/home/crealab/.cagefs/tmp/phpO090gq
py_compile.py000064400000020013151153537440007262 0ustar00"""Routine to "compile" a .py file to a .pyc file.

This module has intimate knowledge of the format of .pyc files.
"""

import enum
import importlib._bootstrap_external
import importlib.machinery
import importlib.util
import os
import os.path
import sys
import traceback

__all__ = ["compile", "main", "PyCompileError", "PycInvalidationMode"]


class PyCompileError(Exception):
    """Exception raised when an error occurs while attempting to
    compile the file.

    To raise this exception, use

        raise PyCompileError(exc_type,exc_value,file[,msg])

    where

        exc_type:   exception type to be used in error message
                    type name can be accesses as class variable
                    'exc_type_name'

        exc_value:  exception value to be used in error message
                    can be accesses as class variable 'exc_value'

        file:       name of file being compiled to be used in error message
                    can be accesses as class variable 'file'

        msg:        string message to be written as error message
                    If no value is given, a default exception message will be
                    given, consistent with 'standard' py_compile output.
                    message (or default) can be accesses as class variable
                    'msg'

    """

    def __init__(self, exc_type, exc_value, file, msg=''):
        exc_type_name = exc_type.__name__
        if exc_type is SyntaxError:
            tbtext = ''.join(traceback.format_exception_only(
                exc_type, exc_value))
            errmsg = tbtext.replace('File "<string>"', 'File "%s"' % file)
        else:
            errmsg = "Sorry: %s: %s" % (exc_type_name,exc_value)

        Exception.__init__(self,msg or errmsg,exc_type_name,exc_value,file)

        self.exc_type_name = exc_type_name
        self.exc_value = exc_value
        self.file = file
        self.msg = msg or errmsg

    def __str__(self):
        return self.msg


class PycInvalidationMode(enum.Enum):
    TIMESTAMP = 1
    CHECKED_HASH = 2
    UNCHECKED_HASH = 3


def _get_default_invalidation_mode():
    if (os.environ.get('SOURCE_DATE_EPOCH') and not
            os.environ.get('RPM_BUILD_ROOT')):
        return PycInvalidationMode.CHECKED_HASH
    else:
        return PycInvalidationMode.TIMESTAMP


def compile(file, cfile=None, dfile=None, doraise=False, optimize=-1,
            invalidation_mode=None, quiet=0):
    """Byte-compile one Python source file to Python bytecode.

    :param file: The source file name.
    :param cfile: The target byte compiled file name.  When not given, this
        defaults to the PEP 3147/PEP 488 location.
    :param dfile: Purported file name, i.e. the file name that shows up in
        error messages.  Defaults to the source file name.
    :param doraise: Flag indicating whether or not an exception should be
        raised when a compile error is found.  If an exception occurs and this
        flag is set to False, a string indicating the nature of the exception
        will be printed, and the function will return to the caller. If an
        exception occurs and this flag is set to True, a PyCompileError
        exception will be raised.
    :param optimize: The optimization level for the compiler.  Valid values
        are -1, 0, 1 and 2.  A value of -1 means to use the optimization
        level of the current interpreter, as given by -O command line options.
    :param invalidation_mode:
    :param quiet: Return full output with False or 0, errors only with 1,
        and no output with 2.

    :return: Path to the resulting byte compiled file.

    Note that it isn't necessary to byte-compile Python modules for
    execution efficiency -- Python itself byte-compiles a module when
    it is loaded, and if it can, writes out the bytecode to the
    corresponding .pyc file.

    However, if a Python installation is shared between users, it is a
    good idea to byte-compile all modules upon installation, since
    other users may not be able to write in the source directories,
    and thus they won't be able to write the .pyc file, and then
    they would be byte-compiling every module each time it is loaded.
    This can slow down program start-up considerably.

    See compileall.py for a script/module that uses this module to
    byte-compile all installed files (or all files in selected
    directories).

    Do note that FileExistsError is raised if cfile ends up pointing at a
    non-regular file or symlink. Because the compilation uses a file renaming,
    the resulting file would be regular and thus not the same type of file as
    it was previously.
    """
    if invalidation_mode is None:
        invalidation_mode = _get_default_invalidation_mode()
    if cfile is None:
        if optimize >= 0:
            optimization = optimize if optimize >= 1 else ''
            cfile = importlib.util.cache_from_source(file,
                                                     optimization=optimization)
        else:
            cfile = importlib.util.cache_from_source(file)
    if os.path.islink(cfile):
        msg = ('{} is a symlink and will be changed into a regular file if '
               'import writes a byte-compiled file to it')
        raise FileExistsError(msg.format(cfile))
    elif os.path.exists(cfile) and not os.path.isfile(cfile):
        msg = ('{} is a non-regular file and will be changed into a regular '
               'one if import writes a byte-compiled file to it')
        raise FileExistsError(msg.format(cfile))
    loader = importlib.machinery.SourceFileLoader('<py_compile>', file)
    source_bytes = loader.get_data(file)
    try:
        code = loader.source_to_code(source_bytes, dfile or file,
                                     _optimize=optimize)
    except Exception as err:
        py_exc = PyCompileError(err.__class__, err, dfile or file)
        if quiet < 2:
            if doraise:
                raise py_exc
            else:
                sys.stderr.write(py_exc.msg + '\n')
        return
    try:
        dirname = os.path.dirname(cfile)
        if dirname:
            os.makedirs(dirname)
    except FileExistsError:
        pass
    if invalidation_mode == PycInvalidationMode.TIMESTAMP:
        source_stats = loader.path_stats(file)
        bytecode = importlib._bootstrap_external._code_to_timestamp_pyc(
            code, source_stats['mtime'], source_stats['size'])
    else:
        source_hash = importlib.util.source_hash(source_bytes)
        bytecode = importlib._bootstrap_external._code_to_hash_pyc(
            code,
            source_hash,
            (invalidation_mode == PycInvalidationMode.CHECKED_HASH),
        )
    mode = importlib._bootstrap_external._calc_mode(file)
    importlib._bootstrap_external._write_atomic(cfile, bytecode, mode)
    return cfile


def main(args=None):
    """Compile several source files.

    The files named in 'args' (or on the command line, if 'args' is
    not specified) are compiled and the resulting bytecode is cached
    in the normal manner.  This function does not search a directory
    structure to locate source files; it only compiles files named
    explicitly.  If '-' is the only parameter in args, the list of
    files is taken from standard input.

    """
    if args is None:
        args = sys.argv[1:]
    rv = 0
    if args == ['-']:
        while True:
            filename = sys.stdin.readline()
            if not filename:
                break
            filename = filename.rstrip('\n')
            try:
                compile(filename, doraise=True)
            except PyCompileError as error:
                rv = 1
                sys.stderr.write("%s\n" % error.msg)
            except OSError as error:
                rv = 1
                sys.stderr.write("%s\n" % error)
    else:
        for filename in args:
            try:
                compile(filename, doraise=True)
            except PyCompileError as error:
                # return value to indicate at least one failure
                rv = 1
                sys.stderr.write("%s\n" % error.msg)
    return rv

if __name__ == "__main__":
    sys.exit(main())
ssl.py000064400000143110151153537440005727 0ustar00# Wrapper module for _ssl, providing some additional facilities
# implemented in Python.  Written by Bill Janssen.

"""This module provides some more Pythonic support for SSL.

Object types:

  SSLSocket -- subtype of socket.socket which does SSL over the socket

Exceptions:

  SSLError -- exception raised for I/O errors

Functions:

  cert_time_to_seconds -- convert time string used for certificate
                          notBefore and notAfter functions to integer
                          seconds past the Epoch (the time values
                          returned from time.time())

  fetch_server_certificate (HOST, PORT) -- fetch the certificate provided
                          by the server running on HOST at port PORT.  No
                          validation of the certificate is performed.

Integer constants:

SSL_ERROR_ZERO_RETURN
SSL_ERROR_WANT_READ
SSL_ERROR_WANT_WRITE
SSL_ERROR_WANT_X509_LOOKUP
SSL_ERROR_SYSCALL
SSL_ERROR_SSL
SSL_ERROR_WANT_CONNECT

SSL_ERROR_EOF
SSL_ERROR_INVALID_ERROR_CODE

The following group define certificate requirements that one side is
allowing/requiring from the other side:

CERT_NONE - no certificates from the other side are required (or will
            be looked at if provided)
CERT_OPTIONAL - certificates are not required, but if provided will be
                validated, and if validation fails, the connection will
                also fail
CERT_REQUIRED - certificates are required, and will be validated, and
                if validation fails, the connection will also fail

The following constants identify various SSL protocol variants:

PROTOCOL_SSLv2
PROTOCOL_SSLv3
PROTOCOL_SSLv23
PROTOCOL_TLS
PROTOCOL_TLS_CLIENT
PROTOCOL_TLS_SERVER
PROTOCOL_TLSv1
PROTOCOL_TLSv1_1
PROTOCOL_TLSv1_2

The following constants identify various SSL alert message descriptions as per
http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-6

ALERT_DESCRIPTION_CLOSE_NOTIFY
ALERT_DESCRIPTION_UNEXPECTED_MESSAGE
ALERT_DESCRIPTION_BAD_RECORD_MAC
ALERT_DESCRIPTION_RECORD_OVERFLOW
ALERT_DESCRIPTION_DECOMPRESSION_FAILURE
ALERT_DESCRIPTION_HANDSHAKE_FAILURE
ALERT_DESCRIPTION_BAD_CERTIFICATE
ALERT_DESCRIPTION_UNSUPPORTED_CERTIFICATE
ALERT_DESCRIPTION_CERTIFICATE_REVOKED
ALERT_DESCRIPTION_CERTIFICATE_EXPIRED
ALERT_DESCRIPTION_CERTIFICATE_UNKNOWN
ALERT_DESCRIPTION_ILLEGAL_PARAMETER
ALERT_DESCRIPTION_UNKNOWN_CA
ALERT_DESCRIPTION_ACCESS_DENIED
ALERT_DESCRIPTION_DECODE_ERROR
ALERT_DESCRIPTION_DECRYPT_ERROR
ALERT_DESCRIPTION_PROTOCOL_VERSION
ALERT_DESCRIPTION_INSUFFICIENT_SECURITY
ALERT_DESCRIPTION_INTERNAL_ERROR
ALERT_DESCRIPTION_USER_CANCELLED
ALERT_DESCRIPTION_NO_RENEGOTIATION
ALERT_DESCRIPTION_UNSUPPORTED_EXTENSION
ALERT_DESCRIPTION_CERTIFICATE_UNOBTAINABLE
ALERT_DESCRIPTION_UNRECOGNIZED_NAME
ALERT_DESCRIPTION_BAD_CERTIFICATE_STATUS_RESPONSE
ALERT_DESCRIPTION_BAD_CERTIFICATE_HASH_VALUE
ALERT_DESCRIPTION_UNKNOWN_PSK_IDENTITY
"""

import sys
import os
from collections import namedtuple
from enum import Enum as _Enum, IntEnum as _IntEnum, IntFlag as _IntFlag

import _ssl             # if we can't import it, let the error propagate

from _ssl import OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_INFO, OPENSSL_VERSION
from _ssl import _SSLContext, MemoryBIO, SSLSession
from _ssl import (
    SSLError, SSLZeroReturnError, SSLWantReadError, SSLWantWriteError,
    SSLSyscallError, SSLEOFError, SSLCertVerificationError
    )
from _ssl import txt2obj as _txt2obj, nid2obj as _nid2obj
from _ssl import RAND_status, RAND_add, RAND_bytes, RAND_pseudo_bytes
try:
    from _ssl import RAND_egd
except ImportError:
    # LibreSSL does not provide RAND_egd
    pass


from _ssl import (
    HAS_SNI, HAS_ECDH, HAS_NPN, HAS_ALPN, HAS_SSLv2, HAS_SSLv3, HAS_TLSv1,
    HAS_TLSv1_1, HAS_TLSv1_2, HAS_TLSv1_3
)
from _ssl import _DEFAULT_CIPHERS, _OPENSSL_API_VERSION


_IntEnum._convert_(
    '_SSLMethod', __name__,
    lambda name: name.startswith('PROTOCOL_') and name != 'PROTOCOL_SSLv23',
    source=_ssl)

_IntFlag._convert_(
    'Options', __name__,
    lambda name: name.startswith('OP_'),
    source=_ssl)

_IntEnum._convert_(
    'AlertDescription', __name__,
    lambda name: name.startswith('ALERT_DESCRIPTION_'),
    source=_ssl)

_IntEnum._convert_(
    'SSLErrorNumber', __name__,
    lambda name: name.startswith('SSL_ERROR_'),
    source=_ssl)

_IntFlag._convert_(
    'VerifyFlags', __name__,
    lambda name: name.startswith('VERIFY_'),
    source=_ssl)

_IntEnum._convert_(
    'VerifyMode', __name__,
    lambda name: name.startswith('CERT_'),
    source=_ssl)

PROTOCOL_SSLv23 = _SSLMethod.PROTOCOL_SSLv23 = _SSLMethod.PROTOCOL_TLS
_PROTOCOL_NAMES = {value: name for name, value in _SSLMethod.__members__.items()}

_SSLv2_IF_EXISTS = getattr(_SSLMethod, 'PROTOCOL_SSLv2', None)


class TLSVersion(_IntEnum):
    MINIMUM_SUPPORTED = _ssl.PROTO_MINIMUM_SUPPORTED
    SSLv3 = _ssl.PROTO_SSLv3
    TLSv1 = _ssl.PROTO_TLSv1
    TLSv1_1 = _ssl.PROTO_TLSv1_1
    TLSv1_2 = _ssl.PROTO_TLSv1_2
    TLSv1_3 = _ssl.PROTO_TLSv1_3
    MAXIMUM_SUPPORTED = _ssl.PROTO_MAXIMUM_SUPPORTED


class _TLSContentType(_IntEnum):
    """Content types (record layer)

    See RFC 8446, section B.1
    """
    CHANGE_CIPHER_SPEC = 20
    ALERT = 21
    HANDSHAKE = 22
    APPLICATION_DATA = 23
    # pseudo content types
    HEADER = 0x100
    INNER_CONTENT_TYPE = 0x101


class _TLSAlertType(_IntEnum):
    """Alert types for TLSContentType.ALERT messages

    See RFC 8466, section B.2
    """
    CLOSE_NOTIFY = 0
    UNEXPECTED_MESSAGE = 10
    BAD_RECORD_MAC = 20
    DECRYPTION_FAILED = 21
    RECORD_OVERFLOW = 22
    DECOMPRESSION_FAILURE = 30
    HANDSHAKE_FAILURE = 40
    NO_CERTIFICATE = 41
    BAD_CERTIFICATE = 42
    UNSUPPORTED_CERTIFICATE = 43
    CERTIFICATE_REVOKED = 44
    CERTIFICATE_EXPIRED = 45
    CERTIFICATE_UNKNOWN = 46
    ILLEGAL_PARAMETER = 47
    UNKNOWN_CA = 48
    ACCESS_DENIED = 49
    DECODE_ERROR = 50
    DECRYPT_ERROR = 51
    EXPORT_RESTRICTION = 60
    PROTOCOL_VERSION = 70
    INSUFFICIENT_SECURITY = 71
    INTERNAL_ERROR = 80
    INAPPROPRIATE_FALLBACK = 86
    USER_CANCELED = 90
    NO_RENEGOTIATION = 100
    MISSING_EXTENSION = 109
    UNSUPPORTED_EXTENSION = 110
    CERTIFICATE_UNOBTAINABLE = 111
    UNRECOGNIZED_NAME = 112
    BAD_CERTIFICATE_STATUS_RESPONSE = 113
    BAD_CERTIFICATE_HASH_VALUE = 114
    UNKNOWN_PSK_IDENTITY = 115
    CERTIFICATE_REQUIRED = 116
    NO_APPLICATION_PROTOCOL = 120


class _TLSMessageType(_IntEnum):
    """Message types (handshake protocol)

    See RFC 8446, section B.3
    """
    HELLO_REQUEST = 0
    CLIENT_HELLO = 1
    SERVER_HELLO = 2
    HELLO_VERIFY_REQUEST = 3
    NEWSESSION_TICKET = 4
    END_OF_EARLY_DATA = 5
    HELLO_RETRY_REQUEST = 6
    ENCRYPTED_EXTENSIONS = 8
    CERTIFICATE = 11
    SERVER_KEY_EXCHANGE = 12
    CERTIFICATE_REQUEST = 13
    SERVER_DONE = 14
    CERTIFICATE_VERIFY = 15
    CLIENT_KEY_EXCHANGE = 16
    FINISHED = 20
    CERTIFICATE_URL = 21
    CERTIFICATE_STATUS = 22
    SUPPLEMENTAL_DATA = 23
    KEY_UPDATE = 24
    NEXT_PROTO = 67
    MESSAGE_HASH = 254
    CHANGE_CIPHER_SPEC = 0x0101


if sys.platform == "win32":
    from _ssl import enum_certificates, enum_crls

from socket import socket, AF_INET, SOCK_STREAM, create_connection
from socket import SOL_SOCKET, SO_TYPE
import socket as _socket
import base64        # for DER-to-PEM translation
import errno
import warnings


socket_error = OSError  # keep that public name in module namespace

CHANNEL_BINDING_TYPES = ['tls-unique']

HAS_NEVER_CHECK_COMMON_NAME = hasattr(_ssl, 'HOSTFLAG_NEVER_CHECK_SUBJECT')


_RESTRICTED_SERVER_CIPHERS = _DEFAULT_CIPHERS

CertificateError = SSLCertVerificationError


def _dnsname_match(dn, hostname):
    """Matching according to RFC 6125, section 6.4.3

    - Hostnames are compared lower case.
    - For IDNA, both dn and hostname must be encoded as IDN A-label (ACE).
    - Partial wildcards like 'www*.example.org', multiple wildcards, sole
      wildcard or wildcards in labels other then the left-most label are not
      supported and a CertificateError is raised.
    - A wildcard must match at least one character.
    """
    if not dn:
        return False

    wildcards = dn.count('*')
    # speed up common case w/o wildcards
    if not wildcards:
        return dn.lower() == hostname.lower()

    if wildcards > 1:
        raise CertificateError(
            "too many wildcards in certificate DNS name: {!r}.".format(dn))

    dn_leftmost, sep, dn_remainder = dn.partition('.')

    if '*' in dn_remainder:
        # Only match wildcard in leftmost segment.
        raise CertificateError(
            "wildcard can only be present in the leftmost label: "
            "{!r}.".format(dn))

    if not sep:
        # no right side
        raise CertificateError(
            "sole wildcard without additional labels are not support: "
            "{!r}.".format(dn))

    if dn_leftmost != '*':
        # no partial wildcard matching
        raise CertificateError(
            "partial wildcards in leftmost label are not supported: "
            "{!r}.".format(dn))

    hostname_leftmost, sep, hostname_remainder = hostname.partition('.')
    if not hostname_leftmost or not sep:
        # wildcard must match at least one char
        return False
    return dn_remainder.lower() == hostname_remainder.lower()


def _inet_paton(ipname):
    """Try to convert an IP address to packed binary form

    Supports IPv4 addresses on all platforms and IPv6 on platforms with IPv6
    support.
    """
    # inet_aton() also accepts strings like '1', '127.1', some also trailing
    # data like '127.0.0.1 whatever'.
    try:
        addr = _socket.inet_aton(ipname)
    except OSError:
        # not an IPv4 address
        pass
    else:
        if _socket.inet_ntoa(addr) == ipname:
            # only accept injective ipnames
            return addr
        else:
            # refuse for short IPv4 notation and additional trailing data
            raise ValueError(
                "{!r} is not a quad-dotted IPv4 address.".format(ipname)
            )

    try:
        return _socket.inet_pton(_socket.AF_INET6, ipname)
    except OSError:
        raise ValueError("{!r} is neither an IPv4 nor an IP6 "
                         "address.".format(ipname))
    except AttributeError:
        # AF_INET6 not available
        pass

    raise ValueError("{!r} is not an IPv4 address.".format(ipname))


def _ipaddress_match(cert_ipaddress, host_ip):
    """Exact matching of IP addresses.

    RFC 6125 explicitly doesn't define an algorithm for this
    (section 1.7.2 - "Out of Scope").
    """
    # OpenSSL may add a trailing newline to a subjectAltName's IP address,
    # commonly woth IPv6 addresses. Strip off trailing \n.
    ip = _inet_paton(cert_ipaddress.rstrip())
    return ip == host_ip


def match_hostname(cert, hostname):
    """Verify that *cert* (in decoded format as returned by
    SSLSocket.getpeercert()) matches the *hostname*.  RFC 2818 and RFC 6125
    rules are followed.

    The function matches IP addresses rather than dNSNames if hostname is a
    valid ipaddress string. IPv4 addresses are supported on all platforms.
    IPv6 addresses are supported on platforms with IPv6 support (AF_INET6
    and inet_pton).

    CertificateError is raised on failure. On success, the function
    returns nothing.
    """
    if not cert:
        raise ValueError("empty or no certificate, match_hostname needs a "
                         "SSL socket or SSL context with either "
                         "CERT_OPTIONAL or CERT_REQUIRED")
    try:
        host_ip = _inet_paton(hostname)
    except ValueError:
        # Not an IP address (common case)
        host_ip = None
    dnsnames = []
    san = cert.get('subjectAltName', ())
    for key, value in san:
        if key == 'DNS':
            if host_ip is None and _dnsname_match(value, hostname):
                return
            dnsnames.append(value)
        elif key == 'IP Address':
            if host_ip is not None and _ipaddress_match(value, host_ip):
                return
            dnsnames.append(value)
    if not dnsnames:
        # The subject is only checked when there is no dNSName entry
        # in subjectAltName
        for sub in cert.get('subject', ()):
            for key, value in sub:
                # XXX according to RFC 2818, the most specific Common Name
                # must be used.
                if key == 'commonName':
                    if _dnsname_match(value, hostname):
                        return
                    dnsnames.append(value)
    if len(dnsnames) > 1:
        raise CertificateError("hostname %r "
            "doesn't match either of %s"
            % (hostname, ', '.join(map(repr, dnsnames))))
    elif len(dnsnames) == 1:
        raise CertificateError("hostname %r "
            "doesn't match %r"
            % (hostname, dnsnames[0]))
    else:
        raise CertificateError("no appropriate commonName or "
            "subjectAltName fields were found")


DefaultVerifyPaths = namedtuple("DefaultVerifyPaths",
    "cafile capath openssl_cafile_env openssl_cafile openssl_capath_env "
    "openssl_capath")

def get_default_verify_paths():
    """Return paths to default cafile and capath.
    """
    parts = _ssl.get_default_verify_paths()

    # environment vars shadow paths
    cafile = os.environ.get(parts[0], parts[1])
    capath = os.environ.get(parts[2], parts[3])

    return DefaultVerifyPaths(cafile if os.path.isfile(cafile) else None,
                              capath if os.path.isdir(capath) else None,
                              *parts)


class _ASN1Object(namedtuple("_ASN1Object", "nid shortname longname oid")):
    """ASN.1 object identifier lookup
    """
    __slots__ = ()

    def __new__(cls, oid):
        return super().__new__(cls, *_txt2obj(oid, name=False))

    @classmethod
    def fromnid(cls, nid):
        """Create _ASN1Object from OpenSSL numeric ID
        """
        return super().__new__(cls, *_nid2obj(nid))

    @classmethod
    def fromname(cls, name):
        """Create _ASN1Object from short name, long name or OID
        """
        return super().__new__(cls, *_txt2obj(name, name=True))


class Purpose(_ASN1Object, _Enum):
    """SSLContext purpose flags with X509v3 Extended Key Usage objects
    """
    SERVER_AUTH = '1.3.6.1.5.5.7.3.1'
    CLIENT_AUTH = '1.3.6.1.5.5.7.3.2'


class SSLContext(_SSLContext):
    """An SSLContext holds various SSL-related configuration options and
    data, such as certificates and possibly a private key."""
    _windows_cert_stores = ("CA", "ROOT")

    sslsocket_class = None  # SSLSocket is assigned later.
    sslobject_class = None  # SSLObject is assigned later.

    def __new__(cls, protocol=PROTOCOL_TLS, *args, **kwargs):
        self = _SSLContext.__new__(cls, protocol)
        return self

    def _encode_hostname(self, hostname):
        if hostname is None:
            return None
        elif isinstance(hostname, str):
            return hostname.encode('idna').decode('ascii')
        else:
            return hostname.decode('ascii')

    def wrap_socket(self, sock, server_side=False,
                    do_handshake_on_connect=True,
                    suppress_ragged_eofs=True,
                    server_hostname=None, session=None):
        # SSLSocket class handles server_hostname encoding before it calls
        # ctx._wrap_socket()
        return self.sslsocket_class._create(
            sock=sock,
            server_side=server_side,
            do_handshake_on_connect=do_handshake_on_connect,
            suppress_ragged_eofs=suppress_ragged_eofs,
            server_hostname=server_hostname,
            context=self,
            session=session
        )

    def wrap_bio(self, incoming, outgoing, server_side=False,
                 server_hostname=None, session=None):
        # Need to encode server_hostname here because _wrap_bio() can only
        # handle ASCII str.
        return self.sslobject_class._create(
            incoming, outgoing, server_side=server_side,
            server_hostname=self._encode_hostname(server_hostname),
            session=session, context=self,
        )

    def set_npn_protocols(self, npn_protocols):
        protos = bytearray()
        for protocol in npn_protocols:
            b = bytes(protocol, 'ascii')
            if len(b) == 0 or len(b) > 255:
                raise SSLError('NPN protocols must be 1 to 255 in length')
            protos.append(len(b))
            protos.extend(b)

        self._set_npn_protocols(protos)

    def set_servername_callback(self, server_name_callback):
        if server_name_callback is None:
            self.sni_callback = None
        else:
            if not callable(server_name_callback):
                raise TypeError("not a callable object")

            def shim_cb(sslobj, servername, sslctx):
                servername = self._encode_hostname(servername)
                return server_name_callback(sslobj, servername, sslctx)

            self.sni_callback = shim_cb

    def set_alpn_protocols(self, alpn_protocols):
        protos = bytearray()
        for protocol in alpn_protocols:
            b = bytes(protocol, 'ascii')
            if len(b) == 0 or len(b) > 255:
                raise SSLError('ALPN protocols must be 1 to 255 in length')
            protos.append(len(b))
            protos.extend(b)

        self._set_alpn_protocols(protos)

    def _load_windows_store_certs(self, storename, purpose):
        certs = bytearray()
        try:
            for cert, encoding, trust in enum_certificates(storename):
                # CA certs are never PKCS#7 encoded
                if encoding == "x509_asn":
                    if trust is True or purpose.oid in trust:
                        certs.extend(cert)
        except PermissionError:
            warnings.warn("unable to enumerate Windows certificate store")
        if certs:
            self.load_verify_locations(cadata=certs)
        return certs

    def load_default_certs(self, purpose=Purpose.SERVER_AUTH):
        if not isinstance(purpose, _ASN1Object):
            raise TypeError(purpose)
        if sys.platform == "win32":
            for storename in self._windows_cert_stores:
                self._load_windows_store_certs(storename, purpose)
        self.set_default_verify_paths()

    if hasattr(_SSLContext, 'minimum_version'):
        @property
        def minimum_version(self):
            return TLSVersion(super().minimum_version)

        @minimum_version.setter
        def minimum_version(self, value):
            if value == TLSVersion.SSLv3:
                self.options &= ~Options.OP_NO_SSLv3
            super(SSLContext, SSLContext).minimum_version.__set__(self, value)

        @property
        def maximum_version(self):
            return TLSVersion(super().maximum_version)

        @maximum_version.setter
        def maximum_version(self, value):
            super(SSLContext, SSLContext).maximum_version.__set__(self, value)

    @property
    def options(self):
        return Options(super().options)

    @options.setter
    def options(self, value):
        super(SSLContext, SSLContext).options.__set__(self, value)

    if hasattr(_ssl, 'HOSTFLAG_NEVER_CHECK_SUBJECT'):
        @property
        def hostname_checks_common_name(self):
            ncs = self._host_flags & _ssl.HOSTFLAG_NEVER_CHECK_SUBJECT
            return ncs != _ssl.HOSTFLAG_NEVER_CHECK_SUBJECT

        @hostname_checks_common_name.setter
        def hostname_checks_common_name(self, value):
            if value:
                self._host_flags &= ~_ssl.HOSTFLAG_NEVER_CHECK_SUBJECT
            else:
                self._host_flags |= _ssl.HOSTFLAG_NEVER_CHECK_SUBJECT
    else:
        @property
        def hostname_checks_common_name(self):
            return True

    @property
    def _msg_callback(self):
        """TLS message callback

        The message callback provides a debugging hook to analyze TLS
        connections. The callback is called for any TLS protocol message
        (header, handshake, alert, and more), but not for application data.
        Due to technical  limitations, the callback can't be used to filter
        traffic or to abort a connection. Any exception raised in the
        callback is delayed until the handshake, read, or write operation
        has been performed.

        def msg_cb(conn, direction, version, content_type, msg_type, data):
            pass

        conn
            :class:`SSLSocket` or :class:`SSLObject` instance
        direction
            ``read`` or ``write``
        version
            :class:`TLSVersion` enum member or int for unknown version. For a
            frame header, it's the header version.
        content_type
            :class:`_TLSContentType` enum member or int for unsupported
            content type.
        msg_type
            Either a :class:`_TLSContentType` enum number for a header
            message, a :class:`_TLSAlertType` enum member for an alert
            message, a :class:`_TLSMessageType` enum member for other
            messages, or int for unsupported message types.
        data
            Raw, decrypted message content as bytes
        """
        inner = super()._msg_callback
        if inner is not None:
            return inner.user_function
        else:
            return None

    @_msg_callback.setter
    def _msg_callback(self, callback):
        if callback is None:
            super(SSLContext, SSLContext)._msg_callback.__set__(self, None)
            return

        if not hasattr(callback, '__call__'):
            raise TypeError(f"{callback} is not callable.")

        def inner(conn, direction, version, content_type, msg_type, data):
            try:
                version = TLSVersion(version)
            except ValueError:
                pass

            try:
                content_type = _TLSContentType(content_type)
            except ValueError:
                pass

            if content_type == _TLSContentType.HEADER:
                msg_enum = _TLSContentType
            elif content_type == _TLSContentType.ALERT:
                msg_enum = _TLSAlertType
            else:
                msg_enum = _TLSMessageType
            try:
                msg_type = msg_enum(msg_type)
            except ValueError:
                pass

            return callback(conn, direction, version,
                            content_type, msg_type, data)

        inner.user_function = callback

        super(SSLContext, SSLContext)._msg_callback.__set__(self, inner)

    @property
    def protocol(self):
        return _SSLMethod(super().protocol)

    @property
    def verify_flags(self):
        return VerifyFlags(super().verify_flags)

    @verify_flags.setter
    def verify_flags(self, value):
        super(SSLContext, SSLContext).verify_flags.__set__(self, value)

    @property
    def verify_mode(self):
        value = super().verify_mode
        try:
            return VerifyMode(value)
        except ValueError:
            return value

    @verify_mode.setter
    def verify_mode(self, value):
        super(SSLContext, SSLContext).verify_mode.__set__(self, value)


def create_default_context(purpose=Purpose.SERVER_AUTH, *, cafile=None,
                           capath=None, cadata=None):
    """Create a SSLContext object with default settings.

    NOTE: The protocol and settings may change anytime without prior
          deprecation. The values represent a fair balance between maximum
          compatibility and security.
    """
    if not isinstance(purpose, _ASN1Object):
        raise TypeError(purpose)

    # SSLContext sets OP_NO_SSLv2, OP_NO_SSLv3, OP_NO_COMPRESSION,
    # OP_CIPHER_SERVER_PREFERENCE, OP_SINGLE_DH_USE and OP_SINGLE_ECDH_USE
    # by default.
    context = SSLContext(PROTOCOL_TLS)

    if purpose == Purpose.SERVER_AUTH:
        # verify certs and host name in client mode
        context.verify_mode = CERT_REQUIRED
        context.check_hostname = True

    if cafile or capath or cadata:
        context.load_verify_locations(cafile, capath, cadata)
    elif context.verify_mode != CERT_NONE:
        # no explicit cafile, capath or cadata but the verify mode is
        # CERT_OPTIONAL or CERT_REQUIRED. Let's try to load default system
        # root CA certificates for the given purpose. This may fail silently.
        context.load_default_certs(purpose)
    # OpenSSL 1.1.1 keylog file
    if hasattr(context, 'keylog_filename'):
        keylogfile = os.environ.get('SSLKEYLOGFILE')
        if keylogfile and not sys.flags.ignore_environment:
            context.keylog_filename = keylogfile
    return context

def _create_unverified_context(protocol=PROTOCOL_TLS, *, cert_reqs=CERT_NONE,
                           check_hostname=False, purpose=Purpose.SERVER_AUTH,
                           certfile=None, keyfile=None,
                           cafile=None, capath=None, cadata=None):
    """Create a SSLContext object for Python stdlib modules

    All Python stdlib modules shall use this function to create SSLContext
    objects in order to keep common settings in one place. The configuration
    is less restrict than create_default_context()'s to increase backward
    compatibility.
    """
    if not isinstance(purpose, _ASN1Object):
        raise TypeError(purpose)

    # SSLContext sets OP_NO_SSLv2, OP_NO_SSLv3, OP_NO_COMPRESSION,
    # OP_CIPHER_SERVER_PREFERENCE, OP_SINGLE_DH_USE and OP_SINGLE_ECDH_USE
    # by default.
    context = SSLContext(protocol)

    if not check_hostname:
        context.check_hostname = False
    if cert_reqs is not None:
        context.verify_mode = cert_reqs
    if check_hostname:
        context.check_hostname = True

    if keyfile and not certfile:
        raise ValueError("certfile must be specified")
    if certfile or keyfile:
        context.load_cert_chain(certfile, keyfile)

    # load CA root certs
    if cafile or capath or cadata:
        context.load_verify_locations(cafile, capath, cadata)
    elif context.verify_mode != CERT_NONE:
        # no explicit cafile, capath or cadata but the verify mode is
        # CERT_OPTIONAL or CERT_REQUIRED. Let's try to load default system
        # root CA certificates for the given purpose. This may fail silently.
        context.load_default_certs(purpose)
    # OpenSSL 1.1.1 keylog file
    if hasattr(context, 'keylog_filename'):
        keylogfile = os.environ.get('SSLKEYLOGFILE')
        if keylogfile and not sys.flags.ignore_environment:
            context.keylog_filename = keylogfile
    return context

# Used by http.client if no context is explicitly passed.
_create_default_https_context = create_default_context


# Backwards compatibility alias, even though it's not a public name.
_create_stdlib_context = _create_unverified_context


class SSLObject:
    """This class implements an interface on top of a low-level SSL object as
    implemented by OpenSSL. This object captures the state of an SSL connection
    but does not provide any network IO itself. IO needs to be performed
    through separate "BIO" objects which are OpenSSL's IO abstraction layer.

    This class does not have a public constructor. Instances are returned by
    ``SSLContext.wrap_bio``. This class is typically used by framework authors
    that want to implement asynchronous IO for SSL through memory buffers.

    When compared to ``SSLSocket``, this object lacks the following features:

     * Any form of network IO, including methods such as ``recv`` and ``send``.
     * The ``do_handshake_on_connect`` and ``suppress_ragged_eofs`` machinery.
    """
    def __init__(self, *args, **kwargs):
        raise TypeError(
            f"{self.__class__.__name__} does not have a public "
            f"constructor. Instances are returned by SSLContext.wrap_bio()."
        )

    @classmethod
    def _create(cls, incoming, outgoing, server_side=False,
                 server_hostname=None, session=None, context=None):
        self = cls.__new__(cls)
        sslobj = context._wrap_bio(
            incoming, outgoing, server_side=server_side,
            server_hostname=server_hostname,
            owner=self, session=session
        )
        self._sslobj = sslobj
        return self

    @property
    def context(self):
        """The SSLContext that is currently in use."""
        return self._sslobj.context

    @context.setter
    def context(self, ctx):
        self._sslobj.context = ctx

    @property
    def session(self):
        """The SSLSession for client socket."""
        return self._sslobj.session

    @session.setter
    def session(self, session):
        self._sslobj.session = session

    @property
    def session_reused(self):
        """Was the client session reused during handshake"""
        return self._sslobj.session_reused

    @property
    def server_side(self):
        """Whether this is a server-side socket."""
        return self._sslobj.server_side

    @property
    def server_hostname(self):
        """The currently set server hostname (for SNI), or ``None`` if no
        server hostname is set."""
        return self._sslobj.server_hostname

    def read(self, len=1024, buffer=None):
        """Read up to 'len' bytes from the SSL object and return them.

        If 'buffer' is provided, read into this buffer and return the number of
        bytes read.
        """
        if buffer is not None:
            v = self._sslobj.read(len, buffer)
        else:
            v = self._sslobj.read(len)
        return v

    def write(self, data):
        """Write 'data' to the SSL object and return the number of bytes
        written.

        The 'data' argument must support the buffer interface.
        """
        return self._sslobj.write(data)

    def getpeercert(self, binary_form=False):
        """Returns a formatted version of the data in the certificate provided
        by the other end of the SSL channel.

        Return None if no certificate was provided, {} if a certificate was
        provided, but not validated.
        """
        return self._sslobj.getpeercert(binary_form)

    def selected_npn_protocol(self):
        """Return the currently selected NPN protocol as a string, or ``None``
        if a next protocol was not negotiated or if NPN is not supported by one
        of the peers."""
        if _ssl.HAS_NPN:
            return self._sslobj.selected_npn_protocol()

    def selected_alpn_protocol(self):
        """Return the currently selected ALPN protocol as a string, or ``None``
        if a next protocol was not negotiated or if ALPN is not supported by one
        of the peers."""
        if _ssl.HAS_ALPN:
            return self._sslobj.selected_alpn_protocol()

    def cipher(self):
        """Return the currently selected cipher as a 3-tuple ``(name,
        ssl_version, secret_bits)``."""
        return self._sslobj.cipher()

    def shared_ciphers(self):
        """Return a list of ciphers shared by the client during the handshake or
        None if this is not a valid server connection.
        """
        return self._sslobj.shared_ciphers()

    def compression(self):
        """Return the current compression algorithm in use, or ``None`` if
        compression was not negotiated or not supported by one of the peers."""
        return self._sslobj.compression()

    def pending(self):
        """Return the number of bytes that can be read immediately."""
        return self._sslobj.pending()

    def do_handshake(self):
        """Start the SSL/TLS handshake."""
        self._sslobj.do_handshake()

    def unwrap(self):
        """Start the SSL shutdown handshake."""
        return self._sslobj.shutdown()

    def get_channel_binding(self, cb_type="tls-unique"):
        """Get channel binding data for current connection.  Raise ValueError
        if the requested `cb_type` is not supported.  Return bytes of the data
        or None if the data is not available (e.g. before the handshake)."""
        return self._sslobj.get_channel_binding(cb_type)

    def version(self):
        """Return a string identifying the protocol version used by the
        current SSL channel. """
        return self._sslobj.version()

    def verify_client_post_handshake(self):
        return self._sslobj.verify_client_post_handshake()


def _sslcopydoc(func):
    """Copy docstring from SSLObject to SSLSocket"""
    func.__doc__ = getattr(SSLObject, func.__name__).__doc__
    return func


class SSLSocket(socket):
    """This class implements a subtype of socket.socket that wraps
    the underlying OS socket in an SSL context when necessary, and
    provides read and write methods over that channel. """

    def __init__(self, *args, **kwargs):
        raise TypeError(
            f"{self.__class__.__name__} does not have a public "
            f"constructor. Instances are returned by "
            f"SSLContext.wrap_socket()."
        )

    @classmethod
    def _create(cls, sock, server_side=False, do_handshake_on_connect=True,
                suppress_ragged_eofs=True, server_hostname=None,
                context=None, session=None):
        if sock.getsockopt(SOL_SOCKET, SO_TYPE) != SOCK_STREAM:
            raise NotImplementedError("only stream sockets are supported")
        if server_side:
            if server_hostname:
                raise ValueError("server_hostname can only be specified "
                                 "in client mode")
            if session is not None:
                raise ValueError("session can only be specified in "
                                 "client mode")
        if context.check_hostname and not server_hostname:
            raise ValueError("check_hostname requires server_hostname")

        kwargs = dict(
            family=sock.family, type=sock.type, proto=sock.proto,
            fileno=sock.fileno()
        )
        self = cls.__new__(cls, **kwargs)
        super(SSLSocket, self).__init__(**kwargs)
        self.settimeout(sock.gettimeout())
        sock.detach()

        self._context = context
        self._session = session
        self._closed = False
        self._sslobj = None
        self.server_side = server_side
        self.server_hostname = context._encode_hostname(server_hostname)
        self.do_handshake_on_connect = do_handshake_on_connect
        self.suppress_ragged_eofs = suppress_ragged_eofs

        # See if we are connected
        try:
            self.getpeername()
        except OSError as e:
            if e.errno != errno.ENOTCONN:
                raise
            connected = False
        else:
            connected = True

        self._connected = connected
        if connected:
            # create the SSL object
            try:
                self._sslobj = self._context._wrap_socket(
                    self, server_side, self.server_hostname,
                    owner=self, session=self._session,
                )
                if do_handshake_on_connect:
                    timeout = self.gettimeout()
                    if timeout == 0.0:
                        # non-blocking
                        raise ValueError("do_handshake_on_connect should not be specified for non-blocking sockets")
                    self.do_handshake()
            except (OSError, ValueError):
                self.close()
                raise
        return self

    @property
    @_sslcopydoc
    def context(self):
        return self._context

    @context.setter
    def context(self, ctx):
        self._context = ctx
        self._sslobj.context = ctx

    @property
    @_sslcopydoc
    def session(self):
        if self._sslobj is not None:
            return self._sslobj.session

    @session.setter
    def session(self, session):
        self._session = session
        if self._sslobj is not None:
            self._sslobj.session = session

    @property
    @_sslcopydoc
    def session_reused(self):
        if self._sslobj is not None:
            return self._sslobj.session_reused

    def dup(self):
        raise NotImplementedError("Can't dup() %s instances" %
                                  self.__class__.__name__)

    def _checkClosed(self, msg=None):
        # raise an exception here if you wish to check for spurious closes
        pass

    def _check_connected(self):
        if not self._connected:
            # getpeername() will raise ENOTCONN if the socket is really
            # not connected; note that we can be connected even without
            # _connected being set, e.g. if connect() first returned
            # EAGAIN.
            self.getpeername()

    def read(self, len=1024, buffer=None):
        """Read up to LEN bytes and return them.
        Return zero-length string on EOF."""

        self._checkClosed()
        if self._sslobj is None:
            raise ValueError("Read on closed or unwrapped SSL socket.")
        try:
            if buffer is not None:
                return self._sslobj.read(len, buffer)
            else:
                return self._sslobj.read(len)
        except SSLError as x:
            if x.args[0] == SSL_ERROR_EOF and self.suppress_ragged_eofs:
                if buffer is not None:
                    return 0
                else:
                    return b''
            else:
                raise

    def write(self, data):
        """Write DATA to the underlying SSL channel.  Returns
        number of bytes of DATA actually transmitted."""

        self._checkClosed()
        if self._sslobj is None:
            raise ValueError("Write on closed or unwrapped SSL socket.")
        return self._sslobj.write(data)

    @_sslcopydoc
    def getpeercert(self, binary_form=False):
        self._checkClosed()
        self._check_connected()
        return self._sslobj.getpeercert(binary_form)

    @_sslcopydoc
    def selected_npn_protocol(self):
        self._checkClosed()
        if self._sslobj is None or not _ssl.HAS_NPN:
            return None
        else:
            return self._sslobj.selected_npn_protocol()

    @_sslcopydoc
    def selected_alpn_protocol(self):
        self._checkClosed()
        if self._sslobj is None or not _ssl.HAS_ALPN:
            return None
        else:
            return self._sslobj.selected_alpn_protocol()

    @_sslcopydoc
    def cipher(self):
        self._checkClosed()
        if self._sslobj is None:
            return None
        else:
            return self._sslobj.cipher()

    @_sslcopydoc
    def shared_ciphers(self):
        self._checkClosed()
        if self._sslobj is None:
            return None
        else:
            return self._sslobj.shared_ciphers()

    @_sslcopydoc
    def compression(self):
        self._checkClosed()
        if self._sslobj is None:
            return None
        else:
            return self._sslobj.compression()

    def send(self, data, flags=0):
        self._checkClosed()
        if self._sslobj is not None:
            if flags != 0:
                raise ValueError(
                    "non-zero flags not allowed in calls to send() on %s" %
                    self.__class__)
            return self._sslobj.write(data)
        else:
            return super().send(data, flags)

    def sendto(self, data, flags_or_addr, addr=None):
        self._checkClosed()
        if self._sslobj is not None:
            raise ValueError("sendto not allowed on instances of %s" %
                             self.__class__)
        elif addr is None:
            return super().sendto(data, flags_or_addr)
        else:
            return super().sendto(data, flags_or_addr, addr)

    def sendmsg(self, *args, **kwargs):
        # Ensure programs don't send data unencrypted if they try to
        # use this method.
        raise NotImplementedError("sendmsg not allowed on instances of %s" %
                                  self.__class__)

    def sendall(self, data, flags=0):
        self._checkClosed()
        if self._sslobj is not None:
            if flags != 0:
                raise ValueError(
                    "non-zero flags not allowed in calls to sendall() on %s" %
                    self.__class__)
            count = 0
            with memoryview(data) as view, view.cast("B") as byte_view:
                amount = len(byte_view)
                while count < amount:
                    v = self.send(byte_view[count:])
                    count += v
        else:
            return super().sendall(data, flags)

    def sendfile(self, file, offset=0, count=None):
        """Send a file, possibly by using os.sendfile() if this is a
        clear-text socket.  Return the total number of bytes sent.
        """
        if self._sslobj is not None:
            return self._sendfile_use_send(file, offset, count)
        else:
            # os.sendfile() works with plain sockets only
            return super().sendfile(file, offset, count)

    def recv(self, buflen=1024, flags=0):
        self._checkClosed()
        if self._sslobj is not None:
            if flags != 0:
                raise ValueError(
                    "non-zero flags not allowed in calls to recv() on %s" %
                    self.__class__)
            return self.read(buflen)
        else:
            return super().recv(buflen, flags)

    def recv_into(self, buffer, nbytes=None, flags=0):
        self._checkClosed()
        if buffer and (nbytes is None):
            nbytes = len(buffer)
        elif nbytes is None:
            nbytes = 1024
        if self._sslobj is not None:
            if flags != 0:
                raise ValueError(
                  "non-zero flags not allowed in calls to recv_into() on %s" %
                  self.__class__)
            return self.read(nbytes, buffer)
        else:
            return super().recv_into(buffer, nbytes, flags)

    def recvfrom(self, buflen=1024, flags=0):
        self._checkClosed()
        if self._sslobj is not None:
            raise ValueError("recvfrom not allowed on instances of %s" %
                             self.__class__)
        else:
            return super().recvfrom(buflen, flags)

    def recvfrom_into(self, buffer, nbytes=None, flags=0):
        self._checkClosed()
        if self._sslobj is not None:
            raise ValueError("recvfrom_into not allowed on instances of %s" %
                             self.__class__)
        else:
            return super().recvfrom_into(buffer, nbytes, flags)

    def recvmsg(self, *args, **kwargs):
        raise NotImplementedError("recvmsg not allowed on instances of %s" %
                                  self.__class__)

    def recvmsg_into(self, *args, **kwargs):
        raise NotImplementedError("recvmsg_into not allowed on instances of "
                                  "%s" % self.__class__)

    @_sslcopydoc
    def pending(self):
        self._checkClosed()
        if self._sslobj is not None:
            return self._sslobj.pending()
        else:
            return 0

    def shutdown(self, how):
        self._checkClosed()
        self._sslobj = None
        super().shutdown(how)

    @_sslcopydoc
    def unwrap(self):
        if self._sslobj:
            s = self._sslobj.shutdown()
            self._sslobj = None
            return s
        else:
            raise ValueError("No SSL wrapper around " + str(self))

    @_sslcopydoc
    def verify_client_post_handshake(self):
        if self._sslobj:
            return self._sslobj.verify_client_post_handshake()
        else:
            raise ValueError("No SSL wrapper around " + str(self))

    def _real_close(self):
        self._sslobj = None
        super()._real_close()

    @_sslcopydoc
    def do_handshake(self, block=False):
        self._check_connected()
        timeout = self.gettimeout()
        try:
            if timeout == 0.0 and block:
                self.settimeout(None)
            self._sslobj.do_handshake()
        finally:
            self.settimeout(timeout)

    def _real_connect(self, addr, connect_ex):
        if self.server_side:
            raise ValueError("can't connect in server-side mode")
        # Here we assume that the socket is client-side, and not
        # connected at the time of the call.  We connect it, then wrap it.
        if self._connected or self._sslobj is not None:
            raise ValueError("attempt to connect already-connected SSLSocket!")
        self._sslobj = self.context._wrap_socket(
            self, False, self.server_hostname,
            owner=self, session=self._session
        )
        try:
            if connect_ex:
                rc = super().connect_ex(addr)
            else:
                rc = None
                super().connect(addr)
            if not rc:
                self._connected = True
                if self.do_handshake_on_connect:
                    self.do_handshake()
            return rc
        except (OSError, ValueError):
            self._sslobj = None
            raise

    def connect(self, addr):
        """Connects to remote ADDR, and then wraps the connection in
        an SSL channel."""
        self._real_connect(addr, False)

    def connect_ex(self, addr):
        """Connects to remote ADDR, and then wraps the connection in
        an SSL channel."""
        return self._real_connect(addr, True)

    def accept(self):
        """Accepts a new connection from a remote client, and returns
        a tuple containing that new connection wrapped with a server-side
        SSL channel, and the address of the remote client."""

        newsock, addr = super().accept()
        newsock = self.context.wrap_socket(newsock,
                    do_handshake_on_connect=self.do_handshake_on_connect,
                    suppress_ragged_eofs=self.suppress_ragged_eofs,
                    server_side=True)
        return newsock, addr

    @_sslcopydoc
    def get_channel_binding(self, cb_type="tls-unique"):
        if self._sslobj is not None:
            return self._sslobj.get_channel_binding(cb_type)
        else:
            if cb_type not in CHANNEL_BINDING_TYPES:
                raise ValueError(
                    "{0} channel binding type not implemented".format(cb_type)
                )
            return None

    @_sslcopydoc
    def version(self):
        if self._sslobj is not None:
            return self._sslobj.version()
        else:
            return None


# Python does not support forward declaration of types.
SSLContext.sslsocket_class = SSLSocket
SSLContext.sslobject_class = SSLObject


def wrap_socket(sock, keyfile=None, certfile=None,
                server_side=False, cert_reqs=CERT_NONE,
                ssl_version=PROTOCOL_TLS, ca_certs=None,
                do_handshake_on_connect=True,
                suppress_ragged_eofs=True,
                ciphers=None):

    if server_side and not certfile:
        raise ValueError("certfile must be specified for server-side "
                         "operations")
    if keyfile and not certfile:
        raise ValueError("certfile must be specified")
    context = SSLContext(ssl_version)
    context.verify_mode = cert_reqs
    if ca_certs:
        context.load_verify_locations(ca_certs)
    if certfile:
        context.load_cert_chain(certfile, keyfile)
    if ciphers:
        context.set_ciphers(ciphers)
    return context.wrap_socket(
        sock=sock, server_side=server_side,
        do_handshake_on_connect=do_handshake_on_connect,
        suppress_ragged_eofs=suppress_ragged_eofs
    )

# some utility functions

def cert_time_to_seconds(cert_time):
    """Return the time in seconds since the Epoch, given the timestring
    representing the "notBefore" or "notAfter" date from a certificate
    in ``"%b %d %H:%M:%S %Y %Z"`` strptime format (C locale).

    "notBefore" or "notAfter" dates must use UTC (RFC 5280).

    Month is one of: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
    UTC should be specified as GMT (see ASN1_TIME_print())
    """
    from time import strptime
    from calendar import timegm

    months = (
        "Jan","Feb","Mar","Apr","May","Jun",
        "Jul","Aug","Sep","Oct","Nov","Dec"
    )
    time_format = ' %d %H:%M:%S %Y GMT' # NOTE: no month, fixed GMT
    try:
        month_number = months.index(cert_time[:3].title()) + 1
    except ValueError:
        raise ValueError('time data %r does not match '
                         'format "%%b%s"' % (cert_time, time_format))
    else:
        # found valid month
        tt = strptime(cert_time[3:], time_format)
        # return an integer, the previous mktime()-based implementation
        # returned a float (fractional seconds are always zero here).
        return timegm((tt[0], month_number) + tt[2:6])

PEM_HEADER = "-----BEGIN CERTIFICATE-----"
PEM_FOOTER = "-----END CERTIFICATE-----"

def DER_cert_to_PEM_cert(der_cert_bytes):
    """Takes a certificate in binary DER format and returns the
    PEM version of it as a string."""

    f = str(base64.standard_b64encode(der_cert_bytes), 'ASCII', 'strict')
    ss = [PEM_HEADER]
    ss += [f[i:i+64] for i in range(0, len(f), 64)]
    ss.append(PEM_FOOTER + '\n')
    return '\n'.join(ss)

def PEM_cert_to_DER_cert(pem_cert_string):
    """Takes a certificate in ASCII PEM format and returns the
    DER-encoded version of it as a byte sequence"""

    if not pem_cert_string.startswith(PEM_HEADER):
        raise ValueError("Invalid PEM encoding; must start with %s"
                         % PEM_HEADER)
    if not pem_cert_string.strip().endswith(PEM_FOOTER):
        raise ValueError("Invalid PEM encoding; must end with %s"
                         % PEM_FOOTER)
    d = pem_cert_string.strip()[len(PEM_HEADER):-len(PEM_FOOTER)]
    return base64.decodebytes(d.encode('ASCII', 'strict'))

def get_server_certificate(addr, ssl_version=PROTOCOL_TLS, ca_certs=None):
    """Retrieve the certificate from the server at the specified address,
    and return it as a PEM-encoded string.
    If 'ca_certs' is specified, validate the server cert against it.
    If 'ssl_version' is specified, use it in the connection attempt."""

    host, port = addr
    if ca_certs is not None:
        cert_reqs = CERT_REQUIRED
    else:
        cert_reqs = CERT_NONE
    context = _create_stdlib_context(ssl_version,
                                     cert_reqs=cert_reqs,
                                     cafile=ca_certs)
    with  create_connection(addr) as sock:
        with context.wrap_socket(sock) as sslsock:
            dercert = sslsock.getpeercert(True)
    return DER_cert_to_PEM_cert(dercert)

def get_protocol_name(protocol_code):
    return _PROTOCOL_NAMES.get(protocol_code, '<unknown>')
pydoc.py000064400000320314151153537440006247 0ustar00"""Generate Python documentation in HTML or text for interactive use.

At the Python interactive prompt, calling help(thing) on a Python object
documents the object, and calling help() starts up an interactive
help session.

Or, at the shell command line outside of Python:

Run "pydoc <name>" to show documentation on something.  <name> may be
the name of a function, module, package, or a dotted reference to a
class or function within a module or module in a package.  If the
argument contains a path segment delimiter (e.g. slash on Unix,
backslash on Windows) it is treated as the path to a Python source file.

Run "pydoc -k <keyword>" to search for a keyword in the synopsis lines
of all available modules.

Run "pydoc -n <hostname>" to start an HTTP server with the given
hostname (default: localhost) on the local machine.

Run "pydoc -p <port>" to start an HTTP server on the given port on the
local machine.  Port number 0 can be used to get an arbitrary unused port.

Run "pydoc -b" to start an HTTP server on an arbitrary unused port and
open a Web browser to interactively browse documentation.  Combine with
the -n and -p options to control the hostname and port used.

Run "pydoc -w <name>" to write out the HTML documentation for a module
to a file named "<name>.html".

Module docs for core modules are assumed to be in

    https://docs.python.org/X.Y/library/

This can be overridden by setting the PYTHONDOCS environment variable
to a different URL or to a local directory containing the Library
Reference Manual pages.
"""
__all__ = ['help']
__author__ = "Ka-Ping Yee <ping@lfw.org>"
__date__ = "26 February 2001"

__credits__ = """Guido van Rossum, for an excellent programming language.
Tommy Burnette, the original creator of manpy.
Paul Prescod, for all his work on onlinehelp.
Richard Chamberlain, for the first implementation of textdoc.
"""

# Known bugs that can't be fixed here:
#   - synopsis() cannot be prevented from clobbering existing
#     loaded modules.
#   - If the __file__ attribute on a module is a relative path and
#     the current directory is changed with os.chdir(), an incorrect
#     path will be displayed.

import builtins
import importlib._bootstrap
import importlib._bootstrap_external
import importlib.machinery
import importlib.util
import inspect
import io
import os
import pkgutil
import platform
import re
import sys
import sysconfig
import time
import tokenize
import urllib.parse
import warnings
from collections import deque
from reprlib import Repr
from traceback import format_exception_only


# --------------------------------------------------------- common routines

def pathdirs():
    """Convert sys.path into a list of absolute, existing, unique paths."""
    dirs = []
    normdirs = []
    for dir in sys.path:
        dir = os.path.abspath(dir or '.')
        normdir = os.path.normcase(dir)
        if normdir not in normdirs and os.path.isdir(dir):
            dirs.append(dir)
            normdirs.append(normdir)
    return dirs

def getdoc(object):
    """Get the doc string or comments for an object."""
    result = inspect.getdoc(object) or inspect.getcomments(object)
    return result and re.sub('^ *\n', '', result.rstrip()) or ''

def splitdoc(doc):
    """Split a doc string into a synopsis line (if any) and the rest."""
    lines = doc.strip().split('\n')
    if len(lines) == 1:
        return lines[0], ''
    elif len(lines) >= 2 and not lines[1].rstrip():
        return lines[0], '\n'.join(lines[2:])
    return '', '\n'.join(lines)

def classname(object, modname):
    """Get a class name and qualify it with a module name if necessary."""
    name = object.__name__
    if object.__module__ != modname:
        name = object.__module__ + '.' + name
    return name

def isdata(object):
    """Check if an object is of a type that probably means it's data."""
    return not (inspect.ismodule(object) or inspect.isclass(object) or
                inspect.isroutine(object) or inspect.isframe(object) or
                inspect.istraceback(object) or inspect.iscode(object))

def replace(text, *pairs):
    """Do a series of global replacements on a string."""
    while pairs:
        text = pairs[1].join(text.split(pairs[0]))
        pairs = pairs[2:]
    return text

def cram(text, maxlen):
    """Omit part of a string if needed to make it fit in a maximum length."""
    if len(text) > maxlen:
        pre = max(0, (maxlen-3)//2)
        post = max(0, maxlen-3-pre)
        return text[:pre] + '...' + text[len(text)-post:]
    return text

_re_stripid = re.compile(r' at 0x[0-9a-f]{6,16}(>+)$', re.IGNORECASE)
def stripid(text):
    """Remove the hexadecimal id from a Python object representation."""
    # The behaviour of %p is implementation-dependent in terms of case.
    return _re_stripid.sub(r'\1', text)

def _is_bound_method(fn):
    """
    Returns True if fn is a bound method, regardless of whether
    fn was implemented in Python or in C.
    """
    if inspect.ismethod(fn):
        return True
    if inspect.isbuiltin(fn):
        self = getattr(fn, '__self__', None)
        return not (inspect.ismodule(self) or (self is None))
    return False


def allmethods(cl):
    methods = {}
    for key, value in inspect.getmembers(cl, inspect.isroutine):
        methods[key] = 1
    for base in cl.__bases__:
        methods.update(allmethods(base)) # all your base are belong to us
    for key in methods.keys():
        methods[key] = getattr(cl, key)
    return methods

def _split_list(s, predicate):
    """Split sequence s via predicate, and return pair ([true], [false]).

    The return value is a 2-tuple of lists,
        ([x for x in s if predicate(x)],
         [x for x in s if not predicate(x)])
    """

    yes = []
    no = []
    for x in s:
        if predicate(x):
            yes.append(x)
        else:
            no.append(x)
    return yes, no

def visiblename(name, all=None, obj=None):
    """Decide whether to show documentation on a variable."""
    # Certain special names are redundant or internal.
    # XXX Remove __initializing__?
    if name in {'__author__', '__builtins__', '__cached__', '__credits__',
                '__date__', '__doc__', '__file__', '__spec__',
                '__loader__', '__module__', '__name__', '__package__',
                '__path__', '__qualname__', '__slots__', '__version__'}:
        return 0
    # Private names are hidden, but special names are displayed.
    if name.startswith('__') and name.endswith('__'): return 1
    # Namedtuples have public fields and methods with a single leading underscore
    if name.startswith('_') and hasattr(obj, '_fields'):
        return True
    if all is not None:
        # only document that which the programmer exported in __all__
        return name in all
    else:
        return not name.startswith('_')

def classify_class_attrs(object):
    """Wrap inspect.classify_class_attrs, with fixup for data descriptors."""
    results = []
    for (name, kind, cls, value) in inspect.classify_class_attrs(object):
        if inspect.isdatadescriptor(value):
            kind = 'data descriptor'
            if isinstance(value, property) and value.fset is None:
                kind = 'readonly property'
        results.append((name, kind, cls, value))
    return results

def sort_attributes(attrs, object):
    'Sort the attrs list in-place by _fields and then alphabetically by name'
    # This allows data descriptors to be ordered according
    # to a _fields attribute if present.
    fields = getattr(object, '_fields', [])
    try:
        field_order = {name : i-len(fields) for (i, name) in enumerate(fields)}
    except TypeError:
        field_order = {}
    keyfunc = lambda attr: (field_order.get(attr[0], 0), attr[0])
    attrs.sort(key=keyfunc)

# ----------------------------------------------------- module manipulation

def ispackage(path):
    """Guess whether a path refers to a package directory."""
    if os.path.isdir(path):
        for ext in ('.py', '.pyc'):
            if os.path.isfile(os.path.join(path, '__init__' + ext)):
                return True
    return False

def source_synopsis(file):
    line = file.readline()
    while line[:1] == '#' or not line.strip():
        line = file.readline()
        if not line: break
    line = line.strip()
    if line[:4] == 'r"""': line = line[1:]
    if line[:3] == '"""':
        line = line[3:]
        if line[-1:] == '\\': line = line[:-1]
        while not line.strip():
            line = file.readline()
            if not line: break
        result = line.split('"""')[0].strip()
    else: result = None
    return result

def synopsis(filename, cache={}):
    """Get the one-line summary out of a module file."""
    mtime = os.stat(filename).st_mtime
    lastupdate, result = cache.get(filename, (None, None))
    if lastupdate is None or lastupdate < mtime:
        # Look for binary suffixes first, falling back to source.
        if filename.endswith(tuple(importlib.machinery.BYTECODE_SUFFIXES)):
            loader_cls = importlib.machinery.SourcelessFileLoader
        elif filename.endswith(tuple(importlib.machinery.EXTENSION_SUFFIXES)):
            loader_cls = importlib.machinery.ExtensionFileLoader
        else:
            loader_cls = None
        # Now handle the choice.
        if loader_cls is None:
            # Must be a source file.
            try:
                file = tokenize.open(filename)
            except OSError:
                # module can't be opened, so skip it
                return None
            # text modules can be directly examined
            with file:
                result = source_synopsis(file)
        else:
            # Must be a binary module, which has to be imported.
            loader = loader_cls('__temp__', filename)
            # XXX We probably don't need to pass in the loader here.
            spec = importlib.util.spec_from_file_location('__temp__', filename,
                                                          loader=loader)
            try:
                module = importlib._bootstrap._load(spec)
            except:
                return None
            del sys.modules['__temp__']
            result = module.__doc__.splitlines()[0] if module.__doc__ else None
        # Cache the result.
        cache[filename] = (mtime, result)
    return result

class ErrorDuringImport(Exception):
    """Errors that occurred while trying to import something to document it."""
    def __init__(self, filename, exc_info):
        self.filename = filename
        self.exc, self.value, self.tb = exc_info

    def __str__(self):
        exc = self.exc.__name__
        return 'problem in %s - %s: %s' % (self.filename, exc, self.value)

def importfile(path):
    """Import a Python source file or compiled file given its path."""
    magic = importlib.util.MAGIC_NUMBER
    with open(path, 'rb') as file:
        is_bytecode = magic == file.read(len(magic))
    filename = os.path.basename(path)
    name, ext = os.path.splitext(filename)
    if is_bytecode:
        loader = importlib._bootstrap_external.SourcelessFileLoader(name, path)
    else:
        loader = importlib._bootstrap_external.SourceFileLoader(name, path)
    # XXX We probably don't need to pass in the loader here.
    spec = importlib.util.spec_from_file_location(name, path, loader=loader)
    try:
        return importlib._bootstrap._load(spec)
    except:
        raise ErrorDuringImport(path, sys.exc_info())

def safeimport(path, forceload=0, cache={}):
    """Import a module; handle errors; return None if the module isn't found.

    If the module *is* found but an exception occurs, it's wrapped in an
    ErrorDuringImport exception and reraised.  Unlike __import__, if a
    package path is specified, the module at the end of the path is returned,
    not the package at the beginning.  If the optional 'forceload' argument
    is 1, we reload the module from disk (unless it's a dynamic extension)."""
    try:
        # If forceload is 1 and the module has been previously loaded from
        # disk, we always have to reload the module.  Checking the file's
        # mtime isn't good enough (e.g. the module could contain a class
        # that inherits from another module that has changed).
        if forceload and path in sys.modules:
            if path not in sys.builtin_module_names:
                # Remove the module from sys.modules and re-import to try
                # and avoid problems with partially loaded modules.
                # Also remove any submodules because they won't appear
                # in the newly loaded module's namespace if they're already
                # in sys.modules.
                subs = [m for m in sys.modules if m.startswith(path + '.')]
                for key in [path] + subs:
                    # Prevent garbage collection.
                    cache[key] = sys.modules[key]
                    del sys.modules[key]
        module = __import__(path)
    except:
        # Did the error occur before or after the module was found?
        (exc, value, tb) = info = sys.exc_info()
        if path in sys.modules:
            # An error occurred while executing the imported module.
            raise ErrorDuringImport(sys.modules[path].__file__, info)
        elif exc is SyntaxError:
            # A SyntaxError occurred before we could execute the module.
            raise ErrorDuringImport(value.filename, info)
        elif issubclass(exc, ImportError) and value.name == path:
            # No such module in the path.
            return None
        else:
            # Some other error occurred during the importing process.
            raise ErrorDuringImport(path, sys.exc_info())
    for part in path.split('.')[1:]:
        try: module = getattr(module, part)
        except AttributeError: return None
    return module

# ---------------------------------------------------- formatter base class

class Doc:

    PYTHONDOCS = os.environ.get("PYTHONDOCS",
                                "https://docs.python.org/%d.%d/library"
                                % sys.version_info[:2])

    def document(self, object, name=None, *args):
        """Generate documentation for an object."""
        args = (object, name) + args
        # 'try' clause is to attempt to handle the possibility that inspect
        # identifies something in a way that pydoc itself has issues handling;
        # think 'super' and how it is a descriptor (which raises the exception
        # by lacking a __name__ attribute) and an instance.
        try:
            if inspect.ismodule(object): return self.docmodule(*args)
            if inspect.isclass(object): return self.docclass(*args)
            if inspect.isroutine(object): return self.docroutine(*args)
        except AttributeError:
            pass
        if inspect.isdatadescriptor(object): return self.docdata(*args)
        return self.docother(*args)

    def fail(self, object, name=None, *args):
        """Raise an exception for unimplemented types."""
        message = "don't know how to document object%s of type %s" % (
            name and ' ' + repr(name), type(object).__name__)
        raise TypeError(message)

    docmodule = docclass = docroutine = docother = docproperty = docdata = fail

    def getdocloc(self, object, basedir=sysconfig.get_path('stdlib')):
        """Return the location of module docs or None"""

        try:
            file = inspect.getabsfile(object)
        except TypeError:
            file = '(built-in)'

        docloc = os.environ.get("PYTHONDOCS", self.PYTHONDOCS)

        basedir = os.path.normcase(basedir)
        if (isinstance(object, type(os)) and
            (object.__name__ in ('errno', 'exceptions', 'gc', 'imp',
                                 'marshal', 'posix', 'signal', 'sys',
                                 '_thread', 'zipimport') or
             (file.startswith(basedir) and
              not file.startswith(os.path.join(basedir, 'site-packages')))) and
            object.__name__ not in ('xml.etree', 'test.pydoc_mod')):
            if docloc.startswith(("http://", "https://")):
                docloc = "%s/%s" % (docloc.rstrip("/"), object.__name__.lower())
            else:
                docloc = os.path.join(docloc, object.__name__.lower() + ".html")
        else:
            docloc = None
        return docloc

# -------------------------------------------- HTML documentation generator

class HTMLRepr(Repr):
    """Class for safely making an HTML representation of a Python object."""
    def __init__(self):
        Repr.__init__(self)
        self.maxlist = self.maxtuple = 20
        self.maxdict = 10
        self.maxstring = self.maxother = 100

    def escape(self, text):
        return replace(text, '&', '&amp;', '<', '&lt;', '>', '&gt;')

    def repr(self, object):
        return Repr.repr(self, object)

    def repr1(self, x, level):
        if hasattr(type(x), '__name__'):
            methodname = 'repr_' + '_'.join(type(x).__name__.split())
            if hasattr(self, methodname):
                return getattr(self, methodname)(x, level)
        return self.escape(cram(stripid(repr(x)), self.maxother))

    def repr_string(self, x, level):
        test = cram(x, self.maxstring)
        testrepr = repr(test)
        if '\\' in test and '\\' not in replace(testrepr, r'\\', ''):
            # Backslashes are only literal in the string and are never
            # needed to make any special characters, so show a raw string.
            return 'r' + testrepr[0] + self.escape(test) + testrepr[0]
        return re.sub(r'((\\[\\abfnrtv\'"]|\\[0-9]..|\\x..|\\u....)+)',
                      r'<font color="#c040c0">\1</font>',
                      self.escape(testrepr))

    repr_str = repr_string

    def repr_instance(self, x, level):
        try:
            return self.escape(cram(stripid(repr(x)), self.maxstring))
        except:
            return self.escape('<%s instance>' % x.__class__.__name__)

    repr_unicode = repr_string

class HTMLDoc(Doc):
    """Formatter class for HTML documentation."""

    # ------------------------------------------- HTML formatting utilities

    _repr_instance = HTMLRepr()
    repr = _repr_instance.repr
    escape = _repr_instance.escape

    def page(self, title, contents):
        """Format an HTML page."""
        return '''\
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: %s</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body bgcolor="#f0f0f8">
%s
</body></html>''' % (title, contents)

    def heading(self, title, fgcol, bgcol, extras=''):
        """Format a page heading."""
        return '''
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="%s">
<td valign=bottom>&nbsp;<br>
<font color="%s" face="helvetica, arial">&nbsp;<br>%s</font></td
><td align=right valign=bottom
><font color="%s" face="helvetica, arial">%s</font></td></tr></table>
    ''' % (bgcol, fgcol, title, fgcol, extras or '&nbsp;')

    def section(self, title, fgcol, bgcol, contents, width=6,
                prelude='', marginalia=None, gap='&nbsp;'):
        """Format a section with a heading."""
        if marginalia is None:
            marginalia = '<tt>' + '&nbsp;' * width + '</tt>'
        result = '''<p>
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="%s">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="%s" face="helvetica, arial">%s</font></td></tr>
    ''' % (bgcol, fgcol, title)
        if prelude:
            result = result + '''
<tr bgcolor="%s"><td rowspan=2>%s</td>
<td colspan=2>%s</td></tr>
<tr><td>%s</td>''' % (bgcol, marginalia, prelude, gap)
        else:
            result = result + '''
<tr><td bgcolor="%s">%s</td><td>%s</td>''' % (bgcol, marginalia, gap)

        return result + '\n<td width="100%%">%s</td></tr></table>' % contents

    def bigsection(self, title, *args):
        """Format a section with a big heading."""
        title = '<big><strong>%s</strong></big>' % title
        return self.section(title, *args)

    def preformat(self, text):
        """Format literal preformatted text."""
        text = self.escape(text.expandtabs())
        return replace(text, '\n\n', '\n \n', '\n\n', '\n \n',
                             ' ', '&nbsp;', '\n', '<br>\n')

    def multicolumn(self, list, format, cols=4):
        """Format a list of items into a multi-column list."""
        result = ''
        rows = (len(list)+cols-1)//cols
        for col in range(cols):
            result = result + '<td width="%d%%" valign=top>' % (100//cols)
            for i in range(rows*col, rows*col+rows):
                if i < len(list):
                    result = result + format(list[i]) + '<br>\n'
            result = result + '</td>'
        return '<table width="100%%" summary="list"><tr>%s</tr></table>' % result

    def grey(self, text): return '<font color="#909090">%s</font>' % text

    def namelink(self, name, *dicts):
        """Make a link for an identifier, given name-to-URL mappings."""
        for dict in dicts:
            if name in dict:
                return '<a href="%s">%s</a>' % (dict[name], name)
        return name

    def classlink(self, object, modname):
        """Make a link for a class."""
        name, module = object.__name__, sys.modules.get(object.__module__)
        if hasattr(module, name) and getattr(module, name) is object:
            return '<a href="%s.html#%s">%s</a>' % (
                module.__name__, name, classname(object, modname))
        return classname(object, modname)

    def modulelink(self, object):
        """Make a link for a module."""
        return '<a href="%s.html">%s</a>' % (object.__name__, object.__name__)

    def modpkglink(self, modpkginfo):
        """Make a link for a module or package to display in an index."""
        name, path, ispackage, shadowed = modpkginfo
        if shadowed:
            return self.grey(name)
        if path:
            url = '%s.%s.html' % (path, name)
        else:
            url = '%s.html' % name
        if ispackage:
            text = '<strong>%s</strong>&nbsp;(package)' % name
        else:
            text = name
        return '<a href="%s">%s</a>' % (url, text)

    def filelink(self, url, path):
        """Make a link to source file."""
        return '<a href="file:%s">%s</a>' % (url, path)

    def markup(self, text, escape=None, funcs={}, classes={}, methods={}):
        """Mark up some plain text, given a context of symbols to look for.
        Each context dictionary maps object names to anchor names."""
        escape = escape or self.escape
        results = []
        here = 0
        pattern = re.compile(r'\b((http|ftp)://\S+[\w/]|'
                                r'RFC[- ]?(\d+)|'
                                r'PEP[- ]?(\d+)|'
                                r'(self\.)?(\w+))')
        while True:
            match = pattern.search(text, here)
            if not match: break
            start, end = match.span()
            results.append(escape(text[here:start]))

            all, scheme, rfc, pep, selfdot, name = match.groups()
            if scheme:
                url = escape(all).replace('"', '&quot;')
                results.append('<a href="%s">%s</a>' % (url, url))
            elif rfc:
                url = 'http://www.rfc-editor.org/rfc/rfc%d.txt' % int(rfc)
                results.append('<a href="%s">%s</a>' % (url, escape(all)))
            elif pep:
                url = 'http://www.python.org/dev/peps/pep-%04d/' % int(pep)
                results.append('<a href="%s">%s</a>' % (url, escape(all)))
            elif selfdot:
                # Create a link for methods like 'self.method(...)'
                # and use <strong> for attributes like 'self.attr'
                if text[end:end+1] == '(':
                    results.append('self.' + self.namelink(name, methods))
                else:
                    results.append('self.<strong>%s</strong>' % name)
            elif text[end:end+1] == '(':
                results.append(self.namelink(name, methods, funcs, classes))
            else:
                results.append(self.namelink(name, classes))
            here = end
        results.append(escape(text[here:]))
        return ''.join(results)

    # ---------------------------------------------- type-specific routines

    def formattree(self, tree, modname, parent=None):
        """Produce HTML for a class tree as given by inspect.getclasstree()."""
        result = ''
        for entry in tree:
            if type(entry) is type(()):
                c, bases = entry
                result = result + '<dt><font face="helvetica, arial">'
                result = result + self.classlink(c, modname)
                if bases and bases != (parent,):
                    parents = []
                    for base in bases:
                        parents.append(self.classlink(base, modname))
                    result = result + '(' + ', '.join(parents) + ')'
                result = result + '\n</font></dt>'
            elif type(entry) is type([]):
                result = result + '<dd>\n%s</dd>\n' % self.formattree(
                    entry, modname, c)
        return '<dl>\n%s</dl>\n' % result

    def docmodule(self, object, name=None, mod=None, *ignored):
        """Produce HTML documentation for a module object."""
        name = object.__name__ # ignore the passed-in name
        try:
            all = object.__all__
        except AttributeError:
            all = None
        parts = name.split('.')
        links = []
        for i in range(len(parts)-1):
            links.append(
                '<a href="%s.html"><font color="#ffffff">%s</font></a>' %
                ('.'.join(parts[:i+1]), parts[i]))
        linkedname = '.'.join(links + parts[-1:])
        head = '<big><big><strong>%s</strong></big></big>' % linkedname
        try:
            path = inspect.getabsfile(object)
            url = urllib.parse.quote(path)
            filelink = self.filelink(url, path)
        except TypeError:
            filelink = '(built-in)'
        info = []
        if hasattr(object, '__version__'):
            version = str(object.__version__)
            if version[:11] == '$' + 'Revision: ' and version[-1:] == '$':
                version = version[11:-1].strip()
            info.append('version %s' % self.escape(version))
        if hasattr(object, '__date__'):
            info.append(self.escape(str(object.__date__)))
        if info:
            head = head + ' (%s)' % ', '.join(info)
        docloc = self.getdocloc(object)
        if docloc is not None:
            docloc = '<br><a href="%(docloc)s">Module Reference</a>' % locals()
        else:
            docloc = ''
        result = self.heading(
            head, '#ffffff', '#7799ee',
            '<a href=".">index</a><br>' + filelink + docloc)

        modules = inspect.getmembers(object, inspect.ismodule)

        classes, cdict = [], {}
        for key, value in inspect.getmembers(object, inspect.isclass):
            # if __all__ exists, believe it.  Otherwise use old heuristic.
            if (all is not None or
                (inspect.getmodule(value) or object) is object):
                if visiblename(key, all, object):
                    classes.append((key, value))
                    cdict[key] = cdict[value] = '#' + key
        for key, value in classes:
            for base in value.__bases__:
                key, modname = base.__name__, base.__module__
                module = sys.modules.get(modname)
                if modname != name and module and hasattr(module, key):
                    if getattr(module, key) is base:
                        if not key in cdict:
                            cdict[key] = cdict[base] = modname + '.html#' + key
        funcs, fdict = [], {}
        for key, value in inspect.getmembers(object, inspect.isroutine):
            # if __all__ exists, believe it.  Otherwise use old heuristic.
            if (all is not None or
                inspect.isbuiltin(value) or inspect.getmodule(value) is object):
                if visiblename(key, all, object):
                    funcs.append((key, value))
                    fdict[key] = '#-' + key
                    if inspect.isfunction(value): fdict[value] = fdict[key]
        data = []
        for key, value in inspect.getmembers(object, isdata):
            if visiblename(key, all, object):
                data.append((key, value))

        doc = self.markup(getdoc(object), self.preformat, fdict, cdict)
        doc = doc and '<tt>%s</tt>' % doc
        result = result + '<p>%s</p>\n' % doc

        if hasattr(object, '__path__'):
            modpkgs = []
            for importer, modname, ispkg in pkgutil.iter_modules(object.__path__):
                modpkgs.append((modname, name, ispkg, 0))
            modpkgs.sort()
            contents = self.multicolumn(modpkgs, self.modpkglink)
            result = result + self.bigsection(
                'Package Contents', '#ffffff', '#aa55cc', contents)
        elif modules:
            contents = self.multicolumn(
                modules, lambda t: self.modulelink(t[1]))
            result = result + self.bigsection(
                'Modules', '#ffffff', '#aa55cc', contents)

        if classes:
            classlist = [value for (key, value) in classes]
            contents = [
                self.formattree(inspect.getclasstree(classlist, 1), name)]
            for key, value in classes:
                contents.append(self.document(value, key, name, fdict, cdict))
            result = result + self.bigsection(
                'Classes', '#ffffff', '#ee77aa', ' '.join(contents))
        if funcs:
            contents = []
            for key, value in funcs:
                contents.append(self.document(value, key, name, fdict, cdict))
            result = result + self.bigsection(
                'Functions', '#ffffff', '#eeaa77', ' '.join(contents))
        if data:
            contents = []
            for key, value in data:
                contents.append(self.document(value, key))
            result = result + self.bigsection(
                'Data', '#ffffff', '#55aa55', '<br>\n'.join(contents))
        if hasattr(object, '__author__'):
            contents = self.markup(str(object.__author__), self.preformat)
            result = result + self.bigsection(
                'Author', '#ffffff', '#7799ee', contents)
        if hasattr(object, '__credits__'):
            contents = self.markup(str(object.__credits__), self.preformat)
            result = result + self.bigsection(
                'Credits', '#ffffff', '#7799ee', contents)

        return result

    def docclass(self, object, name=None, mod=None, funcs={}, classes={},
                 *ignored):
        """Produce HTML documentation for a class object."""
        realname = object.__name__
        name = name or realname
        bases = object.__bases__

        contents = []
        push = contents.append

        # Cute little class to pump out a horizontal rule between sections.
        class HorizontalRule:
            def __init__(self):
                self.needone = 0
            def maybe(self):
                if self.needone:
                    push('<hr>\n')
                self.needone = 1
        hr = HorizontalRule()

        # List the mro, if non-trivial.
        mro = deque(inspect.getmro(object))
        if len(mro) > 2:
            hr.maybe()
            push('<dl><dt>Method resolution order:</dt>\n')
            for base in mro:
                push('<dd>%s</dd>\n' % self.classlink(base,
                                                      object.__module__))
            push('</dl>\n')

        def spill(msg, attrs, predicate):
            ok, attrs = _split_list(attrs, predicate)
            if ok:
                hr.maybe()
                push(msg)
                for name, kind, homecls, value in ok:
                    try:
                        value = getattr(object, name)
                    except Exception:
                        # Some descriptors may meet a failure in their __get__.
                        # (bug #1785)
                        push(self.docdata(value, name, mod))
                    else:
                        push(self.document(value, name, mod,
                                        funcs, classes, mdict, object))
                    push('\n')
            return attrs

        def spilldescriptors(msg, attrs, predicate):
            ok, attrs = _split_list(attrs, predicate)
            if ok:
                hr.maybe()
                push(msg)
                for name, kind, homecls, value in ok:
                    push(self.docdata(value, name, mod))
            return attrs

        def spilldata(msg, attrs, predicate):
            ok, attrs = _split_list(attrs, predicate)
            if ok:
                hr.maybe()
                push(msg)
                for name, kind, homecls, value in ok:
                    base = self.docother(getattr(object, name), name, mod)
                    if callable(value) or inspect.isdatadescriptor(value):
                        doc = getattr(value, "__doc__", None)
                    else:
                        doc = None
                    if doc is None:
                        push('<dl><dt>%s</dl>\n' % base)
                    else:
                        doc = self.markup(getdoc(value), self.preformat,
                                          funcs, classes, mdict)
                        doc = '<dd><tt>%s</tt>' % doc
                        push('<dl><dt>%s%s</dl>\n' % (base, doc))
                    push('\n')
            return attrs

        attrs = [(name, kind, cls, value)
                 for name, kind, cls, value in classify_class_attrs(object)
                 if visiblename(name, obj=object)]

        mdict = {}
        for key, kind, homecls, value in attrs:
            mdict[key] = anchor = '#' + name + '-' + key
            try:
                value = getattr(object, name)
            except Exception:
                # Some descriptors may meet a failure in their __get__.
                # (bug #1785)
                pass
            try:
                # The value may not be hashable (e.g., a data attr with
                # a dict or list value).
                mdict[value] = anchor
            except TypeError:
                pass

        while attrs:
            if mro:
                thisclass = mro.popleft()
            else:
                thisclass = attrs[0][2]
            attrs, inherited = _split_list(attrs, lambda t: t[2] is thisclass)

            if object is not builtins.object and thisclass is builtins.object:
                attrs = inherited
                continue
            elif thisclass is object:
                tag = 'defined here'
            else:
                tag = 'inherited from %s' % self.classlink(thisclass,
                                                           object.__module__)
            tag += ':<br>\n'

            sort_attributes(attrs, object)

            # Pump out the attrs, segregated by kind.
            attrs = spill('Methods %s' % tag, attrs,
                          lambda t: t[1] == 'method')
            attrs = spill('Class methods %s' % tag, attrs,
                          lambda t: t[1] == 'class method')
            attrs = spill('Static methods %s' % tag, attrs,
                          lambda t: t[1] == 'static method')
            attrs = spilldescriptors("Readonly properties %s" % tag, attrs,
                                     lambda t: t[1] == 'readonly property')
            attrs = spilldescriptors('Data descriptors %s' % tag, attrs,
                                     lambda t: t[1] == 'data descriptor')
            attrs = spilldata('Data and other attributes %s' % tag, attrs,
                              lambda t: t[1] == 'data')
            assert attrs == []
            attrs = inherited

        contents = ''.join(contents)

        if name == realname:
            title = '<a name="%s">class <strong>%s</strong></a>' % (
                name, realname)
        else:
            title = '<strong>%s</strong> = <a name="%s">class %s</a>' % (
                name, name, realname)
        if bases:
            parents = []
            for base in bases:
                parents.append(self.classlink(base, object.__module__))
            title = title + '(%s)' % ', '.join(parents)

        decl = ''
        try:
            signature = inspect.signature(object)
        except (ValueError, TypeError):
            signature = None
        if signature:
            argspec = str(signature)
            if argspec and argspec != '()':
                decl = name + self.escape(argspec) + '\n\n'

        doc = getdoc(object)
        if decl:
            doc = decl + (doc or '')
        doc = self.markup(doc, self.preformat, funcs, classes, mdict)
        doc = doc and '<tt>%s<br>&nbsp;</tt>' % doc

        return self.section(title, '#000000', '#ffc8d8', contents, 3, doc)

    def formatvalue(self, object):
        """Format an argument default value as text."""
        return self.grey('=' + self.repr(object))

    def docroutine(self, object, name=None, mod=None,
                   funcs={}, classes={}, methods={}, cl=None):
        """Produce HTML documentation for a function or method object."""
        realname = object.__name__
        name = name or realname
        anchor = (cl and cl.__name__ or '') + '-' + name
        note = ''
        skipdocs = 0
        if _is_bound_method(object):
            imclass = object.__self__.__class__
            if cl:
                if imclass is not cl:
                    note = ' from ' + self.classlink(imclass, mod)
            else:
                if object.__self__ is not None:
                    note = ' method of %s instance' % self.classlink(
                        object.__self__.__class__, mod)
                else:
                    note = ' unbound %s method' % self.classlink(imclass,mod)

        if (inspect.iscoroutinefunction(object) or
                inspect.isasyncgenfunction(object)):
            asyncqualifier = 'async '
        else:
            asyncqualifier = ''

        if name == realname:
            title = '<a name="%s"><strong>%s</strong></a>' % (anchor, realname)
        else:
            if cl and inspect.getattr_static(cl, realname, []) is object:
                reallink = '<a href="#%s">%s</a>' % (
                    cl.__name__ + '-' + realname, realname)
                skipdocs = 1
            else:
                reallink = realname
            title = '<a name="%s"><strong>%s</strong></a> = %s' % (
                anchor, name, reallink)
        argspec = None
        if inspect.isroutine(object):
            try:
                signature = inspect.signature(object)
            except (ValueError, TypeError):
                signature = None
            if signature:
                argspec = str(signature)
                if realname == '<lambda>':
                    title = '<strong>%s</strong> <em>lambda</em> ' % name
                    # XXX lambda's won't usually have func_annotations['return']
                    # since the syntax doesn't support but it is possible.
                    # So removing parentheses isn't truly safe.
                    argspec = argspec[1:-1] # remove parentheses
        if not argspec:
            argspec = '(...)'

        decl = asyncqualifier + title + self.escape(argspec) + (note and
               self.grey('<font face="helvetica, arial">%s</font>' % note))

        if skipdocs:
            return '<dl><dt>%s</dt></dl>\n' % decl
        else:
            doc = self.markup(
                getdoc(object), self.preformat, funcs, classes, methods)
            doc = doc and '<dd><tt>%s</tt></dd>' % doc
            return '<dl><dt>%s</dt>%s</dl>\n' % (decl, doc)

    def docdata(self, object, name=None, mod=None, cl=None):
        """Produce html documentation for a data descriptor."""
        results = []
        push = results.append

        if name:
            push('<dl><dt><strong>%s</strong></dt>\n' % name)
        doc = self.markup(getdoc(object), self.preformat)
        if doc:
            push('<dd><tt>%s</tt></dd>\n' % doc)
        push('</dl>\n')

        return ''.join(results)

    docproperty = docdata

    def docother(self, object, name=None, mod=None, *ignored):
        """Produce HTML documentation for a data object."""
        lhs = name and '<strong>%s</strong> = ' % name or ''
        return lhs + self.repr(object)

    def index(self, dir, shadowed=None):
        """Generate an HTML index for a directory of modules."""
        modpkgs = []
        if shadowed is None: shadowed = {}
        for importer, name, ispkg in pkgutil.iter_modules([dir]):
            if any((0xD800 <= ord(ch) <= 0xDFFF) for ch in name):
                # ignore a module if its name contains a surrogate character
                continue
            modpkgs.append((name, '', ispkg, name in shadowed))
            shadowed[name] = 1

        modpkgs.sort()
        contents = self.multicolumn(modpkgs, self.modpkglink)
        return self.bigsection(dir, '#ffffff', '#ee77aa', contents)

# -------------------------------------------- text documentation generator

class TextRepr(Repr):
    """Class for safely making a text representation of a Python object."""
    def __init__(self):
        Repr.__init__(self)
        self.maxlist = self.maxtuple = 20
        self.maxdict = 10
        self.maxstring = self.maxother = 100

    def repr1(self, x, level):
        if hasattr(type(x), '__name__'):
            methodname = 'repr_' + '_'.join(type(x).__name__.split())
            if hasattr(self, methodname):
                return getattr(self, methodname)(x, level)
        return cram(stripid(repr(x)), self.maxother)

    def repr_string(self, x, level):
        test = cram(x, self.maxstring)
        testrepr = repr(test)
        if '\\' in test and '\\' not in replace(testrepr, r'\\', ''):
            # Backslashes are only literal in the string and are never
            # needed to make any special characters, so show a raw string.
            return 'r' + testrepr[0] + test + testrepr[0]
        return testrepr

    repr_str = repr_string

    def repr_instance(self, x, level):
        try:
            return cram(stripid(repr(x)), self.maxstring)
        except:
            return '<%s instance>' % x.__class__.__name__

class TextDoc(Doc):
    """Formatter class for text documentation."""

    # ------------------------------------------- text formatting utilities

    _repr_instance = TextRepr()
    repr = _repr_instance.repr

    def bold(self, text):
        """Format a string in bold by overstriking."""
        return ''.join(ch + '\b' + ch for ch in text)

    def indent(self, text, prefix='    '):
        """Indent text by prepending a given prefix to each line."""
        if not text: return ''
        lines = [prefix + line for line in text.split('\n')]
        if lines: lines[-1] = lines[-1].rstrip()
        return '\n'.join(lines)

    def section(self, title, contents):
        """Format a section with a given heading."""
        clean_contents = self.indent(contents).rstrip()
        return self.bold(title) + '\n' + clean_contents + '\n\n'

    # ---------------------------------------------- type-specific routines

    def formattree(self, tree, modname, parent=None, prefix=''):
        """Render in text a class tree as returned by inspect.getclasstree()."""
        result = ''
        for entry in tree:
            if type(entry) is type(()):
                c, bases = entry
                result = result + prefix + classname(c, modname)
                if bases and bases != (parent,):
                    parents = (classname(c, modname) for c in bases)
                    result = result + '(%s)' % ', '.join(parents)
                result = result + '\n'
            elif type(entry) is type([]):
                result = result + self.formattree(
                    entry, modname, c, prefix + '    ')
        return result

    def docmodule(self, object, name=None, mod=None):
        """Produce text documentation for a given module object."""
        name = object.__name__ # ignore the passed-in name
        synop, desc = splitdoc(getdoc(object))
        result = self.section('NAME', name + (synop and ' - ' + synop))
        all = getattr(object, '__all__', None)
        docloc = self.getdocloc(object)
        if docloc is not None:
            result = result + self.section('MODULE REFERENCE', docloc + """

The following documentation is automatically generated from the Python
source files.  It may be incomplete, incorrect or include features that
are considered implementation detail and may vary between Python
implementations.  When in doubt, consult the module reference at the
location listed above.
""")

        if desc:
            result = result + self.section('DESCRIPTION', desc)

        classes = []
        for key, value in inspect.getmembers(object, inspect.isclass):
            # if __all__ exists, believe it.  Otherwise use old heuristic.
            if (all is not None
                or (inspect.getmodule(value) or object) is object):
                if visiblename(key, all, object):
                    classes.append((key, value))
        funcs = []
        for key, value in inspect.getmembers(object, inspect.isroutine):
            # if __all__ exists, believe it.  Otherwise use old heuristic.
            if (all is not None or
                inspect.isbuiltin(value) or inspect.getmodule(value) is object):
                if visiblename(key, all, object):
                    funcs.append((key, value))
        data = []
        for key, value in inspect.getmembers(object, isdata):
            if visiblename(key, all, object):
                data.append((key, value))

        modpkgs = []
        modpkgs_names = set()
        if hasattr(object, '__path__'):
            for importer, modname, ispkg in pkgutil.iter_modules(object.__path__):
                modpkgs_names.add(modname)
                if ispkg:
                    modpkgs.append(modname + ' (package)')
                else:
                    modpkgs.append(modname)

            modpkgs.sort()
            result = result + self.section(
                'PACKAGE CONTENTS', '\n'.join(modpkgs))

        # Detect submodules as sometimes created by C extensions
        submodules = []
        for key, value in inspect.getmembers(object, inspect.ismodule):
            if value.__name__.startswith(name + '.') and key not in modpkgs_names:
                submodules.append(key)
        if submodules:
            submodules.sort()
            result = result + self.section(
                'SUBMODULES', '\n'.join(submodules))

        if classes:
            classlist = [value for key, value in classes]
            contents = [self.formattree(
                inspect.getclasstree(classlist, 1), name)]
            for key, value in classes:
                contents.append(self.document(value, key, name))
            result = result + self.section('CLASSES', '\n'.join(contents))

        if funcs:
            contents = []
            for key, value in funcs:
                contents.append(self.document(value, key, name))
            result = result + self.section('FUNCTIONS', '\n'.join(contents))

        if data:
            contents = []
            for key, value in data:
                contents.append(self.docother(value, key, name, maxlen=70))
            result = result + self.section('DATA', '\n'.join(contents))

        if hasattr(object, '__version__'):
            version = str(object.__version__)
            if version[:11] == '$' + 'Revision: ' and version[-1:] == '$':
                version = version[11:-1].strip()
            result = result + self.section('VERSION', version)
        if hasattr(object, '__date__'):
            result = result + self.section('DATE', str(object.__date__))
        if hasattr(object, '__author__'):
            result = result + self.section('AUTHOR', str(object.__author__))
        if hasattr(object, '__credits__'):
            result = result + self.section('CREDITS', str(object.__credits__))
        try:
            file = inspect.getabsfile(object)
        except TypeError:
            file = '(built-in)'
        result = result + self.section('FILE', file)
        return result

    def docclass(self, object, name=None, mod=None, *ignored):
        """Produce text documentation for a given class object."""
        realname = object.__name__
        name = name or realname
        bases = object.__bases__

        def makename(c, m=object.__module__):
            return classname(c, m)

        if name == realname:
            title = 'class ' + self.bold(realname)
        else:
            title = self.bold(name) + ' = class ' + realname
        if bases:
            parents = map(makename, bases)
            title = title + '(%s)' % ', '.join(parents)

        contents = []
        push = contents.append

        try:
            signature = inspect.signature(object)
        except (ValueError, TypeError):
            signature = None
        if signature:
            argspec = str(signature)
            if argspec and argspec != '()':
                push(name + argspec + '\n')

        doc = getdoc(object)
        if doc:
            push(doc + '\n')

        # List the mro, if non-trivial.
        mro = deque(inspect.getmro(object))
        if len(mro) > 2:
            push("Method resolution order:")
            for base in mro:
                push('    ' + makename(base))
            push('')

        # List the built-in subclasses, if any:
        subclasses = sorted(
            (str(cls.__name__) for cls in type.__subclasses__(object)
             if not cls.__name__.startswith("_") and cls.__module__ == "builtins"),
            key=str.lower
        )
        no_of_subclasses = len(subclasses)
        MAX_SUBCLASSES_TO_DISPLAY = 4
        if subclasses:
            push("Built-in subclasses:")
            for subclassname in subclasses[:MAX_SUBCLASSES_TO_DISPLAY]:
                push('    ' + subclassname)
            if no_of_subclasses > MAX_SUBCLASSES_TO_DISPLAY:
                push('    ... and ' +
                     str(no_of_subclasses - MAX_SUBCLASSES_TO_DISPLAY) +
                     ' other subclasses')
            push('')

        # Cute little class to pump out a horizontal rule between sections.
        class HorizontalRule:
            def __init__(self):
                self.needone = 0
            def maybe(self):
                if self.needone:
                    push('-' * 70)
                self.needone = 1
        hr = HorizontalRule()

        def spill(msg, attrs, predicate):
            ok, attrs = _split_list(attrs, predicate)
            if ok:
                hr.maybe()
                push(msg)
                for name, kind, homecls, value in ok:
                    try:
                        value = getattr(object, name)
                    except Exception:
                        # Some descriptors may meet a failure in their __get__.
                        # (bug #1785)
                        push(self.docdata(value, name, mod))
                    else:
                        push(self.document(value,
                                        name, mod, object))
            return attrs

        def spilldescriptors(msg, attrs, predicate):
            ok, attrs = _split_list(attrs, predicate)
            if ok:
                hr.maybe()
                push(msg)
                for name, kind, homecls, value in ok:
                    push(self.docdata(value, name, mod))
            return attrs

        def spilldata(msg, attrs, predicate):
            ok, attrs = _split_list(attrs, predicate)
            if ok:
                hr.maybe()
                push(msg)
                for name, kind, homecls, value in ok:
                    if callable(value) or inspect.isdatadescriptor(value):
                        doc = getdoc(value)
                    else:
                        doc = None
                    try:
                        obj = getattr(object, name)
                    except AttributeError:
                        obj = homecls.__dict__[name]
                    push(self.docother(obj, name, mod, maxlen=70, doc=doc) +
                         '\n')
            return attrs

        attrs = [(name, kind, cls, value)
                 for name, kind, cls, value in classify_class_attrs(object)
                 if visiblename(name, obj=object)]

        while attrs:
            if mro:
                thisclass = mro.popleft()
            else:
                thisclass = attrs[0][2]
            attrs, inherited = _split_list(attrs, lambda t: t[2] is thisclass)

            if object is not builtins.object and thisclass is builtins.object:
                attrs = inherited
                continue
            elif thisclass is object:
                tag = "defined here"
            else:
                tag = "inherited from %s" % classname(thisclass,
                                                      object.__module__)

            sort_attributes(attrs, object)

            # Pump out the attrs, segregated by kind.
            attrs = spill("Methods %s:\n" % tag, attrs,
                          lambda t: t[1] == 'method')
            attrs = spill("Class methods %s:\n" % tag, attrs,
                          lambda t: t[1] == 'class method')
            attrs = spill("Static methods %s:\n" % tag, attrs,
                          lambda t: t[1] == 'static method')
            attrs = spilldescriptors("Readonly properties %s:\n" % tag, attrs,
                                     lambda t: t[1] == 'readonly property')
            attrs = spilldescriptors("Data descriptors %s:\n" % tag, attrs,
                                     lambda t: t[1] == 'data descriptor')
            attrs = spilldata("Data and other attributes %s:\n" % tag, attrs,
                              lambda t: t[1] == 'data')

            assert attrs == []
            attrs = inherited

        contents = '\n'.join(contents)
        if not contents:
            return title + '\n'
        return title + '\n' + self.indent(contents.rstrip(), ' |  ') + '\n'

    def formatvalue(self, object):
        """Format an argument default value as text."""
        return '=' + self.repr(object)

    def docroutine(self, object, name=None, mod=None, cl=None):
        """Produce text documentation for a function or method object."""
        realname = object.__name__
        name = name or realname
        note = ''
        skipdocs = 0
        if _is_bound_method(object):
            imclass = object.__self__.__class__
            if cl:
                if imclass is not cl:
                    note = ' from ' + classname(imclass, mod)
            else:
                if object.__self__ is not None:
                    note = ' method of %s instance' % classname(
                        object.__self__.__class__, mod)
                else:
                    note = ' unbound %s method' % classname(imclass,mod)

        if (inspect.iscoroutinefunction(object) or
                inspect.isasyncgenfunction(object)):
            asyncqualifier = 'async '
        else:
            asyncqualifier = ''

        if name == realname:
            title = self.bold(realname)
        else:
            if cl and inspect.getattr_static(cl, realname, []) is object:
                skipdocs = 1
            title = self.bold(name) + ' = ' + realname
        argspec = None

        if inspect.isroutine(object):
            try:
                signature = inspect.signature(object)
            except (ValueError, TypeError):
                signature = None
            if signature:
                argspec = str(signature)
                if realname == '<lambda>':
                    title = self.bold(name) + ' lambda '
                    # XXX lambda's won't usually have func_annotations['return']
                    # since the syntax doesn't support but it is possible.
                    # So removing parentheses isn't truly safe.
                    argspec = argspec[1:-1] # remove parentheses
        if not argspec:
            argspec = '(...)'
        decl = asyncqualifier + title + argspec + note

        if skipdocs:
            return decl + '\n'
        else:
            doc = getdoc(object) or ''
            return decl + '\n' + (doc and self.indent(doc).rstrip() + '\n')

    def docdata(self, object, name=None, mod=None, cl=None):
        """Produce text documentation for a data descriptor."""
        results = []
        push = results.append

        if name:
            push(self.bold(name))
            push('\n')
        doc = getdoc(object) or ''
        if doc:
            push(self.indent(doc))
            push('\n')
        return ''.join(results)

    docproperty = docdata

    def docother(self, object, name=None, mod=None, parent=None, maxlen=None, doc=None):
        """Produce text documentation for a data object."""
        repr = self.repr(object)
        if maxlen:
            line = (name and name + ' = ' or '') + repr
            chop = maxlen - len(line)
            if chop < 0: repr = repr[:chop] + '...'
        line = (name and self.bold(name) + ' = ' or '') + repr
        if doc is not None:
            line += '\n' + self.indent(str(doc))
        return line

class _PlainTextDoc(TextDoc):
    """Subclass of TextDoc which overrides string styling"""
    def bold(self, text):
        return text

# --------------------------------------------------------- user interfaces

def pager(text):
    """The first time this is called, determine what kind of pager to use."""
    global pager
    pager = getpager()
    pager(text)

def getpager():
    """Decide what method to use for paging through text."""
    if not hasattr(sys.stdin, "isatty"):
        return plainpager
    if not hasattr(sys.stdout, "isatty"):
        return plainpager
    if not sys.stdin.isatty() or not sys.stdout.isatty():
        return plainpager
    use_pager = os.environ.get('MANPAGER') or os.environ.get('PAGER')
    if use_pager:
        if sys.platform == 'win32': # pipes completely broken in Windows
            return lambda text: tempfilepager(plain(text), use_pager)
        elif os.environ.get('TERM') in ('dumb', 'emacs'):
            return lambda text: pipepager(plain(text), use_pager)
        else:
            return lambda text: pipepager(text, use_pager)
    if os.environ.get('TERM') in ('dumb', 'emacs'):
        return plainpager
    if sys.platform == 'win32':
        return lambda text: tempfilepager(plain(text), 'more <')
    if hasattr(os, 'system') and os.system('(less) 2>/dev/null') == 0:
        return lambda text: pipepager(text, 'less')

    import tempfile
    (fd, filename) = tempfile.mkstemp()
    os.close(fd)
    try:
        if hasattr(os, 'system') and os.system('more "%s"' % filename) == 0:
            return lambda text: pipepager(text, 'more')
        else:
            return ttypager
    finally:
        os.unlink(filename)

def plain(text):
    """Remove boldface formatting from text."""
    return re.sub('.\b', '', text)

def pipepager(text, cmd):
    """Page through text by feeding it to another program."""
    import subprocess
    proc = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE)
    try:
        with io.TextIOWrapper(proc.stdin, errors='backslashreplace') as pipe:
            try:
                pipe.write(text)
            except KeyboardInterrupt:
                # We've hereby abandoned whatever text hasn't been written,
                # but the pager is still in control of the terminal.
                pass
    except OSError:
        pass # Ignore broken pipes caused by quitting the pager program.
    while True:
        try:
            proc.wait()
            break
        except KeyboardInterrupt:
            # Ignore ctl-c like the pager itself does.  Otherwise the pager is
            # left running and the terminal is in raw mode and unusable.
            pass

def tempfilepager(text, cmd):
    """Page through text by invoking a program on a temporary file."""
    import tempfile
    with tempfile.TemporaryDirectory() as tempdir:
        filename = os.path.join(tempdir, 'pydoc.out')
        with open(filename, 'w', errors='backslashreplace',
                  encoding=os.device_encoding(0) if
                  sys.platform == 'win32' else None
                  ) as file:
            file.write(text)
        os.system(cmd + ' "' + filename + '"')

def _escape_stdout(text):
    # Escape non-encodable characters to avoid encoding errors later
    encoding = getattr(sys.stdout, 'encoding', None) or 'utf-8'
    return text.encode(encoding, 'backslashreplace').decode(encoding)

def ttypager(text):
    """Page through text on a text terminal."""
    lines = plain(_escape_stdout(text)).split('\n')
    try:
        import tty
        fd = sys.stdin.fileno()
        old = tty.tcgetattr(fd)
        tty.setcbreak(fd)
        getchar = lambda: sys.stdin.read(1)
    except (ImportError, AttributeError, io.UnsupportedOperation):
        tty = None
        getchar = lambda: sys.stdin.readline()[:-1][:1]

    try:
        try:
            h = int(os.environ.get('LINES', 0))
        except ValueError:
            h = 0
        if h <= 1:
            h = 25
        r = inc = h - 1
        sys.stdout.write('\n'.join(lines[:inc]) + '\n')
        while lines[r:]:
            sys.stdout.write('-- more --')
            sys.stdout.flush()
            c = getchar()

            if c in ('q', 'Q'):
                sys.stdout.write('\r          \r')
                break
            elif c in ('\r', '\n'):
                sys.stdout.write('\r          \r' + lines[r] + '\n')
                r = r + 1
                continue
            if c in ('b', 'B', '\x1b'):
                r = r - inc - inc
                if r < 0: r = 0
            sys.stdout.write('\n' + '\n'.join(lines[r:r+inc]) + '\n')
            r = r + inc

    finally:
        if tty:
            tty.tcsetattr(fd, tty.TCSAFLUSH, old)

def plainpager(text):
    """Simply print unformatted text.  This is the ultimate fallback."""
    sys.stdout.write(plain(_escape_stdout(text)))

def describe(thing):
    """Produce a short description of the given thing."""
    if inspect.ismodule(thing):
        if thing.__name__ in sys.builtin_module_names:
            return 'built-in module ' + thing.__name__
        if hasattr(thing, '__path__'):
            return 'package ' + thing.__name__
        else:
            return 'module ' + thing.__name__
    if inspect.isbuiltin(thing):
        return 'built-in function ' + thing.__name__
    if inspect.isgetsetdescriptor(thing):
        return 'getset descriptor %s.%s.%s' % (
            thing.__objclass__.__module__, thing.__objclass__.__name__,
            thing.__name__)
    if inspect.ismemberdescriptor(thing):
        return 'member descriptor %s.%s.%s' % (
            thing.__objclass__.__module__, thing.__objclass__.__name__,
            thing.__name__)
    if inspect.isclass(thing):
        return 'class ' + thing.__name__
    if inspect.isfunction(thing):
        return 'function ' + thing.__name__
    if inspect.ismethod(thing):
        return 'method ' + thing.__name__
    return type(thing).__name__

def locate(path, forceload=0):
    """Locate an object by name or dotted path, importing as necessary."""
    parts = [part for part in path.split('.') if part]
    module, n = None, 0
    while n < len(parts):
        nextmodule = safeimport('.'.join(parts[:n+1]), forceload)
        if nextmodule: module, n = nextmodule, n + 1
        else: break
    if module:
        object = module
    else:
        object = builtins
    for part in parts[n:]:
        try:
            object = getattr(object, part)
        except AttributeError:
            return None
    return object

# --------------------------------------- interactive interpreter interface

text = TextDoc()
plaintext = _PlainTextDoc()
html = HTMLDoc()

def resolve(thing, forceload=0):
    """Given an object or a path to an object, get the object and its name."""
    if isinstance(thing, str):
        object = locate(thing, forceload)
        if object is None:
            raise ImportError('''\
No Python documentation found for %r.
Use help() to get the interactive help utility.
Use help(str) for help on the str class.''' % thing)
        return object, thing
    else:
        name = getattr(thing, '__name__', None)
        return thing, name if isinstance(name, str) else None

def render_doc(thing, title='Python Library Documentation: %s', forceload=0,
        renderer=None):
    """Render text documentation, given an object or a path to an object."""
    if renderer is None:
        renderer = text
    object, name = resolve(thing, forceload)
    desc = describe(object)
    module = inspect.getmodule(object)
    if name and '.' in name:
        desc += ' in ' + name[:name.rfind('.')]
    elif module and module is not object:
        desc += ' in module ' + module.__name__

    if not (inspect.ismodule(object) or
              inspect.isclass(object) or
              inspect.isroutine(object) or
              inspect.isdatadescriptor(object)):
        # If the passed object is a piece of data or an instance,
        # document its available methods instead of its value.
        object = type(object)
        desc += ' object'
    return title % desc + '\n\n' + renderer.document(object, name)

def doc(thing, title='Python Library Documentation: %s', forceload=0,
        output=None):
    """Display text documentation, given an object or a path to an object."""
    try:
        if output is None:
            pager(render_doc(thing, title, forceload))
        else:
            output.write(render_doc(thing, title, forceload, plaintext))
    except (ImportError, ErrorDuringImport) as value:
        print(value)

def writedoc(thing, forceload=0):
    """Write HTML documentation to a file in the current directory."""
    try:
        object, name = resolve(thing, forceload)
        page = html.page(describe(object), html.document(object, name))
        with open(name + '.html', 'w', encoding='utf-8') as file:
            file.write(page)
        print('wrote', name + '.html')
    except (ImportError, ErrorDuringImport) as value:
        print(value)

def writedocs(dir, pkgpath='', done=None):
    """Write out HTML documentation for all modules in a directory tree."""
    if done is None: done = {}
    for importer, modname, ispkg in pkgutil.walk_packages([dir], pkgpath):
        writedoc(modname)
    return

class Helper:

    # These dictionaries map a topic name to either an alias, or a tuple
    # (label, seealso-items).  The "label" is the label of the corresponding
    # section in the .rst file under Doc/ and an index into the dictionary
    # in pydoc_data/topics.py.
    #
    # CAUTION: if you change one of these dictionaries, be sure to adapt the
    #          list of needed labels in Doc/tools/extensions/pyspecific.py and
    #          regenerate the pydoc_data/topics.py file by running
    #              make pydoc-topics
    #          in Doc/ and copying the output file into the Lib/ directory.

    keywords = {
        'False': '',
        'None': '',
        'True': '',
        'and': 'BOOLEAN',
        'as': 'with',
        'assert': ('assert', ''),
        'async': ('async', ''),
        'await': ('await', ''),
        'break': ('break', 'while for'),
        'class': ('class', 'CLASSES SPECIALMETHODS'),
        'continue': ('continue', 'while for'),
        'def': ('function', ''),
        'del': ('del', 'BASICMETHODS'),
        'elif': 'if',
        'else': ('else', 'while for'),
        'except': 'try',
        'finally': 'try',
        'for': ('for', 'break continue while'),
        'from': 'import',
        'global': ('global', 'nonlocal NAMESPACES'),
        'if': ('if', 'TRUTHVALUE'),
        'import': ('import', 'MODULES'),
        'in': ('in', 'SEQUENCEMETHODS'),
        'is': 'COMPARISON',
        'lambda': ('lambda', 'FUNCTIONS'),
        'nonlocal': ('nonlocal', 'global NAMESPACES'),
        'not': 'BOOLEAN',
        'or': 'BOOLEAN',
        'pass': ('pass', ''),
        'raise': ('raise', 'EXCEPTIONS'),
        'return': ('return', 'FUNCTIONS'),
        'try': ('try', 'EXCEPTIONS'),
        'while': ('while', 'break continue if TRUTHVALUE'),
        'with': ('with', 'CONTEXTMANAGERS EXCEPTIONS yield'),
        'yield': ('yield', ''),
    }
    # Either add symbols to this dictionary or to the symbols dictionary
    # directly: Whichever is easier. They are merged later.
    _strprefixes = [p + q for p in ('b', 'f', 'r', 'u') for q in ("'", '"')]
    _symbols_inverse = {
        'STRINGS' : ("'", "'''", '"', '"""', *_strprefixes),
        'OPERATORS' : ('+', '-', '*', '**', '/', '//', '%', '<<', '>>', '&',
                       '|', '^', '~', '<', '>', '<=', '>=', '==', '!=', '<>'),
        'COMPARISON' : ('<', '>', '<=', '>=', '==', '!=', '<>'),
        'UNARY' : ('-', '~'),
        'AUGMENTEDASSIGNMENT' : ('+=', '-=', '*=', '/=', '%=', '&=', '|=',
                                '^=', '<<=', '>>=', '**=', '//='),
        'BITWISE' : ('<<', '>>', '&', '|', '^', '~'),
        'COMPLEX' : ('j', 'J')
    }
    symbols = {
        '%': 'OPERATORS FORMATTING',
        '**': 'POWER',
        ',': 'TUPLES LISTS FUNCTIONS',
        '.': 'ATTRIBUTES FLOAT MODULES OBJECTS',
        '...': 'ELLIPSIS',
        ':': 'SLICINGS DICTIONARYLITERALS',
        '@': 'def class',
        '\\': 'STRINGS',
        '_': 'PRIVATENAMES',
        '__': 'PRIVATENAMES SPECIALMETHODS',
        '`': 'BACKQUOTES',
        '(': 'TUPLES FUNCTIONS CALLS',
        ')': 'TUPLES FUNCTIONS CALLS',
        '[': 'LISTS SUBSCRIPTS SLICINGS',
        ']': 'LISTS SUBSCRIPTS SLICINGS'
    }
    for topic, symbols_ in _symbols_inverse.items():
        for symbol in symbols_:
            topics = symbols.get(symbol, topic)
            if topic not in topics:
                topics = topics + ' ' + topic
            symbols[symbol] = topics

    topics = {
        'TYPES': ('types', 'STRINGS UNICODE NUMBERS SEQUENCES MAPPINGS '
                  'FUNCTIONS CLASSES MODULES FILES inspect'),
        'STRINGS': ('strings', 'str UNICODE SEQUENCES STRINGMETHODS '
                    'FORMATTING TYPES'),
        'STRINGMETHODS': ('string-methods', 'STRINGS FORMATTING'),
        'FORMATTING': ('formatstrings', 'OPERATORS'),
        'UNICODE': ('strings', 'encodings unicode SEQUENCES STRINGMETHODS '
                    'FORMATTING TYPES'),
        'NUMBERS': ('numbers', 'INTEGER FLOAT COMPLEX TYPES'),
        'INTEGER': ('integers', 'int range'),
        'FLOAT': ('floating', 'float math'),
        'COMPLEX': ('imaginary', 'complex cmath'),
        'SEQUENCES': ('typesseq', 'STRINGMETHODS FORMATTING range LISTS'),
        'MAPPINGS': 'DICTIONARIES',
        'FUNCTIONS': ('typesfunctions', 'def TYPES'),
        'METHODS': ('typesmethods', 'class def CLASSES TYPES'),
        'CODEOBJECTS': ('bltin-code-objects', 'compile FUNCTIONS TYPES'),
        'TYPEOBJECTS': ('bltin-type-objects', 'types TYPES'),
        'FRAMEOBJECTS': 'TYPES',
        'TRACEBACKS': 'TYPES',
        'NONE': ('bltin-null-object', ''),
        'ELLIPSIS': ('bltin-ellipsis-object', 'SLICINGS'),
        'SPECIALATTRIBUTES': ('specialattrs', ''),
        'CLASSES': ('types', 'class SPECIALMETHODS PRIVATENAMES'),
        'MODULES': ('typesmodules', 'import'),
        'PACKAGES': 'import',
        'EXPRESSIONS': ('operator-summary', 'lambda or and not in is BOOLEAN '
                        'COMPARISON BITWISE SHIFTING BINARY FORMATTING POWER '
                        'UNARY ATTRIBUTES SUBSCRIPTS SLICINGS CALLS TUPLES '
                        'LISTS DICTIONARIES'),
        'OPERATORS': 'EXPRESSIONS',
        'PRECEDENCE': 'EXPRESSIONS',
        'OBJECTS': ('objects', 'TYPES'),
        'SPECIALMETHODS': ('specialnames', 'BASICMETHODS ATTRIBUTEMETHODS '
                           'CALLABLEMETHODS SEQUENCEMETHODS MAPPINGMETHODS '
                           'NUMBERMETHODS CLASSES'),
        'BASICMETHODS': ('customization', 'hash repr str SPECIALMETHODS'),
        'ATTRIBUTEMETHODS': ('attribute-access', 'ATTRIBUTES SPECIALMETHODS'),
        'CALLABLEMETHODS': ('callable-types', 'CALLS SPECIALMETHODS'),
        'SEQUENCEMETHODS': ('sequence-types', 'SEQUENCES SEQUENCEMETHODS '
                             'SPECIALMETHODS'),
        'MAPPINGMETHODS': ('sequence-types', 'MAPPINGS SPECIALMETHODS'),
        'NUMBERMETHODS': ('numeric-types', 'NUMBERS AUGMENTEDASSIGNMENT '
                          'SPECIALMETHODS'),
        'EXECUTION': ('execmodel', 'NAMESPACES DYNAMICFEATURES EXCEPTIONS'),
        'NAMESPACES': ('naming', 'global nonlocal ASSIGNMENT DELETION DYNAMICFEATURES'),
        'DYNAMICFEATURES': ('dynamic-features', ''),
        'SCOPING': 'NAMESPACES',
        'FRAMES': 'NAMESPACES',
        'EXCEPTIONS': ('exceptions', 'try except finally raise'),
        'CONVERSIONS': ('conversions', ''),
        'IDENTIFIERS': ('identifiers', 'keywords SPECIALIDENTIFIERS'),
        'SPECIALIDENTIFIERS': ('id-classes', ''),
        'PRIVATENAMES': ('atom-identifiers', ''),
        'LITERALS': ('atom-literals', 'STRINGS NUMBERS TUPLELITERALS '
                     'LISTLITERALS DICTIONARYLITERALS'),
        'TUPLES': 'SEQUENCES',
        'TUPLELITERALS': ('exprlists', 'TUPLES LITERALS'),
        'LISTS': ('typesseq-mutable', 'LISTLITERALS'),
        'LISTLITERALS': ('lists', 'LISTS LITERALS'),
        'DICTIONARIES': ('typesmapping', 'DICTIONARYLITERALS'),
        'DICTIONARYLITERALS': ('dict', 'DICTIONARIES LITERALS'),
        'ATTRIBUTES': ('attribute-references', 'getattr hasattr setattr ATTRIBUTEMETHODS'),
        'SUBSCRIPTS': ('subscriptions', 'SEQUENCEMETHODS'),
        'SLICINGS': ('slicings', 'SEQUENCEMETHODS'),
        'CALLS': ('calls', 'EXPRESSIONS'),
        'POWER': ('power', 'EXPRESSIONS'),
        'UNARY': ('unary', 'EXPRESSIONS'),
        'BINARY': ('binary', 'EXPRESSIONS'),
        'SHIFTING': ('shifting', 'EXPRESSIONS'),
        'BITWISE': ('bitwise', 'EXPRESSIONS'),
        'COMPARISON': ('comparisons', 'EXPRESSIONS BASICMETHODS'),
        'BOOLEAN': ('booleans', 'EXPRESSIONS TRUTHVALUE'),
        'ASSERTION': 'assert',
        'ASSIGNMENT': ('assignment', 'AUGMENTEDASSIGNMENT'),
        'AUGMENTEDASSIGNMENT': ('augassign', 'NUMBERMETHODS'),
        'DELETION': 'del',
        'RETURNING': 'return',
        'IMPORTING': 'import',
        'CONDITIONAL': 'if',
        'LOOPING': ('compound', 'for while break continue'),
        'TRUTHVALUE': ('truth', 'if while and or not BASICMETHODS'),
        'DEBUGGING': ('debugger', 'pdb'),
        'CONTEXTMANAGERS': ('context-managers', 'with'),
    }

    def __init__(self, input=None, output=None):
        self._input = input
        self._output = output

    @property
    def input(self):
        return self._input or sys.stdin

    @property
    def output(self):
        return self._output or sys.stdout

    def __repr__(self):
        if inspect.stack()[1][3] == '?':
            self()
            return ''
        return '<%s.%s instance>' % (self.__class__.__module__,
                                     self.__class__.__qualname__)

    _GoInteractive = object()
    def __call__(self, request=_GoInteractive):
        if request is not self._GoInteractive:
            self.help(request)
        else:
            self.intro()
            self.interact()
            self.output.write('''
You are now leaving help and returning to the Python interpreter.
If you want to ask for help on a particular object directly from the
interpreter, you can type "help(object)".  Executing "help('string')"
has the same effect as typing a particular string at the help> prompt.
''')

    def interact(self):
        self.output.write('\n')
        while True:
            try:
                request = self.getline('help> ')
                if not request: break
            except (KeyboardInterrupt, EOFError):
                break
            request = request.strip()

            # Make sure significant trailing quoting marks of literals don't
            # get deleted while cleaning input
            if (len(request) > 2 and request[0] == request[-1] in ("'", '"')
                    and request[0] not in request[1:-1]):
                request = request[1:-1]
            if request.lower() in ('q', 'quit'): break
            if request == 'help':
                self.intro()
            else:
                self.help(request)

    def getline(self, prompt):
        """Read one line, using input() when appropriate."""
        if self.input is sys.stdin:
            return input(prompt)
        else:
            self.output.write(prompt)
            self.output.flush()
            return self.input.readline()

    def help(self, request):
        if type(request) is type(''):
            request = request.strip()
            if request == 'keywords': self.listkeywords()
            elif request == 'symbols': self.listsymbols()
            elif request == 'topics': self.listtopics()
            elif request == 'modules': self.listmodules()
            elif request[:8] == 'modules ':
                self.listmodules(request.split()[1])
            elif request in self.symbols: self.showsymbol(request)
            elif request in ['True', 'False', 'None']:
                # special case these keywords since they are objects too
                doc(eval(request), 'Help on %s:')
            elif request in self.keywords: self.showtopic(request)
            elif request in self.topics: self.showtopic(request)
            elif request: doc(request, 'Help on %s:', output=self._output)
            else: doc(str, 'Help on %s:', output=self._output)
        elif isinstance(request, Helper): self()
        else: doc(request, 'Help on %s:', output=self._output)
        self.output.write('\n')

    def intro(self):
        self.output.write('''
Welcome to Python {0}'s help utility!

If this is your first time using Python, you should definitely check out
the tutorial on the Internet at https://docs.python.org/{0}/tutorial/.

Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules.  To quit this help utility and
return to the interpreter, just type "quit".

To get a list of available modules, keywords, symbols, or topics, type
"modules", "keywords", "symbols", or "topics".  Each module also comes
with a one-line summary of what it does; to list the modules whose name
or summary contain a given string such as "spam", type "modules spam".
'''.format('%d.%d' % sys.version_info[:2]))

    def list(self, items, columns=4, width=80):
        items = list(sorted(items))
        colw = width // columns
        rows = (len(items) + columns - 1) // columns
        for row in range(rows):
            for col in range(columns):
                i = col * rows + row
                if i < len(items):
                    self.output.write(items[i])
                    if col < columns - 1:
                        self.output.write(' ' + ' ' * (colw - 1 - len(items[i])))
            self.output.write('\n')

    def listkeywords(self):
        self.output.write('''
Here is a list of the Python keywords.  Enter any keyword to get more help.

''')
        self.list(self.keywords.keys())

    def listsymbols(self):
        self.output.write('''
Here is a list of the punctuation symbols which Python assigns special meaning
to. Enter any symbol to get more help.

''')
        self.list(self.symbols.keys())

    def listtopics(self):
        self.output.write('''
Here is a list of available topics.  Enter any topic name to get more help.

''')
        self.list(self.topics.keys())

    def showtopic(self, topic, more_xrefs=''):
        try:
            import pydoc_data.topics
        except ImportError:
            self.output.write('''
Sorry, topic and keyword documentation is not available because the
module "pydoc_data.topics" could not be found.
''')
            return
        target = self.topics.get(topic, self.keywords.get(topic))
        if not target:
            self.output.write('no documentation found for %s\n' % repr(topic))
            return
        if type(target) is type(''):
            return self.showtopic(target, more_xrefs)

        label, xrefs = target
        try:
            doc = pydoc_data.topics.topics[label]
        except KeyError:
            self.output.write('no documentation found for %s\n' % repr(topic))
            return
        doc = doc.strip() + '\n'
        if more_xrefs:
            xrefs = (xrefs or '') + ' ' + more_xrefs
        if xrefs:
            import textwrap
            text = 'Related help topics: ' + ', '.join(xrefs.split()) + '\n'
            wrapped_text = textwrap.wrap(text, 72)
            doc += '\n%s\n' % '\n'.join(wrapped_text)
        pager(doc)

    def _gettopic(self, topic, more_xrefs=''):
        """Return unbuffered tuple of (topic, xrefs).

        If an error occurs here, the exception is caught and displayed by
        the url handler.

        This function duplicates the showtopic method but returns its
        result directly so it can be formatted for display in an html page.
        """
        try:
            import pydoc_data.topics
        except ImportError:
            return('''
Sorry, topic and keyword documentation is not available because the
module "pydoc_data.topics" could not be found.
''' , '')
        target = self.topics.get(topic, self.keywords.get(topic))
        if not target:
            raise ValueError('could not find topic')
        if isinstance(target, str):
            return self._gettopic(target, more_xrefs)
        label, xrefs = target
        doc = pydoc_data.topics.topics[label]
        if more_xrefs:
            xrefs = (xrefs or '') + ' ' + more_xrefs
        return doc, xrefs

    def showsymbol(self, symbol):
        target = self.symbols[symbol]
        topic, _, xrefs = target.partition(' ')
        self.showtopic(topic, xrefs)

    def listmodules(self, key=''):
        if key:
            self.output.write('''
Here is a list of modules whose name or summary contains '{}'.
If there are any, enter a module name to get more help.

'''.format(key))
            apropos(key)
        else:
            self.output.write('''
Please wait a moment while I gather a list of all available modules...

''')
            modules = {}
            def callback(path, modname, desc, modules=modules):
                if modname and modname[-9:] == '.__init__':
                    modname = modname[:-9] + ' (package)'
                if modname.find('.') < 0:
                    modules[modname] = 1
            def onerror(modname):
                callback(None, modname, None)
            ModuleScanner().run(callback, onerror=onerror)
            self.list(modules.keys())
            self.output.write('''
Enter any module name to get more help.  Or, type "modules spam" to search
for modules whose name or summary contain the string "spam".
''')

help = Helper()

class ModuleScanner:
    """An interruptible scanner that searches module synopses."""

    def run(self, callback, key=None, completer=None, onerror=None):
        if key: key = key.lower()
        self.quit = False
        seen = {}

        for modname in sys.builtin_module_names:
            if modname != '__main__':
                seen[modname] = 1
                if key is None:
                    callback(None, modname, '')
                else:
                    name = __import__(modname).__doc__ or ''
                    desc = name.split('\n')[0]
                    name = modname + ' - ' + desc
                    if name.lower().find(key) >= 0:
                        callback(None, modname, desc)

        for importer, modname, ispkg in pkgutil.walk_packages(onerror=onerror):
            if self.quit:
                break

            if key is None:
                callback(None, modname, '')
            else:
                try:
                    spec = pkgutil._get_spec(importer, modname)
                except SyntaxError:
                    # raised by tests for bad coding cookies or BOM
                    continue
                loader = spec.loader
                if hasattr(loader, 'get_source'):
                    try:
                        source = loader.get_source(modname)
                    except Exception:
                        if onerror:
                            onerror(modname)
                        continue
                    desc = source_synopsis(io.StringIO(source)) or ''
                    if hasattr(loader, 'get_filename'):
                        path = loader.get_filename(modname)
                    else:
                        path = None
                else:
                    try:
                        module = importlib._bootstrap._load(spec)
                    except ImportError:
                        if onerror:
                            onerror(modname)
                        continue
                    desc = module.__doc__.splitlines()[0] if module.__doc__ else ''
                    path = getattr(module,'__file__',None)
                name = modname + ' - ' + desc
                if name.lower().find(key) >= 0:
                    callback(path, modname, desc)

        if completer:
            completer()

def apropos(key):
    """Print all the one-line module summaries that contain a substring."""
    def callback(path, modname, desc):
        if modname[-9:] == '.__init__':
            modname = modname[:-9] + ' (package)'
        print(modname, desc and '- ' + desc)
    def onerror(modname):
        pass
    with warnings.catch_warnings():
        warnings.filterwarnings('ignore') # ignore problems during import
        ModuleScanner().run(callback, key, onerror=onerror)

# --------------------------------------- enhanced Web browser interface

def _start_server(urlhandler, hostname, port):
    """Start an HTTP server thread on a specific port.

    Start an HTML/text server thread, so HTML or text documents can be
    browsed dynamically and interactively with a Web browser.  Example use:

        >>> import time
        >>> import pydoc

        Define a URL handler.  To determine what the client is asking
        for, check the URL and content_type.

        Then get or generate some text or HTML code and return it.

        >>> def my_url_handler(url, content_type):
        ...     text = 'the URL sent was: (%s, %s)' % (url, content_type)
        ...     return text

        Start server thread on port 0.
        If you use port 0, the server will pick a random port number.
        You can then use serverthread.port to get the port number.

        >>> port = 0
        >>> serverthread = pydoc._start_server(my_url_handler, port)

        Check that the server is really started.  If it is, open browser
        and get first page.  Use serverthread.url as the starting page.

        >>> if serverthread.serving:
        ...    import webbrowser

        The next two lines are commented out so a browser doesn't open if
        doctest is run on this module.

        #...    webbrowser.open(serverthread.url)
        #True

        Let the server do its thing. We just need to monitor its status.
        Use time.sleep so the loop doesn't hog the CPU.

        >>> starttime = time.monotonic()
        >>> timeout = 1                    #seconds

        This is a short timeout for testing purposes.

        >>> while serverthread.serving:
        ...     time.sleep(.01)
        ...     if serverthread.serving and time.monotonic() - starttime > timeout:
        ...          serverthread.stop()
        ...          break

        Print any errors that may have occurred.

        >>> print(serverthread.error)
        None
   """
    import http.server
    import email.message
    import select
    import threading

    class DocHandler(http.server.BaseHTTPRequestHandler):

        def do_GET(self):
            """Process a request from an HTML browser.

            The URL received is in self.path.
            Get an HTML page from self.urlhandler and send it.
            """
            if self.path.endswith('.css'):
                content_type = 'text/css'
            else:
                content_type = 'text/html'
            self.send_response(200)
            self.send_header('Content-Type', '%s; charset=UTF-8' % content_type)
            self.end_headers()
            self.wfile.write(self.urlhandler(
                self.path, content_type).encode('utf-8'))

        def log_message(self, *args):
            # Don't log messages.
            pass

    class DocServer(http.server.HTTPServer):

        def __init__(self, host, port, callback):
            self.host = host
            self.address = (self.host, port)
            self.callback = callback
            self.base.__init__(self, self.address, self.handler)
            self.quit = False

        def serve_until_quit(self):
            while not self.quit:
                rd, wr, ex = select.select([self.socket.fileno()], [], [], 1)
                if rd:
                    self.handle_request()
            self.server_close()

        def server_activate(self):
            self.base.server_activate(self)
            if self.callback:
                self.callback(self)

    class ServerThread(threading.Thread):

        def __init__(self, urlhandler, host, port):
            self.urlhandler = urlhandler
            self.host = host
            self.port = int(port)
            threading.Thread.__init__(self)
            self.serving = False
            self.error = None

        def run(self):
            """Start the server."""
            try:
                DocServer.base = http.server.HTTPServer
                DocServer.handler = DocHandler
                DocHandler.MessageClass = email.message.Message
                DocHandler.urlhandler = staticmethod(self.urlhandler)
                docsvr = DocServer(self.host, self.port, self.ready)
                self.docserver = docsvr
                docsvr.serve_until_quit()
            except Exception as e:
                self.error = e

        def ready(self, server):
            self.serving = True
            self.host = server.host
            self.port = server.server_port
            self.url = 'http://%s:%d/' % (self.host, self.port)

        def stop(self):
            """Stop the server and this thread nicely"""
            self.docserver.quit = True
            self.join()
            # explicitly break a reference cycle: DocServer.callback
            # has indirectly a reference to ServerThread.
            self.docserver = None
            self.serving = False
            self.url = None

    thread = ServerThread(urlhandler, hostname, port)
    thread.start()
    # Wait until thread.serving is True to make sure we are
    # really up before returning.
    while not thread.error and not thread.serving:
        time.sleep(.01)
    return thread


def _url_handler(url, content_type="text/html"):
    """The pydoc url handler for use with the pydoc server.

    If the content_type is 'text/css', the _pydoc.css style
    sheet is read and returned if it exits.

    If the content_type is 'text/html', then the result of
    get_html_page(url) is returned.
    """
    class _HTMLDoc(HTMLDoc):

        def page(self, title, contents):
            """Format an HTML page."""
            css_path = "pydoc_data/_pydoc.css"
            css_link = (
                '<link rel="stylesheet" type="text/css" href="%s">' %
                css_path)
            return '''\
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Pydoc: %s</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
%s</head><body bgcolor="#f0f0f8">%s<div style="clear:both;padding-top:.5em;">%s</div>
</body></html>''' % (title, css_link, html_navbar(), contents)


    html = _HTMLDoc()

    def html_navbar():
        version = html.escape("%s [%s, %s]" % (platform.python_version(),
                                               platform.python_build()[0],
                                               platform.python_compiler()))
        return """
            <div style='float:left'>
                Python %s<br>%s
            </div>
            <div style='float:right'>
                <div style='text-align:center'>
                  <a href="index.html">Module Index</a>
                  : <a href="topics.html">Topics</a>
                  : <a href="keywords.html">Keywords</a>
                </div>
                <div>
                    <form action="get" style='display:inline;'>
                      <input type=text name=key size=15>
                      <input type=submit value="Get">
                    </form>&nbsp;
                    <form action="search" style='display:inline;'>
                      <input type=text name=key size=15>
                      <input type=submit value="Search">
                    </form>
                </div>
            </div>
            """ % (version, html.escape(platform.platform(terse=True)))

    def html_index():
        """Module Index page."""

        def bltinlink(name):
            return '<a href="%s.html">%s</a>' % (name, name)

        heading = html.heading(
            '<big><big><strong>Index of Modules</strong></big></big>',
            '#ffffff', '#7799ee')
        names = [name for name in sys.builtin_module_names
                 if name != '__main__']
        contents = html.multicolumn(names, bltinlink)
        contents = [heading, '<p>' + html.bigsection(
            'Built-in Modules', '#ffffff', '#ee77aa', contents)]

        seen = {}
        for dir in sys.path:
            contents.append(html.index(dir, seen))

        contents.append(
            '<p align=right><font color="#909090" face="helvetica,'
            'arial"><strong>pydoc</strong> by Ka-Ping Yee'
            '&lt;ping@lfw.org&gt;</font>')
        return 'Index of Modules', ''.join(contents)

    def html_search(key):
        """Search results page."""
        # scan for modules
        search_result = []

        def callback(path, modname, desc):
            if modname[-9:] == '.__init__':
                modname = modname[:-9] + ' (package)'
            search_result.append((modname, desc and '- ' + desc))

        with warnings.catch_warnings():
            warnings.filterwarnings('ignore') # ignore problems during import
            def onerror(modname):
                pass
            ModuleScanner().run(callback, key, onerror=onerror)

        # format page
        def bltinlink(name):
            return '<a href="%s.html">%s</a>' % (name, name)

        results = []
        heading = html.heading(
            '<big><big><strong>Search Results</strong></big></big>',
            '#ffffff', '#7799ee')
        for name, desc in search_result:
            results.append(bltinlink(name) + desc)
        contents = heading + html.bigsection(
            'key = %s' % key, '#ffffff', '#ee77aa', '<br>'.join(results))
        return 'Search Results', contents

    def html_topics():
        """Index of topic texts available."""

        def bltinlink(name):
            return '<a href="topic?key=%s">%s</a>' % (name, name)

        heading = html.heading(
            '<big><big><strong>INDEX</strong></big></big>',
            '#ffffff', '#7799ee')
        names = sorted(Helper.topics.keys())

        contents = html.multicolumn(names, bltinlink)
        contents = heading + html.bigsection(
            'Topics', '#ffffff', '#ee77aa', contents)
        return 'Topics', contents

    def html_keywords():
        """Index of keywords."""
        heading = html.heading(
            '<big><big><strong>INDEX</strong></big></big>',
            '#ffffff', '#7799ee')
        names = sorted(Helper.keywords.keys())

        def bltinlink(name):
            return '<a href="topic?key=%s">%s</a>' % (name, name)

        contents = html.multicolumn(names, bltinlink)
        contents = heading + html.bigsection(
            'Keywords', '#ffffff', '#ee77aa', contents)
        return 'Keywords', contents

    def html_topicpage(topic):
        """Topic or keyword help page."""
        buf = io.StringIO()
        htmlhelp = Helper(buf, buf)
        contents, xrefs = htmlhelp._gettopic(topic)
        if topic in htmlhelp.keywords:
            title = 'KEYWORD'
        else:
            title = 'TOPIC'
        heading = html.heading(
            '<big><big><strong>%s</strong></big></big>' % title,
            '#ffffff', '#7799ee')
        contents = '<pre>%s</pre>' % html.markup(contents)
        contents = html.bigsection(topic , '#ffffff','#ee77aa', contents)
        if xrefs:
            xrefs = sorted(xrefs.split())

            def bltinlink(name):
                return '<a href="topic?key=%s">%s</a>' % (name, name)

            xrefs = html.multicolumn(xrefs, bltinlink)
            xrefs = html.section('Related help topics: ',
                                 '#ffffff', '#ee77aa', xrefs)
        return ('%s %s' % (title, topic),
                ''.join((heading, contents, xrefs)))

    def html_getobj(url):
        obj = locate(url, forceload=1)
        if obj is None and url != 'None':
            raise ValueError('could not find object')
        title = describe(obj)
        content = html.document(obj, url)
        return title, content

    def html_error(url, exc):
        heading = html.heading(
            '<big><big><strong>Error</strong></big></big>',
            '#ffffff', '#7799ee')
        contents = '<br>'.join(html.escape(line) for line in
                               format_exception_only(type(exc), exc))
        contents = heading + html.bigsection(url, '#ffffff', '#bb0000',
                                             contents)
        return "Error - %s" % url, contents

    def get_html_page(url):
        """Generate an HTML page for url."""
        complete_url = url
        if url.endswith('.html'):
            url = url[:-5]
        try:
            if url in ("", "index"):
                title, content = html_index()
            elif url == "topics":
                title, content = html_topics()
            elif url == "keywords":
                title, content = html_keywords()
            elif '=' in url:
                op, _, url = url.partition('=')
                if op == "search?key":
                    title, content = html_search(url)
                elif op == "topic?key":
                    # try topics first, then objects.
                    try:
                        title, content = html_topicpage(url)
                    except ValueError:
                        title, content = html_getobj(url)
                elif op == "get?key":
                    # try objects first, then topics.
                    if url in ("", "index"):
                        title, content = html_index()
                    else:
                        try:
                            title, content = html_getobj(url)
                        except ValueError:
                            title, content = html_topicpage(url)
                else:
                    raise ValueError('bad pydoc url')
            else:
                title, content = html_getobj(url)
        except Exception as exc:
            # Catch any errors and display them in an error page.
            title, content = html_error(complete_url, exc)
        return html.page(title, content)

    if url.startswith('/'):
        url = url[1:]
    if content_type == 'text/css':
        path_here = os.path.dirname(os.path.realpath(__file__))
        css_path = os.path.join(path_here, url)
        with open(css_path) as fp:
            return ''.join(fp.readlines())
    elif content_type == 'text/html':
        return get_html_page(url)
    # Errors outside the url handler are caught by the server.
    raise TypeError('unknown content type %r for url %s' % (content_type, url))


def browse(port=0, *, open_browser=True, hostname='localhost'):
    """Start the enhanced pydoc Web server and open a Web browser.

    Use port '0' to start the server on an arbitrary port.
    Set open_browser to False to suppress opening a browser.
    """
    import webbrowser
    serverthread = _start_server(_url_handler, hostname, port)
    if serverthread.error:
        print(serverthread.error)
        return
    if serverthread.serving:
        server_help_msg = 'Server commands: [b]rowser, [q]uit'
        if open_browser:
            webbrowser.open(serverthread.url)
        try:
            print('Server ready at', serverthread.url)
            print(server_help_msg)
            while serverthread.serving:
                cmd = input('server> ')
                cmd = cmd.lower()
                if cmd == 'q':
                    break
                elif cmd == 'b':
                    webbrowser.open(serverthread.url)
                else:
                    print(server_help_msg)
        except (KeyboardInterrupt, EOFError):
            print()
        finally:
            if serverthread.serving:
                serverthread.stop()
                print('Server stopped')


# -------------------------------------------------- command-line interface

def ispath(x):
    return isinstance(x, str) and x.find(os.sep) >= 0

def _get_revised_path(given_path, argv0):
    """Ensures current directory is on returned path, and argv0 directory is not

    Exception: argv0 dir is left alone if it's also pydoc's directory.

    Returns a new path entry list, or None if no adjustment is needed.
    """
    # Scripts may get the current directory in their path by default if they're
    # run with the -m switch, or directly from the current directory.
    # The interactive prompt also allows imports from the current directory.

    # Accordingly, if the current directory is already present, don't make
    # any changes to the given_path
    if '' in given_path or os.curdir in given_path or os.getcwd() in given_path:
        return None

    # Otherwise, add the current directory to the given path, and remove the
    # script directory (as long as the latter isn't also pydoc's directory.
    stdlib_dir = os.path.dirname(__file__)
    script_dir = os.path.dirname(argv0)
    revised_path = given_path.copy()
    if script_dir in given_path and not os.path.samefile(script_dir, stdlib_dir):
        revised_path.remove(script_dir)
    revised_path.insert(0, os.getcwd())
    return revised_path


# Note: the tests only cover _get_revised_path, not _adjust_cli_path itself
def _adjust_cli_sys_path():
    """Ensures current directory is on sys.path, and __main__ directory is not.

    Exception: __main__ dir is left alone if it's also pydoc's directory.
    """
    revised_path = _get_revised_path(sys.path, sys.argv[0])
    if revised_path is not None:
        sys.path[:] = revised_path


def cli():
    """Command-line interface (looks at sys.argv to decide what to do)."""
    import getopt
    class BadUsage(Exception): pass

    _adjust_cli_sys_path()

    try:
        opts, args = getopt.getopt(sys.argv[1:], 'bk:n:p:w')
        writing = False
        start_server = False
        open_browser = False
        port = 0
        hostname = 'localhost'
        for opt, val in opts:
            if opt == '-b':
                start_server = True
                open_browser = True
            if opt == '-k':
                apropos(val)
                return
            if opt == '-p':
                start_server = True
                port = val
            if opt == '-w':
                writing = True
            if opt == '-n':
                start_server = True
                hostname = val

        if start_server:
            browse(port, hostname=hostname, open_browser=open_browser)
            return

        if not args: raise BadUsage
        for arg in args:
            if ispath(arg) and not os.path.exists(arg):
                print('file %r does not exist' % arg)
                break
            try:
                if ispath(arg) and os.path.isfile(arg):
                    arg = importfile(arg)
                if writing:
                    if ispath(arg) and os.path.isdir(arg):
                        writedocs(arg)
                    else:
                        writedoc(arg)
                else:
                    help.help(arg)
            except ErrorDuringImport as value:
                print(value)

    except (getopt.error, BadUsage):
        cmd = os.path.splitext(os.path.basename(sys.argv[0]))[0]
        print("""pydoc - the Python documentation tool

{cmd} <name> ...
    Show text documentation on something.  <name> may be the name of a
    Python keyword, topic, function, module, or package, or a dotted
    reference to a class or function within a module or module in a
    package.  If <name> contains a '{sep}', it is used as the path to a
    Python source file to document. If name is 'keywords', 'topics',
    or 'modules', a listing of these things is displayed.

{cmd} -k <keyword>
    Search for a keyword in the synopsis lines of all available modules.

{cmd} -n <hostname>
    Start an HTTP server with the given hostname (default: localhost).

{cmd} -p <port>
    Start an HTTP server on the given port on the local machine.  Port
    number 0 can be used to get an arbitrary unused port.

{cmd} -b
    Start an HTTP server on an arbitrary unused port and open a Web browser
    to interactively browse documentation.  This option can be used in
    combination with -n and/or -p.

{cmd} -w <name> ...
    Write out the HTML documentation for a module to a file in the current
    directory.  If <name> contains a '{sep}', it is treated as a filename; if
    it names a directory, documentation is written for all the contents.
""".format(cmd=cmd, sep=os.sep))

if __name__ == '__main__':
    cli()
platform.py000075500000116751151153537440006770 0ustar00#! /usr/bin/python3.8

""" This module tries to retrieve as much platform-identifying data as
    possible. It makes this information available via function APIs.

    If called from the command line, it prints the platform
    information concatenated as single string to stdout. The output
    format is useable as part of a filename.

"""
#    This module is maintained by Marc-Andre Lemburg <mal@egenix.com>.
#    If you find problems, please submit bug reports/patches via the
#    Python bug tracker (http://bugs.python.org) and assign them to "lemburg".
#
#    Still needed:
#    * support for MS-DOS (PythonDX ?)
#    * support for Amiga and other still unsupported platforms running Python
#    * support for additional Linux distributions
#
#    Many thanks to all those who helped adding platform-specific
#    checks (in no particular order):
#
#      Charles G Waldman, David Arnold, Gordon McMillan, Ben Darnell,
#      Jeff Bauer, Cliff Crawford, Ivan Van Laningham, Josef
#      Betancourt, Randall Hopper, Karl Putland, John Farrell, Greg
#      Andruk, Just van Rossum, Thomas Heller, Mark R. Levinson, Mark
#      Hammond, Bill Tutt, Hans Nowak, Uwe Zessin (OpenVMS support),
#      Colin Kong, Trent Mick, Guido van Rossum, Anthony Baxter, Steve
#      Dower
#
#    History:
#
#    <see CVS and SVN checkin messages for history>
#
#    1.0.8 - changed Windows support to read version from kernel32.dll
#    1.0.7 - added DEV_NULL
#    1.0.6 - added linux_distribution()
#    1.0.5 - fixed Java support to allow running the module on Jython
#    1.0.4 - added IronPython support
#    1.0.3 - added normalization of Windows system name
#    1.0.2 - added more Windows support
#    1.0.1 - reformatted to make doc.py happy
#    1.0.0 - reformatted a bit and checked into Python CVS
#    0.8.0 - added sys.version parser and various new access
#            APIs (python_version(), python_compiler(), etc.)
#    0.7.2 - fixed architecture() to use sizeof(pointer) where available
#    0.7.1 - added support for Caldera OpenLinux
#    0.7.0 - some fixes for WinCE; untabified the source file
#    0.6.2 - support for OpenVMS - requires version 1.5.2-V006 or higher and
#            vms_lib.getsyi() configured
#    0.6.1 - added code to prevent 'uname -p' on platforms which are
#            known not to support it
#    0.6.0 - fixed win32_ver() to hopefully work on Win95,98,NT and Win2k;
#            did some cleanup of the interfaces - some APIs have changed
#    0.5.5 - fixed another type in the MacOS code... should have
#            used more coffee today ;-)
#    0.5.4 - fixed a few typos in the MacOS code
#    0.5.3 - added experimental MacOS support; added better popen()
#            workarounds in _syscmd_ver() -- still not 100% elegant
#            though
#    0.5.2 - fixed uname() to return '' instead of 'unknown' in all
#            return values (the system uname command tends to return
#            'unknown' instead of just leaving the field empty)
#    0.5.1 - included code for slackware dist; added exception handlers
#            to cover up situations where platforms don't have os.popen
#            (e.g. Mac) or fail on socket.gethostname(); fixed libc
#            detection RE
#    0.5.0 - changed the API names referring to system commands to *syscmd*;
#            added java_ver(); made syscmd_ver() a private
#            API (was system_ver() in previous versions) -- use uname()
#            instead; extended the win32_ver() to also return processor
#            type information
#    0.4.0 - added win32_ver() and modified the platform() output for WinXX
#    0.3.4 - fixed a bug in _follow_symlinks()
#    0.3.3 - fixed popen() and "file" command invocation bugs
#    0.3.2 - added architecture() API and support for it in platform()
#    0.3.1 - fixed syscmd_ver() RE to support Windows NT
#    0.3.0 - added system alias support
#    0.2.3 - removed 'wince' again... oh well.
#    0.2.2 - added 'wince' to syscmd_ver() supported platforms
#    0.2.1 - added cache logic and changed the platform string format
#    0.2.0 - changed the API to use functions instead of module globals
#            since some action take too long to be run on module import
#    0.1.0 - first release
#
#    You can always get the latest version of this module at:
#
#             http://www.egenix.com/files/python/platform.py
#
#    If that URL should fail, try contacting the author.

__copyright__ = """
    Copyright (c) 1999-2000, Marc-Andre Lemburg; mailto:mal@lemburg.com
    Copyright (c) 2000-2010, eGenix.com Software GmbH; mailto:info@egenix.com

    Permission to use, copy, modify, and distribute this software and its
    documentation for any purpose and without fee or royalty is hereby granted,
    provided that the above copyright notice appear in all copies and that
    both that copyright notice and this permission notice appear in
    supporting documentation or portions thereof, including modifications,
    that you make.

    EGENIX.COM SOFTWARE GMBH DISCLAIMS ALL WARRANTIES WITH REGARD TO
    THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
    FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
    INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
    FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
    NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
    WITH THE USE OR PERFORMANCE OF THIS SOFTWARE !

"""

__version__ = '1.0.8'

import collections
import os
import re
import sys

### Globals & Constants

# Helper for comparing two version number strings.
# Based on the description of the PHP's version_compare():
# http://php.net/manual/en/function.version-compare.php

_ver_stages = {
    # any string not found in this dict, will get 0 assigned
    'dev': 10,
    'alpha': 20, 'a': 20,
    'beta': 30, 'b': 30,
    'c': 40,
    'RC': 50, 'rc': 50,
    # number, will get 100 assigned
    'pl': 200, 'p': 200,
}

_component_re = re.compile(r'([0-9]+|[._+-])')

def _comparable_version(version):
    result = []
    for v in _component_re.split(version):
        if v not in '._+-':
            try:
                v = int(v, 10)
                t = 100
            except ValueError:
                t = _ver_stages.get(v, 0)
            result.extend((t, v))
    return result

### Platform specific APIs

_libc_search = re.compile(b'(__libc_init)'
                          b'|'
                          b'(GLIBC_([0-9.]+))'
                          b'|'
                          br'(libc(_\w+)?\.so(?:\.(\d[0-9.]*))?)', re.ASCII)

def libc_ver(executable=None, lib='', version='', chunksize=16384):

    """ Tries to determine the libc version that the file executable
        (which defaults to the Python interpreter) is linked against.

        Returns a tuple of strings (lib,version) which default to the
        given parameters in case the lookup fails.

        Note that the function has intimate knowledge of how different
        libc versions add symbols to the executable and thus is probably
        only useable for executables compiled using gcc.

        The file is read and scanned in chunks of chunksize bytes.

    """
    if executable is None:
        try:
            ver = os.confstr('CS_GNU_LIBC_VERSION')
            # parse 'glibc 2.28' as ('glibc', '2.28')
            parts = ver.split(maxsplit=1)
            if len(parts) == 2:
                return tuple(parts)
        except (AttributeError, ValueError, OSError):
            # os.confstr() or CS_GNU_LIBC_VERSION value not available
            pass

        executable = sys.executable

    V = _comparable_version
    if hasattr(os.path, 'realpath'):
        # Python 2.2 introduced os.path.realpath(); it is used
        # here to work around problems with Cygwin not being
        # able to open symlinks for reading
        executable = os.path.realpath(executable)
    with open(executable, 'rb') as f:
        binary = f.read(chunksize)
        pos = 0
        while pos < len(binary):
            if b'libc' in binary or b'GLIBC' in binary:
                m = _libc_search.search(binary, pos)
            else:
                m = None
            if not m or m.end() == len(binary):
                chunk = f.read(chunksize)
                if chunk:
                    binary = binary[max(pos, len(binary) - 1000):] + chunk
                    pos = 0
                    continue
                if not m:
                    break
            libcinit, glibc, glibcversion, so, threads, soversion = [
                s.decode('latin1') if s is not None else s
                for s in m.groups()]
            if libcinit and not lib:
                lib = 'libc'
            elif glibc:
                if lib != 'glibc':
                    lib = 'glibc'
                    version = glibcversion
                elif V(glibcversion) > V(version):
                    version = glibcversion
            elif so:
                if lib != 'glibc':
                    lib = 'libc'
                    if soversion and (not version or V(soversion) > V(version)):
                        version = soversion
                    if threads and version[-len(threads):] != threads:
                        version = version + threads
            pos = m.end()
    return lib, version

def _norm_version(version, build=''):

    """ Normalize the version and build strings and return a single
        version string using the format major.minor.build (or patchlevel).
    """
    l = version.split('.')
    if build:
        l.append(build)
    try:
        strings = list(map(str, map(int, l)))
    except ValueError:
        strings = l
    version = '.'.join(strings[:3])
    return version

_ver_output = re.compile(r'(?:([\w ]+) ([\w.]+) '
                         r'.*'
                         r'\[.* ([\d.]+)\])')

# Examples of VER command output:
#
#   Windows 2000:  Microsoft Windows 2000 [Version 5.00.2195]
#   Windows XP:    Microsoft Windows XP [Version 5.1.2600]
#   Windows Vista: Microsoft Windows [Version 6.0.6002]
#
# Note that the "Version" string gets localized on different
# Windows versions.

def _syscmd_ver(system='', release='', version='',

               supported_platforms=('win32', 'win16', 'dos')):

    """ Tries to figure out the OS version used and returns
        a tuple (system, release, version).

        It uses the "ver" shell command for this which is known
        to exists on Windows, DOS. XXX Others too ?

        In case this fails, the given parameters are used as
        defaults.

    """
    if sys.platform not in supported_platforms:
        return system, release, version

    # Try some common cmd strings
    import subprocess
    for cmd in ('ver', 'command /c ver', 'cmd /c ver'):
        try:
            info = subprocess.check_output(cmd,
                                           stderr=subprocess.DEVNULL,
                                           text=True,
                                           shell=True)
        except (OSError, subprocess.CalledProcessError) as why:
            #print('Command %s failed: %s' % (cmd, why))
            continue
        else:
            break
    else:
        return system, release, version

    # Parse the output
    info = info.strip()
    m = _ver_output.match(info)
    if m is not None:
        system, release, version = m.groups()
        # Strip trailing dots from version and release
        if release[-1] == '.':
            release = release[:-1]
        if version[-1] == '.':
            version = version[:-1]
        # Normalize the version and build strings (eliminating additional
        # zeros)
        version = _norm_version(version)
    return system, release, version

_WIN32_CLIENT_RELEASES = {
    (5, 0): "2000",
    (5, 1): "XP",
    # Strictly, 5.2 client is XP 64-bit, but platform.py historically
    # has always called it 2003 Server
    (5, 2): "2003Server",
    (5, None): "post2003",

    (6, 0): "Vista",
    (6, 1): "7",
    (6, 2): "8",
    (6, 3): "8.1",
    (6, None): "post8.1",

    (10, 0): "10",
    (10, None): "post10",
}

# Server release name lookup will default to client names if necessary
_WIN32_SERVER_RELEASES = {
    (5, 2): "2003Server",

    (6, 0): "2008Server",
    (6, 1): "2008ServerR2",
    (6, 2): "2012Server",
    (6, 3): "2012ServerR2",
    (6, None): "post2012ServerR2",
}

def win32_is_iot():
    return win32_edition() in ('IoTUAP', 'NanoServer', 'WindowsCoreHeadless', 'IoTEdgeOS')

def win32_edition():
    try:
        try:
            import winreg
        except ImportError:
            import _winreg as winreg
    except ImportError:
        pass
    else:
        try:
            cvkey = r'SOFTWARE\Microsoft\Windows NT\CurrentVersion'
            with winreg.OpenKeyEx(winreg.HKEY_LOCAL_MACHINE, cvkey) as key:
                return winreg.QueryValueEx(key, 'EditionId')[0]
        except OSError:
            pass

    return None

def win32_ver(release='', version='', csd='', ptype=''):
    try:
        from sys import getwindowsversion
    except ImportError:
        return release, version, csd, ptype

    winver = getwindowsversion()
    try:
        major, minor, build = map(int, _syscmd_ver()[2].split('.'))
    except ValueError:
        major, minor, build = winver.platform_version or winver[:3]
    version = '{0}.{1}.{2}'.format(major, minor, build)

    release = (_WIN32_CLIENT_RELEASES.get((major, minor)) or
               _WIN32_CLIENT_RELEASES.get((major, None)) or
               release)

    # getwindowsversion() reflect the compatibility mode Python is
    # running under, and so the service pack value is only going to be
    # valid if the versions match.
    if winver[:2] == (major, minor):
        try:
            csd = 'SP{}'.format(winver.service_pack_major)
        except AttributeError:
            if csd[:13] == 'Service Pack ':
                csd = 'SP' + csd[13:]

    # VER_NT_SERVER = 3
    if getattr(winver, 'product_type', None) == 3:
        release = (_WIN32_SERVER_RELEASES.get((major, minor)) or
                   _WIN32_SERVER_RELEASES.get((major, None)) or
                   release)

    try:
        try:
            import winreg
        except ImportError:
            import _winreg as winreg
    except ImportError:
        pass
    else:
        try:
            cvkey = r'SOFTWARE\Microsoft\Windows NT\CurrentVersion'
            with winreg.OpenKeyEx(winreg.HKEY_LOCAL_MACHINE, cvkey) as key:
                ptype = winreg.QueryValueEx(key, 'CurrentType')[0]
        except OSError:
            pass

    return release, version, csd, ptype


def _mac_ver_xml():
    fn = '/System/Library/CoreServices/SystemVersion.plist'
    if not os.path.exists(fn):
        return None

    try:
        import plistlib
    except ImportError:
        return None

    with open(fn, 'rb') as f:
        pl = plistlib.load(f)
    release = pl['ProductVersion']
    versioninfo = ('', '', '')
    machine = os.uname().machine
    if machine in ('ppc', 'Power Macintosh'):
        # Canonical name
        machine = 'PowerPC'

    return release, versioninfo, machine


def mac_ver(release='', versioninfo=('', '', ''), machine=''):

    """ Get macOS version information and return it as tuple (release,
        versioninfo, machine) with versioninfo being a tuple (version,
        dev_stage, non_release_version).

        Entries which cannot be determined are set to the parameter values
        which default to ''. All tuple entries are strings.
    """

    # First try reading the information from an XML file which should
    # always be present
    info = _mac_ver_xml()
    if info is not None:
        return info

    # If that also doesn't work return the default values
    return release, versioninfo, machine

def _java_getprop(name, default):

    from java.lang import System
    try:
        value = System.getProperty(name)
        if value is None:
            return default
        return value
    except AttributeError:
        return default

def java_ver(release='', vendor='', vminfo=('', '', ''), osinfo=('', '', '')):

    """ Version interface for Jython.

        Returns a tuple (release, vendor, vminfo, osinfo) with vminfo being
        a tuple (vm_name, vm_release, vm_vendor) and osinfo being a
        tuple (os_name, os_version, os_arch).

        Values which cannot be determined are set to the defaults
        given as parameters (which all default to '').

    """
    # Import the needed APIs
    try:
        import java.lang
    except ImportError:
        return release, vendor, vminfo, osinfo

    vendor = _java_getprop('java.vendor', vendor)
    release = _java_getprop('java.version', release)
    vm_name, vm_release, vm_vendor = vminfo
    vm_name = _java_getprop('java.vm.name', vm_name)
    vm_vendor = _java_getprop('java.vm.vendor', vm_vendor)
    vm_release = _java_getprop('java.vm.version', vm_release)
    vminfo = vm_name, vm_release, vm_vendor
    os_name, os_version, os_arch = osinfo
    os_arch = _java_getprop('java.os.arch', os_arch)
    os_name = _java_getprop('java.os.name', os_name)
    os_version = _java_getprop('java.os.version', os_version)
    osinfo = os_name, os_version, os_arch

    return release, vendor, vminfo, osinfo

### System name aliasing

def system_alias(system, release, version):

    """ Returns (system, release, version) aliased to common
        marketing names used for some systems.

        It also does some reordering of the information in some cases
        where it would otherwise cause confusion.

    """
    if system == 'SunOS':
        # Sun's OS
        if release < '5':
            # These releases use the old name SunOS
            return system, release, version
        # Modify release (marketing release = SunOS release - 3)
        l = release.split('.')
        if l:
            try:
                major = int(l[0])
            except ValueError:
                pass
            else:
                major = major - 3
                l[0] = str(major)
                release = '.'.join(l)
        if release < '6':
            system = 'Solaris'
        else:
            # XXX Whatever the new SunOS marketing name is...
            system = 'Solaris'

    elif system == 'IRIX64':
        # IRIX reports IRIX64 on platforms with 64-bit support; yet it
        # is really a version and not a different platform, since 32-bit
        # apps are also supported..
        system = 'IRIX'
        if version:
            version = version + ' (64bit)'
        else:
            version = '64bit'

    elif system in ('win32', 'win16'):
        # In case one of the other tricks
        system = 'Windows'

    # bpo-35516: Don't replace Darwin with macOS since input release and
    # version arguments can be different than the currently running version.

    return system, release, version

### Various internal helpers

def _platform(*args):

    """ Helper to format the platform string in a filename
        compatible format e.g. "system-version-machine".
    """
    # Format the platform string
    platform = '-'.join(x.strip() for x in filter(len, args))

    # Cleanup some possible filename obstacles...
    platform = platform.replace(' ', '_')
    platform = platform.replace('/', '-')
    platform = platform.replace('\\', '-')
    platform = platform.replace(':', '-')
    platform = platform.replace(';', '-')
    platform = platform.replace('"', '-')
    platform = platform.replace('(', '-')
    platform = platform.replace(')', '-')

    # No need to report 'unknown' information...
    platform = platform.replace('unknown', '')

    # Fold '--'s and remove trailing '-'
    while 1:
        cleaned = platform.replace('--', '-')
        if cleaned == platform:
            break
        platform = cleaned
    while platform[-1] == '-':
        platform = platform[:-1]

    return platform

def _node(default=''):

    """ Helper to determine the node name of this machine.
    """
    try:
        import socket
    except ImportError:
        # No sockets...
        return default
    try:
        return socket.gethostname()
    except OSError:
        # Still not working...
        return default

def _follow_symlinks(filepath):

    """ In case filepath is a symlink, follow it until a
        real file is reached.
    """
    filepath = os.path.abspath(filepath)
    while os.path.islink(filepath):
        filepath = os.path.normpath(
            os.path.join(os.path.dirname(filepath), os.readlink(filepath)))
    return filepath

def _syscmd_uname(option, default=''):

    """ Interface to the system's uname command.
    """
    if sys.platform in ('dos', 'win32', 'win16'):
        # XXX Others too ?
        return default

    import subprocess
    try:
        output = subprocess.check_output(('uname', option),
                                         stderr=subprocess.DEVNULL,
                                         text=True)
    except (OSError, subprocess.CalledProcessError):
        return default
    return (output.strip() or default)

def _syscmd_file(target, default=''):

    """ Interface to the system's file command.

        The function uses the -b option of the file command to have it
        omit the filename in its output. Follow the symlinks. It returns
        default in case the command should fail.

    """
    if sys.platform in ('dos', 'win32', 'win16'):
        # XXX Others too ?
        return default

    import subprocess
    target = _follow_symlinks(target)
    # "file" output is locale dependent: force the usage of the C locale
    # to get deterministic behavior.
    env = dict(os.environ, LC_ALL='C')
    try:
        # -b: do not prepend filenames to output lines (brief mode)
        output = subprocess.check_output(['file', '-b', target],
                                         stderr=subprocess.DEVNULL,
                                         env=env)
    except (OSError, subprocess.CalledProcessError):
        return default
    if not output:
        return default
    # With the C locale, the output should be mostly ASCII-compatible.
    # Decode from Latin-1 to prevent Unicode decode error.
    return output.decode('latin-1')

### Information about the used architecture

# Default values for architecture; non-empty strings override the
# defaults given as parameters
_default_architecture = {
    'win32': ('', 'WindowsPE'),
    'win16': ('', 'Windows'),
    'dos': ('', 'MSDOS'),
}

def architecture(executable=sys.executable, bits='', linkage=''):

    """ Queries the given executable (defaults to the Python interpreter
        binary) for various architecture information.

        Returns a tuple (bits, linkage) which contains information about
        the bit architecture and the linkage format used for the
        executable. Both values are returned as strings.

        Values that cannot be determined are returned as given by the
        parameter presets. If bits is given as '', the sizeof(pointer)
        (or sizeof(long) on Python version < 1.5.2) is used as
        indicator for the supported pointer size.

        The function relies on the system's "file" command to do the
        actual work. This is available on most if not all Unix
        platforms. On some non-Unix platforms where the "file" command
        does not exist and the executable is set to the Python interpreter
        binary defaults from _default_architecture are used.

    """
    # Use the sizeof(pointer) as default number of bits if nothing
    # else is given as default.
    if not bits:
        import struct
        size = struct.calcsize('P')
        bits = str(size * 8) + 'bit'

    # Get data from the 'file' system command
    if executable:
        fileout = _syscmd_file(executable, '')
    else:
        fileout = ''

    if not fileout and \
       executable == sys.executable:
        # "file" command did not return anything; we'll try to provide
        # some sensible defaults then...
        if sys.platform in _default_architecture:
            b, l = _default_architecture[sys.platform]
            if b:
                bits = b
            if l:
                linkage = l
        return bits, linkage

    if 'executable' not in fileout and 'shared object' not in fileout:
        # Format not supported
        return bits, linkage

    # Bits
    if '32-bit' in fileout:
        bits = '32bit'
    elif 'N32' in fileout:
        # On Irix only
        bits = 'n32bit'
    elif '64-bit' in fileout:
        bits = '64bit'

    # Linkage
    if 'ELF' in fileout:
        linkage = 'ELF'
    elif 'PE' in fileout:
        # E.g. Windows uses this format
        if 'Windows' in fileout:
            linkage = 'WindowsPE'
        else:
            linkage = 'PE'
    elif 'COFF' in fileout:
        linkage = 'COFF'
    elif 'MS-DOS' in fileout:
        linkage = 'MSDOS'
    else:
        # XXX the A.OUT format also falls under this class...
        pass

    return bits, linkage

### Portable uname() interface

uname_result = collections.namedtuple("uname_result",
                    "system node release version machine processor")

_uname_cache = None

def uname():

    """ Fairly portable uname interface. Returns a tuple
        of strings (system, node, release, version, machine, processor)
        identifying the underlying platform.

        Note that unlike the os.uname function this also returns
        possible processor information as an additional tuple entry.

        Entries which cannot be determined are set to ''.

    """
    global _uname_cache
    no_os_uname = 0

    if _uname_cache is not None:
        return _uname_cache

    processor = ''

    # Get some infos from the builtin os.uname API...
    try:
        system, node, release, version, machine = os.uname()
    except AttributeError:
        no_os_uname = 1

    if no_os_uname or not list(filter(None, (system, node, release, version, machine))):
        # Hmm, no there is either no uname or uname has returned
        #'unknowns'... we'll have to poke around the system then.
        if no_os_uname:
            system = sys.platform
            release = ''
            version = ''
            node = _node()
            machine = ''

        use_syscmd_ver = 1

        # Try win32_ver() on win32 platforms
        if system == 'win32':
            release, version, csd, ptype = win32_ver()
            if release and version:
                use_syscmd_ver = 0
            # Try to use the PROCESSOR_* environment variables
            # available on Win XP and later; see
            # http://support.microsoft.com/kb/888731 and
            # http://www.geocities.com/rick_lively/MANUALS/ENV/MSWIN/PROCESSI.HTM
            if not machine:
                # WOW64 processes mask the native architecture
                if "PROCESSOR_ARCHITEW6432" in os.environ:
                    machine = os.environ.get("PROCESSOR_ARCHITEW6432", '')
                else:
                    machine = os.environ.get('PROCESSOR_ARCHITECTURE', '')
            if not processor:
                processor = os.environ.get('PROCESSOR_IDENTIFIER', machine)

        # Try the 'ver' system command available on some
        # platforms
        if use_syscmd_ver:
            system, release, version = _syscmd_ver(system)
            # Normalize system to what win32_ver() normally returns
            # (_syscmd_ver() tends to return the vendor name as well)
            if system == 'Microsoft Windows':
                system = 'Windows'
            elif system == 'Microsoft' and release == 'Windows':
                # Under Windows Vista and Windows Server 2008,
                # Microsoft changed the output of the ver command. The
                # release is no longer printed.  This causes the
                # system and release to be misidentified.
                system = 'Windows'
                if '6.0' == version[:3]:
                    release = 'Vista'
                else:
                    release = ''

        # In case we still don't know anything useful, we'll try to
        # help ourselves
        if system in ('win32', 'win16'):
            if not version:
                if system == 'win32':
                    version = '32bit'
                else:
                    version = '16bit'
            system = 'Windows'

        elif system[:4] == 'java':
            release, vendor, vminfo, osinfo = java_ver()
            system = 'Java'
            version = ', '.join(vminfo)
            if not version:
                version = vendor

    # System specific extensions
    if system == 'OpenVMS':
        # OpenVMS seems to have release and version mixed up
        if not release or release == '0':
            release = version
            version = ''
        # Get processor information
        try:
            import vms_lib
        except ImportError:
            pass
        else:
            csid, cpu_number = vms_lib.getsyi('SYI$_CPU', 0)
            if (cpu_number >= 128):
                processor = 'Alpha'
            else:
                processor = 'VAX'
    if not processor:
        # Get processor information from the uname system command
        processor = _syscmd_uname('-p', '')

    #If any unknowns still exist, replace them with ''s, which are more portable
    if system == 'unknown':
        system = ''
    if node == 'unknown':
        node = ''
    if release == 'unknown':
        release = ''
    if version == 'unknown':
        version = ''
    if machine == 'unknown':
        machine = ''
    if processor == 'unknown':
        processor = ''

    #  normalize name
    if system == 'Microsoft' and release == 'Windows':
        system = 'Windows'
        release = 'Vista'

    _uname_cache = uname_result(system, node, release, version,
                                machine, processor)
    return _uname_cache

### Direct interfaces to some of the uname() return values

def system():

    """ Returns the system/OS name, e.g. 'Linux', 'Windows' or 'Java'.

        An empty string is returned if the value cannot be determined.

    """
    return uname().system

def node():

    """ Returns the computer's network name (which may not be fully
        qualified)

        An empty string is returned if the value cannot be determined.

    """
    return uname().node

def release():

    """ Returns the system's release, e.g. '2.2.0' or 'NT'

        An empty string is returned if the value cannot be determined.

    """
    return uname().release

def version():

    """ Returns the system's release version, e.g. '#3 on degas'

        An empty string is returned if the value cannot be determined.

    """
    return uname().version

def machine():

    """ Returns the machine type, e.g. 'i386'

        An empty string is returned if the value cannot be determined.

    """
    return uname().machine

def processor():

    """ Returns the (true) processor name, e.g. 'amdk6'

        An empty string is returned if the value cannot be
        determined. Note that many platforms do not provide this
        information or simply return the same value as for machine(),
        e.g.  NetBSD does this.

    """
    return uname().processor

### Various APIs for extracting information from sys.version

_sys_version_parser = re.compile(
    r'([\w.+]+)\s*'  # "version<space>"
    r'\(#?([^,]+)'  # "(#buildno"
    r'(?:,\s*([\w ]*)'  # ", builddate"
    r'(?:,\s*([\w :]*))?)?\)\s*'  # ", buildtime)<space>"
    r'\[([^\]]+)\]?', re.ASCII)  # "[compiler]"

_ironpython_sys_version_parser = re.compile(
    r'IronPython\s*'
    r'([\d\.]+)'
    r'(?: \(([\d\.]+)\))?'
    r' on (.NET [\d\.]+)', re.ASCII)

# IronPython covering 2.6 and 2.7
_ironpython26_sys_version_parser = re.compile(
    r'([\d.]+)\s*'
    r'\(IronPython\s*'
    r'[\d.]+\s*'
    r'\(([\d.]+)\) on ([\w.]+ [\d.]+(?: \(\d+-bit\))?)\)'
)

_pypy_sys_version_parser = re.compile(
    r'([\w.+]+)\s*'
    r'\(#?([^,]+),\s*([\w ]+),\s*([\w :]+)\)\s*'
    r'\[PyPy [^\]]+\]?')

_sys_version_cache = {}

def _sys_version(sys_version=None):

    """ Returns a parsed version of Python's sys.version as tuple
        (name, version, branch, revision, buildno, builddate, compiler)
        referring to the Python implementation name, version, branch,
        revision, build number, build date/time as string and the compiler
        identification string.

        Note that unlike the Python sys.version, the returned value
        for the Python version will always include the patchlevel (it
        defaults to '.0').

        The function returns empty strings for tuple entries that
        cannot be determined.

        sys_version may be given to parse an alternative version
        string, e.g. if the version was read from a different Python
        interpreter.

    """
    # Get the Python version
    if sys_version is None:
        sys_version = sys.version

    # Try the cache first
    result = _sys_version_cache.get(sys_version, None)
    if result is not None:
        return result

    # Parse it
    if 'IronPython' in sys_version:
        # IronPython
        name = 'IronPython'
        if sys_version.startswith('IronPython'):
            match = _ironpython_sys_version_parser.match(sys_version)
        else:
            match = _ironpython26_sys_version_parser.match(sys_version)

        if match is None:
            raise ValueError(
                'failed to parse IronPython sys.version: %s' %
                repr(sys_version))

        version, alt_version, compiler = match.groups()
        buildno = ''
        builddate = ''

    elif sys.platform.startswith('java'):
        # Jython
        name = 'Jython'
        match = _sys_version_parser.match(sys_version)
        if match is None:
            raise ValueError(
                'failed to parse Jython sys.version: %s' %
                repr(sys_version))
        version, buildno, builddate, buildtime, _ = match.groups()
        if builddate is None:
            builddate = ''
        compiler = sys.platform

    elif "PyPy" in sys_version:
        # PyPy
        name = "PyPy"
        match = _pypy_sys_version_parser.match(sys_version)
        if match is None:
            raise ValueError("failed to parse PyPy sys.version: %s" %
                             repr(sys_version))
        version, buildno, builddate, buildtime = match.groups()
        compiler = ""

    else:
        # CPython
        match = _sys_version_parser.match(sys_version)
        if match is None:
            raise ValueError(
                'failed to parse CPython sys.version: %s' %
                repr(sys_version))
        version, buildno, builddate, buildtime, compiler = \
              match.groups()
        name = 'CPython'
        if builddate is None:
            builddate = ''
        elif buildtime:
            builddate = builddate + ' ' + buildtime

    if hasattr(sys, '_git'):
        _, branch, revision = sys._git
    elif hasattr(sys, '_mercurial'):
        _, branch, revision = sys._mercurial
    else:
        branch = ''
        revision = ''

    # Add the patchlevel version if missing
    l = version.split('.')
    if len(l) == 2:
        l.append('0')
        version = '.'.join(l)

    # Build and cache the result
    result = (name, version, branch, revision, buildno, builddate, compiler)
    _sys_version_cache[sys_version] = result
    return result

def python_implementation():

    """ Returns a string identifying the Python implementation.

        Currently, the following implementations are identified:
          'CPython' (C implementation of Python),
          'IronPython' (.NET implementation of Python),
          'Jython' (Java implementation of Python),
          'PyPy' (Python implementation of Python).

    """
    return _sys_version()[0]

def python_version():

    """ Returns the Python version as string 'major.minor.patchlevel'

        Note that unlike the Python sys.version, the returned value
        will always include the patchlevel (it defaults to 0).

    """
    return _sys_version()[1]

def python_version_tuple():

    """ Returns the Python version as tuple (major, minor, patchlevel)
        of strings.

        Note that unlike the Python sys.version, the returned value
        will always include the patchlevel (it defaults to 0).

    """
    return tuple(_sys_version()[1].split('.'))

def python_branch():

    """ Returns a string identifying the Python implementation
        branch.

        For CPython this is the SCM branch from which the
        Python binary was built.

        If not available, an empty string is returned.

    """

    return _sys_version()[2]

def python_revision():

    """ Returns a string identifying the Python implementation
        revision.

        For CPython this is the SCM revision from which the
        Python binary was built.

        If not available, an empty string is returned.

    """
    return _sys_version()[3]

def python_build():

    """ Returns a tuple (buildno, builddate) stating the Python
        build number and date as strings.

    """
    return _sys_version()[4:6]

def python_compiler():

    """ Returns a string identifying the compiler used for compiling
        Python.

    """
    return _sys_version()[6]

### The Opus Magnum of platform strings :-)

_platform_cache = {}

def platform(aliased=0, terse=0):

    """ Returns a single string identifying the underlying platform
        with as much useful information as possible (but no more :).

        The output is intended to be human readable rather than
        machine parseable. It may look different on different
        platforms and this is intended.

        If "aliased" is true, the function will use aliases for
        various platforms that report system names which differ from
        their common names, e.g. SunOS will be reported as
        Solaris. The system_alias() function is used to implement
        this.

        Setting terse to true causes the function to return only the
        absolute minimum information needed to identify the platform.

    """
    result = _platform_cache.get((aliased, terse), None)
    if result is not None:
        return result

    # Get uname information and then apply platform specific cosmetics
    # to it...
    system, node, release, version, machine, processor = uname()
    if machine == processor:
        processor = ''
    if aliased:
        system, release, version = system_alias(system, release, version)

    if system == 'Darwin':
        # macOS (darwin kernel)
        macos_release = mac_ver()[0]
        if macos_release:
            system = 'macOS'
            release = macos_release

    if system == 'Windows':
        # MS platforms
        rel, vers, csd, ptype = win32_ver(version)
        if terse:
            platform = _platform(system, release)
        else:
            platform = _platform(system, release, version, csd)

    elif system in ('Linux',):
        # check for libc vs. glibc
        libcname, libcversion = libc_ver(sys.executable)
        platform = _platform(system, release, machine, processor,
                             'with',
                             libcname+libcversion)
    elif system == 'Java':
        # Java platforms
        r, v, vminfo, (os_name, os_version, os_arch) = java_ver()
        if terse or not os_name:
            platform = _platform(system, release, version)
        else:
            platform = _platform(system, release, version,
                                 'on',
                                 os_name, os_version, os_arch)

    else:
        # Generic handler
        if terse:
            platform = _platform(system, release)
        else:
            bits, linkage = architecture(sys.executable)
            platform = _platform(system, release, machine,
                                 processor, bits, linkage)

    _platform_cache[(aliased, terse)] = platform
    return platform

### Command line interface

if __name__ == '__main__':
    # Default is to print the aliased verbose platform string
    terse = ('terse' in sys.argv or '--terse' in sys.argv)
    aliased = (not 'nonaliased' in sys.argv and not '--nonaliased' in sys.argv)
    print(platform(aliased, terse))
    sys.exit(0)
gzip.py000064400000051645151153537440006112 0ustar00"""Functions that read and write gzipped files.

The user of the file doesn't have to worry about the compression,
but random access is not allowed."""

# based on Andrew Kuchling's minigzip.py distributed with the zlib module

import struct, sys, time, os
import zlib
import builtins
import io
import _compression

__all__ = ["BadGzipFile", "GzipFile", "open", "compress", "decompress"]

FTEXT, FHCRC, FEXTRA, FNAME, FCOMMENT = 1, 2, 4, 8, 16

READ, WRITE = 1, 2

_COMPRESS_LEVEL_FAST = 1
_COMPRESS_LEVEL_TRADEOFF = 6
_COMPRESS_LEVEL_BEST = 9


def open(filename, mode="rb", compresslevel=_COMPRESS_LEVEL_BEST,
         encoding=None, errors=None, newline=None):
    """Open a gzip-compressed file in binary or text mode.

    The filename argument can be an actual filename (a str or bytes object), or
    an existing file object to read from or write to.

    The mode argument can be "r", "rb", "w", "wb", "x", "xb", "a" or "ab" for
    binary mode, or "rt", "wt", "xt" or "at" for text mode. The default mode is
    "rb", and the default compresslevel is 9.

    For binary mode, this function is equivalent to the GzipFile constructor:
    GzipFile(filename, mode, compresslevel). In this case, the encoding, errors
    and newline arguments must not be provided.

    For text mode, a GzipFile object is created, and wrapped in an
    io.TextIOWrapper instance with the specified encoding, error handling
    behavior, and line ending(s).

    """
    if "t" in mode:
        if "b" in mode:
            raise ValueError("Invalid mode: %r" % (mode,))
    else:
        if encoding is not None:
            raise ValueError("Argument 'encoding' not supported in binary mode")
        if errors is not None:
            raise ValueError("Argument 'errors' not supported in binary mode")
        if newline is not None:
            raise ValueError("Argument 'newline' not supported in binary mode")

    gz_mode = mode.replace("t", "")
    if isinstance(filename, (str, bytes, os.PathLike)):
        binary_file = GzipFile(filename, gz_mode, compresslevel)
    elif hasattr(filename, "read") or hasattr(filename, "write"):
        binary_file = GzipFile(None, gz_mode, compresslevel, filename)
    else:
        raise TypeError("filename must be a str or bytes object, or a file")

    if "t" in mode:
        return io.TextIOWrapper(binary_file, encoding, errors, newline)
    else:
        return binary_file

def write32u(output, value):
    # The L format writes the bit pattern correctly whether signed
    # or unsigned.
    output.write(struct.pack("<L", value))

class _PaddedFile:
    """Minimal read-only file object that prepends a string to the contents
    of an actual file. Shouldn't be used outside of gzip.py, as it lacks
    essential functionality."""

    def __init__(self, f, prepend=b''):
        self._buffer = prepend
        self._length = len(prepend)
        self.file = f
        self._read = 0

    def read(self, size):
        if self._read is None:
            return self.file.read(size)
        if self._read + size <= self._length:
            read = self._read
            self._read += size
            return self._buffer[read:self._read]
        else:
            read = self._read
            self._read = None
            return self._buffer[read:] + \
                   self.file.read(size-self._length+read)

    def prepend(self, prepend=b''):
        if self._read is None:
            self._buffer = prepend
        else:  # Assume data was read since the last prepend() call
            self._read -= len(prepend)
            return
        self._length = len(self._buffer)
        self._read = 0

    def seek(self, off):
        self._read = None
        self._buffer = None
        return self.file.seek(off)

    def seekable(self):
        return True  # Allows fast-forwarding even in unseekable streams


class BadGzipFile(OSError):
    """Exception raised in some cases for invalid gzip files."""


class GzipFile(_compression.BaseStream):
    """The GzipFile class simulates most of the methods of a file object with
    the exception of the truncate() method.

    This class only supports opening files in binary mode. If you need to open a
    compressed file in text mode, use the gzip.open() function.

    """

    # Overridden with internal file object to be closed, if only a filename
    # is passed in
    myfileobj = None

    def __init__(self, filename=None, mode=None,
                 compresslevel=_COMPRESS_LEVEL_BEST, fileobj=None, mtime=None):
        """Constructor for the GzipFile class.

        At least one of fileobj and filename must be given a
        non-trivial value.

        The new class instance is based on fileobj, which can be a regular
        file, an io.BytesIO object, or any other object which simulates a file.
        It defaults to None, in which case filename is opened to provide
        a file object.

        When fileobj is not None, the filename argument is only used to be
        included in the gzip file header, which may include the original
        filename of the uncompressed file.  It defaults to the filename of
        fileobj, if discernible; otherwise, it defaults to the empty string,
        and in this case the original filename is not included in the header.

        The mode argument can be any of 'r', 'rb', 'a', 'ab', 'w', 'wb', 'x', or
        'xb' depending on whether the file will be read or written.  The default
        is the mode of fileobj if discernible; otherwise, the default is 'rb'.
        A mode of 'r' is equivalent to one of 'rb', and similarly for 'w' and
        'wb', 'a' and 'ab', and 'x' and 'xb'.

        The compresslevel argument is an integer from 0 to 9 controlling the
        level of compression; 1 is fastest and produces the least compression,
        and 9 is slowest and produces the most compression. 0 is no compression
        at all. The default is 9.

        The mtime argument is an optional numeric timestamp to be written
        to the last modification time field in the stream when compressing.
        If omitted or None, the current time is used.

        """

        if mode and ('t' in mode or 'U' in mode):
            raise ValueError("Invalid mode: {!r}".format(mode))
        if mode and 'b' not in mode:
            mode += 'b'
        if fileobj is None:
            fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')
        if filename is None:
            filename = getattr(fileobj, 'name', '')
            if not isinstance(filename, (str, bytes)):
                filename = ''
        else:
            filename = os.fspath(filename)
        if mode is None:
            mode = getattr(fileobj, 'mode', 'rb')

        if mode.startswith('r'):
            self.mode = READ
            raw = _GzipReader(fileobj)
            self._buffer = io.BufferedReader(raw)
            self.name = filename

        elif mode.startswith(('w', 'a', 'x')):
            self.mode = WRITE
            self._init_write(filename)
            self.compress = zlib.compressobj(compresslevel,
                                             zlib.DEFLATED,
                                             -zlib.MAX_WBITS,
                                             zlib.DEF_MEM_LEVEL,
                                             0)
            self._write_mtime = mtime
        else:
            raise ValueError("Invalid mode: {!r}".format(mode))

        self.fileobj = fileobj

        if self.mode == WRITE:
            self._write_gzip_header(compresslevel)

    @property
    def filename(self):
        import warnings
        warnings.warn("use the name attribute", DeprecationWarning, 2)
        if self.mode == WRITE and self.name[-3:] != ".gz":
            return self.name + ".gz"
        return self.name

    @property
    def mtime(self):
        """Last modification time read from stream, or None"""
        return self._buffer.raw._last_mtime

    def __repr__(self):
        s = repr(self.fileobj)
        return '<gzip ' + s[1:-1] + ' ' + hex(id(self)) + '>'

    def _init_write(self, filename):
        self.name = filename
        self.crc = zlib.crc32(b"")
        self.size = 0
        self.writebuf = []
        self.bufsize = 0
        self.offset = 0  # Current file offset for seek(), tell(), etc

    def _write_gzip_header(self, compresslevel):
        self.fileobj.write(b'\037\213')             # magic header
        self.fileobj.write(b'\010')                 # compression method
        try:
            # RFC 1952 requires the FNAME field to be Latin-1. Do not
            # include filenames that cannot be represented that way.
            fname = os.path.basename(self.name)
            if not isinstance(fname, bytes):
                fname = fname.encode('latin-1')
            if fname.endswith(b'.gz'):
                fname = fname[:-3]
        except UnicodeEncodeError:
            fname = b''
        flags = 0
        if fname:
            flags = FNAME
        self.fileobj.write(chr(flags).encode('latin-1'))
        mtime = self._write_mtime
        if mtime is None:
            mtime = time.time()
        write32u(self.fileobj, int(mtime))
        if compresslevel == _COMPRESS_LEVEL_BEST:
            xfl = b'\002'
        elif compresslevel == _COMPRESS_LEVEL_FAST:
            xfl = b'\004'
        else:
            xfl = b'\000'
        self.fileobj.write(xfl)
        self.fileobj.write(b'\377')
        if fname:
            self.fileobj.write(fname + b'\000')

    def write(self,data):
        self._check_not_closed()
        if self.mode != WRITE:
            import errno
            raise OSError(errno.EBADF, "write() on read-only GzipFile object")

        if self.fileobj is None:
            raise ValueError("write() on closed GzipFile object")

        if isinstance(data, bytes):
            length = len(data)
        else:
            # accept any data that supports the buffer protocol
            data = memoryview(data)
            length = data.nbytes

        if length > 0:
            self.fileobj.write(self.compress.compress(data))
            self.size += length
            self.crc = zlib.crc32(data, self.crc)
            self.offset += length

        return length

    def read(self, size=-1):
        self._check_not_closed()
        if self.mode != READ:
            import errno
            raise OSError(errno.EBADF, "read() on write-only GzipFile object")
        return self._buffer.read(size)

    def read1(self, size=-1):
        """Implements BufferedIOBase.read1()

        Reads up to a buffer's worth of data if size is negative."""
        self._check_not_closed()
        if self.mode != READ:
            import errno
            raise OSError(errno.EBADF, "read1() on write-only GzipFile object")

        if size < 0:
            size = io.DEFAULT_BUFFER_SIZE
        return self._buffer.read1(size)

    def peek(self, n):
        self._check_not_closed()
        if self.mode != READ:
            import errno
            raise OSError(errno.EBADF, "peek() on write-only GzipFile object")
        return self._buffer.peek(n)

    @property
    def closed(self):
        return self.fileobj is None

    def close(self):
        fileobj = self.fileobj
        if fileobj is None:
            return
        self.fileobj = None
        try:
            if self.mode == WRITE:
                fileobj.write(self.compress.flush())
                write32u(fileobj, self.crc)
                # self.size may exceed 2 GiB, or even 4 GiB
                write32u(fileobj, self.size & 0xffffffff)
            elif self.mode == READ:
                self._buffer.close()
        finally:
            myfileobj = self.myfileobj
            if myfileobj:
                self.myfileobj = None
                myfileobj.close()

    def flush(self,zlib_mode=zlib.Z_SYNC_FLUSH):
        self._check_not_closed()
        if self.mode == WRITE:
            # Ensure the compressor's buffer is flushed
            self.fileobj.write(self.compress.flush(zlib_mode))
            self.fileobj.flush()

    def fileno(self):
        """Invoke the underlying file object's fileno() method.

        This will raise AttributeError if the underlying file object
        doesn't support fileno().
        """
        return self.fileobj.fileno()

    def rewind(self):
        '''Return the uncompressed stream file position indicator to the
        beginning of the file'''
        if self.mode != READ:
            raise OSError("Can't rewind in write mode")
        self._buffer.seek(0)

    def readable(self):
        return self.mode == READ

    def writable(self):
        return self.mode == WRITE

    def seekable(self):
        return True

    def seek(self, offset, whence=io.SEEK_SET):
        if self.mode == WRITE:
            if whence != io.SEEK_SET:
                if whence == io.SEEK_CUR:
                    offset = self.offset + offset
                else:
                    raise ValueError('Seek from end not supported')
            if offset < self.offset:
                raise OSError('Negative seek in write mode')
            count = offset - self.offset
            chunk = b'\0' * 1024
            for i in range(count // 1024):
                self.write(chunk)
            self.write(b'\0' * (count % 1024))
        elif self.mode == READ:
            self._check_not_closed()
            return self._buffer.seek(offset, whence)

        return self.offset

    def readline(self, size=-1):
        self._check_not_closed()
        return self._buffer.readline(size)


class _GzipReader(_compression.DecompressReader):
    def __init__(self, fp):
        super().__init__(_PaddedFile(fp), zlib.decompressobj,
                         wbits=-zlib.MAX_WBITS)
        # Set flag indicating start of a new member
        self._new_member = True
        self._last_mtime = None

    def _init_read(self):
        self._crc = zlib.crc32(b"")
        self._stream_size = 0  # Decompressed size of unconcatenated stream

    def _read_exact(self, n):
        '''Read exactly *n* bytes from `self._fp`

        This method is required because self._fp may be unbuffered,
        i.e. return short reads.
        '''

        data = self._fp.read(n)
        while len(data) < n:
            b = self._fp.read(n - len(data))
            if not b:
                raise EOFError("Compressed file ended before the "
                               "end-of-stream marker was reached")
            data += b
        return data

    def _read_gzip_header(self):
        magic = self._fp.read(2)
        if magic == b'':
            return False

        if magic != b'\037\213':
            raise BadGzipFile('Not a gzipped file (%r)' % magic)

        (method, flag,
         self._last_mtime) = struct.unpack("<BBIxx", self._read_exact(8))
        if method != 8:
            raise BadGzipFile('Unknown compression method')

        if flag & FEXTRA:
            # Read & discard the extra field, if present
            extra_len, = struct.unpack("<H", self._read_exact(2))
            self._read_exact(extra_len)
        if flag & FNAME:
            # Read and discard a null-terminated string containing the filename
            while True:
                s = self._fp.read(1)
                if not s or s==b'\000':
                    break
        if flag & FCOMMENT:
            # Read and discard a null-terminated string containing a comment
            while True:
                s = self._fp.read(1)
                if not s or s==b'\000':
                    break
        if flag & FHCRC:
            self._read_exact(2)     # Read & discard the 16-bit header CRC
        return True

    def read(self, size=-1):
        if size < 0:
            return self.readall()
        # size=0 is special because decompress(max_length=0) is not supported
        if not size:
            return b""

        # For certain input data, a single
        # call to decompress() may not return
        # any data. In this case, retry until we get some data or reach EOF.
        while True:
            if self._decompressor.eof:
                # Ending case: we've come to the end of a member in the file,
                # so finish up this member, and read a new gzip header.
                # Check the CRC and file size, and set the flag so we read
                # a new member
                self._read_eof()
                self._new_member = True
                self._decompressor = self._decomp_factory(
                    **self._decomp_args)

            if self._new_member:
                # If the _new_member flag is set, we have to
                # jump to the next member, if there is one.
                self._init_read()
                if not self._read_gzip_header():
                    self._size = self._pos
                    return b""
                self._new_member = False

            # Read a chunk of data from the file
            buf = self._fp.read(io.DEFAULT_BUFFER_SIZE)

            uncompress = self._decompressor.decompress(buf, size)
            if self._decompressor.unconsumed_tail != b"":
                self._fp.prepend(self._decompressor.unconsumed_tail)
            elif self._decompressor.unused_data != b"":
                # Prepend the already read bytes to the fileobj so they can
                # be seen by _read_eof() and _read_gzip_header()
                self._fp.prepend(self._decompressor.unused_data)

            if uncompress != b"":
                break
            if buf == b"":
                raise EOFError("Compressed file ended before the "
                               "end-of-stream marker was reached")

        self._add_read_data( uncompress )
        self._pos += len(uncompress)
        return uncompress

    def _add_read_data(self, data):
        self._crc = zlib.crc32(data, self._crc)
        self._stream_size = self._stream_size + len(data)

    def _read_eof(self):
        # We've read to the end of the file
        # We check the that the computed CRC and size of the
        # uncompressed data matches the stored values.  Note that the size
        # stored is the true file size mod 2**32.
        crc32, isize = struct.unpack("<II", self._read_exact(8))
        if crc32 != self._crc:
            raise BadGzipFile("CRC check failed %s != %s" % (hex(crc32),
                                                             hex(self._crc)))
        elif isize != (self._stream_size & 0xffffffff):
            raise BadGzipFile("Incorrect length of data produced")

        # Gzip files can be padded with zeroes and still have archives.
        # Consume all zero bytes and set the file position to the first
        # non-zero byte. See http://www.gzip.org/#faq8
        c = b"\x00"
        while c == b"\x00":
            c = self._fp.read(1)
        if c:
            self._fp.prepend(c)

    def _rewind(self):
        super()._rewind()
        self._new_member = True

def compress(data, compresslevel=_COMPRESS_LEVEL_BEST, *, mtime=None):
    """Compress data in one shot and return the compressed string.
    Optional argument is the compression level, in range of 0-9.
    """
    buf = io.BytesIO()
    with GzipFile(fileobj=buf, mode='wb', compresslevel=compresslevel, mtime=mtime) as f:
        f.write(data)
    return buf.getvalue()

def decompress(data):
    """Decompress a gzip compressed string in one shot.
    Return the decompressed string.
    """
    with GzipFile(fileobj=io.BytesIO(data)) as f:
        return f.read()


def main():
    from argparse import ArgumentParser
    parser = ArgumentParser(description=
        "A simple command line interface for the gzip module: act like gzip, "
        "but do not delete the input file.")
    group = parser.add_mutually_exclusive_group()
    group.add_argument('--fast', action='store_true', help='compress faster')
    group.add_argument('--best', action='store_true', help='compress better')
    group.add_argument("-d", "--decompress", action="store_true",
                        help="act like gunzip instead of gzip")

    parser.add_argument("args", nargs="*", default=["-"], metavar='file')
    args = parser.parse_args()

    compresslevel = _COMPRESS_LEVEL_TRADEOFF
    if args.fast:
        compresslevel = _COMPRESS_LEVEL_FAST
    elif args.best:
        compresslevel = _COMPRESS_LEVEL_BEST

    for arg in args.args:
        if args.decompress:
            if arg == "-":
                f = GzipFile(filename="", mode="rb", fileobj=sys.stdin.buffer)
                g = sys.stdout.buffer
            else:
                if arg[-3:] != ".gz":
                    sys.exit(f"filename doesn't end in .gz: {arg!r}")
                f = open(arg, "rb")
                g = builtins.open(arg[:-3], "wb")
        else:
            if arg == "-":
                f = sys.stdin.buffer
                g = GzipFile(filename="", mode="wb", fileobj=sys.stdout.buffer,
                             compresslevel=compresslevel)
            else:
                f = builtins.open(arg, "rb")
                g = open(arg + ".gz", "wb")
        while True:
            chunk = f.read(1024)
            if not chunk:
                break
            g.write(chunk)
        if g is not sys.stdout.buffer:
            g.close()
        if f is not sys.stdin.buffer:
            f.close()

if __name__ == '__main__':
    main()
cmd.py000064400000035014151153537440005674 0ustar00"""A generic class to build line-oriented command interpreters.

Interpreters constructed with this class obey the following conventions:

1. End of file on input is processed as the command 'EOF'.
2. A command is parsed out of each line by collecting the prefix composed
   of characters in the identchars member.
3. A command `foo' is dispatched to a method 'do_foo()'; the do_ method
   is passed a single argument consisting of the remainder of the line.
4. Typing an empty line repeats the last command.  (Actually, it calls the
   method `emptyline', which may be overridden in a subclass.)
5. There is a predefined `help' method.  Given an argument `topic', it
   calls the command `help_topic'.  With no arguments, it lists all topics
   with defined help_ functions, broken into up to three topics; documented
   commands, miscellaneous help topics, and undocumented commands.
6. The command '?' is a synonym for `help'.  The command '!' is a synonym
   for `shell', if a do_shell method exists.
7. If completion is enabled, completing commands will be done automatically,
   and completing of commands args is done by calling complete_foo() with
   arguments text, line, begidx, endidx.  text is string we are matching
   against, all returned matches must begin with it.  line is the current
   input line (lstripped), begidx and endidx are the beginning and end
   indexes of the text being matched, which could be used to provide
   different completion depending upon which position the argument is in.

The `default' method may be overridden to intercept commands for which there
is no do_ method.

The `completedefault' method may be overridden to intercept completions for
commands that have no complete_ method.

The data member `self.ruler' sets the character used to draw separator lines
in the help messages.  If empty, no ruler line is drawn.  It defaults to "=".

If the value of `self.intro' is nonempty when the cmdloop method is called,
it is printed out on interpreter startup.  This value may be overridden
via an optional argument to the cmdloop() method.

The data members `self.doc_header', `self.misc_header', and
`self.undoc_header' set the headers used for the help function's
listings of documented functions, miscellaneous topics, and undocumented
functions respectively.
"""

import string, sys

__all__ = ["Cmd"]

PROMPT = '(Cmd) '
IDENTCHARS = string.ascii_letters + string.digits + '_'

class Cmd:
    """A simple framework for writing line-oriented command interpreters.

    These are often useful for test harnesses, administrative tools, and
    prototypes that will later be wrapped in a more sophisticated interface.

    A Cmd instance or subclass instance is a line-oriented interpreter
    framework.  There is no good reason to instantiate Cmd itself; rather,
    it's useful as a superclass of an interpreter class you define yourself
    in order to inherit Cmd's methods and encapsulate action methods.

    """
    prompt = PROMPT
    identchars = IDENTCHARS
    ruler = '='
    lastcmd = ''
    intro = None
    doc_leader = ""
    doc_header = "Documented commands (type help <topic>):"
    misc_header = "Miscellaneous help topics:"
    undoc_header = "Undocumented commands:"
    nohelp = "*** No help on %s"
    use_rawinput = 1

    def __init__(self, completekey='tab', stdin=None, stdout=None):
        """Instantiate a line-oriented interpreter framework.

        The optional argument 'completekey' is the readline name of a
        completion key; it defaults to the Tab key. If completekey is
        not None and the readline module is available, command completion
        is done automatically. The optional arguments stdin and stdout
        specify alternate input and output file objects; if not specified,
        sys.stdin and sys.stdout are used.

        """
        if stdin is not None:
            self.stdin = stdin
        else:
            self.stdin = sys.stdin
        if stdout is not None:
            self.stdout = stdout
        else:
            self.stdout = sys.stdout
        self.cmdqueue = []
        self.completekey = completekey

    def cmdloop(self, intro=None):
        """Repeatedly issue a prompt, accept input, parse an initial prefix
        off the received input, and dispatch to action methods, passing them
        the remainder of the line as argument.

        """

        self.preloop()
        if self.use_rawinput and self.completekey:
            try:
                import readline
                self.old_completer = readline.get_completer()
                readline.set_completer(self.complete)
                readline.parse_and_bind(self.completekey+": complete")
            except ImportError:
                pass
        try:
            if intro is not None:
                self.intro = intro
            if self.intro:
                self.stdout.write(str(self.intro)+"\n")
            stop = None
            while not stop:
                if self.cmdqueue:
                    line = self.cmdqueue.pop(0)
                else:
                    if self.use_rawinput:
                        try:
                            line = input(self.prompt)
                        except EOFError:
                            line = 'EOF'
                    else:
                        self.stdout.write(self.prompt)
                        self.stdout.flush()
                        line = self.stdin.readline()
                        if not len(line):
                            line = 'EOF'
                        else:
                            line = line.rstrip('\r\n')
                line = self.precmd(line)
                stop = self.onecmd(line)
                stop = self.postcmd(stop, line)
            self.postloop()
        finally:
            if self.use_rawinput and self.completekey:
                try:
                    import readline
                    readline.set_completer(self.old_completer)
                except ImportError:
                    pass


    def precmd(self, line):
        """Hook method executed just before the command line is
        interpreted, but after the input prompt is generated and issued.

        """
        return line

    def postcmd(self, stop, line):
        """Hook method executed just after a command dispatch is finished."""
        return stop

    def preloop(self):
        """Hook method executed once when the cmdloop() method is called."""
        pass

    def postloop(self):
        """Hook method executed once when the cmdloop() method is about to
        return.

        """
        pass

    def parseline(self, line):
        """Parse the line into a command name and a string containing
        the arguments.  Returns a tuple containing (command, args, line).
        'command' and 'args' may be None if the line couldn't be parsed.
        """
        line = line.strip()
        if not line:
            return None, None, line
        elif line[0] == '?':
            line = 'help ' + line[1:]
        elif line[0] == '!':
            if hasattr(self, 'do_shell'):
                line = 'shell ' + line[1:]
            else:
                return None, None, line
        i, n = 0, len(line)
        while i < n and line[i] in self.identchars: i = i+1
        cmd, arg = line[:i], line[i:].strip()
        return cmd, arg, line

    def onecmd(self, line):
        """Interpret the argument as though it had been typed in response
        to the prompt.

        This may be overridden, but should not normally need to be;
        see the precmd() and postcmd() methods for useful execution hooks.
        The return value is a flag indicating whether interpretation of
        commands by the interpreter should stop.

        """
        cmd, arg, line = self.parseline(line)
        if not line:
            return self.emptyline()
        if cmd is None:
            return self.default(line)
        self.lastcmd = line
        if line == 'EOF' :
            self.lastcmd = ''
        if cmd == '':
            return self.default(line)
        else:
            try:
                func = getattr(self, 'do_' + cmd)
            except AttributeError:
                return self.default(line)
            return func(arg)

    def emptyline(self):
        """Called when an empty line is entered in response to the prompt.

        If this method is not overridden, it repeats the last nonempty
        command entered.

        """
        if self.lastcmd:
            return self.onecmd(self.lastcmd)

    def default(self, line):
        """Called on an input line when the command prefix is not recognized.

        If this method is not overridden, it prints an error message and
        returns.

        """
        self.stdout.write('*** Unknown syntax: %s\n'%line)

    def completedefault(self, *ignored):
        """Method called to complete an input line when no command-specific
        complete_*() method is available.

        By default, it returns an empty list.

        """
        return []

    def completenames(self, text, *ignored):
        dotext = 'do_'+text
        return [a[3:] for a in self.get_names() if a.startswith(dotext)]

    def complete(self, text, state):
        """Return the next possible completion for 'text'.

        If a command has not been entered, then complete against command list.
        Otherwise try to call complete_<command> to get list of completions.
        """
        if state == 0:
            import readline
            origline = readline.get_line_buffer()
            line = origline.lstrip()
            stripped = len(origline) - len(line)
            begidx = readline.get_begidx() - stripped
            endidx = readline.get_endidx() - stripped
            if begidx>0:
                cmd, args, foo = self.parseline(line)
                if cmd == '':
                    compfunc = self.completedefault
                else:
                    try:
                        compfunc = getattr(self, 'complete_' + cmd)
                    except AttributeError:
                        compfunc = self.completedefault
            else:
                compfunc = self.completenames
            self.completion_matches = compfunc(text, line, begidx, endidx)
        try:
            return self.completion_matches[state]
        except IndexError:
            return None

    def get_names(self):
        # This method used to pull in base class attributes
        # at a time dir() didn't do it yet.
        return dir(self.__class__)

    def complete_help(self, *args):
        commands = set(self.completenames(*args))
        topics = set(a[5:] for a in self.get_names()
                     if a.startswith('help_' + args[0]))
        return list(commands | topics)

    def do_help(self, arg):
        'List available commands with "help" or detailed help with "help cmd".'
        if arg:
            # XXX check arg syntax
            try:
                func = getattr(self, 'help_' + arg)
            except AttributeError:
                try:
                    doc=getattr(self, 'do_' + arg).__doc__
                    if doc:
                        self.stdout.write("%s\n"%str(doc))
                        return
                except AttributeError:
                    pass
                self.stdout.write("%s\n"%str(self.nohelp % (arg,)))
                return
            func()
        else:
            names = self.get_names()
            cmds_doc = []
            cmds_undoc = []
            help = {}
            for name in names:
                if name[:5] == 'help_':
                    help[name[5:]]=1
            names.sort()
            # There can be duplicates if routines overridden
            prevname = ''
            for name in names:
                if name[:3] == 'do_':
                    if name == prevname:
                        continue
                    prevname = name
                    cmd=name[3:]
                    if cmd in help:
                        cmds_doc.append(cmd)
                        del help[cmd]
                    elif getattr(self, name).__doc__:
                        cmds_doc.append(cmd)
                    else:
                        cmds_undoc.append(cmd)
            self.stdout.write("%s\n"%str(self.doc_leader))
            self.print_topics(self.doc_header,   cmds_doc,   15,80)
            self.print_topics(self.misc_header,  list(help.keys()),15,80)
            self.print_topics(self.undoc_header, cmds_undoc, 15,80)

    def print_topics(self, header, cmds, cmdlen, maxcol):
        if cmds:
            self.stdout.write("%s\n"%str(header))
            if self.ruler:
                self.stdout.write("%s\n"%str(self.ruler * len(header)))
            self.columnize(cmds, maxcol-1)
            self.stdout.write("\n")

    def columnize(self, list, displaywidth=80):
        """Display a list of strings as a compact set of columns.

        Each column is only as wide as necessary.
        Columns are separated by two spaces (one was not legible enough).
        """
        if not list:
            self.stdout.write("<empty>\n")
            return

        nonstrings = [i for i in range(len(list))
                        if not isinstance(list[i], str)]
        if nonstrings:
            raise TypeError("list[i] not a string for i in %s"
                            % ", ".join(map(str, nonstrings)))
        size = len(list)
        if size == 1:
            self.stdout.write('%s\n'%str(list[0]))
            return
        # Try every row count from 1 upwards
        for nrows in range(1, len(list)):
            ncols = (size+nrows-1) // nrows
            colwidths = []
            totwidth = -2
            for col in range(ncols):
                colwidth = 0
                for row in range(nrows):
                    i = row + nrows*col
                    if i >= size:
                        break
                    x = list[i]
                    colwidth = max(colwidth, len(x))
                colwidths.append(colwidth)
                totwidth += colwidth + 2
                if totwidth > displaywidth:
                    break
            if totwidth <= displaywidth:
                break
        else:
            nrows = len(list)
            ncols = 1
            colwidths = [0]
        for row in range(nrows):
            texts = []
            for col in range(ncols):
                i = row + nrows*col
                if i >= size:
                    x = ""
                else:
                    x = list[i]
                texts.append(x)
            while texts and not texts[-1]:
                del texts[-1]
            for col in range(len(texts)):
                texts[col] = texts[col].ljust(colwidths[col])
            self.stdout.write("%s\n"%str("  ".join(texts)))
tracemalloc.py000064400000041264151153537440007423 0ustar00from collections.abc import Sequence, Iterable
from functools import total_ordering
import fnmatch
import linecache
import os.path
import pickle

# Import types and functions implemented in C
from _tracemalloc import *
from _tracemalloc import _get_object_traceback, _get_traces


def _format_size(size, sign):
    for unit in ('B', 'KiB', 'MiB', 'GiB', 'TiB'):
        if abs(size) < 100 and unit != 'B':
            # 3 digits (xx.x UNIT)
            if sign:
                return "%+.1f %s" % (size, unit)
            else:
                return "%.1f %s" % (size, unit)
        if abs(size) < 10 * 1024 or unit == 'TiB':
            # 4 or 5 digits (xxxx UNIT)
            if sign:
                return "%+.0f %s" % (size, unit)
            else:
                return "%.0f %s" % (size, unit)
        size /= 1024


class Statistic:
    """
    Statistic difference on memory allocations between two Snapshot instance.
    """

    __slots__ = ('traceback', 'size', 'count')

    def __init__(self, traceback, size, count):
        self.traceback = traceback
        self.size = size
        self.count = count

    def __hash__(self):
        return hash((self.traceback, self.size, self.count))

    def __eq__(self, other):
        return (self.traceback == other.traceback
                and self.size == other.size
                and self.count == other.count)

    def __str__(self):
        text = ("%s: size=%s, count=%i"
                 % (self.traceback,
                    _format_size(self.size, False),
                    self.count))
        if self.count:
            average = self.size / self.count
            text += ", average=%s" % _format_size(average, False)
        return text

    def __repr__(self):
        return ('<Statistic traceback=%r size=%i count=%i>'
                % (self.traceback, self.size, self.count))

    def _sort_key(self):
        return (self.size, self.count, self.traceback)


class StatisticDiff:
    """
    Statistic difference on memory allocations between an old and a new
    Snapshot instance.
    """
    __slots__ = ('traceback', 'size', 'size_diff', 'count', 'count_diff')

    def __init__(self, traceback, size, size_diff, count, count_diff):
        self.traceback = traceback
        self.size = size
        self.size_diff = size_diff
        self.count = count
        self.count_diff = count_diff

    def __hash__(self):
        return hash((self.traceback, self.size, self.size_diff,
                     self.count, self.count_diff))

    def __eq__(self, other):
        return (self.traceback == other.traceback
                and self.size == other.size
                and self.size_diff == other.size_diff
                and self.count == other.count
                and self.count_diff == other.count_diff)

    def __str__(self):
        text = ("%s: size=%s (%s), count=%i (%+i)"
                % (self.traceback,
                   _format_size(self.size, False),
                   _format_size(self.size_diff, True),
                   self.count,
                   self.count_diff))
        if self.count:
            average = self.size / self.count
            text += ", average=%s" % _format_size(average, False)
        return text

    def __repr__(self):
        return ('<StatisticDiff traceback=%r size=%i (%+i) count=%i (%+i)>'
                % (self.traceback, self.size, self.size_diff,
                   self.count, self.count_diff))

    def _sort_key(self):
        return (abs(self.size_diff), self.size,
                abs(self.count_diff), self.count,
                self.traceback)


def _compare_grouped_stats(old_group, new_group):
    statistics = []
    for traceback, stat in new_group.items():
        previous = old_group.pop(traceback, None)
        if previous is not None:
            stat = StatisticDiff(traceback,
                                 stat.size, stat.size - previous.size,
                                 stat.count, stat.count - previous.count)
        else:
            stat = StatisticDiff(traceback,
                                 stat.size, stat.size,
                                 stat.count, stat.count)
        statistics.append(stat)

    for traceback, stat in old_group.items():
        stat = StatisticDiff(traceback, 0, -stat.size, 0, -stat.count)
        statistics.append(stat)
    return statistics


@total_ordering
class Frame:
    """
    Frame of a traceback.
    """
    __slots__ = ("_frame",)

    def __init__(self, frame):
        # frame is a tuple: (filename: str, lineno: int)
        self._frame = frame

    @property
    def filename(self):
        return self._frame[0]

    @property
    def lineno(self):
        return self._frame[1]

    def __eq__(self, other):
        return (self._frame == other._frame)

    def __lt__(self, other):
        return (self._frame < other._frame)

    def __hash__(self):
        return hash(self._frame)

    def __str__(self):
        return "%s:%s" % (self.filename, self.lineno)

    def __repr__(self):
        return "<Frame filename=%r lineno=%r>" % (self.filename, self.lineno)


@total_ordering
class Traceback(Sequence):
    """
    Sequence of Frame instances sorted from the oldest frame
    to the most recent frame.
    """
    __slots__ = ("_frames",)

    def __init__(self, frames):
        Sequence.__init__(self)
        # frames is a tuple of frame tuples: see Frame constructor for the
        # format of a frame tuple; it is reversed, because _tracemalloc
        # returns frames sorted from most recent to oldest, but the
        # Python API expects oldest to most recent
        self._frames = tuple(reversed(frames))

    def __len__(self):
        return len(self._frames)

    def __getitem__(self, index):
        if isinstance(index, slice):
            return tuple(Frame(trace) for trace in self._frames[index])
        else:
            return Frame(self._frames[index])

    def __contains__(self, frame):
        return frame._frame in self._frames

    def __hash__(self):
        return hash(self._frames)

    def __eq__(self, other):
        return (self._frames == other._frames)

    def __lt__(self, other):
        return (self._frames < other._frames)

    def __str__(self):
        return str(self[0])

    def __repr__(self):
        return "<Traceback %r>" % (tuple(self),)

    def format(self, limit=None, most_recent_first=False):
        lines = []
        if limit is not None:
            if limit > 0:
                frame_slice = self[-limit:]
            else:
                frame_slice = self[:limit]
        else:
            frame_slice = self

        if most_recent_first:
            frame_slice = reversed(frame_slice)
        for frame in frame_slice:
            lines.append('  File "%s", line %s'
                         % (frame.filename, frame.lineno))
            line = linecache.getline(frame.filename, frame.lineno).strip()
            if line:
                lines.append('    %s' % line)
        return lines


def get_object_traceback(obj):
    """
    Get the traceback where the Python object *obj* was allocated.
    Return a Traceback instance.

    Return None if the tracemalloc module is not tracing memory allocations or
    did not trace the allocation of the object.
    """
    frames = _get_object_traceback(obj)
    if frames is not None:
        return Traceback(frames)
    else:
        return None


class Trace:
    """
    Trace of a memory block.
    """
    __slots__ = ("_trace",)

    def __init__(self, trace):
        # trace is a tuple: (domain: int, size: int, traceback: tuple).
        # See Traceback constructor for the format of the traceback tuple.
        self._trace = trace

    @property
    def domain(self):
        return self._trace[0]

    @property
    def size(self):
        return self._trace[1]

    @property
    def traceback(self):
        return Traceback(self._trace[2])

    def __eq__(self, other):
        return (self._trace == other._trace)

    def __hash__(self):
        return hash(self._trace)

    def __str__(self):
        return "%s: %s" % (self.traceback, _format_size(self.size, False))

    def __repr__(self):
        return ("<Trace domain=%s size=%s, traceback=%r>"
                % (self.domain, _format_size(self.size, False), self.traceback))


class _Traces(Sequence):
    def __init__(self, traces):
        Sequence.__init__(self)
        # traces is a tuple of trace tuples: see Trace constructor
        self._traces = traces

    def __len__(self):
        return len(self._traces)

    def __getitem__(self, index):
        if isinstance(index, slice):
            return tuple(Trace(trace) for trace in self._traces[index])
        else:
            return Trace(self._traces[index])

    def __contains__(self, trace):
        return trace._trace in self._traces

    def __eq__(self, other):
        return (self._traces == other._traces)

    def __repr__(self):
        return "<Traces len=%s>" % len(self)


def _normalize_filename(filename):
    filename = os.path.normcase(filename)
    if filename.endswith('.pyc'):
        filename = filename[:-1]
    return filename


class BaseFilter:
    def __init__(self, inclusive):
        self.inclusive = inclusive

    def _match(self, trace):
        raise NotImplementedError


class Filter(BaseFilter):
    def __init__(self, inclusive, filename_pattern,
                 lineno=None, all_frames=False, domain=None):
        super().__init__(inclusive)
        self.inclusive = inclusive
        self._filename_pattern = _normalize_filename(filename_pattern)
        self.lineno = lineno
        self.all_frames = all_frames
        self.domain = domain

    @property
    def filename_pattern(self):
        return self._filename_pattern

    def _match_frame_impl(self, filename, lineno):
        filename = _normalize_filename(filename)
        if not fnmatch.fnmatch(filename, self._filename_pattern):
            return False
        if self.lineno is None:
            return True
        else:
            return (lineno == self.lineno)

    def _match_frame(self, filename, lineno):
        return self._match_frame_impl(filename, lineno) ^ (not self.inclusive)

    def _match_traceback(self, traceback):
        if self.all_frames:
            if any(self._match_frame_impl(filename, lineno)
                   for filename, lineno in traceback):
                return self.inclusive
            else:
                return (not self.inclusive)
        else:
            filename, lineno = traceback[0]
            return self._match_frame(filename, lineno)

    def _match(self, trace):
        domain, size, traceback = trace
        res = self._match_traceback(traceback)
        if self.domain is not None:
            if self.inclusive:
                return res and (domain == self.domain)
            else:
                return res or (domain != self.domain)
        return res


class DomainFilter(BaseFilter):
    def __init__(self, inclusive, domain):
        super().__init__(inclusive)
        self._domain = domain

    @property
    def domain(self):
        return self._domain

    def _match(self, trace):
        domain, size, traceback = trace
        return (domain == self.domain) ^ (not self.inclusive)


class Snapshot:
    """
    Snapshot of traces of memory blocks allocated by Python.
    """

    def __init__(self, traces, traceback_limit):
        # traces is a tuple of trace tuples: see _Traces constructor for
        # the exact format
        self.traces = _Traces(traces)
        self.traceback_limit = traceback_limit

    def dump(self, filename):
        """
        Write the snapshot into a file.
        """
        with open(filename, "wb") as fp:
            pickle.dump(self, fp, pickle.HIGHEST_PROTOCOL)

    @staticmethod
    def load(filename):
        """
        Load a snapshot from a file.
        """
        with open(filename, "rb") as fp:
            return pickle.load(fp)

    def _filter_trace(self, include_filters, exclude_filters, trace):
        if include_filters:
            if not any(trace_filter._match(trace)
                       for trace_filter in include_filters):
                return False
        if exclude_filters:
            if any(not trace_filter._match(trace)
                   for trace_filter in exclude_filters):
                return False
        return True

    def filter_traces(self, filters):
        """
        Create a new Snapshot instance with a filtered traces sequence, filters
        is a list of Filter or DomainFilter instances.  If filters is an empty
        list, return a new Snapshot instance with a copy of the traces.
        """
        if not isinstance(filters, Iterable):
            raise TypeError("filters must be a list of filters, not %s"
                            % type(filters).__name__)
        if filters:
            include_filters = []
            exclude_filters = []
            for trace_filter in filters:
                if trace_filter.inclusive:
                    include_filters.append(trace_filter)
                else:
                    exclude_filters.append(trace_filter)
            new_traces = [trace for trace in self.traces._traces
                          if self._filter_trace(include_filters,
                                                exclude_filters,
                                                trace)]
        else:
            new_traces = self.traces._traces.copy()
        return Snapshot(new_traces, self.traceback_limit)

    def _group_by(self, key_type, cumulative):
        if key_type not in ('traceback', 'filename', 'lineno'):
            raise ValueError("unknown key_type: %r" % (key_type,))
        if cumulative and key_type not in ('lineno', 'filename'):
            raise ValueError("cumulative mode cannot by used "
                             "with key type %r" % key_type)

        stats = {}
        tracebacks = {}
        if not cumulative:
            for trace in self.traces._traces:
                domain, size, trace_traceback = trace
                try:
                    traceback = tracebacks[trace_traceback]
                except KeyError:
                    if key_type == 'traceback':
                        frames = trace_traceback
                    elif key_type == 'lineno':
                        frames = trace_traceback[:1]
                    else: # key_type == 'filename':
                        frames = ((trace_traceback[0][0], 0),)
                    traceback = Traceback(frames)
                    tracebacks[trace_traceback] = traceback
                try:
                    stat = stats[traceback]
                    stat.size += size
                    stat.count += 1
                except KeyError:
                    stats[traceback] = Statistic(traceback, size, 1)
        else:
            # cumulative statistics
            for trace in self.traces._traces:
                domain, size, trace_traceback = trace
                for frame in trace_traceback:
                    try:
                        traceback = tracebacks[frame]
                    except KeyError:
                        if key_type == 'lineno':
                            frames = (frame,)
                        else: # key_type == 'filename':
                            frames = ((frame[0], 0),)
                        traceback = Traceback(frames)
                        tracebacks[frame] = traceback
                    try:
                        stat = stats[traceback]
                        stat.size += size
                        stat.count += 1
                    except KeyError:
                        stats[traceback] = Statistic(traceback, size, 1)
        return stats

    def statistics(self, key_type, cumulative=False):
        """
        Group statistics by key_type. Return a sorted list of Statistic
        instances.
        """
        grouped = self._group_by(key_type, cumulative)
        statistics = list(grouped.values())
        statistics.sort(reverse=True, key=Statistic._sort_key)
        return statistics

    def compare_to(self, old_snapshot, key_type, cumulative=False):
        """
        Compute the differences with an old snapshot old_snapshot. Get
        statistics as a sorted list of StatisticDiff instances, grouped by
        group_by.
        """
        new_group = self._group_by(key_type, cumulative)
        old_group = old_snapshot._group_by(key_type, cumulative)
        statistics = _compare_grouped_stats(old_group, new_group)
        statistics.sort(reverse=True, key=StatisticDiff._sort_key)
        return statistics


def take_snapshot():
    """
    Take a snapshot of traces of memory blocks allocated by Python.
    """
    if not is_tracing():
        raise RuntimeError("the tracemalloc module must be tracing memory "
                           "allocations to take a snapshot")
    traces = _get_traces()
    traceback_limit = get_traceback_limit()
    return Snapshot(traces, traceback_limit)
sqlite3/dump.py000064400000005411151153537440007460 0ustar00# Mimic the sqlite3 console shell's .dump command
# Author: Paul Kippes <kippesp@gmail.com>

# Every identifier in sql is quoted based on a comment in sqlite
# documentation "SQLite adds new keywords from time to time when it
# takes on new features. So to prevent your code from being broken by
# future enhancements, you should normally quote any identifier that
# is an English language word, even if you do not have to."

def _iterdump(connection):
    """
    Returns an iterator to the dump of the database in an SQL text format.

    Used to produce an SQL dump of the database.  Useful to save an in-memory
    database for later restoration.  This function should not be called
    directly but instead called from the Connection method, iterdump().
    """

    cu = connection.cursor()
    yield('BEGIN TRANSACTION;')

    # sqlite_master table contains the SQL CREATE statements for the database.
    q = """
        SELECT "name", "type", "sql"
        FROM "sqlite_master"
            WHERE "sql" NOT NULL AND
            "type" == 'table'
            ORDER BY "name"
        """
    schema_res = cu.execute(q)
    for table_name, type, sql in schema_res.fetchall():
        if table_name == 'sqlite_sequence':
            yield('DELETE FROM "sqlite_sequence";')
        elif table_name == 'sqlite_stat1':
            yield('ANALYZE "sqlite_master";')
        elif table_name.startswith('sqlite_'):
            continue
        # NOTE: Virtual table support not implemented
        #elif sql.startswith('CREATE VIRTUAL TABLE'):
        #    qtable = table_name.replace("'", "''")
        #    yield("INSERT INTO sqlite_master(type,name,tbl_name,rootpage,sql)"\
        #        "VALUES('table','{0}','{0}',0,'{1}');".format(
        #        qtable,
        #        sql.replace("''")))
        else:
            yield('{0};'.format(sql))

        # Build the insert statement for each row of the current table
        table_name_ident = table_name.replace('"', '""')
        res = cu.execute('PRAGMA table_info("{0}")'.format(table_name_ident))
        column_names = [str(table_info[1]) for table_info in res.fetchall()]
        q = """SELECT 'INSERT INTO "{0}" VALUES({1})' FROM "{0}";""".format(
            table_name_ident,
            ",".join("""'||quote("{0}")||'""".format(col.replace('"', '""')) for col in column_names))
        query_res = cu.execute(q)
        for row in query_res:
            yield("{0};".format(row[0]))

    # Now when the type is 'index', 'trigger', or 'view'
    q = """
        SELECT "name", "type", "sql"
        FROM "sqlite_master"
            WHERE "sql" NOT NULL AND
            "type" IN ('index', 'trigger', 'view')
        """
    schema_res = cu.execute(q)
    for name, type, sql in schema_res.fetchall():
        yield('{0};'.format(sql))

    yield('COMMIT;')
sqlite3/__init__.py000064400000001772151153537440010260 0ustar00# pysqlite2/__init__.py: the pysqlite2 package.
#
# Copyright (C) 2005 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warranty.  In no event will the authors be held liable for any damages
# arising from the use of this software.
#
# Permission is granted to anyone to use this software for any purpose,
# including commercial applications, and to alter it and redistribute it
# freely, subject to the following restrictions:
#
# 1. The origin of this software must not be misrepresented; you must not
#    claim that you wrote the original software. If you use this software
#    in a product, an acknowledgment in the product documentation would be
#    appreciated but is not required.
# 2. Altered source versions must be plainly marked as such, and must not be
#    misrepresented as being the original software.
# 3. This notice may not be removed or altered from any source distribution.

from sqlite3.dbapi2 import *
sqlite3/__pycache__/dump.cpython-38.opt-1.pyc000064400000003613151153537440014707 0ustar00U

e5d	�@sdd�ZdS)c
cs|��}dVd}|�|�}|��D]�\}}}|dkr>dVn*|dkrNdVn|�d�r\q$nd�|�V|�d	d
�}|�d�|��}dd
�|��D�}	d�|d�dd�|	D���}|�|�}
|
D]}d�|d�Vq�q$d}|�|�}|��D]\}}}d�|�Vq�dVdS)a/
    Returns an iterator to the dump of the database in an SQL text format.

    Used to produce an SQL dump of the database.  Useful to save an in-memory
    database for later restoration.  This function should not be called
    directly but instead called from the Connection method, iterdump().
    zBEGIN TRANSACTION;z�
        SELECT "name", "type", "sql"
        FROM "sqlite_master"
            WHERE "sql" NOT NULL AND
            "type" == 'table'
            ORDER BY "name"
        Zsqlite_sequencezDELETE FROM "sqlite_sequence";Zsqlite_stat1zANALYZE "sqlite_master";Zsqlite_z{0};�"�""zPRAGMA table_info("{0}")cSsg|]}t|d��qS)�)�str)�.0Z
table_info�r�$/usr/lib64/python3.8/sqlite3/dump.py�
<listcomp>3sz_iterdump.<locals>.<listcomp>z2SELECT 'INSERT INTO "{0}" VALUES({1})' FROM "{0}";�,css |]}d�|�dd��VqdS)z'||quote("{0}")||'rrN)�format�replace)r�colrrr�	<genexpr>6sz_iterdump.<locals>.<genexpr>�z�
        SELECT "name", "type", "sql"
        FROM "sqlite_master"
            WHERE "sql" NOT NULL AND
            "type" IN ('index', 'trigger', 'view')
        zCOMMIT;N)ZcursorZexecuteZfetchall�
startswithr
r�join)
Z
connectionZcu�qZ
schema_resZ
table_name�typeZsqlZtable_name_ident�resZcolumn_namesZ	query_res�row�namerrr�	_iterdump
s6	

	�

rN)rrrrr�<module>
�sqlite3/__pycache__/__init__.cpython-38.opt-1.pyc000064400000000242151153537440015474 0ustar00U

e5d��@sddlTdS)�)�*N)Zsqlite3.dbapi2�rr�(/usr/lib64/python3.8/sqlite3/__init__.py�<module>�sqlite3/__pycache__/dbapi2.cpython-38.pyc000064400000004712151153537440014145 0ustar00U

e5d
�@s�ddlZddlZddlZddlTdZdZdZejZ	ejZ
ejZdd�Zdd	�Z
d
d�Zedd
�e�d�D��Zedd
�e�d�D��ZeZejj�e�dd�Ze�[dS)�N)�*Zqmark�z2.0cCstt�|�dd��S)N�)�Date�time�	localtime�Zticks�r	�&/usr/lib64/python3.8/sqlite3/dbapi2.py�
DateFromTicks)srcCstt�|�dd��S)Nr�)�Timerrrr	r	r
�
TimeFromTicks,srcCstt�|�dd��S)Nr)�	Timestamprrrr	r	r
�TimestampFromTicks/srcCsg|]}t|��qSr	��int��.0�xr	r	r
�
<listcomp>2sr�.cCsg|]}t|��qSr	rrr	r	r
r3scCsPdd�}dd�}dd�}dd�}ttj|�ttj|�td	|�td
|�dS)NcSs|��S)N�Z	isoformat��valr	r	r
�
adapt_date9sz4register_adapters_and_converters.<locals>.adapt_datecSs
|�d�S)N� rrr	r	r
�adapt_datetime<sz8register_adapters_and_converters.<locals>.adapt_datetimecSstjtt|�d���S)N�-)�datetime�date�mapr�splitrr	r	r
�convert_date?sz6register_adapters_and_converters.<locals>.convert_datec	Ss�|�d�\}}tt|�d��\}}}|�d�}tt|d�d��\}}}	t|�dkrltd�|d����}
nd}
t�||||||	|
�}|S)	N� r�.r�:�z{:0<6.6}r)r"r!r�len�format�decoder)rZdatepartZtimepartZyearZmonthZdayZ
timepart_fullZhoursZminutesZsecondsZmicrosecondsr	r	r
�convert_timestampBs
z;register_adapters_and_converters.<locals>.convert_timestampr Z	timestamp)Zregister_adapterrr Zregister_converter)rrr#r+r	r	r
� register_adapters_and_converters8s
r,)rrZcollections.abc�collectionsZ_sqlite3Z
paramstyleZthreadsafetyZapilevelr rr
rrrr�tuple�versionr"�version_infoZsqlite_versionZsqlite_version_info�
memoryviewZBinary�abc�Sequence�registerZRowr,r	r	r	r
�<module>s&sqlite3/__pycache__/dbapi2.cpython-38.opt-2.pyc000064400000004712151153537440015105 0ustar00U

e5d
�@s�ddlZddlZddlZddlTdZdZdZejZ	ejZ
ejZdd�Zdd	�Z
d
d�Zedd
�e�d�D��Zedd
�e�d�D��ZeZejj�e�dd�Ze�[dS)�N)�*Zqmark�z2.0cCstt�|�dd��S)N�)�Date�time�	localtime�Zticks�r	�&/usr/lib64/python3.8/sqlite3/dbapi2.py�
DateFromTicks)srcCstt�|�dd��S)Nr�)�Timerrrr	r	r
�
TimeFromTicks,srcCstt�|�dd��S)Nr)�	Timestamprrrr	r	r
�TimestampFromTicks/srcCsg|]}t|��qSr	��int��.0�xr	r	r
�
<listcomp>2sr�.cCsg|]}t|��qSr	rrr	r	r
r3scCsPdd�}dd�}dd�}dd�}ttj|�ttj|�td	|�td
|�dS)NcSs|��S)N�Z	isoformat��valr	r	r
�
adapt_date9sz4register_adapters_and_converters.<locals>.adapt_datecSs
|�d�S)N� rrr	r	r
�adapt_datetime<sz8register_adapters_and_converters.<locals>.adapt_datetimecSstjtt|�d���S)N�-)�datetime�date�mapr�splitrr	r	r
�convert_date?sz6register_adapters_and_converters.<locals>.convert_datec	Ss�|�d�\}}tt|�d��\}}}|�d�}tt|d�d��\}}}	t|�dkrltd�|d����}
nd}
t�||||||	|
�}|S)	N� r�.r�:�z{:0<6.6}r)r"r!r�len�format�decoder)rZdatepartZtimepartZyearZmonthZdayZ
timepart_fullZhoursZminutesZsecondsZmicrosecondsr	r	r
�convert_timestampBs
z;register_adapters_and_converters.<locals>.convert_timestampr Z	timestamp)Zregister_adapterrr Zregister_converter)rrr#r+r	r	r
� register_adapters_and_converters8s
r,)rrZcollections.abc�collectionsZ_sqlite3Z
paramstyleZthreadsafetyZapilevelr rr
rrrr�tuple�versionr"�version_infoZsqlite_versionZsqlite_version_info�
memoryviewZBinary�abc�Sequence�registerZRowr,r	r	r	r
�<module>s&sqlite3/__pycache__/dbapi2.cpython-38.opt-1.pyc000064400000004712151153537440015104 0ustar00U

e5d
�@s�ddlZddlZddlZddlTdZdZdZejZ	ejZ
ejZdd�Zdd	�Z
d
d�Zedd
�e�d�D��Zedd
�e�d�D��ZeZejj�e�dd�Ze�[dS)�N)�*Zqmark�z2.0cCstt�|�dd��S)N�)�Date�time�	localtime�Zticks�r	�&/usr/lib64/python3.8/sqlite3/dbapi2.py�
DateFromTicks)srcCstt�|�dd��S)Nr�)�Timerrrr	r	r
�
TimeFromTicks,srcCstt�|�dd��S)Nr)�	Timestamprrrr	r	r
�TimestampFromTicks/srcCsg|]}t|��qSr	��int��.0�xr	r	r
�
<listcomp>2sr�.cCsg|]}t|��qSr	rrr	r	r
r3scCsPdd�}dd�}dd�}dd�}ttj|�ttj|�td	|�td
|�dS)NcSs|��S)N�Z	isoformat��valr	r	r
�
adapt_date9sz4register_adapters_and_converters.<locals>.adapt_datecSs
|�d�S)N� rrr	r	r
�adapt_datetime<sz8register_adapters_and_converters.<locals>.adapt_datetimecSstjtt|�d���S)N�-)�datetime�date�mapr�splitrr	r	r
�convert_date?sz6register_adapters_and_converters.<locals>.convert_datec	Ss�|�d�\}}tt|�d��\}}}|�d�}tt|d�d��\}}}	t|�dkrltd�|d����}
nd}
t�||||||	|
�}|S)	N� r�.r�:�z{:0<6.6}r)r"r!r�len�format�decoder)rZdatepartZtimepartZyearZmonthZdayZ
timepart_fullZhoursZminutesZsecondsZmicrosecondsr	r	r
�convert_timestampBs
z;register_adapters_and_converters.<locals>.convert_timestampr Z	timestamp)Zregister_adapterrr Zregister_converter)rrr#r+r	r	r
� register_adapters_and_converters8s
r,)rrZcollections.abc�collectionsZ_sqlite3Z
paramstyleZthreadsafetyZapilevelr rr
rrrr�tuple�versionr"�version_infoZsqlite_versionZsqlite_version_info�
memoryviewZBinary�abc�Sequence�registerZRowr,r	r	r	r
�<module>s&sqlite3/__pycache__/dump.cpython-38.opt-2.pyc000064400000003127151153537440014710 0ustar00U

e5d	�@sdd�ZdS)c
cs|��}dVd}|�|�}|��D]�\}}}|dkr>dVn*|dkrNdVn|�d�r\q$nd�|�V|�d	d
�}|�d�|��}dd
�|��D�}	d�|d�dd�|	D���}|�|�}
|
D]}d�|d�Vq�q$d}|�|�}|��D]\}}}d�|�Vq�dVdS)NzBEGIN TRANSACTION;z�
        SELECT "name", "type", "sql"
        FROM "sqlite_master"
            WHERE "sql" NOT NULL AND
            "type" == 'table'
            ORDER BY "name"
        Zsqlite_sequencezDELETE FROM "sqlite_sequence";Zsqlite_stat1zANALYZE "sqlite_master";Zsqlite_z{0};�"�""zPRAGMA table_info("{0}")cSsg|]}t|d��qS)�)�str)�.0Z
table_info�r�$/usr/lib64/python3.8/sqlite3/dump.py�
<listcomp>3sz_iterdump.<locals>.<listcomp>z2SELECT 'INSERT INTO "{0}" VALUES({1})' FROM "{0}";�,css |]}d�|�dd��VqdS)z'||quote("{0}")||'rrN)�format�replace)r�colrrr�	<genexpr>6sz_iterdump.<locals>.<genexpr>�z�
        SELECT "name", "type", "sql"
        FROM "sqlite_master"
            WHERE "sql" NOT NULL AND
            "type" IN ('index', 'trigger', 'view')
        zCOMMIT;)ZcursorZexecuteZfetchall�
startswithr
r�join)
Z
connectionZcu�qZ
schema_resZ
table_name�typeZsqlZtable_name_ident�resZcolumn_namesZ	query_res�row�namerrr�	_iterdump
s6	

	�

rN)rrrrr�<module>
�sqlite3/__pycache__/dump.cpython-38.pyc000064400000003613151153537440013750 0ustar00U

e5d	�@sdd�ZdS)c
cs|��}dVd}|�|�}|��D]�\}}}|dkr>dVn*|dkrNdVn|�d�r\q$nd�|�V|�d	d
�}|�d�|��}dd
�|��D�}	d�|d�dd�|	D���}|�|�}
|
D]}d�|d�Vq�q$d}|�|�}|��D]\}}}d�|�Vq�dVdS)a/
    Returns an iterator to the dump of the database in an SQL text format.

    Used to produce an SQL dump of the database.  Useful to save an in-memory
    database for later restoration.  This function should not be called
    directly but instead called from the Connection method, iterdump().
    zBEGIN TRANSACTION;z�
        SELECT "name", "type", "sql"
        FROM "sqlite_master"
            WHERE "sql" NOT NULL AND
            "type" == 'table'
            ORDER BY "name"
        Zsqlite_sequencezDELETE FROM "sqlite_sequence";Zsqlite_stat1zANALYZE "sqlite_master";Zsqlite_z{0};�"�""zPRAGMA table_info("{0}")cSsg|]}t|d��qS)�)�str)�.0Z
table_info�r�$/usr/lib64/python3.8/sqlite3/dump.py�
<listcomp>3sz_iterdump.<locals>.<listcomp>z2SELECT 'INSERT INTO "{0}" VALUES({1})' FROM "{0}";�,css |]}d�|�dd��VqdS)z'||quote("{0}")||'rrN)�format�replace)r�colrrr�	<genexpr>6sz_iterdump.<locals>.<genexpr>�z�
        SELECT "name", "type", "sql"
        FROM "sqlite_master"
            WHERE "sql" NOT NULL AND
            "type" IN ('index', 'trigger', 'view')
        zCOMMIT;N)ZcursorZexecuteZfetchall�
startswithr
r�join)
Z
connectionZcu�qZ
schema_resZ
table_name�typeZsqlZtable_name_ident�resZcolumn_namesZ	query_res�row�namerrr�	_iterdump
s6	

	�

rN)rrrrr�<module>
�sqlite3/__pycache__/__init__.cpython-38.opt-2.pyc000064400000000242151153537440015475 0ustar00U

e5d��@sddlTdS)�)�*N)Zsqlite3.dbapi2�rr�(/usr/lib64/python3.8/sqlite3/__init__.py�<module>�sqlite3/__pycache__/__init__.cpython-38.pyc000064400000000242151153537440014535 0ustar00U

e5d��@sddlTdS)�)�*N)Zsqlite3.dbapi2�rr�(/usr/lib64/python3.8/sqlite3/__init__.py�<module>�sqlite3/dbapi2.py000064400000005177151153537440007665 0ustar00# pysqlite2/dbapi2.py: the DB-API 2.0 interface
#
# Copyright (C) 2004-2005 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warranty.  In no event will the authors be held liable for any damages
# arising from the use of this software.
#
# Permission is granted to anyone to use this software for any purpose,
# including commercial applications, and to alter it and redistribute it
# freely, subject to the following restrictions:
#
# 1. The origin of this software must not be misrepresented; you must not
#    claim that you wrote the original software. If you use this software
#    in a product, an acknowledgment in the product documentation would be
#    appreciated but is not required.
# 2. Altered source versions must be plainly marked as such, and must not be
#    misrepresented as being the original software.
# 3. This notice may not be removed or altered from any source distribution.

import datetime
import time
import collections.abc

from _sqlite3 import *

paramstyle = "qmark"

threadsafety = 1

apilevel = "2.0"

Date = datetime.date

Time = datetime.time

Timestamp = datetime.datetime

def DateFromTicks(ticks):
    return Date(*time.localtime(ticks)[:3])

def TimeFromTicks(ticks):
    return Time(*time.localtime(ticks)[3:6])

def TimestampFromTicks(ticks):
    return Timestamp(*time.localtime(ticks)[:6])

version_info = tuple([int(x) for x in version.split(".")])
sqlite_version_info = tuple([int(x) for x in sqlite_version.split(".")])

Binary = memoryview
collections.abc.Sequence.register(Row)

def register_adapters_and_converters():
    def adapt_date(val):
        return val.isoformat()

    def adapt_datetime(val):
        return val.isoformat(" ")

    def convert_date(val):
        return datetime.date(*map(int, val.split(b"-")))

    def convert_timestamp(val):
        datepart, timepart = val.split(b" ")
        year, month, day = map(int, datepart.split(b"-"))
        timepart_full = timepart.split(b".")
        hours, minutes, seconds = map(int, timepart_full[0].split(b":"))
        if len(timepart_full) == 2:
            microseconds = int('{:0<6.6}'.format(timepart_full[1].decode()))
        else:
            microseconds = 0

        val = datetime.datetime(year, month, day, hours, minutes, seconds, microseconds)
        return val


    register_adapter(datetime.date, adapt_date)
    register_adapter(datetime.datetime, adapt_datetime)
    register_converter("date", convert_date)
    register_converter("timestamp", convert_timestamp)

register_adapters_and_converters()

# Clean up namespace

del(register_adapters_and_converters)
nturl2path.py000064400000005507151153537440007240 0ustar00"""Convert a NT pathname to a file URL and vice versa.

This module only exists to provide OS-specific code
for urllib.requests, thus do not use directly.
"""
# Testing is done through test_urllib.

def url2pathname(url):
    """OS-specific conversion from a relative URL of the 'file' scheme
    to a file system path; not recommended for general use."""
    # e.g.
    #   ///C|/foo/bar/spam.foo
    # and
    #   ///C:/foo/bar/spam.foo
    # become
    #   C:\foo\bar\spam.foo
    import string, urllib.parse
    # Windows itself uses ":" even in URLs.
    url = url.replace(':', '|')
    if not '|' in url:
        # No drive specifier, just convert slashes
        if url[:4] == '////':
            # path is something like ////host/path/on/remote/host
            # convert this to \\host\path\on\remote\host
            # (notice halving of slashes at the start of the path)
            url = url[2:]
        components = url.split('/')
        # make sure not to convert quoted slashes :-)
        return urllib.parse.unquote('\\'.join(components))
    comp = url.split('|')
    if len(comp) != 2 or comp[0][-1] not in string.ascii_letters:
        error = 'Bad URL: ' + url
        raise OSError(error)
    drive = comp[0][-1].upper()
    components = comp[1].split('/')
    path = drive + ':'
    for comp in components:
        if comp:
            path = path + '\\' + urllib.parse.unquote(comp)
    # Issue #11474 - handing url such as |c/|
    if path.endswith(':') and url.endswith('/'):
        path += '\\'
    return path

def pathname2url(p):
    """OS-specific conversion from a file system path to a relative URL
    of the 'file' scheme; not recommended for general use."""
    # e.g.
    #   C:\foo\bar\spam.foo
    # becomes
    #   ///C:/foo/bar/spam.foo
    import urllib.parse
    # First, clean up some special forms. We are going to sacrifice
    # the additional information anyway
    if p[:4] == '\\\\?\\':
        p = p[4:]
        if p[:4].upper() == 'UNC\\':
            p = '\\' + p[4:]
        elif p[1:2] != ':':
            raise OSError('Bad path: ' + p)
    if not ':' in p:
        # No drive specifier, just convert slashes and quote the name
        if p[:2] == '\\\\':
        # path is something like \\host\path\on\remote\host
        # convert this to ////host/path/on/remote/host
        # (notice doubling of slashes at the start of the path)
            p = '\\\\' + p
        components = p.split('\\')
        return urllib.parse.quote('/'.join(components))
    comp = p.split(':', maxsplit=2)
    if len(comp) != 2 or len(comp[0]) > 1:
        error = 'Bad path: ' + p
        raise OSError(error)

    drive = urllib.parse.quote(comp[0].upper())
    components = comp[1].split('\\')
    path = '///' + drive + ':'
    for comp in components:
        if comp:
            path = path + '/' + urllib.parse.quote(comp)
    return path
inspect.py000064400000347426151153537440006613 0ustar00"""Get useful information from live Python objects.

This module encapsulates the interface provided by the internal special
attributes (co_*, im_*, tb_*, etc.) in a friendlier fashion.
It also provides some help for examining source code and class layout.

Here are some of the useful functions provided by this module:

    ismodule(), isclass(), ismethod(), isfunction(), isgeneratorfunction(),
        isgenerator(), istraceback(), isframe(), iscode(), isbuiltin(),
        isroutine() - check object types
    getmembers() - get members of an object that satisfy a given condition

    getfile(), getsourcefile(), getsource() - find an object's source code
    getdoc(), getcomments() - get documentation on an object
    getmodule() - determine the module that an object came from
    getclasstree() - arrange classes so as to represent their hierarchy

    getargvalues(), getcallargs() - get info about function arguments
    getfullargspec() - same, with support for Python 3 features
    formatargvalues() - format an argument spec
    getouterframes(), getinnerframes() - get info about frames
    currentframe() - get the current stack frame
    stack(), trace() - get info about frames on the stack or in a traceback

    signature() - get a Signature object for the callable
"""

# This module is in the public domain.  No warranties.

__author__ = ('Ka-Ping Yee <ping@lfw.org>',
              'Yury Selivanov <yselivanov@sprymix.com>')

import abc
import dis
import collections.abc
import enum
import importlib.machinery
import itertools
import linecache
import os
import re
import sys
import tokenize
import token
import types
import warnings
import functools
import builtins
from operator import attrgetter
from collections import namedtuple, OrderedDict

# Create constants for the compiler flags in Include/code.h
# We try to get them from dis to avoid duplication
mod_dict = globals()
for k, v in dis.COMPILER_FLAG_NAMES.items():
    mod_dict["CO_" + v] = k

# See Include/object.h
TPFLAGS_IS_ABSTRACT = 1 << 20

# ----------------------------------------------------------- type-checking
def ismodule(object):
    """Return true if the object is a module.

    Module objects provide these attributes:
        __cached__      pathname to byte compiled file
        __doc__         documentation string
        __file__        filename (missing for built-in modules)"""
    return isinstance(object, types.ModuleType)

def isclass(object):
    """Return true if the object is a class.

    Class objects provide these attributes:
        __doc__         documentation string
        __module__      name of module in which this class was defined"""
    return isinstance(object, type)

def ismethod(object):
    """Return true if the object is an instance method.

    Instance method objects provide these attributes:
        __doc__         documentation string
        __name__        name with which this method was defined
        __func__        function object containing implementation of method
        __self__        instance to which this method is bound"""
    return isinstance(object, types.MethodType)

def ismethoddescriptor(object):
    """Return true if the object is a method descriptor.

    But not if ismethod() or isclass() or isfunction() are true.

    This is new in Python 2.2, and, for example, is true of int.__add__.
    An object passing this test has a __get__ attribute but not a __set__
    attribute, but beyond that the set of attributes varies.  __name__ is
    usually sensible, and __doc__ often is.

    Methods implemented via descriptors that also pass one of the other
    tests return false from the ismethoddescriptor() test, simply because
    the other tests promise more -- you can, e.g., count on having the
    __func__ attribute (etc) when an object passes ismethod()."""
    if isclass(object) or ismethod(object) or isfunction(object):
        # mutual exclusion
        return False
    tp = type(object)
    return hasattr(tp, "__get__") and not hasattr(tp, "__set__")

def isdatadescriptor(object):
    """Return true if the object is a data descriptor.

    Data descriptors have a __set__ or a __delete__ attribute.  Examples are
    properties (defined in Python) and getsets and members (defined in C).
    Typically, data descriptors will also have __name__ and __doc__ attributes
    (properties, getsets, and members have both of these attributes), but this
    is not guaranteed."""
    if isclass(object) or ismethod(object) or isfunction(object):
        # mutual exclusion
        return False
    tp = type(object)
    return hasattr(tp, "__set__") or hasattr(tp, "__delete__")

if hasattr(types, 'MemberDescriptorType'):
    # CPython and equivalent
    def ismemberdescriptor(object):
        """Return true if the object is a member descriptor.

        Member descriptors are specialized descriptors defined in extension
        modules."""
        return isinstance(object, types.MemberDescriptorType)
else:
    # Other implementations
    def ismemberdescriptor(object):
        """Return true if the object is a member descriptor.

        Member descriptors are specialized descriptors defined in extension
        modules."""
        return False

if hasattr(types, 'GetSetDescriptorType'):
    # CPython and equivalent
    def isgetsetdescriptor(object):
        """Return true if the object is a getset descriptor.

        getset descriptors are specialized descriptors defined in extension
        modules."""
        return isinstance(object, types.GetSetDescriptorType)
else:
    # Other implementations
    def isgetsetdescriptor(object):
        """Return true if the object is a getset descriptor.

        getset descriptors are specialized descriptors defined in extension
        modules."""
        return False

def isfunction(object):
    """Return true if the object is a user-defined function.

    Function objects provide these attributes:
        __doc__         documentation string
        __name__        name with which this function was defined
        __code__        code object containing compiled function bytecode
        __defaults__    tuple of any default values for arguments
        __globals__     global namespace in which this function was defined
        __annotations__ dict of parameter annotations
        __kwdefaults__  dict of keyword only parameters with defaults"""
    return isinstance(object, types.FunctionType)

def _has_code_flag(f, flag):
    """Return true if ``f`` is a function (or a method or functools.partial
    wrapper wrapping a function) whose code object has the given ``flag``
    set in its flags."""
    while ismethod(f):
        f = f.__func__
    f = functools._unwrap_partial(f)
    if not isfunction(f):
        return False
    return bool(f.__code__.co_flags & flag)

def isgeneratorfunction(obj):
    """Return true if the object is a user-defined generator function.

    Generator function objects provide the same attributes as functions.
    See help(isfunction) for a list of attributes."""
    return _has_code_flag(obj, CO_GENERATOR)

def iscoroutinefunction(obj):
    """Return true if the object is a coroutine function.

    Coroutine functions are defined with "async def" syntax.
    """
    return _has_code_flag(obj, CO_COROUTINE)

def isasyncgenfunction(obj):
    """Return true if the object is an asynchronous generator function.

    Asynchronous generator functions are defined with "async def"
    syntax and have "yield" expressions in their body.
    """
    return _has_code_flag(obj, CO_ASYNC_GENERATOR)

def isasyncgen(object):
    """Return true if the object is an asynchronous generator."""
    return isinstance(object, types.AsyncGeneratorType)

def isgenerator(object):
    """Return true if the object is a generator.

    Generator objects provide these attributes:
        __iter__        defined to support iteration over container
        close           raises a new GeneratorExit exception inside the
                        generator to terminate the iteration
        gi_code         code object
        gi_frame        frame object or possibly None once the generator has
                        been exhausted
        gi_running      set to 1 when generator is executing, 0 otherwise
        next            return the next item from the container
        send            resumes the generator and "sends" a value that becomes
                        the result of the current yield-expression
        throw           used to raise an exception inside the generator"""
    return isinstance(object, types.GeneratorType)

def iscoroutine(object):
    """Return true if the object is a coroutine."""
    return isinstance(object, types.CoroutineType)

def isawaitable(object):
    """Return true if object can be passed to an ``await`` expression."""
    return (isinstance(object, types.CoroutineType) or
            isinstance(object, types.GeneratorType) and
                bool(object.gi_code.co_flags & CO_ITERABLE_COROUTINE) or
            isinstance(object, collections.abc.Awaitable))

def istraceback(object):
    """Return true if the object is a traceback.

    Traceback objects provide these attributes:
        tb_frame        frame object at this level
        tb_lasti        index of last attempted instruction in bytecode
        tb_lineno       current line number in Python source code
        tb_next         next inner traceback object (called by this level)"""
    return isinstance(object, types.TracebackType)

def isframe(object):
    """Return true if the object is a frame object.

    Frame objects provide these attributes:
        f_back          next outer frame object (this frame's caller)
        f_builtins      built-in namespace seen by this frame
        f_code          code object being executed in this frame
        f_globals       global namespace seen by this frame
        f_lasti         index of last attempted instruction in bytecode
        f_lineno        current line number in Python source code
        f_locals        local namespace seen by this frame
        f_trace         tracing function for this frame, or None"""
    return isinstance(object, types.FrameType)

def iscode(object):
    """Return true if the object is a code object.

    Code objects provide these attributes:
        co_argcount         number of arguments (not including *, ** args
                            or keyword only arguments)
        co_code             string of raw compiled bytecode
        co_cellvars         tuple of names of cell variables
        co_consts           tuple of constants used in the bytecode
        co_filename         name of file in which this code object was created
        co_firstlineno      number of first line in Python source code
        co_flags            bitmap: 1=optimized | 2=newlocals | 4=*arg | 8=**arg
                            | 16=nested | 32=generator | 64=nofree | 128=coroutine
                            | 256=iterable_coroutine | 512=async_generator
        co_freevars         tuple of names of free variables
        co_posonlyargcount  number of positional only arguments
        co_kwonlyargcount   number of keyword only arguments (not including ** arg)
        co_lnotab           encoded mapping of line numbers to bytecode indices
        co_name             name with which this code object was defined
        co_names            tuple of names of local variables
        co_nlocals          number of local variables
        co_stacksize        virtual machine stack space required
        co_varnames         tuple of names of arguments and local variables"""
    return isinstance(object, types.CodeType)

def isbuiltin(object):
    """Return true if the object is a built-in function or method.

    Built-in functions and methods provide these attributes:
        __doc__         documentation string
        __name__        original name of this function or method
        __self__        instance to which a method is bound, or None"""
    return isinstance(object, types.BuiltinFunctionType)

def isroutine(object):
    """Return true if the object is any kind of function or method."""
    return (isbuiltin(object)
            or isfunction(object)
            or ismethod(object)
            or ismethoddescriptor(object))

def isabstract(object):
    """Return true if the object is an abstract base class (ABC)."""
    if not isinstance(object, type):
        return False
    if object.__flags__ & TPFLAGS_IS_ABSTRACT:
        return True
    if not issubclass(type(object), abc.ABCMeta):
        return False
    if hasattr(object, '__abstractmethods__'):
        # It looks like ABCMeta.__new__ has finished running;
        # TPFLAGS_IS_ABSTRACT should have been accurate.
        return False
    # It looks like ABCMeta.__new__ has not finished running yet; we're
    # probably in __init_subclass__. We'll look for abstractmethods manually.
    for name, value in object.__dict__.items():
        if getattr(value, "__isabstractmethod__", False):
            return True
    for base in object.__bases__:
        for name in getattr(base, "__abstractmethods__", ()):
            value = getattr(object, name, None)
            if getattr(value, "__isabstractmethod__", False):
                return True
    return False

def getmembers(object, predicate=None):
    """Return all members of an object as (name, value) pairs sorted by name.
    Optionally, only return members that satisfy a given predicate."""
    if isclass(object):
        mro = (object,) + getmro(object)
    else:
        mro = ()
    results = []
    processed = set()
    names = dir(object)
    # :dd any DynamicClassAttributes to the list of names if object is a class;
    # this may result in duplicate entries if, for example, a virtual
    # attribute with the same name as a DynamicClassAttribute exists
    try:
        for base in object.__bases__:
            for k, v in base.__dict__.items():
                if isinstance(v, types.DynamicClassAttribute):
                    names.append(k)
    except AttributeError:
        pass
    for key in names:
        # First try to get the value via getattr.  Some descriptors don't
        # like calling their __get__ (see bug #1785), so fall back to
        # looking in the __dict__.
        try:
            value = getattr(object, key)
            # handle the duplicate key
            if key in processed:
                raise AttributeError
        except AttributeError:
            for base in mro:
                if key in base.__dict__:
                    value = base.__dict__[key]
                    break
            else:
                # could be a (currently) missing slot member, or a buggy
                # __dir__; discard and move on
                continue
        if not predicate or predicate(value):
            results.append((key, value))
        processed.add(key)
    results.sort(key=lambda pair: pair[0])
    return results

Attribute = namedtuple('Attribute', 'name kind defining_class object')

def classify_class_attrs(cls):
    """Return list of attribute-descriptor tuples.

    For each name in dir(cls), the return list contains a 4-tuple
    with these elements:

        0. The name (a string).

        1. The kind of attribute this is, one of these strings:
               'class method'    created via classmethod()
               'static method'   created via staticmethod()
               'property'        created via property()
               'method'          any other flavor of method or descriptor
               'data'            not a method

        2. The class which defined this attribute (a class).

        3. The object as obtained by calling getattr; if this fails, or if the
           resulting object does not live anywhere in the class' mro (including
           metaclasses) then the object is looked up in the defining class's
           dict (found by walking the mro).

    If one of the items in dir(cls) is stored in the metaclass it will now
    be discovered and not have None be listed as the class in which it was
    defined.  Any items whose home class cannot be discovered are skipped.
    """

    mro = getmro(cls)
    metamro = getmro(type(cls)) # for attributes stored in the metaclass
    metamro = tuple(cls for cls in metamro if cls not in (type, object))
    class_bases = (cls,) + mro
    all_bases = class_bases + metamro
    names = dir(cls)
    # :dd any DynamicClassAttributes to the list of names;
    # this may result in duplicate entries if, for example, a virtual
    # attribute with the same name as a DynamicClassAttribute exists.
    for base in mro:
        for k, v in base.__dict__.items():
            if isinstance(v, types.DynamicClassAttribute):
                names.append(k)
    result = []
    processed = set()

    for name in names:
        # Get the object associated with the name, and where it was defined.
        # Normal objects will be looked up with both getattr and directly in
        # its class' dict (in case getattr fails [bug #1785], and also to look
        # for a docstring).
        # For DynamicClassAttributes on the second pass we only look in the
        # class's dict.
        #
        # Getting an obj from the __dict__ sometimes reveals more than
        # using getattr.  Static and class methods are dramatic examples.
        homecls = None
        get_obj = None
        dict_obj = None
        if name not in processed:
            try:
                if name == '__dict__':
                    raise Exception("__dict__ is special, don't want the proxy")
                get_obj = getattr(cls, name)
            except Exception as exc:
                pass
            else:
                homecls = getattr(get_obj, "__objclass__", homecls)
                if homecls not in class_bases:
                    # if the resulting object does not live somewhere in the
                    # mro, drop it and search the mro manually
                    homecls = None
                    last_cls = None
                    # first look in the classes
                    for srch_cls in class_bases:
                        srch_obj = getattr(srch_cls, name, None)
                        if srch_obj is get_obj:
                            last_cls = srch_cls
                    # then check the metaclasses
                    for srch_cls in metamro:
                        try:
                            srch_obj = srch_cls.__getattr__(cls, name)
                        except AttributeError:
                            continue
                        if srch_obj is get_obj:
                            last_cls = srch_cls
                    if last_cls is not None:
                        homecls = last_cls
        for base in all_bases:
            if name in base.__dict__:
                dict_obj = base.__dict__[name]
                if homecls not in metamro:
                    homecls = base
                break
        if homecls is None:
            # unable to locate the attribute anywhere, most likely due to
            # buggy custom __dir__; discard and move on
            continue
        obj = get_obj if get_obj is not None else dict_obj
        # Classify the object or its descriptor.
        if isinstance(dict_obj, (staticmethod, types.BuiltinMethodType)):
            kind = "static method"
            obj = dict_obj
        elif isinstance(dict_obj, (classmethod, types.ClassMethodDescriptorType)):
            kind = "class method"
            obj = dict_obj
        elif isinstance(dict_obj, property):
            kind = "property"
            obj = dict_obj
        elif isroutine(obj):
            kind = "method"
        else:
            kind = "data"
        result.append(Attribute(name, kind, homecls, obj))
        processed.add(name)
    return result

# ----------------------------------------------------------- class helpers

def getmro(cls):
    "Return tuple of base classes (including cls) in method resolution order."
    return cls.__mro__

# -------------------------------------------------------- function helpers

def unwrap(func, *, stop=None):
    """Get the object wrapped by *func*.

   Follows the chain of :attr:`__wrapped__` attributes returning the last
   object in the chain.

   *stop* is an optional callback accepting an object in the wrapper chain
   as its sole argument that allows the unwrapping to be terminated early if
   the callback returns a true value. If the callback never returns a true
   value, the last object in the chain is returned as usual. For example,
   :func:`signature` uses this to stop unwrapping if any object in the
   chain has a ``__signature__`` attribute defined.

   :exc:`ValueError` is raised if a cycle is encountered.

    """
    if stop is None:
        def _is_wrapper(f):
            return hasattr(f, '__wrapped__')
    else:
        def _is_wrapper(f):
            return hasattr(f, '__wrapped__') and not stop(f)
    f = func  # remember the original func for error reporting
    # Memoise by id to tolerate non-hashable objects, but store objects to
    # ensure they aren't destroyed, which would allow their IDs to be reused.
    memo = {id(f): f}
    recursion_limit = sys.getrecursionlimit()
    while _is_wrapper(func):
        func = func.__wrapped__
        id_func = id(func)
        if (id_func in memo) or (len(memo) >= recursion_limit):
            raise ValueError('wrapper loop when unwrapping {!r}'.format(f))
        memo[id_func] = func
    return func

# -------------------------------------------------- source code extraction
def indentsize(line):
    """Return the indent size, in spaces, at the start of a line of text."""
    expline = line.expandtabs()
    return len(expline) - len(expline.lstrip())

def _findclass(func):
    cls = sys.modules.get(func.__module__)
    if cls is None:
        return None
    for name in func.__qualname__.split('.')[:-1]:
        cls = getattr(cls, name)
    if not isclass(cls):
        return None
    return cls

def _finddoc(obj):
    if isclass(obj):
        for base in obj.__mro__:
            if base is not object:
                try:
                    doc = base.__doc__
                except AttributeError:
                    continue
                if doc is not None:
                    return doc
        return None

    if ismethod(obj):
        name = obj.__func__.__name__
        self = obj.__self__
        if (isclass(self) and
            getattr(getattr(self, name, None), '__func__') is obj.__func__):
            # classmethod
            cls = self
        else:
            cls = self.__class__
    elif isfunction(obj):
        name = obj.__name__
        cls = _findclass(obj)
        if cls is None or getattr(cls, name) is not obj:
            return None
    elif isbuiltin(obj):
        name = obj.__name__
        self = obj.__self__
        if (isclass(self) and
            self.__qualname__ + '.' + name == obj.__qualname__):
            # classmethod
            cls = self
        else:
            cls = self.__class__
    # Should be tested before isdatadescriptor().
    elif isinstance(obj, property):
        func = obj.fget
        name = func.__name__
        cls = _findclass(func)
        if cls is None or getattr(cls, name) is not obj:
            return None
    elif ismethoddescriptor(obj) or isdatadescriptor(obj):
        name = obj.__name__
        cls = obj.__objclass__
        if getattr(cls, name) is not obj:
            return None
        if ismemberdescriptor(obj):
            slots = getattr(cls, '__slots__', None)
            if isinstance(slots, dict) and name in slots:
                return slots[name]
    else:
        return None
    for base in cls.__mro__:
        try:
            doc = getattr(base, name).__doc__
        except AttributeError:
            continue
        if doc is not None:
            return doc
    return None

def getdoc(object):
    """Get the documentation string for an object.

    All tabs are expanded to spaces.  To clean up docstrings that are
    indented to line up with blocks of code, any whitespace than can be
    uniformly removed from the second line onwards is removed."""
    try:
        doc = object.__doc__
    except AttributeError:
        return None
    if doc is None:
        try:
            doc = _finddoc(object)
        except (AttributeError, TypeError):
            return None
    if not isinstance(doc, str):
        return None
    return cleandoc(doc)

def cleandoc(doc):
    """Clean up indentation from docstrings.

    Any whitespace that can be uniformly removed from the second line
    onwards is removed."""
    try:
        lines = doc.expandtabs().split('\n')
    except UnicodeError:
        return None
    else:
        # Find minimum indentation of any non-blank lines after first line.
        margin = sys.maxsize
        for line in lines[1:]:
            content = len(line.lstrip())
            if content:
                indent = len(line) - content
                margin = min(margin, indent)
        # Remove indentation.
        if lines:
            lines[0] = lines[0].lstrip()
        if margin < sys.maxsize:
            for i in range(1, len(lines)): lines[i] = lines[i][margin:]
        # Remove any trailing or leading blank lines.
        while lines and not lines[-1]:
            lines.pop()
        while lines and not lines[0]:
            lines.pop(0)
        return '\n'.join(lines)

def getfile(object):
    """Work out which source or compiled file an object was defined in."""
    if ismodule(object):
        if getattr(object, '__file__', None):
            return object.__file__
        raise TypeError('{!r} is a built-in module'.format(object))
    if isclass(object):
        if hasattr(object, '__module__'):
            module = sys.modules.get(object.__module__)
            if getattr(module, '__file__', None):
                return module.__file__
        raise TypeError('{!r} is a built-in class'.format(object))
    if ismethod(object):
        object = object.__func__
    if isfunction(object):
        object = object.__code__
    if istraceback(object):
        object = object.tb_frame
    if isframe(object):
        object = object.f_code
    if iscode(object):
        return object.co_filename
    raise TypeError('module, class, method, function, traceback, frame, or '
                    'code object was expected, got {}'.format(
                    type(object).__name__))

def getmodulename(path):
    """Return the module name for a given file, or None."""
    fname = os.path.basename(path)
    # Check for paths that look like an actual module file
    suffixes = [(-len(suffix), suffix)
                    for suffix in importlib.machinery.all_suffixes()]
    suffixes.sort() # try longest suffixes first, in case they overlap
    for neglen, suffix in suffixes:
        if fname.endswith(suffix):
            return fname[:neglen]
    return None

def getsourcefile(object):
    """Return the filename that can be used to locate an object's source.
    Return None if no way can be identified to get the source.
    """
    filename = getfile(object)
    all_bytecode_suffixes = importlib.machinery.DEBUG_BYTECODE_SUFFIXES[:]
    all_bytecode_suffixes += importlib.machinery.OPTIMIZED_BYTECODE_SUFFIXES[:]
    if any(filename.endswith(s) for s in all_bytecode_suffixes):
        filename = (os.path.splitext(filename)[0] +
                    importlib.machinery.SOURCE_SUFFIXES[0])
    elif any(filename.endswith(s) for s in
                 importlib.machinery.EXTENSION_SUFFIXES):
        return None
    if os.path.exists(filename):
        return filename
    # only return a non-existent filename if the module has a PEP 302 loader
    if getattr(getmodule(object, filename), '__loader__', None) is not None:
        return filename
    # or it is in the linecache
    if filename in linecache.cache:
        return filename

def getabsfile(object, _filename=None):
    """Return an absolute path to the source or compiled file for an object.

    The idea is for each object to have a unique origin, so this routine
    normalizes the result as much as possible."""
    if _filename is None:
        _filename = getsourcefile(object) or getfile(object)
    return os.path.normcase(os.path.abspath(_filename))

modulesbyfile = {}
_filesbymodname = {}

def getmodule(object, _filename=None):
    """Return the module an object was defined in, or None if not found."""
    if ismodule(object):
        return object
    if hasattr(object, '__module__'):
        return sys.modules.get(object.__module__)
    # Try the filename to modulename cache
    if _filename is not None and _filename in modulesbyfile:
        return sys.modules.get(modulesbyfile[_filename])
    # Try the cache again with the absolute file name
    try:
        file = getabsfile(object, _filename)
    except TypeError:
        return None
    if file in modulesbyfile:
        return sys.modules.get(modulesbyfile[file])
    # Update the filename to module name cache and check yet again
    # Copy sys.modules in order to cope with changes while iterating
    for modname, module in sys.modules.copy().items():
        if ismodule(module) and hasattr(module, '__file__'):
            f = module.__file__
            if f == _filesbymodname.get(modname, None):
                # Have already mapped this module, so skip it
                continue
            _filesbymodname[modname] = f
            f = getabsfile(module)
            # Always map to the name the module knows itself by
            modulesbyfile[f] = modulesbyfile[
                os.path.realpath(f)] = module.__name__
    if file in modulesbyfile:
        return sys.modules.get(modulesbyfile[file])
    # Check the main module
    main = sys.modules['__main__']
    if not hasattr(object, '__name__'):
        return None
    if hasattr(main, object.__name__):
        mainobject = getattr(main, object.__name__)
        if mainobject is object:
            return main
    # Check builtins
    builtin = sys.modules['builtins']
    if hasattr(builtin, object.__name__):
        builtinobject = getattr(builtin, object.__name__)
        if builtinobject is object:
            return builtin

def findsource(object):
    """Return the entire source file and starting line number for an object.

    The argument may be a module, class, method, function, traceback, frame,
    or code object.  The source code is returned as a list of all the lines
    in the file and the line number indexes a line in that list.  An OSError
    is raised if the source code cannot be retrieved."""

    file = getsourcefile(object)
    if file:
        # Invalidate cache if needed.
        linecache.checkcache(file)
    else:
        file = getfile(object)
        # Allow filenames in form of "<something>" to pass through.
        # `doctest` monkeypatches `linecache` module to enable
        # inspection, so let `linecache.getlines` to be called.
        if not (file.startswith('<') and file.endswith('>')):
            raise OSError('source code not available')

    module = getmodule(object, file)
    if module:
        lines = linecache.getlines(file, module.__dict__)
    else:
        lines = linecache.getlines(file)
    if not lines:
        raise OSError('could not get source code')

    if ismodule(object):
        return lines, 0

    if isclass(object):
        name = object.__name__
        pat = re.compile(r'^(\s*)class\s*' + name + r'\b')
        # make some effort to find the best matching class definition:
        # use the one with the least indentation, which is the one
        # that's most probably not inside a function definition.
        candidates = []
        for i in range(len(lines)):
            match = pat.match(lines[i])
            if match:
                # if it's at toplevel, it's already the best one
                if lines[i][0] == 'c':
                    return lines, i
                # else add whitespace to candidate list
                candidates.append((match.group(1), i))
        if candidates:
            # this will sort by whitespace, and by line number,
            # less whitespace first
            candidates.sort()
            return lines, candidates[0][1]
        else:
            raise OSError('could not find class definition')

    if ismethod(object):
        object = object.__func__
    if isfunction(object):
        object = object.__code__
    if istraceback(object):
        object = object.tb_frame
    if isframe(object):
        object = object.f_code
    if iscode(object):
        if not hasattr(object, 'co_firstlineno'):
            raise OSError('could not find function definition')
        lnum = object.co_firstlineno - 1
        pat = re.compile(r'^(\s*def\s)|(\s*async\s+def\s)|(.*(?<!\w)lambda(:|\s))|^(\s*@)')
        while lnum > 0:
            try:
                line = lines[lnum]
            except IndexError:
                raise OSError('lineno is out of bounds')
            if pat.match(line):
                break
            lnum = lnum - 1
        return lines, lnum
    raise OSError('could not find code object')

def getcomments(object):
    """Get lines of comments immediately preceding an object's source code.

    Returns None when source can't be found.
    """
    try:
        lines, lnum = findsource(object)
    except (OSError, TypeError):
        return None

    if ismodule(object):
        # Look for a comment block at the top of the file.
        start = 0
        if lines and lines[0][:2] == '#!': start = 1
        while start < len(lines) and lines[start].strip() in ('', '#'):
            start = start + 1
        if start < len(lines) and lines[start][:1] == '#':
            comments = []
            end = start
            while end < len(lines) and lines[end][:1] == '#':
                comments.append(lines[end].expandtabs())
                end = end + 1
            return ''.join(comments)

    # Look for a preceding block of comments at the same indentation.
    elif lnum > 0:
        indent = indentsize(lines[lnum])
        end = lnum - 1
        if end >= 0 and lines[end].lstrip()[:1] == '#' and \
            indentsize(lines[end]) == indent:
            comments = [lines[end].expandtabs().lstrip()]
            if end > 0:
                end = end - 1
                comment = lines[end].expandtabs().lstrip()
                while comment[:1] == '#' and indentsize(lines[end]) == indent:
                    comments[:0] = [comment]
                    end = end - 1
                    if end < 0: break
                    comment = lines[end].expandtabs().lstrip()
            while comments and comments[0].strip() == '#':
                comments[:1] = []
            while comments and comments[-1].strip() == '#':
                comments[-1:] = []
            return ''.join(comments)

class EndOfBlock(Exception): pass

class BlockFinder:
    """Provide a tokeneater() method to detect the end of a code block."""
    def __init__(self):
        self.indent = 0
        self.islambda = False
        self.started = False
        self.passline = False
        self.indecorator = False
        self.decoratorhasargs = False
        self.last = 1
        self.body_col0 = None

    def tokeneater(self, type, token, srowcol, erowcol, line):
        if not self.started and not self.indecorator:
            # skip any decorators
            if token == "@":
                self.indecorator = True
            # look for the first "def", "class" or "lambda"
            elif token in ("def", "class", "lambda"):
                if token == "lambda":
                    self.islambda = True
                self.started = True
            self.passline = True    # skip to the end of the line
        elif token == "(":
            if self.indecorator:
                self.decoratorhasargs = True
        elif token == ")":
            if self.indecorator:
                self.indecorator = False
                self.decoratorhasargs = False
        elif type == tokenize.NEWLINE:
            self.passline = False   # stop skipping when a NEWLINE is seen
            self.last = srowcol[0]
            if self.islambda:       # lambdas always end at the first NEWLINE
                raise EndOfBlock
            # hitting a NEWLINE when in a decorator without args
            # ends the decorator
            if self.indecorator and not self.decoratorhasargs:
                self.indecorator = False
        elif self.passline:
            pass
        elif type == tokenize.INDENT:
            if self.body_col0 is None and self.started:
                self.body_col0 = erowcol[1]
            self.indent = self.indent + 1
            self.passline = True
        elif type == tokenize.DEDENT:
            self.indent = self.indent - 1
            # the end of matching indent/dedent pairs end a block
            # (note that this only works for "def"/"class" blocks,
            #  not e.g. for "if: else:" or "try: finally:" blocks)
            if self.indent <= 0:
                raise EndOfBlock
        elif type == tokenize.COMMENT:
            if self.body_col0 is not None and srowcol[1] >= self.body_col0:
                # Include comments if indented at least as much as the block
                self.last = srowcol[0]
        elif self.indent == 0 and type not in (tokenize.COMMENT, tokenize.NL):
            # any other token on the same indentation level end the previous
            # block as well, except the pseudo-tokens COMMENT and NL.
            raise EndOfBlock

def getblock(lines):
    """Extract the block of code at the top of the given list of lines."""
    blockfinder = BlockFinder()
    try:
        tokens = tokenize.generate_tokens(iter(lines).__next__)
        for _token in tokens:
            blockfinder.tokeneater(*_token)
    except (EndOfBlock, IndentationError):
        pass
    return lines[:blockfinder.last]

def getsourcelines(object):
    """Return a list of source lines and starting line number for an object.

    The argument may be a module, class, method, function, traceback, frame,
    or code object.  The source code is returned as a list of the lines
    corresponding to the object and the line number indicates where in the
    original source file the first line of code was found.  An OSError is
    raised if the source code cannot be retrieved."""
    object = unwrap(object)
    lines, lnum = findsource(object)

    if istraceback(object):
        object = object.tb_frame

    # for module or frame that corresponds to module, return all source lines
    if (ismodule(object) or
        (isframe(object) and object.f_code.co_name == "<module>")):
        return lines, 0
    else:
        return getblock(lines[lnum:]), lnum + 1

def getsource(object):
    """Return the text of the source code for an object.

    The argument may be a module, class, method, function, traceback, frame,
    or code object.  The source code is returned as a single string.  An
    OSError is raised if the source code cannot be retrieved."""
    lines, lnum = getsourcelines(object)
    return ''.join(lines)

# --------------------------------------------------- class tree extraction
def walktree(classes, children, parent):
    """Recursive helper function for getclasstree()."""
    results = []
    classes.sort(key=attrgetter('__module__', '__name__'))
    for c in classes:
        results.append((c, c.__bases__))
        if c in children:
            results.append(walktree(children[c], children, c))
    return results

def getclasstree(classes, unique=False):
    """Arrange the given list of classes into a hierarchy of nested lists.

    Where a nested list appears, it contains classes derived from the class
    whose entry immediately precedes the list.  Each entry is a 2-tuple
    containing a class and a tuple of its base classes.  If the 'unique'
    argument is true, exactly one entry appears in the returned structure
    for each class in the given list.  Otherwise, classes using multiple
    inheritance and their descendants will appear multiple times."""
    children = {}
    roots = []
    for c in classes:
        if c.__bases__:
            for parent in c.__bases__:
                if parent not in children:
                    children[parent] = []
                if c not in children[parent]:
                    children[parent].append(c)
                if unique and parent in classes: break
        elif c not in roots:
            roots.append(c)
    for parent in children:
        if parent not in classes:
            roots.append(parent)
    return walktree(roots, children, None)

# ------------------------------------------------ argument list extraction
Arguments = namedtuple('Arguments', 'args, varargs, varkw')

def getargs(co):
    """Get information about the arguments accepted by a code object.

    Three things are returned: (args, varargs, varkw), where
    'args' is the list of argument names. Keyword-only arguments are
    appended. 'varargs' and 'varkw' are the names of the * and **
    arguments or None."""
    if not iscode(co):
        raise TypeError('{!r} is not a code object'.format(co))

    names = co.co_varnames
    nargs = co.co_argcount
    nkwargs = co.co_kwonlyargcount
    args = list(names[:nargs])
    kwonlyargs = list(names[nargs:nargs+nkwargs])
    step = 0

    nargs += nkwargs
    varargs = None
    if co.co_flags & CO_VARARGS:
        varargs = co.co_varnames[nargs]
        nargs = nargs + 1
    varkw = None
    if co.co_flags & CO_VARKEYWORDS:
        varkw = co.co_varnames[nargs]
    return Arguments(args + kwonlyargs, varargs, varkw)

ArgSpec = namedtuple('ArgSpec', 'args varargs keywords defaults')

def getargspec(func):
    """Get the names and default values of a function's parameters.

    A tuple of four things is returned: (args, varargs, keywords, defaults).
    'args' is a list of the argument names, including keyword-only argument names.
    'varargs' and 'keywords' are the names of the * and ** parameters or None.
    'defaults' is an n-tuple of the default values of the last n parameters.

    This function is deprecated, as it does not support annotations or
    keyword-only parameters and will raise ValueError if either is present
    on the supplied callable.

    For a more structured introspection API, use inspect.signature() instead.

    Alternatively, use getfullargspec() for an API with a similar namedtuple
    based interface, but full support for annotations and keyword-only
    parameters.

    Deprecated since Python 3.5, use `inspect.getfullargspec()`.
    """
    warnings.warn("inspect.getargspec() is deprecated since Python 3.0, "
                  "use inspect.signature() or inspect.getfullargspec()",
                  DeprecationWarning, stacklevel=2)
    args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, ann = \
        getfullargspec(func)
    if kwonlyargs or ann:
        raise ValueError("Function has keyword-only parameters or annotations"
                         ", use inspect.signature() API which can support them")
    return ArgSpec(args, varargs, varkw, defaults)

FullArgSpec = namedtuple('FullArgSpec',
    'args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations')

def getfullargspec(func):
    """Get the names and default values of a callable object's parameters.

    A tuple of seven things is returned:
    (args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations).
    'args' is a list of the parameter names.
    'varargs' and 'varkw' are the names of the * and ** parameters or None.
    'defaults' is an n-tuple of the default values of the last n parameters.
    'kwonlyargs' is a list of keyword-only parameter names.
    'kwonlydefaults' is a dictionary mapping names from kwonlyargs to defaults.
    'annotations' is a dictionary mapping parameter names to annotations.

    Notable differences from inspect.signature():
      - the "self" parameter is always reported, even for bound methods
      - wrapper chains defined by __wrapped__ *not* unwrapped automatically
    """
    try:
        # Re: `skip_bound_arg=False`
        #
        # There is a notable difference in behaviour between getfullargspec
        # and Signature: the former always returns 'self' parameter for bound
        # methods, whereas the Signature always shows the actual calling
        # signature of the passed object.
        #
        # To simulate this behaviour, we "unbind" bound methods, to trick
        # inspect.signature to always return their first parameter ("self",
        # usually)

        # Re: `follow_wrapper_chains=False`
        #
        # getfullargspec() historically ignored __wrapped__ attributes,
        # so we ensure that remains the case in 3.3+

        sig = _signature_from_callable(func,
                                       follow_wrapper_chains=False,
                                       skip_bound_arg=False,
                                       sigcls=Signature)
    except Exception as ex:
        # Most of the times 'signature' will raise ValueError.
        # But, it can also raise AttributeError, and, maybe something
        # else. So to be fully backwards compatible, we catch all
        # possible exceptions here, and reraise a TypeError.
        raise TypeError('unsupported callable') from ex

    args = []
    varargs = None
    varkw = None
    posonlyargs = []
    kwonlyargs = []
    defaults = ()
    annotations = {}
    defaults = ()
    kwdefaults = {}

    if sig.return_annotation is not sig.empty:
        annotations['return'] = sig.return_annotation

    for param in sig.parameters.values():
        kind = param.kind
        name = param.name

        if kind is _POSITIONAL_ONLY:
            posonlyargs.append(name)
            if param.default is not param.empty:
                defaults += (param.default,)
        elif kind is _POSITIONAL_OR_KEYWORD:
            args.append(name)
            if param.default is not param.empty:
                defaults += (param.default,)
        elif kind is _VAR_POSITIONAL:
            varargs = name
        elif kind is _KEYWORD_ONLY:
            kwonlyargs.append(name)
            if param.default is not param.empty:
                kwdefaults[name] = param.default
        elif kind is _VAR_KEYWORD:
            varkw = name

        if param.annotation is not param.empty:
            annotations[name] = param.annotation

    if not kwdefaults:
        # compatibility with 'func.__kwdefaults__'
        kwdefaults = None

    if not defaults:
        # compatibility with 'func.__defaults__'
        defaults = None

    return FullArgSpec(posonlyargs + args, varargs, varkw, defaults,
                       kwonlyargs, kwdefaults, annotations)


ArgInfo = namedtuple('ArgInfo', 'args varargs keywords locals')

def getargvalues(frame):
    """Get information about arguments passed into a particular frame.

    A tuple of four things is returned: (args, varargs, varkw, locals).
    'args' is a list of the argument names.
    'varargs' and 'varkw' are the names of the * and ** arguments or None.
    'locals' is the locals dictionary of the given frame."""
    args, varargs, varkw = getargs(frame.f_code)
    return ArgInfo(args, varargs, varkw, frame.f_locals)

def formatannotation(annotation, base_module=None):
    if getattr(annotation, '__module__', None) == 'typing':
        return repr(annotation).replace('typing.', '')
    if isinstance(annotation, type):
        if annotation.__module__ in ('builtins', base_module):
            return annotation.__qualname__
        return annotation.__module__+'.'+annotation.__qualname__
    return repr(annotation)

def formatannotationrelativeto(object):
    module = getattr(object, '__module__', None)
    def _formatannotation(annotation):
        return formatannotation(annotation, module)
    return _formatannotation

def formatargspec(args, varargs=None, varkw=None, defaults=None,
                  kwonlyargs=(), kwonlydefaults={}, annotations={},
                  formatarg=str,
                  formatvarargs=lambda name: '*' + name,
                  formatvarkw=lambda name: '**' + name,
                  formatvalue=lambda value: '=' + repr(value),
                  formatreturns=lambda text: ' -> ' + text,
                  formatannotation=formatannotation):
    """Format an argument spec from the values returned by getfullargspec.

    The first seven arguments are (args, varargs, varkw, defaults,
    kwonlyargs, kwonlydefaults, annotations).  The other five arguments
    are the corresponding optional formatting functions that are called to
    turn names and values into strings.  The last argument is an optional
    function to format the sequence of arguments.

    Deprecated since Python 3.5: use the `signature` function and `Signature`
    objects.
    """

    from warnings import warn

    warn("`formatargspec` is deprecated since Python 3.5. Use `signature` and "
         "the `Signature` object directly",
         DeprecationWarning,
         stacklevel=2)

    def formatargandannotation(arg):
        result = formatarg(arg)
        if arg in annotations:
            result += ': ' + formatannotation(annotations[arg])
        return result
    specs = []
    if defaults:
        firstdefault = len(args) - len(defaults)
    for i, arg in enumerate(args):
        spec = formatargandannotation(arg)
        if defaults and i >= firstdefault:
            spec = spec + formatvalue(defaults[i - firstdefault])
        specs.append(spec)
    if varargs is not None:
        specs.append(formatvarargs(formatargandannotation(varargs)))
    else:
        if kwonlyargs:
            specs.append('*')
    if kwonlyargs:
        for kwonlyarg in kwonlyargs:
            spec = formatargandannotation(kwonlyarg)
            if kwonlydefaults and kwonlyarg in kwonlydefaults:
                spec += formatvalue(kwonlydefaults[kwonlyarg])
            specs.append(spec)
    if varkw is not None:
        specs.append(formatvarkw(formatargandannotation(varkw)))
    result = '(' + ', '.join(specs) + ')'
    if 'return' in annotations:
        result += formatreturns(formatannotation(annotations['return']))
    return result

def formatargvalues(args, varargs, varkw, locals,
                    formatarg=str,
                    formatvarargs=lambda name: '*' + name,
                    formatvarkw=lambda name: '**' + name,
                    formatvalue=lambda value: '=' + repr(value)):
    """Format an argument spec from the 4 values returned by getargvalues.

    The first four arguments are (args, varargs, varkw, locals).  The
    next four arguments are the corresponding optional formatting functions
    that are called to turn names and values into strings.  The ninth
    argument is an optional function to format the sequence of arguments."""
    def convert(name, locals=locals,
                formatarg=formatarg, formatvalue=formatvalue):
        return formatarg(name) + formatvalue(locals[name])
    specs = []
    for i in range(len(args)):
        specs.append(convert(args[i]))
    if varargs:
        specs.append(formatvarargs(varargs) + formatvalue(locals[varargs]))
    if varkw:
        specs.append(formatvarkw(varkw) + formatvalue(locals[varkw]))
    return '(' + ', '.join(specs) + ')'

def _missing_arguments(f_name, argnames, pos, values):
    names = [repr(name) for name in argnames if name not in values]
    missing = len(names)
    if missing == 1:
        s = names[0]
    elif missing == 2:
        s = "{} and {}".format(*names)
    else:
        tail = ", {} and {}".format(*names[-2:])
        del names[-2:]
        s = ", ".join(names) + tail
    raise TypeError("%s() missing %i required %s argument%s: %s" %
                    (f_name, missing,
                      "positional" if pos else "keyword-only",
                      "" if missing == 1 else "s", s))

def _too_many(f_name, args, kwonly, varargs, defcount, given, values):
    atleast = len(args) - defcount
    kwonly_given = len([arg for arg in kwonly if arg in values])
    if varargs:
        plural = atleast != 1
        sig = "at least %d" % (atleast,)
    elif defcount:
        plural = True
        sig = "from %d to %d" % (atleast, len(args))
    else:
        plural = len(args) != 1
        sig = str(len(args))
    kwonly_sig = ""
    if kwonly_given:
        msg = " positional argument%s (and %d keyword-only argument%s)"
        kwonly_sig = (msg % ("s" if given != 1 else "", kwonly_given,
                             "s" if kwonly_given != 1 else ""))
    raise TypeError("%s() takes %s positional argument%s but %d%s %s given" %
            (f_name, sig, "s" if plural else "", given, kwonly_sig,
             "was" if given == 1 and not kwonly_given else "were"))

def getcallargs(func, /, *positional, **named):
    """Get the mapping of arguments to values.

    A dict is returned, with keys the function argument names (including the
    names of the * and ** arguments, if any), and values the respective bound
    values from 'positional' and 'named'."""
    spec = getfullargspec(func)
    args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, ann = spec
    f_name = func.__name__
    arg2value = {}


    if ismethod(func) and func.__self__ is not None:
        # implicit 'self' (or 'cls' for classmethods) argument
        positional = (func.__self__,) + positional
    num_pos = len(positional)
    num_args = len(args)
    num_defaults = len(defaults) if defaults else 0

    n = min(num_pos, num_args)
    for i in range(n):
        arg2value[args[i]] = positional[i]
    if varargs:
        arg2value[varargs] = tuple(positional[n:])
    possible_kwargs = set(args + kwonlyargs)
    if varkw:
        arg2value[varkw] = {}
    for kw, value in named.items():
        if kw not in possible_kwargs:
            if not varkw:
                raise TypeError("%s() got an unexpected keyword argument %r" %
                                (f_name, kw))
            arg2value[varkw][kw] = value
            continue
        if kw in arg2value:
            raise TypeError("%s() got multiple values for argument %r" %
                            (f_name, kw))
        arg2value[kw] = value
    if num_pos > num_args and not varargs:
        _too_many(f_name, args, kwonlyargs, varargs, num_defaults,
                   num_pos, arg2value)
    if num_pos < num_args:
        req = args[:num_args - num_defaults]
        for arg in req:
            if arg not in arg2value:
                _missing_arguments(f_name, req, True, arg2value)
        for i, arg in enumerate(args[num_args - num_defaults:]):
            if arg not in arg2value:
                arg2value[arg] = defaults[i]
    missing = 0
    for kwarg in kwonlyargs:
        if kwarg not in arg2value:
            if kwonlydefaults and kwarg in kwonlydefaults:
                arg2value[kwarg] = kwonlydefaults[kwarg]
            else:
                missing += 1
    if missing:
        _missing_arguments(f_name, kwonlyargs, False, arg2value)
    return arg2value

ClosureVars = namedtuple('ClosureVars', 'nonlocals globals builtins unbound')

def getclosurevars(func):
    """
    Get the mapping of free variables to their current values.

    Returns a named tuple of dicts mapping the current nonlocal, global
    and builtin references as seen by the body of the function. A final
    set of unbound names that could not be resolved is also provided.
    """

    if ismethod(func):
        func = func.__func__

    if not isfunction(func):
        raise TypeError("{!r} is not a Python function".format(func))

    code = func.__code__
    # Nonlocal references are named in co_freevars and resolved
    # by looking them up in __closure__ by positional index
    if func.__closure__ is None:
        nonlocal_vars = {}
    else:
        nonlocal_vars = {
            var : cell.cell_contents
            for var, cell in zip(code.co_freevars, func.__closure__)
       }

    # Global and builtin references are named in co_names and resolved
    # by looking them up in __globals__ or __builtins__
    global_ns = func.__globals__
    builtin_ns = global_ns.get("__builtins__", builtins.__dict__)
    if ismodule(builtin_ns):
        builtin_ns = builtin_ns.__dict__
    global_vars = {}
    builtin_vars = {}
    unbound_names = set()
    for name in code.co_names:
        if name in ("None", "True", "False"):
            # Because these used to be builtins instead of keywords, they
            # may still show up as name references. We ignore them.
            continue
        try:
            global_vars[name] = global_ns[name]
        except KeyError:
            try:
                builtin_vars[name] = builtin_ns[name]
            except KeyError:
                unbound_names.add(name)

    return ClosureVars(nonlocal_vars, global_vars,
                       builtin_vars, unbound_names)

# -------------------------------------------------- stack frame extraction

Traceback = namedtuple('Traceback', 'filename lineno function code_context index')

def getframeinfo(frame, context=1):
    """Get information about a frame or traceback object.

    A tuple of five things is returned: the filename, the line number of
    the current line, the function name, a list of lines of context from
    the source code, and the index of the current line within that list.
    The optional second argument specifies the number of lines of context
    to return, which are centered around the current line."""
    if istraceback(frame):
        lineno = frame.tb_lineno
        frame = frame.tb_frame
    else:
        lineno = frame.f_lineno
    if not isframe(frame):
        raise TypeError('{!r} is not a frame or traceback object'.format(frame))

    filename = getsourcefile(frame) or getfile(frame)
    if context > 0:
        start = lineno - 1 - context//2
        try:
            lines, lnum = findsource(frame)
        except OSError:
            lines = index = None
        else:
            start = max(0, min(start, len(lines) - context))
            lines = lines[start:start+context]
            index = lineno - 1 - start
    else:
        lines = index = None

    return Traceback(filename, lineno, frame.f_code.co_name, lines, index)

def getlineno(frame):
    """Get the line number from a frame object, allowing for optimization."""
    # FrameType.f_lineno is now a descriptor that grovels co_lnotab
    return frame.f_lineno

FrameInfo = namedtuple('FrameInfo', ('frame',) + Traceback._fields)

def getouterframes(frame, context=1):
    """Get a list of records for a frame and all higher (calling) frames.

    Each record contains a frame object, filename, line number, function
    name, a list of lines of context, and index within the context."""
    framelist = []
    while frame:
        frameinfo = (frame,) + getframeinfo(frame, context)
        framelist.append(FrameInfo(*frameinfo))
        frame = frame.f_back
    return framelist

def getinnerframes(tb, context=1):
    """Get a list of records for a traceback's frame and all lower frames.

    Each record contains a frame object, filename, line number, function
    name, a list of lines of context, and index within the context."""
    framelist = []
    while tb:
        frameinfo = (tb.tb_frame,) + getframeinfo(tb, context)
        framelist.append(FrameInfo(*frameinfo))
        tb = tb.tb_next
    return framelist

def currentframe():
    """Return the frame of the caller or None if this is not possible."""
    return sys._getframe(1) if hasattr(sys, "_getframe") else None

def stack(context=1):
    """Return a list of records for the stack above the caller's frame."""
    return getouterframes(sys._getframe(1), context)

def trace(context=1):
    """Return a list of records for the stack below the current exception."""
    return getinnerframes(sys.exc_info()[2], context)


# ------------------------------------------------ static version of getattr

_sentinel = object()

def _static_getmro(klass):
    return type.__dict__['__mro__'].__get__(klass)

def _check_instance(obj, attr):
    instance_dict = {}
    try:
        instance_dict = object.__getattribute__(obj, "__dict__")
    except AttributeError:
        pass
    return dict.get(instance_dict, attr, _sentinel)


def _check_class(klass, attr):
    for entry in _static_getmro(klass):
        if _shadowed_dict(type(entry)) is _sentinel:
            try:
                return entry.__dict__[attr]
            except KeyError:
                pass
    return _sentinel

def _is_type(obj):
    try:
        _static_getmro(obj)
    except TypeError:
        return False
    return True

def _shadowed_dict(klass):
    dict_attr = type.__dict__["__dict__"]
    for entry in _static_getmro(klass):
        try:
            class_dict = dict_attr.__get__(entry)["__dict__"]
        except KeyError:
            pass
        else:
            if not (type(class_dict) is types.GetSetDescriptorType and
                    class_dict.__name__ == "__dict__" and
                    class_dict.__objclass__ is entry):
                return class_dict
    return _sentinel

def getattr_static(obj, attr, default=_sentinel):
    """Retrieve attributes without triggering dynamic lookup via the
       descriptor protocol,  __getattr__ or __getattribute__.

       Note: this function may not be able to retrieve all attributes
       that getattr can fetch (like dynamically created attributes)
       and may find attributes that getattr can't (like descriptors
       that raise AttributeError). It can also return descriptor objects
       instead of instance members in some cases. See the
       documentation for details.
    """
    instance_result = _sentinel
    if not _is_type(obj):
        klass = type(obj)
        dict_attr = _shadowed_dict(klass)
        if (dict_attr is _sentinel or
            type(dict_attr) is types.MemberDescriptorType):
            instance_result = _check_instance(obj, attr)
    else:
        klass = obj

    klass_result = _check_class(klass, attr)

    if instance_result is not _sentinel and klass_result is not _sentinel:
        if (_check_class(type(klass_result), '__get__') is not _sentinel and
            _check_class(type(klass_result), '__set__') is not _sentinel):
            return klass_result

    if instance_result is not _sentinel:
        return instance_result
    if klass_result is not _sentinel:
        return klass_result

    if obj is klass:
        # for types we check the metaclass too
        for entry in _static_getmro(type(klass)):
            if _shadowed_dict(type(entry)) is _sentinel:
                try:
                    return entry.__dict__[attr]
                except KeyError:
                    pass
    if default is not _sentinel:
        return default
    raise AttributeError(attr)


# ------------------------------------------------ generator introspection

GEN_CREATED = 'GEN_CREATED'
GEN_RUNNING = 'GEN_RUNNING'
GEN_SUSPENDED = 'GEN_SUSPENDED'
GEN_CLOSED = 'GEN_CLOSED'

def getgeneratorstate(generator):
    """Get current state of a generator-iterator.

    Possible states are:
      GEN_CREATED: Waiting to start execution.
      GEN_RUNNING: Currently being executed by the interpreter.
      GEN_SUSPENDED: Currently suspended at a yield expression.
      GEN_CLOSED: Execution has completed.
    """
    if generator.gi_running:
        return GEN_RUNNING
    if generator.gi_frame is None:
        return GEN_CLOSED
    if generator.gi_frame.f_lasti == -1:
        return GEN_CREATED
    return GEN_SUSPENDED


def getgeneratorlocals(generator):
    """
    Get the mapping of generator local variables to their current values.

    A dict is returned, with the keys the local variable names and values the
    bound values."""

    if not isgenerator(generator):
        raise TypeError("{!r} is not a Python generator".format(generator))

    frame = getattr(generator, "gi_frame", None)
    if frame is not None:
        return generator.gi_frame.f_locals
    else:
        return {}


# ------------------------------------------------ coroutine introspection

CORO_CREATED = 'CORO_CREATED'
CORO_RUNNING = 'CORO_RUNNING'
CORO_SUSPENDED = 'CORO_SUSPENDED'
CORO_CLOSED = 'CORO_CLOSED'

def getcoroutinestate(coroutine):
    """Get current state of a coroutine object.

    Possible states are:
      CORO_CREATED: Waiting to start execution.
      CORO_RUNNING: Currently being executed by the interpreter.
      CORO_SUSPENDED: Currently suspended at an await expression.
      CORO_CLOSED: Execution has completed.
    """
    if coroutine.cr_running:
        return CORO_RUNNING
    if coroutine.cr_frame is None:
        return CORO_CLOSED
    if coroutine.cr_frame.f_lasti == -1:
        return CORO_CREATED
    return CORO_SUSPENDED


def getcoroutinelocals(coroutine):
    """
    Get the mapping of coroutine local variables to their current values.

    A dict is returned, with the keys the local variable names and values the
    bound values."""
    frame = getattr(coroutine, "cr_frame", None)
    if frame is not None:
        return frame.f_locals
    else:
        return {}


###############################################################################
### Function Signature Object (PEP 362)
###############################################################################


_WrapperDescriptor = type(type.__call__)
_MethodWrapper = type(all.__call__)
_ClassMethodWrapper = type(int.__dict__['from_bytes'])

_NonUserDefinedCallables = (_WrapperDescriptor,
                            _MethodWrapper,
                            _ClassMethodWrapper,
                            types.BuiltinFunctionType)


def _signature_get_user_defined_method(cls, method_name):
    """Private helper. Checks if ``cls`` has an attribute
    named ``method_name`` and returns it only if it is a
    pure python function.
    """
    try:
        meth = getattr(cls, method_name)
    except AttributeError:
        return
    else:
        if not isinstance(meth, _NonUserDefinedCallables):
            # Once '__signature__' will be added to 'C'-level
            # callables, this check won't be necessary
            return meth


def _signature_get_partial(wrapped_sig, partial, extra_args=()):
    """Private helper to calculate how 'wrapped_sig' signature will
    look like after applying a 'functools.partial' object (or alike)
    on it.
    """

    old_params = wrapped_sig.parameters
    new_params = OrderedDict(old_params.items())

    partial_args = partial.args or ()
    partial_keywords = partial.keywords or {}

    if extra_args:
        partial_args = extra_args + partial_args

    try:
        ba = wrapped_sig.bind_partial(*partial_args, **partial_keywords)
    except TypeError as ex:
        msg = 'partial object {!r} has incorrect arguments'.format(partial)
        raise ValueError(msg) from ex


    transform_to_kwonly = False
    for param_name, param in old_params.items():
        try:
            arg_value = ba.arguments[param_name]
        except KeyError:
            pass
        else:
            if param.kind is _POSITIONAL_ONLY:
                # If positional-only parameter is bound by partial,
                # it effectively disappears from the signature
                new_params.pop(param_name)
                continue

            if param.kind is _POSITIONAL_OR_KEYWORD:
                if param_name in partial_keywords:
                    # This means that this parameter, and all parameters
                    # after it should be keyword-only (and var-positional
                    # should be removed). Here's why. Consider the following
                    # function:
                    #     foo(a, b, *args, c):
                    #         pass
                    #
                    # "partial(foo, a='spam')" will have the following
                    # signature: "(*, a='spam', b, c)". Because attempting
                    # to call that partial with "(10, 20)" arguments will
                    # raise a TypeError, saying that "a" argument received
                    # multiple values.
                    transform_to_kwonly = True
                    # Set the new default value
                    new_params[param_name] = param.replace(default=arg_value)
                else:
                    # was passed as a positional argument
                    new_params.pop(param.name)
                    continue

            if param.kind is _KEYWORD_ONLY:
                # Set the new default value
                new_params[param_name] = param.replace(default=arg_value)

        if transform_to_kwonly:
            assert param.kind is not _POSITIONAL_ONLY

            if param.kind is _POSITIONAL_OR_KEYWORD:
                new_param = new_params[param_name].replace(kind=_KEYWORD_ONLY)
                new_params[param_name] = new_param
                new_params.move_to_end(param_name)
            elif param.kind in (_KEYWORD_ONLY, _VAR_KEYWORD):
                new_params.move_to_end(param_name)
            elif param.kind is _VAR_POSITIONAL:
                new_params.pop(param.name)

    return wrapped_sig.replace(parameters=new_params.values())


def _signature_bound_method(sig):
    """Private helper to transform signatures for unbound
    functions to bound methods.
    """

    params = tuple(sig.parameters.values())

    if not params or params[0].kind in (_VAR_KEYWORD, _KEYWORD_ONLY):
        raise ValueError('invalid method signature')

    kind = params[0].kind
    if kind in (_POSITIONAL_OR_KEYWORD, _POSITIONAL_ONLY):
        # Drop first parameter:
        # '(p1, p2[, ...])' -> '(p2[, ...])'
        params = params[1:]
    else:
        if kind is not _VAR_POSITIONAL:
            # Unless we add a new parameter type we never
            # get here
            raise ValueError('invalid argument type')
        # It's a var-positional parameter.
        # Do nothing. '(*args[, ...])' -> '(*args[, ...])'

    return sig.replace(parameters=params)


def _signature_is_builtin(obj):
    """Private helper to test if `obj` is a callable that might
    support Argument Clinic's __text_signature__ protocol.
    """
    return (isbuiltin(obj) or
            ismethoddescriptor(obj) or
            isinstance(obj, _NonUserDefinedCallables) or
            # Can't test 'isinstance(type)' here, as it would
            # also be True for regular python classes
            obj in (type, object))


def _signature_is_functionlike(obj):
    """Private helper to test if `obj` is a duck type of FunctionType.
    A good example of such objects are functions compiled with
    Cython, which have all attributes that a pure Python function
    would have, but have their code statically compiled.
    """

    if not callable(obj) or isclass(obj):
        # All function-like objects are obviously callables,
        # and not classes.
        return False

    name = getattr(obj, '__name__', None)
    code = getattr(obj, '__code__', None)
    defaults = getattr(obj, '__defaults__', _void) # Important to use _void ...
    kwdefaults = getattr(obj, '__kwdefaults__', _void) # ... and not None here
    annotations = getattr(obj, '__annotations__', None)

    return (isinstance(code, types.CodeType) and
            isinstance(name, str) and
            (defaults is None or isinstance(defaults, tuple)) and
            (kwdefaults is None or isinstance(kwdefaults, dict)) and
            isinstance(annotations, dict))


def _signature_get_bound_param(spec):
    """ Private helper to get first parameter name from a
    __text_signature__ of a builtin method, which should
    be in the following format: '($param1, ...)'.
    Assumptions are that the first argument won't have
    a default value or an annotation.
    """

    assert spec.startswith('($')

    pos = spec.find(',')
    if pos == -1:
        pos = spec.find(')')

    cpos = spec.find(':')
    assert cpos == -1 or cpos > pos

    cpos = spec.find('=')
    assert cpos == -1 or cpos > pos

    return spec[2:pos]


def _signature_strip_non_python_syntax(signature):
    """
    Private helper function. Takes a signature in Argument Clinic's
    extended signature format.

    Returns a tuple of three things:
      * that signature re-rendered in standard Python syntax,
      * the index of the "self" parameter (generally 0), or None if
        the function does not have a "self" parameter, and
      * the index of the last "positional only" parameter,
        or None if the signature has no positional-only parameters.
    """

    if not signature:
        return signature, None, None

    self_parameter = None
    last_positional_only = None

    lines = [l.encode('ascii') for l in signature.split('\n')]
    generator = iter(lines).__next__
    token_stream = tokenize.tokenize(generator)

    delayed_comma = False
    skip_next_comma = False
    text = []
    add = text.append

    current_parameter = 0
    OP = token.OP
    ERRORTOKEN = token.ERRORTOKEN

    # token stream always starts with ENCODING token, skip it
    t = next(token_stream)
    assert t.type == tokenize.ENCODING

    for t in token_stream:
        type, string = t.type, t.string

        if type == OP:
            if string == ',':
                if skip_next_comma:
                    skip_next_comma = False
                else:
                    assert not delayed_comma
                    delayed_comma = True
                    current_parameter += 1
                continue

            if string == '/':
                assert not skip_next_comma
                assert last_positional_only is None
                skip_next_comma = True
                last_positional_only = current_parameter - 1
                continue

        if (type == ERRORTOKEN) and (string == '$'):
            assert self_parameter is None
            self_parameter = current_parameter
            continue

        if delayed_comma:
            delayed_comma = False
            if not ((type == OP) and (string == ')')):
                add(', ')
        add(string)
        if (string == ','):
            add(' ')
    clean_signature = ''.join(text)
    return clean_signature, self_parameter, last_positional_only


def _signature_fromstr(cls, obj, s, skip_bound_arg=True):
    """Private helper to parse content of '__text_signature__'
    and return a Signature based on it.
    """
    # Lazy import ast because it's relatively heavy and
    # it's not used for other than this function.
    import ast

    Parameter = cls._parameter_cls

    clean_signature, self_parameter, last_positional_only = \
        _signature_strip_non_python_syntax(s)

    program = "def foo" + clean_signature + ": pass"

    try:
        module = ast.parse(program)
    except SyntaxError:
        module = None

    if not isinstance(module, ast.Module):
        raise ValueError("{!r} builtin has invalid signature".format(obj))

    f = module.body[0]

    parameters = []
    empty = Parameter.empty
    invalid = object()

    module = None
    module_dict = {}
    module_name = getattr(obj, '__module__', None)
    if module_name:
        module = sys.modules.get(module_name, None)
        if module:
            module_dict = module.__dict__
    sys_module_dict = sys.modules.copy()

    def parse_name(node):
        assert isinstance(node, ast.arg)
        if node.annotation is not None:
            raise ValueError("Annotations are not currently supported")
        return node.arg

    def wrap_value(s):
        try:
            value = eval(s, module_dict)
        except NameError:
            try:
                value = eval(s, sys_module_dict)
            except NameError:
                raise RuntimeError()

        if isinstance(value, (str, int, float, bytes, bool, type(None))):
            return ast.Constant(value)
        raise RuntimeError()

    class RewriteSymbolics(ast.NodeTransformer):
        def visit_Attribute(self, node):
            a = []
            n = node
            while isinstance(n, ast.Attribute):
                a.append(n.attr)
                n = n.value
            if not isinstance(n, ast.Name):
                raise RuntimeError()
            a.append(n.id)
            value = ".".join(reversed(a))
            return wrap_value(value)

        def visit_Name(self, node):
            if not isinstance(node.ctx, ast.Load):
                raise ValueError()
            return wrap_value(node.id)

    def p(name_node, default_node, default=empty):
        name = parse_name(name_node)
        if name is invalid:
            return None
        if default_node and default_node is not _empty:
            try:
                default_node = RewriteSymbolics().visit(default_node)
                o = ast.literal_eval(default_node)
            except ValueError:
                o = invalid
            if o is invalid:
                return None
            default = o if o is not invalid else default
        parameters.append(Parameter(name, kind, default=default, annotation=empty))

    # non-keyword-only parameters
    args = reversed(f.args.args)
    defaults = reversed(f.args.defaults)
    iter = itertools.zip_longest(args, defaults, fillvalue=None)
    if last_positional_only is not None:
        kind = Parameter.POSITIONAL_ONLY
    else:
        kind = Parameter.POSITIONAL_OR_KEYWORD
    for i, (name, default) in enumerate(reversed(list(iter))):
        p(name, default)
        if i == last_positional_only:
            kind = Parameter.POSITIONAL_OR_KEYWORD

    # *args
    if f.args.vararg:
        kind = Parameter.VAR_POSITIONAL
        p(f.args.vararg, empty)

    # keyword-only arguments
    kind = Parameter.KEYWORD_ONLY
    for name, default in zip(f.args.kwonlyargs, f.args.kw_defaults):
        p(name, default)

    # **kwargs
    if f.args.kwarg:
        kind = Parameter.VAR_KEYWORD
        p(f.args.kwarg, empty)

    if self_parameter is not None:
        # Possibly strip the bound argument:
        #    - We *always* strip first bound argument if
        #      it is a module.
        #    - We don't strip first bound argument if
        #      skip_bound_arg is False.
        assert parameters
        _self = getattr(obj, '__self__', None)
        self_isbound = _self is not None
        self_ismodule = ismodule(_self)
        if self_isbound and (self_ismodule or skip_bound_arg):
            parameters.pop(0)
        else:
            # for builtins, self parameter is always positional-only!
            p = parameters[0].replace(kind=Parameter.POSITIONAL_ONLY)
            parameters[0] = p

    return cls(parameters, return_annotation=cls.empty)


def _signature_from_builtin(cls, func, skip_bound_arg=True):
    """Private helper function to get signature for
    builtin callables.
    """

    if not _signature_is_builtin(func):
        raise TypeError("{!r} is not a Python builtin "
                        "function".format(func))

    s = getattr(func, "__text_signature__", None)
    if not s:
        raise ValueError("no signature found for builtin {!r}".format(func))

    return _signature_fromstr(cls, func, s, skip_bound_arg)


def _signature_from_function(cls, func, skip_bound_arg=True):
    """Private helper: constructs Signature for the given python function."""

    is_duck_function = False
    if not isfunction(func):
        if _signature_is_functionlike(func):
            is_duck_function = True
        else:
            # If it's not a pure Python function, and not a duck type
            # of pure function:
            raise TypeError('{!r} is not a Python function'.format(func))

    s = getattr(func, "__text_signature__", None)
    if s:
        return _signature_fromstr(cls, func, s, skip_bound_arg)

    Parameter = cls._parameter_cls

    # Parameter information.
    func_code = func.__code__
    pos_count = func_code.co_argcount
    arg_names = func_code.co_varnames
    posonly_count = func_code.co_posonlyargcount
    positional = arg_names[:pos_count]
    keyword_only_count = func_code.co_kwonlyargcount
    keyword_only = arg_names[pos_count:pos_count + keyword_only_count]
    annotations = func.__annotations__
    defaults = func.__defaults__
    kwdefaults = func.__kwdefaults__

    if defaults:
        pos_default_count = len(defaults)
    else:
        pos_default_count = 0

    parameters = []

    non_default_count = pos_count - pos_default_count
    posonly_left = posonly_count

    # Non-keyword-only parameters w/o defaults.
    for name in positional[:non_default_count]:
        kind = _POSITIONAL_ONLY if posonly_left else _POSITIONAL_OR_KEYWORD
        annotation = annotations.get(name, _empty)
        parameters.append(Parameter(name, annotation=annotation,
                                    kind=kind))
        if posonly_left:
            posonly_left -= 1

    # ... w/ defaults.
    for offset, name in enumerate(positional[non_default_count:]):
        kind = _POSITIONAL_ONLY if posonly_left else _POSITIONAL_OR_KEYWORD
        annotation = annotations.get(name, _empty)
        parameters.append(Parameter(name, annotation=annotation,
                                    kind=kind,
                                    default=defaults[offset]))
        if posonly_left:
            posonly_left -= 1

    # *args
    if func_code.co_flags & CO_VARARGS:
        name = arg_names[pos_count + keyword_only_count]
        annotation = annotations.get(name, _empty)
        parameters.append(Parameter(name, annotation=annotation,
                                    kind=_VAR_POSITIONAL))

    # Keyword-only parameters.
    for name in keyword_only:
        default = _empty
        if kwdefaults is not None:
            default = kwdefaults.get(name, _empty)

        annotation = annotations.get(name, _empty)
        parameters.append(Parameter(name, annotation=annotation,
                                    kind=_KEYWORD_ONLY,
                                    default=default))
    # **kwargs
    if func_code.co_flags & CO_VARKEYWORDS:
        index = pos_count + keyword_only_count
        if func_code.co_flags & CO_VARARGS:
            index += 1

        name = arg_names[index]
        annotation = annotations.get(name, _empty)
        parameters.append(Parameter(name, annotation=annotation,
                                    kind=_VAR_KEYWORD))

    # Is 'func' is a pure Python function - don't validate the
    # parameters list (for correct order and defaults), it should be OK.
    return cls(parameters,
               return_annotation=annotations.get('return', _empty),
               __validate_parameters__=is_duck_function)


def _signature_from_callable(obj, *,
                             follow_wrapper_chains=True,
                             skip_bound_arg=True,
                             sigcls):

    """Private helper function to get signature for arbitrary
    callable objects.
    """

    if not callable(obj):
        raise TypeError('{!r} is not a callable object'.format(obj))

    if isinstance(obj, types.MethodType):
        # In this case we skip the first parameter of the underlying
        # function (usually `self` or `cls`).
        sig = _signature_from_callable(
            obj.__func__,
            follow_wrapper_chains=follow_wrapper_chains,
            skip_bound_arg=skip_bound_arg,
            sigcls=sigcls)

        if skip_bound_arg:
            return _signature_bound_method(sig)
        else:
            return sig

    # Was this function wrapped by a decorator?
    if follow_wrapper_chains:
        obj = unwrap(obj, stop=(lambda f: hasattr(f, "__signature__")))
        if isinstance(obj, types.MethodType):
            # If the unwrapped object is a *method*, we might want to
            # skip its first parameter (self).
            # See test_signature_wrapped_bound_method for details.
            return _signature_from_callable(
                obj,
                follow_wrapper_chains=follow_wrapper_chains,
                skip_bound_arg=skip_bound_arg,
                sigcls=sigcls)

    try:
        sig = obj.__signature__
    except AttributeError:
        pass
    else:
        if sig is not None:
            if not isinstance(sig, Signature):
                raise TypeError(
                    'unexpected object {!r} in __signature__ '
                    'attribute'.format(sig))
            return sig

    try:
        partialmethod = obj._partialmethod
    except AttributeError:
        pass
    else:
        if isinstance(partialmethod, functools.partialmethod):
            # Unbound partialmethod (see functools.partialmethod)
            # This means, that we need to calculate the signature
            # as if it's a regular partial object, but taking into
            # account that the first positional argument
            # (usually `self`, or `cls`) will not be passed
            # automatically (as for boundmethods)

            wrapped_sig = _signature_from_callable(
                partialmethod.func,
                follow_wrapper_chains=follow_wrapper_chains,
                skip_bound_arg=skip_bound_arg,
                sigcls=sigcls)

            sig = _signature_get_partial(wrapped_sig, partialmethod, (None,))
            first_wrapped_param = tuple(wrapped_sig.parameters.values())[0]
            if first_wrapped_param.kind is Parameter.VAR_POSITIONAL:
                # First argument of the wrapped callable is `*args`, as in
                # `partialmethod(lambda *args)`.
                return sig
            else:
                sig_params = tuple(sig.parameters.values())
                assert (not sig_params or
                        first_wrapped_param is not sig_params[0])
                new_params = (first_wrapped_param,) + sig_params
                return sig.replace(parameters=new_params)

    if isfunction(obj) or _signature_is_functionlike(obj):
        # If it's a pure Python function, or an object that is duck type
        # of a Python function (Cython functions, for instance), then:
        return _signature_from_function(sigcls, obj,
                                        skip_bound_arg=skip_bound_arg)

    if _signature_is_builtin(obj):
        return _signature_from_builtin(sigcls, obj,
                                       skip_bound_arg=skip_bound_arg)

    if isinstance(obj, functools.partial):
        wrapped_sig = _signature_from_callable(
            obj.func,
            follow_wrapper_chains=follow_wrapper_chains,
            skip_bound_arg=skip_bound_arg,
            sigcls=sigcls)
        return _signature_get_partial(wrapped_sig, obj)

    sig = None
    if isinstance(obj, type):
        # obj is a class or a metaclass

        # First, let's see if it has an overloaded __call__ defined
        # in its metaclass
        call = _signature_get_user_defined_method(type(obj), '__call__')
        if call is not None:
            sig = _signature_from_callable(
                call,
                follow_wrapper_chains=follow_wrapper_chains,
                skip_bound_arg=skip_bound_arg,
                sigcls=sigcls)
        else:
            # Now we check if the 'obj' class has a '__new__' method
            new = _signature_get_user_defined_method(obj, '__new__')
            if new is not None:
                sig = _signature_from_callable(
                    new,
                    follow_wrapper_chains=follow_wrapper_chains,
                    skip_bound_arg=skip_bound_arg,
                    sigcls=sigcls)
            else:
                # Finally, we should have at least __init__ implemented
                init = _signature_get_user_defined_method(obj, '__init__')
                if init is not None:
                    sig = _signature_from_callable(
                        init,
                        follow_wrapper_chains=follow_wrapper_chains,
                        skip_bound_arg=skip_bound_arg,
                        sigcls=sigcls)

        if sig is None:
            # At this point we know, that `obj` is a class, with no user-
            # defined '__init__', '__new__', or class-level '__call__'

            for base in obj.__mro__[:-1]:
                # Since '__text_signature__' is implemented as a
                # descriptor that extracts text signature from the
                # class docstring, if 'obj' is derived from a builtin
                # class, its own '__text_signature__' may be 'None'.
                # Therefore, we go through the MRO (except the last
                # class in there, which is 'object') to find the first
                # class with non-empty text signature.
                try:
                    text_sig = base.__text_signature__
                except AttributeError:
                    pass
                else:
                    if text_sig:
                        # If 'obj' class has a __text_signature__ attribute:
                        # return a signature based on it
                        return _signature_fromstr(sigcls, obj, text_sig)

            # No '__text_signature__' was found for the 'obj' class.
            # Last option is to check if its '__init__' is
            # object.__init__ or type.__init__.
            if type not in obj.__mro__:
                # We have a class (not metaclass), but no user-defined
                # __init__ or __new__ for it
                if (obj.__init__ is object.__init__ and
                    obj.__new__ is object.__new__):
                    # Return a signature of 'object' builtin.
                    return sigcls.from_callable(object)
                else:
                    raise ValueError(
                        'no signature found for builtin type {!r}'.format(obj))

    elif not isinstance(obj, _NonUserDefinedCallables):
        # An object with __call__
        # We also check that the 'obj' is not an instance of
        # _WrapperDescriptor or _MethodWrapper to avoid
        # infinite recursion (and even potential segfault)
        call = _signature_get_user_defined_method(type(obj), '__call__')
        if call is not None:
            try:
                sig = _signature_from_callable(
                    call,
                    follow_wrapper_chains=follow_wrapper_chains,
                    skip_bound_arg=skip_bound_arg,
                    sigcls=sigcls)
            except ValueError as ex:
                msg = 'no signature found for {!r}'.format(obj)
                raise ValueError(msg) from ex

    if sig is not None:
        # For classes and objects we skip the first parameter of their
        # __call__, __new__, or __init__ methods
        if skip_bound_arg:
            return _signature_bound_method(sig)
        else:
            return sig

    if isinstance(obj, types.BuiltinFunctionType):
        # Raise a nicer error message for builtins
        msg = 'no signature found for builtin function {!r}'.format(obj)
        raise ValueError(msg)

    raise ValueError('callable {!r} is not supported by signature'.format(obj))


class _void:
    """A private marker - used in Parameter & Signature."""


class _empty:
    """Marker object for Signature.empty and Parameter.empty."""


class _ParameterKind(enum.IntEnum):
    POSITIONAL_ONLY = 0
    POSITIONAL_OR_KEYWORD = 1
    VAR_POSITIONAL = 2
    KEYWORD_ONLY = 3
    VAR_KEYWORD = 4

    def __str__(self):
        return self._name_

    @property
    def description(self):
        return _PARAM_NAME_MAPPING[self]

_POSITIONAL_ONLY         = _ParameterKind.POSITIONAL_ONLY
_POSITIONAL_OR_KEYWORD   = _ParameterKind.POSITIONAL_OR_KEYWORD
_VAR_POSITIONAL          = _ParameterKind.VAR_POSITIONAL
_KEYWORD_ONLY            = _ParameterKind.KEYWORD_ONLY
_VAR_KEYWORD             = _ParameterKind.VAR_KEYWORD

_PARAM_NAME_MAPPING = {
    _POSITIONAL_ONLY: 'positional-only',
    _POSITIONAL_OR_KEYWORD: 'positional or keyword',
    _VAR_POSITIONAL: 'variadic positional',
    _KEYWORD_ONLY: 'keyword-only',
    _VAR_KEYWORD: 'variadic keyword'
}


class Parameter:
    """Represents a parameter in a function signature.

    Has the following public attributes:

    * name : str
        The name of the parameter as a string.
    * default : object
        The default value for the parameter if specified.  If the
        parameter has no default value, this attribute is set to
        `Parameter.empty`.
    * annotation
        The annotation for the parameter if specified.  If the
        parameter has no annotation, this attribute is set to
        `Parameter.empty`.
    * kind : str
        Describes how argument values are bound to the parameter.
        Possible values: `Parameter.POSITIONAL_ONLY`,
        `Parameter.POSITIONAL_OR_KEYWORD`, `Parameter.VAR_POSITIONAL`,
        `Parameter.KEYWORD_ONLY`, `Parameter.VAR_KEYWORD`.
    """

    __slots__ = ('_name', '_kind', '_default', '_annotation')

    POSITIONAL_ONLY         = _POSITIONAL_ONLY
    POSITIONAL_OR_KEYWORD   = _POSITIONAL_OR_KEYWORD
    VAR_POSITIONAL          = _VAR_POSITIONAL
    KEYWORD_ONLY            = _KEYWORD_ONLY
    VAR_KEYWORD             = _VAR_KEYWORD

    empty = _empty

    def __init__(self, name, kind, *, default=_empty, annotation=_empty):
        try:
            self._kind = _ParameterKind(kind)
        except ValueError:
            raise ValueError(f'value {kind!r} is not a valid Parameter.kind')
        if default is not _empty:
            if self._kind in (_VAR_POSITIONAL, _VAR_KEYWORD):
                msg = '{} parameters cannot have default values'
                msg = msg.format(self._kind.description)
                raise ValueError(msg)
        self._default = default
        self._annotation = annotation

        if name is _empty:
            raise ValueError('name is a required attribute for Parameter')

        if not isinstance(name, str):
            msg = 'name must be a str, not a {}'.format(type(name).__name__)
            raise TypeError(msg)

        if name[0] == '.' and name[1:].isdigit():
            # These are implicit arguments generated by comprehensions. In
            # order to provide a friendlier interface to users, we recast
            # their name as "implicitN" and treat them as positional-only.
            # See issue 19611.
            if self._kind != _POSITIONAL_OR_KEYWORD:
                msg = (
                    'implicit arguments must be passed as '
                    'positional or keyword arguments, not {}'
                )
                msg = msg.format(self._kind.description)
                raise ValueError(msg)
            self._kind = _POSITIONAL_ONLY
            name = 'implicit{}'.format(name[1:])

        if not name.isidentifier():
            raise ValueError('{!r} is not a valid parameter name'.format(name))

        self._name = name

    def __reduce__(self):
        return (type(self),
                (self._name, self._kind),
                {'_default': self._default,
                 '_annotation': self._annotation})

    def __setstate__(self, state):
        self._default = state['_default']
        self._annotation = state['_annotation']

    @property
    def name(self):
        return self._name

    @property
    def default(self):
        return self._default

    @property
    def annotation(self):
        return self._annotation

    @property
    def kind(self):
        return self._kind

    def replace(self, *, name=_void, kind=_void,
                annotation=_void, default=_void):
        """Creates a customized copy of the Parameter."""

        if name is _void:
            name = self._name

        if kind is _void:
            kind = self._kind

        if annotation is _void:
            annotation = self._annotation

        if default is _void:
            default = self._default

        return type(self)(name, kind, default=default, annotation=annotation)

    def __str__(self):
        kind = self.kind
        formatted = self._name

        # Add annotation and default value
        if self._annotation is not _empty:
            formatted = '{}: {}'.format(formatted,
                                       formatannotation(self._annotation))

        if self._default is not _empty:
            if self._annotation is not _empty:
                formatted = '{} = {}'.format(formatted, repr(self._default))
            else:
                formatted = '{}={}'.format(formatted, repr(self._default))

        if kind == _VAR_POSITIONAL:
            formatted = '*' + formatted
        elif kind == _VAR_KEYWORD:
            formatted = '**' + formatted

        return formatted

    def __repr__(self):
        return '<{} "{}">'.format(self.__class__.__name__, self)

    def __hash__(self):
        return hash((self.name, self.kind, self.annotation, self.default))

    def __eq__(self, other):
        if self is other:
            return True
        if not isinstance(other, Parameter):
            return NotImplemented
        return (self._name == other._name and
                self._kind == other._kind and
                self._default == other._default and
                self._annotation == other._annotation)


class BoundArguments:
    """Result of `Signature.bind` call.  Holds the mapping of arguments
    to the function's parameters.

    Has the following public attributes:

    * arguments : OrderedDict
        An ordered mutable mapping of parameters' names to arguments' values.
        Does not contain arguments' default values.
    * signature : Signature
        The Signature object that created this instance.
    * args : tuple
        Tuple of positional arguments values.
    * kwargs : dict
        Dict of keyword arguments values.
    """

    __slots__ = ('arguments', '_signature', '__weakref__')

    def __init__(self, signature, arguments):
        self.arguments = arguments
        self._signature = signature

    @property
    def signature(self):
        return self._signature

    @property
    def args(self):
        args = []
        for param_name, param in self._signature.parameters.items():
            if param.kind in (_VAR_KEYWORD, _KEYWORD_ONLY):
                break

            try:
                arg = self.arguments[param_name]
            except KeyError:
                # We're done here. Other arguments
                # will be mapped in 'BoundArguments.kwargs'
                break
            else:
                if param.kind == _VAR_POSITIONAL:
                    # *args
                    args.extend(arg)
                else:
                    # plain argument
                    args.append(arg)

        return tuple(args)

    @property
    def kwargs(self):
        kwargs = {}
        kwargs_started = False
        for param_name, param in self._signature.parameters.items():
            if not kwargs_started:
                if param.kind in (_VAR_KEYWORD, _KEYWORD_ONLY):
                    kwargs_started = True
                else:
                    if param_name not in self.arguments:
                        kwargs_started = True
                        continue

            if not kwargs_started:
                continue

            try:
                arg = self.arguments[param_name]
            except KeyError:
                pass
            else:
                if param.kind == _VAR_KEYWORD:
                    # **kwargs
                    kwargs.update(arg)
                else:
                    # plain keyword argument
                    kwargs[param_name] = arg

        return kwargs

    def apply_defaults(self):
        """Set default values for missing arguments.

        For variable-positional arguments (*args) the default is an
        empty tuple.

        For variable-keyword arguments (**kwargs) the default is an
        empty dict.
        """
        arguments = self.arguments
        new_arguments = []
        for name, param in self._signature.parameters.items():
            try:
                new_arguments.append((name, arguments[name]))
            except KeyError:
                if param.default is not _empty:
                    val = param.default
                elif param.kind is _VAR_POSITIONAL:
                    val = ()
                elif param.kind is _VAR_KEYWORD:
                    val = {}
                else:
                    # This BoundArguments was likely produced by
                    # Signature.bind_partial().
                    continue
                new_arguments.append((name, val))
        self.arguments = OrderedDict(new_arguments)

    def __eq__(self, other):
        if self is other:
            return True
        if not isinstance(other, BoundArguments):
            return NotImplemented
        return (self.signature == other.signature and
                self.arguments == other.arguments)

    def __setstate__(self, state):
        self._signature = state['_signature']
        self.arguments = state['arguments']

    def __getstate__(self):
        return {'_signature': self._signature, 'arguments': self.arguments}

    def __repr__(self):
        args = []
        for arg, value in self.arguments.items():
            args.append('{}={!r}'.format(arg, value))
        return '<{} ({})>'.format(self.__class__.__name__, ', '.join(args))


class Signature:
    """A Signature object represents the overall signature of a function.
    It stores a Parameter object for each parameter accepted by the
    function, as well as information specific to the function itself.

    A Signature object has the following public attributes and methods:

    * parameters : OrderedDict
        An ordered mapping of parameters' names to the corresponding
        Parameter objects (keyword-only arguments are in the same order
        as listed in `code.co_varnames`).
    * return_annotation : object
        The annotation for the return type of the function if specified.
        If the function has no annotation for its return type, this
        attribute is set to `Signature.empty`.
    * bind(*args, **kwargs) -> BoundArguments
        Creates a mapping from positional and keyword arguments to
        parameters.
    * bind_partial(*args, **kwargs) -> BoundArguments
        Creates a partial mapping from positional and keyword arguments
        to parameters (simulating 'functools.partial' behavior.)
    """

    __slots__ = ('_return_annotation', '_parameters')

    _parameter_cls = Parameter
    _bound_arguments_cls = BoundArguments

    empty = _empty

    def __init__(self, parameters=None, *, return_annotation=_empty,
                 __validate_parameters__=True):
        """Constructs Signature from the given list of Parameter
        objects and 'return_annotation'.  All arguments are optional.
        """

        if parameters is None:
            params = OrderedDict()
        else:
            if __validate_parameters__:
                params = OrderedDict()
                top_kind = _POSITIONAL_ONLY
                kind_defaults = False

                for idx, param in enumerate(parameters):
                    kind = param.kind
                    name = param.name

                    if kind < top_kind:
                        msg = (
                            'wrong parameter order: {} parameter before {} '
                            'parameter'
                        )
                        msg = msg.format(top_kind.description,
                                         kind.description)
                        raise ValueError(msg)
                    elif kind > top_kind:
                        kind_defaults = False
                        top_kind = kind

                    if kind in (_POSITIONAL_ONLY, _POSITIONAL_OR_KEYWORD):
                        if param.default is _empty:
                            if kind_defaults:
                                # No default for this parameter, but the
                                # previous parameter of the same kind had
                                # a default
                                msg = 'non-default argument follows default ' \
                                      'argument'
                                raise ValueError(msg)
                        else:
                            # There is a default for this parameter.
                            kind_defaults = True

                    if name in params:
                        msg = 'duplicate parameter name: {!r}'.format(name)
                        raise ValueError(msg)

                    params[name] = param
            else:
                params = OrderedDict(((param.name, param)
                                                for param in parameters))

        self._parameters = types.MappingProxyType(params)
        self._return_annotation = return_annotation

    @classmethod
    def from_function(cls, func):
        """Constructs Signature for the given python function.

        Deprecated since Python 3.5, use `Signature.from_callable()`.
        """

        warnings.warn("inspect.Signature.from_function() is deprecated since "
                      "Python 3.5, use Signature.from_callable()",
                      DeprecationWarning, stacklevel=2)
        return _signature_from_function(cls, func)

    @classmethod
    def from_builtin(cls, func):
        """Constructs Signature for the given builtin function.

        Deprecated since Python 3.5, use `Signature.from_callable()`.
        """

        warnings.warn("inspect.Signature.from_builtin() is deprecated since "
                      "Python 3.5, use Signature.from_callable()",
                      DeprecationWarning, stacklevel=2)
        return _signature_from_builtin(cls, func)

    @classmethod
    def from_callable(cls, obj, *, follow_wrapped=True):
        """Constructs Signature for the given callable object."""
        return _signature_from_callable(obj, sigcls=cls,
                                        follow_wrapper_chains=follow_wrapped)

    @property
    def parameters(self):
        return self._parameters

    @property
    def return_annotation(self):
        return self._return_annotation

    def replace(self, *, parameters=_void, return_annotation=_void):
        """Creates a customized copy of the Signature.
        Pass 'parameters' and/or 'return_annotation' arguments
        to override them in the new copy.
        """

        if parameters is _void:
            parameters = self.parameters.values()

        if return_annotation is _void:
            return_annotation = self._return_annotation

        return type(self)(parameters,
                          return_annotation=return_annotation)

    def _hash_basis(self):
        params = tuple(param for param in self.parameters.values()
                             if param.kind != _KEYWORD_ONLY)

        kwo_params = {param.name: param for param in self.parameters.values()
                                        if param.kind == _KEYWORD_ONLY}

        return params, kwo_params, self.return_annotation

    def __hash__(self):
        params, kwo_params, return_annotation = self._hash_basis()
        kwo_params = frozenset(kwo_params.values())
        return hash((params, kwo_params, return_annotation))

    def __eq__(self, other):
        if self is other:
            return True
        if not isinstance(other, Signature):
            return NotImplemented
        return self._hash_basis() == other._hash_basis()

    def _bind(self, args, kwargs, *, partial=False):
        """Private method. Don't use directly."""

        arguments = OrderedDict()

        parameters = iter(self.parameters.values())
        parameters_ex = ()
        arg_vals = iter(args)

        while True:
            # Let's iterate through the positional arguments and corresponding
            # parameters
            try:
                arg_val = next(arg_vals)
            except StopIteration:
                # No more positional arguments
                try:
                    param = next(parameters)
                except StopIteration:
                    # No more parameters. That's it. Just need to check that
                    # we have no `kwargs` after this while loop
                    break
                else:
                    if param.kind == _VAR_POSITIONAL:
                        # That's OK, just empty *args.  Let's start parsing
                        # kwargs
                        break
                    elif param.name in kwargs:
                        if param.kind == _POSITIONAL_ONLY:
                            msg = '{arg!r} parameter is positional only, ' \
                                  'but was passed as a keyword'
                            msg = msg.format(arg=param.name)
                            raise TypeError(msg) from None
                        parameters_ex = (param,)
                        break
                    elif (param.kind == _VAR_KEYWORD or
                                                param.default is not _empty):
                        # That's fine too - we have a default value for this
                        # parameter.  So, lets start parsing `kwargs`, starting
                        # with the current parameter
                        parameters_ex = (param,)
                        break
                    else:
                        # No default, not VAR_KEYWORD, not VAR_POSITIONAL,
                        # not in `kwargs`
                        if partial:
                            parameters_ex = (param,)
                            break
                        else:
                            msg = 'missing a required argument: {arg!r}'
                            msg = msg.format(arg=param.name)
                            raise TypeError(msg) from None
            else:
                # We have a positional argument to process
                try:
                    param = next(parameters)
                except StopIteration:
                    raise TypeError('too many positional arguments') from None
                else:
                    if param.kind in (_VAR_KEYWORD, _KEYWORD_ONLY):
                        # Looks like we have no parameter for this positional
                        # argument
                        raise TypeError(
                            'too many positional arguments') from None

                    if param.kind == _VAR_POSITIONAL:
                        # We have an '*args'-like argument, let's fill it with
                        # all positional arguments we have left and move on to
                        # the next phase
                        values = [arg_val]
                        values.extend(arg_vals)
                        arguments[param.name] = tuple(values)
                        break

                    if param.name in kwargs and param.kind != _POSITIONAL_ONLY:
                        raise TypeError(
                            'multiple values for argument {arg!r}'.format(
                                arg=param.name)) from None

                    arguments[param.name] = arg_val

        # Now, we iterate through the remaining parameters to process
        # keyword arguments
        kwargs_param = None
        for param in itertools.chain(parameters_ex, parameters):
            if param.kind == _VAR_KEYWORD:
                # Memorize that we have a '**kwargs'-like parameter
                kwargs_param = param
                continue

            if param.kind == _VAR_POSITIONAL:
                # Named arguments don't refer to '*args'-like parameters.
                # We only arrive here if the positional arguments ended
                # before reaching the last parameter before *args.
                continue

            param_name = param.name
            try:
                arg_val = kwargs.pop(param_name)
            except KeyError:
                # We have no value for this parameter.  It's fine though,
                # if it has a default value, or it is an '*args'-like
                # parameter, left alone by the processing of positional
                # arguments.
                if (not partial and param.kind != _VAR_POSITIONAL and
                                                    param.default is _empty):
                    raise TypeError('missing a required argument: {arg!r}'. \
                                    format(arg=param_name)) from None

            else:
                if param.kind == _POSITIONAL_ONLY:
                    # This should never happen in case of a properly built
                    # Signature object (but let's have this check here
                    # to ensure correct behaviour just in case)
                    raise TypeError('{arg!r} parameter is positional only, '
                                    'but was passed as a keyword'. \
                                    format(arg=param.name))

                arguments[param_name] = arg_val

        if kwargs:
            if kwargs_param is not None:
                # Process our '**kwargs'-like parameter
                arguments[kwargs_param.name] = kwargs
            else:
                raise TypeError(
                    'got an unexpected keyword argument {arg!r}'.format(
                        arg=next(iter(kwargs))))

        return self._bound_arguments_cls(self, arguments)

    def bind(self, /, *args, **kwargs):
        """Get a BoundArguments object, that maps the passed `args`
        and `kwargs` to the function's signature.  Raises `TypeError`
        if the passed arguments can not be bound.
        """
        return self._bind(args, kwargs)

    def bind_partial(self, /, *args, **kwargs):
        """Get a BoundArguments object, that partially maps the
        passed `args` and `kwargs` to the function's signature.
        Raises `TypeError` if the passed arguments can not be bound.
        """
        return self._bind(args, kwargs, partial=True)

    def __reduce__(self):
        return (type(self),
                (tuple(self._parameters.values()),),
                {'_return_annotation': self._return_annotation})

    def __setstate__(self, state):
        self._return_annotation = state['_return_annotation']

    def __repr__(self):
        return '<{} {}>'.format(self.__class__.__name__, self)

    def __str__(self):
        result = []
        render_pos_only_separator = False
        render_kw_only_separator = True
        for param in self.parameters.values():
            formatted = str(param)

            kind = param.kind

            if kind == _POSITIONAL_ONLY:
                render_pos_only_separator = True
            elif render_pos_only_separator:
                # It's not a positional-only parameter, and the flag
                # is set to 'True' (there were pos-only params before.)
                result.append('/')
                render_pos_only_separator = False

            if kind == _VAR_POSITIONAL:
                # OK, we have an '*args'-like parameter, so we won't need
                # a '*' to separate keyword-only arguments
                render_kw_only_separator = False
            elif kind == _KEYWORD_ONLY and render_kw_only_separator:
                # We have a keyword-only parameter to render and we haven't
                # rendered an '*args'-like parameter before, so add a '*'
                # separator to the parameters list ("foo(arg1, *, arg2)" case)
                result.append('*')
                # This condition should be only triggered once, so
                # reset the flag
                render_kw_only_separator = False

            result.append(formatted)

        if render_pos_only_separator:
            # There were only positional-only parameters, hence the
            # flag was not reset to 'False'
            result.append('/')

        rendered = '({})'.format(', '.join(result))

        if self.return_annotation is not _empty:
            anno = formatannotation(self.return_annotation)
            rendered += ' -> {}'.format(anno)

        return rendered


def signature(obj, *, follow_wrapped=True):
    """Get a signature object for the passed callable."""
    return Signature.from_callable(obj, follow_wrapped=follow_wrapped)


def _main():
    """ Logic for inspecting an object given at command line """
    import argparse
    import importlib

    parser = argparse.ArgumentParser()
    parser.add_argument(
        'object',
         help="The object to be analysed. "
              "It supports the 'module:qualname' syntax")
    parser.add_argument(
        '-d', '--details', action='store_true',
        help='Display info about the module rather than its source code')

    args = parser.parse_args()

    target = args.object
    mod_name, has_attrs, attrs = target.partition(":")
    try:
        obj = module = importlib.import_module(mod_name)
    except Exception as exc:
        msg = "Failed to import {} ({}: {})".format(mod_name,
                                                    type(exc).__name__,
                                                    exc)
        print(msg, file=sys.stderr)
        sys.exit(2)

    if has_attrs:
        parts = attrs.split(".")
        obj = module
        for part in parts:
            obj = getattr(obj, part)

    if module.__name__ in sys.builtin_module_names:
        print("Can't get info for builtin modules.", file=sys.stderr)
        sys.exit(1)

    if args.details:
        print('Target: {}'.format(target))
        print('Origin: {}'.format(getsourcefile(module)))
        print('Cached: {}'.format(module.__cached__))
        if obj is module:
            print('Loader: {}'.format(repr(module.__loader__)))
            if hasattr(module, '__path__'):
                print('Submodule search path: {}'.format(module.__path__))
        else:
            try:
                __, lineno = findsource(obj)
            except Exception:
                pass
            else:
                print('Line: {}'.format(lineno))

        print('\n')
    else:
        print(getsource(obj))


if __name__ == "__main__":
    _main()
hashlib.py000064400000020215151153537440006540 0ustar00#.  Copyright (C) 2005-2010   Gregory P. Smith (greg@krypto.org)
#  Licensed to PSF under a Contributor Agreement.
#

__doc__ = """hashlib module - A common interface to many hash functions.

new(name, data=b'', **kwargs) - returns a new hash object implementing the
                                given hash function; initializing the hash
                                using the given binary data.

Named constructor functions are also available, these are faster
than using new(name):

md5(), sha1(), sha224(), sha256(), sha384(), sha512(), blake2b(), blake2s(),
sha3_224, sha3_256, sha3_384, sha3_512, shake_128, and shake_256.

More algorithms may be available on your platform but the above are guaranteed
to exist.  See the algorithms_guaranteed and algorithms_available attributes
to find out what algorithm names can be passed to new().

NOTE: If you want the adler32 or crc32 hash functions they are available in
the zlib module.

Choose your hash function wisely.  Some have known collision weaknesses.
sha384 and sha512 will be slow on 32 bit platforms.

Hash objects have these methods:
 - update(data): Update the hash object with the bytes in data. Repeated calls
                 are equivalent to a single call with the concatenation of all
                 the arguments.
 - digest():     Return the digest of the bytes passed to the update() method
                 so far as a bytes object.
 - hexdigest():  Like digest() except the digest is returned as a string
                 of double length, containing only hexadecimal digits.
 - copy():       Return a copy (clone) of the hash object. This can be used to
                 efficiently compute the digests of datas that share a common
                 initial substring.

For example, to obtain the digest of the byte string 'Nobody inspects the
spammish repetition':

    >>> import hashlib
    >>> m = hashlib.md5()
    >>> m.update(b"Nobody inspects")
    >>> m.update(b" the spammish repetition")
    >>> m.digest()
    b'\\xbbd\\x9c\\x83\\xdd\\x1e\\xa5\\xc9\\xd9\\xde\\xc9\\xa1\\x8d\\xf0\\xff\\xe9'

More condensed:

    >>> hashlib.sha224(b"Nobody inspects the spammish repetition").hexdigest()
    'a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2'

"""

# This tuple and __get_builtin_constructor() must be modified if a new
# always available algorithm is added.
__always_supported = ('md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512',
                      'blake2b', 'blake2s',
                      'sha3_224', 'sha3_256', 'sha3_384', 'sha3_512',
                      'shake_128', 'shake_256')


algorithms_guaranteed = set(__always_supported)
algorithms_available = set(__always_supported)

__all__ = __always_supported + ('new', 'algorithms_guaranteed',
                                'algorithms_available', 'pbkdf2_hmac')



__block_openssl_constructor = {
    'sha3_224', 'sha3_256', 'sha3_384', 'sha3_512',
    'shake_128', 'shake_256',
    'blake2b', 'blake2s',
}

try:
    from _hashlib import get_fips_mode as _hashlib_get_fips_mode
except ImportError:
    def _hashlib_get_fips_mode():
        return 0

if not _hashlib_get_fips_mode():
    __builtin_constructor_cache = {}

    def __get_builtin_constructor(name):
        cache = __builtin_constructor_cache
        constructor = cache.get(name)
        if constructor is not None:
            return constructor
        try:
            if name in {'SHA1', 'sha1'}:
                import _sha1
                cache['SHA1'] = cache['sha1'] = _sha1.sha1
            elif name in {'MD5', 'md5'}:
                import _md5
                cache['MD5'] = cache['md5'] = _md5.md5
            elif name in {'SHA256', 'sha256', 'SHA224', 'sha224'}:
                import _sha256
                cache['SHA224'] = cache['sha224'] = _sha256.sha224
                cache['SHA256'] = cache['sha256'] = _sha256.sha256
            elif name in {'SHA512', 'sha512', 'SHA384', 'sha384'}:
                import _sha512
                cache['SHA384'] = cache['sha384'] = _sha512.sha384
                cache['SHA512'] = cache['sha512'] = _sha512.sha512
            elif name in {'blake2b', 'blake2s'}:
                import _blake2
                cache['blake2b'] = _blake2.blake2b
                cache['blake2s'] = _blake2.blake2s
            elif name in {'sha3_224', 'sha3_256', 'sha3_384', 'sha3_512'}:
                import _sha3
                cache['sha3_224'] = _sha3.sha3_224
                cache['sha3_256'] = _sha3.sha3_256
                cache['sha3_384'] = _sha3.sha3_384
                cache['sha3_512'] = _sha3.sha3_512
            elif name in {'shake_128', 'shake_256'}:
                import _sha3
                cache['shake_128'] = _sha3.shake_128
                cache['shake_256'] = _sha3.shake_256
        except ImportError:
            pass  # no extension module, this hash is unsupported.

        constructor = cache.get(name)
        if constructor is not None:
            return constructor

        raise ValueError('unsupported hash type ' + name)


def __get_openssl_constructor(name):
    if not _hashlib_get_fips_mode():
        if name in __block_openssl_constructor:
            # Prefer our blake2 and sha3 implementation.
            return __get_builtin_constructor(name)
    try:
        f = getattr(_hashlib, 'openssl_' + name)
        # Allow the C module to raise ValueError.  The function will be
        # defined but the hash not actually available thanks to OpenSSL.
        if not _hashlib.get_fips_mode():
            # N.B. In "FIPS mode", there is no fallback.
            # If this test fails, we want to export the broken hash
            # constructor anyway.
            f()
        # Use the C function directly (very fast)
        return f
    except (AttributeError, ValueError):
        return __get_builtin_constructor(name)


if not _hashlib_get_fips_mode():
    def __py_new(name, data=b'', **kwargs):
        """new(name, data=b'', **kwargs) - Return a new hashing object using the
        named algorithm; optionally initialized with data (which must be
        a bytes-like object).
        """
        return __get_builtin_constructor(name)(data, **kwargs)


def __hash_new(name, data=b'', **kwargs):
    """new(name, data=b'') - Return a new hashing object using the named algorithm;
    optionally initialized with data (which must be a bytes-like object).
    """
    if not _hashlib.get_fips_mode():
        if name in __block_openssl_constructor:
            # Prefer our blake2 and sha3 implementation
            # OpenSSL 1.1.0 comes with a limited implementation of blake2b/s.
            # It does neither support keyed blake2 nor advanced features like
            # salt, personal, tree hashing or SSE.
            return __get_builtin_constructor(name)(data, **kwargs)
    try:
        return _hashlib.new(name, data, **kwargs)
    except ValueError:
        # If the _hashlib module (OpenSSL) doesn't support the named
        # hash, try using our builtin implementations.
        # This allows for SHA224/256 and SHA384/512 support even though
        # the OpenSSL library prior to 0.9.8 doesn't provide them.
        if _hashlib.get_fips_mode():
            raise
        return __get_builtin_constructor(name)(data, **kwargs)


try:
    import _hashlib
    new = __hash_new
    __get_hash = __get_openssl_constructor
    algorithms_available = algorithms_available.union(
            _hashlib.openssl_md_meth_names)
except ImportError:
    if _hashlib_get_fips_mode():
        raise
    new = __py_new
    __get_hash = __get_builtin_constructor

# OpenSSL's PKCS5_PBKDF2_HMAC requires OpenSSL 1.0+ with HMAC and SHA
from _hashlib import pbkdf2_hmac

try:
    # OpenSSL's scrypt requires OpenSSL 1.1+
    from _hashlib import scrypt
except ImportError:
    pass


for __func_name in __always_supported:
    # try them all, some may not work due to the OpenSSL
    # version not supporting that algorithm.
    try:
        globals()[__func_name] = __get_hash(__func_name)
    except ValueError:
        import logging
        logging.exception('code for hash %s was not found.', __func_name)


# Cleanup locals()
del __always_supported, __func_name, __get_hash
del __hash_new, __get_openssl_constructor
if not _hashlib.get_fips_mode():
    del __py_new
del _hashlib_get_fips_mode
threading.py000064400000143204151153537440007077 0ustar00"""Thread module emulating a subset of Java's threading model."""

import os as _os
import sys as _sys
import _thread

from time import monotonic as _time
from _weakrefset import WeakSet
from itertools import islice as _islice, count as _count
try:
    from _collections import deque as _deque
except ImportError:
    from collections import deque as _deque

# Note regarding PEP 8 compliant names
#  This threading model was originally inspired by Java, and inherited
# the convention of camelCase function and method names from that
# language. Those original names are not in any imminent danger of
# being deprecated (even for Py3k),so this module provides them as an
# alias for the PEP 8 compliant names
# Note that using the new PEP 8 compliant names facilitates substitution
# with the multiprocessing module, which doesn't provide the old
# Java inspired names.

__all__ = ['get_ident', 'active_count', 'Condition', 'current_thread',
           'enumerate', 'main_thread', 'TIMEOUT_MAX',
           'Event', 'Lock', 'RLock', 'Semaphore', 'BoundedSemaphore', 'Thread',
           'Barrier', 'BrokenBarrierError', 'Timer', 'ThreadError',
           'setprofile', 'settrace', 'local', 'stack_size',
           'excepthook', 'ExceptHookArgs']

# Rename some stuff so "from threading import *" is safe
_start_new_thread = _thread.start_new_thread
_allocate_lock = _thread.allocate_lock
_set_sentinel = _thread._set_sentinel
get_ident = _thread.get_ident
try:
    get_native_id = _thread.get_native_id
    _HAVE_THREAD_NATIVE_ID = True
    __all__.append('get_native_id')
except AttributeError:
    _HAVE_THREAD_NATIVE_ID = False
ThreadError = _thread.error
try:
    _CRLock = _thread.RLock
except AttributeError:
    _CRLock = None
TIMEOUT_MAX = _thread.TIMEOUT_MAX
del _thread


# Support for profile and trace hooks

_profile_hook = None
_trace_hook = None

def setprofile(func):
    """Set a profile function for all threads started from the threading module.

    The func will be passed to sys.setprofile() for each thread, before its
    run() method is called.

    """
    global _profile_hook
    _profile_hook = func

def settrace(func):
    """Set a trace function for all threads started from the threading module.

    The func will be passed to sys.settrace() for each thread, before its run()
    method is called.

    """
    global _trace_hook
    _trace_hook = func

# Synchronization classes

Lock = _allocate_lock

def RLock(*args, **kwargs):
    """Factory function that returns a new reentrant lock.

    A reentrant lock must be released by the thread that acquired it. Once a
    thread has acquired a reentrant lock, the same thread may acquire it again
    without blocking; the thread must release it once for each time it has
    acquired it.

    """
    if _CRLock is None:
        return _PyRLock(*args, **kwargs)
    return _CRLock(*args, **kwargs)

class _RLock:
    """This class implements reentrant lock objects.

    A reentrant lock must be released by the thread that acquired it. Once a
    thread has acquired a reentrant lock, the same thread may acquire it
    again without blocking; the thread must release it once for each time it
    has acquired it.

    """

    def __init__(self):
        self._block = _allocate_lock()
        self._owner = None
        self._count = 0

    def __repr__(self):
        owner = self._owner
        try:
            owner = _active[owner].name
        except KeyError:
            pass
        return "<%s %s.%s object owner=%r count=%d at %s>" % (
            "locked" if self._block.locked() else "unlocked",
            self.__class__.__module__,
            self.__class__.__qualname__,
            owner,
            self._count,
            hex(id(self))
        )

    def acquire(self, blocking=True, timeout=-1):
        """Acquire a lock, blocking or non-blocking.

        When invoked without arguments: if this thread already owns the lock,
        increment the recursion level by one, and return immediately. Otherwise,
        if another thread owns the lock, block until the lock is unlocked. Once
        the lock is unlocked (not owned by any thread), then grab ownership, set
        the recursion level to one, and return. If more than one thread is
        blocked waiting until the lock is unlocked, only one at a time will be
        able to grab ownership of the lock. There is no return value in this
        case.

        When invoked with the blocking argument set to true, do the same thing
        as when called without arguments, and return true.

        When invoked with the blocking argument set to false, do not block. If a
        call without an argument would block, return false immediately;
        otherwise, do the same thing as when called without arguments, and
        return true.

        When invoked with the floating-point timeout argument set to a positive
        value, block for at most the number of seconds specified by timeout
        and as long as the lock cannot be acquired.  Return true if the lock has
        been acquired, false if the timeout has elapsed.

        """
        me = get_ident()
        if self._owner == me:
            self._count += 1
            return 1
        rc = self._block.acquire(blocking, timeout)
        if rc:
            self._owner = me
            self._count = 1
        return rc

    __enter__ = acquire

    def release(self):
        """Release a lock, decrementing the recursion level.

        If after the decrement it is zero, reset the lock to unlocked (not owned
        by any thread), and if any other threads are blocked waiting for the
        lock to become unlocked, allow exactly one of them to proceed. If after
        the decrement the recursion level is still nonzero, the lock remains
        locked and owned by the calling thread.

        Only call this method when the calling thread owns the lock. A
        RuntimeError is raised if this method is called when the lock is
        unlocked.

        There is no return value.

        """
        if self._owner != get_ident():
            raise RuntimeError("cannot release un-acquired lock")
        self._count = count = self._count - 1
        if not count:
            self._owner = None
            self._block.release()

    def __exit__(self, t, v, tb):
        self.release()

    # Internal methods used by condition variables

    def _acquire_restore(self, state):
        self._block.acquire()
        self._count, self._owner = state

    def _release_save(self):
        if self._count == 0:
            raise RuntimeError("cannot release un-acquired lock")
        count = self._count
        self._count = 0
        owner = self._owner
        self._owner = None
        self._block.release()
        return (count, owner)

    def _is_owned(self):
        return self._owner == get_ident()

_PyRLock = _RLock


class Condition:
    """Class that implements a condition variable.

    A condition variable allows one or more threads to wait until they are
    notified by another thread.

    If the lock argument is given and not None, it must be a Lock or RLock
    object, and it is used as the underlying lock. Otherwise, a new RLock object
    is created and used as the underlying lock.

    """

    def __init__(self, lock=None):
        if lock is None:
            lock = RLock()
        self._lock = lock
        # Export the lock's acquire() and release() methods
        self.acquire = lock.acquire
        self.release = lock.release
        # If the lock defines _release_save() and/or _acquire_restore(),
        # these override the default implementations (which just call
        # release() and acquire() on the lock).  Ditto for _is_owned().
        try:
            self._release_save = lock._release_save
        except AttributeError:
            pass
        try:
            self._acquire_restore = lock._acquire_restore
        except AttributeError:
            pass
        try:
            self._is_owned = lock._is_owned
        except AttributeError:
            pass
        self._waiters = _deque()

    def __enter__(self):
        return self._lock.__enter__()

    def __exit__(self, *args):
        return self._lock.__exit__(*args)

    def __repr__(self):
        return "<Condition(%s, %d)>" % (self._lock, len(self._waiters))

    def _release_save(self):
        self._lock.release()           # No state to save

    def _acquire_restore(self, x):
        self._lock.acquire()           # Ignore saved state

    def _is_owned(self):
        # Return True if lock is owned by current_thread.
        # This method is called only if _lock doesn't have _is_owned().
        if self._lock.acquire(0):
            self._lock.release()
            return False
        else:
            return True

    def wait(self, timeout=None):
        """Wait until notified or until a timeout occurs.

        If the calling thread has not acquired the lock when this method is
        called, a RuntimeError is raised.

        This method releases the underlying lock, and then blocks until it is
        awakened by a notify() or notify_all() call for the same condition
        variable in another thread, or until the optional timeout occurs. Once
        awakened or timed out, it re-acquires the lock and returns.

        When the timeout argument is present and not None, it should be a
        floating point number specifying a timeout for the operation in seconds
        (or fractions thereof).

        When the underlying lock is an RLock, it is not released using its
        release() method, since this may not actually unlock the lock when it
        was acquired multiple times recursively. Instead, an internal interface
        of the RLock class is used, which really unlocks it even when it has
        been recursively acquired several times. Another internal interface is
        then used to restore the recursion level when the lock is reacquired.

        """
        if not self._is_owned():
            raise RuntimeError("cannot wait on un-acquired lock")
        waiter = _allocate_lock()
        waiter.acquire()
        self._waiters.append(waiter)
        saved_state = self._release_save()
        gotit = False
        try:    # restore state no matter what (e.g., KeyboardInterrupt)
            if timeout is None:
                waiter.acquire()
                gotit = True
            else:
                if timeout > 0:
                    gotit = waiter.acquire(True, timeout)
                else:
                    gotit = waiter.acquire(False)
            return gotit
        finally:
            self._acquire_restore(saved_state)
            if not gotit:
                try:
                    self._waiters.remove(waiter)
                except ValueError:
                    pass

    def wait_for(self, predicate, timeout=None):
        """Wait until a condition evaluates to True.

        predicate should be a callable which result will be interpreted as a
        boolean value.  A timeout may be provided giving the maximum time to
        wait.

        """
        endtime = None
        waittime = timeout
        result = predicate()
        while not result:
            if waittime is not None:
                if endtime is None:
                    endtime = _time() + waittime
                else:
                    waittime = endtime - _time()
                    if waittime <= 0:
                        break
            self.wait(waittime)
            result = predicate()
        return result

    def notify(self, n=1):
        """Wake up one or more threads waiting on this condition, if any.

        If the calling thread has not acquired the lock when this method is
        called, a RuntimeError is raised.

        This method wakes up at most n of the threads waiting for the condition
        variable; it is a no-op if no threads are waiting.

        """
        if not self._is_owned():
            raise RuntimeError("cannot notify on un-acquired lock")
        all_waiters = self._waiters
        waiters_to_notify = _deque(_islice(all_waiters, n))
        if not waiters_to_notify:
            return
        for waiter in waiters_to_notify:
            waiter.release()
            try:
                all_waiters.remove(waiter)
            except ValueError:
                pass

    def notify_all(self):
        """Wake up all threads waiting on this condition.

        If the calling thread has not acquired the lock when this method
        is called, a RuntimeError is raised.

        """
        self.notify(len(self._waiters))

    notifyAll = notify_all


class Semaphore:
    """This class implements semaphore objects.

    Semaphores manage a counter representing the number of release() calls minus
    the number of acquire() calls, plus an initial value. The acquire() method
    blocks if necessary until it can return without making the counter
    negative. If not given, value defaults to 1.

    """

    # After Tim Peters' semaphore class, but not quite the same (no maximum)

    def __init__(self, value=1):
        if value < 0:
            raise ValueError("semaphore initial value must be >= 0")
        self._cond = Condition(Lock())
        self._value = value

    def acquire(self, blocking=True, timeout=None):
        """Acquire a semaphore, decrementing the internal counter by one.

        When invoked without arguments: if the internal counter is larger than
        zero on entry, decrement it by one and return immediately. If it is zero
        on entry, block, waiting until some other thread has called release() to
        make it larger than zero. This is done with proper interlocking so that
        if multiple acquire() calls are blocked, release() will wake exactly one
        of them up. The implementation may pick one at random, so the order in
        which blocked threads are awakened should not be relied on. There is no
        return value in this case.

        When invoked with blocking set to true, do the same thing as when called
        without arguments, and return true.

        When invoked with blocking set to false, do not block. If a call without
        an argument would block, return false immediately; otherwise, do the
        same thing as when called without arguments, and return true.

        When invoked with a timeout other than None, it will block for at
        most timeout seconds.  If acquire does not complete successfully in
        that interval, return false.  Return true otherwise.

        """
        if not blocking and timeout is not None:
            raise ValueError("can't specify timeout for non-blocking acquire")
        rc = False
        endtime = None
        with self._cond:
            while self._value == 0:
                if not blocking:
                    break
                if timeout is not None:
                    if endtime is None:
                        endtime = _time() + timeout
                    else:
                        timeout = endtime - _time()
                        if timeout <= 0:
                            break
                self._cond.wait(timeout)
            else:
                self._value -= 1
                rc = True
        return rc

    __enter__ = acquire

    def release(self):
        """Release a semaphore, incrementing the internal counter by one.

        When the counter is zero on entry and another thread is waiting for it
        to become larger than zero again, wake up that thread.

        """
        with self._cond:
            self._value += 1
            self._cond.notify()

    def __exit__(self, t, v, tb):
        self.release()


class BoundedSemaphore(Semaphore):
    """Implements a bounded semaphore.

    A bounded semaphore checks to make sure its current value doesn't exceed its
    initial value. If it does, ValueError is raised. In most situations
    semaphores are used to guard resources with limited capacity.

    If the semaphore is released too many times it's a sign of a bug. If not
    given, value defaults to 1.

    Like regular semaphores, bounded semaphores manage a counter representing
    the number of release() calls minus the number of acquire() calls, plus an
    initial value. The acquire() method blocks if necessary until it can return
    without making the counter negative. If not given, value defaults to 1.

    """

    def __init__(self, value=1):
        Semaphore.__init__(self, value)
        self._initial_value = value

    def release(self):
        """Release a semaphore, incrementing the internal counter by one.

        When the counter is zero on entry and another thread is waiting for it
        to become larger than zero again, wake up that thread.

        If the number of releases exceeds the number of acquires,
        raise a ValueError.

        """
        with self._cond:
            if self._value >= self._initial_value:
                raise ValueError("Semaphore released too many times")
            self._value += 1
            self._cond.notify()


class Event:
    """Class implementing event objects.

    Events manage a flag that can be set to true with the set() method and reset
    to false with the clear() method. The wait() method blocks until the flag is
    true.  The flag is initially false.

    """

    # After Tim Peters' event class (without is_posted())

    def __init__(self):
        self._cond = Condition(Lock())
        self._flag = False

    def _reset_internal_locks(self):
        # private!  called by Thread._reset_internal_locks by _after_fork()
        self._cond.__init__(Lock())

    def is_set(self):
        """Return true if and only if the internal flag is true."""
        return self._flag

    isSet = is_set

    def set(self):
        """Set the internal flag to true.

        All threads waiting for it to become true are awakened. Threads
        that call wait() once the flag is true will not block at all.

        """
        with self._cond:
            self._flag = True
            self._cond.notify_all()

    def clear(self):
        """Reset the internal flag to false.

        Subsequently, threads calling wait() will block until set() is called to
        set the internal flag to true again.

        """
        with self._cond:
            self._flag = False

    def wait(self, timeout=None):
        """Block until the internal flag is true.

        If the internal flag is true on entry, return immediately. Otherwise,
        block until another thread calls set() to set the flag to true, or until
        the optional timeout occurs.

        When the timeout argument is present and not None, it should be a
        floating point number specifying a timeout for the operation in seconds
        (or fractions thereof).

        This method returns the internal flag on exit, so it will always return
        True except if a timeout is given and the operation times out.

        """
        with self._cond:
            signaled = self._flag
            if not signaled:
                signaled = self._cond.wait(timeout)
            return signaled


# A barrier class.  Inspired in part by the pthread_barrier_* api and
# the CyclicBarrier class from Java.  See
# http://sourceware.org/pthreads-win32/manual/pthread_barrier_init.html and
# http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/
#        CyclicBarrier.html
# for information.
# We maintain two main states, 'filling' and 'draining' enabling the barrier
# to be cyclic.  Threads are not allowed into it until it has fully drained
# since the previous cycle.  In addition, a 'resetting' state exists which is
# similar to 'draining' except that threads leave with a BrokenBarrierError,
# and a 'broken' state in which all threads get the exception.
class Barrier:
    """Implements a Barrier.

    Useful for synchronizing a fixed number of threads at known synchronization
    points.  Threads block on 'wait()' and are simultaneously awoken once they
    have all made that call.

    """

    def __init__(self, parties, action=None, timeout=None):
        """Create a barrier, initialised to 'parties' threads.

        'action' is a callable which, when supplied, will be called by one of
        the threads after they have all entered the barrier and just prior to
        releasing them all. If a 'timeout' is provided, it is used as the
        default for all subsequent 'wait()' calls.

        """
        self._cond = Condition(Lock())
        self._action = action
        self._timeout = timeout
        self._parties = parties
        self._state = 0 #0 filling, 1, draining, -1 resetting, -2 broken
        self._count = 0

    def wait(self, timeout=None):
        """Wait for the barrier.

        When the specified number of threads have started waiting, they are all
        simultaneously awoken. If an 'action' was provided for the barrier, one
        of the threads will have executed that callback prior to returning.
        Returns an individual index number from 0 to 'parties-1'.

        """
        if timeout is None:
            timeout = self._timeout
        with self._cond:
            self._enter() # Block while the barrier drains.
            index = self._count
            self._count += 1
            try:
                if index + 1 == self._parties:
                    # We release the barrier
                    self._release()
                else:
                    # We wait until someone releases us
                    self._wait(timeout)
                return index
            finally:
                self._count -= 1
                # Wake up any threads waiting for barrier to drain.
                self._exit()

    # Block until the barrier is ready for us, or raise an exception
    # if it is broken.
    def _enter(self):
        while self._state in (-1, 1):
            # It is draining or resetting, wait until done
            self._cond.wait()
        #see if the barrier is in a broken state
        if self._state < 0:
            raise BrokenBarrierError
        assert self._state == 0

    # Optionally run the 'action' and release the threads waiting
    # in the barrier.
    def _release(self):
        try:
            if self._action:
                self._action()
            # enter draining state
            self._state = 1
            self._cond.notify_all()
        except:
            #an exception during the _action handler.  Break and reraise
            self._break()
            raise

    # Wait in the barrier until we are released.  Raise an exception
    # if the barrier is reset or broken.
    def _wait(self, timeout):
        if not self._cond.wait_for(lambda : self._state != 0, timeout):
            #timed out.  Break the barrier
            self._break()
            raise BrokenBarrierError
        if self._state < 0:
            raise BrokenBarrierError
        assert self._state == 1

    # If we are the last thread to exit the barrier, signal any threads
    # waiting for the barrier to drain.
    def _exit(self):
        if self._count == 0:
            if self._state in (-1, 1):
                #resetting or draining
                self._state = 0
                self._cond.notify_all()

    def reset(self):
        """Reset the barrier to the initial state.

        Any threads currently waiting will get the BrokenBarrier exception
        raised.

        """
        with self._cond:
            if self._count > 0:
                if self._state == 0:
                    #reset the barrier, waking up threads
                    self._state = -1
                elif self._state == -2:
                    #was broken, set it to reset state
                    #which clears when the last thread exits
                    self._state = -1
            else:
                self._state = 0
            self._cond.notify_all()

    def abort(self):
        """Place the barrier into a 'broken' state.

        Useful in case of error.  Any currently waiting threads and threads
        attempting to 'wait()' will have BrokenBarrierError raised.

        """
        with self._cond:
            self._break()

    def _break(self):
        # An internal error was detected.  The barrier is set to
        # a broken state all parties awakened.
        self._state = -2
        self._cond.notify_all()

    @property
    def parties(self):
        """Return the number of threads required to trip the barrier."""
        return self._parties

    @property
    def n_waiting(self):
        """Return the number of threads currently waiting at the barrier."""
        # We don't need synchronization here since this is an ephemeral result
        # anyway.  It returns the correct value in the steady state.
        if self._state == 0:
            return self._count
        return 0

    @property
    def broken(self):
        """Return True if the barrier is in a broken state."""
        return self._state == -2

# exception raised by the Barrier class
class BrokenBarrierError(RuntimeError):
    pass


# Helper to generate new thread names
_counter = _count().__next__
_counter() # Consume 0 so first non-main thread has id 1.
def _newname(template="Thread-%d"):
    return template % _counter()

# Active thread administration
_active_limbo_lock = _allocate_lock()
_active = {}    # maps thread id to Thread object
_limbo = {}
_dangling = WeakSet()
# Set of Thread._tstate_lock locks of non-daemon threads used by _shutdown()
# to wait until all Python thread states get deleted:
# see Thread._set_tstate_lock().
_shutdown_locks_lock = _allocate_lock()
_shutdown_locks = set()

# Main class for threads

class Thread:
    """A class that represents a thread of control.

    This class can be safely subclassed in a limited fashion. There are two ways
    to specify the activity: by passing a callable object to the constructor, or
    by overriding the run() method in a subclass.

    """

    _initialized = False

    def __init__(self, group=None, target=None, name=None,
                 args=(), kwargs=None, *, daemon=None):
        """This constructor should always be called with keyword arguments. Arguments are:

        *group* should be None; reserved for future extension when a ThreadGroup
        class is implemented.

        *target* is the callable object to be invoked by the run()
        method. Defaults to None, meaning nothing is called.

        *name* is the thread name. By default, a unique name is constructed of
        the form "Thread-N" where N is a small decimal number.

        *args* is the argument tuple for the target invocation. Defaults to ().

        *kwargs* is a dictionary of keyword arguments for the target
        invocation. Defaults to {}.

        If a subclass overrides the constructor, it must make sure to invoke
        the base class constructor (Thread.__init__()) before doing anything
        else to the thread.

        """
        assert group is None, "group argument must be None for now"
        if kwargs is None:
            kwargs = {}
        self._target = target
        self._name = str(name or _newname())
        self._args = args
        self._kwargs = kwargs
        if daemon is not None:
            self._daemonic = daemon
        else:
            self._daemonic = current_thread().daemon
        self._ident = None
        if _HAVE_THREAD_NATIVE_ID:
            self._native_id = None
        self._tstate_lock = None
        self._started = Event()
        self._is_stopped = False
        self._initialized = True
        # Copy of sys.stderr used by self._invoke_excepthook()
        self._stderr = _sys.stderr
        self._invoke_excepthook = _make_invoke_excepthook()
        # For debugging and _after_fork()
        _dangling.add(self)

    def _reset_internal_locks(self, is_alive):
        # private!  Called by _after_fork() to reset our internal locks as
        # they may be in an invalid state leading to a deadlock or crash.
        self._started._reset_internal_locks()
        if is_alive:
            self._set_tstate_lock()
        else:
            # The thread isn't alive after fork: it doesn't have a tstate
            # anymore.
            self._is_stopped = True
            self._tstate_lock = None

    def __repr__(self):
        assert self._initialized, "Thread.__init__() was not called"
        status = "initial"
        if self._started.is_set():
            status = "started"
        self.is_alive() # easy way to get ._is_stopped set when appropriate
        if self._is_stopped:
            status = "stopped"
        if self._daemonic:
            status += " daemon"
        if self._ident is not None:
            status += " %s" % self._ident
        return "<%s(%s, %s)>" % (self.__class__.__name__, self._name, status)

    def start(self):
        """Start the thread's activity.

        It must be called at most once per thread object. It arranges for the
        object's run() method to be invoked in a separate thread of control.

        This method will raise a RuntimeError if called more than once on the
        same thread object.

        """
        if not self._initialized:
            raise RuntimeError("thread.__init__() not called")

        if self._started.is_set():
            raise RuntimeError("threads can only be started once")
        with _active_limbo_lock:
            _limbo[self] = self
        try:
            _start_new_thread(self._bootstrap, ())
        except Exception:
            with _active_limbo_lock:
                del _limbo[self]
            raise
        self._started.wait()

    def run(self):
        """Method representing the thread's activity.

        You may override this method in a subclass. The standard run() method
        invokes the callable object passed to the object's constructor as the
        target argument, if any, with sequential and keyword arguments taken
        from the args and kwargs arguments, respectively.

        """
        try:
            if self._target:
                self._target(*self._args, **self._kwargs)
        finally:
            # Avoid a refcycle if the thread is running a function with
            # an argument that has a member that points to the thread.
            del self._target, self._args, self._kwargs

    def _bootstrap(self):
        # Wrapper around the real bootstrap code that ignores
        # exceptions during interpreter cleanup.  Those typically
        # happen when a daemon thread wakes up at an unfortunate
        # moment, finds the world around it destroyed, and raises some
        # random exception *** while trying to report the exception in
        # _bootstrap_inner() below ***.  Those random exceptions
        # don't help anybody, and they confuse users, so we suppress
        # them.  We suppress them only when it appears that the world
        # indeed has already been destroyed, so that exceptions in
        # _bootstrap_inner() during normal business hours are properly
        # reported.  Also, we only suppress them for daemonic threads;
        # if a non-daemonic encounters this, something else is wrong.
        try:
            self._bootstrap_inner()
        except:
            if self._daemonic and _sys is None:
                return
            raise

    def _set_ident(self):
        self._ident = get_ident()

    if _HAVE_THREAD_NATIVE_ID:
        def _set_native_id(self):
            self._native_id = get_native_id()

    def _set_tstate_lock(self):
        """
        Set a lock object which will be released by the interpreter when
        the underlying thread state (see pystate.h) gets deleted.
        """
        self._tstate_lock = _set_sentinel()
        self._tstate_lock.acquire()

        if not self.daemon:
            with _shutdown_locks_lock:
                _shutdown_locks.add(self._tstate_lock)

    def _bootstrap_inner(self):
        try:
            self._set_ident()
            self._set_tstate_lock()
            if _HAVE_THREAD_NATIVE_ID:
                self._set_native_id()
            self._started.set()
            with _active_limbo_lock:
                _active[self._ident] = self
                del _limbo[self]

            if _trace_hook:
                _sys.settrace(_trace_hook)
            if _profile_hook:
                _sys.setprofile(_profile_hook)

            try:
                self.run()
            except:
                self._invoke_excepthook(self)
        finally:
            with _active_limbo_lock:
                try:
                    # We don't call self._delete() because it also
                    # grabs _active_limbo_lock.
                    del _active[get_ident()]
                except:
                    pass

    def _stop(self):
        # After calling ._stop(), .is_alive() returns False and .join() returns
        # immediately.  ._tstate_lock must be released before calling ._stop().
        #
        # Normal case:  C code at the end of the thread's life
        # (release_sentinel in _threadmodule.c) releases ._tstate_lock, and
        # that's detected by our ._wait_for_tstate_lock(), called by .join()
        # and .is_alive().  Any number of threads _may_ call ._stop()
        # simultaneously (for example, if multiple threads are blocked in
        # .join() calls), and they're not serialized.  That's harmless -
        # they'll just make redundant rebindings of ._is_stopped and
        # ._tstate_lock.  Obscure:  we rebind ._tstate_lock last so that the
        # "assert self._is_stopped" in ._wait_for_tstate_lock() always works
        # (the assert is executed only if ._tstate_lock is None).
        #
        # Special case:  _main_thread releases ._tstate_lock via this
        # module's _shutdown() function.
        lock = self._tstate_lock
        if lock is not None:
            assert not lock.locked()
        self._is_stopped = True
        self._tstate_lock = None
        if not self.daemon:
            with _shutdown_locks_lock:
                _shutdown_locks.discard(lock)

    def _delete(self):
        "Remove current thread from the dict of currently running threads."
        with _active_limbo_lock:
            del _active[get_ident()]
            # There must not be any python code between the previous line
            # and after the lock is released.  Otherwise a tracing function
            # could try to acquire the lock again in the same thread, (in
            # current_thread()), and would block.

    def join(self, timeout=None):
        """Wait until the thread terminates.

        This blocks the calling thread until the thread whose join() method is
        called terminates -- either normally or through an unhandled exception
        or until the optional timeout occurs.

        When the timeout argument is present and not None, it should be a
        floating point number specifying a timeout for the operation in seconds
        (or fractions thereof). As join() always returns None, you must call
        is_alive() after join() to decide whether a timeout happened -- if the
        thread is still alive, the join() call timed out.

        When the timeout argument is not present or None, the operation will
        block until the thread terminates.

        A thread can be join()ed many times.

        join() raises a RuntimeError if an attempt is made to join the current
        thread as that would cause a deadlock. It is also an error to join() a
        thread before it has been started and attempts to do so raises the same
        exception.

        """
        if not self._initialized:
            raise RuntimeError("Thread.__init__() not called")
        if not self._started.is_set():
            raise RuntimeError("cannot join thread before it is started")
        if self is current_thread():
            raise RuntimeError("cannot join current thread")

        if timeout is None:
            self._wait_for_tstate_lock()
        else:
            # the behavior of a negative timeout isn't documented, but
            # historically .join(timeout=x) for x<0 has acted as if timeout=0
            self._wait_for_tstate_lock(timeout=max(timeout, 0))

    def _wait_for_tstate_lock(self, block=True, timeout=-1):
        # Issue #18808: wait for the thread state to be gone.
        # At the end of the thread's life, after all knowledge of the thread
        # is removed from C data structures, C code releases our _tstate_lock.
        # This method passes its arguments to _tstate_lock.acquire().
        # If the lock is acquired, the C code is done, and self._stop() is
        # called.  That sets ._is_stopped to True, and ._tstate_lock to None.
        lock = self._tstate_lock
        if lock is None:  # already determined that the C code is done
            assert self._is_stopped
        elif lock.acquire(block, timeout):
            lock.release()
            self._stop()

    @property
    def name(self):
        """A string used for identification purposes only.

        It has no semantics. Multiple threads may be given the same name. The
        initial name is set by the constructor.

        """
        assert self._initialized, "Thread.__init__() not called"
        return self._name

    @name.setter
    def name(self, name):
        assert self._initialized, "Thread.__init__() not called"
        self._name = str(name)

    @property
    def ident(self):
        """Thread identifier of this thread or None if it has not been started.

        This is a nonzero integer. See the get_ident() function. Thread
        identifiers may be recycled when a thread exits and another thread is
        created. The identifier is available even after the thread has exited.

        """
        assert self._initialized, "Thread.__init__() not called"
        return self._ident

    if _HAVE_THREAD_NATIVE_ID:
        @property
        def native_id(self):
            """Native integral thread ID of this thread, or None if it has not been started.

            This is a non-negative integer. See the get_native_id() function.
            This represents the Thread ID as reported by the kernel.

            """
            assert self._initialized, "Thread.__init__() not called"
            return self._native_id

    def is_alive(self):
        """Return whether the thread is alive.

        This method returns True just before the run() method starts until just
        after the run() method terminates. The module function enumerate()
        returns a list of all alive threads.

        """
        assert self._initialized, "Thread.__init__() not called"
        if self._is_stopped or not self._started.is_set():
            return False
        self._wait_for_tstate_lock(False)
        return not self._is_stopped

    def isAlive(self):
        """Return whether the thread is alive.

        This method is deprecated, use is_alive() instead.
        """
        import warnings
        warnings.warn('isAlive() is deprecated, use is_alive() instead',
                      DeprecationWarning, stacklevel=2)
        return self.is_alive()

    @property
    def daemon(self):
        """A boolean value indicating whether this thread is a daemon thread.

        This must be set before start() is called, otherwise RuntimeError is
        raised. Its initial value is inherited from the creating thread; the
        main thread is not a daemon thread and therefore all threads created in
        the main thread default to daemon = False.

        The entire Python program exits when only daemon threads are left.

        """
        assert self._initialized, "Thread.__init__() not called"
        return self._daemonic

    @daemon.setter
    def daemon(self, daemonic):
        if not self._initialized:
            raise RuntimeError("Thread.__init__() not called")
        if self._started.is_set():
            raise RuntimeError("cannot set daemon status of active thread")
        self._daemonic = daemonic

    def isDaemon(self):
        return self.daemon

    def setDaemon(self, daemonic):
        self.daemon = daemonic

    def getName(self):
        return self.name

    def setName(self, name):
        self.name = name


try:
    from _thread import (_excepthook as excepthook,
                         _ExceptHookArgs as ExceptHookArgs)
except ImportError:
    # Simple Python implementation if _thread._excepthook() is not available
    from traceback import print_exception as _print_exception
    from collections import namedtuple

    _ExceptHookArgs = namedtuple(
        'ExceptHookArgs',
        'exc_type exc_value exc_traceback thread')

    def ExceptHookArgs(args):
        return _ExceptHookArgs(*args)

    def excepthook(args, /):
        """
        Handle uncaught Thread.run() exception.
        """
        if args.exc_type == SystemExit:
            # silently ignore SystemExit
            return

        if _sys is not None and _sys.stderr is not None:
            stderr = _sys.stderr
        elif args.thread is not None:
            stderr = args.thread._stderr
            if stderr is None:
                # do nothing if sys.stderr is None and sys.stderr was None
                # when the thread was created
                return
        else:
            # do nothing if sys.stderr is None and args.thread is None
            return

        if args.thread is not None:
            name = args.thread.name
        else:
            name = get_ident()
        print(f"Exception in thread {name}:",
              file=stderr, flush=True)
        _print_exception(args.exc_type, args.exc_value, args.exc_traceback,
                         file=stderr)
        stderr.flush()


def _make_invoke_excepthook():
    # Create a local namespace to ensure that variables remain alive
    # when _invoke_excepthook() is called, even if it is called late during
    # Python shutdown. It is mostly needed for daemon threads.

    old_excepthook = excepthook
    old_sys_excepthook = _sys.excepthook
    if old_excepthook is None:
        raise RuntimeError("threading.excepthook is None")
    if old_sys_excepthook is None:
        raise RuntimeError("sys.excepthook is None")

    sys_exc_info = _sys.exc_info
    local_print = print
    local_sys = _sys

    def invoke_excepthook(thread):
        global excepthook
        try:
            hook = excepthook
            if hook is None:
                hook = old_excepthook

            args = ExceptHookArgs([*sys_exc_info(), thread])

            hook(args)
        except Exception as exc:
            exc.__suppress_context__ = True
            del exc

            if local_sys is not None and local_sys.stderr is not None:
                stderr = local_sys.stderr
            else:
                stderr = thread._stderr

            local_print("Exception in threading.excepthook:",
                        file=stderr, flush=True)

            if local_sys is not None and local_sys.excepthook is not None:
                sys_excepthook = local_sys.excepthook
            else:
                sys_excepthook = old_sys_excepthook

            sys_excepthook(*sys_exc_info())
        finally:
            # Break reference cycle (exception stored in a variable)
            args = None

    return invoke_excepthook


# The timer class was contributed by Itamar Shtull-Trauring

class Timer(Thread):
    """Call a function after a specified number of seconds:

            t = Timer(30.0, f, args=None, kwargs=None)
            t.start()
            t.cancel()     # stop the timer's action if it's still waiting

    """

    def __init__(self, interval, function, args=None, kwargs=None):
        Thread.__init__(self)
        self.interval = interval
        self.function = function
        self.args = args if args is not None else []
        self.kwargs = kwargs if kwargs is not None else {}
        self.finished = Event()

    def cancel(self):
        """Stop the timer if it hasn't finished yet."""
        self.finished.set()

    def run(self):
        self.finished.wait(self.interval)
        if not self.finished.is_set():
            self.function(*self.args, **self.kwargs)
        self.finished.set()


# Special thread class to represent the main thread

class _MainThread(Thread):

    def __init__(self):
        Thread.__init__(self, name="MainThread", daemon=False)
        self._set_tstate_lock()
        self._started.set()
        self._set_ident()
        if _HAVE_THREAD_NATIVE_ID:
            self._set_native_id()
        with _active_limbo_lock:
            _active[self._ident] = self


# Dummy thread class to represent threads not started here.
# These aren't garbage collected when they die, nor can they be waited for.
# If they invoke anything in threading.py that calls current_thread(), they
# leave an entry in the _active dict forever after.
# Their purpose is to return *something* from current_thread().
# They are marked as daemon threads so we won't wait for them
# when we exit (conform previous semantics).

class _DummyThread(Thread):

    def __init__(self):
        Thread.__init__(self, name=_newname("Dummy-%d"), daemon=True)

        self._started.set()
        self._set_ident()
        if _HAVE_THREAD_NATIVE_ID:
            self._set_native_id()
        with _active_limbo_lock:
            _active[self._ident] = self

    def _stop(self):
        pass

    def is_alive(self):
        assert not self._is_stopped and self._started.is_set()
        return True

    def join(self, timeout=None):
        assert False, "cannot join a dummy thread"


# Global API functions

def current_thread():
    """Return the current Thread object, corresponding to the caller's thread of control.

    If the caller's thread of control was not created through the threading
    module, a dummy thread object with limited functionality is returned.

    """
    try:
        return _active[get_ident()]
    except KeyError:
        return _DummyThread()

currentThread = current_thread

def active_count():
    """Return the number of Thread objects currently alive.

    The returned count is equal to the length of the list returned by
    enumerate().

    """
    with _active_limbo_lock:
        return len(_active) + len(_limbo)

activeCount = active_count

def _enumerate():
    # Same as enumerate(), but without the lock. Internal use only.
    return list(_active.values()) + list(_limbo.values())

def enumerate():
    """Return a list of all Thread objects currently alive.

    The list includes daemonic threads, dummy thread objects created by
    current_thread(), and the main thread. It excludes terminated threads and
    threads that have not yet been started.

    """
    with _active_limbo_lock:
        return list(_active.values()) + list(_limbo.values())

from _thread import stack_size

# Create the main thread object,
# and make it available for the interpreter
# (Py_Main) as threading._shutdown.

_main_thread = _MainThread()

def _shutdown():
    """
    Wait until the Python thread state of all non-daemon threads get deleted.
    """
    # Obscure:  other threads may be waiting to join _main_thread.  That's
    # dubious, but some code does it.  We can't wait for C code to release
    # the main thread's tstate_lock - that won't happen until the interpreter
    # is nearly dead.  So we release it here.  Note that just calling _stop()
    # isn't enough:  other threads may already be waiting on _tstate_lock.
    if _main_thread._is_stopped:
        # _shutdown() was already called
        return

    # Main thread
    tlock = _main_thread._tstate_lock
    # The main thread isn't finished yet, so its thread state lock can't have
    # been released.
    assert tlock is not None
    assert tlock.locked()
    tlock.release()
    _main_thread._stop()

    # Join all non-deamon threads
    while True:
        with _shutdown_locks_lock:
            locks = list(_shutdown_locks)
            _shutdown_locks.clear()

        if not locks:
            break

        for lock in locks:
            # mimick Thread.join()
            lock.acquire()
            lock.release()

        # new threads can be spawned while we were waiting for the other
        # threads to complete


def main_thread():
    """Return the main thread object.

    In normal conditions, the main thread is the thread from which the
    Python interpreter was started.
    """
    return _main_thread

# get thread-local implementation, either from the thread
# module, or from the python fallback

try:
    from _thread import _local as local
except ImportError:
    from _threading_local import local


def _after_fork():
    """
    Cleanup threading module state that should not exist after a fork.
    """
    # Reset _active_limbo_lock, in case we forked while the lock was held
    # by another (non-forked) thread.  http://bugs.python.org/issue874900
    global _active_limbo_lock, _main_thread
    global _shutdown_locks_lock, _shutdown_locks
    _active_limbo_lock = _allocate_lock()

    # fork() only copied the current thread; clear references to others.
    new_active = {}

    try:
        current = _active[get_ident()]
    except KeyError:
        # fork() was called in a thread which was not spawned
        # by threading.Thread. For example, a thread spawned
        # by thread.start_new_thread().
        current = _MainThread()

    _main_thread = current

    # reset _shutdown() locks: threads re-register their _tstate_lock below
    _shutdown_locks_lock = _allocate_lock()
    _shutdown_locks = set()

    with _active_limbo_lock:
        # Dangling thread instances must still have their locks reset,
        # because someone may join() them.
        threads = set(_enumerate())
        threads.update(_dangling)
        for thread in threads:
            # Any lock/condition variable may be currently locked or in an
            # invalid state, so we reinitialize them.
            if thread is current:
                # There is only one active thread. We reset the ident to
                # its new value since it can have changed.
                thread._reset_internal_locks(True)
                ident = get_ident()
                thread._ident = ident
                new_active[ident] = thread
            else:
                # All the others are already stopped.
                thread._reset_internal_locks(False)
                thread._stop()

        _limbo.clear()
        _active.clear()
        _active.update(new_active)
        assert len(_active) == 1


if hasattr(_os, "register_at_fork"):
    _os.register_at_fork(after_in_child=_after_fork)
warnings.py000064400000046350151153537440006766 0ustar00"""Python part of the warnings subsystem."""

import sys


__all__ = ["warn", "warn_explicit", "showwarning",
           "formatwarning", "filterwarnings", "simplefilter",
           "resetwarnings", "catch_warnings"]

def showwarning(message, category, filename, lineno, file=None, line=None):
    """Hook to write a warning to a file; replace if you like."""
    msg = WarningMessage(message, category, filename, lineno, file, line)
    _showwarnmsg_impl(msg)

def formatwarning(message, category, filename, lineno, line=None):
    """Function to format a warning the standard way."""
    msg = WarningMessage(message, category, filename, lineno, None, line)
    return _formatwarnmsg_impl(msg)

def _showwarnmsg_impl(msg):
    file = msg.file
    if file is None:
        file = sys.stderr
        if file is None:
            # sys.stderr is None when run with pythonw.exe:
            # warnings get lost
            return
    text = _formatwarnmsg(msg)
    try:
        file.write(text)
    except OSError:
        # the file (probably stderr) is invalid - this warning gets lost.
        pass

def _formatwarnmsg_impl(msg):
    category = msg.category.__name__
    s =  f"{msg.filename}:{msg.lineno}: {category}: {msg.message}\n"

    if msg.line is None:
        try:
            import linecache
            line = linecache.getline(msg.filename, msg.lineno)
        except Exception:
            # When a warning is logged during Python shutdown, linecache
            # and the import machinery don't work anymore
            line = None
            linecache = None
    else:
        line = msg.line
    if line:
        line = line.strip()
        s += "  %s\n" % line

    if msg.source is not None:
        try:
            import tracemalloc
        # Logging a warning should not raise a new exception:
        # catch Exception, not only ImportError and RecursionError.
        except Exception:
            # don't suggest to enable tracemalloc if it's not available
            tracing = True
            tb = None
        else:
            tracing = tracemalloc.is_tracing()
            try:
                tb = tracemalloc.get_object_traceback(msg.source)
            except Exception:
                # When a warning is logged during Python shutdown, tracemalloc
                # and the import machinery don't work anymore
                tb = None

        if tb is not None:
            s += 'Object allocated at (most recent call last):\n'
            for frame in tb:
                s += ('  File "%s", lineno %s\n'
                      % (frame.filename, frame.lineno))

                try:
                    if linecache is not None:
                        line = linecache.getline(frame.filename, frame.lineno)
                    else:
                        line = None
                except Exception:
                    line = None
                if line:
                    line = line.strip()
                    s += '    %s\n' % line
        elif not tracing:
            s += (f'{category}: Enable tracemalloc to get the object '
                  f'allocation traceback\n')
    return s

# Keep a reference to check if the function was replaced
_showwarning_orig = showwarning

def _showwarnmsg(msg):
    """Hook to write a warning to a file; replace if you like."""
    try:
        sw = showwarning
    except NameError:
        pass
    else:
        if sw is not _showwarning_orig:
            # warnings.showwarning() was replaced
            if not callable(sw):
                raise TypeError("warnings.showwarning() must be set to a "
                                "function or method")

            sw(msg.message, msg.category, msg.filename, msg.lineno,
               msg.file, msg.line)
            return
    _showwarnmsg_impl(msg)

# Keep a reference to check if the function was replaced
_formatwarning_orig = formatwarning

def _formatwarnmsg(msg):
    """Function to format a warning the standard way."""
    try:
        fw = formatwarning
    except NameError:
        pass
    else:
        if fw is not _formatwarning_orig:
            # warnings.formatwarning() was replaced
            return fw(msg.message, msg.category,
                      msg.filename, msg.lineno, msg.line)
    return _formatwarnmsg_impl(msg)

def filterwarnings(action, message="", category=Warning, module="", lineno=0,
                   append=False):
    """Insert an entry into the list of warnings filters (at the front).

    'action' -- one of "error", "ignore", "always", "default", "module",
                or "once"
    'message' -- a regex that the warning message must match
    'category' -- a class that the warning must be a subclass of
    'module' -- a regex that the module name must match
    'lineno' -- an integer line number, 0 matches all warnings
    'append' -- if true, append to the list of filters
    """
    assert action in ("error", "ignore", "always", "default", "module",
                      "once"), "invalid action: %r" % (action,)
    assert isinstance(message, str), "message must be a string"
    assert isinstance(category, type), "category must be a class"
    assert issubclass(category, Warning), "category must be a Warning subclass"
    assert isinstance(module, str), "module must be a string"
    assert isinstance(lineno, int) and lineno >= 0, \
           "lineno must be an int >= 0"

    if message or module:
        import re

    if message:
        message = re.compile(message, re.I)
    else:
        message = None
    if module:
        module = re.compile(module)
    else:
        module = None

    _add_filter(action, message, category, module, lineno, append=append)

def simplefilter(action, category=Warning, lineno=0, append=False):
    """Insert a simple entry into the list of warnings filters (at the front).

    A simple filter matches all modules and messages.
    'action' -- one of "error", "ignore", "always", "default", "module",
                or "once"
    'category' -- a class that the warning must be a subclass of
    'lineno' -- an integer line number, 0 matches all warnings
    'append' -- if true, append to the list of filters
    """
    assert action in ("error", "ignore", "always", "default", "module",
                      "once"), "invalid action: %r" % (action,)
    assert isinstance(lineno, int) and lineno >= 0, \
           "lineno must be an int >= 0"
    _add_filter(action, None, category, None, lineno, append=append)

def _add_filter(*item, append):
    # Remove possible duplicate filters, so new one will be placed
    # in correct place. If append=True and duplicate exists, do nothing.
    if not append:
        try:
            filters.remove(item)
        except ValueError:
            pass
        filters.insert(0, item)
    else:
        if item not in filters:
            filters.append(item)
    _filters_mutated()

def resetwarnings():
    """Clear the list of warning filters, so that no filters are active."""
    filters[:] = []
    _filters_mutated()

class _OptionError(Exception):
    """Exception used by option processing helpers."""
    pass

# Helper to process -W options passed via sys.warnoptions
def _processoptions(args):
    for arg in args:
        try:
            _setoption(arg)
        except _OptionError as msg:
            print("Invalid -W option ignored:", msg, file=sys.stderr)

# Helper for _processoptions()
def _setoption(arg):
    parts = arg.split(':')
    if len(parts) > 5:
        raise _OptionError("too many fields (max 5): %r" % (arg,))
    while len(parts) < 5:
        parts.append('')
    action, message, category, module, lineno = [s.strip()
                                                 for s in parts]
    action = _getaction(action)
    category = _getcategory(category)
    if message or module:
        import re
    if message:
        message = re.escape(message)
    if module:
        module = re.escape(module) + r'\Z'
    if lineno:
        try:
            lineno = int(lineno)
            if lineno < 0:
                raise ValueError
        except (ValueError, OverflowError):
            raise _OptionError("invalid lineno %r" % (lineno,)) from None
    else:
        lineno = 0
    filterwarnings(action, message, category, module, lineno)

# Helper for _setoption()
def _getaction(action):
    if not action:
        return "default"
    if action == "all": return "always" # Alias
    for a in ('default', 'always', 'ignore', 'module', 'once', 'error'):
        if a.startswith(action):
            return a
    raise _OptionError("invalid action: %r" % (action,))

# Helper for _setoption()
def _getcategory(category):
    if not category:
        return Warning
    if '.' not in category:
        import builtins as m
        klass = category
    else:
        module, _, klass = category.rpartition('.')
        try:
            m = __import__(module, None, None, [klass])
        except ImportError:
            raise _OptionError("invalid module name: %r" % (module,)) from None
    try:
        cat = getattr(m, klass)
    except AttributeError:
        raise _OptionError("unknown warning category: %r" % (category,)) from None
    if not issubclass(cat, Warning):
        raise _OptionError("invalid warning category: %r" % (category,))
    return cat


def _is_internal_frame(frame):
    """Signal whether the frame is an internal CPython implementation detail."""
    filename = frame.f_code.co_filename
    return 'importlib' in filename and '_bootstrap' in filename


def _next_external_frame(frame):
    """Find the next frame that doesn't involve CPython internals."""
    frame = frame.f_back
    while frame is not None and _is_internal_frame(frame):
        frame = frame.f_back
    return frame


# Code typically replaced by _warnings
def warn(message, category=None, stacklevel=1, source=None):
    """Issue a warning, or maybe ignore it or raise an exception."""
    # Check if message is already a Warning object
    if isinstance(message, Warning):
        category = message.__class__
    # Check category argument
    if category is None:
        category = UserWarning
    if not (isinstance(category, type) and issubclass(category, Warning)):
        raise TypeError("category must be a Warning subclass, "
                        "not '{:s}'".format(type(category).__name__))
    # Get context information
    try:
        if stacklevel <= 1 or _is_internal_frame(sys._getframe(1)):
            # If frame is too small to care or if the warning originated in
            # internal code, then do not try to hide any frames.
            frame = sys._getframe(stacklevel)
        else:
            frame = sys._getframe(1)
            # Look for one frame less since the above line starts us off.
            for x in range(stacklevel-1):
                frame = _next_external_frame(frame)
                if frame is None:
                    raise ValueError
    except ValueError:
        globals = sys.__dict__
        filename = "sys"
        lineno = 1
    else:
        globals = frame.f_globals
        filename = frame.f_code.co_filename
        lineno = frame.f_lineno
    if '__name__' in globals:
        module = globals['__name__']
    else:
        module = "<string>"
    registry = globals.setdefault("__warningregistry__", {})
    warn_explicit(message, category, filename, lineno, module, registry,
                  globals, source)

def warn_explicit(message, category, filename, lineno,
                  module=None, registry=None, module_globals=None,
                  source=None):
    lineno = int(lineno)
    if module is None:
        module = filename or "<unknown>"
        if module[-3:].lower() == ".py":
            module = module[:-3] # XXX What about leading pathname?
    if registry is None:
        registry = {}
    if registry.get('version', 0) != _filters_version:
        registry.clear()
        registry['version'] = _filters_version
    if isinstance(message, Warning):
        text = str(message)
        category = message.__class__
    else:
        text = message
        message = category(message)
    key = (text, category, lineno)
    # Quick test for common case
    if registry.get(key):
        return
    # Search the filters
    for item in filters:
        action, msg, cat, mod, ln = item
        if ((msg is None or msg.match(text)) and
            issubclass(category, cat) and
            (mod is None or mod.match(module)) and
            (ln == 0 or lineno == ln)):
            break
    else:
        action = defaultaction
    # Early exit actions
    if action == "ignore":
        return

    # Prime the linecache for formatting, in case the
    # "file" is actually in a zipfile or something.
    import linecache
    linecache.getlines(filename, module_globals)

    if action == "error":
        raise message
    # Other actions
    if action == "once":
        registry[key] = 1
        oncekey = (text, category)
        if onceregistry.get(oncekey):
            return
        onceregistry[oncekey] = 1
    elif action == "always":
        pass
    elif action == "module":
        registry[key] = 1
        altkey = (text, category, 0)
        if registry.get(altkey):
            return
        registry[altkey] = 1
    elif action == "default":
        registry[key] = 1
    else:
        # Unrecognized actions are errors
        raise RuntimeError(
              "Unrecognized action (%r) in warnings.filters:\n %s" %
              (action, item))
    # Print message and context
    msg = WarningMessage(message, category, filename, lineno, source)
    _showwarnmsg(msg)


class WarningMessage(object):

    _WARNING_DETAILS = ("message", "category", "filename", "lineno", "file",
                        "line", "source")

    def __init__(self, message, category, filename, lineno, file=None,
                 line=None, source=None):
        self.message = message
        self.category = category
        self.filename = filename
        self.lineno = lineno
        self.file = file
        self.line = line
        self.source = source
        self._category_name = category.__name__ if category else None

    def __str__(self):
        return ("{message : %r, category : %r, filename : %r, lineno : %s, "
                    "line : %r}" % (self.message, self._category_name,
                                    self.filename, self.lineno, self.line))


class catch_warnings(object):

    """A context manager that copies and restores the warnings filter upon
    exiting the context.

    The 'record' argument specifies whether warnings should be captured by a
    custom implementation of warnings.showwarning() and be appended to a list
    returned by the context manager. Otherwise None is returned by the context
    manager. The objects appended to the list are arguments whose attributes
    mirror the arguments to showwarning().

    The 'module' argument is to specify an alternative module to the module
    named 'warnings' and imported under that name. This argument is only useful
    when testing the warnings module itself.

    """

    def __init__(self, *, record=False, module=None):
        """Specify whether to record warnings and if an alternative module
        should be used other than sys.modules['warnings'].

        For compatibility with Python 3.0, please consider all arguments to be
        keyword-only.

        """
        self._record = record
        self._module = sys.modules['warnings'] if module is None else module
        self._entered = False

    def __repr__(self):
        args = []
        if self._record:
            args.append("record=True")
        if self._module is not sys.modules['warnings']:
            args.append("module=%r" % self._module)
        name = type(self).__name__
        return "%s(%s)" % (name, ", ".join(args))

    def __enter__(self):
        if self._entered:
            raise RuntimeError("Cannot enter %r twice" % self)
        self._entered = True
        self._filters = self._module.filters
        self._module.filters = self._filters[:]
        self._module._filters_mutated()
        self._showwarning = self._module.showwarning
        self._showwarnmsg_impl = self._module._showwarnmsg_impl
        if self._record:
            log = []
            self._module._showwarnmsg_impl = log.append
            # Reset showwarning() to the default implementation to make sure
            # that _showwarnmsg() calls _showwarnmsg_impl()
            self._module.showwarning = self._module._showwarning_orig
            return log
        else:
            return None

    def __exit__(self, *exc_info):
        if not self._entered:
            raise RuntimeError("Cannot exit %r without entering first" % self)
        self._module.filters = self._filters
        self._module._filters_mutated()
        self._module.showwarning = self._showwarning
        self._module._showwarnmsg_impl = self._showwarnmsg_impl


# Private utility function called by _PyErr_WarnUnawaitedCoroutine
def _warn_unawaited_coroutine(coro):
    msg_lines = [
        f"coroutine '{coro.__qualname__}' was never awaited\n"
    ]
    if coro.cr_origin is not None:
        import linecache, traceback
        def extract():
            for filename, lineno, funcname in reversed(coro.cr_origin):
                line = linecache.getline(filename, lineno)
                yield (filename, lineno, funcname, line)
        msg_lines.append("Coroutine created at (most recent call last)\n")
        msg_lines += traceback.format_list(list(extract()))
    msg = "".join(msg_lines).rstrip("\n")
    # Passing source= here means that if the user happens to have tracemalloc
    # enabled and tracking where the coroutine was created, the warning will
    # contain that traceback. This does mean that if they have *both*
    # coroutine origin tracking *and* tracemalloc enabled, they'll get two
    # partially-redundant tracebacks. If we wanted to be clever we could
    # probably detect this case and avoid it, but for now we don't bother.
    warn(msg, category=RuntimeWarning, stacklevel=2, source=coro)


# filters contains a sequence of filter 5-tuples
# The components of the 5-tuple are:
# - an action: error, ignore, always, default, module, or once
# - a compiled regex that must match the warning message
# - a class representing the warning category
# - a compiled regex that must match the module that is being warned
# - a line number for the line being warning, or 0 to mean any line
# If either if the compiled regexs are None, match anything.
try:
    from _warnings import (filters, _defaultaction, _onceregistry,
                           warn, warn_explicit, _filters_mutated)
    defaultaction = _defaultaction
    onceregistry = _onceregistry
    _warnings_defaults = True
except ImportError:
    filters = []
    defaultaction = "default"
    onceregistry = {}

    _filters_version = 1

    def _filters_mutated():
        global _filters_version
        _filters_version += 1

    _warnings_defaults = False


# Module initialization
_processoptions(sys.warnoptions)
if not _warnings_defaults:
    # Several warning categories are ignored by default in regular builds
    if not hasattr(sys, 'gettotalrefcount'):
        filterwarnings("default", category=DeprecationWarning,
                       module="__main__", append=1)
        simplefilter("ignore", category=DeprecationWarning, append=1)
        simplefilter("ignore", category=PendingDeprecationWarning, append=1)
        simplefilter("ignore", category=ImportWarning, append=1)
        simplefilter("ignore", category=ResourceWarning, append=1)

del _warnings_defaults
binhex.py000064400000033202151153537440006403 0ustar00"""Macintosh binhex compression/decompression.

easy interface:
binhex(inputfilename, outputfilename)
hexbin(inputfilename, outputfilename)
"""

#
# Jack Jansen, CWI, August 1995.
#
# The module is supposed to be as compatible as possible. Especially the
# easy interface should work "as expected" on any platform.
# XXXX Note: currently, textfiles appear in mac-form on all platforms.
# We seem to lack a simple character-translate in python.
# (we should probably use ISO-Latin-1 on all but the mac platform).
# XXXX The simple routines are too simple: they expect to hold the complete
# files in-core. Should be fixed.
# XXXX It would be nice to handle AppleDouble format on unix
# (for servers serving macs).
# XXXX I don't understand what happens when you get 0x90 times the same byte on
# input. The resulting code (xx 90 90) would appear to be interpreted as an
# escaped *value* of 0x90. All coders I've seen appear to ignore this nicety...
#
import io
import os
import struct
import binascii

__all__ = ["binhex","hexbin","Error"]

class Error(Exception):
    pass

# States (what have we written)
_DID_HEADER = 0
_DID_DATA = 1

# Various constants
REASONABLY_LARGE = 32768  # Minimal amount we pass the rle-coder
LINELEN = 64
RUNCHAR = b"\x90"

#
# This code is no longer byte-order dependent


class FInfo:
    def __init__(self):
        self.Type = '????'
        self.Creator = '????'
        self.Flags = 0

def getfileinfo(name):
    finfo = FInfo()
    with io.open(name, 'rb') as fp:
        # Quick check for textfile
        data = fp.read(512)
        if 0 not in data:
            finfo.Type = 'TEXT'
        fp.seek(0, 2)
        dsize = fp.tell()
    dir, file = os.path.split(name)
    file = file.replace(':', '-', 1)
    return file, finfo, dsize, 0

class openrsrc:
    def __init__(self, *args):
        pass

    def read(self, *args):
        return b''

    def write(self, *args):
        pass

    def close(self):
        pass

class _Hqxcoderengine:
    """Write data to the coder in 3-byte chunks"""

    def __init__(self, ofp):
        self.ofp = ofp
        self.data = b''
        self.hqxdata = b''
        self.linelen = LINELEN - 1

    def write(self, data):
        self.data = self.data + data
        datalen = len(self.data)
        todo = (datalen // 3) * 3
        data = self.data[:todo]
        self.data = self.data[todo:]
        if not data:
            return
        self.hqxdata = self.hqxdata + binascii.b2a_hqx(data)
        self._flush(0)

    def _flush(self, force):
        first = 0
        while first <= len(self.hqxdata) - self.linelen:
            last = first + self.linelen
            self.ofp.write(self.hqxdata[first:last] + b'\r')
            self.linelen = LINELEN
            first = last
        self.hqxdata = self.hqxdata[first:]
        if force:
            self.ofp.write(self.hqxdata + b':\r')

    def close(self):
        if self.data:
            self.hqxdata = self.hqxdata + binascii.b2a_hqx(self.data)
        self._flush(1)
        self.ofp.close()
        del self.ofp

class _Rlecoderengine:
    """Write data to the RLE-coder in suitably large chunks"""

    def __init__(self, ofp):
        self.ofp = ofp
        self.data = b''

    def write(self, data):
        self.data = self.data + data
        if len(self.data) < REASONABLY_LARGE:
            return
        rledata = binascii.rlecode_hqx(self.data)
        self.ofp.write(rledata)
        self.data = b''

    def close(self):
        if self.data:
            rledata = binascii.rlecode_hqx(self.data)
            self.ofp.write(rledata)
        self.ofp.close()
        del self.ofp

class BinHex:
    def __init__(self, name_finfo_dlen_rlen, ofp):
        name, finfo, dlen, rlen = name_finfo_dlen_rlen
        close_on_error = False
        if isinstance(ofp, str):
            ofname = ofp
            ofp = io.open(ofname, 'wb')
            close_on_error = True
        try:
            ofp.write(b'(This file must be converted with BinHex 4.0)\r\r:')
            hqxer = _Hqxcoderengine(ofp)
            self.ofp = _Rlecoderengine(hqxer)
            self.crc = 0
            if finfo is None:
                finfo = FInfo()
            self.dlen = dlen
            self.rlen = rlen
            self._writeinfo(name, finfo)
            self.state = _DID_HEADER
        except:
            if close_on_error:
                ofp.close()
            raise

    def _writeinfo(self, name, finfo):
        nl = len(name)
        if nl > 63:
            raise Error('Filename too long')
        d = bytes([nl]) + name.encode("latin-1") + b'\0'
        tp, cr = finfo.Type, finfo.Creator
        if isinstance(tp, str):
            tp = tp.encode("latin-1")
        if isinstance(cr, str):
            cr = cr.encode("latin-1")
        d2 = tp + cr

        # Force all structs to be packed with big-endian
        d3 = struct.pack('>h', finfo.Flags)
        d4 = struct.pack('>ii', self.dlen, self.rlen)
        info = d + d2 + d3 + d4
        self._write(info)
        self._writecrc()

    def _write(self, data):
        self.crc = binascii.crc_hqx(data, self.crc)
        self.ofp.write(data)

    def _writecrc(self):
        # XXXX Should this be here??
        # self.crc = binascii.crc_hqx('\0\0', self.crc)
        if self.crc < 0:
            fmt = '>h'
        else:
            fmt = '>H'
        self.ofp.write(struct.pack(fmt, self.crc))
        self.crc = 0

    def write(self, data):
        if self.state != _DID_HEADER:
            raise Error('Writing data at the wrong time')
        self.dlen = self.dlen - len(data)
        self._write(data)

    def close_data(self):
        if self.dlen != 0:
            raise Error('Incorrect data size, diff=%r' % (self.rlen,))
        self._writecrc()
        self.state = _DID_DATA

    def write_rsrc(self, data):
        if self.state < _DID_DATA:
            self.close_data()
        if self.state != _DID_DATA:
            raise Error('Writing resource data at the wrong time')
        self.rlen = self.rlen - len(data)
        self._write(data)

    def close(self):
        if self.state is None:
            return
        try:
            if self.state < _DID_DATA:
                self.close_data()
            if self.state != _DID_DATA:
                raise Error('Close at the wrong time')
            if self.rlen != 0:
                raise Error("Incorrect resource-datasize, diff=%r" % (self.rlen,))
            self._writecrc()
        finally:
            self.state = None
            ofp = self.ofp
            del self.ofp
            ofp.close()

def binhex(inp, out):
    """binhex(infilename, outfilename): create binhex-encoded copy of a file"""
    finfo = getfileinfo(inp)
    ofp = BinHex(finfo, out)

    with io.open(inp, 'rb') as ifp:
        # XXXX Do textfile translation on non-mac systems
        while True:
            d = ifp.read(128000)
            if not d: break
            ofp.write(d)
        ofp.close_data()

    ifp = openrsrc(inp, 'rb')
    while True:
        d = ifp.read(128000)
        if not d: break
        ofp.write_rsrc(d)
    ofp.close()
    ifp.close()

class _Hqxdecoderengine:
    """Read data via the decoder in 4-byte chunks"""

    def __init__(self, ifp):
        self.ifp = ifp
        self.eof = 0

    def read(self, totalwtd):
        """Read at least wtd bytes (or until EOF)"""
        decdata = b''
        wtd = totalwtd
        #
        # The loop here is convoluted, since we don't really now how
        # much to decode: there may be newlines in the incoming data.
        while wtd > 0:
            if self.eof: return decdata
            wtd = ((wtd + 2) // 3) * 4
            data = self.ifp.read(wtd)
            #
            # Next problem: there may not be a complete number of
            # bytes in what we pass to a2b. Solve by yet another
            # loop.
            #
            while True:
                try:
                    decdatacur, self.eof = binascii.a2b_hqx(data)
                    break
                except binascii.Incomplete:
                    pass
                newdata = self.ifp.read(1)
                if not newdata:
                    raise Error('Premature EOF on binhex file')
                data = data + newdata
            decdata = decdata + decdatacur
            wtd = totalwtd - len(decdata)
            if not decdata and not self.eof:
                raise Error('Premature EOF on binhex file')
        return decdata

    def close(self):
        self.ifp.close()

class _Rledecoderengine:
    """Read data via the RLE-coder"""

    def __init__(self, ifp):
        self.ifp = ifp
        self.pre_buffer = b''
        self.post_buffer = b''
        self.eof = 0

    def read(self, wtd):
        if wtd > len(self.post_buffer):
            self._fill(wtd - len(self.post_buffer))
        rv = self.post_buffer[:wtd]
        self.post_buffer = self.post_buffer[wtd:]
        return rv

    def _fill(self, wtd):
        self.pre_buffer = self.pre_buffer + self.ifp.read(wtd + 4)
        if self.ifp.eof:
            self.post_buffer = self.post_buffer + \
                binascii.rledecode_hqx(self.pre_buffer)
            self.pre_buffer = b''
            return

        #
        # Obfuscated code ahead. We have to take care that we don't
        # end up with an orphaned RUNCHAR later on. So, we keep a couple
        # of bytes in the buffer, depending on what the end of
        # the buffer looks like:
        # '\220\0\220' - Keep 3 bytes: repeated \220 (escaped as \220\0)
        # '?\220' - Keep 2 bytes: repeated something-else
        # '\220\0' - Escaped \220: Keep 2 bytes.
        # '?\220?' - Complete repeat sequence: decode all
        # otherwise: keep 1 byte.
        #
        mark = len(self.pre_buffer)
        if self.pre_buffer[-3:] == RUNCHAR + b'\0' + RUNCHAR:
            mark = mark - 3
        elif self.pre_buffer[-1:] == RUNCHAR:
            mark = mark - 2
        elif self.pre_buffer[-2:] == RUNCHAR + b'\0':
            mark = mark - 2
        elif self.pre_buffer[-2:-1] == RUNCHAR:
            pass # Decode all
        else:
            mark = mark - 1

        self.post_buffer = self.post_buffer + \
            binascii.rledecode_hqx(self.pre_buffer[:mark])
        self.pre_buffer = self.pre_buffer[mark:]

    def close(self):
        self.ifp.close()

class HexBin:
    def __init__(self, ifp):
        if isinstance(ifp, str):
            ifp = io.open(ifp, 'rb')
        #
        # Find initial colon.
        #
        while True:
            ch = ifp.read(1)
            if not ch:
                raise Error("No binhex data found")
            # Cater for \r\n terminated lines (which show up as \n\r, hence
            # all lines start with \r)
            if ch == b'\r':
                continue
            if ch == b':':
                break

        hqxifp = _Hqxdecoderengine(ifp)
        self.ifp = _Rledecoderengine(hqxifp)
        self.crc = 0
        self._readheader()

    def _read(self, len):
        data = self.ifp.read(len)
        self.crc = binascii.crc_hqx(data, self.crc)
        return data

    def _checkcrc(self):
        filecrc = struct.unpack('>h', self.ifp.read(2))[0] & 0xffff
        #self.crc = binascii.crc_hqx('\0\0', self.crc)
        # XXXX Is this needed??
        self.crc = self.crc & 0xffff
        if filecrc != self.crc:
            raise Error('CRC error, computed %x, read %x'
                        % (self.crc, filecrc))
        self.crc = 0

    def _readheader(self):
        len = self._read(1)
        fname = self._read(ord(len))
        rest = self._read(1 + 4 + 4 + 2 + 4 + 4)
        self._checkcrc()

        type = rest[1:5]
        creator = rest[5:9]
        flags = struct.unpack('>h', rest[9:11])[0]
        self.dlen = struct.unpack('>l', rest[11:15])[0]
        self.rlen = struct.unpack('>l', rest[15:19])[0]

        self.FName = fname
        self.FInfo = FInfo()
        self.FInfo.Creator = creator
        self.FInfo.Type = type
        self.FInfo.Flags = flags

        self.state = _DID_HEADER

    def read(self, *n):
        if self.state != _DID_HEADER:
            raise Error('Read data at wrong time')
        if n:
            n = n[0]
            n = min(n, self.dlen)
        else:
            n = self.dlen
        rv = b''
        while len(rv) < n:
            rv = rv + self._read(n-len(rv))
        self.dlen = self.dlen - n
        return rv

    def close_data(self):
        if self.state != _DID_HEADER:
            raise Error('close_data at wrong time')
        if self.dlen:
            dummy = self._read(self.dlen)
        self._checkcrc()
        self.state = _DID_DATA

    def read_rsrc(self, *n):
        if self.state == _DID_HEADER:
            self.close_data()
        if self.state != _DID_DATA:
            raise Error('Read resource data at wrong time')
        if n:
            n = n[0]
            n = min(n, self.rlen)
        else:
            n = self.rlen
        self.rlen = self.rlen - n
        return self._read(n)

    def close(self):
        if self.state is None:
            return
        try:
            if self.rlen:
                dummy = self.read_rsrc(self.rlen)
            self._checkcrc()
        finally:
            self.state = None
            self.ifp.close()

def hexbin(inp, out):
    """hexbin(infilename, outfilename) - Decode binhexed file"""
    ifp = HexBin(inp)
    finfo = ifp.FInfo
    if not out:
        out = ifp.FName

    with io.open(out, 'wb') as ofp:
        # XXXX Do translation on non-mac systems
        while True:
            d = ifp.read(128000)
            if not d: break
            ofp.write(d)
    ifp.close_data()

    d = ifp.read_rsrc(128000)
    if d:
        ofp = openrsrc(out, 'wb')
        ofp.write(d)
        while True:
            d = ifp.read_rsrc(128000)
            if not d: break
            ofp.write(d)
        ofp.close()

    ifp.close()
_threading_local.py000064400000016064151153537440010413 0ustar00"""Thread-local objects.

(Note that this module provides a Python version of the threading.local
 class.  Depending on the version of Python you're using, there may be a
 faster one available.  You should always import the `local` class from
 `threading`.)

Thread-local objects support the management of thread-local data.
If you have data that you want to be local to a thread, simply create
a thread-local object and use its attributes:

  >>> mydata = local()
  >>> mydata.number = 42
  >>> mydata.number
  42

You can also access the local-object's dictionary:

  >>> mydata.__dict__
  {'number': 42}
  >>> mydata.__dict__.setdefault('widgets', [])
  []
  >>> mydata.widgets
  []

What's important about thread-local objects is that their data are
local to a thread. If we access the data in a different thread:

  >>> log = []
  >>> def f():
  ...     items = sorted(mydata.__dict__.items())
  ...     log.append(items)
  ...     mydata.number = 11
  ...     log.append(mydata.number)

  >>> import threading
  >>> thread = threading.Thread(target=f)
  >>> thread.start()
  >>> thread.join()
  >>> log
  [[], 11]

we get different data.  Furthermore, changes made in the other thread
don't affect data seen in this thread:

  >>> mydata.number
  42

Of course, values you get from a local object, including a __dict__
attribute, are for whatever thread was current at the time the
attribute was read.  For that reason, you generally don't want to save
these values across threads, as they apply only to the thread they
came from.

You can create custom local objects by subclassing the local class:

  >>> class MyLocal(local):
  ...     number = 2
  ...     def __init__(self, /, **kw):
  ...         self.__dict__.update(kw)
  ...     def squared(self):
  ...         return self.number ** 2

This can be useful to support default values, methods and
initialization.  Note that if you define an __init__ method, it will be
called each time the local object is used in a separate thread.  This
is necessary to initialize each thread's dictionary.

Now if we create a local object:

  >>> mydata = MyLocal(color='red')

Now we have a default number:

  >>> mydata.number
  2

an initial color:

  >>> mydata.color
  'red'
  >>> del mydata.color

And a method that operates on the data:

  >>> mydata.squared()
  4

As before, we can access the data in a separate thread:

  >>> log = []
  >>> thread = threading.Thread(target=f)
  >>> thread.start()
  >>> thread.join()
  >>> log
  [[('color', 'red')], 11]

without affecting this thread's data:

  >>> mydata.number
  2
  >>> mydata.color
  Traceback (most recent call last):
  ...
  AttributeError: 'MyLocal' object has no attribute 'color'

Note that subclasses can define slots, but they are not thread
local. They are shared across threads:

  >>> class MyLocal(local):
  ...     __slots__ = 'number'

  >>> mydata = MyLocal()
  >>> mydata.number = 42
  >>> mydata.color = 'red'

So, the separate thread:

  >>> thread = threading.Thread(target=f)
  >>> thread.start()
  >>> thread.join()

affects what we see:

  >>> mydata.number
  11

>>> del mydata
"""

from weakref import ref
from contextlib import contextmanager

__all__ = ["local"]

# We need to use objects from the threading module, but the threading
# module may also want to use our `local` class, if support for locals
# isn't compiled in to the `thread` module.  This creates potential problems
# with circular imports.  For that reason, we don't import `threading`
# until the bottom of this file (a hack sufficient to worm around the
# potential problems).  Note that all platforms on CPython do have support
# for locals in the `thread` module, and there is no circular import problem
# then, so problems introduced by fiddling the order of imports here won't
# manifest.

class _localimpl:
    """A class managing thread-local dicts"""
    __slots__ = 'key', 'dicts', 'localargs', 'locallock', '__weakref__'

    def __init__(self):
        # The key used in the Thread objects' attribute dicts.
        # We keep it a string for speed but make it unlikely to clash with
        # a "real" attribute.
        self.key = '_threading_local._localimpl.' + str(id(self))
        # { id(Thread) -> (ref(Thread), thread-local dict) }
        self.dicts = {}

    def get_dict(self):
        """Return the dict for the current thread. Raises KeyError if none
        defined."""
        thread = current_thread()
        return self.dicts[id(thread)][1]

    def create_dict(self):
        """Create a new dict for the current thread, and return it."""
        localdict = {}
        key = self.key
        thread = current_thread()
        idt = id(thread)
        def local_deleted(_, key=key):
            # When the localimpl is deleted, remove the thread attribute.
            thread = wrthread()
            if thread is not None:
                del thread.__dict__[key]
        def thread_deleted(_, idt=idt):
            # When the thread is deleted, remove the local dict.
            # Note that this is suboptimal if the thread object gets
            # caught in a reference loop. We would like to be called
            # as soon as the OS-level thread ends instead.
            local = wrlocal()
            if local is not None:
                dct = local.dicts.pop(idt)
        wrlocal = ref(self, local_deleted)
        wrthread = ref(thread, thread_deleted)
        thread.__dict__[key] = wrlocal
        self.dicts[idt] = wrthread, localdict
        return localdict


@contextmanager
def _patch(self):
    impl = object.__getattribute__(self, '_local__impl')
    try:
        dct = impl.get_dict()
    except KeyError:
        dct = impl.create_dict()
        args, kw = impl.localargs
        self.__init__(*args, **kw)
    with impl.locallock:
        object.__setattr__(self, '__dict__', dct)
        yield


class local:
    __slots__ = '_local__impl', '__dict__'

    def __new__(cls, /, *args, **kw):
        if (args or kw) and (cls.__init__ is object.__init__):
            raise TypeError("Initialization arguments are not supported")
        self = object.__new__(cls)
        impl = _localimpl()
        impl.localargs = (args, kw)
        impl.locallock = RLock()
        object.__setattr__(self, '_local__impl', impl)
        # We need to create the thread dict in anticipation of
        # __init__ being called, to make sure we don't call it
        # again ourselves.
        impl.create_dict()
        return self

    def __getattribute__(self, name):
        with _patch(self):
            return object.__getattribute__(self, name)

    def __setattr__(self, name, value):
        if name == '__dict__':
            raise AttributeError(
                "%r object attribute '__dict__' is read-only"
                % self.__class__.__name__)
        with _patch(self):
            return object.__setattr__(self, name, value)

    def __delattr__(self, name):
        if name == '__dict__':
            raise AttributeError(
                "%r object attribute '__dict__' is read-only"
                % self.__class__.__name__)
        with _patch(self):
            return object.__delattr__(self, name)


from threading import current_thread, RLock
multiprocessing/context.py000064400000025771151153537440012055 0ustar00import os
import sys
import threading

from . import process
from . import reduction

__all__ = ()

#
# Exceptions
#

class ProcessError(Exception):
    pass

class BufferTooShort(ProcessError):
    pass

class TimeoutError(ProcessError):
    pass

class AuthenticationError(ProcessError):
    pass

#
# Base type for contexts. Bound methods of an instance of this type are included in __all__ of __init__.py
#

class BaseContext(object):

    ProcessError = ProcessError
    BufferTooShort = BufferTooShort
    TimeoutError = TimeoutError
    AuthenticationError = AuthenticationError

    current_process = staticmethod(process.current_process)
    parent_process = staticmethod(process.parent_process)
    active_children = staticmethod(process.active_children)

    def cpu_count(self):
        '''Returns the number of CPUs in the system'''
        num = os.cpu_count()
        if num is None:
            raise NotImplementedError('cannot determine number of cpus')
        else:
            return num

    def Manager(self):
        '''Returns a manager associated with a running server process

        The managers methods such as `Lock()`, `Condition()` and `Queue()`
        can be used to create shared objects.
        '''
        from .managers import SyncManager
        m = SyncManager(ctx=self.get_context())
        m.start()
        return m

    def Pipe(self, duplex=True):
        '''Returns two connection object connected by a pipe'''
        from .connection import Pipe
        return Pipe(duplex)

    def Lock(self):
        '''Returns a non-recursive lock object'''
        from .synchronize import Lock
        return Lock(ctx=self.get_context())

    def RLock(self):
        '''Returns a recursive lock object'''
        from .synchronize import RLock
        return RLock(ctx=self.get_context())

    def Condition(self, lock=None):
        '''Returns a condition object'''
        from .synchronize import Condition
        return Condition(lock, ctx=self.get_context())

    def Semaphore(self, value=1):
        '''Returns a semaphore object'''
        from .synchronize import Semaphore
        return Semaphore(value, ctx=self.get_context())

    def BoundedSemaphore(self, value=1):
        '''Returns a bounded semaphore object'''
        from .synchronize import BoundedSemaphore
        return BoundedSemaphore(value, ctx=self.get_context())

    def Event(self):
        '''Returns an event object'''
        from .synchronize import Event
        return Event(ctx=self.get_context())

    def Barrier(self, parties, action=None, timeout=None):
        '''Returns a barrier object'''
        from .synchronize import Barrier
        return Barrier(parties, action, timeout, ctx=self.get_context())

    def Queue(self, maxsize=0):
        '''Returns a queue object'''
        from .queues import Queue
        return Queue(maxsize, ctx=self.get_context())

    def JoinableQueue(self, maxsize=0):
        '''Returns a queue object'''
        from .queues import JoinableQueue
        return JoinableQueue(maxsize, ctx=self.get_context())

    def SimpleQueue(self):
        '''Returns a queue object'''
        from .queues import SimpleQueue
        return SimpleQueue(ctx=self.get_context())

    def Pool(self, processes=None, initializer=None, initargs=(),
             maxtasksperchild=None):
        '''Returns a process pool object'''
        from .pool import Pool
        return Pool(processes, initializer, initargs, maxtasksperchild,
                    context=self.get_context())

    def RawValue(self, typecode_or_type, *args):
        '''Returns a shared object'''
        from .sharedctypes import RawValue
        return RawValue(typecode_or_type, *args)

    def RawArray(self, typecode_or_type, size_or_initializer):
        '''Returns a shared array'''
        from .sharedctypes import RawArray
        return RawArray(typecode_or_type, size_or_initializer)

    def Value(self, typecode_or_type, *args, lock=True):
        '''Returns a synchronized shared object'''
        from .sharedctypes import Value
        return Value(typecode_or_type, *args, lock=lock,
                     ctx=self.get_context())

    def Array(self, typecode_or_type, size_or_initializer, *, lock=True):
        '''Returns a synchronized shared array'''
        from .sharedctypes import Array
        return Array(typecode_or_type, size_or_initializer, lock=lock,
                     ctx=self.get_context())

    def freeze_support(self):
        '''Check whether this is a fake forked process in a frozen executable.
        If so then run code specified by commandline and exit.
        '''
        if sys.platform == 'win32' and getattr(sys, 'frozen', False):
            from .spawn import freeze_support
            freeze_support()

    def get_logger(self):
        '''Return package logger -- if it does not already exist then
        it is created.
        '''
        from .util import get_logger
        return get_logger()

    def log_to_stderr(self, level=None):
        '''Turn on logging and add a handler which prints to stderr'''
        from .util import log_to_stderr
        return log_to_stderr(level)

    def allow_connection_pickling(self):
        '''Install support for sending connections and sockets
        between processes
        '''
        # This is undocumented.  In previous versions of multiprocessing
        # its only effect was to make socket objects inheritable on Windows.
        from . import connection

    def set_executable(self, executable):
        '''Sets the path to a python.exe or pythonw.exe binary used to run
        child processes instead of sys.executable when using the 'spawn'
        start method.  Useful for people embedding Python.
        '''
        from .spawn import set_executable
        set_executable(executable)

    def set_forkserver_preload(self, module_names):
        '''Set list of module names to try to load in forkserver process.
        This is really just a hint.
        '''
        from .forkserver import set_forkserver_preload
        set_forkserver_preload(module_names)

    def get_context(self, method=None):
        if method is None:
            return self
        try:
            ctx = _concrete_contexts[method]
        except KeyError:
            raise ValueError('cannot find context for %r' % method) from None
        ctx._check_available()
        return ctx

    def get_start_method(self, allow_none=False):
        return self._name

    def set_start_method(self, method, force=False):
        raise ValueError('cannot set start method of concrete context')

    @property
    def reducer(self):
        '''Controls how objects will be reduced to a form that can be
        shared with other processes.'''
        return globals().get('reduction')

    @reducer.setter
    def reducer(self, reduction):
        globals()['reduction'] = reduction

    def _check_available(self):
        pass

#
# Type of default context -- underlying context can be set at most once
#

class Process(process.BaseProcess):
    _start_method = None
    @staticmethod
    def _Popen(process_obj):
        return _default_context.get_context().Process._Popen(process_obj)

class DefaultContext(BaseContext):
    Process = Process

    def __init__(self, context):
        self._default_context = context
        self._actual_context = None

    def get_context(self, method=None):
        if method is None:
            if self._actual_context is None:
                self._actual_context = self._default_context
            return self._actual_context
        else:
            return super().get_context(method)

    def set_start_method(self, method, force=False):
        if self._actual_context is not None and not force:
            raise RuntimeError('context has already been set')
        if method is None and force:
            self._actual_context = None
            return
        self._actual_context = self.get_context(method)

    def get_start_method(self, allow_none=False):
        if self._actual_context is None:
            if allow_none:
                return None
            self._actual_context = self._default_context
        return self._actual_context._name

    def get_all_start_methods(self):
        if sys.platform == 'win32':
            return ['spawn']
        else:
            methods = ['spawn', 'fork'] if sys.platform == 'darwin' else ['fork', 'spawn']
            if reduction.HAVE_SEND_HANDLE:
                methods.append('forkserver')
            return methods


#
# Context types for fixed start method
#

if sys.platform != 'win32':

    class ForkProcess(process.BaseProcess):
        _start_method = 'fork'
        @staticmethod
        def _Popen(process_obj):
            from .popen_fork import Popen
            return Popen(process_obj)

    class SpawnProcess(process.BaseProcess):
        _start_method = 'spawn'
        @staticmethod
        def _Popen(process_obj):
            from .popen_spawn_posix import Popen
            return Popen(process_obj)

    class ForkServerProcess(process.BaseProcess):
        _start_method = 'forkserver'
        @staticmethod
        def _Popen(process_obj):
            from .popen_forkserver import Popen
            return Popen(process_obj)

    class ForkContext(BaseContext):
        _name = 'fork'
        Process = ForkProcess

    class SpawnContext(BaseContext):
        _name = 'spawn'
        Process = SpawnProcess

    class ForkServerContext(BaseContext):
        _name = 'forkserver'
        Process = ForkServerProcess
        def _check_available(self):
            if not reduction.HAVE_SEND_HANDLE:
                raise ValueError('forkserver start method not available')

    _concrete_contexts = {
        'fork': ForkContext(),
        'spawn': SpawnContext(),
        'forkserver': ForkServerContext(),
    }
    if sys.platform == 'darwin':
        # bpo-33725: running arbitrary code after fork() is no longer reliable
        # on macOS since macOS 10.14 (Mojave). Use spawn by default instead.
        _default_context = DefaultContext(_concrete_contexts['spawn'])
    else:
        _default_context = DefaultContext(_concrete_contexts['fork'])

else:

    class SpawnProcess(process.BaseProcess):
        _start_method = 'spawn'
        @staticmethod
        def _Popen(process_obj):
            from .popen_spawn_win32 import Popen
            return Popen(process_obj)

    class SpawnContext(BaseContext):
        _name = 'spawn'
        Process = SpawnProcess

    _concrete_contexts = {
        'spawn': SpawnContext(),
    }
    _default_context = DefaultContext(_concrete_contexts['spawn'])

#
# Force the start method
#

def _force_start_method(method):
    _default_context._actual_context = _concrete_contexts[method]

#
# Check that the current thread is spawning a child process
#

_tls = threading.local()

def get_spawning_popen():
    return getattr(_tls, 'spawning_popen', None)

def set_spawning_popen(popen):
    _tls.spawning_popen = popen

def assert_spawning(obj):
    if get_spawning_popen() is None:
        raise RuntimeError(
            '%s objects should only be shared between processes'
            ' through inheritance' % type(obj).__name__
            )
multiprocessing/managers.py000064400000137425151153537440012166 0ustar00#
# Module providing manager classes for dealing
# with shared objects
#
# multiprocessing/managers.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#

__all__ = [ 'BaseManager', 'SyncManager', 'BaseProxy', 'Token',
            'SharedMemoryManager' ]

#
# Imports
#

import sys
import threading
import signal
import array
import queue
import time
import os
from os import getpid

from traceback import format_exc

from . import connection
from .context import reduction, get_spawning_popen, ProcessError
from . import pool
from . import process
from . import util
from . import get_context
try:
    from . import shared_memory
    HAS_SHMEM = True
except ImportError:
    HAS_SHMEM = False

#
# Register some things for pickling
#

def reduce_array(a):
    return array.array, (a.typecode, a.tobytes())
reduction.register(array.array, reduce_array)

view_types = [type(getattr({}, name)()) for name in ('items','keys','values')]
if view_types[0] is not list:       # only needed in Py3.0
    def rebuild_as_list(obj):
        return list, (list(obj),)
    for view_type in view_types:
        reduction.register(view_type, rebuild_as_list)

#
# Type for identifying shared objects
#

class Token(object):
    '''
    Type to uniquely identify a shared object
    '''
    __slots__ = ('typeid', 'address', 'id')

    def __init__(self, typeid, address, id):
        (self.typeid, self.address, self.id) = (typeid, address, id)

    def __getstate__(self):
        return (self.typeid, self.address, self.id)

    def __setstate__(self, state):
        (self.typeid, self.address, self.id) = state

    def __repr__(self):
        return '%s(typeid=%r, address=%r, id=%r)' % \
               (self.__class__.__name__, self.typeid, self.address, self.id)

#
# Function for communication with a manager's server process
#

def dispatch(c, id, methodname, args=(), kwds={}):
    '''
    Send a message to manager using connection `c` and return response
    '''
    c.send((id, methodname, args, kwds))
    kind, result = c.recv()
    if kind == '#RETURN':
        return result
    raise convert_to_error(kind, result)

def convert_to_error(kind, result):
    if kind == '#ERROR':
        return result
    elif kind in ('#TRACEBACK', '#UNSERIALIZABLE'):
        if not isinstance(result, str):
            raise TypeError(
                "Result {0!r} (kind '{1}') type is {2}, not str".format(
                    result, kind, type(result)))
        if kind == '#UNSERIALIZABLE':
            return RemoteError('Unserializable message: %s\n' % result)
        else:
            return RemoteError(result)
    else:
        return ValueError('Unrecognized message type {!r}'.format(kind))

class RemoteError(Exception):
    def __str__(self):
        return ('\n' + '-'*75 + '\n' + str(self.args[0]) + '-'*75)

#
# Functions for finding the method names of an object
#

def all_methods(obj):
    '''
    Return a list of names of methods of `obj`
    '''
    temp = []
    for name in dir(obj):
        func = getattr(obj, name)
        if callable(func):
            temp.append(name)
    return temp

def public_methods(obj):
    '''
    Return a list of names of methods of `obj` which do not start with '_'
    '''
    return [name for name in all_methods(obj) if name[0] != '_']

#
# Server which is run in a process controlled by a manager
#

class Server(object):
    '''
    Server class which runs in a process controlled by a manager object
    '''
    public = ['shutdown', 'create', 'accept_connection', 'get_methods',
              'debug_info', 'number_of_objects', 'dummy', 'incref', 'decref']

    def __init__(self, registry, address, authkey, serializer):
        if not isinstance(authkey, bytes):
            raise TypeError(
                "Authkey {0!r} is type {1!s}, not bytes".format(
                    authkey, type(authkey)))
        self.registry = registry
        self.authkey = process.AuthenticationString(authkey)
        Listener, Client = listener_client[serializer]

        # do authentication later
        self.listener = Listener(address=address, backlog=16)
        self.address = self.listener.address

        self.id_to_obj = {'0': (None, ())}
        self.id_to_refcount = {}
        self.id_to_local_proxy_obj = {}
        self.mutex = threading.Lock()

    def serve_forever(self):
        '''
        Run the server forever
        '''
        self.stop_event = threading.Event()
        process.current_process()._manager_server = self
        try:
            accepter = threading.Thread(target=self.accepter)
            accepter.daemon = True
            accepter.start()
            try:
                while not self.stop_event.is_set():
                    self.stop_event.wait(1)
            except (KeyboardInterrupt, SystemExit):
                pass
        finally:
            if sys.stdout != sys.__stdout__: # what about stderr?
                util.debug('resetting stdout, stderr')
                sys.stdout = sys.__stdout__
                sys.stderr = sys.__stderr__
            sys.exit(0)

    def accepter(self):
        while True:
            try:
                c = self.listener.accept()
            except OSError:
                continue
            t = threading.Thread(target=self.handle_request, args=(c,))
            t.daemon = True
            t.start()

    def handle_request(self, c):
        '''
        Handle a new connection
        '''
        funcname = result = request = None
        try:
            connection.deliver_challenge(c, self.authkey)
            connection.answer_challenge(c, self.authkey)
            request = c.recv()
            ignore, funcname, args, kwds = request
            assert funcname in self.public, '%r unrecognized' % funcname
            func = getattr(self, funcname)
        except Exception:
            msg = ('#TRACEBACK', format_exc())
        else:
            try:
                result = func(c, *args, **kwds)
            except Exception:
                msg = ('#TRACEBACK', format_exc())
            else:
                msg = ('#RETURN', result)
        try:
            c.send(msg)
        except Exception as e:
            try:
                c.send(('#TRACEBACK', format_exc()))
            except Exception:
                pass
            util.info('Failure to send message: %r', msg)
            util.info(' ... request was %r', request)
            util.info(' ... exception was %r', e)

        c.close()

    def serve_client(self, conn):
        '''
        Handle requests from the proxies in a particular process/thread
        '''
        util.debug('starting server thread to service %r',
                   threading.current_thread().name)

        recv = conn.recv
        send = conn.send
        id_to_obj = self.id_to_obj

        while not self.stop_event.is_set():

            try:
                methodname = obj = None
                request = recv()
                ident, methodname, args, kwds = request
                try:
                    obj, exposed, gettypeid = id_to_obj[ident]
                except KeyError as ke:
                    try:
                        obj, exposed, gettypeid = \
                            self.id_to_local_proxy_obj[ident]
                    except KeyError as second_ke:
                        raise ke

                if methodname not in exposed:
                    raise AttributeError(
                        'method %r of %r object is not in exposed=%r' %
                        (methodname, type(obj), exposed)
                        )

                function = getattr(obj, methodname)

                try:
                    res = function(*args, **kwds)
                except Exception as e:
                    msg = ('#ERROR', e)
                else:
                    typeid = gettypeid and gettypeid.get(methodname, None)
                    if typeid:
                        rident, rexposed = self.create(conn, typeid, res)
                        token = Token(typeid, self.address, rident)
                        msg = ('#PROXY', (rexposed, token))
                    else:
                        msg = ('#RETURN', res)

            except AttributeError:
                if methodname is None:
                    msg = ('#TRACEBACK', format_exc())
                else:
                    try:
                        fallback_func = self.fallback_mapping[methodname]
                        result = fallback_func(
                            self, conn, ident, obj, *args, **kwds
                            )
                        msg = ('#RETURN', result)
                    except Exception:
                        msg = ('#TRACEBACK', format_exc())

            except EOFError:
                util.debug('got EOF -- exiting thread serving %r',
                           threading.current_thread().name)
                sys.exit(0)

            except Exception:
                msg = ('#TRACEBACK', format_exc())

            try:
                try:
                    send(msg)
                except Exception as e:
                    send(('#UNSERIALIZABLE', format_exc()))
            except Exception as e:
                util.info('exception in thread serving %r',
                        threading.current_thread().name)
                util.info(' ... message was %r', msg)
                util.info(' ... exception was %r', e)
                conn.close()
                sys.exit(1)

    def fallback_getvalue(self, conn, ident, obj):
        return obj

    def fallback_str(self, conn, ident, obj):
        return str(obj)

    def fallback_repr(self, conn, ident, obj):
        return repr(obj)

    fallback_mapping = {
        '__str__':fallback_str,
        '__repr__':fallback_repr,
        '#GETVALUE':fallback_getvalue
        }

    def dummy(self, c):
        pass

    def debug_info(self, c):
        '''
        Return some info --- useful to spot problems with refcounting
        '''
        # Perhaps include debug info about 'c'?
        with self.mutex:
            result = []
            keys = list(self.id_to_refcount.keys())
            keys.sort()
            for ident in keys:
                if ident != '0':
                    result.append('  %s:       refcount=%s\n    %s' %
                                  (ident, self.id_to_refcount[ident],
                                   str(self.id_to_obj[ident][0])[:75]))
            return '\n'.join(result)

    def number_of_objects(self, c):
        '''
        Number of shared objects
        '''
        # Doesn't use (len(self.id_to_obj) - 1) as we shouldn't count ident='0'
        return len(self.id_to_refcount)

    def shutdown(self, c):
        '''
        Shutdown this process
        '''
        try:
            util.debug('manager received shutdown message')
            c.send(('#RETURN', None))
        except:
            import traceback
            traceback.print_exc()
        finally:
            self.stop_event.set()

    def create(*args, **kwds):
        '''
        Create a new shared object and return its id
        '''
        if len(args) >= 3:
            self, c, typeid, *args = args
        elif not args:
            raise TypeError("descriptor 'create' of 'Server' object "
                            "needs an argument")
        else:
            if 'typeid' not in kwds:
                raise TypeError('create expected at least 2 positional '
                                'arguments, got %d' % (len(args)-1))
            typeid = kwds.pop('typeid')
            if len(args) >= 2:
                self, c, *args = args
                import warnings
                warnings.warn("Passing 'typeid' as keyword argument is deprecated",
                              DeprecationWarning, stacklevel=2)
            else:
                if 'c' not in kwds:
                    raise TypeError('create expected at least 2 positional '
                                    'arguments, got %d' % (len(args)-1))
                c = kwds.pop('c')
                self, *args = args
                import warnings
                warnings.warn("Passing 'c' as keyword argument is deprecated",
                              DeprecationWarning, stacklevel=2)
        args = tuple(args)

        with self.mutex:
            callable, exposed, method_to_typeid, proxytype = \
                      self.registry[typeid]

            if callable is None:
                if kwds or (len(args) != 1):
                    raise ValueError(
                        "Without callable, must have one non-keyword argument")
                obj = args[0]
            else:
                obj = callable(*args, **kwds)

            if exposed is None:
                exposed = public_methods(obj)
            if method_to_typeid is not None:
                if not isinstance(method_to_typeid, dict):
                    raise TypeError(
                        "Method_to_typeid {0!r}: type {1!s}, not dict".format(
                            method_to_typeid, type(method_to_typeid)))
                exposed = list(exposed) + list(method_to_typeid)

            ident = '%x' % id(obj)  # convert to string because xmlrpclib
                                    # only has 32 bit signed integers
            util.debug('%r callable returned object with id %r', typeid, ident)

            self.id_to_obj[ident] = (obj, set(exposed), method_to_typeid)
            if ident not in self.id_to_refcount:
                self.id_to_refcount[ident] = 0

        self.incref(c, ident)
        return ident, tuple(exposed)
    create.__text_signature__ = '($self, c, typeid, /, *args, **kwds)'

    def get_methods(self, c, token):
        '''
        Return the methods of the shared object indicated by token
        '''
        return tuple(self.id_to_obj[token.id][1])

    def accept_connection(self, c, name):
        '''
        Spawn a new thread to serve this connection
        '''
        threading.current_thread().name = name
        c.send(('#RETURN', None))
        self.serve_client(c)

    def incref(self, c, ident):
        with self.mutex:
            try:
                self.id_to_refcount[ident] += 1
            except KeyError as ke:
                # If no external references exist but an internal (to the
                # manager) still does and a new external reference is created
                # from it, restore the manager's tracking of it from the
                # previously stashed internal ref.
                if ident in self.id_to_local_proxy_obj:
                    self.id_to_refcount[ident] = 1
                    self.id_to_obj[ident] = \
                        self.id_to_local_proxy_obj[ident]
                    obj, exposed, gettypeid = self.id_to_obj[ident]
                    util.debug('Server re-enabled tracking & INCREF %r', ident)
                else:
                    raise ke

    def decref(self, c, ident):
        if ident not in self.id_to_refcount and \
            ident in self.id_to_local_proxy_obj:
            util.debug('Server DECREF skipping %r', ident)
            return

        with self.mutex:
            if self.id_to_refcount[ident] <= 0:
                raise AssertionError(
                    "Id {0!s} ({1!r}) has refcount {2:n}, not 1+".format(
                        ident, self.id_to_obj[ident],
                        self.id_to_refcount[ident]))
            self.id_to_refcount[ident] -= 1
            if self.id_to_refcount[ident] == 0:
                del self.id_to_refcount[ident]

        if ident not in self.id_to_refcount:
            # Two-step process in case the object turns out to contain other
            # proxy objects (e.g. a managed list of managed lists).
            # Otherwise, deleting self.id_to_obj[ident] would trigger the
            # deleting of the stored value (another managed object) which would
            # in turn attempt to acquire the mutex that is already held here.
            self.id_to_obj[ident] = (None, (), None)  # thread-safe
            util.debug('disposing of obj with id %r', ident)
            with self.mutex:
                del self.id_to_obj[ident]


#
# Class to represent state of a manager
#

class State(object):
    __slots__ = ['value']
    INITIAL = 0
    STARTED = 1
    SHUTDOWN = 2

#
# Mapping from serializer name to Listener and Client types
#

listener_client = {
    'pickle' : (connection.Listener, connection.Client),
    'xmlrpclib' : (connection.XmlListener, connection.XmlClient)
    }

#
# Definition of BaseManager
#

class BaseManager(object):
    '''
    Base class for managers
    '''
    _registry = {}
    _Server = Server

    def __init__(self, address=None, authkey=None, serializer='pickle',
                 ctx=None):
        if authkey is None:
            authkey = process.current_process().authkey
        self._address = address     # XXX not final address if eg ('', 0)
        self._authkey = process.AuthenticationString(authkey)
        self._state = State()
        self._state.value = State.INITIAL
        self._serializer = serializer
        self._Listener, self._Client = listener_client[serializer]
        self._ctx = ctx or get_context()

    def get_server(self):
        '''
        Return server object with serve_forever() method and address attribute
        '''
        if self._state.value != State.INITIAL:
            if self._state.value == State.STARTED:
                raise ProcessError("Already started server")
            elif self._state.value == State.SHUTDOWN:
                raise ProcessError("Manager has shut down")
            else:
                raise ProcessError(
                    "Unknown state {!r}".format(self._state.value))
        return Server(self._registry, self._address,
                      self._authkey, self._serializer)

    def connect(self):
        '''
        Connect manager object to the server process
        '''
        Listener, Client = listener_client[self._serializer]
        conn = Client(self._address, authkey=self._authkey)
        dispatch(conn, None, 'dummy')
        self._state.value = State.STARTED

    def start(self, initializer=None, initargs=()):
        '''
        Spawn a server process for this manager object
        '''
        if self._state.value != State.INITIAL:
            if self._state.value == State.STARTED:
                raise ProcessError("Already started server")
            elif self._state.value == State.SHUTDOWN:
                raise ProcessError("Manager has shut down")
            else:
                raise ProcessError(
                    "Unknown state {!r}".format(self._state.value))

        if initializer is not None and not callable(initializer):
            raise TypeError('initializer must be a callable')

        # pipe over which we will retrieve address of server
        reader, writer = connection.Pipe(duplex=False)

        # spawn process which runs a server
        self._process = self._ctx.Process(
            target=type(self)._run_server,
            args=(self._registry, self._address, self._authkey,
                  self._serializer, writer, initializer, initargs),
            )
        ident = ':'.join(str(i) for i in self._process._identity)
        self._process.name = type(self).__name__  + '-' + ident
        self._process.start()

        # get address of server
        writer.close()
        self._address = reader.recv()
        reader.close()

        # register a finalizer
        self._state.value = State.STARTED
        self.shutdown = util.Finalize(
            self, type(self)._finalize_manager,
            args=(self._process, self._address, self._authkey,
                  self._state, self._Client),
            exitpriority=0
            )

    @classmethod
    def _run_server(cls, registry, address, authkey, serializer, writer,
                    initializer=None, initargs=()):
        '''
        Create a server, report its address and run it
        '''
        # bpo-36368: protect server process from KeyboardInterrupt signals
        signal.signal(signal.SIGINT, signal.SIG_IGN)

        if initializer is not None:
            initializer(*initargs)

        # create server
        server = cls._Server(registry, address, authkey, serializer)

        # inform parent process of the server's address
        writer.send(server.address)
        writer.close()

        # run the manager
        util.info('manager serving at %r', server.address)
        server.serve_forever()

    def _create(self, typeid, /, *args, **kwds):
        '''
        Create a new shared object; return the token and exposed tuple
        '''
        assert self._state.value == State.STARTED, 'server not yet started'
        conn = self._Client(self._address, authkey=self._authkey)
        try:
            id, exposed = dispatch(conn, None, 'create', (typeid,)+args, kwds)
        finally:
            conn.close()
        return Token(typeid, self._address, id), exposed

    def join(self, timeout=None):
        '''
        Join the manager process (if it has been spawned)
        '''
        if self._process is not None:
            self._process.join(timeout)
            if not self._process.is_alive():
                self._process = None

    def _debug_info(self):
        '''
        Return some info about the servers shared objects and connections
        '''
        conn = self._Client(self._address, authkey=self._authkey)
        try:
            return dispatch(conn, None, 'debug_info')
        finally:
            conn.close()

    def _number_of_objects(self):
        '''
        Return the number of shared objects
        '''
        conn = self._Client(self._address, authkey=self._authkey)
        try:
            return dispatch(conn, None, 'number_of_objects')
        finally:
            conn.close()

    def __enter__(self):
        if self._state.value == State.INITIAL:
            self.start()
        if self._state.value != State.STARTED:
            if self._state.value == State.INITIAL:
                raise ProcessError("Unable to start server")
            elif self._state.value == State.SHUTDOWN:
                raise ProcessError("Manager has shut down")
            else:
                raise ProcessError(
                    "Unknown state {!r}".format(self._state.value))
        return self

    def __exit__(self, exc_type, exc_val, exc_tb):
        self.shutdown()

    @staticmethod
    def _finalize_manager(process, address, authkey, state, _Client):
        '''
        Shutdown the manager process; will be registered as a finalizer
        '''
        if process.is_alive():
            util.info('sending shutdown message to manager')
            try:
                conn = _Client(address, authkey=authkey)
                try:
                    dispatch(conn, None, 'shutdown')
                finally:
                    conn.close()
            except Exception:
                pass

            process.join(timeout=1.0)
            if process.is_alive():
                util.info('manager still alive')
                if hasattr(process, 'terminate'):
                    util.info('trying to `terminate()` manager process')
                    process.terminate()
                    process.join(timeout=0.1)
                    if process.is_alive():
                        util.info('manager still alive after terminate')

        state.value = State.SHUTDOWN
        try:
            del BaseProxy._address_to_local[address]
        except KeyError:
            pass

    @property
    def address(self):
        return self._address

    @classmethod
    def register(cls, typeid, callable=None, proxytype=None, exposed=None,
                 method_to_typeid=None, create_method=True):
        '''
        Register a typeid with the manager type
        '''
        if '_registry' not in cls.__dict__:
            cls._registry = cls._registry.copy()

        if proxytype is None:
            proxytype = AutoProxy

        exposed = exposed or getattr(proxytype, '_exposed_', None)

        method_to_typeid = method_to_typeid or \
                           getattr(proxytype, '_method_to_typeid_', None)

        if method_to_typeid:
            for key, value in list(method_to_typeid.items()): # isinstance?
                assert type(key) is str, '%r is not a string' % key
                assert type(value) is str, '%r is not a string' % value

        cls._registry[typeid] = (
            callable, exposed, method_to_typeid, proxytype
            )

        if create_method:
            def temp(self, /, *args, **kwds):
                util.debug('requesting creation of a shared %r object', typeid)
                token, exp = self._create(typeid, *args, **kwds)
                proxy = proxytype(
                    token, self._serializer, manager=self,
                    authkey=self._authkey, exposed=exp
                    )
                conn = self._Client(token.address, authkey=self._authkey)
                dispatch(conn, None, 'decref', (token.id,))
                return proxy
            temp.__name__ = typeid
            setattr(cls, typeid, temp)

#
# Subclass of set which get cleared after a fork
#

class ProcessLocalSet(set):
    def __init__(self):
        util.register_after_fork(self, lambda obj: obj.clear())
    def __reduce__(self):
        return type(self), ()

#
# Definition of BaseProxy
#

class BaseProxy(object):
    '''
    A base for proxies of shared objects
    '''
    _address_to_local = {}
    _mutex = util.ForkAwareThreadLock()

    def __init__(self, token, serializer, manager=None,
                 authkey=None, exposed=None, incref=True, manager_owned=False):
        with BaseProxy._mutex:
            tls_idset = BaseProxy._address_to_local.get(token.address, None)
            if tls_idset is None:
                tls_idset = util.ForkAwareLocal(), ProcessLocalSet()
                BaseProxy._address_to_local[token.address] = tls_idset

        # self._tls is used to record the connection used by this
        # thread to communicate with the manager at token.address
        self._tls = tls_idset[0]

        # self._idset is used to record the identities of all shared
        # objects for which the current process owns references and
        # which are in the manager at token.address
        self._idset = tls_idset[1]

        self._token = token
        self._id = self._token.id
        self._manager = manager
        self._serializer = serializer
        self._Client = listener_client[serializer][1]

        # Should be set to True only when a proxy object is being created
        # on the manager server; primary use case: nested proxy objects.
        # RebuildProxy detects when a proxy is being created on the manager
        # and sets this value appropriately.
        self._owned_by_manager = manager_owned

        if authkey is not None:
            self._authkey = process.AuthenticationString(authkey)
        elif self._manager is not None:
            self._authkey = self._manager._authkey
        else:
            self._authkey = process.current_process().authkey

        if incref:
            self._incref()

        util.register_after_fork(self, BaseProxy._after_fork)

    def _connect(self):
        util.debug('making connection to manager')
        name = process.current_process().name
        if threading.current_thread().name != 'MainThread':
            name += '|' + threading.current_thread().name
        conn = self._Client(self._token.address, authkey=self._authkey)
        dispatch(conn, None, 'accept_connection', (name,))
        self._tls.connection = conn

    def _callmethod(self, methodname, args=(), kwds={}):
        '''
        Try to call a method of the referent and return a copy of the result
        '''
        try:
            conn = self._tls.connection
        except AttributeError:
            util.debug('thread %r does not own a connection',
                       threading.current_thread().name)
            self._connect()
            conn = self._tls.connection

        conn.send((self._id, methodname, args, kwds))
        kind, result = conn.recv()

        if kind == '#RETURN':
            return result
        elif kind == '#PROXY':
            exposed, token = result
            proxytype = self._manager._registry[token.typeid][-1]
            token.address = self._token.address
            proxy = proxytype(
                token, self._serializer, manager=self._manager,
                authkey=self._authkey, exposed=exposed
                )
            conn = self._Client(token.address, authkey=self._authkey)
            dispatch(conn, None, 'decref', (token.id,))
            return proxy
        raise convert_to_error(kind, result)

    def _getvalue(self):
        '''
        Get a copy of the value of the referent
        '''
        return self._callmethod('#GETVALUE')

    def _incref(self):
        if self._owned_by_manager:
            util.debug('owned_by_manager skipped INCREF of %r', self._token.id)
            return

        conn = self._Client(self._token.address, authkey=self._authkey)
        dispatch(conn, None, 'incref', (self._id,))
        util.debug('INCREF %r', self._token.id)

        self._idset.add(self._id)

        state = self._manager and self._manager._state

        self._close = util.Finalize(
            self, BaseProxy._decref,
            args=(self._token, self._authkey, state,
                  self._tls, self._idset, self._Client),
            exitpriority=10
            )

    @staticmethod
    def _decref(token, authkey, state, tls, idset, _Client):
        idset.discard(token.id)

        # check whether manager is still alive
        if state is None or state.value == State.STARTED:
            # tell manager this process no longer cares about referent
            try:
                util.debug('DECREF %r', token.id)
                conn = _Client(token.address, authkey=authkey)
                dispatch(conn, None, 'decref', (token.id,))
            except Exception as e:
                util.debug('... decref failed %s', e)

        else:
            util.debug('DECREF %r -- manager already shutdown', token.id)

        # check whether we can close this thread's connection because
        # the process owns no more references to objects for this manager
        if not idset and hasattr(tls, 'connection'):
            util.debug('thread %r has no more proxies so closing conn',
                       threading.current_thread().name)
            tls.connection.close()
            del tls.connection

    def _after_fork(self):
        self._manager = None
        try:
            self._incref()
        except Exception as e:
            # the proxy may just be for a manager which has shutdown
            util.info('incref failed: %s' % e)

    def __reduce__(self):
        kwds = {}
        if get_spawning_popen() is not None:
            kwds['authkey'] = self._authkey

        if getattr(self, '_isauto', False):
            kwds['exposed'] = self._exposed_
            return (RebuildProxy,
                    (AutoProxy, self._token, self._serializer, kwds))
        else:
            return (RebuildProxy,
                    (type(self), self._token, self._serializer, kwds))

    def __deepcopy__(self, memo):
        return self._getvalue()

    def __repr__(self):
        return '<%s object, typeid %r at %#x>' % \
               (type(self).__name__, self._token.typeid, id(self))

    def __str__(self):
        '''
        Return representation of the referent (or a fall-back if that fails)
        '''
        try:
            return self._callmethod('__repr__')
        except Exception:
            return repr(self)[:-1] + "; '__str__()' failed>"

#
# Function used for unpickling
#

def RebuildProxy(func, token, serializer, kwds):
    '''
    Function used for unpickling proxy objects.
    '''
    server = getattr(process.current_process(), '_manager_server', None)
    if server and server.address == token.address:
        util.debug('Rebuild a proxy owned by manager, token=%r', token)
        kwds['manager_owned'] = True
        if token.id not in server.id_to_local_proxy_obj:
            server.id_to_local_proxy_obj[token.id] = \
                server.id_to_obj[token.id]
    incref = (
        kwds.pop('incref', True) and
        not getattr(process.current_process(), '_inheriting', False)
        )
    return func(token, serializer, incref=incref, **kwds)

#
# Functions to create proxies and proxy types
#

def MakeProxyType(name, exposed, _cache={}):
    '''
    Return a proxy type whose methods are given by `exposed`
    '''
    exposed = tuple(exposed)
    try:
        return _cache[(name, exposed)]
    except KeyError:
        pass

    dic = {}

    for meth in exposed:
        exec('''def %s(self, /, *args, **kwds):
        return self._callmethod(%r, args, kwds)''' % (meth, meth), dic)

    ProxyType = type(name, (BaseProxy,), dic)
    ProxyType._exposed_ = exposed
    _cache[(name, exposed)] = ProxyType
    return ProxyType


def AutoProxy(token, serializer, manager=None, authkey=None,
              exposed=None, incref=True):
    '''
    Return an auto-proxy for `token`
    '''
    _Client = listener_client[serializer][1]

    if exposed is None:
        conn = _Client(token.address, authkey=authkey)
        try:
            exposed = dispatch(conn, None, 'get_methods', (token,))
        finally:
            conn.close()

    if authkey is None and manager is not None:
        authkey = manager._authkey
    if authkey is None:
        authkey = process.current_process().authkey

    ProxyType = MakeProxyType('AutoProxy[%s]' % token.typeid, exposed)
    proxy = ProxyType(token, serializer, manager=manager, authkey=authkey,
                      incref=incref)
    proxy._isauto = True
    return proxy

#
# Types/callables which we will register with SyncManager
#

class Namespace(object):
    def __init__(self, /, **kwds):
        self.__dict__.update(kwds)
    def __repr__(self):
        items = list(self.__dict__.items())
        temp = []
        for name, value in items:
            if not name.startswith('_'):
                temp.append('%s=%r' % (name, value))
        temp.sort()
        return '%s(%s)' % (self.__class__.__name__, ', '.join(temp))

class Value(object):
    def __init__(self, typecode, value, lock=True):
        self._typecode = typecode
        self._value = value
    def get(self):
        return self._value
    def set(self, value):
        self._value = value
    def __repr__(self):
        return '%s(%r, %r)'%(type(self).__name__, self._typecode, self._value)
    value = property(get, set)

def Array(typecode, sequence, lock=True):
    return array.array(typecode, sequence)

#
# Proxy types used by SyncManager
#

class IteratorProxy(BaseProxy):
    _exposed_ = ('__next__', 'send', 'throw', 'close')
    def __iter__(self):
        return self
    def __next__(self, *args):
        return self._callmethod('__next__', args)
    def send(self, *args):
        return self._callmethod('send', args)
    def throw(self, *args):
        return self._callmethod('throw', args)
    def close(self, *args):
        return self._callmethod('close', args)


class AcquirerProxy(BaseProxy):
    _exposed_ = ('acquire', 'release')
    def acquire(self, blocking=True, timeout=None):
        args = (blocking,) if timeout is None else (blocking, timeout)
        return self._callmethod('acquire', args)
    def release(self):
        return self._callmethod('release')
    def __enter__(self):
        return self._callmethod('acquire')
    def __exit__(self, exc_type, exc_val, exc_tb):
        return self._callmethod('release')


class ConditionProxy(AcquirerProxy):
    _exposed_ = ('acquire', 'release', 'wait', 'notify', 'notify_all')
    def wait(self, timeout=None):
        return self._callmethod('wait', (timeout,))
    def notify(self, n=1):
        return self._callmethod('notify', (n,))
    def notify_all(self):
        return self._callmethod('notify_all')
    def wait_for(self, predicate, timeout=None):
        result = predicate()
        if result:
            return result
        if timeout is not None:
            endtime = time.monotonic() + timeout
        else:
            endtime = None
            waittime = None
        while not result:
            if endtime is not None:
                waittime = endtime - time.monotonic()
                if waittime <= 0:
                    break
            self.wait(waittime)
            result = predicate()
        return result


class EventProxy(BaseProxy):
    _exposed_ = ('is_set', 'set', 'clear', 'wait')
    def is_set(self):
        return self._callmethod('is_set')
    def set(self):
        return self._callmethod('set')
    def clear(self):
        return self._callmethod('clear')
    def wait(self, timeout=None):
        return self._callmethod('wait', (timeout,))


class BarrierProxy(BaseProxy):
    _exposed_ = ('__getattribute__', 'wait', 'abort', 'reset')
    def wait(self, timeout=None):
        return self._callmethod('wait', (timeout,))
    def abort(self):
        return self._callmethod('abort')
    def reset(self):
        return self._callmethod('reset')
    @property
    def parties(self):
        return self._callmethod('__getattribute__', ('parties',))
    @property
    def n_waiting(self):
        return self._callmethod('__getattribute__', ('n_waiting',))
    @property
    def broken(self):
        return self._callmethod('__getattribute__', ('broken',))


class NamespaceProxy(BaseProxy):
    _exposed_ = ('__getattribute__', '__setattr__', '__delattr__')
    def __getattr__(self, key):
        if key[0] == '_':
            return object.__getattribute__(self, key)
        callmethod = object.__getattribute__(self, '_callmethod')
        return callmethod('__getattribute__', (key,))
    def __setattr__(self, key, value):
        if key[0] == '_':
            return object.__setattr__(self, key, value)
        callmethod = object.__getattribute__(self, '_callmethod')
        return callmethod('__setattr__', (key, value))
    def __delattr__(self, key):
        if key[0] == '_':
            return object.__delattr__(self, key)
        callmethod = object.__getattribute__(self, '_callmethod')
        return callmethod('__delattr__', (key,))


class ValueProxy(BaseProxy):
    _exposed_ = ('get', 'set')
    def get(self):
        return self._callmethod('get')
    def set(self, value):
        return self._callmethod('set', (value,))
    value = property(get, set)


BaseListProxy = MakeProxyType('BaseListProxy', (
    '__add__', '__contains__', '__delitem__', '__getitem__', '__len__',
    '__mul__', '__reversed__', '__rmul__', '__setitem__',
    'append', 'count', 'extend', 'index', 'insert', 'pop', 'remove',
    'reverse', 'sort', '__imul__'
    ))
class ListProxy(BaseListProxy):
    def __iadd__(self, value):
        self._callmethod('extend', (value,))
        return self
    def __imul__(self, value):
        self._callmethod('__imul__', (value,))
        return self


DictProxy = MakeProxyType('DictProxy', (
    '__contains__', '__delitem__', '__getitem__', '__iter__', '__len__',
    '__setitem__', 'clear', 'copy', 'get', 'items',
    'keys', 'pop', 'popitem', 'setdefault', 'update', 'values'
    ))
DictProxy._method_to_typeid_ = {
    '__iter__': 'Iterator',
    }


ArrayProxy = MakeProxyType('ArrayProxy', (
    '__len__', '__getitem__', '__setitem__'
    ))


BasePoolProxy = MakeProxyType('PoolProxy', (
    'apply', 'apply_async', 'close', 'imap', 'imap_unordered', 'join',
    'map', 'map_async', 'starmap', 'starmap_async', 'terminate',
    ))
BasePoolProxy._method_to_typeid_ = {
    'apply_async': 'AsyncResult',
    'map_async': 'AsyncResult',
    'starmap_async': 'AsyncResult',
    'imap': 'Iterator',
    'imap_unordered': 'Iterator'
    }
class PoolProxy(BasePoolProxy):
    def __enter__(self):
        return self
    def __exit__(self, exc_type, exc_val, exc_tb):
        self.terminate()

#
# Definition of SyncManager
#

class SyncManager(BaseManager):
    '''
    Subclass of `BaseManager` which supports a number of shared object types.

    The types registered are those intended for the synchronization
    of threads, plus `dict`, `list` and `Namespace`.

    The `multiprocessing.Manager()` function creates started instances of
    this class.
    '''

SyncManager.register('Queue', queue.Queue)
SyncManager.register('JoinableQueue', queue.Queue)
SyncManager.register('Event', threading.Event, EventProxy)
SyncManager.register('Lock', threading.Lock, AcquirerProxy)
SyncManager.register('RLock', threading.RLock, AcquirerProxy)
SyncManager.register('Semaphore', threading.Semaphore, AcquirerProxy)
SyncManager.register('BoundedSemaphore', threading.BoundedSemaphore,
                     AcquirerProxy)
SyncManager.register('Condition', threading.Condition, ConditionProxy)
SyncManager.register('Barrier', threading.Barrier, BarrierProxy)
SyncManager.register('Pool', pool.Pool, PoolProxy)
SyncManager.register('list', list, ListProxy)
SyncManager.register('dict', dict, DictProxy)
SyncManager.register('Value', Value, ValueProxy)
SyncManager.register('Array', Array, ArrayProxy)
SyncManager.register('Namespace', Namespace, NamespaceProxy)

# types returned by methods of PoolProxy
SyncManager.register('Iterator', proxytype=IteratorProxy, create_method=False)
SyncManager.register('AsyncResult', create_method=False)

#
# Definition of SharedMemoryManager and SharedMemoryServer
#

if HAS_SHMEM:
    class _SharedMemoryTracker:
        "Manages one or more shared memory segments."

        def __init__(self, name, segment_names=[]):
            self.shared_memory_context_name = name
            self.segment_names = segment_names

        def register_segment(self, segment_name):
            "Adds the supplied shared memory block name to tracker."
            util.debug(f"Register segment {segment_name!r} in pid {getpid()}")
            self.segment_names.append(segment_name)

        def destroy_segment(self, segment_name):
            """Calls unlink() on the shared memory block with the supplied name
            and removes it from the list of blocks being tracked."""
            util.debug(f"Destroy segment {segment_name!r} in pid {getpid()}")
            self.segment_names.remove(segment_name)
            segment = shared_memory.SharedMemory(segment_name)
            segment.close()
            segment.unlink()

        def unlink(self):
            "Calls destroy_segment() on all tracked shared memory blocks."
            for segment_name in self.segment_names[:]:
                self.destroy_segment(segment_name)

        def __del__(self):
            util.debug(f"Call {self.__class__.__name__}.__del__ in {getpid()}")
            self.unlink()

        def __getstate__(self):
            return (self.shared_memory_context_name, self.segment_names)

        def __setstate__(self, state):
            self.__init__(*state)


    class SharedMemoryServer(Server):

        public = Server.public + \
                 ['track_segment', 'release_segment', 'list_segments']

        def __init__(self, *args, **kwargs):
            Server.__init__(self, *args, **kwargs)
            address = self.address
            # The address of Linux abstract namespaces can be bytes
            if isinstance(address, bytes):
                address = os.fsdecode(address)
            self.shared_memory_context = \
                _SharedMemoryTracker(f"shm_{address}_{getpid()}")
            util.debug(f"SharedMemoryServer started by pid {getpid()}")

        def create(*args, **kwargs):
            """Create a new distributed-shared object (not backed by a shared
            memory block) and return its id to be used in a Proxy Object."""
            # Unless set up as a shared proxy, don't make shared_memory_context
            # a standard part of kwargs.  This makes things easier for supplying
            # simple functions.
            if len(args) >= 3:
                typeod = args[2]
            elif 'typeid' in kwargs:
                typeid = kwargs['typeid']
            elif not args:
                raise TypeError("descriptor 'create' of 'SharedMemoryServer' "
                                "object needs an argument")
            else:
                raise TypeError('create expected at least 2 positional '
                                'arguments, got %d' % (len(args)-1))
            if hasattr(self.registry[typeid][-1], "_shared_memory_proxy"):
                kwargs['shared_memory_context'] = self.shared_memory_context
            return Server.create(*args, **kwargs)
        create.__text_signature__ = '($self, c, typeid, /, *args, **kwargs)'

        def shutdown(self, c):
            "Call unlink() on all tracked shared memory, terminate the Server."
            self.shared_memory_context.unlink()
            return Server.shutdown(self, c)

        def track_segment(self, c, segment_name):
            "Adds the supplied shared memory block name to Server's tracker."
            self.shared_memory_context.register_segment(segment_name)

        def release_segment(self, c, segment_name):
            """Calls unlink() on the shared memory block with the supplied name
            and removes it from the tracker instance inside the Server."""
            self.shared_memory_context.destroy_segment(segment_name)

        def list_segments(self, c):
            """Returns a list of names of shared memory blocks that the Server
            is currently tracking."""
            return self.shared_memory_context.segment_names


    class SharedMemoryManager(BaseManager):
        """Like SyncManager but uses SharedMemoryServer instead of Server.

        It provides methods for creating and returning SharedMemory instances
        and for creating a list-like object (ShareableList) backed by shared
        memory.  It also provides methods that create and return Proxy Objects
        that support synchronization across processes (i.e. multi-process-safe
        locks and semaphores).
        """

        _Server = SharedMemoryServer

        def __init__(self, *args, **kwargs):
            if os.name == "posix":
                # bpo-36867: Ensure the resource_tracker is running before
                # launching the manager process, so that concurrent
                # shared_memory manipulation both in the manager and in the
                # current process does not create two resource_tracker
                # processes.
                from . import resource_tracker
                resource_tracker.ensure_running()
            BaseManager.__init__(self, *args, **kwargs)
            util.debug(f"{self.__class__.__name__} created by pid {getpid()}")

        def __del__(self):
            util.debug(f"{self.__class__.__name__}.__del__ by pid {getpid()}")
            pass

        def get_server(self):
            'Better than monkeypatching for now; merge into Server ultimately'
            if self._state.value != State.INITIAL:
                if self._state.value == State.STARTED:
                    raise ProcessError("Already started SharedMemoryServer")
                elif self._state.value == State.SHUTDOWN:
                    raise ProcessError("SharedMemoryManager has shut down")
                else:
                    raise ProcessError(
                        "Unknown state {!r}".format(self._state.value))
            return self._Server(self._registry, self._address,
                                self._authkey, self._serializer)

        def SharedMemory(self, size):
            """Returns a new SharedMemory instance with the specified size in
            bytes, to be tracked by the manager."""
            with self._Client(self._address, authkey=self._authkey) as conn:
                sms = shared_memory.SharedMemory(None, create=True, size=size)
                try:
                    dispatch(conn, None, 'track_segment', (sms.name,))
                except BaseException as e:
                    sms.unlink()
                    raise e
            return sms

        def ShareableList(self, sequence):
            """Returns a new ShareableList instance populated with the values
            from the input sequence, to be tracked by the manager."""
            with self._Client(self._address, authkey=self._authkey) as conn:
                sl = shared_memory.ShareableList(sequence)
                try:
                    dispatch(conn, None, 'track_segment', (sl.shm.name,))
                except BaseException as e:
                    sl.shm.unlink()
                    raise e
            return sl
multiprocessing/popen_fork.py000064400000005010151153537440012513 0ustar00import os
import signal

from . import util

__all__ = ['Popen']

#
# Start child process using fork
#

class Popen(object):
    method = 'fork'

    def __init__(self, process_obj):
        util._flush_std_streams()
        self.returncode = None
        self.finalizer = None
        self._launch(process_obj)

    def duplicate_for_child(self, fd):
        return fd

    def poll(self, flag=os.WNOHANG):
        if self.returncode is None:
            try:
                pid, sts = os.waitpid(self.pid, flag)
            except OSError as e:
                # Child process not yet created. See #1731717
                # e.errno == errno.ECHILD == 10
                return None
            if pid == self.pid:
                if os.WIFSIGNALED(sts):
                    self.returncode = -os.WTERMSIG(sts)
                else:
                    assert os.WIFEXITED(sts), "Status is {:n}".format(sts)
                    self.returncode = os.WEXITSTATUS(sts)
        return self.returncode

    def wait(self, timeout=None):
        if self.returncode is None:
            if timeout is not None:
                from multiprocessing.connection import wait
                if not wait([self.sentinel], timeout):
                    return None
            # This shouldn't block if wait() returned successfully.
            return self.poll(os.WNOHANG if timeout == 0.0 else 0)
        return self.returncode

    def _send_signal(self, sig):
        if self.returncode is None:
            try:
                os.kill(self.pid, sig)
            except ProcessLookupError:
                pass
            except OSError:
                if self.wait(timeout=0.1) is None:
                    raise

    def terminate(self):
        self._send_signal(signal.SIGTERM)

    def kill(self):
        self._send_signal(signal.SIGKILL)

    def _launch(self, process_obj):
        code = 1
        parent_r, child_w = os.pipe()
        child_r, parent_w = os.pipe()
        self.pid = os.fork()
        if self.pid == 0:
            try:
                os.close(parent_r)
                os.close(parent_w)
                code = process_obj._bootstrap(parent_sentinel=child_r)
            finally:
                os._exit(code)
        else:
            os.close(child_w)
            os.close(child_r)
            self.finalizer = util.Finalize(self, util.close_fds,
                                           (parent_r, parent_w,))
            self.sentinel = parent_r

    def close(self):
        if self.finalizer is not None:
            self.finalizer()
multiprocessing/spawn.py000064400000022120151153537440011502 0ustar00#
# Code used to start processes when using the spawn or forkserver
# start methods.
#
# multiprocessing/spawn.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#

import os
import sys
import runpy
import types

from . import get_start_method, set_start_method
from . import process
from .context import reduction
from . import util

__all__ = ['_main', 'freeze_support', 'set_executable', 'get_executable',
           'get_preparation_data', 'get_command_line', 'import_main_path']

#
# _python_exe is the assumed path to the python executable.
# People embedding Python want to modify it.
#

if sys.platform != 'win32':
    WINEXE = False
    WINSERVICE = False
else:
    WINEXE = getattr(sys, 'frozen', False)
    WINSERVICE = sys.executable.lower().endswith("pythonservice.exe")

if WINSERVICE:
    _python_exe = os.path.join(sys.exec_prefix, 'python.exe')
else:
    _python_exe = sys.executable

def set_executable(exe):
    global _python_exe
    _python_exe = exe

def get_executable():
    return _python_exe

#
#
#

def is_forking(argv):
    '''
    Return whether commandline indicates we are forking
    '''
    if len(argv) >= 2 and argv[1] == '--multiprocessing-fork':
        return True
    else:
        return False


def freeze_support():
    '''
    Run code for process object if this in not the main process
    '''
    if is_forking(sys.argv):
        kwds = {}
        for arg in sys.argv[2:]:
            name, value = arg.split('=')
            if value == 'None':
                kwds[name] = None
            else:
                kwds[name] = int(value)
        spawn_main(**kwds)
        sys.exit()


def get_command_line(**kwds):
    '''
    Returns prefix of command line used for spawning a child process
    '''
    if getattr(sys, 'frozen', False):
        return ([sys.executable, '--multiprocessing-fork'] +
                ['%s=%r' % item for item in kwds.items()])
    else:
        prog = 'from multiprocessing.spawn import spawn_main; spawn_main(%s)'
        prog %= ', '.join('%s=%r' % item for item in kwds.items())
        opts = util._args_from_interpreter_flags()
        return [_python_exe] + opts + ['-c', prog, '--multiprocessing-fork']


def spawn_main(pipe_handle, parent_pid=None, tracker_fd=None):
    '''
    Run code specified by data received over pipe
    '''
    assert is_forking(sys.argv), "Not forking"
    if sys.platform == 'win32':
        import msvcrt
        import _winapi

        if parent_pid is not None:
            source_process = _winapi.OpenProcess(
                _winapi.SYNCHRONIZE | _winapi.PROCESS_DUP_HANDLE,
                False, parent_pid)
        else:
            source_process = None
        new_handle = reduction.duplicate(pipe_handle,
                                         source_process=source_process)
        fd = msvcrt.open_osfhandle(new_handle, os.O_RDONLY)
        parent_sentinel = source_process
    else:
        from . import resource_tracker
        resource_tracker._resource_tracker._fd = tracker_fd
        fd = pipe_handle
        parent_sentinel = os.dup(pipe_handle)
    exitcode = _main(fd, parent_sentinel)
    sys.exit(exitcode)


def _main(fd, parent_sentinel):
    with os.fdopen(fd, 'rb', closefd=True) as from_parent:
        process.current_process()._inheriting = True
        try:
            preparation_data = reduction.pickle.load(from_parent)
            prepare(preparation_data)
            self = reduction.pickle.load(from_parent)
        finally:
            del process.current_process()._inheriting
    return self._bootstrap(parent_sentinel)


def _check_not_importing_main():
    if getattr(process.current_process(), '_inheriting', False):
        raise RuntimeError('''
        An attempt has been made to start a new process before the
        current process has finished its bootstrapping phase.

        This probably means that you are not using fork to start your
        child processes and you have forgotten to use the proper idiom
        in the main module:

            if __name__ == '__main__':
                freeze_support()
                ...

        The "freeze_support()" line can be omitted if the program
        is not going to be frozen to produce an executable.''')


def get_preparation_data(name):
    '''
    Return info about parent needed by child to unpickle process object
    '''
    _check_not_importing_main()
    d = dict(
        log_to_stderr=util._log_to_stderr,
        authkey=process.current_process().authkey,
        )

    if util._logger is not None:
        d['log_level'] = util._logger.getEffectiveLevel()

    sys_path=sys.path.copy()
    try:
        i = sys_path.index('')
    except ValueError:
        pass
    else:
        sys_path[i] = process.ORIGINAL_DIR

    d.update(
        name=name,
        sys_path=sys_path,
        sys_argv=sys.argv,
        orig_dir=process.ORIGINAL_DIR,
        dir=os.getcwd(),
        start_method=get_start_method(),
        )

    # Figure out whether to initialise main in the subprocess as a module
    # or through direct execution (or to leave it alone entirely)
    main_module = sys.modules['__main__']
    main_mod_name = getattr(main_module.__spec__, "name", None)
    if main_mod_name is not None:
        d['init_main_from_name'] = main_mod_name
    elif sys.platform != 'win32' or (not WINEXE and not WINSERVICE):
        main_path = getattr(main_module, '__file__', None)
        if main_path is not None:
            if (not os.path.isabs(main_path) and
                        process.ORIGINAL_DIR is not None):
                main_path = os.path.join(process.ORIGINAL_DIR, main_path)
            d['init_main_from_path'] = os.path.normpath(main_path)

    return d

#
# Prepare current process
#

old_main_modules = []

def prepare(data):
    '''
    Try to get current process ready to unpickle process object
    '''
    if 'name' in data:
        process.current_process().name = data['name']

    if 'authkey' in data:
        process.current_process().authkey = data['authkey']

    if 'log_to_stderr' in data and data['log_to_stderr']:
        util.log_to_stderr()

    if 'log_level' in data:
        util.get_logger().setLevel(data['log_level'])

    if 'sys_path' in data:
        sys.path = data['sys_path']

    if 'sys_argv' in data:
        sys.argv = data['sys_argv']

    if 'dir' in data:
        os.chdir(data['dir'])

    if 'orig_dir' in data:
        process.ORIGINAL_DIR = data['orig_dir']

    if 'start_method' in data:
        set_start_method(data['start_method'], force=True)

    if 'init_main_from_name' in data:
        _fixup_main_from_name(data['init_main_from_name'])
    elif 'init_main_from_path' in data:
        _fixup_main_from_path(data['init_main_from_path'])

# Multiprocessing module helpers to fix up the main module in
# spawned subprocesses
def _fixup_main_from_name(mod_name):
    # __main__.py files for packages, directories, zip archives, etc, run
    # their "main only" code unconditionally, so we don't even try to
    # populate anything in __main__, nor do we make any changes to
    # __main__ attributes
    current_main = sys.modules['__main__']
    if mod_name == "__main__" or mod_name.endswith(".__main__"):
        return

    # If this process was forked, __main__ may already be populated
    if getattr(current_main.__spec__, "name", None) == mod_name:
        return

    # Otherwise, __main__ may contain some non-main code where we need to
    # support unpickling it properly. We rerun it as __mp_main__ and make
    # the normal __main__ an alias to that
    old_main_modules.append(current_main)
    main_module = types.ModuleType("__mp_main__")
    main_content = runpy.run_module(mod_name,
                                    run_name="__mp_main__",
                                    alter_sys=True)
    main_module.__dict__.update(main_content)
    sys.modules['__main__'] = sys.modules['__mp_main__'] = main_module


def _fixup_main_from_path(main_path):
    # If this process was forked, __main__ may already be populated
    current_main = sys.modules['__main__']

    # Unfortunately, the main ipython launch script historically had no
    # "if __name__ == '__main__'" guard, so we work around that
    # by treating it like a __main__.py file
    # See https://github.com/ipython/ipython/issues/4698
    main_name = os.path.splitext(os.path.basename(main_path))[0]
    if main_name == 'ipython':
        return

    # Otherwise, if __file__ already has the setting we expect,
    # there's nothing more to do
    if getattr(current_main, '__file__', None) == main_path:
        return

    # If the parent process has sent a path through rather than a module
    # name we assume it is an executable script that may contain
    # non-main code that needs to be executed
    old_main_modules.append(current_main)
    main_module = types.ModuleType("__mp_main__")
    main_content = runpy.run_path(main_path,
                                  run_name="__mp_main__")
    main_module.__dict__.update(main_content)
    sys.modules['__main__'] = sys.modules['__mp_main__'] = main_module


def import_main_path(main_path):
    '''
    Set sys.modules['__main__'] to module at main_path
    '''
    _fixup_main_from_path(main_path)
multiprocessing/synchronize.py000064400000026532151153537440012740 0ustar00#
# Module implementing synchronization primitives
#
# multiprocessing/synchronize.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#

__all__ = [
    'Lock', 'RLock', 'Semaphore', 'BoundedSemaphore', 'Condition', 'Event'
    ]

import threading
import sys
import tempfile
import _multiprocessing
import time

from . import context
from . import process
from . import util

# Try to import the mp.synchronize module cleanly, if it fails
# raise ImportError for platforms lacking a working sem_open implementation.
# See issue 3770
try:
    from _multiprocessing import SemLock, sem_unlink
except (ImportError):
    raise ImportError("This platform lacks a functioning sem_open" +
                      " implementation, therefore, the required" +
                      " synchronization primitives needed will not" +
                      " function, see issue 3770.")

#
# Constants
#

RECURSIVE_MUTEX, SEMAPHORE = list(range(2))
SEM_VALUE_MAX = _multiprocessing.SemLock.SEM_VALUE_MAX

#
# Base class for semaphores and mutexes; wraps `_multiprocessing.SemLock`
#

class SemLock(object):

    _rand = tempfile._RandomNameSequence()

    def __init__(self, kind, value, maxvalue, *, ctx):
        if ctx is None:
            ctx = context._default_context.get_context()
        name = ctx.get_start_method()
        unlink_now = sys.platform == 'win32' or name == 'fork'
        for i in range(100):
            try:
                sl = self._semlock = _multiprocessing.SemLock(
                    kind, value, maxvalue, self._make_name(),
                    unlink_now)
            except FileExistsError:
                pass
            else:
                break
        else:
            raise FileExistsError('cannot find name for semaphore')

        util.debug('created semlock with handle %s' % sl.handle)
        self._make_methods()

        if sys.platform != 'win32':
            def _after_fork(obj):
                obj._semlock._after_fork()
            util.register_after_fork(self, _after_fork)

        if self._semlock.name is not None:
            # We only get here if we are on Unix with forking
            # disabled.  When the object is garbage collected or the
            # process shuts down we unlink the semaphore name
            from .resource_tracker import register
            register(self._semlock.name, "semaphore")
            util.Finalize(self, SemLock._cleanup, (self._semlock.name,),
                          exitpriority=0)

    @staticmethod
    def _cleanup(name):
        from .resource_tracker import unregister
        sem_unlink(name)
        unregister(name, "semaphore")

    def _make_methods(self):
        self.acquire = self._semlock.acquire
        self.release = self._semlock.release

    def __enter__(self):
        return self._semlock.__enter__()

    def __exit__(self, *args):
        return self._semlock.__exit__(*args)

    def __getstate__(self):
        context.assert_spawning(self)
        sl = self._semlock
        if sys.platform == 'win32':
            h = context.get_spawning_popen().duplicate_for_child(sl.handle)
        else:
            h = sl.handle
        return (h, sl.kind, sl.maxvalue, sl.name)

    def __setstate__(self, state):
        self._semlock = _multiprocessing.SemLock._rebuild(*state)
        util.debug('recreated blocker with handle %r' % state[0])
        self._make_methods()

    @staticmethod
    def _make_name():
        return '%s-%s' % (process.current_process()._config['semprefix'],
                          next(SemLock._rand))

#
# Semaphore
#

class Semaphore(SemLock):

    def __init__(self, value=1, *, ctx):
        SemLock.__init__(self, SEMAPHORE, value, SEM_VALUE_MAX, ctx=ctx)

    def get_value(self):
        return self._semlock._get_value()

    def __repr__(self):
        try:
            value = self._semlock._get_value()
        except Exception:
            value = 'unknown'
        return '<%s(value=%s)>' % (self.__class__.__name__, value)

#
# Bounded semaphore
#

class BoundedSemaphore(Semaphore):

    def __init__(self, value=1, *, ctx):
        SemLock.__init__(self, SEMAPHORE, value, value, ctx=ctx)

    def __repr__(self):
        try:
            value = self._semlock._get_value()
        except Exception:
            value = 'unknown'
        return '<%s(value=%s, maxvalue=%s)>' % \
               (self.__class__.__name__, value, self._semlock.maxvalue)

#
# Non-recursive lock
#

class Lock(SemLock):

    def __init__(self, *, ctx):
        SemLock.__init__(self, SEMAPHORE, 1, 1, ctx=ctx)

    def __repr__(self):
        try:
            if self._semlock._is_mine():
                name = process.current_process().name
                if threading.current_thread().name != 'MainThread':
                    name += '|' + threading.current_thread().name
            elif self._semlock._get_value() == 1:
                name = 'None'
            elif self._semlock._count() > 0:
                name = 'SomeOtherThread'
            else:
                name = 'SomeOtherProcess'
        except Exception:
            name = 'unknown'
        return '<%s(owner=%s)>' % (self.__class__.__name__, name)

#
# Recursive lock
#

class RLock(SemLock):

    def __init__(self, *, ctx):
        SemLock.__init__(self, RECURSIVE_MUTEX, 1, 1, ctx=ctx)

    def __repr__(self):
        try:
            if self._semlock._is_mine():
                name = process.current_process().name
                if threading.current_thread().name != 'MainThread':
                    name += '|' + threading.current_thread().name
                count = self._semlock._count()
            elif self._semlock._get_value() == 1:
                name, count = 'None', 0
            elif self._semlock._count() > 0:
                name, count = 'SomeOtherThread', 'nonzero'
            else:
                name, count = 'SomeOtherProcess', 'nonzero'
        except Exception:
            name, count = 'unknown', 'unknown'
        return '<%s(%s, %s)>' % (self.__class__.__name__, name, count)

#
# Condition variable
#

class Condition(object):

    def __init__(self, lock=None, *, ctx):
        self._lock = lock or ctx.RLock()
        self._sleeping_count = ctx.Semaphore(0)
        self._woken_count = ctx.Semaphore(0)
        self._wait_semaphore = ctx.Semaphore(0)
        self._make_methods()

    def __getstate__(self):
        context.assert_spawning(self)
        return (self._lock, self._sleeping_count,
                self._woken_count, self._wait_semaphore)

    def __setstate__(self, state):
        (self._lock, self._sleeping_count,
         self._woken_count, self._wait_semaphore) = state
        self._make_methods()

    def __enter__(self):
        return self._lock.__enter__()

    def __exit__(self, *args):
        return self._lock.__exit__(*args)

    def _make_methods(self):
        self.acquire = self._lock.acquire
        self.release = self._lock.release

    def __repr__(self):
        try:
            num_waiters = (self._sleeping_count._semlock._get_value() -
                           self._woken_count._semlock._get_value())
        except Exception:
            num_waiters = 'unknown'
        return '<%s(%s, %s)>' % (self.__class__.__name__, self._lock, num_waiters)

    def wait(self, timeout=None):
        assert self._lock._semlock._is_mine(), \
               'must acquire() condition before using wait()'

        # indicate that this thread is going to sleep
        self._sleeping_count.release()

        # release lock
        count = self._lock._semlock._count()
        for i in range(count):
            self._lock.release()

        try:
            # wait for notification or timeout
            return self._wait_semaphore.acquire(True, timeout)
        finally:
            # indicate that this thread has woken
            self._woken_count.release()

            # reacquire lock
            for i in range(count):
                self._lock.acquire()

    def notify(self, n=1):
        assert self._lock._semlock._is_mine(), 'lock is not owned'
        assert not self._wait_semaphore.acquire(
            False), ('notify: Should not have been able to acquire '
                     + '_wait_semaphore')

        # to take account of timeouts since last notify*() we subtract
        # woken_count from sleeping_count and rezero woken_count
        while self._woken_count.acquire(False):
            res = self._sleeping_count.acquire(False)
            assert res, ('notify: Bug in sleeping_count.acquire'
                         + '- res should not be False')

        sleepers = 0
        while sleepers < n and self._sleeping_count.acquire(False):
            self._wait_semaphore.release()        # wake up one sleeper
            sleepers += 1

        if sleepers:
            for i in range(sleepers):
                self._woken_count.acquire()       # wait for a sleeper to wake

            # rezero wait_semaphore in case some timeouts just happened
            while self._wait_semaphore.acquire(False):
                pass

    def notify_all(self):
        self.notify(n=sys.maxsize)

    def wait_for(self, predicate, timeout=None):
        result = predicate()
        if result:
            return result
        if timeout is not None:
            endtime = time.monotonic() + timeout
        else:
            endtime = None
            waittime = None
        while not result:
            if endtime is not None:
                waittime = endtime - time.monotonic()
                if waittime <= 0:
                    break
            self.wait(waittime)
            result = predicate()
        return result

#
# Event
#

class Event(object):

    def __init__(self, *, ctx):
        self._cond = ctx.Condition(ctx.Lock())
        self._flag = ctx.Semaphore(0)

    def is_set(self):
        with self._cond:
            if self._flag.acquire(False):
                self._flag.release()
                return True
            return False

    def set(self):
        with self._cond:
            self._flag.acquire(False)
            self._flag.release()
            self._cond.notify_all()

    def clear(self):
        with self._cond:
            self._flag.acquire(False)

    def wait(self, timeout=None):
        with self._cond:
            if self._flag.acquire(False):
                self._flag.release()
            else:
                self._cond.wait(timeout)

            if self._flag.acquire(False):
                self._flag.release()
                return True
            return False

#
# Barrier
#

class Barrier(threading.Barrier):

    def __init__(self, parties, action=None, timeout=None, *, ctx):
        import struct
        from .heap import BufferWrapper
        wrapper = BufferWrapper(struct.calcsize('i') * 2)
        cond = ctx.Condition()
        self.__setstate__((parties, action, timeout, cond, wrapper))
        self._state = 0
        self._count = 0

    def __setstate__(self, state):
        (self._parties, self._action, self._timeout,
         self._cond, self._wrapper) = state
        self._array = self._wrapper.create_memoryview().cast('i')

    def __getstate__(self):
        return (self._parties, self._action, self._timeout,
                self._cond, self._wrapper)

    @property
    def _state(self):
        return self._array[0]

    @_state.setter
    def _state(self, value):
        self._array[0] = value

    @property
    def _count(self):
        return self._array[1]

    @_count.setter
    def _count(self, value):
        self._array[1] = value
multiprocessing/resource_sharer.py000064400000012350151153537440013551 0ustar00#
# We use a background thread for sharing fds on Unix, and for sharing sockets on
# Windows.
#
# A client which wants to pickle a resource registers it with the resource
# sharer and gets an identifier in return.  The unpickling process will connect
# to the resource sharer, sends the identifier and its pid, and then receives
# the resource.
#

import os
import signal
import socket
import sys
import threading

from . import process
from .context import reduction
from . import util

__all__ = ['stop']


if sys.platform == 'win32':
    __all__ += ['DupSocket']

    class DupSocket(object):
        '''Picklable wrapper for a socket.'''
        def __init__(self, sock):
            new_sock = sock.dup()
            def send(conn, pid):
                share = new_sock.share(pid)
                conn.send_bytes(share)
            self._id = _resource_sharer.register(send, new_sock.close)

        def detach(self):
            '''Get the socket.  This should only be called once.'''
            with _resource_sharer.get_connection(self._id) as conn:
                share = conn.recv_bytes()
                return socket.fromshare(share)

else:
    __all__ += ['DupFd']

    class DupFd(object):
        '''Wrapper for fd which can be used at any time.'''
        def __init__(self, fd):
            new_fd = os.dup(fd)
            def send(conn, pid):
                reduction.send_handle(conn, new_fd, pid)
            def close():
                os.close(new_fd)
            self._id = _resource_sharer.register(send, close)

        def detach(self):
            '''Get the fd.  This should only be called once.'''
            with _resource_sharer.get_connection(self._id) as conn:
                return reduction.recv_handle(conn)


class _ResourceSharer(object):
    '''Manager for resources using background thread.'''
    def __init__(self):
        self._key = 0
        self._cache = {}
        self._old_locks = []
        self._lock = threading.Lock()
        self._listener = None
        self._address = None
        self._thread = None
        util.register_after_fork(self, _ResourceSharer._afterfork)

    def register(self, send, close):
        '''Register resource, returning an identifier.'''
        with self._lock:
            if self._address is None:
                self._start()
            self._key += 1
            self._cache[self._key] = (send, close)
            return (self._address, self._key)

    @staticmethod
    def get_connection(ident):
        '''Return connection from which to receive identified resource.'''
        from .connection import Client
        address, key = ident
        c = Client(address, authkey=process.current_process().authkey)
        c.send((key, os.getpid()))
        return c

    def stop(self, timeout=None):
        '''Stop the background thread and clear registered resources.'''
        from .connection import Client
        with self._lock:
            if self._address is not None:
                c = Client(self._address,
                           authkey=process.current_process().authkey)
                c.send(None)
                c.close()
                self._thread.join(timeout)
                if self._thread.is_alive():
                    util.sub_warning('_ResourceSharer thread did '
                                     'not stop when asked')
                self._listener.close()
                self._thread = None
                self._address = None
                self._listener = None
                for key, (send, close) in self._cache.items():
                    close()
                self._cache.clear()

    def _afterfork(self):
        for key, (send, close) in self._cache.items():
            close()
        self._cache.clear()
        # If self._lock was locked at the time of the fork, it may be broken
        # -- see issue 6721.  Replace it without letting it be gc'ed.
        self._old_locks.append(self._lock)
        self._lock = threading.Lock()
        if self._listener is not None:
            self._listener.close()
        self._listener = None
        self._address = None
        self._thread = None

    def _start(self):
        from .connection import Listener
        assert self._listener is None, "Already have Listener"
        util.debug('starting listener and thread for sending handles')
        self._listener = Listener(authkey=process.current_process().authkey)
        self._address = self._listener.address
        t = threading.Thread(target=self._serve)
        t.daemon = True
        t.start()
        self._thread = t

    def _serve(self):
        if hasattr(signal, 'pthread_sigmask'):
            signal.pthread_sigmask(signal.SIG_BLOCK, signal.valid_signals())
        while 1:
            try:
                with self._listener.accept() as conn:
                    msg = conn.recv()
                    if msg is None:
                        break
                    key, destination_pid = msg
                    send, close = self._cache.pop(key)
                    try:
                        send(conn, destination_pid)
                    finally:
                        close()
            except:
                if not util.is_exiting():
                    sys.excepthook(*sys.exc_info())


_resource_sharer = _ResourceSharer()
stop = _resource_sharer.stop
multiprocessing/popen_spawn_posix.py000064400000003755151153537440014142 0ustar00import io
import os

from .context import reduction, set_spawning_popen
from . import popen_fork
from . import spawn
from . import util

__all__ = ['Popen']


#
# Wrapper for an fd used while launching a process
#

class _DupFd(object):
    def __init__(self, fd):
        self.fd = fd
    def detach(self):
        return self.fd

#
# Start child process using a fresh interpreter
#

class Popen(popen_fork.Popen):
    method = 'spawn'
    DupFd = _DupFd

    def __init__(self, process_obj):
        self._fds = []
        super().__init__(process_obj)

    def duplicate_for_child(self, fd):
        self._fds.append(fd)
        return fd

    def _launch(self, process_obj):
        from . import resource_tracker
        tracker_fd = resource_tracker.getfd()
        self._fds.append(tracker_fd)
        prep_data = spawn.get_preparation_data(process_obj._name)
        fp = io.BytesIO()
        set_spawning_popen(self)
        try:
            reduction.dump(prep_data, fp)
            reduction.dump(process_obj, fp)
        finally:
            set_spawning_popen(None)

        parent_r = child_w = child_r = parent_w = None
        try:
            parent_r, child_w = os.pipe()
            child_r, parent_w = os.pipe()
            cmd = spawn.get_command_line(tracker_fd=tracker_fd,
                                         pipe_handle=child_r)
            self._fds.extend([child_r, child_w])
            self.pid = util.spawnv_passfds(spawn.get_executable(),
                                           cmd, self._fds)
            self.sentinel = parent_r
            with open(parent_w, 'wb', closefd=False) as f:
                f.write(fp.getbuffer())
        finally:
            fds_to_close = []
            for fd in (parent_r, parent_w):
                if fd is not None:
                    fds_to_close.append(fd)
            self.finalizer = util.Finalize(self, util.close_fds, fds_to_close)

            for fd in (child_r, child_w):
                if fd is not None:
                    os.close(fd)
multiprocessing/heap.py000064400000026552151153537440011304 0ustar00#
# Module which supports allocation of memory from an mmap
#
# multiprocessing/heap.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#

import bisect
from collections import defaultdict
import mmap
import os
import sys
import tempfile
import threading

from .context import reduction, assert_spawning
from . import util

__all__ = ['BufferWrapper']

#
# Inheritable class which wraps an mmap, and from which blocks can be allocated
#

if sys.platform == 'win32':

    import _winapi

    class Arena(object):
        """
        A shared memory area backed by anonymous memory (Windows).
        """

        _rand = tempfile._RandomNameSequence()

        def __init__(self, size):
            self.size = size
            for i in range(100):
                name = 'pym-%d-%s' % (os.getpid(), next(self._rand))
                buf = mmap.mmap(-1, size, tagname=name)
                if _winapi.GetLastError() == 0:
                    break
                # We have reopened a preexisting mmap.
                buf.close()
            else:
                raise FileExistsError('Cannot find name for new mmap')
            self.name = name
            self.buffer = buf
            self._state = (self.size, self.name)

        def __getstate__(self):
            assert_spawning(self)
            return self._state

        def __setstate__(self, state):
            self.size, self.name = self._state = state
            # Reopen existing mmap
            self.buffer = mmap.mmap(-1, self.size, tagname=self.name)
            # XXX Temporarily preventing buildbot failures while determining
            # XXX the correct long-term fix. See issue 23060
            #assert _winapi.GetLastError() == _winapi.ERROR_ALREADY_EXISTS

else:

    class Arena(object):
        """
        A shared memory area backed by a temporary file (POSIX).
        """

        if sys.platform == 'linux':
            _dir_candidates = ['/dev/shm']
        else:
            _dir_candidates = []

        def __init__(self, size, fd=-1):
            self.size = size
            self.fd = fd
            if fd == -1:
                # Arena is created anew (if fd != -1, it means we're coming
                # from rebuild_arena() below)
                self.fd, name = tempfile.mkstemp(
                     prefix='pym-%d-'%os.getpid(),
                     dir=self._choose_dir(size))
                os.unlink(name)
                util.Finalize(self, os.close, (self.fd,))
                os.ftruncate(self.fd, size)
            self.buffer = mmap.mmap(self.fd, self.size)

        def _choose_dir(self, size):
            # Choose a non-storage backed directory if possible,
            # to improve performance
            for d in self._dir_candidates:
                st = os.statvfs(d)
                if st.f_bavail * st.f_frsize >= size:  # enough free space?
                    return d
            return util.get_temp_dir()

    def reduce_arena(a):
        if a.fd == -1:
            raise ValueError('Arena is unpicklable because '
                             'forking was enabled when it was created')
        return rebuild_arena, (a.size, reduction.DupFd(a.fd))

    def rebuild_arena(size, dupfd):
        return Arena(size, dupfd.detach())

    reduction.register(Arena, reduce_arena)

#
# Class allowing allocation of chunks of memory from arenas
#

class Heap(object):

    # Minimum malloc() alignment
    _alignment = 8

    _DISCARD_FREE_SPACE_LARGER_THAN = 4 * 1024 ** 2  # 4 MB
    _DOUBLE_ARENA_SIZE_UNTIL = 4 * 1024 ** 2

    def __init__(self, size=mmap.PAGESIZE):
        self._lastpid = os.getpid()
        self._lock = threading.Lock()
        # Current arena allocation size
        self._size = size
        # A sorted list of available block sizes in arenas
        self._lengths = []

        # Free block management:
        # - map each block size to a list of `(Arena, start, stop)` blocks
        self._len_to_seq = {}
        # - map `(Arena, start)` tuple to the `(Arena, start, stop)` block
        #   starting at that offset
        self._start_to_block = {}
        # - map `(Arena, stop)` tuple to the `(Arena, start, stop)` block
        #   ending at that offset
        self._stop_to_block = {}

        # Map arenas to their `(Arena, start, stop)` blocks in use
        self._allocated_blocks = defaultdict(set)
        self._arenas = []

        # List of pending blocks to free - see comment in free() below
        self._pending_free_blocks = []

        # Statistics
        self._n_mallocs = 0
        self._n_frees = 0

    @staticmethod
    def _roundup(n, alignment):
        # alignment must be a power of 2
        mask = alignment - 1
        return (n + mask) & ~mask

    def _new_arena(self, size):
        # Create a new arena with at least the given *size*
        length = self._roundup(max(self._size, size), mmap.PAGESIZE)
        # We carve larger and larger arenas, for efficiency, until we
        # reach a large-ish size (roughly L3 cache-sized)
        if self._size < self._DOUBLE_ARENA_SIZE_UNTIL:
            self._size *= 2
        util.info('allocating a new mmap of length %d', length)
        arena = Arena(length)
        self._arenas.append(arena)
        return (arena, 0, length)

    def _discard_arena(self, arena):
        # Possibly delete the given (unused) arena
        length = arena.size
        # Reusing an existing arena is faster than creating a new one, so
        # we only reclaim space if it's large enough.
        if length < self._DISCARD_FREE_SPACE_LARGER_THAN:
            return
        blocks = self._allocated_blocks.pop(arena)
        assert not blocks
        del self._start_to_block[(arena, 0)]
        del self._stop_to_block[(arena, length)]
        self._arenas.remove(arena)
        seq = self._len_to_seq[length]
        seq.remove((arena, 0, length))
        if not seq:
            del self._len_to_seq[length]
            self._lengths.remove(length)

    def _malloc(self, size):
        # returns a large enough block -- it might be much larger
        i = bisect.bisect_left(self._lengths, size)
        if i == len(self._lengths):
            return self._new_arena(size)
        else:
            length = self._lengths[i]
            seq = self._len_to_seq[length]
            block = seq.pop()
            if not seq:
                del self._len_to_seq[length], self._lengths[i]

        (arena, start, stop) = block
        del self._start_to_block[(arena, start)]
        del self._stop_to_block[(arena, stop)]
        return block

    def _add_free_block(self, block):
        # make block available and try to merge with its neighbours in the arena
        (arena, start, stop) = block

        try:
            prev_block = self._stop_to_block[(arena, start)]
        except KeyError:
            pass
        else:
            start, _ = self._absorb(prev_block)

        try:
            next_block = self._start_to_block[(arena, stop)]
        except KeyError:
            pass
        else:
            _, stop = self._absorb(next_block)

        block = (arena, start, stop)
        length = stop - start

        try:
            self._len_to_seq[length].append(block)
        except KeyError:
            self._len_to_seq[length] = [block]
            bisect.insort(self._lengths, length)

        self._start_to_block[(arena, start)] = block
        self._stop_to_block[(arena, stop)] = block

    def _absorb(self, block):
        # deregister this block so it can be merged with a neighbour
        (arena, start, stop) = block
        del self._start_to_block[(arena, start)]
        del self._stop_to_block[(arena, stop)]

        length = stop - start
        seq = self._len_to_seq[length]
        seq.remove(block)
        if not seq:
            del self._len_to_seq[length]
            self._lengths.remove(length)

        return start, stop

    def _remove_allocated_block(self, block):
        arena, start, stop = block
        blocks = self._allocated_blocks[arena]
        blocks.remove((start, stop))
        if not blocks:
            # Arena is entirely free, discard it from this process
            self._discard_arena(arena)

    def _free_pending_blocks(self):
        # Free all the blocks in the pending list - called with the lock held.
        while True:
            try:
                block = self._pending_free_blocks.pop()
            except IndexError:
                break
            self._add_free_block(block)
            self._remove_allocated_block(block)

    def free(self, block):
        # free a block returned by malloc()
        # Since free() can be called asynchronously by the GC, it could happen
        # that it's called while self._lock is held: in that case,
        # self._lock.acquire() would deadlock (issue #12352). To avoid that, a
        # trylock is used instead, and if the lock can't be acquired
        # immediately, the block is added to a list of blocks to be freed
        # synchronously sometimes later from malloc() or free(), by calling
        # _free_pending_blocks() (appending and retrieving from a list is not
        # strictly thread-safe but under CPython it's atomic thanks to the GIL).
        if os.getpid() != self._lastpid:
            raise ValueError(
                "My pid ({0:n}) is not last pid {1:n}".format(
                    os.getpid(),self._lastpid))
        if not self._lock.acquire(False):
            # can't acquire the lock right now, add the block to the list of
            # pending blocks to free
            self._pending_free_blocks.append(block)
        else:
            # we hold the lock
            try:
                self._n_frees += 1
                self._free_pending_blocks()
                self._add_free_block(block)
                self._remove_allocated_block(block)
            finally:
                self._lock.release()

    def malloc(self, size):
        # return a block of right size (possibly rounded up)
        if size < 0:
            raise ValueError("Size {0:n} out of range".format(size))
        if sys.maxsize <= size:
            raise OverflowError("Size {0:n} too large".format(size))
        if os.getpid() != self._lastpid:
            self.__init__()                     # reinitialize after fork
        with self._lock:
            self._n_mallocs += 1
            # allow pending blocks to be marked available
            self._free_pending_blocks()
            size = self._roundup(max(size, 1), self._alignment)
            (arena, start, stop) = self._malloc(size)
            real_stop = start + size
            if real_stop < stop:
                # if the returned block is larger than necessary, mark
                # the remainder available
                self._add_free_block((arena, real_stop, stop))
            self._allocated_blocks[arena].add((start, real_stop))
            return (arena, start, real_stop)

#
# Class wrapping a block allocated out of a Heap -- can be inherited by child process
#

class BufferWrapper(object):

    _heap = Heap()

    def __init__(self, size):
        if size < 0:
            raise ValueError("Size {0:n} out of range".format(size))
        if sys.maxsize <= size:
            raise OverflowError("Size {0:n} too large".format(size))
        block = BufferWrapper._heap.malloc(size)
        self._state = (block, size)
        util.Finalize(self, BufferWrapper._heap.free, args=(block,))

    def create_memoryview(self):
        (arena, start, stop), size = self._state
        return memoryview(arena.buffer)[start:start+size]
multiprocessing/util.py000064400000033176151153537440011344 0ustar00#
# Module providing various facilities to other parts of the package
#
# multiprocessing/util.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#

import os
import itertools
import sys
import weakref
import atexit
import threading        # we want threading to install it's
                        # cleanup function before multiprocessing does
from subprocess import _args_from_interpreter_flags

from . import process

__all__ = [
    'sub_debug', 'debug', 'info', 'sub_warning', 'get_logger',
    'log_to_stderr', 'get_temp_dir', 'register_after_fork',
    'is_exiting', 'Finalize', 'ForkAwareThreadLock', 'ForkAwareLocal',
    'close_all_fds_except', 'SUBDEBUG', 'SUBWARNING',
    ]

#
# Logging
#

NOTSET = 0
SUBDEBUG = 5
DEBUG = 10
INFO = 20
SUBWARNING = 25

LOGGER_NAME = 'multiprocessing'
DEFAULT_LOGGING_FORMAT = '[%(levelname)s/%(processName)s] %(message)s'

_logger = None
_log_to_stderr = False

def sub_debug(msg, *args):
    if _logger:
        _logger.log(SUBDEBUG, msg, *args)

def debug(msg, *args):
    if _logger:
        _logger.log(DEBUG, msg, *args)

def info(msg, *args):
    if _logger:
        _logger.log(INFO, msg, *args)

def sub_warning(msg, *args):
    if _logger:
        _logger.log(SUBWARNING, msg, *args)

def get_logger():
    '''
    Returns logger used by multiprocessing
    '''
    global _logger
    import logging

    logging._acquireLock()
    try:
        if not _logger:

            _logger = logging.getLogger(LOGGER_NAME)
            _logger.propagate = 0

            # XXX multiprocessing should cleanup before logging
            if hasattr(atexit, 'unregister'):
                atexit.unregister(_exit_function)
                atexit.register(_exit_function)
            else:
                atexit._exithandlers.remove((_exit_function, (), {}))
                atexit._exithandlers.append((_exit_function, (), {}))

    finally:
        logging._releaseLock()

    return _logger

def log_to_stderr(level=None):
    '''
    Turn on logging and add a handler which prints to stderr
    '''
    global _log_to_stderr
    import logging

    logger = get_logger()
    formatter = logging.Formatter(DEFAULT_LOGGING_FORMAT)
    handler = logging.StreamHandler()
    handler.setFormatter(formatter)
    logger.addHandler(handler)

    if level:
        logger.setLevel(level)
    _log_to_stderr = True
    return _logger


# Abstract socket support

def _platform_supports_abstract_sockets():
    if sys.platform == "linux":
        return True
    if hasattr(sys, 'getandroidapilevel'):
        return True
    return False


def is_abstract_socket_namespace(address):
    if not address:
        return False
    if isinstance(address, bytes):
        return address[0] == 0
    elif isinstance(address, str):
        return address[0] == "\0"
    raise TypeError('address type of {address!r} unrecognized')


abstract_sockets_supported = _platform_supports_abstract_sockets()

#
# Function returning a temp directory which will be removed on exit
#

def _remove_temp_dir(rmtree, tempdir):
    rmtree(tempdir)

    current_process = process.current_process()
    # current_process() can be None if the finalizer is called
    # late during Python finalization
    if current_process is not None:
        current_process._config['tempdir'] = None

def get_temp_dir():
    # get name of a temp directory which will be automatically cleaned up
    tempdir = process.current_process()._config.get('tempdir')
    if tempdir is None:
        import shutil, tempfile
        tempdir = tempfile.mkdtemp(prefix='pymp-')
        info('created temp directory %s', tempdir)
        # keep a strong reference to shutil.rmtree(), since the finalizer
        # can be called late during Python shutdown
        Finalize(None, _remove_temp_dir, args=(shutil.rmtree, tempdir),
                 exitpriority=-100)
        process.current_process()._config['tempdir'] = tempdir
    return tempdir

#
# Support for reinitialization of objects when bootstrapping a child process
#

_afterfork_registry = weakref.WeakValueDictionary()
_afterfork_counter = itertools.count()

def _run_after_forkers():
    items = list(_afterfork_registry.items())
    items.sort()
    for (index, ident, func), obj in items:
        try:
            func(obj)
        except Exception as e:
            info('after forker raised exception %s', e)

def register_after_fork(obj, func):
    _afterfork_registry[(next(_afterfork_counter), id(obj), func)] = obj

#
# Finalization using weakrefs
#

_finalizer_registry = {}
_finalizer_counter = itertools.count()


class Finalize(object):
    '''
    Class which supports object finalization using weakrefs
    '''
    def __init__(self, obj, callback, args=(), kwargs=None, exitpriority=None):
        if (exitpriority is not None) and not isinstance(exitpriority,int):
            raise TypeError(
                "Exitpriority ({0!r}) must be None or int, not {1!s}".format(
                    exitpriority, type(exitpriority)))

        if obj is not None:
            self._weakref = weakref.ref(obj, self)
        elif exitpriority is None:
            raise ValueError("Without object, exitpriority cannot be None")

        self._callback = callback
        self._args = args
        self._kwargs = kwargs or {}
        self._key = (exitpriority, next(_finalizer_counter))
        self._pid = os.getpid()

        _finalizer_registry[self._key] = self

    def __call__(self, wr=None,
                 # Need to bind these locally because the globals can have
                 # been cleared at shutdown
                 _finalizer_registry=_finalizer_registry,
                 sub_debug=sub_debug, getpid=os.getpid):
        '''
        Run the callback unless it has already been called or cancelled
        '''
        try:
            del _finalizer_registry[self._key]
        except KeyError:
            sub_debug('finalizer no longer registered')
        else:
            if self._pid != getpid():
                sub_debug('finalizer ignored because different process')
                res = None
            else:
                sub_debug('finalizer calling %s with args %s and kwargs %s',
                          self._callback, self._args, self._kwargs)
                res = self._callback(*self._args, **self._kwargs)
            self._weakref = self._callback = self._args = \
                            self._kwargs = self._key = None
            return res

    def cancel(self):
        '''
        Cancel finalization of the object
        '''
        try:
            del _finalizer_registry[self._key]
        except KeyError:
            pass
        else:
            self._weakref = self._callback = self._args = \
                            self._kwargs = self._key = None

    def still_active(self):
        '''
        Return whether this finalizer is still waiting to invoke callback
        '''
        return self._key in _finalizer_registry

    def __repr__(self):
        try:
            obj = self._weakref()
        except (AttributeError, TypeError):
            obj = None

        if obj is None:
            return '<%s object, dead>' % self.__class__.__name__

        x = '<%s object, callback=%s' % (
                self.__class__.__name__,
                getattr(self._callback, '__name__', self._callback))
        if self._args:
            x += ', args=' + str(self._args)
        if self._kwargs:
            x += ', kwargs=' + str(self._kwargs)
        if self._key[0] is not None:
            x += ', exitpriority=' + str(self._key[0])
        return x + '>'


def _run_finalizers(minpriority=None):
    '''
    Run all finalizers whose exit priority is not None and at least minpriority

    Finalizers with highest priority are called first; finalizers with
    the same priority will be called in reverse order of creation.
    '''
    if _finalizer_registry is None:
        # This function may be called after this module's globals are
        # destroyed.  See the _exit_function function in this module for more
        # notes.
        return

    if minpriority is None:
        f = lambda p : p[0] is not None
    else:
        f = lambda p : p[0] is not None and p[0] >= minpriority

    # Careful: _finalizer_registry may be mutated while this function
    # is running (either by a GC run or by another thread).

    # list(_finalizer_registry) should be atomic, while
    # list(_finalizer_registry.items()) is not.
    keys = [key for key in list(_finalizer_registry) if f(key)]
    keys.sort(reverse=True)

    for key in keys:
        finalizer = _finalizer_registry.get(key)
        # key may have been removed from the registry
        if finalizer is not None:
            sub_debug('calling %s', finalizer)
            try:
                finalizer()
            except Exception:
                import traceback
                traceback.print_exc()

    if minpriority is None:
        _finalizer_registry.clear()

#
# Clean up on exit
#

def is_exiting():
    '''
    Returns true if the process is shutting down
    '''
    return _exiting or _exiting is None

_exiting = False

def _exit_function(info=info, debug=debug, _run_finalizers=_run_finalizers,
                   active_children=process.active_children,
                   current_process=process.current_process):
    # We hold on to references to functions in the arglist due to the
    # situation described below, where this function is called after this
    # module's globals are destroyed.

    global _exiting

    if not _exiting:
        _exiting = True

        info('process shutting down')
        debug('running all "atexit" finalizers with priority >= 0')
        _run_finalizers(0)

        if current_process() is not None:
            # We check if the current process is None here because if
            # it's None, any call to ``active_children()`` will raise
            # an AttributeError (active_children winds up trying to
            # get attributes from util._current_process).  One
            # situation where this can happen is if someone has
            # manipulated sys.modules, causing this module to be
            # garbage collected.  The destructor for the module type
            # then replaces all values in the module dict with None.
            # For instance, after setuptools runs a test it replaces
            # sys.modules with a copy created earlier.  See issues
            # #9775 and #15881.  Also related: #4106, #9205, and
            # #9207.

            for p in active_children():
                if p.daemon:
                    info('calling terminate() for daemon %s', p.name)
                    p._popen.terminate()

            for p in active_children():
                info('calling join() for process %s', p.name)
                p.join()

        debug('running the remaining "atexit" finalizers')
        _run_finalizers()

atexit.register(_exit_function)

#
# Some fork aware types
#

class ForkAwareThreadLock(object):
    def __init__(self):
        self._reset()
        register_after_fork(self, ForkAwareThreadLock._reset)

    def _reset(self):
        self._lock = threading.Lock()
        self.acquire = self._lock.acquire
        self.release = self._lock.release

    def __enter__(self):
        return self._lock.__enter__()

    def __exit__(self, *args):
        return self._lock.__exit__(*args)


class ForkAwareLocal(threading.local):
    def __init__(self):
        register_after_fork(self, lambda obj : obj.__dict__.clear())
    def __reduce__(self):
        return type(self), ()

#
# Close fds except those specified
#

try:
    MAXFD = os.sysconf("SC_OPEN_MAX")
except Exception:
    MAXFD = 256

def close_all_fds_except(fds):
    fds = list(fds) + [-1, MAXFD]
    fds.sort()
    assert fds[-1] == MAXFD, 'fd too large'
    for i in range(len(fds) - 1):
        os.closerange(fds[i]+1, fds[i+1])
#
# Close sys.stdin and replace stdin with os.devnull
#

def _close_stdin():
    if sys.stdin is None:
        return

    try:
        sys.stdin.close()
    except (OSError, ValueError):
        pass

    try:
        fd = os.open(os.devnull, os.O_RDONLY)
        try:
            sys.stdin = open(fd, closefd=False)
        except:
            os.close(fd)
            raise
    except (OSError, ValueError):
        pass

#
# Flush standard streams, if any
#

def _flush_std_streams():
    try:
        sys.stdout.flush()
    except (AttributeError, ValueError):
        pass
    try:
        sys.stderr.flush()
    except (AttributeError, ValueError):
        pass

#
# Start a program with only specified fds kept open
#

def spawnv_passfds(path, args, passfds):
    import _posixsubprocess
    passfds = tuple(sorted(map(int, passfds)))
    errpipe_read, errpipe_write = os.pipe()
    try:
        return _posixsubprocess.fork_exec(
            args, [os.fsencode(path)], True, passfds, None, None,
            -1, -1, -1, -1, -1, -1, errpipe_read, errpipe_write,
            False, False, None)
    finally:
        os.close(errpipe_read)
        os.close(errpipe_write)


def close_fds(*fds):
    """Close each file descriptor given as an argument"""
    for fd in fds:
        os.close(fd)


def _cleanup_tests():
    """Cleanup multiprocessing resources when multiprocessing tests
    completed."""

    from test import support

    # cleanup multiprocessing
    process._cleanup()

    # Stop the ForkServer process if it's running
    from multiprocessing import forkserver
    forkserver._forkserver._stop()

    # Stop the ResourceTracker process if it's running
    from multiprocessing import resource_tracker
    resource_tracker._resource_tracker._stop()

    # bpo-37421: Explicitly call _run_finalizers() to remove immediately
    # temporary directories created by multiprocessing.util.get_temp_dir().
    _run_finalizers()
    support.gc_collect()

    support.reap_children()
multiprocessing/process.py000064400000027345151153537440012046 0ustar00#
# Module providing the `Process` class which emulates `threading.Thread`
#
# multiprocessing/process.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#

__all__ = ['BaseProcess', 'current_process', 'active_children',
           'parent_process']

#
# Imports
#

import os
import sys
import signal
import itertools
import threading
from _weakrefset import WeakSet

#
#
#

try:
    ORIGINAL_DIR = os.path.abspath(os.getcwd())
except OSError:
    ORIGINAL_DIR = None

#
# Public functions
#

def current_process():
    '''
    Return process object representing the current process
    '''
    return _current_process

def active_children():
    '''
    Return list of process objects corresponding to live child processes
    '''
    _cleanup()
    return list(_children)


def parent_process():
    '''
    Return process object representing the parent process
    '''
    return _parent_process

#
#
#

def _cleanup():
    # check for processes which have finished
    for p in list(_children):
        if p._popen.poll() is not None:
            _children.discard(p)

#
# The `Process` class
#

class BaseProcess(object):
    '''
    Process objects represent activity that is run in a separate process

    The class is analogous to `threading.Thread`
    '''
    def _Popen(self):
        raise NotImplementedError

    def __init__(self, group=None, target=None, name=None, args=(), kwargs={},
                 *, daemon=None):
        assert group is None, 'group argument must be None for now'
        count = next(_process_counter)
        self._identity = _current_process._identity + (count,)
        self._config = _current_process._config.copy()
        self._parent_pid = os.getpid()
        self._parent_name = _current_process.name
        self._popen = None
        self._closed = False
        self._target = target
        self._args = tuple(args)
        self._kwargs = dict(kwargs)
        self._name = name or type(self).__name__ + '-' + \
                     ':'.join(str(i) for i in self._identity)
        if daemon is not None:
            self.daemon = daemon
        _dangling.add(self)

    def _check_closed(self):
        if self._closed:
            raise ValueError("process object is closed")

    def run(self):
        '''
        Method to be run in sub-process; can be overridden in sub-class
        '''
        if self._target:
            self._target(*self._args, **self._kwargs)

    def start(self):
        '''
        Start child process
        '''
        self._check_closed()
        assert self._popen is None, 'cannot start a process twice'
        assert self._parent_pid == os.getpid(), \
               'can only start a process object created by current process'
        assert not _current_process._config.get('daemon'), \
               'daemonic processes are not allowed to have children'
        _cleanup()
        self._popen = self._Popen(self)
        self._sentinel = self._popen.sentinel
        # Avoid a refcycle if the target function holds an indirect
        # reference to the process object (see bpo-30775)
        del self._target, self._args, self._kwargs
        _children.add(self)

    def terminate(self):
        '''
        Terminate process; sends SIGTERM signal or uses TerminateProcess()
        '''
        self._check_closed()
        self._popen.terminate()

    def kill(self):
        '''
        Terminate process; sends SIGKILL signal or uses TerminateProcess()
        '''
        self._check_closed()
        self._popen.kill()

    def join(self, timeout=None):
        '''
        Wait until child process terminates
        '''
        self._check_closed()
        assert self._parent_pid == os.getpid(), 'can only join a child process'
        assert self._popen is not None, 'can only join a started process'
        res = self._popen.wait(timeout)
        if res is not None:
            _children.discard(self)

    def is_alive(self):
        '''
        Return whether process is alive
        '''
        self._check_closed()
        if self is _current_process:
            return True
        assert self._parent_pid == os.getpid(), 'can only test a child process'

        if self._popen is None:
            return False

        returncode = self._popen.poll()
        if returncode is None:
            return True
        else:
            _children.discard(self)
            return False

    def close(self):
        '''
        Close the Process object.

        This method releases resources held by the Process object.  It is
        an error to call this method if the child process is still running.
        '''
        if self._popen is not None:
            if self._popen.poll() is None:
                raise ValueError("Cannot close a process while it is still running. "
                                 "You should first call join() or terminate().")
            self._popen.close()
            self._popen = None
            del self._sentinel
            _children.discard(self)
        self._closed = True

    @property
    def name(self):
        return self._name

    @name.setter
    def name(self, name):
        assert isinstance(name, str), 'name must be a string'
        self._name = name

    @property
    def daemon(self):
        '''
        Return whether process is a daemon
        '''
        return self._config.get('daemon', False)

    @daemon.setter
    def daemon(self, daemonic):
        '''
        Set whether process is a daemon
        '''
        assert self._popen is None, 'process has already started'
        self._config['daemon'] = daemonic

    @property
    def authkey(self):
        return self._config['authkey']

    @authkey.setter
    def authkey(self, authkey):
        '''
        Set authorization key of process
        '''
        self._config['authkey'] = AuthenticationString(authkey)

    @property
    def exitcode(self):
        '''
        Return exit code of process or `None` if it has yet to stop
        '''
        self._check_closed()
        if self._popen is None:
            return self._popen
        return self._popen.poll()

    @property
    def ident(self):
        '''
        Return identifier (PID) of process or `None` if it has yet to start
        '''
        self._check_closed()
        if self is _current_process:
            return os.getpid()
        else:
            return self._popen and self._popen.pid

    pid = ident

    @property
    def sentinel(self):
        '''
        Return a file descriptor (Unix) or handle (Windows) suitable for
        waiting for process termination.
        '''
        self._check_closed()
        try:
            return self._sentinel
        except AttributeError:
            raise ValueError("process not started") from None

    def __repr__(self):
        exitcode = None
        if self is _current_process:
            status = 'started'
        elif self._closed:
            status = 'closed'
        elif self._parent_pid != os.getpid():
            status = 'unknown'
        elif self._popen is None:
            status = 'initial'
        else:
            exitcode = self._popen.poll()
            if exitcode is not None:
                status = 'stopped'
            else:
                status = 'started'

        info = [type(self).__name__, 'name=%r' % self._name]
        if self._popen is not None:
            info.append('pid=%s' % self._popen.pid)
        info.append('parent=%s' % self._parent_pid)
        info.append(status)
        if exitcode is not None:
            exitcode = _exitcode_to_name.get(exitcode, exitcode)
            info.append('exitcode=%s' % exitcode)
        if self.daemon:
            info.append('daemon')
        return '<%s>' % ' '.join(info)

    ##

    def _bootstrap(self, parent_sentinel=None):
        from . import util, context
        global _current_process, _parent_process, _process_counter, _children

        try:
            if self._start_method is not None:
                context._force_start_method(self._start_method)
            _process_counter = itertools.count(1)
            _children = set()
            util._close_stdin()
            old_process = _current_process
            _current_process = self
            _parent_process = _ParentProcess(
                self._parent_name, self._parent_pid, parent_sentinel)
            if threading._HAVE_THREAD_NATIVE_ID:
                threading.main_thread()._set_native_id()
            try:
                util._finalizer_registry.clear()
                util._run_after_forkers()
            finally:
                # delay finalization of the old process object until after
                # _run_after_forkers() is executed
                del old_process
            util.info('child process calling self.run()')
            try:
                self.run()
                exitcode = 0
            finally:
                util._exit_function()
        except SystemExit as e:
            if not e.args:
                exitcode = 1
            elif isinstance(e.args[0], int):
                exitcode = e.args[0]
            else:
                sys.stderr.write(str(e.args[0]) + '\n')
                exitcode = 1
        except:
            exitcode = 1
            import traceback
            sys.stderr.write('Process %s:\n' % self.name)
            traceback.print_exc()
        finally:
            threading._shutdown()
            util.info('process exiting with exitcode %d' % exitcode)
            util._flush_std_streams()

        return exitcode

#
# We subclass bytes to avoid accidental transmission of auth keys over network
#

class AuthenticationString(bytes):
    def __reduce__(self):
        from .context import get_spawning_popen
        if get_spawning_popen() is None:
            raise TypeError(
                'Pickling an AuthenticationString object is '
                'disallowed for security reasons'
                )
        return AuthenticationString, (bytes(self),)


#
# Create object representing the parent process
#

class _ParentProcess(BaseProcess):

    def __init__(self, name, pid, sentinel):
        self._identity = ()
        self._name = name
        self._pid = pid
        self._parent_pid = None
        self._popen = None
        self._closed = False
        self._sentinel = sentinel
        self._config = {}

    def is_alive(self):
        from multiprocessing.connection import wait
        return not wait([self._sentinel], timeout=0)

    @property
    def ident(self):
        return self._pid

    def join(self, timeout=None):
        '''
        Wait until parent process terminates
        '''
        from multiprocessing.connection import wait
        wait([self._sentinel], timeout=timeout)

    pid = ident

#
# Create object representing the main process
#

class _MainProcess(BaseProcess):

    def __init__(self):
        self._identity = ()
        self._name = 'MainProcess'
        self._parent_pid = None
        self._popen = None
        self._closed = False
        self._config = {'authkey': AuthenticationString(os.urandom(32)),
                        'semprefix': '/mp'}
        # Note that some versions of FreeBSD only allow named
        # semaphores to have names of up to 14 characters.  Therefore
        # we choose a short prefix.
        #
        # On MacOSX in a sandbox it may be necessary to use a
        # different prefix -- see #19478.
        #
        # Everything in self._config will be inherited by descendant
        # processes.

    def close(self):
        pass


_parent_process = None
_current_process = _MainProcess()
_process_counter = itertools.count(1)
_children = set()
del _MainProcess

#
# Give names to some return codes
#

_exitcode_to_name = {}

for name, signum in list(signal.__dict__.items()):
    if name[:3]=='SIG' and '_' not in name:
        _exitcode_to_name[-signum] = f'-{name}'

# For debug and leak testing
_dangling = WeakSet()
multiprocessing/queues.py000064400000026652151153537440011677 0ustar00#
# Module implementing queues
#
# multiprocessing/queues.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#

__all__ = ['Queue', 'SimpleQueue', 'JoinableQueue']

import sys
import os
import threading
import collections
import time
import weakref
import errno

from queue import Empty, Full

import _multiprocessing

from . import connection
from . import context
_ForkingPickler = context.reduction.ForkingPickler

from .util import debug, info, Finalize, register_after_fork, is_exiting

#
# Queue type using a pipe, buffer and thread
#

class Queue(object):

    def __init__(self, maxsize=0, *, ctx):
        if maxsize <= 0:
            # Can raise ImportError (see issues #3770 and #23400)
            from .synchronize import SEM_VALUE_MAX as maxsize
        self._maxsize = maxsize
        self._reader, self._writer = connection.Pipe(duplex=False)
        self._rlock = ctx.Lock()
        self._opid = os.getpid()
        if sys.platform == 'win32':
            self._wlock = None
        else:
            self._wlock = ctx.Lock()
        self._sem = ctx.BoundedSemaphore(maxsize)
        # For use by concurrent.futures
        self._ignore_epipe = False

        self._after_fork()

        if sys.platform != 'win32':
            register_after_fork(self, Queue._after_fork)

    def __getstate__(self):
        context.assert_spawning(self)
        return (self._ignore_epipe, self._maxsize, self._reader, self._writer,
                self._rlock, self._wlock, self._sem, self._opid)

    def __setstate__(self, state):
        (self._ignore_epipe, self._maxsize, self._reader, self._writer,
         self._rlock, self._wlock, self._sem, self._opid) = state
        self._after_fork()

    def _after_fork(self):
        debug('Queue._after_fork()')
        self._notempty = threading.Condition(threading.Lock())
        self._buffer = collections.deque()
        self._thread = None
        self._jointhread = None
        self._joincancelled = False
        self._closed = False
        self._close = None
        self._send_bytes = self._writer.send_bytes
        self._recv_bytes = self._reader.recv_bytes
        self._poll = self._reader.poll

    def put(self, obj, block=True, timeout=None):
        if self._closed:
            raise ValueError(f"Queue {self!r} is closed")
        if not self._sem.acquire(block, timeout):
            raise Full

        with self._notempty:
            if self._thread is None:
                self._start_thread()
            self._buffer.append(obj)
            self._notempty.notify()

    def get(self, block=True, timeout=None):
        if self._closed:
            raise ValueError(f"Queue {self!r} is closed")
        if block and timeout is None:
            with self._rlock:
                res = self._recv_bytes()
            self._sem.release()
        else:
            if block:
                deadline = time.monotonic() + timeout
            if not self._rlock.acquire(block, timeout):
                raise Empty
            try:
                if block:
                    timeout = deadline - time.monotonic()
                    if not self._poll(timeout):
                        raise Empty
                elif not self._poll():
                    raise Empty
                res = self._recv_bytes()
                self._sem.release()
            finally:
                self._rlock.release()
        # unserialize the data after having released the lock
        return _ForkingPickler.loads(res)

    def qsize(self):
        # Raises NotImplementedError on Mac OSX because of broken sem_getvalue()
        return self._maxsize - self._sem._semlock._get_value()

    def empty(self):
        return not self._poll()

    def full(self):
        return self._sem._semlock._is_zero()

    def get_nowait(self):
        return self.get(False)

    def put_nowait(self, obj):
        return self.put(obj, False)

    def close(self):
        self._closed = True
        try:
            self._reader.close()
        finally:
            close = self._close
            if close:
                self._close = None
                close()

    def join_thread(self):
        debug('Queue.join_thread()')
        assert self._closed, "Queue {0!r} not closed".format(self)
        if self._jointhread:
            self._jointhread()

    def cancel_join_thread(self):
        debug('Queue.cancel_join_thread()')
        self._joincancelled = True
        try:
            self._jointhread.cancel()
        except AttributeError:
            pass

    def _start_thread(self):
        debug('Queue._start_thread()')

        # Start thread which transfers data from buffer to pipe
        self._buffer.clear()
        self._thread = threading.Thread(
            target=Queue._feed,
            args=(self._buffer, self._notempty, self._send_bytes,
                  self._wlock, self._writer.close, self._ignore_epipe,
                  self._on_queue_feeder_error, self._sem),
            name='QueueFeederThread'
        )
        self._thread.daemon = True

        debug('doing self._thread.start()')
        self._thread.start()
        debug('... done self._thread.start()')

        if not self._joincancelled:
            self._jointhread = Finalize(
                self._thread, Queue._finalize_join,
                [weakref.ref(self._thread)],
                exitpriority=-5
                )

        # Send sentinel to the thread queue object when garbage collected
        self._close = Finalize(
            self, Queue._finalize_close,
            [self._buffer, self._notempty],
            exitpriority=10
            )

    @staticmethod
    def _finalize_join(twr):
        debug('joining queue thread')
        thread = twr()
        if thread is not None:
            thread.join()
            debug('... queue thread joined')
        else:
            debug('... queue thread already dead')

    @staticmethod
    def _finalize_close(buffer, notempty):
        debug('telling queue thread to quit')
        with notempty:
            buffer.append(_sentinel)
            notempty.notify()

    @staticmethod
    def _feed(buffer, notempty, send_bytes, writelock, close, ignore_epipe,
              onerror, queue_sem):
        debug('starting thread to feed data to pipe')
        nacquire = notempty.acquire
        nrelease = notempty.release
        nwait = notempty.wait
        bpopleft = buffer.popleft
        sentinel = _sentinel
        if sys.platform != 'win32':
            wacquire = writelock.acquire
            wrelease = writelock.release
        else:
            wacquire = None

        while 1:
            try:
                nacquire()
                try:
                    if not buffer:
                        nwait()
                finally:
                    nrelease()
                try:
                    while 1:
                        obj = bpopleft()
                        if obj is sentinel:
                            debug('feeder thread got sentinel -- exiting')
                            close()
                            return

                        # serialize the data before acquiring the lock
                        obj = _ForkingPickler.dumps(obj)
                        if wacquire is None:
                            send_bytes(obj)
                        else:
                            wacquire()
                            try:
                                send_bytes(obj)
                            finally:
                                wrelease()
                except IndexError:
                    pass
            except Exception as e:
                if ignore_epipe and getattr(e, 'errno', 0) == errno.EPIPE:
                    return
                # Since this runs in a daemon thread the resources it uses
                # may be become unusable while the process is cleaning up.
                # We ignore errors which happen after the process has
                # started to cleanup.
                if is_exiting():
                    info('error in queue thread: %s', e)
                    return
                else:
                    # Since the object has not been sent in the queue, we need
                    # to decrease the size of the queue. The error acts as
                    # if the object had been silently removed from the queue
                    # and this step is necessary to have a properly working
                    # queue.
                    queue_sem.release()
                    onerror(e, obj)

    @staticmethod
    def _on_queue_feeder_error(e, obj):
        """
        Private API hook called when feeding data in the background thread
        raises an exception.  For overriding by concurrent.futures.
        """
        import traceback
        traceback.print_exc()


_sentinel = object()

#
# A queue type which also supports join() and task_done() methods
#
# Note that if you do not call task_done() for each finished task then
# eventually the counter's semaphore may overflow causing Bad Things
# to happen.
#

class JoinableQueue(Queue):

    def __init__(self, maxsize=0, *, ctx):
        Queue.__init__(self, maxsize, ctx=ctx)
        self._unfinished_tasks = ctx.Semaphore(0)
        self._cond = ctx.Condition()

    def __getstate__(self):
        return Queue.__getstate__(self) + (self._cond, self._unfinished_tasks)

    def __setstate__(self, state):
        Queue.__setstate__(self, state[:-2])
        self._cond, self._unfinished_tasks = state[-2:]

    def put(self, obj, block=True, timeout=None):
        if self._closed:
            raise ValueError(f"Queue {self!r} is closed")
        if not self._sem.acquire(block, timeout):
            raise Full

        with self._notempty, self._cond:
            if self._thread is None:
                self._start_thread()
            self._buffer.append(obj)
            self._unfinished_tasks.release()
            self._notempty.notify()

    def task_done(self):
        with self._cond:
            if not self._unfinished_tasks.acquire(False):
                raise ValueError('task_done() called too many times')
            if self._unfinished_tasks._semlock._is_zero():
                self._cond.notify_all()

    def join(self):
        with self._cond:
            if not self._unfinished_tasks._semlock._is_zero():
                self._cond.wait()

#
# Simplified Queue type -- really just a locked pipe
#

class SimpleQueue(object):

    def __init__(self, *, ctx):
        self._reader, self._writer = connection.Pipe(duplex=False)
        self._rlock = ctx.Lock()
        self._poll = self._reader.poll
        if sys.platform == 'win32':
            self._wlock = None
        else:
            self._wlock = ctx.Lock()

    def empty(self):
        return not self._poll()

    def __getstate__(self):
        context.assert_spawning(self)
        return (self._reader, self._writer, self._rlock, self._wlock)

    def __setstate__(self, state):
        (self._reader, self._writer, self._rlock, self._wlock) = state
        self._poll = self._reader.poll

    def get(self):
        with self._rlock:
            res = self._reader.recv_bytes()
        # unserialize the data after having released the lock
        return _ForkingPickler.loads(res)

    def put(self, obj):
        # serialize the data before acquiring the lock
        obj = _ForkingPickler.dumps(obj)
        if self._wlock is None:
            # writes to a message oriented win32 pipe are atomic
            self._writer.send_bytes(obj)
        else:
            with self._wlock:
                self._writer.send_bytes(obj)
multiprocessing/__init__.py000064400000001624151153537440012117 0ustar00#
# Package analogous to 'threading.py' but using processes
#
# multiprocessing/__init__.py
#
# This package is intended to duplicate the functionality (and much of
# the API) of threading.py but uses processes instead of threads.  A
# subpackage 'multiprocessing.dummy' has the same API but is a simple
# wrapper for 'threading'.
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#

import sys
from . import context

#
# Copy stuff from default context
#

__all__ = [x for x in dir(context._default_context) if not x.startswith('_')]
globals().update((name, getattr(context._default_context, name)) for name in __all__)

#
# XXX These should not really be documented or public.
#

SUBDEBUG = 5
SUBWARNING = 25

#
# Alias for main module -- will be reset by bootstrapping child processes
#

if '__main__' in sys.modules:
    sys.modules['__mp_main__'] = sys.modules['__main__']
multiprocessing/popen_spawn_win32.py000064400000007653151153537440013743 0ustar00import os
import msvcrt
import signal
import sys
import _winapi

from .context import reduction, get_spawning_popen, set_spawning_popen
from . import spawn
from . import util

__all__ = ['Popen']

#
#
#

TERMINATE = 0x10000
WINEXE = (sys.platform == 'win32' and getattr(sys, 'frozen', False))
WINSERVICE = sys.executable.lower().endswith("pythonservice.exe")


def _path_eq(p1, p2):
    return p1 == p2 or os.path.normcase(p1) == os.path.normcase(p2)

WINENV = not _path_eq(sys.executable, sys._base_executable)


def _close_handles(*handles):
    for handle in handles:
        _winapi.CloseHandle(handle)


#
# We define a Popen class similar to the one from subprocess, but
# whose constructor takes a process object as its argument.
#

class Popen(object):
    '''
    Start a subprocess to run the code of a process object
    '''
    method = 'spawn'

    def __init__(self, process_obj):
        prep_data = spawn.get_preparation_data(process_obj._name)

        # read end of pipe will be duplicated by the child process
        # -- see spawn_main() in spawn.py.
        #
        # bpo-33929: Previously, the read end of pipe was "stolen" by the child
        # process, but it leaked a handle if the child process had been
        # terminated before it could steal the handle from the parent process.
        rhandle, whandle = _winapi.CreatePipe(None, 0)
        wfd = msvcrt.open_osfhandle(whandle, 0)
        cmd = spawn.get_command_line(parent_pid=os.getpid(),
                                     pipe_handle=rhandle)
        cmd = ' '.join('"%s"' % x for x in cmd)

        python_exe = spawn.get_executable()

        # bpo-35797: When running in a venv, we bypass the redirect
        # executor and launch our base Python.
        if WINENV and _path_eq(python_exe, sys.executable):
            python_exe = sys._base_executable
            env = os.environ.copy()
            env["__PYVENV_LAUNCHER__"] = sys.executable
        else:
            env = None

        with open(wfd, 'wb', closefd=True) as to_child:
            # start process
            try:
                hp, ht, pid, tid = _winapi.CreateProcess(
                    python_exe, cmd,
                    None, None, False, 0, env, None, None)
                _winapi.CloseHandle(ht)
            except:
                _winapi.CloseHandle(rhandle)
                raise

            # set attributes of self
            self.pid = pid
            self.returncode = None
            self._handle = hp
            self.sentinel = int(hp)
            self.finalizer = util.Finalize(self, _close_handles,
                                           (self.sentinel, int(rhandle)))

            # send information to child
            set_spawning_popen(self)
            try:
                reduction.dump(prep_data, to_child)
                reduction.dump(process_obj, to_child)
            finally:
                set_spawning_popen(None)

    def duplicate_for_child(self, handle):
        assert self is get_spawning_popen()
        return reduction.duplicate(handle, self.sentinel)

    def wait(self, timeout=None):
        if self.returncode is None:
            if timeout is None:
                msecs = _winapi.INFINITE
            else:
                msecs = max(0, int(timeout * 1000 + 0.5))

            res = _winapi.WaitForSingleObject(int(self._handle), msecs)
            if res == _winapi.WAIT_OBJECT_0:
                code = _winapi.GetExitCodeProcess(self._handle)
                if code == TERMINATE:
                    code = -signal.SIGTERM
                self.returncode = code

        return self.returncode

    def poll(self):
        return self.wait(timeout=0)

    def terminate(self):
        if self.returncode is None:
            try:
                _winapi.TerminateProcess(int(self._handle), TERMINATE)
            except OSError:
                if self.wait(timeout=1.0) is None:
                    raise

    kill = terminate

    def close(self):
        self.finalizer()
multiprocessing/pool.py000064400000077375151153537440011351 0ustar00#
# Module providing the `Pool` class for managing a process pool
#
# multiprocessing/pool.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#

__all__ = ['Pool', 'ThreadPool']

#
# Imports
#

import collections
import itertools
import os
import queue
import threading
import time
import traceback
import warnings
from queue import Empty

# If threading is available then ThreadPool should be provided.  Therefore
# we avoid top-level imports which are liable to fail on some systems.
from . import util
from . import get_context, TimeoutError
from .connection import wait

#
# Constants representing the state of a pool
#

INIT = "INIT"
RUN = "RUN"
CLOSE = "CLOSE"
TERMINATE = "TERMINATE"

#
# Miscellaneous
#

job_counter = itertools.count()

def mapstar(args):
    return list(map(*args))

def starmapstar(args):
    return list(itertools.starmap(args[0], args[1]))

#
# Hack to embed stringification of remote traceback in local traceback
#

class RemoteTraceback(Exception):
    def __init__(self, tb):
        self.tb = tb
    def __str__(self):
        return self.tb

class ExceptionWithTraceback:
    def __init__(self, exc, tb):
        tb = traceback.format_exception(type(exc), exc, tb)
        tb = ''.join(tb)
        self.exc = exc
        self.tb = '\n"""\n%s"""' % tb
    def __reduce__(self):
        return rebuild_exc, (self.exc, self.tb)

def rebuild_exc(exc, tb):
    exc.__cause__ = RemoteTraceback(tb)
    return exc

#
# Code run by worker processes
#

class MaybeEncodingError(Exception):
    """Wraps possible unpickleable errors, so they can be
    safely sent through the socket."""

    def __init__(self, exc, value):
        self.exc = repr(exc)
        self.value = repr(value)
        super(MaybeEncodingError, self).__init__(self.exc, self.value)

    def __str__(self):
        return "Error sending result: '%s'. Reason: '%s'" % (self.value,
                                                             self.exc)

    def __repr__(self):
        return "<%s: %s>" % (self.__class__.__name__, self)


def worker(inqueue, outqueue, initializer=None, initargs=(), maxtasks=None,
           wrap_exception=False):
    if (maxtasks is not None) and not (isinstance(maxtasks, int)
                                       and maxtasks >= 1):
        raise AssertionError("Maxtasks {!r} is not valid".format(maxtasks))
    put = outqueue.put
    get = inqueue.get
    if hasattr(inqueue, '_writer'):
        inqueue._writer.close()
        outqueue._reader.close()

    if initializer is not None:
        initializer(*initargs)

    completed = 0
    while maxtasks is None or (maxtasks and completed < maxtasks):
        try:
            task = get()
        except (EOFError, OSError):
            util.debug('worker got EOFError or OSError -- exiting')
            break

        if task is None:
            util.debug('worker got sentinel -- exiting')
            break

        job, i, func, args, kwds = task
        try:
            result = (True, func(*args, **kwds))
        except Exception as e:
            if wrap_exception and func is not _helper_reraises_exception:
                e = ExceptionWithTraceback(e, e.__traceback__)
            result = (False, e)
        try:
            put((job, i, result))
        except Exception as e:
            wrapped = MaybeEncodingError(e, result[1])
            util.debug("Possible encoding error while sending result: %s" % (
                wrapped))
            put((job, i, (False, wrapped)))

        task = job = result = func = args = kwds = None
        completed += 1
    util.debug('worker exiting after %d tasks' % completed)

def _helper_reraises_exception(ex):
    'Pickle-able helper function for use by _guarded_task_generation.'
    raise ex

#
# Class representing a process pool
#

class _PoolCache(dict):
    """
    Class that implements a cache for the Pool class that will notify
    the pool management threads every time the cache is emptied. The
    notification is done by the use of a queue that is provided when
    instantiating the cache.
    """
    def __init__(self, /, *args, notifier=None, **kwds):
        self.notifier = notifier
        super().__init__(*args, **kwds)

    def __delitem__(self, item):
        super().__delitem__(item)

        # Notify that the cache is empty. This is important because the
        # pool keeps maintaining workers until the cache gets drained. This
        # eliminates a race condition in which a task is finished after the
        # the pool's _handle_workers method has enter another iteration of the
        # loop. In this situation, the only event that can wake up the pool
        # is the cache to be emptied (no more tasks available).
        if not self:
            self.notifier.put(None)

class Pool(object):
    '''
    Class which supports an async version of applying functions to arguments.
    '''
    _wrap_exception = True

    @staticmethod
    def Process(ctx, *args, **kwds):
        return ctx.Process(*args, **kwds)

    def __init__(self, processes=None, initializer=None, initargs=(),
                 maxtasksperchild=None, context=None):
        # Attributes initialized early to make sure that they exist in
        # __del__() if __init__() raises an exception
        self._pool = []
        self._state = INIT

        self._ctx = context or get_context()
        self._setup_queues()
        self._taskqueue = queue.SimpleQueue()
        # The _change_notifier queue exist to wake up self._handle_workers()
        # when the cache (self._cache) is empty or when there is a change in
        # the _state variable of the thread that runs _handle_workers.
        self._change_notifier = self._ctx.SimpleQueue()
        self._cache = _PoolCache(notifier=self._change_notifier)
        self._maxtasksperchild = maxtasksperchild
        self._initializer = initializer
        self._initargs = initargs

        if processes is None:
            processes = os.cpu_count() or 1
        if processes < 1:
            raise ValueError("Number of processes must be at least 1")

        if initializer is not None and not callable(initializer):
            raise TypeError('initializer must be a callable')

        self._processes = processes
        try:
            self._repopulate_pool()
        except Exception:
            for p in self._pool:
                if p.exitcode is None:
                    p.terminate()
            for p in self._pool:
                p.join()
            raise

        sentinels = self._get_sentinels()

        self._worker_handler = threading.Thread(
            target=Pool._handle_workers,
            args=(self._cache, self._taskqueue, self._ctx, self.Process,
                  self._processes, self._pool, self._inqueue, self._outqueue,
                  self._initializer, self._initargs, self._maxtasksperchild,
                  self._wrap_exception, sentinels, self._change_notifier)
            )
        self._worker_handler.daemon = True
        self._worker_handler._state = RUN
        self._worker_handler.start()


        self._task_handler = threading.Thread(
            target=Pool._handle_tasks,
            args=(self._taskqueue, self._quick_put, self._outqueue,
                  self._pool, self._cache)
            )
        self._task_handler.daemon = True
        self._task_handler._state = RUN
        self._task_handler.start()

        self._result_handler = threading.Thread(
            target=Pool._handle_results,
            args=(self._outqueue, self._quick_get, self._cache)
            )
        self._result_handler.daemon = True
        self._result_handler._state = RUN
        self._result_handler.start()

        self._terminate = util.Finalize(
            self, self._terminate_pool,
            args=(self._taskqueue, self._inqueue, self._outqueue, self._pool,
                  self._change_notifier, self._worker_handler, self._task_handler,
                  self._result_handler, self._cache),
            exitpriority=15
            )
        self._state = RUN

    # Copy globals as function locals to make sure that they are available
    # during Python shutdown when the Pool is destroyed.
    def __del__(self, _warn=warnings.warn, RUN=RUN):
        if self._state == RUN:
            _warn(f"unclosed running multiprocessing pool {self!r}",
                  ResourceWarning, source=self)
            if getattr(self, '_change_notifier', None) is not None:
                self._change_notifier.put(None)

    def __repr__(self):
        cls = self.__class__
        return (f'<{cls.__module__}.{cls.__qualname__} '
                f'state={self._state} '
                f'pool_size={len(self._pool)}>')

    def _get_sentinels(self):
        task_queue_sentinels = [self._outqueue._reader]
        self_notifier_sentinels = [self._change_notifier._reader]
        return [*task_queue_sentinels, *self_notifier_sentinels]

    @staticmethod
    def _get_worker_sentinels(workers):
        return [worker.sentinel for worker in
                workers if hasattr(worker, "sentinel")]

    @staticmethod
    def _join_exited_workers(pool):
        """Cleanup after any worker processes which have exited due to reaching
        their specified lifetime.  Returns True if any workers were cleaned up.
        """
        cleaned = False
        for i in reversed(range(len(pool))):
            worker = pool[i]
            if worker.exitcode is not None:
                # worker exited
                util.debug('cleaning up worker %d' % i)
                worker.join()
                cleaned = True
                del pool[i]
        return cleaned

    def _repopulate_pool(self):
        return self._repopulate_pool_static(self._ctx, self.Process,
                                            self._processes,
                                            self._pool, self._inqueue,
                                            self._outqueue, self._initializer,
                                            self._initargs,
                                            self._maxtasksperchild,
                                            self._wrap_exception)

    @staticmethod
    def _repopulate_pool_static(ctx, Process, processes, pool, inqueue,
                                outqueue, initializer, initargs,
                                maxtasksperchild, wrap_exception):
        """Bring the number of pool processes up to the specified number,
        for use after reaping workers which have exited.
        """
        for i in range(processes - len(pool)):
            w = Process(ctx, target=worker,
                        args=(inqueue, outqueue,
                              initializer,
                              initargs, maxtasksperchild,
                              wrap_exception))
            w.name = w.name.replace('Process', 'PoolWorker')
            w.daemon = True
            w.start()
            pool.append(w)
            util.debug('added worker')

    @staticmethod
    def _maintain_pool(ctx, Process, processes, pool, inqueue, outqueue,
                       initializer, initargs, maxtasksperchild,
                       wrap_exception):
        """Clean up any exited workers and start replacements for them.
        """
        if Pool._join_exited_workers(pool):
            Pool._repopulate_pool_static(ctx, Process, processes, pool,
                                         inqueue, outqueue, initializer,
                                         initargs, maxtasksperchild,
                                         wrap_exception)

    def _setup_queues(self):
        self._inqueue = self._ctx.SimpleQueue()
        self._outqueue = self._ctx.SimpleQueue()
        self._quick_put = self._inqueue._writer.send
        self._quick_get = self._outqueue._reader.recv

    def _check_running(self):
        if self._state != RUN:
            raise ValueError("Pool not running")

    def apply(self, func, args=(), kwds={}):
        '''
        Equivalent of `func(*args, **kwds)`.
        Pool must be running.
        '''
        return self.apply_async(func, args, kwds).get()

    def map(self, func, iterable, chunksize=None):
        '''
        Apply `func` to each element in `iterable`, collecting the results
        in a list that is returned.
        '''
        return self._map_async(func, iterable, mapstar, chunksize).get()

    def starmap(self, func, iterable, chunksize=None):
        '''
        Like `map()` method but the elements of the `iterable` are expected to
        be iterables as well and will be unpacked as arguments. Hence
        `func` and (a, b) becomes func(a, b).
        '''
        return self._map_async(func, iterable, starmapstar, chunksize).get()

    def starmap_async(self, func, iterable, chunksize=None, callback=None,
            error_callback=None):
        '''
        Asynchronous version of `starmap()` method.
        '''
        return self._map_async(func, iterable, starmapstar, chunksize,
                               callback, error_callback)

    def _guarded_task_generation(self, result_job, func, iterable):
        '''Provides a generator of tasks for imap and imap_unordered with
        appropriate handling for iterables which throw exceptions during
        iteration.'''
        try:
            i = -1
            for i, x in enumerate(iterable):
                yield (result_job, i, func, (x,), {})
        except Exception as e:
            yield (result_job, i+1, _helper_reraises_exception, (e,), {})

    def imap(self, func, iterable, chunksize=1):
        '''
        Equivalent of `map()` -- can be MUCH slower than `Pool.map()`.
        '''
        self._check_running()
        if chunksize == 1:
            result = IMapIterator(self)
            self._taskqueue.put(
                (
                    self._guarded_task_generation(result._job, func, iterable),
                    result._set_length
                ))
            return result
        else:
            if chunksize < 1:
                raise ValueError(
                    "Chunksize must be 1+, not {0:n}".format(
                        chunksize))
            task_batches = Pool._get_tasks(func, iterable, chunksize)
            result = IMapIterator(self)
            self._taskqueue.put(
                (
                    self._guarded_task_generation(result._job,
                                                  mapstar,
                                                  task_batches),
                    result._set_length
                ))
            return (item for chunk in result for item in chunk)

    def imap_unordered(self, func, iterable, chunksize=1):
        '''
        Like `imap()` method but ordering of results is arbitrary.
        '''
        self._check_running()
        if chunksize == 1:
            result = IMapUnorderedIterator(self)
            self._taskqueue.put(
                (
                    self._guarded_task_generation(result._job, func, iterable),
                    result._set_length
                ))
            return result
        else:
            if chunksize < 1:
                raise ValueError(
                    "Chunksize must be 1+, not {0!r}".format(chunksize))
            task_batches = Pool._get_tasks(func, iterable, chunksize)
            result = IMapUnorderedIterator(self)
            self._taskqueue.put(
                (
                    self._guarded_task_generation(result._job,
                                                  mapstar,
                                                  task_batches),
                    result._set_length
                ))
            return (item for chunk in result for item in chunk)

    def apply_async(self, func, args=(), kwds={}, callback=None,
            error_callback=None):
        '''
        Asynchronous version of `apply()` method.
        '''
        self._check_running()
        result = ApplyResult(self, callback, error_callback)
        self._taskqueue.put(([(result._job, 0, func, args, kwds)], None))
        return result

    def map_async(self, func, iterable, chunksize=None, callback=None,
            error_callback=None):
        '''
        Asynchronous version of `map()` method.
        '''
        return self._map_async(func, iterable, mapstar, chunksize, callback,
            error_callback)

    def _map_async(self, func, iterable, mapper, chunksize=None, callback=None,
            error_callback=None):
        '''
        Helper function to implement map, starmap and their async counterparts.
        '''
        self._check_running()
        if not hasattr(iterable, '__len__'):
            iterable = list(iterable)

        if chunksize is None:
            chunksize, extra = divmod(len(iterable), len(self._pool) * 4)
            if extra:
                chunksize += 1
        if len(iterable) == 0:
            chunksize = 0

        task_batches = Pool._get_tasks(func, iterable, chunksize)
        result = MapResult(self, chunksize, len(iterable), callback,
                           error_callback=error_callback)
        self._taskqueue.put(
            (
                self._guarded_task_generation(result._job,
                                              mapper,
                                              task_batches),
                None
            )
        )
        return result

    @staticmethod
    def _wait_for_updates(sentinels, change_notifier, timeout=None):
        wait(sentinels, timeout=timeout)
        while not change_notifier.empty():
            change_notifier.get()

    @classmethod
    def _handle_workers(cls, cache, taskqueue, ctx, Process, processes,
                        pool, inqueue, outqueue, initializer, initargs,
                        maxtasksperchild, wrap_exception, sentinels,
                        change_notifier):
        thread = threading.current_thread()

        # Keep maintaining workers until the cache gets drained, unless the pool
        # is terminated.
        while thread._state == RUN or (cache and thread._state != TERMINATE):
            cls._maintain_pool(ctx, Process, processes, pool, inqueue,
                               outqueue, initializer, initargs,
                               maxtasksperchild, wrap_exception)

            current_sentinels = [*cls._get_worker_sentinels(pool), *sentinels]

            cls._wait_for_updates(current_sentinels, change_notifier)
        # send sentinel to stop workers
        taskqueue.put(None)
        util.debug('worker handler exiting')

    @staticmethod
    def _handle_tasks(taskqueue, put, outqueue, pool, cache):
        thread = threading.current_thread()

        for taskseq, set_length in iter(taskqueue.get, None):
            task = None
            try:
                # iterating taskseq cannot fail
                for task in taskseq:
                    if thread._state != RUN:
                        util.debug('task handler found thread._state != RUN')
                        break
                    try:
                        put(task)
                    except Exception as e:
                        job, idx = task[:2]
                        try:
                            cache[job]._set(idx, (False, e))
                        except KeyError:
                            pass
                else:
                    if set_length:
                        util.debug('doing set_length()')
                        idx = task[1] if task else -1
                        set_length(idx + 1)
                    continue
                break
            finally:
                task = taskseq = job = None
        else:
            util.debug('task handler got sentinel')

        try:
            # tell result handler to finish when cache is empty
            util.debug('task handler sending sentinel to result handler')
            outqueue.put(None)

            # tell workers there is no more work
            util.debug('task handler sending sentinel to workers')
            for p in pool:
                put(None)
        except OSError:
            util.debug('task handler got OSError when sending sentinels')

        util.debug('task handler exiting')

    @staticmethod
    def _handle_results(outqueue, get, cache):
        thread = threading.current_thread()

        while 1:
            try:
                task = get()
            except (OSError, EOFError):
                util.debug('result handler got EOFError/OSError -- exiting')
                return

            if thread._state != RUN:
                assert thread._state == TERMINATE, "Thread not in TERMINATE"
                util.debug('result handler found thread._state=TERMINATE')
                break

            if task is None:
                util.debug('result handler got sentinel')
                break

            job, i, obj = task
            try:
                cache[job]._set(i, obj)
            except KeyError:
                pass
            task = job = obj = None

        while cache and thread._state != TERMINATE:
            try:
                task = get()
            except (OSError, EOFError):
                util.debug('result handler got EOFError/OSError -- exiting')
                return

            if task is None:
                util.debug('result handler ignoring extra sentinel')
                continue
            job, i, obj = task
            try:
                cache[job]._set(i, obj)
            except KeyError:
                pass
            task = job = obj = None

        if hasattr(outqueue, '_reader'):
            util.debug('ensuring that outqueue is not full')
            # If we don't make room available in outqueue then
            # attempts to add the sentinel (None) to outqueue may
            # block.  There is guaranteed to be no more than 2 sentinels.
            try:
                for i in range(10):
                    if not outqueue._reader.poll():
                        break
                    get()
            except (OSError, EOFError):
                pass

        util.debug('result handler exiting: len(cache)=%s, thread._state=%s',
              len(cache), thread._state)

    @staticmethod
    def _get_tasks(func, it, size):
        it = iter(it)
        while 1:
            x = tuple(itertools.islice(it, size))
            if not x:
                return
            yield (func, x)

    def __reduce__(self):
        raise NotImplementedError(
              'pool objects cannot be passed between processes or pickled'
              )

    def close(self):
        util.debug('closing pool')
        if self._state == RUN:
            self._state = CLOSE
            self._worker_handler._state = CLOSE
            self._change_notifier.put(None)

    def terminate(self):
        util.debug('terminating pool')
        self._state = TERMINATE
        self._terminate()

    def join(self):
        util.debug('joining pool')
        if self._state == RUN:
            raise ValueError("Pool is still running")
        elif self._state not in (CLOSE, TERMINATE):
            raise ValueError("In unknown state")
        self._worker_handler.join()
        self._task_handler.join()
        self._result_handler.join()
        for p in self._pool:
            p.join()

    @staticmethod
    def _help_stuff_finish(inqueue, task_handler, size):
        # task_handler may be blocked trying to put items on inqueue
        util.debug('removing tasks from inqueue until task handler finished')
        inqueue._rlock.acquire()
        while task_handler.is_alive() and inqueue._reader.poll():
            inqueue._reader.recv()
            time.sleep(0)

    @classmethod
    def _terminate_pool(cls, taskqueue, inqueue, outqueue, pool, change_notifier,
                        worker_handler, task_handler, result_handler, cache):
        # this is guaranteed to only be called once
        util.debug('finalizing pool')

        # Notify that the worker_handler state has been changed so the
        # _handle_workers loop can be unblocked (and exited) in order to
        # send the finalization sentinel all the workers.
        worker_handler._state = TERMINATE
        change_notifier.put(None)

        task_handler._state = TERMINATE

        util.debug('helping task handler/workers to finish')
        cls._help_stuff_finish(inqueue, task_handler, len(pool))

        if (not result_handler.is_alive()) and (len(cache) != 0):
            raise AssertionError(
                "Cannot have cache with result_hander not alive")

        result_handler._state = TERMINATE
        change_notifier.put(None)
        outqueue.put(None)                  # sentinel

        # We must wait for the worker handler to exit before terminating
        # workers because we don't want workers to be restarted behind our back.
        util.debug('joining worker handler')
        if threading.current_thread() is not worker_handler:
            worker_handler.join()

        # Terminate workers which haven't already finished.
        if pool and hasattr(pool[0], 'terminate'):
            util.debug('terminating workers')
            for p in pool:
                if p.exitcode is None:
                    p.terminate()

        util.debug('joining task handler')
        if threading.current_thread() is not task_handler:
            task_handler.join()

        util.debug('joining result handler')
        if threading.current_thread() is not result_handler:
            result_handler.join()

        if pool and hasattr(pool[0], 'terminate'):
            util.debug('joining pool workers')
            for p in pool:
                if p.is_alive():
                    # worker has not yet exited
                    util.debug('cleaning up worker %d' % p.pid)
                    p.join()

    def __enter__(self):
        self._check_running()
        return self

    def __exit__(self, exc_type, exc_val, exc_tb):
        self.terminate()

#
# Class whose instances are returned by `Pool.apply_async()`
#

class ApplyResult(object):

    def __init__(self, pool, callback, error_callback):
        self._pool = pool
        self._event = threading.Event()
        self._job = next(job_counter)
        self._cache = pool._cache
        self._callback = callback
        self._error_callback = error_callback
        self._cache[self._job] = self

    def ready(self):
        return self._event.is_set()

    def successful(self):
        if not self.ready():
            raise ValueError("{0!r} not ready".format(self))
        return self._success

    def wait(self, timeout=None):
        self._event.wait(timeout)

    def get(self, timeout=None):
        self.wait(timeout)
        if not self.ready():
            raise TimeoutError
        if self._success:
            return self._value
        else:
            raise self._value

    def _set(self, i, obj):
        self._success, self._value = obj
        if self._callback and self._success:
            self._callback(self._value)
        if self._error_callback and not self._success:
            self._error_callback(self._value)
        self._event.set()
        del self._cache[self._job]
        self._pool = None

AsyncResult = ApplyResult       # create alias -- see #17805

#
# Class whose instances are returned by `Pool.map_async()`
#

class MapResult(ApplyResult):

    def __init__(self, pool, chunksize, length, callback, error_callback):
        ApplyResult.__init__(self, pool, callback,
                             error_callback=error_callback)
        self._success = True
        self._value = [None] * length
        self._chunksize = chunksize
        if chunksize <= 0:
            self._number_left = 0
            self._event.set()
            del self._cache[self._job]
        else:
            self._number_left = length//chunksize + bool(length % chunksize)

    def _set(self, i, success_result):
        self._number_left -= 1
        success, result = success_result
        if success and self._success:
            self._value[i*self._chunksize:(i+1)*self._chunksize] = result
            if self._number_left == 0:
                if self._callback:
                    self._callback(self._value)
                del self._cache[self._job]
                self._event.set()
                self._pool = None
        else:
            if not success and self._success:
                # only store first exception
                self._success = False
                self._value = result
            if self._number_left == 0:
                # only consider the result ready once all jobs are done
                if self._error_callback:
                    self._error_callback(self._value)
                del self._cache[self._job]
                self._event.set()
                self._pool = None

#
# Class whose instances are returned by `Pool.imap()`
#

class IMapIterator(object):

    def __init__(self, pool):
        self._pool = pool
        self._cond = threading.Condition(threading.Lock())
        self._job = next(job_counter)
        self._cache = pool._cache
        self._items = collections.deque()
        self._index = 0
        self._length = None
        self._unsorted = {}
        self._cache[self._job] = self

    def __iter__(self):
        return self

    def next(self, timeout=None):
        with self._cond:
            try:
                item = self._items.popleft()
            except IndexError:
                if self._index == self._length:
                    self._pool = None
                    raise StopIteration from None
                self._cond.wait(timeout)
                try:
                    item = self._items.popleft()
                except IndexError:
                    if self._index == self._length:
                        self._pool = None
                        raise StopIteration from None
                    raise TimeoutError from None

        success, value = item
        if success:
            return value
        raise value

    __next__ = next                    # XXX

    def _set(self, i, obj):
        with self._cond:
            if self._index == i:
                self._items.append(obj)
                self._index += 1
                while self._index in self._unsorted:
                    obj = self._unsorted.pop(self._index)
                    self._items.append(obj)
                    self._index += 1
                self._cond.notify()
            else:
                self._unsorted[i] = obj

            if self._index == self._length:
                del self._cache[self._job]
                self._pool = None

    def _set_length(self, length):
        with self._cond:
            self._length = length
            if self._index == self._length:
                self._cond.notify()
                del self._cache[self._job]
                self._pool = None

#
# Class whose instances are returned by `Pool.imap_unordered()`
#

class IMapUnorderedIterator(IMapIterator):

    def _set(self, i, obj):
        with self._cond:
            self._items.append(obj)
            self._index += 1
            self._cond.notify()
            if self._index == self._length:
                del self._cache[self._job]
                self._pool = None

#
#
#

class ThreadPool(Pool):
    _wrap_exception = False

    @staticmethod
    def Process(ctx, *args, **kwds):
        from .dummy import Process
        return Process(*args, **kwds)

    def __init__(self, processes=None, initializer=None, initargs=()):
        Pool.__init__(self, processes, initializer, initargs)

    def _setup_queues(self):
        self._inqueue = queue.SimpleQueue()
        self._outqueue = queue.SimpleQueue()
        self._quick_put = self._inqueue.put
        self._quick_get = self._outqueue.get

    def _get_sentinels(self):
        return [self._change_notifier._reader]

    @staticmethod
    def _get_worker_sentinels(workers):
        return []

    @staticmethod
    def _help_stuff_finish(inqueue, task_handler, size):
        # drain inqueue, and put sentinels at its head to make workers finish
        try:
            while True:
                inqueue.get(block=False)
        except queue.Empty:
            pass
        for i in range(size):
            inqueue.put(None)

    def _wait_for_updates(self, sentinels, change_notifier, timeout):
        time.sleep(timeout)
multiprocessing/dummy/__init__.py000064400000005765151153537440013264 0ustar00#
# Support for the API of the multiprocessing package using threads
#
# multiprocessing/dummy/__init__.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#

__all__ = [
    'Process', 'current_process', 'active_children', 'freeze_support',
    'Lock', 'RLock', 'Semaphore', 'BoundedSemaphore', 'Condition',
    'Event', 'Barrier', 'Queue', 'Manager', 'Pipe', 'Pool', 'JoinableQueue'
    ]

#
# Imports
#

import threading
import sys
import weakref
import array

from .connection import Pipe
from threading import Lock, RLock, Semaphore, BoundedSemaphore
from threading import Event, Condition, Barrier
from queue import Queue

#
#
#

class DummyProcess(threading.Thread):

    def __init__(self, group=None, target=None, name=None, args=(), kwargs={}):
        threading.Thread.__init__(self, group, target, name, args, kwargs)
        self._pid = None
        self._children = weakref.WeakKeyDictionary()
        self._start_called = False
        self._parent = current_process()

    def start(self):
        if self._parent is not current_process():
            raise RuntimeError(
                "Parent is {0!r} but current_process is {1!r}".format(
                    self._parent, current_process()))
        self._start_called = True
        if hasattr(self._parent, '_children'):
            self._parent._children[self] = None
        threading.Thread.start(self)

    @property
    def exitcode(self):
        if self._start_called and not self.is_alive():
            return 0
        else:
            return None

#
#
#

Process = DummyProcess
current_process = threading.current_thread
current_process()._children = weakref.WeakKeyDictionary()

def active_children():
    children = current_process()._children
    for p in list(children):
        if not p.is_alive():
            children.pop(p, None)
    return list(children)

def freeze_support():
    pass

#
#
#

class Namespace(object):
    def __init__(self, /, **kwds):
        self.__dict__.update(kwds)
    def __repr__(self):
        items = list(self.__dict__.items())
        temp = []
        for name, value in items:
            if not name.startswith('_'):
                temp.append('%s=%r' % (name, value))
        temp.sort()
        return '%s(%s)' % (self.__class__.__name__, ', '.join(temp))

dict = dict
list = list

def Array(typecode, sequence, lock=True):
    return array.array(typecode, sequence)

class Value(object):
    def __init__(self, typecode, value, lock=True):
        self._typecode = typecode
        self._value = value

    @property
    def value(self):
        return self._value

    @value.setter
    def value(self, value):
        self._value = value

    def __repr__(self):
        return '<%s(%r, %r)>'%(type(self).__name__,self._typecode,self._value)

def Manager():
    return sys.modules[__name__]

def shutdown():
    pass

def Pool(processes=None, initializer=None, initargs=()):
    from ..pool import ThreadPool
    return ThreadPool(processes, initializer, initargs)

JoinableQueue = Queue
multiprocessing/dummy/__pycache__/connection.cpython-38.opt-1.pyc000064400000004766151153537440021111 0ustar00U

e5d>�@sRdddgZddlmZdgZGdd�de�Zdd�Zdd	d�ZGd
d�de�ZdS)
�Client�Listener�Pipe�)�QueueNc@sBeZdZddd�Zdd�Zdd�Zed	d
��Zdd�Zd
d�Z	dS)rN�cCst|�|_dS�N)r�_backlog_queue)�self�addressZfamilyZbacklog�r�8/usr/lib64/python3.8/multiprocessing/dummy/connection.py�__init__szListener.__init__cCst|j���Sr)�
Connectionr�get�r	rrr�acceptszListener.acceptcCs
d|_dSr�rrrrr�closeszListener.closecCs|jSrrrrrrr
szListener.addresscCs|Srrrrrr�	__enter__!szListener.__enter__cCs|��dSr�r�r	�exc_type�	exc_valueZexc_tbrrr�__exit__$szListener.__exit__)NNr)
�__name__�
__module__�__qualname__r
rr�propertyr
rrrrrrrs

cCs&t�t�}}|�||f�t||�Sr)r�putr)r
�_in�_outrrrr(sTcCs"t�t�}}t||�t||�fSr)rr)Zduplex�a�brrrr.sc@s6eZdZdd�Zd
dd�Zdd�Zdd	�Zd
d�ZdS)rcCs,||_||_|j|_|_|j|_|_dSr)r rr�sendZ
send_bytesrZrecvZ
recv_bytes)r	rr rrrr
5szConnection.__init__�c	CsN|j��dkrdS|dkrdS|jj�|jj�|�W5QRX|j��dkS)NrTr$F)rZqsizeZ	not_empty�wait)r	Ztimeoutrrr�poll;s
zConnection.pollcCsdSrrrrrrrDszConnection.closecCs|SrrrrrrrGszConnection.__enter__cCs|��dSrrrrrrrJszConnection.__exit__N)r$)rrrr
r&rrrrrrrr3s

	r)T)	�__all__ZqueuerZfamilies�objectrrrrrrrr�<module>
s

multiprocessing/dummy/__pycache__/__init__.cpython-38.opt-1.pyc000064400000007501151153537440020477 0ustar00U

e5d��@sdddddddddd	d
ddd
ddgZddlZddlZddlZddlZddlmZddlmZmZm	Z	m
Z
ddlmZmZm
Z
ddlmZGdd�dej�ZeZejZe��e�_dd�Zdd�ZGdd�de�ZeZeZd'dd�ZGd d!�d!e�Zd"d�Zd#d$�Z d(d&d�Z!eZ"dS))�Process�current_process�active_children�freeze_support�Lock�RLock�	Semaphore�BoundedSemaphore�	Condition�Event�Barrier�Queue�Manager�Pipe�Pool�
JoinableQueue�N�)r)rrrr)r
r	r)rc@s4eZdZddddifdd�Zdd�Zedd��ZdS)	�DummyProcessN�cCs8tj�||||||�d|_t��|_d|_t�|_	dS)NF)
�	threading�Thread�__init__Z_pid�weakref�WeakKeyDictionary�	_children�
_start_calledr�_parent)�self�group�target�name�args�kwargsrr�6/usr/lib64/python3.8/multiprocessing/dummy/__init__.pyr$s

zDummyProcess.__init__cCsN|jt�k	r td�|jt����d|_t|jd�r>d|jj|<tj�	|�dS)Nz,Parent is {0!r} but current_process is {1!r}Tr)
rr�RuntimeError�formatr�hasattrrrr�start�rrrr#r'+s��zDummyProcess.startcCs|jr|��sdSdSdS)Nr)r�is_aliver(rrr#�exitcode5szDummyProcess.exitcode)�__name__�
__module__�__qualname__rr'�propertyr*rrrr#r"s
rcCs2t�j}t|�D]}|��s|�|d�qt|�S�N)rr�listr)�pop)Zchildren�prrr#rDs
cCsdSr/rrrrr#rKsc@seZdZdd�Zdd�ZdS)�	NamespacecKs|j�|�dSr/)�__dict__�update)r�kwdsrrr#rSszNamespace.__init__cCsZt|j���}g}|D]$\}}|�d�s|�d||f�q|��d|jjd�|�fS)N�_z%s=%rz%s(%s)z, )	r0r4�items�
startswith�append�sort�	__class__r+�join)rr8Ztempr �valuerrr#�__repr__Us
zNamespace.__repr__N)r+r,r-rr?rrrr#r3Rsr3TcCst�||�Sr/)�array)�typecodeZsequence�lockrrr#�ArrayasrCc@s8eZdZd
dd�Zedd��Zejdd��Zdd�Zd	S)�ValueTcCs||_||_dSr/)�	_typecode�_value)rrAr>rBrrr#reszValue.__init__cCs|jSr/�rFr(rrr#r>iszValue.valuecCs
||_dSr/rG)rr>rrr#r>mscCsdt|�j|j|jfS)Nz<%s(%r, %r)>)�typer+rErFr(rrr#r?qszValue.__repr__N)T)r+r,r-rr.r>�setterr?rrrr#rDds


rDcCs
tjtSr/)�sys�modulesr+rrrr#r
tscCsdSr/rrrrr#�shutdownwsrLrcCsddlm}||||�S)N�)�
ThreadPool)ZpoolrN)Z	processesZinitializerZinitargsrNrrr#rzs)T)NNr)#�__all__rrJrr@Z
connectionrrrrrr
r	rZqueuerrrrZcurrent_threadrrrrr�objectr3�dictr0rCrDr
rLrrrrrr#�<module>sN�


multiprocessing/dummy/__pycache__/__init__.cpython-38.opt-2.pyc000064400000007501151153537440020500 0ustar00U

e5d��@sdddddddddd	d
ddd
ddgZddlZddlZddlZddlZddlmZddlmZmZm	Z	m
Z
ddlmZmZm
Z
ddlmZGdd�dej�ZeZejZe��e�_dd�Zdd�ZGdd�de�ZeZeZd'dd�ZGd d!�d!e�Zd"d�Zd#d$�Z d(d&d�Z!eZ"dS))�Process�current_process�active_children�freeze_support�Lock�RLock�	Semaphore�BoundedSemaphore�	Condition�Event�Barrier�Queue�Manager�Pipe�Pool�
JoinableQueue�N�)r)rrrr)r
r	r)rc@s4eZdZddddifdd�Zdd�Zedd��ZdS)	�DummyProcessN�cCs8tj�||||||�d|_t��|_d|_t�|_	dS)NF)
�	threading�Thread�__init__Z_pid�weakref�WeakKeyDictionary�	_children�
_start_calledr�_parent)�self�group�target�name�args�kwargsrr�6/usr/lib64/python3.8/multiprocessing/dummy/__init__.pyr$s

zDummyProcess.__init__cCsN|jt�k	r td�|jt����d|_t|jd�r>d|jj|<tj�	|�dS)Nz,Parent is {0!r} but current_process is {1!r}Tr)
rr�RuntimeError�formatr�hasattrrrr�start�rrrr#r'+s��zDummyProcess.startcCs|jr|��sdSdSdS)Nr)r�is_aliver(rrr#�exitcode5szDummyProcess.exitcode)�__name__�
__module__�__qualname__rr'�propertyr*rrrr#r"s
rcCs2t�j}t|�D]}|��s|�|d�qt|�S�N)rr�listr)�pop)Zchildren�prrr#rDs
cCsdSr/rrrrr#rKsc@seZdZdd�Zdd�ZdS)�	NamespacecKs|j�|�dSr/)�__dict__�update)r�kwdsrrr#rSszNamespace.__init__cCsZt|j���}g}|D]$\}}|�d�s|�d||f�q|��d|jjd�|�fS)N�_z%s=%rz%s(%s)z, )	r0r4�items�
startswith�append�sort�	__class__r+�join)rr8Ztempr �valuerrr#�__repr__Us
zNamespace.__repr__N)r+r,r-rr?rrrr#r3Rsr3TcCst�||�Sr/)�array)�typecodeZsequence�lockrrr#�ArrayasrCc@s8eZdZd
dd�Zedd��Zejdd��Zdd�Zd	S)�ValueTcCs||_||_dSr/)�	_typecode�_value)rrAr>rBrrr#reszValue.__init__cCs|jSr/�rFr(rrr#r>iszValue.valuecCs
||_dSr/rG)rr>rrr#r>mscCsdt|�j|j|jfS)Nz<%s(%r, %r)>)�typer+rErFr(rrr#r?qszValue.__repr__N)T)r+r,r-rr.r>�setterr?rrrr#rDds


rDcCs
tjtSr/)�sys�modulesr+rrrr#r
tscCsdSr/rrrrr#�shutdownwsrLrcCsddlm}||||�S)N�)�
ThreadPool)ZpoolrN)Z	processesZinitializerZinitargsrNrrr#rzs)T)NNr)#�__all__rrJrr@Z
connectionrrrrrr
r	rZqueuerrrrZcurrent_threadrrrrr�objectr3�dictr0rCrDr
rLrrrrrr#�<module>sN�


multiprocessing/dummy/__pycache__/connection.cpython-38.pyc000064400000004766151153537440020152 0ustar00U

e5d>�@sRdddgZddlmZdgZGdd�de�Zdd�Zdd	d�ZGd
d�de�ZdS)
�Client�Listener�Pipe�)�QueueNc@sBeZdZddd�Zdd�Zdd�Zed	d
��Zdd�Zd
d�Z	dS)rN�cCst|�|_dS�N)r�_backlog_queue)�self�addressZfamilyZbacklog�r�8/usr/lib64/python3.8/multiprocessing/dummy/connection.py�__init__szListener.__init__cCst|j���Sr)�
Connectionr�get�r	rrr�acceptszListener.acceptcCs
d|_dSr�rrrrr�closeszListener.closecCs|jSrrrrrrr
szListener.addresscCs|Srrrrrr�	__enter__!szListener.__enter__cCs|��dSr�r�r	�exc_type�	exc_valueZexc_tbrrr�__exit__$szListener.__exit__)NNr)
�__name__�
__module__�__qualname__r
rr�propertyr
rrrrrrrs

cCs&t�t�}}|�||f�t||�Sr)r�putr)r
�_in�_outrrrr(sTcCs"t�t�}}t||�t||�fSr)rr)Zduplex�a�brrrr.sc@s6eZdZdd�Zd
dd�Zdd�Zdd	�Zd
d�ZdS)rcCs,||_||_|j|_|_|j|_|_dSr)r rr�sendZ
send_bytesrZrecvZ
recv_bytes)r	rr rrrr
5szConnection.__init__�c	CsN|j��dkrdS|dkrdS|jj�|jj�|�W5QRX|j��dkS)NrTr$F)rZqsizeZ	not_empty�wait)r	Ztimeoutrrr�poll;s
zConnection.pollcCsdSrrrrrrrDszConnection.closecCs|SrrrrrrrGszConnection.__enter__cCs|��dSrrrrrrrJszConnection.__exit__N)r$)rrrr
r&rrrrrrrr3s

	r)T)	�__all__ZqueuerZfamilies�objectrrrrrrrr�<module>
s

multiprocessing/dummy/__pycache__/connection.cpython-38.opt-2.pyc000064400000004766151153537440021112 0ustar00U

e5d>�@sRdddgZddlmZdgZGdd�de�Zdd�Zdd	d�ZGd
d�de�ZdS)
�Client�Listener�Pipe�)�QueueNc@sBeZdZddd�Zdd�Zdd�Zed	d
��Zdd�Zd
d�Z	dS)rN�cCst|�|_dS�N)r�_backlog_queue)�self�addressZfamilyZbacklog�r�8/usr/lib64/python3.8/multiprocessing/dummy/connection.py�__init__szListener.__init__cCst|j���Sr)�
Connectionr�get�r	rrr�acceptszListener.acceptcCs
d|_dSr�rrrrr�closeszListener.closecCs|jSrrrrrrr
szListener.addresscCs|Srrrrrr�	__enter__!szListener.__enter__cCs|��dSr�r�r	�exc_type�	exc_valueZexc_tbrrr�__exit__$szListener.__exit__)NNr)
�__name__�
__module__�__qualname__r
rr�propertyr
rrrrrrrs

cCs&t�t�}}|�||f�t||�Sr)r�putr)r
�_in�_outrrrr(sTcCs"t�t�}}t||�t||�fSr)rr)Zduplex�a�brrrr.sc@s6eZdZdd�Zd
dd�Zdd�Zdd	�Zd
d�ZdS)rcCs,||_||_|j|_|_|j|_|_dSr)r rr�sendZ
send_bytesrZrecvZ
recv_bytes)r	rr rrrr
5szConnection.__init__�c	CsN|j��dkrdS|dkrdS|jj�|jj�|�W5QRX|j��dkS)NrTr$F)rZqsizeZ	not_empty�wait)r	Ztimeoutrrr�poll;s
zConnection.pollcCsdSrrrrrrrDszConnection.closecCs|SrrrrrrrGszConnection.__enter__cCs|��dSrrrrrrrJszConnection.__exit__N)r$)rrrr
r&rrrrrrrr3s

	r)T)	�__all__ZqueuerZfamilies�objectrrrrrrrr�<module>
s

multiprocessing/dummy/__pycache__/__init__.cpython-38.pyc000064400000007501151153537440017540 0ustar00U

e5d��@sdddddddddd	d
ddd
ddgZddlZddlZddlZddlZddlmZddlmZmZm	Z	m
Z
ddlmZmZm
Z
ddlmZGdd�dej�ZeZejZe��e�_dd�Zdd�ZGdd�de�ZeZeZd'dd�ZGd d!�d!e�Zd"d�Zd#d$�Z d(d&d�Z!eZ"dS))�Process�current_process�active_children�freeze_support�Lock�RLock�	Semaphore�BoundedSemaphore�	Condition�Event�Barrier�Queue�Manager�Pipe�Pool�
JoinableQueue�N�)r)rrrr)r
r	r)rc@s4eZdZddddifdd�Zdd�Zedd��ZdS)	�DummyProcessN�cCs8tj�||||||�d|_t��|_d|_t�|_	dS)NF)
�	threading�Thread�__init__Z_pid�weakref�WeakKeyDictionary�	_children�
_start_calledr�_parent)�self�group�target�name�args�kwargsrr�6/usr/lib64/python3.8/multiprocessing/dummy/__init__.pyr$s

zDummyProcess.__init__cCsN|jt�k	r td�|jt����d|_t|jd�r>d|jj|<tj�	|�dS)Nz,Parent is {0!r} but current_process is {1!r}Tr)
rr�RuntimeError�formatr�hasattrrrr�start�rrrr#r'+s��zDummyProcess.startcCs|jr|��sdSdSdS)Nr)r�is_aliver(rrr#�exitcode5szDummyProcess.exitcode)�__name__�
__module__�__qualname__rr'�propertyr*rrrr#r"s
rcCs2t�j}t|�D]}|��s|�|d�qt|�S�N)rr�listr)�pop)Zchildren�prrr#rDs
cCsdSr/rrrrr#rKsc@seZdZdd�Zdd�ZdS)�	NamespacecKs|j�|�dSr/)�__dict__�update)r�kwdsrrr#rSszNamespace.__init__cCsZt|j���}g}|D]$\}}|�d�s|�d||f�q|��d|jjd�|�fS)N�_z%s=%rz%s(%s)z, )	r0r4�items�
startswith�append�sort�	__class__r+�join)rr8Ztempr �valuerrr#�__repr__Us
zNamespace.__repr__N)r+r,r-rr?rrrr#r3Rsr3TcCst�||�Sr/)�array)�typecodeZsequence�lockrrr#�ArrayasrCc@s8eZdZd
dd�Zedd��Zejdd��Zdd�Zd	S)�ValueTcCs||_||_dSr/)�	_typecode�_value)rrAr>rBrrr#reszValue.__init__cCs|jSr/�rFr(rrr#r>iszValue.valuecCs
||_dSr/rG)rr>rrr#r>mscCsdt|�j|j|jfS)Nz<%s(%r, %r)>)�typer+rErFr(rrr#r?qszValue.__repr__N)T)r+r,r-rr.r>�setterr?rrrr#rDds


rDcCs
tjtSr/)�sys�modulesr+rrrr#r
tscCsdSr/rrrrr#�shutdownwsrLrcCsddlm}||||�S)N�)�
ThreadPool)ZpoolrN)Z	processesZinitializerZinitargsrNrrr#rzs)T)NNr)#�__all__rrJrr@Z
connectionrrrrrr
r	rZqueuerrrrZcurrent_threadrrrrr�objectr3�dictr0rCrDr
rLrrrrrr#�<module>sN�


multiprocessing/dummy/connection.py000064400000003076151153537440013655 0ustar00#
# Analogue of `multiprocessing.connection` which uses queues instead of sockets
#
# multiprocessing/dummy/connection.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#

__all__ = [ 'Client', 'Listener', 'Pipe' ]

from queue import Queue


families = [None]


class Listener(object):

    def __init__(self, address=None, family=None, backlog=1):
        self._backlog_queue = Queue(backlog)

    def accept(self):
        return Connection(*self._backlog_queue.get())

    def close(self):
        self._backlog_queue = None

    @property
    def address(self):
        return self._backlog_queue

    def __enter__(self):
        return self

    def __exit__(self, exc_type, exc_value, exc_tb):
        self.close()


def Client(address):
    _in, _out = Queue(), Queue()
    address.put((_out, _in))
    return Connection(_in, _out)


def Pipe(duplex=True):
    a, b = Queue(), Queue()
    return Connection(a, b), Connection(b, a)


class Connection(object):

    def __init__(self, _in, _out):
        self._out = _out
        self._in = _in
        self.send = self.send_bytes = _out.put
        self.recv = self.recv_bytes = _in.get

    def poll(self, timeout=0.0):
        if self._in.qsize() > 0:
            return True
        if timeout <= 0.0:
            return False
        with self._in.not_empty:
            self._in.not_empty.wait(timeout)
        return self._in.qsize() > 0

    def close(self):
        pass

    def __enter__(self):
        return self

    def __exit__(self, exc_type, exc_value, exc_tb):
        self.close()
multiprocessing/popen_forkserver.py000064400000004266151153537440013756 0ustar00import io
import os

from .context import reduction, set_spawning_popen
if not reduction.HAVE_SEND_HANDLE:
    raise ImportError('No support for sending fds between processes')
from . import forkserver
from . import popen_fork
from . import spawn
from . import util


__all__ = ['Popen']

#
# Wrapper for an fd used while launching a process
#

class _DupFd(object):
    def __init__(self, ind):
        self.ind = ind
    def detach(self):
        return forkserver.get_inherited_fds()[self.ind]

#
# Start child process using a server process
#

class Popen(popen_fork.Popen):
    method = 'forkserver'
    DupFd = _DupFd

    def __init__(self, process_obj):
        self._fds = []
        super().__init__(process_obj)

    def duplicate_for_child(self, fd):
        self._fds.append(fd)
        return len(self._fds) - 1

    def _launch(self, process_obj):
        prep_data = spawn.get_preparation_data(process_obj._name)
        buf = io.BytesIO()
        set_spawning_popen(self)
        try:
            reduction.dump(prep_data, buf)
            reduction.dump(process_obj, buf)
        finally:
            set_spawning_popen(None)

        self.sentinel, w = forkserver.connect_to_new_process(self._fds)
        # Keep a duplicate of the data pipe's write end as a sentinel of the
        # parent process used by the child process.
        _parent_w = os.dup(w)
        self.finalizer = util.Finalize(self, util.close_fds,
                                       (_parent_w, self.sentinel))
        with open(w, 'wb', closefd=True) as f:
            f.write(buf.getbuffer())
        self.pid = forkserver.read_signed(self.sentinel)

    def poll(self, flag=os.WNOHANG):
        if self.returncode is None:
            from multiprocessing.connection import wait
            timeout = 0 if flag == os.WNOHANG else None
            if not wait([self.sentinel], timeout):
                return None
            try:
                self.returncode = forkserver.read_signed(self.sentinel)
            except (OSError, EOFError):
                # This should not happen usually, but perhaps the forkserver
                # process itself got killed
                self.returncode = 255

        return self.returncode
multiprocessing/__pycache__/forkserver.cpython-38.pyc000064400000020251151153537440017033 0ustar00U

e5d�0�@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddl	mZddlm
Z
ddl	mZddl	mZddl	mZd	d
ddgZd
Ze�d�ZGdd�de�Zddd�Zdd�Zdd�Zdd�Ze�ZejZejZejZejZdS)�N�)�
connection)�process)�	reduction)�resource_tracker)�spawn)�util�ensure_running�get_inherited_fds�connect_to_new_process�set_forkserver_preload��qc@sDeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�
ForkServercCs.d|_d|_d|_d|_t��|_dg|_dS)N�__main__)�_forkserver_address�_forkserver_alive_fd�_forkserver_pid�_inherited_fds�	threadingZLock�_lock�_preload_modules��self�r�2/usr/lib64/python3.8/multiprocessing/forkserver.py�__init__"s
zForkServer.__init__c	Cs|j�|��W5QRXdS�N)r�_stop_unlockedrrrr�_stop*szForkServer._stopcCsV|jdkrdSt�|j�d|_t�|jd�d|_t�|j�sLt�|j�d|_dS)Nr)	r�os�closer�waitpidr�is_abstract_socket_namespacer�unlinkrrrrr/s
zForkServer._stop_unlockedcCs&tdd�|jD��std��||_dS)z>Set list of module names to try to load in forkserver process.css|]}t|�tkVqdSr)�type�str)�.0�modrrr�	<genexpr>@sz4ForkServer.set_forkserver_preload.<locals>.<genexpr>z&module_names must be a list of stringsN)�allr�	TypeError)rZ
modules_namesrrrr>sz!ForkServer.set_forkserver_preloadcCs|jS)z�Return list of fds inherited from parent process.

        This returns None if the current process was not started by fork
        server.
        )rrrrrr
DszForkServer.get_inherited_fdsc
Cs�|��t|�dtkr td��t�tj���}|�|j�t�	�\}}t�	�\}}|||j
t��g}||7}zNz&t�||�||fWW�4W5QR�St�
|�t�
|��YnXW5t�
|�t�
|�XW5QRXdS)a;Request forkserver to create a child process.

        Returns a pair of fds (status_r, data_w).  The calling process can read
        the child process's pid and (eventually) its returncode from status_r.
        The calling process should write to data_w the pickled preparation and
        process data.
        �ztoo many fdsN)r	�len�MAXFDS_TO_SEND�
ValueError�socket�AF_UNIXZconnectrr �piperrZgetfdr!rZsendfds)r�fdsZclientZparent_r�child_w�child_rZparent_wZallfdsrrrrLs(�


z!ForkServer.connect_to_new_processcs�|j��~t��|jdk	r`t�|jtj�\}}|sBW5QR�dSt�|j�d|_	d|_d|_d}|j
r�ddh�t�d�}�fdd�|�
�D�}ni}t�tj���}t�d�}|�|�t�|�s�t�|d	�|��t��\}}ztzV|��|g}	||��||j
|f;}t��}
|
gt��}|d
|g7}t�|
||	�}Wnt�|��YnXW5t�|�X||_	||_||_W5QRXW5QRXdS)z�Make sure that a fork server is running.

        This can be called from any process.  Note that usually a child
        process will just reuse the forkserver started by its parent, so
        ensure_running() will do nothing.
        NzCfrom multiprocessing.forkserver import main; main(%d, %d, %r, **%r)�	main_path�sys_path�ignorecsi|]\}}|�kr||�qSrr)r'�x�y�Zdesired_keysrr�
<dictcomp>�sz-ForkServer.ensure_running.<locals>.<dictcomp>r1i�z-c)rrr	rr r"�WNOHANGr!rrrrZget_preparation_data�itemsr0r1rZarbitrary_addressZbindrr#�chmodZlistenr2�filenoZget_executableZ_args_from_interpreter_flagsZspawnv_passfds)r�pidZstatus�cmd�data�listenerZaddress�alive_rZalive_wZfds_to_passZexe�argsrr;rr	isN





�
zForkServer.ensure_runningN)
�__name__�
__module__�__qualname__rrrrr
rr	rrrrr srcCs�|rdd|kr8|dk	r8dt��_zt�|�W5t��`X|D]&}zt|�Wq<tk
r`Yq<Xq<t��t	�
�\}}t	�|d�t	�|d�dd�}tj
|tjtji}	dd�|	��D�}
t�|�i}tjtj|d	���}t�����}
|��t_|
�|tj�|
�|tj�|
�|tj��z�d
d�|
��D�}|�r"�qB�q"||k�rjt	�|d�d
k�sftd��t�||k�r\t	�|d�zt	�dt	j �\}}Wnt!k
�r�Y�q\YnX|dk�rq\|�"|d�}|dk	�rJt	�#|��r�t	�$|�}n&t	�%|��std�&||���t	�'|�}zt(||�Wnt)k
�r<YnXt	�*|�nt+�,d|��q�||k�r�|�-�d��,}t.�/|t0d�}t1|�t0k�r�t2d�&t1|����|^}}}|�*�t	�3�}|dk�rNd}zpz<|�*�|
�*�||||g}|�5|�6��t7||||
�}Wn.t8k
�r:t9j:t9�;��t9j<�=�YnXW5t	�4|�XnNzt(||�Wnt)k
�rrYnX|||<t	�*|�|D]}t	�*|��q�W5QRXWn4t>k
�r�}z|j?t?j@k�r̂W5d}~XYnX�qW5QRXW5QRXdS)zRun forkserver.rNTFcWsdSrr)Z_unusedrrr�sigchld_handler�szmain.<locals>.sigchld_handlercSsi|]\}}|t�||��qSr)�signal)r'�sig�valrrrr<�s�zmain.<locals>.<dictcomp>)r@cSsg|]\}}|j�qSr)Zfileobj)r'�keyZeventsrrr�
<listcomp>�szmain.<locals>.<listcomp>r�zNot at EOF?i���rzChild {0:n} status is {1:n}z.forkserver: waitpid returned unexpected pid %dzToo many ({0:n}) fds to send)ArZcurrent_processZ_inheritingrZimport_main_path�
__import__�ImportErrorrZ_close_stdinr r2�set_blockingrK�SIGCHLD�SIGINT�SIG_IGNr>�
set_wakeup_fdr0r1�	selectorsZDefaultSelectorZgetsockname�_forkserverr�registerZ
EVENT_READZselect�read�AssertionError�
SystemExitr"r=�ChildProcessError�pop�WIFSIGNALED�WTERMSIG�	WIFEXITED�format�WEXITSTATUS�write_signed�BrokenPipeErrorr!�warnings�warnZacceptrZrecvfdsr.r-�RuntimeError�fork�_exit�extend�values�
_serve_one�	Exception�sys�
excepthook�exc_info�stderr�flush�OSError�errnoZECONNABORTED)Zlistener_fdrEZpreloadr6r7�modnameZsig_rZsig_wrJ�handlersZold_handlersZ	pid_to_fdrDZselectorZrfdsrA�stsr4�
returncode�sr3r5�code�
unused_fds�fd�errr�main�s�

��
�




��
�

��

�
r�c	Csht�d�|��D]\}}t�||�q|D]}t�|�q,|^t_tj_	t_
t�|�}t�
||�}|S)NrQ)rKrXr>r r!rZrrZ_resource_trackerZ_fdr�duprZ_main)	r5r3r~ryrLrMrZparent_sentinelr}rrrro1s
�
rocCsNd}tj}t|�|kr@t�||t|��}|s6td��||7}q
t�|�dS)NrPzunexpected EOFr)�
SIGNED_STRUCT�sizer-r r\�EOFErrorZunpack)rrCZlengthr|rrr�read_signedHs
r�cCs<t�|�}|r8t�||�}|dkr*td��||d�}q
dS)Nrzshould not get here)r�Zpackr �writerj)r�n�msg�nbytesrrrrfRs
rf)NN) rwr rYrKr0Zstructrqrrh�rr�contextrrrr�__all__r.ZStructr��objectrr�ror�rfrZr	r
rrrrrr�<module>s>�


multiprocessing/__pycache__/managers.cpython-38.opt-2.pyc000064400000110760151153537440017405 0ustar00U

e5d��@sBdddddgZddlZddlZddlZddlZddlZddlZddlZddlmZddl	m
Z
d	d
lmZd	dl
mZmZmZd	dlmZd	d
lmZd	dlmZd	dlmZzd	dlmZdZWnek
r�dZYnXdd�Ze�eje�dd�dD�Zedek	�r.dd�ZeD]Ze�ee��qGdd�de�Zdifdd�Z dd�Z!Gd d!�d!e"�Z#d"d#�Z$d$d%�Z%Gd&d'�d'e�Z&Gd(d)�d)e�Z'ej(ej)fej*ej+fd*�Z,Gd+d�de�Z-Gd,d-�d-e.�Z/Gd.d�de�Z0d/d0�Z1ifd1d2�Z2dld3d4�Z3Gd5d6�d6e�Z4Gd7d8�d8e�Z5dmd9d:�Z6Gd;d<�d<e0�Z7Gd=d>�d>e0�Z8Gd?d@�d@e8�Z9GdAdB�dBe0�Z:GdCdD�dDe0�Z;GdEdF�dFe0�Z<GdGdH�dHe0�Z=e2dIdJ�Z>GdKdL�dLe>�Z?e2dMdN�Z@dOdPie@_Ae2dQdR�ZBe2dSdT�ZCdUdUdUdPdPdV�eC_AGdWdS�dSeC�ZDGdXd�de-�ZEeE�dYejF�eE�dZejF�eE�d[ejGe:�eE�d\ejHe8�eE�d]ejIe8�eE�d^ejJe8�eE�d_ejKe8�eE�d`ejLe9�eE�daejMe;�eE�dbejNeD�eE�dcee?�eE�ddeOe@�eE�d8e5e=�eE�d:e6eB�eE�d6e4e<�eEjdPe7dde�eEjdUddf�e�r>Gdgdh�dh�ZPGdidj�dje&�ZQGdkd�de-�ZRdS)n�BaseManager�SyncManager�	BaseProxy�Token�SharedMemoryManager�N)�getpid)�
format_exc�)�
connection)�	reduction�get_spawning_popen�ProcessError)�pool)�process)�util)�get_context)�
shared_memoryTFcCstj|j|��ffS�N)�array�typecode�tobytes)�a�r�0/usr/lib64/python3.8/multiprocessing/managers.py�reduce_array-srcCsg|]}tti|����qSr)�type�getattr��.0�namerrr�
<listcomp>1sr )�items�keys�valuescCstt|�ffSr)�list��objrrr�rebuild_as_list3sr'c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r��typeid�address�idcCs||||_|_|_dSrr()�selfr)r*r+rrr�__init__BszToken.__init__cCs|j|j|jfSrr(�r,rrr�__getstate__EszToken.__getstate__cCs|\|_|_|_dSrr(�r,�staterrr�__setstate__HszToken.__setstate__cCsd|jj|j|j|jfS)Nz %s(typeid=%r, address=%r, id=%r))�	__class__�__name__r)r*r+r.rrr�__repr__Ks�zToken.__repr__N)r4�
__module__�__qualname__�	__slots__r-r/r2r5rrrrr<s
rcCs8|�||||f�|��\}}|dkr*|St||��dS)N�#RETURN)�send�recv�convert_to_error)�cr+�
methodname�args�kwds�kind�resultrrr�dispatchSs
rCcCsd|dkr|S|dkrRt|t�s4td�||t|����|dkrHtd|�St|�Sntd�|��SdS)N�#ERROR)�
#TRACEBACK�#UNSERIALIZABLEz.Result {0!r} (kind '{1}') type is {2}, not strrFzUnserializable message: %s
zUnrecognized message type {!r})�
isinstance�str�	TypeError�formatr�RemoteError�
ValueError)rArBrrrr<]s
��
r<c@seZdZdd�ZdS)rKcCsdt|jd�dS)NzM
---------------------------------------------------------------------------
rzK---------------------------------------------------------------------------)rHr?r.rrr�__str__mszRemoteError.__str__N)r4r6r7rMrrrrrKlsrKcCs2g}t|�D] }t||�}t|�r|�|�q|Sr)�dirr�callable�append)r&�tempr�funcrrr�all_methodsts
rScCsdd�t|�D�S)NcSsg|]}|ddkr|�qS)r�_rrrrrr �sz"public_methods.<locals>.<listcomp>)rSr%rrr�public_methodssrUc	@s�eZdZddddddddd	g	Zd
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Z	dd�Z
dd�Ze
ee	d�Zdd�Z
dd�Zdd �Zd!d"�Zd#d$�Zd%e_d&d'�Zd(d)�Zd*d+�Zd,d-�Zd.S)/�Server�shutdown�create�accept_connection�get_methods�
debug_info�number_of_objects�dummy�incref�decrefcCsxt|t�std�|t|����||_t�|�|_t	|\}}||dd�|_
|j
j|_ddi|_i|_
i|_t��|_dS)Nz&Authkey {0!r} is type {1!s}, not bytes�)r*Zbacklog�0�Nr)rG�bytesrIrJr�registryr�AuthenticationString�authkey�listener_client�listenerr*�	id_to_obj�id_to_refcount�id_to_local_proxy_obj�	threading�Lock�mutex)r,rdr*rf�
serializer�Listener�Clientrrrr-�s 
��

zServer.__init__c	Cs�t��|_|t��_zVtj|jd�}d|_|��z|j��sL|j�d�q4Wnttfk
rfYnXW5tjtjkr�t	�
d�tjt_tjt_t�
d�XdS)Nzresetting stdout, stderrr)�targetTr	)rl�Event�
stop_eventr�current_process�_manager_server�sys�stdout�
__stdout__r�debug�
__stderr__�stderr�exit�Thread�accepter�daemon�start�is_set�wait�KeyboardInterrupt�
SystemExit)r,rrrr�
serve_forever�s 




zServer.serve_forevercCsNz|j��}Wntk
r&YqYnXtj|j|fd�}d|_|��qdS)N�rrr?T)rhZaccept�OSErrorrlr~�handle_requestr�r�)r,r=�trrrr�s
zServer.acceptercCs4d}}}z>t�||j�t�||j�|��}|\}}}}t||�}Wntk
rhdt�f}	Yn>Xz||f|�|�}Wntk
r�dt�f}	Yn
Xd|f}	z|�|	�Wnrtk
�r&}
zRz|�dt�f�Wntk
r�YnXt	�
d|	�t	�
d|�t	�
d|
�W5d}
~
XYnX|��dS)NrEr9zFailure to send message: %rz ... request was %r� ... exception was %r)r
Zdeliver_challengerfZanswer_challenger;r�	Exceptionrr:r�info�close)r,r=�funcnamerB�request�ignorer?r@rR�msg�errrr��s2zServer.handle_requestc
Cs�t�dt��j�|j}|j}|j}|j�	��s�zBd}}|�}|\}}}	}
z||\}}}Wn^t
k
r�}
z@z|j|\}}}Wn&t
k
r�}z|
�W5d}~XYnXW5d}
~
XYnX||kr�td|t
|�|f��t||�}z||	|
�}Wn,tk
�r"}zd|f}W5d}~XYnPX|�o4|�|d�}|�rj|�|||�\}}t||j|�}d||ff}nd|f}Wn�tk
�r�|dk�r�dt�f}nNz,|j|}|||||f|	�|
�}d|f}Wn tk
�r�dt�f}YnXYnPtk
�rt�dt��j�t�d�Yn tk
�r<dt�f}YnXzDz||�Wn2tk
�r~}z|d	t�f�W5d}~XYnXWq$tk
�r�}z@t�d
t��j�t�d|�t�d|�|��t�d
�W5d}~XYq$Xq$dS)Nz$starting server thread to service %rz+method %r of %r object is not in exposed=%rrD�#PROXYr9rEz$got EOF -- exiting thread serving %rrrFzexception in thread serving %rz ... message was %rr�r	)rrzrl�current_threadrr;r:rirtr��KeyErrorrk�AttributeErrorrrr��getrXrr*r�fallback_mapping�EOFErrorrwr}r�r�)r,�connr;r:rir>r&r��identr?r@�exposed�	gettypeid�keZ	second_keZfunction�resr�r�r)ZridentZrexposed�tokenZ
fallback_funcrBrrr�serve_client�s���(��


����$�zServer.serve_clientcCs|Srr�r,r�r�r&rrr�fallback_getvalue5szServer.fallback_getvaluecCst|�Sr�rHr�rrr�fallback_str8szServer.fallback_strcCst|�Sr)�reprr�rrr�
fallback_repr;szServer.fallback_repr)rMr5�	#GETVALUEcCsdSrr�r,r=rrrr]DszServer.dummyc
Cs�|j�tg}t|j���}|��|D]<}|dkr&|�d||j|t|j|d�dd�f�q&d�|�W5QR�SQRXdS)Nraz  %s:       refcount=%s
    %sr�K�
)	rnr$rjr"�sortrPrHri�join)r,r=rBr"r�rrrr[Gs
��zServer.debug_infocCs
t|j�Sr)�lenrjr�rrrr\WszServer.number_of_objectscCsLz:zt�d�|�d�Wnddl}|��YnXW5|j��XdS)Nz!manager received shutdown message�r9Nr)rt�setrrzr:�	traceback�	print_exc)r,r=r�rrrrW^s
zServer.shutdownc	Os�t|�dkr|^}}}}n�|s(td��n�d|krDtdt|�d��|�d�}t|�dkr~|^}}}ddl}|jdtdd	�nFd
|kr�tdt|�d��|�d
�}|^}}ddl}|jdtdd	�t|�}|j��|j|\}}}}	|dk�r|�st|�dk�rt	d��|d}
n
|||�}
|dk�r2t
|
�}|dk	�rlt|t��s\td
�
|t|����t|�t|�}dt|
�}t�d||�|
t|�|f|j|<||jk�r�d|j|<W5QRX|�||�|t|�fS)N�z8descriptor 'create' of 'Server' object needs an argumentr)�7create expected at least 2 positional arguments, got %dr	�rz2Passing 'typeid' as keyword argument is deprecated)�
stacklevelr=z-Passing 'c' as keyword argument is deprecatedz4Without callable, must have one non-keyword argumentz,Method_to_typeid {0!r}: type {1!s}, not dictz%xz&%r callable returned object with id %r)r�rI�pop�warnings�warn�DeprecationWarning�tuplernrdrLrUrG�dictrJrr$r+rrzr�rirjr^)r?r@r,r=r)r�rOr��method_to_typeid�	proxytyper&r�rrrrXksp

�

�
�
��

�



��z
Server.createz$($self, c, typeid, /, *args, **kwds)cCst|j|jd�S)Nr	)r�rir+)r,r=r�rrrrZ�szServer.get_methodscCs"|t��_|�d�|�|�dS)Nr�)rlr�rr:r�)r,r=rrrrrY�s

zServer.accept_connectioncCs�|j��z|j|d7<Wnhtk
r�}zJ||jkrrd|j|<|j||j|<|j|\}}}t�d|�n|�W5d}~XYnXW5QRXdS)Nr	z&Server re-enabled tracking & INCREF %r)rnrjr�rkrirrz)r,r=r�r�r&r�r�rrrr^�s

�z
Server.increfc	Cs�||jkr$||jkr$t�d|�dS|j�Z|j|dkrXtd�||j||j|���|j|d8<|j|dkr�|j|=W5QRX||jkr�d|j|<t�d|�|j�|j|=W5QRXdS)NzServer DECREF skipping %rrz+Id {0!s} ({1!r}) has refcount {2:n}, not 1+r	)NrNzdisposing of obj with id %r)rjrkrrzrn�AssertionErrorrJri)r,r=r�rrrr_�s,
���

z
Server.decrefN)r4r6r7�publicr-r�rr�r�r�r�r�r�r]r[r\rWrX�__text_signature__rZrYr^r_rrrrrV�s:�
"Q�
=rVc@seZdZdgZdZdZdZdS)�State�valuerr	r�N)r4r6r7r8�INITIAL�STARTED�SHUTDOWNrrrrr��sr�)�pickleZ	xmlrpclibc@s�eZdZiZeZd!dd�Zdd�Zdd�Zd"d
d�Z	e
d#dd
��Zdd�Zd$dd�Z
dd�Zdd�Zdd�Zdd�Zedd��Zedd��Ze
d%dd ��ZdS)&rNr�cCs\|dkrt��j}||_t�|�|_t�|_tj|j_	||_
t|\|_|_
|pTt�|_dSr)rrurf�_addressre�_authkeyr��_stater�r��_serializerrgZ	_Listener�_Clientr�_ctx)r,r*rfroZctxrrrr-s

zBaseManager.__init__cCsf|jjtjkrP|jjtjkr&td��n*|jjtjkr>td��ntd�|jj���t|j	|j
|j|j�S)N�Already started server�Manager has shut down�Unknown state {!r})
r�r�r�r�r�r
r�rJrV�	_registryr�r�r�r.rrr�
get_servers

�
�zBaseManager.get_servercCs8t|j\}}||j|jd�}t|dd�tj|j_dS)N�rfr])	rgr�r�r�rCr�r�r�r�)r,rprqr�rrr�connectszBaseManager.connectrc	Cs4|jjtjkrP|jjtjkr&td��n*|jjtjkr>td��ntd�|jj���|dk	rht|�sht	d��t
jdd�\}}|jj
t|�j|j|j|j|j|||fd�|_d�d	d
�|jjD��}t|�jd||j_|j��|��|��|_|��tj|j_tj|t|�j|j|j|j|j|jfdd
�|_ dS)Nr�r�r�zinitializer must be a callableF)Zduplexr��:css|]}t|�VqdSrr�)r�irrr�	<genexpr>Asz$BaseManager.start.<locals>.<genexpr>�-r�r?Zexitpriority)!r�r�r�r�r�r
r�rJrOrIr
ZPiper�ZProcessr�_run_serverr�r�r�r��_processr�Z	_identityr4rr�r�r;r�Finalize�_finalize_managerr�rW)r,�initializer�initargs�reader�writerr�rrrr�(sH

���


��zBaseManager.startc	Cs^t�tjtj�|dk	r ||�|�||||�}|�|j�|��t�d|j�|�	�dS)Nzmanager serving at %r)
�signal�SIGINT�SIG_IGN�_Serverr:r*r�rr�r�)	�clsrdr*rfror�r�r��serverrrrr�SszBaseManager._run_servercOsN|j|j|jd�}zt|dd|f||�\}}W5|��Xt||j|�|fS)Nr�rX)r�r�r�r�rCr)r,r)r?r@r�r+r�rrr�_createjs

zBaseManager._createcCs*|jdk	r&|j�|�|j��s&d|_dSr)r�r��is_alive�r,�timeoutrrrr�vs

zBaseManager.joincCs2|j|j|jd�}zt|dd�W�S|��XdS)Nr�r[�r�r�r�r�rC�r,r�rrr�_debug_infoszBaseManager._debug_infocCs2|j|j|jd�}zt|dd�W�S|��XdS)Nr�r\r�r�rrr�_number_of_objects�szBaseManager._number_of_objectscCsj|jjtjkr|��|jjtjkrf|jjtjkr<td��n*|jjtjkrTtd��ntd�|jj���|S)NzUnable to start serverr�r�)	r�r�r�r�r�r�r
r�rJr.rrr�	__enter__�s

�zBaseManager.__enter__cCs|��dSr)rW�r,�exc_typeZexc_valZexc_tbrrr�__exit__�szBaseManager.__exit__cCs�|��r�t�d�z,|||d�}zt|dd�W5|��XWntk
rRYnX|jdd�|��r�t�d�t|d�r�t�d�|��|jd	d�|��r�t�d
�t	j
|_ztj
|=Wntk
r�YnXdS)Nz#sending shutdown message to managerr�rWg�?)r�zmanager still alive�	terminatez'trying to `terminate()` manager processg�������?z#manager still alive after terminate)r�rr�r�rCr�r��hasattrr�r�r�r�r�_address_to_localr�)rr*rfr1r�r�rrrr��s.




zBaseManager._finalize_managercCs|jSr)r�r.rrrr*�szBaseManager.addressTc
s�d|jkr|j��|_�dkr"t�|p0t�dd�}|p@t�dd�}|r\t|���D]\}}qR|||�f|j�<|r���fdd�}	�|	_t|�|	�dS)Nr��	_exposed_�_method_to_typeid_cs`t�d��|j�f|�|�\}}�||j||j|d�}|j|j|jd�}t|dd|jf�|S)Nz)requesting creation of a shared %r object��managerrfr�r�r_)	rrzr�r�r�r�r*rCr+)r,r?r@r�Zexp�proxyr��r�r)rrrQ�s�z"BaseManager.register.<locals>.temp)	�__dict__r��copy�	AutoProxyrr$r!r4�setattr)
r�r)rOr�r�r��
create_method�keyr�rQrr�r�register�s(

��

zBaseManager.register)NNr�N)Nr)Nr)N)NNNNT)r4r6r7r�rVr�r-r�r�r��classmethodr�r�r�r�r�r�r��staticmethodr��propertyr*rrrrrr�s6�
	
+�
	




�c@seZdZdd�Zdd�ZdS)�ProcessLocalSetcCst�|dd��dS)NcSs|��Sr)�clearr%rrr�<lambda>��z*ProcessLocalSet.__init__.<locals>.<lambda>)r�register_after_forkr.rrrr-�szProcessLocalSet.__init__cCst|�dfSrb)rr.rrr�
__reduce__�szProcessLocalSet.__reduce__N)r4r6r7r-r
rrrrr�src@s|eZdZiZe��Zddd�Zdd�Zdifd	d
�Z	dd�Z
d
d�Zedd��Z
dd�Zdd�Zdd�Zdd�Zdd�ZdS)rNTFc		Cs�tj�8tj�|jd�}|dkr:t��t�f}|tj|j<W5QRX|d|_|d|_	||_
|j
j|_||_
||_t|d|_||_|dk	r�t�|�|_n"|j
dk	r�|j
j|_nt��j|_|r�|��t�|tj�dS)Nrr	)r�_mutexr�r�r*rZForkAwareLocalr�_tls�_idset�_tokenr+�_id�_managerr�rgr��_owned_by_managerrrer�rurf�_increfr�_after_fork)	r,r�ror�rfr�r^�
manager_ownedZ	tls_idsetrrrr-s*



zBaseProxy.__init__cCsdt�d�t��j}t��jdkr4|dt��j7}|j|jj	|j
d�}t|dd|f�||j_
dS)Nzmaking connection to managerZ
MainThread�|r�rY)rrzrrurrlr�r�rr*r�rCrr
)r,rr�rrr�_connect-s

zBaseProxy._connectrcCs�z|jj}Wn6tk
rBt�dt��j�|��|jj}YnX|�	|j
|||f�|��\}}|dkrp|S|dkr�|\}}|jj
|jd}	|jj|_|	||j|j|j|d�}
|j|j|jd�}t|dd|jf�|
St||��dS)Nz#thread %r does not own a connectionr9r����r�r�r_)rr
r�rrzrlr�rrr:rr;rr�r)rr*r�r�r�rCr+r<)r,r>r?r@r�rArBr�r�r�r�rrr�_callmethod6s6�
�zBaseProxy._callmethodcCs
|�d�S)Nr��rr.rrr�	_getvalueTszBaseProxy._getvaluec	Cs�|jrt�d|jj�dS|j|jj|jd�}t|dd|j	f�t�d|jj�|j
�|j	�|joj|jj
}tj|tj|j|j||j|j
|jfdd�|_dS)Nz%owned_by_manager skipped INCREF of %rr�r^z	INCREF %r�
r�)rrrzrr+r�r*r�rCrr�addrr�r�r�_decrefrZ_close)r,r�r1rrrrZs$
��zBaseProxy._increfc
Cs�|�|j�|dks |jtjkr�z2t�d|j�||j|d�}t|dd|jf�Wq�t	k
r�}zt�d|�W5d}~XYq�Xnt�d|j�|s�t
|d�r�t�dt��j
�|j��|`dS)Nz	DECREF %rr�r_z... decref failed %sz%DECREF %r -- manager already shutdownr
z-thread %r has no more proxies so closing conn)�discardr+r�r�r�rrzr*rCr�r�rlr�rr
r�)r�rfr1ZtlsZidsetr�r�r�rrrr ns �
zBaseProxy._decrefc
CsHd|_z|��Wn0tk
rB}zt�d|�W5d}~XYnXdS)Nzincref failed: %s)rrr�rr�)r,r�rrrr�s
zBaseProxy._after_forkcCs^i}t�dk	r|j|d<t|dd�rB|j|d<tt|j|j|ffStt|�|j|j|ffSdS)Nrf�_isautoFr�)	rr�rr��RebuildProxyrrr�r�r,r@rrrr
�s


��zBaseProxy.__reduce__cCs|��Sr)r)r,Zmemorrr�__deepcopy__�szBaseProxy.__deepcopy__cCsdt|�j|jjt|�fS)Nz<%s object, typeid %r at %#x>)rr4rr)r+r.rrrr5�s�zBaseProxy.__repr__cCs:z|�d�WStk
r4t|�dd�dYSXdS)Nr5rz; '__str__()' failed>)rr�r�r.rrrrM�szBaseProxy.__str__)NNNTF)r4r6r7r�rZForkAwareThreadLockrr-rrrrrr rr
r%r5rMrrrrr�s&�
)	

cCs�tt��dd�}|rT|j|jkrTt�d|�d|d<|j|jkrT|j|j|j|j<|�	dd�optt��dd�}|||fd|i|��S)Nrvz*Rebuild a proxy owned by manager, token=%rTrr^Z_inheritingF)
rrrur*rrzr+rkrir�)rRr�ror@r�r^rrrr#�s
�
�r#cCspt|�}z|||fWStk
r*YnXi}|D]}td||f|�q4t|tf|�}||_||||f<|S)NzOdef %s(self, /, *args, **kwds):
        return self._callmethod(%r, args, kwds))r�r��execrrr�)rr��_cacheZdicZmeth�	ProxyTyperrr�
MakeProxyType�s ��r)c
Cs�t|d}|dkrB||j|d�}zt|dd|f�}W5|��X|dkrX|dk	rX|j}|dkrjt��j}td|j	|�}||||||d�}	d|	_
|	S)Nr	r�rZz
AutoProxy[%s])r�rfr^T)rgr*r�rCr�rrurfr)r)r")
r�ror�rfr�r^r�r�r(r�rrrr�s 


�rc@seZdZdd�Zdd�ZdS)�	NamespacecKs|j�|�dSr)r��updater$rrrr-�szNamespace.__init__cCsZt|j���}g}|D]$\}}|�d�s|�d||f�q|��d|jjd�|�fS)NrTz%s=%rz%s(%s)z, )	r$r�r!�
startswithrPr�r3r4r�)r,r!rQrr�rrrr5�s
zNamespace.__repr__N)r4r6r7r-r5rrrrr*�sr*c@s8eZdZddd�Zdd�Zdd�Zdd	�Zeee�Zd
S)�ValueTcCs||_||_dSr)�	_typecode�_value)r,rr��lockrrrr-szValue.__init__cCs|jSr�r/r.rrrr�sz	Value.getcCs
||_dSrr1�r,r�rrrr�
sz	Value.setcCsdt|�j|j|jfS)Nz
%s(%r, %r))rr4r.r/r.rrrr5szValue.__repr__N)T)	r4r6r7r-r�r�r5rr�rrrrr-s

r-cCst�||�Sr)r)r�sequencer0rrr�Arraysr4c@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�
IteratorProxy)�__next__r:�throwr�cCs|Srrr.rrr�__iter__szIteratorProxy.__iter__cGs|�d|�S)Nr6r�r,r?rrrr6szIteratorProxy.__next__cGs|�d|�S)Nr:rr9rrrr:szIteratorProxy.sendcGs|�d|�S)Nr7rr9rrrr7szIteratorProxy.throwcGs|�d|�S)Nr�rr9rrrr�!szIteratorProxy.closeN)	r4r6r7r�r8r6r:r7r�rrrrr5sr5c@s2eZdZdZddd�Zdd�Zdd	�Zd
d�ZdS)
�
AcquirerProxy)�acquire�releaseTNcCs"|dkr|fn||f}|�d|�S�Nr;r)r,Zblockingr�r?rrrr;'szAcquirerProxy.acquirecCs
|�d�S�Nr<rr.rrrr<*szAcquirerProxy.releasecCs
|�d�Sr=rr.rrrr�,szAcquirerProxy.__enter__cCs
|�d�Sr>rr�rrrr�.szAcquirerProxy.__exit__)TN)r4r6r7r�r;r<r�r�rrrrr:%s

r:c@s6eZdZdZddd�Zd
dd�Zdd	�Zdd
d�ZdS)�ConditionProxy)r;r<r��notify�
notify_allNcCs|�d|f�S�Nr�rr�rrrr�4szConditionProxy.waitr	cCs|�d|f�S)Nr@r)r,�nrrrr@6szConditionProxy.notifycCs
|�d�S)NrArr.rrrrA8szConditionProxy.notify_allcCsd|�}|r|S|dk	r$t��|}nd}d}|s`|dk	rN|t��}|dkrNq`|�|�|�}q,|S)Nr)�time�	monotonicr�)r,Z	predicater�rBZendtimeZwaittimerrr�wait_for:s
zConditionProxy.wait_for)N)r	)N)r4r6r7r�r�r@rArFrrrrr?2s


r?c@s2eZdZdZdd�Zdd�Zdd�Zdd	d
�ZdS)�
EventProxy)r�r�r	r�cCs
|�d�S)Nr�rr.rrrr�OszEventProxy.is_setcCs
|�d�S�Nr�rr.rrrr�QszEventProxy.setcCs
|�d�S)Nr	rr.rrrr	SszEventProxy.clearNcCs|�d|f�SrBrr�rrrr�UszEventProxy.wait)N)r4r6r7r�r�r�r	r�rrrrrGMs
rGc@sNeZdZdZddd�Zdd�Zdd�Zed	d
��Zedd��Z	ed
d��Z
dS)�BarrierProxy)�__getattribute__r��abort�resetNcCs|�d|f�SrBrr�rrrr�[szBarrierProxy.waitcCs
|�d�S)NrKrr.rrrrK]szBarrierProxy.abortcCs
|�d�S)NrLrr.rrrrL_szBarrierProxy.resetcCs|�dd�S)NrJ)�partiesrr.rrrrMaszBarrierProxy.partiescCs|�dd�S)NrJ)�	n_waitingrr.rrrrNdszBarrierProxy.n_waitingcCs|�dd�S)NrJ)�brokenrr.rrrrOgszBarrierProxy.broken)N)r4r6r7r�r�rKrLrrMrNrOrrrrrIYs


rIc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�NamespaceProxy)rJ�__setattr__�__delattr__cCs0|ddkrt�||�St�|d�}|d|f�S)NrrTrrJ)�objectrJ�r,r�
callmethodrrr�__getattr__nszNamespaceProxy.__getattr__cCs4|ddkrt�|||�St�|d�}|d||f�S)NrrTrrQ)rSrQrJ)r,rr�rUrrrrQsszNamespaceProxy.__setattr__cCs0|ddkrt�||�St�|d�}|d|f�S)NrrTrrR)rSrRrJrTrrrrRxszNamespaceProxy.__delattr__N)r4r6r7r�rVrQrRrrrrrPlsrPc@s*eZdZdZdd�Zdd�Zeee�ZdS)�
ValueProxy)r�r�cCs
|�d�S)Nr�rr.rrrr��szValueProxy.getcCs|�d|f�SrHrr2rrrr��szValueProxy.setN)r4r6r7r�r�r�rr�rrrrrWsrW�
BaseListProxy)�__add__�__contains__�__delitem__�__getitem__�__len__�__mul__�__reversed__�__rmul__�__setitem__rP�count�extend�index�insertr��remove�reverser��__imul__c@seZdZdd�Zdd�ZdS)�	ListProxycCs|�d|f�|S)Nrcrr2rrr�__iadd__�szListProxy.__iadd__cCs|�d|f�|S)Nrhrr2rrrrh�szListProxy.__imul__N)r4r6r7rjrhrrrrri�sri�	DictProxy)rZr[r\r8r]rar	r�r�r!r"r��popitem�
setdefaultr+r#r8�Iterator�
ArrayProxy)r]r\ra�	PoolProxy)Zapply�apply_asyncr��imap�imap_unorderedr��map�	map_async�starmap�
starmap_asyncr�ZAsyncResult)rqrurwrrrsc@seZdZdd�Zdd�ZdS)rpcCs|Srrr.rrrr��szPoolProxy.__enter__cCs|��dSr)r�r�rrrr��szPoolProxy.__exit__N)r4r6r7r�r�rrrrrp�sc@seZdZdS)rN)r4r6r7rrrrr�s�QueueZ
JoinableQueuersrm�RLock�	Semaphore�BoundedSemaphore�	Condition�Barrier�Poolr$r�)r�r)rc@sHeZdZgfdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�_SharedMemoryTrackercCs||_||_dSr�Zshared_memory_context_name�
segment_names)r,rr�rrrr-�sz_SharedMemoryTracker.__init__cCs(t�d|�dt����|j�|�dS)NzRegister segment � in pid )rrzrr�rP�r,�segment_namerrr�register_segment�sz%_SharedMemoryTracker.register_segmentcCsBt�d|�dt����|j�|�t�|�}|��|��dS)NzDestroy segment r�)	rrzrr�rfr�SharedMemoryr��unlink)r,r�Zsegmentrrr�destroy_segment�s

z$_SharedMemoryTracker.destroy_segmentcCs"|jdd�D]}|�|�qdSr)r�r�r�rrrr��sz_SharedMemoryTracker.unlinkcCs(t�d|jj�dt����|��dS)NzCall z.__del__ in )rrzr3r4rr�r.rrr�__del__�sz_SharedMemoryTracker.__del__cCs|j|jfSrr�r.rrrr/�sz!_SharedMemoryTracker.__getstate__cCs|j|�dSr)r-r0rrrr2sz!_SharedMemoryTracker.__setstate__N)
r4r6r7r-r�r�r�r�r/r2rrrrr�s	rc@sReZdZejdddgZdd�Zdd�Zde_d	d
�Zdd�Z	d
d�Z
dd�ZdS)�SharedMemoryServer�
track_segment�release_segment�
list_segmentscOsZtj|f|�|�|j}t|t�r,t�|�}td|�dt����|_	t
�dt����dS)NZshm_rTz"SharedMemoryServer started by pid )rVr-r*rGrc�os�fsdecoderr�shared_memory_contextrrz)r,r?�kwargsr*rrrr-
s

�zSharedMemoryServer.__init__cOstt|�dkr|d}n4d|kr(|d}n"|s6td��ntdt|�d��ttj|dd�rhtj|d	<tj||�S)
Nr�r�r)zDdescriptor 'create' of 'SharedMemoryServer' object needs an argumentr�r	rZ_shared_memory_proxyr�)r�rIr�r,rdr�rVrX)r?r�Ztypeodr)rrrrXs



�
zSharedMemoryServer.createz&($self, c, typeid, /, *args, **kwargs)cCs|j��t�||�Sr)r�r�rVrWr�rrrrW)s
zSharedMemoryServer.shutdowncCs|j�|�dSr)r�r��r,r=r�rrrr�.sz SharedMemoryServer.track_segmentcCs|j�|�dSr)r�r�r�rrrr�2sz"SharedMemoryServer.release_segmentcCs|jjSr)r�r�r�rrrr�7sz SharedMemoryServer.list_segmentsN)r4r6r7rVr�r-rXr�rWr�r�r�rrrrr�s�
r�c@s8eZdZeZdd�Zdd�Zdd�Zdd�Zd	d
�Z	dS)rcOsNtjdkrddlm}|��tj|f|�|�t�|j	j
�dt����dS)N�posixr	)�resource_trackerz created by pid )r�r�r�Zensure_runningrr-rrzr3r4r)r,r?r�r�rrrr-Is

zSharedMemoryManager.__init__cCst�|jj�dt����dS)Nz.__del__ by pid )rrzr3r4rr.rrrr�UszSharedMemoryManager.__del__cCsh|jjtjkrP|jjtjkr&td��n*|jjtjkr>td��ntd�|jj���|�|j	|j
|j|j�S)Nz"Already started SharedMemoryServerz!SharedMemoryManager has shut downr�)
r�r�r�r�r�r
r�rJr�r�r�r�r�r.rrrr�Ys

��zSharedMemoryManager.get_servercCsx|j|j|jd��\}tjdd|d�}zt|dd|jf�Wn.tk
rh}z|��|�W5d}~XYnXW5QRX|S)Nr�T)rX�sizer�)	r�r�r�rr�rCr�
BaseExceptionr�)r,r�r�Zsmsr�rrrr�fs z SharedMemoryManager.SharedMemorycCsv|j|j|jd��Z}t�|�}zt|dd|jjf�Wn0tk
rf}z|j�	�|�W5d}~XYnXW5QRX|S)Nr�r�)
r�r�r�r�
ShareableListrCZshmrr�r�)r,r3r�Zslr�rrrr�rs

 z!SharedMemoryManager.ShareableListN)
r4r6r7r�r�r-r�r�r�r�rrrrr=s

)NNNT)T)S�__all__rwrlr�rZqueuerDr�rr�rr�r
�contextrrr
rrrrrZ	HAS_SHMEM�ImportErrorrrZ
view_typesr$r'Z	view_typerSrrCr<r�rKrSrUrVr�rprqZXmlListenerZ	XmlClientrgrr�rrr#r)rr*r-r4r5r:r?rGrIrPrWrXrirkr�roZ
BasePoolProxyrprrxrsrmryrzr{r|r}r~r�rr�rrrrr�<module>s��


c

�	w
4�


	
	
�

�

�%8multiprocessing/__pycache__/process.cpython-38.opt-2.pyc000064400000021311151153537440017257 0ustar00U

e5d�.�@s8ddddgZddlZddlZddlZddlZddlZddlmZzej�	e�
��ZWnek
rldZYnXdd�Z
dd�Zd	d�Zd
d�ZGdd�de�ZGd
d�de�ZGdd�de�ZGdd�de�Zdae�ae�d�ae�a[iZeej� ��D]0\Z!Z"e!dd�dkr�de!kr�de!��ee"<q�e�Z#dS)�BaseProcess�current_process�active_children�parent_process�N)�WeakSetcCstS�N)�_current_process�r	r	�//usr/lib64/python3.8/multiprocessing/process.pyr%scCst�tt�Sr)�_cleanup�list�	_childrenr	r	r	r
r+scCstSr)�_parent_processr	r	r	r
r3scCs*tt�D]}|j��dk	rt�|�qdSr)rr
�_popen�poll�discard)�pr	r	r
r=src@s�eZdZdd�Zddddifdd�dd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Z	d+dd�Z
dd�Zdd�Ze
dd��Zejdd��Ze
dd��Zejdd��Ze
dd��Zejd d��Ze
d!d"��Ze
d#d$��ZeZe
d%d&��Zd'd(�Zd,d)d*�ZdS)-rcCst�dSr)�NotImplementedError��selfr	r	r
�_PopenMszBaseProcess._PopenNr	)�daemoncCs�tt�}tj|f|_tj��|_t��|_tj	|_
d|_d|_||_
t|�|_t|�|_|p�t|�jdd�dd�|jD��|_|dk	r�||_t�|�dS)NF�-�:css|]}t|�VqdSr)�str)�.0�ir	r	r
�	<genexpr>^sz'BaseProcess.__init__.<locals>.<genexpr>)�next�_process_counterr�	_identity�_config�copy�os�getpid�_parent_pid�name�_parent_namer�_closed�_target�tuple�_args�dict�_kwargs�type�__name__�join�_namer�	_dangling�add)r�group�targetr&�args�kwargsr�countr	r	r
�__init__Ps 


�zBaseProcess.__init__cCs|jrtd��dS)Nzprocess object is closed)r(�
ValueErrorrr	r	r
�
_check_closedcszBaseProcess._check_closedcCs|jr|j|j|j�dSr)r)r+r-rr	r	r
�rungszBaseProcess.runcCs>|��t�|�|�|_|jj|_|`|`|`t	�
|�dSr)r;rrr�sentinel�	_sentinelr)r+r-r
r3rr	r	r
�startns
zBaseProcess.startcCs|��|j��dSr)r;r�	terminaterr	r	r
r@�szBaseProcess.terminatecCs|��|j��dSr)r;r�killrr	r	r
rA�szBaseProcess.killcCs*|��|j�|�}|dk	r&t�|�dSr)r;r�waitr
r)r�timeout�resr	r	r
r0�szBaseProcess.joincCsJ|��|tkrdS|jdkr"dS|j��}|dkr8dSt�|�dSdS)NTF)r;rrrr
r)r�
returncoder	r	r
�is_alive�s


zBaseProcess.is_alivecCsH|jdk	r>|j��dkr td��|j��d|_|`t�|�d|_dS)Nz^Cannot close a process while it is still running. You should first call join() or terminate().T)rrr:�closer>r
rr(rr	r	r
rG�s


zBaseProcess.closecCs|jSr�r1rr	r	r
r&�szBaseProcess.namecCs
||_dSrrH)rr&r	r	r
r&�scCs|j�dd�S)NrF)r!�getrr	r	r
r�szBaseProcess.daemoncCs||jd<dS)Nr�r!)rZdaemonicr	r	r
r�scCs
|jdS�N�authkeyrJrr	r	r
rL�szBaseProcess.authkeycCst|�|jd<dSrK)�AuthenticationStringr!)rrLr	r	r
rL�scCs"|��|jdkr|jS|j��Sr)r;rrrr	r	r
�exitcode�s
zBaseProcess.exitcodecCs*|��|tkrt��S|jo$|jjSdSr)r;rr#r$r�pidrr	r	r
�ident�szBaseProcess.identcCs4|��z|jWStk
r.td�d�YnXdS)Nzprocess not started)r;r>�AttributeErrorr:rr	r	r
r=�s
zBaseProcess.sentinelcCs�d}|tkrd}nL|jrd}n@|jt��kr2d}n,|jdkrBd}n|j��}|dk	rZd}nd}t|�jd|j	g}|jdk	r�|�
d|jj�|�
d|j�|�
|�|dk	r�t�
||�}|�
d	|�|jr�|�
d
�dd�|�S)
NZstarted�closed�unknown�initialZstoppedzname=%rzpid=%sz	parent=%szexitcode=%srz<%s>� )rr(r%r#r$rrr.r/r1�appendrO�_exitcode_to_namerIrr0)rrNZstatus�infor	r	r
�__repr__s0




zBaseProcess.__repr__c
Csvddlm}m}�z>z�|jdk	r,|�|j�t	�
d�at�a
|��t}|at|j|j|�atjrnt����z|j��|��W5~X|�d�z|��d}W5|��XWn�tk
�r}zJ|js�d}n:t|jdt�r�|jd}nt j!�"t#|jd�d�d}W5d}~XYn2d}ddl$}t j!�"d|j%�|�&�YnXW5t��|�d|�|��X|S)N�)�util�contextz process exiting with exitcode %dz child process calling self.run()r�
zProcess %s:
)'�r[r\�	threadingZ	_shutdownrXZ_flush_std_streamsZ
_start_methodZ_force_start_method�	itertoolsr8r�setr
Z_close_stdinr�_ParentProcessr'r%rZ_HAVE_THREAD_NATIVE_IDZmain_threadZ_set_native_idZ_finalizer_registry�clearZ_run_after_forkersZ_exit_functionr<�
SystemExitr6�
isinstance�int�sys�stderr�writer�	tracebackr&�	print_exc)rZparent_sentinelr[r\rNZold_process�erjr	r	r
�
_bootstrap"sR

�


zBaseProcess._bootstrap)N)N)r/�
__module__�__qualname__rr9r;r<r?r@rAr0rFrG�propertyr&�setterrrLrNrPrOr=rYrmr	r	r	r
rGsB�







	


c@seZdZdd�ZdS)rMcCs,ddlm}|�dkrtd��tt|�ffS)NrZ)�get_spawning_popenzJPickling an AuthenticationString object is disallowed for security reasons)r\rr�	TypeErrorrM�bytes)rrrr	r	r
�
__reduce__Xs
�zAuthenticationString.__reduce__N)r/rnrorur	r	r	r
rMWsrMc@s6eZdZdd�Zdd�Zedd��Zd
dd	�ZeZdS)rbcCs4d|_||_||_d|_d|_d|_||_i|_dS)Nr	F)r r1�_pidr%rr(r>r!)rr&rOr=r	r	r
r9hsz_ParentProcess.__init__cCsddlm}||jgdd�S�Nr)rB)rC�Zmultiprocessing.connectionrBr>)rrBr	r	r
rFrsz_ParentProcess.is_alivecCs|jSr)rvrr	r	r
rPvsz_ParentProcess.identNcCs ddlm}||jg|d�dSrwrx)rrCrBr	r	r
r0zsz_ParentProcess.join)N)	r/rnror9rFrprPr0rOr	r	r	r
rbfs


rbc@seZdZdd�Zdd�ZdS)�_MainProcesscCs8d|_d|_d|_d|_d|_tt�d��dd�|_dS)Nr	ZMainProcessF� z/mp)rLZ	semprefix)	r r1r%rr(rMr#�urandomr!rr	r	r
r9�s�z_MainProcess.__init__cCsdSrr	rr	r	r
rG�sz_MainProcess.closeN)r/rnror9rGr	r	r	r
ry�sryrZ�ZSIG�_r)$�__all__r#rg�signalr`r_Z_weakrefsetr�path�abspath�getcwdZORIGINAL_DIR�OSErrorrrrr�objectrrtrMrbryrrr8rrar
rWr�__dict__�itemsr&Zsignumr2r	r	r	r
�<module>
s@�


!
multiprocessing/__pycache__/pool.cpython-38.opt-2.pyc000064400000055105151153537440016562 0ustar00U

e5d�~�@sdddgZddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddl
mZm
Z
ddlmZd	Zd
ZdZdZe��Zd
d�Zdd�ZGdd�de�ZGdd�d�Zdd�ZGdd�de�Zd+dd�Zdd�ZGdd �d e�Z Gd!d�de!�Z"Gd"d#�d#e!�Z#e#Z$Gd$d%�d%e#�Z%Gd&d'�d'e!�Z&Gd(d)�d)e&�Z'Gd*d�de"�Z(dS),�Pool�
ThreadPool�N)�Empty�)�util)�get_context�TimeoutError)�wait�INIT�RUN�CLOSE�	TERMINATEcCstt|��S�N)�list�map��args�r�,/usr/lib64/python3.8/multiprocessing/pool.py�mapstar/srcCstt�|d|d��S)Nrr)r�	itertools�starmaprrrr�starmapstar2src@seZdZdd�Zdd�ZdS)�RemoteTracebackcCs
||_dSr��tb)�selfrrrr�__init__:szRemoteTraceback.__init__cCs|jSrr�rrrr�__str__<szRemoteTraceback.__str__N)�__name__�
__module__�__qualname__rrrrrrr9src@seZdZdd�Zdd�ZdS)�ExceptionWithTracebackcCs0t�t|�||�}d�|�}||_d||_dS)N�z

"""
%s""")�	traceback�format_exception�type�join�excr)rr)rrrrr@s
zExceptionWithTraceback.__init__cCst|j|jffSr)�rebuild_excr)rrrrr�
__reduce__Esz!ExceptionWithTraceback.__reduce__N)r r!r"rr+rrrrr#?sr#cCst|�|_|Sr)r�	__cause__)r)rrrrr*Hs
r*cs,eZdZ�fdd�Zdd�Zdd�Z�ZS)�MaybeEncodingErrorcs.t|�|_t|�|_tt|��|j|j�dSr)�reprr)�value�superr-r)rr)r/��	__class__rrrTs

zMaybeEncodingError.__init__cCsd|j|jfS)Nz(Error sending result: '%s'. Reason: '%s')r/r)rrrrrYs�zMaybeEncodingError.__str__cCsd|jj|fS)Nz<%s: %s>)r2r rrrr�__repr__]szMaybeEncodingError.__repr__)r r!r"rrr3�
__classcell__rrr1rr-Psr-rFc
Cs�|dk	r(t|t�r|dks(td�|���|j}|j}t|d�rR|j��|j	��|dk	rb||�d}|dks~|�r�||k�r�z
|�}	Wn(t
tfk
r�t�
d�Y�q�YnX|	dkr�t�
d��q�|	\}
}}}
}zd||
|�f}WnHtk
�r0}z(|�r|tk	�rt||j�}d|f}W5d}~XYnXz||
||f�WnRtk
�r�}z2t||d�}t�
d	|�||
|d|ff�W5d}~XYnXd}	}
}}}
}|d7}qft�
d
|�dS)NrzMaxtasks {!r} is not valid�_writerrz)worker got EOFError or OSError -- exitingzworker got sentinel -- exitingTFz0Possible encoding error while sending result: %szworker exiting after %d tasks)�
isinstance�int�AssertionError�format�put�get�hasattrr5�close�_reader�EOFError�OSErrorr�debug�	Exception�_helper_reraises_exceptionr#�
__traceback__r-)�inqueue�outqueue�initializer�initargsZmaxtasks�wrap_exceptionr:r;Z	completed�task�job�i�funcr�kwds�result�e�wrappedrrr�workerasN�





�$
rRcCs|�dSrr)ZexrrrrC�srCcs.eZdZdd��fdd�
Z�fdd�Z�ZS)�
_PoolCacheN��notifiercs||_t�j||�dSr)rUr0r)rrUrrNr1rrr�sz_PoolCache.__init__cs t��|�|s|j�d�dSr)r0�__delitem__rUr:)r�itemr1rrrV�sz_PoolCache.__delitem__)r r!r"rrVr4rrr1rrS�srSc@s�eZdZdZedd��ZdKdd�Zeje	fdd	�Z
d
d�Zdd
�Zedd��Z
edd��Zdd�Zedd��Zedd��Zdd�Zdd�Zdifdd�ZdLdd�ZdMd d!�ZdNd"d#�Zd$d%�ZdOd'd(�ZdPd)d*�Zdiddfd+d,�ZdQd-d.�ZdRd/d0�ZedSd1d2��Zed3d4��Z ed5d6��Z!ed7d8��Z"ed9d:��Z#d;d<�Z$d=d>�Z%d?d@�Z&dAdB�Z'edCdD��Z(edEdF��Z)dGdH�Z*dIdJ�Z+dS)TrTcOs|j||�Sr��Process)�ctxrrNrrrrY�szPool.ProcessNrcCsg|_t|_|pt�|_|��t��|_|j��|_	t
|j	d�|_||_||_
||_|dkrjt��phd}|dkrztd��|dk	r�t|�s�td��||_z|��WnHtk
r�|jD]}|jdkr�|��q�|jD]}|��q؂YnX|��}tjtj|j|j|j|j|j|j|j |j!|j
|j|j|j"||j	fd�|_#d|j#_$t%|j#_|j#�&�tjtj'|j|j(|j!|j|jfd�|_)d|j)_$t%|j)_|j)�&�tjtj*|j!|j+|jfd�|_,d|j,_$t%|j,_|j,�&�t-j.||j/|j|j |j!|j|j	|j#|j)|j,|jf	dd�|_0t%|_dS)	NrTrz&Number of processes must be at least 1zinitializer must be a callable��targetrT�)rZexitpriority)1�_poolr
�_stater�_ctx�
_setup_queues�queue�SimpleQueue�
_taskqueue�_change_notifierrS�_cache�_maxtasksperchild�_initializer�	_initargs�os�	cpu_count�
ValueError�callable�	TypeError�
_processes�_repopulate_poolrB�exitcode�	terminater(�_get_sentinels�	threadingZThreadr�_handle_workersrY�_inqueue�	_outqueue�_wrap_exception�_worker_handler�daemonr�start�
_handle_tasks�
_quick_put�
_task_handler�_handle_results�
_quick_get�_result_handlerrZFinalize�_terminate_pool�
_terminate)r�	processesrGrH�maxtasksperchild�context�p�	sentinelsrrrr�s�





��
��
�
��z
Pool.__init__cCs>|j|kr:|d|��t|d�t|dd�dk	r:|j�d�dS)Nz&unclosed running multiprocessing pool )�sourcere)r_�ResourceWarning�getattrrer:)rZ_warnrrrr�__del__s

�zPool.__del__c	Cs0|j}d|j�d|j�d|j�dt|j��d�	S)N�<�.z state=z pool_size=�>)r2r!r"r_�lenr^)r�clsrrrr3sz
Pool.__repr__cCs|jjg}|jjg}||�Sr)rwr>re)rZtask_queue_sentinelsZself_notifier_sentinelsrrrrss

zPool._get_sentinelscCsdd�|D�S)NcSsg|]}t|d�r|j�qS)�sentinel)r<r�)�.0rRrrr�
<listcomp>s
�z.Pool._get_worker_sentinels.<locals>.<listcomp>r�Zworkersrrr�_get_worker_sentinelss�zPool._get_worker_sentinelscCsPd}ttt|���D]6}||}|jdk	rt�d|�|��d}||=q|S)NF�cleaning up worker %dT)�reversed�ranger�rqrrAr()�poolZcleanedrLrRrrr�_join_exited_workerss
zPool._join_exited_workerscCs0|�|j|j|j|j|j|j|j|j|j	|j
�
Sr)�_repopulate_pool_staticr`rYror^rvrwrhrirgrxrrrrrp.s�zPool._repopulate_poolc

Csft|t|��D]P}
||t||||||	fd�}|j�dd�|_d|_|��|�|�t�	d�qdS)Nr[rYZ
PoolWorkerTzadded worker)
r�r�rR�name�replacerzr{�appendrrA)rZrYr�r�rErFrGrHr�rIrL�wrrrr�7s��
zPool._repopulate_pool_staticc

Cs*t�|�r&t�||||||||||	�
dSr)rr�r�)
rZrYr�r�rErFrGrHr�rIrrr�_maintain_poolJs
�zPool._maintain_poolcCs4|j��|_|j��|_|jjj|_|jjj|_	dSr)
r`rcrvrwr5�sendr}r>�recvr�rrrrraVszPool._setup_queuescCs|jtkrtd��dS)NzPool not running)r_rrlrrrr�_check_running\s
zPool._check_runningcCs|�|||���Sr)�apply_asyncr;)rrMrrNrrr�apply`sz
Pool.applycCs|�||t|���Sr)�
_map_asyncrr;�rrM�iterable�	chunksizerrrrgszPool.mapcCs|�||t|���Sr)r�rr;r�rrrrnszPool.starmapcCs|�||t|||�Sr)r�r�rrMr�r��callback�error_callbackrrr�
starmap_asyncvs�zPool.starmap_asyncc
csjz,d}t|�D]\}}||||fifVqWn8tk
rd}z||dt|fifVW5d}~XYnXdS)N���r)�	enumeraterBrC)rZ
result_jobrMr�rL�xrPrrr�_guarded_task_generation~szPool._guarded_task_generationrcCs�|��|dkr:t|�}|j�|�|j||�|jf�|S|dkrPtd�|���t	�
|||�}t|�}|j�|�|jt|�|jf�dd�|D�SdS)NrzChunksize must be 1+, not {0:n}css|]}|D]
}|Vq
qdSrr�r��chunkrWrrr�	<genexpr>�szPool.imap.<locals>.<genexpr>)r��IMapIteratorrdr:r��_job�_set_lengthrlr9r�
_get_tasksr�rrMr�r�rO�task_batchesrrr�imap�s4�������z	Pool.imapcCs�|��|dkr:t|�}|j�|�|j||�|jf�|S|dkrPtd�|���t	�
|||�}t|�}|j�|�|jt|�|jf�dd�|D�SdS)NrzChunksize must be 1+, not {0!r}css|]}|D]
}|Vq
qdSrrr�rrrr��sz&Pool.imap_unordered.<locals>.<genexpr>)r��IMapUnorderedIteratorrdr:r�r�r�rlr9rr�rr�rrr�imap_unordered�s0������zPool.imap_unorderedcCs6|��t|||�}|j�|jd|||fgdf�|S�Nr)r��ApplyResultrdr:r�)rrMrrNr�r�rOrrrr��szPool.apply_asynccCs|�||t|||�Sr)r�rr�rrr�	map_async�s�zPool.map_asyncc
Cs�|��t|d�st|�}|dkrJtt|�t|j�d�\}}|rJ|d7}t|�dkrZd}t�|||�}t||t|�||d�}	|j	�
|�|	j||�df�|	S)N�__len__�rr�r�)
r�r<r�divmodr�r^rr��	MapResultrdr:r�r�)
rrMr�Zmapperr�r�r�Zextrar�rOrrrr��s,
����zPool._map_asynccCs"t||d�|��s|��qdS)N)�timeout)r	�emptyr;)r��change_notifierr�rrr�_wait_for_updates�szPool._wait_for_updatescCspt��}|jtks |rX|jtkrX|�|||||||	|
||�
|�|�|
�}|�||�q|�d�t	�
d�dS)Nzworker handler exiting)rt�current_threadr_rr
r�r�r�r:rrA)r��cache�	taskqueuerZrYr�r�rErFrGrHr�rIr�r��threadZcurrent_sentinelsrrrru�s�
zPool._handle_workersc

Cspt��}t|jd�D]�\}}d}z�|D]�}|jtkrBt�d�q�z||�Wq&tk
r�}
zB|dd�\}	}z||	�	|d|
f�Wnt
k
r�YnXW5d}
~
XYq&Xq&|r�t�d�|r�|dnd}||d�W�qW�
�q
W5d}}}	Xqt�d�z6t�d�|�d�t�d	�|D]}|d��q.Wn tk
�r`t�d
�YnXt�d�dS)Nz'task handler found thread._state != RUN�Fzdoing set_length()rr�ztask handler got sentinelz/task handler sending sentinel to result handlerz(task handler sending sentinel to workersz/task handler got OSError when sending sentinelsztask handler exiting)
rtr��iterr;r_rrrArB�_set�KeyErrorr:r@)
r�r:rFr�r�r�ZtaskseqZ
set_lengthrJrKrP�idxr�rrrr|sB






zPool._handle_tasksc	Cs�t��}z
|�}Wn$ttfk
r6t�d�YdSX|jtkrNt�d�q�|dkrbt�d�q�|\}}}z||�||�Wnt	k
r�YnXd}}}q|�r@|jt
k�r@z
|�}Wn$ttfk
r�t�d�YdSX|dk�r�t�d�q�|\}}}z||�||�Wnt	k
�r0YnXd}}}q�t|d��r�t�d�z,td�D]}|j
���sv�q�|��q`Wnttfk
�r�YnXt�dt|�|j�dS)	Nz.result handler got EOFError/OSError -- exitingz,result handler found thread._state=TERMINATEzresult handler got sentinelz&result handler ignoring extra sentinelr>z"ensuring that outqueue is not full�
z7result handler exiting: len(cache)=%s, thread._state=%s)rtr�r@r?rrAr_rr�r�r
r<r�r>�pollr�)rFr;r�r�rJrKrL�objrrrr:s\











�zPool._handle_resultsccs0t|�}tt�||��}|s dS||fVqdSr)r��tupler�islice)rM�it�sizer�rrrr�vs
zPool._get_taskscCstd��dS)Nz:pool objects cannot be passed between processes or pickled)�NotImplementedErrorrrrrr+s�zPool.__reduce__cCs2t�d�|jtkr.t|_t|j_|j�d�dS)Nzclosing pool)rrAr_rrryrer:rrrrr=�s


z
Pool.closecCst�d�t|_|��dS)Nzterminating pool)rrAr
r_r�rrrrrr�s
zPool.terminatecCsjt�d�|jtkrtd��n|jttfkr4td��|j��|j	��|j
��|jD]}|��qXdS)Nzjoining poolzPool is still runningzIn unknown state)rrAr_rrlrr
ryr(r~r�r^)rr�rrrr(�s






z	Pool.joincCs@t�d�|j��|��r<|j��r<|j��t�	d�qdS)Nz7removing tasks from inqueue until task handler finishedr)
rrAZ_rlock�acquire�is_aliver>r�r��time�sleep)rE�task_handlerr�rrr�_help_stuff_finish�s



zPool._help_stuff_finishc
CsXt�d�t|_|�d�t|_t�d�|�||t|��|��sXt|	�dkrXtd��t|_|�d�|�d�t�d�t	�
�|k	r�|��|r�t|dd�r�t�d�|D]}
|
j
dkr�|
��q�t�d�t	�
�|k	r�|��t�d	�t	�
�|k	�r|��|�rTt|dd��rTt�d
�|D](}
|
���r*t�d|
j�|
���q*dS)Nzfinalizing poolz&helping task handler/workers to finishrz.Cannot have cache with result_hander not alivezjoining worker handlerrrzterminating workerszjoining task handlerzjoining result handlerzjoining pool workersr�)rrAr
r_r:r�r�r�r8rtr�r(r<rqrr�pid)r�r�rErFr�r�Zworker_handlerr�Zresult_handlerr�r�rrrr��sB


�









zPool._terminate_poolcCs|��|Sr)r�rrrr�	__enter__�szPool.__enter__cCs|��dSr)rr)r�exc_typeZexc_valZexc_tbrrr�__exit__�sz
Pool.__exit__)NNrNN)N)N)NNN)r)r)NNN)NNN)N),r r!r"rx�staticmethodrYr�warnings�warnrr�r3rsr�r�rpr�r�rar�r�rrr�r�r�r�r�r�r�r��classmethodrur|rr�r+r=rrr(r�r�r�r�rrrrr�sv
�
P

	



�


�

�
�


-
;


5c@s@eZdZdd�Zdd�Zdd�Zddd	�Zdd
d�Zdd
�ZdS)r�cCs>||_t��|_tt�|_|j|_||_||_	||j|j<dSr)
r^rtZEvent�_event�next�job_counterr�rf�	_callback�_error_callback)rr�r�r�rrrr�s

zApplyResult.__init__cCs
|j��Sr)r�Zis_setrrrr�ready�szApplyResult.readycCs|��std�|���|jS)Nz{0!r} not ready)r�rlr9�_successrrrr�
successful�szApplyResult.successfulNcCs|j�|�dSr)r�r	�rr�rrrr	�szApplyResult.waitcCs,|�|�|��st�|jr"|jS|j�dSr)r	r�rr��_valuer�rrrr;�s
zApplyResult.getcCsZ|\|_|_|jr$|jr$|�|j�|jr<|js<|�|j�|j��|j|j=d|_dSr)	r�r�r�r�r��setrfr�r^�rrLr�rrrr�s

zApplyResult._set)N)N)	r r!r"rr�r�r	r;r�rrrrr��s	

	r�c@seZdZdd�Zdd�ZdS)r�cCshtj||||d�d|_dg||_||_|dkrNd|_|j��|j|j	=n||t
||�|_dS)Nr�Tr)r�rr�r��
_chunksize�_number_leftr�r�rfr��bool)rr�r��lengthr�r�rrrrs
�
zMapResult.__init__cCs�|jd8_|\}}|rv|jrv||j||j|d|j�<|jdkr�|jrZ|�|j�|j|j=|j��d|_	nL|s�|jr�d|_||_|jdkr�|j
r�|�
|j�|j|j=|j��d|_	dS)NrrF)r�r�r�r�r�rfr�r�r�r^r�)rrLZsuccess_result�successrOrrrr�$s&







zMapResult._setN)r r!r"rr�rrrrr�s
r�c@s:eZdZdd�Zdd�Zddd�ZeZdd	�Zd
d�ZdS)
r�cCsT||_t�t���|_tt�|_|j|_t	�
�|_d|_d|_
i|_||j|j<dSr�)r^rtZ	ConditionZLock�_condr�r�r�rf�collections�deque�_items�_index�_length�	_unsorted)rr�rrrrBs

zIMapIterator.__init__cCs|Srrrrrr�__iter__MszIMapIterator.__iter__NcCs�|j��z|j��}Wnztk
r�|j|jkr>d|_td�|j�|�z|j��}Wn2tk
r�|j|jkr�d|_td�t	d�YnXYnXW5QRX|\}}|r�|S|�dSr)
r�r��popleft�
IndexErrorr�rr^�
StopIterationr	r)rr�rWr�r/rrrr�Ps&zIMapIterator.nextc	Cs�|j��|j|krn|j�|�|jd7_|j|jkrb|j�|j�}|j�|�|jd7_q,|j��n
||j|<|j|jkr�|j|j	=d|_
W5QRXdS�Nr)r�r�r�r�r�pop�notifyrrfr�r^r�rrrr�hs


zIMapIterator._setc	CsB|j�2||_|j|jkr4|j��|j|j=d|_W5QRXdSr)r�rr�rrfr�r^)rr�rrrr�ys

zIMapIterator._set_length)N)	r r!r"rrr��__next__r�r�rrrrr�@s
r�c@seZdZdd�ZdS)r�c	CsV|j�F|j�|�|jd7_|j��|j|jkrH|j|j=d|_W5QRXdSr)	r�r�r�r�rrrfr�r^r�rrrr��s

zIMapUnorderedIterator._setN)r r!r"r�rrrrr��sr�c@sVeZdZdZedd��Zddd�Zdd	�Zd
d�Zedd
��Z	edd��Z
dd�ZdS)rFcOsddlm}|||�S)NrrX)ZdummyrY)rZrrNrYrrrrY�szThreadPool.ProcessNrcCst�||||�dSr)rr)rr�rGrHrrrr�szThreadPool.__init__cCs,t��|_t��|_|jj|_|jj|_dSr)rbrcrvrwr:r}r;r�rrrrra�s


zThreadPool._setup_queuescCs
|jjgSr)rer>rrrrrs�szThreadPool._get_sentinelscCsgSrrr�rrrr��sz ThreadPool._get_worker_sentinelscCsFz|jdd�qWntjk
r(YnXt|�D]}|�d�q2dS)NF)�block)r;rbrr�r:)rEr�r�rLrrrr��szThreadPool._help_stuff_finishcCst�|�dSr)r�r�)rr�r�r�rrrr��szThreadPool._wait_for_updates)NNr)r r!r"rxr�rYrrarsr�r�r�rrrrr�s




)NrNF))�__all__r�rrjrbrtr�r%r�rr$rrrZ
connectionr	r
rrr
�countr�rrrBrr#r*r-rRrC�dictrS�objectrr�ZAsyncResultr�r�r�rrrrr�<module>
sN	�
-=)+Emultiprocessing/__pycache__/spawn.cpython-38.opt-2.pyc000064400000014022151153537440016732 0ustar00U

e5dP$�@s$ddlZddlZddlZddlZddlmZmZddlmZddlm	Z	ddlm
Z
ddd	d
ddd
gZejdkrzdZ
dZneedd�Z
ej���d�Zer�ej�ejd�anejadd	�Zdd
�Zdd�Zdd�Zdd�Zd&dd�Zdd�Zdd�Zdd�ZgZ dd �Z!d!d"�Z"d#d$�Z#d%d
�Z$dS)'�N�)�get_start_method�set_start_method)�process)�	reduction)�util�_main�freeze_support�set_executable�get_executable�get_preparation_data�get_command_line�import_main_path�win32F�frozenzpythonservice.exez
python.execCs|adS�N��_python_exe)Zexe�r�-/usr/lib64/python3.8/multiprocessing/spawn.pyr
)scCstSrrrrrrr-scCs$t|�dkr|ddkrdSdSdS)N�r�--multiprocessing-forkTF)�len)�argvrrr�
is_forking4srcCsdttj�r`i}tjdd�D]0}|�d�\}}|dkr@d||<qt|�||<qtf|�t��dS)Nr�=�None)r�sysr�split�int�
spawn_main�exit)�kwds�arg�name�valuerrrr	>s


cKshttdd�r(tjdgdd�|��D�Sd}|d�dd	�|��D��;}t��}tg|d
|dgSdS)NrFrcSsg|]}d|�qS)�%s=%rr��.0�itemrrr�
<listcomp>Tsz$get_command_line.<locals>.<listcomp>z<from multiprocessing.spawn import spawn_main; spawn_main(%s)z, css|]}d|VqdS)r&Nrr'rrr�	<genexpr>Wsz#get_command_line.<locals>.<genexpr>z-c)�getattrr�
executable�items�joinrZ_args_from_interpreter_flagsr)r"�progZoptsrrrr
Ns�cCs�tjdkr`ddl}ddl}|dk	r:|�|j|jBd|�}nd}tj||d�}|�	|t
j�}|}n"ddlm
}	||	j_|}t
�|�}t||�}
t�|
�dS)NrrF)�source_processr)�resource_tracker)r�platform�msvcrt�_winapiZOpenProcessZSYNCHRONIZEZPROCESS_DUP_HANDLErZ	duplicateZopen_osfhandle�os�O_RDONLY�r2Z_resource_trackerZ_fd�duprr!)Zpipe_handleZ
parent_pidZ
tracker_fdr4r5r1Z
new_handle�fd�parent_sentinelr2Zexitcoderrrr \s*

��

r c	Cs`tj|ddd��@}dt��_z$tj�|�}t|�tj�|�}W5t��`XW5QRX|�	|�S)N�rbT)�closefd)
r6�fdopenr�current_process�_inheritingr�pickle�load�prepare�
_bootstrap)r:r;Zfrom_parentZpreparation_data�selfrrrrxs
cCstt��dd�rtd��dS)Nr@Fa
        An attempt has been made to start a new process before the
        current process has finished its bootstrapping phase.

        This probably means that you are not using fork to start your
        child processes and you have forgotten to use the proper idiom
        in the main module:

            if __name__ == '__main__':
                freeze_support()
                ...

        The "freeze_support()" line can be omitted if the program
        is not going to be frozen to produce an executable.)r,rr?�RuntimeErrorrrrr�_check_not_importing_main�srGcCst�ttjt��jd�}tjdk	r2tj��|d<t	j
��}z|�d�}Wnt
k
r^YnXtj||<|j||t	jtjt��t�d�t	jd}t|jdd�}|dk	r�||d<nft	jdks�t�st�st|d	d�}|dk	�rtj
�|��s
tjdk	�r
tj
�tj|�}tj
�|�|d
<|S)N)�
log_to_stderr�authkey�	log_levelr8)r$�sys_path�sys_argv�orig_dir�dir�start_method�__main__r$�init_main_from_namer�__file__�init_main_from_path)rG�dictrZ_log_to_stderrrr?rIZ_loggerZgetEffectiveLevelr�path�copy�index�
ValueError�ORIGINAL_DIR�updaterr6�getcwdr�modulesr,�__spec__r3�WINEXE�
WINSERVICE�isabsr/�normpath)r$�drK�i�main_moduleZ
main_mod_name�	main_pathrrrr�sD�


�


�cCs�d|kr|dt��_d|kr,|dt��_d|krD|drDt��d|kr^t���|d�d|krp|dt_	d|kr�|dt_
d|kr�t�|d�d|kr�|dt_
d	|kr�t|d	d
d�d|kr�t|d�nd
|kr�t|d
�dS)Nr$rIrHrJrKrLrNrMrOT)ZforcerQrS)rr?r$rIrrHZ
get_loggerZsetLevelrrUrr6�chdirrYr�_fixup_main_from_name�_fixup_main_from_path)�datarrrrC�s,


rCcCs~tjd}|dks|�d�r dSt|jdd�|kr6dSt�|�t�d�}t	j
|ddd�}|j�|�|tjd<tjd<dS)NrPz	.__main__r$�__mp_main__T)�run_nameZ	alter_sys)
rr\�endswithr,r]�old_main_modules�append�types�
ModuleType�runpyZ
run_module�__dict__rZ)Zmod_name�current_mainrd�main_contentrrrrg�s


�rgcCs�tjd}tj�tj�|��d}|dkr.dSt|dd�|krBdSt�|�t	�
d�}tj|dd�}|j
�|�|tjd<tjd<dS)NrPrZipythonrRrj)rk)rr\r6rU�splitext�basenamer,rmrnrorprqZrun_pathrrrZ)rersZ	main_namerdrtrrrrh	s


�rhcCst|�dSr)rh)rerrrr%s)NN)%r6rrqror8rrr�contextrr�__all__r3r^r_r,r-�lowerrlrUr/�exec_prefixrr
rrr	r
r rrGrrmrCrgrhrrrrr�<module>sD�


2&multiprocessing/__pycache__/sharedctypes.cpython-38.opt-2.pyc000064400000015102151153537440020300 0ustar00U

e5d��@sBddlZddlZddlmZddlmZddlmZmZejZ	dddd	d
dgZ
ejejej
ejejejejejejejejejejejd�Zd
d�Zdd�Zdd�Zddd�dd�Zddd�dd	�Zdd
�Zd&dd�Z dd�Z!dd�Z"dd�Z#dZ$iZ%e�&�Z'Gdd�de(�Z)Gd d!�d!e)�Z*Gd"d#�d#e)�Z+Gd$d%�d%e+�Z,dS)'�N�)�heap)�get_context)�	reduction�assert_spawning�RawValue�RawArray�Value�Array�copy�synchronized)�c�u�b�B�h�H�i�I�l�L�q�Q�f�dcCs t�|�}t�|�}t||d�S�N)�ctypes�sizeofrZ
BufferWrapper�
rebuild_ctype)�type_�size�wrapper�r"�4/usr/lib64/python3.8/multiprocessing/sharedctypes.py�
_new_value's

r$cGs<t�||�}t|�}t�t�|�dt�|��|j|�|S�Nr)�typecode_to_type�getr$r�memset�	addressofr�__init__)�typecode_or_type�argsr�objr"r"r#r,s

cCsjt�||�}t|t�rD||}t|�}t�t�|�dt�|��|S|t	|�}t|�}|j
|�|SdSr%)r&r'�
isinstance�intr$rr(r)r�lenr*)r+�size_or_initializerrr-�resultr"r"r#r6s

T)�lock�ctxcGsXt|f|��}|dkr|S|dkr4|p*t�}|��}t|d�sJtd|��t|||d�S�NF)TN�acquirez%r has no method 'acquire')r4)rr�RLock�hasattr�AttributeErrorr)r+r3r4r,r-r"r"r#r	Fs

cCsTt||�}|dkr|S|dkr0|p&t�}|��}t|d�sFtd|��t|||d�Sr5)rrr7r8r9r)r+r1r3r4r-r"r"r#r
Ts


cCstt|��}|t�|�d<|Sr%)r$�typerZpointer)r-Znew_objr"r"r#rbscCs�|pt�}t|tj�r"t|||�St|tj�rR|jtjkrFt|||�St	|||�St
|�}zt|}WnRtk
r�dd�|j
D�}dd�|D�}d|j}t
|tf|�}t|<YnX||||�SdS)NcSsg|]}|d�qS)rr")�.0Zfieldr"r"r#�
<listcomp>vsz synchronized.<locals>.<listcomp>cSsi|]}|t|��qSr")�
make_property)r;�namer"r"r#�
<dictcomp>wsz synchronized.<locals>.<dictcomp>�Synchronized)rr.rZ_SimpleCDatar@r
�_type_�c_char�SynchronizedString�SynchronizedArrayr:�class_cache�KeyErrorZ_fields_�__name__�SynchronizedBase)r-r3r4�clsZscls�namesrZ	classnamer"r"r#rgs 

cCs@t|�t|tj�r(t|j|j|jffStt|�|jdffSdSr)	rr.rr
rrA�_wrapperZ_length_r:)r-r"r"r#�reduce_ctype�srLcCs8|dk	r||}t�|t�|��}|�|�}||_|Sr)�_ForkingPickler�registerrLZcreate_memoryviewZfrom_bufferrK)rr!ZlengthZbufr-r"r"r#r�s
rcCsPz
t|WStk
rJi}tt|fd|�||t|<||YSXdS)N�)�
prop_cacherF�exec�template)r>rr"r"r#r=�s
r=z�
def get%s(self):
    self.acquire()
    try:
        return self._obj.%s
    finally:
        self.release()
def set%s(self, value):
    self.acquire()
    try:
        self._obj.%s = value
    finally:
        self.release()
%s = property(get%s, set%s)
c@sFeZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dS)rHNcCsB||_|r||_n|ptdd�}|��|_|jj|_|jj|_dS)NT)Zforce)�_obj�_lockrr7r6�release)�selfr-r3r4r"r"r#r*�s

zSynchronizedBase.__init__cCs
|j��Sr)rT�	__enter__�rVr"r"r#rW�szSynchronizedBase.__enter__cGs|jj|�Sr)rT�__exit__)rVr,r"r"r#rY�szSynchronizedBase.__exit__cCst|�t|j|jffSr)rrrSrTrXr"r"r#�
__reduce__�szSynchronizedBase.__reduce__cCs|jSr�rSrXr"r"r#�get_obj�szSynchronizedBase.get_objcCs|jSr)rTrXr"r"r#�get_lock�szSynchronizedBase.get_lockcCsdt|�j|jfS)Nz<%s wrapper for %s>)r:rGrSrXr"r"r#�__repr__�szSynchronizedBase.__repr__)NN)
rG�
__module__�__qualname__r*rWrYrZr\r]r^r"r"r"r#rH�s

rHc@seZdZed�ZdS)r@�valueN)rGr_r`r=rar"r"r"r#r@�sr@c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)rDcCs
t|j�Sr)r0rSrXr"r"r#�__len__�szSynchronizedArray.__len__c
Cs&|�|j|W5QR�SQRXdSrr[)rVrr"r"r#�__getitem__�szSynchronizedArray.__getitem__c	Cs|�||j|<W5QRXdSrr[)rVrrar"r"r#�__setitem__�szSynchronizedArray.__setitem__c
Cs*|�|j||�W5QR�SQRXdSrr[)rV�start�stopr"r"r#�__getslice__�szSynchronizedArray.__getslice__c	Cs"|�||j||�<W5QRXdSrr[)rVrerf�valuesr"r"r#�__setslice__�szSynchronizedArray.__setslice__N)rGr_r`rbrcrdrgrir"r"r"r#rD�s
rDc@seZdZed�Zed�ZdS)rCra�rawN)rGr_r`r=rarjr"r"r"r#rC�srC)NN)-r�weakref�rr�contextrrZForkingPicklerrM�__all__rBZc_wcharZc_byteZc_ubyteZc_shortZc_ushortZc_intZc_uintZc_longZc_ulongZ
c_longlongZc_ulonglongZc_floatZc_doubler&r$rrr	r
rrrLrr=rRrP�WeakKeyDictionaryrE�objectrHr@rDrCr"r"r"r#�<module>
sL�


	 multiprocessing/__pycache__/heap.cpython-38.opt-1.pyc000064400000016675151153537440016536 0ustar00U

e5dj-�@s�ddlZddlmZddlZddlZddlZddlZddlZddlm	Z	m
Z
ddlmZdgZ
ejdkr�ddlZGdd	�d	e�Zn,Gd
d	�d	e�Zdd�Zd
d�Ze	�ee�Gdd�de�ZGdd�de�ZdS)�N)�defaultdict�)�	reduction�assert_spawning)�util�
BufferWrapperZwin32c@s0eZdZdZe��Zdd�Zdd�Zdd�Z	dS)	�ArenazL
        A shared memory area backed by anonymous memory (Windows).
        cCsx||_td�D]B}dt��t|j�f}tjd||d�}t��dkrHqZ|�	�qt
d��||_||_|j|jf|_
dS)N�dz	pym-%d-%s����ZtagnamerzCannot find name for new mmap)�size�range�os�getpid�next�_rand�mmap�_winapiZGetLastError�close�FileExistsError�name�buffer�_state)�selfr�irZbuf�r�,/usr/lib64/python3.8/multiprocessing/heap.py�__init__&s
�Arena.__init__cCst|�|jS�N)rr)rrrr�__getstate__5szArena.__getstate__cCs,|\|_|_|_tjd|j|jd�|_dS)Nr
r)rrrrr)r�staterrr�__setstate__9szArena.__setstate__N)
�__name__�
__module__�__qualname__�__doc__�tempfileZ_RandomNameSequencerrr r"rrrrrs
rc@s8eZdZdZejdkrdgZngZd
dd�Zdd�Zd	S)rzJ
        A shared memory area backed by a temporary file (POSIX).
        Zlinuxz/dev/shmr
cCsx||_||_|dkrbtjdt��|�|�d�\|_}t�|�t�	|tj
|jf�t�|j|�t�|j|j�|_
dS)Nr
zpym-%d-)�prefix�dir)r�fdr'Zmkstemprr�_choose_dir�unlinkr�Finalizer�	ftruncaterr)rrr*rrrrrMs
�
rcCs6|jD]&}t�|�}|j|j|kr|Sqt��Sr)�_dir_candidatesr�statvfs�f_bavail�f_frsizerZget_temp_dir)rr�d�strrrr+[s



zArena._choose_dirN)r
)	r#r$r%r&�sys�platformr/rr+rrrrrCs

cCs(|jdkrtd��t|jt�|j�ffS)Nr
zDArena is unpicklable because forking was enabled when it was created)r*�
ValueError�
rebuild_arenarrZDupFd)�arrr�reduce_arenads
r:cCst||���Sr)r�detach)rZdupfdrrrr8jsr8c@szeZdZdZdZdZejfdd�Ze	dd��Z
dd�Zd	d
�Zdd�Z
d
d�Zdd�Zdd�Zdd�Zdd�Zdd�ZdS)�Heap�i@cCsXt��|_t��|_||_g|_i|_i|_	i|_
tt�|_
g|_g|_d|_d|_dS�Nr)rr�_lastpid�	threadingZLock�_lock�_size�_lengths�_len_to_seq�_start_to_block�_stop_to_blockr�set�_allocated_blocks�_arenas�_pending_free_blocks�
_n_mallocs�_n_frees)rrrrrr{s


z
Heap.__init__cCs|d}|||@S)Nrr)�nZ	alignment�maskrrr�_roundup�sz
Heap._roundupcCsZ|�t|j|�tj�}|j|jkr0|jd9_t�d|�t|�}|j	�
|�|d|fS)N�z"allocating a new mmap of length %dr)rO�maxrBr�PAGESIZE�_DOUBLE_ARENA_SIZE_UNTILr�inforrI�append)rr�length�arenarrr�
_new_arena�szHeap._new_arenacCsz|j}||jkrdS|j�|�}|j|df=|j||f=|j�|�|j|}|�|d|f�|sv|j|=|j	�|�dSr>)
r�_DISCARD_FREE_SPACE_LARGER_THANrH�poprErFrI�removerDrC)rrWrV�blocks�seqrrr�_discard_arena�s

zHeap._discard_arenac	Cs|t�|j|�}|t|j�kr&|�|�S|j|}|j|}|��}|sV|j|=|j|=|\}}}|j||f=|j||f=|Sr)	�bisectZbisect_leftrC�lenrXrDrZrErF)	rrrrVr]�blockrW�start�stoprrr�_malloc�s



zHeap._mallocc	Cs�|\}}}z|j||f}Wntk
r0YnX|�|�\}}z|j||f}Wntk
rfYnX|�|�\}}|||f}||}z|j|�|�Wn.tk
r�|g|j|<t�|j|�YnX||j||f<||j||f<dSr)	rF�KeyError�_absorbrErDrUr_ZinsortrC)	rrarWrbrcZ
prev_block�_Z
next_blockrVrrr�_add_free_block�s(

zHeap._add_free_blockcCs^|\}}}|j||f=|j||f=||}|j|}|�|�|sV|j|=|j�|�||fSr)rErFrDr[rC)rrarWrbrcrVr]rrrrf�s


zHeap._absorbcCs4|\}}}|j|}|�||f�|s0|�|�dSr)rHr[r^)rrarWrbrcr\rrr�_remove_allocated_block�s


zHeap._remove_allocated_blockcCsBz|j��}Wntk
r&Yq>YnX|�|�|�|�qdSr)rJrZ�
IndexErrorrhri�rrarrr�_free_pending_blockss

zHeap._free_pending_blockscCs~t��|jkr$td�t��|j���|j�d�s>|j�|�n<z.|j
d7_
|��|�|�|�
|�W5|j�	�XdS)Nz$My pid ({0:n}) is not last pid {1:n}Fr)rrr?r7�formatrA�acquirerJrU�releaserLrlrhrirkrrr�frees
��
z	Heap.freec
Cs�|dkrtd�|���tj|kr.td�|���t��|jkrD|��|j	��|j
d7_
|��|�t
|d�|j�}|�|�\}}}||}||kr�|�|||f�|j|�||f�|||fW5QR�SQRXdS)Nr�Size {0:n} out of range�Size {0:n} too larger)r7rmr5�maxsize�
OverflowErrorrrr?rrArKrlrOrQ�
_alignmentrdrhrH�add)rrrWrbrcZ	real_stoprrr�malloc(s 
zHeap.mallocN)r#r$r%rurYrSrrRr�staticmethodrOrXr^rdrhrfrirlrprwrrrrr<ss

r<c@s"eZdZe�Zdd�Zdd�ZdS)rcCs^|dkrtd�|���tj|kr.td�|���tj�|�}||f|_t	j
|tjj|fd�dS)Nrrqrr)�args)r7rmr5rsrtr�_heaprwrrr-rp)rrrarrrrFs

zBufferWrapper.__init__cCs&|j\\}}}}t|j�|||�Sr)r�
memoryviewr)rrWrbrcrrrr�create_memoryviewOszBufferWrapper.create_memoryviewN)r#r$r%r<rzrr|rrrrrBs	)r_�collectionsrrrr5r'r@�contextrr�r�__all__r6r�objectrr:r8�registerr<rrrrr�<module>
s&
$!Pmultiprocessing/__pycache__/resource_sharer.cpython-38.pyc000064400000012212151153537440020034 0ustar00U

e5d��@s�ddlZddlZddlZddlZddlZddlmZddlmZddlm	Z	dgZ
ejdkrxe
dg7Z
Gd	d�de�Z
ne
d
g7Z
Gdd
�d
e�ZGdd
�d
e�Ze�ZejZdS)�N�)�process)�	reduction)�util�stopZwin32�	DupSocketc@s eZdZdZdd�Zdd�ZdS)rzPicklable wrapper for a socket.cs(|����fdd�}t�|�j�|_dS)Ncs��|�}|�|�dS�N)�shareZ
send_bytes)�conn�pidr	�Znew_sock��7/usr/lib64/python3.8/multiprocessing/resource_sharer.py�sends
z DupSocket.__init__.<locals>.send)�dup�_resource_sharer�register�close�_id)�selfZsockrr
rr�__init__szDupSocket.__init__c
Cs6t�|j�� }|��}t�|�W5QR�SQRXdS)z1Get the socket.  This should only be called once.N)r�get_connectionrZ
recv_bytes�socketZ	fromshare)rr
r	r
r
r�detach$szDupSocket.detachN��__name__�
__module__�__qualname__�__doc__rrr
r
r
rrs�DupFdc@s eZdZdZdd�Zdd�ZdS)rz-Wrapper for fd which can be used at any time.cs4t�|���fdd�}�fdd�}t�||�|_dS)Ncst�|�|�dSr)rZsend_handle)r
r�Znew_fdr
rr1szDupFd.__init__.<locals>.sendcst���dSr)�osrr
r r
rr3szDupFd.__init__.<locals>.close)r!rrrr)r�fdrrr
r rr/s
zDupFd.__init__c
Cs.t�|j��}t�|�W5QR�SQRXdS)z-Get the fd.  This should only be called once.N)rrrrZrecv_handle)rr
r
r
rr7szDupFd.detachNrr
r
r
rr-sc@sNeZdZdZdd�Zdd�Zedd��Zdd	d
�Zdd�Z	d
d�Z
dd�ZdS)�_ResourceSharerz.Manager for resources using background thread.cCs@d|_i|_g|_t��|_d|_d|_d|_t	�
|tj�dS)Nr)
�_key�_cache�
_old_locks�	threading�Lock�_lock�	_listener�_address�_threadrZregister_after_forkr#�
_afterfork)rr
r
rr?s
z_ResourceSharer.__init__c
CsZ|j�J|jdkr|��|jd7_||f|j|j<|j|jfW5QR�SQRXdS)z+Register resource, returning an identifier.Nr)r)r+�_startr$r%)rrrr
r
rrIs
z_ResourceSharer.registercCs<ddlm}|\}}||t��jd�}|�|t��f�|S)z<Return connection from which to receive identified resource.r��Client��authkey)�
connectionr0r�current_processr2rr!�getpid)Zidentr0�address�key�cr
r
rrRs
z_ResourceSharer.get_connectionNc	Cs�ddlm}|j��|jdk	r�||jt��jd�}|�d�|��|j	�
|�|j	��rdt�
d�|j��d|_	d|_d|_|j��D]\}\}}|�q�|j��W5QRXdS)z:Stop the background thread and clear registered resources.rr/Nr1z._ResourceSharer thread did not stop when asked)r3r0r)r+rr4r2rrr,�joinZis_aliverZsub_warningr*r%�items�clear)rZtimeoutr0r8r7rrr
r
rr[s$
�



z_ResourceSharer.stopcCsj|j��D]\}\}}|�q
|j��|j�|j�t��|_|jdk	rT|j�	�d|_d|_
d|_dSr)r%r:r;r&�appendr)r'r(r*rr+r,)rr7rrr
r
rr-ps



z_ResourceSharer._afterforkcCsjddlm}|jdkstd��t�d�|t��jd�|_|jj	|_
tj|j
d�}d|_|��||_dS)Nr)�ListenerzAlready have Listenerz0starting listener and thread for sending handlesr1)�targetT)r3r=r*�AssertionErrorr�debugrr4r2r6r+r'ZThread�_serveZdaemon�startr,)rr=�tr
r
rr.~s

z_ResourceSharer._startc	Cs�ttd�rt�tjt���zh|j���T}|��}|dkrHW5QR�Wq�|\}}|j�	|�\}}z|||�W5|�XW5QRXWqt
��s�tj
t���YqXqdS)N�pthread_sigmask)�hasattr�signalrD�	SIG_BLOCK�
valid_signalsr*ZacceptZrecvr%�poprZ
is_exiting�sys�
excepthook�exc_info)rr
�msgr7Zdestination_pidrrr
r
rrA�s
z_ResourceSharer._serve)N)rrrrrr�staticmethodrrr-r.rAr
r
r
rr#=s
	

r#)r!rFrrJr'�r�contextrr�__all__�platform�objectrrr#rrr
r
r
r�<module>s 


`multiprocessing/__pycache__/synchronize.cpython-38.opt-2.pyc000064400000025333151153537440020164 0ustar00U

e5dZ-�@s,ddddddgZddlZddlZddlZddlZddlZdd	lmZdd
lmZddlm	Z	zddlm
Z
mZWnek
r�ed
��YnXe
ed��\ZZej
jZGdd�de�Z
Gdd�de
�ZGdd�de�ZGdd�de
�ZGdd�de
�ZGdd�de�ZGdd�de�ZGdd�dej�ZdS)�Lock�RLock�	Semaphore�BoundedSemaphore�	Condition�Event�N�)�context)�process)�util)�SemLock�
sem_unlinkz�This platform lacks a functioning sem_open implementation, therefore, the required synchronization primitives needed will not function, see issue 3770.�c@s\eZdZe��Zdd�Zedd��Zdd�Z	dd�Z
d	d
�Zdd�Zd
d�Z
edd��ZdS)rc	Cs�|dkrtj��}|��}tjdkp*|dk}td�D]>}z t�||||�	�|�}|_
Wntk
rlYq4Xq|q4td��t�
d|j�|��tjdkr�dd�}	t�||	�|j
jdk	r�dd	lm}
|
|j
jd
�tj|tj|j
jfdd�dS)
N�win32�fork�dzcannot find name for semaphorezcreated semlock with handle %scSs|j��dS�N)�_semlock�_after_fork)�obj�r�3/usr/lib64/python3.8/multiprocessing/synchronize.pyrGsz%SemLock.__init__.<locals>._after_forkr)�register�	semaphorer)Zexitpriority)r	Z_default_contextZget_contextZget_start_method�sys�platform�range�_multiprocessingr�
_make_namer�FileExistsErrorr�debug�handle�
_make_methodsZregister_after_fork�name�resource_trackerrZFinalize�_cleanup)�self�kind�value�maxvalue�ctxr#Z
unlink_now�i�slrrrrr�__init__2s8
�
�zSemLock.__init__cCs"ddlm}t|�||d�dS)Nr)�
unregisterr)r$r.r
)r#r.rrrr%TszSemLock._cleanupcCs|jj|_|jj|_dSr)r�acquire�release�r&rrrr"Zs
zSemLock._make_methodscCs
|j��Sr)r�	__enter__r1rrrr2^szSemLock.__enter__cGs|jj|�Sr)r�__exit__�r&�argsrrrr3aszSemLock.__exit__cCsDt�|�|j}tjdkr,t���|j�}n|j}||j|j	|j
fS)Nr)r	�assert_spawningrrrZget_spawning_popenZduplicate_for_childr!r'r)r#)r&r,�hrrr�__getstate__ds

zSemLock.__getstate__cCs,tjj|�|_t�d|d�|��dS)Nz recreated blocker with handle %rr)rrZ_rebuildrrr r"�r&�staterrr�__setstate__mszSemLock.__setstate__cCsdt��jdttj�fS)Nz%s-%sZ	semprefix)r
�current_processZ_config�nextr�_randrrrrrrs�zSemLock._make_nameN)�__name__�
__module__�__qualname__�tempfileZ_RandomNameSequencer>r-�staticmethodr%r"r2r3r8r;rrrrrr.s"
	rc@s&eZdZd	dd�Zdd�Zdd�ZdS)
rrcCstj|t|t|d�dS�N�r*)rr-�	SEMAPHORE�
SEM_VALUE_MAX�r&r(r*rrrr-}szSemaphore.__init__cCs
|j��Sr)r�
_get_valuer1rrr�	get_value�szSemaphore.get_valuecCs8z|j��}Wntk
r&d}YnXd|jj|fS)N�unknownz<%s(value=%s)>)rrI�	Exception�	__class__r?�r&r(rrr�__repr__�s

zSemaphore.__repr__N)r)r?r@rAr-rJrOrrrrr{s
c@seZdZddd�Zdd�ZdS)rrcCstj|t|||d�dSrD�rr-rFrHrrrr-�szBoundedSemaphore.__init__cCs>z|j��}Wntk
r&d}YnXd|jj||jjfS)NrKz<%s(value=%s, maxvalue=%s)>)rrIrLrMr?r)rNrrrrO�s
�zBoundedSemaphore.__repr__N)r�r?r@rAr-rOrrrrr�s
c@seZdZdd�Zdd�ZdS)rcCstj|tdd|d�dS�NrrErP�r&r*rrrr-�sz
Lock.__init__cCs�zf|j��r8t��j}t��jdkrd|dt��j7}n,|j��dkrLd}n|j��dkr`d}nd}Wnt	k
r~d}YnXd	|j
j|fS)
N�
MainThread�|r�Noner�SomeOtherThread�SomeOtherProcessrKz<%s(owner=%s)>)r�_is_miner
r<r#�	threading�current_threadrI�_countrLrMr?)r&r#rrrrO�s


z
Lock.__repr__NrQrrrrr�sc@seZdZdd�Zdd�ZdS)rcCstj|tdd|d�dSrR)rr-�RECURSIVE_MUTEXrSrrrr-�szRLock.__init__cCs�z||j��rBt��j}t��jdkr6|dt��j7}|j��}n8|j��dkrZd\}}n |j��dkrrd\}}nd\}}Wnt	k
r�d\}}YnXd	|j
j||fS)
NrTrUr)rVrr)rW�nonzero)rXr^)rKrK�<%s(%s, %s)>)rrYr
r<r#rZr[r\rIrLrMr?)r&r#�countrrrrO�s



zRLock.__repr__NrQrrrrr�sc@sleZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	ddd�Z
ddd�Zdd�Zddd�Z
dS)rNcCs>|p
|��|_|�d�|_|�d�|_|�d�|_|��dS�Nr)r�_lockr�_sleeping_count�_woken_count�_wait_semaphorer")r&�lockr*rrrr-�s
zCondition.__init__cCst�|�|j|j|j|jfSr)r	r6rbrcrdrer1rrrr8�s

�zCondition.__getstate__cCs |\|_|_|_|_|��dSr)rbrcrdrer"r9rrrr;�s
�
zCondition.__setstate__cCs
|j��Sr)rbr2r1rrrr2�szCondition.__enter__cGs|jj|�Sr)rbr3r4rrrr3�szCondition.__exit__cCs|jj|_|jj|_dSr)rbr/r0r1rrrr"�s
zCondition._make_methodscCsJz|jj��|jj��}Wntk
r4d}YnXd|jj|j|fS)NrKr_)rcrrIrdrLrMr?rb)r&Znum_waitersrrrrO�s

�
zCondition.__repr__c	Csj|j��|jj��}t|�D]}|j��qz|j�d|�W�S|j��t|�D]}|j��qTXdS)NT)	rcr0rbrr\rrdr/re)r&�timeoutr`r+rrr�wait�s

zCondition.waitrcCst|j�d�r|j�d�}qd}||krF|j�d�rF|j��|d7}q|rpt|�D]}|j��qR|j�d�rpqbdS)NFrr)rdr/rcrer0r)r&�n�resZsleepersr+rrr�notifys

zCondition.notifycCs|jtjd�dS)N)ri)rkr�maxsizer1rrr�
notify_all(szCondition.notify_allcCsd|�}|r|S|dk	r$t��|}nd}d}|s`|dk	rN|t��}|dkrNq`|�|�|�}q,|Sra)�time�	monotonicrh)r&Z	predicaterg�resultZendtimeZwaittimerrr�wait_for+s
zCondition.wait_for)N)N)r)N)r?r@rAr-r8r;r2r3r"rOrhrkrmrqrrrrr�s


c@s6eZdZdd�Zdd�Zdd�Zdd�Zdd
d�Zd	S)
rcCs |�|���|_|�d�|_dSra)rr�_condr�_flagrSrrrr-CszEvent.__init__c	CsD|j�4|j�d�r,|j��W5QR�dSW5QR�dSQRXdS�NFT)rrrsr/r0r1rrr�is_setGs

zEvent.is_setc	Cs6|j�&|j�d�|j��|j��W5QRXdS�NF)rrrsr/r0rmr1rrr�setNs
z	Event.setc	Cs"|j�|j�d�W5QRXdSrv)rrrsr/r1rrr�clearTszEvent.clearNc	Csh|j�X|j�d�r |j��n|j�|�|j�d�rP|j��W5QR�dSW5QR�dSQRXdSrt)rrrsr/r0rh)r&rgrrrrhXs
z
Event.wait)N)r?r@rAr-rurwrxrhrrrrrAs
c@sZeZdZddd�Zdd�Zdd�Zedd	��Zejd
d	��Zedd��Z	e	jd
d��Z	dS)�BarrierNc	CsRddl}ddlm}||�d�d�}|��}|�|||||f�d|_d|_dS)Nrr)�
BufferWrapperr+r)�struct�heaprzZcalcsizerr;�_stater\)	r&Zparties�actionrgr*r{rz�wrapperZcondrrrr-jszBarrier.__init__cCs.|\|_|_|_|_|_|j���d�|_dS)Nr+)�_parties�_action�_timeoutrr�_wrapperZcreate_memoryview�cast�_arrayr9rrrr;ss
�zBarrier.__setstate__cCs|j|j|j|j|jfSr)r�r�r�rrr�r1rrrr8xs�zBarrier.__getstate__cCs
|jdSra�r�r1rrrr}|szBarrier._statecCs||jd<dSrar�rNrrrr}�scCs
|jdS�Nrr�r1rrrr\�szBarrier._countcCs||jd<dSr�r�rNrrrr\�s)NN)
r?r@rAr-r;r8�propertyr}�setterr\rrrrryhs
	


ry)�__all__rZrrBrrn�r	r
rrr
�ImportError�listrr]rFrG�objectrrrrrrryrrrr�<module>s8�	Mo'multiprocessing/__pycache__/process.cpython-38.opt-1.pyc000064400000024161151153537440017264 0ustar00U

e5d�.�@s8ddddgZddlZddlZddlZddlZddlZddlmZzej�	e�
��ZWnek
rldZYnXdd�Z
dd�Zd	d�Zd
d�ZGdd�de�ZGd
d�de�ZGdd�de�ZGdd�de�Zdae�ae�d�ae�a[iZeej� ��D]0\Z!Z"e!dd�dkr�de!kr�de!��ee"<q�e�Z#dS)�BaseProcess�current_process�active_children�parent_process�N)�WeakSetcCstS)z@
    Return process object representing the current process
    )�_current_process�rr�//usr/lib64/python3.8/multiprocessing/process.pyr%scCst�tt�S)zN
    Return list of process objects corresponding to live child processes
    )�_cleanup�list�	_childrenrrrr	r+scCstS)z?
    Return process object representing the parent process
    )�_parent_processrrrr	r3scCs*tt�D]}|j��dk	rt�|�qdS�N)rr�_popen�poll�discard)�prrr	r
=sr
c@s�eZdZdZdd�Zddddifdd�dd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
d,dd�Zdd�Zdd�Z
edd��Zejdd��Zedd��Zejdd��Zedd ��Zejd!d ��Zed"d#��Zed$d%��ZeZed&d'��Zd(d)�Zd-d*d+�ZdS).rz�
    Process objects represent activity that is run in a separate process

    The class is analogous to `threading.Thread`
    cCst�dSr)�NotImplementedError��selfrrr	�_PopenMszBaseProcess._PopenNr)�daemoncCs�tt�}tj|f|_tj��|_t��|_tj	|_
d|_d|_||_
t|�|_t|�|_|p�t|�jdd�dd�|jD��|_|dk	r�||_t�|�dS)NF�-�:css|]}t|�VqdSr)�str)�.0�irrr	�	<genexpr>^sz'BaseProcess.__init__.<locals>.<genexpr>)�next�_process_counterr�	_identity�_config�copy�os�getpid�_parent_pid�name�_parent_namer�_closed�_target�tuple�_args�dict�_kwargs�type�__name__�join�_namer�	_dangling�add)r�group�targetr&�args�kwargsr�countrrr	�__init__Ps 


�zBaseProcess.__init__cCs|jrtd��dS)Nzprocess object is closed)r(�
ValueErrorrrrr	�
_check_closedcszBaseProcess._check_closedcCs|jr|j|j|j�dS)zQ
        Method to be run in sub-process; can be overridden in sub-class
        N)r)r+r-rrrr	�rungszBaseProcess.runcCs>|��t�|�|�|_|jj|_|`|`|`t	�
|�dS)z%
        Start child process
        N)r;r
rr�sentinel�	_sentinelr)r+r-rr3rrrr	�startns
zBaseProcess.startcCs|��|j��dS)zT
        Terminate process; sends SIGTERM signal or uses TerminateProcess()
        N)r;r�	terminaterrrr	r@�szBaseProcess.terminatecCs|��|j��dS)zT
        Terminate process; sends SIGKILL signal or uses TerminateProcess()
        N)r;r�killrrrr	rA�szBaseProcess.killcCs*|��|j�|�}|dk	r&t�|�dS)z5
        Wait until child process terminates
        N)r;r�waitrr)r�timeout�resrrr	r0�szBaseProcess.joincCsJ|��|tkrdS|jdkr"dS|j��}|dkr8dSt�|�dSdS)z1
        Return whether process is alive
        TNF)r;rrrrr)r�
returncoderrr	�is_alive�s


zBaseProcess.is_alivecCsH|jdk	r>|j��dkr td��|j��d|_|`t�|�d|_dS)z�
        Close the Process object.

        This method releases resources held by the Process object.  It is
        an error to call this method if the child process is still running.
        Nz^Cannot close a process while it is still running. You should first call join() or terminate().T)rrr:�closer>rrr(rrrr	rG�s


zBaseProcess.closecCs|jSr�r1rrrr	r&�szBaseProcess.namecCs
||_dSrrH)rr&rrr	r&�scCs|j�dd�S)z4
        Return whether process is a daemon
        rF)r!�getrrrr	r�szBaseProcess.daemoncCs||jd<dS)z1
        Set whether process is a daemon
        rN�r!)rZdaemonicrrr	r�scCs
|jdS)N�authkeyrJrrrr	rK�szBaseProcess.authkeycCst|�|jd<dS)z2
        Set authorization key of process
        rKN)�AuthenticationStringr!)rrKrrr	rK�scCs"|��|jdkr|jS|j��S)zM
        Return exit code of process or `None` if it has yet to stop
        N)r;rrrrrr	�exitcode�s
zBaseProcess.exitcodecCs*|��|tkrt��S|jo$|jjSdS)zU
        Return identifier (PID) of process or `None` if it has yet to start
        N)r;rr#r$r�pidrrrr	�ident�szBaseProcess.identcCs4|��z|jWStk
r.td�d�YnXdS)z{
        Return a file descriptor (Unix) or handle (Windows) suitable for
        waiting for process termination.
        zprocess not startedN)r;r>�AttributeErrorr:rrrr	r=�s
zBaseProcess.sentinelcCs�d}|tkrd}nL|jrd}n@|jt��kr2d}n,|jdkrBd}n|j��}|dk	rZd}nd}t|�jd|j	g}|jdk	r�|�
d|jj�|�
d|j�|�
|�|dk	r�t�
||�}|�
d	|�|jr�|�
d
�dd�|�S)
NZstarted�closed�unknown�initialZstoppedzname=%rzpid=%sz	parent=%szexitcode=%srz<%s>� )rr(r%r#r$rrr.r/r1�appendrN�_exitcode_to_namerIrr0)rrMZstatus�inforrr	�__repr__s0




zBaseProcess.__repr__c
Csvddlm}m}�z>z�|jdk	r,|�|j�t	�
d�at�a
|��t}|at|j|j|�atjrnt����z|j��|��W5~X|�d�z|��d}W5|��XWn�tk
�r}zJ|js�d}n:t|jdt�r�|jd}nt j!�"t#|jd�d�d}W5d}~XYn2d}ddl$}t j!�"d|j%�|�&�YnXW5t��|�d|�|��X|S)N�)�util�contextz process exiting with exitcode %dz child process calling self.run()r�
zProcess %s:
)'�rZr[�	threadingZ	_shutdownrWZ_flush_std_streamsZ
_start_methodZ_force_start_method�	itertoolsr8r�setrZ_close_stdinr�_ParentProcessr'r%r
Z_HAVE_THREAD_NATIVE_IDZmain_threadZ_set_native_idZ_finalizer_registry�clearZ_run_after_forkersZ_exit_functionr<�
SystemExitr6�
isinstance�int�sys�stderr�writer�	tracebackr&�	print_exc)rZparent_sentinelrZr[rMZold_process�erirrr	�
_bootstrap"sR

�


zBaseProcess._bootstrap)N)N)r/�
__module__�__qualname__�__doc__rr9r;r<r?r@rAr0rFrG�propertyr&�setterrrKrMrOrNr=rXrlrrrr	rGsD�







	


c@seZdZdd�ZdS)rLcCs,ddlm}|�dkrtd��tt|�ffS)NrY)�get_spawning_popenzJPickling an AuthenticationString object is disallowed for security reasons)r[rr�	TypeErrorrL�bytes)rrrrrr	�
__reduce__Xs
�zAuthenticationString.__reduce__N)r/rmrnrurrrr	rLWsrLc@s6eZdZdd�Zdd�Zedd��Zd
dd	�ZeZdS)racCs4d|_||_||_d|_d|_d|_||_i|_dS)NrF)r r1�_pidr%rr(r>r!)rr&rNr=rrr	r9hsz_ParentProcess.__init__cCsddlm}||jgdd�S)Nr�rB�rC�Zmultiprocessing.connectionrBr>)rrBrrr	rFrsz_ParentProcess.is_alivecCs|jSr)rvrrrr	rOvsz_ParentProcess.identNcCs ddlm}||jg|d�dS)z6
        Wait until parent process terminates
        rrwrxNry)rrCrBrrr	r0zsz_ParentProcess.join)N)	r/rmrnr9rFrprOr0rNrrrr	rafs


rac@seZdZdd�Zdd�ZdS)�_MainProcesscCs8d|_d|_d|_d|_d|_tt�d��dd�|_dS)NrZMainProcessF� z/mp)rKZ	semprefix)	r r1r%rr(rLr#�urandomr!rrrr	r9�s�z_MainProcess.__init__cCsdSrrrrrr	rG�sz_MainProcess.closeN)r/rmrnr9rGrrrr	rz�srzrY�ZSIG�_r)$�__all__r#rf�signalr_r^Z_weakrefsetr�path�abspath�getcwdZORIGINAL_DIR�OSErrorrrrr
�objectrrtrLrarzr
rr8rr`rrVr�__dict__�itemsr&Zsignumr2rrrr	�<module>
s@�


!
multiprocessing/__pycache__/popen_forkserver.cpython-38.pyc000064400000004563151153537440020244 0ustar00U

e5d��@s�ddlZddlZddlmZmZejs.ed��ddlmZddlm	Z	ddlm
Z
ddlmZd	gZGd
d�de
�ZGdd	�d	e	j�ZdS)
�N�)�	reduction�set_spawning_popenz,No support for sending fds between processes)�
forkserver)�
popen_fork)�spawn)�util�Popenc@seZdZdd�Zdd�ZdS)�_DupFdcCs
||_dS�N)�ind)�selfr�r�8/usr/lib64/python3.8/multiprocessing/popen_forkserver.py�__init__sz_DupFd.__init__cCst��|jSr)rZget_inherited_fdsr)r
rrr�detachsz
_DupFd.detachN)�__name__�
__module__�__qualname__rrrrrrr
sr
csBeZdZdZeZ�fdd�Zdd�Zdd�Ze	j
fdd	�Z�ZS)
r	rcsg|_t��|�dSr)�_fds�superr)r
�process_obj��	__class__rrr!szPopen.__init__cCs|j�|�t|j�dS)Nr)r�append�len)r
�fdrrr�duplicate_for_child%szPopen.duplicate_for_childc	Cs�t�|j�}t��}t|�zt�||�t�||�W5td�Xt�	|j
�\|_}t�
|�}t�|tj||jf�|_t|ddd��}|�|���W5QRXt�|j�|_dS)N�wbT)�closefd)rZget_preparation_data�_name�io�BytesIOrr�dumprZconnect_to_new_processr�sentinel�os�duprZFinalizeZ	close_fds�	finalizer�open�write�	getbuffer�read_signed�pid)r
rZ	prep_dataZbuf�wZ	_parent_w�frrr�_launch)s


�z
Popen._launchc	Csr|jdkrlddlm}|tjkr$dnd}||jg|�s:dSzt�|j�|_Wntt	fk
rjd|_YnX|jS)Nr)�wait�)
�
returncodeZmultiprocessing.connectionr0r%�WNOHANGr$rr+�OSError�EOFError)r
�flagr0Ztimeoutrrr�poll=s
z
Popen.poll)
rrr�methodr
ZDupFdrrr/r%r3r7�
__classcell__rrrrr	s)r!r%�contextrrZHAVE_SEND_HANDLE�ImportError�rrrr�__all__�objectr
r	rrrr�<module>s
multiprocessing/__pycache__/popen_spawn_posix.cpython-38.opt-2.pyc000064400000004242151153537440021360 0ustar00U

e5d��@spddlZddlZddlmZmZddlmZddlmZddlmZdgZ	Gdd	�d	e
�ZGd
d�dej�ZdS)�N�)�	reduction�set_spawning_popen)�
popen_fork)�spawn)�util�Popenc@seZdZdd�Zdd�ZdS)�_DupFdcCs
||_dS�N��fd��selfr�r�9/usr/lib64/python3.8/multiprocessing/popen_spawn_posix.py�__init__sz_DupFd.__init__cCs|jSr
r)rrrr�detachsz
_DupFd.detachN)�__name__�
__module__�__qualname__rrrrrrr	sr	cs4eZdZdZeZ�fdd�Zdd�Zdd�Z�Z	S)rrcsg|_t��|�dSr
)�_fds�superr)r�process_obj��	__class__rrrszPopen.__init__cCs|j�|�|Sr
)r�appendr
rrr�duplicate_for_child"szPopen.duplicate_for_childcCsXddlm}|��}|j�|�t�|j�}t�	�}t
|�zt�||�t�||�W5t
d�Xd}}}}	z~t��\}}t��\}}	tj||d�}|j�||g�t
�t��||j�|_||_t|	ddd��}
|
�|���W5QRXW5g}
||	fD]}|dk	�r|
�|��qt
�|t
j|
�|_||fD]}|dk	�r6t�|��q6XdS)Nr)�resource_tracker)�
tracker_fdZpipe_handle�wbF)�closefd)�rZgetfdrrrZget_preparation_data�_name�io�BytesIOrr�dumprZFinalizeZ	close_fds�	finalizer�os�close�pipeZget_command_line�extendZspawnv_passfdsZget_executable�pid�sentinel�open�write�	getbuffer)rrrrZ	prep_data�fpZparent_rZchild_wZchild_rZparent_wZfds_to_closer�cmd�frrr�_launch&sB
�
�

z
Popen._launch)
rrr�methodr	ZDupFdrrr3�
__classcell__rrrrrs
)
r#r'�contextrrr!rrr�__all__�objectr	rrrrr�<module>s
multiprocessing/__pycache__/shared_memory.cpython-38.opt-1.pyc000064400000033524151153537440020447 0ustar00U

e5dD�@s�dZddgZddlmZddlZddlZddlZddlZddlZej	dkrXddl
Z
dZnddlZdZej
ejBZd	Zer~d
ZndZdd
�ZGdd�d�ZdZGdd�d�ZdS)z�Provides shared memory for direct access across processes.

The API of this package is currently provisional. Refer to the
documentation for details.
�SharedMemory�
ShareableList�)�partialN�ntFT�z/psm_Zwnsm_cCs"ttt�d}tt�|�}|S)z6Create a random filename for the shared memory object.�)�_SHM_SAFE_NAME_LENGTH�len�_SHM_NAME_PREFIX�secretsZ	token_hex)�nbytes�name�r�5/usr/lib64/python3.8/multiprocessing/shared_memory.py�_make_filename&src@s�eZdZdZdZdZdZdZej	Z
dZer.dndZ
ddd	�Zd
d�Zdd
�Zdd�Zedd��Zedd��Zedd��Zdd�Zdd�ZdS)ra�Creates a new shared memory block or attaches to an existing
    shared memory block.

    Every shared memory block is assigned a unique name.  This enables
    one process to create a shared memory block with a particular name
    so that a different process can attach to that same shared memory
    block using that same name.

    As a resource for sharing data across processes, shared memory blocks
    may outlive the original process that created them.  When one process
    no longer needs access to a shared memory block that might still be
    needed by other processes, the close() method should be called.
    When a shared memory block is no longer needed by any process, the
    unlink() method should be called to ensure proper cleanup.N���i�TFrc
	Csl|dkstd��|r0ttjB|_|dkr0td��|dkrL|jtj@sLtd��t�rH|dkr�t�}ztj	||j|j
d�|_Wntk
r�YqZYnX||_
q�qZn.|jr�d|n|}tj	||j|j
d�|_||_
z<|r�|r�t�|j|�t�|j�}|j}t�|j|�|_Wn tk
�r*|���YnXddlm}||j
d	��n|�r�|dk�r^t�n|}t�tjtjtj|d
?d@|d@|�}zXt��}|tjk�r�|dk	�r�tt j!t�"t j!�|tj��nW��qNtjd||d
�|_W5t�|�X||_
�qV�qNnX||_
t�#tj$d|�}zt�%|tj$ddd�}	W5t�|�Xt�&|	�}tjd||d
�|_||_'t(|j�|_)dS)Nrz!'size' must be a positive integerz4'size' must be a positive number different from zeroz&'name' can only be None if create=True)�mode�/�)�register�
shared_memory� l��r)ZtagnameF)*�
ValueError�_O_CREX�os�O_RDWR�_flags�O_EXCL�
_USE_POSIXr�_posixshmemZshm_open�_mode�_fd�FileExistsError�_name�_prepend_leading_slash�	ftruncate�fstat�st_size�mmap�_mmap�OSError�unlink�resource_trackerr�_winapiZCreateFileMappingZINVALID_HANDLE_VALUEZNULLZPAGE_READWRITEZCloseHandleZGetLastErrorZERROR_ALREADY_EXISTS�errnoZEEXIST�strerrorZOpenFileMappingZ
FILE_MAP_READZ
MapViewOfFileZVirtualQuerySize�_size�
memoryview�_buf)
�selfr
�create�sizeZstatsrZ	temp_nameZh_mapZlast_error_codeZp_bufrrr�__init__Is��
�
�

�
��
zSharedMemory.__init__cCs&z|��Wntk
r YnXdS�N)�closer*�r3rrr�__del__�szSharedMemory.__del__cCs|j|jd|jffS)NF)�	__class__r
r5r9rrr�
__reduce__�s��zSharedMemory.__reduce__cCs|jj�d|j�d|j�d�S)N�(z, size=�))r;�__name__r
r5r9rrr�__repr__�szSharedMemory.__repr__cCs|jS)z4A memoryview of contents of the shared memory block.)r2r9rrr�buf�szSharedMemory.bufcCs.|j}tr*|jr*|j�d�r*|jdd�}|S)z4Unique name that identifies the shared memory block.rrN)r#rr$�
startswith)r3Z
reported_namerrrr
�s

zSharedMemory.namecCs|jS)zSize in bytes.)r0r9rrrr5�szSharedMemory.sizecCsX|jdk	r|j��d|_|jdk	r4|j��d|_trT|jdkrTt�|j�d|_dS)zkCloses access to the shared memory from this instance but does
        not destroy the shared memory block.Nrr)r2�releaser)r8rr!rr9rrrr8�s



zSharedMemory.closecCs2tr.|jr.ddlm}t�|j�||jd�dS)z�Requests that the underlying shared memory block be destroyed.

        In order to ensure proper cleanup of resources, unlink should be
        called once (and only once) across all processes which have access
        to the shared memory block.r)�
unregisterrN)rr#r,rDrZ
shm_unlink)r3rDrrrr+�s
zSharedMemory.unlink)NFr)r?�
__module__�__qualname__�__doc__r#r!r)r2rrrr rr$r6r:r<r@�propertyrAr
r5r8r+rrrrr0s(
l




�utf8c@seZdZdZedededededdj	diZ
dZd	d
�dd
�dd
�d
d
�d�Ze
dd��Zd6dd�dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zed$d%��Zed&d'��Zed(d)��Zed*d+��Zed,d-��Zed.d/��Zed0d1��Zd2d3�Z d4d5�Z!dS)7ra�Pattern for a mutable list-like object shareable via a shared
    memory block.  It differs from the built-in list type in that these
    lists can not change their overall length (i.e. no append, insert,
    etc.)

    Because values are packed into a memoryview as bytes, the struct
    packing format for any storable value must require no more than 8
    characters to describe its format.�q�dzxxxxxxx?z%dsNzxxxxxx?x�cCs|Sr7r��valuerrr�<lambda>
�zShareableList.<lambda>cCs|�d��t�S�N�)�rstrip�decode�	_encodingrMrrrrOrPcCs
|�d�SrQ)rSrMrrrrOrPcCsdSr7r)Z_valuerrrrO
rP)rrr�cCs:t|ttdjf�sdSt|t�r$dSt|t�r2dSdSdS)z�Used in concert with _back_transforms_mapping to convert values
        into the appropriate Python objects when retrieving them from
        the list as well as when storing them.NrrrrV)�
isinstance�str�bytesr;rMrrr�_extract_recreation_codes

z&ShareableList._extract_recreation_code�r
csr|dk	rv�fdd�|D�}t|��_t�fdd�|D���_�fdd�|D�}t�d�jd�|��j�j	�}nd}|dk	r�|dkr�t
|��_nt
|d	|d
��_|dk	�rNt�tj
d�j�jjd�jf�j��tj
d�|��jj�jf�fdd�|D���tj
�j�jj�jf�fd
d�|D���tj
�j	�jj�jf|��n t���_t��j�jjd��_dS)NcsPg|]H}t|ttf�s$�jt|�n&�jt|��jt|��jdf�qS)r)rWrXrY�_types_mapping�type�
_alignmentr	��.0�itemr9rr�
<listcomp> s���z*ShareableList.__init__.<locals>.<listcomp>c3s0|](}|ddkr�jnt|dd��VqdS)r�sN)r^�int)r`�fmtr9rr�	<genexpr>*s�z)ShareableList.__init__.<locals>.<genexpr>csg|]}��|��qSr)rZr_r9rrrb.srJ�rLT)r4r5rc3s&|]}t|t�r|���n|VqdSr7)rWrX�encode�r`�v��_encrrrfMsc3s|]}|���VqdSr7)rhrirkrrrfSs)r	�	_list_len�tuple�_allocated_bytes�structZcalcsize�_format_size_metainfo�join�_format_packing_metainfo�_format_back_transform_codesr�shmrU�	pack_intorA�_offset_data_start�_offset_packing_formats�_offset_back_transform_codes�unpack_from)r3Zsequencer
Z_formatsZ_recreation_codesZrequested_sizer)rlr3rr6sz
�
�

�����
��������
�zShareableList.__init__cCsj|dkr|n||j}||jks*|jdkr2td��t�d|jj|j|d�d}|�d�}|�t	�}|S)z>Gets the packing format for a single value stored in the list.r� Requested position out of range.�8srLrR)
rm�
IndexErrorrprzrurArxrSrTrU)r3�positionrjre�
fmt_as_strrrr�_get_packing_formatds��

z!ShareableList._get_packing_formatcCs\|dkr|n||j}||jks*|jdkr2td��t�d|jj|j|�d}|j|}|S)z9Gets the back transformation function for a single value.rr{�b)rmr}rprzrurAry�_back_transforms_mapping)r3r~�transform_codeZtransform_functionrrr�_get_back_transformts��
z!ShareableList._get_back_transformcCs~|dkr|n||j}||jks*|jdkr2td��t�d|jj|j|d|�t��|�	|�}t�d|jj|j
||�dS)zvSets the packing format and back transformation code for a
        single value in the list at the specified position.rr{r|rLr�N)rmr}rprvrurArxrhrUrZry)r3r~rrNr�rrr�!_set_packing_format_and_transform�s �
�z/ShareableList._set_packing_format_and_transformcCsjz6|jt|jd|��}t�|�|�|jj|�\}Wntk
rRtd��YnX|�	|�}||�}|S)Nzindex out of range)
rw�sumrorprzr�rurAr}r�)r3r~�offsetrjZback_transformrrr�__getitem__�s��

zShareableList.__getitem__cCs�z&|jt|jd|��}|�|�}Wntk
rBtd��YnXt|ttf�sf|jt	|�}|}nZt|t�rz|�
t�n|}t|�|j|kr�t
d��|ddkr�|}n|jt|j|f}|�|||�t�||jj||�dS)Nzassignment index out of rangez(bytes/str item exceeds available storagerrc)rwr�ror�r}rWrXrYr\r]rhrUr	rr�rprvrurA)r3r~rNr�Zcurrent_formatZ
new_formatZ
encoded_valuerrr�__setitem__�s6�����zShareableList.__setitem__cCst|j|jjd�dfS)Nr[r)rr;rur
r9rrrr<�szShareableList.__reduce__cCst�d|jjd�dS)NrJr)rprzrurAr9rrr�__len__�szShareableList.__len__cCs"|jj�dt|��d|jj�d�S)Nr=z, name=r>)r;r?�listrur
r9rrrr@�szShareableList.__repr__csd��fdd�t�j�D��S)z>The struct packing format used by all currently stored values.rgc3s|]}��|�VqdSr7)r�)r`�ir9rrrf�sz'ShareableList.format.<locals>.<genexpr>)rr�rangermr9rr9r�format�s�zShareableList.formatcCs|j�d�S)z=The struct packing format used for metainfo on storage sizes.rJ�rmr9rrrrq�sz#ShareableList._format_size_metainfocCs
d|jS)z?The struct packing format used for the values' packing formats.r|r�r9rrrrs�sz&ShareableList._format_packing_metainfocCs
d|jS)z?The struct packing format used for the values' back transforms.r�r�r9rrrrt�sz*ShareableList._format_back_transform_codescCs|jddS)NrrLr�r9rrrrw�sz ShareableList._offset_data_startcCs|jt|j�Sr7)rwr�ror9rrrrx�sz%ShareableList._offset_packing_formatscCs|j|jdS)NrL)rxrmr9rrrry�sz*ShareableList._offset_back_transform_codescst�fdd�|D��S)zCL.count(value) -> integer -- return number of occurrences of value.c3s|]}�|kVqdSr7r)r`�entryrMrrrf�sz&ShareableList.count.<locals>.<genexpr>)r�)r3rNrrMr�count�szShareableList.countcCs4t|�D]\}}||kr|Sqt|�d���dS)zpL.index(value) -> integer -- return first index of value.
        Raises ValueError if the value is not present.z not in this containerN)�	enumerater)r3rNr~r�rrr�index�s
zShareableList.index)N)"r?rErFrGrd�float�boolrXrYr;r\r^r��staticmethodrZr6r�r�r�r�r�r<r�r@rHr�rqrsrtrwrxryr�r�rrrrr�s^
��

F






)rG�__all__�	functoolsrr(rr.rprr
r-rr�O_CREATrrrr
rrrUrrrrr�<module>s,

Emultiprocessing/__pycache__/resource_tracker.cpython-38.pyc000064400000012103151153537440020202 0ustar00U

e5d�!�@s�ddlZddlZddlZddlZddlZddlmZddlmZdddgZe	ed�Z
ejejfZ
d	d
d�iZejdkr�ddlZddlZe�ejejd
��Gdd�de�Ze�ZejZejZejZejZdd�ZdS)�N�)�spawn)�util�ensure_running�register�
unregister�pthread_sigmaskZnoopcCsdS�N�r
r
r
�8/usr/lib64/python3.8/multiprocessing/resource_tracker.py�<lambda>!�r�posix)Z	semaphoreZ
shared_memoryc@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�ResourceTrackercCst��|_d|_d|_dSr	)�	threadingZLock�_lock�_fd�_pid��selfr
r
r�__init__0s
zResourceTracker.__init__c	CsT|j�D|jdkr W5QR�dSt�|j�d|_t�|jd�d|_W5QRXdS)Nr)rr�os�close�waitpidrrr
r
r�_stop5s
zResourceTracker._stopcCs|��|jSr	)rrrr
r
r�getfdBszResourceTracker.getfdcCst|j��b|jdk	r~|��r*W5QR�dSt�|j�z|jdk	rPt�|jd�Wntk
rfYnXd|_d|_t�	d�g}z|�
tj�
��Wntk
r�YnXd}t��\}}z�zr|�
|�t��}|gt��}|d||g7}z&t�rt�tjt�t�|||�}W5t�r,t�tjt�XWnt�|��YnX||_||_W5t�|�XW5QRXdS)z�Make sure that resource tracker process is running.

        This can be run from any process.  Usually a child process will use
        the resource created by its parent.NrzUresource_tracker: process died unexpectedly, relaunching.  Some resources might leak.z:from multiprocessing.resource_tracker import main;main(%d)z-c)rr�_check_aliverrrr�ChildProcessError�warnings�warn�append�sys�stderr�fileno�	Exception�piperZget_executablerZ_args_from_interpreter_flags�
_HAVE_SIGMASK�signalr�SIG_UNBLOCK�_IGNORED_SIGNALS�	SIG_BLOCKZspawnv_passfds)rZfds_to_pass�cmd�r�wZexe�args�pidr
r
rrFsJ






zResourceTracker.ensure_runningcCs2zt�|jd�Wntk
r(YdSXdSdS)z;Check that the pipe has not been closed by sending a probe.s
PROBE:0:noop
FTN)r�writer�OSErrorrr
r
rr�s
zResourceTracker._check_alivecCs|�d||�dS)z0Register name of resource with resource tracker.�REGISTERN��_send�r�name�rtyper
r
rr�szResourceTracker.registercCs|�d||�dS)z2Unregister name of resource with resource tracker.�
UNREGISTERNr3r5r
r
rr�szResourceTracker.unregistercCsb|��d�|||��d�}t|�dkr0td��t�|j|�}|t|�ks^td�|t|����dS)Nz{0}:{1}:{2}
�asciiiz
name too longznbytes {0:n} but len(msg) {1:n})	r�format�encode�len�
ValueErrorrr0r�AssertionError)rr+r6r7�msg�nbytesr
r
rr4�s�zResourceTracker._sendN)�__name__�
__module__�__qualname__rrrrrrrr4r
r
r
rr.s
@rc
Cst�tjtj�t�tjtj�tr2t�tjt�tj	tj
fD]&}z|��Wq>tk
rbYq>Xq>dd�t
��D�}z�t|d���}|D]�}z�|���d��d�\}}}t
�|d�}	|	dkr�td	|�d
|����|dkr�||�|�n2|dk�r||�|�n|d
k�rntd|��Wq�tk
�rTztjt���WnYnXYq�Xq�W5QRXW5|��D]�\}}|�r�zt�dt|�|f�Wntk
�r�YnX|D]V}zLzt
||�Wn6tk
�r�}zt�d||f�W5d}~XYnXW5X�q��qnXdS)zRun resource tracker.cSsi|]}|t��qSr
)�set)�.0r7r
r
r�
<dictcomp>�szmain.<locals>.<dictcomp>zQresource_tracker: There appear to be %d leaked %s objects to clean up at shutdownzresource_tracker: %r: %sN�rbr9�:zCannot register z. for automatic cleanup: unknown resource type r2r8ZPROBEzunrecognized command %r)r'�SIGINT�SIG_IGN�SIGTERMr&rr(r)r!�stdin�stdoutrr$�_CLEANUP_FUNCS�keys�itemsrrr<�open�strip�decode�split�getr=�add�remove�RuntimeError�
excepthook�exc_info)
�fd�f�cacher7Zrtype_cacher6�e�liner+Zcleanup_funcr
r
r�main�s^�


�
(r`)rr'r!rr�rr�__all__�hasattrr&rIrKr)rNr6Z_multiprocessingZ_posixshmem�updateZ
sem_unlinkZ
shm_unlink�objectrZ_resource_trackerrrrrr`r
r
r
r�<module>s4

�
�wmultiprocessing/__pycache__/popen_fork.cpython-38.opt-2.pyc000064400000005013151153537440017744 0ustar00U

e5d
�@s6ddlZddlZddlmZdgZGdd�de�ZdS)�N�)�util�Popenc@s`eZdZdZdd�Zdd�Zejfdd�Zdd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�ZdS)r�forkcCs"t��d|_d|_|�|�dS�N)rZ_flush_std_streams�
returncode�	finalizer�_launch)�self�process_obj�r�2/usr/lib64/python3.8/multiprocessing/popen_fork.py�__init__szPopen.__init__cCs|Srr)r
�fdrrr
�duplicate_for_childszPopen.duplicate_for_childc
Cs�|jdkrzzt�|j|�\}}Wn(tk
rH}z
WY�dSd}~XYnX||jkrzt�|�rnt�|�|_nt�|�|_|jSr)r�os�waitpid�pid�OSError�WIFSIGNALED�WTERMSIG�WEXITSTATUS)r
�flagr�sts�errr
�polls


z
Popen.pollNcCsN|jdkrH|dk	r0ddlm}||jg|�s0dS|�|dkrBtjnd�S|jS)Nr)�waitg)rZmultiprocessing.connectionr�sentinelrr�WNOHANG)r
�timeoutrrrr
r(s
z
Popen.waitcCsZ|jdkrVzt�|j|�Wn8tk
r0Yn&tk
rT|jdd�dkrP�YnXdS)Ng�������?)r)rr�killr�ProcessLookupErrorrr)r
Zsigrrr
�_send_signal2s
zPopen._send_signalcCs|�tj�dSr)r"�signal�SIGTERM�r
rrr
�	terminate<szPopen.terminatecCs|�tj�dSr)r"r#�SIGKILLr%rrr
r ?sz
Popen.killc	Cs�d}t��\}}t��\}}t��|_|jdkrdz$t�|�t�|�|j|d�}W5t�|�Xn0t�|�t�|�t�|tj	||f�|_
||_dS)Nrr)Zparent_sentinel)r�piperr�_exit�close�
_bootstraprZFinalizeZ	close_fdsrr)r
r�codeZparent_rZchild_wZchild_rZparent_wrrr
r	Bs 






�z
Popen._launchcCs|jdk	r|��dSr)rr%rrr
r*Us
zPopen.close)N)�__name__�
__module__�__qualname__�methodrrrrrrr"r&r r	r*rrrr
rs


)rr#�r�__all__�objectrrrrr
�<module>smultiprocessing/__pycache__/connection.cpython-38.opt-1.pyc000064400000060712151153537440017747 0ustar00U

&�.ep|�@sddddgZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddl
mZm
Z
dd	lmZejZz$ddlZdd
lmZmZmZmZWn$ek
r�ejdkr‚dZYnXdZd
ZdZe��ZdZdgZe ed��rdZedg7Zejdk�rdZedg7Zefdd�Z!dd�Z"dd�Z#dd�Z$dd�Z%Gdd�d�Z&e�rnGdd�de&�Z'Gd d!�d!e&�Z(Gd"d�de)�Z*dPd#d�Z+ejdk�r�dQd%d�Z,n
dRd&d�Z,Gd'd(�d(e)�Z-d)d*�Z.ejdk�r�Gd+d,�d,e)�Z/d-d.�Z0d/Z1d0Z2d1Z3d2Z4d3d4�Z5d5d6�Z6Gd7d8�d8e)�Z7d9d:�Z8d;d<�Z9Gd=d>�d>e*�Z:d?d@�Z;ejdk�rzdAdB�Z<ej=ej>hZ?dSdCd�Z@n,ddlAZAe eAdD��r�eAjBZCneAjDZCdTdEd�Z@ejdk�r�dFdG�ZEdHdI�ZFe�Ge(eE�dJdK�ZHdLdM�ZIe�Ge'eH�ndNdG�ZEdOdI�ZFe�Ge(eE�dS)U�Client�Listener�Pipe�wait�N�)�util)�AuthenticationError�BufferTooShort)�	reduction)�
WAIT_OBJECT_0�WAIT_ABANDONED_0�WAIT_TIMEOUT�INFINITE�win32i g4@Zsha256�AF_INET�AF_UNIX�AF_PIPEcCst��|S�N��time�	monotonic)�timeout�r�2/usr/lib64/python3.8/multiprocessing/connection.py�
_init_timeout?srcCst��|kSrr)�trrr�_check_timeoutBsrcCsX|dkrdS|dkr&tjdt��d�S|dkrLtjdt��tt�fdd�Std	��d
S)z?
    Return an arbitrary free address for the given family
    r)Z	localhostrrz	listener-)�prefix�dirrz\\.\pipe\pyc-%d-%d-�zunrecognized familyN)	�tempfileZmktemprZget_temp_dir�os�getpid�next�
_mmap_counter�
ValueError��familyrrr�arbitrary_addressIs��r(cCsJtjdkr|dkrtd|��tjdkrF|dkrFtt|�sFtd|��dS)zD
    Checks if the family is valid for the current environment.
    rrzFamily %s is not recognized.rN)�sys�platformr%�hasattr�socketr&rrr�_validate_familyWs

r-cCsTt|�tkrdSt|�tkr*|�d�r*dSt|�tks@t�|�rDdStd|��dS)z]
    Return the types of the address

    This can be 'AF_INET', 'AF_UNIX', or 'AF_PIPE'
    rz\\rrzaddress type of %r unrecognizedN)�type�tuple�str�
startswithr�is_abstract_socket_namespacer%)�addressrrr�address_typecsr4c@s�eZdZdZd+dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	e
dd��Ze
dd��Ze
dd��Z
dd�Zdd�Zd,dd�Zdd�Zd-dd�Zd.d d!�Zd"d#�Zd/d%d&�Zd'd(�Zd)d*�ZdS)0�_ConnectionBaseNTcCs>|��}|dkrtd��|s(|s(td��||_||_||_dS)Nrzinvalid handlez6at least one of `readable` and `writable` must be True)�	__index__r%�_handle�	_readable�	_writable)�self�handle�readable�writablerrr�__init__ys�z_ConnectionBase.__init__cCs|jdk	r|��dSr�r7�_close�r:rrr�__del__�s
z_ConnectionBase.__del__cCs|jdkrtd��dS)Nzhandle is closed)r7�OSErrorrArrr�
_check_closed�s
z_ConnectionBase._check_closedcCs|jstd��dS)Nzconnection is write-only)r8rCrArrr�_check_readable�sz_ConnectionBase._check_readablecCs|jstd��dS)Nzconnection is read-only)r9rCrArrr�_check_writable�sz_ConnectionBase._check_writablecCs"|jrd|_n|��td��dS)NFzbad message length)r9r8�closerCrArrr�_bad_message_length�sz#_ConnectionBase._bad_message_lengthcCs
|jdkS)z True if the connection is closedN�r7rArrr�closed�sz_ConnectionBase.closedcCs|jS)z"True if the connection is readable)r8rArrrr<�sz_ConnectionBase.readablecCs|jS)z"True if the connection is writable)r9rArrrr=�sz_ConnectionBase.writablecCs|��|jS)z+File descriptor or handle of the connection)rDr7rArrr�fileno�sz_ConnectionBase.filenocCs$|jdk	r z|��W5d|_XdS)zClose the connectionNr?rArrrrG�s
z_ConnectionBase.closercCs�|��|��t|�}|jdkr.tt|��}t|�}|dkrFtd��||krVtd��|dkrh||}n&|dkrztd��n|||kr�td��|�||||��dS)z,Send the bytes data from a bytes-like objectrrzoffset is negativezbuffer length < offsetNzsize is negativezbuffer length < offset + size)rDrF�
memoryview�itemsize�bytes�lenr%�_send_bytes)r:�buf�offset�size�m�nrrr�
send_bytes�s"


z_ConnectionBase.send_bytescCs$|��|��|�t�|��dS)zSend a (picklable) objectN)rDrFrP�_ForkingPickler�dumps�r:�objrrr�send�sz_ConnectionBase.sendcCsJ|��|��|dk	r(|dkr(td��|�|�}|dkrB|��|��S)z7
        Receive bytes data as a bytes object.
        Nrznegative maxlength)rDrEr%�_recv_bytesrH�getvalue)r:Z	maxlengthrQrrr�
recv_bytes�s
z_ConnectionBase.recv_bytesc
Cs�|��|��t|���}|j}|t|�}|dkr>td��n||krNtd��|��}|��}|||krvt|�	���|�
d�|�||||||��|W5QR�SQRXdS)zq
        Receive bytes data into a writeable bytes-like object.
        Return the number of bytes read.
        rznegative offsetzoffset too largeN)rDrErLrMrOr%r\�tellr	r]�seek�readinto)r:rQrRrTrMZbytesize�resultrSrrr�recv_bytes_into�s$



�z_ConnectionBase.recv_bytes_intocCs&|��|��|��}t�|���S)zReceive a (picklable) object)rDrEr\rW�loads�	getbuffer)r:rQrrr�recv�sz_ConnectionBase.recv�cCs|��|��|�|�S)z/Whether there is any input available to be read)rDrE�_poll�r:rrrr�pollsz_ConnectionBase.pollcCs|SrrrArrr�	__enter__sz_ConnectionBase.__enter__cCs|��dSr�rG�r:�exc_type�	exc_valueZexc_tbrrr�__exit__
sz_ConnectionBase.__exit__)TT)rN)N)r)rg)�__name__�
__module__�__qualname__r7r>rBrDrErFrH�propertyrJr<r=rKrGrVr[r^rcrfrjrkrprrrrr5vs.








r5c@sDeZdZdZdZejfdd�Zdd�Zddd	�Z	d
d�Z
dd
�ZdS)�PipeConnectionz�
        Connection class based on a Windows named pipe.
        Overlapped I/O is used, so the handles must have been created
        with FILE_FLAG_OVERLAPPED.
        FcCs||j�dSrrI)r:Z_CloseHandlerrrr@szPipeConnection._closec	Cshtj|j|dd�\}}z<z |tjkr6t�|jgdt�}Wn|���YnXW5|�d�\}}XdS)NT��
overlappedF)	�_winapiZ	WriteFiler7�GetOverlappedResult�ERROR_IO_PENDING�WaitForMultipleObjects�eventr�cancel)r:rQ�ov�errZnwritten�waitresrrrrPs
�zPipeConnection._send_bytesNc	Cs&|jrd|_t��S|dkr dnt|d�}z�tj|j|dd�\}}dz<z |tjkrdt�
|jgdt�}Wn|���YnXW5|�d�\}}|dkr�t��}|�|�	��|�WS|tj
kr�|�||��WSXWn:tk
�r}z|jtjk�rt�n�W5d}~XYnXtd��dS)NF�Trvrz.shouldn't get here; expected KeyboardInterrupt)�_got_empty_message�io�BytesIO�minrx�ReadFiler7ry�writereZERROR_MORE_DATA�_get_more_datarzr{r|rr}rC�winerror�ERROR_BROKEN_PIPE�EOFError�RuntimeError)	r:�maxsizeZbsizer~rZnread�fr��errrr\*s>
�

�
zPipeConnection._recv_bytescCs.|jst�|j�ddkrdStt|g|��S)NrT)r�rx�
PeekNamedPiper7�boolrrirrrrhJs
�zPipeConnection._pollcCs�|��}t��}|�|�t�|j�d}|dk	rJt|�||krJ|��tj	|j|dd�\}}|�
d�\}}|�|���|S)NrTrv)rer�r�r�rxr�r7rOrHr�ry)r:r~r�rQr��leftrZrbytesrrrr�Ps
zPipeConnection._get_more_data)N)rqrrrs�__doc__r�rx�CloseHandler@rPr\rhr�rrrrrus
 ruc@s|eZdZdZer,ejfdd�ZejZ	ej
Znej
fdd�ZejZ	ejZe	fdd�Zefdd�Zd	d
�Zddd
�Zdd�ZdS)�
Connectionzo
    Connection class based on an arbitrary file descriptor (Unix only), or
    a socket handle (Windows).
    cCs||j�dSrrI�r:r@rrrr@gszConnection._closecCs||j�dSrrIr�rrrr@lscCs8t|�}||j|�}||8}|dkr&q4||d�}qdS�Nr)rOr7)r:rQr��	remainingrUrrr�_sendqszConnection._sendcCsbt��}|j}|}|dkr^|||�}t|�}|dkrJ||krBt�ntd��|�|�||8}q|S)Nrzgot end of file during message)r�r�r7rOr�rCr�)r:rS�readrQr;r��chunkrUrrr�_recvzs


zConnection._recvcCs�t|�}|dkrHt�dd�}t�d|�}|�|�|�|�|�|�n8t�d|�}|dkrr|�|�|�|�n|�||�dS)Ni����!i����!Qi@)rO�structZpackr�)r:rQrUZ
pre_header�headerrrrrP�s


zConnection._send_bytesNcCs^|�d�}t�d|���\}|dkr@|�d�}t�d|���\}|dk	rT||krTdS|�|�S)N�r�r��r�)r�r�Zunpackr])r:r�rQrSrrrr\�s

zConnection._recv_bytescCst|g|�}t|�Sr)rr�)r:r�rrrrrh�szConnection._poll)N)rqrrrsr�rx�_multiprocessingZclosesocketr@r[Z_writerfZ_readr!rGr�r�r�r�rPr\rhrrrrr�`s	

r�c@sReZdZdZddd�Zdd�Zdd	�Zed
d��Zedd
��Z	dd�Z
dd�ZdS)rz�
    Returns a listener object.

    This is a wrapper for a bound socket which is 'listening' for
    connections, or for a Windows named pipe.
    NrcCsp|p|rt|�pt}|pt|�}t|�|dkr>t||�|_nt|||�|_|dk	rft|t�sft	d��||_
dS)Nr�authkey should be a byte string)r4�default_familyr(r-�PipeListener�	_listener�SocketListener�
isinstancerN�	TypeError�_authkey)r:r3r'�backlog�authkeyrrrr>�s�zListener.__init__cCs>|jdkrtd��|j��}|jr:t||j�t||j�|S)zz
        Accept a connection on the bound socket or named pipe of `self`.

        Returns a `Connection` object.
        Nzlistener is closed)r�rC�acceptr��deliver_challenge�answer_challenge)r:�crrrr��s

zListener.acceptcCs |j}|dk	rd|_|��dS)zA
        Close the bound socket or named pipe of `self`.
        N)r�rG)r:ZlistenerrrrrG�szListener.closecCs|jjSr)r��_addressrArrrr3�szListener.addresscCs|jjSr)r��_last_acceptedrArrr�
last_accepted�szListener.last_acceptedcCs|SrrrArrrrk�szListener.__enter__cCs|��dSrrlrmrrrrp�szListener.__exit__)NNrN)rqrrrsr�r>r�rGrtr3r�rkrprrrrr�s
	

cCsh|p
t|�}t|�|dkr&t|�}nt|�}|dk	rHt|t�sHtd��|dk	rdt||�t||�|S)z=
    Returns a connection to the address of a `Listener`
    rNr�)	r4r-�
PipeClient�SocketClientr�rNr�r�r�)r3r'r�r�rrrr�s


TcCsj|r>t��\}}|�d�|�d�t|���}t|���}n$t��\}}t|dd�}t|dd�}||fS)�L
        Returns pair of connection objects at either end of a pipe
        TF�r=�r<)r,Z
socketpair�setblockingr��detachr!�pipe)�duplex�s1�s2�c1�c2Zfd1Zfd2rrrrs

c

Cs�td�}|r*tj}tjtjB}tt}}ntj}tj}dt}}t�||tjBtj	Btj
tjBtjBd||tj
tj�}t�||dtjtjtjtj�}t�|tjdd�tj|dd�}|�d�\}	}
t||d�}t||d�}||fS)	r�rrrNTrvr�r�)r(rx�PIPE_ACCESS_DUPLEX�GENERIC_READ�
GENERIC_WRITE�BUFSIZEZPIPE_ACCESS_INBOUND�CreateNamedPipe�FILE_FLAG_OVERLAPPED�FILE_FLAG_FIRST_PIPE_INSTANCE�PIPE_TYPE_MESSAGE�PIPE_READMODE_MESSAGE�	PIPE_WAIT�NMPWAIT_WAIT_FOREVER�NULL�
CreateFile�
OPEN_EXISTING�SetNamedPipeHandleState�ConnectNamedPiperyru)
r�r3Zopenmode�accessZobsizeZibsizeZh1Zh2rw�_rr�r�rrrrsT
�
��	��c@s*eZdZdZd
dd�Zdd�Zdd�Zd	S)r�zO
    Representation of a socket which is bound to an address and listening
    rcCs�t�tt|��|_zRtjdkr2|j�tjtjd�|j�d�|j�	|�|j�
|�|j��|_Wn t
k
r�|j���YnX||_d|_|dkr�t�|�s�tj|tj|fdd�|_nd|_dS)N�posixrTrr��argsZexitpriority)r,�getattr�_socketr!�nameZ
setsockoptZ
SOL_SOCKETZSO_REUSEADDRr�ZbindZlistenZgetsocknamer�rCrGZ_familyr�rr2�Finalize�unlink�_unlink)r:r3r'r�rrrr>Ks0

�
�
zSocketListener.__init__cCs&|j��\}|_|�d�t|���S)NT)r�r�r�r�r�r��r:�srrrr�ds
zSocketListener.acceptcCs0z|j��W5|j}|dk	r*d|_|�XdSr)r�r�rG)r:r�rrrrGiszSocketListener.closeN)r)rqrrrsr�r>r�rGrrrrr�Gs
r�c
CsPt|�}t�tt|���.}|�d�|�|�t|���W5QR�SQRXdS)zO
    Return a connection object connected to the socket given by `address`
    TN)r4r,r�r�Zconnectr�r�)r3r'r�rrrr�ss


r�c@s8eZdZdZddd�Zd
dd�Zdd	�Zed
d��ZdS)r�z0
        Representation of a named pipe
        NcCsL||_|jdd�g|_d|_t�d|j�tj|tj|j|jfdd�|_	dS)NT)�firstz listener created with address=%rrr�)
r��_new_handle�
_handle_queuer�r�	sub_debugr�r��_finalize_pipe_listenerrG)r:r3r�rrrr>�s
�zPipeListener.__init__Fc
CsHtjtjB}|r|tjO}t�|j|tjtjBtjBtj	t
t
tjtj�Sr)
rxr�r�r�r�r�r�r�r�ZPIPE_UNLIMITED_INSTANCESr�r�r�)r:r��flagsrrrr��s

��zPipeListener._new_handlec
Cs�|j�|���|j�d�}ztj|dd�}Wn0tk
r^}z|jtjkrN�W5d}~XYnPXz<zt�
|jgdt�}Wn |�
�t�|��YnXW5|�	d�\}}Xt|�S)NrTrvF)r��appendr��poprxr�rCr�Z
ERROR_NO_DATAryr{r|rr}r�ru)r:r;r~r�r�r�resrrrr��s(�
zPipeListener.acceptcCs$t�d|�|D]}t�|�qdS)Nz closing listener with address=%r)rr�rxr�)Zqueuer3r;rrrr��sz$PipeListener._finalize_pipe_listener)N)F)	rqrrrsr�r>r�r��staticmethodr�rrrrr��s

r�c
Cs�t�}z6t�|d�t�|tjtjBdtjtjtjtj�}Wq�t	k
rz}z |j
tjtjfksht
|�rj�W5d}~XYqXq�q�t�|tjdd�t|�S)zU
        Return a connection object connected to the pipe given by `address`
        ��rN)rrxZ
WaitNamedPiper�r�r�r�r�r�rCr�ZERROR_SEM_TIMEOUTZERROR_PIPE_BUSYrr�r�ru)r3r�hr�rrrr��s8
����r��s#CHALLENGE#s	#WELCOME#s	#FAILURE#cCs�ddl}t|t�s$td�t|����t�t�}|�	t
|�|�||t��
�}|�d�}||krl|�	t�n|�	t�td��dS)Nr� Authkey must be bytes, not {0!s}�zdigest received was wrong)�hmacr�rNr%�formatr.r!�urandom�MESSAGE_LENGTHrV�	CHALLENGE�new�HMAC_DIGEST_NAME�digestr^�WELCOME�FAILUREr�Z
connectionr�r��messager�Zresponserrrr��s
�


r�cCsxddl}t|t�s$td�t|����|�d�}|tt�d�}|�	||t
���}|�|�|�d�}|t
krttd��dS)Nrr�r�zdigest sent was rejected)r�r�rNr%r�r.r^rOr�r�r�r�rVr�rr�rrrr��s
�


r�c@s$eZdZdd�Zdd�Zdd�ZdS)�ConnectionWrappercCs6||_||_||_dD]}t||�}t|||�qdS)N)rKrGrjr^rV)�_conn�_dumps�_loadsr��setattr)r:�connrXrd�attrrZrrrr>s
zConnectionWrapper.__init__cCs|�|�}|j�|�dSr)r�r�rV)r:rZr�rrrr[	s
zConnectionWrapper.sendcCs|j��}|�|�Sr)r�r^r�r�rrrrfs
zConnectionWrapper.recvN)rqrrrsr>r[rfrrrrr�sr�cCst�|fdddd��d�S)Nr�utf-8)�	xmlrpclibrX�encode)rZrrr�
_xml_dumpssrcCst�|�d��\\}}|S)Nr)rrd�decode)r�rZ�methodrrr�
_xml_loadssr	c@seZdZdd�ZdS)�XmlListenercCs"ddlmat�|�}t|tt�Sr�)�
xmlrpc.client�clientrrr�r�rr	rYrrrr�s
zXmlListener.acceptN)rqrrrsr�rrrrr
sr
cOsddlmatt||�tt�Sr�)rrrr�rrr	)r��kwdsrrr�	XmlClientsrcCs�t|�}g}|r�t�|d|�}|tkr*q�n\t|krFtt|�krTnn
|t8}n2t|krptt|�kr~nn
|t8}ntd��|�||�||dd�}d}q|S)NFzShould not get hererr)	�listrxr{r
rrOrr�r�)Zhandlesr�L�readyr�rrr�_exhaustive_wait)s 
 
rc
s^|dkrt}n|dkrd}nt|dd�}t|�}i�g}t��t�}�z@|D�]&}zt|d�}	Wn tk
r�|�|��<YqPXzt	�|	�dd�\}}Wn8tk
r�}zd|j}}|tkrƂW5d}~XYnX|t	jkr�|�|�|�|j<qP|�rjt��dd�d	k�rjz|�d
�\}}Wn*tk
�rP}z
|j}W5d}~XYnX|�sjt
|d��rjd|_��|�d}qPt���|�}W5|D]}|���q�|D]�}z|�d�\}}Wn6tk
�r�}z|j}|tk�r�W5d}~XYnX|t	j
k�r��|j}��|�|dk�r�t
|d��r�d|_�q�X���fdd�|D���fd
d�|D�S)��
        Wait till an object in object_list is ready/readable.

        Returns list of those objects in object_list which are ready/readable.
        Nrr�g�?Tr�rK�)�rFc3s|]}�|VqdSrr)�.0r�)�waithandle_to_objrr�	<genexpr>�szwait.<locals>.<genexpr>csg|]}|�kr|�qSrr)r�o)�
ready_objectsrr�
<listcomp>�s�wait.<locals>.<listcomp>)r�intr�setr}ryrCr��
_ready_errorsrxZERROR_OPERATION_ABORTEDr|�addr+r�r��AttributeErrorr6r�rzr�r)Zgetwindowsversionr�keys�update)
�object_listrZov_listZ
ready_handlesr~r�rr�rrKr)rrrr?sh







�PollSelectorc
Cs�t���}|D]}|�|tj�q|dk	r4t��|}|�|�}|r\dd�|D�W5QR�S|dk	r4|t��}|dkr4|W5QR�Sq4W5QRXdS)rNcSsg|]\}}|j�qSr)Zfileobj)r�keyZeventsrrrr�srr)�
_WaitSelector�register�	selectorsZ
EVENT_READrrZselect)r$rZselectorrZZdeadlinerrrrr�s
c
CsZ|��}t�|tjtj��6}ddlm}|�|�}t||j	|j
ffW5QR�SQRXdS)Nr)�resource_sharer)rKr,ZfromfdrZSOCK_STREAMrr*Z	DupSocket�rebuild_connectionr<r=)rr;r�r*�dsrrr�reduce_connection�s

r-cCs|��}t|��||�Sr�r�r�)r,r<r=Zsockrrrr+�sr+cCsB|jrtjnd|jrtjndB}t�|��|�}t||j|jffSr�)	r<rxZFILE_GENERIC_READr=ZFILE_GENERIC_WRITEr
Z	DupHandlerK�rebuild_pipe_connection)rr��dhrrr�reduce_pipe_connection�s
�r1cCs|��}t|||�Sr)r�ru)r0r<r=r;rrrr/�sr/cCs t�|���}t||j|jffSr)r
ZDupFdrKr+r<r=)r�dfrrrr-�scCs|��}t|||�Srr.)r2r<r=�fdrrrr+�s)NN)T)T)N)N)J�__all__r�r!r)r,r�rr �	itertoolsr�rrrr	�contextr
ZForkingPicklerrWrxrrr
r�ImportErrorr*r�ZCONNECTION_TIMEOUTr��countr$r�Zfamiliesr+rrr(r-r4r5rur��objectrrrr�r�r�r�r�r�r�r�r�r�r�rr	r
rrr�ZERROR_NETNAME_DELETEDrrr)r%r'ZSelectSelectorr-r+r(r1r/rrrr�<module>
s�



PT=

,,8	P
multiprocessing/__pycache__/__init__.cpython-38.opt-1.pyc000064400000001230151153537440017335 0ustar00U

e5d��@sdddlZddlmZdd�eej�D�Ze��dd�eD��dZd	Z	d
ej
kr`ej
d
ej
d<dS)�N�)�contextcCsg|]}|�d�s|�qS)�_)�
startswith)�.0�x�r�0/usr/lib64/python3.8/multiprocessing/__init__.py�
<listcomp>s
r
ccs|]}|ttj|�fVqdS)N)�getattrr�_default_context)r�namerrr	�	<genexpr>sr���__main__Z__mp_main__)�sys�r�dirr�__all__�globals�updateZSUBDEBUGZ
SUBWARNING�modulesrrrr	�<module>s
multiprocessing/__pycache__/queues.cpython-38.opt-2.pyc000064400000022157151153537440017121 0ustar00U

e5d�-�@s�dddgZddlZddlZddlZddlZddlZddlZddlZddlm	Z	m
Z
ddlZddlm
Z
ddlmZejjZdd	lmZmZmZmZmZGd
d�de�Ze�ZGdd�de�ZGdd�de�ZdS)
�Queue�SimpleQueue�
JoinableQueue�N)�Empty�Full�)�
connection)�context)�debug�info�Finalize�register_after_fork�
is_exitingc@s�eZdZd*dd�Zdd�Zdd�Zdd	�Zd+dd
�Zd,dd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd d!�Zed"d#��Zed$d%��Zed&d'��Zed(d)��ZdS)-rrcCs�|dkrddlm}||_tjdd�\|_|_|��|_t	�
�|_tj
dkrTd|_n
|��|_|�|�|_d|_|��tj
dkr�t|tj�dS)Nrr)�
SEM_VALUE_MAXF�Zduplex�win32)Zsynchronizer�_maxsizer�Pipe�_reader�_writer�Lock�_rlock�os�getpid�_opid�sys�platform�_wlockZBoundedSemaphore�_sem�
_ignore_epipe�_after_forkr
r��self�maxsize�ctx�r%�./usr/lib64/python3.8/multiprocessing/queues.py�__init__$s




zQueue.__init__cCs.t�|�|j|j|j|j|j|j|j|j	fS�N)
r	�assert_spawningrrrrrrrr�r"r%r%r&�__getstate__9s
�zQueue.__getstate__c	Cs0|\|_|_|_|_|_|_|_|_|��dSr()	rrrrrrrrr �r"�stater%r%r&�__setstate__>s�zQueue.__setstate__cCsbtd�t�t���|_t��|_d|_d|_	d|_
d|_d|_|j
j|_|jj|_|jj|_dS)NzQueue._after_fork()F)r
�	threading�	Conditionr�	_notempty�collections�deque�_buffer�_thread�_jointhread�_joincancelled�_closed�_closer�
send_bytes�_send_bytesr�
recv_bytes�_recv_bytes�poll�_pollr*r%r%r&r Cs


zQueue._after_forkTNc	Csf|jrtd|�d���|j�||�s(t�|j�.|jdkrB|��|j�	|�|j�
�W5QRXdS�NzQueue z
 is closed)r8�
ValueErrorr�acquirerr1r5�
_start_threadr4�append�notify�r"�obj�block�timeoutr%r%r&�putPs
z	Queue.putc	Cs�|jrtd|�d���|rH|dkrH|j�|��}W5QRX|j��nr|rXt��|}|j�||�sjt	�zB|r�|t��}|�
|�s�t	�n|�
�s�t	�|��}|j��W5|j��Xt�|�Sr@)
r8rArr=r�release�time�	monotonicrBrr?�_ForkingPickler�loads)r"rHrI�resZdeadliner%r%r&�get\s*
z	Queue.getcCs|j|jj��Sr()rr�_semlockZ
_get_valuer*r%r%r&�qsizevszQueue.qsizecCs
|��Sr(�r?r*r%r%r&�emptyzszQueue.emptycCs|jj��Sr()rrR�_is_zeror*r%r%r&�full}sz
Queue.fullcCs
|�d�S�NF)rQr*r%r%r&�
get_nowait�szQueue.get_nowaitcCs|�|d�SrX)rJ�r"rGr%r%r&�
put_nowait�szQueue.put_nowaitcCs2d|_z|j��W5|j}|r,d|_|�XdS)NT)r8r9r�close)r"r\r%r%r&r\�szQueue.closecCstd�|jr|��dS)NzQueue.join_thread())r
r6r*r%r%r&�join_thread�szQueue.join_threadcCs6td�d|_z|j��Wntk
r0YnXdS)NzQueue.cancel_join_thread()T)r
r7r6Zcancel�AttributeErrorr*r%r%r&�cancel_join_thread�szQueue.cancel_join_threadc
Cs�td�|j��tjtj|j|j|j|j	|j
j|j|j
|jfdd�|_d|j_td�|j��td�|js�t|jtjt�|j�gdd�|_t|tj|j|jgd	d�|_dS)
NzQueue._start_thread()ZQueueFeederThread)�target�args�nameTzdoing self._thread.start()z... done self._thread.start()���)Zexitpriority�
)r
r4�clearr/ZThreadr�_feedr1r;rrr\r�_on_queue_feeder_errorrr5Zdaemon�startr7r�_finalize_join�weakref�refr6�_finalize_closer9r*r%r%r&rC�s<
��
�
�zQueue._start_threadcCs4td�|�}|dk	r(|��td�ntd�dS)Nzjoining queue threadz... queue thread joinedz... queue thread already dead)r
�join)Ztwr�threadr%r%r&ri�s
zQueue._finalize_joinc	Cs.td�|�|�t�|��W5QRXdS)Nztelling queue thread to quit)r
rD�	_sentinelrE)�buffer�notemptyr%r%r&rl�s
zQueue._finalize_closec
CsXtd�|j}|j}	|j}
|j}t}tjdkr<|j}
|j}nd}
z�|�z|sT|
�W5|	�Xzb|�}||kr�td�|�WWdSt�	|�}|
dkr�||�qb|
�z||�W5|�XqbWnt
k
r�YnXWq@tk
�rP}zV|�rt|dd�t
jk�rWY�6dSt��r.td|�WY�dS|��|||�W5d}~XYq@Xq@dS)Nz$starting thread to feed data to piperz%feeder thread got sentinel -- exiting�errnorzerror in queue thread: %s)r
rBrK�wait�popleftrorrrN�dumps�
IndexError�	Exception�getattrrrZEPIPErr)rprqr:Z	writelockr\Zignore_epipe�onerrorZ	queue_semZnacquireZnreleaseZnwaitZbpopleft�sentinelZwacquireZwreleaserG�er%r%r&rf�sN







zQueue._feedcCsddl}|��dS)Nr)�	traceback�	print_exc)r{rGr|r%r%r&rg
szQueue._on_queue_feeder_error)r)TN)TN)�__name__�
__module__�__qualname__r'r+r.r rJrQrSrUrWrYr[r\r]r_rC�staticmethodrirlrfrgr%r%r%r&r"s.



 
	

=c@s@eZdZddd�Zdd�Zdd�Zdd
d�Zdd
�Zdd�Zd	S)rrcCs*tj|||d�|�d�|_|��|_dS)N)r$r)rr'Z	Semaphore�_unfinished_tasksr0�_condr!r%r%r&r'#szJoinableQueue.__init__cCst�|�|j|jfSr()rr+r�r�r*r%r%r&r+(szJoinableQueue.__getstate__cCs,t�||dd��|dd�\|_|_dS)N���)rr.r�r�r,r%r%r&r.+szJoinableQueue.__setstate__TNc
Cs�|jrtd|�d���|j�||�s(t�|j�J|j�8|jdkrJ|��|j	�
|�|j��|j�
�W5QRXW5QRXdSr@)r8rArrBrr1r�r5rCr4rDr�rKrErFr%r%r&rJ/s

zJoinableQueue.putc	Cs@|j�0|j�d�std��|jj��r2|j��W5QRXdS)NFz!task_done() called too many times)r�r�rBrArRrVZ
notify_allr*r%r%r&�	task_done<s
zJoinableQueue.task_donec	Cs,|j�|jj��s|j��W5QRXdSr()r�r�rRrVrsr*r%r%r&rmCszJoinableQueue.join)r)TN)	r~rr�r'r+r.rJr�rmr%r%r%r&r!s


c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)rcCsHtjdd�\|_|_|��|_|jj|_tj	dkr:d|_
n
|��|_
dS)NFrr)rrrrrrr>r?rrr)r"r$r%r%r&r'Ns


zSimpleQueue.__init__cCs
|��Sr(rTr*r%r%r&rUWszSimpleQueue.emptycCst�|�|j|j|j|jfSr()r	r)rrrrr*r%r%r&r+Zs
zSimpleQueue.__getstate__cCs"|\|_|_|_|_|jj|_dSr()rrrrr>r?r,r%r%r&r.^szSimpleQueue.__setstate__c	Cs&|j�|j��}W5QRXt�|�Sr()rrr<rNrO)r"rPr%r%r&rQbszSimpleQueue.getc	CsDt�|�}|jdkr"|j�|�n|j�|j�|�W5QRXdSr()rNrurrr:rZr%r%r&rJhs


zSimpleQueue.putN)	r~rr�r'rUr+r.rQrJr%r%r%r&rLs	)�__all__rrr/r2rLrjrrZqueuerrZ_multiprocessing�rr	Z	reductionZForkingPicklerrN�utilr
rrr
r�objectrrorrr%r%r%r&�<module>
s$
v
+multiprocessing/__pycache__/util.cpython-38.opt-2.pyc000064400000024570151153537440016570 0ustar00U

e5d~6�@s�ddlZddlZddlZddlZddlZddlZddlmZddlm	Z	ddddd	d
ddd
ddddddgZ
dZdZdZ
dZdZdZdZdadadd�Zdd�Zdd�Zdd�Zdd	�Zd@d d
�Zd!d"�Zd#d$�Ze�Zd%d&�Zd'd�Ze��Z e�!�Z"d(d)�Z#d*d�Z$iZ%e�!�Z&Gd+d�de'�Z(dAd,d-�Z)d.d
�Z*da+eee)e	j,e	j-fd/d0�Z.e�/e.�Gd1d�de'�Z0Gd2d�dej1�Z2ze�3d3�Z4Wne5k
�r�d4Z4YnXd5d�Z6d6d7�Z7d8d9�Z8d:d;�Z9d<d=�Z:d>d?�Z;dS)B�N)�_args_from_interpreter_flags�)�process�	sub_debug�debug�info�sub_warning�
get_logger�
log_to_stderr�get_temp_dir�register_after_fork�
is_exiting�Finalize�ForkAwareThreadLock�ForkAwareLocal�close_all_fds_except�SUBDEBUG�
SUBWARNING��
���multiprocessingz+[%(levelname)s/%(processName)s] %(message)sFcGstrtjt|f|��dS�N)�_logger�logr��msg�args�r�,/usr/lib64/python3.8/multiprocessing/util.pyr,scGstrtjt|f|��dSr)rr�DEBUGrrrr r0scGstrtjt|f|��dSr)rr�INFOrrrr r4scGstrtjt|f|��dSr)rrrrrrr r8scCs|ddl}|��z\tsj|�t�adt_ttd�rFt�	t
�t�t
�n$tj�
t
dif�tj�t
dif�W5|��XtS)Nr�
unregisterr)�loggingZ_acquireLockZ_releaseLockrZ	getLogger�LOGGER_NAMEZ	propagate�hasattr�atexitr#�_exit_function�registerZ
_exithandlers�remove�append)r$rrr r	<s



cCsJddl}t�}|�t�}|��}|�|�|�|�|rB|�|�dat	S)NrT)
r$r	Z	Formatter�DEFAULT_LOGGING_FORMATZ
StreamHandlerZsetFormatterZ
addHandlerZsetLevel�_log_to_stderrr)�levelr$ZloggerZ	formatterZhandlerrrr r
Ws



cCs tjdkrdSttd�rdSdS)NZlinuxTZgetandroidapilevelF)�sys�platformr&rrrr �#_platform_supports_abstract_socketsls


r1cCs@|sdSt|t�r|ddkSt|t�r4|ddkStd��dS)NFr�z(address type of {address!r} unrecognized)�
isinstance�bytes�str�	TypeError)Zaddressrrr �is_abstract_socket_namespacets

r7cCs&||�t��}|dk	r"d|jd<dS)N�tempdir)r�current_process�_config)�rmtreer8r9rrr �_remove_temp_dir�sr<cCsft��j�d�}|dkrbddl}ddl}|jdd�}td|�tdt	|j
|fdd�|t��jd<|S)Nr8rzpymp-)�prefixzcreated temp directory %si����)r�exitpriority)rr9r:�get�shutil�tempfileZmkdtemprrr<r;)r8r@rArrr r�s
�cCsftt���}|��|D]H\\}}}}z||�Wqtk
r^}ztd|�W5d}~XYqXqdS)Nz after forker raised exception %s)�list�_afterfork_registry�items�sort�	Exceptionr)rD�indexZident�func�obj�errr �_run_after_forkers�srKcCs|ttt�t|�|f<dSr)rC�next�_afterfork_counter�id)rIrHrrr r�sc@sBeZdZd
dd�Zdeeejfdd�Zdd�Z	d	d
�Z
dd�ZdS)rrNcCs�|dk	r&t|t�s&td�|t|����|dk	r>t�||�|_n|dkrNtd��||_	||_
|p`i|_|tt
�f|_t��|_|t|j<dS)Nz3Exitpriority ({0!r}) must be None or int, not {1!s}z+Without object, exitpriority cannot be None)r3�intr6�format�type�weakref�ref�_weakref�
ValueError�	_callback�_args�_kwargsrL�_finalizer_counter�_key�os�getpid�_pid�_finalizer_registry)�selfrI�callbackr�kwargsr>rrr �__init__�s"��

zFinalize.__init__cCs�z||j=Wntk
r(|d�YnbX|j|�krD|d�d}n$|d|j|j|j�|j|j|j�}d|_|_|_|_|_|SdS)Nzfinalizer no longer registeredz+finalizer ignored because different processz/finalizer calling %s with args %s and kwargs %s)rZ�KeyErrorr]rVrWrXrT)r_Zwrr^rr\�resrrr �__call__�s$��zFinalize.__call__cCsDzt|j=Wntk
r Yn Xd|_|_|_|_|_dSr)r^rZrcrTrVrWrX�r_rrr �cancel�s��zFinalize.cancelcCs
|jtkSr)rZr^rfrrr �still_active�szFinalize.still_activec	Cs�z|��}Wnttfk
r(d}YnX|dkr>d|jjSd|jjt|jd|j�f}|jrr|dt|j�7}|j	r�|dt|j	�7}|j
ddk	r�|dt|j
d�7}|dS)	Nz<%s object, dead>z<%s object, callback=%s�__name__z, args=z	, kwargs=rz, exitpriority=�>)rT�AttributeErrorr6�	__class__ri�getattrrVrWr5rXrZ)r_rI�xrrr �__repr__�s"
�zFinalize.__repr__)rNN)ri�
__module__�__qualname__rbr^rr[r\rergrhrorrrr r�s
�
c	s�tdkrdS�dkrdd��n�fdd���fdd�tt�D�}|jdd�|D]P}t�|�}|dk	rPtd|�z
|�WqPtk
r�d	dl}|��YqPXqP�dkr�t��dS)
NcSs|ddk	S�Nrr��prrr �<lambda>�z!_run_finalizers.<locals>.<lambda>cs|ddk	o|d�kSrrrrs)�minpriorityrr rurvcsg|]}�|�r|�qSrr)�.0�key)�frr �
<listcomp>#sz#_run_finalizers.<locals>.<listcomp>T)�reversez
calling %sr)	r^rBrEr?rrF�	traceback�	print_exc�clear)rw�keysry�	finalizerr}r)rzrwr �_run_finalizerss$



r�cCstp
tdkSr)�_exitingrrrr r
8scCs�ts�da|d�|d�|d�|�dk	rr|�D] }|jr0|d|j�|j��q0|�D]}|d|j�|��qX|d�|�dS)NTzprocess shutting downz2running all "atexit" finalizers with priority >= 0rz!calling terminate() for daemon %szcalling join() for process %sz)running the remaining "atexit" finalizers)r�Zdaemon�nameZ_popenZ	terminate�join)rrr��active_childrenr9rtrrr r(@s	



r(c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
rcCs|��t|tj�dSr)�_resetrrrfrrr rbqszForkAwareThreadLock.__init__cCs"t��|_|jj|_|jj|_dSr)�	threadingZLock�_lock�acquire�releaserfrrr r�us

zForkAwareThreadLock._resetcCs
|j��Sr)r��	__enter__rfrrr r�zszForkAwareThreadLock.__enter__cGs|jj|�Sr)r��__exit__)r_rrrr r�}szForkAwareThreadLock.__exit__N)rirprqrbr�r�r�rrrr rpsc@seZdZdd�Zdd�ZdS)rcCst|dd��dS)NcSs
|j��Sr)�__dict__r)rIrrr ru�rvz)ForkAwareLocal.__init__.<locals>.<lambda>)rrfrrr rb�szForkAwareLocal.__init__cCst|�dfS)Nr)rQrfrrr �
__reduce__�szForkAwareLocal.__reduce__N)rirprqrbr�rrrr r�s�SC_OPEN_MAX�cCsNt|�dtg}|��tt|�d�D] }t�||d||d�q(dS)N���r)rB�MAXFDrE�range�lenr[�
closerange)�fds�irrr r�sc	Cs�tjdkrdSztj��Wnttfk
r4YnXz@t�tjtj�}zt|dd�t_Wnt�|��YnXWnttfk
r�YnXdS)NF)�closefd)	r/�stdin�close�OSErrorrUr[�open�devnull�O_RDONLY)�fdrrr �_close_stdin�s

r�c	CsTztj��Wnttfk
r&YnXztj��Wnttfk
rNYnXdSr)r/�stdout�flushrkrU�stderrrrrr �_flush_std_streams�sr�cCsxddl}tttt|���}t��\}}z6|�|t�	|�gd|dddddddd||ddd�W�St�|�t�|�XdS)NrTr�F)
�_posixsubprocess�tuple�sorted�maprOr[�piper�Z	fork_exec�fsencode)�pathrZpassfdsr�Zerrpipe_readZ
errpipe_writerrr �spawnv_passfds�s2
�
r�cGs|D]}t�|�qdSr)r[r�)r�r�rrr �	close_fds�sr�cCsZddlm}t��ddlm}|j��ddlm}|j	��t
�|��|��dS)Nr)�support)�
forkserver)�resource_tracker)
Ztestr�rZ_cleanuprr�Z_forkserverZ_stopr�Z_resource_trackerr�Z
gc_collectZ
reap_children)r�r�r�rrr �_cleanup_tests�s

r�)N)N)<r[�	itertoolsr/rRr'r��
subprocessr�r�__all__ZNOTSETrr!r"rr%r,rr-rrrrr	r
r1r7Zabstract_sockets_supportedr<rZWeakValueDictionaryrC�countrMrKrr^rY�objectrr�r
r�r�r9r(r)rZlocalr�sysconfr�rFrr�r�r�r�r�rrrr �<module>
s��

		V
,�
*



multiprocessing/__pycache__/context.cpython-38.opt-2.pyc000064400000026450151153537440017276 0ustar00U

e5d�+�@s�ddlZddlZddlZddlmZddlmZdZGdd�de�ZGdd	�d	e�Z	Gd
d�de�Z
Gdd
�d
e�ZGdd�de�Z
Gdd�dej�ZGdd�de
�Zejdk�rRGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd�de
�ZGdd�de
�ZGdd �d e
�Ze�e�e�d!�Zejd"k�rDeed#�Zneed$�Zn8Gd%d�dej�ZGd&d�de
�Zd#e�iZeed#�Zd'd(�Ze��Zd)d*�Zd+d,�Zd-d.�ZdS)/�N�)�process)�	reduction�c@seZdZdS)�ProcessErrorN��__name__�
__module__�__qualname__rrr�//usr/lib64/python3.8/multiprocessing/context.pyrsrc@seZdZdS)�BufferTooShortNrrrrrrsrc@seZdZdS)�TimeoutErrorNrrrrrr
sr
c@seZdZdS)�AuthenticationErrorNrrrrrrsrc@sXeZdZeZeZeZeZeej	�Z	eej
�Z
eej�Zdd�Zdd�Z
dCdd�Zdd	�Zd
d�ZdDd
d�ZdEdd�ZdFdd�Zdd�ZdGdd�ZdHdd�ZdIdd�Zdd�ZdJd d!�Zd"d#�Zd$d%�Zdd&�d'd(�Zdd&�d)d*�Zd+d,�Zd-d.�ZdKd/d0�Z d1d2�Z!d3d4�Z"d5d6�Z#dLd7d8�Z$dMd:d;�Z%dNd<d=�Z&e'd>d?��Z(e(j)d@d?��Z(dAdB�Z*dS)O�BaseContextcCs"t��}|dkrtd��n|SdS)Nzcannot determine number of cpus)�os�	cpu_count�NotImplementedError)�selfZnumrrrr)s
zBaseContext.cpu_countcCs&ddlm}||��d�}|��|S)Nr)�SyncManager��ctx)Zmanagersr�get_context�start)rr�mrrr�Manager1szBaseContext.ManagerTcCsddlm}||�S)Nr)�Pipe)�
connectionr)rZduplexrrrrr<szBaseContext.PipecCsddlm}||��d�S)Nr)�Lockr)�synchronizerr)rrrrrrAszBaseContext.LockcCsddlm}||��d�S)Nr)�RLockr)rrr)rrrrrrFszBaseContext.RLockNcCsddlm}|||��d�S)Nr)�	Conditionr)rr r)r�lockr rrrr KszBaseContext.ConditionrcCsddlm}|||��d�S)Nr)�	Semaphorer)rr"r)r�valuer"rrrr"PszBaseContext.SemaphorecCsddlm}|||��d�S)Nr)�BoundedSemaphorer)rr$r)rr#r$rrrr$UszBaseContext.BoundedSemaphorecCsddlm}||��d�S)Nr)�Eventr)rr%r)rr%rrrr%ZszBaseContext.EventcCs ddlm}|||||��d�S)Nr)�Barrierr)rr&r)rZparties�actionZtimeoutr&rrrr&_szBaseContext.BarrierrcCsddlm}|||��d�S)Nr)�Queuer)�queuesr(r)r�maxsizer(rrrr(dszBaseContext.QueuecCsddlm}|||��d�S)Nr)�
JoinableQueuer)r)r+r)rr*r+rrrr+iszBaseContext.JoinableQueuecCsddlm}||��d�S)Nr)�SimpleQueuer)r)r,r)rr,rrrr,nszBaseContext.SimpleQueuercCs"ddlm}||||||��d�S)Nr)�Pool)�context)Zpoolr-r)rZ	processesZinitializerZinitargsZmaxtasksperchildr-rrrr-ss
�zBaseContext.PoolcGsddlm}||f|��S)Nr)�RawValue)�sharedctypesr/)r�typecode_or_type�argsr/rrrr/zszBaseContext.RawValuecCsddlm}|||�S)Nr)�RawArray)r0r3)rr1�size_or_initializerr3rrrr3szBaseContext.RawArray)r!cGs&ddlm}||f|�||��d��S)Nr)�Value�r!r)r0r5r)rr1r!r2r5rrrr5�s�zBaseContext.ValuecCs ddlm}|||||��d�S)Nr)�Arrayr6)r0r7r)rr1r4r!r7rrrr7�s�zBaseContext.ArraycCs,tjdkr(ttdd�r(ddlm}|�dS)N�win32�frozenFr)�freeze_support)�sys�platform�getattr�spawnr:)rr:rrrr:�szBaseContext.freeze_supportcCsddlm}|�S)Nr)�
get_logger)�utilr?)rr?rrrr?�szBaseContext.get_loggercCsddlm}||�S)Nr)�
log_to_stderr)r@rA)r�levelrArrrrA�szBaseContext.log_to_stderrcCsddlm}dS)Nr)r)�r)rrrrr�allow_connection_pickling�sz%BaseContext.allow_connection_picklingcCsddlm}||�dS)Nr)�set_executable)r>rE)r�
executablerErrrrE�szBaseContext.set_executablecCsddlm}||�dS)Nr)�set_forkserver_preload)�
forkserverrG)rZmodule_namesrGrrrrG�sz"BaseContext.set_forkserver_preloadcCsH|dkr|Szt|}Wn"tk
r:td|�d�YnX|��|S)Nzcannot find context for %r)�_concrete_contexts�KeyError�
ValueError�_check_available)r�methodrrrrr�szBaseContext.get_contextFcCs|jS�N)�_name�rZ
allow_nonerrr�get_start_method�szBaseContext.get_start_methodcCstd��dS)Nz+cannot set start method of concrete context)rK�rrMZforcerrr�set_start_method�szBaseContext.set_start_methodcCst��d�S�Nr)�globals�get�rrrr�reducer�szBaseContext.reducercCs|t�d<dSrT)rU)rrrrrrX�scCsdSrNrrWrrrrL�szBaseContext._check_available)T)N)r)r)NN)r)r)NNrN)N)N)F)F)+rr	r
rrr
r�staticmethodrZcurrent_processZparent_processZactive_childrenrrrrrr r"r$r%r&r(r+r,r-r/r3r5r7r:r?rArDrErGrrQrS�propertyrX�setterrLrrrrrsR









�







rc@seZdZdZedd��ZdS)�ProcessNcCst��j�|�SrN)�_default_contextrr\�_Popen)�process_objrrrr^�szProcess._Popen�rr	r
Z
_start_methodrYr^rrrrr\�sr\csFeZdZeZdd�Zd
�fdd�	Zddd�Zdd	d
�Zdd�Z�Z	S)�DefaultContextcCs||_d|_dSrN)r]�_actual_context)rr.rrr�__init__�szDefaultContext.__init__Ncs0|dkr |jdkr|j|_|jSt��|�SdSrN)rbr]�superr)rrM��	__class__rrr�s

zDefaultContext.get_contextFcCs<|jdk	r|std��|dkr,|r,d|_dS|�|�|_dS)Nzcontext has already been set)rb�RuntimeErrorrrRrrrrS�szDefaultContext.set_start_methodcCs"|jdkr|rdS|j|_|jjSrN)rbr]rOrPrrrrQ�s

zDefaultContext.get_start_methodcCsBtjdkrdgStjdkr"ddgnddg}tjr:|�d�|SdS)Nr8r>�darwin�forkrH)r;r<r�HAVE_SEND_HANDLE�append)r�methodsrrr�get_all_start_methodss

z$DefaultContext.get_all_start_methods)N)F)F)
rr	r
r\rcrrSrQrm�
__classcell__rrrerra�s

rar8c@seZdZdZedd��ZdS)�ForkProcessricCsddlm}||�S�Nr)�Popen)Z
popen_forkrq�r_rqrrrr^szForkProcess._PopenNr`rrrrrosroc@seZdZdZedd��ZdS)�SpawnProcessr>cCsddlm}||�Srp)Zpopen_spawn_posixrqrrrrrr^s�SpawnProcess._PopenNr`rrrrrssrsc@seZdZdZedd��ZdS)�ForkServerProcessrHcCsddlm}||�Srp)Zpopen_forkserverrqrrrrrr^ szForkServerProcess._PopenNr`rrrrrusruc@seZdZdZeZdS)�ForkContextriN)rr	r
rOror\rrrrrv%srvc@seZdZdZeZdS��SpawnContextr>N�rr	r
rOrsr\rrrrrx)srxc@seZdZdZeZdd�ZdS)�ForkServerContextrHcCstjstd��dS)Nz%forkserver start method not available)rrjrKrWrrrrL0sz"ForkServerContext._check_availableN)rr	r
rOrur\rLrrrrrz-srz)rir>rHrhr>ric@seZdZdZedd��ZdS)rsr>cCsddlm}||�Srp)Zpopen_spawn_win32rqrrrrrr^DsrtNr`rrrrrsBsc@seZdZdZeZdSrwryrrrrrxIscCst|t_dSrN)rIr]rb)rMrrr�_force_start_methodVsr{cCsttdd�S)N�spawning_popen)r=�_tlsrrrr�get_spawning_popen_sr~cCs
|t_dSrN)r}r|)�popenrrr�set_spawning_popenbsr�cCs t�dkrtdt|�j��dS)NzF%s objects should only be shared between processes through inheritance)r~rg�typer)�objrrr�assert_spawninges
��r�) rr;Z	threadingrCrr�__all__�	Exceptionrrr
r�objectrZBaseProcessr\rar<rorsrurvrxrzrIr]r{Zlocalr}r~r�r�rrrr�<module>sL?,��multiprocessing/__pycache__/sharedctypes.cpython-38.opt-1.pyc000064400000015512151153537440020304 0ustar00U

e5d��@sBddlZddlZddlmZddlmZddlmZmZejZ	dddd	d
dgZ
ejejej
ejejejejejejejejejejejd�Zd
d�Zdd�Zdd�Zddd�dd�Zddd�dd	�Zdd
�Zd&dd�Z dd�Z!dd�Z"dd�Z#dZ$iZ%e�&�Z'Gdd�de(�Z)Gd d!�d!e)�Z*Gd"d#�d#e)�Z+Gd$d%�d%e+�Z,dS)'�N�)�heap)�get_context)�	reduction�assert_spawning�RawValue�RawArray�Value�Array�copy�synchronized)�c�u�b�B�h�H�i�I�l�L�q�Q�f�dcCs t�|�}t�|�}t||d�S�N)�ctypes�sizeofrZ
BufferWrapper�
rebuild_ctype)�type_�size�wrapper�r"�4/usr/lib64/python3.8/multiprocessing/sharedctypes.py�
_new_value's

r$cGs<t�||�}t|�}t�t�|�dt�|��|j|�|S)z>
    Returns a ctypes object allocated from shared memory
    r)�typecode_to_type�getr$r�memset�	addressofr�__init__)�typecode_or_type�argsr�objr"r"r#r,s

cCsjt�||�}t|t�rD||}t|�}t�t�|�dt�|��|S|t	|�}t|�}|j
|�|SdS)z=
    Returns a ctypes array allocated from shared memory
    rN)r%r&�
isinstance�intr$rr'r(r�lenr))r*�size_or_initializerrr,�resultr"r"r#r6s

T)�lock�ctxcGsXt|f|��}|dkr|S|dkr4|p*t�}|��}t|d�sJtd|��t|||d�S)z6
    Return a synchronization wrapper for a Value
    F�TN�acquire�%r has no method 'acquire'�r3)rr�RLock�hasattr�AttributeErrorr)r*r2r3r+r,r"r"r#r	Fs

cCsTt||�}|dkr|S|dkr0|p&t�}|��}t|d�sFtd|��t|||d�S)z9
    Return a synchronization wrapper for a RawArray
    Fr4r5r6r7)rrr8r9r:r)r*r0r2r3r,r"r"r#r
Ts


cCstt|��}|t�|�d<|S)Nr)r$�typerZpointer)r,Znew_objr"r"r#rbscCs�|pt�}t|tj�r"t|||�St|tj�rR|jtjkrFt|||�St	|||�St
|�}zt|}WnRtk
r�dd�|j
D�}dd�|D�}d|j}t
|tf|�}t|<YnX||||�SdS)NcSsg|]}|d�qS)rr")�.0Zfieldr"r"r#�
<listcomp>vsz synchronized.<locals>.<listcomp>cSsi|]}|t|��qSr")�
make_property)r<�namer"r"r#�
<dictcomp>wsz synchronized.<locals>.<dictcomp>�Synchronized)rr-rZ_SimpleCDatarAr
�_type_�c_char�SynchronizedString�SynchronizedArrayr;�class_cache�KeyErrorZ_fields_�__name__�SynchronizedBase)r,r2r3�clsZscls�namesrZ	classnamer"r"r#rgs 

cCs@t|�t|tj�r(t|j|j|jffStt|�|jdffSdSr)	rr-rr
rrB�_wrapperZ_length_r;)r,r"r"r#�reduce_ctype�srMcCs8|dk	r||}t�|t�|��}|�|�}||_|Sr)�_ForkingPickler�registerrMZcreate_memoryviewZfrom_bufferrL)rr!ZlengthZbufr,r"r"r#r�s
rcCsPz
t|WStk
rJi}tt|fd|�||t|<||YSXdS)N�)�
prop_cacherG�exec�template)r?rr"r"r#r>�s
r>z�
def get%s(self):
    self.acquire()
    try:
        return self._obj.%s
    finally:
        self.release()
def set%s(self, value):
    self.acquire()
    try:
        self._obj.%s = value
    finally:
        self.release()
%s = property(get%s, set%s)
c@sFeZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dS)rINcCsB||_|r||_n|ptdd�}|��|_|jj|_|jj|_dS)NT)Zforce)�_obj�_lockrr8r5�release)�selfr,r2r3r"r"r#r)�s

zSynchronizedBase.__init__cCs
|j��Sr)rU�	__enter__�rWr"r"r#rX�szSynchronizedBase.__enter__cGs|jj|�Sr)rU�__exit__)rWr+r"r"r#rZ�szSynchronizedBase.__exit__cCst|�t|j|jffSr)rrrTrUrYr"r"r#�
__reduce__�szSynchronizedBase.__reduce__cCs|jSr�rTrYr"r"r#�get_obj�szSynchronizedBase.get_objcCs|jSr)rUrYr"r"r#�get_lock�szSynchronizedBase.get_lockcCsdt|�j|jfS)Nz<%s wrapper for %s>)r;rHrTrYr"r"r#�__repr__�szSynchronizedBase.__repr__)NN)
rH�
__module__�__qualname__r)rXrZr[r]r^r_r"r"r"r#rI�s

rIc@seZdZed�ZdS)rA�valueN)rHr`rar>rbr"r"r"r#rA�srAc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)rEcCs
t|j�Sr)r/rTrYr"r"r#�__len__�szSynchronizedArray.__len__c
Cs&|�|j|W5QR�SQRXdSrr\)rWrr"r"r#�__getitem__�szSynchronizedArray.__getitem__c	Cs|�||j|<W5QRXdSrr\)rWrrbr"r"r#�__setitem__�szSynchronizedArray.__setitem__c
Cs*|�|j||�W5QR�SQRXdSrr\)rW�start�stopr"r"r#�__getslice__�szSynchronizedArray.__getslice__c	Cs"|�||j||�<W5QRXdSrr\)rWrfrg�valuesr"r"r#�__setslice__�szSynchronizedArray.__setslice__N)rHr`rarcrdrerhrjr"r"r"r#rE�s
rEc@seZdZed�Zed�ZdS)rDrb�rawN)rHr`rar>rbrkr"r"r"r#rD�srD)NN)-r�weakref�rr�contextrrZForkingPicklerrN�__all__rCZc_wcharZc_byteZc_ubyteZc_shortZc_ushortZc_intZc_uintZc_longZc_ulongZ
c_longlongZc_ulonglongZc_floatZc_doubler%r$rrr	r
rrrMrr>rSrQ�WeakKeyDictionaryrF�objectrIrArErDr"r"r"r#�<module>
sL�


	 multiprocessing/__pycache__/popen_forkserver.cpython-38.opt-2.pyc000064400000004563151153537440021204 0ustar00U

e5d��@s�ddlZddlZddlmZmZejs.ed��ddlmZddlm	Z	ddlm
Z
ddlmZd	gZGd
d�de
�ZGdd	�d	e	j�ZdS)
�N�)�	reduction�set_spawning_popenz,No support for sending fds between processes)�
forkserver)�
popen_fork)�spawn)�util�Popenc@seZdZdd�Zdd�ZdS)�_DupFdcCs
||_dS�N)�ind)�selfr�r�8/usr/lib64/python3.8/multiprocessing/popen_forkserver.py�__init__sz_DupFd.__init__cCst��|jSr)rZget_inherited_fdsr)r
rrr�detachsz
_DupFd.detachN)�__name__�
__module__�__qualname__rrrrrrr
sr
csBeZdZdZeZ�fdd�Zdd�Zdd�Ze	j
fdd	�Z�ZS)
r	rcsg|_t��|�dSr)�_fds�superr)r
�process_obj��	__class__rrr!szPopen.__init__cCs|j�|�t|j�dS)Nr)r�append�len)r
�fdrrr�duplicate_for_child%szPopen.duplicate_for_childc	Cs�t�|j�}t��}t|�zt�||�t�||�W5td�Xt�	|j
�\|_}t�
|�}t�|tj||jf�|_t|ddd��}|�|���W5QRXt�|j�|_dS)N�wbT)�closefd)rZget_preparation_data�_name�io�BytesIOrr�dumprZconnect_to_new_processr�sentinel�os�duprZFinalizeZ	close_fds�	finalizer�open�write�	getbuffer�read_signed�pid)r
rZ	prep_dataZbuf�wZ	_parent_w�frrr�_launch)s


�z
Popen._launchc	Csr|jdkrlddlm}|tjkr$dnd}||jg|�s:dSzt�|j�|_Wntt	fk
rjd|_YnX|jS)Nr)�wait�)
�
returncodeZmultiprocessing.connectionr0r%�WNOHANGr$rr+�OSError�EOFError)r
�flagr0Ztimeoutrrr�poll=s
z
Popen.poll)
rrr�methodr
ZDupFdrrr/r%r3r7�
__classcell__rrrrr	s)r!r%�contextrrZHAVE_SEND_HANDLE�ImportError�rrrr�__all__�objectr
r	rrrr�<module>s
multiprocessing/__pycache__/context.cpython-38.opt-1.pyc000064400000031334151153537440017272 0ustar00U

e5d�+�@s�ddlZddlZddlZddlmZddlmZdZGdd�de�ZGdd	�d	e�Z	Gd
d�de�Z
Gdd
�d
e�ZGdd�de�Z
Gdd�dej�ZGdd�de
�Zejdk�rRGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd�de
�ZGdd�de
�ZGdd �d e
�Ze�e�e�d!�Zejd"k�rDeed#�Zneed$�Zn8Gd%d�dej�ZGd&d�de
�Zd#e�iZeed#�Zd'd(�Ze��Zd)d*�Zd+d,�Zd-d.�ZdS)/�N�)�process)�	reduction�c@seZdZdS)�ProcessErrorN��__name__�
__module__�__qualname__rrr�//usr/lib64/python3.8/multiprocessing/context.pyrsrc@seZdZdS)�BufferTooShortNrrrrrrsrc@seZdZdS)�TimeoutErrorNrrrrrr
sr
c@seZdZdS)�AuthenticationErrorNrrrrrrsrc@sXeZdZeZeZeZeZeej	�Z	eej
�Z
eej�Zdd�Zdd�Z
dCdd�Zdd	�Zd
d�ZdDd
d�ZdEdd�ZdFdd�Zdd�ZdGdd�ZdHdd�ZdIdd�Zdd�ZdJd d!�Zd"d#�Zd$d%�Zdd&�d'd(�Zdd&�d)d*�Zd+d,�Zd-d.�ZdKd/d0�Z d1d2�Z!d3d4�Z"d5d6�Z#dLd7d8�Z$dMd:d;�Z%dNd<d=�Z&e'd>d?��Z(e(j)d@d?��Z(dAdB�Z*dS)O�BaseContextcCs"t��}|dkrtd��n|SdS)z(Returns the number of CPUs in the systemNzcannot determine number of cpus)�os�	cpu_count�NotImplementedError)�selfZnumrrrr)s
zBaseContext.cpu_countcCs&ddlm}||��d�}|��|S)z�Returns a manager associated with a running server process

        The managers methods such as `Lock()`, `Condition()` and `Queue()`
        can be used to create shared objects.
        r)�SyncManager��ctx)Zmanagersr�get_context�start)rr�mrrr�Manager1szBaseContext.ManagerTcCsddlm}||�S)z1Returns two connection object connected by a piper)�Pipe)�
connectionr)rZduplexrrrrr<szBaseContext.PipecCsddlm}||��d�S)z#Returns a non-recursive lock objectr)�Lockr)�synchronizerr)rrrrrrAszBaseContext.LockcCsddlm}||��d�S)zReturns a recursive lock objectr)�RLockr)rrr)rrrrrrFszBaseContext.RLockNcCsddlm}|||��d�S)zReturns a condition objectr)�	Conditionr)rr r)r�lockr rrrr KszBaseContext.ConditionrcCsddlm}|||��d�S)zReturns a semaphore objectr)�	Semaphorer)rr"r)r�valuer"rrrr"PszBaseContext.SemaphorecCsddlm}|||��d�S)z"Returns a bounded semaphore objectr)�BoundedSemaphorer)rr$r)rr#r$rrrr$UszBaseContext.BoundedSemaphorecCsddlm}||��d�S)zReturns an event objectr)�Eventr)rr%r)rr%rrrr%ZszBaseContext.EventcCs ddlm}|||||��d�S)zReturns a barrier objectr)�Barrierr)rr&r)rZparties�actionZtimeoutr&rrrr&_szBaseContext.BarrierrcCsddlm}|||��d�S)�Returns a queue objectr)�Queuer)�queuesr)r)r�maxsizer)rrrr)dszBaseContext.QueuecCsddlm}|||��d�S)r(r)�
JoinableQueuer)r*r,r)rr+r,rrrr,iszBaseContext.JoinableQueuecCsddlm}||��d�S)r(r)�SimpleQueuer)r*r-r)rr-rrrr-nszBaseContext.SimpleQueuercCs"ddlm}||||||��d�S)zReturns a process pool objectr)�Pool)�context)Zpoolr.r)rZ	processesZinitializerZinitargsZmaxtasksperchildr.rrrr.ss
�zBaseContext.PoolcGsddlm}||f|��S)zReturns a shared objectr)�RawValue)�sharedctypesr0)r�typecode_or_type�argsr0rrrr0zszBaseContext.RawValuecCsddlm}|||�S)zReturns a shared arrayr)�RawArray)r1r4)rr2�size_or_initializerr4rrrr4szBaseContext.RawArray)r!cGs&ddlm}||f|�||��d��S)z$Returns a synchronized shared objectr)�Value�r!r)r1r6r)rr2r!r3r6rrrr6�s�zBaseContext.ValuecCs ddlm}|||||��d�S)z#Returns a synchronized shared arrayr)�Arrayr7)r1r8r)rr2r5r!r8rrrr8�s�zBaseContext.ArraycCs,tjdkr(ttdd�r(ddlm}|�dS)z�Check whether this is a fake forked process in a frozen executable.
        If so then run code specified by commandline and exit.
        �win32�frozenFr)�freeze_supportN)�sys�platform�getattr�spawnr;)rr;rrrr;�szBaseContext.freeze_supportcCsddlm}|�S)zZReturn package logger -- if it does not already exist then
        it is created.
        r)�
get_logger)�utilr@)rr@rrrr@�szBaseContext.get_loggercCsddlm}||�S)z8Turn on logging and add a handler which prints to stderrr)�
log_to_stderr)rArB)r�levelrBrrrrB�szBaseContext.log_to_stderrcCsddlm}dS)zVInstall support for sending connections and sockets
        between processes
        r)rN)�r)rrrrr�allow_connection_pickling�sz%BaseContext.allow_connection_picklingcCsddlm}||�dS)z�Sets the path to a python.exe or pythonw.exe binary used to run
        child processes instead of sys.executable when using the 'spawn'
        start method.  Useful for people embedding Python.
        r)�set_executableN)r?rF)r�
executablerFrrrrF�szBaseContext.set_executablecCsddlm}||�dS)zkSet list of module names to try to load in forkserver process.
        This is really just a hint.
        r)�set_forkserver_preloadN)�
forkserverrH)rZmodule_namesrHrrrrH�sz"BaseContext.set_forkserver_preloadcCsH|dkr|Szt|}Wn"tk
r:td|�d�YnX|��|S)Nzcannot find context for %r)�_concrete_contexts�KeyError�
ValueError�_check_available)r�methodrrrrr�szBaseContext.get_contextFcCs|jS�N)�_name�rZ
allow_nonerrr�get_start_method�szBaseContext.get_start_methodcCstd��dS)Nz+cannot set start method of concrete context)rL�rrNZforcerrr�set_start_method�szBaseContext.set_start_methodcCst��d�S)z_Controls how objects will be reduced to a form that can be
        shared with other processes.r)�globals�get�rrrr�reducer�szBaseContext.reducercCs|t�d<dS)Nr)rU)rrrrrrX�scCsdSrOrrWrrrrM�szBaseContext._check_available)T)N)r)r)NN)r)r)NNrN)N)N)F)F)+rr	r
rrr
r�staticmethodrZcurrent_processZparent_processZactive_childrenrrrrrr r"r$r%r&r)r,r-r.r0r4r6r8r;r@rBrErFrHrrRrT�propertyrX�setterrMrrrrrsR









�







rc@seZdZdZedd��ZdS)�ProcessNcCst��j�|�SrO)�_default_contextrr\�_Popen)�process_objrrrr^�szProcess._Popen�rr	r
Z
_start_methodrYr^rrrrr\�sr\csFeZdZeZdd�Zd
�fdd�	Zddd�Zdd	d
�Zdd�Z�Z	S)�DefaultContextcCs||_d|_dSrO)r]�_actual_context)rr/rrr�__init__�szDefaultContext.__init__Ncs0|dkr |jdkr|j|_|jSt��|�SdSrO)rbr]�superr)rrN��	__class__rrr�s

zDefaultContext.get_contextFcCs<|jdk	r|std��|dkr,|r,d|_dS|�|�|_dS)Nzcontext has already been set)rb�RuntimeErrorrrSrrrrT�szDefaultContext.set_start_methodcCs"|jdkr|rdS|j|_|jjSrO)rbr]rPrQrrrrR�s

zDefaultContext.get_start_methodcCsBtjdkrdgStjdkr"ddgnddg}tjr:|�d�|SdS)Nr9r?�darwin�forkrI)r<r=r�HAVE_SEND_HANDLE�append)r�methodsrrr�get_all_start_methodss

z$DefaultContext.get_all_start_methods)N)F)F)
rr	r
r\rcrrTrRrm�
__classcell__rrrerra�s

rar9c@seZdZdZedd��ZdS)�ForkProcessricCsddlm}||�S�Nr)�Popen)Z
popen_forkrq�r_rqrrrr^szForkProcess._PopenNr`rrrrrosroc@seZdZdZedd��ZdS)�SpawnProcessr?cCsddlm}||�Srp)Zpopen_spawn_posixrqrrrrrr^s�SpawnProcess._PopenNr`rrrrrssrsc@seZdZdZedd��ZdS)�ForkServerProcessrIcCsddlm}||�Srp)Zpopen_forkserverrqrrrrrr^ szForkServerProcess._PopenNr`rrrrrusruc@seZdZdZeZdS)�ForkContextriN)rr	r
rPror\rrrrrv%srvc@seZdZdZeZdS��SpawnContextr?N�rr	r
rPrsr\rrrrrx)srxc@seZdZdZeZdd�ZdS)�ForkServerContextrIcCstjstd��dS)Nz%forkserver start method not available)rrjrLrWrrrrM0sz"ForkServerContext._check_availableN)rr	r
rPrur\rMrrrrrz-srz)rir?rIrhr?ric@seZdZdZedd��ZdS)rsr?cCsddlm}||�Srp)Zpopen_spawn_win32rqrrrrrr^DsrtNr`rrrrrsBsc@seZdZdZeZdSrwryrrrrrxIscCst|t_dSrO)rJr]rb)rNrrr�_force_start_methodVsr{cCsttdd�S)N�spawning_popen)r>�_tlsrrrr�get_spawning_popen_sr~cCs
|t_dSrO)r}r|)�popenrrr�set_spawning_popenbsr�cCs t�dkrtdt|�j��dS)NzF%s objects should only be shared between processes through inheritance)r~rg�typer)�objrrr�assert_spawninges
��r�) rr<Z	threadingrDrr�__all__�	Exceptionrrr
r�objectrZBaseProcessr\rar=rorsrurvrxrzrJr]r{Zlocalr}r~r�r�rrrr�<module>sL?,��multiprocessing/__pycache__/context.cpython-38.pyc000064400000031334151153537440016333 0ustar00U

e5d�+�@s�ddlZddlZddlZddlmZddlmZdZGdd�de�ZGdd	�d	e�Z	Gd
d�de�Z
Gdd
�d
e�ZGdd�de�Z
Gdd�dej�ZGdd�de
�Zejdk�rRGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd�de
�ZGdd�de
�ZGdd �d e
�Ze�e�e�d!�Zejd"k�rDeed#�Zneed$�Zn8Gd%d�dej�ZGd&d�de
�Zd#e�iZeed#�Zd'd(�Ze��Zd)d*�Zd+d,�Zd-d.�ZdS)/�N�)�process)�	reduction�c@seZdZdS)�ProcessErrorN��__name__�
__module__�__qualname__rrr�//usr/lib64/python3.8/multiprocessing/context.pyrsrc@seZdZdS)�BufferTooShortNrrrrrrsrc@seZdZdS)�TimeoutErrorNrrrrrr
sr
c@seZdZdS)�AuthenticationErrorNrrrrrrsrc@sXeZdZeZeZeZeZeej	�Z	eej
�Z
eej�Zdd�Zdd�Z
dCdd�Zdd	�Zd
d�ZdDd
d�ZdEdd�ZdFdd�Zdd�ZdGdd�ZdHdd�ZdIdd�Zdd�ZdJd d!�Zd"d#�Zd$d%�Zdd&�d'd(�Zdd&�d)d*�Zd+d,�Zd-d.�ZdKd/d0�Z d1d2�Z!d3d4�Z"d5d6�Z#dLd7d8�Z$dMd:d;�Z%dNd<d=�Z&e'd>d?��Z(e(j)d@d?��Z(dAdB�Z*dS)O�BaseContextcCs"t��}|dkrtd��n|SdS)z(Returns the number of CPUs in the systemNzcannot determine number of cpus)�os�	cpu_count�NotImplementedError)�selfZnumrrrr)s
zBaseContext.cpu_countcCs&ddlm}||��d�}|��|S)z�Returns a manager associated with a running server process

        The managers methods such as `Lock()`, `Condition()` and `Queue()`
        can be used to create shared objects.
        r)�SyncManager��ctx)Zmanagersr�get_context�start)rr�mrrr�Manager1szBaseContext.ManagerTcCsddlm}||�S)z1Returns two connection object connected by a piper)�Pipe)�
connectionr)rZduplexrrrrr<szBaseContext.PipecCsddlm}||��d�S)z#Returns a non-recursive lock objectr)�Lockr)�synchronizerr)rrrrrrAszBaseContext.LockcCsddlm}||��d�S)zReturns a recursive lock objectr)�RLockr)rrr)rrrrrrFszBaseContext.RLockNcCsddlm}|||��d�S)zReturns a condition objectr)�	Conditionr)rr r)r�lockr rrrr KszBaseContext.ConditionrcCsddlm}|||��d�S)zReturns a semaphore objectr)�	Semaphorer)rr"r)r�valuer"rrrr"PszBaseContext.SemaphorecCsddlm}|||��d�S)z"Returns a bounded semaphore objectr)�BoundedSemaphorer)rr$r)rr#r$rrrr$UszBaseContext.BoundedSemaphorecCsddlm}||��d�S)zReturns an event objectr)�Eventr)rr%r)rr%rrrr%ZszBaseContext.EventcCs ddlm}|||||��d�S)zReturns a barrier objectr)�Barrierr)rr&r)rZparties�actionZtimeoutr&rrrr&_szBaseContext.BarrierrcCsddlm}|||��d�S)�Returns a queue objectr)�Queuer)�queuesr)r)r�maxsizer)rrrr)dszBaseContext.QueuecCsddlm}|||��d�S)r(r)�
JoinableQueuer)r*r,r)rr+r,rrrr,iszBaseContext.JoinableQueuecCsddlm}||��d�S)r(r)�SimpleQueuer)r*r-r)rr-rrrr-nszBaseContext.SimpleQueuercCs"ddlm}||||||��d�S)zReturns a process pool objectr)�Pool)�context)Zpoolr.r)rZ	processesZinitializerZinitargsZmaxtasksperchildr.rrrr.ss
�zBaseContext.PoolcGsddlm}||f|��S)zReturns a shared objectr)�RawValue)�sharedctypesr0)r�typecode_or_type�argsr0rrrr0zszBaseContext.RawValuecCsddlm}|||�S)zReturns a shared arrayr)�RawArray)r1r4)rr2�size_or_initializerr4rrrr4szBaseContext.RawArray)r!cGs&ddlm}||f|�||��d��S)z$Returns a synchronized shared objectr)�Value�r!r)r1r6r)rr2r!r3r6rrrr6�s�zBaseContext.ValuecCs ddlm}|||||��d�S)z#Returns a synchronized shared arrayr)�Arrayr7)r1r8r)rr2r5r!r8rrrr8�s�zBaseContext.ArraycCs,tjdkr(ttdd�r(ddlm}|�dS)z�Check whether this is a fake forked process in a frozen executable.
        If so then run code specified by commandline and exit.
        �win32�frozenFr)�freeze_supportN)�sys�platform�getattr�spawnr;)rr;rrrr;�szBaseContext.freeze_supportcCsddlm}|�S)zZReturn package logger -- if it does not already exist then
        it is created.
        r)�
get_logger)�utilr@)rr@rrrr@�szBaseContext.get_loggercCsddlm}||�S)z8Turn on logging and add a handler which prints to stderrr)�
log_to_stderr)rArB)r�levelrBrrrrB�szBaseContext.log_to_stderrcCsddlm}dS)zVInstall support for sending connections and sockets
        between processes
        r)rN)�r)rrrrr�allow_connection_pickling�sz%BaseContext.allow_connection_picklingcCsddlm}||�dS)z�Sets the path to a python.exe or pythonw.exe binary used to run
        child processes instead of sys.executable when using the 'spawn'
        start method.  Useful for people embedding Python.
        r)�set_executableN)r?rF)r�
executablerFrrrrF�szBaseContext.set_executablecCsddlm}||�dS)zkSet list of module names to try to load in forkserver process.
        This is really just a hint.
        r)�set_forkserver_preloadN)�
forkserverrH)rZmodule_namesrHrrrrH�sz"BaseContext.set_forkserver_preloadcCsH|dkr|Szt|}Wn"tk
r:td|�d�YnX|��|S)Nzcannot find context for %r)�_concrete_contexts�KeyError�
ValueError�_check_available)r�methodrrrrr�szBaseContext.get_contextFcCs|jS�N)�_name�rZ
allow_nonerrr�get_start_method�szBaseContext.get_start_methodcCstd��dS)Nz+cannot set start method of concrete context)rL�rrNZforcerrr�set_start_method�szBaseContext.set_start_methodcCst��d�S)z_Controls how objects will be reduced to a form that can be
        shared with other processes.r)�globals�get�rrrr�reducer�szBaseContext.reducercCs|t�d<dS)Nr)rU)rrrrrrX�scCsdSrOrrWrrrrM�szBaseContext._check_available)T)N)r)r)NN)r)r)NNrN)N)N)F)F)+rr	r
rrr
r�staticmethodrZcurrent_processZparent_processZactive_childrenrrrrrr r"r$r%r&r)r,r-r.r0r4r6r8r;r@rBrErFrHrrRrT�propertyrX�setterrMrrrrrsR









�







rc@seZdZdZedd��ZdS)�ProcessNcCst��j�|�SrO)�_default_contextrr\�_Popen)�process_objrrrr^�szProcess._Popen�rr	r
Z
_start_methodrYr^rrrrr\�sr\csFeZdZeZdd�Zd
�fdd�	Zddd�Zdd	d
�Zdd�Z�Z	S)�DefaultContextcCs||_d|_dSrO)r]�_actual_context)rr/rrr�__init__�szDefaultContext.__init__Ncs0|dkr |jdkr|j|_|jSt��|�SdSrO)rbr]�superr)rrN��	__class__rrr�s

zDefaultContext.get_contextFcCs<|jdk	r|std��|dkr,|r,d|_dS|�|�|_dS)Nzcontext has already been set)rb�RuntimeErrorrrSrrrrT�szDefaultContext.set_start_methodcCs"|jdkr|rdS|j|_|jjSrO)rbr]rPrQrrrrR�s

zDefaultContext.get_start_methodcCsBtjdkrdgStjdkr"ddgnddg}tjr:|�d�|SdS)Nr9r?�darwin�forkrI)r<r=r�HAVE_SEND_HANDLE�append)r�methodsrrr�get_all_start_methodss

z$DefaultContext.get_all_start_methods)N)F)F)
rr	r
r\rcrrTrRrm�
__classcell__rrrerra�s

rar9c@seZdZdZedd��ZdS)�ForkProcessricCsddlm}||�S�Nr)�Popen)Z
popen_forkrq�r_rqrrrr^szForkProcess._PopenNr`rrrrrosroc@seZdZdZedd��ZdS)�SpawnProcessr?cCsddlm}||�Srp)Zpopen_spawn_posixrqrrrrrr^s�SpawnProcess._PopenNr`rrrrrssrsc@seZdZdZedd��ZdS)�ForkServerProcessrIcCsddlm}||�Srp)Zpopen_forkserverrqrrrrrr^ szForkServerProcess._PopenNr`rrrrrusruc@seZdZdZeZdS)�ForkContextriN)rr	r
rPror\rrrrrv%srvc@seZdZdZeZdS��SpawnContextr?N�rr	r
rPrsr\rrrrrx)srxc@seZdZdZeZdd�ZdS)�ForkServerContextrIcCstjstd��dS)Nz%forkserver start method not available)rrjrLrWrrrrM0sz"ForkServerContext._check_availableN)rr	r
rPrur\rMrrrrrz-srz)rir?rIrhr?ric@seZdZdZedd��ZdS)rsr?cCsddlm}||�Srp)Zpopen_spawn_win32rqrrrrrr^DsrtNr`rrrrrsBsc@seZdZdZeZdSrwryrrrrrxIscCst|t_dSrO)rJr]rb)rNrrr�_force_start_methodVsr{cCsttdd�S)N�spawning_popen)r>�_tlsrrrr�get_spawning_popen_sr~cCs
|t_dSrO)r}r|)�popenrrr�set_spawning_popenbsr�cCs t�dkrtdt|�j��dS)NzF%s objects should only be shared between processes through inheritance)r~rg�typer)�objrrr�assert_spawninges
��r�) rr<Z	threadingrDrr�__all__�	Exceptionrrr
r�objectrZBaseProcessr\rar=rorsrurvrxrzrJr]r{Zlocalr}r~r�r�rrrr�<module>sL?,��multiprocessing/__pycache__/spawn.cpython-38.pyc000064400000015052151153537440015776 0ustar00U

e5dP$�@s$ddlZddlZddlZddlZddlmZmZddlmZddlm	Z	ddlm
Z
ddd	d
ddd
gZejdkrzdZ
dZneedd�Z
ej���d�Zer�ej�ejd�anejadd	�Zdd
�Zdd�Zdd�Zdd�Zd&dd�Zdd�Zdd�Zdd�ZgZ dd �Z!d!d"�Z"d#d$�Z#d%d
�Z$dS)'�N�)�get_start_method�set_start_method)�process)�	reduction)�util�_main�freeze_support�set_executable�get_executable�get_preparation_data�get_command_line�import_main_path�win32F�frozenzpythonservice.exez
python.execCs|adS�N��_python_exe)Zexe�r�-/usr/lib64/python3.8/multiprocessing/spawn.pyr
)scCstSrrrrrrr-scCs$t|�dkr|ddkrdSdSdS)z=
    Return whether commandline indicates we are forking
    �r�--multiprocessing-forkTFN)�len)�argvrrr�
is_forking4srcCsdttj�r`i}tjdd�D]0}|�d�\}}|dkr@d||<qt|�||<qtf|�t��dS)zE
    Run code for process object if this in not the main process
    rN�=�None)r�sysr�split�int�
spawn_main�exit)�kwds�arg�name�valuerrrr	>s


cKshttdd�r(tjdgdd�|��D�Sd}|d�dd	�|��D��;}t��}tg|d
|dgSdS)zJ
    Returns prefix of command line used for spawning a child process
    rFrcSsg|]}d|�qS)�%s=%rr��.0�itemrrr�
<listcomp>Tsz$get_command_line.<locals>.<listcomp>z<from multiprocessing.spawn import spawn_main; spawn_main(%s)z, css|]}d|VqdS)r&Nrr'rrr�	<genexpr>Wsz#get_command_line.<locals>.<genexpr>z-cN)�getattrr�
executable�items�joinrZ_args_from_interpreter_flagsr)r"�progZoptsrrrr
Ns�cCs�ttj�std��tjdkrrddl}ddl}|dk	rL|�|j|j	Bd|�}nd}t
j||d�}|�|t
j�}|}n"ddlm}	||	j_|}t
�|�}t||�}
t�|
�dS)	z7
    Run code specified by data received over pipe
    zNot forkingrrNF)�source_processr)�resource_tracker)rrr�AssertionError�platform�msvcrt�_winapiZOpenProcessZSYNCHRONIZEZPROCESS_DUP_HANDLErZ	duplicateZopen_osfhandle�os�O_RDONLY�r2Z_resource_trackerZ_fd�duprr!)Zpipe_handleZ
parent_pidZ
tracker_fdr5r6r1Z
new_handle�fd�parent_sentinelr2Zexitcoderrrr \s,

��

r c	Cs`tj|ddd��@}dt��_z$tj�|�}t|�tj�|�}W5t��`XW5QRX|�	|�S)N�rbT)�closefd)
r7�fdopenr�current_process�_inheritingr�pickle�load�prepare�
_bootstrap)r;r<Zfrom_parentZpreparation_data�selfrrrrxs
cCstt��dd�rtd��dS)NrAFa
        An attempt has been made to start a new process before the
        current process has finished its bootstrapping phase.

        This probably means that you are not using fork to start your
        child processes and you have forgotten to use the proper idiom
        in the main module:

            if __name__ == '__main__':
                freeze_support()
                ...

        The "freeze_support()" line can be omitted if the program
        is not going to be frozen to produce an executable.)r,rr@�RuntimeErrorrrrr�_check_not_importing_main�srHcCst�ttjt��jd�}tjdk	r2tj��|d<t	j
��}z|�d�}Wnt
k
r^YnXtj||<|j||t	jtjt��t�d�t	jd}t|jdd�}|dk	r�||d<nft	jd	ks�t�st�st|d
d�}|dk	�rtj
�|��s
tjdk	�r
tj
�tj|�}tj
�|�|d<|S)zM
    Return info about parent needed by child to unpickle process object
    )�
log_to_stderr�authkeyN�	log_levelr9)r$�sys_path�sys_argv�orig_dir�dir�start_method�__main__r$�init_main_from_namer�__file__�init_main_from_path)rH�dictrZ_log_to_stderrrr@rJZ_loggerZgetEffectiveLevelr�path�copy�index�
ValueError�ORIGINAL_DIR�updaterr7�getcwdr�modulesr,�__spec__r4�WINEXE�
WINSERVICE�isabsr/�normpath)r$�drL�i�main_moduleZ
main_mod_name�	main_pathrrrr�sD�


�


�cCs�d|kr|dt��_d|kr,|dt��_d|krD|drDt��d|kr^t���|d�d|krp|dt_	d|kr�|dt_
d|kr�t�|d�d|kr�|dt_
d	|kr�t|d	d
d�d|kr�t|d�nd
|kr�t|d
�dS)zE
    Try to get current process ready to unpickle process object
    r$rJrIrKrLrMrOrNrPT)ZforcerRrTN)rr@r$rJrrIZ
get_loggerZsetLevelrrVrr7�chdirrZr�_fixup_main_from_name�_fixup_main_from_path)�datarrrrD�s,


rDcCs~tjd}|dks|�d�r dSt|jdd�|kr6dSt�|�t�d�}t	j
|ddd�}|j�|�|tjd<tjd<dS)NrQz	.__main__r$�__mp_main__T)�run_nameZ	alter_sys)
rr]�endswithr,r^�old_main_modules�append�types�
ModuleType�runpyZ
run_module�__dict__r[)Zmod_name�current_mainre�main_contentrrrrh�s


�rhcCs�tjd}tj�tj�|��d}|dkr.dSt|dd�|krBdSt�|�t	�
d�}tj|dd�}|j
�|�|tjd<tjd<dS)NrQrZipythonrSrk)rl)rr]r7rV�splitext�basenamer,rnrorprqrrZrun_pathrsr[)rfrtZ	main_namererurrrri	s


�ricCst|�dS)z<
    Set sys.modules['__main__'] to module at main_path
    N)ri)rfrrrr%s)NN)%r7rrrrpr9rrr�contextrr�__all__r4r_r`r,r-�lowerrmrVr/�exec_prefixrr
rrr	r
r rrHrrnrDrhrirrrrr�<module>sD�


2&multiprocessing/__pycache__/popen_spawn_posix.cpython-38.opt-1.pyc000064400000004242151153537440021357 0ustar00U

e5d��@spddlZddlZddlmZmZddlmZddlmZddlmZdgZ	Gdd	�d	e
�ZGd
d�dej�ZdS)�N�)�	reduction�set_spawning_popen)�
popen_fork)�spawn)�util�Popenc@seZdZdd�Zdd�ZdS)�_DupFdcCs
||_dS�N��fd��selfr�r�9/usr/lib64/python3.8/multiprocessing/popen_spawn_posix.py�__init__sz_DupFd.__init__cCs|jSr
r)rrrr�detachsz
_DupFd.detachN)�__name__�
__module__�__qualname__rrrrrrr	sr	cs4eZdZdZeZ�fdd�Zdd�Zdd�Z�Z	S)rrcsg|_t��|�dSr
)�_fds�superr)r�process_obj��	__class__rrrszPopen.__init__cCs|j�|�|Sr
)r�appendr
rrr�duplicate_for_child"szPopen.duplicate_for_childcCsXddlm}|��}|j�|�t�|j�}t�	�}t
|�zt�||�t�||�W5t
d�Xd}}}}	z~t��\}}t��\}}	tj||d�}|j�||g�t
�t��||j�|_||_t|	ddd��}
|
�|���W5QRXW5g}
||	fD]}|dk	�r|
�|��qt
�|t
j|
�|_||fD]}|dk	�r6t�|��q6XdS)Nr)�resource_tracker)�
tracker_fdZpipe_handle�wbF)�closefd)�rZgetfdrrrZget_preparation_data�_name�io�BytesIOrr�dumprZFinalizeZ	close_fds�	finalizer�os�close�pipeZget_command_line�extendZspawnv_passfdsZget_executable�pid�sentinel�open�write�	getbuffer)rrrrZ	prep_data�fpZparent_rZchild_wZchild_rZparent_wZfds_to_closer�cmd�frrr�_launch&sB
�
�

z
Popen._launch)
rrr�methodr	ZDupFdrrr3�
__classcell__rrrrrs
)
r#r'�contextrrr!rrr�__all__�objectr	rrrrr�<module>s
multiprocessing/__pycache__/resource_sharer.cpython-38.opt-2.pyc000064400000011253151153537440021000 0ustar00U

e5d��@s�ddlZddlZddlZddlZddlZddlmZddlmZddlm	Z	dgZ
ejdkrxe
dg7Z
Gd	d�de�Z
ne
d
g7Z
Gdd
�d
e�ZGdd
�d
e�Ze�ZejZdS)�N�)�process)�	reduction)�util�stopZwin32�	DupSocketc@seZdZdd�Zdd�ZdS)rcs(|����fdd�}t�|�j�|_dS)Ncs��|�}|�|�dS�N)�shareZ
send_bytes)�conn�pidr	�Znew_sock��7/usr/lib64/python3.8/multiprocessing/resource_sharer.py�sends
z DupSocket.__init__.<locals>.send)�dup�_resource_sharer�register�close�_id)�selfZsockrr
rr�__init__szDupSocket.__init__c
Cs6t�|j�� }|��}t�|�W5QR�SQRXdSr)r�get_connectionrZ
recv_bytes�socketZ	fromshare)rr
r	r
r
r�detach$szDupSocket.detachN��__name__�
__module__�__qualname__rrr
r
r
rrs�DupFdc@seZdZdd�Zdd�ZdS)rcs4t�|���fdd�}�fdd�}t�||�|_dS)Ncst�|�|�dSr)rZsend_handle)r
r�Znew_fdr
rr1szDupFd.__init__.<locals>.sendcst���dSr)�osrr
rr
rr3szDupFd.__init__.<locals>.close)r rrrr)r�fdrrr
rrr/s
zDupFd.__init__c
Cs.t�|j��}t�|�W5QR�SQRXdSr)rrrrZrecv_handle)rr
r
r
rr7szDupFd.detachNrr
r
r
rr-sc@sJeZdZdd�Zdd�Zedd��Zddd	�Zd
d�Zdd
�Z	dd�Z
dS)�_ResourceSharercCs@d|_i|_g|_t��|_d|_d|_d|_t	�
|tj�dS)Nr)
�_key�_cache�
_old_locks�	threading�Lock�_lock�	_listener�_address�_threadrZregister_after_forkr"�
_afterfork)rr
r
rr?s
z_ResourceSharer.__init__c
CsZ|j�J|jdkr|��|jd7_||f|j|j<|j|jfW5QR�SQRXdS)Nr)r(r*�_startr#r$)rrrr
r
rrIs
z_ResourceSharer.registercCs<ddlm}|\}}||t��jd�}|�|t��f�|S)Nr��Client��authkey)�
connectionr/r�current_processr1rr �getpid)Zidentr/�address�key�cr
r
rrRs
z_ResourceSharer.get_connectionNc	Cs�ddlm}|j��|jdk	r�||jt��jd�}|�d�|��|j	�
|�|j	��rdt�
d�|j��d|_	d|_d|_|j��D]\}\}}|�q�|j��W5QRXdS)Nrr.r0z._ResourceSharer thread did not stop when asked)r2r/r(r*rr3r1rrr+�joinZis_aliverZsub_warningr)r$�items�clear)rZtimeoutr/r7r6rrr
r
rr[s$
�



z_ResourceSharer.stopcCsj|j��D]\}\}}|�q
|j��|j�|j�t��|_|jdk	rT|j�	�d|_d|_
d|_dSr)r$r9r:r%�appendr(r&r'r)rr*r+)rr6rrr
r
rr,ps



z_ResourceSharer._afterforkcCsXddlm}t�d�|t��jd�|_|jj|_	t
j|jd�}d|_
|��||_dS)Nr)�Listenerz0starting listener and thread for sending handlesr0)�targetT)r2r<r�debugrr3r1r)r5r*r&ZThread�_serveZdaemon�startr+)rr<�tr
r
rr-~s

z_ResourceSharer._startc	Cs�ttd�rt�tjt���zh|j���T}|��}|dkrHW5QR�Wq�|\}}|j�	|�\}}z|||�W5|�XW5QRXWqt
��s�tj
t���YqXqdS)N�pthread_sigmask)�hasattr�signalrB�	SIG_BLOCK�
valid_signalsr)ZacceptZrecvr$�poprZ
is_exiting�sys�
excepthook�exc_info)rr
�msgr6Zdestination_pidrrr
r
rr?�s
z_ResourceSharer._serve)N)rrrrr�staticmethodrrr,r-r?r
r
r
rr"=s
	

r")r rDrrHr&�r�contextrr�__all__�platform�objectrrr"rrr
r
r
r�<module>s 


`multiprocessing/__pycache__/popen_spawn_win32.cpython-38.opt-1.pyc000064400000006542151153537440021164 0ustar00U

e5d��@s�ddlZddlZddlZddlZddlZddlmZmZmZddl	m
Z
ddl	mZdgZdZ
ejdkoreed	d
�Zej���d�Zdd
�Zeejej�Zdd�ZGdd�de�ZdS)�N�)�	reduction�get_spawning_popen�set_spawning_popen)�spawn)�util�PopeniZwin32�frozenFzpythonservice.execCs ||kptj�|�tj�|�kS�N)�os�path�normcase)Zp1Zp2�r�9/usr/lib64/python3.8/multiprocessing/popen_spawn_win32.py�_path_eqsrcGs|D]}t�|�qdSr
)�_winapi�CloseHandle)Zhandles�handlerrr�_close_handlessrc@sJeZdZdZdZdd�Zdd�Zddd	�Zd
d�Zdd
�Z	e	Z
dd�ZdS)rz@
    Start a subprocess to run the code of a process object
    rcCsTt�|j�}t�dd�\}}t�|d�}tjt�	�|d�}d�
dd�|D��}t��}tr�t
|tj�r�tj}tj��}tj|d<nd}t|ddd	���}	z0t�||ddd
d|dd�	\}
}}}
t�|�Wnt�|��YnX||_d|_|
|_t|
�|_t�|t|jt|�f�|_t|�zt �!||	�t �!||	�W5td�XW5QRXdS)Nr)Z
parent_pidZpipe_handle� css|]}d|VqdS)z"%s"Nr)�.0�xrrr�	<genexpr>9sz!Popen.__init__.<locals>.<genexpr>�__PYVENV_LAUNCHER__�wbT)�closefdF)"rZget_preparation_data�_namerZ
CreatePipe�msvcrtZopen_osfhandleZget_command_liner�getpid�joinZget_executable�WINENVr�sys�
executable�_base_executable�environ�copy�openZ
CreateProcessr�pid�
returncode�_handle�int�sentinelrZFinalizer�	finalizerrr�dump)�selfZprocess_objZ	prep_dataZrhandleZwhandleZwfd�cmdZ
python_exe�envZto_childZhpZhtr'�tidrrr�__init__,sT
�
�

�zPopen.__init__cCst�||j�Sr
)rZ	duplicater+)r.rrrr�duplicate_for_childaszPopen.duplicate_for_childNcCst|jdkrn|dkrtj}ntdt|dd��}t�t|j�|�}|tjkrnt�|j�}|t	krht
j}||_|jS)Nri�g�?)r(rZINFINITE�maxr*ZWaitForSingleObjectr)Z
WAIT_OBJECT_0ZGetExitCodeProcess�	TERMINATE�signal�SIGTERM)r.�timeoutZmsecs�res�coderrr�waites

z
Popen.waitcCs|jdd�S)Nr�r8)r;�r.rrr�pollusz
Popen.pollcCsL|jdkrHzt�t|j�t�Wn&tk
rF|jdd�dkrB�YnXdS)Ng�?r<)r(rZTerminateProcessr*r)r5�OSErrorr;r=rrr�	terminatexs
zPopen.terminatecCs|��dSr
)r,r=rrr�close�szPopen.close)N)�__name__�
__module__�__qualname__�__doc__�methodr2r3r;r>r@�killrArrrrr&s5
)rrr6r!r�contextrrr�rr�__all__r5�platform�getattrZWINEXEr"�lower�endswithZ
WINSERVICErr#r r�objectrrrrr�<module>s
multiprocessing/__pycache__/forkserver.cpython-38.opt-1.pyc000064400000020173151153537440017775 0ustar00U

e5d�0�@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddl	mZddlm
Z
ddl	mZddl	mZddl	mZd	d
ddgZd
Ze�d�ZGdd�de�Zddd�Zdd�Zdd�Zdd�Ze�ZejZejZejZejZdS)�N�)�
connection)�process)�	reduction)�resource_tracker)�spawn)�util�ensure_running�get_inherited_fds�connect_to_new_process�set_forkserver_preload��qc@sDeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�
ForkServercCs.d|_d|_d|_d|_t��|_dg|_dS)N�__main__)�_forkserver_address�_forkserver_alive_fd�_forkserver_pid�_inherited_fds�	threadingZLock�_lock�_preload_modules��self�r�2/usr/lib64/python3.8/multiprocessing/forkserver.py�__init__"s
zForkServer.__init__c	Cs|j�|��W5QRXdS�N)r�_stop_unlockedrrrr�_stop*szForkServer._stopcCsV|jdkrdSt�|j�d|_t�|jd�d|_t�|j�sLt�|j�d|_dS)Nr)	r�os�closer�waitpidr�is_abstract_socket_namespacer�unlinkrrrrr/s
zForkServer._stop_unlockedcCs&tdd�|jD��std��||_dS)z>Set list of module names to try to load in forkserver process.css|]}t|�tkVqdSr)�type�str)�.0�modrrr�	<genexpr>@sz4ForkServer.set_forkserver_preload.<locals>.<genexpr>z&module_names must be a list of stringsN)�allr�	TypeError)rZ
modules_namesrrrr>sz!ForkServer.set_forkserver_preloadcCs|jS)z�Return list of fds inherited from parent process.

        This returns None if the current process was not started by fork
        server.
        )rrrrrr
DszForkServer.get_inherited_fdsc
Cs�|��t|�dtkr td��t�tj���}|�|j�t�	�\}}t�	�\}}|||j
t��g}||7}zNz&t�||�||fWW�4W5QR�St�
|�t�
|��YnXW5t�
|�t�
|�XW5QRXdS)a;Request forkserver to create a child process.

        Returns a pair of fds (status_r, data_w).  The calling process can read
        the child process's pid and (eventually) its returncode from status_r.
        The calling process should write to data_w the pickled preparation and
        process data.
        �ztoo many fdsN)r	�len�MAXFDS_TO_SEND�
ValueError�socket�AF_UNIXZconnectrr �piperrZgetfdr!rZsendfds)r�fdsZclientZparent_r�child_w�child_rZparent_wZallfdsrrrrLs(�


z!ForkServer.connect_to_new_processcs�|j��~t��|jdk	r`t�|jtj�\}}|sBW5QR�dSt�|j�d|_	d|_d|_d}|j
r�ddh�t�d�}�fdd�|�
�D�}ni}t�tj���}t�d�}|�|�t�|�s�t�|d	�|��t��\}}ztzV|��|g}	||��||j
|f;}t��}
|
gt��}|d
|g7}t�|
||	�}Wnt�|��YnXW5t�|�X||_	||_||_W5QRXW5QRXdS)z�Make sure that a fork server is running.

        This can be called from any process.  Note that usually a child
        process will just reuse the forkserver started by its parent, so
        ensure_running() will do nothing.
        NzCfrom multiprocessing.forkserver import main; main(%d, %d, %r, **%r)�	main_path�sys_path�ignorecsi|]\}}|�kr||�qSrr)r'�x�y�Zdesired_keysrr�
<dictcomp>�sz-ForkServer.ensure_running.<locals>.<dictcomp>r1i�z-c)rrr	rr r"�WNOHANGr!rrrrZget_preparation_data�itemsr0r1rZarbitrary_addressZbindrr#�chmodZlistenr2�filenoZget_executableZ_args_from_interpreter_flagsZspawnv_passfds)r�pidZstatus�cmd�data�listenerZaddress�alive_rZalive_wZfds_to_passZexe�argsrr;rr	isN





�
zForkServer.ensure_runningN)
�__name__�
__module__�__qualname__rrrrr
rr	rrrrr srcCs�|rdd|kr8|dk	r8dt��_zt�|�W5t��`X|D]&}zt|�Wq<tk
r`Yq<Xq<t��t	�
�\}}t	�|d�t	�|d�dd�}tj
|tjtji}	dd�|	��D�}
t�|�i}tjtj|d	����}t�����}
|��t_|
�|tj�|
�|tj�|
�|tj��znd
d�|
��D�}|�r"�qB�q"||k�rPt�||k�rBt	�|d�zt	�d
t	j�\}}Wnt k
�r�Y�qBYnX|dk�r��qB|�!|d�}|dk	�r0t	�"|��r�t	�#|�}n&t	�$|��s�t%d�&||���t	�'|�}zt(||�Wnt)k
�r"YnXt	�*|�nt+�,d|��qf||k�r�|�-�d��,}t.�/|t0d�}t1|�t0k�r�t2d�&t1|����|^}}}|�*�t	�3�}|dk�r4d}zpz<|�*�|
�*�||||g}|�5|�6��t7||||
�}Wn.t8k
�r t9j:t9�;��t9j<�=�YnXW5t	�4|�XnNzt(||�Wnt)k
�rXYnX|||<t	�*|�|D]}t	�*|��qpW5QRXWn4t>k
�r�}z|j?t?j@k�r��W5d}~XYnX�qW5QRXW5QRXdS)zRun forkserver.rNTFcWsdSrr)Z_unusedrrr�sigchld_handler�szmain.<locals>.sigchld_handlercSsi|]\}}|t�||��qSr)�signal)r'�sig�valrrrr<�s�zmain.<locals>.<dictcomp>)r@cSsg|]\}}|j�qSr)Zfileobj)r'�keyZeventsrrr�
<listcomp>�szmain.<locals>.<listcomp>i���rzChild {0:n} status is {1:n}z.forkserver: waitpid returned unexpected pid %drzToo many ({0:n}) fds to send)ArZcurrent_processZ_inheritingrZimport_main_path�
__import__�ImportErrorrZ_close_stdinr r2�set_blockingrK�SIGCHLD�SIGINT�SIG_IGNr>�
set_wakeup_fdr0r1�	selectorsZDefaultSelectorZgetsockname�_forkserverr�registerZ
EVENT_READZselect�
SystemExit�readr"r=�ChildProcessError�pop�WIFSIGNALED�WTERMSIG�	WIFEXITED�AssertionError�format�WEXITSTATUS�write_signed�BrokenPipeErrorr!�warnings�warnZacceptrZrecvfdsr.r-�RuntimeError�fork�_exit�extend�values�
_serve_one�	Exception�sys�
excepthook�exc_info�stderr�flush�OSError�errnoZECONNABORTED)Zlistener_fdrEZpreloadr6r7�modnameZsig_rZsig_wrJ�handlersZold_handlersZ	pid_to_fdrDZselectorZrfdsrA�stsr4�
returncode�sr3r5�code�
unused_fds�fd�errr�main�s�

��
�




��
�

��

�
r�c	Csht�d�|��D]\}}t�||�q|D]}t�|�q,|^t_tj_	t_
t�|�}t�
||�}|S)NrP)rKrWr>r r!rYrrZ_resource_trackerZ_fdr�duprZ_main)	r5r3r}rxrLrMr~Zparent_sentinelr|rrrrn1s
�
rncCsNd}tj}t|�|kr@t�||t|��}|s6td��||7}q
t�|�dS)N�zunexpected EOFr)�
SIGNED_STRUCT�sizer-r r\�EOFErrorZunpack)r~rCZlengthr{rrr�read_signedHs
r�cCs<t�|�}|r8t�||�}|dkr*td��||d�}q
dS)Nrzshould not get here)r�Zpackr �writeri)r~�n�msg�nbytesrrrreRs
re)NN) rvr rXrKr0Zstructrprrg�rr�contextrrrr�__all__r.ZStructr��objectrr�rnr�rerYr	r
rrrrrr�<module>s>�


multiprocessing/__pycache__/synchronize.cpython-38.pyc000064400000026035151153537440017224 0ustar00U

e5dZ-�@s,ddddddgZddlZddlZddlZddlZddlZdd	lmZdd
lmZddlm	Z	zddlm
Z
mZWnek
r�ed
��YnXe
ed��\ZZej
jZGdd�de�Z
Gdd�de
�ZGdd�de�ZGdd�de
�ZGdd�de
�ZGdd�de�ZGdd�de�ZGdd�dej�ZdS)�Lock�RLock�	Semaphore�BoundedSemaphore�	Condition�Event�N�)�context)�process)�util)�SemLock�
sem_unlinkz�This platform lacks a functioning sem_open implementation, therefore, the required synchronization primitives needed will not function, see issue 3770.�c@s\eZdZe��Zdd�Zedd��Zdd�Z	dd�Z
d	d
�Zdd�Zd
d�Z
edd��ZdS)rc	Cs�|dkrtj��}|��}tjdkp*|dk}td�D]>}z t�||||�	�|�}|_
Wntk
rlYq4Xq|q4td��t�
d|j�|��tjdkr�dd�}	t�||	�|j
jdk	r�dd	lm}
|
|j
jd
�tj|tj|j
jfdd�dS)
N�win32�fork�dzcannot find name for semaphorezcreated semlock with handle %scSs|j��dS�N)�_semlock�_after_fork)�obj�r�3/usr/lib64/python3.8/multiprocessing/synchronize.pyrGsz%SemLock.__init__.<locals>._after_forkr)�register�	semaphorer)Zexitpriority)r	Z_default_contextZget_contextZget_start_method�sys�platform�range�_multiprocessingr�
_make_namer�FileExistsErrorr�debug�handle�
_make_methodsZregister_after_fork�name�resource_trackerrZFinalize�_cleanup)�self�kind�value�maxvalue�ctxr#Z
unlink_now�i�slrrrrr�__init__2s8
�
�zSemLock.__init__cCs"ddlm}t|�||d�dS)Nr)�
unregisterr)r$r.r
)r#r.rrrr%TszSemLock._cleanupcCs|jj|_|jj|_dSr)r�acquire�release�r&rrrr"Zs
zSemLock._make_methodscCs
|j��Sr)r�	__enter__r1rrrr2^szSemLock.__enter__cGs|jj|�Sr)r�__exit__�r&�argsrrrr3aszSemLock.__exit__cCsDt�|�|j}tjdkr,t���|j�}n|j}||j|j	|j
fS)Nr)r	�assert_spawningrrrZget_spawning_popenZduplicate_for_childr!r'r)r#)r&r,�hrrr�__getstate__ds

zSemLock.__getstate__cCs,tjj|�|_t�d|d�|��dS)Nz recreated blocker with handle %rr)rrZ_rebuildrrr r"�r&�staterrr�__setstate__mszSemLock.__setstate__cCsdt��jdttj�fS)Nz%s-%sZ	semprefix)r
�current_processZ_config�nextr�_randrrrrrrs�zSemLock._make_nameN)�__name__�
__module__�__qualname__�tempfileZ_RandomNameSequencer>r-�staticmethodr%r"r2r3r8r;rrrrrr.s"
	rc@s&eZdZd	dd�Zdd�Zdd�ZdS)
rrcCstj|t|t|d�dS�N�r*)rr-�	SEMAPHORE�
SEM_VALUE_MAX�r&r(r*rrrr-}szSemaphore.__init__cCs
|j��Sr)r�
_get_valuer1rrr�	get_value�szSemaphore.get_valuecCs8z|j��}Wntk
r&d}YnXd|jj|fS)N�unknownz<%s(value=%s)>)rrI�	Exception�	__class__r?�r&r(rrr�__repr__�s

zSemaphore.__repr__N)r)r?r@rAr-rJrOrrrrr{s
c@seZdZddd�Zdd�ZdS)rrcCstj|t|||d�dSrD�rr-rFrHrrrr-�szBoundedSemaphore.__init__cCs>z|j��}Wntk
r&d}YnXd|jj||jjfS)NrKz<%s(value=%s, maxvalue=%s)>)rrIrLrMr?r)rNrrrrO�s
�zBoundedSemaphore.__repr__N)r�r?r@rAr-rOrrrrr�s
c@seZdZdd�Zdd�ZdS)rcCstj|tdd|d�dS�NrrErP�r&r*rrrr-�sz
Lock.__init__cCs�zf|j��r8t��j}t��jdkrd|dt��j7}n,|j��dkrLd}n|j��dkr`d}nd}Wnt	k
r~d}YnXd	|j
j|fS)
N�
MainThread�|r�Noner�SomeOtherThread�SomeOtherProcessrKz<%s(owner=%s)>)r�_is_miner
r<r#�	threading�current_threadrI�_countrLrMr?)r&r#rrrrO�s


z
Lock.__repr__NrQrrrrr�sc@seZdZdd�Zdd�ZdS)rcCstj|tdd|d�dSrR)rr-�RECURSIVE_MUTEXrSrrrr-�szRLock.__init__cCs�z||j��rBt��j}t��jdkr6|dt��j7}|j��}n8|j��dkrZd\}}n |j��dkrrd\}}nd\}}Wnt	k
r�d\}}YnXd	|j
j||fS)
NrTrUr)rVrr)rW�nonzero)rXr^)rKrK�<%s(%s, %s)>)rrYr
r<r#rZr[r\rIrLrMr?)r&r#�countrrrrO�s



zRLock.__repr__NrQrrrrr�sc@sleZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	ddd�Z
ddd�Zdd�Zddd�Z
dS)rNcCs>|p
|��|_|�d�|_|�d�|_|�d�|_|��dS�Nr)r�_lockr�_sleeping_count�_woken_count�_wait_semaphorer")r&�lockr*rrrr-�s
zCondition.__init__cCst�|�|j|j|j|jfSr)r	r6rbrcrdrer1rrrr8�s

�zCondition.__getstate__cCs |\|_|_|_|_|��dSr)rbrcrdrer"r9rrrr;�s
�
zCondition.__setstate__cCs
|j��Sr)rbr2r1rrrr2�szCondition.__enter__cGs|jj|�Sr)rbr3r4rrrr3�szCondition.__exit__cCs|jj|_|jj|_dSr)rbr/r0r1rrrr"�s
zCondition._make_methodscCsJz|jj��|jj��}Wntk
r4d}YnXd|jj|j|fS)NrKr_)rcrrIrdrLrMr?rb)r&Znum_waitersrrrrO�s

�
zCondition.__repr__c	Cs~|jj��std��|j��|jj��}t|�D]}|j��q2z|j
�	d|�W�S|j��t|�D]}|j�	�qhXdS)Nz,must acquire() condition before using wait()T)rbrrY�AssertionErrorrcr0r\rrdr/re)r&�timeoutr`r+rrr�wait�s�

zCondition.waitrcCs�|jj��std��|j�d�r(td��|j�d�rN|j�d�}|s(td��q(d}||krz|j�d�rz|j��|d7}qR|r�t	|�D]}|j��q�|j�d�r�q�dS)Nzlock is not ownedFz<notify: Should not have been able to acquire _wait_semaphorez>notify: Bug in sleeping_count.acquire- res should not be Falserr)
rbrrYrgrer/rdrcr0r)r&�n�resZsleepersr+rrr�notifys$��

zCondition.notifycCs|jtjd�dS)N)rj)rlr�maxsizer1rrr�
notify_all(szCondition.notify_allcCsd|�}|r|S|dk	r$t��|}nd}d}|s`|dk	rN|t��}|dkrNq`|�|�|�}q,|Sra)�time�	monotonicri)r&Z	predicaterh�resultZendtimeZwaittimerrr�wait_for+s
zCondition.wait_for)N)N)r)N)r?r@rAr-r8r;r2r3r"rOrirlrnrrrrrrr�s


c@s6eZdZdd�Zdd�Zdd�Zdd�Zdd
d�Zd	S)
rcCs |�|���|_|�d�|_dSra)rr�_condr�_flagrSrrrr-CszEvent.__init__c	CsD|j�4|j�d�r,|j��W5QR�dSW5QR�dSQRXdS�NFT)rsrtr/r0r1rrr�is_setGs

zEvent.is_setc	Cs6|j�&|j�d�|j��|j��W5QRXdS�NF)rsrtr/r0rnr1rrr�setNs
z	Event.setc	Cs"|j�|j�d�W5QRXdSrw)rsrtr/r1rrr�clearTszEvent.clearNc	Csh|j�X|j�d�r |j��n|j�|�|j�d�rP|j��W5QR�dSW5QR�dSQRXdSru)rsrtr/r0ri)r&rhrrrriXs
z
Event.wait)N)r?r@rAr-rvrxryrirrrrrAs
c@sZeZdZddd�Zdd�Zdd�Zedd	��Zejd
d	��Zedd��Z	e	jd
d��Z	dS)�BarrierNc	CsRddl}ddlm}||�d�d�}|��}|�|||||f�d|_d|_dS)Nrr)�
BufferWrapperr+r)�struct�heapr{Zcalcsizerr;�_stater\)	r&Zparties�actionrhr*r|r{�wrapperZcondrrrr-jszBarrier.__init__cCs.|\|_|_|_|_|_|j���d�|_dS)Nr+)�_parties�_action�_timeoutrs�_wrapperZcreate_memoryview�cast�_arrayr9rrrr;ss
�zBarrier.__setstate__cCs|j|j|j|j|jfSr)r�r�r�rsr�r1rrrr8xs�zBarrier.__getstate__cCs
|jdSra�r�r1rrrr~|szBarrier._statecCs||jd<dSrar�rNrrrr~�scCs
|jdS�Nrr�r1rrrr\�szBarrier._countcCs||jd<dSr�r�rNrrrr\�s)NN)
r?r@rAr-r;r8�propertyr~�setterr\rrrrrzhs
	


rz)�__all__rZrrBrro�r	r
rrr
�ImportError�listrr]rFrG�objectrrrrrrrzrrrr�<module>s8�	Mo'multiprocessing/__pycache__/resource_tracker.cpython-38.opt-1.pyc000064400000011754151153537440021154 0ustar00U

e5d�!�@s�ddlZddlZddlZddlZddlZddlmZddlmZdddgZe	ed�Z
ejejfZ
d	d
d�iZejdkr�ddlZddlZe�ejejd
��Gdd�de�Ze�ZejZejZejZejZdd�ZdS)�N�)�spawn)�util�ensure_running�register�
unregister�pthread_sigmaskZnoopcCsdS�N�r
r
r
�8/usr/lib64/python3.8/multiprocessing/resource_tracker.py�<lambda>!�r�posix)Z	semaphoreZ
shared_memoryc@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�ResourceTrackercCst��|_d|_d|_dSr	)�	threadingZLock�_lock�_fd�_pid��selfr
r
r�__init__0s
zResourceTracker.__init__c	CsT|j�D|jdkr W5QR�dSt�|j�d|_t�|jd�d|_W5QRXdS)Nr)rr�os�close�waitpidrrr
r
r�_stop5s
zResourceTracker._stopcCs|��|jSr	)rrrr
r
r�getfdBszResourceTracker.getfdcCst|j��b|jdk	r~|��r*W5QR�dSt�|j�z|jdk	rPt�|jd�Wntk
rfYnXd|_d|_t�	d�g}z|�
tj�
��Wntk
r�YnXd}t��\}}z�zr|�
|�t��}|gt��}|d||g7}z&t�rt�tjt�t�|||�}W5t�r,t�tjt�XWnt�|��YnX||_||_W5t�|�XW5QRXdS)z�Make sure that resource tracker process is running.

        This can be run from any process.  Usually a child process will use
        the resource created by its parent.NrzUresource_tracker: process died unexpectedly, relaunching.  Some resources might leak.z:from multiprocessing.resource_tracker import main;main(%d)z-c)rr�_check_aliverrrr�ChildProcessError�warnings�warn�append�sys�stderr�fileno�	Exception�piperZget_executablerZ_args_from_interpreter_flags�
_HAVE_SIGMASK�signalr�SIG_UNBLOCK�_IGNORED_SIGNALS�	SIG_BLOCKZspawnv_passfds)rZfds_to_pass�cmd�r�wZexe�args�pidr
r
rrFsJ






zResourceTracker.ensure_runningcCs2zt�|jd�Wntk
r(YdSXdSdS)z;Check that the pipe has not been closed by sending a probe.s
PROBE:0:noop
FTN)r�writer�OSErrorrr
r
rr�s
zResourceTracker._check_alivecCs|�d||�dS)z0Register name of resource with resource tracker.�REGISTERN��_send�r�name�rtyper
r
rr�szResourceTracker.registercCs|�d||�dS)z2Unregister name of resource with resource tracker.�
UNREGISTERNr3r5r
r
rr�szResourceTracker.unregistercCsB|��d�|||��d�}t|�dkr0td��t�|j|�}dS)Nz{0}:{1}:{2}
�asciiiz
name too long)r�format�encode�len�
ValueErrorrr0r)rr+r6r7�msg�nbytesr
r
rr4�szResourceTracker._sendN)�__name__�
__module__�__qualname__rrrrrrrr4r
r
r
rr.s
@rc
Cst�tjtj�t�tjtj�tr2t�tjt�tj	tj
fD]&}z|��Wq>tk
rbYq>Xq>dd�t
��D�}z�t|d���}|D]�}z�|���d��d�\}}}t
�|d�}	|	dkr�td	|�d
|����|dkr�||�|�n2|dk�r||�|�n|d
k�rntd|��Wq�tk
�rTztjt���WnYnXYq�Xq�W5QRXW5|��D]�\}}|�r�zt�dt|�|f�Wntk
�r�YnX|D]V}zLzt
||�Wn6tk
�r�}zt�d||f�W5d}~XYnXW5X�q��qnXdS)zRun resource tracker.cSsi|]}|t��qSr
)�set)�.0r7r
r
r�
<dictcomp>�szmain.<locals>.<dictcomp>zQresource_tracker: There appear to be %d leaked %s objects to clean up at shutdownzresource_tracker: %r: %sN�rbr9�:zCannot register z. for automatic cleanup: unknown resource type r2r8ZPROBEzunrecognized command %r)r'�SIGINT�SIG_IGN�SIGTERMr&rr(r)r!�stdin�stdoutrr$�_CLEANUP_FUNCS�keys�itemsrrr<�open�strip�decode�split�getr=�add�remove�RuntimeError�
excepthook�exc_info)
�fd�f�cacher7Zrtype_cacher6�e�liner+Zcleanup_funcr
r
r�main�s^�


�
(r_)rr'r!rr�rr�__all__�hasattrr&rHrJr)rMr6Z_multiprocessingZ_posixshmem�updateZ
sem_unlinkZ
shm_unlink�objectrZ_resource_trackerrrrrr_r
r
r
r�<module>s4

�
�wmultiprocessing/__pycache__/process.cpython-38.pyc000064400000025373151153537440016333 0ustar00U

e5d�.�@s8ddddgZddlZddlZddlZddlZddlZddlmZzej�	e�
��ZWnek
rldZYnXdd�Z
dd�Zd	d�Zd
d�ZGdd�de�ZGd
d�de�ZGdd�de�ZGdd�de�Zdae�ae�d�ae�a[iZeej� ��D]0\Z!Z"e!dd�dkr�de!kr�de!��ee"<q�e�Z#dS)�BaseProcess�current_process�active_children�parent_process�N)�WeakSetcCstS)z@
    Return process object representing the current process
    )�_current_process�rr�//usr/lib64/python3.8/multiprocessing/process.pyr%scCst�tt�S)zN
    Return list of process objects corresponding to live child processes
    )�_cleanup�list�	_childrenrrrr	r+scCstS)z?
    Return process object representing the parent process
    )�_parent_processrrrr	r3scCs*tt�D]}|j��dk	rt�|�qdS�N)rr�_popen�poll�discard)�prrr	r
=sr
c@s�eZdZdZdd�Zddddifdd�dd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
d,dd�Zdd�Zdd�Z
edd��Zejdd��Zedd��Zejdd��Zedd ��Zejd!d ��Zed"d#��Zed$d%��ZeZed&d'��Zd(d)�Zd-d*d+�ZdS).rz�
    Process objects represent activity that is run in a separate process

    The class is analogous to `threading.Thread`
    cCst�dSr)�NotImplementedError��selfrrr	�_PopenMszBaseProcess._PopenNr)�daemoncCs�|dkstd��tt�}tj|f|_tj��|_t��|_	tj
|_d|_d|_
||_t|�|_t|�|_|p�t|�jdd�dd�|jD��|_|dk	r�||_t�|�dS)Nz#group argument must be None for nowF�-�:css|]}t|�VqdSr)�str)�.0�irrr	�	<genexpr>^sz'BaseProcess.__init__.<locals>.<genexpr>)�AssertionError�next�_process_counterr�	_identity�_config�copy�os�getpid�_parent_pid�name�_parent_namer�_closed�_target�tuple�_args�dict�_kwargs�type�__name__�join�_namer�	_dangling�add)r�group�targetr'�args�kwargsr�countrrr	�__init__Ps"


�zBaseProcess.__init__cCs|jrtd��dS)Nzprocess object is closed)r)�
ValueErrorrrrr	�
_check_closedcszBaseProcess._check_closedcCs|jr|j|j|j�dS)zQ
        Method to be run in sub-process; can be overridden in sub-class
        N)r*r,r.rrrr	�rungszBaseProcess.runcCsz|��|jdkstd��|jt��ks0td��tj�d�rDtd��t	�|�
|�|_|jj|_|`
|`|`t�|�dS)z%
        Start child process
        Nzcannot start a process twicez:can only start a process object created by current processrz3daemonic processes are not allowed to have children)r<rrr&r$r%rr"�getr
r�sentinel�	_sentinelr*r,r.rr4rrrr	�startns��
zBaseProcess.startcCs|��|j��dS)zT
        Terminate process; sends SIGTERM signal or uses TerminateProcess()
        N)r<r�	terminaterrrr	rB�szBaseProcess.terminatecCs|��|j��dS)zT
        Terminate process; sends SIGKILL signal or uses TerminateProcess()
        N)r<r�killrrrr	rC�szBaseProcess.killcCsR|��|jt��kstd��|jdk	s0td��|j�|�}|dk	rNt�|�dS)z5
        Wait until child process terminates
        zcan only join a child processNzcan only join a started process)	r<r&r$r%rr�waitrr)r�timeout�resrrr	r1�szBaseProcess.joincCs`|��|tkrdS|jt��ks*td��|jdkr8dS|j��}|dkrNdSt�	|�dSdS)z1
        Return whether process is alive
        Tzcan only test a child processNF)
r<rr&r$r%rrrrr)r�
returncoderrr	�is_alive�s


zBaseProcess.is_alivecCsH|jdk	r>|j��dkr td��|j��d|_|`t�|�d|_dS)z�
        Close the Process object.

        This method releases resources held by the Process object.  It is
        an error to call this method if the child process is still running.
        Nz^Cannot close a process while it is still running. You should first call join() or terminate().T)rrr;�closer@rrr)rrrr	rI�s


zBaseProcess.closecCs|jSr)r2rrrr	r'�szBaseProcess.namecCst|t�std��||_dS)Nzname must be a string)�
isinstancerrr2)rr'rrr	r'�scCs|j�dd�S)z4
        Return whether process is a daemon
        rF)r"r>rrrr	r�szBaseProcess.daemoncCs |jdkstd��||jd<dS)z1
        Set whether process is a daemon
        Nzprocess has already startedr)rrr")rZdaemonicrrr	r�scCs
|jdS)N�authkey)r"rrrr	rK�szBaseProcess.authkeycCst|�|jd<dS)z2
        Set authorization key of process
        rKN)�AuthenticationStringr")rrKrrr	rK�scCs"|��|jdkr|jS|j��S)zM
        Return exit code of process or `None` if it has yet to stop
        N)r<rrrrrr	�exitcode�s
zBaseProcess.exitcodecCs*|��|tkrt��S|jo$|jjSdS)zU
        Return identifier (PID) of process or `None` if it has yet to start
        N)r<rr$r%r�pidrrrr	�ident�szBaseProcess.identcCs4|��z|jWStk
r.td�d�YnXdS)z{
        Return a file descriptor (Unix) or handle (Windows) suitable for
        waiting for process termination.
        zprocess not startedN)r<r@�AttributeErrorr;rrrr	r?�s
zBaseProcess.sentinelcCs�d}|tkrd}nL|jrd}n@|jt��kr2d}n,|jdkrBd}n|j��}|dk	rZd}nd}t|�jd|j	g}|jdk	r�|�
d|jj�|�
d|j�|�
|�|dk	r�t�
||�}|�
d	|�|jr�|�
d
�dd�|�S)
NZstarted�closed�unknown�initialZstoppedzname=%rzpid=%sz	parent=%szexitcode=%srz<%s>� )rr)r&r$r%rrr/r0r2�appendrN�_exitcode_to_namer>rr1)rrMZstatus�inforrr	�__repr__s0




zBaseProcess.__repr__c
Csvddlm}m}�z>z�|jdk	r,|�|j�t	�
d�at�a
|��t}|at|j|j|�atjrnt����z|j��|��W5~X|�d�z|��d}W5|��XWn�tk
�r}zJ|js�d}n:t|jdt�r�|jd}nt j!�"t#|jd�d�d}W5d}~XYn2d}ddl$}t j!�"d|j%�|�&�YnXW5t��|�d|�|��X|S)N�)�util�contextz process exiting with exitcode %dz child process calling self.run()r�
zProcess %s:
)'�rZr[�	threadingZ	_shutdownrWZ_flush_std_streamsZ
_start_methodZ_force_start_method�	itertoolsr9r �setrZ_close_stdinr�_ParentProcessr(r&r
Z_HAVE_THREAD_NATIVE_IDZmain_threadZ_set_native_idZ_finalizer_registry�clearZ_run_after_forkersZ_exit_functionr=�
SystemExitr7rJ�int�sys�stderr�writer�	tracebackr'�	print_exc)rZparent_sentinelrZr[rMZold_process�erhrrr	�
_bootstrap"sR

�


zBaseProcess._bootstrap)N)N)r0�
__module__�__qualname__�__doc__rr:r<r=rArBrCr1rHrI�propertyr'�setterrrKrMrOrNr?rXrkrrrr	rGsD�







	


c@seZdZdd�ZdS)rLcCs,ddlm}|�dkrtd��tt|�ffS)NrY)�get_spawning_popenzJPickling an AuthenticationString object is disallowed for security reasons)r[rq�	TypeErrorrL�bytes)rrqrrr	�
__reduce__Xs
�zAuthenticationString.__reduce__N)r0rlrmrtrrrr	rLWsrLc@s6eZdZdd�Zdd�Zedd��Zd
dd	�ZeZdS)racCs4d|_||_||_d|_d|_d|_||_i|_dS)NrF)r!r2�_pidr&rr)r@r")rr'rNr?rrr	r:hsz_ParentProcess.__init__cCsddlm}||jgdd�S)Nr�rD�rE�Zmultiprocessing.connectionrDr@)rrDrrr	rHrsz_ParentProcess.is_alivecCs|jSr)rurrrr	rOvsz_ParentProcess.identNcCs ddlm}||jg|d�dS)z6
        Wait until parent process terminates
        rrvrwNrx)rrErDrrr	r1zsz_ParentProcess.join)N)	r0rlrmr:rHrorOr1rNrrrr	rafs


rac@seZdZdd�Zdd�ZdS)�_MainProcesscCs8d|_d|_d|_d|_d|_tt�d��dd�|_dS)NrZMainProcessF� z/mp)rKZ	semprefix)	r!r2r&rr)rLr$�urandomr"rrrr	r:�s�z_MainProcess.__init__cCsdSrrrrrr	rI�sz_MainProcess.closeN)r0rlrmr:rIrrrr	ry�sryrY�ZSIG�_r)$�__all__r$re�signalr_r^Z_weakrefsetr�path�abspath�getcwdZORIGINAL_DIR�OSErrorrrrr
�objectrrsrLraryr
rr9r r`rrVr�__dict__�itemsr'Zsignumr3rrrr	�<module>
s@�


!
multiprocessing/__pycache__/popen_forkserver.cpython-38.opt-1.pyc000064400000004563151153537440021203 0ustar00U

e5d��@s�ddlZddlZddlmZmZejs.ed��ddlmZddlm	Z	ddlm
Z
ddlmZd	gZGd
d�de
�ZGdd	�d	e	j�ZdS)
�N�)�	reduction�set_spawning_popenz,No support for sending fds between processes)�
forkserver)�
popen_fork)�spawn)�util�Popenc@seZdZdd�Zdd�ZdS)�_DupFdcCs
||_dS�N)�ind)�selfr�r�8/usr/lib64/python3.8/multiprocessing/popen_forkserver.py�__init__sz_DupFd.__init__cCst��|jSr)rZget_inherited_fdsr)r
rrr�detachsz
_DupFd.detachN)�__name__�
__module__�__qualname__rrrrrrr
sr
csBeZdZdZeZ�fdd�Zdd�Zdd�Ze	j
fdd	�Z�ZS)
r	rcsg|_t��|�dSr)�_fds�superr)r
�process_obj��	__class__rrr!szPopen.__init__cCs|j�|�t|j�dS)Nr)r�append�len)r
�fdrrr�duplicate_for_child%szPopen.duplicate_for_childc	Cs�t�|j�}t��}t|�zt�||�t�||�W5td�Xt�	|j
�\|_}t�
|�}t�|tj||jf�|_t|ddd��}|�|���W5QRXt�|j�|_dS)N�wbT)�closefd)rZget_preparation_data�_name�io�BytesIOrr�dumprZconnect_to_new_processr�sentinel�os�duprZFinalizeZ	close_fds�	finalizer�open�write�	getbuffer�read_signed�pid)r
rZ	prep_dataZbuf�wZ	_parent_w�frrr�_launch)s


�z
Popen._launchc	Csr|jdkrlddlm}|tjkr$dnd}||jg|�s:dSzt�|j�|_Wntt	fk
rjd|_YnX|jS)Nr)�wait�)
�
returncodeZmultiprocessing.connectionr0r%�WNOHANGr$rr+�OSError�EOFError)r
�flagr0Ztimeoutrrr�poll=s
z
Popen.poll)
rrr�methodr
ZDupFdrrr/r%r3r7�
__classcell__rrrrr	s)r!r%�contextrrZHAVE_SEND_HANDLE�ImportError�rrrr�__all__�objectr
r	rrrr�<module>s
multiprocessing/__pycache__/popen_fork.cpython-38.pyc000064400000005126151153537440017011 0ustar00U

e5d
�@s6ddlZddlZddlmZdgZGdd�de�ZdS)�N�)�util�Popenc@s`eZdZdZdd�Zdd�Zejfdd�Zdd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�ZdS)r�forkcCs"t��d|_d|_|�|�dS�N)rZ_flush_std_streams�
returncode�	finalizer�_launch)�self�process_obj�r�2/usr/lib64/python3.8/multiprocessing/popen_fork.py�__init__szPopen.__init__cCs|Srr)r
�fdrrr
�duplicate_for_childszPopen.duplicate_for_childc
Cs�|jdkr�zt�|j|�\}}Wn(tk
rH}z
WY�dSd}~XYnX||jkr�t�|�rnt�|�|_n$t�|�s�td�	|���t�
|�|_|jS)NzStatus is {:n})r�os�waitpid�pid�OSError�WIFSIGNALED�WTERMSIG�	WIFEXITED�AssertionError�format�WEXITSTATUS)r
�flagr�sts�errr
�polls


z
Popen.pollNcCsN|jdkrH|dk	r0ddlm}||jg|�s0dS|�|dkrBtjnd�S|jS)Nr)�waitg)rZmultiprocessing.connectionr�sentinelrr�WNOHANG)r
�timeoutrrrr
r(s
z
Popen.waitcCsZ|jdkrVzt�|j|�Wn8tk
r0Yn&tk
rT|jdd�dkrP�YnXdS)Ng�������?)r")rr�killr�ProcessLookupErrorrr)r
Zsigrrr
�_send_signal2s
zPopen._send_signalcCs|�tj�dSr)r%�signal�SIGTERM�r
rrr
�	terminate<szPopen.terminatecCs|�tj�dSr)r%r&�SIGKILLr(rrr
r#?sz
Popen.killc	Cs�d}t��\}}t��\}}t��|_|jdkrdz$t�|�t�|�|j|d�}W5t�|�Xn0t�|�t�|�t�|tj	||f�|_
||_dS)Nrr)Zparent_sentinel)r�piperr�_exit�close�
_bootstraprZFinalizeZ	close_fdsrr )r
r�codeZparent_rZchild_wZchild_rZparent_wrrr
r	Bs 






�z
Popen._launchcCs|jdk	r|��dSr)rr(rrr
r-Us
zPopen.close)N)�__name__�
__module__�__qualname__�methodrrrr!rrr%r)r#r	r-rrrr
rs


)rr&�r�__all__�objectrrrrr
�<module>smultiprocessing/__pycache__/shared_memory.cpython-38.opt-2.pyc000064400000026246151153537440020453 0ustar00U

e5dD�@s�ddgZddlmZddlZddlZddlZddlZddlZejdkrTddl	Z	dZ
nddlZdZ
ejej
BZdZe
rzd	Znd
Zdd�ZGd
d�d�ZdZGdd�d�ZdS)�SharedMemory�
ShareableList�)�partialN�ntFT�z/psm_Zwnsm_cCs"ttt�d}tt�|�}|S)N�)�_SHM_SAFE_NAME_LENGTH�len�_SHM_NAME_PREFIX�secretsZ	token_hex)�nbytes�name�r�5/usr/lib64/python3.8/multiprocessing/shared_memory.py�_make_filename&src@s�eZdZdZdZdZdZejZ	dZ
er*dndZddd�Z
d	d
�Zdd�Zd
d�Zedd��Zedd��Zedd��Zdd�Zdd�ZdS)rN���i�TFrc
	Csl|dkstd��|r0ttjB|_|dkr0td��|dkrL|jtj@sLtd��t�rH|dkr�t�}ztj	||j|j
d�|_Wntk
r�YqZYnX||_
q�qZn.|jr�d|n|}tj	||j|j
d�|_||_
z<|r�|r�t�|j|�t�|j�}|j}t�|j|�|_Wn tk
�r*|���YnXddlm}||j
d	��n|�r�|dk�r^t�n|}t�tjtjtj|d
?d@|d@|�}zXt��}|tjk�r�|dk	�r�tt j!t�"t j!�|tj��nW��qNtjd||d
�|_W5t�|�X||_
�qV�qNnX||_
t�#tj$d|�}zt�%|tj$ddd�}	W5t�|�Xt�&|	�}tjd||d
�|_||_'t(|j�|_)dS)Nrz!'size' must be a positive integerz4'size' must be a positive number different from zeroz&'name' can only be None if create=True)�mode�/�)�register�
shared_memory� l��r)ZtagnameF)*�
ValueError�_O_CREX�os�O_RDWR�_flags�O_EXCL�
_USE_POSIXr�_posixshmemZshm_open�_mode�_fd�FileExistsError�_name�_prepend_leading_slash�	ftruncate�fstat�st_size�mmap�_mmap�OSError�unlink�resource_trackerr�_winapiZCreateFileMappingZINVALID_HANDLE_VALUEZNULLZPAGE_READWRITEZCloseHandleZGetLastErrorZERROR_ALREADY_EXISTS�errnoZEEXIST�strerrorZOpenFileMappingZ
FILE_MAP_READZ
MapViewOfFileZVirtualQuerySize�_size�
memoryview�_buf)
�selfr
�create�sizeZstatsrZ	temp_nameZh_mapZlast_error_codeZp_bufrrr�__init__Is��
�
�

�
��
zSharedMemory.__init__cCs&z|��Wntk
r YnXdS�N)�closer*�r3rrr�__del__�szSharedMemory.__del__cCs|j|jd|jffS)NF)�	__class__r
r5r9rrr�
__reduce__�s��zSharedMemory.__reduce__cCs|jj�d|j�d|j�d�S)N�(z, size=�))r;�__name__r
r5r9rrr�__repr__�szSharedMemory.__repr__cCs|jSr7)r2r9rrr�buf�szSharedMemory.bufcCs.|j}tr*|jr*|j�d�r*|jdd�}|S)Nrr)r#rr$�
startswith)r3Z
reported_namerrrr
�s

zSharedMemory.namecCs|jSr7)r0r9rrrr5�szSharedMemory.sizecCsX|jdk	r|j��d|_|jdk	r4|j��d|_trT|jdkrTt�|j�d|_dS)Nrr)r2�releaser)r8rr!rr9rrrr8�s



zSharedMemory.closecCs2tr.|jr.ddlm}t�|j�||jd�dS)Nr)�
unregisterr)rr#r,rDrZ
shm_unlink)r3rDrrrr+�s
zSharedMemory.unlink)NFr)r?�
__module__�__qualname__r#r!r)r2rrrr rr$r6r:r<r@�propertyrAr
r5r8r+rrrrr0s&
l




�utf8c@seZdZedededededdjdiZ	dZ
dd	�d
d	�dd	�dd	�d
�Zedd��Z
d5dd�dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zed#d$��Zed%d&��Zed'd(��Zed)d*��Zed+d,��Zed-d.��Zed/d0��Zd1d2�Zd3d4�Z dS)6r�q�dzxxxxxxx?z%dsNzxxxxxx?x�cCs|Sr7r��valuerrr�<lambda>
�zShareableList.<lambda>cCs|�d��t�S�N�)�rstrip�decode�	_encodingrLrrrrNrOcCs
|�d�SrP)rRrLrrrrNrOcCsdSr7r)Z_valuerrrrN
rO)rrr�cCs:t|ttdjf�sdSt|t�r$dSt|t�r2dSdSdS)NrrrrU)�
isinstance�str�bytesr;rLrrr�_extract_recreation_codes

z&ShareableList._extract_recreation_code�r
csr|dk	rv�fdd�|D�}t|��_t�fdd�|D���_�fdd�|D�}t�d�jd�|��j�j	�}nd}|dk	r�|dkr�t
|��_nt
|d	|d
��_|dk	�rNt�tj
d�j�jjd�jf�j��tj
d�|��jj�jf�fdd�|D���tj
�j�jj�jf�fd
d�|D���tj
�j	�jj�jf|��n t���_t��j�jjd��_dS)NcsPg|]H}t|ttf�s$�jt|�n&�jt|��jt|��jdf�qS)r)rVrWrX�_types_mapping�type�
_alignmentr	��.0�itemr9rr�
<listcomp> s���z*ShareableList.__init__.<locals>.<listcomp>c3s0|](}|ddkr�jnt|dd��VqdS)r�sN)r]�int)r_�fmtr9rr�	<genexpr>*s�z)ShareableList.__init__.<locals>.<genexpr>csg|]}��|��qSr)rYr^r9rrra.srI�rKT)r4r5rc3s&|]}t|t�r|���n|VqdSr7)rVrW�encode�r_�v��_encrrreMsc3s|]}|���VqdSr7)rgrhrjrrreSs)r	�	_list_len�tuple�_allocated_bytes�structZcalcsize�_format_size_metainfo�join�_format_packing_metainfo�_format_back_transform_codesr�shmrT�	pack_intorA�_offset_data_start�_offset_packing_formats�_offset_back_transform_codes�unpack_from)r3Zsequencer
Z_formatsZ_recreation_codesZrequested_sizer)rkr3rr6sz
�
�

�����
��������
�zShareableList.__init__cCsj|dkr|n||j}||jks*|jdkr2td��t�d|jj|j|d�d}|�d�}|�t	�}|S)Nr� Requested position out of range.�8srKrQ)
rl�
IndexErrorroryrtrArwrRrSrT)r3�positionrird�
fmt_as_strrrr�_get_packing_formatds��

z!ShareableList._get_packing_formatcCs\|dkr|n||j}||jks*|jdkr2td��t�d|jj|j|�d}|j|}|S)Nrrz�b)rlr|roryrtrArx�_back_transforms_mapping)r3r}�transform_codeZtransform_functionrrr�_get_back_transformts��
z!ShareableList._get_back_transformcCs~|dkr|n||j}||jks*|jdkr2td��t�d|jj|j|d|�t��|�	|�}t�d|jj|j
||�dS)Nrrzr{rKr�)rlr|rorurtrArwrgrTrYrx)r3r}r~rMr�rrr�!_set_packing_format_and_transform�s �
�z/ShareableList._set_packing_format_and_transformcCsjz6|jt|jd|��}t�|�|�|jj|�\}Wntk
rRtd��YnX|�	|�}||�}|S)Nzindex out of range)
rv�sumrnroryrrtrAr|r�)r3r}�offsetriZback_transformrrr�__getitem__�s��

zShareableList.__getitem__cCs�z&|jt|jd|��}|�|�}Wntk
rBtd��YnXt|ttf�sf|jt	|�}|}nZt|t�rz|�
t�n|}t|�|j|kr�t
d��|ddkr�|}n|jt|j|f}|�|||�t�||jj||�dS)Nzassignment index out of rangez(bytes/str item exceeds available storagerrb)rvr�rnrr|rVrWrXr[r\rgrTr	rr�rorurtrA)r3r}rMr�Zcurrent_formatZ
new_formatZ
encoded_valuerrr�__setitem__�s6�����zShareableList.__setitem__cCst|j|jjd�dfS)NrZr)rr;rtr
r9rrrr<�szShareableList.__reduce__cCst�d|jjd�dS)NrIr)roryrtrAr9rrr�__len__�szShareableList.__len__cCs"|jj�dt|��d|jj�d�S)Nr=z, name=r>)r;r?�listrtr
r9rrrr@�szShareableList.__repr__csd��fdd�t�j�D��S)Nrfc3s|]}��|�VqdSr7)r)r_�ir9rrre�sz'ShareableList.format.<locals>.<genexpr>)rq�rangerlr9rr9r�format�s�zShareableList.formatcCs|j�d�S)NrI�rlr9rrrrp�sz#ShareableList._format_size_metainfocCs
d|jS)Nr{r�r9rrrrr�sz&ShareableList._format_packing_metainfocCs
d|jS)Nr�r�r9rrrrs�sz*ShareableList._format_back_transform_codescCs|jddS)NrrKr�r9rrrrv�sz ShareableList._offset_data_startcCs|jt|j�Sr7)rvr�rnr9rrrrw�sz%ShareableList._offset_packing_formatscCs|j|jdS)NrK)rwrlr9rrrrx�sz*ShareableList._offset_back_transform_codescst�fdd�|D��S)Nc3s|]}�|kVqdSr7r)r_�entryrLrrre�sz&ShareableList.count.<locals>.<genexpr>)r�)r3rMrrLr�count�szShareableList.countcCs4t|�D]\}}||kr|Sqt|�d���dS)Nz not in this container)�	enumerater)r3rMr}r�rrr�index�s
zShareableList.index)N)!r?rErFrc�float�boolrWrXr;r[r]r��staticmethodrYr6rr�r�r�r�r<r�r@rGr�rprrrsrvrwrxr�r�rrrrr�s\��

F






)�__all__�	functoolsrr(rr.rorr
r-rr�O_CREATrrrr
rrrTrrrrr�<module>s*

Emultiprocessing/__pycache__/heap.cpython-38.opt-2.pyc000064400000016411151153537440016523 0ustar00U

e5dj-�@s�ddlZddlmZddlZddlZddlZddlZddlZddlm	Z	m
Z
ddlmZdgZ
ejdkr�ddlZGdd	�d	e�Zn,Gd
d	�d	e�Zdd�Zd
d�Ze	�ee�Gdd�de�ZGdd�de�ZdS)�N)�defaultdict�)�	reduction�assert_spawning)�util�
BufferWrapperZwin32c@s,eZdZe��Zdd�Zdd�Zdd�ZdS)�ArenacCsx||_td�D]B}dt��t|j�f}tjd||d�}t��dkrHqZ|�	�qt
d��||_||_|j|jf|_
dS)N�dz	pym-%d-%s����ZtagnamerzCannot find name for new mmap)�size�range�os�getpid�next�_rand�mmap�_winapiZGetLastError�close�FileExistsError�name�buffer�_state)�selfr�irZbuf�r�,/usr/lib64/python3.8/multiprocessing/heap.py�__init__&s
�Arena.__init__cCst|�|jS�N)rr)rrrr�__getstate__5szArena.__getstate__cCs,|\|_|_|_tjd|j|jd�|_dS)Nr
r)rrrrr)r�staterrr�__setstate__9szArena.__setstate__N)	�__name__�
__module__�__qualname__�tempfileZ_RandomNameSequencerrr r"rrrrrsrc@s4eZdZejdkrdgZngZd	dd�Zdd�ZdS)
rZlinuxz/dev/shmr
cCsx||_||_|dkrbtjdt��|�|�d�\|_}t�|�t�	|tj
|jf�t�|j|�t�|j|j�|_
dS)Nr
zpym-%d-)�prefix�dir)r�fdr&Zmkstemprr�_choose_dir�unlinkr�Finalizer�	ftruncaterr)rrr)rrrrrMs
�
rcCs6|jD]&}t�|�}|j|j|kr|Sqt��Sr)�_dir_candidatesr�statvfs�f_bavail�f_frsizerZget_temp_dir)rr�d�strrrr*[s



zArena._choose_dirN)r
)r#r$r%�sys�platformr.rr*rrrrrCs


cCs(|jdkrtd��t|jt�|j�ffS)Nr
zDArena is unpicklable because forking was enabled when it was created)r)�
ValueError�
rebuild_arenarrZDupFd)�arrr�reduce_arenads
r9cCst||���Sr)r�detach)rZdupfdrrrr7jsr7c@szeZdZdZdZdZejfdd�Ze	dd��Z
dd�Zd	d
�Zdd�Z
d
d�Zdd�Zdd�Zdd�Zdd�Zdd�ZdS)�Heap�i@cCsXt��|_t��|_||_g|_i|_i|_	i|_
tt�|_
g|_g|_d|_d|_dS�Nr)rr�_lastpid�	threadingZLock�_lock�_size�_lengths�_len_to_seq�_start_to_block�_stop_to_blockr�set�_allocated_blocks�_arenas�_pending_free_blocks�
_n_mallocs�_n_frees)rrrrrr{s


z
Heap.__init__cCs|d}|||@S)Nrr)�nZ	alignment�maskrrr�_roundup�sz
Heap._roundupcCsZ|�t|j|�tj�}|j|jkr0|jd9_t�d|�t|�}|j	�
|�|d|fS)N�z"allocating a new mmap of length %dr)rN�maxrAr�PAGESIZE�_DOUBLE_ARENA_SIZE_UNTILr�inforrH�append)rr�length�arenarrr�
_new_arena�szHeap._new_arenacCsz|j}||jkrdS|j�|�}|j|df=|j||f=|j�|�|j|}|�|d|f�|sv|j|=|j	�|�dSr=)
r�_DISCARD_FREE_SPACE_LARGER_THANrG�poprDrErH�removerCrB)rrVrU�blocks�seqrrr�_discard_arena�s

zHeap._discard_arenac	Cs|t�|j|�}|t|j�kr&|�|�S|j|}|j|}|��}|sV|j|=|j|=|\}}}|j||f=|j||f=|Sr)	�bisectZbisect_leftrB�lenrWrCrYrDrE)	rrrrUr\�blockrV�start�stoprrr�_malloc�s



zHeap._mallocc	Cs�|\}}}z|j||f}Wntk
r0YnX|�|�\}}z|j||f}Wntk
rfYnX|�|�\}}|||f}||}z|j|�|�Wn.tk
r�|g|j|<t�|j|�YnX||j||f<||j||f<dSr)	rE�KeyError�_absorbrDrCrTr^ZinsortrB)	rr`rVrarbZ
prev_block�_Z
next_blockrUrrr�_add_free_block�s(

zHeap._add_free_blockcCs^|\}}}|j||f=|j||f=||}|j|}|�|�|sV|j|=|j�|�||fSr)rDrErCrZrB)rr`rVrarbrUr\rrrre�s


zHeap._absorbcCs4|\}}}|j|}|�||f�|s0|�|�dSr)rGrZr])rr`rVrarbr[rrr�_remove_allocated_block�s


zHeap._remove_allocated_blockcCsBz|j��}Wntk
r&Yq>YnX|�|�|�|�qdSr)rIrY�
IndexErrorrgrh�rr`rrr�_free_pending_blockss

zHeap._free_pending_blockscCs~t��|jkr$td�t��|j���|j�d�s>|j�|�n<z.|j
d7_
|��|�|�|�
|�W5|j�	�XdS)Nz$My pid ({0:n}) is not last pid {1:n}Fr)rrr>r6�formatr@�acquirerIrT�releaserKrkrgrhrjrrr�frees
��
z	Heap.freec
Cs�|dkrtd�|���tj|kr.td�|���t��|jkrD|��|j	��|j
d7_
|��|�t
|d�|j�}|�|�\}}}||}||kr�|�|||f�|j|�||f�|||fW5QR�SQRXdS)Nr�Size {0:n} out of range�Size {0:n} too larger)r6rlr4�maxsize�
OverflowErrorrrr>rr@rJrkrNrP�
_alignmentrcrgrG�add)rrrVrarbZ	real_stoprrr�malloc(s 
zHeap.mallocN)r#r$r%rtrXrRrrQr�staticmethodrNrWr]rcrgrerhrkrorvrrrrr;ss

r;c@s"eZdZe�Zdd�Zdd�ZdS)rcCs^|dkrtd�|���tj|kr.td�|���tj�|�}||f|_t	j
|tjj|fd�dS)Nrrprq)�args)r6rlr4rrrsr�_heaprvrrr,ro)rrr`rrrrFs

zBufferWrapper.__init__cCs&|j\\}}}}t|j�|||�Sr)r�
memoryviewr)rrVrarbrrrr�create_memoryviewOszBufferWrapper.create_memoryviewN)r#r$r%r;ryrr{rrrrrBs	)r^�collectionsrrrr4r&r?�contextrr�r�__all__r5r�objectrr9r7�registerr;rrrrr�<module>
s&
$!Pmultiprocessing/__pycache__/pool.cpython-38.opt-1.pyc000064400000060621151153537440016560 0ustar00U

e5d�~�@sdddgZddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddl
mZm
Z
ddlmZd	Zd
ZdZdZe��Zd
d�Zdd�ZGdd�de�ZGdd�d�Zdd�ZGdd�de�Zd+dd�Zdd�ZGdd �d e�Z Gd!d�de!�Z"Gd"d#�d#e!�Z#e#Z$Gd$d%�d%e#�Z%Gd&d'�d'e!�Z&Gd(d)�d)e&�Z'Gd*d�de"�Z(dS),�Pool�
ThreadPool�N)�Empty�)�util)�get_context�TimeoutError)�wait�INIT�RUN�CLOSE�	TERMINATEcCstt|��S�N)�list�map��args�r�,/usr/lib64/python3.8/multiprocessing/pool.py�mapstar/srcCstt�|d|d��S)Nrr)r�	itertools�starmaprrrr�starmapstar2src@seZdZdd�Zdd�ZdS)�RemoteTracebackcCs
||_dSr��tb)�selfrrrr�__init__:szRemoteTraceback.__init__cCs|jSrr�rrrr�__str__<szRemoteTraceback.__str__N)�__name__�
__module__�__qualname__rrrrrrr9src@seZdZdd�Zdd�ZdS)�ExceptionWithTracebackcCs0t�t|�||�}d�|�}||_d||_dS)N�z

"""
%s""")�	traceback�format_exception�type�join�excr)rr)rrrrr@s
zExceptionWithTraceback.__init__cCst|j|jffSr)�rebuild_excr)rrrrr�
__reduce__Esz!ExceptionWithTraceback.__reduce__N)r r!r"rr+rrrrr#?sr#cCst|�|_|Sr)r�	__cause__)r)rrrrr*Hs
r*cs0eZdZdZ�fdd�Zdd�Zdd�Z�ZS)�MaybeEncodingErrorzVWraps possible unpickleable errors, so they can be
    safely sent through the socket.cs.t|�|_t|�|_tt|��|j|j�dSr)�reprr)�value�superr-r)rr)r/��	__class__rrrTs

zMaybeEncodingError.__init__cCsd|j|jfS)Nz(Error sending result: '%s'. Reason: '%s')r/r)rrrrrYs�zMaybeEncodingError.__str__cCsd|jj|fS)Nz<%s: %s>)r2r rrrr�__repr__]szMaybeEncodingError.__repr__)r r!r"�__doc__rrr3�
__classcell__rrr1rr-Psr-rFc
Cs�|dk	r(t|t�r|dks(td�|���|j}|j}t|d�rR|j��|j	��|dk	rb||�d}|dks~|�r�||k�r�z
|�}	Wn(t
tfk
r�t�
d�Y�q�YnX|	dkr�t�
d��q�|	\}
}}}
}zd||
|�f}WnHtk
�r0}z(|�r|tk	�rt||j�}d|f}W5d}~XYnXz||
||f�WnRtk
�r�}z2t||d�}t�
d	|�||
|d|ff�W5d}~XYnXd}	}
}}}
}|d7}qft�
d
|�dS)NrzMaxtasks {!r} is not valid�_writerrz)worker got EOFError or OSError -- exitingzworker got sentinel -- exitingTFz0Possible encoding error while sending result: %szworker exiting after %d tasks)�
isinstance�int�AssertionError�format�put�get�hasattrr6�close�_reader�EOFError�OSErrorr�debug�	Exception�_helper_reraises_exceptionr#�
__traceback__r-)�inqueue�outqueue�initializer�initargsZmaxtasks�wrap_exceptionr;r<Z	completed�task�job�i�funcr�kwds�result�e�wrappedrrr�workerasN�





�$
rScCs|�dS)z@Pickle-able helper function for use by _guarded_task_generation.Nr)ZexrrrrD�srDcs2eZdZdZdd��fdd�
Z�fdd�Z�ZS)�
_PoolCachez�
    Class that implements a cache for the Pool class that will notify
    the pool management threads every time the cache is emptied. The
    notification is done by the use of a queue that is provided when
    instantiating the cache.
    N��notifiercs||_t�j||�dSr)rVr0r)rrVrrOr1rrr�sz_PoolCache.__init__cs t��|�|s|j�d�dSr)r0�__delitem__rVr;)r�itemr1rrrW�sz_PoolCache.__delitem__)r r!r"r4rrWr5rrr1rrT�srTc@s�eZdZdZdZedd��ZdLdd�Zej	e
fd	d
�Zdd�Zd
d�Z
edd��Zedd��Zdd�Zedd��Zedd��Zdd�Zdd�Zdifdd�ZdMdd �ZdNd!d"�ZdOd#d$�Zd%d&�ZdPd(d)�ZdQd*d+�Zdiddfd,d-�ZdRd.d/�ZdSd0d1�ZedTd2d3��Ze d4d5��Z!ed6d7��Z"ed8d9��Z#ed:d;��Z$d<d=�Z%d>d?�Z&d@dA�Z'dBdC�Z(edDdE��Z)e dFdG��Z*dHdI�Z+dJdK�Z,dS)UrzS
    Class which supports an async version of applying functions to arguments.
    TcOs|j||�Sr��Process)�ctxrrOrrrrZ�szPool.ProcessNrcCsg|_t|_|pt�|_|��t��|_|j��|_	t
|j	d�|_||_||_
||_|dkrjt��phd}|dkrztd��|dk	r�t|�s�td��||_z|��WnHtk
r�|jD]}|jdkr�|��q�|jD]}|��q؂YnX|��}tjtj|j|j|j|j|j|j|j |j!|j
|j|j|j"||j	fd�|_#d|j#_$t%|j#_|j#�&�tjtj'|j|j(|j!|j|jfd�|_)d|j)_$t%|j)_|j)�&�tjtj*|j!|j+|jfd�|_,d|j,_$t%|j,_|j,�&�t-j.||j/|j|j |j!|j|j	|j#|j)|j,|jf	dd�|_0t%|_dS)	NrUrz&Number of processes must be at least 1zinitializer must be a callable��targetrT�)rZexitpriority)1�_poolr
�_stater�_ctx�
_setup_queues�queue�SimpleQueue�
_taskqueue�_change_notifierrT�_cache�_maxtasksperchild�_initializer�	_initargs�os�	cpu_count�
ValueError�callable�	TypeError�
_processes�_repopulate_poolrC�exitcode�	terminater(�_get_sentinels�	threadingZThreadr�_handle_workersrZ�_inqueue�	_outqueue�_wrap_exception�_worker_handler�daemonr�start�
_handle_tasks�
_quick_put�
_task_handler�_handle_results�
_quick_get�_result_handlerrZFinalize�_terminate_pool�
_terminate)r�	processesrHrI�maxtasksperchild�context�p�	sentinelsrrrr�s�





��
��
�
��z
Pool.__init__cCs>|j|kr:|d|��t|d�t|dd�dk	r:|j�d�dS)Nz&unclosed running multiprocessing pool )�sourcerf)r`�ResourceWarning�getattrrfr;)rZ_warnrrrr�__del__s

�zPool.__del__c	Cs0|j}d|j�d|j�d|j�dt|j��d�	S)N�<�.z state=z pool_size=�>)r2r!r"r`�lenr_)r�clsrrrr3sz
Pool.__repr__cCs|jjg}|jjg}||�Sr)rxr?rf)rZtask_queue_sentinelsZself_notifier_sentinelsrrrrts

zPool._get_sentinelscCsdd�|D�S)NcSsg|]}t|d�r|j�qS)�sentinel)r=r�)�.0rSrrr�
<listcomp>s
�z.Pool._get_worker_sentinels.<locals>.<listcomp>r�Zworkersrrr�_get_worker_sentinelss�zPool._get_worker_sentinelscCsPd}ttt|���D]6}||}|jdk	rt�d|�|��d}||=q|S)z�Cleanup after any worker processes which have exited due to reaching
        their specified lifetime.  Returns True if any workers were cleaned up.
        FN�cleaning up worker %dT)�reversed�ranger�rrrrBr()�poolZcleanedrMrSrrr�_join_exited_workerss
zPool._join_exited_workerscCs0|�|j|j|j|j|j|j|j|j|j	|j
�
Sr)�_repopulate_pool_staticrarZrpr_rwrxrirjrhryrrrrrq.s�zPool._repopulate_poolc

Csft|t|��D]P}
||t||||||	fd�}|j�dd�|_d|_|��|�|�t�	d�qdS)z�Bring the number of pool processes up to the specified number,
        for use after reaping workers which have exited.
        r\rZZ
PoolWorkerTzadded workerN)
r�r�rS�name�replacer{r|�appendrrB)r[rZr�r�rFrGrHrIr�rJrM�wrrrr�7s��
zPool._repopulate_pool_staticc

Cs*t�|�r&t�||||||||||	�
dS)zEClean up any exited workers and start replacements for them.
        N)rr�r�)
r[rZr�r�rFrGrHrIr�rJrrr�_maintain_poolJs
�zPool._maintain_poolcCs4|j��|_|j��|_|jjj|_|jjj|_	dSr)
rardrwrxr6�sendr~r?�recvr�rrrrrbVszPool._setup_queuescCs|jtkrtd��dS)NzPool not running)r`rrmrrrr�_check_running\s
zPool._check_runningcCs|�|||���S)zT
        Equivalent of `func(*args, **kwds)`.
        Pool must be running.
        )�apply_asyncr<)rrNrrOrrr�apply`sz
Pool.applycCs|�||t|���S)zx
        Apply `func` to each element in `iterable`, collecting the results
        in a list that is returned.
        )�
_map_asyncrr<�rrN�iterable�	chunksizerrrrgszPool.mapcCs|�||t|���S)z�
        Like `map()` method but the elements of the `iterable` are expected to
        be iterables as well and will be unpacked as arguments. Hence
        `func` and (a, b) becomes func(a, b).
        )r�rr<r�rrrrnszPool.starmapcCs|�||t|||�S)z=
        Asynchronous version of `starmap()` method.
        )r�r�rrNr�r��callback�error_callbackrrr�
starmap_asyncvs�zPool.starmap_asyncc
csjz,d}t|�D]\}}||||fifVqWn8tk
rd}z||dt|fifVW5d}~XYnXdS)z�Provides a generator of tasks for imap and imap_unordered with
        appropriate handling for iterables which throw exceptions during
        iteration.���rN)�	enumeraterCrD)rZ
result_jobrNr�rM�xrQrrr�_guarded_task_generation~szPool._guarded_task_generationrcCs�|��|dkr:t|�}|j�|�|j||�|jf�|S|dkrPtd�|���t	�
|||�}t|�}|j�|�|jt|�|jf�dd�|D�SdS)zP
        Equivalent of `map()` -- can be MUCH slower than `Pool.map()`.
        rzChunksize must be 1+, not {0:n}css|]}|D]
}|Vq
qdSrr�r��chunkrXrrr�	<genexpr>�szPool.imap.<locals>.<genexpr>N)r��IMapIteratorrer;r��_job�_set_lengthrmr:r�
_get_tasksr�rrNr�r�rP�task_batchesrrr�imap�s4�������z	Pool.imapcCs�|��|dkr:t|�}|j�|�|j||�|jf�|S|dkrPtd�|���t	�
|||�}t|�}|j�|�|jt|�|jf�dd�|D�SdS)zL
        Like `imap()` method but ordering of results is arbitrary.
        rzChunksize must be 1+, not {0!r}css|]}|D]
}|Vq
qdSrrr�rrrr��sz&Pool.imap_unordered.<locals>.<genexpr>N)r��IMapUnorderedIteratorrer;r�r�r�rmr:rr�rr�rrr�imap_unordered�s0������zPool.imap_unorderedcCs6|��t|||�}|j�|jd|||fgdf�|S)z;
        Asynchronous version of `apply()` method.
        rN)r��ApplyResultrer;r�)rrNrrOr�r�rPrrrr��szPool.apply_asynccCs|�||t|||�S)z9
        Asynchronous version of `map()` method.
        )r�rr�rrr�	map_async�s�zPool.map_asyncc
Cs�|��t|d�st|�}|dkrJtt|�t|j�d�\}}|rJ|d7}t|�dkrZd}t�|||�}t||t|�||d�}	|j	�
|�|	j||�df�|	S)zY
        Helper function to implement map, starmap and their async counterparts.
        �__len__N�rr�r�)
r�r=r�divmodr�r_rr��	MapResultrer;r�r�)
rrNr�Zmapperr�r�r�Zextrar�rPrrrr��s,
����zPool._map_asynccCs"t||d�|��s|��qdS)N)�timeout)r	�emptyr<)r��change_notifierr�rrr�_wait_for_updates�szPool._wait_for_updatescCspt��}|jtks |rX|jtkrX|�|||||||	|
||�
|�|�|
�}|�||�q|�d�t	�
d�dS)Nzworker handler exiting)ru�current_threadr`rr
r�r�r�r;rrB)r��cache�	taskqueuer[rZr�r�rFrGrHrIr�rJr�r��threadZcurrent_sentinelsrrrrv�s�
zPool._handle_workersc

Cspt��}t|jd�D]�\}}d}z�|D]�}|jtkrBt�d�q�z||�Wq&tk
r�}
zB|dd�\}	}z||	�	|d|
f�Wnt
k
r�YnXW5d}
~
XYq&Xq&|r�t�d�|r�|dnd}||d�W�qW�
�q
W5d}}}	Xqt�d�z6t�d�|�d�t�d	�|D]}|d��q.Wn tk
�r`t�d
�YnXt�d�dS)Nz'task handler found thread._state != RUN�Fzdoing set_length()rr�ztask handler got sentinelz/task handler sending sentinel to result handlerz(task handler sending sentinel to workersz/task handler got OSError when sending sentinelsztask handler exiting)
rur��iterr<r`rrrBrC�_set�KeyErrorr;rA)
r�r;rGr�r�r�ZtaskseqZ
set_lengthrKrLrQ�idxr�rrrr}sB






zPool._handle_tasksc	Cs�t��}z
|�}Wn$ttfk
r6t�d�YdSX|jtkrNt�d�q�|dkrbt�d�q�|\}}}z||�||�Wnt	k
r�YnXd}}}q|�r@|jt
k�r@z
|�}Wn$ttfk
r�t�d�YdSX|dk�r�t�d�q�|\}}}z||�||�Wnt	k
�r0YnXd}}}q�t|d��r�t�d�z,td�D]}|j
���sv�q�|��q`Wnttfk
�r�YnXt�dt|�|j�dS)	Nz.result handler got EOFError/OSError -- exitingz,result handler found thread._state=TERMINATEzresult handler got sentinelz&result handler ignoring extra sentinelr?z"ensuring that outqueue is not full�
z7result handler exiting: len(cache)=%s, thread._state=%s)rur�rAr@rrBr`rr�r�r
r=r�r?�pollr�)rGr<r�r�rKrLrM�objrrrr�:s\











�zPool._handle_resultsccs0t|�}tt�||��}|s dS||fVqdSr)r��tupler�islice)rN�it�sizer�rrrr�vs
zPool._get_taskscCstd��dS)Nz:pool objects cannot be passed between processes or pickled)�NotImplementedErrorrrrrr+s�zPool.__reduce__cCs2t�d�|jtkr.t|_t|j_|j�d�dS)Nzclosing pool)rrBr`rrrzrfr;rrrrr>�s


z
Pool.closecCst�d�t|_|��dS)Nzterminating pool)rrBr
r`r�rrrrrs�s
zPool.terminatecCsjt�d�|jtkrtd��n|jttfkr4td��|j��|j	��|j
��|jD]}|��qXdS)Nzjoining poolzPool is still runningzIn unknown state)rrBr`rrmrr
rzr(rr�r_)rr�rrrr(�s






z	Pool.joincCs@t�d�|j��|��r<|j��r<|j��t�	d�qdS)Nz7removing tasks from inqueue until task handler finishedr)
rrBZ_rlock�acquire�is_aliver?r�r��time�sleep)rF�task_handlerr�rrr�_help_stuff_finish�s



zPool._help_stuff_finishc
CsXt�d�t|_|�d�t|_t�d�|�||t|��|��sXt|	�dkrXtd��t|_|�d�|�d�t�d�t	�
�|k	r�|��|r�t|dd�r�t�d�|D]}
|
j
dkr�|
��q�t�d�t	�
�|k	r�|��t�d	�t	�
�|k	�r|��|�rTt|dd��rTt�d
�|D](}
|
���r*t�d|
j�|
���q*dS)Nzfinalizing poolz&helping task handler/workers to finishrz.Cannot have cache with result_hander not alivezjoining worker handlerrszterminating workerszjoining task handlerzjoining result handlerzjoining pool workersr�)rrBr
r`r;r�r�r�r9rur�r(r=rrrs�pid)r�r�rFrGr�r�Zworker_handlerr�Zresult_handlerr�r�rrrr��sB


�









zPool._terminate_poolcCs|��|Sr)r�rrrr�	__enter__�szPool.__enter__cCs|��dSr)rs)r�exc_typeZexc_valZexc_tbrrr�__exit__�sz
Pool.__exit__)NNrNN)N)N)NNN)r)r)NNN)NNN)N)-r r!r"r4ry�staticmethodrZr�warnings�warnrr�r3rtr�r�rqr�r�rbr�r�rrr�r�r�r�r�r�r�r��classmethodrvr}r�r�r+r>rsr(r�r�r�r�rrrrr�sx
�
P

	



�


�

�
�


-
;


5c@s@eZdZdd�Zdd�Zdd�Zddd	�Zdd
d�Zdd
�ZdS)r�cCs>||_t��|_tt�|_|j|_||_||_	||j|j<dSr)
r_ruZEvent�_event�next�job_counterr�rg�	_callback�_error_callback)rr�r�r�rrrr�s

zApplyResult.__init__cCs
|j��Sr)r�Zis_setrrrr�ready�szApplyResult.readycCs|��std�|���|jS)Nz{0!r} not ready)r�rmr:�_successrrrr�
successful�szApplyResult.successfulNcCs|j�|�dSr)r�r	�rr�rrrr	�szApplyResult.waitcCs,|�|�|��st�|jr"|jS|j�dSr)r	r�rr��_valuer�rrrr<�s
zApplyResult.getcCsZ|\|_|_|jr$|jr$|�|j�|jr<|js<|�|j�|j��|j|j=d|_dSr)	r�r�r�r�r��setrgr�r_�rrMr�rrrr�s

zApplyResult._set)N)N)	r r!r"rr�r�r	r<r�rrrrr��s	

	r�c@seZdZdd�Zdd�ZdS)r�cCshtj||||d�d|_dg||_||_|dkrNd|_|j��|j|j	=n||t
||�|_dS)Nr�Tr)r�rr�r��
_chunksize�_number_leftr�r�rgr��bool)rr�r��lengthr�r�rrrrs
�
zMapResult.__init__cCs�|jd8_|\}}|rv|jrv||j||j|d|j�<|jdkr�|jrZ|�|j�|j|j=|j��d|_	nL|s�|jr�d|_||_|jdkr�|j
r�|�
|j�|j|j=|j��d|_	dS)NrrF)r�r�r�r�r�rgr�r�r�r_r�)rrMZsuccess_result�successrPrrrr�$s&







zMapResult._setN)r r!r"rr�rrrrr�s
r�c@s:eZdZdd�Zdd�Zddd�ZeZdd	�Zd
d�ZdS)
r�cCsT||_t�t���|_tt�|_|j|_t	�
�|_d|_d|_
i|_||j|j<dS)Nr)r_ruZ	ConditionZLock�_condr�r�r�rg�collections�deque�_items�_index�_length�	_unsorted)rr�rrrrBs

zIMapIterator.__init__cCs|Srrrrrr�__iter__MszIMapIterator.__iter__NcCs�|j��z|j��}Wnztk
r�|j|jkr>d|_td�|j�|�z|j��}Wn2tk
r�|j|jkr�d|_td�t	d�YnXYnXW5QRX|\}}|r�|S|�dSr)
r�r��popleft�
IndexErrorr�rr_�
StopIterationr	r)rr�rXr�r/rrrr�Ps&zIMapIterator.nextc	Cs�|j��|j|krn|j�|�|jd7_|j|jkrb|j�|j�}|j�|�|jd7_q,|j��n
||j|<|j|jkr�|j|j	=d|_
W5QRXdS�Nr)r�r�r�r�r�pop�notifyrrgr�r_r�rrrr�hs


zIMapIterator._setc	CsB|j�2||_|j|jkr4|j��|j|j=d|_W5QRXdSr)r�rr�rrgr�r_)rr�rrrr�ys

zIMapIterator._set_length)N)	r r!r"rrr��__next__r�r�rrrrr�@s
r�c@seZdZdd�ZdS)r�c	CsV|j�F|j�|�|jd7_|j��|j|jkrH|j|j=d|_W5QRXdSr)	r�r�r�r�rrrgr�r_r�rrrr��s

zIMapUnorderedIterator._setN)r r!r"r�rrrrr��sr�c@sVeZdZdZedd��Zddd�Zdd	�Zd
d�Zedd
��Z	edd��Z
dd�ZdS)rFcOsddlm}|||�S)NrrY)ZdummyrZ)r[rrOrZrrrrZ�szThreadPool.ProcessNrcCst�||||�dSr)rr)rr�rHrIrrrr�szThreadPool.__init__cCs,t��|_t��|_|jj|_|jj|_dSr)rcrdrwrxr;r~r<r�rrrrrb�s


zThreadPool._setup_queuescCs
|jjgSr)rfr?rrrrrt�szThreadPool._get_sentinelscCsgSrrr�rrrr��sz ThreadPool._get_worker_sentinelscCsFz|jdd�qWntjk
r(YnXt|�D]}|�d�q2dS)NF)�block)r<rcrr�r;)rFr�r�rMrrrr��szThreadPool._help_stuff_finishcCst�|�dSr)r�r�)rr�r�r�rrrr��szThreadPool._wait_for_updates)NNr)r r!r"ryr�rZrrbrtr�r�r�rrrrr�s




)NrNF))�__all__r�rrkrcrur�r%r�rr$rrrZ
connectionr	r
rrr
�countr�rrrCrr#r*r-rSrD�dictrT�objectrr�ZAsyncResultr�r�r�rrrrr�<module>
sN	�
-=)+Emultiprocessing/__pycache__/util.cpython-38.opt-1.pyc000064400000026254151153537440016570 0ustar00U

e5d~6�@s�ddlZddlZddlZddlZddlZddlZddlmZddlm	Z	ddddd	d
ddd
ddddddgZ
dZdZdZ
dZdZdZdZdadadd�Zdd�Zdd�Zdd�Zdd	�Zd@d d
�Zd!d"�Zd#d$�Ze�Zd%d&�Zd'd�Ze��Z e�!�Z"d(d)�Z#d*d�Z$iZ%e�!�Z&Gd+d�de'�Z(dAd,d-�Z)d.d
�Z*da+eee)e	j,e	j-fd/d0�Z.e�/e.�Gd1d�de'�Z0Gd2d�dej1�Z2ze�3d3�Z4Wne5k
�r�d4Z4YnXd5d�Z6d6d7�Z7d8d9�Z8d:d;�Z9d<d=�Z:d>d?�Z;dS)B�N)�_args_from_interpreter_flags�)�process�	sub_debug�debug�info�sub_warning�
get_logger�
log_to_stderr�get_temp_dir�register_after_fork�
is_exiting�Finalize�ForkAwareThreadLock�ForkAwareLocal�close_all_fds_except�SUBDEBUG�
SUBWARNING��
���multiprocessingz+[%(levelname)s/%(processName)s] %(message)sFcGstrtjt|f|��dS�N)�_logger�logr��msg�args�r�,/usr/lib64/python3.8/multiprocessing/util.pyr,scGstrtjt|f|��dSr)rr�DEBUGrrrr r0scGstrtjt|f|��dSr)rr�INFOrrrr r4scGstrtjt|f|��dSr)rrrrrrr r8scCs|ddl}|��z\tsj|�t�adt_ttd�rFt�	t
�t�t
�n$tj�
t
dif�tj�t
dif�W5|��XtS)z0
    Returns logger used by multiprocessing
    rN�
unregisterr)�loggingZ_acquireLockZ_releaseLockrZ	getLogger�LOGGER_NAMEZ	propagate�hasattr�atexitr#�_exit_function�registerZ
_exithandlers�remove�append)r$rrr r	<s



cCsJddl}t�}|�t�}|��}|�|�|�|�|rB|�|�dat	S)zB
    Turn on logging and add a handler which prints to stderr
    rNT)
r$r	Z	Formatter�DEFAULT_LOGGING_FORMATZ
StreamHandlerZsetFormatterZ
addHandlerZsetLevel�_log_to_stderrr)�levelr$ZloggerZ	formatterZhandlerrrr r
Ws



cCs tjdkrdSttd�rdSdS)NZlinuxTZgetandroidapilevelF)�sys�platformr&rrrr �#_platform_supports_abstract_socketsls


r1cCs@|sdSt|t�r|ddkSt|t�r4|ddkStd��dS)NFr�z(address type of {address!r} unrecognized)�
isinstance�bytes�str�	TypeError)Zaddressrrr �is_abstract_socket_namespacets

r7cCs&||�t��}|dk	r"d|jd<dS)N�tempdir)r�current_process�_config)�rmtreer8r9rrr �_remove_temp_dir�sr<cCsft��j�d�}|dkrbddl}ddl}|jdd�}td|�tdt	|j
|fdd�|t��jd<|S)Nr8rzpymp-)�prefixzcreated temp directory %si����)r�exitpriority)rr9r:�get�shutil�tempfileZmkdtemprrr<r;)r8r@rArrr r�s
�cCsftt���}|��|D]H\\}}}}z||�Wqtk
r^}ztd|�W5d}~XYqXqdS)Nz after forker raised exception %s)�list�_afterfork_registry�items�sort�	Exceptionr)rD�indexZident�func�obj�errr �_run_after_forkers�srKcCs|ttt�t|�|f<dSr)rC�next�_afterfork_counter�id)rIrHrrr r�sc@sFeZdZdZddd�Zdeeejfdd�Z	dd	�Z
d
d�Zdd
�ZdS)rzA
    Class which supports object finalization using weakrefs
    rNcCs�|dk	r&t|t�s&td�|t|����|dk	r>t�||�|_n|dkrNtd��||_	||_
|p`i|_|tt
�f|_t��|_|t|j<dS)Nz3Exitpriority ({0!r}) must be None or int, not {1!s}z+Without object, exitpriority cannot be None)r3�intr6�format�type�weakref�ref�_weakref�
ValueError�	_callback�_args�_kwargsrL�_finalizer_counter�_key�os�getpid�_pid�_finalizer_registry)�selfrI�callbackr�kwargsr>rrr �__init__�s"��

zFinalize.__init__cCs�z||j=Wntk
r(|d�YnbX|j|�krD|d�d}n$|d|j|j|j�|j|j|j�}d|_|_|_|_|_|SdS)zQ
        Run the callback unless it has already been called or cancelled
        zfinalizer no longer registeredz+finalizer ignored because different processNz/finalizer calling %s with args %s and kwargs %s)rZ�KeyErrorr]rVrWrXrT)r_Zwrr^rr\�resrrr �__call__�s$��zFinalize.__call__cCsDzt|j=Wntk
r Yn Xd|_|_|_|_|_dS)z3
        Cancel finalization of the object
        N)r^rZrcrTrVrWrX�r_rrr �cancel�s��zFinalize.cancelcCs
|jtkS)zS
        Return whether this finalizer is still waiting to invoke callback
        )rZr^rfrrr �still_active�szFinalize.still_activec	Cs�z|��}Wnttfk
r(d}YnX|dkr>d|jjSd|jjt|jd|j�f}|jrr|dt|j�7}|j	r�|dt|j	�7}|j
ddk	r�|dt|j
d�7}|dS)	Nz<%s object, dead>z<%s object, callback=%s�__name__z, args=z	, kwargs=rz, exitpriority=�>)rT�AttributeErrorr6�	__class__ri�getattrrVrWr5rXrZ)r_rI�xrrr �__repr__�s"
�zFinalize.__repr__)rNN)
ri�
__module__�__qualname__�__doc__rbr^rr[r\rergrhrorrrr r�s
�
c	s�tdkrdS�dkrdd��n�fdd���fdd�tt�D�}|jdd�|D]P}t�|�}|dk	rPtd	|�z
|�WqPtk
r�d
dl}|��YqPXqP�dkr�t��dS)z�
    Run all finalizers whose exit priority is not None and at least minpriority

    Finalizers with highest priority are called first; finalizers with
    the same priority will be called in reverse order of creation.
    NcSs|ddk	S�Nrr��prrr �<lambda>�z!_run_finalizers.<locals>.<lambda>cs|ddk	o|d�kSrsrrt)�minpriorityrr rvrwcsg|]}�|�r|�qSrr)�.0�key)�frr �
<listcomp>#sz#_run_finalizers.<locals>.<listcomp>T)�reversez
calling %sr)	r^rBrEr?rrF�	traceback�	print_exc�clear)rx�keysrz�	finalizerr~r)r{rxr �_run_finalizerss$



r�cCstp
tdkS)z6
    Returns true if the process is shutting down
    N)�_exitingrrrr r
8scCs�ts�da|d�|d�|d�|�dk	rr|�D] }|jr0|d|j�|j��q0|�D]}|d|j�|��qX|d�|�dS)NTzprocess shutting downz2running all "atexit" finalizers with priority >= 0rz!calling terminate() for daemon %szcalling join() for process %sz)running the remaining "atexit" finalizers)r�Zdaemon�nameZ_popenZ	terminate�join)rrr��active_childrenr9rurrr r(@s	



r(c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
rcCs|��t|tj�dSr)�_resetrrrfrrr rbqszForkAwareThreadLock.__init__cCs"t��|_|jj|_|jj|_dSr)�	threadingZLock�_lock�acquire�releaserfrrr r�us

zForkAwareThreadLock._resetcCs
|j��Sr)r��	__enter__rfrrr r�zszForkAwareThreadLock.__enter__cGs|jj|�Sr)r��__exit__)r_rrrr r�}szForkAwareThreadLock.__exit__N)rirprqrbr�r�r�rrrr rpsc@seZdZdd�Zdd�ZdS)rcCst|dd��dS)NcSs
|j��Sr)�__dict__r�)rIrrr rv�rwz)ForkAwareLocal.__init__.<locals>.<lambda>)rrfrrr rb�szForkAwareLocal.__init__cCst|�dfS)Nr)rQrfrrr �
__reduce__�szForkAwareLocal.__reduce__N)rirprqrbr�rrrr r�s�SC_OPEN_MAX�cCsNt|�dtg}|��tt|�d�D] }t�||d||d�q(dS)N���r)rB�MAXFDrE�range�lenr[�
closerange)�fds�irrr r�sc	Cs�tjdkrdSztj��Wnttfk
r4YnXz@t�tjtj�}zt|dd�t_Wnt�|��YnXWnttfk
r�YnXdS)NF)�closefd)	r/�stdin�close�OSErrorrUr[�open�devnull�O_RDONLY)�fdrrr �_close_stdin�s

r�c	CsTztj��Wnttfk
r&YnXztj��Wnttfk
rNYnXdSr)r/�stdout�flushrkrU�stderrrrrr �_flush_std_streams�sr�cCsxddl}tttt|���}t��\}}z6|�|t�	|�gd|dddddddd||ddd�W�St�|�t�|�XdS)NrTr�F)
�_posixsubprocess�tuple�sorted�maprOr[�piper�Z	fork_exec�fsencode)�pathrZpassfdsr�Zerrpipe_readZ
errpipe_writerrr �spawnv_passfds�s2
�
r�cGs|D]}t�|�qdS)z/Close each file descriptor given as an argumentN)r[r�)r�r�rrr �	close_fds�sr�cCsZddlm}t��ddlm}|j��ddlm}|j	��t
�|��|��dS)zKCleanup multiprocessing resources when multiprocessing tests
    completed.r)�support)�
forkserver)�resource_trackerN)
Ztestr�rZ_cleanuprr�Z_forkserverZ_stopr�Z_resource_trackerr�Z
gc_collectZ
reap_children)r�r�r�rrr �_cleanup_tests�s

r�)N)N)<r[�	itertoolsr/rRr'r��
subprocessr�r�__all__ZNOTSETrr!r"rr%r,rr-rrrrr	r
r1r7Zabstract_sockets_supportedr<rZWeakValueDictionaryrC�countrMrKrr^rY�objectrr�r
r�r�r9r(r)rZlocalr�sysconfr�rFrr�r�r�r�r�rrrr �<module>
s��

		V
,�
*



multiprocessing/__pycache__/spawn.cpython-38.opt-1.pyc000064400000014757151153537440016750 0ustar00U

e5dP$�@s$ddlZddlZddlZddlZddlmZmZddlmZddlm	Z	ddlm
Z
ddd	d
ddd
gZejdkrzdZ
dZneedd�Z
ej���d�Zer�ej�ejd�anejadd	�Zdd
�Zdd�Zdd�Zdd�Zd&dd�Zdd�Zdd�Zdd�ZgZ dd �Z!d!d"�Z"d#d$�Z#d%d
�Z$dS)'�N�)�get_start_method�set_start_method)�process)�	reduction)�util�_main�freeze_support�set_executable�get_executable�get_preparation_data�get_command_line�import_main_path�win32F�frozenzpythonservice.exez
python.execCs|adS�N��_python_exe)Zexe�r�-/usr/lib64/python3.8/multiprocessing/spawn.pyr
)scCstSrrrrrrr-scCs$t|�dkr|ddkrdSdSdS)z=
    Return whether commandline indicates we are forking
    �r�--multiprocessing-forkTFN)�len)�argvrrr�
is_forking4srcCsdttj�r`i}tjdd�D]0}|�d�\}}|dkr@d||<qt|�||<qtf|�t��dS)zE
    Run code for process object if this in not the main process
    rN�=�None)r�sysr�split�int�
spawn_main�exit)�kwds�arg�name�valuerrrr	>s


cKshttdd�r(tjdgdd�|��D�Sd}|d�dd	�|��D��;}t��}tg|d
|dgSdS)zJ
    Returns prefix of command line used for spawning a child process
    rFrcSsg|]}d|�qS)�%s=%rr��.0�itemrrr�
<listcomp>Tsz$get_command_line.<locals>.<listcomp>z<from multiprocessing.spawn import spawn_main; spawn_main(%s)z, css|]}d|VqdS)r&Nrr'rrr�	<genexpr>Wsz#get_command_line.<locals>.<genexpr>z-cN)�getattrr�
executable�items�joinrZ_args_from_interpreter_flagsr)r"�progZoptsrrrr
Ns�cCs�tjdkr`ddl}ddl}|dk	r:|�|j|jBd|�}nd}tj||d�}|�	|t
j�}|}n"ddlm
}	||	j_|}t
�|�}t||�}
t�|
�dS)z7
    Run code specified by data received over pipe
    rrNF)�source_processr)�resource_tracker)r�platform�msvcrt�_winapiZOpenProcessZSYNCHRONIZEZPROCESS_DUP_HANDLErZ	duplicateZopen_osfhandle�os�O_RDONLY�r2Z_resource_trackerZ_fd�duprr!)Zpipe_handleZ
parent_pidZ
tracker_fdr4r5r1Z
new_handle�fd�parent_sentinelr2Zexitcoderrrr \s*

��

r c	Cs`tj|ddd��@}dt��_z$tj�|�}t|�tj�|�}W5t��`XW5QRX|�	|�S)N�rbT)�closefd)
r6�fdopenr�current_process�_inheritingr�pickle�load�prepare�
_bootstrap)r:r;Zfrom_parentZpreparation_data�selfrrrrxs
cCstt��dd�rtd��dS)Nr@Fa
        An attempt has been made to start a new process before the
        current process has finished its bootstrapping phase.

        This probably means that you are not using fork to start your
        child processes and you have forgotten to use the proper idiom
        in the main module:

            if __name__ == '__main__':
                freeze_support()
                ...

        The "freeze_support()" line can be omitted if the program
        is not going to be frozen to produce an executable.)r,rr?�RuntimeErrorrrrr�_check_not_importing_main�srGcCst�ttjt��jd�}tjdk	r2tj��|d<t	j
��}z|�d�}Wnt
k
r^YnXtj||<|j||t	jtjt��t�d�t	jd}t|jdd�}|dk	r�||d<nft	jd	ks�t�st�st|d
d�}|dk	�rtj
�|��s
tjdk	�r
tj
�tj|�}tj
�|�|d<|S)zM
    Return info about parent needed by child to unpickle process object
    )�
log_to_stderr�authkeyN�	log_levelr8)r$�sys_path�sys_argv�orig_dir�dir�start_method�__main__r$�init_main_from_namer�__file__�init_main_from_path)rG�dictrZ_log_to_stderrrr?rIZ_loggerZgetEffectiveLevelr�path�copy�index�
ValueError�ORIGINAL_DIR�updaterr6�getcwdr�modulesr,�__spec__r3�WINEXE�
WINSERVICE�isabsr/�normpath)r$�drK�i�main_moduleZ
main_mod_name�	main_pathrrrr�sD�


�


�cCs�d|kr|dt��_d|kr,|dt��_d|krD|drDt��d|kr^t���|d�d|krp|dt_	d|kr�|dt_
d|kr�t�|d�d|kr�|dt_
d	|kr�t|d	d
d�d|kr�t|d�nd
|kr�t|d
�dS)zE
    Try to get current process ready to unpickle process object
    r$rIrHrJrKrLrNrMrOT)ZforcerQrSN)rr?r$rIrrHZ
get_loggerZsetLevelrrUrr6�chdirrYr�_fixup_main_from_name�_fixup_main_from_path)�datarrrrC�s,


rCcCs~tjd}|dks|�d�r dSt|jdd�|kr6dSt�|�t�d�}t	j
|ddd�}|j�|�|tjd<tjd<dS)NrPz	.__main__r$�__mp_main__T)�run_nameZ	alter_sys)
rr\�endswithr,r]�old_main_modules�append�types�
ModuleType�runpyZ
run_module�__dict__rZ)Zmod_name�current_mainrd�main_contentrrrrg�s


�rgcCs�tjd}tj�tj�|��d}|dkr.dSt|dd�|krBdSt�|�t	�
d�}tj|dd�}|j
�|�|tjd<tjd<dS)NrPrZipythonrRrj)rk)rr\r6rU�splitext�basenamer,rmrnrorprqZrun_pathrrrZ)rersZ	main_namerdrtrrrrh	s


�rhcCst|�dS)z<
    Set sys.modules['__main__'] to module at main_path
    N)rh)rerrrr%s)NN)%r6rrqror8rrr�contextrr�__all__r3r^r_r,r-�lowerrlrUr/�exec_prefixrr
rrr	r
r rrGrrmrCrgrhrrrrr�<module>sD�


2&multiprocessing/__pycache__/reduction.cpython-38.opt-2.pyc000064400000016451151153537440017606 0ustar00U

e5d(%�@sddlmZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddddd	gZejd
kp�e
ed�o�e
ed�o�e
ejd
�ZGdd�dej�ZejZd6dd	�Zejd
k�redddg7ZddlZd7dd�dd�Zdd�Zdd�Zdd�ZGdd�de�ZnHedddg7ZddlZejdkZdd�Zdd�Zd d�Zd!d�Zd"d�Zd#d$�ZGd%d&�d&�Z ee!e �j"�e�d'd(�Z#ee!e$j%�e#�ee!e&j'�e#�d)d*�Z(d+d,�Z)eej*e(�ejd
k�r�d-d.�Z+d/d0�Z,eeje+�nd1d.�Z+d2d0�Z,eeje+�Gd3d4�d4ed5�Z-dS)8�)�ABCMetaN�)�context�send_handle�recv_handle�ForkingPickler�register�dump�win32ZCMSG_LEN�
SCM_RIGHTS�sendmsgcsFeZdZiZejZ�fdd�Zedd��Z	eddd��Z
ejZ�Z
S)	rcs*t�j|�|j��|_|j�|j�dS�N)�super�__init__�_copyreg_dispatch_table�copy�dispatch_table�update�_extra_reducers��self�args��	__class__��1/usr/lib64/python3.8/multiprocessing/reduction.pyr&szForkingPickler.__init__cCs||j|<dSr
)r)�cls�type�reducerrrr+szForkingPickler.registerNcCs t��}|||��|�|��Sr
)�io�BytesIOr	�	getbuffer)r�obj�protocolZbufrrr�dumps0szForkingPickler.dumps)N)�__name__�
__module__�__qualname__r�copyregrrr�classmethodrr$�pickle�loads�
__classcell__rrrrr!s
cCst||��|�dSr
)rr	)r"�filer#rrrr	:s�	DupHandle�	duplicate�steal_handleF)�source_processcCs6t��}|dkr|}|dkr |}t�|||d|tj�S)Nr)�_winapi�GetCurrentProcess�DuplicateHandle�DUPLICATE_SAME_ACCESS)�handleZtarget_processZinheritabler1Zcurrent_processrrrr/Gs�c	CsFt�tjd|�}z$t�||t��ddtjtjB�W�St�|�XdS�NFr)r2�OpenProcess�PROCESS_DUP_HANDLE�CloseHandler4r3r5�DUPLICATE_CLOSE_SOURCE)Z
source_pidr6Zsource_process_handlerrrr0Ss�
�cCst|tj|�}|�|�dSr
)r.r2r5�send)�connr6�destination_pidZdhrrrr_scCs|����Sr
)�recv�detach)r=rrrrdsc@seZdZddd�Zdd�ZdS)r.Nc	Cs\|dkrt��}t�tjd|�}zt�t��|||dd�|_W5t�|�X||_	||_
dSr7)�os�getpidr2r8r9r:r4r3�_handle�_access�_pid)rr6�access�pid�procrrrrjs�
zDupHandle.__init__c	CsZ|jt��kr|jSt�tjd|j�}z"t�||jt�	�|j
dtj�W�St�|�XdS)NF)rErArBrCr2r8r9r:r4r3rDr;)rrHrrrr@ys
��zDupHandle.detach)N)r%r&r'rr@rrrrr.hs
�DupFd�sendfds�recvfds�darwincCsVt�d|�}tt|�dg�}|�|gtjtj|fg�trR|�d�dkrRt	d��dS)N�i�r�Az%did not receive acknowledgement of fd)
�array�bytes�lenr�socket�
SOL_SOCKETr�ACKNOWLEDGEr?�RuntimeError)�sockZfds�msgrrrrJ�s
c	Cst�d�}|j|}|�dt�|��\}}}}|s:|s:t�z�trJ|�d�t|�dkrft	dt|���|d\}}	}
|tj
kr�|	tjkr�t|
�|jdkr�t�|�
|
�t|�d|dkr�td�t|�|d���t|�WSWnttfk
r�YnXt	d��dS)	NrMrrOzreceived %d items of ancdatarrNz Len is {0:n} but msg[0] is {1!r}zInvalid data received)rP�itemsizeZrecvmsgrSZ
CMSG_SPACE�EOFErrorrUr<rRrVrTr�
ValueErrorZ	frombytes�AssertionError�format�list�
IndexError)rW�size�aZ
bytes_sizerXZancdata�flagsZaddrZ
cmsg_levelZ	cmsg_typeZ	cmsg_datarrrrK�s<


�
�
��c	Cs2t�|��tjtj��}t||g�W5QRXdSr
)rS�fromfd�fileno�AF_UNIX�SOCK_STREAMrJ)r=r6r>�srrrr�sc
Cs<t�|��tjtj��}t|d�dW5QR�SQRXdS)Nrr)rSrcrdrerfrK)r=rgrrrr�scCsFt��}|dk	r |�|�|��Str:ddlm}|�|�Std��dS)Nr)�resource_sharerz&SCM_RIGHTS appears not to be available)rZget_spawning_popenrIZduplicate_for_child�HAVE_SEND_HANDLE�rhr[)�fdZ	popen_objrhrrrrI�s
cCs2|jdkrt|j|jjffSt|j|jjffSdSr
)�__self__�getattrr�__func__r%��mrrr�_reduce_method�s
rqc@seZdZdd�ZdS)�_CcCsdSr
r)rrrr�f�sz_C.fN)r%r&r'rsrrrrrr�srrcCst|j|jffSr
)rm�__objclass__r%rorrr�_reduce_method_descriptor�srucCst|j|j|jpiffSr
)�_rebuild_partial�funcr�keywords)�prrr�_reduce_partial�srzcCstj|f|�|�Sr
)�	functools�partial)rwrrxrrrrv�srvcCsddlm}t||�ffS)Nr)�	DupSocket)rhr}�_rebuild_socket)rgr}rrr�_reduce_socket�srcCs|��Sr
)r@)Zdsrrrr~�sr~cCs"t|���}t||j|j|jffSr
)rIrdr~�familyr�proto)rg�dfrrrr�scCs|��}tj||||d�S)N)rd)r@rS)r�r�rr�rkrrrr~�sc@s`eZdZeZeZeZeZeZej	dkr4e
Z
eZeZne
Z
eZeZeZeZeZeZeZdd�ZdS)�AbstractReducerr
cGsNttt�j�t�tttj�t�tttj	�t�tt
jt�tt
j
t�dSr
)rrrrrsrqr^�appendru�int�__add__r{r|rzrSrrrrrrs
zAbstractReducer.__init__N)r%r&r'rrr	rr�sys�platformr0r/r.rJrKrIrqrurvrr~rrrrrr��s$
r�)�	metaclass)N)NF).�abcrr(r{rrAr*rSr�rjr�__all__r��hasattrriZPicklerrrr	r2r/r0rr�objectr.rPrUrJrKrIrqrrrrsrur^r�r�r�rzrvr|rr~r�rrrr�<module>
sj

�
�	
�#
multiprocessing/__pycache__/forkserver.cpython-38.opt-2.pyc000064400000016550151153537440020002 0ustar00U

e5d�0�@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddl	mZddlm
Z
ddl	mZddl	mZddl	mZd	d
ddgZd
Ze�d�ZGdd�de�Zddd�Zdd�Zdd�Zdd�Ze�ZejZejZejZejZdS)�N�)�
connection)�process)�	reduction)�resource_tracker)�spawn)�util�ensure_running�get_inherited_fds�connect_to_new_process�set_forkserver_preload��qc@sDeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�
ForkServercCs.d|_d|_d|_d|_t��|_dg|_dS)N�__main__)�_forkserver_address�_forkserver_alive_fd�_forkserver_pid�_inherited_fds�	threadingZLock�_lock�_preload_modules��self�r�2/usr/lib64/python3.8/multiprocessing/forkserver.py�__init__"s
zForkServer.__init__c	Cs|j�|��W5QRXdS�N)r�_stop_unlockedrrrr�_stop*szForkServer._stopcCsV|jdkrdSt�|j�d|_t�|jd�d|_t�|j�sLt�|j�d|_dS)Nr)	r�os�closer�waitpidr�is_abstract_socket_namespacer�unlinkrrrrr/s
zForkServer._stop_unlockedcCs&tdd�|jD��std��||_dS)Ncss|]}t|�tkVqdSr)�type�str)�.0�modrrr�	<genexpr>@sz4ForkServer.set_forkserver_preload.<locals>.<genexpr>z&module_names must be a list of strings)�allr�	TypeError)rZ
modules_namesrrrr>sz!ForkServer.set_forkserver_preloadcCs|jSr)rrrrrr
DszForkServer.get_inherited_fdsc
Cs�|��t|�dtkr td��t�tj���}|�|j�t�	�\}}t�	�\}}|||j
t��g}||7}zNz&t�||�||fWW�4W5QR�St�
|�t�
|��YnXW5t�
|�t�
|�XW5QRXdS)N�ztoo many fds)r	�len�MAXFDS_TO_SEND�
ValueError�socket�AF_UNIXZconnectrr �piperrZgetfdr!rZsendfds)r�fdsZclientZparent_r�child_w�child_rZparent_wZallfdsrrrrLs(�


z!ForkServer.connect_to_new_processcs�|j��~t��|jdk	r`t�|jtj�\}}|sBW5QR�dSt�|j�d|_	d|_d|_d}|j
r�ddh�t�d�}�fdd�|�
�D�}ni}t�tj���}t�d�}|�|�t�|�s�t�|d�|��t��\}}ztzV|��|g}	||��||j
|f;}t��}
|
gt��}|d	|g7}t�|
||	�}Wnt�|��YnXW5t�|�X||_	||_||_W5QRXW5QRXdS)
NzCfrom multiprocessing.forkserver import main; main(%d, %d, %r, **%r)�	main_path�sys_path�ignorecsi|]\}}|�kr||�qSrr)r'�x�y�Zdesired_keysrr�
<dictcomp>�sz-ForkServer.ensure_running.<locals>.<dictcomp>r1i�z-c)rrr	rr r"�WNOHANGr!rrrrZget_preparation_data�itemsr0r1rZarbitrary_addressZbindrr#�chmodZlistenr2�filenoZget_executableZ_args_from_interpreter_flagsZspawnv_passfds)r�pidZstatus�cmd�data�listenerZaddress�alive_rZalive_wZfds_to_passZexe�argsrr;rr	isN





�
zForkServer.ensure_runningN)
�__name__�
__module__�__qualname__rrrrr
rr	rrrrr srcCs�|rdd|kr8|dk	r8dt��_zt�|�W5t��`X|D]&}zt|�Wq<tk
r`Yq<Xq<t��t	�
�\}}t	�|d�t	�|d�dd�}tj
|tjtji}	dd�|	��D�}
t�|�i}tjtj|d����}t�����}
|��t_|
�|tj�|
�|tj�|
�|tj��znd	d
�|
��D�}|�r"�qB�q"||k�rPt�||k�rBt	�|d�zt	�dt	j�\}}Wnt k
�r�Y�qBYnX|d
k�r��qB|�!|d�}|dk	�r0t	�"|��r�t	�#|�}n&t	�$|��s�t%d�&||���t	�'|�}zt(||�Wnt)k
�r"YnXt	�*|�nt+�,d|��qf||k�r�|�-�d
��,}t.�/|t0d�}t1|�t0k�r�t2d�&t1|����|^}}}|�*�t	�3�}|d
k�r4d}zpz<|�*�|
�*�||||g}|�5|�6��t7||||
�}Wn.t8k
�r t9j:t9�;��t9j<�=�YnXW5t	�4|�XnNzt(||�Wnt)k
�rXYnX|||<t	�*|�|D]}t	�*|��qpW5QRXWn4t>k
�r�}z|j?t?j@k�r��W5d}~XYnX�qW5QRXW5QRXdS)NrTFcWsdSrr)Z_unusedrrr�sigchld_handler�szmain.<locals>.sigchld_handlercSsi|]\}}|t�||��qSr)�signal)r'�sig�valrrrr<�s�zmain.<locals>.<dictcomp>)r@cSsg|]\}}|j�qSr)Zfileobj)r'�keyZeventsrrr�
<listcomp>�szmain.<locals>.<listcomp>i���rzChild {0:n} status is {1:n}z.forkserver: waitpid returned unexpected pid %drzToo many ({0:n}) fds to send)ArZcurrent_processZ_inheritingrZimport_main_path�
__import__�ImportErrorrZ_close_stdinr r2�set_blockingrK�SIGCHLD�SIGINT�SIG_IGNr>�
set_wakeup_fdr0r1�	selectorsZDefaultSelectorZgetsockname�_forkserverr�registerZ
EVENT_READZselect�
SystemExit�readr"r=�ChildProcessError�pop�WIFSIGNALED�WTERMSIG�	WIFEXITED�AssertionError�format�WEXITSTATUS�write_signed�BrokenPipeErrorr!�warnings�warnZacceptrZrecvfdsr.r-�RuntimeError�fork�_exit�extend�values�
_serve_one�	Exception�sys�
excepthook�exc_info�stderr�flush�OSError�errnoZECONNABORTED)Zlistener_fdrEZpreloadr6r7�modnameZsig_rZsig_wrJ�handlersZold_handlersZ	pid_to_fdrDZselectorZrfdsrA�stsr4�
returncode�sr3r5�code�
unused_fds�fd�errr�main�s�

��
�




��
�

��

�
r�c	Csht�d�|��D]\}}t�||�q|D]}t�|�q,|^t_tj_	t_
t�|�}t�
||�}|S)NrP)rKrWr>r r!rYrrZ_resource_trackerZ_fdr�duprZ_main)	r5r3r}rxrLrMr~Zparent_sentinelr|rrrrn1s
�
rncCsNd}tj}t|�|kr@t�||t|��}|s6td��||7}q
t�|�dS)N�zunexpected EOFr)�
SIGNED_STRUCT�sizer-r r\�EOFErrorZunpack)r~rCZlengthr{rrr�read_signedHs
r�cCs<t�|�}|r8t�||�}|dkr*td��||d�}q
dS)Nrzshould not get here)r�Zpackr �writeri)r~�n�msg�nbytesrrrreRs
re)NN) rvr rXrKr0Zstructrprrg�rr�contextrrrr�__all__r.ZStructr��objectrr�rnr�rerYr	r
rrrrrr�<module>s>�


multiprocessing/__pycache__/__init__.cpython-38.opt-2.pyc000064400000001230151153537440017336 0ustar00U

e5d��@sdddlZddlmZdd�eej�D�Ze��dd�eD��dZd	Z	d
ej
kr`ej
d
ej
d<dS)�N�)�contextcCsg|]}|�d�s|�qS)�_)�
startswith)�.0�x�r�0/usr/lib64/python3.8/multiprocessing/__init__.py�
<listcomp>s
r
ccs|]}|ttj|�fVqdS)N)�getattrr�_default_context)r�namerrr	�	<genexpr>sr���__main__Z__mp_main__)�sys�r�dirr�__all__�globals�updateZSUBDEBUGZ
SUBWARNING�modulesrrrr	�<module>s
multiprocessing/__pycache__/connection.cpython-38.pyc000064400000061266151153537440017015 0ustar00U

&�.ep|�@sddddgZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddl
mZm
Z
dd	lmZejZz$ddlZdd
lmZmZmZmZWn$ek
r�ejdkr‚dZYnXdZd
ZdZe��ZdZdgZe ed��rdZedg7Zejdk�rdZedg7Zefdd�Z!dd�Z"dd�Z#dd�Z$dd�Z%Gdd�d�Z&e�rnGdd�de&�Z'Gd d!�d!e&�Z(Gd"d�de)�Z*dPd#d�Z+ejdk�r�dQd%d�Z,n
dRd&d�Z,Gd'd(�d(e)�Z-d)d*�Z.ejdk�r�Gd+d,�d,e)�Z/d-d.�Z0d/Z1d0Z2d1Z3d2Z4d3d4�Z5d5d6�Z6Gd7d8�d8e)�Z7d9d:�Z8d;d<�Z9Gd=d>�d>e*�Z:d?d@�Z;ejdk�rzdAdB�Z<ej=ej>hZ?dSdCd�Z@n,ddlAZAe eAdD��r�eAjBZCneAjDZCdTdEd�Z@ejdk�r�dFdG�ZEdHdI�ZFe�Ge(eE�dJdK�ZHdLdM�ZIe�Ge'eH�ndNdG�ZEdOdI�ZFe�Ge(eE�dS)U�Client�Listener�Pipe�wait�N�)�util)�AuthenticationError�BufferTooShort)�	reduction)�
WAIT_OBJECT_0�WAIT_ABANDONED_0�WAIT_TIMEOUT�INFINITE�win32i g4@Zsha256�AF_INET�AF_UNIX�AF_PIPEcCst��|S�N��time�	monotonic)�timeout�r�2/usr/lib64/python3.8/multiprocessing/connection.py�
_init_timeout?srcCst��|kSrr)�trrr�_check_timeoutBsrcCsX|dkrdS|dkr&tjdt��d�S|dkrLtjdt��tt�fdd�Std	��d
S)z?
    Return an arbitrary free address for the given family
    r)Z	localhostrrz	listener-)�prefix�dirrz\\.\pipe\pyc-%d-%d-�zunrecognized familyN)	�tempfileZmktemprZget_temp_dir�os�getpid�next�
_mmap_counter�
ValueError��familyrrr�arbitrary_addressIs��r(cCsJtjdkr|dkrtd|��tjdkrF|dkrFtt|�sFtd|��dS)zD
    Checks if the family is valid for the current environment.
    rrzFamily %s is not recognized.rN)�sys�platformr%�hasattr�socketr&rrr�_validate_familyWs

r-cCsTt|�tkrdSt|�tkr*|�d�r*dSt|�tks@t�|�rDdStd|��dS)z]
    Return the types of the address

    This can be 'AF_INET', 'AF_UNIX', or 'AF_PIPE'
    rz\\rrzaddress type of %r unrecognizedN)�type�tuple�str�
startswithr�is_abstract_socket_namespacer%)�addressrrr�address_typecsr4c@s�eZdZdZd+dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	e
dd��Ze
dd��Ze
dd��Z
dd�Zdd�Zd,dd�Zdd�Zd-dd�Zd.d d!�Zd"d#�Zd/d%d&�Zd'd(�Zd)d*�ZdS)0�_ConnectionBaseNTcCs>|��}|dkrtd��|s(|s(td��||_||_||_dS)Nrzinvalid handlez6at least one of `readable` and `writable` must be True)�	__index__r%�_handle�	_readable�	_writable)�self�handle�readable�writablerrr�__init__ys�z_ConnectionBase.__init__cCs|jdk	r|��dSr�r7�_close�r:rrr�__del__�s
z_ConnectionBase.__del__cCs|jdkrtd��dS)Nzhandle is closed)r7�OSErrorrArrr�
_check_closed�s
z_ConnectionBase._check_closedcCs|jstd��dS)Nzconnection is write-only)r8rCrArrr�_check_readable�sz_ConnectionBase._check_readablecCs|jstd��dS)Nzconnection is read-only)r9rCrArrr�_check_writable�sz_ConnectionBase._check_writablecCs"|jrd|_n|��td��dS)NFzbad message length)r9r8�closerCrArrr�_bad_message_length�sz#_ConnectionBase._bad_message_lengthcCs
|jdkS)z True if the connection is closedN�r7rArrr�closed�sz_ConnectionBase.closedcCs|jS)z"True if the connection is readable)r8rArrrr<�sz_ConnectionBase.readablecCs|jS)z"True if the connection is writable)r9rArrrr=�sz_ConnectionBase.writablecCs|��|jS)z+File descriptor or handle of the connection)rDr7rArrr�fileno�sz_ConnectionBase.filenocCs$|jdk	r z|��W5d|_XdS)zClose the connectionNr?rArrrrG�s
z_ConnectionBase.closercCs�|��|��t|�}|jdkr.tt|��}t|�}|dkrFtd��||krVtd��|dkrh||}n&|dkrztd��n|||kr�td��|�||||��dS)z,Send the bytes data from a bytes-like objectrrzoffset is negativezbuffer length < offsetNzsize is negativezbuffer length < offset + size)rDrF�
memoryview�itemsize�bytes�lenr%�_send_bytes)r:�buf�offset�size�m�nrrr�
send_bytes�s"


z_ConnectionBase.send_bytescCs$|��|��|�t�|��dS)zSend a (picklable) objectN)rDrFrP�_ForkingPickler�dumps�r:�objrrr�send�sz_ConnectionBase.sendcCsJ|��|��|dk	r(|dkr(td��|�|�}|dkrB|��|��S)z7
        Receive bytes data as a bytes object.
        Nrznegative maxlength)rDrEr%�_recv_bytesrH�getvalue)r:Z	maxlengthrQrrr�
recv_bytes�s
z_ConnectionBase.recv_bytesc
Cs�|��|��t|���}|j}|t|�}|dkr>td��n||krNtd��|��}|��}|||krvt|�	���|�
d�|�||||||��|W5QR�SQRXdS)zq
        Receive bytes data into a writeable bytes-like object.
        Return the number of bytes read.
        rznegative offsetzoffset too largeN)rDrErLrMrOr%r\�tellr	r]�seek�readinto)r:rQrRrTrMZbytesize�resultrSrrr�recv_bytes_into�s$



�z_ConnectionBase.recv_bytes_intocCs&|��|��|��}t�|���S)zReceive a (picklable) object)rDrEr\rW�loads�	getbuffer)r:rQrrr�recv�sz_ConnectionBase.recv�cCs|��|��|�|�S)z/Whether there is any input available to be read)rDrE�_poll�r:rrrr�pollsz_ConnectionBase.pollcCs|SrrrArrr�	__enter__sz_ConnectionBase.__enter__cCs|��dSr�rG�r:�exc_type�	exc_valueZexc_tbrrr�__exit__
sz_ConnectionBase.__exit__)TT)rN)N)r)rg)�__name__�
__module__�__qualname__r7r>rBrDrErFrH�propertyrJr<r=rKrGrVr[r^rcrfrjrkrprrrrr5vs.








r5c@sDeZdZdZdZejfdd�Zdd�Zddd	�Z	d
d�Z
dd
�ZdS)�PipeConnectionz�
        Connection class based on a Windows named pipe.
        Overlapped I/O is used, so the handles must have been created
        with FILE_FLAG_OVERLAPPED.
        FcCs||j�dSrrI)r:Z_CloseHandlerrrr@szPipeConnection._closec	Cs�tj|j|dd�\}}zHz,|tjkrBt�|jgdt�}|tksBt	�Wn|�
��YnXW5|�d�\}}X|dks|t	�|t|�ks�t	�dS)NT��
overlappedFr)�_winapiZ	WriteFiler7�GetOverlappedResult�ERROR_IO_PENDING�WaitForMultipleObjects�eventrr�AssertionError�cancelrO)r:rQ�ov�errZnwritten�waitresrrrrPs
�zPipeConnection._send_bytesNc	Cs2|jrd|_t��S|dkr dnt|d�}z�tj|j|dd�\}}dzHz,|tjkrpt�
|jgdt�}|tkspt�Wn|���YnXW5|�d�\}}|dkr�t��}|�|�	��|�WS|tj
kr�|�||��WSXWn:tk
�r$}z|jtjk�rt�n�W5d}~XYnXtd��dS)NF�Trvrz.shouldn't get here; expected KeyboardInterrupt)�_got_empty_message�io�BytesIO�minrx�ReadFiler7ry�writereZERROR_MORE_DATA�_get_more_datarzr{r|rrr}r~rC�winerror�ERROR_BROKEN_PIPE�EOFError�RuntimeError)	r:�maxsizeZbsizerr�Znread�fr��errrr\*s>
�

�
zPipeConnection._recv_bytescCs.|jst�|j�ddkrdStt|g|��S)NrT)r�rx�
PeekNamedPiper7�boolrrirrrrhJs
�zPipeConnection._pollcCs�|��}t��}|�|�t�|j�d}|dks6t�|dk	rVt|�||krV|�	�tj
|j|dd�\}}|�d�\}}|dks�t�||ks�t�|�|���|S)NrrTrv)rer�r�r�rxr�r7r}rOrHr�ry)r:rr�rQr��leftr�Zrbytesrrrr�Ps
zPipeConnection._get_more_data)N)rqrrrs�__doc__r�rx�CloseHandler@rPr\rhr�rrrrrus
 ruc@s|eZdZdZer,ejfdd�ZejZ	ej
Znej
fdd�ZejZ	ejZe	fdd�Zefdd�Zd	d
�Zddd
�Zdd�ZdS)�
Connectionzo
    Connection class based on an arbitrary file descriptor (Unix only), or
    a socket handle (Windows).
    cCs||j�dSrrI�r:r@rrrr@gszConnection._closecCs||j�dSrrIr�rrrr@lscCs8t|�}||j|�}||8}|dkr&q4||d�}qdS�Nr)rOr7)r:rQr��	remainingrUrrr�_sendqszConnection._sendcCsbt��}|j}|}|dkr^|||�}t|�}|dkrJ||krBt�ntd��|�|�||8}q|S)Nrzgot end of file during message)r�r�r7rOr�rCr�)r:rS�readrQr;r��chunkrUrrr�_recvzs


zConnection._recvcCs�t|�}|dkrHt�dd�}t�d|�}|�|�|�|�|�|�n8t�d|�}|dkrr|�|�|�|�n|�||�dS)Ni����!i����!Qi@)rO�structZpackr�)r:rQrUZ
pre_header�headerrrrrP�s


zConnection._send_bytesNcCs^|�d�}t�d|���\}|dkr@|�d�}t�d|���\}|dk	rT||krTdS|�|�S)N�r�r��r�)r�r�Zunpackr])r:r�rQrSrrrr\�s

zConnection._recv_bytescCst|g|�}t|�Sr)rr�)r:r�rrrrrh�szConnection._poll)N)rqrrrsr�rx�_multiprocessingZclosesocketr@r[Z_writerfZ_readr!rGr�r�r�r�rPr\rhrrrrr�`s	

r�c@sReZdZdZddd�Zdd�Zdd	�Zed
d��Zedd
��Z	dd�Z
dd�ZdS)rz�
    Returns a listener object.

    This is a wrapper for a bound socket which is 'listening' for
    connections, or for a Windows named pipe.
    NrcCsp|p|rt|�pt}|pt|�}t|�|dkr>t||�|_nt|||�|_|dk	rft|t�sft	d��||_
dS)Nr�authkey should be a byte string)r4�default_familyr(r-�PipeListener�	_listener�SocketListener�
isinstancerN�	TypeError�_authkey)r:r3r'�backlog�authkeyrrrr>�s�zListener.__init__cCs>|jdkrtd��|j��}|jr:t||j�t||j�|S)zz
        Accept a connection on the bound socket or named pipe of `self`.

        Returns a `Connection` object.
        Nzlistener is closed)r�rC�acceptr��deliver_challenge�answer_challenge)r:�crrrr��s

zListener.acceptcCs |j}|dk	rd|_|��dS)zA
        Close the bound socket or named pipe of `self`.
        N)r�rG)r:ZlistenerrrrrG�szListener.closecCs|jjSr)r��_addressrArrrr3�szListener.addresscCs|jjSr)r��_last_acceptedrArrr�
last_accepted�szListener.last_acceptedcCs|SrrrArrrrk�szListener.__enter__cCs|��dSrrlrmrrrrp�szListener.__exit__)NNrN)rqrrrsr�r>r�rGrtr3r�rkrprrrrr�s
	

cCsh|p
t|�}t|�|dkr&t|�}nt|�}|dk	rHt|t�sHtd��|dk	rdt||�t||�|S)z=
    Returns a connection to the address of a `Listener`
    rNr�)	r4r-�
PipeClient�SocketClientr�rNr�r�r�)r3r'r�r�rrrr�s


TcCsj|r>t��\}}|�d�|�d�t|���}t|���}n$t��\}}t|dd�}t|dd�}||fS)�L
        Returns pair of connection objects at either end of a pipe
        TF�r=�r<)r,Z
socketpair�setblockingr��detachr!�pipe)�duplex�s1�s2�c1�c2Zfd1Zfd2rrrrs

c

Cs�td�}|r*tj}tjtjB}tt}}ntj}tj}dt}}t�||tjBtj	Btj
tjBtjBd||tj
tj�}t�||dtjtjtjtj�}t�|tjdd�tj|dd�}|�d�\}	}
|
dks�t�t||d�}t||d�}||fS)	r�rrrNTrvr�r�)r(rx�PIPE_ACCESS_DUPLEX�GENERIC_READ�
GENERIC_WRITE�BUFSIZEZPIPE_ACCESS_INBOUND�CreateNamedPipe�FILE_FLAG_OVERLAPPED�FILE_FLAG_FIRST_PIPE_INSTANCE�PIPE_TYPE_MESSAGE�PIPE_READMODE_MESSAGE�	PIPE_WAIT�NMPWAIT_WAIT_FOREVER�NULL�
CreateFile�
OPEN_EXISTING�SetNamedPipeHandleState�ConnectNamedPiperyr}ru)
r�r3Zopenmode�accessZobsizeZibsizeZh1Zh2rw�_r�r�r�rrrrsV
�
��	��c@s*eZdZdZd
dd�Zdd�Zdd�Zd	S)r�zO
    Representation of a socket which is bound to an address and listening
    rcCs�t�tt|��|_zRtjdkr2|j�tjtjd�|j�d�|j�	|�|j�
|�|j��|_Wn t
k
r�|j���YnX||_d|_|dkr�t�|�s�tj|tj|fdd�|_nd|_dS)N�posixrTrr��argsZexitpriority)r,�getattr�_socketr!�nameZ
setsockoptZ
SOL_SOCKETZSO_REUSEADDRr�ZbindZlistenZgetsocknamer�rCrGZ_familyr�rr2�Finalize�unlink�_unlink)r:r3r'r�rrrr>Ks0

�
�
zSocketListener.__init__cCs&|j��\}|_|�d�t|���S)NT)r�r�r�r�r�r��r:�srrrr�ds
zSocketListener.acceptcCs0z|j��W5|j}|dk	r*d|_|�XdSr)r�r�rG)r:r�rrrrGiszSocketListener.closeN)r)rqrrrsr�r>r�rGrrrrr�Gs
r�c
CsPt|�}t�tt|���.}|�d�|�|�t|���W5QR�SQRXdS)zO
    Return a connection object connected to the socket given by `address`
    TN)r4r,r�r�Zconnectr�r�)r3r'r�rrrr�ss


r�c@s8eZdZdZddd�Zd
dd�Zdd	�Zed
d��ZdS)r�z0
        Representation of a named pipe
        NcCsL||_|jdd�g|_d|_t�d|j�tj|tj|j|jfdd�|_	dS)NT)�firstz listener created with address=%rrr�)
r��_new_handle�
_handle_queuer�r�	sub_debugr�r��_finalize_pipe_listenerrG)r:r3r�rrrr>�s
�zPipeListener.__init__Fc
CsHtjtjB}|r|tjO}t�|j|tjtjBtjBtj	t
t
tjtj�Sr)
rxr�r�r�r�r�r�r�r�ZPIPE_UNLIMITED_INSTANCESr�r�r�)r:r��flagsrrrr��s

��zPipeListener._new_handlec
Cs�|j�|���|j�d�}ztj|dd�}Wn0tk
r^}z|jtjkrN�W5d}~XYn\Xz<zt�|jgdt
�}Wn |��t�|��YnXW5|�	d�\}}|dks�t
�Xt|�S)NrTrvF)r��appendr��poprxr�rCr�Z
ERROR_NO_DATAryr}r{r|rr~r�ru)r:r;rr�r�r��resrrrr��s(�
zPipeListener.acceptcCs$t�d|�|D]}t�|�qdS)Nz closing listener with address=%r)rr�rxr�)Zqueuer3r;rrrr��sz$PipeListener._finalize_pipe_listener)N)F)	rqrrrsr�r>r�r��staticmethodr�rrrrr��s

r�c
Cs�t�}z6t�|d�t�|tjtjBdtjtjtjtj�}Wq�t	k
rz}z |j
tjtjfksht
|�rj�W5d}~XYqXq�q�t�|tjdd�t|�S)zU
        Return a connection object connected to the pipe given by `address`
        ��rN)rrxZ
WaitNamedPiper�r�r�r�r�r�rCr�ZERROR_SEM_TIMEOUTZERROR_PIPE_BUSYrr�r�ru)r3r�hr�rrrr��s8
����r��s#CHALLENGE#s	#WELCOME#s	#FAILURE#cCs�ddl}t|t�s$td�t|����t�t�}|�	t
|�|�||t��
�}|�d�}||krl|�	t�n|�	t�td��dS)Nr� Authkey must be bytes, not {0!s}�zdigest received was wrong)�hmacr�rNr%�formatr.r!�urandom�MESSAGE_LENGTHrV�	CHALLENGE�new�HMAC_DIGEST_NAME�digestr^�WELCOME�FAILUREr�Z
connectionr�r��messager�Zresponserrrr��s
�


r�cCs�ddl}t|t�s$td�t|����|�d�}|dtt��tksNt	d|��|tt�d�}|�
||t���}|�
|�|�d�}|tkr�td��dS)Nrr�r�zmessage = %rzdigest sent was rejected)r�r�rNr%r�r.r^rOr�r}r�r�r�rVr�rr�rrrr��s
�
 

r�c@s$eZdZdd�Zdd�Zdd�ZdS)�ConnectionWrappercCs6||_||_||_dD]}t||�}t|||�qdS)N)rKrGrjr^rV)�_conn�_dumps�_loadsr��setattr)r:�connrXrd�attrrZrrrr>s
zConnectionWrapper.__init__cCs|�|�}|j�|�dSr)r�r�rV)r:rZr�rrrr[	s
zConnectionWrapper.sendcCs|j��}|�|�Sr)r�r^rr�rrrrfs
zConnectionWrapper.recvN)rqrrrsr>r[rfrrrrr�sr�cCst�|fdddd��d�S)Nr�utf-8)�	xmlrpclibrX�encode)rZrrr�
_xml_dumpssrcCst�|�d��\\}}|S)Nr)rrd�decode)r�rZ�methodrrr�
_xml_loadssr
c@seZdZdd�ZdS)�XmlListenercCs"ddlmat�|�}t|tt�Sr�)�
xmlrpc.client�clientrrr�r�rr
rYrrrr�s
zXmlListener.acceptN)rqrrrsr�rrrrrsrcOsddlmatt||�tt�Sr�)rr
rr�rrr
)r��kwdsrrr�	XmlClientsrcCs�t|�}g}|r�t�|d|�}|tkr*q�n\t|krFtt|�krTnn
|t8}n2t|krptt|�kr~nn
|t8}ntd��|�||�||dd�}d}q|S)NFzShould not get hererr)	�listrxr{r
rrOrr�r�)Zhandlesr�L�readyr�rrr�_exhaustive_wait)s 
 
rc
s^|dkrt}n|dkrd}nt|dd�}t|�}i�g}t��t�}�z@|D�]&}zt|d�}	Wn tk
r�|�|��<YqPXzt	�|	�dd�\}}Wn8tk
r�}zd|j}}|tkrƂW5d}~XYnX|t	jkr�|�|�|�|j<qP|�rjt��dd�d	k�rjz|�d
�\}}Wn*tk
�rP}z
|j}W5d}~XYnX|�sjt
|d��rjd|_��|�d}qPt���|�}W5|D]}|���q�|D]�}z|�d�\}}Wn6tk
�r�}z|j}|tk�r�W5d}~XYnX|t	j
k�r��|j}��|�|dk�r�t
|d��r�d|_�q�X���fdd�|D���fd
d�|D�S)��
        Wait till an object in object_list is ready/readable.

        Returns list of those objects in object_list which are ready/readable.
        Nrr�g�?Tr�rK�)�rFc3s|]}�|VqdSrr)�.0r�)�waithandle_to_objrr�	<genexpr>�szwait.<locals>.<genexpr>csg|]}|�kr|�qSrr)r�o)�
ready_objectsrr�
<listcomp>�s�wait.<locals>.<listcomp>)r�intr�setr~ryrCr��
_ready_errorsrxZERROR_OPERATION_ABORTEDr|�addr+r�r��AttributeErrorr6r�rzr�r)Zgetwindowsversionr�keys�update)
�object_listrZov_listZ
ready_handlesrr�r�r�rrKr)rrrr?sh







�PollSelectorc
Cs�t���}|D]}|�|tj�q|dk	r4t��|}|�|�}|r\dd�|D�W5QR�S|dk	r4|t��}|dkr4|W5QR�Sq4W5QRXdS)rNcSsg|]\}}|j�qSr)Zfileobj)r�keyZeventsrrrr�srr)�
_WaitSelector�register�	selectorsZ
EVENT_READrrZselect)r%rZselectorrZZdeadlinerrrrr�s
c
CsZ|��}t�|tjtj��6}ddlm}|�|�}t||j	|j
ffW5QR�SQRXdS)Nr)�resource_sharer)rKr,ZfromfdrZSOCK_STREAMrr+Z	DupSocket�rebuild_connectionr<r=)rr;r�r+�dsrrr�reduce_connection�s

r.cCs|��}t|��||�Sr�r�r�)r-r<r=Zsockrrrr,�sr,cCsB|jrtjnd|jrtjndB}t�|��|�}t||j|jffSr�)	r<rxZFILE_GENERIC_READr=ZFILE_GENERIC_WRITEr
Z	DupHandlerK�rebuild_pipe_connection)rr��dhrrr�reduce_pipe_connection�s
�r2cCs|��}t|||�Sr)r�ru)r1r<r=r;rrrr0�sr0cCs t�|���}t||j|jffSr)r
ZDupFdrKr,r<r=)r�dfrrrr.�scCs|��}t|||�Srr/)r3r<r=�fdrrrr,�s)NN)T)T)N)N)J�__all__r�r!r)r,r�rr �	itertoolsr�rrrr	�contextr
ZForkingPicklerrWrxrrr
r�ImportErrorr*r�ZCONNECTION_TIMEOUTr��countr$r�Zfamiliesr+rrr(r-r4r5rur��objectrrrr�r�r�r�r�r�r�r�r�r�r�rr
rrrr�ZERROR_NETNAME_DELETEDr rr*r&r(ZSelectSelectorr.r,r)r2r0rrrr�<module>
s�



PT=

,,8	P
multiprocessing/__pycache__/pool.cpython-38.pyc000064400000060703151153537440015622 0ustar00U

e5d�~�@sdddgZddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddl
mZm
Z
ddlmZd	Zd
ZdZdZe��Zd
d�Zdd�ZGdd�de�ZGdd�d�Zdd�ZGdd�de�Zd+dd�Zdd�ZGdd �d e�Z Gd!d�de!�Z"Gd"d#�d#e!�Z#e#Z$Gd$d%�d%e#�Z%Gd&d'�d'e!�Z&Gd(d)�d)e&�Z'Gd*d�de"�Z(dS),�Pool�
ThreadPool�N)�Empty�)�util)�get_context�TimeoutError)�wait�INIT�RUN�CLOSE�	TERMINATEcCstt|��S�N)�list�map��args�r�,/usr/lib64/python3.8/multiprocessing/pool.py�mapstar/srcCstt�|d|d��S)Nrr)r�	itertools�starmaprrrr�starmapstar2src@seZdZdd�Zdd�ZdS)�RemoteTracebackcCs
||_dSr��tb)�selfrrrr�__init__:szRemoteTraceback.__init__cCs|jSrr�rrrr�__str__<szRemoteTraceback.__str__N)�__name__�
__module__�__qualname__rrrrrrr9src@seZdZdd�Zdd�ZdS)�ExceptionWithTracebackcCs0t�t|�||�}d�|�}||_d||_dS)N�z

"""
%s""")�	traceback�format_exception�type�join�excr)rr)rrrrr@s
zExceptionWithTraceback.__init__cCst|j|jffSr)�rebuild_excr)rrrrr�
__reduce__Esz!ExceptionWithTraceback.__reduce__N)r r!r"rr+rrrrr#?sr#cCst|�|_|Sr)r�	__cause__)r)rrrrr*Hs
r*cs0eZdZdZ�fdd�Zdd�Zdd�Z�ZS)�MaybeEncodingErrorzVWraps possible unpickleable errors, so they can be
    safely sent through the socket.cs.t|�|_t|�|_tt|��|j|j�dSr)�reprr)�value�superr-r)rr)r/��	__class__rrrTs

zMaybeEncodingError.__init__cCsd|j|jfS)Nz(Error sending result: '%s'. Reason: '%s')r/r)rrrrrYs�zMaybeEncodingError.__str__cCsd|jj|fS)Nz<%s: %s>)r2r rrrr�__repr__]szMaybeEncodingError.__repr__)r r!r"�__doc__rrr3�
__classcell__rrr1rr-Psr-rFc
Cs�|dk	r(t|t�r|dks(td�|���|j}|j}t|d�rR|j��|j	��|dk	rb||�d}|dks~|�r�||k�r�z
|�}	Wn(t
tfk
r�t�
d�Y�q�YnX|	dkr�t�
d��q�|	\}
}}}
}zd||
|�f}WnHtk
�r0}z(|�r|tk	�rt||j�}d|f}W5d}~XYnXz||
||f�WnRtk
�r�}z2t||d�}t�
d	|�||
|d|ff�W5d}~XYnXd}	}
}}}
}|d7}qft�
d
|�dS)NrzMaxtasks {!r} is not valid�_writerrz)worker got EOFError or OSError -- exitingzworker got sentinel -- exitingTFz0Possible encoding error while sending result: %szworker exiting after %d tasks)�
isinstance�int�AssertionError�format�put�get�hasattrr6�close�_reader�EOFError�OSErrorr�debug�	Exception�_helper_reraises_exceptionr#�
__traceback__r-)�inqueue�outqueue�initializer�initargsZmaxtasks�wrap_exceptionr;r<Z	completed�task�job�i�funcr�kwds�result�e�wrappedrrr�workerasN�





�$
rScCs|�dS)z@Pickle-able helper function for use by _guarded_task_generation.Nr)ZexrrrrD�srDcs2eZdZdZdd��fdd�
Z�fdd�Z�ZS)�
_PoolCachez�
    Class that implements a cache for the Pool class that will notify
    the pool management threads every time the cache is emptied. The
    notification is done by the use of a queue that is provided when
    instantiating the cache.
    N��notifiercs||_t�j||�dSr)rVr0r)rrVrrOr1rrr�sz_PoolCache.__init__cs t��|�|s|j�d�dSr)r0�__delitem__rVr;)r�itemr1rrrW�sz_PoolCache.__delitem__)r r!r"r4rrWr5rrr1rrT�srTc@s�eZdZdZdZedd��ZdLdd�Zej	e
fd	d
�Zdd�Zd
d�Z
edd��Zedd��Zdd�Zedd��Zedd��Zdd�Zdd�Zdifdd�ZdMdd �ZdNd!d"�ZdOd#d$�Zd%d&�ZdPd(d)�ZdQd*d+�Zdiddfd,d-�ZdRd.d/�ZdSd0d1�ZedTd2d3��Ze d4d5��Z!ed6d7��Z"ed8d9��Z#ed:d;��Z$d<d=�Z%d>d?�Z&d@dA�Z'dBdC�Z(edDdE��Z)e dFdG��Z*dHdI�Z+dJdK�Z,dS)UrzS
    Class which supports an async version of applying functions to arguments.
    TcOs|j||�Sr��Process)�ctxrrOrrrrZ�szPool.ProcessNrcCsg|_t|_|pt�|_|��t��|_|j��|_	t
|j	d�|_||_||_
||_|dkrjt��phd}|dkrztd��|dk	r�t|�s�td��||_z|��WnHtk
r�|jD]}|jdkr�|��q�|jD]}|��q؂YnX|��}tjtj|j|j|j|j|j|j|j |j!|j
|j|j|j"||j	fd�|_#d|j#_$t%|j#_|j#�&�tjtj'|j|j(|j!|j|jfd�|_)d|j)_$t%|j)_|j)�&�tjtj*|j!|j+|jfd�|_,d|j,_$t%|j,_|j,�&�t-j.||j/|j|j |j!|j|j	|j#|j)|j,|jf	dd�|_0t%|_dS)	NrUrz&Number of processes must be at least 1zinitializer must be a callable��targetrT�)rZexitpriority)1�_poolr
�_stater�_ctx�
_setup_queues�queue�SimpleQueue�
_taskqueue�_change_notifierrT�_cache�_maxtasksperchild�_initializer�	_initargs�os�	cpu_count�
ValueError�callable�	TypeError�
_processes�_repopulate_poolrC�exitcode�	terminater(�_get_sentinels�	threadingZThreadr�_handle_workersrZ�_inqueue�	_outqueue�_wrap_exception�_worker_handler�daemonr�start�
_handle_tasks�
_quick_put�
_task_handler�_handle_results�
_quick_get�_result_handlerrZFinalize�_terminate_pool�
_terminate)r�	processesrHrI�maxtasksperchild�context�p�	sentinelsrrrr�s�





��
��
�
��z
Pool.__init__cCs>|j|kr:|d|��t|d�t|dd�dk	r:|j�d�dS)Nz&unclosed running multiprocessing pool )�sourcerf)r`�ResourceWarning�getattrrfr;)rZ_warnrrrr�__del__s

�zPool.__del__c	Cs0|j}d|j�d|j�d|j�dt|j��d�	S)N�<�.z state=z pool_size=�>)r2r!r"r`�lenr_)r�clsrrrr3sz
Pool.__repr__cCs|jjg}|jjg}||�Sr)rxr?rf)rZtask_queue_sentinelsZself_notifier_sentinelsrrrrts

zPool._get_sentinelscCsdd�|D�S)NcSsg|]}t|d�r|j�qS)�sentinel)r=r�)�.0rSrrr�
<listcomp>s
�z.Pool._get_worker_sentinels.<locals>.<listcomp>r�Zworkersrrr�_get_worker_sentinelss�zPool._get_worker_sentinelscCsPd}ttt|���D]6}||}|jdk	rt�d|�|��d}||=q|S)z�Cleanup after any worker processes which have exited due to reaching
        their specified lifetime.  Returns True if any workers were cleaned up.
        FN�cleaning up worker %dT)�reversed�ranger�rrrrBr()�poolZcleanedrMrSrrr�_join_exited_workerss
zPool._join_exited_workerscCs0|�|j|j|j|j|j|j|j|j|j	|j
�
Sr)�_repopulate_pool_staticrarZrpr_rwrxrirjrhryrrrrrq.s�zPool._repopulate_poolc

Csft|t|��D]P}
||t||||||	fd�}|j�dd�|_d|_|��|�|�t�	d�qdS)z�Bring the number of pool processes up to the specified number,
        for use after reaping workers which have exited.
        r\rZZ
PoolWorkerTzadded workerN)
r�r�rS�name�replacer{r|�appendrrB)r[rZr�r�rFrGrHrIr�rJrM�wrrrr�7s��
zPool._repopulate_pool_staticc

Cs*t�|�r&t�||||||||||	�
dS)zEClean up any exited workers and start replacements for them.
        N)rr�r�)
r[rZr�r�rFrGrHrIr�rJrrr�_maintain_poolJs
�zPool._maintain_poolcCs4|j��|_|j��|_|jjj|_|jjj|_	dSr)
rardrwrxr6�sendr~r?�recvr�rrrrrbVszPool._setup_queuescCs|jtkrtd��dS)NzPool not running)r`rrmrrrr�_check_running\s
zPool._check_runningcCs|�|||���S)zT
        Equivalent of `func(*args, **kwds)`.
        Pool must be running.
        )�apply_asyncr<)rrNrrOrrr�apply`sz
Pool.applycCs|�||t|���S)zx
        Apply `func` to each element in `iterable`, collecting the results
        in a list that is returned.
        )�
_map_asyncrr<�rrN�iterable�	chunksizerrrrgszPool.mapcCs|�||t|���S)z�
        Like `map()` method but the elements of the `iterable` are expected to
        be iterables as well and will be unpacked as arguments. Hence
        `func` and (a, b) becomes func(a, b).
        )r�rr<r�rrrrnszPool.starmapcCs|�||t|||�S)z=
        Asynchronous version of `starmap()` method.
        )r�r�rrNr�r��callback�error_callbackrrr�
starmap_asyncvs�zPool.starmap_asyncc
csjz,d}t|�D]\}}||||fifVqWn8tk
rd}z||dt|fifVW5d}~XYnXdS)z�Provides a generator of tasks for imap and imap_unordered with
        appropriate handling for iterables which throw exceptions during
        iteration.���rN)�	enumeraterCrD)rZ
result_jobrNr�rM�xrQrrr�_guarded_task_generation~szPool._guarded_task_generationrcCs�|��|dkr:t|�}|j�|�|j||�|jf�|S|dkrPtd�|���t	�
|||�}t|�}|j�|�|jt|�|jf�dd�|D�SdS)zP
        Equivalent of `map()` -- can be MUCH slower than `Pool.map()`.
        rzChunksize must be 1+, not {0:n}css|]}|D]
}|Vq
qdSrr�r��chunkrXrrr�	<genexpr>�szPool.imap.<locals>.<genexpr>N)r��IMapIteratorrer;r��_job�_set_lengthrmr:r�
_get_tasksr�rrNr�r�rP�task_batchesrrr�imap�s4�������z	Pool.imapcCs�|��|dkr:t|�}|j�|�|j||�|jf�|S|dkrPtd�|���t	�
|||�}t|�}|j�|�|jt|�|jf�dd�|D�SdS)zL
        Like `imap()` method but ordering of results is arbitrary.
        rzChunksize must be 1+, not {0!r}css|]}|D]
}|Vq
qdSrrr�rrrr��sz&Pool.imap_unordered.<locals>.<genexpr>N)r��IMapUnorderedIteratorrer;r�r�r�rmr:rr�rr�rrr�imap_unordered�s0������zPool.imap_unorderedcCs6|��t|||�}|j�|jd|||fgdf�|S)z;
        Asynchronous version of `apply()` method.
        rN)r��ApplyResultrer;r�)rrNrrOr�r�rPrrrr��szPool.apply_asynccCs|�||t|||�S)z9
        Asynchronous version of `map()` method.
        )r�rr�rrr�	map_async�s�zPool.map_asyncc
Cs�|��t|d�st|�}|dkrJtt|�t|j�d�\}}|rJ|d7}t|�dkrZd}t�|||�}t||t|�||d�}	|j	�
|�|	j||�df�|	S)zY
        Helper function to implement map, starmap and their async counterparts.
        �__len__N�rr�r�)
r�r=r�divmodr�r_rr��	MapResultrer;r�r�)
rrNr�Zmapperr�r�r�Zextrar�rPrrrr��s,
����zPool._map_asynccCs"t||d�|��s|��qdS)N)�timeout)r	�emptyr<)r��change_notifierr�rrr�_wait_for_updates�szPool._wait_for_updatescCspt��}|jtks |rX|jtkrX|�|||||||	|
||�
|�|�|
�}|�||�q|�d�t	�
d�dS)Nzworker handler exiting)ru�current_threadr`rr
r�r�r�r;rrB)r��cache�	taskqueuer[rZr�r�rFrGrHrIr�rJr�r��threadZcurrent_sentinelsrrrrv�s�
zPool._handle_workersc

Cspt��}t|jd�D]�\}}d}z�|D]�}|jtkrBt�d�q�z||�Wq&tk
r�}
zB|dd�\}	}z||	�	|d|
f�Wnt
k
r�YnXW5d}
~
XYq&Xq&|r�t�d�|r�|dnd}||d�W�qW�
�q
W5d}}}	Xqt�d�z6t�d�|�d�t�d	�|D]}|d��q.Wn tk
�r`t�d
�YnXt�d�dS)Nz'task handler found thread._state != RUN�Fzdoing set_length()rr�ztask handler got sentinelz/task handler sending sentinel to result handlerz(task handler sending sentinel to workersz/task handler got OSError when sending sentinelsztask handler exiting)
rur��iterr<r`rrrBrC�_set�KeyErrorr;rA)
r�r;rGr�r�r�ZtaskseqZ
set_lengthrKrLrQ�idxr�rrrr}sB






zPool._handle_tasksc	Cs�t��}z
|�}Wn$ttfk
r6t�d�YdSX|jtkr`|jtksTt	d��t�d�q�|dkrtt�d�q�|\}}}z||�
||�Wntk
r�YnXd}}}q|�rR|jtk�rRz
|�}Wn$ttfk
r�t�d�YdSX|dk�rt�d�q�|\}}}z||�
||�Wntk
�rBYnXd}}}q�t|d��r�t�d�z,t
d�D]}|j���s��q�|��qrWnttfk
�r�YnXt�d	t|�|j�dS)
Nz.result handler got EOFError/OSError -- exitingzThread not in TERMINATEz,result handler found thread._state=TERMINATEzresult handler got sentinelz&result handler ignoring extra sentinelr?z"ensuring that outqueue is not full�
z7result handler exiting: len(cache)=%s, thread._state=%s)rur�rAr@rrBr`rr
r9r�r�r=r�r?�pollr�)rGr<r�r�rKrLrM�objrrrr�:s^











�zPool._handle_resultsccs0t|�}tt�||��}|s dS||fVqdSr)r��tupler�islice)rN�it�sizer�rrrr�vs
zPool._get_taskscCstd��dS)Nz:pool objects cannot be passed between processes or pickled)�NotImplementedErrorrrrrr+s�zPool.__reduce__cCs2t�d�|jtkr.t|_t|j_|j�d�dS)Nzclosing pool)rrBr`rrrzrfr;rrrrr>�s


z
Pool.closecCst�d�t|_|��dS)Nzterminating pool)rrBr
r`r�rrrrrs�s
zPool.terminatecCsjt�d�|jtkrtd��n|jttfkr4td��|j��|j	��|j
��|jD]}|��qXdS)Nzjoining poolzPool is still runningzIn unknown state)rrBr`rrmrr
rzr(rr�r_)rr�rrrr(�s






z	Pool.joincCs@t�d�|j��|��r<|j��r<|j��t�	d�qdS)Nz7removing tasks from inqueue until task handler finishedr)
rrBZ_rlock�acquire�is_aliver?r�r��time�sleep)rF�task_handlerr�rrr�_help_stuff_finish�s



zPool._help_stuff_finishc
CsXt�d�t|_|�d�t|_t�d�|�||t|��|��sXt|	�dkrXtd��t|_|�d�|�d�t�d�t	�
�|k	r�|��|r�t|dd�r�t�d�|D]}
|
j
dkr�|
��q�t�d�t	�
�|k	r�|��t�d	�t	�
�|k	�r|��|�rTt|dd��rTt�d
�|D](}
|
���r*t�d|
j�|
���q*dS)Nzfinalizing poolz&helping task handler/workers to finishrz.Cannot have cache with result_hander not alivezjoining worker handlerrszterminating workerszjoining task handlerzjoining result handlerzjoining pool workersr�)rrBr
r`r;r�r�r�r9rur�r(r=rrrs�pid)r�r�rFrGr�r�Zworker_handlerr�Zresult_handlerr�r�rrrr��sB


�









zPool._terminate_poolcCs|��|Sr)r�rrrr�	__enter__�szPool.__enter__cCs|��dSr)rs)r�exc_typeZexc_valZexc_tbrrr�__exit__�sz
Pool.__exit__)NNrNN)N)N)NNN)r)r)NNN)NNN)N)-r r!r"r4ry�staticmethodrZr�warnings�warnrr�r3rtr�r�rqr�r�rbr�r�rrr�r�r�r�r�r�r�r��classmethodrvr}r�r�r+r>rsr(r�r�r�r�rrrrr�sx
�
P

	



�


�

�
�


-
;


5c@s@eZdZdd�Zdd�Zdd�Zddd	�Zdd
d�Zdd
�ZdS)r�cCs>||_t��|_tt�|_|j|_||_||_	||j|j<dSr)
r_ruZEvent�_event�next�job_counterr�rg�	_callback�_error_callback)rr�r�r�rrrr�s

zApplyResult.__init__cCs
|j��Sr)r�Zis_setrrrr�ready�szApplyResult.readycCs|��std�|���|jS)Nz{0!r} not ready)r�rmr:�_successrrrr�
successful�szApplyResult.successfulNcCs|j�|�dSr)r�r	�rr�rrrr	�szApplyResult.waitcCs,|�|�|��st�|jr"|jS|j�dSr)r	r�rr��_valuer�rrrr<�s
zApplyResult.getcCsZ|\|_|_|jr$|jr$|�|j�|jr<|js<|�|j�|j��|j|j=d|_dSr)	r�r�r�r�r��setrgr�r_�rrMr�rrrr�s

zApplyResult._set)N)N)	r r!r"rr�r�r	r<r�rrrrr��s	

	r�c@seZdZdd�Zdd�ZdS)r�cCshtj||||d�d|_dg||_||_|dkrNd|_|j��|j|j	=n||t
||�|_dS)Nr�Tr)r�rr�r��
_chunksize�_number_leftr�r�rgr��bool)rr�r��lengthr�r�rrrrs
�
zMapResult.__init__cCs�|jd8_|\}}|rv|jrv||j||j|d|j�<|jdkr�|jrZ|�|j�|j|j=|j��d|_	nL|s�|jr�d|_||_|jdkr�|j
r�|�
|j�|j|j=|j��d|_	dS)NrrF)r�r�r�r�r�rgr�r�r�r_r�)rrMZsuccess_result�successrPrrrr�$s&







zMapResult._setN)r r!r"rr�rrrrr�s
r�c@s:eZdZdd�Zdd�Zddd�ZeZdd	�Zd
d�ZdS)
r�cCsT||_t�t���|_tt�|_|j|_t	�
�|_d|_d|_
i|_||j|j<dS)Nr)r_ruZ	ConditionZLock�_condr�r�r�rg�collections�deque�_items�_index�_length�	_unsorted)rr�rrrrBs

zIMapIterator.__init__cCs|Srrrrrr�__iter__MszIMapIterator.__iter__NcCs�|j��z|j��}Wnztk
r�|j|jkr>d|_td�|j�|�z|j��}Wn2tk
r�|j|jkr�d|_td�t	d�YnXYnXW5QRX|\}}|r�|S|�dSr)
r�r��popleft�
IndexErrorr�rr_�
StopIterationr	r)rr�rXr�r/rrrr�Ps&zIMapIterator.nextc	Cs�|j��|j|krn|j�|�|jd7_|j|jkrb|j�|j�}|j�|�|jd7_q,|j��n
||j|<|j|jkr�|j|j	=d|_
W5QRXdS�Nr)r�r�r�r�r�pop�notifyrrgr�r_r�rrrr�hs


zIMapIterator._setc	CsB|j�2||_|j|jkr4|j��|j|j=d|_W5QRXdSr)r�rr�rrgr�r_)rr�rrrr�ys

zIMapIterator._set_length)N)	r r!r"rrr��__next__r�r�rrrrr�@s
r�c@seZdZdd�ZdS)r�c	CsV|j�F|j�|�|jd7_|j��|j|jkrH|j|j=d|_W5QRXdSr)	r�r�r�r�rrrgr�r_r�rrrr��s

zIMapUnorderedIterator._setN)r r!r"r�rrrrr��sr�c@sVeZdZdZedd��Zddd�Zdd	�Zd
d�Zedd
��Z	edd��Z
dd�ZdS)rFcOsddlm}|||�S)NrrY)ZdummyrZ)r[rrOrZrrrrZ�szThreadPool.ProcessNrcCst�||||�dSr)rr)rr�rHrIrrrr�szThreadPool.__init__cCs,t��|_t��|_|jj|_|jj|_dSr)rcrdrwrxr;r~r<r�rrrrrb�s


zThreadPool._setup_queuescCs
|jjgSr)rfr?rrrrrt�szThreadPool._get_sentinelscCsgSrrr�rrrr��sz ThreadPool._get_worker_sentinelscCsFz|jdd�qWntjk
r(YnXt|�D]}|�d�q2dS)NF)�block)r<rcrr�r;)rFr�r�rMrrrr��szThreadPool._help_stuff_finishcCst�|�dSr)r�r�)rr�r�r�rrrr��szThreadPool._wait_for_updates)NNr)r r!r"ryr�rZrrbrtr�r�r�rrrrr�s




)NrNF))�__all__r�rrkrcrur�r%r�rr$rrrZ
connectionr	r
rrr
�countr�rrrCrr#r*r-rSrD�dictrT�objectrr�ZAsyncResultr�r�r�rrrrr�<module>
sN	�
-=)+Emultiprocessing/__pycache__/queues.cpython-38.opt-1.pyc000064400000022411151153537440017111 0ustar00U

e5d�-�@s�dddgZddlZddlZddlZddlZddlZddlZddlZddlm	Z	m
Z
ddlZddlm
Z
ddlmZejjZdd	lmZmZmZmZmZGd
d�de�Ze�ZGdd�de�ZGdd�de�ZdS)
�Queue�SimpleQueue�
JoinableQueue�N)�Empty�Full�)�
connection)�context)�debug�info�Finalize�register_after_fork�
is_exitingc@s�eZdZd*dd�Zdd�Zdd�Zdd	�Zd+dd
�Zd,dd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd d!�Zed"d#��Zed$d%��Zed&d'��Zed(d)��ZdS)-rrcCs�|dkrddlm}||_tjdd�\|_|_|��|_t	�
�|_tj
dkrTd|_n
|��|_|�|�|_d|_|��tj
dkr�t|tj�dS)Nrr)�
SEM_VALUE_MAXF�Zduplex�win32)Zsynchronizer�_maxsizer�Pipe�_reader�_writer�Lock�_rlock�os�getpid�_opid�sys�platform�_wlockZBoundedSemaphore�_sem�
_ignore_epipe�_after_forkr
r��self�maxsize�ctx�r%�./usr/lib64/python3.8/multiprocessing/queues.py�__init__$s




zQueue.__init__cCs.t�|�|j|j|j|j|j|j|j|j	fS�N)
r	�assert_spawningrrrrrrrr�r"r%r%r&�__getstate__9s
�zQueue.__getstate__c	Cs0|\|_|_|_|_|_|_|_|_|��dSr()	rrrrrrrrr �r"�stater%r%r&�__setstate__>s�zQueue.__setstate__cCsbtd�t�t���|_t��|_d|_d|_	d|_
d|_d|_|j
j|_|jj|_|jj|_dS)NzQueue._after_fork()F)r
�	threading�	Conditionr�	_notempty�collections�deque�_buffer�_thread�_jointhread�_joincancelled�_closed�_closer�
send_bytes�_send_bytesr�
recv_bytes�_recv_bytes�poll�_pollr*r%r%r&r Cs


zQueue._after_forkTNc	Csf|jrtd|�d���|j�||�s(t�|j�.|jdkrB|��|j�	|�|j�
�W5QRXdS�NzQueue z
 is closed)r8�
ValueErrorr�acquirerr1r5�
_start_threadr4�append�notify�r"�obj�block�timeoutr%r%r&�putPs
z	Queue.putc	Cs�|jrtd|�d���|rH|dkrH|j�|��}W5QRX|j��nr|rXt��|}|j�||�sjt	�zB|r�|t��}|�
|�s�t	�n|�
�s�t	�|��}|j��W5|j��Xt�|�Sr@)
r8rArr=r�release�time�	monotonicrBrr?�_ForkingPickler�loads)r"rHrI�resZdeadliner%r%r&�get\s*
z	Queue.getcCs|j|jj��Sr()rr�_semlockZ
_get_valuer*r%r%r&�qsizevszQueue.qsizecCs
|��Sr(�r?r*r%r%r&�emptyzszQueue.emptycCs|jj��Sr()rrR�_is_zeror*r%r%r&�full}sz
Queue.fullcCs
|�d�S�NF)rQr*r%r%r&�
get_nowait�szQueue.get_nowaitcCs|�|d�SrX)rJ�r"rGr%r%r&�
put_nowait�szQueue.put_nowaitcCs2d|_z|j��W5|j}|r,d|_|�XdS)NT)r8r9r�close)r"r\r%r%r&r\�szQueue.closecCstd�|jr|��dS)NzQueue.join_thread())r
r6r*r%r%r&�join_thread�szQueue.join_threadcCs6td�d|_z|j��Wntk
r0YnXdS)NzQueue.cancel_join_thread()T)r
r7r6Zcancel�AttributeErrorr*r%r%r&�cancel_join_thread�szQueue.cancel_join_threadc
Cs�td�|j��tjtj|j|j|j|j	|j
j|j|j
|jfdd�|_d|j_td�|j��td�|js�t|jtjt�|j�gdd�|_t|tj|j|jgd	d�|_dS)
NzQueue._start_thread()ZQueueFeederThread)�target�args�nameTzdoing self._thread.start()z... done self._thread.start()���)Zexitpriority�
)r
r4�clearr/ZThreadr�_feedr1r;rrr\r�_on_queue_feeder_errorrr5Zdaemon�startr7r�_finalize_join�weakref�refr6�_finalize_closer9r*r%r%r&rC�s<
��
�
�zQueue._start_threadcCs4td�|�}|dk	r(|��td�ntd�dS)Nzjoining queue threadz... queue thread joinedz... queue thread already dead)r
�join)Ztwr�threadr%r%r&ri�s
zQueue._finalize_joinc	Cs.td�|�|�t�|��W5QRXdS)Nztelling queue thread to quit)r
rD�	_sentinelrE)�buffer�notemptyr%r%r&rl�s
zQueue._finalize_closec
CsXtd�|j}|j}	|j}
|j}t}tjdkr<|j}
|j}nd}
z�|�z|sT|
�W5|	�Xzb|�}||kr�td�|�WWdSt�	|�}|
dkr�||�qb|
�z||�W5|�XqbWnt
k
r�YnXWq@tk
�rP}zV|�rt|dd�t
jk�rWY�6dSt��r.td|�WY�dS|��|||�W5d}~XYq@Xq@dS)Nz$starting thread to feed data to piperz%feeder thread got sentinel -- exiting�errnorzerror in queue thread: %s)r
rBrK�wait�popleftrorrrN�dumps�
IndexError�	Exception�getattrrrZEPIPErr)rprqr:Z	writelockr\Zignore_epipe�onerrorZ	queue_semZnacquireZnreleaseZnwaitZbpopleft�sentinelZwacquireZwreleaserG�er%r%r&rf�sN







zQueue._feedcCsddl}|��dS)z�
        Private API hook called when feeding data in the background thread
        raises an exception.  For overriding by concurrent.futures.
        rN)�	traceback�	print_exc)r{rGr|r%r%r&rg
szQueue._on_queue_feeder_error)r)TN)TN)�__name__�
__module__�__qualname__r'r+r.r rJrQrSrUrWrYr[r\r]r_rC�staticmethodrirlrfrgr%r%r%r&r"s.



 
	

=c@s@eZdZddd�Zdd�Zdd�Zdd
d�Zdd
�Zdd�Zd	S)rrcCs*tj|||d�|�d�|_|��|_dS)N)r$r)rr'Z	Semaphore�_unfinished_tasksr0�_condr!r%r%r&r'#szJoinableQueue.__init__cCst�|�|j|jfSr()rr+r�r�r*r%r%r&r+(szJoinableQueue.__getstate__cCs,t�||dd��|dd�\|_|_dS)N���)rr.r�r�r,r%r%r&r.+szJoinableQueue.__setstate__TNc
Cs�|jrtd|�d���|j�||�s(t�|j�J|j�8|jdkrJ|��|j	�
|�|j��|j�
�W5QRXW5QRXdSr@)r8rArrBrr1r�r5rCr4rDr�rKrErFr%r%r&rJ/s

zJoinableQueue.putc	Cs@|j�0|j�d�std��|jj��r2|j��W5QRXdS)NFz!task_done() called too many times)r�r�rBrArRrVZ
notify_allr*r%r%r&�	task_done<s
zJoinableQueue.task_donec	Cs,|j�|jj��s|j��W5QRXdSr()r�r�rRrVrsr*r%r%r&rmCszJoinableQueue.join)r)TN)	r~rr�r'r+r.rJr�rmr%r%r%r&r!s


c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)rcCsHtjdd�\|_|_|��|_|jj|_tj	dkr:d|_
n
|��|_
dS)NFrr)rrrrrrr>r?rrr)r"r$r%r%r&r'Ns


zSimpleQueue.__init__cCs
|��Sr(rTr*r%r%r&rUWszSimpleQueue.emptycCst�|�|j|j|j|jfSr()r	r)rrrrr*r%r%r&r+Zs
zSimpleQueue.__getstate__cCs"|\|_|_|_|_|jj|_dSr()rrrrr>r?r,r%r%r&r.^szSimpleQueue.__setstate__c	Cs&|j�|j��}W5QRXt�|�Sr()rrr<rNrO)r"rPr%r%r&rQbszSimpleQueue.getc	CsDt�|�}|jdkr"|j�|�n|j�|j�|�W5QRXdSr()rNrurrr:rZr%r%r&rJhs


zSimpleQueue.putN)	r~rr�r'rUr+r.rQrJr%r%r%r&rLs	)�__all__rrr/r2rLrjrrZqueuerrZ_multiprocessing�rr	Z	reductionZForkingPicklerrN�utilr
rrr
r�objectrrorrr%r%r%r&�<module>
s$
v
+multiprocessing/__pycache__/connection.cpython-38.opt-2.pyc000064400000054773151153537440017762 0ustar00U

&�.ep|�@sddddgZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddl
mZm
Z
dd	lmZejZz$ddlZdd
lmZmZmZmZWn$ek
r�ejdkr‚dZYnXdZd
ZdZe��ZdZdgZe ed��rdZedg7Zejdk�rdZedg7Zefdd�Z!dd�Z"dd�Z#dd�Z$dd�Z%Gdd�d�Z&e�rnGdd�de&�Z'Gd d!�d!e&�Z(Gd"d�de)�Z*dPd#d�Z+ejdk�r�dQd%d�Z,n
dRd&d�Z,Gd'd(�d(e)�Z-d)d*�Z.ejdk�r�Gd+d,�d,e)�Z/d-d.�Z0d/Z1d0Z2d1Z3d2Z4d3d4�Z5d5d6�Z6Gd7d8�d8e)�Z7d9d:�Z8d;d<�Z9Gd=d>�d>e*�Z:d?d@�Z;ejdk�rzdAdB�Z<ej=ej>hZ?dSdCd�Z@n,ddlAZAe eAdD��r�eAjBZCneAjDZCdTdEd�Z@ejdk�r�dFdG�ZEdHdI�ZFe�Ge(eE�dJdK�ZHdLdM�ZIe�Ge'eH�ndNdG�ZEdOdI�ZFe�Ge(eE�dS)U�Client�Listener�Pipe�wait�N�)�util)�AuthenticationError�BufferTooShort)�	reduction)�
WAIT_OBJECT_0�WAIT_ABANDONED_0�WAIT_TIMEOUT�INFINITE�win32i g4@Zsha256�AF_INET�AF_UNIX�AF_PIPEcCst��|S�N��time�	monotonic)�timeout�r�2/usr/lib64/python3.8/multiprocessing/connection.py�
_init_timeout?srcCst��|kSrr)�trrr�_check_timeoutBsrcCsX|dkrdS|dkr&tjdt��d�S|dkrLtjdt��tt�fdd�Std	��dS)
Nr)Z	localhostrrz	listener-)�prefix�dirrz\\.\pipe\pyc-%d-%d-�zunrecognized family)	�tempfileZmktemprZget_temp_dir�os�getpid�next�
_mmap_counter�
ValueError��familyrrr�arbitrary_addressIs��r(cCsJtjdkr|dkrtd|��tjdkrF|dkrFtt|�sFtd|��dS)NrrzFamily %s is not recognized.r)�sys�platformr%�hasattr�socketr&rrr�_validate_familyWs

r-cCsTt|�tkrdSt|�tkr*|�d�r*dSt|�tks@t�|�rDdStd|��dS)Nrz\\rrzaddress type of %r unrecognized)�type�tuple�str�
startswithr�is_abstract_socket_namespacer%)�addressrrr�address_typecsr4c@s�eZdZdZd+dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	e
dd��Ze
dd��Ze
dd��Z
dd�Zdd�Zd,dd�Zdd�Zd-dd�Zd.d d!�Zd"d#�Zd/d%d&�Zd'd(�Zd)d*�ZdS)0�_ConnectionBaseNTcCs>|��}|dkrtd��|s(|s(td��||_||_||_dS)Nrzinvalid handlez6at least one of `readable` and `writable` must be True)�	__index__r%�_handle�	_readable�	_writable)�self�handle�readable�writablerrr�__init__ys�z_ConnectionBase.__init__cCs|jdk	r|��dSr�r7�_close�r:rrr�__del__�s
z_ConnectionBase.__del__cCs|jdkrtd��dS)Nzhandle is closed)r7�OSErrorrArrr�
_check_closed�s
z_ConnectionBase._check_closedcCs|jstd��dS)Nzconnection is write-only)r8rCrArrr�_check_readable�sz_ConnectionBase._check_readablecCs|jstd��dS)Nzconnection is read-only)r9rCrArrr�_check_writable�sz_ConnectionBase._check_writablecCs"|jrd|_n|��td��dS)NFzbad message length)r9r8�closerCrArrr�_bad_message_length�sz#_ConnectionBase._bad_message_lengthcCs
|jdkSr�r7rArrr�closed�sz_ConnectionBase.closedcCs|jSr)r8rArrrr<�sz_ConnectionBase.readablecCs|jSr)r9rArrrr=�sz_ConnectionBase.writablecCs|��|jSr)rDr7rArrr�fileno�sz_ConnectionBase.filenocCs$|jdk	r z|��W5d|_XdSrr?rArrrrG�s
z_ConnectionBase.closercCs�|��|��t|�}|jdkr.tt|��}t|�}|dkrFtd��||krVtd��|dkrh||}n&|dkrztd��n|||kr�td��|�||||��dS)Nrrzoffset is negativezbuffer length < offsetzsize is negativezbuffer length < offset + size)rDrF�
memoryview�itemsize�bytes�lenr%�_send_bytes)r:�buf�offset�size�m�nrrr�
send_bytes�s"


z_ConnectionBase.send_bytescCs$|��|��|�t�|��dSr)rDrFrP�_ForkingPickler�dumps�r:�objrrr�send�sz_ConnectionBase.sendcCsJ|��|��|dk	r(|dkr(td��|�|�}|dkrB|��|��S)Nrznegative maxlength)rDrEr%�_recv_bytesrH�getvalue)r:Z	maxlengthrQrrr�
recv_bytes�s
z_ConnectionBase.recv_bytesc
Cs�|��|��t|���}|j}|t|�}|dkr>td��n||krNtd��|��}|��}|||krvt|�	���|�
d�|�||||||��|W5QR�SQRXdS)Nrznegative offsetzoffset too large)rDrErLrMrOr%r\�tellr	r]�seek�readinto)r:rQrRrTrMZbytesize�resultrSrrr�recv_bytes_into�s$



�z_ConnectionBase.recv_bytes_intocCs&|��|��|��}t�|���Sr)rDrEr\rW�loads�	getbuffer)r:rQrrr�recv�sz_ConnectionBase.recv�cCs|��|��|�|�Sr)rDrE�_poll�r:rrrr�pollsz_ConnectionBase.pollcCs|SrrrArrr�	__enter__sz_ConnectionBase.__enter__cCs|��dSr�rG�r:�exc_type�	exc_valueZexc_tbrrr�__exit__
sz_ConnectionBase.__exit__)TT)rN)N)r)rg)�__name__�
__module__�__qualname__r7r>rBrDrErFrH�propertyrJr<r=rKrGrVr[r^rcrfrjrkrprrrrr5vs.








r5c@s@eZdZdZejfdd�Zdd�Zd
dd�Zd	d
�Z	dd�Z
dS)�PipeConnectionFcCs||j�dSrrI)r:Z_CloseHandlerrrr@szPipeConnection._closec	Cshtj|j|dd�\}}z<z |tjkr6t�|jgdt�}Wn|���YnXW5|�d�\}}XdS)NT��
overlappedF)	�_winapiZ	WriteFiler7�GetOverlappedResult�ERROR_IO_PENDING�WaitForMultipleObjects�eventr�cancel)r:rQ�ov�errZnwritten�waitresrrrrPs
�zPipeConnection._send_bytesNc	Cs&|jrd|_t��S|dkr dnt|d�}z�tj|j|dd�\}}dz<z |tjkrdt�
|jgdt�}Wn|���YnXW5|�d�\}}|dkr�t��}|�|�	��|�WS|tj
kr�|�||��WSXWn:tk
�r}z|jtjk�rt�n�W5d}~XYnXtd��dS)NF�Trvrz.shouldn't get here; expected KeyboardInterrupt)�_got_empty_message�io�BytesIO�minrx�ReadFiler7ry�writereZERROR_MORE_DATA�_get_more_datarzr{r|rr}rC�winerror�ERROR_BROKEN_PIPE�EOFError�RuntimeError)	r:�maxsizeZbsizer~rZnread�fr��errrr\*s>
�

�
zPipeConnection._recv_bytescCs.|jst�|j�ddkrdStt|g|��S)NrT)r�rx�
PeekNamedPiper7�boolrrirrrrhJs
�zPipeConnection._pollcCs�|��}t��}|�|�t�|j�d}|dk	rJt|�||krJ|��tj	|j|dd�\}}|�
d�\}}|�|���|S)NrTrv)rer�r�r�rxr�r7rOrHr�ry)r:r~r�rQr��leftrZrbytesrrrr�Ps
zPipeConnection._get_more_data)N)rqrrrsr�rx�CloseHandler@rPr\rhr�rrrrrus
 ruc@sxeZdZer(ejfdd�ZejZej	Z
nejfdd�Zej
ZejZ
efdd�Ze
fdd�Zdd	�Zddd�Zd
d�Zd
S)�
ConnectioncCs||j�dSrrI�r:r@rrrr@gszConnection._closecCs||j�dSrrIr�rrrr@lscCs8t|�}||j|�}||8}|dkr&q4||d�}qdS�Nr)rOr7)r:rQr��	remainingrUrrr�_sendqszConnection._sendcCsbt��}|j}|}|dkr^|||�}t|�}|dkrJ||krBt�ntd��|�|�||8}q|S)Nrzgot end of file during message)r�r�r7rOr�rCr�)r:rS�readrQr;r��chunkrUrrr�_recvzs


zConnection._recvcCs�t|�}|dkrHt�dd�}t�d|�}|�|�|�|�|�|�n8t�d|�}|dkrr|�|�|�|�n|�||�dS)Ni����!i����!Qi@)rO�structZpackr�)r:rQrUZ
pre_header�headerrrrrP�s


zConnection._send_bytesNcCs^|�d�}t�d|���\}|dkr@|�d�}t�d|���\}|dk	rT||krTdS|�|�S)N�r�r��r�)r�r�Zunpackr])r:r�rQrSrrrr\�s

zConnection._recv_bytescCst|g|�}t|�Sr)rr�)r:r�rrrrrh�szConnection._poll)N)rqrrrsrx�_multiprocessingZclosesocketr@r[Z_writerfZ_readr!rGr�r�r�r�rPr\rhrrrrr�`s	

r�c@sNeZdZddd�Zdd�Zdd�Zed	d
��Zedd��Zd
d�Z	dd�Z
dS)rNrcCsp|p|rt|�pt}|pt|�}t|�|dkr>t||�|_nt|||�|_|dk	rft|t�sft	d��||_
dS�Nrzauthkey should be a byte string)r4�default_familyr(r-�PipeListener�	_listener�SocketListener�
isinstancerN�	TypeError�_authkey)r:r3r'�backlog�authkeyrrrr>�s�zListener.__init__cCs>|jdkrtd��|j��}|jr:t||j�t||j�|S)Nzlistener is closed)r�rC�acceptr��deliver_challenge�answer_challenge)r:�crrrr��s

zListener.acceptcCs |j}|dk	rd|_|��dSr)r�rG)r:ZlistenerrrrrG�szListener.closecCs|jjSr)r��_addressrArrrr3�szListener.addresscCs|jjSr)r��_last_acceptedrArrr�
last_accepted�szListener.last_acceptedcCs|SrrrArrrrk�szListener.__enter__cCs|��dSrrlrmrrrrp�szListener.__exit__)NNrN)rqrrrsr>r�rGrtr3r�rkrprrrrr�s
	

cCsh|p
t|�}t|�|dkr&t|�}nt|�}|dk	rHt|t�sHtd��|dk	rdt||�t||�|Sr�)	r4r-�
PipeClient�SocketClientr�rNr�r�r�)r3r'r�r�rrrr�s


TcCsj|r>t��\}}|�d�|�d�t|���}t|���}n$t��\}}t|dd�}t|dd�}||fS)NTF�r=�r<)r,Z
socketpair�setblockingr��detachr!�pipe)�duplex�s1�s2�c1�c2Zfd1Zfd2rrrrs

c

Cs�td�}|r*tj}tjtjB}tt}}ntj}tj}dt}}t�||tjBtj	Btj
tjBtjBd||tj
tj�}t�||dtjtjtjtj�}t�|tjdd�tj|dd�}|�d�\}	}
t||d�}t||d�}||fS)NrrrTrvr�r�)r(rx�PIPE_ACCESS_DUPLEX�GENERIC_READ�
GENERIC_WRITE�BUFSIZEZPIPE_ACCESS_INBOUND�CreateNamedPipe�FILE_FLAG_OVERLAPPED�FILE_FLAG_FIRST_PIPE_INSTANCE�PIPE_TYPE_MESSAGE�PIPE_READMODE_MESSAGE�	PIPE_WAIT�NMPWAIT_WAIT_FOREVER�NULL�
CreateFile�
OPEN_EXISTING�SetNamedPipeHandleState�ConnectNamedPiperyru)
r�r3Zopenmode�accessZobsizeZibsizeZh1Zh2rw�_rr�r�rrrrsT
�
��	��c@s&eZdZd	dd�Zdd�Zdd�ZdS)
r�rcCs�t�tt|��|_zRtjdkr2|j�tjtjd�|j�d�|j�	|�|j�
|�|j��|_Wn t
k
r�|j���YnX||_d|_|dkr�t�|�s�tj|tj|fdd�|_nd|_dS)N�posixrTrr��argsZexitpriority)r,�getattr�_socketr!�nameZ
setsockoptZ
SOL_SOCKETZSO_REUSEADDRr�ZbindZlistenZgetsocknamer�rCrGZ_familyr�rr2�Finalize�unlink�_unlink)r:r3r'r�rrrr>Ks0

�
�
zSocketListener.__init__cCs&|j��\}|_|�d�t|���S�NT)r�r�r�r�r�r��r:�srrrr�ds
zSocketListener.acceptcCs0z|j��W5|j}|dk	r*d|_|�XdSr)r�r�rG)r:r�rrrrGiszSocketListener.closeN)r)rqrrrsr>r�rGrrrrr�Gs
r�c
CsPt|�}t�tt|���.}|�d�|�|�t|���W5QR�SQRXdSr�)r4r,r�r�Zconnectr�r�)r3r'r�rrrr�ss


r�c@s4eZdZddd�Zddd�Zdd�Zed	d
��ZdS)
r�NcCsL||_|jdd�g|_d|_t�d|j�tj|tj|j|jfdd�|_	dS)NT)�firstz listener created with address=%rrr�)
r��_new_handle�
_handle_queuer�r�	sub_debugr�r��_finalize_pipe_listenerrG)r:r3r�rrrr>�s
�zPipeListener.__init__Fc
CsHtjtjB}|r|tjO}t�|j|tjtjBtjBtj	t
t
tjtj�Sr)
rxr�r�r�r�r�r�r�r�ZPIPE_UNLIMITED_INSTANCESr�r�r�)r:r��flagsrrrr��s

��zPipeListener._new_handlec
Cs�|j�|���|j�d�}ztj|dd�}Wn0tk
r^}z|jtjkrN�W5d}~XYnPXz<zt�
|jgdt�}Wn |�
�t�|��YnXW5|�	d�\}}Xt|�S)NrTrvF)r��appendr��poprxr�rCr�Z
ERROR_NO_DATAryr{r|rr}r�ru)r:r;r~r�r�r�resrrrr��s(�
zPipeListener.acceptcCs$t�d|�|D]}t�|�qdS)Nz closing listener with address=%r)rr�rxr�)Zqueuer3r;rrrr��sz$PipeListener._finalize_pipe_listener)N)F)rqrrrsr>r�r��staticmethodr�rrrrr��s


r�c
Cs�t�}z6t�|d�t�|tjtjBdtjtjtjtj�}Wq�t	k
rz}z |j
tjtjfksht
|�rj�W5d}~XYqXq�q�t�|tjdd�t|�S)N��r)rrxZ
WaitNamedPiper�r�r�r�r�r�rCr�ZERROR_SEM_TIMEOUTZERROR_PIPE_BUSYrr�r�ru)r3r�hr�rrrr��s8
����r��s#CHALLENGE#s	#WELCOME#s	#FAILURE#cCs�ddl}t|t�s$td�t|����t�t�}|�	t
|�|�||t��
�}|�d�}||krl|�	t�n|�	t�td��dS)Nr� Authkey must be bytes, not {0!s}�zdigest received was wrong)�hmacr�rNr%�formatr.r!�urandom�MESSAGE_LENGTHrV�	CHALLENGE�new�HMAC_DIGEST_NAME�digestr^�WELCOME�FAILUREr�Z
connectionr�r��messager�Zresponserrrr��s
�


r�cCsxddl}t|t�s$td�t|����|�d�}|tt�d�}|�	||t
���}|�|�|�d�}|t
krttd��dS)Nrr�r�zdigest sent was rejected)r�r�rNr%r�r.r^rOr�r�r�r�rVr�rr�rrrr��s
�


r�c@s$eZdZdd�Zdd�Zdd�ZdS)�ConnectionWrappercCs6||_||_||_dD]}t||�}t|||�qdS)N)rKrGrjr^rV)�_conn�_dumps�_loadsr��setattr)r:�connrXrd�attrrZrrrr>s
zConnectionWrapper.__init__cCs|�|�}|j�|�dSr)r�r�rV)r:rZr�rrrr[	s
zConnectionWrapper.sendcCs|j��}|�|�Sr)r�r^r�r�rrrrfs
zConnectionWrapper.recvN)rqrrrsr>r[rfrrrrr�sr�cCst�|fdddd��d�S)Nr�utf-8)�	xmlrpclibrX�encode)rZrrr�
_xml_dumpssrcCst�|�d��\\}}|S)Nr)rrd�decode)r�rZ�methodrrr�
_xml_loadssrc@seZdZdd�ZdS)�XmlListenercCs"ddlmat�|�}t|tt�Sr�)�
xmlrpc.client�clientrrr�r�rrrYrrrr�s
zXmlListener.acceptN)rqrrrsr�rrrrr	sr	cOsddlmatt||�tt�Sr�)r
rrr�rrr)r��kwdsrrr�	XmlClientsr
cCs�t|�}g}|r�t�|d|�}|tkr*q�n\t|krFtt|�krTnn
|t8}n2t|krptt|�kr~nn
|t8}ntd��|�||�||dd�}d}q|S)NFzShould not get hererr)	�listrxr{r
rrOrr�r�)Zhandlesr�L�readyr�rrr�_exhaustive_wait)s 
 
rc
s^|dkrt}n|dkrd}nt|dd�}t|�}i�g}t��t�}�z@|D�]&}zt|d�}	Wn tk
r�|�|��<YqPXzt	�|	�dd�\}}Wn8tk
r�}zd|j}}|tkrƂW5d}~XYnX|t	jkr�|�|�|�|j<qP|�rjt��dd�dk�rjz|�d	�\}}Wn*tk
�rP}z
|j}W5d}~XYnX|�sjt
|d��rjd|_��|�d}qPt���|�}W5|D]}|���q�|D]�}z|�d�\}}Wn6tk
�r�}z|j}|tk�r�W5d}~XYnX|t	j
k�r��|j}��|�|dk�r�t
|d��r�d|_�q�X���fd
d�|D���fdd
�|D�S)Nrr�g�?Tr�rK�)�rFc3s|]}�|VqdSrr)�.0r�)�waithandle_to_objrr�	<genexpr>�szwait.<locals>.<genexpr>csg|]}|�kr|�qSrr)r�o)�
ready_objectsrr�
<listcomp>�s�wait.<locals>.<listcomp>)r�intr�setr}ryrCr��
_ready_errorsrxZERROR_OPERATION_ABORTEDr|�addr+r�r��AttributeErrorr6r�rzr�r)Zgetwindowsversionr�keys�update)
�object_listrZov_listZ
ready_handlesr~r�rr�rrKr)rrrr?sh







�PollSelectorc
Cs�t���}|D]}|�|tj�q|dk	r4t��|}|�|�}|r\dd�|D�W5QR�S|dk	r4|t��}|dkr4|W5QR�Sq4W5QRXdS)NcSsg|]\}}|j�qSr)Zfileobj)r�keyZeventsrrrr�srr)�
_WaitSelector�register�	selectorsZ
EVENT_READrrZselect)r"rZselectorrZZdeadlinerrrrr�s
c
CsZ|��}t�|tjtj��6}ddlm}|�|�}t||j	|j
ffW5QR�SQRXdS)Nr)�resource_sharer)rKr,ZfromfdrZSOCK_STREAMrr(Z	DupSocket�rebuild_connectionr<r=)rr;r�r(�dsrrr�reduce_connection�s

r+cCs|��}t|��||�Sr�r�r�)r*r<r=Zsockrrrr)�sr)cCsB|jrtjnd|jrtjndB}t�|��|�}t||j|jffSr�)	r<rxZFILE_GENERIC_READr=ZFILE_GENERIC_WRITEr
Z	DupHandlerK�rebuild_pipe_connection)rr��dhrrr�reduce_pipe_connection�s
�r/cCs|��}t|||�Sr)r�ru)r.r<r=r;rrrr-�sr-cCs t�|���}t||j|jffSr)r
ZDupFdrKr)r<r=)r�dfrrrr+�scCs|��}t|||�Srr,)r0r<r=�fdrrrr)�s)NN)T)T)N)N)J�__all__r�r!r)r,r�rr �	itertoolsr�rrrr	�contextr
ZForkingPicklerrWrxrrr
r�ImportErrorr*r�ZCONNECTION_TIMEOUTr��countr$r�Zfamiliesr+rrr(r-r4r5rur��objectrrrr�r�r�r�r�r�r�r�r�r�r�rrr	r
rr�ZERROR_NETNAME_DELETEDrrr'r#r%ZSelectSelectorr+r)r&r/r-rrrr�<module>
s�



PT=

,,8	P
multiprocessing/__pycache__/synchronize.cpython-38.opt-1.pyc000064400000025333151153537440020163 0ustar00U

e5dZ-�@s,ddddddgZddlZddlZddlZddlZddlZdd	lmZdd
lmZddlm	Z	zddlm
Z
mZWnek
r�ed
��YnXe
ed��\ZZej
jZGdd�de�Z
Gdd�de
�ZGdd�de�ZGdd�de
�ZGdd�de
�ZGdd�de�ZGdd�de�ZGdd�dej�ZdS)�Lock�RLock�	Semaphore�BoundedSemaphore�	Condition�Event�N�)�context)�process)�util)�SemLock�
sem_unlinkz�This platform lacks a functioning sem_open implementation, therefore, the required synchronization primitives needed will not function, see issue 3770.�c@s\eZdZe��Zdd�Zedd��Zdd�Z	dd�Z
d	d
�Zdd�Zd
d�Z
edd��ZdS)rc	Cs�|dkrtj��}|��}tjdkp*|dk}td�D]>}z t�||||�	�|�}|_
Wntk
rlYq4Xq|q4td��t�
d|j�|��tjdkr�dd�}	t�||	�|j
jdk	r�dd	lm}
|
|j
jd
�tj|tj|j
jfdd�dS)
N�win32�fork�dzcannot find name for semaphorezcreated semlock with handle %scSs|j��dS�N)�_semlock�_after_fork)�obj�r�3/usr/lib64/python3.8/multiprocessing/synchronize.pyrGsz%SemLock.__init__.<locals>._after_forkr)�register�	semaphorer)Zexitpriority)r	Z_default_contextZget_contextZget_start_method�sys�platform�range�_multiprocessingr�
_make_namer�FileExistsErrorr�debug�handle�
_make_methodsZregister_after_fork�name�resource_trackerrZFinalize�_cleanup)�self�kind�value�maxvalue�ctxr#Z
unlink_now�i�slrrrrr�__init__2s8
�
�zSemLock.__init__cCs"ddlm}t|�||d�dS)Nr)�
unregisterr)r$r.r
)r#r.rrrr%TszSemLock._cleanupcCs|jj|_|jj|_dSr)r�acquire�release�r&rrrr"Zs
zSemLock._make_methodscCs
|j��Sr)r�	__enter__r1rrrr2^szSemLock.__enter__cGs|jj|�Sr)r�__exit__�r&�argsrrrr3aszSemLock.__exit__cCsDt�|�|j}tjdkr,t���|j�}n|j}||j|j	|j
fS)Nr)r	�assert_spawningrrrZget_spawning_popenZduplicate_for_childr!r'r)r#)r&r,�hrrr�__getstate__ds

zSemLock.__getstate__cCs,tjj|�|_t�d|d�|��dS)Nz recreated blocker with handle %rr)rrZ_rebuildrrr r"�r&�staterrr�__setstate__mszSemLock.__setstate__cCsdt��jdttj�fS)Nz%s-%sZ	semprefix)r
�current_processZ_config�nextr�_randrrrrrrs�zSemLock._make_nameN)�__name__�
__module__�__qualname__�tempfileZ_RandomNameSequencer>r-�staticmethodr%r"r2r3r8r;rrrrrr.s"
	rc@s&eZdZd	dd�Zdd�Zdd�ZdS)
rrcCstj|t|t|d�dS�N�r*)rr-�	SEMAPHORE�
SEM_VALUE_MAX�r&r(r*rrrr-}szSemaphore.__init__cCs
|j��Sr)r�
_get_valuer1rrr�	get_value�szSemaphore.get_valuecCs8z|j��}Wntk
r&d}YnXd|jj|fS)N�unknownz<%s(value=%s)>)rrI�	Exception�	__class__r?�r&r(rrr�__repr__�s

zSemaphore.__repr__N)r)r?r@rAr-rJrOrrrrr{s
c@seZdZddd�Zdd�ZdS)rrcCstj|t|||d�dSrD�rr-rFrHrrrr-�szBoundedSemaphore.__init__cCs>z|j��}Wntk
r&d}YnXd|jj||jjfS)NrKz<%s(value=%s, maxvalue=%s)>)rrIrLrMr?r)rNrrrrO�s
�zBoundedSemaphore.__repr__N)r�r?r@rAr-rOrrrrr�s
c@seZdZdd�Zdd�ZdS)rcCstj|tdd|d�dS�NrrErP�r&r*rrrr-�sz
Lock.__init__cCs�zf|j��r8t��j}t��jdkrd|dt��j7}n,|j��dkrLd}n|j��dkr`d}nd}Wnt	k
r~d}YnXd	|j
j|fS)
N�
MainThread�|r�Noner�SomeOtherThread�SomeOtherProcessrKz<%s(owner=%s)>)r�_is_miner
r<r#�	threading�current_threadrI�_countrLrMr?)r&r#rrrrO�s


z
Lock.__repr__NrQrrrrr�sc@seZdZdd�Zdd�ZdS)rcCstj|tdd|d�dSrR)rr-�RECURSIVE_MUTEXrSrrrr-�szRLock.__init__cCs�z||j��rBt��j}t��jdkr6|dt��j7}|j��}n8|j��dkrZd\}}n |j��dkrrd\}}nd\}}Wnt	k
r�d\}}YnXd	|j
j||fS)
NrTrUr)rVrr)rW�nonzero)rXr^)rKrK�<%s(%s, %s)>)rrYr
r<r#rZr[r\rIrLrMr?)r&r#�countrrrrO�s



zRLock.__repr__NrQrrrrr�sc@sleZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	ddd�Z
ddd�Zdd�Zddd�Z
dS)rNcCs>|p
|��|_|�d�|_|�d�|_|�d�|_|��dS�Nr)r�_lockr�_sleeping_count�_woken_count�_wait_semaphorer")r&�lockr*rrrr-�s
zCondition.__init__cCst�|�|j|j|j|jfSr)r	r6rbrcrdrer1rrrr8�s

�zCondition.__getstate__cCs |\|_|_|_|_|��dSr)rbrcrdrer"r9rrrr;�s
�
zCondition.__setstate__cCs
|j��Sr)rbr2r1rrrr2�szCondition.__enter__cGs|jj|�Sr)rbr3r4rrrr3�szCondition.__exit__cCs|jj|_|jj|_dSr)rbr/r0r1rrrr"�s
zCondition._make_methodscCsJz|jj��|jj��}Wntk
r4d}YnXd|jj|j|fS)NrKr_)rcrrIrdrLrMr?rb)r&Znum_waitersrrrrO�s

�
zCondition.__repr__c	Csj|j��|jj��}t|�D]}|j��qz|j�d|�W�S|j��t|�D]}|j��qTXdS)NT)	rcr0rbrr\rrdr/re)r&�timeoutr`r+rrr�wait�s

zCondition.waitrcCst|j�d�r|j�d�}qd}||krF|j�d�rF|j��|d7}q|rpt|�D]}|j��qR|j�d�rpqbdS)NFrr)rdr/rcrer0r)r&�n�resZsleepersr+rrr�notifys

zCondition.notifycCs|jtjd�dS)N)ri)rkr�maxsizer1rrr�
notify_all(szCondition.notify_allcCsd|�}|r|S|dk	r$t��|}nd}d}|s`|dk	rN|t��}|dkrNq`|�|�|�}q,|Sra)�time�	monotonicrh)r&Z	predicaterg�resultZendtimeZwaittimerrr�wait_for+s
zCondition.wait_for)N)N)r)N)r?r@rAr-r8r;r2r3r"rOrhrkrmrqrrrrr�s


c@s6eZdZdd�Zdd�Zdd�Zdd�Zdd
d�Zd	S)
rcCs |�|���|_|�d�|_dSra)rr�_condr�_flagrSrrrr-CszEvent.__init__c	CsD|j�4|j�d�r,|j��W5QR�dSW5QR�dSQRXdS�NFT)rrrsr/r0r1rrr�is_setGs

zEvent.is_setc	Cs6|j�&|j�d�|j��|j��W5QRXdS�NF)rrrsr/r0rmr1rrr�setNs
z	Event.setc	Cs"|j�|j�d�W5QRXdSrv)rrrsr/r1rrr�clearTszEvent.clearNc	Csh|j�X|j�d�r |j��n|j�|�|j�d�rP|j��W5QR�dSW5QR�dSQRXdSrt)rrrsr/r0rh)r&rgrrrrhXs
z
Event.wait)N)r?r@rAr-rurwrxrhrrrrrAs
c@sZeZdZddd�Zdd�Zdd�Zedd	��Zejd
d	��Zedd��Z	e	jd
d��Z	dS)�BarrierNc	CsRddl}ddlm}||�d�d�}|��}|�|||||f�d|_d|_dS)Nrr)�
BufferWrapperr+r)�struct�heaprzZcalcsizerr;�_stater\)	r&Zparties�actionrgr*r{rz�wrapperZcondrrrr-jszBarrier.__init__cCs.|\|_|_|_|_|_|j���d�|_dS)Nr+)�_parties�_action�_timeoutrr�_wrapperZcreate_memoryview�cast�_arrayr9rrrr;ss
�zBarrier.__setstate__cCs|j|j|j|j|jfSr)r�r�r�rrr�r1rrrr8xs�zBarrier.__getstate__cCs
|jdSra�r�r1rrrr}|szBarrier._statecCs||jd<dSrar�rNrrrr}�scCs
|jdS�Nrr�r1rrrr\�szBarrier._countcCs||jd<dSr�r�rNrrrr\�s)NN)
r?r@rAr-r;r8�propertyr}�setterr\rrrrryhs
	


ry)�__all__rZrrBrrn�r	r
rrr
�ImportError�listrr]rFrG�objectrrrrrrryrrrr�<module>s8�	Mo'multiprocessing/__pycache__/util.cpython-38.pyc000064400000026340151153537440015625 0ustar00U

e5d~6�@s�ddlZddlZddlZddlZddlZddlZddlmZddlm	Z	ddddd	d
ddd
ddddddgZ
dZdZdZ
dZdZdZdZdadadd�Zdd�Zdd�Zdd�Zdd	�Zd@d d
�Zd!d"�Zd#d$�Ze�Zd%d&�Zd'd�Ze��Z e�!�Z"d(d)�Z#d*d�Z$iZ%e�!�Z&Gd+d�de'�Z(dAd,d-�Z)d.d
�Z*da+eee)e	j,e	j-fd/d0�Z.e�/e.�Gd1d�de'�Z0Gd2d�dej1�Z2ze�3d3�Z4Wne5k
�r�d4Z4YnXd5d�Z6d6d7�Z7d8d9�Z8d:d;�Z9d<d=�Z:d>d?�Z;dS)B�N)�_args_from_interpreter_flags�)�process�	sub_debug�debug�info�sub_warning�
get_logger�
log_to_stderr�get_temp_dir�register_after_fork�
is_exiting�Finalize�ForkAwareThreadLock�ForkAwareLocal�close_all_fds_except�SUBDEBUG�
SUBWARNING��
���multiprocessingz+[%(levelname)s/%(processName)s] %(message)sFcGstrtjt|f|��dS�N)�_logger�logr��msg�args�r�,/usr/lib64/python3.8/multiprocessing/util.pyr,scGstrtjt|f|��dSr)rr�DEBUGrrrr r0scGstrtjt|f|��dSr)rr�INFOrrrr r4scGstrtjt|f|��dSr)rrrrrrr r8scCs|ddl}|��z\tsj|�t�adt_ttd�rFt�	t
�t�t
�n$tj�
t
dif�tj�t
dif�W5|��XtS)z0
    Returns logger used by multiprocessing
    rN�
unregisterr)�loggingZ_acquireLockZ_releaseLockrZ	getLogger�LOGGER_NAMEZ	propagate�hasattr�atexitr#�_exit_function�registerZ
_exithandlers�remove�append)r$rrr r	<s



cCsJddl}t�}|�t�}|��}|�|�|�|�|rB|�|�dat	S)zB
    Turn on logging and add a handler which prints to stderr
    rNT)
r$r	Z	Formatter�DEFAULT_LOGGING_FORMATZ
StreamHandlerZsetFormatterZ
addHandlerZsetLevel�_log_to_stderrr)�levelr$ZloggerZ	formatterZhandlerrrr r
Ws



cCs tjdkrdSttd�rdSdS)NZlinuxTZgetandroidapilevelF)�sys�platformr&rrrr �#_platform_supports_abstract_socketsls


r1cCs@|sdSt|t�r|ddkSt|t�r4|ddkStd��dS)NFr�z(address type of {address!r} unrecognized)�
isinstance�bytes�str�	TypeError)Zaddressrrr �is_abstract_socket_namespacets

r7cCs&||�t��}|dk	r"d|jd<dS)N�tempdir)r�current_process�_config)�rmtreer8r9rrr �_remove_temp_dir�sr<cCsft��j�d�}|dkrbddl}ddl}|jdd�}td|�tdt	|j
|fdd�|t��jd<|S)Nr8rzpymp-)�prefixzcreated temp directory %si����)r�exitpriority)rr9r:�get�shutil�tempfileZmkdtemprrr<r;)r8r@rArrr r�s
�cCsftt���}|��|D]H\\}}}}z||�Wqtk
r^}ztd|�W5d}~XYqXqdS)Nz after forker raised exception %s)�list�_afterfork_registry�items�sort�	Exceptionr)rD�indexZident�func�obj�errr �_run_after_forkers�srKcCs|ttt�t|�|f<dSr)rC�next�_afterfork_counter�id)rIrHrrr r�sc@sFeZdZdZddd�Zdeeejfdd�Z	dd	�Z
d
d�Zdd
�ZdS)rzA
    Class which supports object finalization using weakrefs
    rNcCs�|dk	r&t|t�s&td�|t|����|dk	r>t�||�|_n|dkrNtd��||_	||_
|p`i|_|tt
�f|_t��|_|t|j<dS)Nz3Exitpriority ({0!r}) must be None or int, not {1!s}z+Without object, exitpriority cannot be None)r3�intr6�format�type�weakref�ref�_weakref�
ValueError�	_callback�_args�_kwargsrL�_finalizer_counter�_key�os�getpid�_pid�_finalizer_registry)�selfrI�callbackr�kwargsr>rrr �__init__�s"��

zFinalize.__init__cCs�z||j=Wntk
r(|d�YnbX|j|�krD|d�d}n$|d|j|j|j�|j|j|j�}d|_|_|_|_|_|SdS)zQ
        Run the callback unless it has already been called or cancelled
        zfinalizer no longer registeredz+finalizer ignored because different processNz/finalizer calling %s with args %s and kwargs %s)rZ�KeyErrorr]rVrWrXrT)r_Zwrr^rr\�resrrr �__call__�s$��zFinalize.__call__cCsDzt|j=Wntk
r Yn Xd|_|_|_|_|_dS)z3
        Cancel finalization of the object
        N)r^rZrcrTrVrWrX�r_rrr �cancel�s��zFinalize.cancelcCs
|jtkS)zS
        Return whether this finalizer is still waiting to invoke callback
        )rZr^rfrrr �still_active�szFinalize.still_activec	Cs�z|��}Wnttfk
r(d}YnX|dkr>d|jjSd|jjt|jd|j�f}|jrr|dt|j�7}|j	r�|dt|j	�7}|j
ddk	r�|dt|j
d�7}|dS)	Nz<%s object, dead>z<%s object, callback=%s�__name__z, args=z	, kwargs=rz, exitpriority=�>)rT�AttributeErrorr6�	__class__ri�getattrrVrWr5rXrZ)r_rI�xrrr �__repr__�s"
�zFinalize.__repr__)rNN)
ri�
__module__�__qualname__�__doc__rbr^rr[r\rergrhrorrrr r�s
�
c	s�tdkrdS�dkrdd��n�fdd���fdd�tt�D�}|jdd�|D]P}t�|�}|dk	rPtd	|�z
|�WqPtk
r�d
dl}|��YqPXqP�dkr�t��dS)z�
    Run all finalizers whose exit priority is not None and at least minpriority

    Finalizers with highest priority are called first; finalizers with
    the same priority will be called in reverse order of creation.
    NcSs|ddk	S�Nrr��prrr �<lambda>�z!_run_finalizers.<locals>.<lambda>cs|ddk	o|d�kSrsrrt)�minpriorityrr rvrwcsg|]}�|�r|�qSrr)�.0�key)�frr �
<listcomp>#sz#_run_finalizers.<locals>.<listcomp>T)�reversez
calling %sr)	r^rBrEr?rrF�	traceback�	print_exc�clear)rx�keysrz�	finalizerr~r)r{rxr �_run_finalizerss$



r�cCstp
tdkS)z6
    Returns true if the process is shutting down
    N)�_exitingrrrr r
8scCs�ts�da|d�|d�|d�|�dk	rr|�D] }|jr0|d|j�|j��q0|�D]}|d|j�|��qX|d�|�dS)NTzprocess shutting downz2running all "atexit" finalizers with priority >= 0rz!calling terminate() for daemon %szcalling join() for process %sz)running the remaining "atexit" finalizers)r�Zdaemon�nameZ_popenZ	terminate�join)rrr��active_childrenr9rurrr r(@s	



r(c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
rcCs|��t|tj�dSr)�_resetrrrfrrr rbqszForkAwareThreadLock.__init__cCs"t��|_|jj|_|jj|_dSr)�	threadingZLock�_lock�acquire�releaserfrrr r�us

zForkAwareThreadLock._resetcCs
|j��Sr)r��	__enter__rfrrr r�zszForkAwareThreadLock.__enter__cGs|jj|�Sr)r��__exit__)r_rrrr r�}szForkAwareThreadLock.__exit__N)rirprqrbr�r�r�rrrr rpsc@seZdZdd�Zdd�ZdS)rcCst|dd��dS)NcSs
|j��Sr)�__dict__r�)rIrrr rv�rwz)ForkAwareLocal.__init__.<locals>.<lambda>)rrfrrr rb�szForkAwareLocal.__init__cCst|�dfS)Nr)rQrfrrr �
__reduce__�szForkAwareLocal.__reduce__N)rirprqrbr�rrrr r�s�SC_OPEN_MAX�cCsbt|�dtg}|��|dtks,td��tt|�d�D] }t�||d||d�q<dS)N���zfd too larger)rB�MAXFDrE�AssertionError�range�lenr[�
closerange)�fds�irrr r�s
c	Cs�tjdkrdSztj��Wnttfk
r4YnXz@t�tjtj�}zt|dd�t_Wnt�|��YnXWnttfk
r�YnXdS)NF)�closefd)	r/�stdin�close�OSErrorrUr[�open�devnull�O_RDONLY)�fdrrr �_close_stdin�s

r�c	CsTztj��Wnttfk
r&YnXztj��Wnttfk
rNYnXdSr)r/�stdout�flushrkrU�stderrrrrr �_flush_std_streams�sr�cCsxddl}tttt|���}t��\}}z6|�|t�	|�gd|dddddddd||ddd�W�St�|�t�|�XdS)NrTr�F)
�_posixsubprocess�tuple�sorted�maprOr[�piper�Z	fork_exec�fsencode)�pathrZpassfdsr�Zerrpipe_readZ
errpipe_writerrr �spawnv_passfds�s2
�
r�cGs|D]}t�|�qdS)z/Close each file descriptor given as an argumentN)r[r�)r�r�rrr �	close_fds�sr�cCsZddlm}t��ddlm}|j��ddlm}|j	��t
�|��|��dS)zKCleanup multiprocessing resources when multiprocessing tests
    completed.r)�support)�
forkserver)�resource_trackerN)
Ztestr�rZ_cleanuprr�Z_forkserverZ_stopr�Z_resource_trackerr�Z
gc_collectZ
reap_children)r�r�r�rrr �_cleanup_tests�s

r�)N)N)<r[�	itertoolsr/rRr'r��
subprocessr�r�__all__ZNOTSETrr!r"rr%r,rr-rrrrr	r
r1r7Zabstract_sockets_supportedr<rZWeakValueDictionaryrC�countrMrKrr^rY�objectrr�r
r�r�r9r(r)rZlocalr�sysconfr�rFrr�r�r�r�r�rrrr �<module>
s��

		V
,�
*



multiprocessing/__pycache__/popen_spawn_win32.cpython-38.pyc000064400000006607151153537440020227 0ustar00U

e5d��@s�ddlZddlZddlZddlZddlZddlmZmZmZddl	m
Z
ddl	mZdgZdZ
ejdkoreed	d
�Zej���d�Zdd
�Zeejej�Zdd�ZGdd�de�ZdS)�N�)�	reduction�get_spawning_popen�set_spawning_popen)�spawn)�util�PopeniZwin32�frozenFzpythonservice.execCs ||kptj�|�tj�|�kS�N)�os�path�normcase)Zp1Zp2�r�9/usr/lib64/python3.8/multiprocessing/popen_spawn_win32.py�_path_eqsrcGs|D]}t�|�qdSr
)�_winapi�CloseHandle)Zhandles�handlerrr�_close_handlessrc@sJeZdZdZdZdd�Zdd�Zddd	�Zd
d�Zdd
�Z	e	Z
dd�ZdS)rz@
    Start a subprocess to run the code of a process object
    rcCsTt�|j�}t�dd�\}}t�|d�}tjt�	�|d�}d�
dd�|D��}t��}tr�t
|tj�r�tj}tj��}tj|d<nd}t|ddd	���}	z0t�||ddd
d|dd�	\}
}}}
t�|�Wnt�|��YnX||_d|_|
|_t|
�|_t�|t|jt|�f�|_t|�zt �!||	�t �!||	�W5td�XW5QRXdS)Nr)Z
parent_pidZpipe_handle� css|]}d|VqdS)z"%s"Nr)�.0�xrrr�	<genexpr>9sz!Popen.__init__.<locals>.<genexpr>�__PYVENV_LAUNCHER__�wbT)�closefdF)"rZget_preparation_data�_namerZ
CreatePipe�msvcrtZopen_osfhandleZget_command_liner�getpid�joinZget_executable�WINENVr�sys�
executable�_base_executable�environ�copy�openZ
CreateProcessr�pid�
returncode�_handle�int�sentinelrZFinalizer�	finalizerrr�dump)�selfZprocess_objZ	prep_dataZrhandleZwhandleZwfd�cmdZ
python_exe�envZto_childZhpZhtr'�tidrrr�__init__,sT
�
�

�zPopen.__init__cCs|t�kst�t�||j�Sr
)r�AssertionErrorrZ	duplicater+)r.rrrr�duplicate_for_childaszPopen.duplicate_for_childNcCst|jdkrn|dkrtj}ntdt|dd��}t�t|j�|�}|tjkrnt�|j�}|t	krht
j}||_|jS)Nri�g�?)r(rZINFINITE�maxr*ZWaitForSingleObjectr)Z
WAIT_OBJECT_0ZGetExitCodeProcess�	TERMINATE�signal�SIGTERM)r.�timeoutZmsecs�res�coderrr�waites

z
Popen.waitcCs|jdd�S)Nr�r9)r<�r.rrr�pollusz
Popen.pollcCsL|jdkrHzt�t|j�t�Wn&tk
rF|jdd�dkrB�YnXdS)Ng�?r=)r(rZTerminateProcessr*r)r6�OSErrorr<r>rrr�	terminatexs
zPopen.terminatecCs|��dSr
)r,r>rrr�close�szPopen.close)N)�__name__�
__module__�__qualname__�__doc__�methodr2r4r<r?rA�killrBrrrrr&s5
)rrr7r!r�contextrrr�rr�__all__r6�platform�getattrZWINEXEr"�lower�endswithZ
WINSERVICErr#r r�objectrrrrr�<module>s
multiprocessing/__pycache__/managers.cpython-38.pyc000064400000121114151153537440016440 0ustar00U

e5d��@sBdddddgZddlZddlZddlZddlZddlZddlZddlZddlmZddl	m
Z
d	d
lmZd	dl
mZmZmZd	dlmZd	d
lmZd	dlmZd	dlmZzd	dlmZdZWnek
r�dZYnXdd�Ze�eje�dd�dD�Zedek	�r.dd�ZeD]Ze�ee��qGdd�de�Zdifdd�Z dd�Z!Gd d!�d!e"�Z#d"d#�Z$d$d%�Z%Gd&d'�d'e�Z&Gd(d)�d)e�Z'ej(ej)fej*ej+fd*�Z,Gd+d�de�Z-Gd,d-�d-e.�Z/Gd.d�de�Z0d/d0�Z1ifd1d2�Z2dld3d4�Z3Gd5d6�d6e�Z4Gd7d8�d8e�Z5dmd9d:�Z6Gd;d<�d<e0�Z7Gd=d>�d>e0�Z8Gd?d@�d@e8�Z9GdAdB�dBe0�Z:GdCdD�dDe0�Z;GdEdF�dFe0�Z<GdGdH�dHe0�Z=e2dIdJ�Z>GdKdL�dLe>�Z?e2dMdN�Z@dOdPie@_Ae2dQdR�ZBe2dSdT�ZCdUdUdUdPdPdV�eC_AGdWdS�dSeC�ZDGdXd�de-�ZEeE�dYejF�eE�dZejF�eE�d[ejGe:�eE�d\ejHe8�eE�d]ejIe8�eE�d^ejJe8�eE�d_ejKe8�eE�d`ejLe9�eE�daejMe;�eE�dbejNeD�eE�dcee?�eE�ddeOe@�eE�d8e5e=�eE�d:e6eB�eE�d6e4e<�eEjdPe7dde�eEjdUddf�e�r>Gdgdh�dh�ZPGdidj�dje&�ZQGdkd�de-�ZRdS)n�BaseManager�SyncManager�	BaseProxy�Token�SharedMemoryManager�N)�getpid)�
format_exc�)�
connection)�	reduction�get_spawning_popen�ProcessError)�pool)�process)�util)�get_context)�
shared_memoryTFcCstj|j|��ffS�N)�array�typecode�tobytes)�a�r�0/usr/lib64/python3.8/multiprocessing/managers.py�reduce_array-srcCsg|]}tti|����qSr)�type�getattr��.0�namerrr�
<listcomp>1sr )�items�keys�valuescCstt|�ffSr)�list��objrrr�rebuild_as_list3sr'c@s4eZdZdZdZdd�Zdd�Zdd�Zd	d
�ZdS)rz3
    Type to uniquely identify a shared object
    ��typeid�address�idcCs||||_|_|_dSrr()�selfr)r*r+rrr�__init__BszToken.__init__cCs|j|j|jfSrr(�r,rrr�__getstate__EszToken.__getstate__cCs|\|_|_|_dSrr(�r,�staterrr�__setstate__HszToken.__setstate__cCsd|jj|j|j|jfS)Nz %s(typeid=%r, address=%r, id=%r))�	__class__�__name__r)r*r+r.rrr�__repr__Ks�zToken.__repr__N)	r4�
__module__�__qualname__�__doc__�	__slots__r-r/r2r5rrrrr<srcCs8|�||||f�|��\}}|dkr*|St||��dS)zL
    Send a message to manager using connection `c` and return response
    �#RETURNN)�send�recv�convert_to_error)�cr+�
methodname�args�kwds�kind�resultrrr�dispatchSs
rDcCsd|dkr|S|dkrRt|t�s4td�||t|����|dkrHtd|�St|�Sntd�|��SdS)N�#ERROR)�
#TRACEBACK�#UNSERIALIZABLEz.Result {0!r} (kind '{1}') type is {2}, not strrGzUnserializable message: %s
zUnrecognized message type {!r})�
isinstance�str�	TypeError�formatr�RemoteError�
ValueError)rBrCrrrr=]s
��
r=c@seZdZdd�ZdS)rLcCsdt|jd�dS)NzM
---------------------------------------------------------------------------
rzK---------------------------------------------------------------------------)rIr@r.rrr�__str__mszRemoteError.__str__N)r4r6r7rNrrrrrLlsrLcCs2g}t|�D] }t||�}t|�r|�|�q|S)z4
    Return a list of names of methods of `obj`
    )�dirr�callable�append)r&�tempr�funcrrr�all_methodsts
rTcCsdd�t|�D�S)zP
    Return a list of names of methods of `obj` which do not start with '_'
    cSsg|]}|ddkr|�qS)r�_rrrrrr �sz"public_methods.<locals>.<listcomp>)rTr%rrr�public_methodssrVc	@s�eZdZdZdddddddd	d
g	Zdd�Zd
d�Zdd�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zeee
d�Z
dd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&e_d'd(�Zd)d*�Zd+d,�Zd-d.�Zd/S)0�ServerzM
    Server class which runs in a process controlled by a manager object
    �shutdown�create�accept_connection�get_methods�
debug_info�number_of_objects�dummy�incref�decrefcCsxt|t�std�|t|����||_t�|�|_t	|\}}||dd�|_
|j
j|_ddi|_i|_
i|_t��|_dS)Nz&Authkey {0!r} is type {1!s}, not bytes�)r*Zbacklog�0�Nr)rH�bytesrJrKr�registryr�AuthenticationString�authkey�listener_client�listenerr*�	id_to_obj�id_to_refcount�id_to_local_proxy_obj�	threading�Lock�mutex)r,rer*rg�
serializer�Listener�Clientrrrr-�s 
��

zServer.__init__c	Cs�t��|_|t��_zVtj|jd�}d|_|��z|j��sL|j�d�q4Wnttfk
rfYnXW5tjtjkr�t	�
d�tjt_tjt_t�
d�XdS)z(
        Run the server forever
        zresetting stdout, stderrr)�targetTr	N)rm�Event�
stop_eventr�current_process�_manager_server�sys�stdout�
__stdout__r�debug�
__stderr__�stderr�exit�Thread�accepter�daemon�start�is_set�wait�KeyboardInterrupt�
SystemExit)r,r�rrr�
serve_forever�s 




zServer.serve_forevercCsNz|j��}Wntk
r&YqYnXtj|j|fd�}d|_|��qdS)N�rsr@T)riZaccept�OSErrorrmr�handle_requestr�r�)r,r>�trrrr��s
zServer.acceptercCsLd}}}zTt�||j�t�||j�|��}|\}}}}||jksTtd|��t||�}Wntk
r~dt	�f}	Yn>Xz||f|�|�}Wntk
r�dt	�f}	Yn
Xd|f}	z|�
|	�Wnttk
�r>}
zTz|�
dt	�f�Wntk
�rYnXt�d|	�t�d|�t�d|
�W5d}
~
XYnX|�
�dS)z)
        Handle a new connection
        Nz%r unrecognizedrFr:zFailure to send message: %rz ... request was %r� ... exception was %r)r
Zdeliver_challengergZanswer_challenger<�public�AssertionErrorr�	Exceptionrr;r�info�close)r,r>�funcnamerC�request�ignorer@rArS�msg�errrr��s4zServer.handle_requestc
Cs�t�dt��j�|j}|j}|j}|j�	��s�zBd}}|�}|\}}}	}
z||\}}}Wn^t
k
r�}
z@z|j|\}}}Wn&t
k
r�}z|
�W5d}~XYnXW5d}
~
XYnX||kr�td|t
|�|f��t||�}z||	|
�}Wn,tk
�r"}zd|f}W5d}~XYnPX|�o4|�|d�}|�rj|�|||�\}}t||j|�}d||ff}nd|f}Wn�tk
�r�|dk�r�dt�f}nNz,|j|}|||||f|	�|
�}d|f}Wn tk
�r�dt�f}YnXYnPtk
�rt�dt��j�t�d	�Yn tk
�r<dt�f}YnXzDz||�Wn2tk
�r~}z|d
t�f�W5d}~XYnXWq$tk
�r�}z@t�dt��j�t�d|�t�d
|�|��t�d�W5d}~XYq$Xq$dS)zQ
        Handle requests from the proxies in a particular process/thread
        z$starting server thread to service %rNz+method %r of %r object is not in exposed=%rrE�#PROXYr:rFz$got EOF -- exiting thread serving %rrrGzexception in thread serving %rz ... message was %rr�r	)rr{rm�current_threadrr<r;rjrur��KeyErrorrl�AttributeErrorrrr��getrYrr*r�fallback_mapping�EOFErrorrxr~r�r�)r,�connr<r;rjr?r&r��identr@rA�exposed�	gettypeid�keZ	second_keZfunction�resr�r�r)ZridentZrexposed�tokenZ
fallback_funcrCrrr�serve_client�s���(��


����$�zServer.serve_clientcCs|Srr�r,r�r�r&rrr�fallback_getvalue5szServer.fallback_getvaluecCst|�Sr�rIr�rrr�fallback_str8szServer.fallback_strcCst|�Sr)�reprr�rrr�
fallback_repr;szServer.fallback_repr)rNr5�	#GETVALUEcCsdSrr�r,r>rrrr^DszServer.dummyc
Cs�|j�tg}t|j���}|��|D]<}|dkr&|�d||j|t|j|d�dd�f�q&d�|�W5QR�SQRXdS)zO
        Return some info --- useful to spot problems with refcounting
        rbz  %s:       refcount=%s
    %srN�K�
)	ror$rkr"�sortrQrIrj�join)r,r>rCr"r�rrrr\Gs
��zServer.debug_infocCs
t|j�S)z*
        Number of shared objects
        )�lenrkr�rrrr]WszServer.number_of_objectscCsLz:zt�d�|�d�Wnddl}|��YnXW5|j��XdS)z'
        Shutdown this process
        z!manager received shutdown message�r:NrN)ru�setrr{r;�	traceback�	print_exc)r,r>r�rrrrX^s
zServer.shutdownc	Os�t|�dkr|^}}}}n�|s(td��n�d|krDtdt|�d��|�d�}t|�dkr~|^}}}ddl}|jd	tdd
�nFd|kr�tdt|�d��|�d�}|^}}ddl}|jdtdd
�t|�}|j��|j|\}}}}	|dk�r|�st|�dk�rt	d
��|d}
n
|||�}
|dk�r2t
|
�}|dk	�rlt|t��s\td�
|t|����t|�t|�}dt|
�}t�d||�|
t|�|f|j|<||jk�r�d|j|<W5QRX|�||�|t|�fS)z>
        Create a new shared object and return its id
        �z8descriptor 'create' of 'Server' object needs an argumentr)�7create expected at least 2 positional arguments, got %dr	�rNz2Passing 'typeid' as keyword argument is deprecated)�
stacklevelr>z-Passing 'c' as keyword argument is deprecatedz4Without callable, must have one non-keyword argumentz,Method_to_typeid {0!r}: type {1!s}, not dictz%xz&%r callable returned object with id %r)r�rJ�pop�warnings�warn�DeprecationWarning�tuplerorerMrVrH�dictrKrr$r+rr{r�rjrkr_)r@rAr,r>r)r�rPr��method_to_typeid�	proxytyper&r�rrrrYksp

�

�
�
��

�



��z
Server.createz$($self, c, typeid, /, *args, **kwds)cCst|j|jd�S)zL
        Return the methods of the shared object indicated by token
        r	)r�rjr+)r,r>r�rrrr[�szServer.get_methodscCs"|t��_|�d�|�|�dS)z=
        Spawn a new thread to serve this connection
        r�N)rmr�rr;r�)r,r>rrrrrZ�s

zServer.accept_connectioncCs�|j��z|j|d7<Wnhtk
r�}zJ||jkrrd|j|<|j||j|<|j|\}}}t�d|�n|�W5d}~XYnXW5QRXdS)Nr	z&Server re-enabled tracking & INCREF %r)rorkr�rlrjrr{)r,r>r�r�r&r�r�rrrr_�s

�z
Server.increfc	Cs�||jkr$||jkr$t�d|�dS|j�Z|j|dkrXtd�||j||j|���|j|d8<|j|dkr�|j|=W5QRX||jkr�d|j|<t�d|�|j�|j|=W5QRXdS)NzServer DECREF skipping %rrz+Id {0!s} ({1!r}) has refcount {2:n}, not 1+r	)NrNzdisposing of obj with id %r)rkrlrr{ror�rKrj)r,r>r�rrrr`�s,
���

z
Server.decrefN)r4r6r7r8r�r-r�r�r�r�r�r�r�r�r^r\r]rXrY�__text_signature__r[rZr_r`rrrrrW�s<�
"Q�
=rWc@seZdZdgZdZdZdZdS)�State�valuerr	r�N)r4r6r7r9�INITIAL�STARTED�SHUTDOWNrrrrr��sr�)�pickleZ	xmlrpclibc@s�eZdZdZiZeZd"dd�Zdd�Zdd	�Z	d#dd�Z
ed$d
d��Zdd�Z
d%dd�Zdd�Zdd�Zdd�Zdd�Zedd��Zedd��Zed&d d!��ZdS)'rz!
    Base class for managers
    Nr�cCs\|dkrt��j}||_t�|�|_t�|_tj|j_	||_
t|\|_|_
|pTt�|_dSr)rrvrg�_addressrf�_authkeyr��_stater�r��_serializerrhZ	_Listener�_Clientr�_ctx)r,r*rgrpZctxrrrr-s

zBaseManager.__init__cCsf|jjtjkrP|jjtjkr&td��n*|jjtjkr>td��ntd�|jj���t|j	|j
|j|j�S)zX
        Return server object with serve_forever() method and address attribute
        �Already started server�Manager has shut down�Unknown state {!r})
r�r�r�r�r�r
r�rKrW�	_registryr�r�r�r.rrr�
get_servers

�
�zBaseManager.get_servercCs8t|j\}}||j|jd�}t|dd�tj|j_dS)z>
        Connect manager object to the server process
        �rgNr^)	rhr�r�r�rDr�r�r�r�)r,rqrrr�rrr�connectszBaseManager.connectrc	Cs4|jjtjkrP|jjtjkr&td��n*|jjtjkr>td��ntd�|jj���|dk	rht|�sht	d��t
jdd�\}}|jj
t|�j|j|j|j|j|||fd�|_d	�d
d�|jjD��}t|�jd||j_|j��|��|��|_|��tj|j_tj|t|�j|j|j|j|j|jfd
d�|_ dS)z@
        Spawn a server process for this manager object
        r�r�r�Nzinitializer must be a callableF)Zduplexr��:css|]}t|�VqdSrr�)r�irrr�	<genexpr>Asz$BaseManager.start.<locals>.<genexpr>�-r�r@Zexitpriority)!r�r�r�r�r�r
r�rKrPrJr
ZPiper�ZProcessr�_run_serverr�r�r�r��_processr�Z	_identityr4rr�r�r<r�Finalize�_finalize_managerr�rX)r,�initializer�initargs�reader�writerr�rrrr�(sH

���


��zBaseManager.startc	Cs^t�tjtj�|dk	r ||�|�||||�}|�|j�|��t�d|j�|�	�dS)z@
        Create a server, report its address and run it
        Nzmanager serving at %r)
�signal�SIGINT�SIG_IGN�_Serverr;r*r�rr�r�)	�clsrer*rgrpr�r�r��serverrrrr�SszBaseManager._run_servercOsd|jjtjkstd��|j|j|jd�}zt	|dd|f||�\}}W5|��Xt
||j|�|fS)zP
        Create a new shared object; return the token and exposed tuple
        zserver not yet startedr�NrY)r�r�r�r�r�r�r�r�r�rDr)r,r)r@rAr�r+r�rrr�_createjs
zBaseManager._createcCs*|jdk	r&|j�|�|j��s&d|_dS)zC
        Join the manager process (if it has been spawned)
        N)r�r��is_alive�r,�timeoutrrrr�vs

zBaseManager.joincCs2|j|j|jd�}zt|dd�W�S|��XdS)zS
        Return some info about the servers shared objects and connections
        r�Nr\�r�r�r�r�rD�r,r�rrr�_debug_infoszBaseManager._debug_infocCs2|j|j|jd�}zt|dd�W�S|��XdS)z5
        Return the number of shared objects
        r�Nr]r�r�rrr�_number_of_objects�szBaseManager._number_of_objectscCsj|jjtjkr|��|jjtjkrf|jjtjkr<td��n*|jjtjkrTtd��ntd�|jj���|S)NzUnable to start serverr�r�)	r�r�r�r�r�r�r
r�rKr.rrr�	__enter__�s

�zBaseManager.__enter__cCs|��dSr)rX�r,�exc_typeZexc_valZexc_tbrrr�__exit__�szBaseManager.__exit__cCs�|��r�t�d�z,|||d�}zt|dd�W5|��XWntk
rRYnX|jdd�|��r�t�d�t|d�r�t�d	�|��|jd
d�|��r�t�d�t	j
|_ztj
|=Wntk
r�YnXdS)zQ
        Shutdown the manager process; will be registered as a finalizer
        z#sending shutdown message to managerr�NrXg�?)r�zmanager still alive�	terminatez'trying to `terminate()` manager processg�������?z#manager still alive after terminate)r�rr�r�rDr�r��hasattrr�r�r�r�r�_address_to_localr�)rr*rgr1r�r�rrrr��s.




zBaseManager._finalize_managercCs|jSr)r�r.rrrr*�szBaseManager.addressTc
s�d|jkr|j��|_�dkr"t�|p0t�dd�}|p@t�dd�}|r�t|���D]8\}}t|�tksrt	d|��t|�tksRt	d|��qR|||�f|j�<|r‡�fdd�}	�|	_
t|�|	�dS)z9
        Register a typeid with the manager type
        r�N�	_exposed_�_method_to_typeid_z%r is not a stringcs`t�d��|j�f|�|�\}}�||j||j|d�}|j|j|jd�}t|dd|jf�|S)Nz)requesting creation of a shared %r object��managerrgr�r�r`)	rr{r�r�r�r�r*rDr+)r,r@rAr�Zexp�proxyr��r�r)rrrR�s�z"BaseManager.register.<locals>.temp)�__dict__r��copy�	AutoProxyrr$r!rrIr�r4�setattr)
r�r)rPr�r�r��
create_method�keyr�rRrr�r�register�s*

��

zBaseManager.register)NNr�N)Nr)Nr)N)NNNNT)r4r6r7r8r�rWr�r-r�r�r��classmethodr�r�r�r�r�r�r��staticmethodr��propertyr*rrrrrr�s8�
	
+�
	




�c@seZdZdd�Zdd�ZdS)�ProcessLocalSetcCst�|dd��dS)NcSs|��Sr)�clearr%rrr�<lambda>��z*ProcessLocalSet.__init__.<locals>.<lambda>)r�register_after_forkr.rrrr-�szProcessLocalSet.__init__cCst|�dfSrc)rr.rrr�
__reduce__�szProcessLocalSet.__reduce__N)r4r6r7r-rrrrrr	�sr	c@s�eZdZdZiZe��Zddd�Zdd�Z	d	ifd
d�Z
dd
�Zdd�Ze
dd��Zdd�Zdd�Zdd�Zdd�Zdd�ZdS)rz.
    A base for proxies of shared objects
    NTFc		Cs�tj�8tj�|jd�}|dkr:t��t�f}|tj|j<W5QRX|d|_|d|_	||_
|j
j|_||_
||_t|d|_||_|dk	r�t�|�|_n"|j
dk	r�|j
j|_nt��j|_|r�|��t�|tj�dS)Nrr	)r�_mutexr�r�r*rZForkAwareLocalr	�_tls�_idset�_tokenr+�_id�_managerr�rhr��_owned_by_managerrrfr�rvrg�_increfr
�_after_fork)	r,r�rpr�rgr�r_�
manager_ownedZ	tls_idsetrrrr-s*



zBaseProxy.__init__cCsdt�d�t��j}t��jdkr4|dt��j7}|j|jj	|j
d�}t|dd|f�||j_
dS)Nzmaking connection to managerZ
MainThread�|r�rZ)rr{rrvrrmr�r�rr*r�rDrr
)r,rr�rrr�_connect-s

zBaseProxy._connectrcCs�z|jj}Wn6tk
rBt�dt��j�|��|jj}YnX|�	|j
|||f�|��\}}|dkrp|S|dkr�|\}}|jj
|jd}	|jj|_|	||j|j|j|d�}
|j|j|jd�}t|dd|jf�|
St||��dS)	zV
        Try to call a method of the referent and return a copy of the result
        z#thread %r does not own a connectionr:r����r�r�Nr`)rr
r�rr{rmr�rrr;rr<rr�r)rr*r�r�r�rDr+r=)r,r?r@rAr�rBrCr�r�r�r�rrr�_callmethod6s6�
�zBaseProxy._callmethodcCs
|�d�S)z9
        Get a copy of the value of the referent
        r��rr.rrr�	_getvalueTszBaseProxy._getvaluec	Cs�|jrt�d|jj�dS|j|jj|jd�}t|dd|j	f�t�d|jj�|j
�|j	�|joj|jj
}tj|tj|j|j||j|j
|jfdd�|_dS)Nz%owned_by_manager skipped INCREF of %rr�r_z	INCREF %r�
r�)rrr{rr+r�r*r�rDrr�addrr�r�r�_decrefrZ_close)r,r�r1rrrrZs$
��zBaseProxy._increfc
Cs�|�|j�|dks |jtjkr�z2t�d|j�||j|d�}t|dd|jf�Wq�t	k
r�}zt�d|�W5d}~XYq�Xnt�d|j�|s�t
|d�r�t�dt��j
�|j��|`dS)Nz	DECREF %rr�r`z... decref failed %sz%DECREF %r -- manager already shutdownr
z-thread %r has no more proxies so closing conn)�discardr+r�r�r�rr{r*rDr�r�rmr�rr
r�)r�rgr1ZtlsZidsetr�r�r�rrrr!ns �
zBaseProxy._decrefc
CsHd|_z|��Wn0tk
rB}zt�d|�W5d}~XYnXdS)Nzincref failed: %s)rrr�rr�)r,r�rrrr�s
zBaseProxy._after_forkcCs^i}t�dk	r|j|d<t|dd�rB|j|d<tt|j|j|ffStt|�|j|j|ffSdS)Nrg�_isautoFr�)	rr�rr��RebuildProxyrrr�r�r,rArrrr�s


��zBaseProxy.__reduce__cCs|��Sr)r)r,Zmemorrr�__deepcopy__�szBaseProxy.__deepcopy__cCsdt|�j|jjt|�fS)Nz<%s object, typeid %r at %#x>)rr4rr)r+r.rrrr5�s�zBaseProxy.__repr__cCs:z|�d�WStk
r4t|�dd�dYSXdS)zV
        Return representation of the referent (or a fall-back if that fails)
        r5Nrz; '__str__()' failed>)rr�r�r.rrrrN�szBaseProxy.__str__)NNNTF)r4r6r7r8r�rZForkAwareThreadLockrr-rrrrrr!rrr&r5rNrrrrr�s(�
)	

cCs�tt��dd�}|rT|j|jkrTt�d|�d|d<|j|jkrT|j|j|j|j<|�	dd�optt��dd�}|||fd|i|��S)	z5
    Function used for unpickling proxy objects.
    rwNz*Rebuild a proxy owned by manager, token=%rTrr_Z_inheritingF)
rrrvr*rr{r+rlrjr�)rSr�rprAr�r_rrrr$�s
�
�r$cCspt|�}z|||fWStk
r*YnXi}|D]}td||f|�q4t|tf|�}||_||||f<|S)zB
    Return a proxy type whose methods are given by `exposed`
    zOdef %s(self, /, *args, **kwds):
        return self._callmethod(%r, args, kwds))r�r��execrrr�)rr��_cacheZdicZmeth�	ProxyTyperrr�
MakeProxyType�s ��r*c
Cs�t|d}|dkrB||j|d�}zt|dd|f�}W5|��X|dkrX|dk	rX|j}|dkrjt��j}td|j	|�}||||||d�}	d|	_
|	S)z*
    Return an auto-proxy for `token`
    r	Nr�r[z
AutoProxy[%s])r�rgr_T)rhr*r�rDr�rrvrgr*r)r#)
r�rpr�rgr�r_r�r�r)r�rrrr�s 


�rc@seZdZdd�Zdd�ZdS)�	NamespacecKs|j�|�dSr)r��updater%rrrr-�szNamespace.__init__cCsZt|j���}g}|D]$\}}|�d�s|�d||f�q|��d|jjd�|�fS)NrUz%s=%rz%s(%s)z, )	r$r�r!�
startswithrQr�r3r4r�)r,r!rRrr�rrrr5�s
zNamespace.__repr__N)r4r6r7r-r5rrrrr+�sr+c@s8eZdZddd�Zdd�Zdd�Zdd	�Zeee�Zd
S)�ValueTcCs||_||_dSr)�	_typecode�_value)r,rr��lockrrrr-szValue.__init__cCs|jSr�r0r.rrrr�sz	Value.getcCs
||_dSrr2�r,r�rrrr�
sz	Value.setcCsdt|�j|j|jfS)Nz
%s(%r, %r))rr4r/r0r.rrrr5szValue.__repr__N)T)	r4r6r7r-r�r�r5rr�rrrrr.s

r.cCst�||�Sr)r)r�sequencer1rrr�Arraysr5c@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�
IteratorProxy)�__next__r;�throwr�cCs|Srrr.rrr�__iter__szIteratorProxy.__iter__cGs|�d|�S)Nr7r�r,r@rrrr7szIteratorProxy.__next__cGs|�d|�S)Nr;rr:rrrr;szIteratorProxy.sendcGs|�d|�S)Nr8rr:rrrr8szIteratorProxy.throwcGs|�d|�S)Nr�rr:rrrr�!szIteratorProxy.closeN)	r4r6r7r�r9r7r;r8r�rrrrr6sr6c@s2eZdZdZddd�Zdd�Zdd	�Zd
d�ZdS)
�
AcquirerProxy)�acquire�releaseTNcCs"|dkr|fn||f}|�d|�S�Nr<r)r,Zblockingr�r@rrrr<'szAcquirerProxy.acquirecCs
|�d�S�Nr=rr.rrrr=*szAcquirerProxy.releasecCs
|�d�Sr>rr.rrrr�,szAcquirerProxy.__enter__cCs
|�d�Sr?rr�rrrr�.szAcquirerProxy.__exit__)TN)r4r6r7r�r<r=r�r�rrrrr;%s

r;c@s6eZdZdZddd�Zd
dd�Zdd	�Zdd
d�ZdS)�ConditionProxy)r<r=r��notify�
notify_allNcCs|�d|f�S�Nr�rr�rrrr�4szConditionProxy.waitr	cCs|�d|f�S)NrAr)r,�nrrrrA6szConditionProxy.notifycCs
|�d�S)NrBrr.rrrrB8szConditionProxy.notify_allcCsd|�}|r|S|dk	r$t��|}nd}d}|s`|dk	rN|t��}|dkrNq`|�|�|�}q,|S)Nr)�time�	monotonicr�)r,Z	predicater�rCZendtimeZwaittimerrr�wait_for:s
zConditionProxy.wait_for)N)r	)N)r4r6r7r�r�rArBrGrrrrr@2s


r@c@s2eZdZdZdd�Zdd�Zdd�Zdd	d
�ZdS)�
EventProxy)r�r�r
r�cCs
|�d�S)Nr�rr.rrrr�OszEventProxy.is_setcCs
|�d�S�Nr�rr.rrrr�QszEventProxy.setcCs
|�d�S)Nr
rr.rrrr
SszEventProxy.clearNcCs|�d|f�SrCrr�rrrr�UszEventProxy.wait)N)r4r6r7r�r�r�r
r�rrrrrHMs
rHc@sNeZdZdZddd�Zdd�Zdd�Zed	d
��Zedd��Z	ed
d��Z
dS)�BarrierProxy)�__getattribute__r��abort�resetNcCs|�d|f�SrCrr�rrrr�[szBarrierProxy.waitcCs
|�d�S)NrLrr.rrrrL]szBarrierProxy.abortcCs
|�d�S)NrMrr.rrrrM_szBarrierProxy.resetcCs|�dd�S)NrK)�partiesrr.rrrrNaszBarrierProxy.partiescCs|�dd�S)NrK)�	n_waitingrr.rrrrOdszBarrierProxy.n_waitingcCs|�dd�S)NrK)�brokenrr.rrrrPgszBarrierProxy.broken)N)r4r6r7r�r�rLrMrrNrOrPrrrrrJYs


rJc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�NamespaceProxy)rK�__setattr__�__delattr__cCs0|ddkrt�||�St�|d�}|d|f�S)NrrUrrK)�objectrK�r,r�
callmethodrrr�__getattr__nszNamespaceProxy.__getattr__cCs4|ddkrt�|||�St�|d�}|d||f�S)NrrUrrR)rTrRrK)r,rr�rVrrrrRsszNamespaceProxy.__setattr__cCs0|ddkrt�||�St�|d�}|d|f�S)NrrUrrS)rTrSrKrUrrrrSxszNamespaceProxy.__delattr__N)r4r6r7r�rWrRrSrrrrrQlsrQc@s*eZdZdZdd�Zdd�Zeee�ZdS)�
ValueProxy)r�r�cCs
|�d�S)Nr�rr.rrrr��szValueProxy.getcCs|�d|f�SrIrr3rrrr��szValueProxy.setN)r4r6r7r�r�r�rr�rrrrrXsrX�
BaseListProxy)�__add__�__contains__�__delitem__�__getitem__�__len__�__mul__�__reversed__�__rmul__�__setitem__rQ�count�extend�index�insertr��remove�reverser��__imul__c@seZdZdd�Zdd�ZdS)�	ListProxycCs|�d|f�|S)Nrdrr3rrr�__iadd__�szListProxy.__iadd__cCs|�d|f�|S)Nrirr3rrrri�szListProxy.__imul__N)r4r6r7rkrirrrrrj�srj�	DictProxy)r[r\r]r9r^rbr
rr�r!r"r��popitem�
setdefaultr,r#r9�Iterator�
ArrayProxy)r^r]rb�	PoolProxy)Zapply�apply_asyncr��imap�imap_unorderedr��map�	map_async�starmap�
starmap_asyncr�ZAsyncResult)rrrvrxrsrtc@seZdZdd�Zdd�ZdS)rqcCs|Srrr.rrrr��szPoolProxy.__enter__cCs|��dSr)r�r�rrrr��szPoolProxy.__exit__N)r4r6r7r�r�rrrrrq�sc@seZdZdZdS)ra(
    Subclass of `BaseManager` which supports a number of shared object types.

    The types registered are those intended for the synchronization
    of threads, plus `dict`, `list` and `Namespace`.

    The `multiprocessing.Manager()` function creates started instances of
    this class.
    N)r4r6r7r8rrrrr�s�QueueZ
JoinableQueuertrn�RLock�	Semaphore�BoundedSemaphore�	Condition�Barrier�Poolr$r�)r�r)rc@sLeZdZdZgfdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)�_SharedMemoryTrackerz+Manages one or more shared memory segments.cCs||_||_dSr�Zshared_memory_context_name�
segment_names)r,rr�rrrr-�sz_SharedMemoryTracker.__init__cCs(t�d|�dt����|j�|�dS)z6Adds the supplied shared memory block name to tracker.zRegister segment � in pid N)rr{rr�rQ�r,�segment_namerrr�register_segment�sz%_SharedMemoryTracker.register_segmentcCsBt�d|�dt����|j�|�t�|�}|��|��dS)z�Calls unlink() on the shared memory block with the supplied name
            and removes it from the list of blocks being tracked.zDestroy segment r�N)	rr{rr�rgr�SharedMemoryr��unlink)r,r�Zsegmentrrr�destroy_segment�s

z$_SharedMemoryTracker.destroy_segmentcCs"|jdd�D]}|�|�qdS)z<Calls destroy_segment() on all tracked shared memory blocks.N)r�r�r�rrrr��sz_SharedMemoryTracker.unlinkcCs(t�d|jj�dt����|��dS)NzCall z.__del__ in )rr{r3r4rr�r.rrr�__del__�sz_SharedMemoryTracker.__del__cCs|j|jfSrr�r.rrrr/�sz!_SharedMemoryTracker.__getstate__cCs|j|�dSr)r-r0rrrr2sz!_SharedMemoryTracker.__setstate__N)r4r6r7r8r-r�r�r�r�r/r2rrrrr��s	r�c@sReZdZejdddgZdd�Zdd�Zde_d	d
�Zdd�Z	d
d�Z
dd�ZdS)�SharedMemoryServer�
track_segment�release_segment�
list_segmentscOsZtj|f|�|�|j}t|t�r,t�|�}td|�dt����|_	t
�dt����dS)NZshm_rUz"SharedMemoryServer started by pid )rWr-r*rHrd�os�fsdecoder�r�shared_memory_contextrr{)r,r@�kwargsr*rrrr-
s

�zSharedMemoryServer.__init__cOstt|�dkr|d}n4d|kr(|d}n"|s6td��ntdt|�d��ttj|dd�rhtj|d	<tj||�S)
z�Create a new distributed-shared object (not backed by a shared
            memory block) and return its id to be used in a Proxy Object.r�r�r)zDdescriptor 'create' of 'SharedMemoryServer' object needs an argumentr�r	rZ_shared_memory_proxyr�)r�rJr�r,rer�rWrY)r@r�Ztypeodr)rrrrYs



�
zSharedMemoryServer.createz&($self, c, typeid, /, *args, **kwargs)cCs|j��t�||�S)zACall unlink() on all tracked shared memory, terminate the Server.)r�r�rWrXr�rrrrX)s
zSharedMemoryServer.shutdowncCs|j�|�dS)z?Adds the supplied shared memory block name to Server's tracker.N)r�r��r,r>r�rrrr�.sz SharedMemoryServer.track_segmentcCs|j�|�dS)z�Calls unlink() on the shared memory block with the supplied name
            and removes it from the tracker instance inside the Server.N)r�r�r�rrrr�2sz"SharedMemoryServer.release_segmentcCs|jjS)zbReturns a list of names of shared memory blocks that the Server
            is currently tracking.)r�r�r�rrrr�7sz SharedMemoryServer.list_segmentsN)r4r6r7rWr�r-rYr�rXr�r�r�rrrrr�s�
r�c@s<eZdZdZeZdd�Zdd�Zdd�Zdd	�Z	d
d�Z
dS)
ra�Like SyncManager but uses SharedMemoryServer instead of Server.

        It provides methods for creating and returning SharedMemory instances
        and for creating a list-like object (ShareableList) backed by shared
        memory.  It also provides methods that create and return Proxy Objects
        that support synchronization across processes (i.e. multi-process-safe
        locks and semaphores).
        cOsNtjdkrddlm}|��tj|f|�|�t�|j	j
�dt����dS)N�posixr	)�resource_trackerz created by pid )r�r�r�Zensure_runningrr-rr{r3r4r)r,r@r�r�rrrr-Is

zSharedMemoryManager.__init__cCst�|jj�dt����dS)Nz.__del__ by pid )rr{r3r4rr.rrrr�UszSharedMemoryManager.__del__cCsh|jjtjkrP|jjtjkr&td��n*|jjtjkr>td��ntd�|jj���|�|j	|j
|j|j�S)z@Better than monkeypatching for now; merge into Server ultimatelyz"Already started SharedMemoryServerz!SharedMemoryManager has shut downr�)
r�r�r�r�r�r
r�rKr�r�r�r�r�r.rrrr�Ys

��zSharedMemoryManager.get_servercCsx|j|j|jd��\}tjdd|d�}zt|dd|jf�Wn.tk
rh}z|��|�W5d}~XYnXW5QRX|S)zoReturns a new SharedMemory instance with the specified size in
            bytes, to be tracked by the manager.r�NT)rY�sizer�)	r�r�r�rr�rDr�
BaseExceptionr�)r,r�r�Zsmsr�rrrr�fs z SharedMemoryManager.SharedMemorycCsv|j|j|jd��Z}t�|�}zt|dd|jjf�Wn0tk
rf}z|j�	�|�W5d}~XYnXW5QRX|S)z�Returns a new ShareableList instance populated with the values
            from the input sequence, to be tracked by the manager.r�Nr�)
r�r�r�r�
ShareableListrDZshmrr�r�)r,r4r�Zslr�rrrr�rs

 z!SharedMemoryManager.ShareableListN)r4r6r7r8r�r�r-r�r�r�r�rrrrr=s	
)NNNT)T)S�__all__rxrmr�rZqueuerEr�rr�rr�r
�contextrrr
rrrrrZ	HAS_SHMEM�ImportErrorrrZ
view_typesr$r'Z	view_typerTrrDr=r�rLrTrVrWr�rqrrZXmlListenerZ	XmlClientrhrr�r	rr$r*rr+r.r5r6r;r@rHrJrQrXrYrjrlr�rpZ
BasePoolProxyrqrryrtrnrzr{r|r}r~rr�r�r�rrrrr�<module>s��


c

�	w
4�


	
	
�

�

�%8multiprocessing/__pycache__/heap.cpython-38.pyc000064400000016727151153537440015575 0ustar00U

e5dj-�@s�ddlZddlmZddlZddlZddlZddlZddlZddlm	Z	m
Z
ddlmZdgZ
ejdkr�ddlZGdd	�d	e�Zn,Gd
d	�d	e�Zdd�Zd
d�Ze	�ee�Gdd�de�ZGdd�de�ZdS)�N)�defaultdict�)�	reduction�assert_spawning)�util�
BufferWrapperZwin32c@s0eZdZdZe��Zdd�Zdd�Zdd�Z	dS)	�ArenazL
        A shared memory area backed by anonymous memory (Windows).
        cCsx||_td�D]B}dt��t|j�f}tjd||d�}t��dkrHqZ|�	�qt
d��||_||_|j|jf|_
dS)N�dz	pym-%d-%s����ZtagnamerzCannot find name for new mmap)�size�range�os�getpid�next�_rand�mmap�_winapiZGetLastError�close�FileExistsError�name�buffer�_state)�selfr�irZbuf�r�,/usr/lib64/python3.8/multiprocessing/heap.py�__init__&s
�Arena.__init__cCst|�|jS�N)rr)rrrr�__getstate__5szArena.__getstate__cCs,|\|_|_|_tjd|j|jd�|_dS)Nr
r)rrrrr)r�staterrr�__setstate__9szArena.__setstate__N)
�__name__�
__module__�__qualname__�__doc__�tempfileZ_RandomNameSequencerrr r"rrrrrs
rc@s8eZdZdZejdkrdgZngZd
dd�Zdd�Zd	S)rzJ
        A shared memory area backed by a temporary file (POSIX).
        Zlinuxz/dev/shmr
cCsx||_||_|dkrbtjdt��|�|�d�\|_}t�|�t�	|tj
|jf�t�|j|�t�|j|j�|_
dS)Nr
zpym-%d-)�prefix�dir)r�fdr'Zmkstemprr�_choose_dir�unlinkr�Finalizer�	ftruncaterr)rrr*rrrrrMs
�
rcCs6|jD]&}t�|�}|j|j|kr|Sqt��Sr)�_dir_candidatesr�statvfs�f_bavail�f_frsizerZget_temp_dir)rr�d�strrrr+[s



zArena._choose_dirN)r
)	r#r$r%r&�sys�platformr/rr+rrrrrCs

cCs(|jdkrtd��t|jt�|j�ffS)Nr
zDArena is unpicklable because forking was enabled when it was created)r*�
ValueError�
rebuild_arenarrZDupFd)�arrr�reduce_arenads
r:cCst||���Sr)r�detach)rZdupfdrrrr8jsr8c@szeZdZdZdZdZejfdd�Ze	dd��Z
dd�Zd	d
�Zdd�Z
d
d�Zdd�Zdd�Zdd�Zdd�Zdd�ZdS)�Heap�i@cCsXt��|_t��|_||_g|_i|_i|_	i|_
tt�|_
g|_g|_d|_d|_dS�Nr)rr�_lastpid�	threadingZLock�_lock�_size�_lengths�_len_to_seq�_start_to_block�_stop_to_blockr�set�_allocated_blocks�_arenas�_pending_free_blocks�
_n_mallocs�_n_frees)rrrrrr{s


z
Heap.__init__cCs|d}|||@S)Nrr)�nZ	alignment�maskrrr�_roundup�sz
Heap._roundupcCsZ|�t|j|�tj�}|j|jkr0|jd9_t�d|�t|�}|j	�
|�|d|fS)N�z"allocating a new mmap of length %dr)rO�maxrBr�PAGESIZE�_DOUBLE_ARENA_SIZE_UNTILr�inforrI�append)rr�length�arenarrr�
_new_arena�szHeap._new_arenacCs�|j}||jkrdS|j�|�}|r(t�|j|df=|j||f=|j�|�|j	|}|�|d|f�|s~|j	|=|j
�|�dSr>)r�_DISCARD_FREE_SPACE_LARGER_THANrH�pop�AssertionErrorrErFrI�removerDrC)rrWrV�blocks�seqrrr�_discard_arena�s

zHeap._discard_arenac	Cs|t�|j|�}|t|j�kr&|�|�S|j|}|j|}|��}|sV|j|=|j|=|\}}}|j||f=|j||f=|Sr)	�bisectZbisect_leftrC�lenrXrDrZrErF)	rrrrVr^�blockrW�start�stoprrr�_malloc�s



zHeap._mallocc	Cs�|\}}}z|j||f}Wntk
r0YnX|�|�\}}z|j||f}Wntk
rfYnX|�|�\}}|||f}||}z|j|�|�Wn.tk
r�|g|j|<t�|j|�YnX||j||f<||j||f<dSr)	rF�KeyError�_absorbrErDrUr`ZinsortrC)	rrbrWrcrdZ
prev_block�_Z
next_blockrVrrr�_add_free_block�s(

zHeap._add_free_blockcCs^|\}}}|j||f=|j||f=||}|j|}|�|�|sV|j|=|j�|�||fSr)rErFrDr\rC)rrbrWrcrdrVr^rrrrg�s


zHeap._absorbcCs4|\}}}|j|}|�||f�|s0|�|�dSr)rHr\r_)rrbrWrcrdr]rrr�_remove_allocated_block�s


zHeap._remove_allocated_blockcCsBz|j��}Wntk
r&Yq>YnX|�|�|�|�qdSr)rJrZ�
IndexErrorrirj�rrbrrr�_free_pending_blockss

zHeap._free_pending_blockscCs~t��|jkr$td�t��|j���|j�d�s>|j�|�n<z.|j
d7_
|��|�|�|�
|�W5|j�	�XdS)Nz$My pid ({0:n}) is not last pid {1:n}Fr)rrr?r7�formatrA�acquirerJrU�releaserLrmrirjrlrrr�frees
��
z	Heap.freec
Cs�|dkrtd�|���tj|kr.td�|���t��|jkrD|��|j	��|j
d7_
|��|�t
|d�|j�}|�|�\}}}||}||kr�|�|||f�|j|�||f�|||fW5QR�SQRXdS)Nr�Size {0:n} out of range�Size {0:n} too larger)r7rnr5�maxsize�
OverflowErrorrrr?rrArKrmrOrQ�
_alignmentrerirH�add)rrrWrcrdZ	real_stoprrr�malloc(s 
zHeap.mallocN)r#r$r%rvrYrSrrRr�staticmethodrOrXr_rerirgrjrmrqrxrrrrr<ss

r<c@s"eZdZe�Zdd�Zdd�ZdS)rcCs^|dkrtd�|���tj|kr.td�|���tj�|�}||f|_t	j
|tjj|fd�dS)Nrrrrs)�args)r7rnr5rtrur�_heaprxrrr-rq)rrrbrrrrFs

zBufferWrapper.__init__cCs&|j\\}}}}t|j�|||�Sr)r�
memoryviewr)rrWrcrdrrrr�create_memoryviewOszBufferWrapper.create_memoryviewN)r#r$r%r<r{rr}rrrrrBs	)r`�collectionsrrrr5r'r@�contextrr�r�__all__r6r�objectrr:r8�registerr<rrrrr�<module>
s&
$!Pmultiprocessing/__pycache__/reduction.cpython-38.pyc000064400000020015151153537440016635 0ustar00U

e5d(%�@sddlmZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddddd	gZejd
kp�e
ed�o�e
ed�o�e
ejd
�ZGdd�dej�ZejZd6dd	�Zejd
k�redddg7ZddlZd7dd�dd�Zdd�Zdd�Zdd�ZGdd�de�ZnHedddg7ZddlZejdkZdd�Zdd�Zd d�Zd!d�Zd"d�Zd#d$�ZGd%d&�d&�Z ee!e �j"�e�d'd(�Z#ee!e$j%�e#�ee!e&j'�e#�d)d*�Z(d+d,�Z)eej*e(�ejd
k�r�d-d.�Z+d/d0�Z,eeje+�nd1d.�Z+d2d0�Z,eeje+�Gd3d4�d4ed5�Z-dS)8�)�ABCMetaN�)�context�send_handle�recv_handle�ForkingPickler�register�dump�win32ZCMSG_LEN�
SCM_RIGHTS�sendmsgcsJeZdZdZiZejZ�fdd�Ze	dd��Z
e	d	dd��Zej
Z
�ZS)
rz)Pickler subclass used by multiprocessing.cs*t�j|�|j��|_|j�|j�dS�N)�super�__init__�_copyreg_dispatch_table�copy�dispatch_table�update�_extra_reducers��self�args��	__class__��1/usr/lib64/python3.8/multiprocessing/reduction.pyr&szForkingPickler.__init__cCs||j|<dS)z&Register a reduce function for a type.N)r)�cls�type�reducerrrr+szForkingPickler.registerNcCs t��}|||��|�|��Sr
)�io�BytesIOr	�	getbuffer)r�obj�protocolZbufrrr�dumps0szForkingPickler.dumps)N)�__name__�
__module__�__qualname__�__doc__r�copyregrrr�classmethodrr$�pickle�loads�
__classcell__rrrrr!s
cCst||��|�dS)z3Replacement for pickle.dump() using ForkingPickler.N)rr	)r"�filer#rrrr	:s�	DupHandle�	duplicate�steal_handleF)�source_processcCs6t��}|dkr|}|dkr |}t�|||d|tj�S)z<Duplicate a handle.  (target_process is a handle not a pid!)Nr)�_winapi�GetCurrentProcess�DuplicateHandle�DUPLICATE_SAME_ACCESS)�handleZtarget_processZinheritabler2Zcurrent_processrrrr0Gs�c	CsFt�tjd|�}z$t�||t��ddtjtjB�W�St�|�XdS)z5Steal a handle from process identified by source_pid.FrN)r3�OpenProcess�PROCESS_DUP_HANDLE�CloseHandler5r4r6�DUPLICATE_CLOSE_SOURCE)Z
source_pidr7Zsource_process_handlerrrr1Ss�
�cCst|tj|�}|�|�dS�z&Send a handle over a local connection.N)r/r3r6�send)�connr7�destination_pidZdhrrrr_scCs|����S)�)Receive a handle over a local connection.)�recv�detach)r>rrrrdsc@s"eZdZdZddd�Zdd�ZdS)r/zPicklable wrapper for a handle.Nc	Cs\|dkrt��}t�tjd|�}zt�t��|||dd�|_W5t�|�X||_	||_
dS)NFr)�os�getpidr3r8r9r:r5r4�_handle�_access�_pid)rr7�access�pid�procrrrrjs�
zDupHandle.__init__c	CsZ|jt��kr|jSt�tjd|j�}z"t�||jt�	�|j
dtj�W�St�|�XdS)z1Get the handle.  This should only be called once.FN)rGrCrDrEr3r8r9r:r5r4rFr;)rrJrrrrBys
��zDupHandle.detach)N)r%r&r'r(rrBrrrrr/hs
�DupFd�sendfds�recvfds�darwincCsVt�d|�}tt|�dg�}|�|gtjtj|fg�trR|�d�dkrRt	d��dS)z,Send an array of fds over an AF_UNIX socket.�i�r�Az%did not receive acknowledgement of fdN)
�array�bytes�lenr�socket�
SOL_SOCKETr�ACKNOWLEDGErA�RuntimeError)�sockZfds�msgrrrrL�s
c	Cst�d�}|j|}|�dt�|��\}}}}|s:|s:t�z�trJ|�d�t|�dkrft	dt|���|d\}}	}
|tj
kr�|	tjkr�t|
�|jdkr�t�|�
|
�t|�d|dkr�td�t|�|d���t|�WSWnttfk
r�YnXt	d��d	S)
z/Receive an array of fds over an AF_UNIX socket.rOrrQzreceived %d items of ancdatarrPz Len is {0:n} but msg[0] is {1!r}zInvalid data receivedN)rR�itemsizeZrecvmsgrUZ
CMSG_SPACE�EOFErrorrWr=rTrXrVr�
ValueErrorZ	frombytes�AssertionError�format�list�
IndexError)rY�size�aZ
bytes_sizerZZancdata�flagsZaddrZ
cmsg_levelZ	cmsg_typeZ	cmsg_datarrrrM�s<


�
�
��c	Cs2t�|��tjtj��}t||g�W5QRXdSr<)rU�fromfd�fileno�AF_UNIX�SOCK_STREAMrL)r>r7r?�srrrr�sc
Cs<t�|��tjtj��}t|d�dW5QR�SQRXdS)r@rrN)rUrerfrgrhrM)r>rirrrr�scCsFt��}|dk	r |�|�|��Str:ddlm}|�|�Std��dS)zReturn a wrapper for an fd.Nr)�resource_sharerz&SCM_RIGHTS appears not to be available)rZget_spawning_popenrKZduplicate_for_child�HAVE_SEND_HANDLE�rjr])�fdZ	popen_objrjrrrrK�s
cCs2|jdkrt|j|jjffSt|j|jjffSdSr
)�__self__�getattrr�__func__r%��mrrr�_reduce_method�s
rsc@seZdZdd�ZdS)�_CcCsdSr
r)rrrr�f�sz_C.fN)r%r&r'rurrrrrt�srtcCst|j|jffSr
)ro�__objclass__r%rqrrr�_reduce_method_descriptor�srwcCst|j|j|jpiffSr
)�_rebuild_partial�funcr�keywords)�prrr�_reduce_partial�sr|cCstj|f|�|�Sr
)�	functools�partial)ryrrzrrrrx�srxcCsddlm}t||�ffS)Nr)�	DupSocket)rjr�_rebuild_socket)rirrrr�_reduce_socket�sr�cCs|��Sr
)rB)Zdsrrrr��sr�cCs"t|���}t||j|j|jffSr
)rKrfr��familyr�proto)ri�dfrrrr��scCs|��}tj||||d�S)N)rf)rBrU)r�r�rr�rmrrrr��sc@sdeZdZdZeZeZeZeZeZe	j
dkr8eZeZe
Z
neZeZeZeZeZeZeZeZdd�ZdS)�AbstractReducerz�Abstract base class for use in implementing a Reduction class
    suitable for use in replacing the standard reduction mechanism
    used in multiprocessing.r
cGsNttt�j�t�tttj�t�tttj	�t�tt
jt�tt
j
t�dSr
)rrrtrursr`�appendrw�int�__add__r}r~r|rUr�rrrrrs
zAbstractReducer.__init__N)r%r&r'r(rrr	rr�sys�platformr1r0r/rLrMrKrsrwrxr�r�rrrrrr��s&
r�)�	metaclass)N)NF).�abcrr)r}rrCr+rUr�rlr�__all__r��hasattrrkZPicklerrrr	r3r0r1rr�objectr/rRrWrLrMrKrsrtrrurwr`r�r�r�r|rxr~r�r�r�rrrr�<module>
sj

�
�	
�#
multiprocessing/__pycache__/sharedctypes.cpython-38.pyc000064400000015613151153537440017347 0ustar00U

e5d��@sBddlZddlZddlmZddlmZddlmZmZejZ	dddd	d
dgZ
ejejej
ejejejejejejejejejejejd�Zd
d�Zdd�Zdd�Zddd�dd�Zddd�dd	�Zdd
�Zd&dd�Z dd�Z!dd�Z"dd�Z#dZ$iZ%e�&�Z'Gdd�de(�Z)Gd d!�d!e)�Z*Gd"d#�d#e)�Z+Gd$d%�d%e+�Z,dS)'�N�)�heap)�get_context)�	reduction�assert_spawning�RawValue�RawArray�Value�Array�copy�synchronized)�c�u�b�B�h�H�i�I�l�L�q�Q�f�dcCs t�|�}t�|�}t||d�S�N)�ctypes�sizeofrZ
BufferWrapper�
rebuild_ctype)�type_�size�wrapper�r"�4/usr/lib64/python3.8/multiprocessing/sharedctypes.py�
_new_value's

r$cGs<t�||�}t|�}t�t�|�dt�|��|j|�|S)z>
    Returns a ctypes object allocated from shared memory
    r)�typecode_to_type�getr$r�memset�	addressofr�__init__)�typecode_or_type�argsr�objr"r"r#r,s

cCsjt�||�}t|t�rD||}t|�}t�t�|�dt�|��|S|t	|�}t|�}|j
|�|SdS)z=
    Returns a ctypes array allocated from shared memory
    rN)r%r&�
isinstance�intr$rr'r(r�lenr))r*�size_or_initializerrr,�resultr"r"r#r6s

T)�lock�ctxcGsXt|f|��}|dkr|S|dkr4|p*t�}|��}t|d�sJtd|��t|||d�S)z6
    Return a synchronization wrapper for a Value
    F�TN�acquire�%r has no method 'acquire'�r3)rr�RLock�hasattr�AttributeErrorr)r*r2r3r+r,r"r"r#r	Fs

cCsTt||�}|dkr|S|dkr0|p&t�}|��}t|d�sFtd|��t|||d�S)z9
    Return a synchronization wrapper for a RawArray
    Fr4r5r6r7)rrr8r9r:r)r*r0r2r3r,r"r"r#r
Ts


cCstt|��}|t�|�d<|S)Nr)r$�typerZpointer)r,Znew_objr"r"r#rbscCs�t|t�rtd��|pt�}t|tj�r4t|||�St|tj�rd|jtj	krXt
|||�St|||�St|�}zt
|}WnRtk
r�dd�|jD�}dd�|D�}d|j}t|tf|�}t
|<YnX||||�SdS)Nzobject already synchronizedcSsg|]}|d�qS)rr")�.0Zfieldr"r"r#�
<listcomp>vsz synchronized.<locals>.<listcomp>cSsi|]}|t|��qSr")�
make_property)r<�namer"r"r#�
<dictcomp>wsz synchronized.<locals>.<dictcomp>�Synchronized)r-�SynchronizedBase�AssertionErrorrrZ_SimpleCDatarAr
�_type_�c_char�SynchronizedString�SynchronizedArrayr;�class_cache�KeyErrorZ_fields_�__name__)r,r2r3�clsZscls�namesrZ	classnamer"r"r#rgs"

cCs@t|�t|tj�r(t|j|j|jffStt|�|jdffSdSr)	rr-rr
rrD�_wrapperZ_length_r;)r,r"r"r#�reduce_ctype�srNcCs8|dk	r||}t�|t�|��}|�|�}||_|Sr)�_ForkingPickler�registerrNZcreate_memoryviewZfrom_bufferrM)rr!ZlengthZbufr,r"r"r#r�s
rcCsPz
t|WStk
rJi}tt|fd|�||t|<||YSXdS)N�)�
prop_cacherI�exec�template)r?rr"r"r#r>�s
r>z�
def get%s(self):
    self.acquire()
    try:
        return self._obj.%s
    finally:
        self.release()
def set%s(self, value):
    self.acquire()
    try:
        self._obj.%s = value
    finally:
        self.release()
%s = property(get%s, set%s)
c@sFeZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dS)rBNcCsB||_|r||_n|ptdd�}|��|_|jj|_|jj|_dS)NT)Zforce)�_obj�_lockrr8r5�release)�selfr,r2r3r"r"r#r)�s

zSynchronizedBase.__init__cCs
|j��Sr)rV�	__enter__�rXr"r"r#rY�szSynchronizedBase.__enter__cGs|jj|�Sr)rV�__exit__)rXr+r"r"r#r[�szSynchronizedBase.__exit__cCst|�t|j|jffSr)rrrUrVrZr"r"r#�
__reduce__�szSynchronizedBase.__reduce__cCs|jSr�rUrZr"r"r#�get_obj�szSynchronizedBase.get_objcCs|jSr)rVrZr"r"r#�get_lock�szSynchronizedBase.get_lockcCsdt|�j|jfS)Nz<%s wrapper for %s>)r;rJrUrZr"r"r#�__repr__�szSynchronizedBase.__repr__)NN)
rJ�
__module__�__qualname__r)rYr[r\r^r_r`r"r"r"r#rB�s

rBc@seZdZed�ZdS)rA�valueN)rJrarbr>rcr"r"r"r#rA�srAc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)rGcCs
t|j�Sr)r/rUrZr"r"r#�__len__�szSynchronizedArray.__len__c
Cs&|�|j|W5QR�SQRXdSrr])rXrr"r"r#�__getitem__�szSynchronizedArray.__getitem__c	Cs|�||j|<W5QRXdSrr])rXrrcr"r"r#�__setitem__�szSynchronizedArray.__setitem__c
Cs*|�|j||�W5QR�SQRXdSrr])rX�start�stopr"r"r#�__getslice__�szSynchronizedArray.__getslice__c	Cs"|�||j||�<W5QRXdSrr])rXrgrh�valuesr"r"r#�__setslice__�szSynchronizedArray.__setslice__N)rJrarbrdrerfrirkr"r"r"r#rG�s
rGc@seZdZed�Zed�ZdS)rFrc�rawN)rJrarbr>rcrlr"r"r"r#rF�srF)NN)-r�weakref�rr�contextrrZForkingPicklerrO�__all__rEZc_wcharZc_byteZc_ubyteZc_shortZc_ushortZc_intZc_uintZc_longZc_ulongZ
c_longlongZc_ulonglongZc_floatZc_doubler%r$rrr	r
rrrNrr>rTrR�WeakKeyDictionaryrH�objectrBrArGrFr"r"r"r#�<module>
sL�


	 multiprocessing/__pycache__/queues.cpython-38.pyc000064400000022524151153537440016157 0ustar00U

e5d�-�@s�dddgZddlZddlZddlZddlZddlZddlZddlZddlm	Z	m
Z
ddlZddlm
Z
ddlmZejjZdd	lmZmZmZmZmZGd
d�de�Ze�ZGdd�de�ZGdd�de�ZdS)
�Queue�SimpleQueue�
JoinableQueue�N)�Empty�Full�)�
connection)�context)�debug�info�Finalize�register_after_fork�
is_exitingc@s�eZdZd*dd�Zdd�Zdd�Zdd	�Zd+dd
�Zd,dd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd d!�Zed"d#��Zed$d%��Zed&d'��Zed(d)��ZdS)-rrcCs�|dkrddlm}||_tjdd�\|_|_|��|_t	�
�|_tj
dkrTd|_n
|��|_|�|�|_d|_|��tj
dkr�t|tj�dS)Nrr)�
SEM_VALUE_MAXF�Zduplex�win32)Zsynchronizer�_maxsizer�Pipe�_reader�_writer�Lock�_rlock�os�getpid�_opid�sys�platform�_wlockZBoundedSemaphore�_sem�
_ignore_epipe�_after_forkr
r��self�maxsize�ctx�r%�./usr/lib64/python3.8/multiprocessing/queues.py�__init__$s




zQueue.__init__cCs.t�|�|j|j|j|j|j|j|j|j	fS�N)
r	�assert_spawningrrrrrrrr�r"r%r%r&�__getstate__9s
�zQueue.__getstate__c	Cs0|\|_|_|_|_|_|_|_|_|��dSr()	rrrrrrrrr �r"�stater%r%r&�__setstate__>s�zQueue.__setstate__cCsbtd�t�t���|_t��|_d|_d|_	d|_
d|_d|_|j
j|_|jj|_|jj|_dS)NzQueue._after_fork()F)r
�	threading�	Conditionr�	_notempty�collections�deque�_buffer�_thread�_jointhread�_joincancelled�_closed�_closer�
send_bytes�_send_bytesr�
recv_bytes�_recv_bytes�poll�_pollr*r%r%r&r Cs


zQueue._after_forkTNc	Csf|jrtd|�d���|j�||�s(t�|j�.|jdkrB|��|j�	|�|j�
�W5QRXdS�NzQueue z
 is closed)r8�
ValueErrorr�acquirerr1r5�
_start_threadr4�append�notify�r"�obj�block�timeoutr%r%r&�putPs
z	Queue.putc	Cs�|jrtd|�d���|rH|dkrH|j�|��}W5QRX|j��nr|rXt��|}|j�||�sjt	�zB|r�|t��}|�
|�s�t	�n|�
�s�t	�|��}|j��W5|j��Xt�|�Sr@)
r8rArr=r�release�time�	monotonicrBrr?�_ForkingPickler�loads)r"rHrI�resZdeadliner%r%r&�get\s*
z	Queue.getcCs|j|jj��Sr()rr�_semlockZ
_get_valuer*r%r%r&�qsizevszQueue.qsizecCs
|��Sr(�r?r*r%r%r&�emptyzszQueue.emptycCs|jj��Sr()rrR�_is_zeror*r%r%r&�full}sz
Queue.fullcCs
|�d�S�NF)rQr*r%r%r&�
get_nowait�szQueue.get_nowaitcCs|�|d�SrX)rJ�r"rGr%r%r&�
put_nowait�szQueue.put_nowaitcCs2d|_z|j��W5|j}|r,d|_|�XdS)NT)r8r9r�close)r"r\r%r%r&r\�szQueue.closecCs.td�|jstd�|���|jr*|��dS)NzQueue.join_thread()zQueue {0!r} not closed)r
r8�AssertionError�formatr6r*r%r%r&�join_thread�szQueue.join_threadcCs6td�d|_z|j��Wntk
r0YnXdS)NzQueue.cancel_join_thread()T)r
r7r6Zcancel�AttributeErrorr*r%r%r&�cancel_join_thread�szQueue.cancel_join_threadc
Cs�td�|j��tjtj|j|j|j|j	|j
j|j|j
|jfdd�|_d|j_td�|j��td�|js�t|jtjt�|j�gdd�|_t|tj|j|jgd	d�|_dS)
NzQueue._start_thread()ZQueueFeederThread)�target�args�nameTzdoing self._thread.start()z... done self._thread.start()���)Zexitpriority�
)r
r4�clearr/ZThreadr�_feedr1r;rrr\r�_on_queue_feeder_errorrr5Zdaemon�startr7r�_finalize_join�weakref�refr6�_finalize_closer9r*r%r%r&rC�s<
��
�
�zQueue._start_threadcCs4td�|�}|dk	r(|��td�ntd�dS)Nzjoining queue threadz... queue thread joinedz... queue thread already dead)r
�join)Ztwr�threadr%r%r&rk�s
zQueue._finalize_joinc	Cs.td�|�|�t�|��W5QRXdS)Nztelling queue thread to quit)r
rD�	_sentinelrE)�buffer�notemptyr%r%r&rn�s
zQueue._finalize_closec
CsXtd�|j}|j}	|j}
|j}t}tjdkr<|j}
|j}nd}
z�|�z|sT|
�W5|	�Xzb|�}||kr�td�|�WWdSt�	|�}|
dkr�||�qb|
�z||�W5|�XqbWnt
k
r�YnXWq@tk
�rP}zV|�rt|dd�t
jk�rWY�6dSt��r.td|�WY�dS|��|||�W5d}~XYq@Xq@dS)Nz$starting thread to feed data to piperz%feeder thread got sentinel -- exiting�errnorzerror in queue thread: %s)r
rBrK�wait�popleftrqrrrN�dumps�
IndexError�	Exception�getattrrtZEPIPErr)rrrsr:Z	writelockr\Zignore_epipe�onerrorZ	queue_semZnacquireZnreleaseZnwaitZbpopleft�sentinelZwacquireZwreleaserG�er%r%r&rh�sN







zQueue._feedcCsddl}|��dS)z�
        Private API hook called when feeding data in the background thread
        raises an exception.  For overriding by concurrent.futures.
        rN)�	traceback�	print_exc)r}rGr~r%r%r&ri
szQueue._on_queue_feeder_error)r)TN)TN)�__name__�
__module__�__qualname__r'r+r.r rJrQrSrUrWrYr[r\r_rarC�staticmethodrkrnrhrir%r%r%r&r"s.



 
	

=c@s@eZdZddd�Zdd�Zdd�Zdd
d�Zdd
�Zdd�Zd	S)rrcCs*tj|||d�|�d�|_|��|_dS)N)r$r)rr'Z	Semaphore�_unfinished_tasksr0�_condr!r%r%r&r'#szJoinableQueue.__init__cCst�|�|j|jfSr()rr+r�r�r*r%r%r&r+(szJoinableQueue.__getstate__cCs,t�||dd��|dd�\|_|_dS)N���)rr.r�r�r,r%r%r&r.+szJoinableQueue.__setstate__TNc
Cs�|jrtd|�d���|j�||�s(t�|j�J|j�8|jdkrJ|��|j	�
|�|j��|j�
�W5QRXW5QRXdSr@)r8rArrBrr1r�r5rCr4rDr�rKrErFr%r%r&rJ/s

zJoinableQueue.putc	Cs@|j�0|j�d�std��|jj��r2|j��W5QRXdS)NFz!task_done() called too many times)r�r�rBrArRrVZ
notify_allr*r%r%r&�	task_done<s
zJoinableQueue.task_donec	Cs,|j�|jj��s|j��W5QRXdSr()r�r�rRrVrur*r%r%r&roCszJoinableQueue.join)r)TN)	r�r�r�r'r+r.rJr�ror%r%r%r&r!s


c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)rcCsHtjdd�\|_|_|��|_|jj|_tj	dkr:d|_
n
|��|_
dS)NFrr)rrrrrrr>r?rrr)r"r$r%r%r&r'Ns


zSimpleQueue.__init__cCs
|��Sr(rTr*r%r%r&rUWszSimpleQueue.emptycCst�|�|j|j|j|jfSr()r	r)rrrrr*r%r%r&r+Zs
zSimpleQueue.__getstate__cCs"|\|_|_|_|_|jj|_dSr()rrrrr>r?r,r%r%r&r.^szSimpleQueue.__setstate__c	Cs&|j�|j��}W5QRXt�|�Sr()rrr<rNrO)r"rPr%r%r&rQbszSimpleQueue.getc	CsDt�|�}|jdkr"|j�|�n|j�|j�|�W5QRXdSr()rNrwrrr:rZr%r%r&rJhs


zSimpleQueue.putN)	r�r�r�r'rUr+r.rQrJr%r%r%r&rLs	)�__all__rrr/r2rLrlrtZqueuerrZ_multiprocessing�rr	Z	reductionZForkingPicklerrN�utilr
rrr
r�objectrrqrrr%r%r%r&�<module>
s$
v
+multiprocessing/__pycache__/managers.cpython-38.opt-1.pyc000064400000120571151153537440017405 0ustar00U

e5d��@sBdddddgZddlZddlZddlZddlZddlZddlZddlZddlmZddl	m
Z
d	d
lmZd	dl
mZmZmZd	dlmZd	d
lmZd	dlmZd	dlmZzd	dlmZdZWnek
r�dZYnXdd�Ze�eje�dd�dD�Zedek	�r.dd�ZeD]Ze�ee��qGdd�de�Zdifdd�Z dd�Z!Gd d!�d!e"�Z#d"d#�Z$d$d%�Z%Gd&d'�d'e�Z&Gd(d)�d)e�Z'ej(ej)fej*ej+fd*�Z,Gd+d�de�Z-Gd,d-�d-e.�Z/Gd.d�de�Z0d/d0�Z1ifd1d2�Z2dld3d4�Z3Gd5d6�d6e�Z4Gd7d8�d8e�Z5dmd9d:�Z6Gd;d<�d<e0�Z7Gd=d>�d>e0�Z8Gd?d@�d@e8�Z9GdAdB�dBe0�Z:GdCdD�dDe0�Z;GdEdF�dFe0�Z<GdGdH�dHe0�Z=e2dIdJ�Z>GdKdL�dLe>�Z?e2dMdN�Z@dOdPie@_Ae2dQdR�ZBe2dSdT�ZCdUdUdUdPdPdV�eC_AGdWdS�dSeC�ZDGdXd�de-�ZEeE�dYejF�eE�dZejF�eE�d[ejGe:�eE�d\ejHe8�eE�d]ejIe8�eE�d^ejJe8�eE�d_ejKe8�eE�d`ejLe9�eE�daejMe;�eE�dbejNeD�eE�dcee?�eE�ddeOe@�eE�d8e5e=�eE�d:e6eB�eE�d6e4e<�eEjdPe7dde�eEjdUddf�e�r>Gdgdh�dh�ZPGdidj�dje&�ZQGdkd�de-�ZRdS)n�BaseManager�SyncManager�	BaseProxy�Token�SharedMemoryManager�N)�getpid)�
format_exc�)�
connection)�	reduction�get_spawning_popen�ProcessError)�pool)�process)�util)�get_context)�
shared_memoryTFcCstj|j|��ffS�N)�array�typecode�tobytes)�a�r�0/usr/lib64/python3.8/multiprocessing/managers.py�reduce_array-srcCsg|]}tti|����qSr)�type�getattr��.0�namerrr�
<listcomp>1sr )�items�keys�valuescCstt|�ffSr)�list��objrrr�rebuild_as_list3sr'c@s4eZdZdZdZdd�Zdd�Zdd�Zd	d
�ZdS)rz3
    Type to uniquely identify a shared object
    ��typeid�address�idcCs||||_|_|_dSrr()�selfr)r*r+rrr�__init__BszToken.__init__cCs|j|j|jfSrr(�r,rrr�__getstate__EszToken.__getstate__cCs|\|_|_|_dSrr(�r,�staterrr�__setstate__HszToken.__setstate__cCsd|jj|j|j|jfS)Nz %s(typeid=%r, address=%r, id=%r))�	__class__�__name__r)r*r+r.rrr�__repr__Ks�zToken.__repr__N)	r4�
__module__�__qualname__�__doc__�	__slots__r-r/r2r5rrrrr<srcCs8|�||||f�|��\}}|dkr*|St||��dS)zL
    Send a message to manager using connection `c` and return response
    �#RETURNN)�send�recv�convert_to_error)�cr+�
methodname�args�kwds�kind�resultrrr�dispatchSs
rDcCsd|dkr|S|dkrRt|t�s4td�||t|����|dkrHtd|�St|�Sntd�|��SdS)N�#ERROR)�
#TRACEBACK�#UNSERIALIZABLEz.Result {0!r} (kind '{1}') type is {2}, not strrGzUnserializable message: %s
zUnrecognized message type {!r})�
isinstance�str�	TypeError�formatr�RemoteError�
ValueError)rBrCrrrr=]s
��
r=c@seZdZdd�ZdS)rLcCsdt|jd�dS)NzM
---------------------------------------------------------------------------
rzK---------------------------------------------------------------------------)rIr@r.rrr�__str__mszRemoteError.__str__N)r4r6r7rNrrrrrLlsrLcCs2g}t|�D] }t||�}t|�r|�|�q|S)z4
    Return a list of names of methods of `obj`
    )�dirr�callable�append)r&�tempr�funcrrr�all_methodsts
rTcCsdd�t|�D�S)zP
    Return a list of names of methods of `obj` which do not start with '_'
    cSsg|]}|ddkr|�qS)r�_rrrrrr �sz"public_methods.<locals>.<listcomp>)rTr%rrr�public_methodssrVc	@s�eZdZdZdddddddd	d
g	Zdd�Zd
d�Zdd�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zeee
d�Z
dd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&e_d'd(�Zd)d*�Zd+d,�Zd-d.�Zd/S)0�ServerzM
    Server class which runs in a process controlled by a manager object
    �shutdown�create�accept_connection�get_methods�
debug_info�number_of_objects�dummy�incref�decrefcCsxt|t�std�|t|����||_t�|�|_t	|\}}||dd�|_
|j
j|_ddi|_i|_
i|_t��|_dS)Nz&Authkey {0!r} is type {1!s}, not bytes�)r*Zbacklog�0�Nr)rH�bytesrJrKr�registryr�AuthenticationString�authkey�listener_client�listenerr*�	id_to_obj�id_to_refcount�id_to_local_proxy_obj�	threading�Lock�mutex)r,rer*rg�
serializer�Listener�Clientrrrr-�s 
��

zServer.__init__c	Cs�t��|_|t��_zVtj|jd�}d|_|��z|j��sL|j�d�q4Wnttfk
rfYnXW5tjtjkr�t	�
d�tjt_tjt_t�
d�XdS)z(
        Run the server forever
        zresetting stdout, stderrr)�targetTr	N)rm�Event�
stop_eventr�current_process�_manager_server�sys�stdout�
__stdout__r�debug�
__stderr__�stderr�exit�Thread�accepter�daemon�start�is_set�wait�KeyboardInterrupt�
SystemExit)r,r�rrr�
serve_forever�s 




zServer.serve_forevercCsNz|j��}Wntk
r&YqYnXtj|j|fd�}d|_|��qdS)N�rsr@T)riZaccept�OSErrorrmr�handle_requestr�r�)r,r>�trrrr��s
zServer.acceptercCs4d}}}z>t�||j�t�||j�|��}|\}}}}t||�}Wntk
rhdt�f}	Yn>Xz||f|�|�}Wntk
r�dt�f}	Yn
Xd|f}	z|�|	�Wnrtk
�r&}
zRz|�dt�f�Wntk
r�YnXt	�
d|	�t	�
d|�t	�
d|
�W5d}
~
XYnX|��dS)z)
        Handle a new connection
        NrFr:zFailure to send message: %rz ... request was %r� ... exception was %r)r
Zdeliver_challengergZanswer_challenger<r�	Exceptionrr;r�info�close)r,r>�funcnamerC�request�ignorer@rArS�msg�errrr��s2zServer.handle_requestc
Cs�t�dt��j�|j}|j}|j}|j�	��s�zBd}}|�}|\}}}	}
z||\}}}Wn^t
k
r�}
z@z|j|\}}}Wn&t
k
r�}z|
�W5d}~XYnXW5d}
~
XYnX||kr�td|t
|�|f��t||�}z||	|
�}Wn,tk
�r"}zd|f}W5d}~XYnPX|�o4|�|d�}|�rj|�|||�\}}t||j|�}d||ff}nd|f}Wn�tk
�r�|dk�r�dt�f}nNz,|j|}|||||f|	�|
�}d|f}Wn tk
�r�dt�f}YnXYnPtk
�rt�dt��j�t�d	�Yn tk
�r<dt�f}YnXzDz||�Wn2tk
�r~}z|d
t�f�W5d}~XYnXWq$tk
�r�}z@t�dt��j�t�d|�t�d
|�|��t�d�W5d}~XYq$Xq$dS)zQ
        Handle requests from the proxies in a particular process/thread
        z$starting server thread to service %rNz+method %r of %r object is not in exposed=%rrE�#PROXYr:rFz$got EOF -- exiting thread serving %rrrGzexception in thread serving %rz ... message was %rr�r	)rr{rm�current_threadrr<r;rjrur��KeyErrorrl�AttributeErrorrrr��getrYrr*r�fallback_mapping�EOFErrorrxr~r�r�)r,�connr<r;rjr?r&r��identr@rA�exposed�	gettypeid�keZ	second_keZfunction�resr�r�r)ZridentZrexposed�tokenZ
fallback_funcrCrrr�serve_client�s���(��


����$�zServer.serve_clientcCs|Srr�r,r�r�r&rrr�fallback_getvalue5szServer.fallback_getvaluecCst|�Sr�rIr�rrr�fallback_str8szServer.fallback_strcCst|�Sr)�reprr�rrr�
fallback_repr;szServer.fallback_repr)rNr5�	#GETVALUEcCsdSrr�r,r>rrrr^DszServer.dummyc
Cs�|j�tg}t|j���}|��|D]<}|dkr&|�d||j|t|j|d�dd�f�q&d�|�W5QR�SQRXdS)zO
        Return some info --- useful to spot problems with refcounting
        rbz  %s:       refcount=%s
    %srN�K�
)	ror$rkr"�sortrQrIrj�join)r,r>rCr"r�rrrr\Gs
��zServer.debug_infocCs
t|j�S)z*
        Number of shared objects
        )�lenrkr�rrrr]WszServer.number_of_objectscCsLz:zt�d�|�d�Wnddl}|��YnXW5|j��XdS)z'
        Shutdown this process
        z!manager received shutdown message�r:NrN)ru�setrr{r;�	traceback�	print_exc)r,r>r�rrrrX^s
zServer.shutdownc	Os�t|�dkr|^}}}}n�|s(td��n�d|krDtdt|�d��|�d�}t|�dkr~|^}}}ddl}|jd	tdd
�nFd|kr�tdt|�d��|�d�}|^}}ddl}|jdtdd
�t|�}|j��|j|\}}}}	|dk�r|�st|�dk�rt	d
��|d}
n
|||�}
|dk�r2t
|
�}|dk	�rlt|t��s\td�
|t|����t|�t|�}dt|
�}t�d||�|
t|�|f|j|<||jk�r�d|j|<W5QRX|�||�|t|�fS)z>
        Create a new shared object and return its id
        �z8descriptor 'create' of 'Server' object needs an argumentr)�7create expected at least 2 positional arguments, got %dr	�rNz2Passing 'typeid' as keyword argument is deprecated)�
stacklevelr>z-Passing 'c' as keyword argument is deprecatedz4Without callable, must have one non-keyword argumentz,Method_to_typeid {0!r}: type {1!s}, not dictz%xz&%r callable returned object with id %r)r�rJ�pop�warnings�warn�DeprecationWarning�tuplerorerMrVrH�dictrKrr$r+rr{r�rjrkr_)r@rAr,r>r)r�rPr��method_to_typeid�	proxytyper&r�rrrrYksp

�

�
�
��

�



��z
Server.createz$($self, c, typeid, /, *args, **kwds)cCst|j|jd�S)zL
        Return the methods of the shared object indicated by token
        r	)r�rjr+)r,r>r�rrrr[�szServer.get_methodscCs"|t��_|�d�|�|�dS)z=
        Spawn a new thread to serve this connection
        r�N)rmr�rr;r�)r,r>rrrrrZ�s

zServer.accept_connectioncCs�|j��z|j|d7<Wnhtk
r�}zJ||jkrrd|j|<|j||j|<|j|\}}}t�d|�n|�W5d}~XYnXW5QRXdS)Nr	z&Server re-enabled tracking & INCREF %r)rorkr�rlrjrr{)r,r>r�r�r&r�r�rrrr_�s

�z
Server.increfc	Cs�||jkr$||jkr$t�d|�dS|j�Z|j|dkrXtd�||j||j|���|j|d8<|j|dkr�|j|=W5QRX||jkr�d|j|<t�d|�|j�|j|=W5QRXdS)NzServer DECREF skipping %rrz+Id {0!s} ({1!r}) has refcount {2:n}, not 1+r	)NrNzdisposing of obj with id %r)rkrlrr{ro�AssertionErrorrKrj)r,r>r�rrrr`�s,
���

z
Server.decrefN)r4r6r7r8�publicr-r�r�r�r�r�r�r�r�r^r\r]rXrY�__text_signature__r[rZr_r`rrrrrW�s<�
"Q�
=rWc@seZdZdgZdZdZdZdS)�State�valuerr	r�N)r4r6r7r9�INITIAL�STARTED�SHUTDOWNrrrrr��sr�)�pickleZ	xmlrpclibc@s�eZdZdZiZeZd"dd�Zdd�Zdd	�Z	d#dd�Z
ed$d
d��Zdd�Z
d%dd�Zdd�Zdd�Zdd�Zdd�Zedd��Zedd��Zed&d d!��ZdS)'rz!
    Base class for managers
    Nr�cCs\|dkrt��j}||_t�|�|_t�|_tj|j_	||_
t|\|_|_
|pTt�|_dSr)rrvrg�_addressrf�_authkeyr��_stater�r��_serializerrhZ	_Listener�_Clientr�_ctx)r,r*rgrpZctxrrrr-s

zBaseManager.__init__cCsf|jjtjkrP|jjtjkr&td��n*|jjtjkr>td��ntd�|jj���t|j	|j
|j|j�S)zX
        Return server object with serve_forever() method and address attribute
        �Already started server�Manager has shut down�Unknown state {!r})
r�r�r�r�r�r
r�rKrW�	_registryr�r�r�r.rrr�
get_servers

�
�zBaseManager.get_servercCs8t|j\}}||j|jd�}t|dd�tj|j_dS)z>
        Connect manager object to the server process
        �rgNr^)	rhr�r�r�rDr�r�r�r�)r,rqrrr�rrr�connectszBaseManager.connectrc	Cs4|jjtjkrP|jjtjkr&td��n*|jjtjkr>td��ntd�|jj���|dk	rht|�sht	d��t
jdd�\}}|jj
t|�j|j|j|j|j|||fd�|_d	�d
d�|jjD��}t|�jd||j_|j��|��|��|_|��tj|j_tj|t|�j|j|j|j|j|jfd
d�|_ dS)z@
        Spawn a server process for this manager object
        r�r�r�Nzinitializer must be a callableF)Zduplexr��:css|]}t|�VqdSrr�)r�irrr�	<genexpr>Asz$BaseManager.start.<locals>.<genexpr>�-r�r@Zexitpriority)!r�r�r�r�r�r
r�rKrPrJr
ZPiper�ZProcessr�_run_serverr�r�r�r��_processr�Z	_identityr4rr�r�r<r�Finalize�_finalize_managerr�rX)r,�initializer�initargs�reader�writerr�rrrr�(sH

���


��zBaseManager.startc	Cs^t�tjtj�|dk	r ||�|�||||�}|�|j�|��t�d|j�|�	�dS)z@
        Create a server, report its address and run it
        Nzmanager serving at %r)
�signal�SIGINT�SIG_IGN�_Serverr;r*r�rr�r�)	�clsrer*rgrpr�r�r��serverrrrr�SszBaseManager._run_servercOsN|j|j|jd�}zt|dd|f||�\}}W5|��Xt||j|�|fS)zP
        Create a new shared object; return the token and exposed tuple
        r�NrY)r�r�r�r�rDr)r,r)r@rAr�r+r�rrr�_createjs

zBaseManager._createcCs*|jdk	r&|j�|�|j��s&d|_dS)zC
        Join the manager process (if it has been spawned)
        N)r�r��is_alive�r,�timeoutrrrr�vs

zBaseManager.joincCs2|j|j|jd�}zt|dd�W�S|��XdS)zS
        Return some info about the servers shared objects and connections
        r�Nr\�r�r�r�r�rD�r,r�rrr�_debug_infoszBaseManager._debug_infocCs2|j|j|jd�}zt|dd�W�S|��XdS)z5
        Return the number of shared objects
        r�Nr]r�r�rrr�_number_of_objects�szBaseManager._number_of_objectscCsj|jjtjkr|��|jjtjkrf|jjtjkr<td��n*|jjtjkrTtd��ntd�|jj���|S)NzUnable to start serverr�r�)	r�r�r�r�r�r�r
r�rKr.rrr�	__enter__�s

�zBaseManager.__enter__cCs|��dSr)rX�r,�exc_typeZexc_valZexc_tbrrr�__exit__�szBaseManager.__exit__cCs�|��r�t�d�z,|||d�}zt|dd�W5|��XWntk
rRYnX|jdd�|��r�t�d�t|d�r�t�d	�|��|jd
d�|��r�t�d�t	j
|_ztj
|=Wntk
r�YnXdS)zQ
        Shutdown the manager process; will be registered as a finalizer
        z#sending shutdown message to managerr�NrXg�?)r�zmanager still alive�	terminatez'trying to `terminate()` manager processg�������?z#manager still alive after terminate)r�rr�r�rDr�r��hasattrr�r�r�r�r�_address_to_localr�)rr*rgr1r�r�rrrr��s.




zBaseManager._finalize_managercCs|jSr)r�r.rrrr*�szBaseManager.addressTc
s�d|jkr|j��|_�dkr"t�|p0t�dd�}|p@t�dd�}|r\t|���D]\}}qR|||�f|j�<|r���fdd�}	�|	_t|�|	�dS)z9
        Register a typeid with the manager type
        r�N�	_exposed_�_method_to_typeid_cs`t�d��|j�f|�|�\}}�||j||j|d�}|j|j|jd�}t|dd|jf�|S)Nz)requesting creation of a shared %r object��managerrgr�r�r`)	rr{r�r�r�r�r*rDr+)r,r@rAr�Zexp�proxyr��r�r)rrrR�s�z"BaseManager.register.<locals>.temp)	�__dict__r��copy�	AutoProxyrr$r!r4�setattr)
r�r)rPr�r�r��
create_method�keyr�rRrr�r�register�s(

��

zBaseManager.register)NNr�N)Nr)Nr)N)NNNNT)r4r6r7r8r�rWr�r-r�r�r��classmethodr�r�r�r�r�r�r��staticmethodr��propertyr*rrrrrr�s8�
	
+�
	




�c@seZdZdd�Zdd�ZdS)�ProcessLocalSetcCst�|dd��dS)NcSs|��Sr)�clearr%rrr�<lambda>��z*ProcessLocalSet.__init__.<locals>.<lambda>)r�register_after_forkr.rrrr-�szProcessLocalSet.__init__cCst|�dfSrc)rr.rrr�
__reduce__�szProcessLocalSet.__reduce__N)r4r6r7r-rrrrrr	�sr	c@s�eZdZdZiZe��Zddd�Zdd�Z	d	ifd
d�Z
dd
�Zdd�Ze
dd��Zdd�Zdd�Zdd�Zdd�Zdd�ZdS)rz.
    A base for proxies of shared objects
    NTFc		Cs�tj�8tj�|jd�}|dkr:t��t�f}|tj|j<W5QRX|d|_|d|_	||_
|j
j|_||_
||_t|d|_||_|dk	r�t�|�|_n"|j
dk	r�|j
j|_nt��j|_|r�|��t�|tj�dS)Nrr	)r�_mutexr�r�r*rZForkAwareLocalr	�_tls�_idset�_tokenr+�_id�_managerr�rhr��_owned_by_managerrrfr�rvrg�_increfr
�_after_fork)	r,r�rpr�rgr�r_�
manager_ownedZ	tls_idsetrrrr-s*



zBaseProxy.__init__cCsdt�d�t��j}t��jdkr4|dt��j7}|j|jj	|j
d�}t|dd|f�||j_
dS)Nzmaking connection to managerZ
MainThread�|r�rZ)rr{rrvrrmr�r�rr*r�rDrr
)r,rr�rrr�_connect-s

zBaseProxy._connectrcCs�z|jj}Wn6tk
rBt�dt��j�|��|jj}YnX|�	|j
|||f�|��\}}|dkrp|S|dkr�|\}}|jj
|jd}	|jj|_|	||j|j|j|d�}
|j|j|jd�}t|dd|jf�|
St||��dS)	zV
        Try to call a method of the referent and return a copy of the result
        z#thread %r does not own a connectionr:r����r�r�Nr`)rr
r�rr{rmr�rrr;rr<rr�r)rr*r�r�r�rDr+r=)r,r?r@rAr�rBrCr�r�r�r�rrr�_callmethod6s6�
�zBaseProxy._callmethodcCs
|�d�S)z9
        Get a copy of the value of the referent
        r��rr.rrr�	_getvalueTszBaseProxy._getvaluec	Cs�|jrt�d|jj�dS|j|jj|jd�}t|dd|j	f�t�d|jj�|j
�|j	�|joj|jj
}tj|tj|j|j||j|j
|jfdd�|_dS)Nz%owned_by_manager skipped INCREF of %rr�r_z	INCREF %r�
r�)rrr{rr+r�r*r�rDrr�addrr�r�r�_decrefrZ_close)r,r�r1rrrrZs$
��zBaseProxy._increfc
Cs�|�|j�|dks |jtjkr�z2t�d|j�||j|d�}t|dd|jf�Wq�t	k
r�}zt�d|�W5d}~XYq�Xnt�d|j�|s�t
|d�r�t�dt��j
�|j��|`dS)Nz	DECREF %rr�r`z... decref failed %sz%DECREF %r -- manager already shutdownr
z-thread %r has no more proxies so closing conn)�discardr+r�r�r�rr{r*rDr�r�rmr�rr
r�)r�rgr1ZtlsZidsetr�r�r�rrrr!ns �
zBaseProxy._decrefc
CsHd|_z|��Wn0tk
rB}zt�d|�W5d}~XYnXdS)Nzincref failed: %s)rrr�rr�)r,r�rrrr�s
zBaseProxy._after_forkcCs^i}t�dk	r|j|d<t|dd�rB|j|d<tt|j|j|ffStt|�|j|j|ffSdS)Nrg�_isautoFr�)	rr�rr��RebuildProxyrrr�r�r,rArrrr�s


��zBaseProxy.__reduce__cCs|��Sr)r)r,Zmemorrr�__deepcopy__�szBaseProxy.__deepcopy__cCsdt|�j|jjt|�fS)Nz<%s object, typeid %r at %#x>)rr4rr)r+r.rrrr5�s�zBaseProxy.__repr__cCs:z|�d�WStk
r4t|�dd�dYSXdS)zV
        Return representation of the referent (or a fall-back if that fails)
        r5Nrz; '__str__()' failed>)rr�r�r.rrrrN�szBaseProxy.__str__)NNNTF)r4r6r7r8r�rZForkAwareThreadLockrr-rrrrrr!rrr&r5rNrrrrr�s(�
)	

cCs�tt��dd�}|rT|j|jkrTt�d|�d|d<|j|jkrT|j|j|j|j<|�	dd�optt��dd�}|||fd|i|��S)	z5
    Function used for unpickling proxy objects.
    rwNz*Rebuild a proxy owned by manager, token=%rTrr_Z_inheritingF)
rrrvr*rr{r+rlrjr�)rSr�rprAr�r_rrrr$�s
�
�r$cCspt|�}z|||fWStk
r*YnXi}|D]}td||f|�q4t|tf|�}||_||||f<|S)zB
    Return a proxy type whose methods are given by `exposed`
    zOdef %s(self, /, *args, **kwds):
        return self._callmethod(%r, args, kwds))r�r��execrrr�)rr��_cacheZdicZmeth�	ProxyTyperrr�
MakeProxyType�s ��r*c
Cs�t|d}|dkrB||j|d�}zt|dd|f�}W5|��X|dkrX|dk	rX|j}|dkrjt��j}td|j	|�}||||||d�}	d|	_
|	S)z*
    Return an auto-proxy for `token`
    r	Nr�r[z
AutoProxy[%s])r�rgr_T)rhr*r�rDr�rrvrgr*r)r#)
r�rpr�rgr�r_r�r�r)r�rrrr�s 


�rc@seZdZdd�Zdd�ZdS)�	NamespacecKs|j�|�dSr)r��updater%rrrr-�szNamespace.__init__cCsZt|j���}g}|D]$\}}|�d�s|�d||f�q|��d|jjd�|�fS)NrUz%s=%rz%s(%s)z, )	r$r�r!�
startswithrQr�r3r4r�)r,r!rRrr�rrrr5�s
zNamespace.__repr__N)r4r6r7r-r5rrrrr+�sr+c@s8eZdZddd�Zdd�Zdd�Zdd	�Zeee�Zd
S)�ValueTcCs||_||_dSr)�	_typecode�_value)r,rr��lockrrrr-szValue.__init__cCs|jSr�r0r.rrrr�sz	Value.getcCs
||_dSrr2�r,r�rrrr�
sz	Value.setcCsdt|�j|j|jfS)Nz
%s(%r, %r))rr4r/r0r.rrrr5szValue.__repr__N)T)	r4r6r7r-r�r�r5rr�rrrrr.s

r.cCst�||�Sr)r)r�sequencer1rrr�Arraysr5c@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�
IteratorProxy)�__next__r;�throwr�cCs|Srrr.rrr�__iter__szIteratorProxy.__iter__cGs|�d|�S)Nr7r�r,r@rrrr7szIteratorProxy.__next__cGs|�d|�S)Nr;rr:rrrr;szIteratorProxy.sendcGs|�d|�S)Nr8rr:rrrr8szIteratorProxy.throwcGs|�d|�S)Nr�rr:rrrr�!szIteratorProxy.closeN)	r4r6r7r�r9r7r;r8r�rrrrr6sr6c@s2eZdZdZddd�Zdd�Zdd	�Zd
d�ZdS)
�
AcquirerProxy)�acquire�releaseTNcCs"|dkr|fn||f}|�d|�S�Nr<r)r,Zblockingr�r@rrrr<'szAcquirerProxy.acquirecCs
|�d�S�Nr=rr.rrrr=*szAcquirerProxy.releasecCs
|�d�Sr>rr.rrrr�,szAcquirerProxy.__enter__cCs
|�d�Sr?rr�rrrr�.szAcquirerProxy.__exit__)TN)r4r6r7r�r<r=r�r�rrrrr;%s

r;c@s6eZdZdZddd�Zd
dd�Zdd	�Zdd
d�ZdS)�ConditionProxy)r<r=r��notify�
notify_allNcCs|�d|f�S�Nr�rr�rrrr�4szConditionProxy.waitr	cCs|�d|f�S)NrAr)r,�nrrrrA6szConditionProxy.notifycCs
|�d�S)NrBrr.rrrrB8szConditionProxy.notify_allcCsd|�}|r|S|dk	r$t��|}nd}d}|s`|dk	rN|t��}|dkrNq`|�|�|�}q,|S)Nr)�time�	monotonicr�)r,Z	predicater�rCZendtimeZwaittimerrr�wait_for:s
zConditionProxy.wait_for)N)r	)N)r4r6r7r�r�rArBrGrrrrr@2s


r@c@s2eZdZdZdd�Zdd�Zdd�Zdd	d
�ZdS)�
EventProxy)r�r�r
r�cCs
|�d�S)Nr�rr.rrrr�OszEventProxy.is_setcCs
|�d�S�Nr�rr.rrrr�QszEventProxy.setcCs
|�d�S)Nr
rr.rrrr
SszEventProxy.clearNcCs|�d|f�SrCrr�rrrr�UszEventProxy.wait)N)r4r6r7r�r�r�r
r�rrrrrHMs
rHc@sNeZdZdZddd�Zdd�Zdd�Zed	d
��Zedd��Z	ed
d��Z
dS)�BarrierProxy)�__getattribute__r��abort�resetNcCs|�d|f�SrCrr�rrrr�[szBarrierProxy.waitcCs
|�d�S)NrLrr.rrrrL]szBarrierProxy.abortcCs
|�d�S)NrMrr.rrrrM_szBarrierProxy.resetcCs|�dd�S)NrK)�partiesrr.rrrrNaszBarrierProxy.partiescCs|�dd�S)NrK)�	n_waitingrr.rrrrOdszBarrierProxy.n_waitingcCs|�dd�S)NrK)�brokenrr.rrrrPgszBarrierProxy.broken)N)r4r6r7r�r�rLrMrrNrOrPrrrrrJYs


rJc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�NamespaceProxy)rK�__setattr__�__delattr__cCs0|ddkrt�||�St�|d�}|d|f�S)NrrUrrK)�objectrK�r,r�
callmethodrrr�__getattr__nszNamespaceProxy.__getattr__cCs4|ddkrt�|||�St�|d�}|d||f�S)NrrUrrR)rTrRrK)r,rr�rVrrrrRsszNamespaceProxy.__setattr__cCs0|ddkrt�||�St�|d�}|d|f�S)NrrUrrS)rTrSrKrUrrrrSxszNamespaceProxy.__delattr__N)r4r6r7r�rWrRrSrrrrrQlsrQc@s*eZdZdZdd�Zdd�Zeee�ZdS)�
ValueProxy)r�r�cCs
|�d�S)Nr�rr.rrrr��szValueProxy.getcCs|�d|f�SrIrr3rrrr��szValueProxy.setN)r4r6r7r�r�r�rr�rrrrrXsrX�
BaseListProxy)�__add__�__contains__�__delitem__�__getitem__�__len__�__mul__�__reversed__�__rmul__�__setitem__rQ�count�extend�index�insertr��remove�reverser��__imul__c@seZdZdd�Zdd�ZdS)�	ListProxycCs|�d|f�|S)Nrdrr3rrr�__iadd__�szListProxy.__iadd__cCs|�d|f�|S)Nrirr3rrrri�szListProxy.__imul__N)r4r6r7rkrirrrrrj�srj�	DictProxy)r[r\r]r9r^rbr
rr�r!r"r��popitem�
setdefaultr,r#r9�Iterator�
ArrayProxy)r^r]rb�	PoolProxy)Zapply�apply_asyncr��imap�imap_unorderedr��map�	map_async�starmap�
starmap_asyncr�ZAsyncResult)rrrvrxrsrtc@seZdZdd�Zdd�ZdS)rqcCs|Srrr.rrrr��szPoolProxy.__enter__cCs|��dSr)r�r�rrrr��szPoolProxy.__exit__N)r4r6r7r�r�rrrrrq�sc@seZdZdZdS)ra(
    Subclass of `BaseManager` which supports a number of shared object types.

    The types registered are those intended for the synchronization
    of threads, plus `dict`, `list` and `Namespace`.

    The `multiprocessing.Manager()` function creates started instances of
    this class.
    N)r4r6r7r8rrrrr�s�QueueZ
JoinableQueuertrn�RLock�	Semaphore�BoundedSemaphore�	Condition�Barrier�Poolr$r�)r�r)rc@sLeZdZdZgfdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)�_SharedMemoryTrackerz+Manages one or more shared memory segments.cCs||_||_dSr�Zshared_memory_context_name�
segment_names)r,rr�rrrr-�sz_SharedMemoryTracker.__init__cCs(t�d|�dt����|j�|�dS)z6Adds the supplied shared memory block name to tracker.zRegister segment � in pid N)rr{rr�rQ�r,�segment_namerrr�register_segment�sz%_SharedMemoryTracker.register_segmentcCsBt�d|�dt����|j�|�t�|�}|��|��dS)z�Calls unlink() on the shared memory block with the supplied name
            and removes it from the list of blocks being tracked.zDestroy segment r�N)	rr{rr�rgr�SharedMemoryr��unlink)r,r�Zsegmentrrr�destroy_segment�s

z$_SharedMemoryTracker.destroy_segmentcCs"|jdd�D]}|�|�qdS)z<Calls destroy_segment() on all tracked shared memory blocks.N)r�r�r�rrrr��sz_SharedMemoryTracker.unlinkcCs(t�d|jj�dt����|��dS)NzCall z.__del__ in )rr{r3r4rr�r.rrr�__del__�sz_SharedMemoryTracker.__del__cCs|j|jfSrr�r.rrrr/�sz!_SharedMemoryTracker.__getstate__cCs|j|�dSr)r-r0rrrr2sz!_SharedMemoryTracker.__setstate__N)r4r6r7r8r-r�r�r�r�r/r2rrrrr��s	r�c@sReZdZejdddgZdd�Zdd�Zde_d	d
�Zdd�Z	d
d�Z
dd�ZdS)�SharedMemoryServer�
track_segment�release_segment�
list_segmentscOsZtj|f|�|�|j}t|t�r,t�|�}td|�dt����|_	t
�dt����dS)NZshm_rUz"SharedMemoryServer started by pid )rWr-r*rHrd�os�fsdecoder�r�shared_memory_contextrr{)r,r@�kwargsr*rrrr-
s

�zSharedMemoryServer.__init__cOstt|�dkr|d}n4d|kr(|d}n"|s6td��ntdt|�d��ttj|dd�rhtj|d	<tj||�S)
z�Create a new distributed-shared object (not backed by a shared
            memory block) and return its id to be used in a Proxy Object.r�r�r)zDdescriptor 'create' of 'SharedMemoryServer' object needs an argumentr�r	rZ_shared_memory_proxyr�)r�rJr�r,rer�rWrY)r@r�Ztypeodr)rrrrYs



�
zSharedMemoryServer.createz&($self, c, typeid, /, *args, **kwargs)cCs|j��t�||�S)zACall unlink() on all tracked shared memory, terminate the Server.)r�r�rWrXr�rrrrX)s
zSharedMemoryServer.shutdowncCs|j�|�dS)z?Adds the supplied shared memory block name to Server's tracker.N)r�r��r,r>r�rrrr�.sz SharedMemoryServer.track_segmentcCs|j�|�dS)z�Calls unlink() on the shared memory block with the supplied name
            and removes it from the tracker instance inside the Server.N)r�r�r�rrrr�2sz"SharedMemoryServer.release_segmentcCs|jjS)zbReturns a list of names of shared memory blocks that the Server
            is currently tracking.)r�r�r�rrrr�7sz SharedMemoryServer.list_segmentsN)r4r6r7rWr�r-rYr�rXr�r�r�rrrrr�s�
r�c@s<eZdZdZeZdd�Zdd�Zdd�Zdd	�Z	d
d�Z
dS)
ra�Like SyncManager but uses SharedMemoryServer instead of Server.

        It provides methods for creating and returning SharedMemory instances
        and for creating a list-like object (ShareableList) backed by shared
        memory.  It also provides methods that create and return Proxy Objects
        that support synchronization across processes (i.e. multi-process-safe
        locks and semaphores).
        cOsNtjdkrddlm}|��tj|f|�|�t�|j	j
�dt����dS)N�posixr	)�resource_trackerz created by pid )r�r�r�Zensure_runningrr-rr{r3r4r)r,r@r�r�rrrr-Is

zSharedMemoryManager.__init__cCst�|jj�dt����dS)Nz.__del__ by pid )rr{r3r4rr.rrrr�UszSharedMemoryManager.__del__cCsh|jjtjkrP|jjtjkr&td��n*|jjtjkr>td��ntd�|jj���|�|j	|j
|j|j�S)z@Better than monkeypatching for now; merge into Server ultimatelyz"Already started SharedMemoryServerz!SharedMemoryManager has shut downr�)
r�r�r�r�r�r
r�rKr�r�r�r�r�r.rrrr�Ys

��zSharedMemoryManager.get_servercCsx|j|j|jd��\}tjdd|d�}zt|dd|jf�Wn.tk
rh}z|��|�W5d}~XYnXW5QRX|S)zoReturns a new SharedMemory instance with the specified size in
            bytes, to be tracked by the manager.r�NT)rY�sizer�)	r�r�r�rr�rDr�
BaseExceptionr�)r,r�r�Zsmsr�rrrr�fs z SharedMemoryManager.SharedMemorycCsv|j|j|jd��Z}t�|�}zt|dd|jjf�Wn0tk
rf}z|j�	�|�W5d}~XYnXW5QRX|S)z�Returns a new ShareableList instance populated with the values
            from the input sequence, to be tracked by the manager.r�Nr�)
r�r�r�r�
ShareableListrDZshmrr�r�)r,r4r�Zslr�rrrr�rs

 z!SharedMemoryManager.ShareableListN)r4r6r7r8r�r�r-r�r�r�r�rrrrr=s	
)NNNT)T)S�__all__rxrmr�rZqueuerEr�rr�rr�r
�contextrrr
rrrrrZ	HAS_SHMEM�ImportErrorrrZ
view_typesr$r'Z	view_typerTrrDr=r�rLrTrVrWr�rqrrZXmlListenerZ	XmlClientrhrr�r	rr$r*rr+r.r5r6r;r@rHrJrQrXrYrjrlr�rpZ
BasePoolProxyrqrryrtrnrzr{r|r}r~rr�r�r�rrrrr�<module>s��


c

�	w
4�


	
	
�

�

�%8multiprocessing/__pycache__/reduction.cpython-38.opt-1.pyc000064400000020015151153537440017574 0ustar00U

e5d(%�@sddlmZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddddd	gZejd
kp�e
ed�o�e
ed�o�e
ejd
�ZGdd�dej�ZejZd6dd	�Zejd
k�redddg7ZddlZd7dd�dd�Zdd�Zdd�Zdd�ZGdd�de�ZnHedddg7ZddlZejdkZdd�Zdd�Zd d�Zd!d�Zd"d�Zd#d$�ZGd%d&�d&�Z ee!e �j"�e�d'd(�Z#ee!e$j%�e#�ee!e&j'�e#�d)d*�Z(d+d,�Z)eej*e(�ejd
k�r�d-d.�Z+d/d0�Z,eeje+�nd1d.�Z+d2d0�Z,eeje+�Gd3d4�d4ed5�Z-dS)8�)�ABCMetaN�)�context�send_handle�recv_handle�ForkingPickler�register�dump�win32ZCMSG_LEN�
SCM_RIGHTS�sendmsgcsJeZdZdZiZejZ�fdd�Ze	dd��Z
e	d	dd��Zej
Z
�ZS)
rz)Pickler subclass used by multiprocessing.cs*t�j|�|j��|_|j�|j�dS�N)�super�__init__�_copyreg_dispatch_table�copy�dispatch_table�update�_extra_reducers��self�args��	__class__��1/usr/lib64/python3.8/multiprocessing/reduction.pyr&szForkingPickler.__init__cCs||j|<dS)z&Register a reduce function for a type.N)r)�cls�type�reducerrrr+szForkingPickler.registerNcCs t��}|||��|�|��Sr
)�io�BytesIOr	�	getbuffer)r�obj�protocolZbufrrr�dumps0szForkingPickler.dumps)N)�__name__�
__module__�__qualname__�__doc__r�copyregrrr�classmethodrr$�pickle�loads�
__classcell__rrrrr!s
cCst||��|�dS)z3Replacement for pickle.dump() using ForkingPickler.N)rr	)r"�filer#rrrr	:s�	DupHandle�	duplicate�steal_handleF)�source_processcCs6t��}|dkr|}|dkr |}t�|||d|tj�S)z<Duplicate a handle.  (target_process is a handle not a pid!)Nr)�_winapi�GetCurrentProcess�DuplicateHandle�DUPLICATE_SAME_ACCESS)�handleZtarget_processZinheritabler2Zcurrent_processrrrr0Gs�c	CsFt�tjd|�}z$t�||t��ddtjtjB�W�St�|�XdS)z5Steal a handle from process identified by source_pid.FrN)r3�OpenProcess�PROCESS_DUP_HANDLE�CloseHandler5r4r6�DUPLICATE_CLOSE_SOURCE)Z
source_pidr7Zsource_process_handlerrrr1Ss�
�cCst|tj|�}|�|�dS�z&Send a handle over a local connection.N)r/r3r6�send)�connr7�destination_pidZdhrrrr_scCs|����S)�)Receive a handle over a local connection.)�recv�detach)r>rrrrdsc@s"eZdZdZddd�Zdd�ZdS)r/zPicklable wrapper for a handle.Nc	Cs\|dkrt��}t�tjd|�}zt�t��|||dd�|_W5t�|�X||_	||_
dS)NFr)�os�getpidr3r8r9r:r5r4�_handle�_access�_pid)rr7�access�pid�procrrrrjs�
zDupHandle.__init__c	CsZ|jt��kr|jSt�tjd|j�}z"t�||jt�	�|j
dtj�W�St�|�XdS)z1Get the handle.  This should only be called once.FN)rGrCrDrEr3r8r9r:r5r4rFr;)rrJrrrrBys
��zDupHandle.detach)N)r%r&r'r(rrBrrrrr/hs
�DupFd�sendfds�recvfds�darwincCsVt�d|�}tt|�dg�}|�|gtjtj|fg�trR|�d�dkrRt	d��dS)z,Send an array of fds over an AF_UNIX socket.�i�r�Az%did not receive acknowledgement of fdN)
�array�bytes�lenr�socket�
SOL_SOCKETr�ACKNOWLEDGErA�RuntimeError)�sockZfds�msgrrrrL�s
c	Cst�d�}|j|}|�dt�|��\}}}}|s:|s:t�z�trJ|�d�t|�dkrft	dt|���|d\}}	}
|tj
kr�|	tjkr�t|
�|jdkr�t�|�
|
�t|�d|dkr�td�t|�|d���t|�WSWnttfk
r�YnXt	d��d	S)
z/Receive an array of fds over an AF_UNIX socket.rOrrQzreceived %d items of ancdatarrPz Len is {0:n} but msg[0] is {1!r}zInvalid data receivedN)rR�itemsizeZrecvmsgrUZ
CMSG_SPACE�EOFErrorrWr=rTrXrVr�
ValueErrorZ	frombytes�AssertionError�format�list�
IndexError)rY�size�aZ
bytes_sizerZZancdata�flagsZaddrZ
cmsg_levelZ	cmsg_typeZ	cmsg_datarrrrM�s<


�
�
��c	Cs2t�|��tjtj��}t||g�W5QRXdSr<)rU�fromfd�fileno�AF_UNIX�SOCK_STREAMrL)r>r7r?�srrrr�sc
Cs<t�|��tjtj��}t|d�dW5QR�SQRXdS)r@rrN)rUrerfrgrhrM)r>rirrrr�scCsFt��}|dk	r |�|�|��Str:ddlm}|�|�Std��dS)zReturn a wrapper for an fd.Nr)�resource_sharerz&SCM_RIGHTS appears not to be available)rZget_spawning_popenrKZduplicate_for_child�HAVE_SEND_HANDLE�rjr])�fdZ	popen_objrjrrrrK�s
cCs2|jdkrt|j|jjffSt|j|jjffSdSr
)�__self__�getattrr�__func__r%��mrrr�_reduce_method�s
rsc@seZdZdd�ZdS)�_CcCsdSr
r)rrrr�f�sz_C.fN)r%r&r'rurrrrrt�srtcCst|j|jffSr
)ro�__objclass__r%rqrrr�_reduce_method_descriptor�srwcCst|j|j|jpiffSr
)�_rebuild_partial�funcr�keywords)�prrr�_reduce_partial�sr|cCstj|f|�|�Sr
)�	functools�partial)ryrrzrrrrx�srxcCsddlm}t||�ffS)Nr)�	DupSocket)rjr�_rebuild_socket)rirrrr�_reduce_socket�sr�cCs|��Sr
)rB)Zdsrrrr��sr�cCs"t|���}t||j|j|jffSr
)rKrfr��familyr�proto)ri�dfrrrr��scCs|��}tj||||d�S)N)rf)rBrU)r�r�rr�rmrrrr��sc@sdeZdZdZeZeZeZeZeZe	j
dkr8eZeZe
Z
neZeZeZeZeZeZeZeZdd�ZdS)�AbstractReducerz�Abstract base class for use in implementing a Reduction class
    suitable for use in replacing the standard reduction mechanism
    used in multiprocessing.r
cGsNttt�j�t�tttj�t�tttj	�t�tt
jt�tt
j
t�dSr
)rrrtrursr`�appendrw�int�__add__r}r~r|rUr�rrrrrs
zAbstractReducer.__init__N)r%r&r'r(rrr	rr�sys�platformr1r0r/rLrMrKrsrwrxr�r�rrrrrr��s&
r�)�	metaclass)N)NF).�abcrr)r}rrCr+rUr�rlr�__all__r��hasattrrkZPicklerrrr	r3r0r1rr�objectr/rRrWrLrMrKrsrtrrurwr`r�r�r�r|rxr~r�r�r�rrrr�<module>
sj

�
�	
�#
multiprocessing/__pycache__/resource_tracker.cpython-38.opt-2.pyc000064400000011204151153537440021143 0ustar00U

e5d�!�@s�ddlZddlZddlZddlZddlZddlmZddlmZdddgZe	ed�Z
ejejfZ
d	d
d�iZejdkr�ddlZddlZe�ejejd
��Gdd�de�Ze�ZejZejZejZejZdd�ZdS)�N�)�spawn)�util�ensure_running�register�
unregister�pthread_sigmaskZnoopcCsdS�N�r
r
r
�8/usr/lib64/python3.8/multiprocessing/resource_tracker.py�<lambda>!�r�posix)Z	semaphoreZ
shared_memoryc@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�ResourceTrackercCst��|_d|_d|_dSr	)�	threadingZLock�_lock�_fd�_pid��selfr
r
r�__init__0s
zResourceTracker.__init__c	CsT|j�D|jdkr W5QR�dSt�|j�d|_t�|jd�d|_W5QRXdS)Nr)rr�os�close�waitpidrrr
r
r�_stop5s
zResourceTracker._stopcCs|��|jSr	)rrrr
r
r�getfdBszResourceTracker.getfdcCst|j��b|jdk	r~|��r*W5QR�dSt�|j�z|jdk	rPt�|jd�Wntk
rfYnXd|_d|_t�	d�g}z|�
tj�
��Wntk
r�YnXd}t��\}}z�zr|�
|�t��}|gt��}|d||g7}z&t�rt�tjt�t�|||�}W5t�r,t�tjt�XWnt�|��YnX||_||_W5t�|�XW5QRXdS)NrzUresource_tracker: process died unexpectedly, relaunching.  Some resources might leak.z:from multiprocessing.resource_tracker import main;main(%d)z-c)rr�_check_aliverrrr�ChildProcessError�warnings�warn�append�sys�stderr�fileno�	Exception�piperZget_executablerZ_args_from_interpreter_flags�
_HAVE_SIGMASK�signalr�SIG_UNBLOCK�_IGNORED_SIGNALS�	SIG_BLOCKZspawnv_passfds)rZfds_to_pass�cmd�r�wZexe�args�pidr
r
rrFsJ






zResourceTracker.ensure_runningcCs2zt�|jd�Wntk
r(YdSXdSdS)Ns
PROBE:0:noop
FT)r�writer�OSErrorrr
r
rr�s
zResourceTracker._check_alivecCs|�d||�dS)N�REGISTER��_send�r�name�rtyper
r
rr�szResourceTracker.registercCs|�d||�dS)N�
UNREGISTERr3r5r
r
rr�szResourceTracker.unregistercCsB|��d�|||��d�}t|�dkr0td��t�|j|�}dS)Nz{0}:{1}:{2}
�asciiiz
name too long)r�format�encode�len�
ValueErrorrr0r)rr+r6r7�msg�nbytesr
r
rr4�szResourceTracker._sendN)�__name__�
__module__�__qualname__rrrrrrrr4r
r
r
rr.s
@rc
Cst�tjtj�t�tjtj�tr2t�tjt�tj	tj
fD]&}z|��Wq>tk
rbYq>Xq>dd�t
��D�}z�t|d���}|D]�}z�|���d��d�\}}}t
�|d�}	|	dkr�td|�d	|����|d
kr�||�|�n2|dk�r||�|�n|dk�rntd
|��Wq�tk
�rTztjt���WnYnXYq�Xq�W5QRXW5|��D]�\}}|�r�zt�dt|�|f�Wntk
�r�YnX|D]V}zLzt
||�Wn6tk
�r�}zt�d||f�W5d}~XYnXW5X�q��qnXdS)NcSsi|]}|t��qSr
)�set)�.0r7r
r
r�
<dictcomp>�szmain.<locals>.<dictcomp>zQresource_tracker: There appear to be %d leaked %s objects to clean up at shutdownzresource_tracker: %r: %s�rbr9�:zCannot register z. for automatic cleanup: unknown resource type r2r8ZPROBEzunrecognized command %r)r'�SIGINT�SIG_IGN�SIGTERMr&rr(r)r!�stdin�stdoutrr$�_CLEANUP_FUNCS�keys�itemsrrr<�open�strip�decode�split�getr=�add�remove�RuntimeError�
excepthook�exc_info)
�fd�f�cacher7Zrtype_cacher6�e�liner+Zcleanup_funcr
r
r�main�s^�


�
(r_)rr'r!rr�rr�__all__�hasattrr&rHrJr)rMr6Z_multiprocessingZ_posixshmem�updateZ
sem_unlinkZ
shm_unlink�objectrZ_resource_trackerrrrrr_r
r
r
r�<module>s4

�
�wmultiprocessing/__pycache__/shared_memory.cpython-38.pyc000064400000034070151153537440017505 0ustar00U

e5dD�@s�dZddgZddlmZddlZddlZddlZddlZddlZej	dkrXddl
Z
dZnddlZdZej
ejBZd	Zer~d
ZndZdd
�ZGdd�d�ZdZGdd�d�ZdS)z�Provides shared memory for direct access across processes.

The API of this package is currently provisional. Refer to the
documentation for details.
�SharedMemory�
ShareableList�)�partialN�ntFT�z/psm_Zwnsm_cCsBttt�d}|dks td��tt�|�}t|�tks>t�|S)z6Create a random filename for the shared memory object.�z_SHM_NAME_PREFIX too long)�_SHM_SAFE_NAME_LENGTH�len�_SHM_NAME_PREFIX�AssertionError�secretsZ	token_hex)�nbytes�name�r�5/usr/lib64/python3.8/multiprocessing/shared_memory.py�_make_filename&s
rc@s�eZdZdZdZdZdZdZej	Z
dZer.dndZ
ddd	�Zd
d�Zdd
�Zdd�Zedd��Zedd��Zedd��Zdd�Zdd�ZdS)ra�Creates a new shared memory block or attaches to an existing
    shared memory block.

    Every shared memory block is assigned a unique name.  This enables
    one process to create a shared memory block with a particular name
    so that a different process can attach to that same shared memory
    block using that same name.

    As a resource for sharing data across processes, shared memory blocks
    may outlive the original process that created them.  When one process
    no longer needs access to a shared memory block that might still be
    needed by other processes, the close() method should be called.
    When a shared memory block is no longer needed by any process, the
    unlink() method should be called to ensure proper cleanup.N���i�TFrc
	Csl|dkstd��|r0ttjB|_|dkr0td��|dkrL|jtj@sLtd��t�rH|dkr�t�}ztj	||j|j
d�|_Wntk
r�YqZYnX||_
q�qZn.|jr�d|n|}tj	||j|j
d�|_||_
z<|r�|r�t�|j|�t�|j�}|j}t�|j|�|_Wn tk
�r*|���YnXddlm}||j
d	��n|�r�|dk�r^t�n|}t�tjtjtj|d
?d@|d@|�}zXt��}|tjk�r�|dk	�r�tt j!t�"t j!�|tj��nW��qNtjd||d
�|_W5t�|�X||_
�qV�qNnX||_
t�#tj$d|�}zt�%|tj$ddd�}	W5t�|�Xt�&|	�}tjd||d
�|_||_'t(|j�|_)dS)Nrz!'size' must be a positive integerz4'size' must be a positive number different from zeroz&'name' can only be None if create=True)�mode�/�)�register�
shared_memory� l��r)ZtagnameF)*�
ValueError�_O_CREX�os�O_RDWR�_flags�O_EXCL�
_USE_POSIXr�_posixshmemZshm_open�_mode�_fd�FileExistsError�_name�_prepend_leading_slash�	ftruncate�fstat�st_size�mmap�_mmap�OSError�unlink�resource_trackerr�_winapiZCreateFileMappingZINVALID_HANDLE_VALUEZNULLZPAGE_READWRITEZCloseHandleZGetLastErrorZERROR_ALREADY_EXISTS�errnoZEEXIST�strerrorZOpenFileMappingZ
FILE_MAP_READZ
MapViewOfFileZVirtualQuerySize�_size�
memoryview�_buf)
�selfr�create�sizeZstatsrZ	temp_nameZh_mapZlast_error_codeZp_bufrrr�__init__Is��
�
�

�
��
zSharedMemory.__init__cCs&z|��Wntk
r YnXdS�N)�closer+�r4rrr�__del__�szSharedMemory.__del__cCs|j|jd|jffS)NF)�	__class__rr6r:rrr�
__reduce__�s��zSharedMemory.__reduce__cCs|jj�d|j�d|j�d�S)N�(z, size=�))r<�__name__rr6r:rrr�__repr__�szSharedMemory.__repr__cCs|jS)z4A memoryview of contents of the shared memory block.)r3r:rrr�buf�szSharedMemory.bufcCs.|j}tr*|jr*|j�d�r*|jdd�}|S)z4Unique name that identifies the shared memory block.rrN)r$rr%�
startswith)r4Z
reported_namerrrr�s

zSharedMemory.namecCs|jS)zSize in bytes.)r1r:rrrr6�szSharedMemory.sizecCsX|jdk	r|j��d|_|jdk	r4|j��d|_trT|jdkrTt�|j�d|_dS)zkCloses access to the shared memory from this instance but does
        not destroy the shared memory block.Nrr)r3�releaser*r9rr"rr:rrrr9�s



zSharedMemory.closecCs2tr.|jr.ddlm}t�|j�||jd�dS)z�Requests that the underlying shared memory block be destroyed.

        In order to ensure proper cleanup of resources, unlink should be
        called once (and only once) across all processes which have access
        to the shared memory block.r)�
unregisterrN)rr$r-rEr Z
shm_unlink)r4rErrrr,�s
zSharedMemory.unlink)NFr)r@�
__module__�__qualname__�__doc__r$r"r*r3rrrr!rr%r7r;r=rA�propertyrBrr6r9r,rrrrr0s(
l




�utf8c@seZdZdZedededededdj	diZ
dZd	d
�dd
�dd
�d
d
�d�Ze
dd��Zd6dd�dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zed$d%��Zed&d'��Zed(d)��Zed*d+��Zed,d-��Zed.d/��Zed0d1��Zd2d3�Z d4d5�Z!dS)7ra�Pattern for a mutable list-like object shareable via a shared
    memory block.  It differs from the built-in list type in that these
    lists can not change their overall length (i.e. no append, insert,
    etc.)

    Because values are packed into a memoryview as bytes, the struct
    packing format for any storable value must require no more than 8
    characters to describe its format.�q�dzxxxxxxx?z%dsNzxxxxxx?x�cCs|Sr8r��valuerrr�<lambda>
�zShareableList.<lambda>cCs|�d��t�S�N�)�rstrip�decode�	_encodingrNrrrrPrQcCs
|�d�SrR)rTrNrrrrPrQcCsdSr8r)Z_valuerrrrP
rQ)rrr�cCs:t|ttdjf�sdSt|t�r$dSt|t�r2dSdSdS)z�Used in concert with _back_transforms_mapping to convert values
        into the appropriate Python objects when retrieving them from
        the list as well as when storing them.NrrrrW)�
isinstance�str�bytesr<rNrrr�_extract_recreation_codes

z&ShareableList._extract_recreation_code�rcs�|dk	r��fdd�|D�}t|��_tdd�|D���jks@t�t�fdd�|D���_�fdd�|D�}t�d�jd�	|��j
�j�}nd	}|dk	r�|dkr�t|��_
nt|d
|d��_
|dk	�rjt�tjd�j�j
jd�jf�j��tjd�	|��j
j�jf�fd
d�|D���tj�j
�j
j�jf�fdd�|D���tj�j�j
j�jf|��n t���_t��j�j
jd	��_dS)NcsPg|]H}t|ttf�s$�jt|�n&�jt|��jt|��jdf�qS)r)rXrYrZ�_types_mapping�type�
_alignmentr	��.0�itemr:rr�
<listcomp> s���z*ShareableList.__init__.<locals>.<listcomp>css|]}t|�dkVqdS)rMN)r	�ra�fmtrrr�	<genexpr>)sz)ShareableList.__init__.<locals>.<genexpr>c3s0|](}|ddkr�jnt|dd��VqdS)r�sN)r_�intrdr:rrrf*s�csg|]}��|��qSr)r[r`r:rrrc.srK�rMT)r5r6rc3s&|]}t|t�r|���n|VqdSr8)rXrY�encode�ra�v��_encrrrfMsc3s|]}|���VqdSr8)rjrkrmrrrfSs)r	�	_list_len�sumr�tuple�_allocated_bytes�structZcalcsize�_format_size_metainfo�join�_format_packing_metainfo�_format_back_transform_codesr�shmrV�	pack_intorB�_offset_data_start�_offset_packing_formats�_offset_back_transform_codes�unpack_from)r4ZsequencerZ_formatsZ_recreation_codesZrequested_sizer)rnr4rr7s|
�
�

�����
��������
�zShareableList.__init__cCsj|dkr|n||j}||jks*|jdkr2td��t�d|jj|j|d�d}|�d�}|�t	�}|S)z>Gets the packing format for a single value stored in the list.r� Requested position out of range.�8srMrS)
ro�
IndexErrorrsr}rxrBr{rTrUrV)r4�positionrlre�
fmt_as_strrrr�_get_packing_formatds��

z!ShareableList._get_packing_formatcCs\|dkr|n||j}||jks*|jdkr2td��t�d|jj|j|�d}|j|}|S)z9Gets the back transformation function for a single value.rr~�b)ror�rsr}rxrBr|�_back_transforms_mapping)r4r��transform_codeZtransform_functionrrr�_get_back_transformts��
z!ShareableList._get_back_transformcCs~|dkr|n||j}||jks*|jdkr2td��t�d|jj|j|d|�t��|�	|�}t�d|jj|j
||�dS)zvSets the packing format and back transformation code for a
        single value in the list at the specified position.rr~rrMr�N)ror�rsryrxrBr{rjrVr[r|)r4r�r�rOr�rrr�!_set_packing_format_and_transform�s �
�z/ShareableList._set_packing_format_and_transformcCsjz6|jt|jd|��}t�|�|�|jj|�\}Wntk
rRtd��YnX|�	|�}||�}|S)Nzindex out of range)
rzrprrrsr}r�rxrBr�r�)r4r��offsetrlZback_transformrrr�__getitem__�s��

zShareableList.__getitem__cCs�z&|jt|jd|��}|�|�}Wntk
rBtd��YnXt|ttf�sf|jt	|�}|}nZt|t�rz|�
t�n|}t|�|j|kr�t
d��|ddkr�|}n|jt|j|f}|�|||�t�||jj||�dS)Nzassignment index out of rangez(bytes/str item exceeds available storagerrg)rzrprrr�r�rXrYrZr]r^rjrVr	rr�rsryrxrB)r4r�rOr�Zcurrent_formatZ
new_formatZ
encoded_valuerrr�__setitem__�s6�����zShareableList.__setitem__cCst|j|jjd�dfS)Nr\r)rr<rxrr:rrrr=�szShareableList.__reduce__cCst�d|jjd�dS)NrKr)rsr}rxrBr:rrr�__len__�szShareableList.__len__cCs"|jj�dt|��d|jj�d�S)Nr>z, name=r?)r<r@�listrxrr:rrrrA�szShareableList.__repr__csd��fdd�t�j�D��S)z>The struct packing format used by all currently stored values.ric3s|]}��|�VqdSr8)r�)ra�ir:rrrf�sz'ShareableList.format.<locals>.<genexpr>)ru�rangeror:rr:r�format�s�zShareableList.formatcCs|j�d�S)z=The struct packing format used for metainfo on storage sizes.rK�ror:rrrrt�sz#ShareableList._format_size_metainfocCs
d|jS)z?The struct packing format used for the values' packing formats.rr�r:rrrrv�sz&ShareableList._format_packing_metainfocCs
d|jS)z?The struct packing format used for the values' back transforms.r�r�r:rrrrw�sz*ShareableList._format_back_transform_codescCs|jddS)NrrMr�r:rrrrz�sz ShareableList._offset_data_startcCs|jt|j�Sr8)rzrprrr:rrrr{�sz%ShareableList._offset_packing_formatscCs|j|jdS)NrM)r{ror:rrrr|�sz*ShareableList._offset_back_transform_codescst�fdd�|D��S)zCL.count(value) -> integer -- return number of occurrences of value.c3s|]}�|kVqdSr8r)ra�entryrNrrrf�sz&ShareableList.count.<locals>.<genexpr>)rp)r4rOrrNr�count�szShareableList.countcCs4t|�D]\}}||kr|Sqt|�d���dS)zpL.index(value) -> integer -- return first index of value.
        Raises ValueError if the value is not present.z not in this containerN)�	enumerater)r4rOr�r�rrr�index�s
zShareableList.index)N)"r@rFrGrHrh�float�boolrYrZr<r]r_r��staticmethodr[r7r�r�r�r�r�r=r�rArIr�rtrvrwrzr{r|r�r�rrrrr�s^
��

F






)rH�__all__�	functoolsrr)rr/rsrrr.rr �O_CREATrrrr
rrrVrrrrr�<module>s,

Emultiprocessing/__pycache__/__init__.cpython-38.pyc000064400000001230151153537440016376 0ustar00U

e5d��@sdddlZddlmZdd�eej�D�Ze��dd�eD��dZd	Z	d
ej
kr`ej
d
ej
d<dS)�N�)�contextcCsg|]}|�d�s|�qS)�_)�
startswith)�.0�x�r�0/usr/lib64/python3.8/multiprocessing/__init__.py�
<listcomp>s
r
ccs|]}|ttj|�fVqdS)N)�getattrr�_default_context)r�namerrr	�	<genexpr>sr���__main__Z__mp_main__)�sys�r�dirr�__all__�globals�updateZSUBDEBUGZ
SUBWARNING�modulesrrrr	�<module>s
multiprocessing/__pycache__/resource_sharer.cpython-38.opt-1.pyc000064400000012117151153537440020777 0ustar00U

e5d��@s�ddlZddlZddlZddlZddlZddlmZddlmZddlm	Z	dgZ
ejdkrxe
dg7Z
Gd	d�de�Z
ne
d
g7Z
Gdd
�d
e�ZGdd
�d
e�Ze�ZejZdS)�N�)�process)�	reduction)�util�stopZwin32�	DupSocketc@s eZdZdZdd�Zdd�ZdS)rzPicklable wrapper for a socket.cs(|����fdd�}t�|�j�|_dS)Ncs��|�}|�|�dS�N)�shareZ
send_bytes)�conn�pidr	�Znew_sock��7/usr/lib64/python3.8/multiprocessing/resource_sharer.py�sends
z DupSocket.__init__.<locals>.send)�dup�_resource_sharer�register�close�_id)�selfZsockrr
rr�__init__szDupSocket.__init__c
Cs6t�|j�� }|��}t�|�W5QR�SQRXdS)z1Get the socket.  This should only be called once.N)r�get_connectionrZ
recv_bytes�socketZ	fromshare)rr
r	r
r
r�detach$szDupSocket.detachN��__name__�
__module__�__qualname__�__doc__rrr
r
r
rrs�DupFdc@s eZdZdZdd�Zdd�ZdS)rz-Wrapper for fd which can be used at any time.cs4t�|���fdd�}�fdd�}t�||�|_dS)Ncst�|�|�dSr)rZsend_handle)r
r�Znew_fdr
rr1szDupFd.__init__.<locals>.sendcst���dSr)�osrr
r r
rr3szDupFd.__init__.<locals>.close)r!rrrr)r�fdrrr
r rr/s
zDupFd.__init__c
Cs.t�|j��}t�|�W5QR�SQRXdS)z-Get the fd.  This should only be called once.N)rrrrZrecv_handle)rr
r
r
rr7szDupFd.detachNrr
r
r
rr-sc@sNeZdZdZdd�Zdd�Zedd��Zdd	d
�Zdd�Z	d
d�Z
dd�ZdS)�_ResourceSharerz.Manager for resources using background thread.cCs@d|_i|_g|_t��|_d|_d|_d|_t	�
|tj�dS)Nr)
�_key�_cache�
_old_locks�	threading�Lock�_lock�	_listener�_address�_threadrZregister_after_forkr#�
_afterfork)rr
r
rr?s
z_ResourceSharer.__init__c
CsZ|j�J|jdkr|��|jd7_||f|j|j<|j|jfW5QR�SQRXdS)z+Register resource, returning an identifier.Nr)r)r+�_startr$r%)rrrr
r
rrIs
z_ResourceSharer.registercCs<ddlm}|\}}||t��jd�}|�|t��f�|S)z<Return connection from which to receive identified resource.r��Client��authkey)�
connectionr0r�current_processr2rr!�getpid)Zidentr0�address�key�cr
r
rrRs
z_ResourceSharer.get_connectionNc	Cs�ddlm}|j��|jdk	r�||jt��jd�}|�d�|��|j	�
|�|j	��rdt�
d�|j��d|_	d|_d|_|j��D]\}\}}|�q�|j��W5QRXdS)z:Stop the background thread and clear registered resources.rr/Nr1z._ResourceSharer thread did not stop when asked)r3r0r)r+rr4r2rrr,�joinZis_aliverZsub_warningr*r%�items�clear)rZtimeoutr0r8r7rrr
r
rr[s$
�



z_ResourceSharer.stopcCsj|j��D]\}\}}|�q
|j��|j�|j�t��|_|jdk	rT|j�	�d|_d|_
d|_dSr)r%r:r;r&�appendr)r'r(r*rr+r,)rr7rrr
r
rr-ps



z_ResourceSharer._afterforkcCsXddlm}t�d�|t��jd�|_|jj|_	t
j|jd�}d|_
|��||_dS)Nr)�Listenerz0starting listener and thread for sending handlesr1)�targetT)r3r=r�debugrr4r2r*r6r+r'ZThread�_serveZdaemon�startr,)rr=�tr
r
rr.~s

z_ResourceSharer._startc	Cs�ttd�rt�tjt���zh|j���T}|��}|dkrHW5QR�Wq�|\}}|j�	|�\}}z|||�W5|�XW5QRXWqt
��s�tj
t���YqXqdS)N�pthread_sigmask)�hasattr�signalrC�	SIG_BLOCK�
valid_signalsr*ZacceptZrecvr%�poprZ
is_exiting�sys�
excepthook�exc_info)rr
�msgr7Zdestination_pidrrr
r
rr@�s
z_ResourceSharer._serve)N)rrrrrr�staticmethodrrr-r.r@r
r
r
rr#=s
	

r#)r!rErrIr'�r�contextrr�__all__�platform�objectrrr#rrr
r
r
r�<module>s 


`multiprocessing/__pycache__/popen_fork.cpython-38.opt-1.pyc000064400000005013151153537440017743 0ustar00U

e5d
�@s6ddlZddlZddlmZdgZGdd�de�ZdS)�N�)�util�Popenc@s`eZdZdZdd�Zdd�Zejfdd�Zdd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�ZdS)r�forkcCs"t��d|_d|_|�|�dS�N)rZ_flush_std_streams�
returncode�	finalizer�_launch)�self�process_obj�r�2/usr/lib64/python3.8/multiprocessing/popen_fork.py�__init__szPopen.__init__cCs|Srr)r
�fdrrr
�duplicate_for_childszPopen.duplicate_for_childc
Cs�|jdkrzzt�|j|�\}}Wn(tk
rH}z
WY�dSd}~XYnX||jkrzt�|�rnt�|�|_nt�|�|_|jSr)r�os�waitpid�pid�OSError�WIFSIGNALED�WTERMSIG�WEXITSTATUS)r
�flagr�sts�errr
�polls


z
Popen.pollNcCsN|jdkrH|dk	r0ddlm}||jg|�s0dS|�|dkrBtjnd�S|jS)Nr)�waitg)rZmultiprocessing.connectionr�sentinelrr�WNOHANG)r
�timeoutrrrr
r(s
z
Popen.waitcCsZ|jdkrVzt�|j|�Wn8tk
r0Yn&tk
rT|jdd�dkrP�YnXdS)Ng�������?)r)rr�killr�ProcessLookupErrorrr)r
Zsigrrr
�_send_signal2s
zPopen._send_signalcCs|�tj�dSr)r"�signal�SIGTERM�r
rrr
�	terminate<szPopen.terminatecCs|�tj�dSr)r"r#�SIGKILLr%rrr
r ?sz
Popen.killc	Cs�d}t��\}}t��\}}t��|_|jdkrdz$t�|�t�|�|j|d�}W5t�|�Xn0t�|�t�|�t�|tj	||f�|_
||_dS)Nrr)Zparent_sentinel)r�piperr�_exit�close�
_bootstraprZFinalizeZ	close_fdsrr)r
r�codeZparent_rZchild_wZchild_rZparent_wrrr
r	Bs 






�z
Popen._launchcCs|jdk	r|��dSr)rr%rrr
r*Us
zPopen.close)N)�__name__�
__module__�__qualname__�methodrrrrrrr"r&r r	r*rrrr
rs


)rr#�r�__all__�objectrrrrr
�<module>smultiprocessing/__pycache__/popen_spawn_posix.cpython-38.pyc000064400000004242151153537440020420 0ustar00U

e5d��@spddlZddlZddlmZmZddlmZddlmZddlmZdgZ	Gdd	�d	e
�ZGd
d�dej�ZdS)�N�)�	reduction�set_spawning_popen)�
popen_fork)�spawn)�util�Popenc@seZdZdd�Zdd�ZdS)�_DupFdcCs
||_dS�N��fd��selfr�r�9/usr/lib64/python3.8/multiprocessing/popen_spawn_posix.py�__init__sz_DupFd.__init__cCs|jSr
r)rrrr�detachsz
_DupFd.detachN)�__name__�
__module__�__qualname__rrrrrrr	sr	cs4eZdZdZeZ�fdd�Zdd�Zdd�Z�Z	S)rrcsg|_t��|�dSr
)�_fds�superr)r�process_obj��	__class__rrrszPopen.__init__cCs|j�|�|Sr
)r�appendr
rrr�duplicate_for_child"szPopen.duplicate_for_childcCsXddlm}|��}|j�|�t�|j�}t�	�}t
|�zt�||�t�||�W5t
d�Xd}}}}	z~t��\}}t��\}}	tj||d�}|j�||g�t
�t��||j�|_||_t|	ddd��}
|
�|���W5QRXW5g}
||	fD]}|dk	�r|
�|��qt
�|t
j|
�|_||fD]}|dk	�r6t�|��q6XdS)Nr)�resource_tracker)�
tracker_fdZpipe_handle�wbF)�closefd)�rZgetfdrrrZget_preparation_data�_name�io�BytesIOrr�dumprZFinalizeZ	close_fds�	finalizer�os�close�pipeZget_command_line�extendZspawnv_passfdsZget_executable�pid�sentinel�open�write�	getbuffer)rrrrZ	prep_data�fpZparent_rZchild_wZchild_rZparent_wZfds_to_closer�cmd�frrr�_launch&sB
�
�

z
Popen._launch)
rrr�methodr	ZDupFdrrr3�
__classcell__rrrrrs
)
r#r'�contextrrr!rrr�__all__�objectr	rrrrr�<module>s
multiprocessing/__pycache__/popen_spawn_win32.cpython-38.opt-2.pyc000064400000006421151153537440021161 0ustar00U

e5d��@s�ddlZddlZddlZddlZddlZddlmZmZmZddl	m
Z
ddl	mZdgZdZ
ejdkoreed	d
�Zej���d�Zdd
�Zeejej�Zdd�ZGdd�de�ZdS)�N�)�	reduction�get_spawning_popen�set_spawning_popen)�spawn)�util�PopeniZwin32�frozenFzpythonservice.execCs ||kptj�|�tj�|�kS�N)�os�path�normcase)Zp1Zp2�r�9/usr/lib64/python3.8/multiprocessing/popen_spawn_win32.py�_path_eqsrcGs|D]}t�|�qdSr
)�_winapi�CloseHandle)Zhandles�handlerrr�_close_handlessrc@sFeZdZdZdd�Zdd�Zddd�Zd	d
�Zdd�ZeZ	d
d�Z
dS)rrcCsTt�|j�}t�dd�\}}t�|d�}tjt�	�|d�}d�
dd�|D��}t��}tr�t
|tj�r�tj}tj��}tj|d<nd}t|ddd	���}	z0t�||ddd
d|dd�	\}
}}}
t�|�Wnt�|��YnX||_d|_|
|_t|
�|_t�|t|jt|�f�|_t|�zt �!||	�t �!||	�W5td�XW5QRXdS)Nr)Z
parent_pidZpipe_handle� css|]}d|VqdS)z"%s"Nr)�.0�xrrr�	<genexpr>9sz!Popen.__init__.<locals>.<genexpr>�__PYVENV_LAUNCHER__�wbT)�closefdF)"rZget_preparation_data�_namerZ
CreatePipe�msvcrtZopen_osfhandleZget_command_liner�getpid�joinZget_executable�WINENVr�sys�
executable�_base_executable�environ�copy�openZ
CreateProcessr�pid�
returncode�_handle�int�sentinelrZFinalizer�	finalizerrr�dump)�selfZprocess_objZ	prep_dataZrhandleZwhandleZwfd�cmdZ
python_exe�envZto_childZhpZhtr'�tidrrr�__init__,sT
�
�

�zPopen.__init__cCst�||j�Sr
)rZ	duplicater+)r.rrrr�duplicate_for_childaszPopen.duplicate_for_childNcCst|jdkrn|dkrtj}ntdt|dd��}t�t|j�|�}|tjkrnt�|j�}|t	krht
j}||_|jS)Nri�g�?)r(rZINFINITE�maxr*ZWaitForSingleObjectr)Z
WAIT_OBJECT_0ZGetExitCodeProcess�	TERMINATE�signal�SIGTERM)r.�timeoutZmsecs�res�coderrr�waites

z
Popen.waitcCs|jdd�S)Nr�r8)r;�r.rrr�pollusz
Popen.pollcCsL|jdkrHzt�t|j�t�Wn&tk
rF|jdd�dkrB�YnXdS)Ng�?r<)r(rZTerminateProcessr*r)r5�OSErrorr;r=rrr�	terminatexs
zPopen.terminatecCs|��dSr
)r,r=rrr�close�szPopen.close)N)�__name__�
__module__�__qualname__�methodr2r3r;r>r@�killrArrrrr&s5
)rrr6r!r�contextrrr�rr�__all__r5�platform�getattrZWINEXEr"�lower�endswithZ
WINSERVICErr#r r�objectrrrrr�<module>s
multiprocessing/forkserver.py000064400000030363151153537440012552 0ustar00import errno
import os
import selectors
import signal
import socket
import struct
import sys
import threading
import warnings

from . import connection
from . import process
from .context import reduction
from . import resource_tracker
from . import spawn
from . import util

__all__ = ['ensure_running', 'get_inherited_fds', 'connect_to_new_process',
           'set_forkserver_preload']

#
#
#

MAXFDS_TO_SEND = 256
SIGNED_STRUCT = struct.Struct('q')     # large enough for pid_t

#
# Forkserver class
#

class ForkServer(object):

    def __init__(self):
        self._forkserver_address = None
        self._forkserver_alive_fd = None
        self._forkserver_pid = None
        self._inherited_fds = None
        self._lock = threading.Lock()
        self._preload_modules = ['__main__']

    def _stop(self):
        # Method used by unit tests to stop the server
        with self._lock:
            self._stop_unlocked()

    def _stop_unlocked(self):
        if self._forkserver_pid is None:
            return

        # close the "alive" file descriptor asks the server to stop
        os.close(self._forkserver_alive_fd)
        self._forkserver_alive_fd = None

        os.waitpid(self._forkserver_pid, 0)
        self._forkserver_pid = None

        if not util.is_abstract_socket_namespace(self._forkserver_address):
            os.unlink(self._forkserver_address)
        self._forkserver_address = None

    def set_forkserver_preload(self, modules_names):
        '''Set list of module names to try to load in forkserver process.'''
        if not all(type(mod) is str for mod in self._preload_modules):
            raise TypeError('module_names must be a list of strings')
        self._preload_modules = modules_names

    def get_inherited_fds(self):
        '''Return list of fds inherited from parent process.

        This returns None if the current process was not started by fork
        server.
        '''
        return self._inherited_fds

    def connect_to_new_process(self, fds):
        '''Request forkserver to create a child process.

        Returns a pair of fds (status_r, data_w).  The calling process can read
        the child process's pid and (eventually) its returncode from status_r.
        The calling process should write to data_w the pickled preparation and
        process data.
        '''
        self.ensure_running()
        if len(fds) + 4 >= MAXFDS_TO_SEND:
            raise ValueError('too many fds')
        with socket.socket(socket.AF_UNIX) as client:
            client.connect(self._forkserver_address)
            parent_r, child_w = os.pipe()
            child_r, parent_w = os.pipe()
            allfds = [child_r, child_w, self._forkserver_alive_fd,
                      resource_tracker.getfd()]
            allfds += fds
            try:
                reduction.sendfds(client, allfds)
                return parent_r, parent_w
            except:
                os.close(parent_r)
                os.close(parent_w)
                raise
            finally:
                os.close(child_r)
                os.close(child_w)

    def ensure_running(self):
        '''Make sure that a fork server is running.

        This can be called from any process.  Note that usually a child
        process will just reuse the forkserver started by its parent, so
        ensure_running() will do nothing.
        '''
        with self._lock:
            resource_tracker.ensure_running()
            if self._forkserver_pid is not None:
                # forkserver was launched before, is it still running?
                pid, status = os.waitpid(self._forkserver_pid, os.WNOHANG)
                if not pid:
                    # still alive
                    return
                # dead, launch it again
                os.close(self._forkserver_alive_fd)
                self._forkserver_address = None
                self._forkserver_alive_fd = None
                self._forkserver_pid = None

            cmd = ('from multiprocessing.forkserver import main; ' +
                   'main(%d, %d, %r, **%r)')

            if self._preload_modules:
                desired_keys = {'main_path', 'sys_path'}
                data = spawn.get_preparation_data('ignore')
                data = {x: y for x, y in data.items() if x in desired_keys}
            else:
                data = {}

            with socket.socket(socket.AF_UNIX) as listener:
                address = connection.arbitrary_address('AF_UNIX')
                listener.bind(address)
                if not util.is_abstract_socket_namespace(address):
                    os.chmod(address, 0o600)
                listener.listen()

                # all client processes own the write end of the "alive" pipe;
                # when they all terminate the read end becomes ready.
                alive_r, alive_w = os.pipe()
                try:
                    fds_to_pass = [listener.fileno(), alive_r]
                    cmd %= (listener.fileno(), alive_r, self._preload_modules,
                            data)
                    exe = spawn.get_executable()
                    args = [exe] + util._args_from_interpreter_flags()
                    args += ['-c', cmd]
                    pid = util.spawnv_passfds(exe, args, fds_to_pass)
                except:
                    os.close(alive_w)
                    raise
                finally:
                    os.close(alive_r)
                self._forkserver_address = address
                self._forkserver_alive_fd = alive_w
                self._forkserver_pid = pid

#
#
#

def main(listener_fd, alive_r, preload, main_path=None, sys_path=None):
    '''Run forkserver.'''
    if preload:
        if '__main__' in preload and main_path is not None:
            process.current_process()._inheriting = True
            try:
                spawn.import_main_path(main_path)
            finally:
                del process.current_process()._inheriting
        for modname in preload:
            try:
                __import__(modname)
            except ImportError:
                pass

    util._close_stdin()

    sig_r, sig_w = os.pipe()
    os.set_blocking(sig_r, False)
    os.set_blocking(sig_w, False)

    def sigchld_handler(*_unused):
        # Dummy signal handler, doesn't do anything
        pass

    handlers = {
        # unblocking SIGCHLD allows the wakeup fd to notify our event loop
        signal.SIGCHLD: sigchld_handler,
        # protect the process from ^C
        signal.SIGINT: signal.SIG_IGN,
        }
    old_handlers = {sig: signal.signal(sig, val)
                    for (sig, val) in handlers.items()}

    # calling os.write() in the Python signal handler is racy
    signal.set_wakeup_fd(sig_w)

    # map child pids to client fds
    pid_to_fd = {}

    with socket.socket(socket.AF_UNIX, fileno=listener_fd) as listener, \
         selectors.DefaultSelector() as selector:
        _forkserver._forkserver_address = listener.getsockname()

        selector.register(listener, selectors.EVENT_READ)
        selector.register(alive_r, selectors.EVENT_READ)
        selector.register(sig_r, selectors.EVENT_READ)

        while True:
            try:
                while True:
                    rfds = [key.fileobj for (key, events) in selector.select()]
                    if rfds:
                        break

                if alive_r in rfds:
                    # EOF because no more client processes left
                    assert os.read(alive_r, 1) == b'', "Not at EOF?"
                    raise SystemExit

                if sig_r in rfds:
                    # Got SIGCHLD
                    os.read(sig_r, 65536)  # exhaust
                    while True:
                        # Scan for child processes
                        try:
                            pid, sts = os.waitpid(-1, os.WNOHANG)
                        except ChildProcessError:
                            break
                        if pid == 0:
                            break
                        child_w = pid_to_fd.pop(pid, None)
                        if child_w is not None:
                            if os.WIFSIGNALED(sts):
                                returncode = -os.WTERMSIG(sts)
                            else:
                                if not os.WIFEXITED(sts):
                                    raise AssertionError(
                                        "Child {0:n} status is {1:n}".format(
                                            pid,sts))
                                returncode = os.WEXITSTATUS(sts)
                            # Send exit code to client process
                            try:
                                write_signed(child_w, returncode)
                            except BrokenPipeError:
                                # client vanished
                                pass
                            os.close(child_w)
                        else:
                            # This shouldn't happen really
                            warnings.warn('forkserver: waitpid returned '
                                          'unexpected pid %d' % pid)

                if listener in rfds:
                    # Incoming fork request
                    with listener.accept()[0] as s:
                        # Receive fds from client
                        fds = reduction.recvfds(s, MAXFDS_TO_SEND + 1)
                        if len(fds) > MAXFDS_TO_SEND:
                            raise RuntimeError(
                                "Too many ({0:n}) fds to send".format(
                                    len(fds)))
                        child_r, child_w, *fds = fds
                        s.close()
                        pid = os.fork()
                        if pid == 0:
                            # Child
                            code = 1
                            try:
                                listener.close()
                                selector.close()
                                unused_fds = [alive_r, child_w, sig_r, sig_w]
                                unused_fds.extend(pid_to_fd.values())
                                code = _serve_one(child_r, fds,
                                                  unused_fds,
                                                  old_handlers)
                            except Exception:
                                sys.excepthook(*sys.exc_info())
                                sys.stderr.flush()
                            finally:
                                os._exit(code)
                        else:
                            # Send pid to client process
                            try:
                                write_signed(child_w, pid)
                            except BrokenPipeError:
                                # client vanished
                                pass
                            pid_to_fd[pid] = child_w
                            os.close(child_r)
                            for fd in fds:
                                os.close(fd)

            except OSError as e:
                if e.errno != errno.ECONNABORTED:
                    raise


def _serve_one(child_r, fds, unused_fds, handlers):
    # close unnecessary stuff and reset signal handlers
    signal.set_wakeup_fd(-1)
    for sig, val in handlers.items():
        signal.signal(sig, val)
    for fd in unused_fds:
        os.close(fd)

    (_forkserver._forkserver_alive_fd,
     resource_tracker._resource_tracker._fd,
     *_forkserver._inherited_fds) = fds

    # Run process object received over pipe
    parent_sentinel = os.dup(child_r)
    code = spawn._main(child_r, parent_sentinel)

    return code


#
# Read and write signed numbers
#

def read_signed(fd):
    data = b''
    length = SIGNED_STRUCT.size
    while len(data) < length:
        s = os.read(fd, length - len(data))
        if not s:
            raise EOFError('unexpected EOF')
        data += s
    return SIGNED_STRUCT.unpack(data)[0]

def write_signed(fd, n):
    msg = SIGNED_STRUCT.pack(n)
    while msg:
        nbytes = os.write(fd, msg)
        if nbytes == 0:
            raise RuntimeError('should not get here')
        msg = msg[nbytes:]

#
#
#

_forkserver = ForkServer()
ensure_running = _forkserver.ensure_running
get_inherited_fds = _forkserver.get_inherited_fds
connect_to_new_process = _forkserver.connect_to_new_process
set_forkserver_preload = _forkserver.set_forkserver_preload
multiprocessing/reduction.py000064400000022450151153537440012354 0ustar00#
# Module which deals with pickling of objects.
#
# multiprocessing/reduction.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#

from abc import ABCMeta
import copyreg
import functools
import io
import os
import pickle
import socket
import sys

from . import context

__all__ = ['send_handle', 'recv_handle', 'ForkingPickler', 'register', 'dump']


HAVE_SEND_HANDLE = (sys.platform == 'win32' or
                    (hasattr(socket, 'CMSG_LEN') and
                     hasattr(socket, 'SCM_RIGHTS') and
                     hasattr(socket.socket, 'sendmsg')))

#
# Pickler subclass
#

class ForkingPickler(pickle.Pickler):
    '''Pickler subclass used by multiprocessing.'''
    _extra_reducers = {}
    _copyreg_dispatch_table = copyreg.dispatch_table

    def __init__(self, *args):
        super().__init__(*args)
        self.dispatch_table = self._copyreg_dispatch_table.copy()
        self.dispatch_table.update(self._extra_reducers)

    @classmethod
    def register(cls, type, reduce):
        '''Register a reduce function for a type.'''
        cls._extra_reducers[type] = reduce

    @classmethod
    def dumps(cls, obj, protocol=None):
        buf = io.BytesIO()
        cls(buf, protocol).dump(obj)
        return buf.getbuffer()

    loads = pickle.loads

register = ForkingPickler.register

def dump(obj, file, protocol=None):
    '''Replacement for pickle.dump() using ForkingPickler.'''
    ForkingPickler(file, protocol).dump(obj)

#
# Platform specific definitions
#

if sys.platform == 'win32':
    # Windows
    __all__ += ['DupHandle', 'duplicate', 'steal_handle']
    import _winapi

    def duplicate(handle, target_process=None, inheritable=False,
                  *, source_process=None):
        '''Duplicate a handle.  (target_process is a handle not a pid!)'''
        current_process = _winapi.GetCurrentProcess()
        if source_process is None:
            source_process = current_process
        if target_process is None:
            target_process = current_process
        return _winapi.DuplicateHandle(
            source_process, handle, target_process,
            0, inheritable, _winapi.DUPLICATE_SAME_ACCESS)

    def steal_handle(source_pid, handle):
        '''Steal a handle from process identified by source_pid.'''
        source_process_handle = _winapi.OpenProcess(
            _winapi.PROCESS_DUP_HANDLE, False, source_pid)
        try:
            return _winapi.DuplicateHandle(
                source_process_handle, handle,
                _winapi.GetCurrentProcess(), 0, False,
                _winapi.DUPLICATE_SAME_ACCESS | _winapi.DUPLICATE_CLOSE_SOURCE)
        finally:
            _winapi.CloseHandle(source_process_handle)

    def send_handle(conn, handle, destination_pid):
        '''Send a handle over a local connection.'''
        dh = DupHandle(handle, _winapi.DUPLICATE_SAME_ACCESS, destination_pid)
        conn.send(dh)

    def recv_handle(conn):
        '''Receive a handle over a local connection.'''
        return conn.recv().detach()

    class DupHandle(object):
        '''Picklable wrapper for a handle.'''
        def __init__(self, handle, access, pid=None):
            if pid is None:
                # We just duplicate the handle in the current process and
                # let the receiving process steal the handle.
                pid = os.getpid()
            proc = _winapi.OpenProcess(_winapi.PROCESS_DUP_HANDLE, False, pid)
            try:
                self._handle = _winapi.DuplicateHandle(
                    _winapi.GetCurrentProcess(),
                    handle, proc, access, False, 0)
            finally:
                _winapi.CloseHandle(proc)
            self._access = access
            self._pid = pid

        def detach(self):
            '''Get the handle.  This should only be called once.'''
            # retrieve handle from process which currently owns it
            if self._pid == os.getpid():
                # The handle has already been duplicated for this process.
                return self._handle
            # We must steal the handle from the process whose pid is self._pid.
            proc = _winapi.OpenProcess(_winapi.PROCESS_DUP_HANDLE, False,
                                       self._pid)
            try:
                return _winapi.DuplicateHandle(
                    proc, self._handle, _winapi.GetCurrentProcess(),
                    self._access, False, _winapi.DUPLICATE_CLOSE_SOURCE)
            finally:
                _winapi.CloseHandle(proc)

else:
    # Unix
    __all__ += ['DupFd', 'sendfds', 'recvfds']
    import array

    # On MacOSX we should acknowledge receipt of fds -- see Issue14669
    ACKNOWLEDGE = sys.platform == 'darwin'

    def sendfds(sock, fds):
        '''Send an array of fds over an AF_UNIX socket.'''
        fds = array.array('i', fds)
        msg = bytes([len(fds) % 256])
        sock.sendmsg([msg], [(socket.SOL_SOCKET, socket.SCM_RIGHTS, fds)])
        if ACKNOWLEDGE and sock.recv(1) != b'A':
            raise RuntimeError('did not receive acknowledgement of fd')

    def recvfds(sock, size):
        '''Receive an array of fds over an AF_UNIX socket.'''
        a = array.array('i')
        bytes_size = a.itemsize * size
        msg, ancdata, flags, addr = sock.recvmsg(1, socket.CMSG_SPACE(bytes_size))
        if not msg and not ancdata:
            raise EOFError
        try:
            if ACKNOWLEDGE:
                sock.send(b'A')
            if len(ancdata) != 1:
                raise RuntimeError('received %d items of ancdata' %
                                   len(ancdata))
            cmsg_level, cmsg_type, cmsg_data = ancdata[0]
            if (cmsg_level == socket.SOL_SOCKET and
                cmsg_type == socket.SCM_RIGHTS):
                if len(cmsg_data) % a.itemsize != 0:
                    raise ValueError
                a.frombytes(cmsg_data)
                if len(a) % 256 != msg[0]:
                    raise AssertionError(
                        "Len is {0:n} but msg[0] is {1!r}".format(
                            len(a), msg[0]))
                return list(a)
        except (ValueError, IndexError):
            pass
        raise RuntimeError('Invalid data received')

    def send_handle(conn, handle, destination_pid):
        '''Send a handle over a local connection.'''
        with socket.fromfd(conn.fileno(), socket.AF_UNIX, socket.SOCK_STREAM) as s:
            sendfds(s, [handle])

    def recv_handle(conn):
        '''Receive a handle over a local connection.'''
        with socket.fromfd(conn.fileno(), socket.AF_UNIX, socket.SOCK_STREAM) as s:
            return recvfds(s, 1)[0]

    def DupFd(fd):
        '''Return a wrapper for an fd.'''
        popen_obj = context.get_spawning_popen()
        if popen_obj is not None:
            return popen_obj.DupFd(popen_obj.duplicate_for_child(fd))
        elif HAVE_SEND_HANDLE:
            from . import resource_sharer
            return resource_sharer.DupFd(fd)
        else:
            raise ValueError('SCM_RIGHTS appears not to be available')

#
# Try making some callable types picklable
#

def _reduce_method(m):
    if m.__self__ is None:
        return getattr, (m.__class__, m.__func__.__name__)
    else:
        return getattr, (m.__self__, m.__func__.__name__)
class _C:
    def f(self):
        pass
register(type(_C().f), _reduce_method)


def _reduce_method_descriptor(m):
    return getattr, (m.__objclass__, m.__name__)
register(type(list.append), _reduce_method_descriptor)
register(type(int.__add__), _reduce_method_descriptor)


def _reduce_partial(p):
    return _rebuild_partial, (p.func, p.args, p.keywords or {})
def _rebuild_partial(func, args, keywords):
    return functools.partial(func, *args, **keywords)
register(functools.partial, _reduce_partial)

#
# Make sockets picklable
#

if sys.platform == 'win32':
    def _reduce_socket(s):
        from .resource_sharer import DupSocket
        return _rebuild_socket, (DupSocket(s),)
    def _rebuild_socket(ds):
        return ds.detach()
    register(socket.socket, _reduce_socket)

else:
    def _reduce_socket(s):
        df = DupFd(s.fileno())
        return _rebuild_socket, (df, s.family, s.type, s.proto)
    def _rebuild_socket(df, family, type, proto):
        fd = df.detach()
        return socket.socket(family, type, proto, fileno=fd)
    register(socket.socket, _reduce_socket)


class AbstractReducer(metaclass=ABCMeta):
    '''Abstract base class for use in implementing a Reduction class
    suitable for use in replacing the standard reduction mechanism
    used in multiprocessing.'''
    ForkingPickler = ForkingPickler
    register = register
    dump = dump
    send_handle = send_handle
    recv_handle = recv_handle

    if sys.platform == 'win32':
        steal_handle = steal_handle
        duplicate = duplicate
        DupHandle = DupHandle
    else:
        sendfds = sendfds
        recvfds = recvfds
        DupFd = DupFd

    _reduce_method = _reduce_method
    _reduce_method_descriptor = _reduce_method_descriptor
    _rebuild_partial = _rebuild_partial
    _reduce_socket = _reduce_socket
    _rebuild_socket = _rebuild_socket

    def __init__(self, *args):
        register(type(_C().f), _reduce_method)
        register(type(list.append), _reduce_method_descriptor)
        register(type(int.__add__), _reduce_method_descriptor)
        register(functools.partial, _reduce_partial)
        register(socket.socket, _reduce_socket)
multiprocessing/resource_tracker.py000064400000020645151153537440013726 0ustar00###############################################################################
# Server process to keep track of unlinked resources (like shared memory
# segments, semaphores etc.) and clean them.
#
# On Unix we run a server process which keeps track of unlinked
# resources. The server ignores SIGINT and SIGTERM and reads from a
# pipe.  Every other process of the program has a copy of the writable
# end of the pipe, so we get EOF when all other processes have exited.
# Then the server process unlinks any remaining resource names.
#
# This is important because there may be system limits for such resources: for
# instance, the system only supports a limited number of named semaphores, and
# shared-memory segments live in the RAM. If a python process leaks such a
# resource, this resource will not be removed till the next reboot.  Without
# this resource tracker process, "killall python" would probably leave unlinked
# resources.

import os
import signal
import sys
import threading
import warnings

from . import spawn
from . import util

__all__ = ['ensure_running', 'register', 'unregister']

_HAVE_SIGMASK = hasattr(signal, 'pthread_sigmask')
_IGNORED_SIGNALS = (signal.SIGINT, signal.SIGTERM)

_CLEANUP_FUNCS = {
    'noop': lambda: None,
}

if os.name == 'posix':
    import _multiprocessing
    import _posixshmem

    _CLEANUP_FUNCS.update({
        'semaphore': _multiprocessing.sem_unlink,
        'shared_memory': _posixshmem.shm_unlink,
    })


class ResourceTracker(object):

    def __init__(self):
        self._lock = threading.Lock()
        self._fd = None
        self._pid = None

    def _stop(self):
        with self._lock:
            if self._fd is None:
                # not running
                return

            # closing the "alive" file descriptor stops main()
            os.close(self._fd)
            self._fd = None

            os.waitpid(self._pid, 0)
            self._pid = None

    def getfd(self):
        self.ensure_running()
        return self._fd

    def ensure_running(self):
        '''Make sure that resource tracker process is running.

        This can be run from any process.  Usually a child process will use
        the resource created by its parent.'''
        with self._lock:
            if self._fd is not None:
                # resource tracker was launched before, is it still running?
                if self._check_alive():
                    # => still alive
                    return
                # => dead, launch it again
                os.close(self._fd)

                # Clean-up to avoid dangling processes.
                try:
                    # _pid can be None if this process is a child from another
                    # python process, which has started the resource_tracker.
                    if self._pid is not None:
                        os.waitpid(self._pid, 0)
                except ChildProcessError:
                    # The resource_tracker has already been terminated.
                    pass
                self._fd = None
                self._pid = None

                warnings.warn('resource_tracker: process died unexpectedly, '
                              'relaunching.  Some resources might leak.')

            fds_to_pass = []
            try:
                fds_to_pass.append(sys.stderr.fileno())
            except Exception:
                pass
            cmd = 'from multiprocessing.resource_tracker import main;main(%d)'
            r, w = os.pipe()
            try:
                fds_to_pass.append(r)
                # process will out live us, so no need to wait on pid
                exe = spawn.get_executable()
                args = [exe] + util._args_from_interpreter_flags()
                args += ['-c', cmd % r]
                # bpo-33613: Register a signal mask that will block the signals.
                # This signal mask will be inherited by the child that is going
                # to be spawned and will protect the child from a race condition
                # that can make the child die before it registers signal handlers
                # for SIGINT and SIGTERM. The mask is unregistered after spawning
                # the child.
                try:
                    if _HAVE_SIGMASK:
                        signal.pthread_sigmask(signal.SIG_BLOCK, _IGNORED_SIGNALS)
                    pid = util.spawnv_passfds(exe, args, fds_to_pass)
                finally:
                    if _HAVE_SIGMASK:
                        signal.pthread_sigmask(signal.SIG_UNBLOCK, _IGNORED_SIGNALS)
            except:
                os.close(w)
                raise
            else:
                self._fd = w
                self._pid = pid
            finally:
                os.close(r)

    def _check_alive(self):
        '''Check that the pipe has not been closed by sending a probe.'''
        try:
            # We cannot use send here as it calls ensure_running, creating
            # a cycle.
            os.write(self._fd, b'PROBE:0:noop\n')
        except OSError:
            return False
        else:
            return True

    def register(self, name, rtype):
        '''Register name of resource with resource tracker.'''
        self._send('REGISTER', name, rtype)

    def unregister(self, name, rtype):
        '''Unregister name of resource with resource tracker.'''
        self._send('UNREGISTER', name, rtype)

    def _send(self, cmd, name, rtype):
        self.ensure_running()
        msg = '{0}:{1}:{2}\n'.format(cmd, name, rtype).encode('ascii')
        if len(name) > 512:
            # posix guarantees that writes to a pipe of less than PIPE_BUF
            # bytes are atomic, and that PIPE_BUF >= 512
            raise ValueError('name too long')
        nbytes = os.write(self._fd, msg)
        assert nbytes == len(msg), "nbytes {0:n} but len(msg) {1:n}".format(
            nbytes, len(msg))


_resource_tracker = ResourceTracker()
ensure_running = _resource_tracker.ensure_running
register = _resource_tracker.register
unregister = _resource_tracker.unregister
getfd = _resource_tracker.getfd

def main(fd):
    '''Run resource tracker.'''
    # protect the process from ^C and "killall python" etc
    signal.signal(signal.SIGINT, signal.SIG_IGN)
    signal.signal(signal.SIGTERM, signal.SIG_IGN)
    if _HAVE_SIGMASK:
        signal.pthread_sigmask(signal.SIG_UNBLOCK, _IGNORED_SIGNALS)

    for f in (sys.stdin, sys.stdout):
        try:
            f.close()
        except Exception:
            pass

    cache = {rtype: set() for rtype in _CLEANUP_FUNCS.keys()}
    try:
        # keep track of registered/unregistered resources
        with open(fd, 'rb') as f:
            for line in f:
                try:
                    cmd, name, rtype = line.strip().decode('ascii').split(':')
                    cleanup_func = _CLEANUP_FUNCS.get(rtype, None)
                    if cleanup_func is None:
                        raise ValueError(
                            f'Cannot register {name} for automatic cleanup: '
                            f'unknown resource type {rtype}')

                    if cmd == 'REGISTER':
                        cache[rtype].add(name)
                    elif cmd == 'UNREGISTER':
                        cache[rtype].remove(name)
                    elif cmd == 'PROBE':
                        pass
                    else:
                        raise RuntimeError('unrecognized command %r' % cmd)
                except Exception:
                    try:
                        sys.excepthook(*sys.exc_info())
                    except:
                        pass
    finally:
        # all processes have terminated; cleanup any remaining resources
        for rtype, rtype_cache in cache.items():
            if rtype_cache:
                try:
                    warnings.warn('resource_tracker: There appear to be %d '
                                  'leaked %s objects to clean up at shutdown' %
                                  (len(rtype_cache), rtype))
                except Exception:
                    pass
            for name in rtype_cache:
                # For some reason the process which created and registered this
                # resource has failed to unregister it. Presumably it has
                # died.  We therefore unlink it.
                try:
                    try:
                        _CLEANUP_FUNCS[rtype](name)
                    except Exception as e:
                        warnings.warn('resource_tracker: %r: %s' % (name, e))
                finally:
                    pass
multiprocessing/shared_memory.py000064400000042016151153537440013216 0ustar00"""Provides shared memory for direct access across processes.

The API of this package is currently provisional. Refer to the
documentation for details.
"""


__all__ = [ 'SharedMemory', 'ShareableList' ]


from functools import partial
import mmap
import os
import errno
import struct
import secrets

if os.name == "nt":
    import _winapi
    _USE_POSIX = False
else:
    import _posixshmem
    _USE_POSIX = True


_O_CREX = os.O_CREAT | os.O_EXCL

# FreeBSD (and perhaps other BSDs) limit names to 14 characters.
_SHM_SAFE_NAME_LENGTH = 14

# Shared memory block name prefix
if _USE_POSIX:
    _SHM_NAME_PREFIX = '/psm_'
else:
    _SHM_NAME_PREFIX = 'wnsm_'


def _make_filename():
    "Create a random filename for the shared memory object."
    # number of random bytes to use for name
    nbytes = (_SHM_SAFE_NAME_LENGTH - len(_SHM_NAME_PREFIX)) // 2
    assert nbytes >= 2, '_SHM_NAME_PREFIX too long'
    name = _SHM_NAME_PREFIX + secrets.token_hex(nbytes)
    assert len(name) <= _SHM_SAFE_NAME_LENGTH
    return name


class SharedMemory:
    """Creates a new shared memory block or attaches to an existing
    shared memory block.

    Every shared memory block is assigned a unique name.  This enables
    one process to create a shared memory block with a particular name
    so that a different process can attach to that same shared memory
    block using that same name.

    As a resource for sharing data across processes, shared memory blocks
    may outlive the original process that created them.  When one process
    no longer needs access to a shared memory block that might still be
    needed by other processes, the close() method should be called.
    When a shared memory block is no longer needed by any process, the
    unlink() method should be called to ensure proper cleanup."""

    # Defaults; enables close() and unlink() to run without errors.
    _name = None
    _fd = -1
    _mmap = None
    _buf = None
    _flags = os.O_RDWR
    _mode = 0o600
    _prepend_leading_slash = True if _USE_POSIX else False

    def __init__(self, name=None, create=False, size=0):
        if not size >= 0:
            raise ValueError("'size' must be a positive integer")
        if create:
            self._flags = _O_CREX | os.O_RDWR
            if size == 0:
                raise ValueError("'size' must be a positive number different from zero")
        if name is None and not self._flags & os.O_EXCL:
            raise ValueError("'name' can only be None if create=True")

        if _USE_POSIX:

            # POSIX Shared Memory

            if name is None:
                while True:
                    name = _make_filename()
                    try:
                        self._fd = _posixshmem.shm_open(
                            name,
                            self._flags,
                            mode=self._mode
                        )
                    except FileExistsError:
                        continue
                    self._name = name
                    break
            else:
                name = "/" + name if self._prepend_leading_slash else name
                self._fd = _posixshmem.shm_open(
                    name,
                    self._flags,
                    mode=self._mode
                )
                self._name = name
            try:
                if create and size:
                    os.ftruncate(self._fd, size)
                stats = os.fstat(self._fd)
                size = stats.st_size
                self._mmap = mmap.mmap(self._fd, size)
            except OSError:
                self.unlink()
                raise

            from .resource_tracker import register
            register(self._name, "shared_memory")

        else:

            # Windows Named Shared Memory

            if create:
                while True:
                    temp_name = _make_filename() if name is None else name
                    # Create and reserve shared memory block with this name
                    # until it can be attached to by mmap.
                    h_map = _winapi.CreateFileMapping(
                        _winapi.INVALID_HANDLE_VALUE,
                        _winapi.NULL,
                        _winapi.PAGE_READWRITE,
                        (size >> 32) & 0xFFFFFFFF,
                        size & 0xFFFFFFFF,
                        temp_name
                    )
                    try:
                        last_error_code = _winapi.GetLastError()
                        if last_error_code == _winapi.ERROR_ALREADY_EXISTS:
                            if name is not None:
                                raise FileExistsError(
                                    errno.EEXIST,
                                    os.strerror(errno.EEXIST),
                                    name,
                                    _winapi.ERROR_ALREADY_EXISTS
                                )
                            else:
                                continue
                        self._mmap = mmap.mmap(-1, size, tagname=temp_name)
                    finally:
                        _winapi.CloseHandle(h_map)
                    self._name = temp_name
                    break

            else:
                self._name = name
                # Dynamically determine the existing named shared memory
                # block's size which is likely a multiple of mmap.PAGESIZE.
                h_map = _winapi.OpenFileMapping(
                    _winapi.FILE_MAP_READ,
                    False,
                    name
                )
                try:
                    p_buf = _winapi.MapViewOfFile(
                        h_map,
                        _winapi.FILE_MAP_READ,
                        0,
                        0,
                        0
                    )
                finally:
                    _winapi.CloseHandle(h_map)
                size = _winapi.VirtualQuerySize(p_buf)
                self._mmap = mmap.mmap(-1, size, tagname=name)

        self._size = size
        self._buf = memoryview(self._mmap)

    def __del__(self):
        try:
            self.close()
        except OSError:
            pass

    def __reduce__(self):
        return (
            self.__class__,
            (
                self.name,
                False,
                self.size,
            ),
        )

    def __repr__(self):
        return f'{self.__class__.__name__}({self.name!r}, size={self.size})'

    @property
    def buf(self):
        "A memoryview of contents of the shared memory block."
        return self._buf

    @property
    def name(self):
        "Unique name that identifies the shared memory block."
        reported_name = self._name
        if _USE_POSIX and self._prepend_leading_slash:
            if self._name.startswith("/"):
                reported_name = self._name[1:]
        return reported_name

    @property
    def size(self):
        "Size in bytes."
        return self._size

    def close(self):
        """Closes access to the shared memory from this instance but does
        not destroy the shared memory block."""
        if self._buf is not None:
            self._buf.release()
            self._buf = None
        if self._mmap is not None:
            self._mmap.close()
            self._mmap = None
        if _USE_POSIX and self._fd >= 0:
            os.close(self._fd)
            self._fd = -1

    def unlink(self):
        """Requests that the underlying shared memory block be destroyed.

        In order to ensure proper cleanup of resources, unlink should be
        called once (and only once) across all processes which have access
        to the shared memory block."""
        if _USE_POSIX and self._name:
            from .resource_tracker import unregister
            _posixshmem.shm_unlink(self._name)
            unregister(self._name, "shared_memory")


_encoding = "utf8"

class ShareableList:
    """Pattern for a mutable list-like object shareable via a shared
    memory block.  It differs from the built-in list type in that these
    lists can not change their overall length (i.e. no append, insert,
    etc.)

    Because values are packed into a memoryview as bytes, the struct
    packing format for any storable value must require no more than 8
    characters to describe its format."""

    _types_mapping = {
        int: "q",
        float: "d",
        bool: "xxxxxxx?",
        str: "%ds",
        bytes: "%ds",
        None.__class__: "xxxxxx?x",
    }
    _alignment = 8
    _back_transforms_mapping = {
        0: lambda value: value,                   # int, float, bool
        1: lambda value: value.rstrip(b'\x00').decode(_encoding),  # str
        2: lambda value: value.rstrip(b'\x00'),   # bytes
        3: lambda _value: None,                   # None
    }

    @staticmethod
    def _extract_recreation_code(value):
        """Used in concert with _back_transforms_mapping to convert values
        into the appropriate Python objects when retrieving them from
        the list as well as when storing them."""
        if not isinstance(value, (str, bytes, None.__class__)):
            return 0
        elif isinstance(value, str):
            return 1
        elif isinstance(value, bytes):
            return 2
        else:
            return 3  # NoneType

    def __init__(self, sequence=None, *, name=None):
        if sequence is not None:
            _formats = [
                self._types_mapping[type(item)]
                    if not isinstance(item, (str, bytes))
                    else self._types_mapping[type(item)] % (
                        self._alignment * (len(item) // self._alignment + 1),
                    )
                for item in sequence
            ]
            self._list_len = len(_formats)
            assert sum(len(fmt) <= 8 for fmt in _formats) == self._list_len
            self._allocated_bytes = tuple(
                    self._alignment if fmt[-1] != "s" else int(fmt[:-1])
                    for fmt in _formats
            )
            _recreation_codes = [
                self._extract_recreation_code(item) for item in sequence
            ]
            requested_size = struct.calcsize(
                "q" + self._format_size_metainfo +
                "".join(_formats) +
                self._format_packing_metainfo +
                self._format_back_transform_codes
            )

        else:
            requested_size = 8  # Some platforms require > 0.

        if name is not None and sequence is None:
            self.shm = SharedMemory(name)
        else:
            self.shm = SharedMemory(name, create=True, size=requested_size)

        if sequence is not None:
            _enc = _encoding
            struct.pack_into(
                "q" + self._format_size_metainfo,
                self.shm.buf,
                0,
                self._list_len,
                *(self._allocated_bytes)
            )
            struct.pack_into(
                "".join(_formats),
                self.shm.buf,
                self._offset_data_start,
                *(v.encode(_enc) if isinstance(v, str) else v for v in sequence)
            )
            struct.pack_into(
                self._format_packing_metainfo,
                self.shm.buf,
                self._offset_packing_formats,
                *(v.encode(_enc) for v in _formats)
            )
            struct.pack_into(
                self._format_back_transform_codes,
                self.shm.buf,
                self._offset_back_transform_codes,
                *(_recreation_codes)
            )

        else:
            self._list_len = len(self)  # Obtains size from offset 0 in buffer.
            self._allocated_bytes = struct.unpack_from(
                self._format_size_metainfo,
                self.shm.buf,
                1 * 8
            )

    def _get_packing_format(self, position):
        "Gets the packing format for a single value stored in the list."
        position = position if position >= 0 else position + self._list_len
        if (position >= self._list_len) or (self._list_len < 0):
            raise IndexError("Requested position out of range.")

        v = struct.unpack_from(
            "8s",
            self.shm.buf,
            self._offset_packing_formats + position * 8
        )[0]
        fmt = v.rstrip(b'\x00')
        fmt_as_str = fmt.decode(_encoding)

        return fmt_as_str

    def _get_back_transform(self, position):
        "Gets the back transformation function for a single value."

        position = position if position >= 0 else position + self._list_len
        if (position >= self._list_len) or (self._list_len < 0):
            raise IndexError("Requested position out of range.")

        transform_code = struct.unpack_from(
            "b",
            self.shm.buf,
            self._offset_back_transform_codes + position
        )[0]
        transform_function = self._back_transforms_mapping[transform_code]

        return transform_function

    def _set_packing_format_and_transform(self, position, fmt_as_str, value):
        """Sets the packing format and back transformation code for a
        single value in the list at the specified position."""

        position = position if position >= 0 else position + self._list_len
        if (position >= self._list_len) or (self._list_len < 0):
            raise IndexError("Requested position out of range.")

        struct.pack_into(
            "8s",
            self.shm.buf,
            self._offset_packing_formats + position * 8,
            fmt_as_str.encode(_encoding)
        )

        transform_code = self._extract_recreation_code(value)
        struct.pack_into(
            "b",
            self.shm.buf,
            self._offset_back_transform_codes + position,
            transform_code
        )

    def __getitem__(self, position):
        try:
            offset = self._offset_data_start \
                     + sum(self._allocated_bytes[:position])
            (v,) = struct.unpack_from(
                self._get_packing_format(position),
                self.shm.buf,
                offset
            )
        except IndexError:
            raise IndexError("index out of range")

        back_transform = self._get_back_transform(position)
        v = back_transform(v)

        return v

    def __setitem__(self, position, value):
        try:
            offset = self._offset_data_start \
                     + sum(self._allocated_bytes[:position])
            current_format = self._get_packing_format(position)
        except IndexError:
            raise IndexError("assignment index out of range")

        if not isinstance(value, (str, bytes)):
            new_format = self._types_mapping[type(value)]
            encoded_value = value
        else:
            encoded_value = (value.encode(_encoding)
                             if isinstance(value, str) else value)
            if len(encoded_value) > self._allocated_bytes[position]:
                raise ValueError("bytes/str item exceeds available storage")
            if current_format[-1] == "s":
                new_format = current_format
            else:
                new_format = self._types_mapping[str] % (
                    self._allocated_bytes[position],
                )

        self._set_packing_format_and_transform(
            position,
            new_format,
            value
        )
        struct.pack_into(new_format, self.shm.buf, offset, encoded_value)

    def __reduce__(self):
        return partial(self.__class__, name=self.shm.name), ()

    def __len__(self):
        return struct.unpack_from("q", self.shm.buf, 0)[0]

    def __repr__(self):
        return f'{self.__class__.__name__}({list(self)}, name={self.shm.name!r})'

    @property
    def format(self):
        "The struct packing format used by all currently stored values."
        return "".join(
            self._get_packing_format(i) for i in range(self._list_len)
        )

    @property
    def _format_size_metainfo(self):
        "The struct packing format used for metainfo on storage sizes."
        return f"{self._list_len}q"

    @property
    def _format_packing_metainfo(self):
        "The struct packing format used for the values' packing formats."
        return "8s" * self._list_len

    @property
    def _format_back_transform_codes(self):
        "The struct packing format used for the values' back transforms."
        return "b" * self._list_len

    @property
    def _offset_data_start(self):
        return (self._list_len + 1) * 8  # 8 bytes per "q"

    @property
    def _offset_packing_formats(self):
        return self._offset_data_start + sum(self._allocated_bytes)

    @property
    def _offset_back_transform_codes(self):
        return self._offset_packing_formats + self._list_len * 8

    def count(self, value):
        "L.count(value) -> integer -- return number of occurrences of value."

        return sum(value == entry for entry in self)

    def index(self, value):
        """L.index(value) -> integer -- return first index of value.
        Raises ValueError if the value is not present."""

        for position, entry in enumerate(self):
            if value == entry:
                return position
        else:
            raise ValueError(f"{value!r} not in this container")
multiprocessing/connection.py000064400000076160151153537440012526 0ustar00#
# A higher level module for using sockets (or Windows named pipes)
#
# multiprocessing/connection.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#

__all__ = [ 'Client', 'Listener', 'Pipe', 'wait' ]

import io
import os
import sys
import socket
import struct
import time
import tempfile
import itertools

import _multiprocessing

from . import util

from . import AuthenticationError, BufferTooShort
from .context import reduction
_ForkingPickler = reduction.ForkingPickler

try:
    import _winapi
    from _winapi import WAIT_OBJECT_0, WAIT_ABANDONED_0, WAIT_TIMEOUT, INFINITE
except ImportError:
    if sys.platform == 'win32':
        raise
    _winapi = None

#
#
#

BUFSIZE = 8192
# A very generous timeout when it comes to local connections...
CONNECTION_TIMEOUT = 20.

# The hmac module implicitly defaults to using MD5.
# Support using a stronger algorithm for the challenge/response code:
HMAC_DIGEST_NAME='sha256'

_mmap_counter = itertools.count()

default_family = 'AF_INET'
families = ['AF_INET']

if hasattr(socket, 'AF_UNIX'):
    default_family = 'AF_UNIX'
    families += ['AF_UNIX']

if sys.platform == 'win32':
    default_family = 'AF_PIPE'
    families += ['AF_PIPE']


def _init_timeout(timeout=CONNECTION_TIMEOUT):
    return time.monotonic() + timeout

def _check_timeout(t):
    return time.monotonic() > t

#
#
#

def arbitrary_address(family):
    '''
    Return an arbitrary free address for the given family
    '''
    if family == 'AF_INET':
        return ('localhost', 0)
    elif family == 'AF_UNIX':
        return tempfile.mktemp(prefix='listener-', dir=util.get_temp_dir())
    elif family == 'AF_PIPE':
        return tempfile.mktemp(prefix=r'\\.\pipe\pyc-%d-%d-' %
                               (os.getpid(), next(_mmap_counter)), dir="")
    else:
        raise ValueError('unrecognized family')

def _validate_family(family):
    '''
    Checks if the family is valid for the current environment.
    '''
    if sys.platform != 'win32' and family == 'AF_PIPE':
        raise ValueError('Family %s is not recognized.' % family)

    if sys.platform == 'win32' and family == 'AF_UNIX':
        # double check
        if not hasattr(socket, family):
            raise ValueError('Family %s is not recognized.' % family)

def address_type(address):
    '''
    Return the types of the address

    This can be 'AF_INET', 'AF_UNIX', or 'AF_PIPE'
    '''
    if type(address) == tuple:
        return 'AF_INET'
    elif type(address) is str and address.startswith('\\\\'):
        return 'AF_PIPE'
    elif type(address) is str or util.is_abstract_socket_namespace(address):
        return 'AF_UNIX'
    else:
        raise ValueError('address type of %r unrecognized' % address)

#
# Connection classes
#

class _ConnectionBase:
    _handle = None

    def __init__(self, handle, readable=True, writable=True):
        handle = handle.__index__()
        if handle < 0:
            raise ValueError("invalid handle")
        if not readable and not writable:
            raise ValueError(
                "at least one of `readable` and `writable` must be True")
        self._handle = handle
        self._readable = readable
        self._writable = writable

    # XXX should we use util.Finalize instead of a __del__?

    def __del__(self):
        if self._handle is not None:
            self._close()

    def _check_closed(self):
        if self._handle is None:
            raise OSError("handle is closed")

    def _check_readable(self):
        if not self._readable:
            raise OSError("connection is write-only")

    def _check_writable(self):
        if not self._writable:
            raise OSError("connection is read-only")

    def _bad_message_length(self):
        if self._writable:
            self._readable = False
        else:
            self.close()
        raise OSError("bad message length")

    @property
    def closed(self):
        """True if the connection is closed"""
        return self._handle is None

    @property
    def readable(self):
        """True if the connection is readable"""
        return self._readable

    @property
    def writable(self):
        """True if the connection is writable"""
        return self._writable

    def fileno(self):
        """File descriptor or handle of the connection"""
        self._check_closed()
        return self._handle

    def close(self):
        """Close the connection"""
        if self._handle is not None:
            try:
                self._close()
            finally:
                self._handle = None

    def send_bytes(self, buf, offset=0, size=None):
        """Send the bytes data from a bytes-like object"""
        self._check_closed()
        self._check_writable()
        m = memoryview(buf)
        # HACK for byte-indexing of non-bytewise buffers (e.g. array.array)
        if m.itemsize > 1:
            m = memoryview(bytes(m))
        n = len(m)
        if offset < 0:
            raise ValueError("offset is negative")
        if n < offset:
            raise ValueError("buffer length < offset")
        if size is None:
            size = n - offset
        elif size < 0:
            raise ValueError("size is negative")
        elif offset + size > n:
            raise ValueError("buffer length < offset + size")
        self._send_bytes(m[offset:offset + size])

    def send(self, obj):
        """Send a (picklable) object"""
        self._check_closed()
        self._check_writable()
        self._send_bytes(_ForkingPickler.dumps(obj))

    def recv_bytes(self, maxlength=None):
        """
        Receive bytes data as a bytes object.
        """
        self._check_closed()
        self._check_readable()
        if maxlength is not None and maxlength < 0:
            raise ValueError("negative maxlength")
        buf = self._recv_bytes(maxlength)
        if buf is None:
            self._bad_message_length()
        return buf.getvalue()

    def recv_bytes_into(self, buf, offset=0):
        """
        Receive bytes data into a writeable bytes-like object.
        Return the number of bytes read.
        """
        self._check_closed()
        self._check_readable()
        with memoryview(buf) as m:
            # Get bytesize of arbitrary buffer
            itemsize = m.itemsize
            bytesize = itemsize * len(m)
            if offset < 0:
                raise ValueError("negative offset")
            elif offset > bytesize:
                raise ValueError("offset too large")
            result = self._recv_bytes()
            size = result.tell()
            if bytesize < offset + size:
                raise BufferTooShort(result.getvalue())
            # Message can fit in dest
            result.seek(0)
            result.readinto(m[offset // itemsize :
                              (offset + size) // itemsize])
            return size

    def recv(self):
        """Receive a (picklable) object"""
        self._check_closed()
        self._check_readable()
        buf = self._recv_bytes()
        return _ForkingPickler.loads(buf.getbuffer())

    def poll(self, timeout=0.0):
        """Whether there is any input available to be read"""
        self._check_closed()
        self._check_readable()
        return self._poll(timeout)

    def __enter__(self):
        return self

    def __exit__(self, exc_type, exc_value, exc_tb):
        self.close()


if _winapi:

    class PipeConnection(_ConnectionBase):
        """
        Connection class based on a Windows named pipe.
        Overlapped I/O is used, so the handles must have been created
        with FILE_FLAG_OVERLAPPED.
        """
        _got_empty_message = False

        def _close(self, _CloseHandle=_winapi.CloseHandle):
            _CloseHandle(self._handle)

        def _send_bytes(self, buf):
            ov, err = _winapi.WriteFile(self._handle, buf, overlapped=True)
            try:
                if err == _winapi.ERROR_IO_PENDING:
                    waitres = _winapi.WaitForMultipleObjects(
                        [ov.event], False, INFINITE)
                    assert waitres == WAIT_OBJECT_0
            except:
                ov.cancel()
                raise
            finally:
                nwritten, err = ov.GetOverlappedResult(True)
            assert err == 0
            assert nwritten == len(buf)

        def _recv_bytes(self, maxsize=None):
            if self._got_empty_message:
                self._got_empty_message = False
                return io.BytesIO()
            else:
                bsize = 128 if maxsize is None else min(maxsize, 128)
                try:
                    ov, err = _winapi.ReadFile(self._handle, bsize,
                                                overlapped=True)
                    try:
                        if err == _winapi.ERROR_IO_PENDING:
                            waitres = _winapi.WaitForMultipleObjects(
                                [ov.event], False, INFINITE)
                            assert waitres == WAIT_OBJECT_0
                    except:
                        ov.cancel()
                        raise
                    finally:
                        nread, err = ov.GetOverlappedResult(True)
                        if err == 0:
                            f = io.BytesIO()
                            f.write(ov.getbuffer())
                            return f
                        elif err == _winapi.ERROR_MORE_DATA:
                            return self._get_more_data(ov, maxsize)
                except OSError as e:
                    if e.winerror == _winapi.ERROR_BROKEN_PIPE:
                        raise EOFError
                    else:
                        raise
            raise RuntimeError("shouldn't get here; expected KeyboardInterrupt")

        def _poll(self, timeout):
            if (self._got_empty_message or
                        _winapi.PeekNamedPipe(self._handle)[0] != 0):
                return True
            return bool(wait([self], timeout))

        def _get_more_data(self, ov, maxsize):
            buf = ov.getbuffer()
            f = io.BytesIO()
            f.write(buf)
            left = _winapi.PeekNamedPipe(self._handle)[1]
            assert left > 0
            if maxsize is not None and len(buf) + left > maxsize:
                self._bad_message_length()
            ov, err = _winapi.ReadFile(self._handle, left, overlapped=True)
            rbytes, err = ov.GetOverlappedResult(True)
            assert err == 0
            assert rbytes == left
            f.write(ov.getbuffer())
            return f


class Connection(_ConnectionBase):
    """
    Connection class based on an arbitrary file descriptor (Unix only), or
    a socket handle (Windows).
    """

    if _winapi:
        def _close(self, _close=_multiprocessing.closesocket):
            _close(self._handle)
        _write = _multiprocessing.send
        _read = _multiprocessing.recv
    else:
        def _close(self, _close=os.close):
            _close(self._handle)
        _write = os.write
        _read = os.read

    def _send(self, buf, write=_write):
        remaining = len(buf)
        while True:
            n = write(self._handle, buf)
            remaining -= n
            if remaining == 0:
                break
            buf = buf[n:]

    def _recv(self, size, read=_read):
        buf = io.BytesIO()
        handle = self._handle
        remaining = size
        while remaining > 0:
            chunk = read(handle, remaining)
            n = len(chunk)
            if n == 0:
                if remaining == size:
                    raise EOFError
                else:
                    raise OSError("got end of file during message")
            buf.write(chunk)
            remaining -= n
        return buf

    def _send_bytes(self, buf):
        n = len(buf)
        if n > 0x7fffffff:
            pre_header = struct.pack("!i", -1)
            header = struct.pack("!Q", n)
            self._send(pre_header)
            self._send(header)
            self._send(buf)
        else:
            # For wire compatibility with 3.7 and lower
            header = struct.pack("!i", n)
            if n > 16384:
                # The payload is large so Nagle's algorithm won't be triggered
                # and we'd better avoid the cost of concatenation.
                self._send(header)
                self._send(buf)
            else:
                # Issue #20540: concatenate before sending, to avoid delays due
                # to Nagle's algorithm on a TCP socket.
                # Also note we want to avoid sending a 0-length buffer separately,
                # to avoid "broken pipe" errors if the other end closed the pipe.
                self._send(header + buf)

    def _recv_bytes(self, maxsize=None):
        buf = self._recv(4)
        size, = struct.unpack("!i", buf.getvalue())
        if size == -1:
            buf = self._recv(8)
            size, = struct.unpack("!Q", buf.getvalue())
        if maxsize is not None and size > maxsize:
            return None
        return self._recv(size)

    def _poll(self, timeout):
        r = wait([self], timeout)
        return bool(r)


#
# Public functions
#

class Listener(object):
    '''
    Returns a listener object.

    This is a wrapper for a bound socket which is 'listening' for
    connections, or for a Windows named pipe.
    '''
    def __init__(self, address=None, family=None, backlog=1, authkey=None):
        family = family or (address and address_type(address)) \
                 or default_family
        address = address or arbitrary_address(family)

        _validate_family(family)
        if family == 'AF_PIPE':
            self._listener = PipeListener(address, backlog)
        else:
            self._listener = SocketListener(address, family, backlog)

        if authkey is not None and not isinstance(authkey, bytes):
            raise TypeError('authkey should be a byte string')

        self._authkey = authkey

    def accept(self):
        '''
        Accept a connection on the bound socket or named pipe of `self`.

        Returns a `Connection` object.
        '''
        if self._listener is None:
            raise OSError('listener is closed')
        c = self._listener.accept()
        if self._authkey:
            deliver_challenge(c, self._authkey)
            answer_challenge(c, self._authkey)
        return c

    def close(self):
        '''
        Close the bound socket or named pipe of `self`.
        '''
        listener = self._listener
        if listener is not None:
            self._listener = None
            listener.close()

    @property
    def address(self):
        return self._listener._address

    @property
    def last_accepted(self):
        return self._listener._last_accepted

    def __enter__(self):
        return self

    def __exit__(self, exc_type, exc_value, exc_tb):
        self.close()


def Client(address, family=None, authkey=None):
    '''
    Returns a connection to the address of a `Listener`
    '''
    family = family or address_type(address)
    _validate_family(family)
    if family == 'AF_PIPE':
        c = PipeClient(address)
    else:
        c = SocketClient(address)

    if authkey is not None and not isinstance(authkey, bytes):
        raise TypeError('authkey should be a byte string')

    if authkey is not None:
        answer_challenge(c, authkey)
        deliver_challenge(c, authkey)

    return c


if sys.platform != 'win32':

    def Pipe(duplex=True):
        '''
        Returns pair of connection objects at either end of a pipe
        '''
        if duplex:
            s1, s2 = socket.socketpair()
            s1.setblocking(True)
            s2.setblocking(True)
            c1 = Connection(s1.detach())
            c2 = Connection(s2.detach())
        else:
            fd1, fd2 = os.pipe()
            c1 = Connection(fd1, writable=False)
            c2 = Connection(fd2, readable=False)

        return c1, c2

else:

    def Pipe(duplex=True):
        '''
        Returns pair of connection objects at either end of a pipe
        '''
        address = arbitrary_address('AF_PIPE')
        if duplex:
            openmode = _winapi.PIPE_ACCESS_DUPLEX
            access = _winapi.GENERIC_READ | _winapi.GENERIC_WRITE
            obsize, ibsize = BUFSIZE, BUFSIZE
        else:
            openmode = _winapi.PIPE_ACCESS_INBOUND
            access = _winapi.GENERIC_WRITE
            obsize, ibsize = 0, BUFSIZE

        h1 = _winapi.CreateNamedPipe(
            address, openmode | _winapi.FILE_FLAG_OVERLAPPED |
            _winapi.FILE_FLAG_FIRST_PIPE_INSTANCE,
            _winapi.PIPE_TYPE_MESSAGE | _winapi.PIPE_READMODE_MESSAGE |
            _winapi.PIPE_WAIT,
            1, obsize, ibsize, _winapi.NMPWAIT_WAIT_FOREVER,
            # default security descriptor: the handle cannot be inherited
            _winapi.NULL
            )
        h2 = _winapi.CreateFile(
            address, access, 0, _winapi.NULL, _winapi.OPEN_EXISTING,
            _winapi.FILE_FLAG_OVERLAPPED, _winapi.NULL
            )
        _winapi.SetNamedPipeHandleState(
            h2, _winapi.PIPE_READMODE_MESSAGE, None, None
            )

        overlapped = _winapi.ConnectNamedPipe(h1, overlapped=True)
        _, err = overlapped.GetOverlappedResult(True)
        assert err == 0

        c1 = PipeConnection(h1, writable=duplex)
        c2 = PipeConnection(h2, readable=duplex)

        return c1, c2

#
# Definitions for connections based on sockets
#

class SocketListener(object):
    '''
    Representation of a socket which is bound to an address and listening
    '''
    def __init__(self, address, family, backlog=1):
        self._socket = socket.socket(getattr(socket, family))
        try:
            # SO_REUSEADDR has different semantics on Windows (issue #2550).
            if os.name == 'posix':
                self._socket.setsockopt(socket.SOL_SOCKET,
                                        socket.SO_REUSEADDR, 1)
            self._socket.setblocking(True)
            self._socket.bind(address)
            self._socket.listen(backlog)
            self._address = self._socket.getsockname()
        except OSError:
            self._socket.close()
            raise
        self._family = family
        self._last_accepted = None

        if family == 'AF_UNIX' and not util.is_abstract_socket_namespace(address):
            # Linux abstract socket namespaces do not need to be explicitly unlinked
            self._unlink = util.Finalize(
                self, os.unlink, args=(address,), exitpriority=0
                )
        else:
            self._unlink = None

    def accept(self):
        s, self._last_accepted = self._socket.accept()
        s.setblocking(True)
        return Connection(s.detach())

    def close(self):
        try:
            self._socket.close()
        finally:
            unlink = self._unlink
            if unlink is not None:
                self._unlink = None
                unlink()


def SocketClient(address):
    '''
    Return a connection object connected to the socket given by `address`
    '''
    family = address_type(address)
    with socket.socket( getattr(socket, family) ) as s:
        s.setblocking(True)
        s.connect(address)
        return Connection(s.detach())

#
# Definitions for connections based on named pipes
#

if sys.platform == 'win32':

    class PipeListener(object):
        '''
        Representation of a named pipe
        '''
        def __init__(self, address, backlog=None):
            self._address = address
            self._handle_queue = [self._new_handle(first=True)]

            self._last_accepted = None
            util.sub_debug('listener created with address=%r', self._address)
            self.close = util.Finalize(
                self, PipeListener._finalize_pipe_listener,
                args=(self._handle_queue, self._address), exitpriority=0
                )

        def _new_handle(self, first=False):
            flags = _winapi.PIPE_ACCESS_DUPLEX | _winapi.FILE_FLAG_OVERLAPPED
            if first:
                flags |= _winapi.FILE_FLAG_FIRST_PIPE_INSTANCE
            return _winapi.CreateNamedPipe(
                self._address, flags,
                _winapi.PIPE_TYPE_MESSAGE | _winapi.PIPE_READMODE_MESSAGE |
                _winapi.PIPE_WAIT,
                _winapi.PIPE_UNLIMITED_INSTANCES, BUFSIZE, BUFSIZE,
                _winapi.NMPWAIT_WAIT_FOREVER, _winapi.NULL
                )

        def accept(self):
            self._handle_queue.append(self._new_handle())
            handle = self._handle_queue.pop(0)
            try:
                ov = _winapi.ConnectNamedPipe(handle, overlapped=True)
            except OSError as e:
                if e.winerror != _winapi.ERROR_NO_DATA:
                    raise
                # ERROR_NO_DATA can occur if a client has already connected,
                # written data and then disconnected -- see Issue 14725.
            else:
                try:
                    res = _winapi.WaitForMultipleObjects(
                        [ov.event], False, INFINITE)
                except:
                    ov.cancel()
                    _winapi.CloseHandle(handle)
                    raise
                finally:
                    _, err = ov.GetOverlappedResult(True)
                    assert err == 0
            return PipeConnection(handle)

        @staticmethod
        def _finalize_pipe_listener(queue, address):
            util.sub_debug('closing listener with address=%r', address)
            for handle in queue:
                _winapi.CloseHandle(handle)

    def PipeClient(address):
        '''
        Return a connection object connected to the pipe given by `address`
        '''
        t = _init_timeout()
        while 1:
            try:
                _winapi.WaitNamedPipe(address, 1000)
                h = _winapi.CreateFile(
                    address, _winapi.GENERIC_READ | _winapi.GENERIC_WRITE,
                    0, _winapi.NULL, _winapi.OPEN_EXISTING,
                    _winapi.FILE_FLAG_OVERLAPPED, _winapi.NULL
                    )
            except OSError as e:
                if e.winerror not in (_winapi.ERROR_SEM_TIMEOUT,
                                      _winapi.ERROR_PIPE_BUSY) or _check_timeout(t):
                    raise
            else:
                break
        else:
            raise

        _winapi.SetNamedPipeHandleState(
            h, _winapi.PIPE_READMODE_MESSAGE, None, None
            )
        return PipeConnection(h)

#
# Authentication stuff
#

MESSAGE_LENGTH = 20

CHALLENGE = b'#CHALLENGE#'
WELCOME = b'#WELCOME#'
FAILURE = b'#FAILURE#'

def deliver_challenge(connection, authkey):
    import hmac
    if not isinstance(authkey, bytes):
        raise ValueError(
            "Authkey must be bytes, not {0!s}".format(type(authkey)))
    message = os.urandom(MESSAGE_LENGTH)
    connection.send_bytes(CHALLENGE + message)
    digest = hmac.new(authkey, message, HMAC_DIGEST_NAME).digest()
    response = connection.recv_bytes(256)        # reject large message
    if response == digest:
        connection.send_bytes(WELCOME)
    else:
        connection.send_bytes(FAILURE)
        raise AuthenticationError('digest received was wrong')

def answer_challenge(connection, authkey):
    import hmac
    if not isinstance(authkey, bytes):
        raise ValueError(
            "Authkey must be bytes, not {0!s}".format(type(authkey)))
    message = connection.recv_bytes(256)         # reject large message
    assert message[:len(CHALLENGE)] == CHALLENGE, 'message = %r' % message
    message = message[len(CHALLENGE):]
    digest = hmac.new(authkey, message, HMAC_DIGEST_NAME).digest()
    connection.send_bytes(digest)
    response = connection.recv_bytes(256)        # reject large message
    if response != WELCOME:
        raise AuthenticationError('digest sent was rejected')

#
# Support for using xmlrpclib for serialization
#

class ConnectionWrapper(object):
    def __init__(self, conn, dumps, loads):
        self._conn = conn
        self._dumps = dumps
        self._loads = loads
        for attr in ('fileno', 'close', 'poll', 'recv_bytes', 'send_bytes'):
            obj = getattr(conn, attr)
            setattr(self, attr, obj)
    def send(self, obj):
        s = self._dumps(obj)
        self._conn.send_bytes(s)
    def recv(self):
        s = self._conn.recv_bytes()
        return self._loads(s)

def _xml_dumps(obj):
    return xmlrpclib.dumps((obj,), None, None, None, 1).encode('utf-8')

def _xml_loads(s):
    (obj,), method = xmlrpclib.loads(s.decode('utf-8'))
    return obj

class XmlListener(Listener):
    def accept(self):
        global xmlrpclib
        import xmlrpc.client as xmlrpclib
        obj = Listener.accept(self)
        return ConnectionWrapper(obj, _xml_dumps, _xml_loads)

def XmlClient(*args, **kwds):
    global xmlrpclib
    import xmlrpc.client as xmlrpclib
    return ConnectionWrapper(Client(*args, **kwds), _xml_dumps, _xml_loads)

#
# Wait
#

if sys.platform == 'win32':

    def _exhaustive_wait(handles, timeout):
        # Return ALL handles which are currently signalled.  (Only
        # returning the first signalled might create starvation issues.)
        L = list(handles)
        ready = []
        while L:
            res = _winapi.WaitForMultipleObjects(L, False, timeout)
            if res == WAIT_TIMEOUT:
                break
            elif WAIT_OBJECT_0 <= res < WAIT_OBJECT_0 + len(L):
                res -= WAIT_OBJECT_0
            elif WAIT_ABANDONED_0 <= res < WAIT_ABANDONED_0 + len(L):
                res -= WAIT_ABANDONED_0
            else:
                raise RuntimeError('Should not get here')
            ready.append(L[res])
            L = L[res+1:]
            timeout = 0
        return ready

    _ready_errors = {_winapi.ERROR_BROKEN_PIPE, _winapi.ERROR_NETNAME_DELETED}

    def wait(object_list, timeout=None):
        '''
        Wait till an object in object_list is ready/readable.

        Returns list of those objects in object_list which are ready/readable.
        '''
        if timeout is None:
            timeout = INFINITE
        elif timeout < 0:
            timeout = 0
        else:
            timeout = int(timeout * 1000 + 0.5)

        object_list = list(object_list)
        waithandle_to_obj = {}
        ov_list = []
        ready_objects = set()
        ready_handles = set()

        try:
            for o in object_list:
                try:
                    fileno = getattr(o, 'fileno')
                except AttributeError:
                    waithandle_to_obj[o.__index__()] = o
                else:
                    # start an overlapped read of length zero
                    try:
                        ov, err = _winapi.ReadFile(fileno(), 0, True)
                    except OSError as e:
                        ov, err = None, e.winerror
                        if err not in _ready_errors:
                            raise
                    if err == _winapi.ERROR_IO_PENDING:
                        ov_list.append(ov)
                        waithandle_to_obj[ov.event] = o
                    else:
                        # If o.fileno() is an overlapped pipe handle and
                        # err == 0 then there is a zero length message
                        # in the pipe, but it HAS NOT been consumed...
                        if ov and sys.getwindowsversion()[:2] >= (6, 2):
                            # ... except on Windows 8 and later, where
                            # the message HAS been consumed.
                            try:
                                _, err = ov.GetOverlappedResult(False)
                            except OSError as e:
                                err = e.winerror
                            if not err and hasattr(o, '_got_empty_message'):
                                o._got_empty_message = True
                        ready_objects.add(o)
                        timeout = 0

            ready_handles = _exhaustive_wait(waithandle_to_obj.keys(), timeout)
        finally:
            # request that overlapped reads stop
            for ov in ov_list:
                ov.cancel()

            # wait for all overlapped reads to stop
            for ov in ov_list:
                try:
                    _, err = ov.GetOverlappedResult(True)
                except OSError as e:
                    err = e.winerror
                    if err not in _ready_errors:
                        raise
                if err != _winapi.ERROR_OPERATION_ABORTED:
                    o = waithandle_to_obj[ov.event]
                    ready_objects.add(o)
                    if err == 0:
                        # If o.fileno() is an overlapped pipe handle then
                        # a zero length message HAS been consumed.
                        if hasattr(o, '_got_empty_message'):
                            o._got_empty_message = True

        ready_objects.update(waithandle_to_obj[h] for h in ready_handles)
        return [o for o in object_list if o in ready_objects]

else:

    import selectors

    # poll/select have the advantage of not requiring any extra file
    # descriptor, contrarily to epoll/kqueue (also, they require a single
    # syscall).
    if hasattr(selectors, 'PollSelector'):
        _WaitSelector = selectors.PollSelector
    else:
        _WaitSelector = selectors.SelectSelector

    def wait(object_list, timeout=None):
        '''
        Wait till an object in object_list is ready/readable.

        Returns list of those objects in object_list which are ready/readable.
        '''
        with _WaitSelector() as selector:
            for obj in object_list:
                selector.register(obj, selectors.EVENT_READ)

            if timeout is not None:
                deadline = time.monotonic() + timeout

            while True:
                ready = selector.select(timeout)
                if ready:
                    return [key.fileobj for (key, events) in ready]
                else:
                    if timeout is not None:
                        timeout = deadline - time.monotonic()
                        if timeout < 0:
                            return ready

#
# Make connection and socket objects sharable if possible
#

if sys.platform == 'win32':
    def reduce_connection(conn):
        handle = conn.fileno()
        with socket.fromfd(handle, socket.AF_INET, socket.SOCK_STREAM) as s:
            from . import resource_sharer
            ds = resource_sharer.DupSocket(s)
            return rebuild_connection, (ds, conn.readable, conn.writable)
    def rebuild_connection(ds, readable, writable):
        sock = ds.detach()
        return Connection(sock.detach(), readable, writable)
    reduction.register(Connection, reduce_connection)

    def reduce_pipe_connection(conn):
        access = ((_winapi.FILE_GENERIC_READ if conn.readable else 0) |
                  (_winapi.FILE_GENERIC_WRITE if conn.writable else 0))
        dh = reduction.DupHandle(conn.fileno(), access)
        return rebuild_pipe_connection, (dh, conn.readable, conn.writable)
    def rebuild_pipe_connection(dh, readable, writable):
        handle = dh.detach()
        return PipeConnection(handle, readable, writable)
    reduction.register(PipeConnection, reduce_pipe_connection)

else:
    def reduce_connection(conn):
        df = reduction.DupFd(conn.fileno())
        return rebuild_connection, (df, conn.readable, conn.writable)
    def rebuild_connection(df, readable, writable):
        fd = df.detach()
        return Connection(fd, readable, writable)
    reduction.register(Connection, reduce_connection)
multiprocessing/sharedctypes.py000064400000014242151153537440013056 0ustar00#
# Module which supports allocation of ctypes objects from shared memory
#
# multiprocessing/sharedctypes.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#

import ctypes
import weakref

from . import heap
from . import get_context

from .context import reduction, assert_spawning
_ForkingPickler = reduction.ForkingPickler

__all__ = ['RawValue', 'RawArray', 'Value', 'Array', 'copy', 'synchronized']

#
#
#

typecode_to_type = {
    'c': ctypes.c_char,     'u': ctypes.c_wchar,
    'b': ctypes.c_byte,     'B': ctypes.c_ubyte,
    'h': ctypes.c_short,    'H': ctypes.c_ushort,
    'i': ctypes.c_int,      'I': ctypes.c_uint,
    'l': ctypes.c_long,     'L': ctypes.c_ulong,
    'q': ctypes.c_longlong, 'Q': ctypes.c_ulonglong,
    'f': ctypes.c_float,    'd': ctypes.c_double
    }

#
#
#

def _new_value(type_):
    size = ctypes.sizeof(type_)
    wrapper = heap.BufferWrapper(size)
    return rebuild_ctype(type_, wrapper, None)

def RawValue(typecode_or_type, *args):
    '''
    Returns a ctypes object allocated from shared memory
    '''
    type_ = typecode_to_type.get(typecode_or_type, typecode_or_type)
    obj = _new_value(type_)
    ctypes.memset(ctypes.addressof(obj), 0, ctypes.sizeof(obj))
    obj.__init__(*args)
    return obj

def RawArray(typecode_or_type, size_or_initializer):
    '''
    Returns a ctypes array allocated from shared memory
    '''
    type_ = typecode_to_type.get(typecode_or_type, typecode_or_type)
    if isinstance(size_or_initializer, int):
        type_ = type_ * size_or_initializer
        obj = _new_value(type_)
        ctypes.memset(ctypes.addressof(obj), 0, ctypes.sizeof(obj))
        return obj
    else:
        type_ = type_ * len(size_or_initializer)
        result = _new_value(type_)
        result.__init__(*size_or_initializer)
        return result

def Value(typecode_or_type, *args, lock=True, ctx=None):
    '''
    Return a synchronization wrapper for a Value
    '''
    obj = RawValue(typecode_or_type, *args)
    if lock is False:
        return obj
    if lock in (True, None):
        ctx = ctx or get_context()
        lock = ctx.RLock()
    if not hasattr(lock, 'acquire'):
        raise AttributeError("%r has no method 'acquire'" % lock)
    return synchronized(obj, lock, ctx=ctx)

def Array(typecode_or_type, size_or_initializer, *, lock=True, ctx=None):
    '''
    Return a synchronization wrapper for a RawArray
    '''
    obj = RawArray(typecode_or_type, size_or_initializer)
    if lock is False:
        return obj
    if lock in (True, None):
        ctx = ctx or get_context()
        lock = ctx.RLock()
    if not hasattr(lock, 'acquire'):
        raise AttributeError("%r has no method 'acquire'" % lock)
    return synchronized(obj, lock, ctx=ctx)

def copy(obj):
    new_obj = _new_value(type(obj))
    ctypes.pointer(new_obj)[0] = obj
    return new_obj

def synchronized(obj, lock=None, ctx=None):
    assert not isinstance(obj, SynchronizedBase), 'object already synchronized'
    ctx = ctx or get_context()

    if isinstance(obj, ctypes._SimpleCData):
        return Synchronized(obj, lock, ctx)
    elif isinstance(obj, ctypes.Array):
        if obj._type_ is ctypes.c_char:
            return SynchronizedString(obj, lock, ctx)
        return SynchronizedArray(obj, lock, ctx)
    else:
        cls = type(obj)
        try:
            scls = class_cache[cls]
        except KeyError:
            names = [field[0] for field in cls._fields_]
            d = {name: make_property(name) for name in names}
            classname = 'Synchronized' + cls.__name__
            scls = class_cache[cls] = type(classname, (SynchronizedBase,), d)
        return scls(obj, lock, ctx)

#
# Functions for pickling/unpickling
#

def reduce_ctype(obj):
    assert_spawning(obj)
    if isinstance(obj, ctypes.Array):
        return rebuild_ctype, (obj._type_, obj._wrapper, obj._length_)
    else:
        return rebuild_ctype, (type(obj), obj._wrapper, None)

def rebuild_ctype(type_, wrapper, length):
    if length is not None:
        type_ = type_ * length
    _ForkingPickler.register(type_, reduce_ctype)
    buf = wrapper.create_memoryview()
    obj = type_.from_buffer(buf)
    obj._wrapper = wrapper
    return obj

#
# Function to create properties
#

def make_property(name):
    try:
        return prop_cache[name]
    except KeyError:
        d = {}
        exec(template % ((name,)*7), d)
        prop_cache[name] = d[name]
        return d[name]

template = '''
def get%s(self):
    self.acquire()
    try:
        return self._obj.%s
    finally:
        self.release()
def set%s(self, value):
    self.acquire()
    try:
        self._obj.%s = value
    finally:
        self.release()
%s = property(get%s, set%s)
'''

prop_cache = {}
class_cache = weakref.WeakKeyDictionary()

#
# Synchronized wrappers
#

class SynchronizedBase(object):

    def __init__(self, obj, lock=None, ctx=None):
        self._obj = obj
        if lock:
            self._lock = lock
        else:
            ctx = ctx or get_context(force=True)
            self._lock = ctx.RLock()
        self.acquire = self._lock.acquire
        self.release = self._lock.release

    def __enter__(self):
        return self._lock.__enter__()

    def __exit__(self, *args):
        return self._lock.__exit__(*args)

    def __reduce__(self):
        assert_spawning(self)
        return synchronized, (self._obj, self._lock)

    def get_obj(self):
        return self._obj

    def get_lock(self):
        return self._lock

    def __repr__(self):
        return '<%s wrapper for %s>' % (type(self).__name__, self._obj)


class Synchronized(SynchronizedBase):
    value = make_property('value')


class SynchronizedArray(SynchronizedBase):

    def __len__(self):
        return len(self._obj)

    def __getitem__(self, i):
        with self:
            return self._obj[i]

    def __setitem__(self, i, value):
        with self:
            self._obj[i] = value

    def __getslice__(self, start, stop):
        with self:
            return self._obj[start:stop]

    def __setslice__(self, start, stop, values):
        with self:
            self._obj[start:stop] = values


class SynchronizedString(SynchronizedArray):
    value = make_property('value')
    raw = make_property('raw')
enum.py000064400000112370151153537440006076 0ustar00import sys
from types import MappingProxyType, DynamicClassAttribute


__all__ = [
        'EnumMeta',
        'Enum', 'IntEnum', 'Flag', 'IntFlag',
        'auto', 'unique',
        ]


def _is_descriptor(obj):
    """
    Returns True if obj is a descriptor, False otherwise.
    """
    return (
            hasattr(obj, '__get__') or
            hasattr(obj, '__set__') or
            hasattr(obj, '__delete__')
            )

def _is_dunder(name):
    """
    Returns True if a __dunder__ name, False otherwise.
    """
    return (
            len(name) > 4 and
            name[:2] == name[-2:] == '__' and
            name[2] != '_' and
            name[-3] != '_'
            )

def _is_sunder(name):
    """
    Returns True if a _sunder_ name, False otherwise.
    """
    return (
            len(name) > 2 and
            name[0] == name[-1] == '_' and
            name[1:2] != '_' and
            name[-2:-1] != '_'
            )

def _make_class_unpicklable(cls):
    """
    Make the given class un-picklable.
    """
    def _break_on_call_reduce(self, proto):
        raise TypeError('%r cannot be pickled' % self)
    cls.__reduce_ex__ = _break_on_call_reduce
    cls.__module__ = '<unknown>'

_auto_null = object()
class auto:
    """
    Instances are replaced with an appropriate value in Enum class suites.
    """
    value = _auto_null


class _EnumDict(dict):
    """
    Track enum member order and ensure member names are not reused.

    EnumMeta will use the names found in self._member_names as the
    enumeration member names.
    """
    def __init__(self):
        super().__init__()
        self._member_names = []
        self._last_values = []
        self._ignore = []
        self._auto_called = False

    def __setitem__(self, key, value):
        """
        Changes anything not dundered or not a descriptor.

        If an enum member name is used twice, an error is raised; duplicate
        values are not checked for.

        Single underscore (sunder) names are reserved.
        """
        if _is_sunder(key):
            if key not in (
                    '_order_', '_create_pseudo_member_',
                    '_generate_next_value_', '_missing_', '_ignore_',
                    ):
                raise ValueError('_names_ are reserved for future Enum use')
            if key == '_generate_next_value_':
                # check if members already defined as auto()
                if self._auto_called:
                    raise TypeError("_generate_next_value_ must be defined before members")
                setattr(self, '_generate_next_value', value)
            elif key == '_ignore_':
                if isinstance(value, str):
                    value = value.replace(',',' ').split()
                else:
                    value = list(value)
                self._ignore = value
                already = set(value) & set(self._member_names)
                if already:
                    raise ValueError(
                            '_ignore_ cannot specify already set names: %r'
                            % (already, )
                            )
        elif _is_dunder(key):
            if key == '__order__':
                key = '_order_'
        elif key in self._member_names:
            # descriptor overwriting an enum?
            raise TypeError('Attempted to reuse key: %r' % key)
        elif key in self._ignore:
            pass
        elif not _is_descriptor(value):
            if key in self:
                # enum overwriting a descriptor?
                raise TypeError('%r already defined as: %r' % (key, self[key]))
            if isinstance(value, auto):
                if value.value == _auto_null:
                    value.value = self._generate_next_value(
                            key,
                            1,
                            len(self._member_names),
                            self._last_values[:],
                            )
                    self._auto_called = True
                value = value.value
            self._member_names.append(key)
            self._last_values.append(value)
        super().__setitem__(key, value)


# Dummy value for Enum as EnumMeta explicitly checks for it, but of course
# until EnumMeta finishes running the first time the Enum class doesn't exist.
# This is also why there are checks in EnumMeta like `if Enum is not None`
Enum = None

class EnumMeta(type):
    """
    Metaclass for Enum
    """
    @classmethod
    def __prepare__(metacls, cls, bases):
        # check that previous enum members do not exist
        metacls._check_for_existing_members(cls, bases)
        # create the namespace dict
        enum_dict = _EnumDict()
        # inherit previous flags and _generate_next_value_ function
        member_type, first_enum = metacls._get_mixins_(cls, bases)
        if first_enum is not None:
            enum_dict['_generate_next_value_'] = getattr(
                    first_enum, '_generate_next_value_', None,
                    )
        return enum_dict

    def __new__(metacls, cls, bases, classdict):
        # an Enum class is final once enumeration items have been defined; it
        # cannot be mixed with other types (int, float, etc.) if it has an
        # inherited __new__ unless a new __new__ is defined (or the resulting
        # class will fail).
        #
        # remove any keys listed in _ignore_
        classdict.setdefault('_ignore_', []).append('_ignore_')
        ignore = classdict['_ignore_']
        for key in ignore:
            classdict.pop(key, None)
        member_type, first_enum = metacls._get_mixins_(cls, bases)
        __new__, save_new, use_args = metacls._find_new_(
                classdict, member_type, first_enum,
                )

        # save enum items into separate mapping so they don't get baked into
        # the new class
        enum_members = {k: classdict[k] for k in classdict._member_names}
        for name in classdict._member_names:
            del classdict[name]

        # adjust the sunders
        _order_ = classdict.pop('_order_', None)

        # check for illegal enum names (any others?)
        invalid_names = set(enum_members) & {'mro', ''}
        if invalid_names:
            raise ValueError('Invalid enum member name: {0}'.format(
                ','.join(invalid_names)))

        # create a default docstring if one has not been provided
        if '__doc__' not in classdict:
            classdict['__doc__'] = 'An enumeration.'

        # create our new Enum type
        enum_class = super().__new__(metacls, cls, bases, classdict)
        enum_class._member_names_ = []               # names in definition order
        enum_class._member_map_ = {}                 # name->value map
        enum_class._member_type_ = member_type

        # save DynamicClassAttribute attributes from super classes so we know
        # if we can take the shortcut of storing members in the class dict
        dynamic_attributes = {
                k for c in enum_class.mro()
                for k, v in c.__dict__.items()
                if isinstance(v, DynamicClassAttribute)
                }

        # Reverse value->name map for hashable values.
        enum_class._value2member_map_ = {}

        # If a custom type is mixed into the Enum, and it does not know how
        # to pickle itself, pickle.dumps will succeed but pickle.loads will
        # fail.  Rather than have the error show up later and possibly far
        # from the source, sabotage the pickle protocol for this class so
        # that pickle.dumps also fails.
        #
        # However, if the new class implements its own __reduce_ex__, do not
        # sabotage -- it's on them to make sure it works correctly.  We use
        # __reduce_ex__ instead of any of the others as it is preferred by
        # pickle over __reduce__, and it handles all pickle protocols.
        if '__reduce_ex__' not in classdict:
            if member_type is not object:
                methods = ('__getnewargs_ex__', '__getnewargs__',
                        '__reduce_ex__', '__reduce__')
                if not any(m in member_type.__dict__ for m in methods):
                    _make_class_unpicklable(enum_class)

        # instantiate them, checking for duplicates as we go
        # we instantiate first instead of checking for duplicates first in case
        # a custom __new__ is doing something funky with the values -- such as
        # auto-numbering ;)
        for member_name in classdict._member_names:
            value = enum_members[member_name]
            if not isinstance(value, tuple):
                args = (value, )
            else:
                args = value
            if member_type is tuple:   # special case for tuple enums
                args = (args, )     # wrap it one more time
            if not use_args:
                enum_member = __new__(enum_class)
                if not hasattr(enum_member, '_value_'):
                    enum_member._value_ = value
            else:
                enum_member = __new__(enum_class, *args)
                if not hasattr(enum_member, '_value_'):
                    if member_type is object:
                        enum_member._value_ = value
                    else:
                        enum_member._value_ = member_type(*args)
            value = enum_member._value_
            enum_member._name_ = member_name
            enum_member.__objclass__ = enum_class
            enum_member.__init__(*args)
            # If another member with the same value was already defined, the
            # new member becomes an alias to the existing one.
            for name, canonical_member in enum_class._member_map_.items():
                if canonical_member._value_ == enum_member._value_:
                    enum_member = canonical_member
                    break
            else:
                # Aliases don't appear in member names (only in __members__).
                enum_class._member_names_.append(member_name)
            # performance boost for any member that would not shadow
            # a DynamicClassAttribute
            if member_name not in dynamic_attributes:
                setattr(enum_class, member_name, enum_member)
            # now add to _member_map_
            enum_class._member_map_[member_name] = enum_member
            try:
                # This may fail if value is not hashable. We can't add the value
                # to the map, and by-value lookups for this value will be
                # linear.
                enum_class._value2member_map_[value] = enum_member
            except TypeError:
                pass

        # double check that repr and friends are not the mixin's or various
        # things break (such as pickle)
        # however, if the method is defined in the Enum itself, don't replace
        # it
        for name in ('__repr__', '__str__', '__format__', '__reduce_ex__'):
            if name in classdict:
                continue
            class_method = getattr(enum_class, name)
            obj_method = getattr(member_type, name, None)
            enum_method = getattr(first_enum, name, None)
            if obj_method is not None and obj_method is class_method:
                setattr(enum_class, name, enum_method)

        # replace any other __new__ with our own (as long as Enum is not None,
        # anyway) -- again, this is to support pickle
        if Enum is not None:
            # if the user defined their own __new__, save it before it gets
            # clobbered in case they subclass later
            if save_new:
                enum_class.__new_member__ = __new__
            enum_class.__new__ = Enum.__new__

        # py3 support for definition order (helps keep py2/py3 code in sync)
        if _order_ is not None:
            if isinstance(_order_, str):
                _order_ = _order_.replace(',', ' ').split()
            if _order_ != enum_class._member_names_:
                raise TypeError('member order does not match _order_')

        return enum_class

    def __bool__(self):
        """
        classes/types should always be True.
        """
        return True

    def __call__(cls, value, names=None, *, module=None, qualname=None, type=None, start=1):
        """
        Either returns an existing member, or creates a new enum class.

        This method is used both when an enum class is given a value to match
        to an enumeration member (i.e. Color(3)) and for the functional API
        (i.e. Color = Enum('Color', names='RED GREEN BLUE')).

        When used for the functional API:

        `value` will be the name of the new class.

        `names` should be either a string of white-space/comma delimited names
        (values will start at `start`), or an iterator/mapping of name, value pairs.

        `module` should be set to the module this class is being created in;
        if it is not set, an attempt to find that module will be made, but if
        it fails the class will not be picklable.

        `qualname` should be set to the actual location this class can be found
        at in its module; by default it is set to the global scope.  If this is
        not correct, unpickling will fail in some circumstances.

        `type`, if set, will be mixed in as the first base class.
        """
        if names is None:  # simple value lookup
            return cls.__new__(cls, value)
        # otherwise, functional API: we're creating a new Enum type
        return cls._create_(
                value,
                names,
                module=module,
                qualname=qualname,
                type=type,
                start=start,
                )

    def __contains__(cls, member):
        if not isinstance(member, Enum):
            raise TypeError(
                "unsupported operand type(s) for 'in': '%s' and '%s'" % (
                    type(member).__qualname__, cls.__class__.__qualname__))
        return isinstance(member, cls) and member._name_ in cls._member_map_

    def __delattr__(cls, attr):
        # nicer error message when someone tries to delete an attribute
        # (see issue19025).
        if attr in cls._member_map_:
            raise AttributeError("%s: cannot delete Enum member." % cls.__name__)
        super().__delattr__(attr)

    def __dir__(self):
        return (
                ['__class__', '__doc__', '__members__', '__module__']
                + self._member_names_
                )

    def __getattr__(cls, name):
        """
        Return the enum member matching `name`

        We use __getattr__ instead of descriptors or inserting into the enum
        class' __dict__ in order to support `name` and `value` being both
        properties for enum members (which live in the class' __dict__) and
        enum members themselves.
        """
        if _is_dunder(name):
            raise AttributeError(name)
        try:
            return cls._member_map_[name]
        except KeyError:
            raise AttributeError(name) from None

    def __getitem__(cls, name):
        return cls._member_map_[name]

    def __iter__(cls):
        """
        Returns members in definition order.
        """
        return (cls._member_map_[name] for name in cls._member_names_)

    def __len__(cls):
        return len(cls._member_names_)

    @property
    def __members__(cls):
        """
        Returns a mapping of member name->value.

        This mapping lists all enum members, including aliases. Note that this
        is a read-only view of the internal mapping.
        """
        return MappingProxyType(cls._member_map_)

    def __repr__(cls):
        return "<enum %r>" % cls.__name__

    def __reversed__(cls):
        """
        Returns members in reverse definition order.
        """
        return (cls._member_map_[name] for name in reversed(cls._member_names_))

    def __setattr__(cls, name, value):
        """
        Block attempts to reassign Enum members.

        A simple assignment to the class namespace only changes one of the
        several possible ways to get an Enum member from the Enum class,
        resulting in an inconsistent Enumeration.
        """
        member_map = cls.__dict__.get('_member_map_', {})
        if name in member_map:
            raise AttributeError('Cannot reassign members.')
        super().__setattr__(name, value)

    def _create_(cls, class_name, names, *, module=None, qualname=None, type=None, start=1):
        """
        Convenience method to create a new Enum class.

        `names` can be:

        * A string containing member names, separated either with spaces or
          commas.  Values are incremented by 1 from `start`.
        * An iterable of member names.  Values are incremented by 1 from `start`.
        * An iterable of (member name, value) pairs.
        * A mapping of member name -> value pairs.
        """
        metacls = cls.__class__
        bases = (cls, ) if type is None else (type, cls)
        _, first_enum = cls._get_mixins_(cls, bases)
        classdict = metacls.__prepare__(class_name, bases)

        # special processing needed for names?
        if isinstance(names, str):
            names = names.replace(',', ' ').split()
        if isinstance(names, (tuple, list)) and names and isinstance(names[0], str):
            original_names, names = names, []
            last_values = []
            for count, name in enumerate(original_names):
                value = first_enum._generate_next_value_(name, start, count, last_values[:])
                last_values.append(value)
                names.append((name, value))

        # Here, names is either an iterable of (name, value) or a mapping.
        for item in names:
            if isinstance(item, str):
                member_name, member_value = item, names[item]
            else:
                member_name, member_value = item
            classdict[member_name] = member_value
        enum_class = metacls.__new__(metacls, class_name, bases, classdict)

        # TODO: replace the frame hack if a blessed way to know the calling
        # module is ever developed
        if module is None:
            try:
                module = sys._getframe(2).f_globals['__name__']
            except (AttributeError, ValueError, KeyError) as exc:
                pass
        if module is None:
            _make_class_unpicklable(enum_class)
        else:
            enum_class.__module__ = module
        if qualname is not None:
            enum_class.__qualname__ = qualname

        return enum_class

    def _convert_(cls, name, module, filter, source=None):
        """
        Create a new Enum subclass that replaces a collection of global constants
        """
        # convert all constants from source (or module) that pass filter() to
        # a new Enum called name, and export the enum and its members back to
        # module;
        # also, replace the __reduce_ex__ method so unpickling works in
        # previous Python versions
        module_globals = vars(sys.modules[module])
        if source:
            source = vars(source)
        else:
            source = module_globals
        # _value2member_map_ is populated in the same order every time
        # for a consistent reverse mapping of number to name when there
        # are multiple names for the same number.
        members = [
                (name, value)
                for name, value in source.items()
                if filter(name)]
        try:
            # sort by value
            members.sort(key=lambda t: (t[1], t[0]))
        except TypeError:
            # unless some values aren't comparable, in which case sort by name
            members.sort(key=lambda t: t[0])
        cls = cls(name, members, module=module)
        cls.__reduce_ex__ = _reduce_ex_by_name
        module_globals.update(cls.__members__)
        module_globals[name] = cls
        return cls

    def _convert(cls, *args, **kwargs):
        import warnings
        warnings.warn("_convert is deprecated and will be removed in 3.9, use "
                      "_convert_ instead.", DeprecationWarning, stacklevel=2)
        return cls._convert_(*args, **kwargs)

    @staticmethod
    def _check_for_existing_members(class_name, bases):
        for chain in bases:
            for base in chain.__mro__:
                if issubclass(base, Enum) and base._member_names_:
                    raise TypeError(
                            "%s: cannot extend enumeration %r"
                            % (class_name, base.__name__)
                            )

    @staticmethod
    def _get_mixins_(class_name, bases):
        """
        Returns the type for creating enum members, and the first inherited
        enum class.

        bases: the tuple of bases that was given to __new__
        """
        if not bases:
            return object, Enum

        def _find_data_type(bases):
            data_types = []
            for chain in bases:
                candidate = None
                for base in chain.__mro__:
                    if base is object:
                        continue
                    elif issubclass(base, Enum):
                        if base._member_type_ is not object:
                            data_types.append(base._member_type_)
                            break
                    elif '__new__' in base.__dict__:
                        if issubclass(base, Enum):
                            continue
                        data_types.append(candidate or base)
                        break
                    else:
                        candidate = base
            if len(data_types) > 1:
                raise TypeError('%r: too many data types: %r' % (class_name, data_types))
            elif data_types:
                return data_types[0]
            else:
                return None

        # ensure final parent class is an Enum derivative, find any concrete
        # data type, and check that Enum has no members
        first_enum = bases[-1]
        if not issubclass(first_enum, Enum):
            raise TypeError("new enumerations should be created as "
                    "`EnumName([mixin_type, ...] [data_type,] enum_type)`")
        member_type = _find_data_type(bases) or object
        if first_enum._member_names_:
            raise TypeError("Cannot extend enumerations")
        return member_type, first_enum

    @staticmethod
    def _find_new_(classdict, member_type, first_enum):
        """
        Returns the __new__ to be used for creating the enum members.

        classdict: the class dictionary given to __new__
        member_type: the data type whose __new__ will be used by default
        first_enum: enumeration to check for an overriding __new__
        """
        # now find the correct __new__, checking to see of one was defined
        # by the user; also check earlier enum classes in case a __new__ was
        # saved as __new_member__
        __new__ = classdict.get('__new__', None)

        # should __new__ be saved as __new_member__ later?
        save_new = __new__ is not None

        if __new__ is None:
            # check all possibles for __new_member__ before falling back to
            # __new__
            for method in ('__new_member__', '__new__'):
                for possible in (member_type, first_enum):
                    target = getattr(possible, method, None)
                    if target not in {
                            None,
                            None.__new__,
                            object.__new__,
                            Enum.__new__,
                            }:
                        __new__ = target
                        break
                if __new__ is not None:
                    break
            else:
                __new__ = object.__new__

        # if a non-object.__new__ is used then whatever value/tuple was
        # assigned to the enum member name will be passed to __new__ and to the
        # new enum member's __init__
        if __new__ is object.__new__:
            use_args = False
        else:
            use_args = True
        return __new__, save_new, use_args


class Enum(metaclass=EnumMeta):
    """
    Generic enumeration.

    Derive from this class to define new enumerations.
    """
    def __new__(cls, value):
        # all enum instances are actually created during class construction
        # without calling this method; this method is called by the metaclass'
        # __call__ (i.e. Color(3) ), and by pickle
        if type(value) is cls:
            # For lookups like Color(Color.RED)
            return value
        # by-value search for a matching enum member
        # see if it's in the reverse mapping (for hashable values)
        try:
            return cls._value2member_map_[value]
        except KeyError:
            # Not found, no need to do long O(n) search
            pass
        except TypeError:
            # not there, now do long search -- O(n) behavior
            for member in cls._member_map_.values():
                if member._value_ == value:
                    return member
        # still not found -- try _missing_ hook
        try:
            exc = None
            result = cls._missing_(value)
        except Exception as e:
            exc = e
            result = None
        try:
            if isinstance(result, cls):
                return result
            else:
                ve_exc = ValueError("%r is not a valid %s" % (value, cls.__name__))
                if result is None and exc is None:
                    raise ve_exc
                elif exc is None:
                    exc = TypeError(
                            'error in %s._missing_: returned %r instead of None or a valid member'
                            % (cls.__name__, result)
                            )
                exc.__context__ = ve_exc
                raise exc
        finally:
            # ensure all variables that could hold an exception are destroyed
            exc = None
            ve_exc = None

    def _generate_next_value_(name, start, count, last_values):
        """
        Generate the next value when not given.

        name: the name of the member
        start: the initial start value or None
        count: the number of existing members
        last_value: the last value assigned or None
        """
        for last_value in reversed(last_values):
            try:
                return last_value + 1
            except TypeError:
                pass
        else:
            return start

    @classmethod
    def _missing_(cls, value):
        return None

    def __repr__(self):
        return "<%s.%s: %r>" % (
                self.__class__.__name__, self._name_, self._value_)

    def __str__(self):
        return "%s.%s" % (self.__class__.__name__, self._name_)

    def __dir__(self):
        """
        Returns all members and all public methods
        """
        added_behavior = [
                m
                for cls in self.__class__.mro()
                for m in cls.__dict__
                if m[0] != '_' and m not in self._member_map_
                ] + [m for m in self.__dict__ if m[0] != '_']
        return (['__class__', '__doc__', '__module__'] + added_behavior)

    def __format__(self, format_spec):
        """
        Returns format using actual value type unless __str__ has been overridden.
        """
        # mixed-in Enums should use the mixed-in type's __format__, otherwise
        # we can get strange results with the Enum name showing up instead of
        # the value

        # pure Enum branch, or branch with __str__ explicitly overridden
        str_overridden = type(self).__str__ not in (Enum.__str__, Flag.__str__)
        if self._member_type_ is object or str_overridden:
            cls = str
            val = str(self)
        # mix-in branch
        else:
            cls = self._member_type_
            val = self._value_
        return cls.__format__(val, format_spec)

    def __hash__(self):
        return hash(self._name_)

    def __reduce_ex__(self, proto):
        return self.__class__, (self._value_, )

    # DynamicClassAttribute is used to provide access to the `name` and
    # `value` properties of enum members while keeping some measure of
    # protection from modification, while still allowing for an enumeration
    # to have members named `name` and `value`.  This works because enumeration
    # members are not set directly on the enum class -- __getattr__ is
    # used to look them up.

    @DynamicClassAttribute
    def name(self):
        """The name of the Enum member."""
        return self._name_

    @DynamicClassAttribute
    def value(self):
        """The value of the Enum member."""
        return self._value_


class IntEnum(int, Enum):
    """Enum where members are also (and must be) ints"""


def _reduce_ex_by_name(self, proto):
    return self.name

class Flag(Enum):
    """
    Support for flags
    """

    def _generate_next_value_(name, start, count, last_values):
        """
        Generate the next value when not given.

        name: the name of the member
        start: the initial start value or None
        count: the number of existing members
        last_value: the last value assigned or None
        """
        if not count:
            return start if start is not None else 1
        for last_value in reversed(last_values):
            try:
                high_bit = _high_bit(last_value)
                break
            except Exception:
                raise TypeError('Invalid Flag value: %r' % last_value) from None
        return 2 ** (high_bit+1)

    @classmethod
    def _missing_(cls, value):
        """
        Returns member (possibly creating it) if one can be found for value.
        """
        original_value = value
        if value < 0:
            value = ~value
        possible_member = cls._create_pseudo_member_(value)
        if original_value < 0:
            possible_member = ~possible_member
        return possible_member

    @classmethod
    def _create_pseudo_member_(cls, value):
        """
        Create a composite member iff value contains only members.
        """
        pseudo_member = cls._value2member_map_.get(value, None)
        if pseudo_member is None:
            # verify all bits are accounted for
            _, extra_flags = _decompose(cls, value)
            if extra_flags:
                raise ValueError("%r is not a valid %s" % (value, cls.__name__))
            # construct a singleton enum pseudo-member
            pseudo_member = object.__new__(cls)
            pseudo_member._name_ = None
            pseudo_member._value_ = value
            # use setdefault in case another thread already created a composite
            # with this value
            pseudo_member = cls._value2member_map_.setdefault(value, pseudo_member)
        return pseudo_member

    def __contains__(self, other):
        """
        Returns True if self has at least the same flags set as other.
        """
        if not isinstance(other, self.__class__):
            raise TypeError(
                "unsupported operand type(s) for 'in': '%s' and '%s'" % (
                    type(other).__qualname__, self.__class__.__qualname__))
        return other._value_ & self._value_ == other._value_

    def __repr__(self):
        cls = self.__class__
        if self._name_ is not None:
            return '<%s.%s: %r>' % (cls.__name__, self._name_, self._value_)
        members, uncovered = _decompose(cls, self._value_)
        return '<%s.%s: %r>' % (
                cls.__name__,
                '|'.join([str(m._name_ or m._value_) for m in members]),
                self._value_,
                )

    def __str__(self):
        cls = self.__class__
        if self._name_ is not None:
            return '%s.%s' % (cls.__name__, self._name_)
        members, uncovered = _decompose(cls, self._value_)
        if len(members) == 1 and members[0]._name_ is None:
            return '%s.%r' % (cls.__name__, members[0]._value_)
        else:
            return '%s.%s' % (
                    cls.__name__,
                    '|'.join([str(m._name_ or m._value_) for m in members]),
                    )

    def __bool__(self):
        return bool(self._value_)

    def __or__(self, other):
        if not isinstance(other, self.__class__):
            return NotImplemented
        return self.__class__(self._value_ | other._value_)

    def __and__(self, other):
        if not isinstance(other, self.__class__):
            return NotImplemented
        return self.__class__(self._value_ & other._value_)

    def __xor__(self, other):
        if not isinstance(other, self.__class__):
            return NotImplemented
        return self.__class__(self._value_ ^ other._value_)

    def __invert__(self):
        members, uncovered = _decompose(self.__class__, self._value_)
        inverted = self.__class__(0)
        for m in self.__class__:
            if m not in members and not (m._value_ & self._value_):
                inverted = inverted | m
        return self.__class__(inverted)


class IntFlag(int, Flag):
    """
    Support for integer-based Flags
    """

    @classmethod
    def _missing_(cls, value):
        """
        Returns member (possibly creating it) if one can be found for value.
        """
        if not isinstance(value, int):
            raise ValueError("%r is not a valid %s" % (value, cls.__name__))
        new_member = cls._create_pseudo_member_(value)
        return new_member

    @classmethod
    def _create_pseudo_member_(cls, value):
        """
        Create a composite member iff value contains only members.
        """
        pseudo_member = cls._value2member_map_.get(value, None)
        if pseudo_member is None:
            need_to_create = [value]
            # get unaccounted for bits
            _, extra_flags = _decompose(cls, value)
            # timer = 10
            while extra_flags:
                # timer -= 1
                bit = _high_bit(extra_flags)
                flag_value = 2 ** bit
                if (flag_value not in cls._value2member_map_ and
                        flag_value not in need_to_create
                        ):
                    need_to_create.append(flag_value)
                if extra_flags == -flag_value:
                    extra_flags = 0
                else:
                    extra_flags ^= flag_value
            for value in reversed(need_to_create):
                # construct singleton pseudo-members
                pseudo_member = int.__new__(cls, value)
                pseudo_member._name_ = None
                pseudo_member._value_ = value
                # use setdefault in case another thread already created a composite
                # with this value
                pseudo_member = cls._value2member_map_.setdefault(value, pseudo_member)
        return pseudo_member

    def __or__(self, other):
        if not isinstance(other, (self.__class__, int)):
            return NotImplemented
        result = self.__class__(self._value_ | self.__class__(other)._value_)
        return result

    def __and__(self, other):
        if not isinstance(other, (self.__class__, int)):
            return NotImplemented
        return self.__class__(self._value_ & self.__class__(other)._value_)

    def __xor__(self, other):
        if not isinstance(other, (self.__class__, int)):
            return NotImplemented
        return self.__class__(self._value_ ^ self.__class__(other)._value_)

    __ror__ = __or__
    __rand__ = __and__
    __rxor__ = __xor__

    def __invert__(self):
        result = self.__class__(~self._value_)
        return result


def _high_bit(value):
    """
    returns index of highest bit, or -1 if value is zero or negative
    """
    return value.bit_length() - 1

def unique(enumeration):
    """
    Class decorator for enumerations ensuring unique member values.
    """
    duplicates = []
    for name, member in enumeration.__members__.items():
        if name != member.name:
            duplicates.append((name, member.name))
    if duplicates:
        alias_details = ', '.join(
                ["%s -> %s" % (alias, name) for (alias, name) in duplicates])
        raise ValueError('duplicate values found in %r: %s' %
                (enumeration, alias_details))
    return enumeration

def _decompose(flag, value):
    """
    Extract all members from the value.
    """
    # _decompose is only called if the value is not named
    not_covered = value
    negative = value < 0
    # issue29167: wrap accesses to _value2member_map_ in a list to avoid race
    #             conditions between iterating over it and having more pseudo-
    #             members added to it
    if negative:
        # only check for named flags
        flags_to_check = [
                (m, v)
                for v, m in list(flag._value2member_map_.items())
                if m.name is not None
                ]
    else:
        # check for named flags and powers-of-two flags
        flags_to_check = [
                (m, v)
                for v, m in list(flag._value2member_map_.items())
                if m.name is not None or _power_of_two(v)
                ]
    members = []
    for member, member_value in flags_to_check:
        if member_value and member_value & value == member_value:
            members.append(member)
            not_covered &= ~member_value
    if not members and value in flag._value2member_map_:
        members.append(flag._value2member_map_[value])
    members.sort(key=lambda m: m._value_, reverse=True)
    if len(members) > 1 and members[0].value == value:
        # we have the breakdown, don't need the value member itself
        members.pop(0)
    return members, not_covered

def _power_of_two(value):
    if value < 1:
        return False
    return value == 2 ** _high_bit(value)
asynchat.py000064400000026100151153537440006737 0ustar00# -*- Mode: Python; tab-width: 4 -*-
#       Id: asynchat.py,v 2.26 2000/09/07 22:29:26 rushing Exp
#       Author: Sam Rushing <rushing@nightmare.com>

# ======================================================================
# Copyright 1996 by Sam Rushing
#
#                         All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee is hereby
# granted, provided that the above copyright notice appear in all
# copies and that both that copyright notice and this permission
# notice appear in supporting documentation, and that the name of Sam
# Rushing not be used in advertising or publicity pertaining to
# distribution of the software without specific, written prior
# permission.
#
# SAM RUSHING DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
# NO EVENT SHALL SAM RUSHING BE LIABLE FOR ANY SPECIAL, INDIRECT OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
# OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# ======================================================================

r"""A class supporting chat-style (command/response) protocols.

This class adds support for 'chat' style protocols - where one side
sends a 'command', and the other sends a response (examples would be
the common internet protocols - smtp, nntp, ftp, etc..).

The handle_read() method looks at the input stream for the current
'terminator' (usually '\r\n' for single-line responses, '\r\n.\r\n'
for multi-line output), calling self.found_terminator() on its
receipt.

for example:
Say you build an async nntp client using this class.  At the start
of the connection, you'll have self.terminator set to '\r\n', in
order to process the single-line greeting.  Just before issuing a
'LIST' command you'll set it to '\r\n.\r\n'.  The output of the LIST
command will be accumulated (using your own 'collect_incoming_data'
method) up to the terminator, and then control will be returned to
you - by calling your self.found_terminator() method.
"""
import asyncore
from collections import deque


class async_chat(asyncore.dispatcher):
    """This is an abstract class.  You must derive from this class, and add
    the two methods collect_incoming_data() and found_terminator()"""

    # these are overridable defaults

    ac_in_buffer_size = 65536
    ac_out_buffer_size = 65536

    # we don't want to enable the use of encoding by default, because that is a
    # sign of an application bug that we don't want to pass silently

    use_encoding = 0
    encoding = 'latin-1'

    def __init__(self, sock=None, map=None):
        # for string terminator matching
        self.ac_in_buffer = b''

        # we use a list here rather than io.BytesIO for a few reasons...
        # del lst[:] is faster than bio.truncate(0)
        # lst = [] is faster than bio.truncate(0)
        self.incoming = []

        # we toss the use of the "simple producer" and replace it with
        # a pure deque, which the original fifo was a wrapping of
        self.producer_fifo = deque()
        asyncore.dispatcher.__init__(self, sock, map)

    def collect_incoming_data(self, data):
        raise NotImplementedError("must be implemented in subclass")

    def _collect_incoming_data(self, data):
        self.incoming.append(data)

    def _get_data(self):
        d = b''.join(self.incoming)
        del self.incoming[:]
        return d

    def found_terminator(self):
        raise NotImplementedError("must be implemented in subclass")

    def set_terminator(self, term):
        """Set the input delimiter.

        Can be a fixed string of any length, an integer, or None.
        """
        if isinstance(term, str) and self.use_encoding:
            term = bytes(term, self.encoding)
        elif isinstance(term, int) and term < 0:
            raise ValueError('the number of received bytes must be positive')
        self.terminator = term

    def get_terminator(self):
        return self.terminator

    # grab some more data from the socket,
    # throw it to the collector method,
    # check for the terminator,
    # if found, transition to the next state.

    def handle_read(self):

        try:
            data = self.recv(self.ac_in_buffer_size)
        except BlockingIOError:
            return
        except OSError as why:
            self.handle_error()
            return

        if isinstance(data, str) and self.use_encoding:
            data = bytes(str, self.encoding)
        self.ac_in_buffer = self.ac_in_buffer + data

        # Continue to search for self.terminator in self.ac_in_buffer,
        # while calling self.collect_incoming_data.  The while loop
        # is necessary because we might read several data+terminator
        # combos with a single recv(4096).

        while self.ac_in_buffer:
            lb = len(self.ac_in_buffer)
            terminator = self.get_terminator()
            if not terminator:
                # no terminator, collect it all
                self.collect_incoming_data(self.ac_in_buffer)
                self.ac_in_buffer = b''
            elif isinstance(terminator, int):
                # numeric terminator
                n = terminator
                if lb < n:
                    self.collect_incoming_data(self.ac_in_buffer)
                    self.ac_in_buffer = b''
                    self.terminator = self.terminator - lb
                else:
                    self.collect_incoming_data(self.ac_in_buffer[:n])
                    self.ac_in_buffer = self.ac_in_buffer[n:]
                    self.terminator = 0
                    self.found_terminator()
            else:
                # 3 cases:
                # 1) end of buffer matches terminator exactly:
                #    collect data, transition
                # 2) end of buffer matches some prefix:
                #    collect data to the prefix
                # 3) end of buffer does not match any prefix:
                #    collect data
                terminator_len = len(terminator)
                index = self.ac_in_buffer.find(terminator)
                if index != -1:
                    # we found the terminator
                    if index > 0:
                        # don't bother reporting the empty string
                        # (source of subtle bugs)
                        self.collect_incoming_data(self.ac_in_buffer[:index])
                    self.ac_in_buffer = self.ac_in_buffer[index+terminator_len:]
                    # This does the Right Thing if the terminator
                    # is changed here.
                    self.found_terminator()
                else:
                    # check for a prefix of the terminator
                    index = find_prefix_at_end(self.ac_in_buffer, terminator)
                    if index:
                        if index != lb:
                            # we found a prefix, collect up to the prefix
                            self.collect_incoming_data(self.ac_in_buffer[:-index])
                            self.ac_in_buffer = self.ac_in_buffer[-index:]
                        break
                    else:
                        # no prefix, collect it all
                        self.collect_incoming_data(self.ac_in_buffer)
                        self.ac_in_buffer = b''

    def handle_write(self):
        self.initiate_send()

    def handle_close(self):
        self.close()

    def push(self, data):
        if not isinstance(data, (bytes, bytearray, memoryview)):
            raise TypeError('data argument must be byte-ish (%r)',
                            type(data))
        sabs = self.ac_out_buffer_size
        if len(data) > sabs:
            for i in range(0, len(data), sabs):
                self.producer_fifo.append(data[i:i+sabs])
        else:
            self.producer_fifo.append(data)
        self.initiate_send()

    def push_with_producer(self, producer):
        self.producer_fifo.append(producer)
        self.initiate_send()

    def readable(self):
        "predicate for inclusion in the readable for select()"
        # cannot use the old predicate, it violates the claim of the
        # set_terminator method.

        # return (len(self.ac_in_buffer) <= self.ac_in_buffer_size)
        return 1

    def writable(self):
        "predicate for inclusion in the writable for select()"
        return self.producer_fifo or (not self.connected)

    def close_when_done(self):
        "automatically close this channel once the outgoing queue is empty"
        self.producer_fifo.append(None)

    def initiate_send(self):
        while self.producer_fifo and self.connected:
            first = self.producer_fifo[0]
            # handle empty string/buffer or None entry
            if not first:
                del self.producer_fifo[0]
                if first is None:
                    self.handle_close()
                    return

            # handle classic producer behavior
            obs = self.ac_out_buffer_size
            try:
                data = first[:obs]
            except TypeError:
                data = first.more()
                if data:
                    self.producer_fifo.appendleft(data)
                else:
                    del self.producer_fifo[0]
                continue

            if isinstance(data, str) and self.use_encoding:
                data = bytes(data, self.encoding)

            # send the data
            try:
                num_sent = self.send(data)
            except OSError:
                self.handle_error()
                return

            if num_sent:
                if num_sent < len(data) or obs < len(first):
                    self.producer_fifo[0] = first[num_sent:]
                else:
                    del self.producer_fifo[0]
            # we tried to send some actual data
            return

    def discard_buffers(self):
        # Emergencies only!
        self.ac_in_buffer = b''
        del self.incoming[:]
        self.producer_fifo.clear()


class simple_producer:

    def __init__(self, data, buffer_size=512):
        self.data = data
        self.buffer_size = buffer_size

    def more(self):
        if len(self.data) > self.buffer_size:
            result = self.data[:self.buffer_size]
            self.data = self.data[self.buffer_size:]
            return result
        else:
            result = self.data
            self.data = b''
            return result


# Given 'haystack', see if any prefix of 'needle' is at its end.  This
# assumes an exact match has already been checked.  Return the number of
# characters matched.
# for example:
# f_p_a_e("qwerty\r", "\r\n") => 1
# f_p_a_e("qwertydkjf", "\r\n") => 0
# f_p_a_e("qwerty\r\n", "\r\n") => <undefined>

# this could maybe be made faster with a computed regex?
# [answer: no; circa Python-2.0, Jan 2001]
# new python:   28961/s
# old python:   18307/s
# re:        12820/s
# regex:     14035/s

def find_prefix_at_end(haystack, needle):
    l = len(needle) - 1
    while l and not haystack.endswith(needle[:l]):
        l -= 1
    return l
copyreg.py000064400000015737151153537440006613 0ustar00"""Helper to provide extensibility for pickle.

This is only useful to add pickle support for extension types defined in
C, not for instances of user-defined classes.
"""

__all__ = ["pickle", "constructor",
           "add_extension", "remove_extension", "clear_extension_cache"]

dispatch_table = {}

def pickle(ob_type, pickle_function, constructor_ob=None):
    if not callable(pickle_function):
        raise TypeError("reduction functions must be callable")
    dispatch_table[ob_type] = pickle_function

    # The constructor_ob function is a vestige of safe for unpickling.
    # There is no reason for the caller to pass it anymore.
    if constructor_ob is not None:
        constructor(constructor_ob)

def constructor(object):
    if not callable(object):
        raise TypeError("constructors must be callable")

# Example: provide pickling support for complex numbers.

try:
    complex
except NameError:
    pass
else:

    def pickle_complex(c):
        return complex, (c.real, c.imag)

    pickle(complex, pickle_complex, complex)

# Support for pickling new-style objects

def _reconstructor(cls, base, state):
    if base is object:
        obj = object.__new__(cls)
    else:
        obj = base.__new__(cls, state)
        if base.__init__ != object.__init__:
            base.__init__(obj, state)
    return obj

_HEAPTYPE = 1<<9

# Python code for object.__reduce_ex__ for protocols 0 and 1

def _reduce_ex(self, proto):
    assert proto < 2
    cls = self.__class__
    for base in cls.__mro__:
        if hasattr(base, '__flags__') and not base.__flags__ & _HEAPTYPE:
            break
    else:
        base = object # not really reachable
    if base is object:
        state = None
    else:
        if base is cls:
            raise TypeError(f"cannot pickle {cls.__name__!r} object")
        state = base(self)
    args = (cls, base, state)
    try:
        getstate = self.__getstate__
    except AttributeError:
        if getattr(self, "__slots__", None):
            raise TypeError(f"cannot pickle {cls.__name__!r} object: "
                            f"a class that defines __slots__ without "
                            f"defining __getstate__ cannot be pickled "
                            f"with protocol {proto}") from None
        try:
            dict = self.__dict__
        except AttributeError:
            dict = None
    else:
        dict = getstate()
    if dict:
        return _reconstructor, args, dict
    else:
        return _reconstructor, args

# Helper for __reduce_ex__ protocol 2

def __newobj__(cls, *args):
    return cls.__new__(cls, *args)

def __newobj_ex__(cls, args, kwargs):
    """Used by pickle protocol 4, instead of __newobj__ to allow classes with
    keyword-only arguments to be pickled correctly.
    """
    return cls.__new__(cls, *args, **kwargs)

def _slotnames(cls):
    """Return a list of slot names for a given class.

    This needs to find slots defined by the class and its bases, so we
    can't simply return the __slots__ attribute.  We must walk down
    the Method Resolution Order and concatenate the __slots__ of each
    class found there.  (This assumes classes don't modify their
    __slots__ attribute to misrepresent their slots after the class is
    defined.)
    """

    # Get the value from a cache in the class if possible
    names = cls.__dict__.get("__slotnames__")
    if names is not None:
        return names

    # Not cached -- calculate the value
    names = []
    if not hasattr(cls, "__slots__"):
        # This class has no slots
        pass
    else:
        # Slots found -- gather slot names from all base classes
        for c in cls.__mro__:
            if "__slots__" in c.__dict__:
                slots = c.__dict__['__slots__']
                # if class has a single slot, it can be given as a string
                if isinstance(slots, str):
                    slots = (slots,)
                for name in slots:
                    # special descriptors
                    if name in ("__dict__", "__weakref__"):
                        continue
                    # mangled names
                    elif name.startswith('__') and not name.endswith('__'):
                        stripped = c.__name__.lstrip('_')
                        if stripped:
                            names.append('_%s%s' % (stripped, name))
                        else:
                            names.append(name)
                    else:
                        names.append(name)

    # Cache the outcome in the class if at all possible
    try:
        cls.__slotnames__ = names
    except:
        pass # But don't die if we can't

    return names

# A registry of extension codes.  This is an ad-hoc compression
# mechanism.  Whenever a global reference to <module>, <name> is about
# to be pickled, the (<module>, <name>) tuple is looked up here to see
# if it is a registered extension code for it.  Extension codes are
# universal, so that the meaning of a pickle does not depend on
# context.  (There are also some codes reserved for local use that
# don't have this restriction.)  Codes are positive ints; 0 is
# reserved.

_extension_registry = {}                # key -> code
_inverted_registry = {}                 # code -> key
_extension_cache = {}                   # code -> object
# Don't ever rebind those names:  pickling grabs a reference to them when
# it's initialized, and won't see a rebinding.

def add_extension(module, name, code):
    """Register an extension code."""
    code = int(code)
    if not 1 <= code <= 0x7fffffff:
        raise ValueError("code out of range")
    key = (module, name)
    if (_extension_registry.get(key) == code and
        _inverted_registry.get(code) == key):
        return # Redundant registrations are benign
    if key in _extension_registry:
        raise ValueError("key %s is already registered with code %s" %
                         (key, _extension_registry[key]))
    if code in _inverted_registry:
        raise ValueError("code %s is already in use for key %s" %
                         (code, _inverted_registry[code]))
    _extension_registry[key] = code
    _inverted_registry[code] = key

def remove_extension(module, name, code):
    """Unregister an extension code.  For testing only."""
    key = (module, name)
    if (_extension_registry.get(key) != code or
        _inverted_registry.get(code) != key):
        raise ValueError("key %s is not registered with code %s" %
                         (key, code))
    del _extension_registry[key]
    del _inverted_registry[code]
    if code in _extension_cache:
        del _extension_cache[code]

def clear_extension_cache():
    _extension_cache.clear()

# Standard extension code assignments

# Reserved ranges

# First  Last Count  Purpose
#     1   127   127  Reserved for Python standard library
#   128   191    64  Reserved for Zope
#   192   239    48  Reserved for 3rd parties
#   240   255    16  Reserved for private use (will never be assigned)
#   256   Inf   Inf  Reserved for future assignment

# Extension codes are assigned by the Python Software Foundation.
uuid.py000064400000073463151153537440006111 0ustar00r"""UUID objects (universally unique identifiers) according to RFC 4122.

This module provides immutable UUID objects (class UUID) and the functions
uuid1(), uuid3(), uuid4(), uuid5() for generating version 1, 3, 4, and 5
UUIDs as specified in RFC 4122.

If all you want is a unique ID, you should probably call uuid1() or uuid4().
Note that uuid1() may compromise privacy since it creates a UUID containing
the computer's network address.  uuid4() creates a random UUID.

Typical usage:

    >>> import uuid

    # make a UUID based on the host ID and current time
    >>> uuid.uuid1()    # doctest: +SKIP
    UUID('a8098c1a-f86e-11da-bd1a-00112444be1e')

    # make a UUID using an MD5 hash of a namespace UUID and a name
    >>> uuid.uuid3(uuid.NAMESPACE_DNS, 'python.org')
    UUID('6fa459ea-ee8a-3ca4-894e-db77e160355e')

    # make a random UUID
    >>> uuid.uuid4()    # doctest: +SKIP
    UUID('16fd2706-8baf-433b-82eb-8c7fada847da')

    # make a UUID using a SHA-1 hash of a namespace UUID and a name
    >>> uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org')
    UUID('886313e1-3b8a-5372-9b90-0c9aee199e5d')

    # make a UUID from a string of hex digits (braces and hyphens ignored)
    >>> x = uuid.UUID('{00010203-0405-0607-0809-0a0b0c0d0e0f}')

    # convert a UUID to a string of hex digits in standard form
    >>> str(x)
    '00010203-0405-0607-0809-0a0b0c0d0e0f'

    # get the raw 16 bytes of the UUID
    >>> x.bytes
    b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f'

    # make a UUID from a 16-byte string
    >>> uuid.UUID(bytes=x.bytes)
    UUID('00010203-0405-0607-0809-0a0b0c0d0e0f')
"""

import os
import sys

from enum import Enum


__author__ = 'Ka-Ping Yee <ping@zesty.ca>'

# The recognized platforms - known behaviors
if sys.platform in ('win32', 'darwin'):
    _AIX = _LINUX = False
else:
    import platform
    _platform_system = platform.system()
    _AIX     = _platform_system == 'AIX'
    _LINUX   = _platform_system == 'Linux'

RESERVED_NCS, RFC_4122, RESERVED_MICROSOFT, RESERVED_FUTURE = [
    'reserved for NCS compatibility', 'specified in RFC 4122',
    'reserved for Microsoft compatibility', 'reserved for future definition']

int_ = int      # The built-in int type
bytes_ = bytes  # The built-in bytes type


class SafeUUID(Enum):
    safe = 0
    unsafe = -1
    unknown = None


class UUID:
    """Instances of the UUID class represent UUIDs as specified in RFC 4122.
    UUID objects are immutable, hashable, and usable as dictionary keys.
    Converting a UUID to a string with str() yields something in the form
    '12345678-1234-1234-1234-123456789abc'.  The UUID constructor accepts
    five possible forms: a similar string of hexadecimal digits, or a tuple
    of six integer fields (with 32-bit, 16-bit, 16-bit, 8-bit, 8-bit, and
    48-bit values respectively) as an argument named 'fields', or a string
    of 16 bytes (with all the integer fields in big-endian order) as an
    argument named 'bytes', or a string of 16 bytes (with the first three
    fields in little-endian order) as an argument named 'bytes_le', or a
    single 128-bit integer as an argument named 'int'.

    UUIDs have these read-only attributes:

        bytes       the UUID as a 16-byte string (containing the six
                    integer fields in big-endian byte order)

        bytes_le    the UUID as a 16-byte string (with time_low, time_mid,
                    and time_hi_version in little-endian byte order)

        fields      a tuple of the six integer fields of the UUID,
                    which are also available as six individual attributes
                    and two derived attributes:

            time_low                the first 32 bits of the UUID
            time_mid                the next 16 bits of the UUID
            time_hi_version         the next 16 bits of the UUID
            clock_seq_hi_variant    the next 8 bits of the UUID
            clock_seq_low           the next 8 bits of the UUID
            node                    the last 48 bits of the UUID

            time                    the 60-bit timestamp
            clock_seq               the 14-bit sequence number

        hex         the UUID as a 32-character hexadecimal string

        int         the UUID as a 128-bit integer

        urn         the UUID as a URN as specified in RFC 4122

        variant     the UUID variant (one of the constants RESERVED_NCS,
                    RFC_4122, RESERVED_MICROSOFT, or RESERVED_FUTURE)

        version     the UUID version number (1 through 5, meaningful only
                    when the variant is RFC_4122)

        is_safe     An enum indicating whether the UUID has been generated in
                    a way that is safe for multiprocessing applications, via
                    uuid_generate_time_safe(3).
    """

    __slots__ = ('int', 'is_safe', '__weakref__')

    def __init__(self, hex=None, bytes=None, bytes_le=None, fields=None,
                       int=None, version=None,
                       *, is_safe=SafeUUID.unknown):
        r"""Create a UUID from either a string of 32 hexadecimal digits,
        a string of 16 bytes as the 'bytes' argument, a string of 16 bytes
        in little-endian order as the 'bytes_le' argument, a tuple of six
        integers (32-bit time_low, 16-bit time_mid, 16-bit time_hi_version,
        8-bit clock_seq_hi_variant, 8-bit clock_seq_low, 48-bit node) as
        the 'fields' argument, or a single 128-bit integer as the 'int'
        argument.  When a string of hex digits is given, curly braces,
        hyphens, and a URN prefix are all optional.  For example, these
        expressions all yield the same UUID:

        UUID('{12345678-1234-5678-1234-567812345678}')
        UUID('12345678123456781234567812345678')
        UUID('urn:uuid:12345678-1234-5678-1234-567812345678')
        UUID(bytes='\x12\x34\x56\x78'*4)
        UUID(bytes_le='\x78\x56\x34\x12\x34\x12\x78\x56' +
                      '\x12\x34\x56\x78\x12\x34\x56\x78')
        UUID(fields=(0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x567812345678))
        UUID(int=0x12345678123456781234567812345678)

        Exactly one of 'hex', 'bytes', 'bytes_le', 'fields', or 'int' must
        be given.  The 'version' argument is optional; if given, the resulting
        UUID will have its variant and version set according to RFC 4122,
        overriding the given 'hex', 'bytes', 'bytes_le', 'fields', or 'int'.

        is_safe is an enum exposed as an attribute on the instance.  It
        indicates whether the UUID has been generated in a way that is safe
        for multiprocessing applications, via uuid_generate_time_safe(3).
        """

        if [hex, bytes, bytes_le, fields, int].count(None) != 4:
            raise TypeError('one of the hex, bytes, bytes_le, fields, '
                            'or int arguments must be given')
        if hex is not None:
            hex = hex.replace('urn:', '').replace('uuid:', '')
            hex = hex.strip('{}').replace('-', '')
            if len(hex) != 32:
                raise ValueError('badly formed hexadecimal UUID string')
            int = int_(hex, 16)
        if bytes_le is not None:
            if len(bytes_le) != 16:
                raise ValueError('bytes_le is not a 16-char string')
            bytes = (bytes_le[4-1::-1] + bytes_le[6-1:4-1:-1] +
                     bytes_le[8-1:6-1:-1] + bytes_le[8:])
        if bytes is not None:
            if len(bytes) != 16:
                raise ValueError('bytes is not a 16-char string')
            assert isinstance(bytes, bytes_), repr(bytes)
            int = int_.from_bytes(bytes, byteorder='big')
        if fields is not None:
            if len(fields) != 6:
                raise ValueError('fields is not a 6-tuple')
            (time_low, time_mid, time_hi_version,
             clock_seq_hi_variant, clock_seq_low, node) = fields
            if not 0 <= time_low < 1<<32:
                raise ValueError('field 1 out of range (need a 32-bit value)')
            if not 0 <= time_mid < 1<<16:
                raise ValueError('field 2 out of range (need a 16-bit value)')
            if not 0 <= time_hi_version < 1<<16:
                raise ValueError('field 3 out of range (need a 16-bit value)')
            if not 0 <= clock_seq_hi_variant < 1<<8:
                raise ValueError('field 4 out of range (need an 8-bit value)')
            if not 0 <= clock_seq_low < 1<<8:
                raise ValueError('field 5 out of range (need an 8-bit value)')
            if not 0 <= node < 1<<48:
                raise ValueError('field 6 out of range (need a 48-bit value)')
            clock_seq = (clock_seq_hi_variant << 8) | clock_seq_low
            int = ((time_low << 96) | (time_mid << 80) |
                   (time_hi_version << 64) | (clock_seq << 48) | node)
        if int is not None:
            if not 0 <= int < 1<<128:
                raise ValueError('int is out of range (need a 128-bit value)')
        if version is not None:
            if not 1 <= version <= 5:
                raise ValueError('illegal version number')
            # Set the variant to RFC 4122.
            int &= ~(0xc000 << 48)
            int |= 0x8000 << 48
            # Set the version number.
            int &= ~(0xf000 << 64)
            int |= version << 76
        object.__setattr__(self, 'int', int)
        object.__setattr__(self, 'is_safe', is_safe)

    def __getstate__(self):
        d = {'int': self.int}
        if self.is_safe != SafeUUID.unknown:
            # is_safe is a SafeUUID instance.  Return just its value, so that
            # it can be un-pickled in older Python versions without SafeUUID.
            d['is_safe'] = self.is_safe.value
        return d

    def __setstate__(self, state):
        object.__setattr__(self, 'int', state['int'])
        # is_safe was added in 3.7; it is also omitted when it is "unknown"
        object.__setattr__(self, 'is_safe',
                           SafeUUID(state['is_safe'])
                           if 'is_safe' in state else SafeUUID.unknown)

    def __eq__(self, other):
        if isinstance(other, UUID):
            return self.int == other.int
        return NotImplemented

    # Q. What's the value of being able to sort UUIDs?
    # A. Use them as keys in a B-Tree or similar mapping.

    def __lt__(self, other):
        if isinstance(other, UUID):
            return self.int < other.int
        return NotImplemented

    def __gt__(self, other):
        if isinstance(other, UUID):
            return self.int > other.int
        return NotImplemented

    def __le__(self, other):
        if isinstance(other, UUID):
            return self.int <= other.int
        return NotImplemented

    def __ge__(self, other):
        if isinstance(other, UUID):
            return self.int >= other.int
        return NotImplemented

    def __hash__(self):
        return hash(self.int)

    def __int__(self):
        return self.int

    def __repr__(self):
        return '%s(%r)' % (self.__class__.__name__, str(self))

    def __setattr__(self, name, value):
        raise TypeError('UUID objects are immutable')

    def __str__(self):
        hex = '%032x' % self.int
        return '%s-%s-%s-%s-%s' % (
            hex[:8], hex[8:12], hex[12:16], hex[16:20], hex[20:])

    @property
    def bytes(self):
        return self.int.to_bytes(16, 'big')

    @property
    def bytes_le(self):
        bytes = self.bytes
        return (bytes[4-1::-1] + bytes[6-1:4-1:-1] + bytes[8-1:6-1:-1] +
                bytes[8:])

    @property
    def fields(self):
        return (self.time_low, self.time_mid, self.time_hi_version,
                self.clock_seq_hi_variant, self.clock_seq_low, self.node)

    @property
    def time_low(self):
        return self.int >> 96

    @property
    def time_mid(self):
        return (self.int >> 80) & 0xffff

    @property
    def time_hi_version(self):
        return (self.int >> 64) & 0xffff

    @property
    def clock_seq_hi_variant(self):
        return (self.int >> 56) & 0xff

    @property
    def clock_seq_low(self):
        return (self.int >> 48) & 0xff

    @property
    def time(self):
        return (((self.time_hi_version & 0x0fff) << 48) |
                (self.time_mid << 32) | self.time_low)

    @property
    def clock_seq(self):
        return (((self.clock_seq_hi_variant & 0x3f) << 8) |
                self.clock_seq_low)

    @property
    def node(self):
        return self.int & 0xffffffffffff

    @property
    def hex(self):
        return '%032x' % self.int

    @property
    def urn(self):
        return 'urn:uuid:' + str(self)

    @property
    def variant(self):
        if not self.int & (0x8000 << 48):
            return RESERVED_NCS
        elif not self.int & (0x4000 << 48):
            return RFC_4122
        elif not self.int & (0x2000 << 48):
            return RESERVED_MICROSOFT
        else:
            return RESERVED_FUTURE

    @property
    def version(self):
        # The version bits are only meaningful for RFC 4122 UUIDs.
        if self.variant == RFC_4122:
            return int((self.int >> 76) & 0xf)

def _popen(command, *args):
    import os, shutil, subprocess
    executable = shutil.which(command)
    if executable is None:
        path = os.pathsep.join(('/sbin', '/usr/sbin'))
        executable = shutil.which(command, path=path)
        if executable is None:
            return None
    # LC_ALL=C to ensure English output, stderr=DEVNULL to prevent output
    # on stderr (Note: we don't have an example where the words we search
    # for are actually localized, but in theory some system could do so.)
    env = dict(os.environ)
    env['LC_ALL'] = 'C'
    proc = subprocess.Popen((executable,) + args,
                            stdout=subprocess.PIPE,
                            stderr=subprocess.DEVNULL,
                            env=env)
    return proc

# For MAC (a.k.a. IEEE 802, or EUI-48) addresses, the second least significant
# bit of the first octet signifies whether the MAC address is universally (0)
# or locally (1) administered.  Network cards from hardware manufacturers will
# always be universally administered to guarantee global uniqueness of the MAC
# address, but any particular machine may have other interfaces which are
# locally administered.  An example of the latter is the bridge interface to
# the Touch Bar on MacBook Pros.
#
# This bit works out to be the 42nd bit counting from 1 being the least
# significant, or 1<<41.  We'll prefer universally administered MAC addresses
# over locally administered ones since the former are globally unique, but
# we'll return the first of the latter found if that's all the machine has.
#
# See https://en.wikipedia.org/wiki/MAC_address#Universal_vs._local

def _is_universal(mac):
    return not (mac & (1 << 41))

def _find_mac(command, args, hw_identifiers, get_index):
    first_local_mac = None
    try:
        proc = _popen(command, *args.split())
        if not proc:
            return None
        with proc:
            for line in proc.stdout:
                words = line.lower().rstrip().split()
                for i in range(len(words)):
                    if words[i] in hw_identifiers:
                        try:
                            word = words[get_index(i)]
                            mac = int(word.replace(b':', b''), 16)
                            if _is_universal(mac):
                                return mac
                            first_local_mac = first_local_mac or mac
                        except (ValueError, IndexError):
                            # Virtual interfaces, such as those provided by
                            # VPNs, do not have a colon-delimited MAC address
                            # as expected, but a 16-byte HWAddr separated by
                            # dashes. These should be ignored in favor of a
                            # real MAC address
                            pass
    except OSError:
        pass
    return first_local_mac or None

def _ifconfig_getnode():
    """Get the hardware address on Unix by running ifconfig."""
    # This works on Linux ('' or '-a'), Tru64 ('-av'), but not all Unixes.
    keywords = (b'hwaddr', b'ether', b'address:', b'lladdr')
    for args in ('', '-a', '-av'):
        mac = _find_mac('ifconfig', args, keywords, lambda i: i+1)
        if mac:
            return mac
        return None

def _ip_getnode():
    """Get the hardware address on Unix by running ip."""
    # This works on Linux with iproute2.
    mac = _find_mac('ip', 'link', [b'link/ether'], lambda i: i+1)
    if mac:
        return mac
    return None

def _arp_getnode():
    """Get the hardware address on Unix by running arp."""
    import os, socket
    try:
        ip_addr = socket.gethostbyname(socket.gethostname())
    except OSError:
        return None

    # Try getting the MAC addr from arp based on our IP address (Solaris).
    mac = _find_mac('arp', '-an', [os.fsencode(ip_addr)], lambda i: -1)
    if mac:
        return mac

    # This works on OpenBSD
    mac = _find_mac('arp', '-an', [os.fsencode(ip_addr)], lambda i: i+1)
    if mac:
        return mac

    # This works on Linux, FreeBSD and NetBSD
    mac = _find_mac('arp', '-an', [os.fsencode('(%s)' % ip_addr)],
                    lambda i: i+2)
    # Return None instead of 0.
    if mac:
        return mac
    return None

def _lanscan_getnode():
    """Get the hardware address on Unix by running lanscan."""
    # This might work on HP-UX.
    return _find_mac('lanscan', '-ai', [b'lan0'], lambda i: 0)

def _netstat_getnode():
    """Get the hardware address on Unix by running netstat."""
    # This might work on AIX, Tru64 UNIX.
    first_local_mac = None
    try:
        proc = _popen('netstat', '-ia')
        if not proc:
            return None
        with proc:
            words = proc.stdout.readline().rstrip().split()
            try:
                i = words.index(b'Address')
            except ValueError:
                return None
            for line in proc.stdout:
                try:
                    words = line.rstrip().split()
                    word = words[i]
                    if len(word) == 17 and word.count(b':') == 5:
                        mac = int(word.replace(b':', b''), 16)
                        if _is_universal(mac):
                            return mac
                        first_local_mac = first_local_mac or mac
                except (ValueError, IndexError):
                    pass
    except OSError:
        pass
    return first_local_mac or None

def _ipconfig_getnode():
    """Get the hardware address on Windows by running ipconfig.exe."""
    import os, re, subprocess
    first_local_mac = None
    dirs = ['', r'c:\windows\system32', r'c:\winnt\system32']
    try:
        import ctypes
        buffer = ctypes.create_string_buffer(300)
        ctypes.windll.kernel32.GetSystemDirectoryA(buffer, 300)
        dirs.insert(0, buffer.value.decode('mbcs'))
    except:
        pass
    for dir in dirs:
        try:
            proc = subprocess.Popen([os.path.join(dir, 'ipconfig'), '/all'],
                                    stdout=subprocess.PIPE,
                                    encoding="oem")
        except OSError:
            continue
        with proc:
            for line in proc.stdout:
                value = line.split(':')[-1].strip().lower()
                if re.fullmatch('(?:[0-9a-f][0-9a-f]-){5}[0-9a-f][0-9a-f]', value):
                    mac = int(value.replace('-', ''), 16)
                    if _is_universal(mac):
                        return mac
                    first_local_mac = first_local_mac or mac
    return first_local_mac or None

def _netbios_getnode():
    """Get the hardware address on Windows using NetBIOS calls.
    See http://support.microsoft.com/kb/118623 for details."""
    import win32wnet, netbios
    first_local_mac = None
    ncb = netbios.NCB()
    ncb.Command = netbios.NCBENUM
    ncb.Buffer = adapters = netbios.LANA_ENUM()
    adapters._pack()
    if win32wnet.Netbios(ncb) != 0:
        return None
    adapters._unpack()
    for i in range(adapters.length):
        ncb.Reset()
        ncb.Command = netbios.NCBRESET
        ncb.Lana_num = ord(adapters.lana[i])
        if win32wnet.Netbios(ncb) != 0:
            continue
        ncb.Reset()
        ncb.Command = netbios.NCBASTAT
        ncb.Lana_num = ord(adapters.lana[i])
        ncb.Callname = '*'.ljust(16)
        ncb.Buffer = status = netbios.ADAPTER_STATUS()
        if win32wnet.Netbios(ncb) != 0:
            continue
        status._unpack()
        bytes = status.adapter_address[:6]
        if len(bytes) != 6:
            continue
        mac = int.from_bytes(bytes, 'big')
        if _is_universal(mac):
            return mac
        first_local_mac = first_local_mac or mac
    return first_local_mac or None


_generate_time_safe = _UuidCreate = None
_has_uuid_generate_time_safe = None

# Import optional C extension at toplevel, to help disabling it when testing
try:
    import _uuid
except ImportError:
    _uuid = None


def _load_system_functions():
    """
    Try to load platform-specific functions for generating uuids.
    """
    global _generate_time_safe, _UuidCreate, _has_uuid_generate_time_safe

    if _has_uuid_generate_time_safe is not None:
        return

    _has_uuid_generate_time_safe = False

    if sys.platform == "darwin" and int(os.uname().release.split('.')[0]) < 9:
        # The uuid_generate_* functions are broken on MacOS X 10.5, as noted
        # in issue #8621 the function generates the same sequence of values
        # in the parent process and all children created using fork (unless
        # those children use exec as well).
        #
        # Assume that the uuid_generate functions are broken from 10.5 onward,
        # the test can be adjusted when a later version is fixed.
        pass
    elif _uuid is not None:
        _generate_time_safe = _uuid.generate_time_safe
        _has_uuid_generate_time_safe = _uuid.has_uuid_generate_time_safe
        return

    try:
        # If we couldn't find an extension module, try ctypes to find
        # system routines for UUID generation.
        # Thanks to Thomas Heller for ctypes and for his help with its use here.
        import ctypes
        import ctypes.util

        # The uuid_generate_* routines are provided by libuuid on at least
        # Linux and FreeBSD, and provided by libc on Mac OS X.
        _libnames = ['uuid']
        if not sys.platform.startswith('win'):
            _libnames.append('c')
        for libname in _libnames:
            try:
                lib = ctypes.CDLL(ctypes.util.find_library(libname))
            except Exception:                           # pragma: nocover
                continue
            # Try to find the safe variety first.
            if hasattr(lib, 'uuid_generate_time_safe'):
                _uuid_generate_time_safe = lib.uuid_generate_time_safe
                # int uuid_generate_time_safe(uuid_t out);
                def _generate_time_safe():
                    _buffer = ctypes.create_string_buffer(16)
                    res = _uuid_generate_time_safe(_buffer)
                    return bytes(_buffer.raw), res
                _has_uuid_generate_time_safe = True
                break

            elif hasattr(lib, 'uuid_generate_time'):    # pragma: nocover
                _uuid_generate_time = lib.uuid_generate_time
                # void uuid_generate_time(uuid_t out);
                _uuid_generate_time.restype = None
                def _generate_time_safe():
                    _buffer = ctypes.create_string_buffer(16)
                    _uuid_generate_time(_buffer)
                    return bytes(_buffer.raw), None
                break

        # On Windows prior to 2000, UuidCreate gives a UUID containing the
        # hardware address.  On Windows 2000 and later, UuidCreate makes a
        # random UUID and UuidCreateSequential gives a UUID containing the
        # hardware address.  These routines are provided by the RPC runtime.
        # NOTE:  at least on Tim's WinXP Pro SP2 desktop box, while the last
        # 6 bytes returned by UuidCreateSequential are fixed, they don't appear
        # to bear any relationship to the MAC address of any network device
        # on the box.
        try:
            lib = ctypes.windll.rpcrt4
        except:
            lib = None
        _UuidCreate = getattr(lib, 'UuidCreateSequential',
                              getattr(lib, 'UuidCreate', None))

    except Exception as exc:
        import warnings
        warnings.warn(f"Could not find fallback ctypes uuid functions: {exc}",
                      ImportWarning)


def _unix_getnode():
    """Get the hardware address on Unix using the _uuid extension module
    or ctypes."""
    _load_system_functions()
    uuid_time, _ = _generate_time_safe()
    return UUID(bytes=uuid_time).node

def _windll_getnode():
    """Get the hardware address on Windows using ctypes."""
    import ctypes
    _load_system_functions()
    _buffer = ctypes.create_string_buffer(16)
    if _UuidCreate(_buffer) == 0:
        return UUID(bytes=bytes_(_buffer.raw)).node

def _random_getnode():
    """Get a random node ID."""
    # RFC 4122, $4.1.6 says "For systems with no IEEE address, a randomly or
    # pseudo-randomly generated value may be used; see Section 4.5.  The
    # multicast bit must be set in such addresses, in order that they will
    # never conflict with addresses obtained from network cards."
    #
    # The "multicast bit" of a MAC address is defined to be "the least
    # significant bit of the first octet".  This works out to be the 41st bit
    # counting from 1 being the least significant bit, or 1<<40.
    #
    # See https://en.wikipedia.org/wiki/MAC_address#Unicast_vs._multicast
    import random
    return random.getrandbits(48) | (1 << 40)


# _OS_GETTERS, when known, are targeted for a specific OS or platform.
# The order is by 'common practice' on the specified platform.
# Note: 'posix' and 'windows' _OS_GETTERS are prefixed by a dll/dlload() method
# which, when successful, means none of these "external" methods are called.
# _GETTERS is (also) used by test_uuid.py to SkipUnless(), e.g.,
#     @unittest.skipUnless(_uuid._ifconfig_getnode in _uuid._GETTERS, ...)
if _LINUX:
    _OS_GETTERS = [_ip_getnode, _ifconfig_getnode]
elif sys.platform == 'darwin':
    _OS_GETTERS = [_ifconfig_getnode, _arp_getnode, _netstat_getnode]
elif sys.platform == 'win32':
    _OS_GETTERS = [_netbios_getnode, _ipconfig_getnode]
elif _AIX:
    _OS_GETTERS = [_netstat_getnode]
else:
    _OS_GETTERS = [_ifconfig_getnode, _ip_getnode, _arp_getnode,
                   _netstat_getnode, _lanscan_getnode]
if os.name == 'posix':
    _GETTERS = [_unix_getnode] + _OS_GETTERS
elif os.name == 'nt':
    _GETTERS = [_windll_getnode] + _OS_GETTERS
else:
    _GETTERS = _OS_GETTERS

_node = None

def getnode(*, getters=None):
    """Get the hardware address as a 48-bit positive integer.

    The first time this runs, it may launch a separate program, which could
    be quite slow.  If all attempts to obtain the hardware address fail, we
    choose a random 48-bit number with its eighth bit set to 1 as recommended
    in RFC 4122.
    """
    global _node
    if _node is not None:
        return _node

    for getter in _GETTERS + [_random_getnode]:
        try:
            _node = getter()
        except:
            continue
        if (_node is not None) and (0 <= _node < (1 << 48)):
            return _node
    assert False, '_random_getnode() returned invalid value: {}'.format(_node)


_last_timestamp = None

def uuid1(node=None, clock_seq=None):
    """Generate a UUID from a host ID, sequence number, and the current time.
    If 'node' is not given, getnode() is used to obtain the hardware
    address.  If 'clock_seq' is given, it is used as the sequence number;
    otherwise a random 14-bit sequence number is chosen."""

    # When the system provides a version-1 UUID generator, use it (but don't
    # use UuidCreate here because its UUIDs don't conform to RFC 4122).
    _load_system_functions()
    if _generate_time_safe is not None and node is clock_seq is None:
        uuid_time, safely_generated = _generate_time_safe()
        try:
            is_safe = SafeUUID(safely_generated)
        except ValueError:
            is_safe = SafeUUID.unknown
        return UUID(bytes=uuid_time, is_safe=is_safe)

    global _last_timestamp
    import time
    nanoseconds = time.time_ns()
    # 0x01b21dd213814000 is the number of 100-ns intervals between the
    # UUID epoch 1582-10-15 00:00:00 and the Unix epoch 1970-01-01 00:00:00.
    timestamp = nanoseconds // 100 + 0x01b21dd213814000
    if _last_timestamp is not None and timestamp <= _last_timestamp:
        timestamp = _last_timestamp + 1
    _last_timestamp = timestamp
    if clock_seq is None:
        import random
        clock_seq = random.getrandbits(14) # instead of stable storage
    time_low = timestamp & 0xffffffff
    time_mid = (timestamp >> 32) & 0xffff
    time_hi_version = (timestamp >> 48) & 0x0fff
    clock_seq_low = clock_seq & 0xff
    clock_seq_hi_variant = (clock_seq >> 8) & 0x3f
    if node is None:
        node = getnode()
    return UUID(fields=(time_low, time_mid, time_hi_version,
                        clock_seq_hi_variant, clock_seq_low, node), version=1)

def uuid3(namespace, name):
    """Generate a UUID from the MD5 hash of a namespace UUID and a name."""
    from hashlib import md5
    digest = md5(
        namespace.bytes + bytes(name, "utf-8"),
        usedforsecurity=False
    ).digest()
    return UUID(bytes=digest[:16], version=3)

def uuid4():
    """Generate a random UUID."""
    return UUID(bytes=os.urandom(16), version=4)

def uuid5(namespace, name):
    """Generate a UUID from the SHA-1 hash of a namespace UUID and a name."""
    from hashlib import sha1
    hash = sha1(namespace.bytes + bytes(name, "utf-8")).digest()
    return UUID(bytes=hash[:16], version=5)

# The following standard UUIDs are for use with uuid3() or uuid5().

NAMESPACE_DNS = UUID('6ba7b810-9dad-11d1-80b4-00c04fd430c8')
NAMESPACE_URL = UUID('6ba7b811-9dad-11d1-80b4-00c04fd430c8')
NAMESPACE_OID = UUID('6ba7b812-9dad-11d1-80b4-00c04fd430c8')
NAMESPACE_X500 = UUID('6ba7b814-9dad-11d1-80b4-00c04fd430c8')
difflib.py000064400000244132151153537440006533 0ustar00"""
Module difflib -- helpers for computing deltas between objects.

Function get_close_matches(word, possibilities, n=3, cutoff=0.6):
    Use SequenceMatcher to return list of the best "good enough" matches.

Function context_diff(a, b):
    For two lists of strings, return a delta in context diff format.

Function ndiff(a, b):
    Return a delta: the difference between `a` and `b` (lists of strings).

Function restore(delta, which):
    Return one of the two sequences that generated an ndiff delta.

Function unified_diff(a, b):
    For two lists of strings, return a delta in unified diff format.

Class SequenceMatcher:
    A flexible class for comparing pairs of sequences of any type.

Class Differ:
    For producing human-readable deltas from sequences of lines of text.

Class HtmlDiff:
    For producing HTML side by side comparison with change highlights.
"""

__all__ = ['get_close_matches', 'ndiff', 'restore', 'SequenceMatcher',
           'Differ','IS_CHARACTER_JUNK', 'IS_LINE_JUNK', 'context_diff',
           'unified_diff', 'diff_bytes', 'HtmlDiff', 'Match']

from heapq import nlargest as _nlargest
from collections import namedtuple as _namedtuple

Match = _namedtuple('Match', 'a b size')

def _calculate_ratio(matches, length):
    if length:
        return 2.0 * matches / length
    return 1.0

class SequenceMatcher:

    """
    SequenceMatcher is a flexible class for comparing pairs of sequences of
    any type, so long as the sequence elements are hashable.  The basic
    algorithm predates, and is a little fancier than, an algorithm
    published in the late 1980's by Ratcliff and Obershelp under the
    hyperbolic name "gestalt pattern matching".  The basic idea is to find
    the longest contiguous matching subsequence that contains no "junk"
    elements (R-O doesn't address junk).  The same idea is then applied
    recursively to the pieces of the sequences to the left and to the right
    of the matching subsequence.  This does not yield minimal edit
    sequences, but does tend to yield matches that "look right" to people.

    SequenceMatcher tries to compute a "human-friendly diff" between two
    sequences.  Unlike e.g. UNIX(tm) diff, the fundamental notion is the
    longest *contiguous* & junk-free matching subsequence.  That's what
    catches peoples' eyes.  The Windows(tm) windiff has another interesting
    notion, pairing up elements that appear uniquely in each sequence.
    That, and the method here, appear to yield more intuitive difference
    reports than does diff.  This method appears to be the least vulnerable
    to synching up on blocks of "junk lines", though (like blank lines in
    ordinary text files, or maybe "<P>" lines in HTML files).  That may be
    because this is the only method of the 3 that has a *concept* of
    "junk" <wink>.

    Example, comparing two strings, and considering blanks to be "junk":

    >>> s = SequenceMatcher(lambda x: x == " ",
    ...                     "private Thread currentThread;",
    ...                     "private volatile Thread currentThread;")
    >>>

    .ratio() returns a float in [0, 1], measuring the "similarity" of the
    sequences.  As a rule of thumb, a .ratio() value over 0.6 means the
    sequences are close matches:

    >>> print(round(s.ratio(), 3))
    0.866
    >>>

    If you're only interested in where the sequences match,
    .get_matching_blocks() is handy:

    >>> for block in s.get_matching_blocks():
    ...     print("a[%d] and b[%d] match for %d elements" % block)
    a[0] and b[0] match for 8 elements
    a[8] and b[17] match for 21 elements
    a[29] and b[38] match for 0 elements

    Note that the last tuple returned by .get_matching_blocks() is always a
    dummy, (len(a), len(b), 0), and this is the only case in which the last
    tuple element (number of elements matched) is 0.

    If you want to know how to change the first sequence into the second,
    use .get_opcodes():

    >>> for opcode in s.get_opcodes():
    ...     print("%6s a[%d:%d] b[%d:%d]" % opcode)
     equal a[0:8] b[0:8]
    insert a[8:8] b[8:17]
     equal a[8:29] b[17:38]

    See the Differ class for a fancy human-friendly file differencer, which
    uses SequenceMatcher both to compare sequences of lines, and to compare
    sequences of characters within similar (near-matching) lines.

    See also function get_close_matches() in this module, which shows how
    simple code building on SequenceMatcher can be used to do useful work.

    Timing:  Basic R-O is cubic time worst case and quadratic time expected
    case.  SequenceMatcher is quadratic time for the worst case and has
    expected-case behavior dependent in a complicated way on how many
    elements the sequences have in common; best case time is linear.

    Methods:

    __init__(isjunk=None, a='', b='')
        Construct a SequenceMatcher.

    set_seqs(a, b)
        Set the two sequences to be compared.

    set_seq1(a)
        Set the first sequence to be compared.

    set_seq2(b)
        Set the second sequence to be compared.

    find_longest_match(alo, ahi, blo, bhi)
        Find longest matching block in a[alo:ahi] and b[blo:bhi].

    get_matching_blocks()
        Return list of triples describing matching subsequences.

    get_opcodes()
        Return list of 5-tuples describing how to turn a into b.

    ratio()
        Return a measure of the sequences' similarity (float in [0,1]).

    quick_ratio()
        Return an upper bound on .ratio() relatively quickly.

    real_quick_ratio()
        Return an upper bound on ratio() very quickly.
    """

    def __init__(self, isjunk=None, a='', b='', autojunk=True):
        """Construct a SequenceMatcher.

        Optional arg isjunk is None (the default), or a one-argument
        function that takes a sequence element and returns true iff the
        element is junk.  None is equivalent to passing "lambda x: 0", i.e.
        no elements are considered to be junk.  For example, pass
            lambda x: x in " \\t"
        if you're comparing lines as sequences of characters, and don't
        want to synch up on blanks or hard tabs.

        Optional arg a is the first of two sequences to be compared.  By
        default, an empty string.  The elements of a must be hashable.  See
        also .set_seqs() and .set_seq1().

        Optional arg b is the second of two sequences to be compared.  By
        default, an empty string.  The elements of b must be hashable. See
        also .set_seqs() and .set_seq2().

        Optional arg autojunk should be set to False to disable the
        "automatic junk heuristic" that treats popular elements as junk
        (see module documentation for more information).
        """

        # Members:
        # a
        #      first sequence
        # b
        #      second sequence; differences are computed as "what do
        #      we need to do to 'a' to change it into 'b'?"
        # b2j
        #      for x in b, b2j[x] is a list of the indices (into b)
        #      at which x appears; junk and popular elements do not appear
        # fullbcount
        #      for x in b, fullbcount[x] == the number of times x
        #      appears in b; only materialized if really needed (used
        #      only for computing quick_ratio())
        # matching_blocks
        #      a list of (i, j, k) triples, where a[i:i+k] == b[j:j+k];
        #      ascending & non-overlapping in i and in j; terminated by
        #      a dummy (len(a), len(b), 0) sentinel
        # opcodes
        #      a list of (tag, i1, i2, j1, j2) tuples, where tag is
        #      one of
        #          'replace'   a[i1:i2] should be replaced by b[j1:j2]
        #          'delete'    a[i1:i2] should be deleted
        #          'insert'    b[j1:j2] should be inserted
        #          'equal'     a[i1:i2] == b[j1:j2]
        # isjunk
        #      a user-supplied function taking a sequence element and
        #      returning true iff the element is "junk" -- this has
        #      subtle but helpful effects on the algorithm, which I'll
        #      get around to writing up someday <0.9 wink>.
        #      DON'T USE!  Only __chain_b uses this.  Use "in self.bjunk".
        # bjunk
        #      the items in b for which isjunk is True.
        # bpopular
        #      nonjunk items in b treated as junk by the heuristic (if used).

        self.isjunk = isjunk
        self.a = self.b = None
        self.autojunk = autojunk
        self.set_seqs(a, b)

    def set_seqs(self, a, b):
        """Set the two sequences to be compared.

        >>> s = SequenceMatcher()
        >>> s.set_seqs("abcd", "bcde")
        >>> s.ratio()
        0.75
        """

        self.set_seq1(a)
        self.set_seq2(b)

    def set_seq1(self, a):
        """Set the first sequence to be compared.

        The second sequence to be compared is not changed.

        >>> s = SequenceMatcher(None, "abcd", "bcde")
        >>> s.ratio()
        0.75
        >>> s.set_seq1("bcde")
        >>> s.ratio()
        1.0
        >>>

        SequenceMatcher computes and caches detailed information about the
        second sequence, so if you want to compare one sequence S against
        many sequences, use .set_seq2(S) once and call .set_seq1(x)
        repeatedly for each of the other sequences.

        See also set_seqs() and set_seq2().
        """

        if a is self.a:
            return
        self.a = a
        self.matching_blocks = self.opcodes = None

    def set_seq2(self, b):
        """Set the second sequence to be compared.

        The first sequence to be compared is not changed.

        >>> s = SequenceMatcher(None, "abcd", "bcde")
        >>> s.ratio()
        0.75
        >>> s.set_seq2("abcd")
        >>> s.ratio()
        1.0
        >>>

        SequenceMatcher computes and caches detailed information about the
        second sequence, so if you want to compare one sequence S against
        many sequences, use .set_seq2(S) once and call .set_seq1(x)
        repeatedly for each of the other sequences.

        See also set_seqs() and set_seq1().
        """

        if b is self.b:
            return
        self.b = b
        self.matching_blocks = self.opcodes = None
        self.fullbcount = None
        self.__chain_b()

    # For each element x in b, set b2j[x] to a list of the indices in
    # b where x appears; the indices are in increasing order; note that
    # the number of times x appears in b is len(b2j[x]) ...
    # when self.isjunk is defined, junk elements don't show up in this
    # map at all, which stops the central find_longest_match method
    # from starting any matching block at a junk element ...
    # b2j also does not contain entries for "popular" elements, meaning
    # elements that account for more than 1 + 1% of the total elements, and
    # when the sequence is reasonably large (>= 200 elements); this can
    # be viewed as an adaptive notion of semi-junk, and yields an enormous
    # speedup when, e.g., comparing program files with hundreds of
    # instances of "return NULL;" ...
    # note that this is only called when b changes; so for cross-product
    # kinds of matches, it's best to call set_seq2 once, then set_seq1
    # repeatedly

    def __chain_b(self):
        # Because isjunk is a user-defined (not C) function, and we test
        # for junk a LOT, it's important to minimize the number of calls.
        # Before the tricks described here, __chain_b was by far the most
        # time-consuming routine in the whole module!  If anyone sees
        # Jim Roskind, thank him again for profile.py -- I never would
        # have guessed that.
        # The first trick is to build b2j ignoring the possibility
        # of junk.  I.e., we don't call isjunk at all yet.  Throwing
        # out the junk later is much cheaper than building b2j "right"
        # from the start.
        b = self.b
        self.b2j = b2j = {}

        for i, elt in enumerate(b):
            indices = b2j.setdefault(elt, [])
            indices.append(i)

        # Purge junk elements
        self.bjunk = junk = set()
        isjunk = self.isjunk
        if isjunk:
            for elt in b2j.keys():
                if isjunk(elt):
                    junk.add(elt)
            for elt in junk: # separate loop avoids separate list of keys
                del b2j[elt]

        # Purge popular elements that are not junk
        self.bpopular = popular = set()
        n = len(b)
        if self.autojunk and n >= 200:
            ntest = n // 100 + 1
            for elt, idxs in b2j.items():
                if len(idxs) > ntest:
                    popular.add(elt)
            for elt in popular: # ditto; as fast for 1% deletion
                del b2j[elt]

    def find_longest_match(self, alo, ahi, blo, bhi):
        """Find longest matching block in a[alo:ahi] and b[blo:bhi].

        If isjunk is not defined:

        Return (i,j,k) such that a[i:i+k] is equal to b[j:j+k], where
            alo <= i <= i+k <= ahi
            blo <= j <= j+k <= bhi
        and for all (i',j',k') meeting those conditions,
            k >= k'
            i <= i'
            and if i == i', j <= j'

        In other words, of all maximal matching blocks, return one that
        starts earliest in a, and of all those maximal matching blocks that
        start earliest in a, return the one that starts earliest in b.

        >>> s = SequenceMatcher(None, " abcd", "abcd abcd")
        >>> s.find_longest_match(0, 5, 0, 9)
        Match(a=0, b=4, size=5)

        If isjunk is defined, first the longest matching block is
        determined as above, but with the additional restriction that no
        junk element appears in the block.  Then that block is extended as
        far as possible by matching (only) junk elements on both sides.  So
        the resulting block never matches on junk except as identical junk
        happens to be adjacent to an "interesting" match.

        Here's the same example as before, but considering blanks to be
        junk.  That prevents " abcd" from matching the " abcd" at the tail
        end of the second sequence directly.  Instead only the "abcd" can
        match, and matches the leftmost "abcd" in the second sequence:

        >>> s = SequenceMatcher(lambda x: x==" ", " abcd", "abcd abcd")
        >>> s.find_longest_match(0, 5, 0, 9)
        Match(a=1, b=0, size=4)

        If no blocks match, return (alo, blo, 0).

        >>> s = SequenceMatcher(None, "ab", "c")
        >>> s.find_longest_match(0, 2, 0, 1)
        Match(a=0, b=0, size=0)
        """

        # CAUTION:  stripping common prefix or suffix would be incorrect.
        # E.g.,
        #    ab
        #    acab
        # Longest matching block is "ab", but if common prefix is
        # stripped, it's "a" (tied with "b").  UNIX(tm) diff does so
        # strip, so ends up claiming that ab is changed to acab by
        # inserting "ca" in the middle.  That's minimal but unintuitive:
        # "it's obvious" that someone inserted "ac" at the front.
        # Windiff ends up at the same place as diff, but by pairing up
        # the unique 'b's and then matching the first two 'a's.

        a, b, b2j, isbjunk = self.a, self.b, self.b2j, self.bjunk.__contains__
        besti, bestj, bestsize = alo, blo, 0
        # find longest junk-free match
        # during an iteration of the loop, j2len[j] = length of longest
        # junk-free match ending with a[i-1] and b[j]
        j2len = {}
        nothing = []
        for i in range(alo, ahi):
            # look at all instances of a[i] in b; note that because
            # b2j has no junk keys, the loop is skipped if a[i] is junk
            j2lenget = j2len.get
            newj2len = {}
            for j in b2j.get(a[i], nothing):
                # a[i] matches b[j]
                if j < blo:
                    continue
                if j >= bhi:
                    break
                k = newj2len[j] = j2lenget(j-1, 0) + 1
                if k > bestsize:
                    besti, bestj, bestsize = i-k+1, j-k+1, k
            j2len = newj2len

        # Extend the best by non-junk elements on each end.  In particular,
        # "popular" non-junk elements aren't in b2j, which greatly speeds
        # the inner loop above, but also means "the best" match so far
        # doesn't contain any junk *or* popular non-junk elements.
        while besti > alo and bestj > blo and \
              not isbjunk(b[bestj-1]) and \
              a[besti-1] == b[bestj-1]:
            besti, bestj, bestsize = besti-1, bestj-1, bestsize+1
        while besti+bestsize < ahi and bestj+bestsize < bhi and \
              not isbjunk(b[bestj+bestsize]) and \
              a[besti+bestsize] == b[bestj+bestsize]:
            bestsize += 1

        # Now that we have a wholly interesting match (albeit possibly
        # empty!), we may as well suck up the matching junk on each
        # side of it too.  Can't think of a good reason not to, and it
        # saves post-processing the (possibly considerable) expense of
        # figuring out what to do with it.  In the case of an empty
        # interesting match, this is clearly the right thing to do,
        # because no other kind of match is possible in the regions.
        while besti > alo and bestj > blo and \
              isbjunk(b[bestj-1]) and \
              a[besti-1] == b[bestj-1]:
            besti, bestj, bestsize = besti-1, bestj-1, bestsize+1
        while besti+bestsize < ahi and bestj+bestsize < bhi and \
              isbjunk(b[bestj+bestsize]) and \
              a[besti+bestsize] == b[bestj+bestsize]:
            bestsize = bestsize + 1

        return Match(besti, bestj, bestsize)

    def get_matching_blocks(self):
        """Return list of triples describing matching subsequences.

        Each triple is of the form (i, j, n), and means that
        a[i:i+n] == b[j:j+n].  The triples are monotonically increasing in
        i and in j.  New in Python 2.5, it's also guaranteed that if
        (i, j, n) and (i', j', n') are adjacent triples in the list, and
        the second is not the last triple in the list, then i+n != i' or
        j+n != j'.  IOW, adjacent triples never describe adjacent equal
        blocks.

        The last triple is a dummy, (len(a), len(b), 0), and is the only
        triple with n==0.

        >>> s = SequenceMatcher(None, "abxcd", "abcd")
        >>> list(s.get_matching_blocks())
        [Match(a=0, b=0, size=2), Match(a=3, b=2, size=2), Match(a=5, b=4, size=0)]
        """

        if self.matching_blocks is not None:
            return self.matching_blocks
        la, lb = len(self.a), len(self.b)

        # This is most naturally expressed as a recursive algorithm, but
        # at least one user bumped into extreme use cases that exceeded
        # the recursion limit on their box.  So, now we maintain a list
        # ('queue`) of blocks we still need to look at, and append partial
        # results to `matching_blocks` in a loop; the matches are sorted
        # at the end.
        queue = [(0, la, 0, lb)]
        matching_blocks = []
        while queue:
            alo, ahi, blo, bhi = queue.pop()
            i, j, k = x = self.find_longest_match(alo, ahi, blo, bhi)
            # a[alo:i] vs b[blo:j] unknown
            # a[i:i+k] same as b[j:j+k]
            # a[i+k:ahi] vs b[j+k:bhi] unknown
            if k:   # if k is 0, there was no matching block
                matching_blocks.append(x)
                if alo < i and blo < j:
                    queue.append((alo, i, blo, j))
                if i+k < ahi and j+k < bhi:
                    queue.append((i+k, ahi, j+k, bhi))
        matching_blocks.sort()

        # It's possible that we have adjacent equal blocks in the
        # matching_blocks list now.  Starting with 2.5, this code was added
        # to collapse them.
        i1 = j1 = k1 = 0
        non_adjacent = []
        for i2, j2, k2 in matching_blocks:
            # Is this block adjacent to i1, j1, k1?
            if i1 + k1 == i2 and j1 + k1 == j2:
                # Yes, so collapse them -- this just increases the length of
                # the first block by the length of the second, and the first
                # block so lengthened remains the block to compare against.
                k1 += k2
            else:
                # Not adjacent.  Remember the first block (k1==0 means it's
                # the dummy we started with), and make the second block the
                # new block to compare against.
                if k1:
                    non_adjacent.append((i1, j1, k1))
                i1, j1, k1 = i2, j2, k2
        if k1:
            non_adjacent.append((i1, j1, k1))

        non_adjacent.append( (la, lb, 0) )
        self.matching_blocks = list(map(Match._make, non_adjacent))
        return self.matching_blocks

    def get_opcodes(self):
        """Return list of 5-tuples describing how to turn a into b.

        Each tuple is of the form (tag, i1, i2, j1, j2).  The first tuple
        has i1 == j1 == 0, and remaining tuples have i1 == the i2 from the
        tuple preceding it, and likewise for j1 == the previous j2.

        The tags are strings, with these meanings:

        'replace':  a[i1:i2] should be replaced by b[j1:j2]
        'delete':   a[i1:i2] should be deleted.
                    Note that j1==j2 in this case.
        'insert':   b[j1:j2] should be inserted at a[i1:i1].
                    Note that i1==i2 in this case.
        'equal':    a[i1:i2] == b[j1:j2]

        >>> a = "qabxcd"
        >>> b = "abycdf"
        >>> s = SequenceMatcher(None, a, b)
        >>> for tag, i1, i2, j1, j2 in s.get_opcodes():
        ...    print(("%7s a[%d:%d] (%s) b[%d:%d] (%s)" %
        ...           (tag, i1, i2, a[i1:i2], j1, j2, b[j1:j2])))
         delete a[0:1] (q) b[0:0] ()
          equal a[1:3] (ab) b[0:2] (ab)
        replace a[3:4] (x) b[2:3] (y)
          equal a[4:6] (cd) b[3:5] (cd)
         insert a[6:6] () b[5:6] (f)
        """

        if self.opcodes is not None:
            return self.opcodes
        i = j = 0
        self.opcodes = answer = []
        for ai, bj, size in self.get_matching_blocks():
            # invariant:  we've pumped out correct diffs to change
            # a[:i] into b[:j], and the next matching block is
            # a[ai:ai+size] == b[bj:bj+size].  So we need to pump
            # out a diff to change a[i:ai] into b[j:bj], pump out
            # the matching block, and move (i,j) beyond the match
            tag = ''
            if i < ai and j < bj:
                tag = 'replace'
            elif i < ai:
                tag = 'delete'
            elif j < bj:
                tag = 'insert'
            if tag:
                answer.append( (tag, i, ai, j, bj) )
            i, j = ai+size, bj+size
            # the list of matching blocks is terminated by a
            # sentinel with size 0
            if size:
                answer.append( ('equal', ai, i, bj, j) )
        return answer

    def get_grouped_opcodes(self, n=3):
        """ Isolate change clusters by eliminating ranges with no changes.

        Return a generator of groups with up to n lines of context.
        Each group is in the same format as returned by get_opcodes().

        >>> from pprint import pprint
        >>> a = list(map(str, range(1,40)))
        >>> b = a[:]
        >>> b[8:8] = ['i']     # Make an insertion
        >>> b[20] += 'x'       # Make a replacement
        >>> b[23:28] = []      # Make a deletion
        >>> b[30] += 'y'       # Make another replacement
        >>> pprint(list(SequenceMatcher(None,a,b).get_grouped_opcodes()))
        [[('equal', 5, 8, 5, 8), ('insert', 8, 8, 8, 9), ('equal', 8, 11, 9, 12)],
         [('equal', 16, 19, 17, 20),
          ('replace', 19, 20, 20, 21),
          ('equal', 20, 22, 21, 23),
          ('delete', 22, 27, 23, 23),
          ('equal', 27, 30, 23, 26)],
         [('equal', 31, 34, 27, 30),
          ('replace', 34, 35, 30, 31),
          ('equal', 35, 38, 31, 34)]]
        """

        codes = self.get_opcodes()
        if not codes:
            codes = [("equal", 0, 1, 0, 1)]
        # Fixup leading and trailing groups if they show no changes.
        if codes[0][0] == 'equal':
            tag, i1, i2, j1, j2 = codes[0]
            codes[0] = tag, max(i1, i2-n), i2, max(j1, j2-n), j2
        if codes[-1][0] == 'equal':
            tag, i1, i2, j1, j2 = codes[-1]
            codes[-1] = tag, i1, min(i2, i1+n), j1, min(j2, j1+n)

        nn = n + n
        group = []
        for tag, i1, i2, j1, j2 in codes:
            # End the current group and start a new one whenever
            # there is a large range with no changes.
            if tag == 'equal' and i2-i1 > nn:
                group.append((tag, i1, min(i2, i1+n), j1, min(j2, j1+n)))
                yield group
                group = []
                i1, j1 = max(i1, i2-n), max(j1, j2-n)
            group.append((tag, i1, i2, j1 ,j2))
        if group and not (len(group)==1 and group[0][0] == 'equal'):
            yield group

    def ratio(self):
        """Return a measure of the sequences' similarity (float in [0,1]).

        Where T is the total number of elements in both sequences, and
        M is the number of matches, this is 2.0*M / T.
        Note that this is 1 if the sequences are identical, and 0 if
        they have nothing in common.

        .ratio() is expensive to compute if you haven't already computed
        .get_matching_blocks() or .get_opcodes(), in which case you may
        want to try .quick_ratio() or .real_quick_ratio() first to get an
        upper bound.

        >>> s = SequenceMatcher(None, "abcd", "bcde")
        >>> s.ratio()
        0.75
        >>> s.quick_ratio()
        0.75
        >>> s.real_quick_ratio()
        1.0
        """

        matches = sum(triple[-1] for triple in self.get_matching_blocks())
        return _calculate_ratio(matches, len(self.a) + len(self.b))

    def quick_ratio(self):
        """Return an upper bound on ratio() relatively quickly.

        This isn't defined beyond that it is an upper bound on .ratio(), and
        is faster to compute.
        """

        # viewing a and b as multisets, set matches to the cardinality
        # of their intersection; this counts the number of matches
        # without regard to order, so is clearly an upper bound
        if self.fullbcount is None:
            self.fullbcount = fullbcount = {}
            for elt in self.b:
                fullbcount[elt] = fullbcount.get(elt, 0) + 1
        fullbcount = self.fullbcount
        # avail[x] is the number of times x appears in 'b' less the
        # number of times we've seen it in 'a' so far ... kinda
        avail = {}
        availhas, matches = avail.__contains__, 0
        for elt in self.a:
            if availhas(elt):
                numb = avail[elt]
            else:
                numb = fullbcount.get(elt, 0)
            avail[elt] = numb - 1
            if numb > 0:
                matches = matches + 1
        return _calculate_ratio(matches, len(self.a) + len(self.b))

    def real_quick_ratio(self):
        """Return an upper bound on ratio() very quickly.

        This isn't defined beyond that it is an upper bound on .ratio(), and
        is faster to compute than either .ratio() or .quick_ratio().
        """

        la, lb = len(self.a), len(self.b)
        # can't have more matches than the number of elements in the
        # shorter sequence
        return _calculate_ratio(min(la, lb), la + lb)

def get_close_matches(word, possibilities, n=3, cutoff=0.6):
    """Use SequenceMatcher to return list of the best "good enough" matches.

    word is a sequence for which close matches are desired (typically a
    string).

    possibilities is a list of sequences against which to match word
    (typically a list of strings).

    Optional arg n (default 3) is the maximum number of close matches to
    return.  n must be > 0.

    Optional arg cutoff (default 0.6) is a float in [0, 1].  Possibilities
    that don't score at least that similar to word are ignored.

    The best (no more than n) matches among the possibilities are returned
    in a list, sorted by similarity score, most similar first.

    >>> get_close_matches("appel", ["ape", "apple", "peach", "puppy"])
    ['apple', 'ape']
    >>> import keyword as _keyword
    >>> get_close_matches("wheel", _keyword.kwlist)
    ['while']
    >>> get_close_matches("Apple", _keyword.kwlist)
    []
    >>> get_close_matches("accept", _keyword.kwlist)
    ['except']
    """

    if not n >  0:
        raise ValueError("n must be > 0: %r" % (n,))
    if not 0.0 <= cutoff <= 1.0:
        raise ValueError("cutoff must be in [0.0, 1.0]: %r" % (cutoff,))
    result = []
    s = SequenceMatcher()
    s.set_seq2(word)
    for x in possibilities:
        s.set_seq1(x)
        if s.real_quick_ratio() >= cutoff and \
           s.quick_ratio() >= cutoff and \
           s.ratio() >= cutoff:
            result.append((s.ratio(), x))

    # Move the best scorers to head of list
    result = _nlargest(n, result)
    # Strip scores for the best n matches
    return [x for score, x in result]


def _keep_original_ws(s, tag_s):
    """Replace whitespace with the original whitespace characters in `s`"""
    return ''.join(
        c if tag_c == " " and c.isspace() else tag_c
        for c, tag_c in zip(s, tag_s)
    )



class Differ:
    r"""
    Differ is a class for comparing sequences of lines of text, and
    producing human-readable differences or deltas.  Differ uses
    SequenceMatcher both to compare sequences of lines, and to compare
    sequences of characters within similar (near-matching) lines.

    Each line of a Differ delta begins with a two-letter code:

        '- '    line unique to sequence 1
        '+ '    line unique to sequence 2
        '  '    line common to both sequences
        '? '    line not present in either input sequence

    Lines beginning with '? ' attempt to guide the eye to intraline
    differences, and were not present in either input sequence.  These lines
    can be confusing if the sequences contain tab characters.

    Note that Differ makes no claim to produce a *minimal* diff.  To the
    contrary, minimal diffs are often counter-intuitive, because they synch
    up anywhere possible, sometimes accidental matches 100 pages apart.
    Restricting synch points to contiguous matches preserves some notion of
    locality, at the occasional cost of producing a longer diff.

    Example: Comparing two texts.

    First we set up the texts, sequences of individual single-line strings
    ending with newlines (such sequences can also be obtained from the
    `readlines()` method of file-like objects):

    >>> text1 = '''  1. Beautiful is better than ugly.
    ...   2. Explicit is better than implicit.
    ...   3. Simple is better than complex.
    ...   4. Complex is better than complicated.
    ... '''.splitlines(keepends=True)
    >>> len(text1)
    4
    >>> text1[0][-1]
    '\n'
    >>> text2 = '''  1. Beautiful is better than ugly.
    ...   3.   Simple is better than complex.
    ...   4. Complicated is better than complex.
    ...   5. Flat is better than nested.
    ... '''.splitlines(keepends=True)

    Next we instantiate a Differ object:

    >>> d = Differ()

    Note that when instantiating a Differ object we may pass functions to
    filter out line and character 'junk'.  See Differ.__init__ for details.

    Finally, we compare the two:

    >>> result = list(d.compare(text1, text2))

    'result' is a list of strings, so let's pretty-print it:

    >>> from pprint import pprint as _pprint
    >>> _pprint(result)
    ['    1. Beautiful is better than ugly.\n',
     '-   2. Explicit is better than implicit.\n',
     '-   3. Simple is better than complex.\n',
     '+   3.   Simple is better than complex.\n',
     '?     ++\n',
     '-   4. Complex is better than complicated.\n',
     '?            ^                     ---- ^\n',
     '+   4. Complicated is better than complex.\n',
     '?           ++++ ^                      ^\n',
     '+   5. Flat is better than nested.\n']

    As a single multi-line string it looks like this:

    >>> print(''.join(result), end="")
        1. Beautiful is better than ugly.
    -   2. Explicit is better than implicit.
    -   3. Simple is better than complex.
    +   3.   Simple is better than complex.
    ?     ++
    -   4. Complex is better than complicated.
    ?            ^                     ---- ^
    +   4. Complicated is better than complex.
    ?           ++++ ^                      ^
    +   5. Flat is better than nested.

    Methods:

    __init__(linejunk=None, charjunk=None)
        Construct a text differencer, with optional filters.

    compare(a, b)
        Compare two sequences of lines; generate the resulting delta.
    """

    def __init__(self, linejunk=None, charjunk=None):
        """
        Construct a text differencer, with optional filters.

        The two optional keyword parameters are for filter functions:

        - `linejunk`: A function that should accept a single string argument,
          and return true iff the string is junk. The module-level function
          `IS_LINE_JUNK` may be used to filter out lines without visible
          characters, except for at most one splat ('#').  It is recommended
          to leave linejunk None; the underlying SequenceMatcher class has
          an adaptive notion of "noise" lines that's better than any static
          definition the author has ever been able to craft.

        - `charjunk`: A function that should accept a string of length 1. The
          module-level function `IS_CHARACTER_JUNK` may be used to filter out
          whitespace characters (a blank or tab; **note**: bad idea to include
          newline in this!).  Use of IS_CHARACTER_JUNK is recommended.
        """

        self.linejunk = linejunk
        self.charjunk = charjunk

    def compare(self, a, b):
        r"""
        Compare two sequences of lines; generate the resulting delta.

        Each sequence must contain individual single-line strings ending with
        newlines. Such sequences can be obtained from the `readlines()` method
        of file-like objects.  The delta generated also consists of newline-
        terminated strings, ready to be printed as-is via the writeline()
        method of a file-like object.

        Example:

        >>> print(''.join(Differ().compare('one\ntwo\nthree\n'.splitlines(True),
        ...                                'ore\ntree\nemu\n'.splitlines(True))),
        ...       end="")
        - one
        ?  ^
        + ore
        ?  ^
        - two
        - three
        ?  -
        + tree
        + emu
        """

        cruncher = SequenceMatcher(self.linejunk, a, b)
        for tag, alo, ahi, blo, bhi in cruncher.get_opcodes():
            if tag == 'replace':
                g = self._fancy_replace(a, alo, ahi, b, blo, bhi)
            elif tag == 'delete':
                g = self._dump('-', a, alo, ahi)
            elif tag == 'insert':
                g = self._dump('+', b, blo, bhi)
            elif tag == 'equal':
                g = self._dump(' ', a, alo, ahi)
            else:
                raise ValueError('unknown tag %r' % (tag,))

            yield from g

    def _dump(self, tag, x, lo, hi):
        """Generate comparison results for a same-tagged range."""
        for i in range(lo, hi):
            yield '%s %s' % (tag, x[i])

    def _plain_replace(self, a, alo, ahi, b, blo, bhi):
        assert alo < ahi and blo < bhi
        # dump the shorter block first -- reduces the burden on short-term
        # memory if the blocks are of very different sizes
        if bhi - blo < ahi - alo:
            first  = self._dump('+', b, blo, bhi)
            second = self._dump('-', a, alo, ahi)
        else:
            first  = self._dump('-', a, alo, ahi)
            second = self._dump('+', b, blo, bhi)

        for g in first, second:
            yield from g

    def _fancy_replace(self, a, alo, ahi, b, blo, bhi):
        r"""
        When replacing one block of lines with another, search the blocks
        for *similar* lines; the best-matching pair (if any) is used as a
        synch point, and intraline difference marking is done on the
        similar pair. Lots of work, but often worth it.

        Example:

        >>> d = Differ()
        >>> results = d._fancy_replace(['abcDefghiJkl\n'], 0, 1,
        ...                            ['abcdefGhijkl\n'], 0, 1)
        >>> print(''.join(results), end="")
        - abcDefghiJkl
        ?    ^  ^  ^
        + abcdefGhijkl
        ?    ^  ^  ^
        """

        # don't synch up unless the lines have a similarity score of at
        # least cutoff; best_ratio tracks the best score seen so far
        best_ratio, cutoff = 0.74, 0.75
        cruncher = SequenceMatcher(self.charjunk)
        eqi, eqj = None, None   # 1st indices of equal lines (if any)

        # search for the pair that matches best without being identical
        # (identical lines must be junk lines, & we don't want to synch up
        # on junk -- unless we have to)
        for j in range(blo, bhi):
            bj = b[j]
            cruncher.set_seq2(bj)
            for i in range(alo, ahi):
                ai = a[i]
                if ai == bj:
                    if eqi is None:
                        eqi, eqj = i, j
                    continue
                cruncher.set_seq1(ai)
                # computing similarity is expensive, so use the quick
                # upper bounds first -- have seen this speed up messy
                # compares by a factor of 3.
                # note that ratio() is only expensive to compute the first
                # time it's called on a sequence pair; the expensive part
                # of the computation is cached by cruncher
                if cruncher.real_quick_ratio() > best_ratio and \
                      cruncher.quick_ratio() > best_ratio and \
                      cruncher.ratio() > best_ratio:
                    best_ratio, best_i, best_j = cruncher.ratio(), i, j
        if best_ratio < cutoff:
            # no non-identical "pretty close" pair
            if eqi is None:
                # no identical pair either -- treat it as a straight replace
                yield from self._plain_replace(a, alo, ahi, b, blo, bhi)
                return
            # no close pair, but an identical pair -- synch up on that
            best_i, best_j, best_ratio = eqi, eqj, 1.0
        else:
            # there's a close pair, so forget the identical pair (if any)
            eqi = None

        # a[best_i] very similar to b[best_j]; eqi is None iff they're not
        # identical

        # pump out diffs from before the synch point
        yield from self._fancy_helper(a, alo, best_i, b, blo, best_j)

        # do intraline marking on the synch pair
        aelt, belt = a[best_i], b[best_j]
        if eqi is None:
            # pump out a '-', '?', '+', '?' quad for the synched lines
            atags = btags = ""
            cruncher.set_seqs(aelt, belt)
            for tag, ai1, ai2, bj1, bj2 in cruncher.get_opcodes():
                la, lb = ai2 - ai1, bj2 - bj1
                if tag == 'replace':
                    atags += '^' * la
                    btags += '^' * lb
                elif tag == 'delete':
                    atags += '-' * la
                elif tag == 'insert':
                    btags += '+' * lb
                elif tag == 'equal':
                    atags += ' ' * la
                    btags += ' ' * lb
                else:
                    raise ValueError('unknown tag %r' % (tag,))
            yield from self._qformat(aelt, belt, atags, btags)
        else:
            # the synch pair is identical
            yield '  ' + aelt

        # pump out diffs from after the synch point
        yield from self._fancy_helper(a, best_i+1, ahi, b, best_j+1, bhi)

    def _fancy_helper(self, a, alo, ahi, b, blo, bhi):
        g = []
        if alo < ahi:
            if blo < bhi:
                g = self._fancy_replace(a, alo, ahi, b, blo, bhi)
            else:
                g = self._dump('-', a, alo, ahi)
        elif blo < bhi:
            g = self._dump('+', b, blo, bhi)

        yield from g

    def _qformat(self, aline, bline, atags, btags):
        r"""
        Format "?" output and deal with tabs.

        Example:

        >>> d = Differ()
        >>> results = d._qformat('\tabcDefghiJkl\n', '\tabcdefGhijkl\n',
        ...                      '  ^ ^  ^      ', '  ^ ^  ^      ')
        >>> for line in results: print(repr(line))
        ...
        '- \tabcDefghiJkl\n'
        '? \t ^ ^  ^\n'
        '+ \tabcdefGhijkl\n'
        '? \t ^ ^  ^\n'
        """
        atags = _keep_original_ws(aline, atags).rstrip()
        btags = _keep_original_ws(bline, btags).rstrip()

        yield "- " + aline
        if atags:
            yield f"? {atags}\n"

        yield "+ " + bline
        if btags:
            yield f"? {btags}\n"

# With respect to junk, an earlier version of ndiff simply refused to
# *start* a match with a junk element.  The result was cases like this:
#     before: private Thread currentThread;
#     after:  private volatile Thread currentThread;
# If you consider whitespace to be junk, the longest contiguous match
# not starting with junk is "e Thread currentThread".  So ndiff reported
# that "e volatil" was inserted between the 't' and the 'e' in "private".
# While an accurate view, to people that's absurd.  The current version
# looks for matching blocks that are entirely junk-free, then extends the
# longest one of those as far as possible but only with matching junk.
# So now "currentThread" is matched, then extended to suck up the
# preceding blank; then "private" is matched, and extended to suck up the
# following blank; then "Thread" is matched; and finally ndiff reports
# that "volatile " was inserted before "Thread".  The only quibble
# remaining is that perhaps it was really the case that " volatile"
# was inserted after "private".  I can live with that <wink>.

import re

def IS_LINE_JUNK(line, pat=re.compile(r"\s*(?:#\s*)?$").match):
    r"""
    Return True for ignorable line: iff `line` is blank or contains a single '#'.

    Examples:

    >>> IS_LINE_JUNK('\n')
    True
    >>> IS_LINE_JUNK('  #   \n')
    True
    >>> IS_LINE_JUNK('hello\n')
    False
    """

    return pat(line) is not None

def IS_CHARACTER_JUNK(ch, ws=" \t"):
    r"""
    Return True for ignorable character: iff `ch` is a space or tab.

    Examples:

    >>> IS_CHARACTER_JUNK(' ')
    True
    >>> IS_CHARACTER_JUNK('\t')
    True
    >>> IS_CHARACTER_JUNK('\n')
    False
    >>> IS_CHARACTER_JUNK('x')
    False
    """

    return ch in ws


########################################################################
###  Unified Diff
########################################################################

def _format_range_unified(start, stop):
    'Convert range to the "ed" format'
    # Per the diff spec at http://www.unix.org/single_unix_specification/
    beginning = start + 1     # lines start numbering with one
    length = stop - start
    if length == 1:
        return '{}'.format(beginning)
    if not length:
        beginning -= 1        # empty ranges begin at line just before the range
    return '{},{}'.format(beginning, length)

def unified_diff(a, b, fromfile='', tofile='', fromfiledate='',
                 tofiledate='', n=3, lineterm='\n'):
    r"""
    Compare two sequences of lines; generate the delta as a unified diff.

    Unified diffs are a compact way of showing line changes and a few
    lines of context.  The number of context lines is set by 'n' which
    defaults to three.

    By default, the diff control lines (those with ---, +++, or @@) are
    created with a trailing newline.  This is helpful so that inputs
    created from file.readlines() result in diffs that are suitable for
    file.writelines() since both the inputs and outputs have trailing
    newlines.

    For inputs that do not have trailing newlines, set the lineterm
    argument to "" so that the output will be uniformly newline free.

    The unidiff format normally has a header for filenames and modification
    times.  Any or all of these may be specified using strings for
    'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'.
    The modification times are normally expressed in the ISO 8601 format.

    Example:

    >>> for line in unified_diff('one two three four'.split(),
    ...             'zero one tree four'.split(), 'Original', 'Current',
    ...             '2005-01-26 23:30:50', '2010-04-02 10:20:52',
    ...             lineterm=''):
    ...     print(line)                 # doctest: +NORMALIZE_WHITESPACE
    --- Original        2005-01-26 23:30:50
    +++ Current         2010-04-02 10:20:52
    @@ -1,4 +1,4 @@
    +zero
     one
    -two
    -three
    +tree
     four
    """

    _check_types(a, b, fromfile, tofile, fromfiledate, tofiledate, lineterm)
    started = False
    for group in SequenceMatcher(None,a,b).get_grouped_opcodes(n):
        if not started:
            started = True
            fromdate = '\t{}'.format(fromfiledate) if fromfiledate else ''
            todate = '\t{}'.format(tofiledate) if tofiledate else ''
            yield '--- {}{}{}'.format(fromfile, fromdate, lineterm)
            yield '+++ {}{}{}'.format(tofile, todate, lineterm)

        first, last = group[0], group[-1]
        file1_range = _format_range_unified(first[1], last[2])
        file2_range = _format_range_unified(first[3], last[4])
        yield '@@ -{} +{} @@{}'.format(file1_range, file2_range, lineterm)

        for tag, i1, i2, j1, j2 in group:
            if tag == 'equal':
                for line in a[i1:i2]:
                    yield ' ' + line
                continue
            if tag in {'replace', 'delete'}:
                for line in a[i1:i2]:
                    yield '-' + line
            if tag in {'replace', 'insert'}:
                for line in b[j1:j2]:
                    yield '+' + line


########################################################################
###  Context Diff
########################################################################

def _format_range_context(start, stop):
    'Convert range to the "ed" format'
    # Per the diff spec at http://www.unix.org/single_unix_specification/
    beginning = start + 1     # lines start numbering with one
    length = stop - start
    if not length:
        beginning -= 1        # empty ranges begin at line just before the range
    if length <= 1:
        return '{}'.format(beginning)
    return '{},{}'.format(beginning, beginning + length - 1)

# See http://www.unix.org/single_unix_specification/
def context_diff(a, b, fromfile='', tofile='',
                 fromfiledate='', tofiledate='', n=3, lineterm='\n'):
    r"""
    Compare two sequences of lines; generate the delta as a context diff.

    Context diffs are a compact way of showing line changes and a few
    lines of context.  The number of context lines is set by 'n' which
    defaults to three.

    By default, the diff control lines (those with *** or ---) are
    created with a trailing newline.  This is helpful so that inputs
    created from file.readlines() result in diffs that are suitable for
    file.writelines() since both the inputs and outputs have trailing
    newlines.

    For inputs that do not have trailing newlines, set the lineterm
    argument to "" so that the output will be uniformly newline free.

    The context diff format normally has a header for filenames and
    modification times.  Any or all of these may be specified using
    strings for 'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'.
    The modification times are normally expressed in the ISO 8601 format.
    If not specified, the strings default to blanks.

    Example:

    >>> print(''.join(context_diff('one\ntwo\nthree\nfour\n'.splitlines(True),
    ...       'zero\none\ntree\nfour\n'.splitlines(True), 'Original', 'Current')),
    ...       end="")
    *** Original
    --- Current
    ***************
    *** 1,4 ****
      one
    ! two
    ! three
      four
    --- 1,4 ----
    + zero
      one
    ! tree
      four
    """

    _check_types(a, b, fromfile, tofile, fromfiledate, tofiledate, lineterm)
    prefix = dict(insert='+ ', delete='- ', replace='! ', equal='  ')
    started = False
    for group in SequenceMatcher(None,a,b).get_grouped_opcodes(n):
        if not started:
            started = True
            fromdate = '\t{}'.format(fromfiledate) if fromfiledate else ''
            todate = '\t{}'.format(tofiledate) if tofiledate else ''
            yield '*** {}{}{}'.format(fromfile, fromdate, lineterm)
            yield '--- {}{}{}'.format(tofile, todate, lineterm)

        first, last = group[0], group[-1]
        yield '***************' + lineterm

        file1_range = _format_range_context(first[1], last[2])
        yield '*** {} ****{}'.format(file1_range, lineterm)

        if any(tag in {'replace', 'delete'} for tag, _, _, _, _ in group):
            for tag, i1, i2, _, _ in group:
                if tag != 'insert':
                    for line in a[i1:i2]:
                        yield prefix[tag] + line

        file2_range = _format_range_context(first[3], last[4])
        yield '--- {} ----{}'.format(file2_range, lineterm)

        if any(tag in {'replace', 'insert'} for tag, _, _, _, _ in group):
            for tag, _, _, j1, j2 in group:
                if tag != 'delete':
                    for line in b[j1:j2]:
                        yield prefix[tag] + line

def _check_types(a, b, *args):
    # Checking types is weird, but the alternative is garbled output when
    # someone passes mixed bytes and str to {unified,context}_diff(). E.g.
    # without this check, passing filenames as bytes results in output like
    #   --- b'oldfile.txt'
    #   +++ b'newfile.txt'
    # because of how str.format() incorporates bytes objects.
    if a and not isinstance(a[0], str):
        raise TypeError('lines to compare must be str, not %s (%r)' %
                        (type(a[0]).__name__, a[0]))
    if b and not isinstance(b[0], str):
        raise TypeError('lines to compare must be str, not %s (%r)' %
                        (type(b[0]).__name__, b[0]))
    for arg in args:
        if not isinstance(arg, str):
            raise TypeError('all arguments must be str, not: %r' % (arg,))

def diff_bytes(dfunc, a, b, fromfile=b'', tofile=b'',
               fromfiledate=b'', tofiledate=b'', n=3, lineterm=b'\n'):
    r"""
    Compare `a` and `b`, two sequences of lines represented as bytes rather
    than str. This is a wrapper for `dfunc`, which is typically either
    unified_diff() or context_diff(). Inputs are losslessly converted to
    strings so that `dfunc` only has to worry about strings, and encoded
    back to bytes on return. This is necessary to compare files with
    unknown or inconsistent encoding. All other inputs (except `n`) must be
    bytes rather than str.
    """
    def decode(s):
        try:
            return s.decode('ascii', 'surrogateescape')
        except AttributeError as err:
            msg = ('all arguments must be bytes, not %s (%r)' %
                   (type(s).__name__, s))
            raise TypeError(msg) from err
    a = list(map(decode, a))
    b = list(map(decode, b))
    fromfile = decode(fromfile)
    tofile = decode(tofile)
    fromfiledate = decode(fromfiledate)
    tofiledate = decode(tofiledate)
    lineterm = decode(lineterm)

    lines = dfunc(a, b, fromfile, tofile, fromfiledate, tofiledate, n, lineterm)
    for line in lines:
        yield line.encode('ascii', 'surrogateescape')

def ndiff(a, b, linejunk=None, charjunk=IS_CHARACTER_JUNK):
    r"""
    Compare `a` and `b` (lists of strings); return a `Differ`-style delta.

    Optional keyword parameters `linejunk` and `charjunk` are for filter
    functions, or can be None:

    - linejunk: A function that should accept a single string argument and
      return true iff the string is junk.  The default is None, and is
      recommended; the underlying SequenceMatcher class has an adaptive
      notion of "noise" lines.

    - charjunk: A function that accepts a character (string of length
      1), and returns true iff the character is junk. The default is
      the module-level function IS_CHARACTER_JUNK, which filters out
      whitespace characters (a blank or tab; note: it's a bad idea to
      include newline in this!).

    Tools/scripts/ndiff.py is a command-line front-end to this function.

    Example:

    >>> diff = ndiff('one\ntwo\nthree\n'.splitlines(keepends=True),
    ...              'ore\ntree\nemu\n'.splitlines(keepends=True))
    >>> print(''.join(diff), end="")
    - one
    ?  ^
    + ore
    ?  ^
    - two
    - three
    ?  -
    + tree
    + emu
    """
    return Differ(linejunk, charjunk).compare(a, b)

def _mdiff(fromlines, tolines, context=None, linejunk=None,
           charjunk=IS_CHARACTER_JUNK):
    r"""Returns generator yielding marked up from/to side by side differences.

    Arguments:
    fromlines -- list of text lines to compared to tolines
    tolines -- list of text lines to be compared to fromlines
    context -- number of context lines to display on each side of difference,
               if None, all from/to text lines will be generated.
    linejunk -- passed on to ndiff (see ndiff documentation)
    charjunk -- passed on to ndiff (see ndiff documentation)

    This function returns an iterator which returns a tuple:
    (from line tuple, to line tuple, boolean flag)

    from/to line tuple -- (line num, line text)
        line num -- integer or None (to indicate a context separation)
        line text -- original line text with following markers inserted:
            '\0+' -- marks start of added text
            '\0-' -- marks start of deleted text
            '\0^' -- marks start of changed text
            '\1' -- marks end of added/deleted/changed text

    boolean flag -- None indicates context separation, True indicates
        either "from" or "to" line contains a change, otherwise False.

    This function/iterator was originally developed to generate side by side
    file difference for making HTML pages (see HtmlDiff class for example
    usage).

    Note, this function utilizes the ndiff function to generate the side by
    side difference markup.  Optional ndiff arguments may be passed to this
    function and they in turn will be passed to ndiff.
    """
    import re

    # regular expression for finding intraline change indices
    change_re = re.compile(r'(\++|\-+|\^+)')

    # create the difference iterator to generate the differences
    diff_lines_iterator = ndiff(fromlines,tolines,linejunk,charjunk)

    def _make_line(lines, format_key, side, num_lines=[0,0]):
        """Returns line of text with user's change markup and line formatting.

        lines -- list of lines from the ndiff generator to produce a line of
                 text from.  When producing the line of text to return, the
                 lines used are removed from this list.
        format_key -- '+' return first line in list with "add" markup around
                          the entire line.
                      '-' return first line in list with "delete" markup around
                          the entire line.
                      '?' return first line in list with add/delete/change
                          intraline markup (indices obtained from second line)
                      None return first line in list with no markup
        side -- indice into the num_lines list (0=from,1=to)
        num_lines -- from/to current line number.  This is NOT intended to be a
                     passed parameter.  It is present as a keyword argument to
                     maintain memory of the current line numbers between calls
                     of this function.

        Note, this function is purposefully not defined at the module scope so
        that data it needs from its parent function (within whose context it
        is defined) does not need to be of module scope.
        """
        num_lines[side] += 1
        # Handle case where no user markup is to be added, just return line of
        # text with user's line format to allow for usage of the line number.
        if format_key is None:
            return (num_lines[side],lines.pop(0)[2:])
        # Handle case of intraline changes
        if format_key == '?':
            text, markers = lines.pop(0), lines.pop(0)
            # find intraline changes (store change type and indices in tuples)
            sub_info = []
            def record_sub_info(match_object,sub_info=sub_info):
                sub_info.append([match_object.group(1)[0],match_object.span()])
                return match_object.group(1)
            change_re.sub(record_sub_info,markers)
            # process each tuple inserting our special marks that won't be
            # noticed by an xml/html escaper.
            for key,(begin,end) in reversed(sub_info):
                text = text[0:begin]+'\0'+key+text[begin:end]+'\1'+text[end:]
            text = text[2:]
        # Handle case of add/delete entire line
        else:
            text = lines.pop(0)[2:]
            # if line of text is just a newline, insert a space so there is
            # something for the user to highlight and see.
            if not text:
                text = ' '
            # insert marks that won't be noticed by an xml/html escaper.
            text = '\0' + format_key + text + '\1'
        # Return line of text, first allow user's line formatter to do its
        # thing (such as adding the line number) then replace the special
        # marks with what the user's change markup.
        return (num_lines[side],text)

    def _line_iterator():
        """Yields from/to lines of text with a change indication.

        This function is an iterator.  It itself pulls lines from a
        differencing iterator, processes them and yields them.  When it can
        it yields both a "from" and a "to" line, otherwise it will yield one
        or the other.  In addition to yielding the lines of from/to text, a
        boolean flag is yielded to indicate if the text line(s) have
        differences in them.

        Note, this function is purposefully not defined at the module scope so
        that data it needs from its parent function (within whose context it
        is defined) does not need to be of module scope.
        """
        lines = []
        num_blanks_pending, num_blanks_to_yield = 0, 0
        while True:
            # Load up next 4 lines so we can look ahead, create strings which
            # are a concatenation of the first character of each of the 4 lines
            # so we can do some very readable comparisons.
            while len(lines) < 4:
                lines.append(next(diff_lines_iterator, 'X'))
            s = ''.join([line[0] for line in lines])
            if s.startswith('X'):
                # When no more lines, pump out any remaining blank lines so the
                # corresponding add/delete lines get a matching blank line so
                # all line pairs get yielded at the next level.
                num_blanks_to_yield = num_blanks_pending
            elif s.startswith('-?+?'):
                # simple intraline change
                yield _make_line(lines,'?',0), _make_line(lines,'?',1), True
                continue
            elif s.startswith('--++'):
                # in delete block, add block coming: we do NOT want to get
                # caught up on blank lines yet, just process the delete line
                num_blanks_pending -= 1
                yield _make_line(lines,'-',0), None, True
                continue
            elif s.startswith(('--?+', '--+', '- ')):
                # in delete block and see an intraline change or unchanged line
                # coming: yield the delete line and then blanks
                from_line,to_line = _make_line(lines,'-',0), None
                num_blanks_to_yield,num_blanks_pending = num_blanks_pending-1,0
            elif s.startswith('-+?'):
                # intraline change
                yield _make_line(lines,None,0), _make_line(lines,'?',1), True
                continue
            elif s.startswith('-?+'):
                # intraline change
                yield _make_line(lines,'?',0), _make_line(lines,None,1), True
                continue
            elif s.startswith('-'):
                # delete FROM line
                num_blanks_pending -= 1
                yield _make_line(lines,'-',0), None, True
                continue
            elif s.startswith('+--'):
                # in add block, delete block coming: we do NOT want to get
                # caught up on blank lines yet, just process the add line
                num_blanks_pending += 1
                yield None, _make_line(lines,'+',1), True
                continue
            elif s.startswith(('+ ', '+-')):
                # will be leaving an add block: yield blanks then add line
                from_line, to_line = None, _make_line(lines,'+',1)
                num_blanks_to_yield,num_blanks_pending = num_blanks_pending+1,0
            elif s.startswith('+'):
                # inside an add block, yield the add line
                num_blanks_pending += 1
                yield None, _make_line(lines,'+',1), True
                continue
            elif s.startswith(' '):
                # unchanged text, yield it to both sides
                yield _make_line(lines[:],None,0),_make_line(lines,None,1),False
                continue
            # Catch up on the blank lines so when we yield the next from/to
            # pair, they are lined up.
            while(num_blanks_to_yield < 0):
                num_blanks_to_yield += 1
                yield None,('','\n'),True
            while(num_blanks_to_yield > 0):
                num_blanks_to_yield -= 1
                yield ('','\n'),None,True
            if s.startswith('X'):
                return
            else:
                yield from_line,to_line,True

    def _line_pair_iterator():
        """Yields from/to lines of text with a change indication.

        This function is an iterator.  It itself pulls lines from the line
        iterator.  Its difference from that iterator is that this function
        always yields a pair of from/to text lines (with the change
        indication).  If necessary it will collect single from/to lines
        until it has a matching pair from/to pair to yield.

        Note, this function is purposefully not defined at the module scope so
        that data it needs from its parent function (within whose context it
        is defined) does not need to be of module scope.
        """
        line_iterator = _line_iterator()
        fromlines,tolines=[],[]
        while True:
            # Collecting lines of text until we have a from/to pair
            while (len(fromlines)==0 or len(tolines)==0):
                try:
                    from_line, to_line, found_diff = next(line_iterator)
                except StopIteration:
                    return
                if from_line is not None:
                    fromlines.append((from_line,found_diff))
                if to_line is not None:
                    tolines.append((to_line,found_diff))
            # Once we have a pair, remove them from the collection and yield it
            from_line, fromDiff = fromlines.pop(0)
            to_line, to_diff = tolines.pop(0)
            yield (from_line,to_line,fromDiff or to_diff)

    # Handle case where user does not want context differencing, just yield
    # them up without doing anything else with them.
    line_pair_iterator = _line_pair_iterator()
    if context is None:
        yield from line_pair_iterator
    # Handle case where user wants context differencing.  We must do some
    # storage of lines until we know for sure that they are to be yielded.
    else:
        context += 1
        lines_to_write = 0
        while True:
            # Store lines up until we find a difference, note use of a
            # circular queue because we only need to keep around what
            # we need for context.
            index, contextLines = 0, [None]*(context)
            found_diff = False
            while(found_diff is False):
                try:
                    from_line, to_line, found_diff = next(line_pair_iterator)
                except StopIteration:
                    return
                i = index % context
                contextLines[i] = (from_line, to_line, found_diff)
                index += 1
            # Yield lines that we have collected so far, but first yield
            # the user's separator.
            if index > context:
                yield None, None, None
                lines_to_write = context
            else:
                lines_to_write = index
                index = 0
            while(lines_to_write):
                i = index % context
                index += 1
                yield contextLines[i]
                lines_to_write -= 1
            # Now yield the context lines after the change
            lines_to_write = context-1
            try:
                while(lines_to_write):
                    from_line, to_line, found_diff = next(line_pair_iterator)
                    # If another change within the context, extend the context
                    if found_diff:
                        lines_to_write = context-1
                    else:
                        lines_to_write -= 1
                    yield from_line, to_line, found_diff
            except StopIteration:
                # Catch exception from next() and return normally
                return


_file_template = """
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>

<head>
    <meta http-equiv="Content-Type"
          content="text/html; charset=%(charset)s" />
    <title></title>
    <style type="text/css">%(styles)s
    </style>
</head>

<body>
    %(table)s%(legend)s
</body>

</html>"""

_styles = """
        table.diff {font-family:Courier; border:medium;}
        .diff_header {background-color:#e0e0e0}
        td.diff_header {text-align:right}
        .diff_next {background-color:#c0c0c0}
        .diff_add {background-color:#aaffaa}
        .diff_chg {background-color:#ffff77}
        .diff_sub {background-color:#ffaaaa}"""

_table_template = """
    <table class="diff" id="difflib_chg_%(prefix)s_top"
           cellspacing="0" cellpadding="0" rules="groups" >
        <colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
        <colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
        %(header_row)s
        <tbody>
%(data_rows)s        </tbody>
    </table>"""

_legend = """
    <table class="diff" summary="Legends">
        <tr> <th colspan="2"> Legends </th> </tr>
        <tr> <td> <table border="" summary="Colors">
                      <tr><th> Colors </th> </tr>
                      <tr><td class="diff_add">&nbsp;Added&nbsp;</td></tr>
                      <tr><td class="diff_chg">Changed</td> </tr>
                      <tr><td class="diff_sub">Deleted</td> </tr>
                  </table></td>
             <td> <table border="" summary="Links">
                      <tr><th colspan="2"> Links </th> </tr>
                      <tr><td>(f)irst change</td> </tr>
                      <tr><td>(n)ext change</td> </tr>
                      <tr><td>(t)op</td> </tr>
                  </table></td> </tr>
    </table>"""

class HtmlDiff(object):
    """For producing HTML side by side comparison with change highlights.

    This class can be used to create an HTML table (or a complete HTML file
    containing the table) showing a side by side, line by line comparison
    of text with inter-line and intra-line change highlights.  The table can
    be generated in either full or contextual difference mode.

    The following methods are provided for HTML generation:

    make_table -- generates HTML for a single side by side table
    make_file -- generates complete HTML file with a single side by side table

    See tools/scripts/diff.py for an example usage of this class.
    """

    _file_template = _file_template
    _styles = _styles
    _table_template = _table_template
    _legend = _legend
    _default_prefix = 0

    def __init__(self,tabsize=8,wrapcolumn=None,linejunk=None,
                 charjunk=IS_CHARACTER_JUNK):
        """HtmlDiff instance initializer

        Arguments:
        tabsize -- tab stop spacing, defaults to 8.
        wrapcolumn -- column number where lines are broken and wrapped,
            defaults to None where lines are not wrapped.
        linejunk,charjunk -- keyword arguments passed into ndiff() (used by
            HtmlDiff() to generate the side by side HTML differences).  See
            ndiff() documentation for argument default values and descriptions.
        """
        self._tabsize = tabsize
        self._wrapcolumn = wrapcolumn
        self._linejunk = linejunk
        self._charjunk = charjunk

    def make_file(self, fromlines, tolines, fromdesc='', todesc='',
                  context=False, numlines=5, *, charset='utf-8'):
        """Returns HTML file of side by side comparison with change highlights

        Arguments:
        fromlines -- list of "from" lines
        tolines -- list of "to" lines
        fromdesc -- "from" file column header string
        todesc -- "to" file column header string
        context -- set to True for contextual differences (defaults to False
            which shows full differences).
        numlines -- number of context lines.  When context is set True,
            controls number of lines displayed before and after the change.
            When context is False, controls the number of lines to place
            the "next" link anchors before the next change (so click of
            "next" link jumps to just before the change).
        charset -- charset of the HTML document
        """

        return (self._file_template % dict(
            styles=self._styles,
            legend=self._legend,
            table=self.make_table(fromlines, tolines, fromdesc, todesc,
                                  context=context, numlines=numlines),
            charset=charset
        )).encode(charset, 'xmlcharrefreplace').decode(charset)

    def _tab_newline_replace(self,fromlines,tolines):
        """Returns from/to line lists with tabs expanded and newlines removed.

        Instead of tab characters being replaced by the number of spaces
        needed to fill in to the next tab stop, this function will fill
        the space with tab characters.  This is done so that the difference
        algorithms can identify changes in a file when tabs are replaced by
        spaces and vice versa.  At the end of the HTML generation, the tab
        characters will be replaced with a nonbreakable space.
        """
        def expand_tabs(line):
            # hide real spaces
            line = line.replace(' ','\0')
            # expand tabs into spaces
            line = line.expandtabs(self._tabsize)
            # replace spaces from expanded tabs back into tab characters
            # (we'll replace them with markup after we do differencing)
            line = line.replace(' ','\t')
            return line.replace('\0',' ').rstrip('\n')
        fromlines = [expand_tabs(line) for line in fromlines]
        tolines = [expand_tabs(line) for line in tolines]
        return fromlines,tolines

    def _split_line(self,data_list,line_num,text):
        """Builds list of text lines by splitting text lines at wrap point

        This function will determine if the input text line needs to be
        wrapped (split) into separate lines.  If so, the first wrap point
        will be determined and the first line appended to the output
        text line list.  This function is used recursively to handle
        the second part of the split line to further split it.
        """
        # if blank line or context separator, just add it to the output list
        if not line_num:
            data_list.append((line_num,text))
            return

        # if line text doesn't need wrapping, just add it to the output list
        size = len(text)
        max = self._wrapcolumn
        if (size <= max) or ((size -(text.count('\0')*3)) <= max):
            data_list.append((line_num,text))
            return

        # scan text looking for the wrap point, keeping track if the wrap
        # point is inside markers
        i = 0
        n = 0
        mark = ''
        while n < max and i < size:
            if text[i] == '\0':
                i += 1
                mark = text[i]
                i += 1
            elif text[i] == '\1':
                i += 1
                mark = ''
            else:
                i += 1
                n += 1

        # wrap point is inside text, break it up into separate lines
        line1 = text[:i]
        line2 = text[i:]

        # if wrap point is inside markers, place end marker at end of first
        # line and start marker at beginning of second line because each
        # line will have its own table tag markup around it.
        if mark:
            line1 = line1 + '\1'
            line2 = '\0' + mark + line2

        # tack on first line onto the output list
        data_list.append((line_num,line1))

        # use this routine again to wrap the remaining text
        self._split_line(data_list,'>',line2)

    def _line_wrapper(self,diffs):
        """Returns iterator that splits (wraps) mdiff text lines"""

        # pull from/to data and flags from mdiff iterator
        for fromdata,todata,flag in diffs:
            # check for context separators and pass them through
            if flag is None:
                yield fromdata,todata,flag
                continue
            (fromline,fromtext),(toline,totext) = fromdata,todata
            # for each from/to line split it at the wrap column to form
            # list of text lines.
            fromlist,tolist = [],[]
            self._split_line(fromlist,fromline,fromtext)
            self._split_line(tolist,toline,totext)
            # yield from/to line in pairs inserting blank lines as
            # necessary when one side has more wrapped lines
            while fromlist or tolist:
                if fromlist:
                    fromdata = fromlist.pop(0)
                else:
                    fromdata = ('',' ')
                if tolist:
                    todata = tolist.pop(0)
                else:
                    todata = ('',' ')
                yield fromdata,todata,flag

    def _collect_lines(self,diffs):
        """Collects mdiff output into separate lists

        Before storing the mdiff from/to data into a list, it is converted
        into a single line of text with HTML markup.
        """

        fromlist,tolist,flaglist = [],[],[]
        # pull from/to data and flags from mdiff style iterator
        for fromdata,todata,flag in diffs:
            try:
                # store HTML markup of the lines into the lists
                fromlist.append(self._format_line(0,flag,*fromdata))
                tolist.append(self._format_line(1,flag,*todata))
            except TypeError:
                # exceptions occur for lines where context separators go
                fromlist.append(None)
                tolist.append(None)
            flaglist.append(flag)
        return fromlist,tolist,flaglist

    def _format_line(self,side,flag,linenum,text):
        """Returns HTML markup of "from" / "to" text lines

        side -- 0 or 1 indicating "from" or "to" text
        flag -- indicates if difference on line
        linenum -- line number (used for line number column)
        text -- line text to be marked up
        """
        try:
            linenum = '%d' % linenum
            id = ' id="%s%s"' % (self._prefix[side],linenum)
        except TypeError:
            # handle blank lines where linenum is '>' or ''
            id = ''
        # replace those things that would get confused with HTML symbols
        text=text.replace("&","&amp;").replace(">","&gt;").replace("<","&lt;")

        # make space non-breakable so they don't get compressed or line wrapped
        text = text.replace(' ','&nbsp;').rstrip()

        return '<td class="diff_header"%s>%s</td><td nowrap="nowrap">%s</td>' \
               % (id,linenum,text)

    def _make_prefix(self):
        """Create unique anchor prefixes"""

        # Generate a unique anchor prefix so multiple tables
        # can exist on the same HTML page without conflicts.
        fromprefix = "from%d_" % HtmlDiff._default_prefix
        toprefix = "to%d_" % HtmlDiff._default_prefix
        HtmlDiff._default_prefix += 1
        # store prefixes so line format method has access
        self._prefix = [fromprefix,toprefix]

    def _convert_flags(self,fromlist,tolist,flaglist,context,numlines):
        """Makes list of "next" links"""

        # all anchor names will be generated using the unique "to" prefix
        toprefix = self._prefix[1]

        # process change flags, generating middle column of next anchors/links
        next_id = ['']*len(flaglist)
        next_href = ['']*len(flaglist)
        num_chg, in_change = 0, False
        last = 0
        for i,flag in enumerate(flaglist):
            if flag:
                if not in_change:
                    in_change = True
                    last = i
                    # at the beginning of a change, drop an anchor a few lines
                    # (the context lines) before the change for the previous
                    # link
                    i = max([0,i-numlines])
                    next_id[i] = ' id="difflib_chg_%s_%d"' % (toprefix,num_chg)
                    # at the beginning of a change, drop a link to the next
                    # change
                    num_chg += 1
                    next_href[last] = '<a href="#difflib_chg_%s_%d">n</a>' % (
                         toprefix,num_chg)
            else:
                in_change = False
        # check for cases where there is no content to avoid exceptions
        if not flaglist:
            flaglist = [False]
            next_id = ['']
            next_href = ['']
            last = 0
            if context:
                fromlist = ['<td></td><td>&nbsp;No Differences Found&nbsp;</td>']
                tolist = fromlist
            else:
                fromlist = tolist = ['<td></td><td>&nbsp;Empty File&nbsp;</td>']
        # if not a change on first line, drop a link
        if not flaglist[0]:
            next_href[0] = '<a href="#difflib_chg_%s_0">f</a>' % toprefix
        # redo the last link to link to the top
        next_href[last] = '<a href="#difflib_chg_%s_top">t</a>' % (toprefix)

        return fromlist,tolist,flaglist,next_href,next_id

    def make_table(self,fromlines,tolines,fromdesc='',todesc='',context=False,
                   numlines=5):
        """Returns HTML table of side by side comparison with change highlights

        Arguments:
        fromlines -- list of "from" lines
        tolines -- list of "to" lines
        fromdesc -- "from" file column header string
        todesc -- "to" file column header string
        context -- set to True for contextual differences (defaults to False
            which shows full differences).
        numlines -- number of context lines.  When context is set True,
            controls number of lines displayed before and after the change.
            When context is False, controls the number of lines to place
            the "next" link anchors before the next change (so click of
            "next" link jumps to just before the change).
        """

        # make unique anchor prefixes so that multiple tables may exist
        # on the same page without conflict.
        self._make_prefix()

        # change tabs to spaces before it gets more difficult after we insert
        # markup
        fromlines,tolines = self._tab_newline_replace(fromlines,tolines)

        # create diffs iterator which generates side by side from/to data
        if context:
            context_lines = numlines
        else:
            context_lines = None
        diffs = _mdiff(fromlines,tolines,context_lines,linejunk=self._linejunk,
                      charjunk=self._charjunk)

        # set up iterator to wrap lines that exceed desired width
        if self._wrapcolumn:
            diffs = self._line_wrapper(diffs)

        # collect up from/to lines and flags into lists (also format the lines)
        fromlist,tolist,flaglist = self._collect_lines(diffs)

        # process change flags, generating middle column of next anchors/links
        fromlist,tolist,flaglist,next_href,next_id = self._convert_flags(
            fromlist,tolist,flaglist,context,numlines)

        s = []
        fmt = '            <tr><td class="diff_next"%s>%s</td>%s' + \
              '<td class="diff_next">%s</td>%s</tr>\n'
        for i in range(len(flaglist)):
            if flaglist[i] is None:
                # mdiff yields None on separator lines skip the bogus ones
                # generated for the first line
                if i > 0:
                    s.append('        </tbody>        \n        <tbody>\n')
            else:
                s.append( fmt % (next_id[i],next_href[i],fromlist[i],
                                           next_href[i],tolist[i]))
        if fromdesc or todesc:
            header_row = '<thead><tr>%s%s%s%s</tr></thead>' % (
                '<th class="diff_next"><br /></th>',
                '<th colspan="2" class="diff_header">%s</th>' % fromdesc,
                '<th class="diff_next"><br /></th>',
                '<th colspan="2" class="diff_header">%s</th>' % todesc)
        else:
            header_row = ''

        table = self._table_template % dict(
            data_rows=''.join(s),
            header_row=header_row,
            prefix=self._prefix[1])

        return table.replace('\0+','<span class="diff_add">'). \
                     replace('\0-','<span class="diff_sub">'). \
                     replace('\0^','<span class="diff_chg">'). \
                     replace('\1','</span>'). \
                     replace('\t','&nbsp;')

del re

def restore(delta, which):
    r"""
    Generate one of the two sequences that generated a delta.

    Given a `delta` produced by `Differ.compare()` or `ndiff()`, extract
    lines originating from file 1 or 2 (parameter `which`), stripping off line
    prefixes.

    Examples:

    >>> diff = ndiff('one\ntwo\nthree\n'.splitlines(keepends=True),
    ...              'ore\ntree\nemu\n'.splitlines(keepends=True))
    >>> diff = list(diff)
    >>> print(''.join(restore(diff, 1)), end="")
    one
    two
    three
    >>> print(''.join(restore(diff, 2)), end="")
    ore
    tree
    emu
    """
    try:
        tag = {1: "- ", 2: "+ "}[int(which)]
    except KeyError:
        raise ValueError('unknown delta choice (must be 1 or 2): %r'
                           % which) from None
    prefixes = ("  ", tag)
    for line in delta:
        if line[:2] in prefixes:
            yield line[2:]

def _test():
    import doctest, difflib
    return doctest.testmod(difflib)

if __name__ == "__main__":
    _test()
subprocess.py000064400000230652151153537440007326 0ustar00# subprocess - Subprocesses with accessible I/O streams
#
# For more information about this module, see PEP 324.
#
# Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se>
#
# Licensed to PSF under a Contributor Agreement.
# See http://www.python.org/2.4/license for licensing details.

r"""Subprocesses with accessible I/O streams

This module allows you to spawn processes, connect to their
input/output/error pipes, and obtain their return codes.

For a complete description of this module see the Python documentation.

Main API
========
run(...): Runs a command, waits for it to complete, then returns a
          CompletedProcess instance.
Popen(...): A class for flexibly executing a command in a new process

Constants
---------
DEVNULL: Special value that indicates that os.devnull should be used
PIPE:    Special value that indicates a pipe should be created
STDOUT:  Special value that indicates that stderr should go to stdout


Older API
=========
call(...): Runs a command, waits for it to complete, then returns
    the return code.
check_call(...): Same as call() but raises CalledProcessError()
    if return code is not 0
check_output(...): Same as check_call() but returns the contents of
    stdout instead of a return code
getoutput(...): Runs a command in the shell, waits for it to complete,
    then returns the output
getstatusoutput(...): Runs a command in the shell, waits for it to complete,
    then returns a (exitcode, output) tuple
"""

import builtins
import errno
import io
import os
import time
import signal
import sys
import threading
import warnings
import contextlib
from time import monotonic as _time


__all__ = ["Popen", "PIPE", "STDOUT", "call", "check_call", "getstatusoutput",
           "getoutput", "check_output", "run", "CalledProcessError", "DEVNULL",
           "SubprocessError", "TimeoutExpired", "CompletedProcess"]
           # NOTE: We intentionally exclude list2cmdline as it is
           # considered an internal implementation detail.  issue10838.

try:
    import msvcrt
    import _winapi
    _mswindows = True
except ModuleNotFoundError:
    _mswindows = False
    import _posixsubprocess
    import select
    import selectors
else:
    from _winapi import (CREATE_NEW_CONSOLE, CREATE_NEW_PROCESS_GROUP,
                         STD_INPUT_HANDLE, STD_OUTPUT_HANDLE,
                         STD_ERROR_HANDLE, SW_HIDE,
                         STARTF_USESTDHANDLES, STARTF_USESHOWWINDOW,
                         ABOVE_NORMAL_PRIORITY_CLASS, BELOW_NORMAL_PRIORITY_CLASS,
                         HIGH_PRIORITY_CLASS, IDLE_PRIORITY_CLASS,
                         NORMAL_PRIORITY_CLASS, REALTIME_PRIORITY_CLASS,
                         CREATE_NO_WINDOW, DETACHED_PROCESS,
                         CREATE_DEFAULT_ERROR_MODE, CREATE_BREAKAWAY_FROM_JOB)

    __all__.extend(["CREATE_NEW_CONSOLE", "CREATE_NEW_PROCESS_GROUP",
                    "STD_INPUT_HANDLE", "STD_OUTPUT_HANDLE",
                    "STD_ERROR_HANDLE", "SW_HIDE",
                    "STARTF_USESTDHANDLES", "STARTF_USESHOWWINDOW",
                    "STARTUPINFO",
                    "ABOVE_NORMAL_PRIORITY_CLASS", "BELOW_NORMAL_PRIORITY_CLASS",
                    "HIGH_PRIORITY_CLASS", "IDLE_PRIORITY_CLASS",
                    "NORMAL_PRIORITY_CLASS", "REALTIME_PRIORITY_CLASS",
                    "CREATE_NO_WINDOW", "DETACHED_PROCESS",
                    "CREATE_DEFAULT_ERROR_MODE", "CREATE_BREAKAWAY_FROM_JOB"])


# Exception classes used by this module.
class SubprocessError(Exception): pass


class CalledProcessError(SubprocessError):
    """Raised when run() is called with check=True and the process
    returns a non-zero exit status.

    Attributes:
      cmd, returncode, stdout, stderr, output
    """
    def __init__(self, returncode, cmd, output=None, stderr=None):
        self.returncode = returncode
        self.cmd = cmd
        self.output = output
        self.stderr = stderr

    def __str__(self):
        if self.returncode and self.returncode < 0:
            try:
                return "Command '%s' died with %r." % (
                        self.cmd, signal.Signals(-self.returncode))
            except ValueError:
                return "Command '%s' died with unknown signal %d." % (
                        self.cmd, -self.returncode)
        else:
            return "Command '%s' returned non-zero exit status %d." % (
                    self.cmd, self.returncode)

    @property
    def stdout(self):
        """Alias for output attribute, to match stderr"""
        return self.output

    @stdout.setter
    def stdout(self, value):
        # There's no obvious reason to set this, but allow it anyway so
        # .stdout is a transparent alias for .output
        self.output = value


class TimeoutExpired(SubprocessError):
    """This exception is raised when the timeout expires while waiting for a
    child process.

    Attributes:
        cmd, output, stdout, stderr, timeout
    """
    def __init__(self, cmd, timeout, output=None, stderr=None):
        self.cmd = cmd
        self.timeout = timeout
        self.output = output
        self.stderr = stderr

    def __str__(self):
        return ("Command '%s' timed out after %s seconds" %
                (self.cmd, self.timeout))

    @property
    def stdout(self):
        return self.output

    @stdout.setter
    def stdout(self, value):
        # There's no obvious reason to set this, but allow it anyway so
        # .stdout is a transparent alias for .output
        self.output = value


if _mswindows:
    class STARTUPINFO:
        def __init__(self, *, dwFlags=0, hStdInput=None, hStdOutput=None,
                     hStdError=None, wShowWindow=0, lpAttributeList=None):
            self.dwFlags = dwFlags
            self.hStdInput = hStdInput
            self.hStdOutput = hStdOutput
            self.hStdError = hStdError
            self.wShowWindow = wShowWindow
            self.lpAttributeList = lpAttributeList or {"handle_list": []}

        def copy(self):
            attr_list = self.lpAttributeList.copy()
            if 'handle_list' in attr_list:
                attr_list['handle_list'] = list(attr_list['handle_list'])

            return STARTUPINFO(dwFlags=self.dwFlags,
                               hStdInput=self.hStdInput,
                               hStdOutput=self.hStdOutput,
                               hStdError=self.hStdError,
                               wShowWindow=self.wShowWindow,
                               lpAttributeList=attr_list)


    class Handle(int):
        closed = False

        def Close(self, CloseHandle=_winapi.CloseHandle):
            if not self.closed:
                self.closed = True
                CloseHandle(self)

        def Detach(self):
            if not self.closed:
                self.closed = True
                return int(self)
            raise ValueError("already closed")

        def __repr__(self):
            return "%s(%d)" % (self.__class__.__name__, int(self))

        __del__ = Close
else:
    # When select or poll has indicated that the file is writable,
    # we can write up to _PIPE_BUF bytes without risk of blocking.
    # POSIX defines PIPE_BUF as >= 512.
    _PIPE_BUF = getattr(select, 'PIPE_BUF', 512)

    # poll/select have the advantage of not requiring any extra file
    # descriptor, contrarily to epoll/kqueue (also, they require a single
    # syscall).
    if hasattr(selectors, 'PollSelector'):
        _PopenSelector = selectors.PollSelector
    else:
        _PopenSelector = selectors.SelectSelector


if _mswindows:
    # On Windows we just need to close `Popen._handle` when we no longer need
    # it, so that the kernel can free it. `Popen._handle` gets closed
    # implicitly when the `Popen` instance is finalized (see `Handle.__del__`,
    # which is calling `CloseHandle` as requested in [1]), so there is nothing
    # for `_cleanup` to do.
    #
    # [1] https://docs.microsoft.com/en-us/windows/desktop/ProcThread/
    # creating-processes
    _active = None

    def _cleanup():
        pass
else:
    # This lists holds Popen instances for which the underlying process had not
    # exited at the time its __del__ method got called: those processes are
    # wait()ed for synchronously from _cleanup() when a new Popen object is
    # created, to avoid zombie processes.
    _active = []

    def _cleanup():
        if _active is None:
            return
        for inst in _active[:]:
            res = inst._internal_poll(_deadstate=sys.maxsize)
            if res is not None:
                try:
                    _active.remove(inst)
                except ValueError:
                    # This can happen if two threads create a new Popen instance.
                    # It's harmless that it was already removed, so ignore.
                    pass

PIPE = -1
STDOUT = -2
DEVNULL = -3


# XXX This function is only used by multiprocessing and the test suite,
# but it's here so that it can be imported when Python is compiled without
# threads.

def _optim_args_from_interpreter_flags():
    """Return a list of command-line arguments reproducing the current
    optimization settings in sys.flags."""
    args = []
    value = sys.flags.optimize
    if value > 0:
        args.append('-' + 'O' * value)
    return args


def _args_from_interpreter_flags():
    """Return a list of command-line arguments reproducing the current
    settings in sys.flags, sys.warnoptions and sys._xoptions."""
    flag_opt_map = {
        'debug': 'd',
        # 'inspect': 'i',
        # 'interactive': 'i',
        'dont_write_bytecode': 'B',
        'no_site': 'S',
        'verbose': 'v',
        'bytes_warning': 'b',
        'quiet': 'q',
        # -O is handled in _optim_args_from_interpreter_flags()
    }
    args = _optim_args_from_interpreter_flags()
    for flag, opt in flag_opt_map.items():
        v = getattr(sys.flags, flag)
        if v > 0:
            args.append('-' + opt * v)

    if sys.flags.isolated:
        args.append('-I')
    else:
        if sys.flags.ignore_environment:
            args.append('-E')
        if sys.flags.no_user_site:
            args.append('-s')

    # -W options
    warnopts = sys.warnoptions[:]
    bytes_warning = sys.flags.bytes_warning
    xoptions = getattr(sys, '_xoptions', {})
    dev_mode = ('dev' in xoptions)

    if bytes_warning > 1:
        warnopts.remove("error::BytesWarning")
    elif bytes_warning:
        warnopts.remove("default::BytesWarning")
    if dev_mode:
        warnopts.remove('default')
    for opt in warnopts:
        args.append('-W' + opt)

    # -X options
    if dev_mode:
        args.extend(('-X', 'dev'))
    for opt in ('faulthandler', 'tracemalloc', 'importtime',
                'showalloccount', 'showrefcount', 'utf8'):
        if opt in xoptions:
            value = xoptions[opt]
            if value is True:
                arg = opt
            else:
                arg = '%s=%s' % (opt, value)
            args.extend(('-X', arg))

    return args


def call(*popenargs, timeout=None, **kwargs):
    """Run command with arguments.  Wait for command to complete or
    timeout, then return the returncode attribute.

    The arguments are the same as for the Popen constructor.  Example:

    retcode = call(["ls", "-l"])
    """
    with Popen(*popenargs, **kwargs) as p:
        try:
            return p.wait(timeout=timeout)
        except:  # Including KeyboardInterrupt, wait handled that.
            p.kill()
            # We don't call p.wait() again as p.__exit__ does that for us.
            raise


def check_call(*popenargs, **kwargs):
    """Run command with arguments.  Wait for command to complete.  If
    the exit code was zero then return, otherwise raise
    CalledProcessError.  The CalledProcessError object will have the
    return code in the returncode attribute.

    The arguments are the same as for the call function.  Example:

    check_call(["ls", "-l"])
    """
    retcode = call(*popenargs, **kwargs)
    if retcode:
        cmd = kwargs.get("args")
        if cmd is None:
            cmd = popenargs[0]
        raise CalledProcessError(retcode, cmd)
    return 0


def check_output(*popenargs, timeout=None, **kwargs):
    r"""Run command with arguments and return its output.

    If the exit code was non-zero it raises a CalledProcessError.  The
    CalledProcessError object will have the return code in the returncode
    attribute and output in the output attribute.

    The arguments are the same as for the Popen constructor.  Example:

    >>> check_output(["ls", "-l", "/dev/null"])
    b'crw-rw-rw- 1 root root 1, 3 Oct 18  2007 /dev/null\n'

    The stdout argument is not allowed as it is used internally.
    To capture standard error in the result, use stderr=STDOUT.

    >>> check_output(["/bin/sh", "-c",
    ...               "ls -l non_existent_file ; exit 0"],
    ...              stderr=STDOUT)
    b'ls: non_existent_file: No such file or directory\n'

    There is an additional optional argument, "input", allowing you to
    pass a string to the subprocess's stdin.  If you use this argument
    you may not also use the Popen constructor's "stdin" argument, as
    it too will be used internally.  Example:

    >>> check_output(["sed", "-e", "s/foo/bar/"],
    ...              input=b"when in the course of fooman events\n")
    b'when in the course of barman events\n'

    By default, all communication is in bytes, and therefore any "input"
    should be bytes, and the return value will be bytes.  If in text mode,
    any "input" should be a string, and the return value will be a string
    decoded according to locale encoding, or by "encoding" if set. Text mode
    is triggered by setting any of text, encoding, errors or universal_newlines.
    """
    if 'stdout' in kwargs:
        raise ValueError('stdout argument not allowed, it will be overridden.')

    if 'input' in kwargs and kwargs['input'] is None:
        # Explicitly passing input=None was previously equivalent to passing an
        # empty string. That is maintained here for backwards compatibility.
        if kwargs.get('universal_newlines') or kwargs.get('text'):
            empty = ''
        else:
            empty = b''
        kwargs['input'] = empty

    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
               **kwargs).stdout


class CompletedProcess(object):
    """A process that has finished running.

    This is returned by run().

    Attributes:
      args: The list or str args passed to run().
      returncode: The exit code of the process, negative for signals.
      stdout: The standard output (None if not captured).
      stderr: The standard error (None if not captured).
    """
    def __init__(self, args, returncode, stdout=None, stderr=None):
        self.args = args
        self.returncode = returncode
        self.stdout = stdout
        self.stderr = stderr

    def __repr__(self):
        args = ['args={!r}'.format(self.args),
                'returncode={!r}'.format(self.returncode)]
        if self.stdout is not None:
            args.append('stdout={!r}'.format(self.stdout))
        if self.stderr is not None:
            args.append('stderr={!r}'.format(self.stderr))
        return "{}({})".format(type(self).__name__, ', '.join(args))

    def check_returncode(self):
        """Raise CalledProcessError if the exit code is non-zero."""
        if self.returncode:
            raise CalledProcessError(self.returncode, self.args, self.stdout,
                                     self.stderr)


def run(*popenargs,
        input=None, capture_output=False, timeout=None, check=False, **kwargs):
    """Run command with arguments and return a CompletedProcess instance.

    The returned instance will have attributes args, returncode, stdout and
    stderr. By default, stdout and stderr are not captured, and those attributes
    will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them.

    If check is True and the exit code was non-zero, it raises a
    CalledProcessError. The CalledProcessError object will have the return code
    in the returncode attribute, and output & stderr attributes if those streams
    were captured.

    If timeout is given, and the process takes too long, a TimeoutExpired
    exception will be raised.

    There is an optional argument "input", allowing you to
    pass bytes or a string to the subprocess's stdin.  If you use this argument
    you may not also use the Popen constructor's "stdin" argument, as
    it will be used internally.

    By default, all communication is in bytes, and therefore any "input" should
    be bytes, and the stdout and stderr will be bytes. If in text mode, any
    "input" should be a string, and stdout and stderr will be strings decoded
    according to locale encoding, or by "encoding" if set. Text mode is
    triggered by setting any of text, encoding, errors or universal_newlines.

    The other arguments are the same as for the Popen constructor.
    """
    if input is not None:
        if kwargs.get('stdin') is not None:
            raise ValueError('stdin and input arguments may not both be used.')
        kwargs['stdin'] = PIPE

    if capture_output:
        if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:
            raise ValueError('stdout and stderr arguments may not be used '
                             'with capture_output.')
        kwargs['stdout'] = PIPE
        kwargs['stderr'] = PIPE

    with Popen(*popenargs, **kwargs) as process:
        try:
            stdout, stderr = process.communicate(input, timeout=timeout)
        except TimeoutExpired as exc:
            process.kill()
            if _mswindows:
                # Windows accumulates the output in a single blocking
                # read() call run on child threads, with the timeout
                # being done in a join() on those threads.  communicate()
                # _after_ kill() is required to collect that and add it
                # to the exception.
                exc.stdout, exc.stderr = process.communicate()
            else:
                # POSIX _communicate already populated the output so
                # far into the TimeoutExpired exception.
                process.wait()
            raise
        except:  # Including KeyboardInterrupt, communicate handled that.
            process.kill()
            # We don't call process.wait() as .__exit__ does that for us.
            raise
        retcode = process.poll()
        if check and retcode:
            raise CalledProcessError(retcode, process.args,
                                     output=stdout, stderr=stderr)
    return CompletedProcess(process.args, retcode, stdout, stderr)


def list2cmdline(seq):
    """
    Translate a sequence of arguments into a command line
    string, using the same rules as the MS C runtime:

    1) Arguments are delimited by white space, which is either a
       space or a tab.

    2) A string surrounded by double quotation marks is
       interpreted as a single argument, regardless of white space
       contained within.  A quoted string can be embedded in an
       argument.

    3) A double quotation mark preceded by a backslash is
       interpreted as a literal double quotation mark.

    4) Backslashes are interpreted literally, unless they
       immediately precede a double quotation mark.

    5) If backslashes immediately precede a double quotation mark,
       every pair of backslashes is interpreted as a literal
       backslash.  If the number of backslashes is odd, the last
       backslash escapes the next double quotation mark as
       described in rule 3.
    """

    # See
    # http://msdn.microsoft.com/en-us/library/17w5ykft.aspx
    # or search http://msdn.microsoft.com for
    # "Parsing C++ Command-Line Arguments"
    result = []
    needquote = False
    for arg in map(os.fsdecode, seq):
        bs_buf = []

        # Add a space to separate this argument from the others
        if result:
            result.append(' ')

        needquote = (" " in arg) or ("\t" in arg) or not arg
        if needquote:
            result.append('"')

        for c in arg:
            if c == '\\':
                # Don't know if we need to double yet.
                bs_buf.append(c)
            elif c == '"':
                # Double backslashes.
                result.append('\\' * len(bs_buf)*2)
                bs_buf = []
                result.append('\\"')
            else:
                # Normal char
                if bs_buf:
                    result.extend(bs_buf)
                    bs_buf = []
                result.append(c)

        # Add remaining backslashes, if any.
        if bs_buf:
            result.extend(bs_buf)

        if needquote:
            result.extend(bs_buf)
            result.append('"')

    return ''.join(result)


# Various tools for executing commands and looking at their output and status.
#

def getstatusoutput(cmd):
    """Return (exitcode, output) of executing cmd in a shell.

    Execute the string 'cmd' in a shell with 'check_output' and
    return a 2-tuple (status, output). The locale encoding is used
    to decode the output and process newlines.

    A trailing newline is stripped from the output.
    The exit status for the command can be interpreted
    according to the rules for the function 'wait'. Example:

    >>> import subprocess
    >>> subprocess.getstatusoutput('ls /bin/ls')
    (0, '/bin/ls')
    >>> subprocess.getstatusoutput('cat /bin/junk')
    (1, 'cat: /bin/junk: No such file or directory')
    >>> subprocess.getstatusoutput('/bin/junk')
    (127, 'sh: /bin/junk: not found')
    >>> subprocess.getstatusoutput('/bin/kill $$')
    (-15, '')
    """
    try:
        data = check_output(cmd, shell=True, text=True, stderr=STDOUT)
        exitcode = 0
    except CalledProcessError as ex:
        data = ex.output
        exitcode = ex.returncode
    if data[-1:] == '\n':
        data = data[:-1]
    return exitcode, data

def getoutput(cmd):
    """Return output (stdout or stderr) of executing cmd in a shell.

    Like getstatusoutput(), except the exit status is ignored and the return
    value is a string containing the command's output.  Example:

    >>> import subprocess
    >>> subprocess.getoutput('ls /bin/ls')
    '/bin/ls'
    """
    return getstatusoutput(cmd)[1]


def _use_posix_spawn():
    """Check if posix_spawn() can be used for subprocess.

    subprocess requires a posix_spawn() implementation that properly reports
    errors to the parent process, & sets errno on the following failures:

    * Process attribute actions failed.
    * File actions failed.
    * exec() failed.

    Prefer an implementation which can use vfork() in some cases for best
    performance.
    """
    if _mswindows or not hasattr(os, 'posix_spawn'):
        # os.posix_spawn() is not available
        return False

    if sys.platform == 'darwin':
        # posix_spawn() is a syscall on macOS and properly reports errors
        return True

    # Check libc name and runtime libc version
    try:
        ver = os.confstr('CS_GNU_LIBC_VERSION')
        # parse 'glibc 2.28' as ('glibc', (2, 28))
        parts = ver.split(maxsplit=1)
        if len(parts) != 2:
            # reject unknown format
            raise ValueError
        libc = parts[0]
        version = tuple(map(int, parts[1].split('.')))

        if sys.platform == 'linux' and libc == 'glibc' and version >= (2, 24):
            # glibc 2.24 has a new Linux posix_spawn implementation using vfork
            # which properly reports errors to the parent process.
            return True
        # Note: Don't use the implementation in earlier glibc because it doesn't
        # use vfork (even if glibc 2.26 added a pipe to properly report errors
        # to the parent process).
    except (AttributeError, ValueError, OSError):
        # os.confstr() or CS_GNU_LIBC_VERSION value not available
        pass

    # By default, assume that posix_spawn() does not properly report errors.
    return False


_USE_POSIX_SPAWN = _use_posix_spawn()


class Popen(object):
    """ Execute a child program in a new process.

    For a complete description of the arguments see the Python documentation.

    Arguments:
      args: A string, or a sequence of program arguments.

      bufsize: supplied as the buffering argument to the open() function when
          creating the stdin/stdout/stderr pipe file objects

      executable: A replacement program to execute.

      stdin, stdout and stderr: These specify the executed programs' standard
          input, standard output and standard error file handles, respectively.

      preexec_fn: (POSIX only) An object to be called in the child process
          just before the child is executed.

      close_fds: Controls closing or inheriting of file descriptors.

      shell: If true, the command will be executed through the shell.

      cwd: Sets the current directory before the child is executed.

      env: Defines the environment variables for the new process.

      text: If true, decode stdin, stdout and stderr using the given encoding
          (if set) or the system default otherwise.

      universal_newlines: Alias of text, provided for backwards compatibility.

      startupinfo and creationflags (Windows only)

      restore_signals (POSIX only)

      start_new_session (POSIX only)

      pass_fds (POSIX only)

      encoding and errors: Text mode encoding and error handling to use for
          file objects stdin, stdout and stderr.

    Attributes:
        stdin, stdout, stderr, pid, returncode
    """
    _child_created = False  # Set here since __del__ checks it

    def __init__(self, args, bufsize=-1, executable=None,
                 stdin=None, stdout=None, stderr=None,
                 preexec_fn=None, close_fds=True,
                 shell=False, cwd=None, env=None, universal_newlines=None,
                 startupinfo=None, creationflags=0,
                 restore_signals=True, start_new_session=False,
                 pass_fds=(), *, encoding=None, errors=None, text=None):
        """Create new Popen instance."""
        _cleanup()
        # Held while anything is calling waitpid before returncode has been
        # updated to prevent clobbering returncode if wait() or poll() are
        # called from multiple threads at once.  After acquiring the lock,
        # code must re-check self.returncode to see if another thread just
        # finished a waitpid() call.
        self._waitpid_lock = threading.Lock()

        self._input = None
        self._communication_started = False
        if bufsize is None:
            bufsize = -1  # Restore default
        if not isinstance(bufsize, int):
            raise TypeError("bufsize must be an integer")

        if _mswindows:
            if preexec_fn is not None:
                raise ValueError("preexec_fn is not supported on Windows "
                                 "platforms")
        else:
            # POSIX
            if pass_fds and not close_fds:
                warnings.warn("pass_fds overriding close_fds.", RuntimeWarning)
                close_fds = True
            if startupinfo is not None:
                raise ValueError("startupinfo is only supported on Windows "
                                 "platforms")
            if creationflags != 0:
                raise ValueError("creationflags is only supported on Windows "
                                 "platforms")

        self.args = args
        self.stdin = None
        self.stdout = None
        self.stderr = None
        self.pid = None
        self.returncode = None
        self.encoding = encoding
        self.errors = errors

        # Validate the combinations of text and universal_newlines
        if (text is not None and universal_newlines is not None
            and bool(universal_newlines) != bool(text)):
            raise SubprocessError('Cannot disambiguate when both text '
                                  'and universal_newlines are supplied but '
                                  'different. Pass one or the other.')

        # Input and output objects. The general principle is like
        # this:
        #
        # Parent                   Child
        # ------                   -----
        # p2cwrite   ---stdin--->  p2cread
        # c2pread    <--stdout---  c2pwrite
        # errread    <--stderr---  errwrite
        #
        # On POSIX, the child objects are file descriptors.  On
        # Windows, these are Windows file handles.  The parent objects
        # are file descriptors on both platforms.  The parent objects
        # are -1 when not using PIPEs. The child objects are -1
        # when not redirecting.

        (p2cread, p2cwrite,
         c2pread, c2pwrite,
         errread, errwrite) = self._get_handles(stdin, stdout, stderr)

        # We wrap OS handles *before* launching the child, otherwise a
        # quickly terminating child could make our fds unwrappable
        # (see #8458).

        if _mswindows:
            if p2cwrite != -1:
                p2cwrite = msvcrt.open_osfhandle(p2cwrite.Detach(), 0)
            if c2pread != -1:
                c2pread = msvcrt.open_osfhandle(c2pread.Detach(), 0)
            if errread != -1:
                errread = msvcrt.open_osfhandle(errread.Detach(), 0)

        self.text_mode = encoding or errors or text or universal_newlines

        # How long to resume waiting on a child after the first ^C.
        # There is no right value for this.  The purpose is to be polite
        # yet remain good for interactive users trying to exit a tool.
        self._sigint_wait_secs = 0.25  # 1/xkcd221.getRandomNumber()

        self._closed_child_pipe_fds = False

        if self.text_mode:
            if bufsize == 1:
                line_buffering = True
                # Use the default buffer size for the underlying binary streams
                # since they don't support line buffering.
                bufsize = -1
            else:
                line_buffering = False

        try:
            if p2cwrite != -1:
                self.stdin = io.open(p2cwrite, 'wb', bufsize)
                if self.text_mode:
                    self.stdin = io.TextIOWrapper(self.stdin, write_through=True,
                            line_buffering=line_buffering,
                            encoding=encoding, errors=errors)
            if c2pread != -1:
                self.stdout = io.open(c2pread, 'rb', bufsize)
                if self.text_mode:
                    self.stdout = io.TextIOWrapper(self.stdout,
                            encoding=encoding, errors=errors)
            if errread != -1:
                self.stderr = io.open(errread, 'rb', bufsize)
                if self.text_mode:
                    self.stderr = io.TextIOWrapper(self.stderr,
                            encoding=encoding, errors=errors)

            self._execute_child(args, executable, preexec_fn, close_fds,
                                pass_fds, cwd, env,
                                startupinfo, creationflags, shell,
                                p2cread, p2cwrite,
                                c2pread, c2pwrite,
                                errread, errwrite,
                                restore_signals, start_new_session)
        except:
            # Cleanup if the child failed starting.
            for f in filter(None, (self.stdin, self.stdout, self.stderr)):
                try:
                    f.close()
                except OSError:
                    pass  # Ignore EBADF or other errors.

            if not self._closed_child_pipe_fds:
                to_close = []
                if stdin == PIPE:
                    to_close.append(p2cread)
                if stdout == PIPE:
                    to_close.append(c2pwrite)
                if stderr == PIPE:
                    to_close.append(errwrite)
                if hasattr(self, '_devnull'):
                    to_close.append(self._devnull)
                for fd in to_close:
                    try:
                        if _mswindows and isinstance(fd, Handle):
                            fd.Close()
                        else:
                            os.close(fd)
                    except OSError:
                        pass

            raise

    @property
    def universal_newlines(self):
        # universal_newlines as retained as an alias of text_mode for API
        # compatibility. bpo-31756
        return self.text_mode

    @universal_newlines.setter
    def universal_newlines(self, universal_newlines):
        self.text_mode = bool(universal_newlines)

    def _translate_newlines(self, data, encoding, errors):
        data = data.decode(encoding, errors)
        return data.replace("\r\n", "\n").replace("\r", "\n")

    def __enter__(self):
        return self

    def __exit__(self, exc_type, value, traceback):
        if self.stdout:
            self.stdout.close()
        if self.stderr:
            self.stderr.close()
        try:  # Flushing a BufferedWriter may raise an error
            if self.stdin:
                self.stdin.close()
        finally:
            if exc_type == KeyboardInterrupt:
                # https://bugs.python.org/issue25942
                # In the case of a KeyboardInterrupt we assume the SIGINT
                # was also already sent to our child processes.  We can't
                # block indefinitely as that is not user friendly.
                # If we have not already waited a brief amount of time in
                # an interrupted .wait() or .communicate() call, do so here
                # for consistency.
                if self._sigint_wait_secs > 0:
                    try:
                        self._wait(timeout=self._sigint_wait_secs)
                    except TimeoutExpired:
                        pass
                self._sigint_wait_secs = 0  # Note that this has been done.
                return  # resume the KeyboardInterrupt

            # Wait for the process to terminate, to avoid zombies.
            self.wait()

    def __del__(self, _maxsize=sys.maxsize, _warn=warnings.warn):
        if not self._child_created:
            # We didn't get to successfully create a child process.
            return
        if self.returncode is None:
            # Not reading subprocess exit status creates a zombie process which
            # is only destroyed at the parent python process exit
            _warn("subprocess %s is still running" % self.pid,
                  ResourceWarning, source=self)
        # In case the child hasn't been waited on, check if it's done.
        self._internal_poll(_deadstate=_maxsize)
        if self.returncode is None and _active is not None:
            # Child is still running, keep us alive until we can wait on it.
            _active.append(self)

    def _get_devnull(self):
        if not hasattr(self, '_devnull'):
            self._devnull = os.open(os.devnull, os.O_RDWR)
        return self._devnull

    def _stdin_write(self, input):
        if input:
            try:
                self.stdin.write(input)
            except BrokenPipeError:
                pass  # communicate() must ignore broken pipe errors.
            except OSError as exc:
                if exc.errno == errno.EINVAL:
                    # bpo-19612, bpo-30418: On Windows, stdin.write() fails
                    # with EINVAL if the child process exited or if the child
                    # process is still running but closed the pipe.
                    pass
                else:
                    raise

        try:
            self.stdin.close()
        except BrokenPipeError:
            pass  # communicate() must ignore broken pipe errors.
        except OSError as exc:
            if exc.errno == errno.EINVAL:
                pass
            else:
                raise

    def communicate(self, input=None, timeout=None):
        """Interact with process: Send data to stdin and close it.
        Read data from stdout and stderr, until end-of-file is
        reached.  Wait for process to terminate.

        The optional "input" argument should be data to be sent to the
        child process, or None, if no data should be sent to the child.
        communicate() returns a tuple (stdout, stderr).

        By default, all communication is in bytes, and therefore any
        "input" should be bytes, and the (stdout, stderr) will be bytes.
        If in text mode (indicated by self.text_mode), any "input" should
        be a string, and (stdout, stderr) will be strings decoded
        according to locale encoding, or by "encoding" if set. Text mode
        is triggered by setting any of text, encoding, errors or
        universal_newlines.
        """

        if self._communication_started and input:
            raise ValueError("Cannot send input after starting communication")

        # Optimization: If we are not worried about timeouts, we haven't
        # started communicating, and we have one or zero pipes, using select()
        # or threads is unnecessary.
        if (timeout is None and not self._communication_started and
            [self.stdin, self.stdout, self.stderr].count(None) >= 2):
            stdout = None
            stderr = None
            if self.stdin:
                self._stdin_write(input)
            elif self.stdout:
                stdout = self.stdout.read()
                self.stdout.close()
            elif self.stderr:
                stderr = self.stderr.read()
                self.stderr.close()
            self.wait()
        else:
            if timeout is not None:
                endtime = _time() + timeout
            else:
                endtime = None

            try:
                stdout, stderr = self._communicate(input, endtime, timeout)
            except KeyboardInterrupt:
                # https://bugs.python.org/issue25942
                # See the detailed comment in .wait().
                if timeout is not None:
                    sigint_timeout = min(self._sigint_wait_secs,
                                         self._remaining_time(endtime))
                else:
                    sigint_timeout = self._sigint_wait_secs
                self._sigint_wait_secs = 0  # nothing else should wait.
                try:
                    self._wait(timeout=sigint_timeout)
                except TimeoutExpired:
                    pass
                raise  # resume the KeyboardInterrupt

            finally:
                self._communication_started = True

            sts = self.wait(timeout=self._remaining_time(endtime))

        return (stdout, stderr)


    def poll(self):
        """Check if child process has terminated. Set and return returncode
        attribute."""
        return self._internal_poll()


    def _remaining_time(self, endtime):
        """Convenience for _communicate when computing timeouts."""
        if endtime is None:
            return None
        else:
            return endtime - _time()


    def _check_timeout(self, endtime, orig_timeout, stdout_seq, stderr_seq,
                       skip_check_and_raise=False):
        """Convenience for checking if a timeout has expired."""
        if endtime is None:
            return
        if skip_check_and_raise or _time() > endtime:
            raise TimeoutExpired(
                    self.args, orig_timeout,
                    output=b''.join(stdout_seq) if stdout_seq else None,
                    stderr=b''.join(stderr_seq) if stderr_seq else None)


    def wait(self, timeout=None):
        """Wait for child process to terminate; returns self.returncode."""
        if timeout is not None:
            endtime = _time() + timeout
        try:
            return self._wait(timeout=timeout)
        except KeyboardInterrupt:
            # https://bugs.python.org/issue25942
            # The first keyboard interrupt waits briefly for the child to
            # exit under the common assumption that it also received the ^C
            # generated SIGINT and will exit rapidly.
            if timeout is not None:
                sigint_timeout = min(self._sigint_wait_secs,
                                     self._remaining_time(endtime))
            else:
                sigint_timeout = self._sigint_wait_secs
            self._sigint_wait_secs = 0  # nothing else should wait.
            try:
                self._wait(timeout=sigint_timeout)
            except TimeoutExpired:
                pass
            raise  # resume the KeyboardInterrupt

    def _close_pipe_fds(self,
                        p2cread, p2cwrite,
                        c2pread, c2pwrite,
                        errread, errwrite):
        # self._devnull is not always defined.
        devnull_fd = getattr(self, '_devnull', None)

        with contextlib.ExitStack() as stack:
            if _mswindows:
                if p2cread != -1:
                    stack.callback(p2cread.Close)
                if c2pwrite != -1:
                    stack.callback(c2pwrite.Close)
                if errwrite != -1:
                    stack.callback(errwrite.Close)
            else:
                if p2cread != -1 and p2cwrite != -1 and p2cread != devnull_fd:
                    stack.callback(os.close, p2cread)
                if c2pwrite != -1 and c2pread != -1 and c2pwrite != devnull_fd:
                    stack.callback(os.close, c2pwrite)
                if errwrite != -1 and errread != -1 and errwrite != devnull_fd:
                    stack.callback(os.close, errwrite)

            if devnull_fd is not None:
                stack.callback(os.close, devnull_fd)

        # Prevent a double close of these handles/fds from __init__ on error.
        self._closed_child_pipe_fds = True

    if _mswindows:
        #
        # Windows methods
        #
        def _get_handles(self, stdin, stdout, stderr):
            """Construct and return tuple with IO objects:
            p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite
            """
            if stdin is None and stdout is None and stderr is None:
                return (-1, -1, -1, -1, -1, -1)

            p2cread, p2cwrite = -1, -1
            c2pread, c2pwrite = -1, -1
            errread, errwrite = -1, -1

            if stdin is None:
                p2cread = _winapi.GetStdHandle(_winapi.STD_INPUT_HANDLE)
                if p2cread is None:
                    p2cread, _ = _winapi.CreatePipe(None, 0)
                    p2cread = Handle(p2cread)
                    _winapi.CloseHandle(_)
            elif stdin == PIPE:
                p2cread, p2cwrite = _winapi.CreatePipe(None, 0)
                p2cread, p2cwrite = Handle(p2cread), Handle(p2cwrite)
            elif stdin == DEVNULL:
                p2cread = msvcrt.get_osfhandle(self._get_devnull())
            elif isinstance(stdin, int):
                p2cread = msvcrt.get_osfhandle(stdin)
            else:
                # Assuming file-like object
                p2cread = msvcrt.get_osfhandle(stdin.fileno())
            p2cread = self._make_inheritable(p2cread)

            if stdout is None:
                c2pwrite = _winapi.GetStdHandle(_winapi.STD_OUTPUT_HANDLE)
                if c2pwrite is None:
                    _, c2pwrite = _winapi.CreatePipe(None, 0)
                    c2pwrite = Handle(c2pwrite)
                    _winapi.CloseHandle(_)
            elif stdout == PIPE:
                c2pread, c2pwrite = _winapi.CreatePipe(None, 0)
                c2pread, c2pwrite = Handle(c2pread), Handle(c2pwrite)
            elif stdout == DEVNULL:
                c2pwrite = msvcrt.get_osfhandle(self._get_devnull())
            elif isinstance(stdout, int):
                c2pwrite = msvcrt.get_osfhandle(stdout)
            else:
                # Assuming file-like object
                c2pwrite = msvcrt.get_osfhandle(stdout.fileno())
            c2pwrite = self._make_inheritable(c2pwrite)

            if stderr is None:
                errwrite = _winapi.GetStdHandle(_winapi.STD_ERROR_HANDLE)
                if errwrite is None:
                    _, errwrite = _winapi.CreatePipe(None, 0)
                    errwrite = Handle(errwrite)
                    _winapi.CloseHandle(_)
            elif stderr == PIPE:
                errread, errwrite = _winapi.CreatePipe(None, 0)
                errread, errwrite = Handle(errread), Handle(errwrite)
            elif stderr == STDOUT:
                errwrite = c2pwrite
            elif stderr == DEVNULL:
                errwrite = msvcrt.get_osfhandle(self._get_devnull())
            elif isinstance(stderr, int):
                errwrite = msvcrt.get_osfhandle(stderr)
            else:
                # Assuming file-like object
                errwrite = msvcrt.get_osfhandle(stderr.fileno())
            errwrite = self._make_inheritable(errwrite)

            return (p2cread, p2cwrite,
                    c2pread, c2pwrite,
                    errread, errwrite)


        def _make_inheritable(self, handle):
            """Return a duplicate of handle, which is inheritable"""
            h = _winapi.DuplicateHandle(
                _winapi.GetCurrentProcess(), handle,
                _winapi.GetCurrentProcess(), 0, 1,
                _winapi.DUPLICATE_SAME_ACCESS)
            return Handle(h)


        def _filter_handle_list(self, handle_list):
            """Filter out console handles that can't be used
            in lpAttributeList["handle_list"] and make sure the list
            isn't empty. This also removes duplicate handles."""
            # An handle with it's lowest two bits set might be a special console
            # handle that if passed in lpAttributeList["handle_list"], will
            # cause it to fail.
            return list({handle for handle in handle_list
                         if handle & 0x3 != 0x3
                         or _winapi.GetFileType(handle) !=
                            _winapi.FILE_TYPE_CHAR})


        def _execute_child(self, args, executable, preexec_fn, close_fds,
                           pass_fds, cwd, env,
                           startupinfo, creationflags, shell,
                           p2cread, p2cwrite,
                           c2pread, c2pwrite,
                           errread, errwrite,
                           unused_restore_signals, unused_start_new_session):
            """Execute program (MS Windows version)"""

            assert not pass_fds, "pass_fds not supported on Windows."

            if isinstance(args, str):
                pass
            elif isinstance(args, bytes):
                if shell:
                    raise TypeError('bytes args is not allowed on Windows')
                args = list2cmdline([args])
            elif isinstance(args, os.PathLike):
                if shell:
                    raise TypeError('path-like args is not allowed when '
                                    'shell is true')
                args = list2cmdline([args])
            else:
                args = list2cmdline(args)

            if executable is not None:
                executable = os.fsdecode(executable)

            # Process startup details
            if startupinfo is None:
                startupinfo = STARTUPINFO()
            else:
                # bpo-34044: Copy STARTUPINFO since it is modified above,
                # so the caller can reuse it multiple times.
                startupinfo = startupinfo.copy()

            use_std_handles = -1 not in (p2cread, c2pwrite, errwrite)
            if use_std_handles:
                startupinfo.dwFlags |= _winapi.STARTF_USESTDHANDLES
                startupinfo.hStdInput = p2cread
                startupinfo.hStdOutput = c2pwrite
                startupinfo.hStdError = errwrite

            attribute_list = startupinfo.lpAttributeList
            have_handle_list = bool(attribute_list and
                                    "handle_list" in attribute_list and
                                    attribute_list["handle_list"])

            # If we were given an handle_list or need to create one
            if have_handle_list or (use_std_handles and close_fds):
                if attribute_list is None:
                    attribute_list = startupinfo.lpAttributeList = {}
                handle_list = attribute_list["handle_list"] = \
                    list(attribute_list.get("handle_list", []))

                if use_std_handles:
                    handle_list += [int(p2cread), int(c2pwrite), int(errwrite)]

                handle_list[:] = self._filter_handle_list(handle_list)

                if handle_list:
                    if not close_fds:
                        warnings.warn("startupinfo.lpAttributeList['handle_list'] "
                                      "overriding close_fds", RuntimeWarning)

                    # When using the handle_list we always request to inherit
                    # handles but the only handles that will be inherited are
                    # the ones in the handle_list
                    close_fds = False

            if shell:
                startupinfo.dwFlags |= _winapi.STARTF_USESHOWWINDOW
                startupinfo.wShowWindow = _winapi.SW_HIDE
                if not executable:
                    # gh-101283: without a fully-qualified path, before Windows
                    # checks the system directories, it first looks in the
                    # application directory, and also the current directory if
                    # NeedCurrentDirectoryForExePathW(ExeName) is true, so try
                    # to avoid executing unqualified "cmd.exe".
                    comspec = os.environ.get('ComSpec')
                    if not comspec:
                        system_root = os.environ.get('SystemRoot', '')
                        comspec = os.path.join(system_root, 'System32', 'cmd.exe')
                        if not os.path.isabs(comspec):
                            raise FileNotFoundError('shell not found: neither %ComSpec% nor %SystemRoot% is set')
                    if os.path.isabs(comspec):
                        executable = comspec
                else:
                    comspec = executable

                args = '{} /c "{}"'.format (comspec, args)

            if cwd is not None:
                cwd = os.fsdecode(cwd)

            sys.audit("subprocess.Popen", executable, args, cwd, env)

            # Start the process
            try:
                hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                                         # no special security
                                         None, None,
                                         int(not close_fds),
                                         creationflags,
                                         env,
                                         cwd,
                                         startupinfo)
            finally:
                # Child is launched. Close the parent's copy of those pipe
                # handles that only the child should have open.  You need
                # to make sure that no handles to the write end of the
                # output pipe are maintained in this process or else the
                # pipe will not close when the child process exits and the
                # ReadFile will hang.
                self._close_pipe_fds(p2cread, p2cwrite,
                                     c2pread, c2pwrite,
                                     errread, errwrite)

            # Retain the process handle, but close the thread handle
            self._child_created = True
            self._handle = Handle(hp)
            self.pid = pid
            _winapi.CloseHandle(ht)

        def _internal_poll(self, _deadstate=None,
                _WaitForSingleObject=_winapi.WaitForSingleObject,
                _WAIT_OBJECT_0=_winapi.WAIT_OBJECT_0,
                _GetExitCodeProcess=_winapi.GetExitCodeProcess):
            """Check if child process has terminated.  Returns returncode
            attribute.

            This method is called by __del__, so it can only refer to objects
            in its local scope.

            """
            if self.returncode is None:
                if _WaitForSingleObject(self._handle, 0) == _WAIT_OBJECT_0:
                    self.returncode = _GetExitCodeProcess(self._handle)
            return self.returncode


        def _wait(self, timeout):
            """Internal implementation of wait() on Windows."""
            if timeout is None:
                timeout_millis = _winapi.INFINITE
            else:
                timeout_millis = int(timeout * 1000)
            if self.returncode is None:
                # API note: Returns immediately if timeout_millis == 0.
                result = _winapi.WaitForSingleObject(self._handle,
                                                     timeout_millis)
                if result == _winapi.WAIT_TIMEOUT:
                    raise TimeoutExpired(self.args, timeout)
                self.returncode = _winapi.GetExitCodeProcess(self._handle)
            return self.returncode


        def _readerthread(self, fh, buffer):
            buffer.append(fh.read())
            fh.close()


        def _communicate(self, input, endtime, orig_timeout):
            # Start reader threads feeding into a list hanging off of this
            # object, unless they've already been started.
            if self.stdout and not hasattr(self, "_stdout_buff"):
                self._stdout_buff = []
                self.stdout_thread = \
                        threading.Thread(target=self._readerthread,
                                         args=(self.stdout, self._stdout_buff))
                self.stdout_thread.daemon = True
                self.stdout_thread.start()
            if self.stderr and not hasattr(self, "_stderr_buff"):
                self._stderr_buff = []
                self.stderr_thread = \
                        threading.Thread(target=self._readerthread,
                                         args=(self.stderr, self._stderr_buff))
                self.stderr_thread.daemon = True
                self.stderr_thread.start()

            if self.stdin:
                self._stdin_write(input)

            # Wait for the reader threads, or time out.  If we time out, the
            # threads remain reading and the fds left open in case the user
            # calls communicate again.
            if self.stdout is not None:
                self.stdout_thread.join(self._remaining_time(endtime))
                if self.stdout_thread.is_alive():
                    raise TimeoutExpired(self.args, orig_timeout)
            if self.stderr is not None:
                self.stderr_thread.join(self._remaining_time(endtime))
                if self.stderr_thread.is_alive():
                    raise TimeoutExpired(self.args, orig_timeout)

            # Collect the output from and close both pipes, now that we know
            # both have been read successfully.
            stdout = None
            stderr = None
            if self.stdout:
                stdout = self._stdout_buff
                self.stdout.close()
            if self.stderr:
                stderr = self._stderr_buff
                self.stderr.close()

            # All data exchanged.  Translate lists into strings.
            stdout = stdout[0] if stdout else None
            stderr = stderr[0] if stderr else None

            return (stdout, stderr)

        def send_signal(self, sig):
            """Send a signal to the process."""
            # Don't signal a process that we know has already died.
            if self.returncode is not None:
                return
            if sig == signal.SIGTERM:
                self.terminate()
            elif sig == signal.CTRL_C_EVENT:
                os.kill(self.pid, signal.CTRL_C_EVENT)
            elif sig == signal.CTRL_BREAK_EVENT:
                os.kill(self.pid, signal.CTRL_BREAK_EVENT)
            else:
                raise ValueError("Unsupported signal: {}".format(sig))

        def terminate(self):
            """Terminates the process."""
            # Don't terminate a process that we know has already died.
            if self.returncode is not None:
                return
            try:
                _winapi.TerminateProcess(self._handle, 1)
            except PermissionError:
                # ERROR_ACCESS_DENIED (winerror 5) is received when the
                # process already died.
                rc = _winapi.GetExitCodeProcess(self._handle)
                if rc == _winapi.STILL_ACTIVE:
                    raise
                self.returncode = rc

        kill = terminate

    else:
        #
        # POSIX methods
        #
        def _get_handles(self, stdin, stdout, stderr):
            """Construct and return tuple with IO objects:
            p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite
            """
            p2cread, p2cwrite = -1, -1
            c2pread, c2pwrite = -1, -1
            errread, errwrite = -1, -1

            if stdin is None:
                pass
            elif stdin == PIPE:
                p2cread, p2cwrite = os.pipe()
            elif stdin == DEVNULL:
                p2cread = self._get_devnull()
            elif isinstance(stdin, int):
                p2cread = stdin
            else:
                # Assuming file-like object
                p2cread = stdin.fileno()

            if stdout is None:
                pass
            elif stdout == PIPE:
                c2pread, c2pwrite = os.pipe()
            elif stdout == DEVNULL:
                c2pwrite = self._get_devnull()
            elif isinstance(stdout, int):
                c2pwrite = stdout
            else:
                # Assuming file-like object
                c2pwrite = stdout.fileno()

            if stderr is None:
                pass
            elif stderr == PIPE:
                errread, errwrite = os.pipe()
            elif stderr == STDOUT:
                if c2pwrite != -1:
                    errwrite = c2pwrite
                else: # child's stdout is not set, use parent's stdout
                    errwrite = sys.__stdout__.fileno()
            elif stderr == DEVNULL:
                errwrite = self._get_devnull()
            elif isinstance(stderr, int):
                errwrite = stderr
            else:
                # Assuming file-like object
                errwrite = stderr.fileno()

            return (p2cread, p2cwrite,
                    c2pread, c2pwrite,
                    errread, errwrite)


        def _posix_spawn(self, args, executable, env, restore_signals,
                         p2cread, p2cwrite,
                         c2pread, c2pwrite,
                         errread, errwrite):
            """Execute program using os.posix_spawn()."""
            if env is None:
                env = os.environ

            kwargs = {}
            if restore_signals:
                # See _Py_RestoreSignals() in Python/pylifecycle.c
                sigset = []
                for signame in ('SIGPIPE', 'SIGXFZ', 'SIGXFSZ'):
                    signum = getattr(signal, signame, None)
                    if signum is not None:
                        sigset.append(signum)
                kwargs['setsigdef'] = sigset

            file_actions = []
            for fd in (p2cwrite, c2pread, errread):
                if fd != -1:
                    file_actions.append((os.POSIX_SPAWN_CLOSE, fd))
            for fd, fd2 in (
                (p2cread, 0),
                (c2pwrite, 1),
                (errwrite, 2),
            ):
                if fd != -1:
                    file_actions.append((os.POSIX_SPAWN_DUP2, fd, fd2))
            if file_actions:
                kwargs['file_actions'] = file_actions

            self.pid = os.posix_spawn(executable, args, env, **kwargs)
            self._child_created = True

            self._close_pipe_fds(p2cread, p2cwrite,
                                 c2pread, c2pwrite,
                                 errread, errwrite)

        def _execute_child(self, args, executable, preexec_fn, close_fds,
                           pass_fds, cwd, env,
                           startupinfo, creationflags, shell,
                           p2cread, p2cwrite,
                           c2pread, c2pwrite,
                           errread, errwrite,
                           restore_signals, start_new_session):
            """Execute program (POSIX version)"""

            if isinstance(args, (str, bytes)):
                args = [args]
            elif isinstance(args, os.PathLike):
                if shell:
                    raise TypeError('path-like args is not allowed when '
                                    'shell is true')
                args = [args]
            else:
                args = list(args)

            if shell:
                # On Android the default shell is at '/system/bin/sh'.
                unix_shell = ('/system/bin/sh' if
                          hasattr(sys, 'getandroidapilevel') else '/bin/sh')
                args = [unix_shell, "-c"] + args
                if executable:
                    args[0] = executable

            if executable is None:
                executable = args[0]

            sys.audit("subprocess.Popen", executable, args, cwd, env)

            if (_USE_POSIX_SPAWN
                    and os.path.dirname(executable)
                    and preexec_fn is None
                    and not close_fds
                    and not pass_fds
                    and cwd is None
                    and (p2cread == -1 or p2cread > 2)
                    and (c2pwrite == -1 or c2pwrite > 2)
                    and (errwrite == -1 or errwrite > 2)
                    and not start_new_session):
                self._posix_spawn(args, executable, env, restore_signals,
                                  p2cread, p2cwrite,
                                  c2pread, c2pwrite,
                                  errread, errwrite)
                return

            orig_executable = executable

            # For transferring possible exec failure from child to parent.
            # Data format: "exception name:hex errno:description"
            # Pickle is not used; it is complex and involves memory allocation.
            errpipe_read, errpipe_write = os.pipe()
            # errpipe_write must not be in the standard io 0, 1, or 2 fd range.
            low_fds_to_close = []
            while errpipe_write < 3:
                low_fds_to_close.append(errpipe_write)
                errpipe_write = os.dup(errpipe_write)
            for low_fd in low_fds_to_close:
                os.close(low_fd)
            try:
                try:
                    # We must avoid complex work that could involve
                    # malloc or free in the child process to avoid
                    # potential deadlocks, thus we do all this here.
                    # and pass it to fork_exec()

                    if env is not None:
                        env_list = []
                        for k, v in env.items():
                            k = os.fsencode(k)
                            if b'=' in k:
                                raise ValueError("illegal environment variable name")
                            env_list.append(k + b'=' + os.fsencode(v))
                    else:
                        env_list = None  # Use execv instead of execve.
                    executable = os.fsencode(executable)
                    if os.path.dirname(executable):
                        executable_list = (executable,)
                    else:
                        # This matches the behavior of os._execvpe().
                        executable_list = tuple(
                            os.path.join(os.fsencode(dir), executable)
                            for dir in os.get_exec_path(env))
                    fds_to_keep = set(pass_fds)
                    fds_to_keep.add(errpipe_write)
                    self.pid = _posixsubprocess.fork_exec(
                            args, executable_list,
                            close_fds, tuple(sorted(map(int, fds_to_keep))),
                            cwd, env_list,
                            p2cread, p2cwrite, c2pread, c2pwrite,
                            errread, errwrite,
                            errpipe_read, errpipe_write,
                            restore_signals, start_new_session, preexec_fn)
                    self._child_created = True
                finally:
                    # be sure the FD is closed no matter what
                    os.close(errpipe_write)

                self._close_pipe_fds(p2cread, p2cwrite,
                                     c2pread, c2pwrite,
                                     errread, errwrite)

                # Wait for exec to fail or succeed; possibly raising an
                # exception (limited in size)
                errpipe_data = bytearray()
                while True:
                    part = os.read(errpipe_read, 50000)
                    errpipe_data += part
                    if not part or len(errpipe_data) > 50000:
                        break
            finally:
                # be sure the FD is closed no matter what
                os.close(errpipe_read)

            if errpipe_data:
                try:
                    pid, sts = os.waitpid(self.pid, 0)
                    if pid == self.pid:
                        self._handle_exitstatus(sts)
                    else:
                        self.returncode = sys.maxsize
                except ChildProcessError:
                    pass

                try:
                    exception_name, hex_errno, err_msg = (
                            errpipe_data.split(b':', 2))
                    # The encoding here should match the encoding
                    # written in by the subprocess implementations
                    # like _posixsubprocess
                    err_msg = err_msg.decode()
                except ValueError:
                    exception_name = b'SubprocessError'
                    hex_errno = b'0'
                    err_msg = 'Bad exception data from child: {!r}'.format(
                                  bytes(errpipe_data))
                child_exception_type = getattr(
                        builtins, exception_name.decode('ascii'),
                        SubprocessError)
                if issubclass(child_exception_type, OSError) and hex_errno:
                    errno_num = int(hex_errno, 16)
                    child_exec_never_called = (err_msg == "noexec")
                    if child_exec_never_called:
                        err_msg = ""
                        # The error must be from chdir(cwd).
                        err_filename = cwd
                    else:
                        err_filename = orig_executable
                    if errno_num != 0:
                        err_msg = os.strerror(errno_num)
                    raise child_exception_type(errno_num, err_msg, err_filename)
                raise child_exception_type(err_msg)


        def _handle_exitstatus(self, sts, _WIFSIGNALED=os.WIFSIGNALED,
                _WTERMSIG=os.WTERMSIG, _WIFEXITED=os.WIFEXITED,
                _WEXITSTATUS=os.WEXITSTATUS, _WIFSTOPPED=os.WIFSTOPPED,
                _WSTOPSIG=os.WSTOPSIG):
            """All callers to this function MUST hold self._waitpid_lock."""
            # This method is called (indirectly) by __del__, so it cannot
            # refer to anything outside of its local scope.
            if _WIFSIGNALED(sts):
                self.returncode = -_WTERMSIG(sts)
            elif _WIFEXITED(sts):
                self.returncode = _WEXITSTATUS(sts)
            elif _WIFSTOPPED(sts):
                self.returncode = -_WSTOPSIG(sts)
            else:
                # Should never happen
                raise SubprocessError("Unknown child exit status!")


        def _internal_poll(self, _deadstate=None, _waitpid=os.waitpid,
                _WNOHANG=os.WNOHANG, _ECHILD=errno.ECHILD):
            """Check if child process has terminated.  Returns returncode
            attribute.

            This method is called by __del__, so it cannot reference anything
            outside of the local scope (nor can any methods it calls).

            """
            if self.returncode is None:
                if not self._waitpid_lock.acquire(False):
                    # Something else is busy calling waitpid.  Don't allow two
                    # at once.  We know nothing yet.
                    return None
                try:
                    if self.returncode is not None:
                        return self.returncode  # Another thread waited.
                    pid, sts = _waitpid(self.pid, _WNOHANG)
                    if pid == self.pid:
                        self._handle_exitstatus(sts)
                except OSError as e:
                    if _deadstate is not None:
                        self.returncode = _deadstate
                    elif e.errno == _ECHILD:
                        # This happens if SIGCLD is set to be ignored or
                        # waiting for child processes has otherwise been
                        # disabled for our process.  This child is dead, we
                        # can't get the status.
                        # http://bugs.python.org/issue15756
                        self.returncode = 0
                finally:
                    self._waitpid_lock.release()
            return self.returncode


        def _try_wait(self, wait_flags):
            """All callers to this function MUST hold self._waitpid_lock."""
            try:
                (pid, sts) = os.waitpid(self.pid, wait_flags)
            except ChildProcessError:
                # This happens if SIGCLD is set to be ignored or waiting
                # for child processes has otherwise been disabled for our
                # process.  This child is dead, we can't get the status.
                pid = self.pid
                sts = 0
            return (pid, sts)


        def _wait(self, timeout):
            """Internal implementation of wait() on POSIX."""
            if self.returncode is not None:
                return self.returncode

            if timeout is not None:
                endtime = _time() + timeout
                # Enter a busy loop if we have a timeout.  This busy loop was
                # cribbed from Lib/threading.py in Thread.wait() at r71065.
                delay = 0.0005 # 500 us -> initial delay of 1 ms
                while True:
                    if self._waitpid_lock.acquire(False):
                        try:
                            if self.returncode is not None:
                                break  # Another thread waited.
                            (pid, sts) = self._try_wait(os.WNOHANG)
                            assert pid == self.pid or pid == 0
                            if pid == self.pid:
                                self._handle_exitstatus(sts)
                                break
                        finally:
                            self._waitpid_lock.release()
                    remaining = self._remaining_time(endtime)
                    if remaining <= 0:
                        raise TimeoutExpired(self.args, timeout)
                    delay = min(delay * 2, remaining, .05)
                    time.sleep(delay)
            else:
                while self.returncode is None:
                    with self._waitpid_lock:
                        if self.returncode is not None:
                            break  # Another thread waited.
                        (pid, sts) = self._try_wait(0)
                        # Check the pid and loop as waitpid has been known to
                        # return 0 even without WNOHANG in odd situations.
                        # http://bugs.python.org/issue14396.
                        if pid == self.pid:
                            self._handle_exitstatus(sts)
            return self.returncode


        def _communicate(self, input, endtime, orig_timeout):
            if self.stdin and not self._communication_started:
                # Flush stdio buffer.  This might block, if the user has
                # been writing to .stdin in an uncontrolled fashion.
                try:
                    self.stdin.flush()
                except BrokenPipeError:
                    pass  # communicate() must ignore BrokenPipeError.
                if not input:
                    try:
                        self.stdin.close()
                    except BrokenPipeError:
                        pass  # communicate() must ignore BrokenPipeError.

            stdout = None
            stderr = None

            # Only create this mapping if we haven't already.
            if not self._communication_started:
                self._fileobj2output = {}
                if self.stdout:
                    self._fileobj2output[self.stdout] = []
                if self.stderr:
                    self._fileobj2output[self.stderr] = []

            if self.stdout:
                stdout = self._fileobj2output[self.stdout]
            if self.stderr:
                stderr = self._fileobj2output[self.stderr]

            self._save_input(input)

            if self._input:
                input_view = memoryview(self._input)

            with _PopenSelector() as selector:
                if self.stdin and input:
                    selector.register(self.stdin, selectors.EVENT_WRITE)
                if self.stdout and not self.stdout.closed:
                    selector.register(self.stdout, selectors.EVENT_READ)
                if self.stderr and not self.stderr.closed:
                    selector.register(self.stderr, selectors.EVENT_READ)

                while selector.get_map():
                    timeout = self._remaining_time(endtime)
                    if timeout is not None and timeout < 0:
                        self._check_timeout(endtime, orig_timeout,
                                            stdout, stderr,
                                            skip_check_and_raise=True)
                        raise RuntimeError(  # Impossible :)
                            '_check_timeout(..., skip_check_and_raise=True) '
                            'failed to raise TimeoutExpired.')

                    ready = selector.select(timeout)
                    self._check_timeout(endtime, orig_timeout, stdout, stderr)

                    # XXX Rewrite these to use non-blocking I/O on the file
                    # objects; they are no longer using C stdio!

                    for key, events in ready:
                        if key.fileobj is self.stdin:
                            chunk = input_view[self._input_offset :
                                               self._input_offset + _PIPE_BUF]
                            try:
                                self._input_offset += os.write(key.fd, chunk)
                            except BrokenPipeError:
                                selector.unregister(key.fileobj)
                                key.fileobj.close()
                            else:
                                if self._input_offset >= len(self._input):
                                    selector.unregister(key.fileobj)
                                    key.fileobj.close()
                        elif key.fileobj in (self.stdout, self.stderr):
                            data = os.read(key.fd, 32768)
                            if not data:
                                selector.unregister(key.fileobj)
                                key.fileobj.close()
                            self._fileobj2output[key.fileobj].append(data)

            self.wait(timeout=self._remaining_time(endtime))

            # All data exchanged.  Translate lists into strings.
            if stdout is not None:
                stdout = b''.join(stdout)
            if stderr is not None:
                stderr = b''.join(stderr)

            # Translate newlines, if requested.
            # This also turns bytes into strings.
            if self.text_mode:
                if stdout is not None:
                    stdout = self._translate_newlines(stdout,
                                                      self.stdout.encoding,
                                                      self.stdout.errors)
                if stderr is not None:
                    stderr = self._translate_newlines(stderr,
                                                      self.stderr.encoding,
                                                      self.stderr.errors)

            return (stdout, stderr)


        def _save_input(self, input):
            # This method is called from the _communicate_with_*() methods
            # so that if we time out while communicating, we can continue
            # sending input if we retry.
            if self.stdin and self._input is None:
                self._input_offset = 0
                self._input = input
                if input is not None and self.text_mode:
                    self._input = self._input.encode(self.stdin.encoding,
                                                     self.stdin.errors)


        def send_signal(self, sig):
            """Send a signal to the process."""
            # Skip signalling a process that we know has already died.
            if self.returncode is None:
                os.kill(self.pid, sig)

        def terminate(self):
            """Terminate the process with SIGTERM
            """
            self.send_signal(signal.SIGTERM)

        def kill(self):
            """Kill the process with SIGKILL
            """
            self.send_signal(signal.SIGKILL)
pickle.py000064400000175723151153537440006414 0ustar00"""Create portable serialized representations of Python objects.

See module copyreg for a mechanism for registering custom picklers.
See module pickletools source for extensive comments.

Classes:

    Pickler
    Unpickler

Functions:

    dump(object, file)
    dumps(object) -> string
    load(file) -> object
    loads(string) -> object

Misc variables:

    __version__
    format_version
    compatible_formats

"""

from types import FunctionType
from copyreg import dispatch_table
from copyreg import _extension_registry, _inverted_registry, _extension_cache
from itertools import islice
from functools import partial
import sys
from sys import maxsize
from struct import pack, unpack
import re
import io
import codecs
import _compat_pickle

__all__ = ["PickleError", "PicklingError", "UnpicklingError", "Pickler",
           "Unpickler", "dump", "dumps", "load", "loads"]

try:
    from _pickle import PickleBuffer
    __all__.append("PickleBuffer")
    _HAVE_PICKLE_BUFFER = True
except ImportError:
    _HAVE_PICKLE_BUFFER = False


# Shortcut for use in isinstance testing
bytes_types = (bytes, bytearray)

# These are purely informational; no code uses these.
format_version = "4.0"                  # File format version we write
compatible_formats = ["1.0",            # Original protocol 0
                      "1.1",            # Protocol 0 with INST added
                      "1.2",            # Original protocol 1
                      "1.3",            # Protocol 1 with BINFLOAT added
                      "2.0",            # Protocol 2
                      "3.0",            # Protocol 3
                      "4.0",            # Protocol 4
                      "5.0",            # Protocol 5
                      ]                 # Old format versions we can read

# This is the highest protocol number we know how to read.
HIGHEST_PROTOCOL = 5

# The protocol we write by default.  May be less than HIGHEST_PROTOCOL.
# Only bump this if the oldest still supported version of Python already
# includes it.
DEFAULT_PROTOCOL = 4

class PickleError(Exception):
    """A common base class for the other pickling exceptions."""
    pass

class PicklingError(PickleError):
    """This exception is raised when an unpicklable object is passed to the
    dump() method.

    """
    pass

class UnpicklingError(PickleError):
    """This exception is raised when there is a problem unpickling an object,
    such as a security violation.

    Note that other exceptions may also be raised during unpickling, including
    (but not necessarily limited to) AttributeError, EOFError, ImportError,
    and IndexError.

    """
    pass

# An instance of _Stop is raised by Unpickler.load_stop() in response to
# the STOP opcode, passing the object that is the result of unpickling.
class _Stop(Exception):
    def __init__(self, value):
        self.value = value

# Jython has PyStringMap; it's a dict subclass with string keys
try:
    from org.python.core import PyStringMap
except ImportError:
    PyStringMap = None

# Pickle opcodes.  See pickletools.py for extensive docs.  The listing
# here is in kind-of alphabetical order of 1-character pickle code.
# pickletools groups them by purpose.

MARK           = b'('   # push special markobject on stack
STOP           = b'.'   # every pickle ends with STOP
POP            = b'0'   # discard topmost stack item
POP_MARK       = b'1'   # discard stack top through topmost markobject
DUP            = b'2'   # duplicate top stack item
FLOAT          = b'F'   # push float object; decimal string argument
INT            = b'I'   # push integer or bool; decimal string argument
BININT         = b'J'   # push four-byte signed int
BININT1        = b'K'   # push 1-byte unsigned int
LONG           = b'L'   # push long; decimal string argument
BININT2        = b'M'   # push 2-byte unsigned int
NONE           = b'N'   # push None
PERSID         = b'P'   # push persistent object; id is taken from string arg
BINPERSID      = b'Q'   #  "       "         "  ;  "  "   "     "  stack
REDUCE         = b'R'   # apply callable to argtuple, both on stack
STRING         = b'S'   # push string; NL-terminated string argument
BINSTRING      = b'T'   # push string; counted binary string argument
SHORT_BINSTRING= b'U'   #  "     "   ;    "      "       "      " < 256 bytes
UNICODE        = b'V'   # push Unicode string; raw-unicode-escaped'd argument
BINUNICODE     = b'X'   #   "     "       "  ; counted UTF-8 string argument
APPEND         = b'a'   # append stack top to list below it
BUILD          = b'b'   # call __setstate__ or __dict__.update()
GLOBAL         = b'c'   # push self.find_class(modname, name); 2 string args
DICT           = b'd'   # build a dict from stack items
EMPTY_DICT     = b'}'   # push empty dict
APPENDS        = b'e'   # extend list on stack by topmost stack slice
GET            = b'g'   # push item from memo on stack; index is string arg
BINGET         = b'h'   #   "    "    "    "   "   "  ;   "    " 1-byte arg
INST           = b'i'   # build & push class instance
LONG_BINGET    = b'j'   # push item from memo on stack; index is 4-byte arg
LIST           = b'l'   # build list from topmost stack items
EMPTY_LIST     = b']'   # push empty list
OBJ            = b'o'   # build & push class instance
PUT            = b'p'   # store stack top in memo; index is string arg
BINPUT         = b'q'   #   "     "    "   "   " ;   "    " 1-byte arg
LONG_BINPUT    = b'r'   #   "     "    "   "   " ;   "    " 4-byte arg
SETITEM        = b's'   # add key+value pair to dict
TUPLE          = b't'   # build tuple from topmost stack items
EMPTY_TUPLE    = b')'   # push empty tuple
SETITEMS       = b'u'   # modify dict by adding topmost key+value pairs
BINFLOAT       = b'G'   # push float; arg is 8-byte float encoding

TRUE           = b'I01\n'  # not an opcode; see INT docs in pickletools.py
FALSE          = b'I00\n'  # not an opcode; see INT docs in pickletools.py

# Protocol 2

PROTO          = b'\x80'  # identify pickle protocol
NEWOBJ         = b'\x81'  # build object by applying cls.__new__ to argtuple
EXT1           = b'\x82'  # push object from extension registry; 1-byte index
EXT2           = b'\x83'  # ditto, but 2-byte index
EXT4           = b'\x84'  # ditto, but 4-byte index
TUPLE1         = b'\x85'  # build 1-tuple from stack top
TUPLE2         = b'\x86'  # build 2-tuple from two topmost stack items
TUPLE3         = b'\x87'  # build 3-tuple from three topmost stack items
NEWTRUE        = b'\x88'  # push True
NEWFALSE       = b'\x89'  # push False
LONG1          = b'\x8a'  # push long from < 256 bytes
LONG4          = b'\x8b'  # push really big long

_tuplesize2code = [EMPTY_TUPLE, TUPLE1, TUPLE2, TUPLE3]

# Protocol 3 (Python 3.x)

BINBYTES       = b'B'   # push bytes; counted binary string argument
SHORT_BINBYTES = b'C'   #  "     "   ;    "      "       "      " < 256 bytes

# Protocol 4

SHORT_BINUNICODE = b'\x8c'  # push short string; UTF-8 length < 256 bytes
BINUNICODE8      = b'\x8d'  # push very long string
BINBYTES8        = b'\x8e'  # push very long bytes string
EMPTY_SET        = b'\x8f'  # push empty set on the stack
ADDITEMS         = b'\x90'  # modify set by adding topmost stack items
FROZENSET        = b'\x91'  # build frozenset from topmost stack items
NEWOBJ_EX        = b'\x92'  # like NEWOBJ but work with keyword only arguments
STACK_GLOBAL     = b'\x93'  # same as GLOBAL but using names on the stacks
MEMOIZE          = b'\x94'  # store top of the stack in memo
FRAME            = b'\x95'  # indicate the beginning of a new frame

# Protocol 5

BYTEARRAY8       = b'\x96'  # push bytearray
NEXT_BUFFER      = b'\x97'  # push next out-of-band buffer
READONLY_BUFFER  = b'\x98'  # make top of stack readonly

__all__.extend([x for x in dir() if re.match("[A-Z][A-Z0-9_]+$", x)])


class _Framer:

    _FRAME_SIZE_MIN = 4
    _FRAME_SIZE_TARGET = 64 * 1024

    def __init__(self, file_write):
        self.file_write = file_write
        self.current_frame = None

    def start_framing(self):
        self.current_frame = io.BytesIO()

    def end_framing(self):
        if self.current_frame and self.current_frame.tell() > 0:
            self.commit_frame(force=True)
            self.current_frame = None

    def commit_frame(self, force=False):
        if self.current_frame:
            f = self.current_frame
            if f.tell() >= self._FRAME_SIZE_TARGET or force:
                data = f.getbuffer()
                write = self.file_write
                if len(data) >= self._FRAME_SIZE_MIN:
                    # Issue a single call to the write method of the underlying
                    # file object for the frame opcode with the size of the
                    # frame. The concatenation is expected to be less expensive
                    # than issuing an additional call to write.
                    write(FRAME + pack("<Q", len(data)))

                # Issue a separate call to write to append the frame
                # contents without concatenation to the above to avoid a
                # memory copy.
                write(data)

                # Start the new frame with a new io.BytesIO instance so that
                # the file object can have delayed access to the previous frame
                # contents via an unreleased memoryview of the previous
                # io.BytesIO instance.
                self.current_frame = io.BytesIO()

    def write(self, data):
        if self.current_frame:
            return self.current_frame.write(data)
        else:
            return self.file_write(data)

    def write_large_bytes(self, header, payload):
        write = self.file_write
        if self.current_frame:
            # Terminate the current frame and flush it to the file.
            self.commit_frame(force=True)

        # Perform direct write of the header and payload of the large binary
        # object. Be careful not to concatenate the header and the payload
        # prior to calling 'write' as we do not want to allocate a large
        # temporary bytes object.
        # We intentionally do not insert a protocol 4 frame opcode to make
        # it possible to optimize file.read calls in the loader.
        write(header)
        write(payload)


class _Unframer:

    def __init__(self, file_read, file_readline, file_tell=None):
        self.file_read = file_read
        self.file_readline = file_readline
        self.current_frame = None

    def readinto(self, buf):
        if self.current_frame:
            n = self.current_frame.readinto(buf)
            if n == 0 and len(buf) != 0:
                self.current_frame = None
                n = len(buf)
                buf[:] = self.file_read(n)
                return n
            if n < len(buf):
                raise UnpicklingError(
                    "pickle exhausted before end of frame")
            return n
        else:
            n = len(buf)
            buf[:] = self.file_read(n)
            return n

    def read(self, n):
        if self.current_frame:
            data = self.current_frame.read(n)
            if not data and n != 0:
                self.current_frame = None
                return self.file_read(n)
            if len(data) < n:
                raise UnpicklingError(
                    "pickle exhausted before end of frame")
            return data
        else:
            return self.file_read(n)

    def readline(self):
        if self.current_frame:
            data = self.current_frame.readline()
            if not data:
                self.current_frame = None
                return self.file_readline()
            if data[-1] != b'\n'[0]:
                raise UnpicklingError(
                    "pickle exhausted before end of frame")
            return data
        else:
            return self.file_readline()

    def load_frame(self, frame_size):
        if self.current_frame and self.current_frame.read() != b'':
            raise UnpicklingError(
                "beginning of a new frame before end of current frame")
        self.current_frame = io.BytesIO(self.file_read(frame_size))


# Tools used for pickling.

def _getattribute(obj, name):
    for subpath in name.split('.'):
        if subpath == '<locals>':
            raise AttributeError("Can't get local attribute {!r} on {!r}"
                                 .format(name, obj))
        try:
            parent = obj
            obj = getattr(obj, subpath)
        except AttributeError:
            raise AttributeError("Can't get attribute {!r} on {!r}"
                                 .format(name, obj)) from None
    return obj, parent

def whichmodule(obj, name):
    """Find the module an object belong to."""
    module_name = getattr(obj, '__module__', None)
    if module_name is not None:
        return module_name
    # Protect the iteration by using a list copy of sys.modules against dynamic
    # modules that trigger imports of other modules upon calls to getattr.
    for module_name, module in sys.modules.copy().items():
        if (module_name == '__main__'
            or module_name == '__mp_main__'  # bpo-42406
            or module is None):
            continue
        try:
            if _getattribute(module, name)[0] is obj:
                return module_name
        except AttributeError:
            pass
    return '__main__'

def encode_long(x):
    r"""Encode a long to a two's complement little-endian binary string.
    Note that 0 is a special case, returning an empty string, to save a
    byte in the LONG1 pickling context.

    >>> encode_long(0)
    b''
    >>> encode_long(255)
    b'\xff\x00'
    >>> encode_long(32767)
    b'\xff\x7f'
    >>> encode_long(-256)
    b'\x00\xff'
    >>> encode_long(-32768)
    b'\x00\x80'
    >>> encode_long(-128)
    b'\x80'
    >>> encode_long(127)
    b'\x7f'
    >>>
    """
    if x == 0:
        return b''
    nbytes = (x.bit_length() >> 3) + 1
    result = x.to_bytes(nbytes, byteorder='little', signed=True)
    if x < 0 and nbytes > 1:
        if result[-1] == 0xff and (result[-2] & 0x80) != 0:
            result = result[:-1]
    return result

def decode_long(data):
    r"""Decode a long from a two's complement little-endian binary string.

    >>> decode_long(b'')
    0
    >>> decode_long(b"\xff\x00")
    255
    >>> decode_long(b"\xff\x7f")
    32767
    >>> decode_long(b"\x00\xff")
    -256
    >>> decode_long(b"\x00\x80")
    -32768
    >>> decode_long(b"\x80")
    -128
    >>> decode_long(b"\x7f")
    127
    """
    return int.from_bytes(data, byteorder='little', signed=True)


# Pickling machinery

class _Pickler:

    def __init__(self, file, protocol=None, *, fix_imports=True,
                 buffer_callback=None):
        """This takes a binary file for writing a pickle data stream.

        The optional *protocol* argument tells the pickler to use the
        given protocol; supported protocols are 0, 1, 2, 3, 4 and 5.
        The default protocol is 4. It was introduced in Python 3.4, and
        is incompatible with previous versions.

        Specifying a negative protocol version selects the highest
        protocol version supported.  The higher the protocol used, the
        more recent the version of Python needed to read the pickle
        produced.

        The *file* argument must have a write() method that accepts a
        single bytes argument. It can thus be a file object opened for
        binary writing, an io.BytesIO instance, or any other custom
        object that meets this interface.

        If *fix_imports* is True and *protocol* is less than 3, pickle
        will try to map the new Python 3 names to the old module names
        used in Python 2, so that the pickle data stream is readable
        with Python 2.

        If *buffer_callback* is None (the default), buffer views are
        serialized into *file* as part of the pickle stream.

        If *buffer_callback* is not None, then it can be called any number
        of times with a buffer view.  If the callback returns a false value
        (such as None), the given buffer is out-of-band; otherwise the
        buffer is serialized in-band, i.e. inside the pickle stream.

        It is an error if *buffer_callback* is not None and *protocol*
        is None or smaller than 5.
        """
        if protocol is None:
            protocol = DEFAULT_PROTOCOL
        if protocol < 0:
            protocol = HIGHEST_PROTOCOL
        elif not 0 <= protocol <= HIGHEST_PROTOCOL:
            raise ValueError("pickle protocol must be <= %d" % HIGHEST_PROTOCOL)
        if buffer_callback is not None and protocol < 5:
            raise ValueError("buffer_callback needs protocol >= 5")
        self._buffer_callback = buffer_callback
        try:
            self._file_write = file.write
        except AttributeError:
            raise TypeError("file must have a 'write' attribute")
        self.framer = _Framer(self._file_write)
        self.write = self.framer.write
        self._write_large_bytes = self.framer.write_large_bytes
        self.memo = {}
        self.proto = int(protocol)
        self.bin = protocol >= 1
        self.fast = 0
        self.fix_imports = fix_imports and protocol < 3

    def clear_memo(self):
        """Clears the pickler's "memo".

        The memo is the data structure that remembers which objects the
        pickler has already seen, so that shared or recursive objects
        are pickled by reference and not by value.  This method is
        useful when re-using picklers.
        """
        self.memo.clear()

    def dump(self, obj):
        """Write a pickled representation of obj to the open file."""
        # Check whether Pickler was initialized correctly. This is
        # only needed to mimic the behavior of _pickle.Pickler.dump().
        if not hasattr(self, "_file_write"):
            raise PicklingError("Pickler.__init__() was not called by "
                                "%s.__init__()" % (self.__class__.__name__,))
        if self.proto >= 2:
            self.write(PROTO + pack("<B", self.proto))
        if self.proto >= 4:
            self.framer.start_framing()
        self.save(obj)
        self.write(STOP)
        self.framer.end_framing()

    def memoize(self, obj):
        """Store an object in the memo."""

        # The Pickler memo is a dictionary mapping object ids to 2-tuples
        # that contain the Unpickler memo key and the object being memoized.
        # The memo key is written to the pickle and will become
        # the key in the Unpickler's memo.  The object is stored in the
        # Pickler memo so that transient objects are kept alive during
        # pickling.

        # The use of the Unpickler memo length as the memo key is just a
        # convention.  The only requirement is that the memo values be unique.
        # But there appears no advantage to any other scheme, and this
        # scheme allows the Unpickler memo to be implemented as a plain (but
        # growable) array, indexed by memo key.
        if self.fast:
            return
        assert id(obj) not in self.memo
        idx = len(self.memo)
        self.write(self.put(idx))
        self.memo[id(obj)] = idx, obj

    # Return a PUT (BINPUT, LONG_BINPUT) opcode string, with argument i.
    def put(self, idx):
        if self.proto >= 4:
            return MEMOIZE
        elif self.bin:
            if idx < 256:
                return BINPUT + pack("<B", idx)
            else:
                return LONG_BINPUT + pack("<I", idx)
        else:
            return PUT + repr(idx).encode("ascii") + b'\n'

    # Return a GET (BINGET, LONG_BINGET) opcode string, with argument i.
    def get(self, i):
        if self.bin:
            if i < 256:
                return BINGET + pack("<B", i)
            else:
                return LONG_BINGET + pack("<I", i)

        return GET + repr(i).encode("ascii") + b'\n'

    def save(self, obj, save_persistent_id=True):
        self.framer.commit_frame()

        # Check for persistent id (defined by a subclass)
        pid = self.persistent_id(obj)
        if pid is not None and save_persistent_id:
            self.save_pers(pid)
            return

        # Check the memo
        x = self.memo.get(id(obj))
        if x is not None:
            self.write(self.get(x[0]))
            return

        rv = NotImplemented
        reduce = getattr(self, "reducer_override", None)
        if reduce is not None:
            rv = reduce(obj)

        if rv is NotImplemented:
            # Check the type dispatch table
            t = type(obj)
            f = self.dispatch.get(t)
            if f is not None:
                f(self, obj)  # Call unbound method with explicit self
                return

            # Check private dispatch table if any, or else
            # copyreg.dispatch_table
            reduce = getattr(self, 'dispatch_table', dispatch_table).get(t)
            if reduce is not None:
                rv = reduce(obj)
            else:
                # Check for a class with a custom metaclass; treat as regular
                # class
                if issubclass(t, type):
                    self.save_global(obj)
                    return

                # Check for a __reduce_ex__ method, fall back to __reduce__
                reduce = getattr(obj, "__reduce_ex__", None)
                if reduce is not None:
                    rv = reduce(self.proto)
                else:
                    reduce = getattr(obj, "__reduce__", None)
                    if reduce is not None:
                        rv = reduce()
                    else:
                        raise PicklingError("Can't pickle %r object: %r" %
                                            (t.__name__, obj))

        # Check for string returned by reduce(), meaning "save as global"
        if isinstance(rv, str):
            self.save_global(obj, rv)
            return

        # Assert that reduce() returned a tuple
        if not isinstance(rv, tuple):
            raise PicklingError("%s must return string or tuple" % reduce)

        # Assert that it returned an appropriately sized tuple
        l = len(rv)
        if not (2 <= l <= 6):
            raise PicklingError("Tuple returned by %s must have "
                                "two to six elements" % reduce)

        # Save the reduce() output and finally memoize the object
        self.save_reduce(obj=obj, *rv)

    def persistent_id(self, obj):
        # This exists so a subclass can override it
        return None

    def save_pers(self, pid):
        # Save a persistent id reference
        if self.bin:
            self.save(pid, save_persistent_id=False)
            self.write(BINPERSID)
        else:
            try:
                self.write(PERSID + str(pid).encode("ascii") + b'\n')
            except UnicodeEncodeError:
                raise PicklingError(
                    "persistent IDs in protocol 0 must be ASCII strings")

    def save_reduce(self, func, args, state=None, listitems=None,
                    dictitems=None, state_setter=None, obj=None):
        # This API is called by some subclasses

        if not isinstance(args, tuple):
            raise PicklingError("args from save_reduce() must be a tuple")
        if not callable(func):
            raise PicklingError("func from save_reduce() must be callable")

        save = self.save
        write = self.write

        func_name = getattr(func, "__name__", "")
        if self.proto >= 2 and func_name == "__newobj_ex__":
            cls, args, kwargs = args
            if not hasattr(cls, "__new__"):
                raise PicklingError("args[0] from {} args has no __new__"
                                    .format(func_name))
            if obj is not None and cls is not obj.__class__:
                raise PicklingError("args[0] from {} args has the wrong class"
                                    .format(func_name))
            if self.proto >= 4:
                save(cls)
                save(args)
                save(kwargs)
                write(NEWOBJ_EX)
            else:
                func = partial(cls.__new__, cls, *args, **kwargs)
                save(func)
                save(())
                write(REDUCE)
        elif self.proto >= 2 and func_name == "__newobj__":
            # A __reduce__ implementation can direct protocol 2 or newer to
            # use the more efficient NEWOBJ opcode, while still
            # allowing protocol 0 and 1 to work normally.  For this to
            # work, the function returned by __reduce__ should be
            # called __newobj__, and its first argument should be a
            # class.  The implementation for __newobj__
            # should be as follows, although pickle has no way to
            # verify this:
            #
            # def __newobj__(cls, *args):
            #     return cls.__new__(cls, *args)
            #
            # Protocols 0 and 1 will pickle a reference to __newobj__,
            # while protocol 2 (and above) will pickle a reference to
            # cls, the remaining args tuple, and the NEWOBJ code,
            # which calls cls.__new__(cls, *args) at unpickling time
            # (see load_newobj below).  If __reduce__ returns a
            # three-tuple, the state from the third tuple item will be
            # pickled regardless of the protocol, calling __setstate__
            # at unpickling time (see load_build below).
            #
            # Note that no standard __newobj__ implementation exists;
            # you have to provide your own.  This is to enforce
            # compatibility with Python 2.2 (pickles written using
            # protocol 0 or 1 in Python 2.3 should be unpicklable by
            # Python 2.2).
            cls = args[0]
            if not hasattr(cls, "__new__"):
                raise PicklingError(
                    "args[0] from __newobj__ args has no __new__")
            if obj is not None and cls is not obj.__class__:
                raise PicklingError(
                    "args[0] from __newobj__ args has the wrong class")
            args = args[1:]
            save(cls)
            save(args)
            write(NEWOBJ)
        else:
            save(func)
            save(args)
            write(REDUCE)

        if obj is not None:
            # If the object is already in the memo, this means it is
            # recursive. In this case, throw away everything we put on the
            # stack, and fetch the object back from the memo.
            if id(obj) in self.memo:
                write(POP + self.get(self.memo[id(obj)][0]))
            else:
                self.memoize(obj)

        # More new special cases (that work with older protocols as
        # well): when __reduce__ returns a tuple with 4 or 5 items,
        # the 4th and 5th item should be iterators that provide list
        # items and dict items (as (key, value) tuples), or None.

        if listitems is not None:
            self._batch_appends(listitems)

        if dictitems is not None:
            self._batch_setitems(dictitems)

        if state is not None:
            if state_setter is None:
                save(state)
                write(BUILD)
            else:
                # If a state_setter is specified, call it instead of load_build
                # to update obj's with its previous state.
                # First, push state_setter and its tuple of expected arguments
                # (obj, state) onto the stack.
                save(state_setter)
                save(obj)  # simple BINGET opcode as obj is already memoized.
                save(state)
                write(TUPLE2)
                # Trigger a state_setter(obj, state) function call.
                write(REDUCE)
                # The purpose of state_setter is to carry-out an
                # inplace modification of obj. We do not care about what the
                # method might return, so its output is eventually removed from
                # the stack.
                write(POP)

    # Methods below this point are dispatched through the dispatch table

    dispatch = {}

    def save_none(self, obj):
        self.write(NONE)
    dispatch[type(None)] = save_none

    def save_bool(self, obj):
        if self.proto >= 2:
            self.write(NEWTRUE if obj else NEWFALSE)
        else:
            self.write(TRUE if obj else FALSE)
    dispatch[bool] = save_bool

    def save_long(self, obj):
        if self.bin:
            # If the int is small enough to fit in a signed 4-byte 2's-comp
            # format, we can store it more efficiently than the general
            # case.
            # First one- and two-byte unsigned ints:
            if obj >= 0:
                if obj <= 0xff:
                    self.write(BININT1 + pack("<B", obj))
                    return
                if obj <= 0xffff:
                    self.write(BININT2 + pack("<H", obj))
                    return
            # Next check for 4-byte signed ints:
            if -0x80000000 <= obj <= 0x7fffffff:
                self.write(BININT + pack("<i", obj))
                return
        if self.proto >= 2:
            encoded = encode_long(obj)
            n = len(encoded)
            if n < 256:
                self.write(LONG1 + pack("<B", n) + encoded)
            else:
                self.write(LONG4 + pack("<i", n) + encoded)
            return
        if -0x80000000 <= obj <= 0x7fffffff:
            self.write(INT + repr(obj).encode("ascii") + b'\n')
        else:
            self.write(LONG + repr(obj).encode("ascii") + b'L\n')
    dispatch[int] = save_long

    def save_float(self, obj):
        if self.bin:
            self.write(BINFLOAT + pack('>d', obj))
        else:
            self.write(FLOAT + repr(obj).encode("ascii") + b'\n')
    dispatch[float] = save_float

    def save_bytes(self, obj):
        if self.proto < 3:
            if not obj: # bytes object is empty
                self.save_reduce(bytes, (), obj=obj)
            else:
                self.save_reduce(codecs.encode,
                                 (str(obj, 'latin1'), 'latin1'), obj=obj)
            return
        n = len(obj)
        if n <= 0xff:
            self.write(SHORT_BINBYTES + pack("<B", n) + obj)
        elif n > 0xffffffff and self.proto >= 4:
            self._write_large_bytes(BINBYTES8 + pack("<Q", n), obj)
        elif n >= self.framer._FRAME_SIZE_TARGET:
            self._write_large_bytes(BINBYTES + pack("<I", n), obj)
        else:
            self.write(BINBYTES + pack("<I", n) + obj)
        self.memoize(obj)
    dispatch[bytes] = save_bytes

    def save_bytearray(self, obj):
        if self.proto < 5:
            if not obj:  # bytearray is empty
                self.save_reduce(bytearray, (), obj=obj)
            else:
                self.save_reduce(bytearray, (bytes(obj),), obj=obj)
            return
        n = len(obj)
        if n >= self.framer._FRAME_SIZE_TARGET:
            self._write_large_bytes(BYTEARRAY8 + pack("<Q", n), obj)
        else:
            self.write(BYTEARRAY8 + pack("<Q", n) + obj)
    dispatch[bytearray] = save_bytearray

    if _HAVE_PICKLE_BUFFER:
        def save_picklebuffer(self, obj):
            if self.proto < 5:
                raise PicklingError("PickleBuffer can only pickled with "
                                    "protocol >= 5")
            with obj.raw() as m:
                if not m.contiguous:
                    raise PicklingError("PickleBuffer can not be pickled when "
                                        "pointing to a non-contiguous buffer")
                in_band = True
                if self._buffer_callback is not None:
                    in_band = bool(self._buffer_callback(obj))
                if in_band:
                    # Write data in-band
                    # XXX The C implementation avoids a copy here
                    if m.readonly:
                        self.save_bytes(m.tobytes())
                    else:
                        self.save_bytearray(m.tobytes())
                else:
                    # Write data out-of-band
                    self.write(NEXT_BUFFER)
                    if m.readonly:
                        self.write(READONLY_BUFFER)

        dispatch[PickleBuffer] = save_picklebuffer

    def save_str(self, obj):
        if self.bin:
            encoded = obj.encode('utf-8', 'surrogatepass')
            n = len(encoded)
            if n <= 0xff and self.proto >= 4:
                self.write(SHORT_BINUNICODE + pack("<B", n) + encoded)
            elif n > 0xffffffff and self.proto >= 4:
                self._write_large_bytes(BINUNICODE8 + pack("<Q", n), encoded)
            elif n >= self.framer._FRAME_SIZE_TARGET:
                self._write_large_bytes(BINUNICODE + pack("<I", n), encoded)
            else:
                self.write(BINUNICODE + pack("<I", n) + encoded)
        else:
            obj = obj.replace("\\", "\\u005c")
            obj = obj.replace("\0", "\\u0000")
            obj = obj.replace("\n", "\\u000a")
            obj = obj.replace("\r", "\\u000d")
            obj = obj.replace("\x1a", "\\u001a")  # EOF on DOS
            self.write(UNICODE + obj.encode('raw-unicode-escape') +
                       b'\n')
        self.memoize(obj)
    dispatch[str] = save_str

    def save_tuple(self, obj):
        if not obj: # tuple is empty
            if self.bin:
                self.write(EMPTY_TUPLE)
            else:
                self.write(MARK + TUPLE)
            return

        n = len(obj)
        save = self.save
        memo = self.memo
        if n <= 3 and self.proto >= 2:
            for element in obj:
                save(element)
            # Subtle.  Same as in the big comment below.
            if id(obj) in memo:
                get = self.get(memo[id(obj)][0])
                self.write(POP * n + get)
            else:
                self.write(_tuplesize2code[n])
                self.memoize(obj)
            return

        # proto 0 or proto 1 and tuple isn't empty, or proto > 1 and tuple
        # has more than 3 elements.
        write = self.write
        write(MARK)
        for element in obj:
            save(element)

        if id(obj) in memo:
            # Subtle.  d was not in memo when we entered save_tuple(), so
            # the process of saving the tuple's elements must have saved
            # the tuple itself:  the tuple is recursive.  The proper action
            # now is to throw away everything we put on the stack, and
            # simply GET the tuple (it's already constructed).  This check
            # could have been done in the "for element" loop instead, but
            # recursive tuples are a rare thing.
            get = self.get(memo[id(obj)][0])
            if self.bin:
                write(POP_MARK + get)
            else:   # proto 0 -- POP_MARK not available
                write(POP * (n+1) + get)
            return

        # No recursion.
        write(TUPLE)
        self.memoize(obj)

    dispatch[tuple] = save_tuple

    def save_list(self, obj):
        if self.bin:
            self.write(EMPTY_LIST)
        else:   # proto 0 -- can't use EMPTY_LIST
            self.write(MARK + LIST)

        self.memoize(obj)
        self._batch_appends(obj)

    dispatch[list] = save_list

    _BATCHSIZE = 1000

    def _batch_appends(self, items):
        # Helper to batch up APPENDS sequences
        save = self.save
        write = self.write

        if not self.bin:
            for x in items:
                save(x)
                write(APPEND)
            return

        it = iter(items)
        while True:
            tmp = list(islice(it, self._BATCHSIZE))
            n = len(tmp)
            if n > 1:
                write(MARK)
                for x in tmp:
                    save(x)
                write(APPENDS)
            elif n:
                save(tmp[0])
                write(APPEND)
            # else tmp is empty, and we're done
            if n < self._BATCHSIZE:
                return

    def save_dict(self, obj):
        if self.bin:
            self.write(EMPTY_DICT)
        else:   # proto 0 -- can't use EMPTY_DICT
            self.write(MARK + DICT)

        self.memoize(obj)
        self._batch_setitems(obj.items())

    dispatch[dict] = save_dict
    if PyStringMap is not None:
        dispatch[PyStringMap] = save_dict

    def _batch_setitems(self, items):
        # Helper to batch up SETITEMS sequences; proto >= 1 only
        save = self.save
        write = self.write

        if not self.bin:
            for k, v in items:
                save(k)
                save(v)
                write(SETITEM)
            return

        it = iter(items)
        while True:
            tmp = list(islice(it, self._BATCHSIZE))
            n = len(tmp)
            if n > 1:
                write(MARK)
                for k, v in tmp:
                    save(k)
                    save(v)
                write(SETITEMS)
            elif n:
                k, v = tmp[0]
                save(k)
                save(v)
                write(SETITEM)
            # else tmp is empty, and we're done
            if n < self._BATCHSIZE:
                return

    def save_set(self, obj):
        save = self.save
        write = self.write

        if self.proto < 4:
            self.save_reduce(set, (list(obj),), obj=obj)
            return

        write(EMPTY_SET)
        self.memoize(obj)

        it = iter(obj)
        while True:
            batch = list(islice(it, self._BATCHSIZE))
            n = len(batch)
            if n > 0:
                write(MARK)
                for item in batch:
                    save(item)
                write(ADDITEMS)
            if n < self._BATCHSIZE:
                return
    dispatch[set] = save_set

    def save_frozenset(self, obj):
        save = self.save
        write = self.write

        if self.proto < 4:
            self.save_reduce(frozenset, (list(obj),), obj=obj)
            return

        write(MARK)
        for item in obj:
            save(item)

        if id(obj) in self.memo:
            # If the object is already in the memo, this means it is
            # recursive. In this case, throw away everything we put on the
            # stack, and fetch the object back from the memo.
            write(POP_MARK + self.get(self.memo[id(obj)][0]))
            return

        write(FROZENSET)
        self.memoize(obj)
    dispatch[frozenset] = save_frozenset

    def save_global(self, obj, name=None):
        write = self.write
        memo = self.memo

        if name is None:
            name = getattr(obj, '__qualname__', None)
        if name is None:
            name = obj.__name__

        module_name = whichmodule(obj, name)
        try:
            __import__(module_name, level=0)
            module = sys.modules[module_name]
            obj2, parent = _getattribute(module, name)
        except (ImportError, KeyError, AttributeError):
            raise PicklingError(
                "Can't pickle %r: it's not found as %s.%s" %
                (obj, module_name, name)) from None
        else:
            if obj2 is not obj:
                raise PicklingError(
                    "Can't pickle %r: it's not the same object as %s.%s" %
                    (obj, module_name, name))

        if self.proto >= 2:
            code = _extension_registry.get((module_name, name))
            if code:
                assert code > 0
                if code <= 0xff:
                    write(EXT1 + pack("<B", code))
                elif code <= 0xffff:
                    write(EXT2 + pack("<H", code))
                else:
                    write(EXT4 + pack("<i", code))
                return
        lastname = name.rpartition('.')[2]
        if parent is module:
            name = lastname
        # Non-ASCII identifiers are supported only with protocols >= 3.
        if self.proto >= 4:
            self.save(module_name)
            self.save(name)
            write(STACK_GLOBAL)
        elif parent is not module:
            self.save_reduce(getattr, (parent, lastname))
        elif self.proto >= 3:
            write(GLOBAL + bytes(module_name, "utf-8") + b'\n' +
                  bytes(name, "utf-8") + b'\n')
        else:
            if self.fix_imports:
                r_name_mapping = _compat_pickle.REVERSE_NAME_MAPPING
                r_import_mapping = _compat_pickle.REVERSE_IMPORT_MAPPING
                if (module_name, name) in r_name_mapping:
                    module_name, name = r_name_mapping[(module_name, name)]
                elif module_name in r_import_mapping:
                    module_name = r_import_mapping[module_name]
            try:
                write(GLOBAL + bytes(module_name, "ascii") + b'\n' +
                      bytes(name, "ascii") + b'\n')
            except UnicodeEncodeError:
                raise PicklingError(
                    "can't pickle global identifier '%s.%s' using "
                    "pickle protocol %i" % (module, name, self.proto)) from None

        self.memoize(obj)

    def save_type(self, obj):
        if obj is type(None):
            return self.save_reduce(type, (None,), obj=obj)
        elif obj is type(NotImplemented):
            return self.save_reduce(type, (NotImplemented,), obj=obj)
        elif obj is type(...):
            return self.save_reduce(type, (...,), obj=obj)
        return self.save_global(obj)

    dispatch[FunctionType] = save_global
    dispatch[type] = save_type


# Unpickling machinery

class _Unpickler:

    def __init__(self, file, *, fix_imports=True,
                 encoding="ASCII", errors="strict", buffers=None):
        """This takes a binary file for reading a pickle data stream.

        The protocol version of the pickle is detected automatically, so
        no proto argument is needed.

        The argument *file* must have two methods, a read() method that
        takes an integer argument, and a readline() method that requires
        no arguments.  Both methods should return bytes.  Thus *file*
        can be a binary file object opened for reading, an io.BytesIO
        object, or any other custom object that meets this interface.

        The file-like object must have two methods, a read() method
        that takes an integer argument, and a readline() method that
        requires no arguments.  Both methods should return bytes.
        Thus file-like object can be a binary file object opened for
        reading, a BytesIO object, or any other custom object that
        meets this interface.

        If *buffers* is not None, it should be an iterable of buffer-enabled
        objects that is consumed each time the pickle stream references
        an out-of-band buffer view.  Such buffers have been given in order
        to the *buffer_callback* of a Pickler object.

        If *buffers* is None (the default), then the buffers are taken
        from the pickle stream, assuming they are serialized there.
        It is an error for *buffers* to be None if the pickle stream
        was produced with a non-None *buffer_callback*.

        Other optional arguments are *fix_imports*, *encoding* and
        *errors*, which are used to control compatibility support for
        pickle stream generated by Python 2.  If *fix_imports* is True,
        pickle will try to map the old Python 2 names to the new names
        used in Python 3.  The *encoding* and *errors* tell pickle how
        to decode 8-bit string instances pickled by Python 2; these
        default to 'ASCII' and 'strict', respectively. *encoding* can be
        'bytes' to read theses 8-bit string instances as bytes objects.
        """
        self._buffers = iter(buffers) if buffers is not None else None
        self._file_readline = file.readline
        self._file_read = file.read
        self.memo = {}
        self.encoding = encoding
        self.errors = errors
        self.proto = 0
        self.fix_imports = fix_imports

    def load(self):
        """Read a pickled object representation from the open file.

        Return the reconstituted object hierarchy specified in the file.
        """
        # Check whether Unpickler was initialized correctly. This is
        # only needed to mimic the behavior of _pickle.Unpickler.dump().
        if not hasattr(self, "_file_read"):
            raise UnpicklingError("Unpickler.__init__() was not called by "
                                  "%s.__init__()" % (self.__class__.__name__,))
        self._unframer = _Unframer(self._file_read, self._file_readline)
        self.read = self._unframer.read
        self.readinto = self._unframer.readinto
        self.readline = self._unframer.readline
        self.metastack = []
        self.stack = []
        self.append = self.stack.append
        self.proto = 0
        read = self.read
        dispatch = self.dispatch
        try:
            while True:
                key = read(1)
                if not key:
                    raise EOFError
                assert isinstance(key, bytes_types)
                dispatch[key[0]](self)
        except _Stop as stopinst:
            return stopinst.value

    # Return a list of items pushed in the stack after last MARK instruction.
    def pop_mark(self):
        items = self.stack
        self.stack = self.metastack.pop()
        self.append = self.stack.append
        return items

    def persistent_load(self, pid):
        raise UnpicklingError("unsupported persistent id encountered")

    dispatch = {}

    def load_proto(self):
        proto = self.read(1)[0]
        if not 0 <= proto <= HIGHEST_PROTOCOL:
            raise ValueError("unsupported pickle protocol: %d" % proto)
        self.proto = proto
    dispatch[PROTO[0]] = load_proto

    def load_frame(self):
        frame_size, = unpack('<Q', self.read(8))
        if frame_size > sys.maxsize:
            raise ValueError("frame size > sys.maxsize: %d" % frame_size)
        self._unframer.load_frame(frame_size)
    dispatch[FRAME[0]] = load_frame

    def load_persid(self):
        try:
            pid = self.readline()[:-1].decode("ascii")
        except UnicodeDecodeError:
            raise UnpicklingError(
                "persistent IDs in protocol 0 must be ASCII strings")
        self.append(self.persistent_load(pid))
    dispatch[PERSID[0]] = load_persid

    def load_binpersid(self):
        pid = self.stack.pop()
        self.append(self.persistent_load(pid))
    dispatch[BINPERSID[0]] = load_binpersid

    def load_none(self):
        self.append(None)
    dispatch[NONE[0]] = load_none

    def load_false(self):
        self.append(False)
    dispatch[NEWFALSE[0]] = load_false

    def load_true(self):
        self.append(True)
    dispatch[NEWTRUE[0]] = load_true

    def load_int(self):
        data = self.readline()
        if data == FALSE[1:]:
            val = False
        elif data == TRUE[1:]:
            val = True
        else:
            val = int(data, 0)
        self.append(val)
    dispatch[INT[0]] = load_int

    def load_binint(self):
        self.append(unpack('<i', self.read(4))[0])
    dispatch[BININT[0]] = load_binint

    def load_binint1(self):
        self.append(self.read(1)[0])
    dispatch[BININT1[0]] = load_binint1

    def load_binint2(self):
        self.append(unpack('<H', self.read(2))[0])
    dispatch[BININT2[0]] = load_binint2

    def load_long(self):
        val = self.readline()[:-1]
        if val and val[-1] == b'L'[0]:
            val = val[:-1]
        self.append(int(val, 0))
    dispatch[LONG[0]] = load_long

    def load_long1(self):
        n = self.read(1)[0]
        data = self.read(n)
        self.append(decode_long(data))
    dispatch[LONG1[0]] = load_long1

    def load_long4(self):
        n, = unpack('<i', self.read(4))
        if n < 0:
            # Corrupt or hostile pickle -- we never write one like this
            raise UnpicklingError("LONG pickle has negative byte count")
        data = self.read(n)
        self.append(decode_long(data))
    dispatch[LONG4[0]] = load_long4

    def load_float(self):
        self.append(float(self.readline()[:-1]))
    dispatch[FLOAT[0]] = load_float

    def load_binfloat(self):
        self.append(unpack('>d', self.read(8))[0])
    dispatch[BINFLOAT[0]] = load_binfloat

    def _decode_string(self, value):
        # Used to allow strings from Python 2 to be decoded either as
        # bytes or Unicode strings.  This should be used only with the
        # STRING, BINSTRING and SHORT_BINSTRING opcodes.
        if self.encoding == "bytes":
            return value
        else:
            return value.decode(self.encoding, self.errors)

    def load_string(self):
        data = self.readline()[:-1]
        # Strip outermost quotes
        if len(data) >= 2 and data[0] == data[-1] and data[0] in b'"\'':
            data = data[1:-1]
        else:
            raise UnpicklingError("the STRING opcode argument must be quoted")
        self.append(self._decode_string(codecs.escape_decode(data)[0]))
    dispatch[STRING[0]] = load_string

    def load_binstring(self):
        # Deprecated BINSTRING uses signed 32-bit length
        len, = unpack('<i', self.read(4))
        if len < 0:
            raise UnpicklingError("BINSTRING pickle has negative byte count")
        data = self.read(len)
        self.append(self._decode_string(data))
    dispatch[BINSTRING[0]] = load_binstring

    def load_binbytes(self):
        len, = unpack('<I', self.read(4))
        if len > maxsize:
            raise UnpicklingError("BINBYTES exceeds system's maximum size "
                                  "of %d bytes" % maxsize)
        self.append(self.read(len))
    dispatch[BINBYTES[0]] = load_binbytes

    def load_unicode(self):
        self.append(str(self.readline()[:-1], 'raw-unicode-escape'))
    dispatch[UNICODE[0]] = load_unicode

    def load_binunicode(self):
        len, = unpack('<I', self.read(4))
        if len > maxsize:
            raise UnpicklingError("BINUNICODE exceeds system's maximum size "
                                  "of %d bytes" % maxsize)
        self.append(str(self.read(len), 'utf-8', 'surrogatepass'))
    dispatch[BINUNICODE[0]] = load_binunicode

    def load_binunicode8(self):
        len, = unpack('<Q', self.read(8))
        if len > maxsize:
            raise UnpicklingError("BINUNICODE8 exceeds system's maximum size "
                                  "of %d bytes" % maxsize)
        self.append(str(self.read(len), 'utf-8', 'surrogatepass'))
    dispatch[BINUNICODE8[0]] = load_binunicode8

    def load_binbytes8(self):
        len, = unpack('<Q', self.read(8))
        if len > maxsize:
            raise UnpicklingError("BINBYTES8 exceeds system's maximum size "
                                  "of %d bytes" % maxsize)
        self.append(self.read(len))
    dispatch[BINBYTES8[0]] = load_binbytes8

    def load_bytearray8(self):
        len, = unpack('<Q', self.read(8))
        if len > maxsize:
            raise UnpicklingError("BYTEARRAY8 exceeds system's maximum size "
                                  "of %d bytes" % maxsize)
        b = bytearray(len)
        self.readinto(b)
        self.append(b)
    dispatch[BYTEARRAY8[0]] = load_bytearray8

    def load_next_buffer(self):
        if self._buffers is None:
            raise UnpicklingError("pickle stream refers to out-of-band data "
                                  "but no *buffers* argument was given")
        try:
            buf = next(self._buffers)
        except StopIteration:
            raise UnpicklingError("not enough out-of-band buffers")
        self.append(buf)
    dispatch[NEXT_BUFFER[0]] = load_next_buffer

    def load_readonly_buffer(self):
        buf = self.stack[-1]
        with memoryview(buf) as m:
            if not m.readonly:
                self.stack[-1] = m.toreadonly()
    dispatch[READONLY_BUFFER[0]] = load_readonly_buffer

    def load_short_binstring(self):
        len = self.read(1)[0]
        data = self.read(len)
        self.append(self._decode_string(data))
    dispatch[SHORT_BINSTRING[0]] = load_short_binstring

    def load_short_binbytes(self):
        len = self.read(1)[0]
        self.append(self.read(len))
    dispatch[SHORT_BINBYTES[0]] = load_short_binbytes

    def load_short_binunicode(self):
        len = self.read(1)[0]
        self.append(str(self.read(len), 'utf-8', 'surrogatepass'))
    dispatch[SHORT_BINUNICODE[0]] = load_short_binunicode

    def load_tuple(self):
        items = self.pop_mark()
        self.append(tuple(items))
    dispatch[TUPLE[0]] = load_tuple

    def load_empty_tuple(self):
        self.append(())
    dispatch[EMPTY_TUPLE[0]] = load_empty_tuple

    def load_tuple1(self):
        self.stack[-1] = (self.stack[-1],)
    dispatch[TUPLE1[0]] = load_tuple1

    def load_tuple2(self):
        self.stack[-2:] = [(self.stack[-2], self.stack[-1])]
    dispatch[TUPLE2[0]] = load_tuple2

    def load_tuple3(self):
        self.stack[-3:] = [(self.stack[-3], self.stack[-2], self.stack[-1])]
    dispatch[TUPLE3[0]] = load_tuple3

    def load_empty_list(self):
        self.append([])
    dispatch[EMPTY_LIST[0]] = load_empty_list

    def load_empty_dictionary(self):
        self.append({})
    dispatch[EMPTY_DICT[0]] = load_empty_dictionary

    def load_empty_set(self):
        self.append(set())
    dispatch[EMPTY_SET[0]] = load_empty_set

    def load_frozenset(self):
        items = self.pop_mark()
        self.append(frozenset(items))
    dispatch[FROZENSET[0]] = load_frozenset

    def load_list(self):
        items = self.pop_mark()
        self.append(items)
    dispatch[LIST[0]] = load_list

    def load_dict(self):
        items = self.pop_mark()
        d = {items[i]: items[i+1]
             for i in range(0, len(items), 2)}
        self.append(d)
    dispatch[DICT[0]] = load_dict

    # INST and OBJ differ only in how they get a class object.  It's not
    # only sensible to do the rest in a common routine, the two routines
    # previously diverged and grew different bugs.
    # klass is the class to instantiate, and k points to the topmost mark
    # object, following which are the arguments for klass.__init__.
    def _instantiate(self, klass, args):
        if (args or not isinstance(klass, type) or
            hasattr(klass, "__getinitargs__")):
            try:
                value = klass(*args)
            except TypeError as err:
                raise TypeError("in constructor for %s: %s" %
                                (klass.__name__, str(err)), sys.exc_info()[2])
        else:
            value = klass.__new__(klass)
        self.append(value)

    def load_inst(self):
        module = self.readline()[:-1].decode("ascii")
        name = self.readline()[:-1].decode("ascii")
        klass = self.find_class(module, name)
        self._instantiate(klass, self.pop_mark())
    dispatch[INST[0]] = load_inst

    def load_obj(self):
        # Stack is ... markobject classobject arg1 arg2 ...
        args = self.pop_mark()
        cls = args.pop(0)
        self._instantiate(cls, args)
    dispatch[OBJ[0]] = load_obj

    def load_newobj(self):
        args = self.stack.pop()
        cls = self.stack.pop()
        obj = cls.__new__(cls, *args)
        self.append(obj)
    dispatch[NEWOBJ[0]] = load_newobj

    def load_newobj_ex(self):
        kwargs = self.stack.pop()
        args = self.stack.pop()
        cls = self.stack.pop()
        obj = cls.__new__(cls, *args, **kwargs)
        self.append(obj)
    dispatch[NEWOBJ_EX[0]] = load_newobj_ex

    def load_global(self):
        module = self.readline()[:-1].decode("utf-8")
        name = self.readline()[:-1].decode("utf-8")
        klass = self.find_class(module, name)
        self.append(klass)
    dispatch[GLOBAL[0]] = load_global

    def load_stack_global(self):
        name = self.stack.pop()
        module = self.stack.pop()
        if type(name) is not str or type(module) is not str:
            raise UnpicklingError("STACK_GLOBAL requires str")
        self.append(self.find_class(module, name))
    dispatch[STACK_GLOBAL[0]] = load_stack_global

    def load_ext1(self):
        code = self.read(1)[0]
        self.get_extension(code)
    dispatch[EXT1[0]] = load_ext1

    def load_ext2(self):
        code, = unpack('<H', self.read(2))
        self.get_extension(code)
    dispatch[EXT2[0]] = load_ext2

    def load_ext4(self):
        code, = unpack('<i', self.read(4))
        self.get_extension(code)
    dispatch[EXT4[0]] = load_ext4

    def get_extension(self, code):
        nil = []
        obj = _extension_cache.get(code, nil)
        if obj is not nil:
            self.append(obj)
            return
        key = _inverted_registry.get(code)
        if not key:
            if code <= 0: # note that 0 is forbidden
                # Corrupt or hostile pickle.
                raise UnpicklingError("EXT specifies code <= 0")
            raise ValueError("unregistered extension code %d" % code)
        obj = self.find_class(*key)
        _extension_cache[code] = obj
        self.append(obj)

    def find_class(self, module, name):
        # Subclasses may override this.
        sys.audit('pickle.find_class', module, name)
        if self.proto < 3 and self.fix_imports:
            if (module, name) in _compat_pickle.NAME_MAPPING:
                module, name = _compat_pickle.NAME_MAPPING[(module, name)]
            elif module in _compat_pickle.IMPORT_MAPPING:
                module = _compat_pickle.IMPORT_MAPPING[module]
        __import__(module, level=0)
        if self.proto >= 4:
            return _getattribute(sys.modules[module], name)[0]
        else:
            return getattr(sys.modules[module], name)

    def load_reduce(self):
        stack = self.stack
        args = stack.pop()
        func = stack[-1]
        stack[-1] = func(*args)
    dispatch[REDUCE[0]] = load_reduce

    def load_pop(self):
        if self.stack:
            del self.stack[-1]
        else:
            self.pop_mark()
    dispatch[POP[0]] = load_pop

    def load_pop_mark(self):
        self.pop_mark()
    dispatch[POP_MARK[0]] = load_pop_mark

    def load_dup(self):
        self.append(self.stack[-1])
    dispatch[DUP[0]] = load_dup

    def load_get(self):
        i = int(self.readline()[:-1])
        self.append(self.memo[i])
    dispatch[GET[0]] = load_get

    def load_binget(self):
        i = self.read(1)[0]
        self.append(self.memo[i])
    dispatch[BINGET[0]] = load_binget

    def load_long_binget(self):
        i, = unpack('<I', self.read(4))
        self.append(self.memo[i])
    dispatch[LONG_BINGET[0]] = load_long_binget

    def load_put(self):
        i = int(self.readline()[:-1])
        if i < 0:
            raise ValueError("negative PUT argument")
        self.memo[i] = self.stack[-1]
    dispatch[PUT[0]] = load_put

    def load_binput(self):
        i = self.read(1)[0]
        if i < 0:
            raise ValueError("negative BINPUT argument")
        self.memo[i] = self.stack[-1]
    dispatch[BINPUT[0]] = load_binput

    def load_long_binput(self):
        i, = unpack('<I', self.read(4))
        if i > maxsize:
            raise ValueError("negative LONG_BINPUT argument")
        self.memo[i] = self.stack[-1]
    dispatch[LONG_BINPUT[0]] = load_long_binput

    def load_memoize(self):
        memo = self.memo
        memo[len(memo)] = self.stack[-1]
    dispatch[MEMOIZE[0]] = load_memoize

    def load_append(self):
        stack = self.stack
        value = stack.pop()
        list = stack[-1]
        list.append(value)
    dispatch[APPEND[0]] = load_append

    def load_appends(self):
        items = self.pop_mark()
        list_obj = self.stack[-1]
        try:
            extend = list_obj.extend
        except AttributeError:
            pass
        else:
            extend(items)
            return
        # Even if the PEP 307 requires extend() and append() methods,
        # fall back on append() if the object has no extend() method
        # for backward compatibility.
        append = list_obj.append
        for item in items:
            append(item)
    dispatch[APPENDS[0]] = load_appends

    def load_setitem(self):
        stack = self.stack
        value = stack.pop()
        key = stack.pop()
        dict = stack[-1]
        dict[key] = value
    dispatch[SETITEM[0]] = load_setitem

    def load_setitems(self):
        items = self.pop_mark()
        dict = self.stack[-1]
        for i in range(0, len(items), 2):
            dict[items[i]] = items[i + 1]
    dispatch[SETITEMS[0]] = load_setitems

    def load_additems(self):
        items = self.pop_mark()
        set_obj = self.stack[-1]
        if isinstance(set_obj, set):
            set_obj.update(items)
        else:
            add = set_obj.add
            for item in items:
                add(item)
    dispatch[ADDITEMS[0]] = load_additems

    def load_build(self):
        stack = self.stack
        state = stack.pop()
        inst = stack[-1]
        setstate = getattr(inst, "__setstate__", None)
        if setstate is not None:
            setstate(state)
            return
        slotstate = None
        if isinstance(state, tuple) and len(state) == 2:
            state, slotstate = state
        if state:
            inst_dict = inst.__dict__
            intern = sys.intern
            for k, v in state.items():
                if type(k) is str:
                    inst_dict[intern(k)] = v
                else:
                    inst_dict[k] = v
        if slotstate:
            for k, v in slotstate.items():
                setattr(inst, k, v)
    dispatch[BUILD[0]] = load_build

    def load_mark(self):
        self.metastack.append(self.stack)
        self.stack = []
        self.append = self.stack.append
    dispatch[MARK[0]] = load_mark

    def load_stop(self):
        value = self.stack.pop()
        raise _Stop(value)
    dispatch[STOP[0]] = load_stop


# Shorthands

def _dump(obj, file, protocol=None, *, fix_imports=True, buffer_callback=None):
    _Pickler(file, protocol, fix_imports=fix_imports,
             buffer_callback=buffer_callback).dump(obj)

def _dumps(obj, protocol=None, *, fix_imports=True, buffer_callback=None):
    f = io.BytesIO()
    _Pickler(f, protocol, fix_imports=fix_imports,
             buffer_callback=buffer_callback).dump(obj)
    res = f.getvalue()
    assert isinstance(res, bytes_types)
    return res

def _load(file, *, fix_imports=True, encoding="ASCII", errors="strict",
          buffers=None):
    return _Unpickler(file, fix_imports=fix_imports, buffers=buffers,
                     encoding=encoding, errors=errors).load()

def _loads(s, *, fix_imports=True, encoding="ASCII", errors="strict",
           buffers=None):
    if isinstance(s, str):
        raise TypeError("Can't load pickle from unicode string")
    file = io.BytesIO(s)
    return _Unpickler(file, fix_imports=fix_imports, buffers=buffers,
                      encoding=encoding, errors=errors).load()

# Use the faster _pickle if possible
try:
    from _pickle import (
        PickleError,
        PicklingError,
        UnpicklingError,
        Pickler,
        Unpickler,
        dump,
        dumps,
        load,
        loads
    )
except ImportError:
    Pickler, Unpickler = _Pickler, _Unpickler
    dump, dumps, load, loads = _dump, _dumps, _load, _loads

# Doctest
def _test():
    import doctest
    return doctest.testmod()

if __name__ == "__main__":
    import argparse
    parser = argparse.ArgumentParser(
        description='display contents of the pickle files')
    parser.add_argument(
        'pickle_file', type=argparse.FileType('br'),
        nargs='*', help='the pickle file')
    parser.add_argument(
        '-t', '--test', action='store_true',
        help='run self-test suite')
    parser.add_argument(
        '-v', action='store_true',
        help='run verbosely; only affects self-test run')
    args = parser.parse_args()
    if args.test:
        _test()
    else:
        if not args.pickle_file:
            parser.print_help()
        else:
            import pprint
            for f in args.pickle_file:
                obj = load(f)
                pprint.pprint(obj)
reprlib.py000064400000012223151153537440006565 0ustar00"""Redo the builtin repr() (representation) but with limits on most sizes."""

__all__ = ["Repr", "repr", "recursive_repr"]

import builtins
from itertools import islice
from _thread import get_ident

def recursive_repr(fillvalue='...'):
    'Decorator to make a repr function return fillvalue for a recursive call'

    def decorating_function(user_function):
        repr_running = set()

        def wrapper(self):
            key = id(self), get_ident()
            if key in repr_running:
                return fillvalue
            repr_running.add(key)
            try:
                result = user_function(self)
            finally:
                repr_running.discard(key)
            return result

        # Can't use functools.wraps() here because of bootstrap issues
        wrapper.__module__ = getattr(user_function, '__module__')
        wrapper.__doc__ = getattr(user_function, '__doc__')
        wrapper.__name__ = getattr(user_function, '__name__')
        wrapper.__qualname__ = getattr(user_function, '__qualname__')
        wrapper.__annotations__ = getattr(user_function, '__annotations__', {})
        return wrapper

    return decorating_function

class Repr:

    def __init__(self):
        self.maxlevel = 6
        self.maxtuple = 6
        self.maxlist = 6
        self.maxarray = 5
        self.maxdict = 4
        self.maxset = 6
        self.maxfrozenset = 6
        self.maxdeque = 6
        self.maxstring = 30
        self.maxlong = 40
        self.maxother = 30

    def repr(self, x):
        return self.repr1(x, self.maxlevel)

    def repr1(self, x, level):
        typename = type(x).__name__
        if ' ' in typename:
            parts = typename.split()
            typename = '_'.join(parts)
        if hasattr(self, 'repr_' + typename):
            return getattr(self, 'repr_' + typename)(x, level)
        else:
            return self.repr_instance(x, level)

    def _repr_iterable(self, x, level, left, right, maxiter, trail=''):
        n = len(x)
        if level <= 0 and n:
            s = '...'
        else:
            newlevel = level - 1
            repr1 = self.repr1
            pieces = [repr1(elem, newlevel) for elem in islice(x, maxiter)]
            if n > maxiter:  pieces.append('...')
            s = ', '.join(pieces)
            if n == 1 and trail:  right = trail + right
        return '%s%s%s' % (left, s, right)

    def repr_tuple(self, x, level):
        return self._repr_iterable(x, level, '(', ')', self.maxtuple, ',')

    def repr_list(self, x, level):
        return self._repr_iterable(x, level, '[', ']', self.maxlist)

    def repr_array(self, x, level):
        if not x:
            return "array('%s')" % x.typecode
        header = "array('%s', [" % x.typecode
        return self._repr_iterable(x, level, header, '])', self.maxarray)

    def repr_set(self, x, level):
        if not x:
            return 'set()'
        x = _possibly_sorted(x)
        return self._repr_iterable(x, level, '{', '}', self.maxset)

    def repr_frozenset(self, x, level):
        if not x:
            return 'frozenset()'
        x = _possibly_sorted(x)
        return self._repr_iterable(x, level, 'frozenset({', '})',
                                   self.maxfrozenset)

    def repr_deque(self, x, level):
        return self._repr_iterable(x, level, 'deque([', '])', self.maxdeque)

    def repr_dict(self, x, level):
        n = len(x)
        if n == 0: return '{}'
        if level <= 0: return '{...}'
        newlevel = level - 1
        repr1 = self.repr1
        pieces = []
        for key in islice(_possibly_sorted(x), self.maxdict):
            keyrepr = repr1(key, newlevel)
            valrepr = repr1(x[key], newlevel)
            pieces.append('%s: %s' % (keyrepr, valrepr))
        if n > self.maxdict: pieces.append('...')
        s = ', '.join(pieces)
        return '{%s}' % (s,)

    def repr_str(self, x, level):
        s = builtins.repr(x[:self.maxstring])
        if len(s) > self.maxstring:
            i = max(0, (self.maxstring-3)//2)
            j = max(0, self.maxstring-3-i)
            s = builtins.repr(x[:i] + x[len(x)-j:])
            s = s[:i] + '...' + s[len(s)-j:]
        return s

    def repr_int(self, x, level):
        s = builtins.repr(x) # XXX Hope this isn't too slow...
        if len(s) > self.maxlong:
            i = max(0, (self.maxlong-3)//2)
            j = max(0, self.maxlong-3-i)
            s = s[:i] + '...' + s[len(s)-j:]
        return s

    def repr_instance(self, x, level):
        try:
            s = builtins.repr(x)
            # Bugs in x.__repr__() can cause arbitrary
            # exceptions -- then make up something
        except Exception:
            return '<%s instance at %#x>' % (x.__class__.__name__, id(x))
        if len(s) > self.maxother:
            i = max(0, (self.maxother-3)//2)
            j = max(0, self.maxother-3-i)
            s = s[:i] + '...' + s[len(s)-j:]
        return s


def _possibly_sorted(x):
    # Since not all sequences of items can be sorted and comparison
    # functions may raise arbitrary exceptions, return an unsorted
    # sequence in that case.
    try:
        return sorted(x)
    except Exception:
        return list(x)

aRepr = Repr()
repr = aRepr.repr
genericpath.py000064400000011557151153537440007430 0ustar00"""
Path operations common to more than one OS
Do not use directly.  The OS specific modules import the appropriate
functions from this module themselves.
"""
import os
import stat

__all__ = ['commonprefix', 'exists', 'getatime', 'getctime', 'getmtime',
           'getsize', 'isdir', 'isfile', 'samefile', 'sameopenfile',
           'samestat']


# Does a path exist?
# This is false for dangling symbolic links on systems that support them.
def exists(path):
    """Test whether a path exists.  Returns False for broken symbolic links"""
    try:
        os.stat(path)
    except (OSError, ValueError):
        return False
    return True


# This follows symbolic links, so both islink() and isdir() can be true
# for the same path on systems that support symlinks
def isfile(path):
    """Test whether a path is a regular file"""
    try:
        st = os.stat(path)
    except (OSError, ValueError):
        return False
    return stat.S_ISREG(st.st_mode)


# Is a path a directory?
# This follows symbolic links, so both islink() and isdir()
# can be true for the same path on systems that support symlinks
def isdir(s):
    """Return true if the pathname refers to an existing directory."""
    try:
        st = os.stat(s)
    except (OSError, ValueError):
        return False
    return stat.S_ISDIR(st.st_mode)


def getsize(filename):
    """Return the size of a file, reported by os.stat()."""
    return os.stat(filename).st_size


def getmtime(filename):
    """Return the last modification time of a file, reported by os.stat()."""
    return os.stat(filename).st_mtime


def getatime(filename):
    """Return the last access time of a file, reported by os.stat()."""
    return os.stat(filename).st_atime


def getctime(filename):
    """Return the metadata change time of a file, reported by os.stat()."""
    return os.stat(filename).st_ctime


# Return the longest prefix of all list elements.
def commonprefix(m):
    "Given a list of pathnames, returns the longest common leading component"
    if not m: return ''
    # Some people pass in a list of pathname parts to operate in an OS-agnostic
    # fashion; don't try to translate in that case as that's an abuse of the
    # API and they are already doing what they need to be OS-agnostic and so
    # they most likely won't be using an os.PathLike object in the sublists.
    if not isinstance(m[0], (list, tuple)):
        m = tuple(map(os.fspath, m))
    s1 = min(m)
    s2 = max(m)
    for i, c in enumerate(s1):
        if c != s2[i]:
            return s1[:i]
    return s1

# Are two stat buffers (obtained from stat, fstat or lstat)
# describing the same file?
def samestat(s1, s2):
    """Test whether two stat buffers reference the same file"""
    return (s1.st_ino == s2.st_ino and
            s1.st_dev == s2.st_dev)


# Are two filenames really pointing to the same file?
def samefile(f1, f2):
    """Test whether two pathnames reference the same actual file or directory

    This is determined by the device number and i-node number and
    raises an exception if an os.stat() call on either pathname fails.
    """
    s1 = os.stat(f1)
    s2 = os.stat(f2)
    return samestat(s1, s2)


# Are two open files really referencing the same file?
# (Not necessarily the same file descriptor!)
def sameopenfile(fp1, fp2):
    """Test whether two open file objects reference the same file"""
    s1 = os.fstat(fp1)
    s2 = os.fstat(fp2)
    return samestat(s1, s2)


# Split a path in root and extension.
# The extension is everything starting at the last dot in the last
# pathname component; the root is everything before that.
# It is always true that root + ext == p.

# Generic implementation of splitext, to be parametrized with
# the separators
def _splitext(p, sep, altsep, extsep):
    """Split the extension from a pathname.

    Extension is everything from the last dot to the end, ignoring
    leading dots.  Returns "(root, ext)"; ext may be empty."""
    # NOTE: This code must work for text and bytes strings.

    sepIndex = p.rfind(sep)
    if altsep:
        altsepIndex = p.rfind(altsep)
        sepIndex = max(sepIndex, altsepIndex)

    dotIndex = p.rfind(extsep)
    if dotIndex > sepIndex:
        # skip all leading dots
        filenameIndex = sepIndex + 1
        while filenameIndex < dotIndex:
            if p[filenameIndex:filenameIndex+1] != extsep:
                return p[:dotIndex], p[dotIndex:]
            filenameIndex += 1

    return p, p[:0]

def _check_arg_types(funcname, *args):
    hasstr = hasbytes = False
    for s in args:
        if isinstance(s, str):
            hasstr = True
        elif isinstance(s, bytes):
            hasbytes = True
        else:
            raise TypeError(f'{funcname}() argument must be str, bytes, or '
                            f'os.PathLike object, not {s.__class__.__name__!r}') from None
    if hasstr and hasbytes:
        raise TypeError("Can't mix strings and bytes in path components") from None
_pyio.py000064400000265771151153537440006267 0ustar00"""
Python implementation of the io module.
"""

import os
import abc
import codecs
import errno
import stat
import sys
# Import _thread instead of threading to reduce startup cost
from _thread import allocate_lock as Lock
if sys.platform in {'win32', 'cygwin'}:
    from msvcrt import setmode as _setmode
else:
    _setmode = None

import io
from io import (__all__, SEEK_SET, SEEK_CUR, SEEK_END)

valid_seek_flags = {0, 1, 2}  # Hardwired values
if hasattr(os, 'SEEK_HOLE') :
    valid_seek_flags.add(os.SEEK_HOLE)
    valid_seek_flags.add(os.SEEK_DATA)

# open() uses st_blksize whenever we can
DEFAULT_BUFFER_SIZE = 8 * 1024  # bytes

# NOTE: Base classes defined here are registered with the "official" ABCs
# defined in io.py. We don't use real inheritance though, because we don't want
# to inherit the C implementations.

# Rebind for compatibility
BlockingIOError = BlockingIOError

# Does io.IOBase finalizer log the exception if the close() method fails?
# The exception is ignored silently by default in release build.
_IOBASE_EMITS_UNRAISABLE = (hasattr(sys, "gettotalrefcount") or sys.flags.dev_mode)


def open(file, mode="r", buffering=-1, encoding=None, errors=None,
         newline=None, closefd=True, opener=None):

    r"""Open file and return a stream.  Raise OSError upon failure.

    file is either a text or byte string giving the name (and the path
    if the file isn't in the current working directory) of the file to
    be opened or an integer file descriptor of the file to be
    wrapped. (If a file descriptor is given, it is closed when the
    returned I/O object is closed, unless closefd is set to False.)

    mode is an optional string that specifies the mode in which the file is
    opened. It defaults to 'r' which means open for reading in text mode. Other
    common values are 'w' for writing (truncating the file if it already
    exists), 'x' for exclusive creation of a new file, and 'a' for appending
    (which on some Unix systems, means that all writes append to the end of the
    file regardless of the current seek position). In text mode, if encoding is
    not specified the encoding used is platform dependent. (For reading and
    writing raw bytes use binary mode and leave encoding unspecified.) The
    available modes are:

    ========= ===============================================================
    Character Meaning
    --------- ---------------------------------------------------------------
    'r'       open for reading (default)
    'w'       open for writing, truncating the file first
    'x'       create a new file and open it for writing
    'a'       open for writing, appending to the end of the file if it exists
    'b'       binary mode
    't'       text mode (default)
    '+'       open a disk file for updating (reading and writing)
    'U'       universal newline mode (deprecated)
    ========= ===============================================================

    The default mode is 'rt' (open for reading text). For binary random
    access, the mode 'w+b' opens and truncates the file to 0 bytes, while
    'r+b' opens the file without truncation. The 'x' mode implies 'w' and
    raises an `FileExistsError` if the file already exists.

    Python distinguishes between files opened in binary and text modes,
    even when the underlying operating system doesn't. Files opened in
    binary mode (appending 'b' to the mode argument) return contents as
    bytes objects without any decoding. In text mode (the default, or when
    't' is appended to the mode argument), the contents of the file are
    returned as strings, the bytes having been first decoded using a
    platform-dependent encoding or using the specified encoding if given.

    'U' mode is deprecated and will raise an exception in future versions
    of Python.  It has no effect in Python 3.  Use newline to control
    universal newlines mode.

    buffering is an optional integer used to set the buffering policy.
    Pass 0 to switch buffering off (only allowed in binary mode), 1 to select
    line buffering (only usable in text mode), and an integer > 1 to indicate
    the size of a fixed-size chunk buffer.  When no buffering argument is
    given, the default buffering policy works as follows:

    * Binary files are buffered in fixed-size chunks; the size of the buffer
      is chosen using a heuristic trying to determine the underlying device's
      "block size" and falling back on `io.DEFAULT_BUFFER_SIZE`.
      On many systems, the buffer will typically be 4096 or 8192 bytes long.

    * "Interactive" text files (files for which isatty() returns True)
      use line buffering.  Other text files use the policy described above
      for binary files.

    encoding is the str name of the encoding used to decode or encode the
    file. This should only be used in text mode. The default encoding is
    platform dependent, but any encoding supported by Python can be
    passed.  See the codecs module for the list of supported encodings.

    errors is an optional string that specifies how encoding errors are to
    be handled---this argument should not be used in binary mode. Pass
    'strict' to raise a ValueError exception if there is an encoding error
    (the default of None has the same effect), or pass 'ignore' to ignore
    errors. (Note that ignoring encoding errors can lead to data loss.)
    See the documentation for codecs.register for a list of the permitted
    encoding error strings.

    newline is a string controlling how universal newlines works (it only
    applies to text mode). It can be None, '', '\n', '\r', and '\r\n'.  It works
    as follows:

    * On input, if newline is None, universal newlines mode is
      enabled. Lines in the input can end in '\n', '\r', or '\r\n', and
      these are translated into '\n' before being returned to the
      caller. If it is '', universal newline mode is enabled, but line
      endings are returned to the caller untranslated. If it has any of
      the other legal values, input lines are only terminated by the given
      string, and the line ending is returned to the caller untranslated.

    * On output, if newline is None, any '\n' characters written are
      translated to the system default line separator, os.linesep. If
      newline is '', no translation takes place. If newline is any of the
      other legal values, any '\n' characters written are translated to
      the given string.

    closedfd is a bool. If closefd is False, the underlying file descriptor will
    be kept open when the file is closed. This does not work when a file name is
    given and must be True in that case.

    The newly created file is non-inheritable.

    A custom opener can be used by passing a callable as *opener*. The
    underlying file descriptor for the file object is then obtained by calling
    *opener* with (*file*, *flags*). *opener* must return an open file
    descriptor (passing os.open as *opener* results in functionality similar to
    passing None).

    open() returns a file object whose type depends on the mode, and
    through which the standard file operations such as reading and writing
    are performed. When open() is used to open a file in a text mode ('w',
    'r', 'wt', 'rt', etc.), it returns a TextIOWrapper. When used to open
    a file in a binary mode, the returned class varies: in read binary
    mode, it returns a BufferedReader; in write binary and append binary
    modes, it returns a BufferedWriter, and in read/write mode, it returns
    a BufferedRandom.

    It is also possible to use a string or bytearray as a file for both
    reading and writing. For strings StringIO can be used like a file
    opened in a text mode, and for bytes a BytesIO can be used like a file
    opened in a binary mode.
    """
    if not isinstance(file, int):
        file = os.fspath(file)
    if not isinstance(file, (str, bytes, int)):
        raise TypeError("invalid file: %r" % file)
    if not isinstance(mode, str):
        raise TypeError("invalid mode: %r" % mode)
    if not isinstance(buffering, int):
        raise TypeError("invalid buffering: %r" % buffering)
    if encoding is not None and not isinstance(encoding, str):
        raise TypeError("invalid encoding: %r" % encoding)
    if errors is not None and not isinstance(errors, str):
        raise TypeError("invalid errors: %r" % errors)
    modes = set(mode)
    if modes - set("axrwb+tU") or len(mode) > len(modes):
        raise ValueError("invalid mode: %r" % mode)
    creating = "x" in modes
    reading = "r" in modes
    writing = "w" in modes
    appending = "a" in modes
    updating = "+" in modes
    text = "t" in modes
    binary = "b" in modes
    if "U" in modes:
        if creating or writing or appending or updating:
            raise ValueError("mode U cannot be combined with 'x', 'w', 'a', or '+'")
        import warnings
        warnings.warn("'U' mode is deprecated",
                      DeprecationWarning, 2)
        reading = True
    if text and binary:
        raise ValueError("can't have text and binary mode at once")
    if creating + reading + writing + appending > 1:
        raise ValueError("can't have read/write/append mode at once")
    if not (creating or reading or writing or appending):
        raise ValueError("must have exactly one of read/write/append mode")
    if binary and encoding is not None:
        raise ValueError("binary mode doesn't take an encoding argument")
    if binary and errors is not None:
        raise ValueError("binary mode doesn't take an errors argument")
    if binary and newline is not None:
        raise ValueError("binary mode doesn't take a newline argument")
    if binary and buffering == 1:
        import warnings
        warnings.warn("line buffering (buffering=1) isn't supported in binary "
                      "mode, the default buffer size will be used",
                      RuntimeWarning, 2)
    raw = FileIO(file,
                 (creating and "x" or "") +
                 (reading and "r" or "") +
                 (writing and "w" or "") +
                 (appending and "a" or "") +
                 (updating and "+" or ""),
                 closefd, opener=opener)
    result = raw
    try:
        line_buffering = False
        if buffering == 1 or buffering < 0 and raw.isatty():
            buffering = -1
            line_buffering = True
        if buffering < 0:
            buffering = DEFAULT_BUFFER_SIZE
            try:
                bs = os.fstat(raw.fileno()).st_blksize
            except (OSError, AttributeError):
                pass
            else:
                if bs > 1:
                    buffering = bs
        if buffering < 0:
            raise ValueError("invalid buffering size")
        if buffering == 0:
            if binary:
                return result
            raise ValueError("can't have unbuffered text I/O")
        if updating:
            buffer = BufferedRandom(raw, buffering)
        elif creating or writing or appending:
            buffer = BufferedWriter(raw, buffering)
        elif reading:
            buffer = BufferedReader(raw, buffering)
        else:
            raise ValueError("unknown mode: %r" % mode)
        result = buffer
        if binary:
            return result
        text = TextIOWrapper(buffer, encoding, errors, newline, line_buffering)
        result = text
        text.mode = mode
        return result
    except:
        result.close()
        raise

# Define a default pure-Python implementation for open_code()
# that does not allow hooks. Warn on first use. Defined for tests.
def _open_code_with_warning(path):
    """Opens the provided file with mode ``'rb'``. This function
    should be used when the intent is to treat the contents as
    executable code.

    ``path`` should be an absolute path.

    When supported by the runtime, this function can be hooked
    in order to allow embedders more control over code files.
    This functionality is not supported on the current runtime.
    """
    import warnings
    warnings.warn("_pyio.open_code() may not be using hooks",
                  RuntimeWarning, 2)
    return open(path, "rb")

try:
    open_code = io.open_code
except AttributeError:
    open_code = _open_code_with_warning


class DocDescriptor:
    """Helper for builtins.open.__doc__
    """
    def __get__(self, obj, typ=None):
        return (
            "open(file, mode='r', buffering=-1, encoding=None, "
                 "errors=None, newline=None, closefd=True)\n\n" +
            open.__doc__)

class OpenWrapper:
    """Wrapper for builtins.open

    Trick so that open won't become a bound method when stored
    as a class variable (as dbm.dumb does).

    See initstdio() in Python/pylifecycle.c.
    """
    __doc__ = DocDescriptor()

    def __new__(cls, *args, **kwargs):
        return open(*args, **kwargs)


# In normal operation, both `UnsupportedOperation`s should be bound to the
# same object.
try:
    UnsupportedOperation = io.UnsupportedOperation
except AttributeError:
    class UnsupportedOperation(OSError, ValueError):
        pass


class IOBase(metaclass=abc.ABCMeta):

    """The abstract base class for all I/O classes, acting on streams of
    bytes. There is no public constructor.

    This class provides dummy implementations for many methods that
    derived classes can override selectively; the default implementations
    represent a file that cannot be read, written or seeked.

    Even though IOBase does not declare read or write because
    their signatures will vary, implementations and clients should
    consider those methods part of the interface. Also, implementations
    may raise UnsupportedOperation when operations they do not support are
    called.

    The basic type used for binary data read from or written to a file is
    bytes. Other bytes-like objects are accepted as method arguments too.
    Text I/O classes work with str data.

    Note that calling any method (even inquiries) on a closed stream is
    undefined. Implementations may raise OSError in this case.

    IOBase (and its subclasses) support the iterator protocol, meaning
    that an IOBase object can be iterated over yielding the lines in a
    stream.

    IOBase also supports the :keyword:`with` statement. In this example,
    fp is closed after the suite of the with statement is complete:

    with open('spam.txt', 'r') as fp:
        fp.write('Spam and eggs!')
    """

    ### Internal ###

    def _unsupported(self, name):
        """Internal: raise an OSError exception for unsupported operations."""
        raise UnsupportedOperation("%s.%s() not supported" %
                                   (self.__class__.__name__, name))

    ### Positioning ###

    def seek(self, pos, whence=0):
        """Change stream position.

        Change the stream position to byte offset pos. Argument pos is
        interpreted relative to the position indicated by whence.  Values
        for whence are ints:

        * 0 -- start of stream (the default); offset should be zero or positive
        * 1 -- current stream position; offset may be negative
        * 2 -- end of stream; offset is usually negative
        Some operating systems / file systems could provide additional values.

        Return an int indicating the new absolute position.
        """
        self._unsupported("seek")

    def tell(self):
        """Return an int indicating the current stream position."""
        return self.seek(0, 1)

    def truncate(self, pos=None):
        """Truncate file to size bytes.

        Size defaults to the current IO position as reported by tell().  Return
        the new size.
        """
        self._unsupported("truncate")

    ### Flush and close ###

    def flush(self):
        """Flush write buffers, if applicable.

        This is not implemented for read-only and non-blocking streams.
        """
        self._checkClosed()
        # XXX Should this return the number of bytes written???

    __closed = False

    def close(self):
        """Flush and close the IO object.

        This method has no effect if the file is already closed.
        """
        if not self.__closed:
            try:
                self.flush()
            finally:
                self.__closed = True

    def __del__(self):
        """Destructor.  Calls close()."""
        try:
            closed = self.closed
        except AttributeError:
            # If getting closed fails, then the object is probably
            # in an unusable state, so ignore.
            return

        if closed:
            return

        if _IOBASE_EMITS_UNRAISABLE:
            self.close()
        else:
            # The try/except block is in case this is called at program
            # exit time, when it's possible that globals have already been
            # deleted, and then the close() call might fail.  Since
            # there's nothing we can do about such failures and they annoy
            # the end users, we suppress the traceback.
            try:
                self.close()
            except:
                pass

    ### Inquiries ###

    def seekable(self):
        """Return a bool indicating whether object supports random access.

        If False, seek(), tell() and truncate() will raise OSError.
        This method may need to do a test seek().
        """
        return False

    def _checkSeekable(self, msg=None):
        """Internal: raise UnsupportedOperation if file is not seekable
        """
        if not self.seekable():
            raise UnsupportedOperation("File or stream is not seekable."
                                       if msg is None else msg)

    def readable(self):
        """Return a bool indicating whether object was opened for reading.

        If False, read() will raise OSError.
        """
        return False

    def _checkReadable(self, msg=None):
        """Internal: raise UnsupportedOperation if file is not readable
        """
        if not self.readable():
            raise UnsupportedOperation("File or stream is not readable."
                                       if msg is None else msg)

    def writable(self):
        """Return a bool indicating whether object was opened for writing.

        If False, write() and truncate() will raise OSError.
        """
        return False

    def _checkWritable(self, msg=None):
        """Internal: raise UnsupportedOperation if file is not writable
        """
        if not self.writable():
            raise UnsupportedOperation("File or stream is not writable."
                                       if msg is None else msg)

    @property
    def closed(self):
        """closed: bool.  True iff the file has been closed.

        For backwards compatibility, this is a property, not a predicate.
        """
        return self.__closed

    def _checkClosed(self, msg=None):
        """Internal: raise a ValueError if file is closed
        """
        if self.closed:
            raise ValueError("I/O operation on closed file."
                             if msg is None else msg)

    ### Context manager ###

    def __enter__(self):  # That's a forward reference
        """Context management protocol.  Returns self (an instance of IOBase)."""
        self._checkClosed()
        return self

    def __exit__(self, *args):
        """Context management protocol.  Calls close()"""
        self.close()

    ### Lower-level APIs ###

    # XXX Should these be present even if unimplemented?

    def fileno(self):
        """Returns underlying file descriptor (an int) if one exists.

        An OSError is raised if the IO object does not use a file descriptor.
        """
        self._unsupported("fileno")

    def isatty(self):
        """Return a bool indicating whether this is an 'interactive' stream.

        Return False if it can't be determined.
        """
        self._checkClosed()
        return False

    ### Readline[s] and writelines ###

    def readline(self, size=-1):
        r"""Read and return a line of bytes from the stream.

        If size is specified, at most size bytes will be read.
        Size should be an int.

        The line terminator is always b'\n' for binary files; for text
        files, the newlines argument to open can be used to select the line
        terminator(s) recognized.
        """
        # For backwards compatibility, a (slowish) readline().
        if hasattr(self, "peek"):
            def nreadahead():
                readahead = self.peek(1)
                if not readahead:
                    return 1
                n = (readahead.find(b"\n") + 1) or len(readahead)
                if size >= 0:
                    n = min(n, size)
                return n
        else:
            def nreadahead():
                return 1
        if size is None:
            size = -1
        else:
            try:
                size_index = size.__index__
            except AttributeError:
                raise TypeError(f"{size!r} is not an integer")
            else:
                size = size_index()
        res = bytearray()
        while size < 0 or len(res) < size:
            b = self.read(nreadahead())
            if not b:
                break
            res += b
            if res.endswith(b"\n"):
                break
        return bytes(res)

    def __iter__(self):
        self._checkClosed()
        return self

    def __next__(self):
        line = self.readline()
        if not line:
            raise StopIteration
        return line

    def readlines(self, hint=None):
        """Return a list of lines from the stream.

        hint can be specified to control the number of lines read: no more
        lines will be read if the total size (in bytes/characters) of all
        lines so far exceeds hint.
        """
        if hint is None or hint <= 0:
            return list(self)
        n = 0
        lines = []
        for line in self:
            lines.append(line)
            n += len(line)
            if n >= hint:
                break
        return lines

    def writelines(self, lines):
        """Write a list of lines to the stream.

        Line separators are not added, so it is usual for each of the lines
        provided to have a line separator at the end.
        """
        self._checkClosed()
        for line in lines:
            self.write(line)

io.IOBase.register(IOBase)


class RawIOBase(IOBase):

    """Base class for raw binary I/O."""

    # The read() method is implemented by calling readinto(); derived
    # classes that want to support read() only need to implement
    # readinto() as a primitive operation.  In general, readinto() can be
    # more efficient than read().

    # (It would be tempting to also provide an implementation of
    # readinto() in terms of read(), in case the latter is a more suitable
    # primitive operation, but that would lead to nasty recursion in case
    # a subclass doesn't implement either.)

    def read(self, size=-1):
        """Read and return up to size bytes, where size is an int.

        Returns an empty bytes object on EOF, or None if the object is
        set not to block and has no data to read.
        """
        if size is None:
            size = -1
        if size < 0:
            return self.readall()
        b = bytearray(size.__index__())
        n = self.readinto(b)
        if n is None:
            return None
        del b[n:]
        return bytes(b)

    def readall(self):
        """Read until EOF, using multiple read() call."""
        res = bytearray()
        while True:
            data = self.read(DEFAULT_BUFFER_SIZE)
            if not data:
                break
            res += data
        if res:
            return bytes(res)
        else:
            # b'' or None
            return data

    def readinto(self, b):
        """Read bytes into a pre-allocated bytes-like object b.

        Returns an int representing the number of bytes read (0 for EOF), or
        None if the object is set not to block and has no data to read.
        """
        self._unsupported("readinto")

    def write(self, b):
        """Write the given buffer to the IO stream.

        Returns the number of bytes written, which may be less than the
        length of b in bytes.
        """
        self._unsupported("write")

io.RawIOBase.register(RawIOBase)
from _io import FileIO
RawIOBase.register(FileIO)


class BufferedIOBase(IOBase):

    """Base class for buffered IO objects.

    The main difference with RawIOBase is that the read() method
    supports omitting the size argument, and does not have a default
    implementation that defers to readinto().

    In addition, read(), readinto() and write() may raise
    BlockingIOError if the underlying raw stream is in non-blocking
    mode and not ready; unlike their raw counterparts, they will never
    return None.

    A typical implementation should not inherit from a RawIOBase
    implementation, but wrap one.
    """

    def read(self, size=-1):
        """Read and return up to size bytes, where size is an int.

        If the argument is omitted, None, or negative, reads and
        returns all data until EOF.

        If the argument is positive, and the underlying raw stream is
        not 'interactive', multiple raw reads may be issued to satisfy
        the byte count (unless EOF is reached first).  But for
        interactive raw streams (XXX and for pipes?), at most one raw
        read will be issued, and a short result does not imply that
        EOF is imminent.

        Returns an empty bytes array on EOF.

        Raises BlockingIOError if the underlying raw stream has no
        data at the moment.
        """
        self._unsupported("read")

    def read1(self, size=-1):
        """Read up to size bytes with at most one read() system call,
        where size is an int.
        """
        self._unsupported("read1")

    def readinto(self, b):
        """Read bytes into a pre-allocated bytes-like object b.

        Like read(), this may issue multiple reads to the underlying raw
        stream, unless the latter is 'interactive'.

        Returns an int representing the number of bytes read (0 for EOF).

        Raises BlockingIOError if the underlying raw stream has no
        data at the moment.
        """

        return self._readinto(b, read1=False)

    def readinto1(self, b):
        """Read bytes into buffer *b*, using at most one system call

        Returns an int representing the number of bytes read (0 for EOF).

        Raises BlockingIOError if the underlying raw stream has no
        data at the moment.
        """

        return self._readinto(b, read1=True)

    def _readinto(self, b, read1):
        if not isinstance(b, memoryview):
            b = memoryview(b)
        b = b.cast('B')

        if read1:
            data = self.read1(len(b))
        else:
            data = self.read(len(b))
        n = len(data)

        b[:n] = data

        return n

    def write(self, b):
        """Write the given bytes buffer to the IO stream.

        Return the number of bytes written, which is always the length of b
        in bytes.

        Raises BlockingIOError if the buffer is full and the
        underlying raw stream cannot accept more data at the moment.
        """
        self._unsupported("write")

    def detach(self):
        """
        Separate the underlying raw stream from the buffer and return it.

        After the raw stream has been detached, the buffer is in an unusable
        state.
        """
        self._unsupported("detach")

io.BufferedIOBase.register(BufferedIOBase)


class _BufferedIOMixin(BufferedIOBase):

    """A mixin implementation of BufferedIOBase with an underlying raw stream.

    This passes most requests on to the underlying raw stream.  It
    does *not* provide implementations of read(), readinto() or
    write().
    """

    def __init__(self, raw):
        self._raw = raw

    ### Positioning ###

    def seek(self, pos, whence=0):
        new_position = self.raw.seek(pos, whence)
        if new_position < 0:
            raise OSError("seek() returned an invalid position")
        return new_position

    def tell(self):
        pos = self.raw.tell()
        if pos < 0:
            raise OSError("tell() returned an invalid position")
        return pos

    def truncate(self, pos=None):
        # Flush the stream.  We're mixing buffered I/O with lower-level I/O,
        # and a flush may be necessary to synch both views of the current
        # file state.
        self.flush()

        if pos is None:
            pos = self.tell()
        # XXX: Should seek() be used, instead of passing the position
        # XXX  directly to truncate?
        return self.raw.truncate(pos)

    ### Flush and close ###

    def flush(self):
        if self.closed:
            raise ValueError("flush on closed file")
        self.raw.flush()

    def close(self):
        if self.raw is not None and not self.closed:
            try:
                # may raise BlockingIOError or BrokenPipeError etc
                self.flush()
            finally:
                self.raw.close()

    def detach(self):
        if self.raw is None:
            raise ValueError("raw stream already detached")
        self.flush()
        raw = self._raw
        self._raw = None
        return raw

    ### Inquiries ###

    def seekable(self):
        return self.raw.seekable()

    @property
    def raw(self):
        return self._raw

    @property
    def closed(self):
        return self.raw.closed

    @property
    def name(self):
        return self.raw.name

    @property
    def mode(self):
        return self.raw.mode

    def __getstate__(self):
        raise TypeError(f"cannot pickle {self.__class__.__name__!r} object")

    def __repr__(self):
        modname = self.__class__.__module__
        clsname = self.__class__.__qualname__
        try:
            name = self.name
        except AttributeError:
            return "<{}.{}>".format(modname, clsname)
        else:
            return "<{}.{} name={!r}>".format(modname, clsname, name)

    ### Lower-level APIs ###

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

    def isatty(self):
        return self.raw.isatty()


class BytesIO(BufferedIOBase):

    """Buffered I/O implementation using an in-memory bytes buffer."""

    # Initialize _buffer as soon as possible since it's used by __del__()
    # which calls close()
    _buffer = None

    def __init__(self, initial_bytes=None):
        buf = bytearray()
        if initial_bytes is not None:
            buf += initial_bytes
        self._buffer = buf
        self._pos = 0

    def __getstate__(self):
        if self.closed:
            raise ValueError("__getstate__ on closed file")
        return self.__dict__.copy()

    def getvalue(self):
        """Return the bytes value (contents) of the buffer
        """
        if self.closed:
            raise ValueError("getvalue on closed file")
        return bytes(self._buffer)

    def getbuffer(self):
        """Return a readable and writable view of the buffer.
        """
        if self.closed:
            raise ValueError("getbuffer on closed file")
        return memoryview(self._buffer)

    def close(self):
        if self._buffer is not None:
            self._buffer.clear()
        super().close()

    def read(self, size=-1):
        if self.closed:
            raise ValueError("read from closed file")
        if size is None:
            size = -1
        else:
            try:
                size_index = size.__index__
            except AttributeError:
                raise TypeError(f"{size!r} is not an integer")
            else:
                size = size_index()
        if size < 0:
            size = len(self._buffer)
        if len(self._buffer) <= self._pos:
            return b""
        newpos = min(len(self._buffer), self._pos + size)
        b = self._buffer[self._pos : newpos]
        self._pos = newpos
        return bytes(b)

    def read1(self, size=-1):
        """This is the same as read.
        """
        return self.read(size)

    def write(self, b):
        if self.closed:
            raise ValueError("write to closed file")
        if isinstance(b, str):
            raise TypeError("can't write str to binary stream")
        with memoryview(b) as view:
            n = view.nbytes  # Size of any bytes-like object
        if n == 0:
            return 0
        pos = self._pos
        if pos > len(self._buffer):
            # Inserts null bytes between the current end of the file
            # and the new write position.
            padding = b'\x00' * (pos - len(self._buffer))
            self._buffer += padding
        self._buffer[pos:pos + n] = b
        self._pos += n
        return n

    def seek(self, pos, whence=0):
        if self.closed:
            raise ValueError("seek on closed file")
        try:
            pos_index = pos.__index__
        except AttributeError:
            raise TypeError(f"{pos!r} is not an integer")
        else:
            pos = pos_index()
        if whence == 0:
            if pos < 0:
                raise ValueError("negative seek position %r" % (pos,))
            self._pos = pos
        elif whence == 1:
            self._pos = max(0, self._pos + pos)
        elif whence == 2:
            self._pos = max(0, len(self._buffer) + pos)
        else:
            raise ValueError("unsupported whence value")
        return self._pos

    def tell(self):
        if self.closed:
            raise ValueError("tell on closed file")
        return self._pos

    def truncate(self, pos=None):
        if self.closed:
            raise ValueError("truncate on closed file")
        if pos is None:
            pos = self._pos
        else:
            try:
                pos_index = pos.__index__
            except AttributeError:
                raise TypeError(f"{pos!r} is not an integer")
            else:
                pos = pos_index()
            if pos < 0:
                raise ValueError("negative truncate position %r" % (pos,))
        del self._buffer[pos:]
        return pos

    def readable(self):
        if self.closed:
            raise ValueError("I/O operation on closed file.")
        return True

    def writable(self):
        if self.closed:
            raise ValueError("I/O operation on closed file.")
        return True

    def seekable(self):
        if self.closed:
            raise ValueError("I/O operation on closed file.")
        return True


class BufferedReader(_BufferedIOMixin):

    """BufferedReader(raw[, buffer_size])

    A buffer for a readable, sequential BaseRawIO object.

    The constructor creates a BufferedReader for the given readable raw
    stream and buffer_size. If buffer_size is omitted, DEFAULT_BUFFER_SIZE
    is used.
    """

    def __init__(self, raw, buffer_size=DEFAULT_BUFFER_SIZE):
        """Create a new buffered reader using the given readable raw IO object.
        """
        if not raw.readable():
            raise OSError('"raw" argument must be readable.')

        _BufferedIOMixin.__init__(self, raw)
        if buffer_size <= 0:
            raise ValueError("invalid buffer size")
        self.buffer_size = buffer_size
        self._reset_read_buf()
        self._read_lock = Lock()

    def readable(self):
        return self.raw.readable()

    def _reset_read_buf(self):
        self._read_buf = b""
        self._read_pos = 0

    def read(self, size=None):
        """Read size bytes.

        Returns exactly size bytes of data unless the underlying raw IO
        stream reaches EOF or if the call would block in non-blocking
        mode. If size is negative, read until EOF or until read() would
        block.
        """
        if size is not None and size < -1:
            raise ValueError("invalid number of bytes to read")
        with self._read_lock:
            return self._read_unlocked(size)

    def _read_unlocked(self, n=None):
        nodata_val = b""
        empty_values = (b"", None)
        buf = self._read_buf
        pos = self._read_pos

        # Special case for when the number of bytes to read is unspecified.
        if n is None or n == -1:
            self._reset_read_buf()
            if hasattr(self.raw, 'readall'):
                chunk = self.raw.readall()
                if chunk is None:
                    return buf[pos:] or None
                else:
                    return buf[pos:] + chunk
            chunks = [buf[pos:]]  # Strip the consumed bytes.
            current_size = 0
            while True:
                # Read until EOF or until read() would block.
                chunk = self.raw.read()
                if chunk in empty_values:
                    nodata_val = chunk
                    break
                current_size += len(chunk)
                chunks.append(chunk)
            return b"".join(chunks) or nodata_val

        # The number of bytes to read is specified, return at most n bytes.
        avail = len(buf) - pos  # Length of the available buffered data.
        if n <= avail:
            # Fast path: the data to read is fully buffered.
            self._read_pos += n
            return buf[pos:pos+n]
        # Slow path: read from the stream until enough bytes are read,
        # or until an EOF occurs or until read() would block.
        chunks = [buf[pos:]]
        wanted = max(self.buffer_size, n)
        while avail < n:
            chunk = self.raw.read(wanted)
            if chunk in empty_values:
                nodata_val = chunk
                break
            avail += len(chunk)
            chunks.append(chunk)
        # n is more than avail only when an EOF occurred or when
        # read() would have blocked.
        n = min(n, avail)
        out = b"".join(chunks)
        self._read_buf = out[n:]  # Save the extra data in the buffer.
        self._read_pos = 0
        return out[:n] if out else nodata_val

    def peek(self, size=0):
        """Returns buffered bytes without advancing the position.

        The argument indicates a desired minimal number of bytes; we
        do at most one raw read to satisfy it.  We never return more
        than self.buffer_size.
        """
        with self._read_lock:
            return self._peek_unlocked(size)

    def _peek_unlocked(self, n=0):
        want = min(n, self.buffer_size)
        have = len(self._read_buf) - self._read_pos
        if have < want or have <= 0:
            to_read = self.buffer_size - have
            current = self.raw.read(to_read)
            if current:
                self._read_buf = self._read_buf[self._read_pos:] + current
                self._read_pos = 0
        return self._read_buf[self._read_pos:]

    def read1(self, size=-1):
        """Reads up to size bytes, with at most one read() system call."""
        # Returns up to size bytes.  If at least one byte is buffered, we
        # only return buffered bytes.  Otherwise, we do one raw read.
        if size < 0:
            size = self.buffer_size
        if size == 0:
            return b""
        with self._read_lock:
            self._peek_unlocked(1)
            return self._read_unlocked(
                min(size, len(self._read_buf) - self._read_pos))

    # Implementing readinto() and readinto1() is not strictly necessary (we
    # could rely on the base class that provides an implementation in terms of
    # read() and read1()). We do it anyway to keep the _pyio implementation
    # similar to the io implementation (which implements the methods for
    # performance reasons).
    def _readinto(self, buf, read1):
        """Read data into *buf* with at most one system call."""

        # Need to create a memoryview object of type 'b', otherwise
        # we may not be able to assign bytes to it, and slicing it
        # would create a new object.
        if not isinstance(buf, memoryview):
            buf = memoryview(buf)
        if buf.nbytes == 0:
            return 0
        buf = buf.cast('B')

        written = 0
        with self._read_lock:
            while written < len(buf):

                # First try to read from internal buffer
                avail = min(len(self._read_buf) - self._read_pos, len(buf))
                if avail:
                    buf[written:written+avail] = \
                        self._read_buf[self._read_pos:self._read_pos+avail]
                    self._read_pos += avail
                    written += avail
                    if written == len(buf):
                        break

                # If remaining space in callers buffer is larger than
                # internal buffer, read directly into callers buffer
                if len(buf) - written > self.buffer_size:
                    n = self.raw.readinto(buf[written:])
                    if not n:
                        break # eof
                    written += n

                # Otherwise refill internal buffer - unless we're
                # in read1 mode and already got some data
                elif not (read1 and written):
                    if not self._peek_unlocked(1):
                        break # eof

                # In readinto1 mode, return as soon as we have some data
                if read1 and written:
                    break

        return written

    def tell(self):
        return _BufferedIOMixin.tell(self) - len(self._read_buf) + self._read_pos

    def seek(self, pos, whence=0):
        if whence not in valid_seek_flags:
            raise ValueError("invalid whence value")
        with self._read_lock:
            if whence == 1:
                pos -= len(self._read_buf) - self._read_pos
            pos = _BufferedIOMixin.seek(self, pos, whence)
            self._reset_read_buf()
            return pos

class BufferedWriter(_BufferedIOMixin):

    """A buffer for a writeable sequential RawIO object.

    The constructor creates a BufferedWriter for the given writeable raw
    stream. If the buffer_size is not given, it defaults to
    DEFAULT_BUFFER_SIZE.
    """

    def __init__(self, raw, buffer_size=DEFAULT_BUFFER_SIZE):
        if not raw.writable():
            raise OSError('"raw" argument must be writable.')

        _BufferedIOMixin.__init__(self, raw)
        if buffer_size <= 0:
            raise ValueError("invalid buffer size")
        self.buffer_size = buffer_size
        self._write_buf = bytearray()
        self._write_lock = Lock()

    def writable(self):
        return self.raw.writable()

    def write(self, b):
        if isinstance(b, str):
            raise TypeError("can't write str to binary stream")
        with self._write_lock:
            if self.closed:
                raise ValueError("write to closed file")
            # XXX we can implement some more tricks to try and avoid
            # partial writes
            if len(self._write_buf) > self.buffer_size:
                # We're full, so let's pre-flush the buffer.  (This may
                # raise BlockingIOError with characters_written == 0.)
                self._flush_unlocked()
            before = len(self._write_buf)
            self._write_buf.extend(b)
            written = len(self._write_buf) - before
            if len(self._write_buf) > self.buffer_size:
                try:
                    self._flush_unlocked()
                except BlockingIOError as e:
                    if len(self._write_buf) > self.buffer_size:
                        # We've hit the buffer_size. We have to accept a partial
                        # write and cut back our buffer.
                        overage = len(self._write_buf) - self.buffer_size
                        written -= overage
                        self._write_buf = self._write_buf[:self.buffer_size]
                        raise BlockingIOError(e.errno, e.strerror, written)
            return written

    def truncate(self, pos=None):
        with self._write_lock:
            self._flush_unlocked()
            if pos is None:
                pos = self.raw.tell()
            return self.raw.truncate(pos)

    def flush(self):
        with self._write_lock:
            self._flush_unlocked()

    def _flush_unlocked(self):
        if self.closed:
            raise ValueError("flush on closed file")
        while self._write_buf:
            try:
                n = self.raw.write(self._write_buf)
            except BlockingIOError:
                raise RuntimeError("self.raw should implement RawIOBase: it "
                                   "should not raise BlockingIOError")
            if n is None:
                raise BlockingIOError(
                    errno.EAGAIN,
                    "write could not complete without blocking", 0)
            if n > len(self._write_buf) or n < 0:
                raise OSError("write() returned incorrect number of bytes")
            del self._write_buf[:n]

    def tell(self):
        return _BufferedIOMixin.tell(self) + len(self._write_buf)

    def seek(self, pos, whence=0):
        if whence not in valid_seek_flags:
            raise ValueError("invalid whence value")
        with self._write_lock:
            self._flush_unlocked()
            return _BufferedIOMixin.seek(self, pos, whence)

    def close(self):
        with self._write_lock:
            if self.raw is None or self.closed:
                return
        # We have to release the lock and call self.flush() (which will
        # probably just re-take the lock) in case flush has been overridden in
        # a subclass or the user set self.flush to something. This is the same
        # behavior as the C implementation.
        try:
            # may raise BlockingIOError or BrokenPipeError etc
            self.flush()
        finally:
            with self._write_lock:
                self.raw.close()


class BufferedRWPair(BufferedIOBase):

    """A buffered reader and writer object together.

    A buffered reader object and buffered writer object put together to
    form a sequential IO object that can read and write. This is typically
    used with a socket or two-way pipe.

    reader and writer are RawIOBase objects that are readable and
    writeable respectively. If the buffer_size is omitted it defaults to
    DEFAULT_BUFFER_SIZE.
    """

    # XXX The usefulness of this (compared to having two separate IO
    # objects) is questionable.

    def __init__(self, reader, writer, buffer_size=DEFAULT_BUFFER_SIZE):
        """Constructor.

        The arguments are two RawIO instances.
        """
        if not reader.readable():
            raise OSError('"reader" argument must be readable.')

        if not writer.writable():
            raise OSError('"writer" argument must be writable.')

        self.reader = BufferedReader(reader, buffer_size)
        self.writer = BufferedWriter(writer, buffer_size)

    def read(self, size=-1):
        if size is None:
            size = -1
        return self.reader.read(size)

    def readinto(self, b):
        return self.reader.readinto(b)

    def write(self, b):
        return self.writer.write(b)

    def peek(self, size=0):
        return self.reader.peek(size)

    def read1(self, size=-1):
        return self.reader.read1(size)

    def readinto1(self, b):
        return self.reader.readinto1(b)

    def readable(self):
        return self.reader.readable()

    def writable(self):
        return self.writer.writable()

    def flush(self):
        return self.writer.flush()

    def close(self):
        try:
            self.writer.close()
        finally:
            self.reader.close()

    def isatty(self):
        return self.reader.isatty() or self.writer.isatty()

    @property
    def closed(self):
        return self.writer.closed


class BufferedRandom(BufferedWriter, BufferedReader):

    """A buffered interface to random access streams.

    The constructor creates a reader and writer for a seekable stream,
    raw, given in the first argument. If the buffer_size is omitted it
    defaults to DEFAULT_BUFFER_SIZE.
    """

    def __init__(self, raw, buffer_size=DEFAULT_BUFFER_SIZE):
        raw._checkSeekable()
        BufferedReader.__init__(self, raw, buffer_size)
        BufferedWriter.__init__(self, raw, buffer_size)

    def seek(self, pos, whence=0):
        if whence not in valid_seek_flags:
            raise ValueError("invalid whence value")
        self.flush()
        if self._read_buf:
            # Undo read ahead.
            with self._read_lock:
                self.raw.seek(self._read_pos - len(self._read_buf), 1)
        # First do the raw seek, then empty the read buffer, so that
        # if the raw seek fails, we don't lose buffered data forever.
        pos = self.raw.seek(pos, whence)
        with self._read_lock:
            self._reset_read_buf()
        if pos < 0:
            raise OSError("seek() returned invalid position")
        return pos

    def tell(self):
        if self._write_buf:
            return BufferedWriter.tell(self)
        else:
            return BufferedReader.tell(self)

    def truncate(self, pos=None):
        if pos is None:
            pos = self.tell()
        # Use seek to flush the read buffer.
        return BufferedWriter.truncate(self, pos)

    def read(self, size=None):
        if size is None:
            size = -1
        self.flush()
        return BufferedReader.read(self, size)

    def readinto(self, b):
        self.flush()
        return BufferedReader.readinto(self, b)

    def peek(self, size=0):
        self.flush()
        return BufferedReader.peek(self, size)

    def read1(self, size=-1):
        self.flush()
        return BufferedReader.read1(self, size)

    def readinto1(self, b):
        self.flush()
        return BufferedReader.readinto1(self, b)

    def write(self, b):
        if self._read_buf:
            # Undo readahead
            with self._read_lock:
                self.raw.seek(self._read_pos - len(self._read_buf), 1)
                self._reset_read_buf()
        return BufferedWriter.write(self, b)


class FileIO(RawIOBase):
    _fd = -1
    _created = False
    _readable = False
    _writable = False
    _appending = False
    _seekable = None
    _closefd = True

    def __init__(self, file, mode='r', closefd=True, opener=None):
        """Open a file.  The mode can be 'r' (default), 'w', 'x' or 'a' for reading,
        writing, exclusive creation or appending.  The file will be created if it
        doesn't exist when opened for writing or appending; it will be truncated
        when opened for writing.  A FileExistsError will be raised if it already
        exists when opened for creating. Opening a file for creating implies
        writing so this mode behaves in a similar way to 'w'. Add a '+' to the mode
        to allow simultaneous reading and writing. A custom opener can be used by
        passing a callable as *opener*. The underlying file descriptor for the file
        object is then obtained by calling opener with (*name*, *flags*).
        *opener* must return an open file descriptor (passing os.open as *opener*
        results in functionality similar to passing None).
        """
        if self._fd >= 0:
            # Have to close the existing file first.
            try:
                if self._closefd:
                    os.close(self._fd)
            finally:
                self._fd = -1

        if isinstance(file, float):
            raise TypeError('integer argument expected, got float')
        if isinstance(file, int):
            fd = file
            if fd < 0:
                raise ValueError('negative file descriptor')
        else:
            fd = -1

        if not isinstance(mode, str):
            raise TypeError('invalid mode: %s' % (mode,))
        if not set(mode) <= set('xrwab+'):
            raise ValueError('invalid mode: %s' % (mode,))
        if sum(c in 'rwax' for c in mode) != 1 or mode.count('+') > 1:
            raise ValueError('Must have exactly one of create/read/write/append '
                             'mode and at most one plus')

        if 'x' in mode:
            self._created = True
            self._writable = True
            flags = os.O_EXCL | os.O_CREAT
        elif 'r' in mode:
            self._readable = True
            flags = 0
        elif 'w' in mode:
            self._writable = True
            flags = os.O_CREAT | os.O_TRUNC
        elif 'a' in mode:
            self._writable = True
            self._appending = True
            flags = os.O_APPEND | os.O_CREAT

        if '+' in mode:
            self._readable = True
            self._writable = True

        if self._readable and self._writable:
            flags |= os.O_RDWR
        elif self._readable:
            flags |= os.O_RDONLY
        else:
            flags |= os.O_WRONLY

        flags |= getattr(os, 'O_BINARY', 0)

        noinherit_flag = (getattr(os, 'O_NOINHERIT', 0) or
                          getattr(os, 'O_CLOEXEC', 0))
        flags |= noinherit_flag

        owned_fd = None
        try:
            if fd < 0:
                if not closefd:
                    raise ValueError('Cannot use closefd=False with file name')
                if opener is None:
                    fd = os.open(file, flags, 0o666)
                else:
                    fd = opener(file, flags)
                    if not isinstance(fd, int):
                        raise TypeError('expected integer from opener')
                    if fd < 0:
                        raise OSError('Negative file descriptor')
                owned_fd = fd
                if not noinherit_flag:
                    os.set_inheritable(fd, False)

            self._closefd = closefd
            fdfstat = os.fstat(fd)
            try:
                if stat.S_ISDIR(fdfstat.st_mode):
                    raise IsADirectoryError(errno.EISDIR,
                                            os.strerror(errno.EISDIR), file)
            except AttributeError:
                # Ignore the AttribueError if stat.S_ISDIR or errno.EISDIR
                # don't exist.
                pass
            self._blksize = getattr(fdfstat, 'st_blksize', 0)
            if self._blksize <= 1:
                self._blksize = DEFAULT_BUFFER_SIZE

            if _setmode:
                # don't translate newlines (\r\n <=> \n)
                _setmode(fd, os.O_BINARY)

            self.name = file
            if self._appending:
                # For consistent behaviour, we explicitly seek to the
                # end of file (otherwise, it might be done only on the
                # first write()).
                try:
                    os.lseek(fd, 0, SEEK_END)
                except OSError as e:
                    if e.errno != errno.ESPIPE:
                        raise
        except:
            if owned_fd is not None:
                os.close(owned_fd)
            raise
        self._fd = fd

    def __del__(self):
        if self._fd >= 0 and self._closefd and not self.closed:
            import warnings
            warnings.warn('unclosed file %r' % (self,), ResourceWarning,
                          stacklevel=2, source=self)
            self.close()

    def __getstate__(self):
        raise TypeError(f"cannot pickle {self.__class__.__name__!r} object")

    def __repr__(self):
        class_name = '%s.%s' % (self.__class__.__module__,
                                self.__class__.__qualname__)
        if self.closed:
            return '<%s [closed]>' % class_name
        try:
            name = self.name
        except AttributeError:
            return ('<%s fd=%d mode=%r closefd=%r>' %
                    (class_name, self._fd, self.mode, self._closefd))
        else:
            return ('<%s name=%r mode=%r closefd=%r>' %
                    (class_name, name, self.mode, self._closefd))

    def _checkReadable(self):
        if not self._readable:
            raise UnsupportedOperation('File not open for reading')

    def _checkWritable(self, msg=None):
        if not self._writable:
            raise UnsupportedOperation('File not open for writing')

    def read(self, size=None):
        """Read at most size bytes, returned as bytes.

        Only makes one system call, so less data may be returned than requested
        In non-blocking mode, returns None if no data is available.
        Return an empty bytes object at EOF.
        """
        self._checkClosed()
        self._checkReadable()
        if size is None or size < 0:
            return self.readall()
        try:
            return os.read(self._fd, size)
        except BlockingIOError:
            return None

    def readall(self):
        """Read all data from the file, returned as bytes.

        In non-blocking mode, returns as much as is immediately available,
        or None if no data is available.  Return an empty bytes object at EOF.
        """
        self._checkClosed()
        self._checkReadable()
        bufsize = DEFAULT_BUFFER_SIZE
        try:
            pos = os.lseek(self._fd, 0, SEEK_CUR)
            end = os.fstat(self._fd).st_size
            if end >= pos:
                bufsize = end - pos + 1
        except OSError:
            pass

        result = bytearray()
        while True:
            if len(result) >= bufsize:
                bufsize = len(result)
                bufsize += max(bufsize, DEFAULT_BUFFER_SIZE)
            n = bufsize - len(result)
            try:
                chunk = os.read(self._fd, n)
            except BlockingIOError:
                if result:
                    break
                return None
            if not chunk: # reached the end of the file
                break
            result += chunk

        return bytes(result)

    def readinto(self, b):
        """Same as RawIOBase.readinto()."""
        m = memoryview(b).cast('B')
        data = self.read(len(m))
        n = len(data)
        m[:n] = data
        return n

    def write(self, b):
        """Write bytes b to file, return number written.

        Only makes one system call, so not all of the data may be written.
        The number of bytes actually written is returned.  In non-blocking mode,
        returns None if the write would block.
        """
        self._checkClosed()
        self._checkWritable()
        try:
            return os.write(self._fd, b)
        except BlockingIOError:
            return None

    def seek(self, pos, whence=SEEK_SET):
        """Move to new file position.

        Argument offset is a byte count.  Optional argument whence defaults to
        SEEK_SET or 0 (offset from start of file, offset should be >= 0); other values
        are SEEK_CUR or 1 (move relative to current position, positive or negative),
        and SEEK_END or 2 (move relative to end of file, usually negative, although
        many platforms allow seeking beyond the end of a file).

        Note that not all file objects are seekable.
        """
        if isinstance(pos, float):
            raise TypeError('an integer is required')
        self._checkClosed()
        return os.lseek(self._fd, pos, whence)

    def tell(self):
        """tell() -> int.  Current file position.

        Can raise OSError for non seekable files."""
        self._checkClosed()
        return os.lseek(self._fd, 0, SEEK_CUR)

    def truncate(self, size=None):
        """Truncate the file to at most size bytes.

        Size defaults to the current file position, as returned by tell().
        The current file position is changed to the value of size.
        """
        self._checkClosed()
        self._checkWritable()
        if size is None:
            size = self.tell()
        os.ftruncate(self._fd, size)
        return size

    def close(self):
        """Close the file.

        A closed file cannot be used for further I/O operations.  close() may be
        called more than once without error.
        """
        if not self.closed:
            try:
                if self._closefd:
                    os.close(self._fd)
            finally:
                super().close()

    def seekable(self):
        """True if file supports random-access."""
        self._checkClosed()
        if self._seekable is None:
            try:
                self.tell()
            except OSError:
                self._seekable = False
            else:
                self._seekable = True
        return self._seekable

    def readable(self):
        """True if file was opened in a read mode."""
        self._checkClosed()
        return self._readable

    def writable(self):
        """True if file was opened in a write mode."""
        self._checkClosed()
        return self._writable

    def fileno(self):
        """Return the underlying file descriptor (an integer)."""
        self._checkClosed()
        return self._fd

    def isatty(self):
        """True if the file is connected to a TTY device."""
        self._checkClosed()
        return os.isatty(self._fd)

    @property
    def closefd(self):
        """True if the file descriptor will be closed by close()."""
        return self._closefd

    @property
    def mode(self):
        """String giving the file mode"""
        if self._created:
            if self._readable:
                return 'xb+'
            else:
                return 'xb'
        elif self._appending:
            if self._readable:
                return 'ab+'
            else:
                return 'ab'
        elif self._readable:
            if self._writable:
                return 'rb+'
            else:
                return 'rb'
        else:
            return 'wb'


class TextIOBase(IOBase):

    """Base class for text I/O.

    This class provides a character and line based interface to stream
    I/O. There is no public constructor.
    """

    def read(self, size=-1):
        """Read at most size characters from stream, where size is an int.

        Read from underlying buffer until we have size characters or we hit EOF.
        If size is negative or omitted, read until EOF.

        Returns a string.
        """
        self._unsupported("read")

    def write(self, s):
        """Write string s to stream and returning an int."""
        self._unsupported("write")

    def truncate(self, pos=None):
        """Truncate size to pos, where pos is an int."""
        self._unsupported("truncate")

    def readline(self):
        """Read until newline or EOF.

        Returns an empty string if EOF is hit immediately.
        """
        self._unsupported("readline")

    def detach(self):
        """
        Separate the underlying buffer from the TextIOBase and return it.

        After the underlying buffer has been detached, the TextIO is in an
        unusable state.
        """
        self._unsupported("detach")

    @property
    def encoding(self):
        """Subclasses should override."""
        return None

    @property
    def newlines(self):
        """Line endings translated so far.

        Only line endings translated during reading are considered.

        Subclasses should override.
        """
        return None

    @property
    def errors(self):
        """Error setting of the decoder or encoder.

        Subclasses should override."""
        return None

io.TextIOBase.register(TextIOBase)


class IncrementalNewlineDecoder(codecs.IncrementalDecoder):
    r"""Codec used when reading a file in universal newlines mode.  It wraps
    another incremental decoder, translating \r\n and \r into \n.  It also
    records the types of newlines encountered.  When used with
    translate=False, it ensures that the newline sequence is returned in
    one piece.
    """
    def __init__(self, decoder, translate, errors='strict'):
        codecs.IncrementalDecoder.__init__(self, errors=errors)
        self.translate = translate
        self.decoder = decoder
        self.seennl = 0
        self.pendingcr = False

    def decode(self, input, final=False):
        # decode input (with the eventual \r from a previous pass)
        if self.decoder is None:
            output = input
        else:
            output = self.decoder.decode(input, final=final)
        if self.pendingcr and (output or final):
            output = "\r" + output
            self.pendingcr = False

        # retain last \r even when not translating data:
        # then readline() is sure to get \r\n in one pass
        if output.endswith("\r") and not final:
            output = output[:-1]
            self.pendingcr = True

        # Record which newlines are read
        crlf = output.count('\r\n')
        cr = output.count('\r') - crlf
        lf = output.count('\n') - crlf
        self.seennl |= (lf and self._LF) | (cr and self._CR) \
                    | (crlf and self._CRLF)

        if self.translate:
            if crlf:
                output = output.replace("\r\n", "\n")
            if cr:
                output = output.replace("\r", "\n")

        return output

    def getstate(self):
        if self.decoder is None:
            buf = b""
            flag = 0
        else:
            buf, flag = self.decoder.getstate()
        flag <<= 1
        if self.pendingcr:
            flag |= 1
        return buf, flag

    def setstate(self, state):
        buf, flag = state
        self.pendingcr = bool(flag & 1)
        if self.decoder is not None:
            self.decoder.setstate((buf, flag >> 1))

    def reset(self):
        self.seennl = 0
        self.pendingcr = False
        if self.decoder is not None:
            self.decoder.reset()

    _LF = 1
    _CR = 2
    _CRLF = 4

    @property
    def newlines(self):
        return (None,
                "\n",
                "\r",
                ("\r", "\n"),
                "\r\n",
                ("\n", "\r\n"),
                ("\r", "\r\n"),
                ("\r", "\n", "\r\n")
               )[self.seennl]


class TextIOWrapper(TextIOBase):

    r"""Character and line based layer over a BufferedIOBase object, buffer.

    encoding gives the name of the encoding that the stream will be
    decoded or encoded with. It defaults to locale.getpreferredencoding(False).

    errors determines the strictness of encoding and decoding (see the
    codecs.register) and defaults to "strict".

    newline can be None, '', '\n', '\r', or '\r\n'.  It controls the
    handling of line endings. If it is None, universal newlines is
    enabled.  With this enabled, on input, the lines endings '\n', '\r',
    or '\r\n' are translated to '\n' before being returned to the
    caller. Conversely, on output, '\n' is translated to the system
    default line separator, os.linesep. If newline is any other of its
    legal values, that newline becomes the newline when the file is read
    and it is returned untranslated. On output, '\n' is converted to the
    newline.

    If line_buffering is True, a call to flush is implied when a call to
    write contains a newline character.
    """

    _CHUNK_SIZE = 2048

    # Initialize _buffer as soon as possible since it's used by __del__()
    # which calls close()
    _buffer = None

    # The write_through argument has no effect here since this
    # implementation always writes through.  The argument is present only
    # so that the signature can match the signature of the C version.
    def __init__(self, buffer, encoding=None, errors=None, newline=None,
                 line_buffering=False, write_through=False):
        self._check_newline(newline)
        if encoding is None:
            try:
                encoding = os.device_encoding(buffer.fileno())
            except (AttributeError, UnsupportedOperation):
                pass
            if encoding is None:
                try:
                    import locale
                except ImportError:
                    # Importing locale may fail if Python is being built
                    encoding = "ascii"
                else:
                    encoding = locale.getpreferredencoding(False)

        if not isinstance(encoding, str):
            raise ValueError("invalid encoding: %r" % encoding)

        if not codecs.lookup(encoding)._is_text_encoding:
            msg = ("%r is not a text encoding; "
                   "use codecs.open() to handle arbitrary codecs")
            raise LookupError(msg % encoding)

        if errors is None:
            errors = "strict"
        else:
            if not isinstance(errors, str):
                raise ValueError("invalid errors: %r" % errors)

        self._buffer = buffer
        self._decoded_chars = ''  # buffer for text returned from decoder
        self._decoded_chars_used = 0  # offset into _decoded_chars for read()
        self._snapshot = None  # info for reconstructing decoder state
        self._seekable = self._telling = self.buffer.seekable()
        self._has_read1 = hasattr(self.buffer, 'read1')
        self._configure(encoding, errors, newline,
                        line_buffering, write_through)

    def _check_newline(self, newline):
        if newline is not None and not isinstance(newline, str):
            raise TypeError("illegal newline type: %r" % (type(newline),))
        if newline not in (None, "", "\n", "\r", "\r\n"):
            raise ValueError("illegal newline value: %r" % (newline,))

    def _configure(self, encoding=None, errors=None, newline=None,
                   line_buffering=False, write_through=False):
        self._encoding = encoding
        self._errors = errors
        self._encoder = None
        self._decoder = None
        self._b2cratio = 0.0

        self._readuniversal = not newline
        self._readtranslate = newline is None
        self._readnl = newline
        self._writetranslate = newline != ''
        self._writenl = newline or os.linesep

        self._line_buffering = line_buffering
        self._write_through = write_through

        # don't write a BOM in the middle of a file
        if self._seekable and self.writable():
            position = self.buffer.tell()
            if position != 0:
                try:
                    self._get_encoder().setstate(0)
                except LookupError:
                    # Sometimes the encoder doesn't exist
                    pass

    # self._snapshot is either None, or a tuple (dec_flags, next_input)
    # where dec_flags is the second (integer) item of the decoder state
    # and next_input is the chunk of input bytes that comes next after the
    # snapshot point.  We use this to reconstruct decoder states in tell().

    # Naming convention:
    #   - "bytes_..." for integer variables that count input bytes
    #   - "chars_..." for integer variables that count decoded characters

    def __repr__(self):
        result = "<{}.{}".format(self.__class__.__module__,
                                 self.__class__.__qualname__)
        try:
            name = self.name
        except AttributeError:
            pass
        else:
            result += " name={0!r}".format(name)
        try:
            mode = self.mode
        except AttributeError:
            pass
        else:
            result += " mode={0!r}".format(mode)
        return result + " encoding={0!r}>".format(self.encoding)

    @property
    def encoding(self):
        return self._encoding

    @property
    def errors(self):
        return self._errors

    @property
    def line_buffering(self):
        return self._line_buffering

    @property
    def write_through(self):
        return self._write_through

    @property
    def buffer(self):
        return self._buffer

    def reconfigure(self, *,
                    encoding=None, errors=None, newline=Ellipsis,
                    line_buffering=None, write_through=None):
        """Reconfigure the text stream with new parameters.

        This also flushes the stream.
        """
        if (self._decoder is not None
                and (encoding is not None or errors is not None
                     or newline is not Ellipsis)):
            raise UnsupportedOperation(
                "It is not possible to set the encoding or newline of stream "
                "after the first read")

        if errors is None:
            if encoding is None:
                errors = self._errors
            else:
                errors = 'strict'
        elif not isinstance(errors, str):
            raise TypeError("invalid errors: %r" % errors)

        if encoding is None:
            encoding = self._encoding
        else:
            if not isinstance(encoding, str):
                raise TypeError("invalid encoding: %r" % encoding)

        if newline is Ellipsis:
            newline = self._readnl
        self._check_newline(newline)

        if line_buffering is None:
            line_buffering = self.line_buffering
        if write_through is None:
            write_through = self.write_through

        self.flush()
        self._configure(encoding, errors, newline,
                        line_buffering, write_through)

    def seekable(self):
        if self.closed:
            raise ValueError("I/O operation on closed file.")
        return self._seekable

    def readable(self):
        return self.buffer.readable()

    def writable(self):
        return self.buffer.writable()

    def flush(self):
        self.buffer.flush()
        self._telling = self._seekable

    def close(self):
        if self.buffer is not None and not self.closed:
            try:
                self.flush()
            finally:
                self.buffer.close()

    @property
    def closed(self):
        return self.buffer.closed

    @property
    def name(self):
        return self.buffer.name

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

    def isatty(self):
        return self.buffer.isatty()

    def write(self, s):
        'Write data, where s is a str'
        if self.closed:
            raise ValueError("write to closed file")
        if not isinstance(s, str):
            raise TypeError("can't write %s to text stream" %
                            s.__class__.__name__)
        length = len(s)
        haslf = (self._writetranslate or self._line_buffering) and "\n" in s
        if haslf and self._writetranslate and self._writenl != "\n":
            s = s.replace("\n", self._writenl)
        encoder = self._encoder or self._get_encoder()
        # XXX What if we were just reading?
        b = encoder.encode(s)
        self.buffer.write(b)
        if self._line_buffering and (haslf or "\r" in s):
            self.flush()
        self._set_decoded_chars('')
        self._snapshot = None
        if self._decoder:
            self._decoder.reset()
        return length

    def _get_encoder(self):
        make_encoder = codecs.getincrementalencoder(self._encoding)
        self._encoder = make_encoder(self._errors)
        return self._encoder

    def _get_decoder(self):
        make_decoder = codecs.getincrementaldecoder(self._encoding)
        decoder = make_decoder(self._errors)
        if self._readuniversal:
            decoder = IncrementalNewlineDecoder(decoder, self._readtranslate)
        self._decoder = decoder
        return decoder

    # The following three methods implement an ADT for _decoded_chars.
    # Text returned from the decoder is buffered here until the client
    # requests it by calling our read() or readline() method.
    def _set_decoded_chars(self, chars):
        """Set the _decoded_chars buffer."""
        self._decoded_chars = chars
        self._decoded_chars_used = 0

    def _get_decoded_chars(self, n=None):
        """Advance into the _decoded_chars buffer."""
        offset = self._decoded_chars_used
        if n is None:
            chars = self._decoded_chars[offset:]
        else:
            chars = self._decoded_chars[offset:offset + n]
        self._decoded_chars_used += len(chars)
        return chars

    def _rewind_decoded_chars(self, n):
        """Rewind the _decoded_chars buffer."""
        if self._decoded_chars_used < n:
            raise AssertionError("rewind decoded_chars out of bounds")
        self._decoded_chars_used -= n

    def _read_chunk(self):
        """
        Read and decode the next chunk of data from the BufferedReader.
        """

        # The return value is True unless EOF was reached.  The decoded
        # string is placed in self._decoded_chars (replacing its previous
        # value).  The entire input chunk is sent to the decoder, though
        # some of it may remain buffered in the decoder, yet to be
        # converted.

        if self._decoder is None:
            raise ValueError("no decoder")

        if self._telling:
            # To prepare for tell(), we need to snapshot a point in the
            # file where the decoder's input buffer is empty.

            dec_buffer, dec_flags = self._decoder.getstate()
            # Given this, we know there was a valid snapshot point
            # len(dec_buffer) bytes ago with decoder state (b'', dec_flags).

        # Read a chunk, decode it, and put the result in self._decoded_chars.
        if self._has_read1:
            input_chunk = self.buffer.read1(self._CHUNK_SIZE)
        else:
            input_chunk = self.buffer.read(self._CHUNK_SIZE)
        eof = not input_chunk
        decoded_chars = self._decoder.decode(input_chunk, eof)
        self._set_decoded_chars(decoded_chars)
        if decoded_chars:
            self._b2cratio = len(input_chunk) / len(self._decoded_chars)
        else:
            self._b2cratio = 0.0

        if self._telling:
            # At the snapshot point, len(dec_buffer) bytes before the read,
            # the next input to be decoded is dec_buffer + input_chunk.
            self._snapshot = (dec_flags, dec_buffer + input_chunk)

        return not eof

    def _pack_cookie(self, position, dec_flags=0,
                           bytes_to_feed=0, need_eof=0, chars_to_skip=0):
        # The meaning of a tell() cookie is: seek to position, set the
        # decoder flags to dec_flags, read bytes_to_feed bytes, feed them
        # into the decoder with need_eof as the EOF flag, then skip
        # chars_to_skip characters of the decoded result.  For most simple
        # decoders, tell() will often just give a byte offset in the file.
        return (position | (dec_flags<<64) | (bytes_to_feed<<128) |
               (chars_to_skip<<192) | bool(need_eof)<<256)

    def _unpack_cookie(self, bigint):
        rest, position = divmod(bigint, 1<<64)
        rest, dec_flags = divmod(rest, 1<<64)
        rest, bytes_to_feed = divmod(rest, 1<<64)
        need_eof, chars_to_skip = divmod(rest, 1<<64)
        return position, dec_flags, bytes_to_feed, need_eof, chars_to_skip

    def tell(self):
        if not self._seekable:
            raise UnsupportedOperation("underlying stream is not seekable")
        if not self._telling:
            raise OSError("telling position disabled by next() call")
        self.flush()
        position = self.buffer.tell()
        decoder = self._decoder
        if decoder is None or self._snapshot is None:
            if self._decoded_chars:
                # This should never happen.
                raise AssertionError("pending decoded text")
            return position

        # Skip backward to the snapshot point (see _read_chunk).
        dec_flags, next_input = self._snapshot
        position -= len(next_input)

        # How many decoded characters have been used up since the snapshot?
        chars_to_skip = self._decoded_chars_used
        if chars_to_skip == 0:
            # We haven't moved from the snapshot point.
            return self._pack_cookie(position, dec_flags)

        # Starting from the snapshot position, we will walk the decoder
        # forward until it gives us enough decoded characters.
        saved_state = decoder.getstate()
        try:
            # Fast search for an acceptable start point, close to our
            # current pos.
            # Rationale: calling decoder.decode() has a large overhead
            # regardless of chunk size; we want the number of such calls to
            # be O(1) in most situations (common decoders, sensible input).
            # Actually, it will be exactly 1 for fixed-size codecs (all
            # 8-bit codecs, also UTF-16 and UTF-32).
            skip_bytes = int(self._b2cratio * chars_to_skip)
            skip_back = 1
            assert skip_bytes <= len(next_input)
            while skip_bytes > 0:
                decoder.setstate((b'', dec_flags))
                # Decode up to temptative start point
                n = len(decoder.decode(next_input[:skip_bytes]))
                if n <= chars_to_skip:
                    b, d = decoder.getstate()
                    if not b:
                        # Before pos and no bytes buffered in decoder => OK
                        dec_flags = d
                        chars_to_skip -= n
                        break
                    # Skip back by buffered amount and reset heuristic
                    skip_bytes -= len(b)
                    skip_back = 1
                else:
                    # We're too far ahead, skip back a bit
                    skip_bytes -= skip_back
                    skip_back = skip_back * 2
            else:
                skip_bytes = 0
                decoder.setstate((b'', dec_flags))

            # Note our initial start point.
            start_pos = position + skip_bytes
            start_flags = dec_flags
            if chars_to_skip == 0:
                # We haven't moved from the start point.
                return self._pack_cookie(start_pos, start_flags)

            # Feed the decoder one byte at a time.  As we go, note the
            # nearest "safe start point" before the current location
            # (a point where the decoder has nothing buffered, so seek()
            # can safely start from there and advance to this location).
            bytes_fed = 0
            need_eof = 0
            # Chars decoded since `start_pos`
            chars_decoded = 0
            for i in range(skip_bytes, len(next_input)):
                bytes_fed += 1
                chars_decoded += len(decoder.decode(next_input[i:i+1]))
                dec_buffer, dec_flags = decoder.getstate()
                if not dec_buffer and chars_decoded <= chars_to_skip:
                    # Decoder buffer is empty, so this is a safe start point.
                    start_pos += bytes_fed
                    chars_to_skip -= chars_decoded
                    start_flags, bytes_fed, chars_decoded = dec_flags, 0, 0
                if chars_decoded >= chars_to_skip:
                    break
            else:
                # We didn't get enough decoded data; signal EOF to get more.
                chars_decoded += len(decoder.decode(b'', final=True))
                need_eof = 1
                if chars_decoded < chars_to_skip:
                    raise OSError("can't reconstruct logical file position")

            # The returned cookie corresponds to the last safe start point.
            return self._pack_cookie(
                start_pos, start_flags, bytes_fed, need_eof, chars_to_skip)
        finally:
            decoder.setstate(saved_state)

    def truncate(self, pos=None):
        self.flush()
        if pos is None:
            pos = self.tell()
        return self.buffer.truncate(pos)

    def detach(self):
        if self.buffer is None:
            raise ValueError("buffer is already detached")
        self.flush()
        buffer = self._buffer
        self._buffer = None
        return buffer

    def seek(self, cookie, whence=0):
        def _reset_encoder(position):
            """Reset the encoder (merely useful for proper BOM handling)"""
            try:
                encoder = self._encoder or self._get_encoder()
            except LookupError:
                # Sometimes the encoder doesn't exist
                pass
            else:
                if position != 0:
                    encoder.setstate(0)
                else:
                    encoder.reset()

        if self.closed:
            raise ValueError("tell on closed file")
        if not self._seekable:
            raise UnsupportedOperation("underlying stream is not seekable")
        if whence == SEEK_CUR:
            if cookie != 0:
                raise UnsupportedOperation("can't do nonzero cur-relative seeks")
            # Seeking to the current position should attempt to
            # sync the underlying buffer with the current position.
            whence = 0
            cookie = self.tell()
        elif whence == SEEK_END:
            if cookie != 0:
                raise UnsupportedOperation("can't do nonzero end-relative seeks")
            self.flush()
            position = self.buffer.seek(0, whence)
            self._set_decoded_chars('')
            self._snapshot = None
            if self._decoder:
                self._decoder.reset()
            _reset_encoder(position)
            return position
        if whence != 0:
            raise ValueError("unsupported whence (%r)" % (whence,))
        if cookie < 0:
            raise ValueError("negative seek position %r" % (cookie,))
        self.flush()

        # The strategy of seek() is to go back to the safe start point
        # and replay the effect of read(chars_to_skip) from there.
        start_pos, dec_flags, bytes_to_feed, need_eof, chars_to_skip = \
            self._unpack_cookie(cookie)

        # Seek back to the safe start point.
        self.buffer.seek(start_pos)
        self._set_decoded_chars('')
        self._snapshot = None

        # Restore the decoder to its state from the safe start point.
        if cookie == 0 and self._decoder:
            self._decoder.reset()
        elif self._decoder or dec_flags or chars_to_skip:
            self._decoder = self._decoder or self._get_decoder()
            self._decoder.setstate((b'', dec_flags))
            self._snapshot = (dec_flags, b'')

        if chars_to_skip:
            # Just like _read_chunk, feed the decoder and save a snapshot.
            input_chunk = self.buffer.read(bytes_to_feed)
            self._set_decoded_chars(
                self._decoder.decode(input_chunk, need_eof))
            self._snapshot = (dec_flags, input_chunk)

            # Skip chars_to_skip of the decoded characters.
            if len(self._decoded_chars) < chars_to_skip:
                raise OSError("can't restore logical file position")
            self._decoded_chars_used = chars_to_skip

        _reset_encoder(cookie)
        return cookie

    def read(self, size=None):
        self._checkReadable()
        if size is None:
            size = -1
        else:
            try:
                size_index = size.__index__
            except AttributeError:
                raise TypeError(f"{size!r} is not an integer")
            else:
                size = size_index()
        decoder = self._decoder or self._get_decoder()
        if size < 0:
            # Read everything.
            result = (self._get_decoded_chars() +
                      decoder.decode(self.buffer.read(), final=True))
            self._set_decoded_chars('')
            self._snapshot = None
            return result
        else:
            # Keep reading chunks until we have size characters to return.
            eof = False
            result = self._get_decoded_chars(size)
            while len(result) < size and not eof:
                eof = not self._read_chunk()
                result += self._get_decoded_chars(size - len(result))
            return result

    def __next__(self):
        self._telling = False
        line = self.readline()
        if not line:
            self._snapshot = None
            self._telling = self._seekable
            raise StopIteration
        return line

    def readline(self, size=None):
        if self.closed:
            raise ValueError("read from closed file")
        if size is None:
            size = -1
        else:
            try:
                size_index = size.__index__
            except AttributeError:
                raise TypeError(f"{size!r} is not an integer")
            else:
                size = size_index()

        # Grab all the decoded text (we will rewind any extra bits later).
        line = self._get_decoded_chars()

        start = 0
        # Make the decoder if it doesn't already exist.
        if not self._decoder:
            self._get_decoder()

        pos = endpos = None
        while True:
            if self._readtranslate:
                # Newlines are already translated, only search for \n
                pos = line.find('\n', start)
                if pos >= 0:
                    endpos = pos + 1
                    break
                else:
                    start = len(line)

            elif self._readuniversal:
                # Universal newline search. Find any of \r, \r\n, \n
                # The decoder ensures that \r\n are not split in two pieces

                # In C we'd look for these in parallel of course.
                nlpos = line.find("\n", start)
                crpos = line.find("\r", start)
                if crpos == -1:
                    if nlpos == -1:
                        # Nothing found
                        start = len(line)
                    else:
                        # Found \n
                        endpos = nlpos + 1
                        break
                elif nlpos == -1:
                    # Found lone \r
                    endpos = crpos + 1
                    break
                elif nlpos < crpos:
                    # Found \n
                    endpos = nlpos + 1
                    break
                elif nlpos == crpos + 1:
                    # Found \r\n
                    endpos = crpos + 2
                    break
                else:
                    # Found \r
                    endpos = crpos + 1
                    break
            else:
                # non-universal
                pos = line.find(self._readnl)
                if pos >= 0:
                    endpos = pos + len(self._readnl)
                    break

            if size >= 0 and len(line) >= size:
                endpos = size  # reached length size
                break

            # No line ending seen yet - get more data'
            while self._read_chunk():
                if self._decoded_chars:
                    break
            if self._decoded_chars:
                line += self._get_decoded_chars()
            else:
                # end of file
                self._set_decoded_chars('')
                self._snapshot = None
                return line

        if size >= 0 and endpos > size:
            endpos = size  # don't exceed size

        # Rewind _decoded_chars to just after the line ending we found.
        self._rewind_decoded_chars(len(line) - endpos)
        return line[:endpos]

    @property
    def newlines(self):
        return self._decoder.newlines if self._decoder else None


class StringIO(TextIOWrapper):
    """Text I/O implementation using an in-memory buffer.

    The initial_value argument sets the value of object.  The newline
    argument is like the one of TextIOWrapper's constructor.
    """

    def __init__(self, initial_value="", newline="\n"):
        super(StringIO, self).__init__(BytesIO(),
                                       encoding="utf-8",
                                       errors="surrogatepass",
                                       newline=newline)
        # Issue #5645: make universal newlines semantics the same as in the
        # C version, even under Windows.
        if newline is None:
            self._writetranslate = False
        if initial_value is not None:
            if not isinstance(initial_value, str):
                raise TypeError("initial_value must be str or None, not {0}"
                                .format(type(initial_value).__name__))
            self.write(initial_value)
            self.seek(0)

    def getvalue(self):
        self.flush()
        decoder = self._decoder or self._get_decoder()
        old_state = decoder.getstate()
        decoder.reset()
        try:
            return decoder.decode(self.buffer.getvalue(), final=True)
        finally:
            decoder.setstate(old_state)

    def __repr__(self):
        # TextIOWrapper tells the encoding in its repr. In StringIO,
        # that's an implementation detail.
        return object.__repr__(self)

    @property
    def errors(self):
        return None

    @property
    def encoding(self):
        return None

    def detach(self):
        # This doesn't make sense on StringIO.
        self._unsupported("detach")
hmac.py000064400000017252151153537440006045 0ustar00"""HMAC (Keyed-Hashing for Message Authentication) module.

Implements the HMAC algorithm as described by RFC 2104.
"""

import warnings as _warnings
from _operator import _compare_digest as compare_digest
try:
    import _hashlib as _hashopenssl
except ImportError:
    _hashopenssl = None
    _openssl_md_meths = None
else:
    _openssl_md_meths = frozenset(_hashopenssl.openssl_md_meth_names)
import hashlib as _hashlib
import _hashlib as _hashlibopenssl
import _hmacopenssl

trans_5C = bytes((x ^ 0x5C) for x in range(256))
trans_36 = bytes((x ^ 0x36) for x in range(256))

# The size of the digests returned by HMAC depends on the underlying
# hashing module used.  Use digest_size from the instance of HMAC instead.
digest_size = None



class HMAC:
    """RFC 2104 HMAC class.  Also complies with RFC 4231.

    This supports the API for Cryptographic Hash Functions (PEP 247).
    """
    blocksize = 64  # 512-bit HMAC; can be changed in subclasses.

    def __init__(self, key, msg=None, digestmod=''):
        """Create a new HMAC object.

        key: bytes or buffer, key for the keyed hash object.
        msg: bytes or buffer, Initial input for the hash or None.
        digestmod: A hash name suitable for hashlib.new(). *OR*
                   A hashlib constructor returning a new hash object. *OR*
                   A module supporting PEP 247.

                   Required as of 3.8, despite its position after the optional
                   msg argument.  Passing it as a keyword argument is
                   recommended, though not required for legacy API reasons.
        """
        if _hashlibopenssl.get_fips_mode():
            raise ValueError(
                'This class is not available in FIPS mode. '
                + 'Use hmac.new().'
            )

        if not isinstance(key, (bytes, bytearray)):
            raise TypeError("key: expected bytes or bytearray, but got %r" % type(key).__name__)

        if not digestmod:
            raise TypeError("Missing required parameter 'digestmod'.")

        if callable(digestmod):
            self.digest_cons = digestmod
        elif isinstance(digestmod, str):
            self.digest_cons = lambda d=b'': _hashlib.new(digestmod, d)
        else:
            self.digest_cons = lambda d=b'': digestmod.new(d)

        self.outer = self.digest_cons()
        self.inner = self.digest_cons()
        self.digest_size = self.inner.digest_size

        if hasattr(self.inner, 'block_size'):
            blocksize = self.inner.block_size
            if blocksize < 16:
                _warnings.warn('block_size of %d seems too small; using our '
                               'default of %d.' % (blocksize, self.blocksize),
                               RuntimeWarning, 2)
                blocksize = self.blocksize
        else:
            _warnings.warn('No block_size attribute on given digest object; '
                           'Assuming %d.' % (self.blocksize),
                           RuntimeWarning, 2)
            blocksize = self.blocksize

        # self.blocksize is the default blocksize. self.block_size is
        # effective block size as well as the public API attribute.
        self.block_size = blocksize

        if len(key) > blocksize:
            key = self.digest_cons(key).digest()

        key = key.ljust(blocksize, b'\0')
        self.outer.update(key.translate(trans_5C))
        self.inner.update(key.translate(trans_36))
        if msg is not None:
            self.update(msg)

    @property
    def name(self):
        return "hmac-" + self.inner.name

    def update(self, msg):
        """Feed data from msg into this hashing object."""
        if _hashlibopenssl.get_fips_mode():
            raise ValueError('hmac.HMAC is not available in FIPS mode')
        self.inner.update(msg)

    def copy(self):
        """Return a separate copy of this hashing object.

        An update to this copy won't affect the original object.
        """
        # Call __new__ directly to avoid the expensive __init__.
        other = self.__class__.__new__(self.__class__)
        other.digest_cons = self.digest_cons
        other.digest_size = self.digest_size
        other.inner = self.inner.copy()
        other.outer = self.outer.copy()
        return other

    def _current(self):
        """Return a hash object for the current state.

        To be used only internally with digest() and hexdigest().
        """
        h = self.outer.copy()
        h.update(self.inner.digest())
        return h

    def digest(self):
        """Return the hash value of this hashing object.

        This returns the hmac value as bytes.  The object is
        not altered in any way by this function; you can continue
        updating the object after calling this function.
        """
        h = self._current()
        return h.digest()

    def hexdigest(self):
        """Like digest(), but returns a string of hexadecimal digits instead.
        """
        h = self._current()
        return h.hexdigest()

def _get_openssl_name(digestmod):
    if isinstance(digestmod, str):
        return digestmod.lower()
    elif callable(digestmod):
        digestmod = digestmod(b'')

    if not isinstance(digestmod, _hashlibopenssl.HASH):
        raise TypeError(
            'Only OpenSSL hashlib hashes are accepted in FIPS mode.')

    return digestmod.name.lower().replace('_', '-')

class HMAC_openssl(_hmacopenssl.HMAC):
    def __new__(cls, key, msg = None, digestmod = None):
        if not isinstance(key, (bytes, bytearray)):
            raise TypeError("key: expected bytes or bytearray, but got %r" % type(key).__name__)

        name = _get_openssl_name(digestmod)
        result = _hmacopenssl.HMAC.__new__(cls, key, digestmod=name)
        if msg:
            result.update(msg)
        return result


if _hashlibopenssl.get_fips_mode():
    HMAC = HMAC_openssl


def new(key, msg=None, digestmod=''):
    """Create a new hashing object and return it.

    key: bytes or buffer, The starting key for the hash.
    msg: bytes or buffer, Initial input for the hash, or None.
    digestmod: A hash name suitable for hashlib.new(). *OR*
               A hashlib constructor returning a new hash object. *OR*
               A module supporting PEP 247.

               Required as of 3.8, despite its position after the optional
               msg argument.  Passing it as a keyword argument is
               recommended, though not required for legacy API reasons.

    You can now feed arbitrary bytes into the object using its update()
    method, and can ask for the hash value at any time by calling its digest()
    or hexdigest() methods.
    """
    return HMAC(key, msg, digestmod)


def digest(key, msg, digest):
    """Fast inline implementation of HMAC.

    key: bytes or buffer, The key for the keyed hash object.
    msg: bytes or buffer, Input message.
    digest: A hash name suitable for hashlib.new() for best performance. *OR*
            A hashlib constructor returning a new hash object. *OR*
            A module supporting PEP 247.
    """
    if (_hashopenssl is not None and
            isinstance(digest, str) and digest in _openssl_md_meths):
        return _hashopenssl.hmac_digest(key, msg, digest)

    if callable(digest):
        digest_cons = digest
    elif isinstance(digest, str):
        digest_cons = lambda d=b'': _hashlib.new(digest, d)
    else:
        digest_cons = lambda d=b'': digest.new(d)

    inner = digest_cons()
    outer = digest_cons()
    blocksize = getattr(inner, 'block_size', 64)
    if len(key) > blocksize:
        key = digest_cons(key).digest()
    key = key + b'\x00' * (blocksize - len(key))
    inner.update(key.translate(trans_36))
    outer.update(key.translate(trans_5C))
    inner.update(msg)
    outer.update(inner.digest())
    return outer.digest()
socket.py000064400000104653151153537440006427 0ustar00# Wrapper module for _socket, providing some additional facilities
# implemented in Python.

"""\
This module provides socket operations and some related functions.
On Unix, it supports IP (Internet Protocol) and Unix domain sockets.
On other systems, it only supports IP. Functions specific for a
socket are available as methods of the socket object.

Functions:

socket() -- create a new socket object
socketpair() -- create a pair of new socket objects [*]
fromfd() -- create a socket object from an open file descriptor [*]
fromshare() -- create a socket object from data received from socket.share() [*]
gethostname() -- return the current hostname
gethostbyname() -- map a hostname to its IP number
gethostbyaddr() -- map an IP number or hostname to DNS info
getservbyname() -- map a service name and a protocol name to a port number
getprotobyname() -- map a protocol name (e.g. 'tcp') to a number
ntohs(), ntohl() -- convert 16, 32 bit int from network to host byte order
htons(), htonl() -- convert 16, 32 bit int from host to network byte order
inet_aton() -- convert IP addr string (123.45.67.89) to 32-bit packed format
inet_ntoa() -- convert 32-bit packed format IP to string (123.45.67.89)
socket.getdefaulttimeout() -- get the default timeout value
socket.setdefaulttimeout() -- set the default timeout value
create_connection() -- connects to an address, with an optional timeout and
                       optional source address.

 [*] not available on all platforms!

Special objects:

SocketType -- type object for socket objects
error -- exception raised for I/O errors
has_ipv6 -- boolean value indicating if IPv6 is supported

IntEnum constants:

AF_INET, AF_UNIX -- socket domains (first argument to socket() call)
SOCK_STREAM, SOCK_DGRAM, SOCK_RAW -- socket types (second argument)

Integer constants:

Many other constants may be defined; these may be used in calls to
the setsockopt() and getsockopt() methods.
"""

import _socket
from _socket import *

import os, sys, io, selectors
from enum import IntEnum, IntFlag

try:
    import errno
except ImportError:
    errno = None
EBADF = getattr(errno, 'EBADF', 9)
EAGAIN = getattr(errno, 'EAGAIN', 11)
EWOULDBLOCK = getattr(errno, 'EWOULDBLOCK', 11)

__all__ = ["fromfd", "getfqdn", "create_connection", "create_server",
           "has_dualstack_ipv6", "AddressFamily", "SocketKind"]
__all__.extend(os._get_exports_list(_socket))

# Set up the socket.AF_* socket.SOCK_* constants as members of IntEnums for
# nicer string representations.
# Note that _socket only knows about the integer values. The public interface
# in this module understands the enums and translates them back from integers
# where needed (e.g. .family property of a socket object).

IntEnum._convert_(
        'AddressFamily',
        __name__,
        lambda C: C.isupper() and C.startswith('AF_'))

IntEnum._convert_(
        'SocketKind',
        __name__,
        lambda C: C.isupper() and C.startswith('SOCK_'))

IntFlag._convert_(
        'MsgFlag',
        __name__,
        lambda C: C.isupper() and C.startswith('MSG_'))

IntFlag._convert_(
        'AddressInfo',
        __name__,
        lambda C: C.isupper() and C.startswith('AI_'))

_LOCALHOST    = '127.0.0.1'
_LOCALHOST_V6 = '::1'


def _intenum_converter(value, enum_klass):
    """Convert a numeric family value to an IntEnum member.

    If it's not a known member, return the numeric value itself.
    """
    try:
        return enum_klass(value)
    except ValueError:
        return value

_realsocket = socket

# WSA error codes
if sys.platform.lower().startswith("win"):
    errorTab = {}
    errorTab[6] = "Specified event object handle is invalid."
    errorTab[8] = "Insufficient memory available."
    errorTab[87] = "One or more parameters are invalid."
    errorTab[995] = "Overlapped operation aborted."
    errorTab[996] = "Overlapped I/O event object not in signaled state."
    errorTab[997] = "Overlapped operation will complete later."
    errorTab[10004] = "The operation was interrupted."
    errorTab[10009] = "A bad file handle was passed."
    errorTab[10013] = "Permission denied."
    errorTab[10014] = "A fault occurred on the network??"  # WSAEFAULT
    errorTab[10022] = "An invalid operation was attempted."
    errorTab[10024] = "Too many open files."
    errorTab[10035] = "The socket operation would block"
    errorTab[10036] = "A blocking operation is already in progress."
    errorTab[10037] = "Operation already in progress."
    errorTab[10038] = "Socket operation on nonsocket."
    errorTab[10039] = "Destination address required."
    errorTab[10040] = "Message too long."
    errorTab[10041] = "Protocol wrong type for socket."
    errorTab[10042] = "Bad protocol option."
    errorTab[10043] = "Protocol not supported."
    errorTab[10044] = "Socket type not supported."
    errorTab[10045] = "Operation not supported."
    errorTab[10046] = "Protocol family not supported."
    errorTab[10047] = "Address family not supported by protocol family."
    errorTab[10048] = "The network address is in use."
    errorTab[10049] = "Cannot assign requested address."
    errorTab[10050] = "Network is down."
    errorTab[10051] = "Network is unreachable."
    errorTab[10052] = "Network dropped connection on reset."
    errorTab[10053] = "Software caused connection abort."
    errorTab[10054] = "The connection has been reset."
    errorTab[10055] = "No buffer space available."
    errorTab[10056] = "Socket is already connected."
    errorTab[10057] = "Socket is not connected."
    errorTab[10058] = "The network has been shut down."
    errorTab[10059] = "Too many references."
    errorTab[10060] = "The operation timed out."
    errorTab[10061] = "Connection refused."
    errorTab[10062] = "Cannot translate name."
    errorTab[10063] = "The name is too long."
    errorTab[10064] = "The host is down."
    errorTab[10065] = "The host is unreachable."
    errorTab[10066] = "Directory not empty."
    errorTab[10067] = "Too many processes."
    errorTab[10068] = "User quota exceeded."
    errorTab[10069] = "Disk quota exceeded."
    errorTab[10070] = "Stale file handle reference."
    errorTab[10071] = "Item is remote."
    errorTab[10091] = "Network subsystem is unavailable."
    errorTab[10092] = "Winsock.dll version out of range."
    errorTab[10093] = "Successful WSAStartup not yet performed."
    errorTab[10101] = "Graceful shutdown in progress."
    errorTab[10102] = "No more results from WSALookupServiceNext."
    errorTab[10103] = "Call has been canceled."
    errorTab[10104] = "Procedure call table is invalid."
    errorTab[10105] = "Service provider is invalid."
    errorTab[10106] = "Service provider failed to initialize."
    errorTab[10107] = "System call failure."
    errorTab[10108] = "Service not found."
    errorTab[10109] = "Class type not found."
    errorTab[10110] = "No more results from WSALookupServiceNext."
    errorTab[10111] = "Call was canceled."
    errorTab[10112] = "Database query was refused."
    errorTab[11001] = "Host not found."
    errorTab[11002] = "Nonauthoritative host not found."
    errorTab[11003] = "This is a nonrecoverable error."
    errorTab[11004] = "Valid name, no data record requested type."
    errorTab[11005] = "QoS receivers."
    errorTab[11006] = "QoS senders."
    errorTab[11007] = "No QoS senders."
    errorTab[11008] = "QoS no receivers."
    errorTab[11009] = "QoS request confirmed."
    errorTab[11010] = "QoS admission error."
    errorTab[11011] = "QoS policy failure."
    errorTab[11012] = "QoS bad style."
    errorTab[11013] = "QoS bad object."
    errorTab[11014] = "QoS traffic control error."
    errorTab[11015] = "QoS generic error."
    errorTab[11016] = "QoS service type error."
    errorTab[11017] = "QoS flowspec error."
    errorTab[11018] = "Invalid QoS provider buffer."
    errorTab[11019] = "Invalid QoS filter style."
    errorTab[11020] = "Invalid QoS filter style."
    errorTab[11021] = "Incorrect QoS filter count."
    errorTab[11022] = "Invalid QoS object length."
    errorTab[11023] = "Incorrect QoS flow count."
    errorTab[11024] = "Unrecognized QoS object."
    errorTab[11025] = "Invalid QoS policy object."
    errorTab[11026] = "Invalid QoS flow descriptor."
    errorTab[11027] = "Invalid QoS provider-specific flowspec."
    errorTab[11028] = "Invalid QoS provider-specific filterspec."
    errorTab[11029] = "Invalid QoS shape discard mode object."
    errorTab[11030] = "Invalid QoS shaping rate object."
    errorTab[11031] = "Reserved policy QoS element type."
    __all__.append("errorTab")


class _GiveupOnSendfile(Exception): pass


class socket(_socket.socket):

    """A subclass of _socket.socket adding the makefile() method."""

    __slots__ = ["__weakref__", "_io_refs", "_closed"]

    def __init__(self, family=-1, type=-1, proto=-1, fileno=None):
        # For user code address family and type values are IntEnum members, but
        # for the underlying _socket.socket they're just integers. The
        # constructor of _socket.socket converts the given argument to an
        # integer automatically.
        if fileno is None:
            if family == -1:
                family = AF_INET
            if type == -1:
                type = SOCK_STREAM
            if proto == -1:
                proto = 0
        _socket.socket.__init__(self, family, type, proto, fileno)
        self._io_refs = 0
        self._closed = False

    def __enter__(self):
        return self

    def __exit__(self, *args):
        if not self._closed:
            self.close()

    def __repr__(self):
        """Wrap __repr__() to reveal the real class name and socket
        address(es).
        """
        closed = getattr(self, '_closed', False)
        s = "<%s.%s%s fd=%i, family=%s, type=%s, proto=%i" \
            % (self.__class__.__module__,
               self.__class__.__qualname__,
               " [closed]" if closed else "",
               self.fileno(),
               self.family,
               self.type,
               self.proto)
        if not closed:
            try:
                laddr = self.getsockname()
                if laddr:
                    s += ", laddr=%s" % str(laddr)
            except error:
                pass
            try:
                raddr = self.getpeername()
                if raddr:
                    s += ", raddr=%s" % str(raddr)
            except error:
                pass
        s += '>'
        return s

    def __getstate__(self):
        raise TypeError(f"cannot pickle {self.__class__.__name__!r} object")

    def dup(self):
        """dup() -> socket object

        Duplicate the socket. Return a new socket object connected to the same
        system resource. The new socket is non-inheritable.
        """
        fd = dup(self.fileno())
        sock = self.__class__(self.family, self.type, self.proto, fileno=fd)
        sock.settimeout(self.gettimeout())
        return sock

    def accept(self):
        """accept() -> (socket object, address info)

        Wait for an incoming connection.  Return a new socket
        representing the connection, and the address of the client.
        For IP sockets, the address info is a pair (hostaddr, port).
        """
        fd, addr = self._accept()
        sock = socket(self.family, self.type, self.proto, fileno=fd)
        # Issue #7995: if no default timeout is set and the listening
        # socket had a (non-zero) timeout, force the new socket in blocking
        # mode to override platform-specific socket flags inheritance.
        if getdefaulttimeout() is None and self.gettimeout():
            sock.setblocking(True)
        return sock, addr

    def makefile(self, mode="r", buffering=None, *,
                 encoding=None, errors=None, newline=None):
        """makefile(...) -> an I/O stream connected to the socket

        The arguments are as for io.open() after the filename, except the only
        supported mode values are 'r' (default), 'w' and 'b'.
        """
        # XXX refactor to share code?
        if not set(mode) <= {"r", "w", "b"}:
            raise ValueError("invalid mode %r (only r, w, b allowed)" % (mode,))
        writing = "w" in mode
        reading = "r" in mode or not writing
        assert reading or writing
        binary = "b" in mode
        rawmode = ""
        if reading:
            rawmode += "r"
        if writing:
            rawmode += "w"
        raw = SocketIO(self, rawmode)
        self._io_refs += 1
        if buffering is None:
            buffering = -1
        if buffering < 0:
            buffering = io.DEFAULT_BUFFER_SIZE
        if buffering == 0:
            if not binary:
                raise ValueError("unbuffered streams must be binary")
            return raw
        if reading and writing:
            buffer = io.BufferedRWPair(raw, raw, buffering)
        elif reading:
            buffer = io.BufferedReader(raw, buffering)
        else:
            assert writing
            buffer = io.BufferedWriter(raw, buffering)
        if binary:
            return buffer
        text = io.TextIOWrapper(buffer, encoding, errors, newline)
        text.mode = mode
        return text

    if hasattr(os, 'sendfile'):

        def _sendfile_use_sendfile(self, file, offset=0, count=None):
            self._check_sendfile_params(file, offset, count)
            sockno = self.fileno()
            try:
                fileno = file.fileno()
            except (AttributeError, io.UnsupportedOperation) as err:
                raise _GiveupOnSendfile(err)  # not a regular file
            try:
                fsize = os.fstat(fileno).st_size
            except OSError as err:
                raise _GiveupOnSendfile(err)  # not a regular file
            if not fsize:
                return 0  # empty file
            # Truncate to 1GiB to avoid OverflowError, see bpo-38319.
            blocksize = min(count or fsize, 2 ** 30)
            timeout = self.gettimeout()
            if timeout == 0:
                raise ValueError("non-blocking sockets are not supported")
            # poll/select have the advantage of not requiring any
            # extra file descriptor, contrarily to epoll/kqueue
            # (also, they require a single syscall).
            if hasattr(selectors, 'PollSelector'):
                selector = selectors.PollSelector()
            else:
                selector = selectors.SelectSelector()
            selector.register(sockno, selectors.EVENT_WRITE)

            total_sent = 0
            # localize variable access to minimize overhead
            selector_select = selector.select
            os_sendfile = os.sendfile
            try:
                while True:
                    if timeout and not selector_select(timeout):
                        raise _socket.timeout('timed out')
                    if count:
                        blocksize = count - total_sent
                        if blocksize <= 0:
                            break
                    try:
                        sent = os_sendfile(sockno, fileno, offset, blocksize)
                    except BlockingIOError:
                        if not timeout:
                            # Block until the socket is ready to send some
                            # data; avoids hogging CPU resources.
                            selector_select()
                        continue
                    except OSError as err:
                        if total_sent == 0:
                            # We can get here for different reasons, the main
                            # one being 'file' is not a regular mmap(2)-like
                            # file, in which case we'll fall back on using
                            # plain send().
                            raise _GiveupOnSendfile(err)
                        raise err from None
                    else:
                        if sent == 0:
                            break  # EOF
                        offset += sent
                        total_sent += sent
                return total_sent
            finally:
                if total_sent > 0 and hasattr(file, 'seek'):
                    file.seek(offset)
    else:
        def _sendfile_use_sendfile(self, file, offset=0, count=None):
            raise _GiveupOnSendfile(
                "os.sendfile() not available on this platform")

    def _sendfile_use_send(self, file, offset=0, count=None):
        self._check_sendfile_params(file, offset, count)
        if self.gettimeout() == 0:
            raise ValueError("non-blocking sockets are not supported")
        if offset:
            file.seek(offset)
        blocksize = min(count, 8192) if count else 8192
        total_sent = 0
        # localize variable access to minimize overhead
        file_read = file.read
        sock_send = self.send
        try:
            while True:
                if count:
                    blocksize = min(count - total_sent, blocksize)
                    if blocksize <= 0:
                        break
                data = memoryview(file_read(blocksize))
                if not data:
                    break  # EOF
                while True:
                    try:
                        sent = sock_send(data)
                    except BlockingIOError:
                        continue
                    else:
                        total_sent += sent
                        if sent < len(data):
                            data = data[sent:]
                        else:
                            break
            return total_sent
        finally:
            if total_sent > 0 and hasattr(file, 'seek'):
                file.seek(offset + total_sent)

    def _check_sendfile_params(self, file, offset, count):
        if 'b' not in getattr(file, 'mode', 'b'):
            raise ValueError("file should be opened in binary mode")
        if not self.type & SOCK_STREAM:
            raise ValueError("only SOCK_STREAM type sockets are supported")
        if count is not None:
            if not isinstance(count, int):
                raise TypeError(
                    "count must be a positive integer (got {!r})".format(count))
            if count <= 0:
                raise ValueError(
                    "count must be a positive integer (got {!r})".format(count))

    def sendfile(self, file, offset=0, count=None):
        """sendfile(file[, offset[, count]]) -> sent

        Send a file until EOF is reached by using high-performance
        os.sendfile() and return the total number of bytes which
        were sent.
        *file* must be a regular file object opened in binary mode.
        If os.sendfile() is not available (e.g. Windows) or file is
        not a regular file socket.send() will be used instead.
        *offset* tells from where to start reading the file.
        If specified, *count* is the total number of bytes to transmit
        as opposed to sending the file until EOF is reached.
        File position is updated on return or also in case of error in
        which case file.tell() can be used to figure out the number of
        bytes which were sent.
        The socket must be of SOCK_STREAM type.
        Non-blocking sockets are not supported.
        """
        try:
            return self._sendfile_use_sendfile(file, offset, count)
        except _GiveupOnSendfile:
            return self._sendfile_use_send(file, offset, count)

    def _decref_socketios(self):
        if self._io_refs > 0:
            self._io_refs -= 1
        if self._closed:
            self.close()

    def _real_close(self, _ss=_socket.socket):
        # This function should not reference any globals. See issue #808164.
        _ss.close(self)

    def close(self):
        # This function should not reference any globals. See issue #808164.
        self._closed = True
        if self._io_refs <= 0:
            self._real_close()

    def detach(self):
        """detach() -> file descriptor

        Close the socket object without closing the underlying file descriptor.
        The object cannot be used after this call, but the file descriptor
        can be reused for other purposes.  The file descriptor is returned.
        """
        self._closed = True
        return super().detach()

    @property
    def family(self):
        """Read-only access to the address family for this socket.
        """
        return _intenum_converter(super().family, AddressFamily)

    @property
    def type(self):
        """Read-only access to the socket type.
        """
        return _intenum_converter(super().type, SocketKind)

    if os.name == 'nt':
        def get_inheritable(self):
            return os.get_handle_inheritable(self.fileno())
        def set_inheritable(self, inheritable):
            os.set_handle_inheritable(self.fileno(), inheritable)
    else:
        def get_inheritable(self):
            return os.get_inheritable(self.fileno())
        def set_inheritable(self, inheritable):
            os.set_inheritable(self.fileno(), inheritable)
    get_inheritable.__doc__ = "Get the inheritable flag of the socket"
    set_inheritable.__doc__ = "Set the inheritable flag of the socket"

def fromfd(fd, family, type, proto=0):
    """ fromfd(fd, family, type[, proto]) -> socket object

    Create a socket object from a duplicate of the given file
    descriptor.  The remaining arguments are the same as for socket().
    """
    nfd = dup(fd)
    return socket(family, type, proto, nfd)

if hasattr(_socket.socket, "share"):
    def fromshare(info):
        """ fromshare(info) -> socket object

        Create a socket object from the bytes object returned by
        socket.share(pid).
        """
        return socket(0, 0, 0, info)
    __all__.append("fromshare")

if hasattr(_socket, "socketpair"):

    def socketpair(family=None, type=SOCK_STREAM, proto=0):
        """socketpair([family[, type[, proto]]]) -> (socket object, socket object)

        Create a pair of socket objects from the sockets returned by the platform
        socketpair() function.
        The arguments are the same as for socket() except the default family is
        AF_UNIX if defined on the platform; otherwise, the default is AF_INET.
        """
        if family is None:
            try:
                family = AF_UNIX
            except NameError:
                family = AF_INET
        a, b = _socket.socketpair(family, type, proto)
        a = socket(family, type, proto, a.detach())
        b = socket(family, type, proto, b.detach())
        return a, b

else:

    # Origin: https://gist.github.com/4325783, by Geert Jansen.  Public domain.
    def socketpair(family=AF_INET, type=SOCK_STREAM, proto=0):
        if family == AF_INET:
            host = _LOCALHOST
        elif family == AF_INET6:
            host = _LOCALHOST_V6
        else:
            raise ValueError("Only AF_INET and AF_INET6 socket address families "
                             "are supported")
        if type != SOCK_STREAM:
            raise ValueError("Only SOCK_STREAM socket type is supported")
        if proto != 0:
            raise ValueError("Only protocol zero is supported")

        # We create a connected TCP socket. Note the trick with
        # setblocking(False) that prevents us from having to create a thread.
        lsock = socket(family, type, proto)
        try:
            lsock.bind((host, 0))
            lsock.listen()
            # On IPv6, ignore flow_info and scope_id
            addr, port = lsock.getsockname()[:2]
            csock = socket(family, type, proto)
            try:
                csock.setblocking(False)
                try:
                    csock.connect((addr, port))
                except (BlockingIOError, InterruptedError):
                    pass
                csock.setblocking(True)
                ssock, _ = lsock.accept()
            except:
                csock.close()
                raise
        finally:
            lsock.close()
        return (ssock, csock)
    __all__.append("socketpair")

socketpair.__doc__ = """socketpair([family[, type[, proto]]]) -> (socket object, socket object)
Create a pair of socket objects from the sockets returned by the platform
socketpair() function.
The arguments are the same as for socket() except the default family is AF_UNIX
if defined on the platform; otherwise, the default is AF_INET.
"""

_blocking_errnos = { EAGAIN, EWOULDBLOCK }

class SocketIO(io.RawIOBase):

    """Raw I/O implementation for stream sockets.

    This class supports the makefile() method on sockets.  It provides
    the raw I/O interface on top of a socket object.
    """

    # One might wonder why not let FileIO do the job instead.  There are two
    # main reasons why FileIO is not adapted:
    # - it wouldn't work under Windows (where you can't used read() and
    #   write() on a socket handle)
    # - it wouldn't work with socket timeouts (FileIO would ignore the
    #   timeout and consider the socket non-blocking)

    # XXX More docs

    def __init__(self, sock, mode):
        if mode not in ("r", "w", "rw", "rb", "wb", "rwb"):
            raise ValueError("invalid mode: %r" % mode)
        io.RawIOBase.__init__(self)
        self._sock = sock
        if "b" not in mode:
            mode += "b"
        self._mode = mode
        self._reading = "r" in mode
        self._writing = "w" in mode
        self._timeout_occurred = False

    def readinto(self, b):
        """Read up to len(b) bytes into the writable buffer *b* and return
        the number of bytes read.  If the socket is non-blocking and no bytes
        are available, None is returned.

        If *b* is non-empty, a 0 return value indicates that the connection
        was shutdown at the other end.
        """
        self._checkClosed()
        self._checkReadable()
        if self._timeout_occurred:
            raise OSError("cannot read from timed out object")
        while True:
            try:
                return self._sock.recv_into(b)
            except timeout:
                self._timeout_occurred = True
                raise
            except error as e:
                if e.args[0] in _blocking_errnos:
                    return None
                raise

    def write(self, b):
        """Write the given bytes or bytearray object *b* to the socket
        and return the number of bytes written.  This can be less than
        len(b) if not all data could be written.  If the socket is
        non-blocking and no bytes could be written None is returned.
        """
        self._checkClosed()
        self._checkWritable()
        try:
            return self._sock.send(b)
        except error as e:
            # XXX what about EINTR?
            if e.args[0] in _blocking_errnos:
                return None
            raise

    def readable(self):
        """True if the SocketIO is open for reading.
        """
        if self.closed:
            raise ValueError("I/O operation on closed socket.")
        return self._reading

    def writable(self):
        """True if the SocketIO is open for writing.
        """
        if self.closed:
            raise ValueError("I/O operation on closed socket.")
        return self._writing

    def seekable(self):
        """True if the SocketIO is open for seeking.
        """
        if self.closed:
            raise ValueError("I/O operation on closed socket.")
        return super().seekable()

    def fileno(self):
        """Return the file descriptor of the underlying socket.
        """
        self._checkClosed()
        return self._sock.fileno()

    @property
    def name(self):
        if not self.closed:
            return self.fileno()
        else:
            return -1

    @property
    def mode(self):
        return self._mode

    def close(self):
        """Close the SocketIO object.  This doesn't close the underlying
        socket, except if all references to it have disappeared.
        """
        if self.closed:
            return
        io.RawIOBase.close(self)
        self._sock._decref_socketios()
        self._sock = None


def getfqdn(name=''):
    """Get fully qualified domain name from name.

    An empty argument is interpreted as meaning the local host.

    First the hostname returned by gethostbyaddr() is checked, then
    possibly existing aliases. In case no FQDN is available, hostname
    from gethostname() is returned.
    """
    name = name.strip()
    if not name or name == '0.0.0.0':
        name = gethostname()
    try:
        hostname, aliases, ipaddrs = gethostbyaddr(name)
    except error:
        pass
    else:
        aliases.insert(0, hostname)
        for name in aliases:
            if '.' in name:
                break
        else:
            name = hostname
    return name


_GLOBAL_DEFAULT_TIMEOUT = object()

def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT,
                      source_address=None):
    """Connect to *address* and return the socket object.

    Convenience function.  Connect to *address* (a 2-tuple ``(host,
    port)``) and return the socket object.  Passing the optional
    *timeout* parameter will set the timeout on the socket instance
    before attempting to connect.  If no *timeout* is supplied, the
    global default timeout setting returned by :func:`getdefaulttimeout`
    is used.  If *source_address* is set it must be a tuple of (host, port)
    for the socket to bind as a source address before making the connection.
    A host of '' or port 0 tells the OS to use the default.
    """

    host, port = address
    err = None
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
        af, socktype, proto, canonname, sa = res
        sock = None
        try:
            sock = socket(af, socktype, proto)
            if timeout is not _GLOBAL_DEFAULT_TIMEOUT:
                sock.settimeout(timeout)
            if source_address:
                sock.bind(source_address)
            sock.connect(sa)
            # Break explicitly a reference cycle
            err = None
            return sock

        except error as _:
            err = _
            if sock is not None:
                sock.close()

    if err is not None:
        try:
            raise err
        finally:
            # Break explicitly a reference cycle
            err = None
    else:
        raise error("getaddrinfo returns an empty list")


def has_dualstack_ipv6():
    """Return True if the platform supports creating a SOCK_STREAM socket
    which can handle both AF_INET and AF_INET6 (IPv4 / IPv6) connections.
    """
    if not has_ipv6 \
            or not hasattr(_socket, 'IPPROTO_IPV6') \
            or not hasattr(_socket, 'IPV6_V6ONLY'):
        return False
    try:
        with socket(AF_INET6, SOCK_STREAM) as sock:
            sock.setsockopt(IPPROTO_IPV6, IPV6_V6ONLY, 0)
            return True
    except error:
        return False


def create_server(address, *, family=AF_INET, backlog=None, reuse_port=False,
                  dualstack_ipv6=False):
    """Convenience function which creates a SOCK_STREAM type socket
    bound to *address* (a 2-tuple (host, port)) and return the socket
    object.

    *family* should be either AF_INET or AF_INET6.
    *backlog* is the queue size passed to socket.listen().
    *reuse_port* dictates whether to use the SO_REUSEPORT socket option.
    *dualstack_ipv6*: if true and the platform supports it, it will
    create an AF_INET6 socket able to accept both IPv4 or IPv6
    connections. When false it will explicitly disable this option on
    platforms that enable it by default (e.g. Linux).

    >>> with create_server(('', 8000)) as server:
    ...     while True:
    ...         conn, addr = server.accept()
    ...         # handle new connection
    """
    if reuse_port and not hasattr(_socket, "SO_REUSEPORT"):
        raise ValueError("SO_REUSEPORT not supported on this platform")
    if dualstack_ipv6:
        if not has_dualstack_ipv6():
            raise ValueError("dualstack_ipv6 not supported on this platform")
        if family != AF_INET6:
            raise ValueError("dualstack_ipv6 requires AF_INET6 family")
    sock = socket(family, SOCK_STREAM)
    try:
        # Note about Windows. We don't set SO_REUSEADDR because:
        # 1) It's unnecessary: bind() will succeed even in case of a
        # previous closed socket on the same address and still in
        # TIME_WAIT state.
        # 2) If set, another socket is free to bind() on the same
        # address, effectively preventing this one from accepting
        # connections. Also, it may set the process in a state where
        # it'll no longer respond to any signals or graceful kills.
        # See: msdn2.microsoft.com/en-us/library/ms740621(VS.85).aspx
        if os.name not in ('nt', 'cygwin') and \
                hasattr(_socket, 'SO_REUSEADDR'):
            try:
                sock.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1)
            except error:
                # Fail later on bind(), for platforms which may not
                # support this option.
                pass
        if reuse_port:
            sock.setsockopt(SOL_SOCKET, SO_REUSEPORT, 1)
        if has_ipv6 and family == AF_INET6:
            if dualstack_ipv6:
                sock.setsockopt(IPPROTO_IPV6, IPV6_V6ONLY, 0)
            elif hasattr(_socket, "IPV6_V6ONLY") and \
                    hasattr(_socket, "IPPROTO_IPV6"):
                sock.setsockopt(IPPROTO_IPV6, IPV6_V6ONLY, 1)
        try:
            sock.bind(address)
        except error as err:
            msg = '%s (while attempting to bind on address %r)' % \
                (err.strerror, address)
            raise error(err.errno, msg) from None
        if backlog is None:
            sock.listen()
        else:
            sock.listen(backlog)
        return sock
    except error:
        sock.close()
        raise


def getaddrinfo(host, port, family=0, type=0, proto=0, flags=0):
    """Resolve host and port into list of address info entries.

    Translate the host/port argument into a sequence of 5-tuples that contain
    all the necessary arguments for creating a socket connected to that service.
    host is a domain name, a string representation of an IPv4/v6 address or
    None. port is a string service name such as 'http', a numeric port number or
    None. By passing None as the value of host and port, you can pass NULL to
    the underlying C API.

    The family, type and proto arguments can be optionally specified in order to
    narrow the list of addresses returned. Passing zero as a value for each of
    these arguments selects the full range of results.
    """
    # We override this function since we want to translate the numeric family
    # and socket type values to enum constants.
    addrlist = []
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
        af, socktype, proto, canonname, sa = res
        addrlist.append((_intenum_converter(af, AddressFamily),
                         _intenum_converter(socktype, SocketKind),
                         proto, canonname, sa))
    return addrlist
aifc.py000064400000100056151153537440006032 0ustar00"""Stuff to parse AIFF-C and AIFF files.

Unless explicitly stated otherwise, the description below is true
both for AIFF-C files and AIFF files.

An AIFF-C file has the following structure.

  +-----------------+
  | FORM            |
  +-----------------+
  | <size>          |
  +----+------------+
  |    | AIFC       |
  |    +------------+
  |    | <chunks>   |
  |    |    .       |
  |    |    .       |
  |    |    .       |
  +----+------------+

An AIFF file has the string "AIFF" instead of "AIFC".

A chunk consists of an identifier (4 bytes) followed by a size (4 bytes,
big endian order), followed by the data.  The size field does not include
the size of the 8 byte header.

The following chunk types are recognized.

  FVER
      <version number of AIFF-C defining document> (AIFF-C only).
  MARK
      <# of markers> (2 bytes)
      list of markers:
          <marker ID> (2 bytes, must be > 0)
          <position> (4 bytes)
          <marker name> ("pstring")
  COMM
      <# of channels> (2 bytes)
      <# of sound frames> (4 bytes)
      <size of the samples> (2 bytes)
      <sampling frequency> (10 bytes, IEEE 80-bit extended
          floating point)
      in AIFF-C files only:
      <compression type> (4 bytes)
      <human-readable version of compression type> ("pstring")
  SSND
      <offset> (4 bytes, not used by this program)
      <blocksize> (4 bytes, not used by this program)
      <sound data>

A pstring consists of 1 byte length, a string of characters, and 0 or 1
byte pad to make the total length even.

Usage.

Reading AIFF files:
  f = aifc.open(file, 'r')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods read(), seek(), and close().
In some types of audio files, if the setpos() method is not used,
the seek() method is not necessary.

This returns an instance of a class with the following public methods:
  getnchannels()  -- returns number of audio channels (1 for
             mono, 2 for stereo)
  getsampwidth()  -- returns sample width in bytes
  getframerate()  -- returns sampling frequency
  getnframes()    -- returns number of audio frames
  getcomptype()   -- returns compression type ('NONE' for AIFF files)
  getcompname()   -- returns human-readable version of
             compression type ('not compressed' for AIFF files)
  getparams() -- returns a namedtuple consisting of all of the
             above in the above order
  getmarkers()    -- get the list of marks in the audio file or None
             if there are no marks
  getmark(id) -- get mark with the specified id (raises an error
             if the mark does not exist)
  readframes(n)   -- returns at most n frames of audio
  rewind()    -- rewind to the beginning of the audio stream
  setpos(pos) -- seek to the specified position
  tell()      -- return the current position
  close()     -- close the instance (make it unusable)
The position returned by tell(), the position given to setpos() and
the position of marks are all compatible and have nothing to do with
the actual position in the file.
The close() method is called automatically when the class instance
is destroyed.

Writing AIFF files:
  f = aifc.open(file, 'w')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods write(), tell(), seek(), and
close().

This returns an instance of a class with the following public methods:
  aiff()      -- create an AIFF file (AIFF-C default)
  aifc()      -- create an AIFF-C file
  setnchannels(n) -- set the number of channels
  setsampwidth(n) -- set the sample width
  setframerate(n) -- set the frame rate
  setnframes(n)   -- set the number of frames
  setcomptype(type, name)
          -- set the compression type and the
             human-readable compression type
  setparams(tuple)
          -- set all parameters at once
  setmark(id, pos, name)
          -- add specified mark to the list of marks
  tell()      -- return current position in output file (useful
             in combination with setmark())
  writeframesraw(data)
          -- write audio frames without pathing up the
             file header
  writeframes(data)
          -- write audio frames and patch up the file header
  close()     -- patch up the file header and close the
             output file
You should set the parameters before the first writeframesraw or
writeframes.  The total number of frames does not need to be set,
but when it is set to the correct value, the header does not have to
be patched up.
It is best to first set all parameters, perhaps possibly the
compression type, and then write audio frames using writeframesraw.
When all frames have been written, either call writeframes(b'') or
close() to patch up the sizes in the header.
Marks can be added anytime.  If there are any marks, you must call
close() after all frames have been written.
The close() method is called automatically when the class instance
is destroyed.

When a file is opened with the extension '.aiff', an AIFF file is
written, otherwise an AIFF-C file is written.  This default can be
changed by calling aiff() or aifc() before the first writeframes or
writeframesraw.
"""

import struct
import builtins
import warnings

__all__ = ["Error", "open", "openfp"]

class Error(Exception):
    pass

_AIFC_version = 0xA2805140     # Version 1 of AIFF-C

def _read_long(file):
    try:
        return struct.unpack('>l', file.read(4))[0]
    except struct.error:
        raise EOFError from None

def _read_ulong(file):
    try:
        return struct.unpack('>L', file.read(4))[0]
    except struct.error:
        raise EOFError from None

def _read_short(file):
    try:
        return struct.unpack('>h', file.read(2))[0]
    except struct.error:
        raise EOFError from None

def _read_ushort(file):
    try:
        return struct.unpack('>H', file.read(2))[0]
    except struct.error:
        raise EOFError from None

def _read_string(file):
    length = ord(file.read(1))
    if length == 0:
        data = b''
    else:
        data = file.read(length)
    if length & 1 == 0:
        dummy = file.read(1)
    return data

_HUGE_VAL = 1.79769313486231e+308 # See <limits.h>

def _read_float(f): # 10 bytes
    expon = _read_short(f) # 2 bytes
    sign = 1
    if expon < 0:
        sign = -1
        expon = expon + 0x8000
    himant = _read_ulong(f) # 4 bytes
    lomant = _read_ulong(f) # 4 bytes
    if expon == himant == lomant == 0:
        f = 0.0
    elif expon == 0x7FFF:
        f = _HUGE_VAL
    else:
        expon = expon - 16383
        f = (himant * 0x100000000 + lomant) * pow(2.0, expon - 63)
    return sign * f

def _write_short(f, x):
    f.write(struct.pack('>h', x))

def _write_ushort(f, x):
    f.write(struct.pack('>H', x))

def _write_long(f, x):
    f.write(struct.pack('>l', x))

def _write_ulong(f, x):
    f.write(struct.pack('>L', x))

def _write_string(f, s):
    if len(s) > 255:
        raise ValueError("string exceeds maximum pstring length")
    f.write(struct.pack('B', len(s)))
    f.write(s)
    if len(s) & 1 == 0:
        f.write(b'\x00')

def _write_float(f, x):
    import math
    if x < 0:
        sign = 0x8000
        x = x * -1
    else:
        sign = 0
    if x == 0:
        expon = 0
        himant = 0
        lomant = 0
    else:
        fmant, expon = math.frexp(x)
        if expon > 16384 or fmant >= 1 or fmant != fmant: # Infinity or NaN
            expon = sign|0x7FFF
            himant = 0
            lomant = 0
        else:                   # Finite
            expon = expon + 16382
            if expon < 0:           # denormalized
                fmant = math.ldexp(fmant, expon)
                expon = 0
            expon = expon | sign
            fmant = math.ldexp(fmant, 32)
            fsmant = math.floor(fmant)
            himant = int(fsmant)
            fmant = math.ldexp(fmant - fsmant, 32)
            fsmant = math.floor(fmant)
            lomant = int(fsmant)
    _write_ushort(f, expon)
    _write_ulong(f, himant)
    _write_ulong(f, lomant)

from chunk import Chunk
from collections import namedtuple

_aifc_params = namedtuple('_aifc_params',
                          'nchannels sampwidth framerate nframes comptype compname')

_aifc_params.nchannels.__doc__ = 'Number of audio channels (1 for mono, 2 for stereo)'
_aifc_params.sampwidth.__doc__ = 'Sample width in bytes'
_aifc_params.framerate.__doc__ = 'Sampling frequency'
_aifc_params.nframes.__doc__ = 'Number of audio frames'
_aifc_params.comptype.__doc__ = 'Compression type ("NONE" for AIFF files)'
_aifc_params.compname.__doc__ = ("""\
A human-readable version of the compression type
('not compressed' for AIFF files)""")


class Aifc_read:
    # Variables used in this class:
    #
    # These variables are available to the user though appropriate
    # methods of this class:
    # _file -- the open file with methods read(), close(), and seek()
    #       set through the __init__() method
    # _nchannels -- the number of audio channels
    #       available through the getnchannels() method
    # _nframes -- the number of audio frames
    #       available through the getnframes() method
    # _sampwidth -- the number of bytes per audio sample
    #       available through the getsampwidth() method
    # _framerate -- the sampling frequency
    #       available through the getframerate() method
    # _comptype -- the AIFF-C compression type ('NONE' if AIFF)
    #       available through the getcomptype() method
    # _compname -- the human-readable AIFF-C compression type
    #       available through the getcomptype() method
    # _markers -- the marks in the audio file
    #       available through the getmarkers() and getmark()
    #       methods
    # _soundpos -- the position in the audio stream
    #       available through the tell() method, set through the
    #       setpos() method
    #
    # These variables are used internally only:
    # _version -- the AIFF-C version number
    # _decomp -- the decompressor from builtin module cl
    # _comm_chunk_read -- 1 iff the COMM chunk has been read
    # _aifc -- 1 iff reading an AIFF-C file
    # _ssnd_seek_needed -- 1 iff positioned correctly in audio
    #       file for readframes()
    # _ssnd_chunk -- instantiation of a chunk class for the SSND chunk
    # _framesize -- size of one frame in the file

    _file = None  # Set here since __del__ checks it

    def initfp(self, file):
        self._version = 0
        self._convert = None
        self._markers = []
        self._soundpos = 0
        self._file = file
        chunk = Chunk(file)
        if chunk.getname() != b'FORM':
            raise Error('file does not start with FORM id')
        formdata = chunk.read(4)
        if formdata == b'AIFF':
            self._aifc = 0
        elif formdata == b'AIFC':
            self._aifc = 1
        else:
            raise Error('not an AIFF or AIFF-C file')
        self._comm_chunk_read = 0
        self._ssnd_chunk = None
        while 1:
            self._ssnd_seek_needed = 1
            try:
                chunk = Chunk(self._file)
            except EOFError:
                break
            chunkname = chunk.getname()
            if chunkname == b'COMM':
                self._read_comm_chunk(chunk)
                self._comm_chunk_read = 1
            elif chunkname == b'SSND':
                self._ssnd_chunk = chunk
                dummy = chunk.read(8)
                self._ssnd_seek_needed = 0
            elif chunkname == b'FVER':
                self._version = _read_ulong(chunk)
            elif chunkname == b'MARK':
                self._readmark(chunk)
            chunk.skip()
        if not self._comm_chunk_read or not self._ssnd_chunk:
            raise Error('COMM chunk and/or SSND chunk missing')

    def __init__(self, f):
        if isinstance(f, str):
            file_object = builtins.open(f, 'rb')
            try:
                self.initfp(file_object)
            except:
                file_object.close()
                raise
        else:
            # assume it is an open file object already
            self.initfp(f)

    def __enter__(self):
        return self

    def __exit__(self, *args):
        self.close()

    #
    # User visible methods.
    #
    def getfp(self):
        return self._file

    def rewind(self):
        self._ssnd_seek_needed = 1
        self._soundpos = 0

    def close(self):
        file = self._file
        if file is not None:
            self._file = None
            file.close()

    def tell(self):
        return self._soundpos

    def getnchannels(self):
        return self._nchannels

    def getnframes(self):
        return self._nframes

    def getsampwidth(self):
        return self._sampwidth

    def getframerate(self):
        return self._framerate

    def getcomptype(self):
        return self._comptype

    def getcompname(self):
        return self._compname

##  def getversion(self):
##      return self._version

    def getparams(self):
        return _aifc_params(self.getnchannels(), self.getsampwidth(),
                            self.getframerate(), self.getnframes(),
                            self.getcomptype(), self.getcompname())

    def getmarkers(self):
        if len(self._markers) == 0:
            return None
        return self._markers

    def getmark(self, id):
        for marker in self._markers:
            if id == marker[0]:
                return marker
        raise Error('marker {0!r} does not exist'.format(id))

    def setpos(self, pos):
        if pos < 0 or pos > self._nframes:
            raise Error('position not in range')
        self._soundpos = pos
        self._ssnd_seek_needed = 1

    def readframes(self, nframes):
        if self._ssnd_seek_needed:
            self._ssnd_chunk.seek(0)
            dummy = self._ssnd_chunk.read(8)
            pos = self._soundpos * self._framesize
            if pos:
                self._ssnd_chunk.seek(pos + 8)
            self._ssnd_seek_needed = 0
        if nframes == 0:
            return b''
        data = self._ssnd_chunk.read(nframes * self._framesize)
        if self._convert and data:
            data = self._convert(data)
        self._soundpos = self._soundpos + len(data) // (self._nchannels
                                                        * self._sampwidth)
        return data

    #
    # Internal methods.
    #

    def _alaw2lin(self, data):
        import audioop
        return audioop.alaw2lin(data, 2)

    def _ulaw2lin(self, data):
        import audioop
        return audioop.ulaw2lin(data, 2)

    def _adpcm2lin(self, data):
        import audioop
        if not hasattr(self, '_adpcmstate'):
            # first time
            self._adpcmstate = None
        data, self._adpcmstate = audioop.adpcm2lin(data, 2, self._adpcmstate)
        return data

    def _read_comm_chunk(self, chunk):
        self._nchannels = _read_short(chunk)
        self._nframes = _read_long(chunk)
        self._sampwidth = (_read_short(chunk) + 7) // 8
        self._framerate = int(_read_float(chunk))
        if self._sampwidth <= 0:
            raise Error('bad sample width')
        if self._nchannels <= 0:
            raise Error('bad # of channels')
        self._framesize = self._nchannels * self._sampwidth
        if self._aifc:
            #DEBUG: SGI's soundeditor produces a bad size :-(
            kludge = 0
            if chunk.chunksize == 18:
                kludge = 1
                warnings.warn('Warning: bad COMM chunk size')
                chunk.chunksize = 23
            #DEBUG end
            self._comptype = chunk.read(4)
            #DEBUG start
            if kludge:
                length = ord(chunk.file.read(1))
                if length & 1 == 0:
                    length = length + 1
                chunk.chunksize = chunk.chunksize + length
                chunk.file.seek(-1, 1)
            #DEBUG end
            self._compname = _read_string(chunk)
            if self._comptype != b'NONE':
                if self._comptype == b'G722':
                    self._convert = self._adpcm2lin
                elif self._comptype in (b'ulaw', b'ULAW'):
                    self._convert = self._ulaw2lin
                elif self._comptype in (b'alaw', b'ALAW'):
                    self._convert = self._alaw2lin
                else:
                    raise Error('unsupported compression type')
                self._sampwidth = 2
        else:
            self._comptype = b'NONE'
            self._compname = b'not compressed'

    def _readmark(self, chunk):
        nmarkers = _read_short(chunk)
        # Some files appear to contain invalid counts.
        # Cope with this by testing for EOF.
        try:
            for i in range(nmarkers):
                id = _read_short(chunk)
                pos = _read_long(chunk)
                name = _read_string(chunk)
                if pos or name:
                    # some files appear to have
                    # dummy markers consisting of
                    # a position 0 and name ''
                    self._markers.append((id, pos, name))
        except EOFError:
            w = ('Warning: MARK chunk contains only %s marker%s instead of %s' %
                 (len(self._markers), '' if len(self._markers) == 1 else 's',
                  nmarkers))
            warnings.warn(w)

class Aifc_write:
    # Variables used in this class:
    #
    # These variables are user settable through appropriate methods
    # of this class:
    # _file -- the open file with methods write(), close(), tell(), seek()
    #       set through the __init__() method
    # _comptype -- the AIFF-C compression type ('NONE' in AIFF)
    #       set through the setcomptype() or setparams() method
    # _compname -- the human-readable AIFF-C compression type
    #       set through the setcomptype() or setparams() method
    # _nchannels -- the number of audio channels
    #       set through the setnchannels() or setparams() method
    # _sampwidth -- the number of bytes per audio sample
    #       set through the setsampwidth() or setparams() method
    # _framerate -- the sampling frequency
    #       set through the setframerate() or setparams() method
    # _nframes -- the number of audio frames written to the header
    #       set through the setnframes() or setparams() method
    # _aifc -- whether we're writing an AIFF-C file or an AIFF file
    #       set through the aifc() method, reset through the
    #       aiff() method
    #
    # These variables are used internally only:
    # _version -- the AIFF-C version number
    # _comp -- the compressor from builtin module cl
    # _nframeswritten -- the number of audio frames actually written
    # _datalength -- the size of the audio samples written to the header
    # _datawritten -- the size of the audio samples actually written

    _file = None  # Set here since __del__ checks it

    def __init__(self, f):
        if isinstance(f, str):
            file_object = builtins.open(f, 'wb')
            try:
                self.initfp(file_object)
            except:
                file_object.close()
                raise

            # treat .aiff file extensions as non-compressed audio
            if f.endswith('.aiff'):
                self._aifc = 0
        else:
            # assume it is an open file object already
            self.initfp(f)

    def initfp(self, file):
        self._file = file
        self._version = _AIFC_version
        self._comptype = b'NONE'
        self._compname = b'not compressed'
        self._convert = None
        self._nchannels = 0
        self._sampwidth = 0
        self._framerate = 0
        self._nframes = 0
        self._nframeswritten = 0
        self._datawritten = 0
        self._datalength = 0
        self._markers = []
        self._marklength = 0
        self._aifc = 1      # AIFF-C is default

    def __del__(self):
        self.close()

    def __enter__(self):
        return self

    def __exit__(self, *args):
        self.close()

    #
    # User visible methods.
    #
    def aiff(self):
        if self._nframeswritten:
            raise Error('cannot change parameters after starting to write')
        self._aifc = 0

    def aifc(self):
        if self._nframeswritten:
            raise Error('cannot change parameters after starting to write')
        self._aifc = 1

    def setnchannels(self, nchannels):
        if self._nframeswritten:
            raise Error('cannot change parameters after starting to write')
        if nchannels < 1:
            raise Error('bad # of channels')
        self._nchannels = nchannels

    def getnchannels(self):
        if not self._nchannels:
            raise Error('number of channels not set')
        return self._nchannels

    def setsampwidth(self, sampwidth):
        if self._nframeswritten:
            raise Error('cannot change parameters after starting to write')
        if sampwidth < 1 or sampwidth > 4:
            raise Error('bad sample width')
        self._sampwidth = sampwidth

    def getsampwidth(self):
        if not self._sampwidth:
            raise Error('sample width not set')
        return self._sampwidth

    def setframerate(self, framerate):
        if self._nframeswritten:
            raise Error('cannot change parameters after starting to write')
        if framerate <= 0:
            raise Error('bad frame rate')
        self._framerate = framerate

    def getframerate(self):
        if not self._framerate:
            raise Error('frame rate not set')
        return self._framerate

    def setnframes(self, nframes):
        if self._nframeswritten:
            raise Error('cannot change parameters after starting to write')
        self._nframes = nframes

    def getnframes(self):
        return self._nframeswritten

    def setcomptype(self, comptype, compname):
        if self._nframeswritten:
            raise Error('cannot change parameters after starting to write')
        if comptype not in (b'NONE', b'ulaw', b'ULAW',
                            b'alaw', b'ALAW', b'G722'):
            raise Error('unsupported compression type')
        self._comptype = comptype
        self._compname = compname

    def getcomptype(self):
        return self._comptype

    def getcompname(self):
        return self._compname

##  def setversion(self, version):
##      if self._nframeswritten:
##          raise Error, 'cannot change parameters after starting to write'
##      self._version = version

    def setparams(self, params):
        nchannels, sampwidth, framerate, nframes, comptype, compname = params
        if self._nframeswritten:
            raise Error('cannot change parameters after starting to write')
        if comptype not in (b'NONE', b'ulaw', b'ULAW',
                            b'alaw', b'ALAW', b'G722'):
            raise Error('unsupported compression type')
        self.setnchannels(nchannels)
        self.setsampwidth(sampwidth)
        self.setframerate(framerate)
        self.setnframes(nframes)
        self.setcomptype(comptype, compname)

    def getparams(self):
        if not self._nchannels or not self._sampwidth or not self._framerate:
            raise Error('not all parameters set')
        return _aifc_params(self._nchannels, self._sampwidth, self._framerate,
                            self._nframes, self._comptype, self._compname)

    def setmark(self, id, pos, name):
        if id <= 0:
            raise Error('marker ID must be > 0')
        if pos < 0:
            raise Error('marker position must be >= 0')
        if not isinstance(name, bytes):
            raise Error('marker name must be bytes')
        for i in range(len(self._markers)):
            if id == self._markers[i][0]:
                self._markers[i] = id, pos, name
                return
        self._markers.append((id, pos, name))

    def getmark(self, id):
        for marker in self._markers:
            if id == marker[0]:
                return marker
        raise Error('marker {0!r} does not exist'.format(id))

    def getmarkers(self):
        if len(self._markers) == 0:
            return None
        return self._markers

    def tell(self):
        return self._nframeswritten

    def writeframesraw(self, data):
        if not isinstance(data, (bytes, bytearray)):
            data = memoryview(data).cast('B')
        self._ensure_header_written(len(data))
        nframes = len(data) // (self._sampwidth * self._nchannels)
        if self._convert:
            data = self._convert(data)
        self._file.write(data)
        self._nframeswritten = self._nframeswritten + nframes
        self._datawritten = self._datawritten + len(data)

    def writeframes(self, data):
        self.writeframesraw(data)
        if self._nframeswritten != self._nframes or \
              self._datalength != self._datawritten:
            self._patchheader()

    def close(self):
        if self._file is None:
            return
        try:
            self._ensure_header_written(0)
            if self._datawritten & 1:
                # quick pad to even size
                self._file.write(b'\x00')
                self._datawritten = self._datawritten + 1
            self._writemarkers()
            if self._nframeswritten != self._nframes or \
                  self._datalength != self._datawritten or \
                  self._marklength:
                self._patchheader()
        finally:
            # Prevent ref cycles
            self._convert = None
            f = self._file
            self._file = None
            f.close()

    #
    # Internal methods.
    #

    def _lin2alaw(self, data):
        import audioop
        return audioop.lin2alaw(data, 2)

    def _lin2ulaw(self, data):
        import audioop
        return audioop.lin2ulaw(data, 2)

    def _lin2adpcm(self, data):
        import audioop
        if not hasattr(self, '_adpcmstate'):
            self._adpcmstate = None
        data, self._adpcmstate = audioop.lin2adpcm(data, 2, self._adpcmstate)
        return data

    def _ensure_header_written(self, datasize):
        if not self._nframeswritten:
            if self._comptype in (b'ULAW', b'ulaw', b'ALAW', b'alaw', b'G722'):
                if not self._sampwidth:
                    self._sampwidth = 2
                if self._sampwidth != 2:
                    raise Error('sample width must be 2 when compressing '
                                'with ulaw/ULAW, alaw/ALAW or G7.22 (ADPCM)')
            if not self._nchannels:
                raise Error('# channels not specified')
            if not self._sampwidth:
                raise Error('sample width not specified')
            if not self._framerate:
                raise Error('sampling rate not specified')
            self._write_header(datasize)

    def _init_compression(self):
        if self._comptype == b'G722':
            self._convert = self._lin2adpcm
        elif self._comptype in (b'ulaw', b'ULAW'):
            self._convert = self._lin2ulaw
        elif self._comptype in (b'alaw', b'ALAW'):
            self._convert = self._lin2alaw

    def _write_header(self, initlength):
        if self._aifc and self._comptype != b'NONE':
            self._init_compression()
        self._file.write(b'FORM')
        if not self._nframes:
            self._nframes = initlength // (self._nchannels * self._sampwidth)
        self._datalength = self._nframes * self._nchannels * self._sampwidth
        if self._datalength & 1:
            self._datalength = self._datalength + 1
        if self._aifc:
            if self._comptype in (b'ulaw', b'ULAW', b'alaw', b'ALAW'):
                self._datalength = self._datalength // 2
                if self._datalength & 1:
                    self._datalength = self._datalength + 1
            elif self._comptype == b'G722':
                self._datalength = (self._datalength + 3) // 4
                if self._datalength & 1:
                    self._datalength = self._datalength + 1
        try:
            self._form_length_pos = self._file.tell()
        except (AttributeError, OSError):
            self._form_length_pos = None
        commlength = self._write_form_length(self._datalength)
        if self._aifc:
            self._file.write(b'AIFC')
            self._file.write(b'FVER')
            _write_ulong(self._file, 4)
            _write_ulong(self._file, self._version)
        else:
            self._file.write(b'AIFF')
        self._file.write(b'COMM')
        _write_ulong(self._file, commlength)
        _write_short(self._file, self._nchannels)
        if self._form_length_pos is not None:
            self._nframes_pos = self._file.tell()
        _write_ulong(self._file, self._nframes)
        if self._comptype in (b'ULAW', b'ulaw', b'ALAW', b'alaw', b'G722'):
            _write_short(self._file, 8)
        else:
            _write_short(self._file, self._sampwidth * 8)
        _write_float(self._file, self._framerate)
        if self._aifc:
            self._file.write(self._comptype)
            _write_string(self._file, self._compname)
        self._file.write(b'SSND')
        if self._form_length_pos is not None:
            self._ssnd_length_pos = self._file.tell()
        _write_ulong(self._file, self._datalength + 8)
        _write_ulong(self._file, 0)
        _write_ulong(self._file, 0)

    def _write_form_length(self, datalength):
        if self._aifc:
            commlength = 18 + 5 + len(self._compname)
            if commlength & 1:
                commlength = commlength + 1
            verslength = 12
        else:
            commlength = 18
            verslength = 0
        _write_ulong(self._file, 4 + verslength + self._marklength + \
                     8 + commlength + 16 + datalength)
        return commlength

    def _patchheader(self):
        curpos = self._file.tell()
        if self._datawritten & 1:
            datalength = self._datawritten + 1
            self._file.write(b'\x00')
        else:
            datalength = self._datawritten
        if datalength == self._datalength and \
              self._nframes == self._nframeswritten and \
              self._marklength == 0:
            self._file.seek(curpos, 0)
            return
        self._file.seek(self._form_length_pos, 0)
        dummy = self._write_form_length(datalength)
        self._file.seek(self._nframes_pos, 0)
        _write_ulong(self._file, self._nframeswritten)
        self._file.seek(self._ssnd_length_pos, 0)
        _write_ulong(self._file, datalength + 8)
        self._file.seek(curpos, 0)
        self._nframes = self._nframeswritten
        self._datalength = datalength

    def _writemarkers(self):
        if len(self._markers) == 0:
            return
        self._file.write(b'MARK')
        length = 2
        for marker in self._markers:
            id, pos, name = marker
            length = length + len(name) + 1 + 6
            if len(name) & 1 == 0:
                length = length + 1
        _write_ulong(self._file, length)
        self._marklength = length + 8
        _write_short(self._file, len(self._markers))
        for marker in self._markers:
            id, pos, name = marker
            _write_short(self._file, id)
            _write_ulong(self._file, pos)
            _write_string(self._file, name)

def open(f, mode=None):
    if mode is None:
        if hasattr(f, 'mode'):
            mode = f.mode
        else:
            mode = 'rb'
    if mode in ('r', 'rb'):
        return Aifc_read(f)
    elif mode in ('w', 'wb'):
        return Aifc_write(f)
    else:
        raise Error("mode must be 'r', 'rb', 'w', or 'wb'")

def openfp(f, mode=None):
    warnings.warn("aifc.openfp is deprecated since Python 3.7. "
                  "Use aifc.open instead.", DeprecationWarning, stacklevel=2)
    return open(f, mode=mode)

if __name__ == '__main__':
    import sys
    if not sys.argv[1:]:
        sys.argv.append('/usr/demos/data/audio/bach.aiff')
    fn = sys.argv[1]
    with open(fn, 'r') as f:
        print("Reading", fn)
        print("nchannels =", f.getnchannels())
        print("nframes   =", f.getnframes())
        print("sampwidth =", f.getsampwidth())
        print("framerate =", f.getframerate())
        print("comptype  =", f.getcomptype())
        print("compname  =", f.getcompname())
        if sys.argv[2:]:
            gn = sys.argv[2]
            print("Writing", gn)
            with open(gn, 'w') as g:
                g.setparams(f.getparams())
                while 1:
                    data = f.readframes(1024)
                    if not data:
                        break
                    g.writeframes(data)
            print("Done.")
gettext.py000064400000065002151153537440006615 0ustar00"""Internationalization and localization support.

This module provides internationalization (I18N) and localization (L10N)
support for your Python programs by providing an interface to the GNU gettext
message catalog library.

I18N refers to the operation by which a program is made aware of multiple
languages.  L10N refers to the adaptation of your program, once
internationalized, to the local language and cultural habits.

"""

# This module represents the integration of work, contributions, feedback, and
# suggestions from the following people:
#
# Martin von Loewis, who wrote the initial implementation of the underlying
# C-based libintlmodule (later renamed _gettext), along with a skeletal
# gettext.py implementation.
#
# Peter Funk, who wrote fintl.py, a fairly complete wrapper around intlmodule,
# which also included a pure-Python implementation to read .mo files if
# intlmodule wasn't available.
#
# James Henstridge, who also wrote a gettext.py module, which has some
# interesting, but currently unsupported experimental features: the notion of
# a Catalog class and instances, and the ability to add to a catalog file via
# a Python API.
#
# Barry Warsaw integrated these modules, wrote the .install() API and code,
# and conformed all C and Python code to Python's coding standards.
#
# Francois Pinard and Marc-Andre Lemburg also contributed valuably to this
# module.
#
# J. David Ibanez implemented plural forms. Bruno Haible fixed some bugs.
#
# TODO:
# - Lazy loading of .mo files.  Currently the entire catalog is loaded into
#   memory, but that's probably bad for large translated programs.  Instead,
#   the lexical sort of original strings in GNU .mo files should be exploited
#   to do binary searches and lazy initializations.  Or you might want to use
#   the undocumented double-hash algorithm for .mo files with hash tables, but
#   you'll need to study the GNU gettext code to do this.
#
# - Support Solaris .mo file formats.  Unfortunately, we've been unable to
#   find this format documented anywhere.


import locale
import os
import re
import sys


__all__ = ['NullTranslations', 'GNUTranslations', 'Catalog',
           'find', 'translation', 'install', 'textdomain', 'bindtextdomain',
           'bind_textdomain_codeset',
           'dgettext', 'dngettext', 'gettext', 'lgettext', 'ldgettext',
           'ldngettext', 'lngettext', 'ngettext',
           'pgettext', 'dpgettext', 'npgettext', 'dnpgettext',
           ]

_default_localedir = os.path.join(sys.base_prefix, 'share', 'locale')

# Expression parsing for plural form selection.
#
# The gettext library supports a small subset of C syntax.  The only
# incompatible difference is that integer literals starting with zero are
# decimal.
#
# https://www.gnu.org/software/gettext/manual/gettext.html#Plural-forms
# http://git.savannah.gnu.org/cgit/gettext.git/tree/gettext-runtime/intl/plural.y

_token_pattern = re.compile(r"""
        (?P<WHITESPACES>[ \t]+)                    | # spaces and horizontal tabs
        (?P<NUMBER>[0-9]+\b)                       | # decimal integer
        (?P<NAME>n\b)                              | # only n is allowed
        (?P<PARENTHESIS>[()])                      |
        (?P<OPERATOR>[-*/%+?:]|[><!]=?|==|&&|\|\|) | # !, *, /, %, +, -, <, >,
                                                     # <=, >=, ==, !=, &&, ||,
                                                     # ? :
                                                     # unary and bitwise ops
                                                     # not allowed
        (?P<INVALID>\w+|.)                           # invalid token
    """, re.VERBOSE|re.DOTALL)

def _tokenize(plural):
    for mo in re.finditer(_token_pattern, plural):
        kind = mo.lastgroup
        if kind == 'WHITESPACES':
            continue
        value = mo.group(kind)
        if kind == 'INVALID':
            raise ValueError('invalid token in plural form: %s' % value)
        yield value
    yield ''

def _error(value):
    if value:
        return ValueError('unexpected token in plural form: %s' % value)
    else:
        return ValueError('unexpected end of plural form')

_binary_ops = (
    ('||',),
    ('&&',),
    ('==', '!='),
    ('<', '>', '<=', '>='),
    ('+', '-'),
    ('*', '/', '%'),
)
_binary_ops = {op: i for i, ops in enumerate(_binary_ops, 1) for op in ops}
_c2py_ops = {'||': 'or', '&&': 'and', '/': '//'}

def _parse(tokens, priority=-1):
    result = ''
    nexttok = next(tokens)
    while nexttok == '!':
        result += 'not '
        nexttok = next(tokens)

    if nexttok == '(':
        sub, nexttok = _parse(tokens)
        result = '%s(%s)' % (result, sub)
        if nexttok != ')':
            raise ValueError('unbalanced parenthesis in plural form')
    elif nexttok == 'n':
        result = '%s%s' % (result, nexttok)
    else:
        try:
            value = int(nexttok, 10)
        except ValueError:
            raise _error(nexttok) from None
        result = '%s%d' % (result, value)
    nexttok = next(tokens)

    j = 100
    while nexttok in _binary_ops:
        i = _binary_ops[nexttok]
        if i < priority:
            break
        # Break chained comparisons
        if i in (3, 4) and j in (3, 4):  # '==', '!=', '<', '>', '<=', '>='
            result = '(%s)' % result
        # Replace some C operators by their Python equivalents
        op = _c2py_ops.get(nexttok, nexttok)
        right, nexttok = _parse(tokens, i + 1)
        result = '%s %s %s' % (result, op, right)
        j = i
    if j == priority == 4:  # '<', '>', '<=', '>='
        result = '(%s)' % result

    if nexttok == '?' and priority <= 0:
        if_true, nexttok = _parse(tokens, 0)
        if nexttok != ':':
            raise _error(nexttok)
        if_false, nexttok = _parse(tokens)
        result = '%s if %s else %s' % (if_true, result, if_false)
        if priority == 0:
            result = '(%s)' % result

    return result, nexttok

def _as_int(n):
    try:
        i = round(n)
    except TypeError:
        raise TypeError('Plural value must be an integer, got %s' %
                        (n.__class__.__name__,)) from None
    import warnings
    warnings.warn('Plural value must be an integer, got %s' %
                  (n.__class__.__name__,),
                  DeprecationWarning, 4)
    return n

def c2py(plural):
    """Gets a C expression as used in PO files for plural forms and returns a
    Python function that implements an equivalent expression.
    """

    if len(plural) > 1000:
        raise ValueError('plural form expression is too long')
    try:
        result, nexttok = _parse(_tokenize(plural))
        if nexttok:
            raise _error(nexttok)

        depth = 0
        for c in result:
            if c == '(':
                depth += 1
                if depth > 20:
                    # Python compiler limit is about 90.
                    # The most complex example has 2.
                    raise ValueError('plural form expression is too complex')
            elif c == ')':
                depth -= 1

        ns = {'_as_int': _as_int}
        exec('''if True:
            def func(n):
                if not isinstance(n, int):
                    n = _as_int(n)
                return int(%s)
            ''' % result, ns)
        return ns['func']
    except RecursionError:
        # Recursion error can be raised in _parse() or exec().
        raise ValueError('plural form expression is too complex')


def _expand_lang(loc):
    loc = locale.normalize(loc)
    COMPONENT_CODESET   = 1 << 0
    COMPONENT_TERRITORY = 1 << 1
    COMPONENT_MODIFIER  = 1 << 2
    # split up the locale into its base components
    mask = 0
    pos = loc.find('@')
    if pos >= 0:
        modifier = loc[pos:]
        loc = loc[:pos]
        mask |= COMPONENT_MODIFIER
    else:
        modifier = ''
    pos = loc.find('.')
    if pos >= 0:
        codeset = loc[pos:]
        loc = loc[:pos]
        mask |= COMPONENT_CODESET
    else:
        codeset = ''
    pos = loc.find('_')
    if pos >= 0:
        territory = loc[pos:]
        loc = loc[:pos]
        mask |= COMPONENT_TERRITORY
    else:
        territory = ''
    language = loc
    ret = []
    for i in range(mask+1):
        if not (i & ~mask):  # if all components for this combo exist ...
            val = language
            if i & COMPONENT_TERRITORY: val += territory
            if i & COMPONENT_CODESET:   val += codeset
            if i & COMPONENT_MODIFIER:  val += modifier
            ret.append(val)
    ret.reverse()
    return ret



class NullTranslations:
    def __init__(self, fp=None):
        self._info = {}
        self._charset = None
        self._output_charset = None
        self._fallback = None
        if fp is not None:
            self._parse(fp)

    def _parse(self, fp):
        pass

    def add_fallback(self, fallback):
        if self._fallback:
            self._fallback.add_fallback(fallback)
        else:
            self._fallback = fallback

    def gettext(self, message):
        if self._fallback:
            return self._fallback.gettext(message)
        return message

    def lgettext(self, message):
        import warnings
        warnings.warn('lgettext() is deprecated, use gettext() instead',
                      DeprecationWarning, 2)
        if self._fallback:
            with warnings.catch_warnings():
                warnings.filterwarnings('ignore', r'.*\blgettext\b.*',
                                        DeprecationWarning)
                return self._fallback.lgettext(message)
        if self._output_charset:
            return message.encode(self._output_charset)
        return message.encode(locale.getpreferredencoding())

    def ngettext(self, msgid1, msgid2, n):
        if self._fallback:
            return self._fallback.ngettext(msgid1, msgid2, n)
        if n == 1:
            return msgid1
        else:
            return msgid2

    def lngettext(self, msgid1, msgid2, n):
        import warnings
        warnings.warn('lngettext() is deprecated, use ngettext() instead',
                      DeprecationWarning, 2)
        if self._fallback:
            with warnings.catch_warnings():
                warnings.filterwarnings('ignore', r'.*\blngettext\b.*',
                                        DeprecationWarning)
                return self._fallback.lngettext(msgid1, msgid2, n)
        if n == 1:
            tmsg = msgid1
        else:
            tmsg = msgid2
        if self._output_charset:
            return tmsg.encode(self._output_charset)
        return tmsg.encode(locale.getpreferredencoding())

    def pgettext(self, context, message):
        if self._fallback:
            return self._fallback.pgettext(context, message)
        return message

    def npgettext(self, context, msgid1, msgid2, n):
        if self._fallback:
            return self._fallback.npgettext(context, msgid1, msgid2, n)
        if n == 1:
            return msgid1
        else:
            return msgid2

    def info(self):
        return self._info

    def charset(self):
        return self._charset

    def output_charset(self):
        import warnings
        warnings.warn('output_charset() is deprecated',
                      DeprecationWarning, 2)
        return self._output_charset

    def set_output_charset(self, charset):
        import warnings
        warnings.warn('set_output_charset() is deprecated',
                      DeprecationWarning, 2)
        self._output_charset = charset

    def install(self, names=None):
        import builtins
        builtins.__dict__['_'] = self.gettext
        if names is not None:
            allowed = {'gettext', 'lgettext', 'lngettext',
                       'ngettext', 'npgettext', 'pgettext'}
            for name in allowed & set(names):
                builtins.__dict__[name] = getattr(self, name)


class GNUTranslations(NullTranslations):
    # Magic number of .mo files
    LE_MAGIC = 0x950412de
    BE_MAGIC = 0xde120495

    # The encoding of a msgctxt and a msgid in a .mo file is
    # msgctxt + "\x04" + msgid (gettext version >= 0.15)
    CONTEXT = "%s\x04%s"

    # Acceptable .mo versions
    VERSIONS = (0, 1)

    def _get_versions(self, version):
        """Returns a tuple of major version, minor version"""
        return (version >> 16, version & 0xffff)

    def _parse(self, fp):
        """Override this method to support alternative .mo formats."""
        # Delay struct import for speeding up gettext import when .mo files
        # are not used.
        from struct import unpack
        filename = getattr(fp, 'name', '')
        # Parse the .mo file header, which consists of 5 little endian 32
        # bit words.
        self._catalog = catalog = {}
        self.plural = lambda n: int(n != 1) # germanic plural by default
        buf = fp.read()
        buflen = len(buf)
        # Are we big endian or little endian?
        magic = unpack('<I', buf[:4])[0]
        if magic == self.LE_MAGIC:
            version, msgcount, masteridx, transidx = unpack('<4I', buf[4:20])
            ii = '<II'
        elif magic == self.BE_MAGIC:
            version, msgcount, masteridx, transidx = unpack('>4I', buf[4:20])
            ii = '>II'
        else:
            raise OSError(0, 'Bad magic number', filename)

        major_version, minor_version = self._get_versions(version)

        if major_version not in self.VERSIONS:
            raise OSError(0, 'Bad version number ' + str(major_version), filename)

        # Now put all messages from the .mo file buffer into the catalog
        # dictionary.
        for i in range(0, msgcount):
            mlen, moff = unpack(ii, buf[masteridx:masteridx+8])
            mend = moff + mlen
            tlen, toff = unpack(ii, buf[transidx:transidx+8])
            tend = toff + tlen
            if mend < buflen and tend < buflen:
                msg = buf[moff:mend]
                tmsg = buf[toff:tend]
            else:
                raise OSError(0, 'File is corrupt', filename)
            # See if we're looking at GNU .mo conventions for metadata
            if mlen == 0:
                # Catalog description
                lastk = None
                for b_item in tmsg.split(b'\n'):
                    item = b_item.decode().strip()
                    if not item:
                        continue
                    # Skip over comment lines:
                    if item.startswith('#-#-#-#-#') and item.endswith('#-#-#-#-#'):
                        continue
                    k = v = None
                    if ':' in item:
                        k, v = item.split(':', 1)
                        k = k.strip().lower()
                        v = v.strip()
                        self._info[k] = v
                        lastk = k
                    elif lastk:
                        self._info[lastk] += '\n' + item
                    if k == 'content-type':
                        self._charset = v.split('charset=')[1]
                    elif k == 'plural-forms':
                        v = v.split(';')
                        plural = v[1].split('plural=')[1]
                        self.plural = c2py(plural)
            # Note: we unconditionally convert both msgids and msgstrs to
            # Unicode using the character encoding specified in the charset
            # parameter of the Content-Type header.  The gettext documentation
            # strongly encourages msgids to be us-ascii, but some applications
            # require alternative encodings (e.g. Zope's ZCML and ZPT).  For
            # traditional gettext applications, the msgid conversion will
            # cause no problems since us-ascii should always be a subset of
            # the charset encoding.  We may want to fall back to 8-bit msgids
            # if the Unicode conversion fails.
            charset = self._charset or 'ascii'
            if b'\x00' in msg:
                # Plural forms
                msgid1, msgid2 = msg.split(b'\x00')
                tmsg = tmsg.split(b'\x00')
                msgid1 = str(msgid1, charset)
                for i, x in enumerate(tmsg):
                    catalog[(msgid1, i)] = str(x, charset)
            else:
                catalog[str(msg, charset)] = str(tmsg, charset)
            # advance to next entry in the seek tables
            masteridx += 8
            transidx += 8

    def lgettext(self, message):
        import warnings
        warnings.warn('lgettext() is deprecated, use gettext() instead',
                      DeprecationWarning, 2)
        missing = object()
        tmsg = self._catalog.get(message, missing)
        if tmsg is missing:
            if self._fallback:
                return self._fallback.lgettext(message)
            tmsg = message
        if self._output_charset:
            return tmsg.encode(self._output_charset)
        return tmsg.encode(locale.getpreferredencoding())

    def lngettext(self, msgid1, msgid2, n):
        import warnings
        warnings.warn('lngettext() is deprecated, use ngettext() instead',
                      DeprecationWarning, 2)
        try:
            tmsg = self._catalog[(msgid1, self.plural(n))]
        except KeyError:
            if self._fallback:
                return self._fallback.lngettext(msgid1, msgid2, n)
            if n == 1:
                tmsg = msgid1
            else:
                tmsg = msgid2
        if self._output_charset:
            return tmsg.encode(self._output_charset)
        return tmsg.encode(locale.getpreferredencoding())

    def gettext(self, message):
        missing = object()
        tmsg = self._catalog.get(message, missing)
        if tmsg is missing:
            if self._fallback:
                return self._fallback.gettext(message)
            return message
        return tmsg

    def ngettext(self, msgid1, msgid2, n):
        try:
            tmsg = self._catalog[(msgid1, self.plural(n))]
        except KeyError:
            if self._fallback:
                return self._fallback.ngettext(msgid1, msgid2, n)
            if n == 1:
                tmsg = msgid1
            else:
                tmsg = msgid2
        return tmsg

    def pgettext(self, context, message):
        ctxt_msg_id = self.CONTEXT % (context, message)
        missing = object()
        tmsg = self._catalog.get(ctxt_msg_id, missing)
        if tmsg is missing:
            if self._fallback:
                return self._fallback.pgettext(context, message)
            return message
        return tmsg

    def npgettext(self, context, msgid1, msgid2, n):
        ctxt_msg_id = self.CONTEXT % (context, msgid1)
        try:
            tmsg = self._catalog[ctxt_msg_id, self.plural(n)]
        except KeyError:
            if self._fallback:
                return self._fallback.npgettext(context, msgid1, msgid2, n)
            if n == 1:
                tmsg = msgid1
            else:
                tmsg = msgid2
        return tmsg


# Locate a .mo file using the gettext strategy
def find(domain, localedir=None, languages=None, all=False):
    # Get some reasonable defaults for arguments that were not supplied
    if localedir is None:
        localedir = _default_localedir
    if languages is None:
        languages = []
        for envar in ('LANGUAGE', 'LC_ALL', 'LC_MESSAGES', 'LANG'):
            val = os.environ.get(envar)
            if val:
                languages = val.split(':')
                break
        if 'C' not in languages:
            languages.append('C')
    # now normalize and expand the languages
    nelangs = []
    for lang in languages:
        for nelang in _expand_lang(lang):
            if nelang not in nelangs:
                nelangs.append(nelang)
    # select a language
    if all:
        result = []
    else:
        result = None
    for lang in nelangs:
        if lang == 'C':
            break
        mofile = os.path.join(localedir, lang, 'LC_MESSAGES', '%s.mo' % domain)
        if os.path.exists(mofile):
            if all:
                result.append(mofile)
            else:
                return mofile
    return result



# a mapping between absolute .mo file path and Translation object
_translations = {}
_unspecified = ['unspecified']

def translation(domain, localedir=None, languages=None,
                class_=None, fallback=False, codeset=_unspecified):
    if class_ is None:
        class_ = GNUTranslations
    mofiles = find(domain, localedir, languages, all=True)
    if not mofiles:
        if fallback:
            return NullTranslations()
        from errno import ENOENT
        raise FileNotFoundError(ENOENT,
                                'No translation file found for domain', domain)
    # Avoid opening, reading, and parsing the .mo file after it's been done
    # once.
    result = None
    for mofile in mofiles:
        key = (class_, os.path.abspath(mofile))
        t = _translations.get(key)
        if t is None:
            with open(mofile, 'rb') as fp:
                t = _translations.setdefault(key, class_(fp))
        # Copy the translation object to allow setting fallbacks and
        # output charset. All other instance data is shared with the
        # cached object.
        # Delay copy import for speeding up gettext import when .mo files
        # are not used.
        import copy
        t = copy.copy(t)
        if codeset is not _unspecified:
            import warnings
            warnings.warn('parameter codeset is deprecated',
                          DeprecationWarning, 2)
            if codeset:
                with warnings.catch_warnings():
                    warnings.filterwarnings('ignore', r'.*\bset_output_charset\b.*',
                                            DeprecationWarning)
                    t.set_output_charset(codeset)
        if result is None:
            result = t
        else:
            result.add_fallback(t)
    return result


def install(domain, localedir=None, codeset=_unspecified, names=None):
    t = translation(domain, localedir, fallback=True, codeset=codeset)
    t.install(names)



# a mapping b/w domains and locale directories
_localedirs = {}
# a mapping b/w domains and codesets
_localecodesets = {}
# current global domain, `messages' used for compatibility w/ GNU gettext
_current_domain = 'messages'


def textdomain(domain=None):
    global _current_domain
    if domain is not None:
        _current_domain = domain
    return _current_domain


def bindtextdomain(domain, localedir=None):
    global _localedirs
    if localedir is not None:
        _localedirs[domain] = localedir
    return _localedirs.get(domain, _default_localedir)


def bind_textdomain_codeset(domain, codeset=None):
    import warnings
    warnings.warn('bind_textdomain_codeset() is deprecated',
                  DeprecationWarning, 2)
    global _localecodesets
    if codeset is not None:
        _localecodesets[domain] = codeset
    return _localecodesets.get(domain)


def dgettext(domain, message):
    try:
        t = translation(domain, _localedirs.get(domain, None))
    except OSError:
        return message
    return t.gettext(message)

def ldgettext(domain, message):
    import warnings
    warnings.warn('ldgettext() is deprecated, use dgettext() instead',
                  DeprecationWarning, 2)
    codeset = _localecodesets.get(domain)
    try:
        with warnings.catch_warnings():
            warnings.filterwarnings('ignore', r'.*\bparameter codeset\b.*',
                                    DeprecationWarning)
            t = translation(domain, _localedirs.get(domain, None), codeset=codeset)
    except OSError:
        return message.encode(codeset or locale.getpreferredencoding())
    with warnings.catch_warnings():
        warnings.filterwarnings('ignore', r'.*\blgettext\b.*',
                                DeprecationWarning)
        return t.lgettext(message)

def dngettext(domain, msgid1, msgid2, n):
    try:
        t = translation(domain, _localedirs.get(domain, None))
    except OSError:
        if n == 1:
            return msgid1
        else:
            return msgid2
    return t.ngettext(msgid1, msgid2, n)

def ldngettext(domain, msgid1, msgid2, n):
    import warnings
    warnings.warn('ldngettext() is deprecated, use dngettext() instead',
                  DeprecationWarning, 2)
    codeset = _localecodesets.get(domain)
    try:
        with warnings.catch_warnings():
            warnings.filterwarnings('ignore', r'.*\bparameter codeset\b.*',
                                    DeprecationWarning)
            t = translation(domain, _localedirs.get(domain, None), codeset=codeset)
    except OSError:
        if n == 1:
            tmsg = msgid1
        else:
            tmsg = msgid2
        return tmsg.encode(codeset or locale.getpreferredencoding())
    with warnings.catch_warnings():
        warnings.filterwarnings('ignore', r'.*\blngettext\b.*',
                                DeprecationWarning)
        return t.lngettext(msgid1, msgid2, n)


def dpgettext(domain, context, message):
    try:
        t = translation(domain, _localedirs.get(domain, None))
    except OSError:
        return message
    return t.pgettext(context, message)


def dnpgettext(domain, context, msgid1, msgid2, n):
    try:
        t = translation(domain, _localedirs.get(domain, None))
    except OSError:
        if n == 1:
            return msgid1
        else:
            return msgid2
    return t.npgettext(context, msgid1, msgid2, n)


def gettext(message):
    return dgettext(_current_domain, message)

def lgettext(message):
    import warnings
    warnings.warn('lgettext() is deprecated, use gettext() instead',
                  DeprecationWarning, 2)
    with warnings.catch_warnings():
        warnings.filterwarnings('ignore', r'.*\bldgettext\b.*',
                                DeprecationWarning)
        return ldgettext(_current_domain, message)

def ngettext(msgid1, msgid2, n):
    return dngettext(_current_domain, msgid1, msgid2, n)

def lngettext(msgid1, msgid2, n):
    import warnings
    warnings.warn('lngettext() is deprecated, use ngettext() instead',
                  DeprecationWarning, 2)
    with warnings.catch_warnings():
        warnings.filterwarnings('ignore', r'.*\bldngettext\b.*',
                                DeprecationWarning)
        return ldngettext(_current_domain, msgid1, msgid2, n)


def pgettext(context, message):
    return dpgettext(_current_domain, context, message)


def npgettext(context, msgid1, msgid2, n):
    return dnpgettext(_current_domain, context, msgid1, msgid2, n)


# dcgettext() has been deemed unnecessary and is not implemented.

# James Henstridge's Catalog constructor from GNOME gettext.  Documented usage
# was:
#
#    import gettext
#    cat = gettext.Catalog(PACKAGE, localedir=LOCALEDIR)
#    _ = cat.gettext
#    print _('Hello World')

# The resulting catalog object currently don't support access through a
# dictionary API, which was supported (but apparently unused) in GNOME
# gettext.

Catalog = translation
sndhdr.py000064400000015673151153537440006424 0ustar00"""Routines to help recognizing sound files.

Function whathdr() recognizes various types of sound file headers.
It understands almost all headers that SOX can decode.

The return tuple contains the following items, in this order:
- file type (as SOX understands it)
- sampling rate (0 if unknown or hard to decode)
- number of channels (0 if unknown or hard to decode)
- number of frames in the file (-1 if unknown or hard to decode)
- number of bits/sample, or 'U' for U-LAW, or 'A' for A-LAW

If the file doesn't have a recognizable type, it returns None.
If the file can't be opened, OSError is raised.

To compute the total time, divide the number of frames by the
sampling rate (a frame contains a sample for each channel).

Function what() calls whathdr().  (It used to also use some
heuristics for raw data, but this doesn't work very well.)

Finally, the function test() is a simple main program that calls
what() for all files mentioned on the argument list.  For directory
arguments it calls what() for all files in that directory.  Default
argument is "." (testing all files in the current directory).  The
option -r tells it to recurse down directories found inside
explicitly given directories.
"""

# The file structure is top-down except that the test program and its
# subroutine come last.

__all__ = ['what', 'whathdr']

from collections import namedtuple

SndHeaders = namedtuple('SndHeaders',
                        'filetype framerate nchannels nframes sampwidth')

SndHeaders.filetype.__doc__ = ("""The value for type indicates the data type
and will be one of the strings 'aifc', 'aiff', 'au','hcom',
'sndr', 'sndt', 'voc', 'wav', '8svx', 'sb', 'ub', or 'ul'.""")
SndHeaders.framerate.__doc__ = ("""The sampling_rate will be either the actual
value or 0 if unknown or difficult to decode.""")
SndHeaders.nchannels.__doc__ = ("""The number of channels or 0 if it cannot be
determined or if the value is difficult to decode.""")
SndHeaders.nframes.__doc__ = ("""The value for frames will be either the number
of frames or -1.""")
SndHeaders.sampwidth.__doc__ = ("""Either the sample size in bits or
'A' for A-LAW or 'U' for u-LAW.""")

def what(filename):
    """Guess the type of a sound file."""
    res = whathdr(filename)
    return res


def whathdr(filename):
    """Recognize sound headers."""
    with open(filename, 'rb') as f:
        h = f.read(512)
        for tf in tests:
            res = tf(h, f)
            if res:
                return SndHeaders(*res)
        return None


#-----------------------------------#
# Subroutines per sound header type #
#-----------------------------------#

tests = []

def test_aifc(h, f):
    import aifc
    if not h.startswith(b'FORM'):
        return None
    if h[8:12] == b'AIFC':
        fmt = 'aifc'
    elif h[8:12] == b'AIFF':
        fmt = 'aiff'
    else:
        return None
    f.seek(0)
    try:
        a = aifc.open(f, 'r')
    except (EOFError, aifc.Error):
        return None
    return (fmt, a.getframerate(), a.getnchannels(),
            a.getnframes(), 8 * a.getsampwidth())

tests.append(test_aifc)


def test_au(h, f):
    if h.startswith(b'.snd'):
        func = get_long_be
    elif h[:4] in (b'\0ds.', b'dns.'):
        func = get_long_le
    else:
        return None
    filetype = 'au'
    hdr_size = func(h[4:8])
    data_size = func(h[8:12])
    encoding = func(h[12:16])
    rate = func(h[16:20])
    nchannels = func(h[20:24])
    sample_size = 1 # default
    if encoding == 1:
        sample_bits = 'U'
    elif encoding == 2:
        sample_bits = 8
    elif encoding == 3:
        sample_bits = 16
        sample_size = 2
    else:
        sample_bits = '?'
    frame_size = sample_size * nchannels
    if frame_size:
        nframe = data_size / frame_size
    else:
        nframe = -1
    return filetype, rate, nchannels, nframe, sample_bits

tests.append(test_au)


def test_hcom(h, f):
    if h[65:69] != b'FSSD' or h[128:132] != b'HCOM':
        return None
    divisor = get_long_be(h[144:148])
    if divisor:
        rate = 22050 / divisor
    else:
        rate = 0
    return 'hcom', rate, 1, -1, 8

tests.append(test_hcom)


def test_voc(h, f):
    if not h.startswith(b'Creative Voice File\032'):
        return None
    sbseek = get_short_le(h[20:22])
    rate = 0
    if 0 <= sbseek < 500 and h[sbseek] == 1:
        ratecode = 256 - h[sbseek+4]
        if ratecode:
            rate = int(1000000.0 / ratecode)
    return 'voc', rate, 1, -1, 8

tests.append(test_voc)


def test_wav(h, f):
    import wave
    # 'RIFF' <len> 'WAVE' 'fmt ' <len>
    if not h.startswith(b'RIFF') or h[8:12] != b'WAVE' or h[12:16] != b'fmt ':
        return None
    f.seek(0)
    try:
        w = wave.open(f, 'r')
    except (EOFError, wave.Error):
        return None
    return ('wav', w.getframerate(), w.getnchannels(),
                   w.getnframes(), 8*w.getsampwidth())

tests.append(test_wav)


def test_8svx(h, f):
    if not h.startswith(b'FORM') or h[8:12] != b'8SVX':
        return None
    # Should decode it to get #channels -- assume always 1
    return '8svx', 0, 1, 0, 8

tests.append(test_8svx)


def test_sndt(h, f):
    if h.startswith(b'SOUND'):
        nsamples = get_long_le(h[8:12])
        rate = get_short_le(h[20:22])
        return 'sndt', rate, 1, nsamples, 8

tests.append(test_sndt)


def test_sndr(h, f):
    if h.startswith(b'\0\0'):
        rate = get_short_le(h[2:4])
        if 4000 <= rate <= 25000:
            return 'sndr', rate, 1, -1, 8

tests.append(test_sndr)


#-------------------------------------------#
# Subroutines to extract numbers from bytes #
#-------------------------------------------#

def get_long_be(b):
    return (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | b[3]

def get_long_le(b):
    return (b[3] << 24) | (b[2] << 16) | (b[1] << 8) | b[0]

def get_short_be(b):
    return (b[0] << 8) | b[1]

def get_short_le(b):
    return (b[1] << 8) | b[0]


#--------------------#
# Small test program #
#--------------------#

def test():
    import sys
    recursive = 0
    if sys.argv[1:] and sys.argv[1] == '-r':
        del sys.argv[1:2]
        recursive = 1
    try:
        if sys.argv[1:]:
            testall(sys.argv[1:], recursive, 1)
        else:
            testall(['.'], recursive, 1)
    except KeyboardInterrupt:
        sys.stderr.write('\n[Interrupted]\n')
        sys.exit(1)

def testall(list, recursive, toplevel):
    import sys
    import os
    for filename in list:
        if os.path.isdir(filename):
            print(filename + '/:', end=' ')
            if recursive or toplevel:
                print('recursing down:')
                import glob
                names = glob.glob(os.path.join(glob.escape(filename), '*'))
                testall(names, recursive, 0)
            else:
                print('*** directory (use -r) ***')
        else:
            print(filename + ':', end=' ')
            sys.stdout.flush()
            try:
                print(what(filename))
            except OSError:
                print('*** not found ***')

if __name__ == '__main__':
    test()
calendar.py000064400000060400151153537440006677 0ustar00"""Calendar printing functions

Note when comparing these calendars to the ones printed by cal(1): By
default, these calendars have Monday as the first day of the week, and
Sunday as the last (the European convention). Use setfirstweekday() to
set the first day of the week (0=Monday, 6=Sunday)."""

import sys
import datetime
import locale as _locale
from itertools import repeat

__all__ = ["IllegalMonthError", "IllegalWeekdayError", "setfirstweekday",
           "firstweekday", "isleap", "leapdays", "weekday", "monthrange",
           "monthcalendar", "prmonth", "month", "prcal", "calendar",
           "timegm", "month_name", "month_abbr", "day_name", "day_abbr",
           "Calendar", "TextCalendar", "HTMLCalendar", "LocaleTextCalendar",
           "LocaleHTMLCalendar", "weekheader"]

# Exception raised for bad input (with string parameter for details)
error = ValueError

# Exceptions raised for bad input
class IllegalMonthError(ValueError):
    def __init__(self, month):
        self.month = month
    def __str__(self):
        return "bad month number %r; must be 1-12" % self.month


class IllegalWeekdayError(ValueError):
    def __init__(self, weekday):
        self.weekday = weekday
    def __str__(self):
        return "bad weekday number %r; must be 0 (Monday) to 6 (Sunday)" % self.weekday


# Constants for months referenced later
January = 1
February = 2

# Number of days per month (except for February in leap years)
mdays = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

# This module used to have hard-coded lists of day and month names, as
# English strings.  The classes following emulate a read-only version of
# that, but supply localized names.  Note that the values are computed
# fresh on each call, in case the user changes locale between calls.

class _localized_month:

    _months = [datetime.date(2001, i+1, 1).strftime for i in range(12)]
    _months.insert(0, lambda x: "")

    def __init__(self, format):
        self.format = format

    def __getitem__(self, i):
        funcs = self._months[i]
        if isinstance(i, slice):
            return [f(self.format) for f in funcs]
        else:
            return funcs(self.format)

    def __len__(self):
        return 13


class _localized_day:

    # January 1, 2001, was a Monday.
    _days = [datetime.date(2001, 1, i+1).strftime for i in range(7)]

    def __init__(self, format):
        self.format = format

    def __getitem__(self, i):
        funcs = self._days[i]
        if isinstance(i, slice):
            return [f(self.format) for f in funcs]
        else:
            return funcs(self.format)

    def __len__(self):
        return 7


# Full and abbreviated names of weekdays
day_name = _localized_day('%A')
day_abbr = _localized_day('%a')

# Full and abbreviated names of months (1-based arrays!!!)
month_name = _localized_month('%B')
month_abbr = _localized_month('%b')

# Constants for weekdays
(MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY) = range(7)


def isleap(year):
    """Return True for leap years, False for non-leap years."""
    return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)


def leapdays(y1, y2):
    """Return number of leap years in range [y1, y2).
       Assume y1 <= y2."""
    y1 -= 1
    y2 -= 1
    return (y2//4 - y1//4) - (y2//100 - y1//100) + (y2//400 - y1//400)


def weekday(year, month, day):
    """Return weekday (0-6 ~ Mon-Sun) for year, month (1-12), day (1-31)."""
    if not datetime.MINYEAR <= year <= datetime.MAXYEAR:
        year = 2000 + year % 400
    return datetime.date(year, month, day).weekday()


def monthrange(year, month):
    """Return weekday (0-6 ~ Mon-Sun) and number of days (28-31) for
       year, month."""
    if not 1 <= month <= 12:
        raise IllegalMonthError(month)
    day1 = weekday(year, month, 1)
    ndays = mdays[month] + (month == February and isleap(year))
    return day1, ndays


def _monthlen(year, month):
    return mdays[month] + (month == February and isleap(year))


def _prevmonth(year, month):
    if month == 1:
        return year-1, 12
    else:
        return year, month-1


def _nextmonth(year, month):
    if month == 12:
        return year+1, 1
    else:
        return year, month+1


class Calendar(object):
    """
    Base calendar class. This class doesn't do any formatting. It simply
    provides data to subclasses.
    """

    def __init__(self, firstweekday=0):
        self.firstweekday = firstweekday # 0 = Monday, 6 = Sunday

    def getfirstweekday(self):
        return self._firstweekday % 7

    def setfirstweekday(self, firstweekday):
        self._firstweekday = firstweekday

    firstweekday = property(getfirstweekday, setfirstweekday)

    def iterweekdays(self):
        """
        Return an iterator for one week of weekday numbers starting with the
        configured first one.
        """
        for i in range(self.firstweekday, self.firstweekday + 7):
            yield i%7

    def itermonthdates(self, year, month):
        """
        Return an iterator for one month. The iterator will yield datetime.date
        values and will always iterate through complete weeks, so it will yield
        dates outside the specified month.
        """
        for y, m, d in self.itermonthdays3(year, month):
            yield datetime.date(y, m, d)

    def itermonthdays(self, year, month):
        """
        Like itermonthdates(), but will yield day numbers. For days outside
        the specified month the day number is 0.
        """
        day1, ndays = monthrange(year, month)
        days_before = (day1 - self.firstweekday) % 7
        yield from repeat(0, days_before)
        yield from range(1, ndays + 1)
        days_after = (self.firstweekday - day1 - ndays) % 7
        yield from repeat(0, days_after)

    def itermonthdays2(self, year, month):
        """
        Like itermonthdates(), but will yield (day number, weekday number)
        tuples. For days outside the specified month the day number is 0.
        """
        for i, d in enumerate(self.itermonthdays(year, month), self.firstweekday):
            yield d, i % 7

    def itermonthdays3(self, year, month):
        """
        Like itermonthdates(), but will yield (year, month, day) tuples.  Can be
        used for dates outside of datetime.date range.
        """
        day1, ndays = monthrange(year, month)
        days_before = (day1 - self.firstweekday) % 7
        days_after = (self.firstweekday - day1 - ndays) % 7
        y, m = _prevmonth(year, month)
        end = _monthlen(y, m) + 1
        for d in range(end-days_before, end):
            yield y, m, d
        for d in range(1, ndays + 1):
            yield year, month, d
        y, m = _nextmonth(year, month)
        for d in range(1, days_after + 1):
            yield y, m, d

    def itermonthdays4(self, year, month):
        """
        Like itermonthdates(), but will yield (year, month, day, day_of_week) tuples.
        Can be used for dates outside of datetime.date range.
        """
        for i, (y, m, d) in enumerate(self.itermonthdays3(year, month)):
            yield y, m, d, (self.firstweekday + i) % 7

    def monthdatescalendar(self, year, month):
        """
        Return a matrix (list of lists) representing a month's calendar.
        Each row represents a week; week entries are datetime.date values.
        """
        dates = list(self.itermonthdates(year, month))
        return [ dates[i:i+7] for i in range(0, len(dates), 7) ]

    def monthdays2calendar(self, year, month):
        """
        Return a matrix representing a month's calendar.
        Each row represents a week; week entries are
        (day number, weekday number) tuples. Day numbers outside this month
        are zero.
        """
        days = list(self.itermonthdays2(year, month))
        return [ days[i:i+7] for i in range(0, len(days), 7) ]

    def monthdayscalendar(self, year, month):
        """
        Return a matrix representing a month's calendar.
        Each row represents a week; days outside this month are zero.
        """
        days = list(self.itermonthdays(year, month))
        return [ days[i:i+7] for i in range(0, len(days), 7) ]

    def yeardatescalendar(self, year, width=3):
        """
        Return the data for the specified year ready for formatting. The return
        value is a list of month rows. Each month row contains up to width months.
        Each month contains between 4 and 6 weeks and each week contains 1-7
        days. Days are datetime.date objects.
        """
        months = [
            self.monthdatescalendar(year, i)
            for i in range(January, January+12)
        ]
        return [months[i:i+width] for i in range(0, len(months), width) ]

    def yeardays2calendar(self, year, width=3):
        """
        Return the data for the specified year ready for formatting (similar to
        yeardatescalendar()). Entries in the week lists are
        (day number, weekday number) tuples. Day numbers outside this month are
        zero.
        """
        months = [
            self.monthdays2calendar(year, i)
            for i in range(January, January+12)
        ]
        return [months[i:i+width] for i in range(0, len(months), width) ]

    def yeardayscalendar(self, year, width=3):
        """
        Return the data for the specified year ready for formatting (similar to
        yeardatescalendar()). Entries in the week lists are day numbers.
        Day numbers outside this month are zero.
        """
        months = [
            self.monthdayscalendar(year, i)
            for i in range(January, January+12)
        ]
        return [months[i:i+width] for i in range(0, len(months), width) ]


class TextCalendar(Calendar):
    """
    Subclass of Calendar that outputs a calendar as a simple plain text
    similar to the UNIX program cal.
    """

    def prweek(self, theweek, width):
        """
        Print a single week (no newline).
        """
        print(self.formatweek(theweek, width), end='')

    def formatday(self, day, weekday, width):
        """
        Returns a formatted day.
        """
        if day == 0:
            s = ''
        else:
            s = '%2i' % day             # right-align single-digit days
        return s.center(width)

    def formatweek(self, theweek, width):
        """
        Returns a single week in a string (no newline).
        """
        return ' '.join(self.formatday(d, wd, width) for (d, wd) in theweek)

    def formatweekday(self, day, width):
        """
        Returns a formatted week day name.
        """
        if width >= 9:
            names = day_name
        else:
            names = day_abbr
        return names[day][:width].center(width)

    def formatweekheader(self, width):
        """
        Return a header for a week.
        """
        return ' '.join(self.formatweekday(i, width) for i in self.iterweekdays())

    def formatmonthname(self, theyear, themonth, width, withyear=True):
        """
        Return a formatted month name.
        """
        s = month_name[themonth]
        if withyear:
            s = "%s %r" % (s, theyear)
        return s.center(width)

    def prmonth(self, theyear, themonth, w=0, l=0):
        """
        Print a month's calendar.
        """
        print(self.formatmonth(theyear, themonth, w, l), end='')

    def formatmonth(self, theyear, themonth, w=0, l=0):
        """
        Return a month's calendar string (multi-line).
        """
        w = max(2, w)
        l = max(1, l)
        s = self.formatmonthname(theyear, themonth, 7 * (w + 1) - 1)
        s = s.rstrip()
        s += '\n' * l
        s += self.formatweekheader(w).rstrip()
        s += '\n' * l
        for week in self.monthdays2calendar(theyear, themonth):
            s += self.formatweek(week, w).rstrip()
            s += '\n' * l
        return s

    def formatyear(self, theyear, w=2, l=1, c=6, m=3):
        """
        Returns a year's calendar as a multi-line string.
        """
        w = max(2, w)
        l = max(1, l)
        c = max(2, c)
        colwidth = (w + 1) * 7 - 1
        v = []
        a = v.append
        a(repr(theyear).center(colwidth*m+c*(m-1)).rstrip())
        a('\n'*l)
        header = self.formatweekheader(w)
        for (i, row) in enumerate(self.yeardays2calendar(theyear, m)):
            # months in this row
            months = range(m*i+1, min(m*(i+1)+1, 13))
            a('\n'*l)
            names = (self.formatmonthname(theyear, k, colwidth, False)
                     for k in months)
            a(formatstring(names, colwidth, c).rstrip())
            a('\n'*l)
            headers = (header for k in months)
            a(formatstring(headers, colwidth, c).rstrip())
            a('\n'*l)
            # max number of weeks for this row
            height = max(len(cal) for cal in row)
            for j in range(height):
                weeks = []
                for cal in row:
                    if j >= len(cal):
                        weeks.append('')
                    else:
                        weeks.append(self.formatweek(cal[j], w))
                a(formatstring(weeks, colwidth, c).rstrip())
                a('\n' * l)
        return ''.join(v)

    def pryear(self, theyear, w=0, l=0, c=6, m=3):
        """Print a year's calendar."""
        print(self.formatyear(theyear, w, l, c, m), end='')


class HTMLCalendar(Calendar):
    """
    This calendar returns complete HTML pages.
    """

    # CSS classes for the day <td>s
    cssclasses = ["mon", "tue", "wed", "thu", "fri", "sat", "sun"]

    # CSS classes for the day <th>s
    cssclasses_weekday_head = cssclasses

    # CSS class for the days before and after current month
    cssclass_noday = "noday"

    # CSS class for the month's head
    cssclass_month_head = "month"

    # CSS class for the month
    cssclass_month = "month"

    # CSS class for the year's table head
    cssclass_year_head = "year"

    # CSS class for the whole year table
    cssclass_year = "year"

    def formatday(self, day, weekday):
        """
        Return a day as a table cell.
        """
        if day == 0:
            # day outside month
            return '<td class="%s">&nbsp;</td>' % self.cssclass_noday
        else:
            return '<td class="%s">%d</td>' % (self.cssclasses[weekday], day)

    def formatweek(self, theweek):
        """
        Return a complete week as a table row.
        """
        s = ''.join(self.formatday(d, wd) for (d, wd) in theweek)
        return '<tr>%s</tr>' % s

    def formatweekday(self, day):
        """
        Return a weekday name as a table header.
        """
        return '<th class="%s">%s</th>' % (
            self.cssclasses_weekday_head[day], day_abbr[day])

    def formatweekheader(self):
        """
        Return a header for a week as a table row.
        """
        s = ''.join(self.formatweekday(i) for i in self.iterweekdays())
        return '<tr>%s</tr>' % s

    def formatmonthname(self, theyear, themonth, withyear=True):
        """
        Return a month name as a table row.
        """
        if withyear:
            s = '%s %s' % (month_name[themonth], theyear)
        else:
            s = '%s' % month_name[themonth]
        return '<tr><th colspan="7" class="%s">%s</th></tr>' % (
            self.cssclass_month_head, s)

    def formatmonth(self, theyear, themonth, withyear=True):
        """
        Return a formatted month as a table.
        """
        v = []
        a = v.append
        a('<table border="0" cellpadding="0" cellspacing="0" class="%s">' % (
            self.cssclass_month))
        a('\n')
        a(self.formatmonthname(theyear, themonth, withyear=withyear))
        a('\n')
        a(self.formatweekheader())
        a('\n')
        for week in self.monthdays2calendar(theyear, themonth):
            a(self.formatweek(week))
            a('\n')
        a('</table>')
        a('\n')
        return ''.join(v)

    def formatyear(self, theyear, width=3):
        """
        Return a formatted year as a table of tables.
        """
        v = []
        a = v.append
        width = max(width, 1)
        a('<table border="0" cellpadding="0" cellspacing="0" class="%s">' %
          self.cssclass_year)
        a('\n')
        a('<tr><th colspan="%d" class="%s">%s</th></tr>' % (
            width, self.cssclass_year_head, theyear))
        for i in range(January, January+12, width):
            # months in this row
            months = range(i, min(i+width, 13))
            a('<tr>')
            for m in months:
                a('<td>')
                a(self.formatmonth(theyear, m, withyear=False))
                a('</td>')
            a('</tr>')
        a('</table>')
        return ''.join(v)

    def formatyearpage(self, theyear, width=3, css='calendar.css', encoding=None):
        """
        Return a formatted year as a complete HTML page.
        """
        if encoding is None:
            encoding = sys.getdefaultencoding()
        v = []
        a = v.append
        a('<?xml version="1.0" encoding="%s"?>\n' % encoding)
        a('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n')
        a('<html>\n')
        a('<head>\n')
        a('<meta http-equiv="Content-Type" content="text/html; charset=%s" />\n' % encoding)
        if css is not None:
            a('<link rel="stylesheet" type="text/css" href="%s" />\n' % css)
        a('<title>Calendar for %d</title>\n' % theyear)
        a('</head>\n')
        a('<body>\n')
        a(self.formatyear(theyear, width))
        a('</body>\n')
        a('</html>\n')
        return ''.join(v).encode(encoding, "xmlcharrefreplace")


class different_locale:
    def __init__(self, locale):
        self.locale = locale

    def __enter__(self):
        self.oldlocale = _locale.getlocale(_locale.LC_TIME)
        _locale.setlocale(_locale.LC_TIME, self.locale)

    def __exit__(self, *args):
        _locale.setlocale(_locale.LC_TIME, self.oldlocale)


class LocaleTextCalendar(TextCalendar):
    """
    This class can be passed a locale name in the constructor and will return
    month and weekday names in the specified locale. If this locale includes
    an encoding all strings containing month and weekday names will be returned
    as unicode.
    """

    def __init__(self, firstweekday=0, locale=None):
        TextCalendar.__init__(self, firstweekday)
        if locale is None:
            locale = _locale.getdefaultlocale()
        self.locale = locale

    def formatweekday(self, day, width):
        with different_locale(self.locale):
            if width >= 9:
                names = day_name
            else:
                names = day_abbr
            name = names[day]
            return name[:width].center(width)

    def formatmonthname(self, theyear, themonth, width, withyear=True):
        with different_locale(self.locale):
            s = month_name[themonth]
            if withyear:
                s = "%s %r" % (s, theyear)
            return s.center(width)


class LocaleHTMLCalendar(HTMLCalendar):
    """
    This class can be passed a locale name in the constructor and will return
    month and weekday names in the specified locale. If this locale includes
    an encoding all strings containing month and weekday names will be returned
    as unicode.
    """
    def __init__(self, firstweekday=0, locale=None):
        HTMLCalendar.__init__(self, firstweekday)
        if locale is None:
            locale = _locale.getdefaultlocale()
        self.locale = locale

    def formatweekday(self, day):
        with different_locale(self.locale):
            s = day_abbr[day]
            return '<th class="%s">%s</th>' % (self.cssclasses[day], s)

    def formatmonthname(self, theyear, themonth, withyear=True):
        with different_locale(self.locale):
            s = month_name[themonth]
            if withyear:
                s = '%s %s' % (s, theyear)
            return '<tr><th colspan="7" class="month">%s</th></tr>' % s


# Support for old module level interface
c = TextCalendar()

firstweekday = c.getfirstweekday

def setfirstweekday(firstweekday):
    if not MONDAY <= firstweekday <= SUNDAY:
        raise IllegalWeekdayError(firstweekday)
    c.firstweekday = firstweekday

monthcalendar = c.monthdayscalendar
prweek = c.prweek
week = c.formatweek
weekheader = c.formatweekheader
prmonth = c.prmonth
month = c.formatmonth
calendar = c.formatyear
prcal = c.pryear


# Spacing of month columns for multi-column year calendar
_colwidth = 7*3 - 1         # Amount printed by prweek()
_spacing = 6                # Number of spaces between columns


def format(cols, colwidth=_colwidth, spacing=_spacing):
    """Prints multi-column formatting for year calendars"""
    print(formatstring(cols, colwidth, spacing))


def formatstring(cols, colwidth=_colwidth, spacing=_spacing):
    """Returns a string formatted from n strings, centered within n columns."""
    spacing *= ' '
    return spacing.join(c.center(colwidth) for c in cols)


EPOCH = 1970
_EPOCH_ORD = datetime.date(EPOCH, 1, 1).toordinal()


def timegm(tuple):
    """Unrelated but handy function to calculate Unix timestamp from GMT."""
    year, month, day, hour, minute, second = tuple[:6]
    days = datetime.date(year, month, 1).toordinal() - _EPOCH_ORD + day - 1
    hours = days*24 + hour
    minutes = hours*60 + minute
    seconds = minutes*60 + second
    return seconds


def main(args):
    import argparse
    parser = argparse.ArgumentParser()
    textgroup = parser.add_argument_group('text only arguments')
    htmlgroup = parser.add_argument_group('html only arguments')
    textgroup.add_argument(
        "-w", "--width",
        type=int, default=2,
        help="width of date column (default 2)"
    )
    textgroup.add_argument(
        "-l", "--lines",
        type=int, default=1,
        help="number of lines for each week (default 1)"
    )
    textgroup.add_argument(
        "-s", "--spacing",
        type=int, default=6,
        help="spacing between months (default 6)"
    )
    textgroup.add_argument(
        "-m", "--months",
        type=int, default=3,
        help="months per row (default 3)"
    )
    htmlgroup.add_argument(
        "-c", "--css",
        default="calendar.css",
        help="CSS to use for page"
    )
    parser.add_argument(
        "-L", "--locale",
        default=None,
        help="locale to be used from month and weekday names"
    )
    parser.add_argument(
        "-e", "--encoding",
        default=None,
        help="encoding to use for output"
    )
    parser.add_argument(
        "-t", "--type",
        default="text",
        choices=("text", "html"),
        help="output type (text or html)"
    )
    parser.add_argument(
        "year",
        nargs='?', type=int,
        help="year number (1-9999)"
    )
    parser.add_argument(
        "month",
        nargs='?', type=int,
        help="month number (1-12, text only)"
    )

    options = parser.parse_args(args[1:])

    if options.locale and not options.encoding:
        parser.error("if --locale is specified --encoding is required")
        sys.exit(1)

    locale = options.locale, options.encoding

    if options.type == "html":
        if options.locale:
            cal = LocaleHTMLCalendar(locale=locale)
        else:
            cal = HTMLCalendar()
        encoding = options.encoding
        if encoding is None:
            encoding = sys.getdefaultencoding()
        optdict = dict(encoding=encoding, css=options.css)
        write = sys.stdout.buffer.write
        if options.year is None:
            write(cal.formatyearpage(datetime.date.today().year, **optdict))
        elif options.month is None:
            write(cal.formatyearpage(options.year, **optdict))
        else:
            parser.error("incorrect number of arguments")
            sys.exit(1)
    else:
        if options.locale:
            cal = LocaleTextCalendar(locale=locale)
        else:
            cal = TextCalendar()
        optdict = dict(w=options.width, l=options.lines)
        if options.month is None:
            optdict["c"] = options.spacing
            optdict["m"] = options.months
        if options.year is None:
            result = cal.formatyear(datetime.date.today().year, **optdict)
        elif options.month is None:
            result = cal.formatyear(options.year, **optdict)
        else:
            result = cal.formatmonth(options.year, options.month, **optdict)
        write = sys.stdout.write
        if options.encoding:
            result = result.encode(options.encoding)
            write = sys.stdout.buffer.write
        write(result)


if __name__ == "__main__":
    main(sys.argv)
symtable.py000064400000017525151153537440006760 0ustar00"""Interface to the compiler's internal symbol tables"""

import _symtable
from _symtable import (USE, DEF_GLOBAL, DEF_NONLOCAL, DEF_LOCAL, DEF_PARAM,
     DEF_IMPORT, DEF_BOUND, DEF_ANNOT, SCOPE_OFF, SCOPE_MASK, FREE,
     LOCAL, GLOBAL_IMPLICIT, GLOBAL_EXPLICIT, CELL)

import weakref

__all__ = ["symtable", "SymbolTable", "Class", "Function", "Symbol"]

def symtable(code, filename, compile_type):
    top = _symtable.symtable(code, filename, compile_type)
    return _newSymbolTable(top, filename)

class SymbolTableFactory:
    def __init__(self):
        self.__memo = weakref.WeakValueDictionary()

    def new(self, table, filename):
        if table.type == _symtable.TYPE_FUNCTION:
            return Function(table, filename)
        if table.type == _symtable.TYPE_CLASS:
            return Class(table, filename)
        return SymbolTable(table, filename)

    def __call__(self, table, filename):
        key = table, filename
        obj = self.__memo.get(key, None)
        if obj is None:
            obj = self.__memo[key] = self.new(table, filename)
        return obj

_newSymbolTable = SymbolTableFactory()


class SymbolTable:

    def __init__(self, raw_table, filename):
        self._table = raw_table
        self._filename = filename
        self._symbols = {}

    def __repr__(self):
        if self.__class__ == SymbolTable:
            kind = ""
        else:
            kind = "%s " % self.__class__.__name__

        if self._table.name == "top":
            return "<{0}SymbolTable for module {1}>".format(kind, self._filename)
        else:
            return "<{0}SymbolTable for {1} in {2}>".format(kind,
                                                            self._table.name,
                                                            self._filename)

    def get_type(self):
        if self._table.type == _symtable.TYPE_MODULE:
            return "module"
        if self._table.type == _symtable.TYPE_FUNCTION:
            return "function"
        if self._table.type == _symtable.TYPE_CLASS:
            return "class"
        assert self._table.type in (1, 2, 3), \
               "unexpected type: {0}".format(self._table.type)

    def get_id(self):
        return self._table.id

    def get_name(self):
        return self._table.name

    def get_lineno(self):
        return self._table.lineno

    def is_optimized(self):
        return bool(self._table.type == _symtable.TYPE_FUNCTION)

    def is_nested(self):
        return bool(self._table.nested)

    def has_children(self):
        return bool(self._table.children)

    def has_exec(self):
        """Return true if the scope uses exec.  Deprecated method."""
        return False

    def get_identifiers(self):
        return self._table.symbols.keys()

    def lookup(self, name):
        sym = self._symbols.get(name)
        if sym is None:
            flags = self._table.symbols[name]
            namespaces = self.__check_children(name)
            module_scope = (self._table.name == "top")
            sym = self._symbols[name] = Symbol(name, flags, namespaces,
                                               module_scope=module_scope)
        return sym

    def get_symbols(self):
        return [self.lookup(ident) for ident in self.get_identifiers()]

    def __check_children(self, name):
        return [_newSymbolTable(st, self._filename)
                for st in self._table.children
                if st.name == name]

    def get_children(self):
        return [_newSymbolTable(st, self._filename)
                for st in self._table.children]


class Function(SymbolTable):

    # Default values for instance variables
    __params = None
    __locals = None
    __frees = None
    __globals = None
    __nonlocals = None

    def __idents_matching(self, test_func):
        return tuple(ident for ident in self.get_identifiers()
                     if test_func(self._table.symbols[ident]))

    def get_parameters(self):
        if self.__params is None:
            self.__params = self.__idents_matching(lambda x:x & DEF_PARAM)
        return self.__params

    def get_locals(self):
        if self.__locals is None:
            locs = (LOCAL, CELL)
            test = lambda x: ((x >> SCOPE_OFF) & SCOPE_MASK) in locs
            self.__locals = self.__idents_matching(test)
        return self.__locals

    def get_globals(self):
        if self.__globals is None:
            glob = (GLOBAL_IMPLICIT, GLOBAL_EXPLICIT)
            test = lambda x:((x >> SCOPE_OFF) & SCOPE_MASK) in glob
            self.__globals = self.__idents_matching(test)
        return self.__globals

    def get_nonlocals(self):
        if self.__nonlocals is None:
            self.__nonlocals = self.__idents_matching(lambda x:x & DEF_NONLOCAL)
        return self.__nonlocals

    def get_frees(self):
        if self.__frees is None:
            is_free = lambda x:((x >> SCOPE_OFF) & SCOPE_MASK) == FREE
            self.__frees = self.__idents_matching(is_free)
        return self.__frees


class Class(SymbolTable):

    __methods = None

    def get_methods(self):
        if self.__methods is None:
            d = {}
            for st in self._table.children:
                d[st.name] = 1
            self.__methods = tuple(d)
        return self.__methods


class Symbol:

    def __init__(self, name, flags, namespaces=None, *, module_scope=False):
        self.__name = name
        self.__flags = flags
        self.__scope = (flags >> SCOPE_OFF) & SCOPE_MASK # like PyST_GetScope()
        self.__namespaces = namespaces or ()
        self.__module_scope = module_scope

    def __repr__(self):
        return "<symbol {0!r}>".format(self.__name)

    def get_name(self):
        return self.__name

    def is_referenced(self):
        return bool(self.__flags & _symtable.USE)

    def is_parameter(self):
        return bool(self.__flags & DEF_PARAM)

    def is_global(self):
        """Return *True* if the sysmbol is global.
        """
        return bool(self.__scope in (GLOBAL_IMPLICIT, GLOBAL_EXPLICIT)
                    or (self.__module_scope and self.__flags & DEF_BOUND))

    def is_nonlocal(self):
        return bool(self.__flags & DEF_NONLOCAL)

    def is_declared_global(self):
        return bool(self.__scope == GLOBAL_EXPLICIT)

    def is_local(self):
        """Return *True* if the symbol is local.
        """
        return bool(self.__scope in (LOCAL, CELL)
                    or (self.__module_scope and self.__flags & DEF_BOUND))

    def is_annotated(self):
        return bool(self.__flags & DEF_ANNOT)

    def is_free(self):
        return bool(self.__scope == FREE)

    def is_imported(self):
        return bool(self.__flags & DEF_IMPORT)

    def is_assigned(self):
        return bool(self.__flags & DEF_LOCAL)

    def is_namespace(self):
        """Returns true if name binding introduces new namespace.

        If the name is used as the target of a function or class
        statement, this will be true.

        Note that a single name can be bound to multiple objects.  If
        is_namespace() is true, the name may also be bound to other
        objects, like an int or list, that does not introduce a new
        namespace.
        """
        return bool(self.__namespaces)

    def get_namespaces(self):
        """Return a list of namespaces bound to this name"""
        return self.__namespaces

    def get_namespace(self):
        """Returns the single namespace bound to this name.

        Raises ValueError if the name is bound to multiple namespaces.
        """
        if len(self.__namespaces) != 1:
            raise ValueError("name is bound to multiple namespaces")
        return self.__namespaces[0]

if __name__ == "__main__":
    import os, sys
    with open(sys.argv[0]) as f:
        src = f.read()
    mod = symtable(src, os.path.split(sys.argv[0])[1], "exec")
    for ident in mod.get_identifiers():
        info = mod.lookup(ident)
        print(info, info.is_local(), info.is_namespace())
distutils/cmd.py000064400000043237151153537440007726 0ustar00"""distutils.cmd

Provides the Command class, the base class for the command classes
in the distutils.command package.
"""

import sys, os, re
from distutils.errors import DistutilsOptionError
from distutils import util, dir_util, file_util, archive_util, dep_util
from distutils import log

class Command:
    """Abstract base class for defining command classes, the "worker bees"
    of the Distutils.  A useful analogy for command classes is to think of
    them as subroutines with local variables called "options".  The options
    are "declared" in 'initialize_options()' and "defined" (given their
    final values, aka "finalized") in 'finalize_options()', both of which
    must be defined by every command class.  The distinction between the
    two is necessary because option values might come from the outside
    world (command line, config file, ...), and any options dependent on
    other options must be computed *after* these outside influences have
    been processed -- hence 'finalize_options()'.  The "body" of the
    subroutine, where it does all its work based on the values of its
    options, is the 'run()' method, which must also be implemented by every
    command class.
    """

    # 'sub_commands' formalizes the notion of a "family" of commands,
    # eg. "install" as the parent with sub-commands "install_lib",
    # "install_headers", etc.  The parent of a family of commands
    # defines 'sub_commands' as a class attribute; it's a list of
    #    (command_name : string, predicate : unbound_method | string | None)
    # tuples, where 'predicate' is a method of the parent command that
    # determines whether the corresponding command is applicable in the
    # current situation.  (Eg. we "install_headers" is only applicable if
    # we have any C header files to install.)  If 'predicate' is None,
    # that command is always applicable.
    #
    # 'sub_commands' is usually defined at the *end* of a class, because
    # predicates can be unbound methods, so they must already have been
    # defined.  The canonical example is the "install" command.
    sub_commands = []


    # -- Creation/initialization methods -------------------------------

    def __init__(self, dist):
        """Create and initialize a new Command object.  Most importantly,
        invokes the 'initialize_options()' method, which is the real
        initializer and depends on the actual command being
        instantiated.
        """
        # late import because of mutual dependence between these classes
        from distutils.dist import Distribution

        if not isinstance(dist, Distribution):
            raise TypeError("dist must be a Distribution instance")
        if self.__class__ is Command:
            raise RuntimeError("Command is an abstract class")

        self.distribution = dist
        self.initialize_options()

        # Per-command versions of the global flags, so that the user can
        # customize Distutils' behaviour command-by-command and let some
        # commands fall back on the Distribution's behaviour.  None means
        # "not defined, check self.distribution's copy", while 0 or 1 mean
        # false and true (duh).  Note that this means figuring out the real
        # value of each flag is a touch complicated -- hence "self._dry_run"
        # will be handled by __getattr__, below.
        # XXX This needs to be fixed.
        self._dry_run = None

        # verbose is largely ignored, but needs to be set for
        # backwards compatibility (I think)?
        self.verbose = dist.verbose

        # Some commands define a 'self.force' option to ignore file
        # timestamps, but methods defined *here* assume that
        # 'self.force' exists for all commands.  So define it here
        # just to be safe.
        self.force = None

        # The 'help' flag is just used for command-line parsing, so
        # none of that complicated bureaucracy is needed.
        self.help = 0

        # 'finalized' records whether or not 'finalize_options()' has been
        # called.  'finalize_options()' itself should not pay attention to
        # this flag: it is the business of 'ensure_finalized()', which
        # always calls 'finalize_options()', to respect/update it.
        self.finalized = 0

    # XXX A more explicit way to customize dry_run would be better.
    def __getattr__(self, attr):
        if attr == 'dry_run':
            myval = getattr(self, "_" + attr)
            if myval is None:
                return getattr(self.distribution, attr)
            else:
                return myval
        else:
            raise AttributeError(attr)

    def ensure_finalized(self):
        if not self.finalized:
            self.finalize_options()
        self.finalized = 1

    # Subclasses must define:
    #   initialize_options()
    #     provide default values for all options; may be customized by
    #     setup script, by options from config file(s), or by command-line
    #     options
    #   finalize_options()
    #     decide on the final values for all options; this is called
    #     after all possible intervention from the outside world
    #     (command-line, option file, etc.) has been processed
    #   run()
    #     run the command: do whatever it is we're here to do,
    #     controlled by the command's various option values

    def initialize_options(self):
        """Set default values for all the options that this command
        supports.  Note that these defaults may be overridden by other
        commands, by the setup script, by config files, or by the
        command-line.  Thus, this is not the place to code dependencies
        between options; generally, 'initialize_options()' implementations
        are just a bunch of "self.foo = None" assignments.

        This method must be implemented by all command classes.
        """
        raise RuntimeError("abstract method -- subclass %s must override"
                           % self.__class__)

    def finalize_options(self):
        """Set final values for all the options that this command supports.
        This is always called as late as possible, ie.  after any option
        assignments from the command-line or from other commands have been
        done.  Thus, this is the place to code option dependencies: if
        'foo' depends on 'bar', then it is safe to set 'foo' from 'bar' as
        long as 'foo' still has the same value it was assigned in
        'initialize_options()'.

        This method must be implemented by all command classes.
        """
        raise RuntimeError("abstract method -- subclass %s must override"
                           % self.__class__)


    def dump_options(self, header=None, indent=""):
        from distutils.fancy_getopt import longopt_xlate
        if header is None:
            header = "command options for '%s':" % self.get_command_name()
        self.announce(indent + header, level=log.INFO)
        indent = indent + "  "
        for (option, _, _) in self.user_options:
            option = option.translate(longopt_xlate)
            if option[-1] == "=":
                option = option[:-1]
            value = getattr(self, option)
            self.announce(indent + "%s = %s" % (option, value),
                          level=log.INFO)

    def run(self):
        """A command's raison d'etre: carry out the action it exists to
        perform, controlled by the options initialized in
        'initialize_options()', customized by other commands, the setup
        script, the command-line, and config files, and finalized in
        'finalize_options()'.  All terminal output and filesystem
        interaction should be done by 'run()'.

        This method must be implemented by all command classes.
        """
        raise RuntimeError("abstract method -- subclass %s must override"
                           % self.__class__)

    def announce(self, msg, level=1):
        """If the current verbosity level is of greater than or equal to
        'level' print 'msg' to stdout.
        """
        log.log(level, msg)

    def debug_print(self, msg):
        """Print 'msg' to stdout if the global DEBUG (taken from the
        DISTUTILS_DEBUG environment variable) flag is true.
        """
        from distutils.debug import DEBUG
        if DEBUG:
            print(msg)
            sys.stdout.flush()


    # -- Option validation methods -------------------------------------
    # (these are very handy in writing the 'finalize_options()' method)
    #
    # NB. the general philosophy here is to ensure that a particular option
    # value meets certain type and value constraints.  If not, we try to
    # force it into conformance (eg. if we expect a list but have a string,
    # split the string on comma and/or whitespace).  If we can't force the
    # option into conformance, raise DistutilsOptionError.  Thus, command
    # classes need do nothing more than (eg.)
    #   self.ensure_string_list('foo')
    # and they can be guaranteed that thereafter, self.foo will be
    # a list of strings.

    def _ensure_stringlike(self, option, what, default=None):
        val = getattr(self, option)
        if val is None:
            setattr(self, option, default)
            return default
        elif not isinstance(val, str):
            raise DistutilsOptionError("'%s' must be a %s (got `%s`)"
                                       % (option, what, val))
        return val

    def ensure_string(self, option, default=None):
        """Ensure that 'option' is a string; if not defined, set it to
        'default'.
        """
        self._ensure_stringlike(option, "string", default)

    def ensure_string_list(self, option):
        r"""Ensure that 'option' is a list of strings.  If 'option' is
        currently a string, we split it either on /,\s*/ or /\s+/, so
        "foo bar baz", "foo,bar,baz", and "foo,   bar baz" all become
        ["foo", "bar", "baz"].
        """
        val = getattr(self, option)
        if val is None:
            return
        elif isinstance(val, str):
            setattr(self, option, re.split(r',\s*|\s+', val))
        else:
            if isinstance(val, list):
                ok = all(isinstance(v, str) for v in val)
            else:
                ok = False
            if not ok:
                raise DistutilsOptionError(
                      "'%s' must be a list of strings (got %r)"
                      % (option, val))

    def _ensure_tested_string(self, option, tester, what, error_fmt,
                              default=None):
        val = self._ensure_stringlike(option, what, default)
        if val is not None and not tester(val):
            raise DistutilsOptionError(("error in '%s' option: " + error_fmt)
                                       % (option, val))

    def ensure_filename(self, option):
        """Ensure that 'option' is the name of an existing file."""
        self._ensure_tested_string(option, os.path.isfile,
                                   "filename",
                                   "'%s' does not exist or is not a file")

    def ensure_dirname(self, option):
        self._ensure_tested_string(option, os.path.isdir,
                                   "directory name",
                                   "'%s' does not exist or is not a directory")


    # -- Convenience methods for commands ------------------------------

    def get_command_name(self):
        if hasattr(self, 'command_name'):
            return self.command_name
        else:
            return self.__class__.__name__

    def set_undefined_options(self, src_cmd, *option_pairs):
        """Set the values of any "undefined" options from corresponding
        option values in some other command object.  "Undefined" here means
        "is None", which is the convention used to indicate that an option
        has not been changed between 'initialize_options()' and
        'finalize_options()'.  Usually called from 'finalize_options()' for
        options that depend on some other command rather than another
        option of the same command.  'src_cmd' is the other command from
        which option values will be taken (a command object will be created
        for it if necessary); the remaining arguments are
        '(src_option,dst_option)' tuples which mean "take the value of
        'src_option' in the 'src_cmd' command object, and copy it to
        'dst_option' in the current command object".
        """
        # Option_pairs: list of (src_option, dst_option) tuples
        src_cmd_obj = self.distribution.get_command_obj(src_cmd)
        src_cmd_obj.ensure_finalized()
        for (src_option, dst_option) in option_pairs:
            if getattr(self, dst_option) is None:
                setattr(self, dst_option, getattr(src_cmd_obj, src_option))

    def get_finalized_command(self, command, create=1):
        """Wrapper around Distribution's 'get_command_obj()' method: find
        (create if necessary and 'create' is true) the command object for
        'command', call its 'ensure_finalized()' method, and return the
        finalized command object.
        """
        cmd_obj = self.distribution.get_command_obj(command, create)
        cmd_obj.ensure_finalized()
        return cmd_obj

    # XXX rename to 'get_reinitialized_command()'? (should do the
    # same in dist.py, if so)
    def reinitialize_command(self, command, reinit_subcommands=0):
        return self.distribution.reinitialize_command(command,
                                                      reinit_subcommands)

    def run_command(self, command):
        """Run some other command: uses the 'run_command()' method of
        Distribution, which creates and finalizes the command object if
        necessary and then invokes its 'run()' method.
        """
        self.distribution.run_command(command)

    def get_sub_commands(self):
        """Determine the sub-commands that are relevant in the current
        distribution (ie., that need to be run).  This is based on the
        'sub_commands' class attribute: each tuple in that list may include
        a method that we call to determine if the subcommand needs to be
        run for the current distribution.  Return a list of command names.
        """
        commands = []
        for (cmd_name, method) in self.sub_commands:
            if method is None or method(self):
                commands.append(cmd_name)
        return commands


    # -- External world manipulation -----------------------------------

    def warn(self, msg):
        log.warn("warning: %s: %s\n", self.get_command_name(), msg)

    def execute(self, func, args, msg=None, level=1):
        util.execute(func, args, msg, dry_run=self.dry_run)

    def mkpath(self, name, mode=0o777):
        dir_util.mkpath(name, mode, dry_run=self.dry_run)

    def copy_file(self, infile, outfile, preserve_mode=1, preserve_times=1,
                  link=None, level=1):
        """Copy a file respecting verbose, dry-run and force flags.  (The
        former two default to whatever is in the Distribution object, and
        the latter defaults to false for commands that don't define it.)"""
        return file_util.copy_file(infile, outfile, preserve_mode,
                                   preserve_times, not self.force, link,
                                   dry_run=self.dry_run)

    def copy_tree(self, infile, outfile, preserve_mode=1, preserve_times=1,
                   preserve_symlinks=0, level=1):
        """Copy an entire directory tree respecting verbose, dry-run,
        and force flags.
        """
        return dir_util.copy_tree(infile, outfile, preserve_mode,
                                  preserve_times, preserve_symlinks,
                                  not self.force, dry_run=self.dry_run)

    def move_file (self, src, dst, level=1):
        """Move a file respecting dry-run flag."""
        return file_util.move_file(src, dst, dry_run=self.dry_run)

    def spawn(self, cmd, search_path=1, level=1):
        """Spawn an external command respecting dry-run flag."""
        from distutils.spawn import spawn
        spawn(cmd, search_path, dry_run=self.dry_run)

    def make_archive(self, base_name, format, root_dir=None, base_dir=None,
                     owner=None, group=None):
        return archive_util.make_archive(base_name, format, root_dir, base_dir,
                                         dry_run=self.dry_run,
                                         owner=owner, group=group)

    def make_file(self, infiles, outfile, func, args,
                  exec_msg=None, skip_msg=None, level=1):
        """Special case of 'execute()' for operations that process one or
        more input files and generate one output file.  Works just like
        'execute()', except the operation is skipped and a different
        message printed if 'outfile' already exists and is newer than all
        files listed in 'infiles'.  If the command defined 'self.force',
        and it is true, then the command is unconditionally run -- does no
        timestamp checks.
        """
        if skip_msg is None:
            skip_msg = "skipping %s (inputs unchanged)" % outfile

        # Allow 'infiles' to be a single string
        if isinstance(infiles, str):
            infiles = (infiles,)
        elif not isinstance(infiles, (list, tuple)):
            raise TypeError(
                  "'infiles' must be a string, or a list or tuple of strings")

        if exec_msg is None:
            exec_msg = "generating %s from %s" % (outfile, ', '.join(infiles))

        # If 'outfile' must be regenerated (either because it doesn't
        # exist, is out-of-date, or the 'force' flag is true) then
        # perform the action that presumably regenerates it
        if self.force or dep_util.newer_group(infiles, outfile):
            self.execute(func, args, exec_msg, level)
        # Otherwise, print the "skip" message
        else:
            log.debug(skip_msg)
distutils/fancy_getopt.py000064400000042570151153537440011644 0ustar00"""distutils.fancy_getopt

Wrapper around the standard getopt module that provides the following
additional features:
  * short and long options are tied together
  * options have help strings, so fancy_getopt could potentially
    create a complete usage summary
  * options set attributes of a passed-in object
"""

import sys, string, re
import getopt
from distutils.errors import *

# Much like command_re in distutils.core, this is close to but not quite
# the same as a Python NAME -- except, in the spirit of most GNU
# utilities, we use '-' in place of '_'.  (The spirit of LISP lives on!)
# The similarities to NAME are again not a coincidence...
longopt_pat = r'[a-zA-Z](?:[a-zA-Z0-9-]*)'
longopt_re = re.compile(r'^%s$' % longopt_pat)

# For recognizing "negative alias" options, eg. "quiet=!verbose"
neg_alias_re = re.compile("^(%s)=!(%s)$" % (longopt_pat, longopt_pat))

# This is used to translate long options to legitimate Python identifiers
# (for use as attributes of some object).
longopt_xlate = str.maketrans('-', '_')

class FancyGetopt:
    """Wrapper around the standard 'getopt()' module that provides some
    handy extra functionality:
      * short and long options are tied together
      * options have help strings, and help text can be assembled
        from them
      * options set attributes of a passed-in object
      * boolean options can have "negative aliases" -- eg. if
        --quiet is the "negative alias" of --verbose, then "--quiet"
        on the command line sets 'verbose' to false
    """

    def __init__(self, option_table=None):
        # The option table is (currently) a list of tuples.  The
        # tuples may have 3 or four values:
        #   (long_option, short_option, help_string [, repeatable])
        # if an option takes an argument, its long_option should have '='
        # appended; short_option should just be a single character, no ':'
        # in any case.  If a long_option doesn't have a corresponding
        # short_option, short_option should be None.  All option tuples
        # must have long options.
        self.option_table = option_table

        # 'option_index' maps long option names to entries in the option
        # table (ie. those 3-tuples).
        self.option_index = {}
        if self.option_table:
            self._build_index()

        # 'alias' records (duh) alias options; {'foo': 'bar'} means
        # --foo is an alias for --bar
        self.alias = {}

        # 'negative_alias' keeps track of options that are the boolean
        # opposite of some other option
        self.negative_alias = {}

        # These keep track of the information in the option table.  We
        # don't actually populate these structures until we're ready to
        # parse the command-line, since the 'option_table' passed in here
        # isn't necessarily the final word.
        self.short_opts = []
        self.long_opts = []
        self.short2long = {}
        self.attr_name = {}
        self.takes_arg = {}

        # And 'option_order' is filled up in 'getopt()'; it records the
        # original order of options (and their values) on the command-line,
        # but expands short options, converts aliases, etc.
        self.option_order = []

    def _build_index(self):
        self.option_index.clear()
        for option in self.option_table:
            self.option_index[option[0]] = option

    def set_option_table(self, option_table):
        self.option_table = option_table
        self._build_index()

    def add_option(self, long_option, short_option=None, help_string=None):
        if long_option in self.option_index:
            raise DistutilsGetoptError(
                  "option conflict: already an option '%s'" % long_option)
        else:
            option = (long_option, short_option, help_string)
            self.option_table.append(option)
            self.option_index[long_option] = option

    def has_option(self, long_option):
        """Return true if the option table for this parser has an
        option with long name 'long_option'."""
        return long_option in self.option_index

    def get_attr_name(self, long_option):
        """Translate long option name 'long_option' to the form it
        has as an attribute of some object: ie., translate hyphens
        to underscores."""
        return long_option.translate(longopt_xlate)

    def _check_alias_dict(self, aliases, what):
        assert isinstance(aliases, dict)
        for (alias, opt) in aliases.items():
            if alias not in self.option_index:
                raise DistutilsGetoptError(("invalid %s '%s': "
                       "option '%s' not defined") % (what, alias, alias))
            if opt not in self.option_index:
                raise DistutilsGetoptError(("invalid %s '%s': "
                       "aliased option '%s' not defined") % (what, alias, opt))

    def set_aliases(self, alias):
        """Set the aliases for this option parser."""
        self._check_alias_dict(alias, "alias")
        self.alias = alias

    def set_negative_aliases(self, negative_alias):
        """Set the negative aliases for this option parser.
        'negative_alias' should be a dictionary mapping option names to
        option names, both the key and value must already be defined
        in the option table."""
        self._check_alias_dict(negative_alias, "negative alias")
        self.negative_alias = negative_alias

    def _grok_option_table(self):
        """Populate the various data structures that keep tabs on the
        option table.  Called by 'getopt()' before it can do anything
        worthwhile.
        """
        self.long_opts = []
        self.short_opts = []
        self.short2long.clear()
        self.repeat = {}

        for option in self.option_table:
            if len(option) == 3:
                long, short, help = option
                repeat = 0
            elif len(option) == 4:
                long, short, help, repeat = option
            else:
                # the option table is part of the code, so simply
                # assert that it is correct
                raise ValueError("invalid option tuple: %r" % (option,))

            # Type- and value-check the option names
            if not isinstance(long, str) or len(long) < 2:
                raise DistutilsGetoptError(("invalid long option '%s': "
                       "must be a string of length >= 2") % long)

            if (not ((short is None) or
                     (isinstance(short, str) and len(short) == 1))):
                raise DistutilsGetoptError("invalid short option '%s': "
                       "must a single character or None" % short)

            self.repeat[long] = repeat
            self.long_opts.append(long)

            if long[-1] == '=':             # option takes an argument?
                if short: short = short + ':'
                long = long[0:-1]
                self.takes_arg[long] = 1
            else:
                # Is option is a "negative alias" for some other option (eg.
                # "quiet" == "!verbose")?
                alias_to = self.negative_alias.get(long)
                if alias_to is not None:
                    if self.takes_arg[alias_to]:
                        raise DistutilsGetoptError(
                              "invalid negative alias '%s': "
                              "aliased option '%s' takes a value"
                              % (long, alias_to))

                    self.long_opts[-1] = long # XXX redundant?!
                self.takes_arg[long] = 0

            # If this is an alias option, make sure its "takes arg" flag is
            # the same as the option it's aliased to.
            alias_to = self.alias.get(long)
            if alias_to is not None:
                if self.takes_arg[long] != self.takes_arg[alias_to]:
                    raise DistutilsGetoptError(
                          "invalid alias '%s': inconsistent with "
                          "aliased option '%s' (one of them takes a value, "
                          "the other doesn't"
                          % (long, alias_to))

            # Now enforce some bondage on the long option name, so we can
            # later translate it to an attribute name on some object.  Have
            # to do this a bit late to make sure we've removed any trailing
            # '='.
            if not longopt_re.match(long):
                raise DistutilsGetoptError(
                       "invalid long option name '%s' "
                       "(must be letters, numbers, hyphens only" % long)

            self.attr_name[long] = self.get_attr_name(long)
            if short:
                self.short_opts.append(short)
                self.short2long[short[0]] = long

    def getopt(self, args=None, object=None):
        """Parse command-line options in args. Store as attributes on object.

        If 'args' is None or not supplied, uses 'sys.argv[1:]'.  If
        'object' is None or not supplied, creates a new OptionDummy
        object, stores option values there, and returns a tuple (args,
        object).  If 'object' is supplied, it is modified in place and
        'getopt()' just returns 'args'; in both cases, the returned
        'args' is a modified copy of the passed-in 'args' list, which
        is left untouched.
        """
        if args is None:
            args = sys.argv[1:]
        if object is None:
            object = OptionDummy()
            created_object = True
        else:
            created_object = False

        self._grok_option_table()

        short_opts = ' '.join(self.short_opts)
        try:
            opts, args = getopt.getopt(args, short_opts, self.long_opts)
        except getopt.error as msg:
            raise DistutilsArgError(msg)

        for opt, val in opts:
            if len(opt) == 2 and opt[0] == '-': # it's a short option
                opt = self.short2long[opt[1]]
            else:
                assert len(opt) > 2 and opt[:2] == '--'
                opt = opt[2:]

            alias = self.alias.get(opt)
            if alias:
                opt = alias

            if not self.takes_arg[opt]:     # boolean option?
                assert val == '', "boolean option can't have value"
                alias = self.negative_alias.get(opt)
                if alias:
                    opt = alias
                    val = 0
                else:
                    val = 1

            attr = self.attr_name[opt]
            # The only repeating option at the moment is 'verbose'.
            # It has a negative option -q quiet, which should set verbose = 0.
            if val and self.repeat.get(attr) is not None:
                val = getattr(object, attr, 0) + 1
            setattr(object, attr, val)
            self.option_order.append((opt, val))

        # for opts
        if created_object:
            return args, object
        else:
            return args

    def get_option_order(self):
        """Returns the list of (option, value) tuples processed by the
        previous run of 'getopt()'.  Raises RuntimeError if
        'getopt()' hasn't been called yet.
        """
        if self.option_order is None:
            raise RuntimeError("'getopt()' hasn't been called yet")
        else:
            return self.option_order

    def generate_help(self, header=None):
        """Generate help text (a list of strings, one per suggested line of
        output) from the option table for this FancyGetopt object.
        """
        # Blithely assume the option table is good: probably wouldn't call
        # 'generate_help()' unless you've already called 'getopt()'.

        # First pass: determine maximum length of long option names
        max_opt = 0
        for option in self.option_table:
            long = option[0]
            short = option[1]
            l = len(long)
            if long[-1] == '=':
                l = l - 1
            if short is not None:
                l = l + 5                   # " (-x)" where short == 'x'
            if l > max_opt:
                max_opt = l

        opt_width = max_opt + 2 + 2 + 2     # room for indent + dashes + gutter

        # Typical help block looks like this:
        #   --foo       controls foonabulation
        # Help block for longest option looks like this:
        #   --flimflam  set the flim-flam level
        # and with wrapped text:
        #   --flimflam  set the flim-flam level (must be between
        #               0 and 100, except on Tuesdays)
        # Options with short names will have the short name shown (but
        # it doesn't contribute to max_opt):
        #   --foo (-f)  controls foonabulation
        # If adding the short option would make the left column too wide,
        # we push the explanation off to the next line
        #   --flimflam (-l)
        #               set the flim-flam level
        # Important parameters:
        #   - 2 spaces before option block start lines
        #   - 2 dashes for each long option name
        #   - min. 2 spaces between option and explanation (gutter)
        #   - 5 characters (incl. space) for short option name

        # Now generate lines of help text.  (If 80 columns were good enough
        # for Jesus, then 78 columns are good enough for me!)
        line_width = 78
        text_width = line_width - opt_width
        big_indent = ' ' * opt_width
        if header:
            lines = [header]
        else:
            lines = ['Option summary:']

        for option in self.option_table:
            long, short, help = option[:3]
            text = wrap_text(help, text_width)
            if long[-1] == '=':
                long = long[0:-1]

            # Case 1: no short option at all (makes life easy)
            if short is None:
                if text:
                    lines.append("  --%-*s  %s" % (max_opt, long, text[0]))
                else:
                    lines.append("  --%-*s  " % (max_opt, long))

            # Case 2: we have a short option, so we have to include it
            # just after the long option
            else:
                opt_names = "%s (-%s)" % (long, short)
                if text:
                    lines.append("  --%-*s  %s" %
                                 (max_opt, opt_names, text[0]))
                else:
                    lines.append("  --%-*s" % opt_names)

            for l in text[1:]:
                lines.append(big_indent + l)
        return lines

    def print_help(self, header=None, file=None):
        if file is None:
            file = sys.stdout
        for line in self.generate_help(header):
            file.write(line + "\n")


def fancy_getopt(options, negative_opt, object, args):
    parser = FancyGetopt(options)
    parser.set_negative_aliases(negative_opt)
    return parser.getopt(args, object)


WS_TRANS = {ord(_wschar) : ' ' for _wschar in string.whitespace}

def wrap_text(text, width):
    """wrap_text(text : string, width : int) -> [string]

    Split 'text' into multiple lines of no more than 'width' characters
    each, and return the list of strings that results.
    """
    if text is None:
        return []
    if len(text) <= width:
        return [text]

    text = text.expandtabs()
    text = text.translate(WS_TRANS)
    chunks = re.split(r'( +|-+)', text)
    chunks = [ch for ch in chunks if ch] # ' - ' results in empty strings
    lines = []

    while chunks:
        cur_line = []                   # list of chunks (to-be-joined)
        cur_len = 0                     # length of current line

        while chunks:
            l = len(chunks[0])
            if cur_len + l <= width:    # can squeeze (at least) this chunk in
                cur_line.append(chunks[0])
                del chunks[0]
                cur_len = cur_len + l
            else:                       # this line is full
                # drop last chunk if all space
                if cur_line and cur_line[-1][0] == ' ':
                    del cur_line[-1]
                break

        if chunks:                      # any chunks left to process?
            # if the current line is still empty, then we had a single
            # chunk that's too big too fit on a line -- so we break
            # down and break it up at the line width
            if cur_len == 0:
                cur_line.append(chunks[0][0:width])
                chunks[0] = chunks[0][width:]

            # all-whitespace chunks at the end of a line can be discarded
            # (and we know from the re.split above that if a chunk has
            # *any* whitespace, it is *all* whitespace)
            if chunks[0][0] == ' ':
                del chunks[0]

        # and store this line in the list-of-all-lines -- as a single
        # string, of course!
        lines.append(''.join(cur_line))

    return lines


def translate_longopt(opt):
    """Convert a long option name to a valid Python identifier by
    changing "-" to "_".
    """
    return opt.translate(longopt_xlate)


class OptionDummy:
    """Dummy class just used as a place to hold command-line option
    values as instance attributes."""

    def __init__(self, options=[]):
        """Create a new OptionDummy instance.  The attributes listed in
        'options' will be initialized to None."""
        for opt in options:
            setattr(self, opt, None)


if __name__ == "__main__":
    text = """\
Tra-la-la, supercalifragilisticexpialidocious.
How *do* you spell that odd word, anyways?
(Someone ask Mary -- she'll know [or she'll
say, "How should I know?"].)"""

    for w in (10, 20, 30, 40):
        print("width: %d" % w)
        print("\n".join(wrap_text(text, w)))
        print()
distutils/filelist.py000064400000031040151153537440010763 0ustar00"""distutils.filelist

Provides the FileList class, used for poking about the filesystem
and building lists of files.
"""

import os, re
import fnmatch
import functools
from distutils.util import convert_path
from distutils.errors import DistutilsTemplateError, DistutilsInternalError
from distutils import log

class FileList:
    """A list of files built by on exploring the filesystem and filtered by
    applying various patterns to what we find there.

    Instance attributes:
      dir
        directory from which files will be taken -- only used if
        'allfiles' not supplied to constructor
      files
        list of filenames currently being built/filtered/manipulated
      allfiles
        complete list of files under consideration (ie. without any
        filtering applied)
    """

    def __init__(self, warn=None, debug_print=None):
        # ignore argument to FileList, but keep them for backwards
        # compatibility
        self.allfiles = None
        self.files = []

    def set_allfiles(self, allfiles):
        self.allfiles = allfiles

    def findall(self, dir=os.curdir):
        self.allfiles = findall(dir)

    def debug_print(self, msg):
        """Print 'msg' to stdout if the global DEBUG (taken from the
        DISTUTILS_DEBUG environment variable) flag is true.
        """
        from distutils.debug import DEBUG
        if DEBUG:
            print(msg)

    # -- List-like methods ---------------------------------------------

    def append(self, item):
        self.files.append(item)

    def extend(self, items):
        self.files.extend(items)

    def sort(self):
        # Not a strict lexical sort!
        sortable_files = sorted(map(os.path.split, self.files))
        self.files = []
        for sort_tuple in sortable_files:
            self.files.append(os.path.join(*sort_tuple))


    # -- Other miscellaneous utility methods ---------------------------

    def remove_duplicates(self):
        # Assumes list has been sorted!
        for i in range(len(self.files) - 1, 0, -1):
            if self.files[i] == self.files[i - 1]:
                del self.files[i]


    # -- "File template" methods ---------------------------------------

    def _parse_template_line(self, line):
        words = line.split()
        action = words[0]

        patterns = dir = dir_pattern = None

        if action in ('include', 'exclude',
                      'global-include', 'global-exclude'):
            if len(words) < 2:
                raise DistutilsTemplateError(
                      "'%s' expects <pattern1> <pattern2> ..." % action)
            patterns = [convert_path(w) for w in words[1:]]
        elif action in ('recursive-include', 'recursive-exclude'):
            if len(words) < 3:
                raise DistutilsTemplateError(
                      "'%s' expects <dir> <pattern1> <pattern2> ..." % action)
            dir = convert_path(words[1])
            patterns = [convert_path(w) for w in words[2:]]
        elif action in ('graft', 'prune'):
            if len(words) != 2:
                raise DistutilsTemplateError(
                      "'%s' expects a single <dir_pattern>" % action)
            dir_pattern = convert_path(words[1])
        else:
            raise DistutilsTemplateError("unknown action '%s'" % action)

        return (action, patterns, dir, dir_pattern)

    def process_template_line(self, line):
        # Parse the line: split it up, make sure the right number of words
        # is there, and return the relevant words.  'action' is always
        # defined: it's the first word of the line.  Which of the other
        # three are defined depends on the action; it'll be either
        # patterns, (dir and patterns), or (dir_pattern).
        (action, patterns, dir, dir_pattern) = self._parse_template_line(line)

        # OK, now we know that the action is valid and we have the
        # right number of words on the line for that action -- so we
        # can proceed with minimal error-checking.
        if action == 'include':
            self.debug_print("include " + ' '.join(patterns))
            for pattern in patterns:
                if not self.include_pattern(pattern, anchor=1):
                    log.warn("warning: no files found matching '%s'",
                             pattern)

        elif action == 'exclude':
            self.debug_print("exclude " + ' '.join(patterns))
            for pattern in patterns:
                if not self.exclude_pattern(pattern, anchor=1):
                    log.warn(("warning: no previously-included files "
                              "found matching '%s'"), pattern)

        elif action == 'global-include':
            self.debug_print("global-include " + ' '.join(patterns))
            for pattern in patterns:
                if not self.include_pattern(pattern, anchor=0):
                    log.warn(("warning: no files found matching '%s' "
                              "anywhere in distribution"), pattern)

        elif action == 'global-exclude':
            self.debug_print("global-exclude " + ' '.join(patterns))
            for pattern in patterns:
                if not self.exclude_pattern(pattern, anchor=0):
                    log.warn(("warning: no previously-included files matching "
                              "'%s' found anywhere in distribution"),
                             pattern)

        elif action == 'recursive-include':
            self.debug_print("recursive-include %s %s" %
                             (dir, ' '.join(patterns)))
            for pattern in patterns:
                if not self.include_pattern(pattern, prefix=dir):
                    log.warn(("warning: no files found matching '%s' "
                                "under directory '%s'"),
                             pattern, dir)

        elif action == 'recursive-exclude':
            self.debug_print("recursive-exclude %s %s" %
                             (dir, ' '.join(patterns)))
            for pattern in patterns:
                if not self.exclude_pattern(pattern, prefix=dir):
                    log.warn(("warning: no previously-included files matching "
                              "'%s' found under directory '%s'"),
                             pattern, dir)

        elif action == 'graft':
            self.debug_print("graft " + dir_pattern)
            if not self.include_pattern(None, prefix=dir_pattern):
                log.warn("warning: no directories found matching '%s'",
                         dir_pattern)

        elif action == 'prune':
            self.debug_print("prune " + dir_pattern)
            if not self.exclude_pattern(None, prefix=dir_pattern):
                log.warn(("no previously-included directories found "
                          "matching '%s'"), dir_pattern)
        else:
            raise DistutilsInternalError(
                  "this cannot happen: invalid action '%s'" % action)


    # -- Filtering/selection methods -----------------------------------

    def include_pattern(self, pattern, anchor=1, prefix=None, is_regex=0):
        """Select strings (presumably filenames) from 'self.files' that
        match 'pattern', a Unix-style wildcard (glob) pattern.  Patterns
        are not quite the same as implemented by the 'fnmatch' module: '*'
        and '?'  match non-special characters, where "special" is platform-
        dependent: slash on Unix; colon, slash, and backslash on
        DOS/Windows; and colon on Mac OS.

        If 'anchor' is true (the default), then the pattern match is more
        stringent: "*.py" will match "foo.py" but not "foo/bar.py".  If
        'anchor' is false, both of these will match.

        If 'prefix' is supplied, then only filenames starting with 'prefix'
        (itself a pattern) and ending with 'pattern', with anything in between
        them, will match.  'anchor' is ignored in this case.

        If 'is_regex' is true, 'anchor' and 'prefix' are ignored, and
        'pattern' is assumed to be either a string containing a regex or a
        regex object -- no translation is done, the regex is just compiled
        and used as-is.

        Selected strings will be added to self.files.

        Return True if files are found, False otherwise.
        """
        # XXX docstring lying about what the special chars are?
        files_found = False
        pattern_re = translate_pattern(pattern, anchor, prefix, is_regex)
        self.debug_print("include_pattern: applying regex r'%s'" %
                         pattern_re.pattern)

        # delayed loading of allfiles list
        if self.allfiles is None:
            self.findall()

        for name in self.allfiles:
            if pattern_re.search(name):
                self.debug_print(" adding " + name)
                self.files.append(name)
                files_found = True
        return files_found


    def exclude_pattern (self, pattern,
                         anchor=1, prefix=None, is_regex=0):
        """Remove strings (presumably filenames) from 'files' that match
        'pattern'.  Other parameters are the same as for
        'include_pattern()', above.
        The list 'self.files' is modified in place.
        Return True if files are found, False otherwise.
        """
        files_found = False
        pattern_re = translate_pattern(pattern, anchor, prefix, is_regex)
        self.debug_print("exclude_pattern: applying regex r'%s'" %
                         pattern_re.pattern)
        for i in range(len(self.files)-1, -1, -1):
            if pattern_re.search(self.files[i]):
                self.debug_print(" removing " + self.files[i])
                del self.files[i]
                files_found = True
        return files_found


# ----------------------------------------------------------------------
# Utility functions

def _find_all_simple(path):
    """
    Find all files under 'path'
    """
    results = (
        os.path.join(base, file)
        for base, dirs, files in os.walk(path, followlinks=True)
        for file in files
    )
    return filter(os.path.isfile, results)


def findall(dir=os.curdir):
    """
    Find all files under 'dir' and return the list of full filenames.
    Unless dir is '.', return full filenames with dir prepended.
    """
    files = _find_all_simple(dir)
    if dir == os.curdir:
        make_rel = functools.partial(os.path.relpath, start=dir)
        files = map(make_rel, files)
    return list(files)


def glob_to_re(pattern):
    """Translate a shell-like glob pattern to a regular expression; return
    a string containing the regex.  Differs from 'fnmatch.translate()' in
    that '*' does not match "special characters" (which are
    platform-specific).
    """
    pattern_re = fnmatch.translate(pattern)

    # '?' and '*' in the glob pattern become '.' and '.*' in the RE, which
    # IMHO is wrong -- '?' and '*' aren't supposed to match slash in Unix,
    # and by extension they shouldn't match such "special characters" under
    # any OS.  So change all non-escaped dots in the RE to match any
    # character except the special characters (currently: just os.sep).
    sep = os.sep
    if os.sep == '\\':
        # we're using a regex to manipulate a regex, so we need
        # to escape the backslash twice
        sep = r'\\\\'
    escaped = r'\1[^%s]' % sep
    pattern_re = re.sub(r'((?<!\\)(\\\\)*)\.', escaped, pattern_re)
    return pattern_re


def translate_pattern(pattern, anchor=1, prefix=None, is_regex=0):
    """Translate a shell-like wildcard pattern to a compiled regular
    expression.  Return the compiled regex.  If 'is_regex' true,
    then 'pattern' is directly compiled to a regex (if it's a string)
    or just returned as-is (assumes it's a regex object).
    """
    if is_regex:
        if isinstance(pattern, str):
            return re.compile(pattern)
        else:
            return pattern

    # ditch start and end characters
    start, _, end = glob_to_re('_').partition('_')

    if pattern:
        pattern_re = glob_to_re(pattern)
        assert pattern_re.startswith(start) and pattern_re.endswith(end)
    else:
        pattern_re = ''

    if prefix is not None:
        prefix_re = glob_to_re(prefix)
        assert prefix_re.startswith(start) and prefix_re.endswith(end)
        prefix_re = prefix_re[len(start): len(prefix_re) - len(end)]
        sep = os.sep
        if os.sep == '\\':
            sep = r'\\'
        pattern_re = pattern_re[len(start): len(pattern_re) - len(end)]
        pattern_re = r'%s\A%s%s.*%s%s' % (start, prefix_re, sep, pattern_re, end)
    else:                               # no prefix -- respect anchor flag
        if anchor:
            pattern_re = r'%s\A%s' % (start, pattern_re[len(start):])

    return re.compile(pattern_re)
distutils/config.py000064400000011333151153537440010420 0ustar00"""distutils.pypirc

Provides the PyPIRCCommand class, the base class for the command classes
that uses .pypirc in the distutils.command package.
"""
import os
from configparser import RawConfigParser

from distutils.cmd import Command

DEFAULT_PYPIRC = """\
[distutils]
index-servers =
    pypi

[pypi]
username:%s
password:%s
"""

class PyPIRCCommand(Command):
    """Base command that knows how to handle the .pypirc file
    """
    DEFAULT_REPOSITORY = 'https://upload.pypi.org/legacy/'
    DEFAULT_REALM = 'pypi'
    repository = None
    realm = None

    user_options = [
        ('repository=', 'r',
         "url of repository [default: %s]" % \
            DEFAULT_REPOSITORY),
        ('show-response', None,
         'display full response text from server')]

    boolean_options = ['show-response']

    def _get_rc_file(self):
        """Returns rc file path."""
        return os.path.join(os.path.expanduser('~'), '.pypirc')

    def _store_pypirc(self, username, password):
        """Creates a default .pypirc file."""
        rc = self._get_rc_file()
        with os.fdopen(os.open(rc, os.O_CREAT | os.O_WRONLY, 0o600), 'w') as f:
            f.write(DEFAULT_PYPIRC % (username, password))

    def _read_pypirc(self):
        """Reads the .pypirc file."""
        rc = self._get_rc_file()
        if os.path.exists(rc):
            self.announce('Using PyPI login from %s' % rc)
            repository = self.repository or self.DEFAULT_REPOSITORY

            config = RawConfigParser()
            config.read(rc)
            sections = config.sections()
            if 'distutils' in sections:
                # let's get the list of servers
                index_servers = config.get('distutils', 'index-servers')
                _servers = [server.strip() for server in
                            index_servers.split('\n')
                            if server.strip() != '']
                if _servers == []:
                    # nothing set, let's try to get the default pypi
                    if 'pypi' in sections:
                        _servers = ['pypi']
                    else:
                        # the file is not properly defined, returning
                        # an empty dict
                        return {}
                for server in _servers:
                    current = {'server': server}
                    current['username'] = config.get(server, 'username')

                    # optional params
                    for key, default in (('repository',
                                          self.DEFAULT_REPOSITORY),
                                         ('realm', self.DEFAULT_REALM),
                                         ('password', None)):
                        if config.has_option(server, key):
                            current[key] = config.get(server, key)
                        else:
                            current[key] = default

                    # work around people having "repository" for the "pypi"
                    # section of their config set to the HTTP (rather than
                    # HTTPS) URL
                    if (server == 'pypi' and
                        repository in (self.DEFAULT_REPOSITORY, 'pypi')):
                        current['repository'] = self.DEFAULT_REPOSITORY
                        return current

                    if (current['server'] == repository or
                        current['repository'] == repository):
                        return current
            elif 'server-login' in sections:
                # old format
                server = 'server-login'
                if config.has_option(server, 'repository'):
                    repository = config.get(server, 'repository')
                else:
                    repository = self.DEFAULT_REPOSITORY
                return {'username': config.get(server, 'username'),
                        'password': config.get(server, 'password'),
                        'repository': repository,
                        'server': server,
                        'realm': self.DEFAULT_REALM}

        return {}

    def _read_pypi_response(self, response):
        """Read and decode a PyPI HTTP response."""
        import cgi
        content_type = response.getheader('content-type', 'text/plain')
        encoding = cgi.parse_header(content_type)[1].get('charset', 'ascii')
        return response.read().decode(encoding)

    def initialize_options(self):
        """Initialize options."""
        self.repository = None
        self.realm = None
        self.show_response = 0

    def finalize_options(self):
        """Finalizes options."""
        if self.repository is None:
            self.repository = self.DEFAULT_REPOSITORY
        if self.realm is None:
            self.realm = self.DEFAULT_REALM
distutils/bcppcompiler.py000064400000035127151153537440011641 0ustar00"""distutils.bcppcompiler

Contains BorlandCCompiler, an implementation of the abstract CCompiler class
for the Borland C++ compiler.
"""

# This implementation by Lyle Johnson, based on the original msvccompiler.py
# module and using the directions originally published by Gordon Williams.

# XXX looks like there's a LOT of overlap between these two classes:
# someone should sit down and factor out the common code as
# WindowsCCompiler!  --GPW


import os
from distutils.errors import \
     DistutilsExecError, DistutilsPlatformError, \
     CompileError, LibError, LinkError, UnknownFileError
from distutils.ccompiler import \
     CCompiler, gen_preprocess_options, gen_lib_options
from distutils.file_util import write_file
from distutils.dep_util import newer
from distutils import log

class BCPPCompiler(CCompiler) :
    """Concrete class that implements an interface to the Borland C/C++
    compiler, as defined by the CCompiler abstract class.
    """

    compiler_type = 'bcpp'

    # Just set this so CCompiler's constructor doesn't barf.  We currently
    # don't use the 'set_executables()' bureaucracy provided by CCompiler,
    # as it really isn't necessary for this sort of single-compiler class.
    # Would be nice to have a consistent interface with UnixCCompiler,
    # though, so it's worth thinking about.
    executables = {}

    # Private class data (need to distinguish C from C++ source for compiler)
    _c_extensions = ['.c']
    _cpp_extensions = ['.cc', '.cpp', '.cxx']

    # Needed for the filename generation methods provided by the
    # base class, CCompiler.
    src_extensions = _c_extensions + _cpp_extensions
    obj_extension = '.obj'
    static_lib_extension = '.lib'
    shared_lib_extension = '.dll'
    static_lib_format = shared_lib_format = '%s%s'
    exe_extension = '.exe'


    def __init__ (self,
                  verbose=0,
                  dry_run=0,
                  force=0):

        CCompiler.__init__ (self, verbose, dry_run, force)

        # These executables are assumed to all be in the path.
        # Borland doesn't seem to use any special registry settings to
        # indicate their installation locations.

        self.cc = "bcc32.exe"
        self.linker = "ilink32.exe"
        self.lib = "tlib.exe"

        self.preprocess_options = None
        self.compile_options = ['/tWM', '/O2', '/q', '/g0']
        self.compile_options_debug = ['/tWM', '/Od', '/q', '/g0']

        self.ldflags_shared = ['/Tpd', '/Gn', '/q', '/x']
        self.ldflags_shared_debug = ['/Tpd', '/Gn', '/q', '/x']
        self.ldflags_static = []
        self.ldflags_exe = ['/Gn', '/q', '/x']
        self.ldflags_exe_debug = ['/Gn', '/q', '/x','/r']


    # -- Worker methods ------------------------------------------------

    def compile(self, sources,
                output_dir=None, macros=None, include_dirs=None, debug=0,
                extra_preargs=None, extra_postargs=None, depends=None):

        macros, objects, extra_postargs, pp_opts, build = \
                self._setup_compile(output_dir, macros, include_dirs, sources,
                                    depends, extra_postargs)
        compile_opts = extra_preargs or []
        compile_opts.append ('-c')
        if debug:
            compile_opts.extend (self.compile_options_debug)
        else:
            compile_opts.extend (self.compile_options)

        for obj in objects:
            try:
                src, ext = build[obj]
            except KeyError:
                continue
            # XXX why do the normpath here?
            src = os.path.normpath(src)
            obj = os.path.normpath(obj)
            # XXX _setup_compile() did a mkpath() too but before the normpath.
            # Is it possible to skip the normpath?
            self.mkpath(os.path.dirname(obj))

            if ext == '.res':
                # This is already a binary file -- skip it.
                continue # the 'for' loop
            if ext == '.rc':
                # This needs to be compiled to a .res file -- do it now.
                try:
                    self.spawn (["brcc32", "-fo", obj, src])
                except DistutilsExecError as msg:
                    raise CompileError(msg)
                continue # the 'for' loop

            # The next two are both for the real compiler.
            if ext in self._c_extensions:
                input_opt = ""
            elif ext in self._cpp_extensions:
                input_opt = "-P"
            else:
                # Unknown file type -- no extra options.  The compiler
                # will probably fail, but let it just in case this is a
                # file the compiler recognizes even if we don't.
                input_opt = ""

            output_opt = "-o" + obj

            # Compiler command line syntax is: "bcc32 [options] file(s)".
            # Note that the source file names must appear at the end of
            # the command line.
            try:
                self.spawn ([self.cc] + compile_opts + pp_opts +
                            [input_opt, output_opt] +
                            extra_postargs + [src])
            except DistutilsExecError as msg:
                raise CompileError(msg)

        return objects

    # compile ()


    def create_static_lib (self,
                           objects,
                           output_libname,
                           output_dir=None,
                           debug=0,
                           target_lang=None):

        (objects, output_dir) = self._fix_object_args (objects, output_dir)
        output_filename = \
            self.library_filename (output_libname, output_dir=output_dir)

        if self._need_link (objects, output_filename):
            lib_args = [output_filename, '/u'] + objects
            if debug:
                pass                    # XXX what goes here?
            try:
                self.spawn ([self.lib] + lib_args)
            except DistutilsExecError as msg:
                raise LibError(msg)
        else:
            log.debug("skipping %s (up-to-date)", output_filename)

    # create_static_lib ()


    def link (self,
              target_desc,
              objects,
              output_filename,
              output_dir=None,
              libraries=None,
              library_dirs=None,
              runtime_library_dirs=None,
              export_symbols=None,
              debug=0,
              extra_preargs=None,
              extra_postargs=None,
              build_temp=None,
              target_lang=None):

        # XXX this ignores 'build_temp'!  should follow the lead of
        # msvccompiler.py

        (objects, output_dir) = self._fix_object_args (objects, output_dir)
        (libraries, library_dirs, runtime_library_dirs) = \
            self._fix_lib_args (libraries, library_dirs, runtime_library_dirs)

        if runtime_library_dirs:
            log.warn("I don't know what to do with 'runtime_library_dirs': %s",
                     str(runtime_library_dirs))

        if output_dir is not None:
            output_filename = os.path.join (output_dir, output_filename)

        if self._need_link (objects, output_filename):

            # Figure out linker args based on type of target.
            if target_desc == CCompiler.EXECUTABLE:
                startup_obj = 'c0w32'
                if debug:
                    ld_args = self.ldflags_exe_debug[:]
                else:
                    ld_args = self.ldflags_exe[:]
            else:
                startup_obj = 'c0d32'
                if debug:
                    ld_args = self.ldflags_shared_debug[:]
                else:
                    ld_args = self.ldflags_shared[:]


            # Create a temporary exports file for use by the linker
            if export_symbols is None:
                def_file = ''
            else:
                head, tail = os.path.split (output_filename)
                modname, ext = os.path.splitext (tail)
                temp_dir = os.path.dirname(objects[0]) # preserve tree structure
                def_file = os.path.join (temp_dir, '%s.def' % modname)
                contents = ['EXPORTS']
                for sym in (export_symbols or []):
                    contents.append('  %s=_%s' % (sym, sym))
                self.execute(write_file, (def_file, contents),
                             "writing %s" % def_file)

            # Borland C++ has problems with '/' in paths
            objects2 = map(os.path.normpath, objects)
            # split objects in .obj and .res files
            # Borland C++ needs them at different positions in the command line
            objects = [startup_obj]
            resources = []
            for file in objects2:
                (base, ext) = os.path.splitext(os.path.normcase(file))
                if ext == '.res':
                    resources.append(file)
                else:
                    objects.append(file)


            for l in library_dirs:
                ld_args.append("/L%s" % os.path.normpath(l))
            ld_args.append("/L.") # we sometimes use relative paths

            # list of object files
            ld_args.extend(objects)

            # XXX the command-line syntax for Borland C++ is a bit wonky;
            # certain filenames are jammed together in one big string, but
            # comma-delimited.  This doesn't mesh too well with the
            # Unix-centric attitude (with a DOS/Windows quoting hack) of
            # 'spawn()', so constructing the argument list is a bit
            # awkward.  Note that doing the obvious thing and jamming all
            # the filenames and commas into one argument would be wrong,
            # because 'spawn()' would quote any filenames with spaces in
            # them.  Arghghh!.  Apparently it works fine as coded...

            # name of dll/exe file
            ld_args.extend([',',output_filename])
            # no map file and start libraries
            ld_args.append(',,')

            for lib in libraries:
                # see if we find it and if there is a bcpp specific lib
                # (xxx_bcpp.lib)
                libfile = self.find_library_file(library_dirs, lib, debug)
                if libfile is None:
                    ld_args.append(lib)
                    # probably a BCPP internal library -- don't warn
                else:
                    # full name which prefers bcpp_xxx.lib over xxx.lib
                    ld_args.append(libfile)

            # some default libraries
            ld_args.append ('import32')
            ld_args.append ('cw32mt')

            # def file for export symbols
            ld_args.extend([',',def_file])
            # add resource files
            ld_args.append(',')
            ld_args.extend(resources)


            if extra_preargs:
                ld_args[:0] = extra_preargs
            if extra_postargs:
                ld_args.extend(extra_postargs)

            self.mkpath (os.path.dirname (output_filename))
            try:
                self.spawn ([self.linker] + ld_args)
            except DistutilsExecError as msg:
                raise LinkError(msg)

        else:
            log.debug("skipping %s (up-to-date)", output_filename)

    # link ()

    # -- Miscellaneous methods -----------------------------------------


    def find_library_file (self, dirs, lib, debug=0):
        # List of effective library names to try, in order of preference:
        # xxx_bcpp.lib is better than xxx.lib
        # and xxx_d.lib is better than xxx.lib if debug is set
        #
        # The "_bcpp" suffix is to handle a Python installation for people
        # with multiple compilers (primarily Distutils hackers, I suspect
        # ;-).  The idea is they'd have one static library for each
        # compiler they care about, since (almost?) every Windows compiler
        # seems to have a different format for static libraries.
        if debug:
            dlib = (lib + "_d")
            try_names = (dlib + "_bcpp", lib + "_bcpp", dlib, lib)
        else:
            try_names = (lib + "_bcpp", lib)

        for dir in dirs:
            for name in try_names:
                libfile = os.path.join(dir, self.library_filename(name))
                if os.path.exists(libfile):
                    return libfile
        else:
            # Oops, didn't find it in *any* of 'dirs'
            return None

    # overwrite the one from CCompiler to support rc and res-files
    def object_filenames (self,
                          source_filenames,
                          strip_dir=0,
                          output_dir=''):
        if output_dir is None: output_dir = ''
        obj_names = []
        for src_name in source_filenames:
            # use normcase to make sure '.rc' is really '.rc' and not '.RC'
            (base, ext) = os.path.splitext (os.path.normcase(src_name))
            if ext not in (self.src_extensions + ['.rc','.res']):
                raise UnknownFileError("unknown file type '%s' (from '%s')" % \
                      (ext, src_name))
            if strip_dir:
                base = os.path.basename (base)
            if ext == '.res':
                # these can go unchanged
                obj_names.append (os.path.join (output_dir, base + ext))
            elif ext == '.rc':
                # these need to be compiled to .res-files
                obj_names.append (os.path.join (output_dir, base + '.res'))
            else:
                obj_names.append (os.path.join (output_dir,
                                            base + self.obj_extension))
        return obj_names

    # object_filenames ()

    def preprocess (self,
                    source,
                    output_file=None,
                    macros=None,
                    include_dirs=None,
                    extra_preargs=None,
                    extra_postargs=None):

        (_, macros, include_dirs) = \
            self._fix_compile_args(None, macros, include_dirs)
        pp_opts = gen_preprocess_options(macros, include_dirs)
        pp_args = ['cpp32.exe'] + pp_opts
        if output_file is not None:
            pp_args.append('-o' + output_file)
        if extra_preargs:
            pp_args[:0] = extra_preargs
        if extra_postargs:
            pp_args.extend(extra_postargs)
        pp_args.append(source)

        # We need to preprocess: either we're being forced to, or the
        # source file is newer than the target (or the target doesn't
        # exist).
        if self.force or output_file is None or newer(source, output_file):
            if output_file:
                self.mkpath(os.path.dirname(output_file))
            try:
                self.spawn(pp_args)
            except DistutilsExecError as msg:
                print(msg)
                raise CompileError(msg)

    # preprocess()
distutils/spawn.py000064400000017243151153537440010311 0ustar00"""distutils.spawn

Provides the 'spawn()' function, a front-end to various platform-
specific functions for launching another program in a sub-process.
Also provides the 'find_executable()' to search the path for a given
executable name.
"""

import sys
import os

from distutils.errors import DistutilsPlatformError, DistutilsExecError
from distutils.debug import DEBUG
from distutils import log

def spawn(cmd, search_path=1, verbose=0, dry_run=0):
    """Run another program, specified as a command list 'cmd', in a new process.

    'cmd' is just the argument list for the new process, ie.
    cmd[0] is the program to run and cmd[1:] are the rest of its arguments.
    There is no way to run a program with a name different from that of its
    executable.

    If 'search_path' is true (the default), the system's executable
    search path will be used to find the program; otherwise, cmd[0]
    must be the exact path to the executable.  If 'dry_run' is true,
    the command will not actually be run.

    Raise DistutilsExecError if running the program fails in any way; just
    return on success.
    """
    # cmd is documented as a list, but just in case some code passes a tuple
    # in, protect our %-formatting code against horrible death
    cmd = list(cmd)
    if os.name == 'posix':
        _spawn_posix(cmd, search_path, dry_run=dry_run)
    elif os.name == 'nt':
        _spawn_nt(cmd, search_path, dry_run=dry_run)
    else:
        raise DistutilsPlatformError(
              "don't know how to spawn programs on platform '%s'" % os.name)

def _nt_quote_args(args):
    """Quote command-line arguments for DOS/Windows conventions.

    Just wraps every argument which contains blanks in double quotes, and
    returns a new argument list.
    """
    # XXX this doesn't seem very robust to me -- but if the Windows guys
    # say it'll work, I guess I'll have to accept it.  (What if an arg
    # contains quotes?  What other magic characters, other than spaces,
    # have to be escaped?  Is there an escaping mechanism other than
    # quoting?)
    for i, arg in enumerate(args):
        if ' ' in arg:
            args[i] = '"%s"' % arg
    return args

def _spawn_nt(cmd, search_path=1, verbose=0, dry_run=0):
    executable = cmd[0]
    cmd = _nt_quote_args(cmd)
    if search_path:
        # either we find one or it stays the same
        executable = find_executable(executable) or executable
    log.info(' '.join([executable] + cmd[1:]))
    if not dry_run:
        # spawn for NT requires a full path to the .exe
        try:
            rc = os.spawnv(os.P_WAIT, executable, cmd)
        except OSError as exc:
            # this seems to happen when the command isn't found
            if not DEBUG:
                cmd = executable
            raise DistutilsExecError(
                  "command %r failed: %s" % (cmd, exc.args[-1]))
        if rc != 0:
            # and this reflects the command running but failing
            if not DEBUG:
                cmd = executable
            raise DistutilsExecError(
                  "command %r failed with exit status %d" % (cmd, rc))

if sys.platform == 'darwin':
    _cfg_target = None
    _cfg_target_split = None

def _spawn_posix(cmd, search_path=1, verbose=0, dry_run=0):
    log.info(' '.join(cmd))
    if dry_run:
        return
    executable = cmd[0]
    exec_fn = search_path and os.execvp or os.execv
    env = None
    if sys.platform == 'darwin':
        global _cfg_target, _cfg_target_split
        if _cfg_target is None:
            from distutils import sysconfig
            _cfg_target = sysconfig.get_config_var(
                                  'MACOSX_DEPLOYMENT_TARGET') or ''
            if _cfg_target:
                _cfg_target_split = [int(x) for x in _cfg_target.split('.')]
        if _cfg_target:
            # ensure that the deployment target of build process is not less
            # than that used when the interpreter was built. This ensures
            # extension modules are built with correct compatibility values
            cur_target = os.environ.get('MACOSX_DEPLOYMENT_TARGET', _cfg_target)
            if _cfg_target_split > [int(x) for x in cur_target.split('.')]:
                my_msg = ('$MACOSX_DEPLOYMENT_TARGET mismatch: '
                          'now "%s" but "%s" during configure'
                                % (cur_target, _cfg_target))
                raise DistutilsPlatformError(my_msg)
            env = dict(os.environ,
                       MACOSX_DEPLOYMENT_TARGET=cur_target)
            exec_fn = search_path and os.execvpe or os.execve
    pid = os.fork()
    if pid == 0: # in the child
        try:
            if env is None:
                exec_fn(executable, cmd)
            else:
                exec_fn(executable, cmd, env)
        except OSError as e:
            if not DEBUG:
                cmd = executable
            sys.stderr.write("unable to execute %r: %s\n"
                             % (cmd, e.strerror))
            os._exit(1)

        if not DEBUG:
            cmd = executable
        sys.stderr.write("unable to execute %r for unknown reasons" % cmd)
        os._exit(1)
    else: # in the parent
        # Loop until the child either exits or is terminated by a signal
        # (ie. keep waiting if it's merely stopped)
        while True:
            try:
                pid, status = os.waitpid(pid, 0)
            except OSError as exc:
                if not DEBUG:
                    cmd = executable
                raise DistutilsExecError(
                      "command %r failed: %s" % (cmd, exc.args[-1]))
            if os.WIFSIGNALED(status):
                if not DEBUG:
                    cmd = executable
                raise DistutilsExecError(
                      "command %r terminated by signal %d"
                      % (cmd, os.WTERMSIG(status)))
            elif os.WIFEXITED(status):
                exit_status = os.WEXITSTATUS(status)
                if exit_status == 0:
                    return   # hey, it succeeded!
                else:
                    if not DEBUG:
                        cmd = executable
                    raise DistutilsExecError(
                          "command %r failed with exit status %d"
                          % (cmd, exit_status))
            elif os.WIFSTOPPED(status):
                continue
            else:
                if not DEBUG:
                    cmd = executable
                raise DistutilsExecError(
                      "unknown error executing %r: termination status %d"
                      % (cmd, status))

def find_executable(executable, path=None):
    """Tries to find 'executable' in the directories listed in 'path'.

    A string listing directories separated by 'os.pathsep'; defaults to
    os.environ['PATH'].  Returns the complete filename or None if not found.
    """
    _, ext = os.path.splitext(executable)
    if (sys.platform == 'win32') and (ext != '.exe'):
        executable = executable + '.exe'

    if os.path.isfile(executable):
        return executable

    if path is None:
        path = os.environ.get('PATH', None)
        if path is None:
            try:
                path = os.confstr("CS_PATH")
            except (AttributeError, ValueError):
                # os.confstr() or CS_PATH is not available
                path = os.defpath
        # bpo-35755: Don't use os.defpath if the PATH environment variable is
        # set to an empty string

    # PATH='' doesn't match, whereas PATH=':' looks in the current directory
    if not path:
        return None

    paths = path.split(os.pathsep)
    for p in paths:
        f = os.path.join(p, executable)
        if os.path.isfile(f):
            # the file exists, we have a shot at spawn working
            return f
    return None
distutils/debug.py000064400000000213151153537440010234 0ustar00import os

# If DISTUTILS_DEBUG is anything other than the empty string, we run in
# debug mode.
DEBUG = os.environ.get('DISTUTILS_DEBUG')
distutils/util.py000064400000050634151153537440010137 0ustar00"""distutils.util

Miscellaneous utility functions -- anything that doesn't fit into
one of the other *util.py modules.
"""

import os
import re
import importlib.util
import string
import sys
from distutils.errors import DistutilsPlatformError
from distutils.dep_util import newer
from distutils.spawn import spawn
from distutils import log
from distutils.errors import DistutilsByteCompileError

def get_host_platform():
    """Return a string that identifies the current platform.  This is used mainly to
    distinguish platform-specific build directories and platform-specific built
    distributions.  Typically includes the OS name and version and the
    architecture (as supplied by 'os.uname()'), although the exact information
    included depends on the OS; eg. on Linux, the kernel version isn't
    particularly important.

    Examples of returned values:
       linux-i586
       linux-alpha (?)
       solaris-2.6-sun4u

    Windows will return one of:
       win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc)
       win32 (all others - specifically, sys.platform is returned)

    For other non-POSIX platforms, currently just returns 'sys.platform'.

    """
    if os.name == 'nt':
        if 'amd64' in sys.version.lower():
            return 'win-amd64'
        if '(arm)' in sys.version.lower():
            return 'win-arm32'
        if '(arm64)' in sys.version.lower():
            return 'win-arm64'
        return sys.platform

    # Set for cross builds explicitly
    if "_PYTHON_HOST_PLATFORM" in os.environ:
        return os.environ["_PYTHON_HOST_PLATFORM"]

    if os.name != "posix" or not hasattr(os, 'uname'):
        # XXX what about the architecture? NT is Intel or Alpha,
        # Mac OS is M68k or PPC, etc.
        return sys.platform

    # Try to distinguish various flavours of Unix

    (osname, host, release, version, machine) = os.uname()

    # Convert the OS name to lowercase, remove '/' characters, and translate
    # spaces (for "Power Macintosh")
    osname = osname.lower().replace('/', '')
    machine = machine.replace(' ', '_')
    machine = machine.replace('/', '-')

    if osname[:5] == "linux":
        # At least on Linux/Intel, 'machine' is the processor --
        # i386, etc.
        # XXX what about Alpha, SPARC, etc?
        return  "%s-%s" % (osname, machine)
    elif osname[:5] == "sunos":
        if release[0] >= "5":           # SunOS 5 == Solaris 2
            osname = "solaris"
            release = "%d.%s" % (int(release[0]) - 3, release[2:])
            # We can't use "platform.architecture()[0]" because a
            # bootstrap problem. We use a dict to get an error
            # if some suspicious happens.
            bitness = {2147483647:"32bit", 9223372036854775807:"64bit"}
            machine += ".%s" % bitness[sys.maxsize]
        # fall through to standard osname-release-machine representation
    elif osname[:3] == "aix":
        return "%s-%s.%s" % (osname, version, release)
    elif osname[:6] == "cygwin":
        osname = "cygwin"
        rel_re = re.compile (r'[\d.]+', re.ASCII)
        m = rel_re.match(release)
        if m:
            release = m.group()
    elif osname[:6] == "darwin":
        import _osx_support, distutils.sysconfig
        osname, release, machine = _osx_support.get_platform_osx(
                                        distutils.sysconfig.get_config_vars(),
                                        osname, release, machine)

    return "%s-%s-%s" % (osname, release, machine)

def get_platform():
    if os.name == 'nt':
        TARGET_TO_PLAT = {
            'x86' : 'win32',
            'x64' : 'win-amd64',
            'arm' : 'win-arm32',
        }
        return TARGET_TO_PLAT.get(os.environ.get('VSCMD_ARG_TGT_ARCH')) or get_host_platform()
    else:
        return get_host_platform()

def convert_path (pathname):
    """Return 'pathname' as a name that will work on the native filesystem,
    i.e. split it on '/' and put it back together again using the current
    directory separator.  Needed because filenames in the setup script are
    always supplied in Unix style, and have to be converted to the local
    convention before we can actually use them in the filesystem.  Raises
    ValueError on non-Unix-ish systems if 'pathname' either starts or
    ends with a slash.
    """
    if os.sep == '/':
        return pathname
    if not pathname:
        return pathname
    if pathname[0] == '/':
        raise ValueError("path '%s' cannot be absolute" % pathname)
    if pathname[-1] == '/':
        raise ValueError("path '%s' cannot end with '/'" % pathname)

    paths = pathname.split('/')
    while '.' in paths:
        paths.remove('.')
    if not paths:
        return os.curdir
    return os.path.join(*paths)

# convert_path ()


def change_root (new_root, pathname):
    """Return 'pathname' with 'new_root' prepended.  If 'pathname' is
    relative, this is equivalent to "os.path.join(new_root,pathname)".
    Otherwise, it requires making 'pathname' relative and then joining the
    two, which is tricky on DOS/Windows and Mac OS.
    """
    if os.name == 'posix':
        if not os.path.isabs(pathname):
            return os.path.join(new_root, pathname)
        else:
            return os.path.join(new_root, pathname[1:])

    elif os.name == 'nt':
        (drive, path) = os.path.splitdrive(pathname)
        if path[0] == '\\':
            path = path[1:]
        return os.path.join(new_root, path)

    else:
        raise DistutilsPlatformError("nothing known about platform '%s'" % os.name)


_environ_checked = 0
def check_environ ():
    """Ensure that 'os.environ' has all the environment variables we
    guarantee that users can use in config files, command-line options,
    etc.  Currently this includes:
      HOME - user's home directory (Unix only)
      PLAT - description of the current platform, including hardware
             and OS (see 'get_platform()')
    """
    global _environ_checked
    if _environ_checked:
        return

    if os.name == 'posix' and 'HOME' not in os.environ:
        try:
            import pwd
            os.environ['HOME'] = pwd.getpwuid(os.getuid())[5]
        except (ImportError, KeyError):
            # bpo-10496: if the current user identifier doesn't exist in the
            # password database, do nothing
            pass

    if 'PLAT' not in os.environ:
        os.environ['PLAT'] = get_platform()

    _environ_checked = 1


def subst_vars (s, local_vars):
    """Perform shell/Perl-style variable substitution on 'string'.  Every
    occurrence of '$' followed by a name is considered a variable, and
    variable is substituted by the value found in the 'local_vars'
    dictionary, or in 'os.environ' if it's not in 'local_vars'.
    'os.environ' is first checked/augmented to guarantee that it contains
    certain values: see 'check_environ()'.  Raise ValueError for any
    variables not found in either 'local_vars' or 'os.environ'.
    """
    check_environ()
    def _subst (match, local_vars=local_vars):
        var_name = match.group(1)
        if var_name in local_vars:
            return str(local_vars[var_name])
        else:
            return os.environ[var_name]

    try:
        return re.sub(r'\$([a-zA-Z_][a-zA-Z_0-9]*)', _subst, s)
    except KeyError as var:
        raise ValueError("invalid variable '$%s'" % var)

# subst_vars ()


def grok_environment_error (exc, prefix="error: "):
    # Function kept for backward compatibility.
    # Used to try clever things with EnvironmentErrors,
    # but nowadays str(exception) produces good messages.
    return prefix + str(exc)


# Needed by 'split_quoted()'
_wordchars_re = _squote_re = _dquote_re = None
def _init_regex():
    global _wordchars_re, _squote_re, _dquote_re
    _wordchars_re = re.compile(r'[^\\\'\"%s ]*' % string.whitespace)
    _squote_re = re.compile(r"'(?:[^'\\]|\\.)*'")
    _dquote_re = re.compile(r'"(?:[^"\\]|\\.)*"')

def split_quoted (s):
    """Split a string up according to Unix shell-like rules for quotes and
    backslashes.  In short: words are delimited by spaces, as long as those
    spaces are not escaped by a backslash, or inside a quoted string.
    Single and double quotes are equivalent, and the quote characters can
    be backslash-escaped.  The backslash is stripped from any two-character
    escape sequence, leaving only the escaped character.  The quote
    characters are stripped from any quoted string.  Returns a list of
    words.
    """

    # This is a nice algorithm for splitting up a single string, since it
    # doesn't require character-by-character examination.  It was a little
    # bit of a brain-bender to get it working right, though...
    if _wordchars_re is None: _init_regex()

    s = s.strip()
    words = []
    pos = 0

    while s:
        m = _wordchars_re.match(s, pos)
        end = m.end()
        if end == len(s):
            words.append(s[:end])
            break

        if s[end] in string.whitespace: # unescaped, unquoted whitespace: now
            words.append(s[:end])       # we definitely have a word delimiter
            s = s[end:].lstrip()
            pos = 0

        elif s[end] == '\\':            # preserve whatever is being escaped;
                                        # will become part of the current word
            s = s[:end] + s[end+1:]
            pos = end+1

        else:
            if s[end] == "'":           # slurp singly-quoted string
                m = _squote_re.match(s, end)
            elif s[end] == '"':         # slurp doubly-quoted string
                m = _dquote_re.match(s, end)
            else:
                raise RuntimeError("this can't happen (bad char '%c')" % s[end])

            if m is None:
                raise ValueError("bad string (mismatched %s quotes?)" % s[end])

            (beg, end) = m.span()
            s = s[:beg] + s[beg+1:end-1] + s[end:]
            pos = m.end() - 2

        if pos >= len(s):
            words.append(s)
            break

    return words

# split_quoted ()


def execute (func, args, msg=None, verbose=0, dry_run=0):
    """Perform some action that affects the outside world (eg.  by
    writing to the filesystem).  Such actions are special because they
    are disabled by the 'dry_run' flag.  This method takes care of all
    that bureaucracy for you; all you have to do is supply the
    function to call and an argument tuple for it (to embody the
    "external action" being performed), and an optional message to
    print.
    """
    if msg is None:
        msg = "%s%r" % (func.__name__, args)
        if msg[-2:] == ',)':        # correct for singleton tuple
            msg = msg[0:-2] + ')'

    log.info(msg)
    if not dry_run:
        func(*args)


def strtobool (val):
    """Convert a string representation of truth to true (1) or false (0).

    True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values
    are 'n', 'no', 'f', 'false', 'off', and '0'.  Raises ValueError if
    'val' is anything else.
    """
    val = val.lower()
    if val in ('y', 'yes', 't', 'true', 'on', '1'):
        return 1
    elif val in ('n', 'no', 'f', 'false', 'off', '0'):
        return 0
    else:
        raise ValueError("invalid truth value %r" % (val,))


def byte_compile (py_files,
                  optimize=0, force=0,
                  prefix=None, base_dir=None,
                  verbose=1, dry_run=0,
                  direct=None):
    """Byte-compile a collection of Python source files to .pyc
    files in a __pycache__ subdirectory.  'py_files' is a list
    of files to compile; any files that don't end in ".py" are silently
    skipped.  'optimize' must be one of the following:
      0 - don't optimize
      1 - normal optimization (like "python -O")
      2 - extra optimization (like "python -OO")
    If 'force' is true, all files are recompiled regardless of
    timestamps.

    The source filename encoded in each bytecode file defaults to the
    filenames listed in 'py_files'; you can modify these with 'prefix' and
    'basedir'.  'prefix' is a string that will be stripped off of each
    source filename, and 'base_dir' is a directory name that will be
    prepended (after 'prefix' is stripped).  You can supply either or both
    (or neither) of 'prefix' and 'base_dir', as you wish.

    If 'dry_run' is true, doesn't actually do anything that would
    affect the filesystem.

    Byte-compilation is either done directly in this interpreter process
    with the standard py_compile module, or indirectly by writing a
    temporary script and executing it.  Normally, you should let
    'byte_compile()' figure out to use direct compilation or not (see
    the source for details).  The 'direct' flag is used by the script
    generated in indirect mode; unless you know what you're doing, leave
    it set to None.
    """

    # Late import to fix a bootstrap issue: _posixsubprocess is built by
    # setup.py, but setup.py uses distutils.
    import subprocess

    # nothing is done if sys.dont_write_bytecode is True
    if sys.dont_write_bytecode:
        raise DistutilsByteCompileError('byte-compiling is disabled.')

    # First, if the caller didn't force us into direct or indirect mode,
    # figure out which mode we should be in.  We take a conservative
    # approach: choose direct mode *only* if the current interpreter is
    # in debug mode and optimize is 0.  If we're not in debug mode (-O
    # or -OO), we don't know which level of optimization this
    # interpreter is running with, so we can't do direct
    # byte-compilation and be certain that it's the right thing.  Thus,
    # always compile indirectly if the current interpreter is in either
    # optimize mode, or if either optimization level was requested by
    # the caller.
    if direct is None:
        direct = (__debug__ and optimize == 0)

    # "Indirect" byte-compilation: write a temporary script and then
    # run it with the appropriate flags.
    if not direct:
        try:
            from tempfile import mkstemp
            (script_fd, script_name) = mkstemp(".py")
        except ImportError:
            from tempfile import mktemp
            (script_fd, script_name) = None, mktemp(".py")
        log.info("writing byte-compilation script '%s'", script_name)
        if not dry_run:
            if script_fd is not None:
                script = os.fdopen(script_fd, "w")
            else:
                script = open(script_name, "w")

            with script:
                script.write("""\
from distutils.util import byte_compile
files = [
""")

                # XXX would be nice to write absolute filenames, just for
                # safety's sake (script should be more robust in the face of
                # chdir'ing before running it).  But this requires abspath'ing
                # 'prefix' as well, and that breaks the hack in build_lib's
                # 'byte_compile()' method that carefully tacks on a trailing
                # slash (os.sep really) to make sure the prefix here is "just
                # right".  This whole prefix business is rather delicate -- the
                # problem is that it's really a directory, but I'm treating it
                # as a dumb string, so trailing slashes and so forth matter.

                #py_files = map(os.path.abspath, py_files)
                #if prefix:
                #    prefix = os.path.abspath(prefix)

                script.write(",\n".join(map(repr, py_files)) + "]\n")
                script.write("""
byte_compile(files, optimize=%r, force=%r,
             prefix=%r, base_dir=%r,
             verbose=%r, dry_run=0,
             direct=1)
""" % (optimize, force, prefix, base_dir, verbose))

        cmd = [sys.executable]
        cmd.extend(subprocess._optim_args_from_interpreter_flags())
        cmd.append(script_name)
        spawn(cmd, dry_run=dry_run)
        execute(os.remove, (script_name,), "removing %s" % script_name,
                dry_run=dry_run)

    # "Direct" byte-compilation: use the py_compile module to compile
    # right here, right now.  Note that the script generated in indirect
    # mode simply calls 'byte_compile()' in direct mode, a weird sort of
    # cross-process recursion.  Hey, it works!
    else:
        from py_compile import compile

        for file in py_files:
            if file[-3:] != ".py":
                # This lets us be lazy and not filter filenames in
                # the "install_lib" command.
                continue

            # Terminology from the py_compile module:
            #   cfile - byte-compiled file
            #   dfile - purported source filename (same as 'file' by default)
            if optimize >= 0:
                opt = '' if optimize == 0 else optimize
                cfile = importlib.util.cache_from_source(
                    file, optimization=opt)
            else:
                cfile = importlib.util.cache_from_source(file)
            dfile = file
            if prefix:
                if file[:len(prefix)] != prefix:
                    raise ValueError("invalid prefix: filename %r doesn't start with %r"
                           % (file, prefix))
                dfile = dfile[len(prefix):]
            if base_dir:
                dfile = os.path.join(base_dir, dfile)

            cfile_base = os.path.basename(cfile)
            if direct:
                if force or newer(file, cfile):
                    log.info("byte-compiling %s to %s", file, cfile_base)
                    if not dry_run:
                        compile(file, cfile, dfile)
                else:
                    log.debug("skipping byte-compilation of %s to %s",
                              file, cfile_base)

# byte_compile ()

def rfc822_escape (header):
    """Return a version of the string escaped for inclusion in an
    RFC-822 header, by ensuring there are 8 spaces space after each newline.
    """
    lines = header.split('\n')
    sep = '\n' + 8 * ' '
    return sep.join(lines)

# 2to3 support

def run_2to3(files, fixer_names=None, options=None, explicit=None):
    """Invoke 2to3 on a list of Python files.
    The files should all come from the build area, as the
    modification is done in-place. To reduce the build time,
    only files modified since the last invocation of this
    function should be passed in the files argument."""

    if not files:
        return

    # Make this class local, to delay import of 2to3
    from lib2to3.refactor import RefactoringTool, get_fixers_from_package
    class DistutilsRefactoringTool(RefactoringTool):
        def log_error(self, msg, *args, **kw):
            log.error(msg, *args)

        def log_message(self, msg, *args):
            log.info(msg, *args)

        def log_debug(self, msg, *args):
            log.debug(msg, *args)

    if fixer_names is None:
        fixer_names = get_fixers_from_package('lib2to3.fixes')
    r = DistutilsRefactoringTool(fixer_names, options=options)
    r.refactor(files, write=True)

def copydir_run_2to3(src, dest, template=None, fixer_names=None,
                     options=None, explicit=None):
    """Recursively copy a directory, only copying new and changed files,
    running run_2to3 over all newly copied Python modules afterward.

    If you give a template string, it's parsed like a MANIFEST.in.
    """
    from distutils.dir_util import mkpath
    from distutils.file_util import copy_file
    from distutils.filelist import FileList
    filelist = FileList()
    curdir = os.getcwd()
    os.chdir(src)
    try:
        filelist.findall()
    finally:
        os.chdir(curdir)
    filelist.files[:] = filelist.allfiles
    if template:
        for line in template.splitlines():
            line = line.strip()
            if not line: continue
            filelist.process_template_line(line)
    copied = []
    for filename in filelist.files:
        outname = os.path.join(dest, filename)
        mkpath(os.path.dirname(outname))
        res = copy_file(os.path.join(src, filename), outname, update=1)
        if res[1]: copied.append(outname)
    run_2to3([fn for fn in copied if fn.lower().endswith('.py')],
             fixer_names=fixer_names, options=options, explicit=explicit)
    return copied

class Mixin2to3:
    '''Mixin class for commands that run 2to3.
    To configure 2to3, setup scripts may either change
    the class variables, or inherit from individual commands
    to override how 2to3 is invoked.'''

    # provide list of fixers to run;
    # defaults to all from lib2to3.fixers
    fixer_names = None

    # options dictionary
    options = None

    # list of fixers to invoke even though they are marked as explicit
    explicit = None

    def run_2to3(self, files):
        return run_2to3(files, self.fixer_names, self.options, self.explicit)
distutils/__init__.py000064400000000354151153537440010713 0ustar00"""distutils

The main package for the Python Module Distribution Utilities.  Normally
used from a setup script as

   from distutils.core import setup

   setup (...)
"""

import sys

__version__ = sys.version[:sys.version.index(' ')]
distutils/command/bdist_rpm.py000064400000052111151153537440012553 0ustar00"""distutils.command.bdist_rpm

Implements the Distutils 'bdist_rpm' command (create RPM source and binary
distributions)."""

import subprocess, sys, os
from distutils.core import Command
from distutils.debug import DEBUG
from distutils.util import get_platform
from distutils.file_util import write_file
from distutils.errors import *
from distutils.sysconfig import get_python_version
from distutils import log

class bdist_rpm(Command):

    description = "create an RPM distribution"

    user_options = [
        ('bdist-base=', None,
         "base directory for creating built distributions"),
        ('rpm-base=', None,
         "base directory for creating RPMs (defaults to \"rpm\" under "
         "--bdist-base; must be specified for RPM 2)"),
        ('dist-dir=', 'd',
         "directory to put final RPM files in "
         "(and .spec files if --spec-only)"),
        ('python=', None,
         "path to Python interpreter to hard-code in the .spec file "
         "(default: \"python\")"),
        ('fix-python', None,
         "hard-code the exact path to the current Python interpreter in "
         "the .spec file"),
        ('spec-only', None,
         "only regenerate spec file"),
        ('source-only', None,
         "only generate source RPM"),
        ('binary-only', None,
         "only generate binary RPM"),
        ('use-bzip2', None,
         "use bzip2 instead of gzip to create source distribution"),

        # More meta-data: too RPM-specific to put in the setup script,
        # but needs to go in the .spec file -- so we make these options
        # to "bdist_rpm".  The idea is that packagers would put this
        # info in setup.cfg, although they are of course free to
        # supply it on the command line.
        ('distribution-name=', None,
         "name of the (Linux) distribution to which this "
         "RPM applies (*not* the name of the module distribution!)"),
        ('group=', None,
         "package classification [default: \"Development/Libraries\"]"),
        ('release=', None,
         "RPM release number"),
        ('serial=', None,
         "RPM serial number"),
        ('vendor=', None,
         "RPM \"vendor\" (eg. \"Joe Blow <joe@example.com>\") "
         "[default: maintainer or author from setup script]"),
        ('packager=', None,
         "RPM packager (eg. \"Jane Doe <jane@example.net>\") "
         "[default: vendor]"),
        ('doc-files=', None,
         "list of documentation files (space or comma-separated)"),
        ('changelog=', None,
         "RPM changelog"),
        ('icon=', None,
         "name of icon file"),
        ('provides=', None,
         "capabilities provided by this package"),
        ('requires=', None,
         "capabilities required by this package"),
        ('conflicts=', None,
         "capabilities which conflict with this package"),
        ('build-requires=', None,
         "capabilities required to build this package"),
        ('obsoletes=', None,
         "capabilities made obsolete by this package"),
        ('no-autoreq', None,
         "do not automatically calculate dependencies"),

        # Actions to take when building RPM
        ('keep-temp', 'k',
         "don't clean up RPM build directory"),
        ('no-keep-temp', None,
         "clean up RPM build directory [default]"),
        ('use-rpm-opt-flags', None,
         "compile with RPM_OPT_FLAGS when building from source RPM"),
        ('no-rpm-opt-flags', None,
         "do not pass any RPM CFLAGS to compiler"),
        ('rpm3-mode', None,
         "RPM 3 compatibility mode (default)"),
        ('rpm2-mode', None,
         "RPM 2 compatibility mode"),

        # Add the hooks necessary for specifying custom scripts
        ('prep-script=', None,
         "Specify a script for the PREP phase of RPM building"),
        ('build-script=', None,
         "Specify a script for the BUILD phase of RPM building"),

        ('pre-install=', None,
         "Specify a script for the pre-INSTALL phase of RPM building"),
        ('install-script=', None,
         "Specify a script for the INSTALL phase of RPM building"),
        ('post-install=', None,
         "Specify a script for the post-INSTALL phase of RPM building"),

        ('pre-uninstall=', None,
         "Specify a script for the pre-UNINSTALL phase of RPM building"),
        ('post-uninstall=', None,
         "Specify a script for the post-UNINSTALL phase of RPM building"),

        ('clean-script=', None,
         "Specify a script for the CLEAN phase of RPM building"),

        ('verify-script=', None,
         "Specify a script for the VERIFY phase of the RPM build"),

        # Allow a packager to explicitly force an architecture
        ('force-arch=', None,
         "Force an architecture onto the RPM build process"),

        ('quiet', 'q',
         "Run the INSTALL phase of RPM building in quiet mode"),
        ]

    boolean_options = ['keep-temp', 'use-rpm-opt-flags', 'rpm3-mode',
                       'no-autoreq', 'quiet']

    negative_opt = {'no-keep-temp': 'keep-temp',
                    'no-rpm-opt-flags': 'use-rpm-opt-flags',
                    'rpm2-mode': 'rpm3-mode'}


    def initialize_options(self):
        self.bdist_base = None
        self.rpm_base = None
        self.dist_dir = None
        self.python = None
        self.fix_python = None
        self.spec_only = None
        self.binary_only = None
        self.source_only = None
        self.use_bzip2 = None

        self.distribution_name = None
        self.group = None
        self.release = None
        self.serial = None
        self.vendor = None
        self.packager = None
        self.doc_files = None
        self.changelog = None
        self.icon = None

        self.prep_script = None
        self.build_script = None
        self.install_script = None
        self.clean_script = None
        self.verify_script = None
        self.pre_install = None
        self.post_install = None
        self.pre_uninstall = None
        self.post_uninstall = None
        self.prep = None
        self.provides = None
        self.requires = None
        self.conflicts = None
        self.build_requires = None
        self.obsoletes = None

        self.keep_temp = 0
        self.use_rpm_opt_flags = 1
        self.rpm3_mode = 1
        self.no_autoreq = 0

        self.force_arch = None
        self.quiet = 0

    def finalize_options(self):
        self.set_undefined_options('bdist', ('bdist_base', 'bdist_base'))
        if self.rpm_base is None:
            if not self.rpm3_mode:
                raise DistutilsOptionError(
                      "you must specify --rpm-base in RPM 2 mode")
            self.rpm_base = os.path.join(self.bdist_base, "rpm")

        if self.python is None:
            if self.fix_python:
                self.python = sys.executable
            else:
                self.python = "python3"
        elif self.fix_python:
            raise DistutilsOptionError(
                  "--python and --fix-python are mutually exclusive options")

        if os.name != 'posix':
            raise DistutilsPlatformError("don't know how to create RPM "
                   "distributions on platform %s" % os.name)
        if self.binary_only and self.source_only:
            raise DistutilsOptionError(
                  "cannot supply both '--source-only' and '--binary-only'")

        # don't pass CFLAGS to pure python distributions
        if not self.distribution.has_ext_modules():
            self.use_rpm_opt_flags = 0

        self.set_undefined_options('bdist', ('dist_dir', 'dist_dir'))
        self.finalize_package_data()

    def finalize_package_data(self):
        self.ensure_string('group', "Development/Libraries")
        self.ensure_string('vendor',
                           "%s <%s>" % (self.distribution.get_contact(),
                                        self.distribution.get_contact_email()))
        self.ensure_string('packager')
        self.ensure_string_list('doc_files')
        if isinstance(self.doc_files, list):
            for readme in ('README', 'README.txt'):
                if os.path.exists(readme) and readme not in self.doc_files:
                    self.doc_files.append(readme)

        self.ensure_string('release', "1")
        self.ensure_string('serial')   # should it be an int?

        self.ensure_string('distribution_name')

        self.ensure_string('changelog')
          # Format changelog correctly
        self.changelog = self._format_changelog(self.changelog)

        self.ensure_filename('icon')

        self.ensure_filename('prep_script')
        self.ensure_filename('build_script')
        self.ensure_filename('install_script')
        self.ensure_filename('clean_script')
        self.ensure_filename('verify_script')
        self.ensure_filename('pre_install')
        self.ensure_filename('post_install')
        self.ensure_filename('pre_uninstall')
        self.ensure_filename('post_uninstall')

        # XXX don't forget we punted on summaries and descriptions -- they
        # should be handled here eventually!

        # Now *this* is some meta-data that belongs in the setup script...
        self.ensure_string_list('provides')
        self.ensure_string_list('requires')
        self.ensure_string_list('conflicts')
        self.ensure_string_list('build_requires')
        self.ensure_string_list('obsoletes')

        self.ensure_string('force_arch')

    def run(self):
        if DEBUG:
            print("before _get_package_data():")
            print("vendor =", self.vendor)
            print("packager =", self.packager)
            print("doc_files =", self.doc_files)
            print("changelog =", self.changelog)

        # make directories
        if self.spec_only:
            spec_dir = self.dist_dir
            self.mkpath(spec_dir)
        else:
            rpm_dir = {}
            for d in ('SOURCES', 'SPECS', 'BUILD', 'RPMS', 'SRPMS'):
                rpm_dir[d] = os.path.join(self.rpm_base, d)
                self.mkpath(rpm_dir[d])
            spec_dir = rpm_dir['SPECS']

        # Spec file goes into 'dist_dir' if '--spec-only specified',
        # build/rpm.<plat> otherwise.
        spec_path = os.path.join(spec_dir,
                                 "%s.spec" % self.distribution.get_name())
        self.execute(write_file,
                     (spec_path,
                      self._make_spec_file()),
                     "writing '%s'" % spec_path)

        if self.spec_only: # stop if requested
            return

        # Make a source distribution and copy to SOURCES directory with
        # optional icon.
        saved_dist_files = self.distribution.dist_files[:]
        sdist = self.reinitialize_command('sdist')
        if self.use_bzip2:
            sdist.formats = ['bztar']
        else:
            sdist.formats = ['gztar']
        self.run_command('sdist')
        self.distribution.dist_files = saved_dist_files

        source = sdist.get_archive_files()[0]
        source_dir = rpm_dir['SOURCES']
        self.copy_file(source, source_dir)

        if self.icon:
            if os.path.exists(self.icon):
                self.copy_file(self.icon, source_dir)
            else:
                raise DistutilsFileError(
                      "icon file '%s' does not exist" % self.icon)

        # build package
        log.info("building RPMs")
        rpm_cmd = ['rpmbuild']

        if self.source_only: # what kind of RPMs?
            rpm_cmd.append('-bs')
        elif self.binary_only:
            rpm_cmd.append('-bb')
        else:
            rpm_cmd.append('-ba')
        rpm_cmd.extend(['--define', '__python %s' % self.python])
        if self.rpm3_mode:
            rpm_cmd.extend(['--define',
                             '_topdir %s' % os.path.abspath(self.rpm_base)])
        if not self.keep_temp:
            rpm_cmd.append('--clean')

        if self.quiet:
            rpm_cmd.append('--quiet')

        rpm_cmd.append(spec_path)
        # Determine the binary rpm names that should be built out of this spec
        # file
        # Note that some of these may not be really built (if the file
        # list is empty)
        nvr_string = "%{name}-%{version}-%{release}"
        src_rpm = nvr_string + ".src.rpm"
        non_src_rpm = "%{arch}/" + nvr_string + ".%{arch}.rpm"
        q_cmd = r"rpm -q --qf '%s %s\n' --specfile '%s'" % (
            src_rpm, non_src_rpm, spec_path)

        out = os.popen(q_cmd)
        try:
            binary_rpms = []
            source_rpm = None
            while True:
                line = out.readline()
                if not line:
                    break
                l = line.strip().split()
                assert(len(l) == 2)
                binary_rpms.append(l[1])
                # The source rpm is named after the first entry in the spec file
                if source_rpm is None:
                    source_rpm = l[0]

            status = out.close()
            if status:
                raise DistutilsExecError("Failed to execute: %s" % repr(q_cmd))

        finally:
            out.close()

        self.spawn(rpm_cmd)

        if not self.dry_run:
            if self.distribution.has_ext_modules():
                pyversion = get_python_version()
            else:
                pyversion = 'any'

            if not self.binary_only:
                srpm = os.path.join(rpm_dir['SRPMS'], source_rpm)
                assert(os.path.exists(srpm))
                self.move_file(srpm, self.dist_dir)
                filename = os.path.join(self.dist_dir, source_rpm)
                self.distribution.dist_files.append(
                    ('bdist_rpm', pyversion, filename))

            if not self.source_only:
                for rpm in binary_rpms:
                    rpm = os.path.join(rpm_dir['RPMS'], rpm)
                    if os.path.exists(rpm):
                        self.move_file(rpm, self.dist_dir)
                        filename = os.path.join(self.dist_dir,
                                                os.path.basename(rpm))
                        self.distribution.dist_files.append(
                            ('bdist_rpm', pyversion, filename))

    def _dist_path(self, path):
        return os.path.join(self.dist_dir, os.path.basename(path))

    def _make_spec_file(self):
        """Generate the text of an RPM spec file and return it as a
        list of strings (one per line).
        """
        # definitions and headers
        spec_file = [
            '%define name ' + self.distribution.get_name(),
            '%define version ' + self.distribution.get_version().replace('-','_'),
            '%define unmangled_version ' + self.distribution.get_version(),
            '%define release ' + self.release.replace('-','_'),
            '',
            'Summary: ' + self.distribution.get_description(),
            ]

        # Workaround for #14443 which affects some RPM based systems such as
        # RHEL6 (and probably derivatives)
        vendor_hook = subprocess.getoutput('rpm --eval %{__os_install_post}')
        # Generate a potential replacement value for __os_install_post (whilst
        # normalizing the whitespace to simplify the test for whether the
        # invocation of brp-python-bytecompile passes in __python):
        vendor_hook = '\n'.join(['  %s \\' % line.strip()
                                 for line in vendor_hook.splitlines()])
        problem = "brp-python-bytecompile \\\n"
        fixed = "brp-python-bytecompile %{__python} \\\n"
        fixed_hook = vendor_hook.replace(problem, fixed)
        if fixed_hook != vendor_hook:
            spec_file.append('# Workaround for http://bugs.python.org/issue14443')
            spec_file.append('%define __os_install_post ' + fixed_hook + '\n')

        # put locale summaries into spec file
        # XXX not supported for now (hard to put a dictionary
        # in a config file -- arg!)
        #for locale in self.summaries.keys():
        #    spec_file.append('Summary(%s): %s' % (locale,
        #                                          self.summaries[locale]))

        spec_file.extend([
            'Name: %{name}',
            'Version: %{version}',
            'Release: %{release}',])

        # XXX yuck! this filename is available from the "sdist" command,
        # but only after it has run: and we create the spec file before
        # running "sdist", in case of --spec-only.
        if self.use_bzip2:
            spec_file.append('Source0: %{name}-%{unmangled_version}.tar.bz2')
        else:
            spec_file.append('Source0: %{name}-%{unmangled_version}.tar.gz')

        spec_file.extend([
            'License: ' + self.distribution.get_license(),
            'Group: ' + self.group,
            'BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot',
            'Prefix: %{_prefix}', ])

        if not self.force_arch:
            # noarch if no extension modules
            if not self.distribution.has_ext_modules():
                spec_file.append('BuildArch: noarch')
        else:
            spec_file.append( 'BuildArch: %s' % self.force_arch )

        for field in ('Vendor',
                      'Packager',
                      'Provides',
                      'Requires',
                      'Conflicts',
                      'Obsoletes',
                      ):
            val = getattr(self, field.lower())
            if isinstance(val, list):
                spec_file.append('%s: %s' % (field, ' '.join(val)))
            elif val is not None:
                spec_file.append('%s: %s' % (field, val))


        if self.distribution.get_url() != 'UNKNOWN':
            spec_file.append('Url: ' + self.distribution.get_url())

        if self.distribution_name:
            spec_file.append('Distribution: ' + self.distribution_name)

        if self.build_requires:
            spec_file.append('BuildRequires: ' +
                             ' '.join(self.build_requires))

        if self.icon:
            spec_file.append('Icon: ' + os.path.basename(self.icon))

        if self.no_autoreq:
            spec_file.append('AutoReq: 0')

        spec_file.extend([
            '',
            '%description',
            self.distribution.get_long_description()
            ])

        # put locale descriptions into spec file
        # XXX again, suppressed because config file syntax doesn't
        # easily support this ;-(
        #for locale in self.descriptions.keys():
        #    spec_file.extend([
        #        '',
        #        '%description -l ' + locale,
        #        self.descriptions[locale],
        #        ])

        # rpm scripts
        # figure out default build script
        def_setup_call = "%s %s" % (self.python,os.path.basename(sys.argv[0]))
        def_build = "%s build" % def_setup_call
        if self.use_rpm_opt_flags:
            def_build = 'env CFLAGS="$RPM_OPT_FLAGS" ' + def_build

        # insert contents of files

        # XXX this is kind of misleading: user-supplied options are files
        # that we open and interpolate into the spec file, but the defaults
        # are just text that we drop in as-is.  Hmmm.

        install_cmd = ('%s install -O1 --root=$RPM_BUILD_ROOT '
                       '--record=INSTALLED_FILES') % def_setup_call

        script_options = [
            ('prep', 'prep_script', "%setup -n %{name}-%{unmangled_version}"),
            ('build', 'build_script', def_build),
            ('install', 'install_script', install_cmd),
            ('clean', 'clean_script', "rm -rf $RPM_BUILD_ROOT"),
            ('verifyscript', 'verify_script', None),
            ('pre', 'pre_install', None),
            ('post', 'post_install', None),
            ('preun', 'pre_uninstall', None),
            ('postun', 'post_uninstall', None),
        ]

        for (rpm_opt, attr, default) in script_options:
            # Insert contents of file referred to, if no file is referred to
            # use 'default' as contents of script
            val = getattr(self, attr)
            if val or default:
                spec_file.extend([
                    '',
                    '%' + rpm_opt,])
                if val:
                    with open(val) as f:
                        spec_file.extend(f.read().split('\n'))
                else:
                    spec_file.append(default)


        # files section
        spec_file.extend([
            '',
            '%files -f INSTALLED_FILES',
            '%defattr(-,root,root)',
            ])

        if self.doc_files:
            spec_file.append('%doc ' + ' '.join(self.doc_files))

        if self.changelog:
            spec_file.extend([
                '',
                '%changelog',])
            spec_file.extend(self.changelog)

        return spec_file

    def _format_changelog(self, changelog):
        """Format the changelog correctly and convert it to a list of strings
        """
        if not changelog:
            return changelog
        new_changelog = []
        for line in changelog.strip().split('\n'):
            line = line.strip()
            if line[0] == '*':
                new_changelog.extend(['', line])
            elif line[0] == '-':
                new_changelog.append(line)
            else:
                new_changelog.append('  ' + line)

        # strip trailing newline inserted by first changelog entry
        if not new_changelog[0]:
            del new_changelog[0]

        return new_changelog
distutils/command/config.py000064400000031475151153537440012047 0ustar00"""distutils.command.config

Implements the Distutils 'config' command, a (mostly) empty command class
that exists mainly to be sub-classed by specific module distributions and
applications.  The idea is that while every "config" command is different,
at least they're all named the same, and users always see "config" in the
list of standard commands.  Also, this is a good place to put common
configure-like tasks: "try to compile this C code", or "figure out where
this header file lives".
"""

import os, re

from distutils.core import Command
from distutils.errors import DistutilsExecError
from distutils.sysconfig import customize_compiler
from distutils import log

LANG_EXT = {"c": ".c", "c++": ".cxx"}

class config(Command):

    description = "prepare to build"

    user_options = [
        ('compiler=', None,
         "specify the compiler type"),
        ('cc=', None,
         "specify the compiler executable"),
        ('include-dirs=', 'I',
         "list of directories to search for header files"),
        ('define=', 'D',
         "C preprocessor macros to define"),
        ('undef=', 'U',
         "C preprocessor macros to undefine"),
        ('libraries=', 'l',
         "external C libraries to link with"),
        ('library-dirs=', 'L',
         "directories to search for external C libraries"),

        ('noisy', None,
         "show every action (compile, link, run, ...) taken"),
        ('dump-source', None,
         "dump generated source files before attempting to compile them"),
        ]


    # The three standard command methods: since the "config" command
    # does nothing by default, these are empty.

    def initialize_options(self):
        self.compiler = None
        self.cc = None
        self.include_dirs = None
        self.libraries = None
        self.library_dirs = None

        # maximal output for now
        self.noisy = 1
        self.dump_source = 1

        # list of temporary files generated along-the-way that we have
        # to clean at some point
        self.temp_files = []

    def finalize_options(self):
        if self.include_dirs is None:
            self.include_dirs = self.distribution.include_dirs or []
        elif isinstance(self.include_dirs, str):
            self.include_dirs = self.include_dirs.split(os.pathsep)

        if self.libraries is None:
            self.libraries = []
        elif isinstance(self.libraries, str):
            self.libraries = [self.libraries]

        if self.library_dirs is None:
            self.library_dirs = []
        elif isinstance(self.library_dirs, str):
            self.library_dirs = self.library_dirs.split(os.pathsep)

    def run(self):
        pass

    # Utility methods for actual "config" commands.  The interfaces are
    # loosely based on Autoconf macros of similar names.  Sub-classes
    # may use these freely.

    def _check_compiler(self):
        """Check that 'self.compiler' really is a CCompiler object;
        if not, make it one.
        """
        # We do this late, and only on-demand, because this is an expensive
        # import.
        from distutils.ccompiler import CCompiler, new_compiler
        if not isinstance(self.compiler, CCompiler):
            self.compiler = new_compiler(compiler=self.compiler,
                                         dry_run=self.dry_run, force=1)
            customize_compiler(self.compiler)
            if self.include_dirs:
                self.compiler.set_include_dirs(self.include_dirs)
            if self.libraries:
                self.compiler.set_libraries(self.libraries)
            if self.library_dirs:
                self.compiler.set_library_dirs(self.library_dirs)

    def _gen_temp_sourcefile(self, body, headers, lang):
        filename = "_configtest" + LANG_EXT[lang]
        with open(filename, "w") as file:
            if headers:
                for header in headers:
                    file.write("#include <%s>\n" % header)
                file.write("\n")
            file.write(body)
            if body[-1] != "\n":
                file.write("\n")
        return filename

    def _preprocess(self, body, headers, include_dirs, lang):
        src = self._gen_temp_sourcefile(body, headers, lang)
        out = "_configtest.i"
        self.temp_files.extend([src, out])
        self.compiler.preprocess(src, out, include_dirs=include_dirs)
        return (src, out)

    def _compile(self, body, headers, include_dirs, lang):
        src = self._gen_temp_sourcefile(body, headers, lang)
        if self.dump_source:
            dump_file(src, "compiling '%s':" % src)
        (obj,) = self.compiler.object_filenames([src])
        self.temp_files.extend([src, obj])
        self.compiler.compile([src], include_dirs=include_dirs)
        return (src, obj)

    def _link(self, body, headers, include_dirs, libraries, library_dirs,
              lang):
        (src, obj) = self._compile(body, headers, include_dirs, lang)
        prog = os.path.splitext(os.path.basename(src))[0]
        self.compiler.link_executable([obj], prog,
                                      libraries=libraries,
                                      library_dirs=library_dirs,
                                      target_lang=lang)

        if self.compiler.exe_extension is not None:
            prog = prog + self.compiler.exe_extension
        self.temp_files.append(prog)

        return (src, obj, prog)

    def _clean(self, *filenames):
        if not filenames:
            filenames = self.temp_files
            self.temp_files = []
        log.info("removing: %s", ' '.join(filenames))
        for filename in filenames:
            try:
                os.remove(filename)
            except OSError:
                pass


    # XXX these ignore the dry-run flag: what to do, what to do? even if
    # you want a dry-run build, you still need some sort of configuration
    # info.  My inclination is to make it up to the real config command to
    # consult 'dry_run', and assume a default (minimal) configuration if
    # true.  The problem with trying to do it here is that you'd have to
    # return either true or false from all the 'try' methods, neither of
    # which is correct.

    # XXX need access to the header search path and maybe default macros.

    def try_cpp(self, body=None, headers=None, include_dirs=None, lang="c"):
        """Construct a source file from 'body' (a string containing lines
        of C/C++ code) and 'headers' (a list of header files to include)
        and run it through the preprocessor.  Return true if the
        preprocessor succeeded, false if there were any errors.
        ('body' probably isn't of much use, but what the heck.)
        """
        from distutils.ccompiler import CompileError
        self._check_compiler()
        ok = True
        try:
            self._preprocess(body, headers, include_dirs, lang)
        except CompileError:
            ok = False

        self._clean()
        return ok

    def search_cpp(self, pattern, body=None, headers=None, include_dirs=None,
                   lang="c"):
        """Construct a source file (just like 'try_cpp()'), run it through
        the preprocessor, and return true if any line of the output matches
        'pattern'.  'pattern' should either be a compiled regex object or a
        string containing a regex.  If both 'body' and 'headers' are None,
        preprocesses an empty file -- which can be useful to determine the
        symbols the preprocessor and compiler set by default.
        """
        self._check_compiler()
        src, out = self._preprocess(body, headers, include_dirs, lang)

        if isinstance(pattern, str):
            pattern = re.compile(pattern)

        with open(out) as file:
            match = False
            while True:
                line = file.readline()
                if line == '':
                    break
                if pattern.search(line):
                    match = True
                    break

        self._clean()
        return match

    def try_compile(self, body, headers=None, include_dirs=None, lang="c"):
        """Try to compile a source file built from 'body' and 'headers'.
        Return true on success, false otherwise.
        """
        from distutils.ccompiler import CompileError
        self._check_compiler()
        try:
            self._compile(body, headers, include_dirs, lang)
            ok = True
        except CompileError:
            ok = False

        log.info(ok and "success!" or "failure.")
        self._clean()
        return ok

    def try_link(self, body, headers=None, include_dirs=None, libraries=None,
                 library_dirs=None, lang="c"):
        """Try to compile and link a source file, built from 'body' and
        'headers', to executable form.  Return true on success, false
        otherwise.
        """
        from distutils.ccompiler import CompileError, LinkError
        self._check_compiler()
        try:
            self._link(body, headers, include_dirs,
                       libraries, library_dirs, lang)
            ok = True
        except (CompileError, LinkError):
            ok = False

        log.info(ok and "success!" or "failure.")
        self._clean()
        return ok

    def try_run(self, body, headers=None, include_dirs=None, libraries=None,
                library_dirs=None, lang="c"):
        """Try to compile, link to an executable, and run a program
        built from 'body' and 'headers'.  Return true on success, false
        otherwise.
        """
        from distutils.ccompiler import CompileError, LinkError
        self._check_compiler()
        try:
            src, obj, exe = self._link(body, headers, include_dirs,
                                       libraries, library_dirs, lang)
            self.spawn([exe])
            ok = True
        except (CompileError, LinkError, DistutilsExecError):
            ok = False

        log.info(ok and "success!" or "failure.")
        self._clean()
        return ok


    # -- High-level methods --------------------------------------------
    # (these are the ones that are actually likely to be useful
    # when implementing a real-world config command!)

    def check_func(self, func, headers=None, include_dirs=None,
                   libraries=None, library_dirs=None, decl=0, call=0):
        """Determine if function 'func' is available by constructing a
        source file that refers to 'func', and compiles and links it.
        If everything succeeds, returns true; otherwise returns false.

        The constructed source file starts out by including the header
        files listed in 'headers'.  If 'decl' is true, it then declares
        'func' (as "int func()"); you probably shouldn't supply 'headers'
        and set 'decl' true in the same call, or you might get errors about
        a conflicting declarations for 'func'.  Finally, the constructed
        'main()' function either references 'func' or (if 'call' is true)
        calls it.  'libraries' and 'library_dirs' are used when
        linking.
        """
        self._check_compiler()
        body = []
        if decl:
            body.append("int %s ();" % func)
        body.append("int main () {")
        if call:
            body.append("  %s();" % func)
        else:
            body.append("  %s;" % func)
        body.append("}")
        body = "\n".join(body) + "\n"

        return self.try_link(body, headers, include_dirs,
                             libraries, library_dirs)

    def check_lib(self, library, library_dirs=None, headers=None,
                  include_dirs=None, other_libraries=[]):
        """Determine if 'library' is available to be linked against,
        without actually checking that any particular symbols are provided
        by it.  'headers' will be used in constructing the source file to
        be compiled, but the only effect of this is to check if all the
        header files listed are available.  Any libraries listed in
        'other_libraries' will be included in the link, in case 'library'
        has symbols that depend on other libraries.
        """
        self._check_compiler()
        return self.try_link("int main (void) { }", headers, include_dirs,
                             [library] + other_libraries, library_dirs)

    def check_header(self, header, include_dirs=None, library_dirs=None,
                     lang="c"):
        """Determine if the system header file named by 'header_file'
        exists and can be found by the preprocessor; return true if so,
        false otherwise.
        """
        return self.try_cpp(body="/* No body */", headers=[header],
                            include_dirs=include_dirs)

def dump_file(filename, head=None):
    """Dumps a file content into log.info.

    If head is not None, will be dumped before the file content.
    """
    if head is None:
        log.info('%s', filename)
    else:
        log.info(head)
    file = open(filename)
    try:
        log.info(file.read())
    finally:
        file.close()
distutils/command/sdist.py000064400000045075151153537440011731 0ustar00"""distutils.command.sdist

Implements the Distutils 'sdist' command (create a source distribution)."""

import os
import sys
from glob import glob
from warnings import warn

from distutils.core import Command
from distutils import dir_util
from distutils import file_util
from distutils import archive_util
from distutils.text_file import TextFile
from distutils.filelist import FileList
from distutils import log
from distutils.util import convert_path
from distutils.errors import DistutilsTemplateError, DistutilsOptionError


def show_formats():
    """Print all possible values for the 'formats' option (used by
    the "--help-formats" command-line option).
    """
    from distutils.fancy_getopt import FancyGetopt
    from distutils.archive_util import ARCHIVE_FORMATS
    formats = []
    for format in ARCHIVE_FORMATS.keys():
        formats.append(("formats=" + format, None,
                        ARCHIVE_FORMATS[format][2]))
    formats.sort()
    FancyGetopt(formats).print_help(
        "List of available source distribution formats:")


class sdist(Command):

    description = "create a source distribution (tarball, zip file, etc.)"

    def checking_metadata(self):
        """Callable used for the check sub-command.

        Placed here so user_options can view it"""
        return self.metadata_check

    user_options = [
        ('template=', 't',
         "name of manifest template file [default: MANIFEST.in]"),
        ('manifest=', 'm',
         "name of manifest file [default: MANIFEST]"),
        ('use-defaults', None,
         "include the default file set in the manifest "
         "[default; disable with --no-defaults]"),
        ('no-defaults', None,
         "don't include the default file set"),
        ('prune', None,
         "specifically exclude files/directories that should not be "
         "distributed (build tree, RCS/CVS dirs, etc.) "
         "[default; disable with --no-prune]"),
        ('no-prune', None,
         "don't automatically exclude anything"),
        ('manifest-only', 'o',
         "just regenerate the manifest and then stop "
         "(implies --force-manifest)"),
        ('force-manifest', 'f',
         "forcibly regenerate the manifest and carry on as usual. "
         "Deprecated: now the manifest is always regenerated."),
        ('formats=', None,
         "formats for source distribution (comma-separated list)"),
        ('keep-temp', 'k',
         "keep the distribution tree around after creating " +
         "archive file(s)"),
        ('dist-dir=', 'd',
         "directory to put the source distribution archive(s) in "
         "[default: dist]"),
        ('metadata-check', None,
         "Ensure that all required elements of meta-data "
         "are supplied. Warn if any missing. [default]"),
        ('owner=', 'u',
         "Owner name used when creating a tar file [default: current user]"),
        ('group=', 'g',
         "Group name used when creating a tar file [default: current group]"),
        ]

    boolean_options = ['use-defaults', 'prune',
                       'manifest-only', 'force-manifest',
                       'keep-temp', 'metadata-check']

    help_options = [
        ('help-formats', None,
         "list available distribution formats", show_formats),
        ]

    negative_opt = {'no-defaults': 'use-defaults',
                    'no-prune': 'prune' }

    sub_commands = [('check', checking_metadata)]

    READMES = ('README', 'README.txt', 'README.rst')

    def initialize_options(self):
        # 'template' and 'manifest' are, respectively, the names of
        # the manifest template and manifest file.
        self.template = None
        self.manifest = None

        # 'use_defaults': if true, we will include the default file set
        # in the manifest
        self.use_defaults = 1
        self.prune = 1

        self.manifest_only = 0
        self.force_manifest = 0

        self.formats = ['gztar']
        self.keep_temp = 0
        self.dist_dir = None

        self.archive_files = None
        self.metadata_check = 1
        self.owner = None
        self.group = None

    def finalize_options(self):
        if self.manifest is None:
            self.manifest = "MANIFEST"
        if self.template is None:
            self.template = "MANIFEST.in"

        self.ensure_string_list('formats')

        bad_format = archive_util.check_archive_formats(self.formats)
        if bad_format:
            raise DistutilsOptionError(
                  "unknown archive format '%s'" % bad_format)

        if self.dist_dir is None:
            self.dist_dir = "dist"

    def run(self):
        # 'filelist' contains the list of files that will make up the
        # manifest
        self.filelist = FileList()

        # Run sub commands
        for cmd_name in self.get_sub_commands():
            self.run_command(cmd_name)

        # Do whatever it takes to get the list of files to process
        # (process the manifest template, read an existing manifest,
        # whatever).  File list is accumulated in 'self.filelist'.
        self.get_file_list()

        # If user just wanted us to regenerate the manifest, stop now.
        if self.manifest_only:
            return

        # Otherwise, go ahead and create the source distribution tarball,
        # or zipfile, or whatever.
        self.make_distribution()

    def check_metadata(self):
        """Deprecated API."""
        warn("distutils.command.sdist.check_metadata is deprecated, \
              use the check command instead", PendingDeprecationWarning)
        check = self.distribution.get_command_obj('check')
        check.ensure_finalized()
        check.run()

    def get_file_list(self):
        """Figure out the list of files to include in the source
        distribution, and put it in 'self.filelist'.  This might involve
        reading the manifest template (and writing the manifest), or just
        reading the manifest, or just using the default file set -- it all
        depends on the user's options.
        """
        # new behavior when using a template:
        # the file list is recalculated every time because
        # even if MANIFEST.in or setup.py are not changed
        # the user might have added some files in the tree that
        # need to be included.
        #
        #  This makes --force the default and only behavior with templates.
        template_exists = os.path.isfile(self.template)
        if not template_exists and self._manifest_is_not_generated():
            self.read_manifest()
            self.filelist.sort()
            self.filelist.remove_duplicates()
            return

        if not template_exists:
            self.warn(("manifest template '%s' does not exist " +
                        "(using default file list)") %
                        self.template)
        self.filelist.findall()

        if self.use_defaults:
            self.add_defaults()

        if template_exists:
            self.read_template()

        if self.prune:
            self.prune_file_list()

        self.filelist.sort()
        self.filelist.remove_duplicates()
        self.write_manifest()

    def add_defaults(self):
        """Add all the default files to self.filelist:
          - README or README.txt
          - setup.py
          - test/test*.py
          - all pure Python modules mentioned in setup script
          - all files pointed by package_data (build_py)
          - all files defined in data_files.
          - all files defined as scripts.
          - all C sources listed as part of extensions or C libraries
            in the setup script (doesn't catch C headers!)
        Warns if (README or README.txt) or setup.py are missing; everything
        else is optional.
        """
        self._add_defaults_standards()
        self._add_defaults_optional()
        self._add_defaults_python()
        self._add_defaults_data_files()
        self._add_defaults_ext()
        self._add_defaults_c_libs()
        self._add_defaults_scripts()

    @staticmethod
    def _cs_path_exists(fspath):
        """
        Case-sensitive path existence check

        >>> sdist._cs_path_exists(__file__)
        True
        >>> sdist._cs_path_exists(__file__.upper())
        False
        """
        if not os.path.exists(fspath):
            return False
        # make absolute so we always have a directory
        abspath = os.path.abspath(fspath)
        directory, filename = os.path.split(abspath)
        return filename in os.listdir(directory)

    def _add_defaults_standards(self):
        standards = [self.READMES, self.distribution.script_name]
        for fn in standards:
            if isinstance(fn, tuple):
                alts = fn
                got_it = False
                for fn in alts:
                    if self._cs_path_exists(fn):
                        got_it = True
                        self.filelist.append(fn)
                        break

                if not got_it:
                    self.warn("standard file not found: should have one of " +
                              ', '.join(alts))
            else:
                if self._cs_path_exists(fn):
                    self.filelist.append(fn)
                else:
                    self.warn("standard file '%s' not found" % fn)

    def _add_defaults_optional(self):
        optional = ['test/test*.py', 'setup.cfg']
        for pattern in optional:
            files = filter(os.path.isfile, glob(pattern))
            self.filelist.extend(files)

    def _add_defaults_python(self):
        # build_py is used to get:
        #  - python modules
        #  - files defined in package_data
        build_py = self.get_finalized_command('build_py')

        # getting python files
        if self.distribution.has_pure_modules():
            self.filelist.extend(build_py.get_source_files())

        # getting package_data files
        # (computed in build_py.data_files by build_py.finalize_options)
        for pkg, src_dir, build_dir, filenames in build_py.data_files:
            for filename in filenames:
                self.filelist.append(os.path.join(src_dir, filename))

    def _add_defaults_data_files(self):
        # getting distribution.data_files
        if self.distribution.has_data_files():
            for item in self.distribution.data_files:
                if isinstance(item, str):
                    # plain file
                    item = convert_path(item)
                    if os.path.isfile(item):
                        self.filelist.append(item)
                else:
                    # a (dirname, filenames) tuple
                    dirname, filenames = item
                    for f in filenames:
                        f = convert_path(f)
                        if os.path.isfile(f):
                            self.filelist.append(f)

    def _add_defaults_ext(self):
        if self.distribution.has_ext_modules():
            build_ext = self.get_finalized_command('build_ext')
            self.filelist.extend(build_ext.get_source_files())

    def _add_defaults_c_libs(self):
        if self.distribution.has_c_libraries():
            build_clib = self.get_finalized_command('build_clib')
            self.filelist.extend(build_clib.get_source_files())

    def _add_defaults_scripts(self):
        if self.distribution.has_scripts():
            build_scripts = self.get_finalized_command('build_scripts')
            self.filelist.extend(build_scripts.get_source_files())

    def read_template(self):
        """Read and parse manifest template file named by self.template.

        (usually "MANIFEST.in") The parsing and processing is done by
        'self.filelist', which updates itself accordingly.
        """
        log.info("reading manifest template '%s'", self.template)
        template = TextFile(self.template, strip_comments=1, skip_blanks=1,
                            join_lines=1, lstrip_ws=1, rstrip_ws=1,
                            collapse_join=1)

        try:
            while True:
                line = template.readline()
                if line is None:            # end of file
                    break

                try:
                    self.filelist.process_template_line(line)
                # the call above can raise a DistutilsTemplateError for
                # malformed lines, or a ValueError from the lower-level
                # convert_path function
                except (DistutilsTemplateError, ValueError) as msg:
                    self.warn("%s, line %d: %s" % (template.filename,
                                                   template.current_line,
                                                   msg))
        finally:
            template.close()

    def prune_file_list(self):
        """Prune off branches that might slip into the file list as created
        by 'read_template()', but really don't belong there:
          * the build tree (typically "build")
          * the release tree itself (only an issue if we ran "sdist"
            previously with --keep-temp, or it aborted)
          * any RCS, CVS, .svn, .hg, .git, .bzr, _darcs directories
        """
        build = self.get_finalized_command('build')
        base_dir = self.distribution.get_fullname()

        self.filelist.exclude_pattern(None, prefix=build.build_base)
        self.filelist.exclude_pattern(None, prefix=base_dir)

        if sys.platform == 'win32':
            seps = r'/|\\'
        else:
            seps = '/'

        vcs_dirs = ['RCS', 'CVS', r'\.svn', r'\.hg', r'\.git', r'\.bzr',
                    '_darcs']
        vcs_ptrn = r'(^|%s)(%s)(%s).*' % (seps, '|'.join(vcs_dirs), seps)
        self.filelist.exclude_pattern(vcs_ptrn, is_regex=1)

    def write_manifest(self):
        """Write the file list in 'self.filelist' (presumably as filled in
        by 'add_defaults()' and 'read_template()') to the manifest file
        named by 'self.manifest'.
        """
        if self._manifest_is_not_generated():
            log.info("not writing to manually maintained "
                     "manifest file '%s'" % self.manifest)
            return

        content = self.filelist.files[:]
        content.insert(0, '# file GENERATED by distutils, do NOT edit')
        self.execute(file_util.write_file, (self.manifest, content),
                     "writing manifest file '%s'" % self.manifest)

    def _manifest_is_not_generated(self):
        # check for special comment used in 3.1.3 and higher
        if not os.path.isfile(self.manifest):
            return False

        fp = open(self.manifest)
        try:
            first_line = fp.readline()
        finally:
            fp.close()
        return first_line != '# file GENERATED by distutils, do NOT edit\n'

    def read_manifest(self):
        """Read the manifest file (named by 'self.manifest') and use it to
        fill in 'self.filelist', the list of files to include in the source
        distribution.
        """
        log.info("reading manifest file '%s'", self.manifest)
        with open(self.manifest) as manifest:
            for line in manifest:
                # ignore comments and blank lines
                line = line.strip()
                if line.startswith('#') or not line:
                    continue
                self.filelist.append(line)

    def make_release_tree(self, base_dir, files):
        """Create the directory tree that will become the source
        distribution archive.  All directories implied by the filenames in
        'files' are created under 'base_dir', and then we hard link or copy
        (if hard linking is unavailable) those files into place.
        Essentially, this duplicates the developer's source tree, but in a
        directory named after the distribution, containing only the files
        to be distributed.
        """
        # Create all the directories under 'base_dir' necessary to
        # put 'files' there; the 'mkpath()' is just so we don't die
        # if the manifest happens to be empty.
        self.mkpath(base_dir)
        dir_util.create_tree(base_dir, files, dry_run=self.dry_run)

        # And walk over the list of files, either making a hard link (if
        # os.link exists) to each one that doesn't already exist in its
        # corresponding location under 'base_dir', or copying each file
        # that's out-of-date in 'base_dir'.  (Usually, all files will be
        # out-of-date, because by default we blow away 'base_dir' when
        # we're done making the distribution archives.)

        if hasattr(os, 'link'):        # can make hard links on this system
            link = 'hard'
            msg = "making hard links in %s..." % base_dir
        else:                           # nope, have to copy
            link = None
            msg = "copying files to %s..." % base_dir

        if not files:
            log.warn("no files to distribute -- empty manifest?")
        else:
            log.info(msg)
        for file in files:
            if not os.path.isfile(file):
                log.warn("'%s' not a regular file -- skipping", file)
            else:
                dest = os.path.join(base_dir, file)
                self.copy_file(file, dest, link=link)

        self.distribution.metadata.write_pkg_info(base_dir)

    def make_distribution(self):
        """Create the source distribution(s).  First, we create the release
        tree with 'make_release_tree()'; then, we create all required
        archive files (according to 'self.formats') from the release tree.
        Finally, we clean up by blowing away the release tree (unless
        'self.keep_temp' is true).  The list of archive files created is
        stored so it can be retrieved later by 'get_archive_files()'.
        """
        # Don't warn about missing meta-data here -- should be (and is!)
        # done elsewhere.
        base_dir = self.distribution.get_fullname()
        base_name = os.path.join(self.dist_dir, base_dir)

        self.make_release_tree(base_dir, self.filelist.files)
        archive_files = []              # remember names of files we create
        # tar archive must be created last to avoid overwrite and remove
        if 'tar' in self.formats:
            self.formats.append(self.formats.pop(self.formats.index('tar')))

        for fmt in self.formats:
            file = self.make_archive(base_name, fmt, base_dir=base_dir,
                                     owner=self.owner, group=self.group)
            archive_files.append(file)
            self.distribution.dist_files.append(('sdist', '', file))

        self.archive_files = archive_files

        if not self.keep_temp:
            dir_util.remove_tree(base_dir, dry_run=self.dry_run)

    def get_archive_files(self):
        """Return the list of archive files created when the command
        was run, or None if the command hasn't run yet.
        """
        return self.archive_files
distutils/command/install_data.py000064400000005406151153537440013234 0ustar00"""distutils.command.install_data

Implements the Distutils 'install_data' command, for installing
platform-independent data files."""

# contributed by Bastian Kleineidam

import os
from distutils.core import Command
from distutils.util import change_root, convert_path

class install_data(Command):

    description = "install data files"

    user_options = [
        ('install-dir=', 'd',
         "base directory for installing data files "
         "(default: installation base dir)"),
        ('root=', None,
         "install everything relative to this alternate root directory"),
        ('force', 'f', "force installation (overwrite existing files)"),
        ]

    boolean_options = ['force']

    def initialize_options(self):
        self.install_dir = None
        self.outfiles = []
        self.root = None
        self.force = 0
        self.data_files = self.distribution.data_files
        self.warn_dir = 1

    def finalize_options(self):
        self.set_undefined_options('install',
                                   ('install_data', 'install_dir'),
                                   ('root', 'root'),
                                   ('force', 'force'),
                                  )

    def run(self):
        self.mkpath(self.install_dir)
        for f in self.data_files:
            if isinstance(f, str):
                # it's a simple file, so copy it
                f = convert_path(f)
                if self.warn_dir:
                    self.warn("setup script did not provide a directory for "
                              "'%s' -- installing right in '%s'" %
                              (f, self.install_dir))
                (out, _) = self.copy_file(f, self.install_dir)
                self.outfiles.append(out)
            else:
                # it's a tuple with path to install to and a list of files
                dir = convert_path(f[0])
                if not os.path.isabs(dir):
                    dir = os.path.join(self.install_dir, dir)
                elif self.root:
                    dir = change_root(self.root, dir)
                self.mkpath(dir)

                if f[1] == []:
                    # If there are no files listed, the user must be
                    # trying to create an empty directory, so add the
                    # directory to the list of output files.
                    self.outfiles.append(dir)
                else:
                    # Copy files, adding them to the list of output files.
                    for data in f[1]:
                        data = convert_path(data)
                        (out, _) = self.copy_file(data, dir)
                        self.outfiles.append(out)

    def get_inputs(self):
        return self.data_files or []

    def get_outputs(self):
        return self.outfiles
distutils/command/__init__.py000064400000001437151153537440012334 0ustar00"""distutils.command

Package containing implementation of all the standard Distutils
commands."""

__all__ = ['build',
           'build_py',
           'build_ext',
           'build_clib',
           'build_scripts',
           'clean',
           'install',
           'install_lib',
           'install_headers',
           'install_scripts',
           'install_data',
           'sdist',
           'register',
           'bdist',
           'bdist_dumb',
           'bdist_rpm',
           'bdist_wininst',
           'check',
           'upload',
           # These two are reserved for future use:
           #'bdist_sdux',
           #'bdist_pkgtool',
           # Note:
           # bdist_packager is not included because it only provides
           # an abstract base class
          ]
distutils/command/check.py000064400000012737151153537440011657 0ustar00"""distutils.command.check

Implements the Distutils 'check' command.
"""
from distutils.core import Command
from distutils.errors import DistutilsSetupError

try:
    # docutils is installed
    from docutils.utils import Reporter
    from docutils.parsers.rst import Parser
    from docutils import frontend
    from docutils import nodes
    from io import StringIO

    class SilentReporter(Reporter):

        def __init__(self, source, report_level, halt_level, stream=None,
                     debug=0, encoding='ascii', error_handler='replace'):
            self.messages = []
            Reporter.__init__(self, source, report_level, halt_level, stream,
                              debug, encoding, error_handler)

        def system_message(self, level, message, *children, **kwargs):
            self.messages.append((level, message, children, kwargs))
            return nodes.system_message(message, level=level,
                                        type=self.levels[level],
                                        *children, **kwargs)

    HAS_DOCUTILS = True
except Exception:
    # Catch all exceptions because exceptions besides ImportError probably
    # indicate that docutils is not ported to Py3k.
    HAS_DOCUTILS = False

class check(Command):
    """This command checks the meta-data of the package.
    """
    description = ("perform some checks on the package")
    user_options = [('metadata', 'm', 'Verify meta-data'),
                    ('restructuredtext', 'r',
                     ('Checks if long string meta-data syntax '
                      'are reStructuredText-compliant')),
                    ('strict', 's',
                     'Will exit with an error if a check fails')]

    boolean_options = ['metadata', 'restructuredtext', 'strict']

    def initialize_options(self):
        """Sets default values for options."""
        self.restructuredtext = 0
        self.metadata = 1
        self.strict = 0
        self._warnings = 0

    def finalize_options(self):
        pass

    def warn(self, msg):
        """Counts the number of warnings that occurs."""
        self._warnings += 1
        return Command.warn(self, msg)

    def run(self):
        """Runs the command."""
        # perform the various tests
        if self.metadata:
            self.check_metadata()
        if self.restructuredtext:
            if HAS_DOCUTILS:
                self.check_restructuredtext()
            elif self.strict:
                raise DistutilsSetupError('The docutils package is needed.')

        # let's raise an error in strict mode, if we have at least
        # one warning
        if self.strict and self._warnings > 0:
            raise DistutilsSetupError('Please correct your package.')

    def check_metadata(self):
        """Ensures that all required elements of meta-data are supplied.

        name, version, URL, (author and author_email) or
        (maintainer and maintainer_email)).

        Warns if any are missing.
        """
        metadata = self.distribution.metadata

        missing = []
        for attr in ('name', 'version', 'url'):
            if not (hasattr(metadata, attr) and getattr(metadata, attr)):
                missing.append(attr)

        if missing:
            self.warn("missing required meta-data: %s"  % ', '.join(missing))
        if metadata.author:
            if not metadata.author_email:
                self.warn("missing meta-data: if 'author' supplied, " +
                          "'author_email' must be supplied too")
        elif metadata.maintainer:
            if not metadata.maintainer_email:
                self.warn("missing meta-data: if 'maintainer' supplied, " +
                          "'maintainer_email' must be supplied too")
        else:
            self.warn("missing meta-data: either (author and author_email) " +
                      "or (maintainer and maintainer_email) " +
                      "must be supplied")

    def check_restructuredtext(self):
        """Checks if the long string fields are reST-compliant."""
        data = self.distribution.get_long_description()
        for warning in self._check_rst_data(data):
            line = warning[-1].get('line')
            if line is None:
                warning = warning[1]
            else:
                warning = '%s (line %s)' % (warning[1], line)
            self.warn(warning)

    def _check_rst_data(self, data):
        """Returns warnings when the provided data doesn't compile."""
        # the include and csv_table directives need this to be a path
        source_path = self.distribution.script_name or 'setup.py'
        parser = Parser()
        settings = frontend.OptionParser(components=(Parser,)).get_default_values()
        settings.tab_width = 4
        settings.pep_references = None
        settings.rfc_references = None
        reporter = SilentReporter(source_path,
                          settings.report_level,
                          settings.halt_level,
                          stream=settings.warning_stream,
                          debug=settings.debug,
                          encoding=settings.error_encoding,
                          error_handler=settings.error_encoding_error_handler)

        document = nodes.document(settings, reporter, source=source_path)
        document.note_source(source_path, -1)
        try:
            parser.parse(data, document)
        except AttributeError as e:
            reporter.messages.append(
                (-1, 'Could not finish the parsing: %s.' % e, '', {}))

        return reporter.messages
distutils/command/build_clib.py000064400000017526151153537440012673 0ustar00"""distutils.command.build_clib

Implements the Distutils 'build_clib' command, to build a C/C++ library
that is included in the module distribution and needed by an extension
module."""


# XXX this module has *lots* of code ripped-off quite transparently from
# build_ext.py -- not surprisingly really, as the work required to build
# a static library from a collection of C source files is not really all
# that different from what's required to build a shared object file from
# a collection of C source files.  Nevertheless, I haven't done the
# necessary refactoring to account for the overlap in code between the
# two modules, mainly because a number of subtle details changed in the
# cut 'n paste.  Sigh.

import os
from distutils.core import Command
from distutils.errors import *
from distutils.sysconfig import customize_compiler
from distutils import log

def show_compilers():
    from distutils.ccompiler import show_compilers
    show_compilers()


class build_clib(Command):

    description = "build C/C++ libraries used by Python extensions"

    user_options = [
        ('build-clib=', 'b',
         "directory to build C/C++ libraries to"),
        ('build-temp=', 't',
         "directory to put temporary build by-products"),
        ('debug', 'g',
         "compile with debugging information"),
        ('force', 'f',
         "forcibly build everything (ignore file timestamps)"),
        ('compiler=', 'c',
         "specify the compiler type"),
        ]

    boolean_options = ['debug', 'force']

    help_options = [
        ('help-compiler', None,
         "list available compilers", show_compilers),
        ]

    def initialize_options(self):
        self.build_clib = None
        self.build_temp = None

        # List of libraries to build
        self.libraries = None

        # Compilation options for all libraries
        self.include_dirs = None
        self.define = None
        self.undef = None
        self.debug = None
        self.force = 0
        self.compiler = None


    def finalize_options(self):
        # This might be confusing: both build-clib and build-temp default
        # to build-temp as defined by the "build" command.  This is because
        # I think that C libraries are really just temporary build
        # by-products, at least from the point of view of building Python
        # extensions -- but I want to keep my options open.
        self.set_undefined_options('build',
                                   ('build_temp', 'build_clib'),
                                   ('build_temp', 'build_temp'),
                                   ('compiler', 'compiler'),
                                   ('debug', 'debug'),
                                   ('force', 'force'))

        self.libraries = self.distribution.libraries
        if self.libraries:
            self.check_library_list(self.libraries)

        if self.include_dirs is None:
            self.include_dirs = self.distribution.include_dirs or []
        if isinstance(self.include_dirs, str):
            self.include_dirs = self.include_dirs.split(os.pathsep)

        # XXX same as for build_ext -- what about 'self.define' and
        # 'self.undef' ?


    def run(self):
        if not self.libraries:
            return

        # Yech -- this is cut 'n pasted from build_ext.py!
        from distutils.ccompiler import new_compiler
        self.compiler = new_compiler(compiler=self.compiler,
                                     dry_run=self.dry_run,
                                     force=self.force)
        customize_compiler(self.compiler)

        if self.include_dirs is not None:
            self.compiler.set_include_dirs(self.include_dirs)
        if self.define is not None:
            # 'define' option is a list of (name,value) tuples
            for (name,value) in self.define:
                self.compiler.define_macro(name, value)
        if self.undef is not None:
            for macro in self.undef:
                self.compiler.undefine_macro(macro)

        self.build_libraries(self.libraries)


    def check_library_list(self, libraries):
        """Ensure that the list of libraries is valid.

        `library` is presumably provided as a command option 'libraries'.
        This method checks that it is a list of 2-tuples, where the tuples
        are (library_name, build_info_dict).

        Raise DistutilsSetupError if the structure is invalid anywhere;
        just returns otherwise.
        """
        if not isinstance(libraries, list):
            raise DistutilsSetupError(
                  "'libraries' option must be a list of tuples")

        for lib in libraries:
            if not isinstance(lib, tuple) and len(lib) != 2:
                raise DistutilsSetupError(
                      "each element of 'libraries' must a 2-tuple")

            name, build_info = lib

            if not isinstance(name, str):
                raise DistutilsSetupError(
                      "first element of each tuple in 'libraries' "
                      "must be a string (the library name)")

            if '/' in name or (os.sep != '/' and os.sep in name):
                raise DistutilsSetupError("bad library name '%s': "
                       "may not contain directory separators" % lib[0])

            if not isinstance(build_info, dict):
                raise DistutilsSetupError(
                      "second element of each tuple in 'libraries' "
                      "must be a dictionary (build info)")


    def get_library_names(self):
        # Assume the library list is valid -- 'check_library_list()' is
        # called from 'finalize_options()', so it should be!
        if not self.libraries:
            return None

        lib_names = []
        for (lib_name, build_info) in self.libraries:
            lib_names.append(lib_name)
        return lib_names


    def get_source_files(self):
        self.check_library_list(self.libraries)
        filenames = []
        for (lib_name, build_info) in self.libraries:
            sources = build_info.get('sources')
            if sources is None or not isinstance(sources, (list, tuple)):
                raise DistutilsSetupError(
                       "in 'libraries' option (library '%s'), "
                       "'sources' must be present and must be "
                       "a list of source filenames" % lib_name)

            filenames.extend(sources)
        return filenames


    def build_libraries(self, libraries):
        for (lib_name, build_info) in libraries:
            sources = build_info.get('sources')
            if sources is None or not isinstance(sources, (list, tuple)):
                raise DistutilsSetupError(
                       "in 'libraries' option (library '%s'), "
                       "'sources' must be present and must be "
                       "a list of source filenames" % lib_name)
            sources = list(sources)

            log.info("building '%s' library", lib_name)

            # First, compile the source code to object files in the library
            # directory.  (This should probably change to putting object
            # files in a temporary build directory.)
            macros = build_info.get('macros')
            include_dirs = build_info.get('include_dirs')
            objects = self.compiler.compile(sources,
                                            output_dir=self.build_temp,
                                            macros=macros,
                                            include_dirs=include_dirs,
                                            debug=self.debug)

            # Now "link" the object files together into a static library.
            # (On Unix at least, this isn't really linking -- it just
            # builds an archive.  Whatever.)
            self.compiler.create_static_lib(objects, lib_name,
                                            output_dir=self.build_clib,
                                            debug=self.debug)
distutils/command/install_headers.py000064400000002422151153537440013731 0ustar00"""distutils.command.install_headers

Implements the Distutils 'install_headers' command, to install C/C++ header
files to the Python include directory."""

from distutils.core import Command


# XXX force is never used
class install_headers(Command):

    description = "install C/C++ header files"

    user_options = [('install-dir=', 'd',
                     "directory to install header files to"),
                    ('force', 'f',
                     "force installation (overwrite existing files)"),
                   ]

    boolean_options = ['force']

    def initialize_options(self):
        self.install_dir = None
        self.force = 0
        self.outfiles = []

    def finalize_options(self):
        self.set_undefined_options('install',
                                   ('install_headers', 'install_dir'),
                                   ('force', 'force'))


    def run(self):
        headers = self.distribution.headers
        if not headers:
            return

        self.mkpath(self.install_dir)
        for header in headers:
            (out, _) = self.copy_file(header, self.install_dir)
            self.outfiles.append(out)

    def get_inputs(self):
        return self.distribution.headers or []

    def get_outputs(self):
        return self.outfiles
distutils/command/install.py000064400000065201151153537440012242 0ustar00"""distutils.command.install

Implements the Distutils 'install' command."""

import sys
import os

from distutils import log
from distutils.core import Command
from distutils.debug import DEBUG
from distutils.sysconfig import get_config_vars
from distutils.errors import DistutilsPlatformError
from distutils.file_util import write_file
from distutils.util import convert_path, subst_vars, change_root
from distutils.util import get_platform
from distutils.errors import DistutilsOptionError

from site import USER_BASE
from site import USER_SITE
HAS_USER_SITE = True

WINDOWS_SCHEME = {
    'purelib': '$base/Lib/site-packages',
    'platlib': '$base/Lib/site-packages',
    'headers': '$base/Include/$dist_name',
    'scripts': '$base/Scripts',
    'data'   : '$base',
}

INSTALL_SCHEMES = {
    'unix_prefix': {
        'purelib': '$base/lib/python$py_version_short/site-packages',
        'platlib': '$platbase/lib64/python$py_version_short/site-packages',
        'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
        'scripts': '$base/bin',
        'data'   : '$base',
        },
    'unix_home': {
        'purelib': '$base/lib/python',
        'platlib': '$base/lib64/python',
        'headers': '$base/include/python/$dist_name',
        'scripts': '$base/bin',
        'data'   : '$base',
        },
    'nt': WINDOWS_SCHEME,
    }

# user site schemes
if HAS_USER_SITE:
    INSTALL_SCHEMES['nt_user'] = {
        'purelib': '$usersite',
        'platlib': '$usersite',
        'headers': '$userbase/Python$py_version_nodot/Include/$dist_name',
        'scripts': '$userbase/Python$py_version_nodot/Scripts',
        'data'   : '$userbase',
        }

    INSTALL_SCHEMES['unix_user'] = {
        'purelib': '$usersite',
        'platlib': '$usersite',
        'headers':
            '$userbase/include/python$py_version_short$abiflags/$dist_name',
        'scripts': '$userbase/bin',
        'data'   : '$userbase',
        }

# The keys to an installation scheme; if any new types of files are to be
# installed, be sure to add an entry to every installation scheme above,
# and to SCHEME_KEYS here.
SCHEME_KEYS = ('purelib', 'platlib', 'headers', 'scripts', 'data')


class install(Command):

    description = "install everything from build directory"

    user_options = [
        # Select installation scheme and set base director(y|ies)
        ('prefix=', None,
         "installation prefix"),
        ('exec-prefix=', None,
         "(Unix only) prefix for platform-specific files"),
        ('home=', None,
         "(Unix only) home directory to install under"),

        # Or, just set the base director(y|ies)
        ('install-base=', None,
         "base installation directory (instead of --prefix or --home)"),
        ('install-platbase=', None,
         "base installation directory for platform-specific files " +
         "(instead of --exec-prefix or --home)"),
        ('root=', None,
         "install everything relative to this alternate root directory"),

        # Or, explicitly set the installation scheme
        ('install-purelib=', None,
         "installation directory for pure Python module distributions"),
        ('install-platlib=', None,
         "installation directory for non-pure module distributions"),
        ('install-lib=', None,
         "installation directory for all module distributions " +
         "(overrides --install-purelib and --install-platlib)"),

        ('install-headers=', None,
         "installation directory for C/C++ headers"),
        ('install-scripts=', None,
         "installation directory for Python scripts"),
        ('install-data=', None,
         "installation directory for data files"),

        # Byte-compilation options -- see install_lib.py for details, as
        # these are duplicated from there (but only install_lib does
        # anything with them).
        ('compile', 'c', "compile .py to .pyc [default]"),
        ('no-compile', None, "don't compile .py files"),
        ('optimize=', 'O',
         "also compile with optimization: -O1 for \"python -O\", "
         "-O2 for \"python -OO\", and -O0 to disable [default: -O0]"),

        # Miscellaneous control options
        ('force', 'f',
         "force installation (overwrite any existing files)"),
        ('skip-build', None,
         "skip rebuilding everything (for testing/debugging)"),

        # Where to install documentation (eventually!)
        #('doc-format=', None, "format of documentation to generate"),
        #('install-man=', None, "directory for Unix man pages"),
        #('install-html=', None, "directory for HTML documentation"),
        #('install-info=', None, "directory for GNU info files"),

        ('record=', None,
         "filename in which to record list of installed files"),
        ]

    boolean_options = ['compile', 'force', 'skip-build']

    if HAS_USER_SITE:
        user_options.append(('user', None,
                             "install in user site-package '%s'" % USER_SITE))
        boolean_options.append('user')

    negative_opt = {'no-compile' : 'compile'}


    def initialize_options(self):
        """Initializes options."""
        # High-level options: these select both an installation base
        # and scheme.
        self.prefix = None
        self.exec_prefix = None
        self.home = None
        self.user = 0

        # These select only the installation base; it's up to the user to
        # specify the installation scheme (currently, that means supplying
        # the --install-{platlib,purelib,scripts,data} options).
        self.install_base = None
        self.install_platbase = None
        self.root = None

        # These options are the actual installation directories; if not
        # supplied by the user, they are filled in using the installation
        # scheme implied by prefix/exec-prefix/home and the contents of
        # that installation scheme.
        self.install_purelib = None     # for pure module distributions
        self.install_platlib = None     # non-pure (dists w/ extensions)
        self.install_headers = None     # for C/C++ headers
        self.install_lib = None         # set to either purelib or platlib
        self.install_scripts = None
        self.install_data = None
        self.install_userbase = USER_BASE
        self.install_usersite = USER_SITE

        self.compile = None
        self.optimize = None

        # Deprecated
        # These two are for putting non-packagized distributions into their
        # own directory and creating a .pth file if it makes sense.
        # 'extra_path' comes from the setup file; 'install_path_file' can
        # be turned off if it makes no sense to install a .pth file.  (But
        # better to install it uselessly than to guess wrong and not
        # install it when it's necessary and would be used!)  Currently,
        # 'install_path_file' is always true unless some outsider meddles
        # with it.
        self.extra_path = None
        self.install_path_file = 1

        # 'force' forces installation, even if target files are not
        # out-of-date.  'skip_build' skips running the "build" command,
        # handy if you know it's not necessary.  'warn_dir' (which is *not*
        # a user option, it's just there so the bdist_* commands can turn
        # it off) determines whether we warn about installing to a
        # directory not in sys.path.
        self.force = 0
        self.skip_build = 0
        self.warn_dir = 1

        # These are only here as a conduit from the 'build' command to the
        # 'install_*' commands that do the real work.  ('build_base' isn't
        # actually used anywhere, but it might be useful in future.)  They
        # are not user options, because if the user told the install
        # command where the build directory is, that wouldn't affect the
        # build command.
        self.build_base = None
        self.build_lib = None

        # Not defined yet because we don't know anything about
        # documentation yet.
        #self.install_man = None
        #self.install_html = None
        #self.install_info = None

        self.record = None


    # -- Option finalizing methods -------------------------------------
    # (This is rather more involved than for most commands,
    # because this is where the policy for installing third-
    # party Python modules on various platforms given a wide
    # array of user input is decided.  Yes, it's quite complex!)

    def finalize_options(self):
        """Finalizes options."""
        # This method (and its helpers, like 'finalize_unix()',
        # 'finalize_other()', and 'select_scheme()') is where the default
        # installation directories for modules, extension modules, and
        # anything else we care to install from a Python module
        # distribution.  Thus, this code makes a pretty important policy
        # statement about how third-party stuff is added to a Python
        # installation!  Note that the actual work of installation is done
        # by the relatively simple 'install_*' commands; they just take
        # their orders from the installation directory options determined
        # here.

        # Check for errors/inconsistencies in the options; first, stuff
        # that's wrong on any platform.

        if ((self.prefix or self.exec_prefix or self.home) and
            (self.install_base or self.install_platbase)):
            raise DistutilsOptionError(
                   "must supply either prefix/exec-prefix/home or " +
                   "install-base/install-platbase -- not both")

        if self.home and (self.prefix or self.exec_prefix):
            raise DistutilsOptionError(
                  "must supply either home or prefix/exec-prefix -- not both")

        if self.user and (self.prefix or self.exec_prefix or self.home or
                self.install_base or self.install_platbase):
            raise DistutilsOptionError("can't combine user with prefix, "
                                       "exec_prefix/home, or install_(plat)base")

        # Next, stuff that's wrong (or dubious) only on certain platforms.
        if os.name != "posix":
            if self.exec_prefix:
                self.warn("exec-prefix option ignored on this platform")
                self.exec_prefix = None

        # Now the interesting logic -- so interesting that we farm it out
        # to other methods.  The goal of these methods is to set the final
        # values for the install_{lib,scripts,data,...}  options, using as
        # input a heady brew of prefix, exec_prefix, home, install_base,
        # install_platbase, user-supplied versions of
        # install_{purelib,platlib,lib,scripts,data,...}, and the
        # INSTALL_SCHEME dictionary above.  Phew!

        self.dump_dirs("pre-finalize_{unix,other}")

        if os.name == 'posix':
            self.finalize_unix()
        else:
            self.finalize_other()

        self.dump_dirs("post-finalize_{unix,other}()")

        # Expand configuration variables, tilde, etc. in self.install_base
        # and self.install_platbase -- that way, we can use $base or
        # $platbase in the other installation directories and not worry
        # about needing recursive variable expansion (shudder).

        py_version = sys.version.split()[0]
        (prefix, exec_prefix) = get_config_vars('prefix', 'exec_prefix')
        try:
            abiflags = sys.abiflags
        except AttributeError:
            # sys.abiflags may not be defined on all platforms.
            abiflags = ''
        self.config_vars = {'dist_name': self.distribution.get_name(),
                            'dist_version': self.distribution.get_version(),
                            'dist_fullname': self.distribution.get_fullname(),
                            'py_version': py_version,
                            'py_version_short': '%d.%d' % sys.version_info[:2],
                            'py_version_nodot': '%d%d' % sys.version_info[:2],
                            'sys_prefix': prefix,
                            'prefix': prefix,
                            'sys_exec_prefix': exec_prefix,
                            'exec_prefix': exec_prefix,
                            'abiflags': abiflags,
                           }

        if HAS_USER_SITE:
            self.config_vars['userbase'] = self.install_userbase
            self.config_vars['usersite'] = self.install_usersite

        self.expand_basedirs()

        self.dump_dirs("post-expand_basedirs()")

        # Now define config vars for the base directories so we can expand
        # everything else.
        self.config_vars['base'] = self.install_base
        self.config_vars['platbase'] = self.install_platbase

        if DEBUG:
            from pprint import pprint
            print("config vars:")
            pprint(self.config_vars)

        # Expand "~" and configuration variables in the installation
        # directories.
        self.expand_dirs()

        self.dump_dirs("post-expand_dirs()")

        # Create directories in the home dir:
        if self.user:
            self.create_home_path()

        # Pick the actual directory to install all modules to: either
        # install_purelib or install_platlib, depending on whether this
        # module distribution is pure or not.  Of course, if the user
        # already specified install_lib, use their selection.
        if self.install_lib is None:
            if self.distribution.ext_modules: # has extensions: non-pure
                self.install_lib = self.install_platlib
            else:
                self.install_lib = self.install_purelib


        # Convert directories from Unix /-separated syntax to the local
        # convention.
        self.convert_paths('lib', 'purelib', 'platlib',
                           'scripts', 'data', 'headers',
                           'userbase', 'usersite')

        # Deprecated
        # Well, we're not actually fully completely finalized yet: we still
        # have to deal with 'extra_path', which is the hack for allowing
        # non-packagized module distributions (hello, Numerical Python!) to
        # get their own directories.
        self.handle_extra_path()
        self.install_libbase = self.install_lib # needed for .pth file
        self.install_lib = os.path.join(self.install_lib, self.extra_dirs)

        # If a new root directory was supplied, make all the installation
        # dirs relative to it.
        if self.root is not None:
            self.change_roots('libbase', 'lib', 'purelib', 'platlib',
                              'scripts', 'data', 'headers')

        self.dump_dirs("after prepending root")

        # Find out the build directories, ie. where to install from.
        self.set_undefined_options('build',
                                   ('build_base', 'build_base'),
                                   ('build_lib', 'build_lib'))

        # Punt on doc directories for now -- after all, we're punting on
        # documentation completely!

    def dump_dirs(self, msg):
        """Dumps the list of user options."""
        if not DEBUG:
            return
        from distutils.fancy_getopt import longopt_xlate
        log.debug(msg + ":")
        for opt in self.user_options:
            opt_name = opt[0]
            if opt_name[-1] == "=":
                opt_name = opt_name[0:-1]
            if opt_name in self.negative_opt:
                opt_name = self.negative_opt[opt_name]
                opt_name = opt_name.translate(longopt_xlate)
                val = not getattr(self, opt_name)
            else:
                opt_name = opt_name.translate(longopt_xlate)
                val = getattr(self, opt_name)
            log.debug("  %s: %s", opt_name, val)

    def finalize_unix(self):
        """Finalizes options for posix platforms."""
        if self.install_base is not None or self.install_platbase is not None:
            if ((self.install_lib is None and
                 self.install_purelib is None and
                 self.install_platlib is None) or
                self.install_headers is None or
                self.install_scripts is None or
                self.install_data is None):
                raise DistutilsOptionError(
                      "install-base or install-platbase supplied, but "
                      "installation scheme is incomplete")
            return

        if self.user:
            if self.install_userbase is None:
                raise DistutilsPlatformError(
                    "User base directory is not specified")
            self.install_base = self.install_platbase = self.install_userbase
            self.select_scheme("unix_user")
        elif self.home is not None:
            self.install_base = self.install_platbase = self.home
            self.select_scheme("unix_home")
        else:
            if self.prefix is None:
                if self.exec_prefix is not None:
                    raise DistutilsOptionError(
                          "must not supply exec-prefix without prefix")

                # self.prefix is set to sys.prefix + /local/
                # if neither RPM build nor virtual environment is
                # detected to make pip and distutils install packages
                # into the separate location.
                if (not (hasattr(sys, 'real_prefix') or
                    sys.prefix != sys.base_prefix) and
                    'RPM_BUILD_ROOT' not in os.environ):
                    addition = "/local"
                else:
                    addition = ""

                self.prefix = os.path.normpath(sys.prefix) + addition
                self.exec_prefix = os.path.normpath(sys.exec_prefix) + addition

            else:
                if self.exec_prefix is None:
                    self.exec_prefix = self.prefix

            self.install_base = self.prefix
            self.install_platbase = self.exec_prefix
            self.select_scheme("unix_prefix")

    def finalize_other(self):
        """Finalizes options for non-posix platforms"""
        if self.user:
            if self.install_userbase is None:
                raise DistutilsPlatformError(
                    "User base directory is not specified")
            self.install_base = self.install_platbase = self.install_userbase
            self.select_scheme(os.name + "_user")
        elif self.home is not None:
            self.install_base = self.install_platbase = self.home
            self.select_scheme("unix_home")
        else:
            if self.prefix is None:
                self.prefix = os.path.normpath(sys.prefix)

            self.install_base = self.install_platbase = self.prefix
            try:
                self.select_scheme(os.name)
            except KeyError:
                raise DistutilsPlatformError(
                      "I don't know how to install stuff on '%s'" % os.name)

    def select_scheme(self, name):
        """Sets the install directories by applying the install schemes."""
        # it's the caller's problem if they supply a bad name!
        scheme = INSTALL_SCHEMES[name]
        for key in SCHEME_KEYS:
            attrname = 'install_' + key
            if getattr(self, attrname) is None:
                setattr(self, attrname, scheme[key])

    def _expand_attrs(self, attrs):
        for attr in attrs:
            val = getattr(self, attr)
            if val is not None:
                if os.name == 'posix' or os.name == 'nt':
                    val = os.path.expanduser(val)
                val = subst_vars(val, self.config_vars)
                setattr(self, attr, val)

    def expand_basedirs(self):
        """Calls `os.path.expanduser` on install_base, install_platbase and
        root."""
        self._expand_attrs(['install_base', 'install_platbase', 'root'])

    def expand_dirs(self):
        """Calls `os.path.expanduser` on install dirs."""
        self._expand_attrs(['install_purelib', 'install_platlib',
                            'install_lib', 'install_headers',
                            'install_scripts', 'install_data',])

    def convert_paths(self, *names):
        """Call `convert_path` over `names`."""
        for name in names:
            attr = "install_" + name
            setattr(self, attr, convert_path(getattr(self, attr)))

    def handle_extra_path(self):
        """Set `path_file` and `extra_dirs` using `extra_path`."""
        if self.extra_path is None:
            self.extra_path = self.distribution.extra_path

        if self.extra_path is not None:
            log.warn(
                "Distribution option extra_path is deprecated. "
                "See issue27919 for details."
            )
            if isinstance(self.extra_path, str):
                self.extra_path = self.extra_path.split(',')

            if len(self.extra_path) == 1:
                path_file = extra_dirs = self.extra_path[0]
            elif len(self.extra_path) == 2:
                path_file, extra_dirs = self.extra_path
            else:
                raise DistutilsOptionError(
                      "'extra_path' option must be a list, tuple, or "
                      "comma-separated string with 1 or 2 elements")

            # convert to local form in case Unix notation used (as it
            # should be in setup scripts)
            extra_dirs = convert_path(extra_dirs)
        else:
            path_file = None
            extra_dirs = ''

        # XXX should we warn if path_file and not extra_dirs? (in which
        # case the path file would be harmless but pointless)
        self.path_file = path_file
        self.extra_dirs = extra_dirs

    def change_roots(self, *names):
        """Change the install directories pointed by name using root."""
        for name in names:
            attr = "install_" + name
            setattr(self, attr, change_root(self.root, getattr(self, attr)))

    def create_home_path(self):
        """Create directories under ~."""
        if not self.user:
            return
        home = convert_path(os.path.expanduser("~"))
        for name, path in self.config_vars.items():
            if path.startswith(home) and not os.path.isdir(path):
                self.debug_print("os.makedirs('%s', 0o700)" % path)
                os.makedirs(path, 0o700)

    # -- Command execution methods -------------------------------------

    def run(self):
        """Runs the command."""
        # Obviously have to build before we can install
        if not self.skip_build:
            self.run_command('build')
            # If we built for any other platform, we can't install.
            build_plat = self.distribution.get_command_obj('build').plat_name
            # check warn_dir - it is a clue that the 'install' is happening
            # internally, and not to sys.path, so we don't check the platform
            # matches what we are running.
            if self.warn_dir and build_plat != get_platform():
                raise DistutilsPlatformError("Can't install when "
                                             "cross-compiling")

        # Run all sub-commands (at least those that need to be run)
        for cmd_name in self.get_sub_commands():
            self.run_command(cmd_name)

        if self.path_file:
            self.create_path_file()

        # write list of installed files, if requested.
        if self.record:
            outputs = self.get_outputs()
            if self.root:               # strip any package prefix
                root_len = len(self.root)
                for counter in range(len(outputs)):
                    outputs[counter] = outputs[counter][root_len:]
            self.execute(write_file,
                         (self.record, outputs),
                         "writing list of installed files to '%s'" %
                         self.record)

        sys_path = map(os.path.normpath, sys.path)
        sys_path = map(os.path.normcase, sys_path)
        install_lib = os.path.normcase(os.path.normpath(self.install_lib))
        if (self.warn_dir and
            not (self.path_file and self.install_path_file) and
            install_lib not in sys_path):
            log.debug(("modules installed to '%s', which is not in "
                       "Python's module search path (sys.path) -- "
                       "you'll have to change the search path yourself"),
                       self.install_lib)

    def create_path_file(self):
        """Creates the .pth file"""
        filename = os.path.join(self.install_libbase,
                                self.path_file + ".pth")
        if self.install_path_file:
            self.execute(write_file,
                         (filename, [self.extra_dirs]),
                         "creating %s" % filename)
        else:
            self.warn("path file '%s' not created" % filename)


    # -- Reporting methods ---------------------------------------------

    def get_outputs(self):
        """Assembles the outputs of all the sub-commands."""
        outputs = []
        for cmd_name in self.get_sub_commands():
            cmd = self.get_finalized_command(cmd_name)
            # Add the contents of cmd.get_outputs(), ensuring
            # that outputs doesn't contain duplicate entries
            for filename in cmd.get_outputs():
                if filename not in outputs:
                    outputs.append(filename)

        if self.path_file and self.install_path_file:
            outputs.append(os.path.join(self.install_libbase,
                                        self.path_file + ".pth"))

        return outputs

    def get_inputs(self):
        """Returns the inputs of all the sub-commands"""
        # XXX gee, this looks familiar ;-(
        inputs = []
        for cmd_name in self.get_sub_commands():
            cmd = self.get_finalized_command(cmd_name)
            inputs.extend(cmd.get_inputs())

        return inputs

    # -- Predicates for sub-command list -------------------------------

    def has_lib(self):
        """Returns true if the current distribution has any Python
        modules to install."""
        return (self.distribution.has_pure_modules() or
                self.distribution.has_ext_modules())

    def has_headers(self):
        """Returns true if the current distribution has any headers to
        install."""
        return self.distribution.has_headers()

    def has_scripts(self):
        """Returns true if the current distribution has any scripts to.
        install."""
        return self.distribution.has_scripts()

    def has_data(self):
        """Returns true if the current distribution has any data to.
        install."""
        return self.distribution.has_data_files()

    # 'sub_commands': a list of commands this command might have to run to
    # get its work done.  See cmd.py for more info.
    sub_commands = [('install_lib',     has_lib),
                    ('install_headers', has_headers),
                    ('install_scripts', has_scripts),
                    ('install_data',    has_data),
                    ('install_egg_info', lambda self:True),
                   ]
distutils/command/install_egg_info.py000064400000005053151153537440014076 0ustar00"""distutils.command.install_egg_info

Implements the Distutils 'install_egg_info' command, for installing
a package's PKG-INFO metadata."""


from distutils.cmd import Command
from distutils import log, dir_util
import os, sys, re

class install_egg_info(Command):
    """Install an .egg-info file for the package"""

    description = "Install package's PKG-INFO metadata as an .egg-info file"
    user_options = [
        ('install-dir=', 'd', "directory to install to"),
    ]

    def initialize_options(self):
        self.install_dir = None

    def finalize_options(self):
        self.set_undefined_options('install_lib',('install_dir','install_dir'))
        basename = "%s-%s-py%d.%d.egg-info" % (
            to_filename(safe_name(self.distribution.get_name())),
            to_filename(safe_version(self.distribution.get_version())),
            *sys.version_info[:2]
        )
        self.target = os.path.join(self.install_dir, basename)
        self.outputs = [self.target]

    def run(self):
        target = self.target
        if os.path.isdir(target) and not os.path.islink(target):
            dir_util.remove_tree(target, dry_run=self.dry_run)
        elif os.path.exists(target):
            self.execute(os.unlink,(self.target,),"Removing "+target)
        elif not os.path.isdir(self.install_dir):
            self.execute(os.makedirs, (self.install_dir,),
                         "Creating "+self.install_dir)
        log.info("Writing %s", target)
        if not self.dry_run:
            with open(target, 'w', encoding='UTF-8') as f:
                self.distribution.metadata.write_pkg_file(f)

    def get_outputs(self):
        return self.outputs


# The following routines are taken from setuptools' pkg_resources module and
# can be replaced by importing them from pkg_resources once it is included
# in the stdlib.

def safe_name(name):
    """Convert an arbitrary string to a standard distribution name

    Any runs of non-alphanumeric/. characters are replaced with a single '-'.
    """
    return re.sub('[^A-Za-z0-9.]+', '-', name)


def safe_version(version):
    """Convert an arbitrary string to a standard version string

    Spaces become dots, and all other non-alphanumeric characters become
    dashes, with runs of multiple dashes condensed to a single dash.
    """
    version = version.replace(' ','.')
    return re.sub('[^A-Za-z0-9.]+', '-', version)


def to_filename(name):
    """Convert a project or version name to its filename-escaped form

    Any '-' characters are currently replaced with '_'.
    """
    return name.replace('-','_')
distutils/command/command_template000064400000001171151153537440013452 0ustar00"""distutils.command.x

Implements the Distutils 'x' command.
"""

# created 2000/mm/dd, John Doe

__revision__ = "$Id$"

from distutils.core import Command


class x(Command):

    # Brief (40-50 characters) description of the command
    description = ""

    # List of option tuples: long name, short name (None if no short
    # name), and help string.
    user_options = [('', '',
                     ""),
                   ]

    def initialize_options(self):
        self. = None
        self. = None
        self. = None

    def finalize_options(self):
        if self.x is None:
            self.x = 

    def run(self):
distutils/command/upload.py000064400000016364151153537440012066 0ustar00"""
distutils.command.upload

Implements the Distutils 'upload' subcommand (upload package to a package
index).
"""

import os
import io
import platform
import hashlib
from base64 import standard_b64encode
from urllib.request import urlopen, Request, HTTPError
from urllib.parse import urlparse
from distutils.errors import DistutilsError, DistutilsOptionError
from distutils.core import PyPIRCCommand
from distutils.spawn import spawn
from distutils import log

class upload(PyPIRCCommand):

    description = "upload binary package to PyPI"

    user_options = PyPIRCCommand.user_options + [
        ('sign', 's',
         'sign files to upload using gpg'),
        ('identity=', 'i', 'GPG identity used to sign files'),
        ]

    boolean_options = PyPIRCCommand.boolean_options + ['sign']

    def initialize_options(self):
        PyPIRCCommand.initialize_options(self)
        self.username = ''
        self.password = ''
        self.show_response = 0
        self.sign = False
        self.identity = None

    def finalize_options(self):
        PyPIRCCommand.finalize_options(self)
        if self.identity and not self.sign:
            raise DistutilsOptionError(
                "Must use --sign for --identity to have meaning"
            )
        config = self._read_pypirc()
        if config != {}:
            self.username = config['username']
            self.password = config['password']
            self.repository = config['repository']
            self.realm = config['realm']

        # getting the password from the distribution
        # if previously set by the register command
        if not self.password and self.distribution.password:
            self.password = self.distribution.password

    def run(self):
        if not self.distribution.dist_files:
            msg = ("Must create and upload files in one command "
                   "(e.g. setup.py sdist upload)")
            raise DistutilsOptionError(msg)
        for command, pyversion, filename in self.distribution.dist_files:
            self.upload_file(command, pyversion, filename)

    def upload_file(self, command, pyversion, filename):
        # Makes sure the repository URL is compliant
        schema, netloc, url, params, query, fragments = \
            urlparse(self.repository)
        if params or query or fragments:
            raise AssertionError("Incompatible url %s" % self.repository)

        if schema not in ('http', 'https'):
            raise AssertionError("unsupported schema " + schema)

        # Sign if requested
        if self.sign:
            gpg_args = ["gpg", "--detach-sign", "-a", filename]
            if self.identity:
                gpg_args[2:2] = ["--local-user", self.identity]
            spawn(gpg_args,
                  dry_run=self.dry_run)

        # Fill in the data - send all the meta-data in case we need to
        # register a new release
        f = open(filename,'rb')
        try:
            content = f.read()
        finally:
            f.close()
        meta = self.distribution.metadata
        data = {
            # action
            ':action': 'file_upload',
            'protocol_version': '1',

            # identify release
            'name': meta.get_name(),
            'version': meta.get_version(),

            # file content
            'content': (os.path.basename(filename),content),
            'filetype': command,
            'pyversion': pyversion,
            'sha256_digest': hashlib.sha256(content).hexdigest(),

            # additional meta-data
            'metadata_version': '1.0',
            'summary': meta.get_description(),
            'home_page': meta.get_url(),
            'author': meta.get_contact(),
            'author_email': meta.get_contact_email(),
            'license': meta.get_licence(),
            'description': meta.get_long_description(),
            'keywords': meta.get_keywords(),
            'platform': meta.get_platforms(),
            'classifiers': meta.get_classifiers(),
            'download_url': meta.get_download_url(),
            # PEP 314
            'provides': meta.get_provides(),
            'requires': meta.get_requires(),
            'obsoletes': meta.get_obsoletes(),
            }

        try:
            digest = hashlib.md5(content).hexdigest()
        except ValueError as e:
            msg = 'calculating md5 checksum failed: %s' % e
            self.announce(msg, log.INFO)
            from _hashlib import get_fips_mode
            if not get_fips_mode():
                # this really shouldn't fail
                raise
        else:
            data['md5_digest'] = digest

        data['comment'] = ''

        if self.sign:
            with open(filename + ".asc", "rb") as f:
                data['gpg_signature'] = (os.path.basename(filename) + ".asc",
                                         f.read())

        # set up the authentication
        user_pass = (self.username + ":" + self.password).encode('ascii')
        # The exact encoding of the authentication string is debated.
        # Anyway PyPI only accepts ascii for both username or password.
        auth = "Basic " + standard_b64encode(user_pass).decode('ascii')

        # Build up the MIME payload for the POST data
        boundary = '--------------GHSKFJDLGDS7543FJKLFHRE75642756743254'
        sep_boundary = b'\r\n--' + boundary.encode('ascii')
        end_boundary = sep_boundary + b'--\r\n'
        body = io.BytesIO()
        for key, value in data.items():
            title = '\r\nContent-Disposition: form-data; name="%s"' % key
            # handle multiple entries for the same name
            if not isinstance(value, list):
                value = [value]
            for value in value:
                if type(value) is tuple:
                    title += '; filename="%s"' % value[0]
                    value = value[1]
                else:
                    value = str(value).encode('utf-8')
                body.write(sep_boundary)
                body.write(title.encode('utf-8'))
                body.write(b"\r\n\r\n")
                body.write(value)
        body.write(end_boundary)
        body = body.getvalue()

        msg = "Submitting %s to %s" % (filename, self.repository)
        self.announce(msg, log.INFO)

        # build the Request
        headers = {
            'Content-type': 'multipart/form-data; boundary=%s' % boundary,
            'Content-length': str(len(body)),
            'Authorization': auth,
        }

        request = Request(self.repository, data=body,
                          headers=headers)
        # send the data
        try:
            result = urlopen(request)
            status = result.getcode()
            reason = result.msg
        except HTTPError as e:
            status = e.code
            reason = e.msg
        except OSError as e:
            self.announce(str(e), log.ERROR)
            raise

        if status == 200:
            self.announce('Server response (%s): %s' % (status, reason),
                          log.INFO)
            if self.show_response:
                text = self._read_pypi_response(result)
                msg = '\n'.join(('-' * 75, text, '-' * 75))
                self.announce(msg, log.INFO)
        else:
            msg = 'Upload failed (%s): %s' % (status, reason)
            self.announce(msg, log.ERROR)
            raise DistutilsError(msg)
distutils/command/clean.py000064400000005330151153537440011653 0ustar00"""distutils.command.clean

Implements the Distutils 'clean' command."""

# contributed by Bastian Kleineidam <calvin@cs.uni-sb.de>, added 2000-03-18

import os
from distutils.core import Command
from distutils.dir_util import remove_tree
from distutils import log

class clean(Command):

    description = "clean up temporary files from 'build' command"
    user_options = [
        ('build-base=', 'b',
         "base build directory (default: 'build.build-base')"),
        ('build-lib=', None,
         "build directory for all modules (default: 'build.build-lib')"),
        ('build-temp=', 't',
         "temporary build directory (default: 'build.build-temp')"),
        ('build-scripts=', None,
         "build directory for scripts (default: 'build.build-scripts')"),
        ('bdist-base=', None,
         "temporary directory for built distributions"),
        ('all', 'a',
         "remove all build output, not just temporary by-products")
    ]

    boolean_options = ['all']

    def initialize_options(self):
        self.build_base = None
        self.build_lib = None
        self.build_temp = None
        self.build_scripts = None
        self.bdist_base = None
        self.all = None

    def finalize_options(self):
        self.set_undefined_options('build',
                                   ('build_base', 'build_base'),
                                   ('build_lib', 'build_lib'),
                                   ('build_scripts', 'build_scripts'),
                                   ('build_temp', 'build_temp'))
        self.set_undefined_options('bdist',
                                   ('bdist_base', 'bdist_base'))

    def run(self):
        # remove the build/temp.<plat> directory (unless it's already
        # gone)
        if os.path.exists(self.build_temp):
            remove_tree(self.build_temp, dry_run=self.dry_run)
        else:
            log.debug("'%s' does not exist -- can't clean it",
                      self.build_temp)

        if self.all:
            # remove build directories
            for directory in (self.build_lib,
                              self.bdist_base,
                              self.build_scripts):
                if os.path.exists(directory):
                    remove_tree(directory, dry_run=self.dry_run)
                else:
                    log.warn("'%s' does not exist -- can't clean it",
                             directory)

        # just for the heck of it, try to remove the base build directory:
        # we might have emptied it right now, but if not we don't care
        if not self.dry_run:
            try:
                os.rmdir(self.build_base)
                log.info("removing '%s'", self.build_base)
            except OSError:
                pass
distutils/command/install_lib.py000064400000020315151153537440013065 0ustar00"""distutils.command.install_lib

Implements the Distutils 'install_lib' command
(install all Python modules)."""

import os
import importlib.util
import sys

from distutils.core import Command
from distutils.errors import DistutilsOptionError


# Extension for Python source files.
PYTHON_SOURCE_EXTENSION = ".py"

class install_lib(Command):

    description = "install all Python modules (extensions and pure Python)"

    # The byte-compilation options are a tad confusing.  Here are the
    # possible scenarios:
    #   1) no compilation at all (--no-compile --no-optimize)
    #   2) compile .pyc only (--compile --no-optimize; default)
    #   3) compile .pyc and "opt-1" .pyc (--compile --optimize)
    #   4) compile "opt-1" .pyc only (--no-compile --optimize)
    #   5) compile .pyc and "opt-2" .pyc (--compile --optimize-more)
    #   6) compile "opt-2" .pyc only (--no-compile --optimize-more)
    #
    # The UI for this is two options, 'compile' and 'optimize'.
    # 'compile' is strictly boolean, and only decides whether to
    # generate .pyc files.  'optimize' is three-way (0, 1, or 2), and
    # decides both whether to generate .pyc files and what level of
    # optimization to use.

    user_options = [
        ('install-dir=', 'd', "directory to install to"),
        ('build-dir=','b', "build directory (where to install from)"),
        ('force', 'f', "force installation (overwrite existing files)"),
        ('compile', 'c', "compile .py to .pyc [default]"),
        ('no-compile', None, "don't compile .py files"),
        ('optimize=', 'O',
         "also compile with optimization: -O1 for \"python -O\", "
         "-O2 for \"python -OO\", and -O0 to disable [default: -O0]"),
        ('skip-build', None, "skip the build steps"),
        ]

    boolean_options = ['force', 'compile', 'skip-build']
    negative_opt = {'no-compile' : 'compile'}

    def initialize_options(self):
        # let the 'install' command dictate our installation directory
        self.install_dir = None
        self.build_dir = None
        self.force = 0
        self.compile = None
        self.optimize = None
        self.skip_build = None

    def finalize_options(self):
        # Get all the information we need to install pure Python modules
        # from the umbrella 'install' command -- build (source) directory,
        # install (target) directory, and whether to compile .py files.
        self.set_undefined_options('install',
                                   ('build_lib', 'build_dir'),
                                   ('install_lib', 'install_dir'),
                                   ('force', 'force'),
                                   ('compile', 'compile'),
                                   ('optimize', 'optimize'),
                                   ('skip_build', 'skip_build'),
                                  )

        if self.compile is None:
            self.compile = True
        if self.optimize is None:
            self.optimize = False

        if not isinstance(self.optimize, int):
            try:
                self.optimize = int(self.optimize)
                if self.optimize not in (0, 1, 2):
                    raise AssertionError
            except (ValueError, AssertionError):
                raise DistutilsOptionError("optimize must be 0, 1, or 2")

    def run(self):
        # Make sure we have built everything we need first
        self.build()

        # Install everything: simply dump the entire contents of the build
        # directory to the installation directory (that's the beauty of
        # having a build directory!)
        outfiles = self.install()

        # (Optionally) compile .py to .pyc
        if outfiles is not None and self.distribution.has_pure_modules():
            self.byte_compile(outfiles)

    # -- Top-level worker functions ------------------------------------
    # (called from 'run()')

    def build(self):
        if not self.skip_build:
            if self.distribution.has_pure_modules():
                self.run_command('build_py')
            if self.distribution.has_ext_modules():
                self.run_command('build_ext')

    def install(self):
        if os.path.isdir(self.build_dir):
            outfiles = self.copy_tree(self.build_dir, self.install_dir)
        else:
            self.warn("'%s' does not exist -- no Python modules to install" %
                      self.build_dir)
            return
        return outfiles

    def byte_compile(self, files):
        if sys.dont_write_bytecode:
            self.warn('byte-compiling is disabled, skipping.')
            return

        from distutils.util import byte_compile

        # Get the "--root" directory supplied to the "install" command,
        # and use it as a prefix to strip off the purported filename
        # encoded in bytecode files.  This is far from complete, but it
        # should at least generate usable bytecode in RPM distributions.
        install_root = self.get_finalized_command('install').root

        if self.compile:
            byte_compile(files, optimize=0,
                         force=self.force, prefix=install_root,
                         dry_run=self.dry_run)
        if self.optimize > 0:
            byte_compile(files, optimize=self.optimize,
                         force=self.force, prefix=install_root,
                         verbose=self.verbose, dry_run=self.dry_run)


    # -- Utility methods -----------------------------------------------

    def _mutate_outputs(self, has_any, build_cmd, cmd_option, output_dir):
        if not has_any:
            return []

        build_cmd = self.get_finalized_command(build_cmd)
        build_files = build_cmd.get_outputs()
        build_dir = getattr(build_cmd, cmd_option)

        prefix_len = len(build_dir) + len(os.sep)
        outputs = []
        for file in build_files:
            outputs.append(os.path.join(output_dir, file[prefix_len:]))

        return outputs

    def _bytecode_filenames(self, py_filenames):
        bytecode_files = []
        for py_file in py_filenames:
            # Since build_py handles package data installation, the
            # list of outputs can contain more than just .py files.
            # Make sure we only report bytecode for the .py files.
            ext = os.path.splitext(os.path.normcase(py_file))[1]
            if ext != PYTHON_SOURCE_EXTENSION:
                continue
            if self.compile:
                bytecode_files.append(importlib.util.cache_from_source(
                    py_file, optimization=''))
            if self.optimize > 0:
                bytecode_files.append(importlib.util.cache_from_source(
                    py_file, optimization=self.optimize))

        return bytecode_files


    # -- External interface --------------------------------------------
    # (called by outsiders)

    def get_outputs(self):
        """Return the list of files that would be installed if this command
        were actually run.  Not affected by the "dry-run" flag or whether
        modules have actually been built yet.
        """
        pure_outputs = \
            self._mutate_outputs(self.distribution.has_pure_modules(),
                                 'build_py', 'build_lib',
                                 self.install_dir)
        if self.compile:
            bytecode_outputs = self._bytecode_filenames(pure_outputs)
        else:
            bytecode_outputs = []

        ext_outputs = \
            self._mutate_outputs(self.distribution.has_ext_modules(),
                                 'build_ext', 'build_lib',
                                 self.install_dir)

        return pure_outputs + bytecode_outputs + ext_outputs

    def get_inputs(self):
        """Get the list of files that are input to this command, ie. the
        files that get installed as they are named in the build tree.
        The files in this list correspond one-to-one to the output
        filenames returned by 'get_outputs()'.
        """
        inputs = []

        if self.distribution.has_pure_modules():
            build_py = self.get_finalized_command('build_py')
            inputs.extend(build_py.get_outputs())

        if self.distribution.has_ext_modules():
            build_ext = self.get_finalized_command('build_ext')
            inputs.extend(build_ext.get_outputs())

        return inputs
distutils/command/build.py000064400000013207151153537440011672 0ustar00"""distutils.command.build

Implements the Distutils 'build' command."""

import sys, os
from distutils.core import Command
from distutils.errors import DistutilsOptionError
from distutils.util import get_platform


def show_compilers():
    from distutils.ccompiler import show_compilers
    show_compilers()


class build(Command):

    description = "build everything needed to install"

    user_options = [
        ('build-base=', 'b',
         "base directory for build library"),
        ('build-purelib=', None,
         "build directory for platform-neutral distributions"),
        ('build-platlib=', None,
         "build directory for platform-specific distributions"),
        ('build-lib=', None,
         "build directory for all distribution (defaults to either " +
         "build-purelib or build-platlib"),
        ('build-scripts=', None,
         "build directory for scripts"),
        ('build-temp=', 't',
         "temporary build directory"),
        ('plat-name=', 'p',
         "platform name to build for, if supported "
         "(default: %s)" % get_platform()),
        ('compiler=', 'c',
         "specify the compiler type"),
        ('parallel=', 'j',
         "number of parallel build jobs"),
        ('debug', 'g',
         "compile extensions and libraries with debugging information"),
        ('force', 'f',
         "forcibly build everything (ignore file timestamps)"),
        ('executable=', 'e',
         "specify final destination interpreter path (build.py)"),
        ]

    boolean_options = ['debug', 'force']

    help_options = [
        ('help-compiler', None,
         "list available compilers", show_compilers),
        ]

    def initialize_options(self):
        self.build_base = 'build'
        # these are decided only after 'build_base' has its final value
        # (unless overridden by the user or client)
        self.build_purelib = None
        self.build_platlib = None
        self.build_lib = None
        self.build_temp = None
        self.build_scripts = None
        self.compiler = None
        self.plat_name = None
        self.debug = None
        self.force = 0
        self.executable = None
        self.parallel = None

    def finalize_options(self):
        if self.plat_name is None:
            self.plat_name = get_platform()
        else:
            # plat-name only supported for windows (other platforms are
            # supported via ./configure flags, if at all).  Avoid misleading
            # other platforms.
            if os.name != 'nt':
                raise DistutilsOptionError(
                            "--plat-name only supported on Windows (try "
                            "using './configure --help' on your platform)")

        plat_specifier = ".%s-%d.%d" % (self.plat_name, *sys.version_info[:2])

        # Make it so Python 2.x and Python 2.x with --with-pydebug don't
        # share the same build directories. Doing so confuses the build
        # process for C modules
        if hasattr(sys, 'gettotalrefcount'):
            plat_specifier += '-pydebug'

        # 'build_purelib' and 'build_platlib' just default to 'lib' and
        # 'lib.<plat>' under the base build directory.  We only use one of
        # them for a given distribution, though --
        if self.build_purelib is None:
            self.build_purelib = os.path.join(self.build_base, 'lib')
        if self.build_platlib is None:
            self.build_platlib = os.path.join(self.build_base,
                                              'lib' + plat_specifier)

        # 'build_lib' is the actual directory that we will use for this
        # particular module distribution -- if user didn't supply it, pick
        # one of 'build_purelib' or 'build_platlib'.
        if self.build_lib is None:
            if self.distribution.ext_modules:
                self.build_lib = self.build_platlib
            else:
                self.build_lib = self.build_purelib

        # 'build_temp' -- temporary directory for compiler turds,
        # "build/temp.<plat>"
        if self.build_temp is None:
            self.build_temp = os.path.join(self.build_base,
                                           'temp' + plat_specifier)
        if self.build_scripts is None:
            self.build_scripts = os.path.join(self.build_base,
                                              'scripts-%d.%d' % sys.version_info[:2])

        if self.executable is None and sys.executable:
            self.executable = os.path.normpath(sys.executable)

        if isinstance(self.parallel, str):
            try:
                self.parallel = int(self.parallel)
            except ValueError:
                raise DistutilsOptionError("parallel should be an integer")

    def run(self):
        # Run all relevant sub-commands.  This will be some subset of:
        #  - build_py      - pure Python modules
        #  - build_clib    - standalone C libraries
        #  - build_ext     - Python extensions
        #  - build_scripts - (Python) scripts
        for cmd_name in self.get_sub_commands():
            self.run_command(cmd_name)


    # -- Predicates for the sub-command list ---------------------------

    def has_pure_modules(self):
        return self.distribution.has_pure_modules()

    def has_c_libraries(self):
        return self.distribution.has_c_libraries()

    def has_ext_modules(self):
        return self.distribution.has_ext_modules()

    def has_scripts(self):
        return self.distribution.has_scripts()


    sub_commands = [('build_py',      has_pure_modules),
                    ('build_clib',    has_c_libraries),
                    ('build_ext',     has_ext_modules),
                    ('build_scripts', has_scripts),
                   ]
distutils/command/build_py.py000064400000041446151153537440012410 0ustar00"""distutils.command.build_py

Implements the Distutils 'build_py' command."""

import os
import importlib.util
import sys
import glob

from distutils.core import Command
from distutils.errors import *
from distutils.util import convert_path, Mixin2to3
from distutils import log

class build_py (Command):

    description = "\"build\" pure Python modules (copy to build directory)"

    user_options = [
        ('build-lib=', 'd', "directory to \"build\" (copy) to"),
        ('compile', 'c', "compile .py to .pyc"),
        ('no-compile', None, "don't compile .py files [default]"),
        ('optimize=', 'O',
         "also compile with optimization: -O1 for \"python -O\", "
         "-O2 for \"python -OO\", and -O0 to disable [default: -O0]"),
        ('force', 'f', "forcibly build everything (ignore file timestamps)"),
        ]

    boolean_options = ['compile', 'force']
    negative_opt = {'no-compile' : 'compile'}

    def initialize_options(self):
        self.build_lib = None
        self.py_modules = None
        self.package = None
        self.package_data = None
        self.package_dir = None
        self.compile = 0
        self.optimize = 0
        self.force = None

    def finalize_options(self):
        self.set_undefined_options('build',
                                   ('build_lib', 'build_lib'),
                                   ('force', 'force'))

        # Get the distribution options that are aliases for build_py
        # options -- list of packages and list of modules.
        self.packages = self.distribution.packages
        self.py_modules = self.distribution.py_modules
        self.package_data = self.distribution.package_data
        self.package_dir = {}
        if self.distribution.package_dir:
            for name, path in self.distribution.package_dir.items():
                self.package_dir[name] = convert_path(path)
        self.data_files = self.get_data_files()

        # Ick, copied straight from install_lib.py (fancy_getopt needs a
        # type system!  Hell, *everything* needs a type system!!!)
        if not isinstance(self.optimize, int):
            try:
                self.optimize = int(self.optimize)
                assert 0 <= self.optimize <= 2
            except (ValueError, AssertionError):
                raise DistutilsOptionError("optimize must be 0, 1, or 2")

    def run(self):
        # XXX copy_file by default preserves atime and mtime.  IMHO this is
        # the right thing to do, but perhaps it should be an option -- in
        # particular, a site administrator might want installed files to
        # reflect the time of installation rather than the last
        # modification time before the installed release.

        # XXX copy_file by default preserves mode, which appears to be the
        # wrong thing to do: if a file is read-only in the working
        # directory, we want it to be installed read/write so that the next
        # installation of the same module distribution can overwrite it
        # without problems.  (This might be a Unix-specific issue.)  Thus
        # we turn off 'preserve_mode' when copying to the build directory,
        # since the build directory is supposed to be exactly what the
        # installation will look like (ie. we preserve mode when
        # installing).

        # Two options control which modules will be installed: 'packages'
        # and 'py_modules'.  The former lets us work with whole packages, not
        # specifying individual modules at all; the latter is for
        # specifying modules one-at-a-time.

        if self.py_modules:
            self.build_modules()
        if self.packages:
            self.build_packages()
            self.build_package_data()

        self.byte_compile(self.get_outputs(include_bytecode=0))

    def get_data_files(self):
        """Generate list of '(package,src_dir,build_dir,filenames)' tuples"""
        data = []
        if not self.packages:
            return data
        for package in self.packages:
            # Locate package source directory
            src_dir = self.get_package_dir(package)

            # Compute package build directory
            build_dir = os.path.join(*([self.build_lib] + package.split('.')))

            # Length of path to strip from found files
            plen = 0
            if src_dir:
                plen = len(src_dir)+1

            # Strip directory from globbed filenames
            filenames = [
                file[plen:] for file in self.find_data_files(package, src_dir)
                ]
            data.append((package, src_dir, build_dir, filenames))
        return data

    def find_data_files(self, package, src_dir):
        """Return filenames for package's data files in 'src_dir'"""
        globs = (self.package_data.get('', [])
                 + self.package_data.get(package, []))
        files = []
        for pattern in globs:
            # Each pattern has to be converted to a platform-specific path
            filelist = glob.glob(os.path.join(glob.escape(src_dir), convert_path(pattern)))
            # Files that match more than one pattern are only added once
            files.extend([fn for fn in filelist if fn not in files
                and os.path.isfile(fn)])
        return files

    def build_package_data(self):
        """Copy data files into build directory"""
        lastdir = None
        for package, src_dir, build_dir, filenames in self.data_files:
            for filename in filenames:
                target = os.path.join(build_dir, filename)
                self.mkpath(os.path.dirname(target))
                self.copy_file(os.path.join(src_dir, filename), target,
                               preserve_mode=False)

    def get_package_dir(self, package):
        """Return the directory, relative to the top of the source
           distribution, where package 'package' should be found
           (at least according to the 'package_dir' option, if any)."""
        path = package.split('.')

        if not self.package_dir:
            if path:
                return os.path.join(*path)
            else:
                return ''
        else:
            tail = []
            while path:
                try:
                    pdir = self.package_dir['.'.join(path)]
                except KeyError:
                    tail.insert(0, path[-1])
                    del path[-1]
                else:
                    tail.insert(0, pdir)
                    return os.path.join(*tail)
            else:
                # Oops, got all the way through 'path' without finding a
                # match in package_dir.  If package_dir defines a directory
                # for the root (nameless) package, then fallback on it;
                # otherwise, we might as well have not consulted
                # package_dir at all, as we just use the directory implied
                # by 'tail' (which should be the same as the original value
                # of 'path' at this point).
                pdir = self.package_dir.get('')
                if pdir is not None:
                    tail.insert(0, pdir)

                if tail:
                    return os.path.join(*tail)
                else:
                    return ''

    def check_package(self, package, package_dir):
        # Empty dir name means current directory, which we can probably
        # assume exists.  Also, os.path.exists and isdir don't know about
        # my "empty string means current dir" convention, so we have to
        # circumvent them.
        if package_dir != "":
            if not os.path.exists(package_dir):
                raise DistutilsFileError(
                      "package directory '%s' does not exist" % package_dir)
            if not os.path.isdir(package_dir):
                raise DistutilsFileError(
                       "supposed package directory '%s' exists, "
                       "but is not a directory" % package_dir)

        # Require __init__.py for all but the "root package"
        if package:
            init_py = os.path.join(package_dir, "__init__.py")
            if os.path.isfile(init_py):
                return init_py
            else:
                log.warn(("package init file '%s' not found " +
                          "(or not a regular file)"), init_py)

        # Either not in a package at all (__init__.py not expected), or
        # __init__.py doesn't exist -- so don't return the filename.
        return None

    def check_module(self, module, module_file):
        if not os.path.isfile(module_file):
            log.warn("file %s (for module %s) not found", module_file, module)
            return False
        else:
            return True

    def find_package_modules(self, package, package_dir):
        self.check_package(package, package_dir)
        module_files = glob.glob(os.path.join(glob.escape(package_dir), "*.py"))
        modules = []
        setup_script = os.path.abspath(self.distribution.script_name)

        for f in module_files:
            abs_f = os.path.abspath(f)
            if abs_f != setup_script:
                module = os.path.splitext(os.path.basename(f))[0]
                modules.append((package, module, f))
            else:
                self.debug_print("excluding %s" % setup_script)
        return modules

    def find_modules(self):
        """Finds individually-specified Python modules, ie. those listed by
        module name in 'self.py_modules'.  Returns a list of tuples (package,
        module_base, filename): 'package' is a tuple of the path through
        package-space to the module; 'module_base' is the bare (no
        packages, no dots) module name, and 'filename' is the path to the
        ".py" file (relative to the distribution root) that implements the
        module.
        """
        # Map package names to tuples of useful info about the package:
        #    (package_dir, checked)
        # package_dir - the directory where we'll find source files for
        #   this package
        # checked - true if we have checked that the package directory
        #   is valid (exists, contains __init__.py, ... ?)
        packages = {}

        # List of (package, module, filename) tuples to return
        modules = []

        # We treat modules-in-packages almost the same as toplevel modules,
        # just the "package" for a toplevel is empty (either an empty
        # string or empty list, depending on context).  Differences:
        #   - don't check for __init__.py in directory for empty package
        for module in self.py_modules:
            path = module.split('.')
            package = '.'.join(path[0:-1])
            module_base = path[-1]

            try:
                (package_dir, checked) = packages[package]
            except KeyError:
                package_dir = self.get_package_dir(package)
                checked = 0

            if not checked:
                init_py = self.check_package(package, package_dir)
                packages[package] = (package_dir, 1)
                if init_py:
                    modules.append((package, "__init__", init_py))

            # XXX perhaps we should also check for just .pyc files
            # (so greedy closed-source bastards can distribute Python
            # modules too)
            module_file = os.path.join(package_dir, module_base + ".py")
            if not self.check_module(module, module_file):
                continue

            modules.append((package, module_base, module_file))

        return modules

    def find_all_modules(self):
        """Compute the list of all modules that will be built, whether
        they are specified one-module-at-a-time ('self.py_modules') or
        by whole packages ('self.packages').  Return a list of tuples
        (package, module, module_file), just like 'find_modules()' and
        'find_package_modules()' do."""
        modules = []
        if self.py_modules:
            modules.extend(self.find_modules())
        if self.packages:
            for package in self.packages:
                package_dir = self.get_package_dir(package)
                m = self.find_package_modules(package, package_dir)
                modules.extend(m)
        return modules

    def get_source_files(self):
        return [module[-1] for module in self.find_all_modules()]

    def get_module_outfile(self, build_dir, package, module):
        outfile_path = [build_dir] + list(package) + [module + ".py"]
        return os.path.join(*outfile_path)

    def get_outputs(self, include_bytecode=1):
        modules = self.find_all_modules()
        outputs = []
        for (package, module, module_file) in modules:
            package = package.split('.')
            filename = self.get_module_outfile(self.build_lib, package, module)
            outputs.append(filename)
            if include_bytecode:
                if self.compile:
                    outputs.append(importlib.util.cache_from_source(
                        filename, optimization=''))
                if self.optimize > 0:
                    outputs.append(importlib.util.cache_from_source(
                        filename, optimization=self.optimize))

        outputs += [
            os.path.join(build_dir, filename)
            for package, src_dir, build_dir, filenames in self.data_files
            for filename in filenames
            ]

        return outputs

    def build_module(self, module, module_file, package):
        if isinstance(package, str):
            package = package.split('.')
        elif not isinstance(package, (list, tuple)):
            raise TypeError(
                  "'package' must be a string (dot-separated), list, or tuple")

        # Now put the module source file into the "build" area -- this is
        # easy, we just copy it somewhere under self.build_lib (the build
        # directory for Python source).
        outfile = self.get_module_outfile(self.build_lib, package, module)
        dir = os.path.dirname(outfile)
        self.mkpath(dir)
        return self.copy_file(module_file, outfile, preserve_mode=0)

    def build_modules(self):
        modules = self.find_modules()
        for (package, module, module_file) in modules:
            # Now "build" the module -- ie. copy the source file to
            # self.build_lib (the build directory for Python source).
            # (Actually, it gets copied to the directory for this package
            # under self.build_lib.)
            self.build_module(module, module_file, package)

    def build_packages(self):
        for package in self.packages:
            # Get list of (package, module, module_file) tuples based on
            # scanning the package directory.  'package' is only included
            # in the tuple so that 'find_modules()' and
            # 'find_package_tuples()' have a consistent interface; it's
            # ignored here (apart from a sanity check).  Also, 'module' is
            # the *unqualified* module name (ie. no dots, no package -- we
            # already know its package!), and 'module_file' is the path to
            # the .py file, relative to the current directory
            # (ie. including 'package_dir').
            package_dir = self.get_package_dir(package)
            modules = self.find_package_modules(package, package_dir)

            # Now loop over the modules we found, "building" each one (just
            # copy it to self.build_lib).
            for (package_, module, module_file) in modules:
                assert package == package_
                self.build_module(module, module_file, package)

    def byte_compile(self, files):
        if sys.dont_write_bytecode:
            self.warn('byte-compiling is disabled, skipping.')
            return

        from distutils.util import byte_compile
        prefix = self.build_lib
        if prefix[-1] != os.sep:
            prefix = prefix + os.sep

        # XXX this code is essentially the same as the 'byte_compile()
        # method of the "install_lib" command, except for the determination
        # of the 'prefix' string.  Hmmm.
        if self.compile:
            byte_compile(files, optimize=0,
                         force=self.force, prefix=prefix, dry_run=self.dry_run)
        if self.optimize > 0:
            byte_compile(files, optimize=self.optimize,
                         force=self.force, prefix=prefix, dry_run=self.dry_run)

class build_py_2to3(build_py, Mixin2to3):
    def run(self):
        self.updated_files = []

        # Base class code
        if self.py_modules:
            self.build_modules()
        if self.packages:
            self.build_packages()
            self.build_package_data()

        # 2to3
        self.run_2to3(self.updated_files)

        # Remaining base class code
        self.byte_compile(self.get_outputs(include_bytecode=0))

    def build_module(self, module, module_file, package):
        res = build_py.build_module(self, module, module_file, package)
        if res[1]:
            # file was copied
            self.updated_files.append(res[0])
        return res
distutils/command/__pycache__/install_lib.cpython-38.opt-1.pyc000064400000011773151153537440020322 0ustar00U

e5d� �@sLdZddlZddlZddlZddlmZddlmZdZ	Gdd�de�Z
dS)zkdistutils.command.install_lib

Implements the Distutils 'install_lib' command
(install all Python modules).�N)�Command)�DistutilsOptionErrorz.pyc@s�eZdZdZdddddddgZd	d
dgZdd
iZd
d�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd �Zd!S)"�install_libz7install all Python modules (extensions and pure Python))zinstall-dir=�dzdirectory to install to)z
build-dir=�bz'build directory (where to install from))�force�fz-force installation (overwrite existing files))�compile�czcompile .py to .pyc [default])�
no-compileNzdon't compile .py files)z	optimize=�Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])�
skip-buildNzskip the build stepsrr	r
rcCs(d|_d|_d|_d|_d|_d|_dS)Nr)�install_dir�	build_dirrr	�optimize�
skip_build��self�r�5/usr/lib64/python3.8/distutils/command/install_lib.py�initialize_options3szinstall_lib.initialize_optionsc	Cs�|�ddddddd�|jdkr&d|_|jdkr6d	|_t|jt�s�zt|j�|_|jd
kr^t�Wn ttfk
r�td��YnXdS)N�install)�	build_libr)rr)rr)r	r	)rr)rrTF)r��zoptimize must be 0, 1, or 2)Zset_undefined_optionsr	r�
isinstance�int�AssertionError�
ValueErrorrrrrr�finalize_options<s&�	


zinstall_lib.finalize_optionscCs0|��|��}|dk	r,|j��r,|�|�dS�N)�buildr�distribution�has_pure_modules�byte_compile�rZoutfilesrrr�runVszinstall_lib.runcCs2|js.|j��r|�d�|j��r.|�d�dS)N�build_py�	build_ext)rr"r#Zrun_command�has_ext_modulesrrrrr!fs



zinstall_lib.buildcCs8tj�|j�r |�|j|j�}n|�d|j�dS|S)Nz3'%s' does not exist -- no Python modules to install)�os�path�isdirrZ	copy_treer�warnr%rrrrms�zinstall_lib.installcCsrtjr|�d�dSddlm}|�d�j}|jrH||d|j||j	d�|j
dkrn|||j
|j||j|j	d�dS)Nz%byte-compiling is disabled, skipping.r)r$r)rr�prefix�dry_run)rrr.�verboser/)�sys�dont_write_bytecoder-Zdistutils.utilr$�get_finalized_command�rootr	rr/rr0)r�filesr$Zinstall_rootrrrr$vs$
�
�zinstall_lib.byte_compilec
	Csd|sgS|�|�}|��}t||�}t|�ttj�}g}|D] }	|�tj�||	|d���q>|Sr )	r3�get_outputs�getattr�lenr*�sep�appendr+�join)
rZhas_anyZ	build_cmdZ
cmd_optionZ
output_dirZbuild_filesr�
prefix_lenZoutputs�filerrr�_mutate_outputs�s

zinstall_lib._mutate_outputscCsrg}|D]d}tj�tj�|��d}|tkr.q|jrJ|�tjj	|dd��|j
dkr|�tjj	||j
d��q|S)Nr�)�optimizationr)r*r+�splitext�normcase�PYTHON_SOURCE_EXTENSIONr	r:�	importlib�util�cache_from_sourcer)rZpy_filenamesZbytecode_filesZpy_fileZextrrr�_bytecode_filenames�s 
�

�
zinstall_lib._bytecode_filenamescCsR|�|j��dd|j�}|jr*|�|�}ng}|�|j��dd|j�}|||S)z�Return the list of files that would be installed if this command
        were actually run.  Not affected by the "dry-run" flag or whether
        modules have actually been built yet.
        r'rr()r>r"r#rr	rGr))rZpure_outputsZbytecode_outputsZext_outputsrrrr6�s ����zinstall_lib.get_outputscCsLg}|j��r&|�d�}|�|���|j��rH|�d�}|�|���|S)z�Get the list of files that are input to this command, ie. the
        files that get installed as they are named in the build tree.
        The files in this list correspond one-to-one to the output
        filenames returned by 'get_outputs()'.
        r'r()r"r#r3�extendr6r))rZinputsr'r(rrr�
get_inputs�s



zinstall_lib.get_inputsN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsZnegative_optrrr&r!rr$r>rGr6rIrrrrrs*�
		r)�__doc__r*�importlib.utilrDr1Zdistutils.corerZdistutils.errorsrrCrrrrr�<module>sdistutils/command/__pycache__/bdist_wininst.cpython-38.opt-2.pyc000064400000020136151153537440020700 0ustar00U

e5d�>�@stddlZddlZddlZddlmZddlmZddlmZm	Z	ddl
TddlmZddl
mZGdd	�d	e�ZdS)
�N)�Command)�get_platform)�create_tree�remove_tree)�*)�get_python_version)�logc
s�eZdZdZdddde�fdddd	d
ddd
dddg
ZddddgZejdkZ	�fdd�Z
dd�Zdd�Zdd�Z
dd�Zd'd!d"�Zd#d$�Zd%d&�Z�ZS)(�
bdist_wininstz-create an executable installer for MS Windows)z
bdist-dir=Nz1temporary directory for creating the distributionz
plat-name=�pz;platform name to embed in generated filenames (default: %s))�	keep-temp�kzPkeep the pseudo-installation tree around after creating the distribution archive)ztarget-version=Nz6require a specific python version on the target system)�no-target-compile�cz/do not compile .py to .pyc on the target system)�no-target-optimize�oz;do not compile .py to .pyo (optimized) on the target system)z	dist-dir=�dz-directory to put final built distributions in)zbitmap=�bz>bitmap to use for the installer instead of python-powered logo)ztitle=�tz?title to display on the installer background instead of default)�
skip-buildNz2skip rebuilding everything (for testing/debugging))zinstall-script=NzUbasename of installation script to be run after installation or before deinstallation)zpre-install-script=Nz{Fully qualified filename of a script to be run before any files are installed.  This script need not be in the distribution)zuser-access-control=Nz�specify Vista's UAC handling - 'none'/default=no handling, 'auto'=use UAC if target Python installed for all users, 'force'=always use UACrr
rr�win32cs t�j||�t�dtd�dS)Nz^bdist_wininst command is deprecated since Python 3.8, use bdist_wheel (wheel packages) instead�)�super�__init__�warnings�warn�DeprecationWarning)�self�args�kw��	__class__��7/usr/lib64/python3.8/distutils/command/bdist_wininst.pyr?s
�zbdist_wininst.__init__cCsRd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_dS)Nr)
�	bdist_dir�	plat_name�	keep_temp�no_target_compile�no_target_optimize�target_version�dist_dir�bitmap�title�
skip_build�install_script�pre_install_script�user_access_control)rr!r!r"�initialize_optionsEsz bdist_wininst.initialize_optionscCs�|�dd�|jdkrR|jr6|jr6|j�d�}|j|_|�d�j}tj	�
|d�|_|js^d|_|js�|j��r�t
�}|jr�|j|kr�td|f��||_|�ddd�|jr�|jjD]}|jtj	�|�kr�q�q�td|j��dS)	N�bdist)r,r,Zwininst�zMtarget version can only be %s, or the '--skip-build' option must be specified)r)r))r$r$z(install_script '%s' not found in scripts)Zset_undefined_optionsr#r,r$�distributionZget_command_obj�get_finalized_command�
bdist_base�os�path�joinr(�has_ext_modulesrZDistutilsOptionErrorr-�scripts�basename)rr1r5Z
short_version�scriptr!r!r"�finalize_optionsUs>
�����zbdist_wininst.finalize_optionsc
Cs�tjdkr&|j��s|j��r&td��|js6|�d�|jddd�}|j	|_
|j|_d|_|j|_|�d�}d|_
d|_|j��r�|j}|s�d	tjdd
�}d|j|f}|�d�}tj�|jd|�|_d
D],}|��}|dkr�|d}t|d||�q�t�d|j	�|��tj�dtj�|j	d��|��tjd=ddlm}|�}	|j� �}
|j!|	d|j	d�}|�"||
|j#�|j���r�t$�}nd}|jj%�&d||�'|
�f�t�(d|�t�)|�|j*�s�t+|j	|j,d�dS)Nrz^distribution contains extensions and/or C libraries; must be compiled on a Windows 32 platform�build�install�)Zreinit_subcommandsr�install_libz%d.%drz.%s-%s�lib)ZpurelibZplatlib�headersr:�datarCz/Include/$dist_nameZinstall_zinstalling to %sZPURELIB)�mktemp�zip)Zroot_dir�anyr	zremoving temporary file '%s')�dry_run)-�sys�platformr3r9Zhas_c_librariesZDistutilsPlatformErrorr,Zrun_commandZreinitialize_commandr#�rootZwarn_dirr$�compile�optimizer(�version_infor4r6r7r8Z
build_baseZ	build_lib�upper�setattrr�infoZensure_finalized�insert�runZtempfilerE�get_fullnameZmake_archive�
create_exer*rZ
dist_files�append�get_installer_filename�debug�remover%rrH)
rr?rAr(Zplat_specifierr>�key�valuerEZarchive_basename�fullname�arcnameZ	pyversionr!r!r"rS{sr
���




��
��
zbdist_wininst.runcCsZg}|jj}|�d�|jpdd}dd�}dD]B}t||d�}|r0|d|��||�f}|�d|||�f�q0|�d	�|jr�|�d
|j�|�d||��|�d|j�|�d
|j�|j	r�|�d|j	�|j
r�|�d|j
�|j�p|j��}|�d||��ddl
}ddl}	d|�|�
��|	jf}
|�d|
�d�|�S)Nz
[metadata]r2�
cSs|�dd�S)Nr^z\n)�replace)�sr!r!r"�escape�sz)bdist_wininst.get_inidata.<locals>.escape)ZauthorZauthor_email�descriptionZ
maintainerZmaintainer_email�nameZurl�versionz
    %s: %sz%s=%sz
[Setup]zinstall_script=%szinfo=%sztarget_compile=%dztarget_optimize=%dztarget_version=%szuser_access_control=%sztitle=%srzBuilt %s with distutils-%sz
build_info=%s)r3�metadatarVZlong_description�getattr�
capitalizer-r&r'r(r/r+rT�time�	distutils�ctime�__version__r8)r�linesrerQrarcrDr+rhriZ
build_infor!r!r"�get_inidata�s>
�
�zbdist_wininst.get_inidataNc
CsHddl}|�|j�|��}|�|�}|�d|�|r`t|d��}|��}W5QRXt|�}	nd}	t|d���}
|
�	|�
��|r�|
�	|�t|t�r�|�
d�}|d}|jr�t|jddd	��}|���
d�}W5QRX||d
}n|d}|
�	|�|�ddt|�|	�}
|
�	|
�t|d��}|
�	|���W5QRXW5QRXdS)
Nrzcreating %s�rb�wb�mbcs��rzlatin-1)�encodings
z<iiii{V4)�structZmkpathr)rmrWZannounce�open�read�len�write�
get_exe_bytes�
isinstance�str�encoder.Zpack)rr]r\r*rtZcfgdata�installer_name�fZ
bitmapdataZ	bitmaplen�filer<Zscript_data�headerr!r!r"rU�sD




�
�
zbdist_wininst.create_execCsD|jr&tj�|jd||j|jf�}ntj�|jd||jf�}|S)Nz%s.%s-py%s.exez	%s.%s.exe)r(r6r7r8r)r$)rr\r}r!r!r"rW1s
��
�z$bdist_wininst.get_installer_filenamec	Cs$t�}|jrl|j|krl|jdkr&d}q�|jdkr6d}q�|jdkrFd}q�|jdkrVd}q�|jdkrfd	}q�d
}n@zddlm}Wntk
r�d
}YnX|�d
�d}|d}tj�t	�}|j
dkr�|j
dd�dkr�|j
dd�}nd}tj�|d||f�}t|d�}z|��W�S|�
�XdS)Nz2.4z6.0z7.1z2.5z8.0z3.2z9.0z3.4z10.0z14.0r)�CRT_ASSEMBLY_VERSION�.z.0r��winr2zwininst-%s%s.exern)rr(Zmsvcrtr��ImportError�	partitionr6r7�dirname�__file__r$r8ru�closerv)	rZcur_versionZbvr��majorZ	directoryZsfix�filenamer~r!r!r"ry>s8	






zbdist_wininst.get_exe_bytes)N)�__name__�
__module__�__qualname__rbrZuser_optionsZboolean_optionsrIrJZ_unsupportedrr0r=rSrmrUrWry�
__classcell__r!r!rr"r	s>���%�
&Q.
7
r	)r6rIrZdistutils.corerZdistutils.utilrZdistutils.dir_utilrrZdistutils.errorsZdistutils.sysconfigrrirr	r!r!r!r"�<module>sdistutils/command/__pycache__/build_scripts.cpython-38.pyc000064400000010346151153537440017730 0ustar00U

e5dX�@s�dZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZm
Z
ddlmZddlZe�d	�ZGd
d�de�ZGdd
�d
ee
�ZdS)zRdistutils.command.build_scripts

Implements the Distutils 'build_scripts' command.�N)�ST_MODE)�	sysconfig)�Command)�newer)�convert_path�	Mixin2to3)�logs^#!.*python[0-9.]*([ 	].*)?$c@sHeZdZdZdddgZdgZdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)�
build_scriptsz("build" scripts (copy and fixup #! line))z
build-dir=�dzdirectory to "build" (copy) to)�force�fz1forcibly build everything (ignore file timestamps)zexecutable=�ez*specify final destination interpreter pathrcCs"d|_d|_d|_d|_d|_dS�N)�	build_dir�scriptsr�
executable�outfiles��self�r�7/usr/lib64/python3.8/distutils/command/build_scripts.py�initialize_optionss
z build_scripts.initialize_optionscCs|�dddd�|jj|_dS)NZbuild)r	r)rr)rr)Zset_undefined_optionsZdistributionrrrrr�finalize_options%s�zbuild_scripts.finalize_optionscCs|jSr)rrrrr�get_source_files,szbuild_scripts.get_source_filescCs|js
dS|��dSr)r�copy_scriptsrrrr�run/szbuild_scripts.runc
Cs�|�|j�g}g}|jD�]}d}t|�}tj�|jtj�|��}|�|�|j	slt
||�slt�d|�qzt
|d�}Wn tk
r�|js��d}YnXXt�|j�\}}|�d�|��}	|	s�|�d|�qt�|	�}
|
r�d}|
�d�p�d	}|�rt�d
||j�|�|�|j�stj�s*|j}n(tj�t�d�dt�d
�t�d�f�}t�|�}d||d}
z|
�d�Wn$tk
�r�t d�!|
���YnXz|
�|�Wn&tk
�r�t d�!|
|���YnXt
|d��}|�"|
�|�#|�$��W5QRX|�r8|�%�q|�r"|�%�|�|�|�&||�qtj'dk�r�|D]`}|j�rdt�d|�nDt�(|�t)d@}|dBd@}||k�rJt�d|||�t�*||��qJ||fS)a"Copy each script listed in 'self.scripts'; if it's marked as a
        Python script in the Unix way (first line matches 'first_line_re',
        ie. starts with "\#!" and contains "python"), then adjust the first
        line to refer to the current Python interpreter as we copy.
        Fznot copying %s (up-to-date)�rbNrz%s is an empty file (skipping)T��zcopying and adjusting %s -> %sZBINDIRz
python%s%sZVERSIONZEXEs#!�
zutf-8z.The shebang ({!r}) is not decodable from utf-8zAThe shebang ({!r}) is not decodable from the script encoding ({})�wb�posixzchanging mode of %si�imz!changing mode of %s from %o to %o)+Zmkpathrrr�os�path�join�basename�appendrrr�debug�open�OSError�dry_run�tokenize�detect_encoding�readline�seek�warn�
first_line_re�match�group�inforZpython_buildrZget_config_var�fsencode�decode�UnicodeDecodeError�
ValueError�format�write�
writelines�	readlines�closeZ	copy_file�name�statr�chmod)rr�
updated_filesZscriptZadjustZoutfiler�encoding�linesZ
first_liner1Zpost_interprZshebangZoutf�fileZoldmodeZnewmoderrrr5s�



�

��
��
��




�zbuild_scripts.copy_scriptsN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsrrrrrrrrrr	s�r	c@seZdZdd�ZdS)�build_scripts_2to3cCs&t�|�\}}|js|�|�||fSr)r	rr*Zrun_2to3)rrr@rrrr�s
zbuild_scripts_2to3.copy_scriptsN)rDrErFrrrrrrG�srG)�__doc__r"�rer>rZ	distutilsrZdistutils.corerZdistutils.dep_utilrZdistutils.utilrrrr+�compiler0r	rGrrrr�<module>s

distutils/command/__pycache__/build_clib.cpython-38.opt-1.pyc000064400000011320151153537440020102 0ustar00U

e5dV�@sTdZddlZddlmZddlTddlmZddlmZdd�Z	Gd	d
�d
e�Z
dS)z�distutils.command.build_clib

Implements the Distutils 'build_clib' command, to build a C/C++ library
that is included in the module distribution and needed by an extension
module.�N)�Command)�*)�customize_compiler)�logcCsddlm}|�dS)Nr��show_compilers)�distutils.ccompilerrr�r	�4/usr/lib64/python3.8/distutils/command/build_clib.pyrsrc@sleZdZdZdddddgZddgZd	d
defgZdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zd
S)�
build_clibz/build C/C++ libraries used by Python extensions)zbuild-clib=�bz%directory to build C/C++ libraries to)zbuild-temp=�tz,directory to put temporary build by-products)�debug�gz"compile with debugging information)�force�fz2forcibly build everything (ignore file timestamps))z	compiler=�czspecify the compiler typerrz
help-compilerNzlist available compilerscCs:d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr)	r�
build_temp�	libraries�include_dirs�define�undefrr�compiler��selfr	r	r
�initialize_options4szbuild_clib.initialize_optionscCsh|�dddddd�|jj|_|jr0|�|j�|jdkrH|jjpDg|_t|jt�rd|j�tj	�|_dS)NZbuild)rr)rr)rr)rr)rr)
Zset_undefined_optionsZdistributionr�check_library_listr�
isinstance�str�split�os�pathseprr	r	r
�finalize_optionsDs�

zbuild_clib.finalize_optionscCs�|js
dSddlm}||j|j|jd�|_t|j�|jdk	rN|j�|j�|j	dk	rv|j	D]\}}|j�
||�q^|jdk	r�|jD]}|j�|�q�|�
|j�dS)Nr)�new_compiler)r�dry_runr)rrr#rr$rrrZset_include_dirsrZdefine_macrorZundefine_macro�build_libraries)rr#�name�valueZmacror	r	r
�run^s"�




zbuild_clib.runcCs�t|t�std��|D]z}t|t�s8t|�dkr8td��|\}}t|t�sRtd��d|ksntjdkr~tj|kr~td|d��t|t�std��qd	S)
a`Ensure that the list of libraries is valid.

        `library` is presumably provided as a command option 'libraries'.
        This method checks that it is a list of 2-tuples, where the tuples
        are (library_name, build_info_dict).

        Raise DistutilsSetupError if the structure is invalid anywhere;
        just returns otherwise.
        z+'libraries' option must be a list of tuples�z*each element of 'libraries' must a 2-tuplezNfirst element of each tuple in 'libraries' must be a string (the library name)�/z;bad library name '%s': may not contain directory separatorsrzMsecond element of each tuple in 'libraries' must be a dictionary (build info)N)	r�list�DistutilsSetupError�tuple�lenrr �sep�dict)rr�libr&�
build_infor	r	r
rvs,

��
��
�zbuild_clib.check_library_listcCs,|js
dSg}|jD]\}}|�|�q|S)N)r�append)rZ	lib_names�lib_namer2r	r	r
�get_library_names�szbuild_clib.get_library_namescCsZ|�|j�g}|jD]>\}}|�d�}|dks>t|ttf�sJtd|��|�|�q|S)N�sources�fin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenames)rr�getrr+r-r,�extend)r�	filenamesr4r2r6r	r	r
�get_source_files�s
��zbuild_clib.get_source_filescCs�|D]�\}}|�d�}|dks,t|ttf�s8td|��t|�}t�d|�|�d�}|�d�}|jj||j	|||j
d�}|jj|||j|j
d�qdS)Nr6r7zbuilding '%s' library�macrosr)�
output_dirr<rr)r=r)
r8rr+r-r,r�infor�compilerrZcreate_static_libr)rrr4r2r6r<rZobjectsr	r	r
r%�s,
��

�	
�zbuild_clib.build_libraries)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsrZhelp_optionsrr"r(rr5r;r%r	r	r	r
rs(�
��$r)�__doc__r Zdistutils.corerZdistutils.errorsZdistutils.sysconfigrZ	distutilsrrrr	r	r	r
�<module>sdistutils/command/__pycache__/bdist_wininst.cpython-38.pyc000064400000020453151153537440017742 0ustar00U

e5d�>�@sxdZddlZddlZddlZddlmZddlmZddlm	Z	m
Z
ddlTddlm
Z
ddlmZGd	d
�d
e�ZdS)zzdistutils.command.bdist_wininst

Implements the Distutils 'bdist_wininst' command: create a windows installer
exe-program.�N)�Command)�get_platform)�create_tree�remove_tree)�*)�get_python_version)�logc
s�eZdZdZdddde�fdddd	d
ddd
dddg
ZddddgZejdkZ	�fdd�Z
dd�Zdd�Zdd�Z
dd�Zd'd!d"�Zd#d$�Zd%d&�Z�ZS)(�
bdist_wininstz-create an executable installer for MS Windows)z
bdist-dir=Nz1temporary directory for creating the distributionz
plat-name=�pz;platform name to embed in generated filenames (default: %s))�	keep-temp�kzPkeep the pseudo-installation tree around after creating the distribution archive)ztarget-version=Nz6require a specific python version on the target system)�no-target-compile�cz/do not compile .py to .pyc on the target system)�no-target-optimize�oz;do not compile .py to .pyo (optimized) on the target system)z	dist-dir=�dz-directory to put final built distributions in)zbitmap=�bz>bitmap to use for the installer instead of python-powered logo)ztitle=�tz?title to display on the installer background instead of default)�
skip-buildNz2skip rebuilding everything (for testing/debugging))zinstall-script=NzUbasename of installation script to be run after installation or before deinstallation)zpre-install-script=Nz{Fully qualified filename of a script to be run before any files are installed.  This script need not be in the distribution)zuser-access-control=Nz�specify Vista's UAC handling - 'none'/default=no handling, 'auto'=use UAC if target Python installed for all users, 'force'=always use UACrr
rr�win32cs t�j||�t�dtd�dS)Nz^bdist_wininst command is deprecated since Python 3.8, use bdist_wheel (wheel packages) instead�)�super�__init__�warnings�warn�DeprecationWarning)�self�args�kw��	__class__��7/usr/lib64/python3.8/distutils/command/bdist_wininst.pyr?s
�zbdist_wininst.__init__cCsRd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_dS)Nr)
�	bdist_dir�	plat_name�	keep_temp�no_target_compile�no_target_optimize�target_version�dist_dir�bitmap�title�
skip_build�install_script�pre_install_script�user_access_control)rr!r!r"�initialize_optionsEsz bdist_wininst.initialize_optionscCs�|�dd�|jdkrR|jr6|jr6|j�d�}|j|_|�d�j}tj	�
|d�|_|js^d|_|js�|j��r�t
�}|jr�|j|kr�td|f��||_|�ddd�|jr�|jjD]}|jtj	�|�kr�q�q�td|j��dS)	N�bdist)r,r,Zwininst�zMtarget version can only be %s, or the '--skip-build' option must be specified)r)r))r$r$z(install_script '%s' not found in scripts)Zset_undefined_optionsr#r,r$�distributionZget_command_obj�get_finalized_command�
bdist_base�os�path�joinr(�has_ext_modulesrZDistutilsOptionErrorr-�scripts�basename)rr1r5Z
short_version�scriptr!r!r"�finalize_optionsUs>
�����zbdist_wininst.finalize_optionsc
Cs�tjdkr&|j��s|j��r&td��|js6|�d�|jddd�}|j	|_
|j|_d|_|j|_|�d�}d|_
d|_|j��r�|j}|s�|js�td	��d
tjdd�}d|j|f}|�d�}tj�|jd
|�|_dD],}|��}|dkr�|d}t|d||�q�t�d|j	�|��tj�dtj�|j	d��|��tjd=ddlm }|�}	|j�!�}
|j"|	d|j	d�}|�#||
|j$�|j���r�t%�}nd}|jj&�'d||�(|
�f�t�)d|�t�*|�|j+�s�t,|j	|j-d�dS)Nrz^distribution contains extensions and/or C libraries; must be compiled on a Windows 32 platform�build�install�)Zreinit_subcommandsr�install_libz Should have already checked thisz%d.%drz.%s-%s�lib)ZpurelibZplatlib�headersr:�datarCz/Include/$dist_nameZinstall_zinstalling to %sZPURELIB)�mktemp�zip)Zroot_dir�anyr	zremoving temporary file '%s')�dry_run).�sys�platformr3r9Zhas_c_librariesZDistutilsPlatformErrorr,Zrun_commandZreinitialize_commandr#�rootZwarn_dirr$�compile�optimizer(�AssertionError�version_infor4r6r7r8Z
build_baseZ	build_lib�upper�setattrr�infoZensure_finalized�insert�runZtempfilerE�get_fullnameZmake_archive�
create_exer*rZ
dist_files�append�get_installer_filename�debug�remover%rrH)
rr?rAr(Zplat_specifierr>�key�valuerEZarchive_basename�fullname�arcnameZ	pyversionr!r!r"rT{st
���




��
��
zbdist_wininst.runcCsZg}|jj}|�d�|jpdd}dd�}dD]B}t||d�}|r0|d|��||�f}|�d|||�f�q0|�d	�|jr�|�d
|j�|�d||��|�d|j�|�d
|j�|j	r�|�d|j	�|j
r�|�d|j
�|j�p|j��}|�d||��ddl
}ddl}	d|�|�
��|	jf}
|�d|
�d�|�S)Nz
[metadata]r2�
cSs|�dd�S)Nr_z\n)�replace)�sr!r!r"�escape�sz)bdist_wininst.get_inidata.<locals>.escape)ZauthorZauthor_email�descriptionZ
maintainerZmaintainer_email�nameZurl�versionz
    %s: %sz%s=%sz
[Setup]zinstall_script=%szinfo=%sztarget_compile=%dztarget_optimize=%dztarget_version=%szuser_access_control=%sztitle=%srzBuilt %s with distutils-%sz
build_info=%s)r3�metadatarWZlong_description�getattr�
capitalizer-r&r'r(r/r+rU�time�	distutils�ctime�__version__r8)r�linesrfrRrbrdrDr+rirjZ
build_infor!r!r"�get_inidata�s>
�
�zbdist_wininst.get_inidataNc
CsHddl}|�|j�|��}|�|�}|�d|�|r`t|d��}|��}W5QRXt|�}	nd}	t|d���}
|
�	|�
��|r�|
�	|�t|t�r�|�
d�}|d}|jr�t|jddd	��}|���
d�}W5QRX||d
}n|d}|
�	|�|�ddt|�|	�}
|
�	|
�t|d��}|
�	|���W5QRXW5QRXdS)
Nrzcreating %s�rb�wb�mbcs��rzlatin-1)�encodings
z<iiii{V4)�structZmkpathr)rnrXZannounce�open�read�len�write�
get_exe_bytes�
isinstance�str�encoder.Zpack)rr^r]r*ruZcfgdata�installer_name�fZ
bitmapdataZ	bitmaplen�filer<Zscript_data�headerr!r!r"rV�sD




�
�
zbdist_wininst.create_execCsD|jr&tj�|jd||j|jf�}ntj�|jd||jf�}|S)Nz%s.%s-py%s.exez	%s.%s.exe)r(r6r7r8r)r$)rr]r~r!r!r"rX1s
��
�z$bdist_wininst.get_installer_filenamec	Cs$t�}|jrl|j|krl|jdkr&d}q�|jdkr6d}q�|jdkrFd}q�|jdkrVd}q�|jdkrfd	}q�d
}n@zddlm}Wntk
r�d
}YnX|�d
�d}|d}tj�t	�}|j
dkr�|j
dd�dkr�|j
dd�}nd}tj�|d||f�}t|d�}z|��W�S|�
�XdS)Nz2.4z6.0z7.1z2.5z8.0z3.2z9.0z3.4z10.0z14.0r)�CRT_ASSEMBLY_VERSION�.z.0r��winr2zwininst-%s%s.exero)rr(Zmsvcrtr��ImportError�	partitionr6r7�dirname�__file__r$r8rv�closerw)	rZcur_versionZbvr��majorZ	directoryZsfix�filenamerr!r!r"rz>s8	






zbdist_wininst.get_exe_bytes)N)�__name__�
__module__�__qualname__rcrZuser_optionsZboolean_optionsrIrJZ_unsupportedrr0r=rTrnrVrXrz�
__classcell__r!r!rr"r	s>���%�
&Q.
7
r	)�__doc__r6rIrZdistutils.corerZdistutils.utilrZdistutils.dir_utilrrZdistutils.errorsZdistutils.sysconfigrrjrr	r!r!r!r"�<module>sdistutils/command/__pycache__/sdist.cpython-38.opt-1.pyc000064400000034266151153537440017156 0ustar00U

e5d=J�@s�dZddlZddlZddlmZddlmZddlmZddlm	Z	ddlm
Z
ddlmZdd	lm
Z
dd
lmZddlmZddlmZdd
lmZmZdd�ZGdd�de�ZdS)zadistutils.command.sdist

Implements the Distutils 'sdist' command (create a source distribution).�N)�glob)�warn)�Command)�dir_util)�	file_util)�archive_util)�TextFile)�FileList)�log)�convert_path)�DistutilsTemplateError�DistutilsOptionErrorcCs`ddlm}ddlm}g}|��D] }|�d|d||df�q$|��||��d�dS)zoPrint all possible values for the 'formats' option (used by
    the "--help-formats" command-line option).
    r)�FancyGetopt)�ARCHIVE_FORMATS�formats=N�z.List of available source distribution formats:)Zdistutils.fancy_getoptrZdistutils.archive_utilr�keys�append�sortZ
print_help)rr�formats�format�r�//usr/lib64/python3.8/distutils/command/sdist.py�show_formatss
��rc@s"eZdZdZdd�Zdddddd	d
ddd
ddddgZddddddgZdddefgZddd�Z	defgZ
dZdd�Zd d!�Z
d"d#�Zd$d%�Zd&d'�Zd(d)�Zed*d+��Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Zd<d=�Zd>d?�Zd@dA�ZdBdC�ZdDdE�Z dFdG�Z!dHdI�Z"dS)J�sdistz6create a source distribution (tarball, zip file, etc.)cCs|jS)zYCallable used for the check sub-command.

        Placed here so user_options can view it)�metadata_check��selfrrr�checking_metadata(szsdist.checking_metadata)z	template=�tz5name of manifest template file [default: MANIFEST.in])z	manifest=�mz)name of manifest file [default: MANIFEST])�use-defaultsNzRinclude the default file set in the manifest [default; disable with --no-defaults])�no-defaultsNz"don't include the default file set)�pruneNz�specifically exclude files/directories that should not be distributed (build tree, RCS/CVS dirs, etc.) [default; disable with --no-prune])�no-pruneNz$don't automatically exclude anything)�
manifest-only�ozEjust regenerate the manifest and then stop (implies --force-manifest))�force-manifest�fzkforcibly regenerate the manifest and carry on as usual. Deprecated: now the manifest is always regenerated.)rNz6formats for source distribution (comma-separated list))�	keep-temp�kz@keep the distribution tree around after creating archive file(s))z	dist-dir=�dzFdirectory to put the source distribution archive(s) in [default: dist])�metadata-checkNz[Ensure that all required elements of meta-data are supplied. Warn if any missing. [default])zowner=�uz@Owner name used when creating a tar file [default: current user])zgroup=�gzAGroup name used when creating a tar file [default: current group]r!r#r%r'r)r,zhelp-formatsNz#list available distribution formats)r"r$�check)ZREADMEz
README.txtz
README.rstcCsTd|_d|_d|_d|_d|_d|_dg|_d|_d|_d|_	d|_
d|_d|_dS)N�rZgztar)
�template�manifest�use_defaultsr#�
manifest_onlyZforce_manifestr�	keep_temp�dist_dir�
archive_filesr�owner�grouprrrr�initialize_optionseszsdist.initialize_optionscCsZ|jdkrd|_|jdkr d|_|�d�t�|j�}|rFtd|��|jdkrVd|_dS)NZMANIFESTzMANIFEST.inrzunknown archive format '%s'Zdist)r2r1Zensure_string_listrZcheck_archive_formatsrr
r6)rZ
bad_formatrrr�finalize_options|s


�
zsdist.finalize_optionscCs>t�|_|��D]}|�|�q|��|jr2dS|��dS�N)r	�filelistZget_sub_commandsZrun_command�
get_file_listr4�make_distribution)rZcmd_namerrr�run�sz	sdist.runcCs*tdt�|j�d�}|��|��dS)zDeprecated API.zadistutils.command.sdist.check_metadata is deprecated,               use the check command insteadr/N)r�PendingDeprecationWarning�distributionZget_command_objZensure_finalizedr@)rr/rrr�check_metadata�s�zsdist.check_metadatacCs�tj�|j�}|s:|��r:|��|j��|j��dS|sN|�	d|j�|j�
�|jrf|��|rr|�
�|jr�|��|j��|j��|��dS)aCFigure out the list of files to include in the source
        distribution, and put it in 'self.filelist'.  This might involve
        reading the manifest template (and writing the manifest), or just
        reading the manifest, or just using the default file set -- it all
        depends on the user's options.
        Nz?manifest template '%s' does not exist (using default file list))�os�path�isfiler1�_manifest_is_not_generated�
read_manifestr=rZremove_duplicatesr�findallr3�add_defaults�
read_templater#�prune_file_list�write_manifest)rZtemplate_existsrrrr>�s(

�


zsdist.get_file_listcCs<|��|��|��|��|��|��|��dS)a9Add all the default files to self.filelist:
          - README or README.txt
          - setup.py
          - test/test*.py
          - all pure Python modules mentioned in setup script
          - all files pointed by package_data (build_py)
          - all files defined in data_files.
          - all files defined as scripts.
          - all C sources listed as part of extensions or C libraries
            in the setup script (doesn't catch C headers!)
        Warns if (README or README.txt) or setup.py are missing; everything
        else is optional.
        N)�_add_defaults_standards�_add_defaults_optional�_add_defaults_python�_add_defaults_data_files�_add_defaults_ext�_add_defaults_c_libs�_add_defaults_scriptsrrrrrJ�szsdist.add_defaultscCs:tj�|�sdStj�|�}tj�|�\}}|t�|�kS)z�
        Case-sensitive path existence check

        >>> sdist._cs_path_exists(__file__)
        True
        >>> sdist._cs_path_exists(__file__.upper())
        False
        F)rDrE�exists�abspath�split�listdir)�fspathrVZ	directory�filenamerrr�_cs_path_exists�s

zsdist._cs_path_existscCs�|j|jjg}|D]~}t|t�rj|}d}|D]"}|�|�r,d}|j�|�qPq,|s�|�dd�	|��q|�|�r�|j�|�q|�d|�qdS)NFTz,standard file not found: should have one of z, zstandard file '%s' not found)
�READMESrBZscript_name�
isinstance�tupler[r=rr�join)rZ	standards�fnZaltsZgot_itrrrrN�s"

�
zsdist._add_defaults_standardscCs4ddg}|D]"}ttjjt|��}|j�|�qdS)Nz
test/test*.pyz	setup.cfg)�filterrDrErFrr=�extend)rZoptional�pattern�filesrrrrOszsdist._add_defaults_optionalcCs\|�d�}|j��r$|j�|���|jD],\}}}}|D]}|j�tj	�
||��q:q*dS)N�build_py)�get_finalized_commandrBZhas_pure_modulesr=rb�get_source_files�
data_filesrrDrEr_)rreZpkgZsrc_dirZ	build_dir�	filenamesrZrrrrPs

zsdist._add_defaults_pythoncCsz|j��rv|jjD]b}t|t�rBt|�}tj�|�rt|j	�
|�q|\}}|D]$}t|�}tj�|�rN|j	�
|�qNqdSr<)rBZhas_data_filesrhr]�strrrDrErFr=r)r�item�dirnamerir(rrrrQ$s

zsdist._add_defaults_data_filescCs(|j��r$|�d�}|j�|���dS)N�	build_ext)rBZhas_ext_modulesrfr=rbrg)rrmrrrrR5s

zsdist._add_defaults_extcCs(|j��r$|�d�}|j�|���dS)N�
build_clib)rBZhas_c_librariesrfr=rbrg)rrnrrrrS:s

zsdist._add_defaults_c_libscCs(|j��r$|�d�}|j�|���dS)N�
build_scripts)rBZhas_scriptsrfr=rbrg)rrorrrrT?s

zsdist._add_defaults_scriptsc
Cs�t�d|j�t|jddddddd�}zh|��}|dkr:q�z|j�|�Wq(tt	fk
r�}z|�
d|j|j|f�W5d}~XYq(Xq(W5|��XdS)z�Read and parse manifest template file named by self.template.

        (usually "MANIFEST.in") The parsing and processing is done by
        'self.filelist', which updates itself accordingly.
        zreading manifest template '%s'r0)Zstrip_commentsZskip_blanksZ
join_linesZ	lstrip_wsZ	rstrip_wsZ
collapse_joinNz%s, line %d: %s)
r
�infor1r�close�readliner=Zprocess_template_liner�
ValueErrorrrZZcurrent_line)rr1�line�msgrrrrKDs&
�
� zsdist.read_templatecCs�|�d�}|j��}|jjd|jd�|jjd|d�tjdkrFd}nd}ddd	d
ddd
g}d|d�|�|f}|jj|dd�dS)avPrune off branches that might slip into the file list as created
        by 'read_template()', but really don't belong there:
          * the build tree (typically "build")
          * the release tree itself (only an issue if we ran "sdist"
            previously with --keep-temp, or it aborted)
          * any RCS, CVS, .svn, .hg, .git, .bzr, _darcs directories
        �buildN)�prefixZwin32z/|\\�/ZRCSZCVSz\.svnz\.hgz\.gitz\.bzrZ_darcsz(^|%s)(%s)(%s).*�|r0)Zis_regex)	rfrB�get_fullnamer=Zexclude_patternZ
build_base�sys�platformr_)rrv�base_dirZsepsZvcs_dirsZvcs_ptrnrrrrLas


�zsdist.prune_file_listcCsX|��rt�d|j�dS|jjdd�}|�dd�|�tj	|j|fd|j�dS)z�Write the file list in 'self.filelist' (presumably as filled in
        by 'add_defaults()' and 'read_template()') to the manifest file
        named by 'self.manifest'.
        z5not writing to manually maintained manifest file '%s'Nrz*# file GENERATED by distutils, do NOT editzwriting manifest file '%s')
rGr
rpr2r=rd�insertZexecuterZ
write_file)rZcontentrrrrMys��zsdist.write_manifestcCs<tj�|j�sdSt|j�}z|��}W5|��X|dkS)NFz+# file GENERATED by distutils, do NOT edit
)rDrErFr2�openrqrr)r�fpZ
first_linerrrrG�s

z sdist._manifest_is_not_generatedc	CsVt�d|j�t|j��4}|D](}|��}|�d�s|s:q|j�|�qW5QRXdS)z�Read the manifest file (named by 'self.manifest') and use it to
        fill in 'self.filelist', the list of files to include in the source
        distribution.
        zreading manifest file '%s'�#N)r
rpr2r�strip�
startswithr=r)rr2rtrrrrH�szsdist.read_manifestcCs�|�|�tj|||jd�ttd�r4d}d|}nd}d|}|sPt�d�n
t�|�|D]<}tj	�
|�s|t�d|�q^tj	�||�}|j|||d	�q^|j
j�|�dS)
a�Create the directory tree that will become the source
        distribution archive.  All directories implied by the filenames in
        'files' are created under 'base_dir', and then we hard link or copy
        (if hard linking is unavailable) those files into place.
        Essentially, this duplicates the developer's source tree, but in a
        directory named after the distribution, containing only the files
        to be distributed.
        ��dry_run�linkZhardzmaking hard links in %s...Nzcopying files to %s...z)no files to distribute -- empty manifest?z#'%s' not a regular file -- skipping)r�)ZmkpathrZcreate_treer��hasattrrDr
rrprErFr_Z	copy_filerBZmetadataZwrite_pkg_info)rr}rdr�ru�file�destrrr�make_release_tree�s 
	


zsdist.make_release_treecCs�|j��}tj�|j|�}|�||jj�g}d|j	krT|j	�
|j	�|j	�d���|j	D]:}|j
||||j|jd�}|�
|�|jj�
dd|f�qZ||_|js�tj||jd�dS)a�Create the source distribution(s).  First, we create the release
        tree with 'make_release_tree()'; then, we create all required
        archive files (according to 'self.formats') from the release tree.
        Finally, we clean up by blowing away the release tree (unless
        'self.keep_temp' is true).  The list of archive files created is
        stored so it can be retrieved later by 'get_archive_files()'.
        Ztar)r}r8r9r�r�N)rBrzrDrEr_r6r�r=rdrr�pop�indexZmake_archiver8r9Z
dist_filesr7r5rZremove_treer�)rr}Z	base_namer7Zfmtr�rrrr?�s 




�
zsdist.make_distributioncCs|jS)zzReturn the list of archive files created when the command
        was run, or None if the command hasn't run yet.
        )r7rrrr�get_archive_files�szsdist.get_archive_files)#�__name__�
__module__�__qualname__ZdescriptionrZuser_optionsZboolean_optionsrZhelp_optionsZnegative_optZsub_commandsr\r:r;r@rCr>rJ�staticmethodr[rNrOrPrQrRrSrTrKrLrMrGrHr�r?r�rrrrr$sp�'����
(
*r)�__doc__rDr{r�warningsrZdistutils.corerZ	distutilsrrrZdistutils.text_filerZdistutils.filelistr	r
Zdistutils.utilrZdistutils.errorsrr
rrrrrr�<module>sdistutils/command/__pycache__/build_ext.cpython-38.opt-1.pyc000064400000037413151153537440020004 0ustar00U

e5dP{�@s�dZddlZddlZddlZddlZddlmZddlTddlm	Z	m
Z
ddlmZddlm
Z
ddlmZdd	lmZdd
lmZddlmZe�d�Zd
d�ZGdd�de�ZdS)z�distutils.command.build_ext

Implements the Distutils 'build_ext' command, for building extension
modules (currently limited to C extensions, should accommodate C++
extensions ASAP).�N)�Command)�*)�customize_compiler�get_python_version)�get_config_h_filename)�newer_group)�	Extension)�get_platform)�log)�	USER_BASEz3^[a-zA-Z_][a-zA-Z_0-9]*(\.[a-zA-Z_][a-zA-Z_0-9]*)*$cCsddlm}|�dS)Nr��show_compilers)�distutils.ccompilerr
r�r�3/usr/lib64/python3.8/distutils/command/build_ext.pyr
sr
c@seZdZdZdejZddddde�fdd	d
defdd
ddddefddddddddddgZddddd gZ	d!d"d#e
fgZd$d%�Zd&d'�Z
d(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zejd6d7��Zd8d9�Zd:d;�Zd<d=�Zd>d?�Zd@dA�ZdBdC�ZdDdE�ZdFdG�Zd"S)H�	build_extz8build C/C++ extensions (compile/link to build directory)z (separated by '%s'))z
build-lib=�bz(directory for compiled extension modules)zbuild-temp=�tz1directory for temporary files (build by-products)z
plat-name=�pz>platform name to cross-compile for, if supported (default: %s))�inplace�iziignore build-lib and put compiled extensions into the source directory alongside your pure Python modulesz
include-dirs=�Iz.list of directories to search for header files)zdefine=�DzC preprocessor macros to define)zundef=�Uz!C preprocessor macros to undefine)z
libraries=�lz!external C libraries to link withz
library-dirs=�Lz.directories to search for external C libraries)zrpath=�Rz7directories to search for shared C libraries at runtime)z
link-objects=�Oz2extra explicit link objects to include in the link)�debug�gz'compile/link with debugging information)�force�fz2forcibly build everything (ignore file timestamps))z	compiler=�czspecify the compiler type)z	parallel=�jznumber of parallel build jobs)�swig-cppNz)make SWIG create C++ files (default is C))z
swig-opts=Nz!list of SWIG command line options)zswig=Nzpath to the SWIG executable)�userNz#add user include, library and rpathrrr r$r%z
help-compilerNzlist available compilerscCs�d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_d|_d|_dS)Nr)�
extensions�	build_lib�	plat_name�
build_tempr�package�include_dirs�define�undef�	libraries�library_dirs�rpath�link_objectsrr �compiler�swig�swig_cpp�	swig_optsr%�parallel��selfrrr�initialize_optionsjs*zbuild_ext.initialize_optionsc

Cs�ddlm}|�ddddddd	d
�|jdkr8|jj|_|jj|_|��}|jdd�}|j	dkrn|jj	pjg|_	t
|j	t�r�|j	�t
j�|_	tjtjkr�|j	�t
j�tjd
��|j	�|�t
jj��||kr�|j	�|�t
jj��|�d�|�d�|jdk�rg|_|jdk�rg|_nt
|jt��r:|j�t
j�|_|jdk�rNg|_nt
|jt��rl|j�t
j�|_t
jdk�rh|j�t
j�tjd��tjtjk�r�|j�t
j�tjd��|j�r�t
j�|jd�|_nt
j�|jd�|_|j	�t
j�t���t tdd�}|�r|j�|�|j!dk�r*d}n|j!dd�}t
j�tjd�}|�r\t
j�||�}|j�|�tj"dd�dk�r�tj#�$t
j�tjd���r�|j�t
j�tjddt%�d��n|j�d�|�&d��r�|j'�s�|j�|�&d ��n|j�d�|j(�r|j(�d!�}d"d#�|D�|_(|j)�r4|j)�d!�|_)|j*dk�rHg|_*n|j*�d$�|_*|j+�r�t
j�t,d
�}t
j�t,d�}	t
j�-|��r�|j	�|�t
j�-|	��r�|j�|	�|j�|	�t
|j.t��r�zt/|j.�|_.Wnt0k
�r�t1d%��YnXdS)&Nr)�	sysconfigZbuild)r'r')r)r))r2r2)rr)r r )r6r6)r(r(�)Z
plat_specificZincluder.r1�ntZlibsZDebugZRelease�_home�win32�ZPCbuild��cygwin�bin�lib�pythonZconfig�.�Py_ENABLE_SHAREDZLIBDIR�,cSsg|]}|df�qS)�1r)�.0Zsymbolrrr�
<listcomp>�sz.build_ext.finalize_options.<locals>.<listcomp>� zparallel should be an integer)2�	distutilsr:Zset_undefined_optionsr*�distributionZext_packageZext_modulesr&Zget_python_incr+�
isinstance�str�split�os�pathsep�sys�exec_prefix�base_exec_prefix�append�path�join�extendZensure_string_listr.r/r0�name�prefixrr)�dirnamer�getattrr(�platform�
executable�
startswithr�get_config_varZpython_buildr,r-r5r%r�isdirr6�int�
ValueErrorZDistutilsOptionError)
r8r:Z
py_includeZplat_py_includeZ	_sys_home�suffixZnew_libZdefinesZuser_includeZuser_librrr�finalize_options�s��




�

�zbuild_ext.finalize_optionscCsjddlm}|jsdS|j��rL|�d�}|j�|��p:g�|j	�
|j�||j|j
|j|jd�|_t|j�tjdkr�|jt�kr�|j�|j�|jdk	r�|j�|j�|jdk	r�|jD]\}}|j�||�q�|jdk	r�|jD]}|j�|�q�|jdk	�r|j�|j�|j	dk	�r*|j�|j	�|jdk	�rD|j�|j�|j dk	�r^|j�!|j �|�"�dS)Nr)�new_compiler�
build_clib)r2�verbose�dry_runr r<)#rrgr&rMZhas_c_libraries�get_finalized_commandr.rYZget_library_namesr/rVrhr2rirjr rrQrZr(r	Z
initializer+Zset_include_dirsr,Zdefine_macror-Zundefine_macroZ
set_librariesZset_library_dirsr0Zset_runtime_library_dirsr1Zset_link_objects�build_extensions)r8rgrhrZ�value�macrorrr�runs@

�




z
build_ext.runc
Csvt|t�std��t|�D�]T\}}t|t�r0qt|t�rFt|�dkrNtd��|\}}t�d|�t|t	�rvt
�|�s~td��t|t�s�td��t||d�}dD]"}|�
|�}|d	k	r�t|||�q�|�
d
�|_d|kr�t�d�|�
d
�}|�rhg|_g|_|D]b}	t|	t��r"t|	�dk�s*td��t|	�dk�rJ|j�|	d�nt|	�dk�r|j�|	��q|||<qd	S)a�Ensure that the list of extensions (presumably provided as a
        command option 'extensions') is valid, i.e. it is a list of
        Extension objects.  We also support the old-style list of 2-tuples,
        where the tuples are (ext_name, build_info), which are converted to
        Extension instances here.

        Raise DistutilsSetupError if the structure is invalid anywhere;
        just returns otherwise.
        z:'ext_modules' option must be a list of Extension instances�zMeach element of 'ext_modules' option must be an Extension instance or 2-tuplezvold-style (ext_name, build_info) tuple found in ext_modules for extension '%s' -- please convert to Extension instancezRfirst element of each tuple in 'ext_modules' must be the extension name (a string)zOsecond element of each tuple in 'ext_modules' must be a dictionary (build info)�sources)r+r/r.�
extra_objects�extra_compile_args�extra_link_argsNr0Zdef_filez9'def_file' element of build info dict no longer supported�macros)r;rpz9'macros' element of build info dict must be 1- or 2-tupler;r)rN�list�DistutilsSetupError�	enumerater�tuple�lenr
�warnrO�extension_name_re�match�dict�get�setattr�runtime_library_dirs�
define_macros�undef_macrosrV)
r8r&r�ext�ext_nameZ
build_info�key�valrurnrrr�check_extensions_listVs^

�
��
��
�


�zbuild_ext.check_extensions_listcCs,|�|j�g}|jD]}|�|j�q|S�N)r�r&rYrq)r8�	filenamesr�rrr�get_source_files�s

zbuild_ext.get_source_filescCs2|�|j�g}|jD]}|�|�|j��q|Sr�)r�r&rV�get_ext_fullpathrZ)r8Zoutputsr�rrr�get_outputs�s

zbuild_ext.get_outputscCs(|�|j�|jr|��n|��dSr�)r�r&r6�_build_extensions_parallel�_build_extensions_serialr7rrrrl�s
zbuild_ext.build_extensionscs��j}�jdkrt��}zddlm}Wntk
r@d}YnX|dkrV���dS||d��P���fdd��jD�}t�j|�D]&\}}��	|��|�
�W5QRXq�W5QRXdS)NTr)�ThreadPoolExecutor)Zmax_workerscsg|]}���j|��qSr)Zsubmit�build_extension)rIr��Zexecutorr8rrrJ�s�z8build_ext._build_extensions_parallel.<locals>.<listcomp>)r6rQ�	cpu_countZconcurrent.futuresr��ImportErrorr�r&�zip�_filter_build_errors�result)r8Zworkersr�Zfuturesr�Zfutrr�rr��s"

�z$build_ext._build_extensions_parallelc
Cs0|jD]$}|�|��|�|�W5QRXqdSr�)r&r�r�)r8r�rrrr��s
z"build_ext._build_extensions_serialc
csTz
dVWnDtttfk
rN}z |js*�|�d|j|f�W5d}~XYnXdS)Nz"building extension "%s" failed: %s)ZCCompilerErrorZDistutilsErrorZCompileErrorZoptionalr{rZ)r8r��errrr��s
�zbuild_ext._filter_build_errorsc
CsP|j}|dkst|ttf�s*td|j��t|�}|�|j�}||j}|jslt	||d�slt
�d|j�dSt
�d|j�|�
||�}|jp�g}|jdd�}|jD]}|�|f�q�|jj||j||j|j||jd�}|dd�|_|jr�|�|j�|j�pg}|j�p|j�|�}	|jj|||�|�|j|j||� |�|j|j|	d�
dS)Nzjin 'ext_modules' option (extension '%s'), 'sources' must be present and must be a list of source filenamesZnewerz$skipping '%s' extension (up-to-date)zbuilding '%s' extension)Z
output_dirrur+r�extra_postargs�depends)r.r/r�r��export_symbolsrr)Ztarget_lang)!rqrNrvryrwrZr�r�r rr
r�info�swig_sourcesrsr�r�rVr2�compiler)r+Z_built_objectsrrrYrt�languageZdetect_languageZlink_shared_object�
get_librariesr/r��get_export_symbols)
r8r�rq�ext_pathr�Z
extra_argsrur-Zobjectsr�rrrr��sX��


�
�zbuild_ext.build_extensioncCs$g}g}i}|jrt�d�|js6d|jks6d|jkr<d}nd}|D]P}tj�|�\}}	|	dkr�|�|d|�|�|�|d||<qD|�|�qD|s�|S|jp�|�	�}
|
dg}|�
|j�|jr�|�d�|js�|jD]}|�|�q�|D].}||}
t�d	||
�|�|d
|
|g�q�|S)z�Walk the list of source files in 'sources', looking for SWIG
        interface (.i) files.  Run SWIG on all that are found, and
        return a modified 'sources' list with SWIG source files replaced
        by the generated C (or C++) files.
        z/--swig-cpp is deprecated - use --swig-opts=-c++z-c++z.cppz.cz.i�_wrap���z-pythonzswigging %s to %sz-o)
r4r
r{r5rQrW�splitextrVr3�	find_swigrYr�Zspawn)r8rq�	extensionZnew_sourcesr�Zswig_targetsZ
target_ext�source�baser�r3Zswig_cmd�o�targetrrrr�1s@
�


zbuild_ext.swig_sourcescCs^tjdkrdStjdkrLdD]*}tj�d|d�}tj�|�r|SqdStdtj��dS)	z�Return the name of the SWIG executable.  On Unix, this is
        just "swig" -- it should be in the PATH.  Tries a bit harder on
        Windows.
        �posixr3r<)z1.3z1.2z1.1z	c:\swig%szswig.exez>I don't know how to find (much less run) SWIG on platform '%s'N)rQrZrWrX�isfileZDistutilsPlatformError)r8Zvers�fnrrrr�gs


��zbuild_ext.find_swigcCs�|�|�}|�d�}|�|d�}|jsRtjj|dd�|g�}tj�|j|�Sd�|dd��}|�d�}tj�	|�
|��}tj�||�S)z�Returns the path of the filename for a given extension.

        The file is located in `build_lib` or directly in the package
        (inplace option).
        rEr�Nr�build_py)�get_ext_fullnamerP�get_ext_filenamerrQrWrXr'rk�abspathZget_package_dir)r8r��fullname�modpath�filenamer*r�Zpackage_dirrrrr�s


zbuild_ext.get_ext_fullpathcCs |jdkr|S|jd|SdS)zSReturns the fullname of a given extension name.

        Adds the `package.` prefixNrE)r*)r8r�rrrr��s
zbuild_ext.get_ext_fullnamecCs.ddlm}|�d�}|d�}tjj|�|S)z�Convert the name of an extension (eg. "foo.bar") into the name
        of the file from which it will be loaded (eg. "foo/bar.so", or
        "foo\bar.pyd").
        r�rarEZ
EXT_SUFFIX)�distutils.sysconfigrarPrQrWrX)r8r�rar�Z
ext_suffixrrrr��s
zbuild_ext.get_ext_filenamecCsxd|j�d�d}z|�d�Wn0tk
rRd|�d��dd��d�}YnXd	|}||jkrr|j�|�|jS)
aReturn the list of symbols that a shared extension has to
        export.  This either uses 'ext.export_symbols' or, if it's not
        provided, "PyInit_" + module_name.  Only relevant on Windows, where
        the .pyd file (DLL) must export the module "PyInit_" function.
        �_rEr��asciirZpunycode�-�_ZPyInit)rZrP�encode�UnicodeEncodeError�replace�decoder�rV)r8r�reZ
initfunc_namerrrr��s"
zbuild_ext.get_export_symbolscCs�tjdkr^ddlm}t|j|�s�d}|jr4|d}|tjd?tjd?d@f}|j|gSn�dd	l	m
}d
}|d�r�ttd�r�d
}n<tjdkr�d
}n,dtj
kr�|d�dkr�d
}n|d�dkr�d
}|r�|d�}|jd|gS|jS)z�Return the list of libraries to link against when building a
        shared extension.  On most platforms, this is just 'ext.libraries';
        on Windows, we add the Python library (eg. python20.dll).
        r>r)�MSVCCompilerz
python%d%dZ_d���r�FrFZgetandroidapilevelTrAZ_PYTHON_HOST_PLATFORMZANDROID_API_LEVELZMACHDEPZ	LDVERSIONrD)rSr^Zdistutils._msvccompilerr�rNr2r�
hexversionr.r�ra�hasattrrQ�environ)r8r�r��templateZ	pythonlibraZlink_libpythonZ	ldversionrrrr��s4

�



zbuild_ext.get_libraries) �__name__�
__module__�__qualname__ZdescriptionrQrRZsep_byr	Zuser_optionsZboolean_optionsr
Zhelp_optionsr9rfror�r�r�rlr�r��
contextlib�contextmanagerr�r�r�r�r�r�r�r�r�rrrrr!sp
�����+��@N	
	K6	
r)�__doc__r�rQ�rerSZdistutils.corerZdistutils.errorsr�rrrZdistutils.dep_utilrZdistutils.extensionrZdistutils.utilr	rLr
Zsiterr�r|r
rrrrr�<module>s$�distutils/command/__pycache__/install_headers.cpython-38.opt-2.pyc000064400000003010151153537440021151 0ustar00U

e5d�@s ddlmZGdd�de�ZdS)�)�Commandc@sFeZdZdZddgZdgZdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dS)�install_headerszinstall C/C++ header files)zinstall-dir=�dz$directory to install header files to)�force�fz-force installation (overwrite existing files)rcCsd|_d|_g|_dS)Nr)�install_dirr�outfiles��self�r�9/usr/lib64/python3.8/distutils/command/install_headers.py�initialize_optionssz"install_headers.initialize_optionscCs|�ddd�dS)NZinstall)rr)rr)Zset_undefined_optionsr	rrr�finalize_optionss�z install_headers.finalize_optionscCsH|jj}|sdS|�|j�|D]"}|�||j�\}}|j�|�q dS�N)�distribution�headersZmkpathrZ	copy_filer�append)r
r�header�out�_rrr�run!szinstall_headers.runcCs|jjp
gSr)rrr	rrr�
get_inputs+szinstall_headers.get_inputscCs|jSr)rr	rrr�get_outputs.szinstall_headers.get_outputsN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsr
rrrrrrrrr
s�
rN)Zdistutils.corerrrrrr�<module>sdistutils/command/__pycache__/install_scripts.cpython-38.opt-1.pyc000064400000004137151153537440021237 0ustar00U

e5d��@sDdZddlZddlmZddlmZddlmZGdd�de�ZdS)zudistutils.command.install_scripts

Implements the Distutils 'install_scripts' command, for installing
Python scripts.�N)�Command)�log)�ST_MODEc@sLeZdZdZddddgZddgZdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dS)�install_scriptsz%install scripts (Python or otherwise))zinstall-dir=�dzdirectory to install scripts to)z
build-dir=�bz'build directory (where to install from))�force�fz-force installation (overwrite existing files))�
skip-buildNzskip the build stepsrr
cCsd|_d|_d|_d|_dS)Nr)�install_dirr�	build_dir�
skip_build��self�r�9/usr/lib64/python3.8/distutils/command/install_scripts.py�initialize_optionssz"install_scripts.initialize_optionscCs |�dd�|�dddd�dS)NZbuild)�
build_scriptsrZinstall)rr)rr)r
r
)Zset_undefined_optionsrrrr�finalize_options!s�z install_scripts.finalize_optionscCs�|js|�d�|�|j|j�|_tjdkr~|��D]H}|j	rLt
�d|�q4t�|�t
dBd@}t
�d||�t�||�q4dS)Nr�posixzchanging mode of %simi�zchanging mode of %s to %o)r
Zrun_commandZ	copy_treerr�outfiles�os�name�get_outputsZdry_runr�info�statr�chmod)r�file�moderrr�run)s

zinstall_scripts.runcCs|jjp
gS�N)ZdistributionZscriptsrrrr�
get_inputs8szinstall_scripts.get_inputscCs
|jpgSr )rrrrrr;szinstall_scripts.get_outputsN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsrrrr!rrrrrrs�r)	�__doc__rZdistutils.corerZ	distutilsrrrrrrrr�<module>s
distutils/command/__pycache__/bdist_msi.cpython-38.opt-2.pyc000064400000043114151153537440017776 0ustar00U

e5d߉�@s�ddlZddlZddlmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZddlZdd	lmZmZmZdd
lmZmZmZmZGdd�de�ZGd
d�de�ZdS)�N)�Command)�remove_tree)�get_python_version)�
StrictVersion)�DistutilsOptionError)�get_platform)�log)�schema�sequence�text)�	Directory�Feature�Dialog�add_datac@sBeZdZdd�Zdd�Zddd�Zdd
d�Zdd
d�Zdd�ZdS)�PyDialogcOs>tj|f|��|jd}d|d}|�dd||jd�dS)N�$�iHZ
BottomLiner)r�__init__�h�line�w)�self�args�kwZrulerZbmwidth�r�3/usr/lib64/python3.8/distutils/command/bdist_msi.pyrs
zPyDialog.__init__c
Cs|�ddddddd|�dS)N�Title��
�@�<�z{\VerdanaBold10}%s)r)r�titlerrrr"#s�zPyDialog.title�Back�c
Cs,|r
d}nd}|�|d|jddd|||�S)N�r$���8���
pushbuttonr�rr"�next�name�active�flagsrrr�back*sz
PyDialog.back�Cancelc
Cs,|r
d}nd}|�|d|jddd|||�S)Nr%r$i0r'r(r)r*r,rrr�cancel5szPyDialog.cancel�Nextc
Cs,|r
d}nd}|�|d|jddd|||�S)Nr%r$��r'r(r)r*r,rrrr-@sz
PyDialog.nextc
Cs,|�|t|j|d�|jdddd||�S)N�r'r(r)r%)r+�intrr)rr.r"r-Zxposrrr�xbuttonKszPyDialog.xbuttonN)r#r$)r2r$)r4r$)	�__name__�
__module__�__qualname__rr"r1r3r-r8rrrrrs



rc@s�eZdZdZdddde�fdddd	d
ddd
g
ZddddgZddddddddddddddd d!d"d#d$d%gZd&Zd'd(�Z	d)d*�Z
d+d,�Zd-d.�Zd/d0�Z
d1d2�Zd3d4�Zd5d6�Zd7S)8�	bdist_msiz7create a Microsoft Installer (.msi) binary distribution)z
bdist-dir=Nz1temporary directory for creating the distributionz
plat-name=�pz;platform name to embed in generated filenames (default: %s))�	keep-temp�kzPkeep the pseudo-installation tree around after creating the distribution archive)ztarget-version=Nz6require a specific python version on the target system)�no-target-compile�cz/do not compile .py to .pyc on the target system)�no-target-optimize�oz;do not compile .py to .pyo (optimized) on the target system)z	dist-dir=�dz-directory to put final built distributions in)�
skip-buildNz2skip rebuilding everything (for testing/debugging))zinstall-script=NzUbasename of installation script to be run after installation or before deinstallation)zpre-install-script=Nz{Fully qualified filename of a script to be run before any files are installed.  This script need not be in the distributionr>r@rBrEz2.0z2.1z2.2z2.3z2.4z2.5z2.6z2.7z2.8z2.9z3.0z3.1z3.2z3.3z3.4z3.5z3.6z3.7z3.8z3.9�XcCsFd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
dS)Nr)�	bdist_dir�	plat_name�	keep_tempZno_target_compileZno_target_optimize�target_version�dist_dir�
skip_build�install_script�pre_install_script�versions)rrrr�initialize_options}szbdist_msi.initialize_optionscCs�|�dd�|jdkr2|�d�j}tj�|d�|_t�}|jsN|j	�
�rN||_|jr�|jg|_|js�|j	�
�r�|j|kr�t
d|f��nt|j�|_|�ddd�|jr�t
d��|jr�|j	jD]}|jtj�|�kr�q�q�t
d|j��d|_dS)	NZbdist)rLrLZmsizMtarget version can only be %s, or the '--skip-build' option must be specified)rKrK)rHrHz5the pre-install-script feature is not yet implementedz(install_script '%s' not found in scripts)Zset_undefined_optionsrG�get_finalized_command�
bdist_base�os�path�joinrrJ�distribution�has_ext_modulesrOrLr�list�all_versionsrNrMZscripts�basename�install_script_key)rrRZ
short_versionZscriptrrr�finalize_options�sH

�������zbdist_msi.finalize_optionscCsz|js|�d�|jddd�}|j|_|j|_d|_|�d�}d|_d|_|j�	�r�|j
}|spdtjdd�}d	|j
|f}|�d�}tj�|jd
|�|_t�d|j�|��tj�dtj�|jd��|��tjd=|�|j�|j��}|�|�}tj�|�}tj�|��r"t�|�|jj }|j!}	|	�s<|j"}	|	�sFd
}	|�#�}
dt$|
�j%}|j��}|j
�r~d|j
|f}nd|}t&�'|t(|t&�)�||	�|_*t&�+|j*t,�d|
fg}
|j-�p�|j.}|�r�|
�/d|f�|j0�r�|
�/d|j0f�|
�rt1|j*d|
�|�2�|�3�|�4�|�5�|j*�6�t7|jd��r^d|j
�pJd|f}|jj8�/|�|j9�svt:|j|j;d�dS)N�build�installr$)Zreinit_subcommandsr�install_libz%d.%d�z.%s-%s�libzinstalling to %sZPURELIBZUNKNOWNz%d.%d.%dzPython %s %sz	Python %sZDistVersionZ
ARPCONTACTZARPURLINFOABOUT�Property�
dist_filesr<�any)�dry_run)<rLZrun_commandZreinitialize_commandrG�prefixZwarn_dir�compile�optimizerVrWrJ�sys�version_inforHrQrSrTrUZ
build_baseZ	build_libr�infoZensure_finalized�insert�runZmkpathrK�get_fullname�get_installer_filename�abspath�exists�unlink�metadata�authorZ
maintainerZget_versionr�version�msilibZ
init_databaser	Zgen_uuid�dbZ
add_tablesr
Zauthor_emailZmaintainer_email�appendZurlr�add_find_python�	add_files�add_scripts�add_ui�Commit�hasattrrcrIrre)rr^r_rJZplat_specifierr]�fullname�installer_namersrtruZsversionZproduct_nameZpropsZemail�tuprrrrm�s�




�



�

z
bdist_msi.runc
Cs|j}t�d�}tj�|j�}t||d|dd�}t|ddddddd�}||d	fg}|j	|j
gD]t}d|}d|}	}
d}||j
kr�d
}d}
nd|}d}
t||	||d|
|d�}t||||||
�}|�|||f�q`|��i}|D�]\}}}|g}|�r�|�
�}t�|j�D]�}tj�|j|�}tj�|��rld
|�|�|f}||}
t|||||
|�}|�|�n�|j�s�|�|j|d�||k�r�|�|�}||<||jk�r�|j�r�td|��d||_n*||}t|jd|||j|d|jfg��qq�|��q�|�|�dS)NZ	distfiles�	TARGETDIRZ	SourceDir�PythonZ
Everythingrr$)Z	directory�zPython from another locationr`zPython %s from registryz%s|%szMultiple files with name %sz[#%s]Z
DuplicateFile)rwrvZCABrSrTrprGrr
rO�
other_versionrxr}�pop�listdirZabsoluterU�isdirZ
make_shortZ	componentZstart_componentZlogicalZadd_filerMr[rrZcommit)rrwZcabZrootdir�root�f�itemsru�targetr.�defaultZdescr"�level�dir�seenZfeatureZtodo�fileZafileZshortZnewdir�keyrrrrz
sf

�

��

zbdist_msi.add_filescCs|d}|jD�]j}d|}d|}d|}d|}d|}d|}d|}	d	|}
d
|}d|}tjrld}
nd
}
t|jd|d
|d|
f|d|d|
fg�t|jd||f||fg�t|jd|d|d|df|	d|d|df|
d|d|dfg�t|jd|||f|	||df|
d|d
fg�t|jd|||f|	||df|
d|d
fg�t|jdd|dd|fg�|d7}q
dS)Ni�z)SOFTWARE\Python\PythonCore\%s\InstallPathzpython.machine.zpython.user.zPYTHON.MACHINE.zPYTHON.USER.ZPythonFromMachineZPythonFromUserZ	PythonExer��PYTHON�r`Z
RegLocatorr$Z	AppSearch�CustomActioni3�[�]z]\python.exe�InstallExecuteSequence�InstallUISequenceZ	Conditionr�rz
NOT TARGETDIR�)rOrvZWin64rrw)r�start�verZinstall_pathZmachine_regZuser_regZmachine_propZ	user_propZmachine_actionZuser_actionZ
exe_actionZtarget_dir_prop�exe_propZTyperrrryCs`�����������zbdist_msi.add_find_pythonc
Cs|jrjd}|j|jgD]P}d|}d|}t|jd|d||jfg�t|jd|d||fg�|d7}q|jr�tj�	|j
d	�}t|d
��4}|�d�t|j��}|�|�
��W5QRXW5QRXt|jdd
t�|�fg�t|jddg�t|jddg�dS)Ni�zinstall_script.r�r��2r�z&Python%s=3r$zpreinstall.batrzrem ="""
%1 %0
exit
"""
�Binary�
PreInstall)r�r`r�N)r�z
NOT Installedi�)rMrOr�rrwr[rNrSrTrUrG�open�write�readrvr�)rr�r�Zinstall_actionr�Zscriptfnr�Zfinrrrr{ys6��
	
"���zbdist_msi.add_scriptscCs�
|j}d}}d}d}d}d}d}d}	t|dd	d
ddd
dg�t|dddddg�t|ddddddg�t|dtj�t|dtj�t|d||||||ddd�}
|
�d�|
jddd d!�|
jd"d#d d!�|
�d$d%d&d'd(d)d*�|
�d+d%d,d'd-d)d.�|
j	dd"dd/�}|�
d0d1�t|d2||||||ddd�}|�d3�|jddd d!�|jd"d#d d!�|�d$d%d&d'd(d)d4�|�d+d%d,d'd-d)d.�|j	dd"dd/�}|�
d0d1�t|d5||||||ddd�}
|
�d6�|
jddd d!�|
jd"d#d d!�|
�d7d%d8d'd-d)d.�|
j	dd"dd/�}|�
d0d9�t|d:||||d;|d<d<d<d=d>�}|�d?d%d@dAd%d)dB�|�d7d-dCdDd-d)dE�|�dFd-dGdHdddI�|�dJdKd-dLdHdMdNdOddd�|jd1dPd1d/�}|�
d0d1�|j	dPd<dPd/�}|�
d0dP�|jd<d1d<d/�}|�
d0d<�t|dQddRdHdSdT|dUdd�}|�dUddVdDdWddX�|�
dYdZd[d\d]dd^d��
d0d_�|�
d`dad[d\d]ddbd��
d0dc�|�
ddd d[d\d]dded��
d0df�|�
dgdhd[d\d]dd"d��
d0di�|�
djd\d[d\d]ddPd��
d0dk�|�
dldmd[d\d]ddnd��
d0do�|�
dpdqd[d\d]dd<d��
d0dr�t|dsddRdtdud|d^d^d^�}|�dFdWd%dvdwddx�|�
dbd[dydzd{ddbd^�}|�
d0d1�|�
d^d|dydzd{dd^db�}|�
d0d9�t|d}ddRdtdu||d9d9d9�}|�dFdWd%dvdwdd~�|�
d9ddydzd{dd9d�}|�
d0d1�t|d�||||||d"d"d"�}|�d7d%d&d'd�d)d��|�d��|�dd%d�d'd-d)d��}|�ddF�|�d�d%d�d'dwd)d�}|�d�dF�|jd#dd d!�|j	d�dd d!�|�d"d�}|�
d�ds�t|d�||||||d�d�d"�}|�d��|�d�d%dwdd-dd�|j���|jddd d!�|�	d�d"�}d}|j
d�d�|d��|j|jgD](}|d7}|j
d�d�|d�||d���q
|j
d�d}|dd��|j
d0d9|d�d��|�d"d��}|�
d�ds�|�d�d�d%d�ddZdd�dd�d�}|�
d�d��|j}d�|}d�|}|�d�d%dAdd%dd��}|�d�|�|�d�|�|�d�|�|�d�|�|�d�d�d%d�dd�dd�|dd�d�}|�d�|�|�d�|�|�d�|�|�d�|�t|d�||||||d�d�d�d=d>�}|�d?d%d@dAd%d)d��|�d7d-d-dDd-d)d��|�dFd-d�dHd�dd��|�d�d�d-d�dHd�d�dd�dd�|�d�dndd���
d0d9�t|d�||||||d�d�d"�}|�d��|�d�d%d�dtddd�dXd��	}|�d�d d�d�d-d��|�d�d d�d�d-d��|jd#dd d!�|�	d�d"�}|�
d�d�d�d�|j
d0d9d�d��|�d"d��}|�
d�ds�t|d�||||||d"d"d"d=d>�}|�d?d-d%dAd%d)d��|�dFd�d�ddwddġ|�d�d�d�d�d-ddơ|�dd&d�|d&d-dd��}|�ddF�|�d�d�d�dZddRd�dd�dd�}|�d�dˡ|jdd�d=d!�|j	d�d"d=d!�|�d"d#��
d�ds�t|d�||||||d�d�d"�}|�d͡|�d�d%d�dHdhddС|�d�d%d�dHd�dd�dXd��	}|�d�d d�dAd{d֡|�d�d d�dAd{d١|jddd=d!�|�	dd"�}|�
d�d�d�d��|�
d�d�d�d@�|�
d�d�d�dN�|�
d�d�d�d�|�
d�d�d�d�|�
d�d�d�d�|�
d�d�d�d�|�
d�d�d�d�|�
d0d9d�d-�|�d"dѡ�
d�ds�dS)�Nr�iri,z[ProductName] Setupr%r$� rb)Z
DefaultUIFont�DlgFont8)ZErrorDialog�ErrorDlg)Z	Progress1ZInstall)Z	Progress2Zinstalls)�MaintenanceForm_Action�Repair)�
WhichUsers�ALLZ	TextStyle)r��Tahoma�	Nr)ZDlgFontBold8r��Nr$)Z
VerdanaBold10�VerdanarNr$)ZVerdanaRed9r�r��rr�)�
PrepareDlgz(Not Privileged or Windows9x or Installed�)�
WhichUsersDlgz.Privileged and not Windows9x and not Installed�)�SelectFeaturesDlgz
Not Installedi�)�MaintenanceTypeDlgz,Installed AND NOT RESUME AND NOT Preselectedi�)�ProgressDlgNi�
ActionText�UITextZ
FatalErrorZFinishz)[ProductName] Installer ended prematurelyz< Backr)r/r2r#ZDescription1r�Fr�Pr!z�[ProductName] setup ended prematurely because of an error.  Your system has not been modified.  To install this program at a later time, please run the installation again.ZDescription2��z.Click the Finish button to exit the Installer.)r.Z	EndDialogZExitZUserExitz'[ProductName] Installer was interruptedz�[ProductName] setup was interrupted.  Your system has not been modified.  To install this program at a later time, please run the installation again.Z
ExitDialogz&Completing the [ProductName] InstallerZDescription��ZReturnZ
FilesInUse�ZRetryF)Zbitmapr���z{\DlgFontBold8}Files in Use�iz8Some files that need to be updated are currently in use.ZText�7iJz�The following applications are using files that need to be updated by this setup. Close these applications and then click Retry to continue the installation or Cancel to exit it.ZListZListBox�k��ZFileInUseProcess�Ignorer�r�eiZ	ErrorTextr��0r��N�x�H�Q�ZNoZErrorNo�Y��ZYesZErrorYes�AZAbortZ
ErrorAbort�C�*ZErrorCancel�IZErrorIgnore�O�ZOkZErrorOk�R��Z
ErrorRetryZ	CancelDlgi�U���z;Are you sure you want to cancel [ProductName] installation?�9r(r)�ZWaitForCostingDlgzRPlease wait while the installer finishes determining your disk space requirements.�fr��(zOPlease wait while the Installer prepares to guide you through the installation.z&Welcome to the [ProductName] Installer�nzPondering...Z
ActionData�r4ZSpawnDialogr�zSelect Python InstallationsZHintz9Select the Python locations where %s should be installed.zNext >z[TARGETDIR]z[SourceDir])Zorderingz
[TARGETDIR%s]z FEATURE_SELECTED AND &Python%s=3ZSpawnWaitDialogr`ZFeaturesZ
SelectionTreer ZFEATUREZPathEditz[FEATURE_SELECTED]�1z!FEATURE_SELECTED AND &Python%s<>3ZOtherz$Provide an alternate Python locationZEnableZShowZDisableZHide���r�ZDiskCostDlgZOKz&{\DlgFontBold8}Disk Space RequirementszFThe disk space required for the installation of the selected features.�5aThe highlighted volumes (if any) do not have enough disk space available for the currently selected features.  You can either remove some files from the highlighted volumes, or choose to install less features onto local drive(s), or select different destination drive(s).Z
VolumeListZVolumeCostList�d�iz{120}{70}{70}{70}{70}g�?r�ZAdminInstallzGSelect whether to install [ProductName] for all users of this computer.r�r��zInstall for all usersZJUSTME�zInstall just for mez
[ALLUSERS]zWhichUsers="ALL"r�z({\DlgFontBold8}[Progress1] [ProductName]�#�AzYPlease wait while the Installer [Progress2] [ProductName]. This may take several minutes.ZStatusLabelzStatus:ZProgressBariz
Progress doneZSetProgressZProgressr�z)Welcome to the [ProductName] Setup WizardZBodyText�?z:Select whether you want to repair or remove [ProductName].ZRepairRadioGroup�lr�r�r�z&Repair [ProductName]ZRemoverzRe&move [ProductName]z[REINSTALL]zMaintenanceForm_Action="Repair"z[Progress1]Z	Repairingz[Progress2]ZrepairsZ	Reinstallr�z[REMOVE]zMaintenanceForm_Action="Remove"�ZRemoving�Zremoves�
�z MaintenanceForm_Action<>"Change")rwrrr�r�rr"r1r3r-ZeventZcontrolrr+�mappingrVrnrOr�Z	conditionr8Z
radiogroup�add)rrw�x�yrrr"ZmodalZmodelessZtrack_disk_spaceZfatalrAZ	user_exitZexit_dialogZinuse�errorr3ZcostingZprepZseldlg�orderrur�Zinstall_other_condZdont_install_other_condZcostZ
whichusers�gZprogressZmaintrrrr|�sv��
��	��
�
���
���
�������       ������
�
���
��������
�
������
��zbdist_msi.add_uicCs<|jrd||j|jf}nd||jf}tj�|j|�}|S)Nz%s.%s-py%s.msiz	%s.%s.msi)rJrHrSrTrUrK)rrZ	base_namer�rrrro�s�z bdist_msi.get_installer_filenameN)r9r:r;ZdescriptionrZuser_optionsZboolean_optionsrYr�rPr\rmrzryr{r|rorrrrr<Ss^����
�
([66&@r<)rirSZdistutils.corerZdistutils.dir_utilrZdistutils.sysconfigrZdistutils.versionrZdistutils.errorsrZdistutils.utilrZ	distutilsrrvr	r
rrr
rrrr<rrrr�<module>	s>distutils/command/__pycache__/bdist_wininst.cpython-38.opt-1.pyc000064400000020351151153537440020676 0ustar00U

e5d�>�@sxdZddlZddlZddlZddlmZddlmZddlm	Z	m
Z
ddlTddlm
Z
ddlmZGd	d
�d
e�ZdS)zzdistutils.command.bdist_wininst

Implements the Distutils 'bdist_wininst' command: create a windows installer
exe-program.�N)�Command)�get_platform)�create_tree�remove_tree)�*)�get_python_version)�logc
s�eZdZdZdddde�fdddd	d
ddd
dddg
ZddddgZejdkZ	�fdd�Z
dd�Zdd�Zdd�Z
dd�Zd'd!d"�Zd#d$�Zd%d&�Z�ZS)(�
bdist_wininstz-create an executable installer for MS Windows)z
bdist-dir=Nz1temporary directory for creating the distributionz
plat-name=�pz;platform name to embed in generated filenames (default: %s))�	keep-temp�kzPkeep the pseudo-installation tree around after creating the distribution archive)ztarget-version=Nz6require a specific python version on the target system)�no-target-compile�cz/do not compile .py to .pyc on the target system)�no-target-optimize�oz;do not compile .py to .pyo (optimized) on the target system)z	dist-dir=�dz-directory to put final built distributions in)zbitmap=�bz>bitmap to use for the installer instead of python-powered logo)ztitle=�tz?title to display on the installer background instead of default)�
skip-buildNz2skip rebuilding everything (for testing/debugging))zinstall-script=NzUbasename of installation script to be run after installation or before deinstallation)zpre-install-script=Nz{Fully qualified filename of a script to be run before any files are installed.  This script need not be in the distribution)zuser-access-control=Nz�specify Vista's UAC handling - 'none'/default=no handling, 'auto'=use UAC if target Python installed for all users, 'force'=always use UACrr
rr�win32cs t�j||�t�dtd�dS)Nz^bdist_wininst command is deprecated since Python 3.8, use bdist_wheel (wheel packages) instead�)�super�__init__�warnings�warn�DeprecationWarning)�self�args�kw��	__class__��7/usr/lib64/python3.8/distutils/command/bdist_wininst.pyr?s
�zbdist_wininst.__init__cCsRd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_dS)Nr)
�	bdist_dir�	plat_name�	keep_temp�no_target_compile�no_target_optimize�target_version�dist_dir�bitmap�title�
skip_build�install_script�pre_install_script�user_access_control)rr!r!r"�initialize_optionsEsz bdist_wininst.initialize_optionscCs�|�dd�|jdkrR|jr6|jr6|j�d�}|j|_|�d�j}tj	�
|d�|_|js^d|_|js�|j��r�t
�}|jr�|j|kr�td|f��||_|�ddd�|jr�|jjD]}|jtj	�|�kr�q�q�td|j��dS)	N�bdist)r,r,Zwininst�zMtarget version can only be %s, or the '--skip-build' option must be specified)r)r))r$r$z(install_script '%s' not found in scripts)Zset_undefined_optionsr#r,r$�distributionZget_command_obj�get_finalized_command�
bdist_base�os�path�joinr(�has_ext_modulesrZDistutilsOptionErrorr-�scripts�basename)rr1r5Z
short_version�scriptr!r!r"�finalize_optionsUs>
�����zbdist_wininst.finalize_optionsc
Cs�tjdkr&|j��s|j��r&td��|js6|�d�|jddd�}|j	|_
|j|_d|_|j|_|�d�}d|_
d|_|j��r�|j}|s�d	tjdd
�}d|j|f}|�d�}tj�|jd|�|_d
D],}|��}|dkr�|d}t|d||�q�t�d|j	�|��tj�dtj�|j	d��|��tjd=ddlm}|�}	|j� �}
|j!|	d|j	d�}|�"||
|j#�|j���r�t$�}nd}|jj%�&d||�'|
�f�t�(d|�t�)|�|j*�s�t+|j	|j,d�dS)Nrz^distribution contains extensions and/or C libraries; must be compiled on a Windows 32 platform�build�install�)Zreinit_subcommandsr�install_libz%d.%drz.%s-%s�lib)ZpurelibZplatlib�headersr:�datarCz/Include/$dist_nameZinstall_zinstalling to %sZPURELIB)�mktemp�zip)Zroot_dir�anyr	zremoving temporary file '%s')�dry_run)-�sys�platformr3r9Zhas_c_librariesZDistutilsPlatformErrorr,Zrun_commandZreinitialize_commandr#�rootZwarn_dirr$�compile�optimizer(�version_infor4r6r7r8Z
build_baseZ	build_lib�upper�setattrr�infoZensure_finalized�insert�runZtempfilerE�get_fullnameZmake_archive�
create_exer*rZ
dist_files�append�get_installer_filename�debug�remover%rrH)
rr?rAr(Zplat_specifierr>�key�valuerEZarchive_basename�fullname�arcnameZ	pyversionr!r!r"rS{sr
���




��
��
zbdist_wininst.runcCsZg}|jj}|�d�|jpdd}dd�}dD]B}t||d�}|r0|d|��||�f}|�d|||�f�q0|�d	�|jr�|�d
|j�|�d||��|�d|j�|�d
|j�|j	r�|�d|j	�|j
r�|�d|j
�|j�p|j��}|�d||��ddl
}ddl}	d|�|�
��|	jf}
|�d|
�d�|�S)Nz
[metadata]r2�
cSs|�dd�S)Nr^z\n)�replace)�sr!r!r"�escape�sz)bdist_wininst.get_inidata.<locals>.escape)ZauthorZauthor_email�descriptionZ
maintainerZmaintainer_email�nameZurl�versionz
    %s: %sz%s=%sz
[Setup]zinstall_script=%szinfo=%sztarget_compile=%dztarget_optimize=%dztarget_version=%szuser_access_control=%sztitle=%srzBuilt %s with distutils-%sz
build_info=%s)r3�metadatarVZlong_description�getattr�
capitalizer-r&r'r(r/r+rT�time�	distutils�ctime�__version__r8)r�linesrerQrarcrDr+rhriZ
build_infor!r!r"�get_inidata�s>
�
�zbdist_wininst.get_inidataNc
CsHddl}|�|j�|��}|�|�}|�d|�|r`t|d��}|��}W5QRXt|�}	nd}	t|d���}
|
�	|�
��|r�|
�	|�t|t�r�|�
d�}|d}|jr�t|jddd	��}|���
d�}W5QRX||d
}n|d}|
�	|�|�ddt|�|	�}
|
�	|
�t|d��}|
�	|���W5QRXW5QRXdS)
Nrzcreating %s�rb�wb�mbcs��rzlatin-1)�encodings
z<iiii{V4)�structZmkpathr)rmrWZannounce�open�read�len�write�
get_exe_bytes�
isinstance�str�encoder.Zpack)rr]r\r*rtZcfgdata�installer_name�fZ
bitmapdataZ	bitmaplen�filer<Zscript_data�headerr!r!r"rU�sD




�
�
zbdist_wininst.create_execCsD|jr&tj�|jd||j|jf�}ntj�|jd||jf�}|S)Nz%s.%s-py%s.exez	%s.%s.exe)r(r6r7r8r)r$)rr\r}r!r!r"rW1s
��
�z$bdist_wininst.get_installer_filenamec	Cs$t�}|jrl|j|krl|jdkr&d}q�|jdkr6d}q�|jdkrFd}q�|jdkrVd}q�|jdkrfd	}q�d
}n@zddlm}Wntk
r�d
}YnX|�d
�d}|d}tj�t	�}|j
dkr�|j
dd�dkr�|j
dd�}nd}tj�|d||f�}t|d�}z|��W�S|�
�XdS)Nz2.4z6.0z7.1z2.5z8.0z3.2z9.0z3.4z10.0z14.0r)�CRT_ASSEMBLY_VERSION�.z.0r��winr2zwininst-%s%s.exern)rr(Zmsvcrtr��ImportError�	partitionr6r7�dirname�__file__r$r8ru�closerv)	rZcur_versionZbvr��majorZ	directoryZsfix�filenamer~r!r!r"ry>s8	






zbdist_wininst.get_exe_bytes)N)�__name__�
__module__�__qualname__rbrZuser_optionsZboolean_optionsrIrJZ_unsupportedrr0r=rSrmrUrWry�
__classcell__r!r!rr"r	s>���%�
&Q.
7
r	)�__doc__r6rIrZdistutils.corerZdistutils.utilrZdistutils.dir_utilrrZdistutils.errorsZdistutils.sysconfigrrirr	r!r!r!r"�<module>sdistutils/command/__pycache__/clean.cpython-38.opt-1.pyc000064400000004066151153537440017105 0ustar00U

e5d�
�@sDdZddlZddlmZddlmZddlmZGdd�de�ZdS)zBdistutils.command.clean

Implements the Distutils 'clean' command.�N)�Command)�remove_tree)�logc@s>eZdZdZddddddgZdgZd	d
�Zdd�Zd
d�ZdS)�cleanz-clean up temporary files from 'build' command)zbuild-base=�bz2base build directory (default: 'build.build-base'))z
build-lib=Nz<build directory for all modules (default: 'build.build-lib'))zbuild-temp=�tz7temporary build directory (default: 'build.build-temp'))zbuild-scripts=Nz<build directory for scripts (default: 'build.build-scripts'))zbdist-base=Nz+temporary directory for built distributions)�all�az7remove all build output, not just temporary by-productsrcCs(d|_d|_d|_d|_d|_d|_dS)N)�
build_base�	build_lib�
build_temp�
build_scripts�
bdist_baser��self�r�//usr/lib64/python3.8/distutils/command/clean.py�initialize_options szclean.initialize_optionscCs"|�ddddd�|�dd�dS)NZbuild)r
r
)rr)r
r
)rrZbdist)rr)Zset_undefined_optionsrrrr�finalize_options(s��zclean.finalize_optionscCs�tj�|j�r t|j|jd�nt�d|j�|jrr|j	|j
|jfD],}tj�|�rdt||jd�qDt�d|�qD|js�zt�
|j�t�d|j�Wntk
r�YnXdS)N)�dry_runz%'%s' does not exist -- can't clean itz
removing '%s')�os�path�existsrrrr�debugrrrr
�warn�rmdirr
�info�OSError)rZ	directoryrrr�run1s*���z	clean.runN)	�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsrrrrrrrrs�	r)	�__doc__rZdistutils.corerZdistutils.dir_utilrZ	distutilsrrrrrr�<module>s
distutils/command/__pycache__/bdist_rpm.cpython-38.opt-2.pyc000064400000027415151153537440020012 0ustar00U

e5dIT�@s|ddlZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlTddlm
Z
ddlmZGd	d
�d
e�ZdS)�N)�Command)�DEBUG)�get_platform)�
write_file)�*)�get_python_version)�logc)@s�eZdZdZdddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*g)Zd+d,d-d.d/gZd+d,d-d0�Zd1d2�Zd3d4�Zd5d6�Z	d7d8�Z
d9d:�Zd;d<�Zd=d>�Z
d?S)@�	bdist_rpmzcreate an RPM distribution)zbdist-base=Nz/base directory for creating built distributions)z	rpm-base=Nzdbase directory for creating RPMs (defaults to "rpm" under --bdist-base; must be specified for RPM 2))z	dist-dir=�dzDdirectory to put final RPM files in (and .spec files if --spec-only))zpython=NzMpath to Python interpreter to hard-code in the .spec file (default: "python"))z
fix-pythonNzLhard-code the exact path to the current Python interpreter in the .spec file)z	spec-onlyNzonly regenerate spec file)zsource-onlyNzonly generate source RPM)zbinary-onlyNzonly generate binary RPM)z	use-bzip2Nz7use bzip2 instead of gzip to create source distribution)zdistribution-name=Nzgname of the (Linux) distribution to which this RPM applies (*not* the name of the module distribution!))zgroup=Nz9package classification [default: "Development/Libraries"])zrelease=NzRPM release number)zserial=NzRPM serial number)zvendor=NzaRPM "vendor" (eg. "Joe Blow <joe@example.com>") [default: maintainer or author from setup script])z	packager=NzBRPM packager (eg. "Jane Doe <jane@example.net>") [default: vendor])z
doc-files=Nz6list of documentation files (space or comma-separated))z
changelog=Nz
RPM changelog)zicon=Nzname of icon file)z	provides=Nz%capabilities provided by this package)z	requires=Nz%capabilities required by this package)z
conflicts=Nz-capabilities which conflict with this package)zbuild-requires=Nz+capabilities required to build this package)z
obsoletes=Nz*capabilities made obsolete by this package)�
no-autoreqNz+do not automatically calculate dependencies)�	keep-temp�kz"don't clean up RPM build directory)�no-keep-tempNz&clean up RPM build directory [default])�use-rpm-opt-flagsNz8compile with RPM_OPT_FLAGS when building from source RPM)�no-rpm-opt-flagsNz&do not pass any RPM CFLAGS to compiler)�	rpm3-modeNz"RPM 3 compatibility mode (default))�	rpm2-modeNzRPM 2 compatibility mode)zprep-script=Nz3Specify a script for the PREP phase of RPM building)z
build-script=Nz4Specify a script for the BUILD phase of RPM building)zpre-install=Nz:Specify a script for the pre-INSTALL phase of RPM building)zinstall-script=Nz6Specify a script for the INSTALL phase of RPM building)z
post-install=Nz;Specify a script for the post-INSTALL phase of RPM building)zpre-uninstall=Nz<Specify a script for the pre-UNINSTALL phase of RPM building)zpost-uninstall=Nz=Specify a script for the post-UNINSTALL phase of RPM building)z
clean-script=Nz4Specify a script for the CLEAN phase of RPM building)zverify-script=Nz6Specify a script for the VERIFY phase of the RPM build)zforce-arch=Nz0Force an architecture onto the RPM build process)�quiet�qz3Run the INSTALL phase of RPM building in quiet moderrrrr)rrrcCs�d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_ d|_!d|_"d|_#d|_$d|_%d|_&dS)Nr�)'�
bdist_base�rpm_base�dist_dir�python�
fix_python�	spec_only�binary_only�source_only�	use_bzip2�distribution_name�group�release�serial�vendor�packager�	doc_files�	changelog�icon�prep_script�build_script�install_script�clean_script�
verify_script�pre_install�post_install�
pre_uninstall�post_uninstall�prep�provides�requires�	conflicts�build_requires�	obsoletes�	keep_temp�use_rpm_opt_flags�	rpm3_mode�
no_autoreq�
force_archr��self�r>�3/usr/lib64/python3.8/distutils/command/bdist_rpm.py�initialize_options�sNzbdist_rpm.initialize_optionscCs�|�dd�|jdkr6|js$td��tj�|jd�|_|jdkrX|j	rPt
j|_qfd|_n|j	rftd��tjdkr~t
dtj��|jr�|jr�td	��|j��s�d
|_|�dd�|��dS)NZbdist)rrz)you must specify --rpm-base in RPM 2 mode�rpmZpython3z8--python and --fix-python are mutually exclusive options�posixz9don't know how to create RPM distributions on platform %sz6cannot supply both '--source-only' and '--binary-only'r)rr)Zset_undefined_optionsrr9ZDistutilsOptionError�os�path�joinrrr�sys�
executable�nameZDistutilsPlatformErrorrr�distribution�has_ext_modulesr8�finalize_package_datar<r>r>r?�finalize_options�s6
�

�
��
zbdist_rpm.finalize_optionscCsT|�dd�|�dd|j��|j��f�|�d�|�d�t|jt�rxdD]&}tj	�
|�rP||jkrP|j�|�qP|�dd	�|�d
�|�d�|�d�|�|j
�|_
|�d
�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�dS)Nr zDevelopment/Librariesr#z%s <%s>r$r%)ZREADMEz
README.txtr!�1r"rr&r'r(r)r*r+r,r-r.r/r0r2r3r4r5r6r;)Z
ensure_stringrIZget_contactZget_contact_emailZensure_string_list�
isinstancer%�listrCrD�exists�append�_format_changelogr&Zensure_filename)r=Zreadmer>r>r?rK�sB
��



















zbdist_rpm.finalize_package_datacCs�tr<td�td|j�td|j�td|j�td|j�|jrT|j}|�|�n8i}dD]&}t	j
�|j|�||<|�||�q\|d}t	j
�|d|j
���}|�t||��fd	|�|jr�dS|j
jdd�}|�d
�}|jr�dg|_ndg|_|�d
�||j
_|��d
}|d}|�||�|j�rbt	j
�|j��rT|�|j|�ntd|j��t�d�dg}	|j�r�|	�d�n|j �r�|	�d�n
|	�d�|	�!dd|j"g�|j#�r�|	�!ddt	j
�$|j�g�|j%�s�|	�d�|j&�r|	�d�|	�|�d}
|
d}d|
d}d|||f}
t	�'|
�}zlg}d}|�)�}|�sV�q�|�*��+�}|�|d�|dk�rD|d
}�qD|�(�}|�r�t,d t-|
���W5|�(�X|�.|	�|j/�s�|j
�0��r�t1�}nd!}|j �s(t	j
�|d"|�}|�2||j�t	j
�|j|�}|j
j�d#||f�|j�s�|D]`}t	j
�|d$|�}t	j
�|��r4|�2||j�t	j
�|jt	j
�3|��}|j
j�d#||f��q4dS)%Nzbefore _get_package_data():zvendor =z
packager =zdoc_files =zchangelog =)�SOURCES�SPECSZBUILD�RPMS�SRPMSrTz%s.speczwriting '%s'�sdistZbztarZgztarrrSzicon file '%s' does not existz
building RPMsZrpmbuildz-bsz-bbz-baz--definez__python %sz
_topdir %sz--cleanz--quietz%{name}-%{version}-%{release}z.src.rpmz%{arch}/z.%{arch}.rpmz%rpm -q --qf '%s %s\n' --specfile '%s'rzFailed to execute: %s�anyrVr	rU)4r�printr#r$r%r&rrZmkpathrCrDrErrI�get_nameZexecuter�_make_spec_fileZ
dist_filesZreinitialize_commandrZformatsZrun_commandZget_archive_filesZ	copy_filer'rPZDistutilsFileErrorr�inforrQr�extendrr9�abspathr7r�popen�close�readline�strip�splitZDistutilsExecError�reprZspawnZdry_runrJrZ	move_file�basename)r=Zspec_dirZrpm_dirr
Z	spec_pathZsaved_dist_filesrW�sourceZ
source_dirZrpm_cmdZ
nvr_stringZsrc_rpmZnon_src_rpmZq_cmd�outZbinary_rpmsZ
source_rpm�line�lZstatusZ	pyversionZsrpm�filenamerAr>r>r?�runs����


�

�


�



�

��z
bdist_rpm.runcCstj�|jtj�|��S)N)rCrDrErre)r=rDr>r>r?�
_dist_path�szbdist_rpm._dist_pathc
CsJd|j��d|j���dd�d|j��d|j�dd�dd|j��g}t�d	�}d
�dd�|�	�D��}d
}d}|�||�}||kr�|�
d�|�
d|d
�|�dddg�|jr�|�
d�n
|�
d�|�d|j�
�d|jddg�|j�s|j���s&|�
d�n|�
d|j�dD]V}t||���}t|t��rb|�
d|d�|�f�n|dk	�r*|�
d||f��q*|j��dk�r�|�
d |j���|j�r�|�
d!|j�|j�r�|�
d"d�|j��|j�r�|�
d#tj�|j��|j�r|�
d$�|�dd%|j��g�d&|jtj�tj d'�f}d(|}	|j!�rXd)|	}	d*|}
d+d,d-|	fd.d/|
fd0d1d2d3d4d5g	}|D]n\}}
}t||
�}|�s�|�r�|�dd6|g�|�r�t"|��}|�|�#��$d
��W5QRXn
|�
|��q�|�dd7d8g�|j%�r$|�
d9d�|j%��|j&�rF|�dd:g�|�|j&�|S);Nz
%define name z%define version �-�_z%define unmangled_version z%define release �z	Summary: zrpm --eval %{__os_install_post}�
cSsg|]}d|���qS)z  %s \)rb)�.0rhr>r>r?�
<listcomp>�s�z-bdist_rpm._make_spec_file.<locals>.<listcomp>zbrp-python-bytecompile \
z%brp-python-bytecompile %{__python} \
z2# Workaround for http://bugs.python.org/issue14443z%define __os_install_post z
Name: %{name}zVersion: %{version}zRelease: %{release}z-Source0: %{name}-%{unmangled_version}.tar.bz2z,Source0: %{name}-%{unmangled_version}.tar.gzz	License: zGroup: z>BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildrootzPrefix: %{_prefix}zBuildArch: noarchz
BuildArch: %s)ZVendorZPackagerZProvidesZRequiresZ	ConflictsZ	Obsoletesz%s: %s� ZUNKNOWNzUrl: zDistribution: zBuildRequires: zIcon: z
AutoReq: 0z%descriptionz%s %srz%s buildzenv CFLAGS="$RPM_OPT_FLAGS" z>%s install -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES)r1r(z&%setup -n %{name}-%{unmangled_version}Zbuildr)Zinstallr*)Zcleanr+zrm -rf $RPM_BUILD_ROOT)Zverifyscriptr,N)Zprer-N)Zpostr.N)Zpreunr/N)Zpostunr0N�%z%files -f INSTALLED_FILESz%defattr(-,root,root)z%doc z
%changelog)'rIrZZget_version�replacer!Zget_description�
subprocessZ	getoutputrE�
splitlinesrQr]rZget_licenser r;rJ�getattr�lowerrNrOZget_urlrr5r'rCrDrer:Zget_long_descriptionrrF�argvr8�open�readrcr%r&)r=Z	spec_fileZvendor_hookZproblemZfixedZ
fixed_hookZfield�valZdef_setup_callZ	def_buildZinstall_cmdZscript_optionsZrpm_opt�attr�default�fr>r>r?r[�s��

�
	�
�

�
���
�
 ��zbdist_rpm._make_spec_filecCs||s|Sg}|���d�D]N}|��}|ddkrB|�d|g�q|ddkrZ|�|�q|�d|�q|dsx|d=|S)Nrprrrormz  )rbrcr]rQ)r=r&Z
new_changelogrhr>r>r?rR1szbdist_rpm._format_changelogN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsZnegative_optr@rLrKrkrlr[rRr>r>r>r?r	sx�m��--*r	)rvrFrCZdistutils.corerZdistutils.debugrZdistutils.utilrZdistutils.file_utilrZdistutils.errorsZdistutils.sysconfigrZ	distutilsrr	r>r>r>r?�<module>sdistutils/command/__pycache__/bdist_dumb.cpython-38.opt-1.pyc000064400000007012151153537440020131 0ustar00U

e5d1�@shdZddlZddlmZddlmZddlmZmZddl	Tddl
mZddlm
Z
Gd	d
�d
e�ZdS)z�distutils.command.bdist_dumb

Implements the Distutils 'bdist_dumb' command (create a "dumb" built
distribution -- i.e., just an archive to be unpacked under $prefix or
$exec_prefix).�N)�Command)�get_platform)�remove_tree�ensure_relative)�*)�get_python_version)�logc	@s^eZdZdZdddde�fdddd	d
ddg	Zd
ddgZddd�Zdd�Zdd�Z	dd�Z
dS)�
bdist_dumbz"create a "dumb" built distribution)z
bdist-dir=�dz1temporary directory for creating the distributionz
plat-name=�pz;platform name to embed in generated filenames (default: %s))zformat=�fz>archive format to create (tar, gztar, bztar, xztar, ztar, zip))�	keep-temp�kzPkeep the pseudo-installation tree around after creating the distribution archive)z	dist-dir=r
z-directory to put final built distributions in)�
skip-buildNz2skip rebuilding everything (for testing/debugging))�relativeNz7build the archive using relative paths (default: false))zowner=�uz@Owner name used when creating a tar file [default: current user])zgroup=�gzAGroup name used when creating a tar file [default: current group]r
rrZgztar�zip)�posix�ntcCs:d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr)	�	bdist_dir�	plat_name�format�	keep_temp�dist_dir�
skip_buildr�owner�group)�self�r�4/usr/lib64/python3.8/distutils/command/bdist_dumb.py�initialize_options2szbdist_dumb.initialize_optionscCsz|jdkr&|�d�j}tj�|d�|_|jdkrfz|jtj|_Wn"t	k
rdt
dtj��YnX|�dddd�dS)NZbdistZdumbz@don't know how to create dumb built distributions on platform %s)rr)rr)rr)rZget_finalized_command�
bdist_base�os�path�joinr�default_format�name�KeyError�DistutilsPlatformErrorZset_undefined_options)rr"rrr �finalize_options=s"

��
�zbdist_dumb.finalize_optionscCs(|js|�d�|jddd�}|j|_|j|_d|_t�d|j�|�d�d|j�	�|j
f}tj�
|j|�}|js~|j}nJ|j��r�|j|jkr�tdt|j�t|j�f��ntj�
|jt|j��}|j||j||j|jd	�}|j��r�t�}nd
}|jj�d||f�|j�s$t|j|jd�dS)
NZbuild�install�)Zreinit_subcommandsrzinstalling to %sz%s.%szScan't make a dumb built distribution where base and platbase are different (%s, %s))Zroot_dirrr�anyr	)�dry_run) rZrun_commandZreinitialize_commandr�rootZwarn_dirr�infoZdistributionZget_fullnamerr#r$r%rrZhas_ext_modulesZinstall_baseZinstall_platbaser)�reprrZmake_archiverrrrZ
dist_files�appendrrr.)rr+Zarchive_basenameZpseudoinstall_rootZarchive_root�filenameZ	pyversionrrr �runOsR


�

����
��
�zbdist_dumb.runN)�__name__�
__module__�__qualname__ZdescriptionrZuser_optionsZboolean_optionsr&r!r*r4rrrr r	s,���
�r	)�__doc__r#Zdistutils.corerZdistutils.utilrZdistutils.dir_utilrrZdistutils.errorsZdistutils.sysconfigrZ	distutilsrr	rrrr �<module>sdistutils/command/__pycache__/bdist_msi.cpython-38.opt-1.pyc000064400000046121151153537440017776 0ustar00U

e5d߉�@s�dZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZdd	lmZddlZdd
lmZmZmZddlmZmZmZmZGdd
�d
e�ZGdd�de�ZdS)z#
Implements the bdist_msi command.
�N)�Command)�remove_tree)�get_python_version)�
StrictVersion)�DistutilsOptionError)�get_platform)�log)�schema�sequence�text)�	Directory�Feature�Dialog�add_datac@sFeZdZdZdd�Zdd�Zddd	�Zddd�Zddd�Zdd�Z	dS)�PyDialogz�Dialog class with a fixed layout: controls at the top, then a ruler,
    then a list of buttons: back, next, cancel. Optionally a bitmap at the
    left.cOs>tj|f|��|jd}d|d}|�dd||jd�dS)zbDialog(database, name, x, y, w, h, attributes, title, first,
        default, cancel, bitmap=true)�$�iHZ
BottomLinerN)r�__init__�h�line�w)�self�args�kwZrulerZbmwidth�r�3/usr/lib64/python3.8/distutils/command/bdist_msi.pyrs
zPyDialog.__init__c
Cs|�ddddddd|�dS)	z,Set the title text of the dialog at the top.�Title��
�@�<�z{\VerdanaBold10}%sN)r)r�titlerrrr"#s�zPyDialog.title�Back�c
Cs,|r
d}nd}|�|d|jddd|||�S)z�Add a back button with a given title, the tab-next button,
        its name in the Control table, possibly initially disabled.

        Return the button, so that events can be associated�r$���8���
pushbuttonr�rr"�next�name�active�flagsrrr�back*sz
PyDialog.back�Cancelc
Cs,|r
d}nd}|�|d|jddd|||�S)z�Add a cancel button with a given title, the tab-next button,
        its name in the Control table, possibly initially disabled.

        Return the button, so that events can be associatedr%r$i0r'r(r)r*r,rrr�cancel5szPyDialog.cancel�Nextc
Cs,|r
d}nd}|�|d|jddd|||�S)z�Add a Next button with a given title, the tab-next button,
        its name in the Control table, possibly initially disabled.

        Return the button, so that events can be associatedr%r$��r'r(r)r*r,rrrr-@sz
PyDialog.nextc
Cs,|�|t|j|d�|jdddd||�S)z�Add a button with a given title, the tab-next button,
        its name in the Control table, giving its x position; the
        y-position is aligned with the other buttons.

        Return the button, so that events can be associated�r'r(r)r%)r+�intrr)rr.r"r-Zxposrrr�xbuttonKszPyDialog.xbuttonN)r#r$)r2r$)r4r$)
�__name__�
__module__�__qualname__�__doc__rr"r1r3r-r8rrrrrs



rc@s�eZdZdZdddde�fdddd	d
ddd
g
ZddddgZddddddddddddddd d!d"d#d$d%gZd&Zd'd(�Z	d)d*�Z
d+d,�Zd-d.�Zd/d0�Z
d1d2�Zd3d4�Zd5d6�Zd7S)8�	bdist_msiz7create a Microsoft Installer (.msi) binary distribution)z
bdist-dir=Nz1temporary directory for creating the distributionz
plat-name=�pz;platform name to embed in generated filenames (default: %s))�	keep-temp�kzPkeep the pseudo-installation tree around after creating the distribution archive)ztarget-version=Nz6require a specific python version on the target system)�no-target-compile�cz/do not compile .py to .pyc on the target system)�no-target-optimize�oz;do not compile .py to .pyo (optimized) on the target system)z	dist-dir=�dz-directory to put final built distributions in)�
skip-buildNz2skip rebuilding everything (for testing/debugging))zinstall-script=NzUbasename of installation script to be run after installation or before deinstallation)zpre-install-script=Nz{Fully qualified filename of a script to be run before any files are installed.  This script need not be in the distributionr?rArCrFz2.0z2.1z2.2z2.3z2.4z2.5z2.6z2.7z2.8z2.9z3.0z3.1z3.2z3.3z3.4z3.5z3.6z3.7z3.8z3.9�XcCsFd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
dS)Nr)�	bdist_dir�	plat_name�	keep_tempZno_target_compileZno_target_optimize�target_version�dist_dir�
skip_build�install_script�pre_install_script�versions)rrrr�initialize_options}szbdist_msi.initialize_optionscCs�|�dd�|jdkr2|�d�j}tj�|d�|_t�}|jsN|j	�
�rN||_|jr�|jg|_|js�|j	�
�r�|j|kr�t
d|f��nt|j�|_|�ddd�|jr�t
d��|jr�|j	jD]}|jtj�|�kr�q�q�t
d|j��d|_dS)	NZbdist)rMrMZmsizMtarget version can only be %s, or the '--skip-build' option must be specified)rLrL)rIrIz5the pre-install-script feature is not yet implementedz(install_script '%s' not found in scripts)Zset_undefined_optionsrH�get_finalized_command�
bdist_base�os�path�joinrrK�distribution�has_ext_modulesrPrMr�list�all_versionsrOrNZscripts�basename�install_script_key)rrSZ
short_versionZscriptrrr�finalize_options�sH

�������zbdist_msi.finalize_optionscCsz|js|�d�|jddd�}|j|_|j|_d|_|�d�}d|_d|_|j�	�r�|j
}|spdtjdd�}d	|j
|f}|�d�}tj�|jd
|�|_t�d|j�|��tj�dtj�|jd��|��tjd=|�|j�|j��}|�|�}tj�|�}tj�|��r"t�|�|jj }|j!}	|	�s<|j"}	|	�sFd
}	|�#�}
dt$|
�j%}|j��}|j
�r~d|j
|f}nd|}t&�'|t(|t&�)�||	�|_*t&�+|j*t,�d|
fg}
|j-�p�|j.}|�r�|
�/d|f�|j0�r�|
�/d|j0f�|
�rt1|j*d|
�|�2�|�3�|�4�|�5�|j*�6�t7|jd��r^d|j
�pJd|f}|jj8�/|�|j9�svt:|j|j;d�dS)N�build�installr$)Zreinit_subcommandsr�install_libz%d.%d�z.%s-%s�libzinstalling to %sZPURELIBZUNKNOWNz%d.%d.%dzPython %s %sz	Python %sZDistVersionZ
ARPCONTACTZARPURLINFOABOUT�Property�
dist_filesr=�any)�dry_run)<rMZrun_commandZreinitialize_commandrH�prefixZwarn_dir�compile�optimizerWrXrK�sys�version_inforIrRrTrUrVZ
build_baseZ	build_libr�infoZensure_finalized�insert�runZmkpathrL�get_fullname�get_installer_filename�abspath�exists�unlink�metadata�authorZ
maintainerZget_versionr�version�msilibZ
init_databaser	Zgen_uuid�dbZ
add_tablesr
Zauthor_emailZmaintainer_email�appendZurlr�add_find_python�	add_files�add_scripts�add_ui�Commit�hasattrrdrJrrf)rr_r`rKZplat_specifierr^�fullname�installer_namertrurvZsversionZproduct_nameZpropsZemail�tuprrrrn�s�




�



�

z
bdist_msi.runc
Cs|j}t�d�}tj�|j�}t||d|dd�}t|ddddddd�}||d	fg}|j	|j
gD]t}d|}d|}	}
d}||j
kr�d
}d}
nd|}d}
t||	||d|
|d�}t||||||
�}|�|||f�q`|��i}|D�]\}}}|g}|�r�|�
�}t�|j�D]�}tj�|j|�}tj�|��rld
|�|�|f}||}
t|||||
|�}|�|�n�|j�s�|�|j|d�||k�r�|�|�}||<||jk�r�|j�r�td|��d||_n*||}t|jd|||j|d|jfg��qq�|��q�|�|�dS)NZ	distfiles�	TARGETDIRZ	SourceDir�PythonZ
Everythingrr$)Z	directory�zPython from another locationrazPython %s from registryz%s|%szMultiple files with name %sz[#%s]Z
DuplicateFile)rxrwZCABrTrUrqrHrr
rP�
other_versionryr~�pop�listdirZabsoluterV�isdirZ
make_shortZ	componentZstart_componentZlogicalZadd_filerNr\rrZcommit)rrxZcabZrootdir�root�f�itemsrv�targetr.�defaultZdescr"�level�dir�seenZfeatureZtodo�fileZafileZshortZnewdir�keyrrrr{
sf

�

��

zbdist_msi.add_filescCs|d}|jD�]j}d|}d|}d|}d|}d|}d|}d|}	d	|}
d
|}d|}tjrld}
nd
}
t|jd|d
|d|
f|d|d|
fg�t|jd||f||fg�t|jd|d|d|df|	d|d|df|
d|d|dfg�t|jd|||f|	||df|
d|d
fg�t|jd|||f|	||df|
d|d
fg�t|jdd|dd|fg�|d7}q
dS)asAdds code to the installer to compute the location of Python.

        Properties PYTHON.MACHINE.X.Y and PYTHON.USER.X.Y will be set from the
        registry for each version of Python.

        Properties TARGETDIRX.Y will be set from PYTHON.USER.X.Y if defined,
        else from PYTHON.MACHINE.X.Y.

        Properties PYTHONX.Y will be set to TARGETDIRX.Y\python.exei�z)SOFTWARE\Python\PythonCore\%s\InstallPathzpython.machine.zpython.user.zPYTHON.MACHINE.zPYTHON.USER.ZPythonFromMachineZPythonFromUserZ	PythonExer��PYTHON�raZ
RegLocatorNr$Z	AppSearch�CustomActioni3�[�]z]\python.exe�InstallExecuteSequence�InstallUISequenceZ	Conditionr�rz
NOT TARGETDIR�)rPrwZWin64rrx)r�start�verZinstall_pathZmachine_regZuser_regZmachine_propZ	user_propZmachine_actionZuser_actionZ
exe_actionZtarget_dir_prop�exe_propZTyperrrrzCs`�����������zbdist_msi.add_find_pythonc
Cs|jrjd}|j|jgD]P}d|}d|}t|jd|d||jfg�t|jd|d||fg�|d7}q|jr�tj�	|j
d	�}t|d
��4}|�d�t|j��}|�|�
��W5QRXW5QRXt|jdd
t�|�fg�t|jddg�t|jddg�dS)Ni�zinstall_script.r�r��2r�z&Python%s=3r$zpreinstall.batrzrem ="""
%1 %0
exit
"""
�Binary�
PreInstall)r�rar�N)r�z
NOT Installedi�)rNrPr�rrxr\rOrTrUrVrH�open�write�readrwr�)rr�r�Zinstall_actionr�Zscriptfnr�Zfinrrrr|ys6��
	
"���zbdist_msi.add_scriptscCs�
|j}d}}d}d}d}d}d}d}	t|dd	d
ddd
dg�t|dddddg�t|ddddddg�t|dtj�t|dtj�t|d||||||ddd�}
|
�d�|
jddd d!�|
jd"d#d d!�|
�d$d%d&d'd(d)d*�|
�d+d%d,d'd-d)d.�|
j	dd"dd/�}|�
d0d1�t|d2||||||ddd�}|�d3�|jddd d!�|jd"d#d d!�|�d$d%d&d'd(d)d4�|�d+d%d,d'd-d)d.�|j	dd"dd/�}|�
d0d1�t|d5||||||ddd�}
|
�d6�|
jddd d!�|
jd"d#d d!�|
�d7d%d8d'd-d)d.�|
j	dd"dd/�}|�
d0d9�t|d:||||d;|d<d<d<d=d>�}|�d?d%d@dAd%d)dB�|�d7d-dCdDd-d)dE�|�dFd-dGdHdddI�|�dJdKd-dLdHdMdNdOddd�|jd1dPd1d/�}|�
d0d1�|j	dPd<dPd/�}|�
d0dP�|jd<d1d<d/�}|�
d0d<�t|dQddRdHdSdT|dUdd�}|�dUddVdDdWddX�|�
dYdZd[d\d]dd^d��
d0d_�|�
d`dad[d\d]ddbd��
d0dc�|�
ddd d[d\d]dded��
d0df�|�
dgdhd[d\d]dd"d��
d0di�|�
djd\d[d\d]ddPd��
d0dk�|�
dldmd[d\d]ddnd��
d0do�|�
dpdqd[d\d]dd<d��
d0dr�t|dsddRdtdud|d^d^d^�}|�dFdWd%dvdwddx�|�
dbd[dydzd{ddbd^�}|�
d0d1�|�
d^d|dydzd{dd^db�}|�
d0d9�t|d}ddRdtdu||d9d9d9�}|�dFdWd%dvdwdd~�|�
d9ddydzd{dd9d�}|�
d0d1�t|d�||||||d"d"d"�}|�d7d%d&d'd�d)d��|�d��|�dd%d�d'd-d)d��}|�ddF�|�d�d%d�d'dwd)d�}|�d�dF�|jd#dd d!�|j	d�dd d!�|�d"d�}|�
d�ds�t|d�||||||d�d�d"�}|�d��|�d�d%dwdd-dd�|j���|jddd d!�|�	d�d"�}d}|j
d�d�|d��|j|jgD](}|d7}|j
d�d�|d�||d���q
|j
d�d}|dd��|j
d0d9|d�d��|�d"d��}|�
d�ds�|�d�d�d%d�ddZdd�dd�d�}|�
d�d��|j}d�|}d�|}|�d�d%dAdd%dd��}|�d�|�|�d�|�|�d�|�|�d�|�|�d�d�d%d�dd�dd�|dd�d�}|�d�|�|�d�|�|�d�|�|�d�|�t|d�||||||d�d�d�d=d>�}|�d?d%d@dAd%d)d��|�d7d-d-dDd-d)d��|�dFd-d�dHd�dd��|�d�d�d-d�dHd�d�dd�dd�|�d�dndd���
d0d9�t|d�||||||d�d�d"�}|�d��|�d�d%d�dtddd�dXd��	}|�d�d d�d�d-d��|�d�d d�d�d-d��|jd#dd d!�|�	d�d"�}|�
d�d�d�d�|j
d0d9d�d��|�d"d��}|�
d�ds�t|d�||||||d"d"d"d=d>�}|�d?d-d%dAd%d)d��|�dFd�d�ddwddġ|�d�d�d�d�d-ddơ|�dd&d�|d&d-dd��}|�ddF�|�d�d�d�dZddRd�dd�dd�}|�d�dˡ|jdd�d=d!�|j	d�d"d=d!�|�d"d#��
d�ds�t|d�||||||d�d�d"�}|�d͡|�d�d%d�dHdhddС|�d�d%d�dHd�dd�dXd��	}|�d�d d�dAd{d֡|�d�d d�dAd{d١|jddd=d!�|�	dd"�}|�
d�d�d�d��|�
d�d�d�d@�|�
d�d�d�dN�|�
d�d�d�d�|�
d�d�d�d�|�
d�d�d�d�|�
d�d�d�d�|�
d�d�d�d�|�
d0d9d�d-�|�d"dѡ�
d�ds�dS)�Nr�iri,z[ProductName] Setupr%r$� rc)Z
DefaultUIFont�DlgFont8)ZErrorDialog�ErrorDlg)Z	Progress1ZInstall)Z	Progress2Zinstalls)�MaintenanceForm_Action�Repair)�
WhichUsers�ALLZ	TextStyle)r��Tahoma�	Nr)ZDlgFontBold8r��Nr$)Z
VerdanaBold10�VerdanarNr$)ZVerdanaRed9r�r��rr�)�
PrepareDlgz(Not Privileged or Windows9x or Installed�)�
WhichUsersDlgz.Privileged and not Windows9x and not Installed�)�SelectFeaturesDlgz
Not Installedi�)�MaintenanceTypeDlgz,Installed AND NOT RESUME AND NOT Preselectedi�)�ProgressDlgNi�
ActionText�UITextZ
FatalErrorZFinishz)[ProductName] Installer ended prematurelyz< Backr)r/r2r#ZDescription1r�Fr�Pr!z�[ProductName] setup ended prematurely because of an error.  Your system has not been modified.  To install this program at a later time, please run the installation again.ZDescription2��z.Click the Finish button to exit the Installer.)r.Z	EndDialogZExitZUserExitz'[ProductName] Installer was interruptedz�[ProductName] setup was interrupted.  Your system has not been modified.  To install this program at a later time, please run the installation again.Z
ExitDialogz&Completing the [ProductName] InstallerZDescription��ZReturnZ
FilesInUse�ZRetryF)Zbitmapr���z{\DlgFontBold8}Files in Use�iz8Some files that need to be updated are currently in use.ZText�7iJz�The following applications are using files that need to be updated by this setup. Close these applications and then click Retry to continue the installation or Cancel to exit it.ZListZListBox�k��ZFileInUseProcess�Ignorer�r�eiZ	ErrorTextr��0r��N�x�H�Q�ZNoZErrorNo�Y��ZYesZErrorYes�AZAbortZ
ErrorAbort�C�*ZErrorCancel�IZErrorIgnore�O�ZOkZErrorOk�R��Z
ErrorRetryZ	CancelDlgi�U���z;Are you sure you want to cancel [ProductName] installation?�9r(r)�ZWaitForCostingDlgzRPlease wait while the installer finishes determining your disk space requirements.�fr��(zOPlease wait while the Installer prepares to guide you through the installation.z&Welcome to the [ProductName] Installer�nzPondering...Z
ActionData�r4ZSpawnDialogr�zSelect Python InstallationsZHintz9Select the Python locations where %s should be installed.zNext >z[TARGETDIR]z[SourceDir])Zorderingz
[TARGETDIR%s]z FEATURE_SELECTED AND &Python%s=3ZSpawnWaitDialograZFeaturesZ
SelectionTreer ZFEATUREZPathEditz[FEATURE_SELECTED]�1z!FEATURE_SELECTED AND &Python%s<>3ZOtherz$Provide an alternate Python locationZEnableZShowZDisableZHide���r�ZDiskCostDlgZOKz&{\DlgFontBold8}Disk Space RequirementszFThe disk space required for the installation of the selected features.�5aThe highlighted volumes (if any) do not have enough disk space available for the currently selected features.  You can either remove some files from the highlighted volumes, or choose to install less features onto local drive(s), or select different destination drive(s).Z
VolumeListZVolumeCostList�d�iz{120}{70}{70}{70}{70}g�?r�ZAdminInstallzGSelect whether to install [ProductName] for all users of this computer.r�r��zInstall for all usersZJUSTME�zInstall just for mez
[ALLUSERS]zWhichUsers="ALL"r�z({\DlgFontBold8}[Progress1] [ProductName]�#�AzYPlease wait while the Installer [Progress2] [ProductName]. This may take several minutes.ZStatusLabelzStatus:ZProgressBariz
Progress doneZSetProgressZProgressr�z)Welcome to the [ProductName] Setup WizardZBodyText�?z:Select whether you want to repair or remove [ProductName].ZRepairRadioGroup�lr�r�r�z&Repair [ProductName]ZRemoverzRe&move [ProductName]z[REINSTALL]zMaintenanceForm_Action="Repair"z[Progress1]Z	Repairingz[Progress2]ZrepairsZ	Reinstallr�z[REMOVE]zMaintenanceForm_Action="Remove"�ZRemoving�Zremoves�
�z MaintenanceForm_Action<>"Change")rxrrr�r�rr"r1r3r-ZeventZcontrolrr+�mappingrWrorPr�Z	conditionr8Z
radiogroup�add)rrx�x�yrrr"ZmodalZmodelessZtrack_disk_spaceZfatalrBZ	user_exitZexit_dialogZinuse�errorr3ZcostingZprepZseldlg�orderrvr�Zinstall_other_condZdont_install_other_condZcostZ
whichusers�gZprogressZmaintrrrr}�sv��
��	��
�
���
���
�������       ������
�
���
��������
�
������
��zbdist_msi.add_uicCs<|jrd||j|jf}nd||jf}tj�|j|�}|S)Nz%s.%s-py%s.msiz	%s.%s.msi)rKrIrTrUrVrL)rr�Z	base_namer�rrrrp�s�z bdist_msi.get_installer_filenameN)r9r:r;ZdescriptionrZuser_optionsZboolean_optionsrZr�rQr]rnr{rzr|r}rprrrrr=Ss^����
�
([66&@r=)r<rjrTZdistutils.corerZdistutils.dir_utilrZdistutils.sysconfigrZdistutils.versionrZdistutils.errorsrZdistutils.utilrZ	distutilsrrwr	r
rrr
rrrr=rrrr�<module>s>distutils/command/__pycache__/sdist.cpython-38.pyc000064400000034266151153537440016217 0ustar00U

e5d=J�@s�dZddlZddlZddlmZddlmZddlmZddlm	Z	ddlm
Z
ddlmZdd	lm
Z
dd
lmZddlmZddlmZdd
lmZmZdd�ZGdd�de�ZdS)zadistutils.command.sdist

Implements the Distutils 'sdist' command (create a source distribution).�N)�glob)�warn)�Command)�dir_util)�	file_util)�archive_util)�TextFile)�FileList)�log)�convert_path)�DistutilsTemplateError�DistutilsOptionErrorcCs`ddlm}ddlm}g}|��D] }|�d|d||df�q$|��||��d�dS)zoPrint all possible values for the 'formats' option (used by
    the "--help-formats" command-line option).
    r)�FancyGetopt)�ARCHIVE_FORMATS�formats=N�z.List of available source distribution formats:)Zdistutils.fancy_getoptrZdistutils.archive_utilr�keys�append�sortZ
print_help)rr�formats�format�r�//usr/lib64/python3.8/distutils/command/sdist.py�show_formatss
��rc@s"eZdZdZdd�Zdddddd	d
ddd
ddddgZddddddgZdddefgZddd�Z	defgZ
dZdd�Zd d!�Z
d"d#�Zd$d%�Zd&d'�Zd(d)�Zed*d+��Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Zd<d=�Zd>d?�Zd@dA�ZdBdC�ZdDdE�Z dFdG�Z!dHdI�Z"dS)J�sdistz6create a source distribution (tarball, zip file, etc.)cCs|jS)zYCallable used for the check sub-command.

        Placed here so user_options can view it)�metadata_check��selfrrr�checking_metadata(szsdist.checking_metadata)z	template=�tz5name of manifest template file [default: MANIFEST.in])z	manifest=�mz)name of manifest file [default: MANIFEST])�use-defaultsNzRinclude the default file set in the manifest [default; disable with --no-defaults])�no-defaultsNz"don't include the default file set)�pruneNz�specifically exclude files/directories that should not be distributed (build tree, RCS/CVS dirs, etc.) [default; disable with --no-prune])�no-pruneNz$don't automatically exclude anything)�
manifest-only�ozEjust regenerate the manifest and then stop (implies --force-manifest))�force-manifest�fzkforcibly regenerate the manifest and carry on as usual. Deprecated: now the manifest is always regenerated.)rNz6formats for source distribution (comma-separated list))�	keep-temp�kz@keep the distribution tree around after creating archive file(s))z	dist-dir=�dzFdirectory to put the source distribution archive(s) in [default: dist])�metadata-checkNz[Ensure that all required elements of meta-data are supplied. Warn if any missing. [default])zowner=�uz@Owner name used when creating a tar file [default: current user])zgroup=�gzAGroup name used when creating a tar file [default: current group]r!r#r%r'r)r,zhelp-formatsNz#list available distribution formats)r"r$�check)ZREADMEz
README.txtz
README.rstcCsTd|_d|_d|_d|_d|_d|_dg|_d|_d|_d|_	d|_
d|_d|_dS)N�rZgztar)
�template�manifest�use_defaultsr#�
manifest_onlyZforce_manifestr�	keep_temp�dist_dir�
archive_filesr�owner�grouprrrr�initialize_optionseszsdist.initialize_optionscCsZ|jdkrd|_|jdkr d|_|�d�t�|j�}|rFtd|��|jdkrVd|_dS)NZMANIFESTzMANIFEST.inrzunknown archive format '%s'Zdist)r2r1Zensure_string_listrZcheck_archive_formatsrr
r6)rZ
bad_formatrrr�finalize_options|s


�
zsdist.finalize_optionscCs>t�|_|��D]}|�|�q|��|jr2dS|��dS�N)r	�filelistZget_sub_commandsZrun_command�
get_file_listr4�make_distribution)rZcmd_namerrr�run�sz	sdist.runcCs*tdt�|j�d�}|��|��dS)zDeprecated API.zadistutils.command.sdist.check_metadata is deprecated,               use the check command insteadr/N)r�PendingDeprecationWarning�distributionZget_command_objZensure_finalizedr@)rr/rrr�check_metadata�s�zsdist.check_metadatacCs�tj�|j�}|s:|��r:|��|j��|j��dS|sN|�	d|j�|j�
�|jrf|��|rr|�
�|jr�|��|j��|j��|��dS)aCFigure out the list of files to include in the source
        distribution, and put it in 'self.filelist'.  This might involve
        reading the manifest template (and writing the manifest), or just
        reading the manifest, or just using the default file set -- it all
        depends on the user's options.
        Nz?manifest template '%s' does not exist (using default file list))�os�path�isfiler1�_manifest_is_not_generated�
read_manifestr=rZremove_duplicatesr�findallr3�add_defaults�
read_templater#�prune_file_list�write_manifest)rZtemplate_existsrrrr>�s(

�


zsdist.get_file_listcCs<|��|��|��|��|��|��|��dS)a9Add all the default files to self.filelist:
          - README or README.txt
          - setup.py
          - test/test*.py
          - all pure Python modules mentioned in setup script
          - all files pointed by package_data (build_py)
          - all files defined in data_files.
          - all files defined as scripts.
          - all C sources listed as part of extensions or C libraries
            in the setup script (doesn't catch C headers!)
        Warns if (README or README.txt) or setup.py are missing; everything
        else is optional.
        N)�_add_defaults_standards�_add_defaults_optional�_add_defaults_python�_add_defaults_data_files�_add_defaults_ext�_add_defaults_c_libs�_add_defaults_scriptsrrrrrJ�szsdist.add_defaultscCs:tj�|�sdStj�|�}tj�|�\}}|t�|�kS)z�
        Case-sensitive path existence check

        >>> sdist._cs_path_exists(__file__)
        True
        >>> sdist._cs_path_exists(__file__.upper())
        False
        F)rDrE�exists�abspath�split�listdir)�fspathrVZ	directory�filenamerrr�_cs_path_exists�s

zsdist._cs_path_existscCs�|j|jjg}|D]~}t|t�rj|}d}|D]"}|�|�r,d}|j�|�qPq,|s�|�dd�	|��q|�|�r�|j�|�q|�d|�qdS)NFTz,standard file not found: should have one of z, zstandard file '%s' not found)
�READMESrBZscript_name�
isinstance�tupler[r=rr�join)rZ	standards�fnZaltsZgot_itrrrrN�s"

�
zsdist._add_defaults_standardscCs4ddg}|D]"}ttjjt|��}|j�|�qdS)Nz
test/test*.pyz	setup.cfg)�filterrDrErFrr=�extend)rZoptional�pattern�filesrrrrOszsdist._add_defaults_optionalcCs\|�d�}|j��r$|j�|���|jD],\}}}}|D]}|j�tj	�
||��q:q*dS)N�build_py)�get_finalized_commandrBZhas_pure_modulesr=rb�get_source_files�
data_filesrrDrEr_)rreZpkgZsrc_dirZ	build_dir�	filenamesrZrrrrPs

zsdist._add_defaults_pythoncCsz|j��rv|jjD]b}t|t�rBt|�}tj�|�rt|j	�
|�q|\}}|D]$}t|�}tj�|�rN|j	�
|�qNqdSr<)rBZhas_data_filesrhr]�strrrDrErFr=r)r�item�dirnamerir(rrrrQ$s

zsdist._add_defaults_data_filescCs(|j��r$|�d�}|j�|���dS)N�	build_ext)rBZhas_ext_modulesrfr=rbrg)rrmrrrrR5s

zsdist._add_defaults_extcCs(|j��r$|�d�}|j�|���dS)N�
build_clib)rBZhas_c_librariesrfr=rbrg)rrnrrrrS:s

zsdist._add_defaults_c_libscCs(|j��r$|�d�}|j�|���dS)N�
build_scripts)rBZhas_scriptsrfr=rbrg)rrorrrrT?s

zsdist._add_defaults_scriptsc
Cs�t�d|j�t|jddddddd�}zh|��}|dkr:q�z|j�|�Wq(tt	fk
r�}z|�
d|j|j|f�W5d}~XYq(Xq(W5|��XdS)z�Read and parse manifest template file named by self.template.

        (usually "MANIFEST.in") The parsing and processing is done by
        'self.filelist', which updates itself accordingly.
        zreading manifest template '%s'r0)Zstrip_commentsZskip_blanksZ
join_linesZ	lstrip_wsZ	rstrip_wsZ
collapse_joinNz%s, line %d: %s)
r
�infor1r�close�readliner=Zprocess_template_liner�
ValueErrorrrZZcurrent_line)rr1�line�msgrrrrKDs&
�
� zsdist.read_templatecCs�|�d�}|j��}|jjd|jd�|jjd|d�tjdkrFd}nd}ddd	d
ddd
g}d|d�|�|f}|jj|dd�dS)avPrune off branches that might slip into the file list as created
        by 'read_template()', but really don't belong there:
          * the build tree (typically "build")
          * the release tree itself (only an issue if we ran "sdist"
            previously with --keep-temp, or it aborted)
          * any RCS, CVS, .svn, .hg, .git, .bzr, _darcs directories
        �buildN)�prefixZwin32z/|\\�/ZRCSZCVSz\.svnz\.hgz\.gitz\.bzrZ_darcsz(^|%s)(%s)(%s).*�|r0)Zis_regex)	rfrB�get_fullnamer=Zexclude_patternZ
build_base�sys�platformr_)rrv�base_dirZsepsZvcs_dirsZvcs_ptrnrrrrLas


�zsdist.prune_file_listcCsX|��rt�d|j�dS|jjdd�}|�dd�|�tj	|j|fd|j�dS)z�Write the file list in 'self.filelist' (presumably as filled in
        by 'add_defaults()' and 'read_template()') to the manifest file
        named by 'self.manifest'.
        z5not writing to manually maintained manifest file '%s'Nrz*# file GENERATED by distutils, do NOT editzwriting manifest file '%s')
rGr
rpr2r=rd�insertZexecuterZ
write_file)rZcontentrrrrMys��zsdist.write_manifestcCs<tj�|j�sdSt|j�}z|��}W5|��X|dkS)NFz+# file GENERATED by distutils, do NOT edit
)rDrErFr2�openrqrr)r�fpZ
first_linerrrrG�s

z sdist._manifest_is_not_generatedc	CsVt�d|j�t|j��4}|D](}|��}|�d�s|s:q|j�|�qW5QRXdS)z�Read the manifest file (named by 'self.manifest') and use it to
        fill in 'self.filelist', the list of files to include in the source
        distribution.
        zreading manifest file '%s'�#N)r
rpr2r�strip�
startswithr=r)rr2rtrrrrH�szsdist.read_manifestcCs�|�|�tj|||jd�ttd�r4d}d|}nd}d|}|sPt�d�n
t�|�|D]<}tj	�
|�s|t�d|�q^tj	�||�}|j|||d	�q^|j
j�|�dS)
a�Create the directory tree that will become the source
        distribution archive.  All directories implied by the filenames in
        'files' are created under 'base_dir', and then we hard link or copy
        (if hard linking is unavailable) those files into place.
        Essentially, this duplicates the developer's source tree, but in a
        directory named after the distribution, containing only the files
        to be distributed.
        ��dry_run�linkZhardzmaking hard links in %s...Nzcopying files to %s...z)no files to distribute -- empty manifest?z#'%s' not a regular file -- skipping)r�)ZmkpathrZcreate_treer��hasattrrDr
rrprErFr_Z	copy_filerBZmetadataZwrite_pkg_info)rr}rdr�ru�file�destrrr�make_release_tree�s 
	


zsdist.make_release_treecCs�|j��}tj�|j|�}|�||jj�g}d|j	krT|j	�
|j	�|j	�d���|j	D]:}|j
||||j|jd�}|�
|�|jj�
dd|f�qZ||_|js�tj||jd�dS)a�Create the source distribution(s).  First, we create the release
        tree with 'make_release_tree()'; then, we create all required
        archive files (according to 'self.formats') from the release tree.
        Finally, we clean up by blowing away the release tree (unless
        'self.keep_temp' is true).  The list of archive files created is
        stored so it can be retrieved later by 'get_archive_files()'.
        Ztar)r}r8r9r�r�N)rBrzrDrEr_r6r�r=rdrr�pop�indexZmake_archiver8r9Z
dist_filesr7r5rZremove_treer�)rr}Z	base_namer7Zfmtr�rrrr?�s 




�
zsdist.make_distributioncCs|jS)zzReturn the list of archive files created when the command
        was run, or None if the command hasn't run yet.
        )r7rrrr�get_archive_files�szsdist.get_archive_files)#�__name__�
__module__�__qualname__ZdescriptionrZuser_optionsZboolean_optionsrZhelp_optionsZnegative_optZsub_commandsr\r:r;r@rCr>rJ�staticmethodr[rNrOrPrQrRrSrTrKrLrMrGrHr�r?r�rrrrr$sp�'����
(
*r)�__doc__rDr{r�warningsrZdistutils.corerZ	distutilsrrrZdistutils.text_filerZdistutils.filelistr	r
Zdistutils.utilrZdistutils.errorsrr
rrrrrr�<module>sdistutils/command/__pycache__/bdist_rpm.cpython-38.pyc000064400000030216151153537440017043 0ustar00U

e5dIT�@s�dZddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZddlTddl
mZdd	lmZGd
d�de�ZdS)zwdistutils.command.bdist_rpm

Implements the Distutils 'bdist_rpm' command (create RPM source and binary
distributions).�N)�Command)�DEBUG)�get_platform)�
write_file)�*)�get_python_version)�logc)@s�eZdZdZdddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*g)Zd+d,d-d.d/gZd+d,d-d0�Zd1d2�Zd3d4�Zd5d6�Z	d7d8�Z
d9d:�Zd;d<�Zd=d>�Z
d?S)@�	bdist_rpmzcreate an RPM distribution)zbdist-base=Nz/base directory for creating built distributions)z	rpm-base=Nzdbase directory for creating RPMs (defaults to "rpm" under --bdist-base; must be specified for RPM 2))z	dist-dir=�dzDdirectory to put final RPM files in (and .spec files if --spec-only))zpython=NzMpath to Python interpreter to hard-code in the .spec file (default: "python"))z
fix-pythonNzLhard-code the exact path to the current Python interpreter in the .spec file)z	spec-onlyNzonly regenerate spec file)zsource-onlyNzonly generate source RPM)zbinary-onlyNzonly generate binary RPM)z	use-bzip2Nz7use bzip2 instead of gzip to create source distribution)zdistribution-name=Nzgname of the (Linux) distribution to which this RPM applies (*not* the name of the module distribution!))zgroup=Nz9package classification [default: "Development/Libraries"])zrelease=NzRPM release number)zserial=NzRPM serial number)zvendor=NzaRPM "vendor" (eg. "Joe Blow <joe@example.com>") [default: maintainer or author from setup script])z	packager=NzBRPM packager (eg. "Jane Doe <jane@example.net>") [default: vendor])z
doc-files=Nz6list of documentation files (space or comma-separated))z
changelog=Nz
RPM changelog)zicon=Nzname of icon file)z	provides=Nz%capabilities provided by this package)z	requires=Nz%capabilities required by this package)z
conflicts=Nz-capabilities which conflict with this package)zbuild-requires=Nz+capabilities required to build this package)z
obsoletes=Nz*capabilities made obsolete by this package)�
no-autoreqNz+do not automatically calculate dependencies)�	keep-temp�kz"don't clean up RPM build directory)�no-keep-tempNz&clean up RPM build directory [default])�use-rpm-opt-flagsNz8compile with RPM_OPT_FLAGS when building from source RPM)�no-rpm-opt-flagsNz&do not pass any RPM CFLAGS to compiler)�	rpm3-modeNz"RPM 3 compatibility mode (default))�	rpm2-modeNzRPM 2 compatibility mode)zprep-script=Nz3Specify a script for the PREP phase of RPM building)z
build-script=Nz4Specify a script for the BUILD phase of RPM building)zpre-install=Nz:Specify a script for the pre-INSTALL phase of RPM building)zinstall-script=Nz6Specify a script for the INSTALL phase of RPM building)z
post-install=Nz;Specify a script for the post-INSTALL phase of RPM building)zpre-uninstall=Nz<Specify a script for the pre-UNINSTALL phase of RPM building)zpost-uninstall=Nz=Specify a script for the post-UNINSTALL phase of RPM building)z
clean-script=Nz4Specify a script for the CLEAN phase of RPM building)zverify-script=Nz6Specify a script for the VERIFY phase of the RPM build)zforce-arch=Nz0Force an architecture onto the RPM build process)�quiet�qz3Run the INSTALL phase of RPM building in quiet moderrrrr)rrrcCs�d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_ d|_!d|_"d|_#d|_$d|_%d|_&dS)Nr�)'�
bdist_base�rpm_base�dist_dir�python�
fix_python�	spec_only�binary_only�source_only�	use_bzip2�distribution_name�group�release�serial�vendor�packager�	doc_files�	changelog�icon�prep_script�build_script�install_script�clean_script�
verify_script�pre_install�post_install�
pre_uninstall�post_uninstall�prep�provides�requires�	conflicts�build_requires�	obsoletes�	keep_temp�use_rpm_opt_flags�	rpm3_mode�
no_autoreq�
force_archr��self�r>�3/usr/lib64/python3.8/distutils/command/bdist_rpm.py�initialize_options�sNzbdist_rpm.initialize_optionscCs�|�dd�|jdkr6|js$td��tj�|jd�|_|jdkrX|j	rPt
j|_qfd|_n|j	rftd��tjdkr~t
dtj��|jr�|jr�td	��|j��s�d
|_|�dd�|��dS)NZbdist)rrz)you must specify --rpm-base in RPM 2 mode�rpmZpython3z8--python and --fix-python are mutually exclusive options�posixz9don't know how to create RPM distributions on platform %sz6cannot supply both '--source-only' and '--binary-only'r)rr)Zset_undefined_optionsrr9ZDistutilsOptionError�os�path�joinrrr�sys�
executable�nameZDistutilsPlatformErrorrr�distribution�has_ext_modulesr8�finalize_package_datar<r>r>r?�finalize_options�s6
�

�
��
zbdist_rpm.finalize_optionscCsT|�dd�|�dd|j��|j��f�|�d�|�d�t|jt�rxdD]&}tj	�
|�rP||jkrP|j�|�qP|�dd	�|�d
�|�d�|�d�|�|j
�|_
|�d
�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�dS)Nr zDevelopment/Librariesr#z%s <%s>r$r%)ZREADMEz
README.txtr!�1r"rr&r'r(r)r*r+r,r-r.r/r0r2r3r4r5r6r;)Z
ensure_stringrIZget_contactZget_contact_emailZensure_string_list�
isinstancer%�listrCrD�exists�append�_format_changelogr&Zensure_filename)r=Zreadmer>r>r?rK�sB
��



















zbdist_rpm.finalize_package_datacCs�tr<td�td|j�td|j�td|j�td|j�|jrT|j}|�|�n8i}dD]&}t	j
�|j|�||<|�||�q\|d}t	j
�|d|j
���}|�t||��fd	|�|jr�dS|j
jdd�}|�d
�}|jr�dg|_ndg|_|�d
�||j
_|��d
}|d}|�||�|j�rbt	j
�|j��rT|�|j|�ntd|j��t�d�dg}	|j�r�|	�d�n|j �r�|	�d�n
|	�d�|	�!dd|j"g�|j#�r�|	�!ddt	j
�$|j�g�|j%�s�|	�d�|j&�r|	�d�|	�|�d}
|
d}d|
d}d|||f}
t	�'|
�}z~g}d}|�)�}|�sV�q�|�*��+�}t,|�dk�stt-�|�|d �|dk�rD|d
}�qD|�(�}|�r�t.d!t/|
���W5|�(�X|�0|	�|j1�s�|j
�2��r�t3�}nd"}|j �sLt	j
�|d#|�}t	j
�|��st-�|�4||j�t	j
�|j|�}|j
j�d$||f�|j�s�|D]`}t	j
�|d%|�}t	j
�|��rX|�4||j�t	j
�|jt	j
�5|��}|j
j�d$||f��qXdS)&Nzbefore _get_package_data():zvendor =z
packager =zdoc_files =zchangelog =)�SOURCES�SPECSZBUILD�RPMS�SRPMSrTz%s.speczwriting '%s'�sdistZbztarZgztarrrSzicon file '%s' does not existz
building RPMsZrpmbuildz-bsz-bbz-baz--definez__python %sz
_topdir %sz--cleanz--quietz%{name}-%{version}-%{release}z.src.rpmz%{arch}/z.%{arch}.rpmz%rpm -q --qf '%s %s\n' --specfile '%s'�rzFailed to execute: %s�anyrVr	rU)6r�printr#r$r%r&rrZmkpathrCrDrErrI�get_nameZexecuter�_make_spec_fileZ
dist_filesZreinitialize_commandrZformatsZrun_commandZget_archive_filesZ	copy_filer'rPZDistutilsFileErrorr�inforrQr�extendrr9�abspathr7r�popen�close�readline�strip�split�len�AssertionErrorZDistutilsExecError�reprZspawnZdry_runrJrZ	move_file�basename)r=Zspec_dirZrpm_dirr
Z	spec_pathZsaved_dist_filesrW�sourceZ
source_dirZrpm_cmdZ
nvr_stringZsrc_rpmZnon_src_rpmZq_cmd�outZbinary_rpmsZ
source_rpm�line�lZstatusZ	pyversionZsrpm�filenamerAr>r>r?�runs����


�

�


�



�

��z
bdist_rpm.runcCstj�|jtj�|��S)N)rCrDrErrh)r=rDr>r>r?�
_dist_path�szbdist_rpm._dist_pathc
CsJd|j��d|j���dd�d|j��d|j�dd�dd|j��g}t�d	�}d
�dd�|�	�D��}d
}d}|�||�}||kr�|�
d�|�
d|d
�|�dddg�|jr�|�
d�n
|�
d�|�d|j�
�d|jddg�|j�s|j���s&|�
d�n|�
d|j�dD]V}t||���}t|t��rb|�
d|d�|�f�n|dk	�r*|�
d||f��q*|j��d k�r�|�
d!|j���|j�r�|�
d"|j�|j�r�|�
d#d�|j��|j�r�|�
d$tj�|j��|j�r|�
d%�|�dd&|j��g�d'|jtj�tj d(�f}d)|}	|j!�rXd*|	}	d+|}
d,d-d.|	fd/d0|
fd1d2d3d4d5d6g	}|D]n\}}
}t||
�}|�s�|�r�|�dd7|g�|�r�t"|��}|�|�#��$d
��W5QRXn
|�
|��q�|�dd8d9g�|j%�r$|�
d:d�|j%��|j&�rF|�dd;g�|�|j&�|S)<ziGenerate the text of an RPM spec file and return it as a
        list of strings (one per line).
        z
%define name z%define version �-�_z%define unmangled_version z%define release �z	Summary: zrpm --eval %{__os_install_post}�
cSsg|]}d|���qS)z  %s \)rc)�.0rkr>r>r?�
<listcomp>�s�z-bdist_rpm._make_spec_file.<locals>.<listcomp>zbrp-python-bytecompile \
z%brp-python-bytecompile %{__python} \
z2# Workaround for http://bugs.python.org/issue14443z%define __os_install_post z
Name: %{name}zVersion: %{version}zRelease: %{release}z-Source0: %{name}-%{unmangled_version}.tar.bz2z,Source0: %{name}-%{unmangled_version}.tar.gzz	License: zGroup: z>BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildrootzPrefix: %{_prefix}zBuildArch: noarchz
BuildArch: %s)ZVendorZPackagerZProvidesZRequiresZ	ConflictsZ	Obsoletesz%s: %s� NZUNKNOWNzUrl: zDistribution: zBuildRequires: zIcon: z
AutoReq: 0z%descriptionz%s %srz%s buildzenv CFLAGS="$RPM_OPT_FLAGS" z>%s install -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES)r1r(z&%setup -n %{name}-%{unmangled_version}Zbuildr)Zinstallr*)Zcleanr+zrm -rf $RPM_BUILD_ROOT)Zverifyscriptr,N)Zprer-N)Zpostr.N)Zpreunr/N)Zpostunr0N�%z%files -f INSTALLED_FILESz%defattr(-,root,root)z%doc z
%changelog)'rIr[Zget_version�replacer!Zget_description�
subprocessZ	getoutputrE�
splitlinesrQr^rZget_licenser r;rJ�getattr�lowerrNrOZget_urlrr5r'rCrDrhr:Zget_long_descriptionrrF�argvr8�open�readrdr%r&)r=Z	spec_fileZvendor_hookZproblemZfixedZ
fixed_hookZfield�valZdef_setup_callZ	def_buildZinstall_cmdZscript_optionsZrpm_opt�attr�default�fr>r>r?r\�s��

�
	�
�

�
���
�
 ��zbdist_rpm._make_spec_filecCs||s|Sg}|���d�D]N}|��}|ddkrB|�d|g�q|ddkrZ|�|�q|�d|�q|dsx|d=|S)zKFormat the changelog correctly and convert it to a list of strings
        rsrrrrrpz  )rcrdr^rQ)r=r&Z
new_changelogrkr>r>r?rR1szbdist_rpm._format_changelogN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsZnegative_optr@rLrKrnror\rRr>r>r>r?r	sx�m��--*r	)�__doc__ryrFrCZdistutils.corerZdistutils.debugrZdistutils.utilrZdistutils.file_utilrZdistutils.errorsZdistutils.sysconfigrZ	distutilsrr	r>r>r>r?�<module>sdistutils/command/__pycache__/register.cpython-38.opt-2.pyc000064400000016030151153537440017642 0ustar00U

e5d�-�@s`ddlZddlZddlZddlZddlmZddlmZddl	Tddl
mZGdd�de�ZdS)�N)�warn)�
PyPIRCCommand)�*)�logc@s�eZdZdZejddgZejdddgZddd	�fgZd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zddd�ZdS) �registerz7register the distribution with the Python package index)�list-classifiersNz list the valid Trove classifiers)�strictNzBWill stop the registering if the meta-data are not fully compliant�verifyrr�checkcCsdS)NT���selfrr�2/usr/lib64/python3.8/distutils/command/register.py�<lambda>�zregister.<lambda>cCst�|�d|_d|_dS)Nr)r�initialize_options�list_classifiersrrrrrrs
zregister.initialize_optionscCs*t�|�d|jfdd�}||jjd<dS)Nr)r�)r�restructuredtextr
)r�finalize_optionsr�distributionZcommand_options)r
Z
check_optionsrrrr$s

�zregister.finalize_optionscCsT|��|��|��D]}|�|�q|jr8|��n|jrH|��n|��dS)N)	r�_set_configZget_sub_commandsZrun_commandZdry_run�verify_metadatar�classifiers�
send_metadata)r
Zcmd_namerrr�run+s

zregister.runcCs8tdt�|j�d�}|��|j|_d|_|��dS)Nzddistutils.command.register.check_metadata is deprecated,               use the check command insteadr
r)r�PendingDeprecationWarningrZget_command_objZensure_finalizedrrr)r
r
rrr�check_metadata:s�zregister.check_metadatacCsz|��}|ikr@|d|_|d|_|d|_|d|_d|_n6|jd|jfkr^td|j��|jdkrp|j|_d|_dS)	N�username�password�
repository�realmTZpypiz%s not found in .pypircF)Z_read_pypircrrr r!�
has_configZDEFAULT_REPOSITORY�
ValueError)r
ZconfigrrrrDs




zregister._set_configcCs*|jd}tj�|�}t�|�|��dS)Nz?:action=list_classifiers)r �urllib�requestZurlopenr�info�_read_pypi_response)r
ZurlZresponserrrrUs
zregister.classifierscCs&|�|�d��\}}t�d||�dS)Nr	�Server response (%s): %s)�post_to_server�build_post_datarr&)r
�code�resultrrrr\szregister.verify_metadatac
Cs�|jrd}|j}|j}nd}d}}d��}||krd|�dtj�t�}|sRd}q,||kr,td�q,|dk�rl|s|td�}qn|s�t	�	d�}q|t
j��}t
j
�|j�d	}|�|j|||�|�|�d
�|�\}}|�d||ftj�|dk�r�|j�r||j_nf|�d
tj�|�d|��tj�d}|��dk�rNtd�}|�s*d}�q*|��dk�r�|�||��nl|dk�r�ddi}	d|	d<|	d<|	d<d|	d<|	d�s�td�|	d<�q�|	d|	dk�r0|	d�s�t	�	d�|	d<�q�|	d�st	�	d�|	d<�q�|	d|	dk�r�d|	d<d|	d<td��q�|	d�sJtd�|	d<�q0|�|	�\}}|dk�rrt�d||�nt�d�t�d�nP|d k�r�dd!i}	d|	d<|	d�s�td"�|	d<�q�|�|	�\}}t�d||�dS)#N�1�x�z1 2 3 4z�We need to know who you are, so please choose either:
 1. use your existing login,
 2. register as a new user,
 3. have the server generate a new password for you (and email it to you), or
 4. quit
Your selection [default 1]: z&Please choose one of the four options!z
Username: z
Password: rZsubmitr(��zAI can store your PyPI login so future submissions will be faster.z (the login will be stored in %s)�XZynzSave your login (y/N)?�n�y�2�:action�user�namerZemailZconfirmz
 Confirm: z!Password and confirm don't match!z
   EMail: z"You will receive an email shortly.z7Follow the instructions in it to complete registration.�3Zpassword_resetzYour email address: )r"rr�split�announcer�INFO�input�print�getpassr$r%ZHTTPPasswordMgr�parseZurlparser Zadd_passwordr!r)r*rZ_get_rc_file�lowerZ
_store_pypircr&)
r
Zchoicerr�choices�authZhostr+r,�datarrrrcs��



��

���








zregister.send_metadatacCs�|jj}|d|��|��|��|��|��|��|��|�	�|�
�|��|��|�
�|��|��|��d�}|ds�|ds�|dr�d|d<|S)Nz1.0)r5�metadata_versionr7�versionZsummaryZ	home_pageZauthorZauthor_email�license�description�keywords�platformrZdownload_url�provides�requires�	obsoletesrJrKrLz1.1rD)rZmetadataZget_nameZget_versionZget_descriptionZget_urlZget_contactZget_contact_emailZget_licenceZget_long_descriptionZget_keywordsZ
get_platformsZget_classifiersZget_download_urlZget_providesZget_requiresZ
get_obsoletes)r
�action�metarCrrrr*�s,�zregister.build_post_dataNc
Cs�d|kr$|�d|d|jftj�d}d|}|d}t��}|��D]~\}}t|�tg�td�fkrn|g}|D]R}t|�}|�	|�|�	d|�|�	d�|�	|�|rr|d	d
krr|�	d�qrqH|�	|�|�	d�|�
��d�}d
|tt|��d�}	t
j�|j||	�}
t
j�t
jj|d��}d}z|�|
�}Wnxt
jjk
�r�}
z"|j�rd|
j��}|
j|
jf}W5d}
~
XYnJt
jjk
�r�}
zdt|
�f}W5d}
~
XYnX|j�r�|�|�}d}|j�r�d�d|df�}|�|tj�|S)Nr7zRegistering %s to %sz3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254z
--z--rz*
Content-Disposition: form-data; name="%s"z

����
�
zutf-8z/multipart/form-data; boundary=%s; charset=utf-8)zContent-typezContent-length)Zpassword_mgrr/i�)r0ZOKzK---------------------------------------------------------------------------)r:r rr;�io�StringIO�items�type�str�write�getvalue�encode�lenr$r%ZRequestZbuild_openerZHTTPBasicAuthHandler�open�errorZ	HTTPErrorZ
show_response�fp�readr+�msgZURLErrorr'�join)r
rCrB�boundaryZsep_boundaryZend_boundaryZbody�key�valueZheadersZreqZopenerr,�er_rrrr)�s^��





��

zregister.post_to_server)N)�__name__�
__module__�__qualname__rGrZuser_optionsZboolean_optionsZsub_commandsrrrrrrrrr*r)rrrrrs*��
zr)
r>rRZurllib.parser$Zurllib.request�warningsrZdistutils.corerZdistutils.errorsZ	distutilsrrrrrr�<module>sdistutils/command/__pycache__/register.cpython-38.opt-1.pyc000064400000020411151153537440017637 0ustar00U

e5d�-�@sddZddlZddlZddlZddlZddlmZddlm	Z	ddl
TddlmZGdd�de	�Z
dS)	zhdistutils.command.register

Implements the Distutils 'register' command (register with the repository).
�N)�warn)�
PyPIRCCommand)�*)�logc@s�eZdZdZejddgZejdddgZddd	�fgZd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zddd�ZdS) �registerz7register the distribution with the Python package index)�list-classifiersNz list the valid Trove classifiers)�strictNzBWill stop the registering if the meta-data are not fully compliant�verifyrr�checkcCsdS)NT���selfrr�2/usr/lib64/python3.8/distutils/command/register.py�<lambda>�zregister.<lambda>cCst�|�d|_d|_dS)Nr)r�initialize_options�list_classifiersrrrrrrs
zregister.initialize_optionscCs*t�|�d|jfdd�}||jjd<dS)Nr)r�)r�restructuredtextr
)r�finalize_optionsr�distributionZcommand_options)r
Z
check_optionsrrrr$s

�zregister.finalize_optionscCsT|��|��|��D]}|�|�q|jr8|��n|jrH|��n|��dS)N)	r�_set_configZget_sub_commandsZrun_commandZdry_run�verify_metadatar�classifiers�
send_metadata)r
Zcmd_namerrr�run+s

zregister.runcCs8tdt�|j�d�}|��|j|_d|_|��dS)zDeprecated API.zddistutils.command.register.check_metadata is deprecated,               use the check command insteadr
rN)r�PendingDeprecationWarningrZget_command_objZensure_finalizedrrr)r
r
rrr�check_metadata:s�zregister.check_metadatacCsz|��}|ikr@|d|_|d|_|d|_|d|_d|_n6|jd|jfkr^td|j��|jdkrp|j|_d|_d	S)
z: Reads the configuration file and set attributes.
        �username�password�
repository�realmTZpypiz%s not found in .pypircFN)Z_read_pypircrrr r!�
has_configZDEFAULT_REPOSITORY�
ValueError)r
ZconfigrrrrDs




zregister._set_configcCs*|jd}tj�|�}t�|�|��dS)z8 Fetch the list of classifiers from the server.
        z?:action=list_classifiersN)r �urllib�requestZurlopenr�info�_read_pypi_response)r
ZurlZresponserrrrUs
zregister.classifierscCs&|�|�d��\}}t�d||�dS)zF Send the metadata to the package index server to be checked.
        r	�Server response (%s): %sN)�post_to_server�build_post_datarr&)r
�code�resultrrrr\szregister.verify_metadatac
Cs�|jrd}|j}|j}nd}d}}d��}||krd|�dtj�t�}|sRd}q,||kr,td�q,|dk�rl|s|td�}qn|s�t	�	d�}q|t
j��}t
j
�|j�d	}|�|j|||�|�|�d
�|�\}}|�d||ftj�|dk�r�|j�r||j_nf|�d
tj�|�d|��tj�d}|��dk�rNtd�}|�s*d}�q*|��dk�r�|�||��nl|dk�r�ddi}	d|	d<|	d<|	d<d|	d<|	d�s�td�|	d<�q�|	d|	dk�r0|	d�s�t	�	d�|	d<�q�|	d�st	�	d�|	d<�q�|	d|	dk�r�d|	d<d|	d<td��q�|	d�sJtd�|	d<�q0|�|	�\}}|dk�rrt�d||�nt�d�t�d �nP|d!k�r�dd"i}	d|	d<|	d�s�td#�|	d<�q�|�|	�\}}t�d||�dS)$a_ Send the metadata to the package index server.

            Well, do the following:
            1. figure who the user is, and then
            2. send the data as a Basic auth'ed POST.

            First we try to read the username/password from $HOME/.pypirc,
            which is a ConfigParser-formatted file with a section
            [distutils] containing username and password entries (both
            in clear text). Eg:

                [distutils]
                index-servers =
                    pypi

                [pypi]
                username: fred
                password: sekrit

            Otherwise, to figure who the user is, we offer the user three
            choices:

             1. use existing login,
             2. register as a new user, or
             3. set the password to a random string and email the user.

        �1�x�z1 2 3 4z�We need to know who you are, so please choose either:
 1. use your existing login,
 2. register as a new user,
 3. have the server generate a new password for you (and email it to you), or
 4. quit
Your selection [default 1]: z&Please choose one of the four options!z
Username: z
Password: rZsubmitr(��zAI can store your PyPI login so future submissions will be faster.z (the login will be stored in %s)�XZynzSave your login (y/N)?�n�y�2�:action�user�namerZemailNZconfirmz
 Confirm: z!Password and confirm don't match!z
   EMail: z"You will receive an email shortly.z7Follow the instructions in it to complete registration.�3Zpassword_resetzYour email address: )r"rr�split�announcer�INFO�input�print�getpassr$r%ZHTTPPasswordMgr�parseZurlparser Zadd_passwordr!r)r*rZ_get_rc_file�lowerZ
_store_pypircr&)
r
Zchoicerr�choices�authZhostr+r,�datarrrrcs��



��

���








zregister.send_metadatacCs�|jj}|d|��|��|��|��|��|��|��|�	�|�
�|��|��|�
�|��|��|��d�}|ds�|ds�|dr�d|d<|S)Nz1.0)r5�metadata_versionr7�versionZsummaryZ	home_pageZauthorZauthor_email�license�description�keywords�platformrZdownload_url�provides�requires�	obsoletesrJrKrLz1.1rD)rZmetadataZget_nameZget_versionZget_descriptionZget_urlZget_contactZget_contact_emailZget_licenceZget_long_descriptionZget_keywordsZ
get_platformsZget_classifiersZget_download_urlZget_providesZget_requiresZ
get_obsoletes)r
�action�metarCrrrr*�s,�zregister.build_post_dataNc
Cs�d|kr$|�d|d|jftj�d}d|}|d}t��}|��D]~\}}t|�tg�td�fkrn|g}|D]R}t|�}|�	|�|�	d|�|�	d�|�	|�|rr|d	d
krr|�	d�qrqH|�	|�|�	d�|�
��d�}d
|tt|��d�}	t
j�|j||	�}
t
j�t
jj|d��}d}z|�|
�}Wnxt
jjk
�r�}
z"|j�rd|
j��}|
j|
jf}W5d}
~
XYnJt
jjk
�r�}
zdt|
�f}W5d}
~
XYnX|j�r�|�|�}d}|j�r�d�d|df�}|�|tj�|S)zC Post a query to the server, and return a string response.
        r7zRegistering %s to %sz3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254z
--z--rz*
Content-Disposition: form-data; name="%s"z

����
�
zutf-8z/multipart/form-data; boundary=%s; charset=utf-8)zContent-typezContent-length)Zpassword_mgrr/Ni�)r0ZOKzK---------------------------------------------------------------------------)r:r rr;�io�StringIO�items�type�str�write�getvalue�encode�lenr$r%ZRequestZbuild_openerZHTTPBasicAuthHandler�open�errorZ	HTTPErrorZ
show_response�fp�readr+�msgZURLErrorr'�join)r
rCrB�boundaryZsep_boundaryZend_boundaryZbody�key�valueZheadersZreqZopenerr,�er_rrrr)�s^��





��

zregister.post_to_server)N)�__name__�
__module__�__qualname__rGrZuser_optionsZboolean_optionsZsub_commandsrrrrrrrrr*r)rrrrrs*��
zr)�__doc__r>rRZurllib.parser$Zurllib.request�warningsrZdistutils.corerZdistutils.errorsZ	distutilsrrrrrr�<module>sdistutils/command/__pycache__/build_ext.cpython-38.opt-2.pyc000064400000033546151153537440020010 0ustar00U

e5dP{�@s�ddlZddlZddlZddlZddlmZddlTddlmZm	Z	ddlm
Z
ddlmZddl
mZddlmZdd	lmZdd
lmZe�d�Zdd
�ZGdd�de�ZdS)�N)�Command)�*)�customize_compiler�get_python_version)�get_config_h_filename)�newer_group)�	Extension)�get_platform)�log)�	USER_BASEz3^[a-zA-Z_][a-zA-Z_0-9]*(\.[a-zA-Z_][a-zA-Z_0-9]*)*$cCsddlm}|�dS)Nr��show_compilers)�distutils.ccompilerr
r�r�3/usr/lib64/python3.8/distutils/command/build_ext.pyr
sr
c@seZdZdZdejZddddde�fdd	d
defdd
ddddefddddddddddgZddddd gZ	d!d"d#e
fgZd$d%�Zd&d'�Z
d(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zejd6d7��Zd8d9�Zd:d;�Zd<d=�Zd>d?�Zd@dA�ZdBdC�ZdDdE�ZdFdG�Zd"S)H�	build_extz8build C/C++ extensions (compile/link to build directory)z (separated by '%s'))z
build-lib=�bz(directory for compiled extension modules)zbuild-temp=�tz1directory for temporary files (build by-products)z
plat-name=�pz>platform name to cross-compile for, if supported (default: %s))�inplace�iziignore build-lib and put compiled extensions into the source directory alongside your pure Python modulesz
include-dirs=�Iz.list of directories to search for header files)zdefine=�DzC preprocessor macros to define)zundef=�Uz!C preprocessor macros to undefine)z
libraries=�lz!external C libraries to link withz
library-dirs=�Lz.directories to search for external C libraries)zrpath=�Rz7directories to search for shared C libraries at runtime)z
link-objects=�Oz2extra explicit link objects to include in the link)�debug�gz'compile/link with debugging information)�force�fz2forcibly build everything (ignore file timestamps))z	compiler=�czspecify the compiler type)z	parallel=�jznumber of parallel build jobs)�swig-cppNz)make SWIG create C++ files (default is C))z
swig-opts=Nz!list of SWIG command line options)zswig=Nzpath to the SWIG executable)�userNz#add user include, library and rpathrrr r$r%z
help-compilerNzlist available compilerscCs�d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_d|_d|_dS)Nr)�
extensions�	build_lib�	plat_name�
build_tempr�package�include_dirs�define�undef�	libraries�library_dirs�rpath�link_objectsrr �compiler�swig�swig_cpp�	swig_optsr%�parallel��selfrrr�initialize_optionsjs*zbuild_ext.initialize_optionsc

Cs�ddlm}|�ddddddd	d
�|jdkr8|jj|_|jj|_|��}|jdd�}|j	dkrn|jj	pjg|_	t
|j	t�r�|j	�t
j�|_	tjtjkr�|j	�t
j�tjd
��|j	�|�t
jj��||kr�|j	�|�t
jj��|�d�|�d�|jdk�rg|_|jdk�rg|_nt
|jt��r:|j�t
j�|_|jdk�rNg|_nt
|jt��rl|j�t
j�|_t
jdk�rh|j�t
j�tjd��tjtjk�r�|j�t
j�tjd��|j�r�t
j�|jd�|_nt
j�|jd�|_|j	�t
j�t���t tdd�}|�r|j�|�|j!dk�r*d}n|j!dd�}t
j�tjd�}|�r\t
j�||�}|j�|�tj"dd�dk�r�tj#�$t
j�tjd���r�|j�t
j�tjddt%�d��n|j�d�|�&d��r�|j'�s�|j�|�&d ��n|j�d�|j(�r|j(�d!�}d"d#�|D�|_(|j)�r4|j)�d!�|_)|j*dk�rHg|_*n|j*�d$�|_*|j+�r�t
j�t,d
�}t
j�t,d�}	t
j�-|��r�|j	�|�t
j�-|	��r�|j�|	�|j�|	�t
|j.t��r�zt/|j.�|_.Wnt0k
�r�t1d%��YnXdS)&Nr)�	sysconfigZbuild)r'r')r)r))r2r2)rr)r r )r6r6)r(r(�)Z
plat_specificZincluder.r1�ntZlibsZDebugZRelease�_home�win32�ZPCbuild��cygwin�bin�lib�pythonZconfig�.�Py_ENABLE_SHAREDZLIBDIR�,cSsg|]}|df�qS)�1r)�.0Zsymbolrrr�
<listcomp>�sz.build_ext.finalize_options.<locals>.<listcomp>� zparallel should be an integer)2�	distutilsr:Zset_undefined_optionsr*�distributionZext_packageZext_modulesr&Zget_python_incr+�
isinstance�str�split�os�pathsep�sys�exec_prefix�base_exec_prefix�append�path�join�extendZensure_string_listr.r/r0�name�prefixrr)�dirnamer�getattrr(�platform�
executable�
startswithr�get_config_varZpython_buildr,r-r5r%r�isdirr6�int�
ValueErrorZDistutilsOptionError)
r8r:Z
py_includeZplat_py_includeZ	_sys_home�suffixZnew_libZdefinesZuser_includeZuser_librrr�finalize_options�s��




�

�zbuild_ext.finalize_optionscCsjddlm}|jsdS|j��rL|�d�}|j�|��p:g�|j	�
|j�||j|j
|j|jd�|_t|j�tjdkr�|jt�kr�|j�|j�|jdk	r�|j�|j�|jdk	r�|jD]\}}|j�||�q�|jdk	r�|jD]}|j�|�q�|jdk	�r|j�|j�|j	dk	�r*|j�|j	�|jdk	�rD|j�|j�|j dk	�r^|j�!|j �|�"�dS)Nr)�new_compiler�
build_clib)r2�verbose�dry_runr r<)#rrgr&rMZhas_c_libraries�get_finalized_commandr.rYZget_library_namesr/rVrhr2rirjr rrQrZr(r	Z
initializer+Zset_include_dirsr,Zdefine_macror-Zundefine_macroZ
set_librariesZset_library_dirsr0Zset_runtime_library_dirsr1Zset_link_objects�build_extensions)r8rgrhrZ�value�macrorrr�runs@

�




z
build_ext.runc
Csvt|t�std��t|�D�]T\}}t|t�r0qt|t�rFt|�dkrNtd��|\}}t�d|�t|t	�rvt
�|�s~td��t|t�s�td��t||d�}dD]"}|�
|�}|dk	r�t|||�q�|�
d	�|_d
|kr�t�d�|�
d�}|�rhg|_g|_|D]b}	t|	t��r"t|	�d
k�s*td��t|	�dk�rJ|j�|	d�nt|	�dk�r|j�|	��q|||<qdS)Nz:'ext_modules' option must be a list of Extension instances�zMeach element of 'ext_modules' option must be an Extension instance or 2-tuplezvold-style (ext_name, build_info) tuple found in ext_modules for extension '%s' -- please convert to Extension instancezRfirst element of each tuple in 'ext_modules' must be the extension name (a string)zOsecond element of each tuple in 'ext_modules' must be a dictionary (build info)�sources)r+r/r.�
extra_objects�extra_compile_args�extra_link_argsr0Zdef_filez9'def_file' element of build info dict no longer supported�macros)r;rpz9'macros' element of build info dict must be 1- or 2-tupler;r)rN�list�DistutilsSetupError�	enumerater�tuple�lenr
�warnrO�extension_name_re�match�dict�get�setattr�runtime_library_dirs�
define_macros�undef_macrosrV)
r8r&r�ext�ext_nameZ
build_info�key�valrurnrrr�check_extensions_listVs^

�
��
��
�


�zbuild_ext.check_extensions_listcCs,|�|j�g}|jD]}|�|j�q|S�N)r�r&rYrq)r8�	filenamesr�rrr�get_source_files�s

zbuild_ext.get_source_filescCs2|�|j�g}|jD]}|�|�|j��q|Sr�)r�r&rV�get_ext_fullpathrZ)r8Zoutputsr�rrr�get_outputs�s

zbuild_ext.get_outputscCs(|�|j�|jr|��n|��dSr�)r�r&r6�_build_extensions_parallel�_build_extensions_serialr7rrrrl�s
zbuild_ext.build_extensionscs��j}�jdkrt��}zddlm}Wntk
r@d}YnX|dkrV���dS||d��P���fdd��jD�}t�j|�D]&\}}��	|��|�
�W5QRXq�W5QRXdS)NTr)�ThreadPoolExecutor)Zmax_workerscsg|]}���j|��qSr)Zsubmit�build_extension)rIr��Zexecutorr8rrrJ�s�z8build_ext._build_extensions_parallel.<locals>.<listcomp>)r6rQ�	cpu_countZconcurrent.futuresr��ImportErrorr�r&�zip�_filter_build_errors�result)r8Zworkersr�Zfuturesr�Zfutrr�rr��s"

�z$build_ext._build_extensions_parallelc
Cs0|jD]$}|�|��|�|�W5QRXqdSr�)r&r�r�)r8r�rrrr��s
z"build_ext._build_extensions_serialc
csTz
dVWnDtttfk
rN}z |js*�|�d|j|f�W5d}~XYnXdS)Nz"building extension "%s" failed: %s)ZCCompilerErrorZDistutilsErrorZCompileErrorZoptionalr{rZ)r8r��errrr��s
�zbuild_ext._filter_build_errorsc
CsP|j}|dkst|ttf�s*td|j��t|�}|�|j�}||j}|jslt	||d�slt
�d|j�dSt
�d|j�|�
||�}|jp�g}|jdd�}|jD]}|�|f�q�|jj||j||j|j||jd�}|dd�|_|jr�|�|j�|j�pg}|j�p|j�|�}	|jj|||�|�|j|j||� |�|j|j|	d�
dS)Nzjin 'ext_modules' option (extension '%s'), 'sources' must be present and must be a list of source filenamesZnewerz$skipping '%s' extension (up-to-date)zbuilding '%s' extension)Z
output_dirrur+r�extra_postargs�depends)r.r/r�r��export_symbolsrr)Ztarget_lang)!rqrNrvryrwrZr�r�r rr
r�info�swig_sourcesrsr�r�rVr2�compiler)r+Z_built_objectsrrrYrt�languageZdetect_languageZlink_shared_object�
get_librariesr/r��get_export_symbols)
r8r�rq�ext_pathr�Z
extra_argsrur-Zobjectsr�rrrr��sX��


�
�zbuild_ext.build_extensioncCs$g}g}i}|jrt�d�|js6d|jks6d|jkr<d}nd}|D]P}tj�|�\}}	|	dkr�|�|d|�|�|�|d||<qD|�|�qD|s�|S|jp�|�	�}
|
dg}|�
|j�|jr�|�d�|js�|jD]}|�|�q�|D].}||}
t�d	||
�|�|d
|
|g�q�|S)Nz/--swig-cpp is deprecated - use --swig-opts=-c++z-c++z.cppz.cz.i�_wrap���z-pythonzswigging %s to %sz-o)
r4r
r{r5rQrW�splitextrVr3�	find_swigrYr�Zspawn)r8rq�	extensionZnew_sourcesr�Zswig_targetsZ
target_ext�source�baser�r3Zswig_cmd�o�targetrrrr�1s@
�


zbuild_ext.swig_sourcescCs^tjdkrdStjdkrLdD]*}tj�d|d�}tj�|�r|SqdStdtj��dS)N�posixr3r<)z1.3z1.2z1.1z	c:\swig%szswig.exez>I don't know how to find (much less run) SWIG on platform '%s')rQrZrWrX�isfileZDistutilsPlatformError)r8Zvers�fnrrrr�gs


��zbuild_ext.find_swigcCs�|�|�}|�d�}|�|d�}|jsRtjj|dd�|g�}tj�|j|�Sd�|dd��}|�d�}tj�	|�
|��}tj�||�S)NrEr�r�build_py)�get_ext_fullnamerP�get_ext_filenamerrQrWrXr'rk�abspathZget_package_dir)r8r��fullname�modpath�filenamer*r�Zpackage_dirrrrr�s


zbuild_ext.get_ext_fullpathcCs |jdkr|S|jd|SdS)NrE)r*)r8r�rrrr��s
zbuild_ext.get_ext_fullnamecCs.ddlm}|�d�}|d�}tjj|�|S)Nr�rarEZ
EXT_SUFFIX)�distutils.sysconfigrarPrQrWrX)r8r�rar�Z
ext_suffixrrrr��s
zbuild_ext.get_ext_filenamecCsxd|j�d�d}z|�d�Wn0tk
rRd|�d��dd��d�}YnXd	|}||jkrr|j�|�|jS)
N�_rEr��asciirZpunycode�-�_ZPyInit)rZrP�encode�UnicodeEncodeError�replace�decoder�rV)r8r�reZ
initfunc_namerrrr��s"
zbuild_ext.get_export_symbolscCs�tjdkr^ddlm}t|j|�s�d}|jr4|d}|tjd?tjd?d@f}|j|gSn�dd	l	m
}d
}|d�r�ttd�r�d
}n<tjdkr�d
}n,dtj
kr�|d�dkr�d
}n|d�dkr�d
}|r�|d�}|jd|gS|jS)Nr>r)�MSVCCompilerz
python%d%dZ_d���r�FrFZgetandroidapilevelTrAZ_PYTHON_HOST_PLATFORMZANDROID_API_LEVELZMACHDEPZ	LDVERSIONrD)rSr^Zdistutils._msvccompilerr�rNr2r�
hexversionr.r�ra�hasattrrQ�environ)r8r�r��templateZ	pythonlibraZlink_libpythonZ	ldversionrrrr��s4

�



zbuild_ext.get_libraries) �__name__�
__module__�__qualname__ZdescriptionrQrRZsep_byr	Zuser_optionsZboolean_optionsr
Zhelp_optionsr9rfror�r�r�rlr�r��
contextlib�contextmanagerr�r�r�r�r�r�r�r�r�rrrrr!sp
�����+��@N	
	K6	
r)r�rQ�rerSZdistutils.corerZdistutils.errorsr�rrrZdistutils.dep_utilrZdistutils.extensionrZdistutils.utilr	rLr
Zsiterr�r|r
rrrrr�<module>s"�distutils/command/__pycache__/__init__.cpython-38.opt-1.pyc000064400000001041151153537440017550 0ustar00U

e5d�@s2dZddddddddd	d
ddd
ddddddgZdS)z\distutils.command

Package containing implementation of all the standard Distutils
commands.ZbuildZbuild_pyZ	build_extZ
build_clibZ
build_scriptsZcleanZinstallZinstall_libZinstall_headersZinstall_scriptsZinstall_dataZsdist�registerZbdistZ
bdist_dumbZ	bdist_rpmZ
bdist_wininstZcheckZuploadN)�__doc__�__all__�rr�2/usr/lib64/python3.8/distutils/command/__init__.py�<module>s(�distutils/command/__pycache__/bdist_msi.cpython-38.pyc000064400000046251151153537440017043 0ustar00U

e5d߉�@s�dZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZdd	lmZddlZdd
lmZmZmZddlmZmZmZmZGdd
�d
e�ZGdd�de�ZdS)z#
Implements the bdist_msi command.
�N)�Command)�remove_tree)�get_python_version)�
StrictVersion)�DistutilsOptionError)�get_platform)�log)�schema�sequence�text)�	Directory�Feature�Dialog�add_datac@sFeZdZdZdd�Zdd�Zddd	�Zddd�Zddd�Zdd�Z	dS)�PyDialogz�Dialog class with a fixed layout: controls at the top, then a ruler,
    then a list of buttons: back, next, cancel. Optionally a bitmap at the
    left.cOs>tj|f|��|jd}d|d}|�dd||jd�dS)zbDialog(database, name, x, y, w, h, attributes, title, first,
        default, cancel, bitmap=true)�$�iHZ
BottomLinerN)r�__init__�h�line�w)�self�args�kwZrulerZbmwidth�r�3/usr/lib64/python3.8/distutils/command/bdist_msi.pyrs
zPyDialog.__init__c
Cs|�ddddddd|�dS)	z,Set the title text of the dialog at the top.�Title��
�@�<�z{\VerdanaBold10}%sN)r)r�titlerrrr"#s�zPyDialog.title�Back�c
Cs,|r
d}nd}|�|d|jddd|||�S)z�Add a back button with a given title, the tab-next button,
        its name in the Control table, possibly initially disabled.

        Return the button, so that events can be associated�r$���8���
pushbuttonr�rr"�next�name�active�flagsrrr�back*sz
PyDialog.back�Cancelc
Cs,|r
d}nd}|�|d|jddd|||�S)z�Add a cancel button with a given title, the tab-next button,
        its name in the Control table, possibly initially disabled.

        Return the button, so that events can be associatedr%r$i0r'r(r)r*r,rrr�cancel5szPyDialog.cancel�Nextc
Cs,|r
d}nd}|�|d|jddd|||�S)z�Add a Next button with a given title, the tab-next button,
        its name in the Control table, possibly initially disabled.

        Return the button, so that events can be associatedr%r$��r'r(r)r*r,rrrr-@sz
PyDialog.nextc
Cs,|�|t|j|d�|jdddd||�S)z�Add a button with a given title, the tab-next button,
        its name in the Control table, giving its x position; the
        y-position is aligned with the other buttons.

        Return the button, so that events can be associated�r'r(r)r%)r+�intrr)rr.r"r-Zxposrrr�xbuttonKszPyDialog.xbuttonN)r#r$)r2r$)r4r$)
�__name__�
__module__�__qualname__�__doc__rr"r1r3r-r8rrrrrs



rc@s�eZdZdZdddde�fdddd	d
ddd
g
ZddddgZddddddddddddddd d!d"d#d$d%gZd&Zd'd(�Z	d)d*�Z
d+d,�Zd-d.�Zd/d0�Z
d1d2�Zd3d4�Zd5d6�Zd7S)8�	bdist_msiz7create a Microsoft Installer (.msi) binary distribution)z
bdist-dir=Nz1temporary directory for creating the distributionz
plat-name=�pz;platform name to embed in generated filenames (default: %s))�	keep-temp�kzPkeep the pseudo-installation tree around after creating the distribution archive)ztarget-version=Nz6require a specific python version on the target system)�no-target-compile�cz/do not compile .py to .pyc on the target system)�no-target-optimize�oz;do not compile .py to .pyo (optimized) on the target system)z	dist-dir=�dz-directory to put final built distributions in)�
skip-buildNz2skip rebuilding everything (for testing/debugging))zinstall-script=NzUbasename of installation script to be run after installation or before deinstallation)zpre-install-script=Nz{Fully qualified filename of a script to be run before any files are installed.  This script need not be in the distributionr?rArCrFz2.0z2.1z2.2z2.3z2.4z2.5z2.6z2.7z2.8z2.9z3.0z3.1z3.2z3.3z3.4z3.5z3.6z3.7z3.8z3.9�XcCsFd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
dS)Nr)�	bdist_dir�	plat_name�	keep_tempZno_target_compileZno_target_optimize�target_version�dist_dir�
skip_build�install_script�pre_install_script�versions)rrrr�initialize_options}szbdist_msi.initialize_optionscCs�|�dd�|jdkr2|�d�j}tj�|d�|_t�}|jsN|j	�
�rN||_|jr�|jg|_|js�|j	�
�r�|j|kr�t
d|f��nt|j�|_|�ddd�|jr�t
d��|jr�|j	jD]}|jtj�|�kr�q�q�t
d|j��d|_dS)	NZbdist)rMrMZmsizMtarget version can only be %s, or the '--skip-build' option must be specified)rLrL)rIrIz5the pre-install-script feature is not yet implementedz(install_script '%s' not found in scripts)Zset_undefined_optionsrH�get_finalized_command�
bdist_base�os�path�joinrrK�distribution�has_ext_modulesrPrMr�list�all_versionsrOrNZscripts�basename�install_script_key)rrSZ
short_versionZscriptrrr�finalize_options�sH

�������zbdist_msi.finalize_optionscCs�|js|�d�|jddd�}|j|_|j|_d|_|�d�}d|_d|_|j�	�r�|j
}|s~|jsltd��dtj
dd	�}d
|j|f}|�d�}tj�|jd|�|_t�d|j�|��tj�dtj�|jd
��|��tjd=|�|j�|j��}|�|�}tj�|�}tj�|��r0t� |�|jj!}|j"}	|	�sJ|j#}	|	�sTd}	|�$�}
dt%|
�j&}|j��}|j
�r�d|j
|f}nd|}t'�(|t)|t'�*�||	�|_+t'�,|j+t-�d|
fg}
|j.�p�|j/}|�r�|
�0d|f�|j1�r|
�0d|j1f�|
�rt2|j+d|
�|�3�|�4�|�5�|�6�|j+�7�t8|jd��rld|j
�pXd|f}|jj9�0|�|j:�s�t;|j|j<d�dS)N�build�installr$)Zreinit_subcommandsr�install_libz Should have already checked thisz%d.%d�z.%s-%s�libzinstalling to %sZPURELIBZUNKNOWNz%d.%d.%dzPython %s %sz	Python %sZDistVersionZ
ARPCONTACTZARPURLINFOABOUT�Property�
dist_filesr=�any)�dry_run)=rMZrun_commandZreinitialize_commandrH�prefixZwarn_dir�compile�optimizerWrXrK�AssertionError�sys�version_inforIrRrTrUrVZ
build_baseZ	build_libr�infoZensure_finalized�insert�runZmkpathrL�get_fullname�get_installer_filename�abspath�exists�unlink�metadata�authorZ
maintainerZget_versionr�version�msilibZ
init_databaser	Zgen_uuid�dbZ
add_tablesr
Zauthor_emailZmaintainer_email�appendZurlr�add_find_python�	add_files�add_scripts�add_ui�Commit�hasattrrdrJrrf)rr_r`rKZplat_specifierr^�fullname�installer_namerurvrwZsversionZproduct_nameZpropsZemail�tuprrrro�s�




�



�

z
bdist_msi.runc
Cs|j}t�d�}tj�|j�}t||d|dd�}t|ddddddd�}||d	fg}|j	|j
gD]t}d|}d|}	}
d}||j
kr�d
}d}
nd|}d}
t||	||d|
|d�}t||||||
�}|�|||f�q`|��i}|D�]\}}}|g}|�r�|�
�}t�|j�D]�}tj�|j|�}tj�|��rld
|�|�|f}||}
t|||||
|�}|�|�n�|j�s�|�|j|d�||k�r�|�|�}||<||jk�r�|j�r�td|��d||_n*||}t|jd|||j|d|jfg��qq�|��q�|�|�dS)NZ	distfiles�	TARGETDIRZ	SourceDir�PythonZ
Everythingrr$)Z	directory�zPython from another locationrazPython %s from registryz%s|%szMultiple files with name %sz[#%s]Z
DuplicateFile)ryrxZCABrTrUrrrHrr
rP�
other_versionrzr�pop�listdirZabsoluterV�isdirZ
make_shortZ	componentZstart_componentZlogicalZadd_filerNr\rrZcommit)rryZcabZrootdir�root�f�itemsrw�targetr.�defaultZdescr"�level�dir�seenZfeatureZtodo�fileZafileZshortZnewdir�keyrrrr|
sf

�

��

zbdist_msi.add_filescCs�d}|jD�]v}d|}d|}d|}d|}d|}d|}d|}	d	|}
d
|}d|}tjrld}
nd
}
t|jd|d
|d|
f|d|d|
fg�t|jd||f||fg�t|jd|d|d|df|	d|d|df|
d|d|dfg�t|jd|||f|	||df|
d|d
fg�t|jd|||f|	||df|
d|d
fg�t|jdd|dd|fg�|d7}|dks
t�q
dS)asAdds code to the installer to compute the location of Python.

        Properties PYTHON.MACHINE.X.Y and PYTHON.USER.X.Y will be set from the
        registry for each version of Python.

        Properties TARGETDIRX.Y will be set from PYTHON.USER.X.Y if defined,
        else from PYTHON.MACHINE.X.Y.

        Properties PYTHONX.Y will be set to TARGETDIRX.Y\python.exei�z)SOFTWARE\Python\PythonCore\%s\InstallPathzpython.machine.zpython.user.zPYTHON.MACHINE.zPYTHON.USER.ZPythonFromMachineZPythonFromUserZ	PythonExer��PYTHON�raZ
RegLocatorNr$Z	AppSearch�CustomActioni3�[�]z]\python.exe�InstallExecuteSequence�InstallUISequenceZ	Conditionr�rz
NOT TARGETDIR�i�)rPrxZWin64rryrj)r�start�verZinstall_pathZmachine_regZuser_regZmachine_propZ	user_propZmachine_actionZuser_actionZ
exe_actionZtarget_dir_prop�exe_propZTyperrrr{Cs`�����������zbdist_msi.add_find_pythonc
Cs|jrjd}|j|jgD]P}d|}d|}t|jd|d||jfg�t|jd|d||fg�|d7}q|jr�tj�	|j
d	�}t|d
��4}|�d�t|j��}|�|�
��W5QRXW5QRXt|jdd
t�|�fg�t|jddg�t|jddg�dS)Ni�zinstall_script.r�r��2r�z&Python%s=3r$zpreinstall.batrzrem ="""
%1 %0
exit
"""
�Binary�
PreInstall)r�rar�N)r�z
NOT Installedi�)rNrPr�rryr\rOrTrUrVrH�open�write�readrxr�)rr�r�Zinstall_actionr�Zscriptfnr�Zfinrrrr}ys6��
	
"���zbdist_msi.add_scriptscCs�
|j}d}}d}d}d}d}d}d}	t|dd	d
ddd
dg�t|dddddg�t|ddddddg�t|dtj�t|dtj�t|d||||||ddd�}
|
�d�|
jddd d!�|
jd"d#d d!�|
�d$d%d&d'd(d)d*�|
�d+d%d,d'd-d)d.�|
j	dd"dd/�}|�
d0d1�t|d2||||||ddd�}|�d3�|jddd d!�|jd"d#d d!�|�d$d%d&d'd(d)d4�|�d+d%d,d'd-d)d.�|j	dd"dd/�}|�
d0d1�t|d5||||||ddd�}
|
�d6�|
jddd d!�|
jd"d#d d!�|
�d7d%d8d'd-d)d.�|
j	dd"dd/�}|�
d0d9�t|d:||||d;|d<d<d<d=d>�}|�d?d%d@dAd%d)dB�|�d7d-dCdDd-d)dE�|�dFd-dGdHdddI�|�dJdKd-dLdHdMdNdOddd�|jd1dPd1d/�}|�
d0d1�|j	dPd<dPd/�}|�
d0dP�|jd<d1d<d/�}|�
d0d<�t|dQddRdHdSdT|dUdd�}|�dUddVdDdWddX�|�
dYdZd[d\d]dd^d��
d0d_�|�
d`dad[d\d]ddbd��
d0dc�|�
ddd d[d\d]dded��
d0df�|�
dgdhd[d\d]dd"d��
d0di�|�
djd\d[d\d]ddPd��
d0dk�|�
dldmd[d\d]ddnd��
d0do�|�
dpdqd[d\d]dd<d��
d0dr�t|dsddRdtdud|d^d^d^�}|�dFdWd%dvdwddx�|�
dbd[dydzd{ddbd^�}|�
d0d1�|�
d^d|dydzd{dd^db�}|�
d0d9�t|d}ddRdtdu||d9d9d9�}|�dFdWd%dvdwdd~�|�
d9ddydzd{dd9d�}|�
d0d1�t|d�||||||d"d"d"�}|�d7d%d&d'd�d)d��|�d��|�dd%d�d'd-d)d��}|�ddF�|�d�d%d�d'dwd)d�}|�d�dF�|jd#dd d!�|j	d�dd d!�|�d"d�}|�
d�ds�t|d�||||||d�d�d"�}|�d��|�d�d%dwdd-dd�|j���|jddd d!�|�	d�d"�}d}|j
d�d�|d��|j|jgD](}|d7}|j
d�d�|d�||d���q
|j
d�d}|dd��|j
d0d9|d�d��|�d"d��}|�
d�ds�|�d�d�d%d�ddZdd�dd�d�}|�
d�d��|j}d�|}d�|}|�d�d%dAdd%dd��}|�d�|�|�d�|�|�d�|�|�d�|�|�d�d�d%d�dd�dd�|dd�d�}|�d�|�|�d�|�|�d�|�|�d�|�t|d�||||||d�d�d�d=d>�}|�d?d%d@dAd%d)d��|�d7d-d-dDd-d)d��|�dFd-d�dHd�dd��|�d�d�d-d�dHd�d�dd�dd�|�d�dndd���
d0d9�t|d�||||||d�d�d"�}|�d��|�d�d%d�dtddd�dXd��	}|�d�d d�d�d-d��|�d�d d�d�d-d��|jd#dd d!�|�	d�d"�}|�
d�d�d�d�|j
d0d9d�d��|�d"d��}|�
d�ds�t|d�||||||d"d"d"d=d>�}|�d?d-d%dAd%d)d��|�dFd�d�ddwddġ|�d�d�d�d�d-ddơ|�dd&d�|d&d-dd��}|�ddF�|�d�d�d�dZddRd�dd�dd�}|�d�dˡ|jdd�d=d!�|j	d�d"d=d!�|�d"d#��
d�ds�t|d�||||||d�d�d"�}|�d͡|�d�d%d�dHdhddС|�d�d%d�dHd�dd�dXd��	}|�d�d d�dAd{d֡|�d�d d�dAd{d١|jddd=d!�|�	dd"�}|�
d�d�d�d��|�
d�d�d�d@�|�
d�d�d�dN�|�
d�d�d�d�|�
d�d�d�d�|�
d�d�d�d�|�
d�d�d�d�|�
d�d�d�d�|�
d0d9d�d-�|�d"dѡ�
d�ds�dS)�Nr�iri,z[ProductName] Setupr%r$� rc)Z
DefaultUIFont�DlgFont8)ZErrorDialog�ErrorDlg)Z	Progress1ZInstall)Z	Progress2Zinstalls)�MaintenanceForm_Action�Repair)�
WhichUsers�ALLZ	TextStyle)r��Tahoma�	Nr)ZDlgFontBold8r��Nr$)Z
VerdanaBold10�VerdanarNr$)ZVerdanaRed9r�r��rr�)�
PrepareDlgz(Not Privileged or Windows9x or Installed�)�
WhichUsersDlgz.Privileged and not Windows9x and not Installed�)�SelectFeaturesDlgz
Not Installedi�)�MaintenanceTypeDlgz,Installed AND NOT RESUME AND NOT Preselectedi�)�ProgressDlgNi�
ActionText�UITextZ
FatalErrorZFinishz)[ProductName] Installer ended prematurelyz< Backr)r/r2r#ZDescription1r�Fr�Pr!z�[ProductName] setup ended prematurely because of an error.  Your system has not been modified.  To install this program at a later time, please run the installation again.ZDescription2��z.Click the Finish button to exit the Installer.)r.Z	EndDialogZExitZUserExitz'[ProductName] Installer was interruptedz�[ProductName] setup was interrupted.  Your system has not been modified.  To install this program at a later time, please run the installation again.Z
ExitDialogz&Completing the [ProductName] InstallerZDescription��ZReturnZ
FilesInUse�ZRetryF)Zbitmapr���z{\DlgFontBold8}Files in Use�iz8Some files that need to be updated are currently in use.ZText�7iJz�The following applications are using files that need to be updated by this setup. Close these applications and then click Retry to continue the installation or Cancel to exit it.ZListZListBox�k��ZFileInUseProcess�Ignorer�r�eiZ	ErrorTextr��0r��N�x�H�Q�ZNoZErrorNo�Y��ZYesZErrorYes�AZAbortZ
ErrorAbort�C�*ZErrorCancel�IZErrorIgnore�O�ZOkZErrorOk�R��Z
ErrorRetryZ	CancelDlgi�U���z;Are you sure you want to cancel [ProductName] installation?�9r(r)�ZWaitForCostingDlgzRPlease wait while the installer finishes determining your disk space requirements.�fr��(zOPlease wait while the Installer prepares to guide you through the installation.z&Welcome to the [ProductName] Installer�nzPondering...Z
ActionData�r4ZSpawnDialogr�zSelect Python InstallationsZHintz9Select the Python locations where %s should be installed.zNext >z[TARGETDIR]z[SourceDir])Zorderingz
[TARGETDIR%s]z FEATURE_SELECTED AND &Python%s=3ZSpawnWaitDialograZFeaturesZ
SelectionTreer ZFEATUREZPathEditz[FEATURE_SELECTED]�1z!FEATURE_SELECTED AND &Python%s<>3ZOtherz$Provide an alternate Python locationZEnableZShowZDisableZHide���r�ZDiskCostDlgZOKz&{\DlgFontBold8}Disk Space RequirementszFThe disk space required for the installation of the selected features.�5aThe highlighted volumes (if any) do not have enough disk space available for the currently selected features.  You can either remove some files from the highlighted volumes, or choose to install less features onto local drive(s), or select different destination drive(s).Z
VolumeListZVolumeCostList�d�iz{120}{70}{70}{70}{70}g�?r�ZAdminInstallzGSelect whether to install [ProductName] for all users of this computer.r�r��zInstall for all usersZJUSTME�zInstall just for mez
[ALLUSERS]zWhichUsers="ALL"r�z({\DlgFontBold8}[Progress1] [ProductName]�#�AzYPlease wait while the Installer [Progress2] [ProductName]. This may take several minutes.ZStatusLabelzStatus:ZProgressBariz
Progress doneZSetProgressZProgressr�z)Welcome to the [ProductName] Setup WizardZBodyText�?z:Select whether you want to repair or remove [ProductName].ZRepairRadioGroup�lr�r�r�z&Repair [ProductName]ZRemoverzRe&move [ProductName]z[REINSTALL]zMaintenanceForm_Action="Repair"z[Progress1]Z	Repairingz[Progress2]ZrepairsZ	Reinstallr�z[REMOVE]zMaintenanceForm_Action="Remove"�ZRemoving�Zremoves�
�z MaintenanceForm_Action<>"Change")ryrrr�r�rr"r1r3r-ZeventZcontrolrr+�mappingrWrprPr�Z	conditionr8Z
radiogroup�add)rry�x�yrrr"ZmodalZmodelessZtrack_disk_spaceZfatalrBZ	user_exitZexit_dialogZinuse�errorr3ZcostingZprepZseldlg�orderrwr�Zinstall_other_condZdont_install_other_condZcostZ
whichusers�gZprogressZmaintrrrr~�sv��
��	��
�
���
���
�������       ������
�
���
��������
�
������
��zbdist_msi.add_uicCs<|jrd||j|jf}nd||jf}tj�|j|�}|S)Nz%s.%s-py%s.msiz	%s.%s.msi)rKrIrTrUrVrL)rr�Z	base_namer�rrrrq�s�z bdist_msi.get_installer_filenameN)r9r:r;ZdescriptionrZuser_optionsZboolean_optionsrZr�rQr]ror|r{r}r~rqrrrrr=Ss^����
�
([66&@r=)r<rkrTZdistutils.corerZdistutils.dir_utilrZdistutils.sysconfigrZdistutils.versionrZdistutils.errorsrZdistutils.utilrZ	distutilsrrxr	r
rrr
rrrr=rrrr�<module>s>distutils/command/__pycache__/upload.cpython-38.pyc000064400000012100151153537440016334 0ustar00U

&�.e��@s�dZddlZddlZddlZddlZddlmZddlmZm	Z	m
Z
ddlmZddl
mZmZddlmZddlmZdd	lmZGd
d�de�ZdS)zm
distutils.command.upload

Implements the Distutils 'upload' subcommand (upload package to a package
index).
�N)�standard_b64encode)�urlopen�Request�	HTTPError)�urlparse)�DistutilsError�DistutilsOptionError)�
PyPIRCCommand)�spawn)�logc@sJeZdZdZejddgZejdgZdd�Zdd�Zd	d
�Z	dd�Z
d
S)�uploadzupload binary package to PyPI)�sign�szsign files to upload using gpg)z	identity=�izGPG identity used to sign filesr
cCs,t�|�d|_d|_d|_d|_d|_dS)N�rF)r	�initialize_options�username�password�
show_responser
�identity)�self�r�0/usr/lib64/python3.8/distutils/command/upload.pyr s
zupload.initialize_optionscCsrt�|�|jr|jstd��|��}|ikrV|d|_|d|_|d|_|d|_	|jsn|j
jrn|j
j|_dS)Nz.Must use --sign for --identity to have meaningrr�
repository�realm)r	�finalize_optionsrr
rZ_read_pypircrrrr�distribution)rZconfigrrrr(s
�



zupload.finalize_optionscCs:|jjsd}t|��|jjD]\}}}|�|||�qdS)NzHMust create and upload files in one command (e.g. setup.py sdist upload))rZ
dist_filesr�upload_file)r�msg�command�	pyversion�filenamerrr�run:s
z
upload.runc"Cst|j�\}}}}}}	|s"|s"|	r0td|j��|dkrDtd|��|jr|ddd|g}
|jrnd|jg|
dd�<t|
|jd	�t|d
�}z|�	�}W5|��X|j
j}
dd|
��|
�
�tj�|�|f||t�|���d
|
��|
��|
��|
��|
��|
��|
��|
��|
��|
��|
��|
��|
� �d�}zt�!|���}WnPt"k
�r�}z0d|}|�#|t$j%�ddl&m'}|��s|�W5d}~XYn
X||d<d|d<|j�r�t|dd
��"}tj�|�d|�	�f|d<W5QRX|j(d|j)�*d�}dt+|��,d�}d}d|�*d�}|d}t-�.�}|�/�D]�\}}d|}t0|t1��sP|g}|D]j}t2|�t3k�r�|d|d7}|d}nt4|��*d �}|�5|�|�5|�*d ��|�5d!�|�5|��qT�q.|�5|�|�6�}d"||jf}|�#|t$j%�d#|t4t7|��|d$�}t8|j||d%�}zt9|�}|�:�}|j;} Wnft<k
�rd}z|j=}|j;} W5d}~XYn8t>k
�r�}z|�#t4|�t$j?��W5d}~XYnX|d&k�r�|�#d'|| ft$j%�|j@�r|�A|�}!d(�Bd)|!d)f�}|�#|t$j%�n"d*|| f}|�#|t$j?�tC|��dS)+NzIncompatible url %s)ZhttpZhttpszunsupported schema Zgpgz
--detach-signz-az--local-user�)�dry_run�rbZfile_upload�1z1.0)z:actionZprotocol_version�name�version�contentZfiletyper Z
sha256_digestZmetadata_versionZsummaryZ	home_pageZauthorZauthor_email�license�description�keywords�platformZclassifiersZdownload_urlZprovidesZrequiresZ	obsoletesz#calculating md5 checksum failed: %sr)�
get_fips_modeZ
md5_digestrZcommentz.ascZ
gpg_signature�:�asciizBasic z3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254s
--s--
z+
Content-Disposition: form-data; name="%s"z; filename="%s"�zutf-8s

zSubmitting %s to %sz multipart/form-data; boundary=%s)zContent-typezContent-lengthZ
Authorization)�data�headers��zServer response (%s): %s�
zK---------------------------------------------------------------------------zUpload failed (%s): %s)Drr�AssertionErrorr
rr
r$�open�close�readrZmetadataZget_nameZget_version�os�path�basename�hashlibZsha256Z	hexdigestZget_descriptionZget_urlZget_contactZget_contact_emailZget_licenceZget_long_descriptionZget_keywordsZ
get_platformsZget_classifiersZget_download_urlZget_providesZget_requiresZ
get_obsoletesZmd5�
ValueErrorZannouncer�INFOZ_hashlibr.rr�encoder�decode�io�BytesIO�items�
isinstance�list�type�tuple�str�write�getvalue�lenrrZgetcoderr�code�OSErrorZERRORrZ_read_pypi_response�joinr)"rrr r!ZschemaZnetlocZurlZparamsZqueryZ	fragmentsZgpg_args�fr)�metar2Zdigest�err.Z	user_passZauth�boundaryZsep_boundaryZend_boundaryZbody�key�value�titler3Zrequest�resultZstatus�reason�textrrrrBs���

�!�




��

�
zupload.upload_fileN)�__name__�
__module__�__qualname__r+r	Zuser_optionsZboolean_optionsrrr"rrrrrrs�r)�__doc__r:rBr-r=�base64rZurllib.requestrrrZurllib.parserZdistutils.errorsrrZdistutils.corer	Zdistutils.spawnr
Z	distutilsrrrrrr�<module>sdistutils/command/__pycache__/install_egg_info.cpython-38.pyc000064400000005666151153537440020376 0ustar00U

e5d+
�@sddZddlmZddlmZmZddlZddlZddlZGdd�de�Z	dd�Z
d	d
�Zdd�ZdS)
z�distutils.command.install_egg_info

Implements the Distutils 'install_egg_info' command, for installing
a package's PKG-INFO metadata.�)�Command)�log�dir_utilNc@s:eZdZdZdZdgZdd�Zdd�Zdd	�Zd
d�Z	dS)
�install_egg_infoz)Install an .egg-info file for the packagez8Install package's PKG-INFO metadata as an .egg-info file)zinstall-dir=�dzdirectory to install tocCs
d|_dS�N)�install_dir��self�r�:/usr/lib64/python3.8/distutils/command/install_egg_info.py�initialize_optionssz#install_egg_info.initialize_optionscCsb|�dd�dtt|j����tt|j����ftjdd��}t	j
�|j|�|_
|j
g|_dS)NZinstall_lib)rrz%s-%s-py%d.%d.egg-info�)Zset_undefined_options�to_filename�	safe_name�distributionZget_name�safe_versionZget_version�sys�version_info�os�path�joinr�target�outputs)r
�basenamerrr�finalize_optionss��z!install_egg_info.finalize_optionsc	Cs�|j}tj�|�r0tj�|�s0tj||jd�nNtj�|�rV|�	tj
|jfd|�n(tj�|j�s~|�	tj|jfd|j�t
�d|�|js�t|ddd��}|jj�|�W5QRXdS)N)�dry_runz	Removing z	Creating z
Writing %s�wzUTF-8)�encoding)rrr�isdir�islinkrZremove_treer�existsZexecute�unlinkr�makedirsr�info�openrZmetadataZwrite_pkg_file)r
r�frrr�run s�zinstall_egg_info.runcCs|jSr)rr	rrr�get_outputs.szinstall_egg_info.get_outputsN)
�__name__�
__module__�__qualname__�__doc__ZdescriptionZuser_optionsr
rr'r(rrrrrs�
rcCst�dd|�S)z�Convert an arbitrary string to a standard distribution name

    Any runs of non-alphanumeric/. characters are replaced with a single '-'.
    �[^A-Za-z0-9.]+�-)�re�sub��namerrrr6srcCs|�dd�}t�dd|�S)z�Convert an arbitrary string to a standard version string

    Spaces become dots, and all other non-alphanumeric characters become
    dashes, with runs of multiple dashes condensed to a single dash.
    � �.r-r.)�replacer/r0)�versionrrrr>srcCs|�dd�S)z|Convert a project or version name to its filename-escaped form

    Any '-' characters are currently replaced with '_'.
    r.�_)r5r1rrrrHsr)
r,Z
distutils.cmdrZ	distutilsrrrrr/rrrrrrrr�<module>s+
distutils/command/__pycache__/upload.cpython-38.opt-2.pyc000064400000011702151153537440017303 0ustar00U

&�.e��@s�ddlZddlZddlZddlZddlmZddlmZmZm	Z	ddl
mZddlm
Z
mZddlmZddlmZddlmZGd	d
�d
e�ZdS)�N)�standard_b64encode)�urlopen�Request�	HTTPError)�urlparse)�DistutilsError�DistutilsOptionError)�
PyPIRCCommand)�spawn)�logc@sJeZdZdZejddgZejdgZdd�Zdd�Zd	d
�Z	dd�Z
d
S)�uploadzupload binary package to PyPI)�sign�szsign files to upload using gpg)z	identity=�izGPG identity used to sign filesr
cCs,t�|�d|_d|_d|_d|_d|_dS)N�rF)r	�initialize_options�username�password�
show_responser
�identity)�self�r�0/usr/lib64/python3.8/distutils/command/upload.pyr s
zupload.initialize_optionscCsrt�|�|jr|jstd��|��}|ikrV|d|_|d|_|d|_|d|_	|jsn|j
jrn|j
j|_dS)Nz.Must use --sign for --identity to have meaningrr�
repository�realm)r	�finalize_optionsrr
rZ_read_pypircrrrr�distribution)rZconfigrrrr(s
�



zupload.finalize_optionscCs:|jjsd}t|��|jjD]\}}}|�|||�qdS)NzHMust create and upload files in one command (e.g. setup.py sdist upload))rZ
dist_filesr�upload_file)r�msg�command�	pyversion�filenamerrr�run:s
z
upload.runc"Cst|j�\}}}}}}	|s"|s"|	r0td|j��|dkrDtd|��|jr|ddd|g}
|jrnd|jg|
dd�<t|
|jd	�t|d
�}z|�	�}W5|��X|j
j}
dd|
��|
�
�tj�|�|f||t�|���d
|
��|
��|
��|
��|
��|
��|
��|
��|
��|
��|
��|
��|
� �d�}zt�!|���}WnPt"k
�r�}z0d|}|�#|t$j%�ddl&m'}|��s|�W5d}~XYn
X||d<d|d<|j�r�t|dd
��"}tj�|�d|�	�f|d<W5QRX|j(d|j)�*d�}dt+|��,d�}d}d|�*d�}|d}t-�.�}|�/�D]�\}}d|}t0|t1��sP|g}|D]j}t2|�t3k�r�|d|d7}|d}nt4|��*d �}|�5|�|�5|�*d ��|�5d!�|�5|��qT�q.|�5|�|�6�}d"||jf}|�#|t$j%�d#|t4t7|��|d$�}t8|j||d%�}zt9|�}|�:�}|j;} Wnft<k
�rd}z|j=}|j;} W5d}~XYn8t>k
�r�}z|�#t4|�t$j?��W5d}~XYnX|d&k�r�|�#d'|| ft$j%�|j@�r|�A|�}!d(�Bd)|!d)f�}|�#|t$j%�n"d*|| f}|�#|t$j?�tC|��dS)+NzIncompatible url %s)ZhttpZhttpszunsupported schema Zgpgz
--detach-signz-az--local-user�)�dry_run�rbZfile_upload�1z1.0)z:actionZprotocol_version�name�version�contentZfiletyper Z
sha256_digestZmetadata_versionZsummaryZ	home_pageZauthorZauthor_email�license�description�keywords�platformZclassifiersZdownload_urlZprovidesZrequiresZ	obsoletesz#calculating md5 checksum failed: %sr)�
get_fips_modeZ
md5_digestrZcommentz.ascZ
gpg_signature�:�asciizBasic z3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254s
--s--
z+
Content-Disposition: form-data; name="%s"z; filename="%s"�zutf-8s

zSubmitting %s to %sz multipart/form-data; boundary=%s)zContent-typezContent-lengthZ
Authorization)�data�headers��zServer response (%s): %s�
zK---------------------------------------------------------------------------zUpload failed (%s): %s)Drr�AssertionErrorr
rr
r$�open�close�readrZmetadataZget_nameZget_version�os�path�basename�hashlibZsha256Z	hexdigestZget_descriptionZget_urlZget_contactZget_contact_emailZget_licenceZget_long_descriptionZget_keywordsZ
get_platformsZget_classifiersZget_download_urlZget_providesZget_requiresZ
get_obsoletesZmd5�
ValueErrorZannouncer�INFOZ_hashlibr.rr�encoder�decode�io�BytesIO�items�
isinstance�list�type�tuple�str�write�getvalue�lenrrZgetcoderr�code�OSErrorZERRORrZ_read_pypi_response�joinr)"rrr r!ZschemaZnetlocZurlZparamsZqueryZ	fragmentsZgpg_args�fr)�metar2Zdigest�err.Z	user_passZauth�boundaryZsep_boundaryZend_boundaryZbody�key�value�titler3Zrequest�resultZstatus�reason�textrrrrBs���

�!�




��

�
zupload.upload_fileN)�__name__�
__module__�__qualname__r+r	Zuser_optionsZboolean_optionsrrr"rrrrrrs�r)r:rBr-r=�base64rZurllib.requestrrrZurllib.parserZdistutils.errorsrrZdistutils.corer	Zdistutils.spawnr
Z	distutilsrrrrrr�<module>sdistutils/command/__pycache__/upload.cpython-38.opt-1.pyc000064400000012100151153537440017273 0ustar00U

&�.e��@s�dZddlZddlZddlZddlZddlmZddlmZm	Z	m
Z
ddlmZddl
mZmZddlmZddlmZdd	lmZGd
d�de�ZdS)zm
distutils.command.upload

Implements the Distutils 'upload' subcommand (upload package to a package
index).
�N)�standard_b64encode)�urlopen�Request�	HTTPError)�urlparse)�DistutilsError�DistutilsOptionError)�
PyPIRCCommand)�spawn)�logc@sJeZdZdZejddgZejdgZdd�Zdd�Zd	d
�Z	dd�Z
d
S)�uploadzupload binary package to PyPI)�sign�szsign files to upload using gpg)z	identity=�izGPG identity used to sign filesr
cCs,t�|�d|_d|_d|_d|_d|_dS)N�rF)r	�initialize_options�username�password�
show_responser
�identity)�self�r�0/usr/lib64/python3.8/distutils/command/upload.pyr s
zupload.initialize_optionscCsrt�|�|jr|jstd��|��}|ikrV|d|_|d|_|d|_|d|_	|jsn|j
jrn|j
j|_dS)Nz.Must use --sign for --identity to have meaningrr�
repository�realm)r	�finalize_optionsrr
rZ_read_pypircrrrr�distribution)rZconfigrrrr(s
�



zupload.finalize_optionscCs:|jjsd}t|��|jjD]\}}}|�|||�qdS)NzHMust create and upload files in one command (e.g. setup.py sdist upload))rZ
dist_filesr�upload_file)r�msg�command�	pyversion�filenamerrr�run:s
z
upload.runc"Cst|j�\}}}}}}	|s"|s"|	r0td|j��|dkrDtd|��|jr|ddd|g}
|jrnd|jg|
dd�<t|
|jd	�t|d
�}z|�	�}W5|��X|j
j}
dd|
��|
�
�tj�|�|f||t�|���d
|
��|
��|
��|
��|
��|
��|
��|
��|
��|
��|
��|
��|
� �d�}zt�!|���}WnPt"k
�r�}z0d|}|�#|t$j%�ddl&m'}|��s|�W5d}~XYn
X||d<d|d<|j�r�t|dd
��"}tj�|�d|�	�f|d<W5QRX|j(d|j)�*d�}dt+|��,d�}d}d|�*d�}|d}t-�.�}|�/�D]�\}}d|}t0|t1��sP|g}|D]j}t2|�t3k�r�|d|d7}|d}nt4|��*d �}|�5|�|�5|�*d ��|�5d!�|�5|��qT�q.|�5|�|�6�}d"||jf}|�#|t$j%�d#|t4t7|��|d$�}t8|j||d%�}zt9|�}|�:�}|j;} Wnft<k
�rd}z|j=}|j;} W5d}~XYn8t>k
�r�}z|�#t4|�t$j?��W5d}~XYnX|d&k�r�|�#d'|| ft$j%�|j@�r|�A|�}!d(�Bd)|!d)f�}|�#|t$j%�n"d*|| f}|�#|t$j?�tC|��dS)+NzIncompatible url %s)ZhttpZhttpszunsupported schema Zgpgz
--detach-signz-az--local-user�)�dry_run�rbZfile_upload�1z1.0)z:actionZprotocol_version�name�version�contentZfiletyper Z
sha256_digestZmetadata_versionZsummaryZ	home_pageZauthorZauthor_email�license�description�keywords�platformZclassifiersZdownload_urlZprovidesZrequiresZ	obsoletesz#calculating md5 checksum failed: %sr)�
get_fips_modeZ
md5_digestrZcommentz.ascZ
gpg_signature�:�asciizBasic z3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254s
--s--
z+
Content-Disposition: form-data; name="%s"z; filename="%s"�zutf-8s

zSubmitting %s to %sz multipart/form-data; boundary=%s)zContent-typezContent-lengthZ
Authorization)�data�headers��zServer response (%s): %s�
zK---------------------------------------------------------------------------zUpload failed (%s): %s)Drr�AssertionErrorr
rr
r$�open�close�readrZmetadataZget_nameZget_version�os�path�basename�hashlibZsha256Z	hexdigestZget_descriptionZget_urlZget_contactZget_contact_emailZget_licenceZget_long_descriptionZget_keywordsZ
get_platformsZget_classifiersZget_download_urlZget_providesZget_requiresZ
get_obsoletesZmd5�
ValueErrorZannouncer�INFOZ_hashlibr.rr�encoder�decode�io�BytesIO�items�
isinstance�list�type�tuple�str�write�getvalue�lenrrZgetcoderr�code�OSErrorZERRORrZ_read_pypi_response�joinr)"rrr r!ZschemaZnetlocZurlZparamsZqueryZ	fragmentsZgpg_args�fr)�metar2Zdigest�err.Z	user_passZauth�boundaryZsep_boundaryZend_boundaryZbody�key�value�titler3Zrequest�resultZstatus�reason�textrrrrBs���

�!�




��

�
zupload.upload_fileN)�__name__�
__module__�__qualname__r+r	Zuser_optionsZboolean_optionsrrr"rrrrrrs�r)�__doc__r:rBr-r=�base64rZurllib.requestrrrZurllib.parserZdistutils.errorsrrZdistutils.corer	Zdistutils.spawnr
Z	distutilsrrrrrr�<module>sdistutils/command/__pycache__/check.cpython-38.opt-2.pyc000064400000010337151153537440017077 0ustar00U

e5d��@s�ddlmZddlmZzTddlmZddlmZddlm	Z	ddlm
Z
ddlmZGdd	�d	e�Z
d
ZWnek
r�dZYnXGdd
�d
e�ZdS)�)�Command)�DistutilsSetupError)�Reporter)�Parser)�frontend)�nodes)�StringIOc@seZdZd	dd�Zdd�ZdS)
�SilentReporterNr�ascii�replacec
Cs"g|_t�||||||||�dS�N)�messagesr�__init__)�self�source�report_level�
halt_level�stream�debug�encoding�
error_handler�r�//usr/lib64/python3.8/distutils/command/check.pyrs�zSilentReporter.__init__cOs6|j�||||f�tj|f|�||j|d�|��S)N)�level�type)r
�appendr�system_messageZlevels)rr�messageZchildren�kwargsrrrrs���zSilentReporter.system_message)Nrr
r)�__name__�
__module__�__qualname__rrrrrrr	s�
r	TFc@s\eZdZdZdddgZdddgZdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�ZdS)�checkz"perform some checks on the package)�metadata�mzVerify meta-data)�restructuredtext�rzEChecks if long string meta-data syntax are reStructuredText-compliant)�strict�sz(Will exit with an error if a check failsr#r%r'cCsd|_d|_d|_d|_dS)Nr�)r%r#r'�	_warnings�rrrr�initialize_options1szcheck.initialize_optionscCsdSrrr+rrr�finalize_options8szcheck.finalize_optionscCs|jd7_t�||�S)Nr))r*r�warn)r�msgrrrr.;sz
check.warncCsL|jr|��|jr0tr"|��n|jr0td��|jrH|jdkrHtd��dS)NzThe docutils package is needed.rzPlease correct your package.)r#�check_metadatar%�HAS_DOCUTILS�check_restructuredtextr'rr*r+rrr�run@s
z	check.runcCs�|jj}g}dD]"}t||�r(t||�s|�|�q|rL|�dd�|��|jrd|js�|�d�n"|j	r||j
s�|�d�n
|�d�dS)N)�name�versionZurlzmissing required meta-data: %sz, zLmissing meta-data: if 'author' supplied, 'author_email' must be supplied toozTmissing meta-data: if 'maintainer' supplied, 'maintainer_email' must be supplied toozimissing meta-data: either (author and author_email) or (maintainer and maintainer_email) must be supplied)�distributionr#�hasattr�getattrrr.�joinZauthorZauthor_emailZ
maintainerZmaintainer_email)rr#Zmissing�attrrrrr0Pszcheck.check_metadatacCsX|j��}|�|�D]>}|d�d�}|dkr8|d}nd|d|f}|�|�qdS)N����liner)z%s (line %s))r6Zget_long_description�_check_rst_data�getr.)r�dataZwarningr<rrrr2ns

zcheck.check_restructuredtextc
Cs�|jjp
d}t�}tjtfd���}d|_d|_d|_t	||j
|j|j|j
|j|jd�}tj|||d�}|�|d�z|�||�Wn:tk
r�}z|j�dd|dif�W5d}~XYnX|jS)	Nzsetup.py)Z
components�)rrrr)rr;z!Could not finish the parsing: %s.�)r6Zscript_namerrZOptionParserZget_default_valuesZ	tab_widthZpep_referencesZrfc_referencesr	rrZwarning_streamrZerror_encodingZerror_encoding_error_handlerr�documentZnote_source�parse�AttributeErrorr
r)rr?�source_path�parserZsettingsZreporterrB�errrr=ys.��zcheck._check_rst_dataN)
rr r!ZdescriptionZuser_optionsZboolean_optionsr,r-r.r3r0r2r=rrrrr"$s�
r"N)Zdistutils.corerZdistutils.errorsrZdocutils.utilsrZdocutils.parsers.rstrZdocutilsrr�iorr	r1�	Exceptionr"rrrr�<module>s
distutils/command/__pycache__/config.cpython-38.pyc000064400000023765151153537440016340 0ustar00U

e5d=3�@sldZddlZddlZddlmZddlmZddlmZddl	m
Z
ddd	�ZGd
d�de�Zddd
�Z
dS)a�distutils.command.config

Implements the Distutils 'config' command, a (mostly) empty command class
that exists mainly to be sub-classed by specific module distributions and
applications.  The idea is that while every "config" command is different,
at least they're all named the same, and users always see "config" in the
list of standard commands.  Also, this is a good place to put common
configure-like tasks: "try to compile this C code", or "figure out where
this header file lives".
�N)�Command)�DistutilsExecError)�customize_compiler)�logz.cz.cxx)�czc++c	@s�eZdZdZdddddddd	d
g	Zdd�Zd
d�Zdd�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
d0dd �Zd1d!d"�Zd2d#d$�Zd3d%d&�Zd4d'd(�Zd5d*d+�Zdddgfd,d-�Zd6d.d/�ZdS)7�configzprepare to build)z	compiler=Nzspecify the compiler type)zcc=Nzspecify the compiler executable)z
include-dirs=�Iz.list of directories to search for header files)zdefine=�DzC preprocessor macros to define)zundef=�Uz!C preprocessor macros to undefine)z
libraries=�lz!external C libraries to link with)z
library-dirs=�Lz.directories to search for external C libraries)�noisyNz1show every action (compile, link, run, ...) taken)zdump-sourceNz=dump generated source files before attempting to compile themcCs4d|_d|_d|_d|_d|_d|_d|_g|_dS)N�)�compilerZcc�include_dirs�	libraries�library_dirsr
�dump_source�
temp_files��self�r�0/usr/lib64/python3.8/distutils/command/config.py�initialize_options3szconfig.initialize_optionscCs�|jdkr|jjpg|_nt|jt�r6|j�tj�|_|jdkrHg|_nt|jt�r^|jg|_|jdkrpg|_nt|jt�r�|j�tj�|_dS�N)	rZdistribution�
isinstance�str�split�os�pathseprrrrrr�finalize_optionsBs



zconfig.finalize_optionscCsdSrrrrrr�runRsz
config.runcCszddlm}m}t|j|�sv||j|jdd�|_t|j�|jrN|j�|j�|j	rb|j�
|j	�|jrv|j�|j�dS)z^Check that 'self.compiler' really is a CCompiler object;
        if not, make it one.
        r)�	CCompiler�new_compilerr)r�dry_runZforceN)
�distutils.ccompilerr"r#rrr$rrZset_include_dirsrZ
set_librariesrZset_library_dirs)rr"r#rrr�_check_compilerYs�
zconfig._check_compilerc	Csldt|}t|d��L}|r>|D]}|�d|�q |�d�|�|�|ddkr^|�d�W5QRX|S)NZ_configtest�wz#include <%s>
�
���)�LANG_EXT�open�write)r�body�headers�lang�filename�file�headerrrr�_gen_temp_sourcefileks

zconfig._gen_temp_sourcefilecCs<|�|||�}d}|j�||g�|jj|||d�||fS)Nz
_configtest.i�r)r3r�extendrZ
preprocess)rr-r.rr/�src�outrrr�_preprocessws
zconfig._preprocesscCs\|�|||�}|jr"t|d|�|j�|g�\}|j�||g�|jj|g|d�||fS)Nzcompiling '%s':r4)r3r�	dump_filerZobject_filenamesrr5�compile)rr-r.rr/r6�objrrr�_compile~szconfig._compilec
Csr|�||||�\}}tj�tj�|��d}	|jj|g|	|||d�|jjdk	r\|	|jj}	|j�	|	�|||	fS)Nr)rrZtarget_lang)
r<r�path�splitext�basenamerZlink_executableZ
exe_extensionr�append)
rr-r.rrrr/r6r;�progrrr�_link�s�zconfig._linkc	GsT|s|j}g|_t�dd�|��|D](}zt�|�Wq&tk
rLYq&Xq&dS)Nzremoving: %s� )rr�info�joinr�remove�OSError)r�	filenamesr0rrr�_clean�sz
config._cleanNrcCsRddlm}|��d}z|�||||�Wn|k
rDd}YnX|��|S)aQConstruct a source file from 'body' (a string containing lines
        of C/C++ code) and 'headers' (a list of header files to include)
        and run it through the preprocessor.  Return true if the
        preprocessor succeeded, false if there were any errors.
        ('body' probably isn't of much use, but what the heck.)
        r��CompileErrorTF)r%rKr&r8rI�rr-r.rr/rK�okrrr�try_cpp�s
zconfig.try_cppc	Csx|��|�||||�\}}t|t�r0t�|�}t|��.}d}	|��}
|
dkrPqb|�|
�r>d}	qbq>W5QRX|�	�|	S)a�Construct a source file (just like 'try_cpp()'), run it through
        the preprocessor, and return true if any line of the output matches
        'pattern'.  'pattern' should either be a compiled regex object or a
        string containing a regex.  If both 'body' and 'headers' are None,
        preprocesses an empty file -- which can be useful to determine the
        symbols the preprocessor and compiler set by default.
        F�T)
r&r8rr�rer:r+�readline�searchrI)r�patternr-r.rr/r6r7r1�match�linerrr�
search_cpp�s	



zconfig.search_cppcCsdddlm}|��z|�||||�d}Wn|k
rDd}YnXt�|rRdpTd�|��|S)zwTry to compile a source file built from 'body' and 'headers'.
        Return true on success, false otherwise.
        rrJTF�success!�failure.)r%rKr&r<rrDrIrLrrr�try_compile�s
zconfig.try_compilec
	Cspddlm}m}|��z|�||||||�d}	Wn||fk
rPd}	YnXt�|	r^dp`d�|��|	S)z�Try to compile and link a source file, built from 'body' and
        'headers', to executable form.  Return true on success, false
        otherwise.
        r�rK�	LinkErrorTFrWrX)r%rKr[r&rBrrDrI)
rr-r.rrrr/rKr[rMrrr�try_link�s
�
zconfig.try_linkc

Cs�ddlm}m}|��z.|�||||||�\}	}
}|�|g�d}Wn||tfk
rdd}YnXt�|rrdptd�|�	�|S)z�Try to compile, link to an executable, and run a program
        built from 'body' and 'headers'.  Return true on success, false
        otherwise.
        rrZTFrWrX)
r%rKr[r&rBZspawnrrrDrI)
rr-r.rrrr/rKr[r6r;ZexerMrrr�try_run�s
�

zconfig.try_runrc	Cst|��g}|r|�d|�|�d�|r<|�d|�n|�d|�|�d�d�|�d}|�|||||�S)a�Determine if function 'func' is available by constructing a
        source file that refers to 'func', and compiles and links it.
        If everything succeeds, returns true; otherwise returns false.

        The constructed source file starts out by including the header
        files listed in 'headers'.  If 'decl' is true, it then declares
        'func' (as "int func()"); you probably shouldn't supply 'headers'
        and set 'decl' true in the same call, or you might get errors about
        a conflicting declarations for 'func'.  Finally, the constructed
        'main()' function either references 'func' or (if 'call' is true)
        calls it.  'libraries' and 'library_dirs' are used when
        linking.
        z
int %s ();z
int main () {z  %s();z  %s;�}r()r&r@rEr\)	r�funcr.rrrZdeclZcallr-rrr�
check_funcs


�zconfig.check_funccCs |��|�d|||g||�S)a�Determine if 'library' is available to be linked against,
        without actually checking that any particular symbols are provided
        by it.  'headers' will be used in constructing the source file to
        be compiled, but the only effect of this is to check if all the
        header files listed are available.  Any libraries listed in
        'other_libraries' will be included in the link, in case 'library'
        has symbols that depend on other libraries.
        zint main (void) { })r&r\)rZlibraryrr.rZother_librariesrrr�	check_lib4s


�zconfig.check_libcCs|jd|g|d�S)z�Determine if the system header file named by 'header_file'
        exists and can be found by the preprocessor; return true if so,
        false otherwise.
        z
/* No body */)r-r.r)rN)rr2rrr/rrr�check_headerBs
�zconfig.check_header)NNNr)NNNr)NNr)NNNNr)NNNNr)NNNNrr)NNr)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsrr r!r&r3r8r<rBrIrNrVrYr\r]r`rarbrrrrrs\�	
�

�
�
�
�
�rcCsJ|dkrt�d|�n
t�|�t|�}zt�|���W5|��XdS)zjDumps a file content into log.info.

    If head is not None, will be dumped before the file content.
    Nz%s)rrDr+�close�read)r0�headr1rrrr9Ks
r9)N)�__doc__rrPZdistutils.corerZdistutils.errorsrZdistutils.sysconfigrZ	distutilsrr*rr9rrrr�<module>s
8distutils/command/__pycache__/bdist_dumb.cpython-38.pyc000064400000007012151153537440017172 0ustar00U

e5d1�@shdZddlZddlmZddlmZddlmZmZddl	Tddl
mZddlm
Z
Gd	d
�d
e�ZdS)z�distutils.command.bdist_dumb

Implements the Distutils 'bdist_dumb' command (create a "dumb" built
distribution -- i.e., just an archive to be unpacked under $prefix or
$exec_prefix).�N)�Command)�get_platform)�remove_tree�ensure_relative)�*)�get_python_version)�logc	@s^eZdZdZdddde�fdddd	d
ddg	Zd
ddgZddd�Zdd�Zdd�Z	dd�Z
dS)�
bdist_dumbz"create a "dumb" built distribution)z
bdist-dir=�dz1temporary directory for creating the distributionz
plat-name=�pz;platform name to embed in generated filenames (default: %s))zformat=�fz>archive format to create (tar, gztar, bztar, xztar, ztar, zip))�	keep-temp�kzPkeep the pseudo-installation tree around after creating the distribution archive)z	dist-dir=r
z-directory to put final built distributions in)�
skip-buildNz2skip rebuilding everything (for testing/debugging))�relativeNz7build the archive using relative paths (default: false))zowner=�uz@Owner name used when creating a tar file [default: current user])zgroup=�gzAGroup name used when creating a tar file [default: current group]r
rrZgztar�zip)�posix�ntcCs:d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr)	�	bdist_dir�	plat_name�format�	keep_temp�dist_dir�
skip_buildr�owner�group)�self�r�4/usr/lib64/python3.8/distutils/command/bdist_dumb.py�initialize_options2szbdist_dumb.initialize_optionscCsz|jdkr&|�d�j}tj�|d�|_|jdkrfz|jtj|_Wn"t	k
rdt
dtj��YnX|�dddd�dS)NZbdistZdumbz@don't know how to create dumb built distributions on platform %s)rr)rr)rr)rZget_finalized_command�
bdist_base�os�path�joinr�default_format�name�KeyError�DistutilsPlatformErrorZset_undefined_options)rr"rrr �finalize_options=s"

��
�zbdist_dumb.finalize_optionscCs(|js|�d�|jddd�}|j|_|j|_d|_t�d|j�|�d�d|j�	�|j
f}tj�
|j|�}|js~|j}nJ|j��r�|j|jkr�tdt|j�t|j�f��ntj�
|jt|j��}|j||j||j|jd	�}|j��r�t�}nd
}|jj�d||f�|j�s$t|j|jd�dS)
NZbuild�install�)Zreinit_subcommandsrzinstalling to %sz%s.%szScan't make a dumb built distribution where base and platbase are different (%s, %s))Zroot_dirrr�anyr	)�dry_run) rZrun_commandZreinitialize_commandr�rootZwarn_dirr�infoZdistributionZget_fullnamerr#r$r%rrZhas_ext_modulesZinstall_baseZinstall_platbaser)�reprrZmake_archiverrrrZ
dist_files�appendrrr.)rr+Zarchive_basenameZpseudoinstall_rootZarchive_root�filenameZ	pyversionrrr �runOsR


�

����
��
�zbdist_dumb.runN)�__name__�
__module__�__qualname__ZdescriptionrZuser_optionsZboolean_optionsr&r!r*r4rrrr r	s,���
�r	)�__doc__r#Zdistutils.corerZdistutils.utilrZdistutils.dir_utilrrZdistutils.errorsZdistutils.sysconfigrZ	distutilsrr	rrrr �<module>sdistutils/command/__pycache__/install_scripts.cpython-38.opt-2.pyc000064400000003731151153537440021237 0ustar00U

e5d��@s@ddlZddlmZddlmZddlmZGdd�de�ZdS)�N)�Command)�log)�ST_MODEc@sLeZdZdZddddgZddgZdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dS)�install_scriptsz%install scripts (Python or otherwise))zinstall-dir=�dzdirectory to install scripts to)z
build-dir=�bz'build directory (where to install from))�force�fz-force installation (overwrite existing files))�
skip-buildNzskip the build stepsrr
cCsd|_d|_d|_d|_dS)Nr)�install_dirr�	build_dir�
skip_build��self�r�9/usr/lib64/python3.8/distutils/command/install_scripts.py�initialize_optionssz"install_scripts.initialize_optionscCs |�dd�|�dddd�dS)NZbuild)�
build_scriptsrZinstall)rr)rr)r
r
)Zset_undefined_optionsrrrr�finalize_options!s�z install_scripts.finalize_optionscCs�|js|�d�|�|j|j�|_tjdkr~|��D]H}|j	rLt
�d|�q4t�|�t
dBd@}t
�d||�t�||�q4dS)Nr�posixzchanging mode of %simi�zchanging mode of %s to %o)r
Zrun_commandZ	copy_treerr�outfiles�os�name�get_outputsZdry_runr�info�statr�chmod)r�file�moderrr�run)s

zinstall_scripts.runcCs|jjp
gS�N)ZdistributionZscriptsrrrr�
get_inputs8szinstall_scripts.get_inputscCs
|jpgSr )rrrrrr;szinstall_scripts.get_outputsN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsrrrr!rrrrrrs�r)rZdistutils.corerZ	distutilsrrrrrrrr�<module>sdistutils/command/__pycache__/build_py.cpython-38.opt-1.pyc000064400000024271151153537440017632 0ustar00U

e5d&C�@szdZddlZddlZddlZddlZddlmZddlTddl	m
Z
mZddlm
Z
Gdd�de�ZGd	d
�d
ee�ZdS)zHdistutils.command.build_py

Implements the Distutils 'build_py' command.�N)�Command)�*)�convert_path�	Mixin2to3)�logc@s�eZdZdZdddddgZddgZd	diZd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd2d'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1S)3�build_pyz5"build" pure Python modules (copy to build directory))z
build-lib=�dzdirectory to "build" (copy) to)�compile�czcompile .py to .pyc)�
no-compileNz!don't compile .py files [default])z	optimize=�Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])�force�fz2forcibly build everything (ignore file timestamps)r	r
rcCs4d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr)�	build_lib�
py_modules�package�package_data�package_dirr	�optimizer
��self�r�2/usr/lib64/python3.8/distutils/command/build_py.py�initialize_options szbuild_py.initialize_optionsc	Cs�|�ddd�|jj|_|jj|_|jj|_i|_|jjr^|jj��D]\}}t|�|j|<qF|��|_	t
|jt�s�zt|j�|_Wn t
tfk
r�td��YnXdS)NZbuild)rr)r
r
zoptimize must be 0, 1, or 2)Zset_undefined_options�distribution�packagesrrr�itemsr�get_data_files�
data_files�
isinstancer�int�
ValueError�AssertionErrorZDistutilsOptionError)r�name�pathrrr�finalize_options*s$�



zbuild_py.finalize_optionscCs:|jr|��|jr$|��|��|�|jdd��dS�Nr)�include_bytecode)r�
build_modulesr�build_packages�build_package_data�byte_compile�get_outputsrrrr�runCszbuild_py.runcs�g}|js|S|jD]h}|�|�}tjj|jg|�d��}d�|rPt|�d��fdd�|�||�D�}|�	||||f�q|S)z?Generate list of '(package,src_dir,build_dir,filenames)' tuples�.r�csg|]}|�d��qS�Nr)�.0�file�Zplenrr�
<listcomp>ssz+build_py.get_data_files.<locals>.<listcomp>)
r�get_package_dir�osr$�joinr�split�len�find_data_files�append)r�datar�src_dir�	build_dir�	filenamesrr3rras



�zbuild_py.get_data_filescsd|j�dg�|j�|g�}g�|D]:}t�tj�t�|�t|���}���fdd�|D��q$�S)z6Return filenames for package's data files in 'src_dir'�cs$g|]}|�krtj�|�r|�qSr)r6r$�isfile)r1�fn��filesrrr4�s�z,build_py.find_data_files.<locals>.<listcomp>)	r�get�globr6r$r7�escaper�extend)rrr=Zglobs�patternZfilelistrrCrr:ys�zbuild_py.find_data_filescCs`d}|jD]P\}}}}|D]>}tj�||�}|�tj�|��|jtj�||�|dd�qq
dS)z$Copy data files into build directoryNF�Z
preserve_mode)rr6r$r7�mkpath�dirname�	copy_file)rZlastdirrr=r>r?�filename�targetrrrr*�s�zbuild_py.build_package_datacCs�|�d�}|js&|r tjj|�SdSn�g}|r�z|jd�|�}Wn*tk
rl|�d|d�|d=Yq*X|�d|�tjj|�Sq*|j�d�}|dk	r�|�d|�|r�tjj|�SdSdS)z�Return the directory, relative to the top of the source
           distribution, where package 'package' should be found
           (at least according to the 'package_dir' option, if any).r.r@r���N)r8rr6r$r7�KeyError�insertrE)rrr$�tailZpdirrrrr5�s(
	zbuild_py.get_package_dircCsj|dkr8tj�|�s td|��tj�|�s8td|��|rftj�|d�}tj�|�rZ|St�d|�dS)Nr@z%package directory '%s' does not existz>supposed package directory '%s' exists, but is not a directoryz__init__.pyz8package init file '%s' not found (or not a regular file))	r6r$�existsZDistutilsFileError�isdirr7rAr�warn)rrr�init_pyrrr�
check_package�s&����zbuild_py.check_packagecCs&tj�|�st�d||�dSdSdS)Nz!file %s (for module %s) not foundFT)r6r$rArrV)r�module�module_filerrr�check_module�szbuild_py.check_modulec	Cs�|�||�t�tj�t�|�d��}g}tj�|jj�}|D]P}tj�|�}||kr�tj�	tj�
|��d}|�|||f�q>|�d|�q>|S)Nz*.pyrzexcluding %s)
rXrFr6r$r7rG�abspathrZscript_name�splitext�basenamer;Zdebug_print)	rrrZmodule_files�modulesZsetup_scriptrZabs_frYrrr�find_package_modules�szbuild_py.find_package_modulesc	Cs�i}g}|jD]�}|�d�}d�|dd��}|d}z||\}}Wn"tk
rh|�|�}d}YnX|s�|�||�}	|df||<|	r�|�|d|	f�tj�||d�}
|�	||
�s�q|�|||
f�q|S)a�Finds individually-specified Python modules, ie. those listed by
        module name in 'self.py_modules'.  Returns a list of tuples (package,
        module_base, filename): 'package' is a tuple of the path through
        package-space to the module; 'module_base' is the bare (no
        packages, no dots) module name, and 'filename' is the path to the
        ".py" file (relative to the distribution root) that implements the
        module.
        r.rrPr/�__init__�.py)
rr8r7rQr5rXr;r6r$r[)rrr_rYr$rZmodule_baser�checkedrWrZrrr�find_modules�s*



zbuild_py.find_modulescCsNg}|jr|�|���|jrJ|jD]$}|�|�}|�||�}|�|�q$|S)a4Compute the list of all modules that will be built, whether
        they are specified one-module-at-a-time ('self.py_modules') or
        by whole packages ('self.packages').  Return a list of tuples
        (package, module, module_file), just like 'find_modules()' and
        'find_package_modules()' do.)rrHrdrr5r`)rr_rr�mrrr�find_all_moduless

zbuild_py.find_all_modulescCsdd�|��D�S)NcSsg|]}|d�qS)rPr)r1rYrrrr4-sz-build_py.get_source_files.<locals>.<listcomp>)rfrrrr�get_source_files,szbuild_py.get_source_filescCs$|gt|�|dg}tjj|�S)Nrb)�listr6r$r7)rr>rrYZoutfile_pathrrr�get_module_outfile/szbuild_py.get_module_outfiler/cCs�|��}g}|D]p\}}}|�d�}|�|j||�}|�|�|r|jr^|�tjj|dd��|j	dkr|�tjj||j	d��q|dd�|j
D�7}|S)Nr.r@)�optimizationrcSs,g|]$\}}}}|D]}tj�||��qqSr)r6r$r7)r1rr=r>r?rNrrrr4Bs
�z(build_py.get_outputs.<locals>.<listcomp>)rfr8rirr;r	�	importlib�util�cache_from_sourcerr)rr'r_ZoutputsrrYrZrNrrrr,3s*


�

�
�zbuild_py.get_outputscCsbt|t�r|�d�}nt|ttf�s,td��|�|j||�}tj	�
|�}|�|�|j||dd�S)Nr.z:'package' must be a string (dot-separated), list, or tuplerrJ)
r�strr8rh�tuple�	TypeErrorrirr6r$rLrKrM)rrYrZrZoutfile�dirrrr�build_moduleJs
�
zbuild_py.build_modulecCs*|��}|D]\}}}|�|||�qdSr0)rdrr)rr_rrYrZrrrr(Yszbuild_py.build_modulescCsD|jD]8}|�|�}|�||�}|D]\}}}|�|||�q$qdSr0)rr5r`rr)rrrr_Zpackage_rYrZrrrr)bs



zbuild_py.build_packagescCs�tjr|�d�dSddlm}|j}|dtjkr>|tj}|jrZ||d|j	||j
d�|jdkr||||j|j	||j
d�dS)Nz%byte-compiling is disabled, skipping.r)r+rP)rr
�prefix�dry_run)�sys�dont_write_bytecoderV�distutils.utilr+rr6�sepr	r
rtr)rrDr+rsrrrr+vs&

�
�zbuild_py.byte_compileN)r/)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsZnegative_optrr%r-rr:r*r5rXr[r`rdrfrgrir,rrr(r)r+rrrrrs8�



'4
	rc@seZdZdd�Zdd�ZdS)�
build_py_2to3cCsLg|_|jr|��|jr*|��|��|�|j�|�|jdd��dSr&)	�
updated_filesrr(rr)r*Zrun_2to3r+r,rrrrr-�szbuild_py_2to3.runcCs,t�||||�}|dr(|j�|d�|S)Nr/r)rrrr}r;)rrYrZr�resrrrrr�szbuild_py_2to3.build_moduleN)ryrzr{r-rrrrrrr|�sr|)�__doc__r6�importlib.utilrkrurFZdistutils.corerZdistutils.errorsrwrrZ	distutilsrrr|rrrr�<module>s}distutils/command/__pycache__/sdist.cpython-38.opt-2.pyc000064400000025627151153537440017160 0ustar00U

e5d=J�@s�ddlZddlZddlmZddlmZddlmZddlmZddlm	Z	ddlm
Z
ddlmZdd	l
mZdd
lmZddlmZddlmZmZd
d�ZGdd�de�ZdS)�N)�glob)�warn)�Command)�dir_util)�	file_util)�archive_util)�TextFile)�FileList)�log)�convert_path)�DistutilsTemplateError�DistutilsOptionErrorcCs`ddlm}ddlm}g}|��D] }|�d|d||df�q$|��||��d�dS)Nr)�FancyGetopt)�ARCHIVE_FORMATS�formats=�z.List of available source distribution formats:)Zdistutils.fancy_getoptrZdistutils.archive_utilr�keys�append�sortZ
print_help)rr�formats�format�r�//usr/lib64/python3.8/distutils/command/sdist.py�show_formatss
��rc@s"eZdZdZdd�Zdddddd	d
ddd
ddddgZddddddgZdddefgZddd�Z	defgZ
dZdd�Zd d!�Z
d"d#�Zd$d%�Zd&d'�Zd(d)�Zed*d+��Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Zd<d=�Zd>d?�Zd@dA�ZdBdC�ZdDdE�Z dFdG�Z!dHdI�Z"dS)J�sdistz6create a source distribution (tarball, zip file, etc.)cCs|jS�N)�metadata_check��selfrrr�checking_metadata(szsdist.checking_metadata)z	template=�tz5name of manifest template file [default: MANIFEST.in])z	manifest=�mz)name of manifest file [default: MANIFEST])�use-defaultsNzRinclude the default file set in the manifest [default; disable with --no-defaults])�no-defaultsNz"don't include the default file set)�pruneNz�specifically exclude files/directories that should not be distributed (build tree, RCS/CVS dirs, etc.) [default; disable with --no-prune])�no-pruneNz$don't automatically exclude anything)�
manifest-only�ozEjust regenerate the manifest and then stop (implies --force-manifest))�force-manifest�fzkforcibly regenerate the manifest and carry on as usual. Deprecated: now the manifest is always regenerated.)rNz6formats for source distribution (comma-separated list))�	keep-temp�kz@keep the distribution tree around after creating archive file(s))z	dist-dir=�dzFdirectory to put the source distribution archive(s) in [default: dist])�metadata-checkNz[Ensure that all required elements of meta-data are supplied. Warn if any missing. [default])zowner=�uz@Owner name used when creating a tar file [default: current user])zgroup=�gzAGroup name used when creating a tar file [default: current group]r"r$r&r(r*r-zhelp-formatsNz#list available distribution formats)r#r%�check)ZREADMEz
README.txtz
README.rstcCsTd|_d|_d|_d|_d|_d|_dg|_d|_d|_d|_	d|_
d|_d|_dS)N�rZgztar)
�template�manifest�use_defaultsr$�
manifest_onlyZforce_manifestr�	keep_temp�dist_dir�
archive_filesr�owner�grouprrrr�initialize_optionseszsdist.initialize_optionscCsZ|jdkrd|_|jdkr d|_|�d�t�|j�}|rFtd|��|jdkrVd|_dS)NZMANIFESTzMANIFEST.inrzunknown archive format '%s'Zdist)r3r2Zensure_string_listrZcheck_archive_formatsrr
r7)rZ
bad_formatrrr�finalize_options|s


�
zsdist.finalize_optionscCs>t�|_|��D]}|�|�q|��|jr2dS|��dSr)r	�filelistZget_sub_commandsZrun_command�
get_file_listr5�make_distribution)rZcmd_namerrr�run�sz	sdist.runcCs*tdt�|j�d�}|��|��dS)Nzadistutils.command.sdist.check_metadata is deprecated,               use the check command insteadr0)r�PendingDeprecationWarning�distributionZget_command_objZensure_finalizedr@)rr0rrr�check_metadata�s�zsdist.check_metadatacCs�tj�|j�}|s:|��r:|��|j��|j��dS|sN|�	d|j�|j�
�|jrf|��|rr|�
�|jr�|��|j��|j��|��dS)Nz?manifest template '%s' does not exist (using default file list))�os�path�isfiler2�_manifest_is_not_generated�
read_manifestr=rZremove_duplicatesr�findallr4�add_defaults�
read_templater$�prune_file_list�write_manifest)rZtemplate_existsrrrr>�s(

�


zsdist.get_file_listcCs<|��|��|��|��|��|��|��dSr)�_add_defaults_standards�_add_defaults_optional�_add_defaults_python�_add_defaults_data_files�_add_defaults_ext�_add_defaults_c_libs�_add_defaults_scriptsrrrrrJ�szsdist.add_defaultscCs:tj�|�sdStj�|�}tj�|�\}}|t�|�kS)NF)rDrE�exists�abspath�split�listdir)�fspathrVZ	directory�filenamerrr�_cs_path_exists�s

zsdist._cs_path_existscCs�|j|jjg}|D]~}t|t�rj|}d}|D]"}|�|�r,d}|j�|�qPq,|s�|�dd�	|��q|�|�r�|j�|�q|�d|�qdS)NFTz,standard file not found: should have one of z, zstandard file '%s' not found)
�READMESrBZscript_name�
isinstance�tupler[r=rr�join)rZ	standards�fnZaltsZgot_itrrrrN�s"

�
zsdist._add_defaults_standardscCs4ddg}|D]"}ttjjt|��}|j�|�qdS)Nz
test/test*.pyz	setup.cfg)�filterrDrErFrr=�extend)rZoptional�pattern�filesrrrrOszsdist._add_defaults_optionalcCs\|�d�}|j��r$|j�|���|jD],\}}}}|D]}|j�tj	�
||��q:q*dS)N�build_py)�get_finalized_commandrBZhas_pure_modulesr=rb�get_source_files�
data_filesrrDrEr_)rreZpkgZsrc_dirZ	build_dir�	filenamesrZrrrrPs

zsdist._add_defaults_pythoncCsz|j��rv|jjD]b}t|t�rBt|�}tj�|�rt|j	�
|�q|\}}|D]$}t|�}tj�|�rN|j	�
|�qNqdSr)rBZhas_data_filesrhr]�strrrDrErFr=r)r�item�dirnamerir)rrrrQ$s

zsdist._add_defaults_data_filescCs(|j��r$|�d�}|j�|���dS)N�	build_ext)rBZhas_ext_modulesrfr=rbrg)rrmrrrrR5s

zsdist._add_defaults_extcCs(|j��r$|�d�}|j�|���dS)N�
build_clib)rBZhas_c_librariesrfr=rbrg)rrnrrrrS:s

zsdist._add_defaults_c_libscCs(|j��r$|�d�}|j�|���dS)N�
build_scripts)rBZhas_scriptsrfr=rbrg)rrorrrrT?s

zsdist._add_defaults_scriptsc
Cs�t�d|j�t|jddddddd�}zh|��}|dkr:q�z|j�|�Wq(tt	fk
r�}z|�
d|j|j|f�W5d}~XYq(Xq(W5|��XdS)Nzreading manifest template '%s'r1)Zstrip_commentsZskip_blanksZ
join_linesZ	lstrip_wsZ	rstrip_wsZ
collapse_joinz%s, line %d: %s)
r
�infor2r�close�readliner=Zprocess_template_liner�
ValueErrorrrZZcurrent_line)rr2�line�msgrrrrKDs&
�
� zsdist.read_templatecCs�|�d�}|j��}|jjd|jd�|jjd|d�tjdkrFd}nd}dddd	d
ddg}d
|d�|�|f}|jj|dd�dS)N�build)�prefixZwin32z/|\\�/ZRCSZCVSz\.svnz\.hgz\.gitz\.bzrZ_darcsz(^|%s)(%s)(%s).*�|r1)Zis_regex)	rfrB�get_fullnamer=Zexclude_patternZ
build_base�sys�platformr_)rrv�base_dirZsepsZvcs_dirsZvcs_ptrnrrrrLas


�zsdist.prune_file_listcCsX|��rt�d|j�dS|jjdd�}|�dd�|�tj	|j|fd|j�dS)Nz5not writing to manually maintained manifest file '%s'rz*# file GENERATED by distutils, do NOT editzwriting manifest file '%s')
rGr
rpr3r=rd�insertZexecuterZ
write_file)rZcontentrrrrMys��zsdist.write_manifestcCs<tj�|j�sdSt|j�}z|��}W5|��X|dkS)NFz+# file GENERATED by distutils, do NOT edit
)rDrErFr3�openrqrr)r�fpZ
first_linerrrrG�s

z sdist._manifest_is_not_generatedc	CsVt�d|j�t|j��4}|D](}|��}|�d�s|s:q|j�|�qW5QRXdS)Nzreading manifest file '%s'�#)r
rpr3r�strip�
startswithr=r)rr3rtrrrrH�szsdist.read_manifestcCs�|�|�tj|||jd�ttd�r4d}d|}nd}d|}|sPt�d�n
t�|�|D]<}tj	�
|�s|t�d|�q^tj	�||�}|j|||d�q^|j
j�|�dS)	N��dry_run�linkZhardzmaking hard links in %s...zcopying files to %s...z)no files to distribute -- empty manifest?z#'%s' not a regular file -- skipping)r�)ZmkpathrZcreate_treer��hasattrrDr
rrprErFr_Z	copy_filerBZmetadataZwrite_pkg_info)rr}rdr�ru�file�destrrr�make_release_tree�s 
	


zsdist.make_release_treecCs�|j��}tj�|j|�}|�||jj�g}d|j	krT|j	�
|j	�|j	�d���|j	D]:}|j
||||j|jd�}|�
|�|jj�
dd|f�qZ||_|js�tj||jd�dS)NZtar)r}r9r:r�r�)rBrzrDrEr_r7r�r=rdrr�pop�indexZmake_archiver9r:Z
dist_filesr8r6rZremove_treer�)rr}Z	base_namer8Zfmtr�rrrr?�s 




�
zsdist.make_distributioncCs|jSr)r8rrrr�get_archive_files�szsdist.get_archive_files)#�__name__�
__module__�__qualname__ZdescriptionrZuser_optionsZboolean_optionsrZhelp_optionsZnegative_optZsub_commandsr\r;r<r@rCr>rJ�staticmethodr[rNrOrPrQrRrSrTrKrLrMrGrHr�r?r�rrrrr$sp�'����
(
*r)rDr{r�warningsrZdistutils.corerZ	distutilsrrrZdistutils.text_filerZdistutils.filelistr	r
Zdistutils.utilrZdistutils.errorsrr
rrrrrr�<module>sdistutils/command/__pycache__/install.cpython-38.opt-1.pyc000064400000032663151153537440017475 0ustar00U

&�.e�j�@sdZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZdd	lmZmZmZdd
lmZddlmZddlmZdd
lmZdZdddddd�Zdddddd�dddddd�ed�Ze�rdddddd�ed <ddd!d"dd�ed#<dZGd$d%�d%e�ZdS)&zFdistutils.command.install

Implements the Distutils 'install' command.�N)�log)�Command)�DEBUG)�get_config_vars)�DistutilsPlatformError)�
write_file)�convert_path�
subst_vars�change_root)�get_platform)�DistutilsOptionError)�	USER_BASE)�	USER_SITETz$base/Lib/site-packagesz$base/Include/$dist_namez
$base/Scriptsz$base)�purelib�platlib�headers�scripts�dataz/$base/lib/python$py_version_short/site-packagesz5$platbase/lib64/python$py_version_short/site-packagesz9$base/include/python$py_version_short$abiflags/$dist_namez	$base/binz$base/lib/pythonz$base/lib64/pythonz$base/include/python/$dist_name)�unix_prefix�	unix_home�ntz	$usersitez4$userbase/Python$py_version_nodot/Include/$dist_namez)$userbase/Python$py_version_nodot/Scriptsz	$userbaseZnt_userz=$userbase/include/python$py_version_short$abiflags/$dist_namez
$userbase/bin�	unix_userc@s:eZdZdZdddddddd	d
ddd
ddddddgZdddgZer`e�dddef�e�d�ddiZ	dd�Z
dd�Zdd �Zd!d"�Z
d#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Zd=d>�Zd?d@�ZdAdB�ZdCdD�ZdEefdFefdGefdHefdIdJdK�fgZdS)L�installz'install everything from build directory)zprefix=Nzinstallation prefix)zexec-prefix=Nz.(Unix only) prefix for platform-specific files)zhome=Nz+(Unix only) home directory to install under)z
install-base=Nz;base installation directory (instead of --prefix or --home))zinstall-platbase=Nz\base installation directory for platform-specific files (instead of --exec-prefix or --home))zroot=Nz<install everything relative to this alternate root directory)zinstall-purelib=Nz;installation directory for pure Python module distributions)zinstall-platlib=Nz8installation directory for non-pure module distributions)zinstall-lib=Nzginstallation directory for all module distributions (overrides --install-purelib and --install-platlib))zinstall-headers=Nz(installation directory for C/C++ headers)zinstall-scripts=Nz)installation directory for Python scripts)z
install-data=Nz%installation directory for data files)�compile�czcompile .py to .pyc [default])�
no-compileNzdon't compile .py files)z	optimize=�Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])�force�fz1force installation (overwrite any existing files))�
skip-buildNz2skip rebuilding everything (for testing/debugging))zrecord=Nz3filename in which to record list of installed filesrrr�userNz!install in user site-package '%s'rcCs�d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_t
|_t|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)zInitializes options.Nr�)�prefix�exec_prefix�homer �install_base�install_platbase�root�install_purelib�install_platlib�install_headers�install_lib�install_scripts�install_datar
�install_userbaser�install_usersiter�optimize�
extra_path�install_path_filer�
skip_build�warn_dir�
build_base�	build_lib�record��self�r:�1/usr/lib64/python3.8/distutils/command/install.py�initialize_options�s2zinstall.initialize_optionscCsx|js|js|jr&|js|jr&td��|jr@|js8|jr@td��|jrl|jsd|jsd|jsd|jsd|jrltd��tjdkr�|jr�|�	d�d|_|�
d�tjdkr�|��n|��|�
d�t
j��d	}td
d�\}}z
t
j}Wntk
r�d}YnX|j��|j��|j��|d
t
jdd�dt
jdd�|||||d�|_t�rf|j|jd<|j|jd<|��|�
d�|j|jd<|j|jd<t�r�d	dlm}td�||j�|� �|�
d�|j�r�|�!�|j"dk�r�|jj#�r�|j$|_"n|j%|_"|�&dddddddd�|�'�|j"|_(tj)�*|j"|j+�|_"|j,dk	�r\|�-ddddddd�|�
d �|�.d!d"d#�dS)$zFinalizes options.zWmust supply either prefix/exec-prefix/home or install-base/install-platbase -- not bothz9must supply either home or prefix/exec-prefix -- not bothzGcan't combine user with prefix, exec_prefix/home, or install_(plat)base�posixz+exec-prefix option ignored on this platformNzpre-finalize_{unix,other}zpost-finalize_{unix,other}()rr"r#�z%d.%d�z%d%d)Z	dist_nameZdist_versionZ
dist_fullname�
py_versionZpy_version_shortZpy_version_nodotZ
sys_prefixr"Zsys_exec_prefixr#�abiflags�userbaseZusersitezpost-expand_basedirs()�baseZplatbase)�pprintzconfig vars:zpost-expand_dirs()�librrrrrZlibbasezafter prepending root�build)r5r5)r6r6)/r"r#r$r%r&rr �os�name�warn�	dump_dirs�
finalize_unix�finalize_other�sys�version�splitrrA�AttributeError�distributionZget_nameZget_versionZget_fullname�version_info�config_vars�
HAS_USER_SITEr.r/�expand_basedirsrrD�print�expand_dirs�create_home_pathr+Zext_modulesr)r(�
convert_paths�handle_extra_path�install_libbase�path�join�
extra_dirsr'�change_rootsZset_undefined_options)r9r@r"r#rArDr:r:r;�finalize_options�s�������








�






�	�
�zinstall.finalize_optionscCs�tsdSddlm}t�|d�|jD]r}|d}|ddkrL|dd�}||jkrx|j|}|�|�}t||�}n|�|�}t||�}t�d||�q(dS)zDumps the list of user options.Nr)�
longopt_xlate�:����=z  %s: %s)	rZdistutils.fancy_getoptrar�debug�user_options�negative_opt�	translate�getattr)r9�msgra�optZopt_name�valr:r:r;rJus





zinstall.dump_dirscCsV|jdk	s|jdk	r\|jdkr2|jdkr2|jdksP|jdksP|jdksP|jdkrXtd��dS|j	r�|j
dkrttd��|j
|_|_|�d�n�|j
dk	r�|j
|_|_|�d�n�|jdk�r$|jdk	r�td��ttd�s�tjtjks�dtjkr�d	}nd
}tj�tj�||_tj�tj�||_n|jdk�r8|j|_|j|_|j|_|�d�dS)z&Finalizes options for posix platforms.NzPinstall-base or install-platbase supplied, but installation scheme is incomplete�$User base directory is not specifiedrrz*must not supply exec-prefix without prefixZreal_prefix�RPM_BUILD_ROOTz/localr>r)r%r&r+r(r)r*r,r-rr r.r�
select_schemer$r"r#�hasattrrM�base_prefixrG�environr\�normpath)r9Zadditionr:r:r;rK�sZ
������
�

�

��zinstall.finalize_unixcCs�|jr8|jdkrtd��|j|_|_|�tjd�n�|jdk	r\|j|_|_|�d�n\|j	dkrvtj
�tj	�|_	|j	|_|_z|�tj�Wn"t
k
r�tdtj��YnXdS)z)Finalizes options for non-posix platformsNrmZ_userrz)I don't know how to install stuff on '%s')r r.rr%r&rorGrHr$r"r\rsrM�KeyErrorr8r:r:r;rL�s&
�

�zinstall.finalize_othercCs<t|}tD]*}d|}t||�dkrt||||�qdS)z=Sets the install directories by applying the install schemes.�install_N)�INSTALL_SCHEMES�SCHEME_KEYSri�setattr)r9rHZscheme�key�attrnamer:r:r;ro�s
zinstall.select_schemecCsX|D]N}t||�}|dk	rtjdks.tjdkr:tj�|�}t||j�}t|||�qdS)Nr=r)rirGrHr\�
expanduserr	rSrx)r9�attrs�attrrlr:r:r;�
_expand_attrs�s
zinstall._expand_attrscCs|�dddg�dS)zNCalls `os.path.expanduser` on install_base, install_platbase and
        root.r%r&r'N�r~r8r:r:r;rU�szinstall.expand_basedirscCs|�ddddddg�dS)z+Calls `os.path.expanduser` on install dirs.r(r)r+r*r,r-Nrr8r:r:r;rW�s�zinstall.expand_dirscGs,|D]"}d|}t||tt||���qdS)z!Call `convert_path` over `names`.ruN)rxrri�r9�namesrHr}r:r:r;rY�szinstall.convert_pathscCs�|jdkr|jj|_|jdk	r�t�d�t|jt�rB|j�d�|_t|j�dkr`|jd}}n"t|j�dkrz|j\}}ntd��t	|�}nd}d}||_
||_dS)	z4Set `path_file` and `extra_dirs` using `extra_path`.NzIDistribution option extra_path is deprecated. See issue27919 for details.�,r!rr?zY'extra_path' option must be a list, tuple, or comma-separated string with 1 or 2 elementsr>)r1rQrrI�
isinstance�strrO�lenrr�	path_filer^)r9r�r^r:r:r;rZ�s(


��
zinstall.handle_extra_pathc	Gs0|D]&}d|}t||t|jt||���qdS)z:Change the install directories pointed by name using root.ruN)rxr
r'rir�r:r:r;r_szinstall.change_rootscCsb|js
dSttj�d��}|j��D]8\}}|�|�r$tj�|�s$|�	d|�t�
|d�q$dS)zCreate directories under ~.N�~zos.makedirs('%s', 0o700)i�)r rrGr\r{rS�items�
startswith�isdirZdebug_print�makedirs)r9r$rHr\r:r:r;rXszinstall.create_home_pathcCs"|js6|�d�|j�d�j}|jr6|t�kr6td��|��D]}|�|�q>|j	r\|�
�|jr�|��}|j
r�t|j
�}tt|��D]}|||d�||<q�|�t|j|fd|j�ttjjtj�}ttjj|�}tj�tj�|j��}|j�r|j	�r|j�s||k�rt�d|j�dS)zRuns the command.rFz"Can't install when cross-compilingNz'writing list of installed files to '%s'z�modules installed to '%s', which is not in Python's module search path (sys.path) -- you'll have to change the search path yourself)r3Zrun_commandrQZget_command_objZ	plat_namer4rr�get_sub_commandsr��create_path_filer7�get_outputsr'r��range�executer�maprGr\rsrM�normcaser+r2rre)r9Z
build_plat�cmd_name�outputsZroot_lenZcounterZsys_pathr+r:r:r;�run(sD

������zinstall.runcCsJtj�|j|jd�}|jr8|�t||jgfd|�n|�	d|�dS)zCreates the .pth file�.pthzcreating %szpath file '%s' not createdN)
rGr\r]r[r�r2r�rr^rI)r9�filenamer:r:r;r�Ts
�
�zinstall.create_path_filecCshg}|��D].}|�|�}|��D]}||kr"|�|�q"q|jrd|jrd|�tj�|j	|jd��|S)z.Assembles the outputs of all the sub-commands.r�)
r��get_finalized_commandr��appendr�r2rGr\r]r[)r9r�r��cmdr�r:r:r;r�bs
�zinstall.get_outputscCs.g}|��D]}|�|�}|�|���q|S)z*Returns the inputs of all the sub-commands)r�r��extend�
get_inputs)r9Zinputsr�r�r:r:r;r�ss

zinstall.get_inputscCs|j��p|j��S)zSReturns true if the current distribution has any Python
        modules to install.)rQZhas_pure_modulesZhas_ext_modulesr8r:r:r;�has_libs
�zinstall.has_libcCs
|j��S)zLReturns true if the current distribution has any headers to
        install.)rQ�has_headersr8r:r:r;r��szinstall.has_headerscCs
|j��S)zMReturns true if the current distribution has any scripts to.
        install.)rQ�has_scriptsr8r:r:r;r��szinstall.has_scriptscCs
|j��S)zJReturns true if the current distribution has any data to.
        install.)rQZhas_data_filesr8r:r:r;�has_data�szinstall.has_datar+r*r,r-Zinstall_egg_infocCsdS)NTr:r8r:r:r;�<lambda>��zinstall.<lambda>) �__name__�
__module__�__qualname__ZdescriptionrfZboolean_optionsrTr�rrgr<r`rJrKrLror~rUrWrYrZr_rXr�r�r�r�r�r�r�r�Zsub_commandsr:r:r:r;rIsn	�;
�
N3		",
�r)�__doc__rMrGZ	distutilsrZdistutils.corerZdistutils.debugrZdistutils.sysconfigrZdistutils.errorsrZdistutils.file_utilrZdistutils.utilrr	r
rrZsiter
rrTZWINDOWS_SCHEMErvrwrr:r:r:r;�<module>sb�
����
	�
distutils/command/__pycache__/build_py.cpython-38.opt-2.pyc000064400000022002151153537440017621 0ustar00U

e5d&C�@svddlZddlZddlZddlZddlmZddlTddlm	Z	m
Z
ddlmZGdd�de�Z
Gdd	�d	e
e
�ZdS)
�N)�Command)�*)�convert_path�	Mixin2to3)�logc@s�eZdZdZdddddgZddgZd	diZd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd2d'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1S)3�build_pyz5"build" pure Python modules (copy to build directory))z
build-lib=�dzdirectory to "build" (copy) to)�compile�czcompile .py to .pyc)�
no-compileNz!don't compile .py files [default])z	optimize=�Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])�force�fz2forcibly build everything (ignore file timestamps)r	r
rcCs4d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr)�	build_lib�
py_modules�package�package_data�package_dirr	�optimizer
��self�r�2/usr/lib64/python3.8/distutils/command/build_py.py�initialize_options szbuild_py.initialize_optionsc	Cs�|�ddd�|jj|_|jj|_|jj|_i|_|jjr^|jj��D]\}}t|�|j|<qF|��|_	t
|jt�s�zt|j�|_Wn t
tfk
r�td��YnXdS)NZbuild)rr)r
r
zoptimize must be 0, 1, or 2)Zset_undefined_options�distribution�packagesrrr�itemsr�get_data_files�
data_files�
isinstancer�int�
ValueError�AssertionErrorZDistutilsOptionError)r�name�pathrrr�finalize_options*s$�



zbuild_py.finalize_optionscCs:|jr|��|jr$|��|��|�|jdd��dS�Nr)�include_bytecode)r�
build_modulesr�build_packages�build_package_data�byte_compile�get_outputsrrrr�runCszbuild_py.runcs�g}|js|S|jD]h}|�|�}tjj|jg|�d��}d�|rPt|�d��fdd�|�||�D�}|�	||||f�q|S)N�.r�csg|]}|�d��qS�Nr)�.0�file�Zplenrr�
<listcomp>ssz+build_py.get_data_files.<locals>.<listcomp>)
r�get_package_dir�osr$�joinr�split�len�find_data_files�append)r�datar�src_dir�	build_dir�	filenamesrr3rras



�zbuild_py.get_data_filescsd|j�dg�|j�|g�}g�|D]:}t�tj�t�|�t|���}���fdd�|D��q$�S)N�cs$g|]}|�krtj�|�r|�qSr)r6r$�isfile)r1�fn��filesrrr4�s�z,build_py.find_data_files.<locals>.<listcomp>)	r�get�globr6r$r7�escaper�extend)rrr=Zglobs�patternZfilelistrrCrr:ys�zbuild_py.find_data_filescCs`d}|jD]P\}}}}|D]>}tj�||�}|�tj�|��|jtj�||�|dd�qq
dS)NF�Z
preserve_mode)rr6r$r7�mkpath�dirname�	copy_file)rZlastdirrr=r>r?�filename�targetrrrr*�s�zbuild_py.build_package_datacCs�|�d�}|js&|r tjj|�SdSn�g}|r�z|jd�|�}Wn*tk
rl|�d|d�|d=Yq*X|�d|�tjj|�Sq*|j�d�}|dk	r�|�d|�|r�tjj|�SdSdS)Nr.r@r���)r8rr6r$r7�KeyError�insertrE)rrr$�tailZpdirrrrr5�s(
	zbuild_py.get_package_dircCsj|dkr8tj�|�s td|��tj�|�s8td|��|rftj�|d�}tj�|�rZ|St�d|�dS)Nr@z%package directory '%s' does not existz>supposed package directory '%s' exists, but is not a directoryz__init__.pyz8package init file '%s' not found (or not a regular file))	r6r$�existsZDistutilsFileError�isdirr7rAr�warn)rrr�init_pyrrr�
check_package�s&����zbuild_py.check_packagecCs&tj�|�st�d||�dSdSdS)Nz!file %s (for module %s) not foundFT)r6r$rArrV)r�module�module_filerrr�check_module�szbuild_py.check_modulec	Cs�|�||�t�tj�t�|�d��}g}tj�|jj�}|D]P}tj�|�}||kr�tj�	tj�
|��d}|�|||f�q>|�d|�q>|S)Nz*.pyrzexcluding %s)
rXrFr6r$r7rG�abspathrZscript_name�splitext�basenamer;Zdebug_print)	rrrZmodule_files�modulesZsetup_scriptrZabs_frYrrr�find_package_modules�szbuild_py.find_package_modulesc	Cs�i}g}|jD]�}|�d�}d�|dd��}|d}z||\}}Wn"tk
rh|�|�}d}YnX|s�|�||�}	|df||<|	r�|�|d|	f�tj�||d�}
|�	||
�s�q|�|||
f�q|S)Nr.rrPr/�__init__�.py)
rr8r7rQr5rXr;r6r$r[)rrr_rYr$rZmodule_baser�checkedrWrZrrr�find_modules�s*



zbuild_py.find_modulescCsNg}|jr|�|���|jrJ|jD]$}|�|�}|�||�}|�|�q$|Sr0)rrHrdrr5r`)rr_rr�mrrr�find_all_moduless

zbuild_py.find_all_modulescCsdd�|��D�S)NcSsg|]}|d�qS)rPr)r1rYrrrr4-sz-build_py.get_source_files.<locals>.<listcomp>)rfrrrr�get_source_files,szbuild_py.get_source_filescCs$|gt|�|dg}tjj|�S)Nrb)�listr6r$r7)rr>rrYZoutfile_pathrrr�get_module_outfile/szbuild_py.get_module_outfiler/cCs�|��}g}|D]p\}}}|�d�}|�|j||�}|�|�|r|jr^|�tjj|dd��|j	dkr|�tjj||j	d��q|dd�|j
D�7}|S)Nr.r@)�optimizationrcSs,g|]$\}}}}|D]}tj�||��qqSr)r6r$r7)r1rr=r>r?rNrrrr4Bs
�z(build_py.get_outputs.<locals>.<listcomp>)rfr8rirr;r	�	importlib�util�cache_from_sourcerr)rr'r_ZoutputsrrYrZrNrrrr,3s*


�

�
�zbuild_py.get_outputscCsbt|t�r|�d�}nt|ttf�s,td��|�|j||�}tj	�
|�}|�|�|j||dd�S)Nr.z:'package' must be a string (dot-separated), list, or tuplerrJ)
r�strr8rh�tuple�	TypeErrorrirr6r$rLrKrM)rrYrZrZoutfile�dirrrr�build_moduleJs
�
zbuild_py.build_modulecCs*|��}|D]\}}}|�|||�qdSr0)rdrr)rr_rrYrZrrrr(Yszbuild_py.build_modulescCsD|jD]8}|�|�}|�||�}|D]\}}}|�|||�q$qdSr0)rr5r`rr)rrrr_Zpackage_rYrZrrrr)bs



zbuild_py.build_packagescCs�tjr|�d�dSddlm}|j}|dtjkr>|tj}|jrZ||d|j	||j
d�|jdkr||||j|j	||j
d�dS)Nz%byte-compiling is disabled, skipping.r)r+rP)rr
�prefix�dry_run)�sys�dont_write_bytecoderV�distutils.utilr+rr6�sepr	r
rtr)rrDr+rsrrrr+vs&

�
�zbuild_py.byte_compileN)r/)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsZnegative_optrr%r-rr:r*r5rXr[r`rdrfrgrir,rrr(r)r+rrrrrs8�



'4
	rc@seZdZdd�Zdd�ZdS)�
build_py_2to3cCsLg|_|jr|��|jr*|��|��|�|j�|�|jdd��dSr&)	�
updated_filesrr(rr)r*Zrun_2to3r+r,rrrrr-�szbuild_py_2to3.runcCs,t�||||�}|dr(|j�|d�|S)Nr/r)rrrr}r;)rrYrZr�resrrrrr�szbuild_py_2to3.build_moduleN)ryrzr{r-rrrrrrr|�sr|)r6�importlib.utilrkrurFZdistutils.corerZdistutils.errorsrwrrZ	distutilsrrr|rrrr�<module>s}distutils/command/__pycache__/build.cpython-38.pyc000064400000007453151153537440016166 0ustar00U

e5d��@sTdZddlZddlZddlmZddlmZddlmZdd�Z	Gdd	�d	e�Z
dS)
zBdistutils.command.build

Implements the Distutils 'build' command.�N)�Command)�DistutilsOptionError)�get_platformcCsddlm}|�dS)Nr��show_compilers)Zdistutils.ccompilerrr�r�//usr/lib64/python3.8/distutils/command/build.pyrsrc@s�eZdZdZdddddddd	d
e�fddd
ddgZddgZdddefgZdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd �Zd!d"�Zd#efd$e
fd%efd&efgZdS)'�buildz"build everything needed to install)zbuild-base=�bz base directory for build library)zbuild-purelib=Nz2build directory for platform-neutral distributions)zbuild-platlib=Nz3build directory for platform-specific distributions)z
build-lib=NzWbuild directory for all distribution (defaults to either build-purelib or build-platlib)zbuild-scripts=Nzbuild directory for scripts)zbuild-temp=�tztemporary build directoryz
plat-name=�pz6platform name to build for, if supported (default: %s))z	compiler=�czspecify the compiler type)z	parallel=�jznumber of parallel build jobs)�debug�gz;compile extensions and libraries with debugging information)�force�fz2forcibly build everything (ignore file timestamps))zexecutable=�ez5specify final destination interpreter path (build.py)rrz
help-compilerNzlist available compilerscCsLd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_dS)Nr	r)�
build_base�
build_purelib�
build_platlib�	build_lib�
build_temp�
build_scriptsZcompiler�	plat_namerr�
executable�parallel��selfrrr�initialize_options8szbuild.initialize_optionscCsb|jdkrt�|_ntjdkr&td��d|jftjdd��}ttd�rR|d7}|jdkrntj	�
|jd�|_|jdkr�tj	�
|jd|�|_|j
dkr�|jjr�|j|_
n|j|_
|jdkr�tj	�
|jd|�|_|jdkr�tj	�
|jd	tjdd��|_|jdk�r tj�r tj	�tj�|_t|jt��r^zt|j�|_Wntk
�r\td
��YnXdS)N�ntzW--plat-name only supported on Windows (try using './configure --help' on your platform)z	.%s-%d.%d�Zgettotalrefcountz-pydebug�libZtempz
scripts-%d.%dzparallel should be an integer)rr�os�namer�sys�version_info�hasattrr�path�joinrrr�distributionZext_modulesrrr�normpath�
isinstancer�str�int�
ValueError)rZplat_specifierrrr�finalize_optionsHsD


�



�



�

�zbuild.finalize_optionscCs|��D]}|�|�qdS�N)Zget_sub_commandsZrun_command)rZcmd_namerrr�run�sz	build.runcCs
|j��Sr1)r*�has_pure_modulesrrrrr3�szbuild.has_pure_modulescCs
|j��Sr1)r*�has_c_librariesrrrrr4�szbuild.has_c_librariescCs
|j��Sr1)r*�has_ext_modulesrrrrr5�szbuild.has_ext_modulescCs
|j��Sr1)r*�has_scriptsrrrrr6�szbuild.has_scriptsZbuild_pyZ
build_clibZ	build_extr)�__name__�
__module__�__qualname__ZdescriptionrZuser_optionsZboolean_optionsrZhelp_optionsrr0r2r3r4r5r6Zsub_commandsrrrrr	sH�����8�r	)�__doc__r%r#Zdistutils.corerZdistutils.errorsrZdistutils.utilrrr	rrrr�<module>sdistutils/command/__pycache__/install.cpython-38.pyc000064400000032663151153537440016536 0ustar00U

&�.e�j�@sdZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZdd	lmZmZmZdd
lmZddlmZddlmZdd
lmZdZdddddd�Zdddddd�dddddd�ed�Ze�rdddddd�ed <ddd!d"dd�ed#<dZGd$d%�d%e�ZdS)&zFdistutils.command.install

Implements the Distutils 'install' command.�N)�log)�Command)�DEBUG)�get_config_vars)�DistutilsPlatformError)�
write_file)�convert_path�
subst_vars�change_root)�get_platform)�DistutilsOptionError)�	USER_BASE)�	USER_SITETz$base/Lib/site-packagesz$base/Include/$dist_namez
$base/Scriptsz$base)�purelib�platlib�headers�scripts�dataz/$base/lib/python$py_version_short/site-packagesz5$platbase/lib64/python$py_version_short/site-packagesz9$base/include/python$py_version_short$abiflags/$dist_namez	$base/binz$base/lib/pythonz$base/lib64/pythonz$base/include/python/$dist_name)�unix_prefix�	unix_home�ntz	$usersitez4$userbase/Python$py_version_nodot/Include/$dist_namez)$userbase/Python$py_version_nodot/Scriptsz	$userbaseZnt_userz=$userbase/include/python$py_version_short$abiflags/$dist_namez
$userbase/bin�	unix_userc@s:eZdZdZdddddddd	d
ddd
ddddddgZdddgZer`e�dddef�e�d�ddiZ	dd�Z
dd�Zdd �Zd!d"�Z
d#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Zd=d>�Zd?d@�ZdAdB�ZdCdD�ZdEefdFefdGefdHefdIdJdK�fgZdS)L�installz'install everything from build directory)zprefix=Nzinstallation prefix)zexec-prefix=Nz.(Unix only) prefix for platform-specific files)zhome=Nz+(Unix only) home directory to install under)z
install-base=Nz;base installation directory (instead of --prefix or --home))zinstall-platbase=Nz\base installation directory for platform-specific files (instead of --exec-prefix or --home))zroot=Nz<install everything relative to this alternate root directory)zinstall-purelib=Nz;installation directory for pure Python module distributions)zinstall-platlib=Nz8installation directory for non-pure module distributions)zinstall-lib=Nzginstallation directory for all module distributions (overrides --install-purelib and --install-platlib))zinstall-headers=Nz(installation directory for C/C++ headers)zinstall-scripts=Nz)installation directory for Python scripts)z
install-data=Nz%installation directory for data files)�compile�czcompile .py to .pyc [default])�
no-compileNzdon't compile .py files)z	optimize=�Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])�force�fz1force installation (overwrite any existing files))�
skip-buildNz2skip rebuilding everything (for testing/debugging))zrecord=Nz3filename in which to record list of installed filesrrr�userNz!install in user site-package '%s'rcCs�d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_t
|_t|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)zInitializes options.Nr�)�prefix�exec_prefix�homer �install_base�install_platbase�root�install_purelib�install_platlib�install_headers�install_lib�install_scripts�install_datar
�install_userbaser�install_usersiter�optimize�
extra_path�install_path_filer�
skip_build�warn_dir�
build_base�	build_lib�record��self�r:�1/usr/lib64/python3.8/distutils/command/install.py�initialize_options�s2zinstall.initialize_optionscCsx|js|js|jr&|js|jr&td��|jr@|js8|jr@td��|jrl|jsd|jsd|jsd|jsd|jrltd��tjdkr�|jr�|�	d�d|_|�
d�tjdkr�|��n|��|�
d�t
j��d	}td
d�\}}z
t
j}Wntk
r�d}YnX|j��|j��|j��|d
t
jdd�dt
jdd�|||||d�|_t�rf|j|jd<|j|jd<|��|�
d�|j|jd<|j|jd<t�r�d	dlm}td�||j�|� �|�
d�|j�r�|�!�|j"dk�r�|jj#�r�|j$|_"n|j%|_"|�&dddddddd�|�'�|j"|_(tj)�*|j"|j+�|_"|j,dk	�r\|�-ddddddd�|�
d �|�.d!d"d#�dS)$zFinalizes options.zWmust supply either prefix/exec-prefix/home or install-base/install-platbase -- not bothz9must supply either home or prefix/exec-prefix -- not bothzGcan't combine user with prefix, exec_prefix/home, or install_(plat)base�posixz+exec-prefix option ignored on this platformNzpre-finalize_{unix,other}zpost-finalize_{unix,other}()rr"r#�z%d.%d�z%d%d)Z	dist_nameZdist_versionZ
dist_fullname�
py_versionZpy_version_shortZpy_version_nodotZ
sys_prefixr"Zsys_exec_prefixr#�abiflags�userbaseZusersitezpost-expand_basedirs()�baseZplatbase)�pprintzconfig vars:zpost-expand_dirs()�librrrrrZlibbasezafter prepending root�build)r5r5)r6r6)/r"r#r$r%r&rr �os�name�warn�	dump_dirs�
finalize_unix�finalize_other�sys�version�splitrrA�AttributeError�distributionZget_nameZget_versionZget_fullname�version_info�config_vars�
HAS_USER_SITEr.r/�expand_basedirsrrD�print�expand_dirs�create_home_pathr+Zext_modulesr)r(�
convert_paths�handle_extra_path�install_libbase�path�join�
extra_dirsr'�change_rootsZset_undefined_options)r9r@r"r#rArDr:r:r;�finalize_options�s�������








�






�	�
�zinstall.finalize_optionscCs�tsdSddlm}t�|d�|jD]r}|d}|ddkrL|dd�}||jkrx|j|}|�|�}t||�}n|�|�}t||�}t�d||�q(dS)zDumps the list of user options.Nr)�
longopt_xlate�:����=z  %s: %s)	rZdistutils.fancy_getoptrar�debug�user_options�negative_opt�	translate�getattr)r9�msgra�optZopt_name�valr:r:r;rJus





zinstall.dump_dirscCsV|jdk	s|jdk	r\|jdkr2|jdkr2|jdksP|jdksP|jdksP|jdkrXtd��dS|j	r�|j
dkrttd��|j
|_|_|�d�n�|j
dk	r�|j
|_|_|�d�n�|jdk�r$|jdk	r�td��ttd�s�tjtjks�dtjkr�d	}nd
}tj�tj�||_tj�tj�||_n|jdk�r8|j|_|j|_|j|_|�d�dS)z&Finalizes options for posix platforms.NzPinstall-base or install-platbase supplied, but installation scheme is incomplete�$User base directory is not specifiedrrz*must not supply exec-prefix without prefixZreal_prefix�RPM_BUILD_ROOTz/localr>r)r%r&r+r(r)r*r,r-rr r.r�
select_schemer$r"r#�hasattrrM�base_prefixrG�environr\�normpath)r9Zadditionr:r:r;rK�sZ
������
�

�

��zinstall.finalize_unixcCs�|jr8|jdkrtd��|j|_|_|�tjd�n�|jdk	r\|j|_|_|�d�n\|j	dkrvtj
�tj	�|_	|j	|_|_z|�tj�Wn"t
k
r�tdtj��YnXdS)z)Finalizes options for non-posix platformsNrmZ_userrz)I don't know how to install stuff on '%s')r r.rr%r&rorGrHr$r"r\rsrM�KeyErrorr8r:r:r;rL�s&
�

�zinstall.finalize_othercCs<t|}tD]*}d|}t||�dkrt||||�qdS)z=Sets the install directories by applying the install schemes.�install_N)�INSTALL_SCHEMES�SCHEME_KEYSri�setattr)r9rHZscheme�key�attrnamer:r:r;ro�s
zinstall.select_schemecCsX|D]N}t||�}|dk	rtjdks.tjdkr:tj�|�}t||j�}t|||�qdS)Nr=r)rirGrHr\�
expanduserr	rSrx)r9�attrs�attrrlr:r:r;�
_expand_attrs�s
zinstall._expand_attrscCs|�dddg�dS)zNCalls `os.path.expanduser` on install_base, install_platbase and
        root.r%r&r'N�r~r8r:r:r;rU�szinstall.expand_basedirscCs|�ddddddg�dS)z+Calls `os.path.expanduser` on install dirs.r(r)r+r*r,r-Nrr8r:r:r;rW�s�zinstall.expand_dirscGs,|D]"}d|}t||tt||���qdS)z!Call `convert_path` over `names`.ruN)rxrri�r9�namesrHr}r:r:r;rY�szinstall.convert_pathscCs�|jdkr|jj|_|jdk	r�t�d�t|jt�rB|j�d�|_t|j�dkr`|jd}}n"t|j�dkrz|j\}}ntd��t	|�}nd}d}||_
||_dS)	z4Set `path_file` and `extra_dirs` using `extra_path`.NzIDistribution option extra_path is deprecated. See issue27919 for details.�,r!rr?zY'extra_path' option must be a list, tuple, or comma-separated string with 1 or 2 elementsr>)r1rQrrI�
isinstance�strrO�lenrr�	path_filer^)r9r�r^r:r:r;rZ�s(


��
zinstall.handle_extra_pathc	Gs0|D]&}d|}t||t|jt||���qdS)z:Change the install directories pointed by name using root.ruN)rxr
r'rir�r:r:r;r_szinstall.change_rootscCsb|js
dSttj�d��}|j��D]8\}}|�|�r$tj�|�s$|�	d|�t�
|d�q$dS)zCreate directories under ~.N�~zos.makedirs('%s', 0o700)i�)r rrGr\r{rS�items�
startswith�isdirZdebug_print�makedirs)r9r$rHr\r:r:r;rXszinstall.create_home_pathcCs"|js6|�d�|j�d�j}|jr6|t�kr6td��|��D]}|�|�q>|j	r\|�
�|jr�|��}|j
r�t|j
�}tt|��D]}|||d�||<q�|�t|j|fd|j�ttjjtj�}ttjj|�}tj�tj�|j��}|j�r|j	�r|j�s||k�rt�d|j�dS)zRuns the command.rFz"Can't install when cross-compilingNz'writing list of installed files to '%s'z�modules installed to '%s', which is not in Python's module search path (sys.path) -- you'll have to change the search path yourself)r3Zrun_commandrQZget_command_objZ	plat_namer4rr�get_sub_commandsr��create_path_filer7�get_outputsr'r��range�executer�maprGr\rsrM�normcaser+r2rre)r9Z
build_plat�cmd_name�outputsZroot_lenZcounterZsys_pathr+r:r:r;�run(sD

������zinstall.runcCsJtj�|j|jd�}|jr8|�t||jgfd|�n|�	d|�dS)zCreates the .pth file�.pthzcreating %szpath file '%s' not createdN)
rGr\r]r[r�r2r�rr^rI)r9�filenamer:r:r;r�Ts
�
�zinstall.create_path_filecCshg}|��D].}|�|�}|��D]}||kr"|�|�q"q|jrd|jrd|�tj�|j	|jd��|S)z.Assembles the outputs of all the sub-commands.r�)
r��get_finalized_commandr��appendr�r2rGr\r]r[)r9r�r��cmdr�r:r:r;r�bs
�zinstall.get_outputscCs.g}|��D]}|�|�}|�|���q|S)z*Returns the inputs of all the sub-commands)r�r��extend�
get_inputs)r9Zinputsr�r�r:r:r;r�ss

zinstall.get_inputscCs|j��p|j��S)zSReturns true if the current distribution has any Python
        modules to install.)rQZhas_pure_modulesZhas_ext_modulesr8r:r:r;�has_libs
�zinstall.has_libcCs
|j��S)zLReturns true if the current distribution has any headers to
        install.)rQ�has_headersr8r:r:r;r��szinstall.has_headerscCs
|j��S)zMReturns true if the current distribution has any scripts to.
        install.)rQ�has_scriptsr8r:r:r;r��szinstall.has_scriptscCs
|j��S)zJReturns true if the current distribution has any data to.
        install.)rQZhas_data_filesr8r:r:r;�has_data�szinstall.has_datar+r*r,r-Zinstall_egg_infocCsdS)NTr:r8r:r:r;�<lambda>��zinstall.<lambda>) �__name__�
__module__�__qualname__ZdescriptionrfZboolean_optionsrTr�rrgr<r`rJrKrLror~rUrWrYrZr_rXr�r�r�r�r�r�r�r�Zsub_commandsr:r:r:r;rIsn	�;
�
N3		",
�r)�__doc__rMrGZ	distutilsrZdistutils.corerZdistutils.debugrZdistutils.sysconfigrZdistutils.errorsrZdistutils.file_utilrZdistutils.utilrr	r
rrZsiter
rrTZWINDOWS_SCHEMErvrwrr:r:r:r;�<module>sb�
����
	�
distutils/command/__pycache__/build_scripts.cpython-38.opt-1.pyc000064400000010346151153537440020667 0ustar00U

e5dX�@s�dZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZm
Z
ddlmZddlZe�d	�ZGd
d�de�ZGdd
�d
ee
�ZdS)zRdistutils.command.build_scripts

Implements the Distutils 'build_scripts' command.�N)�ST_MODE)�	sysconfig)�Command)�newer)�convert_path�	Mixin2to3)�logs^#!.*python[0-9.]*([ 	].*)?$c@sHeZdZdZdddgZdgZdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)�
build_scriptsz("build" scripts (copy and fixup #! line))z
build-dir=�dzdirectory to "build" (copy) to)�force�fz1forcibly build everything (ignore file timestamps)zexecutable=�ez*specify final destination interpreter pathrcCs"d|_d|_d|_d|_d|_dS�N)�	build_dir�scriptsr�
executable�outfiles��self�r�7/usr/lib64/python3.8/distutils/command/build_scripts.py�initialize_optionss
z build_scripts.initialize_optionscCs|�dddd�|jj|_dS)NZbuild)r	r)rr)rr)Zset_undefined_optionsZdistributionrrrrr�finalize_options%s�zbuild_scripts.finalize_optionscCs|jSr)rrrrr�get_source_files,szbuild_scripts.get_source_filescCs|js
dS|��dSr)r�copy_scriptsrrrr�run/szbuild_scripts.runc
Cs�|�|j�g}g}|jD�]}d}t|�}tj�|jtj�|��}|�|�|j	slt
||�slt�d|�qzt
|d�}Wn tk
r�|js��d}YnXXt�|j�\}}|�d�|��}	|	s�|�d|�qt�|	�}
|
r�d}|
�d�p�d	}|�rt�d
||j�|�|�|j�stj�s*|j}n(tj�t�d�dt�d
�t�d�f�}t�|�}d||d}
z|
�d�Wn$tk
�r�t d�!|
���YnXz|
�|�Wn&tk
�r�t d�!|
|���YnXt
|d��}|�"|
�|�#|�$��W5QRX|�r8|�%�q|�r"|�%�|�|�|�&||�qtj'dk�r�|D]`}|j�rdt�d|�nDt�(|�t)d@}|dBd@}||k�rJt�d|||�t�*||��qJ||fS)a"Copy each script listed in 'self.scripts'; if it's marked as a
        Python script in the Unix way (first line matches 'first_line_re',
        ie. starts with "\#!" and contains "python"), then adjust the first
        line to refer to the current Python interpreter as we copy.
        Fznot copying %s (up-to-date)�rbNrz%s is an empty file (skipping)T��zcopying and adjusting %s -> %sZBINDIRz
python%s%sZVERSIONZEXEs#!�
zutf-8z.The shebang ({!r}) is not decodable from utf-8zAThe shebang ({!r}) is not decodable from the script encoding ({})�wb�posixzchanging mode of %si�imz!changing mode of %s from %o to %o)+Zmkpathrrr�os�path�join�basename�appendrrr�debug�open�OSError�dry_run�tokenize�detect_encoding�readline�seek�warn�
first_line_re�match�group�inforZpython_buildrZget_config_var�fsencode�decode�UnicodeDecodeError�
ValueError�format�write�
writelines�	readlines�closeZ	copy_file�name�statr�chmod)rr�
updated_filesZscriptZadjustZoutfiler�encoding�linesZ
first_liner1Zpost_interprZshebangZoutf�fileZoldmodeZnewmoderrrr5s�



�

��
��
��




�zbuild_scripts.copy_scriptsN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsrrrrrrrrrr	s�r	c@seZdZdd�ZdS)�build_scripts_2to3cCs&t�|�\}}|js|�|�||fSr)r	rr*Zrun_2to3)rrr@rrrr�s
zbuild_scripts_2to3.copy_scriptsN)rDrErFrrrrrrG�srG)�__doc__r"�rer>rZ	distutilsrZdistutils.corerZdistutils.dep_utilrZdistutils.utilrrrr+�compiler0r	rGrrrr�<module>s

distutils/command/__pycache__/install_headers.cpython-38.opt-1.pyc000064400000003256151153537440021164 0ustar00U

e5d�@s$dZddlmZGdd�de�ZdS)z�distutils.command.install_headers

Implements the Distutils 'install_headers' command, to install C/C++ header
files to the Python include directory.�)�Commandc@sFeZdZdZddgZdgZdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dS)�install_headerszinstall C/C++ header files)zinstall-dir=�dz$directory to install header files to)�force�fz-force installation (overwrite existing files)rcCsd|_d|_g|_dS)Nr)�install_dirr�outfiles��self�r�9/usr/lib64/python3.8/distutils/command/install_headers.py�initialize_optionssz"install_headers.initialize_optionscCs|�ddd�dS)NZinstall)rr)rr)Zset_undefined_optionsr	rrr�finalize_optionss�z install_headers.finalize_optionscCsH|jj}|sdS|�|j�|D]"}|�||j�\}}|j�|�q dS�N)�distribution�headersZmkpathrZ	copy_filer�append)r
r�header�out�_rrr�run!szinstall_headers.runcCs|jjp
gSr)rrr	rrr�
get_inputs+szinstall_headers.get_inputscCs|jSr)rr	rrr�get_outputs.szinstall_headers.get_outputsN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsr
rrrrrrrrr
s�
rN)�__doc__Zdistutils.corerrrrrr�<module>sdistutils/command/__pycache__/install_lib.cpython-38.pyc000064400000011773151153537440017363 0ustar00U

e5d� �@sLdZddlZddlZddlZddlmZddlmZdZ	Gdd�de�Z
dS)zkdistutils.command.install_lib

Implements the Distutils 'install_lib' command
(install all Python modules).�N)�Command)�DistutilsOptionErrorz.pyc@s�eZdZdZdddddddgZd	d
dgZdd
iZd
d�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd �Zd!S)"�install_libz7install all Python modules (extensions and pure Python))zinstall-dir=�dzdirectory to install to)z
build-dir=�bz'build directory (where to install from))�force�fz-force installation (overwrite existing files))�compile�czcompile .py to .pyc [default])�
no-compileNzdon't compile .py files)z	optimize=�Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])�
skip-buildNzskip the build stepsrr	r
rcCs(d|_d|_d|_d|_d|_d|_dS)Nr)�install_dir�	build_dirrr	�optimize�
skip_build��self�r�5/usr/lib64/python3.8/distutils/command/install_lib.py�initialize_options3szinstall_lib.initialize_optionsc	Cs�|�ddddddd�|jdkr&d|_|jdkr6d	|_t|jt�s�zt|j�|_|jd
kr^t�Wn ttfk
r�td��YnXdS)N�install)�	build_libr)rr)rr)r	r	)rr)rrTF)r��zoptimize must be 0, 1, or 2)Zset_undefined_optionsr	r�
isinstance�int�AssertionError�
ValueErrorrrrrr�finalize_options<s&�	


zinstall_lib.finalize_optionscCs0|��|��}|dk	r,|j��r,|�|�dS�N)�buildr�distribution�has_pure_modules�byte_compile�rZoutfilesrrr�runVszinstall_lib.runcCs2|js.|j��r|�d�|j��r.|�d�dS)N�build_py�	build_ext)rr"r#Zrun_command�has_ext_modulesrrrrr!fs



zinstall_lib.buildcCs8tj�|j�r |�|j|j�}n|�d|j�dS|S)Nz3'%s' does not exist -- no Python modules to install)�os�path�isdirrZ	copy_treer�warnr%rrrrms�zinstall_lib.installcCsrtjr|�d�dSddlm}|�d�j}|jrH||d|j||j	d�|j
dkrn|||j
|j||j|j	d�dS)Nz%byte-compiling is disabled, skipping.r)r$r)rr�prefix�dry_run)rrr.�verboser/)�sys�dont_write_bytecoder-Zdistutils.utilr$�get_finalized_command�rootr	rr/rr0)r�filesr$Zinstall_rootrrrr$vs$
�
�zinstall_lib.byte_compilec
	Csd|sgS|�|�}|��}t||�}t|�ttj�}g}|D] }	|�tj�||	|d���q>|Sr )	r3�get_outputs�getattr�lenr*�sep�appendr+�join)
rZhas_anyZ	build_cmdZ
cmd_optionZ
output_dirZbuild_filesr�
prefix_lenZoutputs�filerrr�_mutate_outputs�s

zinstall_lib._mutate_outputscCsrg}|D]d}tj�tj�|��d}|tkr.q|jrJ|�tjj	|dd��|j
dkr|�tjj	||j
d��q|S)Nr�)�optimizationr)r*r+�splitext�normcase�PYTHON_SOURCE_EXTENSIONr	r:�	importlib�util�cache_from_sourcer)rZpy_filenamesZbytecode_filesZpy_fileZextrrr�_bytecode_filenames�s 
�

�
zinstall_lib._bytecode_filenamescCsR|�|j��dd|j�}|jr*|�|�}ng}|�|j��dd|j�}|||S)z�Return the list of files that would be installed if this command
        were actually run.  Not affected by the "dry-run" flag or whether
        modules have actually been built yet.
        r'rr()r>r"r#rr	rGr))rZpure_outputsZbytecode_outputsZext_outputsrrrr6�s ����zinstall_lib.get_outputscCsLg}|j��r&|�d�}|�|���|j��rH|�d�}|�|���|S)z�Get the list of files that are input to this command, ie. the
        files that get installed as they are named in the build tree.
        The files in this list correspond one-to-one to the output
        filenames returned by 'get_outputs()'.
        r'r()r"r#r3�extendr6r))rZinputsr'r(rrr�
get_inputs�s



zinstall_lib.get_inputsN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsZnegative_optrrr&r!rr$r>rGr6rIrrrrrs*�
		r)�__doc__r*�importlib.utilrDr1Zdistutils.corerZdistutils.errorsrrCrrrrr�<module>sdistutils/command/__pycache__/register.cpython-38.pyc000064400000020411151153537440016700 0ustar00U

e5d�-�@sddZddlZddlZddlZddlZddlmZddlm	Z	ddl
TddlmZGdd�de	�Z
dS)	zhdistutils.command.register

Implements the Distutils 'register' command (register with the repository).
�N)�warn)�
PyPIRCCommand)�*)�logc@s�eZdZdZejddgZejdddgZddd	�fgZd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zddd�ZdS) �registerz7register the distribution with the Python package index)�list-classifiersNz list the valid Trove classifiers)�strictNzBWill stop the registering if the meta-data are not fully compliant�verifyrr�checkcCsdS)NT���selfrr�2/usr/lib64/python3.8/distutils/command/register.py�<lambda>�zregister.<lambda>cCst�|�d|_d|_dS)Nr)r�initialize_options�list_classifiersrrrrrrs
zregister.initialize_optionscCs*t�|�d|jfdd�}||jjd<dS)Nr)r�)r�restructuredtextr
)r�finalize_optionsr�distributionZcommand_options)r
Z
check_optionsrrrr$s

�zregister.finalize_optionscCsT|��|��|��D]}|�|�q|jr8|��n|jrH|��n|��dS)N)	r�_set_configZget_sub_commandsZrun_commandZdry_run�verify_metadatar�classifiers�
send_metadata)r
Zcmd_namerrr�run+s

zregister.runcCs8tdt�|j�d�}|��|j|_d|_|��dS)zDeprecated API.zddistutils.command.register.check_metadata is deprecated,               use the check command insteadr
rN)r�PendingDeprecationWarningrZget_command_objZensure_finalizedrrr)r
r
rrr�check_metadata:s�zregister.check_metadatacCsz|��}|ikr@|d|_|d|_|d|_|d|_d|_n6|jd|jfkr^td|j��|jdkrp|j|_d|_d	S)
z: Reads the configuration file and set attributes.
        �username�password�
repository�realmTZpypiz%s not found in .pypircFN)Z_read_pypircrrr r!�
has_configZDEFAULT_REPOSITORY�
ValueError)r
ZconfigrrrrDs




zregister._set_configcCs*|jd}tj�|�}t�|�|��dS)z8 Fetch the list of classifiers from the server.
        z?:action=list_classifiersN)r �urllib�requestZurlopenr�info�_read_pypi_response)r
ZurlZresponserrrrUs
zregister.classifierscCs&|�|�d��\}}t�d||�dS)zF Send the metadata to the package index server to be checked.
        r	�Server response (%s): %sN)�post_to_server�build_post_datarr&)r
�code�resultrrrr\szregister.verify_metadatac
Cs�|jrd}|j}|j}nd}d}}d��}||krd|�dtj�t�}|sRd}q,||kr,td�q,|dk�rl|s|td�}qn|s�t	�	d�}q|t
j��}t
j
�|j�d	}|�|j|||�|�|�d
�|�\}}|�d||ftj�|dk�r�|j�r||j_nf|�d
tj�|�d|��tj�d}|��dk�rNtd�}|�s*d}�q*|��dk�r�|�||��nl|dk�r�ddi}	d|	d<|	d<|	d<d|	d<|	d�s�td�|	d<�q�|	d|	dk�r0|	d�s�t	�	d�|	d<�q�|	d�st	�	d�|	d<�q�|	d|	dk�r�d|	d<d|	d<td��q�|	d�sJtd�|	d<�q0|�|	�\}}|dk�rrt�d||�nt�d�t�d �nP|d!k�r�dd"i}	d|	d<|	d�s�td#�|	d<�q�|�|	�\}}t�d||�dS)$a_ Send the metadata to the package index server.

            Well, do the following:
            1. figure who the user is, and then
            2. send the data as a Basic auth'ed POST.

            First we try to read the username/password from $HOME/.pypirc,
            which is a ConfigParser-formatted file with a section
            [distutils] containing username and password entries (both
            in clear text). Eg:

                [distutils]
                index-servers =
                    pypi

                [pypi]
                username: fred
                password: sekrit

            Otherwise, to figure who the user is, we offer the user three
            choices:

             1. use existing login,
             2. register as a new user, or
             3. set the password to a random string and email the user.

        �1�x�z1 2 3 4z�We need to know who you are, so please choose either:
 1. use your existing login,
 2. register as a new user,
 3. have the server generate a new password for you (and email it to you), or
 4. quit
Your selection [default 1]: z&Please choose one of the four options!z
Username: z
Password: rZsubmitr(��zAI can store your PyPI login so future submissions will be faster.z (the login will be stored in %s)�XZynzSave your login (y/N)?�n�y�2�:action�user�namerZemailNZconfirmz
 Confirm: z!Password and confirm don't match!z
   EMail: z"You will receive an email shortly.z7Follow the instructions in it to complete registration.�3Zpassword_resetzYour email address: )r"rr�split�announcer�INFO�input�print�getpassr$r%ZHTTPPasswordMgr�parseZurlparser Zadd_passwordr!r)r*rZ_get_rc_file�lowerZ
_store_pypircr&)
r
Zchoicerr�choices�authZhostr+r,�datarrrrcs��



��

���








zregister.send_metadatacCs�|jj}|d|��|��|��|��|��|��|��|�	�|�
�|��|��|�
�|��|��|��d�}|ds�|ds�|dr�d|d<|S)Nz1.0)r5�metadata_versionr7�versionZsummaryZ	home_pageZauthorZauthor_email�license�description�keywords�platformrZdownload_url�provides�requires�	obsoletesrJrKrLz1.1rD)rZmetadataZget_nameZget_versionZget_descriptionZget_urlZget_contactZget_contact_emailZget_licenceZget_long_descriptionZget_keywordsZ
get_platformsZget_classifiersZget_download_urlZget_providesZget_requiresZ
get_obsoletes)r
�action�metarCrrrr*�s,�zregister.build_post_dataNc
Cs�d|kr$|�d|d|jftj�d}d|}|d}t��}|��D]~\}}t|�tg�td�fkrn|g}|D]R}t|�}|�	|�|�	d|�|�	d�|�	|�|rr|d	d
krr|�	d�qrqH|�	|�|�	d�|�
��d�}d
|tt|��d�}	t
j�|j||	�}
t
j�t
jj|d��}d}z|�|
�}Wnxt
jjk
�r�}
z"|j�rd|
j��}|
j|
jf}W5d}
~
XYnJt
jjk
�r�}
zdt|
�f}W5d}
~
XYnX|j�r�|�|�}d}|j�r�d�d|df�}|�|tj�|S)zC Post a query to the server, and return a string response.
        r7zRegistering %s to %sz3--------------GHSKFJDLGDS7543FJKLFHRE75642756743254z
--z--rz*
Content-Disposition: form-data; name="%s"z

����
�
zutf-8z/multipart/form-data; boundary=%s; charset=utf-8)zContent-typezContent-length)Zpassword_mgrr/Ni�)r0ZOKzK---------------------------------------------------------------------------)r:r rr;�io�StringIO�items�type�str�write�getvalue�encode�lenr$r%ZRequestZbuild_openerZHTTPBasicAuthHandler�open�errorZ	HTTPErrorZ
show_response�fp�readr+�msgZURLErrorr'�join)r
rCrB�boundaryZsep_boundaryZend_boundaryZbody�key�valueZheadersZreqZopenerr,�er_rrrr)�s^��





��

zregister.post_to_server)N)�__name__�
__module__�__qualname__rGrZuser_optionsZboolean_optionsZsub_commandsrrrrrrrrr*r)rrrrrs*��
zr)�__doc__r>rRZurllib.parser$Zurllib.request�warningsrZdistutils.corerZdistutils.errorsZ	distutilsrrrrrr�<module>sdistutils/command/__pycache__/install_egg_info.cpython-38.opt-1.pyc000064400000005666151153537440021335 0ustar00U

e5d+
�@sddZddlmZddlmZmZddlZddlZddlZGdd�de�Z	dd�Z
d	d
�Zdd�ZdS)
z�distutils.command.install_egg_info

Implements the Distutils 'install_egg_info' command, for installing
a package's PKG-INFO metadata.�)�Command)�log�dir_utilNc@s:eZdZdZdZdgZdd�Zdd�Zdd	�Zd
d�Z	dS)
�install_egg_infoz)Install an .egg-info file for the packagez8Install package's PKG-INFO metadata as an .egg-info file)zinstall-dir=�dzdirectory to install tocCs
d|_dS�N)�install_dir��self�r�:/usr/lib64/python3.8/distutils/command/install_egg_info.py�initialize_optionssz#install_egg_info.initialize_optionscCsb|�dd�dtt|j����tt|j����ftjdd��}t	j
�|j|�|_
|j
g|_dS)NZinstall_lib)rrz%s-%s-py%d.%d.egg-info�)Zset_undefined_options�to_filename�	safe_name�distributionZget_name�safe_versionZget_version�sys�version_info�os�path�joinr�target�outputs)r
�basenamerrr�finalize_optionss��z!install_egg_info.finalize_optionsc	Cs�|j}tj�|�r0tj�|�s0tj||jd�nNtj�|�rV|�	tj
|jfd|�n(tj�|j�s~|�	tj|jfd|j�t
�d|�|js�t|ddd��}|jj�|�W5QRXdS)N)�dry_runz	Removing z	Creating z
Writing %s�wzUTF-8)�encoding)rrr�isdir�islinkrZremove_treer�existsZexecute�unlinkr�makedirsr�info�openrZmetadataZwrite_pkg_file)r
r�frrr�run s�zinstall_egg_info.runcCs|jSr)rr	rrr�get_outputs.szinstall_egg_info.get_outputsN)
�__name__�
__module__�__qualname__�__doc__ZdescriptionZuser_optionsr
rr'r(rrrrrs�
rcCst�dd|�S)z�Convert an arbitrary string to a standard distribution name

    Any runs of non-alphanumeric/. characters are replaced with a single '-'.
    �[^A-Za-z0-9.]+�-)�re�sub��namerrrr6srcCs|�dd�}t�dd|�S)z�Convert an arbitrary string to a standard version string

    Spaces become dots, and all other non-alphanumeric characters become
    dashes, with runs of multiple dashes condensed to a single dash.
    � �.r-r.)�replacer/r0)�versionrrrr>srcCs|�dd�S)z|Convert a project or version name to its filename-escaped form

    Any '-' characters are currently replaced with '_'.
    r.�_)r5r1rrrrHsr)
r,Z
distutils.cmdrZ	distutilsrrrrr/rrrrrrrr�<module>s+
distutils/command/__pycache__/install_headers.cpython-38.pyc000064400000003256151153537440020225 0ustar00U

e5d�@s$dZddlmZGdd�de�ZdS)z�distutils.command.install_headers

Implements the Distutils 'install_headers' command, to install C/C++ header
files to the Python include directory.�)�Commandc@sFeZdZdZddgZdgZdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dS)�install_headerszinstall C/C++ header files)zinstall-dir=�dz$directory to install header files to)�force�fz-force installation (overwrite existing files)rcCsd|_d|_g|_dS)Nr)�install_dirr�outfiles��self�r�9/usr/lib64/python3.8/distutils/command/install_headers.py�initialize_optionssz"install_headers.initialize_optionscCs|�ddd�dS)NZinstall)rr)rr)Zset_undefined_optionsr	rrr�finalize_optionss�z install_headers.finalize_optionscCsH|jj}|sdS|�|j�|D]"}|�||j�\}}|j�|�q dS�N)�distribution�headersZmkpathrZ	copy_filer�append)r
r�header�out�_rrr�run!szinstall_headers.runcCs|jjp
gSr)rrr	rrr�
get_inputs+szinstall_headers.get_inputscCs|jSr)rr	rrr�get_outputs.szinstall_headers.get_outputsN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsr
rrrrrrrrr
s�
rN)�__doc__Zdistutils.corerrrrrr�<module>sdistutils/command/__pycache__/bdist.cpython-38.pyc000064400000007124151153537440016167 0ustar00U

e5d��@sHdZddlZddlmZddlTddlmZdd�ZGdd	�d	e�ZdS)
zidistutils.command.bdist

Implements the Distutils 'bdist' command (create a built [binary]
distribution).�N)�Command)�*)�get_platformcCsPddlm}g}tjD]"}|�d|dtj|df�q||�}|�d�dS)zFPrint list of available formats (arguments to "--format" option).
    r)�FancyGetopt�formats=N�z'List of available distribution formats:)Zdistutils.fancy_getoptr�bdist�format_commands�append�format_commandZ
print_help)r�formats�formatZpretty_printer�r�//usr/lib64/python3.8/distutils/command/bdist.py�show_formatss
�rc
@s�eZdZdZdddde�fdddd	d
gZdgZdd
defgZdZ	ddd�Z
dddddddddg	Zddddddd d!d"d#�	Zd$d%�Z
d&d'�Zd(d)�Zd
S)*rz$create a built (binary) distribution)zbdist-base=�bz4temporary directory for creating built distributionsz
plat-name=�pz;platform name to embed in generated filenames (default: %s))rNz/formats for distribution (comma-separated list))z	dist-dir=�dz=directory to put final built distributions in [default: dist])�
skip-buildNz2skip rebuilding everything (for testing/debugging))zowner=�uz@Owner name used when creating a tar file [default: current user])zgroup=�gzAGroup name used when creating a tar file [default: current group]rzhelp-formatsNz$lists available distribution formats)�	bdist_rpm�gztar�zip)�posix�nt�rpm�bztar�xztar�ztar�tar�wininst�msi)rzRPM distribution)�
bdist_dumbzgzip'ed tar file)r#zbzip2'ed tar file)r#zxz'ed tar file)r#zcompressed tar file)r#ztar file)Z
bdist_wininstzWindows executable installer)r#zZIP file)Z	bdist_msizMicrosoft Installer)	rrrrrr r!rr"cCs.d|_d|_d|_d|_d|_d|_d|_dS)Nr)�
bdist_base�	plat_namer�dist_dir�
skip_build�group�owner)�selfrrr�initialize_optionsQszbdist.initialize_optionscCs�|jdkr(|jrt�|_n|�d�j|_|jdkrT|�d�j}tj�|d|j�|_|�	d�|j
dkr�z|jtjg|_
Wn"t
k
r�tdtj��YnX|jdkr�d|_dS)NZbuildzbdist.rz;don't know how to create built distributions on platform %sZdist)r%r'rZget_finalized_commandr$�
build_base�os�path�joinZensure_string_listr�default_format�name�KeyErrorZDistutilsPlatformErrorr&)r*r,rrr�finalize_optionsZs*


�

��

zbdist.finalize_optionsc	Cs�g}|jD]>}z|�|j|d�Wq
tk
rFtd|��Yq
Xq
tt|j��D]h}||}|�|�}||jkr�|j||_	|dkr�|j
|_
|j|_|||dd�kr�d|_|�
|�qXdS)Nrzinvalid format '%s'r#r)rr
rr2ZDistutilsOptionError�range�lenZreinitialize_command�no_format_optionr
r)r(Z	keep_tempZrun_command)r*Zcommandsr
�iZcmd_nameZsub_cmdrrr�runvs"


z	bdist.run)�__name__�
__module__�__qualname__ZdescriptionrZuser_optionsZboolean_optionsrZhelp_optionsr6r0r	rr+r3r8rrrrrsR��������
	r)	�__doc__r-Zdistutils.corerZdistutils.errorsZdistutils.utilrrrrrrr�<module>sdistutils/command/__pycache__/build.cpython-38.opt-2.pyc000064400000007330151153537440017120 0ustar00U

e5d��@sPddlZddlZddlmZddlmZddlmZdd�ZGdd�de�Z	dS)	�N)�Command)�DistutilsOptionError)�get_platformcCsddlm}|�dS)Nr��show_compilers)Zdistutils.ccompilerrr�r�//usr/lib64/python3.8/distutils/command/build.pyrsrc@s�eZdZdZdddddddd	d
e�fddd
ddgZddgZdddefgZdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd �Zd!d"�Zd#efd$e
fd%efd&efgZdS)'�buildz"build everything needed to install)zbuild-base=�bz base directory for build library)zbuild-purelib=Nz2build directory for platform-neutral distributions)zbuild-platlib=Nz3build directory for platform-specific distributions)z
build-lib=NzWbuild directory for all distribution (defaults to either build-purelib or build-platlib)zbuild-scripts=Nzbuild directory for scripts)zbuild-temp=�tztemporary build directoryz
plat-name=�pz6platform name to build for, if supported (default: %s))z	compiler=�czspecify the compiler type)z	parallel=�jznumber of parallel build jobs)�debug�gz;compile extensions and libraries with debugging information)�force�fz2forcibly build everything (ignore file timestamps))zexecutable=�ez5specify final destination interpreter path (build.py)rrz
help-compilerNzlist available compilerscCsLd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_dS)Nr	r)�
build_base�
build_purelib�
build_platlib�	build_lib�
build_temp�
build_scriptsZcompiler�	plat_namerr�
executable�parallel��selfrrr�initialize_options8szbuild.initialize_optionscCsb|jdkrt�|_ntjdkr&td��d|jftjdd��}ttd�rR|d7}|jdkrntj	�
|jd�|_|jdkr�tj	�
|jd|�|_|j
dkr�|jjr�|j|_
n|j|_
|jdkr�tj	�
|jd|�|_|jdkr�tj	�
|jd	tjdd��|_|jdk�r tj�r tj	�tj�|_t|jt��r^zt|j�|_Wntk
�r\td
��YnXdS)N�ntzW--plat-name only supported on Windows (try using './configure --help' on your platform)z	.%s-%d.%d�Zgettotalrefcountz-pydebug�libZtempz
scripts-%d.%dzparallel should be an integer)rr�os�namer�sys�version_info�hasattrr�path�joinrrr�distributionZext_modulesrrr�normpath�
isinstancer�str�int�
ValueError)rZplat_specifierrrr�finalize_optionsHsD


�



�



�

�zbuild.finalize_optionscCs|��D]}|�|�qdS�N)Zget_sub_commandsZrun_command)rZcmd_namerrr�run�sz	build.runcCs
|j��Sr1)r*�has_pure_modulesrrrrr3�szbuild.has_pure_modulescCs
|j��Sr1)r*�has_c_librariesrrrrr4�szbuild.has_c_librariescCs
|j��Sr1)r*�has_ext_modulesrrrrr5�szbuild.has_ext_modulescCs
|j��Sr1)r*�has_scriptsrrrrr6�szbuild.has_scriptsZbuild_pyZ
build_clibZ	build_extr)�__name__�
__module__�__qualname__ZdescriptionrZuser_optionsZboolean_optionsrZhelp_optionsrr0r2r3r4r5r6Zsub_commandsrrrrr	sH�����8�r	)
r%r#Zdistutils.corerZdistutils.errorsrZdistutils.utilrrr	rrrr�<module>s
distutils/command/__pycache__/install_data.cpython-38.opt-1.pyc000064400000004363151153537440020462 0ustar00U

e5d�@s<dZddlZddlmZddlmZmZGdd�de�ZdS)z�distutils.command.install_data

Implements the Distutils 'install_data' command, for installing
platform-independent data files.�N)�Command)�change_root�convert_pathc@sHeZdZdZdddgZdgZdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)�install_datazinstall data files)zinstall-dir=�dzIbase directory for installing data files (default: installation base dir))zroot=Nz<install everything relative to this alternate root directory)�force�fz-force installation (overwrite existing files)rcCs,d|_g|_d|_d|_|jj|_d|_dS)Nr�)�install_dir�outfiles�rootrZdistribution�
data_files�warn_dir��self�r�6/usr/lib64/python3.8/distutils/command/install_data.py�initialize_optionss
zinstall_data.initialize_optionscCs|�dddd�dS)NZinstall)rr
)rr)rr)Zset_undefined_optionsrrrr�finalize_options#s
�zinstall_data.finalize_optionscCs�|�|j�|jD]�}t|t�rbt|�}|jrB|�d||jf�|�||j�\}}|j	�
|�qt|d�}tj�
|�s�tj�|j|�}n|jr�t|j|�}|�|�|dgkr�|j	�
|�q|dD](}t|�}|�||�\}}|j	�
|�q�qdS)NzMsetup script did not provide a directory for '%s' -- installing right in '%s'rr	)Zmkpathr
r
�
isinstance�strrr�warnZ	copy_filer�append�os�path�isabs�joinrr)rr�out�_�dir�datarrr�run*s,

�
zinstall_data.runcCs
|jpgS�N)r
rrrr�
get_inputsKszinstall_data.get_inputscCs|jSr")rrrrr�get_outputsNszinstall_data.get_outputsN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsrrr!r#r$rrrrrs�	!r)�__doc__rZdistutils.corerZdistutils.utilrrrrrrr�<module>sdistutils/command/__pycache__/clean.cpython-38.pyc000064400000004066151153537440016146 0ustar00U

e5d�
�@sDdZddlZddlmZddlmZddlmZGdd�de�ZdS)zBdistutils.command.clean

Implements the Distutils 'clean' command.�N)�Command)�remove_tree)�logc@s>eZdZdZddddddgZdgZd	d
�Zdd�Zd
d�ZdS)�cleanz-clean up temporary files from 'build' command)zbuild-base=�bz2base build directory (default: 'build.build-base'))z
build-lib=Nz<build directory for all modules (default: 'build.build-lib'))zbuild-temp=�tz7temporary build directory (default: 'build.build-temp'))zbuild-scripts=Nz<build directory for scripts (default: 'build.build-scripts'))zbdist-base=Nz+temporary directory for built distributions)�all�az7remove all build output, not just temporary by-productsrcCs(d|_d|_d|_d|_d|_d|_dS)N)�
build_base�	build_lib�
build_temp�
build_scripts�
bdist_baser��self�r�//usr/lib64/python3.8/distutils/command/clean.py�initialize_options szclean.initialize_optionscCs"|�ddddd�|�dd�dS)NZbuild)r
r
)rr)r
r
)rrZbdist)rr)Zset_undefined_optionsrrrr�finalize_options(s��zclean.finalize_optionscCs�tj�|j�r t|j|jd�nt�d|j�|jrr|j	|j
|jfD],}tj�|�rdt||jd�qDt�d|�qD|js�zt�
|j�t�d|j�Wntk
r�YnXdS)N)�dry_runz%'%s' does not exist -- can't clean itz
removing '%s')�os�path�existsrrrr�debugrrrr
�warn�rmdirr
�info�OSError)rZ	directoryrrr�run1s*���z	clean.runN)	�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsrrrrrrrrs�	r)	�__doc__rZdistutils.corerZdistutils.dir_utilrZ	distutilsrrrrrr�<module>s
distutils/command/__pycache__/bdist_rpm.cpython-38.opt-1.pyc000064400000030114151153537440017777 0ustar00U

e5dIT�@s�dZddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZddlTddl
mZdd	lmZGd
d�de�ZdS)zwdistutils.command.bdist_rpm

Implements the Distutils 'bdist_rpm' command (create RPM source and binary
distributions).�N)�Command)�DEBUG)�get_platform)�
write_file)�*)�get_python_version)�logc)@s�eZdZdZdddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*g)Zd+d,d-d.d/gZd+d,d-d0�Zd1d2�Zd3d4�Zd5d6�Z	d7d8�Z
d9d:�Zd;d<�Zd=d>�Z
d?S)@�	bdist_rpmzcreate an RPM distribution)zbdist-base=Nz/base directory for creating built distributions)z	rpm-base=Nzdbase directory for creating RPMs (defaults to "rpm" under --bdist-base; must be specified for RPM 2))z	dist-dir=�dzDdirectory to put final RPM files in (and .spec files if --spec-only))zpython=NzMpath to Python interpreter to hard-code in the .spec file (default: "python"))z
fix-pythonNzLhard-code the exact path to the current Python interpreter in the .spec file)z	spec-onlyNzonly regenerate spec file)zsource-onlyNzonly generate source RPM)zbinary-onlyNzonly generate binary RPM)z	use-bzip2Nz7use bzip2 instead of gzip to create source distribution)zdistribution-name=Nzgname of the (Linux) distribution to which this RPM applies (*not* the name of the module distribution!))zgroup=Nz9package classification [default: "Development/Libraries"])zrelease=NzRPM release number)zserial=NzRPM serial number)zvendor=NzaRPM "vendor" (eg. "Joe Blow <joe@example.com>") [default: maintainer or author from setup script])z	packager=NzBRPM packager (eg. "Jane Doe <jane@example.net>") [default: vendor])z
doc-files=Nz6list of documentation files (space or comma-separated))z
changelog=Nz
RPM changelog)zicon=Nzname of icon file)z	provides=Nz%capabilities provided by this package)z	requires=Nz%capabilities required by this package)z
conflicts=Nz-capabilities which conflict with this package)zbuild-requires=Nz+capabilities required to build this package)z
obsoletes=Nz*capabilities made obsolete by this package)�
no-autoreqNz+do not automatically calculate dependencies)�	keep-temp�kz"don't clean up RPM build directory)�no-keep-tempNz&clean up RPM build directory [default])�use-rpm-opt-flagsNz8compile with RPM_OPT_FLAGS when building from source RPM)�no-rpm-opt-flagsNz&do not pass any RPM CFLAGS to compiler)�	rpm3-modeNz"RPM 3 compatibility mode (default))�	rpm2-modeNzRPM 2 compatibility mode)zprep-script=Nz3Specify a script for the PREP phase of RPM building)z
build-script=Nz4Specify a script for the BUILD phase of RPM building)zpre-install=Nz:Specify a script for the pre-INSTALL phase of RPM building)zinstall-script=Nz6Specify a script for the INSTALL phase of RPM building)z
post-install=Nz;Specify a script for the post-INSTALL phase of RPM building)zpre-uninstall=Nz<Specify a script for the pre-UNINSTALL phase of RPM building)zpost-uninstall=Nz=Specify a script for the post-UNINSTALL phase of RPM building)z
clean-script=Nz4Specify a script for the CLEAN phase of RPM building)zverify-script=Nz6Specify a script for the VERIFY phase of the RPM build)zforce-arch=Nz0Force an architecture onto the RPM build process)�quiet�qz3Run the INSTALL phase of RPM building in quiet moderrrrr)rrrcCs�d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_ d|_!d|_"d|_#d|_$d|_%d|_&dS)Nr�)'�
bdist_base�rpm_base�dist_dir�python�
fix_python�	spec_only�binary_only�source_only�	use_bzip2�distribution_name�group�release�serial�vendor�packager�	doc_files�	changelog�icon�prep_script�build_script�install_script�clean_script�
verify_script�pre_install�post_install�
pre_uninstall�post_uninstall�prep�provides�requires�	conflicts�build_requires�	obsoletes�	keep_temp�use_rpm_opt_flags�	rpm3_mode�
no_autoreq�
force_archr��self�r>�3/usr/lib64/python3.8/distutils/command/bdist_rpm.py�initialize_options�sNzbdist_rpm.initialize_optionscCs�|�dd�|jdkr6|js$td��tj�|jd�|_|jdkrX|j	rPt
j|_qfd|_n|j	rftd��tjdkr~t
dtj��|jr�|jr�td	��|j��s�d
|_|�dd�|��dS)NZbdist)rrz)you must specify --rpm-base in RPM 2 mode�rpmZpython3z8--python and --fix-python are mutually exclusive options�posixz9don't know how to create RPM distributions on platform %sz6cannot supply both '--source-only' and '--binary-only'r)rr)Zset_undefined_optionsrr9ZDistutilsOptionError�os�path�joinrrr�sys�
executable�nameZDistutilsPlatformErrorrr�distribution�has_ext_modulesr8�finalize_package_datar<r>r>r?�finalize_options�s6
�

�
��
zbdist_rpm.finalize_optionscCsT|�dd�|�dd|j��|j��f�|�d�|�d�t|jt�rxdD]&}tj	�
|�rP||jkrP|j�|�qP|�dd	�|�d
�|�d�|�d�|�|j
�|_
|�d
�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�|�d�dS)Nr zDevelopment/Librariesr#z%s <%s>r$r%)ZREADMEz
README.txtr!�1r"rr&r'r(r)r*r+r,r-r.r/r0r2r3r4r5r6r;)Z
ensure_stringrIZget_contactZget_contact_emailZensure_string_list�
isinstancer%�listrCrD�exists�append�_format_changelogr&Zensure_filename)r=Zreadmer>r>r?rK�sB
��



















zbdist_rpm.finalize_package_datacCs�tr<td�td|j�td|j�td|j�td|j�|jrT|j}|�|�n8i}dD]&}t	j
�|j|�||<|�||�q\|d}t	j
�|d|j
���}|�t||��fd	|�|jr�dS|j
jdd�}|�d
�}|jr�dg|_ndg|_|�d
�||j
_|��d
}|d}|�||�|j�rbt	j
�|j��rT|�|j|�ntd|j��t�d�dg}	|j�r�|	�d�n|j �r�|	�d�n
|	�d�|	�!dd|j"g�|j#�r�|	�!ddt	j
�$|j�g�|j%�s�|	�d�|j&�r|	�d�|	�|�d}
|
d}d|
d}d|||f}
t	�'|
�}zlg}d}|�)�}|�sV�q�|�*��+�}|�|d�|dk�rD|d
}�qD|�(�}|�r�t,d t-|
���W5|�(�X|�.|	�|j/�s�|j
�0��r�t1�}nd!}|j �s(t	j
�|d"|�}|�2||j�t	j
�|j|�}|j
j�d#||f�|j�s�|D]`}t	j
�|d$|�}t	j
�|��r4|�2||j�t	j
�|jt	j
�3|��}|j
j�d#||f��q4dS)%Nzbefore _get_package_data():zvendor =z
packager =zdoc_files =zchangelog =)�SOURCES�SPECSZBUILD�RPMS�SRPMSrTz%s.speczwriting '%s'�sdistZbztarZgztarrrSzicon file '%s' does not existz
building RPMsZrpmbuildz-bsz-bbz-baz--definez__python %sz
_topdir %sz--cleanz--quietz%{name}-%{version}-%{release}z.src.rpmz%{arch}/z.%{arch}.rpmz%rpm -q --qf '%s %s\n' --specfile '%s'rzFailed to execute: %s�anyrVr	rU)4r�printr#r$r%r&rrZmkpathrCrDrErrI�get_nameZexecuter�_make_spec_fileZ
dist_filesZreinitialize_commandrZformatsZrun_commandZget_archive_filesZ	copy_filer'rPZDistutilsFileErrorr�inforrQr�extendrr9�abspathr7r�popen�close�readline�strip�splitZDistutilsExecError�reprZspawnZdry_runrJrZ	move_file�basename)r=Zspec_dirZrpm_dirr
Z	spec_pathZsaved_dist_filesrW�sourceZ
source_dirZrpm_cmdZ
nvr_stringZsrc_rpmZnon_src_rpmZq_cmd�outZbinary_rpmsZ
source_rpm�line�lZstatusZ	pyversionZsrpm�filenamerAr>r>r?�runs����


�

�


�



�

��z
bdist_rpm.runcCstj�|jtj�|��S)N)rCrDrErre)r=rDr>r>r?�
_dist_path�szbdist_rpm._dist_pathc
CsJd|j��d|j���dd�d|j��d|j�dd�dd|j��g}t�d	�}d
�dd�|�	�D��}d
}d}|�||�}||kr�|�
d�|�
d|d
�|�dddg�|jr�|�
d�n
|�
d�|�d|j�
�d|jddg�|j�s|j���s&|�
d�n|�
d|j�dD]V}t||���}t|t��rb|�
d|d�|�f�n|dk	�r*|�
d||f��q*|j��d k�r�|�
d!|j���|j�r�|�
d"|j�|j�r�|�
d#d�|j��|j�r�|�
d$tj�|j��|j�r|�
d%�|�dd&|j��g�d'|jtj�tj d(�f}d)|}	|j!�rXd*|	}	d+|}
d,d-d.|	fd/d0|
fd1d2d3d4d5d6g	}|D]n\}}
}t||
�}|�s�|�r�|�dd7|g�|�r�t"|��}|�|�#��$d
��W5QRXn
|�
|��q�|�dd8d9g�|j%�r$|�
d:d�|j%��|j&�rF|�dd;g�|�|j&�|S)<ziGenerate the text of an RPM spec file and return it as a
        list of strings (one per line).
        z
%define name z%define version �-�_z%define unmangled_version z%define release �z	Summary: zrpm --eval %{__os_install_post}�
cSsg|]}d|���qS)z  %s \)rb)�.0rhr>r>r?�
<listcomp>�s�z-bdist_rpm._make_spec_file.<locals>.<listcomp>zbrp-python-bytecompile \
z%brp-python-bytecompile %{__python} \
z2# Workaround for http://bugs.python.org/issue14443z%define __os_install_post z
Name: %{name}zVersion: %{version}zRelease: %{release}z-Source0: %{name}-%{unmangled_version}.tar.bz2z,Source0: %{name}-%{unmangled_version}.tar.gzz	License: zGroup: z>BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildrootzPrefix: %{_prefix}zBuildArch: noarchz
BuildArch: %s)ZVendorZPackagerZProvidesZRequiresZ	ConflictsZ	Obsoletesz%s: %s� NZUNKNOWNzUrl: zDistribution: zBuildRequires: zIcon: z
AutoReq: 0z%descriptionz%s %srz%s buildzenv CFLAGS="$RPM_OPT_FLAGS" z>%s install -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES)r1r(z&%setup -n %{name}-%{unmangled_version}Zbuildr)Zinstallr*)Zcleanr+zrm -rf $RPM_BUILD_ROOT)Zverifyscriptr,N)Zprer-N)Zpostr.N)Zpreunr/N)Zpostunr0N�%z%files -f INSTALLED_FILESz%defattr(-,root,root)z%doc z
%changelog)'rIrZZget_version�replacer!Zget_description�
subprocessZ	getoutputrE�
splitlinesrQr]rZget_licenser r;rJ�getattr�lowerrNrOZget_urlrr5r'rCrDrer:Zget_long_descriptionrrF�argvr8�open�readrcr%r&)r=Z	spec_fileZvendor_hookZproblemZfixedZ
fixed_hookZfield�valZdef_setup_callZ	def_buildZinstall_cmdZscript_optionsZrpm_opt�attr�default�fr>r>r?r[�s��

�
	�
�

�
���
�
 ��zbdist_rpm._make_spec_filecCs||s|Sg}|���d�D]N}|��}|ddkrB|�d|g�q|ddkrZ|�|�q|�d|�q|dsx|d=|S)zKFormat the changelog correctly and convert it to a list of strings
        rprrrormz  )rbrcr]rQ)r=r&Z
new_changelogrhr>r>r?rR1szbdist_rpm._format_changelogN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsZnegative_optr@rLrKrkrlr[rRr>r>r>r?r	sx�m��--*r	)�__doc__rvrFrCZdistutils.corerZdistutils.debugrZdistutils.utilrZdistutils.file_utilrZdistutils.errorsZdistutils.sysconfigrZ	distutilsrr	r>r>r>r?�<module>sdistutils/command/__pycache__/config.cpython-38.opt-2.pyc000064400000015355151153537440017274 0ustar00U

e5d=3�@shddlZddlZddlmZddlmZddlmZddlm	Z	ddd�Z
Gd	d
�d
e�Zd
dd�ZdS)�N)�Command)�DistutilsExecError)�customize_compiler)�logz.cz.cxx)�czc++c	@s�eZdZdZdddddddd	d
g	Zdd�Zd
d�Zdd�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
d0dd �Zd1d!d"�Zd2d#d$�Zd3d%d&�Zd4d'd(�Zd5d*d+�Zdddgfd,d-�Zd6d.d/�ZdS)7�configzprepare to build)z	compiler=Nzspecify the compiler type)zcc=Nzspecify the compiler executable)z
include-dirs=�Iz.list of directories to search for header files)zdefine=�DzC preprocessor macros to define)zundef=�Uz!C preprocessor macros to undefine)z
libraries=�lz!external C libraries to link with)z
library-dirs=�Lz.directories to search for external C libraries)�noisyNz1show every action (compile, link, run, ...) taken)zdump-sourceNz=dump generated source files before attempting to compile themcCs4d|_d|_d|_d|_d|_d|_d|_g|_dS)N�)�compilerZcc�include_dirs�	libraries�library_dirsr
�dump_source�
temp_files��self�r�0/usr/lib64/python3.8/distutils/command/config.py�initialize_options3szconfig.initialize_optionscCs�|jdkr|jjpg|_nt|jt�r6|j�tj�|_|jdkrHg|_nt|jt�r^|jg|_|jdkrpg|_nt|jt�r�|j�tj�|_dS�N)	rZdistribution�
isinstance�str�split�os�pathseprrrrrr�finalize_optionsBs



zconfig.finalize_optionscCsdSrrrrrr�runRsz
config.runcCszddlm}m}t|j|�sv||j|jdd�|_t|j�|jrN|j�|j�|j	rb|j�
|j	�|jrv|j�|j�dS)Nr)�	CCompiler�new_compilerr)r�dry_runZforce)
�distutils.ccompilerr"r#rrr$rrZset_include_dirsrZ
set_librariesrZset_library_dirs)rr"r#rrr�_check_compilerYs�
zconfig._check_compilerc	Csldt|}t|d��L}|r>|D]}|�d|�q |�d�|�|�|ddkr^|�d�W5QRX|S)NZ_configtest�wz#include <%s>
�
���)�LANG_EXT�open�write)r�body�headers�lang�filename�file�headerrrr�_gen_temp_sourcefileks

zconfig._gen_temp_sourcefilecCs<|�|||�}d}|j�||g�|jj|||d�||fS)Nz
_configtest.i�r)r3r�extendrZ
preprocess)rr-r.rr/�src�outrrr�_preprocessws
zconfig._preprocesscCs\|�|||�}|jr"t|d|�|j�|g�\}|j�||g�|jj|g|d�||fS)Nzcompiling '%s':r4)r3r�	dump_filerZobject_filenamesrr5�compile)rr-r.rr/r6�objrrr�_compile~szconfig._compilec
Csr|�||||�\}}tj�tj�|��d}	|jj|g|	|||d�|jjdk	r\|	|jj}	|j�	|	�|||	fS)Nr)rrZtarget_lang)
r<r�path�splitext�basenamerZlink_executableZ
exe_extensionr�append)
rr-r.rrrr/r6r;�progrrr�_link�s�zconfig._linkc	GsT|s|j}g|_t�dd�|��|D](}zt�|�Wq&tk
rLYq&Xq&dS)Nzremoving: %s� )rr�info�joinr�remove�OSError)r�	filenamesr0rrr�_clean�sz
config._cleanNrcCsRddlm}|��d}z|�||||�Wn|k
rDd}YnX|��|S)Nr��CompileErrorTF)r%rKr&r8rI�rr-r.rr/rK�okrrr�try_cpp�s
zconfig.try_cppc	Csx|��|�||||�\}}t|t�r0t�|�}t|��.}d}	|��}
|
dkrPqb|�|
�r>d}	qbq>W5QRX|�	�|	S)NF�T)
r&r8rr�rer:r+�readline�searchrI)r�patternr-r.rr/r6r7r1�match�linerrr�
search_cpp�s	



zconfig.search_cppcCsdddlm}|��z|�||||�d}Wn|k
rDd}YnXt�|rRdpTd�|��|S)NrrJTF�success!�failure.)r%rKr&r<rrDrIrLrrr�try_compile�s
zconfig.try_compilec
	Cspddlm}m}|��z|�||||||�d}	Wn||fk
rPd}	YnXt�|	r^dp`d�|��|	S�Nr)rK�	LinkErrorTFrWrX)r%rKr[r&rBrrDrI)
rr-r.rrrr/rKr[rMrrr�try_link�s
�
zconfig.try_linkc

Cs�ddlm}m}|��z.|�||||||�\}	}
}|�|g�d}Wn||tfk
rdd}YnXt�|rrdptd�|�	�|SrZ)
r%rKr[r&rBZspawnrrrDrI)
rr-r.rrrr/rKr[r6r;ZexerMrrr�try_run�s
�

zconfig.try_runrc	Cst|��g}|r|�d|�|�d�|r<|�d|�n|�d|�|�d�d�|�d}|�|||||�S)Nz
int %s ();z
int main () {z  %s();z  %s;�}r()r&r@rEr\)	r�funcr.rrrZdeclZcallr-rrr�
check_funcs


�zconfig.check_funccCs |��|�d|||g||�S)Nzint main (void) { })r&r\)rZlibraryrr.rZother_librariesrrr�	check_lib4s


�zconfig.check_libcCs|jd|g|d�S)Nz
/* No body */)r-r.r)rN)rr2rrr/rrr�check_headerBs
�zconfig.check_header)NNNr)NNNr)NNr)NNNNr)NNNNr)NNNNrr)NNr)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsrr r!r&r3r8r<rBrIrNrVrYr\r]r`rarbrrrrrs\�	
�

�
�
�
�
�rcCsJ|dkrt�d|�n
t�|�t|�}zt�|���W5|��XdS)Nz%s)rrDr+�close�read)r0�headr1rrrr9Ks
r9)N)
rrPZdistutils.corerZdistutils.errorsrZdistutils.sysconfigrZ	distutilsrr*rr9rrrr�<module>s
8distutils/command/__pycache__/install.cpython-38.opt-2.pyc000064400000030624151153537440017471 0ustar00U

&�.e�j�@sddlZddlZddlmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZmZmZdd	lmZdd
l
mZddlmZddlmZd
Zdddddd�Zdddddd�dddddd�ed�Ze�rdddddd�ed<ddd d!dd�ed"<dZGd#d$�d$e�ZdS)%�N)�log)�Command)�DEBUG)�get_config_vars)�DistutilsPlatformError)�
write_file)�convert_path�
subst_vars�change_root)�get_platform)�DistutilsOptionError)�	USER_BASE)�	USER_SITETz$base/Lib/site-packagesz$base/Include/$dist_namez
$base/Scriptsz$base)�purelib�platlib�headers�scripts�dataz/$base/lib/python$py_version_short/site-packagesz5$platbase/lib64/python$py_version_short/site-packagesz9$base/include/python$py_version_short$abiflags/$dist_namez	$base/binz$base/lib/pythonz$base/lib64/pythonz$base/include/python/$dist_name)�unix_prefix�	unix_home�ntz	$usersitez4$userbase/Python$py_version_nodot/Include/$dist_namez)$userbase/Python$py_version_nodot/Scriptsz	$userbaseZnt_userz=$userbase/include/python$py_version_short$abiflags/$dist_namez
$userbase/bin�	unix_userc@s:eZdZdZdddddddd	d
ddd
ddddddgZdddgZer`e�dddef�e�d�ddiZ	dd�Z
dd�Zdd �Zd!d"�Z
d#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Zd=d>�Zd?d@�ZdAdB�ZdCdD�ZdEefdFefdGefdHefdIdJdK�fgZdS)L�installz'install everything from build directory)zprefix=Nzinstallation prefix)zexec-prefix=Nz.(Unix only) prefix for platform-specific files)zhome=Nz+(Unix only) home directory to install under)z
install-base=Nz;base installation directory (instead of --prefix or --home))zinstall-platbase=Nz\base installation directory for platform-specific files (instead of --exec-prefix or --home))zroot=Nz<install everything relative to this alternate root directory)zinstall-purelib=Nz;installation directory for pure Python module distributions)zinstall-platlib=Nz8installation directory for non-pure module distributions)zinstall-lib=Nzginstallation directory for all module distributions (overrides --install-purelib and --install-platlib))zinstall-headers=Nz(installation directory for C/C++ headers)zinstall-scripts=Nz)installation directory for Python scripts)z
install-data=Nz%installation directory for data files)�compile�czcompile .py to .pyc [default])�
no-compileNzdon't compile .py files)z	optimize=�Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])�force�fz1force installation (overwrite any existing files))�
skip-buildNz2skip rebuilding everything (for testing/debugging))zrecord=Nz3filename in which to record list of installed filesrrr�userNz!install in user site-package '%s'rcCs�d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_t
|_t|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr�)�prefix�exec_prefix�homer �install_base�install_platbase�root�install_purelib�install_platlib�install_headers�install_lib�install_scripts�install_datar
�install_userbaser�install_usersiter�optimize�
extra_path�install_path_filer�
skip_build�warn_dir�
build_base�	build_lib�record��self�r:�1/usr/lib64/python3.8/distutils/command/install.py�initialize_options�s2zinstall.initialize_optionscCsx|js|js|jr&|js|jr&td��|jr@|js8|jr@td��|jrl|jsd|jsd|jsd|jsd|jrltd��tjdkr�|jr�|�	d�d|_|�
d�tjdkr�|��n|��|�
d�t
j��d}td	d
�\}}z
t
j}Wntk
r�d}YnX|j��|j��|j��|dt
jdd
�dt
jdd
�|||||d�|_t�rf|j|jd<|j|jd<|��|�
d�|j|jd<|j|jd<t�r�ddlm}td�||j�|� �|�
d�|j�r�|�!�|j"dk�r�|jj#�r�|j$|_"n|j%|_"|�&dddddddd�|�'�|j"|_(tj)�*|j"|j+�|_"|j,dk	�r\|�-ddddddd�|�
d�|�.d d!d"�dS)#NzWmust supply either prefix/exec-prefix/home or install-base/install-platbase -- not bothz9must supply either home or prefix/exec-prefix -- not bothzGcan't combine user with prefix, exec_prefix/home, or install_(plat)base�posixz+exec-prefix option ignored on this platformzpre-finalize_{unix,other}zpost-finalize_{unix,other}()rr"r#�z%d.%d�z%d%d)Z	dist_nameZdist_versionZ
dist_fullname�
py_versionZpy_version_shortZpy_version_nodotZ
sys_prefixr"Zsys_exec_prefixr#�abiflags�userbaseZusersitezpost-expand_basedirs()�baseZplatbase)�pprintzconfig vars:zpost-expand_dirs()�librrrrrZlibbasezafter prepending root�build)r5r5)r6r6)/r"r#r$r%r&rr �os�name�warn�	dump_dirs�
finalize_unix�finalize_other�sys�version�splitrrA�AttributeError�distributionZget_nameZget_versionZget_fullname�version_info�config_vars�
HAS_USER_SITEr.r/�expand_basedirsrrD�print�expand_dirs�create_home_pathr+Zext_modulesr)r(�
convert_paths�handle_extra_path�install_libbase�path�join�
extra_dirsr'�change_rootsZset_undefined_options)r9r@r"r#rArDr:r:r;�finalize_options�s�������








�






�	�
�zinstall.finalize_optionscCs�tsdSddlm}t�|d�|jD]r}|d}|ddkrL|dd�}||jkrx|j|}|�|�}t||�}n|�|�}t||�}t�d||�q(dS)Nr)�
longopt_xlate�:����=z  %s: %s)	rZdistutils.fancy_getoptrar�debug�user_options�negative_opt�	translate�getattr)r9�msgra�optZopt_name�valr:r:r;rJus





zinstall.dump_dirscCsV|jdk	s|jdk	r\|jdkr2|jdkr2|jdksP|jdksP|jdksP|jdkrXtd��dS|j	r�|j
dkrttd��|j
|_|_|�d�n�|j
dk	r�|j
|_|_|�d�n�|jdk�r$|jdk	r�td��ttd�s�tjtjks�dtjkr�d}nd	}tj�tj�||_tj�tj�||_n|jdk�r8|j|_|j|_|j|_|�d
�dS)NzPinstall-base or install-platbase supplied, but installation scheme is incomplete�$User base directory is not specifiedrrz*must not supply exec-prefix without prefixZreal_prefix�RPM_BUILD_ROOTz/localr>r)r%r&r+r(r)r*r,r-rr r.r�
select_schemer$r"r#�hasattrrM�base_prefixrG�environr\�normpath)r9Zadditionr:r:r;rK�sZ
������
�

�

��zinstall.finalize_unixcCs�|jr8|jdkrtd��|j|_|_|�tjd�n�|jdk	r\|j|_|_|�d�n\|j	dkrvtj
�tj	�|_	|j	|_|_z|�tj�Wn"t
k
r�tdtj��YnXdS)NrmZ_userrz)I don't know how to install stuff on '%s')r r.rr%r&rorGrHr$r"r\rsrM�KeyErrorr8r:r:r;rL�s&
�

�zinstall.finalize_othercCs<t|}tD]*}d|}t||�dkrt||||�qdS�NZinstall_)�INSTALL_SCHEMES�SCHEME_KEYSri�setattr)r9rHZscheme�key�attrnamer:r:r;ro�s
zinstall.select_schemecCsX|D]N}t||�}|dk	rtjdks.tjdkr:tj�|�}t||j�}t|||�qdS)Nr=r)rirGrHr\�
expanduserr	rSrx)r9�attrs�attrrlr:r:r;�
_expand_attrs�s
zinstall._expand_attrscCs|�dddg�dS)Nr%r&r'�r~r8r:r:r;rU�szinstall.expand_basedirscCs|�ddddddg�dS)Nr(r)r+r*r,r-rr8r:r:r;rW�s�zinstall.expand_dirscGs,|D]"}d|}t||tt||���qdSru)rxrri�r9�namesrHr}r:r:r;rY�szinstall.convert_pathscCs�|jdkr|jj|_|jdk	r�t�d�t|jt�rB|j�d�|_t|j�dkr`|jd}}n"t|j�dkrz|j\}}ntd��t	|�}nd}d}||_
||_dS)NzIDistribution option extra_path is deprecated. See issue27919 for details.�,r!rr?zY'extra_path' option must be a list, tuple, or comma-separated string with 1 or 2 elementsr>)r1rQrrI�
isinstance�strrO�lenrr�	path_filer^)r9r�r^r:r:r;rZ�s(


��
zinstall.handle_extra_pathc	Gs0|D]&}d|}t||t|jt||���qdSru)rxr
r'rir�r:r:r;r_szinstall.change_rootscCsb|js
dSttj�d��}|j��D]8\}}|�|�r$tj�|�s$|�	d|�t�
|d�q$dS)N�~zos.makedirs('%s', 0o700)i�)r rrGr\r{rS�items�
startswith�isdirZdebug_print�makedirs)r9r$rHr\r:r:r;rXszinstall.create_home_pathcCs"|js6|�d�|j�d�j}|jr6|t�kr6td��|��D]}|�|�q>|j	r\|�
�|jr�|��}|j
r�t|j
�}tt|��D]}|||d�||<q�|�t|j|fd|j�ttjjtj�}ttjj|�}tj�tj�|j��}|j�r|j	�r|j�s||k�rt�d|j�dS)NrFz"Can't install when cross-compilingz'writing list of installed files to '%s'z�modules installed to '%s', which is not in Python's module search path (sys.path) -- you'll have to change the search path yourself)r3Zrun_commandrQZget_command_objZ	plat_namer4rr�get_sub_commandsr��create_path_filer7�get_outputsr'r��range�executer�maprGr\rsrM�normcaser+r2rre)r9Z
build_plat�cmd_name�outputsZroot_lenZcounterZsys_pathr+r:r:r;�run(sD

������zinstall.runcCsJtj�|j|jd�}|jr8|�t||jgfd|�n|�	d|�dS)N�.pthzcreating %szpath file '%s' not created)
rGr\r]r[r�r2r�rr^rI)r9�filenamer:r:r;r�Ts
�
�zinstall.create_path_filecCshg}|��D].}|�|�}|��D]}||kr"|�|�q"q|jrd|jrd|�tj�|j	|jd��|S)Nr�)
r��get_finalized_commandr��appendr�r2rGr\r]r[)r9r�r��cmdr�r:r:r;r�bs
�zinstall.get_outputscCs.g}|��D]}|�|�}|�|���q|S�N)r�r��extend�
get_inputs)r9Zinputsr�r�r:r:r;r�ss

zinstall.get_inputscCs|j��p|j��Sr�)rQZhas_pure_modulesZhas_ext_modulesr8r:r:r;�has_libs
�zinstall.has_libcCs
|j��Sr�)rQ�has_headersr8r:r:r;r��szinstall.has_headerscCs
|j��Sr�)rQ�has_scriptsr8r:r:r;r��szinstall.has_scriptscCs
|j��Sr�)rQZhas_data_filesr8r:r:r;�has_data�szinstall.has_datar+r*r,r-Zinstall_egg_infocCsdS)NTr:r8r:r:r;�<lambda>��zinstall.<lambda>) �__name__�
__module__�__qualname__ZdescriptionrfZboolean_optionsrTr�rrgr<r`rJrKrLror~rUrWrYrZr_rXr�r�r�r�r�r�r�r�Zsub_commandsr:r:r:r;rIsn	�;
�
N3		",
�r)rMrGZ	distutilsrZdistutils.corerZdistutils.debugrZdistutils.sysconfigrZdistutils.errorsrZdistutils.file_utilrZdistutils.utilrr	r
rrZsiter
rrTZWINDOWS_SCHEMErvrwrr:r:r:r;�<module>s`�
����
	�
distutils/command/__pycache__/install_scripts.cpython-38.pyc000064400000004137151153537440020300 0ustar00U

e5d��@sDdZddlZddlmZddlmZddlmZGdd�de�ZdS)zudistutils.command.install_scripts

Implements the Distutils 'install_scripts' command, for installing
Python scripts.�N)�Command)�log)�ST_MODEc@sLeZdZdZddddgZddgZdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dS)�install_scriptsz%install scripts (Python or otherwise))zinstall-dir=�dzdirectory to install scripts to)z
build-dir=�bz'build directory (where to install from))�force�fz-force installation (overwrite existing files))�
skip-buildNzskip the build stepsrr
cCsd|_d|_d|_d|_dS)Nr)�install_dirr�	build_dir�
skip_build��self�r�9/usr/lib64/python3.8/distutils/command/install_scripts.py�initialize_optionssz"install_scripts.initialize_optionscCs |�dd�|�dddd�dS)NZbuild)�
build_scriptsrZinstall)rr)rr)r
r
)Zset_undefined_optionsrrrr�finalize_options!s�z install_scripts.finalize_optionscCs�|js|�d�|�|j|j�|_tjdkr~|��D]H}|j	rLt
�d|�q4t�|�t
dBd@}t
�d||�t�||�q4dS)Nr�posixzchanging mode of %simi�zchanging mode of %s to %o)r
Zrun_commandZ	copy_treerr�outfiles�os�name�get_outputsZdry_runr�info�statr�chmod)r�file�moderrr�run)s

zinstall_scripts.runcCs|jjp
gS�N)ZdistributionZscriptsrrrr�
get_inputs8szinstall_scripts.get_inputscCs
|jpgSr )rrrrrr;szinstall_scripts.get_outputsN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsrrrr!rrrrrrs�r)	�__doc__rZdistutils.corerZ	distutilsrrrrrrrr�<module>s
distutils/command/__pycache__/install_egg_info.cpython-38.opt-2.pyc000064400000004417151153537440021327 0ustar00U

e5d+
�@s`ddlmZddlmZmZddlZddlZddlZGdd�de�Zdd�Z	dd	�Z
d
d�ZdS)�)�Command)�log�dir_utilNc@s6eZdZdZdgZdd�Zdd�Zdd�Zd	d
�ZdS)�install_egg_infoz8Install package's PKG-INFO metadata as an .egg-info file)zinstall-dir=�dzdirectory to install tocCs
d|_dS�N)�install_dir��self�r�:/usr/lib64/python3.8/distutils/command/install_egg_info.py�initialize_optionssz#install_egg_info.initialize_optionscCsb|�dd�dtt|j����tt|j����ftjdd��}t	j
�|j|�|_
|j
g|_dS)NZinstall_lib)rrz%s-%s-py%d.%d.egg-info�)Zset_undefined_options�to_filename�	safe_name�distributionZget_name�safe_versionZget_version�sys�version_info�os�path�joinr�target�outputs)r
�basenamerrr�finalize_optionss��z!install_egg_info.finalize_optionsc	Cs�|j}tj�|�r0tj�|�s0tj||jd�nNtj�|�rV|�	tj
|jfd|�n(tj�|j�s~|�	tj|jfd|j�t
�d|�|js�t|ddd��}|jj�|�W5QRXdS)N)�dry_runz	Removing z	Creating z
Writing %s�wzUTF-8)�encoding)rrr�isdir�islinkrZremove_treer�existsZexecute�unlinkr�makedirsr�info�openrZmetadataZwrite_pkg_file)r
r�frrr�run s�zinstall_egg_info.runcCs|jSr)rr	rrr�get_outputs.szinstall_egg_info.get_outputsN)	�__name__�
__module__�__qualname__ZdescriptionZuser_optionsr
rr'r(rrrrrs�
rcCst�dd|�S)N�[^A-Za-z0-9.]+�-)�re�sub��namerrrr6srcCs|�dd�}t�dd|�S)N� �.r,r-)�replacer.r/)�versionrrrr>srcCs|�dd�S)Nr-�_)r4r0rrrrHsr)Z
distutils.cmdrZ	distutilsrrrrr.rrrrrrrr�<module>s+
distutils/command/__pycache__/bdist.cpython-38.opt-2.pyc000064400000006622151153537440017131 0ustar00U

e5d��@sDddlZddlmZddlTddlmZdd�ZGdd�de�ZdS)	�N)�Command)�*)�get_platformcCsPddlm}g}tjD]"}|�d|dtj|df�q||�}|�d�dS)Nr)�FancyGetopt�formats=�z'List of available distribution formats:)Zdistutils.fancy_getoptr�bdist�format_commands�append�format_commandZ
print_help)r�formats�formatZpretty_printer�r�//usr/lib64/python3.8/distutils/command/bdist.py�show_formatss
�rc
@s�eZdZdZdddde�fdddd	d
gZdgZdd
defgZdZ	ddd�Z
dddddddddg	Zddddddd d!d"d#�	Zd$d%�Z
d&d'�Zd(d)�Zd
S)*rz$create a built (binary) distribution)zbdist-base=�bz4temporary directory for creating built distributionsz
plat-name=�pz;platform name to embed in generated filenames (default: %s))rNz/formats for distribution (comma-separated list))z	dist-dir=�dz=directory to put final built distributions in [default: dist])�
skip-buildNz2skip rebuilding everything (for testing/debugging))zowner=�uz@Owner name used when creating a tar file [default: current user])zgroup=�gzAGroup name used when creating a tar file [default: current group]rzhelp-formatsNz$lists available distribution formats)�	bdist_rpm�gztar�zip)�posix�nt�rpm�bztar�xztar�ztar�tar�wininst�msi)rzRPM distribution)�
bdist_dumbzgzip'ed tar file)r#zbzip2'ed tar file)r#zxz'ed tar file)r#zcompressed tar file)r#ztar file)Z
bdist_wininstzWindows executable installer)r#zZIP file)Z	bdist_msizMicrosoft Installer)	rrrrrr r!rr"cCs.d|_d|_d|_d|_d|_d|_d|_dS)Nr)�
bdist_base�	plat_namer�dist_dir�
skip_build�group�owner)�selfrrr�initialize_optionsQszbdist.initialize_optionscCs�|jdkr(|jrt�|_n|�d�j|_|jdkrT|�d�j}tj�|d|j�|_|�	d�|j
dkr�z|jtjg|_
Wn"t
k
r�tdtj��YnX|jdkr�d|_dS)NZbuildzbdist.rz;don't know how to create built distributions on platform %sZdist)r%r'rZget_finalized_commandr$�
build_base�os�path�joinZensure_string_listr�default_format�name�KeyErrorZDistutilsPlatformErrorr&)r*r,rrr�finalize_optionsZs*


�

��

zbdist.finalize_optionsc	Cs�g}|jD]>}z|�|j|d�Wq
tk
rFtd|��Yq
Xq
tt|j��D]h}||}|�|�}||jkr�|j||_	|dkr�|j
|_
|j|_|||dd�kr�d|_|�
|�qXdS)Nrzinvalid format '%s'r#r)rr
rr2ZDistutilsOptionError�range�lenZreinitialize_command�no_format_optionr
r)r(Z	keep_tempZrun_command)r*Zcommandsr
�iZcmd_nameZsub_cmdrrr�runvs"


z	bdist.run)�__name__�
__module__�__qualname__ZdescriptionrZuser_optionsZboolean_optionsrZhelp_optionsr6r0r	rr+r3r8rrrrrsR��������
	r)r-Zdistutils.corerZdistutils.errorsZdistutils.utilrrrrrrr�<module>s
distutils/command/__pycache__/install_data.cpython-38.pyc000064400000004363151153537440017523 0ustar00U

e5d�@s<dZddlZddlmZddlmZmZGdd�de�ZdS)z�distutils.command.install_data

Implements the Distutils 'install_data' command, for installing
platform-independent data files.�N)�Command)�change_root�convert_pathc@sHeZdZdZdddgZdgZdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)�install_datazinstall data files)zinstall-dir=�dzIbase directory for installing data files (default: installation base dir))zroot=Nz<install everything relative to this alternate root directory)�force�fz-force installation (overwrite existing files)rcCs,d|_g|_d|_d|_|jj|_d|_dS)Nr�)�install_dir�outfiles�rootrZdistribution�
data_files�warn_dir��self�r�6/usr/lib64/python3.8/distutils/command/install_data.py�initialize_optionss
zinstall_data.initialize_optionscCs|�dddd�dS)NZinstall)rr
)rr)rr)Zset_undefined_optionsrrrr�finalize_options#s
�zinstall_data.finalize_optionscCs�|�|j�|jD]�}t|t�rbt|�}|jrB|�d||jf�|�||j�\}}|j	�
|�qt|d�}tj�
|�s�tj�|j|�}n|jr�t|j|�}|�|�|dgkr�|j	�
|�q|dD](}t|�}|�||�\}}|j	�
|�q�qdS)NzMsetup script did not provide a directory for '%s' -- installing right in '%s'rr	)Zmkpathr
r
�
isinstance�strrr�warnZ	copy_filer�append�os�path�isabs�joinrr)rr�out�_�dir�datarrr�run*s,

�
zinstall_data.runcCs
|jpgS�N)r
rrrr�
get_inputsKszinstall_data.get_inputscCs|jSr")rrrrr�get_outputsNszinstall_data.get_outputsN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsrrr!r#r$rrrrrs�	!r)�__doc__rZdistutils.corerZdistutils.utilrrrrrrr�<module>sdistutils/command/__pycache__/__init__.cpython-38.opt-2.pyc000064400000000664151153537440017563 0ustar00U

e5d�@s.dddddddddd	d
ddd
dddddgZdS)ZbuildZbuild_pyZ	build_extZ
build_clibZ
build_scriptsZcleanZinstallZinstall_libZinstall_headersZinstall_scriptsZinstall_dataZsdist�registerZbdistZ
bdist_dumbZ	bdist_rpmZ
bdist_wininstZcheckZuploadN)�__all__�rr�2/usr/lib64/python3.8/distutils/command/__init__.py�<module>s&�distutils/command/__pycache__/install_lib.cpython-38.opt-2.pyc000064400000010666151153537440020323 0ustar00U

e5d� �@sHddlZddlZddlZddlmZddlmZdZGdd�de�Z	dS)�N)�Command)�DistutilsOptionErrorz.pyc@s�eZdZdZdddddddgZd	d
dgZdd
iZd
d�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd �Zd!S)"�install_libz7install all Python modules (extensions and pure Python))zinstall-dir=�dzdirectory to install to)z
build-dir=�bz'build directory (where to install from))�force�fz-force installation (overwrite existing files))�compile�czcompile .py to .pyc [default])�
no-compileNzdon't compile .py files)z	optimize=�Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])�
skip-buildNzskip the build stepsrr	r
rcCs(d|_d|_d|_d|_d|_d|_dS)Nr)�install_dir�	build_dirrr	�optimize�
skip_build��self�r�5/usr/lib64/python3.8/distutils/command/install_lib.py�initialize_options3szinstall_lib.initialize_optionsc	Cs�|�ddddddd�|jdkr&d|_|jdkr6d	|_t|jt�s�zt|j�|_|jd
kr^t�Wn ttfk
r�td��YnXdS)N�install)�	build_libr)rr)rr)r	r	)rr)rrTF)r��zoptimize must be 0, 1, or 2)Zset_undefined_optionsr	r�
isinstance�int�AssertionError�
ValueErrorrrrrr�finalize_options<s&�	


zinstall_lib.finalize_optionscCs0|��|��}|dk	r,|j��r,|�|�dS�N)�buildr�distribution�has_pure_modules�byte_compile�rZoutfilesrrr�runVszinstall_lib.runcCs2|js.|j��r|�d�|j��r.|�d�dS�N�build_py�	build_ext)rr"r#Zrun_command�has_ext_modulesrrrrr!fs



zinstall_lib.buildcCs8tj�|j�r |�|j|j�}n|�d|j�dS|S)Nz3'%s' does not exist -- no Python modules to install)�os�path�isdirrZ	copy_treer�warnr%rrrrms�zinstall_lib.installcCsrtjr|�d�dSddlm}|�d�j}|jrH||d|j||j	d�|j
dkrn|||j
|j||j|j	d�dS)Nz%byte-compiling is disabled, skipping.r)r$r)rr�prefix�dry_run)rrr/�verboser0)�sys�dont_write_bytecoder.Zdistutils.utilr$�get_finalized_command�rootr	rr0rr1)r�filesr$Zinstall_rootrrrr$vs$
�
�zinstall_lib.byte_compilec
	Csd|sgS|�|�}|��}t||�}t|�ttj�}g}|D] }	|�tj�||	|d���q>|Sr )	r4�get_outputs�getattr�lenr+�sep�appendr,�join)
rZhas_anyZ	build_cmdZ
cmd_optionZ
output_dirZbuild_filesr�
prefix_lenZoutputs�filerrr�_mutate_outputs�s

zinstall_lib._mutate_outputscCsrg}|D]d}tj�tj�|��d}|tkr.q|jrJ|�tjj	|dd��|j
dkr|�tjj	||j
d��q|S)Nr�)�optimizationr)r+r,�splitext�normcase�PYTHON_SOURCE_EXTENSIONr	r;�	importlib�util�cache_from_sourcer)rZpy_filenamesZbytecode_filesZpy_fileZextrrr�_bytecode_filenames�s 
�

�
zinstall_lib._bytecode_filenamescCsR|�|j��dd|j�}|jr*|�|�}ng}|�|j��dd|j�}|||S)Nr(rr))r?r"r#rr	rHr*)rZpure_outputsZbytecode_outputsZext_outputsrrrr7�s ����zinstall_lib.get_outputscCsLg}|j��r&|�d�}|�|���|j��rH|�d�}|�|���|Sr')r"r#r4�extendr7r*)rZinputsr(r)rrr�
get_inputs�s



zinstall_lib.get_inputsN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsZnegative_optrrr&r!rr$r?rHr7rJrrrrrs*�
		r)
r+�importlib.utilrEr2Zdistutils.corerZdistutils.errorsrrDrrrrr�<module>sdistutils/command/__pycache__/bdist.cpython-38.opt-1.pyc000064400000007124151153537440017126 0ustar00U

e5d��@sHdZddlZddlmZddlTddlmZdd�ZGdd	�d	e�ZdS)
zidistutils.command.bdist

Implements the Distutils 'bdist' command (create a built [binary]
distribution).�N)�Command)�*)�get_platformcCsPddlm}g}tjD]"}|�d|dtj|df�q||�}|�d�dS)zFPrint list of available formats (arguments to "--format" option).
    r)�FancyGetopt�formats=N�z'List of available distribution formats:)Zdistutils.fancy_getoptr�bdist�format_commands�append�format_commandZ
print_help)r�formats�formatZpretty_printer�r�//usr/lib64/python3.8/distutils/command/bdist.py�show_formatss
�rc
@s�eZdZdZdddde�fdddd	d
gZdgZdd
defgZdZ	ddd�Z
dddddddddg	Zddddddd d!d"d#�	Zd$d%�Z
d&d'�Zd(d)�Zd
S)*rz$create a built (binary) distribution)zbdist-base=�bz4temporary directory for creating built distributionsz
plat-name=�pz;platform name to embed in generated filenames (default: %s))rNz/formats for distribution (comma-separated list))z	dist-dir=�dz=directory to put final built distributions in [default: dist])�
skip-buildNz2skip rebuilding everything (for testing/debugging))zowner=�uz@Owner name used when creating a tar file [default: current user])zgroup=�gzAGroup name used when creating a tar file [default: current group]rzhelp-formatsNz$lists available distribution formats)�	bdist_rpm�gztar�zip)�posix�nt�rpm�bztar�xztar�ztar�tar�wininst�msi)rzRPM distribution)�
bdist_dumbzgzip'ed tar file)r#zbzip2'ed tar file)r#zxz'ed tar file)r#zcompressed tar file)r#ztar file)Z
bdist_wininstzWindows executable installer)r#zZIP file)Z	bdist_msizMicrosoft Installer)	rrrrrr r!rr"cCs.d|_d|_d|_d|_d|_d|_d|_dS)Nr)�
bdist_base�	plat_namer�dist_dir�
skip_build�group�owner)�selfrrr�initialize_optionsQszbdist.initialize_optionscCs�|jdkr(|jrt�|_n|�d�j|_|jdkrT|�d�j}tj�|d|j�|_|�	d�|j
dkr�z|jtjg|_
Wn"t
k
r�tdtj��YnX|jdkr�d|_dS)NZbuildzbdist.rz;don't know how to create built distributions on platform %sZdist)r%r'rZget_finalized_commandr$�
build_base�os�path�joinZensure_string_listr�default_format�name�KeyErrorZDistutilsPlatformErrorr&)r*r,rrr�finalize_optionsZs*


�

��

zbdist.finalize_optionsc	Cs�g}|jD]>}z|�|j|d�Wq
tk
rFtd|��Yq
Xq
tt|j��D]h}||}|�|�}||jkr�|j||_	|dkr�|j
|_
|j|_|||dd�kr�d|_|�
|�qXdS)Nrzinvalid format '%s'r#r)rr
rr2ZDistutilsOptionError�range�lenZreinitialize_command�no_format_optionr
r)r(Z	keep_tempZrun_command)r*Zcommandsr
�iZcmd_nameZsub_cmdrrr�runvs"


z	bdist.run)�__name__�
__module__�__qualname__ZdescriptionrZuser_optionsZboolean_optionsrZhelp_optionsr6r0r	rr+r3r8rrrrrsR��������
	r)	�__doc__r-Zdistutils.corerZdistutils.errorsZdistutils.utilrrrrrrr�<module>sdistutils/command/__pycache__/build_scripts.cpython-38.opt-2.pyc000064400000007534151153537440020675 0ustar00U

e5dX�@s�ddlZddlZddlmZddlmZddlmZddlm	Z	ddl
mZmZddlm
Z
ddlZe�d�ZGd	d
�d
e�ZGdd�dee�ZdS)
�N)�ST_MODE)�	sysconfig)�Command)�newer)�convert_path�	Mixin2to3)�logs^#!.*python[0-9.]*([ 	].*)?$c@sHeZdZdZdddgZdgZdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)�
build_scriptsz("build" scripts (copy and fixup #! line))z
build-dir=�dzdirectory to "build" (copy) to)�force�fz1forcibly build everything (ignore file timestamps)zexecutable=�ez*specify final destination interpreter pathrcCs"d|_d|_d|_d|_d|_dS�N)�	build_dir�scriptsr�
executable�outfiles��self�r�7/usr/lib64/python3.8/distutils/command/build_scripts.py�initialize_optionss
z build_scripts.initialize_optionscCs|�dddd�|jj|_dS)NZbuild)r	r)rr)rr)Zset_undefined_optionsZdistributionrrrrr�finalize_options%s�zbuild_scripts.finalize_optionscCs|jSr)rrrrr�get_source_files,szbuild_scripts.get_source_filescCs|js
dS|��dSr)r�copy_scriptsrrrr�run/szbuild_scripts.runc
Cs�|�|j�g}g}|jD�]}d}t|�}tj�|jtj�|��}|�|�|j	slt
||�slt�d|�qzt
|d�}Wn tk
r�|js��d}YnXXt�|j�\}}|�d�|��}	|	s�|�d|�qt�|	�}
|
r�d}|
�d�p�d}|�rt�d	||j�|�|�|j�stj�s*|j}n(tj�t�d
�dt�d�t�d
�f�}t�|�}d||d}
z|
�d�Wn$tk
�r�t d�!|
���YnXz|
�|�Wn&tk
�r�t d�!|
|���YnXt
|d��}|�"|
�|�#|�$��W5QRX|�r8|�%�q|�r"|�%�|�|�|�&||�qtj'dk�r�|D]`}|j�rdt�d|�nDt�(|�t)d@}|dBd@}||k�rJt�d|||�t�*||��qJ||fS)NFznot copying %s (up-to-date)�rbrz%s is an empty file (skipping)T��zcopying and adjusting %s -> %sZBINDIRz
python%s%sZVERSIONZEXEs#!�
zutf-8z.The shebang ({!r}) is not decodable from utf-8zAThe shebang ({!r}) is not decodable from the script encoding ({})�wb�posixzchanging mode of %si�imz!changing mode of %s from %o to %o)+Zmkpathrrr�os�path�join�basename�appendrrr�debug�open�OSError�dry_run�tokenize�detect_encoding�readline�seek�warn�
first_line_re�match�group�inforZpython_buildrZget_config_var�fsencode�decode�UnicodeDecodeError�
ValueError�format�write�
writelines�	readlines�closeZ	copy_file�name�statr�chmod)rr�
updated_filesZscriptZadjustZoutfiler�encoding�linesZ
first_liner1Zpost_interprZshebangZoutf�fileZoldmodeZnewmoderrrr5s�



�

��
��
��




�zbuild_scripts.copy_scriptsN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsrrrrrrrrrr	s�r	c@seZdZdd�ZdS)�build_scripts_2to3cCs&t�|�\}}|js|�|�||fSr)r	rr*Zrun_2to3)rrr@rrrr�s
zbuild_scripts_2to3.copy_scriptsN)rDrErFrrrrrrG�srG)r"�rer>rZ	distutilsrZdistutils.corerZdistutils.dep_utilrZdistutils.utilrrrr+�compiler0r	rGrrrr�<module>s

distutils/command/__pycache__/build_clib.cpython-38.pyc000064400000011320151153537440017143 0ustar00U

e5dV�@sTdZddlZddlmZddlTddlmZddlmZdd�Z	Gd	d
�d
e�Z
dS)z�distutils.command.build_clib

Implements the Distutils 'build_clib' command, to build a C/C++ library
that is included in the module distribution and needed by an extension
module.�N)�Command)�*)�customize_compiler)�logcCsddlm}|�dS)Nr��show_compilers)�distutils.ccompilerrr�r	�4/usr/lib64/python3.8/distutils/command/build_clib.pyrsrc@sleZdZdZdddddgZddgZd	d
defgZdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zd
S)�
build_clibz/build C/C++ libraries used by Python extensions)zbuild-clib=�bz%directory to build C/C++ libraries to)zbuild-temp=�tz,directory to put temporary build by-products)�debug�gz"compile with debugging information)�force�fz2forcibly build everything (ignore file timestamps))z	compiler=�czspecify the compiler typerrz
help-compilerNzlist available compilerscCs:d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr)	r�
build_temp�	libraries�include_dirs�define�undefrr�compiler��selfr	r	r
�initialize_options4szbuild_clib.initialize_optionscCsh|�dddddd�|jj|_|jr0|�|j�|jdkrH|jjpDg|_t|jt�rd|j�tj	�|_dS)NZbuild)rr)rr)rr)rr)rr)
Zset_undefined_optionsZdistributionr�check_library_listr�
isinstance�str�split�os�pathseprr	r	r
�finalize_optionsDs�

zbuild_clib.finalize_optionscCs�|js
dSddlm}||j|j|jd�|_t|j�|jdk	rN|j�|j�|j	dk	rv|j	D]\}}|j�
||�q^|jdk	r�|jD]}|j�|�q�|�
|j�dS)Nr)�new_compiler)r�dry_runr)rrr#rr$rrrZset_include_dirsrZdefine_macrorZundefine_macro�build_libraries)rr#�name�valueZmacror	r	r
�run^s"�




zbuild_clib.runcCs�t|t�std��|D]z}t|t�s8t|�dkr8td��|\}}t|t�sRtd��d|ksntjdkr~tj|kr~td|d��t|t�std��qd	S)
a`Ensure that the list of libraries is valid.

        `library` is presumably provided as a command option 'libraries'.
        This method checks that it is a list of 2-tuples, where the tuples
        are (library_name, build_info_dict).

        Raise DistutilsSetupError if the structure is invalid anywhere;
        just returns otherwise.
        z+'libraries' option must be a list of tuples�z*each element of 'libraries' must a 2-tuplezNfirst element of each tuple in 'libraries' must be a string (the library name)�/z;bad library name '%s': may not contain directory separatorsrzMsecond element of each tuple in 'libraries' must be a dictionary (build info)N)	r�list�DistutilsSetupError�tuple�lenrr �sep�dict)rr�libr&�
build_infor	r	r
rvs,

��
��
�zbuild_clib.check_library_listcCs,|js
dSg}|jD]\}}|�|�q|S)N)r�append)rZ	lib_names�lib_namer2r	r	r
�get_library_names�szbuild_clib.get_library_namescCsZ|�|j�g}|jD]>\}}|�d�}|dks>t|ttf�sJtd|��|�|�q|S)N�sources�fin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenames)rr�getrr+r-r,�extend)r�	filenamesr4r2r6r	r	r
�get_source_files�s
��zbuild_clib.get_source_filescCs�|D]�\}}|�d�}|dks,t|ttf�s8td|��t|�}t�d|�|�d�}|�d�}|jj||j	|||j
d�}|jj|||j|j
d�qdS)Nr6r7zbuilding '%s' library�macrosr)�
output_dirr<rr)r=r)
r8rr+r-r,r�infor�compilerrZcreate_static_libr)rrr4r2r6r<rZobjectsr	r	r
r%�s,
��

�	
�zbuild_clib.build_libraries)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsrZhelp_optionsrr"r(rr5r;r%r	r	r	r
rs(�
��$r)�__doc__r Zdistutils.corerZdistutils.errorsZdistutils.sysconfigrZ	distutilsrrrr	r	r	r
�<module>sdistutils/command/__pycache__/config.cpython-38.opt-1.pyc000064400000023765151153537440017277 0ustar00U

e5d=3�@sldZddlZddlZddlmZddlmZddlmZddl	m
Z
ddd	�ZGd
d�de�Zddd
�Z
dS)a�distutils.command.config

Implements the Distutils 'config' command, a (mostly) empty command class
that exists mainly to be sub-classed by specific module distributions and
applications.  The idea is that while every "config" command is different,
at least they're all named the same, and users always see "config" in the
list of standard commands.  Also, this is a good place to put common
configure-like tasks: "try to compile this C code", or "figure out where
this header file lives".
�N)�Command)�DistutilsExecError)�customize_compiler)�logz.cz.cxx)�czc++c	@s�eZdZdZdddddddd	d
g	Zdd�Zd
d�Zdd�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
d0dd �Zd1d!d"�Zd2d#d$�Zd3d%d&�Zd4d'd(�Zd5d*d+�Zdddgfd,d-�Zd6d.d/�ZdS)7�configzprepare to build)z	compiler=Nzspecify the compiler type)zcc=Nzspecify the compiler executable)z
include-dirs=�Iz.list of directories to search for header files)zdefine=�DzC preprocessor macros to define)zundef=�Uz!C preprocessor macros to undefine)z
libraries=�lz!external C libraries to link with)z
library-dirs=�Lz.directories to search for external C libraries)�noisyNz1show every action (compile, link, run, ...) taken)zdump-sourceNz=dump generated source files before attempting to compile themcCs4d|_d|_d|_d|_d|_d|_d|_g|_dS)N�)�compilerZcc�include_dirs�	libraries�library_dirsr
�dump_source�
temp_files��self�r�0/usr/lib64/python3.8/distutils/command/config.py�initialize_options3szconfig.initialize_optionscCs�|jdkr|jjpg|_nt|jt�r6|j�tj�|_|jdkrHg|_nt|jt�r^|jg|_|jdkrpg|_nt|jt�r�|j�tj�|_dS�N)	rZdistribution�
isinstance�str�split�os�pathseprrrrrr�finalize_optionsBs



zconfig.finalize_optionscCsdSrrrrrr�runRsz
config.runcCszddlm}m}t|j|�sv||j|jdd�|_t|j�|jrN|j�|j�|j	rb|j�
|j	�|jrv|j�|j�dS)z^Check that 'self.compiler' really is a CCompiler object;
        if not, make it one.
        r)�	CCompiler�new_compilerr)r�dry_runZforceN)
�distutils.ccompilerr"r#rrr$rrZset_include_dirsrZ
set_librariesrZset_library_dirs)rr"r#rrr�_check_compilerYs�
zconfig._check_compilerc	Csldt|}t|d��L}|r>|D]}|�d|�q |�d�|�|�|ddkr^|�d�W5QRX|S)NZ_configtest�wz#include <%s>
�
���)�LANG_EXT�open�write)r�body�headers�lang�filename�file�headerrrr�_gen_temp_sourcefileks

zconfig._gen_temp_sourcefilecCs<|�|||�}d}|j�||g�|jj|||d�||fS)Nz
_configtest.i�r)r3r�extendrZ
preprocess)rr-r.rr/�src�outrrr�_preprocessws
zconfig._preprocesscCs\|�|||�}|jr"t|d|�|j�|g�\}|j�||g�|jj|g|d�||fS)Nzcompiling '%s':r4)r3r�	dump_filerZobject_filenamesrr5�compile)rr-r.rr/r6�objrrr�_compile~szconfig._compilec
Csr|�||||�\}}tj�tj�|��d}	|jj|g|	|||d�|jjdk	r\|	|jj}	|j�	|	�|||	fS)Nr)rrZtarget_lang)
r<r�path�splitext�basenamerZlink_executableZ
exe_extensionr�append)
rr-r.rrrr/r6r;�progrrr�_link�s�zconfig._linkc	GsT|s|j}g|_t�dd�|��|D](}zt�|�Wq&tk
rLYq&Xq&dS)Nzremoving: %s� )rr�info�joinr�remove�OSError)r�	filenamesr0rrr�_clean�sz
config._cleanNrcCsRddlm}|��d}z|�||||�Wn|k
rDd}YnX|��|S)aQConstruct a source file from 'body' (a string containing lines
        of C/C++ code) and 'headers' (a list of header files to include)
        and run it through the preprocessor.  Return true if the
        preprocessor succeeded, false if there were any errors.
        ('body' probably isn't of much use, but what the heck.)
        r��CompileErrorTF)r%rKr&r8rI�rr-r.rr/rK�okrrr�try_cpp�s
zconfig.try_cppc	Csx|��|�||||�\}}t|t�r0t�|�}t|��.}d}	|��}
|
dkrPqb|�|
�r>d}	qbq>W5QRX|�	�|	S)a�Construct a source file (just like 'try_cpp()'), run it through
        the preprocessor, and return true if any line of the output matches
        'pattern'.  'pattern' should either be a compiled regex object or a
        string containing a regex.  If both 'body' and 'headers' are None,
        preprocesses an empty file -- which can be useful to determine the
        symbols the preprocessor and compiler set by default.
        F�T)
r&r8rr�rer:r+�readline�searchrI)r�patternr-r.rr/r6r7r1�match�linerrr�
search_cpp�s	



zconfig.search_cppcCsdddlm}|��z|�||||�d}Wn|k
rDd}YnXt�|rRdpTd�|��|S)zwTry to compile a source file built from 'body' and 'headers'.
        Return true on success, false otherwise.
        rrJTF�success!�failure.)r%rKr&r<rrDrIrLrrr�try_compile�s
zconfig.try_compilec
	Cspddlm}m}|��z|�||||||�d}	Wn||fk
rPd}	YnXt�|	r^dp`d�|��|	S)z�Try to compile and link a source file, built from 'body' and
        'headers', to executable form.  Return true on success, false
        otherwise.
        r�rK�	LinkErrorTFrWrX)r%rKr[r&rBrrDrI)
rr-r.rrrr/rKr[rMrrr�try_link�s
�
zconfig.try_linkc

Cs�ddlm}m}|��z.|�||||||�\}	}
}|�|g�d}Wn||tfk
rdd}YnXt�|rrdptd�|�	�|S)z�Try to compile, link to an executable, and run a program
        built from 'body' and 'headers'.  Return true on success, false
        otherwise.
        rrZTFrWrX)
r%rKr[r&rBZspawnrrrDrI)
rr-r.rrrr/rKr[r6r;ZexerMrrr�try_run�s
�

zconfig.try_runrc	Cst|��g}|r|�d|�|�d�|r<|�d|�n|�d|�|�d�d�|�d}|�|||||�S)a�Determine if function 'func' is available by constructing a
        source file that refers to 'func', and compiles and links it.
        If everything succeeds, returns true; otherwise returns false.

        The constructed source file starts out by including the header
        files listed in 'headers'.  If 'decl' is true, it then declares
        'func' (as "int func()"); you probably shouldn't supply 'headers'
        and set 'decl' true in the same call, or you might get errors about
        a conflicting declarations for 'func'.  Finally, the constructed
        'main()' function either references 'func' or (if 'call' is true)
        calls it.  'libraries' and 'library_dirs' are used when
        linking.
        z
int %s ();z
int main () {z  %s();z  %s;�}r()r&r@rEr\)	r�funcr.rrrZdeclZcallr-rrr�
check_funcs


�zconfig.check_funccCs |��|�d|||g||�S)a�Determine if 'library' is available to be linked against,
        without actually checking that any particular symbols are provided
        by it.  'headers' will be used in constructing the source file to
        be compiled, but the only effect of this is to check if all the
        header files listed are available.  Any libraries listed in
        'other_libraries' will be included in the link, in case 'library'
        has symbols that depend on other libraries.
        zint main (void) { })r&r\)rZlibraryrr.rZother_librariesrrr�	check_lib4s


�zconfig.check_libcCs|jd|g|d�S)z�Determine if the system header file named by 'header_file'
        exists and can be found by the preprocessor; return true if so,
        false otherwise.
        z
/* No body */)r-r.r)rN)rr2rrr/rrr�check_headerBs
�zconfig.check_header)NNNr)NNNr)NNr)NNNNr)NNNNr)NNNNrr)NNr)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsrr r!r&r3r8r<rBrIrNrVrYr\r]r`rarbrrrrrs\�	
�

�
�
�
�
�rcCsJ|dkrt�d|�n
t�|�t|�}zt�|���W5|��XdS)zjDumps a file content into log.info.

    If head is not None, will be dumped before the file content.
    Nz%s)rrDr+�close�read)r0�headr1rrrr9Ks
r9)N)�__doc__rrPZdistutils.corerZdistutils.errorsrZdistutils.sysconfigrZ	distutilsrr*rr9rrrr�<module>s
8distutils/command/__pycache__/build_clib.cpython-38.opt-2.pyc000064400000010246151153537440020111 0ustar00U

e5dV�@sPddlZddlmZddlTddlmZddlmZdd�ZGdd	�d	e�Z	dS)
�N)�Command)�*)�customize_compiler)�logcCsddlm}|�dS)Nr��show_compilers)�distutils.ccompilerrr�r	�4/usr/lib64/python3.8/distutils/command/build_clib.pyrsrc@sleZdZdZdddddgZddgZd	d
defgZdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zd
S)�
build_clibz/build C/C++ libraries used by Python extensions)zbuild-clib=�bz%directory to build C/C++ libraries to)zbuild-temp=�tz,directory to put temporary build by-products)�debug�gz"compile with debugging information)�force�fz2forcibly build everything (ignore file timestamps))z	compiler=�czspecify the compiler typerrz
help-compilerNzlist available compilerscCs:d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr)	r�
build_temp�	libraries�include_dirs�define�undefrr�compiler��selfr	r	r
�initialize_options4szbuild_clib.initialize_optionscCsh|�dddddd�|jj|_|jr0|�|j�|jdkrH|jjpDg|_t|jt�rd|j�tj	�|_dS)NZbuild)rr)rr)rr)rr)rr)
Zset_undefined_optionsZdistributionr�check_library_listr�
isinstance�str�split�os�pathseprr	r	r
�finalize_optionsDs�

zbuild_clib.finalize_optionscCs�|js
dSddlm}||j|j|jd�|_t|j�|jdk	rN|j�|j�|j	dk	rv|j	D]\}}|j�
||�q^|jdk	r�|jD]}|j�|�q�|�
|j�dS)Nr)�new_compiler)r�dry_runr)rrr#rr$rrrZset_include_dirsrZdefine_macrorZundefine_macro�build_libraries)rr#�name�valueZmacror	r	r
�run^s"�




zbuild_clib.runcCs�t|t�std��|D]z}t|t�s8t|�dkr8td��|\}}t|t�sRtd��d|ksntjdkr~tj|kr~td|d��t|t�std��qdS)	Nz+'libraries' option must be a list of tuples�z*each element of 'libraries' must a 2-tuplezNfirst element of each tuple in 'libraries' must be a string (the library name)�/z;bad library name '%s': may not contain directory separatorsrzMsecond element of each tuple in 'libraries' must be a dictionary (build info))	r�list�DistutilsSetupError�tuple�lenrr �sep�dict)rr�libr&�
build_infor	r	r
rvs,

��
��
�zbuild_clib.check_library_listcCs,|js
dSg}|jD]\}}|�|�q|S)N)r�append)rZ	lib_names�lib_namer2r	r	r
�get_library_names�szbuild_clib.get_library_namescCsZ|�|j�g}|jD]>\}}|�d�}|dks>t|ttf�sJtd|��|�|�q|S)N�sources�fin 'libraries' option (library '%s'), 'sources' must be present and must be a list of source filenames)rr�getrr+r-r,�extend)r�	filenamesr4r2r6r	r	r
�get_source_files�s
��zbuild_clib.get_source_filescCs�|D]�\}}|�d�}|dks,t|ttf�s8td|��t|�}t�d|�|�d�}|�d�}|jj||j	|||j
d�}|jj|||j|j
d�qdS)Nr6r7zbuilding '%s' library�macrosr)�
output_dirr<rr)r=r)
r8rr+r-r,r�infor�compilerrZcreate_static_libr)rrr4r2r6r<rZobjectsr	r	r
r%�s,
��

�	
�zbuild_clib.build_libraries)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsrZhelp_optionsrr"r(rr5r;r%r	r	r	r
rs(�
��$r)
r Zdistutils.corerZdistutils.errorsZdistutils.sysconfigrZ	distutilsrrrr	r	r	r
�<module>sdistutils/command/__pycache__/bdist_dumb.cpython-38.opt-2.pyc000064400000006502151153537440020135 0ustar00U

e5d1�@sdddlZddlmZddlmZddlmZmZddlTddl	m
Z
ddlmZGdd	�d	e�Z
dS)
�N)�Command)�get_platform)�remove_tree�ensure_relative)�*)�get_python_version)�logc	@s^eZdZdZdddde�fdddd	d
ddg	Zd
ddgZddd�Zdd�Zdd�Z	dd�Z
dS)�
bdist_dumbz"create a "dumb" built distribution)z
bdist-dir=�dz1temporary directory for creating the distributionz
plat-name=�pz;platform name to embed in generated filenames (default: %s))zformat=�fz>archive format to create (tar, gztar, bztar, xztar, ztar, zip))�	keep-temp�kzPkeep the pseudo-installation tree around after creating the distribution archive)z	dist-dir=r
z-directory to put final built distributions in)�
skip-buildNz2skip rebuilding everything (for testing/debugging))�relativeNz7build the archive using relative paths (default: false))zowner=�uz@Owner name used when creating a tar file [default: current user])zgroup=�gzAGroup name used when creating a tar file [default: current group]r
rrZgztar�zip)�posix�ntcCs:d|_d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr)	�	bdist_dir�	plat_name�format�	keep_temp�dist_dir�
skip_buildr�owner�group)�self�r�4/usr/lib64/python3.8/distutils/command/bdist_dumb.py�initialize_options2szbdist_dumb.initialize_optionscCsz|jdkr&|�d�j}tj�|d�|_|jdkrfz|jtj|_Wn"t	k
rdt
dtj��YnX|�dddd�dS)NZbdistZdumbz@don't know how to create dumb built distributions on platform %s)rr)rr)rr)rZget_finalized_command�
bdist_base�os�path�joinr�default_format�name�KeyError�DistutilsPlatformErrorZset_undefined_options)rr"rrr �finalize_options=s"

��
�zbdist_dumb.finalize_optionscCs(|js|�d�|jddd�}|j|_|j|_d|_t�d|j�|�d�d|j�	�|j
f}tj�
|j|�}|js~|j}nJ|j��r�|j|jkr�tdt|j�t|j�f��ntj�
|jt|j��}|j||j||j|jd	�}|j��r�t�}nd
}|jj�d||f�|j�s$t|j|jd�dS)
NZbuild�install�)Zreinit_subcommandsrzinstalling to %sz%s.%szScan't make a dumb built distribution where base and platbase are different (%s, %s))Zroot_dirrr�anyr	)�dry_run) rZrun_commandZreinitialize_commandr�rootZwarn_dirr�infoZdistributionZget_fullnamerr#r$r%rrZhas_ext_modulesZinstall_baseZinstall_platbaser)�reprrZmake_archiverrrrZ
dist_files�appendrrr.)rr+Zarchive_basenameZpseudoinstall_rootZarchive_root�filenameZ	pyversionrrr �runOsR


�

����
��
�zbdist_dumb.runN)�__name__�
__module__�__qualname__ZdescriptionrZuser_optionsZboolean_optionsr&r!r*r4rrrr r	s,���
�r	)r#Zdistutils.corerZdistutils.utilrZdistutils.dir_utilrrZdistutils.errorsZdistutils.sysconfigrZ	distutilsrr	rrrr �<module>sdistutils/command/__pycache__/build_py.cpython-38.pyc000064400000024362151153537440016674 0ustar00U

e5d&C�@szdZddlZddlZddlZddlZddlmZddlTddl	m
Z
mZddlm
Z
Gdd�de�ZGd	d
�d
ee�ZdS)zHdistutils.command.build_py

Implements the Distutils 'build_py' command.�N)�Command)�*)�convert_path�	Mixin2to3)�logc@s�eZdZdZdddddgZddgZd	diZd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd2d'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1S)3�build_pyz5"build" pure Python modules (copy to build directory))z
build-lib=�dzdirectory to "build" (copy) to)�compile�czcompile .py to .pyc)�
no-compileNz!don't compile .py files [default])z	optimize=�Ozlalso compile with optimization: -O1 for "python -O", -O2 for "python -OO", and -O0 to disable [default: -O0])�force�fz2forcibly build everything (ignore file timestamps)r	r
rcCs4d|_d|_d|_d|_d|_d|_d|_d|_dS)Nr)�	build_lib�
py_modules�package�package_data�package_dirr	�optimizer
��self�r�2/usr/lib64/python3.8/distutils/command/build_py.py�initialize_options szbuild_py.initialize_optionsc	Cs�|�ddd�|jj|_|jj|_|jj|_i|_|jjr^|jj��D]\}}t|�|j|<qF|��|_	t
|jt�s�z,t|j�|_d|jkr�dks�nt
�Wn tt
fk
r�td��YnXdS)NZbuild)rr)r
r
r�zoptimize must be 0, 1, or 2)Zset_undefined_options�distribution�packagesrrr�itemsr�get_data_files�
data_files�
isinstancer�int�AssertionError�
ValueErrorZDistutilsOptionError)r�name�pathrrr�finalize_options*s$�



 zbuild_py.finalize_optionscCs:|jr|��|jr$|��|��|�|jdd��dS�Nr)�include_bytecode)r�
build_modulesr�build_packages�build_package_data�byte_compile�get_outputsrrrr�runCszbuild_py.runcs�g}|js|S|jD]h}|�|�}tjj|jg|�d��}d�|rPt|�d��fdd�|�||�D�}|�	||||f�q|S)z?Generate list of '(package,src_dir,build_dir,filenames)' tuples�.r�csg|]}|�d��qS�Nr)�.0�file�Zplenrr�
<listcomp>ssz+build_py.get_data_files.<locals>.<listcomp>)
r�get_package_dir�osr%�joinr�split�len�find_data_files�append)r�datar�src_dir�	build_dir�	filenamesrr4rras



�zbuild_py.get_data_filescsd|j�dg�|j�|g�}g�|D]:}t�tj�t�|�t|���}���fdd�|D��q$�S)z6Return filenames for package's data files in 'src_dir'�cs$g|]}|�krtj�|�r|�qSr)r7r%�isfile)r2�fn��filesrrr5�s�z,build_py.find_data_files.<locals>.<listcomp>)	r�get�globr7r%r8�escaper�extend)rrr>Zglobs�patternZfilelistrrDrr;ys�zbuild_py.find_data_filescCs`d}|jD]P\}}}}|D]>}tj�||�}|�tj�|��|jtj�||�|dd�qq
dS)z$Copy data files into build directoryNF�Z
preserve_mode)rr7r%r8�mkpath�dirname�	copy_file)rZlastdirrr>r?r@�filename�targetrrrr+�s�zbuild_py.build_package_datacCs�|�d�}|js&|r tjj|�SdSn�g}|r�z|jd�|�}Wn*tk
rl|�d|d�|d=Yq*X|�d|�tjj|�Sq*|j�d�}|dk	r�|�d|�|r�tjj|�SdSdS)z�Return the directory, relative to the top of the source
           distribution, where package 'package' should be found
           (at least according to the 'package_dir' option, if any).r/rAr���N)r9rr7r%r8�KeyError�insertrF)rrr%�tailZpdirrrrr6�s(
	zbuild_py.get_package_dircCsj|dkr8tj�|�s td|��tj�|�s8td|��|rftj�|d�}tj�|�rZ|St�d|�dS)NrAz%package directory '%s' does not existz>supposed package directory '%s' exists, but is not a directoryz__init__.pyz8package init file '%s' not found (or not a regular file))	r7r%�existsZDistutilsFileError�isdirr8rBr�warn)rrr�init_pyrrr�
check_package�s&����zbuild_py.check_packagecCs&tj�|�st�d||�dSdSdS)Nz!file %s (for module %s) not foundFT)r7r%rBrrW)r�module�module_filerrr�check_module�szbuild_py.check_modulec	Cs�|�||�t�tj�t�|�d��}g}tj�|jj�}|D]P}tj�|�}||kr�tj�	tj�
|��d}|�|||f�q>|�d|�q>|S)Nz*.pyrzexcluding %s)
rYrGr7r%r8rH�abspathrZscript_name�splitext�basenamer<Zdebug_print)	rrrZmodule_files�modulesZsetup_scriptrZabs_frZrrr�find_package_modules�szbuild_py.find_package_modulesc	Cs�i}g}|jD]�}|�d�}d�|dd��}|d}z||\}}Wn"tk
rh|�|�}d}YnX|s�|�||�}	|df||<|	r�|�|d|	f�tj�||d�}
|�	||
�s�q|�|||
f�q|S)a�Finds individually-specified Python modules, ie. those listed by
        module name in 'self.py_modules'.  Returns a list of tuples (package,
        module_base, filename): 'package' is a tuple of the path through
        package-space to the module; 'module_base' is the bare (no
        packages, no dots) module name, and 'filename' is the path to the
        ".py" file (relative to the distribution root) that implements the
        module.
        r/rrQr0�__init__�.py)
rr9r8rRr6rYr<r7r%r\)rrr`rZr%rZmodule_baser�checkedrXr[rrr�find_modules�s*



zbuild_py.find_modulescCsNg}|jr|�|���|jrJ|jD]$}|�|�}|�||�}|�|�q$|S)a4Compute the list of all modules that will be built, whether
        they are specified one-module-at-a-time ('self.py_modules') or
        by whole packages ('self.packages').  Return a list of tuples
        (package, module, module_file), just like 'find_modules()' and
        'find_package_modules()' do.)rrIrerr6ra)rr`rr�mrrr�find_all_moduless

zbuild_py.find_all_modulescCsdd�|��D�S)NcSsg|]}|d�qS)rQr)r2rZrrrr5-sz-build_py.get_source_files.<locals>.<listcomp>)rgrrrr�get_source_files,szbuild_py.get_source_filescCs$|gt|�|dg}tjj|�S)Nrc)�listr7r%r8)rr?rrZZoutfile_pathrrr�get_module_outfile/szbuild_py.get_module_outfiler0cCs�|��}g}|D]p\}}}|�d�}|�|j||�}|�|�|r|jr^|�tjj|dd��|j	dkr|�tjj||j	d��q|dd�|j
D�7}|S)Nr/rA)�optimizationrcSs,g|]$\}}}}|D]}tj�||��qqSr)r7r%r8)r2rr>r?r@rOrrrr5Bs
�z(build_py.get_outputs.<locals>.<listcomp>)rgr9rjrr<r	�	importlib�util�cache_from_sourcerr)rr(r`ZoutputsrrZr[rOrrrr-3s*


�

�
�zbuild_py.get_outputscCsbt|t�r|�d�}nt|ttf�s,td��|�|j||�}tj	�
|�}|�|�|j||dd�S)Nr/z:'package' must be a string (dot-separated), list, or tuplerrK)
r �strr9ri�tuple�	TypeErrorrjrr7r%rMrLrN)rrZr[rZoutfile�dirrrr�build_moduleJs
�
zbuild_py.build_modulecCs*|��}|D]\}}}|�|||�qdSr1)rers)rr`rrZr[rrrr)Yszbuild_py.build_modulescCsP|jD]D}|�|�}|�||�}|D]$\}}}||ks:t�|�|||�q$qdSr1)rr6rar"rs)rrrr`Zpackage_rZr[rrrr*bs


zbuild_py.build_packagescCs�tjr|�d�dSddlm}|j}|dtjkr>|tj}|jrZ||d|j	||j
d�|jdkr||||j|j	||j
d�dS)Nz%byte-compiling is disabled, skipping.r)r,rQ)rr
�prefix�dry_run)�sys�dont_write_bytecoderW�distutils.utilr,rr7�sepr	r
rur)rrEr,rtrrrr,vs&

�
�zbuild_py.byte_compileN)r0)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsZnegative_optrr&r.rr;r+r6rYr\rarergrhrjr-rsr)r*r,rrrrrs8�



'4
	rc@seZdZdd�Zdd�ZdS)�
build_py_2to3cCsLg|_|jr|��|jr*|��|��|�|j�|�|jdd��dSr')	�
updated_filesrr)rr*r+Zrun_2to3r,r-rrrrr.�szbuild_py_2to3.runcCs,t�||||�}|dr(|j�|d�|S)Nr0r)rrsr~r<)rrZr[r�resrrrrs�szbuild_py_2to3.build_moduleN)rzr{r|r.rsrrrrr}�sr})�__doc__r7�importlib.utilrlrvrGZdistutils.corerZdistutils.errorsrxrrZ	distutilsrrr}rrrr�<module>s}distutils/command/__pycache__/build_ext.cpython-38.pyc000064400000037413151153537440017045 0ustar00U

e5dP{�@s�dZddlZddlZddlZddlZddlmZddlTddlm	Z	m
Z
ddlmZddlm
Z
ddlmZdd	lmZdd
lmZddlmZe�d�Zd
d�ZGdd�de�ZdS)z�distutils.command.build_ext

Implements the Distutils 'build_ext' command, for building extension
modules (currently limited to C extensions, should accommodate C++
extensions ASAP).�N)�Command)�*)�customize_compiler�get_python_version)�get_config_h_filename)�newer_group)�	Extension)�get_platform)�log)�	USER_BASEz3^[a-zA-Z_][a-zA-Z_0-9]*(\.[a-zA-Z_][a-zA-Z_0-9]*)*$cCsddlm}|�dS)Nr��show_compilers)�distutils.ccompilerr
r�r�3/usr/lib64/python3.8/distutils/command/build_ext.pyr
sr
c@seZdZdZdejZddddde�fdd	d
defdd
ddddefddddddddddgZddddd gZ	d!d"d#e
fgZd$d%�Zd&d'�Z
d(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zejd6d7��Zd8d9�Zd:d;�Zd<d=�Zd>d?�Zd@dA�ZdBdC�ZdDdE�ZdFdG�Zd"S)H�	build_extz8build C/C++ extensions (compile/link to build directory)z (separated by '%s'))z
build-lib=�bz(directory for compiled extension modules)zbuild-temp=�tz1directory for temporary files (build by-products)z
plat-name=�pz>platform name to cross-compile for, if supported (default: %s))�inplace�iziignore build-lib and put compiled extensions into the source directory alongside your pure Python modulesz
include-dirs=�Iz.list of directories to search for header files)zdefine=�DzC preprocessor macros to define)zundef=�Uz!C preprocessor macros to undefine)z
libraries=�lz!external C libraries to link withz
library-dirs=�Lz.directories to search for external C libraries)zrpath=�Rz7directories to search for shared C libraries at runtime)z
link-objects=�Oz2extra explicit link objects to include in the link)�debug�gz'compile/link with debugging information)�force�fz2forcibly build everything (ignore file timestamps))z	compiler=�czspecify the compiler type)z	parallel=�jznumber of parallel build jobs)�swig-cppNz)make SWIG create C++ files (default is C))z
swig-opts=Nz!list of SWIG command line options)zswig=Nzpath to the SWIG executable)�userNz#add user include, library and rpathrrr r$r%z
help-compilerNzlist available compilerscCs�d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_d|_d|_dS)Nr)�
extensions�	build_lib�	plat_name�
build_tempr�package�include_dirs�define�undef�	libraries�library_dirs�rpath�link_objectsrr �compiler�swig�swig_cpp�	swig_optsr%�parallel��selfrrr�initialize_optionsjs*zbuild_ext.initialize_optionsc

Cs�ddlm}|�ddddddd	d
�|jdkr8|jj|_|jj|_|��}|jdd�}|j	dkrn|jj	pjg|_	t
|j	t�r�|j	�t
j�|_	tjtjkr�|j	�t
j�tjd
��|j	�|�t
jj��||kr�|j	�|�t
jj��|�d�|�d�|jdk�rg|_|jdk�rg|_nt
|jt��r:|j�t
j�|_|jdk�rNg|_nt
|jt��rl|j�t
j�|_t
jdk�rh|j�t
j�tjd��tjtjk�r�|j�t
j�tjd��|j�r�t
j�|jd�|_nt
j�|jd�|_|j	�t
j�t���t tdd�}|�r|j�|�|j!dk�r*d}n|j!dd�}t
j�tjd�}|�r\t
j�||�}|j�|�tj"dd�dk�r�tj#�$t
j�tjd���r�|j�t
j�tjddt%�d��n|j�d�|�&d��r�|j'�s�|j�|�&d ��n|j�d�|j(�r|j(�d!�}d"d#�|D�|_(|j)�r4|j)�d!�|_)|j*dk�rHg|_*n|j*�d$�|_*|j+�r�t
j�t,d
�}t
j�t,d�}	t
j�-|��r�|j	�|�t
j�-|	��r�|j�|	�|j�|	�t
|j.t��r�zt/|j.�|_.Wnt0k
�r�t1d%��YnXdS)&Nr)�	sysconfigZbuild)r'r')r)r))r2r2)rr)r r )r6r6)r(r(�)Z
plat_specificZincluder.r1�ntZlibsZDebugZRelease�_home�win32�ZPCbuild��cygwin�bin�lib�pythonZconfig�.�Py_ENABLE_SHAREDZLIBDIR�,cSsg|]}|df�qS)�1r)�.0Zsymbolrrr�
<listcomp>�sz.build_ext.finalize_options.<locals>.<listcomp>� zparallel should be an integer)2�	distutilsr:Zset_undefined_optionsr*�distributionZext_packageZext_modulesr&Zget_python_incr+�
isinstance�str�split�os�pathsep�sys�exec_prefix�base_exec_prefix�append�path�join�extendZensure_string_listr.r/r0�name�prefixrr)�dirnamer�getattrr(�platform�
executable�
startswithr�get_config_varZpython_buildr,r-r5r%r�isdirr6�int�
ValueErrorZDistutilsOptionError)
r8r:Z
py_includeZplat_py_includeZ	_sys_home�suffixZnew_libZdefinesZuser_includeZuser_librrr�finalize_options�s��




�

�zbuild_ext.finalize_optionscCsjddlm}|jsdS|j��rL|�d�}|j�|��p:g�|j	�
|j�||j|j
|j|jd�|_t|j�tjdkr�|jt�kr�|j�|j�|jdk	r�|j�|j�|jdk	r�|jD]\}}|j�||�q�|jdk	r�|jD]}|j�|�q�|jdk	�r|j�|j�|j	dk	�r*|j�|j	�|jdk	�rD|j�|j�|j dk	�r^|j�!|j �|�"�dS)Nr)�new_compiler�
build_clib)r2�verbose�dry_runr r<)#rrgr&rMZhas_c_libraries�get_finalized_commandr.rYZget_library_namesr/rVrhr2rirjr rrQrZr(r	Z
initializer+Zset_include_dirsr,Zdefine_macror-Zundefine_macroZ
set_librariesZset_library_dirsr0Zset_runtime_library_dirsr1Zset_link_objects�build_extensions)r8rgrhrZ�value�macrorrr�runs@

�




z
build_ext.runc
Csvt|t�std��t|�D�]T\}}t|t�r0qt|t�rFt|�dkrNtd��|\}}t�d|�t|t	�rvt
�|�s~td��t|t�s�td��t||d�}dD]"}|�
|�}|d	k	r�t|||�q�|�
d
�|_d|kr�t�d�|�
d
�}|�rhg|_g|_|D]b}	t|	t��r"t|	�dk�s*td��t|	�dk�rJ|j�|	d�nt|	�dk�r|j�|	��q|||<qd	S)a�Ensure that the list of extensions (presumably provided as a
        command option 'extensions') is valid, i.e. it is a list of
        Extension objects.  We also support the old-style list of 2-tuples,
        where the tuples are (ext_name, build_info), which are converted to
        Extension instances here.

        Raise DistutilsSetupError if the structure is invalid anywhere;
        just returns otherwise.
        z:'ext_modules' option must be a list of Extension instances�zMeach element of 'ext_modules' option must be an Extension instance or 2-tuplezvold-style (ext_name, build_info) tuple found in ext_modules for extension '%s' -- please convert to Extension instancezRfirst element of each tuple in 'ext_modules' must be the extension name (a string)zOsecond element of each tuple in 'ext_modules' must be a dictionary (build info)�sources)r+r/r.�
extra_objects�extra_compile_args�extra_link_argsNr0Zdef_filez9'def_file' element of build info dict no longer supported�macros)r;rpz9'macros' element of build info dict must be 1- or 2-tupler;r)rN�list�DistutilsSetupError�	enumerater�tuple�lenr
�warnrO�extension_name_re�match�dict�get�setattr�runtime_library_dirs�
define_macros�undef_macrosrV)
r8r&r�ext�ext_nameZ
build_info�key�valrurnrrr�check_extensions_listVs^

�
��
��
�


�zbuild_ext.check_extensions_listcCs,|�|j�g}|jD]}|�|j�q|S�N)r�r&rYrq)r8�	filenamesr�rrr�get_source_files�s

zbuild_ext.get_source_filescCs2|�|j�g}|jD]}|�|�|j��q|Sr�)r�r&rV�get_ext_fullpathrZ)r8Zoutputsr�rrr�get_outputs�s

zbuild_ext.get_outputscCs(|�|j�|jr|��n|��dSr�)r�r&r6�_build_extensions_parallel�_build_extensions_serialr7rrrrl�s
zbuild_ext.build_extensionscs��j}�jdkrt��}zddlm}Wntk
r@d}YnX|dkrV���dS||d��P���fdd��jD�}t�j|�D]&\}}��	|��|�
�W5QRXq�W5QRXdS)NTr)�ThreadPoolExecutor)Zmax_workerscsg|]}���j|��qSr)Zsubmit�build_extension)rIr��Zexecutorr8rrrJ�s�z8build_ext._build_extensions_parallel.<locals>.<listcomp>)r6rQ�	cpu_countZconcurrent.futuresr��ImportErrorr�r&�zip�_filter_build_errors�result)r8Zworkersr�Zfuturesr�Zfutrr�rr��s"

�z$build_ext._build_extensions_parallelc
Cs0|jD]$}|�|��|�|�W5QRXqdSr�)r&r�r�)r8r�rrrr��s
z"build_ext._build_extensions_serialc
csTz
dVWnDtttfk
rN}z |js*�|�d|j|f�W5d}~XYnXdS)Nz"building extension "%s" failed: %s)ZCCompilerErrorZDistutilsErrorZCompileErrorZoptionalr{rZ)r8r��errrr��s
�zbuild_ext._filter_build_errorsc
CsP|j}|dkst|ttf�s*td|j��t|�}|�|j�}||j}|jslt	||d�slt
�d|j�dSt
�d|j�|�
||�}|jp�g}|jdd�}|jD]}|�|f�q�|jj||j||j|j||jd�}|dd�|_|jr�|�|j�|j�pg}|j�p|j�|�}	|jj|||�|�|j|j||� |�|j|j|	d�
dS)Nzjin 'ext_modules' option (extension '%s'), 'sources' must be present and must be a list of source filenamesZnewerz$skipping '%s' extension (up-to-date)zbuilding '%s' extension)Z
output_dirrur+r�extra_postargs�depends)r.r/r�r��export_symbolsrr)Ztarget_lang)!rqrNrvryrwrZr�r�r rr
r�info�swig_sourcesrsr�r�rVr2�compiler)r+Z_built_objectsrrrYrt�languageZdetect_languageZlink_shared_object�
get_librariesr/r��get_export_symbols)
r8r�rq�ext_pathr�Z
extra_argsrur-Zobjectsr�rrrr��sX��


�
�zbuild_ext.build_extensioncCs$g}g}i}|jrt�d�|js6d|jks6d|jkr<d}nd}|D]P}tj�|�\}}	|	dkr�|�|d|�|�|�|d||<qD|�|�qD|s�|S|jp�|�	�}
|
dg}|�
|j�|jr�|�d�|js�|jD]}|�|�q�|D].}||}
t�d	||
�|�|d
|
|g�q�|S)z�Walk the list of source files in 'sources', looking for SWIG
        interface (.i) files.  Run SWIG on all that are found, and
        return a modified 'sources' list with SWIG source files replaced
        by the generated C (or C++) files.
        z/--swig-cpp is deprecated - use --swig-opts=-c++z-c++z.cppz.cz.i�_wrap���z-pythonzswigging %s to %sz-o)
r4r
r{r5rQrW�splitextrVr3�	find_swigrYr�Zspawn)r8rq�	extensionZnew_sourcesr�Zswig_targetsZ
target_ext�source�baser�r3Zswig_cmd�o�targetrrrr�1s@
�


zbuild_ext.swig_sourcescCs^tjdkrdStjdkrLdD]*}tj�d|d�}tj�|�r|SqdStdtj��dS)	z�Return the name of the SWIG executable.  On Unix, this is
        just "swig" -- it should be in the PATH.  Tries a bit harder on
        Windows.
        �posixr3r<)z1.3z1.2z1.1z	c:\swig%szswig.exez>I don't know how to find (much less run) SWIG on platform '%s'N)rQrZrWrX�isfileZDistutilsPlatformError)r8Zvers�fnrrrr�gs


��zbuild_ext.find_swigcCs�|�|�}|�d�}|�|d�}|jsRtjj|dd�|g�}tj�|j|�Sd�|dd��}|�d�}tj�	|�
|��}tj�||�S)z�Returns the path of the filename for a given extension.

        The file is located in `build_lib` or directly in the package
        (inplace option).
        rEr�Nr�build_py)�get_ext_fullnamerP�get_ext_filenamerrQrWrXr'rk�abspathZget_package_dir)r8r��fullname�modpath�filenamer*r�Zpackage_dirrrrr�s


zbuild_ext.get_ext_fullpathcCs |jdkr|S|jd|SdS)zSReturns the fullname of a given extension name.

        Adds the `package.` prefixNrE)r*)r8r�rrrr��s
zbuild_ext.get_ext_fullnamecCs.ddlm}|�d�}|d�}tjj|�|S)z�Convert the name of an extension (eg. "foo.bar") into the name
        of the file from which it will be loaded (eg. "foo/bar.so", or
        "foo\bar.pyd").
        r�rarEZ
EXT_SUFFIX)�distutils.sysconfigrarPrQrWrX)r8r�rar�Z
ext_suffixrrrr��s
zbuild_ext.get_ext_filenamecCsxd|j�d�d}z|�d�Wn0tk
rRd|�d��dd��d�}YnXd	|}||jkrr|j�|�|jS)
aReturn the list of symbols that a shared extension has to
        export.  This either uses 'ext.export_symbols' or, if it's not
        provided, "PyInit_" + module_name.  Only relevant on Windows, where
        the .pyd file (DLL) must export the module "PyInit_" function.
        �_rEr��asciirZpunycode�-�_ZPyInit)rZrP�encode�UnicodeEncodeError�replace�decoder�rV)r8r�reZ
initfunc_namerrrr��s"
zbuild_ext.get_export_symbolscCs�tjdkr^ddlm}t|j|�s�d}|jr4|d}|tjd?tjd?d@f}|j|gSn�dd	l	m
}d
}|d�r�ttd�r�d
}n<tjdkr�d
}n,dtj
kr�|d�dkr�d
}n|d�dkr�d
}|r�|d�}|jd|gS|jS)z�Return the list of libraries to link against when building a
        shared extension.  On most platforms, this is just 'ext.libraries';
        on Windows, we add the Python library (eg. python20.dll).
        r>r)�MSVCCompilerz
python%d%dZ_d���r�FrFZgetandroidapilevelTrAZ_PYTHON_HOST_PLATFORMZANDROID_API_LEVELZMACHDEPZ	LDVERSIONrD)rSr^Zdistutils._msvccompilerr�rNr2r�
hexversionr.r�ra�hasattrrQ�environ)r8r�r��templateZ	pythonlibraZlink_libpythonZ	ldversionrrrr��s4

�



zbuild_ext.get_libraries) �__name__�
__module__�__qualname__ZdescriptionrQrRZsep_byr	Zuser_optionsZboolean_optionsr
Zhelp_optionsr9rfror�r�r�rlr�r��
contextlib�contextmanagerr�r�r�r�r�r�r�r�r�rrrrr!sp
�����+��@N	
	K6	
r)�__doc__r�rQ�rerSZdistutils.corerZdistutils.errorsr�rrrZdistutils.dep_utilrZdistutils.extensionrZdistutils.utilr	rLr
Zsiterr�r|r
rrrrr�<module>s$�distutils/command/__pycache__/build.cpython-38.opt-1.pyc000064400000007453151153537440017125 0ustar00U

e5d��@sTdZddlZddlZddlmZddlmZddlmZdd�Z	Gdd	�d	e�Z
dS)
zBdistutils.command.build

Implements the Distutils 'build' command.�N)�Command)�DistutilsOptionError)�get_platformcCsddlm}|�dS)Nr��show_compilers)Zdistutils.ccompilerrr�r�//usr/lib64/python3.8/distutils/command/build.pyrsrc@s�eZdZdZdddddddd	d
e�fddd
ddgZddgZdddefgZdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd �Zd!d"�Zd#efd$e
fd%efd&efgZdS)'�buildz"build everything needed to install)zbuild-base=�bz base directory for build library)zbuild-purelib=Nz2build directory for platform-neutral distributions)zbuild-platlib=Nz3build directory for platform-specific distributions)z
build-lib=NzWbuild directory for all distribution (defaults to either build-purelib or build-platlib)zbuild-scripts=Nzbuild directory for scripts)zbuild-temp=�tztemporary build directoryz
plat-name=�pz6platform name to build for, if supported (default: %s))z	compiler=�czspecify the compiler type)z	parallel=�jznumber of parallel build jobs)�debug�gz;compile extensions and libraries with debugging information)�force�fz2forcibly build everything (ignore file timestamps))zexecutable=�ez5specify final destination interpreter path (build.py)rrz
help-compilerNzlist available compilerscCsLd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_dS)Nr	r)�
build_base�
build_purelib�
build_platlib�	build_lib�
build_temp�
build_scriptsZcompiler�	plat_namerr�
executable�parallel��selfrrr�initialize_options8szbuild.initialize_optionscCsb|jdkrt�|_ntjdkr&td��d|jftjdd��}ttd�rR|d7}|jdkrntj	�
|jd�|_|jdkr�tj	�
|jd|�|_|j
dkr�|jjr�|j|_
n|j|_
|jdkr�tj	�
|jd|�|_|jdkr�tj	�
|jd	tjdd��|_|jdk�r tj�r tj	�tj�|_t|jt��r^zt|j�|_Wntk
�r\td
��YnXdS)N�ntzW--plat-name only supported on Windows (try using './configure --help' on your platform)z	.%s-%d.%d�Zgettotalrefcountz-pydebug�libZtempz
scripts-%d.%dzparallel should be an integer)rr�os�namer�sys�version_info�hasattrr�path�joinrrr�distributionZext_modulesrrr�normpath�
isinstancer�str�int�
ValueError)rZplat_specifierrrr�finalize_optionsHsD


�



�



�

�zbuild.finalize_optionscCs|��D]}|�|�qdS�N)Zget_sub_commandsZrun_command)rZcmd_namerrr�run�sz	build.runcCs
|j��Sr1)r*�has_pure_modulesrrrrr3�szbuild.has_pure_modulescCs
|j��Sr1)r*�has_c_librariesrrrrr4�szbuild.has_c_librariescCs
|j��Sr1)r*�has_ext_modulesrrrrr5�szbuild.has_ext_modulescCs
|j��Sr1)r*�has_scriptsrrrrr6�szbuild.has_scriptsZbuild_pyZ
build_clibZ	build_extr)�__name__�
__module__�__qualname__ZdescriptionrZuser_optionsZboolean_optionsrZhelp_optionsrr0r2r3r4r5r6Zsub_commandsrrrrr	sH�����8�r	)�__doc__r%r#Zdistutils.corerZdistutils.errorsrZdistutils.utilrrr	rrrr�<module>sdistutils/command/__pycache__/__init__.cpython-38.pyc000064400000001041151153537440016611 0ustar00U

e5d�@s2dZddddddddd	d
ddd
ddddddgZdS)z\distutils.command

Package containing implementation of all the standard Distutils
commands.ZbuildZbuild_pyZ	build_extZ
build_clibZ
build_scriptsZcleanZinstallZinstall_libZinstall_headersZinstall_scriptsZinstall_dataZsdist�registerZbdistZ
bdist_dumbZ	bdist_rpmZ
bdist_wininstZcheckZuploadN)�__doc__�__all__�rr�2/usr/lib64/python3.8/distutils/command/__init__.py�<module>s(�distutils/command/__pycache__/check.cpython-38.opt-1.pyc000064400000011427151153537440017077 0ustar00U

e5d��@s�dZddlmZddlmZzTddlmZddlmZddl	m
Z
ddl	mZddlm
Z
Gd	d
�d
e�ZdZWnek
r�dZYnXGd
d�de�ZdS)zCdistutils.command.check

Implements the Distutils 'check' command.
�)�Command)�DistutilsSetupError)�Reporter)�Parser)�frontend)�nodes)�StringIOc@seZdZd	dd�Zdd�ZdS)
�SilentReporterNr�ascii�replacec
Cs"g|_t�||||||||�dS�N)�messagesr�__init__)�self�source�report_level�
halt_level�stream�debug�encoding�
error_handler�r�//usr/lib64/python3.8/distutils/command/check.pyrs�zSilentReporter.__init__cOs6|j�||||f�tj|f|�||j|d�|��S)N)�level�type)r
�appendr�system_messageZlevels)rr�messageZchildren�kwargsrrrrs���zSilentReporter.system_message)Nrr
r)�__name__�
__module__�__qualname__rrrrrrr	s�
r	TFc@s`eZdZdZdZdddgZdddgZd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�checkz6This command checks the meta-data of the package.
    z"perform some checks on the package)�metadata�mzVerify meta-data)�restructuredtext�rzEChecks if long string meta-data syntax are reStructuredText-compliant)�strict�sz(Will exit with an error if a check failsr#r%r'cCsd|_d|_d|_d|_dS)z Sets default values for options.r�N)r%r#r'�	_warnings�rrrr�initialize_options1szcheck.initialize_optionscCsdSrrr+rrr�finalize_options8szcheck.finalize_optionscCs|jd7_t�||�S)z*Counts the number of warnings that occurs.r))r*r�warn)r�msgrrrr.;sz
check.warncCsL|jr|��|jr0tr"|��n|jr0td��|jrH|jdkrHtd��dS)zRuns the command.zThe docutils package is needed.rzPlease correct your package.N)r#�check_metadatar%�HAS_DOCUTILS�check_restructuredtextr'rr*r+rrr�run@s
z	check.runcCs�|jj}g}dD]"}t||�r(t||�s|�|�q|rL|�dd�|��|jrd|js�|�d�n"|j	r||j
s�|�d�n
|�d�dS)z�Ensures that all required elements of meta-data are supplied.

        name, version, URL, (author and author_email) or
        (maintainer and maintainer_email)).

        Warns if any are missing.
        )�name�versionZurlzmissing required meta-data: %sz, zLmissing meta-data: if 'author' supplied, 'author_email' must be supplied toozTmissing meta-data: if 'maintainer' supplied, 'maintainer_email' must be supplied toozimissing meta-data: either (author and author_email) or (maintainer and maintainer_email) must be suppliedN)�distributionr#�hasattr�getattrrr.�joinZauthorZauthor_emailZ
maintainerZmaintainer_email)rr#Zmissing�attrrrrr0Pszcheck.check_metadatacCsX|j��}|�|�D]>}|d�d�}|dkr8|d}nd|d|f}|�|�qdS)z4Checks if the long string fields are reST-compliant.����lineNr)z%s (line %s))r6Zget_long_description�_check_rst_data�getr.)r�dataZwarningr<rrrr2ns

zcheck.check_restructuredtextc
Cs�|jjp
d}t�}tjtfd���}d|_d|_d|_t	||j
|j|j|j
|j|jd�}tj|||d�}|�|d�z|�||�Wn:tk
r�}z|j�dd|d	if�W5d}~XYnX|jS)
z8Returns warnings when the provided data doesn't compile.zsetup.py)Z
components�N)rrrr)rr;z!Could not finish the parsing: %s.�)r6Zscript_namerrZOptionParserZget_default_valuesZ	tab_widthZpep_referencesZrfc_referencesr	rrZwarning_streamrZerror_encodingZerror_encoding_error_handlerr�documentZnote_source�parse�AttributeErrorr
r)rr?�source_path�parserZsettingsZreporterrB�errrr=ys.��zcheck._check_rst_dataN)rr r!�__doc__ZdescriptionZuser_optionsZboolean_optionsr,r-r.r3r0r2r=rrrrr"$s�
r"N)rHZdistutils.corerZdistutils.errorsrZdocutils.utilsrZdocutils.parsers.rstrZdocutilsrr�iorr	r1�	Exceptionr"rrrr�<module>s
distutils/command/__pycache__/clean.cpython-38.opt-2.pyc000064400000003743151153537440017107 0ustar00U

e5d�
�@s@ddlZddlmZddlmZddlmZGdd�de�ZdS)�N)�Command)�remove_tree)�logc@s>eZdZdZddddddgZdgZd	d
�Zdd�Zd
d�ZdS)�cleanz-clean up temporary files from 'build' command)zbuild-base=�bz2base build directory (default: 'build.build-base'))z
build-lib=Nz<build directory for all modules (default: 'build.build-lib'))zbuild-temp=�tz7temporary build directory (default: 'build.build-temp'))zbuild-scripts=Nz<build directory for scripts (default: 'build.build-scripts'))zbdist-base=Nz+temporary directory for built distributions)�all�az7remove all build output, not just temporary by-productsrcCs(d|_d|_d|_d|_d|_d|_dS)N)�
build_base�	build_lib�
build_temp�
build_scripts�
bdist_baser��self�r�//usr/lib64/python3.8/distutils/command/clean.py�initialize_options szclean.initialize_optionscCs"|�ddddd�|�dd�dS)NZbuild)r
r
)rr)r
r
)rrZbdist)rr)Zset_undefined_optionsrrrr�finalize_options(s��zclean.finalize_optionscCs�tj�|j�r t|j|jd�nt�d|j�|jrr|j	|j
|jfD],}tj�|�rdt||jd�qDt�d|�qD|js�zt�
|j�t�d|j�Wntk
r�YnXdS)N)�dry_runz%'%s' does not exist -- can't clean itz
removing '%s')�os�path�existsrrrr�debugrrrr
�warn�rmdirr
�info�OSError)rZ	directoryrrr�run1s*���z	clean.runN)	�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsrrrrrrrrs�	r)rZdistutils.corerZdistutils.dir_utilrZ	distutilsrrrrrr�<module>sdistutils/command/__pycache__/install_data.cpython-38.opt-2.pyc000064400000004142151153537440020456 0ustar00U

e5d�@s8ddlZddlmZddlmZmZGdd�de�ZdS)�N)�Command)�change_root�convert_pathc@sHeZdZdZdddgZdgZdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)�install_datazinstall data files)zinstall-dir=�dzIbase directory for installing data files (default: installation base dir))zroot=Nz<install everything relative to this alternate root directory)�force�fz-force installation (overwrite existing files)rcCs,d|_g|_d|_d|_|jj|_d|_dS)Nr�)�install_dir�outfiles�rootrZdistribution�
data_files�warn_dir��self�r�6/usr/lib64/python3.8/distutils/command/install_data.py�initialize_optionss
zinstall_data.initialize_optionscCs|�dddd�dS)NZinstall)rr
)rr)rr)Zset_undefined_optionsrrrr�finalize_options#s
�zinstall_data.finalize_optionscCs�|�|j�|jD]�}t|t�rbt|�}|jrB|�d||jf�|�||j�\}}|j	�
|�qt|d�}tj�
|�s�tj�|j|�}n|jr�t|j|�}|�|�|dgkr�|j	�
|�q|dD](}t|�}|�||�\}}|j	�
|�q�qdS)NzMsetup script did not provide a directory for '%s' -- installing right in '%s'rr	)Zmkpathr
r
�
isinstance�strrr�warnZ	copy_filer�append�os�path�isabs�joinrr)rr�out�_�dir�datarrr�run*s,

�
zinstall_data.runcCs
|jpgS�N)r
rrrr�
get_inputsKszinstall_data.get_inputscCs|jSr")rrrrr�get_outputsNszinstall_data.get_outputsN)�__name__�
__module__�__qualname__ZdescriptionZuser_optionsZboolean_optionsrrr!r#r$rrrrrs�	!r)rZdistutils.corerZdistutils.utilrrrrrrr�<module>sdistutils/command/__pycache__/check.cpython-38.pyc000064400000011427151153537440016140 0ustar00U

e5d��@s�dZddlmZddlmZzTddlmZddlmZddl	m
Z
ddl	mZddlm
Z
Gd	d
�d
e�ZdZWnek
r�dZYnXGd
d�de�ZdS)zCdistutils.command.check

Implements the Distutils 'check' command.
�)�Command)�DistutilsSetupError)�Reporter)�Parser)�frontend)�nodes)�StringIOc@seZdZd	dd�Zdd�ZdS)
�SilentReporterNr�ascii�replacec
Cs"g|_t�||||||||�dS�N)�messagesr�__init__)�self�source�report_level�
halt_level�stream�debug�encoding�
error_handler�r�//usr/lib64/python3.8/distutils/command/check.pyrs�zSilentReporter.__init__cOs6|j�||||f�tj|f|�||j|d�|��S)N)�level�type)r
�appendr�system_messageZlevels)rr�messageZchildren�kwargsrrrrs���zSilentReporter.system_message)Nrr
r)�__name__�
__module__�__qualname__rrrrrrr	s�
r	TFc@s`eZdZdZdZdddgZdddgZd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�checkz6This command checks the meta-data of the package.
    z"perform some checks on the package)�metadata�mzVerify meta-data)�restructuredtext�rzEChecks if long string meta-data syntax are reStructuredText-compliant)�strict�sz(Will exit with an error if a check failsr#r%r'cCsd|_d|_d|_d|_dS)z Sets default values for options.r�N)r%r#r'�	_warnings�rrrr�initialize_options1szcheck.initialize_optionscCsdSrrr+rrr�finalize_options8szcheck.finalize_optionscCs|jd7_t�||�S)z*Counts the number of warnings that occurs.r))r*r�warn)r�msgrrrr.;sz
check.warncCsL|jr|��|jr0tr"|��n|jr0td��|jrH|jdkrHtd��dS)zRuns the command.zThe docutils package is needed.rzPlease correct your package.N)r#�check_metadatar%�HAS_DOCUTILS�check_restructuredtextr'rr*r+rrr�run@s
z	check.runcCs�|jj}g}dD]"}t||�r(t||�s|�|�q|rL|�dd�|��|jrd|js�|�d�n"|j	r||j
s�|�d�n
|�d�dS)z�Ensures that all required elements of meta-data are supplied.

        name, version, URL, (author and author_email) or
        (maintainer and maintainer_email)).

        Warns if any are missing.
        )�name�versionZurlzmissing required meta-data: %sz, zLmissing meta-data: if 'author' supplied, 'author_email' must be supplied toozTmissing meta-data: if 'maintainer' supplied, 'maintainer_email' must be supplied toozimissing meta-data: either (author and author_email) or (maintainer and maintainer_email) must be suppliedN)�distributionr#�hasattr�getattrrr.�joinZauthorZauthor_emailZ
maintainerZmaintainer_email)rr#Zmissing�attrrrrr0Pszcheck.check_metadatacCsX|j��}|�|�D]>}|d�d�}|dkr8|d}nd|d|f}|�|�qdS)z4Checks if the long string fields are reST-compliant.����lineNr)z%s (line %s))r6Zget_long_description�_check_rst_data�getr.)r�dataZwarningr<rrrr2ns

zcheck.check_restructuredtextc
Cs�|jjp
d}t�}tjtfd���}d|_d|_d|_t	||j
|j|j|j
|j|jd�}tj|||d�}|�|d�z|�||�Wn:tk
r�}z|j�dd|d	if�W5d}~XYnX|jS)
z8Returns warnings when the provided data doesn't compile.zsetup.py)Z
components�N)rrrr)rr;z!Could not finish the parsing: %s.�)r6Zscript_namerrZOptionParserZget_default_valuesZ	tab_widthZpep_referencesZrfc_referencesr	rrZwarning_streamrZerror_encodingZerror_encoding_error_handlerr�documentZnote_source�parse�AttributeErrorr
r)rr?�source_path�parserZsettingsZreporterrB�errrr=ys.��zcheck._check_rst_dataN)rr r!�__doc__ZdescriptionZuser_optionsZboolean_optionsr,r-r.r3r0r2r=rrrrr"$s�
r"N)rHZdistutils.corerZdistutils.errorsrZdocutils.utilsrZdocutils.parsers.rstrZdocutilsrr�iorr	r1�	Exceptionr"rrrr�<module>s
distutils/command/install_scripts.py000064400000003741151153537440014012 0ustar00"""distutils.command.install_scripts

Implements the Distutils 'install_scripts' command, for installing
Python scripts."""

# contributed by Bastian Kleineidam

import os
from distutils.core import Command
from distutils import log
from stat import ST_MODE


class install_scripts(Command):

    description = "install scripts (Python or otherwise)"

    user_options = [
        ('install-dir=', 'd', "directory to install scripts to"),
        ('build-dir=','b', "build directory (where to install from)"),
        ('force', 'f', "force installation (overwrite existing files)"),
        ('skip-build', None, "skip the build steps"),
    ]

    boolean_options = ['force', 'skip-build']

    def initialize_options(self):
        self.install_dir = None
        self.force = 0
        self.build_dir = None
        self.skip_build = None

    def finalize_options(self):
        self.set_undefined_options('build', ('build_scripts', 'build_dir'))
        self.set_undefined_options('install',
                                   ('install_scripts', 'install_dir'),
                                   ('force', 'force'),
                                   ('skip_build', 'skip_build'),
                                  )

    def run(self):
        if not self.skip_build:
            self.run_command('build_scripts')
        self.outfiles = self.copy_tree(self.build_dir, self.install_dir)
        if os.name == 'posix':
            # Set the executable bits (owner, group, and world) on
            # all the scripts we just installed.
            for file in self.get_outputs():
                if self.dry_run:
                    log.info("changing mode of %s", file)
                else:
                    mode = ((os.stat(file)[ST_MODE]) | 0o555) & 0o7777
                    log.info("changing mode of %s to %o", file, mode)
                    os.chmod(file, mode)

    def get_inputs(self):
        return self.distribution.scripts or []

    def get_outputs(self):
        return self.outfiles or []
distutils/command/bdist.py000064400000012672151153537440011705 0ustar00"""distutils.command.bdist

Implements the Distutils 'bdist' command (create a built [binary]
distribution)."""

import os
from distutils.core import Command
from distutils.errors import *
from distutils.util import get_platform


def show_formats():
    """Print list of available formats (arguments to "--format" option).
    """
    from distutils.fancy_getopt import FancyGetopt
    formats = []
    for format in bdist.format_commands:
        formats.append(("formats=" + format, None,
                        bdist.format_command[format][1]))
    pretty_printer = FancyGetopt(formats)
    pretty_printer.print_help("List of available distribution formats:")


class bdist(Command):

    description = "create a built (binary) distribution"

    user_options = [('bdist-base=', 'b',
                     "temporary directory for creating built distributions"),
                    ('plat-name=', 'p',
                     "platform name to embed in generated filenames "
                     "(default: %s)" % get_platform()),
                    ('formats=', None,
                     "formats for distribution (comma-separated list)"),
                    ('dist-dir=', 'd',
                     "directory to put final built distributions in "
                     "[default: dist]"),
                    ('skip-build', None,
                     "skip rebuilding everything (for testing/debugging)"),
                    ('owner=', 'u',
                     "Owner name used when creating a tar file"
                     " [default: current user]"),
                    ('group=', 'g',
                     "Group name used when creating a tar file"
                     " [default: current group]"),
                   ]

    boolean_options = ['skip-build']

    help_options = [
        ('help-formats', None,
         "lists available distribution formats", show_formats),
        ]

    # The following commands do not take a format option from bdist
    no_format_option = ('bdist_rpm',)

    # This won't do in reality: will need to distinguish RPM-ish Linux,
    # Debian-ish Linux, Solaris, FreeBSD, ..., Windows, Mac OS.
    default_format = {'posix': 'gztar',
                      'nt': 'zip'}

    # Establish the preferred order (for the --help-formats option).
    format_commands = ['rpm', 'gztar', 'bztar', 'xztar', 'ztar', 'tar',
                       'wininst', 'zip', 'msi']

    # And the real information.
    format_command = {'rpm':   ('bdist_rpm',  "RPM distribution"),
                      'gztar': ('bdist_dumb', "gzip'ed tar file"),
                      'bztar': ('bdist_dumb', "bzip2'ed tar file"),
                      'xztar': ('bdist_dumb', "xz'ed tar file"),
                      'ztar':  ('bdist_dumb', "compressed tar file"),
                      'tar':   ('bdist_dumb', "tar file"),
                      'wininst': ('bdist_wininst',
                                  "Windows executable installer"),
                      'zip':   ('bdist_dumb', "ZIP file"),
                      'msi':   ('bdist_msi',  "Microsoft Installer")
                      }


    def initialize_options(self):
        self.bdist_base = None
        self.plat_name = None
        self.formats = None
        self.dist_dir = None
        self.skip_build = 0
        self.group = None
        self.owner = None

    def finalize_options(self):
        # have to finalize 'plat_name' before 'bdist_base'
        if self.plat_name is None:
            if self.skip_build:
                self.plat_name = get_platform()
            else:
                self.plat_name = self.get_finalized_command('build').plat_name

        # 'bdist_base' -- parent of per-built-distribution-format
        # temporary directories (eg. we'll probably have
        # "build/bdist.<plat>/dumb", "build/bdist.<plat>/rpm", etc.)
        if self.bdist_base is None:
            build_base = self.get_finalized_command('build').build_base
            self.bdist_base = os.path.join(build_base,
                                           'bdist.' + self.plat_name)

        self.ensure_string_list('formats')
        if self.formats is None:
            try:
                self.formats = [self.default_format[os.name]]
            except KeyError:
                raise DistutilsPlatformError(
                      "don't know how to create built distributions "
                      "on platform %s" % os.name)

        if self.dist_dir is None:
            self.dist_dir = "dist"

    def run(self):
        # Figure out which sub-commands we need to run.
        commands = []
        for format in self.formats:
            try:
                commands.append(self.format_command[format][0])
            except KeyError:
                raise DistutilsOptionError("invalid format '%s'" % format)

        # Reinitialize and run each command.
        for i in range(len(self.formats)):
            cmd_name = commands[i]
            sub_cmd = self.reinitialize_command(cmd_name)
            if cmd_name not in self.no_format_option:
                sub_cmd.format = self.formats[i]

            # passing the owner and group names for tar archiving
            if cmd_name == 'bdist_dumb':
                sub_cmd.owner = self.owner
                sub_cmd.group = self.group

            # If we're going to need to run this command again, tell it to
            # keep its temporary files around so subsequent runs go faster.
            if cmd_name in commands[i+1:]:
                sub_cmd.keep_temp = 1
            self.run_command(cmd_name)
distutils/command/bdist_wininst.py000064400000037253151153537440013462 0ustar00"""distutils.command.bdist_wininst

Implements the Distutils 'bdist_wininst' command: create a windows installer
exe-program."""

import os
import sys
import warnings
from distutils.core import Command
from distutils.util import get_platform
from distutils.dir_util import create_tree, remove_tree
from distutils.errors import *
from distutils.sysconfig import get_python_version
from distutils import log

class bdist_wininst(Command):

    description = "create an executable installer for MS Windows"

    user_options = [('bdist-dir=', None,
                     "temporary directory for creating the distribution"),
                    ('plat-name=', 'p',
                     "platform name to embed in generated filenames "
                     "(default: %s)" % get_platform()),
                    ('keep-temp', 'k',
                     "keep the pseudo-installation tree around after " +
                     "creating the distribution archive"),
                    ('target-version=', None,
                     "require a specific python version" +
                     " on the target system"),
                    ('no-target-compile', 'c',
                     "do not compile .py to .pyc on the target system"),
                    ('no-target-optimize', 'o',
                     "do not compile .py to .pyo (optimized) "
                     "on the target system"),
                    ('dist-dir=', 'd',
                     "directory to put final built distributions in"),
                    ('bitmap=', 'b',
                     "bitmap to use for the installer instead of python-powered logo"),
                    ('title=', 't',
                     "title to display on the installer background instead of default"),
                    ('skip-build', None,
                     "skip rebuilding everything (for testing/debugging)"),
                    ('install-script=', None,
                     "basename of installation script to be run after "
                     "installation or before deinstallation"),
                    ('pre-install-script=', None,
                     "Fully qualified filename of a script to be run before "
                     "any files are installed.  This script need not be in the "
                     "distribution"),
                    ('user-access-control=', None,
                     "specify Vista's UAC handling - 'none'/default=no "
                     "handling, 'auto'=use UAC if target Python installed for "
                     "all users, 'force'=always use UAC"),
                   ]

    boolean_options = ['keep-temp', 'no-target-compile', 'no-target-optimize',
                       'skip-build']

    # bpo-10945: bdist_wininst requires mbcs encoding only available on Windows
    _unsupported = (sys.platform != "win32")

    def __init__(self, *args, **kw):
        super().__init__(*args, **kw)
        warnings.warn("bdist_wininst command is deprecated since Python 3.8, "
                      "use bdist_wheel (wheel packages) instead",
                      DeprecationWarning, 2)

    def initialize_options(self):
        self.bdist_dir = None
        self.plat_name = None
        self.keep_temp = 0
        self.no_target_compile = 0
        self.no_target_optimize = 0
        self.target_version = None
        self.dist_dir = None
        self.bitmap = None
        self.title = None
        self.skip_build = None
        self.install_script = None
        self.pre_install_script = None
        self.user_access_control = None


    def finalize_options(self):
        self.set_undefined_options('bdist', ('skip_build', 'skip_build'))

        if self.bdist_dir is None:
            if self.skip_build and self.plat_name:
                # If build is skipped and plat_name is overridden, bdist will
                # not see the correct 'plat_name' - so set that up manually.
                bdist = self.distribution.get_command_obj('bdist')
                bdist.plat_name = self.plat_name
                # next the command will be initialized using that name
            bdist_base = self.get_finalized_command('bdist').bdist_base
            self.bdist_dir = os.path.join(bdist_base, 'wininst')

        if not self.target_version:
            self.target_version = ""

        if not self.skip_build and self.distribution.has_ext_modules():
            short_version = get_python_version()
            if self.target_version and self.target_version != short_version:
                raise DistutilsOptionError(
                      "target version can only be %s, or the '--skip-build'" \
                      " option must be specified" % (short_version,))
            self.target_version = short_version

        self.set_undefined_options('bdist',
                                   ('dist_dir', 'dist_dir'),
                                   ('plat_name', 'plat_name'),
                                  )

        if self.install_script:
            for script in self.distribution.scripts:
                if self.install_script == os.path.basename(script):
                    break
            else:
                raise DistutilsOptionError(
                      "install_script '%s' not found in scripts"
                      % self.install_script)

    def run(self):
        if (sys.platform != "win32" and
            (self.distribution.has_ext_modules() or
             self.distribution.has_c_libraries())):
            raise DistutilsPlatformError \
                  ("distribution contains extensions and/or C libraries; "
                   "must be compiled on a Windows 32 platform")

        if not self.skip_build:
            self.run_command('build')

        install = self.reinitialize_command('install', reinit_subcommands=1)
        install.root = self.bdist_dir
        install.skip_build = self.skip_build
        install.warn_dir = 0
        install.plat_name = self.plat_name

        install_lib = self.reinitialize_command('install_lib')
        # we do not want to include pyc or pyo files
        install_lib.compile = 0
        install_lib.optimize = 0

        if self.distribution.has_ext_modules():
            # If we are building an installer for a Python version other
            # than the one we are currently running, then we need to ensure
            # our build_lib reflects the other Python version rather than ours.
            # Note that for target_version!=sys.version, we must have skipped the
            # build step, so there is no issue with enforcing the build of this
            # version.
            target_version = self.target_version
            if not target_version:
                assert self.skip_build, "Should have already checked this"
                target_version = '%d.%d' % sys.version_info[:2]
            plat_specifier = ".%s-%s" % (self.plat_name, target_version)
            build = self.get_finalized_command('build')
            build.build_lib = os.path.join(build.build_base,
                                           'lib' + plat_specifier)

        # Use a custom scheme for the zip-file, because we have to decide
        # at installation time which scheme to use.
        for key in ('purelib', 'platlib', 'headers', 'scripts', 'data'):
            value = key.upper()
            if key == 'headers':
                value = value + '/Include/$dist_name'
            setattr(install,
                    'install_' + key,
                    value)

        log.info("installing to %s", self.bdist_dir)
        install.ensure_finalized()

        # avoid warning of 'install_lib' about installing
        # into a directory not in sys.path
        sys.path.insert(0, os.path.join(self.bdist_dir, 'PURELIB'))

        install.run()

        del sys.path[0]

        # And make an archive relative to the root of the
        # pseudo-installation tree.
        from tempfile import mktemp
        archive_basename = mktemp()
        fullname = self.distribution.get_fullname()
        arcname = self.make_archive(archive_basename, "zip",
                                    root_dir=self.bdist_dir)
        # create an exe containing the zip-file
        self.create_exe(arcname, fullname, self.bitmap)
        if self.distribution.has_ext_modules():
            pyversion = get_python_version()
        else:
            pyversion = 'any'
        self.distribution.dist_files.append(('bdist_wininst', pyversion,
                                             self.get_installer_filename(fullname)))
        # remove the zip-file again
        log.debug("removing temporary file '%s'", arcname)
        os.remove(arcname)

        if not self.keep_temp:
            remove_tree(self.bdist_dir, dry_run=self.dry_run)

    def get_inidata(self):
        # Return data describing the installation.
        lines = []
        metadata = self.distribution.metadata

        # Write the [metadata] section.
        lines.append("[metadata]")

        # 'info' will be displayed in the installer's dialog box,
        # describing the items to be installed.
        info = (metadata.long_description or '') + '\n'

        # Escape newline characters
        def escape(s):
            return s.replace("\n", "\\n")

        for name in ["author", "author_email", "description", "maintainer",
                     "maintainer_email", "name", "url", "version"]:
            data = getattr(metadata, name, "")
            if data:
                info = info + ("\n    %s: %s" % \
                               (name.capitalize(), escape(data)))
                lines.append("%s=%s" % (name, escape(data)))

        # The [setup] section contains entries controlling
        # the installer runtime.
        lines.append("\n[Setup]")
        if self.install_script:
            lines.append("install_script=%s" % self.install_script)
        lines.append("info=%s" % escape(info))
        lines.append("target_compile=%d" % (not self.no_target_compile))
        lines.append("target_optimize=%d" % (not self.no_target_optimize))
        if self.target_version:
            lines.append("target_version=%s" % self.target_version)
        if self.user_access_control:
            lines.append("user_access_control=%s" % self.user_access_control)

        title = self.title or self.distribution.get_fullname()
        lines.append("title=%s" % escape(title))
        import time
        import distutils
        build_info = "Built %s with distutils-%s" % \
                     (time.ctime(time.time()), distutils.__version__)
        lines.append("build_info=%s" % build_info)
        return "\n".join(lines)

    def create_exe(self, arcname, fullname, bitmap=None):
        import struct

        self.mkpath(self.dist_dir)

        cfgdata = self.get_inidata()

        installer_name = self.get_installer_filename(fullname)
        self.announce("creating %s" % installer_name)

        if bitmap:
            with open(bitmap, "rb") as f:
                bitmapdata = f.read()
            bitmaplen = len(bitmapdata)
        else:
            bitmaplen = 0

        with open(installer_name, "wb") as file:
            file.write(self.get_exe_bytes())
            if bitmap:
                file.write(bitmapdata)

            # Convert cfgdata from unicode to ascii, mbcs encoded
            if isinstance(cfgdata, str):
                cfgdata = cfgdata.encode("mbcs")

            # Append the pre-install script
            cfgdata = cfgdata + b"\0"
            if self.pre_install_script:
                # We need to normalize newlines, so we open in text mode and
                # convert back to bytes. "latin-1" simply avoids any possible
                # failures.
                with open(self.pre_install_script, "r",
                          encoding="latin-1") as script:
                    script_data = script.read().encode("latin-1")
                cfgdata = cfgdata + script_data + b"\n\0"
            else:
                # empty pre-install script
                cfgdata = cfgdata + b"\0"
            file.write(cfgdata)

            # The 'magic number' 0x1234567B is used to make sure that the
            # binary layout of 'cfgdata' is what the wininst.exe binary
            # expects.  If the layout changes, increment that number, make
            # the corresponding changes to the wininst.exe sources, and
            # recompile them.
            header = struct.pack("<iii",
                                0x1234567B,       # tag
                                len(cfgdata),     # length
                                bitmaplen,        # number of bytes in bitmap
                                )
            file.write(header)
            with open(arcname, "rb") as f:
                file.write(f.read())

    def get_installer_filename(self, fullname):
        # Factored out to allow overriding in subclasses
        if self.target_version:
            # if we create an installer for a specific python version,
            # it's better to include this in the name
            installer_name = os.path.join(self.dist_dir,
                                          "%s.%s-py%s.exe" %
                                           (fullname, self.plat_name, self.target_version))
        else:
            installer_name = os.path.join(self.dist_dir,
                                          "%s.%s.exe" % (fullname, self.plat_name))
        return installer_name

    def get_exe_bytes(self):
        # If a target-version other than the current version has been
        # specified, then using the MSVC version from *this* build is no good.
        # Without actually finding and executing the target version and parsing
        # its sys.version, we just hard-code our knowledge of old versions.
        # NOTE: Possible alternative is to allow "--target-version" to
        # specify a Python executable rather than a simple version string.
        # We can then execute this program to obtain any info we need, such
        # as the real sys.version string for the build.
        cur_version = get_python_version()

        # If the target version is *later* than us, then we assume they
        # use what we use
        # string compares seem wrong, but are what sysconfig.py itself uses
        if self.target_version and self.target_version < cur_version:
            if self.target_version < "2.4":
                bv = '6.0'
            elif self.target_version == "2.4":
                bv = '7.1'
            elif self.target_version == "2.5":
                bv = '8.0'
            elif self.target_version <= "3.2":
                bv = '9.0'
            elif self.target_version <= "3.4":
                bv = '10.0'
            else:
                bv = '14.0'
        else:
            # for current version - use authoritative check.
            try:
                from msvcrt import CRT_ASSEMBLY_VERSION
            except ImportError:
                # cross-building, so assume the latest version
                bv = '14.0'
            else:
                # as far as we know, CRT is binary compatible based on
                # the first field, so assume 'x.0' until proven otherwise
                major = CRT_ASSEMBLY_VERSION.partition('.')[0]
                bv = major + '.0'


        # wininst-x.y.exe is in the same directory as this file
        directory = os.path.dirname(__file__)
        # we must use a wininst-x.y.exe built with the same C compiler
        # used for python.  XXX What about mingw, borland, and so on?

        # if plat_name starts with "win" but is not "win32"
        # we want to strip "win" and leave the rest (e.g. -amd64)
        # for all other cases, we don't want any suffix
        if self.plat_name != 'win32' and self.plat_name[:3] == 'win':
            sfix = self.plat_name[3:]
        else:
            sfix = ''

        filename = os.path.join(directory, "wininst-%s%s.exe" % (bv, sfix))
        f = open(filename, "rb")
        try:
            return f.read()
        finally:
            f.close()
distutils/command/build_ext.py000064400000075520151153537440012560 0ustar00"""distutils.command.build_ext

Implements the Distutils 'build_ext' command, for building extension
modules (currently limited to C extensions, should accommodate C++
extensions ASAP)."""

import contextlib
import os
import re
import sys
from distutils.core import Command
from distutils.errors import *
from distutils.sysconfig import customize_compiler, get_python_version
from distutils.sysconfig import get_config_h_filename
from distutils.dep_util import newer_group
from distutils.extension import Extension
from distutils.util import get_platform
from distutils import log

from site import USER_BASE

# An extension name is just a dot-separated list of Python NAMEs (ie.
# the same as a fully-qualified module name).
extension_name_re = re.compile \
    (r'^[a-zA-Z_][a-zA-Z_0-9]*(\.[a-zA-Z_][a-zA-Z_0-9]*)*$')


def show_compilers ():
    from distutils.ccompiler import show_compilers
    show_compilers()


class build_ext(Command):

    description = "build C/C++ extensions (compile/link to build directory)"

    # XXX thoughts on how to deal with complex command-line options like
    # these, i.e. how to make it so fancy_getopt can suck them off the
    # command line and make it look like setup.py defined the appropriate
    # lists of tuples of what-have-you.
    #   - each command needs a callback to process its command-line options
    #   - Command.__init__() needs access to its share of the whole
    #     command line (must ultimately come from
    #     Distribution.parse_command_line())
    #   - it then calls the current command class' option-parsing
    #     callback to deal with weird options like -D, which have to
    #     parse the option text and churn out some custom data
    #     structure
    #   - that data structure (in this case, a list of 2-tuples)
    #     will then be present in the command object by the time
    #     we get to finalize_options() (i.e. the constructor
    #     takes care of both command-line and client options
    #     in between initialize_options() and finalize_options())

    sep_by = " (separated by '%s')" % os.pathsep
    user_options = [
        ('build-lib=', 'b',
         "directory for compiled extension modules"),
        ('build-temp=', 't',
         "directory for temporary files (build by-products)"),
        ('plat-name=', 'p',
         "platform name to cross-compile for, if supported "
         "(default: %s)" % get_platform()),
        ('inplace', 'i',
         "ignore build-lib and put compiled extensions into the source " +
         "directory alongside your pure Python modules"),
        ('include-dirs=', 'I',
         "list of directories to search for header files" + sep_by),
        ('define=', 'D',
         "C preprocessor macros to define"),
        ('undef=', 'U',
         "C preprocessor macros to undefine"),
        ('libraries=', 'l',
         "external C libraries to link with"),
        ('library-dirs=', 'L',
         "directories to search for external C libraries" + sep_by),
        ('rpath=', 'R',
         "directories to search for shared C libraries at runtime"),
        ('link-objects=', 'O',
         "extra explicit link objects to include in the link"),
        ('debug', 'g',
         "compile/link with debugging information"),
        ('force', 'f',
         "forcibly build everything (ignore file timestamps)"),
        ('compiler=', 'c',
         "specify the compiler type"),
        ('parallel=', 'j',
         "number of parallel build jobs"),
        ('swig-cpp', None,
         "make SWIG create C++ files (default is C)"),
        ('swig-opts=', None,
         "list of SWIG command line options"),
        ('swig=', None,
         "path to the SWIG executable"),
        ('user', None,
         "add user include, library and rpath")
        ]

    boolean_options = ['inplace', 'debug', 'force', 'swig-cpp', 'user']

    help_options = [
        ('help-compiler', None,
         "list available compilers", show_compilers),
        ]

    def initialize_options(self):
        self.extensions = None
        self.build_lib = None
        self.plat_name = None
        self.build_temp = None
        self.inplace = 0
        self.package = None

        self.include_dirs = None
        self.define = None
        self.undef = None
        self.libraries = None
        self.library_dirs = None
        self.rpath = None
        self.link_objects = None
        self.debug = None
        self.force = None
        self.compiler = None
        self.swig = None
        self.swig_cpp = None
        self.swig_opts = None
        self.user = None
        self.parallel = None

    def finalize_options(self):
        from distutils import sysconfig

        self.set_undefined_options('build',
                                   ('build_lib', 'build_lib'),
                                   ('build_temp', 'build_temp'),
                                   ('compiler', 'compiler'),
                                   ('debug', 'debug'),
                                   ('force', 'force'),
                                   ('parallel', 'parallel'),
                                   ('plat_name', 'plat_name'),
                                   )

        if self.package is None:
            self.package = self.distribution.ext_package

        self.extensions = self.distribution.ext_modules

        # Make sure Python's include directories (for Python.h, pyconfig.h,
        # etc.) are in the include search path.
        py_include = sysconfig.get_python_inc()
        plat_py_include = sysconfig.get_python_inc(plat_specific=1)
        if self.include_dirs is None:
            self.include_dirs = self.distribution.include_dirs or []
        if isinstance(self.include_dirs, str):
            self.include_dirs = self.include_dirs.split(os.pathsep)

        # If in a virtualenv, add its include directory
        # Issue 16116
        if sys.exec_prefix != sys.base_exec_prefix:
            self.include_dirs.append(os.path.join(sys.exec_prefix, 'include'))

        # Put the Python "system" include dir at the end, so that
        # any local include dirs take precedence.
        self.include_dirs.extend(py_include.split(os.path.pathsep))
        if plat_py_include != py_include:
            self.include_dirs.extend(
                plat_py_include.split(os.path.pathsep))

        self.ensure_string_list('libraries')
        self.ensure_string_list('link_objects')

        # Life is easier if we're not forever checking for None, so
        # simplify these options to empty lists if unset
        if self.libraries is None:
            self.libraries = []
        if self.library_dirs is None:
            self.library_dirs = []
        elif isinstance(self.library_dirs, str):
            self.library_dirs = self.library_dirs.split(os.pathsep)

        if self.rpath is None:
            self.rpath = []
        elif isinstance(self.rpath, str):
            self.rpath = self.rpath.split(os.pathsep)

        # for extensions under windows use different directories
        # for Release and Debug builds.
        # also Python's library directory must be appended to library_dirs
        if os.name == 'nt':
            # the 'libs' directory is for binary installs - we assume that
            # must be the *native* platform.  But we don't really support
            # cross-compiling via a binary install anyway, so we let it go.
            self.library_dirs.append(os.path.join(sys.exec_prefix, 'libs'))
            if sys.base_exec_prefix != sys.prefix:  # Issue 16116
                self.library_dirs.append(os.path.join(sys.base_exec_prefix, 'libs'))
            if self.debug:
                self.build_temp = os.path.join(self.build_temp, "Debug")
            else:
                self.build_temp = os.path.join(self.build_temp, "Release")

            # Append the source distribution include and library directories,
            # this allows distutils on windows to work in the source tree
            self.include_dirs.append(os.path.dirname(get_config_h_filename()))
            _sys_home = getattr(sys, '_home', None)
            if _sys_home:
                self.library_dirs.append(_sys_home)

            # Use the .lib files for the correct architecture
            if self.plat_name == 'win32':
                suffix = 'win32'
            else:
                # win-amd64
                suffix = self.plat_name[4:]
            new_lib = os.path.join(sys.exec_prefix, 'PCbuild')
            if suffix:
                new_lib = os.path.join(new_lib, suffix)
            self.library_dirs.append(new_lib)

        # For extensions under Cygwin, Python's library directory must be
        # appended to library_dirs
        if sys.platform[:6] == 'cygwin':
            if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")):
                # building third party extensions
                self.library_dirs.append(os.path.join(sys.prefix, "lib",
                                                      "python" + get_python_version(),
                                                      "config"))
            else:
                # building python standard extensions
                self.library_dirs.append('.')

        # For building extensions with a shared Python library,
        # Python's library directory must be appended to library_dirs
        # See Issues: #1600860, #4366
        if (sysconfig.get_config_var('Py_ENABLE_SHARED')):
            if not sysconfig.python_build:
                # building third party extensions
                self.library_dirs.append(sysconfig.get_config_var('LIBDIR'))
            else:
                # building python standard extensions
                self.library_dirs.append('.')

        # The argument parsing will result in self.define being a string, but
        # it has to be a list of 2-tuples.  All the preprocessor symbols
        # specified by the 'define' option will be set to '1'.  Multiple
        # symbols can be separated with commas.

        if self.define:
            defines = self.define.split(',')
            self.define = [(symbol, '1') for symbol in defines]

        # The option for macros to undefine is also a string from the
        # option parsing, but has to be a list.  Multiple symbols can also
        # be separated with commas here.
        if self.undef:
            self.undef = self.undef.split(',')

        if self.swig_opts is None:
            self.swig_opts = []
        else:
            self.swig_opts = self.swig_opts.split(' ')

        # Finally add the user include and library directories if requested
        if self.user:
            user_include = os.path.join(USER_BASE, "include")
            user_lib = os.path.join(USER_BASE, "lib")
            if os.path.isdir(user_include):
                self.include_dirs.append(user_include)
            if os.path.isdir(user_lib):
                self.library_dirs.append(user_lib)
                self.rpath.append(user_lib)

        if isinstance(self.parallel, str):
            try:
                self.parallel = int(self.parallel)
            except ValueError:
                raise DistutilsOptionError("parallel should be an integer")

    def run(self):
        from distutils.ccompiler import new_compiler

        # 'self.extensions', as supplied by setup.py, is a list of
        # Extension instances.  See the documentation for Extension (in
        # distutils.extension) for details.
        #
        # For backwards compatibility with Distutils 0.8.2 and earlier, we
        # also allow the 'extensions' list to be a list of tuples:
        #    (ext_name, build_info)
        # where build_info is a dictionary containing everything that
        # Extension instances do except the name, with a few things being
        # differently named.  We convert these 2-tuples to Extension
        # instances as needed.

        if not self.extensions:
            return

        # If we were asked to build any C/C++ libraries, make sure that the
        # directory where we put them is in the library search path for
        # linking extensions.
        if self.distribution.has_c_libraries():
            build_clib = self.get_finalized_command('build_clib')
            self.libraries.extend(build_clib.get_library_names() or [])
            self.library_dirs.append(build_clib.build_clib)

        # Setup the CCompiler object that we'll use to do all the
        # compiling and linking
        self.compiler = new_compiler(compiler=self.compiler,
                                     verbose=self.verbose,
                                     dry_run=self.dry_run,
                                     force=self.force)
        customize_compiler(self.compiler)
        # If we are cross-compiling, init the compiler now (if we are not
        # cross-compiling, init would not hurt, but people may rely on
        # late initialization of compiler even if they shouldn't...)
        if os.name == 'nt' and self.plat_name != get_platform():
            self.compiler.initialize(self.plat_name)

        # And make sure that any compile/link-related options (which might
        # come from the command-line or from the setup script) are set in
        # that CCompiler object -- that way, they automatically apply to
        # all compiling and linking done here.
        if self.include_dirs is not None:
            self.compiler.set_include_dirs(self.include_dirs)
        if self.define is not None:
            # 'define' option is a list of (name,value) tuples
            for (name, value) in self.define:
                self.compiler.define_macro(name, value)
        if self.undef is not None:
            for macro in self.undef:
                self.compiler.undefine_macro(macro)
        if self.libraries is not None:
            self.compiler.set_libraries(self.libraries)
        if self.library_dirs is not None:
            self.compiler.set_library_dirs(self.library_dirs)
        if self.rpath is not None:
            self.compiler.set_runtime_library_dirs(self.rpath)
        if self.link_objects is not None:
            self.compiler.set_link_objects(self.link_objects)

        # Now actually compile and link everything.
        self.build_extensions()

    def check_extensions_list(self, extensions):
        """Ensure that the list of extensions (presumably provided as a
        command option 'extensions') is valid, i.e. it is a list of
        Extension objects.  We also support the old-style list of 2-tuples,
        where the tuples are (ext_name, build_info), which are converted to
        Extension instances here.

        Raise DistutilsSetupError if the structure is invalid anywhere;
        just returns otherwise.
        """
        if not isinstance(extensions, list):
            raise DistutilsSetupError(
                  "'ext_modules' option must be a list of Extension instances")

        for i, ext in enumerate(extensions):
            if isinstance(ext, Extension):
                continue                # OK! (assume type-checking done
                                        # by Extension constructor)

            if not isinstance(ext, tuple) or len(ext) != 2:
                raise DistutilsSetupError(
                       "each element of 'ext_modules' option must be an "
                       "Extension instance or 2-tuple")

            ext_name, build_info = ext

            log.warn("old-style (ext_name, build_info) tuple found in "
                     "ext_modules for extension '%s' "
                     "-- please convert to Extension instance", ext_name)

            if not (isinstance(ext_name, str) and
                    extension_name_re.match(ext_name)):
                raise DistutilsSetupError(
                       "first element of each tuple in 'ext_modules' "
                       "must be the extension name (a string)")

            if not isinstance(build_info, dict):
                raise DistutilsSetupError(
                       "second element of each tuple in 'ext_modules' "
                       "must be a dictionary (build info)")

            # OK, the (ext_name, build_info) dict is type-safe: convert it
            # to an Extension instance.
            ext = Extension(ext_name, build_info['sources'])

            # Easy stuff: one-to-one mapping from dict elements to
            # instance attributes.
            for key in ('include_dirs', 'library_dirs', 'libraries',
                        'extra_objects', 'extra_compile_args',
                        'extra_link_args'):
                val = build_info.get(key)
                if val is not None:
                    setattr(ext, key, val)

            # Medium-easy stuff: same syntax/semantics, different names.
            ext.runtime_library_dirs = build_info.get('rpath')
            if 'def_file' in build_info:
                log.warn("'def_file' element of build info dict "
                         "no longer supported")

            # Non-trivial stuff: 'macros' split into 'define_macros'
            # and 'undef_macros'.
            macros = build_info.get('macros')
            if macros:
                ext.define_macros = []
                ext.undef_macros = []
                for macro in macros:
                    if not (isinstance(macro, tuple) and len(macro) in (1, 2)):
                        raise DistutilsSetupError(
                              "'macros' element of build info dict "
                              "must be 1- or 2-tuple")
                    if len(macro) == 1:
                        ext.undef_macros.append(macro[0])
                    elif len(macro) == 2:
                        ext.define_macros.append(macro)

            extensions[i] = ext

    def get_source_files(self):
        self.check_extensions_list(self.extensions)
        filenames = []

        # Wouldn't it be neat if we knew the names of header files too...
        for ext in self.extensions:
            filenames.extend(ext.sources)
        return filenames

    def get_outputs(self):
        # Sanity check the 'extensions' list -- can't assume this is being
        # done in the same run as a 'build_extensions()' call (in fact, we
        # can probably assume that it *isn't*!).
        self.check_extensions_list(self.extensions)

        # And build the list of output (built) filenames.  Note that this
        # ignores the 'inplace' flag, and assumes everything goes in the
        # "build" tree.
        outputs = []
        for ext in self.extensions:
            outputs.append(self.get_ext_fullpath(ext.name))
        return outputs

    def build_extensions(self):
        # First, sanity-check the 'extensions' list
        self.check_extensions_list(self.extensions)
        if self.parallel:
            self._build_extensions_parallel()
        else:
            self._build_extensions_serial()

    def _build_extensions_parallel(self):
        workers = self.parallel
        if self.parallel is True:
            workers = os.cpu_count()  # may return None
        try:
            from concurrent.futures import ThreadPoolExecutor
        except ImportError:
            workers = None

        if workers is None:
            self._build_extensions_serial()
            return

        with ThreadPoolExecutor(max_workers=workers) as executor:
            futures = [executor.submit(self.build_extension, ext)
                       for ext in self.extensions]
            for ext, fut in zip(self.extensions, futures):
                with self._filter_build_errors(ext):
                    fut.result()

    def _build_extensions_serial(self):
        for ext in self.extensions:
            with self._filter_build_errors(ext):
                self.build_extension(ext)

    @contextlib.contextmanager
    def _filter_build_errors(self, ext):
        try:
            yield
        except (CCompilerError, DistutilsError, CompileError) as e:
            if not ext.optional:
                raise
            self.warn('building extension "%s" failed: %s' %
                      (ext.name, e))

    def build_extension(self, ext):
        sources = ext.sources
        if sources is None or not isinstance(sources, (list, tuple)):
            raise DistutilsSetupError(
                  "in 'ext_modules' option (extension '%s'), "
                  "'sources' must be present and must be "
                  "a list of source filenames" % ext.name)
        sources = list(sources)

        ext_path = self.get_ext_fullpath(ext.name)
        depends = sources + ext.depends
        if not (self.force or newer_group(depends, ext_path, 'newer')):
            log.debug("skipping '%s' extension (up-to-date)", ext.name)
            return
        else:
            log.info("building '%s' extension", ext.name)

        # First, scan the sources for SWIG definition files (.i), run
        # SWIG on 'em to create .c files, and modify the sources list
        # accordingly.
        sources = self.swig_sources(sources, ext)

        # Next, compile the source code to object files.

        # XXX not honouring 'define_macros' or 'undef_macros' -- the
        # CCompiler API needs to change to accommodate this, and I
        # want to do one thing at a time!

        # Two possible sources for extra compiler arguments:
        #   - 'extra_compile_args' in Extension object
        #   - CFLAGS environment variable (not particularly
        #     elegant, but people seem to expect it and I
        #     guess it's useful)
        # The environment variable should take precedence, and
        # any sensible compiler will give precedence to later
        # command line args.  Hence we combine them in order:
        extra_args = ext.extra_compile_args or []

        macros = ext.define_macros[:]
        for undef in ext.undef_macros:
            macros.append((undef,))

        objects = self.compiler.compile(sources,
                                         output_dir=self.build_temp,
                                         macros=macros,
                                         include_dirs=ext.include_dirs,
                                         debug=self.debug,
                                         extra_postargs=extra_args,
                                         depends=ext.depends)

        # XXX outdated variable, kept here in case third-part code
        # needs it.
        self._built_objects = objects[:]

        # Now link the object files together into a "shared object" --
        # of course, first we have to figure out all the other things
        # that go into the mix.
        if ext.extra_objects:
            objects.extend(ext.extra_objects)
        extra_args = ext.extra_link_args or []

        # Detect target language, if not provided
        language = ext.language or self.compiler.detect_language(sources)

        self.compiler.link_shared_object(
            objects, ext_path,
            libraries=self.get_libraries(ext),
            library_dirs=ext.library_dirs,
            runtime_library_dirs=ext.runtime_library_dirs,
            extra_postargs=extra_args,
            export_symbols=self.get_export_symbols(ext),
            debug=self.debug,
            build_temp=self.build_temp,
            target_lang=language)

    def swig_sources(self, sources, extension):
        """Walk the list of source files in 'sources', looking for SWIG
        interface (.i) files.  Run SWIG on all that are found, and
        return a modified 'sources' list with SWIG source files replaced
        by the generated C (or C++) files.
        """
        new_sources = []
        swig_sources = []
        swig_targets = {}

        # XXX this drops generated C/C++ files into the source tree, which
        # is fine for developers who want to distribute the generated
        # source -- but there should be an option to put SWIG output in
        # the temp dir.

        if self.swig_cpp:
            log.warn("--swig-cpp is deprecated - use --swig-opts=-c++")

        if self.swig_cpp or ('-c++' in self.swig_opts) or \
           ('-c++' in extension.swig_opts):
            target_ext = '.cpp'
        else:
            target_ext = '.c'

        for source in sources:
            (base, ext) = os.path.splitext(source)
            if ext == ".i":             # SWIG interface file
                new_sources.append(base + '_wrap' + target_ext)
                swig_sources.append(source)
                swig_targets[source] = new_sources[-1]
            else:
                new_sources.append(source)

        if not swig_sources:
            return new_sources

        swig = self.swig or self.find_swig()
        swig_cmd = [swig, "-python"]
        swig_cmd.extend(self.swig_opts)
        if self.swig_cpp:
            swig_cmd.append("-c++")

        # Do not override commandline arguments
        if not self.swig_opts:
            for o in extension.swig_opts:
                swig_cmd.append(o)

        for source in swig_sources:
            target = swig_targets[source]
            log.info("swigging %s to %s", source, target)
            self.spawn(swig_cmd + ["-o", target, source])

        return new_sources

    def find_swig(self):
        """Return the name of the SWIG executable.  On Unix, this is
        just "swig" -- it should be in the PATH.  Tries a bit harder on
        Windows.
        """
        if os.name == "posix":
            return "swig"
        elif os.name == "nt":
            # Look for SWIG in its standard installation directory on
            # Windows (or so I presume!).  If we find it there, great;
            # if not, act like Unix and assume it's in the PATH.
            for vers in ("1.3", "1.2", "1.1"):
                fn = os.path.join("c:\\swig%s" % vers, "swig.exe")
                if os.path.isfile(fn):
                    return fn
            else:
                return "swig.exe"
        else:
            raise DistutilsPlatformError(
                  "I don't know how to find (much less run) SWIG "
                  "on platform '%s'" % os.name)

    # -- Name generators -----------------------------------------------
    # (extension names, filenames, whatever)
    def get_ext_fullpath(self, ext_name):
        """Returns the path of the filename for a given extension.

        The file is located in `build_lib` or directly in the package
        (inplace option).
        """
        fullname = self.get_ext_fullname(ext_name)
        modpath = fullname.split('.')
        filename = self.get_ext_filename(modpath[-1])

        if not self.inplace:
            # no further work needed
            # returning :
            #   build_dir/package/path/filename
            filename = os.path.join(*modpath[:-1]+[filename])
            return os.path.join(self.build_lib, filename)

        # the inplace option requires to find the package directory
        # using the build_py command for that
        package = '.'.join(modpath[0:-1])
        build_py = self.get_finalized_command('build_py')
        package_dir = os.path.abspath(build_py.get_package_dir(package))

        # returning
        #   package_dir/filename
        return os.path.join(package_dir, filename)

    def get_ext_fullname(self, ext_name):
        """Returns the fullname of a given extension name.

        Adds the `package.` prefix"""
        if self.package is None:
            return ext_name
        else:
            return self.package + '.' + ext_name

    def get_ext_filename(self, ext_name):
        r"""Convert the name of an extension (eg. "foo.bar") into the name
        of the file from which it will be loaded (eg. "foo/bar.so", or
        "foo\bar.pyd").
        """
        from distutils.sysconfig import get_config_var
        ext_path = ext_name.split('.')
        ext_suffix = get_config_var('EXT_SUFFIX')
        return os.path.join(*ext_path) + ext_suffix

    def get_export_symbols(self, ext):
        """Return the list of symbols that a shared extension has to
        export.  This either uses 'ext.export_symbols' or, if it's not
        provided, "PyInit_" + module_name.  Only relevant on Windows, where
        the .pyd file (DLL) must export the module "PyInit_" function.
        """
        suffix = '_' + ext.name.split('.')[-1]
        try:
            # Unicode module name support as defined in PEP-489
            # https://www.python.org/dev/peps/pep-0489/#export-hook-name
            suffix.encode('ascii')
        except UnicodeEncodeError:
            suffix = 'U' + suffix.encode('punycode').replace(b'-', b'_').decode('ascii')

        initfunc_name = "PyInit" + suffix
        if initfunc_name not in ext.export_symbols:
            ext.export_symbols.append(initfunc_name)
        return ext.export_symbols

    def get_libraries(self, ext):
        """Return the list of libraries to link against when building a
        shared extension.  On most platforms, this is just 'ext.libraries';
        on Windows, we add the Python library (eg. python20.dll).
        """
        # The python library is always needed on Windows.  For MSVC, this
        # is redundant, since the library is mentioned in a pragma in
        # pyconfig.h that MSVC groks.  The other Windows compilers all seem
        # to need it mentioned explicitly, though, so that's what we do.
        # Append '_d' to the python import library on debug builds.
        if sys.platform == "win32":
            from distutils._msvccompiler import MSVCCompiler
            if not isinstance(self.compiler, MSVCCompiler):
                template = "python%d%d"
                if self.debug:
                    template = template + '_d'
                pythonlib = (template %
                       (sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
                # don't extend ext.libraries, it may be shared with other
                # extensions, it is a reference to the original list
                return ext.libraries + [pythonlib]
        else:
            # On Android only the main executable and LD_PRELOADs are considered
            # to be RTLD_GLOBAL, all the dependencies of the main executable
            # remain RTLD_LOCAL and so the shared libraries must be linked with
            # libpython when python is built with a shared python library (issue
            # bpo-21536).
            # On Cygwin (and if required, other POSIX-like platforms based on
            # Windows like MinGW) it is simply necessary that all symbols in
            # shared libraries are resolved at link time.
            from distutils.sysconfig import get_config_var
            link_libpython = False
            if get_config_var('Py_ENABLE_SHARED'):
                # A native build on an Android device or on Cygwin
                if hasattr(sys, 'getandroidapilevel'):
                    link_libpython = True
                elif sys.platform == 'cygwin':
                    link_libpython = True
                elif '_PYTHON_HOST_PLATFORM' in os.environ:
                    # We are cross-compiling for one of the relevant platforms
                    if get_config_var('ANDROID_API_LEVEL') != 0:
                        link_libpython = True
                    elif get_config_var('MACHDEP') == 'cygwin':
                        link_libpython = True

            if link_libpython:
                ldversion = get_config_var('LDVERSION')
                return ext.libraries + ['python' + ldversion]

        return ext.libraries
distutils/command/register.py000064400000026700151153537440012421 0ustar00"""distutils.command.register

Implements the Distutils 'register' command (register with the repository).
"""

# created 2002/10/21, Richard Jones

import getpass
import io
import urllib.parse, urllib.request
from warnings import warn

from distutils.core import PyPIRCCommand
from distutils.errors import *
from distutils import log

class register(PyPIRCCommand):

    description = ("register the distribution with the Python package index")
    user_options = PyPIRCCommand.user_options + [
        ('list-classifiers', None,
         'list the valid Trove classifiers'),
        ('strict', None ,
         'Will stop the registering if the meta-data are not fully compliant')
        ]
    boolean_options = PyPIRCCommand.boolean_options + [
        'verify', 'list-classifiers', 'strict']

    sub_commands = [('check', lambda self: True)]

    def initialize_options(self):
        PyPIRCCommand.initialize_options(self)
        self.list_classifiers = 0
        self.strict = 0

    def finalize_options(self):
        PyPIRCCommand.finalize_options(self)
        # setting options for the `check` subcommand
        check_options = {'strict': ('register', self.strict),
                         'restructuredtext': ('register', 1)}
        self.distribution.command_options['check'] = check_options

    def run(self):
        self.finalize_options()
        self._set_config()

        # Run sub commands
        for cmd_name in self.get_sub_commands():
            self.run_command(cmd_name)

        if self.dry_run:
            self.verify_metadata()
        elif self.list_classifiers:
            self.classifiers()
        else:
            self.send_metadata()

    def check_metadata(self):
        """Deprecated API."""
        warn("distutils.command.register.check_metadata is deprecated, \
              use the check command instead", PendingDeprecationWarning)
        check = self.distribution.get_command_obj('check')
        check.ensure_finalized()
        check.strict = self.strict
        check.restructuredtext = 1
        check.run()

    def _set_config(self):
        ''' Reads the configuration file and set attributes.
        '''
        config = self._read_pypirc()
        if config != {}:
            self.username = config['username']
            self.password = config['password']
            self.repository = config['repository']
            self.realm = config['realm']
            self.has_config = True
        else:
            if self.repository not in ('pypi', self.DEFAULT_REPOSITORY):
                raise ValueError('%s not found in .pypirc' % self.repository)
            if self.repository == 'pypi':
                self.repository = self.DEFAULT_REPOSITORY
            self.has_config = False

    def classifiers(self):
        ''' Fetch the list of classifiers from the server.
        '''
        url = self.repository+'?:action=list_classifiers'
        response = urllib.request.urlopen(url)
        log.info(self._read_pypi_response(response))

    def verify_metadata(self):
        ''' Send the metadata to the package index server to be checked.
        '''
        # send the info to the server and report the result
        (code, result) = self.post_to_server(self.build_post_data('verify'))
        log.info('Server response (%s): %s', code, result)

    def send_metadata(self):
        ''' Send the metadata to the package index server.

            Well, do the following:
            1. figure who the user is, and then
            2. send the data as a Basic auth'ed POST.

            First we try to read the username/password from $HOME/.pypirc,
            which is a ConfigParser-formatted file with a section
            [distutils] containing username and password entries (both
            in clear text). Eg:

                [distutils]
                index-servers =
                    pypi

                [pypi]
                username: fred
                password: sekrit

            Otherwise, to figure who the user is, we offer the user three
            choices:

             1. use existing login,
             2. register as a new user, or
             3. set the password to a random string and email the user.

        '''
        # see if we can short-cut and get the username/password from the
        # config
        if self.has_config:
            choice = '1'
            username = self.username
            password = self.password
        else:
            choice = 'x'
            username = password = ''

        # get the user's login info
        choices = '1 2 3 4'.split()
        while choice not in choices:
            self.announce('''\
We need to know who you are, so please choose either:
 1. use your existing login,
 2. register as a new user,
 3. have the server generate a new password for you (and email it to you), or
 4. quit
Your selection [default 1]: ''', log.INFO)
            choice = input()
            if not choice:
                choice = '1'
            elif choice not in choices:
                print('Please choose one of the four options!')

        if choice == '1':
            # get the username and password
            while not username:
                username = input('Username: ')
            while not password:
                password = getpass.getpass('Password: ')

            # set up the authentication
            auth = urllib.request.HTTPPasswordMgr()
            host = urllib.parse.urlparse(self.repository)[1]
            auth.add_password(self.realm, host, username, password)
            # send the info to the server and report the result
            code, result = self.post_to_server(self.build_post_data('submit'),
                auth)
            self.announce('Server response (%s): %s' % (code, result),
                          log.INFO)

            # possibly save the login
            if code == 200:
                if self.has_config:
                    # sharing the password in the distribution instance
                    # so the upload command can reuse it
                    self.distribution.password = password
                else:
                    self.announce(('I can store your PyPI login so future '
                                   'submissions will be faster.'), log.INFO)
                    self.announce('(the login will be stored in %s)' % \
                                  self._get_rc_file(), log.INFO)
                    choice = 'X'
                    while choice.lower() not in 'yn':
                        choice = input('Save your login (y/N)?')
                        if not choice:
                            choice = 'n'
                    if choice.lower() == 'y':
                        self._store_pypirc(username, password)

        elif choice == '2':
            data = {':action': 'user'}
            data['name'] = data['password'] = data['email'] = ''
            data['confirm'] = None
            while not data['name']:
                data['name'] = input('Username: ')
            while data['password'] != data['confirm']:
                while not data['password']:
                    data['password'] = getpass.getpass('Password: ')
                while not data['confirm']:
                    data['confirm'] = getpass.getpass(' Confirm: ')
                if data['password'] != data['confirm']:
                    data['password'] = ''
                    data['confirm'] = None
                    print("Password and confirm don't match!")
            while not data['email']:
                data['email'] = input('   EMail: ')
            code, result = self.post_to_server(data)
            if code != 200:
                log.info('Server response (%s): %s', code, result)
            else:
                log.info('You will receive an email shortly.')
                log.info(('Follow the instructions in it to '
                          'complete registration.'))
        elif choice == '3':
            data = {':action': 'password_reset'}
            data['email'] = ''
            while not data['email']:
                data['email'] = input('Your email address: ')
            code, result = self.post_to_server(data)
            log.info('Server response (%s): %s', code, result)

    def build_post_data(self, action):
        # figure the data to send - the metadata plus some additional
        # information used by the package server
        meta = self.distribution.metadata
        data = {
            ':action': action,
            'metadata_version' : '1.0',
            'name': meta.get_name(),
            'version': meta.get_version(),
            'summary': meta.get_description(),
            'home_page': meta.get_url(),
            'author': meta.get_contact(),
            'author_email': meta.get_contact_email(),
            'license': meta.get_licence(),
            'description': meta.get_long_description(),
            'keywords': meta.get_keywords(),
            'platform': meta.get_platforms(),
            'classifiers': meta.get_classifiers(),
            'download_url': meta.get_download_url(),
            # PEP 314
            'provides': meta.get_provides(),
            'requires': meta.get_requires(),
            'obsoletes': meta.get_obsoletes(),
        }
        if data['provides'] or data['requires'] or data['obsoletes']:
            data['metadata_version'] = '1.1'
        return data

    def post_to_server(self, data, auth=None):
        ''' Post a query to the server, and return a string response.
        '''
        if 'name' in data:
            self.announce('Registering %s to %s' % (data['name'],
                                                    self.repository),
                                                    log.INFO)
        # Build up the MIME payload for the urllib2 POST data
        boundary = '--------------GHSKFJDLGDS7543FJKLFHRE75642756743254'
        sep_boundary = '\n--' + boundary
        end_boundary = sep_boundary + '--'
        body = io.StringIO()
        for key, value in data.items():
            # handle multiple entries for the same name
            if type(value) not in (type([]), type( () )):
                value = [value]
            for value in value:
                value = str(value)
                body.write(sep_boundary)
                body.write('\nContent-Disposition: form-data; name="%s"'%key)
                body.write("\n\n")
                body.write(value)
                if value and value[-1] == '\r':
                    body.write('\n')  # write an extra newline (lurve Macs)
        body.write(end_boundary)
        body.write("\n")
        body = body.getvalue().encode("utf-8")

        # build the Request
        headers = {
            'Content-type': 'multipart/form-data; boundary=%s; charset=utf-8'%boundary,
            'Content-length': str(len(body))
        }
        req = urllib.request.Request(self.repository, body, headers)

        # handle HTTP and include the Basic Auth handler
        opener = urllib.request.build_opener(
            urllib.request.HTTPBasicAuthHandler(password_mgr=auth)
        )
        data = ''
        try:
            result = opener.open(req)
        except urllib.error.HTTPError as e:
            if self.show_response:
                data = e.fp.read()
            result = e.code, e.msg
        except urllib.error.URLError as e:
            result = 500, str(e)
        else:
            if self.show_response:
                data = self._read_pypi_response(result)
            result = 200, 'OK'
        if self.show_response:
            msg = '\n'.join(('-' * 75, data, '-' * 75))
            self.announce(msg, log.INFO)
        return result
distutils/command/bdist_dumb.py000064400000011461151153537440012707 0ustar00"""distutils.command.bdist_dumb

Implements the Distutils 'bdist_dumb' command (create a "dumb" built
distribution -- i.e., just an archive to be unpacked under $prefix or
$exec_prefix)."""

import os
from distutils.core import Command
from distutils.util import get_platform
from distutils.dir_util import remove_tree, ensure_relative
from distutils.errors import *
from distutils.sysconfig import get_python_version
from distutils import log

class bdist_dumb(Command):

    description = "create a \"dumb\" built distribution"

    user_options = [('bdist-dir=', 'd',
                     "temporary directory for creating the distribution"),
                    ('plat-name=', 'p',
                     "platform name to embed in generated filenames "
                     "(default: %s)" % get_platform()),
                    ('format=', 'f',
                     "archive format to create (tar, gztar, bztar, xztar, "
                     "ztar, zip)"),
                    ('keep-temp', 'k',
                     "keep the pseudo-installation tree around after " +
                     "creating the distribution archive"),
                    ('dist-dir=', 'd',
                     "directory to put final built distributions in"),
                    ('skip-build', None,
                     "skip rebuilding everything (for testing/debugging)"),
                    ('relative', None,
                     "build the archive using relative paths "
                     "(default: false)"),
                    ('owner=', 'u',
                     "Owner name used when creating a tar file"
                     " [default: current user]"),
                    ('group=', 'g',
                     "Group name used when creating a tar file"
                     " [default: current group]"),
                   ]

    boolean_options = ['keep-temp', 'skip-build', 'relative']

    default_format = { 'posix': 'gztar',
                       'nt': 'zip' }

    def initialize_options(self):
        self.bdist_dir = None
        self.plat_name = None
        self.format = None
        self.keep_temp = 0
        self.dist_dir = None
        self.skip_build = None
        self.relative = 0
        self.owner = None
        self.group = None

    def finalize_options(self):
        if self.bdist_dir is None:
            bdist_base = self.get_finalized_command('bdist').bdist_base
            self.bdist_dir = os.path.join(bdist_base, 'dumb')

        if self.format is None:
            try:
                self.format = self.default_format[os.name]
            except KeyError:
                raise DistutilsPlatformError(
                       "don't know how to create dumb built distributions "
                       "on platform %s" % os.name)

        self.set_undefined_options('bdist',
                                   ('dist_dir', 'dist_dir'),
                                   ('plat_name', 'plat_name'),
                                   ('skip_build', 'skip_build'))

    def run(self):
        if not self.skip_build:
            self.run_command('build')

        install = self.reinitialize_command('install', reinit_subcommands=1)
        install.root = self.bdist_dir
        install.skip_build = self.skip_build
        install.warn_dir = 0

        log.info("installing to %s", self.bdist_dir)
        self.run_command('install')

        # And make an archive relative to the root of the
        # pseudo-installation tree.
        archive_basename = "%s.%s" % (self.distribution.get_fullname(),
                                      self.plat_name)

        pseudoinstall_root = os.path.join(self.dist_dir, archive_basename)
        if not self.relative:
            archive_root = self.bdist_dir
        else:
            if (self.distribution.has_ext_modules() and
                (install.install_base != install.install_platbase)):
                raise DistutilsPlatformError(
                       "can't make a dumb built distribution where "
                       "base and platbase are different (%s, %s)"
                       % (repr(install.install_base),
                          repr(install.install_platbase)))
            else:
                archive_root = os.path.join(self.bdist_dir,
                                   ensure_relative(install.install_base))

        # Make the archive
        filename = self.make_archive(pseudoinstall_root,
                                     self.format, root_dir=archive_root,
                                     owner=self.owner, group=self.group)
        if self.distribution.has_ext_modules():
            pyversion = get_python_version()
        else:
            pyversion = 'any'
        self.distribution.dist_files.append(('bdist_dumb', pyversion,
                                             filename))

        if not self.keep_temp:
            remove_tree(self.bdist_dir, dry_run=self.dry_run)
distutils/command/bdist_msi.py000064400000104737151153537440012561 0ustar00# Copyright (C) 2005, 2006 Martin von Löwis
# Licensed to PSF under a Contributor Agreement.
# The bdist_wininst command proper
# based on bdist_wininst
"""
Implements the bdist_msi command.
"""

import sys, os
from distutils.core import Command
from distutils.dir_util import remove_tree
from distutils.sysconfig import get_python_version
from distutils.version import StrictVersion
from distutils.errors import DistutilsOptionError
from distutils.util import get_platform
from distutils import log
import msilib
from msilib import schema, sequence, text
from msilib import Directory, Feature, Dialog, add_data

class PyDialog(Dialog):
    """Dialog class with a fixed layout: controls at the top, then a ruler,
    then a list of buttons: back, next, cancel. Optionally a bitmap at the
    left."""
    def __init__(self, *args, **kw):
        """Dialog(database, name, x, y, w, h, attributes, title, first,
        default, cancel, bitmap=true)"""
        Dialog.__init__(self, *args)
        ruler = self.h - 36
        bmwidth = 152*ruler/328
        #if kw.get("bitmap", True):
        #    self.bitmap("Bitmap", 0, 0, bmwidth, ruler, "PythonWin")
        self.line("BottomLine", 0, ruler, self.w, 0)

    def title(self, title):
        "Set the title text of the dialog at the top."
        # name, x, y, w, h, flags=Visible|Enabled|Transparent|NoPrefix,
        # text, in VerdanaBold10
        self.text("Title", 15, 10, 320, 60, 0x30003,
                  r"{\VerdanaBold10}%s" % title)

    def back(self, title, next, name = "Back", active = 1):
        """Add a back button with a given title, the tab-next button,
        its name in the Control table, possibly initially disabled.

        Return the button, so that events can be associated"""
        if active:
            flags = 3 # Visible|Enabled
        else:
            flags = 1 # Visible
        return self.pushbutton(name, 180, self.h-27 , 56, 17, flags, title, next)

    def cancel(self, title, next, name = "Cancel", active = 1):
        """Add a cancel button with a given title, the tab-next button,
        its name in the Control table, possibly initially disabled.

        Return the button, so that events can be associated"""
        if active:
            flags = 3 # Visible|Enabled
        else:
            flags = 1 # Visible
        return self.pushbutton(name, 304, self.h-27, 56, 17, flags, title, next)

    def next(self, title, next, name = "Next", active = 1):
        """Add a Next button with a given title, the tab-next button,
        its name in the Control table, possibly initially disabled.

        Return the button, so that events can be associated"""
        if active:
            flags = 3 # Visible|Enabled
        else:
            flags = 1 # Visible
        return self.pushbutton(name, 236, self.h-27, 56, 17, flags, title, next)

    def xbutton(self, name, title, next, xpos):
        """Add a button with a given title, the tab-next button,
        its name in the Control table, giving its x position; the
        y-position is aligned with the other buttons.

        Return the button, so that events can be associated"""
        return self.pushbutton(name, int(self.w*xpos - 28), self.h-27, 56, 17, 3, title, next)

class bdist_msi(Command):

    description = "create a Microsoft Installer (.msi) binary distribution"

    user_options = [('bdist-dir=', None,
                     "temporary directory for creating the distribution"),
                    ('plat-name=', 'p',
                     "platform name to embed in generated filenames "
                     "(default: %s)" % get_platform()),
                    ('keep-temp', 'k',
                     "keep the pseudo-installation tree around after " +
                     "creating the distribution archive"),
                    ('target-version=', None,
                     "require a specific python version" +
                     " on the target system"),
                    ('no-target-compile', 'c',
                     "do not compile .py to .pyc on the target system"),
                    ('no-target-optimize', 'o',
                     "do not compile .py to .pyo (optimized) "
                     "on the target system"),
                    ('dist-dir=', 'd',
                     "directory to put final built distributions in"),
                    ('skip-build', None,
                     "skip rebuilding everything (for testing/debugging)"),
                    ('install-script=', None,
                     "basename of installation script to be run after "
                     "installation or before deinstallation"),
                    ('pre-install-script=', None,
                     "Fully qualified filename of a script to be run before "
                     "any files are installed.  This script need not be in the "
                     "distribution"),
                   ]

    boolean_options = ['keep-temp', 'no-target-compile', 'no-target-optimize',
                       'skip-build']

    all_versions = ['2.0', '2.1', '2.2', '2.3', '2.4',
                    '2.5', '2.6', '2.7', '2.8', '2.9',
                    '3.0', '3.1', '3.2', '3.3', '3.4',
                    '3.5', '3.6', '3.7', '3.8', '3.9']
    other_version = 'X'

    def initialize_options(self):
        self.bdist_dir = None
        self.plat_name = None
        self.keep_temp = 0
        self.no_target_compile = 0
        self.no_target_optimize = 0
        self.target_version = None
        self.dist_dir = None
        self.skip_build = None
        self.install_script = None
        self.pre_install_script = None
        self.versions = None

    def finalize_options(self):
        self.set_undefined_options('bdist', ('skip_build', 'skip_build'))

        if self.bdist_dir is None:
            bdist_base = self.get_finalized_command('bdist').bdist_base
            self.bdist_dir = os.path.join(bdist_base, 'msi')

        short_version = get_python_version()
        if (not self.target_version) and self.distribution.has_ext_modules():
            self.target_version = short_version

        if self.target_version:
            self.versions = [self.target_version]
            if not self.skip_build and self.distribution.has_ext_modules()\
               and self.target_version != short_version:
                raise DistutilsOptionError(
                      "target version can only be %s, or the '--skip-build'"
                      " option must be specified" % (short_version,))
        else:
            self.versions = list(self.all_versions)

        self.set_undefined_options('bdist',
                                   ('dist_dir', 'dist_dir'),
                                   ('plat_name', 'plat_name'),
                                   )

        if self.pre_install_script:
            raise DistutilsOptionError(
                  "the pre-install-script feature is not yet implemented")

        if self.install_script:
            for script in self.distribution.scripts:
                if self.install_script == os.path.basename(script):
                    break
            else:
                raise DistutilsOptionError(
                      "install_script '%s' not found in scripts"
                      % self.install_script)
        self.install_script_key = None

    def run(self):
        if not self.skip_build:
            self.run_command('build')

        install = self.reinitialize_command('install', reinit_subcommands=1)
        install.prefix = self.bdist_dir
        install.skip_build = self.skip_build
        install.warn_dir = 0

        install_lib = self.reinitialize_command('install_lib')
        # we do not want to include pyc or pyo files
        install_lib.compile = 0
        install_lib.optimize = 0

        if self.distribution.has_ext_modules():
            # If we are building an installer for a Python version other
            # than the one we are currently running, then we need to ensure
            # our build_lib reflects the other Python version rather than ours.
            # Note that for target_version!=sys.version, we must have skipped the
            # build step, so there is no issue with enforcing the build of this
            # version.
            target_version = self.target_version
            if not target_version:
                assert self.skip_build, "Should have already checked this"
                target_version = '%d.%d' % sys.version_info[:2]
            plat_specifier = ".%s-%s" % (self.plat_name, target_version)
            build = self.get_finalized_command('build')
            build.build_lib = os.path.join(build.build_base,
                                           'lib' + plat_specifier)

        log.info("installing to %s", self.bdist_dir)
        install.ensure_finalized()

        # avoid warning of 'install_lib' about installing
        # into a directory not in sys.path
        sys.path.insert(0, os.path.join(self.bdist_dir, 'PURELIB'))

        install.run()

        del sys.path[0]

        self.mkpath(self.dist_dir)
        fullname = self.distribution.get_fullname()
        installer_name = self.get_installer_filename(fullname)
        installer_name = os.path.abspath(installer_name)
        if os.path.exists(installer_name): os.unlink(installer_name)

        metadata = self.distribution.metadata
        author = metadata.author
        if not author:
            author = metadata.maintainer
        if not author:
            author = "UNKNOWN"
        version = metadata.get_version()
        # ProductVersion must be strictly numeric
        # XXX need to deal with prerelease versions
        sversion = "%d.%d.%d" % StrictVersion(version).version
        # Prefix ProductName with Python x.y, so that
        # it sorts together with the other Python packages
        # in Add-Remove-Programs (APR)
        fullname = self.distribution.get_fullname()
        if self.target_version:
            product_name = "Python %s %s" % (self.target_version, fullname)
        else:
            product_name = "Python %s" % (fullname)
        self.db = msilib.init_database(installer_name, schema,
                product_name, msilib.gen_uuid(),
                sversion, author)
        msilib.add_tables(self.db, sequence)
        props = [('DistVersion', version)]
        email = metadata.author_email or metadata.maintainer_email
        if email:
            props.append(("ARPCONTACT", email))
        if metadata.url:
            props.append(("ARPURLINFOABOUT", metadata.url))
        if props:
            add_data(self.db, 'Property', props)

        self.add_find_python()
        self.add_files()
        self.add_scripts()
        self.add_ui()
        self.db.Commit()

        if hasattr(self.distribution, 'dist_files'):
            tup = 'bdist_msi', self.target_version or 'any', fullname
            self.distribution.dist_files.append(tup)

        if not self.keep_temp:
            remove_tree(self.bdist_dir, dry_run=self.dry_run)

    def add_files(self):
        db = self.db
        cab = msilib.CAB("distfiles")
        rootdir = os.path.abspath(self.bdist_dir)

        root = Directory(db, cab, None, rootdir, "TARGETDIR", "SourceDir")
        f = Feature(db, "Python", "Python", "Everything",
                    0, 1, directory="TARGETDIR")

        items = [(f, root, '')]
        for version in self.versions + [self.other_version]:
            target = "TARGETDIR" + version
            name = default = "Python" + version
            desc = "Everything"
            if version is self.other_version:
                title = "Python from another location"
                level = 2
            else:
                title = "Python %s from registry" % version
                level = 1
            f = Feature(db, name, title, desc, 1, level, directory=target)
            dir = Directory(db, cab, root, rootdir, target, default)
            items.append((f, dir, version))
        db.Commit()

        seen = {}
        for feature, dir, version in items:
            todo = [dir]
            while todo:
                dir = todo.pop()
                for file in os.listdir(dir.absolute):
                    afile = os.path.join(dir.absolute, file)
                    if os.path.isdir(afile):
                        short = "%s|%s" % (dir.make_short(file), file)
                        default = file + version
                        newdir = Directory(db, cab, dir, file, default, short)
                        todo.append(newdir)
                    else:
                        if not dir.component:
                            dir.start_component(dir.logical, feature, 0)
                        if afile not in seen:
                            key = seen[afile] = dir.add_file(file)
                            if file==self.install_script:
                                if self.install_script_key:
                                    raise DistutilsOptionError(
                                          "Multiple files with name %s" % file)
                                self.install_script_key = '[#%s]' % key
                        else:
                            key = seen[afile]
                            add_data(self.db, "DuplicateFile",
                                [(key + version, dir.component, key, None, dir.logical)])
            db.Commit()
        cab.commit(db)

    def add_find_python(self):
        """Adds code to the installer to compute the location of Python.

        Properties PYTHON.MACHINE.X.Y and PYTHON.USER.X.Y will be set from the
        registry for each version of Python.

        Properties TARGETDIRX.Y will be set from PYTHON.USER.X.Y if defined,
        else from PYTHON.MACHINE.X.Y.

        Properties PYTHONX.Y will be set to TARGETDIRX.Y\\python.exe"""

        start = 402
        for ver in self.versions:
            install_path = r"SOFTWARE\Python\PythonCore\%s\InstallPath" % ver
            machine_reg = "python.machine." + ver
            user_reg = "python.user." + ver
            machine_prop = "PYTHON.MACHINE." + ver
            user_prop = "PYTHON.USER." + ver
            machine_action = "PythonFromMachine" + ver
            user_action = "PythonFromUser" + ver
            exe_action = "PythonExe" + ver
            target_dir_prop = "TARGETDIR" + ver
            exe_prop = "PYTHON" + ver
            if msilib.Win64:
                # type: msidbLocatorTypeRawValue + msidbLocatorType64bit
                Type = 2+16
            else:
                Type = 2
            add_data(self.db, "RegLocator",
                    [(machine_reg, 2, install_path, None, Type),
                     (user_reg, 1, install_path, None, Type)])
            add_data(self.db, "AppSearch",
                    [(machine_prop, machine_reg),
                     (user_prop, user_reg)])
            add_data(self.db, "CustomAction",
                    [(machine_action, 51+256, target_dir_prop, "[" + machine_prop + "]"),
                     (user_action, 51+256, target_dir_prop, "[" + user_prop + "]"),
                     (exe_action, 51+256, exe_prop, "[" + target_dir_prop + "]\\python.exe"),
                    ])
            add_data(self.db, "InstallExecuteSequence",
                    [(machine_action, machine_prop, start),
                     (user_action, user_prop, start + 1),
                     (exe_action, None, start + 2),
                    ])
            add_data(self.db, "InstallUISequence",
                    [(machine_action, machine_prop, start),
                     (user_action, user_prop, start + 1),
                     (exe_action, None, start + 2),
                    ])
            add_data(self.db, "Condition",
                    [("Python" + ver, 0, "NOT TARGETDIR" + ver)])
            start += 4
            assert start < 500

    def add_scripts(self):
        if self.install_script:
            start = 6800
            for ver in self.versions + [self.other_version]:
                install_action = "install_script." + ver
                exe_prop = "PYTHON" + ver
                add_data(self.db, "CustomAction",
                        [(install_action, 50, exe_prop, self.install_script_key)])
                add_data(self.db, "InstallExecuteSequence",
                        [(install_action, "&Python%s=3" % ver, start)])
                start += 1
        # XXX pre-install scripts are currently refused in finalize_options()
        #     but if this feature is completed, it will also need to add
        #     entries for each version as the above code does
        if self.pre_install_script:
            scriptfn = os.path.join(self.bdist_dir, "preinstall.bat")
            with open(scriptfn, "w") as f:
                # The batch file will be executed with [PYTHON], so that %1
                # is the path to the Python interpreter; %0 will be the path
                # of the batch file.
                # rem ="""
                # %1 %0
                # exit
                # """
                # <actual script>
                f.write('rem ="""\n%1 %0\nexit\n"""\n')
                with open(self.pre_install_script) as fin:
                    f.write(fin.read())
            add_data(self.db, "Binary",
                [("PreInstall", msilib.Binary(scriptfn))
                ])
            add_data(self.db, "CustomAction",
                [("PreInstall", 2, "PreInstall", None)
                ])
            add_data(self.db, "InstallExecuteSequence",
                    [("PreInstall", "NOT Installed", 450)])


    def add_ui(self):
        db = self.db
        x = y = 50
        w = 370
        h = 300
        title = "[ProductName] Setup"

        # see "Dialog Style Bits"
        modal = 3      # visible | modal
        modeless = 1   # visible
        track_disk_space = 32

        # UI customization properties
        add_data(db, "Property",
                 # See "DefaultUIFont Property"
                 [("DefaultUIFont", "DlgFont8"),
                  # See "ErrorDialog Style Bit"
                  ("ErrorDialog", "ErrorDlg"),
                  ("Progress1", "Install"),   # modified in maintenance type dlg
                  ("Progress2", "installs"),
                  ("MaintenanceForm_Action", "Repair"),
                  # possible values: ALL, JUSTME
                  ("WhichUsers", "ALL")
                 ])

        # Fonts, see "TextStyle Table"
        add_data(db, "TextStyle",
                 [("DlgFont8", "Tahoma", 9, None, 0),
                  ("DlgFontBold8", "Tahoma", 8, None, 1), #bold
                  ("VerdanaBold10", "Verdana", 10, None, 1),
                  ("VerdanaRed9", "Verdana", 9, 255, 0),
                 ])

        # UI Sequences, see "InstallUISequence Table", "Using a Sequence Table"
        # Numbers indicate sequence; see sequence.py for how these action integrate
        add_data(db, "InstallUISequence",
                 [("PrepareDlg", "Not Privileged or Windows9x or Installed", 140),
                  ("WhichUsersDlg", "Privileged and not Windows9x and not Installed", 141),
                  # In the user interface, assume all-users installation if privileged.
                  ("SelectFeaturesDlg", "Not Installed", 1230),
                  # XXX no support for resume installations yet
                  #("ResumeDlg", "Installed AND (RESUME OR Preselected)", 1240),
                  ("MaintenanceTypeDlg", "Installed AND NOT RESUME AND NOT Preselected", 1250),
                  ("ProgressDlg", None, 1280)])

        add_data(db, 'ActionText', text.ActionText)
        add_data(db, 'UIText', text.UIText)
        #####################################################################
        # Standard dialogs: FatalError, UserExit, ExitDialog
        fatal=PyDialog(db, "FatalError", x, y, w, h, modal, title,
                     "Finish", "Finish", "Finish")
        fatal.title("[ProductName] Installer ended prematurely")
        fatal.back("< Back", "Finish", active = 0)
        fatal.cancel("Cancel", "Back", active = 0)
        fatal.text("Description1", 15, 70, 320, 80, 0x30003,
                   "[ProductName] setup ended prematurely because of an error.  Your system has not been modified.  To install this program at a later time, please run the installation again.")
        fatal.text("Description2", 15, 155, 320, 20, 0x30003,
                   "Click the Finish button to exit the Installer.")
        c=fatal.next("Finish", "Cancel", name="Finish")
        c.event("EndDialog", "Exit")

        user_exit=PyDialog(db, "UserExit", x, y, w, h, modal, title,
                     "Finish", "Finish", "Finish")
        user_exit.title("[ProductName] Installer was interrupted")
        user_exit.back("< Back", "Finish", active = 0)
        user_exit.cancel("Cancel", "Back", active = 0)
        user_exit.text("Description1", 15, 70, 320, 80, 0x30003,
                   "[ProductName] setup was interrupted.  Your system has not been modified.  "
                   "To install this program at a later time, please run the installation again.")
        user_exit.text("Description2", 15, 155, 320, 20, 0x30003,
                   "Click the Finish button to exit the Installer.")
        c = user_exit.next("Finish", "Cancel", name="Finish")
        c.event("EndDialog", "Exit")

        exit_dialog = PyDialog(db, "ExitDialog", x, y, w, h, modal, title,
                             "Finish", "Finish", "Finish")
        exit_dialog.title("Completing the [ProductName] Installer")
        exit_dialog.back("< Back", "Finish", active = 0)
        exit_dialog.cancel("Cancel", "Back", active = 0)
        exit_dialog.text("Description", 15, 235, 320, 20, 0x30003,
                   "Click the Finish button to exit the Installer.")
        c = exit_dialog.next("Finish", "Cancel", name="Finish")
        c.event("EndDialog", "Return")

        #####################################################################
        # Required dialog: FilesInUse, ErrorDlg
        inuse = PyDialog(db, "FilesInUse",
                         x, y, w, h,
                         19,                # KeepModeless|Modal|Visible
                         title,
                         "Retry", "Retry", "Retry", bitmap=False)
        inuse.text("Title", 15, 6, 200, 15, 0x30003,
                   r"{\DlgFontBold8}Files in Use")
        inuse.text("Description", 20, 23, 280, 20, 0x30003,
               "Some files that need to be updated are currently in use.")
        inuse.text("Text", 20, 55, 330, 50, 3,
                   "The following applications are using files that need to be updated by this setup. Close these applications and then click Retry to continue the installation or Cancel to exit it.")
        inuse.control("List", "ListBox", 20, 107, 330, 130, 7, "FileInUseProcess",
                      None, None, None)
        c=inuse.back("Exit", "Ignore", name="Exit")
        c.event("EndDialog", "Exit")
        c=inuse.next("Ignore", "Retry", name="Ignore")
        c.event("EndDialog", "Ignore")
        c=inuse.cancel("Retry", "Exit", name="Retry")
        c.event("EndDialog","Retry")

        # See "Error Dialog". See "ICE20" for the required names of the controls.
        error = Dialog(db, "ErrorDlg",
                       50, 10, 330, 101,
                       65543,       # Error|Minimize|Modal|Visible
                       title,
                       "ErrorText", None, None)
        error.text("ErrorText", 50,9,280,48,3, "")
        #error.control("ErrorIcon", "Icon", 15, 9, 24, 24, 5242881, None, "py.ico", None, None)
        error.pushbutton("N",120,72,81,21,3,"No",None).event("EndDialog","ErrorNo")
        error.pushbutton("Y",240,72,81,21,3,"Yes",None).event("EndDialog","ErrorYes")
        error.pushbutton("A",0,72,81,21,3,"Abort",None).event("EndDialog","ErrorAbort")
        error.pushbutton("C",42,72,81,21,3,"Cancel",None).event("EndDialog","ErrorCancel")
        error.pushbutton("I",81,72,81,21,3,"Ignore",None).event("EndDialog","ErrorIgnore")
        error.pushbutton("O",159,72,81,21,3,"Ok",None).event("EndDialog","ErrorOk")
        error.pushbutton("R",198,72,81,21,3,"Retry",None).event("EndDialog","ErrorRetry")

        #####################################################################
        # Global "Query Cancel" dialog
        cancel = Dialog(db, "CancelDlg", 50, 10, 260, 85, 3, title,
                        "No", "No", "No")
        cancel.text("Text", 48, 15, 194, 30, 3,
                    "Are you sure you want to cancel [ProductName] installation?")
        #cancel.control("Icon", "Icon", 15, 15, 24, 24, 5242881, None,
        #               "py.ico", None, None)
        c=cancel.pushbutton("Yes", 72, 57, 56, 17, 3, "Yes", "No")
        c.event("EndDialog", "Exit")

        c=cancel.pushbutton("No", 132, 57, 56, 17, 3, "No", "Yes")
        c.event("EndDialog", "Return")

        #####################################################################
        # Global "Wait for costing" dialog
        costing = Dialog(db, "WaitForCostingDlg", 50, 10, 260, 85, modal, title,
                         "Return", "Return", "Return")
        costing.text("Text", 48, 15, 194, 30, 3,
                     "Please wait while the installer finishes determining your disk space requirements.")
        c = costing.pushbutton("Return", 102, 57, 56, 17, 3, "Return", None)
        c.event("EndDialog", "Exit")

        #####################################################################
        # Preparation dialog: no user input except cancellation
        prep = PyDialog(db, "PrepareDlg", x, y, w, h, modeless, title,
                        "Cancel", "Cancel", "Cancel")
        prep.text("Description", 15, 70, 320, 40, 0x30003,
                  "Please wait while the Installer prepares to guide you through the installation.")
        prep.title("Welcome to the [ProductName] Installer")
        c=prep.text("ActionText", 15, 110, 320, 20, 0x30003, "Pondering...")
        c.mapping("ActionText", "Text")
        c=prep.text("ActionData", 15, 135, 320, 30, 0x30003, None)
        c.mapping("ActionData", "Text")
        prep.back("Back", None, active=0)
        prep.next("Next", None, active=0)
        c=prep.cancel("Cancel", None)
        c.event("SpawnDialog", "CancelDlg")

        #####################################################################
        # Feature (Python directory) selection
        seldlg = PyDialog(db, "SelectFeaturesDlg", x, y, w, h, modal, title,
                        "Next", "Next", "Cancel")
        seldlg.title("Select Python Installations")

        seldlg.text("Hint", 15, 30, 300, 20, 3,
                    "Select the Python locations where %s should be installed."
                    % self.distribution.get_fullname())

        seldlg.back("< Back", None, active=0)
        c = seldlg.next("Next >", "Cancel")
        order = 1
        c.event("[TARGETDIR]", "[SourceDir]", ordering=order)
        for version in self.versions + [self.other_version]:
            order += 1
            c.event("[TARGETDIR]", "[TARGETDIR%s]" % version,
                    "FEATURE_SELECTED AND &Python%s=3" % version,
                    ordering=order)
        c.event("SpawnWaitDialog", "WaitForCostingDlg", ordering=order + 1)
        c.event("EndDialog", "Return", ordering=order + 2)
        c = seldlg.cancel("Cancel", "Features")
        c.event("SpawnDialog", "CancelDlg")

        c = seldlg.control("Features", "SelectionTree", 15, 60, 300, 120, 3,
                           "FEATURE", None, "PathEdit", None)
        c.event("[FEATURE_SELECTED]", "1")
        ver = self.other_version
        install_other_cond = "FEATURE_SELECTED AND &Python%s=3" % ver
        dont_install_other_cond = "FEATURE_SELECTED AND &Python%s<>3" % ver

        c = seldlg.text("Other", 15, 200, 300, 15, 3,
                        "Provide an alternate Python location")
        c.condition("Enable", install_other_cond)
        c.condition("Show", install_other_cond)
        c.condition("Disable", dont_install_other_cond)
        c.condition("Hide", dont_install_other_cond)

        c = seldlg.control("PathEdit", "PathEdit", 15, 215, 300, 16, 1,
                           "TARGETDIR" + ver, None, "Next", None)
        c.condition("Enable", install_other_cond)
        c.condition("Show", install_other_cond)
        c.condition("Disable", dont_install_other_cond)
        c.condition("Hide", dont_install_other_cond)

        #####################################################################
        # Disk cost
        cost = PyDialog(db, "DiskCostDlg", x, y, w, h, modal, title,
                        "OK", "OK", "OK", bitmap=False)
        cost.text("Title", 15, 6, 200, 15, 0x30003,
                 r"{\DlgFontBold8}Disk Space Requirements")
        cost.text("Description", 20, 20, 280, 20, 0x30003,
                  "The disk space required for the installation of the selected features.")
        cost.text("Text", 20, 53, 330, 60, 3,
                  "The highlighted volumes (if any) do not have enough disk space "
              "available for the currently selected features.  You can either "
              "remove some files from the highlighted volumes, or choose to "
              "install less features onto local drive(s), or select different "
              "destination drive(s).")
        cost.control("VolumeList", "VolumeCostList", 20, 100, 330, 150, 393223,
                     None, "{120}{70}{70}{70}{70}", None, None)
        cost.xbutton("OK", "Ok", None, 0.5).event("EndDialog", "Return")

        #####################################################################
        # WhichUsers Dialog. Only available on NT, and for privileged users.
        # This must be run before FindRelatedProducts, because that will
        # take into account whether the previous installation was per-user
        # or per-machine. We currently don't support going back to this
        # dialog after "Next" was selected; to support this, we would need to
        # find how to reset the ALLUSERS property, and how to re-run
        # FindRelatedProducts.
        # On Windows9x, the ALLUSERS property is ignored on the command line
        # and in the Property table, but installer fails according to the documentation
        # if a dialog attempts to set ALLUSERS.
        whichusers = PyDialog(db, "WhichUsersDlg", x, y, w, h, modal, title,
                            "AdminInstall", "Next", "Cancel")
        whichusers.title("Select whether to install [ProductName] for all users of this computer.")
        # A radio group with two options: allusers, justme
        g = whichusers.radiogroup("AdminInstall", 15, 60, 260, 50, 3,
                                  "WhichUsers", "", "Next")
        g.add("ALL", 0, 5, 150, 20, "Install for all users")
        g.add("JUSTME", 0, 25, 150, 20, "Install just for me")

        whichusers.back("Back", None, active=0)

        c = whichusers.next("Next >", "Cancel")
        c.event("[ALLUSERS]", "1", 'WhichUsers="ALL"', 1)
        c.event("EndDialog", "Return", ordering = 2)

        c = whichusers.cancel("Cancel", "AdminInstall")
        c.event("SpawnDialog", "CancelDlg")

        #####################################################################
        # Installation Progress dialog (modeless)
        progress = PyDialog(db, "ProgressDlg", x, y, w, h, modeless, title,
                            "Cancel", "Cancel", "Cancel", bitmap=False)
        progress.text("Title", 20, 15, 200, 15, 0x30003,
                     r"{\DlgFontBold8}[Progress1] [ProductName]")
        progress.text("Text", 35, 65, 300, 30, 3,
                      "Please wait while the Installer [Progress2] [ProductName]. "
                      "This may take several minutes.")
        progress.text("StatusLabel", 35, 100, 35, 20, 3, "Status:")

        c=progress.text("ActionText", 70, 100, w-70, 20, 3, "Pondering...")
        c.mapping("ActionText", "Text")

        #c=progress.text("ActionData", 35, 140, 300, 20, 3, None)
        #c.mapping("ActionData", "Text")

        c=progress.control("ProgressBar", "ProgressBar", 35, 120, 300, 10, 65537,
                           None, "Progress done", None, None)
        c.mapping("SetProgress", "Progress")

        progress.back("< Back", "Next", active=False)
        progress.next("Next >", "Cancel", active=False)
        progress.cancel("Cancel", "Back").event("SpawnDialog", "CancelDlg")

        ###################################################################
        # Maintenance type: repair/uninstall
        maint = PyDialog(db, "MaintenanceTypeDlg", x, y, w, h, modal, title,
                         "Next", "Next", "Cancel")
        maint.title("Welcome to the [ProductName] Setup Wizard")
        maint.text("BodyText", 15, 63, 330, 42, 3,
                   "Select whether you want to repair or remove [ProductName].")
        g=maint.radiogroup("RepairRadioGroup", 15, 108, 330, 60, 3,
                            "MaintenanceForm_Action", "", "Next")
        #g.add("Change", 0, 0, 200, 17, "&Change [ProductName]")
        g.add("Repair", 0, 18, 200, 17, "&Repair [ProductName]")
        g.add("Remove", 0, 36, 200, 17, "Re&move [ProductName]")

        maint.back("< Back", None, active=False)
        c=maint.next("Finish", "Cancel")
        # Change installation: Change progress dialog to "Change", then ask
        # for feature selection
        #c.event("[Progress1]", "Change", 'MaintenanceForm_Action="Change"', 1)
        #c.event("[Progress2]", "changes", 'MaintenanceForm_Action="Change"', 2)

        # Reinstall: Change progress dialog to "Repair", then invoke reinstall
        # Also set list of reinstalled features to "ALL"
        c.event("[REINSTALL]", "ALL", 'MaintenanceForm_Action="Repair"', 5)
        c.event("[Progress1]", "Repairing", 'MaintenanceForm_Action="Repair"', 6)
        c.event("[Progress2]", "repairs", 'MaintenanceForm_Action="Repair"', 7)
        c.event("Reinstall", "ALL", 'MaintenanceForm_Action="Repair"', 8)

        # Uninstall: Change progress to "Remove", then invoke uninstall
        # Also set list of removed features to "ALL"
        c.event("[REMOVE]", "ALL", 'MaintenanceForm_Action="Remove"', 11)
        c.event("[Progress1]", "Removing", 'MaintenanceForm_Action="Remove"', 12)
        c.event("[Progress2]", "removes", 'MaintenanceForm_Action="Remove"', 13)
        c.event("Remove", "ALL", 'MaintenanceForm_Action="Remove"', 14)

        # Close dialog when maintenance action scheduled
        c.event("EndDialog", "Return", 'MaintenanceForm_Action<>"Change"', 20)
        #c.event("NewDialog", "SelectFeaturesDlg", 'MaintenanceForm_Action="Change"', 21)

        maint.cancel("Cancel", "RepairRadioGroup").event("SpawnDialog", "CancelDlg")

    def get_installer_filename(self, fullname):
        # Factored out to allow overriding in subclasses
        if self.target_version:
            base_name = "%s.%s-py%s.msi" % (fullname, self.plat_name,
                                            self.target_version)
        else:
            base_name = "%s.%s.msi" % (fullname, self.plat_name)
        installer_name = os.path.join(self.dist_dir, base_name)
        return installer_name
distutils/command/build_scripts.py000064400000014130151153537440013435 0ustar00"""distutils.command.build_scripts

Implements the Distutils 'build_scripts' command."""

import os, re
from stat import ST_MODE
from distutils import sysconfig
from distutils.core import Command
from distutils.dep_util import newer
from distutils.util import convert_path, Mixin2to3
from distutils import log
import tokenize

# check if Python is called on the first line with this expression
first_line_re = re.compile(b'^#!.*python[0-9.]*([ \t].*)?$')

class build_scripts(Command):

    description = "\"build\" scripts (copy and fixup #! line)"

    user_options = [
        ('build-dir=', 'd', "directory to \"build\" (copy) to"),
        ('force', 'f', "forcibly build everything (ignore file timestamps"),
        ('executable=', 'e', "specify final destination interpreter path"),
        ]

    boolean_options = ['force']


    def initialize_options(self):
        self.build_dir = None
        self.scripts = None
        self.force = None
        self.executable = None
        self.outfiles = None

    def finalize_options(self):
        self.set_undefined_options('build',
                                   ('build_scripts', 'build_dir'),
                                   ('force', 'force'),
                                   ('executable', 'executable'))
        self.scripts = self.distribution.scripts

    def get_source_files(self):
        return self.scripts

    def run(self):
        if not self.scripts:
            return
        self.copy_scripts()


    def copy_scripts(self):
        r"""Copy each script listed in 'self.scripts'; if it's marked as a
        Python script in the Unix way (first line matches 'first_line_re',
        ie. starts with "\#!" and contains "python"), then adjust the first
        line to refer to the current Python interpreter as we copy.
        """
        self.mkpath(self.build_dir)
        outfiles = []
        updated_files = []
        for script in self.scripts:
            adjust = False
            script = convert_path(script)
            outfile = os.path.join(self.build_dir, os.path.basename(script))
            outfiles.append(outfile)

            if not self.force and not newer(script, outfile):
                log.debug("not copying %s (up-to-date)", script)
                continue

            # Always open the file, but ignore failures in dry-run mode --
            # that way, we'll get accurate feedback if we can read the
            # script.
            try:
                f = open(script, "rb")
            except OSError:
                if not self.dry_run:
                    raise
                f = None
            else:
                encoding, lines = tokenize.detect_encoding(f.readline)
                f.seek(0)
                first_line = f.readline()
                if not first_line:
                    self.warn("%s is an empty file (skipping)" % script)
                    continue

                match = first_line_re.match(first_line)
                if match:
                    adjust = True
                    post_interp = match.group(1) or b''

            if adjust:
                log.info("copying and adjusting %s -> %s", script,
                         self.build_dir)
                updated_files.append(outfile)
                if not self.dry_run:
                    if not sysconfig.python_build:
                        executable = self.executable
                    else:
                        executable = os.path.join(
                            sysconfig.get_config_var("BINDIR"),
                           "python%s%s" % (sysconfig.get_config_var("VERSION"),
                                           sysconfig.get_config_var("EXE")))
                    executable = os.fsencode(executable)
                    shebang = b"#!" + executable + post_interp + b"\n"
                    # Python parser starts to read a script using UTF-8 until
                    # it gets a #coding:xxx cookie. The shebang has to be the
                    # first line of a file, the #coding:xxx cookie cannot be
                    # written before. So the shebang has to be decodable from
                    # UTF-8.
                    try:
                        shebang.decode('utf-8')
                    except UnicodeDecodeError:
                        raise ValueError(
                            "The shebang ({!r}) is not decodable "
                            "from utf-8".format(shebang))
                    # If the script is encoded to a custom encoding (use a
                    # #coding:xxx cookie), the shebang has to be decodable from
                    # the script encoding too.
                    try:
                        shebang.decode(encoding)
                    except UnicodeDecodeError:
                        raise ValueError(
                            "The shebang ({!r}) is not decodable "
                            "from the script encoding ({})"
                            .format(shebang, encoding))
                    with open(outfile, "wb") as outf:
                        outf.write(shebang)
                        outf.writelines(f.readlines())
                if f:
                    f.close()
            else:
                if f:
                    f.close()
                updated_files.append(outfile)
                self.copy_file(script, outfile)

        if os.name == 'posix':
            for file in outfiles:
                if self.dry_run:
                    log.info("changing mode of %s", file)
                else:
                    oldmode = os.stat(file)[ST_MODE] & 0o7777
                    newmode = (oldmode | 0o555) & 0o7777
                    if newmode != oldmode:
                        log.info("changing mode of %s from %o to %o",
                                 file, oldmode, newmode)
                        os.chmod(file, newmode)
        # XXX should we modify self.outfiles?
        return outfiles, updated_files

class build_scripts_2to3(build_scripts, Mixin2to3):

    def copy_scripts(self):
        outfiles, updated_files = build_scripts.copy_scripts(self)
        if not self.dry_run:
            self.run_2to3(updated_files)
        return outfiles, updated_files
distutils/msvc9compiler.py000064400000073457151153537440011766 0ustar00"""distutils.msvc9compiler

Contains MSVCCompiler, an implementation of the abstract CCompiler class
for the Microsoft Visual Studio 2008.

The module is compatible with VS 2005 and VS 2008. You can find legacy support
for older versions of VS in distutils.msvccompiler.
"""

# Written by Perry Stoll
# hacked by Robin Becker and Thomas Heller to do a better job of
#   finding DevStudio (through the registry)
# ported to VS2005 and VS 2008 by Christian Heimes

import os
import subprocess
import sys
import re

from distutils.errors import DistutilsExecError, DistutilsPlatformError, \
                             CompileError, LibError, LinkError
from distutils.ccompiler import CCompiler, gen_preprocess_options, \
                                gen_lib_options
from distutils import log
from distutils.util import get_platform

import winreg

RegOpenKeyEx = winreg.OpenKeyEx
RegEnumKey = winreg.EnumKey
RegEnumValue = winreg.EnumValue
RegError = winreg.error

HKEYS = (winreg.HKEY_USERS,
         winreg.HKEY_CURRENT_USER,
         winreg.HKEY_LOCAL_MACHINE,
         winreg.HKEY_CLASSES_ROOT)

NATIVE_WIN64 = (sys.platform == 'win32' and sys.maxsize > 2**32)
if NATIVE_WIN64:
    # Visual C++ is a 32-bit application, so we need to look in
    # the corresponding registry branch, if we're running a
    # 64-bit Python on Win64
    VS_BASE = r"Software\Wow6432Node\Microsoft\VisualStudio\%0.1f"
    WINSDK_BASE = r"Software\Wow6432Node\Microsoft\Microsoft SDKs\Windows"
    NET_BASE = r"Software\Wow6432Node\Microsoft\.NETFramework"
else:
    VS_BASE = r"Software\Microsoft\VisualStudio\%0.1f"
    WINSDK_BASE = r"Software\Microsoft\Microsoft SDKs\Windows"
    NET_BASE = r"Software\Microsoft\.NETFramework"

# A map keyed by get_platform() return values to values accepted by
# 'vcvarsall.bat'.  Note a cross-compile may combine these (eg, 'x86_amd64' is
# the param to cross-compile on x86 targeting amd64.)
PLAT_TO_VCVARS = {
    'win32' : 'x86',
    'win-amd64' : 'amd64',
}

class Reg:
    """Helper class to read values from the registry
    """

    def get_value(cls, path, key):
        for base in HKEYS:
            d = cls.read_values(base, path)
            if d and key in d:
                return d[key]
        raise KeyError(key)
    get_value = classmethod(get_value)

    def read_keys(cls, base, key):
        """Return list of registry keys."""
        try:
            handle = RegOpenKeyEx(base, key)
        except RegError:
            return None
        L = []
        i = 0
        while True:
            try:
                k = RegEnumKey(handle, i)
            except RegError:
                break
            L.append(k)
            i += 1
        return L
    read_keys = classmethod(read_keys)

    def read_values(cls, base, key):
        """Return dict of registry keys and values.

        All names are converted to lowercase.
        """
        try:
            handle = RegOpenKeyEx(base, key)
        except RegError:
            return None
        d = {}
        i = 0
        while True:
            try:
                name, value, type = RegEnumValue(handle, i)
            except RegError:
                break
            name = name.lower()
            d[cls.convert_mbcs(name)] = cls.convert_mbcs(value)
            i += 1
        return d
    read_values = classmethod(read_values)

    def convert_mbcs(s):
        dec = getattr(s, "decode", None)
        if dec is not None:
            try:
                s = dec("mbcs")
            except UnicodeError:
                pass
        return s
    convert_mbcs = staticmethod(convert_mbcs)

class MacroExpander:

    def __init__(self, version):
        self.macros = {}
        self.vsbase = VS_BASE % version
        self.load_macros(version)

    def set_macro(self, macro, path, key):
        self.macros["$(%s)" % macro] = Reg.get_value(path, key)

    def load_macros(self, version):
        self.set_macro("VCInstallDir", self.vsbase + r"\Setup\VC", "productdir")
        self.set_macro("VSInstallDir", self.vsbase + r"\Setup\VS", "productdir")
        self.set_macro("FrameworkDir", NET_BASE, "installroot")
        try:
            if version >= 8.0:
                self.set_macro("FrameworkSDKDir", NET_BASE,
                               "sdkinstallrootv2.0")
            else:
                raise KeyError("sdkinstallrootv2.0")
        except KeyError:
            raise DistutilsPlatformError(
            """Python was built with Visual Studio 2008;
extensions must be built with a compiler than can generate compatible binaries.
Visual Studio 2008 was not found on this system. If you have Cygwin installed,
you can try compiling with MingW32, by passing "-c mingw32" to setup.py.""")

        if version >= 9.0:
            self.set_macro("FrameworkVersion", self.vsbase, "clr version")
            self.set_macro("WindowsSdkDir", WINSDK_BASE, "currentinstallfolder")
        else:
            p = r"Software\Microsoft\NET Framework Setup\Product"
            for base in HKEYS:
                try:
                    h = RegOpenKeyEx(base, p)
                except RegError:
                    continue
                key = RegEnumKey(h, 0)
                d = Reg.get_value(base, r"%s\%s" % (p, key))
                self.macros["$(FrameworkVersion)"] = d["version"]

    def sub(self, s):
        for k, v in self.macros.items():
            s = s.replace(k, v)
        return s

def get_build_version():
    """Return the version of MSVC that was used to build Python.

    For Python 2.3 and up, the version number is included in
    sys.version.  For earlier versions, assume the compiler is MSVC 6.
    """
    prefix = "MSC v."
    i = sys.version.find(prefix)
    if i == -1:
        return 6
    i = i + len(prefix)
    s, rest = sys.version[i:].split(" ", 1)
    majorVersion = int(s[:-2]) - 6
    if majorVersion >= 13:
        # v13 was skipped and should be v14
        majorVersion += 1
    minorVersion = int(s[2:3]) / 10.0
    # I don't think paths are affected by minor version in version 6
    if majorVersion == 6:
        minorVersion = 0
    if majorVersion >= 6:
        return majorVersion + minorVersion
    # else we don't know what version of the compiler this is
    return None

def normalize_and_reduce_paths(paths):
    """Return a list of normalized paths with duplicates removed.

    The current order of paths is maintained.
    """
    # Paths are normalized so things like:  /a and /a/ aren't both preserved.
    reduced_paths = []
    for p in paths:
        np = os.path.normpath(p)
        # XXX(nnorwitz): O(n**2), if reduced_paths gets long perhaps use a set.
        if np not in reduced_paths:
            reduced_paths.append(np)
    return reduced_paths

def removeDuplicates(variable):
    """Remove duplicate values of an environment variable.
    """
    oldList = variable.split(os.pathsep)
    newList = []
    for i in oldList:
        if i not in newList:
            newList.append(i)
    newVariable = os.pathsep.join(newList)
    return newVariable

def find_vcvarsall(version):
    """Find the vcvarsall.bat file

    At first it tries to find the productdir of VS 2008 in the registry. If
    that fails it falls back to the VS90COMNTOOLS env var.
    """
    vsbase = VS_BASE % version
    try:
        productdir = Reg.get_value(r"%s\Setup\VC" % vsbase,
                                   "productdir")
    except KeyError:
        log.debug("Unable to find productdir in registry")
        productdir = None

    if not productdir or not os.path.isdir(productdir):
        toolskey = "VS%0.f0COMNTOOLS" % version
        toolsdir = os.environ.get(toolskey, None)

        if toolsdir and os.path.isdir(toolsdir):
            productdir = os.path.join(toolsdir, os.pardir, os.pardir, "VC")
            productdir = os.path.abspath(productdir)
            if not os.path.isdir(productdir):
                log.debug("%s is not a valid directory" % productdir)
                return None
        else:
            log.debug("Env var %s is not set or invalid" % toolskey)
    if not productdir:
        log.debug("No productdir found")
        return None
    vcvarsall = os.path.join(productdir, "vcvarsall.bat")
    if os.path.isfile(vcvarsall):
        return vcvarsall
    log.debug("Unable to find vcvarsall.bat")
    return None

def query_vcvarsall(version, arch="x86"):
    """Launch vcvarsall.bat and read the settings from its environment
    """
    vcvarsall = find_vcvarsall(version)
    interesting = {"include", "lib", "libpath", "path"}
    result = {}

    if vcvarsall is None:
        raise DistutilsPlatformError("Unable to find vcvarsall.bat")
    log.debug("Calling 'vcvarsall.bat %s' (version=%s)", arch, version)
    popen = subprocess.Popen('"%s" %s & set' % (vcvarsall, arch),
                             stdout=subprocess.PIPE,
                             stderr=subprocess.PIPE)
    try:
        stdout, stderr = popen.communicate()
        if popen.wait() != 0:
            raise DistutilsPlatformError(stderr.decode("mbcs"))

        stdout = stdout.decode("mbcs")
        for line in stdout.split("\n"):
            line = Reg.convert_mbcs(line)
            if '=' not in line:
                continue
            line = line.strip()
            key, value = line.split('=', 1)
            key = key.lower()
            if key in interesting:
                if value.endswith(os.pathsep):
                    value = value[:-1]
                result[key] = removeDuplicates(value)

    finally:
        popen.stdout.close()
        popen.stderr.close()

    if len(result) != len(interesting):
        raise ValueError(str(list(result.keys())))

    return result

# More globals
VERSION = get_build_version()
if VERSION < 8.0:
    raise DistutilsPlatformError("VC %0.1f is not supported by this module" % VERSION)
# MACROS = MacroExpander(VERSION)

class MSVCCompiler(CCompiler) :
    """Concrete class that implements an interface to Microsoft Visual C++,
       as defined by the CCompiler abstract class."""

    compiler_type = 'msvc'

    # Just set this so CCompiler's constructor doesn't barf.  We currently
    # don't use the 'set_executables()' bureaucracy provided by CCompiler,
    # as it really isn't necessary for this sort of single-compiler class.
    # Would be nice to have a consistent interface with UnixCCompiler,
    # though, so it's worth thinking about.
    executables = {}

    # Private class data (need to distinguish C from C++ source for compiler)
    _c_extensions = ['.c']
    _cpp_extensions = ['.cc', '.cpp', '.cxx']
    _rc_extensions = ['.rc']
    _mc_extensions = ['.mc']

    # Needed for the filename generation methods provided by the
    # base class, CCompiler.
    src_extensions = (_c_extensions + _cpp_extensions +
                      _rc_extensions + _mc_extensions)
    res_extension = '.res'
    obj_extension = '.obj'
    static_lib_extension = '.lib'
    shared_lib_extension = '.dll'
    static_lib_format = shared_lib_format = '%s%s'
    exe_extension = '.exe'

    def __init__(self, verbose=0, dry_run=0, force=0):
        CCompiler.__init__ (self, verbose, dry_run, force)
        self.__version = VERSION
        self.__root = r"Software\Microsoft\VisualStudio"
        # self.__macros = MACROS
        self.__paths = []
        # target platform (.plat_name is consistent with 'bdist')
        self.plat_name = None
        self.__arch = None # deprecated name
        self.initialized = False

    def initialize(self, plat_name=None):
        # multi-init means we would need to check platform same each time...
        assert not self.initialized, "don't init multiple times"
        if plat_name is None:
            plat_name = get_platform()
        # sanity check for platforms to prevent obscure errors later.
        ok_plats = 'win32', 'win-amd64'
        if plat_name not in ok_plats:
            raise DistutilsPlatformError("--plat-name must be one of %s" %
                                         (ok_plats,))

        if "DISTUTILS_USE_SDK" in os.environ and "MSSdk" in os.environ and self.find_exe("cl.exe"):
            # Assume that the SDK set up everything alright; don't try to be
            # smarter
            self.cc = "cl.exe"
            self.linker = "link.exe"
            self.lib = "lib.exe"
            self.rc = "rc.exe"
            self.mc = "mc.exe"
        else:
            # On x86, 'vcvars32.bat amd64' creates an env that doesn't work;
            # to cross compile, you use 'x86_amd64'.
            # On AMD64, 'vcvars32.bat amd64' is a native build env; to cross
            # compile use 'x86' (ie, it runs the x86 compiler directly)
            if plat_name == get_platform() or plat_name == 'win32':
                # native build or cross-compile to win32
                plat_spec = PLAT_TO_VCVARS[plat_name]
            else:
                # cross compile from win32 -> some 64bit
                plat_spec = PLAT_TO_VCVARS[get_platform()] + '_' + \
                            PLAT_TO_VCVARS[plat_name]

            vc_env = query_vcvarsall(VERSION, plat_spec)

            self.__paths = vc_env['path'].split(os.pathsep)
            os.environ['lib'] = vc_env['lib']
            os.environ['include'] = vc_env['include']

            if len(self.__paths) == 0:
                raise DistutilsPlatformError("Python was built with %s, "
                       "and extensions need to be built with the same "
                       "version of the compiler, but it isn't installed."
                       % self.__product)

            self.cc = self.find_exe("cl.exe")
            self.linker = self.find_exe("link.exe")
            self.lib = self.find_exe("lib.exe")
            self.rc = self.find_exe("rc.exe")   # resource compiler
            self.mc = self.find_exe("mc.exe")   # message compiler
            #self.set_path_env_var('lib')
            #self.set_path_env_var('include')

        # extend the MSVC path with the current path
        try:
            for p in os.environ['path'].split(';'):
                self.__paths.append(p)
        except KeyError:
            pass
        self.__paths = normalize_and_reduce_paths(self.__paths)
        os.environ['path'] = ";".join(self.__paths)

        self.preprocess_options = None
        if self.__arch == "x86":
            self.compile_options = [ '/nologo', '/Ox', '/MD', '/W3',
                                     '/DNDEBUG']
            self.compile_options_debug = ['/nologo', '/Od', '/MDd', '/W3',
                                          '/Z7', '/D_DEBUG']
        else:
            # Win64
            self.compile_options = [ '/nologo', '/Ox', '/MD', '/W3', '/GS-' ,
                                     '/DNDEBUG']
            self.compile_options_debug = ['/nologo', '/Od', '/MDd', '/W3', '/GS-',
                                          '/Z7', '/D_DEBUG']

        self.ldflags_shared = ['/DLL', '/nologo', '/INCREMENTAL:NO']
        if self.__version >= 7:
            self.ldflags_shared_debug = [
                '/DLL', '/nologo', '/INCREMENTAL:no', '/DEBUG'
                ]
        self.ldflags_static = [ '/nologo']

        self.initialized = True

    # -- Worker methods ------------------------------------------------

    def object_filenames(self,
                         source_filenames,
                         strip_dir=0,
                         output_dir=''):
        # Copied from ccompiler.py, extended to return .res as 'object'-file
        # for .rc input file
        if output_dir is None: output_dir = ''
        obj_names = []
        for src_name in source_filenames:
            (base, ext) = os.path.splitext (src_name)
            base = os.path.splitdrive(base)[1] # Chop off the drive
            base = base[os.path.isabs(base):]  # If abs, chop off leading /
            if ext not in self.src_extensions:
                # Better to raise an exception instead of silently continuing
                # and later complain about sources and targets having
                # different lengths
                raise CompileError ("Don't know how to compile %s" % src_name)
            if strip_dir:
                base = os.path.basename (base)
            if ext in self._rc_extensions:
                obj_names.append (os.path.join (output_dir,
                                                base + self.res_extension))
            elif ext in self._mc_extensions:
                obj_names.append (os.path.join (output_dir,
                                                base + self.res_extension))
            else:
                obj_names.append (os.path.join (output_dir,
                                                base + self.obj_extension))
        return obj_names


    def compile(self, sources,
                output_dir=None, macros=None, include_dirs=None, debug=0,
                extra_preargs=None, extra_postargs=None, depends=None):

        if not self.initialized:
            self.initialize()
        compile_info = self._setup_compile(output_dir, macros, include_dirs,
                                           sources, depends, extra_postargs)
        macros, objects, extra_postargs, pp_opts, build = compile_info

        compile_opts = extra_preargs or []
        compile_opts.append ('/c')
        if debug:
            compile_opts.extend(self.compile_options_debug)
        else:
            compile_opts.extend(self.compile_options)

        for obj in objects:
            try:
                src, ext = build[obj]
            except KeyError:
                continue
            if debug:
                # pass the full pathname to MSVC in debug mode,
                # this allows the debugger to find the source file
                # without asking the user to browse for it
                src = os.path.abspath(src)

            if ext in self._c_extensions:
                input_opt = "/Tc" + src
            elif ext in self._cpp_extensions:
                input_opt = "/Tp" + src
            elif ext in self._rc_extensions:
                # compile .RC to .RES file
                input_opt = src
                output_opt = "/fo" + obj
                try:
                    self.spawn([self.rc] + pp_opts +
                               [output_opt] + [input_opt])
                except DistutilsExecError as msg:
                    raise CompileError(msg)
                continue
            elif ext in self._mc_extensions:
                # Compile .MC to .RC file to .RES file.
                #   * '-h dir' specifies the directory for the
                #     generated include file
                #   * '-r dir' specifies the target directory of the
                #     generated RC file and the binary message resource
                #     it includes
                #
                # For now (since there are no options to change this),
                # we use the source-directory for the include file and
                # the build directory for the RC file and message
                # resources. This works at least for win32all.
                h_dir = os.path.dirname(src)
                rc_dir = os.path.dirname(obj)
                try:
                    # first compile .MC to .RC and .H file
                    self.spawn([self.mc] +
                               ['-h', h_dir, '-r', rc_dir] + [src])
                    base, _ = os.path.splitext (os.path.basename (src))
                    rc_file = os.path.join (rc_dir, base + '.rc')
                    # then compile .RC to .RES file
                    self.spawn([self.rc] +
                               ["/fo" + obj] + [rc_file])

                except DistutilsExecError as msg:
                    raise CompileError(msg)
                continue
            else:
                # how to handle this file?
                raise CompileError("Don't know how to compile %s to %s"
                                   % (src, obj))

            output_opt = "/Fo" + obj
            try:
                self.spawn([self.cc] + compile_opts + pp_opts +
                           [input_opt, output_opt] +
                           extra_postargs)
            except DistutilsExecError as msg:
                raise CompileError(msg)

        return objects


    def create_static_lib(self,
                          objects,
                          output_libname,
                          output_dir=None,
                          debug=0,
                          target_lang=None):

        if not self.initialized:
            self.initialize()
        (objects, output_dir) = self._fix_object_args(objects, output_dir)
        output_filename = self.library_filename(output_libname,
                                                output_dir=output_dir)

        if self._need_link(objects, output_filename):
            lib_args = objects + ['/OUT:' + output_filename]
            if debug:
                pass # XXX what goes here?
            try:
                self.spawn([self.lib] + lib_args)
            except DistutilsExecError as msg:
                raise LibError(msg)
        else:
            log.debug("skipping %s (up-to-date)", output_filename)


    def link(self,
             target_desc,
             objects,
             output_filename,
             output_dir=None,
             libraries=None,
             library_dirs=None,
             runtime_library_dirs=None,
             export_symbols=None,
             debug=0,
             extra_preargs=None,
             extra_postargs=None,
             build_temp=None,
             target_lang=None):

        if not self.initialized:
            self.initialize()
        (objects, output_dir) = self._fix_object_args(objects, output_dir)
        fixed_args = self._fix_lib_args(libraries, library_dirs,
                                        runtime_library_dirs)
        (libraries, library_dirs, runtime_library_dirs) = fixed_args

        if runtime_library_dirs:
            self.warn ("I don't know what to do with 'runtime_library_dirs': "
                       + str (runtime_library_dirs))

        lib_opts = gen_lib_options(self,
                                   library_dirs, runtime_library_dirs,
                                   libraries)
        if output_dir is not None:
            output_filename = os.path.join(output_dir, output_filename)

        if self._need_link(objects, output_filename):
            if target_desc == CCompiler.EXECUTABLE:
                if debug:
                    ldflags = self.ldflags_shared_debug[1:]
                else:
                    ldflags = self.ldflags_shared[1:]
            else:
                if debug:
                    ldflags = self.ldflags_shared_debug
                else:
                    ldflags = self.ldflags_shared

            export_opts = []
            for sym in (export_symbols or []):
                export_opts.append("/EXPORT:" + sym)

            ld_args = (ldflags + lib_opts + export_opts +
                       objects + ['/OUT:' + output_filename])

            # The MSVC linker generates .lib and .exp files, which cannot be
            # suppressed by any linker switches. The .lib files may even be
            # needed! Make sure they are generated in the temporary build
            # directory. Since they have different names for debug and release
            # builds, they can go into the same directory.
            build_temp = os.path.dirname(objects[0])
            if export_symbols is not None:
                (dll_name, dll_ext) = os.path.splitext(
                    os.path.basename(output_filename))
                implib_file = os.path.join(
                    build_temp,
                    self.library_filename(dll_name))
                ld_args.append ('/IMPLIB:' + implib_file)

            self.manifest_setup_ldargs(output_filename, build_temp, ld_args)

            if extra_preargs:
                ld_args[:0] = extra_preargs
            if extra_postargs:
                ld_args.extend(extra_postargs)

            self.mkpath(os.path.dirname(output_filename))
            try:
                self.spawn([self.linker] + ld_args)
            except DistutilsExecError as msg:
                raise LinkError(msg)

            # embed the manifest
            # XXX - this is somewhat fragile - if mt.exe fails, distutils
            # will still consider the DLL up-to-date, but it will not have a
            # manifest.  Maybe we should link to a temp file?  OTOH, that
            # implies a build environment error that shouldn't go undetected.
            mfinfo = self.manifest_get_embed_info(target_desc, ld_args)
            if mfinfo is not None:
                mffilename, mfid = mfinfo
                out_arg = '-outputresource:%s;%s' % (output_filename, mfid)
                try:
                    self.spawn(['mt.exe', '-nologo', '-manifest',
                                mffilename, out_arg])
                except DistutilsExecError as msg:
                    raise LinkError(msg)
        else:
            log.debug("skipping %s (up-to-date)", output_filename)

    def manifest_setup_ldargs(self, output_filename, build_temp, ld_args):
        # If we need a manifest at all, an embedded manifest is recommended.
        # See MSDN article titled
        # "How to: Embed a Manifest Inside a C/C++ Application"
        # (currently at http://msdn2.microsoft.com/en-us/library/ms235591(VS.80).aspx)
        # Ask the linker to generate the manifest in the temp dir, so
        # we can check it, and possibly embed it, later.
        temp_manifest = os.path.join(
                build_temp,
                os.path.basename(output_filename) + ".manifest")
        ld_args.append('/MANIFESTFILE:' + temp_manifest)

    def manifest_get_embed_info(self, target_desc, ld_args):
        # If a manifest should be embedded, return a tuple of
        # (manifest_filename, resource_id).  Returns None if no manifest
        # should be embedded.  See http://bugs.python.org/issue7833 for why
        # we want to avoid any manifest for extension modules if we can)
        for arg in ld_args:
            if arg.startswith("/MANIFESTFILE:"):
                temp_manifest = arg.split(":", 1)[1]
                break
        else:
            # no /MANIFESTFILE so nothing to do.
            return None
        if target_desc == CCompiler.EXECUTABLE:
            # by default, executables always get the manifest with the
            # CRT referenced.
            mfid = 1
        else:
            # Extension modules try and avoid any manifest if possible.
            mfid = 2
            temp_manifest = self._remove_visual_c_ref(temp_manifest)
        if temp_manifest is None:
            return None
        return temp_manifest, mfid

    def _remove_visual_c_ref(self, manifest_file):
        try:
            # Remove references to the Visual C runtime, so they will
            # fall through to the Visual C dependency of Python.exe.
            # This way, when installed for a restricted user (e.g.
            # runtimes are not in WinSxS folder, but in Python's own
            # folder), the runtimes do not need to be in every folder
            # with .pyd's.
            # Returns either the filename of the modified manifest or
            # None if no manifest should be embedded.
            manifest_f = open(manifest_file)
            try:
                manifest_buf = manifest_f.read()
            finally:
                manifest_f.close()
            pattern = re.compile(
                r"""<assemblyIdentity.*?name=("|')Microsoft\."""\
                r"""VC\d{2}\.CRT("|').*?(/>|</assemblyIdentity>)""",
                re.DOTALL)
            manifest_buf = re.sub(pattern, "", manifest_buf)
            pattern = r"<dependentAssembly>\s*</dependentAssembly>"
            manifest_buf = re.sub(pattern, "", manifest_buf)
            # Now see if any other assemblies are referenced - if not, we
            # don't want a manifest embedded.
            pattern = re.compile(
                r"""<assemblyIdentity.*?name=(?:"|')(.+?)(?:"|')"""
                r""".*?(?:/>|</assemblyIdentity>)""", re.DOTALL)
            if re.search(pattern, manifest_buf) is None:
                return None

            manifest_f = open(manifest_file, 'w')
            try:
                manifest_f.write(manifest_buf)
                return manifest_file
            finally:
                manifest_f.close()
        except OSError:
            pass

    # -- Miscellaneous methods -----------------------------------------
    # These are all used by the 'gen_lib_options() function, in
    # ccompiler.py.

    def library_dir_option(self, dir):
        return "/LIBPATH:" + dir

    def runtime_library_dir_option(self, dir):
        raise DistutilsPlatformError(
              "don't know how to set runtime library search path for MSVC++")

    def library_option(self, lib):
        return self.library_filename(lib)


    def find_library_file(self, dirs, lib, debug=0):
        # Prefer a debugging library if found (and requested), but deal
        # with it if we don't have one.
        if debug:
            try_names = [lib + "_d", lib]
        else:
            try_names = [lib]
        for dir in dirs:
            for name in try_names:
                libfile = os.path.join(dir, self.library_filename (name))
                if os.path.exists(libfile):
                    return libfile
        else:
            # Oops, didn't find it in *any* of 'dirs'
            return None

    # Helper methods for using the MSVC registry settings

    def find_exe(self, exe):
        """Return path to an MSVC executable program.

        Tries to find the program in several places: first, one of the
        MSVC program search paths from the registry; next, the directories
        in the PATH environment variable.  If any of those work, return an
        absolute path that is known to exist.  If none of them work, just
        return the original program name, 'exe'.
        """
        for p in self.__paths:
            fn = os.path.join(os.path.abspath(p), exe)
            if os.path.isfile(fn):
                return fn

        # didn't find it; try existing path
        for p in os.environ['Path'].split(';'):
            fn = os.path.join(os.path.abspath(p),exe)
            if os.path.isfile(fn):
                return fn

        return exe
distutils/text_file.py000064400000030303151153537440011134 0ustar00"""text_file

provides the TextFile class, which gives an interface to text files
that (optionally) takes care of stripping comments, ignoring blank
lines, and joining lines with backslashes."""

import sys, io


class TextFile:
    """Provides a file-like object that takes care of all the things you
       commonly want to do when processing a text file that has some
       line-by-line syntax: strip comments (as long as "#" is your
       comment character), skip blank lines, join adjacent lines by
       escaping the newline (ie. backslash at end of line), strip
       leading and/or trailing whitespace.  All of these are optional
       and independently controllable.

       Provides a 'warn()' method so you can generate warning messages that
       report physical line number, even if the logical line in question
       spans multiple physical lines.  Also provides 'unreadline()' for
       implementing line-at-a-time lookahead.

       Constructor is called as:

           TextFile (filename=None, file=None, **options)

       It bombs (RuntimeError) if both 'filename' and 'file' are None;
       'filename' should be a string, and 'file' a file object (or
       something that provides 'readline()' and 'close()' methods).  It is
       recommended that you supply at least 'filename', so that TextFile
       can include it in warning messages.  If 'file' is not supplied,
       TextFile creates its own using 'io.open()'.

       The options are all boolean, and affect the value returned by
       'readline()':
         strip_comments [default: true]
           strip from "#" to end-of-line, as well as any whitespace
           leading up to the "#" -- unless it is escaped by a backslash
         lstrip_ws [default: false]
           strip leading whitespace from each line before returning it
         rstrip_ws [default: true]
           strip trailing whitespace (including line terminator!) from
           each line before returning it
         skip_blanks [default: true}
           skip lines that are empty *after* stripping comments and
           whitespace.  (If both lstrip_ws and rstrip_ws are false,
           then some lines may consist of solely whitespace: these will
           *not* be skipped, even if 'skip_blanks' is true.)
         join_lines [default: false]
           if a backslash is the last non-newline character on a line
           after stripping comments and whitespace, join the following line
           to it to form one "logical line"; if N consecutive lines end
           with a backslash, then N+1 physical lines will be joined to
           form one logical line.
         collapse_join [default: false]
           strip leading whitespace from lines that are joined to their
           predecessor; only matters if (join_lines and not lstrip_ws)
         errors [default: 'strict']
           error handler used to decode the file content

       Note that since 'rstrip_ws' can strip the trailing newline, the
       semantics of 'readline()' must differ from those of the builtin file
       object's 'readline()' method!  In particular, 'readline()' returns
       None for end-of-file: an empty string might just be a blank line (or
       an all-whitespace line), if 'rstrip_ws' is true but 'skip_blanks' is
       not."""

    default_options = { 'strip_comments': 1,
                        'skip_blanks':    1,
                        'lstrip_ws':      0,
                        'rstrip_ws':      1,
                        'join_lines':     0,
                        'collapse_join':  0,
                        'errors':         'strict',
                      }

    def __init__(self, filename=None, file=None, **options):
        """Construct a new TextFile object.  At least one of 'filename'
           (a string) and 'file' (a file-like object) must be supplied.
           They keyword argument options are described above and affect
           the values returned by 'readline()'."""
        if filename is None and file is None:
            raise RuntimeError("you must supply either or both of 'filename' and 'file'")

        # set values for all options -- either from client option hash
        # or fallback to default_options
        for opt in self.default_options.keys():
            if opt in options:
                setattr(self, opt, options[opt])
            else:
                setattr(self, opt, self.default_options[opt])

        # sanity check client option hash
        for opt in options.keys():
            if opt not in self.default_options:
                raise KeyError("invalid TextFile option '%s'" % opt)

        if file is None:
            self.open(filename)
        else:
            self.filename = filename
            self.file = file
            self.current_line = 0       # assuming that file is at BOF!

        # 'linebuf' is a stack of lines that will be emptied before we
        # actually read from the file; it's only populated by an
        # 'unreadline()' operation
        self.linebuf = []

    def open(self, filename):
        """Open a new file named 'filename'.  This overrides both the
           'filename' and 'file' arguments to the constructor."""
        self.filename = filename
        self.file = io.open(self.filename, 'r', errors=self.errors)
        self.current_line = 0

    def close(self):
        """Close the current file and forget everything we know about it
           (filename, current line number)."""
        file = self.file
        self.file = None
        self.filename = None
        self.current_line = None
        file.close()

    def gen_error(self, msg, line=None):
        outmsg = []
        if line is None:
            line = self.current_line
        outmsg.append(self.filename + ", ")
        if isinstance(line, (list, tuple)):
            outmsg.append("lines %d-%d: " % tuple(line))
        else:
            outmsg.append("line %d: " % line)
        outmsg.append(str(msg))
        return "".join(outmsg)

    def error(self, msg, line=None):
        raise ValueError("error: " + self.gen_error(msg, line))

    def warn(self, msg, line=None):
        """Print (to stderr) a warning message tied to the current logical
           line in the current file.  If the current logical line in the
           file spans multiple physical lines, the warning refers to the
           whole range, eg. "lines 3-5".  If 'line' supplied, it overrides
           the current line number; it may be a list or tuple to indicate a
           range of physical lines, or an integer for a single physical
           line."""
        sys.stderr.write("warning: " + self.gen_error(msg, line) + "\n")

    def readline(self):
        """Read and return a single logical line from the current file (or
           from an internal buffer if lines have previously been "unread"
           with 'unreadline()').  If the 'join_lines' option is true, this
           may involve reading multiple physical lines concatenated into a
           single string.  Updates the current line number, so calling
           'warn()' after 'readline()' emits a warning about the physical
           line(s) just read.  Returns None on end-of-file, since the empty
           string can occur if 'rstrip_ws' is true but 'strip_blanks' is
           not."""
        # If any "unread" lines waiting in 'linebuf', return the top
        # one.  (We don't actually buffer read-ahead data -- lines only
        # get put in 'linebuf' if the client explicitly does an
        # 'unreadline()'.
        if self.linebuf:
            line = self.linebuf[-1]
            del self.linebuf[-1]
            return line

        buildup_line = ''

        while True:
            # read the line, make it None if EOF
            line = self.file.readline()
            if line == '':
                line = None

            if self.strip_comments and line:

                # Look for the first "#" in the line.  If none, never
                # mind.  If we find one and it's the first character, or
                # is not preceded by "\", then it starts a comment --
                # strip the comment, strip whitespace before it, and
                # carry on.  Otherwise, it's just an escaped "#", so
                # unescape it (and any other escaped "#"'s that might be
                # lurking in there) and otherwise leave the line alone.

                pos = line.find("#")
                if pos == -1: # no "#" -- no comments
                    pass

                # It's definitely a comment -- either "#" is the first
                # character, or it's elsewhere and unescaped.
                elif pos == 0 or line[pos-1] != "\\":
                    # Have to preserve the trailing newline, because it's
                    # the job of a later step (rstrip_ws) to remove it --
                    # and if rstrip_ws is false, we'd better preserve it!
                    # (NB. this means that if the final line is all comment
                    # and has no trailing newline, we will think that it's
                    # EOF; I think that's OK.)
                    eol = (line[-1] == '\n') and '\n' or ''
                    line = line[0:pos] + eol

                    # If all that's left is whitespace, then skip line
                    # *now*, before we try to join it to 'buildup_line' --
                    # that way constructs like
                    #   hello \\
                    #   # comment that should be ignored
                    #   there
                    # result in "hello there".
                    if line.strip() == "":
                        continue
                else: # it's an escaped "#"
                    line = line.replace("\\#", "#")

            # did previous line end with a backslash? then accumulate
            if self.join_lines and buildup_line:
                # oops: end of file
                if line is None:
                    self.warn("continuation line immediately precedes "
                              "end-of-file")
                    return buildup_line

                if self.collapse_join:
                    line = line.lstrip()
                line = buildup_line + line

                # careful: pay attention to line number when incrementing it
                if isinstance(self.current_line, list):
                    self.current_line[1] = self.current_line[1] + 1
                else:
                    self.current_line = [self.current_line,
                                         self.current_line + 1]
            # just an ordinary line, read it as usual
            else:
                if line is None: # eof
                    return None

                # still have to be careful about incrementing the line number!
                if isinstance(self.current_line, list):
                    self.current_line = self.current_line[1] + 1
                else:
                    self.current_line = self.current_line + 1

            # strip whitespace however the client wants (leading and
            # trailing, or one or the other, or neither)
            if self.lstrip_ws and self.rstrip_ws:
                line = line.strip()
            elif self.lstrip_ws:
                line = line.lstrip()
            elif self.rstrip_ws:
                line = line.rstrip()

            # blank line (whether we rstrip'ed or not)? skip to next line
            # if appropriate
            if (line == '' or line == '\n') and self.skip_blanks:
                continue

            if self.join_lines:
                if line[-1] == '\\':
                    buildup_line = line[:-1]
                    continue

                if line[-2:] == '\\\n':
                    buildup_line = line[0:-2] + '\n'
                    continue

            # well, I guess there's some actual content there: return it
            return line

    def readlines(self):
        """Read and return the list of all logical lines remaining in the
           current file."""
        lines = []
        while True:
            line = self.readline()
            if line is None:
                return lines
            lines.append(line)

    def unreadline(self, line):
        """Push 'line' (a string) onto an internal buffer that will be
           checked by future 'readline()' calls.  Handy for implementing
           a parser with line-at-a-time lookahead."""
        self.linebuf.append(line)
distutils/dist.py000064400000142321151153537440010120 0ustar00"""distutils.dist

Provides the Distribution class, which represents the module distribution
being built/installed/distributed.
"""

import sys
import os
import re
from email import message_from_file

try:
    import warnings
except ImportError:
    warnings = None

from distutils.errors import *
from distutils.fancy_getopt import FancyGetopt, translate_longopt
from distutils.util import check_environ, strtobool, rfc822_escape
from distutils import log
from distutils.debug import DEBUG

# Regex to define acceptable Distutils command names.  This is not *quite*
# the same as a Python NAME -- I don't allow leading underscores.  The fact
# that they're very similar is no coincidence; the default naming scheme is
# to look for a Python module named after the command.
command_re = re.compile(r'^[a-zA-Z]([a-zA-Z0-9_]*)$')


def _ensure_list(value, fieldname):
    if isinstance(value, str):
        # a string containing comma separated values is okay.  It will
        # be converted to a list by Distribution.finalize_options().
        pass
    elif not isinstance(value, list):
        # passing a tuple or an iterator perhaps, warn and convert
        typename = type(value).__name__
        msg = f"Warning: '{fieldname}' should be a list, got type '{typename}'"
        log.log(log.WARN, msg)
        value = list(value)
    return value


class Distribution:
    """The core of the Distutils.  Most of the work hiding behind 'setup'
    is really done within a Distribution instance, which farms the work out
    to the Distutils commands specified on the command line.

    Setup scripts will almost never instantiate Distribution directly,
    unless the 'setup()' function is totally inadequate to their needs.
    However, it is conceivable that a setup script might wish to subclass
    Distribution for some specialized purpose, and then pass the subclass
    to 'setup()' as the 'distclass' keyword argument.  If so, it is
    necessary to respect the expectations that 'setup' has of Distribution.
    See the code for 'setup()', in core.py, for details.
    """

    # 'global_options' describes the command-line options that may be
    # supplied to the setup script prior to any actual commands.
    # Eg. "./setup.py -n" or "./setup.py --quiet" both take advantage of
    # these global options.  This list should be kept to a bare minimum,
    # since every global option is also valid as a command option -- and we
    # don't want to pollute the commands with too many options that they
    # have minimal control over.
    # The fourth entry for verbose means that it can be repeated.
    global_options = [
        ('verbose', 'v', "run verbosely (default)", 1),
        ('quiet', 'q', "run quietly (turns verbosity off)"),
        ('dry-run', 'n', "don't actually do anything"),
        ('help', 'h', "show detailed help message"),
        ('no-user-cfg', None,
            'ignore pydistutils.cfg in your home directory'),
    ]

    # 'common_usage' is a short (2-3 line) string describing the common
    # usage of the setup script.
    common_usage = """\
Common commands: (see '--help-commands' for more)

  setup.py build      will build the package underneath 'build/'
  setup.py install    will install the package
"""

    # options that are not propagated to the commands
    display_options = [
        ('help-commands', None,
         "list all available commands"),
        ('name', None,
         "print package name"),
        ('version', 'V',
         "print package version"),
        ('fullname', None,
         "print <package name>-<version>"),
        ('author', None,
         "print the author's name"),
        ('author-email', None,
         "print the author's email address"),
        ('maintainer', None,
         "print the maintainer's name"),
        ('maintainer-email', None,
         "print the maintainer's email address"),
        ('contact', None,
         "print the maintainer's name if known, else the author's"),
        ('contact-email', None,
         "print the maintainer's email address if known, else the author's"),
        ('url', None,
         "print the URL for this package"),
        ('license', None,
         "print the license of the package"),
        ('licence', None,
         "alias for --license"),
        ('description', None,
         "print the package description"),
        ('long-description', None,
         "print the long package description"),
        ('platforms', None,
         "print the list of platforms"),
        ('classifiers', None,
         "print the list of classifiers"),
        ('keywords', None,
         "print the list of keywords"),
        ('provides', None,
         "print the list of packages/modules provided"),
        ('requires', None,
         "print the list of packages/modules required"),
        ('obsoletes', None,
         "print the list of packages/modules made obsolete")
        ]
    display_option_names = [translate_longopt(x[0]) for x in display_options]

    # negative options are options that exclude other options
    negative_opt = {'quiet': 'verbose'}

    # -- Creation/initialization methods -------------------------------

    def __init__(self, attrs=None):
        """Construct a new Distribution instance: initialize all the
        attributes of a Distribution, and then use 'attrs' (a dictionary
        mapping attribute names to values) to assign some of those
        attributes their "real" values.  (Any attributes not mentioned in
        'attrs' will be assigned to some null value: 0, None, an empty list
        or dictionary, etc.)  Most importantly, initialize the
        'command_obj' attribute to the empty dictionary; this will be
        filled in with real command objects by 'parse_command_line()'.
        """

        # Default values for our command-line options
        self.verbose = 1
        self.dry_run = 0
        self.help = 0
        for attr in self.display_option_names:
            setattr(self, attr, 0)

        # Store the distribution meta-data (name, version, author, and so
        # forth) in a separate object -- we're getting to have enough
        # information here (and enough command-line options) that it's
        # worth it.  Also delegate 'get_XXX()' methods to the 'metadata'
        # object in a sneaky and underhanded (but efficient!) way.
        self.metadata = DistributionMetadata()
        for basename in self.metadata._METHOD_BASENAMES:
            method_name = "get_" + basename
            setattr(self, method_name, getattr(self.metadata, method_name))

        # 'cmdclass' maps command names to class objects, so we
        # can 1) quickly figure out which class to instantiate when
        # we need to create a new command object, and 2) have a way
        # for the setup script to override command classes
        self.cmdclass = {}

        # 'command_packages' is a list of packages in which commands
        # are searched for.  The factory for command 'foo' is expected
        # to be named 'foo' in the module 'foo' in one of the packages
        # named here.  This list is searched from the left; an error
        # is raised if no named package provides the command being
        # searched for.  (Always access using get_command_packages().)
        self.command_packages = None

        # 'script_name' and 'script_args' are usually set to sys.argv[0]
        # and sys.argv[1:], but they can be overridden when the caller is
        # not necessarily a setup script run from the command-line.
        self.script_name = None
        self.script_args = None

        # 'command_options' is where we store command options between
        # parsing them (from config files, the command-line, etc.) and when
        # they are actually needed -- ie. when the command in question is
        # instantiated.  It is a dictionary of dictionaries of 2-tuples:
        #   command_options = { command_name : { option : (source, value) } }
        self.command_options = {}

        # 'dist_files' is the list of (command, pyversion, file) that
        # have been created by any dist commands run so far. This is
        # filled regardless of whether the run is dry or not. pyversion
        # gives sysconfig.get_python_version() if the dist file is
        # specific to a Python version, 'any' if it is good for all
        # Python versions on the target platform, and '' for a source
        # file. pyversion should not be used to specify minimum or
        # maximum required Python versions; use the metainfo for that
        # instead.
        self.dist_files = []

        # These options are really the business of various commands, rather
        # than of the Distribution itself.  We provide aliases for them in
        # Distribution as a convenience to the developer.
        self.packages = None
        self.package_data = {}
        self.package_dir = None
        self.py_modules = None
        self.libraries = None
        self.headers = None
        self.ext_modules = None
        self.ext_package = None
        self.include_dirs = None
        self.extra_path = None
        self.scripts = None
        self.data_files = None
        self.password = ''

        # And now initialize bookkeeping stuff that can't be supplied by
        # the caller at all.  'command_obj' maps command names to
        # Command instances -- that's how we enforce that every command
        # class is a singleton.
        self.command_obj = {}

        # 'have_run' maps command names to boolean values; it keeps track
        # of whether we have actually run a particular command, to make it
        # cheap to "run" a command whenever we think we might need to -- if
        # it's already been done, no need for expensive filesystem
        # operations, we just check the 'have_run' dictionary and carry on.
        # It's only safe to query 'have_run' for a command class that has
        # been instantiated -- a false value will be inserted when the
        # command object is created, and replaced with a true value when
        # the command is successfully run.  Thus it's probably best to use
        # '.get()' rather than a straight lookup.
        self.have_run = {}

        # Now we'll use the attrs dictionary (ultimately, keyword args from
        # the setup script) to possibly override any or all of these
        # distribution options.

        if attrs:
            # Pull out the set of command options and work on them
            # specifically.  Note that this order guarantees that aliased
            # command options will override any supplied redundantly
            # through the general options dictionary.
            options = attrs.get('options')
            if options is not None:
                del attrs['options']
                for (command, cmd_options) in options.items():
                    opt_dict = self.get_option_dict(command)
                    for (opt, val) in cmd_options.items():
                        opt_dict[opt] = ("setup script", val)

            if 'licence' in attrs:
                attrs['license'] = attrs['licence']
                del attrs['licence']
                msg = "'licence' distribution option is deprecated; use 'license'"
                if warnings is not None:
                    warnings.warn(msg)
                else:
                    sys.stderr.write(msg + "\n")

            # Now work on the rest of the attributes.  Any attribute that's
            # not already defined is invalid!
            for (key, val) in attrs.items():
                if hasattr(self.metadata, "set_" + key):
                    getattr(self.metadata, "set_" + key)(val)
                elif hasattr(self.metadata, key):
                    setattr(self.metadata, key, val)
                elif hasattr(self, key):
                    setattr(self, key, val)
                else:
                    msg = "Unknown distribution option: %s" % repr(key)
                    warnings.warn(msg)

        # no-user-cfg is handled before other command line args
        # because other args override the config files, and this
        # one is needed before we can load the config files.
        # If attrs['script_args'] wasn't passed, assume false.
        #
        # This also make sure we just look at the global options
        self.want_user_cfg = True

        if self.script_args is not None:
            for arg in self.script_args:
                if not arg.startswith('-'):
                    break
                if arg == '--no-user-cfg':
                    self.want_user_cfg = False
                    break

        self.finalize_options()

    def get_option_dict(self, command):
        """Get the option dictionary for a given command.  If that
        command's option dictionary hasn't been created yet, then create it
        and return the new dictionary; otherwise, return the existing
        option dictionary.
        """
        dict = self.command_options.get(command)
        if dict is None:
            dict = self.command_options[command] = {}
        return dict

    def dump_option_dicts(self, header=None, commands=None, indent=""):
        from pprint import pformat

        if commands is None:             # dump all command option dicts
            commands = sorted(self.command_options.keys())

        if header is not None:
            self.announce(indent + header)
            indent = indent + "  "

        if not commands:
            self.announce(indent + "no commands known yet")
            return

        for cmd_name in commands:
            opt_dict = self.command_options.get(cmd_name)
            if opt_dict is None:
                self.announce(indent +
                              "no option dict for '%s' command" % cmd_name)
            else:
                self.announce(indent +
                              "option dict for '%s' command:" % cmd_name)
                out = pformat(opt_dict)
                for line in out.split('\n'):
                    self.announce(indent + "  " + line)

    # -- Config file finding/parsing methods ---------------------------

    def find_config_files(self):
        """Find as many configuration files as should be processed for this
        platform, and return a list of filenames in the order in which they
        should be parsed.  The filenames returned are guaranteed to exist
        (modulo nasty race conditions).

        There are three possible config files: distutils.cfg in the
        Distutils installation directory (ie. where the top-level
        Distutils __inst__.py file lives), a file in the user's home
        directory named .pydistutils.cfg on Unix and pydistutils.cfg
        on Windows/Mac; and setup.cfg in the current directory.

        The file in the user's home directory can be disabled with the
        --no-user-cfg option.
        """
        files = []
        check_environ()

        # Where to look for the system-wide Distutils config file
        sys_dir = os.path.dirname(sys.modules['distutils'].__file__)

        # Look for the system config file
        sys_file = os.path.join(sys_dir, "distutils.cfg")
        if os.path.isfile(sys_file):
            files.append(sys_file)

        # What to call the per-user config file
        if os.name == 'posix':
            user_filename = ".pydistutils.cfg"
        else:
            user_filename = "pydistutils.cfg"

        # And look for the user config file
        if self.want_user_cfg:
            user_file = os.path.join(os.path.expanduser('~'), user_filename)
            if os.path.isfile(user_file):
                files.append(user_file)

        # All platforms support local setup.cfg
        local_file = "setup.cfg"
        if os.path.isfile(local_file):
            files.append(local_file)

        if DEBUG:
            self.announce("using config files: %s" % ', '.join(files))

        return files

    def parse_config_files(self, filenames=None):
        from configparser import ConfigParser

        # Ignore install directory options if we have a venv
        if sys.prefix != sys.base_prefix:
            ignore_options = [
                'install-base', 'install-platbase', 'install-lib',
                'install-platlib', 'install-purelib', 'install-headers',
                'install-scripts', 'install-data', 'prefix', 'exec-prefix',
                'home', 'user', 'root']
        else:
            ignore_options = []

        ignore_options = frozenset(ignore_options)

        if filenames is None:
            filenames = self.find_config_files()

        if DEBUG:
            self.announce("Distribution.parse_config_files():")

        parser = ConfigParser()
        for filename in filenames:
            if DEBUG:
                self.announce("  reading %s" % filename)
            parser.read(filename)
            for section in parser.sections():
                options = parser.options(section)
                opt_dict = self.get_option_dict(section)

                for opt in options:
                    if opt != '__name__' and opt not in ignore_options:
                        val = parser.get(section,opt)
                        opt = opt.replace('-', '_')
                        opt_dict[opt] = (filename, val)

            # Make the ConfigParser forget everything (so we retain
            # the original filenames that options come from)
            parser.__init__()

        # If there was a "global" section in the config file, use it
        # to set Distribution options.

        if 'global' in self.command_options:
            for (opt, (src, val)) in self.command_options['global'].items():
                alias = self.negative_opt.get(opt)
                try:
                    if alias:
                        setattr(self, alias, not strtobool(val))
                    elif opt in ('verbose', 'dry_run'): # ugh!
                        setattr(self, opt, strtobool(val))
                    else:
                        setattr(self, opt, val)
                except ValueError as msg:
                    raise DistutilsOptionError(msg)

    # -- Command-line parsing methods ----------------------------------

    def parse_command_line(self):
        """Parse the setup script's command line, taken from the
        'script_args' instance attribute (which defaults to 'sys.argv[1:]'
        -- see 'setup()' in core.py).  This list is first processed for
        "global options" -- options that set attributes of the Distribution
        instance.  Then, it is alternately scanned for Distutils commands
        and options for that command.  Each new command terminates the
        options for the previous command.  The allowed options for a
        command are determined by the 'user_options' attribute of the
        command class -- thus, we have to be able to load command classes
        in order to parse the command line.  Any error in that 'options'
        attribute raises DistutilsGetoptError; any error on the
        command-line raises DistutilsArgError.  If no Distutils commands
        were found on the command line, raises DistutilsArgError.  Return
        true if command-line was successfully parsed and we should carry
        on with executing commands; false if no errors but we shouldn't
        execute commands (currently, this only happens if user asks for
        help).
        """
        #
        # We now have enough information to show the Macintosh dialog
        # that allows the user to interactively specify the "command line".
        #
        toplevel_options = self._get_toplevel_options()

        # We have to parse the command line a bit at a time -- global
        # options, then the first command, then its options, and so on --
        # because each command will be handled by a different class, and
        # the options that are valid for a particular class aren't known
        # until we have loaded the command class, which doesn't happen
        # until we know what the command is.

        self.commands = []
        parser = FancyGetopt(toplevel_options + self.display_options)
        parser.set_negative_aliases(self.negative_opt)
        parser.set_aliases({'licence': 'license'})
        args = parser.getopt(args=self.script_args, object=self)
        option_order = parser.get_option_order()
        log.set_verbosity(self.verbose)

        # for display options we return immediately
        if self.handle_display_options(option_order):
            return
        while args:
            args = self._parse_command_opts(parser, args)
            if args is None:            # user asked for help (and got it)
                return

        # Handle the cases of --help as a "global" option, ie.
        # "setup.py --help" and "setup.py --help command ...".  For the
        # former, we show global options (--verbose, --dry-run, etc.)
        # and display-only options (--name, --version, etc.); for the
        # latter, we omit the display-only options and show help for
        # each command listed on the command line.
        if self.help:
            self._show_help(parser,
                            display_options=len(self.commands) == 0,
                            commands=self.commands)
            return

        # Oops, no commands found -- an end-user error
        if not self.commands:
            raise DistutilsArgError("no commands supplied")

        # All is well: return true
        return True

    def _get_toplevel_options(self):
        """Return the non-display options recognized at the top level.

        This includes options that are recognized *only* at the top
        level as well as options recognized for commands.
        """
        return self.global_options + [
            ("command-packages=", None,
             "list of packages that provide distutils commands"),
            ]

    def _parse_command_opts(self, parser, args):
        """Parse the command-line options for a single command.
        'parser' must be a FancyGetopt instance; 'args' must be the list
        of arguments, starting with the current command (whose options
        we are about to parse).  Returns a new version of 'args' with
        the next command at the front of the list; will be the empty
        list if there are no more commands on the command line.  Returns
        None if the user asked for help on this command.
        """
        # late import because of mutual dependence between these modules
        from distutils.cmd import Command

        # Pull the current command from the head of the command line
        command = args[0]
        if not command_re.match(command):
            raise SystemExit("invalid command name '%s'" % command)
        self.commands.append(command)

        # Dig up the command class that implements this command, so we
        # 1) know that it's a valid command, and 2) know which options
        # it takes.
        try:
            cmd_class = self.get_command_class(command)
        except DistutilsModuleError as msg:
            raise DistutilsArgError(msg)

        # Require that the command class be derived from Command -- want
        # to be sure that the basic "command" interface is implemented.
        if not issubclass(cmd_class, Command):
            raise DistutilsClassError(
                "command class %s must subclass Command" % cmd_class)

        # Also make sure that the command object provides a list of its
        # known options.
        if not (hasattr(cmd_class, 'user_options') and
                isinstance(cmd_class.user_options, list)):
            msg = ("command class %s must provide "
                "'user_options' attribute (a list of tuples)")
            raise DistutilsClassError(msg % cmd_class)

        # If the command class has a list of negative alias options,
        # merge it in with the global negative aliases.
        negative_opt = self.negative_opt
        if hasattr(cmd_class, 'negative_opt'):
            negative_opt = negative_opt.copy()
            negative_opt.update(cmd_class.negative_opt)

        # Check for help_options in command class.  They have a different
        # format (tuple of four) so we need to preprocess them here.
        if (hasattr(cmd_class, 'help_options') and
                isinstance(cmd_class.help_options, list)):
            help_options = fix_help_options(cmd_class.help_options)
        else:
            help_options = []

        # All commands support the global options too, just by adding
        # in 'global_options'.
        parser.set_option_table(self.global_options +
                                cmd_class.user_options +
                                help_options)
        parser.set_negative_aliases(negative_opt)
        (args, opts) = parser.getopt(args[1:])
        if hasattr(opts, 'help') and opts.help:
            self._show_help(parser, display_options=0, commands=[cmd_class])
            return

        if (hasattr(cmd_class, 'help_options') and
                isinstance(cmd_class.help_options, list)):
            help_option_found=0
            for (help_option, short, desc, func) in cmd_class.help_options:
                if hasattr(opts, parser.get_attr_name(help_option)):
                    help_option_found=1
                    if callable(func):
                        func()
                    else:
                        raise DistutilsClassError(
                            "invalid help function %r for help option '%s': "
                            "must be a callable object (function, etc.)"
                            % (func, help_option))

            if help_option_found:
                return

        # Put the options from the command-line into their official
        # holding pen, the 'command_options' dictionary.
        opt_dict = self.get_option_dict(command)
        for (name, value) in vars(opts).items():
            opt_dict[name] = ("command line", value)

        return args

    def finalize_options(self):
        """Set final values for all the options on the Distribution
        instance, analogous to the .finalize_options() method of Command
        objects.
        """
        for attr in ('keywords', 'platforms'):
            value = getattr(self.metadata, attr)
            if value is None:
                continue
            if isinstance(value, str):
                value = [elm.strip() for elm in value.split(',')]
                setattr(self.metadata, attr, value)

    def _show_help(self, parser, global_options=1, display_options=1,
                   commands=[]):
        """Show help for the setup script command-line in the form of
        several lists of command-line options.  'parser' should be a
        FancyGetopt instance; do not expect it to be returned in the
        same state, as its option table will be reset to make it
        generate the correct help text.

        If 'global_options' is true, lists the global options:
        --verbose, --dry-run, etc.  If 'display_options' is true, lists
        the "display-only" options: --name, --version, etc.  Finally,
        lists per-command help for every command name or command class
        in 'commands'.
        """
        # late import because of mutual dependence between these modules
        from distutils.core import gen_usage
        from distutils.cmd import Command

        if global_options:
            if display_options:
                options = self._get_toplevel_options()
            else:
                options = self.global_options
            parser.set_option_table(options)
            parser.print_help(self.common_usage + "\nGlobal options:")
            print('')

        if display_options:
            parser.set_option_table(self.display_options)
            parser.print_help(
                "Information display options (just display " +
                "information, ignore any commands)")
            print('')

        for command in self.commands:
            if isinstance(command, type) and issubclass(command, Command):
                klass = command
            else:
                klass = self.get_command_class(command)
            if (hasattr(klass, 'help_options') and
                    isinstance(klass.help_options, list)):
                parser.set_option_table(klass.user_options +
                                        fix_help_options(klass.help_options))
            else:
                parser.set_option_table(klass.user_options)
            parser.print_help("Options for '%s' command:" % klass.__name__)
            print('')

        print(gen_usage(self.script_name))

    def handle_display_options(self, option_order):
        """If there were any non-global "display-only" options
        (--help-commands or the metadata display options) on the command
        line, display the requested info and return true; else return
        false.
        """
        from distutils.core import gen_usage

        # User just wants a list of commands -- we'll print it out and stop
        # processing now (ie. if they ran "setup --help-commands foo bar",
        # we ignore "foo bar").
        if self.help_commands:
            self.print_commands()
            print('')
            print(gen_usage(self.script_name))
            return 1

        # If user supplied any of the "display metadata" options, then
        # display that metadata in the order in which the user supplied the
        # metadata options.
        any_display_options = 0
        is_display_option = {}
        for option in self.display_options:
            is_display_option[option[0]] = 1

        for (opt, val) in option_order:
            if val and is_display_option.get(opt):
                opt = translate_longopt(opt)
                value = getattr(self.metadata, "get_"+opt)()
                if opt in ['keywords', 'platforms']:
                    print(','.join(value))
                elif opt in ('classifiers', 'provides', 'requires',
                             'obsoletes'):
                    print('\n'.join(value))
                else:
                    print(value)
                any_display_options = 1

        return any_display_options

    def print_command_list(self, commands, header, max_length):
        """Print a subset of the list of all commands -- used by
        'print_commands()'.
        """
        print(header + ":")

        for cmd in commands:
            klass = self.cmdclass.get(cmd)
            if not klass:
                klass = self.get_command_class(cmd)
            try:
                description = klass.description
            except AttributeError:
                description = "(no description available)"

            print("  %-*s  %s" % (max_length, cmd, description))

    def print_commands(self):
        """Print out a help message listing all available commands with a
        description of each.  The list is divided into "standard commands"
        (listed in distutils.command.__all__) and "extra commands"
        (mentioned in self.cmdclass, but not a standard command).  The
        descriptions come from the command class attribute
        'description'.
        """
        import distutils.command
        std_commands = distutils.command.__all__
        is_std = {}
        for cmd in std_commands:
            is_std[cmd] = 1

        extra_commands = []
        for cmd in self.cmdclass.keys():
            if not is_std.get(cmd):
                extra_commands.append(cmd)

        max_length = 0
        for cmd in (std_commands + extra_commands):
            if len(cmd) > max_length:
                max_length = len(cmd)

        self.print_command_list(std_commands,
                                "Standard commands",
                                max_length)
        if extra_commands:
            print()
            self.print_command_list(extra_commands,
                                    "Extra commands",
                                    max_length)

    def get_command_list(self):
        """Get a list of (command, description) tuples.
        The list is divided into "standard commands" (listed in
        distutils.command.__all__) and "extra commands" (mentioned in
        self.cmdclass, but not a standard command).  The descriptions come
        from the command class attribute 'description'.
        """
        # Currently this is only used on Mac OS, for the Mac-only GUI
        # Distutils interface (by Jack Jansen)
        import distutils.command
        std_commands = distutils.command.__all__
        is_std = {}
        for cmd in std_commands:
            is_std[cmd] = 1

        extra_commands = []
        for cmd in self.cmdclass.keys():
            if not is_std.get(cmd):
                extra_commands.append(cmd)

        rv = []
        for cmd in (std_commands + extra_commands):
            klass = self.cmdclass.get(cmd)
            if not klass:
                klass = self.get_command_class(cmd)
            try:
                description = klass.description
            except AttributeError:
                description = "(no description available)"
            rv.append((cmd, description))
        return rv

    # -- Command class/object methods ----------------------------------

    def get_command_packages(self):
        """Return a list of packages from which commands are loaded."""
        pkgs = self.command_packages
        if not isinstance(pkgs, list):
            if pkgs is None:
                pkgs = ''
            pkgs = [pkg.strip() for pkg in pkgs.split(',') if pkg != '']
            if "distutils.command" not in pkgs:
                pkgs.insert(0, "distutils.command")
            self.command_packages = pkgs
        return pkgs

    def get_command_class(self, command):
        """Return the class that implements the Distutils command named by
        'command'.  First we check the 'cmdclass' dictionary; if the
        command is mentioned there, we fetch the class object from the
        dictionary and return it.  Otherwise we load the command module
        ("distutils.command." + command) and fetch the command class from
        the module.  The loaded class is also stored in 'cmdclass'
        to speed future calls to 'get_command_class()'.

        Raises DistutilsModuleError if the expected module could not be
        found, or if that module does not define the expected class.
        """
        klass = self.cmdclass.get(command)
        if klass:
            return klass

        for pkgname in self.get_command_packages():
            module_name = "%s.%s" % (pkgname, command)
            klass_name = command

            try:
                __import__(module_name)
                module = sys.modules[module_name]
            except ImportError:
                continue

            try:
                klass = getattr(module, klass_name)
            except AttributeError:
                raise DistutilsModuleError(
                    "invalid command '%s' (no class '%s' in module '%s')"
                    % (command, klass_name, module_name))

            self.cmdclass[command] = klass
            return klass

        raise DistutilsModuleError("invalid command '%s'" % command)

    def get_command_obj(self, command, create=1):
        """Return the command object for 'command'.  Normally this object
        is cached on a previous call to 'get_command_obj()'; if no command
        object for 'command' is in the cache, then we either create and
        return it (if 'create' is true) or return None.
        """
        cmd_obj = self.command_obj.get(command)
        if not cmd_obj and create:
            if DEBUG:
                self.announce("Distribution.get_command_obj(): "
                              "creating '%s' command object" % command)

            klass = self.get_command_class(command)
            cmd_obj = self.command_obj[command] = klass(self)
            self.have_run[command] = 0

            # Set any options that were supplied in config files
            # or on the command line.  (NB. support for error
            # reporting is lame here: any errors aren't reported
            # until 'finalize_options()' is called, which means
            # we won't report the source of the error.)
            options = self.command_options.get(command)
            if options:
                self._set_command_options(cmd_obj, options)

        return cmd_obj

    def _set_command_options(self, command_obj, option_dict=None):
        """Set the options for 'command_obj' from 'option_dict'.  Basically
        this means copying elements of a dictionary ('option_dict') to
        attributes of an instance ('command').

        'command_obj' must be a Command instance.  If 'option_dict' is not
        supplied, uses the standard option dictionary for this command
        (from 'self.command_options').
        """
        command_name = command_obj.get_command_name()
        if option_dict is None:
            option_dict = self.get_option_dict(command_name)

        if DEBUG:
            self.announce("  setting options for '%s' command:" % command_name)
        for (option, (source, value)) in option_dict.items():
            if DEBUG:
                self.announce("    %s = %s (from %s)" % (option, value,
                                                         source))
            try:
                bool_opts = [translate_longopt(o)
                             for o in command_obj.boolean_options]
            except AttributeError:
                bool_opts = []
            try:
                neg_opt = command_obj.negative_opt
            except AttributeError:
                neg_opt = {}

            try:
                is_string = isinstance(value, str)
                if option in neg_opt and is_string:
                    setattr(command_obj, neg_opt[option], not strtobool(value))
                elif option in bool_opts and is_string:
                    setattr(command_obj, option, strtobool(value))
                elif hasattr(command_obj, option):
                    setattr(command_obj, option, value)
                else:
                    raise DistutilsOptionError(
                        "error in %s: command '%s' has no such option '%s'"
                        % (source, command_name, option))
            except ValueError as msg:
                raise DistutilsOptionError(msg)

    def reinitialize_command(self, command, reinit_subcommands=0):
        """Reinitializes a command to the state it was in when first
        returned by 'get_command_obj()': ie., initialized but not yet
        finalized.  This provides the opportunity to sneak option
        values in programmatically, overriding or supplementing
        user-supplied values from the config files and command line.
        You'll have to re-finalize the command object (by calling
        'finalize_options()' or 'ensure_finalized()') before using it for
        real.

        'command' should be a command name (string) or command object.  If
        'reinit_subcommands' is true, also reinitializes the command's
        sub-commands, as declared by the 'sub_commands' class attribute (if
        it has one).  See the "install" command for an example.  Only
        reinitializes the sub-commands that actually matter, ie. those
        whose test predicates return true.

        Returns the reinitialized command object.
        """
        from distutils.cmd import Command
        if not isinstance(command, Command):
            command_name = command
            command = self.get_command_obj(command_name)
        else:
            command_name = command.get_command_name()

        if not command.finalized:
            return command
        command.initialize_options()
        command.finalized = 0
        self.have_run[command_name] = 0
        self._set_command_options(command)

        if reinit_subcommands:
            for sub in command.get_sub_commands():
                self.reinitialize_command(sub, reinit_subcommands)

        return command

    # -- Methods that operate on the Distribution ----------------------

    def announce(self, msg, level=log.INFO):
        log.log(level, msg)

    def run_commands(self):
        """Run each command that was seen on the setup script command line.
        Uses the list of commands found and cache of command objects
        created by 'get_command_obj()'.
        """
        for cmd in self.commands:
            self.run_command(cmd)

    # -- Methods that operate on its Commands --------------------------

    def run_command(self, command):
        """Do whatever it takes to run a command (including nothing at all,
        if the command has already been run).  Specifically: if we have
        already created and run the command named by 'command', return
        silently without doing anything.  If the command named by 'command'
        doesn't even have a command object yet, create one.  Then invoke
        'run()' on that command object (or an existing one).
        """
        # Already been here, done that? then return silently.
        if self.have_run.get(command):
            return

        log.info("running %s", command)
        cmd_obj = self.get_command_obj(command)
        cmd_obj.ensure_finalized()
        cmd_obj.run()
        self.have_run[command] = 1

    # -- Distribution query methods ------------------------------------

    def has_pure_modules(self):
        return len(self.packages or self.py_modules or []) > 0

    def has_ext_modules(self):
        return self.ext_modules and len(self.ext_modules) > 0

    def has_c_libraries(self):
        return self.libraries and len(self.libraries) > 0

    def has_modules(self):
        return self.has_pure_modules() or self.has_ext_modules()

    def has_headers(self):
        return self.headers and len(self.headers) > 0

    def has_scripts(self):
        return self.scripts and len(self.scripts) > 0

    def has_data_files(self):
        return self.data_files and len(self.data_files) > 0

    def is_pure(self):
        return (self.has_pure_modules() and
                not self.has_ext_modules() and
                not self.has_c_libraries())

    # -- Metadata query methods ----------------------------------------

    # If you're looking for 'get_name()', 'get_version()', and so forth,
    # they are defined in a sneaky way: the constructor binds self.get_XXX
    # to self.metadata.get_XXX.  The actual code is in the
    # DistributionMetadata class, below.

class DistributionMetadata:
    """Dummy class to hold the distribution meta-data: name, version,
    author, and so forth.
    """

    _METHOD_BASENAMES = ("name", "version", "author", "author_email",
                         "maintainer", "maintainer_email", "url",
                         "license", "description", "long_description",
                         "keywords", "platforms", "fullname", "contact",
                         "contact_email", "classifiers", "download_url",
                         # PEP 314
                         "provides", "requires", "obsoletes",
                         )

    def __init__(self, path=None):
        if path is not None:
            self.read_pkg_file(open(path))
        else:
            self.name = None
            self.version = None
            self.author = None
            self.author_email = None
            self.maintainer = None
            self.maintainer_email = None
            self.url = None
            self.license = None
            self.description = None
            self.long_description = None
            self.keywords = None
            self.platforms = None
            self.classifiers = None
            self.download_url = None
            # PEP 314
            self.provides = None
            self.requires = None
            self.obsoletes = None

    def read_pkg_file(self, file):
        """Reads the metadata values from a file object."""
        msg = message_from_file(file)

        def _read_field(name):
            value = msg[name]
            if value == 'UNKNOWN':
                return None
            return value

        def _read_list(name):
            values = msg.get_all(name, None)
            if values == []:
                return None
            return values

        metadata_version = msg['metadata-version']
        self.name = _read_field('name')
        self.version = _read_field('version')
        self.description = _read_field('summary')
        # we are filling author only.
        self.author = _read_field('author')
        self.maintainer = None
        self.author_email = _read_field('author-email')
        self.maintainer_email = None
        self.url = _read_field('home-page')
        self.license = _read_field('license')

        if 'download-url' in msg:
            self.download_url = _read_field('download-url')
        else:
            self.download_url = None

        self.long_description = _read_field('description')
        self.description = _read_field('summary')

        if 'keywords' in msg:
            self.keywords = _read_field('keywords').split(',')

        self.platforms = _read_list('platform')
        self.classifiers = _read_list('classifier')

        # PEP 314 - these fields only exist in 1.1
        if metadata_version == '1.1':
            self.requires = _read_list('requires')
            self.provides = _read_list('provides')
            self.obsoletes = _read_list('obsoletes')
        else:
            self.requires = None
            self.provides = None
            self.obsoletes = None

    def write_pkg_info(self, base_dir):
        """Write the PKG-INFO file into the release tree.
        """
        with open(os.path.join(base_dir, 'PKG-INFO'), 'w',
                  encoding='UTF-8') as pkg_info:
            self.write_pkg_file(pkg_info)

    def write_pkg_file(self, file):
        """Write the PKG-INFO format data to a file object.
        """
        version = '1.0'
        if (self.provides or self.requires or self.obsoletes or
                self.classifiers or self.download_url):
            version = '1.1'

        file.write('Metadata-Version: %s\n' % version)
        file.write('Name: %s\n' % self.get_name())
        file.write('Version: %s\n' % self.get_version())
        file.write('Summary: %s\n' % self.get_description())
        file.write('Home-page: %s\n' % self.get_url())
        file.write('Author: %s\n' % self.get_contact())
        file.write('Author-email: %s\n' % self.get_contact_email())
        file.write('License: %s\n' % self.get_license())
        if self.download_url:
            file.write('Download-URL: %s\n' % self.download_url)

        long_desc = rfc822_escape(self.get_long_description())
        file.write('Description: %s\n' % long_desc)

        keywords = ','.join(self.get_keywords())
        if keywords:
            file.write('Keywords: %s\n' % keywords)

        self._write_list(file, 'Platform', self.get_platforms())
        self._write_list(file, 'Classifier', self.get_classifiers())

        # PEP 314
        self._write_list(file, 'Requires', self.get_requires())
        self._write_list(file, 'Provides', self.get_provides())
        self._write_list(file, 'Obsoletes', self.get_obsoletes())

    def _write_list(self, file, name, values):
        for value in values:
            file.write('%s: %s\n' % (name, value))

    # -- Metadata query methods ----------------------------------------

    def get_name(self):
        return self.name or "UNKNOWN"

    def get_version(self):
        return self.version or "0.0.0"

    def get_fullname(self):
        return "%s-%s" % (self.get_name(), self.get_version())

    def get_author(self):
        return self.author or "UNKNOWN"

    def get_author_email(self):
        return self.author_email or "UNKNOWN"

    def get_maintainer(self):
        return self.maintainer or "UNKNOWN"

    def get_maintainer_email(self):
        return self.maintainer_email or "UNKNOWN"

    def get_contact(self):
        return self.maintainer or self.author or "UNKNOWN"

    def get_contact_email(self):
        return self.maintainer_email or self.author_email or "UNKNOWN"

    def get_url(self):
        return self.url or "UNKNOWN"

    def get_license(self):
        return self.license or "UNKNOWN"
    get_licence = get_license

    def get_description(self):
        return self.description or "UNKNOWN"

    def get_long_description(self):
        return self.long_description or "UNKNOWN"

    def get_keywords(self):
        return self.keywords or []

    def set_keywords(self, value):
        self.keywords = _ensure_list(value, 'keywords')

    def get_platforms(self):
        return self.platforms or ["UNKNOWN"]

    def set_platforms(self, value):
        self.platforms = _ensure_list(value, 'platforms')

    def get_classifiers(self):
        return self.classifiers or []

    def set_classifiers(self, value):
        self.classifiers = _ensure_list(value, 'classifiers')

    def get_download_url(self):
        return self.download_url or "UNKNOWN"

    # PEP 314
    def get_requires(self):
        return self.requires or []

    def set_requires(self, value):
        import distutils.versionpredicate
        for v in value:
            distutils.versionpredicate.VersionPredicate(v)
        self.requires = list(value)

    def get_provides(self):
        return self.provides or []

    def set_provides(self, value):
        value = [v.strip() for v in value]
        for v in value:
            import distutils.versionpredicate
            distutils.versionpredicate.split_provision(v)
        self.provides = value

    def get_obsoletes(self):
        return self.obsoletes or []

    def set_obsoletes(self, value):
        import distutils.versionpredicate
        for v in value:
            distutils.versionpredicate.VersionPredicate(v)
        self.obsoletes = list(value)

def fix_help_options(options):
    """Convert a 4-tuple 'help_options' list as found in various command
    classes to the 3-tuple form required by FancyGetopt.
    """
    new_options = []
    for help_tuple in options:
        new_options.append(help_tuple[0:3])
    return new_options
distutils/archive_util.py000064400000020574151153537450011641 0ustar00"""distutils.archive_util

Utility functions for creating archive files (tarballs, zip files,
that sort of thing)."""

import os
from warnings import warn
import sys

try:
    import zipfile
except ImportError:
    zipfile = None


from distutils.errors import DistutilsExecError
from distutils.spawn import spawn
from distutils.dir_util import mkpath
from distutils import log

try:
    from pwd import getpwnam
except ImportError:
    getpwnam = None

try:
    from grp import getgrnam
except ImportError:
    getgrnam = None

def _get_gid(name):
    """Returns a gid, given a group name."""
    if getgrnam is None or name is None:
        return None
    try:
        result = getgrnam(name)
    except KeyError:
        result = None
    if result is not None:
        return result[2]
    return None

def _get_uid(name):
    """Returns an uid, given a user name."""
    if getpwnam is None or name is None:
        return None
    try:
        result = getpwnam(name)
    except KeyError:
        result = None
    if result is not None:
        return result[2]
    return None

def make_tarball(base_name, base_dir, compress="gzip", verbose=0, dry_run=0,
                 owner=None, group=None):
    """Create a (possibly compressed) tar file from all the files under
    'base_dir'.

    'compress' must be "gzip" (the default), "bzip2", "xz", "compress", or
    None.  ("compress" will be deprecated in Python 3.2)

    'owner' and 'group' can be used to define an owner and a group for the
    archive that is being built. If not provided, the current owner and group
    will be used.

    The output tar file will be named 'base_dir' +  ".tar", possibly plus
    the appropriate compression extension (".gz", ".bz2", ".xz" or ".Z").

    Returns the output filename.
    """
    tar_compression = {'gzip': 'gz', 'bzip2': 'bz2', 'xz': 'xz', None: '',
                       'compress': ''}
    compress_ext = {'gzip': '.gz', 'bzip2': '.bz2', 'xz': '.xz',
                    'compress': '.Z'}

    # flags for compression program, each element of list will be an argument
    if compress is not None and compress not in compress_ext.keys():
        raise ValueError(
              "bad value for 'compress': must be None, 'gzip', 'bzip2', "
              "'xz' or 'compress'")

    archive_name = base_name + '.tar'
    if compress != 'compress':
        archive_name += compress_ext.get(compress, '')

    mkpath(os.path.dirname(archive_name), dry_run=dry_run)

    # creating the tarball
    import tarfile  # late import so Python build itself doesn't break

    log.info('Creating tar archive')

    uid = _get_uid(owner)
    gid = _get_gid(group)

    def _set_uid_gid(tarinfo):
        if gid is not None:
            tarinfo.gid = gid
            tarinfo.gname = group
        if uid is not None:
            tarinfo.uid = uid
            tarinfo.uname = owner
        return tarinfo

    if not dry_run:
        tar = tarfile.open(archive_name, 'w|%s' % tar_compression[compress])
        try:
            tar.add(base_dir, filter=_set_uid_gid)
        finally:
            tar.close()

    # compression using `compress`
    if compress == 'compress':
        warn("'compress' will be deprecated.", PendingDeprecationWarning)
        # the option varies depending on the platform
        compressed_name = archive_name + compress_ext[compress]
        if sys.platform == 'win32':
            cmd = [compress, archive_name, compressed_name]
        else:
            cmd = [compress, '-f', archive_name]
        spawn(cmd, dry_run=dry_run)
        return compressed_name

    return archive_name

def make_zipfile(base_name, base_dir, verbose=0, dry_run=0):
    """Create a zip file from all the files under 'base_dir'.

    The output zip file will be named 'base_name' + ".zip".  Uses either the
    "zipfile" Python module (if available) or the InfoZIP "zip" utility
    (if installed and found on the default search path).  If neither tool is
    available, raises DistutilsExecError.  Returns the name of the output zip
    file.
    """
    zip_filename = base_name + ".zip"
    mkpath(os.path.dirname(zip_filename), dry_run=dry_run)

    # If zipfile module is not available, try spawning an external
    # 'zip' command.
    if zipfile is None:
        if verbose:
            zipoptions = "-r"
        else:
            zipoptions = "-rq"

        try:
            spawn(["zip", zipoptions, zip_filename, base_dir],
                  dry_run=dry_run)
        except DistutilsExecError:
            # XXX really should distinguish between "couldn't find
            # external 'zip' command" and "zip failed".
            raise DistutilsExecError(("unable to create zip file '%s': "
                   "could neither import the 'zipfile' module nor "
                   "find a standalone zip utility") % zip_filename)

    else:
        log.info("creating '%s' and adding '%s' to it",
                 zip_filename, base_dir)

        if not dry_run:
            try:
                zip = zipfile.ZipFile(zip_filename, "w",
                                      compression=zipfile.ZIP_DEFLATED)
            except RuntimeError:
                zip = zipfile.ZipFile(zip_filename, "w",
                                      compression=zipfile.ZIP_STORED)

            with zip:
                if base_dir != os.curdir:
                    path = os.path.normpath(os.path.join(base_dir, ''))
                    zip.write(path, path)
                    log.info("adding '%s'", path)
                for dirpath, dirnames, filenames in os.walk(base_dir):
                    for name in dirnames:
                        path = os.path.normpath(os.path.join(dirpath, name, ''))
                        zip.write(path, path)
                        log.info("adding '%s'", path)
                    for name in filenames:
                        path = os.path.normpath(os.path.join(dirpath, name))
                        if os.path.isfile(path):
                            zip.write(path, path)
                            log.info("adding '%s'", path)

    return zip_filename

ARCHIVE_FORMATS = {
    'gztar': (make_tarball, [('compress', 'gzip')], "gzip'ed tar-file"),
    'bztar': (make_tarball, [('compress', 'bzip2')], "bzip2'ed tar-file"),
    'xztar': (make_tarball, [('compress', 'xz')], "xz'ed tar-file"),
    'ztar':  (make_tarball, [('compress', 'compress')], "compressed tar file"),
    'tar':   (make_tarball, [('compress', None)], "uncompressed tar file"),
    'zip':   (make_zipfile, [],"ZIP file")
    }

def check_archive_formats(formats):
    """Returns the first format from the 'format' list that is unknown.

    If all formats are known, returns None
    """
    for format in formats:
        if format not in ARCHIVE_FORMATS:
            return format
    return None

def make_archive(base_name, format, root_dir=None, base_dir=None, verbose=0,
                 dry_run=0, owner=None, group=None):
    """Create an archive file (eg. zip or tar).

    'base_name' is the name of the file to create, minus any format-specific
    extension; 'format' is the archive format: one of "zip", "tar", "gztar",
    "bztar", "xztar", or "ztar".

    'root_dir' is a directory that will be the root directory of the
    archive; ie. we typically chdir into 'root_dir' before creating the
    archive.  'base_dir' is the directory where we start archiving from;
    ie. 'base_dir' will be the common prefix of all files and
    directories in the archive.  'root_dir' and 'base_dir' both default
    to the current directory.  Returns the name of the archive file.

    'owner' and 'group' are used when creating a tar archive. By default,
    uses the current owner and group.
    """
    save_cwd = os.getcwd()
    if root_dir is not None:
        log.debug("changing into '%s'", root_dir)
        base_name = os.path.abspath(base_name)
        if not dry_run:
            os.chdir(root_dir)

    if base_dir is None:
        base_dir = os.curdir

    kwargs = {'dry_run': dry_run}

    try:
        format_info = ARCHIVE_FORMATS[format]
    except KeyError:
        raise ValueError("unknown archive format '%s'" % format)

    func = format_info[0]
    for arg, val in format_info[1]:
        kwargs[arg] = val

    if format != 'zip':
        kwargs['owner'] = owner
        kwargs['group'] = group

    try:
        filename = func(base_name, base_dir, **kwargs)
    finally:
        if root_dir is not None:
            log.debug("changing back to '%s'", save_cwd)
            os.chdir(save_cwd)

    return filename
distutils/core.py000064400000021254151153537450010107 0ustar00"""distutils.core

The only module that needs to be imported to use the Distutils; provides
the 'setup' function (which is to be called from the setup script).  Also
indirectly provides the Distribution and Command classes, although they are
really defined in distutils.dist and distutils.cmd.
"""

import os
import sys

from distutils.debug import DEBUG
from distutils.errors import *

# Mainly import these so setup scripts can "from distutils.core import" them.
from distutils.dist import Distribution
from distutils.cmd import Command
from distutils.config import PyPIRCCommand
from distutils.extension import Extension

# This is a barebones help message generated displayed when the user
# runs the setup script with no arguments at all.  More useful help
# is generated with various --help options: global help, list commands,
# and per-command help.
USAGE = """\
usage: %(script)s [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: %(script)s --help [cmd1 cmd2 ...]
   or: %(script)s --help-commands
   or: %(script)s cmd --help
"""

def gen_usage (script_name):
    script = os.path.basename(script_name)
    return USAGE % vars()


# Some mild magic to control the behaviour of 'setup()' from 'run_setup()'.
_setup_stop_after = None
_setup_distribution = None

# Legal keyword arguments for the setup() function
setup_keywords = ('distclass', 'script_name', 'script_args', 'options',
                  'name', 'version', 'author', 'author_email',
                  'maintainer', 'maintainer_email', 'url', 'license',
                  'description', 'long_description', 'keywords',
                  'platforms', 'classifiers', 'download_url',
                  'requires', 'provides', 'obsoletes',
                  )

# Legal keyword arguments for the Extension constructor
extension_keywords = ('name', 'sources', 'include_dirs',
                      'define_macros', 'undef_macros',
                      'library_dirs', 'libraries', 'runtime_library_dirs',
                      'extra_objects', 'extra_compile_args', 'extra_link_args',
                      'swig_opts', 'export_symbols', 'depends', 'language')

def setup (**attrs):
    """The gateway to the Distutils: do everything your setup script needs
    to do, in a highly flexible and user-driven way.  Briefly: create a
    Distribution instance; find and parse config files; parse the command
    line; run each Distutils command found there, customized by the options
    supplied to 'setup()' (as keyword arguments), in config files, and on
    the command line.

    The Distribution instance might be an instance of a class supplied via
    the 'distclass' keyword argument to 'setup'; if no such class is
    supplied, then the Distribution class (in dist.py) is instantiated.
    All other arguments to 'setup' (except for 'cmdclass') are used to set
    attributes of the Distribution instance.

    The 'cmdclass' argument, if supplied, is a dictionary mapping command
    names to command classes.  Each command encountered on the command line
    will be turned into a command class, which is in turn instantiated; any
    class found in 'cmdclass' is used in place of the default, which is
    (for command 'foo_bar') class 'foo_bar' in module
    'distutils.command.foo_bar'.  The command class must provide a
    'user_options' attribute which is a list of option specifiers for
    'distutils.fancy_getopt'.  Any command-line options between the current
    and the next command are used to set attributes of the current command
    object.

    When the entire command-line has been successfully parsed, calls the
    'run()' method on each command object in turn.  This method will be
    driven entirely by the Distribution object (which each command object
    has a reference to, thanks to its constructor), and the
    command-specific options that became attributes of each command
    object.
    """

    global _setup_stop_after, _setup_distribution

    # Determine the distribution class -- either caller-supplied or
    # our Distribution (see below).
    klass = attrs.get('distclass')
    if klass:
        del attrs['distclass']
    else:
        klass = Distribution

    if 'script_name' not in attrs:
        attrs['script_name'] = os.path.basename(sys.argv[0])
    if 'script_args'  not in attrs:
        attrs['script_args'] = sys.argv[1:]

    # Create the Distribution instance, using the remaining arguments
    # (ie. everything except distclass) to initialize it
    try:
        _setup_distribution = dist = klass(attrs)
    except DistutilsSetupError as msg:
        if 'name' not in attrs:
            raise SystemExit("error in setup command: %s" % msg)
        else:
            raise SystemExit("error in %s setup command: %s" % \
                  (attrs['name'], msg))

    if _setup_stop_after == "init":
        return dist

    # Find and parse the config file(s): they will override options from
    # the setup script, but be overridden by the command line.
    dist.parse_config_files()

    if DEBUG:
        print("options (after parsing config files):")
        dist.dump_option_dicts()

    if _setup_stop_after == "config":
        return dist

    # Parse the command line and override config files; any
    # command-line errors are the end user's fault, so turn them into
    # SystemExit to suppress tracebacks.
    try:
        ok = dist.parse_command_line()
    except DistutilsArgError as msg:
        raise SystemExit(gen_usage(dist.script_name) + "\nerror: %s" % msg)

    if DEBUG:
        print("options (after parsing command line):")
        dist.dump_option_dicts()

    if _setup_stop_after == "commandline":
        return dist

    # And finally, run all the commands found on the command line.
    if ok:
        try:
            dist.run_commands()
        except KeyboardInterrupt:
            raise SystemExit("interrupted")
        except OSError as exc:
            if DEBUG:
                sys.stderr.write("error: %s\n" % (exc,))
                raise
            else:
                raise SystemExit("error: %s" % (exc,))

        except (DistutilsError,
                CCompilerError) as msg:
            if DEBUG:
                raise
            else:
                raise SystemExit("error: " + str(msg))

    return dist

# setup ()


def run_setup (script_name, script_args=None, stop_after="run"):
    """Run a setup script in a somewhat controlled environment, and
    return the Distribution instance that drives things.  This is useful
    if you need to find out the distribution meta-data (passed as
    keyword args from 'script' to 'setup()', or the contents of the
    config files or command-line.

    'script_name' is a file that will be read and run with 'exec()';
    'sys.argv[0]' will be replaced with 'script' for the duration of the
    call.  'script_args' is a list of strings; if supplied,
    'sys.argv[1:]' will be replaced by 'script_args' for the duration of
    the call.

    'stop_after' tells 'setup()' when to stop processing; possible
    values:
      init
        stop after the Distribution instance has been created and
        populated with the keyword arguments to 'setup()'
      config
        stop after config files have been parsed (and their data
        stored in the Distribution instance)
      commandline
        stop after the command-line ('sys.argv[1:]' or 'script_args')
        have been parsed (and the data stored in the Distribution)
      run [default]
        stop after all commands have been run (the same as if 'setup()'
        had been called in the usual way

    Returns the Distribution instance, which provides all information
    used to drive the Distutils.
    """
    if stop_after not in ('init', 'config', 'commandline', 'run'):
        raise ValueError("invalid value for 'stop_after': %r" % (stop_after,))

    global _setup_stop_after, _setup_distribution
    _setup_stop_after = stop_after

    save_argv = sys.argv.copy()
    g = {'__file__': script_name}
    try:
        try:
            sys.argv[0] = script_name
            if script_args is not None:
                sys.argv[1:] = script_args
            with open(script_name, 'rb') as f:
                exec(f.read(), g)
        finally:
            sys.argv = save_argv
            _setup_stop_after = None
    except SystemExit:
        # Hmm, should we do something if exiting with a non-zero code
        # (ie. error)?
        pass

    if _setup_distribution is None:
        raise RuntimeError(("'distutils.core.setup()' was never called -- "
               "perhaps '%s' is not a Distutils setup script?") % \
              script_name)

    # I wonder if the setup script's namespace -- g and l -- would be of
    # any interest to callers?
    #print "_setup_distribution:", _setup_distribution
    return _setup_distribution

# run_setup ()
distutils/msvccompiler.py000064400000056014151153537450011664 0ustar00"""distutils.msvccompiler

Contains MSVCCompiler, an implementation of the abstract CCompiler class
for the Microsoft Visual Studio.
"""

# Written by Perry Stoll
# hacked by Robin Becker and Thomas Heller to do a better job of
#   finding DevStudio (through the registry)

import sys, os
from distutils.errors import \
     DistutilsExecError, DistutilsPlatformError, \
     CompileError, LibError, LinkError
from distutils.ccompiler import \
     CCompiler, gen_preprocess_options, gen_lib_options
from distutils import log

_can_read_reg = False
try:
    import winreg

    _can_read_reg = True
    hkey_mod = winreg

    RegOpenKeyEx = winreg.OpenKeyEx
    RegEnumKey = winreg.EnumKey
    RegEnumValue = winreg.EnumValue
    RegError = winreg.error

except ImportError:
    try:
        import win32api
        import win32con
        _can_read_reg = True
        hkey_mod = win32con

        RegOpenKeyEx = win32api.RegOpenKeyEx
        RegEnumKey = win32api.RegEnumKey
        RegEnumValue = win32api.RegEnumValue
        RegError = win32api.error
    except ImportError:
        log.info("Warning: Can't read registry to find the "
                 "necessary compiler setting\n"
                 "Make sure that Python modules winreg, "
                 "win32api or win32con are installed.")
        pass

if _can_read_reg:
    HKEYS = (hkey_mod.HKEY_USERS,
             hkey_mod.HKEY_CURRENT_USER,
             hkey_mod.HKEY_LOCAL_MACHINE,
             hkey_mod.HKEY_CLASSES_ROOT)

def read_keys(base, key):
    """Return list of registry keys."""
    try:
        handle = RegOpenKeyEx(base, key)
    except RegError:
        return None
    L = []
    i = 0
    while True:
        try:
            k = RegEnumKey(handle, i)
        except RegError:
            break
        L.append(k)
        i += 1
    return L

def read_values(base, key):
    """Return dict of registry keys and values.

    All names are converted to lowercase.
    """
    try:
        handle = RegOpenKeyEx(base, key)
    except RegError:
        return None
    d = {}
    i = 0
    while True:
        try:
            name, value, type = RegEnumValue(handle, i)
        except RegError:
            break
        name = name.lower()
        d[convert_mbcs(name)] = convert_mbcs(value)
        i += 1
    return d

def convert_mbcs(s):
    dec = getattr(s, "decode", None)
    if dec is not None:
        try:
            s = dec("mbcs")
        except UnicodeError:
            pass
    return s

class MacroExpander:
    def __init__(self, version):
        self.macros = {}
        self.load_macros(version)

    def set_macro(self, macro, path, key):
        for base in HKEYS:
            d = read_values(base, path)
            if d:
                self.macros["$(%s)" % macro] = d[key]
                break

    def load_macros(self, version):
        vsbase = r"Software\Microsoft\VisualStudio\%0.1f" % version
        self.set_macro("VCInstallDir", vsbase + r"\Setup\VC", "productdir")
        self.set_macro("VSInstallDir", vsbase + r"\Setup\VS", "productdir")
        net = r"Software\Microsoft\.NETFramework"
        self.set_macro("FrameworkDir", net, "installroot")
        try:
            if version > 7.0:
                self.set_macro("FrameworkSDKDir", net, "sdkinstallrootv1.1")
            else:
                self.set_macro("FrameworkSDKDir", net, "sdkinstallroot")
        except KeyError as exc: #
            raise DistutilsPlatformError(
            """Python was built with Visual Studio 2003;
extensions must be built with a compiler than can generate compatible binaries.
Visual Studio 2003 was not found on this system. If you have Cygwin installed,
you can try compiling with MingW32, by passing "-c mingw32" to setup.py.""")

        p = r"Software\Microsoft\NET Framework Setup\Product"
        for base in HKEYS:
            try:
                h = RegOpenKeyEx(base, p)
            except RegError:
                continue
            key = RegEnumKey(h, 0)
            d = read_values(base, r"%s\%s" % (p, key))
            self.macros["$(FrameworkVersion)"] = d["version"]

    def sub(self, s):
        for k, v in self.macros.items():
            s = s.replace(k, v)
        return s

def get_build_version():
    """Return the version of MSVC that was used to build Python.

    For Python 2.3 and up, the version number is included in
    sys.version.  For earlier versions, assume the compiler is MSVC 6.
    """
    prefix = "MSC v."
    i = sys.version.find(prefix)
    if i == -1:
        return 6
    i = i + len(prefix)
    s, rest = sys.version[i:].split(" ", 1)
    majorVersion = int(s[:-2]) - 6
    if majorVersion >= 13:
        # v13 was skipped and should be v14
        majorVersion += 1
    minorVersion = int(s[2:3]) / 10.0
    # I don't think paths are affected by minor version in version 6
    if majorVersion == 6:
        minorVersion = 0
    if majorVersion >= 6:
        return majorVersion + minorVersion
    # else we don't know what version of the compiler this is
    return None

def get_build_architecture():
    """Return the processor architecture.

    Possible results are "Intel" or "AMD64".
    """

    prefix = " bit ("
    i = sys.version.find(prefix)
    if i == -1:
        return "Intel"
    j = sys.version.find(")", i)
    return sys.version[i+len(prefix):j]

def normalize_and_reduce_paths(paths):
    """Return a list of normalized paths with duplicates removed.

    The current order of paths is maintained.
    """
    # Paths are normalized so things like:  /a and /a/ aren't both preserved.
    reduced_paths = []
    for p in paths:
        np = os.path.normpath(p)
        # XXX(nnorwitz): O(n**2), if reduced_paths gets long perhaps use a set.
        if np not in reduced_paths:
            reduced_paths.append(np)
    return reduced_paths


class MSVCCompiler(CCompiler) :
    """Concrete class that implements an interface to Microsoft Visual C++,
       as defined by the CCompiler abstract class."""

    compiler_type = 'msvc'

    # Just set this so CCompiler's constructor doesn't barf.  We currently
    # don't use the 'set_executables()' bureaucracy provided by CCompiler,
    # as it really isn't necessary for this sort of single-compiler class.
    # Would be nice to have a consistent interface with UnixCCompiler,
    # though, so it's worth thinking about.
    executables = {}

    # Private class data (need to distinguish C from C++ source for compiler)
    _c_extensions = ['.c']
    _cpp_extensions = ['.cc', '.cpp', '.cxx']
    _rc_extensions = ['.rc']
    _mc_extensions = ['.mc']

    # Needed for the filename generation methods provided by the
    # base class, CCompiler.
    src_extensions = (_c_extensions + _cpp_extensions +
                      _rc_extensions + _mc_extensions)
    res_extension = '.res'
    obj_extension = '.obj'
    static_lib_extension = '.lib'
    shared_lib_extension = '.dll'
    static_lib_format = shared_lib_format = '%s%s'
    exe_extension = '.exe'

    def __init__(self, verbose=0, dry_run=0, force=0):
        CCompiler.__init__ (self, verbose, dry_run, force)
        self.__version = get_build_version()
        self.__arch = get_build_architecture()
        if self.__arch == "Intel":
            # x86
            if self.__version >= 7:
                self.__root = r"Software\Microsoft\VisualStudio"
                self.__macros = MacroExpander(self.__version)
            else:
                self.__root = r"Software\Microsoft\Devstudio"
            self.__product = "Visual Studio version %s" % self.__version
        else:
            # Win64. Assume this was built with the platform SDK
            self.__product = "Microsoft SDK compiler %s" % (self.__version + 6)

        self.initialized = False

    def initialize(self):
        self.__paths = []
        if "DISTUTILS_USE_SDK" in os.environ and "MSSdk" in os.environ and self.find_exe("cl.exe"):
            # Assume that the SDK set up everything alright; don't try to be
            # smarter
            self.cc = "cl.exe"
            self.linker = "link.exe"
            self.lib = "lib.exe"
            self.rc = "rc.exe"
            self.mc = "mc.exe"
        else:
            self.__paths = self.get_msvc_paths("path")

            if len(self.__paths) == 0:
                raise DistutilsPlatformError("Python was built with %s, "
                       "and extensions need to be built with the same "
                       "version of the compiler, but it isn't installed."
                       % self.__product)

            self.cc = self.find_exe("cl.exe")
            self.linker = self.find_exe("link.exe")
            self.lib = self.find_exe("lib.exe")
            self.rc = self.find_exe("rc.exe")   # resource compiler
            self.mc = self.find_exe("mc.exe")   # message compiler
            self.set_path_env_var('lib')
            self.set_path_env_var('include')

        # extend the MSVC path with the current path
        try:
            for p in os.environ['path'].split(';'):
                self.__paths.append(p)
        except KeyError:
            pass
        self.__paths = normalize_and_reduce_paths(self.__paths)
        os.environ['path'] = ";".join(self.__paths)

        self.preprocess_options = None
        if self.__arch == "Intel":
            self.compile_options = [ '/nologo', '/Ox', '/MD', '/W3', '/GX' ,
                                     '/DNDEBUG']
            self.compile_options_debug = ['/nologo', '/Od', '/MDd', '/W3', '/GX',
                                          '/Z7', '/D_DEBUG']
        else:
            # Win64
            self.compile_options = [ '/nologo', '/Ox', '/MD', '/W3', '/GS-' ,
                                     '/DNDEBUG']
            self.compile_options_debug = ['/nologo', '/Od', '/MDd', '/W3', '/GS-',
                                          '/Z7', '/D_DEBUG']

        self.ldflags_shared = ['/DLL', '/nologo', '/INCREMENTAL:NO']
        if self.__version >= 7:
            self.ldflags_shared_debug = [
                '/DLL', '/nologo', '/INCREMENTAL:no', '/DEBUG'
                ]
        else:
            self.ldflags_shared_debug = [
                '/DLL', '/nologo', '/INCREMENTAL:no', '/pdb:None', '/DEBUG'
                ]
        self.ldflags_static = [ '/nologo']

        self.initialized = True

    # -- Worker methods ------------------------------------------------

    def object_filenames(self,
                         source_filenames,
                         strip_dir=0,
                         output_dir=''):
        # Copied from ccompiler.py, extended to return .res as 'object'-file
        # for .rc input file
        if output_dir is None: output_dir = ''
        obj_names = []
        for src_name in source_filenames:
            (base, ext) = os.path.splitext (src_name)
            base = os.path.splitdrive(base)[1] # Chop off the drive
            base = base[os.path.isabs(base):]  # If abs, chop off leading /
            if ext not in self.src_extensions:
                # Better to raise an exception instead of silently continuing
                # and later complain about sources and targets having
                # different lengths
                raise CompileError ("Don't know how to compile %s" % src_name)
            if strip_dir:
                base = os.path.basename (base)
            if ext in self._rc_extensions:
                obj_names.append (os.path.join (output_dir,
                                                base + self.res_extension))
            elif ext in self._mc_extensions:
                obj_names.append (os.path.join (output_dir,
                                                base + self.res_extension))
            else:
                obj_names.append (os.path.join (output_dir,
                                                base + self.obj_extension))
        return obj_names


    def compile(self, sources,
                output_dir=None, macros=None, include_dirs=None, debug=0,
                extra_preargs=None, extra_postargs=None, depends=None):

        if not self.initialized:
            self.initialize()
        compile_info = self._setup_compile(output_dir, macros, include_dirs,
                                           sources, depends, extra_postargs)
        macros, objects, extra_postargs, pp_opts, build = compile_info

        compile_opts = extra_preargs or []
        compile_opts.append ('/c')
        if debug:
            compile_opts.extend(self.compile_options_debug)
        else:
            compile_opts.extend(self.compile_options)

        for obj in objects:
            try:
                src, ext = build[obj]
            except KeyError:
                continue
            if debug:
                # pass the full pathname to MSVC in debug mode,
                # this allows the debugger to find the source file
                # without asking the user to browse for it
                src = os.path.abspath(src)

            if ext in self._c_extensions:
                input_opt = "/Tc" + src
            elif ext in self._cpp_extensions:
                input_opt = "/Tp" + src
            elif ext in self._rc_extensions:
                # compile .RC to .RES file
                input_opt = src
                output_opt = "/fo" + obj
                try:
                    self.spawn([self.rc] + pp_opts +
                               [output_opt] + [input_opt])
                except DistutilsExecError as msg:
                    raise CompileError(msg)
                continue
            elif ext in self._mc_extensions:
                # Compile .MC to .RC file to .RES file.
                #   * '-h dir' specifies the directory for the
                #     generated include file
                #   * '-r dir' specifies the target directory of the
                #     generated RC file and the binary message resource
                #     it includes
                #
                # For now (since there are no options to change this),
                # we use the source-directory for the include file and
                # the build directory for the RC file and message
                # resources. This works at least for win32all.
                h_dir = os.path.dirname(src)
                rc_dir = os.path.dirname(obj)
                try:
                    # first compile .MC to .RC and .H file
                    self.spawn([self.mc] +
                               ['-h', h_dir, '-r', rc_dir] + [src])
                    base, _ = os.path.splitext (os.path.basename (src))
                    rc_file = os.path.join (rc_dir, base + '.rc')
                    # then compile .RC to .RES file
                    self.spawn([self.rc] +
                               ["/fo" + obj] + [rc_file])

                except DistutilsExecError as msg:
                    raise CompileError(msg)
                continue
            else:
                # how to handle this file?
                raise CompileError("Don't know how to compile %s to %s"
                                   % (src, obj))

            output_opt = "/Fo" + obj
            try:
                self.spawn([self.cc] + compile_opts + pp_opts +
                           [input_opt, output_opt] +
                           extra_postargs)
            except DistutilsExecError as msg:
                raise CompileError(msg)

        return objects


    def create_static_lib(self,
                          objects,
                          output_libname,
                          output_dir=None,
                          debug=0,
                          target_lang=None):

        if not self.initialized:
            self.initialize()
        (objects, output_dir) = self._fix_object_args(objects, output_dir)
        output_filename = self.library_filename(output_libname,
                                                output_dir=output_dir)

        if self._need_link(objects, output_filename):
            lib_args = objects + ['/OUT:' + output_filename]
            if debug:
                pass # XXX what goes here?
            try:
                self.spawn([self.lib] + lib_args)
            except DistutilsExecError as msg:
                raise LibError(msg)
        else:
            log.debug("skipping %s (up-to-date)", output_filename)


    def link(self,
             target_desc,
             objects,
             output_filename,
             output_dir=None,
             libraries=None,
             library_dirs=None,
             runtime_library_dirs=None,
             export_symbols=None,
             debug=0,
             extra_preargs=None,
             extra_postargs=None,
             build_temp=None,
             target_lang=None):

        if not self.initialized:
            self.initialize()
        (objects, output_dir) = self._fix_object_args(objects, output_dir)
        fixed_args = self._fix_lib_args(libraries, library_dirs,
                                        runtime_library_dirs)
        (libraries, library_dirs, runtime_library_dirs) = fixed_args

        if runtime_library_dirs:
            self.warn ("I don't know what to do with 'runtime_library_dirs': "
                       + str (runtime_library_dirs))

        lib_opts = gen_lib_options(self,
                                   library_dirs, runtime_library_dirs,
                                   libraries)
        if output_dir is not None:
            output_filename = os.path.join(output_dir, output_filename)

        if self._need_link(objects, output_filename):
            if target_desc == CCompiler.EXECUTABLE:
                if debug:
                    ldflags = self.ldflags_shared_debug[1:]
                else:
                    ldflags = self.ldflags_shared[1:]
            else:
                if debug:
                    ldflags = self.ldflags_shared_debug
                else:
                    ldflags = self.ldflags_shared

            export_opts = []
            for sym in (export_symbols or []):
                export_opts.append("/EXPORT:" + sym)

            ld_args = (ldflags + lib_opts + export_opts +
                       objects + ['/OUT:' + output_filename])

            # The MSVC linker generates .lib and .exp files, which cannot be
            # suppressed by any linker switches. The .lib files may even be
            # needed! Make sure they are generated in the temporary build
            # directory. Since they have different names for debug and release
            # builds, they can go into the same directory.
            if export_symbols is not None:
                (dll_name, dll_ext) = os.path.splitext(
                    os.path.basename(output_filename))
                implib_file = os.path.join(
                    os.path.dirname(objects[0]),
                    self.library_filename(dll_name))
                ld_args.append ('/IMPLIB:' + implib_file)

            if extra_preargs:
                ld_args[:0] = extra_preargs
            if extra_postargs:
                ld_args.extend(extra_postargs)

            self.mkpath(os.path.dirname(output_filename))
            try:
                self.spawn([self.linker] + ld_args)
            except DistutilsExecError as msg:
                raise LinkError(msg)

        else:
            log.debug("skipping %s (up-to-date)", output_filename)


    # -- Miscellaneous methods -----------------------------------------
    # These are all used by the 'gen_lib_options() function, in
    # ccompiler.py.

    def library_dir_option(self, dir):
        return "/LIBPATH:" + dir

    def runtime_library_dir_option(self, dir):
        raise DistutilsPlatformError(
              "don't know how to set runtime library search path for MSVC++")

    def library_option(self, lib):
        return self.library_filename(lib)


    def find_library_file(self, dirs, lib, debug=0):
        # Prefer a debugging library if found (and requested), but deal
        # with it if we don't have one.
        if debug:
            try_names = [lib + "_d", lib]
        else:
            try_names = [lib]
        for dir in dirs:
            for name in try_names:
                libfile = os.path.join(dir, self.library_filename (name))
                if os.path.exists(libfile):
                    return libfile
        else:
            # Oops, didn't find it in *any* of 'dirs'
            return None

    # Helper methods for using the MSVC registry settings

    def find_exe(self, exe):
        """Return path to an MSVC executable program.

        Tries to find the program in several places: first, one of the
        MSVC program search paths from the registry; next, the directories
        in the PATH environment variable.  If any of those work, return an
        absolute path that is known to exist.  If none of them work, just
        return the original program name, 'exe'.
        """
        for p in self.__paths:
            fn = os.path.join(os.path.abspath(p), exe)
            if os.path.isfile(fn):
                return fn

        # didn't find it; try existing path
        for p in os.environ['Path'].split(';'):
            fn = os.path.join(os.path.abspath(p),exe)
            if os.path.isfile(fn):
                return fn

        return exe

    def get_msvc_paths(self, path, platform='x86'):
        """Get a list of devstudio directories (include, lib or path).

        Return a list of strings.  The list will be empty if unable to
        access the registry or appropriate registry keys not found.
        """
        if not _can_read_reg:
            return []

        path = path + " dirs"
        if self.__version >= 7:
            key = (r"%s\%0.1f\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directories"
                   % (self.__root, self.__version))
        else:
            key = (r"%s\6.0\Build System\Components\Platforms"
                   r"\Win32 (%s)\Directories" % (self.__root, platform))

        for base in HKEYS:
            d = read_values(base, key)
            if d:
                if self.__version >= 7:
                    return self.__macros.sub(d[path]).split(";")
                else:
                    return d[path].split(";")
        # MSVC 6 seems to create the registry entries we need only when
        # the GUI is run.
        if self.__version == 6:
            for base in HKEYS:
                if read_values(base, r"%s\6.0" % self.__root) is not None:
                    self.warn("It seems you have Visual Studio 6 installed, "
                        "but the expected registry settings are not present.\n"
                        "You must at least run the Visual Studio GUI once "
                        "so that these entries are created.")
                    break
        return []

    def set_path_env_var(self, name):
        """Set environment variable 'name' to an MSVC path type value.

        This is equivalent to a SET command prior to execution of spawned
        commands.
        """

        if name == "lib":
            p = self.get_msvc_paths("library")
        else:
            p = self.get_msvc_paths(name)
        if p:
            os.environ[name] = ';'.join(p)


if get_build_version() >= 8.0:
    log.debug("Importing new compiler from distutils.msvc9compiler")
    OldMSVCCompiler = MSVCCompiler
    from distutils.msvc9compiler import MSVCCompiler
    # get_build_architecture not really relevant now we support cross-compile
    from distutils.msvc9compiler import MacroExpander
distutils/cygwinccompiler.py000064400000040136151153537450012355 0ustar00"""distutils.cygwinccompiler

Provides the CygwinCCompiler class, a subclass of UnixCCompiler that
handles the Cygwin port of the GNU C compiler to Windows.  It also contains
the Mingw32CCompiler class which handles the mingw32 port of GCC (same as
cygwin in no-cygwin mode).
"""

# problems:
#
# * if you use a msvc compiled python version (1.5.2)
#   1. you have to insert a __GNUC__ section in its config.h
#   2. you have to generate an import library for its dll
#      - create a def-file for python??.dll
#      - create an import library using
#             dlltool --dllname python15.dll --def python15.def \
#                       --output-lib libpython15.a
#
#   see also http://starship.python.net/crew/kernr/mingw32/Notes.html
#
# * We put export_symbols in a def-file, and don't use
#   --export-all-symbols because it doesn't worked reliable in some
#   tested configurations. And because other windows compilers also
#   need their symbols specified this no serious problem.
#
# tested configurations:
#
# * cygwin gcc 2.91.57/ld 2.9.4/dllwrap 0.2.4 works
#   (after patching python's config.h and for C++ some other include files)
#   see also http://starship.python.net/crew/kernr/mingw32/Notes.html
# * mingw32 gcc 2.95.2/ld 2.9.4/dllwrap 0.2.4 works
#   (ld doesn't support -shared, so we use dllwrap)
# * cygwin gcc 2.95.2/ld 2.10.90/dllwrap 2.10.90 works now
#   - its dllwrap doesn't work, there is a bug in binutils 2.10.90
#     see also http://sources.redhat.com/ml/cygwin/2000-06/msg01274.html
#   - using gcc -mdll instead dllwrap doesn't work without -static because
#     it tries to link against dlls instead their import libraries. (If
#     it finds the dll first.)
#     By specifying -static we force ld to link against the import libraries,
#     this is windows standard and there are normally not the necessary symbols
#     in the dlls.
#   *** only the version of June 2000 shows these problems
# * cygwin gcc 3.2/ld 2.13.90 works
#   (ld supports -shared)
# * mingw gcc 3.2/ld 2.13 works
#   (ld supports -shared)

import os
import sys
import copy
from subprocess import Popen, PIPE, check_output
import re

from distutils.ccompiler import gen_preprocess_options, gen_lib_options
from distutils.unixccompiler import UnixCCompiler
from distutils.file_util import write_file
from distutils.errors import (DistutilsExecError, CCompilerError,
        CompileError, UnknownFileError)
from distutils import log
from distutils.version import LooseVersion
from distutils.spawn import find_executable

def get_msvcr():
    """Include the appropriate MSVC runtime library if Python was built
    with MSVC 7.0 or later.
    """
    msc_pos = sys.version.find('MSC v.')
    if msc_pos != -1:
        msc_ver = sys.version[msc_pos+6:msc_pos+10]
        if msc_ver == '1300':
            # MSVC 7.0
            return ['msvcr70']
        elif msc_ver == '1310':
            # MSVC 7.1
            return ['msvcr71']
        elif msc_ver == '1400':
            # VS2005 / MSVC 8.0
            return ['msvcr80']
        elif msc_ver == '1500':
            # VS2008 / MSVC 9.0
            return ['msvcr90']
        elif msc_ver == '1600':
            # VS2010 / MSVC 10.0
            return ['msvcr100']
        else:
            raise ValueError("Unknown MS Compiler version %s " % msc_ver)


class CygwinCCompiler(UnixCCompiler):
    """ Handles the Cygwin port of the GNU C compiler to Windows.
    """
    compiler_type = 'cygwin'
    obj_extension = ".o"
    static_lib_extension = ".a"
    shared_lib_extension = ".dll"
    static_lib_format = "lib%s%s"
    shared_lib_format = "%s%s"
    exe_extension = ".exe"

    def __init__(self, verbose=0, dry_run=0, force=0):

        UnixCCompiler.__init__(self, verbose, dry_run, force)

        status, details = check_config_h()
        self.debug_print("Python's GCC status: %s (details: %s)" %
                         (status, details))
        if status is not CONFIG_H_OK:
            self.warn(
                "Python's pyconfig.h doesn't seem to support your compiler. "
                "Reason: %s. "
                "Compiling may fail because of undefined preprocessor macros."
                % details)

        self.gcc_version, self.ld_version, self.dllwrap_version = \
            get_versions()
        self.debug_print(self.compiler_type + ": gcc %s, ld %s, dllwrap %s\n" %
                         (self.gcc_version,
                          self.ld_version,
                          self.dllwrap_version) )

        # ld_version >= "2.10.90" and < "2.13" should also be able to use
        # gcc -mdll instead of dllwrap
        # Older dllwraps had own version numbers, newer ones use the
        # same as the rest of binutils ( also ld )
        # dllwrap 2.10.90 is buggy
        if self.ld_version >= "2.10.90":
            self.linker_dll = "gcc"
        else:
            self.linker_dll = "dllwrap"

        # ld_version >= "2.13" support -shared so use it instead of
        # -mdll -static
        if self.ld_version >= "2.13":
            shared_option = "-shared"
        else:
            shared_option = "-mdll -static"

        # Hard-code GCC because that's what this is all about.
        # XXX optimization, warnings etc. should be customizable.
        self.set_executables(compiler='gcc -mcygwin -O -Wall',
                             compiler_so='gcc -mcygwin -mdll -O -Wall',
                             compiler_cxx='g++ -mcygwin -O -Wall',
                             linker_exe='gcc -mcygwin',
                             linker_so=('%s -mcygwin %s' %
                                        (self.linker_dll, shared_option)))

        # cygwin and mingw32 need different sets of libraries
        if self.gcc_version == "2.91.57":
            # cygwin shouldn't need msvcrt, but without the dlls will crash
            # (gcc version 2.91.57) -- perhaps something about initialization
            self.dll_libraries=["msvcrt"]
            self.warn(
                "Consider upgrading to a newer version of gcc")
        else:
            # Include the appropriate MSVC runtime library if Python was built
            # with MSVC 7.0 or later.
            self.dll_libraries = get_msvcr()

    def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
        """Compiles the source by spawning GCC and windres if needed."""
        if ext == '.rc' or ext == '.res':
            # gcc needs '.res' and '.rc' compiled to object files !!!
            try:
                self.spawn(["windres", "-i", src, "-o", obj])
            except DistutilsExecError as msg:
                raise CompileError(msg)
        else: # for other files use the C-compiler
            try:
                self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
                           extra_postargs)
            except DistutilsExecError as msg:
                raise CompileError(msg)

    def link(self, target_desc, objects, output_filename, output_dir=None,
             libraries=None, library_dirs=None, runtime_library_dirs=None,
             export_symbols=None, debug=0, extra_preargs=None,
             extra_postargs=None, build_temp=None, target_lang=None):
        """Link the objects."""
        # use separate copies, so we can modify the lists
        extra_preargs = copy.copy(extra_preargs or [])
        libraries = copy.copy(libraries or [])
        objects = copy.copy(objects or [])

        # Additional libraries
        libraries.extend(self.dll_libraries)

        # handle export symbols by creating a def-file
        # with executables this only works with gcc/ld as linker
        if ((export_symbols is not None) and
            (target_desc != self.EXECUTABLE or self.linker_dll == "gcc")):
            # (The linker doesn't do anything if output is up-to-date.
            # So it would probably better to check if we really need this,
            # but for this we had to insert some unchanged parts of
            # UnixCCompiler, and this is not what we want.)

            # we want to put some files in the same directory as the
            # object files are, build_temp doesn't help much
            # where are the object files
            temp_dir = os.path.dirname(objects[0])
            # name of dll to give the helper files the same base name
            (dll_name, dll_extension) = os.path.splitext(
                os.path.basename(output_filename))

            # generate the filenames for these files
            def_file = os.path.join(temp_dir, dll_name + ".def")
            lib_file = os.path.join(temp_dir, 'lib' + dll_name + ".a")

            # Generate .def file
            contents = [
                "LIBRARY %s" % os.path.basename(output_filename),
                "EXPORTS"]
            for sym in export_symbols:
                contents.append(sym)
            self.execute(write_file, (def_file, contents),
                         "writing %s" % def_file)

            # next add options for def-file and to creating import libraries

            # dllwrap uses different options than gcc/ld
            if self.linker_dll == "dllwrap":
                extra_preargs.extend(["--output-lib", lib_file])
                # for dllwrap we have to use a special option
                extra_preargs.extend(["--def", def_file])
            # we use gcc/ld here and can be sure ld is >= 2.9.10
            else:
                # doesn't work: bfd_close build\...\libfoo.a: Invalid operation
                #extra_preargs.extend(["-Wl,--out-implib,%s" % lib_file])
                # for gcc/ld the def-file is specified as any object files
                objects.append(def_file)

        #end: if ((export_symbols is not None) and
        #        (target_desc != self.EXECUTABLE or self.linker_dll == "gcc")):

        # who wants symbols and a many times larger output file
        # should explicitly switch the debug mode on
        # otherwise we let dllwrap/ld strip the output file
        # (On my machine: 10KiB < stripped_file < ??100KiB
        #   unstripped_file = stripped_file + XXX KiB
        #  ( XXX=254 for a typical python extension))
        if not debug:
            extra_preargs.append("-s")

        UnixCCompiler.link(self, target_desc, objects, output_filename,
                           output_dir, libraries, library_dirs,
                           runtime_library_dirs,
                           None, # export_symbols, we do this in our def-file
                           debug, extra_preargs, extra_postargs, build_temp,
                           target_lang)

    # -- Miscellaneous methods -----------------------------------------

    def object_filenames(self, source_filenames, strip_dir=0, output_dir=''):
        """Adds supports for rc and res files."""
        if output_dir is None:
            output_dir = ''
        obj_names = []
        for src_name in source_filenames:
            # use normcase to make sure '.rc' is really '.rc' and not '.RC'
            base, ext = os.path.splitext(os.path.normcase(src_name))
            if ext not in (self.src_extensions + ['.rc','.res']):
                raise UnknownFileError("unknown file type '%s' (from '%s')" % \
                      (ext, src_name))
            if strip_dir:
                base = os.path.basename (base)
            if ext in ('.res', '.rc'):
                # these need to be compiled to object files
                obj_names.append (os.path.join(output_dir,
                                              base + ext + self.obj_extension))
            else:
                obj_names.append (os.path.join(output_dir,
                                               base + self.obj_extension))
        return obj_names

# the same as cygwin plus some additional parameters
class Mingw32CCompiler(CygwinCCompiler):
    """ Handles the Mingw32 port of the GNU C compiler to Windows.
    """
    compiler_type = 'mingw32'

    def __init__(self, verbose=0, dry_run=0, force=0):

        CygwinCCompiler.__init__ (self, verbose, dry_run, force)

        # ld_version >= "2.13" support -shared so use it instead of
        # -mdll -static
        if self.ld_version >= "2.13":
            shared_option = "-shared"
        else:
            shared_option = "-mdll -static"

        # A real mingw32 doesn't need to specify a different entry point,
        # but cygwin 2.91.57 in no-cygwin-mode needs it.
        if self.gcc_version <= "2.91.57":
            entry_point = '--entry _DllMain@12'
        else:
            entry_point = ''

        if is_cygwingcc():
            raise CCompilerError(
                'Cygwin gcc cannot be used with --compiler=mingw32')

        self.set_executables(compiler='gcc -O -Wall',
                             compiler_so='gcc -mdll -O -Wall',
                             compiler_cxx='g++ -O -Wall',
                             linker_exe='gcc',
                             linker_so='%s %s %s'
                                        % (self.linker_dll, shared_option,
                                           entry_point))
        # Maybe we should also append -mthreads, but then the finished
        # dlls need another dll (mingwm10.dll see Mingw32 docs)
        # (-mthreads: Support thread-safe exception handling on `Mingw32')

        # no additional libraries needed
        self.dll_libraries=[]

        # Include the appropriate MSVC runtime library if Python was built
        # with MSVC 7.0 or later.
        self.dll_libraries = get_msvcr()

# Because these compilers aren't configured in Python's pyconfig.h file by
# default, we should at least warn the user if he is using an unmodified
# version.

CONFIG_H_OK = "ok"
CONFIG_H_NOTOK = "not ok"
CONFIG_H_UNCERTAIN = "uncertain"

def check_config_h():
    """Check if the current Python installation appears amenable to building
    extensions with GCC.

    Returns a tuple (status, details), where 'status' is one of the following
    constants:

    - CONFIG_H_OK: all is well, go ahead and compile
    - CONFIG_H_NOTOK: doesn't look good
    - CONFIG_H_UNCERTAIN: not sure -- unable to read pyconfig.h

    'details' is a human-readable string explaining the situation.

    Note there are two ways to conclude "OK": either 'sys.version' contains
    the string "GCC" (implying that this Python was built with GCC), or the
    installed "pyconfig.h" contains the string "__GNUC__".
    """

    # XXX since this function also checks sys.version, it's not strictly a
    # "pyconfig.h" check -- should probably be renamed...

    from distutils import sysconfig

    # if sys.version contains GCC then python was compiled with GCC, and the
    # pyconfig.h file should be OK
    if "GCC" in sys.version:
        return CONFIG_H_OK, "sys.version mentions 'GCC'"

    # let's see if __GNUC__ is mentioned in python.h
    fn = sysconfig.get_config_h_filename()
    try:
        config_h = open(fn)
        try:
            if "__GNUC__" in config_h.read():
                return CONFIG_H_OK, "'%s' mentions '__GNUC__'" % fn
            else:
                return CONFIG_H_NOTOK, "'%s' does not mention '__GNUC__'" % fn
        finally:
            config_h.close()
    except OSError as exc:
        return (CONFIG_H_UNCERTAIN,
                "couldn't read '%s': %s" % (fn, exc.strerror))

RE_VERSION = re.compile(br'(\d+\.\d+(\.\d+)*)')

def _find_exe_version(cmd):
    """Find the version of an executable by running `cmd` in the shell.

    If the command is not found, or the output does not match
    `RE_VERSION`, returns None.
    """
    executable = cmd.split()[0]
    if find_executable(executable) is None:
        return None
    out = Popen(cmd, shell=True, stdout=PIPE).stdout
    try:
        out_string = out.read()
    finally:
        out.close()
    result = RE_VERSION.search(out_string)
    if result is None:
        return None
    # LooseVersion works with strings
    # so we need to decode our bytes
    return LooseVersion(result.group(1).decode())

def get_versions():
    """ Try to find out the versions of gcc, ld and dllwrap.

    If not possible it returns None for it.
    """
    commands = ['gcc -dumpversion', 'ld -v', 'dllwrap --version']
    return tuple([_find_exe_version(cmd) for cmd in commands])

def is_cygwingcc():
    '''Try to determine if the gcc that would be used is from cygwin.'''
    out_string = check_output(['gcc', '-dumpmachine'])
    return out_string.strip().endswith(b'cygwin')
distutils/version.py000064400000030071151153537450010641 0ustar00#
# distutils/version.py
#
# Implements multiple version numbering conventions for the
# Python Module Distribution Utilities.
#
# $Id$
#

"""Provides classes to represent module version numbers (one class for
each style of version numbering).  There are currently two such classes
implemented: StrictVersion and LooseVersion.

Every version number class implements the following interface:
  * the 'parse' method takes a string and parses it to some internal
    representation; if the string is an invalid version number,
    'parse' raises a ValueError exception
  * the class constructor takes an optional string argument which,
    if supplied, is passed to 'parse'
  * __str__ reconstructs the string that was passed to 'parse' (or
    an equivalent string -- ie. one that will generate an equivalent
    version number instance)
  * __repr__ generates Python code to recreate the version number instance
  * _cmp compares the current instance with either another instance
    of the same class or a string (which will be parsed to an instance
    of the same class, thus must follow the same rules)
"""

import re

class Version:
    """Abstract base class for version numbering classes.  Just provides
    constructor (__init__) and reproducer (__repr__), because those
    seem to be the same for all version numbering classes; and route
    rich comparisons to _cmp.
    """

    def __init__ (self, vstring=None):
        if vstring:
            self.parse(vstring)

    def __repr__ (self):
        return "%s ('%s')" % (self.__class__.__name__, str(self))

    def __eq__(self, other):
        c = self._cmp(other)
        if c is NotImplemented:
            return c
        return c == 0

    def __lt__(self, other):
        c = self._cmp(other)
        if c is NotImplemented:
            return c
        return c < 0

    def __le__(self, other):
        c = self._cmp(other)
        if c is NotImplemented:
            return c
        return c <= 0

    def __gt__(self, other):
        c = self._cmp(other)
        if c is NotImplemented:
            return c
        return c > 0

    def __ge__(self, other):
        c = self._cmp(other)
        if c is NotImplemented:
            return c
        return c >= 0


# Interface for version-number classes -- must be implemented
# by the following classes (the concrete ones -- Version should
# be treated as an abstract class).
#    __init__ (string) - create and take same action as 'parse'
#                        (string parameter is optional)
#    parse (string)    - convert a string representation to whatever
#                        internal representation is appropriate for
#                        this style of version numbering
#    __str__ (self)    - convert back to a string; should be very similar
#                        (if not identical to) the string supplied to parse
#    __repr__ (self)   - generate Python code to recreate
#                        the instance
#    _cmp (self, other) - compare two version numbers ('other' may
#                        be an unparsed version string, or another
#                        instance of your version class)


class StrictVersion (Version):

    """Version numbering for anal retentives and software idealists.
    Implements the standard interface for version number classes as
    described above.  A version number consists of two or three
    dot-separated numeric components, with an optional "pre-release" tag
    on the end.  The pre-release tag consists of the letter 'a' or 'b'
    followed by a number.  If the numeric components of two version
    numbers are equal, then one with a pre-release tag will always
    be deemed earlier (lesser) than one without.

    The following are valid version numbers (shown in the order that
    would be obtained by sorting according to the supplied cmp function):

        0.4       0.4.0  (these two are equivalent)
        0.4.1
        0.5a1
        0.5b3
        0.5
        0.9.6
        1.0
        1.0.4a3
        1.0.4b1
        1.0.4

    The following are examples of invalid version numbers:

        1
        2.7.2.2
        1.3.a4
        1.3pl1
        1.3c4

    The rationale for this version numbering system will be explained
    in the distutils documentation.
    """

    version_re = re.compile(r'^(\d+) \. (\d+) (\. (\d+))? ([ab](\d+))?$',
                            re.VERBOSE | re.ASCII)


    def parse (self, vstring):
        match = self.version_re.match(vstring)
        if not match:
            raise ValueError("invalid version number '%s'" % vstring)

        (major, minor, patch, prerelease, prerelease_num) = \
            match.group(1, 2, 4, 5, 6)

        if patch:
            self.version = tuple(map(int, [major, minor, patch]))
        else:
            self.version = tuple(map(int, [major, minor])) + (0,)

        if prerelease:
            self.prerelease = (prerelease[0], int(prerelease_num))
        else:
            self.prerelease = None


    def __str__ (self):

        if self.version[2] == 0:
            vstring = '.'.join(map(str, self.version[0:2]))
        else:
            vstring = '.'.join(map(str, self.version))

        if self.prerelease:
            vstring = vstring + self.prerelease[0] + str(self.prerelease[1])

        return vstring


    def _cmp (self, other):
        if isinstance(other, str):
            other = StrictVersion(other)

        if self.version != other.version:
            # numeric versions don't match
            # prerelease stuff doesn't matter
            if self.version < other.version:
                return -1
            else:
                return 1

        # have to compare prerelease
        # case 1: neither has prerelease; they're equal
        # case 2: self has prerelease, other doesn't; other is greater
        # case 3: self doesn't have prerelease, other does: self is greater
        # case 4: both have prerelease: must compare them!

        if (not self.prerelease and not other.prerelease):
            return 0
        elif (self.prerelease and not other.prerelease):
            return -1
        elif (not self.prerelease and other.prerelease):
            return 1
        elif (self.prerelease and other.prerelease):
            if self.prerelease == other.prerelease:
                return 0
            elif self.prerelease < other.prerelease:
                return -1
            else:
                return 1
        else:
            assert False, "never get here"

# end class StrictVersion


# The rules according to Greg Stein:
# 1) a version number has 1 or more numbers separated by a period or by
#    sequences of letters. If only periods, then these are compared
#    left-to-right to determine an ordering.
# 2) sequences of letters are part of the tuple for comparison and are
#    compared lexicographically
# 3) recognize the numeric components may have leading zeroes
#
# The LooseVersion class below implements these rules: a version number
# string is split up into a tuple of integer and string components, and
# comparison is a simple tuple comparison.  This means that version
# numbers behave in a predictable and obvious way, but a way that might
# not necessarily be how people *want* version numbers to behave.  There
# wouldn't be a problem if people could stick to purely numeric version
# numbers: just split on period and compare the numbers as tuples.
# However, people insist on putting letters into their version numbers;
# the most common purpose seems to be:
#   - indicating a "pre-release" version
#     ('alpha', 'beta', 'a', 'b', 'pre', 'p')
#   - indicating a post-release patch ('p', 'pl', 'patch')
# but of course this can't cover all version number schemes, and there's
# no way to know what a programmer means without asking him.
#
# The problem is what to do with letters (and other non-numeric
# characters) in a version number.  The current implementation does the
# obvious and predictable thing: keep them as strings and compare
# lexically within a tuple comparison.  This has the desired effect if
# an appended letter sequence implies something "post-release":
# eg. "0.99" < "0.99pl14" < "1.0", and "5.001" < "5.001m" < "5.002".
#
# However, if letters in a version number imply a pre-release version,
# the "obvious" thing isn't correct.  Eg. you would expect that
# "1.5.1" < "1.5.2a2" < "1.5.2", but under the tuple/lexical comparison
# implemented here, this just isn't so.
#
# Two possible solutions come to mind.  The first is to tie the
# comparison algorithm to a particular set of semantic rules, as has
# been done in the StrictVersion class above.  This works great as long
# as everyone can go along with bondage and discipline.  Hopefully a
# (large) subset of Python module programmers will agree that the
# particular flavour of bondage and discipline provided by StrictVersion
# provides enough benefit to be worth using, and will submit their
# version numbering scheme to its domination.  The free-thinking
# anarchists in the lot will never give in, though, and something needs
# to be done to accommodate them.
#
# Perhaps a "moderately strict" version class could be implemented that
# lets almost anything slide (syntactically), and makes some heuristic
# assumptions about non-digits in version number strings.  This could
# sink into special-case-hell, though; if I was as talented and
# idiosyncratic as Larry Wall, I'd go ahead and implement a class that
# somehow knows that "1.2.1" < "1.2.2a2" < "1.2.2" < "1.2.2pl3", and is
# just as happy dealing with things like "2g6" and "1.13++".  I don't
# think I'm smart enough to do it right though.
#
# In any case, I've coded the test suite for this module (see
# ../test/test_version.py) specifically to fail on things like comparing
# "1.2a2" and "1.2".  That's not because the *code* is doing anything
# wrong, it's because the simple, obvious design doesn't match my
# complicated, hairy expectations for real-world version numbers.  It
# would be a snap to fix the test suite to say, "Yep, LooseVersion does
# the Right Thing" (ie. the code matches the conception).  But I'd rather
# have a conception that matches common notions about version numbers.

class LooseVersion (Version):

    """Version numbering for anarchists and software realists.
    Implements the standard interface for version number classes as
    described above.  A version number consists of a series of numbers,
    separated by either periods or strings of letters.  When comparing
    version numbers, the numeric components will be compared
    numerically, and the alphabetic components lexically.  The following
    are all valid version numbers, in no particular order:

        1.5.1
        1.5.2b2
        161
        3.10a
        8.02
        3.4j
        1996.07.12
        3.2.pl0
        3.1.1.6
        2g6
        11g
        0.960923
        2.2beta29
        1.13++
        5.5.kw
        2.0b1pl0

    In fact, there is no such thing as an invalid version number under
    this scheme; the rules for comparison are simple and predictable,
    but may not always give the results you want (for some definition
    of "want").
    """

    component_re = re.compile(r'(\d+ | [a-z]+ | \.)', re.VERBOSE)

    def __init__ (self, vstring=None):
        if vstring:
            self.parse(vstring)


    def parse (self, vstring):
        # I've given up on thinking I can reconstruct the version string
        # from the parsed tuple -- so I just store the string here for
        # use by __str__
        self.vstring = vstring
        components = [x for x in self.component_re.split(vstring)
                              if x and x != '.']
        for i, obj in enumerate(components):
            try:
                components[i] = int(obj)
            except ValueError:
                pass

        self.version = components


    def __str__ (self):
        return self.vstring


    def __repr__ (self):
        return "LooseVersion ('%s')" % str(self)


    def _cmp (self, other):
        if isinstance(other, str):
            other = LooseVersion(other)

        if self.version == other.version:
            return 0
        if self.version < other.version:
            return -1
        if self.version > other.version:
            return 1


# end class LooseVersion
distutils/__pycache__/extension.cpython-38.opt-1.pyc000064400000015415151153537450016422 0ustar00U

e5d)�@s.dZddlZddlZGdd�d�Zdd�ZdS)zmdistutils.extension

Provides the Extension class, used to describe C/C++ extension
modules in setup scripts.�Nc@s"eZdZdZddd�Zdd�ZdS)�	Extensiona�Just a collection of attributes that describes an extension
    module and everything needed to build it (hopefully in a portable
    way, but there are hooks that let you be as unportable as you need).

    Instance attributes:
      name : string
        the full name of the extension, including any packages -- ie.
        *not* a filename or pathname, but Python dotted name
      sources : [string]
        list of source filenames, relative to the distribution root
        (where the setup script lives), in Unix form (slash-separated)
        for portability.  Source files may be C, C++, SWIG (.i),
        platform-specific resource files, or whatever else is recognized
        by the "build_ext" command as source for a Python extension.
      include_dirs : [string]
        list of directories to search for C/C++ header files (in Unix
        form for portability)
      define_macros : [(name : string, value : string|None)]
        list of macros to define; each macro is defined using a 2-tuple,
        where 'value' is either the string to define it to or None to
        define it without a particular value (equivalent of "#define
        FOO" in source or -DFOO on Unix C compiler command line)
      undef_macros : [string]
        list of macros to undefine explicitly
      library_dirs : [string]
        list of directories to search for C/C++ libraries at link time
      libraries : [string]
        list of library names (not filenames or paths) to link against
      runtime_library_dirs : [string]
        list of directories to search for C/C++ libraries at run time
        (for shared extensions, this is when the extension is loaded)
      extra_objects : [string]
        list of extra files to link with (eg. object files not implied
        by 'sources', static library that must be explicitly specified,
        binary resource files, etc.)
      extra_compile_args : [string]
        any extra platform- and compiler-specific information to use
        when compiling the source files in 'sources'.  For platforms and
        compilers where "command line" makes sense, this is typically a
        list of command-line arguments, but for other platforms it could
        be anything.
      extra_link_args : [string]
        any extra platform- and compiler-specific information to use
        when linking object files together to create the extension (or
        to create a new static Python interpreter).  Similar
        interpretation as for 'extra_compile_args'.
      export_symbols : [string]
        list of symbols to be exported from a shared extension.  Not
        used on all platforms, and not generally necessary for Python
        extensions, which typically export exactly one symbol: "init" +
        extension_name.
      swig_opts : [string]
        any extra options to pass to SWIG if a source file has the .i
        extension.
      depends : [string]
        list of files that the extension depends on
      language : string
        extension language (i.e. "c", "c++", "objc"). Will be detected
        from the source extensions if not provided.
      optional : boolean
        specifies that a build failure in the extension should not abort the
        build process, but simply not install the failing extension.
    NcKst|t�std��t|t�r.tdd�|D��s6td��||_||_|pHg|_|pRg|_|p\g|_	|pfg|_
|ppg|_|pzg|_|	p�g|_
|
p�g|_|p�g|_|p�g|_|
p�g|_|p�g|_||_||_t|�dk�rdd�|D�}d�t|��}d	|}t�|�dS)
Nz'name' must be a stringcss|]}t|t�VqdS)N)�
isinstance�str)�.0�v�r�+/usr/lib64/python3.8/distutils/extension.py�	<genexpr>jsz%Extension.__init__.<locals>.<genexpr>z#'sources' must be a list of stringsrcSsg|]}t|��qSr)�repr)rZoptionrrr�
<listcomp>�sz&Extension.__init__.<locals>.<listcomp>z, zUnknown Extension options: %s)rr�AssertionError�list�all�name�sources�include_dirs�
define_macros�undef_macros�library_dirs�	libraries�runtime_library_dirs�
extra_objects�extra_compile_args�extra_link_args�export_symbols�	swig_opts�depends�language�optional�len�join�sorted�warnings�warn)�selfrrrrrrrrrrrrrrrr�kwZoptions�msgrrr�__init__Vs6

�











zExtension.__init__cCsd|jj|jj|jt|�fS)Nz<%s.%s(%r) at %#x>)�	__class__�
__module__�__qualname__r�id)r$rrr�__repr__�s�zExtension.__repr__)NNNNNNNNNNNNNN)�__name__r)r*�__doc__r'r,rrrrrs"C�
/rcCs�ddlm}m}m}ddlm}ddlm}||�}||dddddd�}�z^g}|�	�}	|	dkrd�q�|�
|	�rpqP|	d|	dkr�d	kr�nn|�d
|	�qP||	|�}	||	�}
|
d}t|g�}d}
|
dd�D�]�}|
dk	r�|
�
|�d}
q�tj�|�d}|dd�}|dd�}|dk�r2|j�
|�q�|d
k�rJ|j�
|�q�|dk�r�|�d�}|dk�rz|j�
|df�n$|j�
|d|�||dd�f�q�|dk�r�|j�
|�q�|dk�r�|j�
|�q�|dk�r�|j�
|�q�|dk�r|j�
|�q�|dk�r|j�
|�q�|dk�r*|j}
q�|dk�r<|j}
q�|dk�rN|j}
q�|dk�rr|j�
|�|�s�|j}
q�|dk�r�|j�
|�q�|�d|�q�|�
|�qPW5|��X|S)z3Reads a Setup file and returns Extension instances.r)�parse_makefile�expand_makefile_vars�_variable_rx)�TextFile)�split_quoted�)Zstrip_commentsZskip_blanksZ
join_linesZ	lstrip_wsZ	rstrip_wsN����*z'%s' lines not handled yet�)z.cz.ccz.cppz.cxxz.c++z.mz.mmz-Iz-D�=z-Uz-Cz-lz-Lz-Rz-rpathz-Xlinkerz
-Xcompilerz-u)z.az.soz.slz.oz.dylibzunrecognized argument '%s')Zdistutils.sysconfigr/r0r1Zdistutils.text_filer2Zdistutils.utilr3�close�readline�matchr#r�append�os�path�splitextrr�findrrrrrrrr)�filenamer/r0r1r2r3�vars�file�
extensions�lineZwords�moduleZextZappend_next_wordZword�suffixZswitch�valueZequalsrrr�read_setup_file�s��
 







�










rI)r.r=r"rrIrrrr�<module>szdistutils/__pycache__/core.cpython-38.pyc000064400000014730151153537450014376 0ustar00U

e5d�"�@s�dZddlZddlZddlmZddlTddlmZddlm	Z	ddl
mZddlm
Z
d	Zd
d�ZdadadZd
Zdd�Zddd�ZdS)a#distutils.core

The only module that needs to be imported to use the Distutils; provides
the 'setup' function (which is to be called from the setup script).  Also
indirectly provides the Distribution and Command classes, although they are
really defined in distutils.dist and distutils.cmd.
�N)�DEBUG)�*)�Distribution)�Command)�
PyPIRCCommand)�	Extensionz�usage: %(script)s [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: %(script)s --help [cmd1 cmd2 ...]
   or: %(script)s --help-commands
   or: %(script)s cmd --help
cCstj�|�}tt�S)N)�os�path�basename�USAGE�vars)�script_nameZscript�r�&/usr/lib64/python3.8/distutils/core.py�	gen_usage sr)�	distclassr
�script_argsZoptions�name�versionZauthorZauthor_emailZ
maintainerZmaintainer_emailZurl�licenseZdescriptionZlong_description�keywordsZ	platformsZclassifiersZdownload_urlZrequiresZprovidesZ	obsoletes)rZsourcesZinclude_dirsZ
define_macrosZundef_macrosZlibrary_dirsZ	librariesZruntime_library_dirsZ
extra_objectsZextra_compile_argsZextra_link_argsZ	swig_optsZexport_symbolsZdependsZlanguagec
Ks|�d�}|r|d=nt}d|kr8tj�tjd�|d<d|krRtjdd�|d<z||�a}WnLtk
r�}z.d|kr�t	d|��nt	d	|d|f��W5d}~XYnXt
d
kr�|S|��tr�t
d�|��t
dkr�|Sz|��}Wn:tk
�r*}zt	t|j�d
|��W5d}~XYnXt�rBt
d�|��t
dk�rP|S|�rz|��Wn�tk
�r�t	d��Yn�tk
�r�}z.t�r�tj�d|f��nt	d|f��W5d}~XYnBttfk
�r}zt�r�nt	dt|���W5d}~XYnX|S)a�The gateway to the Distutils: do everything your setup script needs
    to do, in a highly flexible and user-driven way.  Briefly: create a
    Distribution instance; find and parse config files; parse the command
    line; run each Distutils command found there, customized by the options
    supplied to 'setup()' (as keyword arguments), in config files, and on
    the command line.

    The Distribution instance might be an instance of a class supplied via
    the 'distclass' keyword argument to 'setup'; if no such class is
    supplied, then the Distribution class (in dist.py) is instantiated.
    All other arguments to 'setup' (except for 'cmdclass') are used to set
    attributes of the Distribution instance.

    The 'cmdclass' argument, if supplied, is a dictionary mapping command
    names to command classes.  Each command encountered on the command line
    will be turned into a command class, which is in turn instantiated; any
    class found in 'cmdclass' is used in place of the default, which is
    (for command 'foo_bar') class 'foo_bar' in module
    'distutils.command.foo_bar'.  The command class must provide a
    'user_options' attribute which is a list of option specifiers for
    'distutils.fancy_getopt'.  Any command-line options between the current
    and the next command are used to set attributes of the current command
    object.

    When the entire command-line has been successfully parsed, calls the
    'run()' method on each command object in turn.  This method will be
    driven entirely by the Distribution object (which each command object
    has a reference to, thanks to its constructor), and the
    command-specific options that became attributes of each command
    object.
    rr
rr�Nrzerror in setup command: %szerror in %s setup command: %s�initz%options (after parsing config files):�configz

error: %sz%options (after parsing command line):�commandlineZinterruptedz
error: %s
z	error: %szerror: )�getrrr	r
�sys�argv�_setup_distributionZDistutilsSetupError�
SystemExit�_setup_stop_afterZparse_config_filesr�printZdump_option_dictsZparse_command_lineZDistutilsArgErrorrr
Zrun_commands�KeyboardInterrupt�OSError�stderr�writeZDistutilsErrorZCCompilerError�str)�attrs�klassZdist�msg�ok�excrrr�setup9sd%

�(
�"r,�runc	Cs�|dkrtd|f��|atj��}d|i}zZzH|tjd<|dk	rP|tjdd�<t|d��}t|��|�W5QRXW5|t_daXWntk
r�YnXt	dkr�t
d|��t	S)	a.Run a setup script in a somewhat controlled environment, and
    return the Distribution instance that drives things.  This is useful
    if you need to find out the distribution meta-data (passed as
    keyword args from 'script' to 'setup()', or the contents of the
    config files or command-line.

    'script_name' is a file that will be read and run with 'exec()';
    'sys.argv[0]' will be replaced with 'script' for the duration of the
    call.  'script_args' is a list of strings; if supplied,
    'sys.argv[1:]' will be replaced by 'script_args' for the duration of
    the call.

    'stop_after' tells 'setup()' when to stop processing; possible
    values:
      init
        stop after the Distribution instance has been created and
        populated with the keyword arguments to 'setup()'
      config
        stop after config files have been parsed (and their data
        stored in the Distribution instance)
      commandline
        stop after the command-line ('sys.argv[1:]' or 'script_args')
        have been parsed (and the data stored in the Distribution)
      run [default]
        stop after all commands have been run (the same as if 'setup()'
        had been called in the usual way

    Returns the Distribution instance, which provides all information
    used to drive the Distutils.
    )rrrr-z"invalid value for 'stop_after': %r�__file__Nrr�rbzZ'distutils.core.setup()' was never called -- perhaps '%s' is not a Distutils setup script?)�
ValueErrorr rr�copy�open�exec�readrr�RuntimeError)r
rZ
stop_afterZ	save_argv�g�frrr�	run_setup�s*


�r8)Nr-)�__doc__rrZdistutils.debugrZdistutils.errorsZdistutils.distrZ
distutils.cmdrZdistutils.configrZdistutils.extensionrrrr rZsetup_keywordsZextension_keywordsr,r8rrrr�<module>s 	qdistutils/__pycache__/sysconfig.cpython-38.opt-1.pyc000064400000027556151153537450016423 0ustar00U

��.eP�@s�dZddlZddlZddlZddlZddlmZddlmZm	Z	ej
�ej�Z
ej
�ej�Zej
�ej�Zej
�ej�Zdejkr�ej
�ejd�Zn&ejr�ej
�ej
�ej��Zne��Zdd�Zeed	d�Zejd
kr�dd�Zee�Zee�Zd
d�Ze�Z dZ!ze �sej"Z!Wne#k
�r*YnXdd�Z$d-dd�Z%d.dd�Z&dd�Z'dd�Z(dd�Z)d/dd�Z*e�+d�Z,e�+d�Z-e�+d �Z.d0d!d"�Z/d#d$�Z0da1d%d&�Z2d'd(�Z3d)d*�Z4d+d,�Z5dS)1a�Provide access to Python's configuration information.  The specific
configuration variables available depend heavily on the platform and
configuration.  The values may be retrieved using
get_config_var(name), and the list of variables is available via
get_config_vars().keys().  Additional convenience functions are also
available.

Written by:   Fred L. Drake, Jr.
Email:        <fdrake@acm.org>
�N�)�DistutilsPlatformError)�get_platform�get_host_platformZ_PYTHON_PROJECT_BASEcCs,dD]"}tj�tj�|d|��rdSqdS)N)ZSetupzSetup.localZModulesTF)�os�path�isfile�join)�d�fn�r�+/usr/lib64/python3.8/distutils/sysconfig.py�_is_python_source_dir+sr�_home�ntcCs0|r,tj�|��tj�tj�td���r,tS|S)NZPCbuild)rr�normcase�
startswithr	�PREFIX)r
rrr
�_fix_pcbuild4s
�rcCstrtt�Stt�S)N)�	_sys_homer�project_baserrrr
�
_python_build<sr�cCsdtjdd�S)z�Return a string containing the major and minor Python version,
    leaving off the patchlevel.  Sample return values could be '1.5'
    or '2.2'.
    z%d.%dN�)�sys�version_inforrrr
�get_python_versionPsrcCs�|dkr|rtpt}tjdkrjtrL|r.tp,tStj�t	d�d�}tj�
|�Sdt�t}tj�|d|�Stjdkr�tr�tj�|d�tjj
tj�|d�Stj�|d�Std	tj��dS)
a�Return the directory containing installed Python header files.

    If 'plat_specific' is false (the default), this is the path to the
    non-platform-specific header files, i.e. Python.h and so on;
    otherwise, this is the path to platform-specific header files
    (namely pyconfig.h).

    If 'prefix' is supplied, use it instead of sys.base_prefix or
    sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
    N�posix�srcdirZInclude�pythonZincluder�PCzFI don't know where Python installs its C header files on platform '%s')�BASE_EXEC_PREFIX�BASE_PREFIXr�name�python_buildrrrr	�get_config_var�normpathr�build_flags�pathsepr)�
plat_specific�prefixZincdirZ
python_dirrrr
�get_python_incXs*

���r+cCs�|dkr&|r|rtpt}n|r"tp$t}tjdkrp|s8|r>d}nd}tj�||dt��}|r`|Stj�|d�Sn<tjdkr�|r�tj�|d�Stj�|dd�Snt	d	tj��dS)
aSReturn the directory containing the Python library (standard or
    site additions).

    If 'plat_specific' is true, return the directory containing
    platform-specific modules, i.e. any module from a non-pure-Python
    module distribution; otherwise, return the platform-shared library
    directory.  If 'standard_lib' is true, return the directory
    containing standard Python library modules; otherwise, return the
    directory for site-specific modules.

    If 'prefix' is supplied, use it instead of sys.base_prefix or
    sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
    Nr�lib64�librz
site-packagesrZLibz?I don't know where Python installs its library on platform '%s')
r!r"�EXEC_PREFIXrrr#rr	rr)r)�standard_libr*r-Z	libpythonrrr
�get_python_lib�s0
�
��r0c	Cs�|jdk�r�tjdkr8td�s8ddl}|�t�dtd<tddd	d
ddd
d�\}}}}}}}}	dtj	kr�tj	d}
tjdkr�dtj	kr�|�
|�r�|
|t|�d�}|
}dtj	kr�tj	d}dtj	kr�tj	d}dtj	kr�tj	d}n|d}dtj	k�r|dtj	d}d	tj	k�r<|dtj	d	}|dtj	d	}dtj	k�r~|dtj	d}|dtj	d}|dtj	d}d
tj	k�r�tj	d
}dtj	k�r�|dtj	d}n|d|	}|d|}
|j||
|
d|||||d�||_
dS)z�Do any platform-specific customization of a CCompiler instance.

    Mainly needed on Unix, so we can plug in the information that
    varies across Unices and is stored in Python's Makefile.
    Zunix�darwinZCUSTOMIZED_OSX_COMPILERrN�TrueZCCZCXX�CFLAGSZCCSHAREDZLDSHAREDZSHLIB_SUFFIXZARZARFLAGSZCPPz -E�LDFLAGS� �CPPFLAGS)Zpreprocessor�compilerZcompiler_soZcompiler_cxxZ	linker_soZ
linker_exe�archiver)Z
compiler_typer�platformr%�_osx_support�customize_compiler�_config_vars�get_config_varsr�environr�lenZset_executablesZshared_lib_extension)r7r:ZccZcxxZcflagsZccsharedZldsharedZshlib_suffixZarZar_flagsZnewccZcppr8Zcc_cmdrrr
r;�sn

��


��






�	r;cCsDtr,tjdkr"tj�tptd�}q6tp(t}n
tdd�}tj�|d�S)z2Return full pathname of installed pyconfig.h file.rr r�r)z
pyconfig-64.h)r$rr#rr	rrr+)Zinc_dirrrr
�get_config_h_filename�s


rAcCs\trtj�tptd�Stddd�}d�t�t	�}t
tjd�rL|dtjj
7}tj�||d�S)zAReturn full pathname of installed Makefile from the Python build.ZMakefilerr�r)r/zconfig-{}{}�
_multiarchz-%s)r$rrr	rrr0�formatrr'�hasattrr�implementationrC)Zlib_dirZconfig_filerrr
�get_makefile_filenamesrGcCs�|dkri}t�d�}t�d�}|��}|s.q�|�|�}|rx|�dd�\}}zt|�}Wntk
rlYnX|||<q |�|�}|r d||�d�<q |S)z�Parse a config.h-style file.

    A dictionary containing name/value pairs is returned.  If an
    optional dictionary is passed in as the second argument, it is
    used instead of a new dictionary.
    Nz"#define ([A-Z][A-Za-z0-9_]+) (.*)
z&/[*] #undef ([A-Z][A-Za-z0-9_]+) [*]/
rrr)�re�compile�readline�match�group�int�
ValueError)�fp�gZ	define_rxZundef_rx�line�m�n�vrrr
�parse_config_hs&




rUz"([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)z\$\(([A-Za-z][A-Za-z0-9_]*)\)z\${([A-Za-z][A-Za-z0-9_]*)}c	Cs�ddlm}||ddddd�}|dkr*i}i}i}|��}|dkrDq�t�|�}|r2|�dd�\}}	|	��}	|	�dd	�}
d
|
kr�|	||<q2zt|	�}	Wn$t	k
r�|	�dd
�||<Yq2X|	||<q2d}|�rtt
|�D�]�}||}
t�|
�p�t
�|
�}|�rj|�d�}d}||k�r$t||�}n�||k�r4d
}nx|tjk�rLtj|}n`||k�r�|�d��rz|dd�|k�rzd	}n$d||k�r�d
}nt|d|�}nd	||<}|�rp|
|��d�}|
d|���||}
d
|k�r�|
||<nzzt|
�}
Wn"t	k
�r|
��||<Yn
X|
||<||=|�d��rp|dd�|k�rp|dd�}||k�rp|
||<q�||=q�q�|��|��D]"\}}	t|	t��r�|	��||<�q�|�|�|S)z�Parse a Makefile-style file.

    A dictionary containing name/value pairs is returned.  If an
    optional dictionary is passed in as the second argument, it is
    used instead of a new dictionary.
    r)�TextFiler�surrogateescape)Zstrip_commentsZskip_blanksZ
join_lines�errorsNrz$$r�$)r3r4r6TFZPY_�)Zdistutils.text_filerVrJ�_variable_rxrKrL�strip�replacerMrN�list�_findvar1_rx�search�_findvar2_rx�strrr>r�end�start�close�items�
isinstance�update)rrPrVrOZdoneZnotdonerQrRrSrTZtmpvZrenamed_variablesr#�value�found�itemZafter�krrr
�parse_makefile/s�








�



rmcCsVt�|�pt�|�}|rR|��\}}|d|�|�|�d��||d�}qqRq|S)a�Expand Makefile-style variables -- "${foo}" or "$(foo)" -- in
    'string' according to 'vars' (a dictionary mapping variable names to
    values).  Variables not present in 'vars' are silently expanded to the
    empty string.  The variable values in 'vars' should not contain further
    variable expansions; if 'vars' is the output of 'parse_makefile()',
    you're fine.  Returns a variable-expanded version of 's'.
    rrN)r_r`ra�span�getrL)�s�varsrRZbegrcrrr
�expand_makefile_vars�s*rrc
CsVtj�ddjtjtjttjdd�d��}t	|t
�t�dgd�}|j}ia
t
�|�dS)	z7Initialize the module as appropriate for POSIX systems.Z_PYTHON_SYSCONFIGDATA_NAMEz+_sysconfigdata_{abi}_{platform}_{multiarch}rCr)Zabir9Z	multiarch�build_time_varsrN)rr>rorDr�abiflagsr9�getattrrF�
__import__�globals�localsrsr<rh)r#Z_temprsrrr
�_init_posix�s��rycCs~i}tddd�|d<tddd�|d<tdd�|d<t��d|d<d	|d
<t��dd�|d
<tj�tj�	t
j��|d<|adS)z+Initialize the module as appropriate for NTrrrBZLIBDESTZ
BINLIBDESTr@Z	INCLUDEPY�
EXT_SUFFIXz.exeZEXE�.rZVERSIONZBINDIRN)
r0r+�_imp�extension_suffixesrr]rr�dirname�abspathr�
executabler<)rPrrr
�_init_nt�sr�cGs\tdk�r*t��dtj�}|r(|�niattd<ttd<t�d�}|dk	rV|td<t�dt�}tjdkr�tr�tj	�
t��}tj	�||�}ntj	�
t��}tj	�
tj	�|��td<t�rtjdk�rt}tj	�td��s|t��k�rtj	�|td�}tj	�|�td<tjd	k�r*d
dl}|�t�|�rTg}|D]}|�t�|���q8|StSdS)a�With no arguments, return a dictionary of all configuration
    variables relevant for the current platform.  Generally this includes
    everything needed to build extensions and install both pure modules and
    extensions.  On Unix, this means every variable defined in Python's
    installed Makefile; on Windows it's a much smaller set.

    With arguments, return a list of values that result from looking up
    each argument in the configuration variable dictionary.
    NZ_init_r*�exec_prefixrz�SOrrr1r)r<rwrorr#rr.rr$rr~rGr	rr&�isabs�getcwdrr9r:Zcustomize_config_vars�append)�args�funcr�r�baser:Zvalsr#rrr
r=�sB



�
r=cCs*|dkrddl}|�dtd�t��|�S)z�Return the value of a single variable using the dictionary
    returned by 'get_config_vars()'.  Equivalent to
    get_config_vars().get(name)
    r�rNz SO is deprecated, use EXT_SUFFIXr)�warnings�warn�DeprecationWarningr=ro)r#r�rrr
r%!sr%)rN)rrN)N)N)6�__doc__r|rrHrrXr�utilrrrr&r*rr�r.�base_prefixr"�base_exec_prefixr!r>rrr�r~r�rrurr#rrr$r'rt�AttributeErrorrr+r0r;rArGrUrIr[r_rarmrrr<ryr�r=r%rrrr
�<module>s\



(
+I





jJdistutils/__pycache__/versionpredicate.cpython-38.opt-2.pyc000064400000005141151153537450017750 0ustar00U

e5d
�@s~ddlZddlZddlZe�dej�Ze�d�Ze�d�Zdd�Z	ej
ejejej
ejejd�ZGdd	�d	�Zdad
d�ZdS)�Nz'(?i)^\s*([a-z_]\w*(?:\.[a-z_]\w*)*)(.*)z^\s*\((.*)\)\s*$z%^\s*(<=|>=|<|>|!=|==)\s*([^\s,]+)\s*$cCs6t�|�}|std|��|��\}}|tj�|�fS)Nz"bad package restriction syntax: %r)�re_splitComparison�match�
ValueError�groups�	distutils�version�
StrictVersion)�pred�res�compZverStr�r�2/usr/lib64/python3.8/distutils/versionpredicate.py�splitUps

r)�<z<=z==�>z>=z!=c@s$eZdZdd�Zdd�Zdd�ZdS)�VersionPredicatecCs�|��}|std��t�|�}|s.td|��|��\|_}|��}|r�t�|�}|sbtd|��|��d}dd�|�d�D�|_|js�td|��ng|_dS)	Nzempty package restrictionzbad package name in %rzexpected parenthesized list: %rrcSsg|]}t|��qSr)r)�.0ZaPredrrr
�
<listcomp>tsz-VersionPredicate.__init__.<locals>.<listcomp>�,zempty parenthesized list in %r)	�stripr�re_validPackagerr�name�re_paren�splitr	)�selfZversionPredicateStrrZparen�strrrr
�__init__`s&

�zVersionPredicate.__init__cCs8|jr.dd�|jD�}|jdd�|�dS|jSdS)NcSs g|]\}}|dt|��qS)� )r)r�cond�verrrr
r}sz,VersionPredicate.__str__.<locals>.<listcomp>z (z, �))r	r�join)r�seqrrr
�__str__{szVersionPredicate.__str__cCs(|jD]\}}t|||�sdSqdS)NFT)r	�compmap)rrrrrrr
�satisfied_by�szVersionPredicate.satisfied_byN)�__name__�
__module__�__qualname__rr#r%rrrr
rsArcCsdtdkrt�dtj�a|��}t�|�}|s8td|��|�d�pDd}|rVtj	�
|�}|�d�|fS)Nz=([a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*)(?:\s*\(\s*([^)\s]+)\s*\))?$z"illegal provides specification: %r��)�
_provision_rx�re�compile�ASCIIrrr�grouprrr)�value�mrrrr
�split_provision�s�
r2)r,Zdistutils.versionr�operatorr-r.rrrr�lt�le�eq�gt�ge�ner$rr+r2rrrr
�<module>s �

�ndistutils/__pycache__/versionpredicate.cpython-38.opt-1.pyc000064400000012021151153537450017742 0ustar00U

e5d
�@s�dZddlZddlZddlZe�dej�Ze�d�Ze�d�Z	dd�Z
ejejej
ejejejd�ZGd	d
�d
�Zdadd�ZdS)
zBModule for parsing and testing package version predicate strings.
�Nz'(?i)^\s*([a-z_]\w*(?:\.[a-z_]\w*)*)(.*)z^\s*\((.*)\)\s*$z%^\s*(<=|>=|<|>|!=|==)\s*([^\s,]+)\s*$cCs6t�|�}|std|��|��\}}|tj�|�fS)zVParse a single version comparison.

    Return (comparison string, StrictVersion)
    z"bad package restriction syntax: %r)�re_splitComparison�match�
ValueError�groups�	distutils�version�
StrictVersion)�pred�res�compZverStr�r�2/usr/lib64/python3.8/distutils/versionpredicate.py�splitUps

r)�<z<=z==�>z>=z!=c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�VersionPredicatea�Parse and test package version predicates.

    >>> v = VersionPredicate('pyepat.abc (>1.0, <3333.3a1, !=1555.1b3)')

    The `name` attribute provides the full dotted name that is given::

    >>> v.name
    'pyepat.abc'

    The str() of a `VersionPredicate` provides a normalized
    human-readable version of the expression::

    >>> print(v)
    pyepat.abc (> 1.0, < 3333.3a1, != 1555.1b3)

    The `satisfied_by()` method can be used to determine with a given
    version number is included in the set described by the version
    restrictions::

    >>> v.satisfied_by('1.1')
    True
    >>> v.satisfied_by('1.4')
    True
    >>> v.satisfied_by('1.0')
    False
    >>> v.satisfied_by('4444.4')
    False
    >>> v.satisfied_by('1555.1b3')
    False

    `VersionPredicate` is flexible in accepting extra whitespace::

    >>> v = VersionPredicate(' pat( ==  0.1  )  ')
    >>> v.name
    'pat'
    >>> v.satisfied_by('0.1')
    True
    >>> v.satisfied_by('0.2')
    False

    If any version numbers passed in do not conform to the
    restrictions of `StrictVersion`, a `ValueError` is raised::

    >>> v = VersionPredicate('p1.p2.p3.p4(>=1.0, <=1.3a1, !=1.2zb3)')
    Traceback (most recent call last):
      ...
    ValueError: invalid version number '1.2zb3'

    It the module or package name given does not conform to what's
    allowed as a legal module or package name, `ValueError` is
    raised::

    >>> v = VersionPredicate('foo-bar')
    Traceback (most recent call last):
      ...
    ValueError: expected parenthesized list: '-bar'

    >>> v = VersionPredicate('foo bar (12.21)')
    Traceback (most recent call last):
      ...
    ValueError: expected parenthesized list: 'bar (12.21)'

    cCs�|��}|std��t�|�}|s.td|��|��\|_}|��}|r�t�|�}|sbtd|��|��d}dd�|�d�D�|_|js�td|��ng|_d	S)
z*Parse a version predicate string.
        zempty package restrictionzbad package name in %rzexpected parenthesized list: %rrcSsg|]}t|��qSr)r)�.0ZaPredrrr
�
<listcomp>tsz-VersionPredicate.__init__.<locals>.<listcomp>�,zempty parenthesized list in %rN)	�stripr�re_validPackagerr�name�re_paren�splitr	)�selfZversionPredicateStrrZparen�strrrr
�__init__`s&

�zVersionPredicate.__init__cCs8|jr.dd�|jD�}|jdd�|�dS|jSdS)NcSs g|]\}}|dt|��qS)� )r)r�cond�verrrr
r}sz,VersionPredicate.__str__.<locals>.<listcomp>z (z, �))r	r�join)r�seqrrr
�__str__{szVersionPredicate.__str__cCs(|jD]\}}t|||�sdSqdS)z�True if version is compatible with all the predicates in self.
        The parameter version must be acceptable to the StrictVersion
        constructor.  It may be either a string or StrictVersion.
        FT)r	�compmap)rrrrrrr
�satisfied_by�szVersionPredicate.satisfied_byN)�__name__�
__module__�__qualname__�__doc__rr#r%rrrr
rs@rcCsdtdkrt�dtj�a|��}t�|�}|s8td|��|�d�pDd}|rVtj	�
|�}|�d�|fS)a9Return the name and optional version number of a provision.

    The version number, if given, will be returned as a `StrictVersion`
    instance, otherwise it will be `None`.

    >>> split_provision('mypkg')
    ('mypkg', None)
    >>> split_provision(' mypkg( 1.2 ) ')
    ('mypkg', StrictVersion ('1.2'))
    Nz=([a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*)(?:\s*\(\s*([^)\s]+)\s*\))?$z"illegal provides specification: %r��)�
_provision_rx�re�compile�ASCIIrrr�grouprrr)�value�mrrrr
�split_provision�s�
r3)r)r-Zdistutils.versionr�operatorr.r/rrrr�lt�le�eq�gt�ge�ner$rr,r3rrrr
�<module>s"�

�ndistutils/__pycache__/unixccompiler.cpython-38.opt-1.pyc000064400000015512151153537450017265 0ustar00U

&�.e�;�@s�dZddlZddlZddlZddlmZddlmZddlm	Z	m
Z
mZddlm
Z
mZmZmZddlmZejdkr~ddlZGd	d
�d
e	�ZdS)a9distutils.unixccompiler

Contains the UnixCCompiler class, a subclass of CCompiler that handles
the "typical" Unix-style command-line C compiler:
  * macros defined with -Dname[=value]
  * macros undefined with -Uname
  * include search directories specified with -Idir
  * libraries specified with -lllib
  * library search directories specified with -Ldir
  * compile handled by 'cc' (or similar) executable with -c option:
    compiles .c to .o
  * link static library handled by 'ar' command (possibly with 'ranlib')
  * link shared library handled by 'cc -shared'
�N)�	sysconfig)�newer)�	CCompiler�gen_preprocess_options�gen_lib_options)�DistutilsExecError�CompileError�LibError�	LinkError)�log�darwinc
s�eZdZdZddgdgdgddgdgddgdd�Zejdd�d	krNd
ged
<ddd
dddgZdZdZ	dZ
dZdZdZ
ZZeZejdkr�dZ�fdd�Zd.dd�Zdd�Zd/d d!�Zd0d"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd1d,d-�Z�ZS)2�
UnixCCompilerZunixNZccz-sharedZarz-cr)�preprocessor�compiler�compiler_so�compiler_cxx�	linker_so�
linker_exe�archiver�ranlib�rrz.cz.Cz.ccz.cxxz.cppz.mz.oz.az.soz.dylibz.tbdzlib%s%s�cygwinz.execs@t��|||�\}}}t�d�}|r6||kr6|�|�|||fS)z'Remove standard library path from rpathZLIBDIR)�super�
_fix_lib_argsr�get_config_var�remove)�self�	libraries�library_dirs�runtime_library_dirsZlibdir��	__class__��//usr/lib64/python3.8/distutils/unixccompiler.pyrUs�


zUnixCCompiler._fix_lib_argsc
Cs�|�d||�}|\}}}t||�}	|j|	}
|r>|
�d|g�|rN||
dd�<|r\|
�|�|
�|�|js~|dks~t||�r�|r�|�tj	�
|��z|�|
�Wn*tk
r�}zt
|��W5d}~XYnXdS)N�-or)Z_fix_compile_argsrr�extend�appendZforcer�mkpath�os�path�dirname�spawnrr)r�sourceZoutput_fileZmacrosZinclude_dirs�
extra_preargs�extra_postargs�
fixed_args�ignore�pp_optsZpp_args�msgr"r"r#�
preprocess^s$




zUnixCCompiler.preprocessc	
Csp|j}tjdkr t�|||�}z |�|||d|g|�Wn*tk
rj}zt|��W5d}~XYnXdS)Nrr$)r�sys�platform�_osx_support�compiler_fixupr+rr)	r�obj�srcZextZcc_argsr.r1rr2r"r"r#�_compilexs
��
zUnixCCompiler._compilerc
Cs�|�||�\}}|j||d�}|�||�r�|�tj�|��|�|j|g||j	�|j
r�z|�|j
|g�Wq�tk
r�}zt|��W5d}~XYq�Xnt
�d|�dS)N)�
output_dir�skipping %s (up-to-date))�_fix_object_args�library_filename�
_need_linkr'r(r)r*r+r�objectsrrr	r�debug)rr@Zoutput_libnamer;rA�target_lang�output_filenamer2r"r"r#�create_static_lib�s$����	zUnixCCompiler.create_static_libc
Cs�|�||�\}}|�|||�}|\}}}t||||�}t|ttd�f�sPtd��|dk	rftj�	||�}|�
||��r�||j|d|g}|	r�dg|dd�<|
r�|
|dd�<|r�|�|�|�
tj�|��z�|tjkr�|jdd�}n|jdd�}|
dk�rr|j�rrd}tj�|d�dk�r@d}d||k�r@|d7}�q&tj�||�d	k�r\d}nd}|j||||<tjd
k�r�t�||�}|�||�Wn,tk
�r�}zt|��W5d}~XYnXnt�d|�dS)Nz%'output_dir' must be a string or Noner$z-grzc++�env��=Z	ld_so_aixrr<)r=rr�
isinstance�str�type�	TypeErrorr(r)�joinr?r@r%r'r*rZ
EXECUTABLErrr�basenamer4r5r6r7r+rr
rrA)rZtarget_descr@rCr;rrrZexport_symbolsrAr-r.Z
build_temprBr/Zlib_optsZld_argsZlinker�i�offsetr2r"r"r#�link�sZ�
���

zUnixCCompiler.linkcCsd|S)N�-Lr")r�dirr"r"r#�library_dir_option�sz UnixCCompiler.library_dir_optioncCsd|kpd|kS)NZgcczg++r")rZ
compiler_namer"r"r#�_is_gcc�szUnixCCompiler._is_gcccCs�tj�t�d��}tjdd�dkr,d|Stjdd�dkrFd|Stjdd�d	krz|�|�rnd
d|gSdd|gS|�|�r�t�d�d
kr�d|Sd|Snd|SdS)N�CCrrrQ�Zfreebsdz-Wl,-rpath=�zhp-uxz-Wl,+sz+sZGNULDZyesz-Wl,--enable-new-dtags,-Rz-Wl,-Rz-R)r(r)rMrrr4r5rT)rrRrr"r"r#�runtime_library_dir_option�s


z(UnixCCompiler.runtime_library_dir_optioncCsd|S)Nz-lr")r�libr"r"r#�library_optionszUnixCCompiler.library_optioncCs�|j|dd�}|j|dd�}|j|dd�}|j|dd�}tjdkr|t�d�}t�d|�}	|	dkrrt�t�d	��}
n
|	�	d
�}
|D�] }t
j�||�}t
j�||�}
t
j�||�}t
j�||�}tjdk�rL|�
d�s�|�
d��rL|�
d
��sLt
j�|
|d
d�|�}t
j�|
|d
d�|�}
t
j�|
|d
d�|�}t
j�|
|d
d�|�}t
j�|
��rb|
St
j�|��rx|St
j�|��r�|St
j�|�r�|Sq�dS)N�shared)Zlib_type�dylib�
xcode_stub�staticrZCFLAGSz-isysroot\s*(\S+)rUrFz/System/z/usr/z/usr/local/)r>r4r5rr�re�searchr6Z_default_sysroot�groupr(r)rL�
startswith�exists)r�dirsrYrAZshared_fZdylib_fZxcode_stub_fZstatic_fZcflags�mZsysrootrRr[r\r^r]r"r"r#�find_library_filesF



���
zUnixCCompiler.find_library_file)NNNNN)NrN)
NNNNNrNNNN)r)�__name__�
__module__�__qualname__Z
compiler_typeZexecutablesr4r5Zsrc_extensionsZ
obj_extensionZstatic_lib_extensionZshared_lib_extensionZdylib_lib_extensionZxcode_stub_lib_extensionZstatic_lib_formatZshared_lib_formatZdylib_lib_formatZxcode_stub_lib_formatZ
exe_extensionrr3r:rDrPrSrTrXrZrf�
__classcell__r"r"r r#r
-sb�


	�
�
�
B*r
)�__doc__r(r4r_Z	distutilsrZdistutils.dep_utilrZdistutils.ccompilerrrrZdistutils.errorsrrr	r
rr5r6r
r"r"r"r#�<module>s
distutils/__pycache__/spawn.cpython-38.opt-2.pyc000064400000007334151153537450015540 0ustar00U

e5d��@s~ddlZddlZddlmZmZddlmZddlmZddd�Z	dd	�Z
dd
d�Zejdkrfda
dadd
d�Zddd�ZdS)�N)�DistutilsPlatformError�DistutilsExecError)�DEBUG)�log�cCsNt|�}tjdkr"t|||d�n(tjdkr<t|||d�ntdtj��dS)N�posix)�dry_run�ntz1don't know how to spawn programs on platform '%s')�list�os�name�_spawn_posix�	_spawn_ntr)�cmd�search_path�verboser�r�'/usr/lib64/python3.8/distutils/spawn.py�spawns

�rcCs*t|�D]\}}d|krd|||<q|S)N� z"%s")�	enumerate)�args�i�argrrr�_nt_quote_args+src
Cs�|d}t|�}|r t|�p|}t�d�|g|dd���|s�zt�tj||�}Wn@tk
r�}z"t	sp|}t
d||jdf��W5d}~XYnX|dkr�t	s�|}t
d||f��dS)Nrrr�command %r failed: %s����%command %r failed with exit status %d)r�find_executabler�info�joinr�spawnv�P_WAIT�OSErrorrrr)rrrr�
executableZrc�excrrrr;s(�
�r�darwinc
Cs|t�d�|��|rdS|d}|r*tjp.tj}d}tjdkr�tdkrxddl	m
}|�d�p^datrxdd�t�d	�D�a
tr�tj�dt�}t
d
d�|�d	�D�kr�d|tf}	t|	��ttj|d�}|r�tjp�tj}t��}
|
dk�r�z$|dkr�|||�n||||�WnNtk
�rX}z.t�s(|}tj�d
||jf�t�d�W5d}~XYnXt�sd|}tj�d|�t�d�n�zt�|
d�\}
}WnDtk
�r�}
z$t�s�|}td||
jdf��W5d}
~
XYnXt�|��rt�s�|}td|t�|�f��nlt� |��rHt�!|�}|dk�r,dSt�s6|}td||f��n,t�"|��rZ�q�nt�sd|}td||f���q�dS)Nrrr&)�	sysconfig�MACOSX_DEPLOYMENT_TARGET�cSsg|]}t|��qSr��int��.0�xrrr�
<listcomp>esz _spawn_posix.<locals>.<listcomp>�.cSsg|]}t|��qSrr*r,rrrr/kszF$MACOSX_DEPLOYMENT_TARGET mismatch: now "%s" but "%s" during configure)r(zunable to execute %r: %s
rz(unable to execute %r for unknown reasonsrrz"command %r terminated by signal %drz1unknown error executing %r: termination status %d)#rrr r�execvp�execv�sys�platform�_cfg_target�	distutilsr'Zget_config_var�split�_cfg_target_split�environ�getr�dict�execvpe�execve�forkr#r�stderr�write�strerror�_exit�waitpidrr�WIFSIGNALED�WTERMSIG�	WIFEXITED�WEXITSTATUS�
WIFSTOPPED)rrrrr$Zexec_fn�envr'Z
cur_targetZmy_msg�pid�eZstatusr%Zexit_statusrrrr
Ws�
����
����

����r
c	Cs�tj�|�\}}tjdkr*|dkr*|d}tj�|�r:|S|dkr�tj�dd�}|dkr�zt�d�}Wnt	t
fk
r�tj}YnX|s�dS|�tj
�}|D]&}tj�||�}tj�|�r�|Sq�dS)NZwin32z.exe�PATH�CS_PATH)r�path�splitextr3r4�isfiler9r:�confstr�AttributeError�
ValueError�defpathr7�pathsepr )r$rN�_Zext�paths�p�frrrr�s(
r)rrr)rrr)rrr)N)r3rZdistutils.errorsrrZdistutils.debugrr6rrrrr4r5r8r
rrrrr�<module>	s



Rdistutils/__pycache__/filelist.cpython-38.opt-1.pyc000064400000023063151153537450016217 0ustar00U

e5d 2�@s�dZddlZddlZddlZddlZddlmZddlmZm	Z	ddl
mZGdd�d�Zdd	�Z
ejfd
d�Zdd
�Zddd�ZdS)zsdistutils.filelist

Provides the FileList class, used for poking about the filesystem
and building lists of files.
�N��convert_path)�DistutilsTemplateError�DistutilsInternalError)�logc@s|eZdZdZddd�Zdd�Zejfdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zddd�Zddd�ZdS) �FileLista�A list of files built by on exploring the filesystem and filtered by
    applying various patterns to what we find there.

    Instance attributes:
      dir
        directory from which files will be taken -- only used if
        'allfiles' not supplied to constructor
      files
        list of filenames currently being built/filtered/manipulated
      allfiles
        complete list of files under consideration (ie. without any
        filtering applied)
    NcCsd|_g|_dS�N)�allfiles�files)�self�warn�debug_print�r�*/usr/lib64/python3.8/distutils/filelist.py�__init__szFileList.__init__cCs
||_dSr)r	)rr	rrr�set_allfiles#szFileList.set_allfilescCst|�|_dSr)�findallr	)r�dirrrrr&szFileList.findallcCsddlm}|rt|�dS)z~Print 'msg' to stdout if the global DEBUG (taken from the
        DISTUTILS_DEBUG environment variable) flag is true.
        r)�DEBUGN)Zdistutils.debugr�print)r�msgrrrrr
)szFileList.debug_printcCs|j�|�dSr)r
�append)r�itemrrrr3szFileList.appendcCs|j�|�dSr)r
�extend)r�itemsrrrr6szFileList.extendcCs<tttjj|j��}g|_|D]}|j�tjj|��qdSr)�sorted�map�os�path�splitr
r�join)rZsortable_filesZ
sort_tuplerrr�sort9sz
FileList.sortcCs@tt|j�ddd�D]$}|j||j|dkr|j|=qdS)N�r���)�range�lenr
)r�irrr�remove_duplicatesCszFileList.remove_duplicatescCs�|��}|d}d}}}|dkrTt|�dkr<td|��dd�|dd�D�}n~|dkr�t|�d	krttd
|��t|d�}dd�|dd�D�}n:|dkr�t|�dkr�td
|��t|d�}ntd|��||||fS)Nr)�include�exclude�global-include�global-exclude�z&'%s' expects <pattern1> <pattern2> ...cSsg|]}t|��qSrr��.0�wrrr�
<listcomp>Wsz1FileList._parse_template_line.<locals>.<listcomp>r")�recursive-include�recursive-exclude�z,'%s' expects <dir> <pattern1> <pattern2> ...cSsg|]}t|��qSrrr-rrrr0]s)�graft�prunez#'%s' expects a single <dir_pattern>zunknown action '%s')rr%rr)r�lineZwords�action�patternsr�dir_patternrrr�_parse_template_lineLs0���zFileList._parse_template_linecCs@|�|�\}}}}|dkrV|�dd�|��|D]}|j|dd�s2t�d|�q2�n�|dkr�|�dd�|��|D]}|j|dd�svt�d	|�qv�n�|d
kr�|�dd�|��|D]}|j|dd�s�t�d
|�q��n^|dk�r(|�dd�|��|D]"}|j|dd��st�d|��q�n|dk�rv|�d|d�|�f�|D]$}|j||d��sNt�d||��qNn�|dk�r�|�d|d�|�f�|D]$}|j||d��s�t�d||��q�nx|dk�r�|�d|�|jd|d��s<t�d|�nB|dk�r0|�d|�|jd|d��s<t�d|�ntd|��dS)Nr(zinclude � r")�anchorz%warning: no files found matching '%s'r)zexclude z9warning: no previously-included files found matching '%s'r*zglobal-include rz>warning: no files found matching '%s' anywhere in distributionr+zglobal-exclude zRwarning: no previously-included files matching '%s' found anywhere in distributionr1zrecursive-include %s %s)�prefixz:warning: no files found matching '%s' under directory '%s'r2zrecursive-exclude %s %szNwarning: no previously-included files matching '%s' found under directory '%s'r4zgraft z+warning: no directories found matching '%s'r5zprune z6no previously-included directories found matching '%s'z'this cannot happen: invalid action '%s')r:r
r �include_patternrr�exclude_patternr)rr6r7r8rr9�patternrrr�process_template_linehs��
�
�

�
��

��

�
��zFileList.process_template_liner"rcCsld}t||||�}|�d|j�|jdkr4|��|jD],}|�|�r:|�d|�|j�|�d}q:|S)a�Select strings (presumably filenames) from 'self.files' that
        match 'pattern', a Unix-style wildcard (glob) pattern.  Patterns
        are not quite the same as implemented by the 'fnmatch' module: '*'
        and '?'  match non-special characters, where "special" is platform-
        dependent: slash on Unix; colon, slash, and backslash on
        DOS/Windows; and colon on Mac OS.

        If 'anchor' is true (the default), then the pattern match is more
        stringent: "*.py" will match "foo.py" but not "foo/bar.py".  If
        'anchor' is false, both of these will match.

        If 'prefix' is supplied, then only filenames starting with 'prefix'
        (itself a pattern) and ending with 'pattern', with anything in between
        them, will match.  'anchor' is ignored in this case.

        If 'is_regex' is true, 'anchor' and 'prefix' are ignored, and
        'pattern' is assumed to be either a string containing a regex or a
        regex object -- no translation is done, the regex is just compiled
        and used as-is.

        Selected strings will be added to self.files.

        Return True if files are found, False otherwise.
        Fz%include_pattern: applying regex r'%s'Nz adding T)�translate_patternr
r@r	r�searchr
r)rr@r<r=�is_regex�files_found�
pattern_re�namerrrr>�s�


zFileList.include_patterncCsrd}t||||�}|�d|j�tt|j�ddd�D]4}|�|j|�r8|�d|j|�|j|=d}q8|S)aRemove strings (presumably filenames) from 'files' that match
        'pattern'.  Other parameters are the same as for
        'include_pattern()', above.
        The list 'self.files' is modified in place.
        Return True if files are found, False otherwise.
        Fz%exclude_pattern: applying regex r'%s'r"r#z
 removing T)rBr
r@r$r%r
rC)rr@r<r=rDrErFr&rrrr?�s�zFileList.exclude_pattern)NN)r"Nr)r"Nr)�__name__�
__module__�__qualname__�__doc__rrr�curdirrr
rrr!r'r:rAr>r?rrrrrs 


	L
,�rcCs&dd�tj|dd�D�}ttjj|�S)z%
    Find all files under 'path'
    css,|]$\}}}|D]}tj�||�VqqdSr)rrr )r.�base�dirsr
�filerrr�	<genexpr>�s�z#_find_all_simple.<locals>.<genexpr>T)�followlinks)r�walk�filterr�isfile)rZresultsrrr�_find_all_simple�s�rUcCs6t|�}|tjkr.tjtjj|d�}t||�}t|�S)z�
    Find all files under 'dir' and return the list of full filenames.
    Unless dir is '.', return full filenames with dir prepended.
    )�start)	rUrrL�	functools�partialr�relpathr�list)rr
Zmake_relrrrrs


rcCs8t�|�}tj}tjdkrd}d|}t�d||�}|S)z�Translate a shell-like glob pattern to a regular expression; return
    a string containing the regex.  Differs from 'fnmatch.translate()' in
    that '*' does not match "special characters" (which are
    platform-specific).
    �\z\\\\z\1[^%s]z((?<!\\)(\\\\)*)\.)�fnmatch�	translater�sep�re�sub)r@rFr^Zescapedrrr�
glob_to_res

rar"c
Cs�|rt|t�rt�|�S|Std��d�\}}}|r>t|�}nd}|dk	r�t|�}|t|�t|�t|��}tj}	tjdkr�d}	|t|�t|�t|��}d|||	||f}n|r�d||t|�d�f}t�|�S)aTranslate a shell-like wildcard pattern to a compiled regular
    expression.  Return the compiled regex.  If 'is_regex' true,
    then 'pattern' is directly compiled to a regex (if it's a string)
    or just returned as-is (assumes it's a regex object).
    �_�Nr[z\\z%s\A%s%s.*%s%sz%s\A%s)	�
isinstance�strr_�compilera�	partitionr%rr^)
r@r<r=rDrVrb�endrFZ	prefix_rer^rrrrB%s(


rB)r"Nr)rKrr_r\rWZdistutils.utilrZdistutils.errorsrrZ	distutilsrrrUrLrrarBrrrr�<module>sidistutils/__pycache__/cygwinccompiler.cpython-38.pyc000064400000020646151153537450016647 0ustar00U

e5d^@�@s�dZddlZddlZddlZddlmZmZmZddlZddl	m
Z
mZddlm
Z
ddlmZddlmZmZmZmZddlmZdd	lmZdd
lmZdd�ZGd
d�de
�ZGdd�de�ZdZdZdZ dd�Z!e�"d�Z#dd�Z$dd�Z%dd�Z&dS)adistutils.cygwinccompiler

Provides the CygwinCCompiler class, a subclass of UnixCCompiler that
handles the Cygwin port of the GNU C compiler to Windows.  It also contains
the Mingw32CCompiler class which handles the mingw32 port of GCC (same as
cygwin in no-cygwin mode).
�N)�Popen�PIPE�check_output)�gen_preprocess_options�gen_lib_options)�
UnixCCompiler)�
write_file)�DistutilsExecError�CCompilerError�CompileError�UnknownFileError)�log)�LooseVersion)�find_executablecCs�tj�d�}|dkr|tj|d|d�}|dkr8dgS|dkrFdgS|d	krTd
gS|dkrbdgS|d
krpdgStd|��dS)zaInclude the appropriate MSVC runtime library if Python was built
    with MSVC 7.0 or later.
    zMSC v.�����
Z1300Zmsvcr70Z1310Zmsvcr71Z1400Zmsvcr80Z1500Zmsvcr90Z1600Zmsvcr100zUnknown MS Compiler version %s N)�sys�version�find�
ValueError)Zmsc_posZmsc_ver�r�1/usr/lib64/python3.8/distutils/cygwinccompiler.py�	get_msvcr?src
@sReZdZdZdZdZdZdZdZdZ	dZ
dd
d�Zdd
�Zddd�Z
ddd�ZdS)�CygwinCCompilerz? Handles the Cygwin port of the GNU C compiler to Windows.
    �cygwinz.o�.az.dllzlib%s%sz%s%sz.exercCs�t�||||�t�\}}|�d||f�|tk	rB|�d|�t�\|_|_|_	|�|j
d|j|j|j	f�|jdkr�d|_nd|_|jdkr�d}nd	}|jd
ddd
d|j|fd�|jdkr�dg|_
|�d�nt�|_
dS)Nz%Python's GCC status: %s (details: %s)z�Python's pyconfig.h doesn't seem to support your compiler. Reason: %s. Compiling may fail because of undefined preprocessor macros.z: gcc %s, ld %s, dllwrap %s
z2.10.90�gcc�dllwrap�2.13�-shared�
-mdll -staticzgcc -mcygwin -O -Wallzgcc -mcygwin -mdll -O -Wallzg++ -mcygwin -O -Wallzgcc -mcygwinz%s -mcygwin %s�Zcompiler�compiler_soZcompiler_cxxZ
linker_exeZ	linker_so�2.91.57Zmsvcrtz,Consider upgrading to a newer version of gcc)r�__init__�check_config_hZdebug_print�CONFIG_H_OK�warn�get_versions�gcc_version�
ld_versionZdllwrap_version�
compiler_type�
linker_dll�set_executables�
dll_librariesr)�self�verbose�dry_run�forceZstatusZdetails�
shared_optionrrrr%dsN
����
��


��
�zCygwinCCompiler.__init__c
Cs�|dks|dkrVz|�dd|d|g�Wq�tk
rR}zt|��W5d}~XYq�XnNz"|�|j||d|g|�Wn*tk
r�}zt|��W5d}~XYnXdS)z:Compiles the source by spawning GCC and windres if needed.�.rc�.resZwindresz-iz-oN)Zspawnr	rr#)r0�obj�src�extZcc_args�extra_postargsZpp_opts�msgrrr�_compile�s�
zCygwinCCompiler._compileNcCsPt�|
p
g�}
t�|pg�}t�|p&g�}|�|j�|dk	�r||jksV|jdk�rtj�|d�}tj�tj�	|��\}}tj�
||d�}tj�
|d|d�}dtj�	|�dg}|D]}|�|�q�|�t
||fd	|�|jd
k�r|
�d|g�|
�d|g�n
|�|�|	�s(|
�d
�t�||||||||d|	|
|||
�dS)zLink the objects.Nrrz.def�librz
LIBRARY %sZEXPORTSz
writing %srz--output-libz--defz-s)�copy�extendr/Z
EXECUTABLEr-�os�path�dirname�splitext�basename�join�appendZexecuterr�link)r0Ztarget_descZobjectsZoutput_filename�
output_dirZ	librariesZlibrary_dirsZruntime_library_dirsZexport_symbols�debugZ
extra_preargsr:Z
build_tempZtarget_langZtemp_dirZdll_nameZ
dll_extensionZdef_fileZlib_file�contentsZsymrrrrG�sR
��

���

�zCygwinCCompiler.link�cCs�|dkrd}g}|D]�}tj�tj�|��\}}||jddgkrRtd||f��|rbtj�|�}|dkr�|�tj�||||j	��q|�tj�|||j	��q|S)z#Adds supports for rc and res files.NrKr5r6z"unknown file type '%s' (from '%s'))r6r5)
r@rArC�normcaseZsrc_extensionsrrDrFrE�
obj_extension)r0Zsource_filenamesZ	strip_dirrHZ	obj_namesZsrc_name�baser9rrr�object_filenames�s&���z CygwinCCompiler.object_filenames)rrr)
NNNNNrNNNN)rrK)�__name__�
__module__�__qualname__�__doc__r,rMZstatic_lib_extensionZshared_lib_extensionZstatic_lib_formatZshared_lib_formatZ
exe_extensionr%r<rGrOrrrrrYs,
;�
Nrc@seZdZdZdZddd�ZdS)�Mingw32CCompilerz@ Handles the Mingw32 port of the GNU C compiler to Windows.
    Zmingw32rc	Csxt�||||�|jdkr d}nd}|jdkr4d}nd}t�rFtd��|jdd	d
dd|j||fd
�g|_t	�|_dS)Nrr r!r$z--entry _DllMain@12rKz1Cygwin gcc cannot be used with --compiler=mingw32zgcc -O -Wallzgcc -mdll -O -Wallzg++ -O -Wallrz%s %s %sr")
rr%r+r*�is_cygwingccr
r.r-r/r)r0r1r2r3r4Zentry_pointrrrr%s.

����zMingw32CCompiler.__init__N)rrr)rPrQrRrSr,r%rrrrrTsrT�okznot okZ	uncertainc
Cs�ddlm}dtjkrtdfS|��}zLt|�}z4d|��krPtd|fW�WSt	d|fW�WSW5|��XWn8t
k
r�}ztd||jffWY�Sd	}~XYnXd	S)
awCheck if the current Python installation appears amenable to building
    extensions with GCC.

    Returns a tuple (status, details), where 'status' is one of the following
    constants:

    - CONFIG_H_OK: all is well, go ahead and compile
    - CONFIG_H_NOTOK: doesn't look good
    - CONFIG_H_UNCERTAIN: not sure -- unable to read pyconfig.h

    'details' is a human-readable string explaining the situation.

    Note there are two ways to conclude "OK": either 'sys.version' contains
    the string "GCC" (implying that this Python was built with GCC), or the
    installed "pyconfig.h" contains the string "__GNUC__".
    r)�	sysconfigZGCCzsys.version mentions 'GCC'Z__GNUC__z'%s' mentions '__GNUC__'z '%s' does not mention '__GNUC__'zcouldn't read '%s': %sN)
�	distutilsrWrrr'Zget_config_h_filename�open�close�read�CONFIG_H_NOTOK�OSError�CONFIG_H_UNCERTAIN�strerror)rW�fnZconfig_h�excrrrr&Hs
�r&s(\d+\.\d+(\.\d+)*)cCsl|��d}t|�dkrdSt|dtd�j}z|��}W5|��Xt�|�}|dkrZdSt	|�
d����S)z�Find the version of an executable by running `cmd` in the shell.

    If the command is not found, or the output does not match
    `RE_VERSION`, returns None.
    rNT)�shell�stdout�)�splitrrrrcrZr[�
RE_VERSION�searchr�group�decode)�cmd�
executable�out�
out_string�resultrrr�_find_exe_versionus

rocCsdddg}tdd�|D��S)zg Try to find out the versions of gcc, ld and dllwrap.

    If not possible it returns None for it.
    zgcc -dumpversionzld -vzdllwrap --versioncSsg|]}t|��qSr)ro)�.0rjrrr�
<listcomp>�sz get_versions.<locals>.<listcomp>)�tuple)Zcommandsrrrr)�s
r)cCstddg�}|���d�S)z>Try to determine if the gcc that would be used is from cygwin.rz-dumpmachinescygwin)r�strip�endswith)rmrrrrU�srU)'rSr@rr>�
subprocessrrr�reZdistutils.ccompilerrrZdistutils.unixccompilerrZdistutils.file_utilrZdistutils.errorsr	r
rrrXr
Zdistutils.versionrZdistutils.spawnrrrrTr'r\r^r&�compilerfror)rUrrrr�<module>s0/;1+
distutils/__pycache__/cygwinccompiler.cpython-38.opt-2.pyc000064400000015510151153537450017601 0ustar00U

e5d^@�@s�ddlZddlZddlZddlmZmZmZddlZddlm	Z	m
Z
ddlmZddl
mZddlmZmZmZmZddlmZddlmZdd	lmZd
d�ZGdd
�d
e�ZGdd�de�ZdZdZdZdd�Z e�!d�Z"dd�Z#dd�Z$dd�Z%dS)�N)�Popen�PIPE�check_output)�gen_preprocess_options�gen_lib_options)�
UnixCCompiler)�
write_file)�DistutilsExecError�CCompilerError�CompileError�UnknownFileError)�log)�LooseVersion)�find_executablecCs�tj�d�}|dkr|tj|d|d�}|dkr8dgS|dkrFdgS|d	krTd
gS|dkrbdgS|d
krpdgStd|��dS)NzMSC v.�����
Z1300Zmsvcr70Z1310Zmsvcr71Z1400Zmsvcr80Z1500Zmsvcr90Z1600Zmsvcr100zUnknown MS Compiler version %s )�sys�version�find�
ValueError)Zmsc_posZmsc_ver�r�1/usr/lib64/python3.8/distutils/cygwinccompiler.py�	get_msvcr?src
@sNeZdZdZdZdZdZdZdZdZ	dd	d
�Z
dd�Zddd�Zddd�Z
d
S)�CygwinCCompiler�cygwinz.o�.az.dllzlib%s%sz%s%sz.exercCs�t�||||�t�\}}|�d||f�|tk	rB|�d|�t�\|_|_|_	|�|j
d|j|j|j	f�|jdkr�d|_nd|_|jdkr�d}nd	}|jd
ddd
d|j|fd�|jdkr�dg|_
|�d�nt�|_
dS)Nz%Python's GCC status: %s (details: %s)z�Python's pyconfig.h doesn't seem to support your compiler. Reason: %s. Compiling may fail because of undefined preprocessor macros.z: gcc %s, ld %s, dllwrap %s
z2.10.90�gcc�dllwrap�2.13�-shared�
-mdll -staticzgcc -mcygwin -O -Wallzgcc -mcygwin -mdll -O -Wallzg++ -mcygwin -O -Wallzgcc -mcygwinz%s -mcygwin %s�Zcompiler�compiler_soZcompiler_cxxZ
linker_exeZ	linker_so�2.91.57Zmsvcrtz,Consider upgrading to a newer version of gcc)r�__init__�check_config_hZdebug_print�CONFIG_H_OK�warn�get_versions�gcc_version�
ld_versionZdllwrap_version�
compiler_type�
linker_dll�set_executables�
dll_librariesr)�self�verbose�dry_run�forceZstatusZdetails�
shared_optionrrrr%dsN
����
��


��
�zCygwinCCompiler.__init__c
Cs�|dks|dkrVz|�dd|d|g�Wq�tk
rR}zt|��W5d}~XYq�XnNz"|�|j||d|g|�Wn*tk
r�}zt|��W5d}~XYnXdS)N�.rc�.resZwindresz-iz-o)Zspawnr	rr#)r0�obj�src�extZcc_args�extra_postargsZpp_opts�msgrrr�_compile�s�
zCygwinCCompiler._compileNcCsPt�|
p
g�}
t�|pg�}t�|p&g�}|�|j�|dk	�r||jksV|jdk�rtj�|d�}tj�tj�	|��\}}tj�
||d�}tj�
|d|d�}dtj�	|�dg}|D]}|�|�q�|�t
||fd|�|jd	k�r|
�d
|g�|
�d|g�n
|�|�|	�s(|
�d�t�||||||||d|	|
|||
�dS)
Nrrz.def�librz
LIBRARY %sZEXPORTSz
writing %srz--output-libz--defz-s)�copy�extendr/Z
EXECUTABLEr-�os�path�dirname�splitext�basename�join�appendZexecuterr�link)r0Ztarget_descZobjectsZoutput_filename�
output_dirZ	librariesZlibrary_dirsZruntime_library_dirsZexport_symbols�debugZ
extra_preargsr:Z
build_tempZtarget_langZtemp_dirZdll_nameZ
dll_extensionZdef_fileZlib_file�contentsZsymrrrrG�sR
��

���

�zCygwinCCompiler.link�cCs�|dkrd}g}|D]�}tj�tj�|��\}}||jddgkrRtd||f��|rbtj�|�}|dkr�|�tj�||||j	��q|�tj�|||j	��q|S)NrKr5r6z"unknown file type '%s' (from '%s'))r6r5)
r@rArC�normcaseZsrc_extensionsrrDrFrE�
obj_extension)r0Zsource_filenamesZ	strip_dirrHZ	obj_namesZsrc_name�baser9rrr�object_filenames�s&���z CygwinCCompiler.object_filenames)rrr)
NNNNNrNNNN)rrK)�__name__�
__module__�__qualname__r,rMZstatic_lib_extensionZshared_lib_extensionZstatic_lib_formatZshared_lib_formatZ
exe_extensionr%r<rGrOrrrrrYs*
;�
Nrc@seZdZdZddd�ZdS)�Mingw32CCompilerZmingw32rc	Csxt�||||�|jdkr d}nd}|jdkr4d}nd}t�rFtd��|jdd	d
dd|j||fd
�g|_t	�|_dS)Nrr r!r$z--entry _DllMain@12rKz1Cygwin gcc cannot be used with --compiler=mingw32zgcc -O -Wallzgcc -mdll -O -Wallzg++ -O -Wallrz%s %s %sr")
rr%r+r*�is_cygwingccr
r.r-r/r)r0r1r2r3r4Zentry_pointrrrr%s.

����zMingw32CCompiler.__init__N)rrr)rPrQrRr,r%rrrrrSsrS�okznot okZ	uncertainc
Cs�ddlm}dtjkrtdfS|��}zLt|�}z4d|��krPtd|fW�WSt	d|fW�WSW5|��XWn8t
k
r�}ztd||jffWY�Sd}~XYnXdS)	Nr)�	sysconfigZGCCzsys.version mentions 'GCC'Z__GNUC__z'%s' mentions '__GNUC__'z '%s' does not mention '__GNUC__'zcouldn't read '%s': %s)
�	distutilsrVrrr'Zget_config_h_filename�open�close�read�CONFIG_H_NOTOK�OSError�CONFIG_H_UNCERTAIN�strerror)rV�fnZconfig_h�excrrrr&Hs
�r&s(\d+\.\d+(\.\d+)*)cCsl|��d}t|�dkrdSt|dtd�j}z|��}W5|��Xt�|�}|dkrZdSt	|�
d����S)NrT)�shell�stdout�)�splitrrrrbrYrZ�
RE_VERSION�searchr�group�decode)�cmd�
executable�out�
out_string�resultrrr�_find_exe_versionus

rncCsdddg}tdd�|D��S)Nzgcc -dumpversionzld -vzdllwrap --versioncSsg|]}t|��qSr)rn)�.0rirrr�
<listcomp>�sz get_versions.<locals>.<listcomp>)�tuple)Zcommandsrrrr)�s
r)cCstddg�}|���d�S)Nrz-dumpmachinescygwin)r�strip�endswith)rlrrrrT�srT)&r@rr>�
subprocessrrr�reZdistutils.ccompilerrrZdistutils.unixccompilerrZdistutils.file_utilrZdistutils.errorsr	r
rrrWr
Zdistutils.versionrZdistutils.spawnrrrrSr'r[r]r&�compilerernr)rTrrrr�<module>0s.;1+
distutils/__pycache__/errors.cpython-38.pyc000064400000012204151153537450014754 0ustar00U

e5d�
�@s8dZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGd	d
�d
e�ZGdd�de�ZGd
d�de�ZGdd�de�Z	Gdd�de�Z
Gdd�de�ZGdd�de�ZGdd�de�Z
Gdd�de�ZGdd�de�ZGdd�de�ZGdd �d e�ZGd!d"�d"e�ZGd#d$�d$e�ZGd%d&�d&e�Zd'S)(a�distutils.errors

Provides exceptions used by the Distutils modules.  Note that Distutils
modules may raise standard exceptions; in particular, SystemExit is
usually raised for errors that are obviously the end-user's fault
(eg. bad command-line arguments).

This module is safe to use in "from ... import *" mode; it only exports
symbols whose names start with "Distutils" and end with "Error".c@seZdZdZdS)�DistutilsErrorzThe root of all Distutils evil.N��__name__�
__module__�__qualname__�__doc__�rr�(/usr/lib64/python3.8/distutils/errors.pyrsrc@seZdZdZdS)�DistutilsModuleErrorz�Unable to load an expected module, or to find an expected class
    within some module (in particular, command modules and classes).Nrrrrrr	sr	c@seZdZdZdS)�DistutilsClassErrorz�Some command class (or possibly distribution class, if anyone
    feels a need to subclass Distribution) is found not to be holding
    up its end of the bargain, ie. implementing some part of the
    "command "interface.Nrrrrrr
sr
c@seZdZdZdS)�DistutilsGetoptErrorz7The option table provided to 'fancy_getopt()' is bogus.Nrrrrrrsrc@seZdZdZdS)�DistutilsArgErrorzaRaised by fancy_getopt in response to getopt.error -- ie. an
    error in the command line usage.Nrrrrrrsrc@seZdZdZdS)�DistutilsFileErrorz�Any problems in the filesystem: expected file not found, etc.
    Typically this is for problems that we detect before OSError
    could be raised.Nrrrrrr
$sr
c@seZdZdZdS)�DistutilsOptionErrora�Syntactic/semantic errors in command options, such as use of
    mutually conflicting options, or inconsistent options,
    badly-spelled values, etc.  No distinction is made between option
    values originating in the setup script, the command line, config
    files, or what-have-you -- but if we *know* something originated in
    the setup script, we'll raise DistutilsSetupError instead.Nrrrrrr*src@seZdZdZdS)�DistutilsSetupErrorzqFor errors that can be definitely blamed on the setup script,
    such as invalid keyword arguments to 'setup()'.Nrrrrrr3src@seZdZdZdS)�DistutilsPlatformErrorz�We don't know how to do something on the current platform (but
    we do know how to do it on some platform) -- eg. trying to compile
    C files on a platform not supported by a CCompiler subclass.Nrrrrrr8src@seZdZdZdS)�DistutilsExecErrorz`Any problems executing an external program (such as the C
    compiler, when compiling C files).Nrrrrrr>src@seZdZdZdS)�DistutilsInternalErrorzoInternal inconsistencies or impossibilities (obviously, this
    should never be seen if the code is working!).NrrrrrrCsrc@seZdZdZdS)�DistutilsTemplateErrorz%Syntax error in a file list template.NrrrrrrHsrc@seZdZdZdS)�DistutilsByteCompileErrorzByte compile error.NrrrrrrKsrc@seZdZdZdS)�CCompilerErrorz#Some compile/link operation failed.NrrrrrrOsrc@seZdZdZdS)�PreprocessErrorz.Failure to preprocess one or more C/C++ files.NrrrrrrRsrc@seZdZdZdS)�CompileErrorz2Failure to compile one or more C/C++ source files.NrrrrrrUsrc@seZdZdZdS)�LibErrorzKFailure to create a static library from one or more C/C++ object
    files.NrrrrrrXsrc@seZdZdZdS)�	LinkErrorz]Failure to link one or more C/C++ object files into an executable
    or shared library file.Nrrrrrr\src@seZdZdZdS)�UnknownFileErrorz(Attempt to process an unknown file type.Nrrrrrr`srN)r�	Exceptionrr	r
rrr
rrrrrrrrrrrrrrrrr�<module>s&
	distutils/__pycache__/cmd.cpython-38.opt-1.pyc000064400000033176151153537450015155 0ustar00U

e5d�F�@sbdZddlZddlZddlZddlmZddlmZmZm	Z	m
Z
mZddlmZGdd�d�Z
dS)ztdistutils.cmd

Provides the Command class, the base class for the command classes
in the distutils.command package.
�N)�DistutilsOptionError)�util�dir_util�	file_util�archive_util�dep_util��logc@s"eZdZdZgZdd�Zdd�Zdd�Zdd	�Zd
d�Z	dCdd�Z
dd�ZdDdd�Zdd�Z
dEdd�ZdFdd�Zdd�ZdGdd�Zdd �Zd!d"�Zd#d$�Zd%d&�ZdHd'd(�ZdId*d+�Zd,d-�Zd.d/�Zd0d1�ZdJd2d3�ZdKd5d6�ZdLd7d8�ZdMd9d:�ZdNd;d<�ZdOd=d>�Z dPd?d@�Z!dQdAdB�Z"dS)R�Commanda}Abstract base class for defining command classes, the "worker bees"
    of the Distutils.  A useful analogy for command classes is to think of
    them as subroutines with local variables called "options".  The options
    are "declared" in 'initialize_options()' and "defined" (given their
    final values, aka "finalized") in 'finalize_options()', both of which
    must be defined by every command class.  The distinction between the
    two is necessary because option values might come from the outside
    world (command line, config file, ...), and any options dependent on
    other options must be computed *after* these outside influences have
    been processed -- hence 'finalize_options()'.  The "body" of the
    subroutine, where it does all its work based on the values of its
    options, is the 'run()' method, which must also be implemented by every
    command class.
    cCsbddlm}t||�std��|jtkr0td��||_|��d|_	|j
|_
d|_d|_d|_
dS)z�Create and initialize a new Command object.  Most importantly,
        invokes the 'initialize_options()' method, which is the real
        initializer and depends on the actual command being
        instantiated.
        r)�Distributionz$dist must be a Distribution instancezCommand is an abstract classN)Zdistutils.distr�
isinstance�	TypeError�	__class__r
�RuntimeError�distribution�initialize_optionsZ_dry_run�verbose�force�help�	finalized)�selfZdistr�r�%/usr/lib64/python3.8/distutils/cmd.py�__init__/s


zCommand.__init__cCs<|dkr0t|d|�}|dkr*t|j|�S|Snt|��dS)N�dry_run�_)�getattrr�AttributeError)r�attrZmyvalrrr�__getattr___szCommand.__getattr__cCs|js|��d|_dS)N�)r�finalize_options�rrrr�ensure_finalizediszCommand.ensure_finalizedcCstd|j��dS)a�Set default values for all the options that this command
        supports.  Note that these defaults may be overridden by other
        commands, by the setup script, by config files, or by the
        command-line.  Thus, this is not the place to code dependencies
        between options; generally, 'initialize_options()' implementations
        are just a bunch of "self.foo = None" assignments.

        This method must be implemented by all command classes.
        �,abstract method -- subclass %s must overrideN�rrr"rrrr{s
�zCommand.initialize_optionscCstd|j��dS)aSet final values for all the options that this command supports.
        This is always called as late as possible, ie.  after any option
        assignments from the command-line or from other commands have been
        done.  Thus, this is the place to code option dependencies: if
        'foo' depends on 'bar', then it is safe to set 'foo' from 'bar' as
        long as 'foo' still has the same value it was assigned in
        'initialize_options()'.

        This method must be implemented by all command classes.
        r$Nr%r"rrrr!�s�zCommand.finalize_optionsN�cCs�ddlm}|dkr d|��}|j||tjd�|d}|jD]R\}}}|�|�}|ddkrn|dd�}t||�}|j|d||ftjd�qBdS)	Nr)�
longopt_xlatezcommand options for '%s':)�levelz  ����=z%s = %s)	Zdistutils.fancy_getoptr'�get_command_name�announcer	�INFOZuser_options�	translater)r�header�indentr'�optionr�valuerrr�dump_options�s

�zCommand.dump_optionscCstd|j��dS)a�A command's raison d'etre: carry out the action it exists to
        perform, controlled by the options initialized in
        'initialize_options()', customized by other commands, the setup
        script, the command-line, and config files, and finalized in
        'finalize_options()'.  All terminal output and filesystem
        interaction should be done by 'run()'.

        This method must be implemented by all command classes.
        r$Nr%r"rrr�run�s
�zCommand.runr cCst�||�dS)zmIf the current verbosity level is of greater than or equal to
        'level' print 'msg' to stdout.
        Nr)r�msgr(rrrr,�szCommand.announcecCs&ddlm}|r"t|�tj��dS)z~Print 'msg' to stdout if the global DEBUG (taken from the
        DISTUTILS_DEBUG environment variable) flag is true.
        r)�DEBUGN)Zdistutils.debugr6�print�sys�stdout�flush)rr5r6rrr�debug_print�szCommand.debug_printcCsBt||�}|dkr"t|||�|St|t�s>td|||f��|S)Nz'%s' must be a %s (got `%s`))r�setattrr�strr)rr1�what�default�valrrr�_ensure_stringlike�s

�zCommand._ensure_stringlikecCs|�|d|�dS)zWEnsure that 'option' is a string; if not defined, set it to
        'default'.
        �stringN)rA)rr1r?rrr�
ensure_string�szCommand.ensure_stringcCspt||�}|dkrdSt|t�r6t||t�d|��n6t|t�rTtdd�|D��}nd}|sltd||f��dS)z�Ensure that 'option' is a list of strings.  If 'option' is
        currently a string, we split it either on /,\s*/ or /\s+/, so
        "foo bar baz", "foo,bar,baz", and "foo,   bar baz" all become
        ["foo", "bar", "baz"].
        Nz,\s*|\s+css|]}t|t�VqdS�N)rr=)�.0�vrrr�	<genexpr>�sz-Command.ensure_string_list.<locals>.<genexpr>Fz''%s' must be a list of strings (got %r))	rrr=r<�re�split�list�allr)rr1r@�okrrr�ensure_string_list�s


��zCommand.ensure_string_listcCs6|�|||�}|dk	r2||�s2td|||f��dS)Nzerror in '%s' option: )rAr)rr1Ztesterr>Z	error_fmtr?r@rrr�_ensure_tested_string�s
�zCommand._ensure_tested_stringcCs|�|tjjdd�dS)z5Ensure that 'option' is the name of an existing file.�filenamez$'%s' does not exist or is not a fileN)rN�os�path�isfile�rr1rrr�ensure_filename�s�zCommand.ensure_filenamecCs|�|tjjdd�dS)Nzdirectory namez)'%s' does not exist or is not a directory)rNrPrQ�isdirrSrrr�ensure_dirnames�zCommand.ensure_dirnamecCst|d�r|jS|jjSdS)N�command_name)�hasattrrWr�__name__r"rrrr+	s
zCommand.get_command_namecGsF|j�|�}|��|D](\}}t||�dkrt||t||��qdS)a>Set the values of any "undefined" options from corresponding
        option values in some other command object.  "Undefined" here means
        "is None", which is the convention used to indicate that an option
        has not been changed between 'initialize_options()' and
        'finalize_options()'.  Usually called from 'finalize_options()' for
        options that depend on some other command rather than another
        option of the same command.  'src_cmd' is the other command from
        which option values will be taken (a command object will be created
        for it if necessary); the remaining arguments are
        '(src_option,dst_option)' tuples which mean "take the value of
        'src_option' in the 'src_cmd' command object, and copy it to
        'dst_option' in the current command object".
        N)r�get_command_objr#rr<)rZsrc_cmdZoption_pairsZsrc_cmd_objZ
src_optionZ
dst_optionrrr�set_undefined_optionss
zCommand.set_undefined_optionscCs|j�||�}|��|S)z�Wrapper around Distribution's 'get_command_obj()' method: find
        (create if necessary and 'create' is true) the command object for
        'command', call its 'ensure_finalized()' method, and return the
        finalized command object.
        )rrZr#)r�commandZcreateZcmd_objrrr�get_finalized_command$szCommand.get_finalized_commandrcCs|j�||�SrD)r�reinitialize_command)rr\Zreinit_subcommandsrrrr^0s�zCommand.reinitialize_commandcCs|j�|�dS)z�Run some other command: uses the 'run_command()' method of
        Distribution, which creates and finalizes the command object if
        necessary and then invokes its 'run()' method.
        N)r�run_command)rr\rrrr_4szCommand.run_commandcCs2g}|jD]"\}}|dks"||�r
|�|�q
|S)akDetermine the sub-commands that are relevant in the current
        distribution (ie., that need to be run).  This is based on the
        'sub_commands' class attribute: each tuple in that list may include
        a method that we call to determine if the subcommand needs to be
        run for the current distribution.  Return a list of command names.
        N)�sub_commands�append)rZcommandsZcmd_name�methodrrr�get_sub_commands;s
zCommand.get_sub_commandscCst�d|��|�dS)Nzwarning: %s: %s
)r	�warnr+)rr5rrrrdKszCommand.warncCstj||||jd�dS�N�r)r�executer)r�func�argsr5r(rrrrgNszCommand.execute�cCstj|||jd�dSre)r�mkpathr)r�name�moderrrrkQszCommand.mkpathc	Cstj|||||j||jd�S)z�Copy a file respecting verbose, dry-run and force flags.  (The
        former two default to whatever is in the Distribution object, and
        the latter defaults to false for commands that don't define it.)rf)r�	copy_filerr)r�infile�outfile�
preserve_mode�preserve_times�linkr(rrrrnTs
�zCommand.copy_filec	Cstj||||||j|jd�S)z\Copy an entire directory tree respecting verbose, dry-run,
        and force flags.
        rf)r�	copy_treerr)rrorprqrrZpreserve_symlinksr(rrrrt]s
�zCommand.copy_treecCstj|||jd�S)z$Move a file respecting dry-run flag.rf)r�	move_filer)r�srcZdstr(rrrrufszCommand.move_filecCs ddlm}||||jd�dS)z2Spawn an external command respecting dry-run flag.r)�spawnrfN)Zdistutils.spawnrwr)r�cmdZsearch_pathr(rwrrrrwjsz
Command.spawnc	Cstj|||||j||d�S)N)r�owner�group)r�make_archiver)rZ	base_name�formatZroot_dirZbase_dirryrzrrrr{os
�zCommand.make_archivecCs�|dkrd|}t|t�r"|f}nt|ttf�s8td��|dkrRd|d�|�f}|jsdt�||�rv|�	||||�n
t
�|�dS)a�Special case of 'execute()' for operations that process one or
        more input files and generate one output file.  Works just like
        'execute()', except the operation is skipped and a different
        message printed if 'outfile' already exists and is newer than all
        files listed in 'infiles'.  If the command defined 'self.force',
        and it is true, then the command is unconditionally run -- does no
        timestamp checks.
        Nzskipping %s (inputs unchanged)z9'infiles' must be a string, or a list or tuple of stringszgenerating %s from %sz, )rr=rJ�tupler
�joinrrZnewer_grouprgr	�debug)rZinfilesrprhriZexec_msgZskip_msgr(rrr�	make_fileus

�zCommand.make_file)Nr&)r )N)N)N)r )r)Nr )rj)r r Nr )r r rr )r )r r )NNNN)NNr )#rY�
__module__�__qualname__�__doc__r`rrr#rr!r3r4r,r;rArCrMrNrTrVr+r[r]r^r_rcrdrgrkrnrtrurwr{r�rrrrr
sZ0






�




�
	�
	

�
�r
)r�r8rPrHZdistutils.errorsrZ	distutilsrrrrrr	r
rrrr�<module>s
distutils/__pycache__/msvc9compiler.cpython-38.pyc000064400000042150151153537450016237 0ustar00U

e5d/w�@sRdZddlZddlZddlZddlZddlmZmZmZm	Z	m
Z
ddlmZm
Z
mZddlmZddlmZddlZejZejZejZejZejejejejfZ ej!dko�ej"dkZ#e#r�d	Z$d
Z%dZ&ndZ$d
Z%dZ&ddd�Z'Gdd�d�Z(Gdd�d�Z)dd�Z*dd�Z+dd�Z,dd�Z-d$dd�Z.e*�Z/e/d k�r>ed!e/��Gd"d#�d#e�Z0dS)%adistutils.msvc9compiler

Contains MSVCCompiler, an implementation of the abstract CCompiler class
for the Microsoft Visual Studio 2008.

The module is compatible with VS 2005 and VS 2008. You can find legacy support
for older versions of VS in distutils.msvccompiler.
�N)�DistutilsExecError�DistutilsPlatformError�CompileError�LibError�	LinkError)�	CCompiler�gen_preprocess_options�gen_lib_options)�log)�get_platform�win32lz1Software\Wow6432Node\Microsoft\VisualStudio\%0.1fz5Software\Wow6432Node\Microsoft\Microsoft SDKs\Windowsz,Software\Wow6432Node\Microsoft\.NETFrameworkz%Software\Microsoft\VisualStudio\%0.1fz)Software\Microsoft\Microsoft SDKs\Windowsz Software\Microsoft\.NETFramework�x86Zamd64�rz	win-amd64c@sPeZdZdZdd�Zee�Zdd�Zee�Zdd�Zee�Zdd	�Ze	e�Zd
S)�Regz2Helper class to read values from the registry
    cCs:tD](}|�||�}|r||kr||Sqt|��dS�N)�HKEYS�read_values�KeyError)�cls�path�key�base�d�r�//usr/lib64/python3.8/distutils/msvc9compiler.py�	get_value@s
z
Reg.get_valuecCsnzt||�}Wntk
r$YdSXg}d}zt||�}Wntk
rTYqjYnX|�|�|d7}q.|S)zReturn list of registry keys.Nr�)�RegOpenKeyEx�RegError�
RegEnumKey�append)rrr�handle�L�i�krrr�	read_keysHs


z
Reg.read_keysc	Cs�zt||�}Wntk
r$YdSXi}d}zt||�\}}}Wntk
rZYq�YnX|��}|�|�||�|�<|d7}q.|S)z`Return dict of registry keys and values.

        All names are converted to lowercase.
        Nrr)rr�RegEnumValue�lower�convert_mbcs)	rrrr!rr#�name�value�typerrrrZs

zReg.read_valuescCs:t|dd�}|dk	r6z|d�}Wntk
r4YnX|S)N�decode�mbcs)�getattr�UnicodeError)�sZdecrrrr(pszReg.convert_mbcsN)
�__name__�
__module__�__qualname__�__doc__r�classmethodr%rr(�staticmethodrrrrr<src@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�
MacroExpandercCsi|_t||_|�|�dSr)�macros�VS_BASE�vsbase�load_macros)�self�versionrrr�__init__|s
zMacroExpander.__init__cCst�||�|jd|<dS)Nz$(%s))rrr8)r<Zmacrorrrrr�	set_macro�szMacroExpander.set_macroc	Cs|�d|jdd�|�d|jdd�|�dtd�z$|dkrP|�d	td
�ntd
��Wntk
rvtd��YnX|dkr�|�d
|jd�|�dtd�nbd}tD]X}zt||�}Wntk
r�Yq�YnXt	|d�}t
�|d||f�}|d|jd<q�dS)NZVCInstallDirz	\Setup\VC�
productdirZVSInstallDirz	\Setup\VSZFrameworkDirZinstallroot� @ZFrameworkSDKDirzsdkinstallrootv2.0aPython was built with Visual Studio 2008;
extensions must be built with a compiler than can generate compatible binaries.
Visual Studio 2008 was not found on this system. If you have Cygwin installed,
you can try compiling with MingW32, by passing "-c mingw32" to setup.py.g"@ZFrameworkVersionzclr versionZ
WindowsSdkDirZcurrentinstallfolderz.Software\Microsoft\NET Framework Setup\Productrz%s\%sr=z$(FrameworkVersion))
r?r:�NET_BASErr�WINSDK_BASErrrrrrr8)r<r=�pr�hrrrrrr;�s2��


zMacroExpander.load_macroscCs$|j��D]\}}|�||�}q
|Sr)r8�items�replace)r<r0r$�vrrr�sub�szMacroExpander.subN)r1r2r3r>r?r;rIrrrrr7zsr7cCs�d}tj�|�}|dkrdS|t|�}tj|d��dd�\}}t|dd��d}|dkrf|d7}t|d	d
��d}|dkr�d}|dkr�||SdS)
z�Return the version of MSVC that was used to build Python.

    For Python 2.3 and up, the version number is included in
    sys.version.  For earlier versions, assume the compiler is MSVC 6.
    zMSC v.����N� r����
��g$@r)�sysr=�find�len�split�int)�prefixr#r0�restZmajorVersionZminorVersionrrr�get_build_version�srXcCs0g}|D]"}tj�|�}||kr|�|�q|S)znReturn a list of normalized paths with duplicates removed.

    The current order of paths is maintained.
    )�osr�normpathr )�pathsZ
reduced_pathsrDZnprrr�normalize_and_reduce_paths�sr\cCs<|�tj�}g}|D]}||kr|�|�qtj�|�}|S)z8Remove duplicate values of an environment variable.
    )rTrY�pathsepr �join)ZvariableZoldListZnewListr#ZnewVariablerrr�removeDuplicates�sr_cCst|}zt�d|d�}Wn"tk
r>t�d�d}YnX|rPtj�|�s�d|}tj	�
|d�}|r�tj�|�r�tj�|tjtjd�}tj�
|�}tj�|�s�t�d|�dSnt�d|�|s�t�d	�dStj�|d
�}tj�|�r�|St�d�dS)z�Find the vcvarsall.bat file

    At first it tries to find the productdir of VS 2008 in the registry. If
    that fails it falls back to the VS90COMNTOOLS env var.
    z%s\Setup\VCr@z%Unable to find productdir in registryNzVS%0.f0COMNTOOLSZVCz%s is not a valid directoryz Env var %s is not set or invalidzNo productdir foundz
vcvarsall.bat�Unable to find vcvarsall.bat)r9rrrr
�debugrYr�isdir�environ�getr^�pardir�abspath�isfile)r=r:r@ZtoolskeyZtoolsdir�	vcvarsallrrr�find_vcvarsall�s4
�



ricCs8t|�}ddddh}i}|dkr(td��t�d||�tjd||ftjtjd	�}z�|�
�\}}|��d
krzt|�d���|�d�}|�
d�D]d}t�|�}d
|kr�q�|��}|�
d
d�\}	}
|	��}	|	|kr�|
�tj�r�|
dd�}
t|
�||	<q�W5|j��|j	��Xt|�t|�k�r4ttt|������|S)zDLaunch vcvarsall.bat and read the settings from its environment
    �include�libZlibpathrNr`z'Calling 'vcvarsall.bat %s' (version=%s)z
"%s" %s & set)�stdout�stderrrr-�
�=rrJ)rirr
ra�
subprocess�Popen�PIPErl�closermZcommunicate�waitr,rTrr(�stripr'�endswithrYr]r_rS�
ValueError�str�list�keys)r=ZarchrhZinteresting�result�popenrlrm�linerr*rrr�query_vcvarsall�s>�


r~rAz(VC %0.1f is not supported by this modulec
@s�eZdZdZdZiZdgZdddgZdgZdgZ	eeee	Z
d	Zd
ZdZ
dZd
ZZdZd.dd�Zd/dd�Zd0dd�Zd1dd�Zd2dd�Zd3dd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd4d*d+�Zd,d-�ZdS)5�MSVCCompilerzwConcrete class that implements an interface to Microsoft Visual C++,
       as defined by the CCompiler abstract class.Zmsvcz.cz.ccz.cppz.cxx�.rcz.mcz.resz.objz.libz.dllz%s%sz.exercCs8t�||||�t|_d|_g|_d|_d|_d|_dS)NzSoftware\Microsoft\VisualStudioF)	rr>�VERSION�_MSVCCompiler__versionZ_MSVCCompiler__root�_MSVCCompiler__paths�	plat_name�_MSVCCompiler__arch�initialized)r<�verboseZdry_runZforcerrrr>IszMSVCCompiler.__init__NcCs(|jrtd��|dkrt�}d}||kr6td|f��dtjkrtdtjkrt|�d�rtd|_d|_d|_	d	|_
d
|_n�|t�ks�|dkr�t|}ntt�dt|}t
t|�}|d
�tj�|_|dtjd<|dtjd<t|j�dkr�td|j��|�d�|_|�d�|_|�d�|_	|�d	�|_
|�d
�|_z(tjd
�d�D]}|j�|��qHWntk
�rtYnXt|j�|_d�|j�tjd
<d|_|jdk�r�dddddg|_ddddddg|_n&ddddddg|_dddddddg|_dddg|_|jd k�rddd!d"g|_dg|_d#|_dS)$Nzdon't init multiple timesrz--plat-name must be one of %sZDISTUTILS_USE_SDKZMSSdkzcl.exezlink.exezlib.exezrc.exezmc.exer�_rrkrjrzxPython was built with %s, and extensions need to be built with the same version of the compiler, but it isn't installed.�;r
z/nologoz/Oxz/MDz/W3z/DNDEBUGz/Odz/MDdz/Z7z/D_DEBUGz/GS-z/DLLz/INCREMENTAL:NO�z/INCREMENTAL:noz/DEBUGT) r��AssertionErrorrrrYrc�find_exe�cc�linkerrk�rc�mc�PLAT_TO_VCVARSr~r�rTr]r�rSZ_MSVCCompiler__productr rr\r^Zpreprocess_optionsr��compile_options�compile_options_debug�ldflags_sharedr��ldflags_shared_debugZldflags_static)r<r�Zok_platsZ	plat_specZvc_envrDrrr�
initializeTs��
�
���
�
��zMSVCCompiler.initialize�cCs�|dkrd}g}|D]�}tj�|�\}}tj�|�d}|tj�|�d�}||jkrbtd|��|rrtj�|�}||jkr�|�	tj�
|||j��q||jkr�|�	tj�
|||j��q|�	tj�
|||j
��q|S)Nr�rzDon't know how to compile %s)rYr�splitext�
splitdrive�isabs�src_extensionsr�basename�_rc_extensionsr r^�
res_extension�_mc_extensions�
obj_extension)r<Zsource_filenamesZ	strip_dir�
output_dirZ	obj_namesZsrc_namer�extrrr�object_filenames�s.

�
��zMSVCCompiler.object_filenamesc	Csp|js|��|�||||||�}	|	\}}
}}}|p6g}
|
�d�|rT|
�|j�n|
�|j�|
D�]}z||\}}Wntk
r�YqdYnX|r�tj	�
|�}||jkr�d|}�nT||jkr�d|}�n>||j
k�r<|}d|}z"|�|jg||g|g�Wqdtk
�r6}zt|��W5d}~XYqdXqdn�||jk�r�tj	�|�}tj	�|�}zl|�|jgd|d|g|g�tj	�tj	�|��\}}tj	�||d�}|�|jgd|g|g�Wqdtk
�r�}zt|��W5d}~XYqdXqdntd||f��d	|}z&|�|jg|
|||g|�Wqdtk
�rh}zt|��W5d}~XYqdXqd|
S)
Nz/cz/Tcz/Tpz/foz-hz-rr�z"Don't know how to compile %s to %sz/Fo)r�r�Z_setup_compiler �extendr�r�rrYrrf�
_c_extensions�_cpp_extensionsr��spawnr�rrr��dirnamer�r�r�r^r�)r<Zsourcesr�r8Zinclude_dirsra�
extra_preargs�extra_postargsZdependsZcompile_info�objectsZpp_optsZbuildZcompile_opts�obj�srcr�Z	input_optZ
output_opt�msgZh_dirZrc_dirrr�Zrc_filerrr�compile�s�
�




��


��
��
���
zMSVCCompiler.compilec	
Cs�|js|��|�||�\}}|j||d�}|�||�r�|d|g}|rJz|�|jg|�Wq�tk
r�}zt|��W5d}~XYq�Xnt	�
d|�dS)N)r��/OUT:�skipping %s (up-to-date))r�r��_fix_object_args�library_filename�
_need_linkr�rkrrr
ra)	r<r�Zoutput_libnamer�ra�target_lang�output_filenameZlib_argsr�rrr�create_static_libs�zMSVCCompiler.create_static_libc
CsT|js|��|�||�\}}|�|||�}|\}}}|rL|�dt|��t||||�}|dk	rptj�	||�}|�
||��rD|tjkr�|	r�|j
dd�}q�|jdd�}n|	r�|j
}n|j}g}|p�gD]}|�d|�q�||||d|g}tj�|d�}|dk	�rLtj�tj�|��\}}tj�	||�|��}|�d|�|�|||�|
�rl|
|dd�<|�r||�|�|�tj�|��z|�|jg|�Wn,tk
�r�}zt|��W5d}~XYnX|�||�}|dk	�rP|\}}d||f}z|�dd	d
||g�Wn,tk
�r@}zt|��W5d}~XYnXnt�d|�dS)Nz5I don't know what to do with 'runtime_library_dirs': rz/EXPORT:r�rz/IMPLIB:z-outputresource:%s;%szmt.exez-nologoz	-manifestr�)r�r�r�Z
_fix_lib_args�warnrxr	rYrr^r�r�
EXECUTABLEr�r�r r�r�r�r��manifest_setup_ldargsr�Zmkpathr�r�rr�manifest_get_embed_infor
ra)r<�target_descr�r�r�Z	librariesZlibrary_dirsZruntime_library_dirsZexport_symbolsrar�r��
build_tempr�Z
fixed_argsZlib_optsZldflagsZexport_optsZsym�ld_argsZdll_nameZdll_extZimplib_filer�ZmfinfoZ
mffilename�mfidZout_argrrr�link6s��
��

��

��


�
zMSVCCompiler.linkcCs,tj�|tj�|�d�}|�d|�dS)Nz	.manifest�/MANIFESTFILE:)rYrr^r�r )r<r�r�r��
temp_manifestrrrr��s
�z"MSVCCompiler.manifest_setup_ldargscCs^|D]"}|�d�r|�dd�d}q,qdS|tjkr<d}nd}|�|�}|dkrVdS||fS)Nr��:rrO)�
startswithrTrr��_remove_visual_c_ref)r<r�r��argr�r�rrrr��s


z$MSVCCompiler.manifest_get_embed_infocCs�z�t|�}z|��}W5|��Xt�dtj�}t�|d|�}d}t�|d|�}t�dtj�}t�||�dkrtWdSt|d�}z|�|�|W�WS|��XWnt	k
r�YnXdS)NzU<assemblyIdentity.*?name=("|')Microsoft\.VC\d{2}\.CRT("|').*?(/>|</assemblyIdentity>)r�z*<dependentAssembly>\s*</dependentAssembly>zI<assemblyIdentity.*?name=(?:"|')(.+?)(?:"|').*?(?:/>|</assemblyIdentity>)�w)
�openrs�read�rer��DOTALLrI�search�write�OSError)r<Z
manifest_fileZ
manifest_fZmanifest_buf�patternrrrr��s2	
��


z!MSVCCompiler._remove_visual_c_refcCsd|S)Nz	/LIBPATH:r�r<�dirrrr�library_dir_option�szMSVCCompiler.library_dir_optioncCstd��dS)Nz<don't know how to set runtime library search path for MSVC++)rr�rrr�runtime_library_dir_option�s�z'MSVCCompiler.runtime_library_dir_optioncCs
|�|�Sr)r�)r<rkrrr�library_option�szMSVCCompiler.library_optioncCs\|r|d|g}n|g}|D]:}|D]0}tj�||�|��}tj�|�r$|Sq$qdS)NZ_d)rYrr^r��exists)r<�dirsrkraZ	try_namesr�r)Zlibfilerrr�find_library_file�szMSVCCompiler.find_library_filecCsz|jD].}tj�tj�|�|�}tj�|�r|Sqtjd�d�D].}tj�tj�|�|�}tj�|�rF|SqF|S)a�Return path to an MSVC executable program.

        Tries to find the program in several places: first, one of the
        MSVC program search paths from the registry; next, the directories
        in the PATH environment variable.  If any of those work, return an
        absolute path that is known to exist.  If none of them work, just
        return the original program name, 'exe'.
        �Pathr�)r�rYrr^rfrgrcrT)r<ZexerD�fnrrrr�s	


zMSVCCompiler.find_exe)rrr)N)rr�)NNNrNNN)NrN)
NNNNNrNNNN)r) r1r2r3r4Z
compiler_typeZexecutablesr�r�r�r�r�r�r�Zstatic_lib_extensionZshared_lib_extensionZstatic_lib_formatZshared_lib_formatZ
exe_extensionr>r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr+sl
��

W�
 �
X�
�
_+
r)r
)1r4rYrprQr�Zdistutils.errorsrrrrrZdistutils.ccompilerrrr	Z	distutilsr
Zdistutils.utilr�winregZ	OpenKeyExrZEnumKeyrZ	EnumValuer&�errorrZ
HKEY_USERS�HKEY_CURRENT_USER�HKEY_LOCAL_MACHINEZHKEY_CLASSES_ROOTr�platform�maxsizeZNATIVE_WIN64r9rCrBr�rr7rXr\r_rir~r�rrrrr�<module>sP��>.#
)
distutils/__pycache__/msvc9compiler.cpython-38.opt-2.pyc000064400000036730151153537450017206 0ustar00U

e5d/w�@sNddlZddlZddlZddlZddlmZmZmZmZm	Z	ddl
mZmZm
Z
ddlmZddlmZddlZejZejZejZejZejejejejfZej dko�ej!dkZ"e"r�dZ#d	Z$d
Z%ndZ#dZ$d
Z%ddd�Z&Gdd�d�Z'Gdd�d�Z(dd�Z)dd�Z*dd�Z+dd�Z,d#dd�Z-e)�Z.e.dk�r:ed e.��Gd!d"�d"e�Z/dS)$�N)�DistutilsExecError�DistutilsPlatformError�CompileError�LibError�	LinkError)�	CCompiler�gen_preprocess_options�gen_lib_options)�log)�get_platform�win32lz1Software\Wow6432Node\Microsoft\VisualStudio\%0.1fz5Software\Wow6432Node\Microsoft\Microsoft SDKs\Windowsz,Software\Wow6432Node\Microsoft\.NETFrameworkz%Software\Microsoft\VisualStudio\%0.1fz)Software\Microsoft\Microsoft SDKs\Windowsz Software\Microsoft\.NETFramework�x86Zamd64�rz	win-amd64c@sLeZdZdd�Zee�Zdd�Zee�Zdd�Zee�Zdd�Zee�Zd	S)
�RegcCs:tD](}|�||�}|r||kr||Sqt|��dS�N)�HKEYS�read_values�KeyError)�cls�path�key�base�d�r�//usr/lib64/python3.8/distutils/msvc9compiler.py�	get_value@s
z
Reg.get_valuecCsnzt||�}Wntk
r$YdSXg}d}zt||�}Wntk
rTYqjYnX|�|�|d7}q.|S�Nr�)�RegOpenKeyEx�RegError�
RegEnumKey�append)rrr�handle�L�i�krrr�	read_keysHs


z
Reg.read_keysc	Cs�zt||�}Wntk
r$YdSXi}d}zt||�\}}}Wntk
rZYq�YnX|��}|�|�||�|�<|d7}q.|Sr)rr�RegEnumValue�lower�convert_mbcs)	rrrr"rr$�name�value�typerrrrZs

zReg.read_valuescCs:t|dd�}|dk	r6z|d�}Wntk
r4YnX|S)N�decode�mbcs)�getattr�UnicodeError)�sZdecrrrr)pszReg.convert_mbcsN)	�__name__�
__module__�__qualname__r�classmethodr&rr)�staticmethodrrrrr<src@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�
MacroExpandercCsi|_t||_|�|�dSr)�macros�VS_BASE�vsbase�load_macros)�self�versionrrr�__init__|s
zMacroExpander.__init__cCst�||�|jd|<dS)Nz$(%s))rrr8)r<Zmacrorrrrr�	set_macro�szMacroExpander.set_macroc	Cs|�d|jdd�|�d|jdd�|�dtd�z$|dkrP|�d	td
�ntd
��Wntk
rvtd��YnX|dkr�|�d
|jd�|�dtd�nbd}tD]X}zt||�}Wntk
r�Yq�YnXt	|d�}t
�|d||f�}|d|jd<q�dS)NZVCInstallDirz	\Setup\VC�
productdirZVSInstallDirz	\Setup\VSZFrameworkDirZinstallroot� @ZFrameworkSDKDirzsdkinstallrootv2.0aPython was built with Visual Studio 2008;
extensions must be built with a compiler than can generate compatible binaries.
Visual Studio 2008 was not found on this system. If you have Cygwin installed,
you can try compiling with MingW32, by passing "-c mingw32" to setup.py.g"@ZFrameworkVersionzclr versionZ
WindowsSdkDirZcurrentinstallfolderz.Software\Microsoft\NET Framework Setup\Productrz%s\%sr=z$(FrameworkVersion))
r?r:�NET_BASErr�WINSDK_BASErrrr rrr8)r<r=�pr�hrrrrrr;�s2��


zMacroExpander.load_macroscCs$|j��D]\}}|�||�}q
|Sr)r8�items�replace)r<r1r%�vrrr�sub�szMacroExpander.subN)r2r3r4r>r?r;rIrrrrr7zsr7cCs�d}tj�|�}|dkrdS|t|�}tj|d��dd�\}}t|dd��d}|dkrf|d7}t|dd	��d
}|dkr�d}|dkr�||SdS)NzMSC v.����� r����
��g$@r)�sysr=�find�len�split�int)�prefixr$r1�restZmajorVersionZminorVersionrrr�get_build_version�srXcCs0g}|D]"}tj�|�}||kr|�|�q|Sr)�osr�normpathr!)�pathsZ
reduced_pathsrDZnprrr�normalize_and_reduce_paths�sr\cCs<|�tj�}g}|D]}||kr|�|�qtj�|�}|Sr)rTrY�pathsepr!�join)ZvariableZoldListZnewListr$ZnewVariablerrr�removeDuplicates�sr_cCst|}zt�d|d�}Wn"tk
r>t�d�d}YnX|rPtj�|�s�d|}tj	�
|d�}|r�tj�|�r�tj�|tjtjd�}tj�
|�}tj�|�s�t�d|�dSnt�d|�|s�t�d�dStj�|d	�}tj�|�r�|St�d
�dS)Nz%s\Setup\VCr@z%Unable to find productdir in registryzVS%0.f0COMNTOOLSZVCz%s is not a valid directoryz Env var %s is not set or invalidzNo productdir foundz
vcvarsall.bat�Unable to find vcvarsall.bat)r9rrrr
�debugrYr�isdir�environ�getr^�pardir�abspath�isfile)r=r:r@ZtoolskeyZtoolsdir�	vcvarsallrrr�find_vcvarsall�s4
�



ricCs8t|�}ddddh}i}|dkr(td��t�d||�tjd||ftjtjd�}z�|�
�\}}|��d	krzt|�d
���|�d
�}|�
d�D]d}t�|�}d|kr�q�|��}|�
dd
�\}	}
|	��}	|	|kr�|
�tj�r�|
dd�}
t|
�||	<q�W5|j��|j	��Xt|�t|�k�r4ttt|������|S)N�include�libZlibpathrr`z'Calling 'vcvarsall.bat %s' (version=%s)z
"%s" %s & set)�stdout�stderrrr.�
�=rrJ)rirr
ra�
subprocess�Popen�PIPErl�closermZcommunicate�waitr-rTrr)�stripr(�endswithrYr]r_rS�
ValueError�str�list�keys)r=ZarchrhZinteresting�result�popenrlrm�linerr+rrr�query_vcvarsall�s>�


r~rAz(VC %0.1f is not supported by this modulec
@s�eZdZdZiZdgZdddgZdgZdgZeeeeZ	dZ
d	Zd
ZdZ
dZZd
Zd-dd�Zd.dd�Zd/dd�Zd0dd�Zd1dd�Zd2dd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd3d)d*�Zd+d,�ZdS)4�MSVCCompilerZmsvcz.cz.ccz.cppz.cxx�.rcz.mcz.resz.objz.libz.dllz%s%sz.exercCs8t�||||�t|_d|_g|_d|_d|_d|_dS)NzSoftware\Microsoft\VisualStudioF)	rr>�VERSION�_MSVCCompiler__versionZ_MSVCCompiler__root�_MSVCCompiler__paths�	plat_name�_MSVCCompiler__arch�initialized)r<�verboseZdry_runZforcerrrr>IszMSVCCompiler.__init__NcCs|dkrt�}d}||kr(td|f��dtjkrfdtjkrf|�d�rfd|_d|_d|_d|_d	|_	n�|t�ksx|d
kr�t
|}nt
t�dt
|}tt|�}|d�
tj�|_|d
tjd
<|dtjd<t|j�dkr�td|j��|�d�|_|�d�|_|�d�|_|�d�|_|�d	�|_	z(tjd�
d�D]}|j�|��q:Wntk
�rfYnXt|j�|_d�|j�tjd<d|_|jdk�r�dddddg|_ddddddg|_n&ddddddg|_dddddddg|_dddg|_|jdk�rddd d!g|_dg|_d"|_dS)#Nrz--plat-name must be one of %sZDISTUTILS_USE_SDKZMSSdkzcl.exezlink.exezlib.exezrc.exezmc.exer�_rrkrjrzxPython was built with %s, and extensions need to be built with the same version of the compiler, but it isn't installed.�;r
z/nologoz/Oxz/MDz/W3z/DNDEBUGz/Odz/MDdz/Z7z/D_DEBUGz/GS-z/DLLz/INCREMENTAL:NO�z/INCREMENTAL:noz/DEBUGT)rrrYrc�find_exe�cc�linkerrk�rc�mc�PLAT_TO_VCVARSr~r�rTr]r�rSZ_MSVCCompiler__productr!rr\r^Zpreprocess_optionsr��compile_options�compile_options_debug�ldflags_sharedr��ldflags_shared_debugZldflags_staticr�)r<r�Zok_platsZ	plat_specZvc_envrDrrr�
initializeTs~�
�
���
�
��zMSVCCompiler.initialize�cCs�|dkrd}g}|D]�}tj�|�\}}tj�|�d}|tj�|�d�}||jkrbtd|��|rrtj�|�}||jkr�|�	tj�
|||j��q||jkr�|�	tj�
|||j��q|�	tj�
|||j
��q|S)Nr�rzDon't know how to compile %s)rYr�splitext�
splitdrive�isabs�src_extensionsr�basename�_rc_extensionsr!r^�
res_extension�_mc_extensions�
obj_extension)r<Zsource_filenamesZ	strip_dir�
output_dirZ	obj_namesZsrc_namer�extrrr�object_filenames�s.

�
��zMSVCCompiler.object_filenamesc	Csp|js|��|�||||||�}	|	\}}
}}}|p6g}
|
�d�|rT|
�|j�n|
�|j�|
D�]}z||\}}Wntk
r�YqdYnX|r�tj	�
|�}||jkr�d|}�nT||jkr�d|}�n>||j
k�r<|}d|}z"|�|jg||g|g�Wqdtk
�r6}zt|��W5d}~XYqdXqdn�||jk�r�tj	�|�}tj	�|�}zl|�|jgd|d|g|g�tj	�tj	�|��\}}tj	�||d�}|�|jgd|g|g�Wqdtk
�r�}zt|��W5d}~XYqdXqdntd||f��d	|}z&|�|jg|
|||g|�Wqdtk
�rh}zt|��W5d}~XYqdXqd|
S)
Nz/cz/Tcz/Tpz/foz-hz-rr�z"Don't know how to compile %s to %sz/Fo)r�r�Z_setup_compiler!�extendr�r�rrYrrf�
_c_extensions�_cpp_extensionsr��spawnr�rrr��dirnamer�r�r�r^r�)r<Zsourcesr�r8Zinclude_dirsra�
extra_preargs�extra_postargsZdependsZcompile_info�objectsZpp_optsZbuildZcompile_opts�obj�srcr�Z	input_optZ
output_opt�msgZh_dirZrc_dirrr�Zrc_filerrr�compile�s�
�




��


��
��
���
zMSVCCompiler.compilec	
Cs�|js|��|�||�\}}|j||d�}|�||�r�|d|g}|rJz|�|jg|�Wq�tk
r�}zt|��W5d}~XYq�Xnt	�
d|�dS)N)r��/OUT:�skipping %s (up-to-date))r�r��_fix_object_args�library_filename�
_need_linkr�rkrrr
ra)	r<r�Zoutput_libnamer�ra�target_lang�output_filenameZlib_argsr�rrr�create_static_libs�zMSVCCompiler.create_static_libc
CsT|js|��|�||�\}}|�|||�}|\}}}|rL|�dt|��t||||�}|dk	rptj�	||�}|�
||��rD|tjkr�|	r�|j
dd�}q�|jdd�}n|	r�|j
}n|j}g}|p�gD]}|�d|�q�||||d|g}tj�|d�}|dk	�rLtj�tj�|��\}}tj�	||�|��}|�d|�|�|||�|
�rl|
|dd�<|�r||�|�|�tj�|��z|�|jg|�Wn,tk
�r�}zt|��W5d}~XYnX|�||�}|dk	�rP|\}}d||f}z|�dd	d
||g�Wn,tk
�r@}zt|��W5d}~XYnXnt�d|�dS)Nz5I don't know what to do with 'runtime_library_dirs': rz/EXPORT:r�rz/IMPLIB:z-outputresource:%s;%szmt.exez-nologoz	-manifestr�)r�r�r�Z
_fix_lib_args�warnrxr	rYrr^r�r�
EXECUTABLEr�r�r!r�r�r�r��manifest_setup_ldargsr�Zmkpathr�r�rr�manifest_get_embed_infor
ra)r<�target_descr�r�r�Z	librariesZlibrary_dirsZruntime_library_dirsZexport_symbolsrar�r��
build_tempr�Z
fixed_argsZlib_optsZldflagsZexport_optsZsym�ld_argsZdll_nameZdll_extZimplib_filer�ZmfinfoZ
mffilename�mfidZout_argrrr�link6s��
��

��

��


�
zMSVCCompiler.linkcCs,tj�|tj�|�d�}|�d|�dS)Nz	.manifest�/MANIFESTFILE:)rYrr^r�r!)r<r�r�r��
temp_manifestrrrr��s
�z"MSVCCompiler.manifest_setup_ldargscCs^|D]"}|�d�r|�dd�d}q,qdS|tjkr<d}nd}|�|�}|dkrVdS||fS)Nr��:rrO)�
startswithrTrr��_remove_visual_c_ref)r<r�r��argr�r�rrrr��s


z$MSVCCompiler.manifest_get_embed_infocCs�z�t|�}z|��}W5|��Xt�dtj�}t�|d|�}d}t�|d|�}t�dtj�}t�||�dkrtWdSt|d�}z|�|�|W�WS|��XWnt	k
r�YnXdS)NzU<assemblyIdentity.*?name=("|')Microsoft\.VC\d{2}\.CRT("|').*?(/>|</assemblyIdentity>)r�z*<dependentAssembly>\s*</dependentAssembly>zI<assemblyIdentity.*?name=(?:"|')(.+?)(?:"|').*?(?:/>|</assemblyIdentity>)�w)
�openrs�read�rer��DOTALLrI�search�write�OSError)r<Z
manifest_fileZ
manifest_fZmanifest_buf�patternrrrr��s2	
��


z!MSVCCompiler._remove_visual_c_refcCsd|S)Nz	/LIBPATH:r�r<�dirrrr�library_dir_option�szMSVCCompiler.library_dir_optioncCstd��dS)Nz<don't know how to set runtime library search path for MSVC++)rr�rrr�runtime_library_dir_option�s�z'MSVCCompiler.runtime_library_dir_optioncCs
|�|�Sr)r�)r<rkrrr�library_option�szMSVCCompiler.library_optioncCs\|r|d|g}n|g}|D]:}|D]0}tj�||�|��}tj�|�r$|Sq$qdS)NZ_d)rYrr^r��exists)r<�dirsrkraZ	try_namesr�r*Zlibfilerrr�find_library_file�szMSVCCompiler.find_library_filecCsz|jD].}tj�tj�|�|�}tj�|�r|Sqtjd�d�D].}tj�tj�|�|�}tj�|�rF|SqF|S)N�Pathr�)r�rYrr^rfrgrcrT)r<ZexerD�fnrrrr�s	


zMSVCCompiler.find_exe)rrr)N)rr�)NNNrNNN)NrN)
NNNNNrNNNN)r)r2r3r4Z
compiler_typeZexecutablesr�r�r�r�r�r�r�Zstatic_lib_extensionZshared_lib_extensionZstatic_lib_formatZshared_lib_formatZ
exe_extensionr>r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr+sj
��

W�
 �
X�
�
_+
r)r
)0rYrprQr�Zdistutils.errorsrrrrrZdistutils.ccompilerrrr	Z	distutilsr
Zdistutils.utilr�winregZ	OpenKeyExrZEnumKeyr Z	EnumValuer'�errorrZ
HKEY_USERS�HKEY_CURRENT_USER�HKEY_LOCAL_MACHINEZHKEY_CLASSES_ROOTr�platform�maxsizeZNATIVE_WIN64r9rCrBr�rr7rXr\r_rir~r�rrrrr�<module>sN��>.#
)
distutils/__pycache__/msvccompiler.cpython-38.pyc000064400000034605151153537450016154 0ustar00U

e5d\�@s�dZddlZddlZddlmZmZmZmZmZddl	m
Z
mZmZddl
mZdZz,ddlZdZeZejZejZejZejZWnhek
r�z4ddlZddlZdZeZejZejZejZejZWnek
r�e�d�YnXYnXe�rejejej ej!fZ"d	d
�Z#dd�Z$d
d�Z%Gdd�d�Z&dd�Z'dd�Z(dd�Z)Gdd�de
�Z*e'�dk�r�e�+d�e*Z,ddl-m*Z*ddl-m&Z&dS)z�distutils.msvccompiler

Contains MSVCCompiler, an implementation of the abstract CCompiler class
for the Microsoft Visual Studio.
�N)�DistutilsExecError�DistutilsPlatformError�CompileError�LibError�	LinkError)�	CCompiler�gen_preprocess_options�gen_lib_options)�logFTz�Warning: Can't read registry to find the necessary compiler setting
Make sure that Python modules winreg, win32api or win32con are installed.cCsnzt||�}Wntk
r$YdSXg}d}zt||�}Wntk
rTYqjYnX|�|�|d7}q.|S)zReturn list of registry keys.Nr�)�RegOpenKeyEx�RegError�
RegEnumKey�append)�base�key�handle�L�i�k�r�./usr/lib64/python3.8/distutils/msvccompiler.py�	read_keys7s


rcCs�zt||�}Wntk
r$YdSXi}d}zt||�\}}}Wntk
rZYq~YnX|��}t|�|t|�<|d7}q.|S)zXReturn dict of registry keys and values.

    All names are converted to lowercase.
    Nrr)rr
�RegEnumValue�lower�convert_mbcs)rrr�dr�name�value�typerrr�read_valuesHs

r cCs:t|dd�}|dk	r6z|d�}Wntk
r4YnX|S)N�decode�mbcs)�getattr�UnicodeError)�sZdecrrrr]src@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�
MacroExpandercCsi|_|�|�dS�N)�macros�load_macros)�self�versionrrr�__init__gszMacroExpander.__init__cCs2tD](}t||�}|r|||jd|<q.qdS)Nz$(%s))�HKEYSr r()r*Zmacro�pathrrrrrr�	set_macroks

zMacroExpander.set_macroc

Cs�d|}|�d|dd�|�d|dd�d}|�d|d	�z*|d
krX|�d|d�n|�d|d
�Wn*tk
r�}ztd��W5d}~XYnXd}tD]V}zt||�}Wntk
r�Yq�YnXt|d�}t|d||f�}	|	d|jd<q�dS)Nz%Software\Microsoft\VisualStudio\%0.1fZVCInstallDirz	\Setup\VCZ
productdirZVSInstallDirz	\Setup\VSz Software\Microsoft\.NETFrameworkZFrameworkDirZinstallrootg@ZFrameworkSDKDirzsdkinstallrootv1.1ZsdkinstallrootaPython was built with Visual Studio 2003;
extensions must be built with a compiler than can generate compatible binaries.
Visual Studio 2003 was not found on this system. If you have Cygwin installed,
you can try compiling with MingW32, by passing "-c mingw32" to setup.py.z.Software\Microsoft\NET Framework Setup\Productrz%s\%sr+z$(FrameworkVersion))	r/�KeyErrorrr-rr
rr r()
r*r+ZvsbaseZnet�exc�pr�hrrrrrr)rs,�

zMacroExpander.load_macroscCs$|j��D]\}}|�||�}q
|Sr')r(�items�replace)r*r%r�vrrr�sub�szMacroExpander.subN)�__name__�
__module__�__qualname__r,r/r)r7rrrrr&fsr&cCs�d}tj�|�}|dkrdS|t|�}tj|d��dd�\}}t|dd��d}|dkrf|d7}t|d	d
��d}|dkr�d}|dkr�||SdS)
z�Return the version of MSVC that was used to build Python.

    For Python 2.3 and up, the version number is included in
    sys.version.  For earlier versions, assume the compiler is MSVC 6.
    zMSC v.����N� r����
��g$@r)�sysr+�find�len�split�int)�prefixrr%�restZmajorVersionZminorVersionrrr�get_build_version�srIcCs@d}tj�|�}|dkrdStj�d|�}tj|t|�|�S)zUReturn the processor architecture.

    Possible results are "Intel" or "AMD64".
    z bit (r;�Intel�))rBr+rCrD)rGr�jrrr�get_build_architecture�srMcCs0g}|D]"}tj�|�}||kr|�|�q|S)znReturn a list of normalized paths with duplicates removed.

    The current order of paths is maintained.
    )�osr.�normpathr)�pathsZ
reduced_pathsr2Znprrr�normalize_and_reduce_paths�srQc
@s�eZdZdZdZiZdgZdddgZdgZdgZ	eeee	Z
d	Zd
ZdZ
dZd
ZZdZd-dd�Zdd�Zd.dd�Zd/dd�Zd0dd�Zd1dd�Zdd�Zd d!�Zd"d#�Zd2d$d%�Zd&d'�Zd3d)d*�Zd+d,�ZdS)4�MSVCCompilerzwConcrete class that implements an interface to Microsoft Visual C++,
       as defined by the CCompiler abstract class.Zmsvcz.cz.ccz.cppz.cxx�.rcz.mcz.resz.objz.libz.dllz%s%sz.exercCsvt�||||�t�|_t�|_|jdkr\|jdkrHd|_t|j�|_nd|_d|j|_	nd|jd|_	d|_
dS)	NrJ�zSoftware\Microsoft\VisualStudiozSoftware\Microsoft\DevstudiozVisual Studio version %szMicrosoft SDK compiler %sr<F)rr,rI�_MSVCCompiler__versionrM�_MSVCCompiler__arch�_MSVCCompiler__rootr&�_MSVCCompiler__macros�_MSVCCompiler__product�initialized)r*�verboseZdry_runZforcerrrr,�s

zMSVCCompiler.__init__cCs�g|_dtjkrDdtjkrD|�d�rDd|_d|_d|_d|_d|_nx|�	d�|_t
|j�d	krltd
|j��|�d�|_|�d�|_|�d�|_|�d�|_|�d�|_|�
d�|�
d�z&tjd�d
�D]}|j�|�q�Wntk
r�YnXt|j�|_d
�|j�tjd<d|_|jdk�rPddddddg|_dddddddg|_n&ddddddg|_dddddddg|_dddg|_|jdk�r�ddddg|_ndddddg|_dg|_d |_dS)!NZDISTUTILS_USE_SDKZMSSdkzcl.exezlink.exezlib.exezrc.exezmc.exer.rzxPython was built with %s, and extensions need to be built with the same version of the compiler, but it isn't installed.�libZinclude�;rJz/nologoz/Oxz/MDz/W3z/GXz/DNDEBUGz/Odz/MDdz/Z7z/D_DEBUGz/GS-z/DLLz/INCREMENTAL:NOrTz/INCREMENTAL:noz/DEBUGz	/pdb:NoneT)�_MSVCCompiler__pathsrN�environ�find_exe�cc�linkerr\�rc�mc�get_msvc_pathsrDrrY�set_path_env_varrErr0rQ�joinZpreprocess_optionsrV�compile_options�compile_options_debug�ldflags_sharedrU�ldflags_shared_debugZldflags_staticrZ)r*r2rrr�
initialize�sr�


�
�
�
���zMSVCCompiler.initialize�cCs�|dkrd}g}|D]�}tj�|�\}}tj�|�d}|tj�|�d�}||jkrbtd|��|rrtj�|�}||jkr�|�	tj�
|||j��q||jkr�|�	tj�
|||j��q|�	tj�
|||j
��q|S)NrmrzDon't know how to compile %s)rNr.�splitext�
splitdrive�isabs�src_extensionsr�basename�_rc_extensionsrrg�
res_extension�_mc_extensions�
obj_extension)r*Zsource_filenamesZ	strip_dir�
output_dirZ	obj_namesZsrc_namer�extrrr�object_filenames8s.

�
��zMSVCCompiler.object_filenamesNc	Csp|js|��|�||||||�}	|	\}}
}}}|p6g}
|
�d�|rT|
�|j�n|
�|j�|
D�]}z||\}}Wntk
r�YqdYnX|r�tj	�
|�}||jkr�d|}�nT||jkr�d|}�n>||j
k�r<|}d|}z"|�|jg||g|g�Wqdtk
�r6}zt|��W5d}~XYqdXqdn�||jk�r�tj	�|�}tj	�|�}zl|�|jgd|d|g|g�tj	�tj	�|��\}}tj	�||d�}|�|jgd|g|g�Wqdtk
�r�}zt|��W5d}~XYqdXqdntd||f��d	|}z&|�|jg|
|||g|�Wqdtk
�rh}zt|��W5d}~XYqdXqd|
S)
Nz/cz/Tcz/Tpz/foz-hz-rrSz"Don't know how to compile %s to %sz/Fo)rZrlZ_setup_compiler�extendrirhr0rNr.�abspath�
_c_extensions�_cpp_extensionsrs�spawnrcrrru�dirnamerdrnrrrgra)r*Zsourcesrwr(Zinclude_dirs�debug�
extra_preargs�extra_postargsZdependsZcompile_info�objectsZpp_optsZbuildZcompile_opts�obj�srcrxZ	input_optZ
output_opt�msgZh_dirZrc_dirr�_Zrc_filerrr�compileWs�
�




��


��
��
���
zMSVCCompiler.compilec	
Cs�|js|��|�||�\}}|j||d�}|�||�r�|d|g}|rJz|�|jg|�Wq�tk
r�}zt|��W5d}~XYq�Xnt	�
d|�dS)N)rw�/OUT:�skipping %s (up-to-date))rZrl�_fix_object_args�library_filename�
_need_linkr~r\rrr
r�)	r*r�Zoutput_libnamerwr��target_lang�output_filenameZlib_argsr�rrr�create_static_lib�s�zMSVCCompiler.create_static_libc
Cs�|js|��|�||�\}}|�|||�}|\}}}|rL|�dt|��t||||�}|dk	rptj�	||�}|�
||��r�|tjkr�|	r�|j
dd�}q�|jdd�}n|	r�|j
}n|j}g}|p�gD]}|�d|�q�||||d|g}|dk	�rHtj�tj�|��\}}tj�	tj�|d�|�|��}|�d|�|
�rZ|
|dd�<|�rj|�|�|�tj�|��z|�|jg|�Wn,tk
�r�}zt|��W5d}~XYnXnt�d|�dS)Nz5I don't know what to do with 'runtime_library_dirs': rz/EXPORT:r�rz/IMPLIB:r�)rZrlr�Z
_fix_lib_args�warn�strr	rNr.rgr�rZ
EXECUTABLErkrjrrnrrrr�rzZmkpathr~rbrrr
r�)r*Ztarget_descr�r�rwZ	librariesZlibrary_dirsZruntime_library_dirsZexport_symbolsr�r�r�Z
build_tempr�Z
fixed_argsZlib_optsZldflagsZexport_optsZsymZld_argsZdll_nameZdll_extZimplib_filer�rrr�link�sj�
��

��

��
zMSVCCompiler.linkcCsd|S)Nz	/LIBPATH:r�r*�dirrrr�library_dir_optionszMSVCCompiler.library_dir_optioncCstd��dS)Nz<don't know how to set runtime library search path for MSVC++)rr�rrr�runtime_library_dir_options�z'MSVCCompiler.runtime_library_dir_optioncCs
|�|�Sr')r�)r*r\rrr�library_optionszMSVCCompiler.library_optioncCs\|r|d|g}n|g}|D]:}|D]0}tj�||�|��}tj�|�r$|Sq$qdS)NZ_d)rNr.rgr��exists)r*�dirsr\r�Z	try_namesr�rZlibfilerrr�find_library_file#szMSVCCompiler.find_library_filecCsz|jD].}tj�tj�|�|�}tj�|�r|Sqtjd�d�D].}tj�tj�|�|�}tj�|�rF|SqF|S)a�Return path to an MSVC executable program.

        Tries to find the program in several places: first, one of the
        MSVC program search paths from the registry; next, the directories
        in the PATH environment variable.  If any of those work, return an
        absolute path that is known to exist.  If none of them work, just
        return the original program name, 'exe'.
        �Pathr])r^rNr.rgr{�isfiler_rE)r*Zexer2�fnrrrr`5s	


zMSVCCompiler.find_exe�x86cCs�tsgS|d}|jdkr,d|j|jf}nd|j|f}tD]H}t||�}|r>|jdkrt|j�||��d�S||�d�Sq>|jdkr�tD]&}t|d|j�dk	r�|�d	�q�q�gS)
z�Get a list of devstudio directories (include, lib or path).

        Return a list of strings.  The list will be empty if unable to
        access the registry or appropriate registry keys not found.
        z dirsrTz6%s\%0.1f\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directoriesz?%s\6.0\Build System\Components\Platforms\Win32 (%s)\Directoriesr]r<z%s\6.0Nz�It seems you have Visual Studio 6 installed, but the expected registry settings are not present.
You must at least run the Visual Studio GUI once so that these entries are created.)	�
_can_read_regrUrWr-r rXr7rEr�)r*r.�platformrrrrrrreKs,

��



zMSVCCompiler.get_msvc_pathscCs6|dkr|�d�}n
|�|�}|r2d�|�tj|<dS)z�Set environment variable 'name' to an MSVC path type value.

        This is equivalent to a SET command prior to execution of spawned
        commands.
        r\Zlibraryr]N)rergrNr_)r*rr2rrrrfos

zMSVCCompiler.set_path_env_var)rrr)rrm)NNNrNNN)NrN)
NNNNNrNNNN)r)r�)r8r9r:�__doc__Z
compiler_typeZexecutablesr|r}rsrurqrtrvZstatic_lib_extensionZshared_lib_extensionZstatic_lib_formatZshared_lib_formatZ
exe_extensionr,rlryr�r�r�r�r�r�r�r`rerfrrrrrR�sj
��
B�
 �
X�
�
S

$rRg @z3Importing new compiler from distutils.msvc9compiler)rR)r&).r�rBrNZdistutils.errorsrrrrrZdistutils.ccompilerrrr	Z	distutilsr
r��winregZhkey_modZ	OpenKeyExrZEnumKeyrZ	EnumValuer�errorr
�ImportErrorZwin32apiZwin32con�infoZ
HKEY_USERS�HKEY_CURRENT_USER�HKEY_LOCAL_MACHINEZHKEY_CLASSES_ROOTr-rr rr&rIrMrQrRr�ZOldMSVCCompilerZdistutils.msvc9compilerrrrr�<module>s`



�	-
9
distutils/__pycache__/log.cpython-38.pyc000064400000004415151153537450014226 0ustar00U

e5d��@sldZdZdZdZdZdZddlZGdd	�d	�Ze�Zej	Z	ej
Z
ejZejZej
Z
ejZd
d�Zdd
�ZdS)z,A simple log mechanism styled after PEP 282.������Nc@sPeZdZefdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�ZdS)�LogcCs
||_dS�N)�	threshold)�selfr	�r�%/usr/lib64/python3.8/distutils/log.py�__init__szLog.__init__cCs�|tttttfkr"tdt|���||jkr�|r8||}|tttfkrNtj	}ntj
}z|�d|�Wn:tk
r�|j
}|�|d��|�}|�d|�YnX|��dS)Nz%s wrong log levelz%s
�backslashreplace)�DEBUG�INFO�WARN�ERROR�FATAL�
ValueError�strr	�sys�stderr�stdout�write�UnicodeEncodeError�encoding�encode�decode�flush)r
�level�msg�args�streamrrrr�_logs
zLog._logcGs|�|||�dSr)r#)r
rr r!rrr�log'szLog.logcGs|�t||�dSr)r#r�r
r r!rrr�debug*sz	Log.debugcGs|�t||�dSr)r#rr%rrr�info-szLog.infocGs|�t||�dSr)r#rr%rrr�warn0szLog.warncGs|�t||�dSr)r#rr%rrr�error3sz	Log.errorcGs|�t||�dSr)r#rr%rrr�fatal6sz	Log.fatalN)�__name__�
__module__�__qualname__rr
r#r$r&r'r(r)r*rrrrrsrcCstj}|t_|Sr)�_global_logr	)r�oldrrr�
set_thresholdAsr0cCs8|dkrtt�n"|dkr$tt�n|dkr4tt�dS)Nrrr)r0rrr)�vrrr�
set_verbosityGs

r2)�__doc__rrrrrrrr.r$r&r'r(r)r*r0r2rrrr�<module>s +distutils/__pycache__/unixccompiler.cpython-38.opt-2.pyc000064400000014325151153537450017267 0ustar00U

&�.e�;�@s�ddlZddlZddlZddlmZddlmZddlmZm	Z	m
Z
ddlmZm
Z
mZmZddlmZejdkrzddlZGdd	�d	e�ZdS)
�N)�	sysconfig)�newer)�	CCompiler�gen_preprocess_options�gen_lib_options)�DistutilsExecError�CompileError�LibError�	LinkError)�log�darwinc
s�eZdZdZddgdgdgddgdgddgdd�Zejdd�d	krNd
ged
<ddd
dddgZdZdZ	dZ
dZdZdZ
ZZeZejdkr�dZ�fdd�Zd.dd�Zdd�Zd/d d!�Zd0d"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd1d,d-�Z�ZS)2�
UnixCCompilerZunixNZccz-sharedZarz-cr)�preprocessor�compiler�compiler_so�compiler_cxx�	linker_so�
linker_exe�archiver�ranlib�rrz.cz.Cz.ccz.cxxz.cppz.mz.oz.az.soz.dylibz.tbdzlib%s%s�cygwinz.execs@t��|||�\}}}t�d�}|r6||kr6|�|�|||fS)NZLIBDIR)�super�
_fix_lib_argsr�get_config_var�remove)�self�	libraries�library_dirs�runtime_library_dirsZlibdir��	__class__��//usr/lib64/python3.8/distutils/unixccompiler.pyrUs�


zUnixCCompiler._fix_lib_argsc
Cs�|�d||�}|\}}}t||�}	|j|	}
|r>|
�d|g�|rN||
dd�<|r\|
�|�|
�|�|js~|dks~t||�r�|r�|�tj	�
|��z|�|
�Wn*tk
r�}zt
|��W5d}~XYnXdS)N�-or)Z_fix_compile_argsrr�extend�appendZforcer�mkpath�os�path�dirname�spawnrr)r�sourceZoutput_fileZmacrosZinclude_dirs�
extra_preargs�extra_postargs�
fixed_args�ignore�pp_optsZpp_args�msgr"r"r#�
preprocess^s$




zUnixCCompiler.preprocessc	
Csp|j}tjdkr t�|||�}z |�|||d|g|�Wn*tk
rj}zt|��W5d}~XYnXdS)Nrr$)r�sys�platform�_osx_support�compiler_fixupr+rr)	r�obj�srcZextZcc_argsr.r1rr2r"r"r#�_compilexs
��
zUnixCCompiler._compilerc
Cs�|�||�\}}|j||d�}|�||�r�|�tj�|��|�|j|g||j	�|j
r�z|�|j
|g�Wq�tk
r�}zt|��W5d}~XYq�Xnt
�d|�dS)N)�
output_dir�skipping %s (up-to-date))�_fix_object_args�library_filename�
_need_linkr'r(r)r*r+r�objectsrrr	r�debug)rr@Zoutput_libnamer;rA�target_lang�output_filenamer2r"r"r#�create_static_lib�s$����	zUnixCCompiler.create_static_libc
Cs�|�||�\}}|�|||�}|\}}}t||||�}t|ttd�f�sPtd��|dk	rftj�	||�}|�
||��r�||j|d|g}|	r�dg|dd�<|
r�|
|dd�<|r�|�|�|�
tj�|��z�|tjkr�|jdd�}n|jdd�}|
dk�rr|j�rrd}tj�|d�dk�r@d}d||k�r@|d7}�q&tj�||�d	k�r\d}nd}|j||||<tjd
k�r�t�||�}|�||�Wn,tk
�r�}zt|��W5d}~XYnXnt�d|�dS)Nz%'output_dir' must be a string or Noner$z-grzc++�env��=Z	ld_so_aixrr<)r=rr�
isinstance�str�type�	TypeErrorr(r)�joinr?r@r%r'r*rZ
EXECUTABLErrr�basenamer4r5r6r7r+rr
rrA)rZtarget_descr@rCr;rrrZexport_symbolsrAr-r.Z
build_temprBr/Zlib_optsZld_argsZlinker�i�offsetr2r"r"r#�link�sZ�
���

zUnixCCompiler.linkcCsd|S)N�-Lr")r�dirr"r"r#�library_dir_option�sz UnixCCompiler.library_dir_optioncCsd|kpd|kS)NZgcczg++r")rZ
compiler_namer"r"r#�_is_gcc�szUnixCCompiler._is_gcccCs�tj�t�d��}tjdd�dkr,d|Stjdd�dkrFd|Stjdd�d	krz|�|�rnd
d|gSdd|gS|�|�r�t�d�d
kr�d|Sd|Snd|SdS)N�CCrrrQ�Zfreebsdz-Wl,-rpath=�zhp-uxz-Wl,+sz+sZGNULDZyesz-Wl,--enable-new-dtags,-Rz-Wl,-Rz-R)r(r)rMrrr4r5rT)rrRrr"r"r#�runtime_library_dir_option�s


z(UnixCCompiler.runtime_library_dir_optioncCsd|S)Nz-lr")r�libr"r"r#�library_optionszUnixCCompiler.library_optioncCs�|j|dd�}|j|dd�}|j|dd�}|j|dd�}tjdkr|t�d�}t�d|�}	|	dkrrt�t�d	��}
n
|	�	d
�}
|D�] }t
j�||�}t
j�||�}
t
j�||�}t
j�||�}tjdk�rL|�
d�s�|�
d��rL|�
d
��sLt
j�|
|d
d�|�}t
j�|
|d
d�|�}
t
j�|
|d
d�|�}t
j�|
|d
d�|�}t
j�|
��rb|
St
j�|��rx|St
j�|��r�|St
j�|�r�|Sq�dS)N�shared)Zlib_type�dylib�
xcode_stub�staticrZCFLAGSz-isysroot\s*(\S+)rUrFz/System/z/usr/z/usr/local/)r>r4r5rr�re�searchr6Z_default_sysroot�groupr(r)rL�
startswith�exists)r�dirsrYrAZshared_fZdylib_fZxcode_stub_fZstatic_fZcflags�mZsysrootrRr[r\r^r]r"r"r#�find_library_filesF



���
zUnixCCompiler.find_library_file)NNNNN)NrN)
NNNNNrNNNN)r)�__name__�
__module__�__qualname__Z
compiler_typeZexecutablesr4r5Zsrc_extensionsZ
obj_extensionZstatic_lib_extensionZshared_lib_extensionZdylib_lib_extensionZxcode_stub_lib_extensionZstatic_lib_formatZshared_lib_formatZdylib_lib_formatZxcode_stub_lib_formatZ
exe_extensionrr3r:rDrPrSrTrXrZrf�
__classcell__r"r"r r#r
-sb�


	�
�
�
B*r
)r(r4r_Z	distutilsrZdistutils.dep_utilrZdistutils.ccompilerrrrZdistutils.errorsrrr	r
rr5r6r
r"r"r"r#�<module>s
distutils/__pycache__/msvccompiler.cpython-38.opt-2.pyc000064400000031536151153537450017114 0ustar00U

e5d\�@s�ddlZddlZddlmZmZmZmZmZddlm	Z	m
Z
mZddlm
Z
dZz,ddlZdZeZejZejZejZejZWnhek
r�z4ddlZddlZdZeZejZejZejZejZWnek
r�e
�d�YnXYnXer�ejejejej fZ!dd	�Z"d
d�Z#dd
�Z$Gdd�d�Z%dd�Z&dd�Z'dd�Z(Gdd�de	�Z)e&�dk�r~e
�*d�e)Z+ddl,m)Z)ddl,m%Z%dS)�N)�DistutilsExecError�DistutilsPlatformError�CompileError�LibError�	LinkError)�	CCompiler�gen_preprocess_options�gen_lib_options)�logFTz�Warning: Can't read registry to find the necessary compiler setting
Make sure that Python modules winreg, win32api or win32con are installed.cCsnzt||�}Wntk
r$YdSXg}d}zt||�}Wntk
rTYqjYnX|�|�|d7}q.|S�Nr�)�RegOpenKeyEx�RegError�
RegEnumKey�append)�base�key�handle�L�i�k�r�./usr/lib64/python3.8/distutils/msvccompiler.py�	read_keys7s


rcCs�zt||�}Wntk
r$YdSXi}d}zt||�\}}}Wntk
rZYq~YnX|��}t|�|t|�<|d7}q.|Sr)r
r�RegEnumValue�lower�convert_mbcs)rrr�dr�name�value�typerrr�read_valuesHs

r!cCs:t|dd�}|dk	r6z|d�}Wntk
r4YnX|S)N�decode�mbcs)�getattr�UnicodeError)�sZdecrrrr]src@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�
MacroExpandercCsi|_|�|�dS�N)�macros�load_macros)�self�versionrrr�__init__gszMacroExpander.__init__cCs2tD](}t||�}|r|||jd|<q.qdS)Nz$(%s))�HKEYSr!r))r+Zmacro�pathrrrrrr�	set_macroks

zMacroExpander.set_macroc

Cs�d|}|�d|dd�|�d|dd�d}|�d|d	�z*|d
krX|�d|d�n|�d|d
�Wn*tk
r�}ztd��W5d}~XYnXd}tD]V}zt||�}Wntk
r�Yq�YnXt|d�}t|d||f�}	|	d|jd<q�dS)Nz%Software\Microsoft\VisualStudio\%0.1fZVCInstallDirz	\Setup\VCZ
productdirZVSInstallDirz	\Setup\VSz Software\Microsoft\.NETFrameworkZFrameworkDirZinstallrootg@ZFrameworkSDKDirzsdkinstallrootv1.1ZsdkinstallrootaPython was built with Visual Studio 2003;
extensions must be built with a compiler than can generate compatible binaries.
Visual Studio 2003 was not found on this system. If you have Cygwin installed,
you can try compiling with MingW32, by passing "-c mingw32" to setup.py.z.Software\Microsoft\NET Framework Setup\Productrz%s\%sr,z$(FrameworkVersion))	r0�KeyErrorrr.r
rrr!r))
r+r,ZvsbaseZnet�exc�pr�hrrrrrr*rs,�

zMacroExpander.load_macroscCs$|j��D]\}}|�||�}q
|Sr()r)�items�replace)r+r&r�vrrr�sub�szMacroExpander.subN)�__name__�
__module__�__qualname__r-r0r*r8rrrrr'fsr'cCs�d}tj�|�}|dkrdS|t|�}tj|d��dd�\}}t|dd��d}|dkrf|d7}t|dd	��d
}|dkr�d}|dkr�||SdS)NzMSC v.����� r����
��g$@r)�sysr,�find�len�split�int)�prefixrr&�restZmajorVersionZminorVersionrrr�get_build_version�srJcCs@d}tj�|�}|dkrdStj�d|�}tj|t|�|�S)Nz bit (r<�Intel�))rCr,rDrE)rHr�jrrr�get_build_architecture�srNcCs0g}|D]"}tj�|�}||kr|�|�q|Sr()�osr/�normpathr)�pathsZ
reduced_pathsr3Znprrr�normalize_and_reduce_paths�srRc
@s�eZdZdZiZdgZdddgZdgZdgZeeeeZ	dZ
d	Zd
ZdZ
dZZd
Zd,dd�Zdd�Zd-dd�Zd.dd�Zd/dd�Zd0dd�Zdd�Zdd �Zd!d"�Zd1d#d$�Zd%d&�Zd2d(d)�Zd*d+�ZdS)3�MSVCCompilerZmsvcz.cz.ccz.cppz.cxx�.rcz.mcz.resz.objz.libz.dllz%s%sz.exercCsvt�||||�t�|_t�|_|jdkr\|jdkrHd|_t|j�|_nd|_d|j|_	nd|jd|_	d|_
dS)	NrK�zSoftware\Microsoft\VisualStudiozSoftware\Microsoft\DevstudiozVisual Studio version %szMicrosoft SDK compiler %sr=F)rr-rJ�_MSVCCompiler__versionrN�_MSVCCompiler__arch�_MSVCCompiler__rootr'�_MSVCCompiler__macros�_MSVCCompiler__product�initialized)r+�verboseZdry_runZforcerrrr-�s

zMSVCCompiler.__init__cCs�g|_dtjkrDdtjkrD|�d�rDd|_d|_d|_d|_d|_nx|�	d�|_t
|j�d	krltd
|j��|�d�|_|�d�|_|�d�|_|�d�|_|�d�|_|�
d�|�
d�z&tjd�d
�D]}|j�|�q�Wntk
r�YnXt|j�|_d
�|j�tjd<d|_|jdk�rPddddddg|_dddddddg|_n&ddddddg|_dddddddg|_dddg|_|jdk�r�ddddg|_ndddddg|_dg|_d |_dS)!NZDISTUTILS_USE_SDKZMSSdkzcl.exezlink.exezlib.exezrc.exezmc.exer/rzxPython was built with %s, and extensions need to be built with the same version of the compiler, but it isn't installed.�libZinclude�;rKz/nologoz/Oxz/MDz/W3z/GXz/DNDEBUGz/Odz/MDdz/Z7z/D_DEBUGz/GS-z/DLLz/INCREMENTAL:NOrUz/INCREMENTAL:noz/DEBUGz	/pdb:NoneT)�_MSVCCompiler__pathsrO�environ�find_exe�cc�linkerr]�rc�mc�get_msvc_pathsrErrZ�set_path_env_varrFrr1rR�joinZpreprocess_optionsrW�compile_options�compile_options_debug�ldflags_sharedrV�ldflags_shared_debugZldflags_staticr[)r+r3rrr�
initialize�sr�


�
�
�
���zMSVCCompiler.initialize�cCs�|dkrd}g}|D]�}tj�|�\}}tj�|�d}|tj�|�d�}||jkrbtd|��|rrtj�|�}||jkr�|�	tj�
|||j��q||jkr�|�	tj�
|||j��q|�	tj�
|||j
��q|S)NrnrzDon't know how to compile %s)rOr/�splitext�
splitdrive�isabs�src_extensionsr�basename�_rc_extensionsrrh�
res_extension�_mc_extensions�
obj_extension)r+Zsource_filenamesZ	strip_dir�
output_dirZ	obj_namesZsrc_namer�extrrr�object_filenames8s.

�
��zMSVCCompiler.object_filenamesNc	Csp|js|��|�||||||�}	|	\}}
}}}|p6g}
|
�d�|rT|
�|j�n|
�|j�|
D�]}z||\}}Wntk
r�YqdYnX|r�tj	�
|�}||jkr�d|}�nT||jkr�d|}�n>||j
k�r<|}d|}z"|�|jg||g|g�Wqdtk
�r6}zt|��W5d}~XYqdXqdn�||jk�r�tj	�|�}tj	�|�}zl|�|jgd|d|g|g�tj	�tj	�|��\}}tj	�||d�}|�|jgd|g|g�Wqdtk
�r�}zt|��W5d}~XYqdXqdntd||f��d	|}z&|�|jg|
|||g|�Wqdtk
�rh}zt|��W5d}~XYqdXqd|
S)
Nz/cz/Tcz/Tpz/foz-hz-rrTz"Don't know how to compile %s to %sz/Fo)r[rmZ_setup_compiler�extendrjrir1rOr/�abspath�
_c_extensions�_cpp_extensionsrt�spawnrdrrrv�dirnamererorsrhrb)r+Zsourcesrxr)Zinclude_dirs�debug�
extra_preargs�extra_postargsZdependsZcompile_info�objectsZpp_optsZbuildZcompile_opts�obj�srcryZ	input_optZ
output_opt�msgZh_dirZrc_dirr�_Zrc_filerrr�compileWs�
�




��


��
��
���
zMSVCCompiler.compilec	
Cs�|js|��|�||�\}}|j||d�}|�||�r�|d|g}|rJz|�|jg|�Wq�tk
r�}zt|��W5d}~XYq�Xnt	�
d|�dS)N)rx�/OUT:�skipping %s (up-to-date))r[rm�_fix_object_args�library_filename�
_need_linkrr]rrr
r�)	r+r�Zoutput_libnamerxr��target_lang�output_filenameZlib_argsr�rrr�create_static_lib�s�zMSVCCompiler.create_static_libc
Cs�|js|��|�||�\}}|�|||�}|\}}}|rL|�dt|��t||||�}|dk	rptj�	||�}|�
||��r�|tjkr�|	r�|j
dd�}q�|jdd�}n|	r�|j
}n|j}g}|p�gD]}|�d|�q�||||d|g}|dk	�rHtj�tj�|��\}}tj�	tj�|d�|�|��}|�d|�|
�rZ|
|dd�<|�rj|�|�|�tj�|��z|�|jg|�Wn,tk
�r�}zt|��W5d}~XYnXnt�d|�dS)Nz5I don't know what to do with 'runtime_library_dirs': rz/EXPORT:r�rz/IMPLIB:r�)r[rmr�Z
_fix_lib_args�warn�strr	rOr/rhr�rZ
EXECUTABLErlrkrrorsr�r�r{Zmkpathrrcrrr
r�)r+Ztarget_descr�r�rxZ	librariesZlibrary_dirsZruntime_library_dirsZexport_symbolsr�r�r�Z
build_tempr�Z
fixed_argsZlib_optsZldflagsZexport_optsZsymZld_argsZdll_nameZdll_extZimplib_filer�rrr�link�sj�
��

��

��
zMSVCCompiler.linkcCsd|S)Nz	/LIBPATH:r�r+�dirrrr�library_dir_optionszMSVCCompiler.library_dir_optioncCstd��dS)Nz<don't know how to set runtime library search path for MSVC++)rr�rrr�runtime_library_dir_options�z'MSVCCompiler.runtime_library_dir_optioncCs
|�|�Sr()r�)r+r]rrr�library_optionszMSVCCompiler.library_optioncCs\|r|d|g}n|g}|D]:}|D]0}tj�||�|��}tj�|�r$|Sq$qdS)NZ_d)rOr/rhr��exists)r+�dirsr]r�Z	try_namesr�rZlibfilerrr�find_library_file#szMSVCCompiler.find_library_filecCsz|jD].}tj�tj�|�|�}tj�|�r|Sqtjd�d�D].}tj�tj�|�|�}tj�|�rF|SqF|S)N�Pathr^)r_rOr/rhr|�isfiler`rF)r+Zexer3�fnrrrra5s	


zMSVCCompiler.find_exe�x86cCs�tsgS|d}|jdkr,d|j|jf}nd|j|f}tD]H}t||�}|r>|jdkrt|j�||��d�S||�d�Sq>|jdkr�tD]&}t|d|j�dk	r�|�d�q�q�gS)	Nz dirsrUz6%s\%0.1f\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directoriesz?%s\6.0\Build System\Components\Platforms\Win32 (%s)\Directoriesr^r=z%s\6.0z�It seems you have Visual Studio 6 installed, but the expected registry settings are not present.
You must at least run the Visual Studio GUI once so that these entries are created.)	�
_can_read_regrVrXr.r!rYr8rFr�)r+r/�platformrrrrrrrfKs,

��



zMSVCCompiler.get_msvc_pathscCs6|dkr|�d�}n
|�|�}|r2d�|�tj|<dS)Nr]Zlibraryr^)rfrhrOr`)r+rr3rrrrgos

zMSVCCompiler.set_path_env_var)rrr)rrn)NNNrNNN)NrN)
NNNNNrNNNN)r)r�)r9r:r;Z
compiler_typeZexecutablesr}r~rtrvrrrurwZstatic_lib_extensionZshared_lib_extensionZstatic_lib_formatZshared_lib_formatZ
exe_extensionr-rmrzr�r�r�r�r�r�r�rarfrgrrrrrS�sh
��
B�
 �
X�
�
S

$rSg @z3Importing new compiler from distutils.msvc9compiler)rS)r')-rCrOZdistutils.errorsrrrrrZdistutils.ccompilerrrr	Z	distutilsr
r��winregZhkey_modZ	OpenKeyExr
ZEnumKeyrZ	EnumValuer�errorr�ImportErrorZwin32apiZwin32con�infoZ
HKEY_USERS�HKEY_CURRENT_USER�HKEY_LOCAL_MACHINEZHKEY_CLASSES_ROOTr.rr!rr'rJrNrRrSr�ZOldMSVCCompilerZdistutils.msvc9compilerrrrr�<module>s^


�	-
9
distutils/__pycache__/versionpredicate.cpython-38.pyc000064400000012021151153537450017003 0ustar00U

e5d
�@s�dZddlZddlZddlZe�dej�Ze�d�Ze�d�Z	dd�Z
ejejej
ejejejd�ZGd	d
�d
�Zdadd�ZdS)
zBModule for parsing and testing package version predicate strings.
�Nz'(?i)^\s*([a-z_]\w*(?:\.[a-z_]\w*)*)(.*)z^\s*\((.*)\)\s*$z%^\s*(<=|>=|<|>|!=|==)\s*([^\s,]+)\s*$cCs6t�|�}|std|��|��\}}|tj�|�fS)zVParse a single version comparison.

    Return (comparison string, StrictVersion)
    z"bad package restriction syntax: %r)�re_splitComparison�match�
ValueError�groups�	distutils�version�
StrictVersion)�pred�res�compZverStr�r�2/usr/lib64/python3.8/distutils/versionpredicate.py�splitUps

r)�<z<=z==�>z>=z!=c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�VersionPredicatea�Parse and test package version predicates.

    >>> v = VersionPredicate('pyepat.abc (>1.0, <3333.3a1, !=1555.1b3)')

    The `name` attribute provides the full dotted name that is given::

    >>> v.name
    'pyepat.abc'

    The str() of a `VersionPredicate` provides a normalized
    human-readable version of the expression::

    >>> print(v)
    pyepat.abc (> 1.0, < 3333.3a1, != 1555.1b3)

    The `satisfied_by()` method can be used to determine with a given
    version number is included in the set described by the version
    restrictions::

    >>> v.satisfied_by('1.1')
    True
    >>> v.satisfied_by('1.4')
    True
    >>> v.satisfied_by('1.0')
    False
    >>> v.satisfied_by('4444.4')
    False
    >>> v.satisfied_by('1555.1b3')
    False

    `VersionPredicate` is flexible in accepting extra whitespace::

    >>> v = VersionPredicate(' pat( ==  0.1  )  ')
    >>> v.name
    'pat'
    >>> v.satisfied_by('0.1')
    True
    >>> v.satisfied_by('0.2')
    False

    If any version numbers passed in do not conform to the
    restrictions of `StrictVersion`, a `ValueError` is raised::

    >>> v = VersionPredicate('p1.p2.p3.p4(>=1.0, <=1.3a1, !=1.2zb3)')
    Traceback (most recent call last):
      ...
    ValueError: invalid version number '1.2zb3'

    It the module or package name given does not conform to what's
    allowed as a legal module or package name, `ValueError` is
    raised::

    >>> v = VersionPredicate('foo-bar')
    Traceback (most recent call last):
      ...
    ValueError: expected parenthesized list: '-bar'

    >>> v = VersionPredicate('foo bar (12.21)')
    Traceback (most recent call last):
      ...
    ValueError: expected parenthesized list: 'bar (12.21)'

    cCs�|��}|std��t�|�}|s.td|��|��\|_}|��}|r�t�|�}|sbtd|��|��d}dd�|�d�D�|_|js�td|��ng|_d	S)
z*Parse a version predicate string.
        zempty package restrictionzbad package name in %rzexpected parenthesized list: %rrcSsg|]}t|��qSr)r)�.0ZaPredrrr
�
<listcomp>tsz-VersionPredicate.__init__.<locals>.<listcomp>�,zempty parenthesized list in %rN)	�stripr�re_validPackagerr�name�re_paren�splitr	)�selfZversionPredicateStrrZparen�strrrr
�__init__`s&

�zVersionPredicate.__init__cCs8|jr.dd�|jD�}|jdd�|�dS|jSdS)NcSs g|]\}}|dt|��qS)� )r)r�cond�verrrr
r}sz,VersionPredicate.__str__.<locals>.<listcomp>z (z, �))r	r�join)r�seqrrr
�__str__{szVersionPredicate.__str__cCs(|jD]\}}t|||�sdSqdS)z�True if version is compatible with all the predicates in self.
        The parameter version must be acceptable to the StrictVersion
        constructor.  It may be either a string or StrictVersion.
        FT)r	�compmap)rrrrrrr
�satisfied_by�szVersionPredicate.satisfied_byN)�__name__�
__module__�__qualname__�__doc__rr#r%rrrr
rs@rcCsdtdkrt�dtj�a|��}t�|�}|s8td|��|�d�pDd}|rVtj	�
|�}|�d�|fS)a9Return the name and optional version number of a provision.

    The version number, if given, will be returned as a `StrictVersion`
    instance, otherwise it will be `None`.

    >>> split_provision('mypkg')
    ('mypkg', None)
    >>> split_provision(' mypkg( 1.2 ) ')
    ('mypkg', StrictVersion ('1.2'))
    Nz=([a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*)(?:\s*\(\s*([^)\s]+)\s*\))?$z"illegal provides specification: %r��)�
_provision_rx�re�compile�ASCIIrrr�grouprrr)�value�mrrrr
�split_provision�s�
r3)r)r-Zdistutils.versionr�operatorr.r/rrrr�lt�le�eq�gt�ge�ner$rr,r3rrrr
�<module>s"�

�ndistutils/__pycache__/msvccompiler.cpython-38.opt-1.pyc000064400000034605151153537450017113 0ustar00U

e5d\�@s�dZddlZddlZddlmZmZmZmZmZddl	m
Z
mZmZddl
mZdZz,ddlZdZeZejZejZejZejZWnhek
r�z4ddlZddlZdZeZejZejZejZejZWnek
r�e�d�YnXYnXe�rejejej ej!fZ"d	d
�Z#dd�Z$d
d�Z%Gdd�d�Z&dd�Z'dd�Z(dd�Z)Gdd�de
�Z*e'�dk�r�e�+d�e*Z,ddl-m*Z*ddl-m&Z&dS)z�distutils.msvccompiler

Contains MSVCCompiler, an implementation of the abstract CCompiler class
for the Microsoft Visual Studio.
�N)�DistutilsExecError�DistutilsPlatformError�CompileError�LibError�	LinkError)�	CCompiler�gen_preprocess_options�gen_lib_options)�logFTz�Warning: Can't read registry to find the necessary compiler setting
Make sure that Python modules winreg, win32api or win32con are installed.cCsnzt||�}Wntk
r$YdSXg}d}zt||�}Wntk
rTYqjYnX|�|�|d7}q.|S)zReturn list of registry keys.Nr�)�RegOpenKeyEx�RegError�
RegEnumKey�append)�base�key�handle�L�i�k�r�./usr/lib64/python3.8/distutils/msvccompiler.py�	read_keys7s


rcCs�zt||�}Wntk
r$YdSXi}d}zt||�\}}}Wntk
rZYq~YnX|��}t|�|t|�<|d7}q.|S)zXReturn dict of registry keys and values.

    All names are converted to lowercase.
    Nrr)rr
�RegEnumValue�lower�convert_mbcs)rrr�dr�name�value�typerrr�read_valuesHs

r cCs:t|dd�}|dk	r6z|d�}Wntk
r4YnX|S)N�decode�mbcs)�getattr�UnicodeError)�sZdecrrrr]src@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�
MacroExpandercCsi|_|�|�dS�N)�macros�load_macros)�self�versionrrr�__init__gszMacroExpander.__init__cCs2tD](}t||�}|r|||jd|<q.qdS)Nz$(%s))�HKEYSr r()r*Zmacro�pathrrrrrr�	set_macroks

zMacroExpander.set_macroc

Cs�d|}|�d|dd�|�d|dd�d}|�d|d	�z*|d
krX|�d|d�n|�d|d
�Wn*tk
r�}ztd��W5d}~XYnXd}tD]V}zt||�}Wntk
r�Yq�YnXt|d�}t|d||f�}	|	d|jd<q�dS)Nz%Software\Microsoft\VisualStudio\%0.1fZVCInstallDirz	\Setup\VCZ
productdirZVSInstallDirz	\Setup\VSz Software\Microsoft\.NETFrameworkZFrameworkDirZinstallrootg@ZFrameworkSDKDirzsdkinstallrootv1.1ZsdkinstallrootaPython was built with Visual Studio 2003;
extensions must be built with a compiler than can generate compatible binaries.
Visual Studio 2003 was not found on this system. If you have Cygwin installed,
you can try compiling with MingW32, by passing "-c mingw32" to setup.py.z.Software\Microsoft\NET Framework Setup\Productrz%s\%sr+z$(FrameworkVersion))	r/�KeyErrorrr-rr
rr r()
r*r+ZvsbaseZnet�exc�pr�hrrrrrr)rs,�

zMacroExpander.load_macroscCs$|j��D]\}}|�||�}q
|Sr')r(�items�replace)r*r%r�vrrr�sub�szMacroExpander.subN)�__name__�
__module__�__qualname__r,r/r)r7rrrrr&fsr&cCs�d}tj�|�}|dkrdS|t|�}tj|d��dd�\}}t|dd��d}|dkrf|d7}t|d	d
��d}|dkr�d}|dkr�||SdS)
z�Return the version of MSVC that was used to build Python.

    For Python 2.3 and up, the version number is included in
    sys.version.  For earlier versions, assume the compiler is MSVC 6.
    zMSC v.����N� r����
��g$@r)�sysr+�find�len�split�int)�prefixrr%�restZmajorVersionZminorVersionrrr�get_build_version�srIcCs@d}tj�|�}|dkrdStj�d|�}tj|t|�|�S)zUReturn the processor architecture.

    Possible results are "Intel" or "AMD64".
    z bit (r;�Intel�))rBr+rCrD)rGr�jrrr�get_build_architecture�srMcCs0g}|D]"}tj�|�}||kr|�|�q|S)znReturn a list of normalized paths with duplicates removed.

    The current order of paths is maintained.
    )�osr.�normpathr)�pathsZ
reduced_pathsr2Znprrr�normalize_and_reduce_paths�srQc
@s�eZdZdZdZiZdgZdddgZdgZdgZ	eeee	Z
d	Zd
ZdZ
dZd
ZZdZd-dd�Zdd�Zd.dd�Zd/dd�Zd0dd�Zd1dd�Zdd�Zd d!�Zd"d#�Zd2d$d%�Zd&d'�Zd3d)d*�Zd+d,�ZdS)4�MSVCCompilerzwConcrete class that implements an interface to Microsoft Visual C++,
       as defined by the CCompiler abstract class.Zmsvcz.cz.ccz.cppz.cxx�.rcz.mcz.resz.objz.libz.dllz%s%sz.exercCsvt�||||�t�|_t�|_|jdkr\|jdkrHd|_t|j�|_nd|_d|j|_	nd|jd|_	d|_
dS)	NrJ�zSoftware\Microsoft\VisualStudiozSoftware\Microsoft\DevstudiozVisual Studio version %szMicrosoft SDK compiler %sr<F)rr,rI�_MSVCCompiler__versionrM�_MSVCCompiler__arch�_MSVCCompiler__rootr&�_MSVCCompiler__macros�_MSVCCompiler__product�initialized)r*�verboseZdry_runZforcerrrr,�s

zMSVCCompiler.__init__cCs�g|_dtjkrDdtjkrD|�d�rDd|_d|_d|_d|_d|_nx|�	d�|_t
|j�d	krltd
|j��|�d�|_|�d�|_|�d�|_|�d�|_|�d�|_|�
d�|�
d�z&tjd�d
�D]}|j�|�q�Wntk
r�YnXt|j�|_d
�|j�tjd<d|_|jdk�rPddddddg|_dddddddg|_n&ddddddg|_dddddddg|_dddg|_|jdk�r�ddddg|_ndddddg|_dg|_d |_dS)!NZDISTUTILS_USE_SDKZMSSdkzcl.exezlink.exezlib.exezrc.exezmc.exer.rzxPython was built with %s, and extensions need to be built with the same version of the compiler, but it isn't installed.�libZinclude�;rJz/nologoz/Oxz/MDz/W3z/GXz/DNDEBUGz/Odz/MDdz/Z7z/D_DEBUGz/GS-z/DLLz/INCREMENTAL:NOrTz/INCREMENTAL:noz/DEBUGz	/pdb:NoneT)�_MSVCCompiler__pathsrN�environ�find_exe�cc�linkerr\�rc�mc�get_msvc_pathsrDrrY�set_path_env_varrErr0rQ�joinZpreprocess_optionsrV�compile_options�compile_options_debug�ldflags_sharedrU�ldflags_shared_debugZldflags_staticrZ)r*r2rrr�
initialize�sr�


�
�
�
���zMSVCCompiler.initialize�cCs�|dkrd}g}|D]�}tj�|�\}}tj�|�d}|tj�|�d�}||jkrbtd|��|rrtj�|�}||jkr�|�	tj�
|||j��q||jkr�|�	tj�
|||j��q|�	tj�
|||j
��q|S)NrmrzDon't know how to compile %s)rNr.�splitext�
splitdrive�isabs�src_extensionsr�basename�_rc_extensionsrrg�
res_extension�_mc_extensions�
obj_extension)r*Zsource_filenamesZ	strip_dir�
output_dirZ	obj_namesZsrc_namer�extrrr�object_filenames8s.

�
��zMSVCCompiler.object_filenamesNc	Csp|js|��|�||||||�}	|	\}}
}}}|p6g}
|
�d�|rT|
�|j�n|
�|j�|
D�]}z||\}}Wntk
r�YqdYnX|r�tj	�
|�}||jkr�d|}�nT||jkr�d|}�n>||j
k�r<|}d|}z"|�|jg||g|g�Wqdtk
�r6}zt|��W5d}~XYqdXqdn�||jk�r�tj	�|�}tj	�|�}zl|�|jgd|d|g|g�tj	�tj	�|��\}}tj	�||d�}|�|jgd|g|g�Wqdtk
�r�}zt|��W5d}~XYqdXqdntd||f��d	|}z&|�|jg|
|||g|�Wqdtk
�rh}zt|��W5d}~XYqdXqd|
S)
Nz/cz/Tcz/Tpz/foz-hz-rrSz"Don't know how to compile %s to %sz/Fo)rZrlZ_setup_compiler�extendrirhr0rNr.�abspath�
_c_extensions�_cpp_extensionsrs�spawnrcrrru�dirnamerdrnrrrgra)r*Zsourcesrwr(Zinclude_dirs�debug�
extra_preargs�extra_postargsZdependsZcompile_info�objectsZpp_optsZbuildZcompile_opts�obj�srcrxZ	input_optZ
output_opt�msgZh_dirZrc_dirr�_Zrc_filerrr�compileWs�
�




��


��
��
���
zMSVCCompiler.compilec	
Cs�|js|��|�||�\}}|j||d�}|�||�r�|d|g}|rJz|�|jg|�Wq�tk
r�}zt|��W5d}~XYq�Xnt	�
d|�dS)N)rw�/OUT:�skipping %s (up-to-date))rZrl�_fix_object_args�library_filename�
_need_linkr~r\rrr
r�)	r*r�Zoutput_libnamerwr��target_lang�output_filenameZlib_argsr�rrr�create_static_lib�s�zMSVCCompiler.create_static_libc
Cs�|js|��|�||�\}}|�|||�}|\}}}|rL|�dt|��t||||�}|dk	rptj�	||�}|�
||��r�|tjkr�|	r�|j
dd�}q�|jdd�}n|	r�|j
}n|j}g}|p�gD]}|�d|�q�||||d|g}|dk	�rHtj�tj�|��\}}tj�	tj�|d�|�|��}|�d|�|
�rZ|
|dd�<|�rj|�|�|�tj�|��z|�|jg|�Wn,tk
�r�}zt|��W5d}~XYnXnt�d|�dS)Nz5I don't know what to do with 'runtime_library_dirs': rz/EXPORT:r�rz/IMPLIB:r�)rZrlr�Z
_fix_lib_args�warn�strr	rNr.rgr�rZ
EXECUTABLErkrjrrnrrrr�rzZmkpathr~rbrrr
r�)r*Ztarget_descr�r�rwZ	librariesZlibrary_dirsZruntime_library_dirsZexport_symbolsr�r�r�Z
build_tempr�Z
fixed_argsZlib_optsZldflagsZexport_optsZsymZld_argsZdll_nameZdll_extZimplib_filer�rrr�link�sj�
��

��

��
zMSVCCompiler.linkcCsd|S)Nz	/LIBPATH:r�r*�dirrrr�library_dir_optionszMSVCCompiler.library_dir_optioncCstd��dS)Nz<don't know how to set runtime library search path for MSVC++)rr�rrr�runtime_library_dir_options�z'MSVCCompiler.runtime_library_dir_optioncCs
|�|�Sr')r�)r*r\rrr�library_optionszMSVCCompiler.library_optioncCs\|r|d|g}n|g}|D]:}|D]0}tj�||�|��}tj�|�r$|Sq$qdS)NZ_d)rNr.rgr��exists)r*�dirsr\r�Z	try_namesr�rZlibfilerrr�find_library_file#szMSVCCompiler.find_library_filecCsz|jD].}tj�tj�|�|�}tj�|�r|Sqtjd�d�D].}tj�tj�|�|�}tj�|�rF|SqF|S)a�Return path to an MSVC executable program.

        Tries to find the program in several places: first, one of the
        MSVC program search paths from the registry; next, the directories
        in the PATH environment variable.  If any of those work, return an
        absolute path that is known to exist.  If none of them work, just
        return the original program name, 'exe'.
        �Pathr])r^rNr.rgr{�isfiler_rE)r*Zexer2�fnrrrr`5s	


zMSVCCompiler.find_exe�x86cCs�tsgS|d}|jdkr,d|j|jf}nd|j|f}tD]H}t||�}|r>|jdkrt|j�||��d�S||�d�Sq>|jdkr�tD]&}t|d|j�dk	r�|�d	�q�q�gS)
z�Get a list of devstudio directories (include, lib or path).

        Return a list of strings.  The list will be empty if unable to
        access the registry or appropriate registry keys not found.
        z dirsrTz6%s\%0.1f\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directoriesz?%s\6.0\Build System\Components\Platforms\Win32 (%s)\Directoriesr]r<z%s\6.0Nz�It seems you have Visual Studio 6 installed, but the expected registry settings are not present.
You must at least run the Visual Studio GUI once so that these entries are created.)	�
_can_read_regrUrWr-r rXr7rEr�)r*r.�platformrrrrrrreKs,

��



zMSVCCompiler.get_msvc_pathscCs6|dkr|�d�}n
|�|�}|r2d�|�tj|<dS)z�Set environment variable 'name' to an MSVC path type value.

        This is equivalent to a SET command prior to execution of spawned
        commands.
        r\Zlibraryr]N)rergrNr_)r*rr2rrrrfos

zMSVCCompiler.set_path_env_var)rrr)rrm)NNNrNNN)NrN)
NNNNNrNNNN)r)r�)r8r9r:�__doc__Z
compiler_typeZexecutablesr|r}rsrurqrtrvZstatic_lib_extensionZshared_lib_extensionZstatic_lib_formatZshared_lib_formatZ
exe_extensionr,rlryr�r�r�r�r�r�r�r`rerfrrrrrR�sj
��
B�
 �
X�
�
S

$rRg @z3Importing new compiler from distutils.msvc9compiler)rR)r&).r�rBrNZdistutils.errorsrrrrrZdistutils.ccompilerrrr	Z	distutilsr
r��winregZhkey_modZ	OpenKeyExrZEnumKeyrZ	EnumValuer�errorr
�ImportErrorZwin32apiZwin32con�infoZ
HKEY_USERS�HKEY_CURRENT_USER�HKEY_LOCAL_MACHINEZHKEY_CLASSES_ROOTr-rr rr&rIrMrQrRr�ZOldMSVCCompilerZdistutils.msvc9compilerrrrr�<module>s`



�	-
9
distutils/__pycache__/ccompiler.cpython-38.opt-1.pyc000064400000100624151153537450016360 0ustar00U

e5dI��@s�dZddlZddlZddlZddlTddlmZddlmZddl	m
Z
ddlmZm
Z
ddlmZmZdd	lmZGd
d�d�ZdZdd
d�Zdddddd�Zdd�Zddd�Zdd�Zdd�ZdS)z�distutils.ccompiler

Contains CCompiler, an abstract base class that defines the interface
for the Distutils compiler abstraction model.�N)�*)�spawn)�	move_file)�mkpath)�newer_pairwise�newer_group)�split_quoted�execute)�logc
@seZdZdZdZdZdZdZdZdZ	dZ
dZdddddd�ZdddgZ
dqdd	�Zd
d�Zdd
�Zdd�Zdd�Zdrdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Z d.d/�Z!dsd0d1�Z"d2d3�Z#d4d5�Z$d6d7�Z%d8d9�Z&dtd:d;�Z'dud<d=�Z(d>d?�Z)dvd@dA�Z*dBZ+dCZ,dDZ-dwdEdF�Z.dxdGdH�Z/dydIdJ�Z0dzdKdL�Z1dMdN�Z2dOdP�Z3dQdR�Z4d{dSdT�Z5d|dUdV�Z6d}dXdY�Z7d~dZd[�Z8dd\d]�Z9d�d_d`�Z:d�dbdc�Z;ddde�Z<dfdg�Z=d�dhdi�Z>djdk�Z?dldm�Z@d�dodp�ZAdS)��	CCompilera�Abstract base class to define the interface that must be implemented
    by real compiler classes.  Also has some utility methods used by
    several compiler classes.

    The basic idea behind a compiler abstraction class is that each
    instance can be used for all the compile/link steps in building a
    single project.  Thus, attributes common to all of those compile and
    link steps -- include directories, macros to define, libraries to link
    against, etc. -- are attributes of the compiler instance.  To allow for
    variability in how individual files are treated, most of those
    attributes may be varied on a per-compilation or per-link basis.
    N�czc++Zobjc)�.cz.ccz.cppz.cxxz.mrcCsb||_||_||_d|_g|_g|_g|_g|_g|_g|_	|j
��D]}|�||j
|�qFdS�N)
�dry_run�force�verbose�
output_dir�macros�include_dirs�	libraries�library_dirs�runtime_library_dirs�objects�executables�keys�set_executable)�selfrrr�key�r�+/usr/lib64/python3.8/distutils/ccompiler.py�__init__UszCCompiler.__init__cKs<|D]2}||jkr&td||jjf��|�|||�qdS)a�Define the executables (and options for them) that will be run
        to perform the various stages of compilation.  The exact set of
        executables that may be specified here depends on the compiler
        class (via the 'executables' class attribute), but most will have:
          compiler      the C/C++ compiler
          linker_so     linker used to create shared objects and libraries
          linker_exe    linker used to create binary executables
          archiver      static library creator

        On platforms with a command-line (Unix, DOS/Windows), each of these
        is a string that will be split into executable name and (optional)
        list of arguments.  (Splitting the string is done similarly to how
        Unix shells operate: words are delimited by spaces, but quotes and
        backslashes can override this.  See
        'distutils.util.split_quoted()'.)
        z$unknown executable '%s' for class %sN)r�
ValueError�	__class__�__name__r)r�kwargsrrrr�set_executablesys

�zCCompiler.set_executablescCs,t|t�rt||t|��nt|||�dSr)�
isinstance�str�setattrr)rr�valuerrrr�s
zCCompiler.set_executablecCs0d}|jD] }|d|kr"|S|d7}q
dS)Nr�)r)r�name�i�defnrrr�_find_macro�s

zCCompiler._find_macrocCs`|D]V}t|t�rFt|�dkrFt|dt�s8|ddkrFt|dt�std|dd��qdS)z�Ensures that every element of 'definitions' is a valid macro
        definition, ie. either (name,value) 2-tuple or a (name,) tuple.  Do
        nothing if all definitions are OK, raise TypeError otherwise.
        )r*�r*Nrzinvalid macro definition '%s': z.must be tuple (string,), (string, string), or z(string, None))r&�tuple�lenr'�	TypeError)rZdefinitionsr-rrr�_check_macro_definitions�s

��
����z"CCompiler._check_macro_definitionscCs.|�|�}|dk	r|j|=|j�||f�dS)a_Define a preprocessor macro for all compilations driven by this
        compiler object.  The optional parameter 'value' should be a
        string; if it is not supplied, then the macro will be defined
        without an explicit value and the exact outcome depends on the
        compiler used (XXX true? does ANSI say anything about this?)
        N�r.r�append)rr+r)r,rrr�define_macro�s	
zCCompiler.define_macrocCs0|�|�}|dk	r|j|=|f}|j�|�dS)a�Undefine a preprocessor macro for all compilations driven by
        this compiler object.  If the same macro is defined by
        'define_macro()' and undefined by 'undefine_macro()' the last call
        takes precedence (including multiple redefinitions or
        undefinitions).  If the macro is redefined/undefined on a
        per-compilation basis (ie. in the call to 'compile()'), then that
        takes precedence.
        Nr4)rr+r,Zundefnrrr�undefine_macro�s

zCCompiler.undefine_macrocCs|j�|�dS)z�Add 'dir' to the list of directories that will be searched for
        header files.  The compiler is instructed to search directories in
        the order in which they are supplied by successive calls to
        'add_include_dir()'.
        N)rr5�r�dirrrr�add_include_dir�szCCompiler.add_include_dircCs|dd�|_dS)aySet the list of directories that will be searched to 'dirs' (a
        list of strings).  Overrides any preceding calls to
        'add_include_dir()'; subsequence calls to 'add_include_dir()' add
        to the list passed to 'set_include_dirs()'.  This does not affect
        any list of standard include directories that the compiler may
        search by default.
        N�r�r�dirsrrr�set_include_dirs�szCCompiler.set_include_dirscCs|j�|�dS)a�Add 'libname' to the list of libraries that will be included in
        all links driven by this compiler object.  Note that 'libname'
        should *not* be the name of a file containing a library, but the
        name of the library itself: the actual filename will be inferred by
        the linker, the compiler, or the compiler class (depending on the
        platform).

        The linker will be instructed to link against libraries in the
        order they were supplied to 'add_library()' and/or
        'set_libraries()'.  It is perfectly valid to duplicate library
        names; the linker will be instructed to link against libraries as
        many times as they are mentioned.
        N)rr5)r�libnamerrr�add_library�szCCompiler.add_librarycCs|dd�|_dS)z�Set the list of libraries to be included in all links driven by
        this compiler object to 'libnames' (a list of strings).  This does
        not affect any standard system libraries that the linker may
        include by default.
        N)r)rZlibnamesrrr�
set_libraries�szCCompiler.set_librariescCs|j�|�dS)a'Add 'dir' to the list of directories that will be searched for
        libraries specified to 'add_library()' and 'set_libraries()'.  The
        linker will be instructed to search for libraries in the order they
        are supplied to 'add_library_dir()' and/or 'set_library_dirs()'.
        N)rr5r8rrr�add_library_dirszCCompiler.add_library_dircCs|dd�|_dS)z�Set the list of library search directories to 'dirs' (a list of
        strings).  This does not affect any standard library search path
        that the linker may search by default.
        N)rr<rrr�set_library_dirsszCCompiler.set_library_dirscCs|j�|�dS)zlAdd 'dir' to the list of directories that will be searched for
        shared libraries at runtime.
        N)rr5r8rrr�add_runtime_library_dirsz!CCompiler.add_runtime_library_dircCs|dd�|_dS)z�Set the list of directories to search for shared libraries at
        runtime to 'dirs' (a list of strings).  This does not affect any
        standard search path that the runtime linker may search by
        default.
        N)rr<rrr�set_runtime_library_dirssz"CCompiler.set_runtime_library_dirscCs|j�|�dS)z�Add 'object' to the list of object files (or analogues, such as
        explicitly named library files or the output of "resource
        compilers") to be included in every link driven by this compiler
        object.
        N)rr5)r�objectrrr�add_link_object szCCompiler.add_link_objectcCs|dd�|_dS)z�Set the list of object files (or analogues) to be included in
        every link to 'objects'.  This does not affect any standard object
        files that the linker may include by default (such as system
        libraries).
        N)r)rrrrr�set_link_objects(szCCompiler.set_link_objectscCs|dkr|j}nt|t�s"td��|dkr2|j}n"t|t�rL||jpFg}ntd��|dkrd|j}n*t|ttf�r�t|�|jp�g}ntd��|dkr�g}|j|d|d�}t	||�}i}	t
t|��D]B}
||
}||
}tj
�|�d}
|�tj
�|��||
f|	|<q�|||||	fS)z;Process arguments and decide which source files to compile.N�%'output_dir' must be a string or None�/'macros' (if supplied) must be a list of tuples�6'include_dirs' (if supplied) must be a list of stringsr)�	strip_dirrr*)rr&r'r2r�listrr0�object_filenames�gen_preprocess_options�ranger1�os�path�splitextr�dirname)rZoutdirrZincdirs�sources�dependsZextrar�pp_opts�buildr,�src�obj�extrrr�_setup_compile6s<

��
zCCompiler._setup_compilecCs0|dg}|rdg|dd�<|r,||dd�<|S)Nz-cz-grr)rrW�debugZbefore�cc_argsrrr�_get_cc_argsas
zCCompiler._get_cc_argscCs�|dkr|j}nt|t�s"td��|dkr2|j}n"t|t�rL||jpFg}ntd��|dkrd|j}n*t|ttf�r�t|�|jp�g}ntd��|||fS)a'Typecheck and fix-up some of the arguments to the 'compile()'
        method, and return fixed-up values.  Specifically: if 'output_dir'
        is None, replaces it with 'self.output_dir'; ensures that 'macros'
        is a list, and augments it with 'self.macros'; ensures that
        'include_dirs' is a list, and augments it with 'self.include_dirs'.
        Guarantees that the returned values are of the correct type,
        i.e. for 'output_dir' either string or None, and for 'macros' and
        'include_dirs' either list or None.
        NrIrJrK)rr&r'r2rrMrr0)rrrrrrr�_fix_compile_argsjs"


�zCCompiler._fix_compile_argscCs|j||d�}|ifS)a+Decide which souce files must be recompiled.

        Determine the list of object files corresponding to 'sources',
        and figure out which ones really need to be recompiled.
        Return a list of all object files and a dictionary telling
        which source files can be skipped.
        )r)rN)rrUrrVrrrr�
_prep_compile�s	zCCompiler._prep_compilecCsHt|ttf�std��t|�}|dkr.|j}nt|t�s@td��||fS)z�Typecheck and fix up some arguments supplied to various methods.
        Specifically: ensure that 'objects' is a list; if output_dir is
        None, replace with self.output_dir.  Return fixed versions of
        'objects' and 'output_dir'.
        z,'objects' must be a list or tuple of stringsNrI)r&rMr0r2rr')rrrrrr�_fix_object_args�s
zCCompiler._fix_object_argscCs�|dkr|j}n*t|ttf�r2t|�|jp,g}ntd��|dkrJ|j}n*t|ttf�rlt|�|jpfg}ntd��|dkr�|j}n*t|ttf�r�t|�|jp�g}ntd��|||fS)a;Typecheck and fix up some of the arguments supplied to the
        'link_*' methods.  Specifically: ensure that all arguments are
        lists, and augment them with their permanent versions
        (eg. 'self.libraries' augments 'libraries').  Return a tuple with
        fixed versions of all arguments.
        Nz3'libraries' (if supplied) must be a list of stringsz6'library_dirs' (if supplied) must be a list of stringsz>'runtime_library_dirs' (if supplied) must be a list of strings)rr&rMr0r2rr)rrrrrrr�
_fix_lib_args�s,���zCCompiler._fix_lib_argscCs2|jr
dS|jr t||dd�}n
t||�}|SdS)zjReturn true if we need to relink the files listed in 'objects'
        to recreate 'output_file'.
        T�newer)ZmissingN)rrr)rr�output_filerdrrr�
_need_link�s
zCCompiler._need_linkc		Cs~t|t�s|g}d}t|j�}|D]V}tj�|�\}}|j�|�}z |j�	|�}||kr`|}|}Wq"t
k
rvYq"Xq"|S)z|Detect the language of a given file, or list of files. Uses
        language_map, and language_order to do the job.
        N)r&rMr1�language_orderrQrRrS�language_map�get�indexr!)	rrUZlangrj�source�baser[ZextlangZextindexrrr�detect_language�s

zCCompiler.detect_languagecCsdS)a�Preprocess a single C/C++ source file, named in 'source'.
        Output will be written to file named 'output_file', or stdout if
        'output_file' not supplied.  'macros' is a list of macro
        definitions as for 'compile()', which will augment the macros set
        with 'define_macro()' and 'undefine_macro()'.  'include_dirs' is a
        list of directory names that will be added to the default list.

        Raises PreprocessError on failure.
        Nr)rrkrerr�
extra_preargs�extra_postargsrrr�
preprocess�szCCompiler.preprocessc		Csx|�||||||�\}}	}}
}|�|
||�}|	D]B}
z||
\}}Wntk
r\Yq0YnX|�|
|||||
�q0|	S)aK	Compile one or more source files.

        'sources' must be a list of filenames, most likely C/C++
        files, but in reality anything that can be handled by a
        particular compiler and compiler class (eg. MSVCCompiler can
        handle resource files in 'sources').  Return a list of object
        filenames, one per source filename in 'sources'.  Depending on
        the implementation, not all source files will necessarily be
        compiled, but all corresponding object filenames will be
        returned.

        If 'output_dir' is given, object files will be put under it, while
        retaining their original path component.  That is, "foo/bar.c"
        normally compiles to "foo/bar.o" (for a Unix implementation); if
        'output_dir' is "build", then it would compile to
        "build/foo/bar.o".

        'macros', if given, must be a list of macro definitions.  A macro
        definition is either a (name, value) 2-tuple or a (name,) 1-tuple.
        The former defines a macro; if the value is None, the macro is
        defined without an explicit value.  The 1-tuple case undefines a
        macro.  Later definitions/redefinitions/ undefinitions take
        precedence.

        'include_dirs', if given, must be a list of strings, the
        directories to add to the default include file search path for this
        compilation only.

        'debug' is a boolean; if true, the compiler will be instructed to
        output debug symbols in (or alongside) the object file(s).

        'extra_preargs' and 'extra_postargs' are implementation- dependent.
        On platforms that have the notion of a command-line (e.g. Unix,
        DOS/Windows), they are most likely lists of strings: extra
        command-line arguments to prepend/append to the compiler command
        line.  On other platforms, consult the implementation class
        documentation.  In any event, they are intended as an escape hatch
        for those occasions when the abstract compiler framework doesn't
        cut the mustard.

        'depends', if given, is a list of filenames that all targets
        depend on.  If a source file is older than any file in
        depends, then the source file will be recompiled.  This
        supports dependency tracking, but only at a coarse
        granularity.

        Raises CompileError on failure.
        )r\r_�KeyError�_compile)rrUrrrr]rnrorVrrWrXr^rZrYr[rrr�compile�s6��
zCCompiler.compilecCsdS)zCompile 'src' to product 'obj'.Nr)rrZrYr[r^rorWrrrrrCszCCompiler._compilecCsdS)a&Link a bunch of stuff together to create a static library file.
        The "bunch of stuff" consists of the list of object files supplied
        as 'objects', the extra object files supplied to
        'add_link_object()' and/or 'set_link_objects()', the libraries
        supplied to 'add_library()' and/or 'set_libraries()', and the
        libraries supplied as 'libraries' (if any).

        'output_libname' should be a library name, not a filename; the
        filename will be inferred from the library name.  'output_dir' is
        the directory where the library file will be put.

        'debug' is a boolean; if true, debugging information will be
        included in the library (note that on most platforms, it is the
        compile step where this matters: the 'debug' flag is included here
        just for consistency).

        'target_lang' is the target language for which the given objects
        are being compiled. This allows specific linkage time treatment of
        certain languages.

        Raises LibError on failure.
        Nr)rr�output_libnamerr]�target_langrrr�create_static_libIszCCompiler.create_static_libZ
shared_objectZshared_library�
executablecCst�dS)auLink a bunch of stuff together to create an executable or
        shared library file.

        The "bunch of stuff" consists of the list of object files supplied
        as 'objects'.  'output_filename' should be a filename.  If
        'output_dir' is supplied, 'output_filename' is relative to it
        (i.e. 'output_filename' can provide directory components if
        needed).

        'libraries' is a list of libraries to link against.  These are
        library names, not filenames, since they're translated into
        filenames in a platform-specific way (eg. "foo" becomes "libfoo.a"
        on Unix and "foo.lib" on DOS/Windows).  However, they can include a
        directory component, which means the linker will look in that
        specific directory rather than searching all the normal locations.

        'library_dirs', if supplied, should be a list of directories to
        search for libraries that were specified as bare library names
        (ie. no directory component).  These are on top of the system
        default and those supplied to 'add_library_dir()' and/or
        'set_library_dirs()'.  'runtime_library_dirs' is a list of
        directories that will be embedded into the shared library and used
        to search for other shared libraries that *it* depends on at
        run-time.  (This may only be relevant on Unix.)

        'export_symbols' is a list of symbols that the shared library will
        export.  (This appears to be relevant only on Windows.)

        'debug' is as for 'compile()' and 'create_static_lib()', with the
        slight distinction that it actually matters on most platforms (as
        opposed to 'create_static_lib()', which includes a 'debug' flag
        mostly for form's sake).

        'extra_preargs' and 'extra_postargs' are as for 'compile()' (except
        of course that they supply command-line arguments for the
        particular linker being used).

        'target_lang' is the target language for which the given objects
        are being compiled. This allows specific linkage time treatment of
        certain languages.

        Raises LinkError on failure.
        N��NotImplementedError)rZtarget_descr�output_filenamerrrr�export_symbolsr]rnro�
build_temprurrr�linkis9zCCompiler.linkc

Cs2|�tj||j|dd�|||||||	|
||�
dS)N�shared)�lib_type)r}r�SHARED_LIBRARY�library_filename)
rrrtrrrrr{r]rnror|rurrr�link_shared_lib�s
�zCCompiler.link_shared_libc

Cs(|�tj|||||||||	|
||�
dSr)r}r�
SHARED_OBJECT)
rrrzrrrrr{r]rnror|rurrr�link_shared_object�s
�zCCompiler.link_shared_objectcCs.|�tj||�|�||||d|||	d|
�
dSr)r}r�
EXECUTABLE�executable_filename)rrZoutput_prognamerrrrr]rnrorurrr�link_executable�s
�zCCompiler.link_executablecCst�dS)zkReturn the compiler option to add 'dir' to the list of
        directories searched for libraries.
        Nrxr8rrr�library_dir_option�szCCompiler.library_dir_optioncCst�dS)zsReturn the compiler option to add 'dir' to the list of
        directories searched for runtime libraries.
        Nrxr8rrr�runtime_library_dir_option�sz$CCompiler.runtime_library_dir_optioncCst�dS)zReturn the compiler option to add 'lib' to the list of libraries
        linked into the shared library or executable.
        Nrx)r�librrr�library_option�szCCompiler.library_optionc	Cs�ddl}|dkrg}|dkr g}|dkr,g}|dkr8g}|jd|dd�\}}t�|d�}	z*|D]}
|	�d|
�q^|	�d|�W5|	��Xz|j|g|d	�}Wntk
r�Yd
SXz|j|d||d�Wnt	t
fk
r�Yd
SXdS)
z�Return a boolean indicating whether funcname is supported on
        the current platform.  The optional arguments can be used to
        augment the compilation environment.
        rNr
T)�text�wz#include "%s"
z=int main (int argc, char **argv) {
    %s();
    return 0;
}
r;Fza.out)rr)�tempfileZmkstemprQ�fdopen�close�writersZCompileErrorr�Z	LinkErrorr2)r�funcnameZincludesrrrr��fdZfname�fZinclrrrr�has_function�s<	�

�
zCCompiler.has_functioncCst�dS)aHSearch the specified list of directories for a static or shared
        library file 'lib' and return the full path to that file.  If
        'debug' true, look for a debugging version (if that makes sense on
        the current platform).  Return None if 'lib' wasn't found in any of
        the specified directories.
        Nrx)rr=r�r]rrr�find_library_file$szCCompiler.find_library_file�cCs�|dkrd}g}|D]|}tj�|�\}}tj�|�d}|tj�|�d�}||jkrftd||f��|rvtj�|�}|�tj�	|||j
��q|S)Nr�r*z"unknown file type '%s' (from '%s'))rQrRrS�
splitdrive�isabs�src_extensionsZUnknownFileError�basenamer5�join�
obj_extension)rZsource_filenamesrLrZ	obj_namesZsrc_namerlr[rrrrNOs"

��zCCompiler.object_filenamescCs$|rtj�|�}tj�|||j�Sr)rQrRr�r��shared_lib_extension�rr�rLrrrr�shared_object_filename`sz CCompiler.shared_object_filenamecCs(|rtj�|�}tj�|||jp"d�S)Nr�)rQrRr�r��
exe_extensionr�rrrr�fszCCompiler.executable_filename�staticc
Cs`|dkrtd��t||d�}t||d�}tj�|�\}}|||f}	|rPd}tj�|||	�S)N)r�r~ZdylibZ
xcode_stubz?'lib_type' must be "static", "shared", "dylib", or "xcode_stub"Z_lib_formatZ_lib_extensionr�)r!�getattrrQrR�splitr�)
rr?rrLrZfmtr[r9rl�filenamerrrr�ls�zCCompiler.library_filenamer*cCst�|�dSr)r
r])r�msg�levelrrr�announceszCCompiler.announcecCsddlm}|rt|�dS)Nr)�DEBUG)Zdistutils.debugr��print)rr�r�rrr�debug_print�szCCompiler.debug_printcCstj�d|�dS)Nzwarning: %s
)�sys�stderrr�)rr�rrr�warn�szCCompiler.warncCst||||j�dSr)r	r)r�func�argsr�r�rrrr	�szCCompiler.executecCst||jd�dS�N)r)rr)r�cmdrrrr�szCCompiler.spawncCst|||jd�Sr�)rr)rrYZdstrrrr�szCCompiler.move_file�cCst|||jd�dSr�)rr)rr+�moderrrr�szCCompiler.mkpath)rrr)N)N)NNNNN)NNNrNNN)NrN)
NNNNNrNNNN)
NNNNNrNNNN)
NNNNNrNNNN)NNNNrNNN)NNNN)r)rr�)rr�)rr�)r�rr�)r*)Nr*)r�)Br#�
__module__�__qualname__�__doc__Z
compiler_typer�r�Zstatic_lib_extensionr�Zstatic_lib_formatZshared_lib_formatr�rhrgr r%rr.r3r6r7r:r>r@rArBrCrDrErGrHr\r_r`rarbrcrfrmrprsrrrvr�r�r�r}r�r�r�r�r�r�r�r�rNr�r�r�r�r�r�r	rrrrrrrrs��

$ 

+	 
"
�

�
D�
�
A�
�
�
�
,
+


�


r))zcygwin.*�unix)�posixr�)�nt�msvccCsV|dkrtj}|dkrtj}tD]0\}}t�||�dk	sHt�||�dk	r |Sq dS)akDetermine the default compiler to use for the given platform.

       osname should be one of the standard Python OS names (i.e. the
       ones returned by os.name) and platform the common value
       returned by sys.platform for the platform in question.

       The default values are os.name and sys.platform in case the
       parameters are not given.
    Nr�)rQr+r��platform�_default_compilers�re�match)Zosnamer��pattern�compilerrrr�get_default_compiler�s
�
r�)Z
unixccompilerZ
UnixCCompilerzstandard UNIX-style compiler)Z
_msvccompilerZMSVCCompilerzMicrosoft Visual C++)�cygwinccompilerZCygwinCCompilerz'Cygwin port of GNU C Compiler for Win32)r�ZMingw32CCompilerz(Mingw32 port of GNU C Compiler for Win32)ZbcppcompilerZBCPPCompilerzBorland C++ Compiler)r�r��cygwinZmingw32ZbcppcCsXddlm}g}t��D] }|�d|dt|df�q|��||�}|�d�dS)zyPrint list of available compilers (used by the "--help-compiler"
    options to "build", "build_ext", "build_clib").
    r)�FancyGetoptz	compiler=Nr/zList of available compilers:)Zdistutils.fancy_getoptr��compiler_classrr5�sortZ
print_help)r�Z	compilersr�Zpretty_printerrrr�show_compilers�s
�r�cCs�|dkrtj}z"|dkr t|�}t|\}}}Wn8tk
rhd|}|dk	r\|d|}t|��YnXz*d|}t|�tj|}	t	|	�|}
WnBt
k
r�td|��Yn$tk
r�td||f��YnX|
d||�S)a[Generate an instance of some CCompiler subclass for the supplied
    platform/compiler combination.  'plat' defaults to 'os.name'
    (eg. 'posix', 'nt'), and 'compiler' defaults to the default compiler
    for that platform.  Currently only 'posix' and 'nt' are supported, and
    the default compilers are "traditional Unix interface" (UnixCCompiler
    class) and Visual C++ (MSVCCompiler class).  Note that it's perfectly
    possible to ask for a Unix compiler object under Windows, and a
    Microsoft compiler object under Unix -- if you supply a value for
    'compiler', 'plat' is ignored.
    Nz5don't know how to compile C/C++ code on platform '%s'z with '%s' compilerz
distutils.z4can't compile C/C++ code: unable to load module '%s'zBcan't compile C/C++ code: unable to find class '%s' in module '%s')rQr+r�r�rqZDistutilsPlatformError�
__import__r��modules�vars�ImportErrorZDistutilsModuleError)Zplatr�rrrZmodule_name�
class_nameZlong_descriptionr��module�klassrrr�new_compiler�s:
����
r�cCs�g}|D]�}t|t�r0dt|�kr.dks<ntd|��t|�dkr\|�d|d�qt|�dkr|ddkr�|�d|d�q|�d|�q|D]}|�d	|�q�|S)
aGenerate C pre-processor options (-D, -U, -I) as used by at least
    two types of compilers: the typical Unix compiler and Visual C++.
    'macros' is the usual thing, a list of 1- or 2-tuples, where (name,)
    means undefine (-U) macro 'name', and (name,value) means define (-D)
    macro 'name' to 'value'.  'include_dirs' is just a list of directory
    names to be added to the header file search path (-I).  Returns a list
    of command-line options suitable for either Unix compilers or Visual
    C++.
    r*r/zPbad macro definition '%s': each element of 'macros' list must be a 1- or 2-tuplez-U%srNz-D%sz-D%s=%sz-I%s)r&r0r1r2r5)rrrWZmacror9rrrrOs"$��rOcCs�g}|D]}|�|�|��q|D],}|�|�}t|t�rD||}q"|�|�q"|D]V}tj�|�\}}	|r�|�|g|	�}
|
r�|�|
�q�|�	d|�qT|�|�
|��qT|S)acGenerate linker options for searching library directories and
    linking with specific libraries.  'libraries' and 'library_dirs' are,
    respectively, lists of library names (not filenames!) and search
    directories.  Returns a list of command-line options suitable for use
    with some compiler (depending on the two format strings passed in).
    z6no library file corresponding to '%s' found (skipping))r5r�r�r&rMrQrRr�r�r�r�)r�rrrZlib_optsr9�optr�Zlib_dirZlib_nameZlib_filerrr�gen_lib_options8s&


�r�)NN)NNrrr)r�r�rQr�Zdistutils.errorsZdistutils.spawnrZdistutils.file_utilrZdistutils.dir_utilrZdistutils.dep_utilrrZdistutils.utilrr	Z	distutilsr
rr�r�r�r�r�rOr�rrrr�<module>s8
�
--distutils/__pycache__/file_util.cpython-38.pyc000064400000013457151153537450015427 0ustar00U

e5d��@sZdZddlZddlmZddlmZdddd�Zdd
d�Zdd
d�Zddd�Z	dd�Z
dS)zFdistutils.file_util

Utility functions for operating on single files.
�N)�DistutilsFileError)�logZcopyingzhard linkingzsymbolically linking)N�hard�sym�@c
Cs�d}d}�ztzt|d�}Wn4tk
rN}ztd||jf��W5d}~XYnXtj�|�r�zt�|�Wn4tk
r�}ztd||jf��W5d}~XYnXzt|d�}Wn4tk
r�}ztd||jf��W5d}~XYnXz|�	|�}Wn6tk
�r(}ztd||jf��W5d}~XYnX|�s4�q|z|�
|�Wq�tk
�rx}ztd||jf��W5d}~XYq�Xq�W5|�r�|��|�r�|��XdS)	a5Copy the file 'src' to 'dst'; both must be filenames.  Any error
    opening either file, reading from 'src', or writing to 'dst', raises
    DistutilsFileError.  Data is read/written in chunks of 'buffer_size'
    bytes (default 16k).  No attempt is made to handle anything apart from
    regular files.
    N�rbzcould not open '%s': %szcould not delete '%s': %s�wbzcould not create '%s': %szcould not read from '%s': %szcould not write to '%s': %s)�close�open�OSErrorr�strerror�os�path�exists�unlink�read�write)�src�dstZbuffer_sizeZfsrcZfdst�eZbuf�r�+/usr/lib64/python3.8/distutils/file_util.py�_copy_file_contentssL	$����r�cCsddlm}ddlm}	m}
m}m}tj�	|�s<t
d|��tj�|�rd|}
tj�|tj�
|��}ntj�|�}
|r�|||�s�|dkr�t�d|�|dfSzt|}Wn tk
r�td|��YnX|dk�rtj�
|�tj�
|�kr�t�d|||
�nt�d|||�|�r|dfS|d	k�rrtj�|��rBtj�||��s�zt�||�|dfWStk
�rnYnXn<|d
k�r�tj�|��r�tj�||��s�t�||�|dfSt||�|�s�|�rt�|�}|�r�t�|||	||
f�|�rt�||||��|dfS)aCopy a file 'src' to 'dst'.  If 'dst' is a directory, then 'src' is
    copied there with the same name; otherwise, it must be a filename.  (If
    the file exists, it will be ruthlessly clobbered.)  If 'preserve_mode'
    is true (the default), the file's mode (type and permission bits, or
    whatever is analogous on the current platform) is copied.  If
    'preserve_times' is true (the default), the last-modified and
    last-access times are copied as well.  If 'update' is true, 'src' will
    only be copied if 'dst' does not exist, or if 'dst' does exist but is
    older than 'src'.

    'link' allows you to make hard links (os.link) or symbolic links
    (os.symlink) instead of copying: set it to "hard" or "sym"; if it is
    None (the default), files are copied.  Don't set 'link' on systems that
    don't support it: 'copy_file()' doesn't check if hard or symbolic
    linking is available. If hardlink fails, falls back to
    _copy_file_contents().

    Under Mac OS, uses the native file copy function in macostools; on
    other systems, uses '_copy_file_contents()' to copy file contents.

    Return a tuple (dest_name, copied): 'dest_name' is the actual name of
    the output file, and 'copied' is true if the file was copied (or would
    have been copied, if 'dry_run' true).
    r)�newer)�ST_ATIME�ST_MTIME�ST_MODE�S_IMODEz4can't copy '%s': doesn't exist or not a regular filerz"not copying %s (output up-to-date)z&invalid value '%s' for 'link' argumentz%s %s -> %srr)Zdistutils.dep_utilr�statrrrrr
r�isfiler�isdir�join�basename�dirnamer�debug�_copy_action�KeyError�
ValueError�infor�samefile�linkr�symlinkr�utime�chmod)rrZ
preserve_modeZpreserve_times�updater+�verbose�dry_runrrrrr�dir�action�strrr�	copy_fileCsV!�





r5cCs�ddlm}m}m}m}m}ddl}	|dkr:t�d||�|rB|S||�sVt	d|��||�rrt
j�|||��}n||�r�t	d||f��|||��s�t	d||f��d	}
zt
�
||�WnPtk
�r
}z0|j\}}
||	jkr�d
}
nt	d|||
f��W5d}~XYnX|
�r�t|||d�zt
�|�Wnhtk
�r�}zH|j\}}
zt
�|�Wntk
�rpYnXt	d
||||
f��W5d}~XYnX|S)a%Move a file 'src' to 'dst'.  If 'dst' is a directory, the file will
    be moved into it with the same name; otherwise, 'src' is just renamed
    to 'dst'.  Return the new full name of the file.

    Handles cross-device moves on Unix using 'copy_file()'.  What about
    other systems???
    r)rr r!r#r$Nrzmoving %s -> %sz#can't move '%s': not a regular filez0can't move '%s': destination '%s' already existsz2can't move '%s': destination '%s' not a valid pathFTzcouldn't move '%s' to '%s': %s)r0zAcouldn't move '%s' to '%s' by copy/delete: delete '%s' failed: %s)Zos.pathrr r!r#r$�errnorr)rr
rr"�renamer�argsZEXDEVr5r)rrr0r1rr r!r#r$r6Zcopy_itrZnum�msgrrr�	move_file�s`����

�

��r:cCs6t|d�}z|D]}|�|d�qW5|��XdS)z{Create a file with the specified name and write 'contents' (a
    sequence of strings without line terminators) to it.
    �w�
N)r
r	r)�filename�contents�f�linerrr�
write_file�s

rA)r)rrrNrr)rr)�__doc__r
Zdistutils.errorsrZ	distutilsrr&rr5r:rArrrr�<module>s"�
3�
d�
?distutils/__pycache__/__init__.cpython-38.opt-1.pyc000064400000000602151153537450016135 0ustar00U

e5d��@s&dZddlZejdej�d��ZdS)z�distutils

The main package for the Python Module Distribution Utilities.  Normally
used from a setup script as

   from distutils.core import setup

   setup (...)
�N� )�__doc__�sys�version�index�__version__�rr�*/usr/lib64/python3.8/distutils/__init__.py�<module>s
distutils/__pycache__/text_file.cpython-38.pyc000064400000020371151153537450015427 0ustar00U

e5d�0�@s&dZddlZddlZGdd�d�ZdS)z�text_file

provides the TextFile class, which gives an interface to text files
that (optionally) takes care of stripping comments, ignoring blank
lines, and joining lines with backslashes.�Nc@steZdZdZdddddddd�Zddd�Zd	d
�Zdd�Zdd
d�Zddd�Z	ddd�Z
dd�Zdd�Zdd�Z
dS)�TextFilea�Provides a file-like object that takes care of all the things you
       commonly want to do when processing a text file that has some
       line-by-line syntax: strip comments (as long as "#" is your
       comment character), skip blank lines, join adjacent lines by
       escaping the newline (ie. backslash at end of line), strip
       leading and/or trailing whitespace.  All of these are optional
       and independently controllable.

       Provides a 'warn()' method so you can generate warning messages that
       report physical line number, even if the logical line in question
       spans multiple physical lines.  Also provides 'unreadline()' for
       implementing line-at-a-time lookahead.

       Constructor is called as:

           TextFile (filename=None, file=None, **options)

       It bombs (RuntimeError) if both 'filename' and 'file' are None;
       'filename' should be a string, and 'file' a file object (or
       something that provides 'readline()' and 'close()' methods).  It is
       recommended that you supply at least 'filename', so that TextFile
       can include it in warning messages.  If 'file' is not supplied,
       TextFile creates its own using 'io.open()'.

       The options are all boolean, and affect the value returned by
       'readline()':
         strip_comments [default: true]
           strip from "#" to end-of-line, as well as any whitespace
           leading up to the "#" -- unless it is escaped by a backslash
         lstrip_ws [default: false]
           strip leading whitespace from each line before returning it
         rstrip_ws [default: true]
           strip trailing whitespace (including line terminator!) from
           each line before returning it
         skip_blanks [default: true}
           skip lines that are empty *after* stripping comments and
           whitespace.  (If both lstrip_ws and rstrip_ws are false,
           then some lines may consist of solely whitespace: these will
           *not* be skipped, even if 'skip_blanks' is true.)
         join_lines [default: false]
           if a backslash is the last non-newline character on a line
           after stripping comments and whitespace, join the following line
           to it to form one "logical line"; if N consecutive lines end
           with a backslash, then N+1 physical lines will be joined to
           form one logical line.
         collapse_join [default: false]
           strip leading whitespace from lines that are joined to their
           predecessor; only matters if (join_lines and not lstrip_ws)
         errors [default: 'strict']
           error handler used to decode the file content

       Note that since 'rstrip_ws' can strip the trailing newline, the
       semantics of 'readline()' must differ from those of the builtin file
       object's 'readline()' method!  In particular, 'readline()' returns
       None for end-of-file: an empty string might just be a blank line (or
       an all-whitespace line), if 'rstrip_ws' is true but 'skip_blanks' is
       not.�r�strict)�strip_comments�skip_blanks�	lstrip_ws�	rstrip_ws�
join_lines�
collapse_join�errorsNcKs�|dkr|dkrtd��|j��D]0}||kr@t||||�q"t|||j|�q"|��D]}||jkr\td|��q\|dkr�|�|�n||_||_d|_g|_	dS)z�Construct a new TextFile object.  At least one of 'filename'
           (a string) and 'file' (a file-like object) must be supplied.
           They keyword argument options are described above and affect
           the values returned by 'readline()'.Nz7you must supply either or both of 'filename' and 'file'zinvalid TextFile option '%s'r)
�RuntimeError�default_options�keys�setattr�KeyError�open�filename�file�current_line�linebuf)�selfrrZoptions�opt�r�+/usr/lib64/python3.8/distutils/text_file.py�__init__Ns
zTextFile.__init__cCs&||_tj|jd|jd�|_d|_dS)zyOpen a new file named 'filename'.  This overrides both the
           'filename' and 'file' arguments to the constructor.�r)rrN)r�iorrrr)rrrrrrosz
TextFile.opencCs$|j}d|_d|_d|_|��dS)ziClose the current file and forget everything we know about it
           (filename, current line number).N)rrr�close)rrrrrrvs
zTextFile.closecCsjg}|dkr|j}|�|jd�t|ttf�rD|�dt|��n|�d|�|�t|��d�|�S)Nz, z
lines %d-%d: z	line %d: �)r�appendr�
isinstance�list�tuple�str�join)r�msg�lineZoutmsgrrr�	gen_errorszTextFile.gen_errorcCstd|�||���dS)Nzerror: )�
ValueErrorr'�rr%r&rrr�error�szTextFile.errorcCs tj�d|�||�d�dS)a�Print (to stderr) a warning message tied to the current logical
           line in the current file.  If the current logical line in the
           file spans multiple physical lines, the warning refers to the
           whole range, eg. "lines 3-5".  If 'line' supplied, it overrides
           the current line number; it may be a list or tuple to indicate a
           range of physical lines, or an integer for a single physical
           line.z	warning: �
N)�sys�stderr�writer'r)rrr�warn�sz
TextFile.warncCs�|jr|jd}|jd=|Sd}|j��}|dkr6d}|jr�|r�|�d�}|dkrTnX|dksl||ddkr�|ddkr|dp~d}|d|�|}|��dkr�q n|�d	d�}|j�r|�r|dkr�|�d
�|S|j	r�|�
�}||}t|jt
��r
|jdd|jd<n|j|jdg|_n:|dk�r,dSt|jt
��rL|jdd|_n|jd|_|j�rr|j�rr|��}n"|j�r�|�
�}n|j�r�|��}|dk�s�|dk�r�|j�r�q |j�r�|ddk�r�|dd�}q |dd�dk�r�|dd�d}q |S)
aURead and return a single logical line from the current file (or
           from an internal buffer if lines have previously been "unread"
           with 'unreadline()').  If the 'join_lines' option is true, this
           may involve reading multiple physical lines concatenated into a
           single string.  Updates the current line number, so calling
           'warn()' after 'readline()' emits a warning about the physical
           line(s) just read.  Returns None on end-of-file, since the empty
           string can occur if 'rstrip_ws' is true but 'strip_blanks' is
           not.���rN�#rr�\r+z\#z2continuation line immediately precedes end-of-file���z\
)rr�readliner�find�strip�replacer	r/r
�lstripr rr!rr�rstripr)rr&Zbuildup_line�posZeolrrrr4�sf




	
�


zTextFile.readlinecCs(g}|��}|dkr|S|�|�qdS)zWRead and return the list of all logical lines remaining in the
           current file.N)r4r)r�linesr&rrr�	readliness
zTextFile.readlinescCs|j�|�dS)z�Push 'line' (a string) onto an internal buffer that will be
           checked by future 'readline()' calls.  Handy for implementing
           a parser with line-at-a-time lookahead.N)rr)rr&rrr�
unreadlineszTextFile.unreadline)NN)N)N)N)�__name__�
__module__�__qualname__�__doc__r
rrrr'r*r/r4r<r=rrrrr
s$:�	
!	



x
r)rAr,rrrrrr�<module>sdistutils/__pycache__/util.cpython-38.opt-2.pyc000064400000022700151153537450015357 0ustar00U

e5d�Q�@sddlZddlZddlZddlZddlZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZdd�Zd	d
�Zdd�Zd
d�Zdadd�Zdd�Zd)dd�Zdaaadd�Zdd�Zd*dd�Zdd�Zd+dd �Zd!d"�Zd,d#d$�Z d-d%d&�Z!Gd'd(�d(�Z"dS).�N)�DistutilsPlatformError)�newer)�spawn)�log)�DistutilsByteCompileErrorc
Cs�tjdkrFdtj��krdSdtj��kr.dSdtj��kr@dStjSdtjkrZtjdStjd	ksnttd
�sttjSt��\}}}}}|���	dd�}|�	d
d�}|�	dd�}|dd�dkr�d||fS|dd�dk�r,|ddk�r�d}dt
|d�d|dd�f}ddd�}|d|tj7}n�|dd�dk�rLd|||fS|dd �d!k�r�d!}t�
d"tj�}|�|�}|�r�|��}n>|dd �d#k�r�ddl}ddl}	|�|	j��|||�\}}}d$|||fS)%N�ntZamd64�	win-amd64z(arm)�	win-arm32z(arm64)z	win-arm64Z_PYTHON_HOST_PLATFORM�posix�uname�/�� �_�-�Zlinuxz%s-%sZsunosr�5Zsolarisz%d.%s��Z32bitZ64bit)i���l����z.%sZaixz%s-%s.%s��cygwinz[\d.]+�darwinz%s-%s-%s)�os�name�sys�version�lower�platform�environ�hasattrr�replace�int�maxsize�re�compile�ASCII�match�group�_osx_supportZdistutils.sysconfigZget_platform_osxZ	sysconfigZget_config_vars)
ZosnameZhost�releaser�machineZbitnessZrel_re�mr(�	distutils�r-�&/usr/lib64/python3.8/distutils/util.py�get_host_platformsR


 


�
r/cCs8tjdkr.dddd�}|�tj�d��p,t�St�SdS)NrZwin32rr	)Zx86Zx64ZarmZVSCMD_ARG_TGT_ARCH)rr�getrr/)ZTARGET_TO_PLATr-r-r.�get_platformas
�r1cCsztjdkr|S|s|S|ddkr.td|��|ddkrFtd|��|�d�}d|krd|�d�qP|sntjStjj|�S)Nrrzpath '%s' cannot be absolute���zpath '%s' cannot end with '/'�.)r�sep�
ValueError�split�remove�curdir�path�join)�pathname�pathsr-r-r.�convert_pathls	

r=cCs�tjdkr<tj�|�s$tj�||�Stj�||dd��SnNtjdkr|tj�|�\}}|ddkrn|dd�}tj�||�Stdtj��dS)Nr
�rr�\z!nothing known about platform '%s')rrr9�isabsr:�
splitdriver)Znew_rootr;Zdriver9r-r-r.�change_root�s

rBc	CsxtrdStjdkrZdtjkrZz$ddl}|�t���dtjd<Wnttfk
rXYnXdtjkrpt	�tjd<dadS)Nr
�HOMErrZPLATr>)
�_environ_checkedrrr�pwd�getpwuid�getuid�ImportError�KeyErrorr1)rEr-r-r.�
check_environ�s	
rJc
CsVt�|fdd�}zt�d||�WStk
rP}ztd|��W5d}~XYnXdS)NcSs,|�d�}||krt||�Stj|SdS)Nr>)r'�strrr)r&�
local_varsZvar_namer-r-r.�_subst�s
zsubst_vars.<locals>._substz\$([a-zA-Z_][a-zA-Z_0-9]*)zinvalid variable '$%s')rJr#�subrIr5)�srLrM�varr-r-r.�
subst_vars�s	rQ�error: cCs|t|�S�N)rK)�exc�prefixr-r-r.�grok_environment_error�srVcCs(t�dtj�at�d�at�d�adS)Nz
[^\\\'\"%s ]*z'(?:[^'\\]|\\.)*'z"(?:[^"\\]|\\.)*")r#r$�string�
whitespace�
_wordchars_re�
_squote_re�
_dquote_rer-r-r-r.�_init_regex�s
r\cCs�tdkrt�|��}g}d}|�r�t�||�}|��}|t|�krZ|�|d|���q�||tjkr�|�|d|��||d��	�}d}n�||dkr�|d|�||dd�}|d}n�||dkr�t
�||�}n*||dkr�t�||�}ntd||��|dk�r t
d||��|��\}}|d|�||d|d�||d�}|��d}|t|�kr|�|��q�q|S)	Nrr?r>�'�"z!this can't happen (bad char '%c')z"bad string (mismatched %s quotes?)r)rYr\�stripr&�end�len�appendrWrX�lstriprZr[�RuntimeErrorr5�span)rOZwords�posr+r`Zbegr-r-r.�split_quoted�s@

,
rgcCsP|dkr6d|j|f}|dd�dkr6|dd�d}t�|�|sL||�dS)Nz%s%r���z,)r�))�__name__r�info)�func�args�msg�verbose�dry_runr-r-r.�executes	
rqcCs2|��}|dkrdS|dkr dStd|f��dS)N)�yZyes�t�trueZon�1r>)�nZno�fZfalseZoff�0rzinvalid truth value %r)rr5)�valr-r-r.�	strtobool2srzr>c	CsTddl}tjrtd��|dkr*do(|dk}|�s@zddlm}	|	d�\}
}Wn.tk
rzddlm}d|d�}
}YnXt�	d|�|s�|
dk	r�t
�|
d�}
n
t|d�}
|
�B|
�
d	�|
�
d
�tt|��d�|
�
d|||||f�W5QRXtjg}|�|���|�|�t||d
�tt
j|fd||d
��nddlm}|D]�}|dd�dk�rj�qP|dk�r�|dk�r�dn|}tjj||d�}ntj�|�}|}|�r�|dt|��|k�r�td||f��|t|�d�}|�r�t
j�||�}t
j� |�}|�rP|�st!||��r>t�	d||�|�sL||||�nt�"d||��qPdS)Nrzbyte-compiling is disabled.F)�mkstemp�.py)�mktempz$writing byte-compilation script '%s'�wz2from distutils.util import byte_compile
files = [
z,
z]
z�
byte_compile(files, optimize=%r, force=%r,
             prefix=%r, base_dir=%r,
             verbose=%r, dry_run=0,
             direct=1)
)rpzremoving %s)r$���r
)�optimizationz1invalid prefix: filename %r doesn't start with %rzbyte-compiling %s to %sz%skipping byte-compilation of %s to %s)#�
subprocessr�dont_write_bytecoderZtempfiler{rHr}rrkr�fdopen�open�writer:�map�repr�
executable�extendZ"_optim_args_from_interpreter_flagsrbrrqr7�
py_compiler$�	importlib�util�cache_from_sourcerar5r9�basenamer�debug)Zpy_files�optimizeZforcerUZbase_dirrorpZdirectr�r{Z	script_fdZscript_namer}Zscript�cmdr$�file�opt�cfile�dfileZ
cfile_baser-r-r.�byte_compileBsx$

�
�

���r�cCs|�d�}d}|�|�S)N�
z	
        )r6r:)�header�linesr4r-r-r.�
rfc822_escape�s
r�cCsV|sdSddlm}m}Gdd�d|�}|dkr8|d�}|||d�}|j|dd�dS)	Nr)�RefactoringTool�get_fixers_from_packagec@s$eZdZdd�Zdd�Zdd�ZdS)z*run_2to3.<locals>.DistutilsRefactoringToolc_stj|f|��dSrS)r�error)�selfrnrm�kwr-r-r.�	log_error�sz4run_2to3.<locals>.DistutilsRefactoringTool.log_errorcWstj|f|��dSrS)rrk�r�rnrmr-r-r.�log_message�sz6run_2to3.<locals>.DistutilsRefactoringTool.log_messagecWstj|f|��dSrS)rr�r�r-r-r.�	log_debug�sz4run_2to3.<locals>.DistutilsRefactoringTool.log_debugN)rj�
__module__�__qualname__r�r�r�r-r-r-r.�DistutilsRefactoringTool�sr�z
lib2to3.fixes)�optionsT)r�)Zlib2to3.refactorr�r�Zrefactor)�files�fixer_namesr��explicitr�r�r��rr-r-r.�run_2to3�s
r�c	Csddlm}ddlm}ddlm}|�}	t��}
t�|�z|	�	�W5t�|
�X|	j
|	jdd�<|r�|��D]}|�
�}|s�qr|	�|�qrg}|	jD]L}
tj�||
�}|tj�|��|tj�||
�|dd�}|dr�|�|�q�tdd�|D�|||d	�|S)
Nr)�mkpath)�	copy_file)�FileListr>)�updatecSsg|]}|���d�r|�qS)r|)r�endswith)�.0�fnr-r-r.�
<listcomp>sz$copydir_run_2to3.<locals>.<listcomp>)r�r�r�)Zdistutils.dir_utilr�Zdistutils.file_utilr�Zdistutils.filelistr�r�getcwd�chdir�findallZallfilesr��
splitlinesr_Zprocess_template_liner9r:�dirnamerbr�)�src�dest�templater�r�r�r�r�r�Zfilelistr8�lineZcopied�filenameZoutname�resr-r-r.�copydir_run_2to3�s:

�r�c@s eZdZdZdZdZdd�ZdS)�	Mixin2to3NcCst||j|j|j�SrS)r�r�r�r�)r�r�r-r-r.r�-szMixin2to3.run_2to3)rjr�r�r�r�r�r�r-r-r-r.r�sr�)rR)Nrr)rrNNr>rN)NNN)NNNN)#rr#�importlib.utilr�rWrZdistutils.errorsrZdistutils.dep_utilrZdistutils.spawnrr,rrr/r1r=rBrDrJrQrVrYrZr[r\rgrqrzr�r�r�r�r�r-r-r-r.�<module>sLO
=
�


�
!distutils/__pycache__/_msvccompiler.cpython-38.opt-2.pyc000064400000026757151153537450017264 0ustar00U

e5dRN�@s�ddlZddlZddlZddlZddlZddlmZmZmZm	Z	m
Z
ddlmZm
Z
ddlmZddlmZddlmZdd�Zd	d
�Zddd
dd�Zdd�Zdd�Zddd�Zddddd�ZGdd�de�ZdS)�N)�DistutilsExecError�DistutilsPlatformError�CompileError�LibError�	LinkError)�	CCompiler�gen_lib_options)�log)�get_platform)�countcCsztjtjdtjtjBd�}Wn tk
r>t�d�YdSXd}d}|��t�D]�}zt�	||�\}}}Wntk
r�Yq�YnX|rT|tj
krTtj�
|�rTztt|��}Wnttfk
r�YqTYnX|dkrT||krT||}}qTW5QRX||fS)Nz'Software\Microsoft\VisualStudio\SxS\VC7)�accesszVisual C++ is not registered�NNr�)�winregZ	OpenKeyEx�HKEY_LOCAL_MACHINEZKEY_READZKEY_WOW64_32KEY�OSErrorr	�debugrZ	EnumValueZREG_SZ�os�path�isdir�int�float�
ValueError�	TypeError)�key�best_version�best_dir�i�vZvc_dirZvt�version�r �//usr/lib64/python3.8/distutils/_msvccompiler.py�_find_vc2015s2
�



r"c
Cs�ddl}tj�d�ptj�d�}|s(dSz8tjtj�|ddd�dd	d
ddd
ddg	ddd���}Wntj	t
tfk
r~YdSXtj�|ddd�}tj�|�r�d|fSdS)NrzProgramFiles(x86)ZProgramFilesr
zMicrosoft Visual StudioZ	Installerzvswhere.exez-latestz-prereleasez	-requiresz1Microsoft.VisualStudio.Component.VC.Tools.x86.x64z	-propertyZinstallationPathz	-products�*�mbcs�strict)�encoding�errorsZVCZ	AuxiliaryZBuild�)
�jsonr�environ�get�
subprocess�check_outputr�join�strip�CalledProcessErrorr�UnicodeDecodeErrorr)r)�rootrr r r!�_find_vc2017:s2
��r3�x86Zx64ZarmZarm64)r4�	x86_amd64�x86_arm�	x86_arm64cCs\t�\}}|st�\}}|s*t�d�dStj�|d�}tj�|�sTt�d|�dS|dfS)Nz$No suitable Visual C++ version foundr
z
vcvarsall.batz%s cannot be found)r3r"r	rrrr.�isfile)�	plat_spec�_rr�	vcvarsallr r r!�_find_vcvarsallcs


r<c
Cs�t�d�rdd�tj��D�St|�\}}|s6td��z&tjd�||�tj	d�j
ddd	�}Wn@tjk
r�}z t�
|j�td
�|j���W5d}~XYnXdd�dd
�|��D�D�}|S)NZDISTUTILS_USE_SDKcSsi|]\}}|��|�qSr ��lower)�.0r�valuer r r!�
<dictcomp>ws�z_get_vc_env.<locals>.<dictcomp>zUnable to find vcvarsall.batzcmd /u /c "{}" {} && set)�stderrzutf-16le�replace)r'zError executing {}cSs$i|]\}}}|r|r|��|�qSr r=)r?rr:r@r r r!rA�s
�css|]}|�d�VqdS)�=N)�	partition)r?�liner r r!�	<genexpr>�sz_get_vc_env.<locals>.<genexpr>)r�getenvr*�itemsr<rr,r-�formatZSTDOUT�decoder0r	�error�output�cmd�
splitlines)r9r;r:�out�exc�envr r r!�_get_vc_envus0
�
��
��rScCsN|st�d��tj�}|D].}tj�tj�|�|�}tj�|�r|Sq|S�Nr)rrH�split�pathseprr.�abspathr8)Zexe�paths�p�fnr r r!�	_find_exe�s	
r[r5r6r7)Zwin32z	win-amd64z	win-arm32z	win-arm64c
s�eZdZdZiZdgZdddgZdgZdgZeeeeZ	dZ
d	Zd
ZdZ
dZZd
Zd'dd�Zd(dd�Zd)dd�Zd*dd�Zd+dd�Zd,dd�Z�fdd�Zdd �Zd!d"�Zd#d$�Zd-d%d&�Z�ZS).�MSVCCompilerZmsvcz.cz.ccz.cppz.cxx�.rcz.mcz.resz.objz.libz.dllz%s%sz.exercCs t�||||�d|_d|_dS)NF)r�__init__�	plat_name�initialized)�self�verboseZdry_runZforcer r r!r^�szMSVCCompiler.__init__NcCs�|dkrt�}|tkr(td�tt����t|}t|�}|sDtd��|�dd�|_|j�t	j
�}td|�|_td|�|_
td|�|_td|�|_td	|�|_td
|�|_|�dd��t	j
�D]}|r�|�|�t	j��q�|�dd��t	j
�D]}|r�|�|�t	j��q�d|_d
dddddg|_d
dddddg|_d
ddg}d
dddg}|d �|_|d!�|_|d"�|_|d#�|_|�|_|�|_tj df|jtj df|jtj df|jtj!df|jtj!df|jtj!df|jtj"df|jtj"df|jtj"df|ji	|_#d|_$dS)$Nz--plat-name must be one of {}z7Unable to find a compatible Visual Studio installation.r�zcl.exezlink.exezlib.exezrc.exezmc.exezmt.exeZinclude�libz/nologoz/Oxz/W3z/GLz/DNDEBUGz/MDz/Odz/MDdz/Ziz/D_DEBUGz/INCREMENTAL:NOz/LTCGz/DEBUG:FULL�/MANIFEST:EMBED,ID=1�/DLL�/MANIFEST:EMBED,ID=2�/MANIFESTUAC:NOFT)re)re)rfrgrh)rfrgrh)%r
�PLAT_TO_VCVARSrrJ�tuplerSr+�_pathsrUrrVr[�cc�linkerrd�rc�mcZmtZadd_include_dir�rstrip�sepZadd_library_dirZpreprocess_options�compile_options�compile_options_debugZldflags_exeZldflags_exe_debugZldflags_sharedZldflags_shared_debugZldflags_staticZldflags_static_debugrZ
EXECUTABLEZ
SHARED_OBJECTZSHARED_LIBRARY�_ldflagsr`)rar_r9Zvc_envrX�dir�ldflagsZ
ldflags_debugr r r!�
initialize�s������



�zMSVCCompiler.initializerccsT�fdd��jD��fdd��j�jD����p4d����fdd�}tt||��S)Ncsi|]}|�j�qSr )�
obj_extension�r?�ext�rar r!rA&sz1MSVCCompiler.object_filenames.<locals>.<dictcomp>csi|]}|�j�qSr )�
res_extensionryr{r r!rA'srccs�tj�|�\}}�r"tj�|�}n2tj�|�\}}|�tjjtjjf�rT|dd�}ztj��|�|�WSt	k
r�t
d�|���YnXdS)N�zDon't know how to compile {})rr�splitext�basename�
splitdrive�
startswithrq�altsepr.�LookupErrorrrJ)rY�baserzr:)�ext_map�
output_dir�	strip_dirr r!�
make_out_path,sz4MSVCCompiler.object_filenames.<locals>.make_out_path)�src_extensions�_rc_extensions�_mc_extensions�list�map)raZsource_filenamesr�r�r�r )r�r�rar�r!�object_filenames!s�zMSVCCompiler.object_filenamesc	Cs�|js|��|�||||||�}	|	\}}
}}}|p6g}
|
�d�|rT|
�|j�n|
�|j�d}|
D�]}z||\}}Wntk
r�YqhYnX|r�tj	�
|�}||jkr�d|}�nD||jkr�d|}d}�n*||j
k�r@|}d|}z|�|jg|||g�Wqhtk
�r:}zt|��W5d}~XYqhXqhn�||jk�r�tj	�|�}tj	�|�}z\|�|jd|d||g�tj	�tj	�|��\}}tj	�||d	�}|�|jd||g�Wqhtk
�r�}zt|��W5d}~XYqhXqhntd
�||���|jg|
|}|�r"|�d�|�|�|�d|�|�|�z|�|�Wqhtk
�r~}zt|��W5d}~XYqhXqh|
S)
Nz/cFz/Tcz/TpTz/foz-hz-rr]z"Don't know how to compile {} to {}z/EHscz/Fo)r`rwZ_setup_compile�append�extendrsrr�KeyErrorrrrW�
_c_extensions�_cpp_extensionsr��spawnrnrrr��dirnameror~rr.rJrl)raZsourcesr�ZmacrosZinclude_dirsr�
extra_preargs�extra_postargsZdependsZcompile_info�objectsZpp_optsZbuildZcompile_optsZadd_cpp_opts�obj�srcrzZ	input_optZ
output_opt�msgZh_dirZrc_dirr�r:Zrc_file�argsr r r!�compileBsx
�




�


zMSVCCompiler.compilec	
Cs�|js|��|�||�\}}|j||d�}|�||�r�|d|g}|rJz,t�d|jd�|��|�	|jg|�Wq�t
k
r�}zt|��W5d}~XYq�Xnt�d|�dS)N)r��/OUT:�Executing "%s" %s� �skipping %s (up-to-date))r`rw�_fix_object_args�library_filename�
_need_linkr	rrdr.r�rr)	rar�Zoutput_libnamer�r�target_lang�output_filenameZlib_argsr�r r r!�create_static_lib�s�zMSVCCompiler.create_static_libc
Cs�|js|��|�||�\}}|�|||�}|\}}}|rL|�dt|��t||||�}|dk	rptj�	||�}|�
||��r�|j||	f}dd�|p�gD�}||||d|g}tj�|d�}|dk	�rtj�
tj�|��\}}tj�	||�|��}|�d|�|
�r|
|dd�<|�r.|�|�tj�tj�|��}|�|�z,t�d|jd�	|��|�|jg|�Wn,tk
�r�}zt|��W5d}~XYnXnt�d	|�dS)
Nz5I don't know what to do with 'runtime_library_dirs': cSsg|]}d|�qS)z/EXPORT:r )r?Zsymr r r!�
<listcomp>�sz%MSVCCompiler.link.<locals>.<listcomp>r�rz/IMPLIB:r�r�r�)r`rwr�Z
_fix_lib_args�warn�strrrrr.r�rtr�r~rr�r�r�rWZmkpathr	rrmr�rr)raZtarget_descr�r�r�Z	librariesZlibrary_dirsZruntime_library_dirsZexport_symbolsrr�r�Z
build_tempr�Z
fixed_argsZlib_optsrvZexport_optsZld_argsZdll_nameZdll_extZimplib_filer�r r r!�link�s`�
��
��

��

zMSVCCompiler.linkc	s8t�d�}z|jtjd<t��|�W�S|tjd<XdSrT)rrHr*rk�superr�)rarNZold_path��	__class__r r!r��s

zMSVCCompiler.spawncCsd|S)Nz	/LIBPATH:r �rarur r r!�library_dir_optionszMSVCCompiler.library_dir_optioncCstd��dS)Nz:don't know how to set runtime library search path for MSVC)rr�r r r!�runtime_library_dir_option
s�z'MSVCCompiler.runtime_library_dir_optioncCs
|�|�S)N)r�)rardr r r!�library_optionszMSVCCompiler.library_optioncCs\|r|d|g}n|g}|D]:}|D]0}tj�||�|��}tj�|�r$|Sq$qdS)NZ_d)rrr.r�r8)ra�dirsrdrZ	try_namesru�nameZlibfiler r r!�find_library_fileszMSVCCompiler.find_library_file)rrr)N)rrc)NNNrNNN)NrN)
NNNNNrNNNN)r)�__name__�
__module__�__qualname__Z
compiler_typeZexecutablesr�r�r�r�r�r|rxZstatic_lib_extensionZshared_lib_extensionZstatic_lib_formatZshared_lib_formatZ
exe_extensionr^rwr�r�r�r�r�r�r�r�r��
__classcell__r r r�r!r\�sd
��

P�
"�
]�
�
Er\)N)rZshutil�statr,rZdistutils.errorsrrrrrZdistutils.ccompilerrrZ	distutilsr	Zdistutils.utilr
�	itertoolsrr"r3ZPLAT_SPEC_TO_RUNTIMEr<rSr[rir\r r r r!�<module>s2#�
�distutils/__pycache__/extension.cpython-38.pyc000064400000015415151153537450015463 0ustar00U

e5d)�@s.dZddlZddlZGdd�d�Zdd�ZdS)zmdistutils.extension

Provides the Extension class, used to describe C/C++ extension
modules in setup scripts.�Nc@s"eZdZdZddd�Zdd�ZdS)�	Extensiona�Just a collection of attributes that describes an extension
    module and everything needed to build it (hopefully in a portable
    way, but there are hooks that let you be as unportable as you need).

    Instance attributes:
      name : string
        the full name of the extension, including any packages -- ie.
        *not* a filename or pathname, but Python dotted name
      sources : [string]
        list of source filenames, relative to the distribution root
        (where the setup script lives), in Unix form (slash-separated)
        for portability.  Source files may be C, C++, SWIG (.i),
        platform-specific resource files, or whatever else is recognized
        by the "build_ext" command as source for a Python extension.
      include_dirs : [string]
        list of directories to search for C/C++ header files (in Unix
        form for portability)
      define_macros : [(name : string, value : string|None)]
        list of macros to define; each macro is defined using a 2-tuple,
        where 'value' is either the string to define it to or None to
        define it without a particular value (equivalent of "#define
        FOO" in source or -DFOO on Unix C compiler command line)
      undef_macros : [string]
        list of macros to undefine explicitly
      library_dirs : [string]
        list of directories to search for C/C++ libraries at link time
      libraries : [string]
        list of library names (not filenames or paths) to link against
      runtime_library_dirs : [string]
        list of directories to search for C/C++ libraries at run time
        (for shared extensions, this is when the extension is loaded)
      extra_objects : [string]
        list of extra files to link with (eg. object files not implied
        by 'sources', static library that must be explicitly specified,
        binary resource files, etc.)
      extra_compile_args : [string]
        any extra platform- and compiler-specific information to use
        when compiling the source files in 'sources'.  For platforms and
        compilers where "command line" makes sense, this is typically a
        list of command-line arguments, but for other platforms it could
        be anything.
      extra_link_args : [string]
        any extra platform- and compiler-specific information to use
        when linking object files together to create the extension (or
        to create a new static Python interpreter).  Similar
        interpretation as for 'extra_compile_args'.
      export_symbols : [string]
        list of symbols to be exported from a shared extension.  Not
        used on all platforms, and not generally necessary for Python
        extensions, which typically export exactly one symbol: "init" +
        extension_name.
      swig_opts : [string]
        any extra options to pass to SWIG if a source file has the .i
        extension.
      depends : [string]
        list of files that the extension depends on
      language : string
        extension language (i.e. "c", "c++", "objc"). Will be detected
        from the source extensions if not provided.
      optional : boolean
        specifies that a build failure in the extension should not abort the
        build process, but simply not install the failing extension.
    NcKst|t�std��t|t�r.tdd�|D��s6td��||_||_|pHg|_|pRg|_|p\g|_	|pfg|_
|ppg|_|pzg|_|	p�g|_
|
p�g|_|p�g|_|p�g|_|
p�g|_|p�g|_||_||_t|�dk�rdd�|D�}d�t|��}d	|}t�|�dS)
Nz'name' must be a stringcss|]}t|t�VqdS)N)�
isinstance�str)�.0�v�r�+/usr/lib64/python3.8/distutils/extension.py�	<genexpr>jsz%Extension.__init__.<locals>.<genexpr>z#'sources' must be a list of stringsrcSsg|]}t|��qSr)�repr)rZoptionrrr�
<listcomp>�sz&Extension.__init__.<locals>.<listcomp>z, zUnknown Extension options: %s)rr�AssertionError�list�all�name�sources�include_dirs�
define_macros�undef_macros�library_dirs�	libraries�runtime_library_dirs�
extra_objects�extra_compile_args�extra_link_args�export_symbols�	swig_opts�depends�language�optional�len�join�sorted�warnings�warn)�selfrrrrrrrrrrrrrrrr�kwZoptions�msgrrr�__init__Vs6

�











zExtension.__init__cCsd|jj|jj|jt|�fS)Nz<%s.%s(%r) at %#x>)�	__class__�
__module__�__qualname__r�id)r$rrr�__repr__�s�zExtension.__repr__)NNNNNNNNNNNNNN)�__name__r)r*�__doc__r'r,rrrrrs"C�
/rcCs�ddlm}m}m}ddlm}ddlm}||�}||dddddd�}�z^g}|�	�}	|	dkrd�q�|�
|	�rpqP|	d|	dkr�d	kr�nn|�d
|	�qP||	|�}	||	�}
|
d}t|g�}d}
|
dd�D�]�}|
dk	r�|
�
|�d}
q�tj�|�d}|dd�}|dd�}|dk�r2|j�
|�q�|d
k�rJ|j�
|�q�|dk�r�|�d�}|dk�rz|j�
|df�n$|j�
|d|�||dd�f�q�|dk�r�|j�
|�q�|dk�r�|j�
|�q�|dk�r�|j�
|�q�|dk�r|j�
|�q�|dk�r|j�
|�q�|dk�r*|j}
q�|dk�r<|j}
q�|dk�rN|j}
q�|dk�rr|j�
|�|�s�|j}
q�|dk�r�|j�
|�q�|�d|�q�|�
|�qPW5|��X|S)z3Reads a Setup file and returns Extension instances.r)�parse_makefile�expand_makefile_vars�_variable_rx)�TextFile)�split_quoted�)Zstrip_commentsZskip_blanksZ
join_linesZ	lstrip_wsZ	rstrip_wsN����*z'%s' lines not handled yet�)z.cz.ccz.cppz.cxxz.c++z.mz.mmz-Iz-D�=z-Uz-Cz-lz-Lz-Rz-rpathz-Xlinkerz
-Xcompilerz-u)z.az.soz.slz.oz.dylibzunrecognized argument '%s')Zdistutils.sysconfigr/r0r1Zdistutils.text_filer2Zdistutils.utilr3�close�readline�matchr#r�append�os�path�splitextrr�findrrrrrrrr)�filenamer/r0r1r2r3�vars�file�
extensions�lineZwords�moduleZextZappend_next_wordZword�suffixZswitch�valueZequalsrrr�read_setup_file�s��
 







�










rI)r.r=r"rrIrrrr�<module>szdistutils/__pycache__/text_file.cpython-38.opt-2.pyc000064400000006417151153537450016374 0ustar00U

e5d�0�@s"ddlZddlZGdd�d�ZdS)�Nc@speZdZdddddddd�Zddd�Zdd	�Zd
d�Zddd
�Zddd�Zddd�Z	dd�Z
dd�Zdd�ZdS)�TextFile�r�strict)�strip_comments�skip_blanks�	lstrip_ws�	rstrip_ws�
join_lines�
collapse_join�errorsNcKs�|dkr|dkrtd��|j��D]0}||kr@t||||�q"t|||j|�q"|��D]}||jkr\td|��q\|dkr�|�|�n||_||_d|_g|_	dS)Nz7you must supply either or both of 'filename' and 'file'zinvalid TextFile option '%s'r)
�RuntimeError�default_options�keys�setattr�KeyError�open�filename�file�current_line�linebuf)�selfrrZoptions�opt�r�+/usr/lib64/python3.8/distutils/text_file.py�__init__Ns
zTextFile.__init__cCs&||_tj|jd|jd�|_d|_dS)N�r)rr)r�iorrrr)rrrrrrosz
TextFile.opencCs$|j}d|_d|_d|_|��dS�N)rrr�close)rrrrrrvs
zTextFile.closecCsjg}|dkr|j}|�|jd�t|ttf�rD|�dt|��n|�d|�|�t|��d�|�S)Nz, z
lines %d-%d: z	line %d: �)r�appendr�
isinstance�list�tuple�str�join)r�msg�lineZoutmsgrrr�	gen_errorszTextFile.gen_errorcCstd|�||���dS)Nzerror: )�
ValueErrorr(�rr&r'rrr�error�szTextFile.errorcCs tj�d|�||�d�dS)Nz	warning: �
)�sys�stderr�writer(r*rrr�warn�sz
TextFile.warncCs�|jr|jd}|jd=|Sd}|j��}|dkr6d}|jr�|r�|�d�}|dkrTnX|dksl||ddkr�|ddkr|dp~d}|d|�|}|��dkr�q n|�dd�}|j�r|�r|dkr�|�d	�|S|j	r�|�
�}||}t|jt
��r
|jdd|jd<n|j|jdg|_n:|dk�r,dSt|jt
��rL|jdd|_n|jd|_|j�rr|j�rr|��}n"|j�r�|�
�}n|j�r�|��}|dk�s�|dk�r�|j�r�q |j�r�|ddk�r�|dd�}q |d
d�dk�r�|dd
�d}q |S)N���r�#rr�\r,z\#z2continuation line immediately precedes end-of-file���z\
)rr�readliner�find�strip�replacer	r0r
�lstripr!rr"rr�rstripr)rr'Zbuildup_line�posZeolrrrr5�sf




	
�


zTextFile.readlinecCs(g}|��}|dkr|S|�|�qdSr)r5r )r�linesr'rrr�	readliness
zTextFile.readlinescCs|j�|�dSr)rr )rr'rrr�
unreadlineszTextFile.unreadline)NN)N)N)N)
�__name__�
__module__�__qualname__r
rrrr(r+r0r5r=r>rrrrr
s";�	
!	



x
r)r-rrrrrr�<module>sdistutils/__pycache__/fancy_getopt.cpython-38.opt-2.pyc000064400000017037151153537450017073 0ustar00U

e5dxE�@s�ddlZddlZddlZddlZddlTdZe�de�Ze�deef�Ze	�
dd�ZGdd	�d	�Zd
d�Z
dd
�ejD�Zdd�Zdd�ZGdd�d�Zedkr�dZdD]*Zede�ed�eee���e�q�dS)�N)�*z[a-zA-Z](?:[a-zA-Z0-9-]*)z^%s$z^(%s)=!(%s)$�-�_c@s�eZdZddd�Zdd�Zdd�Zddd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zd dd�Z
dd�Zd!dd�Zd"dd�ZdS)#�FancyGetoptNcCsN||_i|_|jr|��i|_i|_g|_g|_i|_i|_i|_	g|_
dS�N)�option_table�option_index�_build_index�alias�negative_alias�
short_opts�	long_opts�
short2long�	attr_name�	takes_arg�option_order��selfr�r�./usr/lib64/python3.8/distutils/fancy_getopt.py�__init__)s	zFancyGetopt.__init__cCs(|j��|jD]}||j|d<qdS)Nr)r�clearr)r�optionrrrr	Qs

zFancyGetopt._build_indexcCs||_|��dSr)rr	rrrr�set_option_tableVszFancyGetopt.set_option_tablecCs<||jkrtd|��n |||f}|j�|�||j|<dS)Nz'option conflict: already an option '%s')r�DistutilsGetoptErrorr�append)r�long_optionZshort_optionZhelp_stringrrrr�
add_optionZs
�
zFancyGetopt.add_optioncCs
||jkSr)r�rrrrr�
has_optioncszFancyGetopt.has_optioncCs
|�t�Sr��	translate�
longopt_xlaterrrr�
get_attr_namehszFancyGetopt.get_attr_namecCsN|��D]@\}}||jkr,td|||f��||jkrtd|||f��qdS)Nz(invalid %s '%s': option '%s' not definedz0invalid %s '%s': aliased option '%s' not defined)�itemsrr)r�aliasesZwhatr
�optrrr�_check_alias_dictns
�
�zFancyGetopt._check_alias_dictcCs|�|d�||_dS)Nr
)r'r
)rr
rrr�set_aliasesxszFancyGetopt.set_aliasescCs|�|d�||_dS)Nznegative alias)r'r)rrrrr�set_negative_aliases}sz FancyGetopt.set_negative_aliasescCs�g|_g|_|j��i|_|jD�]�}t|�dkrD|\}}}d}n(t|�dkr^|\}}}}ntd|f��t|t	�r�t|�dkr�t
d|��|dks�t|t	�r�t|�dks�t
d|��||j|<|j�|�|d	d
kr�|r�|d}|dd	�}d|j|<nF|j
�|�}|dk	�r:|j|�r0t
d||f��||jd	<d|j|<|j�|�}|dk	�r�|j||j|k�r�t
d
||f��t�|��s�t
d|��|�|�|j|<|r"|j�|�||j|d<q"dS)N�r�zinvalid option tuple: %r�z9invalid long option '%s': must be a string of length >= 2�z:invalid short option '%s': must a single character or None����=�:z>invalid negative alias '%s': aliased option '%s' takes a valuezginvalid alias '%s': inconsistent with aliased option '%s' (one of them takes a value, the other doesn'tzEinvalid long option name '%s' (must be letters, numbers, hyphens only)r
rrr�repeatr�len�
ValueError�
isinstance�strrrrr�getr
�
longopt_re�matchr#r)rr�long�short�helpr1Zalias_torrr�_grok_option_table�st

��
��

��


��
��zFancyGetopt._grok_option_tablec
Csn|dkrtjdd�}|dkr*t�}d}nd}|��d�|j�}zt�|||j�\}}Wn,tjk
r�}zt	|��W5d}~XYnX|D]�\}}t
|�dkr�|ddkr�|j|d}n|dd�}|j�
|�}	|	r�|	}|j|�s|j�
|�}	|	�r|	}d}nd}|j|}
|�r:|j�
|
�dk	�r:t||
d�d}t||
|�|j�||f�q�|�rf||fS|SdS)Nr-TF� r,rr)�sys�argv�OptionDummyr<�joinr�getoptr
�errorZDistutilsArgErrorr2rr
r6rrrr1�getattr�setattrrr)r�args�objectZcreated_objectrZopts�msgr&�valr
�attrrrrrB�sB
zFancyGetopt.getoptcCs|jdkrtd��n|jSdS)Nz!'getopt()' hasn't been called yet)r�RuntimeError)rrrr�get_option_orders

zFancyGetopt.get_option_ordercCsjd}|jD]L}|d}|d}t|�}|ddkr:|d}|dk	rJ|d}||kr
|}q
|ddd}d}||}	d|}
|r�|g}nd	g}|jD]�}|dd
�\}}}t||	�}
|ddkr�|dd�}|dk�r|
r�|�d|||
df�n|�d||f�n:d
||f}|
�r4|�d|||
df�n|�d|�|
dd�D]}|�|
|��qNq�|S)Nrr-r.r/�r,�Nr=zOption summary:r*z  --%-*s  %sz
  --%-*s  z%s (-%s)z  --%-*s)rr2�	wrap_textr)r�headerZmax_optrr9r:�lZ	opt_widthZ
line_widthZ
text_widthZ
big_indent�linesr;�textZ	opt_namesrrr�
generate_helpsH



�zFancyGetopt.generate_helpcCs0|dkrtj}|�|�D]}|�|d�qdS)N�
)r>�stdoutrT�write)rrP�file�linerrr�
print_helphszFancyGetopt.print_help)N)NN)NN)N)NN)�__name__�
__module__�__qualname__rr	rrrr#r'r(r)r<rBrLrTrZrrrrrs
(
	
M
=

OrcCst|�}|�|�|�||�Sr)rr)rB)�optionsZnegative_optrGrF�parserrrr�fancy_getoptos
r`cCsi|]}t|�d�qS)r=)�ord)�.0Z_wscharrrr�
<dictcomp>usrccCs|dkrgSt|�|kr|gS|��}|�t�}t�d|�}dd�|D�}g}|�rg}d}|r�t|d�}|||kr�|�|d�|d=||}q\|r�|dddkr�|d=q�q\|�r|dkr�|�|dd|��|d|d�|d<|dddk�r|d=|�d�|��qN|S)Nz( +|-+)cSsg|]}|r|�qSrr)rbZchrrr�
<listcomp>�szwrap_text.<locals>.<listcomp>rr.r=�)r2�
expandtabsr!�WS_TRANS�re�splitrrA)rS�widthZchunksrRZcur_lineZcur_lenrQrrrrOws:

rOcCs
|�t�Srr )r&rrr�translate_longopt�srkc@seZdZgfdd�ZdS)r@cCs|D]}t||d�qdSr)rE)rr^r&rrrr�szOptionDummy.__init__N)r[r\r]rrrrrr@�sr@�__main__z�Tra-la-la, supercalifragilisticexpialidocious.
How *do* you spell that odd word, anyways?
(Someone ask Mary -- she'll know [or she'll
say, "How should I know?"].))�
���(z	width: %drU)r>�stringrhrBZdistutils.errorsZlongopt_pat�compiler7Zneg_alias_rer5�	maketransr"rr`Z
whitespacergrOrkr@r[rS�w�printrArrrr�<module>s(T6distutils/__pycache__/archive_util.cpython-38.opt-1.pyc000064400000014615151153537450017065 0ustar00U

e5d|!�@sDdZddlZddlmZddlZzddlZWnek
rDdZYnXddlmZddl	m
Z
ddlmZddl
mZzddlmZWnek
r�dZYnXzdd	lmZWnek
r�dZYnXd
d�Zdd
�Zd#dd�Zd$dd�Zedgdfedgdfedgdfedgdfedgdfegdfd�Zdd �Zd%d!d"�ZdS)&zodistutils.archive_util

Utility functions for creating archive files (tarballs, zip files,
that sort of thing).�N)�warn)�DistutilsExecError)�spawn)�mkpath)�log)�getpwnam)�getgrnamcCsNtdks|dkrdSzt|�}Wntk
r8d}YnX|dk	rJ|dSdS)z"Returns a gid, given a group name.N�)r�KeyError��name�result�r�./usr/lib64/python3.8/distutils/archive_util.py�_get_gids
rcCsNtdks|dkrdSzt|�}Wntk
r8d}YnX|dk	rJ|dSdS)z"Returns an uid, given a user name.Nr	)rr
rrrr�_get_uid+s
r�gzipcs.dddddd�}dddd	d
�}|dk	r:||��kr:td��|d
}	|dkrZ|	|�|d�7}	ttj�|	�|d�ddl}
t�	d�t
���t�������fdd�}|s�|
�|	d||�}z|j||d�W5|�
�X|dk�r*tdt�|	||}
tjdk�r||	|
g}n
|d|	g}t||d�|
S|	S)a=Create a (possibly compressed) tar file from all the files under
    'base_dir'.

    'compress' must be "gzip" (the default), "bzip2", "xz", "compress", or
    None.  ("compress" will be deprecated in Python 3.2)

    'owner' and 'group' can be used to define an owner and a group for the
    archive that is being built. If not provided, the current owner and group
    will be used.

    The output tar file will be named 'base_dir' +  ".tar", possibly plus
    the appropriate compression extension (".gz", ".bz2", ".xz" or ".Z").

    Returns the output filename.
    Zgz�bz2�xz�)r�bzip2rN�compressz.gzz.bz2z.xzz.Z)rrrrNzKbad value for 'compress': must be None, 'gzip', 'bzip2', 'xz' or 'compress'z.tarr��dry_runrzCreating tar archivecs,�dk	r�|_�|_�dk	r(�|_�|_|S)N)�gidZgname�uid�uname)Ztarinfo�r�group�ownerrrr�_set_uid_gidasz"make_tarball.<locals>._set_uid_gidzw|%s)�filterz'compress' will be deprecated.Zwin32z-f)�keys�
ValueError�getr�os�path�dirname�tarfiler�inforr�open�close�addr�PendingDeprecationWarning�sys�platformr)�	base_name�base_dirr�verboserrrZtar_compressionZcompress_extZarchive_namer(r �tarZcompressed_name�cmdrrr�make_tarball7sB���
	



r5c
Cs�|d}ttj�|�|d�tdkrp|r.d}nd}ztd|||g|d�Wn tk
rjtd|��YnX�n8t�d||�|�s�ztj	|d	tj
d
�}Wn&tk
r�tj	|d	tjd
�}YnX|��|tj
k�rtj�tj�|d��}|�||�t�d|�t�|�D]�\}}	}
|	D]6}tj�tj�||d��}|�||�t�d|��q|
D]B}tj�tj�||��}tj�|��rV|�||�t�d|��qV�qW5QRX|S)
avCreate a zip file from all the files under 'base_dir'.

    The output zip file will be named 'base_name' + ".zip".  Uses either the
    "zipfile" Python module (if available) or the InfoZIP "zip" utility
    (if installed and found on the default search path).  If neither tool is
    available, raises DistutilsExecError.  Returns the name of the output zip
    file.
    z.ziprNz-rz-rq�zipzkunable to create zip file '%s': could neither import the 'zipfile' module nor find a standalone zip utilityz#creating '%s' and adding '%s' to it�w)Zcompressionrzadding '%s')rr%r&r'�zipfilerrrr)ZZipFileZZIP_DEFLATED�RuntimeErrorZ
ZIP_STORED�curdir�normpath�join�write�walk�isfile)r0r1r2rZzip_filenameZ
zipoptionsr6r&�dirpathZdirnames�	filenamesrrrr�make_zipfilesV	�
���
�rB)rrzgzip'ed tar-file)rrzbzip2'ed tar-file)rrzxz'ed tar-file)rrzcompressed tar file)rNzuncompressed tar filezZIP file)ZgztarZbztarZxztarZztarr3r6cCs|D]}|tkr|SqdS)zqReturns the first format from the 'format' list that is unknown.

    If all formats are known, returns None
    N)�ARCHIVE_FORMATS)Zformats�formatrrr�check_archive_formats�s
rEc
Cs�t��}|dk	r6t�d|�tj�|�}|s6t�|�|dkrDtj}d|i}	zt|}
Wn t	k
rxt
d|��YnX|
d}|
dD]\}}
|
|	|<q�|dkr�||	d<||	d	<z|||f|	�}W5|dk	r�t�d
|�t�|�X|S)a�Create an archive file (eg. zip or tar).

    'base_name' is the name of the file to create, minus any format-specific
    extension; 'format' is the archive format: one of "zip", "tar", "gztar",
    "bztar", "xztar", or "ztar".

    'root_dir' is a directory that will be the root directory of the
    archive; ie. we typically chdir into 'root_dir' before creating the
    archive.  'base_dir' is the directory where we start archiving from;
    ie. 'base_dir' will be the common prefix of all files and
    directories in the archive.  'root_dir' and 'base_dir' both default
    to the current directory.  Returns the name of the archive file.

    'owner' and 'group' are used when creating a tar archive. By default,
    uses the current owner and group.
    Nzchanging into '%s'rzunknown archive format '%s'r�r6rrzchanging back to '%s')r%�getcwdr�debugr&�abspath�chdirr:rCr
r#)r0rDZroot_dirr1r2rrrZsave_cwd�kwargsZformat_info�func�arg�val�filenamerrr�make_archive�s2

rP)rrrNN)rr)NNrrNN)�__doc__r%�warningsrr.r8�ImportErrorZdistutils.errorsrZdistutils.spawnrZdistutils.dir_utilrZ	distutilsr�pwdrZgrprrrr5rBrCrErPrrrr�<module>sN


�
H
=




�	
�distutils/__pycache__/config.cpython-38.pyc000064400000006667151153537450014725 0ustar00U

e5d��@s<dZddlZddlmZddlmZdZGdd�de�ZdS)z�distutils.pypirc

Provides the PyPIRCCommand class, the base class for the command classes
that uses .pypirc in the distutils.command package.
�N)�RawConfigParser)�CommandzE[distutils]
index-servers =
    pypi

[pypi]
username:%s
password:%s
c@sheZdZdZdZdZdZdZdddefdgZd	gZ	d
d�Z
dd
�Zdd�Zdd�Z
dd�Zdd�ZdS)�
PyPIRCCommandz;Base command that knows how to handle the .pypirc file
    zhttps://upload.pypi.org/legacy/�pypiNzrepository=�rzurl of repository [default: %s])�
show-responseNz&display full response text from serverrcCstj�tj�d�d�S)zReturns rc file path.�~z.pypirc)�os�path�join�
expanduser��self�r�(/usr/lib64/python3.8/distutils/config.py�_get_rc_file&szPyPIRCCommand._get_rc_filec	CsH|��}t�t�|tjtjBd�d��}|�t||f�W5QRXdS)zCreates a default .pypirc file.i��wN)rr	�fdopen�open�O_CREAT�O_WRONLY�write�DEFAULT_PYPIRC)r�username�password�rc�frrr�
_store_pypirc*s zPyPIRCCommand._store_pypirccCs�|��}tj�|��r�|�d|�|jp.|j}t�}|�|�|�	�}d|k�rF|�
dd�}dd�|�d�D�}|gkr�d|kr�dg}niS|D]�}d|i}|�
|d	�|d	<d
|jfd|jfdfD].\}	}
|�
||	�r�|�
||	�||	<q�|
||	<q�|dk�r ||jdfk�r |j|d
<|S|d|k�s:|d
|kr�|Sq�nRd
|k�r�d
}|�
|d
��rp|�
|d
�}n|j}|�
|d	�|�
|d�|||jd�SiS)zReads the .pypirc file.zUsing PyPI login from %sZ	distutilsz
index-serverscSs g|]}|��dkr|���qS)�)�strip)�.0�serverrrr�
<listcomp>=s�z.PyPIRCCommand._read_pypirc.<locals>.<listcomp>�
rr!r�
repository�realm)rNzserver-loginr)rrr$r!r%)rr	r
�existsZannouncer$�DEFAULT_REPOSITORYr�read�sections�get�split�
DEFAULT_REALMZ
has_option)rrr$Zconfigr)Z
index_serversZ_serversr!Zcurrent�key�defaultrrr�_read_pypirc0sb

���

�

�


�zPyPIRCCommand._read_pypirccCs8ddl}|�dd�}|�|�d�dd�}|���|�S)z%Read and decode a PyPI HTTP response.rNzcontent-typez
text/plain��charset�ascii)�cgiZ	getheaderZparse_headerr*r(�decode)rZresponser3Zcontent_type�encodingrrr�_read_pypi_responsepsz!PyPIRCCommand._read_pypi_responsecCsd|_d|_d|_dS)zInitialize options.Nr)r$r%Z
show_responser
rrr�initialize_optionswsz PyPIRCCommand.initialize_optionscCs(|jdkr|j|_|jdkr$|j|_dS)zFinalizes options.N)r$r'r%r,r
rrr�finalize_options}s

zPyPIRCCommand.finalize_options)�__name__�
__module__�__qualname__�__doc__r'r,r$r%Zuser_optionsZboolean_optionsrrr/r6r7r8rrrrrs&���@r)r<r	ZconfigparserrZ
distutils.cmdrrrrrrr�<module>s

distutils/__pycache__/cmd.cpython-38.pyc000064400000033176151153537450014216 0ustar00U

e5d�F�@sbdZddlZddlZddlZddlmZddlmZmZm	Z	m
Z
mZddlmZGdd�d�Z
dS)ztdistutils.cmd

Provides the Command class, the base class for the command classes
in the distutils.command package.
�N)�DistutilsOptionError)�util�dir_util�	file_util�archive_util�dep_util��logc@s"eZdZdZgZdd�Zdd�Zdd�Zdd	�Zd
d�Z	dCdd�Z
dd�ZdDdd�Zdd�Z
dEdd�ZdFdd�Zdd�ZdGdd�Zdd �Zd!d"�Zd#d$�Zd%d&�ZdHd'd(�ZdId*d+�Zd,d-�Zd.d/�Zd0d1�ZdJd2d3�ZdKd5d6�ZdLd7d8�ZdMd9d:�ZdNd;d<�ZdOd=d>�Z dPd?d@�Z!dQdAdB�Z"dS)R�Commanda}Abstract base class for defining command classes, the "worker bees"
    of the Distutils.  A useful analogy for command classes is to think of
    them as subroutines with local variables called "options".  The options
    are "declared" in 'initialize_options()' and "defined" (given their
    final values, aka "finalized") in 'finalize_options()', both of which
    must be defined by every command class.  The distinction between the
    two is necessary because option values might come from the outside
    world (command line, config file, ...), and any options dependent on
    other options must be computed *after* these outside influences have
    been processed -- hence 'finalize_options()'.  The "body" of the
    subroutine, where it does all its work based on the values of its
    options, is the 'run()' method, which must also be implemented by every
    command class.
    cCsbddlm}t||�std��|jtkr0td��||_|��d|_	|j
|_
d|_d|_d|_
dS)z�Create and initialize a new Command object.  Most importantly,
        invokes the 'initialize_options()' method, which is the real
        initializer and depends on the actual command being
        instantiated.
        r)�Distributionz$dist must be a Distribution instancezCommand is an abstract classN)Zdistutils.distr�
isinstance�	TypeError�	__class__r
�RuntimeError�distribution�initialize_optionsZ_dry_run�verbose�force�help�	finalized)�selfZdistr�r�%/usr/lib64/python3.8/distutils/cmd.py�__init__/s


zCommand.__init__cCs<|dkr0t|d|�}|dkr*t|j|�S|Snt|��dS)N�dry_run�_)�getattrr�AttributeError)r�attrZmyvalrrr�__getattr___szCommand.__getattr__cCs|js|��d|_dS)N�)r�finalize_options�rrrr�ensure_finalizediszCommand.ensure_finalizedcCstd|j��dS)a�Set default values for all the options that this command
        supports.  Note that these defaults may be overridden by other
        commands, by the setup script, by config files, or by the
        command-line.  Thus, this is not the place to code dependencies
        between options; generally, 'initialize_options()' implementations
        are just a bunch of "self.foo = None" assignments.

        This method must be implemented by all command classes.
        �,abstract method -- subclass %s must overrideN�rrr"rrrr{s
�zCommand.initialize_optionscCstd|j��dS)aSet final values for all the options that this command supports.
        This is always called as late as possible, ie.  after any option
        assignments from the command-line or from other commands have been
        done.  Thus, this is the place to code option dependencies: if
        'foo' depends on 'bar', then it is safe to set 'foo' from 'bar' as
        long as 'foo' still has the same value it was assigned in
        'initialize_options()'.

        This method must be implemented by all command classes.
        r$Nr%r"rrrr!�s�zCommand.finalize_optionsN�cCs�ddlm}|dkr d|��}|j||tjd�|d}|jD]R\}}}|�|�}|ddkrn|dd�}t||�}|j|d||ftjd�qBdS)	Nr)�
longopt_xlatezcommand options for '%s':)�levelz  ����=z%s = %s)	Zdistutils.fancy_getoptr'�get_command_name�announcer	�INFOZuser_options�	translater)r�header�indentr'�optionr�valuerrr�dump_options�s

�zCommand.dump_optionscCstd|j��dS)a�A command's raison d'etre: carry out the action it exists to
        perform, controlled by the options initialized in
        'initialize_options()', customized by other commands, the setup
        script, the command-line, and config files, and finalized in
        'finalize_options()'.  All terminal output and filesystem
        interaction should be done by 'run()'.

        This method must be implemented by all command classes.
        r$Nr%r"rrr�run�s
�zCommand.runr cCst�||�dS)zmIf the current verbosity level is of greater than or equal to
        'level' print 'msg' to stdout.
        Nr)r�msgr(rrrr,�szCommand.announcecCs&ddlm}|r"t|�tj��dS)z~Print 'msg' to stdout if the global DEBUG (taken from the
        DISTUTILS_DEBUG environment variable) flag is true.
        r)�DEBUGN)Zdistutils.debugr6�print�sys�stdout�flush)rr5r6rrr�debug_print�szCommand.debug_printcCsBt||�}|dkr"t|||�|St|t�s>td|||f��|S)Nz'%s' must be a %s (got `%s`))r�setattrr�strr)rr1�what�default�valrrr�_ensure_stringlike�s

�zCommand._ensure_stringlikecCs|�|d|�dS)zWEnsure that 'option' is a string; if not defined, set it to
        'default'.
        �stringN)rA)rr1r?rrr�
ensure_string�szCommand.ensure_stringcCspt||�}|dkrdSt|t�r6t||t�d|��n6t|t�rTtdd�|D��}nd}|sltd||f��dS)z�Ensure that 'option' is a list of strings.  If 'option' is
        currently a string, we split it either on /,\s*/ or /\s+/, so
        "foo bar baz", "foo,bar,baz", and "foo,   bar baz" all become
        ["foo", "bar", "baz"].
        Nz,\s*|\s+css|]}t|t�VqdS�N)rr=)�.0�vrrr�	<genexpr>�sz-Command.ensure_string_list.<locals>.<genexpr>Fz''%s' must be a list of strings (got %r))	rrr=r<�re�split�list�allr)rr1r@�okrrr�ensure_string_list�s


��zCommand.ensure_string_listcCs6|�|||�}|dk	r2||�s2td|||f��dS)Nzerror in '%s' option: )rAr)rr1Ztesterr>Z	error_fmtr?r@rrr�_ensure_tested_string�s
�zCommand._ensure_tested_stringcCs|�|tjjdd�dS)z5Ensure that 'option' is the name of an existing file.�filenamez$'%s' does not exist or is not a fileN)rN�os�path�isfile�rr1rrr�ensure_filename�s�zCommand.ensure_filenamecCs|�|tjjdd�dS)Nzdirectory namez)'%s' does not exist or is not a directory)rNrPrQ�isdirrSrrr�ensure_dirnames�zCommand.ensure_dirnamecCst|d�r|jS|jjSdS)N�command_name)�hasattrrWr�__name__r"rrrr+	s
zCommand.get_command_namecGsF|j�|�}|��|D](\}}t||�dkrt||t||��qdS)a>Set the values of any "undefined" options from corresponding
        option values in some other command object.  "Undefined" here means
        "is None", which is the convention used to indicate that an option
        has not been changed between 'initialize_options()' and
        'finalize_options()'.  Usually called from 'finalize_options()' for
        options that depend on some other command rather than another
        option of the same command.  'src_cmd' is the other command from
        which option values will be taken (a command object will be created
        for it if necessary); the remaining arguments are
        '(src_option,dst_option)' tuples which mean "take the value of
        'src_option' in the 'src_cmd' command object, and copy it to
        'dst_option' in the current command object".
        N)r�get_command_objr#rr<)rZsrc_cmdZoption_pairsZsrc_cmd_objZ
src_optionZ
dst_optionrrr�set_undefined_optionss
zCommand.set_undefined_optionscCs|j�||�}|��|S)z�Wrapper around Distribution's 'get_command_obj()' method: find
        (create if necessary and 'create' is true) the command object for
        'command', call its 'ensure_finalized()' method, and return the
        finalized command object.
        )rrZr#)r�commandZcreateZcmd_objrrr�get_finalized_command$szCommand.get_finalized_commandrcCs|j�||�SrD)r�reinitialize_command)rr\Zreinit_subcommandsrrrr^0s�zCommand.reinitialize_commandcCs|j�|�dS)z�Run some other command: uses the 'run_command()' method of
        Distribution, which creates and finalizes the command object if
        necessary and then invokes its 'run()' method.
        N)r�run_command)rr\rrrr_4szCommand.run_commandcCs2g}|jD]"\}}|dks"||�r
|�|�q
|S)akDetermine the sub-commands that are relevant in the current
        distribution (ie., that need to be run).  This is based on the
        'sub_commands' class attribute: each tuple in that list may include
        a method that we call to determine if the subcommand needs to be
        run for the current distribution.  Return a list of command names.
        N)�sub_commands�append)rZcommandsZcmd_name�methodrrr�get_sub_commands;s
zCommand.get_sub_commandscCst�d|��|�dS)Nzwarning: %s: %s
)r	�warnr+)rr5rrrrdKszCommand.warncCstj||||jd�dS�N�r)r�executer)r�func�argsr5r(rrrrgNszCommand.execute�cCstj|||jd�dSre)r�mkpathr)r�name�moderrrrkQszCommand.mkpathc	Cstj|||||j||jd�S)z�Copy a file respecting verbose, dry-run and force flags.  (The
        former two default to whatever is in the Distribution object, and
        the latter defaults to false for commands that don't define it.)rf)r�	copy_filerr)r�infile�outfile�
preserve_mode�preserve_times�linkr(rrrrnTs
�zCommand.copy_filec	Cstj||||||j|jd�S)z\Copy an entire directory tree respecting verbose, dry-run,
        and force flags.
        rf)r�	copy_treerr)rrorprqrrZpreserve_symlinksr(rrrrt]s
�zCommand.copy_treecCstj|||jd�S)z$Move a file respecting dry-run flag.rf)r�	move_filer)r�srcZdstr(rrrrufszCommand.move_filecCs ddlm}||||jd�dS)z2Spawn an external command respecting dry-run flag.r)�spawnrfN)Zdistutils.spawnrwr)r�cmdZsearch_pathr(rwrrrrwjsz
Command.spawnc	Cstj|||||j||d�S)N)r�owner�group)r�make_archiver)rZ	base_name�formatZroot_dirZbase_dirryrzrrrr{os
�zCommand.make_archivecCs�|dkrd|}t|t�r"|f}nt|ttf�s8td��|dkrRd|d�|�f}|jsdt�||�rv|�	||||�n
t
�|�dS)a�Special case of 'execute()' for operations that process one or
        more input files and generate one output file.  Works just like
        'execute()', except the operation is skipped and a different
        message printed if 'outfile' already exists and is newer than all
        files listed in 'infiles'.  If the command defined 'self.force',
        and it is true, then the command is unconditionally run -- does no
        timestamp checks.
        Nzskipping %s (inputs unchanged)z9'infiles' must be a string, or a list or tuple of stringszgenerating %s from %sz, )rr=rJ�tupler
�joinrrZnewer_grouprgr	�debug)rZinfilesrprhriZexec_msgZskip_msgr(rrr�	make_fileus

�zCommand.make_file)Nr&)r )N)N)N)r )r)Nr )rj)r r Nr )r r rr )r )r r )NNNN)NNr )#rY�
__module__�__qualname__�__doc__r`rrr#rr!r3r4r,r;rArCrMrNrTrVr+r[r]r^r_rcrdrgrkrnrtrurwr{r�rrrrr
sZ0






�




�
	�
	

�
�r
)r�r8rPrHZdistutils.errorsrZ	distutilsrrrrrr	r
rrrr�<module>s
distutils/__pycache__/cygwinccompiler.cpython-38.opt-1.pyc000064400000020646151153537450017606 0ustar00U

e5d^@�@s�dZddlZddlZddlZddlmZmZmZddlZddl	m
Z
mZddlm
Z
ddlmZddlmZmZmZmZddlmZdd	lmZdd
lmZdd�ZGd
d�de
�ZGdd�de�ZdZdZdZ dd�Z!e�"d�Z#dd�Z$dd�Z%dd�Z&dS)adistutils.cygwinccompiler

Provides the CygwinCCompiler class, a subclass of UnixCCompiler that
handles the Cygwin port of the GNU C compiler to Windows.  It also contains
the Mingw32CCompiler class which handles the mingw32 port of GCC (same as
cygwin in no-cygwin mode).
�N)�Popen�PIPE�check_output)�gen_preprocess_options�gen_lib_options)�
UnixCCompiler)�
write_file)�DistutilsExecError�CCompilerError�CompileError�UnknownFileError)�log)�LooseVersion)�find_executablecCs�tj�d�}|dkr|tj|d|d�}|dkr8dgS|dkrFdgS|d	krTd
gS|dkrbdgS|d
krpdgStd|��dS)zaInclude the appropriate MSVC runtime library if Python was built
    with MSVC 7.0 or later.
    zMSC v.�����
Z1300Zmsvcr70Z1310Zmsvcr71Z1400Zmsvcr80Z1500Zmsvcr90Z1600Zmsvcr100zUnknown MS Compiler version %s N)�sys�version�find�
ValueError)Zmsc_posZmsc_ver�r�1/usr/lib64/python3.8/distutils/cygwinccompiler.py�	get_msvcr?src
@sReZdZdZdZdZdZdZdZdZ	dZ
dd
d�Zdd
�Zddd�Z
ddd�ZdS)�CygwinCCompilerz? Handles the Cygwin port of the GNU C compiler to Windows.
    �cygwinz.o�.az.dllzlib%s%sz%s%sz.exercCs�t�||||�t�\}}|�d||f�|tk	rB|�d|�t�\|_|_|_	|�|j
d|j|j|j	f�|jdkr�d|_nd|_|jdkr�d}nd	}|jd
ddd
d|j|fd�|jdkr�dg|_
|�d�nt�|_
dS)Nz%Python's GCC status: %s (details: %s)z�Python's pyconfig.h doesn't seem to support your compiler. Reason: %s. Compiling may fail because of undefined preprocessor macros.z: gcc %s, ld %s, dllwrap %s
z2.10.90�gcc�dllwrap�2.13�-shared�
-mdll -staticzgcc -mcygwin -O -Wallzgcc -mcygwin -mdll -O -Wallzg++ -mcygwin -O -Wallzgcc -mcygwinz%s -mcygwin %s�Zcompiler�compiler_soZcompiler_cxxZ
linker_exeZ	linker_so�2.91.57Zmsvcrtz,Consider upgrading to a newer version of gcc)r�__init__�check_config_hZdebug_print�CONFIG_H_OK�warn�get_versions�gcc_version�
ld_versionZdllwrap_version�
compiler_type�
linker_dll�set_executables�
dll_librariesr)�self�verbose�dry_run�forceZstatusZdetails�
shared_optionrrrr%dsN
����
��


��
�zCygwinCCompiler.__init__c
Cs�|dks|dkrVz|�dd|d|g�Wq�tk
rR}zt|��W5d}~XYq�XnNz"|�|j||d|g|�Wn*tk
r�}zt|��W5d}~XYnXdS)z:Compiles the source by spawning GCC and windres if needed.�.rc�.resZwindresz-iz-oN)Zspawnr	rr#)r0�obj�src�extZcc_args�extra_postargsZpp_opts�msgrrr�_compile�s�
zCygwinCCompiler._compileNcCsPt�|
p
g�}
t�|pg�}t�|p&g�}|�|j�|dk	�r||jksV|jdk�rtj�|d�}tj�tj�	|��\}}tj�
||d�}tj�
|d|d�}dtj�	|�dg}|D]}|�|�q�|�t
||fd	|�|jd
k�r|
�d|g�|
�d|g�n
|�|�|	�s(|
�d
�t�||||||||d|	|
|||
�dS)zLink the objects.Nrrz.def�librz
LIBRARY %sZEXPORTSz
writing %srz--output-libz--defz-s)�copy�extendr/Z
EXECUTABLEr-�os�path�dirname�splitext�basename�join�appendZexecuterr�link)r0Ztarget_descZobjectsZoutput_filename�
output_dirZ	librariesZlibrary_dirsZruntime_library_dirsZexport_symbols�debugZ
extra_preargsr:Z
build_tempZtarget_langZtemp_dirZdll_nameZ
dll_extensionZdef_fileZlib_file�contentsZsymrrrrG�sR
��

���

�zCygwinCCompiler.link�cCs�|dkrd}g}|D]�}tj�tj�|��\}}||jddgkrRtd||f��|rbtj�|�}|dkr�|�tj�||||j	��q|�tj�|||j	��q|S)z#Adds supports for rc and res files.NrKr5r6z"unknown file type '%s' (from '%s'))r6r5)
r@rArC�normcaseZsrc_extensionsrrDrFrE�
obj_extension)r0Zsource_filenamesZ	strip_dirrHZ	obj_namesZsrc_name�baser9rrr�object_filenames�s&���z CygwinCCompiler.object_filenames)rrr)
NNNNNrNNNN)rrK)�__name__�
__module__�__qualname__�__doc__r,rMZstatic_lib_extensionZshared_lib_extensionZstatic_lib_formatZshared_lib_formatZ
exe_extensionr%r<rGrOrrrrrYs,
;�
Nrc@seZdZdZdZddd�ZdS)�Mingw32CCompilerz@ Handles the Mingw32 port of the GNU C compiler to Windows.
    Zmingw32rc	Csxt�||||�|jdkr d}nd}|jdkr4d}nd}t�rFtd��|jdd	d
dd|j||fd
�g|_t	�|_dS)Nrr r!r$z--entry _DllMain@12rKz1Cygwin gcc cannot be used with --compiler=mingw32zgcc -O -Wallzgcc -mdll -O -Wallzg++ -O -Wallrz%s %s %sr")
rr%r+r*�is_cygwingccr
r.r-r/r)r0r1r2r3r4Zentry_pointrrrr%s.

����zMingw32CCompiler.__init__N)rrr)rPrQrRrSr,r%rrrrrTsrT�okznot okZ	uncertainc
Cs�ddlm}dtjkrtdfS|��}zLt|�}z4d|��krPtd|fW�WSt	d|fW�WSW5|��XWn8t
k
r�}ztd||jffWY�Sd	}~XYnXd	S)
awCheck if the current Python installation appears amenable to building
    extensions with GCC.

    Returns a tuple (status, details), where 'status' is one of the following
    constants:

    - CONFIG_H_OK: all is well, go ahead and compile
    - CONFIG_H_NOTOK: doesn't look good
    - CONFIG_H_UNCERTAIN: not sure -- unable to read pyconfig.h

    'details' is a human-readable string explaining the situation.

    Note there are two ways to conclude "OK": either 'sys.version' contains
    the string "GCC" (implying that this Python was built with GCC), or the
    installed "pyconfig.h" contains the string "__GNUC__".
    r)�	sysconfigZGCCzsys.version mentions 'GCC'Z__GNUC__z'%s' mentions '__GNUC__'z '%s' does not mention '__GNUC__'zcouldn't read '%s': %sN)
�	distutilsrWrrr'Zget_config_h_filename�open�close�read�CONFIG_H_NOTOK�OSError�CONFIG_H_UNCERTAIN�strerror)rW�fnZconfig_h�excrrrr&Hs
�r&s(\d+\.\d+(\.\d+)*)cCsl|��d}t|�dkrdSt|dtd�j}z|��}W5|��Xt�|�}|dkrZdSt	|�
d����S)z�Find the version of an executable by running `cmd` in the shell.

    If the command is not found, or the output does not match
    `RE_VERSION`, returns None.
    rNT)�shell�stdout�)�splitrrrrcrZr[�
RE_VERSION�searchr�group�decode)�cmd�
executable�out�
out_string�resultrrr�_find_exe_versionus

rocCsdddg}tdd�|D��S)zg Try to find out the versions of gcc, ld and dllwrap.

    If not possible it returns None for it.
    zgcc -dumpversionzld -vzdllwrap --versioncSsg|]}t|��qSr)ro)�.0rjrrr�
<listcomp>�sz get_versions.<locals>.<listcomp>)�tuple)Zcommandsrrrr)�s
r)cCstddg�}|���d�S)z>Try to determine if the gcc that would be used is from cygwin.rz-dumpmachinescygwin)r�strip�endswith)rmrrrrU�srU)'rSr@rr>�
subprocessrrr�reZdistutils.ccompilerrrZdistutils.unixccompilerrZdistutils.file_utilrZdistutils.errorsr	r
rrrXr
Zdistutils.versionrZdistutils.spawnrrrrTr'r\r^r&�compilerfror)rUrrrr�<module>s0/;1+
distutils/__pycache__/filelist.cpython-38.opt-2.pyc000064400000015374151153537450016226 0ustar00U

e5d 2�@s�ddlZddlZddlZddlZddlmZddlmZmZddl	m
Z
Gdd�d�Zdd�Zej
fd	d
�Zdd�Zddd�ZdS)�N��convert_path)�DistutilsTemplateError�DistutilsInternalError)�logc@sxeZdZddd�Zdd�Zejfdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zddd�Zddd�ZdS)�FileListNcCsd|_g|_dS�N)�allfiles�files)�self�warn�debug_print�r�*/usr/lib64/python3.8/distutils/filelist.py�__init__szFileList.__init__cCs
||_dSr)r	)rr	rrr�set_allfiles#szFileList.set_allfilescCst|�|_dSr)�findallr	)r�dirrrrr&szFileList.findallcCsddlm}|rt|�dS)Nr)�DEBUG)Zdistutils.debugr�print)r�msgrrrrr
)szFileList.debug_printcCs|j�|�dSr)r
�append)r�itemrrrr3szFileList.appendcCs|j�|�dSr)r
�extend)r�itemsrrrr6szFileList.extendcCs<tttjj|j��}g|_|D]}|j�tjj|��qdSr)�sorted�map�os�path�splitr
r�join)rZsortable_filesZ
sort_tuplerrr�sort9sz
FileList.sortcCs@tt|j�ddd�D]$}|j||j|dkr|j|=qdS)N�r���)�range�lenr
)r�irrr�remove_duplicatesCszFileList.remove_duplicatescCs�|��}|d}d}}}|dkrTt|�dkr<td|��dd�|dd�D�}n~|dkr�t|�d	krttd
|��t|d�}dd�|dd�D�}n:|dkr�t|�dkr�td
|��t|d�}ntd|��||||fS)Nr)�include�exclude�global-include�global-exclude�z&'%s' expects <pattern1> <pattern2> ...cSsg|]}t|��qSrr��.0�wrrr�
<listcomp>Wsz1FileList._parse_template_line.<locals>.<listcomp>r")�recursive-include�recursive-exclude�z,'%s' expects <dir> <pattern1> <pattern2> ...cSsg|]}t|��qSrrr-rrrr0]s)�graft�prunez#'%s' expects a single <dir_pattern>zunknown action '%s')rr%rr)r�lineZwords�action�patternsr�dir_patternrrr�_parse_template_lineLs0���zFileList._parse_template_linecCs@|�|�\}}}}|dkrV|�dd�|��|D]}|j|dd�s2t�d|�q2�n�|dkr�|�dd�|��|D]}|j|dd�svt�d	|�qv�n�|d
kr�|�dd�|��|D]}|j|dd�s�t�d
|�q��n^|dk�r(|�dd�|��|D]"}|j|dd��st�d|��q�n|dk�rv|�d|d�|�f�|D]$}|j||d��sNt�d||��qNn�|dk�r�|�d|d�|�f�|D]$}|j||d��s�t�d||��q�nx|dk�r�|�d|�|jd|d��s<t�d|�nB|dk�r0|�d|�|jd|d��s<t�d|�ntd|��dS)Nr(zinclude � r")�anchorz%warning: no files found matching '%s'r)zexclude z9warning: no previously-included files found matching '%s'r*zglobal-include rz>warning: no files found matching '%s' anywhere in distributionr+zglobal-exclude zRwarning: no previously-included files matching '%s' found anywhere in distributionr1zrecursive-include %s %s)�prefixz:warning: no files found matching '%s' under directory '%s'r2zrecursive-exclude %s %szNwarning: no previously-included files matching '%s' found under directory '%s'r4zgraft z+warning: no directories found matching '%s'r5zprune z6no previously-included directories found matching '%s'z'this cannot happen: invalid action '%s')r:r
r �include_patternrr�exclude_patternr)rr6r7r8rr9�patternrrr�process_template_linehs��
�
�

�
��

��

�
��zFileList.process_template_liner"rcCsld}t||||�}|�d|j�|jdkr4|��|jD],}|�|�r:|�d|�|j�|�d}q:|S)NFz%include_pattern: applying regex r'%s'z adding T)�translate_patternr
r@r	r�searchr
r)rr@r<r=�is_regex�files_found�
pattern_re�namerrrr>�s�


zFileList.include_patterncCsrd}t||||�}|�d|j�tt|j�ddd�D]4}|�|j|�r8|�d|j|�|j|=d}q8|S)NFz%exclude_pattern: applying regex r'%s'r"r#z
 removing T)rBr
r@r$r%r
rC)rr@r<r=rDrErFr&rrrr?�s�zFileList.exclude_pattern)NN)r"Nr)r"Nr)�__name__�
__module__�__qualname__rrr�curdirrr
rrr!r'r:rAr>r?rrrrrs


	L
,�rcCs&dd�tj|dd�D�}ttjj|�S)Ncss,|]$\}}}|D]}tj�||�VqqdSr)rrr )r.�base�dirsr
�filerrr�	<genexpr>�s�z#_find_all_simple.<locals>.<genexpr>T)�followlinks)r�walk�filterr�isfile)rZresultsrrr�_find_all_simple�s�rTcCs6t|�}|tjkr.tjtjj|d�}t||�}t|�S)N)�start)	rTrrK�	functools�partialr�relpathr�list)rr
Zmake_relrrrrs


rcCs8t�|�}tj}tjdkrd}d|}t�d||�}|S)N�\z\\\\z\1[^%s]z((?<!\\)(\\\\)*)\.)�fnmatch�	translater�sep�re�sub)r@rFr]Zescapedrrr�
glob_to_res

r`r"c
Cs�|rt|t�rt�|�S|Std��d�\}}}|r>t|�}nd}|dk	r�t|�}|t|�t|�t|��}tj}	tjdkr�d}	|t|�t|�t|��}d|||	||f}n|r�d||t|�d�f}t�|�S)N�_�rZz\\z%s\A%s%s.*%s%sz%s\A%s)	�
isinstance�strr^�compiler`�	partitionr%rr])
r@r<r=rDrUra�endrFZ	prefix_rer]rrrrB%s(


rB)r"Nr)rr^r[rVZdistutils.utilrZdistutils.errorsrrZ	distutilsrrrTrKrr`rBrrrr�<module>sidistutils/__pycache__/core.cpython-38.opt-2.pyc000064400000006235151153537450015337 0ustar00U

e5d�"�@s�ddlZddlZddlmZddlTddlmZddlmZddl	m
Z
ddlmZdZ
d	d
�ZdadadZdZd
d�Zddd�ZdS)�N)�DEBUG)�*)�Distribution)�Command)�
PyPIRCCommand)�	Extensionz�usage: %(script)s [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: %(script)s --help [cmd1 cmd2 ...]
   or: %(script)s --help-commands
   or: %(script)s cmd --help
cCstj�|�}tt�S)N)�os�path�basename�USAGE�vars)�script_nameZscript�r�&/usr/lib64/python3.8/distutils/core.py�	gen_usage sr)�	distclassr
�script_argsZoptions�name�versionZauthorZauthor_emailZ
maintainerZmaintainer_emailZurl�licenseZdescriptionZlong_description�keywordsZ	platformsZclassifiersZdownload_urlZrequiresZprovidesZ	obsoletes)rZsourcesZinclude_dirsZ
define_macrosZundef_macrosZlibrary_dirsZ	librariesZruntime_library_dirsZ
extra_objectsZextra_compile_argsZextra_link_argsZ	swig_optsZexport_symbolsZdependsZlanguagec
Ks|�d�}|r|d=nt}d|kr8tj�tjd�|d<d|krRtjdd�|d<z||�a}WnLtk
r�}z.d|kr�t	d|��nt	d|d|f��W5d}~XYnXt
d	kr�|S|��tr�t
d
�|��t
dkr�|Sz|��}Wn:tk
�r*}zt	t|j�d|��W5d}~XYnXt�rBt
d
�|��t
dk�rP|S|�rz|��Wn�tk
�r�t	d��Yn�tk
�r�}z.t�r�tj�d|f��nt	d|f��W5d}~XYnBttfk
�r}zt�r�nt	dt|���W5d}~XYnX|S)Nrr
rr�rzerror in setup command: %szerror in %s setup command: %s�initz%options (after parsing config files):�configz

error: %sz%options (after parsing command line):�commandlineZinterruptedz
error: %s
z	error: %szerror: )�getrrr	r
�sys�argv�_setup_distributionZDistutilsSetupError�
SystemExit�_setup_stop_afterZparse_config_filesr�printZdump_option_dictsZparse_command_lineZDistutilsArgErrorrr
Zrun_commands�KeyboardInterrupt�OSError�stderr�writeZDistutilsErrorZCCompilerError�str)�attrs�klassZdist�msg�ok�excrrr�setup9sd%

�(
�"r,�runc	Cs�|dkrtd|f��|atj��}d|i}zZzH|tjd<|dk	rP|tjdd�<t|d��}t|��|�W5QRXW5|t_daXWntk
r�YnXt	dkr�t
d|��t	S)N)rrrr-z"invalid value for 'stop_after': %r�__file__rr�rbzZ'distutils.core.setup()' was never called -- perhaps '%s' is not a Distutils setup script?)�
ValueErrorr rr�copy�open�exec�readrr�RuntimeError)r
rZ
stop_afterZ	save_argv�g�frrr�	run_setup�s*


�r8)Nr-)rrZdistutils.debugrZdistutils.errorsZdistutils.distrZ
distutils.cmdrZdistutils.configrZdistutils.extensionrrrr rZsetup_keywordsZextension_keywordsr,r8rrrr�<module>	s	qdistutils/__pycache__/dist.cpython-38.pyc000064400000103276151153537450014415 0ustar00U

e5d���@s�dZddlZddlZddlZddlmZzddlZWnek
rLdZYnXddlTddl	m
Z
mZddlm
Z
mZmZddlmZddlmZe�d	�Zd
d�ZGdd
�d
�ZGdd�d�Zdd�ZdS)z}distutils.dist

Provides the Distribution class, which represents the module distribution
being built/installed/distributed.
�N)�message_from_file)�*)�FancyGetopt�translate_longopt)�
check_environ�	strtobool�
rfc822_escape��log)�DEBUGz^[a-zA-Z]([a-zA-Z0-9_]*)$cCsLt|t�rn<t|t�sHt|�j}d|�d|�d�}t�tj|�t|�}|S)Nz
Warning: 'z' should be a list, got type '�')�
isinstance�str�list�type�__name__r
ZWARN)�valueZ	fieldname�typename�msg�r�&/usr/lib64/python3.8/distutils/dist.py�_ensure_lists


rc@speZdZdZdddddgZdZdd	d
ddd
dddddddddddddddgZdd�eD�Zdd iZdad"d#�Z	d$d%�Z
dbd'd(�Zd)d*�Zdcd+d,�Z
d-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d5gfd6d7�Zd8d9�Zd:d;�Zd<d=�Zd>d?�Zd@dA�ZdBdC�ZdddDdE�ZdedFdG�ZdfdIdJ�ZejfdKdL�ZdMdN�ZdOdP�Z dQdR�Z!dSdT�Z"dUdV�Z#dWdX�Z$dYdZ�Z%d[d\�Z&d]d^�Z'd_d`�Z(d!S)g�Distributiona�The core of the Distutils.  Most of the work hiding behind 'setup'
    is really done within a Distribution instance, which farms the work out
    to the Distutils commands specified on the command line.

    Setup scripts will almost never instantiate Distribution directly,
    unless the 'setup()' function is totally inadequate to their needs.
    However, it is conceivable that a setup script might wish to subclass
    Distribution for some specialized purpose, and then pass the subclass
    to 'setup()' as the 'distclass' keyword argument.  If so, it is
    necessary to respect the expectations that 'setup' has of Distribution.
    See the code for 'setup()', in core.py, for details.
    )�verbose�vzrun verbosely (default)�)�quiet�qz!run quietly (turns verbosity off))zdry-run�nzdon't actually do anything)�help�hzshow detailed help message)zno-user-cfgNz-ignore pydistutils.cfg in your home directoryz�Common commands: (see '--help-commands' for more)

  setup.py build      will build the package underneath 'build/'
  setup.py install    will install the package
)z
help-commandsNzlist all available commands)�nameNzprint package name)�version�Vzprint package version)�fullnameNzprint <package name>-<version>)�authorNzprint the author's name)�author-emailNz print the author's email address)�
maintainerNzprint the maintainer's name)zmaintainer-emailNz$print the maintainer's email address)�contactNz7print the maintainer's name if known, else the author's)z
contact-emailNz@print the maintainer's email address if known, else the author's)�urlNzprint the URL for this package)�licenseNz print the license of the package)�licenceNzalias for --license)�descriptionNzprint the package description)zlong-descriptionNz"print the long package description)�	platformsNzprint the list of platforms)�classifiersNzprint the list of classifiers)�keywordsNzprint the list of keywords)�providesNz+print the list of packages/modules provided)�requiresNz+print the list of packages/modules required)�	obsoletesNz0print the list of packages/modules made obsoletecCsg|]}t|d��qS)r�r)�.0�xrrr�
<listcomp>�szDistribution.<listcomp>rrNcCs\d|_d|_d|_|jD]}t||d�qt�|_|jjD] }d|}t||t|j|��q:i|_	d|_
d|_d|_i|_
g|_d|_i|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_i|_i|_|�r|�d�}|dk	�r8|d=|��D]4\}}|� |�}|��D]\}	}
d|
f||	<�q�qd|k�r~|d|d	<|d=d
}t!dk	�rnt!�"|�nt#j$�%|d�|��D]�\}}
t&|jd|��r�t|jd|�|
�nNt&|j|��r�t|j||
�n0t&||��r�t|||
�nd
t'|�}t!�"|��q�d|_(|jdk	�rP|jD].}
|
�)d��s6�qP|
dk�r d|_(�qP�q |�*�dS)a0Construct a new Distribution instance: initialize all the
        attributes of a Distribution, and then use 'attrs' (a dictionary
        mapping attribute names to values) to assign some of those
        attributes their "real" values.  (Any attributes not mentioned in
        'attrs' will be assigned to some null value: 0, None, an empty list
        or dictionary, etc.)  Most importantly, initialize the
        'command_obj' attribute to the empty dictionary; this will be
        filled in with real command objects by 'parse_command_line()'.
        rr�get_N��optionszsetup scriptr+r*z:'licence' distribution option is deprecated; use 'license'�
Zset_zUnknown distribution option: %sT�-z
--no-user-cfgF)+r�dry_runr�display_option_names�setattr�DistributionMetadata�metadata�_METHOD_BASENAMES�getattr�cmdclass�command_packages�script_name�script_args�command_optionsZ
dist_files�packagesZpackage_dataZpackage_dir�
py_modules�	libraries�headers�ext_modulesZext_packageZinclude_dirsZ
extra_path�scripts�
data_filesZpassword�command_obj�have_run�get�items�get_option_dict�warnings�warn�sys�stderr�write�hasattr�repr�
want_user_cfg�
startswith�finalize_options)�self�attrs�attr�basenameZmethod_namer9�commandZcmd_options�opt_dict�opt�valr�key�argrrr�__init__�s~








zDistribution.__init__cCs&|j�|�}|dkr"i}|j|<|S)z�Get the option dictionary for a given command.  If that
        command's option dictionary hasn't been created yet, then create it
        and return the new dictionary; otherwise, return the existing
        option dictionary.
        N)rGrQ)r^rb�dictrrrrS&szDistribution.get_option_dictr8c	Cs�ddlm}|dkr"t|j���}|dk	r@|�||�|d}|sV|�|d�dS|D]h}|j�|�}|dkr�|�|d|�qZ|�|d|�||�}|�d�D]}|�|d|�q�qZdS)Nr)�pformatz  zno commands known yetzno option dict for '%s' commandzoption dict for '%s' command:r:)Zpprintrj�sortedrG�keys�announcerQ�split)	r^�header�commands�indentrjZcmd_namerc�out�linerrr�dump_option_dicts1s*��zDistribution.dump_option_dictscCs�g}t�tj�tjdj�}tj�|d�}tj�|�rB|�	|�tj
dkrRd}nd}|jr�tj�tj�d�|�}tj�|�r�|�	|�d}tj�|�r�|�	|�t
r�|�dd	�|��|S)
a�Find as many configuration files as should be processed for this
        platform, and return a list of filenames in the order in which they
        should be parsed.  The filenames returned are guaranteed to exist
        (modulo nasty race conditions).

        There are three possible config files: distutils.cfg in the
        Distutils installation directory (ie. where the top-level
        Distutils __inst__.py file lives), a file in the user's home
        directory named .pydistutils.cfg on Unix and pydistutils.cfg
        on Windows/Mac; and setup.cfg in the current directory.

        The file in the user's home directory can be disabled with the
        --no-user-cfg option.
        �	distutilsz
distutils.cfg�posixz.pydistutils.cfgzpydistutils.cfg�~z	setup.cfgzusing config files: %sz, )r�os�path�dirnamerV�modules�__file__�join�isfile�appendr!r[�
expanduserrrm)r^�filesZsys_dirZsys_fileZ
user_filenameZ	user_fileZ
local_filerrr�find_config_filesMs&



zDistribution.find_config_filesc
Cs�ddlm}tjtjkr8ddddddd	d
ddd
ddg
}ng}t|�}|dkrT|��}trb|�d�|�}|D]�}tr�|�d|�|�	|�|�
�D]V}|�|�}|�|�}|D]8}	|	dkr�|	|kr�|�
||	�}
|	�dd�}	||
f||	<q�q�|��qld|jk�r�|jd��D]�\}	\}}
|j�
|	�}zF|�rDt||t|
��n(|	dk�r`t||	t|
��nt||	|
�Wn,tk
�r�}
zt|
��W5d}
~
XYnX�qdS)Nr)�ConfigParserzinstall-basezinstall-platbasezinstall-libzinstall-platlibzinstall-purelibzinstall-headerszinstall-scriptszinstall-data�prefixzexec-prefix�home�user�rootz"Distribution.parse_config_files():z  reading %srr;�_�global)rr<)Zconfigparserr�rVr��base_prefix�	frozensetr�rrm�readZsectionsr9rSrQ�replacerhrGrR�negative_optr>r�
ValueError�DistutilsOptionError)r^�	filenamesr�Zignore_options�parser�filenameZsectionr9rcrdre�src�aliasrrrr�parse_config_files}s^�





zDistribution.parse_config_filescCs�|��}g|_t||j�}|�|j�|�ddi�|j|j|d�}|�	�}t
�|j�|�
|�rhdS|r�|�||�}|dkrhdSqh|jr�|j|t|j�dk|jd�dS|js�td��dS)	a�Parse the setup script's command line, taken from the
        'script_args' instance attribute (which defaults to 'sys.argv[1:]'
        -- see 'setup()' in core.py).  This list is first processed for
        "global options" -- options that set attributes of the Distribution
        instance.  Then, it is alternately scanned for Distutils commands
        and options for that command.  Each new command terminates the
        options for the previous command.  The allowed options for a
        command are determined by the 'user_options' attribute of the
        command class -- thus, we have to be able to load command classes
        in order to parse the command line.  Any error in that 'options'
        attribute raises DistutilsGetoptError; any error on the
        command-line raises DistutilsArgError.  If no Distutils commands
        were found on the command line, raises DistutilsArgError.  Return
        true if command-line was successfully parsed and we should carry
        on with executing commands; false if no errors but we shouldn't
        execute commands (currently, this only happens if user asks for
        help).
        r+r*)�args�objectNr��display_optionsrpzno commands suppliedT)�_get_toplevel_optionsrprr��set_negative_aliasesr�Zset_aliases�getoptrFZget_option_orderr
Z
set_verbosityr�handle_display_options�_parse_command_optsr�
_show_help�len�DistutilsArgError)r^Ztoplevel_optionsr�r��option_orderrrr�parse_command_line�s.	
�zDistribution.parse_command_linecCs|jdgS)z�Return the non-display options recognized at the top level.

        This includes options that are recognized *only* at the top
        level as well as options recognized for commands.
        )zcommand-packages=Nz0list of packages that provide distutils commands)�global_options�r^rrrr��s�z"Distribution._get_toplevel_optionsc
Cs�ddlm}|d}t�|�s*td|��|j�|�z|�|�}Wn*tk
rn}zt	|��W5d}~XYnXt
||�s�td|��t|d�r�t
|jt�s�d}t||��|j}t|d�r�|��}|�|j�t|d	�r�t
|jt�r�t|j�}ng}|�|j|j|�|�|�|�|d
d��\}}	t|	d��rV|	j�rV|j|d|gd�dSt|d	��r�t
|jt��r�d}
|jD]F\}}}
}t|	|�|���rzd
}
t|��r�|�ntd
||f���qz|
�r�dS|�|�}t|	���D]\}}d|f||<�q�|S)a�Parse the command-line options for a single command.
        'parser' must be a FancyGetopt instance; 'args' must be the list
        of arguments, starting with the current command (whose options
        we are about to parse).  Returns a new version of 'args' with
        the next command at the front of the list; will be the empty
        list if there are no more commands on the command line.  Returns
        None if the user asked for help on this command.
        r��Commandzinvalid command name '%s'Nz&command class %s must subclass Command�user_optionszIcommand class %s must provide 'user_options' attribute (a list of tuples)r��help_optionsrrr�zYinvalid help function %r for help option '%s': must be a callable object (function, etc.)zcommand line) �
distutils.cmdr��
command_re�match�
SystemExitrpr�get_command_class�DistutilsModuleErrorr��
issubclassZDistutilsClassErrorrYr
r�rr��copy�updater��fix_help_options�set_option_tabler�r�r�rr�Z
get_attr_name�callablerS�varsrR)r^r�r�r�rbZ	cmd_classrr�r�ZoptsZhelp_option_foundZhelp_optionZshortZdesc�funcrcr!rrrrr�sr


�

�


���

�
��
z Distribution._parse_command_optscCsPdD]F}t|j|�}|dkrqt|t�rdd�|�d�D�}t|j||�qdS)z�Set final values for all the options on the Distribution
        instance, analogous to the .finalize_options() method of Command
        objects.
        �r/r-NcSsg|]}|���qSr��strip)r4Zelmrrrr6jsz1Distribution.finalize_options.<locals>.<listcomp>�,)rBr@r
rrnr>)r^r`rrrrr]`s
zDistribution.finalize_optionsrc
Csddlm}ddlm}|rR|r*|��}n|j}|�|�|�|jd�t	d�|rt|�|j
�|�d�t	d�|jD]z}t|t
�r�t||�r�|}	n
|�|�}	t|	d�r�t|	jt�r�|�|	jt|	j��n|�|	j�|�d|	j�t	d�qzt	||j��d	S)
abShow help for the setup script command-line in the form of
        several lists of command-line options.  'parser' should be a
        FancyGetopt instance; do not expect it to be returned in the
        same state, as its option table will be reset to make it
        generate the correct help text.

        If 'global_options' is true, lists the global options:
        --verbose, --dry-run, etc.  If 'display_options' is true, lists
        the "display-only" options: --name, --version, etc.  Finally,
        lists per-command help for every command name or command class
        in 'commands'.
        r��	gen_usager�z
Global options:r8zKInformation display options (just display information, ignore any commands)r�zOptions for '%s' command:N)�distutils.corer�r�r�r�r�r�Z
print_help�common_usage�printr�rpr
rr�r�rYr�rr�r�rrE)
r^r�r�r�rpr�r�r9rb�klassrrrr�ms:

�



��
zDistribution._show_helpc	Cs�ddlm}|jr4|��td�t||j��dSd}i}|jD]}d||d<qB|D]l\}}|rX|�|�rXt|�}t	|j
d|��}|dkr�td�|��n |dkr�td	�|��nt|�d}qX|S)
z�If there were any non-global "display-only" options
        (--help-commands or the metadata display options) on the command
        line, display the requested info and return true; else return
        false.
        rr�r8rr7r�r�)r.r0r1r2r:)r�r�Z
help_commands�print_commandsr�rEr�rQrrBr@r})	r^r�r�Zany_display_optionsZis_display_option�optionrdrerrrrr��s*
z#Distribution.handle_display_optionsc	Csjt|d�|D]T}|j�|�}|s.|�|�}z
|j}Wntk
rPd}YnXtd|||f�qdS)zZPrint a subset of the list of all commands -- used by
        'print_commands()'.
        �:�(no description available)z
  %-*s  %sN)r�rCrQr�r,�AttributeError)r^rpro�
max_length�cmdr�r,rrr�print_command_list�s


zDistribution.print_command_listcCs�ddl}|jj}i}|D]}d||<qg}|j��D]}|�|�s4|�|�q4d}||D]}t|�|krZt|�}qZ|�|d|�|r�t	�|�|d|�dS)anPrint out a help message listing all available commands with a
        description of each.  The list is divided into "standard commands"
        (listed in distutils.command.__all__) and "extra commands"
        (mentioned in self.cmdclass, but not a standard command).  The
        descriptions come from the command class attribute
        'description'.
        rNrzStandard commandszExtra commands)
�distutils.commandrb�__all__rCrlrQrr�r�r�)r^ru�std_commands�is_stdr��extra_commandsr�rrrr��s.


��zDistribution.print_commandsc		Cs�ddl}|jj}i}|D]}d||<qg}|j��D]}|�|�s4|�|�q4g}||D]P}|j�|�}|sx|�|�}z
|j}Wnt	k
r�d}YnX|�||f�qZ|S)a>Get a list of (command, description) tuples.
        The list is divided into "standard commands" (listed in
        distutils.command.__all__) and "extra commands" (mentioned in
        self.cmdclass, but not a standard command).  The descriptions come
        from the command class attribute 'description'.
        rNrr�)
r�rbr�rCrlrQrr�r,r�)	r^rur�r�r�r��rvr�r,rrr�get_command_list�s(	




zDistribution.get_command_listcCsN|j}t|t�sJ|dkrd}dd�|�d�D�}d|krD|�dd�||_|S)z9Return a list of packages from which commands are loaded.Nr8cSsg|]}|dkr|���qS)r8r�)r4Zpkgrrrr6!sz5Distribution.get_command_packages.<locals>.<listcomp>r�zdistutils.commandr)rDr
rrn�insert)r^Zpkgsrrr�get_command_packagess
z!Distribution.get_command_packagesc	Cs�|j�|�}|r|S|��D]�}d||f}|}zt|�tj|}Wntk
r^YqYnXzt||�}Wn&tk
r�t	d|||f��YnX||j|<|St	d|��dS)aoReturn the class that implements the Distutils command named by
        'command'.  First we check the 'cmdclass' dictionary; if the
        command is mentioned there, we fetch the class object from the
        dictionary and return it.  Otherwise we load the command module
        ("distutils.command." + command) and fetch the command class from
        the module.  The loaded class is also stored in 'cmdclass'
        to speed future calls to 'get_command_class()'.

        Raises DistutilsModuleError if the expected module could not be
        found, or if that module does not define the expected class.
        z%s.%sz3invalid command '%s' (no class '%s' in module '%s')zinvalid command '%s'N)
rCrQr��
__import__rVr{�ImportErrorrBr�r�)r^rbr�ZpkgnameZmodule_nameZ
klass_name�modulerrrr�'s,
��

zDistribution.get_command_classcCsl|j�|�}|sh|rhtr&|�d|�|�|�}||�}|j|<d|j|<|j�|�}|rh|�||�|S)aReturn the command object for 'command'.  Normally this object
        is cached on a previous call to 'get_command_obj()'; if no command
        object for 'command' is in the cache, then we either create and
        return it (if 'create' is true) or return None.
        z<Distribution.get_command_obj(): creating '%s' command objectr)rOrQrrmr�rPrG�_set_command_options)r^rbZcreate�cmd_objr�r9rrr�get_command_objMs�

zDistribution.get_command_objcCs\|��}|dkr|�|�}tr,|�d|�|��D�] \}\}}trZ|�d|||f�zdd�|jD�}Wntk
r�g}YnXz
|j}Wntk
r�i}YnXz|t|t	�}	||kr�|	r�t
|||t|��nJ||kr�|	r�t
||t|��n,t||��rt
|||�nt
d|||f��Wq4tk
�rT}
zt
|
��W5d}
~
XYq4Xq4dS)aySet the options for 'command_obj' from 'option_dict'.  Basically
        this means copying elements of a dictionary ('option_dict') to
        attributes of an instance ('command').

        'command_obj' must be a Command instance.  If 'option_dict' is not
        supplied, uses the standard option dictionary for this command
        (from 'self.command_options').
        Nz#  setting options for '%s' command:z    %s = %s (from %s)cSsg|]}t|��qSrr3)r4�orrrr6|s�z5Distribution._set_command_options.<locals>.<listcomp>z1error in %s: command '%s' has no such option '%s')�get_command_namerSrrmrRZboolean_optionsr�r�r
rr>rrYr�r�)r^rOZoption_dict�command_namer��sourcerZ	bool_optsZneg_optZ	is_stringrrrrr�hsF	

��




��z!Distribution._set_command_optionsrcCs|ddlm}t||�s&|}|�|�}n|��}|js8|S|��d|_d|j|<|�|�|rx|�	�D]}|�
||�qf|S)a�Reinitializes a command to the state it was in when first
        returned by 'get_command_obj()': ie., initialized but not yet
        finalized.  This provides the opportunity to sneak option
        values in programmatically, overriding or supplementing
        user-supplied values from the config files and command line.
        You'll have to re-finalize the command object (by calling
        'finalize_options()' or 'ensure_finalized()') before using it for
        real.

        'command' should be a command name (string) or command object.  If
        'reinit_subcommands' is true, also reinitializes the command's
        sub-commands, as declared by the 'sub_commands' class attribute (if
        it has one).  See the "install" command for an example.  Only
        reinitializes the sub-commands that actually matter, ie. those
        whose test predicates return true.

        Returns the reinitialized command object.
        rr�)r�r�r
r�r�Z	finalizedZinitialize_optionsrPr�Zget_sub_commands�reinitialize_command)r^rbZreinit_subcommandsr�r��subrrrr��s


z!Distribution.reinitialize_commandcCst�||�dS�Nr	)r^r�levelrrrrm�szDistribution.announcecCs|jD]}|�|�qdS)z�Run each command that was seen on the setup script command line.
        Uses the list of commands found and cache of command objects
        created by 'get_command_obj()'.
        N)rp�run_command)r^r�rrr�run_commands�s
zDistribution.run_commandscCsD|j�|�rdSt�d|�|�|�}|��|��d|j|<dS)a�Do whatever it takes to run a command (including nothing at all,
        if the command has already been run).  Specifically: if we have
        already created and run the command named by 'command', return
        silently without doing anything.  If the command named by 'command'
        doesn't even have a command object yet, create one.  Then invoke
        'run()' on that command object (or an existing one).
        Nz
running %sr)rPrQr
�infor�Zensure_finalized�run)r^rbr�rrrr��s	
zDistribution.run_commandcCst|jp|jpg�dkS�Nr)r�rHrIr�rrr�has_pure_modules�szDistribution.has_pure_modulescCs|jot|j�dkSr�)rLr�r�rrr�has_ext_modules�szDistribution.has_ext_modulescCs|jot|j�dkSr�)rJr�r�rrr�has_c_libraries�szDistribution.has_c_librariescCs|��p|��Sr�)r�r�r�rrr�has_modules�szDistribution.has_modulescCs|jot|j�dkSr�)rKr�r�rrr�has_headers�szDistribution.has_headerscCs|jot|j�dkSr�)rMr�r�rrr�has_scripts�szDistribution.has_scriptscCs|jot|j�dkSr�)rNr�r�rrr�has_data_files�szDistribution.has_data_filescCs|��o|��o|��Sr�)r�r�r�r�rrr�is_pure�s
��zDistribution.is_pure)N)NNr8)N)r)N)r))r�
__module__�__qualname__�__doc__r�r�r�r=r�rhrSrtr�r�r�r�r�r]r�r�r�r�r�r�r�r�r�r�r
�INFOrmr�r�r�r�r�r�r�r�r�r�rrrrr,s��	�,

0
:C[
�
2(!"&

,
)
rc@seZdZdZdZdBdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�ZeZd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Z d:d;�Z!d<d=�Z"d>d?�Z#d@dA�Z$dS)Cr?z]Dummy class to hold the distribution meta-data: name, version,
    author, and so forth.
    )r!r"r%�author_emailr'�maintainer_emailr)r*r,�long_descriptionr/r-r$r(Z
contact_emailr.�download_urlr0r1r2NcCs�|dk	r|�t|��nfd|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_dSr�)�
read_pkg_file�openr!r"r%r�r'r�r)r*r,r�r/r-r.r�r0r1r2)r^ryrrrrh
s&zDistributionMetadata.__init__cst|���fdd�}�fdd�}�d}|d�|_|d�|_|d�|_|d	�|_d
|_|d�|_d
|_|d�|_|d
�|_	d�kr�|d�|_
nd
|_
|d�|_|d�|_d�kr�|d��d�|_
|d�|_|d�|_|dkr�|d�|_|d�|_|d�|_nd
|_d
|_d
|_d
S)z-Reads the metadata values from a file object.cs�|}|dkrdS|S�NZUNKNOWNr)r!r�rrr�_read_field(sz7DistributionMetadata.read_pkg_file.<locals>._read_fieldcs��|d�}|gkrdS|Sr�)Zget_all)r!�valuesr�rr�
_read_list.sz6DistributionMetadata.read_pkg_file.<locals>._read_listzmetadata-versionr!r"Zsummaryr%Nr&z	home-pager*zdownload-urlr,r/r��platformZ
classifier�1.1r1r0r2)rr!r"r,r%r'r�r�r)r*r�r�rnr/r-r.r1r0r2)r^�filer�r�Zmetadata_versionrr�rr�$s:












z"DistributionMetadata.read_pkg_filec	Cs2ttj�|d�ddd��}|�|�W5QRXdS)z7Write the PKG-INFO file into the release tree.
        zPKG-INFO�wzUTF-8)�encodingN)r�rxryr}�write_pkg_file)r^Zbase_dirZpkg_inforrr�write_pkg_infoXs
�z#DistributionMetadata.write_pkg_infocCsbd}|js"|js"|js"|js"|jr&d}|�d|�|�d|���|�d|���|�d|���|�d|�	��|�d|�
��|�d	|���|�d
|���|jr�|�d|j�t
|���}|�d|�d
�|���}|�r|�d|�|�|d|���|�|d|���|�|d|���|�|d|���|�|d|���dS)z9Write the PKG-INFO format data to a file object.
        z1.0r�zMetadata-Version: %s
z	Name: %s
zVersion: %s
zSummary: %s
zHome-page: %s
zAuthor: %s
zAuthor-email: %s
zLicense: %s
zDownload-URL: %s
zDescription: %s
r�z
Keywords: %s
ZPlatformZ
ClassifierZRequiresZProvidesZ	ObsoletesN)r0r1r2r.r�rX�get_name�get_version�get_description�get_url�get_contact�get_contact_email�get_licenser�get_long_descriptionr}�get_keywords�_write_list�
get_platforms�get_classifiers�get_requires�get_provides�
get_obsoletes)r^rr"Z	long_descr/rrrr_s6��z#DistributionMetadata.write_pkg_filecCs |D]}|�d||f�qdS)Nz%s: %s
)rX)r^rr!r�rrrrr�sz DistributionMetadata._write_listcCs
|jpdSr�)r!r�rrrr�szDistributionMetadata.get_namecCs
|jpdS)Nz0.0.0)r"r�rrrr�sz DistributionMetadata.get_versioncCsd|��|��fS)Nz%s-%s)rrr�rrr�get_fullname�sz!DistributionMetadata.get_fullnamecCs
|jpdSr�)r%r�rrr�
get_author�szDistributionMetadata.get_authorcCs
|jpdSr�)r�r�rrr�get_author_email�sz%DistributionMetadata.get_author_emailcCs
|jpdSr�)r'r�rrr�get_maintainer�sz#DistributionMetadata.get_maintainercCs
|jpdSr�)r�r�rrr�get_maintainer_email�sz)DistributionMetadata.get_maintainer_emailcCs|jp|jpdSr�)r'r%r�rrrr	�sz DistributionMetadata.get_contactcCs|jp|jpdSr�)r�r�r�rrrr
�sz&DistributionMetadata.get_contact_emailcCs
|jpdSr�)r)r�rrrr�szDistributionMetadata.get_urlcCs
|jpdSr�)r*r�rrrr�sz DistributionMetadata.get_licensecCs
|jpdSr�)r,r�rrrr�sz$DistributionMetadata.get_descriptioncCs
|jpdSr�)r�r�rrrr�sz)DistributionMetadata.get_long_descriptioncCs
|jpgSr�)r/r�rrrr
�sz!DistributionMetadata.get_keywordscCst|d�|_dS)Nr/)rr/�r^rrrr�set_keywords�sz!DistributionMetadata.set_keywordscCs|jp
dgSr�)r-r�rrrr�sz"DistributionMetadata.get_platformscCst|d�|_dS)Nr-)rr-rrrr�
set_platforms�sz"DistributionMetadata.set_platformscCs
|jpgSr�)r.r�rrrr�sz$DistributionMetadata.get_classifierscCst|d�|_dS)Nr.)rr.rrrr�set_classifiers�sz$DistributionMetadata.set_classifierscCs
|jpdSr�)r�r�rrr�get_download_url�sz%DistributionMetadata.get_download_urlcCs
|jpgSr�)r1r�rrrr�sz!DistributionMetadata.get_requirescCs,ddl}|D]}|j�|�qt|�|_dSr�)�distutils.versionpredicate�versionpredicate�VersionPredicaterr1�r^rrurrrr�set_requires�sz!DistributionMetadata.set_requirescCs
|jpgSr�)r0r�rrrr�sz!DistributionMetadata.get_providescCs6dd�|D�}|D]}ddl}|j�|�q||_dS)NcSsg|]}|���qSrr�)r4rrrrr6�sz5DistributionMetadata.set_provides.<locals>.<listcomp>r)rrZsplit_provisionr0)r^rrrurrr�set_provides�s
z!DistributionMetadata.set_providescCs
|jpgSr�)r2r�rrrr�sz"DistributionMetadata.get_obsoletescCs,ddl}|D]}|j�|�qt|�|_dSr�)rrr rr2r!rrr�
set_obsoletes�sz"DistributionMetadata.set_obsoletes)N)%rr�r�r�rArhr�rrrrrrrrrrr	r
rrZget_licencerrr
rrrrrrrr"rr#rr$rrrrr?�sD	
4"r?cCs$g}|D]}|�|dd��q|S)zConvert a 4-tuple 'help_options' list as found in various command
    classes to the 3-tuple form required by FancyGetopt.
    r�)r)r9Znew_optionsZ
help_tuplerrrr��sr�)r�rVrx�reZemailrrTr�Zdistutils.errorsZdistutils.fancy_getoptrrZdistutils.utilrrrrur
Zdistutils.debugr�compiler�rrr?r�rrrr�<module>s4

Zcdistutils/__pycache__/dep_util.cpython-38.opt-1.pyc000064400000005234151153537450016211 0ustar00U

e5d�
�@s6dZddlZddlmZdd�Zdd�Zdd	d
�ZdS)z�distutils.dep_util

Utility functions for simple, timestamp-based dependency of files
and groups of files; also, function based entirely on such
timestamp dependency analysis.�N)�DistutilsFileErrorcCs`tj�|�s tdtj�|���tj�|�s0dSddlm}t�|�|}t�|�|}||kS)aReturn true if 'source' exists and is more recently modified than
    'target', or if 'source' exists and 'target' doesn't.  Return false if
    both exist and 'target' is the same age or younger than 'source'.
    Raise DistutilsFileError if 'source' does not exist.
    zfile '%s' does not exist�r��ST_MTIME)�os�path�existsr�abspath�statr)�source�targetrZmtime1Zmtime2�r
�*/usr/lib64/python3.8/distutils/dep_util.py�newers
�rcCsht|�t|�krtd��g}g}tt|��D]2}t||||�r,|�||�|�||�q,||fS)z�Walk two filename lists in parallel, testing if each source is newer
    than its corresponding target.  Return a pair of lists (sources,
    targets) where source is newer than target, according to the semantics
    of 'newer()'.
    z+'sources' and 'targets' must be same length)�len�
ValueError�ranger�append)�sourcesZtargetsZ	n_sourcesZ	n_targets�ir
r
r�newer_pairwise sr�errorcCs�tj�|�sdSddlm}t�|�|}|D]P}tj�|�sb|dkrHn|dkrTq.n|dkrbdSt�|�|}||kr.dSq.dS)a�Return true if 'target' is out-of-date with respect to any file
    listed in 'sources'.  In other words, if 'target' exists and is newer
    than every file in 'sources', return false; otherwise return true.
    'missing' controls what we do when a source file is missing; the
    default ("error") is to blow up with an OSError from inside 'stat()';
    if it is "ignore", we silently drop any missing source files; if it is
    "newer", any missing source files make us assume that 'target' is
    out-of-date (this is handy in "dry-run" mode: it'll make you pretend to
    carry out commands that wouldn't work because inputs are missing, but
    that doesn't matter because you're not actually going to run the
    commands).
    rrrr�ignorerN)rrrr
r)rrZmissingrZtarget_mtimer�source_mtimer
r
r�newer_group6s r)r)�__doc__rZdistutils.errorsrrrrr
r
r
r�<module>s
distutils/__pycache__/_msvccompiler.cpython-38.opt-1.pyc000064400000031155151153537450017247 0ustar00U

e5dRN�@s�dZddlZddlZddlZddlZddlZddlmZmZm	Z	m
Z
mZddlm
Z
mZddlmZddlmZddlmZdd	�Zd
d�Zdd
ddd�Zdd�Zdd�Zddd�Zddddd�ZGdd�de
�ZdS)adistutils._msvccompiler

Contains MSVCCompiler, an implementation of the abstract CCompiler class
for Microsoft Visual Studio 2015.

The module is compatible with VS 2015 and later. You can find legacy support
for older versions in distutils.msvc9compiler and distutils.msvccompiler.
�N)�DistutilsExecError�DistutilsPlatformError�CompileError�LibError�	LinkError)�	CCompiler�gen_lib_options)�log)�get_platform)�countcCsztjtjdtjtjBd�}Wn tk
r>t�d�YdSXd}d}|��t�D]�}zt�	||�\}}}Wntk
r�Yq�YnX|rT|tj
krTtj�
|�rTztt|��}Wnttfk
r�YqTYnX|dkrT||krT||}}qTW5QRX||fS)Nz'Software\Microsoft\VisualStudio\SxS\VC7)�accesszVisual C++ is not registered�NNr�)�winregZ	OpenKeyEx�HKEY_LOCAL_MACHINEZKEY_READZKEY_WOW64_32KEY�OSErrorr	�debugrZ	EnumValueZREG_SZ�os�path�isdir�int�float�
ValueError�	TypeError)�key�best_version�best_dir�i�vZvc_dirZvt�version�r �//usr/lib64/python3.8/distutils/_msvccompiler.py�_find_vc2015s2
�



r"c
Cs�ddl}tj�d�ptj�d�}|s(dSz8tjtj�|ddd�d	d
ddd
dddg	ddd���}Wntj	t
tfk
r~YdSXtj�|ddd�}tj�|�r�d|fSdS)aJReturns "15, path" based on the result of invoking vswhere.exe
    If no install is found, returns "None, None"

    The version is returned to avoid unnecessarily changing the function
    result. It may be ignored when the path is not None.

    If vswhere.exe is not available, by definition, VS 2017 is not
    installed.
    rNzProgramFiles(x86)ZProgramFilesr
zMicrosoft Visual StudioZ	Installerzvswhere.exez-latestz-prereleasez	-requiresz1Microsoft.VisualStudio.Component.VC.Tools.x86.x64z	-propertyZinstallationPathz	-products�*�mbcs�strict)�encoding�errorsZVCZ	AuxiliaryZBuild�)
�jsonr�environ�get�
subprocess�check_outputr�join�strip�CalledProcessErrorr�UnicodeDecodeErrorr)r)�rootrr r r!�_find_vc2017:s2
��r3�x86Zx64ZarmZarm64)r4�	x86_amd64�x86_arm�	x86_arm64cCs\t�\}}|st�\}}|s*t�d�dStj�|d�}tj�|�sTt�d|�dS|dfS)Nz$No suitable Visual C++ version foundr
z
vcvarsall.batz%s cannot be found)r3r"r	rrrr.�isfile)�	plat_spec�_rr�	vcvarsallr r r!�_find_vcvarsallcs


r<c
Cs�t�d�rdd�tj��D�St|�\}}|s6td��z&tjd�||�tj	d�j
ddd	�}Wn@tjk
r�}z t�
|j�td
�|j���W5d}~XYnXdd�dd
�|��D�D�}|S)NZDISTUTILS_USE_SDKcSsi|]\}}|��|�qSr ��lower)�.0r�valuer r r!�
<dictcomp>ws�z_get_vc_env.<locals>.<dictcomp>zUnable to find vcvarsall.batzcmd /u /c "{}" {} && set)�stderrzutf-16le�replace)r'zError executing {}cSs$i|]\}}}|r|r|��|�qSr r=)r?rr:r@r r r!rA�s
�css|]}|�d�VqdS)�=N)�	partition)r?�liner r r!�	<genexpr>�sz_get_vc_env.<locals>.<genexpr>)r�getenvr*�itemsr<rr,r-�formatZSTDOUT�decoder0r	�error�output�cmd�
splitlines)r9r;r:�out�exc�envr r r!�_get_vc_envus0
�
��
��rScCsN|st�d��tj�}|D].}tj�tj�|�|�}tj�|�r|Sq|S)atReturn path to an MSVC executable program.

    Tries to find the program in several places: first, one of the
    MSVC program search paths from the registry; next, the directories
    in the PATH environment variable.  If any of those work, return an
    absolute path that is known to exist.  If none of them work, just
    return the original program name, 'exe'.
    r)rrH�split�pathseprr.�abspathr8)Zexe�paths�p�fnr r r!�	_find_exe�s	
rZr5r6r7)Zwin32z	win-amd64z	win-arm32z	win-arm64c
s�eZdZdZdZiZdgZdddgZdgZdgZ	eeee	Z
d	Zd
ZdZ
dZd
ZZdZd(dd�Zd)dd�Zd*dd�Zd+dd�Zd,dd�Zd-dd�Z�fdd�Zd d!�Zd"d#�Zd$d%�Zd.d&d'�Z�ZS)/�MSVCCompilerzwConcrete class that implements an interface to Microsoft Visual C++,
       as defined by the CCompiler abstract class.Zmsvcz.cz.ccz.cppz.cxx�.rcz.mcz.resz.objz.libz.dllz%s%sz.exercCs t�||||�d|_d|_dS)NF)r�__init__�	plat_name�initialized)�self�verboseZdry_runZforcer r r!r]�szMSVCCompiler.__init__NcCs�|dkrt�}|tkr(td�tt����t|}t|�}|sDtd��|�dd�|_|j�t	j
�}td|�|_td|�|_
td|�|_td|�|_td	|�|_td
|�|_|�dd��t	j
�D]}|r�|�|�t	j��q�|�dd��t	j
�D]}|r�|�|�t	j��q�d|_d
dddddg|_d
dddddg|_d
ddg}d
dddg}|d �|_|d!�|_|d"�|_|d#�|_|�|_|�|_tj df|jtj df|jtj df|jtj!df|jtj!df|jtj!df|jtj"df|jtj"df|jtj"df|ji	|_#d|_$dS)$Nz--plat-name must be one of {}z7Unable to find a compatible Visual Studio installation.r�zcl.exezlink.exezlib.exezrc.exezmc.exezmt.exeZinclude�libz/nologoz/Oxz/W3z/GLz/DNDEBUGz/MDz/Odz/MDdz/Ziz/D_DEBUGz/INCREMENTAL:NOz/LTCGz/DEBUG:FULL�/MANIFEST:EMBED,ID=1�/DLL�/MANIFEST:EMBED,ID=2�/MANIFESTUAC:NOFT)rd)rd)rerfrg)rerfrg)%r
�PLAT_TO_VCVARSrrJ�tuplerSr+�_pathsrTrrUrZ�cc�linkerrc�rc�mcZmtZadd_include_dir�rstrip�sepZadd_library_dirZpreprocess_options�compile_options�compile_options_debugZldflags_exeZldflags_exe_debugZldflags_sharedZldflags_shared_debugZldflags_staticZldflags_static_debugrZ
EXECUTABLEZ
SHARED_OBJECTZSHARED_LIBRARY�_ldflagsr_)r`r^r9Zvc_envrW�dir�ldflagsZ
ldflags_debugr r r!�
initialize�s������



�zMSVCCompiler.initializerbcsT�fdd��jD��fdd��j�jD����p4d����fdd�}tt||��S)Ncsi|]}|�j�qSr )�
obj_extension�r?�ext�r`r r!rA&sz1MSVCCompiler.object_filenames.<locals>.<dictcomp>csi|]}|�j�qSr )�
res_extensionrxrzr r!rA'srbcs�tj�|�\}}�r"tj�|�}n2tj�|�\}}|�tjjtjjf�rT|dd�}ztj��|�|�WSt	k
r�t
d�|���YnXdS)N�zDon't know how to compile {})rr�splitext�basename�
splitdrive�
startswithrp�altsepr.�LookupErrorrrJ)rX�baseryr:)�ext_map�
output_dir�	strip_dirr r!�
make_out_path,sz4MSVCCompiler.object_filenames.<locals>.make_out_path)�src_extensions�_rc_extensions�_mc_extensions�list�map)r`Zsource_filenamesr�r�r�r )r�r�r`r�r!�object_filenames!s�zMSVCCompiler.object_filenamesc	Cs�|js|��|�||||||�}	|	\}}
}}}|p6g}
|
�d�|rT|
�|j�n|
�|j�d}|
D�]}z||\}}Wntk
r�YqhYnX|r�tj	�
|�}||jkr�d|}�nD||jkr�d|}d}�n*||j
k�r@|}d|}z|�|jg|||g�Wqhtk
�r:}zt|��W5d}~XYqhXqhn�||jk�r�tj	�|�}tj	�|�}z\|�|jd|d||g�tj	�tj	�|��\}}tj	�||d	�}|�|jd||g�Wqhtk
�r�}zt|��W5d}~XYqhXqhntd
�||���|jg|
|}|�r"|�d�|�|�|�d|�|�|�z|�|�Wqhtk
�r~}zt|��W5d}~XYqhXqh|
S)
Nz/cFz/Tcz/TpTz/foz-hz-rr\z"Don't know how to compile {} to {}z/EHscz/Fo)r_rvZ_setup_compile�append�extendrrrq�KeyErrorrrrV�
_c_extensions�_cpp_extensionsr��spawnrmrrr��dirnamernr}r~r.rJrk)r`Zsourcesr�ZmacrosZinclude_dirsr�
extra_preargs�extra_postargsZdependsZcompile_info�objectsZpp_optsZbuildZcompile_optsZadd_cpp_opts�obj�srcryZ	input_optZ
output_opt�msgZh_dirZrc_dirr�r:Zrc_file�argsr r r!�compileBsx
�




�


zMSVCCompiler.compilec	
Cs�|js|��|�||�\}}|j||d�}|�||�r�|d|g}|rJz,t�d|jd�|��|�	|jg|�Wq�t
k
r�}zt|��W5d}~XYq�Xnt�d|�dS)N)r��/OUT:�Executing "%s" %s� �skipping %s (up-to-date))r_rv�_fix_object_args�library_filename�
_need_linkr	rrcr.r�rr)	r`r�Zoutput_libnamer�r�target_lang�output_filenameZlib_argsr�r r r!�create_static_lib�s�zMSVCCompiler.create_static_libc
Cs�|js|��|�||�\}}|�|||�}|\}}}|rL|�dt|��t||||�}|dk	rptj�	||�}|�
||��r�|j||	f}dd�|p�gD�}||||d|g}tj�|d�}|dk	�rtj�
tj�|��\}}tj�	||�|��}|�d|�|
�r|
|dd�<|�r.|�|�tj�tj�|��}|�|�z,t�d|jd�	|��|�|jg|�Wn,tk
�r�}zt|��W5d}~XYnXnt�d	|�dS)
Nz5I don't know what to do with 'runtime_library_dirs': cSsg|]}d|�qS)z/EXPORT:r )r?Zsymr r r!�
<listcomp>�sz%MSVCCompiler.link.<locals>.<listcomp>r�rz/IMPLIB:r�r�r�)r_rvr�Z
_fix_lib_args�warn�strrrrr.r�rsr�r}r~r�r�r�rVZmkpathr	rrlr�rr)r`Ztarget_descr�r�r�Z	librariesZlibrary_dirsZruntime_library_dirsZexport_symbolsrr�r�Z
build_tempr�Z
fixed_argsZlib_optsruZexport_optsZld_argsZdll_nameZdll_extZimplib_filer�r r r!�link�s`�
��
��

��

zMSVCCompiler.linkc	s8t�d�}z|jtjd<t��|�W�S|tjd<XdS)Nr)rrHr*rj�superr�)r`rNZold_path��	__class__r r!r��s

zMSVCCompiler.spawncCsd|S)Nz	/LIBPATH:r �r`rtr r r!�library_dir_optionszMSVCCompiler.library_dir_optioncCstd��dS)Nz:don't know how to set runtime library search path for MSVC)rr�r r r!�runtime_library_dir_option
s�z'MSVCCompiler.runtime_library_dir_optioncCs
|�|�S)N)r�)r`rcr r r!�library_optionszMSVCCompiler.library_optioncCs\|r|d|g}n|g}|D]:}|D]0}tj�||�|��}tj�|�r$|Sq$qdS)NZ_d)rrr.r�r8)r`�dirsrcrZ	try_namesrt�nameZlibfiler r r!�find_library_fileszMSVCCompiler.find_library_file)rrr)N)rrb)NNNrNNN)NrN)
NNNNNrNNNN)r)�__name__�
__module__�__qualname__�__doc__Z
compiler_typeZexecutablesr�r�r�r�r�r{rwZstatic_lib_extensionZshared_lib_extensionZstatic_lib_formatZshared_lib_formatZ
exe_extensionr]rvr�r�r�r�r�r�r�r�r��
__classcell__r r r�r!r[�sf
��

P�
"�
]�
�
Er[)N)r�rZshutil�statr,rZdistutils.errorsrrrrrZdistutils.ccompilerrrZ	distutilsr	Zdistutils.utilr
�	itertoolsrr"r3ZPLAT_SPEC_TO_RUNTIMEr<rSrZrhr[r r r r!�<module>s4#�
�distutils/__pycache__/dist.cpython-38.opt-1.pyc000064400000103276151153537450015354 0ustar00U

e5d���@s�dZddlZddlZddlZddlmZzddlZWnek
rLdZYnXddlTddl	m
Z
mZddlm
Z
mZmZddlmZddlmZe�d	�Zd
d�ZGdd
�d
�ZGdd�d�Zdd�ZdS)z}distutils.dist

Provides the Distribution class, which represents the module distribution
being built/installed/distributed.
�N)�message_from_file)�*)�FancyGetopt�translate_longopt)�
check_environ�	strtobool�
rfc822_escape��log)�DEBUGz^[a-zA-Z]([a-zA-Z0-9_]*)$cCsLt|t�rn<t|t�sHt|�j}d|�d|�d�}t�tj|�t|�}|S)Nz
Warning: 'z' should be a list, got type '�')�
isinstance�str�list�type�__name__r
ZWARN)�valueZ	fieldname�typename�msg�r�&/usr/lib64/python3.8/distutils/dist.py�_ensure_lists


rc@speZdZdZdddddgZdZdd	d
ddd
dddddddddddddddgZdd�eD�Zdd iZdad"d#�Z	d$d%�Z
dbd'd(�Zd)d*�Zdcd+d,�Z
d-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d5gfd6d7�Zd8d9�Zd:d;�Zd<d=�Zd>d?�Zd@dA�ZdBdC�ZdddDdE�ZdedFdG�ZdfdIdJ�ZejfdKdL�ZdMdN�ZdOdP�Z dQdR�Z!dSdT�Z"dUdV�Z#dWdX�Z$dYdZ�Z%d[d\�Z&d]d^�Z'd_d`�Z(d!S)g�Distributiona�The core of the Distutils.  Most of the work hiding behind 'setup'
    is really done within a Distribution instance, which farms the work out
    to the Distutils commands specified on the command line.

    Setup scripts will almost never instantiate Distribution directly,
    unless the 'setup()' function is totally inadequate to their needs.
    However, it is conceivable that a setup script might wish to subclass
    Distribution for some specialized purpose, and then pass the subclass
    to 'setup()' as the 'distclass' keyword argument.  If so, it is
    necessary to respect the expectations that 'setup' has of Distribution.
    See the code for 'setup()', in core.py, for details.
    )�verbose�vzrun verbosely (default)�)�quiet�qz!run quietly (turns verbosity off))zdry-run�nzdon't actually do anything)�help�hzshow detailed help message)zno-user-cfgNz-ignore pydistutils.cfg in your home directoryz�Common commands: (see '--help-commands' for more)

  setup.py build      will build the package underneath 'build/'
  setup.py install    will install the package
)z
help-commandsNzlist all available commands)�nameNzprint package name)�version�Vzprint package version)�fullnameNzprint <package name>-<version>)�authorNzprint the author's name)�author-emailNz print the author's email address)�
maintainerNzprint the maintainer's name)zmaintainer-emailNz$print the maintainer's email address)�contactNz7print the maintainer's name if known, else the author's)z
contact-emailNz@print the maintainer's email address if known, else the author's)�urlNzprint the URL for this package)�licenseNz print the license of the package)�licenceNzalias for --license)�descriptionNzprint the package description)zlong-descriptionNz"print the long package description)�	platformsNzprint the list of platforms)�classifiersNzprint the list of classifiers)�keywordsNzprint the list of keywords)�providesNz+print the list of packages/modules provided)�requiresNz+print the list of packages/modules required)�	obsoletesNz0print the list of packages/modules made obsoletecCsg|]}t|d��qS)r�r)�.0�xrrr�
<listcomp>�szDistribution.<listcomp>rrNcCs\d|_d|_d|_|jD]}t||d�qt�|_|jjD] }d|}t||t|j|��q:i|_	d|_
d|_d|_i|_
g|_d|_i|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_i|_i|_|�r|�d�}|dk	�r8|d=|��D]4\}}|� |�}|��D]\}	}
d|
f||	<�q�qd|k�r~|d|d	<|d=d
}t!dk	�rnt!�"|�nt#j$�%|d�|��D]�\}}
t&|jd|��r�t|jd|�|
�nNt&|j|��r�t|j||
�n0t&||��r�t|||
�nd
t'|�}t!�"|��q�d|_(|jdk	�rP|jD].}
|
�)d��s6�qP|
dk�r d|_(�qP�q |�*�dS)a0Construct a new Distribution instance: initialize all the
        attributes of a Distribution, and then use 'attrs' (a dictionary
        mapping attribute names to values) to assign some of those
        attributes their "real" values.  (Any attributes not mentioned in
        'attrs' will be assigned to some null value: 0, None, an empty list
        or dictionary, etc.)  Most importantly, initialize the
        'command_obj' attribute to the empty dictionary; this will be
        filled in with real command objects by 'parse_command_line()'.
        rr�get_N��optionszsetup scriptr+r*z:'licence' distribution option is deprecated; use 'license'�
Zset_zUnknown distribution option: %sT�-z
--no-user-cfgF)+r�dry_runr�display_option_names�setattr�DistributionMetadata�metadata�_METHOD_BASENAMES�getattr�cmdclass�command_packages�script_name�script_args�command_optionsZ
dist_files�packagesZpackage_dataZpackage_dir�
py_modules�	libraries�headers�ext_modulesZext_packageZinclude_dirsZ
extra_path�scripts�
data_filesZpassword�command_obj�have_run�get�items�get_option_dict�warnings�warn�sys�stderr�write�hasattr�repr�
want_user_cfg�
startswith�finalize_options)�self�attrs�attr�basenameZmethod_namer9�commandZcmd_options�opt_dict�opt�valr�key�argrrr�__init__�s~








zDistribution.__init__cCs&|j�|�}|dkr"i}|j|<|S)z�Get the option dictionary for a given command.  If that
        command's option dictionary hasn't been created yet, then create it
        and return the new dictionary; otherwise, return the existing
        option dictionary.
        N)rGrQ)r^rb�dictrrrrS&szDistribution.get_option_dictr8c	Cs�ddlm}|dkr"t|j���}|dk	r@|�||�|d}|sV|�|d�dS|D]h}|j�|�}|dkr�|�|d|�qZ|�|d|�||�}|�d�D]}|�|d|�q�qZdS)Nr)�pformatz  zno commands known yetzno option dict for '%s' commandzoption dict for '%s' command:r:)Zpprintrj�sortedrG�keys�announcerQ�split)	r^�header�commands�indentrjZcmd_namerc�out�linerrr�dump_option_dicts1s*��zDistribution.dump_option_dictscCs�g}t�tj�tjdj�}tj�|d�}tj�|�rB|�	|�tj
dkrRd}nd}|jr�tj�tj�d�|�}tj�|�r�|�	|�d}tj�|�r�|�	|�t
r�|�dd	�|��|S)
a�Find as many configuration files as should be processed for this
        platform, and return a list of filenames in the order in which they
        should be parsed.  The filenames returned are guaranteed to exist
        (modulo nasty race conditions).

        There are three possible config files: distutils.cfg in the
        Distutils installation directory (ie. where the top-level
        Distutils __inst__.py file lives), a file in the user's home
        directory named .pydistutils.cfg on Unix and pydistutils.cfg
        on Windows/Mac; and setup.cfg in the current directory.

        The file in the user's home directory can be disabled with the
        --no-user-cfg option.
        �	distutilsz
distutils.cfg�posixz.pydistutils.cfgzpydistutils.cfg�~z	setup.cfgzusing config files: %sz, )r�os�path�dirnamerV�modules�__file__�join�isfile�appendr!r[�
expanduserrrm)r^�filesZsys_dirZsys_fileZ
user_filenameZ	user_fileZ
local_filerrr�find_config_filesMs&



zDistribution.find_config_filesc
Cs�ddlm}tjtjkr8ddddddd	d
ddd
ddg
}ng}t|�}|dkrT|��}trb|�d�|�}|D]�}tr�|�d|�|�	|�|�
�D]V}|�|�}|�|�}|D]8}	|	dkr�|	|kr�|�
||	�}
|	�dd�}	||
f||	<q�q�|��qld|jk�r�|jd��D]�\}	\}}
|j�
|	�}zF|�rDt||t|
��n(|	dk�r`t||	t|
��nt||	|
�Wn,tk
�r�}
zt|
��W5d}
~
XYnX�qdS)Nr)�ConfigParserzinstall-basezinstall-platbasezinstall-libzinstall-platlibzinstall-purelibzinstall-headerszinstall-scriptszinstall-data�prefixzexec-prefix�home�user�rootz"Distribution.parse_config_files():z  reading %srr;�_�global)rr<)Zconfigparserr�rVr��base_prefix�	frozensetr�rrm�readZsectionsr9rSrQ�replacerhrGrR�negative_optr>r�
ValueError�DistutilsOptionError)r^�	filenamesr�Zignore_options�parser�filenameZsectionr9rcrdre�src�aliasrrrr�parse_config_files}s^�





zDistribution.parse_config_filescCs�|��}g|_t||j�}|�|j�|�ddi�|j|j|d�}|�	�}t
�|j�|�
|�rhdS|r�|�||�}|dkrhdSqh|jr�|j|t|j�dk|jd�dS|js�td��dS)	a�Parse the setup script's command line, taken from the
        'script_args' instance attribute (which defaults to 'sys.argv[1:]'
        -- see 'setup()' in core.py).  This list is first processed for
        "global options" -- options that set attributes of the Distribution
        instance.  Then, it is alternately scanned for Distutils commands
        and options for that command.  Each new command terminates the
        options for the previous command.  The allowed options for a
        command are determined by the 'user_options' attribute of the
        command class -- thus, we have to be able to load command classes
        in order to parse the command line.  Any error in that 'options'
        attribute raises DistutilsGetoptError; any error on the
        command-line raises DistutilsArgError.  If no Distutils commands
        were found on the command line, raises DistutilsArgError.  Return
        true if command-line was successfully parsed and we should carry
        on with executing commands; false if no errors but we shouldn't
        execute commands (currently, this only happens if user asks for
        help).
        r+r*)�args�objectNr��display_optionsrpzno commands suppliedT)�_get_toplevel_optionsrprr��set_negative_aliasesr�Zset_aliases�getoptrFZget_option_orderr
Z
set_verbosityr�handle_display_options�_parse_command_optsr�
_show_help�len�DistutilsArgError)r^Ztoplevel_optionsr�r��option_orderrrr�parse_command_line�s.	
�zDistribution.parse_command_linecCs|jdgS)z�Return the non-display options recognized at the top level.

        This includes options that are recognized *only* at the top
        level as well as options recognized for commands.
        )zcommand-packages=Nz0list of packages that provide distutils commands)�global_options�r^rrrr��s�z"Distribution._get_toplevel_optionsc
Cs�ddlm}|d}t�|�s*td|��|j�|�z|�|�}Wn*tk
rn}zt	|��W5d}~XYnXt
||�s�td|��t|d�r�t
|jt�s�d}t||��|j}t|d�r�|��}|�|j�t|d	�r�t
|jt�r�t|j�}ng}|�|j|j|�|�|�|�|d
d��\}}	t|	d��rV|	j�rV|j|d|gd�dSt|d	��r�t
|jt��r�d}
|jD]F\}}}
}t|	|�|���rzd
}
t|��r�|�ntd
||f���qz|
�r�dS|�|�}t|	���D]\}}d|f||<�q�|S)a�Parse the command-line options for a single command.
        'parser' must be a FancyGetopt instance; 'args' must be the list
        of arguments, starting with the current command (whose options
        we are about to parse).  Returns a new version of 'args' with
        the next command at the front of the list; will be the empty
        list if there are no more commands on the command line.  Returns
        None if the user asked for help on this command.
        r��Commandzinvalid command name '%s'Nz&command class %s must subclass Command�user_optionszIcommand class %s must provide 'user_options' attribute (a list of tuples)r��help_optionsrrr�zYinvalid help function %r for help option '%s': must be a callable object (function, etc.)zcommand line) �
distutils.cmdr��
command_re�match�
SystemExitrpr�get_command_class�DistutilsModuleErrorr��
issubclassZDistutilsClassErrorrYr
r�rr��copy�updater��fix_help_options�set_option_tabler�r�r�rr�Z
get_attr_name�callablerS�varsrR)r^r�r�r�rbZ	cmd_classrr�r�ZoptsZhelp_option_foundZhelp_optionZshortZdesc�funcrcr!rrrrr�sr


�

�


���

�
��
z Distribution._parse_command_optscCsPdD]F}t|j|�}|dkrqt|t�rdd�|�d�D�}t|j||�qdS)z�Set final values for all the options on the Distribution
        instance, analogous to the .finalize_options() method of Command
        objects.
        �r/r-NcSsg|]}|���qSr��strip)r4Zelmrrrr6jsz1Distribution.finalize_options.<locals>.<listcomp>�,)rBr@r
rrnr>)r^r`rrrrr]`s
zDistribution.finalize_optionsrc
Csddlm}ddlm}|rR|r*|��}n|j}|�|�|�|jd�t	d�|rt|�|j
�|�d�t	d�|jD]z}t|t
�r�t||�r�|}	n
|�|�}	t|	d�r�t|	jt�r�|�|	jt|	j��n|�|	j�|�d|	j�t	d�qzt	||j��d	S)
abShow help for the setup script command-line in the form of
        several lists of command-line options.  'parser' should be a
        FancyGetopt instance; do not expect it to be returned in the
        same state, as its option table will be reset to make it
        generate the correct help text.

        If 'global_options' is true, lists the global options:
        --verbose, --dry-run, etc.  If 'display_options' is true, lists
        the "display-only" options: --name, --version, etc.  Finally,
        lists per-command help for every command name or command class
        in 'commands'.
        r��	gen_usager�z
Global options:r8zKInformation display options (just display information, ignore any commands)r�zOptions for '%s' command:N)�distutils.corer�r�r�r�r�r�Z
print_help�common_usage�printr�rpr
rr�r�rYr�rr�r�rrE)
r^r�r�r�rpr�r�r9rb�klassrrrr�ms:

�



��
zDistribution._show_helpc	Cs�ddlm}|jr4|��td�t||j��dSd}i}|jD]}d||d<qB|D]l\}}|rX|�|�rXt|�}t	|j
d|��}|dkr�td�|��n |dkr�td	�|��nt|�d}qX|S)
z�If there were any non-global "display-only" options
        (--help-commands or the metadata display options) on the command
        line, display the requested info and return true; else return
        false.
        rr�r8rr7r�r�)r.r0r1r2r:)r�r�Z
help_commands�print_commandsr�rEr�rQrrBr@r})	r^r�r�Zany_display_optionsZis_display_option�optionrdrerrrrr��s*
z#Distribution.handle_display_optionsc	Csjt|d�|D]T}|j�|�}|s.|�|�}z
|j}Wntk
rPd}YnXtd|||f�qdS)zZPrint a subset of the list of all commands -- used by
        'print_commands()'.
        �:�(no description available)z
  %-*s  %sN)r�rCrQr�r,�AttributeError)r^rpro�
max_length�cmdr�r,rrr�print_command_list�s


zDistribution.print_command_listcCs�ddl}|jj}i}|D]}d||<qg}|j��D]}|�|�s4|�|�q4d}||D]}t|�|krZt|�}qZ|�|d|�|r�t	�|�|d|�dS)anPrint out a help message listing all available commands with a
        description of each.  The list is divided into "standard commands"
        (listed in distutils.command.__all__) and "extra commands"
        (mentioned in self.cmdclass, but not a standard command).  The
        descriptions come from the command class attribute
        'description'.
        rNrzStandard commandszExtra commands)
�distutils.commandrb�__all__rCrlrQrr�r�r�)r^ru�std_commands�is_stdr��extra_commandsr�rrrr��s.


��zDistribution.print_commandsc		Cs�ddl}|jj}i}|D]}d||<qg}|j��D]}|�|�s4|�|�q4g}||D]P}|j�|�}|sx|�|�}z
|j}Wnt	k
r�d}YnX|�||f�qZ|S)a>Get a list of (command, description) tuples.
        The list is divided into "standard commands" (listed in
        distutils.command.__all__) and "extra commands" (mentioned in
        self.cmdclass, but not a standard command).  The descriptions come
        from the command class attribute 'description'.
        rNrr�)
r�rbr�rCrlrQrr�r,r�)	r^rur�r�r�r��rvr�r,rrr�get_command_list�s(	




zDistribution.get_command_listcCsN|j}t|t�sJ|dkrd}dd�|�d�D�}d|krD|�dd�||_|S)z9Return a list of packages from which commands are loaded.Nr8cSsg|]}|dkr|���qS)r8r�)r4Zpkgrrrr6!sz5Distribution.get_command_packages.<locals>.<listcomp>r�zdistutils.commandr)rDr
rrn�insert)r^Zpkgsrrr�get_command_packagess
z!Distribution.get_command_packagesc	Cs�|j�|�}|r|S|��D]�}d||f}|}zt|�tj|}Wntk
r^YqYnXzt||�}Wn&tk
r�t	d|||f��YnX||j|<|St	d|��dS)aoReturn the class that implements the Distutils command named by
        'command'.  First we check the 'cmdclass' dictionary; if the
        command is mentioned there, we fetch the class object from the
        dictionary and return it.  Otherwise we load the command module
        ("distutils.command." + command) and fetch the command class from
        the module.  The loaded class is also stored in 'cmdclass'
        to speed future calls to 'get_command_class()'.

        Raises DistutilsModuleError if the expected module could not be
        found, or if that module does not define the expected class.
        z%s.%sz3invalid command '%s' (no class '%s' in module '%s')zinvalid command '%s'N)
rCrQr��
__import__rVr{�ImportErrorrBr�r�)r^rbr�ZpkgnameZmodule_nameZ
klass_name�modulerrrr�'s,
��

zDistribution.get_command_classcCsl|j�|�}|sh|rhtr&|�d|�|�|�}||�}|j|<d|j|<|j�|�}|rh|�||�|S)aReturn the command object for 'command'.  Normally this object
        is cached on a previous call to 'get_command_obj()'; if no command
        object for 'command' is in the cache, then we either create and
        return it (if 'create' is true) or return None.
        z<Distribution.get_command_obj(): creating '%s' command objectr)rOrQrrmr�rPrG�_set_command_options)r^rbZcreate�cmd_objr�r9rrr�get_command_objMs�

zDistribution.get_command_objcCs\|��}|dkr|�|�}tr,|�d|�|��D�] \}\}}trZ|�d|||f�zdd�|jD�}Wntk
r�g}YnXz
|j}Wntk
r�i}YnXz|t|t	�}	||kr�|	r�t
|||t|��nJ||kr�|	r�t
||t|��n,t||��rt
|||�nt
d|||f��Wq4tk
�rT}
zt
|
��W5d}
~
XYq4Xq4dS)aySet the options for 'command_obj' from 'option_dict'.  Basically
        this means copying elements of a dictionary ('option_dict') to
        attributes of an instance ('command').

        'command_obj' must be a Command instance.  If 'option_dict' is not
        supplied, uses the standard option dictionary for this command
        (from 'self.command_options').
        Nz#  setting options for '%s' command:z    %s = %s (from %s)cSsg|]}t|��qSrr3)r4�orrrr6|s�z5Distribution._set_command_options.<locals>.<listcomp>z1error in %s: command '%s' has no such option '%s')�get_command_namerSrrmrRZboolean_optionsr�r�r
rr>rrYr�r�)r^rOZoption_dict�command_namer��sourcerZ	bool_optsZneg_optZ	is_stringrrrrr�hsF	

��




��z!Distribution._set_command_optionsrcCs|ddlm}t||�s&|}|�|�}n|��}|js8|S|��d|_d|j|<|�|�|rx|�	�D]}|�
||�qf|S)a�Reinitializes a command to the state it was in when first
        returned by 'get_command_obj()': ie., initialized but not yet
        finalized.  This provides the opportunity to sneak option
        values in programmatically, overriding or supplementing
        user-supplied values from the config files and command line.
        You'll have to re-finalize the command object (by calling
        'finalize_options()' or 'ensure_finalized()') before using it for
        real.

        'command' should be a command name (string) or command object.  If
        'reinit_subcommands' is true, also reinitializes the command's
        sub-commands, as declared by the 'sub_commands' class attribute (if
        it has one).  See the "install" command for an example.  Only
        reinitializes the sub-commands that actually matter, ie. those
        whose test predicates return true.

        Returns the reinitialized command object.
        rr�)r�r�r
r�r�Z	finalizedZinitialize_optionsrPr�Zget_sub_commands�reinitialize_command)r^rbZreinit_subcommandsr�r��subrrrr��s


z!Distribution.reinitialize_commandcCst�||�dS�Nr	)r^r�levelrrrrm�szDistribution.announcecCs|jD]}|�|�qdS)z�Run each command that was seen on the setup script command line.
        Uses the list of commands found and cache of command objects
        created by 'get_command_obj()'.
        N)rp�run_command)r^r�rrr�run_commands�s
zDistribution.run_commandscCsD|j�|�rdSt�d|�|�|�}|��|��d|j|<dS)a�Do whatever it takes to run a command (including nothing at all,
        if the command has already been run).  Specifically: if we have
        already created and run the command named by 'command', return
        silently without doing anything.  If the command named by 'command'
        doesn't even have a command object yet, create one.  Then invoke
        'run()' on that command object (or an existing one).
        Nz
running %sr)rPrQr
�infor�Zensure_finalized�run)r^rbr�rrrr��s	
zDistribution.run_commandcCst|jp|jpg�dkS�Nr)r�rHrIr�rrr�has_pure_modules�szDistribution.has_pure_modulescCs|jot|j�dkSr�)rLr�r�rrr�has_ext_modules�szDistribution.has_ext_modulescCs|jot|j�dkSr�)rJr�r�rrr�has_c_libraries�szDistribution.has_c_librariescCs|��p|��Sr�)r�r�r�rrr�has_modules�szDistribution.has_modulescCs|jot|j�dkSr�)rKr�r�rrr�has_headers�szDistribution.has_headerscCs|jot|j�dkSr�)rMr�r�rrr�has_scripts�szDistribution.has_scriptscCs|jot|j�dkSr�)rNr�r�rrr�has_data_files�szDistribution.has_data_filescCs|��o|��o|��Sr�)r�r�r�r�rrr�is_pure�s
��zDistribution.is_pure)N)NNr8)N)r)N)r))r�
__module__�__qualname__�__doc__r�r�r�r=r�rhrSrtr�r�r�r�r�r]r�r�r�r�r�r�r�r�r�r�r
�INFOrmr�r�r�r�r�r�r�r�r�r�rrrrr,s��	�,

0
:C[
�
2(!"&

,
)
rc@seZdZdZdZdBdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�ZeZd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Z d:d;�Z!d<d=�Z"d>d?�Z#d@dA�Z$dS)Cr?z]Dummy class to hold the distribution meta-data: name, version,
    author, and so forth.
    )r!r"r%�author_emailr'�maintainer_emailr)r*r,�long_descriptionr/r-r$r(Z
contact_emailr.�download_urlr0r1r2NcCs�|dk	r|�t|��nfd|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_dSr�)�
read_pkg_file�openr!r"r%r�r'r�r)r*r,r�r/r-r.r�r0r1r2)r^ryrrrrh
s&zDistributionMetadata.__init__cst|���fdd�}�fdd�}�d}|d�|_|d�|_|d�|_|d	�|_d
|_|d�|_d
|_|d�|_|d
�|_	d�kr�|d�|_
nd
|_
|d�|_|d�|_d�kr�|d��d�|_
|d�|_|d�|_|dkr�|d�|_|d�|_|d�|_nd
|_d
|_d
|_d
S)z-Reads the metadata values from a file object.cs�|}|dkrdS|S�NZUNKNOWNr)r!r�rrr�_read_field(sz7DistributionMetadata.read_pkg_file.<locals>._read_fieldcs��|d�}|gkrdS|Sr�)Zget_all)r!�valuesr�rr�
_read_list.sz6DistributionMetadata.read_pkg_file.<locals>._read_listzmetadata-versionr!r"Zsummaryr%Nr&z	home-pager*zdownload-urlr,r/r��platformZ
classifier�1.1r1r0r2)rr!r"r,r%r'r�r�r)r*r�r�rnr/r-r.r1r0r2)r^�filer�r�Zmetadata_versionrr�rr�$s:












z"DistributionMetadata.read_pkg_filec	Cs2ttj�|d�ddd��}|�|�W5QRXdS)z7Write the PKG-INFO file into the release tree.
        zPKG-INFO�wzUTF-8)�encodingN)r�rxryr}�write_pkg_file)r^Zbase_dirZpkg_inforrr�write_pkg_infoXs
�z#DistributionMetadata.write_pkg_infocCsbd}|js"|js"|js"|js"|jr&d}|�d|�|�d|���|�d|���|�d|���|�d|�	��|�d|�
��|�d	|���|�d
|���|jr�|�d|j�t
|���}|�d|�d
�|���}|�r|�d|�|�|d|���|�|d|���|�|d|���|�|d|���|�|d|���dS)z9Write the PKG-INFO format data to a file object.
        z1.0r�zMetadata-Version: %s
z	Name: %s
zVersion: %s
zSummary: %s
zHome-page: %s
zAuthor: %s
zAuthor-email: %s
zLicense: %s
zDownload-URL: %s
zDescription: %s
r�z
Keywords: %s
ZPlatformZ
ClassifierZRequiresZProvidesZ	ObsoletesN)r0r1r2r.r�rX�get_name�get_version�get_description�get_url�get_contact�get_contact_email�get_licenser�get_long_descriptionr}�get_keywords�_write_list�
get_platforms�get_classifiers�get_requires�get_provides�
get_obsoletes)r^rr"Z	long_descr/rrrr_s6��z#DistributionMetadata.write_pkg_filecCs |D]}|�d||f�qdS)Nz%s: %s
)rX)r^rr!r�rrrrr�sz DistributionMetadata._write_listcCs
|jpdSr�)r!r�rrrr�szDistributionMetadata.get_namecCs
|jpdS)Nz0.0.0)r"r�rrrr�sz DistributionMetadata.get_versioncCsd|��|��fS)Nz%s-%s)rrr�rrr�get_fullname�sz!DistributionMetadata.get_fullnamecCs
|jpdSr�)r%r�rrr�
get_author�szDistributionMetadata.get_authorcCs
|jpdSr�)r�r�rrr�get_author_email�sz%DistributionMetadata.get_author_emailcCs
|jpdSr�)r'r�rrr�get_maintainer�sz#DistributionMetadata.get_maintainercCs
|jpdSr�)r�r�rrr�get_maintainer_email�sz)DistributionMetadata.get_maintainer_emailcCs|jp|jpdSr�)r'r%r�rrrr	�sz DistributionMetadata.get_contactcCs|jp|jpdSr�)r�r�r�rrrr
�sz&DistributionMetadata.get_contact_emailcCs
|jpdSr�)r)r�rrrr�szDistributionMetadata.get_urlcCs
|jpdSr�)r*r�rrrr�sz DistributionMetadata.get_licensecCs
|jpdSr�)r,r�rrrr�sz$DistributionMetadata.get_descriptioncCs
|jpdSr�)r�r�rrrr�sz)DistributionMetadata.get_long_descriptioncCs
|jpgSr�)r/r�rrrr
�sz!DistributionMetadata.get_keywordscCst|d�|_dS)Nr/)rr/�r^rrrr�set_keywords�sz!DistributionMetadata.set_keywordscCs|jp
dgSr�)r-r�rrrr�sz"DistributionMetadata.get_platformscCst|d�|_dS)Nr-)rr-rrrr�
set_platforms�sz"DistributionMetadata.set_platformscCs
|jpgSr�)r.r�rrrr�sz$DistributionMetadata.get_classifierscCst|d�|_dS)Nr.)rr.rrrr�set_classifiers�sz$DistributionMetadata.set_classifierscCs
|jpdSr�)r�r�rrr�get_download_url�sz%DistributionMetadata.get_download_urlcCs
|jpgSr�)r1r�rrrr�sz!DistributionMetadata.get_requirescCs,ddl}|D]}|j�|�qt|�|_dSr�)�distutils.versionpredicate�versionpredicate�VersionPredicaterr1�r^rrurrrr�set_requires�sz!DistributionMetadata.set_requirescCs
|jpgSr�)r0r�rrrr�sz!DistributionMetadata.get_providescCs6dd�|D�}|D]}ddl}|j�|�q||_dS)NcSsg|]}|���qSrr�)r4rrrrr6�sz5DistributionMetadata.set_provides.<locals>.<listcomp>r)rrZsplit_provisionr0)r^rrrurrr�set_provides�s
z!DistributionMetadata.set_providescCs
|jpgSr�)r2r�rrrr�sz"DistributionMetadata.get_obsoletescCs,ddl}|D]}|j�|�qt|�|_dSr�)rrr rr2r!rrr�
set_obsoletes�sz"DistributionMetadata.set_obsoletes)N)%rr�r�r�rArhr�rrrrrrrrrrr	r
rrZget_licencerrr
rrrrrrrr"rr#rr$rrrrr?�sD	
4"r?cCs$g}|D]}|�|dd��q|S)zConvert a 4-tuple 'help_options' list as found in various command
    classes to the 3-tuple form required by FancyGetopt.
    r�)r)r9Znew_optionsZ
help_tuplerrrr��sr�)r�rVrx�reZemailrrTr�Zdistutils.errorsZdistutils.fancy_getoptrrZdistutils.utilrrrrur
Zdistutils.debugr�compiler�rrr?r�rrrr�<module>s4

Zcdistutils/__pycache__/spawn.cpython-38.pyc000064400000011764151153537450014602 0ustar00U

e5d��@s�dZddlZddlZddlmZmZddlmZddlm	Z	ddd�Z
d	d
�Zddd�Zej
d
krjdadaddd�Zddd�ZdS)z�distutils.spawn

Provides the 'spawn()' function, a front-end to various platform-
specific functions for launching another program in a sub-process.
Also provides the 'find_executable()' to search the path for a given
executable name.
�N)�DistutilsPlatformError�DistutilsExecError)�DEBUG)�log�cCsNt|�}tjdkr"t|||d�n(tjdkr<t|||d�ntdtj��dS)a�Run another program, specified as a command list 'cmd', in a new process.

    'cmd' is just the argument list for the new process, ie.
    cmd[0] is the program to run and cmd[1:] are the rest of its arguments.
    There is no way to run a program with a name different from that of its
    executable.

    If 'search_path' is true (the default), the system's executable
    search path will be used to find the program; otherwise, cmd[0]
    must be the exact path to the executable.  If 'dry_run' is true,
    the command will not actually be run.

    Raise DistutilsExecError if running the program fails in any way; just
    return on success.
    �posix)�dry_run�ntz1don't know how to spawn programs on platform '%s'N)�list�os�name�_spawn_posix�	_spawn_ntr)�cmd�search_path�verboser�r�'/usr/lib64/python3.8/distutils/spawn.py�spawns

�rcCs*t|�D]\}}d|krd|||<q|S)z�Quote command-line arguments for DOS/Windows conventions.

    Just wraps every argument which contains blanks in double quotes, and
    returns a new argument list.
    � z"%s")�	enumerate)�args�i�argrrr�_nt_quote_args+src
Cs�|d}t|�}|r t|�p|}t�d�|g|dd���|s�zt�tj||�}Wn@tk
r�}z"t	sp|}t
d||jdf��W5d}~XYnX|dkr�t	s�|}t
d||f��dS)Nrrr�command %r failed: %s����%command %r failed with exit status %d)r�find_executabler�info�joinr�spawnv�P_WAIT�OSErrorrrr)rrrr�
executableZrc�excrrrr;s(�
�r�darwinc
Cs|t�d�|��|rdS|d}|r*tjp.tj}d}tjdkr�tdkrxddl	m
}|�d�p^datrxdd�t�d	�D�a
tr�tj�dt�}t
d
d�|�d	�D�kr�d|tf}	t|	��ttj|d�}|r�tjp�tj}t��}
|
dk�r�z$|dkr�|||�n||||�WnNtk
�rX}z.t�s(|}tj�d
||jf�t�d�W5d}~XYnXt�sd|}tj�d|�t�d�n�zt�|
d�\}
}WnDtk
�r�}
z$t�s�|}td||
jdf��W5d}
~
XYnXt�|��rt�s�|}td|t�|�f��nlt� |��rHt�!|�}|dk�r,dSt�s6|}td||f��n,t�"|��rZ�q�nt�sd|}td||f���q�dS)Nrrr&)�	sysconfig�MACOSX_DEPLOYMENT_TARGET�cSsg|]}t|��qSr��int��.0�xrrr�
<listcomp>esz _spawn_posix.<locals>.<listcomp>�.cSsg|]}t|��qSrr*r,rrrr/kszF$MACOSX_DEPLOYMENT_TARGET mismatch: now "%s" but "%s" during configure)r(zunable to execute %r: %s
rz(unable to execute %r for unknown reasonsrrz"command %r terminated by signal %drz1unknown error executing %r: termination status %d)#rrr r�execvp�execv�sys�platform�_cfg_target�	distutilsr'Zget_config_var�split�_cfg_target_split�environ�getr�dict�execvpe�execve�forkr#r�stderr�write�strerror�_exit�waitpidrr�WIFSIGNALED�WTERMSIG�	WIFEXITED�WEXITSTATUS�
WIFSTOPPED)rrrrr$Zexec_fn�envr'Z
cur_targetZmy_msg�pid�eZstatusr%Zexit_statusrrrr
Ws�
����
����

����r
c	Cs�tj�|�\}}tjdkr*|dkr*|d}tj�|�r:|S|dkr�tj�dd�}|dkr�zt�d�}Wnt	t
fk
r�tj}YnX|s�dS|�tj
�}|D]&}tj�||�}tj�|�r�|Sq�dS)z�Tries to find 'executable' in the directories listed in 'path'.

    A string listing directories separated by 'os.pathsep'; defaults to
    os.environ['PATH'].  Returns the complete filename or None if not found.
    Zwin32z.exeN�PATH�CS_PATH)r�path�splitextr3r4�isfiler9r:�confstr�AttributeError�
ValueError�defpathr7�pathsepr )r$rN�_Zext�paths�p�frrrr�s(
r)rrr)rrr)rrr)N)�__doc__r3rZdistutils.errorsrrZdistutils.debugrr6rrrrr4r5r8r
rrrrr�<module>s



Rdistutils/__pycache__/log.cpython-38.opt-2.pyc000064400000004320151153537450015161 0ustar00U

e5d��@shdZdZdZdZdZddlZGdd�d�Ze�ZejZej	Z	ej
Z
ejZejZej
Z
d	d
�Zdd�ZdS)
������Nc@sPeZdZefdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�ZdS)�LogcCs
||_dS�N)�	threshold)�selfr	�r�%/usr/lib64/python3.8/distutils/log.py�__init__szLog.__init__cCs�|tttttfkr"tdt|���||jkr�|r8||}|tttfkrNtj	}ntj
}z|�d|�Wn:tk
r�|j
}|�|d��|�}|�d|�YnX|��dS)Nz%s wrong log levelz%s
�backslashreplace)�DEBUG�INFO�WARN�ERROR�FATAL�
ValueError�strr	�sys�stderr�stdout�write�UnicodeEncodeError�encoding�encode�decode�flush)r
�level�msg�args�streamrrrr�_logs
zLog._logcGs|�|||�dSr)r#)r
rr r!rrr�log'szLog.logcGs|�t||�dSr)r#r�r
r r!rrr�debug*sz	Log.debugcGs|�t||�dSr)r#rr%rrr�info-szLog.infocGs|�t||�dSr)r#rr%rrr�warn0szLog.warncGs|�t||�dSr)r#rr%rrr�error3sz	Log.errorcGs|�t||�dSr)r#rr%rrr�fatal6sz	Log.fatalN)�__name__�
__module__�__qualname__rr
r#r$r&r'r(r)r*rrrrrsrcCstj}|t_|Sr)�_global_logr	)r�oldrrr�
set_thresholdAsr0cCs8|dkrtt�n"|dkr$tt�n|dkr4tt�dS)Nrrr)r0rrr)�vrrr�
set_verbosityGs

r2)rrrrrrrr.r$r&r'r(r)r*r0r2rrrr�<module>s+distutils/__pycache__/_msvccompiler.cpython-38.pyc000064400000031250151153537450016304 0ustar00U

e5dRN�@s�dZddlZddlZddlZddlZddlZddlmZmZm	Z	m
Z
mZddlm
Z
mZddlmZddlmZddlmZdd	�Zd
d�Zdd
ddd�Zdd�Zdd�Zddd�Zddddd�ZGdd�de
�ZdS)adistutils._msvccompiler

Contains MSVCCompiler, an implementation of the abstract CCompiler class
for Microsoft Visual Studio 2015.

The module is compatible with VS 2015 and later. You can find legacy support
for older versions in distutils.msvc9compiler and distutils.msvccompiler.
�N)�DistutilsExecError�DistutilsPlatformError�CompileError�LibError�	LinkError)�	CCompiler�gen_lib_options)�log)�get_platform)�countcCsztjtjdtjtjBd�}Wn tk
r>t�d�YdSXd}d}|��t�D]�}zt�	||�\}}}Wntk
r�Yq�YnX|rT|tj
krTtj�
|�rTztt|��}Wnttfk
r�YqTYnX|dkrT||krT||}}qTW5QRX||fS)Nz'Software\Microsoft\VisualStudio\SxS\VC7)�accesszVisual C++ is not registered�NNr�)�winregZ	OpenKeyEx�HKEY_LOCAL_MACHINEZKEY_READZKEY_WOW64_32KEY�OSErrorr	�debugrZ	EnumValueZREG_SZ�os�path�isdir�int�float�
ValueError�	TypeError)�key�best_version�best_dir�i�vZvc_dirZvt�version�r �//usr/lib64/python3.8/distutils/_msvccompiler.py�_find_vc2015s2
�



r"c
Cs�ddl}tj�d�ptj�d�}|s(dSz8tjtj�|ddd�d	d
ddd
dddg	ddd���}Wntj	t
tfk
r~YdSXtj�|ddd�}tj�|�r�d|fSdS)aJReturns "15, path" based on the result of invoking vswhere.exe
    If no install is found, returns "None, None"

    The version is returned to avoid unnecessarily changing the function
    result. It may be ignored when the path is not None.

    If vswhere.exe is not available, by definition, VS 2017 is not
    installed.
    rNzProgramFiles(x86)ZProgramFilesr
zMicrosoft Visual StudioZ	Installerzvswhere.exez-latestz-prereleasez	-requiresz1Microsoft.VisualStudio.Component.VC.Tools.x86.x64z	-propertyZinstallationPathz	-products�*�mbcs�strict)�encoding�errorsZVCZ	AuxiliaryZBuild�)
�jsonr�environ�get�
subprocess�check_outputr�join�strip�CalledProcessErrorr�UnicodeDecodeErrorr)r)�rootrr r r!�_find_vc2017:s2
��r3�x86Zx64ZarmZarm64)r4�	x86_amd64�x86_arm�	x86_arm64cCs\t�\}}|st�\}}|s*t�d�dStj�|d�}tj�|�sTt�d|�dS|dfS)Nz$No suitable Visual C++ version foundr
z
vcvarsall.batz%s cannot be found)r3r"r	rrrr.�isfile)�	plat_spec�_rr�	vcvarsallr r r!�_find_vcvarsallcs


r<c
Cs�t�d�rdd�tj��D�St|�\}}|s6td��z&tjd�||�tj	d�j
ddd	�}Wn@tjk
r�}z t�
|j�td
�|j���W5d}~XYnXdd�dd
�|��D�D�}|S)NZDISTUTILS_USE_SDKcSsi|]\}}|��|�qSr ��lower)�.0r�valuer r r!�
<dictcomp>ws�z_get_vc_env.<locals>.<dictcomp>zUnable to find vcvarsall.batzcmd /u /c "{}" {} && set)�stderrzutf-16le�replace)r'zError executing {}cSs$i|]\}}}|r|r|��|�qSr r=)r?rr:r@r r r!rA�s
�css|]}|�d�VqdS)�=N)�	partition)r?�liner r r!�	<genexpr>�sz_get_vc_env.<locals>.<genexpr>)r�getenvr*�itemsr<rr,r-�formatZSTDOUT�decoder0r	�error�output�cmd�
splitlines)r9r;r:�out�exc�envr r r!�_get_vc_envus0
�
��
��rScCsN|st�d��tj�}|D].}tj�tj�|�|�}tj�|�r|Sq|S)atReturn path to an MSVC executable program.

    Tries to find the program in several places: first, one of the
    MSVC program search paths from the registry; next, the directories
    in the PATH environment variable.  If any of those work, return an
    absolute path that is known to exist.  If none of them work, just
    return the original program name, 'exe'.
    r)rrH�split�pathseprr.�abspathr8)Zexe�paths�p�fnr r r!�	_find_exe�s	
rZr5r6r7)Zwin32z	win-amd64z	win-arm32z	win-arm64c
s�eZdZdZdZiZdgZdddgZdgZdgZ	eeee	Z
d	Zd
ZdZ
dZd
ZZdZd(dd�Zd)dd�Zd*dd�Zd+dd�Zd,dd�Zd-dd�Z�fdd�Zd d!�Zd"d#�Zd$d%�Zd.d&d'�Z�ZS)/�MSVCCompilerzwConcrete class that implements an interface to Microsoft Visual C++,
       as defined by the CCompiler abstract class.Zmsvcz.cz.ccz.cppz.cxx�.rcz.mcz.resz.objz.libz.dllz%s%sz.exercCs t�||||�d|_d|_dS)NF)r�__init__�	plat_name�initialized)�self�verboseZdry_runZforcer r r!r]�szMSVCCompiler.__init__NcCs
|jrtd��|dkrt�}|tkr6td�tt����t|}t|�}|sRtd��|�dd�|_	|j	�
tj�}t
d|�|_t
d|�|_t
d|�|_t
d	|�|_t
d
|�|_t
d|�|_|�dd��
tj�D]}|r�|�|�tj��q�|�d
d��
tj�D]}|r�|�|�tj��q�d|_ddddddg|_ddddddg|_dddg}ddddg}|d!�|_|d"�|_|d#�|_|d$�|_|�|_|�|_ t!j"df|jt!j"df|jt!j"d f|jt!j#df|jt!j#df|jt!j#d f|jt!j$df|jt!j$df|jt!j$d f|j i	|_%d |_dS)%Nzdon't init multiple timesz--plat-name must be one of {}z7Unable to find a compatible Visual Studio installation.r�zcl.exezlink.exezlib.exezrc.exezmc.exezmt.exeZinclude�libz/nologoz/Oxz/W3z/GLz/DNDEBUGz/MDz/Odz/MDdz/Ziz/D_DEBUGz/INCREMENTAL:NOz/LTCGz/DEBUG:FULL�/MANIFEST:EMBED,ID=1�/DLL�/MANIFEST:EMBED,ID=2�/MANIFESTUAC:NOFT)rd)rd)rerfrg)rerfrg)&r_�AssertionErrorr
�PLAT_TO_VCVARSrrJ�tuplerSr+�_pathsrTrrUrZ�cc�linkerrc�rc�mcZmtZadd_include_dir�rstrip�sepZadd_library_dirZpreprocess_options�compile_options�compile_options_debugZldflags_exeZldflags_exe_debugZldflags_sharedZldflags_shared_debugZldflags_staticZldflags_static_debugrZ
EXECUTABLEZ
SHARED_OBJECTZSHARED_LIBRARY�_ldflags)r`r^r9Zvc_envrW�dir�ldflagsZ
ldflags_debugr r r!�
initialize�s������



�zMSVCCompiler.initializerbcsT�fdd��jD��fdd��j�jD����p4d����fdd�}tt||��S)Ncsi|]}|�j�qSr )�
obj_extension�r?�ext�r`r r!rA&sz1MSVCCompiler.object_filenames.<locals>.<dictcomp>csi|]}|�j�qSr )�
res_extensionryr{r r!rA'srbcs�tj�|�\}}�r"tj�|�}n2tj�|�\}}|�tjjtjjf�rT|dd�}ztj��|�|�WSt	k
r�t
d�|���YnXdS)N�zDon't know how to compile {})rr�splitext�basename�
splitdrive�
startswithrq�altsepr.�LookupErrorrrJ)rX�baserzr:)�ext_map�
output_dir�	strip_dirr r!�
make_out_path,sz4MSVCCompiler.object_filenames.<locals>.make_out_path)�src_extensions�_rc_extensions�_mc_extensions�list�map)r`Zsource_filenamesr�r�r�r )r�r�r`r�r!�object_filenames!s�zMSVCCompiler.object_filenamesc	Cs�|js|��|�||||||�}	|	\}}
}}}|p6g}
|
�d�|rT|
�|j�n|
�|j�d}|
D�]}z||\}}Wntk
r�YqhYnX|r�tj	�
|�}||jkr�d|}�nD||jkr�d|}d}�n*||j
k�r@|}d|}z|�|jg|||g�Wqhtk
�r:}zt|��W5d}~XYqhXqhn�||jk�r�tj	�|�}tj	�|�}z\|�|jd|d||g�tj	�tj	�|��\}}tj	�||d	�}|�|jd||g�Wqhtk
�r�}zt|��W5d}~XYqhXqhntd
�||���|jg|
|}|�r"|�d�|�|�|�d|�|�|�z|�|�Wqhtk
�r~}zt|��W5d}~XYqhXqh|
S)
Nz/cFz/Tcz/TpTz/foz-hz-rr\z"Don't know how to compile {} to {}z/EHscz/Fo)r_rwZ_setup_compile�append�extendrsrr�KeyErrorrrrV�
_c_extensions�_cpp_extensionsr��spawnrnrrr��dirnameror~rr.rJrl)r`Zsourcesr�ZmacrosZinclude_dirsr�
extra_preargs�extra_postargsZdependsZcompile_info�objectsZpp_optsZbuildZcompile_optsZadd_cpp_opts�obj�srcrzZ	input_optZ
output_opt�msgZh_dirZrc_dirr�r:Zrc_file�argsr r r!�compileBsx
�




�


zMSVCCompiler.compilec	
Cs�|js|��|�||�\}}|j||d�}|�||�r�|d|g}|rJz,t�d|jd�|��|�	|jg|�Wq�t
k
r�}zt|��W5d}~XYq�Xnt�d|�dS)N)r��/OUT:�Executing "%s" %s� �skipping %s (up-to-date))r_rw�_fix_object_args�library_filename�
_need_linkr	rrcr.r�rr)	r`r�Zoutput_libnamer�r�target_lang�output_filenameZlib_argsr�r r r!�create_static_lib�s�zMSVCCompiler.create_static_libc
Cs�|js|��|�||�\}}|�|||�}|\}}}|rL|�dt|��t||||�}|dk	rptj�	||�}|�
||��r�|j||	f}dd�|p�gD�}||||d|g}tj�|d�}|dk	�rtj�
tj�|��\}}tj�	||�|��}|�d|�|
�r|
|dd�<|�r.|�|�tj�tj�|��}|�|�z,t�d|jd�	|��|�|jg|�Wn,tk
�r�}zt|��W5d}~XYnXnt�d	|�dS)
Nz5I don't know what to do with 'runtime_library_dirs': cSsg|]}d|�qS)z/EXPORT:r )r?Zsymr r r!�
<listcomp>�sz%MSVCCompiler.link.<locals>.<listcomp>r�rz/IMPLIB:r�r�r�)r_rwr�Z
_fix_lib_args�warn�strrrrr.r�rtr�r~rr�r�r�rVZmkpathr	rrmr�rr)r`Ztarget_descr�r�r�Z	librariesZlibrary_dirsZruntime_library_dirsZexport_symbolsrr�r�Z
build_tempr�Z
fixed_argsZlib_optsrvZexport_optsZld_argsZdll_nameZdll_extZimplib_filer�r r r!�link�s`�
��
��

��

zMSVCCompiler.linkc	s8t�d�}z|jtjd<t��|�W�S|tjd<XdS)Nr)rrHr*rk�superr�)r`rNZold_path��	__class__r r!r��s

zMSVCCompiler.spawncCsd|S)Nz	/LIBPATH:r �r`rur r r!�library_dir_optionszMSVCCompiler.library_dir_optioncCstd��dS)Nz:don't know how to set runtime library search path for MSVC)rr�r r r!�runtime_library_dir_option
s�z'MSVCCompiler.runtime_library_dir_optioncCs
|�|�S)N)r�)r`rcr r r!�library_optionszMSVCCompiler.library_optioncCs\|r|d|g}n|g}|D]:}|D]0}tj�||�|��}tj�|�r$|Sq$qdS)NZ_d)rrr.r�r8)r`�dirsrcrZ	try_namesru�nameZlibfiler r r!�find_library_fileszMSVCCompiler.find_library_file)rrr)N)rrb)NNNrNNN)NrN)
NNNNNrNNNN)r)�__name__�
__module__�__qualname__�__doc__Z
compiler_typeZexecutablesr�r�r�r�r�r|rxZstatic_lib_extensionZshared_lib_extensionZstatic_lib_formatZshared_lib_formatZ
exe_extensionr]rwr�r�r�r�r�r�r�r�r��
__classcell__r r r�r!r[�sf
��

P�
"�
]�
�
Er[)N)r�rZshutil�statr,rZdistutils.errorsrrrrrZdistutils.ccompilerrrZ	distutilsr	Zdistutils.utilr
�	itertoolsrr"r3ZPLAT_SPEC_TO_RUNTIMEr<rSrZrir[r r r r!�<module>s4#�
�distutils/__pycache__/errors.cpython-38.opt-1.pyc000064400000012204151153537450015713 0ustar00U

e5d�
�@s8dZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGd	d
�d
e�ZGdd�de�ZGd
d�de�ZGdd�de�Z	Gdd�de�Z
Gdd�de�ZGdd�de�ZGdd�de�Z
Gdd�de�ZGdd�de�ZGdd�de�ZGdd �d e�ZGd!d"�d"e�ZGd#d$�d$e�ZGd%d&�d&e�Zd'S)(a�distutils.errors

Provides exceptions used by the Distutils modules.  Note that Distutils
modules may raise standard exceptions; in particular, SystemExit is
usually raised for errors that are obviously the end-user's fault
(eg. bad command-line arguments).

This module is safe to use in "from ... import *" mode; it only exports
symbols whose names start with "Distutils" and end with "Error".c@seZdZdZdS)�DistutilsErrorzThe root of all Distutils evil.N��__name__�
__module__�__qualname__�__doc__�rr�(/usr/lib64/python3.8/distutils/errors.pyrsrc@seZdZdZdS)�DistutilsModuleErrorz�Unable to load an expected module, or to find an expected class
    within some module (in particular, command modules and classes).Nrrrrrr	sr	c@seZdZdZdS)�DistutilsClassErrorz�Some command class (or possibly distribution class, if anyone
    feels a need to subclass Distribution) is found not to be holding
    up its end of the bargain, ie. implementing some part of the
    "command "interface.Nrrrrrr
sr
c@seZdZdZdS)�DistutilsGetoptErrorz7The option table provided to 'fancy_getopt()' is bogus.Nrrrrrrsrc@seZdZdZdS)�DistutilsArgErrorzaRaised by fancy_getopt in response to getopt.error -- ie. an
    error in the command line usage.Nrrrrrrsrc@seZdZdZdS)�DistutilsFileErrorz�Any problems in the filesystem: expected file not found, etc.
    Typically this is for problems that we detect before OSError
    could be raised.Nrrrrrr
$sr
c@seZdZdZdS)�DistutilsOptionErrora�Syntactic/semantic errors in command options, such as use of
    mutually conflicting options, or inconsistent options,
    badly-spelled values, etc.  No distinction is made between option
    values originating in the setup script, the command line, config
    files, or what-have-you -- but if we *know* something originated in
    the setup script, we'll raise DistutilsSetupError instead.Nrrrrrr*src@seZdZdZdS)�DistutilsSetupErrorzqFor errors that can be definitely blamed on the setup script,
    such as invalid keyword arguments to 'setup()'.Nrrrrrr3src@seZdZdZdS)�DistutilsPlatformErrorz�We don't know how to do something on the current platform (but
    we do know how to do it on some platform) -- eg. trying to compile
    C files on a platform not supported by a CCompiler subclass.Nrrrrrr8src@seZdZdZdS)�DistutilsExecErrorz`Any problems executing an external program (such as the C
    compiler, when compiling C files).Nrrrrrr>src@seZdZdZdS)�DistutilsInternalErrorzoInternal inconsistencies or impossibilities (obviously, this
    should never be seen if the code is working!).NrrrrrrCsrc@seZdZdZdS)�DistutilsTemplateErrorz%Syntax error in a file list template.NrrrrrrHsrc@seZdZdZdS)�DistutilsByteCompileErrorzByte compile error.NrrrrrrKsrc@seZdZdZdS)�CCompilerErrorz#Some compile/link operation failed.NrrrrrrOsrc@seZdZdZdS)�PreprocessErrorz.Failure to preprocess one or more C/C++ files.NrrrrrrRsrc@seZdZdZdS)�CompileErrorz2Failure to compile one or more C/C++ source files.NrrrrrrUsrc@seZdZdZdS)�LibErrorzKFailure to create a static library from one or more C/C++ object
    files.NrrrrrrXsrc@seZdZdZdS)�	LinkErrorz]Failure to link one or more C/C++ object files into an executable
    or shared library file.Nrrrrrr\src@seZdZdZdS)�UnknownFileErrorz(Attempt to process an unknown file type.Nrrrrrr`srN)r�	Exceptionrr	r
rrr
rrrrrrrrrrrrrrrrr�<module>s&
	distutils/__pycache__/ccompiler.cpython-38.pyc000064400000101023151153537450015413 0ustar00U

e5dI��@s�dZddlZddlZddlZddlTddlmZddlmZddl	m
Z
ddlmZm
Z
ddlmZmZdd	lmZGd
d�d�ZdZdd
d�Zdddddd�Zdd�Zddd�Zdd�Zdd�ZdS)z�distutils.ccompiler

Contains CCompiler, an abstract base class that defines the interface
for the Distutils compiler abstraction model.�N)�*)�spawn)�	move_file)�mkpath)�newer_pairwise�newer_group)�split_quoted�execute)�logc
@seZdZdZdZdZdZdZdZdZ	dZ
dZdddddd�ZdddgZ
dqdd	�Zd
d�Zdd
�Zdd�Zdd�Zdrdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Z d.d/�Z!dsd0d1�Z"d2d3�Z#d4d5�Z$d6d7�Z%d8d9�Z&dtd:d;�Z'dud<d=�Z(d>d?�Z)dvd@dA�Z*dBZ+dCZ,dDZ-dwdEdF�Z.dxdGdH�Z/dydIdJ�Z0dzdKdL�Z1dMdN�Z2dOdP�Z3dQdR�Z4d{dSdT�Z5d|dUdV�Z6d}dXdY�Z7d~dZd[�Z8dd\d]�Z9d�d_d`�Z:d�dbdc�Z;ddde�Z<dfdg�Z=d�dhdi�Z>djdk�Z?dldm�Z@d�dodp�ZAdS)��	CCompilera�Abstract base class to define the interface that must be implemented
    by real compiler classes.  Also has some utility methods used by
    several compiler classes.

    The basic idea behind a compiler abstraction class is that each
    instance can be used for all the compile/link steps in building a
    single project.  Thus, attributes common to all of those compile and
    link steps -- include directories, macros to define, libraries to link
    against, etc. -- are attributes of the compiler instance.  To allow for
    variability in how individual files are treated, most of those
    attributes may be varied on a per-compilation or per-link basis.
    N�czc++Zobjc)�.cz.ccz.cppz.cxxz.mrcCsb||_||_||_d|_g|_g|_g|_g|_g|_g|_	|j
��D]}|�||j
|�qFdS�N)
�dry_run�force�verbose�
output_dir�macros�include_dirs�	libraries�library_dirs�runtime_library_dirs�objects�executables�keys�set_executable)�selfrrr�key�r�+/usr/lib64/python3.8/distutils/ccompiler.py�__init__UszCCompiler.__init__cKs<|D]2}||jkr&td||jjf��|�|||�qdS)a�Define the executables (and options for them) that will be run
        to perform the various stages of compilation.  The exact set of
        executables that may be specified here depends on the compiler
        class (via the 'executables' class attribute), but most will have:
          compiler      the C/C++ compiler
          linker_so     linker used to create shared objects and libraries
          linker_exe    linker used to create binary executables
          archiver      static library creator

        On platforms with a command-line (Unix, DOS/Windows), each of these
        is a string that will be split into executable name and (optional)
        list of arguments.  (Splitting the string is done similarly to how
        Unix shells operate: words are delimited by spaces, but quotes and
        backslashes can override this.  See
        'distutils.util.split_quoted()'.)
        z$unknown executable '%s' for class %sN)r�
ValueError�	__class__�__name__r)r�kwargsrrrr�set_executablesys

�zCCompiler.set_executablescCs,t|t�rt||t|��nt|||�dSr)�
isinstance�str�setattrr)rr�valuerrrr�s
zCCompiler.set_executablecCs0d}|jD] }|d|kr"|S|d7}q
dS)Nr�)r)r�name�i�defnrrr�_find_macro�s

zCCompiler._find_macrocCs`|D]V}t|t�rFt|�dkrFt|dt�s8|ddkrFt|dt�std|dd��qdS)z�Ensures that every element of 'definitions' is a valid macro
        definition, ie. either (name,value) 2-tuple or a (name,) tuple.  Do
        nothing if all definitions are OK, raise TypeError otherwise.
        )r*�r*Nrzinvalid macro definition '%s': z.must be tuple (string,), (string, string), or z(string, None))r&�tuple�lenr'�	TypeError)rZdefinitionsr-rrr�_check_macro_definitions�s

��
����z"CCompiler._check_macro_definitionscCs.|�|�}|dk	r|j|=|j�||f�dS)a_Define a preprocessor macro for all compilations driven by this
        compiler object.  The optional parameter 'value' should be a
        string; if it is not supplied, then the macro will be defined
        without an explicit value and the exact outcome depends on the
        compiler used (XXX true? does ANSI say anything about this?)
        N�r.r�append)rr+r)r,rrr�define_macro�s	
zCCompiler.define_macrocCs0|�|�}|dk	r|j|=|f}|j�|�dS)a�Undefine a preprocessor macro for all compilations driven by
        this compiler object.  If the same macro is defined by
        'define_macro()' and undefined by 'undefine_macro()' the last call
        takes precedence (including multiple redefinitions or
        undefinitions).  If the macro is redefined/undefined on a
        per-compilation basis (ie. in the call to 'compile()'), then that
        takes precedence.
        Nr4)rr+r,Zundefnrrr�undefine_macro�s

zCCompiler.undefine_macrocCs|j�|�dS)z�Add 'dir' to the list of directories that will be searched for
        header files.  The compiler is instructed to search directories in
        the order in which they are supplied by successive calls to
        'add_include_dir()'.
        N)rr5�r�dirrrr�add_include_dir�szCCompiler.add_include_dircCs|dd�|_dS)aySet the list of directories that will be searched to 'dirs' (a
        list of strings).  Overrides any preceding calls to
        'add_include_dir()'; subsequence calls to 'add_include_dir()' add
        to the list passed to 'set_include_dirs()'.  This does not affect
        any list of standard include directories that the compiler may
        search by default.
        N�r�r�dirsrrr�set_include_dirs�szCCompiler.set_include_dirscCs|j�|�dS)a�Add 'libname' to the list of libraries that will be included in
        all links driven by this compiler object.  Note that 'libname'
        should *not* be the name of a file containing a library, but the
        name of the library itself: the actual filename will be inferred by
        the linker, the compiler, or the compiler class (depending on the
        platform).

        The linker will be instructed to link against libraries in the
        order they were supplied to 'add_library()' and/or
        'set_libraries()'.  It is perfectly valid to duplicate library
        names; the linker will be instructed to link against libraries as
        many times as they are mentioned.
        N)rr5)r�libnamerrr�add_library�szCCompiler.add_librarycCs|dd�|_dS)z�Set the list of libraries to be included in all links driven by
        this compiler object to 'libnames' (a list of strings).  This does
        not affect any standard system libraries that the linker may
        include by default.
        N)r)rZlibnamesrrr�
set_libraries�szCCompiler.set_librariescCs|j�|�dS)a'Add 'dir' to the list of directories that will be searched for
        libraries specified to 'add_library()' and 'set_libraries()'.  The
        linker will be instructed to search for libraries in the order they
        are supplied to 'add_library_dir()' and/or 'set_library_dirs()'.
        N)rr5r8rrr�add_library_dirszCCompiler.add_library_dircCs|dd�|_dS)z�Set the list of library search directories to 'dirs' (a list of
        strings).  This does not affect any standard library search path
        that the linker may search by default.
        N)rr<rrr�set_library_dirsszCCompiler.set_library_dirscCs|j�|�dS)zlAdd 'dir' to the list of directories that will be searched for
        shared libraries at runtime.
        N)rr5r8rrr�add_runtime_library_dirsz!CCompiler.add_runtime_library_dircCs|dd�|_dS)z�Set the list of directories to search for shared libraries at
        runtime to 'dirs' (a list of strings).  This does not affect any
        standard search path that the runtime linker may search by
        default.
        N)rr<rrr�set_runtime_library_dirssz"CCompiler.set_runtime_library_dirscCs|j�|�dS)z�Add 'object' to the list of object files (or analogues, such as
        explicitly named library files or the output of "resource
        compilers") to be included in every link driven by this compiler
        object.
        N)rr5)r�objectrrr�add_link_object szCCompiler.add_link_objectcCs|dd�|_dS)z�Set the list of object files (or analogues) to be included in
        every link to 'objects'.  This does not affect any standard object
        files that the linker may include by default (such as system
        libraries).
        N)r)rrrrr�set_link_objects(szCCompiler.set_link_objectscCs*|dkr|j}nt|t�s"td��|dkr2|j}n"t|t�rL||jpFg}ntd��|dkrd|j}n*t|ttf�r�t|�|jp�g}ntd��|dkr�g}|j|d|d�}t	|�t	|�ks�t
�t||�}i}	tt	|��D]B}
||
}||
}t
j�|�d}
|�t
j�|��||
f|	|<q�|||||	fS)z;Process arguments and decide which source files to compile.N�%'output_dir' must be a string or None�/'macros' (if supplied) must be a list of tuples�6'include_dirs' (if supplied) must be a list of stringsr)�	strip_dirrr*)rr&r'r2r�listrr0�object_filenamesr1�AssertionError�gen_preprocess_options�range�os�path�splitextr�dirname)rZoutdirrZincdirs�sources�dependsZextrar�pp_opts�buildr,�src�obj�extrrr�_setup_compile6s>

��
zCCompiler._setup_compilecCs0|dg}|rdg|dd�<|r,||dd�<|S)Nz-cz-grr)rrX�debugZbefore�cc_argsrrr�_get_cc_argsas
zCCompiler._get_cc_argscCs�|dkr|j}nt|t�s"td��|dkr2|j}n"t|t�rL||jpFg}ntd��|dkrd|j}n*t|ttf�r�t|�|jp�g}ntd��|||fS)a'Typecheck and fix-up some of the arguments to the 'compile()'
        method, and return fixed-up values.  Specifically: if 'output_dir'
        is None, replaces it with 'self.output_dir'; ensures that 'macros'
        is a list, and augments it with 'self.macros'; ensures that
        'include_dirs' is a list, and augments it with 'self.include_dirs'.
        Guarantees that the returned values are of the correct type,
        i.e. for 'output_dir' either string or None, and for 'macros' and
        'include_dirs' either list or None.
        NrIrJrK)rr&r'r2rrMrr0)rrrrrrr�_fix_compile_argsjs"


�zCCompiler._fix_compile_argscCs*|j||d�}t|�t|�ks"t�|ifS)a+Decide which souce files must be recompiled.

        Determine the list of object files corresponding to 'sources',
        and figure out which ones really need to be recompiled.
        Return a list of all object files and a dictionary telling
        which source files can be skipped.
        )r)rNr1rO)rrVrrWrrrr�
_prep_compile�s	zCCompiler._prep_compilecCsHt|ttf�std��t|�}|dkr.|j}nt|t�s@td��||fS)z�Typecheck and fix up some arguments supplied to various methods.
        Specifically: ensure that 'objects' is a list; if output_dir is
        None, replace with self.output_dir.  Return fixed versions of
        'objects' and 'output_dir'.
        z,'objects' must be a list or tuple of stringsNrI)r&rMr0r2rr')rrrrrr�_fix_object_args�s
zCCompiler._fix_object_argscCs�|dkr|j}n*t|ttf�r2t|�|jp,g}ntd��|dkrJ|j}n*t|ttf�rlt|�|jpfg}ntd��|dkr�|j}n*t|ttf�r�t|�|jp�g}ntd��|||fS)a;Typecheck and fix up some of the arguments supplied to the
        'link_*' methods.  Specifically: ensure that all arguments are
        lists, and augment them with their permanent versions
        (eg. 'self.libraries' augments 'libraries').  Return a tuple with
        fixed versions of all arguments.
        Nz3'libraries' (if supplied) must be a list of stringsz6'library_dirs' (if supplied) must be a list of stringsz>'runtime_library_dirs' (if supplied) must be a list of strings)rr&rMr0r2rr)rrrrrrr�
_fix_lib_args�s,���zCCompiler._fix_lib_argscCs2|jr
dS|jr t||dd�}n
t||�}|SdS)zjReturn true if we need to relink the files listed in 'objects'
        to recreate 'output_file'.
        T�newer)ZmissingN)rrr)rr�output_filererrr�
_need_link�s
zCCompiler._need_linkc		Cs~t|t�s|g}d}t|j�}|D]V}tj�|�\}}|j�|�}z |j�	|�}||kr`|}|}Wq"t
k
rvYq"Xq"|S)z|Detect the language of a given file, or list of files. Uses
        language_map, and language_order to do the job.
        N)r&rMr1�language_orderrRrSrT�language_map�get�indexr!)	rrVZlangrk�source�baser\ZextlangZextindexrrr�detect_language�s

zCCompiler.detect_languagecCsdS)a�Preprocess a single C/C++ source file, named in 'source'.
        Output will be written to file named 'output_file', or stdout if
        'output_file' not supplied.  'macros' is a list of macro
        definitions as for 'compile()', which will augment the macros set
        with 'define_macro()' and 'undefine_macro()'.  'include_dirs' is a
        list of directory names that will be added to the default list.

        Raises PreprocessError on failure.
        Nr)rrlrfrr�
extra_preargs�extra_postargsrrr�
preprocess�szCCompiler.preprocessc		Csx|�||||||�\}}	}}
}|�|
||�}|	D]B}
z||
\}}Wntk
r\Yq0YnX|�|
|||||
�q0|	S)aK	Compile one or more source files.

        'sources' must be a list of filenames, most likely C/C++
        files, but in reality anything that can be handled by a
        particular compiler and compiler class (eg. MSVCCompiler can
        handle resource files in 'sources').  Return a list of object
        filenames, one per source filename in 'sources'.  Depending on
        the implementation, not all source files will necessarily be
        compiled, but all corresponding object filenames will be
        returned.

        If 'output_dir' is given, object files will be put under it, while
        retaining their original path component.  That is, "foo/bar.c"
        normally compiles to "foo/bar.o" (for a Unix implementation); if
        'output_dir' is "build", then it would compile to
        "build/foo/bar.o".

        'macros', if given, must be a list of macro definitions.  A macro
        definition is either a (name, value) 2-tuple or a (name,) 1-tuple.
        The former defines a macro; if the value is None, the macro is
        defined without an explicit value.  The 1-tuple case undefines a
        macro.  Later definitions/redefinitions/ undefinitions take
        precedence.

        'include_dirs', if given, must be a list of strings, the
        directories to add to the default include file search path for this
        compilation only.

        'debug' is a boolean; if true, the compiler will be instructed to
        output debug symbols in (or alongside) the object file(s).

        'extra_preargs' and 'extra_postargs' are implementation- dependent.
        On platforms that have the notion of a command-line (e.g. Unix,
        DOS/Windows), they are most likely lists of strings: extra
        command-line arguments to prepend/append to the compiler command
        line.  On other platforms, consult the implementation class
        documentation.  In any event, they are intended as an escape hatch
        for those occasions when the abstract compiler framework doesn't
        cut the mustard.

        'depends', if given, is a list of filenames that all targets
        depend on.  If a source file is older than any file in
        depends, then the source file will be recompiled.  This
        supports dependency tracking, but only at a coarse
        granularity.

        Raises CompileError on failure.
        )r]r`�KeyError�_compile)rrVrrrr^rorprWrrXrYr_r[rZr\rrr�compile�s6��
zCCompiler.compilecCsdS)zCompile 'src' to product 'obj'.Nr)rr[rZr\r_rprXrrrrsCszCCompiler._compilecCsdS)a&Link a bunch of stuff together to create a static library file.
        The "bunch of stuff" consists of the list of object files supplied
        as 'objects', the extra object files supplied to
        'add_link_object()' and/or 'set_link_objects()', the libraries
        supplied to 'add_library()' and/or 'set_libraries()', and the
        libraries supplied as 'libraries' (if any).

        'output_libname' should be a library name, not a filename; the
        filename will be inferred from the library name.  'output_dir' is
        the directory where the library file will be put.

        'debug' is a boolean; if true, debugging information will be
        included in the library (note that on most platforms, it is the
        compile step where this matters: the 'debug' flag is included here
        just for consistency).

        'target_lang' is the target language for which the given objects
        are being compiled. This allows specific linkage time treatment of
        certain languages.

        Raises LibError on failure.
        Nr)rr�output_libnamerr^�target_langrrr�create_static_libIszCCompiler.create_static_libZ
shared_objectZshared_library�
executablecCst�dS)auLink a bunch of stuff together to create an executable or
        shared library file.

        The "bunch of stuff" consists of the list of object files supplied
        as 'objects'.  'output_filename' should be a filename.  If
        'output_dir' is supplied, 'output_filename' is relative to it
        (i.e. 'output_filename' can provide directory components if
        needed).

        'libraries' is a list of libraries to link against.  These are
        library names, not filenames, since they're translated into
        filenames in a platform-specific way (eg. "foo" becomes "libfoo.a"
        on Unix and "foo.lib" on DOS/Windows).  However, they can include a
        directory component, which means the linker will look in that
        specific directory rather than searching all the normal locations.

        'library_dirs', if supplied, should be a list of directories to
        search for libraries that were specified as bare library names
        (ie. no directory component).  These are on top of the system
        default and those supplied to 'add_library_dir()' and/or
        'set_library_dirs()'.  'runtime_library_dirs' is a list of
        directories that will be embedded into the shared library and used
        to search for other shared libraries that *it* depends on at
        run-time.  (This may only be relevant on Unix.)

        'export_symbols' is a list of symbols that the shared library will
        export.  (This appears to be relevant only on Windows.)

        'debug' is as for 'compile()' and 'create_static_lib()', with the
        slight distinction that it actually matters on most platforms (as
        opposed to 'create_static_lib()', which includes a 'debug' flag
        mostly for form's sake).

        'extra_preargs' and 'extra_postargs' are as for 'compile()' (except
        of course that they supply command-line arguments for the
        particular linker being used).

        'target_lang' is the target language for which the given objects
        are being compiled. This allows specific linkage time treatment of
        certain languages.

        Raises LinkError on failure.
        N��NotImplementedError)rZtarget_descr�output_filenamerrrr�export_symbolsr^rorp�
build_temprvrrr�linkis9zCCompiler.linkc

Cs2|�tj||j|dd�|||||||	|
||�
dS)N�shared)�lib_type)r~r�SHARED_LIBRARY�library_filename)
rrrurrrrr|r^rorpr}rvrrr�link_shared_lib�s
�zCCompiler.link_shared_libc

Cs(|�tj|||||||||	|
||�
dSr)r~r�
SHARED_OBJECT)
rrr{rrrrr|r^rorpr}rvrrr�link_shared_object�s
�zCCompiler.link_shared_objectcCs.|�tj||�|�||||d|||	d|
�
dSr)r~r�
EXECUTABLE�executable_filename)rrZoutput_prognamerrrrr^rorprvrrr�link_executable�s
�zCCompiler.link_executablecCst�dS)zkReturn the compiler option to add 'dir' to the list of
        directories searched for libraries.
        Nryr8rrr�library_dir_option�szCCompiler.library_dir_optioncCst�dS)zsReturn the compiler option to add 'dir' to the list of
        directories searched for runtime libraries.
        Nryr8rrr�runtime_library_dir_option�sz$CCompiler.runtime_library_dir_optioncCst�dS)zReturn the compiler option to add 'lib' to the list of libraries
        linked into the shared library or executable.
        Nry)r�librrr�library_option�szCCompiler.library_optionc	Cs�ddl}|dkrg}|dkr g}|dkr,g}|dkr8g}|jd|dd�\}}t�|d�}	z*|D]}
|	�d|
�q^|	�d|�W5|	��Xz|j|g|d	�}Wntk
r�Yd
SXz|j|d||d�Wnt	t
fk
r�Yd
SXdS)
z�Return a boolean indicating whether funcname is supported on
        the current platform.  The optional arguments can be used to
        augment the compilation environment.
        rNr
T)�text�wz#include "%s"
z=int main (int argc, char **argv) {
    %s();
    return 0;
}
r;Fza.out)rr)�tempfileZmkstemprR�fdopen�close�writertZCompileErrorr�Z	LinkErrorr2)r�funcnameZincludesrrrr��fdZfname�fZinclrrrr�has_function�s<	�

�
zCCompiler.has_functioncCst�dS)aHSearch the specified list of directories for a static or shared
        library file 'lib' and return the full path to that file.  If
        'debug' true, look for a debugging version (if that makes sense on
        the current platform).  Return None if 'lib' wasn't found in any of
        the specified directories.
        Nry)rr=r�r^rrr�find_library_file$szCCompiler.find_library_file�cCs�|dkrd}g}|D]|}tj�|�\}}tj�|�d}|tj�|�d�}||jkrftd||f��|rvtj�|�}|�tj�	|||j
��q|S)Nr�r*z"unknown file type '%s' (from '%s'))rRrSrT�
splitdrive�isabs�src_extensionsZUnknownFileError�basenamer5�join�
obj_extension)rZsource_filenamesrLrZ	obj_namesZsrc_namermr\rrrrNOs"

��zCCompiler.object_filenamescCs0|dk	st�|rtj�|�}tj�|||j�Sr)rOrRrSr�r��shared_lib_extension�rr�rLrrrr�shared_object_filename`sz CCompiler.shared_object_filenamecCs4|dk	st�|rtj�|�}tj�|||jp.d�S)Nr�)rOrRrSr�r��
exe_extensionr�rrrr�fszCCompiler.executable_filename�staticc
Csl|dk	st�|dkrtd��t||d�}t||d�}tj�|�\}}|||f}	|r\d}tj�|||	�S)N)r�rZdylibZ
xcode_stubz?'lib_type' must be "static", "shared", "dylib", or "xcode_stub"Z_lib_formatZ_lib_extensionr�)rOr!�getattrrRrS�splitr�)
rr?r�rLrZfmtr\r9rm�filenamerrrr�ls�zCCompiler.library_filenamer*cCst�|�dSr)r
r^)r�msg�levelrrr�announceszCCompiler.announcecCsddlm}|rt|�dS)Nr)�DEBUG)Zdistutils.debugr��print)rr�r�rrr�debug_print�szCCompiler.debug_printcCstj�d|�dS)Nzwarning: %s
)�sys�stderrr�)rr�rrr�warn�szCCompiler.warncCst||||j�dSr)r	r)r�func�argsr�r�rrrr	�szCCompiler.executecCst||jd�dS�N)r)rr)r�cmdrrrr�szCCompiler.spawncCst|||jd�Sr�)rr)rrZZdstrrrr�szCCompiler.move_file�cCst|||jd�dSr�)rr)rr+�moderrrr�szCCompiler.mkpath)rrr)N)N)NNNNN)NNNrNNN)NrN)
NNNNNrNNNN)
NNNNNrNNNN)
NNNNNrNNNN)NNNNrNNN)NNNN)r)rr�)rr�)rr�)r�rr�)r*)Nr*)r�)Br#�
__module__�__qualname__�__doc__Z
compiler_typer�r�Zstatic_lib_extensionr�Zstatic_lib_formatZshared_lib_formatr�rirhr r%rr.r3r6r7r:r>r@rArBrCrDrErGrHr]r`rarbrcrdrgrnrqrtrsrwr�r�r�r~r�r�r�r�r�r�r�r�rNr�r�r�r�r�r�r	rrrrrrrrs��

$ 

+	 
"
�

�
D�
�
A�
�
�
�
,
+


�


r))zcygwin.*�unix)�posixr�)�nt�msvccCsV|dkrtj}|dkrtj}tD]0\}}t�||�dk	sHt�||�dk	r |Sq dS)akDetermine the default compiler to use for the given platform.

       osname should be one of the standard Python OS names (i.e. the
       ones returned by os.name) and platform the common value
       returned by sys.platform for the platform in question.

       The default values are os.name and sys.platform in case the
       parameters are not given.
    Nr�)rRr+r��platform�_default_compilers�re�match)Zosnamer��pattern�compilerrrr�get_default_compiler�s
�
r�)Z
unixccompilerZ
UnixCCompilerzstandard UNIX-style compiler)Z
_msvccompilerZMSVCCompilerzMicrosoft Visual C++)�cygwinccompilerZCygwinCCompilerz'Cygwin port of GNU C Compiler for Win32)r�ZMingw32CCompilerz(Mingw32 port of GNU C Compiler for Win32)ZbcppcompilerZBCPPCompilerzBorland C++ Compiler)r�r��cygwinZmingw32ZbcppcCsXddlm}g}t��D] }|�d|dt|df�q|��||�}|�d�dS)zyPrint list of available compilers (used by the "--help-compiler"
    options to "build", "build_ext", "build_clib").
    r)�FancyGetoptz	compiler=Nr/zList of available compilers:)Zdistutils.fancy_getoptr��compiler_classrr5�sortZ
print_help)r�Z	compilersr�Zpretty_printerrrr�show_compilers�s
�r�cCs�|dkrtj}z"|dkr t|�}t|\}}}Wn8tk
rhd|}|dk	r\|d|}t|��YnXz*d|}t|�tj|}	t	|	�|}
WnBt
k
r�td|��Yn$tk
r�td||f��YnX|
d||�S)a[Generate an instance of some CCompiler subclass for the supplied
    platform/compiler combination.  'plat' defaults to 'os.name'
    (eg. 'posix', 'nt'), and 'compiler' defaults to the default compiler
    for that platform.  Currently only 'posix' and 'nt' are supported, and
    the default compilers are "traditional Unix interface" (UnixCCompiler
    class) and Visual C++ (MSVCCompiler class).  Note that it's perfectly
    possible to ask for a Unix compiler object under Windows, and a
    Microsoft compiler object under Unix -- if you supply a value for
    'compiler', 'plat' is ignored.
    Nz5don't know how to compile C/C++ code on platform '%s'z with '%s' compilerz
distutils.z4can't compile C/C++ code: unable to load module '%s'zBcan't compile C/C++ code: unable to find class '%s' in module '%s')rRr+r�r�rrZDistutilsPlatformError�
__import__r��modules�vars�ImportErrorZDistutilsModuleError)Zplatr�rrrZmodule_name�
class_nameZlong_descriptionr��module�klassrrr�new_compiler�s:
����
r�cCs�g}|D]�}t|t�r0dt|�kr.dks<ntd|��t|�dkr\|�d|d�qt|�dkr|ddkr�|�d|d�q|�d|�q|D]}|�d	|�q�|S)
aGenerate C pre-processor options (-D, -U, -I) as used by at least
    two types of compilers: the typical Unix compiler and Visual C++.
    'macros' is the usual thing, a list of 1- or 2-tuples, where (name,)
    means undefine (-U) macro 'name', and (name,value) means define (-D)
    macro 'name' to 'value'.  'include_dirs' is just a list of directory
    names to be added to the header file search path (-I).  Returns a list
    of command-line options suitable for either Unix compilers or Visual
    C++.
    r*r/zPbad macro definition '%s': each element of 'macros' list must be a 1- or 2-tuplez-U%srNz-D%sz-D%s=%sz-I%s)r&r0r1r2r5)rrrXZmacror9rrrrPs"$��rPcCs�g}|D]}|�|�|��q|D],}|�|�}t|t�rD||}q"|�|�q"|D]V}tj�|�\}}	|r�|�|g|	�}
|
r�|�|
�q�|�	d|�qT|�|�
|��qT|S)acGenerate linker options for searching library directories and
    linking with specific libraries.  'libraries' and 'library_dirs' are,
    respectively, lists of library names (not filenames!) and search
    directories.  Returns a list of command-line options suitable for use
    with some compiler (depending on the two format strings passed in).
    z6no library file corresponding to '%s' found (skipping))r5r�r�r&rMrRrSr�r�r�r�)r�rrrZlib_optsr9�optr�Zlib_dirZlib_nameZlib_filerrr�gen_lib_options8s&


�r�)NN)NNrrr)r�r�rRr�Zdistutils.errorsZdistutils.spawnrZdistutils.file_utilrZdistutils.dir_utilrZdistutils.dep_utilrrZdistutils.utilrr	Z	distutilsr
rr�r�r�r�r�rPr�rrrr�<module>s8
�
--distutils/__pycache__/bcppcompiler.cpython-38.opt-2.pyc000064400000014135151153537450017064 0ustar00U

e5dW:�@stddlZddlmZmZmZmZmZmZddlm	Z	m
Z
mZddlm
Z
ddlmZddlmZGdd�de	�ZdS)	�N)�DistutilsExecError�DistutilsPlatformError�CompileError�LibError�	LinkError�UnknownFileError)�	CCompiler�gen_preprocess_options�gen_lib_options)�
write_file)�newer)�logc
@s�eZdZdZiZdgZdddgZeeZdZdZ	dZ
d	ZZd
Z
ddd
�Zddd�Zddd�Zddd�Zd dd�Zd!dd�Zd"dd�ZdS)#�BCPPCompilerZbcppz.cz.ccz.cppz.cxxz.objz.libz.dllz%s%sz.exercCs�t�||||�d|_d|_d|_d|_ddddg|_ddddg|_d	d
ddg|_d	d
ddg|_	g|_
d
ddg|_d
dddg|_dS)
Nz	bcc32.exezilink32.exeztlib.exez/tWMz/O2z/qz/g0z/Odz/Tpdz/Gnz/xz/r)
r�__init__�cc�linker�libZpreprocess_options�compile_options�compile_options_debug�ldflags_shared�ldflags_shared_debugZldflags_static�ldflags_exe�ldflags_exe_debug)�self�verboseZdry_run�force�r�./usr/lib64/python3.8/distutils/bcppcompiler.pyr5szBCPPCompiler.__init__Nc	Cs�|�||||||�\}}	}}
}|p$g}|�d�|rB|�|j�n|�|j�|	D�]<}
z||
\}}Wntk
r�YqRYnXtj�|�}tj�|
�}
|�	tj�
|
��|dkr�qR|dk�rz|�dd|
|g�WqRtk
�r}zt
|��W5d}~XYqRXqR||jk�rd}n||jk�r*d}nd}d|
}z,|�|jg||
||g||g�WqRtk
�r�}zt
|��W5d}~XYqRXqR|	S)	Nz-c�.res�.rcZbrcc32z-fo�z-P�-o)Z_setup_compile�append�extendrr�KeyError�os�path�normpath�mkpath�dirname�spawnrr�
_c_extensions�_cpp_extensionsr)rZsources�
output_dir�macros�include_dirs�debug�
extra_preargs�extra_postargsZdepends�objects�pp_optsZbuildZcompile_opts�obj�src�ext�msgZ	input_optZ
output_optrrr�compileQsV��



���
zBCPPCompiler.compilec	
Cs�|�||�\}}|j||d�}|�||�r~|dg|}|r:z|�|jg|�Wq�tk
rz}zt|��W5d}~XYq�Xnt�d|�dS)N)r-z/u�skipping %s (up-to-date))	�_fix_object_args�library_filename�
_need_linkr*rrrr
r0)	rr3Zoutput_libnamer-r0�target_lang�output_filenameZlib_argsr8rrr�create_static_lib�s�zBCPPCompiler.create_static_libc 
Cs�|�||�\}}|�|||�\}}}|r8t�dt|��|dk	rNtj�||�}|�||��r�|t	j
kr�d}|	r~|jdd�}q�|jdd�}n&d}|	r�|j
dd�}n|jdd�}|dkr�d}n�tj�|�\}}tj�|�\}}tj�|d�}tj�|d|�}dg}|�pgD]}|�d||f��q|�t||fd	|�ttjj|�}|g}g}|D]>}tj�tj�|��\}}|d
k�r�|�|�n
|�|��q`|D]}|�dtj�|���q�|�d�|�|�|�d
|g�|�d�|D]4}|�|||	�}|dk�r|�|�n
|�|��q�|�d�|�d�|�d
|g�|�d
�|�|�|
�rp|
|dd�<|�r�|�|�|�tj�|��z|�|jg|�Wn,tk
�r�}zt|��W5d}~XYnXnt�d|�dS)Nz7I don't know what to do with 'runtime_library_dirs': %sZc0w32Zc0d32r rz%s.defZEXPORTSz  %s=_%sz
writing %srz/L%sz/L.�,z,,Zimport32Zcw32mtr:) r;Z
_fix_lib_argsr
�warn�strr%r&�joinr=rZ
EXECUTABLErrrr�split�splitextr)r"Zexecuter�mapr'�normcaser#�find_library_filer(r*rrrr0) rZtarget_descr3r?r-Z	librariesZlibrary_dirsZruntime_library_dirsZexport_symbolsr0r1r2Z
build_tempr>Zstartup_objZld_argsZdef_file�head�tail�modnamer7Ztemp_dir�contentsZsymZobjects2Z	resources�file�base�lr�libfiler8rrr�link�s���
�










zBCPPCompiler.linkc	Csr|r"|d}|d|d||f}n|d|f}|D]:}|D]0}tj�||�|��}tj�|�r:|Sq:q2dS)NZ_dZ_bcpp)r%r&rDr<�exists)	r�dirsrr0ZdlibZ	try_names�dir�namerQrrrrI4s
zBCPPCompiler.find_library_filer cCs�|dkrd}g}|D]�}tj�tj�|��\}}||jddgkrRtd||f��|rbtj�|�}|dkr�|�tj�|||��q|dkr�|�tj�||d��q|�tj�|||j	��q|S)Nr rrz"unknown file type '%s' (from '%s'))
r%r&rFrH�src_extensionsr�basenamer"rD�
obj_extension)rZsource_filenamesZ	strip_dirr-Z	obj_namesZsrc_namerOr7rrr�object_filenamesNs&��zBCPPCompiler.object_filenamesc
Cs�|�d||�\}}}t||�}dg|}	|dk	r>|	�d|�|rN||	dd�<|r\|	�|�|	�|�|js~|dks~t||�r�|r�|�tj�	|��z|�
|	�Wn2tk
r�}
zt|
�t
|
��W5d}
~
XYnXdS)Nz	cpp32.exer!r)Z_fix_compile_argsr	r"r#rrr(r%r&r)r*r�printr)r�sourceZoutput_filer.r/r1r2�_r4Zpp_argsr8rrr�
preprocessis&	�



zBCPPCompiler.preprocess)rrr)NNNrNNN)NrN)
NNNNNrNNNN)r)rr )NNNNN)�__name__�
__module__�__qualname__Z
compiler_typeZexecutablesr+r,rWrYZstatic_lib_extensionZshared_lib_extensionZstatic_lib_formatZshared_lib_formatZ
exe_extensionrr9r@rRrIrZr^rrrrrs`
�
�
D�
�


�
�r)r%Zdistutils.errorsrrrrrrZdistutils.ccompilerrr	r
Zdistutils.file_utilrZdistutils.dep_utilrZ	distutilsr
rrrrr�<module>s distutils/__pycache__/version.cpython-38.pyc000064400000016221151153537450015130 0ustar00U

e5d90�@s>dZddlZGdd�d�ZGdd�de�ZGdd�de�ZdS)	a�Provides classes to represent module version numbers (one class for
each style of version numbering).  There are currently two such classes
implemented: StrictVersion and LooseVersion.

Every version number class implements the following interface:
  * the 'parse' method takes a string and parses it to some internal
    representation; if the string is an invalid version number,
    'parse' raises a ValueError exception
  * the class constructor takes an optional string argument which,
    if supplied, is passed to 'parse'
  * __str__ reconstructs the string that was passed to 'parse' (or
    an equivalent string -- ie. one that will generate an equivalent
    version number instance)
  * __repr__ generates Python code to recreate the version number instance
  * _cmp compares the current instance with either another instance
    of the same class or a string (which will be parsed to an instance
    of the same class, thus must follow the same rules)
�Nc@sJeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�Versionz�Abstract base class for version numbering classes.  Just provides
    constructor (__init__) and reproducer (__repr__), because those
    seem to be the same for all version numbering classes; and route
    rich comparisons to _cmp.
    NcCs|r|�|�dS�N��parse��self�vstring�r	�)/usr/lib64/python3.8/distutils/version.py�__init__&szVersion.__init__cCsd|jjt|�fS)Nz	%s ('%s'))�	__class__�__name__�str�rr	r	r
�__repr__*szVersion.__repr__cCs|�|�}|tkr|S|dkS�Nr��_cmp�NotImplemented�r�other�cr	r	r
�__eq__-s
zVersion.__eq__cCs|�|�}|tkr|S|dkSrrrr	r	r
�__lt__3s
zVersion.__lt__cCs|�|�}|tkr|S|dkSrrrr	r	r
�__le__9s
zVersion.__le__cCs|�|�}|tkr|S|dkSrrrr	r	r
�__gt__?s
zVersion.__gt__cCs|�|�}|tkr|S|dkSrrrr	r	r
�__ge__Es
zVersion.__ge__)N)r
�
__module__�__qualname__�__doc__rrrrrrrr	r	r	r
rs
rc@s<eZdZdZe�dejejB�Zdd�Z	dd�Z
dd�Zd	S)
�
StrictVersiona?Version numbering for anal retentives and software idealists.
    Implements the standard interface for version number classes as
    described above.  A version number consists of two or three
    dot-separated numeric components, with an optional "pre-release" tag
    on the end.  The pre-release tag consists of the letter 'a' or 'b'
    followed by a number.  If the numeric components of two version
    numbers are equal, then one with a pre-release tag will always
    be deemed earlier (lesser) than one without.

    The following are valid version numbers (shown in the order that
    would be obtained by sorting according to the supplied cmp function):

        0.4       0.4.0  (these two are equivalent)
        0.4.1
        0.5a1
        0.5b3
        0.5
        0.9.6
        1.0
        1.0.4a3
        1.0.4b1
        1.0.4

    The following are examples of invalid version numbers:

        1
        2.7.2.2
        1.3.a4
        1.3pl1
        1.3c4

    The rationale for this version numbering system will be explained
    in the distutils documentation.
    z)^(\d+) \. (\d+) (\. (\d+))? ([ab](\d+))?$cCs�|j�|�}|std|��|�ddddd�\}}}}}|rTttt|||g��|_nttt||g��d|_|r�|dt|�f|_nd|_dS)	Nzinvalid version number '%s'�����)rr)	�
version_re�match�
ValueError�group�tuple�map�int�version�
prerelease)rrr'�major�minorZpatchr.Zprerelease_numr	r	r
r�s�zStrictVersion.parsecCsb|jddkr*d�tt|jdd���}nd�tt|j��}|jr^||jdt|jd�}|S)Nr"r�.r!)r-�joinr+rr.rr	r	r
�__str__�szStrictVersion.__str__cCs�t|t�rt|�}|j|jkr2|j|jkr.dSdS|jsB|jsBdS|jrR|jsRdS|jsb|jrbdS|jr�|jr�|j|jkr~dS|j|jkr�dSdSnds�td��dS)N���r!rFznever get here)�
isinstancerr r-r.�AssertionError�rrr	r	r
r�s&
zStrictVersion._cmpN)r
rrr�re�compile�VERBOSE�ASCIIr&rr3rr	r	r	r
r ]s#
�
r c@sHeZdZdZe�dej�Zddd�Zdd�Z	dd	�Z
d
d�Zdd
�ZdS)�LooseVersiona�Version numbering for anarchists and software realists.
    Implements the standard interface for version number classes as
    described above.  A version number consists of a series of numbers,
    separated by either periods or strings of letters.  When comparing
    version numbers, the numeric components will be compared
    numerically, and the alphabetic components lexically.  The following
    are all valid version numbers, in no particular order:

        1.5.1
        1.5.2b2
        161
        3.10a
        8.02
        3.4j
        1996.07.12
        3.2.pl0
        3.1.1.6
        2g6
        11g
        0.960923
        2.2beta29
        1.13++
        5.5.kw
        2.0b1pl0

    In fact, there is no such thing as an invalid version number under
    this scheme; the rules for comparison are simple and predictable,
    but may not always give the results you want (for some definition
    of "want").
    z(\d+ | [a-z]+ | \.)NcCs|r|�|�dSrrrr	r	r
r.szLooseVersion.__init__c	Cs^||_dd�|j�|�D�}t|�D].\}}zt|�||<Wq$tk
rPYq$Xq$||_dS)NcSsg|]}|r|dkr|�qS)r1r	)�.0�xr	r	r
�
<listcomp>8s�z&LooseVersion.parse.<locals>.<listcomp>)r�component_re�split�	enumerater,r(r-)rrZ
components�i�objr	r	r
r3szLooseVersion.parsecCs|jSr)rrr	r	r
r3CszLooseVersion.__str__cCsdt|�S)NzLooseVersion ('%s'))rrr	r	r
rGszLooseVersion.__repr__cCsFt|t�rt|�}|j|jkr"dS|j|jkr2dS|j|jkrBdSdS)Nrr4r!)r5rr<r-r7r	r	r
rKs
zLooseVersion._cmp)N)
r
rrrr8r9r:r@rrr3rrr	r	r	r
r<s
r<)rr8rr r<r	r	r	r
�<module>
s
>/distutils/__pycache__/archive_util.cpython-38.opt-2.pyc000064400000010623151153537450017061 0ustar00U

e5d|!�@s@ddlZddlmZddlZzddlZWnek
r@dZYnXddlmZddlm	Z	ddl
mZddlm
Z
zddlmZWnek
r�dZYnXzddlmZWnek
r�dZYnXd	d
�Zdd�Zd"dd�Zd#dd�Zedgdfedgdfedgdfedgdfedgdfegdfd�Zdd�Zd$d d!�ZdS)%�N)�warn)�DistutilsExecError)�spawn)�mkpath)�log)�getpwnam)�getgrnamcCsNtdks|dkrdSzt|�}Wntk
r8d}YnX|dk	rJ|dSdS�N�)r�KeyError��name�result�r�./usr/lib64/python3.8/distutils/archive_util.py�_get_gids
rcCsNtdks|dkrdSzt|�}Wntk
r8d}YnX|dk	rJ|dSdSr	)rrrrrr�_get_uid+s
r�gzipcs.dddddd�}dddd	d
�}|dk	r:||��kr:td��|d}	|d
krZ|	|�|d�7}	ttj�|	�|d�ddl}
t�	d�t
���t�������fdd�}|s�|
�|	d||�}z|j||d�W5|�
�X|d
k�r*tdt�|	||}
tjdk�r||	|
g}n
|d|	g}t||d�|
S|	S)NZgz�bz2�xz�)r�bzip2rN�compressz.gzz.bz2z.xzz.Z)rrrrzKbad value for 'compress': must be None, 'gzip', 'bzip2', 'xz' or 'compress'z.tarr��dry_runrzCreating tar archivecs,�dk	r�|_�|_�dk	r(�|_�|_|S�N)�gidZgname�uid�uname)Ztarinfo�r�group�ownerrrr�_set_uid_gidasz"make_tarball.<locals>._set_uid_gidzw|%s)�filterz'compress' will be deprecated.Zwin32z-f)�keys�
ValueError�getr�os�path�dirname�tarfiler�inforr�open�close�addr�PendingDeprecationWarning�sys�platformr)�	base_name�base_dirr�verboserr!r Ztar_compressionZcompress_extZarchive_namer*r"�tarZcompressed_name�cmdrrr�make_tarball7sB���
	



r7c
Cs�|d}ttj�|�|d�tdkrp|r.d}nd}ztd|||g|d�Wn tk
rjtd|��YnX�n8t�d||�|�s�ztj	|dtj
d	�}Wn&tk
r�tj	|dtjd	�}YnX|��|tj
k�rtj�tj�|d
��}|�||�t�d|�t�|�D]�\}}	}
|	D]6}tj�tj�||d
��}|�||�t�d|��q|
D]B}tj�tj�||��}tj�|��rV|�||�t�d|��qV�qW5QRX|S)Nz.ziprz-rz-rq�zipzkunable to create zip file '%s': could neither import the 'zipfile' module nor find a standalone zip utilityz#creating '%s' and adding '%s' to it�w)Zcompressionrzadding '%s')rr'r(r)�zipfilerrrr+ZZipFileZZIP_DEFLATED�RuntimeErrorZ
ZIP_STORED�curdir�normpath�join�write�walk�isfile)r2r3r4rZzip_filenameZ
zipoptionsr8r(�dirpathZdirnames�	filenamesr
rrr�make_zipfilesV	�
���
�rD)rrzgzip'ed tar-file)rrzbzip2'ed tar-file)rrzxz'ed tar-file)rrzcompressed tar file)rNzuncompressed tar filezZIP file)ZgztarZbztarZxztarZztarr5r8cCs|D]}|tkr|SqdSr)�ARCHIVE_FORMATS)Zformats�formatrrr�check_archive_formats�s
rGc
Cs�t��}|dk	r6t�d|�tj�|�}|s6t�|�|dkrDtj}d|i}	zt|}
Wn t	k
rxt
d|��YnX|
d}|
dD]\}}
|
|	|<q�|dkr�||	d<||	d<z|||f|	�}W5|dk	r�t�d	|�t�|�X|S)
Nzchanging into '%s'rzunknown archive format '%s'r�r8r!r zchanging back to '%s')r'�getcwdr�debugr(�abspath�chdirr<rErr%)r2rFZroot_dirr3r4rr!r Zsave_cwd�kwargsZformat_info�func�arg�val�filenamerrr�make_archive�s2

rR)rrrNN)rr)NNrrNN)r'�warningsrr0r:�ImportErrorZdistutils.errorsrZdistutils.spawnrZdistutils.dir_utilrZ	distutilsr�pwdrZgrprrrr7rDrErGrRrrrr�<module>sL


�
H
=




�	
�distutils/__pycache__/sysconfig.cpython-38.opt-2.pyc000064400000020721151153537450016407 0ustar00U

��.eP�@s�ddlZddlZddlZddlZddlmZddlmZmZej	�
ej�Zej	�
ej
�Zej	�
ej�Zej	�
ej�Zdejkr�ej	�ejd�Zn&ejr�ej	�ej	�ej��Zne��Zdd�Zeedd�Zejd	kr�d
d�Zee�Zee�Zdd
�Ze�ZdZ ze�sej!Z Wne"k
�r&YnXdd�Z#d,dd�Z$d-dd�Z%dd�Z&dd�Z'dd�Z(d.dd�Z)e�*d�Z+e�*d�Z,e�*d�Z-d/d d!�Z.d"d#�Z/da0d$d%�Z1d&d'�Z2d(d)�Z3d*d+�Z4dS)0�N�)�DistutilsPlatformError)�get_platform�get_host_platformZ_PYTHON_PROJECT_BASEcCs,dD]"}tj�tj�|d|��rdSqdS)N)ZSetupzSetup.localZModulesTF)�os�path�isfile�join)�d�fn�r�+/usr/lib64/python3.8/distutils/sysconfig.py�_is_python_source_dir+sr�_home�ntcCs0|r,tj�|��tj�tj�td���r,tS|S)NZPCbuild)rr�normcase�
startswithr	�PREFIX)r
rrr
�_fix_pcbuild4s
�rcCstrtt�Stt�S)N)�	_sys_homer�project_baserrrr
�
_python_build<sr�cCsdtjdd�S)Nz%d.%d�)�sys�version_inforrrr
�get_python_versionPsrcCs�|dkr|rtpt}tjdkrjtrL|r.tp,tStj�t	d�d�}tj�
|�Sdt�t}tj�|d|�Stjdkr�tr�tj�|d�tjj
tj�|d�Stj�|d�Stdtj��dS)	N�posix�srcdirZInclude�pythonZincluder�PCzFI don't know where Python installs its C header files on platform '%s')�BASE_EXEC_PREFIX�BASE_PREFIXr�name�python_buildrrrr	�get_config_var�normpathr�build_flags�pathsepr)�
plat_specific�prefixZincdirZ
python_dirrrr
�get_python_incXs*

���r+cCs�|dkr&|r|rtpt}n|r"tp$t}tjdkrp|s8|r>d}nd}tj�||dt��}|r`|Stj�|d�Sn<tjdkr�|r�tj�|d�Stj�|dd�Snt	dtj��dS)	Nr�lib64�librz
site-packagesrZLibz?I don't know where Python installs its library on platform '%s')
r!r"�EXEC_PREFIXrrr#rr	rr)r)�standard_libr*r-Z	libpythonrrr
�get_python_lib�s0
�
��r0c	Cs�|jdk�r�tjdkr8td�s8ddl}|�t�dtd<tdddd	d
ddd
�\}}}}}}}}	dtj	kr�tj	d}
tjdkr�d
tj	kr�|�
|�r�|
|t|�d�}|
}dtj	kr�tj	d}d
tj	kr�tj	d
}dtj	kr�tj	d}n|d}dtj	k�r|dtj	d}dtj	k�r<|dtj	d}|dtj	d}dtj	k�r~|dtj	d}|dtj	d}|dtj	d}dtj	k�r�tj	d}d
tj	k�r�|dtj	d
}n|d|	}|d|}
|j||
|
d|||||d�||_
dS)NZunix�darwinZCUSTOMIZED_OSX_COMPILERr�TrueZCCZCXX�CFLAGSZCCSHAREDZLDSHAREDZSHLIB_SUFFIXZARZARFLAGSZCPPz -E�LDFLAGS� �CPPFLAGS)Zpreprocessor�compilerZcompiler_soZcompiler_cxxZ	linker_soZ
linker_exe�archiver)Z
compiler_typer�platformr%�_osx_support�customize_compiler�_config_vars�get_config_varsr�environr�lenZset_executablesZshared_lib_extension)r7r:ZccZcxxZcflagsZccsharedZldsharedZshlib_suffixZarZar_flagsZnewccZcppr8Zcc_cmdrrr
r;�sn

��


��






�	r;cCsDtr,tjdkr"tj�tptd�}q6tp(t}n
tdd�}tj�|d�S)Nrr r�r)z
pyconfig-64.h)r$rr#rr	rrr+)Zinc_dirrrr
�get_config_h_filename�s


rAcCs\trtj�tptd�Stddd�}d�t�t	�}t
tjd�rL|dtjj
7}tj�||d�S)NZMakefilerr�r)r/zconfig-{}{}�
_multiarchz-%s)r$rrr	rrr0�formatrr'�hasattrr�implementationrC)Zlib_dirZconfig_filerrr
�get_makefile_filenamesrGcCs�|dkri}t�d�}t�d�}|��}|s.q�|�|�}|rx|�dd�\}}zt|�}Wntk
rlYnX|||<q |�|�}|r d||�d�<q |S)Nz"#define ([A-Z][A-Za-z0-9_]+) (.*)
z&/[*] #undef ([A-Z][A-Za-z0-9_]+) [*]/
rrr)�re�compile�readline�match�group�int�
ValueError)�fp�gZ	define_rxZundef_rx�line�m�n�vrrr
�parse_config_hs&




rUz"([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)z\$\(([A-Za-z][A-Za-z0-9_]*)\)z\${([A-Za-z][A-Za-z0-9_]*)}c	Cs�ddlm}||ddddd�}|dkr*i}i}i}|��}|dkrDq�t�|�}|r2|�dd�\}}	|	��}	|	�dd�}
d	|
kr�|	||<q2zt|	�}	Wn$t	k
r�|	�dd	�||<Yq2X|	||<q2d
}|�rtt
|�D�]�}||}
t�|
�p�t
�|
�}|�rj|�d�}d}||k�r$t||�}n�||k�r4d}nx|tjk�rLtj|}n`||k�r�|�d
��rz|dd�|k�rzd}n$d
||k�r�d}nt|d
|�}nd||<}|�rp|
|��d�}|
d|���||}
d	|k�r�|
||<nzzt|
�}
Wn"t	k
�r|
��||<Yn
X|
||<||=|�d
��rp|dd�|k�rp|dd�}||k�rp|
||<q�||=q�q�|��|��D]"\}}	t|	t��r�|	��||<�q�|�|�|S)Nr)�TextFiler�surrogateescape)Zstrip_commentsZskip_blanksZ
join_lines�errorsrz$$r�$)r3r4r6TFZPY_�)Zdistutils.text_filerVrJ�_variable_rxrKrL�strip�replacerMrN�list�_findvar1_rx�search�_findvar2_rx�strrr>r�end�start�close�items�
isinstance�update)rrPrVrOZdoneZnotdonerQrRrSrTZtmpvZrenamed_variablesr#�value�found�itemZafter�krrr
�parse_makefile/s�








�



rmcCsVt�|�pt�|�}|rR|��\}}|d|�|�|�d��||d�}qqRq|S)Nrr)r_r`ra�span�getrL)�s�varsrRZbegrcrrr
�expand_makefile_vars�s*rrc
CsVtj�ddjtjtjttjdd�d��}t	|t
�t�dgd�}|j}ia
t
�|�dS)NZ_PYTHON_SYSCONFIGDATA_NAMEz+_sysconfigdata_{abi}_{platform}_{multiarch}rCr)Zabir9Z	multiarch�build_time_varsr)rr>rorDr�abiflagsr9�getattrrF�
__import__�globals�localsrsr<rh)r#Z_temprsrrr
�_init_posix�s��rycCs~i}tddd�|d<tddd�|d<tdd�|d<t��d|d<d	|d
<t��dd�|d
<tj�tj�	t
j��|d<|adS)NrrrBZLIBDESTZ
BINLIBDESTr@Z	INCLUDEPY�
EXT_SUFFIXz.exeZEXE�.rZVERSIONZBINDIR)
r0r+�_imp�extension_suffixesrr]rr�dirname�abspathr�
executabler<)rPrrr
�_init_nt�sr�cGs\tdk�r*t��dtj�}|r(|�niattd<ttd<t�d�}|dk	rV|td<t�dt�}tjdkr�tr�tj	�
t��}tj	�||�}ntj	�
t��}tj	�
tj	�|��td<t�rtjdk�rt}tj	�td��s|t��k�rtj	�|td�}tj	�|�td<tjdk�r*d	dl}|�t�|�rTg}|D]}|�t�|���q8|StSdS)
NZ_init_r*�exec_prefixrz�SOrrr1r)r<rwrorr#rr.rr$rr~rGr	rr&�isabs�getcwdrr9r:Zcustomize_config_vars�append)�args�funcr�r�baser:Zvalsr#rrr
r=�sB



�
r=cCs*|dkrddl}|�dtd�t��|�S)Nr�rz SO is deprecated, use EXT_SUFFIXr)�warnings�warn�DeprecationWarningr=ro)r#r�rrr
r%!sr%)rN)rrN)N)N)5r|rrHrrXr�utilrrrr&r*rr�r.�base_prefixr"�base_exec_prefixr!r>rrr�r~r�rrurr#rrr$r'rt�AttributeErrorrr+r0r;rArGrUrIr[r_rarmrrr<ryr�r=r%rrrr
�<module>sZ



(
+I





jJdistutils/__pycache__/file_util.cpython-38.opt-1.pyc000064400000013457151153537450016366 0ustar00U

e5d��@sZdZddlZddlmZddlmZdddd�Zdd
d�Zdd
d�Zddd�Z	dd�Z
dS)zFdistutils.file_util

Utility functions for operating on single files.
�N)�DistutilsFileError)�logZcopyingzhard linkingzsymbolically linking)N�hard�sym�@c
Cs�d}d}�ztzt|d�}Wn4tk
rN}ztd||jf��W5d}~XYnXtj�|�r�zt�|�Wn4tk
r�}ztd||jf��W5d}~XYnXzt|d�}Wn4tk
r�}ztd||jf��W5d}~XYnXz|�	|�}Wn6tk
�r(}ztd||jf��W5d}~XYnX|�s4�q|z|�
|�Wq�tk
�rx}ztd||jf��W5d}~XYq�Xq�W5|�r�|��|�r�|��XdS)	a5Copy the file 'src' to 'dst'; both must be filenames.  Any error
    opening either file, reading from 'src', or writing to 'dst', raises
    DistutilsFileError.  Data is read/written in chunks of 'buffer_size'
    bytes (default 16k).  No attempt is made to handle anything apart from
    regular files.
    N�rbzcould not open '%s': %szcould not delete '%s': %s�wbzcould not create '%s': %szcould not read from '%s': %szcould not write to '%s': %s)�close�open�OSErrorr�strerror�os�path�exists�unlink�read�write)�src�dstZbuffer_sizeZfsrcZfdst�eZbuf�r�+/usr/lib64/python3.8/distutils/file_util.py�_copy_file_contentssL	$����r�cCsddlm}ddlm}	m}
m}m}tj�	|�s<t
d|��tj�|�rd|}
tj�|tj�
|��}ntj�|�}
|r�|||�s�|dkr�t�d|�|dfSzt|}Wn tk
r�td|��YnX|dk�rtj�
|�tj�
|�kr�t�d|||
�nt�d|||�|�r|dfS|d	k�rrtj�|��rBtj�||��s�zt�||�|dfWStk
�rnYnXn<|d
k�r�tj�|��r�tj�||��s�t�||�|dfSt||�|�s�|�rt�|�}|�r�t�|||	||
f�|�rt�||||��|dfS)aCopy a file 'src' to 'dst'.  If 'dst' is a directory, then 'src' is
    copied there with the same name; otherwise, it must be a filename.  (If
    the file exists, it will be ruthlessly clobbered.)  If 'preserve_mode'
    is true (the default), the file's mode (type and permission bits, or
    whatever is analogous on the current platform) is copied.  If
    'preserve_times' is true (the default), the last-modified and
    last-access times are copied as well.  If 'update' is true, 'src' will
    only be copied if 'dst' does not exist, or if 'dst' does exist but is
    older than 'src'.

    'link' allows you to make hard links (os.link) or symbolic links
    (os.symlink) instead of copying: set it to "hard" or "sym"; if it is
    None (the default), files are copied.  Don't set 'link' on systems that
    don't support it: 'copy_file()' doesn't check if hard or symbolic
    linking is available. If hardlink fails, falls back to
    _copy_file_contents().

    Under Mac OS, uses the native file copy function in macostools; on
    other systems, uses '_copy_file_contents()' to copy file contents.

    Return a tuple (dest_name, copied): 'dest_name' is the actual name of
    the output file, and 'copied' is true if the file was copied (or would
    have been copied, if 'dry_run' true).
    r)�newer)�ST_ATIME�ST_MTIME�ST_MODE�S_IMODEz4can't copy '%s': doesn't exist or not a regular filerz"not copying %s (output up-to-date)z&invalid value '%s' for 'link' argumentz%s %s -> %srr)Zdistutils.dep_utilr�statrrrrr
r�isfiler�isdir�join�basename�dirnamer�debug�_copy_action�KeyError�
ValueError�infor�samefile�linkr�symlinkr�utime�chmod)rrZ
preserve_modeZpreserve_times�updater+�verbose�dry_runrrrrr�dir�action�strrr�	copy_fileCsV!�





r5cCs�ddlm}m}m}m}m}ddl}	|dkr:t�d||�|rB|S||�sVt	d|��||�rrt
j�|||��}n||�r�t	d||f��|||��s�t	d||f��d	}
zt
�
||�WnPtk
�r
}z0|j\}}
||	jkr�d
}
nt	d|||
f��W5d}~XYnX|
�r�t|||d�zt
�|�Wnhtk
�r�}zH|j\}}
zt
�|�Wntk
�rpYnXt	d
||||
f��W5d}~XYnX|S)a%Move a file 'src' to 'dst'.  If 'dst' is a directory, the file will
    be moved into it with the same name; otherwise, 'src' is just renamed
    to 'dst'.  Return the new full name of the file.

    Handles cross-device moves on Unix using 'copy_file()'.  What about
    other systems???
    r)rr r!r#r$Nrzmoving %s -> %sz#can't move '%s': not a regular filez0can't move '%s': destination '%s' already existsz2can't move '%s': destination '%s' not a valid pathFTzcouldn't move '%s' to '%s': %s)r0zAcouldn't move '%s' to '%s' by copy/delete: delete '%s' failed: %s)Zos.pathrr r!r#r$�errnorr)rr
rr"�renamer�argsZEXDEVr5r)rrr0r1rr r!r#r$r6Zcopy_itrZnum�msgrrr�	move_file�s`����

�

��r:cCs6t|d�}z|D]}|�|d�qW5|��XdS)z{Create a file with the specified name and write 'contents' (a
    sequence of strings without line terminators) to it.
    �w�
N)r
r	r)�filename�contents�f�linerrr�
write_file�s

rA)r)rrrNrr)rr)�__doc__r
Zdistutils.errorsrZ	distutilsrr&rr5r:rArrrr�<module>s"�
3�
d�
?distutils/__pycache__/fancy_getopt.cpython-38.pyc000064400000024642151153537450016133 0ustar00U

e5dxE�@s�dZddlZddlZddlZddlZddlTdZe�de�Ze�deef�Z	e
�dd�ZGd	d
�d
�Z
dd�Zd
d�ejD�Zdd�Zdd�ZGdd�d�Zedkr�dZdD]*Zede�ed�eee���e�q�dS)a6distutils.fancy_getopt

Wrapper around the standard getopt module that provides the following
additional features:
  * short and long options are tied together
  * options have help strings, so fancy_getopt could potentially
    create a complete usage summary
  * options set attributes of a passed-in object
�N)�*z[a-zA-Z](?:[a-zA-Z0-9-]*)z^%s$z^(%s)=!(%s)$�-�_c@s�eZdZdZddd�Zdd�Zdd�Zd d	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
d!dd�Zdd�Zd"dd�Zd#dd�ZdS)$�FancyGetopta�Wrapper around the standard 'getopt()' module that provides some
    handy extra functionality:
      * short and long options are tied together
      * options have help strings, and help text can be assembled
        from them
      * options set attributes of a passed-in object
      * boolean options can have "negative aliases" -- eg. if
        --quiet is the "negative alias" of --verbose, then "--quiet"
        on the command line sets 'verbose' to false
    NcCsN||_i|_|jr|��i|_i|_g|_g|_i|_i|_i|_	g|_
dS�N)�option_table�option_index�_build_index�alias�negative_alias�
short_opts�	long_opts�
short2long�	attr_name�	takes_arg�option_order��selfr�r�./usr/lib64/python3.8/distutils/fancy_getopt.py�__init__)s	zFancyGetopt.__init__cCs(|j��|jD]}||j|d<qdS)Nr)r�clearr)r�optionrrrr	Qs

zFancyGetopt._build_indexcCs||_|��dSr)rr	rrrr�set_option_tableVszFancyGetopt.set_option_tablecCs<||jkrtd|��n |||f}|j�|�||j|<dS)Nz'option conflict: already an option '%s')r�DistutilsGetoptErrorr�append)r�long_optionZshort_optionZhelp_stringrrrr�
add_optionZs
�
zFancyGetopt.add_optioncCs
||jkS)zcReturn true if the option table for this parser has an
        option with long name 'long_option'.)r�rrrrr�
has_optioncszFancyGetopt.has_optioncCs
|�t�S)z�Translate long option name 'long_option' to the form it
        has as an attribute of some object: ie., translate hyphens
        to underscores.��	translate�
longopt_xlaterrrr�
get_attr_namehszFancyGetopt.get_attr_namecCs\t|t�st�|��D]@\}}||jkr:td|||f��||jkrtd|||f��qdS)Nz(invalid %s '%s': option '%s' not definedz0invalid %s '%s': aliased option '%s' not defined)�
isinstance�dict�AssertionError�itemsrr)r�aliasesZwhatr
�optrrr�_check_alias_dictns
�
�zFancyGetopt._check_alias_dictcCs|�|d�||_dS)z'Set the aliases for this option parser.r
N)r*r
)rr
rrr�set_aliasesxszFancyGetopt.set_aliasescCs|�|d�||_dS)z�Set the negative aliases for this option parser.
        'negative_alias' should be a dictionary mapping option names to
        option names, both the key and value must already be defined
        in the option table.znegative aliasN)r*r)rrrrr�set_negative_aliases}sz FancyGetopt.set_negative_aliasescCs�g|_g|_|j��i|_|jD�]�}t|�dkrD|\}}}d}n(t|�dkr^|\}}}}ntd|f��t|t	�r�t|�dkr�t
d|��|dks�t|t	�r�t|�dks�t
d	|��||j|<|j�|�|d
dkr�|r�|d}|dd
�}d|j|<nF|j
�|�}|dk	�r:|j|�r0t
d
||f��||jd
<d|j|<|j�|�}|dk	�r�|j||j|k�r�t
d||f��t�|��s�t
d|��|�|�|j|<|r"|j�|�||j|d<q"dS)z�Populate the various data structures that keep tabs on the
        option table.  Called by 'getopt()' before it can do anything
        worthwhile.
        �r�zinvalid option tuple: %r�z9invalid long option '%s': must be a string of length >= 2N�z:invalid short option '%s': must a single character or None����=�:z>invalid negative alias '%s': aliased option '%s' takes a valuezginvalid alias '%s': inconsistent with aliased option '%s' (one of them takes a value, the other doesn'tzEinvalid long option name '%s' (must be letters, numbers, hyphens only)r
rrr�repeatr�len�
ValueErrorr$�strrrrr�getr
�
longopt_re�matchr#r)rr�long�short�helpr4Zalias_torrr�_grok_option_table�st

��
��

��


��
��zFancyGetopt._grok_option_tablec
Cs�|dkrtjdd�}|dkr*t�}d}nd}|��d�|j�}zt�|||j�\}}Wn,tjk
r�}zt	|��W5d}~XYnX|D]�\}}t
|�dkr�|ddkr�|j|d}n,t
|�dkr�|dd�d	ks�t�|dd�}|j
�|�}	|	r�|	}|j|�s:|d
k�std��|j�|�}	|	�r6|	}d}nd}|j|}
|�rl|j�|
�dk	�rlt||
d�d}t||
|�|j�||f�q�|�r�||fS|SdS)aParse command-line options in args. Store as attributes on object.

        If 'args' is None or not supplied, uses 'sys.argv[1:]'.  If
        'object' is None or not supplied, creates a new OptionDummy
        object, stores option values there, and returns a tuple (args,
        object).  If 'object' is supplied, it is modified in place and
        'getopt()' just returns 'args'; in both cases, the returned
        'args' is a modified copy of the passed-in 'args' list, which
        is left untouched.
        Nr0TF� r/rrz--�zboolean option can't have value)�sys�argv�OptionDummyr>�joinr�getoptr
�errorZDistutilsArgErrorr5rr&r
r8rrrr4�getattr�setattrrr)r�args�objectZcreated_objectrZopts�msgr)�valr
�attrrrrrE�sF 
zFancyGetopt.getoptcCs|jdkrtd��n|jSdS)z�Returns the list of (option, value) tuples processed by the
        previous run of 'getopt()'.  Raises RuntimeError if
        'getopt()' hasn't been called yet.
        Nz!'getopt()' hasn't been called yet)r�RuntimeError)rrrr�get_option_orders

zFancyGetopt.get_option_ordercCsjd}|jD]L}|d}|d}t|�}|ddkr:|d}|dk	rJ|d}||kr
|}q
|ddd}d}||}	d	|}
|r�|g}nd
g}|jD]�}|dd�\}}}t||	�}
|ddkr�|dd�}|dk�r|
r�|�d|||
df�n|�d
||f�n:d||f}|
�r4|�d|||
df�n|�d|�|
dd�D]}|�|
|��qNq�|S)z�Generate help text (a list of strings, one per suggested line of
        output) from the option table for this FancyGetopt object.
        rr0r1r2N�r/�Nr?zOption summary:r-z  --%-*s  %sz
  --%-*s  z%s (-%s)z  --%-*s)rr5�	wrap_textr)r�headerZmax_optrr;r<�lZ	opt_widthZ
line_widthZ
text_widthZ
big_indent�linesr=�textZ	opt_namesrrr�
generate_helpsH



�zFancyGetopt.generate_helpcCs0|dkrtj}|�|�D]}|�|d�qdS)N�
)rA�stdoutrW�write)rrS�file�linerrr�
print_helphszFancyGetopt.print_help)N)NN)NN)N)NN)�__name__�
__module__�__qualname__�__doc__rr	rrrr#r*r+r,r>rErOrWr]rrrrrs
(
	
M
=

OrcCst|�}|�|�|�||�Sr)rr,rE)�optionsZnegative_optrJrI�parserrrr�fancy_getoptos
rdcCsi|]}t|�d�qS)r?)�ord)�.0Z_wscharrrr�
<dictcomp>usrgcCs|dkrgSt|�|kr|gS|��}|�t�}t�d|�}dd�|D�}g}|�rg}d}|r�t|d�}|||kr�|�|d�|d=||}q\|r�|dddkr�|d=q�q\|�r|dkr�|�|dd|��|d|d�|d<|dddk�r|d=|�d�|��qN|S)	z�wrap_text(text : string, width : int) -> [string]

    Split 'text' into multiple lines of no more than 'width' characters
    each, and return the list of strings that results.
    Nz( +|-+)cSsg|]}|r|�qSrr)rfZchrrr�
<listcomp>�szwrap_text.<locals>.<listcomp>rr1r?r@)r5�
expandtabsr!�WS_TRANS�re�splitrrD)rV�widthZchunksrUZcur_lineZcur_lenrTrrrrRws:

rRcCs
|�t�S)zXConvert a long option name to a valid Python identifier by
    changing "-" to "_".
    r )r)rrr�translate_longopt�srnc@seZdZdZgfdd�ZdS)rCz_Dummy class just used as a place to hold command-line option
    values as instance attributes.cCs|D]}t||d�qdS)zkCreate a new OptionDummy instance.  The attributes listed in
        'options' will be initialized to None.N)rH)rrbr)rrrr�szOptionDummy.__init__N)r^r_r`rarrrrrrC�srC�__main__z�Tra-la-la, supercalifragilisticexpialidocious.
How *do* you spell that odd word, anyways?
(Someone ask Mary -- she'll know [or she'll
say, "How should I know?"].))�
���(z	width: %drX)rarA�stringrkrEZdistutils.errorsZlongopt_pat�compiler9Zneg_alias_rer7�	maketransr"rrdZ
whitespacerjrRrnrCr^rV�w�printrDrrrr�<module>s*
T6distutils/__pycache__/dir_util.cpython-38.opt-1.pyc000064400000013301151153537450016211 0ustar00U

e5db�@spdZddlZddlZddlmZmZddlmZiaddd�Z	dd	d
�Z
ddd�Zd
d�Zddd�Z
dd�ZdS)zWdistutils.dir_util

Utility functions for manipulating directories and directory trees.�N)�DistutilsFileError�DistutilsInternalError)�log��cCsft|t�std|f��tj�|�}g}tj�|�s<|dkr@|St�tj�	|��rV|Stj�
|�\}}|g}|r�|r�tj�|�s�tj�
|�\}}|�d|�ql|D]�}tj�||�}tj�	|�}	t�|	�r�q�|dkr�t
�d|�|�sXzt�||�WnVtk
�rL}
z6|
jtjk�r&tj�|��s<td||
jdf��W5d}
~
XYnX|�|�dt|	<q�|S)	a�Create a directory and any missing ancestor directories.

    If the directory already exists (or if 'name' is the empty string, which
    means the current directory, which of course exists), then do nothing.
    Raise DistutilsFileError if unable to create some directory along the way
    (eg. some sub-path exists, but is a file rather than a directory).
    If 'verbose' is true, print a one-line summary of each mkdir to stdout.
    Return the list of directories actually created.
    z(mkpath: 'name' must be a string (got %r)�rrzcreating %szcould not create '%s': %s���N)�
isinstance�strr�os�path�normpath�isdir�
_path_created�get�abspath�split�insert�joinr�info�mkdir�OSError�errnoZEEXISTr�args�append)�name�mode�verbose�dry_runZcreated_dirs�head�tailZtails�dZabs_head�exc�r#�*/usr/lib64/python3.8/distutils/dir_util.py�mkpathsB
�
�

r%c	CsNt�}|D] }|�tj�|tj�|���q
t|�D]}t||||d�q4dS)a�Create all the empty directories under 'base_dir' needed to put 'files'
    there.

    'base_dir' is just the name of a directory which doesn't necessarily
    exist yet; 'files' is a list of filenames to be interpreted relative to
    'base_dir'.  'base_dir' + the directory portion of every file in 'files'
    will be created if it doesn't already exist.  'mode', 'verbose' and
    'dry_run' flags are as for 'mkpath()'.
    �rrN)�set�addrrr�dirname�sortedr%)Zbase_dir�filesrrrZneed_dir�file�dirr#r#r$�create_treePs
r.c
Cs^ddlm}|s(tj�|�s(td|��zt�|�}	Wn>tk
rt}
z |rRg}	ntd||
jf��W5d}
~
XYnX|s�t	||d�g}|	D]�}tj�
||�}
tj�
||�}|�d�r�q�|�r
tj�|
��r
t�
|
�}|dkr�t�d	||�|s�t�||�|�|�q�tj�|
��r8|�t|
|||||||d
��q�||
||||||d
�|�|�q�|S)aCopy an entire directory tree 'src' to a new location 'dst'.

    Both 'src' and 'dst' must be directory names.  If 'src' is not a
    directory, raise DistutilsFileError.  If 'dst' does not exist, it is
    created with 'mkpath()'.  The end result of the copy is that every
    file in 'src' is copied to 'dst', and directories under 'src' are
    recursively copied to 'dst'.  Return the list of files that were
    copied or might have been copied, using their output name.  The
    return value is unaffected by 'update' or 'dry_run': it is simply
    the list of all files under 'src', with the names changed to be
    under 'dst'.

    'preserve_mode' and 'preserve_times' are the same as for
    'copy_file'; note that they only apply to regular files, not to
    directories.  If 'preserve_symlinks' is true, symlinks will be
    copied as symlinks (on platforms that support them!); otherwise
    (the default), the destination of the symlink will be copied.
    'update' and 'verbose' are the same as for 'copy_file'.
    r)�	copy_filez&cannot copy tree '%s': not a directoryzerror listing files in '%s': %sN)rz.nfsrzlinking %s -> %sr&)Zdistutils.file_utilr/rrrr�listdirr�strerrorr%r�
startswith�islink�readlinkrr�symlinkr�extend�	copy_tree)�srcZdstZ
preserve_modeZpreserve_timesZpreserve_symlinks�updaterrr/�names�eZoutputs�nZsrc_nameZdst_nameZ	link_destr#r#r$r7cs\��

���r7cCsft�|�D]F}tj�||�}tj�|�r@tj�|�s@t||�q
|�tj|f�q
|�tj	|f�dS)zHelper for remove_tree().N)
rr0rrrr3�_build_cmdtupler�remove�rmdir)r�	cmdtuples�fZreal_fr#r#r$r=�sr=cCs�|dkrt�d|�|rdSg}t||�|D]h}z2|d|d�tj�|d�}|tkrbt|=Wq.tk
r�}zt�d||�W5d}~XYq.Xq.dS)z�Recursively remove an entire directory tree.

    Any errors are ignored (apart from being reported to stdout if 'verbose'
    is true).
    rz'removing '%s' (and everything under it)Nrzerror removing %s: %s)	rrr=rrrrr�warn)Z	directoryrrr@�cmdrr"r#r#r$�remove_tree�s

rDcCs6tj�|�\}}|dd�tjkr2||dd�}|S)z�Take the full path 'path', and make it a relative path.

    This is useful to make 'path' the second argument to os.path.join().
    rrN)rr�
splitdrive�sep)rZdriver#r#r$�ensure_relative�srG)rrr)rrr)rrrrrr)rr)�__doc__rrZdistutils.errorsrrZ	distutilsrrr%r.r7r=rDrGr#r#r#r$�<module>s 
?
�
E

distutils/__pycache__/debug.cpython-38.pyc000064400000000304151153537450014524 0ustar00U

e5d��@sddlZej�d�ZdS)�NZDISTUTILS_DEBUG)�os�environ�get�DEBUG�rr�'/usr/lib64/python3.8/distutils/debug.py�<module>sdistutils/__pycache__/unixccompiler.cpython-38.pyc000064400000015512151153537450016326 0ustar00U

&�.e�;�@s�dZddlZddlZddlZddlmZddlmZddlm	Z	m
Z
mZddlm
Z
mZmZmZddlmZejdkr~ddlZGd	d
�d
e	�ZdS)a9distutils.unixccompiler

Contains the UnixCCompiler class, a subclass of CCompiler that handles
the "typical" Unix-style command-line C compiler:
  * macros defined with -Dname[=value]
  * macros undefined with -Uname
  * include search directories specified with -Idir
  * libraries specified with -lllib
  * library search directories specified with -Ldir
  * compile handled by 'cc' (or similar) executable with -c option:
    compiles .c to .o
  * link static library handled by 'ar' command (possibly with 'ranlib')
  * link shared library handled by 'cc -shared'
�N)�	sysconfig)�newer)�	CCompiler�gen_preprocess_options�gen_lib_options)�DistutilsExecError�CompileError�LibError�	LinkError)�log�darwinc
s�eZdZdZddgdgdgddgdgddgdd�Zejdd�d	krNd
ged
<ddd
dddgZdZdZ	dZ
dZdZdZ
ZZeZejdkr�dZ�fdd�Zd.dd�Zdd�Zd/d d!�Zd0d"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd1d,d-�Z�ZS)2�
UnixCCompilerZunixNZccz-sharedZarz-cr)�preprocessor�compiler�compiler_so�compiler_cxx�	linker_so�
linker_exe�archiver�ranlib�rrz.cz.Cz.ccz.cxxz.cppz.mz.oz.az.soz.dylibz.tbdzlib%s%s�cygwinz.execs@t��|||�\}}}t�d�}|r6||kr6|�|�|||fS)z'Remove standard library path from rpathZLIBDIR)�super�
_fix_lib_argsr�get_config_var�remove)�self�	libraries�library_dirs�runtime_library_dirsZlibdir��	__class__��//usr/lib64/python3.8/distutils/unixccompiler.pyrUs�


zUnixCCompiler._fix_lib_argsc
Cs�|�d||�}|\}}}t||�}	|j|	}
|r>|
�d|g�|rN||
dd�<|r\|
�|�|
�|�|js~|dks~t||�r�|r�|�tj	�
|��z|�|
�Wn*tk
r�}zt
|��W5d}~XYnXdS)N�-or)Z_fix_compile_argsrr�extend�appendZforcer�mkpath�os�path�dirname�spawnrr)r�sourceZoutput_fileZmacrosZinclude_dirs�
extra_preargs�extra_postargs�
fixed_args�ignore�pp_optsZpp_args�msgr"r"r#�
preprocess^s$




zUnixCCompiler.preprocessc	
Csp|j}tjdkr t�|||�}z |�|||d|g|�Wn*tk
rj}zt|��W5d}~XYnXdS)Nrr$)r�sys�platform�_osx_support�compiler_fixupr+rr)	r�obj�srcZextZcc_argsr.r1rr2r"r"r#�_compilexs
��
zUnixCCompiler._compilerc
Cs�|�||�\}}|j||d�}|�||�r�|�tj�|��|�|j|g||j	�|j
r�z|�|j
|g�Wq�tk
r�}zt|��W5d}~XYq�Xnt
�d|�dS)N)�
output_dir�skipping %s (up-to-date))�_fix_object_args�library_filename�
_need_linkr'r(r)r*r+r�objectsrrr	r�debug)rr@Zoutput_libnamer;rA�target_lang�output_filenamer2r"r"r#�create_static_lib�s$����	zUnixCCompiler.create_static_libc
Cs�|�||�\}}|�|||�}|\}}}t||||�}t|ttd�f�sPtd��|dk	rftj�	||�}|�
||��r�||j|d|g}|	r�dg|dd�<|
r�|
|dd�<|r�|�|�|�
tj�|��z�|tjkr�|jdd�}n|jdd�}|
dk�rr|j�rrd}tj�|d�dk�r@d}d||k�r@|d7}�q&tj�||�d	k�r\d}nd}|j||||<tjd
k�r�t�||�}|�||�Wn,tk
�r�}zt|��W5d}~XYnXnt�d|�dS)Nz%'output_dir' must be a string or Noner$z-grzc++�env��=Z	ld_so_aixrr<)r=rr�
isinstance�str�type�	TypeErrorr(r)�joinr?r@r%r'r*rZ
EXECUTABLErrr�basenamer4r5r6r7r+rr
rrA)rZtarget_descr@rCr;rrrZexport_symbolsrAr-r.Z
build_temprBr/Zlib_optsZld_argsZlinker�i�offsetr2r"r"r#�link�sZ�
���

zUnixCCompiler.linkcCsd|S)N�-Lr")r�dirr"r"r#�library_dir_option�sz UnixCCompiler.library_dir_optioncCsd|kpd|kS)NZgcczg++r")rZ
compiler_namer"r"r#�_is_gcc�szUnixCCompiler._is_gcccCs�tj�t�d��}tjdd�dkr,d|Stjdd�dkrFd|Stjdd�d	krz|�|�rnd
d|gSdd|gS|�|�r�t�d�d
kr�d|Sd|Snd|SdS)N�CCrrrQ�Zfreebsdz-Wl,-rpath=�zhp-uxz-Wl,+sz+sZGNULDZyesz-Wl,--enable-new-dtags,-Rz-Wl,-Rz-R)r(r)rMrrr4r5rT)rrRrr"r"r#�runtime_library_dir_option�s


z(UnixCCompiler.runtime_library_dir_optioncCsd|S)Nz-lr")r�libr"r"r#�library_optionszUnixCCompiler.library_optioncCs�|j|dd�}|j|dd�}|j|dd�}|j|dd�}tjdkr|t�d�}t�d|�}	|	dkrrt�t�d	��}
n
|	�	d
�}
|D�] }t
j�||�}t
j�||�}
t
j�||�}t
j�||�}tjdk�rL|�
d�s�|�
d��rL|�
d
��sLt
j�|
|d
d�|�}t
j�|
|d
d�|�}
t
j�|
|d
d�|�}t
j�|
|d
d�|�}t
j�|
��rb|
St
j�|��rx|St
j�|��r�|St
j�|�r�|Sq�dS)N�shared)Zlib_type�dylib�
xcode_stub�staticrZCFLAGSz-isysroot\s*(\S+)rUrFz/System/z/usr/z/usr/local/)r>r4r5rr�re�searchr6Z_default_sysroot�groupr(r)rL�
startswith�exists)r�dirsrYrAZshared_fZdylib_fZxcode_stub_fZstatic_fZcflags�mZsysrootrRr[r\r^r]r"r"r#�find_library_filesF



���
zUnixCCompiler.find_library_file)NNNNN)NrN)
NNNNNrNNNN)r)�__name__�
__module__�__qualname__Z
compiler_typeZexecutablesr4r5Zsrc_extensionsZ
obj_extensionZstatic_lib_extensionZshared_lib_extensionZdylib_lib_extensionZxcode_stub_lib_extensionZstatic_lib_formatZshared_lib_formatZdylib_lib_formatZxcode_stub_lib_formatZ
exe_extensionrr3r:rDrPrSrTrXrZrf�
__classcell__r"r"r r#r
-sb�


	�
�
�
B*r
)�__doc__r(r4r_Z	distutilsrZdistutils.dep_utilrZdistutils.ccompilerrrrZdistutils.errorsrrr	r
rr5r6r
r"r"r"r#�<module>s
distutils/__pycache__/util.cpython-38.opt-1.pyc000064400000036274151153537450015371 0ustar00U

e5d�Q�@sdZddlZddlZddlZddlZddlZddlmZddl	m
Z
ddlmZddl
mZddlmZdd	�Zd
d�Zdd
�Zdd�Zdadd�Zdd�Zd*dd�Zdaaadd�Zdd�Zd+dd�Zdd�Zd,d d!�Zd"d#�Z d-d$d%�Z!d.d&d'�Z"Gd(d)�d)�Z#dS)/zudistutils.util

Miscellaneous utility functions -- anything that doesn't fit into
one of the other *util.py modules.
�N)�DistutilsPlatformError)�newer)�spawn)�log)�DistutilsByteCompileErrorc
Cs�tjdkrFdtj��krdSdtj��kr.dSdtj��kr@dStjSdtjkrZtjdStjd	ksnttd
�sttjSt��\}}}}}|���	dd�}|�	d
d�}|�	dd�}|dd�dkr�d||fS|dd�dk�r,|ddk�r�d}dt
|d�d|dd�f}ddd�}|d|tj7}n�|dd�dk�rLd |||fS|dd!�d"k�r�d"}t�
d#tj�}|�|�}|�r�|��}n>|dd!�d$k�r�ddl}ddl}	|�|	j��|||�\}}}d%|||fS)&a�Return a string that identifies the current platform.  This is used mainly to
    distinguish platform-specific build directories and platform-specific built
    distributions.  Typically includes the OS name and version and the
    architecture (as supplied by 'os.uname()'), although the exact information
    included depends on the OS; eg. on Linux, the kernel version isn't
    particularly important.

    Examples of returned values:
       linux-i586
       linux-alpha (?)
       solaris-2.6-sun4u

    Windows will return one of:
       win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc)
       win32 (all others - specifically, sys.platform is returned)

    For other non-POSIX platforms, currently just returns 'sys.platform'.

    �ntZamd64�	win-amd64z(arm)�	win-arm32z(arm64)z	win-arm64Z_PYTHON_HOST_PLATFORM�posix�uname�/�� �_�-N�Zlinuxz%s-%sZsunosr�5Zsolarisz%d.%s��Z32bitZ64bit)i���l����z.%sZaixz%s-%s.%s��cygwinz[\d.]+�darwinz%s-%s-%s)�os�name�sys�version�lower�platform�environ�hasattrr�replace�int�maxsize�re�compile�ASCII�match�group�_osx_supportZdistutils.sysconfigZget_platform_osxZ	sysconfigZget_config_vars)
ZosnameZhost�releaser�machineZbitnessZrel_re�mr(�	distutils�r-�&/usr/lib64/python3.8/distutils/util.py�get_host_platformsR


 


�
r/cCs8tjdkr.dddd�}|�tj�d��p,t�St�SdS)NrZwin32rr	)Zx86Zx64ZarmZVSCMD_ARG_TGT_ARCH)rr�getrr/)ZTARGET_TO_PLATr-r-r.�get_platformas
�r1cCsztjdkr|S|s|S|ddkr.td|��|ddkrFtd|��|�d�}d|krd|�d�qP|sntjStjj|�S)a�Return 'pathname' as a name that will work on the native filesystem,
    i.e. split it on '/' and put it back together again using the current
    directory separator.  Needed because filenames in the setup script are
    always supplied in Unix style, and have to be converted to the local
    convention before we can actually use them in the filesystem.  Raises
    ValueError on non-Unix-ish systems if 'pathname' either starts or
    ends with a slash.
    rrzpath '%s' cannot be absolute���zpath '%s' cannot end with '/'�.)r�sep�
ValueError�split�remove�curdir�path�join)�pathname�pathsr-r-r.�convert_pathls	

r=cCs�tjdkr<tj�|�s$tj�||�Stj�||dd��SnNtjdkr|tj�|�\}}|ddkrn|dd�}tj�||�Stdtj��dS)a	Return 'pathname' with 'new_root' prepended.  If 'pathname' is
    relative, this is equivalent to "os.path.join(new_root,pathname)".
    Otherwise, it requires making 'pathname' relative and then joining the
    two, which is tricky on DOS/Windows and Mac OS.
    r
�Nrr�\z!nothing known about platform '%s')rrr9�isabsr:�
splitdriver)Znew_rootr;Zdriver9r-r-r.�change_root�s

rBc	CsxtrdStjdkrZdtjkrZz$ddl}|�t���dtjd<Wnttfk
rXYnXdtjkrpt	�tjd<dadS)aLEnsure that 'os.environ' has all the environment variables we
    guarantee that users can use in config files, command-line options,
    etc.  Currently this includes:
      HOME - user's home directory (Unix only)
      PLAT - description of the current platform, including hardware
             and OS (see 'get_platform()')
    Nr
�HOMErrZPLATr>)
�_environ_checkedrrr�pwd�getpwuid�getuid�ImportError�KeyErrorr1)rEr-r-r.�
check_environ�s	
rJc
CsVt�|fdd�}zt�d||�WStk
rP}ztd|��W5d}~XYnXdS)a�Perform shell/Perl-style variable substitution on 'string'.  Every
    occurrence of '$' followed by a name is considered a variable, and
    variable is substituted by the value found in the 'local_vars'
    dictionary, or in 'os.environ' if it's not in 'local_vars'.
    'os.environ' is first checked/augmented to guarantee that it contains
    certain values: see 'check_environ()'.  Raise ValueError for any
    variables not found in either 'local_vars' or 'os.environ'.
    cSs,|�d�}||krt||�Stj|SdS)Nr>)r'�strrr)r&�
local_varsZvar_namer-r-r.�_subst�s
zsubst_vars.<locals>._substz\$([a-zA-Z_][a-zA-Z_0-9]*)zinvalid variable '$%s'N)rJr#�subrIr5)�srLrM�varr-r-r.�
subst_vars�s	rQ�error: cCs|t|�S�N)rK)�exc�prefixr-r-r.�grok_environment_error�srVcCs(t�dtj�at�d�at�d�adS)Nz
[^\\\'\"%s ]*z'(?:[^'\\]|\\.)*'z"(?:[^"\\]|\\.)*")r#r$�string�
whitespace�
_wordchars_re�
_squote_re�
_dquote_rer-r-r-r.�_init_regex�s
r\cCs�tdkrt�|��}g}d}|�r�t�||�}|��}|t|�krZ|�|d|���q�||tjkr�|�|d|��||d��	�}d}n�||dkr�|d|�||dd�}|d}n�||dkr�t
�||�}n*||dkr�t�||�}ntd||��|dk�r t
d||��|��\}}|d|�||d|d�||d�}|��d	}|t|�kr|�|��q�q|S)
aSplit a string up according to Unix shell-like rules for quotes and
    backslashes.  In short: words are delimited by spaces, as long as those
    spaces are not escaped by a backslash, or inside a quoted string.
    Single and double quotes are equivalent, and the quote characters can
    be backslash-escaped.  The backslash is stripped from any two-character
    escape sequence, leaving only the escaped character.  The quote
    characters are stripped from any quoted string.  Returns a list of
    words.
    Nrr?r>�'�"z!this can't happen (bad char '%c')z"bad string (mismatched %s quotes?)r)rYr\�stripr&�end�len�appendrWrX�lstriprZr[�RuntimeErrorr5�span)rOZwords�posr+r`Zbegr-r-r.�split_quoted�s@

,
rgcCsP|dkr6d|j|f}|dd�dkr6|dd�d}t�|�|sL||�dS)a�Perform some action that affects the outside world (eg.  by
    writing to the filesystem).  Such actions are special because they
    are disabled by the 'dry_run' flag.  This method takes care of all
    that bureaucracy for you; all you have to do is supply the
    function to call and an argument tuple for it (to embody the
    "external action" being performed), and an optional message to
    print.
    Nz%s%r���z,)r�))�__name__r�info)�func�args�msg�verbose�dry_runr-r-r.�executes	
rqcCs2|��}|dkrdS|dkr dStd|f��dS)z�Convert a string representation of truth to true (1) or false (0).

    True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values
    are 'n', 'no', 'f', 'false', 'off', and '0'.  Raises ValueError if
    'val' is anything else.
    )�yZyes�t�trueZon�1r>)�nZno�fZfalseZoff�0rzinvalid truth value %rN)rr5)�valr-r-r.�	strtobool2srzr>c	CsTddl}tjrtd��|dkr*do(|dk}|�s@zddlm}	|	d�\}
}Wn.tk
rzddlm}d|d�}
}YnXt�	d|�|s�|
dk	r�t
�|
d	�}
n
t|d	�}
|
�B|
�
d
�|
�
d�tt|��d�|
�
d
|||||f�W5QRXtjg}|�|���|�|�t||d�tt
j|fd||d��nddlm}|D]�}|dd�dk�rj�qP|dk�r�|dk�r�dn|}tjj||d�}ntj�|�}|}|�r�|dt|��|k�r�td||f��|t|�d�}|�r�t
j�||�}t
j� |�}|�rP|�st!||��r>t�	d||�|�sL||||�nt�"d||��qPdS)a~Byte-compile a collection of Python source files to .pyc
    files in a __pycache__ subdirectory.  'py_files' is a list
    of files to compile; any files that don't end in ".py" are silently
    skipped.  'optimize' must be one of the following:
      0 - don't optimize
      1 - normal optimization (like "python -O")
      2 - extra optimization (like "python -OO")
    If 'force' is true, all files are recompiled regardless of
    timestamps.

    The source filename encoded in each bytecode file defaults to the
    filenames listed in 'py_files'; you can modify these with 'prefix' and
    'basedir'.  'prefix' is a string that will be stripped off of each
    source filename, and 'base_dir' is a directory name that will be
    prepended (after 'prefix' is stripped).  You can supply either or both
    (or neither) of 'prefix' and 'base_dir', as you wish.

    If 'dry_run' is true, doesn't actually do anything that would
    affect the filesystem.

    Byte-compilation is either done directly in this interpreter process
    with the standard py_compile module, or indirectly by writing a
    temporary script and executing it.  Normally, you should let
    'byte_compile()' figure out to use direct compilation or not (see
    the source for details).  The 'direct' flag is used by the script
    generated in indirect mode; unless you know what you're doing, leave
    it set to None.
    rNzbyte-compiling is disabled.F)�mkstemp�.py)�mktempz$writing byte-compilation script '%s'�wz2from distutils.util import byte_compile
files = [
z,
z]
z�
byte_compile(files, optimize=%r, force=%r,
             prefix=%r, base_dir=%r,
             verbose=%r, dry_run=0,
             direct=1)
)rpzremoving %s)r$���r
)�optimizationz1invalid prefix: filename %r doesn't start with %rzbyte-compiling %s to %sz%skipping byte-compilation of %s to %s)#�
subprocessr�dont_write_bytecoderZtempfiler{rHr}rrkr�fdopen�open�writer:�map�repr�
executable�extendZ"_optim_args_from_interpreter_flagsrbrrqr7�
py_compiler$�	importlib�util�cache_from_sourcerar5r9�basenamer�debug)Zpy_files�optimizeZforcerUZbase_dirrorpZdirectr�r{Z	script_fdZscript_namer}Zscript�cmdr$�file�opt�cfile�dfileZ
cfile_baser-r-r.�byte_compileBsx$

�
�

���r�cCs|�d�}d}|�|�S)z�Return a version of the string escaped for inclusion in an
    RFC-822 header, by ensuring there are 8 spaces space after each newline.
    �
z	
        )r6r:)�header�linesr4r-r-r.�
rfc822_escape�s
r�cCsV|sdSddlm}m}Gdd�d|�}|dkr8|d�}|||d�}|j|dd	�dS)
aInvoke 2to3 on a list of Python files.
    The files should all come from the build area, as the
    modification is done in-place. To reduce the build time,
    only files modified since the last invocation of this
    function should be passed in the files argument.Nr)�RefactoringTool�get_fixers_from_packagec@s$eZdZdd�Zdd�Zdd�ZdS)z*run_2to3.<locals>.DistutilsRefactoringToolc_stj|f|��dSrS)r�error)�selfrnrm�kwr-r-r.�	log_error�sz4run_2to3.<locals>.DistutilsRefactoringTool.log_errorcWstj|f|��dSrS)rrk�r�rnrmr-r-r.�log_message�sz6run_2to3.<locals>.DistutilsRefactoringTool.log_messagecWstj|f|��dSrS)rr�r�r-r-r.�	log_debug�sz4run_2to3.<locals>.DistutilsRefactoringTool.log_debugN)rj�
__module__�__qualname__r�r�r�r-r-r-r.�DistutilsRefactoringTool�sr�z
lib2to3.fixes)�optionsT)r�)Zlib2to3.refactorr�r�Zrefactor)�files�fixer_namesr��explicitr�r�r��rr-r-r.�run_2to3�s
r�c	Csddlm}ddlm}ddlm}|�}	t��}
t�|�z|	�	�W5t�|
�X|	j
|	jdd�<|r�|��D]}|�
�}|s�qr|	�|�qrg}|	jD]L}
tj�||
�}|tj�|��|tj�||
�|dd�}|dr�|�|�q�tdd	�|D�|||d
�|S)z�Recursively copy a directory, only copying new and changed files,
    running run_2to3 over all newly copied Python modules afterward.

    If you give a template string, it's parsed like a MANIFEST.in.
    r)�mkpath)�	copy_file)�FileListNr>)�updatecSsg|]}|���d�r|�qS)r|)r�endswith)�.0�fnr-r-r.�
<listcomp>sz$copydir_run_2to3.<locals>.<listcomp>)r�r�r�)Zdistutils.dir_utilr�Zdistutils.file_utilr�Zdistutils.filelistr�r�getcwd�chdir�findallZallfilesr��
splitlinesr_Zprocess_template_liner9r:�dirnamerbr�)�src�dest�templater�r�r�r�r�r�Zfilelistr8�lineZcopied�filenameZoutname�resr-r-r.�copydir_run_2to3�s:

�r�c@s$eZdZdZdZdZdZdd�ZdS)�	Mixin2to3z�Mixin class for commands that run 2to3.
    To configure 2to3, setup scripts may either change
    the class variables, or inherit from individual commands
    to override how 2to3 is invoked.NcCst||j|j|j�SrS)r�r�r�r�)r�r�r-r-r.r�-szMixin2to3.run_2to3)rjr�r��__doc__r�r�r�r�r-r-r-r.r�s
r�)rR)Nrr)rrNNr>rN)NNN)NNNN)$r�rr#�importlib.utilr�rWrZdistutils.errorsrZdistutils.dep_utilrZdistutils.spawnrr,rrr/r1r=rBrDrJrQrVrYrZr[r\rgrqrzr�r�r�r�r�r-r-r-r.�<module>sNO
=
�


�
!distutils/__pycache__/config.cpython-38.opt-2.pyc000064400000006060151153537450015650 0ustar00U

e5d��@s8ddlZddlmZddlmZdZGdd�de�ZdS)�N)�RawConfigParser)�CommandzE[distutils]
index-servers =
    pypi

[pypi]
username:%s
password:%s
c@sdeZdZdZdZdZdZdddefdgZdgZd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�ZdS)�
PyPIRCCommandzhttps://upload.pypi.org/legacy/�pypiNzrepository=�rzurl of repository [default: %s])�
show-responseNz&display full response text from serverrcCstj�tj�d�d�S)N�~z.pypirc)�os�path�join�
expanduser��self�r�(/usr/lib64/python3.8/distutils/config.py�_get_rc_file&szPyPIRCCommand._get_rc_filec	CsH|��}t�t�|tjtjBd�d��}|�t||f�W5QRXdS)Ni��w)rr	�fdopen�open�O_CREAT�O_WRONLY�write�DEFAULT_PYPIRC)r�username�password�rc�frrr�
_store_pypirc*s zPyPIRCCommand._store_pypirccCs�|��}tj�|��r�|�d|�|jp.|j}t�}|�|�|�	�}d|k�rF|�
dd�}dd�|�d�D�}|gkr�d|kr�dg}niS|D]�}d|i}|�
|d	�|d	<d
|jfd|jfdfD].\}	}
|�
||	�r�|�
||	�||	<q�|
||	<q�|dk�r ||jdfk�r |j|d
<|S|d|k�s:|d
|kr�|Sq�nRd
|k�r�d
}|�
|d
��rp|�
|d
�}n|j}|�
|d	�|�
|d�|||jd�SiS)NzUsing PyPI login from %sZ	distutilsz
index-serverscSs g|]}|��dkr|���qS)�)�strip)�.0�serverrrr�
<listcomp>=s�z.PyPIRCCommand._read_pypirc.<locals>.<listcomp>�
rr!r�
repository�realm)rNzserver-loginr)rrr$r!r%)rr	r
�existsZannouncer$�DEFAULT_REPOSITORYr�read�sections�get�split�
DEFAULT_REALMZ
has_option)rrr$Zconfigr)Z
index_serversZ_serversr!Zcurrent�key�defaultrrr�_read_pypirc0sb

���

�

�


�zPyPIRCCommand._read_pypirccCs8ddl}|�dd�}|�|�d�dd�}|���|�S)Nrzcontent-typez
text/plain��charset�ascii)�cgiZ	getheaderZparse_headerr*r(�decode)rZresponser3Zcontent_type�encodingrrr�_read_pypi_responsepsz!PyPIRCCommand._read_pypi_responsecCsd|_d|_d|_dS)Nr)r$r%Z
show_responser
rrr�initialize_optionswsz PyPIRCCommand.initialize_optionscCs(|jdkr|j|_|jdkr$|j|_dS)N)r$r'r%r,r
rrr�finalize_options}s

zPyPIRCCommand.finalize_options)�__name__�
__module__�__qualname__r'r,r$r%Zuser_optionsZboolean_optionsrrr/r6r7r8rrrrrs$���@r)r	ZconfigparserrZ
distutils.cmdrrrrrrr�<module>s
distutils/__pycache__/dir_util.cpython-38.opt-2.pyc000064400000006567151153537450016232 0ustar00U

e5db�@slddlZddlZddlmZmZddlmZiaddd�Zddd	�Z	dd
d�Z
dd
�Zddd�Zdd�Z
dS)�N)�DistutilsFileError�DistutilsInternalError)�log��cCsft|t�std|f��tj�|�}g}tj�|�s<|dkr@|St�tj�	|��rV|Stj�
|�\}}|g}|r�|r�tj�|�s�tj�
|�\}}|�d|�ql|D]�}tj�||�}tj�	|�}	t�|	�r�q�|dkr�t
�d|�|�sXzt�||�WnVtk
�rL}
z6|
jtjk�r&tj�|��s<td||
jdf��W5d}
~
XYnX|�|�dt|	<q�|S)Nz(mkpath: 'name' must be a string (got %r)�rrzcreating %szcould not create '%s': %s���)�
isinstance�strr�os�path�normpath�isdir�
_path_created�get�abspath�split�insert�joinr�info�mkdir�OSError�errnoZEEXISTr�args�append)�name�mode�verbose�dry_runZcreated_dirs�head�tailZtails�dZabs_head�exc�r#�*/usr/lib64/python3.8/distutils/dir_util.py�mkpathsB
�
�

r%c	CsNt�}|D] }|�tj�|tj�|���q
t|�D]}t||||d�q4dS)N�rr)�set�addrrr�dirname�sortedr%)Zbase_dir�filesrrrZneed_dir�file�dirr#r#r$�create_treePs
r.c
Cs^ddlm}|s(tj�|�s(td|��zt�|�}	Wn>tk
rt}
z |rRg}	ntd||
jf��W5d}
~
XYnX|s�t	||d�g}|	D]�}tj�
||�}
tj�
||�}|�d�r�q�|�r
tj�|
��r
t�
|
�}|dkr�t�d||�|s�t�||�|�|�q�tj�|
��r8|�t|
|||||||d	��q�||
||||||d	�|�|�q�|S)
Nr)�	copy_filez&cannot copy tree '%s': not a directoryzerror listing files in '%s': %s)rz.nfsrzlinking %s -> %sr&)Zdistutils.file_utilr/rrrr�listdirr�strerrorr%r�
startswith�islink�readlinkrr�symlinkr�extend�	copy_tree)�srcZdstZ
preserve_modeZpreserve_timesZpreserve_symlinks�updaterrr/�names�eZoutputs�nZsrc_nameZdst_nameZ	link_destr#r#r$r7cs\��

���r7cCsft�|�D]F}tj�||�}tj�|�r@tj�|�s@t||�q
|�tj|f�q
|�tj	|f�dS)N)
rr0rrrr3�_build_cmdtupler�remove�rmdir)r�	cmdtuples�fZreal_fr#r#r$r=�sr=cCs�|dkrt�d|�|rdSg}t||�|D]h}z2|d|d�tj�|d�}|tkrbt|=Wq.tk
r�}zt�d||�W5d}~XYq.Xq.dS)Nrz'removing '%s' (and everything under it)rzerror removing %s: %s)	rrr=rrrrr�warn)Z	directoryrrr@�cmdrr"r#r#r$�remove_tree�s

rDcCs6tj�|�\}}|dd�tjkr2||dd�}|S)Nrr)rr�
splitdrive�sep)rZdriver#r#r$�ensure_relative�srG)rrr)rrr)rrrrrr)rr)rrZdistutils.errorsrrZ	distutilsrrr%r.r7r=rDrGr#r#r#r$�<module>s
?
�
E

distutils/__pycache__/errors.cpython-38.opt-2.pyc000064400000005220151153537450015714 0ustar00U

e5d�
�@s4Gdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd	�d	e�ZGd
d�de�ZGdd
�d
e�ZGdd�de�ZGdd�de�Z	Gdd�de�Z
Gdd�de�ZGdd�de�ZGdd�de�Z
Gdd�de�ZGdd�de�ZGdd�de�ZGd d!�d!e�ZGd"d#�d#e�ZGd$d%�d%e�Zd&S)'c@seZdZdS)�DistutilsErrorN��__name__�
__module__�__qualname__�rr�(/usr/lib64/python3.8/distutils/errors.pyrsrc@seZdZdS)�DistutilsModuleErrorNrrrrrrsrc@seZdZdS)�DistutilsClassErrorNrrrrrr	sr	c@seZdZdS)�DistutilsGetoptErrorNrrrrrr
sr
c@seZdZdS)�DistutilsArgErrorNrrrrrrsrc@seZdZdS)�DistutilsFileErrorNrrrrrr$src@seZdZdS)�DistutilsOptionErrorNrrrrrr
*sr
c@seZdZdS)�DistutilsSetupErrorNrrrrrr3src@seZdZdS)�DistutilsPlatformErrorNrrrrrr8src@seZdZdS)�DistutilsExecErrorNrrrrrr>src@seZdZdS)�DistutilsInternalErrorNrrrrrrCsrc@seZdZdS)�DistutilsTemplateErrorNrrrrrrHsrc@seZdZdS)�DistutilsByteCompileErrorNrrrrrrKsrc@seZdZdS)�CCompilerErrorNrrrrrrOsrc@seZdZdS)�PreprocessErrorNrrrrrrRsrc@seZdZdS)�CompileErrorNrrrrrrUsrc@seZdZdS)�LibErrorNrrrrrrXsrc@seZdZdS)�	LinkErrorNrrrrrr\src@seZdZdS)�UnknownFileErrorNrrrrrr`srN)�	Exceptionrrr	r
rrr
rrrrrrrrrrrrrrrr�<module>s$	distutils/__pycache__/dep_util.cpython-38.opt-2.pyc000064400000002370151153537450016210 0ustar00U

e5d�
�@s2ddlZddlmZdd�Zdd�Zd
dd	�ZdS)�N)�DistutilsFileErrorcCs`tj�|�s tdtj�|���tj�|�s0dSddlm}t�|�|}t�|�|}||kS)Nzfile '%s' does not exist�r��ST_MTIME)�os�path�existsr�abspath�statr)�source�targetrZmtime1Zmtime2�r
�*/usr/lib64/python3.8/distutils/dep_util.py�newers
�rcCsht|�t|�krtd��g}g}tt|��D]2}t||||�r,|�||�|�||�q,||fS)Nz+'sources' and 'targets' must be same length)�len�
ValueError�ranger�append)�sourcesZtargetsZ	n_sourcesZ	n_targets�ir
r
r�newer_pairwise sr�errorcCs�tj�|�sdSddlm}t�|�|}|D]P}tj�|�sb|dkrHn|dkrTq.n|dkrbdSt�|�|}||kr.dSq.dS)Nrrrr�ignorer)rrrr
r)rrZmissingrZtarget_mtimer�source_mtimer
r
r�newer_group6s r)r)rZdistutils.errorsrrrrr
r
r
r�<module>sdistutils/__pycache__/cmd.cpython-38.opt-2.pyc000064400000017624151153537450015156 0ustar00U

e5d�F�@s^ddlZddlZddlZddlmZddlmZmZmZm	Z	m
Z
ddlmZGdd�d�ZdS)�N)�DistutilsOptionError)�util�dir_util�	file_util�archive_util�dep_util��logc@seZdZgZdd�Zdd�Zdd�Zdd�Zd	d
�ZdBd
d�Z	dd�Z
dCdd�Zdd�ZdDdd�Z
dEdd�Zdd�ZdFdd�Zdd�Zd d!�Zd"d#�Zd$d%�ZdGd&d'�ZdHd)d*�Zd+d,�Zd-d.�Zd/d0�ZdId1d2�ZdJd4d5�ZdKd6d7�ZdLd8d9�ZdMd:d;�ZdNd<d=�ZdOd>d?�Z dPd@dA�Z!dS)Q�CommandcCsbddlm}t||�std��|jtkr0td��||_|��d|_	|j
|_
d|_d|_d|_
dS)Nr)�Distributionz$dist must be a Distribution instancezCommand is an abstract class)Zdistutils.distr�
isinstance�	TypeError�	__class__r
�RuntimeError�distribution�initialize_optionsZ_dry_run�verbose�force�help�	finalized)�selfZdistr�r�%/usr/lib64/python3.8/distutils/cmd.py�__init__/s


zCommand.__init__cCs<|dkr0t|d|�}|dkr*t|j|�S|Snt|��dS)N�dry_run�_)�getattrr�AttributeError)r�attrZmyvalrrr�__getattr___szCommand.__getattr__cCs|js|��d|_dS)N�)r�finalize_options�rrrr�ensure_finalizediszCommand.ensure_finalizedcCstd|j��dS�Nz,abstract method -- subclass %s must override�rrr"rrrr{s
�zCommand.initialize_optionscCstd|j��dSr$r%r"rrrr!�s�zCommand.finalize_optionsN�cCs�ddlm}|dkr d|��}|j||tjd�|d}|jD]R\}}}|�|�}|ddkrn|dd�}t||�}|j|d||ftjd�qBdS)	Nr)�
longopt_xlatezcommand options for '%s':)�levelz  ����=z%s = %s)	Zdistutils.fancy_getoptr'�get_command_name�announcer	�INFOZuser_options�	translater)r�header�indentr'�optionr�valuerrr�dump_options�s

�zCommand.dump_optionscCstd|j��dSr$r%r"rrr�run�s
�zCommand.runr cCst�||�dS�Nr)r�msgr(rrrr,�szCommand.announcecCs&ddlm}|r"t|�tj��dS)Nr)�DEBUG)Zdistutils.debugr7�print�sys�stdout�flush)rr6r7rrr�debug_print�szCommand.debug_printcCsBt||�}|dkr"t|||�|St|t�s>td|||f��|S)Nz'%s' must be a %s (got `%s`))r�setattrr�strr)rr1�what�default�valrrr�_ensure_stringlike�s

�zCommand._ensure_stringlikecCs|�|d|�dS)N�string)rB)rr1r@rrr�
ensure_string�szCommand.ensure_stringcCspt||�}|dkrdSt|t�r6t||t�d|��n6t|t�rTtdd�|D��}nd}|sltd||f��dS)Nz,\s*|\s+css|]}t|t�VqdSr5)rr>)�.0�vrrr�	<genexpr>�sz-Command.ensure_string_list.<locals>.<genexpr>Fz''%s' must be a list of strings (got %r))	rrr>r=�re�split�list�allr)rr1rA�okrrr�ensure_string_list�s


��zCommand.ensure_string_listcCs6|�|||�}|dk	r2||�s2td|||f��dS)Nzerror in '%s' option: )rBr)rr1Ztesterr?Z	error_fmtr@rArrr�_ensure_tested_string�s
�zCommand._ensure_tested_stringcCs|�|tjjdd�dS)N�filenamez$'%s' does not exist or is not a file)rN�os�path�isfile�rr1rrr�ensure_filename�s�zCommand.ensure_filenamecCs|�|tjjdd�dS)Nzdirectory namez)'%s' does not exist or is not a directory)rNrPrQ�isdirrSrrr�ensure_dirnames�zCommand.ensure_dirnamecCst|d�r|jS|jjSdS)N�command_name)�hasattrrWr�__name__r"rrrr+	s
zCommand.get_command_namecGsF|j�|�}|��|D](\}}t||�dkrt||t||��qdSr5)r�get_command_objr#rr=)rZsrc_cmdZoption_pairsZsrc_cmd_objZ
src_optionZ
dst_optionrrr�set_undefined_optionss
zCommand.set_undefined_optionscCs|j�||�}|��|Sr5)rrZr#)r�commandZcreateZcmd_objrrr�get_finalized_command$szCommand.get_finalized_commandrcCs|j�||�Sr5)r�reinitialize_command)rr\Zreinit_subcommandsrrrr^0s�zCommand.reinitialize_commandcCs|j�|�dSr5)r�run_command)rr\rrrr_4szCommand.run_commandcCs2g}|jD]"\}}|dks"||�r
|�|�q
|Sr5)�sub_commands�append)rZcommandsZcmd_name�methodrrr�get_sub_commands;s
zCommand.get_sub_commandscCst�d|��|�dS)Nzwarning: %s: %s
)r	�warnr+)rr6rrrrdKszCommand.warncCstj||||jd�dS�N�r)r�executer)r�func�argsr6r(rrrrgNszCommand.execute�cCstj|||jd�dSre)r�mkpathr)r�name�moderrrrkQszCommand.mkpathc	Cstj|||||j||jd�Sre)r�	copy_filerr)r�infile�outfile�
preserve_mode�preserve_times�linkr(rrrrnTs
�zCommand.copy_filec	Cstj||||||j|jd�Sre)r�	copy_treerr)rrorprqrrZpreserve_symlinksr(rrrrt]s
�zCommand.copy_treecCstj|||jd�Sre)r�	move_filer)r�srcZdstr(rrrrufszCommand.move_filecCs ddlm}||||jd�dS)Nr)�spawnrf)Zdistutils.spawnrwr)r�cmdZsearch_pathr(rwrrrrwjsz
Command.spawnc	Cstj|||||j||d�S)N)r�owner�group)r�make_archiver)rZ	base_name�formatZroot_dirZbase_dirryrzrrrr{os
�zCommand.make_archivecCs�|dkrd|}t|t�r"|f}nt|ttf�s8td��|dkrRd|d�|�f}|jsdt�||�rv|�	||||�n
t
�|�dS)Nzskipping %s (inputs unchanged)z9'infiles' must be a string, or a list or tuple of stringszgenerating %s from %sz, )rr>rJ�tupler
�joinrrZnewer_grouprgr	�debug)rZinfilesrprhriZexec_msgZskip_msgr(rrr�	make_fileus

�zCommand.make_file)Nr&)r )N)N)N)r )r)Nr )rj)r r Nr )r r rr )r )r r )NNNN)NNr )"rY�
__module__�__qualname__r`rrr#rr!r3r4r,r<rBrDrMrNrTrVr+r[r]r^r_rcrdrgrkrnrtrurwr{r�rrrrr
sX0






�




�
	�
	

�
�r
)
r9rPrHZdistutils.errorsrZ	distutilsrrrrrr	r
rrrr�<module>sdistutils/__pycache__/spawn.cpython-38.opt-1.pyc000064400000011764151153537450015541 0ustar00U

e5d��@s�dZddlZddlZddlmZmZddlmZddlm	Z	ddd�Z
d	d
�Zddd�Zej
d
krjdadaddd�Zddd�ZdS)z�distutils.spawn

Provides the 'spawn()' function, a front-end to various platform-
specific functions for launching another program in a sub-process.
Also provides the 'find_executable()' to search the path for a given
executable name.
�N)�DistutilsPlatformError�DistutilsExecError)�DEBUG)�log�cCsNt|�}tjdkr"t|||d�n(tjdkr<t|||d�ntdtj��dS)a�Run another program, specified as a command list 'cmd', in a new process.

    'cmd' is just the argument list for the new process, ie.
    cmd[0] is the program to run and cmd[1:] are the rest of its arguments.
    There is no way to run a program with a name different from that of its
    executable.

    If 'search_path' is true (the default), the system's executable
    search path will be used to find the program; otherwise, cmd[0]
    must be the exact path to the executable.  If 'dry_run' is true,
    the command will not actually be run.

    Raise DistutilsExecError if running the program fails in any way; just
    return on success.
    �posix)�dry_run�ntz1don't know how to spawn programs on platform '%s'N)�list�os�name�_spawn_posix�	_spawn_ntr)�cmd�search_path�verboser�r�'/usr/lib64/python3.8/distutils/spawn.py�spawns

�rcCs*t|�D]\}}d|krd|||<q|S)z�Quote command-line arguments for DOS/Windows conventions.

    Just wraps every argument which contains blanks in double quotes, and
    returns a new argument list.
    � z"%s")�	enumerate)�args�i�argrrr�_nt_quote_args+src
Cs�|d}t|�}|r t|�p|}t�d�|g|dd���|s�zt�tj||�}Wn@tk
r�}z"t	sp|}t
d||jdf��W5d}~XYnX|dkr�t	s�|}t
d||f��dS)Nrrr�command %r failed: %s����%command %r failed with exit status %d)r�find_executabler�info�joinr�spawnv�P_WAIT�OSErrorrrr)rrrr�
executableZrc�excrrrr;s(�
�r�darwinc
Cs|t�d�|��|rdS|d}|r*tjp.tj}d}tjdkr�tdkrxddl	m
}|�d�p^datrxdd�t�d	�D�a
tr�tj�dt�}t
d
d�|�d	�D�kr�d|tf}	t|	��ttj|d�}|r�tjp�tj}t��}
|
dk�r�z$|dkr�|||�n||||�WnNtk
�rX}z.t�s(|}tj�d
||jf�t�d�W5d}~XYnXt�sd|}tj�d|�t�d�n�zt�|
d�\}
}WnDtk
�r�}
z$t�s�|}td||
jdf��W5d}
~
XYnXt�|��rt�s�|}td|t�|�f��nlt� |��rHt�!|�}|dk�r,dSt�s6|}td||f��n,t�"|��rZ�q�nt�sd|}td||f���q�dS)Nrrr&)�	sysconfig�MACOSX_DEPLOYMENT_TARGET�cSsg|]}t|��qSr��int��.0�xrrr�
<listcomp>esz _spawn_posix.<locals>.<listcomp>�.cSsg|]}t|��qSrr*r,rrrr/kszF$MACOSX_DEPLOYMENT_TARGET mismatch: now "%s" but "%s" during configure)r(zunable to execute %r: %s
rz(unable to execute %r for unknown reasonsrrz"command %r terminated by signal %drz1unknown error executing %r: termination status %d)#rrr r�execvp�execv�sys�platform�_cfg_target�	distutilsr'Zget_config_var�split�_cfg_target_split�environ�getr�dict�execvpe�execve�forkr#r�stderr�write�strerror�_exit�waitpidrr�WIFSIGNALED�WTERMSIG�	WIFEXITED�WEXITSTATUS�
WIFSTOPPED)rrrrr$Zexec_fn�envr'Z
cur_targetZmy_msg�pid�eZstatusr%Zexit_statusrrrr
Ws�
����
����

����r
c	Cs�tj�|�\}}tjdkr*|dkr*|d}tj�|�r:|S|dkr�tj�dd�}|dkr�zt�d�}Wnt	t
fk
r�tj}YnX|s�dS|�tj
�}|D]&}tj�||�}tj�|�r�|Sq�dS)z�Tries to find 'executable' in the directories listed in 'path'.

    A string listing directories separated by 'os.pathsep'; defaults to
    os.environ['PATH'].  Returns the complete filename or None if not found.
    Zwin32z.exeN�PATH�CS_PATH)r�path�splitextr3r4�isfiler9r:�confstr�AttributeError�
ValueError�defpathr7�pathsepr )r$rN�_Zext�paths�p�frrrr�s(
r)rrr)rrr)rrr)N)�__doc__r3rZdistutils.errorsrrZdistutils.debugrr6rrrrr4r5r8r
rrrrr�<module>s



Rdistutils/__pycache__/version.cpython-38.opt-1.pyc000064400000016144151153537450016073 0ustar00U

e5d90�@s>dZddlZGdd�d�ZGdd�de�ZGdd�de�ZdS)	a�Provides classes to represent module version numbers (one class for
each style of version numbering).  There are currently two such classes
implemented: StrictVersion and LooseVersion.

Every version number class implements the following interface:
  * the 'parse' method takes a string and parses it to some internal
    representation; if the string is an invalid version number,
    'parse' raises a ValueError exception
  * the class constructor takes an optional string argument which,
    if supplied, is passed to 'parse'
  * __str__ reconstructs the string that was passed to 'parse' (or
    an equivalent string -- ie. one that will generate an equivalent
    version number instance)
  * __repr__ generates Python code to recreate the version number instance
  * _cmp compares the current instance with either another instance
    of the same class or a string (which will be parsed to an instance
    of the same class, thus must follow the same rules)
�Nc@sJeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�Versionz�Abstract base class for version numbering classes.  Just provides
    constructor (__init__) and reproducer (__repr__), because those
    seem to be the same for all version numbering classes; and route
    rich comparisons to _cmp.
    NcCs|r|�|�dS�N��parse��self�vstring�r	�)/usr/lib64/python3.8/distutils/version.py�__init__&szVersion.__init__cCsd|jjt|�fS)Nz	%s ('%s'))�	__class__�__name__�str�rr	r	r
�__repr__*szVersion.__repr__cCs|�|�}|tkr|S|dkS�Nr��_cmp�NotImplemented�r�other�cr	r	r
�__eq__-s
zVersion.__eq__cCs|�|�}|tkr|S|dkSrrrr	r	r
�__lt__3s
zVersion.__lt__cCs|�|�}|tkr|S|dkSrrrr	r	r
�__le__9s
zVersion.__le__cCs|�|�}|tkr|S|dkSrrrr	r	r
�__gt__?s
zVersion.__gt__cCs|�|�}|tkr|S|dkSrrrr	r	r
�__ge__Es
zVersion.__ge__)N)r
�
__module__�__qualname__�__doc__rrrrrrrr	r	r	r
rs
rc@s<eZdZdZe�dejejB�Zdd�Z	dd�Z
dd�Zd	S)
�
StrictVersiona?Version numbering for anal retentives and software idealists.
    Implements the standard interface for version number classes as
    described above.  A version number consists of two or three
    dot-separated numeric components, with an optional "pre-release" tag
    on the end.  The pre-release tag consists of the letter 'a' or 'b'
    followed by a number.  If the numeric components of two version
    numbers are equal, then one with a pre-release tag will always
    be deemed earlier (lesser) than one without.

    The following are valid version numbers (shown in the order that
    would be obtained by sorting according to the supplied cmp function):

        0.4       0.4.0  (these two are equivalent)
        0.4.1
        0.5a1
        0.5b3
        0.5
        0.9.6
        1.0
        1.0.4a3
        1.0.4b1
        1.0.4

    The following are examples of invalid version numbers:

        1
        2.7.2.2
        1.3.a4
        1.3pl1
        1.3c4

    The rationale for this version numbering system will be explained
    in the distutils documentation.
    z)^(\d+) \. (\d+) (\. (\d+))? ([ab](\d+))?$cCs�|j�|�}|std|��|�ddddd�\}}}}}|rTttt|||g��|_nttt||g��d|_|r�|dt|�f|_nd|_dS)	Nzinvalid version number '%s'�����)rr)	�
version_re�match�
ValueError�group�tuple�map�int�version�
prerelease)rrr'�major�minorZpatchr.Zprerelease_numr	r	r
r�s�zStrictVersion.parsecCsb|jddkr*d�tt|jdd���}nd�tt|j��}|jr^||jdt|jd�}|S)Nr"r�.r!)r-�joinr+rr.rr	r	r
�__str__�szStrictVersion.__str__cCs�t|t�rt|�}|j|jkr2|j|jkr.dSdS|jsB|jsBdS|jrR|jsRdS|jsb|jrbdS|jr�|jr�|j|jkr~dS|j|jkr�dSdSndS)N���r!r)�
isinstancerr r-r.�rrr	r	r
r�s&
zStrictVersion._cmpN)r
rrr�re�compile�VERBOSE�ASCIIr&rr3rr	r	r	r
r ]s#
�
r c@sHeZdZdZe�dej�Zddd�Zdd�Z	dd	�Z
d
d�Zdd
�ZdS)�LooseVersiona�Version numbering for anarchists and software realists.
    Implements the standard interface for version number classes as
    described above.  A version number consists of a series of numbers,
    separated by either periods or strings of letters.  When comparing
    version numbers, the numeric components will be compared
    numerically, and the alphabetic components lexically.  The following
    are all valid version numbers, in no particular order:

        1.5.1
        1.5.2b2
        161
        3.10a
        8.02
        3.4j
        1996.07.12
        3.2.pl0
        3.1.1.6
        2g6
        11g
        0.960923
        2.2beta29
        1.13++
        5.5.kw
        2.0b1pl0

    In fact, there is no such thing as an invalid version number under
    this scheme; the rules for comparison are simple and predictable,
    but may not always give the results you want (for some definition
    of "want").
    z(\d+ | [a-z]+ | \.)NcCs|r|�|�dSrrrr	r	r
r.szLooseVersion.__init__c	Cs^||_dd�|j�|�D�}t|�D].\}}zt|�||<Wq$tk
rPYq$Xq$||_dS)NcSsg|]}|r|dkr|�qS)r1r	)�.0�xr	r	r
�
<listcomp>8s�z&LooseVersion.parse.<locals>.<listcomp>)r�component_re�split�	enumerater,r(r-)rrZ
components�i�objr	r	r
r3szLooseVersion.parsecCs|jSr)rrr	r	r
r3CszLooseVersion.__str__cCsdt|�S)NzLooseVersion ('%s'))rrr	r	r
rGszLooseVersion.__repr__cCsFt|t�rt|�}|j|jkr"dS|j|jkr2dS|j|jkrBdSdS)Nrr4r!)r5rr;r-r6r	r	r
rKs
zLooseVersion._cmp)N)
r
rrrr7r8r9r?rrr3rrr	r	r	r
r;s
r;)rr7rr r;r	r	r	r
�<module>
s
>/distutils/__pycache__/log.cpython-38.opt-1.pyc000064400000004415151153537450015165 0ustar00U

e5d��@sldZdZdZdZdZdZddlZGdd	�d	�Ze�Zej	Z	ej
Z
ejZejZej
Z
ejZd
d�Zdd
�ZdS)z,A simple log mechanism styled after PEP 282.������Nc@sPeZdZefdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�ZdS)�LogcCs
||_dS�N)�	threshold)�selfr	�r�%/usr/lib64/python3.8/distutils/log.py�__init__szLog.__init__cCs�|tttttfkr"tdt|���||jkr�|r8||}|tttfkrNtj	}ntj
}z|�d|�Wn:tk
r�|j
}|�|d��|�}|�d|�YnX|��dS)Nz%s wrong log levelz%s
�backslashreplace)�DEBUG�INFO�WARN�ERROR�FATAL�
ValueError�strr	�sys�stderr�stdout�write�UnicodeEncodeError�encoding�encode�decode�flush)r
�level�msg�args�streamrrrr�_logs
zLog._logcGs|�|||�dSr)r#)r
rr r!rrr�log'szLog.logcGs|�t||�dSr)r#r�r
r r!rrr�debug*sz	Log.debugcGs|�t||�dSr)r#rr%rrr�info-szLog.infocGs|�t||�dSr)r#rr%rrr�warn0szLog.warncGs|�t||�dSr)r#rr%rrr�error3sz	Log.errorcGs|�t||�dSr)r#rr%rrr�fatal6sz	Log.fatalN)�__name__�
__module__�__qualname__rr
r#r$r&r'r(r)r*rrrrrsrcCstj}|t_|Sr)�_global_logr	)r�oldrrr�
set_thresholdAsr0cCs8|dkrtt�n"|dkr$tt�n|dkr4tt�dS)Nrrr)r0rrr)�vrrr�
set_verbosityGs

r2)�__doc__rrrrrrrr.r$r&r'r(r)r*r0r2rrrr�<module>s +distutils/__pycache__/extension.cpython-38.opt-2.pyc000064400000006553151153537450016426 0ustar00U

e5d)�@s*ddlZddlZGdd�d�Zdd�ZdS)�Nc@seZdZddd�Zdd�ZdS)�	ExtensionNcKst|t�std��t|t�r.tdd�|D��s6td��||_||_|pHg|_|pRg|_|p\g|_	|pfg|_
|ppg|_|pzg|_|	p�g|_
|
p�g|_|p�g|_|p�g|_|
p�g|_|p�g|_||_||_t|�dk�rdd�|D�}d�t|��}d	|}t�|�dS)
Nz'name' must be a stringcss|]}t|t�VqdS)N)�
isinstance�str)�.0�v�r�+/usr/lib64/python3.8/distutils/extension.py�	<genexpr>jsz%Extension.__init__.<locals>.<genexpr>z#'sources' must be a list of stringsrcSsg|]}t|��qSr)�repr)rZoptionrrr�
<listcomp>�sz&Extension.__init__.<locals>.<listcomp>z, zUnknown Extension options: %s)rr�AssertionError�list�all�name�sources�include_dirs�
define_macros�undef_macros�library_dirs�	libraries�runtime_library_dirs�
extra_objects�extra_compile_args�extra_link_args�export_symbols�	swig_opts�depends�language�optional�len�join�sorted�warnings�warn)�selfrrrrrrrrrrrrrrrr�kwZoptions�msgrrr�__init__Vs6

�











zExtension.__init__cCsd|jj|jj|jt|�fS)Nz<%s.%s(%r) at %#x>)�	__class__�
__module__�__qualname__r�id)r$rrr�__repr__�s�zExtension.__repr__)NNNNNNNNNNNNNN)�__name__r)r*r'r,rrrrrs D�
/rcCs�ddlm}m}m}ddlm}ddlm}||�}||dddddd�}�z^g}|�	�}	|	dkrd�q�|�
|	�rpqP|	d|	dkr�dkr�nn|�d	|	�qP||	|�}	||	�}
|
d}t|g�}d}
|
dd�D�]�}|
dk	r�|
�
|�d}
q�tj�|�d}|dd
�}|d
d�}|dk�r2|j�
|�q�|dk�rJ|j�
|�q�|d
k�r�|�d�}|dk�rz|j�
|df�n$|j�
|d|�||d
d�f�q�|dk�r�|j�
|�q�|dk�r�|j�
|�q�|dk�r�|j�
|�q�|dk�r|j�
|�q�|dk�r|j�
|�q�|dk�r*|j}
q�|dk�r<|j}
q�|dk�rN|j}
q�|dk�rr|j�
|�|�s�|j}
q�|dk�r�|j�
|�q�|�d|�q�|�
|�qPW5|��X|S)Nr)�parse_makefile�expand_makefile_vars�_variable_rx)�TextFile)�split_quoted�)Zstrip_commentsZskip_blanksZ
join_linesZ	lstrip_wsZ	rstrip_ws����*z'%s' lines not handled yet�)z.cz.ccz.cppz.cxxz.c++z.mz.mmz-Iz-D�=z-Uz-Cz-lz-Lz-Rz-rpathz-Xlinkerz
-Xcompilerz-u)z.az.soz.slz.oz.dylibzunrecognized argument '%s')Zdistutils.sysconfigr.r/r0Zdistutils.text_filer1Zdistutils.utilr2�close�readline�matchr#r�append�os�path�splitextrr�findrrrrrrrr)�filenamer.r/r0r1r2�vars�file�
extensions�lineZwords�moduleZextZappend_next_wordZword�suffixZswitch�valueZequalsrrr�read_setup_file�s��
 







�










rH)r<r"rrHrrrr�<module>szdistutils/__pycache__/sysconfig.cpython-38.pyc000064400000027556151153537450015464 0ustar00U

��.eP�@s�dZddlZddlZddlZddlZddlmZddlmZm	Z	ej
�ej�Z
ej
�ej�Zej
�ej�Zej
�ej�Zdejkr�ej
�ejd�Zn&ejr�ej
�ej
�ej��Zne��Zdd�Zeed	d�Zejd
kr�dd�Zee�Zee�Zd
d�Ze�Z dZ!ze �sej"Z!Wne#k
�r*YnXdd�Z$d-dd�Z%d.dd�Z&dd�Z'dd�Z(dd�Z)d/dd�Z*e�+d�Z,e�+d�Z-e�+d �Z.d0d!d"�Z/d#d$�Z0da1d%d&�Z2d'd(�Z3d)d*�Z4d+d,�Z5dS)1a�Provide access to Python's configuration information.  The specific
configuration variables available depend heavily on the platform and
configuration.  The values may be retrieved using
get_config_var(name), and the list of variables is available via
get_config_vars().keys().  Additional convenience functions are also
available.

Written by:   Fred L. Drake, Jr.
Email:        <fdrake@acm.org>
�N�)�DistutilsPlatformError)�get_platform�get_host_platformZ_PYTHON_PROJECT_BASEcCs,dD]"}tj�tj�|d|��rdSqdS)N)ZSetupzSetup.localZModulesTF)�os�path�isfile�join)�d�fn�r�+/usr/lib64/python3.8/distutils/sysconfig.py�_is_python_source_dir+sr�_home�ntcCs0|r,tj�|��tj�tj�td���r,tS|S)NZPCbuild)rr�normcase�
startswithr	�PREFIX)r
rrr
�_fix_pcbuild4s
�rcCstrtt�Stt�S)N)�	_sys_homer�project_baserrrr
�
_python_build<sr�cCsdtjdd�S)z�Return a string containing the major and minor Python version,
    leaving off the patchlevel.  Sample return values could be '1.5'
    or '2.2'.
    z%d.%dN�)�sys�version_inforrrr
�get_python_versionPsrcCs�|dkr|rtpt}tjdkrjtrL|r.tp,tStj�t	d�d�}tj�
|�Sdt�t}tj�|d|�Stjdkr�tr�tj�|d�tjj
tj�|d�Stj�|d�Std	tj��dS)
a�Return the directory containing installed Python header files.

    If 'plat_specific' is false (the default), this is the path to the
    non-platform-specific header files, i.e. Python.h and so on;
    otherwise, this is the path to platform-specific header files
    (namely pyconfig.h).

    If 'prefix' is supplied, use it instead of sys.base_prefix or
    sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
    N�posix�srcdirZInclude�pythonZincluder�PCzFI don't know where Python installs its C header files on platform '%s')�BASE_EXEC_PREFIX�BASE_PREFIXr�name�python_buildrrrr	�get_config_var�normpathr�build_flags�pathsepr)�
plat_specific�prefixZincdirZ
python_dirrrr
�get_python_incXs*

���r+cCs�|dkr&|r|rtpt}n|r"tp$t}tjdkrp|s8|r>d}nd}tj�||dt��}|r`|Stj�|d�Sn<tjdkr�|r�tj�|d�Stj�|dd�Snt	d	tj��dS)
aSReturn the directory containing the Python library (standard or
    site additions).

    If 'plat_specific' is true, return the directory containing
    platform-specific modules, i.e. any module from a non-pure-Python
    module distribution; otherwise, return the platform-shared library
    directory.  If 'standard_lib' is true, return the directory
    containing standard Python library modules; otherwise, return the
    directory for site-specific modules.

    If 'prefix' is supplied, use it instead of sys.base_prefix or
    sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
    Nr�lib64�librz
site-packagesrZLibz?I don't know where Python installs its library on platform '%s')
r!r"�EXEC_PREFIXrrr#rr	rr)r)�standard_libr*r-Z	libpythonrrr
�get_python_lib�s0
�
��r0c	Cs�|jdk�r�tjdkr8td�s8ddl}|�t�dtd<tddd	d
ddd
d�\}}}}}}}}	dtj	kr�tj	d}
tjdkr�dtj	kr�|�
|�r�|
|t|�d�}|
}dtj	kr�tj	d}dtj	kr�tj	d}dtj	kr�tj	d}n|d}dtj	k�r|dtj	d}d	tj	k�r<|dtj	d	}|dtj	d	}dtj	k�r~|dtj	d}|dtj	d}|dtj	d}d
tj	k�r�tj	d
}dtj	k�r�|dtj	d}n|d|	}|d|}
|j||
|
d|||||d�||_
dS)z�Do any platform-specific customization of a CCompiler instance.

    Mainly needed on Unix, so we can plug in the information that
    varies across Unices and is stored in Python's Makefile.
    Zunix�darwinZCUSTOMIZED_OSX_COMPILERrN�TrueZCCZCXX�CFLAGSZCCSHAREDZLDSHAREDZSHLIB_SUFFIXZARZARFLAGSZCPPz -E�LDFLAGS� �CPPFLAGS)Zpreprocessor�compilerZcompiler_soZcompiler_cxxZ	linker_soZ
linker_exe�archiver)Z
compiler_typer�platformr%�_osx_support�customize_compiler�_config_vars�get_config_varsr�environr�lenZset_executablesZshared_lib_extension)r7r:ZccZcxxZcflagsZccsharedZldsharedZshlib_suffixZarZar_flagsZnewccZcppr8Zcc_cmdrrr
r;�sn

��


��






�	r;cCsDtr,tjdkr"tj�tptd�}q6tp(t}n
tdd�}tj�|d�S)z2Return full pathname of installed pyconfig.h file.rr r�r)z
pyconfig-64.h)r$rr#rr	rrr+)Zinc_dirrrr
�get_config_h_filename�s


rAcCs\trtj�tptd�Stddd�}d�t�t	�}t
tjd�rL|dtjj
7}tj�||d�S)zAReturn full pathname of installed Makefile from the Python build.ZMakefilerr�r)r/zconfig-{}{}�
_multiarchz-%s)r$rrr	rrr0�formatrr'�hasattrr�implementationrC)Zlib_dirZconfig_filerrr
�get_makefile_filenamesrGcCs�|dkri}t�d�}t�d�}|��}|s.q�|�|�}|rx|�dd�\}}zt|�}Wntk
rlYnX|||<q |�|�}|r d||�d�<q |S)z�Parse a config.h-style file.

    A dictionary containing name/value pairs is returned.  If an
    optional dictionary is passed in as the second argument, it is
    used instead of a new dictionary.
    Nz"#define ([A-Z][A-Za-z0-9_]+) (.*)
z&/[*] #undef ([A-Z][A-Za-z0-9_]+) [*]/
rrr)�re�compile�readline�match�group�int�
ValueError)�fp�gZ	define_rxZundef_rx�line�m�n�vrrr
�parse_config_hs&




rUz"([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)z\$\(([A-Za-z][A-Za-z0-9_]*)\)z\${([A-Za-z][A-Za-z0-9_]*)}c	Cs�ddlm}||ddddd�}|dkr*i}i}i}|��}|dkrDq�t�|�}|r2|�dd�\}}	|	��}	|	�dd	�}
d
|
kr�|	||<q2zt|	�}	Wn$t	k
r�|	�dd
�||<Yq2X|	||<q2d}|�rtt
|�D�]�}||}
t�|
�p�t
�|
�}|�rj|�d�}d}||k�r$t||�}n�||k�r4d
}nx|tjk�rLtj|}n`||k�r�|�d��rz|dd�|k�rzd	}n$d||k�r�d
}nt|d|�}nd	||<}|�rp|
|��d�}|
d|���||}
d
|k�r�|
||<nzzt|
�}
Wn"t	k
�r|
��||<Yn
X|
||<||=|�d��rp|dd�|k�rp|dd�}||k�rp|
||<q�||=q�q�|��|��D]"\}}	t|	t��r�|	��||<�q�|�|�|S)z�Parse a Makefile-style file.

    A dictionary containing name/value pairs is returned.  If an
    optional dictionary is passed in as the second argument, it is
    used instead of a new dictionary.
    r)�TextFiler�surrogateescape)Zstrip_commentsZskip_blanksZ
join_lines�errorsNrz$$r�$)r3r4r6TFZPY_�)Zdistutils.text_filerVrJ�_variable_rxrKrL�strip�replacerMrN�list�_findvar1_rx�search�_findvar2_rx�strrr>r�end�start�close�items�
isinstance�update)rrPrVrOZdoneZnotdonerQrRrSrTZtmpvZrenamed_variablesr#�value�found�itemZafter�krrr
�parse_makefile/s�








�



rmcCsVt�|�pt�|�}|rR|��\}}|d|�|�|�d��||d�}qqRq|S)a�Expand Makefile-style variables -- "${foo}" or "$(foo)" -- in
    'string' according to 'vars' (a dictionary mapping variable names to
    values).  Variables not present in 'vars' are silently expanded to the
    empty string.  The variable values in 'vars' should not contain further
    variable expansions; if 'vars' is the output of 'parse_makefile()',
    you're fine.  Returns a variable-expanded version of 's'.
    rrN)r_r`ra�span�getrL)�s�varsrRZbegrcrrr
�expand_makefile_vars�s*rrc
CsVtj�ddjtjtjttjdd�d��}t	|t
�t�dgd�}|j}ia
t
�|�dS)	z7Initialize the module as appropriate for POSIX systems.Z_PYTHON_SYSCONFIGDATA_NAMEz+_sysconfigdata_{abi}_{platform}_{multiarch}rCr)Zabir9Z	multiarch�build_time_varsrN)rr>rorDr�abiflagsr9�getattrrF�
__import__�globals�localsrsr<rh)r#Z_temprsrrr
�_init_posix�s��rycCs~i}tddd�|d<tddd�|d<tdd�|d<t��d|d<d	|d
<t��dd�|d
<tj�tj�	t
j��|d<|adS)z+Initialize the module as appropriate for NTrrrBZLIBDESTZ
BINLIBDESTr@Z	INCLUDEPY�
EXT_SUFFIXz.exeZEXE�.rZVERSIONZBINDIRN)
r0r+�_imp�extension_suffixesrr]rr�dirname�abspathr�
executabler<)rPrrr
�_init_nt�sr�cGs\tdk�r*t��dtj�}|r(|�niattd<ttd<t�d�}|dk	rV|td<t�dt�}tjdkr�tr�tj	�
t��}tj	�||�}ntj	�
t��}tj	�
tj	�|��td<t�rtjdk�rt}tj	�td��s|t��k�rtj	�|td�}tj	�|�td<tjd	k�r*d
dl}|�t�|�rTg}|D]}|�t�|���q8|StSdS)a�With no arguments, return a dictionary of all configuration
    variables relevant for the current platform.  Generally this includes
    everything needed to build extensions and install both pure modules and
    extensions.  On Unix, this means every variable defined in Python's
    installed Makefile; on Windows it's a much smaller set.

    With arguments, return a list of values that result from looking up
    each argument in the configuration variable dictionary.
    NZ_init_r*�exec_prefixrz�SOrrr1r)r<rwrorr#rr.rr$rr~rGr	rr&�isabs�getcwdrr9r:Zcustomize_config_vars�append)�args�funcr�r�baser:Zvalsr#rrr
r=�sB



�
r=cCs*|dkrddl}|�dtd�t��|�S)z�Return the value of a single variable using the dictionary
    returned by 'get_config_vars()'.  Equivalent to
    get_config_vars().get(name)
    r�rNz SO is deprecated, use EXT_SUFFIXr)�warnings�warn�DeprecationWarningr=ro)r#r�rrr
r%!sr%)rN)rrN)N)N)6�__doc__r|rrHrrXr�utilrrrr&r*rr�r.�base_prefixr"�base_exec_prefixr!r>rrr�r~r�rrurr#rrr$r'rt�AttributeErrorrr+r0r;rArGrUrIr[r_rarmrrr<ryr�r=r%rrrr
�<module>s\



(
+I





jJdistutils/__pycache__/file_util.cpython-38.opt-2.pyc000064400000007326151153537450016365 0ustar00U

e5d��@sVddlZddlmZddlmZdddd�Zdd	d
�Zddd
�Zddd�Zdd�Z	dS)�N)�DistutilsFileError)�logZcopyingzhard linkingzsymbolically linking)N�hard�sym�@c
Cs�d}d}�ztzt|d�}Wn4tk
rN}ztd||jf��W5d}~XYnXtj�|�r�zt�|�Wn4tk
r�}ztd||jf��W5d}~XYnXzt|d�}Wn4tk
r�}ztd||jf��W5d}~XYnXz|�	|�}Wn6tk
�r(}ztd||jf��W5d}~XYnX|�s4�q|z|�
|�Wq�tk
�rx}ztd||jf��W5d}~XYq�Xq�W5|�r�|��|�r�|��XdS)N�rbzcould not open '%s': %szcould not delete '%s': %s�wbzcould not create '%s': %szcould not read from '%s': %szcould not write to '%s': %s)�close�open�OSErrorr�strerror�os�path�exists�unlink�read�write)�src�dstZbuffer_sizeZfsrcZfdst�eZbuf�r�+/usr/lib64/python3.8/distutils/file_util.py�_copy_file_contentssL	$����r�cCsddlm}ddlm}	m}
m}m}tj�	|�s<t
d|��tj�|�rd|}
tj�|tj�
|��}ntj�|�}
|r�|||�s�|dkr�t�d|�|dfSzt|}Wn tk
r�td|��YnX|dk�rtj�
|�tj�
|�kr�t�d|||
�nt�d|||�|�r|dfS|d	k�rrtj�|��rBtj�||��s�zt�||�|dfWStk
�rnYnXn<|d
k�r�tj�|��r�tj�||��s�t�||�|dfSt||�|�s�|�rt�|�}|�r�t�|||	||
f�|�rt�||||��|dfS)Nr)�newer)�ST_ATIME�ST_MTIME�ST_MODE�S_IMODEz4can't copy '%s': doesn't exist or not a regular filerz"not copying %s (output up-to-date)z&invalid value '%s' for 'link' argumentz%s %s -> %srr)Zdistutils.dep_utilr�statrrrrr
r�isfiler�isdir�join�basename�dirnamer�debug�_copy_action�KeyError�
ValueError�infor�samefile�linkr�symlinkr�utime�chmod)rrZ
preserve_modeZpreserve_times�updater+�verbose�dry_runrrrrr�dir�action�strrr�	copy_fileCsV!�





r5cCs�ddlm}m}m}m}m}ddl}	|dkr:t�d||�|rB|S||�sVt	d|��||�rrt
j�|||��}n||�r�t	d||f��|||��s�t	d||f��d}
zt
�
||�WnPtk
�r
}z0|j\}}
||	jkr�d	}
nt	d
|||
f��W5d}~XYnX|
�r�t|||d�zt
�|�Wnhtk
�r�}zH|j\}}
zt
�|�Wntk
�rpYnXt	d||||
f��W5d}~XYnX|S)
Nr)rr r!r#r$rzmoving %s -> %sz#can't move '%s': not a regular filez0can't move '%s': destination '%s' already existsz2can't move '%s': destination '%s' not a valid pathFTzcouldn't move '%s' to '%s': %s)r0zAcouldn't move '%s' to '%s' by copy/delete: delete '%s' failed: %s)Zos.pathrr r!r#r$�errnorr)rr
rr"�renamer�argsZEXDEVr5r)rrr0r1rr r!r#r$r6Zcopy_itrZnum�msgrrr�	move_file�s`����

�

��r:cCs6t|d�}z|D]}|�|d�qW5|��XdS)N�w�
)r
r	r)�filename�contents�f�linerrr�
write_file�s

rA)r)rrrNrr)rr)
r
Zdistutils.errorsrZ	distutilsrr&rr5r:rArrrr�<module>s �
3�
d�
?distutils/__pycache__/version.cpython-38.opt-2.pyc000064400000007617151153537450016101 0ustar00U

e5d90�@s:ddlZGdd�d�ZGdd�de�ZGdd�de�ZdS)�Nc@sFeZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dS)�VersionNcCs|r|�|�dS�N��parse��self�vstring�r	�)/usr/lib64/python3.8/distutils/version.py�__init__&szVersion.__init__cCsd|jjt|�fS)Nz	%s ('%s'))�	__class__�__name__�str�rr	r	r
�__repr__*szVersion.__repr__cCs|�|�}|tkr|S|dkS�Nr��_cmp�NotImplemented�r�other�cr	r	r
�__eq__-s
zVersion.__eq__cCs|�|�}|tkr|S|dkSrrrr	r	r
�__lt__3s
zVersion.__lt__cCs|�|�}|tkr|S|dkSrrrr	r	r
�__le__9s
zVersion.__le__cCs|�|�}|tkr|S|dkSrrrr	r	r
�__gt__?s
zVersion.__gt__cCs|�|�}|tkr|S|dkSrrrr	r	r
�__ge__Es
zVersion.__ge__)N)
r
�
__module__�__qualname__rrrrrrrr	r	r	r
rs
rc@s8eZdZe�dejejB�Zdd�Zdd�Z	dd�Z
dS)	�
StrictVersionz)^(\d+) \. (\d+) (\. (\d+))? ([ab](\d+))?$cCs�|j�|�}|std|��|�ddddd�\}}}}}|rTttt|||g��|_nttt||g��d|_|r�|dt|�f|_nd|_dS)	Nzinvalid version number '%s'�����)rr)	�
version_re�match�
ValueError�group�tuple�map�int�version�
prerelease)rrr&�major�minorZpatchr-Zprerelease_numr	r	r
r�s�zStrictVersion.parsecCsb|jddkr*d�tt|jdd���}nd�tt|j��}|jr^||jdt|jd�}|S)Nr!r�.r )r,�joinr*rr-rr	r	r
�__str__�szStrictVersion.__str__cCs�t|t�rt|�}|j|jkr2|j|jkr.dSdS|jsB|jsBdS|jrR|jsRdS|jsb|jrbdS|jr�|jr�|j|jkr~dS|j|jkr�dSdSndS)N���r r)�
isinstancerrr,r-�rrr	r	r
r�s&
zStrictVersion._cmpN)r
rr�re�compile�VERBOSE�ASCIIr%rr2rr	r	r	r
r]s%
�
rc@sDeZdZe�dej�Zd
dd�Zdd�Zdd�Z	d	d
�Z
dd�ZdS)�LooseVersionz(\d+ | [a-z]+ | \.)NcCs|r|�|�dSrrrr	r	r
r.szLooseVersion.__init__c	Cs^||_dd�|j�|�D�}t|�D].\}}zt|�||<Wq$tk
rPYq$Xq$||_dS)NcSsg|]}|r|dkr|�qS)r0r	)�.0�xr	r	r
�
<listcomp>8s�z&LooseVersion.parse.<locals>.<listcomp>)r�component_re�split�	enumerater+r'r,)rrZ
components�i�objr	r	r
r3szLooseVersion.parsecCs|jSr)rrr	r	r
r2CszLooseVersion.__str__cCsdt|�S)NzLooseVersion ('%s'))rrr	r	r
rGszLooseVersion.__repr__cCsFt|t�rt|�}|j|jkr"dS|j|jkr2dS|j|jkrBdSdS)Nrr3r )r4rr:r,r5r	r	r
rKs
zLooseVersion._cmp)N)r
rrr6r7r8r>rrr2rrr	r	r	r
r:s!
r:)r6rrr:r	r	r	r
�<module>s>/distutils/__pycache__/__init__.cpython-38.opt-2.pyc000064400000000314151153537450016136 0ustar00U

e5d��@s"ddlZejdej�d��ZdS)�N� )�sys�version�index�__version__�rr�*/usr/lib64/python3.8/distutils/__init__.py�<module>sdistutils/__pycache__/debug.cpython-38.opt-2.pyc000064400000000304151153537450015464 0ustar00U

e5d��@sddlZej�d�ZdS)�NZDISTUTILS_DEBUG)�os�environ�get�DEBUG�rr�'/usr/lib64/python3.8/distutils/debug.py�<module>sdistutils/__pycache__/bcppcompiler.cpython-38.opt-1.pyc000064400000014575151153537450017073 0ustar00U

e5dW:�@sxdZddlZddlmZmZmZmZmZmZddl	m
Z
mZmZddl
mZddlmZddlmZGdd	�d	e
�ZdS)
z�distutils.bcppcompiler

Contains BorlandCCompiler, an implementation of the abstract CCompiler class
for the Borland C++ compiler.
�N)�DistutilsExecError�DistutilsPlatformError�CompileError�LibError�	LinkError�UnknownFileError)�	CCompiler�gen_preprocess_options�gen_lib_options)�
write_file)�newer)�logc
@s�eZdZdZdZiZdgZdddgZeeZdZ	dZ
d	Zd
ZZ
dZdd
d�Zddd�Zddd�Zd dd�Zd!dd�Zd"dd�Zd#dd�ZdS)$�BCPPCompilerzConcrete class that implements an interface to the Borland C/C++
    compiler, as defined by the CCompiler abstract class.
    Zbcppz.cz.ccz.cppz.cxxz.objz.libz.dllz%s%sz.exercCs�t�||||�d|_d|_d|_d|_ddddg|_ddddg|_d	d
ddg|_d	d
ddg|_	g|_
d
ddg|_d
dddg|_dS)
Nz	bcc32.exezilink32.exeztlib.exez/tWMz/O2z/qz/g0z/Odz/Tpdz/Gnz/xz/r)
r�__init__�cc�linker�libZpreprocess_options�compile_options�compile_options_debug�ldflags_shared�ldflags_shared_debugZldflags_static�ldflags_exe�ldflags_exe_debug)�self�verboseZdry_run�force�r�./usr/lib64/python3.8/distutils/bcppcompiler.pyr5szBCPPCompiler.__init__Nc	Cs�|�||||||�\}}	}}
}|p$g}|�d�|rB|�|j�n|�|j�|	D�]<}
z||
\}}Wntk
r�YqRYnXtj�|�}tj�|
�}
|�	tj�
|
��|dkr�qR|dk�rz|�dd|
|g�WqRtk
�r}zt
|��W5d}~XYqRXqR||jk�rd}n||jk�r*d}nd}d|
}z,|�|jg||
||g||g�WqRtk
�r�}zt
|��W5d}~XYqRXqR|	S)	Nz-c�.res�.rcZbrcc32z-fo�z-P�-o)Z_setup_compile�append�extendrr�KeyError�os�path�normpath�mkpath�dirname�spawnrr�
_c_extensions�_cpp_extensionsr)rZsources�
output_dir�macros�include_dirs�debug�
extra_preargs�extra_postargsZdepends�objects�pp_optsZbuildZcompile_opts�obj�src�ext�msgZ	input_optZ
output_optrrr�compileQsV��



���
zBCPPCompiler.compilec	
Cs�|�||�\}}|j||d�}|�||�r~|dg|}|r:z|�|jg|�Wq�tk
rz}zt|��W5d}~XYq�Xnt�d|�dS)N)r-z/u�skipping %s (up-to-date))	�_fix_object_args�library_filename�
_need_linkr*rrrr
r0)	rr3Zoutput_libnamer-r0�target_lang�output_filenameZlib_argsr8rrr�create_static_lib�s�zBCPPCompiler.create_static_libc 
Cs�|�||�\}}|�|||�\}}}|r8t�dt|��|dk	rNtj�||�}|�||��r�|t	j
kr�d}|	r~|jdd�}q�|jdd�}n&d}|	r�|j
dd�}n|jdd�}|dkr�d}n�tj�|�\}}tj�|�\}}tj�|d�}tj�|d|�}dg}|�pgD]}|�d||f��q|�t||fd	|�ttjj|�}|g}g}|D]>}tj�tj�|��\}}|d
k�r�|�|�n
|�|��q`|D]}|�dtj�|���q�|�d�|�|�|�d
|g�|�d�|D]4}|�|||	�}|dk�r|�|�n
|�|��q�|�d�|�d�|�d
|g�|�d
�|�|�|
�rp|
|dd�<|�r�|�|�|�tj�|��z|�|jg|�Wn,tk
�r�}zt|��W5d}~XYnXnt�d|�dS)Nz7I don't know what to do with 'runtime_library_dirs': %sZc0w32Zc0d32r rz%s.defZEXPORTSz  %s=_%sz
writing %srz/L%sz/L.�,z,,Zimport32Zcw32mtr:) r;Z
_fix_lib_argsr
�warn�strr%r&�joinr=rZ
EXECUTABLErrrr�split�splitextr)r"Zexecuter�mapr'�normcaser#�find_library_filer(r*rrrr0) rZtarget_descr3r?r-Z	librariesZlibrary_dirsZruntime_library_dirsZexport_symbolsr0r1r2Z
build_tempr>Zstartup_objZld_argsZdef_file�head�tail�modnamer7Ztemp_dir�contentsZsymZobjects2Z	resources�file�base�lr�libfiler8rrr�link�s���
�










zBCPPCompiler.linkc	Csr|r"|d}|d|d||f}n|d|f}|D]:}|D]0}tj�||�|��}tj�|�r:|Sq:q2dS)NZ_dZ_bcpp)r%r&rDr<�exists)	r�dirsrr0ZdlibZ	try_names�dir�namerQrrrrI4s
zBCPPCompiler.find_library_filer cCs�|dkrd}g}|D]�}tj�tj�|��\}}||jddgkrRtd||f��|rbtj�|�}|dkr�|�tj�|||��q|dkr�|�tj�||d��q|�tj�|||j	��q|S)Nr rrz"unknown file type '%s' (from '%s'))
r%r&rFrH�src_extensionsr�basenamer"rD�
obj_extension)rZsource_filenamesZ	strip_dirr-Z	obj_namesZsrc_namerOr7rrr�object_filenamesNs&��zBCPPCompiler.object_filenamesc
Cs�|�d||�\}}}t||�}dg|}	|dk	r>|	�d|�|rN||	dd�<|r\|	�|�|	�|�|js~|dks~t||�r�|r�|�tj�	|��z|�
|	�Wn2tk
r�}
zt|
�t
|
��W5d}
~
XYnXdS)Nz	cpp32.exer!r)Z_fix_compile_argsr	r"r#rrr(r%r&r)r*r�printr)r�sourceZoutput_filer.r/r1r2�_r4Zpp_argsr8rrr�
preprocessis&	�



zBCPPCompiler.preprocess)rrr)NNNrNNN)NrN)
NNNNNrNNNN)r)rr )NNNNN)�__name__�
__module__�__qualname__�__doc__Z
compiler_typeZexecutablesr+r,rWrYZstatic_lib_extensionZshared_lib_extensionZstatic_lib_formatZshared_lib_formatZ
exe_extensionrr9r@rRrIrZr^rrrrrsb
�
�
D�
�


�
�r)rbr%Zdistutils.errorsrrrrrrZdistutils.ccompilerrr	r
Zdistutils.file_utilrZdistutils.dep_utilrZ	distutilsr
rrrrr�<module>s distutils/__pycache__/bcppcompiler.cpython-38.pyc000064400000014575151153537450016134 0ustar00U

e5dW:�@sxdZddlZddlmZmZmZmZmZmZddl	m
Z
mZmZddl
mZddlmZddlmZGdd	�d	e
�ZdS)
z�distutils.bcppcompiler

Contains BorlandCCompiler, an implementation of the abstract CCompiler class
for the Borland C++ compiler.
�N)�DistutilsExecError�DistutilsPlatformError�CompileError�LibError�	LinkError�UnknownFileError)�	CCompiler�gen_preprocess_options�gen_lib_options)�
write_file)�newer)�logc
@s�eZdZdZdZiZdgZdddgZeeZdZ	dZ
d	Zd
ZZ
dZdd
d�Zddd�Zddd�Zd dd�Zd!dd�Zd"dd�Zd#dd�ZdS)$�BCPPCompilerzConcrete class that implements an interface to the Borland C/C++
    compiler, as defined by the CCompiler abstract class.
    Zbcppz.cz.ccz.cppz.cxxz.objz.libz.dllz%s%sz.exercCs�t�||||�d|_d|_d|_d|_ddddg|_ddddg|_d	d
ddg|_d	d
ddg|_	g|_
d
ddg|_d
dddg|_dS)
Nz	bcc32.exezilink32.exeztlib.exez/tWMz/O2z/qz/g0z/Odz/Tpdz/Gnz/xz/r)
r�__init__�cc�linker�libZpreprocess_options�compile_options�compile_options_debug�ldflags_shared�ldflags_shared_debugZldflags_static�ldflags_exe�ldflags_exe_debug)�self�verboseZdry_run�force�r�./usr/lib64/python3.8/distutils/bcppcompiler.pyr5szBCPPCompiler.__init__Nc	Cs�|�||||||�\}}	}}
}|p$g}|�d�|rB|�|j�n|�|j�|	D�]<}
z||
\}}Wntk
r�YqRYnXtj�|�}tj�|
�}
|�	tj�
|
��|dkr�qR|dk�rz|�dd|
|g�WqRtk
�r}zt
|��W5d}~XYqRXqR||jk�rd}n||jk�r*d}nd}d|
}z,|�|jg||
||g||g�WqRtk
�r�}zt
|��W5d}~XYqRXqR|	S)	Nz-c�.res�.rcZbrcc32z-fo�z-P�-o)Z_setup_compile�append�extendrr�KeyError�os�path�normpath�mkpath�dirname�spawnrr�
_c_extensions�_cpp_extensionsr)rZsources�
output_dir�macros�include_dirs�debug�
extra_preargs�extra_postargsZdepends�objects�pp_optsZbuildZcompile_opts�obj�src�ext�msgZ	input_optZ
output_optrrr�compileQsV��



���
zBCPPCompiler.compilec	
Cs�|�||�\}}|j||d�}|�||�r~|dg|}|r:z|�|jg|�Wq�tk
rz}zt|��W5d}~XYq�Xnt�d|�dS)N)r-z/u�skipping %s (up-to-date))	�_fix_object_args�library_filename�
_need_linkr*rrrr
r0)	rr3Zoutput_libnamer-r0�target_lang�output_filenameZlib_argsr8rrr�create_static_lib�s�zBCPPCompiler.create_static_libc 
Cs�|�||�\}}|�|||�\}}}|r8t�dt|��|dk	rNtj�||�}|�||��r�|t	j
kr�d}|	r~|jdd�}q�|jdd�}n&d}|	r�|j
dd�}n|jdd�}|dkr�d}n�tj�|�\}}tj�|�\}}tj�|d�}tj�|d|�}dg}|�pgD]}|�d||f��q|�t||fd	|�ttjj|�}|g}g}|D]>}tj�tj�|��\}}|d
k�r�|�|�n
|�|��q`|D]}|�dtj�|���q�|�d�|�|�|�d
|g�|�d�|D]4}|�|||	�}|dk�r|�|�n
|�|��q�|�d�|�d�|�d
|g�|�d
�|�|�|
�rp|
|dd�<|�r�|�|�|�tj�|��z|�|jg|�Wn,tk
�r�}zt|��W5d}~XYnXnt�d|�dS)Nz7I don't know what to do with 'runtime_library_dirs': %sZc0w32Zc0d32r rz%s.defZEXPORTSz  %s=_%sz
writing %srz/L%sz/L.�,z,,Zimport32Zcw32mtr:) r;Z
_fix_lib_argsr
�warn�strr%r&�joinr=rZ
EXECUTABLErrrr�split�splitextr)r"Zexecuter�mapr'�normcaser#�find_library_filer(r*rrrr0) rZtarget_descr3r?r-Z	librariesZlibrary_dirsZruntime_library_dirsZexport_symbolsr0r1r2Z
build_tempr>Zstartup_objZld_argsZdef_file�head�tail�modnamer7Ztemp_dir�contentsZsymZobjects2Z	resources�file�base�lr�libfiler8rrr�link�s���
�










zBCPPCompiler.linkc	Csr|r"|d}|d|d||f}n|d|f}|D]:}|D]0}tj�||�|��}tj�|�r:|Sq:q2dS)NZ_dZ_bcpp)r%r&rDr<�exists)	r�dirsrr0ZdlibZ	try_names�dir�namerQrrrrI4s
zBCPPCompiler.find_library_filer cCs�|dkrd}g}|D]�}tj�tj�|��\}}||jddgkrRtd||f��|rbtj�|�}|dkr�|�tj�|||��q|dkr�|�tj�||d��q|�tj�|||j	��q|S)Nr rrz"unknown file type '%s' (from '%s'))
r%r&rFrH�src_extensionsr�basenamer"rD�
obj_extension)rZsource_filenamesZ	strip_dirr-Z	obj_namesZsrc_namerOr7rrr�object_filenamesNs&��zBCPPCompiler.object_filenamesc
Cs�|�d||�\}}}t||�}dg|}	|dk	r>|	�d|�|rN||	dd�<|r\|	�|�|	�|�|js~|dks~t||�r�|r�|�tj�	|��z|�
|	�Wn2tk
r�}
zt|
�t
|
��W5d}
~
XYnXdS)Nz	cpp32.exer!r)Z_fix_compile_argsr	r"r#rrr(r%r&r)r*r�printr)r�sourceZoutput_filer.r/r1r2�_r4Zpp_argsr8rrr�
preprocessis&	�



zBCPPCompiler.preprocess)rrr)NNNrNNN)NrN)
NNNNNrNNNN)r)rr )NNNNN)�__name__�
__module__�__qualname__�__doc__Z
compiler_typeZexecutablesr+r,rWrYZstatic_lib_extensionZshared_lib_extensionZstatic_lib_formatZshared_lib_formatZ
exe_extensionrr9r@rRrIrZr^rrrrrsb
�
�
D�
�


�
�r)rbr%Zdistutils.errorsrrrrrrZdistutils.ccompilerrr	r
Zdistutils.file_utilrZdistutils.dep_utilrZ	distutilsr
rrrrr�<module>s distutils/__pycache__/config.cpython-38.opt-1.pyc000064400000006667151153537450015664 0ustar00U

e5d��@s<dZddlZddlmZddlmZdZGdd�de�ZdS)z�distutils.pypirc

Provides the PyPIRCCommand class, the base class for the command classes
that uses .pypirc in the distutils.command package.
�N)�RawConfigParser)�CommandzE[distutils]
index-servers =
    pypi

[pypi]
username:%s
password:%s
c@sheZdZdZdZdZdZdZdddefdgZd	gZ	d
d�Z
dd
�Zdd�Zdd�Z
dd�Zdd�ZdS)�
PyPIRCCommandz;Base command that knows how to handle the .pypirc file
    zhttps://upload.pypi.org/legacy/�pypiNzrepository=�rzurl of repository [default: %s])�
show-responseNz&display full response text from serverrcCstj�tj�d�d�S)zReturns rc file path.�~z.pypirc)�os�path�join�
expanduser��self�r�(/usr/lib64/python3.8/distutils/config.py�_get_rc_file&szPyPIRCCommand._get_rc_filec	CsH|��}t�t�|tjtjBd�d��}|�t||f�W5QRXdS)zCreates a default .pypirc file.i��wN)rr	�fdopen�open�O_CREAT�O_WRONLY�write�DEFAULT_PYPIRC)r�username�password�rc�frrr�
_store_pypirc*s zPyPIRCCommand._store_pypirccCs�|��}tj�|��r�|�d|�|jp.|j}t�}|�|�|�	�}d|k�rF|�
dd�}dd�|�d�D�}|gkr�d|kr�dg}niS|D]�}d|i}|�
|d	�|d	<d
|jfd|jfdfD].\}	}
|�
||	�r�|�
||	�||	<q�|
||	<q�|dk�r ||jdfk�r |j|d
<|S|d|k�s:|d
|kr�|Sq�nRd
|k�r�d
}|�
|d
��rp|�
|d
�}n|j}|�
|d	�|�
|d�|||jd�SiS)zReads the .pypirc file.zUsing PyPI login from %sZ	distutilsz
index-serverscSs g|]}|��dkr|���qS)�)�strip)�.0�serverrrr�
<listcomp>=s�z.PyPIRCCommand._read_pypirc.<locals>.<listcomp>�
rr!r�
repository�realm)rNzserver-loginr)rrr$r!r%)rr	r
�existsZannouncer$�DEFAULT_REPOSITORYr�read�sections�get�split�
DEFAULT_REALMZ
has_option)rrr$Zconfigr)Z
index_serversZ_serversr!Zcurrent�key�defaultrrr�_read_pypirc0sb

���

�

�


�zPyPIRCCommand._read_pypirccCs8ddl}|�dd�}|�|�d�dd�}|���|�S)z%Read and decode a PyPI HTTP response.rNzcontent-typez
text/plain��charset�ascii)�cgiZ	getheaderZparse_headerr*r(�decode)rZresponser3Zcontent_type�encodingrrr�_read_pypi_responsepsz!PyPIRCCommand._read_pypi_responsecCsd|_d|_d|_dS)zInitialize options.Nr)r$r%Z
show_responser
rrr�initialize_optionswsz PyPIRCCommand.initialize_optionscCs(|jdkr|j|_|jdkr$|j|_dS)zFinalizes options.N)r$r'r%r,r
rrr�finalize_options}s

zPyPIRCCommand.finalize_options)�__name__�
__module__�__qualname__�__doc__r'r,r$r%Zuser_optionsZboolean_optionsrrr/r6r7r8rrrrrs&���@r)r<r	ZconfigparserrZ
distutils.cmdrrrrrrr�<module>s

distutils/__pycache__/util.cpython-38.pyc000064400000036274151153537450014432 0ustar00U

e5d�Q�@sdZddlZddlZddlZddlZddlZddlmZddl	m
Z
ddlmZddl
mZddlmZdd	�Zd
d�Zdd
�Zdd�Zdadd�Zdd�Zd*dd�Zdaaadd�Zdd�Zd+dd�Zdd�Zd,d d!�Zd"d#�Z d-d$d%�Z!d.d&d'�Z"Gd(d)�d)�Z#dS)/zudistutils.util

Miscellaneous utility functions -- anything that doesn't fit into
one of the other *util.py modules.
�N)�DistutilsPlatformError)�newer)�spawn)�log)�DistutilsByteCompileErrorc
Cs�tjdkrFdtj��krdSdtj��kr.dSdtj��kr@dStjSdtjkrZtjdStjd	ksnttd
�sttjSt��\}}}}}|���	dd�}|�	d
d�}|�	dd�}|dd�dkr�d||fS|dd�dk�r,|ddk�r�d}dt
|d�d|dd�f}ddd�}|d|tj7}n�|dd�dk�rLd |||fS|dd!�d"k�r�d"}t�
d#tj�}|�|�}|�r�|��}n>|dd!�d$k�r�ddl}ddl}	|�|	j��|||�\}}}d%|||fS)&a�Return a string that identifies the current platform.  This is used mainly to
    distinguish platform-specific build directories and platform-specific built
    distributions.  Typically includes the OS name and version and the
    architecture (as supplied by 'os.uname()'), although the exact information
    included depends on the OS; eg. on Linux, the kernel version isn't
    particularly important.

    Examples of returned values:
       linux-i586
       linux-alpha (?)
       solaris-2.6-sun4u

    Windows will return one of:
       win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc)
       win32 (all others - specifically, sys.platform is returned)

    For other non-POSIX platforms, currently just returns 'sys.platform'.

    �ntZamd64�	win-amd64z(arm)�	win-arm32z(arm64)z	win-arm64Z_PYTHON_HOST_PLATFORM�posix�uname�/�� �_�-N�Zlinuxz%s-%sZsunosr�5Zsolarisz%d.%s��Z32bitZ64bit)i���l����z.%sZaixz%s-%s.%s��cygwinz[\d.]+�darwinz%s-%s-%s)�os�name�sys�version�lower�platform�environ�hasattrr�replace�int�maxsize�re�compile�ASCII�match�group�_osx_supportZdistutils.sysconfigZget_platform_osxZ	sysconfigZget_config_vars)
ZosnameZhost�releaser�machineZbitnessZrel_re�mr(�	distutils�r-�&/usr/lib64/python3.8/distutils/util.py�get_host_platformsR


 


�
r/cCs8tjdkr.dddd�}|�tj�d��p,t�St�SdS)NrZwin32rr	)Zx86Zx64ZarmZVSCMD_ARG_TGT_ARCH)rr�getrr/)ZTARGET_TO_PLATr-r-r.�get_platformas
�r1cCsztjdkr|S|s|S|ddkr.td|��|ddkrFtd|��|�d�}d|krd|�d�qP|sntjStjj|�S)a�Return 'pathname' as a name that will work on the native filesystem,
    i.e. split it on '/' and put it back together again using the current
    directory separator.  Needed because filenames in the setup script are
    always supplied in Unix style, and have to be converted to the local
    convention before we can actually use them in the filesystem.  Raises
    ValueError on non-Unix-ish systems if 'pathname' either starts or
    ends with a slash.
    rrzpath '%s' cannot be absolute���zpath '%s' cannot end with '/'�.)r�sep�
ValueError�split�remove�curdir�path�join)�pathname�pathsr-r-r.�convert_pathls	

r=cCs�tjdkr<tj�|�s$tj�||�Stj�||dd��SnNtjdkr|tj�|�\}}|ddkrn|dd�}tj�||�Stdtj��dS)a	Return 'pathname' with 'new_root' prepended.  If 'pathname' is
    relative, this is equivalent to "os.path.join(new_root,pathname)".
    Otherwise, it requires making 'pathname' relative and then joining the
    two, which is tricky on DOS/Windows and Mac OS.
    r
�Nrr�\z!nothing known about platform '%s')rrr9�isabsr:�
splitdriver)Znew_rootr;Zdriver9r-r-r.�change_root�s

rBc	CsxtrdStjdkrZdtjkrZz$ddl}|�t���dtjd<Wnttfk
rXYnXdtjkrpt	�tjd<dadS)aLEnsure that 'os.environ' has all the environment variables we
    guarantee that users can use in config files, command-line options,
    etc.  Currently this includes:
      HOME - user's home directory (Unix only)
      PLAT - description of the current platform, including hardware
             and OS (see 'get_platform()')
    Nr
�HOMErrZPLATr>)
�_environ_checkedrrr�pwd�getpwuid�getuid�ImportError�KeyErrorr1)rEr-r-r.�
check_environ�s	
rJc
CsVt�|fdd�}zt�d||�WStk
rP}ztd|��W5d}~XYnXdS)a�Perform shell/Perl-style variable substitution on 'string'.  Every
    occurrence of '$' followed by a name is considered a variable, and
    variable is substituted by the value found in the 'local_vars'
    dictionary, or in 'os.environ' if it's not in 'local_vars'.
    'os.environ' is first checked/augmented to guarantee that it contains
    certain values: see 'check_environ()'.  Raise ValueError for any
    variables not found in either 'local_vars' or 'os.environ'.
    cSs,|�d�}||krt||�Stj|SdS)Nr>)r'�strrr)r&�
local_varsZvar_namer-r-r.�_subst�s
zsubst_vars.<locals>._substz\$([a-zA-Z_][a-zA-Z_0-9]*)zinvalid variable '$%s'N)rJr#�subrIr5)�srLrM�varr-r-r.�
subst_vars�s	rQ�error: cCs|t|�S�N)rK)�exc�prefixr-r-r.�grok_environment_error�srVcCs(t�dtj�at�d�at�d�adS)Nz
[^\\\'\"%s ]*z'(?:[^'\\]|\\.)*'z"(?:[^"\\]|\\.)*")r#r$�string�
whitespace�
_wordchars_re�
_squote_re�
_dquote_rer-r-r-r.�_init_regex�s
r\cCs�tdkrt�|��}g}d}|�r�t�||�}|��}|t|�krZ|�|d|���q�||tjkr�|�|d|��||d��	�}d}n�||dkr�|d|�||dd�}|d}n�||dkr�t
�||�}n*||dkr�t�||�}ntd||��|dk�r t
d||��|��\}}|d|�||d|d�||d�}|��d	}|t|�kr|�|��q�q|S)
aSplit a string up according to Unix shell-like rules for quotes and
    backslashes.  In short: words are delimited by spaces, as long as those
    spaces are not escaped by a backslash, or inside a quoted string.
    Single and double quotes are equivalent, and the quote characters can
    be backslash-escaped.  The backslash is stripped from any two-character
    escape sequence, leaving only the escaped character.  The quote
    characters are stripped from any quoted string.  Returns a list of
    words.
    Nrr?r>�'�"z!this can't happen (bad char '%c')z"bad string (mismatched %s quotes?)r)rYr\�stripr&�end�len�appendrWrX�lstriprZr[�RuntimeErrorr5�span)rOZwords�posr+r`Zbegr-r-r.�split_quoted�s@

,
rgcCsP|dkr6d|j|f}|dd�dkr6|dd�d}t�|�|sL||�dS)a�Perform some action that affects the outside world (eg.  by
    writing to the filesystem).  Such actions are special because they
    are disabled by the 'dry_run' flag.  This method takes care of all
    that bureaucracy for you; all you have to do is supply the
    function to call and an argument tuple for it (to embody the
    "external action" being performed), and an optional message to
    print.
    Nz%s%r���z,)r�))�__name__r�info)�func�args�msg�verbose�dry_runr-r-r.�executes	
rqcCs2|��}|dkrdS|dkr dStd|f��dS)z�Convert a string representation of truth to true (1) or false (0).

    True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values
    are 'n', 'no', 'f', 'false', 'off', and '0'.  Raises ValueError if
    'val' is anything else.
    )�yZyes�t�trueZon�1r>)�nZno�fZfalseZoff�0rzinvalid truth value %rN)rr5)�valr-r-r.�	strtobool2srzr>c	CsTddl}tjrtd��|dkr*do(|dk}|�s@zddlm}	|	d�\}
}Wn.tk
rzddlm}d|d�}
}YnXt�	d|�|s�|
dk	r�t
�|
d	�}
n
t|d	�}
|
�B|
�
d
�|
�
d�tt|��d�|
�
d
|||||f�W5QRXtjg}|�|���|�|�t||d�tt
j|fd||d��nddlm}|D]�}|dd�dk�rj�qP|dk�r�|dk�r�dn|}tjj||d�}ntj�|�}|}|�r�|dt|��|k�r�td||f��|t|�d�}|�r�t
j�||�}t
j� |�}|�rP|�st!||��r>t�	d||�|�sL||||�nt�"d||��qPdS)a~Byte-compile a collection of Python source files to .pyc
    files in a __pycache__ subdirectory.  'py_files' is a list
    of files to compile; any files that don't end in ".py" are silently
    skipped.  'optimize' must be one of the following:
      0 - don't optimize
      1 - normal optimization (like "python -O")
      2 - extra optimization (like "python -OO")
    If 'force' is true, all files are recompiled regardless of
    timestamps.

    The source filename encoded in each bytecode file defaults to the
    filenames listed in 'py_files'; you can modify these with 'prefix' and
    'basedir'.  'prefix' is a string that will be stripped off of each
    source filename, and 'base_dir' is a directory name that will be
    prepended (after 'prefix' is stripped).  You can supply either or both
    (or neither) of 'prefix' and 'base_dir', as you wish.

    If 'dry_run' is true, doesn't actually do anything that would
    affect the filesystem.

    Byte-compilation is either done directly in this interpreter process
    with the standard py_compile module, or indirectly by writing a
    temporary script and executing it.  Normally, you should let
    'byte_compile()' figure out to use direct compilation or not (see
    the source for details).  The 'direct' flag is used by the script
    generated in indirect mode; unless you know what you're doing, leave
    it set to None.
    rNzbyte-compiling is disabled.T)�mkstemp�.py)�mktempz$writing byte-compilation script '%s'�wz2from distutils.util import byte_compile
files = [
z,
z]
z�
byte_compile(files, optimize=%r, force=%r,
             prefix=%r, base_dir=%r,
             verbose=%r, dry_run=0,
             direct=1)
)rpzremoving %s)r$���r
)�optimizationz1invalid prefix: filename %r doesn't start with %rzbyte-compiling %s to %sz%skipping byte-compilation of %s to %s)#�
subprocessr�dont_write_bytecoderZtempfiler{rHr}rrkr�fdopen�open�writer:�map�repr�
executable�extendZ"_optim_args_from_interpreter_flagsrbrrqr7�
py_compiler$�	importlib�util�cache_from_sourcerar5r9�basenamer�debug)Zpy_files�optimizeZforcerUZbase_dirrorpZdirectr�r{Z	script_fdZscript_namer}Zscript�cmdr$�file�opt�cfile�dfileZ
cfile_baser-r-r.�byte_compileBsx$

�
�

���r�cCs|�d�}d}|�|�S)z�Return a version of the string escaped for inclusion in an
    RFC-822 header, by ensuring there are 8 spaces space after each newline.
    �
z	
        )r6r:)�header�linesr4r-r-r.�
rfc822_escape�s
r�cCsV|sdSddlm}m}Gdd�d|�}|dkr8|d�}|||d�}|j|dd	�dS)
aInvoke 2to3 on a list of Python files.
    The files should all come from the build area, as the
    modification is done in-place. To reduce the build time,
    only files modified since the last invocation of this
    function should be passed in the files argument.Nr)�RefactoringTool�get_fixers_from_packagec@s$eZdZdd�Zdd�Zdd�ZdS)z*run_2to3.<locals>.DistutilsRefactoringToolc_stj|f|��dSrS)r�error)�selfrnrm�kwr-r-r.�	log_error�sz4run_2to3.<locals>.DistutilsRefactoringTool.log_errorcWstj|f|��dSrS)rrk�r�rnrmr-r-r.�log_message�sz6run_2to3.<locals>.DistutilsRefactoringTool.log_messagecWstj|f|��dSrS)rr�r�r-r-r.�	log_debug�sz4run_2to3.<locals>.DistutilsRefactoringTool.log_debugN)rj�
__module__�__qualname__r�r�r�r-r-r-r.�DistutilsRefactoringTool�sr�z
lib2to3.fixes)�optionsT)r�)Zlib2to3.refactorr�r�Zrefactor)�files�fixer_namesr��explicitr�r�r��rr-r-r.�run_2to3�s
r�c	Csddlm}ddlm}ddlm}|�}	t��}
t�|�z|	�	�W5t�|
�X|	j
|	jdd�<|r�|��D]}|�
�}|s�qr|	�|�qrg}|	jD]L}
tj�||
�}|tj�|��|tj�||
�|dd�}|dr�|�|�q�tdd	�|D�|||d
�|S)z�Recursively copy a directory, only copying new and changed files,
    running run_2to3 over all newly copied Python modules afterward.

    If you give a template string, it's parsed like a MANIFEST.in.
    r)�mkpath)�	copy_file)�FileListNr>)�updatecSsg|]}|���d�r|�qS)r|)r�endswith)�.0�fnr-r-r.�
<listcomp>sz$copydir_run_2to3.<locals>.<listcomp>)r�r�r�)Zdistutils.dir_utilr�Zdistutils.file_utilr�Zdistutils.filelistr�r�getcwd�chdir�findallZallfilesr��
splitlinesr_Zprocess_template_liner9r:�dirnamerbr�)�src�dest�templater�r�r�r�r�r�Zfilelistr8�lineZcopied�filenameZoutname�resr-r-r.�copydir_run_2to3�s:

�r�c@s$eZdZdZdZdZdZdd�ZdS)�	Mixin2to3z�Mixin class for commands that run 2to3.
    To configure 2to3, setup scripts may either change
    the class variables, or inherit from individual commands
    to override how 2to3 is invoked.NcCst||j|j|j�SrS)r�r�r�r�)r�r�r-r-r.r�-szMixin2to3.run_2to3)rjr�r��__doc__r�r�r�r�r-r-r-r.r�s
r�)rR)Nrr)rrNNr>rN)NNN)NNNN)$r�rr#�importlib.utilr�rWrZdistutils.errorsrZdistutils.dep_utilrZdistutils.spawnrr,rrr/r1r=rBrDrJrQrVrYrZr[r\rgrqrzr�r�r�r�r�r-r-r-r.�<module>sNO
=
�


�
!distutils/__pycache__/archive_util.cpython-38.pyc000064400000014615151153537450016126 0ustar00U

e5d|!�@sDdZddlZddlmZddlZzddlZWnek
rDdZYnXddlmZddl	m
Z
ddlmZddl
mZzddlmZWnek
r�dZYnXzdd	lmZWnek
r�dZYnXd
d�Zdd
�Zd#dd�Zd$dd�Zedgdfedgdfedgdfedgdfedgdfegdfd�Zdd �Zd%d!d"�ZdS)&zodistutils.archive_util

Utility functions for creating archive files (tarballs, zip files,
that sort of thing).�N)�warn)�DistutilsExecError)�spawn)�mkpath)�log)�getpwnam)�getgrnamcCsNtdks|dkrdSzt|�}Wntk
r8d}YnX|dk	rJ|dSdS)z"Returns a gid, given a group name.N�)r�KeyError��name�result�r�./usr/lib64/python3.8/distutils/archive_util.py�_get_gids
rcCsNtdks|dkrdSzt|�}Wntk
r8d}YnX|dk	rJ|dSdS)z"Returns an uid, given a user name.Nr	)rr
rrrr�_get_uid+s
r�gzipcs.dddddd�}dddd	d
�}|dk	r:||��kr:td��|d
}	|dkrZ|	|�|d�7}	ttj�|	�|d�ddl}
t�	d�t
���t�������fdd�}|s�|
�|	d||�}z|j||d�W5|�
�X|dk�r*tdt�|	||}
tjdk�r||	|
g}n
|d|	g}t||d�|
S|	S)a=Create a (possibly compressed) tar file from all the files under
    'base_dir'.

    'compress' must be "gzip" (the default), "bzip2", "xz", "compress", or
    None.  ("compress" will be deprecated in Python 3.2)

    'owner' and 'group' can be used to define an owner and a group for the
    archive that is being built. If not provided, the current owner and group
    will be used.

    The output tar file will be named 'base_dir' +  ".tar", possibly plus
    the appropriate compression extension (".gz", ".bz2", ".xz" or ".Z").

    Returns the output filename.
    Zgz�bz2�xz�)r�bzip2rN�compressz.gzz.bz2z.xzz.Z)rrrrNzKbad value for 'compress': must be None, 'gzip', 'bzip2', 'xz' or 'compress'z.tarr��dry_runrzCreating tar archivecs,�dk	r�|_�|_�dk	r(�|_�|_|S)N)�gidZgname�uid�uname)Ztarinfo�r�group�ownerrrr�_set_uid_gidasz"make_tarball.<locals>._set_uid_gidzw|%s)�filterz'compress' will be deprecated.Zwin32z-f)�keys�
ValueError�getr�os�path�dirname�tarfiler�inforr�open�close�addr�PendingDeprecationWarning�sys�platformr)�	base_name�base_dirr�verboserrrZtar_compressionZcompress_extZarchive_namer(r �tarZcompressed_name�cmdrrr�make_tarball7sB���
	



r5c
Cs�|d}ttj�|�|d�tdkrp|r.d}nd}ztd|||g|d�Wn tk
rjtd|��YnX�n8t�d||�|�s�ztj	|d	tj
d
�}Wn&tk
r�tj	|d	tjd
�}YnX|��|tj
k�rtj�tj�|d��}|�||�t�d|�t�|�D]�\}}	}
|	D]6}tj�tj�||d��}|�||�t�d|��q|
D]B}tj�tj�||��}tj�|��rV|�||�t�d|��qV�qW5QRX|S)
avCreate a zip file from all the files under 'base_dir'.

    The output zip file will be named 'base_name' + ".zip".  Uses either the
    "zipfile" Python module (if available) or the InfoZIP "zip" utility
    (if installed and found on the default search path).  If neither tool is
    available, raises DistutilsExecError.  Returns the name of the output zip
    file.
    z.ziprNz-rz-rq�zipzkunable to create zip file '%s': could neither import the 'zipfile' module nor find a standalone zip utilityz#creating '%s' and adding '%s' to it�w)Zcompressionrzadding '%s')rr%r&r'�zipfilerrrr)ZZipFileZZIP_DEFLATED�RuntimeErrorZ
ZIP_STORED�curdir�normpath�join�write�walk�isfile)r0r1r2rZzip_filenameZ
zipoptionsr6r&�dirpathZdirnames�	filenamesrrrr�make_zipfilesV	�
���
�rB)rrzgzip'ed tar-file)rrzbzip2'ed tar-file)rrzxz'ed tar-file)rrzcompressed tar file)rNzuncompressed tar filezZIP file)ZgztarZbztarZxztarZztarr3r6cCs|D]}|tkr|SqdS)zqReturns the first format from the 'format' list that is unknown.

    If all formats are known, returns None
    N)�ARCHIVE_FORMATS)Zformats�formatrrr�check_archive_formats�s
rEc
Cs�t��}|dk	r6t�d|�tj�|�}|s6t�|�|dkrDtj}d|i}	zt|}
Wn t	k
rxt
d|��YnX|
d}|
dD]\}}
|
|	|<q�|dkr�||	d<||	d	<z|||f|	�}W5|dk	r�t�d
|�t�|�X|S)a�Create an archive file (eg. zip or tar).

    'base_name' is the name of the file to create, minus any format-specific
    extension; 'format' is the archive format: one of "zip", "tar", "gztar",
    "bztar", "xztar", or "ztar".

    'root_dir' is a directory that will be the root directory of the
    archive; ie. we typically chdir into 'root_dir' before creating the
    archive.  'base_dir' is the directory where we start archiving from;
    ie. 'base_dir' will be the common prefix of all files and
    directories in the archive.  'root_dir' and 'base_dir' both default
    to the current directory.  Returns the name of the archive file.

    'owner' and 'group' are used when creating a tar archive. By default,
    uses the current owner and group.
    Nzchanging into '%s'rzunknown archive format '%s'r�r6rrzchanging back to '%s')r%�getcwdr�debugr&�abspath�chdirr:rCr
r#)r0rDZroot_dirr1r2rrrZsave_cwd�kwargsZformat_info�func�arg�val�filenamerrr�make_archive�s2

rP)rrrNN)rr)NNrrNN)�__doc__r%�warningsrr.r8�ImportErrorZdistutils.errorsrZdistutils.spawnrZdistutils.dir_utilrZ	distutilsr�pwdrZgrprrrr5rBrCrErPrrrr�<module>sN


�
H
=




�	
�distutils/__pycache__/filelist.cpython-38.pyc000064400000023215151153537450015257 0ustar00U

e5d 2�@s�dZddlZddlZddlZddlZddlmZddlmZm	Z	ddl
mZGdd�d�Zdd	�Z
ejfd
d�Zdd
�Zddd�ZdS)zsdistutils.filelist

Provides the FileList class, used for poking about the filesystem
and building lists of files.
�N��convert_path)�DistutilsTemplateError�DistutilsInternalError)�logc@s|eZdZdZddd�Zdd�Zejfdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zddd�Zddd�ZdS) �FileLista�A list of files built by on exploring the filesystem and filtered by
    applying various patterns to what we find there.

    Instance attributes:
      dir
        directory from which files will be taken -- only used if
        'allfiles' not supplied to constructor
      files
        list of filenames currently being built/filtered/manipulated
      allfiles
        complete list of files under consideration (ie. without any
        filtering applied)
    NcCsd|_g|_dS�N)�allfiles�files)�self�warn�debug_print�r�*/usr/lib64/python3.8/distutils/filelist.py�__init__szFileList.__init__cCs
||_dSr)r	)rr	rrr�set_allfiles#szFileList.set_allfilescCst|�|_dSr)�findallr	)r�dirrrrr&szFileList.findallcCsddlm}|rt|�dS)z~Print 'msg' to stdout if the global DEBUG (taken from the
        DISTUTILS_DEBUG environment variable) flag is true.
        r)�DEBUGN)Zdistutils.debugr�print)r�msgrrrrr
)szFileList.debug_printcCs|j�|�dSr)r
�append)r�itemrrrr3szFileList.appendcCs|j�|�dSr)r
�extend)r�itemsrrrr6szFileList.extendcCs<tttjj|j��}g|_|D]}|j�tjj|��qdSr)�sorted�map�os�path�splitr
r�join)rZsortable_filesZ
sort_tuplerrr�sort9sz
FileList.sortcCs@tt|j�ddd�D]$}|j||j|dkr|j|=qdS)N�r���)�range�lenr
)r�irrr�remove_duplicatesCszFileList.remove_duplicatescCs�|��}|d}d}}}|dkrTt|�dkr<td|��dd�|dd�D�}n~|dkr�t|�d	krttd
|��t|d�}dd�|dd�D�}n:|dkr�t|�dkr�td
|��t|d�}ntd|��||||fS)Nr)�include�exclude�global-include�global-exclude�z&'%s' expects <pattern1> <pattern2> ...cSsg|]}t|��qSrr��.0�wrrr�
<listcomp>Wsz1FileList._parse_template_line.<locals>.<listcomp>r")�recursive-include�recursive-exclude�z,'%s' expects <dir> <pattern1> <pattern2> ...cSsg|]}t|��qSrrr-rrrr0]s)�graft�prunez#'%s' expects a single <dir_pattern>zunknown action '%s')rr%rr)r�lineZwords�action�patternsr�dir_patternrrr�_parse_template_lineLs0���zFileList._parse_template_linecCs@|�|�\}}}}|dkrV|�dd�|��|D]}|j|dd�s2t�d|�q2�n�|dkr�|�dd�|��|D]}|j|dd�svt�d	|�qv�n�|d
kr�|�dd�|��|D]}|j|dd�s�t�d
|�q��n^|dk�r(|�dd�|��|D]"}|j|dd��st�d|��q�n|dk�rv|�d|d�|�f�|D]$}|j||d��sNt�d||��qNn�|dk�r�|�d|d�|�f�|D]$}|j||d��s�t�d||��q�nx|dk�r�|�d|�|jd|d��s<t�d|�nB|dk�r0|�d|�|jd|d��s<t�d|�ntd|��dS)Nr(zinclude � r")�anchorz%warning: no files found matching '%s'r)zexclude z9warning: no previously-included files found matching '%s'r*zglobal-include rz>warning: no files found matching '%s' anywhere in distributionr+zglobal-exclude zRwarning: no previously-included files matching '%s' found anywhere in distributionr1zrecursive-include %s %s)�prefixz:warning: no files found matching '%s' under directory '%s'r2zrecursive-exclude %s %szNwarning: no previously-included files matching '%s' found under directory '%s'r4zgraft z+warning: no directories found matching '%s'r5zprune z6no previously-included directories found matching '%s'z'this cannot happen: invalid action '%s')r:r
r �include_patternrr�exclude_patternr)rr6r7r8rr9�patternrrr�process_template_linehs��
�
�

�
��

��

�
��zFileList.process_template_liner"rcCsld}t||||�}|�d|j�|jdkr4|��|jD],}|�|�r:|�d|�|j�|�d}q:|S)a�Select strings (presumably filenames) from 'self.files' that
        match 'pattern', a Unix-style wildcard (glob) pattern.  Patterns
        are not quite the same as implemented by the 'fnmatch' module: '*'
        and '?'  match non-special characters, where "special" is platform-
        dependent: slash on Unix; colon, slash, and backslash on
        DOS/Windows; and colon on Mac OS.

        If 'anchor' is true (the default), then the pattern match is more
        stringent: "*.py" will match "foo.py" but not "foo/bar.py".  If
        'anchor' is false, both of these will match.

        If 'prefix' is supplied, then only filenames starting with 'prefix'
        (itself a pattern) and ending with 'pattern', with anything in between
        them, will match.  'anchor' is ignored in this case.

        If 'is_regex' is true, 'anchor' and 'prefix' are ignored, and
        'pattern' is assumed to be either a string containing a regex or a
        regex object -- no translation is done, the regex is just compiled
        and used as-is.

        Selected strings will be added to self.files.

        Return True if files are found, False otherwise.
        Fz%include_pattern: applying regex r'%s'Nz adding T)�translate_patternr
r@r	r�searchr
r)rr@r<r=�is_regex�files_found�
pattern_re�namerrrr>�s�


zFileList.include_patterncCsrd}t||||�}|�d|j�tt|j�ddd�D]4}|�|j|�r8|�d|j|�|j|=d}q8|S)aRemove strings (presumably filenames) from 'files' that match
        'pattern'.  Other parameters are the same as for
        'include_pattern()', above.
        The list 'self.files' is modified in place.
        Return True if files are found, False otherwise.
        Fz%exclude_pattern: applying regex r'%s'r"r#z
 removing T)rBr
r@r$r%r
rC)rr@r<r=rDrErFr&rrrr?�s�zFileList.exclude_pattern)NN)r"Nr)r"Nr)�__name__�
__module__�__qualname__�__doc__rrr�curdirrr
rrr!r'r:rAr>r?rrrrrs 


	L
,�rcCs&dd�tj|dd�D�}ttjj|�S)z%
    Find all files under 'path'
    css,|]$\}}}|D]}tj�||�VqqdSr)rrr )r.�base�dirsr
�filerrr�	<genexpr>�s�z#_find_all_simple.<locals>.<genexpr>T)�followlinks)r�walk�filterr�isfile)rZresultsrrr�_find_all_simple�s�rUcCs6t|�}|tjkr.tjtjj|d�}t||�}t|�S)z�
    Find all files under 'dir' and return the list of full filenames.
    Unless dir is '.', return full filenames with dir prepended.
    )�start)	rUrrL�	functools�partialr�relpathr�list)rr
Zmake_relrrrrs


rcCs8t�|�}tj}tjdkrd}d|}t�d||�}|S)z�Translate a shell-like glob pattern to a regular expression; return
    a string containing the regex.  Differs from 'fnmatch.translate()' in
    that '*' does not match "special characters" (which are
    platform-specific).
    �\z\\\\z\1[^%s]z((?<!\\)(\\\\)*)\.)�fnmatch�	translater�sep�re�sub)r@rFr^Zescapedrrr�
glob_to_res

rar"c
Cs
|rt|t�rt�|�S|Std��d�\}}}|rVt|�}|�|�rP|�|�sZt�nd}|dk	r�t|�}|�|�r~|�|�s�t�|t	|�t	|�t	|��}t
j}	t
jdkr�d}	|t	|�t	|�t	|��}d|||	||f}n|�rd||t	|�d�f}t�|�S)aTranslate a shell-like wildcard pattern to a compiled regular
    expression.  Return the compiled regex.  If 'is_regex' true,
    then 'pattern' is directly compiled to a regex (if it's a string)
    or just returned as-is (assumes it's a regex object).
    �_�Nr[z\\z%s\A%s%s.*%s%sz%s\A%s)�
isinstance�strr_�compilera�	partition�
startswith�endswith�AssertionErrorr%rr^)
r@r<r=rDrVrb�endrFZ	prefix_rer^rrrrB%s*


rB)r"Nr)rKrr_r\rWZdistutils.utilrZdistutils.errorsrrZ	distutilsrrrUrLrrarBrrrr�<module>sidistutils/__pycache__/text_file.cpython-38.opt-1.pyc000064400000020371151153537450016366 0ustar00U

e5d�0�@s&dZddlZddlZGdd�d�ZdS)z�text_file

provides the TextFile class, which gives an interface to text files
that (optionally) takes care of stripping comments, ignoring blank
lines, and joining lines with backslashes.�Nc@steZdZdZdddddddd�Zddd�Zd	d
�Zdd�Zdd
d�Zddd�Z	ddd�Z
dd�Zdd�Zdd�Z
dS)�TextFilea�Provides a file-like object that takes care of all the things you
       commonly want to do when processing a text file that has some
       line-by-line syntax: strip comments (as long as "#" is your
       comment character), skip blank lines, join adjacent lines by
       escaping the newline (ie. backslash at end of line), strip
       leading and/or trailing whitespace.  All of these are optional
       and independently controllable.

       Provides a 'warn()' method so you can generate warning messages that
       report physical line number, even if the logical line in question
       spans multiple physical lines.  Also provides 'unreadline()' for
       implementing line-at-a-time lookahead.

       Constructor is called as:

           TextFile (filename=None, file=None, **options)

       It bombs (RuntimeError) if both 'filename' and 'file' are None;
       'filename' should be a string, and 'file' a file object (or
       something that provides 'readline()' and 'close()' methods).  It is
       recommended that you supply at least 'filename', so that TextFile
       can include it in warning messages.  If 'file' is not supplied,
       TextFile creates its own using 'io.open()'.

       The options are all boolean, and affect the value returned by
       'readline()':
         strip_comments [default: true]
           strip from "#" to end-of-line, as well as any whitespace
           leading up to the "#" -- unless it is escaped by a backslash
         lstrip_ws [default: false]
           strip leading whitespace from each line before returning it
         rstrip_ws [default: true]
           strip trailing whitespace (including line terminator!) from
           each line before returning it
         skip_blanks [default: true}
           skip lines that are empty *after* stripping comments and
           whitespace.  (If both lstrip_ws and rstrip_ws are false,
           then some lines may consist of solely whitespace: these will
           *not* be skipped, even if 'skip_blanks' is true.)
         join_lines [default: false]
           if a backslash is the last non-newline character on a line
           after stripping comments and whitespace, join the following line
           to it to form one "logical line"; if N consecutive lines end
           with a backslash, then N+1 physical lines will be joined to
           form one logical line.
         collapse_join [default: false]
           strip leading whitespace from lines that are joined to their
           predecessor; only matters if (join_lines and not lstrip_ws)
         errors [default: 'strict']
           error handler used to decode the file content

       Note that since 'rstrip_ws' can strip the trailing newline, the
       semantics of 'readline()' must differ from those of the builtin file
       object's 'readline()' method!  In particular, 'readline()' returns
       None for end-of-file: an empty string might just be a blank line (or
       an all-whitespace line), if 'rstrip_ws' is true but 'skip_blanks' is
       not.�r�strict)�strip_comments�skip_blanks�	lstrip_ws�	rstrip_ws�
join_lines�
collapse_join�errorsNcKs�|dkr|dkrtd��|j��D]0}||kr@t||||�q"t|||j|�q"|��D]}||jkr\td|��q\|dkr�|�|�n||_||_d|_g|_	dS)z�Construct a new TextFile object.  At least one of 'filename'
           (a string) and 'file' (a file-like object) must be supplied.
           They keyword argument options are described above and affect
           the values returned by 'readline()'.Nz7you must supply either or both of 'filename' and 'file'zinvalid TextFile option '%s'r)
�RuntimeError�default_options�keys�setattr�KeyError�open�filename�file�current_line�linebuf)�selfrrZoptions�opt�r�+/usr/lib64/python3.8/distutils/text_file.py�__init__Ns
zTextFile.__init__cCs&||_tj|jd|jd�|_d|_dS)zyOpen a new file named 'filename'.  This overrides both the
           'filename' and 'file' arguments to the constructor.�r)rrN)r�iorrrr)rrrrrrosz
TextFile.opencCs$|j}d|_d|_d|_|��dS)ziClose the current file and forget everything we know about it
           (filename, current line number).N)rrr�close)rrrrrrvs
zTextFile.closecCsjg}|dkr|j}|�|jd�t|ttf�rD|�dt|��n|�d|�|�t|��d�|�S)Nz, z
lines %d-%d: z	line %d: �)r�appendr�
isinstance�list�tuple�str�join)r�msg�lineZoutmsgrrr�	gen_errorszTextFile.gen_errorcCstd|�||���dS)Nzerror: )�
ValueErrorr'�rr%r&rrr�error�szTextFile.errorcCs tj�d|�||�d�dS)a�Print (to stderr) a warning message tied to the current logical
           line in the current file.  If the current logical line in the
           file spans multiple physical lines, the warning refers to the
           whole range, eg. "lines 3-5".  If 'line' supplied, it overrides
           the current line number; it may be a list or tuple to indicate a
           range of physical lines, or an integer for a single physical
           line.z	warning: �
N)�sys�stderr�writer'r)rrr�warn�sz
TextFile.warncCs�|jr|jd}|jd=|Sd}|j��}|dkr6d}|jr�|r�|�d�}|dkrTnX|dksl||ddkr�|ddkr|dp~d}|d|�|}|��dkr�q n|�d	d�}|j�r|�r|dkr�|�d
�|S|j	r�|�
�}||}t|jt
��r
|jdd|jd<n|j|jdg|_n:|dk�r,dSt|jt
��rL|jdd|_n|jd|_|j�rr|j�rr|��}n"|j�r�|�
�}n|j�r�|��}|dk�s�|dk�r�|j�r�q |j�r�|ddk�r�|dd�}q |dd�dk�r�|dd�d}q |S)
aURead and return a single logical line from the current file (or
           from an internal buffer if lines have previously been "unread"
           with 'unreadline()').  If the 'join_lines' option is true, this
           may involve reading multiple physical lines concatenated into a
           single string.  Updates the current line number, so calling
           'warn()' after 'readline()' emits a warning about the physical
           line(s) just read.  Returns None on end-of-file, since the empty
           string can occur if 'rstrip_ws' is true but 'strip_blanks' is
           not.���rN�#rr�\r+z\#z2continuation line immediately precedes end-of-file���z\
)rr�readliner�find�strip�replacer	r/r
�lstripr rr!rr�rstripr)rr&Zbuildup_line�posZeolrrrr4�sf




	
�


zTextFile.readlinecCs(g}|��}|dkr|S|�|�qdS)zWRead and return the list of all logical lines remaining in the
           current file.N)r4r)r�linesr&rrr�	readliness
zTextFile.readlinescCs|j�|�dS)z�Push 'line' (a string) onto an internal buffer that will be
           checked by future 'readline()' calls.  Handy for implementing
           a parser with line-at-a-time lookahead.N)rr)rr&rrr�
unreadlineszTextFile.unreadline)NN)N)N)N)�__name__�
__module__�__qualname__�__doc__r
rrrr'r*r/r4r<r=rrrrr
s$:�	
!	



x
r)rAr,rrrrrr�<module>sdistutils/__pycache__/core.cpython-38.opt-1.pyc000064400000014730151153537450015335 0ustar00U

e5d�"�@s�dZddlZddlZddlmZddlTddlmZddlm	Z	ddl
mZddlm
Z
d	Zd
d�ZdadadZd
Zdd�Zddd�ZdS)a#distutils.core

The only module that needs to be imported to use the Distutils; provides
the 'setup' function (which is to be called from the setup script).  Also
indirectly provides the Distribution and Command classes, although they are
really defined in distutils.dist and distutils.cmd.
�N)�DEBUG)�*)�Distribution)�Command)�
PyPIRCCommand)�	Extensionz�usage: %(script)s [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: %(script)s --help [cmd1 cmd2 ...]
   or: %(script)s --help-commands
   or: %(script)s cmd --help
cCstj�|�}tt�S)N)�os�path�basename�USAGE�vars)�script_nameZscript�r�&/usr/lib64/python3.8/distutils/core.py�	gen_usage sr)�	distclassr
�script_argsZoptions�name�versionZauthorZauthor_emailZ
maintainerZmaintainer_emailZurl�licenseZdescriptionZlong_description�keywordsZ	platformsZclassifiersZdownload_urlZrequiresZprovidesZ	obsoletes)rZsourcesZinclude_dirsZ
define_macrosZundef_macrosZlibrary_dirsZ	librariesZruntime_library_dirsZ
extra_objectsZextra_compile_argsZextra_link_argsZ	swig_optsZexport_symbolsZdependsZlanguagec
Ks|�d�}|r|d=nt}d|kr8tj�tjd�|d<d|krRtjdd�|d<z||�a}WnLtk
r�}z.d|kr�t	d|��nt	d	|d|f��W5d}~XYnXt
d
kr�|S|��tr�t
d�|��t
dkr�|Sz|��}Wn:tk
�r*}zt	t|j�d
|��W5d}~XYnXt�rBt
d�|��t
dk�rP|S|�rz|��Wn�tk
�r�t	d��Yn�tk
�r�}z.t�r�tj�d|f��nt	d|f��W5d}~XYnBttfk
�r}zt�r�nt	dt|���W5d}~XYnX|S)a�The gateway to the Distutils: do everything your setup script needs
    to do, in a highly flexible and user-driven way.  Briefly: create a
    Distribution instance; find and parse config files; parse the command
    line; run each Distutils command found there, customized by the options
    supplied to 'setup()' (as keyword arguments), in config files, and on
    the command line.

    The Distribution instance might be an instance of a class supplied via
    the 'distclass' keyword argument to 'setup'; if no such class is
    supplied, then the Distribution class (in dist.py) is instantiated.
    All other arguments to 'setup' (except for 'cmdclass') are used to set
    attributes of the Distribution instance.

    The 'cmdclass' argument, if supplied, is a dictionary mapping command
    names to command classes.  Each command encountered on the command line
    will be turned into a command class, which is in turn instantiated; any
    class found in 'cmdclass' is used in place of the default, which is
    (for command 'foo_bar') class 'foo_bar' in module
    'distutils.command.foo_bar'.  The command class must provide a
    'user_options' attribute which is a list of option specifiers for
    'distutils.fancy_getopt'.  Any command-line options between the current
    and the next command are used to set attributes of the current command
    object.

    When the entire command-line has been successfully parsed, calls the
    'run()' method on each command object in turn.  This method will be
    driven entirely by the Distribution object (which each command object
    has a reference to, thanks to its constructor), and the
    command-specific options that became attributes of each command
    object.
    rr
rr�Nrzerror in setup command: %szerror in %s setup command: %s�initz%options (after parsing config files):�configz

error: %sz%options (after parsing command line):�commandlineZinterruptedz
error: %s
z	error: %szerror: )�getrrr	r
�sys�argv�_setup_distributionZDistutilsSetupError�
SystemExit�_setup_stop_afterZparse_config_filesr�printZdump_option_dictsZparse_command_lineZDistutilsArgErrorrr
Zrun_commands�KeyboardInterrupt�OSError�stderr�writeZDistutilsErrorZCCompilerError�str)�attrs�klassZdist�msg�ok�excrrr�setup9sd%

�(
�"r,�runc	Cs�|dkrtd|f��|atj��}d|i}zZzH|tjd<|dk	rP|tjdd�<t|d��}t|��|�W5QRXW5|t_daXWntk
r�YnXt	dkr�t
d|��t	S)	a.Run a setup script in a somewhat controlled environment, and
    return the Distribution instance that drives things.  This is useful
    if you need to find out the distribution meta-data (passed as
    keyword args from 'script' to 'setup()', or the contents of the
    config files or command-line.

    'script_name' is a file that will be read and run with 'exec()';
    'sys.argv[0]' will be replaced with 'script' for the duration of the
    call.  'script_args' is a list of strings; if supplied,
    'sys.argv[1:]' will be replaced by 'script_args' for the duration of
    the call.

    'stop_after' tells 'setup()' when to stop processing; possible
    values:
      init
        stop after the Distribution instance has been created and
        populated with the keyword arguments to 'setup()'
      config
        stop after config files have been parsed (and their data
        stored in the Distribution instance)
      commandline
        stop after the command-line ('sys.argv[1:]' or 'script_args')
        have been parsed (and the data stored in the Distribution)
      run [default]
        stop after all commands have been run (the same as if 'setup()'
        had been called in the usual way

    Returns the Distribution instance, which provides all information
    used to drive the Distutils.
    )rrrr-z"invalid value for 'stop_after': %r�__file__Nrr�rbzZ'distutils.core.setup()' was never called -- perhaps '%s' is not a Distutils setup script?)�
ValueErrorr rr�copy�open�exec�readrr�RuntimeError)r
rZ
stop_afterZ	save_argv�g�frrr�	run_setup�s*


�r8)Nr-)�__doc__rrZdistutils.debugrZdistutils.errorsZdistutils.distrZ
distutils.cmdrZdistutils.configrZdistutils.extensionrrrr rZsetup_keywordsZextension_keywordsr,r8rrrr�<module>s 	qdistutils/__pycache__/msvc9compiler.cpython-38.opt-1.pyc000064400000042055151153537450017202 0ustar00U

e5d/w�@sRdZddlZddlZddlZddlZddlmZmZmZm	Z	m
Z
ddlmZm
Z
mZddlmZddlmZddlZejZejZejZejZejejejejfZ ej!dko�ej"dkZ#e#r�d	Z$d
Z%dZ&ndZ$d
Z%dZ&ddd�Z'Gdd�d�Z(Gdd�d�Z)dd�Z*dd�Z+dd�Z,dd�Z-d$dd�Z.e*�Z/e/d k�r>ed!e/��Gd"d#�d#e�Z0dS)%adistutils.msvc9compiler

Contains MSVCCompiler, an implementation of the abstract CCompiler class
for the Microsoft Visual Studio 2008.

The module is compatible with VS 2005 and VS 2008. You can find legacy support
for older versions of VS in distutils.msvccompiler.
�N)�DistutilsExecError�DistutilsPlatformError�CompileError�LibError�	LinkError)�	CCompiler�gen_preprocess_options�gen_lib_options)�log)�get_platform�win32lz1Software\Wow6432Node\Microsoft\VisualStudio\%0.1fz5Software\Wow6432Node\Microsoft\Microsoft SDKs\Windowsz,Software\Wow6432Node\Microsoft\.NETFrameworkz%Software\Microsoft\VisualStudio\%0.1fz)Software\Microsoft\Microsoft SDKs\Windowsz Software\Microsoft\.NETFramework�x86Zamd64�rz	win-amd64c@sPeZdZdZdd�Zee�Zdd�Zee�Zdd�Zee�Zdd	�Ze	e�Zd
S)�Regz2Helper class to read values from the registry
    cCs:tD](}|�||�}|r||kr||Sqt|��dS�N)�HKEYS�read_values�KeyError)�cls�path�key�base�d�r�//usr/lib64/python3.8/distutils/msvc9compiler.py�	get_value@s
z
Reg.get_valuecCsnzt||�}Wntk
r$YdSXg}d}zt||�}Wntk
rTYqjYnX|�|�|d7}q.|S)zReturn list of registry keys.Nr�)�RegOpenKeyEx�RegError�
RegEnumKey�append)rrr�handle�L�i�krrr�	read_keysHs


z
Reg.read_keysc	Cs�zt||�}Wntk
r$YdSXi}d}zt||�\}}}Wntk
rZYq�YnX|��}|�|�||�|�<|d7}q.|S)z`Return dict of registry keys and values.

        All names are converted to lowercase.
        Nrr)rr�RegEnumValue�lower�convert_mbcs)	rrrr!rr#�name�value�typerrrrZs

zReg.read_valuescCs:t|dd�}|dk	r6z|d�}Wntk
r4YnX|S)N�decode�mbcs)�getattr�UnicodeError)�sZdecrrrr(pszReg.convert_mbcsN)
�__name__�
__module__�__qualname__�__doc__r�classmethodr%rr(�staticmethodrrrrr<src@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�
MacroExpandercCsi|_t||_|�|�dSr)�macros�VS_BASE�vsbase�load_macros)�self�versionrrr�__init__|s
zMacroExpander.__init__cCst�||�|jd|<dS)Nz$(%s))rrr8)r<Zmacrorrrrr�	set_macro�szMacroExpander.set_macroc	Cs|�d|jdd�|�d|jdd�|�dtd�z$|dkrP|�d	td
�ntd
��Wntk
rvtd��YnX|dkr�|�d
|jd�|�dtd�nbd}tD]X}zt||�}Wntk
r�Yq�YnXt	|d�}t
�|d||f�}|d|jd<q�dS)NZVCInstallDirz	\Setup\VC�
productdirZVSInstallDirz	\Setup\VSZFrameworkDirZinstallroot� @ZFrameworkSDKDirzsdkinstallrootv2.0aPython was built with Visual Studio 2008;
extensions must be built with a compiler than can generate compatible binaries.
Visual Studio 2008 was not found on this system. If you have Cygwin installed,
you can try compiling with MingW32, by passing "-c mingw32" to setup.py.g"@ZFrameworkVersionzclr versionZ
WindowsSdkDirZcurrentinstallfolderz.Software\Microsoft\NET Framework Setup\Productrz%s\%sr=z$(FrameworkVersion))
r?r:�NET_BASErr�WINSDK_BASErrrrrrr8)r<r=�pr�hrrrrrr;�s2��


zMacroExpander.load_macroscCs$|j��D]\}}|�||�}q
|Sr)r8�items�replace)r<r0r$�vrrr�sub�szMacroExpander.subN)r1r2r3r>r?r;rIrrrrr7zsr7cCs�d}tj�|�}|dkrdS|t|�}tj|d��dd�\}}t|dd��d}|dkrf|d7}t|d	d
��d}|dkr�d}|dkr�||SdS)
z�Return the version of MSVC that was used to build Python.

    For Python 2.3 and up, the version number is included in
    sys.version.  For earlier versions, assume the compiler is MSVC 6.
    zMSC v.����N� r����
��g$@r)�sysr=�find�len�split�int)�prefixr#r0�restZmajorVersionZminorVersionrrr�get_build_version�srXcCs0g}|D]"}tj�|�}||kr|�|�q|S)znReturn a list of normalized paths with duplicates removed.

    The current order of paths is maintained.
    )�osr�normpathr )�pathsZ
reduced_pathsrDZnprrr�normalize_and_reduce_paths�sr\cCs<|�tj�}g}|D]}||kr|�|�qtj�|�}|S)z8Remove duplicate values of an environment variable.
    )rTrY�pathsepr �join)ZvariableZoldListZnewListr#ZnewVariablerrr�removeDuplicates�sr_cCst|}zt�d|d�}Wn"tk
r>t�d�d}YnX|rPtj�|�s�d|}tj	�
|d�}|r�tj�|�r�tj�|tjtjd�}tj�
|�}tj�|�s�t�d|�dSnt�d|�|s�t�d	�dStj�|d
�}tj�|�r�|St�d�dS)z�Find the vcvarsall.bat file

    At first it tries to find the productdir of VS 2008 in the registry. If
    that fails it falls back to the VS90COMNTOOLS env var.
    z%s\Setup\VCr@z%Unable to find productdir in registryNzVS%0.f0COMNTOOLSZVCz%s is not a valid directoryz Env var %s is not set or invalidzNo productdir foundz
vcvarsall.bat�Unable to find vcvarsall.bat)r9rrrr
�debugrYr�isdir�environ�getr^�pardir�abspath�isfile)r=r:r@ZtoolskeyZtoolsdir�	vcvarsallrrr�find_vcvarsall�s4
�



ricCs8t|�}ddddh}i}|dkr(td��t�d||�tjd||ftjtjd	�}z�|�
�\}}|��d
krzt|�d���|�d�}|�
d�D]d}t�|�}d
|kr�q�|��}|�
d
d�\}	}
|	��}	|	|kr�|
�tj�r�|
dd�}
t|
�||	<q�W5|j��|j	��Xt|�t|�k�r4ttt|������|S)zDLaunch vcvarsall.bat and read the settings from its environment
    �include�libZlibpathrNr`z'Calling 'vcvarsall.bat %s' (version=%s)z
"%s" %s & set)�stdout�stderrrr-�
�=rrJ)rirr
ra�
subprocess�Popen�PIPErl�closermZcommunicate�waitr,rTrr(�stripr'�endswithrYr]r_rS�
ValueError�str�list�keys)r=ZarchrhZinteresting�result�popenrlrm�linerr*rrr�query_vcvarsall�s>�


r~rAz(VC %0.1f is not supported by this modulec
@s�eZdZdZdZiZdgZdddgZdgZdgZ	eeee	Z
d	Zd
ZdZ
dZd
ZZdZd.dd�Zd/dd�Zd0dd�Zd1dd�Zd2dd�Zd3dd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd4d*d+�Zd,d-�ZdS)5�MSVCCompilerzwConcrete class that implements an interface to Microsoft Visual C++,
       as defined by the CCompiler abstract class.Zmsvcz.cz.ccz.cppz.cxx�.rcz.mcz.resz.objz.libz.dllz%s%sz.exercCs8t�||||�t|_d|_g|_d|_d|_d|_dS)NzSoftware\Microsoft\VisualStudioF)	rr>�VERSION�_MSVCCompiler__versionZ_MSVCCompiler__root�_MSVCCompiler__paths�	plat_name�_MSVCCompiler__arch�initialized)r<�verboseZdry_runZforcerrrr>IszMSVCCompiler.__init__NcCs|dkrt�}d}||kr(td|f��dtjkrfdtjkrf|�d�rfd|_d|_d|_d|_d	|_	n�|t�ksx|d
kr�t
|}nt
t�dt
|}tt|�}|d�
tj�|_|d
tjd
<|dtjd<t|j�dkr�td|j��|�d�|_|�d�|_|�d�|_|�d�|_|�d	�|_	z(tjd�
d�D]}|j�|��q:Wntk
�rfYnXt|j�|_d�|j�tjd<d|_|jdk�r�dddddg|_ddddddg|_n&ddddddg|_dddddddg|_dddg|_|jdk�rddd d!g|_dg|_d"|_dS)#Nrz--plat-name must be one of %sZDISTUTILS_USE_SDKZMSSdkzcl.exezlink.exezlib.exezrc.exezmc.exer�_rrkrjrzxPython was built with %s, and extensions need to be built with the same version of the compiler, but it isn't installed.�;r
z/nologoz/Oxz/MDz/W3z/DNDEBUGz/Odz/MDdz/Z7z/D_DEBUGz/GS-z/DLLz/INCREMENTAL:NO�z/INCREMENTAL:noz/DEBUGT)rrrYrc�find_exe�cc�linkerrk�rc�mc�PLAT_TO_VCVARSr~r�rTr]r�rSZ_MSVCCompiler__productr rr\r^Zpreprocess_optionsr��compile_options�compile_options_debug�ldflags_sharedr��ldflags_shared_debugZldflags_staticr�)r<r�Zok_platsZ	plat_specZvc_envrDrrr�
initializeTs~�
�
���
�
��zMSVCCompiler.initialize�cCs�|dkrd}g}|D]�}tj�|�\}}tj�|�d}|tj�|�d�}||jkrbtd|��|rrtj�|�}||jkr�|�	tj�
|||j��q||jkr�|�	tj�
|||j��q|�	tj�
|||j
��q|S)Nr�rzDon't know how to compile %s)rYr�splitext�
splitdrive�isabs�src_extensionsr�basename�_rc_extensionsr r^�
res_extension�_mc_extensions�
obj_extension)r<Zsource_filenamesZ	strip_dir�
output_dirZ	obj_namesZsrc_namer�extrrr�object_filenames�s.

�
��zMSVCCompiler.object_filenamesc	Csp|js|��|�||||||�}	|	\}}
}}}|p6g}
|
�d�|rT|
�|j�n|
�|j�|
D�]}z||\}}Wntk
r�YqdYnX|r�tj	�
|�}||jkr�d|}�nT||jkr�d|}�n>||j
k�r<|}d|}z"|�|jg||g|g�Wqdtk
�r6}zt|��W5d}~XYqdXqdn�||jk�r�tj	�|�}tj	�|�}zl|�|jgd|d|g|g�tj	�tj	�|��\}}tj	�||d�}|�|jgd|g|g�Wqdtk
�r�}zt|��W5d}~XYqdXqdntd||f��d	|}z&|�|jg|
|||g|�Wqdtk
�rh}zt|��W5d}~XYqdXqd|
S)
Nz/cz/Tcz/Tpz/foz-hz-rr�z"Don't know how to compile %s to %sz/Fo)r�r�Z_setup_compiler �extendr�r�rrYrrf�
_c_extensions�_cpp_extensionsr��spawnr�rrr��dirnamer�r�r�r^r�)r<Zsourcesr�r8Zinclude_dirsra�
extra_preargs�extra_postargsZdependsZcompile_info�objectsZpp_optsZbuildZcompile_opts�obj�srcr�Z	input_optZ
output_opt�msgZh_dirZrc_dirrr�Zrc_filerrr�compile�s�
�




��


��
��
���
zMSVCCompiler.compilec	
Cs�|js|��|�||�\}}|j||d�}|�||�r�|d|g}|rJz|�|jg|�Wq�tk
r�}zt|��W5d}~XYq�Xnt	�
d|�dS)N)r��/OUT:�skipping %s (up-to-date))r�r��_fix_object_args�library_filename�
_need_linkr�rkrrr
ra)	r<r�Zoutput_libnamer�ra�target_lang�output_filenameZlib_argsr�rrr�create_static_libs�zMSVCCompiler.create_static_libc
CsT|js|��|�||�\}}|�|||�}|\}}}|rL|�dt|��t||||�}|dk	rptj�	||�}|�
||��rD|tjkr�|	r�|j
dd�}q�|jdd�}n|	r�|j
}n|j}g}|p�gD]}|�d|�q�||||d|g}tj�|d�}|dk	�rLtj�tj�|��\}}tj�	||�|��}|�d|�|�|||�|
�rl|
|dd�<|�r||�|�|�tj�|��z|�|jg|�Wn,tk
�r�}zt|��W5d}~XYnX|�||�}|dk	�rP|\}}d||f}z|�dd	d
||g�Wn,tk
�r@}zt|��W5d}~XYnXnt�d|�dS)Nz5I don't know what to do with 'runtime_library_dirs': rz/EXPORT:r�rz/IMPLIB:z-outputresource:%s;%szmt.exez-nologoz	-manifestr�)r�r�r�Z
_fix_lib_args�warnrxr	rYrr^r�r�
EXECUTABLEr�r�r r�r�r�r��manifest_setup_ldargsr�Zmkpathr�r�rr�manifest_get_embed_infor
ra)r<�target_descr�r�r�Z	librariesZlibrary_dirsZruntime_library_dirsZexport_symbolsrar�r��
build_tempr�Z
fixed_argsZlib_optsZldflagsZexport_optsZsym�ld_argsZdll_nameZdll_extZimplib_filer�ZmfinfoZ
mffilename�mfidZout_argrrr�link6s��
��

��

��


�
zMSVCCompiler.linkcCs,tj�|tj�|�d�}|�d|�dS)Nz	.manifest�/MANIFESTFILE:)rYrr^r�r )r<r�r�r��
temp_manifestrrrr��s
�z"MSVCCompiler.manifest_setup_ldargscCs^|D]"}|�d�r|�dd�d}q,qdS|tjkr<d}nd}|�|�}|dkrVdS||fS)Nr��:rrO)�
startswithrTrr��_remove_visual_c_ref)r<r�r��argr�r�rrrr��s


z$MSVCCompiler.manifest_get_embed_infocCs�z�t|�}z|��}W5|��Xt�dtj�}t�|d|�}d}t�|d|�}t�dtj�}t�||�dkrtWdSt|d�}z|�|�|W�WS|��XWnt	k
r�YnXdS)NzU<assemblyIdentity.*?name=("|')Microsoft\.VC\d{2}\.CRT("|').*?(/>|</assemblyIdentity>)r�z*<dependentAssembly>\s*</dependentAssembly>zI<assemblyIdentity.*?name=(?:"|')(.+?)(?:"|').*?(?:/>|</assemblyIdentity>)�w)
�openrs�read�rer��DOTALLrI�search�write�OSError)r<Z
manifest_fileZ
manifest_fZmanifest_buf�patternrrrr��s2	
��


z!MSVCCompiler._remove_visual_c_refcCsd|S)Nz	/LIBPATH:r�r<�dirrrr�library_dir_option�szMSVCCompiler.library_dir_optioncCstd��dS)Nz<don't know how to set runtime library search path for MSVC++)rr�rrr�runtime_library_dir_option�s�z'MSVCCompiler.runtime_library_dir_optioncCs
|�|�Sr)r�)r<rkrrr�library_option�szMSVCCompiler.library_optioncCs\|r|d|g}n|g}|D]:}|D]0}tj�||�|��}tj�|�r$|Sq$qdS)NZ_d)rYrr^r��exists)r<�dirsrkraZ	try_namesr�r)Zlibfilerrr�find_library_file�szMSVCCompiler.find_library_filecCsz|jD].}tj�tj�|�|�}tj�|�r|Sqtjd�d�D].}tj�tj�|�|�}tj�|�rF|SqF|S)a�Return path to an MSVC executable program.

        Tries to find the program in several places: first, one of the
        MSVC program search paths from the registry; next, the directories
        in the PATH environment variable.  If any of those work, return an
        absolute path that is known to exist.  If none of them work, just
        return the original program name, 'exe'.
        �Pathr�)r�rYrr^rfrgrcrT)r<ZexerD�fnrrrr�s	


zMSVCCompiler.find_exe)rrr)N)rr�)NNNrNNN)NrN)
NNNNNrNNNN)r) r1r2r3r4Z
compiler_typeZexecutablesr�r�r�r�r�r�r�Zstatic_lib_extensionZshared_lib_extensionZstatic_lib_formatZshared_lib_formatZ
exe_extensionr>r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr+sl
��

W�
 �
X�
�
_+
r)r
)1r4rYrprQr�Zdistutils.errorsrrrrrZdistutils.ccompilerrrr	Z	distutilsr
Zdistutils.utilr�winregZ	OpenKeyExrZEnumKeyrZ	EnumValuer&�errorrZ
HKEY_USERS�HKEY_CURRENT_USER�HKEY_LOCAL_MACHINEZHKEY_CLASSES_ROOTr�platform�maxsizeZNATIVE_WIN64r9rCrBr�rr7rXr\r_rir~r�rrrrr�<module>sP��>.#
)
distutils/__pycache__/dir_util.cpython-38.pyc000064400000013301151153537450015252 0ustar00U

e5db�@spdZddlZddlZddlmZmZddlmZiaddd�Z	dd	d
�Z
ddd�Zd
d�Zddd�Z
dd�ZdS)zWdistutils.dir_util

Utility functions for manipulating directories and directory trees.�N)�DistutilsFileError�DistutilsInternalError)�log��cCsft|t�std|f��tj�|�}g}tj�|�s<|dkr@|St�tj�	|��rV|Stj�
|�\}}|g}|r�|r�tj�|�s�tj�
|�\}}|�d|�ql|D]�}tj�||�}tj�	|�}	t�|	�r�q�|dkr�t
�d|�|�sXzt�||�WnVtk
�rL}
z6|
jtjk�r&tj�|��s<td||
jdf��W5d}
~
XYnX|�|�dt|	<q�|S)	a�Create a directory and any missing ancestor directories.

    If the directory already exists (or if 'name' is the empty string, which
    means the current directory, which of course exists), then do nothing.
    Raise DistutilsFileError if unable to create some directory along the way
    (eg. some sub-path exists, but is a file rather than a directory).
    If 'verbose' is true, print a one-line summary of each mkdir to stdout.
    Return the list of directories actually created.
    z(mkpath: 'name' must be a string (got %r)�rrzcreating %szcould not create '%s': %s���N)�
isinstance�strr�os�path�normpath�isdir�
_path_created�get�abspath�split�insert�joinr�info�mkdir�OSError�errnoZEEXISTr�args�append)�name�mode�verbose�dry_runZcreated_dirs�head�tailZtails�dZabs_head�exc�r#�*/usr/lib64/python3.8/distutils/dir_util.py�mkpathsB
�
�

r%c	CsNt�}|D] }|�tj�|tj�|���q
t|�D]}t||||d�q4dS)a�Create all the empty directories under 'base_dir' needed to put 'files'
    there.

    'base_dir' is just the name of a directory which doesn't necessarily
    exist yet; 'files' is a list of filenames to be interpreted relative to
    'base_dir'.  'base_dir' + the directory portion of every file in 'files'
    will be created if it doesn't already exist.  'mode', 'verbose' and
    'dry_run' flags are as for 'mkpath()'.
    �rrN)�set�addrrr�dirname�sortedr%)Zbase_dir�filesrrrZneed_dir�file�dirr#r#r$�create_treePs
r.c
Cs^ddlm}|s(tj�|�s(td|��zt�|�}	Wn>tk
rt}
z |rRg}	ntd||
jf��W5d}
~
XYnX|s�t	||d�g}|	D]�}tj�
||�}
tj�
||�}|�d�r�q�|�r
tj�|
��r
t�
|
�}|dkr�t�d	||�|s�t�||�|�|�q�tj�|
��r8|�t|
|||||||d
��q�||
||||||d
�|�|�q�|S)aCopy an entire directory tree 'src' to a new location 'dst'.

    Both 'src' and 'dst' must be directory names.  If 'src' is not a
    directory, raise DistutilsFileError.  If 'dst' does not exist, it is
    created with 'mkpath()'.  The end result of the copy is that every
    file in 'src' is copied to 'dst', and directories under 'src' are
    recursively copied to 'dst'.  Return the list of files that were
    copied or might have been copied, using their output name.  The
    return value is unaffected by 'update' or 'dry_run': it is simply
    the list of all files under 'src', with the names changed to be
    under 'dst'.

    'preserve_mode' and 'preserve_times' are the same as for
    'copy_file'; note that they only apply to regular files, not to
    directories.  If 'preserve_symlinks' is true, symlinks will be
    copied as symlinks (on platforms that support them!); otherwise
    (the default), the destination of the symlink will be copied.
    'update' and 'verbose' are the same as for 'copy_file'.
    r)�	copy_filez&cannot copy tree '%s': not a directoryzerror listing files in '%s': %sN)rz.nfsrzlinking %s -> %sr&)Zdistutils.file_utilr/rrrr�listdirr�strerrorr%r�
startswith�islink�readlinkrr�symlinkr�extend�	copy_tree)�srcZdstZ
preserve_modeZpreserve_timesZpreserve_symlinks�updaterrr/�names�eZoutputs�nZsrc_nameZdst_nameZ	link_destr#r#r$r7cs\��

���r7cCsft�|�D]F}tj�||�}tj�|�r@tj�|�s@t||�q
|�tj|f�q
|�tj	|f�dS)zHelper for remove_tree().N)
rr0rrrr3�_build_cmdtupler�remove�rmdir)r�	cmdtuples�fZreal_fr#r#r$r=�sr=cCs�|dkrt�d|�|rdSg}t||�|D]h}z2|d|d�tj�|d�}|tkrbt|=Wq.tk
r�}zt�d||�W5d}~XYq.Xq.dS)z�Recursively remove an entire directory tree.

    Any errors are ignored (apart from being reported to stdout if 'verbose'
    is true).
    rz'removing '%s' (and everything under it)Nrzerror removing %s: %s)	rrr=rrrrr�warn)Z	directoryrrr@�cmdrr"r#r#r$�remove_tree�s

rDcCs6tj�|�\}}|dd�tjkr2||dd�}|S)z�Take the full path 'path', and make it a relative path.

    This is useful to make 'path' the second argument to os.path.join().
    rrN)rr�
splitdrive�sep)rZdriver#r#r$�ensure_relative�srG)rrr)rrr)rrrrrr)rr)�__doc__rrZdistutils.errorsrrZ	distutilsrrr%r.r7r=rDrGr#r#r#r$�<module>s 
?
�
E

distutils/__pycache__/ccompiler.cpython-38.opt-2.pyc000064400000040742151153537450016365 0ustar00U

e5dI��@s�ddlZddlZddlZddlTddlmZddlmZddlm	Z	ddl
mZmZddl
mZmZddlmZGd	d
�d
�ZdZddd
�Zdddddd�Zdd�Zddd�Zdd�Zdd�ZdS)�N)�*)�spawn)�	move_file)�mkpath)�newer_pairwise�newer_group)�split_quoted�execute)�logc
@seZdZdZdZdZdZdZdZdZ	dZ
dddddd�ZdddgZdpdd�Z
d	d
�Zdd�Zd
d�Zdd�Zdqdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Z drd/d0�Z!d1d2�Z"d3d4�Z#d5d6�Z$d7d8�Z%dsd9d:�Z&dtd;d<�Z'd=d>�Z(dud?d@�Z)dAZ*dBZ+dCZ,dvdDdE�Z-dwdFdG�Z.dxdHdI�Z/dydJdK�Z0dLdM�Z1dNdO�Z2dPdQ�Z3dzdRdS�Z4d{dTdU�Z5d|dWdX�Z6d}dYdZ�Z7d~d[d\�Z8dd^d_�Z9d�dadb�Z:dcdd�Z;dedf�Z<d�dgdh�Z=didj�Z>dkdl�Z?d�dndo�Z@dS)��	CCompilerN�czc++Zobjc)�.cz.ccz.cppz.cxxz.mrcCsb||_||_||_d|_g|_g|_g|_g|_g|_g|_	|j
��D]}|�||j
|�qFdS�N)
�dry_run�force�verbose�
output_dir�macros�include_dirs�	libraries�library_dirs�runtime_library_dirs�objects�executables�keys�set_executable)�selfrrr�key�r�+/usr/lib64/python3.8/distutils/ccompiler.py�__init__UszCCompiler.__init__cKs<|D]2}||jkr&td||jjf��|�|||�qdS)Nz$unknown executable '%s' for class %s)r�
ValueError�	__class__�__name__r)r�kwargsrrrr�set_executablesys

�zCCompiler.set_executablescCs,t|t�rt||t|��nt|||�dSr)�
isinstance�str�setattrr)rr�valuerrrr�s
zCCompiler.set_executablecCs0d}|jD] }|d|kr"|S|d7}q
dS)Nr�)r)r�name�i�defnrrr�_find_macro�s

zCCompiler._find_macrocCs`|D]V}t|t�rFt|�dkrFt|dt�s8|ddkrFt|dt�std|dd��qdS)N)r*�r*rzinvalid macro definition '%s': z.must be tuple (string,), (string, string), or z(string, None))r&�tuple�lenr'�	TypeError)rZdefinitionsr-rrr�_check_macro_definitions�s

��
����z"CCompiler._check_macro_definitionscCs.|�|�}|dk	r|j|=|j�||f�dSr�r.r�append)rr+r)r,rrr�define_macro�s	
zCCompiler.define_macrocCs0|�|�}|dk	r|j|=|f}|j�|�dSrr4)rr+r,Zundefnrrr�undefine_macro�s

zCCompiler.undefine_macrocCs|j�|�dSr)rr5�r�dirrrr�add_include_dir�szCCompiler.add_include_dircCs|dd�|_dSr�r�r�dirsrrr�set_include_dirs�szCCompiler.set_include_dirscCs|j�|�dSr)rr5)r�libnamerrr�add_library�szCCompiler.add_librarycCs|dd�|_dSr)r)rZlibnamesrrr�
set_libraries�szCCompiler.set_librariescCs|j�|�dSr)rr5r8rrr�add_library_dirszCCompiler.add_library_dircCs|dd�|_dSr)rr<rrr�set_library_dirsszCCompiler.set_library_dirscCs|j�|�dSr)rr5r8rrr�add_runtime_library_dirsz!CCompiler.add_runtime_library_dircCs|dd�|_dSr)rr<rrr�set_runtime_library_dirssz"CCompiler.set_runtime_library_dirscCs|j�|�dSr)rr5)r�objectrrr�add_link_object szCCompiler.add_link_objectcCs|dd�|_dSr)r)rrrrr�set_link_objects(szCCompiler.set_link_objectscCs|dkr|j}nt|t�s"td��|dkr2|j}n"t|t�rL||jpFg}ntd��|dkrd|j}n*t|ttf�r�t|�|jp�g}ntd��|dkr�g}|j|d|d�}t	||�}i}	t
t|��D]B}
||
}||
}tj
�|�d}
|�tj
�|��||
f|	|<q�|||||	fS)N�%'output_dir' must be a string or None�/'macros' (if supplied) must be a list of tuples�6'include_dirs' (if supplied) must be a list of stringsr)�	strip_dirrr*)rr&r'r2r�listrr0�object_filenames�gen_preprocess_options�ranger1�os�path�splitextr�dirname)rZoutdirrZincdirs�sources�dependsZextrar�pp_opts�buildr,�src�obj�extrrr�_setup_compile6s<

��
zCCompiler._setup_compilecCs0|dg}|rdg|dd�<|r,||dd�<|S)Nz-cz-grr)rrW�debugZbefore�cc_argsrrr�_get_cc_argsas
zCCompiler._get_cc_argscCs�|dkr|j}nt|t�s"td��|dkr2|j}n"t|t�rL||jpFg}ntd��|dkrd|j}n*t|ttf�r�t|�|jp�g}ntd��|||fS)NrIrJrK)rr&r'r2rrMrr0)rrrrrrr�_fix_compile_argsjs"


�zCCompiler._fix_compile_argscCs|j||d�}|ifS)N)r)rN)rrUrrVrrrr�
_prep_compile�s	zCCompiler._prep_compilecCsHt|ttf�std��t|�}|dkr.|j}nt|t�s@td��||fS)Nz,'objects' must be a list or tuple of stringsrI)r&rMr0r2rr')rrrrrr�_fix_object_args�s
zCCompiler._fix_object_argscCs�|dkr|j}n*t|ttf�r2t|�|jp,g}ntd��|dkrJ|j}n*t|ttf�rlt|�|jpfg}ntd��|dkr�|j}n*t|ttf�r�t|�|jp�g}ntd��|||fS)Nz3'libraries' (if supplied) must be a list of stringsz6'library_dirs' (if supplied) must be a list of stringsz>'runtime_library_dirs' (if supplied) must be a list of strings)rr&rMr0r2rr)rrrrrrr�
_fix_lib_args�s,���zCCompiler._fix_lib_argscCs2|jr
dS|jr t||dd�}n
t||�}|SdS)NT�newer)Zmissing)rrr)rr�output_filerdrrr�
_need_link�s
zCCompiler._need_linkc		Cs~t|t�s|g}d}t|j�}|D]V}tj�|�\}}|j�|�}z |j�	|�}||kr`|}|}Wq"t
k
rvYq"Xq"|Sr)r&rMr1�language_orderrQrRrS�language_map�get�indexr!)	rrUZlangrj�source�baser[ZextlangZextindexrrr�detect_language�s

zCCompiler.detect_languagecCsdSrr)rrkrerr�
extra_preargs�extra_postargsrrr�
preprocess�szCCompiler.preprocessc		Csx|�||||||�\}}	}}
}|�|
||�}|	D]B}
z||
\}}Wntk
r\Yq0YnX|�|
|||||
�q0|	Sr)r\r_�KeyError�_compile)rrUrrrr]rnrorVrrWrXr^rZrYr[rrr�compile�s6��
zCCompiler.compilecCsdSrr)rrZrYr[r^rorWrrrrrCszCCompiler._compilecCsdSrr)rr�output_libnamerr]�target_langrrr�create_static_libIszCCompiler.create_static_libZ
shared_objectZshared_library�
executablecCst�dSr��NotImplementedError)rZtarget_descr�output_filenamerrrr�export_symbolsr]rnro�
build_temprurrr�linkis9zCCompiler.linkc

Cs2|�tj||j|dd�|||||||	|
||�
dS)N�shared)�lib_type)r}r�SHARED_LIBRARY�library_filename)
rrrtrrrrr{r]rnror|rurrr�link_shared_lib�s
�zCCompiler.link_shared_libc

Cs(|�tj|||||||||	|
||�
dSr)r}r�
SHARED_OBJECT)
rrrzrrrrr{r]rnror|rurrr�link_shared_object�s
�zCCompiler.link_shared_objectcCs.|�tj||�|�||||d|||	d|
�
dSr)r}r�
EXECUTABLE�executable_filename)rrZoutput_prognamerrrrr]rnrorurrr�link_executable�s
�zCCompiler.link_executablecCst�dSrrxr8rrr�library_dir_option�szCCompiler.library_dir_optioncCst�dSrrxr8rrr�runtime_library_dir_option�sz$CCompiler.runtime_library_dir_optioncCst�dSrrx)r�librrr�library_option�szCCompiler.library_optionc	Cs�ddl}|dkrg}|dkr g}|dkr,g}|dkr8g}|jd|dd�\}}t�|d�}	z*|D]}
|	�d|
�q^|	�d|�W5|	��Xz|j|g|d�}Wntk
r�Yd	SXz|j|d
||d�Wnt	t
fk
r�Yd	SXdS)Nrr
T)�text�wz#include "%s"
z=int main (int argc, char **argv) {
    %s();
    return 0;
}
r;Fza.out)rr)�tempfileZmkstemprQ�fdopen�close�writersZCompileErrorr�Z	LinkErrorr2)r�funcnameZincludesrrrr��fdZfname�fZinclrrrr�has_function�s<	�

�
zCCompiler.has_functioncCst�dSrrx)rr=r�r]rrr�find_library_file$szCCompiler.find_library_file�cCs�|dkrd}g}|D]|}tj�|�\}}tj�|�d}|tj�|�d�}||jkrftd||f��|rvtj�|�}|�tj�	|||j
��q|S)Nr�r*z"unknown file type '%s' (from '%s'))rQrRrS�
splitdrive�isabs�src_extensionsZUnknownFileError�basenamer5�join�
obj_extension)rZsource_filenamesrLrZ	obj_namesZsrc_namerlr[rrrrNOs"

��zCCompiler.object_filenamescCs$|rtj�|�}tj�|||j�Sr)rQrRr�r��shared_lib_extension�rr�rLrrrr�shared_object_filename`sz CCompiler.shared_object_filenamecCs(|rtj�|�}tj�|||jp"d�S)Nr�)rQrRr�r��
exe_extensionr�rrrr�fszCCompiler.executable_filename�staticc
Cs`|dkrtd��t||d�}t||d�}tj�|�\}}|||f}	|rPd}tj�|||	�S)N)r�r~ZdylibZ
xcode_stubz?'lib_type' must be "static", "shared", "dylib", or "xcode_stub"Z_lib_formatZ_lib_extensionr�)r!�getattrrQrR�splitr�)
rr?rrLrZfmtr[r9rl�filenamerrrr�ls�zCCompiler.library_filenamer*cCst�|�dSr)r
r])r�msg�levelrrr�announceszCCompiler.announcecCsddlm}|rt|�dS)Nr)�DEBUG)Zdistutils.debugr��print)rr�r�rrr�debug_print�szCCompiler.debug_printcCstj�d|�dS)Nzwarning: %s
)�sys�stderrr�)rr�rrr�warn�szCCompiler.warncCst||||j�dSr)r	r)r�func�argsr�r�rrrr	�szCCompiler.executecCst||jd�dS�N)r)rr)r�cmdrrrr�szCCompiler.spawncCst|||jd�Sr�)rr)rrYZdstrrrr�szCCompiler.move_file�cCst|||jd�dSr�)rr)rr+�moderrrr�szCCompiler.mkpath)rrr)N)N)NNNNN)NNNrNNN)NrN)
NNNNNrNNNN)
NNNNNrNNNN)
NNNNNrNNNN)NNNNrNNN)NNNN)r)rr�)rr�)rr�)r�rr�)r*)Nr*)r�)Ar#�
__module__�__qualname__Z
compiler_typer�r�Zstatic_lib_extensionr�Zstatic_lib_formatZshared_lib_formatr�rhrgr r%rr.r3r6r7r:r>r@rArBrCrDrErGrHr\r_r`rarbrcrfrmrprsrrrvr�r�r�r}r�r�r�r�r�r�r�r�rNr�r�r�r�r�r�r	rrrrrrrrs��

$ 

+	 
"
�

�
D�
�
A�
�
�
�
,
+


�


r))zcygwin.*�unix)�posixr�)�nt�msvccCsV|dkrtj}|dkrtj}tD]0\}}t�||�dk	sHt�||�dk	r |Sq dS)Nr�)rQr+r��platform�_default_compilers�re�match)Zosnamer��pattern�compilerrrr�get_default_compiler�s
�
r�)Z
unixccompilerZ
UnixCCompilerzstandard UNIX-style compiler)Z
_msvccompilerZMSVCCompilerzMicrosoft Visual C++)�cygwinccompilerZCygwinCCompilerz'Cygwin port of GNU C Compiler for Win32)r�ZMingw32CCompilerz(Mingw32 port of GNU C Compiler for Win32)ZbcppcompilerZBCPPCompilerzBorland C++ Compiler)r�r��cygwinZmingw32ZbcppcCsXddlm}g}t��D] }|�d|dt|df�q|��||�}|�d�dS)Nr)�FancyGetoptz	compiler=r/zList of available compilers:)Zdistutils.fancy_getoptr��compiler_classrr5�sortZ
print_help)r�Z	compilersr�Zpretty_printerrrr�show_compilers�s
�r�cCs�|dkrtj}z"|dkr t|�}t|\}}}Wn8tk
rhd|}|dk	r\|d|}t|��YnXz*d|}t|�tj|}	t	|	�|}
WnBt
k
r�td|��Yn$tk
r�td||f��YnX|
d||�S)Nz5don't know how to compile C/C++ code on platform '%s'z with '%s' compilerz
distutils.z4can't compile C/C++ code: unable to load module '%s'zBcan't compile C/C++ code: unable to find class '%s' in module '%s')rQr+r�r�rqZDistutilsPlatformError�
__import__r��modules�vars�ImportErrorZDistutilsModuleError)Zplatr�rrrZmodule_name�
class_nameZlong_descriptionr��module�klassrrr�new_compiler�s:
����
r�cCs�g}|D]�}t|t�r0dt|�kr.dks<ntd|��t|�dkr\|�d|d�qt|�dkr|ddkr�|�d|d�q|�d|�q|D]}|�d|�q�|S)	Nr*r/zPbad macro definition '%s': each element of 'macros' list must be a 1- or 2-tuplez-U%srz-D%sz-D%s=%sz-I%s)r&r0r1r2r5)rrrWZmacror9rrrrOs"$��rOcCs�g}|D]}|�|�|��q|D],}|�|�}t|t�rD||}q"|�|�q"|D]V}tj�|�\}}	|r�|�|g|	�}
|
r�|�|
�q�|�	d|�qT|�|�
|��qT|S)Nz6no library file corresponding to '%s' found (skipping))r5r�r�r&rMrQrRr�r�r�r�)r�rrrZlib_optsr9�optr�Zlib_dirZlib_nameZlib_filerrr�gen_lib_options8s&


�r�)NN)NNrrr)r�rQr�Zdistutils.errorsZdistutils.spawnrZdistutils.file_utilrZdistutils.dir_utilrZdistutils.dep_utilrrZdistutils.utilrr	Z	distutilsr
rr�r�r�r�r�rOr�rrrr�<module>s6
�
--distutils/__pycache__/dist.cpython-38.opt-2.pyc000064400000061163151153537450015353 0ustar00U

e5d���@s�ddlZddlZddlZddlmZzddlZWnek
rHdZYnXddlTddlm	Z	m
Z
ddlmZm
Z
mZddlmZddlmZe�d�Zd	d
�ZGdd�d�ZGd
d�d�Zdd�ZdS)�N)�message_from_file)�*)�FancyGetopt�translate_longopt)�
check_environ�	strtobool�
rfc822_escape��log)�DEBUGz^[a-zA-Z]([a-zA-Z0-9_]*)$cCsLt|t�rn<t|t�sHt|�j}d|�d|�d�}t�tj|�t|�}|S)Nz
Warning: 'z' should be a list, got type '�')�
isinstance�str�list�type�__name__r
ZWARN)�valueZ	fieldname�typename�msg�r�&/usr/lib64/python3.8/distutils/dist.py�_ensure_lists


rc@sleZdZdddddgZdZddd	d
ddd
ddddddddddddddgZdd�eD�ZddiZd`d!d"�Zd#d$�Z	dad&d'�Z
d(d)�Zdbd*d+�Zd,d-�Z
d.d/�Zd0d1�Zd2d3�Zd4d4gfd5d6�Zd7d8�Zd9d:�Zd;d<�Zd=d>�Zd?d@�ZdAdB�ZdcdCdD�ZdddEdF�ZdedHdI�ZejfdJdK�ZdLdM�ZdNdO�ZdPdQ�Z dRdS�Z!dTdU�Z"dVdW�Z#dXdY�Z$dZd[�Z%d\d]�Z&d^d_�Z'd S)f�Distribution)�verbose�vzrun verbosely (default)�)�quiet�qz!run quietly (turns verbosity off))zdry-run�nzdon't actually do anything)�help�hzshow detailed help message)zno-user-cfgNz-ignore pydistutils.cfg in your home directoryz�Common commands: (see '--help-commands' for more)

  setup.py build      will build the package underneath 'build/'
  setup.py install    will install the package
)z
help-commandsNzlist all available commands)�nameNzprint package name)�version�Vzprint package version)�fullnameNzprint <package name>-<version>)�authorNzprint the author's name)�author-emailNz print the author's email address)�
maintainerNzprint the maintainer's name)zmaintainer-emailNz$print the maintainer's email address)�contactNz7print the maintainer's name if known, else the author's)z
contact-emailNz@print the maintainer's email address if known, else the author's)�urlNzprint the URL for this package)�licenseNz print the license of the package)�licenceNzalias for --license)�descriptionNzprint the package description)zlong-descriptionNz"print the long package description)�	platformsNzprint the list of platforms)�classifiersNzprint the list of classifiers)�keywordsNzprint the list of keywords)�providesNz+print the list of packages/modules provided)�requiresNz+print the list of packages/modules required)�	obsoletesNz0print the list of packages/modules made obsoletecCsg|]}t|d��qS)r�r)�.0�xrrr�
<listcomp>�szDistribution.<listcomp>rrNcCs\d|_d|_d|_|jD]}t||d�qt�|_|jjD] }d|}t||t|j|��q:i|_	d|_
d|_d|_i|_
g|_d|_i|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_i|_i|_|�r|�d�}|dk	�r8|d=|��D]4\}}|� |�}|��D]\}	}
d|
f||	<�q�qd|k�r~|d|d<|d=d	}t!dk	�rnt!�"|�nt#j$�%|d
�|��D]�\}}
t&|jd|��r�t|jd|�|
�nNt&|j|��r�t|j||
�n0t&||��r�t|||
�ndt'|�}t!�"|��q�d
|_(|jdk	�rP|jD].}
|
�)d��s6�qP|
dk�r d|_(�qP�q |�*�dS)Nrr�get_��optionszsetup scriptr+r*z:'licence' distribution option is deprecated; use 'license'�
Zset_zUnknown distribution option: %sT�-z
--no-user-cfgF)+r�dry_runr�display_option_names�setattr�DistributionMetadata�metadata�_METHOD_BASENAMES�getattr�cmdclass�command_packages�script_name�script_args�command_optionsZ
dist_files�packagesZpackage_dataZpackage_dir�
py_modules�	libraries�headers�ext_modulesZext_packageZinclude_dirsZ
extra_path�scripts�
data_filesZpassword�command_obj�have_run�get�items�get_option_dict�warnings�warn�sys�stderr�write�hasattr�repr�
want_user_cfg�
startswith�finalize_options)�self�attrs�attr�basenameZmethod_namer9�commandZcmd_options�opt_dict�opt�valr�key�argrrr�__init__�s~








zDistribution.__init__cCs&|j�|�}|dkr"i}|j|<|S�N)rGrQ)r^rb�dictrrrrS&szDistribution.get_option_dictr8c	Cs�ddlm}|dkr"t|j���}|dk	r@|�||�|d}|sV|�|d�dS|D]h}|j�|�}|dkr�|�|d|�qZ|�|d|�||�}|�d�D]}|�|d|�q�qZdS)Nr)�pformatz  zno commands known yetzno option dict for '%s' commandzoption dict for '%s' command:r:)Zpprintrk�sortedrG�keys�announcerQ�split)	r^�header�commands�indentrkZcmd_namerc�out�linerrr�dump_option_dicts1s*��zDistribution.dump_option_dictscCs�g}t�tj�tjdj�}tj�|d�}tj�|�rB|�	|�tj
dkrRd}nd}|jr�tj�tj�d�|�}tj�|�r�|�	|�d}tj�|�r�|�	|�t
r�|�dd	�|��|S)
N�	distutilsz
distutils.cfg�posixz.pydistutils.cfgzpydistutils.cfg�~z	setup.cfgzusing config files: %sz, )r�os�path�dirnamerV�modules�__file__�join�isfile�appendr!r[�
expanduserrrn)r^�filesZsys_dirZsys_fileZ
user_filenameZ	user_fileZ
local_filerrr�find_config_filesMs&



zDistribution.find_config_filesc
Cs�ddlm}tjtjkr8ddddddd	d
ddd
ddg
}ng}t|�}|dkrT|��}trb|�d�|�}|D]�}tr�|�d|�|�	|�|�
�D]V}|�|�}|�|�}|D]8}	|	dkr�|	|kr�|�
||	�}
|	�dd�}	||
f||	<q�q�|��qld|jk�r�|jd��D]�\}	\}}
|j�
|	�}zF|�rDt||t|
��n(|	dk�r`t||	t|
��nt||	|
�Wn,tk
�r�}
zt|
��W5d}
~
XYnX�qdS)Nr)�ConfigParserzinstall-basezinstall-platbasezinstall-libzinstall-platlibzinstall-purelibzinstall-headerszinstall-scriptszinstall-data�prefixzexec-prefix�home�user�rootz"Distribution.parse_config_files():z  reading %srr;�_�global)rr<)Zconfigparserr�rVr��base_prefix�	frozensetr�rrn�readZsectionsr9rSrQ�replacerhrGrR�negative_optr>r�
ValueError�DistutilsOptionError)r^�	filenamesr�Zignore_options�parser�filenameZsectionr9rcrdre�src�aliasrrrr�parse_config_files}s^�





zDistribution.parse_config_filescCs�|��}g|_t||j�}|�|j�|�ddi�|j|j|d�}|�	�}t
�|j�|�
|�rhdS|r�|�||�}|dkrhdSqh|jr�|j|t|j�dk|jd�dS|js�td��dS)Nr+r*)�args�objectr��display_optionsrqzno commands suppliedT)�_get_toplevel_optionsrqrr��set_negative_aliasesr�Zset_aliases�getoptrFZget_option_orderr
Z
set_verbosityr�handle_display_options�_parse_command_optsr�
_show_help�len�DistutilsArgError)r^Ztoplevel_optionsr�r��option_orderrrr�parse_command_line�s.	
�zDistribution.parse_command_linecCs|jdgS)N)zcommand-packages=Nz0list of packages that provide distutils commands)�global_options�r^rrrr��s�z"Distribution._get_toplevel_optionsc
Cs�ddlm}|d}t�|�s*td|��|j�|�z|�|�}Wn*tk
rn}zt	|��W5d}~XYnXt
||�s�td|��t|d�r�t
|jt�s�d}t||��|j}t|d�r�|��}|�|j�t|d�r�t
|jt�r�t|j�}ng}|�|j|j|�|�|�|�|d	d��\}}	t|	d
��rV|	j�rV|j|d|gd�dSt|d��r�t
|jt��r�d}
|jD]F\}}}
}t|	|�|���rzd	}
t|��r�|�ntd||f���qz|
�r�dS|�|�}t|	���D]\}}d
|f||<�q�|S)Nr��Commandzinvalid command name '%s'z&command class %s must subclass Command�user_optionszIcommand class %s must provide 'user_options' attribute (a list of tuples)r��help_optionsrrr�zYinvalid help function %r for help option '%s': must be a callable object (function, etc.)zcommand line) �
distutils.cmdr��
command_re�match�
SystemExitrqr��get_command_class�DistutilsModuleErrorr��
issubclassZDistutilsClassErrorrYr
r�rr��copy�updater��fix_help_options�set_option_tabler�r�r�rr�Z
get_attr_name�callablerS�varsrR)r^r�r�r�rbZ	cmd_classrr�r�ZoptsZhelp_option_foundZhelp_optionZshortZdesc�funcrcr!rrrrr�sr


�

�


���

�
��
z Distribution._parse_command_optscCsPdD]F}t|j|�}|dkrqt|t�rdd�|�d�D�}t|j||�qdS)N�r/r-cSsg|]}|���qSr��strip)r4Zelmrrrr6jsz1Distribution.finalize_options.<locals>.<listcomp>�,)rBr@r
rror>)r^r`rrrrr]`s
zDistribution.finalize_optionsrc
Csddlm}ddlm}|rR|r*|��}n|j}|�|�|�|jd�t	d�|rt|�|j
�|�d�t	d�|jD]z}t|t
�r�t||�r�|}	n
|�|�}	t|	d�r�t|	jt�r�|�|	jt|	j��n|�|	j�|�d|	j�t	d�qzt	||j��dS)	Nr��	gen_usager�z
Global options:r8zKInformation display options (just display information, ignore any commands)r�zOptions for '%s' command:)�distutils.corer�r�r�r�r�r�Z
print_help�common_usage�printr�rqr
rr�r�rYr�rr�r�rrE)
r^r�r�r�rqr�r�r9rb�klassrrrr�ms:

�



��
zDistribution._show_helpc	Cs�ddlm}|jr4|��td�t||j��dSd}i}|jD]}d||d<qB|D]l\}}|rX|�|�rXt|�}t	|j
d|��}|dkr�td�|��n |dkr�td	�|��nt|�d}qX|S)
Nrr�r8rr7r�r�)r.r0r1r2r:)r�r�Z
help_commands�print_commandsr�rEr�rQrrBr@r~)	r^r�r�Zany_display_optionsZis_display_option�optionrdrerrrrr��s*
z#Distribution.handle_display_optionsc	Csjt|d�|D]T}|j�|�}|s.|�|�}z
|j}Wntk
rPd}YnXtd|||f�qdS)N�:�(no description available)z
  %-*s  %s)r�rCrQr�r,�AttributeError)r^rqrp�
max_length�cmdr�r,rrr�print_command_list�s


zDistribution.print_command_listcCs�ddl}|jj}i}|D]}d||<qg}|j��D]}|�|�s4|�|�q4d}||D]}t|�|krZt|�}qZ|�|d|�|r�t	�|�|d|�dS)NrrzStandard commandszExtra commands)
�distutils.commandrb�__all__rCrmrQr�r�r�r�)r^rv�std_commands�is_stdr��extra_commandsr�rrrr��s.


��zDistribution.print_commandsc		Cs�ddl}|jj}i}|D]}d||<qg}|j��D]}|�|�s4|�|�q4g}||D]P}|j�|�}|sx|�|�}z
|j}Wnt	k
r�d}YnX|�||f�qZ|S)Nrrr�)
r�rbr�rCrmrQr�r�r,r�)	r^rvr�r�r�r��rvr�r,rrr�get_command_list�s(	




zDistribution.get_command_listcCsN|j}t|t�sJ|dkrd}dd�|�d�D�}d|krD|�dd�||_|S)Nr8cSsg|]}|dkr|���qS)r8r�)r4Zpkgrrrr6!sz5Distribution.get_command_packages.<locals>.<listcomp>r�zdistutils.commandr)rDr
rro�insert)r^Zpkgsrrr�get_command_packagess
z!Distribution.get_command_packagesc	Cs�|j�|�}|r|S|��D]�}d||f}|}zt|�tj|}Wntk
r^YqYnXzt||�}Wn&tk
r�t	d|||f��YnX||j|<|St	d|��dS)Nz%s.%sz3invalid command '%s' (no class '%s' in module '%s')zinvalid command '%s')
rCrQr��
__import__rVr|�ImportErrorrBr�r�)r^rbr�ZpkgnameZmodule_nameZ
klass_name�modulerrrr�'s,
��

zDistribution.get_command_classcCsl|j�|�}|sh|rhtr&|�d|�|�|�}||�}|j|<d|j|<|j�|�}|rh|�||�|S)Nz<Distribution.get_command_obj(): creating '%s' command objectr)rOrQrrnr�rPrG�_set_command_options)r^rbZcreate�cmd_objr�r9rrr�get_command_objMs�

zDistribution.get_command_objcCs\|��}|dkr|�|�}tr,|�d|�|��D�] \}\}}trZ|�d|||f�zdd�|jD�}Wntk
r�g}YnXz
|j}Wntk
r�i}YnXz|t|t	�}	||kr�|	r�t
|||t|��nJ||kr�|	r�t
||t|��n,t||��rt
|||�nt
d|||f��Wq4tk
�rT}
zt
|
��W5d}
~
XYq4Xq4dS)Nz#  setting options for '%s' command:z    %s = %s (from %s)cSsg|]}t|��qSrr3)r4�orrrr6|s�z5Distribution._set_command_options.<locals>.<listcomp>z1error in %s: command '%s' has no such option '%s')�get_command_namerSrrnrRZboolean_optionsr�r�r
rr>rrYr�r�)r^rOZoption_dict�command_namer��sourcerZ	bool_optsZneg_optZ	is_stringrrrrr�hsF	

��




��z!Distribution._set_command_optionsrcCs|ddlm}t||�s&|}|�|�}n|��}|js8|S|��d|_d|j|<|�|�|rx|�	�D]}|�
||�qf|S)Nrr�)r�r�r
r�r�Z	finalizedZinitialize_optionsrPr�Zget_sub_commands�reinitialize_command)r^rbZreinit_subcommandsr�r��subrrrr��s


z!Distribution.reinitialize_commandcCst�||�dSrir	)r^r�levelrrrrn�szDistribution.announcecCs|jD]}|�|�qdSri)rq�run_command)r^r�rrr�run_commands�s
zDistribution.run_commandscCsD|j�|�rdSt�d|�|�|�}|��|��d|j|<dS)Nz
running %sr)rPrQr
�infor�Zensure_finalized�run)r^rbr�rrrr��s	
zDistribution.run_commandcCst|jp|jpg�dkS�Nr)r�rHrIr�rrr�has_pure_modules�szDistribution.has_pure_modulescCs|jot|j�dkSr�)rLr�r�rrr�has_ext_modules�szDistribution.has_ext_modulescCs|jot|j�dkSr�)rJr�r�rrr�has_c_libraries�szDistribution.has_c_librariescCs|��p|��Sri)r�r�r�rrr�has_modules�szDistribution.has_modulescCs|jot|j�dkSr�)rKr�r�rrr�has_headers�szDistribution.has_headerscCs|jot|j�dkSr�)rMr�r�rrr�has_scripts�szDistribution.has_scriptscCs|jot|j�dkSr�)rNr�r�rrr�has_data_files�szDistribution.has_data_filescCs|��o|��o|��Sri)r�r�r�r�rrr�is_pure�s
��zDistribution.is_pure)N)NNr8)N)r)N)r)(r�
__module__�__qualname__r�r�r�r=r�rhrSrur�r�r�r�r�r]r�r�r�r�r�r�r�r�r�r�r
�INFOrnr�r�r�r�r�r�r�r�r�r�rrrrr,s��	�,

0
:C[
�
2(!"&

,
)
rc@seZdZdZdAdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�ZeZd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Z d;d<�Z!d=d>�Z"d?d@�Z#dS)Br?)r!r"r%�author_emailr'�maintainer_emailr)r*r,�long_descriptionr/r-r$r(Z
contact_emailr.�download_urlr0r1r2NcCs�|dk	r|�t|��nfd|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_dSri)�
read_pkg_file�openr!r"r%r�r'r�r)r*r,r�r/r-r.r�r0r1r2)r^rzrrrrh
s&zDistributionMetadata.__init__cst|���fdd�}�fdd�}�d}|d�|_|d�|_|d�|_|d	�|_d|_|d
�|_d|_|d�|_|d�|_	d
�kr�|d
�|_
nd|_
|d�|_|d�|_d�kr�|d��d�|_
|d�|_|d�|_|dkr�|d�|_|d�|_|d�|_nd|_d|_d|_dS)Ncs�|}|dkrdS|S�NZUNKNOWNr)r!r�rrr�_read_field(sz7DistributionMetadata.read_pkg_file.<locals>._read_fieldcs��|d�}|gkrdS|Sri)Zget_all)r!�valuesr�rr�
_read_list.sz6DistributionMetadata.read_pkg_file.<locals>._read_listzmetadata-versionr!r"Zsummaryr%r&z	home-pager*zdownload-urlr,r/r��platformZ
classifier�1.1r1r0r2)rr!r"r,r%r'r�r�r)r*r�r�ror/r-r.r1r0r2)r^�filer�r�Zmetadata_versionrr�rr�$s:












z"DistributionMetadata.read_pkg_filec	Cs2ttj�|d�ddd��}|�|�W5QRXdS)NzPKG-INFO�wzUTF-8)�encoding)r�ryrzr~�write_pkg_file)r^Zbase_dirZpkg_inforrr�write_pkg_infoXs
�z#DistributionMetadata.write_pkg_infocCsbd}|js"|js"|js"|js"|jr&d}|�d|�|�d|���|�d|���|�d|���|�d|�	��|�d|�
��|�d	|���|�d
|���|jr�|�d|j�t
|���}|�d|�d
�|���}|�r|�d|�|�|d|���|�|d|���|�|d|���|�|d|���|�|d|���dS)Nz1.0r�zMetadata-Version: %s
z	Name: %s
zVersion: %s
zSummary: %s
zHome-page: %s
zAuthor: %s
zAuthor-email: %s
zLicense: %s
zDownload-URL: %s
zDescription: %s
r�z
Keywords: %s
ZPlatformZ
ClassifierZRequiresZProvidesZ	Obsoletes)r0r1r2r.r�rX�get_name�get_version�get_description�get_url�get_contact�get_contact_email�get_licenser�get_long_descriptionr~�get_keywords�_write_list�
get_platforms�get_classifiers�get_requires�get_provides�
get_obsoletes)r^r�r"Z	long_descr/rrrr_s6��z#DistributionMetadata.write_pkg_filecCs |D]}|�d||f�qdS)Nz%s: %s
)rX)r^r�r!r�rrrrr
�sz DistributionMetadata._write_listcCs
|jpdSr�)r!r�rrrr�szDistributionMetadata.get_namecCs
|jpdS)Nz0.0.0)r"r�rrrr�sz DistributionMetadata.get_versioncCsd|��|��fS)Nz%s-%s)rrr�rrr�get_fullname�sz!DistributionMetadata.get_fullnamecCs
|jpdSr�)r%r�rrr�
get_author�szDistributionMetadata.get_authorcCs
|jpdSr�)r�r�rrr�get_author_email�sz%DistributionMetadata.get_author_emailcCs
|jpdSr�)r'r�rrr�get_maintainer�sz#DistributionMetadata.get_maintainercCs
|jpdSr�)r�r�rrr�get_maintainer_email�sz)DistributionMetadata.get_maintainer_emailcCs|jp|jpdSr�)r'r%r�rrrr�sz DistributionMetadata.get_contactcCs|jp|jpdSr�)r�r�r�rrrr	�sz&DistributionMetadata.get_contact_emailcCs
|jpdSr�)r)r�rrrr�szDistributionMetadata.get_urlcCs
|jpdSr�)r*r�rrrr
�sz DistributionMetadata.get_licensecCs
|jpdSr�)r,r�rrrr�sz$DistributionMetadata.get_descriptioncCs
|jpdSr�)r�r�rrrr�sz)DistributionMetadata.get_long_descriptioncCs
|jpgSri)r/r�rrrr�sz!DistributionMetadata.get_keywordscCst|d�|_dS)Nr/)rr/�r^rrrr�set_keywords�sz!DistributionMetadata.set_keywordscCs|jp
dgSr�)r-r�rrrr�sz"DistributionMetadata.get_platformscCst|d�|_dS)Nr-)rr-rrrr�
set_platforms�sz"DistributionMetadata.set_platformscCs
|jpgSri)r.r�rrrr�sz$DistributionMetadata.get_classifierscCst|d�|_dS)Nr.)rr.rrrr�set_classifiers�sz$DistributionMetadata.set_classifierscCs
|jpdSr�)r�r�rrr�get_download_url�sz%DistributionMetadata.get_download_urlcCs
|jpgSri)r1r�rrrr�sz!DistributionMetadata.get_requirescCs,ddl}|D]}|j�|�qt|�|_dSr�)�distutils.versionpredicate�versionpredicate�VersionPredicaterr1�r^rrvrrrr�set_requires�sz!DistributionMetadata.set_requirescCs
|jpgSri)r0r�rrrr�sz!DistributionMetadata.get_providescCs6dd�|D�}|D]}ddl}|j�|�q||_dS)NcSsg|]}|���qSrr�)r4rrrrr6�sz5DistributionMetadata.set_provides.<locals>.<listcomp>r)rrZsplit_provisionr0)r^rrrvrrr�set_provides�s
z!DistributionMetadata.set_providescCs
|jpgSri)r2r�rrrr�sz"DistributionMetadata.get_obsoletescCs,ddl}|D]}|j�|�qt|�|_dSr�)rrrrr2r rrr�
set_obsoletes�sz"DistributionMetadata.set_obsoletes)N)$rr�r�rArhr�rrr
rrrrrrrrr	rr
Zget_licencerrrrrrrrrrr!rr"rr#rrrrr?�sB	
4"r?cCs$g}|D]}|�|dd��q|S)Nr�)r�)r9Znew_optionsZ
help_tuplerrrr��sr�)rVry�reZemailrrTr�Zdistutils.errorsZdistutils.fancy_getoptrrZdistutils.utilrrrrvr
Zdistutils.debugr�compiler�rrr?r�rrrr�<module>s2

Zcdistutils/__pycache__/dep_util.cpython-38.pyc000064400000005234151153537450015252 0ustar00U

e5d�
�@s6dZddlZddlmZdd�Zdd�Zdd	d
�ZdS)z�distutils.dep_util

Utility functions for simple, timestamp-based dependency of files
and groups of files; also, function based entirely on such
timestamp dependency analysis.�N)�DistutilsFileErrorcCs`tj�|�s tdtj�|���tj�|�s0dSddlm}t�|�|}t�|�|}||kS)aReturn true if 'source' exists and is more recently modified than
    'target', or if 'source' exists and 'target' doesn't.  Return false if
    both exist and 'target' is the same age or younger than 'source'.
    Raise DistutilsFileError if 'source' does not exist.
    zfile '%s' does not exist�r��ST_MTIME)�os�path�existsr�abspath�statr)�source�targetrZmtime1Zmtime2�r
�*/usr/lib64/python3.8/distutils/dep_util.py�newers
�rcCsht|�t|�krtd��g}g}tt|��D]2}t||||�r,|�||�|�||�q,||fS)z�Walk two filename lists in parallel, testing if each source is newer
    than its corresponding target.  Return a pair of lists (sources,
    targets) where source is newer than target, according to the semantics
    of 'newer()'.
    z+'sources' and 'targets' must be same length)�len�
ValueError�ranger�append)�sourcesZtargetsZ	n_sourcesZ	n_targets�ir
r
r�newer_pairwise sr�errorcCs�tj�|�sdSddlm}t�|�|}|D]P}tj�|�sb|dkrHn|dkrTq.n|dkrbdSt�|�|}||kr.dSq.dS)a�Return true if 'target' is out-of-date with respect to any file
    listed in 'sources'.  In other words, if 'target' exists and is newer
    than every file in 'sources', return false; otherwise return true.
    'missing' controls what we do when a source file is missing; the
    default ("error") is to blow up with an OSError from inside 'stat()';
    if it is "ignore", we silently drop any missing source files; if it is
    "newer", any missing source files make us assume that 'target' is
    out-of-date (this is handy in "dry-run" mode: it'll make you pretend to
    carry out commands that wouldn't work because inputs are missing, but
    that doesn't matter because you're not actually going to run the
    commands).
    rrrr�ignorerN)rrrr
r)rrZmissingrZtarget_mtimer�source_mtimer
r
r�newer_group6s r)r)�__doc__rZdistutils.errorsrrrrr
r
r
r�<module>s
distutils/__pycache__/__init__.cpython-38.pyc000064400000000602151153537450015176 0ustar00U

e5d��@s&dZddlZejdej�d��ZdS)z�distutils

The main package for the Python Module Distribution Utilities.  Normally
used from a setup script as

   from distutils.core import setup

   setup (...)
�N� )�__doc__�sys�version�index�__version__�rr�*/usr/lib64/python3.8/distutils/__init__.py�<module>s
distutils/__pycache__/fancy_getopt.cpython-38.opt-1.pyc000064400000024422151153537450017066 0ustar00U

e5dxE�@s�dZddlZddlZddlZddlZddlTdZe�de�Ze�deef�Z	e
�dd�ZGd	d
�d
�Z
dd�Zd
d�ejD�Zdd�Zdd�ZGdd�d�Zedkr�dZdD]*Zede�ed�eee���e�q�dS)a6distutils.fancy_getopt

Wrapper around the standard getopt module that provides the following
additional features:
  * short and long options are tied together
  * options have help strings, so fancy_getopt could potentially
    create a complete usage summary
  * options set attributes of a passed-in object
�N)�*z[a-zA-Z](?:[a-zA-Z0-9-]*)z^%s$z^(%s)=!(%s)$�-�_c@s�eZdZdZddd�Zdd�Zdd�Zd d	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
d!dd�Zdd�Zd"dd�Zd#dd�ZdS)$�FancyGetopta�Wrapper around the standard 'getopt()' module that provides some
    handy extra functionality:
      * short and long options are tied together
      * options have help strings, and help text can be assembled
        from them
      * options set attributes of a passed-in object
      * boolean options can have "negative aliases" -- eg. if
        --quiet is the "negative alias" of --verbose, then "--quiet"
        on the command line sets 'verbose' to false
    NcCsN||_i|_|jr|��i|_i|_g|_g|_i|_i|_i|_	g|_
dS�N)�option_table�option_index�_build_index�alias�negative_alias�
short_opts�	long_opts�
short2long�	attr_name�	takes_arg�option_order��selfr�r�./usr/lib64/python3.8/distutils/fancy_getopt.py�__init__)s	zFancyGetopt.__init__cCs(|j��|jD]}||j|d<qdS)Nr)r�clearr)r�optionrrrr	Qs

zFancyGetopt._build_indexcCs||_|��dSr)rr	rrrr�set_option_tableVszFancyGetopt.set_option_tablecCs<||jkrtd|��n |||f}|j�|�||j|<dS)Nz'option conflict: already an option '%s')r�DistutilsGetoptErrorr�append)r�long_optionZshort_optionZhelp_stringrrrr�
add_optionZs
�
zFancyGetopt.add_optioncCs
||jkS)zcReturn true if the option table for this parser has an
        option with long name 'long_option'.)r�rrrrr�
has_optioncszFancyGetopt.has_optioncCs
|�t�S)z�Translate long option name 'long_option' to the form it
        has as an attribute of some object: ie., translate hyphens
        to underscores.��	translate�
longopt_xlaterrrr�
get_attr_namehszFancyGetopt.get_attr_namecCsN|��D]@\}}||jkr,td|||f��||jkrtd|||f��qdS)Nz(invalid %s '%s': option '%s' not definedz0invalid %s '%s': aliased option '%s' not defined)�itemsrr)r�aliasesZwhatr
�optrrr�_check_alias_dictns
�
�zFancyGetopt._check_alias_dictcCs|�|d�||_dS)z'Set the aliases for this option parser.r
N)r'r
)rr
rrr�set_aliasesxszFancyGetopt.set_aliasescCs|�|d�||_dS)z�Set the negative aliases for this option parser.
        'negative_alias' should be a dictionary mapping option names to
        option names, both the key and value must already be defined
        in the option table.znegative aliasN)r'r)rrrrr�set_negative_aliases}sz FancyGetopt.set_negative_aliasescCs�g|_g|_|j��i|_|jD�]�}t|�dkrD|\}}}d}n(t|�dkr^|\}}}}ntd|f��t|t	�r�t|�dkr�t
d|��|dks�t|t	�r�t|�dks�t
d	|��||j|<|j�|�|d
dkr�|r�|d}|dd
�}d|j|<nF|j
�|�}|dk	�r:|j|�r0t
d
||f��||jd
<d|j|<|j�|�}|dk	�r�|j||j|k�r�t
d||f��t�|��s�t
d|��|�|�|j|<|r"|j�|�||j|d<q"dS)z�Populate the various data structures that keep tabs on the
        option table.  Called by 'getopt()' before it can do anything
        worthwhile.
        �r�zinvalid option tuple: %r�z9invalid long option '%s': must be a string of length >= 2N�z:invalid short option '%s': must a single character or None����=�:z>invalid negative alias '%s': aliased option '%s' takes a valuezginvalid alias '%s': inconsistent with aliased option '%s' (one of them takes a value, the other doesn'tzEinvalid long option name '%s' (must be letters, numbers, hyphens only)r
rrr�repeatr�len�
ValueError�
isinstance�strrrrr�getr
�
longopt_re�matchr#r)rr�long�short�helpr1Zalias_torrr�_grok_option_table�st

��
��

��


��
��zFancyGetopt._grok_option_tablec
Csn|dkrtjdd�}|dkr*t�}d}nd}|��d�|j�}zt�|||j�\}}Wn,tjk
r�}zt	|��W5d}~XYnX|D]�\}}t
|�dkr�|ddkr�|j|d}n|dd�}|j�
|�}	|	r�|	}|j|�s|j�
|�}	|	�r|	}d}nd}|j|}
|�r:|j�
|
�dk	�r:t||
d�d}t||
|�|j�||f�q�|�rf||fS|SdS)	aParse command-line options in args. Store as attributes on object.

        If 'args' is None or not supplied, uses 'sys.argv[1:]'.  If
        'object' is None or not supplied, creates a new OptionDummy
        object, stores option values there, and returns a tuple (args,
        object).  If 'object' is supplied, it is modified in place and
        'getopt()' just returns 'args'; in both cases, the returned
        'args' is a modified copy of the passed-in 'args' list, which
        is left untouched.
        Nr-TF� r,rr)�sys�argv�OptionDummyr<�joinr�getoptr
�errorZDistutilsArgErrorr2rr
r6rrrr1�getattr�setattrrr)r�args�objectZcreated_objectrZopts�msgr&�valr
�attrrrrrB�sB
zFancyGetopt.getoptcCs|jdkrtd��n|jSdS)z�Returns the list of (option, value) tuples processed by the
        previous run of 'getopt()'.  Raises RuntimeError if
        'getopt()' hasn't been called yet.
        Nz!'getopt()' hasn't been called yet)r�RuntimeError)rrrr�get_option_orders

zFancyGetopt.get_option_ordercCsjd}|jD]L}|d}|d}t|�}|ddkr:|d}|dk	rJ|d}||kr
|}q
|ddd}d}||}	d	|}
|r�|g}nd
g}|jD]�}|dd�\}}}t||	�}
|ddkr�|dd�}|dk�r|
r�|�d|||
df�n|�d
||f�n:d||f}|
�r4|�d|||
df�n|�d|�|
dd�D]}|�|
|��qNq�|S)z�Generate help text (a list of strings, one per suggested line of
        output) from the option table for this FancyGetopt object.
        rr-r.r/N�r,�Nr=zOption summary:r*z  --%-*s  %sz
  --%-*s  z%s (-%s)z  --%-*s)rr2�	wrap_textr)r�headerZmax_optrr9r:�lZ	opt_widthZ
line_widthZ
text_widthZ
big_indent�linesr;�textZ	opt_namesrrr�
generate_helpsH



�zFancyGetopt.generate_helpcCs0|dkrtj}|�|�D]}|�|d�qdS)N�
)r>�stdoutrT�write)rrP�file�linerrr�
print_helphszFancyGetopt.print_help)N)NN)NN)N)NN)�__name__�
__module__�__qualname__�__doc__rr	rrrr#r'r(r)r<rBrLrTrZrrrrrs
(
	
M
=

OrcCst|�}|�|�|�||�Sr)rr)rB)�optionsZnegative_optrGrF�parserrrr�fancy_getoptos
racCsi|]}t|�d�qS)r=)�ord)�.0Z_wscharrrr�
<dictcomp>usrdcCs|dkrgSt|�|kr|gS|��}|�t�}t�d|�}dd�|D�}g}|�rg}d}|r�t|d�}|||kr�|�|d�|d=||}q\|r�|dddkr�|d=q�q\|�r|dkr�|�|dd|��|d|d�|d<|dddk�r|d=|�d�|��qN|S)	z�wrap_text(text : string, width : int) -> [string]

    Split 'text' into multiple lines of no more than 'width' characters
    each, and return the list of strings that results.
    Nz( +|-+)cSsg|]}|r|�qSrr)rcZchrrr�
<listcomp>�szwrap_text.<locals>.<listcomp>rr.r=�)r2�
expandtabsr!�WS_TRANS�re�splitrrA)rS�widthZchunksrRZcur_lineZcur_lenrQrrrrOws:

rOcCs
|�t�S)zXConvert a long option name to a valid Python identifier by
    changing "-" to "_".
    r )r&rrr�translate_longopt�srlc@seZdZdZgfdd�ZdS)r@z_Dummy class just used as a place to hold command-line option
    values as instance attributes.cCs|D]}t||d�qdS)zkCreate a new OptionDummy instance.  The attributes listed in
        'options' will be initialized to None.N)rE)rr_r&rrrr�szOptionDummy.__init__N)r[r\r]r^rrrrrr@�sr@�__main__z�Tra-la-la, supercalifragilisticexpialidocious.
How *do* you spell that odd word, anyways?
(Someone ask Mary -- she'll know [or she'll
say, "How should I know?"].))�
���(z	width: %drU)r^r>�stringrirBZdistutils.errorsZlongopt_pat�compiler7Zneg_alias_rer5�	maketransr"rraZ
whitespacerhrOrlr@r[rS�w�printrArrrr�<module>s*
T6distutils/__pycache__/debug.cpython-38.opt-1.pyc000064400000000304151153537450015463 0ustar00U

e5d��@sddlZej�d�ZdS)�NZDISTUTILS_DEBUG)�os�environ�get�DEBUG�rr�'/usr/lib64/python3.8/distutils/debug.py�<module>sdistutils/dir_util.py000064400000017142151153537450010773 0ustar00"""distutils.dir_util

Utility functions for manipulating directories and directory trees."""

import os
import errno
from distutils.errors import DistutilsFileError, DistutilsInternalError
from distutils import log

# cache for by mkpath() -- in addition to cheapening redundant calls,
# eliminates redundant "creating /foo/bar/baz" messages in dry-run mode
_path_created = {}

# I don't use os.makedirs because a) it's new to Python 1.5.2, and
# b) it blows up if the directory already exists (I want to silently
# succeed in that case).
def mkpath(name, mode=0o777, verbose=1, dry_run=0):
    """Create a directory and any missing ancestor directories.

    If the directory already exists (or if 'name' is the empty string, which
    means the current directory, which of course exists), then do nothing.
    Raise DistutilsFileError if unable to create some directory along the way
    (eg. some sub-path exists, but is a file rather than a directory).
    If 'verbose' is true, print a one-line summary of each mkdir to stdout.
    Return the list of directories actually created.
    """

    global _path_created

    # Detect a common bug -- name is None
    if not isinstance(name, str):
        raise DistutilsInternalError(
              "mkpath: 'name' must be a string (got %r)" % (name,))

    # XXX what's the better way to handle verbosity? print as we create
    # each directory in the path (the current behaviour), or only announce
    # the creation of the whole path? (quite easy to do the latter since
    # we're not using a recursive algorithm)

    name = os.path.normpath(name)
    created_dirs = []
    if os.path.isdir(name) or name == '':
        return created_dirs
    if _path_created.get(os.path.abspath(name)):
        return created_dirs

    (head, tail) = os.path.split(name)
    tails = [tail]                      # stack of lone dirs to create

    while head and tail and not os.path.isdir(head):
        (head, tail) = os.path.split(head)
        tails.insert(0, tail)          # push next higher dir onto stack

    # now 'head' contains the deepest directory that already exists
    # (that is, the child of 'head' in 'name' is the highest directory
    # that does *not* exist)
    for d in tails:
        #print "head = %s, d = %s: " % (head, d),
        head = os.path.join(head, d)
        abs_head = os.path.abspath(head)

        if _path_created.get(abs_head):
            continue

        if verbose >= 1:
            log.info("creating %s", head)

        if not dry_run:
            try:
                os.mkdir(head, mode)
            except OSError as exc:
                if not (exc.errno == errno.EEXIST and os.path.isdir(head)):
                    raise DistutilsFileError(
                          "could not create '%s': %s" % (head, exc.args[-1]))
            created_dirs.append(head)

        _path_created[abs_head] = 1
    return created_dirs

def create_tree(base_dir, files, mode=0o777, verbose=1, dry_run=0):
    """Create all the empty directories under 'base_dir' needed to put 'files'
    there.

    'base_dir' is just the name of a directory which doesn't necessarily
    exist yet; 'files' is a list of filenames to be interpreted relative to
    'base_dir'.  'base_dir' + the directory portion of every file in 'files'
    will be created if it doesn't already exist.  'mode', 'verbose' and
    'dry_run' flags are as for 'mkpath()'.
    """
    # First get the list of directories to create
    need_dir = set()
    for file in files:
        need_dir.add(os.path.join(base_dir, os.path.dirname(file)))

    # Now create them
    for dir in sorted(need_dir):
        mkpath(dir, mode, verbose=verbose, dry_run=dry_run)

def copy_tree(src, dst, preserve_mode=1, preserve_times=1,
              preserve_symlinks=0, update=0, verbose=1, dry_run=0):
    """Copy an entire directory tree 'src' to a new location 'dst'.

    Both 'src' and 'dst' must be directory names.  If 'src' is not a
    directory, raise DistutilsFileError.  If 'dst' does not exist, it is
    created with 'mkpath()'.  The end result of the copy is that every
    file in 'src' is copied to 'dst', and directories under 'src' are
    recursively copied to 'dst'.  Return the list of files that were
    copied or might have been copied, using their output name.  The
    return value is unaffected by 'update' or 'dry_run': it is simply
    the list of all files under 'src', with the names changed to be
    under 'dst'.

    'preserve_mode' and 'preserve_times' are the same as for
    'copy_file'; note that they only apply to regular files, not to
    directories.  If 'preserve_symlinks' is true, symlinks will be
    copied as symlinks (on platforms that support them!); otherwise
    (the default), the destination of the symlink will be copied.
    'update' and 'verbose' are the same as for 'copy_file'.
    """
    from distutils.file_util import copy_file

    if not dry_run and not os.path.isdir(src):
        raise DistutilsFileError(
              "cannot copy tree '%s': not a directory" % src)
    try:
        names = os.listdir(src)
    except OSError as e:
        if dry_run:
            names = []
        else:
            raise DistutilsFileError(
                  "error listing files in '%s': %s" % (src, e.strerror))

    if not dry_run:
        mkpath(dst, verbose=verbose)

    outputs = []

    for n in names:
        src_name = os.path.join(src, n)
        dst_name = os.path.join(dst, n)

        if n.startswith('.nfs'):
            # skip NFS rename files
            continue

        if preserve_symlinks and os.path.islink(src_name):
            link_dest = os.readlink(src_name)
            if verbose >= 1:
                log.info("linking %s -> %s", dst_name, link_dest)
            if not dry_run:
                os.symlink(link_dest, dst_name)
            outputs.append(dst_name)

        elif os.path.isdir(src_name):
            outputs.extend(
                copy_tree(src_name, dst_name, preserve_mode,
                          preserve_times, preserve_symlinks, update,
                          verbose=verbose, dry_run=dry_run))
        else:
            copy_file(src_name, dst_name, preserve_mode,
                      preserve_times, update, verbose=verbose,
                      dry_run=dry_run)
            outputs.append(dst_name)

    return outputs

def _build_cmdtuple(path, cmdtuples):
    """Helper for remove_tree()."""
    for f in os.listdir(path):
        real_f = os.path.join(path,f)
        if os.path.isdir(real_f) and not os.path.islink(real_f):
            _build_cmdtuple(real_f, cmdtuples)
        else:
            cmdtuples.append((os.remove, real_f))
    cmdtuples.append((os.rmdir, path))

def remove_tree(directory, verbose=1, dry_run=0):
    """Recursively remove an entire directory tree.

    Any errors are ignored (apart from being reported to stdout if 'verbose'
    is true).
    """
    global _path_created

    if verbose >= 1:
        log.info("removing '%s' (and everything under it)", directory)
    if dry_run:
        return
    cmdtuples = []
    _build_cmdtuple(directory, cmdtuples)
    for cmd in cmdtuples:
        try:
            cmd[0](cmd[1])
            # remove dir from cache if it's already there
            abspath = os.path.abspath(cmd[1])
            if abspath in _path_created:
                del _path_created[abspath]
        except OSError as exc:
            log.warn("error removing %s: %s", directory, exc)

def ensure_relative(path):
    """Take the full path 'path', and make it a relative path.

    This is useful to make 'path' the second argument to os.path.join().
    """
    drive, path = os.path.splitdrive(path)
    if path[0:1] == os.sep:
        path = drive + path[1:]
    return path
distutils/dep_util.py000064400000006643151153537450010771 0ustar00"""distutils.dep_util

Utility functions for simple, timestamp-based dependency of files
and groups of files; also, function based entirely on such
timestamp dependency analysis."""

import os
from distutils.errors import DistutilsFileError


def newer (source, target):
    """Return true if 'source' exists and is more recently modified than
    'target', or if 'source' exists and 'target' doesn't.  Return false if
    both exist and 'target' is the same age or younger than 'source'.
    Raise DistutilsFileError if 'source' does not exist.
    """
    if not os.path.exists(source):
        raise DistutilsFileError("file '%s' does not exist" %
                                 os.path.abspath(source))
    if not os.path.exists(target):
        return 1

    from stat import ST_MTIME
    mtime1 = os.stat(source)[ST_MTIME]
    mtime2 = os.stat(target)[ST_MTIME]

    return mtime1 > mtime2

# newer ()


def newer_pairwise (sources, targets):
    """Walk two filename lists in parallel, testing if each source is newer
    than its corresponding target.  Return a pair of lists (sources,
    targets) where source is newer than target, according to the semantics
    of 'newer()'.
    """
    if len(sources) != len(targets):
        raise ValueError("'sources' and 'targets' must be same length")

    # build a pair of lists (sources, targets) where  source is newer
    n_sources = []
    n_targets = []
    for i in range(len(sources)):
        if newer(sources[i], targets[i]):
            n_sources.append(sources[i])
            n_targets.append(targets[i])

    return (n_sources, n_targets)

# newer_pairwise ()


def newer_group (sources, target, missing='error'):
    """Return true if 'target' is out-of-date with respect to any file
    listed in 'sources'.  In other words, if 'target' exists and is newer
    than every file in 'sources', return false; otherwise return true.
    'missing' controls what we do when a source file is missing; the
    default ("error") is to blow up with an OSError from inside 'stat()';
    if it is "ignore", we silently drop any missing source files; if it is
    "newer", any missing source files make us assume that 'target' is
    out-of-date (this is handy in "dry-run" mode: it'll make you pretend to
    carry out commands that wouldn't work because inputs are missing, but
    that doesn't matter because you're not actually going to run the
    commands).
    """
    # If the target doesn't even exist, then it's definitely out-of-date.
    if not os.path.exists(target):
        return 1

    # Otherwise we have to find out the hard way: if *any* source file
    # is more recent than 'target', then 'target' is out-of-date and
    # we can immediately return true.  If we fall through to the end
    # of the loop, then 'target' is up-to-date and we return false.
    from stat import ST_MTIME
    target_mtime = os.stat(target)[ST_MTIME]
    for source in sources:
        if not os.path.exists(source):
            if missing == 'error':      # blow up when we stat() the file
                pass
            elif missing == 'ignore':   # missing source dropped from
                continue                #  target's dependency list
            elif missing == 'newer':    # missing source means target is
                return 1                #  out-of-date

        source_mtime = os.stat(source)[ST_MTIME]
        if source_mtime > target_mtime:
            return 1
    else:
        return 0

# newer_group ()
distutils/file_util.py000064400000017724151153537450011142 0ustar00"""distutils.file_util

Utility functions for operating on single files.
"""

import os
from distutils.errors import DistutilsFileError
from distutils import log

# for generating verbose output in 'copy_file()'
_copy_action = { None:   'copying',
                 'hard': 'hard linking',
                 'sym':  'symbolically linking' }


def _copy_file_contents(src, dst, buffer_size=16*1024):
    """Copy the file 'src' to 'dst'; both must be filenames.  Any error
    opening either file, reading from 'src', or writing to 'dst', raises
    DistutilsFileError.  Data is read/written in chunks of 'buffer_size'
    bytes (default 16k).  No attempt is made to handle anything apart from
    regular files.
    """
    # Stolen from shutil module in the standard library, but with
    # custom error-handling added.
    fsrc = None
    fdst = None
    try:
        try:
            fsrc = open(src, 'rb')
        except OSError as e:
            raise DistutilsFileError("could not open '%s': %s" % (src, e.strerror))

        if os.path.exists(dst):
            try:
                os.unlink(dst)
            except OSError as e:
                raise DistutilsFileError(
                      "could not delete '%s': %s" % (dst, e.strerror))

        try:
            fdst = open(dst, 'wb')
        except OSError as e:
            raise DistutilsFileError(
                  "could not create '%s': %s" % (dst, e.strerror))

        while True:
            try:
                buf = fsrc.read(buffer_size)
            except OSError as e:
                raise DistutilsFileError(
                      "could not read from '%s': %s" % (src, e.strerror))

            if not buf:
                break

            try:
                fdst.write(buf)
            except OSError as e:
                raise DistutilsFileError(
                      "could not write to '%s': %s" % (dst, e.strerror))
    finally:
        if fdst:
            fdst.close()
        if fsrc:
            fsrc.close()

def copy_file(src, dst, preserve_mode=1, preserve_times=1, update=0,
              link=None, verbose=1, dry_run=0):
    """Copy a file 'src' to 'dst'.  If 'dst' is a directory, then 'src' is
    copied there with the same name; otherwise, it must be a filename.  (If
    the file exists, it will be ruthlessly clobbered.)  If 'preserve_mode'
    is true (the default), the file's mode (type and permission bits, or
    whatever is analogous on the current platform) is copied.  If
    'preserve_times' is true (the default), the last-modified and
    last-access times are copied as well.  If 'update' is true, 'src' will
    only be copied if 'dst' does not exist, or if 'dst' does exist but is
    older than 'src'.

    'link' allows you to make hard links (os.link) or symbolic links
    (os.symlink) instead of copying: set it to "hard" or "sym"; if it is
    None (the default), files are copied.  Don't set 'link' on systems that
    don't support it: 'copy_file()' doesn't check if hard or symbolic
    linking is available. If hardlink fails, falls back to
    _copy_file_contents().

    Under Mac OS, uses the native file copy function in macostools; on
    other systems, uses '_copy_file_contents()' to copy file contents.

    Return a tuple (dest_name, copied): 'dest_name' is the actual name of
    the output file, and 'copied' is true if the file was copied (or would
    have been copied, if 'dry_run' true).
    """
    # XXX if the destination file already exists, we clobber it if
    # copying, but blow up if linking.  Hmmm.  And I don't know what
    # macostools.copyfile() does.  Should definitely be consistent, and
    # should probably blow up if destination exists and we would be
    # changing it (ie. it's not already a hard/soft link to src OR
    # (not update) and (src newer than dst).

    from distutils.dep_util import newer
    from stat import ST_ATIME, ST_MTIME, ST_MODE, S_IMODE

    if not os.path.isfile(src):
        raise DistutilsFileError(
              "can't copy '%s': doesn't exist or not a regular file" % src)

    if os.path.isdir(dst):
        dir = dst
        dst = os.path.join(dst, os.path.basename(src))
    else:
        dir = os.path.dirname(dst)

    if update and not newer(src, dst):
        if verbose >= 1:
            log.debug("not copying %s (output up-to-date)", src)
        return (dst, 0)

    try:
        action = _copy_action[link]
    except KeyError:
        raise ValueError("invalid value '%s' for 'link' argument" % link)

    if verbose >= 1:
        if os.path.basename(dst) == os.path.basename(src):
            log.info("%s %s -> %s", action, src, dir)
        else:
            log.info("%s %s -> %s", action, src, dst)

    if dry_run:
        return (dst, 1)

    # If linking (hard or symbolic), use the appropriate system call
    # (Unix only, of course, but that's the caller's responsibility)
    elif link == 'hard':
        if not (os.path.exists(dst) and os.path.samefile(src, dst)):
            try:
                os.link(src, dst)
                return (dst, 1)
            except OSError:
                # If hard linking fails, fall back on copying file
                # (some special filesystems don't support hard linking
                #  even under Unix, see issue #8876).
                pass
    elif link == 'sym':
        if not (os.path.exists(dst) and os.path.samefile(src, dst)):
            os.symlink(src, dst)
            return (dst, 1)

    # Otherwise (non-Mac, not linking), copy the file contents and
    # (optionally) copy the times and mode.
    _copy_file_contents(src, dst)
    if preserve_mode or preserve_times:
        st = os.stat(src)

        # According to David Ascher <da@ski.org>, utime() should be done
        # before chmod() (at least under NT).
        if preserve_times:
            os.utime(dst, (st[ST_ATIME], st[ST_MTIME]))
        if preserve_mode:
            os.chmod(dst, S_IMODE(st[ST_MODE]))

    return (dst, 1)


# XXX I suspect this is Unix-specific -- need porting help!
def move_file (src, dst,
               verbose=1,
               dry_run=0):

    """Move a file 'src' to 'dst'.  If 'dst' is a directory, the file will
    be moved into it with the same name; otherwise, 'src' is just renamed
    to 'dst'.  Return the new full name of the file.

    Handles cross-device moves on Unix using 'copy_file()'.  What about
    other systems???
    """
    from os.path import exists, isfile, isdir, basename, dirname
    import errno

    if verbose >= 1:
        log.info("moving %s -> %s", src, dst)

    if dry_run:
        return dst

    if not isfile(src):
        raise DistutilsFileError("can't move '%s': not a regular file" % src)

    if isdir(dst):
        dst = os.path.join(dst, basename(src))
    elif exists(dst):
        raise DistutilsFileError(
              "can't move '%s': destination '%s' already exists" %
              (src, dst))

    if not isdir(dirname(dst)):
        raise DistutilsFileError(
              "can't move '%s': destination '%s' not a valid path" %
              (src, dst))

    copy_it = False
    try:
        os.rename(src, dst)
    except OSError as e:
        (num, msg) = e.args
        if num == errno.EXDEV:
            copy_it = True
        else:
            raise DistutilsFileError(
                  "couldn't move '%s' to '%s': %s" % (src, dst, msg))

    if copy_it:
        copy_file(src, dst, verbose=verbose)
        try:
            os.unlink(src)
        except OSError as e:
            (num, msg) = e.args
            try:
                os.unlink(dst)
            except OSError:
                pass
            raise DistutilsFileError(
                  "couldn't move '%s' to '%s' by copy/delete: "
                  "delete '%s' failed: %s"
                  % (src, dst, src, msg))
    return dst


def write_file (filename, contents):
    """Create a file with the specified name and write 'contents' (a
    sequence of strings without line terminators) to it.
    """
    f = open(filename, "w")
    try:
        for line in contents:
            f.write(line + "\n")
    finally:
        f.close()
distutils/unixccompiler.py000064400000035626151153537450012050 0ustar00"""distutils.unixccompiler

Contains the UnixCCompiler class, a subclass of CCompiler that handles
the "typical" Unix-style command-line C compiler:
  * macros defined with -Dname[=value]
  * macros undefined with -Uname
  * include search directories specified with -Idir
  * libraries specified with -lllib
  * library search directories specified with -Ldir
  * compile handled by 'cc' (or similar) executable with -c option:
    compiles .c to .o
  * link static library handled by 'ar' command (possibly with 'ranlib')
  * link shared library handled by 'cc -shared'
"""

import os, sys, re

from distutils import sysconfig
from distutils.dep_util import newer
from distutils.ccompiler import \
     CCompiler, gen_preprocess_options, gen_lib_options
from distutils.errors import \
     DistutilsExecError, CompileError, LibError, LinkError
from distutils import log

if sys.platform == 'darwin':
    import _osx_support

# XXX Things not currently handled:
#   * optimization/debug/warning flags; we just use whatever's in Python's
#     Makefile and live with it.  Is this adequate?  If not, we might
#     have to have a bunch of subclasses GNUCCompiler, SGICCompiler,
#     SunCCompiler, and I suspect down that road lies madness.
#   * even if we don't know a warning flag from an optimization flag,
#     we need some way for outsiders to feed preprocessor/compiler/linker
#     flags in to us -- eg. a sysadmin might want to mandate certain flags
#     via a site config file, or a user might want to set something for
#     compiling this module distribution only via the setup.py command
#     line, whatever.  As long as these options come from something on the
#     current system, they can be as system-dependent as they like, and we
#     should just happily stuff them into the preprocessor/compiler/linker
#     options and carry on.


class UnixCCompiler(CCompiler):

    compiler_type = 'unix'

    # These are used by CCompiler in two places: the constructor sets
    # instance attributes 'preprocessor', 'compiler', etc. from them, and
    # 'set_executable()' allows any of these to be set.  The defaults here
    # are pretty generic; they will probably have to be set by an outsider
    # (eg. using information discovered by the sysconfig about building
    # Python extensions).
    executables = {'preprocessor' : None,
                   'compiler'     : ["cc"],
                   'compiler_so'  : ["cc"],
                   'compiler_cxx' : ["cc"],
                   'linker_so'    : ["cc", "-shared"],
                   'linker_exe'   : ["cc"],
                   'archiver'     : ["ar", "-cr"],
                   'ranlib'       : None,
                  }

    if sys.platform[:6] == "darwin":
        executables['ranlib'] = ["ranlib"]

    # Needed for the filename generation methods provided by the base
    # class, CCompiler.  NB. whoever instantiates/uses a particular
    # UnixCCompiler instance should set 'shared_lib_ext' -- we set a
    # reasonable common default here, but it's not necessarily used on all
    # Unices!

    src_extensions = [".c",".C",".cc",".cxx",".cpp",".m"]
    obj_extension = ".o"
    static_lib_extension = ".a"
    shared_lib_extension = ".so"
    dylib_lib_extension = ".dylib"
    xcode_stub_lib_extension = ".tbd"
    static_lib_format = shared_lib_format = dylib_lib_format = "lib%s%s"
    xcode_stub_lib_format = dylib_lib_format
    if sys.platform == "cygwin":
        exe_extension = ".exe"

    def _fix_lib_args(self, libraries, library_dirs, runtime_library_dirs):
        """Remove standard library path from rpath"""
        libraries, library_dirs, runtime_library_dirs = super()._fix_lib_args(
            libraries, library_dirs, runtime_library_dirs)
        libdir = sysconfig.get_config_var('LIBDIR')
        if runtime_library_dirs and (libdir in runtime_library_dirs):
            runtime_library_dirs.remove(libdir)
        return libraries, library_dirs, runtime_library_dirs

    def preprocess(self, source, output_file=None, macros=None,
                   include_dirs=None, extra_preargs=None, extra_postargs=None):
        fixed_args = self._fix_compile_args(None, macros, include_dirs)
        ignore, macros, include_dirs = fixed_args
        pp_opts = gen_preprocess_options(macros, include_dirs)
        pp_args = self.preprocessor + pp_opts
        if output_file:
            pp_args.extend(['-o', output_file])
        if extra_preargs:
            pp_args[:0] = extra_preargs
        if extra_postargs:
            pp_args.extend(extra_postargs)
        pp_args.append(source)

        # We need to preprocess: either we're being forced to, or we're
        # generating output to stdout, or there's a target output file and
        # the source file is newer than the target (or the target doesn't
        # exist).
        if self.force or output_file is None or newer(source, output_file):
            if output_file:
                self.mkpath(os.path.dirname(output_file))
            try:
                self.spawn(pp_args)
            except DistutilsExecError as msg:
                raise CompileError(msg)

    def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
        compiler_so = self.compiler_so
        if sys.platform == 'darwin':
            compiler_so = _osx_support.compiler_fixup(compiler_so,
                                                    cc_args + extra_postargs)
        try:
            self.spawn(compiler_so + cc_args + [src, '-o', obj] +
                       extra_postargs)
        except DistutilsExecError as msg:
            raise CompileError(msg)

    def create_static_lib(self, objects, output_libname,
                          output_dir=None, debug=0, target_lang=None):
        objects, output_dir = self._fix_object_args(objects, output_dir)

        output_filename = \
            self.library_filename(output_libname, output_dir=output_dir)

        if self._need_link(objects, output_filename):
            self.mkpath(os.path.dirname(output_filename))
            self.spawn(self.archiver +
                       [output_filename] +
                       objects + self.objects)

            # Not many Unices required ranlib anymore -- SunOS 4.x is, I
            # think the only major Unix that does.  Maybe we need some
            # platform intelligence here to skip ranlib if it's not
            # needed -- or maybe Python's configure script took care of
            # it for us, hence the check for leading colon.
            if self.ranlib:
                try:
                    self.spawn(self.ranlib + [output_filename])
                except DistutilsExecError as msg:
                    raise LibError(msg)
        else:
            log.debug("skipping %s (up-to-date)", output_filename)

    def link(self, target_desc, objects,
             output_filename, output_dir=None, libraries=None,
             library_dirs=None, runtime_library_dirs=None,
             export_symbols=None, debug=0, extra_preargs=None,
             extra_postargs=None, build_temp=None, target_lang=None):
        objects, output_dir = self._fix_object_args(objects, output_dir)
        fixed_args = self._fix_lib_args(libraries, library_dirs,
                                        runtime_library_dirs)
        libraries, library_dirs, runtime_library_dirs = fixed_args

        lib_opts = gen_lib_options(self, library_dirs, runtime_library_dirs,
                                   libraries)
        if not isinstance(output_dir, (str, type(None))):
            raise TypeError("'output_dir' must be a string or None")
        if output_dir is not None:
            output_filename = os.path.join(output_dir, output_filename)

        if self._need_link(objects, output_filename):
            ld_args = (objects + self.objects +
                       lib_opts + ['-o', output_filename])
            if debug:
                ld_args[:0] = ['-g']
            if extra_preargs:
                ld_args[:0] = extra_preargs
            if extra_postargs:
                ld_args.extend(extra_postargs)
            self.mkpath(os.path.dirname(output_filename))
            try:
                if target_desc == CCompiler.EXECUTABLE:
                    linker = self.linker_exe[:]
                else:
                    linker = self.linker_so[:]
                if target_lang == "c++" and self.compiler_cxx:
                    # skip over environment variable settings if /usr/bin/env
                    # is used to set up the linker's environment.
                    # This is needed on OSX. Note: this assumes that the
                    # normal and C++ compiler have the same environment
                    # settings.
                    i = 0
                    if os.path.basename(linker[0]) == "env":
                        i = 1
                        while '=' in linker[i]:
                            i += 1

                    if os.path.basename(linker[i]) == 'ld_so_aix':
                        # AIX platforms prefix the compiler with the ld_so_aix
                        # script, so we need to adjust our linker index
                        offset = 1
                    else:
                        offset = 0

                    linker[i+offset] = self.compiler_cxx[i]

                if sys.platform == 'darwin':
                    linker = _osx_support.compiler_fixup(linker, ld_args)

                self.spawn(linker + ld_args)
            except DistutilsExecError as msg:
                raise LinkError(msg)
        else:
            log.debug("skipping %s (up-to-date)", output_filename)

    # -- Miscellaneous methods -----------------------------------------
    # These are all used by the 'gen_lib_options() function, in
    # ccompiler.py.

    def library_dir_option(self, dir):
        return "-L" + dir

    def _is_gcc(self, compiler_name):
        return "gcc" in compiler_name or "g++" in compiler_name

    def runtime_library_dir_option(self, dir):
        # XXX Hackish, at the very least.  See Python bug #445902:
        # http://sourceforge.net/tracker/index.php
        #   ?func=detail&aid=445902&group_id=5470&atid=105470
        # Linkers on different platforms need different options to
        # specify that directories need to be added to the list of
        # directories searched for dependencies when a dynamic library
        # is sought.  GCC on GNU systems (Linux, FreeBSD, ...) has to
        # be told to pass the -R option through to the linker, whereas
        # other compilers and gcc on other systems just know this.
        # Other compilers may need something slightly different.  At
        # this time, there's no way to determine this information from
        # the configuration data stored in the Python installation, so
        # we use this hack.
        compiler = os.path.basename(sysconfig.get_config_var("CC"))
        if sys.platform[:6] == "darwin":
            # MacOSX's linker doesn't understand the -R flag at all
            return "-L" + dir
        elif sys.platform[:7] == "freebsd":
            return "-Wl,-rpath=" + dir
        elif sys.platform[:5] == "hp-ux":
            if self._is_gcc(compiler):
                return ["-Wl,+s", "-L" + dir]
            return ["+s", "-L" + dir]
        else:
            if self._is_gcc(compiler):
                # gcc on non-GNU systems does not need -Wl, but can
                # use it anyway.  Since distutils has always passed in
                # -Wl whenever gcc was used in the past it is probably
                # safest to keep doing so.
                if sysconfig.get_config_var("GNULD") == "yes":
                    # GNU ld needs an extra option to get a RUNPATH
                    # instead of just an RPATH.
                    return "-Wl,--enable-new-dtags,-R" + dir
                else:
                    return "-Wl,-R" + dir
            else:
                # No idea how --enable-new-dtags would be passed on to
                # ld if this system was using GNU ld.  Don't know if a
                # system like this even exists.
                return "-R" + dir

    def library_option(self, lib):
        return "-l" + lib

    def find_library_file(self, dirs, lib, debug=0):
        shared_f = self.library_filename(lib, lib_type='shared')
        dylib_f = self.library_filename(lib, lib_type='dylib')
        xcode_stub_f = self.library_filename(lib, lib_type='xcode_stub')
        static_f = self.library_filename(lib, lib_type='static')

        if sys.platform == 'darwin':
            # On OSX users can specify an alternate SDK using
            # '-isysroot', calculate the SDK root if it is specified
            # (and use it further on)
            #
            # Note that, as of Xcode 7, Apple SDKs may contain textual stub
            # libraries with .tbd extensions rather than the normal .dylib
            # shared libraries installed in /.  The Apple compiler tool
            # chain handles this transparently but it can cause problems
            # for programs that are being built with an SDK and searching
            # for specific libraries.  Callers of find_library_file need to
            # keep in mind that the base filename of the returned SDK library
            # file might have a different extension from that of the library
            # file installed on the running system, for example:
            #   /Applications/Xcode.app/Contents/Developer/Platforms/
            #       MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/
            #       usr/lib/libedit.tbd
            # vs
            #   /usr/lib/libedit.dylib
            cflags = sysconfig.get_config_var('CFLAGS')
            m = re.search(r'-isysroot\s*(\S+)', cflags)
            if m is None:
                sysroot = _osx_support._default_sysroot(sysconfig.get_config_var('CC'))
            else:
                sysroot = m.group(1)



        for dir in dirs:
            shared = os.path.join(dir, shared_f)
            dylib = os.path.join(dir, dylib_f)
            static = os.path.join(dir, static_f)
            xcode_stub = os.path.join(dir, xcode_stub_f)

            if sys.platform == 'darwin' and (
                dir.startswith('/System/') or (
                dir.startswith('/usr/') and not dir.startswith('/usr/local/'))):

                shared = os.path.join(sysroot, dir[1:], shared_f)
                dylib = os.path.join(sysroot, dir[1:], dylib_f)
                static = os.path.join(sysroot, dir[1:], static_f)
                xcode_stub = os.path.join(sysroot, dir[1:], xcode_stub_f)

            # We're second-guessing the linker here, with not much hard
            # data to go on: GCC seems to prefer the shared library, so I'm
            # assuming that *all* Unix C compilers do.  And of course I'm
            # ignoring even GCC's "-static" option.  So sue me.
            if os.path.exists(dylib):
                return dylib
            elif os.path.exists(xcode_stub):
                return xcode_stub
            elif os.path.exists(shared):
                return shared
            elif os.path.exists(static):
                return static

        # Oops, didn't find it in *any* of 'dirs'
        return None
distutils/errors.py000064400000006771151153537450010502 0ustar00"""distutils.errors

Provides exceptions used by the Distutils modules.  Note that Distutils
modules may raise standard exceptions; in particular, SystemExit is
usually raised for errors that are obviously the end-user's fault
(eg. bad command-line arguments).

This module is safe to use in "from ... import *" mode; it only exports
symbols whose names start with "Distutils" and end with "Error"."""

class DistutilsError (Exception):
    """The root of all Distutils evil."""
    pass

class DistutilsModuleError (DistutilsError):
    """Unable to load an expected module, or to find an expected class
    within some module (in particular, command modules and classes)."""
    pass

class DistutilsClassError (DistutilsError):
    """Some command class (or possibly distribution class, if anyone
    feels a need to subclass Distribution) is found not to be holding
    up its end of the bargain, ie. implementing some part of the
    "command "interface."""
    pass

class DistutilsGetoptError (DistutilsError):
    """The option table provided to 'fancy_getopt()' is bogus."""
    pass

class DistutilsArgError (DistutilsError):
    """Raised by fancy_getopt in response to getopt.error -- ie. an
    error in the command line usage."""
    pass

class DistutilsFileError (DistutilsError):
    """Any problems in the filesystem: expected file not found, etc.
    Typically this is for problems that we detect before OSError
    could be raised."""
    pass

class DistutilsOptionError (DistutilsError):
    """Syntactic/semantic errors in command options, such as use of
    mutually conflicting options, or inconsistent options,
    badly-spelled values, etc.  No distinction is made between option
    values originating in the setup script, the command line, config
    files, or what-have-you -- but if we *know* something originated in
    the setup script, we'll raise DistutilsSetupError instead."""
    pass

class DistutilsSetupError (DistutilsError):
    """For errors that can be definitely blamed on the setup script,
    such as invalid keyword arguments to 'setup()'."""
    pass

class DistutilsPlatformError (DistutilsError):
    """We don't know how to do something on the current platform (but
    we do know how to do it on some platform) -- eg. trying to compile
    C files on a platform not supported by a CCompiler subclass."""
    pass

class DistutilsExecError (DistutilsError):
    """Any problems executing an external program (such as the C
    compiler, when compiling C files)."""
    pass

class DistutilsInternalError (DistutilsError):
    """Internal inconsistencies or impossibilities (obviously, this
    should never be seen if the code is working!)."""
    pass

class DistutilsTemplateError (DistutilsError):
    """Syntax error in a file list template."""

class DistutilsByteCompileError(DistutilsError):
    """Byte compile error."""

# Exception classes used by the CCompiler implementation classes
class CCompilerError (Exception):
    """Some compile/link operation failed."""

class PreprocessError (CCompilerError):
    """Failure to preprocess one or more C/C++ files."""

class CompileError (CCompilerError):
    """Failure to compile one or more C/C++ source files."""

class LibError (CCompilerError):
    """Failure to create a static library from one or more C/C++ object
    files."""

class LinkError (CCompilerError):
    """Failure to link one or more C/C++ object files into an executable
    or shared library file."""

class UnknownFileError (CCompilerError):
    """Attempt to process an unknown file type."""
distutils/extension.py000064400000024423151153537450011174 0ustar00"""distutils.extension

Provides the Extension class, used to describe C/C++ extension
modules in setup scripts."""

import os
import warnings

# This class is really only used by the "build_ext" command, so it might
# make sense to put it in distutils.command.build_ext.  However, that
# module is already big enough, and I want to make this class a bit more
# complex to simplify some common cases ("foo" module in "foo.c") and do
# better error-checking ("foo.c" actually exists).
#
# Also, putting this in build_ext.py means every setup script would have to
# import that large-ish module (indirectly, through distutils.core) in
# order to do anything.

class Extension:
    """Just a collection of attributes that describes an extension
    module and everything needed to build it (hopefully in a portable
    way, but there are hooks that let you be as unportable as you need).

    Instance attributes:
      name : string
        the full name of the extension, including any packages -- ie.
        *not* a filename or pathname, but Python dotted name
      sources : [string]
        list of source filenames, relative to the distribution root
        (where the setup script lives), in Unix form (slash-separated)
        for portability.  Source files may be C, C++, SWIG (.i),
        platform-specific resource files, or whatever else is recognized
        by the "build_ext" command as source for a Python extension.
      include_dirs : [string]
        list of directories to search for C/C++ header files (in Unix
        form for portability)
      define_macros : [(name : string, value : string|None)]
        list of macros to define; each macro is defined using a 2-tuple,
        where 'value' is either the string to define it to or None to
        define it without a particular value (equivalent of "#define
        FOO" in source or -DFOO on Unix C compiler command line)
      undef_macros : [string]
        list of macros to undefine explicitly
      library_dirs : [string]
        list of directories to search for C/C++ libraries at link time
      libraries : [string]
        list of library names (not filenames or paths) to link against
      runtime_library_dirs : [string]
        list of directories to search for C/C++ libraries at run time
        (for shared extensions, this is when the extension is loaded)
      extra_objects : [string]
        list of extra files to link with (eg. object files not implied
        by 'sources', static library that must be explicitly specified,
        binary resource files, etc.)
      extra_compile_args : [string]
        any extra platform- and compiler-specific information to use
        when compiling the source files in 'sources'.  For platforms and
        compilers where "command line" makes sense, this is typically a
        list of command-line arguments, but for other platforms it could
        be anything.
      extra_link_args : [string]
        any extra platform- and compiler-specific information to use
        when linking object files together to create the extension (or
        to create a new static Python interpreter).  Similar
        interpretation as for 'extra_compile_args'.
      export_symbols : [string]
        list of symbols to be exported from a shared extension.  Not
        used on all platforms, and not generally necessary for Python
        extensions, which typically export exactly one symbol: "init" +
        extension_name.
      swig_opts : [string]
        any extra options to pass to SWIG if a source file has the .i
        extension.
      depends : [string]
        list of files that the extension depends on
      language : string
        extension language (i.e. "c", "c++", "objc"). Will be detected
        from the source extensions if not provided.
      optional : boolean
        specifies that a build failure in the extension should not abort the
        build process, but simply not install the failing extension.
    """

    # When adding arguments to this constructor, be sure to update
    # setup_keywords in core.py.
    def __init__(self, name, sources,
                  include_dirs=None,
                  define_macros=None,
                  undef_macros=None,
                  library_dirs=None,
                  libraries=None,
                  runtime_library_dirs=None,
                  extra_objects=None,
                  extra_compile_args=None,
                  extra_link_args=None,
                  export_symbols=None,
                  swig_opts = None,
                  depends=None,
                  language=None,
                  optional=None,
                  **kw                      # To catch unknown keywords
                 ):
        if not isinstance(name, str):
            raise AssertionError("'name' must be a string")
        if not (isinstance(sources, list) and
                all(isinstance(v, str) for v in sources)):
            raise AssertionError("'sources' must be a list of strings")

        self.name = name
        self.sources = sources
        self.include_dirs = include_dirs or []
        self.define_macros = define_macros or []
        self.undef_macros = undef_macros or []
        self.library_dirs = library_dirs or []
        self.libraries = libraries or []
        self.runtime_library_dirs = runtime_library_dirs or []
        self.extra_objects = extra_objects or []
        self.extra_compile_args = extra_compile_args or []
        self.extra_link_args = extra_link_args or []
        self.export_symbols = export_symbols or []
        self.swig_opts = swig_opts or []
        self.depends = depends or []
        self.language = language
        self.optional = optional

        # If there are unknown keyword options, warn about them
        if len(kw) > 0:
            options = [repr(option) for option in kw]
            options = ', '.join(sorted(options))
            msg = "Unknown Extension options: %s" % options
            warnings.warn(msg)

    def __repr__(self):
        return '<%s.%s(%r) at %#x>' % (
            self.__class__.__module__,
            self.__class__.__qualname__,
            self.name,
            id(self))


def read_setup_file(filename):
    """Reads a Setup file and returns Extension instances."""
    from distutils.sysconfig import (parse_makefile, expand_makefile_vars,
                                     _variable_rx)

    from distutils.text_file import TextFile
    from distutils.util import split_quoted

    # First pass over the file to gather "VAR = VALUE" assignments.
    vars = parse_makefile(filename)

    # Second pass to gobble up the real content: lines of the form
    #   <module> ... [<sourcefile> ...] [<cpparg> ...] [<library> ...]
    file = TextFile(filename,
                    strip_comments=1, skip_blanks=1, join_lines=1,
                    lstrip_ws=1, rstrip_ws=1)
    try:
        extensions = []

        while True:
            line = file.readline()
            if line is None:                # eof
                break
            if _variable_rx.match(line):    # VAR=VALUE, handled in first pass
                continue

            if line[0] == line[-1] == "*":
                file.warn("'%s' lines not handled yet" % line)
                continue

            line = expand_makefile_vars(line, vars)
            words = split_quoted(line)

            # NB. this parses a slightly different syntax than the old
            # makesetup script: here, there must be exactly one extension per
            # line, and it must be the first word of the line.  I have no idea
            # why the old syntax supported multiple extensions per line, as
            # they all wind up being the same.

            module = words[0]
            ext = Extension(module, [])
            append_next_word = None

            for word in words[1:]:
                if append_next_word is not None:
                    append_next_word.append(word)
                    append_next_word = None
                    continue

                suffix = os.path.splitext(word)[1]
                switch = word[0:2] ; value = word[2:]

                if suffix in (".c", ".cc", ".cpp", ".cxx", ".c++", ".m", ".mm"):
                    # hmm, should we do something about C vs. C++ sources?
                    # or leave it up to the CCompiler implementation to
                    # worry about?
                    ext.sources.append(word)
                elif switch == "-I":
                    ext.include_dirs.append(value)
                elif switch == "-D":
                    equals = value.find("=")
                    if equals == -1:        # bare "-DFOO" -- no value
                        ext.define_macros.append((value, None))
                    else:                   # "-DFOO=blah"
                        ext.define_macros.append((value[0:equals],
                                                  value[equals+2:]))
                elif switch == "-U":
                    ext.undef_macros.append(value)
                elif switch == "-C":        # only here 'cause makesetup has it!
                    ext.extra_compile_args.append(word)
                elif switch == "-l":
                    ext.libraries.append(value)
                elif switch == "-L":
                    ext.library_dirs.append(value)
                elif switch == "-R":
                    ext.runtime_library_dirs.append(value)
                elif word == "-rpath":
                    append_next_word = ext.runtime_library_dirs
                elif word == "-Xlinker":
                    append_next_word = ext.extra_link_args
                elif word == "-Xcompiler":
                    append_next_word = ext.extra_compile_args
                elif switch == "-u":
                    ext.extra_link_args.append(word)
                    if not value:
                        append_next_word = ext.extra_link_args
                elif suffix in (".a", ".so", ".sl", ".o", ".dylib"):
                    # NB. a really faithful emulation of makesetup would
                    # append a .o file to extra_objects only if it
                    # had a slash in it; otherwise, it would s/.o/.c/
                    # and append it to sources.  Hmmmm.
                    ext.extra_objects.append(word)
                else:
                    file.warn("unrecognized argument '%s'" % word)

            extensions.append(ext)
    finally:
        file.close()

    return extensions
distutils/_msvccompiler.py000064400000047122151153537450012023 0ustar00"""distutils._msvccompiler

Contains MSVCCompiler, an implementation of the abstract CCompiler class
for Microsoft Visual Studio 2015.

The module is compatible with VS 2015 and later. You can find legacy support
for older versions in distutils.msvc9compiler and distutils.msvccompiler.
"""

# Written by Perry Stoll
# hacked by Robin Becker and Thomas Heller to do a better job of
#   finding DevStudio (through the registry)
# ported to VS 2005 and VS 2008 by Christian Heimes
# ported to VS 2015 by Steve Dower

import os
import shutil
import stat
import subprocess
import winreg

from distutils.errors import DistutilsExecError, DistutilsPlatformError, \
                             CompileError, LibError, LinkError
from distutils.ccompiler import CCompiler, gen_lib_options
from distutils import log
from distutils.util import get_platform

from itertools import count

def _find_vc2015():
    try:
        key = winreg.OpenKeyEx(
            winreg.HKEY_LOCAL_MACHINE,
            r"Software\Microsoft\VisualStudio\SxS\VC7",
            access=winreg.KEY_READ | winreg.KEY_WOW64_32KEY
        )
    except OSError:
        log.debug("Visual C++ is not registered")
        return None, None

    best_version = 0
    best_dir = None
    with key:
        for i in count():
            try:
                v, vc_dir, vt = winreg.EnumValue(key, i)
            except OSError:
                break
            if v and vt == winreg.REG_SZ and os.path.isdir(vc_dir):
                try:
                    version = int(float(v))
                except (ValueError, TypeError):
                    continue
                if version >= 14 and version > best_version:
                    best_version, best_dir = version, vc_dir
    return best_version, best_dir

def _find_vc2017():
    """Returns "15, path" based on the result of invoking vswhere.exe
    If no install is found, returns "None, None"

    The version is returned to avoid unnecessarily changing the function
    result. It may be ignored when the path is not None.

    If vswhere.exe is not available, by definition, VS 2017 is not
    installed.
    """
    import json

    root = os.environ.get("ProgramFiles(x86)") or os.environ.get("ProgramFiles")
    if not root:
        return None, None

    try:
        path = subprocess.check_output([
            os.path.join(root, "Microsoft Visual Studio", "Installer", "vswhere.exe"),
            "-latest",
            "-prerelease",
            "-requires", "Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
            "-property", "installationPath",
            "-products", "*",
        ], encoding="mbcs", errors="strict").strip()
    except (subprocess.CalledProcessError, OSError, UnicodeDecodeError):
        return None, None

    path = os.path.join(path, "VC", "Auxiliary", "Build")
    if os.path.isdir(path):
        return 15, path

    return None, None

PLAT_SPEC_TO_RUNTIME = {
    'x86' : 'x86',
    'x86_amd64' : 'x64',
    'x86_arm' : 'arm',
    'x86_arm64' : 'arm64'
}

def _find_vcvarsall(plat_spec):
    # bpo-38597: Removed vcruntime return value
    _, best_dir = _find_vc2017()

    if not best_dir:
        best_version, best_dir = _find_vc2015()

    if not best_dir:
        log.debug("No suitable Visual C++ version found")
        return None, None

    vcvarsall = os.path.join(best_dir, "vcvarsall.bat")
    if not os.path.isfile(vcvarsall):
        log.debug("%s cannot be found", vcvarsall)
        return None, None

    return vcvarsall, None

def _get_vc_env(plat_spec):
    if os.getenv("DISTUTILS_USE_SDK"):
        return {
            key.lower(): value
            for key, value in os.environ.items()
        }

    vcvarsall, _ = _find_vcvarsall(plat_spec)
    if not vcvarsall:
        raise DistutilsPlatformError("Unable to find vcvarsall.bat")

    try:
        out = subprocess.check_output(
            'cmd /u /c "{}" {} && set'.format(vcvarsall, plat_spec),
            stderr=subprocess.STDOUT,
        ).decode('utf-16le', errors='replace')
    except subprocess.CalledProcessError as exc:
        log.error(exc.output)
        raise DistutilsPlatformError("Error executing {}"
                .format(exc.cmd))

    env = {
        key.lower(): value
        for key, _, value in
        (line.partition('=') for line in out.splitlines())
        if key and value
    }

    return env

def _find_exe(exe, paths=None):
    """Return path to an MSVC executable program.

    Tries to find the program in several places: first, one of the
    MSVC program search paths from the registry; next, the directories
    in the PATH environment variable.  If any of those work, return an
    absolute path that is known to exist.  If none of them work, just
    return the original program name, 'exe'.
    """
    if not paths:
        paths = os.getenv('path').split(os.pathsep)
    for p in paths:
        fn = os.path.join(os.path.abspath(p), exe)
        if os.path.isfile(fn):
            return fn
    return exe

# A map keyed by get_platform() return values to values accepted by
# 'vcvarsall.bat'. Always cross-compile from x86 to work with the
# lighter-weight MSVC installs that do not include native 64-bit tools.
PLAT_TO_VCVARS = {
    'win32' : 'x86',
    'win-amd64' : 'x86_amd64',
    'win-arm32' : 'x86_arm',
    'win-arm64' : 'x86_arm64'
}

class MSVCCompiler(CCompiler) :
    """Concrete class that implements an interface to Microsoft Visual C++,
       as defined by the CCompiler abstract class."""

    compiler_type = 'msvc'

    # Just set this so CCompiler's constructor doesn't barf.  We currently
    # don't use the 'set_executables()' bureaucracy provided by CCompiler,
    # as it really isn't necessary for this sort of single-compiler class.
    # Would be nice to have a consistent interface with UnixCCompiler,
    # though, so it's worth thinking about.
    executables = {}

    # Private class data (need to distinguish C from C++ source for compiler)
    _c_extensions = ['.c']
    _cpp_extensions = ['.cc', '.cpp', '.cxx']
    _rc_extensions = ['.rc']
    _mc_extensions = ['.mc']

    # Needed for the filename generation methods provided by the
    # base class, CCompiler.
    src_extensions = (_c_extensions + _cpp_extensions +
                      _rc_extensions + _mc_extensions)
    res_extension = '.res'
    obj_extension = '.obj'
    static_lib_extension = '.lib'
    shared_lib_extension = '.dll'
    static_lib_format = shared_lib_format = '%s%s'
    exe_extension = '.exe'


    def __init__(self, verbose=0, dry_run=0, force=0):
        CCompiler.__init__ (self, verbose, dry_run, force)
        # target platform (.plat_name is consistent with 'bdist')
        self.plat_name = None
        self.initialized = False

    def initialize(self, plat_name=None):
        # multi-init means we would need to check platform same each time...
        assert not self.initialized, "don't init multiple times"
        if plat_name is None:
            plat_name = get_platform()
        # sanity check for platforms to prevent obscure errors later.
        if plat_name not in PLAT_TO_VCVARS:
            raise DistutilsPlatformError("--plat-name must be one of {}"
                                         .format(tuple(PLAT_TO_VCVARS)))

        # Get the vcvarsall.bat spec for the requested platform.
        plat_spec = PLAT_TO_VCVARS[plat_name]

        vc_env = _get_vc_env(plat_spec)
        if not vc_env:
            raise DistutilsPlatformError("Unable to find a compatible "
                "Visual Studio installation.")

        self._paths = vc_env.get('path', '')
        paths = self._paths.split(os.pathsep)
        self.cc = _find_exe("cl.exe", paths)
        self.linker = _find_exe("link.exe", paths)
        self.lib = _find_exe("lib.exe", paths)
        self.rc = _find_exe("rc.exe", paths)   # resource compiler
        self.mc = _find_exe("mc.exe", paths)   # message compiler
        self.mt = _find_exe("mt.exe", paths)   # message compiler

        for dir in vc_env.get('include', '').split(os.pathsep):
            if dir:
                self.add_include_dir(dir.rstrip(os.sep))

        for dir in vc_env.get('lib', '').split(os.pathsep):
            if dir:
                self.add_library_dir(dir.rstrip(os.sep))

        self.preprocess_options = None
        # bpo-38597: Always compile with dynamic linking
        # Future releases of Python 3.x will include all past
        # versions of vcruntime*.dll for compatibility.
        self.compile_options = [
            '/nologo', '/Ox', '/W3', '/GL', '/DNDEBUG', '/MD'
        ]

        self.compile_options_debug = [
            '/nologo', '/Od', '/MDd', '/Zi', '/W3', '/D_DEBUG'
        ]

        ldflags = [
            '/nologo', '/INCREMENTAL:NO', '/LTCG'
        ]

        ldflags_debug = [
            '/nologo', '/INCREMENTAL:NO', '/LTCG', '/DEBUG:FULL'
        ]

        self.ldflags_exe = [*ldflags, '/MANIFEST:EMBED,ID=1']
        self.ldflags_exe_debug = [*ldflags_debug, '/MANIFEST:EMBED,ID=1']
        self.ldflags_shared = [*ldflags, '/DLL', '/MANIFEST:EMBED,ID=2', '/MANIFESTUAC:NO']
        self.ldflags_shared_debug = [*ldflags_debug, '/DLL', '/MANIFEST:EMBED,ID=2', '/MANIFESTUAC:NO']
        self.ldflags_static = [*ldflags]
        self.ldflags_static_debug = [*ldflags_debug]

        self._ldflags = {
            (CCompiler.EXECUTABLE, None): self.ldflags_exe,
            (CCompiler.EXECUTABLE, False): self.ldflags_exe,
            (CCompiler.EXECUTABLE, True): self.ldflags_exe_debug,
            (CCompiler.SHARED_OBJECT, None): self.ldflags_shared,
            (CCompiler.SHARED_OBJECT, False): self.ldflags_shared,
            (CCompiler.SHARED_OBJECT, True): self.ldflags_shared_debug,
            (CCompiler.SHARED_LIBRARY, None): self.ldflags_static,
            (CCompiler.SHARED_LIBRARY, False): self.ldflags_static,
            (CCompiler.SHARED_LIBRARY, True): self.ldflags_static_debug,
        }

        self.initialized = True

    # -- Worker methods ------------------------------------------------

    def object_filenames(self,
                         source_filenames,
                         strip_dir=0,
                         output_dir=''):
        ext_map = {
            **{ext: self.obj_extension for ext in self.src_extensions},
            **{ext: self.res_extension for ext in self._rc_extensions + self._mc_extensions},
        }

        output_dir = output_dir or ''

        def make_out_path(p):
            base, ext = os.path.splitext(p)
            if strip_dir:
                base = os.path.basename(base)
            else:
                _, base = os.path.splitdrive(base)
                if base.startswith((os.path.sep, os.path.altsep)):
                    base = base[1:]
            try:
                # XXX: This may produce absurdly long paths. We should check
                # the length of the result and trim base until we fit within
                # 260 characters.
                return os.path.join(output_dir, base + ext_map[ext])
            except LookupError:
                # Better to raise an exception instead of silently continuing
                # and later complain about sources and targets having
                # different lengths
                raise CompileError("Don't know how to compile {}".format(p))

        return list(map(make_out_path, source_filenames))


    def compile(self, sources,
                output_dir=None, macros=None, include_dirs=None, debug=0,
                extra_preargs=None, extra_postargs=None, depends=None):

        if not self.initialized:
            self.initialize()
        compile_info = self._setup_compile(output_dir, macros, include_dirs,
                                           sources, depends, extra_postargs)
        macros, objects, extra_postargs, pp_opts, build = compile_info

        compile_opts = extra_preargs or []
        compile_opts.append('/c')
        if debug:
            compile_opts.extend(self.compile_options_debug)
        else:
            compile_opts.extend(self.compile_options)


        add_cpp_opts = False

        for obj in objects:
            try:
                src, ext = build[obj]
            except KeyError:
                continue
            if debug:
                # pass the full pathname to MSVC in debug mode,
                # this allows the debugger to find the source file
                # without asking the user to browse for it
                src = os.path.abspath(src)

            if ext in self._c_extensions:
                input_opt = "/Tc" + src
            elif ext in self._cpp_extensions:
                input_opt = "/Tp" + src
                add_cpp_opts = True
            elif ext in self._rc_extensions:
                # compile .RC to .RES file
                input_opt = src
                output_opt = "/fo" + obj
                try:
                    self.spawn([self.rc] + pp_opts + [output_opt, input_opt])
                except DistutilsExecError as msg:
                    raise CompileError(msg)
                continue
            elif ext in self._mc_extensions:
                # Compile .MC to .RC file to .RES file.
                #   * '-h dir' specifies the directory for the
                #     generated include file
                #   * '-r dir' specifies the target directory of the
                #     generated RC file and the binary message resource
                #     it includes
                #
                # For now (since there are no options to change this),
                # we use the source-directory for the include file and
                # the build directory for the RC file and message
                # resources. This works at least for win32all.
                h_dir = os.path.dirname(src)
                rc_dir = os.path.dirname(obj)
                try:
                    # first compile .MC to .RC and .H file
                    self.spawn([self.mc, '-h', h_dir, '-r', rc_dir, src])
                    base, _ = os.path.splitext(os.path.basename (src))
                    rc_file = os.path.join(rc_dir, base + '.rc')
                    # then compile .RC to .RES file
                    self.spawn([self.rc, "/fo" + obj, rc_file])

                except DistutilsExecError as msg:
                    raise CompileError(msg)
                continue
            else:
                # how to handle this file?
                raise CompileError("Don't know how to compile {} to {}"
                                   .format(src, obj))

            args = [self.cc] + compile_opts + pp_opts
            if add_cpp_opts:
                args.append('/EHsc')
            args.append(input_opt)
            args.append("/Fo" + obj)
            args.extend(extra_postargs)

            try:
                self.spawn(args)
            except DistutilsExecError as msg:
                raise CompileError(msg)

        return objects


    def create_static_lib(self,
                          objects,
                          output_libname,
                          output_dir=None,
                          debug=0,
                          target_lang=None):

        if not self.initialized:
            self.initialize()
        objects, output_dir = self._fix_object_args(objects, output_dir)
        output_filename = self.library_filename(output_libname,
                                                output_dir=output_dir)

        if self._need_link(objects, output_filename):
            lib_args = objects + ['/OUT:' + output_filename]
            if debug:
                pass # XXX what goes here?
            try:
                log.debug('Executing "%s" %s', self.lib, ' '.join(lib_args))
                self.spawn([self.lib] + lib_args)
            except DistutilsExecError as msg:
                raise LibError(msg)
        else:
            log.debug("skipping %s (up-to-date)", output_filename)


    def link(self,
             target_desc,
             objects,
             output_filename,
             output_dir=None,
             libraries=None,
             library_dirs=None,
             runtime_library_dirs=None,
             export_symbols=None,
             debug=0,
             extra_preargs=None,
             extra_postargs=None,
             build_temp=None,
             target_lang=None):

        if not self.initialized:
            self.initialize()
        objects, output_dir = self._fix_object_args(objects, output_dir)
        fixed_args = self._fix_lib_args(libraries, library_dirs,
                                        runtime_library_dirs)
        libraries, library_dirs, runtime_library_dirs = fixed_args

        if runtime_library_dirs:
            self.warn("I don't know what to do with 'runtime_library_dirs': "
                       + str(runtime_library_dirs))

        lib_opts = gen_lib_options(self,
                                   library_dirs, runtime_library_dirs,
                                   libraries)
        if output_dir is not None:
            output_filename = os.path.join(output_dir, output_filename)

        if self._need_link(objects, output_filename):
            ldflags = self._ldflags[target_desc, debug]

            export_opts = ["/EXPORT:" + sym for sym in (export_symbols or [])]

            ld_args = (ldflags + lib_opts + export_opts +
                       objects + ['/OUT:' + output_filename])

            # The MSVC linker generates .lib and .exp files, which cannot be
            # suppressed by any linker switches. The .lib files may even be
            # needed! Make sure they are generated in the temporary build
            # directory. Since they have different names for debug and release
            # builds, they can go into the same directory.
            build_temp = os.path.dirname(objects[0])
            if export_symbols is not None:
                (dll_name, dll_ext) = os.path.splitext(
                    os.path.basename(output_filename))
                implib_file = os.path.join(
                    build_temp,
                    self.library_filename(dll_name))
                ld_args.append ('/IMPLIB:' + implib_file)

            if extra_preargs:
                ld_args[:0] = extra_preargs
            if extra_postargs:
                ld_args.extend(extra_postargs)

            output_dir = os.path.dirname(os.path.abspath(output_filename))
            self.mkpath(output_dir)
            try:
                log.debug('Executing "%s" %s', self.linker, ' '.join(ld_args))
                self.spawn([self.linker] + ld_args)
            except DistutilsExecError as msg:
                raise LinkError(msg)
        else:
            log.debug("skipping %s (up-to-date)", output_filename)

    def spawn(self, cmd):
        old_path = os.getenv('path')
        try:
            os.environ['path'] = self._paths
            return super().spawn(cmd)
        finally:
            os.environ['path'] = old_path

    # -- Miscellaneous methods -----------------------------------------
    # These are all used by the 'gen_lib_options() function, in
    # ccompiler.py.

    def library_dir_option(self, dir):
        return "/LIBPATH:" + dir

    def runtime_library_dir_option(self, dir):
        raise DistutilsPlatformError(
              "don't know how to set runtime library search path for MSVC")

    def library_option(self, lib):
        return self.library_filename(lib)

    def find_library_file(self, dirs, lib, debug=0):
        # Prefer a debugging library if found (and requested), but deal
        # with it if we don't have one.
        if debug:
            try_names = [lib + "_d", lib]
        else:
            try_names = [lib]
        for dir in dirs:
            for name in try_names:
                libfile = os.path.join(dir, self.library_filename(name))
                if os.path.isfile(libfile):
                    return libfile
        else:
            # Oops, didn't find it in *any* of 'dirs'
            return None
distutils/README000064400000000362151153537450007462 0ustar00This directory contains the Distutils package.

There's a full documentation available at:

    http://docs.python.org/distutils/

The Distutils-SIG web page is also a good starting point:

    http://www.python.org/sigs/distutils-sig/

$Id$
distutils/sysconfig.py000064400000050021151153537450011155 0ustar00"""Provide access to Python's configuration information.  The specific
configuration variables available depend heavily on the platform and
configuration.  The values may be retrieved using
get_config_var(name), and the list of variables is available via
get_config_vars().keys().  Additional convenience functions are also
available.

Written by:   Fred L. Drake, Jr.
Email:        <fdrake@acm.org>
"""

import _imp
import os
import re
import sys

from .errors import DistutilsPlatformError
from .util import get_platform, get_host_platform

# These are needed in a couple of spots, so just compute them once.
PREFIX = os.path.normpath(sys.prefix)
EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
BASE_PREFIX = os.path.normpath(sys.base_prefix)
BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix)

# Path to the base directory of the project. On Windows the binary may
# live in project/PCbuild/win32 or project/PCbuild/amd64.
# set for cross builds
if "_PYTHON_PROJECT_BASE" in os.environ:
    project_base = os.path.abspath(os.environ["_PYTHON_PROJECT_BASE"])
else:
    if sys.executable:
        project_base = os.path.dirname(os.path.abspath(sys.executable))
    else:
        # sys.executable can be empty if argv[0] has been changed and Python is
        # unable to retrieve the real program name
        project_base = os.getcwd()


# python_build: (Boolean) if true, we're either building Python or
# building an extension with an un-installed Python, so we use
# different (hard-wired) directories.
def _is_python_source_dir(d):
    for fn in ("Setup", "Setup.local"):
        if os.path.isfile(os.path.join(d, "Modules", fn)):
            return True
    return False

_sys_home = getattr(sys, '_home', None)

if os.name == 'nt':
    def _fix_pcbuild(d):
        if d and os.path.normcase(d).startswith(
                os.path.normcase(os.path.join(PREFIX, "PCbuild"))):
            return PREFIX
        return d
    project_base = _fix_pcbuild(project_base)
    _sys_home = _fix_pcbuild(_sys_home)

def _python_build():
    if _sys_home:
        return _is_python_source_dir(_sys_home)
    return _is_python_source_dir(project_base)

python_build = _python_build()


# Calculate the build qualifier flags if they are defined.  Adding the flags
# to the include and lib directories only makes sense for an installation, not
# an in-source build.
build_flags = ''
try:
    if not python_build:
        build_flags = sys.abiflags
except AttributeError:
    # It's not a configure-based build, so the sys module doesn't have
    # this attribute, which is fine.
    pass

def get_python_version():
    """Return a string containing the major and minor Python version,
    leaving off the patchlevel.  Sample return values could be '1.5'
    or '2.2'.
    """
    return '%d.%d' % sys.version_info[:2]


def get_python_inc(plat_specific=0, prefix=None):
    """Return the directory containing installed Python header files.

    If 'plat_specific' is false (the default), this is the path to the
    non-platform-specific header files, i.e. Python.h and so on;
    otherwise, this is the path to platform-specific header files
    (namely pyconfig.h).

    If 'prefix' is supplied, use it instead of sys.base_prefix or
    sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
    """
    if prefix is None:
        prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
    if os.name == "posix":
        if python_build:
            # Assume the executable is in the build directory.  The
            # pyconfig.h file should be in the same directory.  Since
            # the build directory may not be the source directory, we
            # must use "srcdir" from the makefile to find the "Include"
            # directory.
            if plat_specific:
                return _sys_home or project_base
            else:
                incdir = os.path.join(get_config_var('srcdir'), 'Include')
                return os.path.normpath(incdir)
        python_dir = 'python' + get_python_version() + build_flags
        return os.path.join(prefix, "include", python_dir)
    elif os.name == "nt":
        if python_build:
            # Include both the include and PC dir to ensure we can find
            # pyconfig.h
            return (os.path.join(prefix, "include") + os.path.pathsep +
                    os.path.join(prefix, "PC"))
        return os.path.join(prefix, "include")
    else:
        raise DistutilsPlatformError(
            "I don't know where Python installs its C header files "
            "on platform '%s'" % os.name)


def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
    """Return the directory containing the Python library (standard or
    site additions).

    If 'plat_specific' is true, return the directory containing
    platform-specific modules, i.e. any module from a non-pure-Python
    module distribution; otherwise, return the platform-shared library
    directory.  If 'standard_lib' is true, return the directory
    containing standard Python library modules; otherwise, return the
    directory for site-specific modules.

    If 'prefix' is supplied, use it instead of sys.base_prefix or
    sys.base_exec_prefix -- i.e., ignore 'plat_specific'.
    """
    if prefix is None:
        if standard_lib:
            prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX
        else:
            prefix = plat_specific and EXEC_PREFIX or PREFIX

    if os.name == "posix":
        if plat_specific or standard_lib:
            lib = "lib64"
        else:
            lib = "lib"
        libpython = os.path.join(prefix,
                                 lib, "python" + get_python_version())
        if standard_lib:
            return libpython
        else:
            return os.path.join(libpython, "site-packages")
    elif os.name == "nt":
        if standard_lib:
            return os.path.join(prefix, "Lib")
        else:
            return os.path.join(prefix, "Lib", "site-packages")
    else:
        raise DistutilsPlatformError(
            "I don't know where Python installs its library "
            "on platform '%s'" % os.name)



def customize_compiler(compiler):
    """Do any platform-specific customization of a CCompiler instance.

    Mainly needed on Unix, so we can plug in the information that
    varies across Unices and is stored in Python's Makefile.
    """
    if compiler.compiler_type == "unix":
        if sys.platform == "darwin":
            # Perform first-time customization of compiler-related
            # config vars on OS X now that we know we need a compiler.
            # This is primarily to support Pythons from binary
            # installers.  The kind and paths to build tools on
            # the user system may vary significantly from the system
            # that Python itself was built on.  Also the user OS
            # version and build tools may not support the same set
            # of CPU architectures for universal builds.
            global _config_vars
            # Use get_config_var() to ensure _config_vars is initialized.
            if not get_config_var('CUSTOMIZED_OSX_COMPILER'):
                import _osx_support
                _osx_support.customize_compiler(_config_vars)
                _config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True'

        (cc, cxx, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags) = \
            get_config_vars('CC', 'CXX', 'CFLAGS',
                            'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS')

        if 'CC' in os.environ:
            newcc = os.environ['CC']
            if (sys.platform == 'darwin'
                    and 'LDSHARED' not in os.environ
                    and ldshared.startswith(cc)):
                # On OS X, if CC is overridden, use that as the default
                #       command for LDSHARED as well
                ldshared = newcc + ldshared[len(cc):]
            cc = newcc
        if 'CXX' in os.environ:
            cxx = os.environ['CXX']
        if 'LDSHARED' in os.environ:
            ldshared = os.environ['LDSHARED']
        if 'CPP' in os.environ:
            cpp = os.environ['CPP']
        else:
            cpp = cc + " -E"           # not always
        if 'LDFLAGS' in os.environ:
            ldshared = ldshared + ' ' + os.environ['LDFLAGS']
        if 'CFLAGS' in os.environ:
            cflags = cflags + ' ' + os.environ['CFLAGS']
            ldshared = ldshared + ' ' + os.environ['CFLAGS']
        if 'CPPFLAGS' in os.environ:
            cpp = cpp + ' ' + os.environ['CPPFLAGS']
            cflags = cflags + ' ' + os.environ['CPPFLAGS']
            ldshared = ldshared + ' ' + os.environ['CPPFLAGS']
        if 'AR' in os.environ:
            ar = os.environ['AR']
        if 'ARFLAGS' in os.environ:
            archiver = ar + ' ' + os.environ['ARFLAGS']
        else:
            archiver = ar + ' ' + ar_flags

        cc_cmd = cc + ' ' + cflags
        compiler.set_executables(
            preprocessor=cpp,
            compiler=cc_cmd,
            compiler_so=cc_cmd + ' ' + ccshared,
            compiler_cxx=cxx,
            linker_so=ldshared,
            linker_exe=cc,
            archiver=archiver)

        compiler.shared_lib_extension = shlib_suffix


def get_config_h_filename():
    """Return full pathname of installed pyconfig.h file."""
    if python_build:
        if os.name == "nt":
            inc_dir = os.path.join(_sys_home or project_base, "PC")
        else:
            inc_dir = _sys_home or project_base
    else:
        inc_dir = get_python_inc(plat_specific=1)

    return os.path.join(inc_dir, 'pyconfig-64.h')


def get_makefile_filename():
    """Return full pathname of installed Makefile from the Python build."""
    if python_build:
        return os.path.join(_sys_home or project_base, "Makefile")
    lib_dir = get_python_lib(plat_specific=0, standard_lib=1)
    config_file = 'config-{}{}'.format(get_python_version(), build_flags)
    if hasattr(sys.implementation, '_multiarch'):
        config_file += '-%s' % sys.implementation._multiarch
    return os.path.join(lib_dir, config_file, 'Makefile')


def parse_config_h(fp, g=None):
    """Parse a config.h-style file.

    A dictionary containing name/value pairs is returned.  If an
    optional dictionary is passed in as the second argument, it is
    used instead of a new dictionary.
    """
    if g is None:
        g = {}
    define_rx = re.compile("#define ([A-Z][A-Za-z0-9_]+) (.*)\n")
    undef_rx = re.compile("/[*] #undef ([A-Z][A-Za-z0-9_]+) [*]/\n")
    #
    while True:
        line = fp.readline()
        if not line:
            break
        m = define_rx.match(line)
        if m:
            n, v = m.group(1, 2)
            try: v = int(v)
            except ValueError: pass
            g[n] = v
        else:
            m = undef_rx.match(line)
            if m:
                g[m.group(1)] = 0
    return g


# Regexes needed for parsing Makefile (and similar syntaxes,
# like old-style Setup files).
_variable_rx = re.compile(r"([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)")
_findvar1_rx = re.compile(r"\$\(([A-Za-z][A-Za-z0-9_]*)\)")
_findvar2_rx = re.compile(r"\${([A-Za-z][A-Za-z0-9_]*)}")

def parse_makefile(fn, g=None):
    """Parse a Makefile-style file.

    A dictionary containing name/value pairs is returned.  If an
    optional dictionary is passed in as the second argument, it is
    used instead of a new dictionary.
    """
    from distutils.text_file import TextFile
    fp = TextFile(fn, strip_comments=1, skip_blanks=1, join_lines=1, errors="surrogateescape")

    if g is None:
        g = {}
    done = {}
    notdone = {}

    while True:
        line = fp.readline()
        if line is None: # eof
            break
        m = _variable_rx.match(line)
        if m:
            n, v = m.group(1, 2)
            v = v.strip()
            # `$$' is a literal `$' in make
            tmpv = v.replace('$$', '')

            if "$" in tmpv:
                notdone[n] = v
            else:
                try:
                    v = int(v)
                except ValueError:
                    # insert literal `$'
                    done[n] = v.replace('$$', '$')
                else:
                    done[n] = v

    # Variables with a 'PY_' prefix in the makefile. These need to
    # be made available without that prefix through sysconfig.
    # Special care is needed to ensure that variable expansion works, even
    # if the expansion uses the name without a prefix.
    renamed_variables = ('CFLAGS', 'LDFLAGS', 'CPPFLAGS')

    # do variable interpolation here
    while notdone:
        for name in list(notdone):
            value = notdone[name]
            m = _findvar1_rx.search(value) or _findvar2_rx.search(value)
            if m:
                n = m.group(1)
                found = True
                if n in done:
                    item = str(done[n])
                elif n in notdone:
                    # get it on a subsequent round
                    found = False
                elif n in os.environ:
                    # do it like make: fall back to environment
                    item = os.environ[n]

                elif n in renamed_variables:
                    if name.startswith('PY_') and name[3:] in renamed_variables:
                        item = ""

                    elif 'PY_' + n in notdone:
                        found = False

                    else:
                        item = str(done['PY_' + n])
                else:
                    done[n] = item = ""
                if found:
                    after = value[m.end():]
                    value = value[:m.start()] + item + after
                    if "$" in after:
                        notdone[name] = value
                    else:
                        try: value = int(value)
                        except ValueError:
                            done[name] = value.strip()
                        else:
                            done[name] = value
                        del notdone[name]

                        if name.startswith('PY_') \
                            and name[3:] in renamed_variables:

                            name = name[3:]
                            if name not in done:
                                done[name] = value
            else:
                # bogus variable reference; just drop it since we can't deal
                del notdone[name]

    fp.close()

    # strip spurious spaces
    for k, v in done.items():
        if isinstance(v, str):
            done[k] = v.strip()

    # save the results in the global dictionary
    g.update(done)
    return g


def expand_makefile_vars(s, vars):
    """Expand Makefile-style variables -- "${foo}" or "$(foo)" -- in
    'string' according to 'vars' (a dictionary mapping variable names to
    values).  Variables not present in 'vars' are silently expanded to the
    empty string.  The variable values in 'vars' should not contain further
    variable expansions; if 'vars' is the output of 'parse_makefile()',
    you're fine.  Returns a variable-expanded version of 's'.
    """

    # This algorithm does multiple expansion, so if vars['foo'] contains
    # "${bar}", it will expand ${foo} to ${bar}, and then expand
    # ${bar}... and so forth.  This is fine as long as 'vars' comes from
    # 'parse_makefile()', which takes care of such expansions eagerly,
    # according to make's variable expansion semantics.

    while True:
        m = _findvar1_rx.search(s) or _findvar2_rx.search(s)
        if m:
            (beg, end) = m.span()
            s = s[0:beg] + vars.get(m.group(1)) + s[end:]
        else:
            break
    return s


_config_vars = None

def _init_posix():
    """Initialize the module as appropriate for POSIX systems."""
    # _sysconfigdata is generated at build time, see the sysconfig module
    name = os.environ.get('_PYTHON_SYSCONFIGDATA_NAME',
        '_sysconfigdata_{abi}_{platform}_{multiarch}'.format(
        abi=sys.abiflags,
        platform=sys.platform,
        multiarch=getattr(sys.implementation, '_multiarch', ''),
    ))
    _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
    build_time_vars = _temp.build_time_vars
    global _config_vars
    _config_vars = {}
    _config_vars.update(build_time_vars)


def _init_nt():
    """Initialize the module as appropriate for NT"""
    g = {}
    # set basic install directories
    g['LIBDEST'] = get_python_lib(plat_specific=0, standard_lib=1)
    g['BINLIBDEST'] = get_python_lib(plat_specific=1, standard_lib=1)

    # XXX hmmm.. a normal install puts include files here
    g['INCLUDEPY'] = get_python_inc(plat_specific=0)

    g['EXT_SUFFIX'] = _imp.extension_suffixes()[0]
    g['EXE'] = ".exe"
    g['VERSION'] = get_python_version().replace(".", "")
    g['BINDIR'] = os.path.dirname(os.path.abspath(sys.executable))

    global _config_vars
    _config_vars = g


def get_config_vars(*args):
    """With no arguments, return a dictionary of all configuration
    variables relevant for the current platform.  Generally this includes
    everything needed to build extensions and install both pure modules and
    extensions.  On Unix, this means every variable defined in Python's
    installed Makefile; on Windows it's a much smaller set.

    With arguments, return a list of values that result from looking up
    each argument in the configuration variable dictionary.
    """
    global _config_vars
    if _config_vars is None:
        func = globals().get("_init_" + os.name)
        if func:
            func()
        else:
            _config_vars = {}

        # Normalized versions of prefix and exec_prefix are handy to have;
        # in fact, these are the standard versions used most places in the
        # Distutils.
        _config_vars['prefix'] = PREFIX
        _config_vars['exec_prefix'] = EXEC_PREFIX

        # For backward compatibility, see issue19555
        SO = _config_vars.get('EXT_SUFFIX')
        if SO is not None:
            _config_vars['SO'] = SO

        # Always convert srcdir to an absolute path
        srcdir = _config_vars.get('srcdir', project_base)
        if os.name == 'posix':
            if python_build:
                # If srcdir is a relative path (typically '.' or '..')
                # then it should be interpreted relative to the directory
                # containing Makefile.
                base = os.path.dirname(get_makefile_filename())
                srcdir = os.path.join(base, srcdir)
            else:
                # srcdir is not meaningful since the installation is
                # spread about the filesystem.  We choose the
                # directory containing the Makefile since we know it
                # exists.
                srcdir = os.path.dirname(get_makefile_filename())
        _config_vars['srcdir'] = os.path.abspath(os.path.normpath(srcdir))

        # Convert srcdir into an absolute path if it appears necessary.
        # Normally it is relative to the build directory.  However, during
        # testing, for example, we might be running a non-installed python
        # from a different directory.
        if python_build and os.name == "posix":
            base = project_base
            if (not os.path.isabs(_config_vars['srcdir']) and
                base != os.getcwd()):
                # srcdir is relative and we are not in the same directory
                # as the executable. Assume executable is in the build
                # directory and make srcdir absolute.
                srcdir = os.path.join(base, _config_vars['srcdir'])
                _config_vars['srcdir'] = os.path.normpath(srcdir)

        # OS X platforms require special customization to handle
        # multi-architecture, multi-os-version installers
        if sys.platform == 'darwin':
            import _osx_support
            _osx_support.customize_config_vars(_config_vars)

    if args:
        vals = []
        for name in args:
            vals.append(_config_vars.get(name))
        return vals
    else:
        return _config_vars

def get_config_var(name):
    """Return the value of a single variable using the dictionary
    returned by 'get_config_vars()'.  Equivalent to
    get_config_vars().get(name)
    """
    if name == 'SO':
        import warnings
        warnings.warn('SO is deprecated, use EXT_SUFFIX', DeprecationWarning, 2)
    return get_config_vars().get(name)
distutils/ccompiler.py000064400000134511151153537450011135 0ustar00"""distutils.ccompiler

Contains CCompiler, an abstract base class that defines the interface
for the Distutils compiler abstraction model."""

import sys, os, re
from distutils.errors import *
from distutils.spawn import spawn
from distutils.file_util import move_file
from distutils.dir_util import mkpath
from distutils.dep_util import newer_pairwise, newer_group
from distutils.util import split_quoted, execute
from distutils import log

class CCompiler:
    """Abstract base class to define the interface that must be implemented
    by real compiler classes.  Also has some utility methods used by
    several compiler classes.

    The basic idea behind a compiler abstraction class is that each
    instance can be used for all the compile/link steps in building a
    single project.  Thus, attributes common to all of those compile and
    link steps -- include directories, macros to define, libraries to link
    against, etc. -- are attributes of the compiler instance.  To allow for
    variability in how individual files are treated, most of those
    attributes may be varied on a per-compilation or per-link basis.
    """

    # 'compiler_type' is a class attribute that identifies this class.  It
    # keeps code that wants to know what kind of compiler it's dealing with
    # from having to import all possible compiler classes just to do an
    # 'isinstance'.  In concrete CCompiler subclasses, 'compiler_type'
    # should really, really be one of the keys of the 'compiler_class'
    # dictionary (see below -- used by the 'new_compiler()' factory
    # function) -- authors of new compiler interface classes are
    # responsible for updating 'compiler_class'!
    compiler_type = None

    # XXX things not handled by this compiler abstraction model:
    #   * client can't provide additional options for a compiler,
    #     e.g. warning, optimization, debugging flags.  Perhaps this
    #     should be the domain of concrete compiler abstraction classes
    #     (UnixCCompiler, MSVCCompiler, etc.) -- or perhaps the base
    #     class should have methods for the common ones.
    #   * can't completely override the include or library searchg
    #     path, ie. no "cc -I -Idir1 -Idir2" or "cc -L -Ldir1 -Ldir2".
    #     I'm not sure how widely supported this is even by Unix
    #     compilers, much less on other platforms.  And I'm even less
    #     sure how useful it is; maybe for cross-compiling, but
    #     support for that is a ways off.  (And anyways, cross
    #     compilers probably have a dedicated binary with the
    #     right paths compiled in.  I hope.)
    #   * can't do really freaky things with the library list/library
    #     dirs, e.g. "-Ldir1 -lfoo -Ldir2 -lfoo" to link against
    #     different versions of libfoo.a in different locations.  I
    #     think this is useless without the ability to null out the
    #     library search path anyways.


    # Subclasses that rely on the standard filename generation methods
    # implemented below should override these; see the comment near
    # those methods ('object_filenames()' et. al.) for details:
    src_extensions = None               # list of strings
    obj_extension = None                # string
    static_lib_extension = None
    shared_lib_extension = None         # string
    static_lib_format = None            # format string
    shared_lib_format = None            # prob. same as static_lib_format
    exe_extension = None                # string

    # Default language settings. language_map is used to detect a source
    # file or Extension target language, checking source filenames.
    # language_order is used to detect the language precedence, when deciding
    # what language to use when mixing source types. For example, if some
    # extension has two files with ".c" extension, and one with ".cpp", it
    # is still linked as c++.
    language_map = {".c"   : "c",
                    ".cc"  : "c++",
                    ".cpp" : "c++",
                    ".cxx" : "c++",
                    ".m"   : "objc",
                   }
    language_order = ["c++", "objc", "c"]

    def __init__(self, verbose=0, dry_run=0, force=0):
        self.dry_run = dry_run
        self.force = force
        self.verbose = verbose

        # 'output_dir': a common output directory for object, library,
        # shared object, and shared library files
        self.output_dir = None

        # 'macros': a list of macro definitions (or undefinitions).  A
        # macro definition is a 2-tuple (name, value), where the value is
        # either a string or None (no explicit value).  A macro
        # undefinition is a 1-tuple (name,).
        self.macros = []

        # 'include_dirs': a list of directories to search for include files
        self.include_dirs = []

        # 'libraries': a list of libraries to include in any link
        # (library names, not filenames: eg. "foo" not "libfoo.a")
        self.libraries = []

        # 'library_dirs': a list of directories to search for libraries
        self.library_dirs = []

        # 'runtime_library_dirs': a list of directories to search for
        # shared libraries/objects at runtime
        self.runtime_library_dirs = []

        # 'objects': a list of object files (or similar, such as explicitly
        # named library files) to include on any link
        self.objects = []

        for key in self.executables.keys():
            self.set_executable(key, self.executables[key])

    def set_executables(self, **kwargs):
        """Define the executables (and options for them) that will be run
        to perform the various stages of compilation.  The exact set of
        executables that may be specified here depends on the compiler
        class (via the 'executables' class attribute), but most will have:
          compiler      the C/C++ compiler
          linker_so     linker used to create shared objects and libraries
          linker_exe    linker used to create binary executables
          archiver      static library creator

        On platforms with a command-line (Unix, DOS/Windows), each of these
        is a string that will be split into executable name and (optional)
        list of arguments.  (Splitting the string is done similarly to how
        Unix shells operate: words are delimited by spaces, but quotes and
        backslashes can override this.  See
        'distutils.util.split_quoted()'.)
        """

        # Note that some CCompiler implementation classes will define class
        # attributes 'cpp', 'cc', etc. with hard-coded executable names;
        # this is appropriate when a compiler class is for exactly one
        # compiler/OS combination (eg. MSVCCompiler).  Other compiler
        # classes (UnixCCompiler, in particular) are driven by information
        # discovered at run-time, since there are many different ways to do
        # basically the same things with Unix C compilers.

        for key in kwargs:
            if key not in self.executables:
                raise ValueError("unknown executable '%s' for class %s" %
                      (key, self.__class__.__name__))
            self.set_executable(key, kwargs[key])

    def set_executable(self, key, value):
        if isinstance(value, str):
            setattr(self, key, split_quoted(value))
        else:
            setattr(self, key, value)

    def _find_macro(self, name):
        i = 0
        for defn in self.macros:
            if defn[0] == name:
                return i
            i += 1
        return None

    def _check_macro_definitions(self, definitions):
        """Ensures that every element of 'definitions' is a valid macro
        definition, ie. either (name,value) 2-tuple or a (name,) tuple.  Do
        nothing if all definitions are OK, raise TypeError otherwise.
        """
        for defn in definitions:
            if not (isinstance(defn, tuple) and
                    (len(defn) in (1, 2) and
                      (isinstance (defn[1], str) or defn[1] is None)) and
                    isinstance (defn[0], str)):
                raise TypeError(("invalid macro definition '%s': " % defn) + \
                      "must be tuple (string,), (string, string), or " + \
                      "(string, None)")


    # -- Bookkeeping methods -------------------------------------------

    def define_macro(self, name, value=None):
        """Define a preprocessor macro for all compilations driven by this
        compiler object.  The optional parameter 'value' should be a
        string; if it is not supplied, then the macro will be defined
        without an explicit value and the exact outcome depends on the
        compiler used (XXX true? does ANSI say anything about this?)
        """
        # Delete from the list of macro definitions/undefinitions if
        # already there (so that this one will take precedence).
        i = self._find_macro (name)
        if i is not None:
            del self.macros[i]

        self.macros.append((name, value))

    def undefine_macro(self, name):
        """Undefine a preprocessor macro for all compilations driven by
        this compiler object.  If the same macro is defined by
        'define_macro()' and undefined by 'undefine_macro()' the last call
        takes precedence (including multiple redefinitions or
        undefinitions).  If the macro is redefined/undefined on a
        per-compilation basis (ie. in the call to 'compile()'), then that
        takes precedence.
        """
        # Delete from the list of macro definitions/undefinitions if
        # already there (so that this one will take precedence).
        i = self._find_macro (name)
        if i is not None:
            del self.macros[i]

        undefn = (name,)
        self.macros.append(undefn)

    def add_include_dir(self, dir):
        """Add 'dir' to the list of directories that will be searched for
        header files.  The compiler is instructed to search directories in
        the order in which they are supplied by successive calls to
        'add_include_dir()'.
        """
        self.include_dirs.append(dir)

    def set_include_dirs(self, dirs):
        """Set the list of directories that will be searched to 'dirs' (a
        list of strings).  Overrides any preceding calls to
        'add_include_dir()'; subsequence calls to 'add_include_dir()' add
        to the list passed to 'set_include_dirs()'.  This does not affect
        any list of standard include directories that the compiler may
        search by default.
        """
        self.include_dirs = dirs[:]

    def add_library(self, libname):
        """Add 'libname' to the list of libraries that will be included in
        all links driven by this compiler object.  Note that 'libname'
        should *not* be the name of a file containing a library, but the
        name of the library itself: the actual filename will be inferred by
        the linker, the compiler, or the compiler class (depending on the
        platform).

        The linker will be instructed to link against libraries in the
        order they were supplied to 'add_library()' and/or
        'set_libraries()'.  It is perfectly valid to duplicate library
        names; the linker will be instructed to link against libraries as
        many times as they are mentioned.
        """
        self.libraries.append(libname)

    def set_libraries(self, libnames):
        """Set the list of libraries to be included in all links driven by
        this compiler object to 'libnames' (a list of strings).  This does
        not affect any standard system libraries that the linker may
        include by default.
        """
        self.libraries = libnames[:]

    def add_library_dir(self, dir):
        """Add 'dir' to the list of directories that will be searched for
        libraries specified to 'add_library()' and 'set_libraries()'.  The
        linker will be instructed to search for libraries in the order they
        are supplied to 'add_library_dir()' and/or 'set_library_dirs()'.
        """
        self.library_dirs.append(dir)

    def set_library_dirs(self, dirs):
        """Set the list of library search directories to 'dirs' (a list of
        strings).  This does not affect any standard library search path
        that the linker may search by default.
        """
        self.library_dirs = dirs[:]

    def add_runtime_library_dir(self, dir):
        """Add 'dir' to the list of directories that will be searched for
        shared libraries at runtime.
        """
        self.runtime_library_dirs.append(dir)

    def set_runtime_library_dirs(self, dirs):
        """Set the list of directories to search for shared libraries at
        runtime to 'dirs' (a list of strings).  This does not affect any
        standard search path that the runtime linker may search by
        default.
        """
        self.runtime_library_dirs = dirs[:]

    def add_link_object(self, object):
        """Add 'object' to the list of object files (or analogues, such as
        explicitly named library files or the output of "resource
        compilers") to be included in every link driven by this compiler
        object.
        """
        self.objects.append(object)

    def set_link_objects(self, objects):
        """Set the list of object files (or analogues) to be included in
        every link to 'objects'.  This does not affect any standard object
        files that the linker may include by default (such as system
        libraries).
        """
        self.objects = objects[:]


    # -- Private utility methods --------------------------------------
    # (here for the convenience of subclasses)

    # Helper method to prep compiler in subclass compile() methods

    def _setup_compile(self, outdir, macros, incdirs, sources, depends,
                       extra):
        """Process arguments and decide which source files to compile."""
        if outdir is None:
            outdir = self.output_dir
        elif not isinstance(outdir, str):
            raise TypeError("'output_dir' must be a string or None")

        if macros is None:
            macros = self.macros
        elif isinstance(macros, list):
            macros = macros + (self.macros or [])
        else:
            raise TypeError("'macros' (if supplied) must be a list of tuples")

        if incdirs is None:
            incdirs = self.include_dirs
        elif isinstance(incdirs, (list, tuple)):
            incdirs = list(incdirs) + (self.include_dirs or [])
        else:
            raise TypeError(
                  "'include_dirs' (if supplied) must be a list of strings")

        if extra is None:
            extra = []

        # Get the list of expected output (object) files
        objects = self.object_filenames(sources, strip_dir=0,
                                        output_dir=outdir)
        assert len(objects) == len(sources)

        pp_opts = gen_preprocess_options(macros, incdirs)

        build = {}
        for i in range(len(sources)):
            src = sources[i]
            obj = objects[i]
            ext = os.path.splitext(src)[1]
            self.mkpath(os.path.dirname(obj))
            build[obj] = (src, ext)

        return macros, objects, extra, pp_opts, build

    def _get_cc_args(self, pp_opts, debug, before):
        # works for unixccompiler, cygwinccompiler
        cc_args = pp_opts + ['-c']
        if debug:
            cc_args[:0] = ['-g']
        if before:
            cc_args[:0] = before
        return cc_args

    def _fix_compile_args(self, output_dir, macros, include_dirs):
        """Typecheck and fix-up some of the arguments to the 'compile()'
        method, and return fixed-up values.  Specifically: if 'output_dir'
        is None, replaces it with 'self.output_dir'; ensures that 'macros'
        is a list, and augments it with 'self.macros'; ensures that
        'include_dirs' is a list, and augments it with 'self.include_dirs'.
        Guarantees that the returned values are of the correct type,
        i.e. for 'output_dir' either string or None, and for 'macros' and
        'include_dirs' either list or None.
        """
        if output_dir is None:
            output_dir = self.output_dir
        elif not isinstance(output_dir, str):
            raise TypeError("'output_dir' must be a string or None")

        if macros is None:
            macros = self.macros
        elif isinstance(macros, list):
            macros = macros + (self.macros or [])
        else:
            raise TypeError("'macros' (if supplied) must be a list of tuples")

        if include_dirs is None:
            include_dirs = self.include_dirs
        elif isinstance(include_dirs, (list, tuple)):
            include_dirs = list(include_dirs) + (self.include_dirs or [])
        else:
            raise TypeError(
                  "'include_dirs' (if supplied) must be a list of strings")

        return output_dir, macros, include_dirs

    def _prep_compile(self, sources, output_dir, depends=None):
        """Decide which souce files must be recompiled.

        Determine the list of object files corresponding to 'sources',
        and figure out which ones really need to be recompiled.
        Return a list of all object files and a dictionary telling
        which source files can be skipped.
        """
        # Get the list of expected output (object) files
        objects = self.object_filenames(sources, output_dir=output_dir)
        assert len(objects) == len(sources)

        # Return an empty dict for the "which source files can be skipped"
        # return value to preserve API compatibility.
        return objects, {}

    def _fix_object_args(self, objects, output_dir):
        """Typecheck and fix up some arguments supplied to various methods.
        Specifically: ensure that 'objects' is a list; if output_dir is
        None, replace with self.output_dir.  Return fixed versions of
        'objects' and 'output_dir'.
        """
        if not isinstance(objects, (list, tuple)):
            raise TypeError("'objects' must be a list or tuple of strings")
        objects = list(objects)

        if output_dir is None:
            output_dir = self.output_dir
        elif not isinstance(output_dir, str):
            raise TypeError("'output_dir' must be a string or None")

        return (objects, output_dir)

    def _fix_lib_args(self, libraries, library_dirs, runtime_library_dirs):
        """Typecheck and fix up some of the arguments supplied to the
        'link_*' methods.  Specifically: ensure that all arguments are
        lists, and augment them with their permanent versions
        (eg. 'self.libraries' augments 'libraries').  Return a tuple with
        fixed versions of all arguments.
        """
        if libraries is None:
            libraries = self.libraries
        elif isinstance(libraries, (list, tuple)):
            libraries = list (libraries) + (self.libraries or [])
        else:
            raise TypeError(
                  "'libraries' (if supplied) must be a list of strings")

        if library_dirs is None:
            library_dirs = self.library_dirs
        elif isinstance(library_dirs, (list, tuple)):
            library_dirs = list (library_dirs) + (self.library_dirs or [])
        else:
            raise TypeError(
                  "'library_dirs' (if supplied) must be a list of strings")

        if runtime_library_dirs is None:
            runtime_library_dirs = self.runtime_library_dirs
        elif isinstance(runtime_library_dirs, (list, tuple)):
            runtime_library_dirs = (list(runtime_library_dirs) +
                                    (self.runtime_library_dirs or []))
        else:
            raise TypeError("'runtime_library_dirs' (if supplied) "
                            "must be a list of strings")

        return (libraries, library_dirs, runtime_library_dirs)

    def _need_link(self, objects, output_file):
        """Return true if we need to relink the files listed in 'objects'
        to recreate 'output_file'.
        """
        if self.force:
            return True
        else:
            if self.dry_run:
                newer = newer_group (objects, output_file, missing='newer')
            else:
                newer = newer_group (objects, output_file)
            return newer

    def detect_language(self, sources):
        """Detect the language of a given file, or list of files. Uses
        language_map, and language_order to do the job.
        """
        if not isinstance(sources, list):
            sources = [sources]
        lang = None
        index = len(self.language_order)
        for source in sources:
            base, ext = os.path.splitext(source)
            extlang = self.language_map.get(ext)
            try:
                extindex = self.language_order.index(extlang)
                if extindex < index:
                    lang = extlang
                    index = extindex
            except ValueError:
                pass
        return lang


    # -- Worker methods ------------------------------------------------
    # (must be implemented by subclasses)

    def preprocess(self, source, output_file=None, macros=None,
                   include_dirs=None, extra_preargs=None, extra_postargs=None):
        """Preprocess a single C/C++ source file, named in 'source'.
        Output will be written to file named 'output_file', or stdout if
        'output_file' not supplied.  'macros' is a list of macro
        definitions as for 'compile()', which will augment the macros set
        with 'define_macro()' and 'undefine_macro()'.  'include_dirs' is a
        list of directory names that will be added to the default list.

        Raises PreprocessError on failure.
        """
        pass

    def compile(self, sources, output_dir=None, macros=None,
                include_dirs=None, debug=0, extra_preargs=None,
                extra_postargs=None, depends=None):
        """Compile one or more source files.

        'sources' must be a list of filenames, most likely C/C++
        files, but in reality anything that can be handled by a
        particular compiler and compiler class (eg. MSVCCompiler can
        handle resource files in 'sources').  Return a list of object
        filenames, one per source filename in 'sources'.  Depending on
        the implementation, not all source files will necessarily be
        compiled, but all corresponding object filenames will be
        returned.

        If 'output_dir' is given, object files will be put under it, while
        retaining their original path component.  That is, "foo/bar.c"
        normally compiles to "foo/bar.o" (for a Unix implementation); if
        'output_dir' is "build", then it would compile to
        "build/foo/bar.o".

        'macros', if given, must be a list of macro definitions.  A macro
        definition is either a (name, value) 2-tuple or a (name,) 1-tuple.
        The former defines a macro; if the value is None, the macro is
        defined without an explicit value.  The 1-tuple case undefines a
        macro.  Later definitions/redefinitions/ undefinitions take
        precedence.

        'include_dirs', if given, must be a list of strings, the
        directories to add to the default include file search path for this
        compilation only.

        'debug' is a boolean; if true, the compiler will be instructed to
        output debug symbols in (or alongside) the object file(s).

        'extra_preargs' and 'extra_postargs' are implementation- dependent.
        On platforms that have the notion of a command-line (e.g. Unix,
        DOS/Windows), they are most likely lists of strings: extra
        command-line arguments to prepend/append to the compiler command
        line.  On other platforms, consult the implementation class
        documentation.  In any event, they are intended as an escape hatch
        for those occasions when the abstract compiler framework doesn't
        cut the mustard.

        'depends', if given, is a list of filenames that all targets
        depend on.  If a source file is older than any file in
        depends, then the source file will be recompiled.  This
        supports dependency tracking, but only at a coarse
        granularity.

        Raises CompileError on failure.
        """
        # A concrete compiler class can either override this method
        # entirely or implement _compile().
        macros, objects, extra_postargs, pp_opts, build = \
                self._setup_compile(output_dir, macros, include_dirs, sources,
                                    depends, extra_postargs)
        cc_args = self._get_cc_args(pp_opts, debug, extra_preargs)

        for obj in objects:
            try:
                src, ext = build[obj]
            except KeyError:
                continue
            self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)

        # Return *all* object filenames, not just the ones we just built.
        return objects

    def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
        """Compile 'src' to product 'obj'."""
        # A concrete compiler class that does not override compile()
        # should implement _compile().
        pass

    def create_static_lib(self, objects, output_libname, output_dir=None,
                          debug=0, target_lang=None):
        """Link a bunch of stuff together to create a static library file.
        The "bunch of stuff" consists of the list of object files supplied
        as 'objects', the extra object files supplied to
        'add_link_object()' and/or 'set_link_objects()', the libraries
        supplied to 'add_library()' and/or 'set_libraries()', and the
        libraries supplied as 'libraries' (if any).

        'output_libname' should be a library name, not a filename; the
        filename will be inferred from the library name.  'output_dir' is
        the directory where the library file will be put.

        'debug' is a boolean; if true, debugging information will be
        included in the library (note that on most platforms, it is the
        compile step where this matters: the 'debug' flag is included here
        just for consistency).

        'target_lang' is the target language for which the given objects
        are being compiled. This allows specific linkage time treatment of
        certain languages.

        Raises LibError on failure.
        """
        pass


    # values for target_desc parameter in link()
    SHARED_OBJECT = "shared_object"
    SHARED_LIBRARY = "shared_library"
    EXECUTABLE = "executable"

    def link(self,
             target_desc,
             objects,
             output_filename,
             output_dir=None,
             libraries=None,
             library_dirs=None,
             runtime_library_dirs=None,
             export_symbols=None,
             debug=0,
             extra_preargs=None,
             extra_postargs=None,
             build_temp=None,
             target_lang=None):
        """Link a bunch of stuff together to create an executable or
        shared library file.

        The "bunch of stuff" consists of the list of object files supplied
        as 'objects'.  'output_filename' should be a filename.  If
        'output_dir' is supplied, 'output_filename' is relative to it
        (i.e. 'output_filename' can provide directory components if
        needed).

        'libraries' is a list of libraries to link against.  These are
        library names, not filenames, since they're translated into
        filenames in a platform-specific way (eg. "foo" becomes "libfoo.a"
        on Unix and "foo.lib" on DOS/Windows).  However, they can include a
        directory component, which means the linker will look in that
        specific directory rather than searching all the normal locations.

        'library_dirs', if supplied, should be a list of directories to
        search for libraries that were specified as bare library names
        (ie. no directory component).  These are on top of the system
        default and those supplied to 'add_library_dir()' and/or
        'set_library_dirs()'.  'runtime_library_dirs' is a list of
        directories that will be embedded into the shared library and used
        to search for other shared libraries that *it* depends on at
        run-time.  (This may only be relevant on Unix.)

        'export_symbols' is a list of symbols that the shared library will
        export.  (This appears to be relevant only on Windows.)

        'debug' is as for 'compile()' and 'create_static_lib()', with the
        slight distinction that it actually matters on most platforms (as
        opposed to 'create_static_lib()', which includes a 'debug' flag
        mostly for form's sake).

        'extra_preargs' and 'extra_postargs' are as for 'compile()' (except
        of course that they supply command-line arguments for the
        particular linker being used).

        'target_lang' is the target language for which the given objects
        are being compiled. This allows specific linkage time treatment of
        certain languages.

        Raises LinkError on failure.
        """
        raise NotImplementedError


    # Old 'link_*()' methods, rewritten to use the new 'link()' method.

    def link_shared_lib(self,
                        objects,
                        output_libname,
                        output_dir=None,
                        libraries=None,
                        library_dirs=None,
                        runtime_library_dirs=None,
                        export_symbols=None,
                        debug=0,
                        extra_preargs=None,
                        extra_postargs=None,
                        build_temp=None,
                        target_lang=None):
        self.link(CCompiler.SHARED_LIBRARY, objects,
                  self.library_filename(output_libname, lib_type='shared'),
                  output_dir,
                  libraries, library_dirs, runtime_library_dirs,
                  export_symbols, debug,
                  extra_preargs, extra_postargs, build_temp, target_lang)


    def link_shared_object(self,
                           objects,
                           output_filename,
                           output_dir=None,
                           libraries=None,
                           library_dirs=None,
                           runtime_library_dirs=None,
                           export_symbols=None,
                           debug=0,
                           extra_preargs=None,
                           extra_postargs=None,
                           build_temp=None,
                           target_lang=None):
        self.link(CCompiler.SHARED_OBJECT, objects,
                  output_filename, output_dir,
                  libraries, library_dirs, runtime_library_dirs,
                  export_symbols, debug,
                  extra_preargs, extra_postargs, build_temp, target_lang)


    def link_executable(self,
                        objects,
                        output_progname,
                        output_dir=None,
                        libraries=None,
                        library_dirs=None,
                        runtime_library_dirs=None,
                        debug=0,
                        extra_preargs=None,
                        extra_postargs=None,
                        target_lang=None):
        self.link(CCompiler.EXECUTABLE, objects,
                  self.executable_filename(output_progname), output_dir,
                  libraries, library_dirs, runtime_library_dirs, None,
                  debug, extra_preargs, extra_postargs, None, target_lang)


    # -- Miscellaneous methods -----------------------------------------
    # These are all used by the 'gen_lib_options() function; there is
    # no appropriate default implementation so subclasses should
    # implement all of these.

    def library_dir_option(self, dir):
        """Return the compiler option to add 'dir' to the list of
        directories searched for libraries.
        """
        raise NotImplementedError

    def runtime_library_dir_option(self, dir):
        """Return the compiler option to add 'dir' to the list of
        directories searched for runtime libraries.
        """
        raise NotImplementedError

    def library_option(self, lib):
        """Return the compiler option to add 'lib' to the list of libraries
        linked into the shared library or executable.
        """
        raise NotImplementedError

    def has_function(self, funcname, includes=None, include_dirs=None,
                     libraries=None, library_dirs=None):
        """Return a boolean indicating whether funcname is supported on
        the current platform.  The optional arguments can be used to
        augment the compilation environment.
        """
        # this can't be included at module scope because it tries to
        # import math which might not be available at that point - maybe
        # the necessary logic should just be inlined?
        import tempfile
        if includes is None:
            includes = []
        if include_dirs is None:
            include_dirs = []
        if libraries is None:
            libraries = []
        if library_dirs is None:
            library_dirs = []
        fd, fname = tempfile.mkstemp(".c", funcname, text=True)
        f = os.fdopen(fd, "w")
        try:
            for incl in includes:
                f.write("""#include "%s"\n""" % incl)
            f.write("""\
int main (int argc, char **argv) {
    %s();
    return 0;
}
""" % funcname)
        finally:
            f.close()
        try:
            objects = self.compile([fname], include_dirs=include_dirs)
        except CompileError:
            return False

        try:
            self.link_executable(objects, "a.out",
                                 libraries=libraries,
                                 library_dirs=library_dirs)
        except (LinkError, TypeError):
            return False
        return True

    def find_library_file (self, dirs, lib, debug=0):
        """Search the specified list of directories for a static or shared
        library file 'lib' and return the full path to that file.  If
        'debug' true, look for a debugging version (if that makes sense on
        the current platform).  Return None if 'lib' wasn't found in any of
        the specified directories.
        """
        raise NotImplementedError

    # -- Filename generation methods -----------------------------------

    # The default implementation of the filename generating methods are
    # prejudiced towards the Unix/DOS/Windows view of the world:
    #   * object files are named by replacing the source file extension
    #     (eg. .c/.cpp -> .o/.obj)
    #   * library files (shared or static) are named by plugging the
    #     library name and extension into a format string, eg.
    #     "lib%s.%s" % (lib_name, ".a") for Unix static libraries
    #   * executables are named by appending an extension (possibly
    #     empty) to the program name: eg. progname + ".exe" for
    #     Windows
    #
    # To reduce redundant code, these methods expect to find
    # several attributes in the current object (presumably defined
    # as class attributes):
    #   * src_extensions -
    #     list of C/C++ source file extensions, eg. ['.c', '.cpp']
    #   * obj_extension -
    #     object file extension, eg. '.o' or '.obj'
    #   * static_lib_extension -
    #     extension for static library files, eg. '.a' or '.lib'
    #   * shared_lib_extension -
    #     extension for shared library/object files, eg. '.so', '.dll'
    #   * static_lib_format -
    #     format string for generating static library filenames,
    #     eg. 'lib%s.%s' or '%s.%s'
    #   * shared_lib_format
    #     format string for generating shared library filenames
    #     (probably same as static_lib_format, since the extension
    #     is one of the intended parameters to the format string)
    #   * exe_extension -
    #     extension for executable files, eg. '' or '.exe'

    def object_filenames(self, source_filenames, strip_dir=0, output_dir=''):
        if output_dir is None:
            output_dir = ''
        obj_names = []
        for src_name in source_filenames:
            base, ext = os.path.splitext(src_name)
            base = os.path.splitdrive(base)[1] # Chop off the drive
            base = base[os.path.isabs(base):]  # If abs, chop off leading /
            if ext not in self.src_extensions:
                raise UnknownFileError(
                      "unknown file type '%s' (from '%s')" % (ext, src_name))
            if strip_dir:
                base = os.path.basename(base)
            obj_names.append(os.path.join(output_dir,
                                          base + self.obj_extension))
        return obj_names

    def shared_object_filename(self, basename, strip_dir=0, output_dir=''):
        assert output_dir is not None
        if strip_dir:
            basename = os.path.basename(basename)
        return os.path.join(output_dir, basename + self.shared_lib_extension)

    def executable_filename(self, basename, strip_dir=0, output_dir=''):
        assert output_dir is not None
        if strip_dir:
            basename = os.path.basename(basename)
        return os.path.join(output_dir, basename + (self.exe_extension or ''))

    def library_filename(self, libname, lib_type='static',     # or 'shared'
                         strip_dir=0, output_dir=''):
        assert output_dir is not None
        if lib_type not in ("static", "shared", "dylib", "xcode_stub"):
            raise ValueError(
                  "'lib_type' must be \"static\", \"shared\", \"dylib\", or \"xcode_stub\"")
        fmt = getattr(self, lib_type + "_lib_format")
        ext = getattr(self, lib_type + "_lib_extension")

        dir, base = os.path.split(libname)
        filename = fmt % (base, ext)
        if strip_dir:
            dir = ''

        return os.path.join(output_dir, dir, filename)


    # -- Utility methods -----------------------------------------------

    def announce(self, msg, level=1):
        log.debug(msg)

    def debug_print(self, msg):
        from distutils.debug import DEBUG
        if DEBUG:
            print(msg)

    def warn(self, msg):
        sys.stderr.write("warning: %s\n" % msg)

    def execute(self, func, args, msg=None, level=1):
        execute(func, args, msg, self.dry_run)

    def spawn(self, cmd):
        spawn(cmd, dry_run=self.dry_run)

    def move_file(self, src, dst):
        return move_file(src, dst, dry_run=self.dry_run)

    def mkpath (self, name, mode=0o777):
        mkpath(name, mode, dry_run=self.dry_run)


# Map a sys.platform/os.name ('posix', 'nt') to the default compiler
# type for that platform. Keys are interpreted as re match
# patterns. Order is important; platform mappings are preferred over
# OS names.
_default_compilers = (

    # Platform string mappings

    # on a cygwin built python we can use gcc like an ordinary UNIXish
    # compiler
    ('cygwin.*', 'unix'),

    # OS name mappings
    ('posix', 'unix'),
    ('nt', 'msvc'),

    )

def get_default_compiler(osname=None, platform=None):
    """Determine the default compiler to use for the given platform.

       osname should be one of the standard Python OS names (i.e. the
       ones returned by os.name) and platform the common value
       returned by sys.platform for the platform in question.

       The default values are os.name and sys.platform in case the
       parameters are not given.
    """
    if osname is None:
        osname = os.name
    if platform is None:
        platform = sys.platform
    for pattern, compiler in _default_compilers:
        if re.match(pattern, platform) is not None or \
           re.match(pattern, osname) is not None:
            return compiler
    # Default to Unix compiler
    return 'unix'

# Map compiler types to (module_name, class_name) pairs -- ie. where to
# find the code that implements an interface to this compiler.  (The module
# is assumed to be in the 'distutils' package.)
compiler_class = { 'unix':    ('unixccompiler', 'UnixCCompiler',
                               "standard UNIX-style compiler"),
                   'msvc':    ('_msvccompiler', 'MSVCCompiler',
                               "Microsoft Visual C++"),
                   'cygwin':  ('cygwinccompiler', 'CygwinCCompiler',
                               "Cygwin port of GNU C Compiler for Win32"),
                   'mingw32': ('cygwinccompiler', 'Mingw32CCompiler',
                               "Mingw32 port of GNU C Compiler for Win32"),
                   'bcpp':    ('bcppcompiler', 'BCPPCompiler',
                               "Borland C++ Compiler"),
                 }

def show_compilers():
    """Print list of available compilers (used by the "--help-compiler"
    options to "build", "build_ext", "build_clib").
    """
    # XXX this "knows" that the compiler option it's describing is
    # "--compiler", which just happens to be the case for the three
    # commands that use it.
    from distutils.fancy_getopt import FancyGetopt
    compilers = []
    for compiler in compiler_class.keys():
        compilers.append(("compiler="+compiler, None,
                          compiler_class[compiler][2]))
    compilers.sort()
    pretty_printer = FancyGetopt(compilers)
    pretty_printer.print_help("List of available compilers:")


def new_compiler(plat=None, compiler=None, verbose=0, dry_run=0, force=0):
    """Generate an instance of some CCompiler subclass for the supplied
    platform/compiler combination.  'plat' defaults to 'os.name'
    (eg. 'posix', 'nt'), and 'compiler' defaults to the default compiler
    for that platform.  Currently only 'posix' and 'nt' are supported, and
    the default compilers are "traditional Unix interface" (UnixCCompiler
    class) and Visual C++ (MSVCCompiler class).  Note that it's perfectly
    possible to ask for a Unix compiler object under Windows, and a
    Microsoft compiler object under Unix -- if you supply a value for
    'compiler', 'plat' is ignored.
    """
    if plat is None:
        plat = os.name

    try:
        if compiler is None:
            compiler = get_default_compiler(plat)

        (module_name, class_name, long_description) = compiler_class[compiler]
    except KeyError:
        msg = "don't know how to compile C/C++ code on platform '%s'" % plat
        if compiler is not None:
            msg = msg + " with '%s' compiler" % compiler
        raise DistutilsPlatformError(msg)

    try:
        module_name = "distutils." + module_name
        __import__ (module_name)
        module = sys.modules[module_name]
        klass = vars(module)[class_name]
    except ImportError:
        raise DistutilsModuleError(
              "can't compile C/C++ code: unable to load module '%s'" % \
              module_name)
    except KeyError:
        raise DistutilsModuleError(
               "can't compile C/C++ code: unable to find class '%s' "
               "in module '%s'" % (class_name, module_name))

    # XXX The None is necessary to preserve backwards compatibility
    # with classes that expect verbose to be the first positional
    # argument.
    return klass(None, dry_run, force)


def gen_preprocess_options(macros, include_dirs):
    """Generate C pre-processor options (-D, -U, -I) as used by at least
    two types of compilers: the typical Unix compiler and Visual C++.
    'macros' is the usual thing, a list of 1- or 2-tuples, where (name,)
    means undefine (-U) macro 'name', and (name,value) means define (-D)
    macro 'name' to 'value'.  'include_dirs' is just a list of directory
    names to be added to the header file search path (-I).  Returns a list
    of command-line options suitable for either Unix compilers or Visual
    C++.
    """
    # XXX it would be nice (mainly aesthetic, and so we don't generate
    # stupid-looking command lines) to go over 'macros' and eliminate
    # redundant definitions/undefinitions (ie. ensure that only the
    # latest mention of a particular macro winds up on the command
    # line).  I don't think it's essential, though, since most (all?)
    # Unix C compilers only pay attention to the latest -D or -U
    # mention of a macro on their command line.  Similar situation for
    # 'include_dirs'.  I'm punting on both for now.  Anyways, weeding out
    # redundancies like this should probably be the province of
    # CCompiler, since the data structures used are inherited from it
    # and therefore common to all CCompiler classes.
    pp_opts = []
    for macro in macros:
        if not (isinstance(macro, tuple) and 1 <= len(macro) <= 2):
            raise TypeError(
                  "bad macro definition '%s': "
                  "each element of 'macros' list must be a 1- or 2-tuple"
                  % macro)

        if len(macro) == 1:        # undefine this macro
            pp_opts.append("-U%s" % macro[0])
        elif len(macro) == 2:
            if macro[1] is None:    # define with no explicit value
                pp_opts.append("-D%s" % macro[0])
            else:
                # XXX *don't* need to be clever about quoting the
                # macro value here, because we're going to avoid the
                # shell at all costs when we spawn the command!
                pp_opts.append("-D%s=%s" % macro)

    for dir in include_dirs:
        pp_opts.append("-I%s" % dir)
    return pp_opts


def gen_lib_options (compiler, library_dirs, runtime_library_dirs, libraries):
    """Generate linker options for searching library directories and
    linking with specific libraries.  'libraries' and 'library_dirs' are,
    respectively, lists of library names (not filenames!) and search
    directories.  Returns a list of command-line options suitable for use
    with some compiler (depending on the two format strings passed in).
    """
    lib_opts = []

    for dir in library_dirs:
        lib_opts.append(compiler.library_dir_option(dir))

    for dir in runtime_library_dirs:
        opt = compiler.runtime_library_dir_option(dir)
        if isinstance(opt, list):
            lib_opts = lib_opts + opt
        else:
            lib_opts.append(opt)

    # XXX it's important that we *not* remove redundant library mentions!
    # sometimes you really do have to say "-lfoo -lbar -lfoo" in order to
    # resolve all symbols.  I just hope we never have to say "-lfoo obj.o
    # -lbar" to get things to work -- that's certainly a possibility, but a
    # pretty nasty way to arrange your C code.

    for lib in libraries:
        (lib_dir, lib_name) = os.path.split(lib)
        if lib_dir:
            lib_file = compiler.find_library_file([lib_dir], lib_name)
            if lib_file:
                lib_opts.append(lib_file)
            else:
                compiler.warn("no library file corresponding to "
                              "'%s' found (skipping)" % lib)
        else:
            lib_opts.append(compiler.library_option (lib))
    return lib_opts
distutils/log.py000064400000003661151153537450007742 0ustar00"""A simple log mechanism styled after PEP 282."""

# The class here is styled after PEP 282 so that it could later be
# replaced with a standard Python logging implementation.

DEBUG = 1
INFO = 2
WARN = 3
ERROR = 4
FATAL = 5

import sys

class Log:

    def __init__(self, threshold=WARN):
        self.threshold = threshold

    def _log(self, level, msg, args):
        if level not in (DEBUG, INFO, WARN, ERROR, FATAL):
            raise ValueError('%s wrong log level' % str(level))

        if level >= self.threshold:
            if args:
                msg = msg % args
            if level in (WARN, ERROR, FATAL):
                stream = sys.stderr
            else:
                stream = sys.stdout
            try:
                stream.write('%s\n' % msg)
            except UnicodeEncodeError:
                # emulate backslashreplace error handler
                encoding = stream.encoding
                msg = msg.encode(encoding, "backslashreplace").decode(encoding)
                stream.write('%s\n' % msg)
            stream.flush()

    def log(self, level, msg, *args):
        self._log(level, msg, args)

    def debug(self, msg, *args):
        self._log(DEBUG, msg, args)

    def info(self, msg, *args):
        self._log(INFO, msg, args)

    def warn(self, msg, *args):
        self._log(WARN, msg, args)

    def error(self, msg, *args):
        self._log(ERROR, msg, args)

    def fatal(self, msg, *args):
        self._log(FATAL, msg, args)

_global_log = Log()
log = _global_log.log
debug = _global_log.debug
info = _global_log.info
warn = _global_log.warn
error = _global_log.error
fatal = _global_log.fatal

def set_threshold(level):
    # return the old threshold for use from tests
    old = _global_log.threshold
    _global_log.threshold = level
    return old

def set_verbosity(v):
    if v <= 0:
        set_threshold(WARN)
    elif v == 1:
        set_threshold(INFO)
    elif v >= 2:
        set_threshold(DEBUG)
distutils/versionpredicate.py000064400000012015151153537450012520 0ustar00"""Module for parsing and testing package version predicate strings.
"""
import re
import distutils.version
import operator


re_validPackage = re.compile(r"(?i)^\s*([a-z_]\w*(?:\.[a-z_]\w*)*)(.*)",
    re.ASCII)
# (package) (rest)

re_paren = re.compile(r"^\s*\((.*)\)\s*$") # (list) inside of parentheses
re_splitComparison = re.compile(r"^\s*(<=|>=|<|>|!=|==)\s*([^\s,]+)\s*$")
# (comp) (version)


def splitUp(pred):
    """Parse a single version comparison.

    Return (comparison string, StrictVersion)
    """
    res = re_splitComparison.match(pred)
    if not res:
        raise ValueError("bad package restriction syntax: %r" % pred)
    comp, verStr = res.groups()
    return (comp, distutils.version.StrictVersion(verStr))

compmap = {"<": operator.lt, "<=": operator.le, "==": operator.eq,
           ">": operator.gt, ">=": operator.ge, "!=": operator.ne}

class VersionPredicate:
    """Parse and test package version predicates.

    >>> v = VersionPredicate('pyepat.abc (>1.0, <3333.3a1, !=1555.1b3)')

    The `name` attribute provides the full dotted name that is given::

    >>> v.name
    'pyepat.abc'

    The str() of a `VersionPredicate` provides a normalized
    human-readable version of the expression::

    >>> print(v)
    pyepat.abc (> 1.0, < 3333.3a1, != 1555.1b3)

    The `satisfied_by()` method can be used to determine with a given
    version number is included in the set described by the version
    restrictions::

    >>> v.satisfied_by('1.1')
    True
    >>> v.satisfied_by('1.4')
    True
    >>> v.satisfied_by('1.0')
    False
    >>> v.satisfied_by('4444.4')
    False
    >>> v.satisfied_by('1555.1b3')
    False

    `VersionPredicate` is flexible in accepting extra whitespace::

    >>> v = VersionPredicate(' pat( ==  0.1  )  ')
    >>> v.name
    'pat'
    >>> v.satisfied_by('0.1')
    True
    >>> v.satisfied_by('0.2')
    False

    If any version numbers passed in do not conform to the
    restrictions of `StrictVersion`, a `ValueError` is raised::

    >>> v = VersionPredicate('p1.p2.p3.p4(>=1.0, <=1.3a1, !=1.2zb3)')
    Traceback (most recent call last):
      ...
    ValueError: invalid version number '1.2zb3'

    It the module or package name given does not conform to what's
    allowed as a legal module or package name, `ValueError` is
    raised::

    >>> v = VersionPredicate('foo-bar')
    Traceback (most recent call last):
      ...
    ValueError: expected parenthesized list: '-bar'

    >>> v = VersionPredicate('foo bar (12.21)')
    Traceback (most recent call last):
      ...
    ValueError: expected parenthesized list: 'bar (12.21)'

    """

    def __init__(self, versionPredicateStr):
        """Parse a version predicate string.
        """
        # Fields:
        #    name:  package name
        #    pred:  list of (comparison string, StrictVersion)

        versionPredicateStr = versionPredicateStr.strip()
        if not versionPredicateStr:
            raise ValueError("empty package restriction")
        match = re_validPackage.match(versionPredicateStr)
        if not match:
            raise ValueError("bad package name in %r" % versionPredicateStr)
        self.name, paren = match.groups()
        paren = paren.strip()
        if paren:
            match = re_paren.match(paren)
            if not match:
                raise ValueError("expected parenthesized list: %r" % paren)
            str = match.groups()[0]
            self.pred = [splitUp(aPred) for aPred in str.split(",")]
            if not self.pred:
                raise ValueError("empty parenthesized list in %r"
                                 % versionPredicateStr)
        else:
            self.pred = []

    def __str__(self):
        if self.pred:
            seq = [cond + " " + str(ver) for cond, ver in self.pred]
            return self.name + " (" + ", ".join(seq) + ")"
        else:
            return self.name

    def satisfied_by(self, version):
        """True if version is compatible with all the predicates in self.
        The parameter version must be acceptable to the StrictVersion
        constructor.  It may be either a string or StrictVersion.
        """
        for cond, ver in self.pred:
            if not compmap[cond](version, ver):
                return False
        return True


_provision_rx = None

def split_provision(value):
    """Return the name and optional version number of a provision.

    The version number, if given, will be returned as a `StrictVersion`
    instance, otherwise it will be `None`.

    >>> split_provision('mypkg')
    ('mypkg', None)
    >>> split_provision(' mypkg( 1.2 ) ')
    ('mypkg', StrictVersion ('1.2'))
    """
    global _provision_rx
    if _provision_rx is None:
        _provision_rx = re.compile(
            r"([a-zA-Z_]\w*(?:\.[a-zA-Z_]\w*)*)(?:\s*\(\s*([^)\s]+)\s*\))?$",
            re.ASCII)
    value = value.strip()
    m = _provision_rx.match(value)
    if not m:
        raise ValueError("illegal provides specification: %r" % value)
    ver = m.group(2) or None
    if ver:
        ver = distutils.version.StrictVersion(ver)
    return m.group(1), ver
turtle.py000064400000430544151153537450006460 0ustar00#
# turtle.py: a Tkinter based turtle graphics module for Python
# Version 1.1b - 4. 5. 2009
#
# Copyright (C) 2006 - 2010  Gregor Lingl
# email: glingl@aon.at
#
# This software is provided 'as-is', without any express or implied
# warranty.  In no event will the authors be held liable for any damages
# arising from the use of this software.
#
# Permission is granted to anyone to use this software for any purpose,
# including commercial applications, and to alter it and redistribute it
# freely, subject to the following restrictions:
#
# 1. The origin of this software must not be misrepresented; you must not
#    claim that you wrote the original software. If you use this software
#    in a product, an acknowledgment in the product documentation would be
#    appreciated but is not required.
# 2. Altered source versions must be plainly marked as such, and must not be
#    misrepresented as being the original software.
# 3. This notice may not be removed or altered from any source distribution.


"""
Turtle graphics is a popular way for introducing programming to
kids. It was part of the original Logo programming language developed
by Wally Feurzig and Seymour Papert in 1966.

Imagine a robotic turtle starting at (0, 0) in the x-y plane. After an ``import turtle``, give it
the command turtle.forward(15), and it moves (on-screen!) 15 pixels in
the direction it is facing, drawing a line as it moves. Give it the
command turtle.right(25), and it rotates in-place 25 degrees clockwise.

By combining together these and similar commands, intricate shapes and
pictures can easily be drawn.

----- turtle.py

This module is an extended reimplementation of turtle.py from the
Python standard distribution up to Python 2.5. (See: http://www.python.org)

It tries to keep the merits of turtle.py and to be (nearly) 100%
compatible with it. This means in the first place to enable the
learning programmer to use all the commands, classes and methods
interactively when using the module from within IDLE run with
the -n switch.

Roughly it has the following features added:

- Better animation of the turtle movements, especially of turning the
  turtle. So the turtles can more easily be used as a visual feedback
  instrument by the (beginning) programmer.

- Different turtle shapes, gif-images as turtle shapes, user defined
  and user controllable turtle shapes, among them compound
  (multicolored) shapes. Turtle shapes can be stretched and tilted, which
  makes turtles very versatile geometrical objects.

- Fine control over turtle movement and screen updates via delay(),
  and enhanced tracer() and speed() methods.

- Aliases for the most commonly used commands, like fd for forward etc.,
  following the early Logo traditions. This reduces the boring work of
  typing long sequences of commands, which often occur in a natural way
  when kids try to program fancy pictures on their first encounter with
  turtle graphics.

- Turtles now have an undo()-method with configurable undo-buffer.

- Some simple commands/methods for creating event driven programs
  (mouse-, key-, timer-events). Especially useful for programming games.

- A scrollable Canvas class. The default scrollable Canvas can be
  extended interactively as needed while playing around with the turtle(s).

- A TurtleScreen class with methods controlling background color or
  background image, window and canvas size and other properties of the
  TurtleScreen.

- There is a method, setworldcoordinates(), to install a user defined
  coordinate-system for the TurtleScreen.

- The implementation uses a 2-vector class named Vec2D, derived from tuple.
  This class is public, so it can be imported by the application programmer,
  which makes certain types of computations very natural and compact.

- Appearance of the TurtleScreen and the Turtles at startup/import can be
  configured by means of a turtle.cfg configuration file.
  The default configuration mimics the appearance of the old turtle module.

- If configured appropriately the module reads in docstrings from a docstring
  dictionary in some different language, supplied separately  and replaces
  the English ones by those read in. There is a utility function
  write_docstringdict() to write a dictionary with the original (English)
  docstrings to disc, so it can serve as a template for translations.

Behind the scenes there are some features included with possible
extensions in mind. These will be commented and documented elsewhere.

"""

_ver = "turtle 1.1b- - for Python 3.1   -  4. 5. 2009"

# print(_ver)

import tkinter as TK
import types
import math
import time
import inspect
import sys

from os.path import isfile, split, join
from copy import deepcopy
from tkinter import simpledialog

_tg_classes = ['ScrolledCanvas', 'TurtleScreen', 'Screen',
               'RawTurtle', 'Turtle', 'RawPen', 'Pen', 'Shape', 'Vec2D']
_tg_screen_functions = ['addshape', 'bgcolor', 'bgpic', 'bye',
        'clearscreen', 'colormode', 'delay', 'exitonclick', 'getcanvas',
        'getshapes', 'listen', 'mainloop', 'mode', 'numinput',
        'onkey', 'onkeypress', 'onkeyrelease', 'onscreenclick', 'ontimer',
        'register_shape', 'resetscreen', 'screensize', 'setup',
        'setworldcoordinates', 'textinput', 'title', 'tracer', 'turtles', 'update',
        'window_height', 'window_width']
_tg_turtle_functions = ['back', 'backward', 'begin_fill', 'begin_poly', 'bk',
        'circle', 'clear', 'clearstamp', 'clearstamps', 'clone', 'color',
        'degrees', 'distance', 'dot', 'down', 'end_fill', 'end_poly', 'fd',
        'fillcolor', 'filling', 'forward', 'get_poly', 'getpen', 'getscreen', 'get_shapepoly',
        'getturtle', 'goto', 'heading', 'hideturtle', 'home', 'ht', 'isdown',
        'isvisible', 'left', 'lt', 'onclick', 'ondrag', 'onrelease', 'pd',
        'pen', 'pencolor', 'pendown', 'pensize', 'penup', 'pos', 'position',
        'pu', 'radians', 'right', 'reset', 'resizemode', 'rt',
        'seth', 'setheading', 'setpos', 'setposition', 'settiltangle',
        'setundobuffer', 'setx', 'sety', 'shape', 'shapesize', 'shapetransform', 'shearfactor', 'showturtle',
        'speed', 'st', 'stamp', 'tilt', 'tiltangle', 'towards',
        'turtlesize', 'undo', 'undobufferentries', 'up', 'width',
        'write', 'xcor', 'ycor']
_tg_utilities = ['write_docstringdict', 'done']

__all__ = (_tg_classes + _tg_screen_functions + _tg_turtle_functions +
           _tg_utilities + ['Terminator']) # + _math_functions)

_alias_list = ['addshape', 'backward', 'bk', 'fd', 'ht', 'lt', 'pd', 'pos',
               'pu', 'rt', 'seth', 'setpos', 'setposition', 'st',
               'turtlesize', 'up', 'width']

_CFG = {"width" : 0.5,               # Screen
        "height" : 0.75,
        "canvwidth" : 400,
        "canvheight": 300,
        "leftright": None,
        "topbottom": None,
        "mode": "standard",          # TurtleScreen
        "colormode": 1.0,
        "delay": 10,
        "undobuffersize": 1000,      # RawTurtle
        "shape": "classic",
        "pencolor" : "black",
        "fillcolor" : "black",
        "resizemode" : "noresize",
        "visible" : True,
        "language": "english",        # docstrings
        "exampleturtle": "turtle",
        "examplescreen": "screen",
        "title": "Python Turtle Graphics",
        "using_IDLE": False
       }

def config_dict(filename):
    """Convert content of config-file into dictionary."""
    with open(filename, "r") as f:
        cfglines = f.readlines()
    cfgdict = {}
    for line in cfglines:
        line = line.strip()
        if not line or line.startswith("#"):
            continue
        try:
            key, value = line.split("=")
        except ValueError:
            print("Bad line in config-file %s:\n%s" % (filename,line))
            continue
        key = key.strip()
        value = value.strip()
        if value in ["True", "False", "None", "''", '""']:
            value = eval(value)
        else:
            try:
                if "." in value:
                    value = float(value)
                else:
                    value = int(value)
            except ValueError:
                pass # value need not be converted
        cfgdict[key] = value
    return cfgdict

def readconfig(cfgdict):
    """Read config-files, change configuration-dict accordingly.

    If there is a turtle.cfg file in the current working directory,
    read it from there. If this contains an importconfig-value,
    say 'myway', construct filename turtle_mayway.cfg else use
    turtle.cfg and read it from the import-directory, where
    turtle.py is located.
    Update configuration dictionary first according to config-file,
    in the import directory, then according to config-file in the
    current working directory.
    If no config-file is found, the default configuration is used.
    """
    default_cfg = "turtle.cfg"
    cfgdict1 = {}
    cfgdict2 = {}
    if isfile(default_cfg):
        cfgdict1 = config_dict(default_cfg)
    if "importconfig" in cfgdict1:
        default_cfg = "turtle_%s.cfg" % cfgdict1["importconfig"]
    try:
        head, tail = split(__file__)
        cfg_file2 = join(head, default_cfg)
    except Exception:
        cfg_file2 = ""
    if isfile(cfg_file2):
        cfgdict2 = config_dict(cfg_file2)
    _CFG.update(cfgdict2)
    _CFG.update(cfgdict1)

try:
    readconfig(_CFG)
except Exception:
    print ("No configfile read, reason unknown")


class Vec2D(tuple):
    """A 2 dimensional vector class, used as a helper class
    for implementing turtle graphics.
    May be useful for turtle graphics programs also.
    Derived from tuple, so a vector is a tuple!

    Provides (for a, b vectors, k number):
       a+b vector addition
       a-b vector subtraction
       a*b inner product
       k*a and a*k multiplication with scalar
       |a| absolute value of a
       a.rotate(angle) rotation
    """
    def __new__(cls, x, y):
        return tuple.__new__(cls, (x, y))
    def __add__(self, other):
        return Vec2D(self[0]+other[0], self[1]+other[1])
    def __mul__(self, other):
        if isinstance(other, Vec2D):
            return self[0]*other[0]+self[1]*other[1]
        return Vec2D(self[0]*other, self[1]*other)
    def __rmul__(self, other):
        if isinstance(other, int) or isinstance(other, float):
            return Vec2D(self[0]*other, self[1]*other)
        return NotImplemented
    def __sub__(self, other):
        return Vec2D(self[0]-other[0], self[1]-other[1])
    def __neg__(self):
        return Vec2D(-self[0], -self[1])
    def __abs__(self):
        return (self[0]**2 + self[1]**2)**0.5
    def rotate(self, angle):
        """rotate self counterclockwise by angle
        """
        perp = Vec2D(-self[1], self[0])
        angle = angle * math.pi / 180.0
        c, s = math.cos(angle), math.sin(angle)
        return Vec2D(self[0]*c+perp[0]*s, self[1]*c+perp[1]*s)
    def __getnewargs__(self):
        return (self[0], self[1])
    def __repr__(self):
        return "(%.2f,%.2f)" % self


##############################################################################
### From here up to line    : Tkinter - Interface for turtle.py            ###
### May be replaced by an interface to some different graphics toolkit     ###
##############################################################################

## helper functions for Scrolled Canvas, to forward Canvas-methods
## to ScrolledCanvas class

def __methodDict(cls, _dict):
    """helper function for Scrolled Canvas"""
    baseList = list(cls.__bases__)
    baseList.reverse()
    for _super in baseList:
        __methodDict(_super, _dict)
    for key, value in cls.__dict__.items():
        if type(value) == types.FunctionType:
            _dict[key] = value

def __methods(cls):
    """helper function for Scrolled Canvas"""
    _dict = {}
    __methodDict(cls, _dict)
    return _dict.keys()

__stringBody = (
    'def %(method)s(self, *args, **kw): return ' +
    'self.%(attribute)s.%(method)s(*args, **kw)')

def __forwardmethods(fromClass, toClass, toPart, exclude = ()):
    ### MANY CHANGES ###
    _dict_1 = {}
    __methodDict(toClass, _dict_1)
    _dict = {}
    mfc = __methods(fromClass)
    for ex in _dict_1.keys():
        if ex[:1] == '_' or ex[-1:] == '_' or ex in exclude or ex in mfc:
            pass
        else:
            _dict[ex] = _dict_1[ex]

    for method, func in _dict.items():
        d = {'method': method, 'func': func}
        if isinstance(toPart, str):
            execString = \
                __stringBody % {'method' : method, 'attribute' : toPart}
        exec(execString, d)
        setattr(fromClass, method, d[method])   ### NEWU!


class ScrolledCanvas(TK.Frame):
    """Modeled after the scrolled canvas class from Grayons's Tkinter book.

    Used as the default canvas, which pops up automatically when
    using turtle graphics functions or the Turtle class.
    """
    def __init__(self, master, width=500, height=350,
                                          canvwidth=600, canvheight=500):
        TK.Frame.__init__(self, master, width=width, height=height)
        self._rootwindow = self.winfo_toplevel()
        self.width, self.height = width, height
        self.canvwidth, self.canvheight = canvwidth, canvheight
        self.bg = "white"
        self._canvas = TK.Canvas(master, width=width, height=height,
                                 bg=self.bg, relief=TK.SUNKEN, borderwidth=2)
        self.hscroll = TK.Scrollbar(master, command=self._canvas.xview,
                                    orient=TK.HORIZONTAL)
        self.vscroll = TK.Scrollbar(master, command=self._canvas.yview)
        self._canvas.configure(xscrollcommand=self.hscroll.set,
                               yscrollcommand=self.vscroll.set)
        self.rowconfigure(0, weight=1, minsize=0)
        self.columnconfigure(0, weight=1, minsize=0)
        self._canvas.grid(padx=1, in_ = self, pady=1, row=0,
                column=0, rowspan=1, columnspan=1, sticky='news')
        self.vscroll.grid(padx=1, in_ = self, pady=1, row=0,
                column=1, rowspan=1, columnspan=1, sticky='news')
        self.hscroll.grid(padx=1, in_ = self, pady=1, row=1,
                column=0, rowspan=1, columnspan=1, sticky='news')
        self.reset()
        self._rootwindow.bind('<Configure>', self.onResize)

    def reset(self, canvwidth=None, canvheight=None, bg = None):
        """Adjust canvas and scrollbars according to given canvas size."""
        if canvwidth:
            self.canvwidth = canvwidth
        if canvheight:
            self.canvheight = canvheight
        if bg:
            self.bg = bg
        self._canvas.config(bg=bg,
                        scrollregion=(-self.canvwidth//2, -self.canvheight//2,
                                       self.canvwidth//2, self.canvheight//2))
        self._canvas.xview_moveto(0.5*(self.canvwidth - self.width + 30) /
                                                               self.canvwidth)
        self._canvas.yview_moveto(0.5*(self.canvheight- self.height + 30) /
                                                              self.canvheight)
        self.adjustScrolls()


    def adjustScrolls(self):
        """ Adjust scrollbars according to window- and canvas-size.
        """
        cwidth = self._canvas.winfo_width()
        cheight = self._canvas.winfo_height()
        self._canvas.xview_moveto(0.5*(self.canvwidth-cwidth)/self.canvwidth)
        self._canvas.yview_moveto(0.5*(self.canvheight-cheight)/self.canvheight)
        if cwidth < self.canvwidth or cheight < self.canvheight:
            self.hscroll.grid(padx=1, in_ = self, pady=1, row=1,
                              column=0, rowspan=1, columnspan=1, sticky='news')
            self.vscroll.grid(padx=1, in_ = self, pady=1, row=0,
                              column=1, rowspan=1, columnspan=1, sticky='news')
        else:
            self.hscroll.grid_forget()
            self.vscroll.grid_forget()

    def onResize(self, event):
        """self-explanatory"""
        self.adjustScrolls()

    def bbox(self, *args):
        """ 'forward' method, which canvas itself has inherited...
        """
        return self._canvas.bbox(*args)

    def cget(self, *args, **kwargs):
        """ 'forward' method, which canvas itself has inherited...
        """
        return self._canvas.cget(*args, **kwargs)

    def config(self, *args, **kwargs):
        """ 'forward' method, which canvas itself has inherited...
        """
        self._canvas.config(*args, **kwargs)

    def bind(self, *args, **kwargs):
        """ 'forward' method, which canvas itself has inherited...
        """
        self._canvas.bind(*args, **kwargs)

    def unbind(self, *args, **kwargs):
        """ 'forward' method, which canvas itself has inherited...
        """
        self._canvas.unbind(*args, **kwargs)

    def focus_force(self):
        """ 'forward' method, which canvas itself has inherited...
        """
        self._canvas.focus_force()

__forwardmethods(ScrolledCanvas, TK.Canvas, '_canvas')


class _Root(TK.Tk):
    """Root class for Screen based on Tkinter."""
    def __init__(self):
        TK.Tk.__init__(self)

    def setupcanvas(self, width, height, cwidth, cheight):
        self._canvas = ScrolledCanvas(self, width, height, cwidth, cheight)
        self._canvas.pack(expand=1, fill="both")

    def _getcanvas(self):
        return self._canvas

    def set_geometry(self, width, height, startx, starty):
        self.geometry("%dx%d%+d%+d"%(width, height, startx, starty))

    def ondestroy(self, destroy):
        self.wm_protocol("WM_DELETE_WINDOW", destroy)

    def win_width(self):
        return self.winfo_screenwidth()

    def win_height(self):
        return self.winfo_screenheight()

Canvas = TK.Canvas


class TurtleScreenBase(object):
    """Provide the basic graphics functionality.
       Interface between Tkinter and turtle.py.

       To port turtle.py to some different graphics toolkit
       a corresponding TurtleScreenBase class has to be implemented.
    """

    def _blankimage(self):
        """return a blank image object
        """
        img = TK.PhotoImage(width=1, height=1, master=self.cv)
        img.blank()
        return img

    def _image(self, filename):
        """return an image object containing the
        imagedata from a gif-file named filename.
        """
        return TK.PhotoImage(file=filename, master=self.cv)

    def __init__(self, cv):
        self.cv = cv
        if isinstance(cv, ScrolledCanvas):
            w = self.cv.canvwidth
            h = self.cv.canvheight
        else:  # expected: ordinary TK.Canvas
            w = int(self.cv.cget("width"))
            h = int(self.cv.cget("height"))
            self.cv.config(scrollregion = (-w//2, -h//2, w//2, h//2 ))
        self.canvwidth = w
        self.canvheight = h
        self.xscale = self.yscale = 1.0

    def _createpoly(self):
        """Create an invisible polygon item on canvas self.cv)
        """
        return self.cv.create_polygon((0, 0, 0, 0, 0, 0), fill="", outline="")

    def _drawpoly(self, polyitem, coordlist, fill=None,
                  outline=None, width=None, top=False):
        """Configure polygonitem polyitem according to provided
        arguments:
        coordlist is sequence of coordinates
        fill is filling color
        outline is outline color
        top is a boolean value, which specifies if polyitem
        will be put on top of the canvas' displaylist so it
        will not be covered by other items.
        """
        cl = []
        for x, y in coordlist:
            cl.append(x * self.xscale)
            cl.append(-y * self.yscale)
        self.cv.coords(polyitem, *cl)
        if fill is not None:
            self.cv.itemconfigure(polyitem, fill=fill)
        if outline is not None:
            self.cv.itemconfigure(polyitem, outline=outline)
        if width is not None:
            self.cv.itemconfigure(polyitem, width=width)
        if top:
            self.cv.tag_raise(polyitem)

    def _createline(self):
        """Create an invisible line item on canvas self.cv)
        """
        return self.cv.create_line(0, 0, 0, 0, fill="", width=2,
                                   capstyle = TK.ROUND)

    def _drawline(self, lineitem, coordlist=None,
                  fill=None, width=None, top=False):
        """Configure lineitem according to provided arguments:
        coordlist is sequence of coordinates
        fill is drawing color
        width is width of drawn line.
        top is a boolean value, which specifies if polyitem
        will be put on top of the canvas' displaylist so it
        will not be covered by other items.
        """
        if coordlist is not None:
            cl = []
            for x, y in coordlist:
                cl.append(x * self.xscale)
                cl.append(-y * self.yscale)
            self.cv.coords(lineitem, *cl)
        if fill is not None:
            self.cv.itemconfigure(lineitem, fill=fill)
        if width is not None:
            self.cv.itemconfigure(lineitem, width=width)
        if top:
            self.cv.tag_raise(lineitem)

    def _delete(self, item):
        """Delete graphics item from canvas.
        If item is"all" delete all graphics items.
        """
        self.cv.delete(item)

    def _update(self):
        """Redraw graphics items on canvas
        """
        self.cv.update()

    def _delay(self, delay):
        """Delay subsequent canvas actions for delay ms."""
        self.cv.after(delay)

    def _iscolorstring(self, color):
        """Check if the string color is a legal Tkinter color string.
        """
        try:
            rgb = self.cv.winfo_rgb(color)
            ok = True
        except TK.TclError:
            ok = False
        return ok

    def _bgcolor(self, color=None):
        """Set canvas' backgroundcolor if color is not None,
        else return backgroundcolor."""
        if color is not None:
            self.cv.config(bg = color)
            self._update()
        else:
            return self.cv.cget("bg")

    def _write(self, pos, txt, align, font, pencolor):
        """Write txt at pos in canvas with specified font
        and color.
        Return text item and x-coord of right bottom corner
        of text's bounding box."""
        x, y = pos
        x = x * self.xscale
        y = y * self.yscale
        anchor = {"left":"sw", "center":"s", "right":"se" }
        item = self.cv.create_text(x-1, -y, text = txt, anchor = anchor[align],
                                        fill = pencolor, font = font)
        x0, y0, x1, y1 = self.cv.bbox(item)
        self.cv.update()
        return item, x1-1

##    def _dot(self, pos, size, color):
##        """may be implemented for some other graphics toolkit"""

    def _onclick(self, item, fun, num=1, add=None):
        """Bind fun to mouse-click event on turtle.
        fun must be a function with two arguments, the coordinates
        of the clicked point on the canvas.
        num, the number of the mouse-button defaults to 1
        """
        if fun is None:
            self.cv.tag_unbind(item, "<Button-%s>" % num)
        else:
            def eventfun(event):
                x, y = (self.cv.canvasx(event.x)/self.xscale,
                        -self.cv.canvasy(event.y)/self.yscale)
                fun(x, y)
            self.cv.tag_bind(item, "<Button-%s>" % num, eventfun, add)

    def _onrelease(self, item, fun, num=1, add=None):
        """Bind fun to mouse-button-release event on turtle.
        fun must be a function with two arguments, the coordinates
        of the point on the canvas where mouse button is released.
        num, the number of the mouse-button defaults to 1

        If a turtle is clicked, first _onclick-event will be performed,
        then _onscreensclick-event.
        """
        if fun is None:
            self.cv.tag_unbind(item, "<Button%s-ButtonRelease>" % num)
        else:
            def eventfun(event):
                x, y = (self.cv.canvasx(event.x)/self.xscale,
                        -self.cv.canvasy(event.y)/self.yscale)
                fun(x, y)
            self.cv.tag_bind(item, "<Button%s-ButtonRelease>" % num,
                             eventfun, add)

    def _ondrag(self, item, fun, num=1, add=None):
        """Bind fun to mouse-move-event (with pressed mouse button) on turtle.
        fun must be a function with two arguments, the coordinates of the
        actual mouse position on the canvas.
        num, the number of the mouse-button defaults to 1

        Every sequence of mouse-move-events on a turtle is preceded by a
        mouse-click event on that turtle.
        """
        if fun is None:
            self.cv.tag_unbind(item, "<Button%s-Motion>" % num)
        else:
            def eventfun(event):
                try:
                    x, y = (self.cv.canvasx(event.x)/self.xscale,
                           -self.cv.canvasy(event.y)/self.yscale)
                    fun(x, y)
                except Exception:
                    pass
            self.cv.tag_bind(item, "<Button%s-Motion>" % num, eventfun, add)

    def _onscreenclick(self, fun, num=1, add=None):
        """Bind fun to mouse-click event on canvas.
        fun must be a function with two arguments, the coordinates
        of the clicked point on the canvas.
        num, the number of the mouse-button defaults to 1

        If a turtle is clicked, first _onclick-event will be performed,
        then _onscreensclick-event.
        """
        if fun is None:
            self.cv.unbind("<Button-%s>" % num)
        else:
            def eventfun(event):
                x, y = (self.cv.canvasx(event.x)/self.xscale,
                        -self.cv.canvasy(event.y)/self.yscale)
                fun(x, y)
            self.cv.bind("<Button-%s>" % num, eventfun, add)

    def _onkeyrelease(self, fun, key):
        """Bind fun to key-release event of key.
        Canvas must have focus. See method listen
        """
        if fun is None:
            self.cv.unbind("<KeyRelease-%s>" % key, None)
        else:
            def eventfun(event):
                fun()
            self.cv.bind("<KeyRelease-%s>" % key, eventfun)

    def _onkeypress(self, fun, key=None):
        """If key is given, bind fun to key-press event of key.
        Otherwise bind fun to any key-press.
        Canvas must have focus. See method listen.
        """
        if fun is None:
            if key is None:
                self.cv.unbind("<KeyPress>", None)
            else:
                self.cv.unbind("<KeyPress-%s>" % key, None)
        else:
            def eventfun(event):
                fun()
            if key is None:
                self.cv.bind("<KeyPress>", eventfun)
            else:
                self.cv.bind("<KeyPress-%s>" % key, eventfun)

    def _listen(self):
        """Set focus on canvas (in order to collect key-events)
        """
        self.cv.focus_force()

    def _ontimer(self, fun, t):
        """Install a timer, which calls fun after t milliseconds.
        """
        if t == 0:
            self.cv.after_idle(fun)
        else:
            self.cv.after(t, fun)

    def _createimage(self, image):
        """Create and return image item on canvas.
        """
        return self.cv.create_image(0, 0, image=image)

    def _drawimage(self, item, pos, image):
        """Configure image item as to draw image object
        at position (x,y) on canvas)
        """
        x, y = pos
        self.cv.coords(item, (x * self.xscale, -y * self.yscale))
        self.cv.itemconfig(item, image=image)

    def _setbgpic(self, item, image):
        """Configure image item as to draw image object
        at center of canvas. Set item to the first item
        in the displaylist, so it will be drawn below
        any other item ."""
        self.cv.itemconfig(item, image=image)
        self.cv.tag_lower(item)

    def _type(self, item):
        """Return 'line' or 'polygon' or 'image' depending on
        type of item.
        """
        return self.cv.type(item)

    def _pointlist(self, item):
        """returns list of coordinate-pairs of points of item
        Example (for insiders):
        >>> from turtle import *
        >>> getscreen()._pointlist(getturtle().turtle._item)
        [(0.0, 9.9999999999999982), (0.0, -9.9999999999999982),
        (9.9999999999999982, 0.0)]
        >>> """
        cl = self.cv.coords(item)
        pl = [(cl[i], -cl[i+1]) for i in range(0, len(cl), 2)]
        return  pl

    def _setscrollregion(self, srx1, sry1, srx2, sry2):
        self.cv.config(scrollregion=(srx1, sry1, srx2, sry2))

    def _rescale(self, xscalefactor, yscalefactor):
        items = self.cv.find_all()
        for item in items:
            coordinates = list(self.cv.coords(item))
            newcoordlist = []
            while coordinates:
                x, y = coordinates[:2]
                newcoordlist.append(x * xscalefactor)
                newcoordlist.append(y * yscalefactor)
                coordinates = coordinates[2:]
            self.cv.coords(item, *newcoordlist)

    def _resize(self, canvwidth=None, canvheight=None, bg=None):
        """Resize the canvas the turtles are drawing on. Does
        not alter the drawing window.
        """
        # needs amendment
        if not isinstance(self.cv, ScrolledCanvas):
            return self.canvwidth, self.canvheight
        if canvwidth is canvheight is bg is None:
            return self.cv.canvwidth, self.cv.canvheight
        if canvwidth is not None:
            self.canvwidth = canvwidth
        if canvheight is not None:
            self.canvheight = canvheight
        self.cv.reset(canvwidth, canvheight, bg)

    def _window_size(self):
        """ Return the width and height of the turtle window.
        """
        width = self.cv.winfo_width()
        if width <= 1:  # the window isn't managed by a geometry manager
            width = self.cv['width']
        height = self.cv.winfo_height()
        if height <= 1: # the window isn't managed by a geometry manager
            height = self.cv['height']
        return width, height

    def mainloop(self):
        """Starts event loop - calling Tkinter's mainloop function.

        No argument.

        Must be last statement in a turtle graphics program.
        Must NOT be used if a script is run from within IDLE in -n mode
        (No subprocess) - for interactive use of turtle graphics.

        Example (for a TurtleScreen instance named screen):
        >>> screen.mainloop()

        """
        self.cv.tk.mainloop()

    def textinput(self, title, prompt):
        """Pop up a dialog window for input of a string.

        Arguments: title is the title of the dialog window,
        prompt is a text mostly describing what information to input.

        Return the string input
        If the dialog is canceled, return None.

        Example (for a TurtleScreen instance named screen):
        >>> screen.textinput("NIM", "Name of first player:")

        """
        return simpledialog.askstring(title, prompt, parent=self.cv)

    def numinput(self, title, prompt, default=None, minval=None, maxval=None):
        """Pop up a dialog window for input of a number.

        Arguments: title is the title of the dialog window,
        prompt is a text mostly describing what numerical information to input.
        default: default value
        minval: minimum value for input
        maxval: maximum value for input

        The number input must be in the range minval .. maxval if these are
        given. If not, a hint is issued and the dialog remains open for
        correction. Return the number input.
        If the dialog is canceled,  return None.

        Example (for a TurtleScreen instance named screen):
        >>> screen.numinput("Poker", "Your stakes:", 1000, minval=10, maxval=10000)

        """
        return simpledialog.askfloat(title, prompt, initialvalue=default,
                                     minvalue=minval, maxvalue=maxval,
                                     parent=self.cv)


##############################################################################
###                  End of Tkinter - interface                            ###
##############################################################################


class Terminator (Exception):
    """Will be raised in TurtleScreen.update, if _RUNNING becomes False.

    This stops execution of a turtle graphics script.
    Main purpose: use in the Demo-Viewer turtle.Demo.py.
    """
    pass


class TurtleGraphicsError(Exception):
    """Some TurtleGraphics Error
    """


class Shape(object):
    """Data structure modeling shapes.

    attribute _type is one of "polygon", "image", "compound"
    attribute _data is - depending on _type a poygon-tuple,
    an image or a list constructed using the addcomponent method.
    """
    def __init__(self, type_, data=None):
        self._type = type_
        if type_ == "polygon":
            if isinstance(data, list):
                data = tuple(data)
        elif type_ == "image":
            if isinstance(data, str):
                if data.lower().endswith(".gif") and isfile(data):
                    data = TurtleScreen._image(data)
                # else data assumed to be Photoimage
        elif type_ == "compound":
            data = []
        else:
            raise TurtleGraphicsError("There is no shape type %s" % type_)
        self._data = data

    def addcomponent(self, poly, fill, outline=None):
        """Add component to a shape of type compound.

        Arguments: poly is a polygon, i. e. a tuple of number pairs.
        fill is the fillcolor of the component,
        outline is the outline color of the component.

        call (for a Shapeobject namend s):
        --   s.addcomponent(((0,0), (10,10), (-10,10)), "red", "blue")

        Example:
        >>> poly = ((0,0),(10,-5),(0,10),(-10,-5))
        >>> s = Shape("compound")
        >>> s.addcomponent(poly, "red", "blue")
        >>> # .. add more components and then use register_shape()
        """
        if self._type != "compound":
            raise TurtleGraphicsError("Cannot add component to %s Shape"
                                                                % self._type)
        if outline is None:
            outline = fill
        self._data.append([poly, fill, outline])


class Tbuffer(object):
    """Ring buffer used as undobuffer for RawTurtle objects."""
    def __init__(self, bufsize=10):
        self.bufsize = bufsize
        self.buffer = [[None]] * bufsize
        self.ptr = -1
        self.cumulate = False
    def reset(self, bufsize=None):
        if bufsize is None:
            for i in range(self.bufsize):
                self.buffer[i] = [None]
        else:
            self.bufsize = bufsize
            self.buffer = [[None]] * bufsize
        self.ptr = -1
    def push(self, item):
        if self.bufsize > 0:
            if not self.cumulate:
                self.ptr = (self.ptr + 1) % self.bufsize
                self.buffer[self.ptr] = item
            else:
                self.buffer[self.ptr].append(item)
    def pop(self):
        if self.bufsize > 0:
            item = self.buffer[self.ptr]
            if item is None:
                return None
            else:
                self.buffer[self.ptr] = [None]
                self.ptr = (self.ptr - 1) % self.bufsize
                return (item)
    def nr_of_items(self):
        return self.bufsize - self.buffer.count([None])
    def __repr__(self):
        return str(self.buffer) + " " + str(self.ptr)



class TurtleScreen(TurtleScreenBase):
    """Provides screen oriented methods like setbg etc.

    Only relies upon the methods of TurtleScreenBase and NOT
    upon components of the underlying graphics toolkit -
    which is Tkinter in this case.
    """
    _RUNNING = True

    def __init__(self, cv, mode=_CFG["mode"],
                 colormode=_CFG["colormode"], delay=_CFG["delay"]):
        TurtleScreenBase.__init__(self, cv)

        self._shapes = {
                   "arrow" : Shape("polygon", ((-10,0), (10,0), (0,10))),
                  "turtle" : Shape("polygon", ((0,16), (-2,14), (-1,10), (-4,7),
                              (-7,9), (-9,8), (-6,5), (-7,1), (-5,-3), (-8,-6),
                              (-6,-8), (-4,-5), (0,-7), (4,-5), (6,-8), (8,-6),
                              (5,-3), (7,1), (6,5), (9,8), (7,9), (4,7), (1,10),
                              (2,14))),
                  "circle" : Shape("polygon", ((10,0), (9.51,3.09), (8.09,5.88),
                              (5.88,8.09), (3.09,9.51), (0,10), (-3.09,9.51),
                              (-5.88,8.09), (-8.09,5.88), (-9.51,3.09), (-10,0),
                              (-9.51,-3.09), (-8.09,-5.88), (-5.88,-8.09),
                              (-3.09,-9.51), (-0.00,-10.00), (3.09,-9.51),
                              (5.88,-8.09), (8.09,-5.88), (9.51,-3.09))),
                  "square" : Shape("polygon", ((10,-10), (10,10), (-10,10),
                              (-10,-10))),
                "triangle" : Shape("polygon", ((10,-5.77), (0,11.55),
                              (-10,-5.77))),
                  "classic": Shape("polygon", ((0,0),(-5,-9),(0,-7),(5,-9))),
                   "blank" : Shape("image", self._blankimage())
                  }

        self._bgpics = {"nopic" : ""}

        self._mode = mode
        self._delayvalue = delay
        self._colormode = _CFG["colormode"]
        self._keys = []
        self.clear()
        if sys.platform == 'darwin':
            # Force Turtle window to the front on OS X. This is needed because
            # the Turtle window will show behind the Terminal window when you
            # start the demo from the command line.
            rootwindow = cv.winfo_toplevel()
            rootwindow.call('wm', 'attributes', '.', '-topmost', '1')
            rootwindow.call('wm', 'attributes', '.', '-topmost', '0')

    def clear(self):
        """Delete all drawings and all turtles from the TurtleScreen.

        No argument.

        Reset empty TurtleScreen to its initial state: white background,
        no backgroundimage, no eventbindings and tracing on.

        Example (for a TurtleScreen instance named screen):
        >>> screen.clear()

        Note: this method is not available as function.
        """
        self._delayvalue = _CFG["delay"]
        self._colormode = _CFG["colormode"]
        self._delete("all")
        self._bgpic = self._createimage("")
        self._bgpicname = "nopic"
        self._tracing = 1
        self._updatecounter = 0
        self._turtles = []
        self.bgcolor("white")
        for btn in 1, 2, 3:
            self.onclick(None, btn)
        self.onkeypress(None)
        for key in self._keys[:]:
            self.onkey(None, key)
            self.onkeypress(None, key)
        Turtle._pen = None

    def mode(self, mode=None):
        """Set turtle-mode ('standard', 'logo' or 'world') and perform reset.

        Optional argument:
        mode -- one of the strings 'standard', 'logo' or 'world'

        Mode 'standard' is compatible with turtle.py.
        Mode 'logo' is compatible with most Logo-Turtle-Graphics.
        Mode 'world' uses userdefined 'worldcoordinates'. *Attention*: in
        this mode angles appear distorted if x/y unit-ratio doesn't equal 1.
        If mode is not given, return the current mode.

             Mode      Initial turtle heading     positive angles
         ------------|-------------------------|-------------------
          'standard'    to the right (east)       counterclockwise
            'logo'        upward    (north)         clockwise

        Examples:
        >>> mode('logo')   # resets turtle heading to north
        >>> mode()
        'logo'
        """
        if mode is None:
            return self._mode
        mode = mode.lower()
        if mode not in ["standard", "logo", "world"]:
            raise TurtleGraphicsError("No turtle-graphics-mode %s" % mode)
        self._mode = mode
        if mode in ["standard", "logo"]:
            self._setscrollregion(-self.canvwidth//2, -self.canvheight//2,
                                       self.canvwidth//2, self.canvheight//2)
            self.xscale = self.yscale = 1.0
        self.reset()

    def setworldcoordinates(self, llx, lly, urx, ury):
        """Set up a user defined coordinate-system.

        Arguments:
        llx -- a number, x-coordinate of lower left corner of canvas
        lly -- a number, y-coordinate of lower left corner of canvas
        urx -- a number, x-coordinate of upper right corner of canvas
        ury -- a number, y-coordinate of upper right corner of canvas

        Set up user coodinat-system and switch to mode 'world' if necessary.
        This performs a screen.reset. If mode 'world' is already active,
        all drawings are redrawn according to the new coordinates.

        But ATTENTION: in user-defined coordinatesystems angles may appear
        distorted. (see Screen.mode())

        Example (for a TurtleScreen instance named screen):
        >>> screen.setworldcoordinates(-10,-0.5,50,1.5)
        >>> for _ in range(36):
        ...     left(10)
        ...     forward(0.5)
        """
        if self.mode() != "world":
            self.mode("world")
        xspan = float(urx - llx)
        yspan = float(ury - lly)
        wx, wy = self._window_size()
        self.screensize(wx-20, wy-20)
        oldxscale, oldyscale = self.xscale, self.yscale
        self.xscale = self.canvwidth / xspan
        self.yscale = self.canvheight / yspan
        srx1 = llx * self.xscale
        sry1 = -ury * self.yscale
        srx2 = self.canvwidth + srx1
        sry2 = self.canvheight + sry1
        self._setscrollregion(srx1, sry1, srx2, sry2)
        self._rescale(self.xscale/oldxscale, self.yscale/oldyscale)
        self.update()

    def register_shape(self, name, shape=None):
        """Adds a turtle shape to TurtleScreen's shapelist.

        Arguments:
        (1) name is the name of a gif-file and shape is None.
            Installs the corresponding image shape.
            !! Image-shapes DO NOT rotate when turning the turtle,
            !! so they do not display the heading of the turtle!
        (2) name is an arbitrary string and shape is a tuple
            of pairs of coordinates. Installs the corresponding
            polygon shape
        (3) name is an arbitrary string and shape is a
            (compound) Shape object. Installs the corresponding
            compound shape.
        To use a shape, you have to issue the command shape(shapename).

        call: register_shape("turtle.gif")
        --or: register_shape("tri", ((0,0), (10,10), (-10,10)))

        Example (for a TurtleScreen instance named screen):
        >>> screen.register_shape("triangle", ((5,-3),(0,5),(-5,-3)))

        """
        if shape is None:
            # image
            if name.lower().endswith(".gif"):
                shape = Shape("image", self._image(name))
            else:
                raise TurtleGraphicsError("Bad arguments for register_shape.\n"
                                          + "Use  help(register_shape)" )
        elif isinstance(shape, tuple):
            shape = Shape("polygon", shape)
        ## else shape assumed to be Shape-instance
        self._shapes[name] = shape

    def _colorstr(self, color):
        """Return color string corresponding to args.

        Argument may be a string or a tuple of three
        numbers corresponding to actual colormode,
        i.e. in the range 0<=n<=colormode.

        If the argument doesn't represent a color,
        an error is raised.
        """
        if len(color) == 1:
            color = color[0]
        if isinstance(color, str):
            if self._iscolorstring(color) or color == "":
                return color
            else:
                raise TurtleGraphicsError("bad color string: %s" % str(color))
        try:
            r, g, b = color
        except (TypeError, ValueError):
            raise TurtleGraphicsError("bad color arguments: %s" % str(color))
        if self._colormode == 1.0:
            r, g, b = [round(255.0*x) for x in (r, g, b)]
        if not ((0 <= r <= 255) and (0 <= g <= 255) and (0 <= b <= 255)):
            raise TurtleGraphicsError("bad color sequence: %s" % str(color))
        return "#%02x%02x%02x" % (r, g, b)

    def _color(self, cstr):
        if not cstr.startswith("#"):
            return cstr
        if len(cstr) == 7:
            cl = [int(cstr[i:i+2], 16) for i in (1, 3, 5)]
        elif len(cstr) == 4:
            cl = [16*int(cstr[h], 16) for h in cstr[1:]]
        else:
            raise TurtleGraphicsError("bad colorstring: %s" % cstr)
        return tuple(c * self._colormode/255 for c in cl)

    def colormode(self, cmode=None):
        """Return the colormode or set it to 1.0 or 255.

        Optional argument:
        cmode -- one of the values 1.0 or 255

        r, g, b values of colortriples have to be in range 0..cmode.

        Example (for a TurtleScreen instance named screen):
        >>> screen.colormode()
        1.0
        >>> screen.colormode(255)
        >>> pencolor(240,160,80)
        """
        if cmode is None:
            return self._colormode
        if cmode == 1.0:
            self._colormode = float(cmode)
        elif cmode == 255:
            self._colormode = int(cmode)

    def reset(self):
        """Reset all Turtles on the Screen to their initial state.

        No argument.

        Example (for a TurtleScreen instance named screen):
        >>> screen.reset()
        """
        for turtle in self._turtles:
            turtle._setmode(self._mode)
            turtle.reset()

    def turtles(self):
        """Return the list of turtles on the screen.

        Example (for a TurtleScreen instance named screen):
        >>> screen.turtles()
        [<turtle.Turtle object at 0x00E11FB0>]
        """
        return self._turtles

    def bgcolor(self, *args):
        """Set or return backgroundcolor of the TurtleScreen.

        Arguments (if given): a color string or three numbers
        in the range 0..colormode or a 3-tuple of such numbers.

        Example (for a TurtleScreen instance named screen):
        >>> screen.bgcolor("orange")
        >>> screen.bgcolor()
        'orange'
        >>> screen.bgcolor(0.5,0,0.5)
        >>> screen.bgcolor()
        '#800080'
        """
        if args:
            color = self._colorstr(args)
        else:
            color = None
        color = self._bgcolor(color)
        if color is not None:
            color = self._color(color)
        return color

    def tracer(self, n=None, delay=None):
        """Turns turtle animation on/off and set delay for update drawings.

        Optional arguments:
        n -- nonnegative  integer
        delay -- nonnegative  integer

        If n is given, only each n-th regular screen update is really performed.
        (Can be used to accelerate the drawing of complex graphics.)
        Second arguments sets delay value (see RawTurtle.delay())

        Example (for a TurtleScreen instance named screen):
        >>> screen.tracer(8, 25)
        >>> dist = 2
        >>> for i in range(200):
        ...     fd(dist)
        ...     rt(90)
        ...     dist += 2
        """
        if n is None:
            return self._tracing
        self._tracing = int(n)
        self._updatecounter = 0
        if delay is not None:
            self._delayvalue = int(delay)
        if self._tracing:
            self.update()

    def delay(self, delay=None):
        """ Return or set the drawing delay in milliseconds.

        Optional argument:
        delay -- positive integer

        Example (for a TurtleScreen instance named screen):
        >>> screen.delay(15)
        >>> screen.delay()
        15
        """
        if delay is None:
            return self._delayvalue
        self._delayvalue = int(delay)

    def _incrementudc(self):
        """Increment update counter."""
        if not TurtleScreen._RUNNING:
            TurtleScreen._RUNNING = True
            raise Terminator
        if self._tracing > 0:
            self._updatecounter += 1
            self._updatecounter %= self._tracing

    def update(self):
        """Perform a TurtleScreen update.
        """
        tracing = self._tracing
        self._tracing = True
        for t in self.turtles():
            t._update_data()
            t._drawturtle()
        self._tracing = tracing
        self._update()

    def window_width(self):
        """ Return the width of the turtle window.

        Example (for a TurtleScreen instance named screen):
        >>> screen.window_width()
        640
        """
        return self._window_size()[0]

    def window_height(self):
        """ Return the height of the turtle window.

        Example (for a TurtleScreen instance named screen):
        >>> screen.window_height()
        480
        """
        return self._window_size()[1]

    def getcanvas(self):
        """Return the Canvas of this TurtleScreen.

        No argument.

        Example (for a Screen instance named screen):
        >>> cv = screen.getcanvas()
        >>> cv
        <turtle.ScrolledCanvas instance at 0x010742D8>
        """
        return self.cv

    def getshapes(self):
        """Return a list of names of all currently available turtle shapes.

        No argument.

        Example (for a TurtleScreen instance named screen):
        >>> screen.getshapes()
        ['arrow', 'blank', 'circle', ... , 'turtle']
        """
        return sorted(self._shapes.keys())

    def onclick(self, fun, btn=1, add=None):
        """Bind fun to mouse-click event on canvas.

        Arguments:
        fun -- a function with two arguments, the coordinates of the
               clicked point on the canvas.
        btn -- the number of the mouse-button, defaults to 1

        Example (for a TurtleScreen instance named screen)

        >>> screen.onclick(goto)
        >>> # Subsequently clicking into the TurtleScreen will
        >>> # make the turtle move to the clicked point.
        >>> screen.onclick(None)
        """
        self._onscreenclick(fun, btn, add)

    def onkey(self, fun, key):
        """Bind fun to key-release event of key.

        Arguments:
        fun -- a function with no arguments
        key -- a string: key (e.g. "a") or key-symbol (e.g. "space")

        In order to be able to register key-events, TurtleScreen
        must have focus. (See method listen.)

        Example (for a TurtleScreen instance named screen):

        >>> def f():
        ...     fd(50)
        ...     lt(60)
        ...
        >>> screen.onkey(f, "Up")
        >>> screen.listen()

        Subsequently the turtle can be moved by repeatedly pressing
        the up-arrow key, consequently drawing a hexagon

        """
        if fun is None:
            if key in self._keys:
                self._keys.remove(key)
        elif key not in self._keys:
            self._keys.append(key)
        self._onkeyrelease(fun, key)

    def onkeypress(self, fun, key=None):
        """Bind fun to key-press event of key if key is given,
        or to any key-press-event if no key is given.

        Arguments:
        fun -- a function with no arguments
        key -- a string: key (e.g. "a") or key-symbol (e.g. "space")

        In order to be able to register key-events, TurtleScreen
        must have focus. (See method listen.)

        Example (for a TurtleScreen instance named screen
        and a Turtle instance named turtle):

        >>> def f():
        ...     fd(50)
        ...     lt(60)
        ...
        >>> screen.onkeypress(f, "Up")
        >>> screen.listen()

        Subsequently the turtle can be moved by repeatedly pressing
        the up-arrow key, or by keeping pressed the up-arrow key.
        consequently drawing a hexagon.
        """
        if fun is None:
            if key in self._keys:
                self._keys.remove(key)
        elif key is not None and key not in self._keys:
            self._keys.append(key)
        self._onkeypress(fun, key)

    def listen(self, xdummy=None, ydummy=None):
        """Set focus on TurtleScreen (in order to collect key-events)

        No arguments.
        Dummy arguments are provided in order
        to be able to pass listen to the onclick method.

        Example (for a TurtleScreen instance named screen):
        >>> screen.listen()
        """
        self._listen()

    def ontimer(self, fun, t=0):
        """Install a timer, which calls fun after t milliseconds.

        Arguments:
        fun -- a function with no arguments.
        t -- a number >= 0

        Example (for a TurtleScreen instance named screen):

        >>> running = True
        >>> def f():
        ...     if running:
        ...             fd(50)
        ...             lt(60)
        ...             screen.ontimer(f, 250)
        ...
        >>> f()   # makes the turtle marching around
        >>> running = False
        """
        self._ontimer(fun, t)

    def bgpic(self, picname=None):
        """Set background image or return name of current backgroundimage.

        Optional argument:
        picname -- a string, name of a gif-file or "nopic".

        If picname is a filename, set the corresponding image as background.
        If picname is "nopic", delete backgroundimage, if present.
        If picname is None, return the filename of the current backgroundimage.

        Example (for a TurtleScreen instance named screen):
        >>> screen.bgpic()
        'nopic'
        >>> screen.bgpic("landscape.gif")
        >>> screen.bgpic()
        'landscape.gif'
        """
        if picname is None:
            return self._bgpicname
        if picname not in self._bgpics:
            self._bgpics[picname] = self._image(picname)
        self._setbgpic(self._bgpic, self._bgpics[picname])
        self._bgpicname = picname

    def screensize(self, canvwidth=None, canvheight=None, bg=None):
        """Resize the canvas the turtles are drawing on.

        Optional arguments:
        canvwidth -- positive integer, new width of canvas in pixels
        canvheight --  positive integer, new height of canvas in pixels
        bg -- colorstring or color-tuple, new backgroundcolor
        If no arguments are given, return current (canvaswidth, canvasheight)

        Do not alter the drawing window. To observe hidden parts of
        the canvas use the scrollbars. (Can make visible those parts
        of a drawing, which were outside the canvas before!)

        Example (for a Turtle instance named turtle):
        >>> turtle.screensize(2000,1500)
        >>> # e.g. to search for an erroneously escaped turtle ;-)
        """
        return self._resize(canvwidth, canvheight, bg)

    onscreenclick = onclick
    resetscreen = reset
    clearscreen = clear
    addshape = register_shape
    onkeyrelease = onkey

class TNavigator(object):
    """Navigation part of the RawTurtle.
    Implements methods for turtle movement.
    """
    START_ORIENTATION = {
        "standard": Vec2D(1.0, 0.0),
        "world"   : Vec2D(1.0, 0.0),
        "logo"    : Vec2D(0.0, 1.0)  }
    DEFAULT_MODE = "standard"
    DEFAULT_ANGLEOFFSET = 0
    DEFAULT_ANGLEORIENT = 1

    def __init__(self, mode=DEFAULT_MODE):
        self._angleOffset = self.DEFAULT_ANGLEOFFSET
        self._angleOrient = self.DEFAULT_ANGLEORIENT
        self._mode = mode
        self.undobuffer = None
        self.degrees()
        self._mode = None
        self._setmode(mode)
        TNavigator.reset(self)

    def reset(self):
        """reset turtle to its initial values

        Will be overwritten by parent class
        """
        self._position = Vec2D(0.0, 0.0)
        self._orient =  TNavigator.START_ORIENTATION[self._mode]

    def _setmode(self, mode=None):
        """Set turtle-mode to 'standard', 'world' or 'logo'.
        """
        if mode is None:
            return self._mode
        if mode not in ["standard", "logo", "world"]:
            return
        self._mode = mode
        if mode in ["standard", "world"]:
            self._angleOffset = 0
            self._angleOrient = 1
        else: # mode == "logo":
            self._angleOffset = self._fullcircle/4.
            self._angleOrient = -1

    def _setDegreesPerAU(self, fullcircle):
        """Helper function for degrees() and radians()"""
        self._fullcircle = fullcircle
        self._degreesPerAU = 360/fullcircle
        if self._mode == "standard":
            self._angleOffset = 0
        else:
            self._angleOffset = fullcircle/4.

    def degrees(self, fullcircle=360.0):
        """ Set angle measurement units to degrees.

        Optional argument:
        fullcircle -  a number

        Set angle measurement units, i. e. set number
        of 'degrees' for a full circle. Default value is
        360 degrees.

        Example (for a Turtle instance named turtle):
        >>> turtle.left(90)
        >>> turtle.heading()
        90

        Change angle measurement unit to grad (also known as gon,
        grade, or gradian and equals 1/100-th of the right angle.)
        >>> turtle.degrees(400.0)
        >>> turtle.heading()
        100

        """
        self._setDegreesPerAU(fullcircle)

    def radians(self):
        """ Set the angle measurement units to radians.

        No arguments.

        Example (for a Turtle instance named turtle):
        >>> turtle.heading()
        90
        >>> turtle.radians()
        >>> turtle.heading()
        1.5707963267948966
        """
        self._setDegreesPerAU(2*math.pi)

    def _go(self, distance):
        """move turtle forward by specified distance"""
        ende = self._position + self._orient * distance
        self._goto(ende)

    def _rotate(self, angle):
        """Turn turtle counterclockwise by specified angle if angle > 0."""
        angle *= self._degreesPerAU
        self._orient = self._orient.rotate(angle)

    def _goto(self, end):
        """move turtle to position end."""
        self._position = end

    def forward(self, distance):
        """Move the turtle forward by the specified distance.

        Aliases: forward | fd

        Argument:
        distance -- a number (integer or float)

        Move the turtle forward by the specified distance, in the direction
        the turtle is headed.

        Example (for a Turtle instance named turtle):
        >>> turtle.position()
        (0.00, 0.00)
        >>> turtle.forward(25)
        >>> turtle.position()
        (25.00,0.00)
        >>> turtle.forward(-75)
        >>> turtle.position()
        (-50.00,0.00)
        """
        self._go(distance)

    def back(self, distance):
        """Move the turtle backward by distance.

        Aliases: back | backward | bk

        Argument:
        distance -- a number

        Move the turtle backward by distance, opposite to the direction the
        turtle is headed. Do not change the turtle's heading.

        Example (for a Turtle instance named turtle):
        >>> turtle.position()
        (0.00, 0.00)
        >>> turtle.backward(30)
        >>> turtle.position()
        (-30.00, 0.00)
        """
        self._go(-distance)

    def right(self, angle):
        """Turn turtle right by angle units.

        Aliases: right | rt

        Argument:
        angle -- a number (integer or float)

        Turn turtle right by angle units. (Units are by default degrees,
        but can be set via the degrees() and radians() functions.)
        Angle orientation depends on mode. (See this.)

        Example (for a Turtle instance named turtle):
        >>> turtle.heading()
        22.0
        >>> turtle.right(45)
        >>> turtle.heading()
        337.0
        """
        self._rotate(-angle)

    def left(self, angle):
        """Turn turtle left by angle units.

        Aliases: left | lt

        Argument:
        angle -- a number (integer or float)

        Turn turtle left by angle units. (Units are by default degrees,
        but can be set via the degrees() and radians() functions.)
        Angle orientation depends on mode. (See this.)

        Example (for a Turtle instance named turtle):
        >>> turtle.heading()
        22.0
        >>> turtle.left(45)
        >>> turtle.heading()
        67.0
        """
        self._rotate(angle)

    def pos(self):
        """Return the turtle's current location (x,y), as a Vec2D-vector.

        Aliases: pos | position

        No arguments.

        Example (for a Turtle instance named turtle):
        >>> turtle.pos()
        (0.00, 240.00)
        """
        return self._position

    def xcor(self):
        """ Return the turtle's x coordinate.

        No arguments.

        Example (for a Turtle instance named turtle):
        >>> reset()
        >>> turtle.left(60)
        >>> turtle.forward(100)
        >>> print turtle.xcor()
        50.0
        """
        return self._position[0]

    def ycor(self):
        """ Return the turtle's y coordinate
        ---
        No arguments.

        Example (for a Turtle instance named turtle):
        >>> reset()
        >>> turtle.left(60)
        >>> turtle.forward(100)
        >>> print turtle.ycor()
        86.6025403784
        """
        return self._position[1]


    def goto(self, x, y=None):
        """Move turtle to an absolute position.

        Aliases: setpos | setposition | goto:

        Arguments:
        x -- a number      or     a pair/vector of numbers
        y -- a number             None

        call: goto(x, y)         # two coordinates
        --or: goto((x, y))       # a pair (tuple) of coordinates
        --or: goto(vec)          # e.g. as returned by pos()

        Move turtle to an absolute position. If the pen is down,
        a line will be drawn. The turtle's orientation does not change.

        Example (for a Turtle instance named turtle):
        >>> tp = turtle.pos()
        >>> tp
        (0.00, 0.00)
        >>> turtle.setpos(60,30)
        >>> turtle.pos()
        (60.00,30.00)
        >>> turtle.setpos((20,80))
        >>> turtle.pos()
        (20.00,80.00)
        >>> turtle.setpos(tp)
        >>> turtle.pos()
        (0.00,0.00)
        """
        if y is None:
            self._goto(Vec2D(*x))
        else:
            self._goto(Vec2D(x, y))

    def home(self):
        """Move turtle to the origin - coordinates (0,0).

        No arguments.

        Move turtle to the origin - coordinates (0,0) and set its
        heading to its start-orientation (which depends on mode).

        Example (for a Turtle instance named turtle):
        >>> turtle.home()
        """
        self.goto(0, 0)
        self.setheading(0)

    def setx(self, x):
        """Set the turtle's first coordinate to x

        Argument:
        x -- a number (integer or float)

        Set the turtle's first coordinate to x, leave second coordinate
        unchanged.

        Example (for a Turtle instance named turtle):
        >>> turtle.position()
        (0.00, 240.00)
        >>> turtle.setx(10)
        >>> turtle.position()
        (10.00, 240.00)
        """
        self._goto(Vec2D(x, self._position[1]))

    def sety(self, y):
        """Set the turtle's second coordinate to y

        Argument:
        y -- a number (integer or float)

        Set the turtle's first coordinate to x, second coordinate remains
        unchanged.

        Example (for a Turtle instance named turtle):
        >>> turtle.position()
        (0.00, 40.00)
        >>> turtle.sety(-10)
        >>> turtle.position()
        (0.00, -10.00)
        """
        self._goto(Vec2D(self._position[0], y))

    def distance(self, x, y=None):
        """Return the distance from the turtle to (x,y) in turtle step units.

        Arguments:
        x -- a number   or  a pair/vector of numbers   or   a turtle instance
        y -- a number       None                            None

        call: distance(x, y)         # two coordinates
        --or: distance((x, y))       # a pair (tuple) of coordinates
        --or: distance(vec)          # e.g. as returned by pos()
        --or: distance(mypen)        # where mypen is another turtle

        Example (for a Turtle instance named turtle):
        >>> turtle.pos()
        (0.00, 0.00)
        >>> turtle.distance(30,40)
        50.0
        >>> pen = Turtle()
        >>> pen.forward(77)
        >>> turtle.distance(pen)
        77.0
        """
        if y is not None:
            pos = Vec2D(x, y)
        if isinstance(x, Vec2D):
            pos = x
        elif isinstance(x, tuple):
            pos = Vec2D(*x)
        elif isinstance(x, TNavigator):
            pos = x._position
        return abs(pos - self._position)

    def towards(self, x, y=None):
        """Return the angle of the line from the turtle's position to (x, y).

        Arguments:
        x -- a number   or  a pair/vector of numbers   or   a turtle instance
        y -- a number       None                            None

        call: distance(x, y)         # two coordinates
        --or: distance((x, y))       # a pair (tuple) of coordinates
        --or: distance(vec)          # e.g. as returned by pos()
        --or: distance(mypen)        # where mypen is another turtle

        Return the angle, between the line from turtle-position to position
        specified by x, y and the turtle's start orientation. (Depends on
        modes - "standard" or "logo")

        Example (for a Turtle instance named turtle):
        >>> turtle.pos()
        (10.00, 10.00)
        >>> turtle.towards(0,0)
        225.0
        """
        if y is not None:
            pos = Vec2D(x, y)
        if isinstance(x, Vec2D):
            pos = x
        elif isinstance(x, tuple):
            pos = Vec2D(*x)
        elif isinstance(x, TNavigator):
            pos = x._position
        x, y = pos - self._position
        result = round(math.atan2(y, x)*180.0/math.pi, 10) % 360.0
        result /= self._degreesPerAU
        return (self._angleOffset + self._angleOrient*result) % self._fullcircle

    def heading(self):
        """ Return the turtle's current heading.

        No arguments.

        Example (for a Turtle instance named turtle):
        >>> turtle.left(67)
        >>> turtle.heading()
        67.0
        """
        x, y = self._orient
        result = round(math.atan2(y, x)*180.0/math.pi, 10) % 360.0
        result /= self._degreesPerAU
        return (self._angleOffset + self._angleOrient*result) % self._fullcircle

    def setheading(self, to_angle):
        """Set the orientation of the turtle to to_angle.

        Aliases:  setheading | seth

        Argument:
        to_angle -- a number (integer or float)

        Set the orientation of the turtle to to_angle.
        Here are some common directions in degrees:

         standard - mode:          logo-mode:
        -------------------|--------------------
           0 - east                0 - north
          90 - north              90 - east
         180 - west              180 - south
         270 - south             270 - west

        Example (for a Turtle instance named turtle):
        >>> turtle.setheading(90)
        >>> turtle.heading()
        90
        """
        angle = (to_angle - self.heading())*self._angleOrient
        full = self._fullcircle
        angle = (angle+full/2.)%full - full/2.
        self._rotate(angle)

    def circle(self, radius, extent = None, steps = None):
        """ Draw a circle with given radius.

        Arguments:
        radius -- a number
        extent (optional) -- a number
        steps (optional) -- an integer

        Draw a circle with given radius. The center is radius units left
        of the turtle; extent - an angle - determines which part of the
        circle is drawn. If extent is not given, draw the entire circle.
        If extent is not a full circle, one endpoint of the arc is the
        current pen position. Draw the arc in counterclockwise direction
        if radius is positive, otherwise in clockwise direction. Finally
        the direction of the turtle is changed by the amount of extent.

        As the circle is approximated by an inscribed regular polygon,
        steps determines the number of steps to use. If not given,
        it will be calculated automatically. Maybe used to draw regular
        polygons.

        call: circle(radius)                  # full circle
        --or: circle(radius, extent)          # arc
        --or: circle(radius, extent, steps)
        --or: circle(radius, steps=6)         # 6-sided polygon

        Example (for a Turtle instance named turtle):
        >>> turtle.circle(50)
        >>> turtle.circle(120, 180)  # semicircle
        """
        if self.undobuffer:
            self.undobuffer.push(["seq"])
            self.undobuffer.cumulate = True
        speed = self.speed()
        if extent is None:
            extent = self._fullcircle
        if steps is None:
            frac = abs(extent)/self._fullcircle
            steps = 1+int(min(11+abs(radius)/6.0, 59.0)*frac)
        w = 1.0 * extent / steps
        w2 = 0.5 * w
        l = 2.0 * radius * math.sin(w2*math.pi/180.0*self._degreesPerAU)
        if radius < 0:
            l, w, w2 = -l, -w, -w2
        tr = self._tracer()
        dl = self._delay()
        if speed == 0:
            self._tracer(0, 0)
        else:
            self.speed(0)
        self._rotate(w2)
        for i in range(steps):
            self.speed(speed)
            self._go(l)
            self.speed(0)
            self._rotate(w)
        self._rotate(-w2)
        if speed == 0:
            self._tracer(tr, dl)
        self.speed(speed)
        if self.undobuffer:
            self.undobuffer.cumulate = False

## three dummy methods to be implemented by child class:

    def speed(self, s=0):
        """dummy method - to be overwritten by child class"""
    def _tracer(self, a=None, b=None):
        """dummy method - to be overwritten by child class"""
    def _delay(self, n=None):
        """dummy method - to be overwritten by child class"""

    fd = forward
    bk = back
    backward = back
    rt = right
    lt = left
    position = pos
    setpos = goto
    setposition = goto
    seth = setheading


class TPen(object):
    """Drawing part of the RawTurtle.
    Implements drawing properties.
    """
    def __init__(self, resizemode=_CFG["resizemode"]):
        self._resizemode = resizemode # or "user" or "noresize"
        self.undobuffer = None
        TPen._reset(self)

    def _reset(self, pencolor=_CFG["pencolor"],
                     fillcolor=_CFG["fillcolor"]):
        self._pensize = 1
        self._shown = True
        self._pencolor = pencolor
        self._fillcolor = fillcolor
        self._drawing = True
        self._speed = 3
        self._stretchfactor = (1., 1.)
        self._shearfactor = 0.
        self._tilt = 0.
        self._shapetrafo = (1., 0., 0., 1.)
        self._outlinewidth = 1

    def resizemode(self, rmode=None):
        """Set resizemode to one of the values: "auto", "user", "noresize".

        (Optional) Argument:
        rmode -- one of the strings "auto", "user", "noresize"

        Different resizemodes have the following effects:
          - "auto" adapts the appearance of the turtle
                   corresponding to the value of pensize.
          - "user" adapts the appearance of the turtle according to the
                   values of stretchfactor and outlinewidth (outline),
                   which are set by shapesize()
          - "noresize" no adaption of the turtle's appearance takes place.
        If no argument is given, return current resizemode.
        resizemode("user") is called by a call of shapesize with arguments.


        Examples (for a Turtle instance named turtle):
        >>> turtle.resizemode("noresize")
        >>> turtle.resizemode()
        'noresize'
        """
        if rmode is None:
            return self._resizemode
        rmode = rmode.lower()
        if rmode in ["auto", "user", "noresize"]:
            self.pen(resizemode=rmode)

    def pensize(self, width=None):
        """Set or return the line thickness.

        Aliases:  pensize | width

        Argument:
        width -- positive number

        Set the line thickness to width or return it. If resizemode is set
        to "auto" and turtleshape is a polygon, that polygon is drawn with
        the same line thickness. If no argument is given, current pensize
        is returned.

        Example (for a Turtle instance named turtle):
        >>> turtle.pensize()
        1
        >>> turtle.pensize(10)   # from here on lines of width 10 are drawn
        """
        if width is None:
            return self._pensize
        self.pen(pensize=width)


    def penup(self):
        """Pull the pen up -- no drawing when moving.

        Aliases: penup | pu | up

        No argument

        Example (for a Turtle instance named turtle):
        >>> turtle.penup()
        """
        if not self._drawing:
            return
        self.pen(pendown=False)

    def pendown(self):
        """Pull the pen down -- drawing when moving.

        Aliases: pendown | pd | down

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.pendown()
        """
        if self._drawing:
            return
        self.pen(pendown=True)

    def isdown(self):
        """Return True if pen is down, False if it's up.

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.penup()
        >>> turtle.isdown()
        False
        >>> turtle.pendown()
        >>> turtle.isdown()
        True
        """
        return self._drawing

    def speed(self, speed=None):
        """ Return or set the turtle's speed.

        Optional argument:
        speed -- an integer in the range 0..10 or a speedstring (see below)

        Set the turtle's speed to an integer value in the range 0 .. 10.
        If no argument is given: return current speed.

        If input is a number greater than 10 or smaller than 0.5,
        speed is set to 0.
        Speedstrings  are mapped to speedvalues in the following way:
            'fastest' :  0
            'fast'    :  10
            'normal'  :  6
            'slow'    :  3
            'slowest' :  1
        speeds from 1 to 10 enforce increasingly faster animation of
        line drawing and turtle turning.

        Attention:
        speed = 0 : *no* animation takes place. forward/back makes turtle jump
        and likewise left/right make the turtle turn instantly.

        Example (for a Turtle instance named turtle):
        >>> turtle.speed(3)
        """
        speeds = {'fastest':0, 'fast':10, 'normal':6, 'slow':3, 'slowest':1 }
        if speed is None:
            return self._speed
        if speed in speeds:
            speed = speeds[speed]
        elif 0.5 < speed < 10.5:
            speed = int(round(speed))
        else:
            speed = 0
        self.pen(speed=speed)

    def color(self, *args):
        """Return or set the pencolor and fillcolor.

        Arguments:
        Several input formats are allowed.
        They use 0, 1, 2, or 3 arguments as follows:

        color()
            Return the current pencolor and the current fillcolor
            as a pair of color specification strings as are returned
            by pencolor and fillcolor.
        color(colorstring), color((r,g,b)), color(r,g,b)
            inputs as in pencolor, set both, fillcolor and pencolor,
            to the given value.
        color(colorstring1, colorstring2),
        color((r1,g1,b1), (r2,g2,b2))
            equivalent to pencolor(colorstring1) and fillcolor(colorstring2)
            and analogously, if the other input format is used.

        If turtleshape is a polygon, outline and interior of that polygon
        is drawn with the newly set colors.
        For more info see: pencolor, fillcolor

        Example (for a Turtle instance named turtle):
        >>> turtle.color('red', 'green')
        >>> turtle.color()
        ('red', 'green')
        >>> colormode(255)
        >>> color((40, 80, 120), (160, 200, 240))
        >>> color()
        ('#285078', '#a0c8f0')
        """
        if args:
            l = len(args)
            if l == 1:
                pcolor = fcolor = args[0]
            elif l == 2:
                pcolor, fcolor = args
            elif l == 3:
                pcolor = fcolor = args
            pcolor = self._colorstr(pcolor)
            fcolor = self._colorstr(fcolor)
            self.pen(pencolor=pcolor, fillcolor=fcolor)
        else:
            return self._color(self._pencolor), self._color(self._fillcolor)

    def pencolor(self, *args):
        """ Return or set the pencolor.

        Arguments:
        Four input formats are allowed:
          - pencolor()
            Return the current pencolor as color specification string,
            possibly in hex-number format (see example).
            May be used as input to another color/pencolor/fillcolor call.
          - pencolor(colorstring)
            s is a Tk color specification string, such as "red" or "yellow"
          - pencolor((r, g, b))
            *a tuple* of r, g, and b, which represent, an RGB color,
            and each of r, g, and b are in the range 0..colormode,
            where colormode is either 1.0 or 255
          - pencolor(r, g, b)
            r, g, and b represent an RGB color, and each of r, g, and b
            are in the range 0..colormode

        If turtleshape is a polygon, the outline of that polygon is drawn
        with the newly set pencolor.

        Example (for a Turtle instance named turtle):
        >>> turtle.pencolor('brown')
        >>> tup = (0.2, 0.8, 0.55)
        >>> turtle.pencolor(tup)
        >>> turtle.pencolor()
        '#33cc8c'
        """
        if args:
            color = self._colorstr(args)
            if color == self._pencolor:
                return
            self.pen(pencolor=color)
        else:
            return self._color(self._pencolor)

    def fillcolor(self, *args):
        """ Return or set the fillcolor.

        Arguments:
        Four input formats are allowed:
          - fillcolor()
            Return the current fillcolor as color specification string,
            possibly in hex-number format (see example).
            May be used as input to another color/pencolor/fillcolor call.
          - fillcolor(colorstring)
            s is a Tk color specification string, such as "red" or "yellow"
          - fillcolor((r, g, b))
            *a tuple* of r, g, and b, which represent, an RGB color,
            and each of r, g, and b are in the range 0..colormode,
            where colormode is either 1.0 or 255
          - fillcolor(r, g, b)
            r, g, and b represent an RGB color, and each of r, g, and b
            are in the range 0..colormode

        If turtleshape is a polygon, the interior of that polygon is drawn
        with the newly set fillcolor.

        Example (for a Turtle instance named turtle):
        >>> turtle.fillcolor('violet')
        >>> col = turtle.pencolor()
        >>> turtle.fillcolor(col)
        >>> turtle.fillcolor(0, .5, 0)
        """
        if args:
            color = self._colorstr(args)
            if color == self._fillcolor:
                return
            self.pen(fillcolor=color)
        else:
            return self._color(self._fillcolor)

    def showturtle(self):
        """Makes the turtle visible.

        Aliases: showturtle | st

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.hideturtle()
        >>> turtle.showturtle()
        """
        self.pen(shown=True)

    def hideturtle(self):
        """Makes the turtle invisible.

        Aliases: hideturtle | ht

        No argument.

        It's a good idea to do this while you're in the
        middle of a complicated drawing, because hiding
        the turtle speeds up the drawing observably.

        Example (for a Turtle instance named turtle):
        >>> turtle.hideturtle()
        """
        self.pen(shown=False)

    def isvisible(self):
        """Return True if the Turtle is shown, False if it's hidden.

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.hideturtle()
        >>> print turtle.isvisible():
        False
        """
        return self._shown

    def pen(self, pen=None, **pendict):
        """Return or set the pen's attributes.

        Arguments:
            pen -- a dictionary with some or all of the below listed keys.
            **pendict -- one or more keyword-arguments with the below
                         listed keys as keywords.

        Return or set the pen's attributes in a 'pen-dictionary'
        with the following key/value pairs:
           "shown"      :   True/False
           "pendown"    :   True/False
           "pencolor"   :   color-string or color-tuple
           "fillcolor"  :   color-string or color-tuple
           "pensize"    :   positive number
           "speed"      :   number in range 0..10
           "resizemode" :   "auto" or "user" or "noresize"
           "stretchfactor": (positive number, positive number)
           "shearfactor":   number
           "outline"    :   positive number
           "tilt"       :   number

        This dictionary can be used as argument for a subsequent
        pen()-call to restore the former pen-state. Moreover one
        or more of these attributes can be provided as keyword-arguments.
        This can be used to set several pen attributes in one statement.


        Examples (for a Turtle instance named turtle):
        >>> turtle.pen(fillcolor="black", pencolor="red", pensize=10)
        >>> turtle.pen()
        {'pensize': 10, 'shown': True, 'resizemode': 'auto', 'outline': 1,
        'pencolor': 'red', 'pendown': True, 'fillcolor': 'black',
        'stretchfactor': (1,1), 'speed': 3, 'shearfactor': 0.0}
        >>> penstate=turtle.pen()
        >>> turtle.color("yellow","")
        >>> turtle.penup()
        >>> turtle.pen()
        {'pensize': 10, 'shown': True, 'resizemode': 'auto', 'outline': 1,
        'pencolor': 'yellow', 'pendown': False, 'fillcolor': '',
        'stretchfactor': (1,1), 'speed': 3, 'shearfactor': 0.0}
        >>> p.pen(penstate, fillcolor="green")
        >>> p.pen()
        {'pensize': 10, 'shown': True, 'resizemode': 'auto', 'outline': 1,
        'pencolor': 'red', 'pendown': True, 'fillcolor': 'green',
        'stretchfactor': (1,1), 'speed': 3, 'shearfactor': 0.0}
        """
        _pd =  {"shown"         : self._shown,
                "pendown"       : self._drawing,
                "pencolor"      : self._pencolor,
                "fillcolor"     : self._fillcolor,
                "pensize"       : self._pensize,
                "speed"         : self._speed,
                "resizemode"    : self._resizemode,
                "stretchfactor" : self._stretchfactor,
                "shearfactor"   : self._shearfactor,
                "outline"       : self._outlinewidth,
                "tilt"          : self._tilt
               }

        if not (pen or pendict):
            return _pd

        if isinstance(pen, dict):
            p = pen
        else:
            p = {}
        p.update(pendict)

        _p_buf = {}
        for key in p:
            _p_buf[key] = _pd[key]

        if self.undobuffer:
            self.undobuffer.push(("pen", _p_buf))

        newLine = False
        if "pendown" in p:
            if self._drawing != p["pendown"]:
                newLine = True
        if "pencolor" in p:
            if isinstance(p["pencolor"], tuple):
                p["pencolor"] = self._colorstr((p["pencolor"],))
            if self._pencolor != p["pencolor"]:
                newLine = True
        if "pensize" in p:
            if self._pensize != p["pensize"]:
                newLine = True
        if newLine:
            self._newLine()
        if "pendown" in p:
            self._drawing = p["pendown"]
        if "pencolor" in p:
            self._pencolor = p["pencolor"]
        if "pensize" in p:
            self._pensize = p["pensize"]
        if "fillcolor" in p:
            if isinstance(p["fillcolor"], tuple):
                p["fillcolor"] = self._colorstr((p["fillcolor"],))
            self._fillcolor = p["fillcolor"]
        if "speed" in p:
            self._speed = p["speed"]
        if "resizemode" in p:
            self._resizemode = p["resizemode"]
        if "stretchfactor" in p:
            sf = p["stretchfactor"]
            if isinstance(sf, (int, float)):
                sf = (sf, sf)
            self._stretchfactor = sf
        if "shearfactor" in p:
            self._shearfactor = p["shearfactor"]
        if "outline" in p:
            self._outlinewidth = p["outline"]
        if "shown" in p:
            self._shown = p["shown"]
        if "tilt" in p:
            self._tilt = p["tilt"]
        if "stretchfactor" in p or "tilt" in p or "shearfactor" in p:
            scx, scy = self._stretchfactor
            shf = self._shearfactor
            sa, ca = math.sin(self._tilt), math.cos(self._tilt)
            self._shapetrafo = ( scx*ca, scy*(shf*ca + sa),
                                -scx*sa, scy*(ca - shf*sa))
        self._update()

## three dummy methods to be implemented by child class:

    def _newLine(self, usePos = True):
        """dummy method - to be overwritten by child class"""
    def _update(self, count=True, forced=False):
        """dummy method - to be overwritten by child class"""
    def _color(self, args):
        """dummy method - to be overwritten by child class"""
    def _colorstr(self, args):
        """dummy method - to be overwritten by child class"""

    width = pensize
    up = penup
    pu = penup
    pd = pendown
    down = pendown
    st = showturtle
    ht = hideturtle


class _TurtleImage(object):
    """Helper class: Datatype to store Turtle attributes
    """

    def __init__(self, screen, shapeIndex):
        self.screen = screen
        self._type = None
        self._setshape(shapeIndex)

    def _setshape(self, shapeIndex):
        screen = self.screen
        self.shapeIndex = shapeIndex
        if self._type == "polygon" == screen._shapes[shapeIndex]._type:
            return
        if self._type == "image" == screen._shapes[shapeIndex]._type:
            return
        if self._type in ["image", "polygon"]:
            screen._delete(self._item)
        elif self._type == "compound":
            for item in self._item:
                screen._delete(item)
        self._type = screen._shapes[shapeIndex]._type
        if self._type == "polygon":
            self._item = screen._createpoly()
        elif self._type == "image":
            self._item = screen._createimage(screen._shapes["blank"]._data)
        elif self._type == "compound":
            self._item = [screen._createpoly() for item in
                                          screen._shapes[shapeIndex]._data]


class RawTurtle(TPen, TNavigator):
    """Animation part of the RawTurtle.
    Puts RawTurtle upon a TurtleScreen and provides tools for
    its animation.
    """
    screens = []

    def __init__(self, canvas=None,
                 shape=_CFG["shape"],
                 undobuffersize=_CFG["undobuffersize"],
                 visible=_CFG["visible"]):
        if isinstance(canvas, _Screen):
            self.screen = canvas
        elif isinstance(canvas, TurtleScreen):
            if canvas not in RawTurtle.screens:
                RawTurtle.screens.append(canvas)
            self.screen = canvas
        elif isinstance(canvas, (ScrolledCanvas, Canvas)):
            for screen in RawTurtle.screens:
                if screen.cv == canvas:
                    self.screen = screen
                    break
            else:
                self.screen = TurtleScreen(canvas)
                RawTurtle.screens.append(self.screen)
        else:
            raise TurtleGraphicsError("bad canvas argument %s" % canvas)

        screen = self.screen
        TNavigator.__init__(self, screen.mode())
        TPen.__init__(self)
        screen._turtles.append(self)
        self.drawingLineItem = screen._createline()
        self.turtle = _TurtleImage(screen, shape)
        self._poly = None
        self._creatingPoly = False
        self._fillitem = self._fillpath = None
        self._shown = visible
        self._hidden_from_screen = False
        self.currentLineItem = screen._createline()
        self.currentLine = [self._position]
        self.items = [self.currentLineItem]
        self.stampItems = []
        self._undobuffersize = undobuffersize
        self.undobuffer = Tbuffer(undobuffersize)
        self._update()

    def reset(self):
        """Delete the turtle's drawings and restore its default values.

        No argument.

        Delete the turtle's drawings from the screen, re-center the turtle
        and set variables to the default values.

        Example (for a Turtle instance named turtle):
        >>> turtle.position()
        (0.00,-22.00)
        >>> turtle.heading()
        100.0
        >>> turtle.reset()
        >>> turtle.position()
        (0.00,0.00)
        >>> turtle.heading()
        0.0
        """
        TNavigator.reset(self)
        TPen._reset(self)
        self._clear()
        self._drawturtle()
        self._update()

    def setundobuffer(self, size):
        """Set or disable undobuffer.

        Argument:
        size -- an integer or None

        If size is an integer an empty undobuffer of given size is installed.
        Size gives the maximum number of turtle-actions that can be undone
        by the undo() function.
        If size is None, no undobuffer is present.

        Example (for a Turtle instance named turtle):
        >>> turtle.setundobuffer(42)
        """
        if size is None or size <= 0:
            self.undobuffer = None
        else:
            self.undobuffer = Tbuffer(size)

    def undobufferentries(self):
        """Return count of entries in the undobuffer.

        No argument.

        Example (for a Turtle instance named turtle):
        >>> while undobufferentries():
        ...     undo()
        """
        if self.undobuffer is None:
            return 0
        return self.undobuffer.nr_of_items()

    def _clear(self):
        """Delete all of pen's drawings"""
        self._fillitem = self._fillpath = None
        for item in self.items:
            self.screen._delete(item)
        self.currentLineItem = self.screen._createline()
        self.currentLine = []
        if self._drawing:
            self.currentLine.append(self._position)
        self.items = [self.currentLineItem]
        self.clearstamps()
        self.setundobuffer(self._undobuffersize)


    def clear(self):
        """Delete the turtle's drawings from the screen. Do not move turtle.

        No arguments.

        Delete the turtle's drawings from the screen. Do not move turtle.
        State and position of the turtle as well as drawings of other
        turtles are not affected.

        Examples (for a Turtle instance named turtle):
        >>> turtle.clear()
        """
        self._clear()
        self._update()

    def _update_data(self):
        self.screen._incrementudc()
        if self.screen._updatecounter != 0:
            return
        if len(self.currentLine)>1:
            self.screen._drawline(self.currentLineItem, self.currentLine,
                                  self._pencolor, self._pensize)

    def _update(self):
        """Perform a Turtle-data update.
        """
        screen = self.screen
        if screen._tracing == 0:
            return
        elif screen._tracing == 1:
            self._update_data()
            self._drawturtle()
            screen._update()                  # TurtleScreenBase
            screen._delay(screen._delayvalue) # TurtleScreenBase
        else:
            self._update_data()
            if screen._updatecounter == 0:
                for t in screen.turtles():
                    t._drawturtle()
                screen._update()

    def _tracer(self, flag=None, delay=None):
        """Turns turtle animation on/off and set delay for update drawings.

        Optional arguments:
        n -- nonnegative  integer
        delay -- nonnegative  integer

        If n is given, only each n-th regular screen update is really performed.
        (Can be used to accelerate the drawing of complex graphics.)
        Second arguments sets delay value (see RawTurtle.delay())

        Example (for a Turtle instance named turtle):
        >>> turtle.tracer(8, 25)
        >>> dist = 2
        >>> for i in range(200):
        ...     turtle.fd(dist)
        ...     turtle.rt(90)
        ...     dist += 2
        """
        return self.screen.tracer(flag, delay)

    def _color(self, args):
        return self.screen._color(args)

    def _colorstr(self, args):
        return self.screen._colorstr(args)

    def _cc(self, args):
        """Convert colortriples to hexstrings.
        """
        if isinstance(args, str):
            return args
        try:
            r, g, b = args
        except (TypeError, ValueError):
            raise TurtleGraphicsError("bad color arguments: %s" % str(args))
        if self.screen._colormode == 1.0:
            r, g, b = [round(255.0*x) for x in (r, g, b)]
        if not ((0 <= r <= 255) and (0 <= g <= 255) and (0 <= b <= 255)):
            raise TurtleGraphicsError("bad color sequence: %s" % str(args))
        return "#%02x%02x%02x" % (r, g, b)

    def clone(self):
        """Create and return a clone of the turtle.

        No argument.

        Create and return a clone of the turtle with same position, heading
        and turtle properties.

        Example (for a Turtle instance named mick):
        mick = Turtle()
        joe = mick.clone()
        """
        screen = self.screen
        self._newLine(self._drawing)

        turtle = self.turtle
        self.screen = None
        self.turtle = None  # too make self deepcopy-able

        q = deepcopy(self)

        self.screen = screen
        self.turtle = turtle

        q.screen = screen
        q.turtle = _TurtleImage(screen, self.turtle.shapeIndex)

        screen._turtles.append(q)
        ttype = screen._shapes[self.turtle.shapeIndex]._type
        if ttype == "polygon":
            q.turtle._item = screen._createpoly()
        elif ttype == "image":
            q.turtle._item = screen._createimage(screen._shapes["blank"]._data)
        elif ttype == "compound":
            q.turtle._item = [screen._createpoly() for item in
                              screen._shapes[self.turtle.shapeIndex]._data]
        q.currentLineItem = screen._createline()
        q._update()
        return q

    def shape(self, name=None):
        """Set turtle shape to shape with given name / return current shapename.

        Optional argument:
        name -- a string, which is a valid shapename

        Set turtle shape to shape with given name or, if name is not given,
        return name of current shape.
        Shape with name must exist in the TurtleScreen's shape dictionary.
        Initially there are the following polygon shapes:
        'arrow', 'turtle', 'circle', 'square', 'triangle', 'classic'.
        To learn about how to deal with shapes see Screen-method register_shape.

        Example (for a Turtle instance named turtle):
        >>> turtle.shape()
        'arrow'
        >>> turtle.shape("turtle")
        >>> turtle.shape()
        'turtle'
        """
        if name is None:
            return self.turtle.shapeIndex
        if not name in self.screen.getshapes():
            raise TurtleGraphicsError("There is no shape named %s" % name)
        self.turtle._setshape(name)
        self._update()

    def shapesize(self, stretch_wid=None, stretch_len=None, outline=None):
        """Set/return turtle's stretchfactors/outline. Set resizemode to "user".

        Optional arguments:
           stretch_wid : positive number
           stretch_len : positive number
           outline  : positive number

        Return or set the pen's attributes x/y-stretchfactors and/or outline.
        Set resizemode to "user".
        If and only if resizemode is set to "user", the turtle will be displayed
        stretched according to its stretchfactors:
        stretch_wid is stretchfactor perpendicular to orientation
        stretch_len is stretchfactor in direction of turtles orientation.
        outline determines the width of the shapes's outline.

        Examples (for a Turtle instance named turtle):
        >>> turtle.resizemode("user")
        >>> turtle.shapesize(5, 5, 12)
        >>> turtle.shapesize(outline=8)
        """
        if stretch_wid is stretch_len is outline is None:
            stretch_wid, stretch_len = self._stretchfactor
            return stretch_wid, stretch_len, self._outlinewidth
        if stretch_wid == 0 or stretch_len == 0:
            raise TurtleGraphicsError("stretch_wid/stretch_len must not be zero")
        if stretch_wid is not None:
            if stretch_len is None:
                stretchfactor = stretch_wid, stretch_wid
            else:
                stretchfactor = stretch_wid, stretch_len
        elif stretch_len is not None:
            stretchfactor = self._stretchfactor[0], stretch_len
        else:
            stretchfactor = self._stretchfactor
        if outline is None:
            outline = self._outlinewidth
        self.pen(resizemode="user",
                 stretchfactor=stretchfactor, outline=outline)

    def shearfactor(self, shear=None):
        """Set or return the current shearfactor.

        Optional argument: shear -- number, tangent of the shear angle

        Shear the turtleshape according to the given shearfactor shear,
        which is the tangent of the shear angle. DO NOT change the
        turtle's heading (direction of movement).
        If shear is not given: return the current shearfactor, i. e. the
        tangent of the shear angle, by which lines parallel to the
        heading of the turtle are sheared.

        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("circle")
        >>> turtle.shapesize(5,2)
        >>> turtle.shearfactor(0.5)
        >>> turtle.shearfactor()
        >>> 0.5
        """
        if shear is None:
            return self._shearfactor
        self.pen(resizemode="user", shearfactor=shear)

    def settiltangle(self, angle):
        """Rotate the turtleshape to point in the specified direction

        Argument: angle -- number

        Rotate the turtleshape to point in the direction specified by angle,
        regardless of its current tilt-angle. DO NOT change the turtle's
        heading (direction of movement).


        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("circle")
        >>> turtle.shapesize(5,2)
        >>> turtle.settiltangle(45)
        >>> stamp()
        >>> turtle.fd(50)
        >>> turtle.settiltangle(-45)
        >>> stamp()
        >>> turtle.fd(50)
        """
        tilt = -angle * self._degreesPerAU * self._angleOrient
        tilt = (tilt * math.pi / 180.0) % (2*math.pi)
        self.pen(resizemode="user", tilt=tilt)

    def tiltangle(self, angle=None):
        """Set or return the current tilt-angle.

        Optional argument: angle -- number

        Rotate the turtleshape to point in the direction specified by angle,
        regardless of its current tilt-angle. DO NOT change the turtle's
        heading (direction of movement).
        If angle is not given: return the current tilt-angle, i. e. the angle
        between the orientation of the turtleshape and the heading of the
        turtle (its direction of movement).

        Deprecated since Python 3.1

        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("circle")
        >>> turtle.shapesize(5,2)
        >>> turtle.tilt(45)
        >>> turtle.tiltangle()
        """
        if angle is None:
            tilt = -self._tilt * (180.0/math.pi) * self._angleOrient
            return (tilt / self._degreesPerAU) % self._fullcircle
        else:
            self.settiltangle(angle)

    def tilt(self, angle):
        """Rotate the turtleshape by angle.

        Argument:
        angle - a number

        Rotate the turtleshape by angle from its current tilt-angle,
        but do NOT change the turtle's heading (direction of movement).

        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("circle")
        >>> turtle.shapesize(5,2)
        >>> turtle.tilt(30)
        >>> turtle.fd(50)
        >>> turtle.tilt(30)
        >>> turtle.fd(50)
        """
        self.settiltangle(angle + self.tiltangle())

    def shapetransform(self, t11=None, t12=None, t21=None, t22=None):
        """Set or return the current transformation matrix of the turtle shape.

        Optional arguments: t11, t12, t21, t22 -- numbers.

        If none of the matrix elements are given, return the transformation
        matrix.
        Otherwise set the given elements and transform the turtleshape
        according to the matrix consisting of first row t11, t12 and
        second row t21, 22.
        Modify stretchfactor, shearfactor and tiltangle according to the
        given matrix.

        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("square")
        >>> turtle.shapesize(4,2)
        >>> turtle.shearfactor(-0.5)
        >>> turtle.shapetransform()
        (4.0, -1.0, -0.0, 2.0)
        """
        if t11 is t12 is t21 is t22 is None:
            return self._shapetrafo
        m11, m12, m21, m22 = self._shapetrafo
        if t11 is not None: m11 = t11
        if t12 is not None: m12 = t12
        if t21 is not None: m21 = t21
        if t22 is not None: m22 = t22
        if t11 * t22 - t12 * t21 == 0:
            raise TurtleGraphicsError("Bad shape transform matrix: must not be singular")
        self._shapetrafo = (m11, m12, m21, m22)
        alfa = math.atan2(-m21, m11) % (2 * math.pi)
        sa, ca = math.sin(alfa), math.cos(alfa)
        a11, a12, a21, a22 = (ca*m11 - sa*m21, ca*m12 - sa*m22,
                              sa*m11 + ca*m21, sa*m12 + ca*m22)
        self._stretchfactor = a11, a22
        self._shearfactor = a12/a22
        self._tilt = alfa
        self.pen(resizemode="user")


    def _polytrafo(self, poly):
        """Computes transformed polygon shapes from a shape
        according to current position and heading.
        """
        screen = self.screen
        p0, p1 = self._position
        e0, e1 = self._orient
        e = Vec2D(e0, e1 * screen.yscale / screen.xscale)
        e0, e1 = (1.0 / abs(e)) * e
        return [(p0+(e1*x+e0*y)/screen.xscale, p1+(-e0*x+e1*y)/screen.yscale)
                                                           for (x, y) in poly]

    def get_shapepoly(self):
        """Return the current shape polygon as tuple of coordinate pairs.

        No argument.

        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("square")
        >>> turtle.shapetransform(4, -1, 0, 2)
        >>> turtle.get_shapepoly()
        ((50, -20), (30, 20), (-50, 20), (-30, -20))

        """
        shape = self.screen._shapes[self.turtle.shapeIndex]
        if shape._type == "polygon":
            return self._getshapepoly(shape._data, shape._type == "compound")
        # else return None

    def _getshapepoly(self, polygon, compound=False):
        """Calculate transformed shape polygon according to resizemode
        and shapetransform.
        """
        if self._resizemode == "user" or compound:
            t11, t12, t21, t22 = self._shapetrafo
        elif self._resizemode == "auto":
            l = max(1, self._pensize/5.0)
            t11, t12, t21, t22 = l, 0, 0, l
        elif self._resizemode == "noresize":
            return polygon
        return tuple((t11*x + t12*y, t21*x + t22*y) for (x, y) in polygon)

    def _drawturtle(self):
        """Manages the correct rendering of the turtle with respect to
        its shape, resizemode, stretch and tilt etc."""
        screen = self.screen
        shape = screen._shapes[self.turtle.shapeIndex]
        ttype = shape._type
        titem = self.turtle._item
        if self._shown and screen._updatecounter == 0 and screen._tracing > 0:
            self._hidden_from_screen = False
            tshape = shape._data
            if ttype == "polygon":
                if self._resizemode == "noresize": w = 1
                elif self._resizemode == "auto": w = self._pensize
                else: w =self._outlinewidth
                shape = self._polytrafo(self._getshapepoly(tshape))
                fc, oc = self._fillcolor, self._pencolor
                screen._drawpoly(titem, shape, fill=fc, outline=oc,
                                                      width=w, top=True)
            elif ttype == "image":
                screen._drawimage(titem, self._position, tshape)
            elif ttype == "compound":
                for item, (poly, fc, oc) in zip(titem, tshape):
                    poly = self._polytrafo(self._getshapepoly(poly, True))
                    screen._drawpoly(item, poly, fill=self._cc(fc),
                                     outline=self._cc(oc), width=self._outlinewidth, top=True)
        else:
            if self._hidden_from_screen:
                return
            if ttype == "polygon":
                screen._drawpoly(titem, ((0, 0), (0, 0), (0, 0)), "", "")
            elif ttype == "image":
                screen._drawimage(titem, self._position,
                                          screen._shapes["blank"]._data)
            elif ttype == "compound":
                for item in titem:
                    screen._drawpoly(item, ((0, 0), (0, 0), (0, 0)), "", "")
            self._hidden_from_screen = True

##############################  stamp stuff  ###############################

    def stamp(self):
        """Stamp a copy of the turtleshape onto the canvas and return its id.

        No argument.

        Stamp a copy of the turtle shape onto the canvas at the current
        turtle position. Return a stamp_id for that stamp, which can be
        used to delete it by calling clearstamp(stamp_id).

        Example (for a Turtle instance named turtle):
        >>> turtle.color("blue")
        >>> turtle.stamp()
        13
        >>> turtle.fd(50)
        """
        screen = self.screen
        shape = screen._shapes[self.turtle.shapeIndex]
        ttype = shape._type
        tshape = shape._data
        if ttype == "polygon":
            stitem = screen._createpoly()
            if self._resizemode == "noresize": w = 1
            elif self._resizemode == "auto": w = self._pensize
            else: w =self._outlinewidth
            shape = self._polytrafo(self._getshapepoly(tshape))
            fc, oc = self._fillcolor, self._pencolor
            screen._drawpoly(stitem, shape, fill=fc, outline=oc,
                                                  width=w, top=True)
        elif ttype == "image":
            stitem = screen._createimage("")
            screen._drawimage(stitem, self._position, tshape)
        elif ttype == "compound":
            stitem = []
            for element in tshape:
                item = screen._createpoly()
                stitem.append(item)
            stitem = tuple(stitem)
            for item, (poly, fc, oc) in zip(stitem, tshape):
                poly = self._polytrafo(self._getshapepoly(poly, True))
                screen._drawpoly(item, poly, fill=self._cc(fc),
                                 outline=self._cc(oc), width=self._outlinewidth, top=True)
        self.stampItems.append(stitem)
        self.undobuffer.push(("stamp", stitem))
        return stitem

    def _clearstamp(self, stampid):
        """does the work for clearstamp() and clearstamps()
        """
        if stampid in self.stampItems:
            if isinstance(stampid, tuple):
                for subitem in stampid:
                    self.screen._delete(subitem)
            else:
                self.screen._delete(stampid)
            self.stampItems.remove(stampid)
        # Delete stampitem from undobuffer if necessary
        # if clearstamp is called directly.
        item = ("stamp", stampid)
        buf = self.undobuffer
        if item not in buf.buffer:
            return
        index = buf.buffer.index(item)
        buf.buffer.remove(item)
        if index <= buf.ptr:
            buf.ptr = (buf.ptr - 1) % buf.bufsize
        buf.buffer.insert((buf.ptr+1)%buf.bufsize, [None])

    def clearstamp(self, stampid):
        """Delete stamp with given stampid

        Argument:
        stampid - an integer, must be return value of previous stamp() call.

        Example (for a Turtle instance named turtle):
        >>> turtle.color("blue")
        >>> astamp = turtle.stamp()
        >>> turtle.fd(50)
        >>> turtle.clearstamp(astamp)
        """
        self._clearstamp(stampid)
        self._update()

    def clearstamps(self, n=None):
        """Delete all or first/last n of turtle's stamps.

        Optional argument:
        n -- an integer

        If n is None, delete all of pen's stamps,
        else if n > 0 delete first n stamps
        else if n < 0 delete last n stamps.

        Example (for a Turtle instance named turtle):
        >>> for i in range(8):
        ...     turtle.stamp(); turtle.fd(30)
        ...
        >>> turtle.clearstamps(2)
        >>> turtle.clearstamps(-2)
        >>> turtle.clearstamps()
        """
        if n is None:
            toDelete = self.stampItems[:]
        elif n >= 0:
            toDelete = self.stampItems[:n]
        else:
            toDelete = self.stampItems[n:]
        for item in toDelete:
            self._clearstamp(item)
        self._update()

    def _goto(self, end):
        """Move the pen to the point end, thereby drawing a line
        if pen is down. All other methods for turtle movement depend
        on this one.
        """
        ## Version with undo-stuff
        go_modes = ( self._drawing,
                     self._pencolor,
                     self._pensize,
                     isinstance(self._fillpath, list))
        screen = self.screen
        undo_entry = ("go", self._position, end, go_modes,
                      (self.currentLineItem,
                      self.currentLine[:],
                      screen._pointlist(self.currentLineItem),
                      self.items[:])
                      )
        if self.undobuffer:
            self.undobuffer.push(undo_entry)
        start = self._position
        if self._speed and screen._tracing == 1:
            diff = (end-start)
            diffsq = (diff[0]*screen.xscale)**2 + (diff[1]*screen.yscale)**2
            nhops = 1+int((diffsq**0.5)/(3*(1.1**self._speed)*self._speed))
            delta = diff * (1.0/nhops)
            for n in range(1, nhops):
                if n == 1:
                    top = True
                else:
                    top = False
                self._position = start + delta * n
                if self._drawing:
                    screen._drawline(self.drawingLineItem,
                                     (start, self._position),
                                     self._pencolor, self._pensize, top)
                self._update()
            if self._drawing:
                screen._drawline(self.drawingLineItem, ((0, 0), (0, 0)),
                                               fill="", width=self._pensize)
        # Turtle now at end,
        if self._drawing: # now update currentLine
            self.currentLine.append(end)
        if isinstance(self._fillpath, list):
            self._fillpath.append(end)
        ######    vererbung!!!!!!!!!!!!!!!!!!!!!!
        self._position = end
        if self._creatingPoly:
            self._poly.append(end)
        if len(self.currentLine) > 42: # 42! answer to the ultimate question
                                       # of life, the universe and everything
            self._newLine()
        self._update() #count=True)

    def _undogoto(self, entry):
        """Reverse a _goto. Used for undo()
        """
        old, new, go_modes, coodata = entry
        drawing, pc, ps, filling = go_modes
        cLI, cL, pl, items = coodata
        screen = self.screen
        if abs(self._position - new) > 0.5:
            print ("undogoto: HALLO-DA-STIMMT-WAS-NICHT!")
        # restore former situation
        self.currentLineItem = cLI
        self.currentLine = cL

        if pl == [(0, 0), (0, 0)]:
            usepc = ""
        else:
            usepc = pc
        screen._drawline(cLI, pl, fill=usepc, width=ps)

        todelete = [i for i in self.items if (i not in items) and
                                       (screen._type(i) == "line")]
        for i in todelete:
            screen._delete(i)
            self.items.remove(i)

        start = old
        if self._speed and screen._tracing == 1:
            diff = old - new
            diffsq = (diff[0]*screen.xscale)**2 + (diff[1]*screen.yscale)**2
            nhops = 1+int((diffsq**0.5)/(3*(1.1**self._speed)*self._speed))
            delta = diff * (1.0/nhops)
            for n in range(1, nhops):
                if n == 1:
                    top = True
                else:
                    top = False
                self._position = new + delta * n
                if drawing:
                    screen._drawline(self.drawingLineItem,
                                     (start, self._position),
                                     pc, ps, top)
                self._update()
            if drawing:
                screen._drawline(self.drawingLineItem, ((0, 0), (0, 0)),
                                               fill="", width=ps)
        # Turtle now at position old,
        self._position = old
        ##  if undo is done during creating a polygon, the last vertex
        ##  will be deleted. if the polygon is entirely deleted,
        ##  creatingPoly will be set to False.
        ##  Polygons created before the last one will not be affected by undo()
        if self._creatingPoly:
            if len(self._poly) > 0:
                self._poly.pop()
            if self._poly == []:
                self._creatingPoly = False
                self._poly = None
        if filling:
            if self._fillpath == []:
                self._fillpath = None
                print("Unwahrscheinlich in _undogoto!")
            elif self._fillpath is not None:
                self._fillpath.pop()
        self._update() #count=True)

    def _rotate(self, angle):
        """Turns pen clockwise by angle.
        """
        if self.undobuffer:
            self.undobuffer.push(("rot", angle, self._degreesPerAU))
        angle *= self._degreesPerAU
        neworient = self._orient.rotate(angle)
        tracing = self.screen._tracing
        if tracing == 1 and self._speed > 0:
            anglevel = 3.0 * self._speed
            steps = 1 + int(abs(angle)/anglevel)
            delta = 1.0*angle/steps
            for _ in range(steps):
                self._orient = self._orient.rotate(delta)
                self._update()
        self._orient = neworient
        self._update()

    def _newLine(self, usePos=True):
        """Closes current line item and starts a new one.
           Remark: if current line became too long, animation
           performance (via _drawline) slowed down considerably.
        """
        if len(self.currentLine) > 1:
            self.screen._drawline(self.currentLineItem, self.currentLine,
                                      self._pencolor, self._pensize)
            self.currentLineItem = self.screen._createline()
            self.items.append(self.currentLineItem)
        else:
            self.screen._drawline(self.currentLineItem, top=True)
        self.currentLine = []
        if usePos:
            self.currentLine = [self._position]

    def filling(self):
        """Return fillstate (True if filling, False else).

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.begin_fill()
        >>> if turtle.filling():
        ...     turtle.pensize(5)
        ... else:
        ...     turtle.pensize(3)
        """
        return isinstance(self._fillpath, list)

    def begin_fill(self):
        """Called just before drawing a shape to be filled.

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.color("black", "red")
        >>> turtle.begin_fill()
        >>> turtle.circle(60)
        >>> turtle.end_fill()
        """
        if not self.filling():
            self._fillitem = self.screen._createpoly()
            self.items.append(self._fillitem)
        self._fillpath = [self._position]
        self._newLine()
        if self.undobuffer:
            self.undobuffer.push(("beginfill", self._fillitem))
        self._update()


    def end_fill(self):
        """Fill the shape drawn after the call begin_fill().

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.color("black", "red")
        >>> turtle.begin_fill()
        >>> turtle.circle(60)
        >>> turtle.end_fill()
        """
        if self.filling():
            if len(self._fillpath) > 2:
                self.screen._drawpoly(self._fillitem, self._fillpath,
                                      fill=self._fillcolor)
                if self.undobuffer:
                    self.undobuffer.push(("dofill", self._fillitem))
            self._fillitem = self._fillpath = None
            self._update()

    def dot(self, size=None, *color):
        """Draw a dot with diameter size, using color.

        Optional arguments:
        size -- an integer >= 1 (if given)
        color -- a colorstring or a numeric color tuple

        Draw a circular dot with diameter size, using color.
        If size is not given, the maximum of pensize+4 and 2*pensize is used.

        Example (for a Turtle instance named turtle):
        >>> turtle.dot()
        >>> turtle.fd(50); turtle.dot(20, "blue"); turtle.fd(50)
        """
        if not color:
            if isinstance(size, (str, tuple)):
                color = self._colorstr(size)
                size = self._pensize + max(self._pensize, 4)
            else:
                color = self._pencolor
                if not size:
                    size = self._pensize + max(self._pensize, 4)
        else:
            if size is None:
                size = self._pensize + max(self._pensize, 4)
            color = self._colorstr(color)
        if hasattr(self.screen, "_dot"):
            item = self.screen._dot(self._position, size, color)
            self.items.append(item)
            if self.undobuffer:
                self.undobuffer.push(("dot", item))
        else:
            pen = self.pen()
            if self.undobuffer:
                self.undobuffer.push(["seq"])
                self.undobuffer.cumulate = True
            try:
                if self.resizemode() == 'auto':
                    self.ht()
                self.pendown()
                self.pensize(size)
                self.pencolor(color)
                self.forward(0)
            finally:
                self.pen(pen)
            if self.undobuffer:
                self.undobuffer.cumulate = False

    def _write(self, txt, align, font):
        """Performs the writing for write()
        """
        item, end = self.screen._write(self._position, txt, align, font,
                                                          self._pencolor)
        self.items.append(item)
        if self.undobuffer:
            self.undobuffer.push(("wri", item))
        return end

    def write(self, arg, move=False, align="left", font=("Arial", 8, "normal")):
        """Write text at the current turtle position.

        Arguments:
        arg -- info, which is to be written to the TurtleScreen
        move (optional) -- True/False
        align (optional) -- one of the strings "left", "center" or right"
        font (optional) -- a triple (fontname, fontsize, fonttype)

        Write text - the string representation of arg - at the current
        turtle position according to align ("left", "center" or right")
        and with the given font.
        If move is True, the pen is moved to the bottom-right corner
        of the text. By default, move is False.

        Example (for a Turtle instance named turtle):
        >>> turtle.write('Home = ', True, align="center")
        >>> turtle.write((0,0), True)
        """
        if self.undobuffer:
            self.undobuffer.push(["seq"])
            self.undobuffer.cumulate = True
        end = self._write(str(arg), align.lower(), font)
        if move:
            x, y = self.pos()
            self.setpos(end, y)
        if self.undobuffer:
            self.undobuffer.cumulate = False

    def begin_poly(self):
        """Start recording the vertices of a polygon.

        No argument.

        Start recording the vertices of a polygon. Current turtle position
        is first point of polygon.

        Example (for a Turtle instance named turtle):
        >>> turtle.begin_poly()
        """
        self._poly = [self._position]
        self._creatingPoly = True

    def end_poly(self):
        """Stop recording the vertices of a polygon.

        No argument.

        Stop recording the vertices of a polygon. Current turtle position is
        last point of polygon. This will be connected with the first point.

        Example (for a Turtle instance named turtle):
        >>> turtle.end_poly()
        """
        self._creatingPoly = False

    def get_poly(self):
        """Return the lastly recorded polygon.

        No argument.

        Example (for a Turtle instance named turtle):
        >>> p = turtle.get_poly()
        >>> turtle.register_shape("myFavouriteShape", p)
        """
        ## check if there is any poly?
        if self._poly is not None:
            return tuple(self._poly)

    def getscreen(self):
        """Return the TurtleScreen object, the turtle is drawing  on.

        No argument.

        Return the TurtleScreen object, the turtle is drawing  on.
        So TurtleScreen-methods can be called for that object.

        Example (for a Turtle instance named turtle):
        >>> ts = turtle.getscreen()
        >>> ts
        <turtle.TurtleScreen object at 0x0106B770>
        >>> ts.bgcolor("pink")
        """
        return self.screen

    def getturtle(self):
        """Return the Turtleobject itself.

        No argument.

        Only reasonable use: as a function to return the 'anonymous turtle':

        Example:
        >>> pet = getturtle()
        >>> pet.fd(50)
        >>> pet
        <turtle.Turtle object at 0x0187D810>
        >>> turtles()
        [<turtle.Turtle object at 0x0187D810>]
        """
        return self

    getpen = getturtle


    ################################################################
    ### screen oriented methods recurring to methods of TurtleScreen
    ################################################################

    def _delay(self, delay=None):
        """Set delay value which determines speed of turtle animation.
        """
        return self.screen.delay(delay)

    def onclick(self, fun, btn=1, add=None):
        """Bind fun to mouse-click event on this turtle on canvas.

        Arguments:
        fun --  a function with two arguments, to which will be assigned
                the coordinates of the clicked point on the canvas.
        btn --  number of the mouse-button defaults to 1 (left mouse button).
        add --  True or False. If True, new binding will be added, otherwise
                it will replace a former binding.

        Example for the anonymous turtle, i. e. the procedural way:

        >>> def turn(x, y):
        ...     left(360)
        ...
        >>> onclick(turn)  # Now clicking into the turtle will turn it.
        >>> onclick(None)  # event-binding will be removed
        """
        self.screen._onclick(self.turtle._item, fun, btn, add)
        self._update()

    def onrelease(self, fun, btn=1, add=None):
        """Bind fun to mouse-button-release event on this turtle on canvas.

        Arguments:
        fun -- a function with two arguments, to which will be assigned
                the coordinates of the clicked point on the canvas.
        btn --  number of the mouse-button defaults to 1 (left mouse button).

        Example (for a MyTurtle instance named joe):
        >>> class MyTurtle(Turtle):
        ...     def glow(self,x,y):
        ...             self.fillcolor("red")
        ...     def unglow(self,x,y):
        ...             self.fillcolor("")
        ...
        >>> joe = MyTurtle()
        >>> joe.onclick(joe.glow)
        >>> joe.onrelease(joe.unglow)

        Clicking on joe turns fillcolor red, unclicking turns it to
        transparent.
        """
        self.screen._onrelease(self.turtle._item, fun, btn, add)
        self._update()

    def ondrag(self, fun, btn=1, add=None):
        """Bind fun to mouse-move event on this turtle on canvas.

        Arguments:
        fun -- a function with two arguments, to which will be assigned
               the coordinates of the clicked point on the canvas.
        btn -- number of the mouse-button defaults to 1 (left mouse button).

        Every sequence of mouse-move-events on a turtle is preceded by a
        mouse-click event on that turtle.

        Example (for a Turtle instance named turtle):
        >>> turtle.ondrag(turtle.goto)

        Subsequently clicking and dragging a Turtle will move it
        across the screen thereby producing handdrawings (if pen is
        down).
        """
        self.screen._ondrag(self.turtle._item, fun, btn, add)


    def _undo(self, action, data):
        """Does the main part of the work for undo()
        """
        if self.undobuffer is None:
            return
        if action == "rot":
            angle, degPAU = data
            self._rotate(-angle*degPAU/self._degreesPerAU)
            dummy = self.undobuffer.pop()
        elif action == "stamp":
            stitem = data[0]
            self.clearstamp(stitem)
        elif action == "go":
            self._undogoto(data)
        elif action in ["wri", "dot"]:
            item = data[0]
            self.screen._delete(item)
            self.items.remove(item)
        elif action == "dofill":
            item = data[0]
            self.screen._drawpoly(item, ((0, 0),(0, 0),(0, 0)),
                                  fill="", outline="")
        elif action == "beginfill":
            item = data[0]
            self._fillitem = self._fillpath = None
            if item in self.items:
                self.screen._delete(item)
                self.items.remove(item)
        elif action == "pen":
            TPen.pen(self, data[0])
            self.undobuffer.pop()

    def undo(self):
        """undo (repeatedly) the last turtle action.

        No argument.

        undo (repeatedly) the last turtle action.
        Number of available undo actions is determined by the size of
        the undobuffer.

        Example (for a Turtle instance named turtle):
        >>> for i in range(4):
        ...     turtle.fd(50); turtle.lt(80)
        ...
        >>> for i in range(8):
        ...     turtle.undo()
        ...
        """
        if self.undobuffer is None:
            return
        item = self.undobuffer.pop()
        action = item[0]
        data = item[1:]
        if action == "seq":
            while data:
                item = data.pop()
                self._undo(item[0], item[1:])
        else:
            self._undo(action, data)

    turtlesize = shapesize

RawPen = RawTurtle

###  Screen - Singleton  ########################

def Screen():
    """Return the singleton screen object.
    If none exists at the moment, create a new one and return it,
    else return the existing one."""
    if Turtle._screen is None:
        Turtle._screen = _Screen()
    return Turtle._screen

class _Screen(TurtleScreen):

    _root = None
    _canvas = None
    _title = _CFG["title"]

    def __init__(self):
        # XXX there is no need for this code to be conditional,
        # as there will be only a single _Screen instance, anyway
        # XXX actually, the turtle demo is injecting root window,
        # so perhaps the conditional creation of a root should be
        # preserved (perhaps by passing it as an optional parameter)
        if _Screen._root is None:
            _Screen._root = self._root = _Root()
            self._root.title(_Screen._title)
            self._root.ondestroy(self._destroy)
        if _Screen._canvas is None:
            width = _CFG["width"]
            height = _CFG["height"]
            canvwidth = _CFG["canvwidth"]
            canvheight = _CFG["canvheight"]
            leftright = _CFG["leftright"]
            topbottom = _CFG["topbottom"]
            self._root.setupcanvas(width, height, canvwidth, canvheight)
            _Screen._canvas = self._root._getcanvas()
            TurtleScreen.__init__(self, _Screen._canvas)
            self.setup(width, height, leftright, topbottom)

    def setup(self, width=_CFG["width"], height=_CFG["height"],
              startx=_CFG["leftright"], starty=_CFG["topbottom"]):
        """ Set the size and position of the main window.

        Arguments:
        width: as integer a size in pixels, as float a fraction of the screen.
          Default is 50% of screen.
        height: as integer the height in pixels, as float a fraction of the
          screen. Default is 75% of screen.
        startx: if positive, starting position in pixels from the left
          edge of the screen, if negative from the right edge
          Default, startx=None is to center window horizontally.
        starty: if positive, starting position in pixels from the top
          edge of the screen, if negative from the bottom edge
          Default, starty=None is to center window vertically.

        Examples (for a Screen instance named screen):
        >>> screen.setup (width=200, height=200, startx=0, starty=0)

        sets window to 200x200 pixels, in upper left of screen

        >>> screen.setup(width=.75, height=0.5, startx=None, starty=None)

        sets window to 75% of screen by 50% of screen and centers
        """
        if not hasattr(self._root, "set_geometry"):
            return
        sw = self._root.win_width()
        sh = self._root.win_height()
        if isinstance(width, float) and 0 <= width <= 1:
            width = sw*width
        if startx is None:
            startx = (sw - width) / 2
        if isinstance(height, float) and 0 <= height <= 1:
            height = sh*height
        if starty is None:
            starty = (sh - height) / 2
        self._root.set_geometry(width, height, startx, starty)
        self.update()

    def title(self, titlestring):
        """Set title of turtle-window

        Argument:
        titlestring -- a string, to appear in the titlebar of the
                       turtle graphics window.

        This is a method of Screen-class. Not available for TurtleScreen-
        objects.

        Example (for a Screen instance named screen):
        >>> screen.title("Welcome to the turtle-zoo!")
        """
        if _Screen._root is not None:
            _Screen._root.title(titlestring)
        _Screen._title = titlestring

    def _destroy(self):
        root = self._root
        if root is _Screen._root:
            Turtle._pen = None
            Turtle._screen = None
            _Screen._root = None
            _Screen._canvas = None
        TurtleScreen._RUNNING = False
        root.destroy()

    def bye(self):
        """Shut the turtlegraphics window.

        Example (for a TurtleScreen instance named screen):
        >>> screen.bye()
        """
        self._destroy()

    def exitonclick(self):
        """Go into mainloop until the mouse is clicked.

        No arguments.

        Bind bye() method to mouseclick on TurtleScreen.
        If "using_IDLE" - value in configuration dictionary is False
        (default value), enter mainloop.
        If IDLE with -n switch (no subprocess) is used, this value should be
        set to True in turtle.cfg. In this case IDLE's mainloop
        is active also for the client script.

        This is a method of the Screen-class and not available for
        TurtleScreen instances.

        Example (for a Screen instance named screen):
        >>> screen.exitonclick()

        """
        def exitGracefully(x, y):
            """Screen.bye() with two dummy-parameters"""
            self.bye()
        self.onclick(exitGracefully)
        if _CFG["using_IDLE"]:
            return
        try:
            mainloop()
        except AttributeError:
            exit(0)

class Turtle(RawTurtle):
    """RawTurtle auto-creating (scrolled) canvas.

    When a Turtle object is created or a function derived from some
    Turtle method is called a TurtleScreen object is automatically created.
    """
    _pen = None
    _screen = None

    def __init__(self,
                 shape=_CFG["shape"],
                 undobuffersize=_CFG["undobuffersize"],
                 visible=_CFG["visible"]):
        if Turtle._screen is None:
            Turtle._screen = Screen()
        RawTurtle.__init__(self, Turtle._screen,
                           shape=shape,
                           undobuffersize=undobuffersize,
                           visible=visible)

Pen = Turtle

def write_docstringdict(filename="turtle_docstringdict"):
    """Create and write docstring-dictionary to file.

    Optional argument:
    filename -- a string, used as filename
                default value is turtle_docstringdict

    Has to be called explicitly, (not used by the turtle-graphics classes)
    The docstring dictionary will be written to the Python script <filname>.py
    It is intended to serve as a template for translation of the docstrings
    into different languages.
    """
    docsdict = {}

    for methodname in _tg_screen_functions:
        key = "_Screen."+methodname
        docsdict[key] = eval(key).__doc__
    for methodname in _tg_turtle_functions:
        key = "Turtle."+methodname
        docsdict[key] = eval(key).__doc__

    with open("%s.py" % filename,"w") as f:
        keys = sorted(x for x in docsdict
                      if x.split('.')[1] not in _alias_list)
        f.write('docsdict = {\n\n')
        for key in keys[:-1]:
            f.write('%s :\n' % repr(key))
            f.write('        """%s\n""",\n\n' % docsdict[key])
        key = keys[-1]
        f.write('%s :\n' % repr(key))
        f.write('        """%s\n"""\n\n' % docsdict[key])
        f.write("}\n")
        f.close()

def read_docstrings(lang):
    """Read in docstrings from lang-specific docstring dictionary.

    Transfer docstrings, translated to lang, from a dictionary-file
    to the methods of classes Screen and Turtle and - in revised form -
    to the corresponding functions.
    """
    modname = "turtle_docstringdict_%(language)s" % {'language':lang.lower()}
    module = __import__(modname)
    docsdict = module.docsdict
    for key in docsdict:
        try:
#            eval(key).im_func.__doc__ = docsdict[key]
            eval(key).__doc__ = docsdict[key]
        except Exception:
            print("Bad docstring-entry: %s" % key)

_LANGUAGE = _CFG["language"]

try:
    if _LANGUAGE != "english":
        read_docstrings(_LANGUAGE)
except ImportError:
    print("Cannot find docsdict for", _LANGUAGE)
except Exception:
    print ("Unknown Error when trying to import %s-docstring-dictionary" %
                                                                  _LANGUAGE)


def getmethparlist(ob):
    """Get strings describing the arguments for the given object

    Returns a pair of strings representing function parameter lists
    including parenthesis.  The first string is suitable for use in
    function definition and the second is suitable for use in function
    call.  The "self" parameter is not included.
    """
    defText = callText = ""
    # bit of a hack for methods - turn it into a function
    # but we drop the "self" param.
    # Try and build one for Python defined functions
    args, varargs, varkw = inspect.getargs(ob.__code__)
    items2 = args[1:]
    realArgs = args[1:]
    defaults = ob.__defaults__ or []
    defaults = ["=%r" % (value,) for value in defaults]
    defaults = [""] * (len(realArgs)-len(defaults)) + defaults
    items1 = [arg + dflt for arg, dflt in zip(realArgs, defaults)]
    if varargs is not None:
        items1.append("*" + varargs)
        items2.append("*" + varargs)
    if varkw is not None:
        items1.append("**" + varkw)
        items2.append("**" + varkw)
    defText = ", ".join(items1)
    defText = "(%s)" % defText
    callText = ", ".join(items2)
    callText = "(%s)" % callText
    return defText, callText

def _turtle_docrevise(docstr):
    """To reduce docstrings from RawTurtle class for functions
    """
    import re
    if docstr is None:
        return None
    turtlename = _CFG["exampleturtle"]
    newdocstr = docstr.replace("%s." % turtlename,"")
    parexp = re.compile(r' \(.+ %s\):' % turtlename)
    newdocstr = parexp.sub(":", newdocstr)
    return newdocstr

def _screen_docrevise(docstr):
    """To reduce docstrings from TurtleScreen class for functions
    """
    import re
    if docstr is None:
        return None
    screenname = _CFG["examplescreen"]
    newdocstr = docstr.replace("%s." % screenname,"")
    parexp = re.compile(r' \(.+ %s\):' % screenname)
    newdocstr = parexp.sub(":", newdocstr)
    return newdocstr

## The following mechanism makes all methods of RawTurtle and Turtle available
## as functions. So we can enhance, change, add, delete methods to these
## classes and do not need to change anything here.

__func_body = """\
def {name}{paramslist}:
    if {obj} is None:
        if not TurtleScreen._RUNNING:
            TurtleScreen._RUNNING = True
            raise Terminator
        {obj} = {init}
    try:
        return {obj}.{name}{argslist}
    except TK.TclError:
        if not TurtleScreen._RUNNING:
            TurtleScreen._RUNNING = True
            raise Terminator
        raise
"""

def _make_global_funcs(functions, cls, obj, init, docrevise):
    for methodname in functions:
        method = getattr(cls, methodname)
        pl1, pl2 = getmethparlist(method)
        if pl1 == "":
            print(">>>>>>", pl1, pl2)
            continue
        defstr = __func_body.format(obj=obj, init=init, name=methodname,
                                    paramslist=pl1, argslist=pl2)
        exec(defstr, globals())
        globals()[methodname].__doc__ = docrevise(method.__doc__)

_make_global_funcs(_tg_screen_functions, _Screen,
                   'Turtle._screen', 'Screen()', _screen_docrevise)
_make_global_funcs(_tg_turtle_functions, Turtle,
                   'Turtle._pen', 'Turtle()', _turtle_docrevise)


done = mainloop

if __name__ == "__main__":
    def switchpen():
        if isdown():
            pu()
        else:
            pd()

    def demo1():
        """Demo of old turtle.py - module"""
        reset()
        tracer(True)
        up()
        backward(100)
        down()
        # draw 3 squares; the last filled
        width(3)
        for i in range(3):
            if i == 2:
                begin_fill()
            for _ in range(4):
                forward(20)
                left(90)
            if i == 2:
                color("maroon")
                end_fill()
            up()
            forward(30)
            down()
        width(1)
        color("black")
        # move out of the way
        tracer(False)
        up()
        right(90)
        forward(100)
        right(90)
        forward(100)
        right(180)
        down()
        # some text
        write("startstart", 1)
        write("start", 1)
        color("red")
        # staircase
        for i in range(5):
            forward(20)
            left(90)
            forward(20)
            right(90)
        # filled staircase
        tracer(True)
        begin_fill()
        for i in range(5):
            forward(20)
            left(90)
            forward(20)
            right(90)
        end_fill()
        # more text

    def demo2():
        """Demo of some new features."""
        speed(1)
        st()
        pensize(3)
        setheading(towards(0, 0))
        radius = distance(0, 0)/2.0
        rt(90)
        for _ in range(18):
            switchpen()
            circle(radius, 10)
        write("wait a moment...")
        while undobufferentries():
            undo()
        reset()
        lt(90)
        colormode(255)
        laenge = 10
        pencolor("green")
        pensize(3)
        lt(180)
        for i in range(-2, 16):
            if i > 0:
                begin_fill()
                fillcolor(255-15*i, 0, 15*i)
            for _ in range(3):
                fd(laenge)
                lt(120)
            end_fill()
            laenge += 10
            lt(15)
            speed((speed()+1)%12)
        #end_fill()

        lt(120)
        pu()
        fd(70)
        rt(30)
        pd()
        color("red","yellow")
        speed(0)
        begin_fill()
        for _ in range(4):
            circle(50, 90)
            rt(90)
            fd(30)
            rt(90)
        end_fill()
        lt(90)
        pu()
        fd(30)
        pd()
        shape("turtle")

        tri = getturtle()
        tri.resizemode("auto")
        turtle = Turtle()
        turtle.resizemode("auto")
        turtle.shape("turtle")
        turtle.reset()
        turtle.left(90)
        turtle.speed(0)
        turtle.up()
        turtle.goto(280, 40)
        turtle.lt(30)
        turtle.down()
        turtle.speed(6)
        turtle.color("blue","orange")
        turtle.pensize(2)
        tri.speed(6)
        setheading(towards(turtle))
        count = 1
        while tri.distance(turtle) > 4:
            turtle.fd(3.5)
            turtle.lt(0.6)
            tri.setheading(tri.towards(turtle))
            tri.fd(4)
            if count % 20 == 0:
                turtle.stamp()
                tri.stamp()
                switchpen()
            count += 1
        tri.write("CAUGHT! ", font=("Arial", 16, "bold"), align="right")
        tri.pencolor("black")
        tri.pencolor("red")

        def baba(xdummy, ydummy):
            clearscreen()
            bye()

        time.sleep(2)

        while undobufferentries():
            tri.undo()
            turtle.undo()
        tri.fd(50)
        tri.write("  Click me!", font = ("Courier", 12, "bold") )
        tri.onclick(baba, 1)

    demo1()
    demo2()
    exitonclick()
dbm/ndbm.py000064400000000106151153537450006606 0ustar00"""Provide the _dbm module as a dbm submodule."""

from _dbm import *
dbm/__init__.py000064400000013317151153537450007435 0ustar00"""Generic interface to all dbm clones.

Use

        import dbm
        d = dbm.open(file, 'w', 0o666)

The returned object is a dbm.gnu, dbm.ndbm or dbm.dumb object, dependent on the
type of database being opened (determined by the whichdb function) in the case
of an existing dbm. If the dbm does not exist and the create or new flag ('c'
or 'n') was specified, the dbm type will be determined by the availability of
the modules (tested in the above order).

It has the following interface (key and data are strings):

        d[key] = data   # store data at key (may override data at
                        # existing key)
        data = d[key]   # retrieve data at key (raise KeyError if no
                        # such key)
        del d[key]      # delete data stored at key (raises KeyError
                        # if no such key)
        flag = key in d # true if the key exists
        list = d.keys() # return a list of all existing keys (slow!)

Future versions may change the order in which implementations are
tested for existence, and add interfaces to other dbm-like
implementations.
"""

__all__ = ['open', 'whichdb', 'error']

import io
import os
import struct
import sys


class error(Exception):
    pass

_names = ['dbm.gnu', 'dbm.ndbm', 'dbm.dumb']
_defaultmod = None
_modules = {}

error = (error, OSError)

try:
    from dbm import ndbm
except ImportError:
    ndbm = None


def open(file, flag='r', mode=0o666):
    """Open or create database at path given by *file*.

    Optional argument *flag* can be 'r' (default) for read-only access, 'w'
    for read-write access of an existing database, 'c' for read-write access
    to a new or existing database, and 'n' for read-write access to a new
    database.

    Note: 'r' and 'w' fail if the database doesn't exist; 'c' creates it
    only if it doesn't exist; and 'n' always creates a new database.
    """
    global _defaultmod
    if _defaultmod is None:
        for name in _names:
            try:
                mod = __import__(name, fromlist=['open'])
            except ImportError:
                continue
            if not _defaultmod:
                _defaultmod = mod
            _modules[name] = mod
        if not _defaultmod:
            raise ImportError("no dbm clone found; tried %s" % _names)

    # guess the type of an existing database, if not creating a new one
    result = whichdb(file) if 'n' not in flag else None
    if result is None:
        # db doesn't exist or 'n' flag was specified to create a new db
        if 'c' in flag or 'n' in flag:
            # file doesn't exist and the new flag was used so use default type
            mod = _defaultmod
        else:
            raise error[0]("db file doesn't exist; "
                           "use 'c' or 'n' flag to create a new db")
    elif result == "":
        # db type cannot be determined
        raise error[0]("db type could not be determined")
    elif result not in _modules:
        raise error[0]("db type is {0}, but the module is not "
                       "available".format(result))
    else:
        mod = _modules[result]
    return mod.open(file, flag, mode)


def whichdb(filename):
    """Guess which db package to use to open a db file.

    Return values:

    - None if the database file can't be read;
    - empty string if the file can be read but can't be recognized
    - the name of the dbm submodule (e.g. "ndbm" or "gnu") if recognized.

    Importing the given module may still fail, and opening the
    database using that module may still fail.
    """

    # Check for ndbm first -- this has a .pag and a .dir file
    try:
        f = io.open(filename + ".pag", "rb")
        f.close()
        f = io.open(filename + ".dir", "rb")
        f.close()
        return "dbm.ndbm"
    except OSError:
        # some dbm emulations based on Berkeley DB generate a .db file
        # some do not, but they should be caught by the bsd checks
        try:
            f = io.open(filename + ".db", "rb")
            f.close()
            # guarantee we can actually open the file using dbm
            # kind of overkill, but since we are dealing with emulations
            # it seems like a prudent step
            if ndbm is not None:
                d = ndbm.open(filename)
                d.close()
                return "dbm.ndbm"
        except OSError:
            pass

    # Check for dumbdbm next -- this has a .dir and a .dat file
    try:
        # First check for presence of files
        os.stat(filename + ".dat")
        size = os.stat(filename + ".dir").st_size
        # dumbdbm files with no keys are empty
        if size == 0:
            return "dbm.dumb"
        f = io.open(filename + ".dir", "rb")
        try:
            if f.read(1) in (b"'", b'"'):
                return "dbm.dumb"
        finally:
            f.close()
    except OSError:
        pass

    # See if the file exists, return None if not
    try:
        f = io.open(filename, "rb")
    except OSError:
        return None

    with f:
        # Read the start of the file -- the magic number
        s16 = f.read(16)
    s = s16[0:4]

    # Return "" if not at least 4 bytes
    if len(s) != 4:
        return ""

    # Convert to 4-byte int in native byte order -- return "" if impossible
    try:
        (magic,) = struct.unpack("=l", s)
    except struct.error:
        return ""

    # Check for GNU dbm
    if magic in (0x13579ace, 0x13579acd, 0x13579acf):
        return "dbm.gnu"

    # Later versions of Berkeley db hash file have a 12-byte pad in
    # front of the file type
    try:
        (magic,) = struct.unpack("=l", s16[-4:])
    except struct.error:
        return ""

    # Unknown
    return ""


if __name__ == "__main__":
    for filename in sys.argv[1:]:
        print(whichdb(filename) or "UNKNOWN", filename)
dbm/dumb.py000064400000026420151153537450006624 0ustar00"""A dumb and slow but simple dbm clone.

For database spam, spam.dir contains the index (a text file),
spam.bak *may* contain a backup of the index (also a text file),
while spam.dat contains the data (a binary file).

XXX TO DO:

- seems to contain a bug when updating...

- reclaim free space (currently, space once occupied by deleted or expanded
items is never reused)

- support concurrent access (currently, if two processes take turns making
updates, they can mess up the index)

- support efficient access to large databases (currently, the whole index
is read when the database is opened, and some updates rewrite the whole index)

- support opening for read-only (flag = 'm')

"""

import ast as _ast
import io as _io
import os as _os
import collections.abc

__all__ = ["error", "open"]

_BLOCKSIZE = 512

error = OSError

class _Database(collections.abc.MutableMapping):

    # The on-disk directory and data files can remain in mutually
    # inconsistent states for an arbitrarily long time (see comments
    # at the end of __setitem__).  This is only repaired when _commit()
    # gets called.  One place _commit() gets called is from __del__(),
    # and if that occurs at program shutdown time, module globals may
    # already have gotten rebound to None.  Since it's crucial that
    # _commit() finish successfully, we can't ignore shutdown races
    # here, and _commit() must not reference any globals.
    _os = _os       # for _commit()
    _io = _io       # for _commit()

    def __init__(self, filebasename, mode, flag='c'):
        self._mode = mode
        self._readonly = (flag == 'r')

        # The directory file is a text file.  Each line looks like
        #    "%r, (%d, %d)\n" % (key, pos, siz)
        # where key is the string key, pos is the offset into the dat
        # file of the associated value's first byte, and siz is the number
        # of bytes in the associated value.
        self._dirfile = filebasename + '.dir'

        # The data file is a binary file pointed into by the directory
        # file, and holds the values associated with keys.  Each value
        # begins at a _BLOCKSIZE-aligned byte offset, and is a raw
        # binary 8-bit string value.
        self._datfile = filebasename + '.dat'
        self._bakfile = filebasename + '.bak'

        # The index is an in-memory dict, mirroring the directory file.
        self._index = None  # maps keys to (pos, siz) pairs

        # Handle the creation
        self._create(flag)
        self._update(flag)

    def _create(self, flag):
        if flag == 'n':
            for filename in (self._datfile, self._bakfile, self._dirfile):
                try:
                    _os.remove(filename)
                except OSError:
                    pass
        # Mod by Jack: create data file if needed
        try:
            f = _io.open(self._datfile, 'r', encoding="Latin-1")
        except OSError:
            if flag not in ('c', 'n'):
                raise
            with _io.open(self._datfile, 'w', encoding="Latin-1") as f:
                self._chmod(self._datfile)
        else:
            f.close()

    # Read directory file into the in-memory index dict.
    def _update(self, flag):
        self._modified = False
        self._index = {}
        try:
            f = _io.open(self._dirfile, 'r', encoding="Latin-1")
        except OSError:
            if flag not in ('c', 'n'):
                raise
            self._modified = True
        else:
            with f:
                for line in f:
                    line = line.rstrip()
                    key, pos_and_siz_pair = _ast.literal_eval(line)
                    key = key.encode('Latin-1')
                    self._index[key] = pos_and_siz_pair

    # Write the index dict to the directory file.  The original directory
    # file (if any) is renamed with a .bak extension first.  If a .bak
    # file currently exists, it's deleted.
    def _commit(self):
        # CAUTION:  It's vital that _commit() succeed, and _commit() can
        # be called from __del__().  Therefore we must never reference a
        # global in this routine.
        if self._index is None or not self._modified:
            return  # nothing to do

        try:
            self._os.unlink(self._bakfile)
        except OSError:
            pass

        try:
            self._os.rename(self._dirfile, self._bakfile)
        except OSError:
            pass

        with self._io.open(self._dirfile, 'w', encoding="Latin-1") as f:
            self._chmod(self._dirfile)
            for key, pos_and_siz_pair in self._index.items():
                # Use Latin-1 since it has no qualms with any value in any
                # position; UTF-8, though, does care sometimes.
                entry = "%r, %r\n" % (key.decode('Latin-1'), pos_and_siz_pair)
                f.write(entry)

    sync = _commit

    def _verify_open(self):
        if self._index is None:
            raise error('DBM object has already been closed')

    def __getitem__(self, key):
        if isinstance(key, str):
            key = key.encode('utf-8')
        self._verify_open()
        pos, siz = self._index[key]     # may raise KeyError
        with _io.open(self._datfile, 'rb') as f:
            f.seek(pos)
            dat = f.read(siz)
        return dat

    # Append val to the data file, starting at a _BLOCKSIZE-aligned
    # offset.  The data file is first padded with NUL bytes (if needed)
    # to get to an aligned offset.  Return pair
    #     (starting offset of val, len(val))
    def _addval(self, val):
        with _io.open(self._datfile, 'rb+') as f:
            f.seek(0, 2)
            pos = int(f.tell())
            npos = ((pos + _BLOCKSIZE - 1) // _BLOCKSIZE) * _BLOCKSIZE
            f.write(b'\0'*(npos-pos))
            pos = npos
            f.write(val)
        return (pos, len(val))

    # Write val to the data file, starting at offset pos.  The caller
    # is responsible for ensuring that there's enough room starting at
    # pos to hold val, without overwriting some other value.  Return
    # pair (pos, len(val)).
    def _setval(self, pos, val):
        with _io.open(self._datfile, 'rb+') as f:
            f.seek(pos)
            f.write(val)
        return (pos, len(val))

    # key is a new key whose associated value starts in the data file
    # at offset pos and with length siz.  Add an index record to
    # the in-memory index dict, and append one to the directory file.
    def _addkey(self, key, pos_and_siz_pair):
        self._index[key] = pos_and_siz_pair
        with _io.open(self._dirfile, 'a', encoding="Latin-1") as f:
            self._chmod(self._dirfile)
            f.write("%r, %r\n" % (key.decode("Latin-1"), pos_and_siz_pair))

    def __setitem__(self, key, val):
        if self._readonly:
            raise error('The database is opened for reading only')
        if isinstance(key, str):
            key = key.encode('utf-8')
        elif not isinstance(key, (bytes, bytearray)):
            raise TypeError("keys must be bytes or strings")
        if isinstance(val, str):
            val = val.encode('utf-8')
        elif not isinstance(val, (bytes, bytearray)):
            raise TypeError("values must be bytes or strings")
        self._verify_open()
        self._modified = True
        if key not in self._index:
            self._addkey(key, self._addval(val))
        else:
            # See whether the new value is small enough to fit in the
            # (padded) space currently occupied by the old value.
            pos, siz = self._index[key]
            oldblocks = (siz + _BLOCKSIZE - 1) // _BLOCKSIZE
            newblocks = (len(val) + _BLOCKSIZE - 1) // _BLOCKSIZE
            if newblocks <= oldblocks:
                self._index[key] = self._setval(pos, val)
            else:
                # The new value doesn't fit in the (padded) space used
                # by the old value.  The blocks used by the old value are
                # forever lost.
                self._index[key] = self._addval(val)

            # Note that _index may be out of synch with the directory
            # file now:  _setval() and _addval() don't update the directory
            # file.  This also means that the on-disk directory and data
            # files are in a mutually inconsistent state, and they'll
            # remain that way until _commit() is called.  Note that this
            # is a disaster (for the database) if the program crashes
            # (so that _commit() never gets called).

    def __delitem__(self, key):
        if self._readonly:
            raise error('The database is opened for reading only')
        if isinstance(key, str):
            key = key.encode('utf-8')
        self._verify_open()
        self._modified = True
        # The blocks used by the associated value are lost.
        del self._index[key]
        # XXX It's unclear why we do a _commit() here (the code always
        # XXX has, so I'm not changing it).  __setitem__ doesn't try to
        # XXX keep the directory file in synch.  Why should we?  Or
        # XXX why shouldn't __setitem__?
        self._commit()

    def keys(self):
        try:
            return list(self._index)
        except TypeError:
            raise error('DBM object has already been closed') from None

    def items(self):
        self._verify_open()
        return [(key, self[key]) for key in self._index.keys()]

    def __contains__(self, key):
        if isinstance(key, str):
            key = key.encode('utf-8')
        try:
            return key in self._index
        except TypeError:
            if self._index is None:
                raise error('DBM object has already been closed') from None
            else:
                raise

    def iterkeys(self):
        try:
            return iter(self._index)
        except TypeError:
            raise error('DBM object has already been closed') from None
    __iter__ = iterkeys

    def __len__(self):
        try:
            return len(self._index)
        except TypeError:
            raise error('DBM object has already been closed') from None

    def close(self):
        try:
            self._commit()
        finally:
            self._index = self._datfile = self._dirfile = self._bakfile = None

    __del__ = close

    def _chmod(self, file):
        self._os.chmod(file, self._mode)

    def __enter__(self):
        return self

    def __exit__(self, *args):
        self.close()


def open(file, flag='c', mode=0o666):
    """Open the database file, filename, and return corresponding object.

    The flag argument, used to control how the database is opened in the
    other DBM implementations, supports only the semantics of 'c' and 'n'
    values.  Other values will default to the semantics of 'c' value:
    the database will always opened for update and will be created if it
    does not exist.

    The optional mode argument is the UNIX mode of the file, used only when
    the database has to be created.  It defaults to octal code 0o666 (and
    will be modified by the prevailing umask).

    """

    # Modify mode depending on the umask
    try:
        um = _os.umask(0)
        _os.umask(um)
    except AttributeError:
        pass
    else:
        # Turn off any bits that are set in the umask
        mode = mode & (~um)
    if flag not in ('r', 'w', 'c', 'n'):
        raise ValueError("Flag must be one of 'r', 'w', 'c', or 'n'")
    return _Database(file, mode, flag=flag)
dbm/__pycache__/gnu.cpython-38.pyc000064400000000315151153537450012747 0ustar00U

e5dH�@sdZddlTdS)z,Provide the _gdbm module as a dbm submodule.�)�*N)�__doc__Z_gdbm�rr�/usr/lib64/python3.8/dbm/gnu.py�<module>sdbm/__pycache__/ndbm.cpython-38.pyc000064400000000314151153537450013075 0ustar00U

e5dF�@sdZddlTdS)z+Provide the _dbm module as a dbm submodule.�)�*N)�__doc__Z_dbm�rr� /usr/lib64/python3.8/dbm/ndbm.py�<module>sdbm/__pycache__/dumb.cpython-38.opt-1.pyc000064400000017137151153537450014056 0ustar00U

e5d-�@sVdZddlZddlZddlZddlZddgZ	dZ
eZGdd�dej
j�Zdd
d�ZdS)a�A dumb and slow but simple dbm clone.

For database spam, spam.dir contains the index (a text file),
spam.bak *may* contain a backup of the index (also a text file),
while spam.dat contains the data (a binary file).

XXX TO DO:

- seems to contain a bug when updating...

- reclaim free space (currently, space once occupied by deleted or expanded
items is never reused)

- support concurrent access (currently, if two processes take turns making
updates, they can mess up the index)

- support efficient access to large databases (currently, the whole index
is read when the database is opened, and some updates rewrite the whole index)

- support opening for read-only (flag = 'm')

�N�error�openic@s�eZdZeZeZd+dd�Zdd�Zdd�Zdd	�ZeZ	d
d�Z
dd
�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�ZeZd d!�Zd"d#�ZeZd$d%�Zd&d'�Zd(d)�Zd*S),�	_Database�ccCsL||_|dk|_|d|_|d|_|d|_d|_|�|�|�|�dS)N�rz.dirz.datz.bak)�_mode�	_readonly�_dirfile�_datfile�_bakfile�_index�_create�_update)�selfZfilebasename�mode�flag�r� /usr/lib64/python3.8/dbm/dumb.py�__init__0s




z_Database.__init__cCs�|dkrB|j|j|jfD](}zt�|�Wqtk
r>YqXqztj|jddd�}WnHtk
r�|dkrr�tj|jddd��}|�|j�W5QRXYn
X|�	�dS)N�nr�Latin-1��encoding�rr�w)
r
rr	�_os�remove�OSError�_ior�_chmod�close)rr�filename�frrrr
Isz_Database._createc	Cs�d|_i|_ztj|jddd�}Wn$tk
rF|dkr<�d|_YnFX|�:|D].}|��}t�|�\}}|�	d�}||j|<qRW5QRXdS)NFrrrrT)
�	_modifiedrrrr	r�rstrip�_astZliteral_eval�encode)rrr"�line�key�pos_and_siz_pairrrrr\s
z_Database._updatec	Cs�|jdks|jsdSz|j�|j�Wntk
r:YnXz|j�|j|j�Wntk
rfYnX|jj	|jddd��B}|�
|j�|j��D]$\}}d|�d�|f}|�
|�q�W5QRXdS)Nrrr�%r, %r
)rr#r�unlinkrr�renamer	rrr�items�decode�write)rr"r(r)�entryrrr�_commitpsz_Database._commitcCs|jdkrtd��dS�N�"DBM object has already been closed)rr�rrrr�_verify_open�s
z_Database._verify_openc	Cs\t|t�r|�d�}|��|j|\}}t�|jd��}|�|�|�	|�}W5QRX|S)N�utf-8�rb)
�
isinstance�strr&r5rrrr
�seek�read)rr(�pos�sizr"Zdatrrr�__getitem__�s


z_Database.__getitem__c	Csrt�|jd��R}|�dd�t|���}|tdtt}|�d||�|}|�|�W5QRX|t|�fS)N�rb+r���)	rrr
r:�int�tell�
_BLOCKSIZEr/�len)r�valr"r<Znposrrr�_addval�sz_Database._addvalc	Cs:t�|jd��}|�|�|�|�W5QRX|t|�fS)Nr?)rrr
r:r/rF)rr<rGr"rrr�_setval�s
z_Database._setvalc	CsP||j|<tj|jddd��*}|�|j�|�d|�d�|f�W5QRXdS)N�arrr*)rrrr	rr/r.)rr(r)r"rrr�_addkey�s
z_Database._addkeycCs�|jrtd��t|t�r$|�d�}nt|ttf�s:td��t|t�rP|�d�}nt|ttf�sftd��|��d|_	||j
kr�|�||�|��n^|j
|\}}|t
dt
}t|�t
dt
}||kr�|�||�|j
|<n|�|�|j
|<dS)N�'The database is opened for reading onlyr6zkeys must be bytes or stringszvalues must be bytes or stringsTrA)rrr8r9r&�bytes�	bytearray�	TypeErrorr5r#rrKrHrErFrI)rr(rGr<r=Z	oldblocksZ	newblocksrrr�__setitem__�s(


z_Database.__setitem__cCsD|jrtd��t|t�r"|�d�}|��d|_|j|=|��dS)NrLr6T)	rrr8r9r&r5r#rr1�rr(rrr�__delitem__�s

z_Database.__delitem__cCs0zt|j�WStk
r*td�d�YnXdSr2)�listrrOrr4rrr�keys�sz_Database.keyscs ����fdd��j��D�S)Ncsg|]}|�|f�qSrr)�.0r(r4rr�
<listcomp>�sz#_Database.items.<locals>.<listcomp>)r5rrTr4rr4rr-�sz_Database.itemscCsRt|t�r|�d�}z||jkWStk
rL|jdkrFtd�d�n�YnXdS)Nr6r3)r8r9r&rrOrrQrrr�__contains__�s


z_Database.__contains__cCs0zt|j�WStk
r*td�d�YnXdSr2)�iterrrOrr4rrr�iterkeyssz_Database.iterkeyscCs0zt|j�WStk
r*td�d�YnXdSr2)rFrrOrr4rrr�__len__
sz_Database.__len__c	Cs,z|��W5d|_|_|_|_XdS�N)rr
r	rr1r4rrrr sz_Database.closecCs|j�||j�dSr[)r�chmodr)r�filerrrrsz_Database._chmodcCs|Sr[rr4rrr�	__enter__sz_Database.__enter__cGs|��dSr[)r )r�argsrrr�__exit__sz_Database.__exit__N)r)�__name__�
__module__�__qualname__rrrr
rr1�syncr5r>rHrIrKrPrRrTr-rWrY�__iter__rZr �__del__rr^r`rrrrr#s2

	%rr�cCsVzt�d�}t�|�Wntk
r,YnX||@}|dkrHtd��t|||d�S)aEOpen the database file, filename, and return corresponding object.

    The flag argument, used to control how the database is opened in the
    other DBM implementations, supports only the semantics of 'c' and 'n'
    values.  Other values will default to the semantics of 'c' value:
    the database will always opened for update and will be created if it
    does not exist.

    The optional mode argument is the UNIX mode of the file, used only when
    the database has to be created.  It defaults to octal code 0o666 (and
    will be modified by the prevailing umask).

    r)rrrrz)Flag must be one of 'r', 'w', 'c', or 'n')r)r�umask�AttributeError�
ValueErrorr)r]rrZumrrrr"s

)rrg)�__doc__Zastr%�ior�osrZcollections.abc�collections�__all__rErr�abc�MutableMappingrrrrrr�<module>sdbm/__pycache__/ndbm.cpython-38.opt-1.pyc000064400000000314151153537450014034 0ustar00U

e5dF�@sdZddlTdS)z+Provide the _dbm module as a dbm submodule.�)�*N)�__doc__Z_dbm�rr� /usr/lib64/python3.8/dbm/ndbm.py�<module>sdbm/__pycache__/gnu.cpython-38.opt-1.pyc000064400000000315151153537450013706 0ustar00U

e5dH�@sdZddlTdS)z,Provide the _gdbm module as a dbm submodule.�)�*N)�__doc__Z_gdbm�rr�/usr/lib64/python3.8/dbm/gnu.py�<module>sdbm/__pycache__/gnu.cpython-38.opt-2.pyc000064400000000220151153537450013702 0ustar00U

e5dH�@sddlTdS)�)�*N)Z_gdbm�rr�/usr/lib64/python3.8/dbm/gnu.py�<module>�dbm/__pycache__/__init__.cpython-38.opt-1.pyc000064400000010142151153537450014653 0ustar00U

e5d��@s�dZdddgZddlZddlZddlZddlZGdd�de�Zddd	gZda	iZ
eefZzdd
lm
Z
Wnek
r�dZ
YnXdd
d�Zdd�Zedkr�ejdd�D]Zeee�p�de�q�dS)aNGeneric interface to all dbm clones.

Use

        import dbm
        d = dbm.open(file, 'w', 0o666)

The returned object is a dbm.gnu, dbm.ndbm or dbm.dumb object, dependent on the
type of database being opened (determined by the whichdb function) in the case
of an existing dbm. If the dbm does not exist and the create or new flag ('c'
or 'n') was specified, the dbm type will be determined by the availability of
the modules (tested in the above order).

It has the following interface (key and data are strings):

        d[key] = data   # store data at key (may override data at
                        # existing key)
        data = d[key]   # retrieve data at key (raise KeyError if no
                        # such key)
        del d[key]      # delete data stored at key (raises KeyError
                        # if no such key)
        flag = key in d # true if the key exists
        list = d.keys() # return a list of all existing keys (slow!)

Future versions may change the order in which implementations are
tested for existence, and add interfaces to other dbm-like
implementations.
�open�whichdb�error�Nc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�$/usr/lib64/python3.8/dbm/__init__.pyr&s�dbm.gnu�dbm.ndbm�dbm.dumb)�ndbm�r�c	Cs�tdkr^tD]@}zt|dgd�}Wntk
r:YqYnXtsD|a|t|<qts^tdt��d|krnt|�nd}|dkr�d|ks�d|kr�t}q�tdd��n:|d	kr�tdd
��n$|tkr�tdd�|���nt|}|�|||�S)a�Open or create database at path given by *file*.

    Optional argument *flag* can be 'r' (default) for read-only access, 'w'
    for read-write access of an existing database, 'c' for read-write access
    to a new or existing database, and 'n' for read-write access to a new
    database.

    Note: 'r' and 'w' fail if the database doesn't exist; 'c' creates it
    only if it doesn't exist; and 'n' always creates a new database.
    Nr)�fromlistzno dbm clone found; tried %s�n�crz=db file doesn't exist; use 'c' or 'n' flag to create a new db�zdb type could not be determinedz/db type is {0}, but the module is not available)	�_defaultmod�_names�
__import__�ImportError�_modulesrr�formatr)�file�flag�mode�name�mod�resultrrr	r5s0


�cCs�z6t�|dd�}|��t�|dd�}|��WdStk
r�z>t�|dd�}|��tdk	r�t�|�}|��WYdSWntk
r�YnXYnXzht�|d�t�|d�j}|dkr�Wd	St�|dd�}z|�d
�dkr�W�
Wd	SW5|��XWntk
�rYnXzt�|d�}Wntk
�rHYdSX|�|�d�}W5QRX|dd
�}t	|�d
k�r�dSzt
�d|�\}Wnt
jk
�r�YdSX|dk�r�dSzt
�d|dd��\}Wnt
jk
�r�YdSXdS)auGuess which db package to use to open a db file.

    Return values:

    - None if the database file can't be read;
    - empty string if the file can be read but can't be recognized
    - the name of the dbm submodule (e.g. "ndbm" or "gnu") if recognized.

    Importing the given module may still fail, and opening the
    database using that module may still fail.
    z.pag�rbz.dirrz.dbNz.datrr�)�'�"��rz=l)iΚWi͚WiϚWr
���)
�ior�close�OSErrorr
�os�stat�st_size�read�len�structZunpackr)�filename�f�d�sizeZs16�s�magicrrr	rbs`

�__main__r!ZUNKNOWN)rr)�__doc__�__all__r'r*r/�sys�	Exceptionrrrrr)Zdbmr
rrrr�argvr0�printrrrr	�<module>s&



-Ydbm/__pycache__/ndbm.cpython-38.opt-2.pyc000064400000000220151153537450014031 0ustar00U

e5dF�@sddlTdS)�)�*N)Z_dbm�rr� /usr/lib64/python3.8/dbm/ndbm.py�<module>�dbm/__pycache__/dumb.cpython-38.opt-2.pyc000064400000014525151153537450014055 0ustar00U

e5d-�@sRddlZddlZddlZddlZddgZdZ	e
ZGdd�dejj
�Zd
d	d�ZdS)�N�error�openic@s�eZdZeZeZd+dd�Zdd�Zdd�Zdd	�ZeZ	d
d�Z
dd
�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�ZeZd d!�Zd"d#�ZeZd$d%�Zd&d'�Zd(d)�Zd*S),�	_Database�ccCsL||_|dk|_|d|_|d|_|d|_d|_|�|�|�|�dS)N�rz.dirz.datz.bak)�_mode�	_readonly�_dirfile�_datfile�_bakfile�_index�_create�_update)�selfZfilebasename�mode�flag�r� /usr/lib64/python3.8/dbm/dumb.py�__init__0s




z_Database.__init__cCs�|dkrB|j|j|jfD](}zt�|�Wqtk
r>YqXqztj|jddd�}WnHtk
r�|dkrr�tj|jddd��}|�|j�W5QRXYn
X|�	�dS)N�nr�Latin-1��encoding�rr�w)
r
rr	�_os�remove�OSError�_ior�_chmod�close)rr�filename�frrrr
Isz_Database._createc	Cs�d|_i|_ztj|jddd�}Wn$tk
rF|dkr<�d|_YnFX|�:|D].}|��}t�|�\}}|�	d�}||j|<qRW5QRXdS)NFrrrrT)
�	_modifiedrrrr	r�rstrip�_astZliteral_eval�encode)rrr"�line�key�pos_and_siz_pairrrrr\s
z_Database._updatec	Cs�|jdks|jsdSz|j�|j�Wntk
r:YnXz|j�|j|j�Wntk
rfYnX|jj	|jddd��B}|�
|j�|j��D]$\}}d|�d�|f}|�
|�q�W5QRXdS)Nrrr�%r, %r
)rr#r�unlinkrr�renamer	rrr�items�decode�write)rr"r(r)�entryrrr�_commitpsz_Database._commitcCs|jdkrtd��dS�N�"DBM object has already been closed)rr�rrrr�_verify_open�s
z_Database._verify_openc	Cs\t|t�r|�d�}|��|j|\}}t�|jd��}|�|�|�	|�}W5QRX|S)N�utf-8�rb)
�
isinstance�strr&r5rrrr
�seek�read)rr(�pos�sizr"Zdatrrr�__getitem__�s


z_Database.__getitem__c	Csrt�|jd��R}|�dd�t|���}|tdtt}|�d||�|}|�|�W5QRX|t|�fS)N�rb+r���)	rrr
r:�int�tell�
_BLOCKSIZEr/�len)r�valr"r<Znposrrr�_addval�sz_Database._addvalc	Cs:t�|jd��}|�|�|�|�W5QRX|t|�fS)Nr?)rrr
r:r/rF)rr<rGr"rrr�_setval�s
z_Database._setvalc	CsP||j|<tj|jddd��*}|�|j�|�d|�d�|f�W5QRXdS)N�arrr*)rrrr	rr/r.)rr(r)r"rrr�_addkey�s
z_Database._addkeycCs�|jrtd��t|t�r$|�d�}nt|ttf�s:td��t|t�rP|�d�}nt|ttf�sftd��|��d|_	||j
kr�|�||�|��n^|j
|\}}|t
dt
}t|�t
dt
}||kr�|�||�|j
|<n|�|�|j
|<dS)N�'The database is opened for reading onlyr6zkeys must be bytes or stringszvalues must be bytes or stringsTrA)rrr8r9r&�bytes�	bytearray�	TypeErrorr5r#rrKrHrErFrI)rr(rGr<r=Z	oldblocksZ	newblocksrrr�__setitem__�s(


z_Database.__setitem__cCsD|jrtd��t|t�r"|�d�}|��d|_|j|=|��dS)NrLr6T)	rrr8r9r&r5r#rr1�rr(rrr�__delitem__�s

z_Database.__delitem__cCs0zt|j�WStk
r*td�d�YnXdSr2)�listrrOrr4rrr�keys�sz_Database.keyscs ����fdd��j��D�S)Ncsg|]}|�|f�qSrr)�.0r(r4rr�
<listcomp>�sz#_Database.items.<locals>.<listcomp>)r5rrTr4rr4rr-�sz_Database.itemscCsRt|t�r|�d�}z||jkWStk
rL|jdkrFtd�d�n�YnXdS)Nr6r3)r8r9r&rrOrrQrrr�__contains__�s


z_Database.__contains__cCs0zt|j�WStk
r*td�d�YnXdSr2)�iterrrOrr4rrr�iterkeyssz_Database.iterkeyscCs0zt|j�WStk
r*td�d�YnXdSr2)rFrrOrr4rrr�__len__
sz_Database.__len__c	Cs,z|��W5d|_|_|_|_XdS�N)rr
r	rr1r4rrrr sz_Database.closecCs|j�||j�dSr[)r�chmodr)r�filerrrrsz_Database._chmodcCs|Sr[rr4rrr�	__enter__sz_Database.__enter__cGs|��dSr[)r )r�argsrrr�__exit__sz_Database.__exit__N)r)�__name__�
__module__�__qualname__rrrr
rr1�syncr5r>rHrIrKrPrRrTr-rWrY�__iter__rZr �__del__rr^r`rrrrr#s2

	%rr�cCsVzt�d�}t�|�Wntk
r,YnX||@}|dkrHtd��t|||d�S)Nr)rrrrz)Flag must be one of 'r', 'w', 'c', or 'n')r)r�umask�AttributeError�
ValueErrorr)r]rrZumrrrr"s

)rrg)Zastr%�ior�osrZcollections.abc�collections�__all__rErr�abc�MutableMappingrrrrrr�<module>sdbm/__pycache__/__init__.cpython-38.opt-2.pyc000064400000004313151153537450014657 0ustar00U

e5d��@s�dddgZddlZddlZddlZddlZGdd�de�ZdddgZdaiZ	ee
fZzdd	lmZWne
k
r|dZYnXddd�Zd
d�Zedkr�ejdd�D]Zeee�p�de�q�dS)�open�whichdb�error�Nc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�$/usr/lib64/python3.8/dbm/__init__.pyr&s�dbm.gnu�dbm.ndbm�dbm.dumb)�ndbm�r�c	Cs�tdkr^tD]@}zt|dgd�}Wntk
r:YqYnXtsD|a|t|<qts^tdt��d|krnt|�nd}|dkr�d|ks�d|kr�t}q�tdd��n:|dkr�tdd	��n$|tkr�tdd
�|���nt|}|�|||�S)Nr)�fromlistzno dbm clone found; tried %s�n�crz=db file doesn't exist; use 'c' or 'n' flag to create a new db�zdb type could not be determinedz/db type is {0}, but the module is not available)	�_defaultmod�_names�
__import__�ImportError�_modulesrr�formatr)�file�flag�mode�name�mod�resultrrr	r5s0


�cCs�z6t�|dd�}|��t�|dd�}|��WdStk
r�z>t�|dd�}|��tdk	r�t�|�}|��WYdSWntk
r�YnXYnXzht�|d�t�|d�j}|dkr�WdSt�|dd�}z|�d	�d
kr�W�
WdSW5|��XWntk
�rYnXzt�|d�}Wntk
�rHYdSX|�|�d�}W5QRX|dd�}t	|�dk�r�d
Szt
�d|�\}Wnt
jk
�r�Yd
SX|dk�r�dSzt
�d|dd��\}Wnt
jk
�r�Yd
SXd
S)Nz.pag�rbz.dirrz.dbz.datrr�)�'�"��rz=l)iΚWi͚WiϚWr
���)
�ior�close�OSErrorr
�os�stat�st_size�read�len�structZunpackr)�filename�f�d�sizeZs16�s�magicrrr	rbs`

�__main__r!ZUNKNOWN)rr)�__all__r'r*r/�sys�	Exceptionrrrrr)Zdbmr
rrrr�argvr0�printrrrr	�<module>s$



-Ydbm/__pycache__/dumb.cpython-38.pyc000064400000017137151153537450013117 0ustar00U

e5d-�@sVdZddlZddlZddlZddlZddgZ	dZ
eZGdd�dej
j�Zdd
d�ZdS)a�A dumb and slow but simple dbm clone.

For database spam, spam.dir contains the index (a text file),
spam.bak *may* contain a backup of the index (also a text file),
while spam.dat contains the data (a binary file).

XXX TO DO:

- seems to contain a bug when updating...

- reclaim free space (currently, space once occupied by deleted or expanded
items is never reused)

- support concurrent access (currently, if two processes take turns making
updates, they can mess up the index)

- support efficient access to large databases (currently, the whole index
is read when the database is opened, and some updates rewrite the whole index)

- support opening for read-only (flag = 'm')

�N�error�openic@s�eZdZeZeZd+dd�Zdd�Zdd�Zdd	�ZeZ	d
d�Z
dd
�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�ZeZd d!�Zd"d#�ZeZd$d%�Zd&d'�Zd(d)�Zd*S),�	_Database�ccCsL||_|dk|_|d|_|d|_|d|_d|_|�|�|�|�dS)N�rz.dirz.datz.bak)�_mode�	_readonly�_dirfile�_datfile�_bakfile�_index�_create�_update)�selfZfilebasename�mode�flag�r� /usr/lib64/python3.8/dbm/dumb.py�__init__0s




z_Database.__init__cCs�|dkrB|j|j|jfD](}zt�|�Wqtk
r>YqXqztj|jddd�}WnHtk
r�|dkrr�tj|jddd��}|�|j�W5QRXYn
X|�	�dS)N�nr�Latin-1��encoding�rr�w)
r
rr	�_os�remove�OSError�_ior�_chmod�close)rr�filename�frrrr
Isz_Database._createc	Cs�d|_i|_ztj|jddd�}Wn$tk
rF|dkr<�d|_YnFX|�:|D].}|��}t�|�\}}|�	d�}||j|<qRW5QRXdS)NFrrrrT)
�	_modifiedrrrr	r�rstrip�_astZliteral_eval�encode)rrr"�line�key�pos_and_siz_pairrrrr\s
z_Database._updatec	Cs�|jdks|jsdSz|j�|j�Wntk
r:YnXz|j�|j|j�Wntk
rfYnX|jj	|jddd��B}|�
|j�|j��D]$\}}d|�d�|f}|�
|�q�W5QRXdS)Nrrr�%r, %r
)rr#r�unlinkrr�renamer	rrr�items�decode�write)rr"r(r)�entryrrr�_commitpsz_Database._commitcCs|jdkrtd��dS�N�"DBM object has already been closed)rr�rrrr�_verify_open�s
z_Database._verify_openc	Cs\t|t�r|�d�}|��|j|\}}t�|jd��}|�|�|�	|�}W5QRX|S)N�utf-8�rb)
�
isinstance�strr&r5rrrr
�seek�read)rr(�pos�sizr"Zdatrrr�__getitem__�s


z_Database.__getitem__c	Csrt�|jd��R}|�dd�t|���}|tdtt}|�d||�|}|�|�W5QRX|t|�fS)N�rb+r���)	rrr
r:�int�tell�
_BLOCKSIZEr/�len)r�valr"r<Znposrrr�_addval�sz_Database._addvalc	Cs:t�|jd��}|�|�|�|�W5QRX|t|�fS)Nr?)rrr
r:r/rF)rr<rGr"rrr�_setval�s
z_Database._setvalc	CsP||j|<tj|jddd��*}|�|j�|�d|�d�|f�W5QRXdS)N�arrr*)rrrr	rr/r.)rr(r)r"rrr�_addkey�s
z_Database._addkeycCs�|jrtd��t|t�r$|�d�}nt|ttf�s:td��t|t�rP|�d�}nt|ttf�sftd��|��d|_	||j
kr�|�||�|��n^|j
|\}}|t
dt
}t|�t
dt
}||kr�|�||�|j
|<n|�|�|j
|<dS)N�'The database is opened for reading onlyr6zkeys must be bytes or stringszvalues must be bytes or stringsTrA)rrr8r9r&�bytes�	bytearray�	TypeErrorr5r#rrKrHrErFrI)rr(rGr<r=Z	oldblocksZ	newblocksrrr�__setitem__�s(


z_Database.__setitem__cCsD|jrtd��t|t�r"|�d�}|��d|_|j|=|��dS)NrLr6T)	rrr8r9r&r5r#rr1�rr(rrr�__delitem__�s

z_Database.__delitem__cCs0zt|j�WStk
r*td�d�YnXdSr2)�listrrOrr4rrr�keys�sz_Database.keyscs ����fdd��j��D�S)Ncsg|]}|�|f�qSrr)�.0r(r4rr�
<listcomp>�sz#_Database.items.<locals>.<listcomp>)r5rrTr4rr4rr-�sz_Database.itemscCsRt|t�r|�d�}z||jkWStk
rL|jdkrFtd�d�n�YnXdS)Nr6r3)r8r9r&rrOrrQrrr�__contains__�s


z_Database.__contains__cCs0zt|j�WStk
r*td�d�YnXdSr2)�iterrrOrr4rrr�iterkeyssz_Database.iterkeyscCs0zt|j�WStk
r*td�d�YnXdSr2)rFrrOrr4rrr�__len__
sz_Database.__len__c	Cs,z|��W5d|_|_|_|_XdS�N)rr
r	rr1r4rrrr sz_Database.closecCs|j�||j�dSr[)r�chmodr)r�filerrrrsz_Database._chmodcCs|Sr[rr4rrr�	__enter__sz_Database.__enter__cGs|��dSr[)r )r�argsrrr�__exit__sz_Database.__exit__N)r)�__name__�
__module__�__qualname__rrrr
rr1�syncr5r>rHrIrKrPrRrTr-rWrY�__iter__rZr �__del__rr^r`rrrrr#s2

	%rr�cCsVzt�d�}t�|�Wntk
r,YnX||@}|dkrHtd��t|||d�S)aEOpen the database file, filename, and return corresponding object.

    The flag argument, used to control how the database is opened in the
    other DBM implementations, supports only the semantics of 'c' and 'n'
    values.  Other values will default to the semantics of 'c' value:
    the database will always opened for update and will be created if it
    does not exist.

    The optional mode argument is the UNIX mode of the file, used only when
    the database has to be created.  It defaults to octal code 0o666 (and
    will be modified by the prevailing umask).

    r)rrrrz)Flag must be one of 'r', 'w', 'c', or 'n')r)r�umask�AttributeError�
ValueErrorr)r]rrZumrrrr"s

)rrg)�__doc__Zastr%�ior�osrZcollections.abc�collections�__all__rErr�abc�MutableMappingrrrrrr�<module>sdbm/__pycache__/__init__.cpython-38.pyc000064400000010142151153537450013714 0ustar00U

e5d��@s�dZdddgZddlZddlZddlZddlZGdd�de�Zddd	gZda	iZ
eefZzdd
lm
Z
Wnek
r�dZ
YnXdd
d�Zdd�Zedkr�ejdd�D]Zeee�p�de�q�dS)aNGeneric interface to all dbm clones.

Use

        import dbm
        d = dbm.open(file, 'w', 0o666)

The returned object is a dbm.gnu, dbm.ndbm or dbm.dumb object, dependent on the
type of database being opened (determined by the whichdb function) in the case
of an existing dbm. If the dbm does not exist and the create or new flag ('c'
or 'n') was specified, the dbm type will be determined by the availability of
the modules (tested in the above order).

It has the following interface (key and data are strings):

        d[key] = data   # store data at key (may override data at
                        # existing key)
        data = d[key]   # retrieve data at key (raise KeyError if no
                        # such key)
        del d[key]      # delete data stored at key (raises KeyError
                        # if no such key)
        flag = key in d # true if the key exists
        list = d.keys() # return a list of all existing keys (slow!)

Future versions may change the order in which implementations are
tested for existence, and add interfaces to other dbm-like
implementations.
�open�whichdb�error�Nc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�$/usr/lib64/python3.8/dbm/__init__.pyr&s�dbm.gnu�dbm.ndbm�dbm.dumb)�ndbm�r�c	Cs�tdkr^tD]@}zt|dgd�}Wntk
r:YqYnXtsD|a|t|<qts^tdt��d|krnt|�nd}|dkr�d|ks�d|kr�t}q�tdd��n:|d	kr�tdd
��n$|tkr�tdd�|���nt|}|�|||�S)a�Open or create database at path given by *file*.

    Optional argument *flag* can be 'r' (default) for read-only access, 'w'
    for read-write access of an existing database, 'c' for read-write access
    to a new or existing database, and 'n' for read-write access to a new
    database.

    Note: 'r' and 'w' fail if the database doesn't exist; 'c' creates it
    only if it doesn't exist; and 'n' always creates a new database.
    Nr)�fromlistzno dbm clone found; tried %s�n�crz=db file doesn't exist; use 'c' or 'n' flag to create a new db�zdb type could not be determinedz/db type is {0}, but the module is not available)	�_defaultmod�_names�
__import__�ImportError�_modulesrr�formatr)�file�flag�mode�name�mod�resultrrr	r5s0


�cCs�z6t�|dd�}|��t�|dd�}|��WdStk
r�z>t�|dd�}|��tdk	r�t�|�}|��WYdSWntk
r�YnXYnXzht�|d�t�|d�j}|dkr�Wd	St�|dd�}z|�d
�dkr�W�
Wd	SW5|��XWntk
�rYnXzt�|d�}Wntk
�rHYdSX|�|�d�}W5QRX|dd
�}t	|�d
k�r�dSzt
�d|�\}Wnt
jk
�r�YdSX|dk�r�dSzt
�d|dd��\}Wnt
jk
�r�YdSXdS)auGuess which db package to use to open a db file.

    Return values:

    - None if the database file can't be read;
    - empty string if the file can be read but can't be recognized
    - the name of the dbm submodule (e.g. "ndbm" or "gnu") if recognized.

    Importing the given module may still fail, and opening the
    database using that module may still fail.
    z.pag�rbz.dirrz.dbNz.datrr�)�'�"��rz=l)iΚWi͚WiϚWr
���)
�ior�close�OSErrorr
�os�stat�st_size�read�len�structZunpackr)�filename�f�d�sizeZs16�s�magicrrr	rbs`

�__main__r!ZUNKNOWN)rr)�__doc__�__all__r'r*r/�sys�	Exceptionrrrrr)Zdbmr
rrrr�argvr0�printrrrr	�<module>s&



-Ydbm/gnu.py000064400000000110151153537450006452 0ustar00"""Provide the _gdbm module as a dbm submodule."""

from _gdbm import *
this.py000064400000001753151153537450006104 0ustar00s = """Gur Mra bs Clguba, ol Gvz Crgref

Ornhgvshy vf orggre guna htyl.
Rkcyvpvg vf orggre guna vzcyvpvg.
Fvzcyr vf orggre guna pbzcyrk.
Pbzcyrk vf orggre guna pbzcyvpngrq.
Syng vf orggre guna arfgrq.
Fcnefr vf orggre guna qrafr.
Ernqnovyvgl pbhagf.
Fcrpvny pnfrf nera'g fcrpvny rabhtu gb oernx gur ehyrf.
Nygubhtu cenpgvpnyvgl orngf chevgl.
Reebef fubhyq arire cnff fvyragyl.
Hayrff rkcyvpvgyl fvyraprq.
Va gur snpr bs nzovthvgl, ershfr gur grzcgngvba gb thrff.
Gurer fubhyq or bar-- naq cersrenoyl bayl bar --boivbhf jnl gb qb vg.
Nygubhtu gung jnl znl abg or boivbhf ng svefg hayrff lbh'er Qhgpu.
Abj vf orggre guna arire.
Nygubhtu arire vf bsgra orggre guna *evtug* abj.
Vs gur vzcyrzragngvba vf uneq gb rkcynva, vg'f n onq vqrn.
Vs gur vzcyrzragngvba vf rnfl gb rkcynva, vg znl or n tbbq vqrn.
Anzrfcnprf ner bar ubaxvat terng vqrn -- yrg'f qb zber bs gubfr!"""

d = {}
for c in (65, 97):
    for i in range(26):
        d[chr(i+c)] = chr((i+13) % 26 + c)

print("".join([d.get(c, c) for c in s]))
fileinput.py000064400000034565151153537450007143 0ustar00"""Helper class to quickly write a loop over all standard input files.

Typical use is:

    import fileinput
    for line in fileinput.input():
        process(line)

This iterates over the lines of all files listed in sys.argv[1:],
defaulting to sys.stdin if the list is empty.  If a filename is '-' it
is also replaced by sys.stdin and the optional arguments mode and
openhook are ignored.  To specify an alternative list of filenames,
pass it as the argument to input().  A single file name is also allowed.

Functions filename(), lineno() return the filename and cumulative line
number of the line that has just been read; filelineno() returns its
line number in the current file; isfirstline() returns true iff the
line just read is the first line of its file; isstdin() returns true
iff the line was read from sys.stdin.  Function nextfile() closes the
current file so that the next iteration will read the first line from
the next file (if any); lines not read from the file will not count
towards the cumulative line count; the filename is not changed until
after the first line of the next file has been read.  Function close()
closes the sequence.

Before any lines have been read, filename() returns None and both line
numbers are zero; nextfile() has no effect.  After all lines have been
read, filename() and the line number functions return the values
pertaining to the last line read; nextfile() has no effect.

All files are opened in text mode by default, you can override this by
setting the mode parameter to input() or FileInput.__init__().
If an I/O error occurs during opening or reading a file, the OSError
exception is raised.

If sys.stdin is used more than once, the second and further use will
return no lines, except perhaps for interactive use, or if it has been
explicitly reset (e.g. using sys.stdin.seek(0)).

Empty files are opened and immediately closed; the only time their
presence in the list of filenames is noticeable at all is when the
last file opened is empty.

It is possible that the last line of a file doesn't end in a newline
character; otherwise lines are returned including the trailing
newline.

Class FileInput is the implementation; its methods filename(),
lineno(), fileline(), isfirstline(), isstdin(), nextfile() and close()
correspond to the functions in the module.  In addition it has a
readline() method which returns the next input line, and a
__getitem__() method which implements the sequence behavior.  The
sequence must be accessed in strictly sequential order; sequence
access and readline() cannot be mixed.

Optional in-place filtering: if the keyword argument inplace=1 is
passed to input() or to the FileInput constructor, the file is moved
to a backup file and standard output is directed to the input file.
This makes it possible to write a filter that rewrites its input file
in place.  If the keyword argument backup=".<some extension>" is also
given, it specifies the extension for the backup file, and the backup
file remains around; by default, the extension is ".bak" and it is
deleted when the output file is closed.  In-place filtering is
disabled when standard input is read.  XXX The current implementation
does not work for MS-DOS 8+3 filesystems.

XXX Possible additions:

- optional getopt argument processing
- isatty()
- read(), read(size), even readlines()

"""

import sys, os

__all__ = ["input", "close", "nextfile", "filename", "lineno", "filelineno",
           "fileno", "isfirstline", "isstdin", "FileInput", "hook_compressed",
           "hook_encoded"]

_state = None

def input(files=None, inplace=False, backup="", *, mode="r", openhook=None):
    """Return an instance of the FileInput class, which can be iterated.

    The parameters are passed to the constructor of the FileInput class.
    The returned instance, in addition to being an iterator,
    keeps global state for the functions of this module,.
    """
    global _state
    if _state and _state._file:
        raise RuntimeError("input() already active")
    _state = FileInput(files, inplace, backup, mode=mode, openhook=openhook)
    return _state

def close():
    """Close the sequence."""
    global _state
    state = _state
    _state = None
    if state:
        state.close()

def nextfile():
    """
    Close the current file so that the next iteration will read the first
    line from the next file (if any); lines not read from the file will
    not count towards the cumulative line count. The filename is not
    changed until after the first line of the next file has been read.
    Before the first line has been read, this function has no effect;
    it cannot be used to skip the first file. After the last line of the
    last file has been read, this function has no effect.
    """
    if not _state:
        raise RuntimeError("no active input()")
    return _state.nextfile()

def filename():
    """
    Return the name of the file currently being read.
    Before the first line has been read, returns None.
    """
    if not _state:
        raise RuntimeError("no active input()")
    return _state.filename()

def lineno():
    """
    Return the cumulative line number of the line that has just been read.
    Before the first line has been read, returns 0. After the last line
    of the last file has been read, returns the line number of that line.
    """
    if not _state:
        raise RuntimeError("no active input()")
    return _state.lineno()

def filelineno():
    """
    Return the line number in the current file. Before the first line
    has been read, returns 0. After the last line of the last file has
    been read, returns the line number of that line within the file.
    """
    if not _state:
        raise RuntimeError("no active input()")
    return _state.filelineno()

def fileno():
    """
    Return the file number of the current file. When no file is currently
    opened, returns -1.
    """
    if not _state:
        raise RuntimeError("no active input()")
    return _state.fileno()

def isfirstline():
    """
    Returns true the line just read is the first line of its file,
    otherwise returns false.
    """
    if not _state:
        raise RuntimeError("no active input()")
    return _state.isfirstline()

def isstdin():
    """
    Returns true if the last line was read from sys.stdin,
    otherwise returns false.
    """
    if not _state:
        raise RuntimeError("no active input()")
    return _state.isstdin()

class FileInput:
    """FileInput([files[, inplace[, backup]]], *, mode=None, openhook=None)

    Class FileInput is the implementation of the module; its methods
    filename(), lineno(), fileline(), isfirstline(), isstdin(), fileno(),
    nextfile() and close() correspond to the functions of the same name
    in the module.
    In addition it has a readline() method which returns the next
    input line, and a __getitem__() method which implements the
    sequence behavior. The sequence must be accessed in strictly
    sequential order; random access and readline() cannot be mixed.
    """

    def __init__(self, files=None, inplace=False, backup="", *,
                 mode="r", openhook=None):
        if isinstance(files, str):
            files = (files,)
        elif isinstance(files, os.PathLike):
            files = (os.fspath(files), )
        else:
            if files is None:
                files = sys.argv[1:]
            if not files:
                files = ('-',)
            else:
                files = tuple(files)
        self._files = files
        self._inplace = inplace
        self._backup = backup
        self._savestdout = None
        self._output = None
        self._filename = None
        self._startlineno = 0
        self._filelineno = 0
        self._file = None
        self._isstdin = False
        self._backupfilename = None
        # restrict mode argument to reading modes
        if mode not in ('r', 'rU', 'U', 'rb'):
            raise ValueError("FileInput opening mode must be one of "
                             "'r', 'rU', 'U' and 'rb'")
        if 'U' in mode:
            import warnings
            warnings.warn("'U' mode is deprecated",
                          DeprecationWarning, 2)
        self._mode = mode
        self._write_mode = mode.replace('r', 'w') if 'U' not in mode else 'w'
        if openhook:
            if inplace:
                raise ValueError("FileInput cannot use an opening hook in inplace mode")
            if not callable(openhook):
                raise ValueError("FileInput openhook must be callable")
        self._openhook = openhook

    def __del__(self):
        self.close()

    def close(self):
        try:
            self.nextfile()
        finally:
            self._files = ()

    def __enter__(self):
        return self

    def __exit__(self, type, value, traceback):
        self.close()

    def __iter__(self):
        return self

    def __next__(self):
        while True:
            line = self._readline()
            if line:
                self._filelineno += 1
                return line
            if not self._file:
                raise StopIteration
            self.nextfile()
            # repeat with next file

    def __getitem__(self, i):
        import warnings
        warnings.warn(
            "Support for indexing FileInput objects is deprecated. "
            "Use iterator protocol instead.",
            DeprecationWarning,
            stacklevel=2
        )
        if i != self.lineno():
            raise RuntimeError("accessing lines out of order")
        try:
            return self.__next__()
        except StopIteration:
            raise IndexError("end of input reached")

    def nextfile(self):
        savestdout = self._savestdout
        self._savestdout = None
        if savestdout:
            sys.stdout = savestdout

        output = self._output
        self._output = None
        try:
            if output:
                output.close()
        finally:
            file = self._file
            self._file = None
            try:
                del self._readline  # restore FileInput._readline
            except AttributeError:
                pass
            try:
                if file and not self._isstdin:
                    file.close()
            finally:
                backupfilename = self._backupfilename
                self._backupfilename = None
                if backupfilename and not self._backup:
                    try: os.unlink(backupfilename)
                    except OSError: pass

                self._isstdin = False

    def readline(self):
        while True:
            line = self._readline()
            if line:
                self._filelineno += 1
                return line
            if not self._file:
                return line
            self.nextfile()
            # repeat with next file

    def _readline(self):
        if not self._files:
            if 'b' in self._mode:
                return b''
            else:
                return ''
        self._filename = self._files[0]
        self._files = self._files[1:]
        self._startlineno = self.lineno()
        self._filelineno = 0
        self._file = None
        self._isstdin = False
        self._backupfilename = 0
        if self._filename == '-':
            self._filename = '<stdin>'
            if 'b' in self._mode:
                self._file = getattr(sys.stdin, 'buffer', sys.stdin)
            else:
                self._file = sys.stdin
            self._isstdin = True
        else:
            if self._inplace:
                self._backupfilename = (
                    os.fspath(self._filename) + (self._backup or ".bak"))
                try:
                    os.unlink(self._backupfilename)
                except OSError:
                    pass
                # The next few lines may raise OSError
                os.rename(self._filename, self._backupfilename)
                self._file = open(self._backupfilename, self._mode)
                try:
                    perm = os.fstat(self._file.fileno()).st_mode
                except OSError:
                    self._output = open(self._filename, self._write_mode)
                else:
                    mode = os.O_CREAT | os.O_WRONLY | os.O_TRUNC
                    if hasattr(os, 'O_BINARY'):
                        mode |= os.O_BINARY

                    fd = os.open(self._filename, mode, perm)
                    self._output = os.fdopen(fd, self._write_mode)
                    try:
                        os.chmod(self._filename, perm)
                    except OSError:
                        pass
                self._savestdout = sys.stdout
                sys.stdout = self._output
            else:
                # This may raise OSError
                if self._openhook:
                    self._file = self._openhook(self._filename, self._mode)
                else:
                    self._file = open(self._filename, self._mode)
        self._readline = self._file.readline  # hide FileInput._readline
        return self._readline()

    def filename(self):
        return self._filename

    def lineno(self):
        return self._startlineno + self._filelineno

    def filelineno(self):
        return self._filelineno

    def fileno(self):
        if self._file:
            try:
                return self._file.fileno()
            except ValueError:
                return -1
        else:
            return -1

    def isfirstline(self):
        return self._filelineno == 1

    def isstdin(self):
        return self._isstdin


def hook_compressed(filename, mode):
    ext = os.path.splitext(filename)[1]
    if ext == '.gz':
        import gzip
        return gzip.open(filename, mode)
    elif ext == '.bz2':
        import bz2
        return bz2.BZ2File(filename, mode)
    else:
        return open(filename, mode)


def hook_encoded(encoding, errors=None):
    def openhook(filename, mode):
        return open(filename, mode, encoding=encoding, errors=errors)
    return openhook


def _test():
    import getopt
    inplace = False
    backup = False
    opts, args = getopt.getopt(sys.argv[1:], "ib:")
    for o, a in opts:
        if o == '-i': inplace = True
        if o == '-b': backup = a
    for line in input(args, inplace=inplace, backup=backup):
        if line[-1:] == '\n': line = line[:-1]
        if line[-1:] == '\r': line = line[:-1]
        print("%d: %s[%d]%s %s" % (lineno(), filename(), filelineno(),
                                   isfirstline() and "*" or "", line))
    print("%d: %s[%d]" % (lineno(), filename(), filelineno()))

if __name__ == '__main__':
    _test()
http/server.py000064400000135757151153537450007436 0ustar00"""HTTP server classes.

Note: BaseHTTPRequestHandler doesn't implement any HTTP request; see
SimpleHTTPRequestHandler for simple implementations of GET, HEAD and POST,
and CGIHTTPRequestHandler for CGI scripts.

It does, however, optionally implement HTTP/1.1 persistent connections,
as of version 0.3.

Notes on CGIHTTPRequestHandler
------------------------------

This class implements GET and POST requests to cgi-bin scripts.

If the os.fork() function is not present (e.g. on Windows),
subprocess.Popen() is used as a fallback, with slightly altered semantics.

In all cases, the implementation is intentionally naive -- all
requests are executed synchronously.

SECURITY WARNING: DON'T USE THIS CODE UNLESS YOU ARE INSIDE A FIREWALL
-- it may execute arbitrary Python code or external programs.

Note that status code 200 is sent prior to execution of a CGI script, so
scripts cannot send other status codes such as 302 (redirect).

XXX To do:

- log requests even later (to capture byte count)
- log user-agent header and other interesting goodies
- send error log to separate file
"""


# See also:
#
# HTTP Working Group                                        T. Berners-Lee
# INTERNET-DRAFT                                            R. T. Fielding
# <draft-ietf-http-v10-spec-00.txt>                     H. Frystyk Nielsen
# Expires September 8, 1995                                  March 8, 1995
#
# URL: http://www.ics.uci.edu/pub/ietf/http/draft-ietf-http-v10-spec-00.txt
#
# and
#
# Network Working Group                                      R. Fielding
# Request for Comments: 2616                                       et al
# Obsoletes: 2068                                              June 1999
# Category: Standards Track
#
# URL: http://www.faqs.org/rfcs/rfc2616.html

# Log files
# ---------
#
# Here's a quote from the NCSA httpd docs about log file format.
#
# | The logfile format is as follows. Each line consists of:
# |
# | host rfc931 authuser [DD/Mon/YYYY:hh:mm:ss] "request" ddd bbbb
# |
# |        host: Either the DNS name or the IP number of the remote client
# |        rfc931: Any information returned by identd for this person,
# |                - otherwise.
# |        authuser: If user sent a userid for authentication, the user name,
# |                  - otherwise.
# |        DD: Day
# |        Mon: Month (calendar name)
# |        YYYY: Year
# |        hh: hour (24-hour format, the machine's timezone)
# |        mm: minutes
# |        ss: seconds
# |        request: The first line of the HTTP request as sent by the client.
# |        ddd: the status code returned by the server, - if not available.
# |        bbbb: the total number of bytes sent,
# |              *not including the HTTP/1.0 header*, - if not available
# |
# | You can determine the name of the file accessed through request.
#
# (Actually, the latter is only true if you know the server configuration
# at the time the request was made!)

__version__ = "0.6"

__all__ = [
    "HTTPServer", "ThreadingHTTPServer", "BaseHTTPRequestHandler",
    "SimpleHTTPRequestHandler", "CGIHTTPRequestHandler",
]

import copy
import datetime
import email.utils
import html
import http.client
import io
import itertools
import mimetypes
import os
import posixpath
import select
import shutil
import socket # For gethostbyaddr()
import socketserver
import sys
import time
import urllib.parse
import contextlib
from functools import partial

from http import HTTPStatus


# Default error message template
DEFAULT_ERROR_MESSAGE = """\
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
        <title>Error response</title>
    </head>
    <body>
        <h1>Error response</h1>
        <p>Error code: %(code)d</p>
        <p>Message: %(message)s.</p>
        <p>Error code explanation: %(code)s - %(explain)s.</p>
    </body>
</html>
"""

DEFAULT_ERROR_CONTENT_TYPE = "text/html;charset=utf-8"

class HTTPServer(socketserver.TCPServer):

    allow_reuse_address = 1    # Seems to make sense in testing environment

    def server_bind(self):
        """Override server_bind to store the server name."""
        socketserver.TCPServer.server_bind(self)
        host, port = self.server_address[:2]
        self.server_name = socket.getfqdn(host)
        self.server_port = port


class ThreadingHTTPServer(socketserver.ThreadingMixIn, HTTPServer):
    daemon_threads = True


class BaseHTTPRequestHandler(socketserver.StreamRequestHandler):

    """HTTP request handler base class.

    The following explanation of HTTP serves to guide you through the
    code as well as to expose any misunderstandings I may have about
    HTTP (so you don't need to read the code to figure out I'm wrong
    :-).

    HTTP (HyperText Transfer Protocol) is an extensible protocol on
    top of a reliable stream transport (e.g. TCP/IP).  The protocol
    recognizes three parts to a request:

    1. One line identifying the request type and path
    2. An optional set of RFC-822-style headers
    3. An optional data part

    The headers and data are separated by a blank line.

    The first line of the request has the form

    <command> <path> <version>

    where <command> is a (case-sensitive) keyword such as GET or POST,
    <path> is a string containing path information for the request,
    and <version> should be the string "HTTP/1.0" or "HTTP/1.1".
    <path> is encoded using the URL encoding scheme (using %xx to signify
    the ASCII character with hex code xx).

    The specification specifies that lines are separated by CRLF but
    for compatibility with the widest range of clients recommends
    servers also handle LF.  Similarly, whitespace in the request line
    is treated sensibly (allowing multiple spaces between components
    and allowing trailing whitespace).

    Similarly, for output, lines ought to be separated by CRLF pairs
    but most clients grok LF characters just fine.

    If the first line of the request has the form

    <command> <path>

    (i.e. <version> is left out) then this is assumed to be an HTTP
    0.9 request; this form has no optional headers and data part and
    the reply consists of just the data.

    The reply form of the HTTP 1.x protocol again has three parts:

    1. One line giving the response code
    2. An optional set of RFC-822-style headers
    3. The data

    Again, the headers and data are separated by a blank line.

    The response code line has the form

    <version> <responsecode> <responsestring>

    where <version> is the protocol version ("HTTP/1.0" or "HTTP/1.1"),
    <responsecode> is a 3-digit response code indicating success or
    failure of the request, and <responsestring> is an optional
    human-readable string explaining what the response code means.

    This server parses the request and the headers, and then calls a
    function specific to the request type (<command>).  Specifically,
    a request SPAM will be handled by a method do_SPAM().  If no
    such method exists the server sends an error response to the
    client.  If it exists, it is called with no arguments:

    do_SPAM()

    Note that the request name is case sensitive (i.e. SPAM and spam
    are different requests).

    The various request details are stored in instance variables:

    - client_address is the client IP address in the form (host,
    port);

    - command, path and version are the broken-down request line;

    - headers is an instance of email.message.Message (or a derived
    class) containing the header information;

    - rfile is a file object open for reading positioned at the
    start of the optional input data part;

    - wfile is a file object open for writing.

    IT IS IMPORTANT TO ADHERE TO THE PROTOCOL FOR WRITING!

    The first thing to be written must be the response line.  Then
    follow 0 or more header lines, then a blank line, and then the
    actual data (if any).  The meaning of the header lines depends on
    the command executed by the server; in most cases, when data is
    returned, there should be at least one header line of the form

    Content-type: <type>/<subtype>

    where <type> and <subtype> should be registered MIME types,
    e.g. "text/html" or "text/plain".

    """

    # The Python system version, truncated to its first component.
    sys_version = "Python/" + sys.version.split()[0]

    # The server software version.  You may want to override this.
    # The format is multiple whitespace-separated strings,
    # where each string is of the form name[/version].
    server_version = "BaseHTTP/" + __version__

    error_message_format = DEFAULT_ERROR_MESSAGE
    error_content_type = DEFAULT_ERROR_CONTENT_TYPE

    # The default request version.  This only affects responses up until
    # the point where the request line is parsed, so it mainly decides what
    # the client gets back when sending a malformed request line.
    # Most web servers default to HTTP 0.9, i.e. don't send a status line.
    default_request_version = "HTTP/0.9"

    def parse_request(self):
        """Parse a request (internal).

        The request should be stored in self.raw_requestline; the results
        are in self.command, self.path, self.request_version and
        self.headers.

        Return True for success, False for failure; on failure, any relevant
        error response has already been sent back.

        """
        self.command = None  # set in case of error on the first line
        self.request_version = version = self.default_request_version
        self.close_connection = True
        requestline = str(self.raw_requestline, 'iso-8859-1')
        requestline = requestline.rstrip('\r\n')
        self.requestline = requestline
        words = requestline.split()
        if len(words) == 0:
            return False

        if len(words) >= 3:  # Enough to determine protocol version
            version = words[-1]
            try:
                if not version.startswith('HTTP/'):
                    raise ValueError
                base_version_number = version.split('/', 1)[1]
                version_number = base_version_number.split(".")
                # RFC 2145 section 3.1 says there can be only one "." and
                #   - major and minor numbers MUST be treated as
                #      separate integers;
                #   - HTTP/2.4 is a lower version than HTTP/2.13, which in
                #      turn is lower than HTTP/12.3;
                #   - Leading zeros MUST be ignored by recipients.
                if len(version_number) != 2:
                    raise ValueError
                version_number = int(version_number[0]), int(version_number[1])
            except (ValueError, IndexError):
                self.send_error(
                    HTTPStatus.BAD_REQUEST,
                    "Bad request version (%r)" % version)
                return False
            if version_number >= (1, 1) and self.protocol_version >= "HTTP/1.1":
                self.close_connection = False
            if version_number >= (2, 0):
                self.send_error(
                    HTTPStatus.HTTP_VERSION_NOT_SUPPORTED,
                    "Invalid HTTP version (%s)" % base_version_number)
                return False
            self.request_version = version

        if not 2 <= len(words) <= 3:
            self.send_error(
                HTTPStatus.BAD_REQUEST,
                "Bad request syntax (%r)" % requestline)
            return False
        command, path = words[:2]
        if len(words) == 2:
            self.close_connection = True
            if command != 'GET':
                self.send_error(
                    HTTPStatus.BAD_REQUEST,
                    "Bad HTTP/0.9 request type (%r)" % command)
                return False
        self.command, self.path = command, path

        # gh-87389: The purpose of replacing '//' with '/' is to protect
        # against open redirect attacks possibly triggered if the path starts
        # with '//' because http clients treat //path as an absolute URI
        # without scheme (similar to http://path) rather than a path.
        if self.path.startswith('//'):
            self.path = '/' + self.path.lstrip('/')  # Reduce to a single /

        # Examine the headers and look for a Connection directive.
        try:
            self.headers = http.client.parse_headers(self.rfile,
                                                     _class=self.MessageClass)
        except http.client.LineTooLong as err:
            self.send_error(
                HTTPStatus.REQUEST_HEADER_FIELDS_TOO_LARGE,
                "Line too long",
                str(err))
            return False
        except http.client.HTTPException as err:
            self.send_error(
                HTTPStatus.REQUEST_HEADER_FIELDS_TOO_LARGE,
                "Too many headers",
                str(err)
            )
            return False

        conntype = self.headers.get('Connection', "")
        if conntype.lower() == 'close':
            self.close_connection = True
        elif (conntype.lower() == 'keep-alive' and
              self.protocol_version >= "HTTP/1.1"):
            self.close_connection = False
        # Examine the headers and look for an Expect directive
        expect = self.headers.get('Expect', "")
        if (expect.lower() == "100-continue" and
                self.protocol_version >= "HTTP/1.1" and
                self.request_version >= "HTTP/1.1"):
            if not self.handle_expect_100():
                return False
        return True

    def handle_expect_100(self):
        """Decide what to do with an "Expect: 100-continue" header.

        If the client is expecting a 100 Continue response, we must
        respond with either a 100 Continue or a final response before
        waiting for the request body. The default is to always respond
        with a 100 Continue. You can behave differently (for example,
        reject unauthorized requests) by overriding this method.

        This method should either return True (possibly after sending
        a 100 Continue response) or send an error response and return
        False.

        """
        self.send_response_only(HTTPStatus.CONTINUE)
        self.end_headers()
        return True

    def handle_one_request(self):
        """Handle a single HTTP request.

        You normally don't need to override this method; see the class
        __doc__ string for information on how to handle specific HTTP
        commands such as GET and POST.

        """
        try:
            self.raw_requestline = self.rfile.readline(65537)
            if len(self.raw_requestline) > 65536:
                self.requestline = ''
                self.request_version = ''
                self.command = ''
                self.send_error(HTTPStatus.REQUEST_URI_TOO_LONG)
                return
            if not self.raw_requestline:
                self.close_connection = True
                return
            if not self.parse_request():
                # An error code has been sent, just exit
                return
            mname = 'do_' + self.command
            if not hasattr(self, mname):
                self.send_error(
                    HTTPStatus.NOT_IMPLEMENTED,
                    "Unsupported method (%r)" % self.command)
                return
            method = getattr(self, mname)
            method()
            self.wfile.flush() #actually send the response if not already done.
        except socket.timeout as e:
            #a read or a write timed out.  Discard this connection
            self.log_error("Request timed out: %r", e)
            self.close_connection = True
            return

    def handle(self):
        """Handle multiple requests if necessary."""
        self.close_connection = True

        self.handle_one_request()
        while not self.close_connection:
            self.handle_one_request()

    def send_error(self, code, message=None, explain=None):
        """Send and log an error reply.

        Arguments are
        * code:    an HTTP error code
                   3 digits
        * message: a simple optional 1 line reason phrase.
                   *( HTAB / SP / VCHAR / %x80-FF )
                   defaults to short entry matching the response code
        * explain: a detailed message defaults to the long entry
                   matching the response code.

        This sends an error response (so it must be called before any
        output has been generated), logs the error, and finally sends
        a piece of HTML explaining the error to the user.

        """

        try:
            shortmsg, longmsg = self.responses[code]
        except KeyError:
            shortmsg, longmsg = '???', '???'
        if message is None:
            message = shortmsg
        if explain is None:
            explain = longmsg
        self.log_error("code %d, message %s", code, message)
        self.send_response(code, message)
        self.send_header('Connection', 'close')

        # Message body is omitted for cases described in:
        #  - RFC7230: 3.3. 1xx, 204(No Content), 304(Not Modified)
        #  - RFC7231: 6.3.6. 205(Reset Content)
        body = None
        if (code >= 200 and
            code not in (HTTPStatus.NO_CONTENT,
                         HTTPStatus.RESET_CONTENT,
                         HTTPStatus.NOT_MODIFIED)):
            # HTML encode to prevent Cross Site Scripting attacks
            # (see bug #1100201)
            content = (self.error_message_format % {
                'code': code,
                'message': html.escape(message, quote=False),
                'explain': html.escape(explain, quote=False)
            })
            body = content.encode('UTF-8', 'replace')
            self.send_header("Content-Type", self.error_content_type)
            self.send_header('Content-Length', str(len(body)))
        self.end_headers()

        if self.command != 'HEAD' and body:
            self.wfile.write(body)

    def send_response(self, code, message=None):
        """Add the response header to the headers buffer and log the
        response code.

        Also send two standard headers with the server software
        version and the current date.

        """
        self.log_request(code)
        self.send_response_only(code, message)
        self.send_header('Server', self.version_string())
        self.send_header('Date', self.date_time_string())

    def send_response_only(self, code, message=None):
        """Send the response header only."""
        if self.request_version != 'HTTP/0.9':
            if message is None:
                if code in self.responses:
                    message = self.responses[code][0]
                else:
                    message = ''
            if not hasattr(self, '_headers_buffer'):
                self._headers_buffer = []
            self._headers_buffer.append(("%s %d %s\r\n" %
                    (self.protocol_version, code, message)).encode(
                        'latin-1', 'strict'))

    def send_header(self, keyword, value):
        """Send a MIME header to the headers buffer."""
        if self.request_version != 'HTTP/0.9':
            if not hasattr(self, '_headers_buffer'):
                self._headers_buffer = []
            self._headers_buffer.append(
                ("%s: %s\r\n" % (keyword, value)).encode('latin-1', 'strict'))

        if keyword.lower() == 'connection':
            if value.lower() == 'close':
                self.close_connection = True
            elif value.lower() == 'keep-alive':
                self.close_connection = False

    def end_headers(self):
        """Send the blank line ending the MIME headers."""
        if self.request_version != 'HTTP/0.9':
            self._headers_buffer.append(b"\r\n")
            self.flush_headers()

    def flush_headers(self):
        if hasattr(self, '_headers_buffer'):
            self.wfile.write(b"".join(self._headers_buffer))
            self._headers_buffer = []

    def log_request(self, code='-', size='-'):
        """Log an accepted request.

        This is called by send_response().

        """
        if isinstance(code, HTTPStatus):
            code = code.value
        self.log_message('"%s" %s %s',
                         self.requestline, str(code), str(size))

    def log_error(self, format, *args):
        """Log an error.

        This is called when a request cannot be fulfilled.  By
        default it passes the message on to log_message().

        Arguments are the same as for log_message().

        XXX This should go to the separate error log.

        """

        self.log_message(format, *args)

    # https://en.wikipedia.org/wiki/List_of_Unicode_characters#Control_codes
    _control_char_table = str.maketrans(
            {c: fr'\x{c:02x}' for c in itertools.chain(range(0x20), range(0x7f,0xa0))})
    _control_char_table[ord('\\')] = r'\\'

    def log_message(self, format, *args):
        """Log an arbitrary message.

        This is used by all other logging functions.  Override
        it if you have specific logging wishes.

        The first argument, FORMAT, is a format string for the
        message to be logged.  If the format string contains
        any % escapes requiring parameters, they should be
        specified as subsequent arguments (it's just like
        printf!).

        The client ip and current date/time are prefixed to
        every message.

        Unicode control characters are replaced with escaped hex
        before writing the output to stderr.

        """

        message = format % args
        sys.stderr.write("%s - - [%s] %s\n" %
                         (self.address_string(),
                          self.log_date_time_string(),
                          message.translate(self._control_char_table)))

    def version_string(self):
        """Return the server software version string."""
        return self.server_version + ' ' + self.sys_version

    def date_time_string(self, timestamp=None):
        """Return the current date and time formatted for a message header."""
        if timestamp is None:
            timestamp = time.time()
        return email.utils.formatdate(timestamp, usegmt=True)

    def log_date_time_string(self):
        """Return the current time formatted for logging."""
        now = time.time()
        year, month, day, hh, mm, ss, x, y, z = time.localtime(now)
        s = "%02d/%3s/%04d %02d:%02d:%02d" % (
                day, self.monthname[month], year, hh, mm, ss)
        return s

    weekdayname = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']

    monthname = [None,
                 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
                 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']

    def address_string(self):
        """Return the client address."""

        return self.client_address[0]

    # Essentially static class variables

    # The version of the HTTP protocol we support.
    # Set this to HTTP/1.1 to enable automatic keepalive
    protocol_version = "HTTP/1.0"

    # MessageClass used to parse headers
    MessageClass = http.client.HTTPMessage

    # hack to maintain backwards compatibility
    responses = {
        v: (v.phrase, v.description)
        for v in HTTPStatus.__members__.values()
    }


class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):

    """Simple HTTP request handler with GET and HEAD commands.

    This serves files from the current directory and any of its
    subdirectories.  The MIME type for files is determined by
    calling the .guess_type() method.

    The GET and HEAD requests are identical except that the HEAD
    request omits the actual contents of the file.

    """

    server_version = "SimpleHTTP/" + __version__

    def __init__(self, *args, directory=None, **kwargs):
        if directory is None:
            directory = os.getcwd()
        self.directory = directory
        super().__init__(*args, **kwargs)

    def do_GET(self):
        """Serve a GET request."""
        f = self.send_head()
        if f:
            try:
                self.copyfile(f, self.wfile)
            finally:
                f.close()

    def do_HEAD(self):
        """Serve a HEAD request."""
        f = self.send_head()
        if f:
            f.close()

    def send_head(self):
        """Common code for GET and HEAD commands.

        This sends the response code and MIME headers.

        Return value is either a file object (which has to be copied
        to the outputfile by the caller unless the command was HEAD,
        and must be closed by the caller under all circumstances), or
        None, in which case the caller has nothing further to do.

        """
        path = self.translate_path(self.path)
        f = None
        if os.path.isdir(path):
            parts = urllib.parse.urlsplit(self.path)
            if not parts.path.endswith('/'):
                # redirect browser - doing basically what apache does
                self.send_response(HTTPStatus.MOVED_PERMANENTLY)
                new_parts = (parts[0], parts[1], parts[2] + '/',
                             parts[3], parts[4])
                new_url = urllib.parse.urlunsplit(new_parts)
                self.send_header("Location", new_url)
                self.end_headers()
                return None
            for index in "index.html", "index.htm":
                index = os.path.join(path, index)
                if os.path.exists(index):
                    path = index
                    break
            else:
                return self.list_directory(path)
        ctype = self.guess_type(path)
        # check for trailing "/" which should return 404. See Issue17324
        # The test for this was added in test_httpserver.py
        # However, some OS platforms accept a trailingSlash as a filename
        # See discussion on python-dev and Issue34711 regarding
        # parseing and rejection of filenames with a trailing slash
        if path.endswith("/"):
            self.send_error(HTTPStatus.NOT_FOUND, "File not found")
            return None
        try:
            f = open(path, 'rb')
        except OSError:
            self.send_error(HTTPStatus.NOT_FOUND, "File not found")
            return None

        try:
            fs = os.fstat(f.fileno())
            # Use browser cache if possible
            if ("If-Modified-Since" in self.headers
                    and "If-None-Match" not in self.headers):
                # compare If-Modified-Since and time of last file modification
                try:
                    ims = email.utils.parsedate_to_datetime(
                        self.headers["If-Modified-Since"])
                except (TypeError, IndexError, OverflowError, ValueError):
                    # ignore ill-formed values
                    pass
                else:
                    if ims.tzinfo is None:
                        # obsolete format with no timezone, cf.
                        # https://tools.ietf.org/html/rfc7231#section-7.1.1.1
                        ims = ims.replace(tzinfo=datetime.timezone.utc)
                    if ims.tzinfo is datetime.timezone.utc:
                        # compare to UTC datetime of last modification
                        last_modif = datetime.datetime.fromtimestamp(
                            fs.st_mtime, datetime.timezone.utc)
                        # remove microseconds, like in If-Modified-Since
                        last_modif = last_modif.replace(microsecond=0)

                        if last_modif <= ims:
                            self.send_response(HTTPStatus.NOT_MODIFIED)
                            self.end_headers()
                            f.close()
                            return None

            self.send_response(HTTPStatus.OK)
            self.send_header("Content-type", ctype)
            self.send_header("Content-Length", str(fs[6]))
            self.send_header("Last-Modified",
                self.date_time_string(fs.st_mtime))
            self.end_headers()
            return f
        except:
            f.close()
            raise

    def list_directory(self, path):
        """Helper to produce a directory listing (absent index.html).

        Return value is either a file object, or None (indicating an
        error).  In either case, the headers are sent, making the
        interface the same as for send_head().

        """
        try:
            list = os.listdir(path)
        except OSError:
            self.send_error(
                HTTPStatus.NOT_FOUND,
                "No permission to list directory")
            return None
        list.sort(key=lambda a: a.lower())
        r = []
        try:
            displaypath = urllib.parse.unquote(self.path,
                                               errors='surrogatepass')
        except UnicodeDecodeError:
            displaypath = urllib.parse.unquote(self.path)
        displaypath = html.escape(displaypath, quote=False)
        enc = sys.getfilesystemencoding()
        title = 'Directory listing for %s' % displaypath
        r.append('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" '
                 '"http://www.w3.org/TR/html4/strict.dtd">')
        r.append('<html>\n<head>')
        r.append('<meta http-equiv="Content-Type" '
                 'content="text/html; charset=%s">' % enc)
        r.append('<title>%s</title>\n</head>' % title)
        r.append('<body>\n<h1>%s</h1>' % title)
        r.append('<hr>\n<ul>')
        for name in list:
            fullname = os.path.join(path, name)
            displayname = linkname = name
            # Append / for directories or @ for symbolic links
            if os.path.isdir(fullname):
                displayname = name + "/"
                linkname = name + "/"
            if os.path.islink(fullname):
                displayname = name + "@"
                # Note: a link to a directory displays with @ and links with /
            r.append('<li><a href="%s">%s</a></li>'
                    % (urllib.parse.quote(linkname,
                                          errors='surrogatepass'),
                       html.escape(displayname, quote=False)))
        r.append('</ul>\n<hr>\n</body>\n</html>\n')
        encoded = '\n'.join(r).encode(enc, 'surrogateescape')
        f = io.BytesIO()
        f.write(encoded)
        f.seek(0)
        self.send_response(HTTPStatus.OK)
        self.send_header("Content-type", "text/html; charset=%s" % enc)
        self.send_header("Content-Length", str(len(encoded)))
        self.end_headers()
        return f

    def translate_path(self, path):
        """Translate a /-separated PATH to the local filename syntax.

        Components that mean special things to the local file system
        (e.g. drive or directory names) are ignored.  (XXX They should
        probably be diagnosed.)

        """
        # abandon query parameters
        path = path.split('?',1)[0]
        path = path.split('#',1)[0]
        # Don't forget explicit trailing slash when normalizing. Issue17324
        trailing_slash = path.rstrip().endswith('/')
        try:
            path = urllib.parse.unquote(path, errors='surrogatepass')
        except UnicodeDecodeError:
            path = urllib.parse.unquote(path)
        path = posixpath.normpath(path)
        words = path.split('/')
        words = filter(None, words)
        path = self.directory
        for word in words:
            if os.path.dirname(word) or word in (os.curdir, os.pardir):
                # Ignore components that are not a simple file/directory name
                continue
            path = os.path.join(path, word)
        if trailing_slash:
            path += '/'
        return path

    def copyfile(self, source, outputfile):
        """Copy all data between two file objects.

        The SOURCE argument is a file object open for reading
        (or anything with a read() method) and the DESTINATION
        argument is a file object open for writing (or
        anything with a write() method).

        The only reason for overriding this would be to change
        the block size or perhaps to replace newlines by CRLF
        -- note however that this the default server uses this
        to copy binary data as well.

        """
        shutil.copyfileobj(source, outputfile)

    def guess_type(self, path):
        """Guess the type of a file.

        Argument is a PATH (a filename).

        Return value is a string of the form type/subtype,
        usable for a MIME Content-type header.

        The default implementation looks the file's extension
        up in the table self.extensions_map, using application/octet-stream
        as a default; however it would be permissible (if
        slow) to look inside the data to make a better guess.

        """

        base, ext = posixpath.splitext(path)
        if ext in self.extensions_map:
            return self.extensions_map[ext]
        ext = ext.lower()
        if ext in self.extensions_map:
            return self.extensions_map[ext]
        else:
            return self.extensions_map['']

    if not mimetypes.inited:
        mimetypes.init() # try to read system mime.types
    extensions_map = mimetypes.types_map.copy()
    extensions_map.update({
        '': 'application/octet-stream', # Default
        '.py': 'text/plain',
        '.c': 'text/plain',
        '.h': 'text/plain',
        })


# Utilities for CGIHTTPRequestHandler

def _url_collapse_path(path):
    """
    Given a URL path, remove extra '/'s and '.' path elements and collapse
    any '..' references and returns a collapsed path.

    Implements something akin to RFC-2396 5.2 step 6 to parse relative paths.
    The utility of this function is limited to is_cgi method and helps
    preventing some security attacks.

    Returns: The reconstituted URL, which will always start with a '/'.

    Raises: IndexError if too many '..' occur within the path.

    """
    # Query component should not be involved.
    path, _, query = path.partition('?')
    path = urllib.parse.unquote(path)

    # Similar to os.path.split(os.path.normpath(path)) but specific to URL
    # path semantics rather than local operating system semantics.
    path_parts = path.split('/')
    head_parts = []
    for part in path_parts[:-1]:
        if part == '..':
            head_parts.pop() # IndexError if more '..' than prior parts
        elif part and part != '.':
            head_parts.append( part )
    if path_parts:
        tail_part = path_parts.pop()
        if tail_part:
            if tail_part == '..':
                head_parts.pop()
                tail_part = ''
            elif tail_part == '.':
                tail_part = ''
    else:
        tail_part = ''

    if query:
        tail_part = '?'.join((tail_part, query))

    splitpath = ('/' + '/'.join(head_parts), tail_part)
    collapsed_path = "/".join(splitpath)

    return collapsed_path



nobody = None

def nobody_uid():
    """Internal routine to get nobody's uid"""
    global nobody
    if nobody:
        return nobody
    try:
        import pwd
    except ImportError:
        return -1
    try:
        nobody = pwd.getpwnam('nobody')[2]
    except KeyError:
        nobody = 1 + max(x[2] for x in pwd.getpwall())
    return nobody


def executable(path):
    """Test for executable file."""
    return os.access(path, os.X_OK)


class CGIHTTPRequestHandler(SimpleHTTPRequestHandler):

    """Complete HTTP server with GET, HEAD and POST commands.

    GET and HEAD also support running CGI scripts.

    The POST command is *only* implemented for CGI scripts.

    """

    # Determine platform specifics
    have_fork = hasattr(os, 'fork')

    # Make rfile unbuffered -- we need to read one line and then pass
    # the rest to a subprocess, so we can't use buffered input.
    rbufsize = 0

    def do_POST(self):
        """Serve a POST request.

        This is only implemented for CGI scripts.

        """

        if self.is_cgi():
            self.run_cgi()
        else:
            self.send_error(
                HTTPStatus.NOT_IMPLEMENTED,
                "Can only POST to CGI scripts")

    def send_head(self):
        """Version of send_head that support CGI scripts"""
        if self.is_cgi():
            return self.run_cgi()
        else:
            return SimpleHTTPRequestHandler.send_head(self)

    def is_cgi(self):
        """Test whether self.path corresponds to a CGI script.

        Returns True and updates the cgi_info attribute to the tuple
        (dir, rest) if self.path requires running a CGI script.
        Returns False otherwise.

        If any exception is raised, the caller should assume that
        self.path was rejected as invalid and act accordingly.

        The default implementation tests whether the normalized url
        path begins with one of the strings in self.cgi_directories
        (and the next character is a '/' or the end of the string).

        """
        collapsed_path = _url_collapse_path(self.path)
        dir_sep = collapsed_path.find('/', 1)
        head, tail = collapsed_path[:dir_sep], collapsed_path[dir_sep+1:]
        if head in self.cgi_directories:
            self.cgi_info = head, tail
            return True
        return False


    cgi_directories = ['/cgi-bin', '/htbin']

    def is_executable(self, path):
        """Test whether argument path is an executable file."""
        return executable(path)

    def is_python(self, path):
        """Test whether argument path is a Python script."""
        head, tail = os.path.splitext(path)
        return tail.lower() in (".py", ".pyw")

    def run_cgi(self):
        """Execute a CGI script."""
        dir, rest = self.cgi_info
        path = dir + '/' + rest
        i = path.find('/', len(dir)+1)
        while i >= 0:
            nextdir = path[:i]
            nextrest = path[i+1:]

            scriptdir = self.translate_path(nextdir)
            if os.path.isdir(scriptdir):
                dir, rest = nextdir, nextrest
                i = path.find('/', len(dir)+1)
            else:
                break

        # find an explicit query string, if present.
        rest, _, query = rest.partition('?')

        # dissect the part after the directory name into a script name &
        # a possible additional path, to be stored in PATH_INFO.
        i = rest.find('/')
        if i >= 0:
            script, rest = rest[:i], rest[i:]
        else:
            script, rest = rest, ''

        scriptname = dir + '/' + script
        scriptfile = self.translate_path(scriptname)
        if not os.path.exists(scriptfile):
            self.send_error(
                HTTPStatus.NOT_FOUND,
                "No such CGI script (%r)" % scriptname)
            return
        if not os.path.isfile(scriptfile):
            self.send_error(
                HTTPStatus.FORBIDDEN,
                "CGI script is not a plain file (%r)" % scriptname)
            return
        ispy = self.is_python(scriptname)
        if self.have_fork or not ispy:
            if not self.is_executable(scriptfile):
                self.send_error(
                    HTTPStatus.FORBIDDEN,
                    "CGI script is not executable (%r)" % scriptname)
                return

        # Reference: http://hoohoo.ncsa.uiuc.edu/cgi/env.html
        # XXX Much of the following could be prepared ahead of time!
        env = copy.deepcopy(os.environ)
        env['SERVER_SOFTWARE'] = self.version_string()
        env['SERVER_NAME'] = self.server.server_name
        env['GATEWAY_INTERFACE'] = 'CGI/1.1'
        env['SERVER_PROTOCOL'] = self.protocol_version
        env['SERVER_PORT'] = str(self.server.server_port)
        env['REQUEST_METHOD'] = self.command
        uqrest = urllib.parse.unquote(rest)
        env['PATH_INFO'] = uqrest
        env['PATH_TRANSLATED'] = self.translate_path(uqrest)
        env['SCRIPT_NAME'] = scriptname
        if query:
            env['QUERY_STRING'] = query
        env['REMOTE_ADDR'] = self.client_address[0]
        authorization = self.headers.get("authorization")
        if authorization:
            authorization = authorization.split()
            if len(authorization) == 2:
                import base64, binascii
                env['AUTH_TYPE'] = authorization[0]
                if authorization[0].lower() == "basic":
                    try:
                        authorization = authorization[1].encode('ascii')
                        authorization = base64.decodebytes(authorization).\
                                        decode('ascii')
                    except (binascii.Error, UnicodeError):
                        pass
                    else:
                        authorization = authorization.split(':')
                        if len(authorization) == 2:
                            env['REMOTE_USER'] = authorization[0]
        # XXX REMOTE_IDENT
        if self.headers.get('content-type') is None:
            env['CONTENT_TYPE'] = self.headers.get_content_type()
        else:
            env['CONTENT_TYPE'] = self.headers['content-type']
        length = self.headers.get('content-length')
        if length:
            env['CONTENT_LENGTH'] = length
        referer = self.headers.get('referer')
        if referer:
            env['HTTP_REFERER'] = referer
        accept = []
        for line in self.headers.getallmatchingheaders('accept'):
            if line[:1] in "\t\n\r ":
                accept.append(line.strip())
            else:
                accept = accept + line[7:].split(',')
        env['HTTP_ACCEPT'] = ','.join(accept)
        ua = self.headers.get('user-agent')
        if ua:
            env['HTTP_USER_AGENT'] = ua
        co = filter(None, self.headers.get_all('cookie', []))
        cookie_str = ', '.join(co)
        if cookie_str:
            env['HTTP_COOKIE'] = cookie_str
        # XXX Other HTTP_* headers
        # Since we're setting the env in the parent, provide empty
        # values to override previously set values
        for k in ('QUERY_STRING', 'REMOTE_HOST', 'CONTENT_LENGTH',
                  'HTTP_USER_AGENT', 'HTTP_COOKIE', 'HTTP_REFERER'):
            env.setdefault(k, "")

        self.send_response(HTTPStatus.OK, "Script output follows")
        self.flush_headers()

        decoded_query = query.replace('+', ' ')

        if self.have_fork:
            # Unix -- fork as we should
            args = [script]
            if '=' not in decoded_query:
                args.append(decoded_query)
            nobody = nobody_uid()
            self.wfile.flush() # Always flush before forking
            pid = os.fork()
            if pid != 0:
                # Parent
                pid, sts = os.waitpid(pid, 0)
                # throw away additional data [see bug #427345]
                while select.select([self.rfile], [], [], 0)[0]:
                    if not self.rfile.read(1):
                        break
                if sts:
                    self.log_error("CGI script exit status %#x", sts)
                return
            # Child
            try:
                try:
                    os.setuid(nobody)
                except OSError:
                    pass
                os.dup2(self.rfile.fileno(), 0)
                os.dup2(self.wfile.fileno(), 1)
                os.execve(scriptfile, args, env)
            except:
                self.server.handle_error(self.request, self.client_address)
                os._exit(127)

        else:
            # Non-Unix -- use subprocess
            import subprocess
            cmdline = [scriptfile]
            if self.is_python(scriptfile):
                interp = sys.executable
                if interp.lower().endswith("w.exe"):
                    # On Windows, use python.exe, not pythonw.exe
                    interp = interp[:-5] + interp[-4:]
                cmdline = [interp, '-u'] + cmdline
            if '=' not in query:
                cmdline.append(query)
            self.log_message("command: %s", subprocess.list2cmdline(cmdline))
            try:
                nbytes = int(length)
            except (TypeError, ValueError):
                nbytes = 0
            p = subprocess.Popen(cmdline,
                                 stdin=subprocess.PIPE,
                                 stdout=subprocess.PIPE,
                                 stderr=subprocess.PIPE,
                                 env = env
                                 )
            if self.command.lower() == "post" and nbytes > 0:
                data = self.rfile.read(nbytes)
            else:
                data = None
            # throw away additional data [see bug #427345]
            while select.select([self.rfile._sock], [], [], 0)[0]:
                if not self.rfile._sock.recv(1):
                    break
            stdout, stderr = p.communicate(data)
            self.wfile.write(stdout)
            if stderr:
                self.log_error('%s', stderr)
            p.stderr.close()
            p.stdout.close()
            status = p.returncode
            if status:
                self.log_error("CGI script exit status %#x", status)
            else:
                self.log_message("CGI script exited OK")


def _get_best_family(*address):
    infos = socket.getaddrinfo(
        *address,
        type=socket.SOCK_STREAM,
        flags=socket.AI_PASSIVE,
    )
    family, type, proto, canonname, sockaddr = next(iter(infos))
    return family, sockaddr


def test(HandlerClass=BaseHTTPRequestHandler,
         ServerClass=ThreadingHTTPServer,
         protocol="HTTP/1.0", port=8000, bind=None):
    """Test the HTTP request handler class.

    This runs an HTTP server on port 8000 (or the port argument).

    """
    ServerClass.address_family, addr = _get_best_family(bind, port)

    HandlerClass.protocol_version = protocol
    with ServerClass(addr, HandlerClass) as httpd:
        host, port = httpd.socket.getsockname()[:2]
        url_host = f'[{host}]' if ':' in host else host
        print(
            f"Serving HTTP on {host} port {port} "
            f"(http://{url_host}:{port}/) ..."
        )
        try:
            httpd.serve_forever()
        except KeyboardInterrupt:
            print("\nKeyboard interrupt received, exiting.")
            sys.exit(0)

if __name__ == '__main__':
    import argparse

    parser = argparse.ArgumentParser()
    parser.add_argument('--cgi', action='store_true',
                       help='Run as CGI Server')
    parser.add_argument('--bind', '-b', metavar='ADDRESS',
                        help='Specify alternate bind address '
                             '[default: all interfaces]')
    parser.add_argument('--directory', '-d', default=os.getcwd(),
                        help='Specify alternative directory '
                        '[default:current directory]')
    parser.add_argument('port', action='store',
                        default=8000, type=int,
                        nargs='?',
                        help='Specify alternate port [default: 8000]')
    args = parser.parse_args()
    if args.cgi:
        handler_class = CGIHTTPRequestHandler
    else:
        handler_class = partial(SimpleHTTPRequestHandler,
                                directory=args.directory)

    # ensure dual-stack is not disabled; ref #38907
    class DualStackServer(ThreadingHTTPServer):
        def server_bind(self):
            # suppress exception when protocol is IPv4
            with contextlib.suppress(Exception):
                self.socket.setsockopt(
                    socket.IPPROTO_IPV6, socket.IPV6_V6ONLY, 0)
            return super().server_bind()

    test(
        HandlerClass=handler_class,
        ServerClass=DualStackServer,
        port=args.port,
        bind=args.bind,
    )
http/cookies.py000064400000047674151153537450007564 0ustar00####
# Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu>
#
#                All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software
# and its documentation for any purpose and without fee is hereby
# granted, provided that the above copyright notice appear in all
# copies and that both that copyright notice and this permission
# notice appear in supporting documentation, and that the name of
# Timothy O'Malley  not be used in advertising or publicity
# pertaining to distribution of the software without specific, written
# prior permission.
#
# Timothy O'Malley DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
# SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS, IN NO EVENT SHALL Timothy O'Malley BE LIABLE FOR
# ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
#
####
#
# Id: Cookie.py,v 2.29 2000/08/23 05:28:49 timo Exp
#   by Timothy O'Malley <timo@alum.mit.edu>
#
#  Cookie.py is a Python module for the handling of HTTP
#  cookies as a Python dictionary.  See RFC 2109 for more
#  information on cookies.
#
#  The original idea to treat Cookies as a dictionary came from
#  Dave Mitchell (davem@magnet.com) in 1995, when he released the
#  first version of nscookie.py.
#
####

r"""
Here's a sample session to show how to use this module.
At the moment, this is the only documentation.

The Basics
----------

Importing is easy...

   >>> from http import cookies

Most of the time you start by creating a cookie.

   >>> C = cookies.SimpleCookie()

Once you've created your Cookie, you can add values just as if it were
a dictionary.

   >>> C = cookies.SimpleCookie()
   >>> C["fig"] = "newton"
   >>> C["sugar"] = "wafer"
   >>> C.output()
   'Set-Cookie: fig=newton\r\nSet-Cookie: sugar=wafer'

Notice that the printable representation of a Cookie is the
appropriate format for a Set-Cookie: header.  This is the
default behavior.  You can change the header and printed
attributes by using the .output() function

   >>> C = cookies.SimpleCookie()
   >>> C["rocky"] = "road"
   >>> C["rocky"]["path"] = "/cookie"
   >>> print(C.output(header="Cookie:"))
   Cookie: rocky=road; Path=/cookie
   >>> print(C.output(attrs=[], header="Cookie:"))
   Cookie: rocky=road

The load() method of a Cookie extracts cookies from a string.  In a
CGI script, you would use this method to extract the cookies from the
HTTP_COOKIE environment variable.

   >>> C = cookies.SimpleCookie()
   >>> C.load("chips=ahoy; vienna=finger")
   >>> C.output()
   'Set-Cookie: chips=ahoy\r\nSet-Cookie: vienna=finger'

The load() method is darn-tootin smart about identifying cookies
within a string.  Escaped quotation marks, nested semicolons, and other
such trickeries do not confuse it.

   >>> C = cookies.SimpleCookie()
   >>> C.load('keebler="E=everybody; L=\\"Loves\\"; fudge=\\012;";')
   >>> print(C)
   Set-Cookie: keebler="E=everybody; L=\"Loves\"; fudge=\012;"

Each element of the Cookie also supports all of the RFC 2109
Cookie attributes.  Here's an example which sets the Path
attribute.

   >>> C = cookies.SimpleCookie()
   >>> C["oreo"] = "doublestuff"
   >>> C["oreo"]["path"] = "/"
   >>> print(C)
   Set-Cookie: oreo=doublestuff; Path=/

Each dictionary element has a 'value' attribute, which gives you
back the value associated with the key.

   >>> C = cookies.SimpleCookie()
   >>> C["twix"] = "none for you"
   >>> C["twix"].value
   'none for you'

The SimpleCookie expects that all values should be standard strings.
Just to be sure, SimpleCookie invokes the str() builtin to convert
the value to a string, when the values are set dictionary-style.

   >>> C = cookies.SimpleCookie()
   >>> C["number"] = 7
   >>> C["string"] = "seven"
   >>> C["number"].value
   '7'
   >>> C["string"].value
   'seven'
   >>> C.output()
   'Set-Cookie: number=7\r\nSet-Cookie: string=seven'

Finis.
"""

#
# Import our required modules
#
import re
import string

__all__ = ["CookieError", "BaseCookie", "SimpleCookie"]

_nulljoin = ''.join
_semispacejoin = '; '.join
_spacejoin = ' '.join

#
# Define an exception visible to External modules
#
class CookieError(Exception):
    pass


# These quoting routines conform to the RFC2109 specification, which in
# turn references the character definitions from RFC2068.  They provide
# a two-way quoting algorithm.  Any non-text character is translated
# into a 4 character sequence: a forward-slash followed by the
# three-digit octal equivalent of the character.  Any '\' or '"' is
# quoted with a preceding '\' slash.
# Because of the way browsers really handle cookies (as opposed to what
# the RFC says) we also encode "," and ";".
#
# These are taken from RFC2068 and RFC2109.
#       _LegalChars       is the list of chars which don't require "'s
#       _Translator       hash-table for fast quoting
#
_LegalChars = string.ascii_letters + string.digits + "!#$%&'*+-.^_`|~:"
_UnescapedChars = _LegalChars + ' ()/<=>?@[]{}'

_Translator = {n: '\\%03o' % n
               for n in set(range(256)) - set(map(ord, _UnescapedChars))}
_Translator.update({
    ord('"'): '\\"',
    ord('\\'): '\\\\',
})

_is_legal_key = re.compile('[%s]+' % re.escape(_LegalChars)).fullmatch

def _quote(str):
    r"""Quote a string for use in a cookie header.

    If the string does not need to be double-quoted, then just return the
    string.  Otherwise, surround the string in doublequotes and quote
    (with a \) special characters.
    """
    if str is None or _is_legal_key(str):
        return str
    else:
        return '"' + str.translate(_Translator) + '"'


_OctalPatt = re.compile(r"\\[0-3][0-7][0-7]")
_QuotePatt = re.compile(r"[\\].")

def _unquote(str):
    # If there aren't any doublequotes,
    # then there can't be any special characters.  See RFC 2109.
    if str is None or len(str) < 2:
        return str
    if str[0] != '"' or str[-1] != '"':
        return str

    # We have to assume that we must decode this string.
    # Down to work.

    # Remove the "s
    str = str[1:-1]

    # Check for special sequences.  Examples:
    #    \012 --> \n
    #    \"   --> "
    #
    i = 0
    n = len(str)
    res = []
    while 0 <= i < n:
        o_match = _OctalPatt.search(str, i)
        q_match = _QuotePatt.search(str, i)
        if not o_match and not q_match:              # Neither matched
            res.append(str[i:])
            break
        # else:
        j = k = -1
        if o_match:
            j = o_match.start(0)
        if q_match:
            k = q_match.start(0)
        if q_match and (not o_match or k < j):     # QuotePatt matched
            res.append(str[i:k])
            res.append(str[k+1])
            i = k + 2
        else:                                      # OctalPatt matched
            res.append(str[i:j])
            res.append(chr(int(str[j+1:j+4], 8)))
            i = j + 4
    return _nulljoin(res)

# The _getdate() routine is used to set the expiration time in the cookie's HTTP
# header.  By default, _getdate() returns the current time in the appropriate
# "expires" format for a Set-Cookie header.  The one optional argument is an
# offset from now, in seconds.  For example, an offset of -3600 means "one hour
# ago".  The offset may be a floating point number.
#

_weekdayname = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']

_monthname = [None,
              'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
              'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']

def _getdate(future=0, weekdayname=_weekdayname, monthname=_monthname):
    from time import gmtime, time
    now = time()
    year, month, day, hh, mm, ss, wd, y, z = gmtime(now + future)
    return "%s, %02d %3s %4d %02d:%02d:%02d GMT" % \
           (weekdayname[wd], day, monthname[month], year, hh, mm, ss)


class Morsel(dict):
    """A class to hold ONE (key, value) pair.

    In a cookie, each such pair may have several attributes, so this class is
    used to keep the attributes associated with the appropriate key,value pair.
    This class also includes a coded_value attribute, which is used to hold
    the network representation of the value.
    """
    # RFC 2109 lists these attributes as reserved:
    #   path       comment         domain
    #   max-age    secure      version
    #
    # For historical reasons, these attributes are also reserved:
    #   expires
    #
    # This is an extension from Microsoft:
    #   httponly
    #
    # This dictionary provides a mapping from the lowercase
    # variant on the left to the appropriate traditional
    # formatting on the right.
    _reserved = {
        "expires"  : "expires",
        "path"     : "Path",
        "comment"  : "Comment",
        "domain"   : "Domain",
        "max-age"  : "Max-Age",
        "secure"   : "Secure",
        "httponly" : "HttpOnly",
        "version"  : "Version",
        "samesite" : "SameSite",
    }

    _flags = {'secure', 'httponly'}

    def __init__(self):
        # Set defaults
        self._key = self._value = self._coded_value = None

        # Set default attributes
        for key in self._reserved:
            dict.__setitem__(self, key, "")

    @property
    def key(self):
        return self._key

    @property
    def value(self):
        return self._value

    @property
    def coded_value(self):
        return self._coded_value

    def __setitem__(self, K, V):
        K = K.lower()
        if not K in self._reserved:
            raise CookieError("Invalid attribute %r" % (K,))
        dict.__setitem__(self, K, V)

    def setdefault(self, key, val=None):
        key = key.lower()
        if key not in self._reserved:
            raise CookieError("Invalid attribute %r" % (key,))
        return dict.setdefault(self, key, val)

    def __eq__(self, morsel):
        if not isinstance(morsel, Morsel):
            return NotImplemented
        return (dict.__eq__(self, morsel) and
                self._value == morsel._value and
                self._key == morsel._key and
                self._coded_value == morsel._coded_value)

    __ne__ = object.__ne__

    def copy(self):
        morsel = Morsel()
        dict.update(morsel, self)
        morsel.__dict__.update(self.__dict__)
        return morsel

    def update(self, values):
        data = {}
        for key, val in dict(values).items():
            key = key.lower()
            if key not in self._reserved:
                raise CookieError("Invalid attribute %r" % (key,))
            data[key] = val
        dict.update(self, data)

    def isReservedKey(self, K):
        return K.lower() in self._reserved

    def set(self, key, val, coded_val):
        if key.lower() in self._reserved:
            raise CookieError('Attempt to set a reserved key %r' % (key,))
        if not _is_legal_key(key):
            raise CookieError('Illegal key %r' % (key,))

        # It's a good key, so save it.
        self._key = key
        self._value = val
        self._coded_value = coded_val

    def __getstate__(self):
        return {
            'key': self._key,
            'value': self._value,
            'coded_value': self._coded_value,
        }

    def __setstate__(self, state):
        self._key = state['key']
        self._value = state['value']
        self._coded_value = state['coded_value']

    def output(self, attrs=None, header="Set-Cookie:"):
        return "%s %s" % (header, self.OutputString(attrs))

    __str__ = output

    def __repr__(self):
        return '<%s: %s>' % (self.__class__.__name__, self.OutputString())

    def js_output(self, attrs=None):
        # Print javascript
        return """
        <script type="text/javascript">
        <!-- begin hiding
        document.cookie = \"%s\";
        // end hiding -->
        </script>
        """ % (self.OutputString(attrs).replace('"', r'\"'))

    def OutputString(self, attrs=None):
        # Build up our result
        #
        result = []
        append = result.append

        # First, the key=value pair
        append("%s=%s" % (self.key, self.coded_value))

        # Now add any defined attributes
        if attrs is None:
            attrs = self._reserved
        items = sorted(self.items())
        for key, value in items:
            if value == "":
                continue
            if key not in attrs:
                continue
            if key == "expires" and isinstance(value, int):
                append("%s=%s" % (self._reserved[key], _getdate(value)))
            elif key == "max-age" and isinstance(value, int):
                append("%s=%d" % (self._reserved[key], value))
            elif key == "comment" and isinstance(value, str):
                append("%s=%s" % (self._reserved[key], _quote(value)))
            elif key in self._flags:
                if value:
                    append(str(self._reserved[key]))
            else:
                append("%s=%s" % (self._reserved[key], value))

        # Return the result
        return _semispacejoin(result)


#
# Pattern for finding cookie
#
# This used to be strict parsing based on the RFC2109 and RFC2068
# specifications.  I have since discovered that MSIE 3.0x doesn't
# follow the character rules outlined in those specs.  As a
# result, the parsing rules here are less strict.
#

_LegalKeyChars  = r"\w\d!#%&'~_`><@,:/\$\*\+\-\.\^\|\)\(\?\}\{\="
_LegalValueChars = _LegalKeyChars + r'\[\]'
_CookiePattern = re.compile(r"""
    \s*                            # Optional whitespace at start of cookie
    (?P<key>                       # Start of group 'key'
    [""" + _LegalKeyChars + r"""]+?   # Any word of at least one letter
    )                              # End of group 'key'
    (                              # Optional group: there may not be a value.
    \s*=\s*                          # Equal Sign
    (?P<val>                         # Start of group 'val'
    "(?:[^\\"]|\\.)*"                  # Any doublequoted string
    |                                  # or
    \w{3},\s[\w\d\s-]{9,11}\s[\d:]{8}\sGMT  # Special case for "expires" attr
    |                                  # or
    [""" + _LegalValueChars + r"""]*      # Any word or empty string
    )                                # End of group 'val'
    )?                             # End of optional value group
    \s*                            # Any number of spaces.
    (\s+|;|$)                      # Ending either at space, semicolon, or EOS.
    """, re.ASCII | re.VERBOSE)    # re.ASCII may be removed if safe.


# At long last, here is the cookie class.  Using this class is almost just like
# using a dictionary.  See this module's docstring for example usage.
#
class BaseCookie(dict):
    """A container class for a set of Morsels."""

    def value_decode(self, val):
        """real_value, coded_value = value_decode(STRING)
        Called prior to setting a cookie's value from the network
        representation.  The VALUE is the value read from HTTP
        header.
        Override this function to modify the behavior of cookies.
        """
        return val, val

    def value_encode(self, val):
        """real_value, coded_value = value_encode(VALUE)
        Called prior to setting a cookie's value from the dictionary
        representation.  The VALUE is the value being assigned.
        Override this function to modify the behavior of cookies.
        """
        strval = str(val)
        return strval, strval

    def __init__(self, input=None):
        if input:
            self.load(input)

    def __set(self, key, real_value, coded_value):
        """Private method for setting a cookie's value"""
        M = self.get(key, Morsel())
        M.set(key, real_value, coded_value)
        dict.__setitem__(self, key, M)

    def __setitem__(self, key, value):
        """Dictionary style assignment."""
        if isinstance(value, Morsel):
            # allow assignment of constructed Morsels (e.g. for pickling)
            dict.__setitem__(self, key, value)
        else:
            rval, cval = self.value_encode(value)
            self.__set(key, rval, cval)

    def output(self, attrs=None, header="Set-Cookie:", sep="\015\012"):
        """Return a string suitable for HTTP."""
        result = []
        items = sorted(self.items())
        for key, value in items:
            result.append(value.output(attrs, header))
        return sep.join(result)

    __str__ = output

    def __repr__(self):
        l = []
        items = sorted(self.items())
        for key, value in items:
            l.append('%s=%s' % (key, repr(value.value)))
        return '<%s: %s>' % (self.__class__.__name__, _spacejoin(l))

    def js_output(self, attrs=None):
        """Return a string suitable for JavaScript."""
        result = []
        items = sorted(self.items())
        for key, value in items:
            result.append(value.js_output(attrs))
        return _nulljoin(result)

    def load(self, rawdata):
        """Load cookies from a string (presumably HTTP_COOKIE) or
        from a dictionary.  Loading cookies from a dictionary 'd'
        is equivalent to calling:
            map(Cookie.__setitem__, d.keys(), d.values())
        """
        if isinstance(rawdata, str):
            self.__parse_string(rawdata)
        else:
            # self.update() wouldn't call our custom __setitem__
            for key, value in rawdata.items():
                self[key] = value
        return

    def __parse_string(self, str, patt=_CookiePattern):
        i = 0                 # Our starting point
        n = len(str)          # Length of string
        parsed_items = []     # Parsed (type, key, value) triples
        morsel_seen = False   # A key=value pair was previously encountered

        TYPE_ATTRIBUTE = 1
        TYPE_KEYVALUE = 2

        # We first parse the whole cookie string and reject it if it's
        # syntactically invalid (this helps avoid some classes of injection
        # attacks).
        while 0 <= i < n:
            # Start looking for a cookie
            match = patt.match(str, i)
            if not match:
                # No more cookies
                break

            key, value = match.group("key"), match.group("val")
            i = match.end(0)

            if key[0] == "$":
                if not morsel_seen:
                    # We ignore attributes which pertain to the cookie
                    # mechanism as a whole, such as "$Version".
                    # See RFC 2965. (Does anyone care?)
                    continue
                parsed_items.append((TYPE_ATTRIBUTE, key[1:], value))
            elif key.lower() in Morsel._reserved:
                if not morsel_seen:
                    # Invalid cookie string
                    return
                if value is None:
                    if key.lower() in Morsel._flags:
                        parsed_items.append((TYPE_ATTRIBUTE, key, True))
                    else:
                        # Invalid cookie string
                        return
                else:
                    parsed_items.append((TYPE_ATTRIBUTE, key, _unquote(value)))
            elif value is not None:
                parsed_items.append((TYPE_KEYVALUE, key, self.value_decode(value)))
                morsel_seen = True
            else:
                # Invalid cookie string
                return

        # The cookie string is valid, apply it.
        M = None         # current morsel
        for tp, key, value in parsed_items:
            if tp == TYPE_ATTRIBUTE:
                assert M is not None
                M[key] = value
            else:
                assert tp == TYPE_KEYVALUE
                rval, cval = value
                self.__set(key, rval, cval)
                M = self[key]


class SimpleCookie(BaseCookie):
    """
    SimpleCookie supports strings as cookie values.  When setting
    the value using the dictionary assignment notation, SimpleCookie
    calls the builtin str() to convert the value to a string.  Values
    received from HTTP are kept as strings.
    """
    def value_decode(self, val):
        return _unquote(val), val

    def value_encode(self, val):
        strval = str(val)
        return strval, _quote(strval)
http/cookiejar.py000064400000226043151153537450010063 0ustar00r"""HTTP cookie handling for web clients.

This module has (now fairly distant) origins in Gisle Aas' Perl module
HTTP::Cookies, from the libwww-perl library.

Docstrings, comments and debug strings in this code refer to the
attributes of the HTTP cookie system as cookie-attributes, to distinguish
them clearly from Python attributes.

Class diagram (note that BSDDBCookieJar and the MSIE* classes are not
distributed with the Python standard library, but are available from
http://wwwsearch.sf.net/):

                        CookieJar____
                        /     \      \
            FileCookieJar      \      \
             /    |   \         \      \
 MozillaCookieJar | LWPCookieJar \      \
                  |               |      \
                  |   ---MSIEBase |       \
                  |  /      |     |        \
                  | /   MSIEDBCookieJar BSDDBCookieJar
                  |/
               MSIECookieJar

"""

__all__ = ['Cookie', 'CookieJar', 'CookiePolicy', 'DefaultCookiePolicy',
           'FileCookieJar', 'LWPCookieJar', 'LoadError', 'MozillaCookieJar']

import os
import copy
import datetime
import re
import time
import urllib.parse, urllib.request
import threading as _threading
import http.client  # only for the default HTTP port
from calendar import timegm

debug = False   # set to True to enable debugging via the logging module
logger = None

def _debug(*args):
    if not debug:
        return
    global logger
    if not logger:
        import logging
        logger = logging.getLogger("http.cookiejar")
    return logger.debug(*args)


DEFAULT_HTTP_PORT = str(http.client.HTTP_PORT)
MISSING_FILENAME_TEXT = ("a filename was not supplied (nor was the CookieJar "
                         "instance initialised with one)")

def _warn_unhandled_exception():
    # There are a few catch-all except: statements in this module, for
    # catching input that's bad in unexpected ways.  Warn if any
    # exceptions are caught there.
    import io, warnings, traceback
    f = io.StringIO()
    traceback.print_exc(None, f)
    msg = f.getvalue()
    warnings.warn("http.cookiejar bug!\n%s" % msg, stacklevel=2)


# Date/time conversion
# -----------------------------------------------------------------------------

EPOCH_YEAR = 1970
def _timegm(tt):
    year, month, mday, hour, min, sec = tt[:6]
    if ((year >= EPOCH_YEAR) and (1 <= month <= 12) and (1 <= mday <= 31) and
        (0 <= hour <= 24) and (0 <= min <= 59) and (0 <= sec <= 61)):
        return timegm(tt)
    else:
        return None

DAYS = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
          "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
MONTHS_LOWER = []
for month in MONTHS: MONTHS_LOWER.append(month.lower())

def time2isoz(t=None):
    """Return a string representing time in seconds since epoch, t.

    If the function is called without an argument, it will use the current
    time.

    The format of the returned string is like "YYYY-MM-DD hh:mm:ssZ",
    representing Universal Time (UTC, aka GMT).  An example of this format is:

    1994-11-24 08:49:37Z

    """
    if t is None:
        dt = datetime.datetime.utcnow()
    else:
        dt = datetime.datetime.utcfromtimestamp(t)
    return "%04d-%02d-%02d %02d:%02d:%02dZ" % (
        dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second)

def time2netscape(t=None):
    """Return a string representing time in seconds since epoch, t.

    If the function is called without an argument, it will use the current
    time.

    The format of the returned string is like this:

    Wed, DD-Mon-YYYY HH:MM:SS GMT

    """
    if t is None:
        dt = datetime.datetime.utcnow()
    else:
        dt = datetime.datetime.utcfromtimestamp(t)
    return "%s, %02d-%s-%04d %02d:%02d:%02d GMT" % (
        DAYS[dt.weekday()], dt.day, MONTHS[dt.month-1],
        dt.year, dt.hour, dt.minute, dt.second)


UTC_ZONES = {"GMT": None, "UTC": None, "UT": None, "Z": None}

TIMEZONE_RE = re.compile(r"^([-+])?(\d\d?):?(\d\d)?$", re.ASCII)
def offset_from_tz_string(tz):
    offset = None
    if tz in UTC_ZONES:
        offset = 0
    else:
        m = TIMEZONE_RE.search(tz)
        if m:
            offset = 3600 * int(m.group(2))
            if m.group(3):
                offset = offset + 60 * int(m.group(3))
            if m.group(1) == '-':
                offset = -offset
    return offset

def _str2time(day, mon, yr, hr, min, sec, tz):
    yr = int(yr)
    if yr > datetime.MAXYEAR:
        return None

    # translate month name to number
    # month numbers start with 1 (January)
    try:
        mon = MONTHS_LOWER.index(mon.lower())+1
    except ValueError:
        # maybe it's already a number
        try:
            imon = int(mon)
        except ValueError:
            return None
        if 1 <= imon <= 12:
            mon = imon
        else:
            return None

    # make sure clock elements are defined
    if hr is None: hr = 0
    if min is None: min = 0
    if sec is None: sec = 0

    day = int(day)
    hr = int(hr)
    min = int(min)
    sec = int(sec)

    if yr < 1000:
        # find "obvious" year
        cur_yr = time.localtime(time.time())[0]
        m = cur_yr % 100
        tmp = yr
        yr = yr + cur_yr - m
        m = m - tmp
        if abs(m) > 50:
            if m > 0: yr = yr + 100
            else: yr = yr - 100

    # convert UTC time tuple to seconds since epoch (not timezone-adjusted)
    t = _timegm((yr, mon, day, hr, min, sec, tz))

    if t is not None:
        # adjust time using timezone string, to get absolute time since epoch
        if tz is None:
            tz = "UTC"
        tz = tz.upper()
        offset = offset_from_tz_string(tz)
        if offset is None:
            return None
        t = t - offset

    return t

STRICT_DATE_RE = re.compile(
    r"^[SMTWF][a-z][a-z], (\d\d) ([JFMASOND][a-z][a-z]) "
    r"(\d\d\d\d) (\d\d):(\d\d):(\d\d) GMT$", re.ASCII)
WEEKDAY_RE = re.compile(
    r"^(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)[a-z]*,?\s*", re.I | re.ASCII)
LOOSE_HTTP_DATE_RE = re.compile(
    r"""^
    (\d\d?)            # day
       (?:\s+|[-\/])
    (\w+)              # month
        (?:\s+|[-\/])
    (\d+)              # year
    (?:
          (?:\s+|:)    # separator before clock
       (\d\d?):(\d\d)  # hour:min
       (?::(\d\d))?    # optional seconds
    )?                 # optional clock
       \s*
    (?:
       ([-+]?\d{2,4}|(?![APap][Mm]\b)[A-Za-z]+) # timezone
       \s*
    )?
    (?:
       \(\w+\)         # ASCII representation of timezone in parens.
       \s*
    )?$""", re.X | re.ASCII)
def http2time(text):
    """Returns time in seconds since epoch of time represented by a string.

    Return value is an integer.

    None is returned if the format of str is unrecognized, the time is outside
    the representable range, or the timezone string is not recognized.  If the
    string contains no timezone, UTC is assumed.

    The timezone in the string may be numerical (like "-0800" or "+0100") or a
    string timezone (like "UTC", "GMT", "BST" or "EST").  Currently, only the
    timezone strings equivalent to UTC (zero offset) are known to the function.

    The function loosely parses the following formats:

    Wed, 09 Feb 1994 22:23:32 GMT       -- HTTP format
    Tuesday, 08-Feb-94 14:15:29 GMT     -- old rfc850 HTTP format
    Tuesday, 08-Feb-1994 14:15:29 GMT   -- broken rfc850 HTTP format
    09 Feb 1994 22:23:32 GMT            -- HTTP format (no weekday)
    08-Feb-94 14:15:29 GMT              -- rfc850 format (no weekday)
    08-Feb-1994 14:15:29 GMT            -- broken rfc850 format (no weekday)

    The parser ignores leading and trailing whitespace.  The time may be
    absent.

    If the year is given with only 2 digits, the function will select the
    century that makes the year closest to the current date.

    """
    # fast exit for strictly conforming string
    m = STRICT_DATE_RE.search(text)
    if m:
        g = m.groups()
        mon = MONTHS_LOWER.index(g[1].lower()) + 1
        tt = (int(g[2]), mon, int(g[0]),
              int(g[3]), int(g[4]), float(g[5]))
        return _timegm(tt)

    # No, we need some messy parsing...

    # clean up
    text = text.lstrip()
    text = WEEKDAY_RE.sub("", text, 1)  # Useless weekday

    # tz is time zone specifier string
    day, mon, yr, hr, min, sec, tz = [None]*7

    # loose regexp parse
    m = LOOSE_HTTP_DATE_RE.search(text)
    if m is not None:
        day, mon, yr, hr, min, sec, tz = m.groups()
    else:
        return None  # bad format

    return _str2time(day, mon, yr, hr, min, sec, tz)

ISO_DATE_RE = re.compile(
    r"""^
    (\d{4})              # year
       [-\/]?
    (\d\d?)              # numerical month
       [-\/]?
    (\d\d?)              # day
   (?:
         (?:\s+|[-:Tt])  # separator before clock
      (\d\d?):?(\d\d)    # hour:min
      (?::?(\d\d(?:\.\d*)?))?  # optional seconds (and fractional)
   )?                    # optional clock
      \s*
   (?:
      ([-+]?\d\d?:?(:?\d\d)?
       |Z|z)             # timezone  (Z is "zero meridian", i.e. GMT)
      \s*
   )?$""", re.X | re. ASCII)
def iso2time(text):
    """
    As for http2time, but parses the ISO 8601 formats:

    1994-02-03 14:15:29 -0100    -- ISO 8601 format
    1994-02-03 14:15:29          -- zone is optional
    1994-02-03                   -- only date
    1994-02-03T14:15:29          -- Use T as separator
    19940203T141529Z             -- ISO 8601 compact format
    19940203                     -- only date

    """
    # clean up
    text = text.lstrip()

    # tz is time zone specifier string
    day, mon, yr, hr, min, sec, tz = [None]*7

    # loose regexp parse
    m = ISO_DATE_RE.search(text)
    if m is not None:
        # XXX there's an extra bit of the timezone I'm ignoring here: is
        #   this the right thing to do?
        yr, mon, day, hr, min, sec, tz, _ = m.groups()
    else:
        return None  # bad format

    return _str2time(day, mon, yr, hr, min, sec, tz)


# Header parsing
# -----------------------------------------------------------------------------

def unmatched(match):
    """Return unmatched part of re.Match object."""
    start, end = match.span(0)
    return match.string[:start]+match.string[end:]

HEADER_TOKEN_RE =        re.compile(r"^\s*([^=\s;,]+)")
HEADER_QUOTED_VALUE_RE = re.compile(r"^\s*=\s*\"([^\"\\]*(?:\\.[^\"\\]*)*)\"")
HEADER_VALUE_RE =        re.compile(r"^\s*=\s*([^\s;,]*)")
HEADER_ESCAPE_RE = re.compile(r"\\(.)")
def split_header_words(header_values):
    r"""Parse header values into a list of lists containing key,value pairs.

    The function knows how to deal with ",", ";" and "=" as well as quoted
    values after "=".  A list of space separated tokens are parsed as if they
    were separated by ";".

    If the header_values passed as argument contains multiple values, then they
    are treated as if they were a single value separated by comma ",".

    This means that this function is useful for parsing header fields that
    follow this syntax (BNF as from the HTTP/1.1 specification, but we relax
    the requirement for tokens).

      headers           = #header
      header            = (token | parameter) *( [";"] (token | parameter))

      token             = 1*<any CHAR except CTLs or separators>
      separators        = "(" | ")" | "<" | ">" | "@"
                        | "," | ";" | ":" | "\" | <">
                        | "/" | "[" | "]" | "?" | "="
                        | "{" | "}" | SP | HT

      quoted-string     = ( <"> *(qdtext | quoted-pair ) <"> )
      qdtext            = <any TEXT except <">>
      quoted-pair       = "\" CHAR

      parameter         = attribute "=" value
      attribute         = token
      value             = token | quoted-string

    Each header is represented by a list of key/value pairs.  The value for a
    simple token (not part of a parameter) is None.  Syntactically incorrect
    headers will not necessarily be parsed as you would want.

    This is easier to describe with some examples:

    >>> split_header_words(['foo="bar"; port="80,81"; discard, bar=baz'])
    [[('foo', 'bar'), ('port', '80,81'), ('discard', None)], [('bar', 'baz')]]
    >>> split_header_words(['text/html; charset="iso-8859-1"'])
    [[('text/html', None), ('charset', 'iso-8859-1')]]
    >>> split_header_words([r'Basic realm="\"foo\bar\""'])
    [[('Basic', None), ('realm', '"foobar"')]]

    """
    assert not isinstance(header_values, str)
    result = []
    for text in header_values:
        orig_text = text
        pairs = []
        while text:
            m = HEADER_TOKEN_RE.search(text)
            if m:
                text = unmatched(m)
                name = m.group(1)
                m = HEADER_QUOTED_VALUE_RE.search(text)
                if m:  # quoted value
                    text = unmatched(m)
                    value = m.group(1)
                    value = HEADER_ESCAPE_RE.sub(r"\1", value)
                else:
                    m = HEADER_VALUE_RE.search(text)
                    if m:  # unquoted value
                        text = unmatched(m)
                        value = m.group(1)
                        value = value.rstrip()
                    else:
                        # no value, a lone token
                        value = None
                pairs.append((name, value))
            elif text.lstrip().startswith(","):
                # concatenated headers, as per RFC 2616 section 4.2
                text = text.lstrip()[1:]
                if pairs: result.append(pairs)
                pairs = []
            else:
                # skip junk
                non_junk, nr_junk_chars = re.subn(r"^[=\s;]*", "", text)
                assert nr_junk_chars > 0, (
                    "split_header_words bug: '%s', '%s', %s" %
                    (orig_text, text, pairs))
                text = non_junk
        if pairs: result.append(pairs)
    return result

HEADER_JOIN_ESCAPE_RE = re.compile(r"([\"\\])")
def join_header_words(lists):
    """Do the inverse (almost) of the conversion done by split_header_words.

    Takes a list of lists of (key, value) pairs and produces a single header
    value.  Attribute values are quoted if needed.

    >>> join_header_words([[("text/plain", None), ("charset", "iso-8859-1")]])
    'text/plain; charset="iso-8859-1"'
    >>> join_header_words([[("text/plain", None)], [("charset", "iso-8859-1")]])
    'text/plain, charset="iso-8859-1"'

    """
    headers = []
    for pairs in lists:
        attr = []
        for k, v in pairs:
            if v is not None:
                if not re.search(r"^\w+$", v):
                    v = HEADER_JOIN_ESCAPE_RE.sub(r"\\\1", v)  # escape " and \
                    v = '"%s"' % v
                k = "%s=%s" % (k, v)
            attr.append(k)
        if attr: headers.append("; ".join(attr))
    return ", ".join(headers)

def strip_quotes(text):
    if text.startswith('"'):
        text = text[1:]
    if text.endswith('"'):
        text = text[:-1]
    return text

def parse_ns_headers(ns_headers):
    """Ad-hoc parser for Netscape protocol cookie-attributes.

    The old Netscape cookie format for Set-Cookie can for instance contain
    an unquoted "," in the expires field, so we have to use this ad-hoc
    parser instead of split_header_words.

    XXX This may not make the best possible effort to parse all the crap
    that Netscape Cookie headers contain.  Ronald Tschalar's HTTPClient
    parser is probably better, so could do worse than following that if
    this ever gives any trouble.

    Currently, this is also used for parsing RFC 2109 cookies.

    """
    known_attrs = ("expires", "domain", "path", "secure",
                   # RFC 2109 attrs (may turn up in Netscape cookies, too)
                   "version", "port", "max-age")

    result = []
    for ns_header in ns_headers:
        pairs = []
        version_set = False

        # XXX: The following does not strictly adhere to RFCs in that empty
        # names and values are legal (the former will only appear once and will
        # be overwritten if multiple occurrences are present). This is
        # mostly to deal with backwards compatibility.
        for ii, param in enumerate(ns_header.split(';')):
            param = param.strip()

            key, sep, val = param.partition('=')
            key = key.strip()

            if not key:
                if ii == 0:
                    break
                else:
                    continue

            # allow for a distinction between present and empty and missing
            # altogether
            val = val.strip() if sep else None

            if ii != 0:
                lc = key.lower()
                if lc in known_attrs:
                    key = lc

                if key == "version":
                    # This is an RFC 2109 cookie.
                    if val is not None:
                        val = strip_quotes(val)
                    version_set = True
                elif key == "expires":
                    # convert expires date to seconds since epoch
                    if val is not None:
                        val = http2time(strip_quotes(val))  # None if invalid
            pairs.append((key, val))

        if pairs:
            if not version_set:
                pairs.append(("version", "0"))
            result.append(pairs)

    return result


IPV4_RE = re.compile(r"\.\d+$", re.ASCII)
def is_HDN(text):
    """Return True if text is a host domain name."""
    # XXX
    # This may well be wrong.  Which RFC is HDN defined in, if any (for
    #  the purposes of RFC 2965)?
    # For the current implementation, what about IPv6?  Remember to look
    #  at other uses of IPV4_RE also, if change this.
    if IPV4_RE.search(text):
        return False
    if text == "":
        return False
    if text[0] == "." or text[-1] == ".":
        return False
    return True

def domain_match(A, B):
    """Return True if domain A domain-matches domain B, according to RFC 2965.

    A and B may be host domain names or IP addresses.

    RFC 2965, section 1:

    Host names can be specified either as an IP address or a HDN string.
    Sometimes we compare one host name with another.  (Such comparisons SHALL
    be case-insensitive.)  Host A's name domain-matches host B's if

         *  their host name strings string-compare equal; or

         * A is a HDN string and has the form NB, where N is a non-empty
            name string, B has the form .B', and B' is a HDN string.  (So,
            x.y.com domain-matches .Y.com but not Y.com.)

    Note that domain-match is not a commutative operation: a.b.c.com
    domain-matches .c.com, but not the reverse.

    """
    # Note that, if A or B are IP addresses, the only relevant part of the
    # definition of the domain-match algorithm is the direct string-compare.
    A = A.lower()
    B = B.lower()
    if A == B:
        return True
    if not is_HDN(A):
        return False
    i = A.rfind(B)
    if i == -1 or i == 0:
        # A does not have form NB, or N is the empty string
        return False
    if not B.startswith("."):
        return False
    if not is_HDN(B[1:]):
        return False
    return True

def liberal_is_HDN(text):
    """Return True if text is a sort-of-like a host domain name.

    For accepting/blocking domains.

    """
    if IPV4_RE.search(text):
        return False
    return True

def user_domain_match(A, B):
    """For blocking/accepting domains.

    A and B may be host domain names or IP addresses.

    """
    A = A.lower()
    B = B.lower()
    if not (liberal_is_HDN(A) and liberal_is_HDN(B)):
        if A == B:
            # equal IP addresses
            return True
        return False
    initial_dot = B.startswith(".")
    if initial_dot and A.endswith(B):
        return True
    if not initial_dot and A == B:
        return True
    return False

cut_port_re = re.compile(r":\d+$", re.ASCII)
def request_host(request):
    """Return request-host, as defined by RFC 2965.

    Variation from RFC: returned value is lowercased, for convenient
    comparison.

    """
    url = request.get_full_url()
    host = urllib.parse.urlparse(url)[1]
    if host == "":
        host = request.get_header("Host", "")

    # remove port, if present
    host = cut_port_re.sub("", host, 1)
    return host.lower()

def eff_request_host(request):
    """Return a tuple (request-host, effective request-host name).

    As defined by RFC 2965, except both are lowercased.

    """
    erhn = req_host = request_host(request)
    if req_host.find(".") == -1 and not IPV4_RE.search(req_host):
        erhn = req_host + ".local"
    return req_host, erhn

def request_path(request):
    """Path component of request-URI, as defined by RFC 2965."""
    url = request.get_full_url()
    parts = urllib.parse.urlsplit(url)
    path = escape_path(parts.path)
    if not path.startswith("/"):
        # fix bad RFC 2396 absoluteURI
        path = "/" + path
    return path

def request_port(request):
    host = request.host
    i = host.find(':')
    if i >= 0:
        port = host[i+1:]
        try:
            int(port)
        except ValueError:
            _debug("nonnumeric port: '%s'", port)
            return None
    else:
        port = DEFAULT_HTTP_PORT
    return port

# Characters in addition to A-Z, a-z, 0-9, '_', '.', and '-' that don't
# need to be escaped to form a valid HTTP URL (RFCs 2396 and 1738).
HTTP_PATH_SAFE = "%/;:@&=+$,!~*'()"
ESCAPED_CHAR_RE = re.compile(r"%([0-9a-fA-F][0-9a-fA-F])")
def uppercase_escaped_char(match):
    return "%%%s" % match.group(1).upper()
def escape_path(path):
    """Escape any invalid characters in HTTP URL, and uppercase all escapes."""
    # There's no knowing what character encoding was used to create URLs
    # containing %-escapes, but since we have to pick one to escape invalid
    # path characters, we pick UTF-8, as recommended in the HTML 4.0
    # specification:
    # http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.2.1
    # And here, kind of: draft-fielding-uri-rfc2396bis-03
    # (And in draft IRI specification: draft-duerst-iri-05)
    # (And here, for new URI schemes: RFC 2718)
    path = urllib.parse.quote(path, HTTP_PATH_SAFE)
    path = ESCAPED_CHAR_RE.sub(uppercase_escaped_char, path)
    return path

def reach(h):
    """Return reach of host h, as defined by RFC 2965, section 1.

    The reach R of a host name H is defined as follows:

       *  If

          -  H is the host domain name of a host; and,

          -  H has the form A.B; and

          -  A has no embedded (that is, interior) dots; and

          -  B has at least one embedded dot, or B is the string "local".
             then the reach of H is .B.

       *  Otherwise, the reach of H is H.

    >>> reach("www.acme.com")
    '.acme.com'
    >>> reach("acme.com")
    'acme.com'
    >>> reach("acme.local")
    '.local'

    """
    i = h.find(".")
    if i >= 0:
        #a = h[:i]  # this line is only here to show what a is
        b = h[i+1:]
        i = b.find(".")
        if is_HDN(h) and (i >= 0 or b == "local"):
            return "."+b
    return h

def is_third_party(request):
    """

    RFC 2965, section 3.3.6:

        An unverifiable transaction is to a third-party host if its request-
        host U does not domain-match the reach R of the request-host O in the
        origin transaction.

    """
    req_host = request_host(request)
    if not domain_match(req_host, reach(request.origin_req_host)):
        return True
    else:
        return False


class Cookie:
    """HTTP Cookie.

    This class represents both Netscape and RFC 2965 cookies.

    This is deliberately a very simple class.  It just holds attributes.  It's
    possible to construct Cookie instances that don't comply with the cookie
    standards.  CookieJar.make_cookies is the factory function for Cookie
    objects -- it deals with cookie parsing, supplying defaults, and
    normalising to the representation used in this class.  CookiePolicy is
    responsible for checking them to see whether they should be accepted from
    and returned to the server.

    Note that the port may be present in the headers, but unspecified ("Port"
    rather than"Port=80", for example); if this is the case, port is None.

    """

    def __init__(self, version, name, value,
                 port, port_specified,
                 domain, domain_specified, domain_initial_dot,
                 path, path_specified,
                 secure,
                 expires,
                 discard,
                 comment,
                 comment_url,
                 rest,
                 rfc2109=False,
                 ):

        if version is not None: version = int(version)
        if expires is not None: expires = int(float(expires))
        if port is None and port_specified is True:
            raise ValueError("if port is None, port_specified must be false")

        self.version = version
        self.name = name
        self.value = value
        self.port = port
        self.port_specified = port_specified
        # normalise case, as per RFC 2965 section 3.3.3
        self.domain = domain.lower()
        self.domain_specified = domain_specified
        # Sigh.  We need to know whether the domain given in the
        # cookie-attribute had an initial dot, in order to follow RFC 2965
        # (as clarified in draft errata).  Needed for the returned $Domain
        # value.
        self.domain_initial_dot = domain_initial_dot
        self.path = path
        self.path_specified = path_specified
        self.secure = secure
        self.expires = expires
        self.discard = discard
        self.comment = comment
        self.comment_url = comment_url
        self.rfc2109 = rfc2109

        self._rest = copy.copy(rest)

    def has_nonstandard_attr(self, name):
        return name in self._rest
    def get_nonstandard_attr(self, name, default=None):
        return self._rest.get(name, default)
    def set_nonstandard_attr(self, name, value):
        self._rest[name] = value

    def is_expired(self, now=None):
        if now is None: now = time.time()
        if (self.expires is not None) and (self.expires <= now):
            return True
        return False

    def __str__(self):
        if self.port is None: p = ""
        else: p = ":"+self.port
        limit = self.domain + p + self.path
        if self.value is not None:
            namevalue = "%s=%s" % (self.name, self.value)
        else:
            namevalue = self.name
        return "<Cookie %s for %s>" % (namevalue, limit)

    def __repr__(self):
        args = []
        for name in ("version", "name", "value",
                     "port", "port_specified",
                     "domain", "domain_specified", "domain_initial_dot",
                     "path", "path_specified",
                     "secure", "expires", "discard", "comment", "comment_url",
                     ):
            attr = getattr(self, name)
            args.append("%s=%s" % (name, repr(attr)))
        args.append("rest=%s" % repr(self._rest))
        args.append("rfc2109=%s" % repr(self.rfc2109))
        return "%s(%s)" % (self.__class__.__name__, ", ".join(args))


class CookiePolicy:
    """Defines which cookies get accepted from and returned to server.

    May also modify cookies, though this is probably a bad idea.

    The subclass DefaultCookiePolicy defines the standard rules for Netscape
    and RFC 2965 cookies -- override that if you want a customized policy.

    """
    def set_ok(self, cookie, request):
        """Return true if (and only if) cookie should be accepted from server.

        Currently, pre-expired cookies never get this far -- the CookieJar
        class deletes such cookies itself.

        """
        raise NotImplementedError()

    def return_ok(self, cookie, request):
        """Return true if (and only if) cookie should be returned to server."""
        raise NotImplementedError()

    def domain_return_ok(self, domain, request):
        """Return false if cookies should not be returned, given cookie domain.
        """
        return True

    def path_return_ok(self, path, request):
        """Return false if cookies should not be returned, given cookie path.
        """
        return True


class DefaultCookiePolicy(CookiePolicy):
    """Implements the standard rules for accepting and returning cookies."""

    DomainStrictNoDots = 1
    DomainStrictNonDomain = 2
    DomainRFC2965Match = 4

    DomainLiberal = 0
    DomainStrict = DomainStrictNoDots|DomainStrictNonDomain

    def __init__(self,
                 blocked_domains=None, allowed_domains=None,
                 netscape=True, rfc2965=False,
                 rfc2109_as_netscape=None,
                 hide_cookie2=False,
                 strict_domain=False,
                 strict_rfc2965_unverifiable=True,
                 strict_ns_unverifiable=False,
                 strict_ns_domain=DomainLiberal,
                 strict_ns_set_initial_dollar=False,
                 strict_ns_set_path=False,
                 secure_protocols=("https", "wss")
                 ):
        """Constructor arguments should be passed as keyword arguments only."""
        self.netscape = netscape
        self.rfc2965 = rfc2965
        self.rfc2109_as_netscape = rfc2109_as_netscape
        self.hide_cookie2 = hide_cookie2
        self.strict_domain = strict_domain
        self.strict_rfc2965_unverifiable = strict_rfc2965_unverifiable
        self.strict_ns_unverifiable = strict_ns_unverifiable
        self.strict_ns_domain = strict_ns_domain
        self.strict_ns_set_initial_dollar = strict_ns_set_initial_dollar
        self.strict_ns_set_path = strict_ns_set_path
        self.secure_protocols = secure_protocols

        if blocked_domains is not None:
            self._blocked_domains = tuple(blocked_domains)
        else:
            self._blocked_domains = ()

        if allowed_domains is not None:
            allowed_domains = tuple(allowed_domains)
        self._allowed_domains = allowed_domains

    def blocked_domains(self):
        """Return the sequence of blocked domains (as a tuple)."""
        return self._blocked_domains
    def set_blocked_domains(self, blocked_domains):
        """Set the sequence of blocked domains."""
        self._blocked_domains = tuple(blocked_domains)

    def is_blocked(self, domain):
        for blocked_domain in self._blocked_domains:
            if user_domain_match(domain, blocked_domain):
                return True
        return False

    def allowed_domains(self):
        """Return None, or the sequence of allowed domains (as a tuple)."""
        return self._allowed_domains
    def set_allowed_domains(self, allowed_domains):
        """Set the sequence of allowed domains, or None."""
        if allowed_domains is not None:
            allowed_domains = tuple(allowed_domains)
        self._allowed_domains = allowed_domains

    def is_not_allowed(self, domain):
        if self._allowed_domains is None:
            return False
        for allowed_domain in self._allowed_domains:
            if user_domain_match(domain, allowed_domain):
                return False
        return True

    def set_ok(self, cookie, request):
        """
        If you override .set_ok(), be sure to call this method.  If it returns
        false, so should your subclass (assuming your subclass wants to be more
        strict about which cookies to accept).

        """
        _debug(" - checking cookie %s=%s", cookie.name, cookie.value)

        assert cookie.name is not None

        for n in "version", "verifiability", "name", "path", "domain", "port":
            fn_name = "set_ok_"+n
            fn = getattr(self, fn_name)
            if not fn(cookie, request):
                return False

        return True

    def set_ok_version(self, cookie, request):
        if cookie.version is None:
            # Version is always set to 0 by parse_ns_headers if it's a Netscape
            # cookie, so this must be an invalid RFC 2965 cookie.
            _debug("   Set-Cookie2 without version attribute (%s=%s)",
                   cookie.name, cookie.value)
            return False
        if cookie.version > 0 and not self.rfc2965:
            _debug("   RFC 2965 cookies are switched off")
            return False
        elif cookie.version == 0 and not self.netscape:
            _debug("   Netscape cookies are switched off")
            return False
        return True

    def set_ok_verifiability(self, cookie, request):
        if request.unverifiable and is_third_party(request):
            if cookie.version > 0 and self.strict_rfc2965_unverifiable:
                _debug("   third-party RFC 2965 cookie during "
                             "unverifiable transaction")
                return False
            elif cookie.version == 0 and self.strict_ns_unverifiable:
                _debug("   third-party Netscape cookie during "
                             "unverifiable transaction")
                return False
        return True

    def set_ok_name(self, cookie, request):
        # Try and stop servers setting V0 cookies designed to hack other
        # servers that know both V0 and V1 protocols.
        if (cookie.version == 0 and self.strict_ns_set_initial_dollar and
            cookie.name.startswith("$")):
            _debug("   illegal name (starts with '$'): '%s'", cookie.name)
            return False
        return True

    def set_ok_path(self, cookie, request):
        if cookie.path_specified:
            req_path = request_path(request)
            if ((cookie.version > 0 or
                 (cookie.version == 0 and self.strict_ns_set_path)) and
                not self.path_return_ok(cookie.path, request)):
                _debug("   path attribute %s is not a prefix of request "
                       "path %s", cookie.path, req_path)
                return False
        return True

    def set_ok_domain(self, cookie, request):
        if self.is_blocked(cookie.domain):
            _debug("   domain %s is in user block-list", cookie.domain)
            return False
        if self.is_not_allowed(cookie.domain):
            _debug("   domain %s is not in user allow-list", cookie.domain)
            return False
        if cookie.domain_specified:
            req_host, erhn = eff_request_host(request)
            domain = cookie.domain
            if self.strict_domain and (domain.count(".") >= 2):
                # XXX This should probably be compared with the Konqueror
                # (kcookiejar.cpp) and Mozilla implementations, but it's a
                # losing battle.
                i = domain.rfind(".")
                j = domain.rfind(".", 0, i)
                if j == 0:  # domain like .foo.bar
                    tld = domain[i+1:]
                    sld = domain[j+1:i]
                    if sld.lower() in ("co", "ac", "com", "edu", "org", "net",
                       "gov", "mil", "int", "aero", "biz", "cat", "coop",
                       "info", "jobs", "mobi", "museum", "name", "pro",
                       "travel", "eu") and len(tld) == 2:
                        # domain like .co.uk
                        _debug("   country-code second level domain %s", domain)
                        return False
            if domain.startswith("."):
                undotted_domain = domain[1:]
            else:
                undotted_domain = domain
            embedded_dots = (undotted_domain.find(".") >= 0)
            if not embedded_dots and domain != ".local":
                _debug("   non-local domain %s contains no embedded dot",
                       domain)
                return False
            if cookie.version == 0:
                if (not erhn.endswith(domain) and
                    (not erhn.startswith(".") and
                     not ("."+erhn).endswith(domain))):
                    _debug("   effective request-host %s (even with added "
                           "initial dot) does not end with %s",
                           erhn, domain)
                    return False
            if (cookie.version > 0 or
                (self.strict_ns_domain & self.DomainRFC2965Match)):
                if not domain_match(erhn, domain):
                    _debug("   effective request-host %s does not domain-match "
                           "%s", erhn, domain)
                    return False
            if (cookie.version > 0 or
                (self.strict_ns_domain & self.DomainStrictNoDots)):
                host_prefix = req_host[:-len(domain)]
                if (host_prefix.find(".") >= 0 and
                    not IPV4_RE.search(req_host)):
                    _debug("   host prefix %s for domain %s contains a dot",
                           host_prefix, domain)
                    return False
        return True

    def set_ok_port(self, cookie, request):
        if cookie.port_specified:
            req_port = request_port(request)
            if req_port is None:
                req_port = "80"
            else:
                req_port = str(req_port)
            for p in cookie.port.split(","):
                try:
                    int(p)
                except ValueError:
                    _debug("   bad port %s (not numeric)", p)
                    return False
                if p == req_port:
                    break
            else:
                _debug("   request port (%s) not found in %s",
                       req_port, cookie.port)
                return False
        return True

    def return_ok(self, cookie, request):
        """
        If you override .return_ok(), be sure to call this method.  If it
        returns false, so should your subclass (assuming your subclass wants to
        be more strict about which cookies to return).

        """
        # Path has already been checked by .path_return_ok(), and domain
        # blocking done by .domain_return_ok().
        _debug(" - checking cookie %s=%s", cookie.name, cookie.value)

        for n in "version", "verifiability", "secure", "expires", "port", "domain":
            fn_name = "return_ok_"+n
            fn = getattr(self, fn_name)
            if not fn(cookie, request):
                return False
        return True

    def return_ok_version(self, cookie, request):
        if cookie.version > 0 and not self.rfc2965:
            _debug("   RFC 2965 cookies are switched off")
            return False
        elif cookie.version == 0 and not self.netscape:
            _debug("   Netscape cookies are switched off")
            return False
        return True

    def return_ok_verifiability(self, cookie, request):
        if request.unverifiable and is_third_party(request):
            if cookie.version > 0 and self.strict_rfc2965_unverifiable:
                _debug("   third-party RFC 2965 cookie during unverifiable "
                       "transaction")
                return False
            elif cookie.version == 0 and self.strict_ns_unverifiable:
                _debug("   third-party Netscape cookie during unverifiable "
                       "transaction")
                return False
        return True

    def return_ok_secure(self, cookie, request):
        if cookie.secure and request.type not in self.secure_protocols:
            _debug("   secure cookie with non-secure request")
            return False
        return True

    def return_ok_expires(self, cookie, request):
        if cookie.is_expired(self._now):
            _debug("   cookie expired")
            return False
        return True

    def return_ok_port(self, cookie, request):
        if cookie.port:
            req_port = request_port(request)
            if req_port is None:
                req_port = "80"
            for p in cookie.port.split(","):
                if p == req_port:
                    break
            else:
                _debug("   request port %s does not match cookie port %s",
                       req_port, cookie.port)
                return False
        return True

    def return_ok_domain(self, cookie, request):
        req_host, erhn = eff_request_host(request)
        domain = cookie.domain

        if domain and not domain.startswith("."):
            dotdomain = "." + domain
        else:
            dotdomain = domain

        # strict check of non-domain cookies: Mozilla does this, MSIE5 doesn't
        if (cookie.version == 0 and
            (self.strict_ns_domain & self.DomainStrictNonDomain) and
            not cookie.domain_specified and domain != erhn):
            _debug("   cookie with unspecified domain does not string-compare "
                   "equal to request domain")
            return False

        if cookie.version > 0 and not domain_match(erhn, domain):
            _debug("   effective request-host name %s does not domain-match "
                   "RFC 2965 cookie domain %s", erhn, domain)
            return False
        if cookie.version == 0 and not ("."+erhn).endswith(dotdomain):
            _debug("   request-host %s does not match Netscape cookie domain "
                   "%s", req_host, domain)
            return False
        return True

    def domain_return_ok(self, domain, request):
        # Liberal check of.  This is here as an optimization to avoid
        # having to load lots of MSIE cookie files unless necessary.
        req_host, erhn = eff_request_host(request)
        if not req_host.startswith("."):
            req_host = "."+req_host
        if not erhn.startswith("."):
            erhn = "."+erhn
        if domain and not domain.startswith("."):
            dotdomain = "." + domain
        else:
            dotdomain = domain
        if not (req_host.endswith(dotdomain) or erhn.endswith(dotdomain)):
            #_debug("   request domain %s does not match cookie domain %s",
            #       req_host, domain)
            return False

        if self.is_blocked(domain):
            _debug("   domain %s is in user block-list", domain)
            return False
        if self.is_not_allowed(domain):
            _debug("   domain %s is not in user allow-list", domain)
            return False

        return True

    def path_return_ok(self, path, request):
        _debug("- checking cookie path=%s", path)
        req_path = request_path(request)
        pathlen = len(path)
        if req_path == path:
            return True
        elif (req_path.startswith(path) and
              (path.endswith("/") or req_path[pathlen:pathlen+1] == "/")):
            return True

        _debug("  %s does not path-match %s", req_path, path)
        return False

def vals_sorted_by_key(adict):
    keys = sorted(adict.keys())
    return map(adict.get, keys)

def deepvalues(mapping):
    """Iterates over nested mapping, depth-first, in sorted order by key."""
    values = vals_sorted_by_key(mapping)
    for obj in values:
        mapping = False
        try:
            obj.items
        except AttributeError:
            pass
        else:
            mapping = True
            yield from deepvalues(obj)
        if not mapping:
            yield obj


# Used as second parameter to dict.get() method, to distinguish absent
# dict key from one with a None value.
class Absent: pass

class CookieJar:
    """Collection of HTTP cookies.

    You may not need to know about this class: try
    urllib.request.build_opener(HTTPCookieProcessor).open(url).
    """

    non_word_re = re.compile(r"\W")
    quote_re = re.compile(r"([\"\\])")
    strict_domain_re = re.compile(r"\.?[^.]*")
    domain_re = re.compile(r"[^.]*")
    dots_re = re.compile(r"^\.+")

    magic_re = re.compile(r"^\#LWP-Cookies-(\d+\.\d+)", re.ASCII)

    def __init__(self, policy=None):
        if policy is None:
            policy = DefaultCookiePolicy()
        self._policy = policy

        self._cookies_lock = _threading.RLock()
        self._cookies = {}

    def set_policy(self, policy):
        self._policy = policy

    def _cookies_for_domain(self, domain, request):
        cookies = []
        if not self._policy.domain_return_ok(domain, request):
            return []
        _debug("Checking %s for cookies to return", domain)
        cookies_by_path = self._cookies[domain]
        for path in cookies_by_path.keys():
            if not self._policy.path_return_ok(path, request):
                continue
            cookies_by_name = cookies_by_path[path]
            for cookie in cookies_by_name.values():
                if not self._policy.return_ok(cookie, request):
                    _debug("   not returning cookie")
                    continue
                _debug("   it's a match")
                cookies.append(cookie)
        return cookies

    def _cookies_for_request(self, request):
        """Return a list of cookies to be returned to server."""
        cookies = []
        for domain in self._cookies.keys():
            cookies.extend(self._cookies_for_domain(domain, request))
        return cookies

    def _cookie_attrs(self, cookies):
        """Return a list of cookie-attributes to be returned to server.

        like ['foo="bar"; $Path="/"', ...]

        The $Version attribute is also added when appropriate (currently only
        once per request).

        """
        # add cookies in order of most specific (ie. longest) path first
        cookies.sort(key=lambda a: len(a.path), reverse=True)

        version_set = False

        attrs = []
        for cookie in cookies:
            # set version of Cookie header
            # XXX
            # What should it be if multiple matching Set-Cookie headers have
            #  different versions themselves?
            # Answer: there is no answer; was supposed to be settled by
            #  RFC 2965 errata, but that may never appear...
            version = cookie.version
            if not version_set:
                version_set = True
                if version > 0:
                    attrs.append("$Version=%s" % version)

            # quote cookie value if necessary
            # (not for Netscape protocol, which already has any quotes
            #  intact, due to the poorly-specified Netscape Cookie: syntax)
            if ((cookie.value is not None) and
                self.non_word_re.search(cookie.value) and version > 0):
                value = self.quote_re.sub(r"\\\1", cookie.value)
            else:
                value = cookie.value

            # add cookie-attributes to be returned in Cookie header
            if cookie.value is None:
                attrs.append(cookie.name)
            else:
                attrs.append("%s=%s" % (cookie.name, value))
            if version > 0:
                if cookie.path_specified:
                    attrs.append('$Path="%s"' % cookie.path)
                if cookie.domain.startswith("."):
                    domain = cookie.domain
                    if (not cookie.domain_initial_dot and
                        domain.startswith(".")):
                        domain = domain[1:]
                    attrs.append('$Domain="%s"' % domain)
                if cookie.port is not None:
                    p = "$Port"
                    if cookie.port_specified:
                        p = p + ('="%s"' % cookie.port)
                    attrs.append(p)

        return attrs

    def add_cookie_header(self, request):
        """Add correct Cookie: header to request (urllib.request.Request object).

        The Cookie2 header is also added unless policy.hide_cookie2 is true.

        """
        _debug("add_cookie_header")
        self._cookies_lock.acquire()
        try:

            self._policy._now = self._now = int(time.time())

            cookies = self._cookies_for_request(request)

            attrs = self._cookie_attrs(cookies)
            if attrs:
                if not request.has_header("Cookie"):
                    request.add_unredirected_header(
                        "Cookie", "; ".join(attrs))

            # if necessary, advertise that we know RFC 2965
            if (self._policy.rfc2965 and not self._policy.hide_cookie2 and
                not request.has_header("Cookie2")):
                for cookie in cookies:
                    if cookie.version != 1:
                        request.add_unredirected_header("Cookie2", '$Version="1"')
                        break

        finally:
            self._cookies_lock.release()

        self.clear_expired_cookies()

    def _normalized_cookie_tuples(self, attrs_set):
        """Return list of tuples containing normalised cookie information.

        attrs_set is the list of lists of key,value pairs extracted from
        the Set-Cookie or Set-Cookie2 headers.

        Tuples are name, value, standard, rest, where name and value are the
        cookie name and value, standard is a dictionary containing the standard
        cookie-attributes (discard, secure, version, expires or max-age,
        domain, path and port) and rest is a dictionary containing the rest of
        the cookie-attributes.

        """
        cookie_tuples = []

        boolean_attrs = "discard", "secure"
        value_attrs = ("version",
                       "expires", "max-age",
                       "domain", "path", "port",
                       "comment", "commenturl")

        for cookie_attrs in attrs_set:
            name, value = cookie_attrs[0]

            # Build dictionary of standard cookie-attributes (standard) and
            # dictionary of other cookie-attributes (rest).

            # Note: expiry time is normalised to seconds since epoch.  V0
            # cookies should have the Expires cookie-attribute, and V1 cookies
            # should have Max-Age, but since V1 includes RFC 2109 cookies (and
            # since V0 cookies may be a mish-mash of Netscape and RFC 2109), we
            # accept either (but prefer Max-Age).
            max_age_set = False

            bad_cookie = False

            standard = {}
            rest = {}
            for k, v in cookie_attrs[1:]:
                lc = k.lower()
                # don't lose case distinction for unknown fields
                if lc in value_attrs or lc in boolean_attrs:
                    k = lc
                if k in boolean_attrs and v is None:
                    # boolean cookie-attribute is present, but has no value
                    # (like "discard", rather than "port=80")
                    v = True
                if k in standard:
                    # only first value is significant
                    continue
                if k == "domain":
                    if v is None:
                        _debug("   missing value for domain attribute")
                        bad_cookie = True
                        break
                    # RFC 2965 section 3.3.3
                    v = v.lower()
                if k == "expires":
                    if max_age_set:
                        # Prefer max-age to expires (like Mozilla)
                        continue
                    if v is None:
                        _debug("   missing or invalid value for expires "
                              "attribute: treating as session cookie")
                        continue
                if k == "max-age":
                    max_age_set = True
                    try:
                        v = int(v)
                    except ValueError:
                        _debug("   missing or invalid (non-numeric) value for "
                              "max-age attribute")
                        bad_cookie = True
                        break
                    # convert RFC 2965 Max-Age to seconds since epoch
                    # XXX Strictly you're supposed to follow RFC 2616
                    #   age-calculation rules.  Remember that zero Max-Age
                    #   is a request to discard (old and new) cookie, though.
                    k = "expires"
                    v = self._now + v
                if (k in value_attrs) or (k in boolean_attrs):
                    if (v is None and
                        k not in ("port", "comment", "commenturl")):
                        _debug("   missing value for %s attribute" % k)
                        bad_cookie = True
                        break
                    standard[k] = v
                else:
                    rest[k] = v

            if bad_cookie:
                continue

            cookie_tuples.append((name, value, standard, rest))

        return cookie_tuples

    def _cookie_from_cookie_tuple(self, tup, request):
        # standard is dict of standard cookie-attributes, rest is dict of the
        # rest of them
        name, value, standard, rest = tup

        domain = standard.get("domain", Absent)
        path = standard.get("path", Absent)
        port = standard.get("port", Absent)
        expires = standard.get("expires", Absent)

        # set the easy defaults
        version = standard.get("version", None)
        if version is not None:
            try:
                version = int(version)
            except ValueError:
                return None  # invalid version, ignore cookie
        secure = standard.get("secure", False)
        # (discard is also set if expires is Absent)
        discard = standard.get("discard", False)
        comment = standard.get("comment", None)
        comment_url = standard.get("commenturl", None)

        # set default path
        if path is not Absent and path != "":
            path_specified = True
            path = escape_path(path)
        else:
            path_specified = False
            path = request_path(request)
            i = path.rfind("/")
            if i != -1:
                if version == 0:
                    # Netscape spec parts company from reality here
                    path = path[:i]
                else:
                    path = path[:i+1]
            if len(path) == 0: path = "/"

        # set default domain
        domain_specified = domain is not Absent
        # but first we have to remember whether it starts with a dot
        domain_initial_dot = False
        if domain_specified:
            domain_initial_dot = bool(domain.startswith("."))
        if domain is Absent:
            req_host, erhn = eff_request_host(request)
            domain = erhn
        elif not domain.startswith("."):
            domain = "."+domain

        # set default port
        port_specified = False
        if port is not Absent:
            if port is None:
                # Port attr present, but has no value: default to request port.
                # Cookie should then only be sent back on that port.
                port = request_port(request)
            else:
                port_specified = True
                port = re.sub(r"\s+", "", port)
        else:
            # No port attr present.  Cookie can be sent back on any port.
            port = None

        # set default expires and discard
        if expires is Absent:
            expires = None
            discard = True
        elif expires <= self._now:
            # Expiry date in past is request to delete cookie.  This can't be
            # in DefaultCookiePolicy, because can't delete cookies there.
            try:
                self.clear(domain, path, name)
            except KeyError:
                pass
            _debug("Expiring cookie, domain='%s', path='%s', name='%s'",
                   domain, path, name)
            return None

        return Cookie(version,
                      name, value,
                      port, port_specified,
                      domain, domain_specified, domain_initial_dot,
                      path, path_specified,
                      secure,
                      expires,
                      discard,
                      comment,
                      comment_url,
                      rest)

    def _cookies_from_attrs_set(self, attrs_set, request):
        cookie_tuples = self._normalized_cookie_tuples(attrs_set)

        cookies = []
        for tup in cookie_tuples:
            cookie = self._cookie_from_cookie_tuple(tup, request)
            if cookie: cookies.append(cookie)
        return cookies

    def _process_rfc2109_cookies(self, cookies):
        rfc2109_as_ns = getattr(self._policy, 'rfc2109_as_netscape', None)
        if rfc2109_as_ns is None:
            rfc2109_as_ns = not self._policy.rfc2965
        for cookie in cookies:
            if cookie.version == 1:
                cookie.rfc2109 = True
                if rfc2109_as_ns:
                    # treat 2109 cookies as Netscape cookies rather than
                    # as RFC2965 cookies
                    cookie.version = 0

    def make_cookies(self, response, request):
        """Return sequence of Cookie objects extracted from response object."""
        # get cookie-attributes for RFC 2965 and Netscape protocols
        headers = response.info()
        rfc2965_hdrs = headers.get_all("Set-Cookie2", [])
        ns_hdrs = headers.get_all("Set-Cookie", [])
        self._policy._now = self._now = int(time.time())

        rfc2965 = self._policy.rfc2965
        netscape = self._policy.netscape

        if ((not rfc2965_hdrs and not ns_hdrs) or
            (not ns_hdrs and not rfc2965) or
            (not rfc2965_hdrs and not netscape) or
            (not netscape and not rfc2965)):
            return []  # no relevant cookie headers: quick exit

        try:
            cookies = self._cookies_from_attrs_set(
                split_header_words(rfc2965_hdrs), request)
        except Exception:
            _warn_unhandled_exception()
            cookies = []

        if ns_hdrs and netscape:
            try:
                # RFC 2109 and Netscape cookies
                ns_cookies = self._cookies_from_attrs_set(
                    parse_ns_headers(ns_hdrs), request)
            except Exception:
                _warn_unhandled_exception()
                ns_cookies = []
            self._process_rfc2109_cookies(ns_cookies)

            # Look for Netscape cookies (from Set-Cookie headers) that match
            # corresponding RFC 2965 cookies (from Set-Cookie2 headers).
            # For each match, keep the RFC 2965 cookie and ignore the Netscape
            # cookie (RFC 2965 section 9.1).  Actually, RFC 2109 cookies are
            # bundled in with the Netscape cookies for this purpose, which is
            # reasonable behaviour.
            if rfc2965:
                lookup = {}
                for cookie in cookies:
                    lookup[(cookie.domain, cookie.path, cookie.name)] = None

                def no_matching_rfc2965(ns_cookie, lookup=lookup):
                    key = ns_cookie.domain, ns_cookie.path, ns_cookie.name
                    return key not in lookup
                ns_cookies = filter(no_matching_rfc2965, ns_cookies)

            if ns_cookies:
                cookies.extend(ns_cookies)

        return cookies

    def set_cookie_if_ok(self, cookie, request):
        """Set a cookie if policy says it's OK to do so."""
        self._cookies_lock.acquire()
        try:
            self._policy._now = self._now = int(time.time())

            if self._policy.set_ok(cookie, request):
                self.set_cookie(cookie)


        finally:
            self._cookies_lock.release()

    def set_cookie(self, cookie):
        """Set a cookie, without checking whether or not it should be set."""
        c = self._cookies
        self._cookies_lock.acquire()
        try:
            if cookie.domain not in c: c[cookie.domain] = {}
            c2 = c[cookie.domain]
            if cookie.path not in c2: c2[cookie.path] = {}
            c3 = c2[cookie.path]
            c3[cookie.name] = cookie
        finally:
            self._cookies_lock.release()

    def extract_cookies(self, response, request):
        """Extract cookies from response, where allowable given the request."""
        _debug("extract_cookies: %s", response.info())
        self._cookies_lock.acquire()
        try:
            for cookie in self.make_cookies(response, request):
                if self._policy.set_ok(cookie, request):
                    _debug(" setting cookie: %s", cookie)
                    self.set_cookie(cookie)
        finally:
            self._cookies_lock.release()

    def clear(self, domain=None, path=None, name=None):
        """Clear some cookies.

        Invoking this method without arguments will clear all cookies.  If
        given a single argument, only cookies belonging to that domain will be
        removed.  If given two arguments, cookies belonging to the specified
        path within that domain are removed.  If given three arguments, then
        the cookie with the specified name, path and domain is removed.

        Raises KeyError if no matching cookie exists.

        """
        if name is not None:
            if (domain is None) or (path is None):
                raise ValueError(
                    "domain and path must be given to remove a cookie by name")
            del self._cookies[domain][path][name]
        elif path is not None:
            if domain is None:
                raise ValueError(
                    "domain must be given to remove cookies by path")
            del self._cookies[domain][path]
        elif domain is not None:
            del self._cookies[domain]
        else:
            self._cookies = {}

    def clear_session_cookies(self):
        """Discard all session cookies.

        Note that the .save() method won't save session cookies anyway, unless
        you ask otherwise by passing a true ignore_discard argument.

        """
        self._cookies_lock.acquire()
        try:
            for cookie in self:
                if cookie.discard:
                    self.clear(cookie.domain, cookie.path, cookie.name)
        finally:
            self._cookies_lock.release()

    def clear_expired_cookies(self):
        """Discard all expired cookies.

        You probably don't need to call this method: expired cookies are never
        sent back to the server (provided you're using DefaultCookiePolicy),
        this method is called by CookieJar itself every so often, and the
        .save() method won't save expired cookies anyway (unless you ask
        otherwise by passing a true ignore_expires argument).

        """
        self._cookies_lock.acquire()
        try:
            now = time.time()
            for cookie in self:
                if cookie.is_expired(now):
                    self.clear(cookie.domain, cookie.path, cookie.name)
        finally:
            self._cookies_lock.release()

    def __iter__(self):
        return deepvalues(self._cookies)

    def __len__(self):
        """Return number of contained cookies."""
        i = 0
        for cookie in self: i = i + 1
        return i

    def __repr__(self):
        r = []
        for cookie in self: r.append(repr(cookie))
        return "<%s[%s]>" % (self.__class__.__name__, ", ".join(r))

    def __str__(self):
        r = []
        for cookie in self: r.append(str(cookie))
        return "<%s[%s]>" % (self.__class__.__name__, ", ".join(r))


# derives from OSError for backwards-compatibility with Python 2.4.0
class LoadError(OSError): pass

class FileCookieJar(CookieJar):
    """CookieJar that can be loaded from and saved to a file."""

    def __init__(self, filename=None, delayload=False, policy=None):
        """
        Cookies are NOT loaded from the named file until either the .load() or
        .revert() method is called.

        """
        CookieJar.__init__(self, policy)
        if filename is not None:
            filename = os.fspath(filename)
        self.filename = filename
        self.delayload = bool(delayload)

    def save(self, filename=None, ignore_discard=False, ignore_expires=False):
        """Save cookies to a file."""
        raise NotImplementedError()

    def load(self, filename=None, ignore_discard=False, ignore_expires=False):
        """Load cookies from a file."""
        if filename is None:
            if self.filename is not None: filename = self.filename
            else: raise ValueError(MISSING_FILENAME_TEXT)

        with open(filename) as f:
            self._really_load(f, filename, ignore_discard, ignore_expires)

    def revert(self, filename=None,
               ignore_discard=False, ignore_expires=False):
        """Clear all cookies and reload cookies from a saved file.

        Raises LoadError (or OSError) if reversion is not successful; the
        object's state will not be altered if this happens.

        """
        if filename is None:
            if self.filename is not None: filename = self.filename
            else: raise ValueError(MISSING_FILENAME_TEXT)

        self._cookies_lock.acquire()
        try:

            old_state = copy.deepcopy(self._cookies)
            self._cookies = {}
            try:
                self.load(filename, ignore_discard, ignore_expires)
            except OSError:
                self._cookies = old_state
                raise

        finally:
            self._cookies_lock.release()


def lwp_cookie_str(cookie):
    """Return string representation of Cookie in the LWP cookie file format.

    Actually, the format is extended a bit -- see module docstring.

    """
    h = [(cookie.name, cookie.value),
         ("path", cookie.path),
         ("domain", cookie.domain)]
    if cookie.port is not None: h.append(("port", cookie.port))
    if cookie.path_specified: h.append(("path_spec", None))
    if cookie.port_specified: h.append(("port_spec", None))
    if cookie.domain_initial_dot: h.append(("domain_dot", None))
    if cookie.secure: h.append(("secure", None))
    if cookie.expires: h.append(("expires",
                               time2isoz(float(cookie.expires))))
    if cookie.discard: h.append(("discard", None))
    if cookie.comment: h.append(("comment", cookie.comment))
    if cookie.comment_url: h.append(("commenturl", cookie.comment_url))

    keys = sorted(cookie._rest.keys())
    for k in keys:
        h.append((k, str(cookie._rest[k])))

    h.append(("version", str(cookie.version)))

    return join_header_words([h])

class LWPCookieJar(FileCookieJar):
    """
    The LWPCookieJar saves a sequence of "Set-Cookie3" lines.
    "Set-Cookie3" is the format used by the libwww-perl library, not known
    to be compatible with any browser, but which is easy to read and
    doesn't lose information about RFC 2965 cookies.

    Additional methods

    as_lwp_str(ignore_discard=True, ignore_expired=True)

    """

    def as_lwp_str(self, ignore_discard=True, ignore_expires=True):
        """Return cookies as a string of "\\n"-separated "Set-Cookie3" headers.

        ignore_discard and ignore_expires: see docstring for FileCookieJar.save

        """
        now = time.time()
        r = []
        for cookie in self:
            if not ignore_discard and cookie.discard:
                continue
            if not ignore_expires and cookie.is_expired(now):
                continue
            r.append("Set-Cookie3: %s" % lwp_cookie_str(cookie))
        return "\n".join(r+[""])

    def save(self, filename=None, ignore_discard=False, ignore_expires=False):
        if filename is None:
            if self.filename is not None: filename = self.filename
            else: raise ValueError(MISSING_FILENAME_TEXT)

        with open(filename, "w") as f:
            # There really isn't an LWP Cookies 2.0 format, but this indicates
            # that there is extra information in here (domain_dot and
            # port_spec) while still being compatible with libwww-perl, I hope.
            f.write("#LWP-Cookies-2.0\n")
            f.write(self.as_lwp_str(ignore_discard, ignore_expires))

    def _really_load(self, f, filename, ignore_discard, ignore_expires):
        magic = f.readline()
        if not self.magic_re.search(magic):
            msg = ("%r does not look like a Set-Cookie3 (LWP) format "
                   "file" % filename)
            raise LoadError(msg)

        now = time.time()

        header = "Set-Cookie3:"
        boolean_attrs = ("port_spec", "path_spec", "domain_dot",
                         "secure", "discard")
        value_attrs = ("version",
                       "port", "path", "domain",
                       "expires",
                       "comment", "commenturl")

        try:
            while 1:
                line = f.readline()
                if line == "": break
                if not line.startswith(header):
                    continue
                line = line[len(header):].strip()

                for data in split_header_words([line]):
                    name, value = data[0]
                    standard = {}
                    rest = {}
                    for k in boolean_attrs:
                        standard[k] = False
                    for k, v in data[1:]:
                        if k is not None:
                            lc = k.lower()
                        else:
                            lc = None
                        # don't lose case distinction for unknown fields
                        if (lc in value_attrs) or (lc in boolean_attrs):
                            k = lc
                        if k in boolean_attrs:
                            if v is None: v = True
                            standard[k] = v
                        elif k in value_attrs:
                            standard[k] = v
                        else:
                            rest[k] = v

                    h = standard.get
                    expires = h("expires")
                    discard = h("discard")
                    if expires is not None:
                        expires = iso2time(expires)
                    if expires is None:
                        discard = True
                    domain = h("domain")
                    domain_specified = domain.startswith(".")
                    c = Cookie(h("version"), name, value,
                               h("port"), h("port_spec"),
                               domain, domain_specified, h("domain_dot"),
                               h("path"), h("path_spec"),
                               h("secure"),
                               expires,
                               discard,
                               h("comment"),
                               h("commenturl"),
                               rest)
                    if not ignore_discard and c.discard:
                        continue
                    if not ignore_expires and c.is_expired(now):
                        continue
                    self.set_cookie(c)
        except OSError:
            raise
        except Exception:
            _warn_unhandled_exception()
            raise LoadError("invalid Set-Cookie3 format file %r: %r" %
                            (filename, line))


class MozillaCookieJar(FileCookieJar):
    """

    WARNING: you may want to backup your browser's cookies file if you use
    this class to save cookies.  I *think* it works, but there have been
    bugs in the past!

    This class differs from CookieJar only in the format it uses to save and
    load cookies to and from a file.  This class uses the Mozilla/Netscape
    `cookies.txt' format.  lynx uses this file format, too.

    Don't expect cookies saved while the browser is running to be noticed by
    the browser (in fact, Mozilla on unix will overwrite your saved cookies if
    you change them on disk while it's running; on Windows, you probably can't
    save at all while the browser is running).

    Note that the Mozilla/Netscape format will downgrade RFC2965 cookies to
    Netscape cookies on saving.

    In particular, the cookie version and port number information is lost,
    together with information about whether or not Path, Port and Discard were
    specified by the Set-Cookie2 (or Set-Cookie) header, and whether or not the
    domain as set in the HTTP header started with a dot (yes, I'm aware some
    domains in Netscape files start with a dot and some don't -- trust me, you
    really don't want to know any more about this).

    Note that though Mozilla and Netscape use the same format, they use
    slightly different headers.  The class saves cookies using the Netscape
    header by default (Mozilla can cope with that).

    """
    magic_re = re.compile("#( Netscape)? HTTP Cookie File")
    header = """\
# Netscape HTTP Cookie File
# http://curl.haxx.se/rfc/cookie_spec.html
# This is a generated file!  Do not edit.

"""

    def _really_load(self, f, filename, ignore_discard, ignore_expires):
        now = time.time()

        magic = f.readline()
        if not self.magic_re.search(magic):
            raise LoadError(
                "%r does not look like a Netscape format cookies file" %
                filename)

        try:
            while 1:
                line = f.readline()
                if line == "": break

                # last field may be absent, so keep any trailing tab
                if line.endswith("\n"): line = line[:-1]

                # skip comments and blank lines XXX what is $ for?
                if (line.strip().startswith(("#", "$")) or
                    line.strip() == ""):
                    continue

                domain, domain_specified, path, secure, expires, name, value = \
                        line.split("\t")
                secure = (secure == "TRUE")
                domain_specified = (domain_specified == "TRUE")
                if name == "":
                    # cookies.txt regards 'Set-Cookie: foo' as a cookie
                    # with no name, whereas http.cookiejar regards it as a
                    # cookie with no value.
                    name = value
                    value = None

                initial_dot = domain.startswith(".")
                assert domain_specified == initial_dot

                discard = False
                if expires == "":
                    expires = None
                    discard = True

                # assume path_specified is false
                c = Cookie(0, name, value,
                           None, False,
                           domain, domain_specified, initial_dot,
                           path, False,
                           secure,
                           expires,
                           discard,
                           None,
                           None,
                           {})
                if not ignore_discard and c.discard:
                    continue
                if not ignore_expires and c.is_expired(now):
                    continue
                self.set_cookie(c)

        except OSError:
            raise
        except Exception:
            _warn_unhandled_exception()
            raise LoadError("invalid Netscape format cookies file %r: %r" %
                            (filename, line))

    def save(self, filename=None, ignore_discard=False, ignore_expires=False):
        if filename is None:
            if self.filename is not None: filename = self.filename
            else: raise ValueError(MISSING_FILENAME_TEXT)

        with open(filename, "w") as f:
            f.write(self.header)
            now = time.time()
            for cookie in self:
                if not ignore_discard and cookie.discard:
                    continue
                if not ignore_expires and cookie.is_expired(now):
                    continue
                if cookie.secure: secure = "TRUE"
                else: secure = "FALSE"
                if cookie.domain.startswith("."): initial_dot = "TRUE"
                else: initial_dot = "FALSE"
                if cookie.expires is not None:
                    expires = str(cookie.expires)
                else:
                    expires = ""
                if cookie.value is None:
                    # cookies.txt regards 'Set-Cookie: foo' as a cookie
                    # with no name, whereas http.cookiejar regards it as a
                    # cookie with no value.
                    name = ""
                    value = cookie.name
                else:
                    name = cookie.name
                    value = cookie.value
                f.write(
                    "\t".join([cookie.domain, initial_dot, cookie.path,
                               secure, expires, name, value])+
                    "\n")
http/__init__.py000064400000014352151153537450007652 0ustar00from enum import IntEnum

__all__ = ['HTTPStatus']

class HTTPStatus(IntEnum):
    """HTTP status codes and reason phrases

    Status codes from the following RFCs are all observed:

        * RFC 7231: Hypertext Transfer Protocol (HTTP/1.1), obsoletes 2616
        * RFC 6585: Additional HTTP Status Codes
        * RFC 3229: Delta encoding in HTTP
        * RFC 4918: HTTP Extensions for WebDAV, obsoletes 2518
        * RFC 5842: Binding Extensions to WebDAV
        * RFC 7238: Permanent Redirect
        * RFC 2295: Transparent Content Negotiation in HTTP
        * RFC 2774: An HTTP Extension Framework
        * RFC 7725: An HTTP Status Code to Report Legal Obstacles
        * RFC 7540: Hypertext Transfer Protocol Version 2 (HTTP/2)
    """
    def __new__(cls, value, phrase, description=''):
        obj = int.__new__(cls, value)
        obj._value_ = value

        obj.phrase = phrase
        obj.description = description
        return obj

    # informational
    CONTINUE = 100, 'Continue', 'Request received, please continue'
    SWITCHING_PROTOCOLS = (101, 'Switching Protocols',
            'Switching to new protocol; obey Upgrade header')
    PROCESSING = 102, 'Processing'

    # success
    OK = 200, 'OK', 'Request fulfilled, document follows'
    CREATED = 201, 'Created', 'Document created, URL follows'
    ACCEPTED = (202, 'Accepted',
        'Request accepted, processing continues off-line')
    NON_AUTHORITATIVE_INFORMATION = (203,
        'Non-Authoritative Information', 'Request fulfilled from cache')
    NO_CONTENT = 204, 'No Content', 'Request fulfilled, nothing follows'
    RESET_CONTENT = 205, 'Reset Content', 'Clear input form for further input'
    PARTIAL_CONTENT = 206, 'Partial Content', 'Partial content follows'
    MULTI_STATUS = 207, 'Multi-Status'
    ALREADY_REPORTED = 208, 'Already Reported'
    IM_USED = 226, 'IM Used'

    # redirection
    MULTIPLE_CHOICES = (300, 'Multiple Choices',
        'Object has several resources -- see URI list')
    MOVED_PERMANENTLY = (301, 'Moved Permanently',
        'Object moved permanently -- see URI list')
    FOUND = 302, 'Found', 'Object moved temporarily -- see URI list'
    SEE_OTHER = 303, 'See Other', 'Object moved -- see Method and URL list'
    NOT_MODIFIED = (304, 'Not Modified',
        'Document has not changed since given time')
    USE_PROXY = (305, 'Use Proxy',
        'You must use proxy specified in Location to access this resource')
    TEMPORARY_REDIRECT = (307, 'Temporary Redirect',
        'Object moved temporarily -- see URI list')
    PERMANENT_REDIRECT = (308, 'Permanent Redirect',
        'Object moved permanently -- see URI list')

    # client error
    BAD_REQUEST = (400, 'Bad Request',
        'Bad request syntax or unsupported method')
    UNAUTHORIZED = (401, 'Unauthorized',
        'No permission -- see authorization schemes')
    PAYMENT_REQUIRED = (402, 'Payment Required',
        'No payment -- see charging schemes')
    FORBIDDEN = (403, 'Forbidden',
        'Request forbidden -- authorization will not help')
    NOT_FOUND = (404, 'Not Found',
        'Nothing matches the given URI')
    METHOD_NOT_ALLOWED = (405, 'Method Not Allowed',
        'Specified method is invalid for this resource')
    NOT_ACCEPTABLE = (406, 'Not Acceptable',
        'URI not available in preferred format')
    PROXY_AUTHENTICATION_REQUIRED = (407,
        'Proxy Authentication Required',
        'You must authenticate with this proxy before proceeding')
    REQUEST_TIMEOUT = (408, 'Request Timeout',
        'Request timed out; try again later')
    CONFLICT = 409, 'Conflict', 'Request conflict'
    GONE = (410, 'Gone',
        'URI no longer exists and has been permanently removed')
    LENGTH_REQUIRED = (411, 'Length Required',
        'Client must specify Content-Length')
    PRECONDITION_FAILED = (412, 'Precondition Failed',
        'Precondition in headers is false')
    REQUEST_ENTITY_TOO_LARGE = (413, 'Request Entity Too Large',
        'Entity is too large')
    REQUEST_URI_TOO_LONG = (414, 'Request-URI Too Long',
        'URI is too long')
    UNSUPPORTED_MEDIA_TYPE = (415, 'Unsupported Media Type',
        'Entity body in unsupported format')
    REQUESTED_RANGE_NOT_SATISFIABLE = (416,
        'Requested Range Not Satisfiable',
        'Cannot satisfy request range')
    EXPECTATION_FAILED = (417, 'Expectation Failed',
        'Expect condition could not be satisfied')
    MISDIRECTED_REQUEST = (421, 'Misdirected Request',
        'Server is not able to produce a response')
    UNPROCESSABLE_ENTITY = 422, 'Unprocessable Entity'
    LOCKED = 423, 'Locked'
    FAILED_DEPENDENCY = 424, 'Failed Dependency'
    UPGRADE_REQUIRED = 426, 'Upgrade Required'
    PRECONDITION_REQUIRED = (428, 'Precondition Required',
        'The origin server requires the request to be conditional')
    TOO_MANY_REQUESTS = (429, 'Too Many Requests',
        'The user has sent too many requests in '
        'a given amount of time ("rate limiting")')
    REQUEST_HEADER_FIELDS_TOO_LARGE = (431,
        'Request Header Fields Too Large',
        'The server is unwilling to process the request because its header '
        'fields are too large')
    UNAVAILABLE_FOR_LEGAL_REASONS = (451,
        'Unavailable For Legal Reasons',
        'The server is denying access to the '
        'resource as a consequence of a legal demand')

    # server errors
    INTERNAL_SERVER_ERROR = (500, 'Internal Server Error',
        'Server got itself in trouble')
    NOT_IMPLEMENTED = (501, 'Not Implemented',
        'Server does not support this operation')
    BAD_GATEWAY = (502, 'Bad Gateway',
        'Invalid responses from another server/proxy')
    SERVICE_UNAVAILABLE = (503, 'Service Unavailable',
        'The server cannot process the request due to a high load')
    GATEWAY_TIMEOUT = (504, 'Gateway Timeout',
        'The gateway server did not receive a timely response')
    HTTP_VERSION_NOT_SUPPORTED = (505, 'HTTP Version Not Supported',
        'Cannot fulfill request')
    VARIANT_ALSO_NEGOTIATES = 506, 'Variant Also Negotiates'
    INSUFFICIENT_STORAGE = 507, 'Insufficient Storage'
    LOOP_DETECTED = 508, 'Loop Detected'
    NOT_EXTENDED = 510, 'Not Extended'
    NETWORK_AUTHENTICATION_REQUIRED = (511,
        'Network Authentication Required',
        'The client needs to authenticate to gain network access')
http/__pycache__/cookies.cpython-38.pyc000064400000035646151153537450014046 0ustar00U

e5d�O�
@stdZddlZddlZdddgZdjZdjZdjZGd	d�de�Z	ej
ejd
ZedZ
dd
�eed��eeee
��D�Ze�ed�ded�di�e�de�e��jZdd�Ze�d�Ze�d�Zdd�Zddddddd gZdd!d"d#d$d%d&d'd(d)d*d+d,g
Zdeefd-d.�ZGd/d0�d0e�Z d1Z!e!d2Z"e�d3e!d4e"d5ej#ej$B�Z%Gd6d�de�Z&Gd7d�de&�Z'dS)8a.

Here's a sample session to show how to use this module.
At the moment, this is the only documentation.

The Basics
----------

Importing is easy...

   >>> from http import cookies

Most of the time you start by creating a cookie.

   >>> C = cookies.SimpleCookie()

Once you've created your Cookie, you can add values just as if it were
a dictionary.

   >>> C = cookies.SimpleCookie()
   >>> C["fig"] = "newton"
   >>> C["sugar"] = "wafer"
   >>> C.output()
   'Set-Cookie: fig=newton\r\nSet-Cookie: sugar=wafer'

Notice that the printable representation of a Cookie is the
appropriate format for a Set-Cookie: header.  This is the
default behavior.  You can change the header and printed
attributes by using the .output() function

   >>> C = cookies.SimpleCookie()
   >>> C["rocky"] = "road"
   >>> C["rocky"]["path"] = "/cookie"
   >>> print(C.output(header="Cookie:"))
   Cookie: rocky=road; Path=/cookie
   >>> print(C.output(attrs=[], header="Cookie:"))
   Cookie: rocky=road

The load() method of a Cookie extracts cookies from a string.  In a
CGI script, you would use this method to extract the cookies from the
HTTP_COOKIE environment variable.

   >>> C = cookies.SimpleCookie()
   >>> C.load("chips=ahoy; vienna=finger")
   >>> C.output()
   'Set-Cookie: chips=ahoy\r\nSet-Cookie: vienna=finger'

The load() method is darn-tootin smart about identifying cookies
within a string.  Escaped quotation marks, nested semicolons, and other
such trickeries do not confuse it.

   >>> C = cookies.SimpleCookie()
   >>> C.load('keebler="E=everybody; L=\\"Loves\\"; fudge=\\012;";')
   >>> print(C)
   Set-Cookie: keebler="E=everybody; L=\"Loves\"; fudge=\012;"

Each element of the Cookie also supports all of the RFC 2109
Cookie attributes.  Here's an example which sets the Path
attribute.

   >>> C = cookies.SimpleCookie()
   >>> C["oreo"] = "doublestuff"
   >>> C["oreo"]["path"] = "/"
   >>> print(C)
   Set-Cookie: oreo=doublestuff; Path=/

Each dictionary element has a 'value' attribute, which gives you
back the value associated with the key.

   >>> C = cookies.SimpleCookie()
   >>> C["twix"] = "none for you"
   >>> C["twix"].value
   'none for you'

The SimpleCookie expects that all values should be standard strings.
Just to be sure, SimpleCookie invokes the str() builtin to convert
the value to a string, when the values are set dictionary-style.

   >>> C = cookies.SimpleCookie()
   >>> C["number"] = 7
   >>> C["string"] = "seven"
   >>> C["number"].value
   '7'
   >>> C["string"].value
   'seven'
   >>> C.output()
   'Set-Cookie: number=7\r\nSet-Cookie: string=seven'

Finis.
�N�CookieError�
BaseCookie�SimpleCookie�z; � c@seZdZdS)rN)�__name__�
__module__�__qualname__�r
r
�$/usr/lib64/python3.8/http/cookies.pyr�sz!#$%&'*+-.^_`|~:z
 ()/<=>?@[]{}cCsi|]}|d|�qS)z\%03or
)�.0�nr
r
r�
<dictcomp>�s�r��"�\"�\z\\z[%s]+cCs*|dkst|�r|Sd|�t�dSdS)z�Quote a string for use in a cookie header.

    If the string does not need to be double-quoted, then just return the
    string.  Otherwise, surround the string in doublequotes and quote
    (with a \) special characters.
    Nr)�
_is_legal_key�	translate�_Translator��strr
r
r�_quote�srz\\[0-3][0-7][0-7]z[\\].cCsN|dkst|�dkr|S|ddks0|ddkr4|S|dd�}d}t|�}g}d|krf|k�rFnn�t�||�}t�||�}|s�|s�|�||d���qFd}}|r�|�d�}|r�|�d�}|�r|r�||k�r|�|||��|�||d�|d}qP|�|||��|�tt||d|d�d���|d}qPt|�S)N�rr������)	�len�
_OctalPatt�search�
_QuotePatt�append�start�chr�int�	_nulljoin)r�ir
�resZo_matchZq_match�j�kr
r
r�_unquote�s6


$
r+ZMonZTueZWedZThuZFriZSatZSunZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDecc	CsRddlm}m}|�}|||�\	}}}}	}
}}}
}d|||||||	|
|fS)Nr)�gmtime�timez#%s, %02d %3s %4d %02d:%02d:%02d GMT)r-r,)ZfutureZweekdaynameZ	monthnamer,r-ZnowZyearZmonthZdayZhhZmmZssZwd�y�zr
r
r�_getdate�s�r0c
@s�eZdZdZdddddddd	d
d�	Zdd
hZdd�Zedd��Zedd��Z	edd��Z
dd�Zd2dd�Zdd�Z
ejZdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd3d*d+�ZeZd,d-�Zd4d.d/�Zd5d0d1�ZdS)6�MorselaCA class to hold ONE (key, value) pair.

    In a cookie, each such pair may have several attributes, so this class is
    used to keep the attributes associated with the appropriate key,value pair.
    This class also includes a coded_value attribute, which is used to hold
    the network representation of the value.
    �expires�Path�CommentZDomainzMax-AgeZSecureZHttpOnlyZVersionZSameSite)	r2�path�commentZdomain�max-age�secure�httponly�versionZsamesiter8r9cCs0d|_|_|_|jD]}t�||d�qdS)Nr)�_key�_value�_coded_value�	_reserved�dict�__setitem__)�self�keyr
r
r�__init__ s
zMorsel.__init__cCs|jS�N)r;�rAr
r
rrB(sz
Morsel.keycCs|jSrD)r<rEr
r
r�value,szMorsel.valuecCs|jSrD)r=rEr
r
r�coded_value0szMorsel.coded_valuecCs2|��}||jkr td|f��t�|||�dS�NzInvalid attribute %r)�lowerr>rr?r@)rA�K�Vr
r
rr@4s
zMorsel.__setitem__NcCs.|��}||jkr td|f��t�|||�SrH)rIr>rr?�
setdefault)rArB�valr
r
rrL:s
zMorsel.setdefaultcCs>t|t�stSt�||�o<|j|jko<|j|jko<|j|jkSrD)�
isinstancer1�NotImplementedr?�__eq__r<r;r=�rAZmorselr
r
rrP@s

�
�
�z
Morsel.__eq__cCs$t�}t�||�|j�|j�|SrD)r1r?�update�__dict__rQr
r
r�copyJszMorsel.copycCsRi}t|���D]0\}}|��}||jkr8td|f��|||<qt�||�dSrH)r?�itemsrIr>rrR)rA�values�datarBrMr
r
rrRPs

z
Morsel.updatecCs|��|jkSrD)rIr>)rArJr
r
r�
isReservedKeyYszMorsel.isReservedKeycCsH|��|jkrtd|f��t|�s2td|f��||_||_||_dS)Nz Attempt to set a reserved key %rzIllegal key %r)rIr>rrr;r<r=)rArBrMZ	coded_valr
r
r�set\sz
Morsel.setcCs|j|j|jd�S)N)rBrFrG�r;r<r=rEr
r
r�__getstate__gs�zMorsel.__getstate__cCs"|d|_|d|_|d|_dS)NrBrFrGrZ)rA�stater
r
r�__setstate__ns

zMorsel.__setstate__�Set-Cookie:cCsd||�|�fS)Nz%s %s)�OutputString)rA�attrs�headerr
r
r�outputssz
Morsel.outputcCsd|jj|��fS)N�<%s: %s>)�	__class__rr_rEr
r
r�__repr__xszMorsel.__repr__cCsd|�|��dd�S)Nz�
        <script type="text/javascript">
        <!-- begin hiding
        document.cookie = "%s";
        // end hiding -->
        </script>
        rr)r_�replace)rAr`r
r
r�	js_output{s�zMorsel.js_outputcCs$g}|j}|d|j|jf�|dkr,|j}t|���}|D]�\}}|dkrNq<||krXq<|dkr�t|t�r�|d|j|t|�f�q<|dkr�t|t�r�|d|j||f�q<|dkr�t|t	�r�|d|j|t
|�f�q<||jk�r|�r|t	|j|��q<|d|j||f�q<t|�S)N�%s=%srr2r7z%s=%dr6)
r"rBrGr>�sortedrUrNr%r0rr�_flags�_semispacejoin)rAr`�resultr"rUrBrFr
r
rr_�s,zMorsel.OutputString)N)Nr^)N)N)rrr	�__doc__r>rjrC�propertyrBrFrGr@rLrP�object�__ne__rTrRrXrYr[r]rb�__str__rergr_r
r
r
rr1�sD�



	


r1z,\w\d!#%&'~_`><@,:/\$\*\+\-\.\^\|\)\(\?\}\{\=z\[\]z�
    \s*                            # Optional whitespace at start of cookie
    (?P<key>                       # Start of group 'key'
    [a	]+?   # Any word of at least one letter
    )                              # End of group 'key'
    (                              # Optional group: there may not be a value.
    \s*=\s*                          # Equal Sign
    (?P<val>                         # Start of group 'val'
    "(?:[^\\"]|\\.)*"                  # Any doublequoted string
    |                                  # or
    \w{3},\s[\w\d\s-]{9,11}\s[\d:]{8}\sGMT  # Special case for "expires" attr
    |                                  # or
    [a-]*      # Any word or empty string
    )                                # End of group 'val'
    )?                             # End of optional value group
    \s*                            # Any number of spaces.
    (\s+|;|$)                      # Ending either at space, semicolon, or EOS.
    c@sneZdZdZdd�Zdd�Zddd�Zd	d
�Zdd�Zddd�Z	e	Z
dd�Zddd�Zdd�Z
efdd�ZdS)rz'A container class for a set of Morsels.cCs||fS)a
real_value, coded_value = value_decode(STRING)
        Called prior to setting a cookie's value from the network
        representation.  The VALUE is the value read from HTTP
        header.
        Override this function to modify the behavior of cookies.
        r
�rArMr
r
r�value_decode�szBaseCookie.value_decodecCst|�}||fS)z�real_value, coded_value = value_encode(VALUE)
        Called prior to setting a cookie's value from the dictionary
        representation.  The VALUE is the value being assigned.
        Override this function to modify the behavior of cookies.
        r�rArMZstrvalr
r
r�value_encode�szBaseCookie.value_encodeNcCs|r|�|�dSrD)�load)rA�inputr
r
rrC�szBaseCookie.__init__cCs.|�|t��}|�|||�t�|||�dS)z+Private method for setting a cookie's valueN)�getr1rYr?r@)rArBZ
real_valuerG�Mr
r
rZ__set�szBaseCookie.__setcCs:t|t�rt�|||�n|�|�\}}|�|||�dS)zDictionary style assignment.N)rNr1r?r@ru�_BaseCookie__set)rArBrF�rval�cvalr
r
rr@�s
zBaseCookie.__setitem__r^�
cCs:g}t|���}|D]\}}|�|�||��q|�|�S)z"Return a string suitable for HTTP.)rirUr"rb�join)rAr`ra�seprlrUrBrFr
r
rrb�s
zBaseCookie.outputcCsJg}t|���}|D] \}}|�d|t|j�f�qd|jjt|�fS)Nrhrc)rirUr"�reprrFrdr�
_spacejoin)rA�lrUrBrFr
r
rre�s
zBaseCookie.__repr__cCs6g}t|���}|D]\}}|�|�|��qt|�S)z(Return a string suitable for JavaScript.)rirUr"rgr&)rAr`rlrUrBrFr
r
rrgs
zBaseCookie.js_outputcCs4t|t�r|�|�n|��D]\}}|||<qdS)z�Load cookies from a string (presumably HTTP_COOKIE) or
        from a dictionary.  Loading cookies from a dictionary 'd'
        is equivalent to calling:
            map(Cookie.__setitem__, d.keys(), d.values())
        N)rNr�_BaseCookie__parse_stringrU)rAZrawdatarBrFr
r
rrv
s


zBaseCookie.loadcCs�d}t|�}g}d}d}d}d|kr2|k�rnn�|�||�}	|	sJ�q|	�d�|	�d�}
}|	�d�}|
ddkr�|s|q|�||
dd�|f�q|
��tjkr�|s�dS|dkr�|
��tjkr�|�||
df�q�dSn|�||
t	|�f�q|dk	�r|�||
|�
|�f�d}qdSqd}|D]Z\}
}
}|
|k�rP|dk	�sFt�|||
<n,|
|k�s^t�|\}}|�|
||�||
}�q$dS)	NrFrrrBrM�$T)
r�match�group�endr"rIr1r>rjr+rs�AssertionErrorrz)rArZpattr'r
Zparsed_itemsZmorsel_seenZTYPE_ATTRIBUTEZ
TYPE_KEYVALUEr�rBrFry�tpr{r|r
r
rZ__parse_stringsJ



zBaseCookie.__parse_string)N)Nr^r})N)rrr	rmrsrurCrzr@rbrqrergrv�_CookiePatternr�r
r
r
rr�s		
	

c@s eZdZdZdd�Zdd�ZdS)rz�
    SimpleCookie supports strings as cookie values.  When setting
    the value using the dictionary assignment notation, SimpleCookie
    calls the builtin str() to convert the value to a string.  Values
    received from HTTP are kept as strings.
    cCst|�|fSrD)r+rrr
r
rrs\szSimpleCookie.value_decodecCst|�}|t|�fSrD)rrrtr
r
rru_szSimpleCookie.value_encodeN)rrr	rmrsrur
r
r
rrUs)(rm�re�string�__all__r~r&rkr��	ExceptionrZ
ascii_lettersZdigitsZ_LegalCharsZ_UnescapedCharsrY�range�map�ordrrR�compile�escape�	fullmatchrrrr!r+Z_weekdaynameZ
_monthnamer0r?r1Z_LegalKeyCharsZ_LegalValueChars�ASCII�VERBOSEr�rrr
r
r
r�<module>'sr]
��

2�4����
�
http/__pycache__/cookiejar.cpython-38.pyc000064400000150614151153537450014351 0ustar00U

e5d#,�@sdZddddddddgZd	d
lZd	d
lZd	d
lZd	d
lZd	d
lZd	d
lZd	d
l	Zd	d
l
Zd	d
lZ
d	dlmZdZd
ad
d�Zee
jj�ZdZdd�ZdZdd�ZdddddddgZddddd d!d"d#d$d%d&d'gZgZeD]Ze�e� ��q�dud(d)�Z!dvd*d+�Z"d
d
d
d
d,�Z#e�$d-ej%�Z&d.d/�Z'd0d1�Z(e�$d2ej%�Z)e�$d3ej*ej%B�Z+e�$d4ej,ej%B�Z-d5d6�Z.e�$d7ej,ej%B�Z/d8d9�Z0d:d;�Z1e�$d<�Z2e�$d=�Z3e�$d>�Z4e�$d?�Z5d@dA�Z6e�$dB�Z7dCdD�Z8dEdF�Z9dGdH�Z:e�$dIej%�Z;dJdK�Z<dLdM�Z=dNdO�Z>dPdQ�Z?e�$dRej%�Z@dSdT�ZAdUdV�ZBdWdX�ZCdYdZ�ZDd[ZEe�$d\�ZFd]d^�ZGd_d`�ZHdadb�ZIdcdd�ZJGded�d�ZKGdfd�d�ZLGdgd�deL�ZMdhdi�ZNdjdk�ZOGdldm�dm�ZPGdnd�d�ZQGdod�deR�ZSGdpd�deQ�ZTdqdr�ZUGdsd�deT�ZVGdtd�deT�ZWd
S)wa�HTTP cookie handling for web clients.

This module has (now fairly distant) origins in Gisle Aas' Perl module
HTTP::Cookies, from the libwww-perl library.

Docstrings, comments and debug strings in this code refer to the
attributes of the HTTP cookie system as cookie-attributes, to distinguish
them clearly from Python attributes.

Class diagram (note that BSDDBCookieJar and the MSIE* classes are not
distributed with the Python standard library, but are available from
http://wwwsearch.sf.net/):

                        CookieJar____
                        /     \      \
            FileCookieJar      \      \
             /    |   \         \      \
 MozillaCookieJar | LWPCookieJar \      \
                  |               |      \
                  |   ---MSIEBase |       \
                  |  /      |     |        \
                  | /   MSIEDBCookieJar BSDDBCookieJar
                  |/
               MSIECookieJar

�Cookie�	CookieJar�CookiePolicy�DefaultCookiePolicy�
FileCookieJar�LWPCookieJar�	LoadError�MozillaCookieJar�N)�timegmFcGs(tsdStsddl}|�d�atj|�S)Nr	zhttp.cookiejar)�debug�logger�loggingZ	getLogger)�argsr
�r�&/usr/lib64/python3.8/http/cookiejar.py�_debug,s
rzQa filename was not supplied (nor was the CookieJar instance initialised with one)cCsJddl}ddl}ddl}|��}|�d|�|��}|jd|dd�dS)Nr	zhttp.cookiejar bug!
%s�)�
stacklevel)�io�warnings�	traceback�StringIO�	print_exc�getvalue�warn)rrr�f�msgrrr�_warn_unhandled_exception:s
ri�cCs�|dd�\}}}}}}|tkr�d|kr4dkr�nnhd|krLdkr�nnPd|krddkr�nn8d|kr|dkr�nn d|kr�dkr�nnt|�SdSdS)	N����r	��;�=)�
EPOCH_YEARr
)�tt�year�monthZmday�hour�min�secrrr�_timegmIs&8��
��
��
r,ZMonZTueZWedZThuZFriZSatZSunZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDeccCs@|dkrtj��}ntj�|�}d|j|j|j|j|j|jfS)aHReturn a string representing time in seconds since epoch, t.

    If the function is called without an argument, it will use the current
    time.

    The format of the returned string is like "YYYY-MM-DD hh:mm:ssZ",
    representing Universal Time (UTC, aka GMT).  An example of this format is:

    1994-11-24 08:49:37Z

    Nz%04d-%02d-%02d %02d:%02d:%02dZ)	�datetime�utcnow�utcfromtimestampr'r(�dayr)�minute�second��tZdtrrr�	time2isozWs�r5cCsR|dkrtj��}ntj�|�}dt|��|jt|jd|j|j	|j
|jfS)z�Return a string representing time in seconds since epoch, t.

    If the function is called without an argument, it will use the current
    time.

    The format of the returned string is like this:

    Wed, DD-Mon-YYYY HH:MM:SS GMT

    Nz#%s, %02d-%s-%04d %02d:%02d:%02d GMTr)r-r.r/�DAYSZweekdayr0�MONTHSr(r'r)r1r2r3rrr�
time2netscapejs
�r8)ZGMT�UTCZUT�Zz^([-+])?(\d\d?):?(\d\d)?$cCsjd}|tkrd}nTt�|�}|rfdt|�d��}|�d�rR|dt|�d��}|�d�dkrf|}|S)Nr	ir��<r�-)�	UTC_ZONES�TIMEZONE_RE�search�int�group)�tz�offset�mrrr�offset_from_tz_string�s

rFc
Cs�t|�}|tjkrdSzt�|���d}Wn^tk
r�zt|�}Wntk
r`YYdSXd|krvdkr�nn|}nYdSYnX|dkr�d}|dkr�d}|dkr�d}t|�}t|�}t|�}t|�}|dk�r6t�t���d}|d}	|}
|||	}|	|
}	t	|	�dk�r6|	dk�r.|d}n|d}t
|||||||f�}|dk	�r�|dk�rdd}|��}t|�}|dk�r�dS||}|S)Nrr r	i��d�2r9)
rAr-ZMAXYEAR�MONTHS_LOWER�index�lower�
ValueError�time�	localtime�absr,�upperrF)
r0�mon�yr�hrr*r+rCZimonZcur_yrrEZtmpr4rDrrr�	_str2time�sV







rTzV^[SMTWF][a-z][a-z], (\d\d) ([JFMASOND][a-z][a-z]) (\d\d\d\d) (\d\d):(\d\d):(\d\d) GMT$z+^(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)[a-z]*,?\s*a�^
    (\d\d?)            # day
       (?:\s+|[-\/])
    (\w+)              # month
        (?:\s+|[-\/])
    (\d+)              # year
    (?:
          (?:\s+|:)    # separator before clock
       (\d\d?):(\d\d)  # hour:min
       (?::(\d\d))?    # optional seconds
    )?                 # optional clock
       \s*
    (?:
       ([-+]?\d{2,4}|(?![APap][Mm]\b)[A-Za-z]+) # timezone
       \s*
    )?
    (?:
       \(\w+\)         # ASCII representation of timezone in parens.
       \s*
    )?$cCs�t�|�}|rl|��}t�|d���d}t|d�|t|d�t|d�t|d�t|d�f}t|�S|�	�}t
�d|d�}dgd	\}}}}}}	}
t�|�}|dk	r�|��\}}}}}}	}
ndSt
||||||	|
�S)
a�Returns time in seconds since epoch of time represented by a string.

    Return value is an integer.

    None is returned if the format of str is unrecognized, the time is outside
    the representable range, or the timezone string is not recognized.  If the
    string contains no timezone, UTC is assumed.

    The timezone in the string may be numerical (like "-0800" or "+0100") or a
    string timezone (like "UTC", "GMT", "BST" or "EST").  Currently, only the
    timezone strings equivalent to UTC (zero offset) are known to the function.

    The function loosely parses the following formats:

    Wed, 09 Feb 1994 22:23:32 GMT       -- HTTP format
    Tuesday, 08-Feb-94 14:15:29 GMT     -- old rfc850 HTTP format
    Tuesday, 08-Feb-1994 14:15:29 GMT   -- broken rfc850 HTTP format
    09 Feb 1994 22:23:32 GMT            -- HTTP format (no weekday)
    08-Feb-94 14:15:29 GMT              -- rfc850 format (no weekday)
    08-Feb-1994 14:15:29 GMT            -- broken rfc850 format (no weekday)

    The parser ignores leading and trailing whitespace.  The time may be
    absent.

    If the year is given with only 2 digits, the function will select the
    century that makes the year closest to the current date.

    rrr	r;���N�)�STRICT_DATE_REr@�groupsrIrJrKrA�floatr,�lstrip�
WEEKDAY_RE�sub�LOOSE_HTTP_DATE_RErT)�textrE�grQr&r0rRrSr*r+rCrrr�	http2time�s$



�
rba�^
    (\d{4})              # year
       [-\/]?
    (\d\d?)              # numerical month
       [-\/]?
    (\d\d?)              # day
   (?:
         (?:\s+|[-:Tt])  # separator before clock
      (\d\d?):?(\d\d)    # hour:min
      (?::?(\d\d(?:\.\d*)?))?  # optional seconds (and fractional)
   )?                    # optional clock
      \s*
   (?:
      ([-+]?\d\d?:?(:?\d\d)?
       |Z|z)             # timezone  (Z is "zero meridian", i.e. GMT)
      \s*
   )?$c
Csd|��}dgd\}}}}}}}t�|�}|dk	rL|��\}}}}}}}}	ndSt|||||||�S)av
    As for http2time, but parses the ISO 8601 formats:

    1994-02-03 14:15:29 -0100    -- ISO 8601 format
    1994-02-03 14:15:29          -- zone is optional
    1994-02-03                   -- only date
    1994-02-03T14:15:29          -- Use T as separator
    19940203T141529Z             -- ISO 8601 compact format
    19940203                     -- only date

    NrX)r\�ISO_DATE_REr@rZrT)
r`r0rQrRrSr*r+rCrE�_rrr�iso2time+s

recCs*|�d�\}}|jd|�|j|d�S)z)Return unmatched part of re.Match object.r	N)�span�string)�match�start�endrrr�	unmatchedLsrkz^\s*([^=\s;,]+)z&^\s*=\s*\"([^\"\\]*(?:\\.[^\"\\]*)*)\"z^\s*=\s*([^\s;,]*)z\\(.)c
Cs0t|t�rt�g}|D�]}|}g}|�rt�|�}|r�t|�}|�d�}t�|�}|rxt|�}|�d�}t�	d|�}n.t
�|�}|r�t|�}|�d�}|��}nd}|�||f�q$|�
��d�r�|�
�dd�}|r�|�|�g}q$t�dd|�\}}	|	dk�std|||f��|}q$|r|�|�q|S)	amParse header values into a list of lists containing key,value pairs.

    The function knows how to deal with ",", ";" and "=" as well as quoted
    values after "=".  A list of space separated tokens are parsed as if they
    were separated by ";".

    If the header_values passed as argument contains multiple values, then they
    are treated as if they were a single value separated by comma ",".

    This means that this function is useful for parsing header fields that
    follow this syntax (BNF as from the HTTP/1.1 specification, but we relax
    the requirement for tokens).

      headers           = #header
      header            = (token | parameter) *( [";"] (token | parameter))

      token             = 1*<any CHAR except CTLs or separators>
      separators        = "(" | ")" | "<" | ">" | "@"
                        | "," | ";" | ":" | "\" | <">
                        | "/" | "[" | "]" | "?" | "="
                        | "{" | "}" | SP | HT

      quoted-string     = ( <"> *(qdtext | quoted-pair ) <"> )
      qdtext            = <any TEXT except <">>
      quoted-pair       = "\" CHAR

      parameter         = attribute "=" value
      attribute         = token
      value             = token | quoted-string

    Each header is represented by a list of key/value pairs.  The value for a
    simple token (not part of a parameter) is None.  Syntactically incorrect
    headers will not necessarily be parsed as you would want.

    This is easier to describe with some examples:

    >>> split_header_words(['foo="bar"; port="80,81"; discard, bar=baz'])
    [[('foo', 'bar'), ('port', '80,81'), ('discard', None)], [('bar', 'baz')]]
    >>> split_header_words(['text/html; charset="iso-8859-1"'])
    [[('text/html', None), ('charset', 'iso-8859-1')]]
    >>> split_header_words([r'Basic realm="\"foo\bar\""'])
    [[('Basic', None), ('realm', '"foobar"')]]

    rz\1N�,z^[=\s;]*rWr	z&split_header_words bug: '%s', '%s', %s)�
isinstance�str�AssertionError�HEADER_TOKEN_REr@rkrB�HEADER_QUOTED_VALUE_RE�HEADER_ESCAPE_REr^�HEADER_VALUE_RE�rstrip�appendr\�
startswith�re�subn)
Z
header_values�resultr`Z	orig_text�pairsrE�name�valueZnon_junkZ
nr_junk_charsrrr�split_header_wordsUsJ-








��r}�([\"\\])cCs|g}|D]h}g}|D]F\}}|dk	rPt�d|�sDt�d|�}d|}d||f}|�|�q|r|�d�|��qd�|�S)a�Do the inverse (almost) of the conversion done by split_header_words.

    Takes a list of lists of (key, value) pairs and produces a single header
    value.  Attribute values are quoted if needed.

    >>> join_header_words([[("text/plain", None), ("charset", "iso-8859-1")]])
    'text/plain; charset="iso-8859-1"'
    >>> join_header_words([[("text/plain", None)], [("charset", "iso-8859-1")]])
    'text/plain, charset="iso-8859-1"'

    Nz^\w+$�\\\1z"%s"�%s=%s�; �, )rwr@�HEADER_JOIN_ESCAPE_REr^ru�join)Zlists�headersrz�attr�k�vrrr�join_header_words�sr�cCs0|�d�r|dd�}|�d�r,|dd�}|S)N�"r���)rv�endswith�r`rrr�strip_quotes�s


r�cCs�d}g}|D]�}g}d}t|�d��D]�\}}|��}|�d�\}}	}
|��}|sb|dkr&q�nq&|	rn|
��nd}
|dkr�|��}||kr�|}|dkr�|
dk	r�t|
�}
d}n|d	kr�|
dk	r�tt|
��}
|�||
f�q&|r|s�|�d
�|�|�q|S)a5Ad-hoc parser for Netscape protocol cookie-attributes.

    The old Netscape cookie format for Set-Cookie can for instance contain
    an unquoted "," in the expires field, so we have to use this ad-hoc
    parser instead of split_header_words.

    XXX This may not make the best possible effort to parse all the crap
    that Netscape Cookie headers contain.  Ronald Tschalar's HTTPClient
    parser is probably better, so could do worse than following that if
    this ever gives any trouble.

    Currently, this is also used for parsing RFC 2109 cookies.

    )�expires�domain�path�secure�version�port�max-ageF�;�=r	Nr�Tr�)r��0)�	enumerate�split�strip�	partitionrKr�rbru)Z
ns_headersZknown_attrsryZ	ns_headerrz�version_setZiiZparam�key�sep�val�lcrrr�parse_ns_headers�s>
r�z\.\d+$cCs:t�|�rdS|dkrdS|ddks2|ddkr6dSdS)z*Return True if text is a host domain name.FrWr	�.r�T��IPV4_REr@r�rrr�is_HDNs
r�cCsl|��}|��}||krdSt|�s(dS|�|�}|dksB|dkrFdS|�d�sTdSt|dd��shdSdS)a�Return True if domain A domain-matches domain B, according to RFC 2965.

    A and B may be host domain names or IP addresses.

    RFC 2965, section 1:

    Host names can be specified either as an IP address or a HDN string.
    Sometimes we compare one host name with another.  (Such comparisons SHALL
    be case-insensitive.)  Host A's name domain-matches host B's if

         *  their host name strings string-compare equal; or

         * A is a HDN string and has the form NB, where N is a non-empty
            name string, B has the form .B', and B' is a HDN string.  (So,
            x.y.com domain-matches .Y.com but not Y.com.)

    Note that domain-match is not a commutative operation: a.b.c.com
    domain-matches .c.com, but not the reverse.

    TFr�r	r�rN)rKr��rfindrv)�A�B�irrr�domain_matchs

r�cCst�|�rdSdS)zdReturn True if text is a sort-of-like a host domain name.

    For accepting/blocking domains.

    FTr�r�rrr�liberal_is_HDNFs
r�cCs`|��}|��}t|�r t|�s0||kr,dSdS|�d�}|rL|�|�rLdS|s\||kr\dSdS)z\For blocking/accepting domains.

    A and B may be host domain names or IP addresses.

    TFr�)rKr�rvr�)r�r��initial_dotrrr�user_domain_matchPs
r�z:\d+$cCsB|��}tj�|�d}|dkr,|�dd�}t�d|d�}|��S)z�Return request-host, as defined by RFC 2965.

    Variation from RFC: returned value is lowercased, for convenient
    comparison.

    rrWZHost)�get_full_url�urllib�parseZurlparseZ
get_header�cut_port_rer^rK)�request�url�hostrrr�request_hostesr�cCs4t|�}}|�d�dkr,t�|�s,|d}||fS)zzReturn a tuple (request-host, effective request-host name).

    As defined by RFC 2965, except both are lowercased.

    r�r��.local)r��findr�r@)r��erhn�req_hostrrr�eff_request_hostusr�cCs4|��}tj�|�}t|j�}|�d�s0d|}|S)z6Path component of request-URI, as defined by RFC 2965.�/)r�r�r�Zurlsplit�escape_pathr�rv)r�r��partsr�rrr�request_path�s

r�cCs`|j}|�d�}|dkrX||dd�}zt|�Wq\tk
rTtd|�YdSXnt}|S)N�:r	rznonnumeric port: '%s')r�r�rArLr�DEFAULT_HTTP_PORT)r�r�r�r�rrr�request_port�s


r�z%/;:@&=+$,!~*'()z%([0-9a-fA-F][0-9a-fA-F])cCsd|�d���S)Nz%%%sr)rBrP)rhrrr�uppercase_escaped_char�sr�cCstj�|t�}t�t|�}|S)zEEscape any invalid characters in HTTP URL, and uppercase all escapes.)r�r�Zquote�HTTP_PATH_SAFE�ESCAPED_CHAR_REr^r�)r�rrrr��s
r�cCsP|�d�}|dkrL||dd�}|�d�}t|�rL|dksD|dkrLd|S|S)aBReturn reach of host h, as defined by RFC 2965, section 1.

    The reach R of a host name H is defined as follows:

       *  If

          -  H is the host domain name of a host; and,

          -  H has the form A.B; and

          -  A has no embedded (that is, interior) dots; and

          -  B has at least one embedded dot, or B is the string "local".
             then the reach of H is .B.

       *  Otherwise, the reach of H is H.

    >>> reach("www.acme.com")
    '.acme.com'
    >>> reach("acme.com")
    'acme.com'
    >>> reach("acme.local")
    '.local'

    r�r	rNZlocal)r�r�)�hr��brrr�reach�s

r�cCs$t|�}t|t|j��sdSdSdS)z�

    RFC 2965, section 3.3.6:

        An unverifiable transaction is to a third-party host if its request-
        host U does not domain-match the reach R of the request-host O in the
        origin transaction.

    TFN)r�r�r�Zorigin_req_host)r�r�rrr�is_third_party�s
r�c@sNeZdZdZddd�Zdd�Zddd	�Zd
d�Zddd
�Zdd�Z	dd�Z
dS)ra�HTTP Cookie.

    This class represents both Netscape and RFC 2965 cookies.

    This is deliberately a very simple class.  It just holds attributes.  It's
    possible to construct Cookie instances that don't comply with the cookie
    standards.  CookieJar.make_cookies is the factory function for Cookie
    objects -- it deals with cookie parsing, supplying defaults, and
    normalising to the representation used in this class.  CookiePolicy is
    responsible for checking them to see whether they should be accepted from
    and returned to the server.

    Note that the port may be present in the headers, but unspecified ("Port"
    rather than"Port=80", for example); if this is the case, port is None.

    FcCs�|dk	rt|�}|dk	r$tt|��}|dkr<|dkr<td��||_||_||_||_||_|��|_	||_
||_|	|_|
|_
||_||_|
|_||_||_||_t�|�|_dS)NTz-if port is None, port_specified must be false)rAr[rLr�r{r|r��port_specifiedrKr��domain_specified�domain_initial_dotr��path_specifiedr�r��discard�comment�comment_url�rfc2109�copy�_rest)�selfr�r{r|r�r�r�r�r�r�r�r�r�r�r�r��restr�rrr�__init__�s.

zCookie.__init__cCs
||jkS�N�r�)r�r{rrr�has_nonstandard_attrszCookie.has_nonstandard_attrNcCs|j�||�Sr�)r��get)r�r{�defaultrrr�get_nonstandard_attrszCookie.get_nonstandard_attrcCs||j|<dSr�r�)r�r{r|rrr�set_nonstandard_attr szCookie.set_nonstandard_attrcCs,|dkrt��}|jdk	r(|j|kr(dSdS�NTF)rMr�)r��nowrrr�
is_expired#s
zCookie.is_expiredcCsX|jdkrd}n
d|j}|j||j}|jdk	rFd|j|jf}n|j}d||fS)NrWr�r�z<Cookie %s for %s>)r�r�r�r|r{)r��p�limitZ	namevaluerrr�__str__)s


zCookie.__str__cCslg}dD]$}t||�}|�d|t|�f�q|�dt|j��|�dt|j��d|jjd�|�fS)N)r�r{r|r�r�r�r�r�r�r�r�r�r�r�r�r�zrest=%sz
rfc2109=%sz%s(%s)r�)�getattrru�reprr�r��	__class__�__name__r�)r�rr{r�rrr�__repr__3s
zCookie.__repr__)F)N)N)r��
__module__�__qualname__�__doc__r�r�r�r�r�r�r�rrrrr�s�
*


c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)ra Defines which cookies get accepted from and returned to server.

    May also modify cookies, though this is probably a bad idea.

    The subclass DefaultCookiePolicy defines the standard rules for Netscape
    and RFC 2965 cookies -- override that if you want a customized policy.

    cCs
t��dS)z�Return true if (and only if) cookie should be accepted from server.

        Currently, pre-expired cookies never get this far -- the CookieJar
        class deletes such cookies itself.

        N��NotImplementedError�r��cookier�rrr�set_okKszCookiePolicy.set_okcCs
t��dS)zAReturn true if (and only if) cookie should be returned to server.Nr�r�rrr�	return_okTszCookiePolicy.return_okcCsdS)zMReturn false if cookies should not be returned, given cookie domain.
        Tr)r�r�r�rrr�domain_return_okXszCookiePolicy.domain_return_okcCsdS)zKReturn false if cookies should not be returned, given cookie path.
        Tr)r�r�r�rrr�path_return_ok]szCookiePolicy.path_return_okN)r�r�r�r�r�r�r�r�rrrrrBs
	c
@s�eZdZdZdZdZdZdZeeBZdddddddddeddd	f
d
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�ZdS)8rzBImplements the standard rules for accepting and returning cookies.rrrUr	NTF)ZhttpsZwsscCsv||_||_||_||_||_||_|	|_|
|_||_||_	|
|_
|dk	rVt|�|_nd|_|dk	rlt|�}||_
dS)zAConstructor arguments should be passed as keyword arguments only.Nr)�netscape�rfc2965�rfc2109_as_netscape�hide_cookie2�
strict_domain�strict_rfc2965_unverifiable�strict_ns_unverifiable�strict_ns_domain�strict_ns_set_initial_dollar�strict_ns_set_path�secure_protocols�tuple�_blocked_domains�_allowed_domains)r��blocked_domains�allowed_domainsr�r�r�r�r�r�r�r�r�r�r�rrrr�ms"zDefaultCookiePolicy.__init__cCs|jS)z4Return the sequence of blocked domains (as a tuple).)r�r�rrrr�sz#DefaultCookiePolicy.blocked_domainscCst|�|_dS)z$Set the sequence of blocked domains.N)r�r)r�rrrr�set_blocked_domains�sz'DefaultCookiePolicy.set_blocked_domainscCs |jD]}t||�rdSqdSr�)rr�)r�r�Zblocked_domainrrr�
is_blocked�s

zDefaultCookiePolicy.is_blockedcCs|jS)z=Return None, or the sequence of allowed domains (as a tuple).)rrrrrr�sz#DefaultCookiePolicy.allowed_domainscCs|dk	rt|�}||_dS)z-Set the sequence of allowed domains, or None.N)r�r)r�rrrr�set_allowed_domains�sz'DefaultCookiePolicy.set_allowed_domainscCs.|jdkrdS|jD]}t||�rdSqdS)NFT)rr�)r�r�Zallowed_domainrrr�is_not_allowed�s


z"DefaultCookiePolicy.is_not_allowedcCsNtd|j|j�|jdk	st�dD]&}d|}t||�}|||�s"dSq"dS)z�
        If you override .set_ok(), be sure to call this method.  If it returns
        false, so should your subclass (assuming your subclass wants to be more
        strict about which cookies to accept).

        � - checking cookie %s=%sN)r��
verifiabilityr{r�r�r�Zset_ok_FT)rr{r|ror��r�r�r��nZfn_name�fnrrrr��s

zDefaultCookiePolicy.set_okcCsZ|jdkrtd|j|j�dS|jdkr:|js:td�dS|jdkrV|jsVtd�dSdS)Nz0   Set-Cookie2 without version attribute (%s=%s)Fr	�$   RFC 2965 cookies are switched off�$   Netscape cookies are switched offT)r�rr{r|r�r�r�rrr�set_ok_version�s
�z"DefaultCookiePolicy.set_ok_versioncCsJ|jrFt|�rF|jdkr*|jr*td�dS|jdkrF|jrFtd�dSdS�Nr	z>   third-party RFC 2965 cookie during unverifiable transactionFz>   third-party Netscape cookie during unverifiable transactionT�Zunverifiabler�r�r�rr�r�rrr�set_ok_verifiability�sz(DefaultCookiePolicy.set_ok_verifiabilitycCs0|jdkr,|jr,|j�d�r,td|j�dSdS)Nr	�$z'   illegal name (starts with '$'): '%s'FT)r�r�r{rvrr�rrr�set_ok_name�s
�zDefaultCookiePolicy.set_ok_namecCsL|jrHt|�}|jdks(|jdkrH|jrH|�|j|�sHtd|j|�dSdS)Nr	z7   path attribute %s is not a prefix of request path %sFT)r�r�r�r�r�r�r)r�r�r��req_pathrrr�set_ok_path�s
����zDefaultCookiePolicy.set_ok_pathc
Cs�|�|j�rtd|j�dS|�|j�r8td|j�dS|j�r�t|�\}}|j}|jr�|�d�dkr�|�d�}|�dd|�}|dkr�||dd�}||d|�}	|	�	�dkr�t
|�dkr�td	|�dS|�d�r�|dd�}
n|}
|
�d�dk}|�s|d
k�rtd|�dS|j
dk�rX|�|��sX|�d��sXd|�|��sXtd||�dS|j
dk�sr|j|j@�r�t||��s�td
||�dS|j
dk�s�|j|j@�r�|dt
|��}|�d�dk�r�t�|��s�td||�dSdS)N�"   domain %s is in user block-listF�&   domain %s is not in user allow-listr�rr	r)�coZacZcomZeduZorgZnetZgovZmilrAZaeroZbiz�catZcoop�infoZjobsZmobiZmuseumr{ZproZtravelZeuz&   country-code second level domain %sr�z/   non-local domain %s contains no embedded dotzO   effective request-host %s (even with added initial dot) does not end with %sz5   effective request-host %s does not domain-match %sz.   host prefix %s for domain %s contains a dotT)rr�rrr�r�r��countr�rK�lenrvr�r�r�r��DomainRFC2965Matchr��DomainStrictNoDotsr�r@)
r�r�r�r�r�r�r��jZtldZsldZundotted_domainZ
embedded_dotsZhost_prefixrrr�
set_ok_domain�s|

�

����
��
���z!DefaultCookiePolicy.set_ok_domainc	Cs�|jr�t|�}|dkrd}nt|�}|j�d�D]@}zt|�Wn"tk
rbtd|�YdSX||kr0q�q0td||j�dSdS)N�80rlz   bad port %s (not numeric)Fz$   request port (%s) not found in %sT)r�r�rnr�r�rArLr�r�r�r�Zreq_portr�rrr�set_ok_port+s&

�zDefaultCookiePolicy.set_ok_portcCs@td|j|j�dD]&}d|}t||�}|||�sdSqdS)z�
        If you override .return_ok(), be sure to call this method.  If it
        returns false, so should your subclass (assuming your subclass wants to
        be more strict about which cookies to return).

        r	)r�r
r�r�r�r�Z
return_ok_FT)rr{r|r�rrrrr�@s	

zDefaultCookiePolicy.return_okcCs<|jdkr|jstd�dS|jdkr8|js8td�dSdS)Nr	rFrT)r�r�rr�r�rrr�return_ok_versionRsz%DefaultCookiePolicy.return_ok_versioncCsJ|jrFt|�rF|jdkr*|jr*td�dS|jdkrF|jrFtd�dSdSrrr�rrr�return_ok_verifiability[sz+DefaultCookiePolicy.return_ok_verifiabilitycCs"|jr|j|jkrtd�dSdS)Nz(   secure cookie with non-secure requestFT)r��typer�rr�rrr�return_ok_securegsz$DefaultCookiePolicy.return_ok_securecCs|�|j�rtd�dSdS)Nz   cookie expiredFT)r��_nowrr�rrr�return_ok_expiresmsz%DefaultCookiePolicy.return_ok_expirescCsN|jrJt|�}|dkrd}|j�d�D]}||kr&qJq&td||j�dSdS)Nr#rlz0   request port %s does not match cookie port %sFT)r�r�r�rr$rrr�return_ok_portss�z"DefaultCookiePolicy.return_ok_portcCs�t|�\}}|j}|r*|�d�s*d|}n|}|jdkr^|j|j@r^|js^||kr^td�dS|jdkr�t||�s�td||�dS|jdkr�d|�	|�s�td||�dSdS)Nr�r	zQ   cookie with unspecified domain does not string-compare equal to request domainFzQ   effective request-host name %s does not domain-match RFC 2965 cookie domain %sz;   request-host %s does not match Netscape cookie domain %sT)
r�r�rvr�r��DomainStrictNonDomainr�rr�r�)r�r�r�r�r�r��	dotdomainrrr�return_ok_domain�s6


�����z$DefaultCookiePolicy.return_ok_domaincCs�t|�\}}|�d�sd|}|�d�s0d|}|rH|�d�sHd|}n|}|�|�sd|�|�sddS|�|�r|td|�dS|�|�r�td|�dSdS)Nr�FrrT)r�rvr�rrr)r�r�r�r�r�r.rrrr��s"






z$DefaultCookiePolicy.domain_return_okcCsbtd|�t|�}t|�}||kr&dS|�|�rR|�d�sN|||d�dkrRdStd||�dS)Nz- checking cookie path=%sTr�rz  %s does not path-match %sF)rr�rrvr�)r�r�r�rZpathlenrrrr��s

��z"DefaultCookiePolicy.path_return_ok) r�r�r�r�r r-rZ
DomainLiberalZDomainStrictr�rrrrrrr�rrrrr"r%r�r&r'r)r+r,r/r�r�rrrrrcsT�
#	;	cCst|���}t|j|�Sr�)�sorted�keys�mapr�)Zadictr1rrr�vals_sorted_by_key�sr3c	csVt|�}|D]D}d}z
|jWntk
r2YnXd}t|�EdH|s|VqdS)zBIterates over nested mapping, depth-first, in sorted order by key.FTN)r3�items�AttributeError�
deepvalues)�mapping�values�objrrrr6�s
r6c@seZdZdS)�AbsentN�r�r�r�rrrrr:�sr:c@s�eZdZdZe�d�Ze�d�Ze�d�Ze�d�Z	e�d�Z
e�dej�Zd3d	d
�Z
dd�Zd
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd4d%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Z d1d2�Z!dS)5rz�Collection of HTTP cookies.

    You may not need to know about this class: try
    urllib.request.build_opener(HTTPCookieProcessor).open(url).
    z\Wr~z\.?[^.]*z[^.]*z^\.+z^\#LWP-Cookies-(\d+\.\d+)NcCs(|dkrt�}||_t��|_i|_dSr�)r�_policy�
_threading�RLock�
_cookies_lock�_cookies�r��policyrrrr��s

zCookieJar.__init__cCs
||_dSr�)r<rArrr�
set_policy�szCookieJar.set_policycCs�g}|j�||�sgStd|�|j|}|��D]T}|j�||�sFq2||}|��D].}|j�||�srtd�qVtd�|�|�qVq2|S)Nz!Checking %s for cookies to returnz   not returning cookiez   it's a match)	r<r�rr@r1r�r8r�ru)r�r�r��cookiesZcookies_by_pathr�Zcookies_by_namer�rrr�_cookies_for_domain�s 

zCookieJar._cookies_for_domaincCs*g}|j��D]}|�|�||��q|S)z2Return a list of cookies to be returned to server.)r@r1�extendrE)r�r�rDr�rrr�_cookies_for_requestszCookieJar._cookies_for_requestc	Cs<|jdd�dd�d}g}|D�]}|j}|sHd}|dkrH|�d|�|jdk	rz|j�|j�rz|dkrz|j�d	|j�}n|j}|jdkr�|�|j�n|�d
|j|f�|dkr|j	r�|�d|j
�|j�d��r|j}|j
s�|�d�r�|d
d�}|�d|�|jdk	rd}|j�r,|d|j}|�|�q|S)z�Return a list of cookie-attributes to be returned to server.

        like ['foo="bar"; $Path="/"', ...]

        The $Version attribute is also added when appropriate (currently only
        once per request).

        cSs
t|j�Sr�)rr�)�arrr�<lambda>�z)CookieJar._cookie_attrs.<locals>.<lambda>T)r��reverseFr	z$Version=%sNrr�z
$Path="%s"r�rz$Domain="%s"z$Portz="%s")�sortr�rur|�non_word_rer@�quote_rer^r{r�r�r�rvr�r�r�)	r�rDr��attrsr�r�r|r�r�rrr�
_cookie_attrssF


��
�
zCookieJar._cookie_attrscCs�td�|j��z�tt���|j_|_|�|�}|�	|�}|r^|�
d�s^|�dd�|��|jj
r�|jjs�|�
d�s�|D]}|jdkr||�dd�q�q|W5|j��X|��dS)z�Add correct Cookie: header to request (urllib.request.Request object).

        The Cookie2 header is also added unless policy.hide_cookie2 is true.

        �add_cookie_headerrr�ZCookie2rz$Version="1"N)rr?�acquire�releaserArMr<r*rGrPZ
has_headerZadd_unredirected_headerr�r�r�r��clear_expired_cookies)r�r�rDrOr�rrrrQIs*



��

zCookieJar.add_cookie_headerc
Cs�g}d}d}|D�]z}|d\}}d}d}	i}
i}|dd�D�]0\}}
|��}||ks`||krd|}||krx|
dkrxd}
||
kr�q>|dkr�|
dkr�td	�d}	�qr|
��}
|d
kr�|r�q>|
dkr�td�q>|dk�r d}zt|
�}
Wn*tk
�rtd
�d}	Y�qrYnXd
}|j|
}
||k�s4||k�rh|
dk�r^|dk�r^td|�d}	�qr|
|
|<q>|
||<q>|	�rzq|�|||
|f�q|S)aReturn list of tuples containing normalised cookie information.

        attrs_set is the list of lists of key,value pairs extracted from
        the Set-Cookie or Set-Cookie2 headers.

        Tuples are name, value, standard, rest, where name and value are the
        cookie name and value, standard is a dictionary containing the standard
        cookie-attributes (discard, secure, version, expires or max-age,
        domain, path and port) and rest is a dictionary containing the rest of
        the cookie-attributes.

        )r�r�)r�r�r�r�r�r�r��
commenturlr	FrNTr�z%   missing value for domain attributer�zM   missing or invalid value for expires attribute: treating as session cookier�z?   missing or invalid (non-numeric) value for max-age attribute)r�r�rUz!   missing value for %s attribute)rKrrArLr*ru)r��	attrs_set�
cookie_tuples�
boolean_attrs�value_attrsZcookie_attrsr{r|Zmax_age_setZ
bad_cookie�standardr�r�r�r�rrr�_normalized_cookie_tuplesjsh





�

z#CookieJar._normalized_cookie_tuplescCs&|\}}}}|�dt�}|�dt�}|�dt�}	|�dt�}
|�dd�}|dk	rtzt|�}Wntk
rrYdSX|�dd�}|�dd�}
|�d	d�}|�d
d�}|tk	r�|dkr�d}t|�}nXd}t|�}|�d
�}|dk�r|dkr�|d|�}n|d|d�}t|�dk�rd
}|tk	}d}|�r:t|�	d��}|tk�rVt
|�\}}|}n|�	d��sjd|}d}|	tk	�r�|	dk�r�t|�}	nd}t�
dd|	�}	nd}	|
tk�r�d}
d}
nH|
|jk�rz|�|||�Wntk
�r�YnXtd|||�dSt||||	||||||||
|
|||�S)Nr�r�r�r�r�r�Fr�r�rUrWTr�r�r	rr�z\s+z2Expiring cookie, domain='%s', path='%s', name='%s')r�r:rArLr�r�r�r�boolrvr�r�rwr^r*�clear�KeyErrorrr)r��tupr�r{r|rZr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr�_cookie_from_cookie_tuple�s�







��z#CookieJar._cookie_from_cookie_tuplecCs6|�|�}g}|D]}|�||�}|r|�|�q|Sr�)r[r`ru)r�rVr�rWrDr_r�rrr�_cookies_from_attrs_set's
z!CookieJar._cookies_from_attrs_setcCsHt|jdd�}|dkr |jj}|D]}|jdkr$d|_|r$d|_q$dS)Nr�rTr	)r�r<r�r�r�)r�rDZ
rfc2109_as_nsr�rrr�_process_rfc2109_cookies0s

z"CookieJar._process_rfc2109_cookiesc
Cs:|��}|�dg�}|�dg�}tt���|j_|_|jj}|jj}|sN|rf|sV|rf|s^|rf|sj|sjgSz|�t	|�|�}Wnt
k
r�t�g}YnX|�r6|�r6z|�t|�|�}	Wnt
k
r�t�g}	YnX|�
|	�|�r&i}
|D]}d|
|j|j|jf<q�|
fdd�}t||	�}	|	�r6|�|	�|S)zAReturn sequence of Cookie objects extracted from response object.zSet-Cookie2z
Set-CookieNcSs|j|j|jf}||kSr�)r�r�r{)Z	ns_cookie�lookupr�rrr�no_matching_rfc2965isz3CookieJar.make_cookies.<locals>.no_matching_rfc2965)rZget_allrArMr<r*r�r�rar}�	Exceptionrr�rbr�r�r{�filterrF)
r��responser�r�Zrfc2965_hdrsZns_hdrsr�r�rDZ
ns_cookiesrcr�rdrrr�make_cookies<s^�������
�



zCookieJar.make_cookiescCsN|j��z2tt���|j_|_|j�||�r:|�|�W5|j��XdS)z-Set a cookie if policy says it's OK to do so.N)	r?rRrSrArMr<r*r��
set_cookier�rrr�set_cookie_if_okss
zCookieJar.set_cookie_if_okcCsl|j}|j��zJ|j|kr&i||j<||j}|j|krDi||j<||j}|||j<W5|j��XdS)z?Set a cookie, without checking whether or not it should be set.N)r@r?rRrSr�r�r{)r�r��cZc2Zc3rrrri�s






zCookieJar.set_cookiecCsbtd|���|j��z8|�||�D]&}|j�||�r&td|�|�|�q&W5|j��XdS)zAExtract cookies from response, where allowable given the request.zextract_cookies: %sz setting cookie: %sN)	rrr?rRrSrhr<r�ri)r�rgr�r�rrr�extract_cookies�s

zCookieJar.extract_cookiescCst|dk	r2|dks|dkr td��|j|||=n>|dk	rX|dkrJtd��|j||=n|dk	rj|j|=ni|_dS)a�Clear some cookies.

        Invoking this method without arguments will clear all cookies.  If
        given a single argument, only cookies belonging to that domain will be
        removed.  If given two arguments, cookies belonging to the specified
        path within that domain are removed.  If given three arguments, then
        the cookie with the specified name, path and domain is removed.

        Raises KeyError if no matching cookie exists.

        Nz8domain and path must be given to remove a cookie by namez.domain must be given to remove cookies by path)rLr@)r�r�r�r{rrrr]�s��
zCookieJar.clearcCsD|j��z(|D]}|jr|�|j|j|j�qW5|j��XdS)z�Discard all session cookies.

        Note that the .save() method won't save session cookies anyway, unless
        you ask otherwise by passing a true ignore_discard argument.

        N)r?rRrSr�r]r�r�r{)r�r�rrr�clear_session_cookies�s
zCookieJar.clear_session_cookiescCsP|j��z4t��}|D]"}|�|�r|�|j|j|j�qW5|j��XdS)a�Discard all expired cookies.

        You probably don't need to call this method: expired cookies are never
        sent back to the server (provided you're using DefaultCookiePolicy),
        this method is called by CookieJar itself every so often, and the
        .save() method won't save expired cookies anyway (unless you ask
        otherwise by passing a true ignore_expires argument).

        N)	r?rRrSrMr�r]r�r�r{)r�r�r�rrrrT�s


zCookieJar.clear_expired_cookiescCs
t|j�Sr�)r6r@rrrr�__iter__�szCookieJar.__iter__cCsd}|D]}|d}q|S)z#Return number of contained cookies.r	rr)r�r�r�rrr�__len__�s
zCookieJar.__len__cCs2g}|D]}|�t|��qd|jjd�|�fS�Nz<%s[%s]>r�)rur�r�r�r��r��rr�rrrr��szCookieJar.__repr__cCs2g}|D]}|�t|��qd|jjd�|�fSrp)rurnr�r�r�rqrrrr��szCookieJar.__str__)N)NNN)"r�r�r�r�rw�compilerMrNZstrict_domain_reZ	domain_reZdots_re�ASCII�magic_rer�rCrErGrPrQr[r`rarbrhrjrirlr]rmrTrnror�r�rrrrr�s8





;!a\	7


c@seZdZdS)rNr;rrrrr�sc@s8eZdZdZddd�Zd
dd�Zddd	�Zdd
d�ZdS)rz6CookieJar that can be loaded from and saved to a file.NFcCs2t�||�|dk	rt�|�}||_t|�|_dS)z}
        Cookies are NOT loaded from the named file until either the .load() or
        .revert() method is called.

        N)rr��os�fspath�filenamer\�	delayload)r�rxryrBrrrr��s

zFileCookieJar.__init__cCs
t��dS)zSave cookies to a file.Nr�)r�rx�ignore_discard�ignore_expiresrrr�save�szFileCookieJar.savec	CsJ|dkr"|jdk	r|j}ntt��t|��}|�||||�W5QRXdS)zLoad cookies from a file.N)rxrL�MISSING_FILENAME_TEXT�open�_really_load�r�rxrzr{rrrr�loads

zFileCookieJar.loadcCs�|dkr"|jdk	r|j}ntt��|j��zFt�|j�}i|_z|�	|||�Wnt
k
rn||_�YnXW5|j��XdS)z�Clear all cookies and reload cookies from a saved file.

        Raises LoadError (or OSError) if reversion is not successful; the
        object's state will not be altered if this happens.

        N)rxrLr}r?rRrSr�Zdeepcopyr@r��OSError)r�rxrzr{Z	old_staterrr�revert	s

zFileCookieJar.revert)NFN)NFF)NFF)NFF)r�r�r�r�r�r|r�r�rrrrr�s


	�cCs |j|jfd|jfd|jfg}|jdk	r8|�d|jf�|jrH|�d�|jrX|�d�|jrh|�d�|j	rx|�d�|j
r�|�d	tt|j
��f�|j
r�|�d
�|jr�|�d|jf�|jr�|�d|jf�t|j���}|D]}|�|t|j|�f�q�|�d
t|j�f�t|g�S)z�Return string representation of Cookie in the LWP cookie file format.

    Actually, the format is extended a bit -- see module docstring.

    r�r�Nr�)�	path_specN)�	port_specN)�
domain_dotN)r�Nr�)r�Nr�rUr�)r{r|r�r�r�rur�r�r�r�r�r5r[r�r�r�r0r�r1rnr�r�)r�r�r1r�rrr�lwp_cookie_str$s:
�




�
r�c@s,eZdZdZddd�Zddd�Zd	d
�ZdS)
ra[
    The LWPCookieJar saves a sequence of "Set-Cookie3" lines.
    "Set-Cookie3" is the format used by the libwww-perl library, not known
    to be compatible with any browser, but which is easy to read and
    doesn't lose information about RFC 2965 cookies.

    Additional methods

    as_lwp_str(ignore_discard=True, ignore_expired=True)

    TcCsTt��}g}|D]2}|s |jr q|s0|�|�r0q|�dt|��qd�|dg�S)z�Return cookies as a string of "\n"-separated "Set-Cookie3" headers.

        ignore_discard and ignore_expires: see docstring for FileCookieJar.save

        zSet-Cookie3: %s�
rW)rMr�r�rur�r�)r�rzr{r�rrr�rrr�
as_lwp_strMs
zLWPCookieJar.as_lwp_strNFc	CsX|dkr"|jdk	r|j}ntt��t|d��"}|�d�|�|�||��W5QRXdS)N�wz#LWP-Cookies-2.0
)rxrLr}r~�writer�r�rrrr|]s

zLWPCookieJar.savecCs0|��}|j�|�s$d|}t|��t��}d}d}	d}
�z�|��}|dkrP�q�|�|�s\q<|t|�d���}t|g�D�]f}|d\}
}i}i}|	D]}d||<q�|dd�D]n\}}|dk	r�|�	�}nd}||
ks�||	kr�|}||	k�r|dkr�d	}|||<q�||
k�r|||<q�|||<q�|j
}|d
�}|d�}|dk	�rJt|�}|dk�rXd	}|d�}|�d
�}t|d�|
||d�|d�|||d�|d�|d�|d�|||d�|d�|�}|�s�|j
�r�qz|�s�|�|��r�qz|�|�qzq<WnBtk
�r�Yn,tk
�r*t�td||f��YnXdS)Nz5%r does not look like a Set-Cookie3 (LWP) format filezSet-Cookie3:)r�r�r�r�r�)r�r�r�r�r�r�rUrWr	FrTr�r�r�r�r�r�r�r�r�r�r�r�rUz&invalid Set-Cookie3 format file %r: %r)�readlinerur@rrMrvrr�r}rKr�rerr�r�rir�rer)r�rrxrzr{�magicrr��headerrXrY�line�datar{r|rZr�r�r�r�r�r�r�r�r�rkrrrris��










�
�zLWPCookieJar._really_load)TT)NFF)r�r�r�r�r�r|rrrrrr@s

c@s0eZdZdZe�d�ZdZdd�Zd
dd	�Z	dS)ra�

    WARNING: you may want to backup your browser's cookies file if you use
    this class to save cookies.  I *think* it works, but there have been
    bugs in the past!

    This class differs from CookieJar only in the format it uses to save and
    load cookies to and from a file.  This class uses the Mozilla/Netscape
    `cookies.txt' format.  lynx uses this file format, too.

    Don't expect cookies saved while the browser is running to be noticed by
    the browser (in fact, Mozilla on unix will overwrite your saved cookies if
    you change them on disk while it's running; on Windows, you probably can't
    save at all while the browser is running).

    Note that the Mozilla/Netscape format will downgrade RFC2965 cookies to
    Netscape cookies on saving.

    In particular, the cookie version and port number information is lost,
    together with information about whether or not Path, Port and Discard were
    specified by the Set-Cookie2 (or Set-Cookie) header, and whether or not the
    domain as set in the HTTP header started with a dot (yes, I'm aware some
    domains in Netscape files start with a dot and some don't -- trust me, you
    really don't want to know any more about this).

    Note that though Mozilla and Netscape use the same format, they use
    slightly different headers.  The class saves cookies using the Netscape
    header by default (Mozilla can cope with that).

    z#( Netscape)? HTTP Cookie Filezr# Netscape HTTP Cookie File
# http://curl.haxx.se/rfc/cookie_spec.html
# This is a generated file!  Do not edit.

cCstt��}|��}|j�|�s(td|���z|��}|dkr@�q*|�d�rV|dd�}|���d�s,|��dkrrq,|�d�\}}	}
}}}
}|dk}|	dk}	|
dkr�|}
d}|�d�}|	|ks�t	�d	}|dkr�d}d
}t
d|
|dd	||	||
d	|||ddi�}|�s
|j�r
q,|�s|�|��rq,|�
|�q,WnBtk
�rD�Yn,tk
�rnt�td||f��YnXdS)
Nz4%r does not look like a Netscape format cookies filerWr�r�)�#r�	�TRUEr�FTr	z+invalid Netscape format cookies file %r: %r)rMr�rur@rr�r�rvr�rorr�r�rir�rer)r�rrxrzr{r�r�r�r�r�r�r�r�r{r|r�r�rkrrrr�st��

��
�
�zMozillaCookieJar._really_loadNFc
Cs�|dkr"|jdk	r|j}ntt��t|d���}|�|j�t��}|D]�}|sV|jrVqF|sf|�|�rfqF|j	rrd}nd}|j
�d�r�d}nd}|jdk	r�t
|j�}	nd}	|jdkr�d}
|j}n|j}
|j}|�d�|j
||j||	|
|g�d�qFW5QRXdS)Nr�r�ZFALSEr�rWr�r�)rxrLr}r~r�r�rMr�r�r�r�rvr�rnr|r{r�r�)r�rxrzr{rr�r�r�r�r�r{r|rrrr| sH



���zMozillaCookieJar.save)NFF)
r�r�r�r�rwrsrur�rr|rrrrr�s

A)N)N)Xr��__all__rvr�r-rwrMZurllib.parser�Zurllib.requestZ	threadingr=Zhttp.clientZhttpZcalendarr
rrrrnZclientZ	HTTP_PORTr�r}rr%r,r6r7rIr(rurKr5r8r>rsrtr?rFrTrY�Ir]�Xr_rbrcrerkrprqrsrrr}r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrr3r6r:rr�rrr�rrrrrr�<module>s��
�

8�
�
�8
�!



U
D'


#b!b7xhttp/__pycache__/cookiejar.cpython-38.opt-2.pyc000064400000111657151153537450015315 0ustar00U

e5d#,�@sddddddddgZdd	lZdd	lZdd	lZdd	lZdd	lZdd	lZdd	lZdd	l	Z
dd	lZdd
l
mZdZd	add
�Zeejj�ZdZdd�ZdZdd�ZdddddddgZdddddd d!d"d#d$d%d&gZgZeD]Ze�e���q�dtd'd(�Z dud)d*�Z!d	d	d	d	d+�Z"e�#d,ej$�Z%d-d.�Z&d/d0�Z'e�#d1ej$�Z(e�#d2ej)ej$B�Z*e�#d3ej+ej$B�Z,d4d5�Z-e�#d6ej+ej$B�Z.d7d8�Z/d9d:�Z0e�#d;�Z1e�#d<�Z2e�#d=�Z3e�#d>�Z4d?d@�Z5e�#dA�Z6dBdC�Z7dDdE�Z8dFdG�Z9e�#dHej$�Z:dIdJ�Z;dKdL�Z<dMdN�Z=dOdP�Z>e�#dQej$�Z?dRdS�Z@dTdU�ZAdVdW�ZBdXdY�ZCdZZDe�#d[�ZEd\d]�ZFd^d_�ZGd`da�ZHdbdc�ZIGddd�d�ZJGded�d�ZKGdfd�deK�ZLdgdh�ZMdidj�ZNGdkdl�dl�ZOGdmd�d�ZPGdnd�deQ�ZRGdod�deP�ZSdpdq�ZTGdrd�deS�ZUGdsd�deS�ZVd	S)v�Cookie�	CookieJar�CookiePolicy�DefaultCookiePolicy�
FileCookieJar�LWPCookieJar�	LoadError�MozillaCookieJar�N)�timegmFcGs(tsdStsddl}|�d�atj|�S)Nr	zhttp.cookiejar)�debug�logger�loggingZ	getLogger)�argsr
�r�&/usr/lib64/python3.8/http/cookiejar.py�_debug,s
rzQa filename was not supplied (nor was the CookieJar instance initialised with one)cCsJddl}ddl}ddl}|��}|�d|�|��}|jd|dd�dS)Nr	zhttp.cookiejar bug!
%s�)�
stacklevel)�io�warnings�	traceback�StringIO�	print_exc�getvalue�warn)rrr�f�msgrrr�_warn_unhandled_exception:s
ri�cCs�|dd�\}}}}}}|tkr�d|kr4dkr�nnhd|krLdkr�nnPd|krddkr�nn8d|kr|dkr�nn d|kr�dkr�nnt|�SdSdS)	N����r	��;�=)�
EPOCH_YEARr
)�tt�year�monthZmday�hour�min�secrrr�_timegmIs&8��
��
��
r,ZMonZTueZWedZThuZFriZSatZSunZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDeccCs@|dkrtj��}ntj�|�}d|j|j|j|j|j|jfS)Nz%04d-%02d-%02d %02d:%02d:%02dZ)	�datetime�utcnow�utcfromtimestampr'r(�dayr)�minute�second��tZdtrrr�	time2isozWs�r5cCsR|dkrtj��}ntj�|�}dt|��|jt|jd|j|j	|j
|jfS)Nz#%s, %02d-%s-%04d %02d:%02d:%02d GMTr)r-r.r/�DAYSZweekdayr0�MONTHSr(r'r)r1r2r3rrr�
time2netscapejs
�r8)ZGMT�UTCZUT�Zz^([-+])?(\d\d?):?(\d\d)?$cCsjd}|tkrd}nTt�|�}|rfdt|�d��}|�d�rR|dt|�d��}|�d�dkrf|}|S)Nr	ir��<r�-)�	UTC_ZONES�TIMEZONE_RE�search�int�group)�tz�offset�mrrr�offset_from_tz_string�s

rFc
Cs�t|�}|tjkrdSzt�|���d}Wn^tk
r�zt|�}Wntk
r`YYdSXd|krvdkr�nn|}nYdSYnX|dkr�d}|dkr�d}|dkr�d}t|�}t|�}t|�}t|�}|dk�r6t�t���d}|d}	|}
|||	}|	|
}	t	|	�dk�r6|	dk�r.|d}n|d}t
|||||||f�}|dk	�r�|dk�rdd}|��}t|�}|dk�r�dS||}|S)Nrr r	i��d�2r9)
rAr-ZMAXYEAR�MONTHS_LOWER�index�lower�
ValueError�time�	localtime�absr,�upperrF)
r0�mon�yr�hrr*r+rCZimonZcur_yrrEZtmpr4rDrrr�	_str2time�sV







rTzV^[SMTWF][a-z][a-z], (\d\d) ([JFMASOND][a-z][a-z]) (\d\d\d\d) (\d\d):(\d\d):(\d\d) GMT$z+^(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)[a-z]*,?\s*a�^
    (\d\d?)            # day
       (?:\s+|[-\/])
    (\w+)              # month
        (?:\s+|[-\/])
    (\d+)              # year
    (?:
          (?:\s+|:)    # separator before clock
       (\d\d?):(\d\d)  # hour:min
       (?::(\d\d))?    # optional seconds
    )?                 # optional clock
       \s*
    (?:
       ([-+]?\d{2,4}|(?![APap][Mm]\b)[A-Za-z]+) # timezone
       \s*
    )?
    (?:
       \(\w+\)         # ASCII representation of timezone in parens.
       \s*
    )?$cCs�t�|�}|rl|��}t�|d���d}t|d�|t|d�t|d�t|d�t|d�f}t|�S|�	�}t
�d|d�}dgd\}}}}}}	}
t�|�}|dk	r�|��\}}}}}}	}
ndSt
||||||	|
�S)	Nrrr	r;����)�STRICT_DATE_REr@�groupsrIrJrKrA�floatr,�lstrip�
WEEKDAY_RE�sub�LOOSE_HTTP_DATE_RErT)�textrE�grQr&r0rRrSr*r+rCrrr�	http2time�s$



�
rba�^
    (\d{4})              # year
       [-\/]?
    (\d\d?)              # numerical month
       [-\/]?
    (\d\d?)              # day
   (?:
         (?:\s+|[-:Tt])  # separator before clock
      (\d\d?):?(\d\d)    # hour:min
      (?::?(\d\d(?:\.\d*)?))?  # optional seconds (and fractional)
   )?                    # optional clock
      \s*
   (?:
      ([-+]?\d\d?:?(:?\d\d)?
       |Z|z)             # timezone  (Z is "zero meridian", i.e. GMT)
      \s*
   )?$c
Csd|��}dgd\}}}}}}}t�|�}|dk	rL|��\}}}}}}}}	ndSt|||||||�S)NrX)r\�ISO_DATE_REr@rZrT)
r`r0rQrRrSr*r+rCrE�_rrr�iso2time+s

recCs*|�d�\}}|jd|�|j|d�S)Nr	)�span�string)�match�start�endrrr�	unmatchedLsrkz^\s*([^=\s;,]+)z&^\s*=\s*\"([^\"\\]*(?:\\.[^\"\\]*)*)\"z^\s*=\s*([^\s;,]*)z\\(.)c
Csg}|D]�}|}g}|r�t�|�}|r�t|�}|�d�}t�|�}|rft|�}|�d�}t�d|�}n.t�|�}|r�t|�}|�d�}|��}nd}|�	||f�q|�
��d�r�|�
�dd�}|r�|�	|�g}qt�
dd|�\}}	|}q|r|�	|�q|S)Nrz\1�,z^[=\s;]*rW)�HEADER_TOKEN_REr@rkrB�HEADER_QUOTED_VALUE_RE�HEADER_ESCAPE_REr^�HEADER_VALUE_RE�rstrip�appendr\�
startswith�re�subn)
Z
header_values�resultr`Z	orig_text�pairsrE�name�valueZnon_junkZ
nr_junk_charsrrr�split_header_wordsUs>.







rz�([\"\\])cCs|g}|D]h}g}|D]F\}}|dk	rPt�d|�sDt�d|�}d|}d||f}|�|�q|r|�d�|��qd�|�S)Nz^\w+$�\\\1z"%s"�%s=%s�; �, )rtr@�HEADER_JOIN_ESCAPE_REr^rr�join)Zlists�headersrw�attr�k�vrrr�join_header_words�sr�cCs0|�d�r|dd�}|�d�r,|dd�}|S)N�"r���)rs�endswith�r`rrr�strip_quotes�s


r�cCs�d}g}|D]�}g}d}t|�d��D]�\}}|��}|�d�\}}	}
|��}|sb|dkr&q�nq&|	rn|
��nd}
|dkr�|��}||kr�|}|dkr�|
dk	r�t|
�}
d}n|dkr�|
dk	r�tt|
��}
|�||
f�q&|r|s�|�d	�|�|�q|S)
N)�expires�domain�path�secure�version�port�max-ageF�;�=r	r�Tr�)r��0)�	enumerate�split�strip�	partitionrKr�rbrr)Z
ns_headersZknown_attrsrvZ	ns_headerrw�version_setZiiZparam�key�sep�val�lcrrr�parse_ns_headers�s>
r�z\.\d+$cCs:t�|�rdS|dkrdS|ddks2|ddkr6dSdS)NFrWr	�.r�T��IPV4_REr@r�rrr�is_HDNs
r�cCsl|��}|��}||krdSt|�s(dS|�|�}|dksB|dkrFdS|�d�sTdSt|dd��shdSdS)NTFr�r	r�r)rKr��rfindrs)�A�B�irrr�domain_matchs

r�cCst�|�rdSdS�NFTr�r�rrr�liberal_is_HDNFs
r�cCs`|��}|��}t|�r t|�s0||kr,dSdS|�d�}|rL|�|�rLdS|s\||kr\dSdS)NTFr�)rKr�rsr�)r�r��initial_dotrrr�user_domain_matchPs
r�z:\d+$cCsB|��}tj�|�d}|dkr,|�dd�}t�d|d�}|��S)NrrWZHost)�get_full_url�urllib�parseZurlparseZ
get_header�cut_port_rer^rK)�request�url�hostrrr�request_hostesr�cCs4t|�}}|�d�dkr,t�|�s,|d}||fS)Nr�r��.local)r��findr�r@)r��erhn�req_hostrrr�eff_request_hostusr�cCs4|��}tj�|�}t|j�}|�d�s0d|}|S)N�/)r�r�r�Zurlsplit�escape_pathr�rs)r�r��partsr�rrr�request_path�s

r�cCs`|j}|�d�}|dkrX||dd�}zt|�Wq\tk
rTtd|�YdSXnt}|S)N�:r	rznonnumeric port: '%s')r�r�rArLr�DEFAULT_HTTP_PORT)r�r�r�r�rrr�request_port�s


r�z%/;:@&=+$,!~*'()z%([0-9a-fA-F][0-9a-fA-F])cCsd|�d���S)Nz%%%sr)rBrP)rhrrr�uppercase_escaped_char�sr�cCstj�|t�}t�t|�}|S�N)r�r�Zquote�HTTP_PATH_SAFE�ESCAPED_CHAR_REr^r�)r�rrrr��s
r�cCsP|�d�}|dkrL||dd�}|�d�}t|�rL|dksD|dkrLd|S|S)Nr�r	rZlocal)r�r�)�hr��brrr�reach�s

r�cCs$t|�}t|t|j��sdSdSdS�NTF)r�r�r�Zorigin_req_host)r�r�rrr�is_third_party�s
r�c@sJeZdZddd�Zdd�Zddd�Zd	d
�Zddd�Zd
d�Zdd�Z	dS)rFcCs�|dk	rt|�}|dk	r$tt|��}|dkr<|dkr<td��||_||_||_||_||_|��|_	||_
||_|	|_|
|_
||_||_|
|_||_||_||_t�|�|_dS)NTz-if port is None, port_specified must be false)rAr[rLr�rxryr��port_specifiedrKr��domain_specified�domain_initial_dotr��path_specifiedr�r��discard�comment�comment_url�rfc2109�copy�_rest)�selfr�rxryr�r�r�r�r�r�r�r�r�r�r�r��restr�rrr�__init__�s.

zCookie.__init__cCs
||jkSr��r�)r�rxrrr�has_nonstandard_attrszCookie.has_nonstandard_attrNcCs|j�||�Sr�)r��get)r�rx�defaultrrr�get_nonstandard_attrszCookie.get_nonstandard_attrcCs||j|<dSr�r�)r�rxryrrr�set_nonstandard_attr szCookie.set_nonstandard_attrcCs,|dkrt��}|jdk	r(|j|kr(dSdSr�)rMr�)r��nowrrr�
is_expired#s
zCookie.is_expiredcCsX|jdkrd}n
d|j}|j||j}|jdk	rFd|j|jf}n|j}d||fS)NrWr�r}z<Cookie %s for %s>)r�r�r�ryrx)r��p�limitZ	namevaluerrr�__str__)s


zCookie.__str__cCslg}dD]$}t||�}|�d|t|�f�q|�dt|j��|�dt|j��d|jjd�|�fS)N)r�rxryr�r�r�r�r�r�r�r�r�r�r�r�r}zrest=%sz
rfc2109=%sz%s(%s)r)�getattrrr�reprr�r��	__class__�__name__r�)r�rrxr�rrr�__repr__3s
zCookie.__repr__)F)N)N)
r��
__module__�__qualname__r�r�r�r�r�r�r�rrrrr�s�
*


c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
rcCs
t��dSr���NotImplementedError�r��cookier�rrr�set_okKszCookiePolicy.set_okcCs
t��dSr�r�r�rrr�	return_okTszCookiePolicy.return_okcCsdS�NTr)r�r�r�rrr�domain_return_okXszCookiePolicy.domain_return_okcCsdSr�r)r�r�r�rrr�path_return_ok]szCookiePolicy.path_return_okN)r�r�r�r�r�r�r�rrrrrBs		c
@s�eZdZdZdZdZdZeeBZdddddddddedddf
d	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�ZdS)7rrrrUr	NTF)ZhttpsZwsscCsv||_||_||_||_||_||_|	|_|
|_||_||_	|
|_
|dk	rVt|�|_nd|_|dk	rlt|�}||_
dS)Nr)�netscape�rfc2965�rfc2109_as_netscape�hide_cookie2�
strict_domain�strict_rfc2965_unverifiable�strict_ns_unverifiable�strict_ns_domain�strict_ns_set_initial_dollar�strict_ns_set_path�secure_protocols�tuple�_blocked_domains�_allowed_domains)r��blocked_domains�allowed_domainsr�r�r�r�r�r�r�r�r�r�r�rrrr�ms"zDefaultCookiePolicy.__init__cCs|jSr�)r��r�rrrr�sz#DefaultCookiePolicy.blocked_domainscCst|�|_dSr�)r�r�)r�rrrr�set_blocked_domains�sz'DefaultCookiePolicy.set_blocked_domainscCs |jD]}t||�rdSqdSr�)r�r�)r�r�Zblocked_domainrrr�
is_blocked�s

zDefaultCookiePolicy.is_blockedcCs|jSr�)r�rrrrr�sz#DefaultCookiePolicy.allowed_domainscCs|dk	rt|�}||_dSr�)r�r�)r�rrrr�set_allowed_domains�sz'DefaultCookiePolicy.set_allowed_domainscCs.|jdkrdS|jD]}t||�rdSqdSr�)r�r�)r�r�Zallowed_domainrrr�is_not_allowed�s


z"DefaultCookiePolicy.is_not_allowedcCs@td|j|j�dD]&}d|}t||�}|||�sdSqdS)N� - checking cookie %s=%s)r��
verifiabilityrxr�r�r�Zset_ok_FT�rrxryr��r�r�r��nZfn_name�fnrrrr��s

zDefaultCookiePolicy.set_okcCsZ|jdkrtd|j|j�dS|jdkr:|js:td�dS|jdkrV|jsVtd�dSdS)Nz0   Set-Cookie2 without version attribute (%s=%s)Fr	�$   RFC 2965 cookies are switched off�$   Netscape cookies are switched offT)r�rrxryr�r�r�rrr�set_ok_version�s
�z"DefaultCookiePolicy.set_ok_versioncCsJ|jrFt|�rF|jdkr*|jr*td�dS|jdkrF|jrFtd�dSdS�Nr	z>   third-party RFC 2965 cookie during unverifiable transactionFz>   third-party Netscape cookie during unverifiable transactionT�Zunverifiabler�r�r�rr�r�rrr�set_ok_verifiability�sz(DefaultCookiePolicy.set_ok_verifiabilitycCs0|jdkr,|jr,|j�d�r,td|j�dSdS)Nr	�$z'   illegal name (starts with '$'): '%s'FT)r�r�rxrsrr�rrr�set_ok_name�s
�zDefaultCookiePolicy.set_ok_namecCsL|jrHt|�}|jdks(|jdkrH|jrH|�|j|�sHtd|j|�dSdS)Nr	z7   path attribute %s is not a prefix of request path %sFT)r�r�r�r�r�r�r)r�r�r��req_pathrrr�set_ok_path�s
����zDefaultCookiePolicy.set_ok_pathc
Cs�|�|j�rtd|j�dS|�|j�r8td|j�dS|j�r�t|�\}}|j}|jr�|�d�dkr�|�d�}|�dd|�}|dkr�||dd�}||d|�}	|	�	�dkr�t
|�dkr�td	|�dS|�d�r�|dd�}
n|}
|
�d�dk}|�s|d
k�rtd|�dS|j
dk�rX|�|��sX|�d��sXd|�|��sXtd||�dS|j
dk�sr|j|j@�r�t||��s�td
||�dS|j
dk�s�|j|j@�r�|dt
|��}|�d�dk�r�t�|��s�td||�dSdS)N�"   domain %s is in user block-listF�&   domain %s is not in user allow-listr�rr	r)�coZacZcomZeduZorgZnetZgovZmilrAZaeroZbiz�catZcoop�infoZjobsZmobiZmuseumrxZproZtravelZeuz&   country-code second level domain %sr�z/   non-local domain %s contains no embedded dotzO   effective request-host %s (even with added initial dot) does not end with %sz5   effective request-host %s does not domain-match %sz.   host prefix %s for domain %s contains a dotT)rr�rrr�r�r��countr�rK�lenrsr�r�r�r��DomainRFC2965Matchr��DomainStrictNoDotsr�r@)
r�r�r�r�r�r�r��jZtldZsldZundotted_domainZ
embedded_dotsZhost_prefixrrr�
set_ok_domain�s|

�

����
��
���z!DefaultCookiePolicy.set_ok_domainc	Cs�|jr�t|�}|dkrd}nt|�}|j�d�D]@}zt|�Wn"tk
rbtd|�YdSX||kr0q�q0td||j�dSdS)N�80rlz   bad port %s (not numeric)Fz$   request port (%s) not found in %sT)r�r��strr�r�rArLr�r�r�r�Zreq_portr�rrr�set_ok_port+s&

�zDefaultCookiePolicy.set_ok_portcCs@td|j|j�dD]&}d|}t||�}|||�sdSqdS)Nr)r�rr�r�r�r�Z
return_ok_FTr	r
rrrr�@s	

zDefaultCookiePolicy.return_okcCs<|jdkr|jstd�dS|jdkr8|js8td�dSdS)Nr	r
FrT)r�r�rr�r�rrr�return_ok_versionRsz%DefaultCookiePolicy.return_ok_versioncCsJ|jrFt|�rF|jdkr*|jr*td�dS|jdkrF|jrFtd�dSdSrrr�rrr�return_ok_verifiability[sz+DefaultCookiePolicy.return_ok_verifiabilitycCs"|jr|j|jkrtd�dSdS)Nz(   secure cookie with non-secure requestFT)r��typer�rr�rrr�return_ok_securegsz$DefaultCookiePolicy.return_ok_securecCs|�|j�rtd�dSdS)Nz   cookie expiredFT)r��_nowrr�rrr�return_ok_expiresmsz%DefaultCookiePolicy.return_ok_expirescCsN|jrJt|�}|dkrd}|j�d�D]}||kr&qJq&td||j�dSdS)Nr"rlz0   request port %s does not match cookie port %sFT)r�r�r�rr$rrr�return_ok_portss�z"DefaultCookiePolicy.return_ok_portcCs�t|�\}}|j}|r*|�d�s*d|}n|}|jdkr^|j|j@r^|js^||kr^td�dS|jdkr�t||�s�td||�dS|jdkr�d|�	|�s�td||�dSdS)Nr�r	zQ   cookie with unspecified domain does not string-compare equal to request domainFzQ   effective request-host name %s does not domain-match RFC 2965 cookie domain %sz;   request-host %s does not match Netscape cookie domain %sT)
r�r�rsr�r��DomainStrictNonDomainr�rr�r�)r�r�r�r�r�r��	dotdomainrrr�return_ok_domain�s6


�����z$DefaultCookiePolicy.return_ok_domaincCs�t|�\}}|�d�sd|}|�d�s0d|}|rH|�d�sHd|}n|}|�|�sd|�|�sddS|�|�r|td|�dS|�|�r�td|�dSdS)Nr�FrrT)r�rsr�rrr)r�r�r�r�r�r.rrrr��s"






z$DefaultCookiePolicy.domain_return_okcCsbtd|�t|�}t|�}||kr&dS|�|�rR|�d�sN|||d�dkrRdStd||�dS)Nz- checking cookie path=%sTr�rz  %s does not path-match %sF)rr�rrsr�)r�r�r�rZpathlenrrrr��s

��z"DefaultCookiePolicy.path_return_ok)r�r�r�rr-rZ
DomainLiberalZDomainStrictr�rrrrrrr�rrrrr!r%r�r&r'r)r+r,r/r�r�rrrrrcsR�
#	;	cCst|���}t|j|�Sr�)�sorted�keys�mapr�)Zadictr1rrr�vals_sorted_by_key�sr3c	csVt|�}|D]D}d}z
|jWntk
r2YnXd}t|�EdH|s|VqdSr�)r3�items�AttributeError�
deepvalues)�mapping�values�objrrrr6�s
r6c@seZdZdS)�AbsentN�r�r�r�rrrrr:�sr:c@s�eZdZe�d�Ze�d�Ze�d�Ze�d�Ze�d�Z	e�dej
�Zd2dd	�Zd
d�Z
dd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd3d$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Z dS)4rz\Wr{z\.?[^.]*z[^.]*z^\.+z^\#LWP-Cookies-(\d+\.\d+)NcCs(|dkrt�}||_t��|_i|_dSr�)r�_policy�
_threading�RLock�
_cookies_lock�_cookies�r��policyrrrr��s

zCookieJar.__init__cCs
||_dSr�)r<rArrr�
set_policy�szCookieJar.set_policycCs�g}|j�||�sgStd|�|j|}|��D]T}|j�||�sFq2||}|��D].}|j�||�srtd�qVtd�|�|�qVq2|S)Nz!Checking %s for cookies to returnz   not returning cookiez   it's a match)	r<r�rr@r1r�r8r�rr)r�r�r��cookiesZcookies_by_pathr�Zcookies_by_namer�rrr�_cookies_for_domain�s 

zCookieJar._cookies_for_domaincCs*g}|j��D]}|�|�||��q|Sr�)r@r1�extendrE)r�r�rDr�rrr�_cookies_for_requestszCookieJar._cookies_for_requestc	Cs<|jdd�dd�d}g}|D�]}|j}|sHd}|dkrH|�d|�|jdk	rz|j�|j�rz|dkrz|j�d|j�}n|j}|jdkr�|�|j�n|�d	|j|f�|dkr|j	r�|�d
|j
�|j�d��r|j}|j
s�|�d�r�|dd�}|�d
|�|jdk	rd}|j�r,|d|j}|�|�q|S)NcSs
t|j�Sr�)rr�)�arrr�<lambda>�z)CookieJar._cookie_attrs.<locals>.<lambda>T)r��reverseFr	z$Version=%sr|r}z
$Path="%s"r�rz$Domain="%s"z$Portz="%s")�sortr�rrry�non_word_rer@�quote_rer^rxr�r�r�rsr�r�r�)	r�rDr��attrsr�r�ryr�r�rrr�
_cookie_attrssF


��
�
zCookieJar._cookie_attrscCs�td�|j��z�tt���|j_|_|�|�}|�	|�}|r^|�
d�s^|�dd�|��|jj
r�|jjs�|�
d�s�|D]}|jdkr||�dd�q�q|W5|j��X|��dS)N�add_cookie_headerrr~ZCookie2rz$Version="1")rr?�acquire�releaserArMr<r*rGrPZ
has_headerZadd_unredirected_headerr�r�r�r��clear_expired_cookies)r�r�rDrOr�rrrrQIs*



��

zCookieJar.add_cookie_headerc
Cs�g}d}d}|D�]z}|d\}}d}d}	i}
i}|dd�D�]0\}}
|��}||ks`||krd|}||krx|
dkrxd}
||
kr�q>|dkr�|
dkr�td�d}	�qr|
��}
|d	kr�|r�q>|
dkr�td
�q>|dk�r d}zt|
�}
Wn*tk
�rtd�d}	Y�qrYnXd	}|j|
}
||k�s4||k�rh|
dk�r^|d
k�r^td|�d}	�qr|
|
|<q>|
||<q>|	�rzq|�|||
|f�q|S)N)r�r�)r�r�r�r�r�r�r��
commenturlr	FrTr�z%   missing value for domain attributer�zM   missing or invalid value for expires attribute: treating as session cookier�z?   missing or invalid (non-numeric) value for max-age attribute)r�r�rUz!   missing value for %s attribute)rKrrArLr*rr)r��	attrs_set�
cookie_tuples�
boolean_attrs�value_attrsZcookie_attrsrxryZmax_age_setZ
bad_cookie�standardr�r�r�r�rrr�_normalized_cookie_tuplesjsh





�

z#CookieJar._normalized_cookie_tuplescCs&|\}}}}|�dt�}|�dt�}|�dt�}	|�dt�}
|�dd�}|dk	rtzt|�}Wntk
rrYdSX|�dd�}|�dd�}
|�d	d�}|�d
d�}|tk	r�|dkr�d}t|�}nXd}t|�}|�d
�}|dk�r|dkr�|d|�}n|d|d�}t|�dk�rd
}|tk	}d}|�r:t|�	d��}|tk�rVt
|�\}}|}n|�	d��sjd|}d}|	tk	�r�|	dk�r�t|�}	nd}t�
dd|	�}	nd}	|
tk�r�d}
d}
nH|
|jk�rz|�|||�Wntk
�r�YnXtd|||�dSt||||	||||||||
|
|||�S)Nr�r�r�r�r�r�Fr�r�rUrWTr�r�r	rr�z\s+z2Expiring cookie, domain='%s', path='%s', name='%s')r�r:rArLr�r�r�r�boolrsr�r�rtr^r*�clear�KeyErrorrr)r��tupr�rxryrZr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr�_cookie_from_cookie_tuple�s�







��z#CookieJar._cookie_from_cookie_tuplecCs6|�|�}g}|D]}|�||�}|r|�|�q|Sr�)r[r`rr)r�rVr�rWrDr_r�rrr�_cookies_from_attrs_set's
z!CookieJar._cookies_from_attrs_setcCsHt|jdd�}|dkr |jj}|D]}|jdkr$d|_|r$d|_q$dS)Nr�rTr	)r�r<r�r�r�)r�rDZ
rfc2109_as_nsr�rrr�_process_rfc2109_cookies0s

z"CookieJar._process_rfc2109_cookiesc
Cs:|��}|�dg�}|�dg�}tt���|j_|_|jj}|jj}|sN|rf|sV|rf|s^|rf|sj|sjgSz|�t	|�|�}Wnt
k
r�t�g}YnX|�r6|�r6z|�t|�|�}	Wnt
k
r�t�g}	YnX|�
|	�|�r&i}
|D]}d|
|j|j|jf<q�|
fdd�}t||	�}	|	�r6|�|	�|S)NzSet-Cookie2z
Set-CookiecSs|j|j|jf}||kSr�)r�r�rx)Z	ns_cookie�lookupr�rrr�no_matching_rfc2965isz3CookieJar.make_cookies.<locals>.no_matching_rfc2965)rZget_allrArMr<r*r�r�rarz�	Exceptionrr�rbr�r�rx�filterrF)
r��responser�r�Zrfc2965_hdrsZns_hdrsr�r�rDZ
ns_cookiesrcr�rdrrr�make_cookies<s^�������
�



zCookieJar.make_cookiescCsN|j��z2tt���|j_|_|j�||�r:|�|�W5|j��XdSr�)	r?rRrSrArMr<r*r��
set_cookier�rrr�set_cookie_if_okss
zCookieJar.set_cookie_if_okcCsl|j}|j��zJ|j|kr&i||j<||j}|j|krDi||j<||j}|||j<W5|j��XdSr�)r@r?rRrSr�r�rx)r�r��cZc2Zc3rrrri�s






zCookieJar.set_cookiecCsbtd|���|j��z8|�||�D]&}|j�||�r&td|�|�|�q&W5|j��XdS)Nzextract_cookies: %sz setting cookie: %s)	rrr?rRrSrhr<r�ri)r�rgr�r�rrr�extract_cookies�s

zCookieJar.extract_cookiescCst|dk	r2|dks|dkr td��|j|||=n>|dk	rX|dkrJtd��|j||=n|dk	rj|j|=ni|_dS)Nz8domain and path must be given to remove a cookie by namez.domain must be given to remove cookies by path)rLr@)r�r�r�rxrrrr]�s��
zCookieJar.clearcCsD|j��z(|D]}|jr|�|j|j|j�qW5|j��XdSr�)r?rRrSr�r]r�r�rx)r�r�rrr�clear_session_cookies�s
zCookieJar.clear_session_cookiescCsP|j��z4t��}|D]"}|�|�r|�|j|j|j�qW5|j��XdSr�)	r?rRrSrMr�r]r�r�rx)r�r�r�rrrrT�s


zCookieJar.clear_expired_cookiescCs
t|j�Sr�)r6r@rrrr�__iter__�szCookieJar.__iter__cCsd}|D]}|d}q|S)Nr	rr)r�r�r�rrr�__len__�s
zCookieJar.__len__cCs2g}|D]}|�t|��qd|jjd�|�fS�Nz<%s[%s]>r)rrr�r�r�r��r��rr�rrrr��szCookieJar.__repr__cCs2g}|D]}|�t|��qd|jjd�|�fSrp)rrr#r�r�r�rqrrrr��szCookieJar.__str__)N)NNN)!r�r�r�rt�compilerMrNZstrict_domain_reZ	domain_reZdots_re�ASCII�magic_rer�rCrErGrPrQr[r`rarbrhrjrirlr]rmrTrnror�r�rrrrr�s6





;!a\	7


c@seZdZdS)rNr;rrrrr�sc@s4eZdZddd�Zddd�Zd
dd�Zdd	d
�ZdS)rNFcCs2t�||�|dk	rt�|�}||_t|�|_dSr�)rr��os�fspath�filenamer\�	delayload)r�rxryrBrrrr��s

zFileCookieJar.__init__cCs
t��dSr�r�)r�rx�ignore_discard�ignore_expiresrrr�save�szFileCookieJar.savec	CsJ|dkr"|jdk	r|j}ntt��t|��}|�||||�W5QRXdSr�)rxrL�MISSING_FILENAME_TEXT�open�_really_load�r�rxrzr{rrrr�loads

zFileCookieJar.loadcCs�|dkr"|jdk	r|j}ntt��|j��zFt�|j�}i|_z|�	|||�Wnt
k
rn||_�YnXW5|j��XdSr�)rxrLr}r?rRrSr�Zdeepcopyr@r��OSError)r�rxrzr{Z	old_staterrr�revert	s

zFileCookieJar.revert)NFN)NFF)NFF)NFF)r�r�r�r�r|r�r�rrrrr�s


	�cCs |j|jfd|jfd|jfg}|jdk	r8|�d|jf�|jrH|�d�|jrX|�d�|jrh|�d�|j	rx|�d�|j
r�|�dtt|j
��f�|j
r�|�d	�|jr�|�d
|jf�|jr�|�d|jf�t|j���}|D]}|�|t|j|�f�q�|�dt|j�f�t|g�S)
Nr�r�r�)�	path_specN)�	port_specN)�
domain_dotN)r�Nr�)r�Nr�rUr�)rxryr�r�r�rrr�r�r�r�r�r5r[r�r�r�r0r�r1r#r�r�)r�r�r1r�rrr�lwp_cookie_str$s:
�




�
r�c@s(eZdZd
dd�Zddd�Zdd	�ZdS)rTcCsTt��}g}|D]2}|s |jr q|s0|�|�r0q|�dt|��qd�|dg�S)NzSet-Cookie3: %s�
rW)rMr�r�rrr�r�)r�rzr{r�rrr�rrr�
as_lwp_strMs
zLWPCookieJar.as_lwp_strNFc	CsX|dkr"|jdk	r|j}ntt��t|d��"}|�d�|�|�||��W5QRXdS)N�wz#LWP-Cookies-2.0
)rxrLr}r~�writer�r�rrrr|]s

zLWPCookieJar.savecCs0|��}|j�|�s$d|}t|��t��}d}d}	d}
�z�|��}|dkrP�q�|�|�s\q<|t|�d���}t|g�D�]f}|d\}
}i}i}|	D]}d||<q�|dd�D]n\}}|dk	r�|�	�}nd}||
ks�||	kr�|}||	k�r|dkr�d	}|||<q�||
k�r|||<q�|||<q�|j
}|d
�}|d�}|dk	�rJt|�}|dk�rXd	}|d�}|�d
�}t|d�|
||d�|d�|||d�|d�|d�|d�|||d�|d�|�}|�s�|j
�r�qz|�s�|�|��r�qz|�|�qzq<WnBtk
�r�Yn,tk
�r*t�td||f��YnXdS)Nz5%r does not look like a Set-Cookie3 (LWP) format filezSet-Cookie3:)r�r�r�r�r�)r�r�r�r�r�r�rUrWr	FrTr�r�r�r�r�r�r�r�r�r�r�r�rUz&invalid Set-Cookie3 format file %r: %r)�readlinerur@rrMrsrr�rzrKr�rerr�r�rir�rer)r�rrxrzr{�magicrr��headerrXrY�line�datarxryrZr�r�r�r�r�r�r�r�r�rkrrrris��










�
�zLWPCookieJar._really_load)TT)NFF)r�r�r�r�r|rrrrrr@s

c@s,eZdZe�d�ZdZdd�Zd	dd�ZdS)
rz#( Netscape)? HTTP Cookie Filezr# Netscape HTTP Cookie File
# http://curl.haxx.se/rfc/cookie_spec.html
# This is a generated file!  Do not edit.

cCsbt��}|��}|j�|�s(td|��z�|��}|dkr>�q|�d�rT|dd�}|���d�s*|��dkrpq*|�d�\}}	}
}}}
}|dk}|	dk}	|
dkr�|}
d}|�d�}d	}|dkr�d}d
}t	d|
|dd	||	||
d	|||ddi�}|s�|j
r�q*|�s|�|��rq*|�|�q*WnBt
k
�r2�Yn,tk
�r\t�td||f��YnXdS)
Nz4%r does not look like a Netscape format cookies filerWr�r�)�#r�	�TRUEr�FTr	z+invalid Netscape format cookies file %r: %r)rMr�rur@rr�r�rsr�rr�r�rir�rer)r�rrxrzr{r�r�r�r�r�r�r�r�rxryr�r�rkrrrr�sr��

��
�

�zMozillaCookieJar._really_loadNFc
Cs�|dkr"|jdk	r|j}ntt��t|d���}|�|j�t��}|D]�}|sV|jrVqF|sf|�|�rfqF|j	rrd}nd}|j
�d�r�d}nd}|jdk	r�t
|j�}	nd}	|jdkr�d}
|j}n|j}
|j}|�d�|j
||j||	|
|g�d�qFW5QRXdS)Nr�r�ZFALSEr�rWr�r�)rxrLr}r~r�r�rMr�r�r�r�rsr�r#ryrxr�r�)r�rxrzr{rr�r�r�r�r�rxryrrrr| sH



���zMozillaCookieJar.save)NFF)	r�r�r�rtrsrur�rr|rrrrr�s
A)N)N)W�__all__rvr�r-rtrMZurllib.parser�Zurllib.requestZ	threadingr=Zhttp.clientZhttpZcalendarr
rrrr#ZclientZ	HTTP_PORTr�r}rr%r,r6r7rIr(rrrKr5r8r>rsrtr?rFrTrY�Ir]�Xr_rbrcrerkrmrnrprorzr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrr3r6r:rr�rrr�rrrrrr�<module>s��
�

8�
�
�8
�!



U
D'


#b!b7xhttp/__pycache__/client.cpython-38.opt-1.pyc000064400000103772151153537450014623 0ustar00U

e5d���@sfdZddlZddlZddlZddlZddlZddlZddlZ	ddl
mZdddddd	d
ddd
ddddddddgZdZ
dZdZdZdZdZe��ejj�dd�ejj��D�ZdZdZe�d �jZe�d!�jZe�d"�Z e�d#�Z!d$d%d&hZ"dBd(d)�Z#Gd*d+�d+ej$j%�Z&d,d-�Z'e&fd.d/�Z(Gd0d�dej)�Z*Gd1d�d�Z+zddl,Z,Wne-k
�r`YnXGd2d3�d3e+�Z.e�/d3�Gd4d�de0�Z1Gd5d�de1�Z2Gd6d�de1�Z3Gd7d�de1�Z4Gd8d	�d	e1�Z5Gd9d
�d
e1�Z6Gd:d�de1�Z7Gd;d
�d
e1�Z8Gd<d�de8�Z9Gd=d�de8�Z:Gd>d�de8�Z;Gd?d�de1�Z<Gd@d�de1�Z=GdAd�de>e<�Z?e1Z@dS)Ca�
HTTP/1.1 client library

<intro stuff goes here>
<other stuff, too>

HTTPConnection goes through a number of "states", which define when a client
may legally make another request or fetch the response for a particular
request. This diagram details these state transitions:

    (null)
      |
      | HTTPConnection()
      v
    Idle
      |
      | putrequest()
      v
    Request-started
      |
      | ( putheader() )*  endheaders()
      v
    Request-sent
      |\_____________________________
      |                              | getresponse() raises
      | response = getresponse()     | ConnectionError
      v                              v
    Unread-response                Idle
    [Response-headers-read]
      |\____________________
      |                     |
      | response.read()     | putrequest()
      v                     v
    Idle                  Req-started-unread-response
                     ______/|
                   /        |
   response.read() |        | ( putheader() )*  endheaders()
                   v        v
       Request-started    Req-sent-unread-response
                            |
                            | response.read()
                            v
                          Request-sent

This diagram presents the following rules:
  -- a second request may not be started until {response-headers-read}
  -- a response [object] cannot be retrieved until {request-sent}
  -- there is no differentiation between an unread response body and a
     partially read response body

Note: this enforcement is applied by the HTTPConnection class. The
      HTTPResponse class does not enforce this state machine, which
      implies sophisticated clients may accelerate the request/response
      pipeline. Caution should be taken, though: accelerating the states
      beyond the above pattern may imply knowledge of the server's
      connection-close behavior for certain requests. For example, it
      is impossible to tell whether the server will close the connection
      UNTIL the response headers have been read; this means that further
      requests cannot be placed into the pipeline until it is known that
      the server will NOT be closing the connection.

Logical State                  __state            __response
-------------                  -------            ----------
Idle                           _CS_IDLE           None
Request-started                _CS_REQ_STARTED    None
Request-sent                   _CS_REQ_SENT       None
Unread-response                _CS_IDLE           <response_class>
Req-started-unread-response    _CS_REQ_STARTED    <response_class>
Req-sent-unread-response       _CS_REQ_SENT       <response_class>
�N)�urlsplit�HTTPResponse�HTTPConnection�
HTTPException�NotConnected�UnknownProtocol�UnknownTransferEncoding�UnimplementedFileMode�IncompleteRead�
InvalidURL�ImproperConnectionState�CannotSendRequest�CannotSendHeader�ResponseNotReady�
BadStatusLine�LineTooLong�RemoteDisconnected�error�	responses�Pi�ZUNKNOWNZIdlezRequest-startedzRequest-sentcCsi|]}||j�qS�)�phrase)�.0�vrr�#/usr/lib64/python3.8/http/client.py�
<dictcomp>jsri�ds[^:\s][^:\r\n]*s\n(?![ \t])|\r(?![ \t\n])z[- ]z[-]ZPATCHZPOSTZPUT�datac
Cshz|�d�WStk
rb}z8t|j|j|j|jd|��||j|j�|f�d�W5d}~XYnXdS)z<Call data.encode("latin-1") but show a better error message.�latin-1z`%s (%.20r) is not valid Latin-1. Use %s.encode('utf-8') if you want to send it encoded in UTF-8.N)�encode�UnicodeEncodeError�encoding�object�start�end�title)r�name�errrrr�_encode�s���r(c@seZdZdd�ZdS)�HTTPMessagecCsj|��d}t|�}g}d}|��D]@}|d|���|krBd}n|dd���sVd}|r$|�|�q$|S)a�Find all header lines matching a given header name.

        Look through the list of headers and find all lines matching a given
        header name (and their continuation lines).  A list of the lines is
        returned, without interpretation.  If the header does not occur, an
        empty list is returned.  If the header occurs multiple times, all
        occurrences are returned.  Case is not important in the header name.

        �:rN�)�lower�len�keys�isspace�append)�selfr&�nZlstZhit�linerrr�getallmatchingheaders�s
z!HTTPMessage.getallmatchingheadersN)�__name__�
__module__�__qualname__r4rrrrr)�sr)cCsXg}|�td�}t|�tkr&td��|�|�t|�tkrHtdt��|dkrqTq|S)z�Reads potential header lines into a list from a file pointer.

    Length of line is limited by _MAXLINE, and number of
    headers is limited by _MAXHEADERS.
    r+�header linezgot more than %d headers��
�
�)�readline�_MAXLINEr-rr0�_MAXHEADERSr)�fp�headersr3rrr�
_read_headers�s
rBcCs,t|�}d�|��d�}tjj|d��|�S)aGParses only RFC2822 headers from a file pointer.

    email Parser wants to see strings rather than bytes.
    But a TextIOWrapper around self.rfile would buffer too many bytes
    from the stream, bytes which we later need to read as bytes.
    So we read the correct bytes here, as bytes, for email Parser
    to parse.

    r<�
iso-8859-1)�_class)rB�join�decode�email�parserZParserZparsestr)r@rDrAZhstringrrr�
parse_headers�s
rIcseZdZd@dd�Zdd�Zdd�Zd	d
�Zdd�Z�fd
d�Z�fdd�Z	dd�Z
dd�ZdAdd�Zdd�Z
dd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�ZdBd(d)�ZdCd*d+�ZdD�fd,d-�	Zd.d/�Zd0d1�Zd2d3�ZdEd4d5�Zd6d7�Zd8d9�Zd:d;�Zd<d=�Zd>d?�Z �Z!S)FrrNcCsR|�d�|_||_||_d|_|_t|_t|_t|_	t|_
t|_t|_t|_
dS)N�rb)Zmakefiler@�
debuglevel�_methodrA�msg�_UNKNOWN�version�status�reason�chunked�
chunk_left�length�
will_close)r1�sockrK�method�urlrrr�__init__�szHTTPResponse.__init__cCst|j�td�d�}t|�tkr*td��|jdkrBtdt|��|sNt	d��z|�
dd�\}}}WnFtk
r�z|�
dd�\}}d}Wntk
r�d}YnXYnX|�d	�s�|�
�t|��z$t|�}|d
ks�|dkr�t|��Wntk
�rt|��YnX|||fS)Nr+rCzstatus linerzreply:z-Remote end closed connection without response��zHTTP/ri�)�strr@r=r>r-rrK�print�reprr�split�
ValueError�
startswith�_close_connr�int)r1r3rOrPrQrrr�_read_statuss2

zHTTPResponse._read_statusc	Cs�|jdk	rdS|��\}}}|tkr&qHt|j�}|jdkrDtd|�~q||_|_|�	�|_
|dkrnd|_n|�d�r�d|_nt
|��t|j�|_|_|jdkr�|j��D]\}}td|d|�q�|j�d	�}|r�|��d
kr�d|_d|_nd|_|��|_d|_|j�d
�}|�rb|j�sbzt|�|_Wntk
�rLd|_YnX|jdk�rhd|_nd|_|tk�s�|tk�s�d|k�r�dk�s�n|jdk�r�d|_|j�s�|j�s�|jdk�r�d|_dS)Nrzheaders:)zHTTP/1.0zHTTP/0.9�
zHTTP/1.��header:r*�transfer-encodingrRTF�content-lengthr���HEAD)rArdZCONTINUErBr@rKr]�coderP�striprQrOrarrIrM�items�getr,rRrS�_check_closerUrTrcr`Z
NO_CONTENTZNOT_MODIFIEDrL)	r1rOrPrQZskipped_headers�hdr�valZtr_encrTrrr�begin5sf







�
�
���zHTTPResponse.begincCsv|j�d�}|jdkr.|r*d|��kr*dSdS|j�d�r>dS|rRd|��krRdS|j�d�}|rrd|��krrdSdS)NZ
connectionrf�closeTFz
keep-alivezproxy-connection)rArorOr,)r1ZconnZpconnrrrrp}s
zHTTPResponse._check_closecCs|j}d|_|��dS�N)r@rt)r1r@rrrrb�szHTTPResponse._close_conncs$zt���W5|jr|��XdSru)r@rb�superrt�r1��	__class__rrrt�szHTTPResponse.closecst���|jr|j��dSru)rv�flushr@rwrxrrrz�s
zHTTPResponse.flushcCsdS)zAlways returns TrueTrrwrrr�readable�szHTTPResponse.readablecCs
|jdkS)z!True if the connection is closed.N)r@rwrrr�isclosed�szHTTPResponse.isclosedcCs�|jdkrdS|jdkr$|��dS|dk	rRt|�}|�|�}t|�d|���S|jr`|��S|j	dkrv|j�
�}n6z|�|j	�}Wntk
r�|���YnXd|_	|��|SdS)Nr<rkr)
r@rLrb�	bytearray�readinto�
memoryview�tobytesrR�_readall_chunkedrT�read�
_safe_readr
)r1�amt�br2�srrrr��s*



zHTTPResponse.readcCs�|jdkrdS|jdkr$|��dS|jr4|�|�S|jdk	r^t|�|jkr^t|�d|j�}|j�|�}|s||r||��n&|jdk	r�|j|8_|js�|��|S)z^Read up to len(b) bytes into bytearray b and return the number
        of bytes read.
        Nrrk)	r@rLrbrR�_readinto_chunkedrTr-rr~)r1r�r2rrrr~�s$





zHTTPResponse.readintocCsr|j�td�}t|�tkr$td��|�d�}|dkrB|d|�}zt|d�WStk
rl|���YnXdS)Nr+z
chunk size�;r�)	r@r=r>r-r�findrcr`rb)r1r3�irrr�_read_next_chunk_sizes
z"HTTPResponse._read_next_chunk_sizecCs:|j�td�}t|�tkr$td��|s*q6|dkrq6qdS)Nr+ztrailer liner9)r@r=r>r-r�r1r3rrr�_read_and_discard_trailersz&HTTPResponse._read_and_discard_trailercCsl|j}|sh|dk	r|�d�z|��}Wntk
rDtd��YnX|dkrb|��|��d}||_|S)NrZr<r)rSr�r�r`r
r�rb)r1rSrrr�_get_chunk_left s
zHTTPResponse._get_chunk_leftcCsbg}z6|��}|dkrq0|�|�|��d|_qd�|�WStk
r\td�|���YnXdS�Nrr<)r�r0r�rSrEr
)r1�valuerSrrrr�8szHTTPResponse._readall_chunkedcCs�d}t|�}zv|��}|dkr$|WSt|�|krN|�|�}|||_||WS|d|�}|�|�}||d�}||7}d|_qWn(tk
r�tt|d|����YnXdS)Nr)rr�r-�_safe_readintorSr
�bytes)r1r�Ztotal_bytesZmvbrSr2Ztemp_mvbrrrr�Fs"



zHTTPResponse._readinto_chunkedcCs.|j�|�}t|�|kr*t||t|���|S)aRead the number of bytes requested.

        This function should be used when <amt> bytes "should" be present for
        reading. If the bytes are truly not available (due to EOF), then the
        IncompleteRead exception can be used to detect the problem.
        )r@r�r-r
)r1r�rrrrr�^szHTTPResponse._safe_readcCs:t|�}|j�|�}||kr6tt|d|��||��|S)z2Same as _safe_read, but for reading into a buffer.N)r-r@r~r
r�)r1r�r�r2rrrr�js
zHTTPResponse._safe_readinto���cCs�|jdks|jdkrdS|jr(|�|�S|jdk	rJ|dksD||jkrJ|j}|j�|�}|sh|rh|��n|jdk	r�|jt|�8_|S)zvRead with at most one underlying system call.  If at least one
        byte is buffered, return that instead.
        Nrkr<r)r@rLrR�_read1_chunkedrT�read1rbr-)r1r2�resultrrrr�rs


zHTTPResponse.read1cCs4|jdks|jdkrdS|jr(|�|�S|j�|�S)Nrkr<)r@rLrR�
_peek_chunked�peek)r1r2rrrr��s

zHTTPResponse.peekcs�|jdks|jdkrdS|jr*t��|�S|jdk	rL|dksF||jkrL|j}|j�|�}|sj|rj|��n|jdk	r�|jt|�8_|S)Nrkr<r)r@rLrRrvr=rTrbr-)r1�limitr�rxrrr=�s

zHTTPResponse.readlinecCsd|��}|dks|dkrdSd|kr0|ks6n|}|j�|�}|jt|�8_|s`td��|Sr�)r�r@r�rSr-r
)r1r2rSr�rrrr��szHTTPResponse._read1_chunkedcCsDz|��}Wntk
r"YdSX|dkr0dS|j�|�d|�S)Nr<)r�r
r@r�)r1r2rSrrrr��szHTTPResponse._peek_chunkedcCs
|j��Sru)r@�filenorwrrrr��szHTTPResponse.filenocCsF|jdkrt��|j�|�p|}t|t�s4t|d�s8|Sd�|�SdS)axReturns the value of the header matching *name*.

        If there are multiple matching headers, the values are
        combined into a single string separated by commas and spaces.

        If no matching header is found, returns *default* or None if
        the *default* is not specified.

        If the headers are unknown, raises http.client.ResponseNotReady.

        N�__iter__z, )rArZget_all�
isinstancer\�hasattrrE)r1r&�defaultrArrr�	getheader�s
zHTTPResponse.getheadercCs|jdkrt��t|j���S)z&Return list of (header, value) tuples.N)rAr�listrnrwrrr�
getheaders�s
zHTTPResponse.getheaderscCs|Srurrwrrrr��szHTTPResponse.__iter__cCs|jS)ajReturns an instance of the class mimetools.Message containing
        meta-information associated with the URL.

        When the method is HTTP, these headers are those returned by
        the server at the head of the retrieved HTML page (including
        Content-Length and Content-Type).

        When the method is FTP, a Content-Length header will be
        present if (as is now usual) the server passed back a file
        length in response to the FTP retrieval request. A
        Content-Type header will be present if the MIME type can be
        guessed.

        When the method is local-file, returned headers will include
        a Date representing the file's last-modified time, a
        Content-Length giving file size, and a Content-Type
        containing a guess at the file's type. See also the
        description of the mimetools module.

        )rArwrrr�info�szHTTPResponse.infocCs|jS)aZReturn the real URL of the page.

        In some cases, the HTTP server redirects a client to another
        URL. The urlopen() function handles this transparently, but in
        some cases the caller needs to know which URL the client was
        redirected to. The geturl() method can be used to get at this
        redirected URL.

        )rXrwrrr�geturl�s
zHTTPResponse.geturlcCs|jS)zuReturn the HTTP status code that was sent with the response,
        or None if the URL is not an HTTP URL.

        )rPrwrrr�getcode�szHTTPResponse.getcode)rNN)N)r�)r�)r�)N)"r5r6r7rYrdrsrprbrtrzr{r|r�r~r�r�r�r�r�r�r�r�r�r=r�r�r�r�r�r�r�r�r��
__classcell__rrrxrr�s<	
!H

 "

	

c@s
eZdZdZdZeZeZdZ	dZ
edd��Zedd��Z
d	ejd	d
fdd�Zd7d
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd8d d!�Zd9d"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Z d:dd.�d/d0�Z!d	ifdd.�d1d2�Z"d3d4�Z#d5d6�Z$d	S);rrfzHTTP/1.1r+rcCst|tj�S)zFTest whether a file-like object is a text or a binary stream.
        )r��io�
TextIOBase)�streamrrr�
_is_textIOszHTTPConnection._is_textIOcCsf|dkr|��tkrdSdSt|d�r*dSzt|�}|jWStk
rNYnXt|t�rbt|�SdS)aGet the content-length based on the body.

        If the body is None, we set Content-Length: 0 for methods that expect
        a body (RFC 7230, Section 3.3.2). We also set the Content-Length for
        any method if the body is a str or bytes-like object and not a file.
        Nrr�)	�upper�_METHODS_EXPECTING_BODYr�r�nbytes�	TypeErrorr�r\r-)�bodyrWZmvrrr�_get_content_lengths

z"HTTPConnection._get_content_lengthN� cCsn||_||_||_d|_g|_d|_t|_d|_d|_	d|_
i|_|�||�\|_
|_|�|j
�tj|_dSru)�timeout�source_address�	blocksizerV�_buffer�_HTTPConnection__response�_CS_IDLE�_HTTPConnection__staterL�_tunnel_host�_tunnel_port�_tunnel_headers�
_get_hostport�host�port�_validate_host�socketZcreate_connection�_create_connection)r1r�r�r�r�r�rrrrY4szHTTPConnection.__init__cCs<|jrtd��|�||�\|_|_|r.||_n
|j��dS)aDSet up host and port for HTTP CONNECT tunnelling.

        In a connection that uses HTTP CONNECT tunneling, the host passed to the
        constructor is used as a proxy server that relays all communication to
        the endpoint passed to `set_tunnel`. This done by sending an HTTP
        CONNECT request to the proxy server when the connection is established.

        This method must be called before the HTTP connection has been
        established.

        The headers argument should be a mapping of extra HTTP headers to send
        with the CONNECT request.
        z.Can't set up tunnel for established connectionN)rV�RuntimeErrorr�r�r�r��clear)r1r�r�rArrr�
set_tunnelJszHTTPConnection.set_tunnelcCs�|dkr�|�d�}|�d�}||kr�zt||dd��}WnHtk
r�||dd�dkrh|j}ntd||dd���YnX|d|�}n|j}|r�|ddkr�|ddkr�|dd�}||fS)	Nr*�]r+r[znonnumeric port: '%s'r�[r�)�rfindrcr`�default_portr)r1r�r�r��jrrrr�bs

zHTTPConnection._get_hostportcCs
||_dSru)rK)r1�levelrrr�set_debuglevelvszHTTPConnection.set_debuglevelcCs�d|j|jf}|�d�}|�|�|j��D](\}}d||f}|�d�}|�|�q.|�d�|j|j|jd�}|�	�\}}	}
|	t
jjkr�|�
�td|	|
��f��|j�td�}t|�tkr�td	��|s�q�|d
kr�q�|jdkr�td|���q�dS)
NzCONNECT %s:%d HTTP/1.0
�asciiz%s: %s
rr:�rWzTunnel connection failed: %d %sr+r8r9rrg)r�r�r�sendr�rn�response_classrVrLrd�http�
HTTPStatusZOKrt�OSErrorrmr@r=r>r-rrKr]rF)r1Zconnect_strZ
connect_bytes�headerr�Z
header_strZheader_bytes�responserOrl�messager3rrr�_tunnelys4�



�
zHTTPConnection._tunnelcCsB|�|j|jf|j|j�|_|j�tjtj	d�|j
r>|��dS)z3Connect to the host and port specified in __init__.r+N)r�r�r�r�r�rVZ
setsockoptr�ZIPPROTO_TCPZTCP_NODELAYr�r�rwrrr�connect�s
�zHTTPConnection.connectcCsBt|_z|j}|r d|_|��W5|j}|r<d|_|��XdS)z(Close the connection to the HTTP server.N)r�r�r�rtrV)r1r�rVrrrrt�szHTTPConnection.closecCs|jdkr |jr|��nt��|jdkr8tdt|��t|d�r�|jdkrTtd�|�|�}|rt|jdkrttd�|�	|j
�}|s�q�|r�|�d�}|j�|�qtdSz|j�|�WnLt
k
�rt|tjj�r�|D]}|j�|�q�nt
dt|���YnXdS)	z�Send `data' to the server.
        ``data`` can be a string object, a bytes object, an array object, a
        file-like object that supports a .read() method, or an iterable object.
        Nrzsend:r��sendIng a read()able�encoding file using iso-8859-1rCz9data should be a bytes-like object or an iterable, got %r)rV�	auto_openr�rrKr]r^r�r�r�r�rZsendallr�r��collections�abc�Iterable�type)r1rr�	datablock�drrrr��s8






�zHTTPConnection.sendcCs|j�|�dS)zuAdd a line of output to the current request buffer.

        Assumes that the line does *not* end with \r\n.
        N)r�r0)r1r�rrr�_output�szHTTPConnection._outputccs^|jdkrtd�|�|�}|r2|jdkr2td�|�|j�}|sDqZ|rR|�d�}|Vq2dS)Nrr�r�rC)rKr]r�r�r�r)r1r{rr�rrr�_read_readable�s


zHTTPConnection._read_readableFcCs |j�d�d�|j�}|jdd�=|�|�|dk	�rt|d�rN|�|�}nZzt|�WnFtk
r�zt|�}Wn$tk
r�tdt	|���YnXYnX|f}|D]R}|s�|j
dkr�td�q�|r�|jdkr�t
|�d	�d
��d�|d}|�|�q�|�r|jdk�r|�d�dS)
z�Send the currently buffered request and clear the buffer.

        Appends an extra \r\n to the buffer.
        A message_body may be specified, to be appended to the request.
        )r<r<r:Nr�zAmessage_body should be a bytes-like object or an iterable, got %rrzZero length chunk ignoredrf�Xz
r�s0

)r��extendrEr�r�r�rr��iterr�rKr]�	_http_vsnr-r)r1�message_body�encode_chunkedrMZchunks�chunkrrr�_send_output�s:


�
�zHTTPConnection._send_outputcCs�|jr|j��rd|_|jtkr(t|_n
t|j��|�|�||_|pHd}|�|�d|||j	f}|�
|�|��|jdk�r�|�s�d}|�
d�r�t|�\}}}}}|r�z|�d�}Wntk
r�|�d�}YnX|�d	|�n�|jr�|j}	|j}
n|j}	|j}
z|	�d�}Wn tk
�r4|	�d�}YnX|	�d
�dk�rRd|d
}|
|jk�rl|�d	|�n|�d�}|�d	d||
f�|�s�|�dd�ndS)a`Send a request to the server.

        `method' specifies an HTTP request method, e.g. 'GET'.
        `url' specifies the object being requested, e.g. '/index.html'.
        `skip_host' if True does not add automatically a 'Host:' header
        `skip_accept_encoding' if True does not add automatically an
           'Accept-Encoding:' header
        N�/z%s %s %srfr[r�r�ZidnaZHostr*r�[�]z%s:%szAccept-EncodingZidentity)r�r|r�r��_CS_REQ_STARTEDr
�_validate_methodrL�_validate_path�
_http_vsn_strr��_encode_requestr�rarrr �	putheaderr�r�r�r�r�r�rF)r1rWrX�	skip_host�skip_accept_encoding�requestZnetlocZnilZ
netloc_encr�r�Zhost_encrrr�
putrequest sP






zHTTPConnection.putrequestcCs
|�d�S)Nr�)r)r1r�rrrr��szHTTPConnection._encode_requestcCs,t�|�}|r(td|�d|���d���dS)z&Validate a method name for putrequest.z)method can't contain control characters. � (found at least �)N)�$_contains_disallowed_method_pchar_re�searchr`�group)r1rW�matchrrrr��s

�zHTTPConnection._validate_methodcCs,t�|�}|r(td|�d|���d���dS)zValidate a url for putrequest.�&URL can't contain control characters. r�r�N��!_contains_disallowed_url_pchar_rer�rr�)r1rXr�rrrr��s
zHTTPConnection._validate_pathcCs,t�|�}|r(td|�d|���d���dS)z9Validate a host so it doesn't contain control characters.r�r�r�Nr�)r1r�r�rrrr��s
zHTTPConnection._validate_hostcGs�|jtkrt��t|d�r$|�d�}t|�s:td|f��t|�}t|�D]\\}}t|d�rl|�d�||<nt	|t
�r�t|��d�||<t||�rJtd||f��qJd�
|�}|d|}|�|�dS)	zkSend a request header line to the server.

        For example: h.putheader('Accept', 'text/html')
        rr�zInvalid header name %rrzInvalid header value %rs
	s: N)r�r�rr�r�_is_legal_header_namer`r��	enumerater�rcr\�_is_illegal_header_valuerEr�)r1r��valuesr�Z	one_valuer�rrrr��s"





zHTTPConnection.putheader�r�cCs*|jtkrt|_nt��|j||d�dS)z�Indicate that the last header line has been sent to the server.

        This method sends the request to the server.  The optional message_body
        argument can be used to pass a message body associated with the
        request.
        rN)r�r��_CS_REQ_SENTrr�)r1r�r�rrr�
endheaders�s
zHTTPConnection.endheaderscCs|�|||||�dS)z&Send a complete request to the server.N)�
_send_request)r1rWrXr�rAr�rrrr��szHTTPConnection.requestcCs�tdd�|D��}i}d|kr&d|d<d|kr6d|d<|j||f|�d|kr�d	|kr�d
}|�||�}|dkr�|dk	r�|jdkr�td|�d
}|�dd�q�|�dt|��nd
}|��D]\}	}
|�|	|
�q�t|t�r�t	|d�}|j
||d�dS)Ncss|]}|��VqdSru)r,)r�krrr�	<genexpr>�sz/HTTPConnection._send_request.<locals>.<genexpr>r�r+r�zaccept-encodingr�rirhFrzUnable to determine size of %rTzTransfer-EncodingrRzContent-Lengthr�r)�	frozensetr�r�rKr]r�r\rnr�r(r)r1rWrXr�rAr�Zheader_namesZskipsZcontent_lengthrqr�rrrr�s0	


zHTTPConnection._send_requestcCs�|jr|j��rd|_|jtks&|jr0t|j��|jdkrR|j|j|j|jd�}n|j|j|jd�}zNz|�	�Wnt
k
r�|���YnXt|_|j
r�|��n||_|WS|���YnXdS)a)Get the response from the server.

        If the HTTPConnection is in the correct state, returns an
        instance of HTTPResponse or of whatever object is returned by
        the response_class variable.

        If a request has not been sent or if a previous response has
        not be handled, ResponseNotReady is raised.  If the HTTP
        response indicates that the connection should be closed, then
        it will be closed before the response is returned.  When the
        connection is closed, the underlying socket is closed.
        Nrr�)r�r|r�rrrKr�rVrLrs�ConnectionErrorrtr�rU)r1r�rrr�getresponses.

�
zHTTPConnection.getresponse)NN)NF)FF)N)%r5r6r7r�r�rr��	HTTP_PORTr�r�rK�staticmethodr�r�r��_GLOBAL_DEFAULT_TIMEOUTrYr�r�r�r�r�rtr�r�r�r�r�r�r�r�r�r�rr�rr
rrrrrsL

�

	&
6�
	
�.csHeZdZdZeZdddejdfdddd��fdd�Z�fdd�Z	�Z
S)	�HTTPSConnectionz(This class allows communication via SSL.Nr�)�context�check_hostnamer�cs�tt|�j|||||	d�|dk	s2|dk	s2|dk	rHddl}
|
�dtd�||_||_|dkrtt�	�}|j
dk	rtd|_
|jtjk}|dkr�|j
}|r�|s�td��|s�|r�|�||�|j
dk	r�d|_
||_|dk	r�||j_
dS)N)r�rzTkey_file, cert_file and check_hostname are deprecated, use a custom context instead.rZTzMcheck_hostname needs a SSL context with either CERT_OPTIONAL or CERT_REQUIRED)rvrrY�warnings�warn�DeprecationWarning�key_file�	cert_file�sslZ_create_default_https_contextZpost_handshake_authZverify_modeZ	CERT_NONErr`Zload_cert_chain�_context)r1r�r�rrr�r�rrr�rZwill_verifyrxrrrYcs<���

zHTTPSConnection.__init__cs6t���|jr|j}n|j}|jj|j|d�|_dS)z(Connect to a host on a given (SSL) port.)�server_hostnameN)rvr�r�r�rZwrap_socketrV)r1rrxrrr��s

�zHTTPSConnection.connect)r5r6r7�__doc__�
HTTPS_PORTr�r�rrYr�r�rrrxrr\s��$rc@seZdZdS)rN�r5r6r7rrrrr�sc@seZdZdS)rNrrrrrr�sc@seZdZdS)rNrrrrrr�sc@seZdZdd�ZdS)rcCs|f|_||_dSru)�argsrO)r1rOrrrrY�szUnknownProtocol.__init__N�r5r6r7rYrrrrr�sc@seZdZdS)rNrrrrrr�sc@seZdZdS)r	Nrrrrrr	�sc@s$eZdZddd�Zdd�ZejZdS)r
NcCs|f|_||_||_dSru)r�partial�expected)r1r!r"rrrrY�szIncompleteRead.__init__cCs2|jdk	rd|j}nd}d|jjt|j�|fS)Nz, %i more expectedr[z%s(%i bytes read%s))r"ryr5r-r!)r1�errr�__repr__�s
�zIncompleteRead.__repr__)N)r5r6r7rYr$r"�__str__rrrrr
�s
c@seZdZdS)rNrrrrrr�sc@seZdZdS)r
Nrrrrrr
�sc@seZdZdS)rNrrrrrr�sc@seZdZdS)rNrrrrrr�sc@seZdZdd�ZdS)rcCs|st|�}|f|_||_dSru)r^rr3r�rrrrY�szBadStatusLine.__init__Nr rrrrr�sc@seZdZdd�ZdS)rcCst�|dt|f�dS)Nz&got more than %d bytes when reading %s)rrYr>)r1Z	line_typerrrrY�s�zLineTooLong.__init__Nr rrrrr�sc@seZdZdd�ZdS)rcOs"t�|d�tj|f|�|�dS)Nr[)rrY�ConnectionResetError)r1�pos�kwrrrrY�szRemoteDisconnected.__init__Nr rrrrr�s)r)ArZemail.parserrGZ
email.messager�r��rer�Zcollections.abcr�Zurllib.parser�__all__rrrNr�r�r�globals�updater��__members__rrr>r?�compile�	fullmatchrr�rrr�r�r(r�ZMessager)rBrI�BufferedIOBaserrr�ImportErrorrr0�	Exceptionrrrrrr	r
rr
rrrrr&rrrrrr�<module>s�F�



W8
http/__pycache__/__init__.cpython-38.opt-1.pyc000064400000013662151153537450015102 0ustar00U

e5d��@s&ddlmZdgZGdd�de�ZdS)�)�IntEnum�
HTTPStatusc@seZdZdZdAdd�ZdZdZdZdZd	Z	d
Z
dZdZd
Z
dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZd Z d!Z!d"Z"d#Z#d$Z$d%Z%d&Z&d'Z'd(Z(d)Z)d*Z*d+Z+d,Z,d-Z-d.Z.d/Z/d0Z0d1Z1d2Z2d3Z3d4Z4d5Z5d6Z6d7Z7d8Z8d9Z9d:Z:d;Z;d<Z<d=Z=d>Z>d?Z?d@S)Bra�HTTP status codes and reason phrases

    Status codes from the following RFCs are all observed:

        * RFC 7231: Hypertext Transfer Protocol (HTTP/1.1), obsoletes 2616
        * RFC 6585: Additional HTTP Status Codes
        * RFC 3229: Delta encoding in HTTP
        * RFC 4918: HTTP Extensions for WebDAV, obsoletes 2518
        * RFC 5842: Binding Extensions to WebDAV
        * RFC 7238: Permanent Redirect
        * RFC 2295: Transparent Content Negotiation in HTTP
        * RFC 2774: An HTTP Extension Framework
        * RFC 7725: An HTTP Status Code to Report Legal Obstacles
        * RFC 7540: Hypertext Transfer Protocol Version 2 (HTTP/2)
    �cCs"t�||�}||_||_||_|S)N)�int�__new__�_value_�phrase�description)�cls�valuerr	�obj�r
�%/usr/lib64/python3.8/http/__init__.pyrs
zHTTPStatus.__new__)�dZContinuez!Request received, please continue)�ezSwitching Protocolsz.Switching to new protocol; obey Upgrade header)�fZ
Processing)���OKz#Request fulfilled, document follows)��ZCreatedzDocument created, URL follows)��ZAcceptedz/Request accepted, processing continues off-line)��zNon-Authoritative InformationzRequest fulfilled from cache)��z
No Contentz"Request fulfilled, nothing follows)��z
Reset Contentz"Clear input form for further input)��zPartial ContentzPartial content follows)��zMulti-Status)��zAlready Reported)��zIM Used)i,zMultiple Choicesz,Object has several resources -- see URI list)i-zMoved Permanently�(Object moved permanently -- see URI list)i.ZFound�(Object moved temporarily -- see URI list)i/z	See Otherz'Object moved -- see Method and URL list)i0zNot Modifiedz)Document has not changed since given time)i1z	Use Proxyz@You must use proxy specified in Location to access this resource)i3zTemporary Redirectr)i4zPermanent Redirectr)i�zBad Requestz(Bad request syntax or unsupported method)i�ZUnauthorizedz*No permission -- see authorization schemes)i�zPayment Requiredz"No payment -- see charging schemes)i�Z	Forbiddenz0Request forbidden -- authorization will not help)i�z	Not FoundzNothing matches the given URI)i�zMethod Not Allowedz-Specified method is invalid for this resource)i�zNot Acceptablez%URI not available in preferred format)i�zProxy Authentication Requiredz7You must authenticate with this proxy before proceeding)i�zRequest Timeoutz"Request timed out; try again later)i�ZConflictzRequest conflict)i�ZGonez5URI no longer exists and has been permanently removed)i�zLength Requiredz"Client must specify Content-Length)i�zPrecondition Failedz Precondition in headers is false)i�zRequest Entity Too LargezEntity is too large)i�zRequest-URI Too LongzURI is too long)i�zUnsupported Media Typez!Entity body in unsupported format)i�zRequested Range Not SatisfiablezCannot satisfy request range)i�zExpectation Failedz'Expect condition could not be satisfied)i�zMisdirected Requestz(Server is not able to produce a response)i�zUnprocessable Entity)i�ZLocked)i�zFailed Dependency)i�zUpgrade Required)i�zPrecondition Requiredz8The origin server requires the request to be conditional)i�zToo Many RequestszOThe user has sent too many requests in a given amount of time ("rate limiting"))i�zRequest Header Fields Too LargezVThe server is unwilling to process the request because its header fields are too large)i�zUnavailable For Legal ReasonszOThe server is denying access to the resource as a consequence of a legal demand)i�zInternal Server ErrorzServer got itself in trouble)i�zNot Implementedz&Server does not support this operation)i�zBad Gatewayz+Invalid responses from another server/proxy)i�zService Unavailablez8The server cannot process the request due to a high load)i�zGateway Timeoutz4The gateway server did not receive a timely response)i�zHTTP Version Not SupportedzCannot fulfill request)i�zVariant Also Negotiates)i�zInsufficient Storage)i�z
Loop Detected)i�zNot Extended)i�zNetwork Authentication Requiredz7The client needs to authenticate to gain network accessN)r)@�__name__�
__module__�__qualname__�__doc__rZCONTINUEZSWITCHING_PROTOCOLSZ
PROCESSINGrZCREATEDZACCEPTEDZNON_AUTHORITATIVE_INFORMATIONZ
NO_CONTENTZ
RESET_CONTENTZPARTIAL_CONTENTZMULTI_STATUSZALREADY_REPORTEDZIM_USEDZMULTIPLE_CHOICESZMOVED_PERMANENTLYZFOUNDZ	SEE_OTHERZNOT_MODIFIEDZ	USE_PROXYZTEMPORARY_REDIRECTZPERMANENT_REDIRECTZBAD_REQUESTZUNAUTHORIZEDZPAYMENT_REQUIREDZ	FORBIDDENZ	NOT_FOUNDZMETHOD_NOT_ALLOWEDZNOT_ACCEPTABLEZPROXY_AUTHENTICATION_REQUIREDZREQUEST_TIMEOUTZCONFLICTZGONEZLENGTH_REQUIREDZPRECONDITION_FAILEDZREQUEST_ENTITY_TOO_LARGEZREQUEST_URI_TOO_LONGZUNSUPPORTED_MEDIA_TYPEZREQUESTED_RANGE_NOT_SATISFIABLEZEXPECTATION_FAILEDZMISDIRECTED_REQUESTZUNPROCESSABLE_ENTITYZLOCKEDZFAILED_DEPENDENCYZUPGRADE_REQUIREDZPRECONDITION_REQUIREDZTOO_MANY_REQUESTSZREQUEST_HEADER_FIELDS_TOO_LARGEZUNAVAILABLE_FOR_LEGAL_REASONSZINTERNAL_SERVER_ERRORZNOT_IMPLEMENTEDZBAD_GATEWAYZSERVICE_UNAVAILABLEZGATEWAY_TIMEOUTZHTTP_VERSION_NOT_SUPPORTEDZVARIANT_ALSO_NEGOTIATESZINSUFFICIENT_STORAGEZ
LOOP_DETECTEDZNOT_EXTENDEDZNETWORK_AUTHENTICATION_REQUIREDr
r
r
rrsz
	N)�enumr�__all__rr
r
r
r�<module>shttp/__pycache__/client.cpython-38.pyc000064400000104135151153537450013656 0ustar00U

e5d���@sfdZddlZddlZddlZddlZddlZddlZddlZ	ddl
mZdddddd	d
ddd
ddddddddgZdZ
dZdZdZdZdZe��ejj�dd�ejj��D�ZdZdZe�d �jZe�d!�jZe�d"�Z e�d#�Z!d$d%d&hZ"dBd(d)�Z#Gd*d+�d+ej$j%�Z&d,d-�Z'e&fd.d/�Z(Gd0d�dej)�Z*Gd1d�d�Z+zddl,Z,Wne-k
�r`YnXGd2d3�d3e+�Z.e�/d3�Gd4d�de0�Z1Gd5d�de1�Z2Gd6d�de1�Z3Gd7d�de1�Z4Gd8d	�d	e1�Z5Gd9d
�d
e1�Z6Gd:d�de1�Z7Gd;d
�d
e1�Z8Gd<d�de8�Z9Gd=d�de8�Z:Gd>d�de8�Z;Gd?d�de1�Z<Gd@d�de1�Z=GdAd�de>e<�Z?e1Z@dS)Ca�
HTTP/1.1 client library

<intro stuff goes here>
<other stuff, too>

HTTPConnection goes through a number of "states", which define when a client
may legally make another request or fetch the response for a particular
request. This diagram details these state transitions:

    (null)
      |
      | HTTPConnection()
      v
    Idle
      |
      | putrequest()
      v
    Request-started
      |
      | ( putheader() )*  endheaders()
      v
    Request-sent
      |\_____________________________
      |                              | getresponse() raises
      | response = getresponse()     | ConnectionError
      v                              v
    Unread-response                Idle
    [Response-headers-read]
      |\____________________
      |                     |
      | response.read()     | putrequest()
      v                     v
    Idle                  Req-started-unread-response
                     ______/|
                   /        |
   response.read() |        | ( putheader() )*  endheaders()
                   v        v
       Request-started    Req-sent-unread-response
                            |
                            | response.read()
                            v
                          Request-sent

This diagram presents the following rules:
  -- a second request may not be started until {response-headers-read}
  -- a response [object] cannot be retrieved until {request-sent}
  -- there is no differentiation between an unread response body and a
     partially read response body

Note: this enforcement is applied by the HTTPConnection class. The
      HTTPResponse class does not enforce this state machine, which
      implies sophisticated clients may accelerate the request/response
      pipeline. Caution should be taken, though: accelerating the states
      beyond the above pattern may imply knowledge of the server's
      connection-close behavior for certain requests. For example, it
      is impossible to tell whether the server will close the connection
      UNTIL the response headers have been read; this means that further
      requests cannot be placed into the pipeline until it is known that
      the server will NOT be closing the connection.

Logical State                  __state            __response
-------------                  -------            ----------
Idle                           _CS_IDLE           None
Request-started                _CS_REQ_STARTED    None
Request-sent                   _CS_REQ_SENT       None
Unread-response                _CS_IDLE           <response_class>
Req-started-unread-response    _CS_REQ_STARTED    <response_class>
Req-sent-unread-response       _CS_REQ_SENT       <response_class>
�N)�urlsplit�HTTPResponse�HTTPConnection�
HTTPException�NotConnected�UnknownProtocol�UnknownTransferEncoding�UnimplementedFileMode�IncompleteRead�
InvalidURL�ImproperConnectionState�CannotSendRequest�CannotSendHeader�ResponseNotReady�
BadStatusLine�LineTooLong�RemoteDisconnected�error�	responses�Pi�ZUNKNOWNZIdlezRequest-startedzRequest-sentcCsi|]}||j�qS�)�phrase)�.0�vrr�#/usr/lib64/python3.8/http/client.py�
<dictcomp>jsri�ds[^:\s][^:\r\n]*s\n(?![ \t])|\r(?![ \t\n])z[- ]z[-]ZPATCHZPOSTZPUT�datac
Cshz|�d�WStk
rb}z8t|j|j|j|jd|��||j|j�|f�d�W5d}~XYnXdS)z<Call data.encode("latin-1") but show a better error message.�latin-1z`%s (%.20r) is not valid Latin-1. Use %s.encode('utf-8') if you want to send it encoded in UTF-8.N)�encode�UnicodeEncodeError�encoding�object�start�end�title)r�name�errrrr�_encode�s���r(c@seZdZdd�ZdS)�HTTPMessagecCsj|��d}t|�}g}d}|��D]@}|d|���|krBd}n|dd���sVd}|r$|�|�q$|S)a�Find all header lines matching a given header name.

        Look through the list of headers and find all lines matching a given
        header name (and their continuation lines).  A list of the lines is
        returned, without interpretation.  If the header does not occur, an
        empty list is returned.  If the header occurs multiple times, all
        occurrences are returned.  Case is not important in the header name.

        �:rN�)�lower�len�keys�isspace�append)�selfr&�nZlstZhit�linerrr�getallmatchingheaders�s
z!HTTPMessage.getallmatchingheadersN)�__name__�
__module__�__qualname__r4rrrrr)�sr)cCsXg}|�td�}t|�tkr&td��|�|�t|�tkrHtdt��|dkrqTq|S)z�Reads potential header lines into a list from a file pointer.

    Length of line is limited by _MAXLINE, and number of
    headers is limited by _MAXHEADERS.
    r+�header linezgot more than %d headers��
�
�)�readline�_MAXLINEr-rr0�_MAXHEADERSr)�fp�headersr3rrr�
_read_headers�s
rBcCs,t|�}d�|��d�}tjj|d��|�S)aGParses only RFC2822 headers from a file pointer.

    email Parser wants to see strings rather than bytes.
    But a TextIOWrapper around self.rfile would buffer too many bytes
    from the stream, bytes which we later need to read as bytes.
    So we read the correct bytes here, as bytes, for email Parser
    to parse.

    r<�
iso-8859-1)�_class)rB�join�decode�email�parserZParserZparsestr)r@rDrAZhstringrrr�
parse_headers�s
rIcseZdZd@dd�Zdd�Zdd�Zd	d
�Zdd�Z�fd
d�Z�fdd�Z	dd�Z
dd�ZdAdd�Zdd�Z
dd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�ZdBd(d)�ZdCd*d+�ZdD�fd,d-�	Zd.d/�Zd0d1�Zd2d3�ZdEd4d5�Zd6d7�Zd8d9�Zd:d;�Zd<d=�Zd>d?�Z �Z!S)FrrNcCsR|�d�|_||_||_d|_|_t|_t|_t|_	t|_
t|_t|_t|_
dS)N�rb)Zmakefiler@�
debuglevel�_methodrA�msg�_UNKNOWN�version�status�reason�chunked�
chunk_left�length�
will_close)r1�sockrK�method�urlrrr�__init__�szHTTPResponse.__init__cCst|j�td�d�}t|�tkr*td��|jdkrBtdt|��|sNt	d��z|�
dd�\}}}WnFtk
r�z|�
dd�\}}d}Wntk
r�d}YnXYnX|�d	�s�|�
�t|��z$t|�}|d
ks�|dkr�t|��Wntk
�rt|��YnX|||fS)Nr+rCzstatus linerzreply:z-Remote end closed connection without response��zHTTP/ri�)�strr@r=r>r-rrK�print�reprr�split�
ValueError�
startswith�_close_connr�int)r1r3rOrPrQrrr�_read_statuss2

zHTTPResponse._read_statusc	Cs�|jdk	rdS|��\}}}|tkr&qHt|j�}|jdkrDtd|�~q||_|_|�	�|_
|dkrnd|_n|�d�r�d|_nt
|��t|j�|_|_|jdkr�|j��D]\}}td|d|�q�|j�d	�}|r�|��d
kr�d|_d|_nd|_|��|_d|_|j�d
�}|�rb|j�sbzt|�|_Wntk
�rLd|_YnX|jdk�rhd|_nd|_|tk�s�|tk�s�d|k�r�dk�s�n|jdk�r�d|_|j�s�|j�s�|jdk�r�d|_dS)Nrzheaders:)zHTTP/1.0zHTTP/0.9�
zHTTP/1.��header:r*�transfer-encodingrRTF�content-lengthr���HEAD)rArdZCONTINUErBr@rKr]�coderP�striprQrOrarrIrM�items�getr,rRrS�_check_closerUrTrcr`Z
NO_CONTENTZNOT_MODIFIEDrL)	r1rOrPrQZskipped_headers�hdr�valZtr_encrTrrr�begin5sf







�
�
���zHTTPResponse.begincCsv|j�d�}|jdkr.|r*d|��kr*dSdS|j�d�r>dS|rRd|��krRdS|j�d�}|rrd|��krrdSdS)NZ
connectionrf�closeTFz
keep-alivezproxy-connection)rArorOr,)r1ZconnZpconnrrrrp}s
zHTTPResponse._check_closecCs|j}d|_|��dS�N)r@rt)r1r@rrrrb�szHTTPResponse._close_conncs$zt���W5|jr|��XdSru)r@rb�superrt�r1��	__class__rrrt�szHTTPResponse.closecst���|jr|j��dSru)rv�flushr@rwrxrrrz�s
zHTTPResponse.flushcCsdS)zAlways returns TrueTrrwrrr�readable�szHTTPResponse.readablecCs
|jdkS)z!True if the connection is closed.N)r@rwrrr�isclosed�szHTTPResponse.isclosedcCs�|jdkrdS|jdkr$|��dS|dk	rRt|�}|�|�}t|�d|���S|jr`|��S|j	dkrv|j�
�}n6z|�|j	�}Wntk
r�|���YnXd|_	|��|SdS)Nr<rkr)
r@rLrb�	bytearray�readinto�
memoryview�tobytesrR�_readall_chunkedrT�read�
_safe_readr
)r1�amt�br2�srrrr��s*



zHTTPResponse.readcCs�|jdkrdS|jdkr$|��dS|jr4|�|�S|jdk	r^t|�|jkr^t|�d|j�}|j�|�}|s||r||��n&|jdk	r�|j|8_|js�|��|S)z^Read up to len(b) bytes into bytearray b and return the number
        of bytes read.
        Nrrk)	r@rLrbrR�_readinto_chunkedrTr-rr~)r1r�r2rrrr~�s$





zHTTPResponse.readintocCsr|j�td�}t|�tkr$td��|�d�}|dkrB|d|�}zt|d�WStk
rl|���YnXdS)Nr+z
chunk size�;r�)	r@r=r>r-r�findrcr`rb)r1r3�irrr�_read_next_chunk_sizes
z"HTTPResponse._read_next_chunk_sizecCs:|j�td�}t|�tkr$td��|s*q6|dkrq6qdS)Nr+ztrailer liner9)r@r=r>r-r�r1r3rrr�_read_and_discard_trailersz&HTTPResponse._read_and_discard_trailercCsl|j}|sh|dk	r|�d�z|��}Wntk
rDtd��YnX|dkrb|��|��d}||_|S)NrZr<r)rSr�r�r`r
r�rb)r1rSrrr�_get_chunk_left s
zHTTPResponse._get_chunk_leftcCsp|jtkst�g}z6|��}|dkr&q>|�|�|��d|_qd�|�WStk
rjtd�|���YnXdS�Nrr<)	rRrN�AssertionErrorr�r0r�rSrEr
)r1�valuerSrrrr�8szHTTPResponse._readall_chunkedcCs�|jtkst�d}t|�}zv|��}|dkr2|WSt|�|kr\|�|�}|||_||WS|d|�}|�|�}||d�}||7}d|_qWn(tk
r�tt	|d|����YnXdS)Nr)
rRrNr�rr�r-�_safe_readintorSr
�bytes)r1r�Ztotal_bytesZmvbrSr2Ztemp_mvbrrrr�Fs$



zHTTPResponse._readinto_chunkedcCs.|j�|�}t|�|kr*t||t|���|S)aRead the number of bytes requested.

        This function should be used when <amt> bytes "should" be present for
        reading. If the bytes are truly not available (due to EOF), then the
        IncompleteRead exception can be used to detect the problem.
        )r@r�r-r
)r1r�rrrrr�^szHTTPResponse._safe_readcCs:t|�}|j�|�}||kr6tt|d|��||��|S)z2Same as _safe_read, but for reading into a buffer.N)r-r@r~r
r�)r1r�r�r2rrrr�js
zHTTPResponse._safe_readinto���cCs�|jdks|jdkrdS|jr(|�|�S|jdk	rJ|dksD||jkrJ|j}|j�|�}|sh|rh|��n|jdk	r�|jt|�8_|S)zvRead with at most one underlying system call.  If at least one
        byte is buffered, return that instead.
        Nrkr<r)r@rLrR�_read1_chunkedrT�read1rbr-)r1r2�resultrrrr�rs


zHTTPResponse.read1cCs4|jdks|jdkrdS|jr(|�|�S|j�|�S)Nrkr<)r@rLrR�
_peek_chunked�peek)r1r2rrrr��s

zHTTPResponse.peekcs�|jdks|jdkrdS|jr*t��|�S|jdk	rL|dksF||jkrL|j}|j�|�}|sj|rj|��n|jdk	r�|jt|�8_|S)Nrkr<r)r@rLrRrvr=rTrbr-)r1�limitr�rxrrr=�s

zHTTPResponse.readlinecCsd|��}|dks|dkrdSd|kr0|ks6n|}|j�|�}|jt|�8_|s`td��|Sr�)r�r@r�rSr-r
)r1r2rSr�rrrr��szHTTPResponse._read1_chunkedcCsDz|��}Wntk
r"YdSX|dkr0dS|j�|�d|�S)Nr<)r�r
r@r�)r1r2rSrrrr��szHTTPResponse._peek_chunkedcCs
|j��Sru)r@�filenorwrrrr��szHTTPResponse.filenocCsF|jdkrt��|j�|�p|}t|t�s4t|d�s8|Sd�|�SdS)axReturns the value of the header matching *name*.

        If there are multiple matching headers, the values are
        combined into a single string separated by commas and spaces.

        If no matching header is found, returns *default* or None if
        the *default* is not specified.

        If the headers are unknown, raises http.client.ResponseNotReady.

        N�__iter__z, )rArZget_all�
isinstancer\�hasattrrE)r1r&�defaultrArrr�	getheader�s
zHTTPResponse.getheadercCs|jdkrt��t|j���S)z&Return list of (header, value) tuples.N)rAr�listrnrwrrr�
getheaders�s
zHTTPResponse.getheaderscCs|Srurrwrrrr��szHTTPResponse.__iter__cCs|jS)ajReturns an instance of the class mimetools.Message containing
        meta-information associated with the URL.

        When the method is HTTP, these headers are those returned by
        the server at the head of the retrieved HTML page (including
        Content-Length and Content-Type).

        When the method is FTP, a Content-Length header will be
        present if (as is now usual) the server passed back a file
        length in response to the FTP retrieval request. A
        Content-Type header will be present if the MIME type can be
        guessed.

        When the method is local-file, returned headers will include
        a Date representing the file's last-modified time, a
        Content-Length giving file size, and a Content-Type
        containing a guess at the file's type. See also the
        description of the mimetools module.

        )rArwrrr�info�szHTTPResponse.infocCs|jS)aZReturn the real URL of the page.

        In some cases, the HTTP server redirects a client to another
        URL. The urlopen() function handles this transparently, but in
        some cases the caller needs to know which URL the client was
        redirected to. The geturl() method can be used to get at this
        redirected URL.

        )rXrwrrr�geturl�s
zHTTPResponse.geturlcCs|jS)zuReturn the HTTP status code that was sent with the response,
        or None if the URL is not an HTTP URL.

        )rPrwrrr�getcode�szHTTPResponse.getcode)rNN)N)r�)r�)r�)N)"r5r6r7rYrdrsrprbrtrzr{r|r�r~r�r�r�r�r�r�r�r�r�r=r�r�r�r�r�r�r�r�r��
__classcell__rrrxrr�s<	
!H

 "

	

c@s
eZdZdZdZeZeZdZ	dZ
edd��Zedd��Z
d	ejd	d
fdd�Zd7d
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd8d d!�Zd9d"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Z d:dd.�d/d0�Z!d	ifdd.�d1d2�Z"d3d4�Z#d5d6�Z$d	S);rrfzHTTP/1.1r+rcCst|tj�S)zFTest whether a file-like object is a text or a binary stream.
        )r��io�
TextIOBase)�streamrrr�
_is_textIOszHTTPConnection._is_textIOcCsf|dkr|��tkrdSdSt|d�r*dSzt|�}|jWStk
rNYnXt|t�rbt|�SdS)aGet the content-length based on the body.

        If the body is None, we set Content-Length: 0 for methods that expect
        a body (RFC 7230, Section 3.3.2). We also set the Content-Length for
        any method if the body is a str or bytes-like object and not a file.
        Nrr�)	�upper�_METHODS_EXPECTING_BODYr�r�nbytes�	TypeErrorr�r\r-)�bodyrWZmvrrr�_get_content_lengths

z"HTTPConnection._get_content_lengthN� cCsn||_||_||_d|_g|_d|_t|_d|_d|_	d|_
i|_|�||�\|_
|_|�|j
�tj|_dSru)�timeout�source_address�	blocksizerV�_buffer�_HTTPConnection__response�_CS_IDLE�_HTTPConnection__staterL�_tunnel_host�_tunnel_port�_tunnel_headers�
_get_hostport�host�port�_validate_host�socketZcreate_connection�_create_connection)r1r�r�r�r�r�rrrrY4szHTTPConnection.__init__cCs<|jrtd��|�||�\|_|_|r.||_n
|j��dS)aDSet up host and port for HTTP CONNECT tunnelling.

        In a connection that uses HTTP CONNECT tunneling, the host passed to the
        constructor is used as a proxy server that relays all communication to
        the endpoint passed to `set_tunnel`. This done by sending an HTTP
        CONNECT request to the proxy server when the connection is established.

        This method must be called before the HTTP connection has been
        established.

        The headers argument should be a mapping of extra HTTP headers to send
        with the CONNECT request.
        z.Can't set up tunnel for established connectionN)rV�RuntimeErrorr�r�r�r��clear)r1r�r�rArrr�
set_tunnelJszHTTPConnection.set_tunnelcCs�|dkr�|�d�}|�d�}||kr�zt||dd��}WnHtk
r�||dd�dkrh|j}ntd||dd���YnX|d|�}n|j}|r�|ddkr�|ddkr�|dd�}||fS)	Nr*�]r+r[znonnumeric port: '%s'r�[r�)�rfindrcr`�default_portr)r1r�r�r��jrrrr�bs

zHTTPConnection._get_hostportcCs
||_dSru)rK)r1�levelrrr�set_debuglevelvszHTTPConnection.set_debuglevelcCs�d|j|jf}|�d�}|�|�|j��D](\}}d||f}|�d�}|�|�q.|�d�|j|j|jd�}|�	�\}}	}
|	t
jjkr�|�
�td|	|
��f��|j�td�}t|�tkr�td	��|s�q�|d
kr�q�|jdkr�td|���q�dS)
NzCONNECT %s:%d HTTP/1.0
�asciiz%s: %s
rr:�rWzTunnel connection failed: %d %sr+r8r9rrg)r�r�r�sendr�rn�response_classrVrLrd�http�
HTTPStatusZOKrt�OSErrorrmr@r=r>r-rrKr]rF)r1Zconnect_strZ
connect_bytes�headerr�Z
header_strZheader_bytes�responserOrl�messager3rrr�_tunnelys4�



�
zHTTPConnection._tunnelcCsB|�|j|jf|j|j�|_|j�tjtj	d�|j
r>|��dS)z3Connect to the host and port specified in __init__.r+N)r�r�r�r�r�rVZ
setsockoptr�ZIPPROTO_TCPZTCP_NODELAYr�r�rwrrr�connect�s
�zHTTPConnection.connectcCsBt|_z|j}|r d|_|��W5|j}|r<d|_|��XdS)z(Close the connection to the HTTP server.N)r�r�r�rtrV)r1r�rVrrrrt�szHTTPConnection.closecCs|jdkr |jr|��nt��|jdkr8tdt|��t|d�r�|jdkrTtd�|�|�}|rt|jdkrttd�|�	|j
�}|s�q�|r�|�d�}|j�|�qtdSz|j�|�WnLt
k
�rt|tjj�r�|D]}|j�|�q�nt
dt|���YnXdS)	z�Send `data' to the server.
        ``data`` can be a string object, a bytes object, an array object, a
        file-like object that supports a .read() method, or an iterable object.
        Nrzsend:r��sendIng a read()able�encoding file using iso-8859-1rCz9data should be a bytes-like object or an iterable, got %r)rV�	auto_openr�rrKr]r^r�r�r�r�rZsendallr�r��collections�abc�Iterable�type)r1rr�	datablock�drrrr��s8






�zHTTPConnection.sendcCs|j�|�dS)zuAdd a line of output to the current request buffer.

        Assumes that the line does *not* end with \r\n.
        N)r�r0)r1r�rrr�_output�szHTTPConnection._outputccs^|jdkrtd�|�|�}|r2|jdkr2td�|�|j�}|sDqZ|rR|�d�}|Vq2dS)Nrr�r�rC)rKr]r�r�r�r)r1r{rr�rrr�_read_readable�s


zHTTPConnection._read_readableFcCs |j�d�d�|j�}|jdd�=|�|�|dk	�rt|d�rN|�|�}nZzt|�WnFtk
r�zt|�}Wn$tk
r�tdt	|���YnXYnX|f}|D]R}|s�|j
dkr�td�q�|r�|jdkr�t
|�d	�d
��d�|d}|�|�q�|�r|jdk�r|�d�dS)
z�Send the currently buffered request and clear the buffer.

        Appends an extra \r\n to the buffer.
        A message_body may be specified, to be appended to the request.
        )r<r<r:Nr�zAmessage_body should be a bytes-like object or an iterable, got %rrzZero length chunk ignoredrf�Xz
r�s0

)r��extendrEr�r�r�rr��iterr�rKr]�	_http_vsnr-r)r1�message_body�encode_chunkedrMZchunks�chunkrrr�_send_output�s:


�
�zHTTPConnection._send_outputcCs�|jr|j��rd|_|jtkr(t|_n
t|j��|�|�||_|pHd}|�|�d|||j	f}|�
|�|��|jdk�r�|�s�d}|�
d�r�t|�\}}}}}|r�z|�d�}Wntk
r�|�d�}YnX|�d	|�n�|jr�|j}	|j}
n|j}	|j}
z|	�d�}Wn tk
�r4|	�d�}YnX|	�d
�dk�rRd|d
}|
|jk�rl|�d	|�n|�d�}|�d	d||
f�|�s�|�dd�ndS)a`Send a request to the server.

        `method' specifies an HTTP request method, e.g. 'GET'.
        `url' specifies the object being requested, e.g. '/index.html'.
        `skip_host' if True does not add automatically a 'Host:' header
        `skip_accept_encoding' if True does not add automatically an
           'Accept-Encoding:' header
        N�/z%s %s %srfr[r�r�ZidnaZHostr*r�[�]z%s:%szAccept-EncodingZidentity)r�r|r�r��_CS_REQ_STARTEDr
�_validate_methodrL�_validate_path�
_http_vsn_strr��_encode_requestr�rarrr �	putheaderr�r�r�r�r�r�rF)r1rWrX�	skip_host�skip_accept_encoding�requestZnetlocZnilZ
netloc_encr�r�Zhost_encrrr�
putrequest sP






zHTTPConnection.putrequestcCs
|�d�S)Nr�)r)r1r�rrrr��szHTTPConnection._encode_requestcCs,t�|�}|r(td|�d|���d���dS)z&Validate a method name for putrequest.z)method can't contain control characters. � (found at least �)N)�$_contains_disallowed_method_pchar_re�searchr`�group)r1rW�matchrrrr��s

�zHTTPConnection._validate_methodcCs,t�|�}|r(td|�d|���d���dS)zValidate a url for putrequest.�&URL can't contain control characters. r�r�N��!_contains_disallowed_url_pchar_rer�rr�)r1rXr�rrrr��s
zHTTPConnection._validate_pathcCs,t�|�}|r(td|�d|���d���dS)z9Validate a host so it doesn't contain control characters.r�r�r�Nr)r1r�r�rrrr��s
zHTTPConnection._validate_hostcGs�|jtkrt��t|d�r$|�d�}t|�s:td|f��t|�}t|�D]\\}}t|d�rl|�d�||<nt	|t
�r�t|��d�||<t||�rJtd||f��qJd�
|�}|d|}|�|�dS)	zkSend a request header line to the server.

        For example: h.putheader('Accept', 'text/html')
        rr�zInvalid header name %rrzInvalid header value %rs
	s: N)r�r�rr�r�_is_legal_header_namer`r��	enumerater�rcr\�_is_illegal_header_valuerEr�)r1r��valuesr�Z	one_valuer�rrrr��s"





zHTTPConnection.putheader�r�cCs*|jtkrt|_nt��|j||d�dS)z�Indicate that the last header line has been sent to the server.

        This method sends the request to the server.  The optional message_body
        argument can be used to pass a message body associated with the
        request.
        rN)r�r��_CS_REQ_SENTrr�)r1r�r�rrr�
endheaders�s
zHTTPConnection.endheaderscCs|�|||||�dS)z&Send a complete request to the server.N)�
_send_request)r1rWrXr�rAr�rrrr��szHTTPConnection.requestcCs�tdd�|D��}i}d|kr&d|d<d|kr6d|d<|j||f|�d|kr�d	|kr�d
}|�||�}|dkr�|dk	r�|jdkr�td|�d
}|�dd�q�|�dt|��nd
}|��D]\}	}
|�|	|
�q�t|t�r�t	|d�}|j
||d�dS)Ncss|]}|��VqdSru)r,)r�krrr�	<genexpr>�sz/HTTPConnection._send_request.<locals>.<genexpr>r�r+r�zaccept-encodingr�rirhFrzUnable to determine size of %rTzTransfer-EncodingrRzContent-Lengthr�r)�	frozensetr�r�rKr]r�r\rnr�r(r)r1rWrXr�rAr�Zheader_namesZskipsZcontent_lengthrqr�rrrr	�s0	


zHTTPConnection._send_requestcCs�|jr|j��rd|_|jtks&|jr0t|j��|jdkrR|j|j|j|jd�}n|j|j|jd�}z\z|�	�Wnt
k
r�|���YnX|jt
ks�t�t|_|jr�|��n||_|WS|���YnXdS)a)Get the response from the server.

        If the HTTPConnection is in the correct state, returns an
        instance of HTTPResponse or of whatever object is returned by
        the response_class variable.

        If a request has not been sent or if a previous response has
        not be handled, ResponseNotReady is raised.  If the HTTP
        response indicates that the connection should be closed, then
        it will be closed before the response is returned.  When the
        connection is closed, the underlying socket is closed.
        Nrr�)r�r|r�rrrKr�rVrLrs�ConnectionErrorrtrUrNr�r�)r1r�rrr�getresponses0

�
zHTTPConnection.getresponse)NN)NF)FF)N)%r5r6r7r�r�rr��	HTTP_PORTr�r�rK�staticmethodr�r�r��_GLOBAL_DEFAULT_TIMEOUTrYr�r�r�r�r�rtr�r�r�r�r�r�r�r�r�r�rr�r	rrrrrrsL

�

	&
6�
	
�.csHeZdZdZeZdddejdfdddd��fdd�Z�fdd�Z	�Z
S)	�HTTPSConnectionz(This class allows communication via SSL.Nr�)�context�check_hostnamer�cs�tt|�j|||||	d�|dk	s2|dk	s2|dk	rHddl}
|
�dtd�||_||_|dkrtt�	�}|j
dk	rtd|_
|jtjk}|dkr�|j
}|r�|s�td��|s�|r�|�||�|j
dk	r�d|_
||_|dk	r�||j_
dS)N)r�rzTkey_file, cert_file and check_hostname are deprecated, use a custom context instead.rZTzMcheck_hostname needs a SSL context with either CERT_OPTIONAL or CERT_REQUIRED)rvrrY�warnings�warn�DeprecationWarning�key_file�	cert_file�sslZ_create_default_https_contextZpost_handshake_authZverify_modeZ	CERT_NONErr`Zload_cert_chain�_context)r1r�r�rrr�r�rrr�rZwill_verifyrxrrrYcs<���

zHTTPSConnection.__init__cs6t���|jr|j}n|j}|jj|j|d�|_dS)z(Connect to a host on a given (SSL) port.)�server_hostnameN)rvr�r�r�rZwrap_socketrV)r1rrxrrr��s

�zHTTPSConnection.connect)r5r6r7�__doc__�
HTTPS_PORTr�r�rrYr�r�rrrxrr\s��$rc@seZdZdS)rN�r5r6r7rrrrr�sc@seZdZdS)rNrrrrrr�sc@seZdZdS)rNrrrrrr�sc@seZdZdd�ZdS)rcCs|f|_||_dSru)�argsrO)r1rOrrrrY�szUnknownProtocol.__init__N�r5r6r7rYrrrrr�sc@seZdZdS)rNrrrrrr�sc@seZdZdS)r	Nrrrrrr	�sc@s$eZdZddd�Zdd�ZejZdS)r
NcCs|f|_||_||_dSru)r �partial�expected)r1r"r#rrrrY�szIncompleteRead.__init__cCs2|jdk	rd|j}nd}d|jjt|j�|fS)Nz, %i more expectedr[z%s(%i bytes read%s))r#ryr5r-r")r1�errr�__repr__�s
�zIncompleteRead.__repr__)N)r5r6r7rYr%r"�__str__rrrrr
�s
c@seZdZdS)rNrrrrrr�sc@seZdZdS)r
Nrrrrrr
�sc@seZdZdS)rNrrrrrr�sc@seZdZdS)rNrrrrrr�sc@seZdZdd�ZdS)rcCs|st|�}|f|_||_dSru)r^r r3r�rrrrY�szBadStatusLine.__init__Nr!rrrrr�sc@seZdZdd�ZdS)rcCst�|dt|f�dS)Nz&got more than %d bytes when reading %s)rrYr>)r1Z	line_typerrrrY�s�zLineTooLong.__init__Nr!rrrrr�sc@seZdZdd�ZdS)rcOs"t�|d�tj|f|�|�dS)Nr[)rrY�ConnectionResetError)r1�pos�kwrrrrY�szRemoteDisconnected.__init__Nr!rrrrr�s)r)ArZemail.parserrGZ
email.messager�r��rer�Zcollections.abcr�Zurllib.parser�__all__rrrNr�r�r�globals�updater��__members__rrr>r?�compile�	fullmatchrr�rrr�r�r(r�ZMessager)rBrI�BufferedIOBaserrr�ImportErrorrr0�	Exceptionrrrrrr	r
rr
rrrrr'rrrrrr�<module>s�F�



W8
http/__pycache__/cookiejar.cpython-38.opt-1.pyc000064400000150304151153537450015304 0ustar00U

e5d#,�@sdZddddddddgZd	d
lZd	d
lZd	d
lZd	d
lZd	d
lZd	d
lZd	d
l	Zd	d
l
Zd	d
lZ
d	dlmZdZd
ad
d�Zee
jj�ZdZdd�ZdZdd�ZdddddddgZddddd d!d"d#d$d%d&d'gZgZeD]Ze�e� ��q�dud(d)�Z!dvd*d+�Z"d
d
d
d
d,�Z#e�$d-ej%�Z&d.d/�Z'd0d1�Z(e�$d2ej%�Z)e�$d3ej*ej%B�Z+e�$d4ej,ej%B�Z-d5d6�Z.e�$d7ej,ej%B�Z/d8d9�Z0d:d;�Z1e�$d<�Z2e�$d=�Z3e�$d>�Z4e�$d?�Z5d@dA�Z6e�$dB�Z7dCdD�Z8dEdF�Z9dGdH�Z:e�$dIej%�Z;dJdK�Z<dLdM�Z=dNdO�Z>dPdQ�Z?e�$dRej%�Z@dSdT�ZAdUdV�ZBdWdX�ZCdYdZ�ZDd[ZEe�$d\�ZFd]d^�ZGd_d`�ZHdadb�ZIdcdd�ZJGded�d�ZKGdfd�d�ZLGdgd�deL�ZMdhdi�ZNdjdk�ZOGdldm�dm�ZPGdnd�d�ZQGdod�deR�ZSGdpd�deQ�ZTdqdr�ZUGdsd�deT�ZVGdtd�deT�ZWd
S)wa�HTTP cookie handling for web clients.

This module has (now fairly distant) origins in Gisle Aas' Perl module
HTTP::Cookies, from the libwww-perl library.

Docstrings, comments and debug strings in this code refer to the
attributes of the HTTP cookie system as cookie-attributes, to distinguish
them clearly from Python attributes.

Class diagram (note that BSDDBCookieJar and the MSIE* classes are not
distributed with the Python standard library, but are available from
http://wwwsearch.sf.net/):

                        CookieJar____
                        /     \      \
            FileCookieJar      \      \
             /    |   \         \      \
 MozillaCookieJar | LWPCookieJar \      \
                  |               |      \
                  |   ---MSIEBase |       \
                  |  /      |     |        \
                  | /   MSIEDBCookieJar BSDDBCookieJar
                  |/
               MSIECookieJar

�Cookie�	CookieJar�CookiePolicy�DefaultCookiePolicy�
FileCookieJar�LWPCookieJar�	LoadError�MozillaCookieJar�N)�timegmFcGs(tsdStsddl}|�d�atj|�S)Nr	zhttp.cookiejar)�debug�logger�loggingZ	getLogger)�argsr
�r�&/usr/lib64/python3.8/http/cookiejar.py�_debug,s
rzQa filename was not supplied (nor was the CookieJar instance initialised with one)cCsJddl}ddl}ddl}|��}|�d|�|��}|jd|dd�dS)Nr	zhttp.cookiejar bug!
%s�)�
stacklevel)�io�warnings�	traceback�StringIO�	print_exc�getvalue�warn)rrr�f�msgrrr�_warn_unhandled_exception:s
ri�cCs�|dd�\}}}}}}|tkr�d|kr4dkr�nnhd|krLdkr�nnPd|krddkr�nn8d|kr|dkr�nn d|kr�dkr�nnt|�SdSdS)	N����r	��;�=)�
EPOCH_YEARr
)�tt�year�monthZmday�hour�min�secrrr�_timegmIs&8��
��
��
r,ZMonZTueZWedZThuZFriZSatZSunZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDeccCs@|dkrtj��}ntj�|�}d|j|j|j|j|j|jfS)aHReturn a string representing time in seconds since epoch, t.

    If the function is called without an argument, it will use the current
    time.

    The format of the returned string is like "YYYY-MM-DD hh:mm:ssZ",
    representing Universal Time (UTC, aka GMT).  An example of this format is:

    1994-11-24 08:49:37Z

    Nz%04d-%02d-%02d %02d:%02d:%02dZ)	�datetime�utcnow�utcfromtimestampr'r(�dayr)�minute�second��tZdtrrr�	time2isozWs�r5cCsR|dkrtj��}ntj�|�}dt|��|jt|jd|j|j	|j
|jfS)z�Return a string representing time in seconds since epoch, t.

    If the function is called without an argument, it will use the current
    time.

    The format of the returned string is like this:

    Wed, DD-Mon-YYYY HH:MM:SS GMT

    Nz#%s, %02d-%s-%04d %02d:%02d:%02d GMTr)r-r.r/�DAYSZweekdayr0�MONTHSr(r'r)r1r2r3rrr�
time2netscapejs
�r8)ZGMT�UTCZUT�Zz^([-+])?(\d\d?):?(\d\d)?$cCsjd}|tkrd}nTt�|�}|rfdt|�d��}|�d�rR|dt|�d��}|�d�dkrf|}|S)Nr	ir��<r�-)�	UTC_ZONES�TIMEZONE_RE�search�int�group)�tz�offset�mrrr�offset_from_tz_string�s

rFc
Cs�t|�}|tjkrdSzt�|���d}Wn^tk
r�zt|�}Wntk
r`YYdSXd|krvdkr�nn|}nYdSYnX|dkr�d}|dkr�d}|dkr�d}t|�}t|�}t|�}t|�}|dk�r6t�t���d}|d}	|}
|||	}|	|
}	t	|	�dk�r6|	dk�r.|d}n|d}t
|||||||f�}|dk	�r�|dk�rdd}|��}t|�}|dk�r�dS||}|S)Nrr r	i��d�2r9)
rAr-ZMAXYEAR�MONTHS_LOWER�index�lower�
ValueError�time�	localtime�absr,�upperrF)
r0�mon�yr�hrr*r+rCZimonZcur_yrrEZtmpr4rDrrr�	_str2time�sV







rTzV^[SMTWF][a-z][a-z], (\d\d) ([JFMASOND][a-z][a-z]) (\d\d\d\d) (\d\d):(\d\d):(\d\d) GMT$z+^(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)[a-z]*,?\s*a�^
    (\d\d?)            # day
       (?:\s+|[-\/])
    (\w+)              # month
        (?:\s+|[-\/])
    (\d+)              # year
    (?:
          (?:\s+|:)    # separator before clock
       (\d\d?):(\d\d)  # hour:min
       (?::(\d\d))?    # optional seconds
    )?                 # optional clock
       \s*
    (?:
       ([-+]?\d{2,4}|(?![APap][Mm]\b)[A-Za-z]+) # timezone
       \s*
    )?
    (?:
       \(\w+\)         # ASCII representation of timezone in parens.
       \s*
    )?$cCs�t�|�}|rl|��}t�|d���d}t|d�|t|d�t|d�t|d�t|d�f}t|�S|�	�}t
�d|d�}dgd	\}}}}}}	}
t�|�}|dk	r�|��\}}}}}}	}
ndSt
||||||	|
�S)
a�Returns time in seconds since epoch of time represented by a string.

    Return value is an integer.

    None is returned if the format of str is unrecognized, the time is outside
    the representable range, or the timezone string is not recognized.  If the
    string contains no timezone, UTC is assumed.

    The timezone in the string may be numerical (like "-0800" or "+0100") or a
    string timezone (like "UTC", "GMT", "BST" or "EST").  Currently, only the
    timezone strings equivalent to UTC (zero offset) are known to the function.

    The function loosely parses the following formats:

    Wed, 09 Feb 1994 22:23:32 GMT       -- HTTP format
    Tuesday, 08-Feb-94 14:15:29 GMT     -- old rfc850 HTTP format
    Tuesday, 08-Feb-1994 14:15:29 GMT   -- broken rfc850 HTTP format
    09 Feb 1994 22:23:32 GMT            -- HTTP format (no weekday)
    08-Feb-94 14:15:29 GMT              -- rfc850 format (no weekday)
    08-Feb-1994 14:15:29 GMT            -- broken rfc850 format (no weekday)

    The parser ignores leading and trailing whitespace.  The time may be
    absent.

    If the year is given with only 2 digits, the function will select the
    century that makes the year closest to the current date.

    rrr	r;���N�)�STRICT_DATE_REr@�groupsrIrJrKrA�floatr,�lstrip�
WEEKDAY_RE�sub�LOOSE_HTTP_DATE_RErT)�textrE�grQr&r0rRrSr*r+rCrrr�	http2time�s$



�
rba�^
    (\d{4})              # year
       [-\/]?
    (\d\d?)              # numerical month
       [-\/]?
    (\d\d?)              # day
   (?:
         (?:\s+|[-:Tt])  # separator before clock
      (\d\d?):?(\d\d)    # hour:min
      (?::?(\d\d(?:\.\d*)?))?  # optional seconds (and fractional)
   )?                    # optional clock
      \s*
   (?:
      ([-+]?\d\d?:?(:?\d\d)?
       |Z|z)             # timezone  (Z is "zero meridian", i.e. GMT)
      \s*
   )?$c
Csd|��}dgd\}}}}}}}t�|�}|dk	rL|��\}}}}}}}}	ndSt|||||||�S)av
    As for http2time, but parses the ISO 8601 formats:

    1994-02-03 14:15:29 -0100    -- ISO 8601 format
    1994-02-03 14:15:29          -- zone is optional
    1994-02-03                   -- only date
    1994-02-03T14:15:29          -- Use T as separator
    19940203T141529Z             -- ISO 8601 compact format
    19940203                     -- only date

    NrX)r\�ISO_DATE_REr@rZrT)
r`r0rQrRrSr*r+rCrE�_rrr�iso2time+s

recCs*|�d�\}}|jd|�|j|d�S)z)Return unmatched part of re.Match object.r	N)�span�string)�match�start�endrrr�	unmatchedLsrkz^\s*([^=\s;,]+)z&^\s*=\s*\"([^\"\\]*(?:\\.[^\"\\]*)*)\"z^\s*=\s*([^\s;,]*)z\\(.)c
Csg}|D]�}|}g}|r�t�|�}|r�t|�}|�d�}t�|�}|rft|�}|�d�}t�d|�}n.t�|�}|r�t|�}|�d�}|��}nd}|�	||f�q|�
��d�r�|�
�dd�}|r�|�	|�g}qt�
dd|�\}}	|}q|r|�	|�q|S)amParse header values into a list of lists containing key,value pairs.

    The function knows how to deal with ",", ";" and "=" as well as quoted
    values after "=".  A list of space separated tokens are parsed as if they
    were separated by ";".

    If the header_values passed as argument contains multiple values, then they
    are treated as if they were a single value separated by comma ",".

    This means that this function is useful for parsing header fields that
    follow this syntax (BNF as from the HTTP/1.1 specification, but we relax
    the requirement for tokens).

      headers           = #header
      header            = (token | parameter) *( [";"] (token | parameter))

      token             = 1*<any CHAR except CTLs or separators>
      separators        = "(" | ")" | "<" | ">" | "@"
                        | "," | ";" | ":" | "\" | <">
                        | "/" | "[" | "]" | "?" | "="
                        | "{" | "}" | SP | HT

      quoted-string     = ( <"> *(qdtext | quoted-pair ) <"> )
      qdtext            = <any TEXT except <">>
      quoted-pair       = "\" CHAR

      parameter         = attribute "=" value
      attribute         = token
      value             = token | quoted-string

    Each header is represented by a list of key/value pairs.  The value for a
    simple token (not part of a parameter) is None.  Syntactically incorrect
    headers will not necessarily be parsed as you would want.

    This is easier to describe with some examples:

    >>> split_header_words(['foo="bar"; port="80,81"; discard, bar=baz'])
    [[('foo', 'bar'), ('port', '80,81'), ('discard', None)], [('bar', 'baz')]]
    >>> split_header_words(['text/html; charset="iso-8859-1"'])
    [[('text/html', None), ('charset', 'iso-8859-1')]]
    >>> split_header_words([r'Basic realm="\"foo\bar\""'])
    [[('Basic', None), ('realm', '"foobar"')]]

    rz\1N�,z^[=\s;]*rW)�HEADER_TOKEN_REr@rkrB�HEADER_QUOTED_VALUE_RE�HEADER_ESCAPE_REr^�HEADER_VALUE_RE�rstrip�appendr\�
startswith�re�subn)
Z
header_values�resultr`Z	orig_text�pairsrE�name�valueZnon_junkZ
nr_junk_charsrrr�split_header_wordsUs>.







rz�([\"\\])cCs|g}|D]h}g}|D]F\}}|dk	rPt�d|�sDt�d|�}d|}d||f}|�|�q|r|�d�|��qd�|�S)a�Do the inverse (almost) of the conversion done by split_header_words.

    Takes a list of lists of (key, value) pairs and produces a single header
    value.  Attribute values are quoted if needed.

    >>> join_header_words([[("text/plain", None), ("charset", "iso-8859-1")]])
    'text/plain; charset="iso-8859-1"'
    >>> join_header_words([[("text/plain", None)], [("charset", "iso-8859-1")]])
    'text/plain, charset="iso-8859-1"'

    Nz^\w+$�\\\1z"%s"�%s=%s�; �, )rtr@�HEADER_JOIN_ESCAPE_REr^rr�join)Zlists�headersrw�attr�k�vrrr�join_header_words�sr�cCs0|�d�r|dd�}|�d�r,|dd�}|S)N�"r���)rs�endswith�r`rrr�strip_quotes�s


r�cCs�d}g}|D]�}g}d}t|�d��D]�\}}|��}|�d�\}}	}
|��}|sb|dkr&q�nq&|	rn|
��nd}
|dkr�|��}||kr�|}|dkr�|
dk	r�t|
�}
d}n|d	kr�|
dk	r�tt|
��}
|�||
f�q&|r|s�|�d
�|�|�q|S)a5Ad-hoc parser for Netscape protocol cookie-attributes.

    The old Netscape cookie format for Set-Cookie can for instance contain
    an unquoted "," in the expires field, so we have to use this ad-hoc
    parser instead of split_header_words.

    XXX This may not make the best possible effort to parse all the crap
    that Netscape Cookie headers contain.  Ronald Tschalar's HTTPClient
    parser is probably better, so could do worse than following that if
    this ever gives any trouble.

    Currently, this is also used for parsing RFC 2109 cookies.

    )�expires�domain�path�secure�version�port�max-ageF�;�=r	Nr�Tr�)r��0)�	enumerate�split�strip�	partitionrKr�rbrr)Z
ns_headersZknown_attrsrvZ	ns_headerrw�version_setZiiZparam�key�sep�val�lcrrr�parse_ns_headers�s>
r�z\.\d+$cCs:t�|�rdS|dkrdS|ddks2|ddkr6dSdS)z*Return True if text is a host domain name.FrWr	�.r�T��IPV4_REr@r�rrr�is_HDNs
r�cCsl|��}|��}||krdSt|�s(dS|�|�}|dksB|dkrFdS|�d�sTdSt|dd��shdSdS)a�Return True if domain A domain-matches domain B, according to RFC 2965.

    A and B may be host domain names or IP addresses.

    RFC 2965, section 1:

    Host names can be specified either as an IP address or a HDN string.
    Sometimes we compare one host name with another.  (Such comparisons SHALL
    be case-insensitive.)  Host A's name domain-matches host B's if

         *  their host name strings string-compare equal; or

         * A is a HDN string and has the form NB, where N is a non-empty
            name string, B has the form .B', and B' is a HDN string.  (So,
            x.y.com domain-matches .Y.com but not Y.com.)

    Note that domain-match is not a commutative operation: a.b.c.com
    domain-matches .c.com, but not the reverse.

    TFr�r	r�rN)rKr��rfindrs)�A�B�irrr�domain_matchs

r�cCst�|�rdSdS)zdReturn True if text is a sort-of-like a host domain name.

    For accepting/blocking domains.

    FTr�r�rrr�liberal_is_HDNFs
r�cCs`|��}|��}t|�r t|�s0||kr,dSdS|�d�}|rL|�|�rLdS|s\||kr\dSdS)z\For blocking/accepting domains.

    A and B may be host domain names or IP addresses.

    TFr�)rKr�rsr�)r�r��initial_dotrrr�user_domain_matchPs
r�z:\d+$cCsB|��}tj�|�d}|dkr,|�dd�}t�d|d�}|��S)z�Return request-host, as defined by RFC 2965.

    Variation from RFC: returned value is lowercased, for convenient
    comparison.

    rrWZHost)�get_full_url�urllib�parseZurlparseZ
get_header�cut_port_rer^rK)�request�url�hostrrr�request_hostesr�cCs4t|�}}|�d�dkr,t�|�s,|d}||fS)zzReturn a tuple (request-host, effective request-host name).

    As defined by RFC 2965, except both are lowercased.

    r�r��.local)r��findr�r@)r��erhn�req_hostrrr�eff_request_hostusr�cCs4|��}tj�|�}t|j�}|�d�s0d|}|S)z6Path component of request-URI, as defined by RFC 2965.�/)r�r�r�Zurlsplit�escape_pathr�rs)r�r��partsr�rrr�request_path�s

r�cCs`|j}|�d�}|dkrX||dd�}zt|�Wq\tk
rTtd|�YdSXnt}|S)N�:r	rznonnumeric port: '%s')r�r�rArLr�DEFAULT_HTTP_PORT)r�r�r�r�rrr�request_port�s


r�z%/;:@&=+$,!~*'()z%([0-9a-fA-F][0-9a-fA-F])cCsd|�d���S)Nz%%%sr)rBrP)rhrrr�uppercase_escaped_char�sr�cCstj�|t�}t�t|�}|S)zEEscape any invalid characters in HTTP URL, and uppercase all escapes.)r�r�Zquote�HTTP_PATH_SAFE�ESCAPED_CHAR_REr^r�)r�rrrr��s
r�cCsP|�d�}|dkrL||dd�}|�d�}t|�rL|dksD|dkrLd|S|S)aBReturn reach of host h, as defined by RFC 2965, section 1.

    The reach R of a host name H is defined as follows:

       *  If

          -  H is the host domain name of a host; and,

          -  H has the form A.B; and

          -  A has no embedded (that is, interior) dots; and

          -  B has at least one embedded dot, or B is the string "local".
             then the reach of H is .B.

       *  Otherwise, the reach of H is H.

    >>> reach("www.acme.com")
    '.acme.com'
    >>> reach("acme.com")
    'acme.com'
    >>> reach("acme.local")
    '.local'

    r�r	rNZlocal)r�r�)�hr��brrr�reach�s

r�cCs$t|�}t|t|j��sdSdSdS)z�

    RFC 2965, section 3.3.6:

        An unverifiable transaction is to a third-party host if its request-
        host U does not domain-match the reach R of the request-host O in the
        origin transaction.

    TFN)r�r�r�Zorigin_req_host)r�r�rrr�is_third_party�s
r�c@sNeZdZdZddd�Zdd�Zddd	�Zd
d�Zddd
�Zdd�Z	dd�Z
dS)ra�HTTP Cookie.

    This class represents both Netscape and RFC 2965 cookies.

    This is deliberately a very simple class.  It just holds attributes.  It's
    possible to construct Cookie instances that don't comply with the cookie
    standards.  CookieJar.make_cookies is the factory function for Cookie
    objects -- it deals with cookie parsing, supplying defaults, and
    normalising to the representation used in this class.  CookiePolicy is
    responsible for checking them to see whether they should be accepted from
    and returned to the server.

    Note that the port may be present in the headers, but unspecified ("Port"
    rather than"Port=80", for example); if this is the case, port is None.

    FcCs�|dk	rt|�}|dk	r$tt|��}|dkr<|dkr<td��||_||_||_||_||_|��|_	||_
||_|	|_|
|_
||_||_|
|_||_||_||_t�|�|_dS)NTz-if port is None, port_specified must be false)rAr[rLr�rxryr��port_specifiedrKr��domain_specified�domain_initial_dotr��path_specifiedr�r��discard�comment�comment_url�rfc2109�copy�_rest)�selfr�rxryr�r�r�r�r�r�r�r�r�r�r�r��restr�rrr�__init__�s.

zCookie.__init__cCs
||jkS�N�r�)r�rxrrr�has_nonstandard_attrszCookie.has_nonstandard_attrNcCs|j�||�Sr�)r��get)r�rx�defaultrrr�get_nonstandard_attrszCookie.get_nonstandard_attrcCs||j|<dSr�r�)r�rxryrrr�set_nonstandard_attr szCookie.set_nonstandard_attrcCs,|dkrt��}|jdk	r(|j|kr(dSdS�NTF)rMr�)r��nowrrr�
is_expired#s
zCookie.is_expiredcCsX|jdkrd}n
d|j}|j||j}|jdk	rFd|j|jf}n|j}d||fS)NrWr�r}z<Cookie %s for %s>)r�r�r�ryrx)r��p�limitZ	namevaluerrr�__str__)s


zCookie.__str__cCslg}dD]$}t||�}|�d|t|�f�q|�dt|j��|�dt|j��d|jjd�|�fS)N)r�rxryr�r�r�r�r�r�r�r�r�r�r�r�r}zrest=%sz
rfc2109=%sz%s(%s)r)�getattrrr�reprr�r��	__class__�__name__r�)r�rrxr�rrr�__repr__3s
zCookie.__repr__)F)N)N)r��
__module__�__qualname__�__doc__r�r�r�r�r�r�r�rrrrr�s�
*


c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)ra Defines which cookies get accepted from and returned to server.

    May also modify cookies, though this is probably a bad idea.

    The subclass DefaultCookiePolicy defines the standard rules for Netscape
    and RFC 2965 cookies -- override that if you want a customized policy.

    cCs
t��dS)z�Return true if (and only if) cookie should be accepted from server.

        Currently, pre-expired cookies never get this far -- the CookieJar
        class deletes such cookies itself.

        N��NotImplementedError�r��cookier�rrr�set_okKszCookiePolicy.set_okcCs
t��dS)zAReturn true if (and only if) cookie should be returned to server.Nr�r�rrr�	return_okTszCookiePolicy.return_okcCsdS)zMReturn false if cookies should not be returned, given cookie domain.
        Tr)r�r�r�rrr�domain_return_okXszCookiePolicy.domain_return_okcCsdS)zKReturn false if cookies should not be returned, given cookie path.
        Tr)r�r�r�rrr�path_return_ok]szCookiePolicy.path_return_okN)r�r�r�r�r�r�r�r�rrrrrBs
	c
@s�eZdZdZdZdZdZdZeeBZdddddddddeddd	f
d
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�ZdS)8rzBImplements the standard rules for accepting and returning cookies.rrrUr	NTF)ZhttpsZwsscCsv||_||_||_||_||_||_|	|_|
|_||_||_	|
|_
|dk	rVt|�|_nd|_|dk	rlt|�}||_
dS)zAConstructor arguments should be passed as keyword arguments only.Nr)�netscape�rfc2965�rfc2109_as_netscape�hide_cookie2�
strict_domain�strict_rfc2965_unverifiable�strict_ns_unverifiable�strict_ns_domain�strict_ns_set_initial_dollar�strict_ns_set_path�secure_protocols�tuple�_blocked_domains�_allowed_domains)r��blocked_domains�allowed_domainsr�r�r�r�r�r�r�r�r�r�r�rrrr�ms"zDefaultCookiePolicy.__init__cCs|jS)z4Return the sequence of blocked domains (as a tuple).)r��r�rrrr��sz#DefaultCookiePolicy.blocked_domainscCst|�|_dS)z$Set the sequence of blocked domains.N)r�r�)r�r�rrr�set_blocked_domains�sz'DefaultCookiePolicy.set_blocked_domainscCs |jD]}t||�rdSqdSr�)r�r�)r�r�Zblocked_domainrrr�
is_blocked�s

zDefaultCookiePolicy.is_blockedcCs|jS)z=Return None, or the sequence of allowed domains (as a tuple).)r�rrrrr�sz#DefaultCookiePolicy.allowed_domainscCs|dk	rt|�}||_dS)z-Set the sequence of allowed domains, or None.N)r�r�)r�rrrr�set_allowed_domains�sz'DefaultCookiePolicy.set_allowed_domainscCs.|jdkrdS|jD]}t||�rdSqdS)NFT)r�r�)r�r�Zallowed_domainrrr�is_not_allowed�s


z"DefaultCookiePolicy.is_not_allowedcCs@td|j|j�dD]&}d|}t||�}|||�sdSqdS)z�
        If you override .set_ok(), be sure to call this method.  If it returns
        false, so should your subclass (assuming your subclass wants to be more
        strict about which cookies to accept).

        � - checking cookie %s=%s)r��
verifiabilityrxr�r�r�Zset_ok_FT�rrxryr��r�r�r��nZfn_name�fnrrrr��s

zDefaultCookiePolicy.set_okcCsZ|jdkrtd|j|j�dS|jdkr:|js:td�dS|jdkrV|jsVtd�dSdS)Nz0   Set-Cookie2 without version attribute (%s=%s)Fr	�$   RFC 2965 cookies are switched off�$   Netscape cookies are switched offT)r�rrxryr�r�r�rrr�set_ok_version�s
�z"DefaultCookiePolicy.set_ok_versioncCsJ|jrFt|�rF|jdkr*|jr*td�dS|jdkrF|jrFtd�dSdS�Nr	z>   third-party RFC 2965 cookie during unverifiable transactionFz>   third-party Netscape cookie during unverifiable transactionT�Zunverifiabler�r�r�rr�r�rrr�set_ok_verifiability�sz(DefaultCookiePolicy.set_ok_verifiabilitycCs0|jdkr,|jr,|j�d�r,td|j�dSdS)Nr	�$z'   illegal name (starts with '$'): '%s'FT)r�r�rxrsrr�rrr�set_ok_name�s
�zDefaultCookiePolicy.set_ok_namecCsL|jrHt|�}|jdks(|jdkrH|jrH|�|j|�sHtd|j|�dSdS)Nr	z7   path attribute %s is not a prefix of request path %sFT)r�r�r�r�r�r�r)r�r�r��req_pathrrr�set_ok_path�s
����zDefaultCookiePolicy.set_ok_pathc
Cs�|�|j�rtd|j�dS|�|j�r8td|j�dS|j�r�t|�\}}|j}|jr�|�d�dkr�|�d�}|�dd|�}|dkr�||dd�}||d|�}	|	�	�dkr�t
|�dkr�td	|�dS|�d�r�|dd�}
n|}
|
�d�dk}|�s|d
k�rtd|�dS|j
dk�rX|�|��sX|�d��sXd|�|��sXtd||�dS|j
dk�sr|j|j@�r�t||��s�td
||�dS|j
dk�s�|j|j@�r�|dt
|��}|�d�dk�r�t�|��s�td||�dSdS)N�"   domain %s is in user block-listF�&   domain %s is not in user allow-listr�rr	r)�coZacZcomZeduZorgZnetZgovZmilrAZaeroZbiz�catZcoop�infoZjobsZmobiZmuseumrxZproZtravelZeuz&   country-code second level domain %sr�z/   non-local domain %s contains no embedded dotzO   effective request-host %s (even with added initial dot) does not end with %sz5   effective request-host %s does not domain-match %sz.   host prefix %s for domain %s contains a dotT)rr�rrr�r�r��countr�rK�lenrsr�r�r�r��DomainRFC2965Matchr��DomainStrictNoDotsr�r@)
r�r�r�r�r�r�r��jZtldZsldZundotted_domainZ
embedded_dotsZhost_prefixrrr�
set_ok_domain�s|

�

����
��
���z!DefaultCookiePolicy.set_ok_domainc	Cs�|jr�t|�}|dkrd}nt|�}|j�d�D]@}zt|�Wn"tk
rbtd|�YdSX||kr0q�q0td||j�dSdS)N�80rlz   bad port %s (not numeric)Fz$   request port (%s) not found in %sT)r�r��strr�r�rArLr�r�r�r�Zreq_portr�rrr�set_ok_port+s&

�zDefaultCookiePolicy.set_ok_portcCs@td|j|j�dD]&}d|}t||�}|||�sdSqdS)z�
        If you override .return_ok(), be sure to call this method.  If it
        returns false, so should your subclass (assuming your subclass wants to
        be more strict about which cookies to return).

        r)r�rr�r�r�r�Z
return_ok_FTrr	rrrr�@s	

zDefaultCookiePolicy.return_okcCs<|jdkr|jstd�dS|jdkr8|js8td�dSdS)Nr	rFr
T)r�r�rr�r�rrr�return_ok_versionRsz%DefaultCookiePolicy.return_ok_versioncCsJ|jrFt|�rF|jdkr*|jr*td�dS|jdkrF|jrFtd�dSdSrrr�rrr�return_ok_verifiability[sz+DefaultCookiePolicy.return_ok_verifiabilitycCs"|jr|j|jkrtd�dSdS)Nz(   secure cookie with non-secure requestFT)r��typer�rr�rrr�return_ok_securegsz$DefaultCookiePolicy.return_ok_securecCs|�|j�rtd�dSdS)Nz   cookie expiredFT)r��_nowrr�rrr�return_ok_expiresmsz%DefaultCookiePolicy.return_ok_expirescCsN|jrJt|�}|dkrd}|j�d�D]}||kr&qJq&td||j�dSdS)Nr!rlz0   request port %s does not match cookie port %sFT)r�r�r�rr#rrr�return_ok_portss�z"DefaultCookiePolicy.return_ok_portcCs�t|�\}}|j}|r*|�d�s*d|}n|}|jdkr^|j|j@r^|js^||kr^td�dS|jdkr�t||�s�td||�dS|jdkr�d|�	|�s�td||�dSdS)Nr�r	zQ   cookie with unspecified domain does not string-compare equal to request domainFzQ   effective request-host name %s does not domain-match RFC 2965 cookie domain %sz;   request-host %s does not match Netscape cookie domain %sT)
r�r�rsr�r��DomainStrictNonDomainr�rr�r�)r�r�r�r�r�r��	dotdomainrrr�return_ok_domain�s6


�����z$DefaultCookiePolicy.return_ok_domaincCs�t|�\}}|�d�sd|}|�d�s0d|}|rH|�d�sHd|}n|}|�|�sd|�|�sddS|�|�r|td|�dS|�|�r�td|�dSdS)Nr�FrrT)r�rsr�rrr)r�r�r�r�r�r-rrrr��s"






z$DefaultCookiePolicy.domain_return_okcCsbtd|�t|�}t|�}||kr&dS|�|�rR|�d�sN|||d�dkrRdStd||�dS)Nz- checking cookie path=%sTr�rz  %s does not path-match %sF)rr�rrsr�)r�r�r�rZpathlenrrrr��s

��z"DefaultCookiePolicy.path_return_ok) r�r�r�r�rr,rZ
DomainLiberalZDomainStrictr�r�rrrrrr�rrrrr r$r�r%r&r(r*r+r.r�r�rrrrrcsT�
#	;	cCst|���}t|j|�Sr�)�sorted�keys�mapr�)Zadictr0rrr�vals_sorted_by_key�sr2c	csVt|�}|D]D}d}z
|jWntk
r2YnXd}t|�EdH|s|VqdS)zBIterates over nested mapping, depth-first, in sorted order by key.FTN)r2�items�AttributeError�
deepvalues)�mapping�values�objrrrr5�s
r5c@seZdZdS)�AbsentN�r�r�r�rrrrr9�sr9c@s�eZdZdZe�d�Ze�d�Ze�d�Ze�d�Z	e�d�Z
e�dej�Zd3d	d
�Z
dd�Zd
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd4d%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Z d1d2�Z!dS)5rz�Collection of HTTP cookies.

    You may not need to know about this class: try
    urllib.request.build_opener(HTTPCookieProcessor).open(url).
    z\Wr{z\.?[^.]*z[^.]*z^\.+z^\#LWP-Cookies-(\d+\.\d+)NcCs(|dkrt�}||_t��|_i|_dSr�)r�_policy�
_threading�RLock�
_cookies_lock�_cookies�r��policyrrrr��s

zCookieJar.__init__cCs
||_dSr�)r;r@rrr�
set_policy�szCookieJar.set_policycCs�g}|j�||�sgStd|�|j|}|��D]T}|j�||�sFq2||}|��D].}|j�||�srtd�qVtd�|�|�qVq2|S)Nz!Checking %s for cookies to returnz   not returning cookiez   it's a match)	r;r�rr?r0r�r7r�rr)r�r�r��cookiesZcookies_by_pathr�Zcookies_by_namer�rrr�_cookies_for_domain�s 

zCookieJar._cookies_for_domaincCs*g}|j��D]}|�|�||��q|S)z2Return a list of cookies to be returned to server.)r?r0�extendrD)r�r�rCr�rrr�_cookies_for_requestszCookieJar._cookies_for_requestc	Cs<|jdd�dd�d}g}|D�]}|j}|sHd}|dkrH|�d|�|jdk	rz|j�|j�rz|dkrz|j�d	|j�}n|j}|jdkr�|�|j�n|�d
|j|f�|dkr|j	r�|�d|j
�|j�d��r|j}|j
s�|�d�r�|d
d�}|�d|�|jdk	rd}|j�r,|d|j}|�|�q|S)z�Return a list of cookie-attributes to be returned to server.

        like ['foo="bar"; $Path="/"', ...]

        The $Version attribute is also added when appropriate (currently only
        once per request).

        cSs
t|j�Sr�)rr�)�arrr�<lambda>�z)CookieJar._cookie_attrs.<locals>.<lambda>T)r��reverseFr	z$Version=%sNr|r}z
$Path="%s"r�rz$Domain="%s"z$Portz="%s")�sortr�rrry�non_word_rer@�quote_rer^rxr�r�r�rsr�r�r�)	r�rCr��attrsr�r�ryr�r�rrr�
_cookie_attrssF


��
�
zCookieJar._cookie_attrscCs�td�|j��z�tt���|j_|_|�|�}|�	|�}|r^|�
d�s^|�dd�|��|jj
r�|jjs�|�
d�s�|D]}|jdkr||�dd�q�q|W5|j��X|��dS)z�Add correct Cookie: header to request (urllib.request.Request object).

        The Cookie2 header is also added unless policy.hide_cookie2 is true.

        �add_cookie_headerrr~ZCookie2rz$Version="1"N)rr>�acquire�releaserArMr;r)rFrOZ
has_headerZadd_unredirected_headerr�r�r�r��clear_expired_cookies)r�r�rCrNr�rrrrPIs*



��

zCookieJar.add_cookie_headerc
Cs�g}d}d}|D�]z}|d\}}d}d}	i}
i}|dd�D�]0\}}
|��}||ks`||krd|}||krx|
dkrxd}
||
kr�q>|dkr�|
dkr�td	�d}	�qr|
��}
|d
kr�|r�q>|
dkr�td�q>|dk�r d}zt|
�}
Wn*tk
�rtd
�d}	Y�qrYnXd
}|j|
}
||k�s4||k�rh|
dk�r^|dk�r^td|�d}	�qr|
|
|<q>|
||<q>|	�rzq|�|||
|f�q|S)aReturn list of tuples containing normalised cookie information.

        attrs_set is the list of lists of key,value pairs extracted from
        the Set-Cookie or Set-Cookie2 headers.

        Tuples are name, value, standard, rest, where name and value are the
        cookie name and value, standard is a dictionary containing the standard
        cookie-attributes (discard, secure, version, expires or max-age,
        domain, path and port) and rest is a dictionary containing the rest of
        the cookie-attributes.

        )r�r�)r�r�r�r�r�r�r��
commenturlr	FrNTr�z%   missing value for domain attributer�zM   missing or invalid value for expires attribute: treating as session cookier�z?   missing or invalid (non-numeric) value for max-age attribute)r�r�rTz!   missing value for %s attribute)rKrrArLr)rr)r��	attrs_set�
cookie_tuples�
boolean_attrs�value_attrsZcookie_attrsrxryZmax_age_setZ
bad_cookie�standardr�r�r�r�rrr�_normalized_cookie_tuplesjsh





�

z#CookieJar._normalized_cookie_tuplescCs&|\}}}}|�dt�}|�dt�}|�dt�}	|�dt�}
|�dd�}|dk	rtzt|�}Wntk
rrYdSX|�dd�}|�dd�}
|�d	d�}|�d
d�}|tk	r�|dkr�d}t|�}nXd}t|�}|�d
�}|dk�r|dkr�|d|�}n|d|d�}t|�dk�rd
}|tk	}d}|�r:t|�	d��}|tk�rVt
|�\}}|}n|�	d��sjd|}d}|	tk	�r�|	dk�r�t|�}	nd}t�
dd|	�}	nd}	|
tk�r�d}
d}
nH|
|jk�rz|�|||�Wntk
�r�YnXtd|||�dSt||||	||||||||
|
|||�S)Nr�r�r�r�r�r�Fr�r�rTrWTr�r�r	rr�z\s+z2Expiring cookie, domain='%s', path='%s', name='%s')r�r9rArLr�r�r�r�boolrsr�r�rtr^r)�clear�KeyErrorrr)r��tupr�rxryrYr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr�_cookie_from_cookie_tuple�s�







��z#CookieJar._cookie_from_cookie_tuplecCs6|�|�}g}|D]}|�||�}|r|�|�q|Sr�)rZr_rr)r�rUr�rVrCr^r�rrr�_cookies_from_attrs_set's
z!CookieJar._cookies_from_attrs_setcCsHt|jdd�}|dkr |jj}|D]}|jdkr$d|_|r$d|_q$dS)Nr�rTr	)r�r;r�r�r�)r�rCZ
rfc2109_as_nsr�rrr�_process_rfc2109_cookies0s

z"CookieJar._process_rfc2109_cookiesc
Cs:|��}|�dg�}|�dg�}tt���|j_|_|jj}|jj}|sN|rf|sV|rf|s^|rf|sj|sjgSz|�t	|�|�}Wnt
k
r�t�g}YnX|�r6|�r6z|�t|�|�}	Wnt
k
r�t�g}	YnX|�
|	�|�r&i}
|D]}d|
|j|j|jf<q�|
fdd�}t||	�}	|	�r6|�|	�|S)zAReturn sequence of Cookie objects extracted from response object.zSet-Cookie2z
Set-CookieNcSs|j|j|jf}||kSr�)r�r�rx)Z	ns_cookie�lookupr�rrr�no_matching_rfc2965isz3CookieJar.make_cookies.<locals>.no_matching_rfc2965)rZget_allrArMr;r)r�r�r`rz�	Exceptionrr�rar�r�rx�filterrE)
r��responser�r�Zrfc2965_hdrsZns_hdrsr�r�rCZ
ns_cookiesrbr�rcrrr�make_cookies<s^�������
�



zCookieJar.make_cookiescCsN|j��z2tt���|j_|_|j�||�r:|�|�W5|j��XdS)z-Set a cookie if policy says it's OK to do so.N)	r>rQrRrArMr;r)r��
set_cookier�rrr�set_cookie_if_okss
zCookieJar.set_cookie_if_okcCsl|j}|j��zJ|j|kr&i||j<||j}|j|krDi||j<||j}|||j<W5|j��XdS)z?Set a cookie, without checking whether or not it should be set.N)r?r>rQrRr�r�rx)r�r��cZc2Zc3rrrrh�s






zCookieJar.set_cookiecCsbtd|���|j��z8|�||�D]&}|j�||�r&td|�|�|�q&W5|j��XdS)zAExtract cookies from response, where allowable given the request.zextract_cookies: %sz setting cookie: %sN)	rrr>rQrRrgr;r�rh)r�rfr�r�rrr�extract_cookies�s

zCookieJar.extract_cookiescCst|dk	r2|dks|dkr td��|j|||=n>|dk	rX|dkrJtd��|j||=n|dk	rj|j|=ni|_dS)a�Clear some cookies.

        Invoking this method without arguments will clear all cookies.  If
        given a single argument, only cookies belonging to that domain will be
        removed.  If given two arguments, cookies belonging to the specified
        path within that domain are removed.  If given three arguments, then
        the cookie with the specified name, path and domain is removed.

        Raises KeyError if no matching cookie exists.

        Nz8domain and path must be given to remove a cookie by namez.domain must be given to remove cookies by path)rLr?)r�r�r�rxrrrr\�s��
zCookieJar.clearcCsD|j��z(|D]}|jr|�|j|j|j�qW5|j��XdS)z�Discard all session cookies.

        Note that the .save() method won't save session cookies anyway, unless
        you ask otherwise by passing a true ignore_discard argument.

        N)r>rQrRr�r\r�r�rx)r�r�rrr�clear_session_cookies�s
zCookieJar.clear_session_cookiescCsP|j��z4t��}|D]"}|�|�r|�|j|j|j�qW5|j��XdS)a�Discard all expired cookies.

        You probably don't need to call this method: expired cookies are never
        sent back to the server (provided you're using DefaultCookiePolicy),
        this method is called by CookieJar itself every so often, and the
        .save() method won't save expired cookies anyway (unless you ask
        otherwise by passing a true ignore_expires argument).

        N)	r>rQrRrMr�r\r�r�rx)r�r�r�rrrrS�s


zCookieJar.clear_expired_cookiescCs
t|j�Sr�)r5r?rrrr�__iter__�szCookieJar.__iter__cCsd}|D]}|d}q|S)z#Return number of contained cookies.r	rr)r�r�r�rrr�__len__�s
zCookieJar.__len__cCs2g}|D]}|�t|��qd|jjd�|�fS�Nz<%s[%s]>r)rrr�r�r�r��r��rr�rrrr��szCookieJar.__repr__cCs2g}|D]}|�t|��qd|jjd�|�fSro)rrr"r�r�r�rprrrr��szCookieJar.__str__)N)NNN)"r�r�r�r�rt�compilerLrMZstrict_domain_reZ	domain_reZdots_re�ASCII�magic_rer�rBrDrFrOrPrZr_r`rargrirhrkr\rlrSrmrnr�r�rrrrr�s8





;!a\	7


c@seZdZdS)rNr:rrrrr�sc@s8eZdZdZddd�Zd
dd�Zddd	�Zdd
d�ZdS)rz6CookieJar that can be loaded from and saved to a file.NFcCs2t�||�|dk	rt�|�}||_t|�|_dS)z}
        Cookies are NOT loaded from the named file until either the .load() or
        .revert() method is called.

        N)rr��os�fspath�filenamer[�	delayload)r�rwrxrArrrr��s

zFileCookieJar.__init__cCs
t��dS)zSave cookies to a file.Nr�)r�rw�ignore_discard�ignore_expiresrrr�save�szFileCookieJar.savec	CsJ|dkr"|jdk	r|j}ntt��t|��}|�||||�W5QRXdS)zLoad cookies from a file.N)rwrL�MISSING_FILENAME_TEXT�open�_really_load�r�rwryrzrrrr�loads

zFileCookieJar.loadcCs�|dkr"|jdk	r|j}ntt��|j��zFt�|j�}i|_z|�	|||�Wnt
k
rn||_�YnXW5|j��XdS)z�Clear all cookies and reload cookies from a saved file.

        Raises LoadError (or OSError) if reversion is not successful; the
        object's state will not be altered if this happens.

        N)rwrLr|r>rQrRr�Zdeepcopyr?r��OSError)r�rwryrzZ	old_staterrr�revert	s

zFileCookieJar.revert)NFN)NFF)NFF)NFF)r�r�r�r�r�r{r�r�rrrrr�s


	�cCs |j|jfd|jfd|jfg}|jdk	r8|�d|jf�|jrH|�d�|jrX|�d�|jrh|�d�|j	rx|�d�|j
r�|�d	tt|j
��f�|j
r�|�d
�|jr�|�d|jf�|jr�|�d|jf�t|j���}|D]}|�|t|j|�f�q�|�d
t|j�f�t|g�S)z�Return string representation of Cookie in the LWP cookie file format.

    Actually, the format is extended a bit -- see module docstring.

    r�r�Nr�)�	path_specN)�	port_specN)�
domain_dotN)r�Nr�)r�Nr�rTr�)rxryr�r�r�rrr�r�r�r�r�r5r[r�r�r�r/r�r0r"r�r�)r�r�r0r�rrr�lwp_cookie_str$s:
�




�
r�c@s,eZdZdZddd�Zddd�Zd	d
�ZdS)
ra[
    The LWPCookieJar saves a sequence of "Set-Cookie3" lines.
    "Set-Cookie3" is the format used by the libwww-perl library, not known
    to be compatible with any browser, but which is easy to read and
    doesn't lose information about RFC 2965 cookies.

    Additional methods

    as_lwp_str(ignore_discard=True, ignore_expired=True)

    TcCsTt��}g}|D]2}|s |jr q|s0|�|�r0q|�dt|��qd�|dg�S)z�Return cookies as a string of "\n"-separated "Set-Cookie3" headers.

        ignore_discard and ignore_expires: see docstring for FileCookieJar.save

        zSet-Cookie3: %s�
rW)rMr�r�rrr�r�)r�ryrzr�rqr�rrr�
as_lwp_strMs
zLWPCookieJar.as_lwp_strNFc	CsX|dkr"|jdk	r|j}ntt��t|d��"}|�d�|�|�||��W5QRXdS)N�wz#LWP-Cookies-2.0
)rwrLr|r}�writer�rrrrr{]s

zLWPCookieJar.savecCs0|��}|j�|�s$d|}t|��t��}d}d}	d}
�z�|��}|dkrP�q�|�|�s\q<|t|�d���}t|g�D�]f}|d\}
}i}i}|	D]}d||<q�|dd�D]n\}}|dk	r�|�	�}nd}||
ks�||	kr�|}||	k�r|dkr�d	}|||<q�||
k�r|||<q�|||<q�|j
}|d
�}|d�}|dk	�rJt|�}|dk�rXd	}|d�}|�d
�}t|d�|
||d�|d�|||d�|d�|d�|d�|||d�|d�|�}|�s�|j
�r�qz|�s�|�|��r�qz|�|�qzq<WnBtk
�r�Yn,tk
�r*t�td||f��YnXdS)Nz5%r does not look like a Set-Cookie3 (LWP) format filezSet-Cookie3:)r�r�r�r�r�)r�r�r�r�r�r�rTrWr	FrTr�r�r�r�r�r�r�r�r�r�r�r�rTz&invalid Set-Cookie3 format file %r: %r)�readlinertr@rrMrsrr�rzrKr�rerr�r�rhr�rdr)r�rrwryrz�magicrr��headerrWrX�line�datarxryrYr�r�r�r�r�r�r�r�r�rjrrrr~is��










�
�zLWPCookieJar._really_load)TT)NFF)r�r�r�r�r�r{r~rrrrr@s

c@s0eZdZdZe�d�ZdZdd�Zd
dd	�Z	dS)ra�

    WARNING: you may want to backup your browser's cookies file if you use
    this class to save cookies.  I *think* it works, but there have been
    bugs in the past!

    This class differs from CookieJar only in the format it uses to save and
    load cookies to and from a file.  This class uses the Mozilla/Netscape
    `cookies.txt' format.  lynx uses this file format, too.

    Don't expect cookies saved while the browser is running to be noticed by
    the browser (in fact, Mozilla on unix will overwrite your saved cookies if
    you change them on disk while it's running; on Windows, you probably can't
    save at all while the browser is running).

    Note that the Mozilla/Netscape format will downgrade RFC2965 cookies to
    Netscape cookies on saving.

    In particular, the cookie version and port number information is lost,
    together with information about whether or not Path, Port and Discard were
    specified by the Set-Cookie2 (or Set-Cookie) header, and whether or not the
    domain as set in the HTTP header started with a dot (yes, I'm aware some
    domains in Netscape files start with a dot and some don't -- trust me, you
    really don't want to know any more about this).

    Note that though Mozilla and Netscape use the same format, they use
    slightly different headers.  The class saves cookies using the Netscape
    header by default (Mozilla can cope with that).

    z#( Netscape)? HTTP Cookie Filezr# Netscape HTTP Cookie File
# http://curl.haxx.se/rfc/cookie_spec.html
# This is a generated file!  Do not edit.

cCsbt��}|��}|j�|�s(td|��z�|��}|dkr>�q|�d�rT|dd�}|���d�s*|��dkrpq*|�d�\}}	}
}}}
}|dk}|	dk}	|
dkr�|}
d}|�d�}d	}|dkr�d}d
}t	d|
|dd	||	||
d	|||ddi�}|s�|j
r�q*|�s|�|��rq*|�|�q*WnBt
k
�r2�Yn,tk
�r\t�td||f��YnXdS)
Nz4%r does not look like a Netscape format cookies filerWr�r�)�#r�	�TRUEr�FTr	z+invalid Netscape format cookies file %r: %r)rMr�rtr@rr�r�rsr�rr�r�rhr�rdr)r�rrwryrzr�r�r�r�r�r�r�r�rxryr�r�rjrrrr~�sr��

��
�

�zMozillaCookieJar._really_loadNFc
Cs�|dkr"|jdk	r|j}ntt��t|d���}|�|j�t��}|D]�}|sV|jrVqF|sf|�|�rfqF|j	rrd}nd}|j
�d�r�d}nd}|jdk	r�t
|j�}	nd}	|jdkr�d}
|j}n|j}
|j}|�d�|j
||j||	|
|g�d�qFW5QRXdS)Nr�r�ZFALSEr�rWr�r�)rwrLr|r}r�r�rMr�r�r�r�rsr�r"ryrxr�r�)r�rwryrzrr�r�r�r�r�rxryrrrr{ sH



���zMozillaCookieJar.save)NFF)
r�r�r�r�rtrrrtr�r~r{rrrrr�s

A)N)N)Xr��__all__rur�r-rtrMZurllib.parser�Zurllib.requestZ	threadingr<Zhttp.clientZhttpZcalendarr
rrrr"ZclientZ	HTTP_PORTr�r|rr%r,r6r7rIr(rrrKr5r8r>rrrsr?rFrTrY�Ir]�Xr_rbrcrerkrmrnrprorzr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrr2r5r9rr�rrr�rrrrrr�<module>s��
�

8�
�
�8
�!



U
D'


#b!b7xhttp/__pycache__/server.cpython-38.pyc000064400000104101151153537450013677 0ustar00U

e5d��@s
dZdZdddddgZddlZddlZddlZddlZddlZ	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlZddlZddlZdd	lmZdd
l	mZdZdZGd
d�dej�ZGdd�deje�Z Gdd�dej!�Z"Gdd�de"�Z#dd�Z$da%dd�Z&dd�Z'Gdd�de#�Z(dd�Z)e"e dddfdd�Z*e+dk�rddl,Z,e,�-�Z.e.j/dd d!d"�e.j/d#d$d%d&d'�e.j/d(d)e
�0�d*d+�e.j/d,d-de1d.d/d0�e.�2�Z3e3j4�r�e(Z5nee#e3j6d1�Z5Gd2d3�d3e �Z7e*e5e7e3j8e3j9d4�dS)5a@HTTP server classes.

Note: BaseHTTPRequestHandler doesn't implement any HTTP request; see
SimpleHTTPRequestHandler for simple implementations of GET, HEAD and POST,
and CGIHTTPRequestHandler for CGI scripts.

It does, however, optionally implement HTTP/1.1 persistent connections,
as of version 0.3.

Notes on CGIHTTPRequestHandler
------------------------------

This class implements GET and POST requests to cgi-bin scripts.

If the os.fork() function is not present (e.g. on Windows),
subprocess.Popen() is used as a fallback, with slightly altered semantics.

In all cases, the implementation is intentionally naive -- all
requests are executed synchronously.

SECURITY WARNING: DON'T USE THIS CODE UNLESS YOU ARE INSIDE A FIREWALL
-- it may execute arbitrary Python code or external programs.

Note that status code 200 is sent prior to execution of a CGI script, so
scripts cannot send other status codes such as 302 (redirect).

XXX To do:

- log requests even later (to capture byte count)
- log user-agent header and other interesting goodies
- send error log to separate file
z0.6�
HTTPServer�ThreadingHTTPServer�BaseHTTPRequestHandler�SimpleHTTPRequestHandler�CGIHTTPRequestHandler�N)�partial)�
HTTPStatusa�<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
        <title>Error response</title>
    </head>
    <body>
        <h1>Error response</h1>
        <p>Error code: %(code)d</p>
        <p>Message: %(message)s.</p>
        <p>Error code explanation: %(code)s - %(explain)s.</p>
    </body>
</html>
ztext/html;charset=utf-8c@seZdZdZdd�ZdS)r�cCs4tj�|�|jdd�\}}t�|�|_||_dS)z.Override server_bind to store the server name.N�)�socketserver�	TCPServer�server_bindZserver_address�socketZgetfqdn�server_name�server_port)�self�host�port�r�#/usr/lib64/python3.8/http/server.pyr
�szHTTPServer.server_bindN)�__name__�
__module__�__qualname__Zallow_reuse_addressr
rrrrr�sc@seZdZdZdS)rTN)rrrZdaemon_threadsrrrrr�sc
@sJeZdZdZdej��dZdeZ	e
ZeZ
dZdd�Zdd	�Zd
d�Zdd
�ZdFdd�ZdGdd�ZdHdd�Zdd�Zdd�Zdd�ZdIdd�Zdd�Ze�d d!�e�ed"�ed#d$��D��Z d%e e!d&�<d'd(�Z"d)d*�Z#dJd+d,�Z$d-d.�Z%d/d0d1d2d3d4d5gZ&dd6d7d8d9d:d;d<d=d>d?d@dAg
Z'dBdC�Z(dDZ)e*j+j,Z-dEd!�e.j/�0�D�Z1dS)Kra�HTTP request handler base class.

    The following explanation of HTTP serves to guide you through the
    code as well as to expose any misunderstandings I may have about
    HTTP (so you don't need to read the code to figure out I'm wrong
    :-).

    HTTP (HyperText Transfer Protocol) is an extensible protocol on
    top of a reliable stream transport (e.g. TCP/IP).  The protocol
    recognizes three parts to a request:

    1. One line identifying the request type and path
    2. An optional set of RFC-822-style headers
    3. An optional data part

    The headers and data are separated by a blank line.

    The first line of the request has the form

    <command> <path> <version>

    where <command> is a (case-sensitive) keyword such as GET or POST,
    <path> is a string containing path information for the request,
    and <version> should be the string "HTTP/1.0" or "HTTP/1.1".
    <path> is encoded using the URL encoding scheme (using %xx to signify
    the ASCII character with hex code xx).

    The specification specifies that lines are separated by CRLF but
    for compatibility with the widest range of clients recommends
    servers also handle LF.  Similarly, whitespace in the request line
    is treated sensibly (allowing multiple spaces between components
    and allowing trailing whitespace).

    Similarly, for output, lines ought to be separated by CRLF pairs
    but most clients grok LF characters just fine.

    If the first line of the request has the form

    <command> <path>

    (i.e. <version> is left out) then this is assumed to be an HTTP
    0.9 request; this form has no optional headers and data part and
    the reply consists of just the data.

    The reply form of the HTTP 1.x protocol again has three parts:

    1. One line giving the response code
    2. An optional set of RFC-822-style headers
    3. The data

    Again, the headers and data are separated by a blank line.

    The response code line has the form

    <version> <responsecode> <responsestring>

    where <version> is the protocol version ("HTTP/1.0" or "HTTP/1.1"),
    <responsecode> is a 3-digit response code indicating success or
    failure of the request, and <responsestring> is an optional
    human-readable string explaining what the response code means.

    This server parses the request and the headers, and then calls a
    function specific to the request type (<command>).  Specifically,
    a request SPAM will be handled by a method do_SPAM().  If no
    such method exists the server sends an error response to the
    client.  If it exists, it is called with no arguments:

    do_SPAM()

    Note that the request name is case sensitive (i.e. SPAM and spam
    are different requests).

    The various request details are stored in instance variables:

    - client_address is the client IP address in the form (host,
    port);

    - command, path and version are the broken-down request line;

    - headers is an instance of email.message.Message (or a derived
    class) containing the header information;

    - rfile is a file object open for reading positioned at the
    start of the optional input data part;

    - wfile is a file object open for writing.

    IT IS IMPORTANT TO ADHERE TO THE PROTOCOL FOR WRITING!

    The first thing to be written must be the response line.  Then
    follow 0 or more header lines, then a blank line, and then the
    actual data (if any).  The meaning of the header lines depends on
    the command executed by the server; in most cases, when data is
    returned, there should be at least one header line of the form

    Content-type: <type>/<subtype>

    where <type> and <subtype> should be registered MIME types,
    e.g. "text/html" or "text/plain".

    zPython/rz	BaseHTTP/�HTTP/0.9c
Cs�d|_|j|_}d|_t|jd�}|�d�}||_|��}t	|�dkrLdSt	|�dk�r&|d}zT|�
d	�srt�|�d
d�d}|�d�}t	|�d
kr�t�t|d�t|d�f}Wn,tt
fk
r�|�tjd|�YdSX|dk�r|jdk�rd|_|dk�r |�tjd|�dS||_d
t	|�k�rBdk�sZn|�tjd|�dS|dd
�\}}t	|�d
k�r�d|_|dk�r�|�tjd|�dS|||_|_|j�
d��r�d
|j�d
�|_ztjj|j|jd�|_Wn�tjjk
�r(}z|�tjdt|��WY�dSd}~XYnBtjjk
�rh}z|�tjdt|��WY�dSd}~XYnX|j�dd�}	|	��dk�r�d|_n |	��dk�r�|jdk�r�d|_|j�dd�}
|
��dk�r�|jdk�r�|jdk�r�|� ��s�dSdS) aHParse a request (internal).

        The request should be stored in self.raw_requestline; the results
        are in self.command, self.path, self.request_version and
        self.headers.

        Return True for success, False for failure; on failure, any relevant
        error response has already been sent back.

        NTz
iso-8859-1z
rF����zHTTP/�/r	�.r
zBad request version (%r))r	r	zHTTP/1.1)r
rzInvalid HTTP version (%s)zBad request syntax (%r)ZGETzBad HTTP/0.9 request type (%r)z//)Z_classz
Line too longzToo many headers�
Connection��close�
keep-aliveZExpectz100-continue)!�command�default_request_version�request_version�close_connection�str�raw_requestline�rstrip�requestline�split�len�
startswith�
ValueError�int�
IndexError�
send_errorrZBAD_REQUEST�protocol_versionZHTTP_VERSION_NOT_SUPPORTED�path�lstrip�http�clientZ
parse_headers�rfile�MessageClass�headersZLineTooLongZREQUEST_HEADER_FIELDS_TOO_LARGEZ
HTTPException�get�lower�handle_expect_100)r�versionr)�wordsZbase_version_numberZversion_numberr"r2�errZconntypeZexpectrrr�
parse_requests�


�
��
�
������
z$BaseHTTPRequestHandler.parse_requestcCs|�tj�|��dS)a7Decide what to do with an "Expect: 100-continue" header.

        If the client is expecting a 100 Continue response, we must
        respond with either a 100 Continue or a final response before
        waiting for the request body. The default is to always respond
        with a 100 Continue. You can behave differently (for example,
        reject unauthorized requests) by overriding this method.

        This method should either return True (possibly after sending
        a 100 Continue response) or send an error response and return
        False.

        T)�send_response_onlyrZCONTINUE�end_headers�rrrrr;xsz(BaseHTTPRequestHandler.handle_expect_100c
Cs�z�|j�d�|_t|j�dkrBd|_d|_d|_|�tj	�WdS|jsTd|_
WdS|��sbWdSd|j}t||�s�|�tj
d|j�WdSt||�}|�|j��Wn<tjk
r�}z|�d|�d|_
WY�dSd}~XYnXdS)	z�Handle a single HTTP request.

        You normally don't need to override this method; see the class
        __doc__ string for information on how to handle specific HTTP
        commands such as GET and POST.

        iirNTZdo_zUnsupported method (%r)zRequest timed out: %r)r6�readliner'r+r)r$r"r0rZREQUEST_URI_TOO_LONGr%r?�hasattr�NOT_IMPLEMENTED�getattr�wfile�flushrZtimeout�	log_error)rZmname�method�errr�handle_one_request�s6

�
z)BaseHTTPRequestHandler.handle_one_requestcCs"d|_|��|js|��qdS)z&Handle multiple requests if necessary.TN)r%rLrBrrr�handle�szBaseHTTPRequestHandler.handleNcCsz|j|\}}Wntk
r.d\}}YnX|dkr<|}|dkrH|}|�d||�|�||�|�dd�d}|dkr�|tjtjtjfkr�|j	|t
j|dd�t
j|dd�d	�}|�d
d�}|�d|j
�|�d
tt|���|��|jdk�r|�r|j�|�dS)akSend and log an error reply.

        Arguments are
        * code:    an HTTP error code
                   3 digits
        * message: a simple optional 1 line reason phrase.
                   *( HTAB / SP / VCHAR / %x80-FF )
                   defaults to short entry matching the response code
        * explain: a detailed message defaults to the long entry
                   matching the response code.

        This sends an error response (so it must be called before any
        output has been generated), logs the error, and finally sends
        a piece of HTML explaining the error to the user.

        )�???rNNzcode %d, message %srr ��F��quote)�code�message�explainzUTF-8�replacezContent-Type�Content-LengthZHEAD)�	responses�KeyErrorrI�
send_response�send_headerrZ
NO_CONTENTZ
RESET_CONTENT�NOT_MODIFIED�error_message_format�html�escape�encode�error_content_typer&r+rAr"rG�write)rrRrSrTZshortmsgZlongmsgZbodyZcontentrrrr0�s:���z!BaseHTTPRequestHandler.send_errorcCs:|�|�|�||�|�d|���|�d|���dS)z�Add the response header to the headers buffer and log the
        response code.

        Also send two standard headers with the server software
        version and the current date.

        ZServerZDateN)�log_requestr@rZ�version_string�date_time_string�rrRrSrrrrY�s
z$BaseHTTPRequestHandler.send_responsecCsd|jdkr`|dkr0||jkr,|j|d}nd}t|d�s@g|_|j�d|j||f�dd��dS)	zSend the response header only.rNrr�_headers_bufferz
%s %d %s
�latin-1�strict)r$rWrDrf�appendr1r_rerrrr@�s



��z)BaseHTTPRequestHandler.send_response_onlycCsl|jdkr6t|d�sg|_|j�d||f�dd��|��dkrh|��dkrVd|_n|��d	krhd
|_dS)z)Send a MIME header to the headers buffer.rrfz%s: %s
rgrhZ
connectionr Tr!FN)r$rDrfrir_r:r%)r�keyword�valuerrrrZs

�z"BaseHTTPRequestHandler.send_headercCs"|jdkr|j�d�|��dS)z,Send the blank line ending the MIME headers.rs
N)r$rfri�
flush_headersrBrrrrAs
z"BaseHTTPRequestHandler.end_headerscCs(t|d�r$|j�d�|j��g|_dS)Nrf�)rDrGra�joinrfrBrrrrls
z$BaseHTTPRequestHandler.flush_headers�-cCs.t|t�r|j}|�d|jt|�t|��dS)zNLog an accepted request.

        This is called by send_response().

        z
"%s" %s %sN)�
isinstancerrk�log_messager)r&)rrR�sizerrrrb s
�z"BaseHTTPRequestHandler.log_requestcGs|j|f|��dS)z�Log an error.

        This is called when a request cannot be fulfilled.  By
        default it passes the message on to log_message().

        Arguments are the same as for log_message().

        XXX This should go to the separate error log.

        N)rq)r�format�argsrrrrI+sz BaseHTTPRequestHandler.log_errorcCsi|]}|d|d���qS)z\xZ02xr)�.0�crrr�
<dictcomp>;sz!BaseHTTPRequestHandler.<dictcomp>� ��z\\�\cGs2||}tj�d|��|��|�|j�f�dS)aZLog an arbitrary message.

        This is used by all other logging functions.  Override
        it if you have specific logging wishes.

        The first argument, FORMAT, is a format string for the
        message to be logged.  If the format string contains
        any % escapes requiring parameters, they should be
        specified as subsequent arguments (it's just like
        printf!).

        The client ip and current date/time are prefixed to
        every message.

        Unicode control characters are replaced with escaped hex
        before writing the output to stderr.

        z%s - - [%s] %s
N)�sys�stderrra�address_string�log_date_time_string�	translate�_control_char_table)rrsrtrSrrrrq>s
��z"BaseHTTPRequestHandler.log_messagecCs|jd|jS)z*Return the server software version string.� )�server_version�sys_versionrBrrrrcXsz%BaseHTTPRequestHandler.version_stringcCs |dkrt��}tjj|dd�S)z@Return the current date and time formatted for a message header.NT)Zusegmt)�time�email�utilsZ
formatdate)rZ	timestamprrrrd\sz'BaseHTTPRequestHandler.date_time_stringc	CsBt��}t�|�\	}}}}}}}}	}
d||j|||||f}|S)z.Return the current time formatted for logging.z%02d/%3s/%04d %02d:%02d:%02d)r��	localtime�	monthname)rZnowZyearZmonthZdayZhhZmmZss�x�y�z�srrrrbs�z+BaseHTTPRequestHandler.log_date_time_stringZMonZTueZWedZThuZFriZSatZSunZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDeccCs
|jdS)zReturn the client address.r)�client_addressrBrrrr~psz%BaseHTTPRequestHandler.address_string�HTTP/1.0cCsi|]}||j|jf�qSr)�phraseZdescription)ru�vrrrrws�)NN)N)N)roro)N)2rrr�__doc__r|r<r*r��__version__r��DEFAULT_ERROR_MESSAGEr\�DEFAULT_ERROR_CONTENT_TYPEr`r#r?r;rLrMr0rYr@rZrArlrbrIr&�	maketrans�	itertools�chain�ranger��ordrqrcrdrZweekdaynamer�r~r1r4r5ZHTTPMessager7r�__members__�valuesrWrrrrr�s^gj%
5


�
�	�cs�eZdZdZdeZdd��fdd�
Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
ejsle��ej��Ze�ddddd���ZS)raWSimple HTTP request handler with GET and HEAD commands.

    This serves files from the current directory and any of its
    subdirectories.  The MIME type for files is determined by
    calling the .guess_type() method.

    The GET and HEAD requests are identical except that the HEAD
    request omits the actual contents of the file.

    zSimpleHTTP/N��	directorycs(|dkrt��}||_t�j||�dS�N)�os�getcwdr��super�__init__)rr�rt�kwargs��	__class__rrr��sz!SimpleHTTPRequestHandler.__init__cCs.|��}|r*z|�||j�W5|��XdS)zServe a GET request.N)�	send_headr �copyfilerG�r�frrr�do_GET�s
zSimpleHTTPRequestHandler.do_GETcCs|��}|r|��dS)zServe a HEAD request.N)r�r r�rrr�do_HEAD�sz SimpleHTTPRequestHandler.do_HEADcCs^|�|j�}d}tj�|�r�tj�|j�}|j�d�s�|�t	j
�|d|d|dd|d|df}tj�|�}|�d|�|�
�dSd	D]&}tj�||�}tj�|�r�|}q�q�|�|�S|�|�}|�d�r�|�t	jd
�dSzt|d�}Wn&tk
�r|�t	jd
�YdSX�z"t�|���}d|jk�r�d
|jk�r�ztj�|jd�}	Wnttttfk
�r|YnzX|	j dk�r�|	j!t"j#j$d�}	|	j t"j#j$k�r�t"j"�%|j&t"j#j$�}
|
j!dd�}
|
|	k�r�|�t	j'�|�
�|�(�WdS|�t	j)�|�d|�|�dt*|d��|�d|�+|j&��|�
�|WS|�(��YnXdS)a{Common code for GET and HEAD commands.

        This sends the response code and MIME headers.

        Return value is either a file object (which has to be copied
        to the outputfile by the caller unless the command was HEAD,
        and must be closed by the caller under all circumstances), or
        None, in which case the caller has nothing further to do.

        Nrrr	r
r�ZLocation)z
index.htmlz	index.htmzFile not found�rbzIf-Modified-Sincez
If-None-Match)�tzinfo)Zmicrosecond�Content-typerV�z
Last-Modified),�translate_pathr2r��isdir�urllib�parseZurlsplit�endswithrYrZMOVED_PERMANENTLYZ
urlunsplitrZrArn�exists�list_directory�
guess_typer0�	NOT_FOUND�open�OSError�fstat�filenor8r�r�Zparsedate_to_datetime�	TypeErrorr/�
OverflowErrorr-r�rU�datetime�timezoneZutcZ
fromtimestamp�st_mtimer[r �OKr&rd)rr2r��partsZ	new_partsZnew_url�indexZctypeZfsZimsZ
last_modifrrrr��s��


���

�z"SimpleHTTPRequestHandler.send_headc
	Cs�zt�|�}Wn$tk
r2|�tjd�YdSX|jdd�d�g}ztjj	|j
dd�}Wn"tk
r�tj�	|j
�}YnXtj
|dd	�}t��}d
|}|�d�|�d�|�d
|�|�d|�|�d|�|�d�|D]v}tj
�||�}|}	}
tj
�|��r$|d}	|d}
tj
�|��r:|d}	|�dtjj|
dd�tj
|	dd	�f�q�|�d�d�|��|d�}t��}|�|�|�d�|�tj�|�dd|�|�dtt|���|��|S)z�Helper to produce a directory listing (absent index.html).

        Return value is either a file object, or None (indicating an
        error).  In either case, the headers are sent, making the
        interface the same as for send_head().

        zNo permission to list directoryNcSs|��Sr�)r:)�arrr�<lambda>rmz9SimpleHTTPRequestHandler.list_directory.<locals>.<lambda>)�key�
surrogatepass��errorsFrPzDirectory listing for %szZ<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">z
<html>
<head>z@<meta http-equiv="Content-Type" content="text/html; charset=%s">z<title>%s</title>
</head>z<body>
<h1>%s</h1>z	<hr>
<ul>r�@z<li><a href="%s">%s</a></li>z</ul>
<hr>
</body>
</html>
�
�surrogateescaperr�ztext/html; charset=%srV) r��listdirr�r0rr��sortr�r��unquoter2�UnicodeDecodeErrorr]r^r|�getfilesystemencodingrirnr��islinkrQr_�io�BytesIOra�seekrYr�rZr&r+rA)
rr2�list�rZdisplaypath�enc�title�name�fullnameZdisplaynameZlinknameZencodedr�rrrr�sh�
�


�
���


z'SimpleHTTPRequestHandler.list_directorycCs�|�dd�d}|�dd�d}|���d�}ztjj|dd�}Wn tk
rbtj�|�}YnXt�|�}|�d�}t	d|�}|j
}|D]0}tj�
|�s�|tjtjfkr�q�tj�||�}q�|r�|d7}|S)	z�Translate a /-separated PATH to the local filename syntax.

        Components that mean special things to the local file system
        (e.g. drive or directory names) are ignored.  (XXX They should
        probably be diagnosed.)

        �?r	r�#rr�r�N)r*r(r�r�r�r�r��	posixpath�normpath�filterr�r�r2�dirname�curdir�pardirrn)rr2Ztrailing_slashr=Zwordrrrr�:s$	


z'SimpleHTTPRequestHandler.translate_pathcCst�||�dS)a�Copy all data between two file objects.

        The SOURCE argument is a file object open for reading
        (or anything with a read() method) and the DESTINATION
        argument is a file object open for writing (or
        anything with a write() method).

        The only reason for overriding this would be to change
        the block size or perhaps to replace newlines by CRLF
        -- note however that this the default server uses this
        to copy binary data as well.

        N)�shutilZcopyfileobj)r�sourceZ
outputfilerrrr�Xsz!SimpleHTTPRequestHandler.copyfilecCsLt�|�\}}||jkr"|j|S|��}||jkr>|j|S|jdSdS)a�Guess the type of a file.

        Argument is a PATH (a filename).

        Return value is a string of the form type/subtype,
        usable for a MIME Content-type header.

        The default implementation looks the file's extension
        up in the table self.extensions_map, using application/octet-stream
        as a default; however it would be permissible (if
        slow) to look inside the data to make a better guess.

        rN)r��splitext�extensions_mapr:)rr2�baseZextrrrr�hs



z#SimpleHTTPRequestHandler.guess_typezapplication/octet-streamz
text/plain)r�.pyz.cz.h)rrrr�r�r�r�r�r�r�r�r�r�r��	mimetypesZinitedZinitZ	types_map�copyr��update�
__classcell__rrr�rr�s&	W:
�c	Cs�|�d�\}}}tj�|�}|�d�}g}|dd�D],}|dkrL|��q6|r6|dkr6|�|�q6|r�|��}|r�|dkr�|��d}q�|dkr�d}nd}|r�d�||f�}dd�|�|f}d�|�}|S)a�
    Given a URL path, remove extra '/'s and '.' path elements and collapse
    any '..' references and returns a collapsed path.

    Implements something akin to RFC-2396 5.2 step 6 to parse relative paths.
    The utility of this function is limited to is_cgi method and helps
    preventing some security attacks.

    Returns: The reconstituted URL, which will always start with a '/'.

    Raises: IndexError if too many '..' occur within the path.

    r�rNrz..rr)�	partitionr�r�r�r*�poprirn)	r2�_�query�
path_partsZ
head_parts�partZ	tail_partZ	splitpath�collapsed_pathrrr�_url_collapse_path�s.


r�cCsrtrtSzddl}Wntk
r*YdSXz|�d�daWn.tk
rldtdd�|��D��aYnXtS)	z$Internal routine to get nobody's uidrNr�nobodyr
r	css|]}|dVqdS)r
Nr)rur�rrr�	<genexpr>�sznobody_uid.<locals>.<genexpr>)r��pwd�ImportError�getpwnamrX�maxZgetpwall)r�rrr�
nobody_uid�s r�cCst�|tj�S)zTest for executable file.)r��access�X_OK)r2rrr�
executable�src@sVeZdZdZeed�ZdZdd�Zdd�Z	dd	�Z
d
dgZdd
�Zdd�Z
dd�ZdS)rz�Complete HTTP server with GET, HEAD and POST commands.

    GET and HEAD also support running CGI scripts.

    The POST command is *only* implemented for CGI scripts.

    �forkrcCs$|��r|��n|�tjd�dS)zRServe a POST request.

        This is only implemented for CGI scripts.

        zCan only POST to CGI scriptsN)�is_cgi�run_cgir0rrErBrrr�do_POST�s
�zCGIHTTPRequestHandler.do_POSTcCs|��r|��St�|�SdS)z-Version of send_head that support CGI scriptsN)rrrr�rBrrrr��szCGIHTTPRequestHandler.send_headcCsPt|j�}|�dd�}|d|�||dd�}}||jkrL||f|_dSdS)a3Test whether self.path corresponds to a CGI script.

        Returns True and updates the cgi_info attribute to the tuple
        (dir, rest) if self.path requires running a CGI script.
        Returns False otherwise.

        If any exception is raised, the caller should assume that
        self.path was rejected as invalid and act accordingly.

        The default implementation tests whether the normalized url
        path begins with one of the strings in self.cgi_directories
        (and the next character is a '/' or the end of the string).

        rr	NTF)r�r2�find�cgi_directories�cgi_info)rr�Zdir_sep�head�tailrrrr�s


zCGIHTTPRequestHandler.is_cgiz/cgi-binz/htbincCst|�S)z1Test whether argument path is an executable file.)r)rr2rrr�
is_executablesz#CGIHTTPRequestHandler.is_executablecCstj�|�\}}|��dkS)z.Test whether argument path is a Python script.)r�z.pyw)r�r2r�r:)rr2r
rrrr�	is_pythonszCGIHTTPRequestHandler.is_pythonc)	Cs�|j\}}|d|}|�dt|�d�}|dkr�|d|�}||dd�}|�|�}tj�|�r�||}}|�dt|�d�}q*q�q*|�d�\}}}	|�d�}|dkr�|d|�||d�}
}n
|d}
}|d|
}|�|�}tj�|��s
|�	t
jd|�dStj�|��s.|�	t
j
d|�dS|�|�}
|j�sF|
�sh|�|��sh|�	t
j
d	|�dSt�tj�}|��|d
<|jj|d<d|d
<|j|d<t|jj�|d<|j|d<tj�|�}||d<|�|�|d<||d<|	�r�|	|d<|jd|d<|j� d�}|�r�|�!�}t|�dk�r�ddl"}ddl#}|d|d<|d�$�dk�r�z"|d�%d�}|�&|��'d�}Wn|j(t)fk
�r�Yn&X|�!d�}t|�dk�r�|d|d<|j� d�dk�r�|j�*�|d<n|jd|d<|j� d�}|�r||d <|j� d!�}|�r||d"<g}|j�+d#�D]>}|dd�d$k�rR|�,|�-��n||d%d��!d&�}�q,d&�.|�|d'<|j� d(�}|�r�||d)<t/d|j�0d*g��}d+�.|�}|�r�||d,<d-D]}|�1|d��q�|�2t
j3d.�|�4�|	�5d/d0�}|j�r|
g}d1|k�r|�,|�t6�}|j7�8�t�9�}|dk�r�t�:|d�\}}t;�;|j<gggd�d�r~|j<�=d��sN�q~�qN|�r�|�>d2|�dSz\zt�?|�Wnt@k
�r�YnXt�A|j<�B�d�t�A|j7�B�d�t�C|||�Wn(|j�D|jE|j�t�Fd3�YnX�n�ddlG} |g}!|�|��rrtHjI}"|"�$��Jd4��rf|"dd5�|"d6d�}"|"d7g|!}!d1|	k�r�|!�,|	�|�Kd8| �L|!��ztM|�}#WntNtOfk
�r�d}#YnX| jP|!| jQ| jQ| jQ|d9�}$|j�$�d:k�r|#dk�r|j<�=|#�}%nd}%t;�;|j<jRgggd�d�r>|j<jR�Sd��s
�q>�q
|$�T|%�\}&}'|j7�U|&�|'�rj|�>d;|'�|$jV�W�|$jX�W�|$jY}(|(�r�|�>d2|(�n
|�Kd<�dS)=zExecute a CGI script.rr	rNr�rzNo such CGI script (%r)z#CGI script is not a plain file (%r)z!CGI script is not executable (%r)ZSERVER_SOFTWAREZSERVER_NAMEzCGI/1.1ZGATEWAY_INTERFACEZSERVER_PROTOCOLZSERVER_PORTZREQUEST_METHODZ	PATH_INFOZPATH_TRANSLATEDZSCRIPT_NAME�QUERY_STRINGZREMOTE_ADDR�
authorizationr
Z	AUTH_TYPEZbasic�ascii�:ZREMOTE_USERzcontent-typeZCONTENT_TYPEzcontent-length�CONTENT_LENGTH�referer�HTTP_REFERER�acceptz	

 ��,ZHTTP_ACCEPTz
user-agent�HTTP_USER_AGENTZcookiez, �HTTP_COOKIE)rZREMOTE_HOSTrrrrzScript output follows�+r��=zCGI script exit status %#xryzw.exe������z-uzcommand: %s)�stdin�stdoutr}�envZpostz%szCGI script exited OK)Zr	rr+r�r�r2r�r�r�r0rr��isfileZ	FORBIDDENr
�	have_forkrr�Zdeepcopy�environrcZserverrr1r&rr"r�r�r�r�r8r9r*�base64�binasciir:r_Zdecodebytes�decode�Error�UnicodeErrorZget_content_typeZgetallmatchingheadersri�striprnr�Zget_all�
setdefaultrYr�rlrUr�rGrHr�waitpid�selectr6�readrI�setuidr��dup2r��execveZhandle_errorZrequest�_exit�
subprocessr|rr�rqZlist2cmdliner.r�r-�Popen�PIPEZ_sockZrecvZcommunicaterar}r r�
returncode))r�dir�restr2�iZnextdirZnextrestZ	scriptdirr�r�ZscriptZ
scriptnameZ
scriptfileZispyr Zuqrestrr$r%Zlengthrr�lineZua�coZ
cookie_str�kZ
decoded_queryrtr��pid�stsr2ZcmdlineZinterp�nbytes�p�datarr}Zstatusrrrrs<





��
�


�








�

zCGIHTTPRequestHandler.run_cgiN)rrrr�rDr�r"Zrbufsizerr�rrrr
rrrrrr�s	
cGs4tj|tjtjd��}tt|��\}}}}}||fS)N)�type�flags)rZgetaddrinfoZSOCK_STREAMZ
AI_PASSIVE�next�iter)ZaddressZinfosZfamilyrA�protoZ	canonnameZsockaddrrrr�_get_best_family�s�rFr�i@c	Cs�t||�\|_}||_|||���}|j��dd�\}}d|krLd|�d�n|}td|�d|�d|�d|�d	�	�z|��Wn&tk
r�td
�t�	d�YnXW5QRXdS)zmTest the HTTP request handler class.

    This runs an HTTP server on port 8000 (or the port argument).

    Nr
r�[�]zServing HTTP on z port z	 (http://z/) ...z&
Keyboard interrupt received, exiting.r)
rFZaddress_familyr1rZgetsockname�printZ
serve_forever�KeyboardInterruptr|�exit)	�HandlerClass�ServerClassZprotocolr�bindZaddrZhttpdrZurl_hostrrr�test�s�rO�__main__z--cgi�
store_truezRun as CGI Server)�action�helpz--bindz-bZADDRESSz8Specify alternate bind address [default: all interfaces])�metavarrSz--directoryz-dz9Specify alternative directory [default:current directory])�defaultrSrZstorer�z&Specify alternate port [default: 8000])rRrUrA�nargsrSr�cseZdZ�fdd�Z�ZS)�DualStackServerc	s4t�t��|j�tjtjd�W5QRXt���S)Nr)	�
contextlib�suppress�	ExceptionrZ
setsockoptZIPPROTO_IPV6ZIPV6_V6ONLYr�r
rBr�rrr
s�zDualStackServer.server_bind)rrrr
r�rrr�rrWsrW)rLrMrrN):r�r��__all__r�r�Zemail.utilsr�r]Zhttp.clientr4r�r�r�r�r�r,r�rrr|r�Zurllib.parser�rX�	functoolsrrr�r�rrZThreadingMixInrZStreamRequestHandlerrrr�r�r�rrrFrOr�argparse�ArgumentParser�parser�add_argumentr�r.�
parse_argsrtZcgiZ
handler_classr�rWrrNrrrr�<module>s�R�s
0
�

�
�����http/__pycache__/cookies.cpython-38.opt-2.pyc000064400000025111151153537450014770 0ustar00U

e5d�O�
@spddlZddlZdddgZdjZdjZdjZGdd�de�Zej	ej
d	Zed
Zdd�e
ed
��e
eee��D�Ze�ed�ded�di�e�de�e��jZdd�Ze�d�Ze�d�Zdd�ZdddddddgZdd d!d"d#d$d%d&d'd(d)d*d+g
Zdeefd,d-�ZGd.d/�d/e�Zd0Z e d1Z!e�d2e d3e!d4ej"ej#B�Z$Gd5d�de�Z%Gd6d�de%�Z&dS)7�N�CookieError�
BaseCookie�SimpleCookie�z; � c@seZdZdS)rN)�__name__�
__module__�__qualname__�r
r
�$/usr/lib64/python3.8/http/cookies.pyr�sz!#$%&'*+-.^_`|~:z
 ()/<=>?@[]{}cCsi|]}|d|�qS)z\%03or
)�.0�nr
r
r�
<dictcomp>�s�r��"�\"�\z\\z[%s]+cCs*|dkst|�r|Sd|�t�dSdS)Nr)�
_is_legal_key�	translate�_Translator��strr
r
r�_quote�srz\\[0-3][0-7][0-7]z[\\].cCsN|dkst|�dkr|S|ddks0|ddkr4|S|dd�}d}t|�}g}d|krf|k�rFnn�t�||�}t�||�}|s�|s�|�||d���qFd}}|r�|�d�}|r�|�d�}|�r|r�||k�r|�|||��|�||d�|d}qP|�|||��|�tt||d|d�d���|d}qPt|�S)N�rr������)	�len�
_OctalPatt�search�
_QuotePatt�append�start�chr�int�	_nulljoin)r�ir
�resZo_matchZq_match�j�kr
r
r�_unquote�s6


$
r+ZMonZTueZWedZThuZFriZSatZSunZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDecc	CsRddlm}m}|�}|||�\	}}}}	}
}}}
}d|||||||	|
|fS)Nr)�gmtime�timez#%s, %02d %3s %4d %02d:%02d:%02d GMT)r-r,)ZfutureZweekdaynameZ	monthnamer,r-ZnowZyearZmonthZdayZhhZmmZssZwd�y�zr
r
r�_getdate�s�r0c
@s�eZdZddddddddd	d
�	ZddhZd
d�Zedd��Zedd��Zedd��Z	dd�Z
d1dd�Zdd�Ze
jZdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd2d)d*�ZeZd+d,�Zd3d-d.�Zd4d/d0�ZdS)5�Morsel�expires�Path�CommentZDomainzMax-AgeZSecureZHttpOnlyZVersionZSameSite)	r2�path�commentZdomain�max-age�secure�httponly�versionZsamesiter8r9cCs0d|_|_|_|jD]}t�||d�qdS)Nr)�_key�_value�_coded_value�	_reserved�dict�__setitem__)�self�keyr
r
r�__init__ s
zMorsel.__init__cCs|jS�N)r;�rAr
r
rrB(sz
Morsel.keycCs|jSrD)r<rEr
r
r�value,szMorsel.valuecCs|jSrD)r=rEr
r
r�coded_value0szMorsel.coded_valuecCs2|��}||jkr td|f��t�|||�dS�NzInvalid attribute %r)�lowerr>rr?r@)rA�K�Vr
r
rr@4s
zMorsel.__setitem__NcCs.|��}||jkr td|f��t�|||�SrH)rIr>rr?�
setdefault)rArB�valr
r
rrL:s
zMorsel.setdefaultcCs>t|t�stSt�||�o<|j|jko<|j|jko<|j|jkSrD)�
isinstancer1�NotImplementedr?�__eq__r<r;r=�rAZmorselr
r
rrP@s

�
�
�z
Morsel.__eq__cCs$t�}t�||�|j�|j�|SrD)r1r?�update�__dict__rQr
r
r�copyJszMorsel.copycCsRi}t|���D]0\}}|��}||jkr8td|f��|||<qt�||�dSrH)r?�itemsrIr>rrR)rA�values�datarBrMr
r
rrRPs

z
Morsel.updatecCs|��|jkSrD)rIr>)rArJr
r
r�
isReservedKeyYszMorsel.isReservedKeycCsH|��|jkrtd|f��t|�s2td|f��||_||_||_dS)Nz Attempt to set a reserved key %rzIllegal key %r)rIr>rrr;r<r=)rArBrMZ	coded_valr
r
r�set\sz
Morsel.setcCs|j|j|jd�S)N)rBrFrG�r;r<r=rEr
r
r�__getstate__gs�zMorsel.__getstate__cCs"|d|_|d|_|d|_dS)NrBrFrGrZ)rA�stater
r
r�__setstate__ns

zMorsel.__setstate__�Set-Cookie:cCsd||�|�fS)Nz%s %s)�OutputString)rA�attrs�headerr
r
r�outputssz
Morsel.outputcCsd|jj|��fS)N�<%s: %s>)�	__class__rr_rEr
r
r�__repr__xszMorsel.__repr__cCsd|�|��dd�S)Nz�
        <script type="text/javascript">
        <!-- begin hiding
        document.cookie = "%s";
        // end hiding -->
        </script>
        rr)r_�replace)rAr`r
r
r�	js_output{s�zMorsel.js_outputcCs$g}|j}|d|j|jf�|dkr,|j}t|���}|D]�\}}|dkrNq<||krXq<|dkr�t|t�r�|d|j|t|�f�q<|dkr�t|t�r�|d|j||f�q<|dkr�t|t	�r�|d|j|t
|�f�q<||jk�r|�r|t	|j|��q<|d|j||f�q<t|�S)N�%s=%srr2r7z%s=%dr6)
r"rBrGr>�sortedrUrNr%r0rr�_flags�_semispacejoin)rAr`�resultr"rUrBrFr
r
rr_�s,zMorsel.OutputString)N)Nr^)N)N)rrr	r>rjrC�propertyrBrFrGr@rLrP�object�__ne__rTrRrXrYr[r]rb�__str__rergr_r
r
r
rr1�sB�



	


r1z,\w\d!#%&'~_`><@,:/\$\*\+\-\.\^\|\)\(\?\}\{\=z\[\]z�
    \s*                            # Optional whitespace at start of cookie
    (?P<key>                       # Start of group 'key'
    [a	]+?   # Any word of at least one letter
    )                              # End of group 'key'
    (                              # Optional group: there may not be a value.
    \s*=\s*                          # Equal Sign
    (?P<val>                         # Start of group 'val'
    "(?:[^\\"]|\\.)*"                  # Any doublequoted string
    |                                  # or
    \w{3},\s[\w\d\s-]{9,11}\s[\d:]{8}\sGMT  # Special case for "expires" attr
    |                                  # or
    [a-]*      # Any word or empty string
    )                                # End of group 'val'
    )?                             # End of optional value group
    \s*                            # Any number of spaces.
    (\s+|;|$)                      # Ending either at space, semicolon, or EOS.
    c@sjeZdZdd�Zdd�Zddd�Zdd	�Zd
d�Zddd�ZeZ	dd�Z
ddd�Zdd�Ze
fdd�ZdS)rcCs||fSrDr
�rArMr
r
r�value_decode�szBaseCookie.value_decodecCst|�}||fSrDr�rArMZstrvalr
r
r�value_encode�szBaseCookie.value_encodeNcCs|r|�|�dSrD)�load)rA�inputr
r
rrC�szBaseCookie.__init__cCs.|�|t��}|�|||�t�|||�dSrD)�getr1rYr?r@)rArBZ
real_valuerG�Mr
r
rZ__set�szBaseCookie.__setcCs:t|t�rt�|||�n|�|�\}}|�|||�dSrD)rNr1r?r@rt�_BaseCookie__set)rArBrF�rval�cvalr
r
rr@�s
zBaseCookie.__setitem__r^�
cCs:g}t|���}|D]\}}|�|�||��q|�|�SrD)rirUr"rb�join)rAr`ra�seprlrUrBrFr
r
rrb�s
zBaseCookie.outputcCsJg}t|���}|D] \}}|�d|t|j�f�qd|jjt|�fS)Nrhrc)rirUr"�reprrFrdr�
_spacejoin)rA�lrUrBrFr
r
rre�s
zBaseCookie.__repr__cCs6g}t|���}|D]\}}|�|�|��qt|�SrD)rirUr"rgr&)rAr`rlrUrBrFr
r
rrgs
zBaseCookie.js_outputcCs4t|t�r|�|�n|��D]\}}|||<qdSrD)rNr�_BaseCookie__parse_stringrU)rAZrawdatarBrFr
r
rru
s


zBaseCookie.loadcCshd}t|�}g}d}d}d}d|kr2|k�rnn�|�||�}	|	sJ�q|	�d�|	�d�}
}|	�d�}|
ddkr�|s|q|�||
dd�|f�q|
��tjkr�|s�dS|dkr�|
��tjkr�|�||
df�q�dSn|�||
t	|�f�q|dk	�r|�||
|�
|�f�d}qdSqd}|D]>\}
}
}|
|k�rB|||
<n|\}}|�|
||�||
}�q$dS)	NrFrrrBrM�$T)r�match�group�endr"rIr1r>rjr+rrry)rArZpattr'r
Zparsed_itemsZmorsel_seenZTYPE_ATTRIBUTEZ
TYPE_KEYVALUEr�rBrFrx�tprzr{r
r
rZ__parse_stringsF



zBaseCookie.__parse_string)N)Nr^r|)N)rrr	rrrtrCryr@rbrprergru�_CookiePatternr�r
r
r
rr�s		
	

c@seZdZdd�Zdd�ZdS)rcCst|�|fSrD)r+rqr
r
rrr\szSimpleCookie.value_decodecCst|�}|t|�fSrD)rrrsr
r
rrt_szSimpleCookie.value_encodeN)rrr	rrrtr
r
r
rrUs)'�re�string�__all__r}r&rkr��	ExceptionrZ
ascii_lettersZdigitsZ_LegalCharsZ_UnescapedCharsrY�range�map�ordrrR�compile�escape�	fullmatchrrrr!r+Z_weekdaynameZ
_monthnamer0r?r1Z_LegalKeyCharsZ_LegalValueChars�ASCII�VERBOSEr�rrr
r
r
r�<module>�sp
��

2�4����
�
http/__pycache__/client.cpython-38.opt-2.pyc000064400000062033151153537450014616 0ustar00U

e5d���@sbddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddddddd	d
ddd
dddddddgZdZdZ
dZdZdZdZe��ejj�dd�ejj��D�ZdZdZe�d�jZe�d �jZe�d!�Ze�d"�Z d#d$d%hZ!dAd'd(�Z"Gd)d*�d*ej#j$�Z%d+d,�Z&e%fd-d.�Z'Gd/d�dej(�Z)Gd0d�d�Z*zddl+Z+Wne,k
�r\YnXGd1d2�d2e*�Z-e�.d2�Gd3d�de/�Z0Gd4d�de0�Z1Gd5d�de0�Z2Gd6d�de0�Z3Gd7d�de0�Z4Gd8d	�d	e0�Z5Gd9d
�d
e0�Z6Gd:d�de0�Z7Gd;d
�d
e7�Z8Gd<d�de7�Z9Gd=d�de7�Z:Gd>d�de0�Z;Gd?d�de0�Z<Gd@d�de=e;�Z>e0Z?dS)B�N)�urlsplit�HTTPResponse�HTTPConnection�
HTTPException�NotConnected�UnknownProtocol�UnknownTransferEncoding�UnimplementedFileMode�IncompleteRead�
InvalidURL�ImproperConnectionState�CannotSendRequest�CannotSendHeader�ResponseNotReady�
BadStatusLine�LineTooLong�RemoteDisconnected�error�	responses�Pi�ZUNKNOWNZIdlezRequest-startedzRequest-sentcCsi|]}||j�qS�)�phrase)�.0�vrr�#/usr/lib64/python3.8/http/client.py�
<dictcomp>jsri�ds[^:\s][^:\r\n]*s\n(?![ \t])|\r(?![ \t\n])z[- ]z[-]ZPATCHZPOSTZPUT�datac
Cshz|�d�WStk
rb}z8t|j|j|j|jd|��||j|j�|f�d�W5d}~XYnXdS)N�latin-1z`%s (%.20r) is not valid Latin-1. Use %s.encode('utf-8') if you want to send it encoded in UTF-8.)�encode�UnicodeEncodeError�encoding�object�start�end�title)r�name�errrrr�_encode�s���r(c@seZdZdd�ZdS)�HTTPMessagecCsj|��d}t|�}g}d}|��D]@}|d|���|krBd}n|dd���sVd}|r$|�|�q$|S)N�:r�)�lower�len�keys�isspace�append)�selfr&�nZlstZhit�linerrr�getallmatchingheaders�s
z!HTTPMessage.getallmatchingheadersN)�__name__�
__module__�__qualname__r4rrrrr)�sr)cCsXg}|�td�}t|�tkr&td��|�|�t|�tkrHtdt��|dkrqTq|S)Nr+�header linezgot more than %d headers��
�
�)�readline�_MAXLINEr-rr0�_MAXHEADERSr)�fp�headersr3rrr�
_read_headers�s
rBcCs,t|�}d�|��d�}tjj|d��|�S)Nr<�
iso-8859-1)�_class)rB�join�decode�email�parserZParserZparsestr)r@rDrAZhstringrrr�
parse_headers�s
rIcseZdZd@dd�Zdd�Zdd�Zd	d
�Zdd�Z�fd
d�Z�fdd�Z	dd�Z
dd�ZdAdd�Zdd�Z
dd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�ZdBd(d)�ZdCd*d+�ZdD�fd,d-�	Zd.d/�Zd0d1�Zd2d3�ZdEd4d5�Zd6d7�Zd8d9�Zd:d;�Zd<d=�Zd>d?�Z �Z!S)FrrNcCsR|�d�|_||_||_d|_|_t|_t|_t|_	t|_
t|_t|_t|_
dS)N�rb)Zmakefiler@�
debuglevel�_methodrA�msg�_UNKNOWN�version�status�reason�chunked�
chunk_left�length�
will_close)r1�sockrK�method�urlrrr�__init__�szHTTPResponse.__init__cCst|j�td�d�}t|�tkr*td��|jdkrBtdt|��|sNt	d��z|�
dd�\}}}WnFtk
r�z|�
dd�\}}d}Wntk
r�d}YnXYnX|�d	�s�|�
�t|��z$t|�}|d
ks�|dkr�t|��Wntk
�rt|��YnX|||fS)Nr+rCzstatus linerzreply:z-Remote end closed connection without response��zHTTP/ri�)�strr@r=r>r-rrK�print�reprr�split�
ValueError�
startswith�_close_connr�int)r1r3rOrPrQrrr�_read_statuss2

zHTTPResponse._read_statusc	Cs�|jdk	rdS|��\}}}|tkr&qHt|j�}|jdkrDtd|�~q||_|_|�	�|_
|dkrnd|_n|�d�r�d|_nt
|��t|j�|_|_|jdkr�|j��D]\}}td|d|�q�|j�d	�}|r�|��d
kr�d|_d|_nd|_|��|_d|_|j�d
�}|�rb|j�sbzt|�|_Wntk
�rLd|_YnX|jdk�rhd|_nd|_|tk�s�|tk�s�d|k�r�dk�s�n|jdk�r�d|_|j�s�|j�s�|jdk�r�d|_dS)Nrzheaders:)zHTTP/1.0zHTTP/0.9�
zHTTP/1.��header:r*�transfer-encodingrRTF�content-lengthr���HEAD)rArdZCONTINUErBr@rKr]�coderP�striprQrOrarrIrM�items�getr,rRrS�_check_closerUrTrcr`Z
NO_CONTENTZNOT_MODIFIEDrL)	r1rOrPrQZskipped_headers�hdr�valZtr_encrTrrr�begin5sf







�
�
���zHTTPResponse.begincCsv|j�d�}|jdkr.|r*d|��kr*dSdS|j�d�r>dS|rRd|��krRdS|j�d�}|rrd|��krrdSdS)NZ
connectionrf�closeTFz
keep-alivezproxy-connection)rArorOr,)r1ZconnZpconnrrrrp}s
zHTTPResponse._check_closecCs|j}d|_|��dS�N)r@rt)r1r@rrrrb�szHTTPResponse._close_conncs$zt���W5|jr|��XdSru)r@rb�superrt�r1��	__class__rrrt�szHTTPResponse.closecst���|jr|j��dSru)rv�flushr@rwrxrrrz�s
zHTTPResponse.flushcCsdS)NTrrwrrr�readable�szHTTPResponse.readablecCs
|jdkSru)r@rwrrr�isclosed�szHTTPResponse.isclosedcCs�|jdkrdS|jdkr$|��dS|dk	rRt|�}|�|�}t|�d|���S|jr`|��S|j	dkrv|j�
�}n6z|�|j	�}Wntk
r�|���YnXd|_	|��|SdS)Nr<rkr)
r@rLrb�	bytearray�readinto�
memoryview�tobytesrR�_readall_chunkedrT�read�
_safe_readr
)r1�amt�br2�srrrr��s*



zHTTPResponse.readcCs�|jdkrdS|jdkr$|��dS|jr4|�|�S|jdk	r^t|�|jkr^t|�d|j�}|j�|�}|s||r||��n&|jdk	r�|j|8_|js�|��|S)Nrrk)	r@rLrbrR�_readinto_chunkedrTr-rr~)r1r�r2rrrr~�s$





zHTTPResponse.readintocCsr|j�td�}t|�tkr$td��|�d�}|dkrB|d|�}zt|d�WStk
rl|���YnXdS)Nr+z
chunk size�;r�)	r@r=r>r-r�findrcr`rb)r1r3�irrr�_read_next_chunk_sizes
z"HTTPResponse._read_next_chunk_sizecCs:|j�td�}t|�tkr$td��|s*q6|dkrq6qdS)Nr+ztrailer liner9)r@r=r>r-r�r1r3rrr�_read_and_discard_trailersz&HTTPResponse._read_and_discard_trailercCsl|j}|sh|dk	r|�d�z|��}Wntk
rDtd��YnX|dkrb|��|��d}||_|S)NrZr<r)rSr�r�r`r
r�rb)r1rSrrr�_get_chunk_left s
zHTTPResponse._get_chunk_leftcCsbg}z6|��}|dkrq0|�|�|��d|_qd�|�WStk
r\td�|���YnXdS�Nrr<)r�r0r�rSrEr
)r1�valuerSrrrr�8szHTTPResponse._readall_chunkedcCs�d}t|�}zv|��}|dkr$|WSt|�|krN|�|�}|||_||WS|d|�}|�|�}||d�}||7}d|_qWn(tk
r�tt|d|����YnXdS)Nr)rr�r-�_safe_readintorSr
�bytes)r1r�Ztotal_bytesZmvbrSr2Ztemp_mvbrrrr�Fs"



zHTTPResponse._readinto_chunkedcCs.|j�|�}t|�|kr*t||t|���|Sru)r@r�r-r
)r1r�rrrrr�^szHTTPResponse._safe_readcCs:t|�}|j�|�}||kr6tt|d|��||��|Sru)r-r@r~r
r�)r1r�r�r2rrrr�js
zHTTPResponse._safe_readinto���cCs�|jdks|jdkrdS|jr(|�|�S|jdk	rJ|dksD||jkrJ|j}|j�|�}|sh|rh|��n|jdk	r�|jt|�8_|S�Nrkr<r)r@rLrR�_read1_chunkedrT�read1rbr-)r1r2�resultrrrr�rs


zHTTPResponse.read1cCs4|jdks|jdkrdS|jr(|�|�S|j�|�S)Nrkr<)r@rLrR�
_peek_chunked�peek)r1r2rrrr��s

zHTTPResponse.peekcs�|jdks|jdkrdS|jr*t��|�S|jdk	rL|dksF||jkrL|j}|j�|�}|sj|rj|��n|jdk	r�|jt|�8_|Sr�)r@rLrRrvr=rTrbr-)r1�limitr�rxrrr=�s

zHTTPResponse.readlinecCsd|��}|dks|dkrdSd|kr0|ks6n|}|j�|�}|jt|�8_|s`td��|Sr�)r�r@r�rSr-r
)r1r2rSr�rrrr��szHTTPResponse._read1_chunkedcCsDz|��}Wntk
r"YdSX|dkr0dS|j�|�d|�S)Nr<)r�r
r@r�)r1r2rSrrrr��szHTTPResponse._peek_chunkedcCs
|j��Sru)r@�filenorwrrrr��szHTTPResponse.filenocCsF|jdkrt��|j�|�p|}t|t�s4t|d�s8|Sd�|�SdS)N�__iter__z, )rArZget_all�
isinstancer\�hasattrrE)r1r&�defaultrArrr�	getheader�s
zHTTPResponse.getheadercCs|jdkrt��t|j���Sru)rAr�listrnrwrrr�
getheaders�s
zHTTPResponse.getheaderscCs|Srurrwrrrr��szHTTPResponse.__iter__cCs|jSru)rArwrrr�info�szHTTPResponse.infocCs|jSru)rXrwrrr�geturl�s
zHTTPResponse.geturlcCs|jSru)rPrwrrr�getcode�szHTTPResponse.getcode)rNN)N)r�)r�)r�)N)"r5r6r7rYrdrsrprbrtrzr{r|r�r~r�r�r�r�r�r�r�r�r�r=r�r�r�r�r�r�r�r�r��
__classcell__rrrxrr�s<	
!H

 "

	

c@s
eZdZdZdZeZeZdZ	dZ
edd��Zedd��Z
d	ejd	d
fdd�Zd7d
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd8d d!�Zd9d"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Z d:dd.�d/d0�Z!d	ifdd.�d1d2�Z"d3d4�Z#d5d6�Z$d	S);rrfzHTTP/1.1r+rcCst|tj�Sru)r��io�
TextIOBase)�streamrrr�
_is_textIOszHTTPConnection._is_textIOcCsf|dkr|��tkrdSdSt|d�r*dSzt|�}|jWStk
rNYnXt|t�rbt|�SdS)Nrr�)	�upper�_METHODS_EXPECTING_BODYr�r�nbytes�	TypeErrorr�r\r-)�bodyrWZmvrrr�_get_content_lengths

z"HTTPConnection._get_content_lengthN� cCsn||_||_||_d|_g|_d|_t|_d|_d|_	d|_
i|_|�||�\|_
|_|�|j
�tj|_dSru)�timeout�source_address�	blocksizerV�_buffer�_HTTPConnection__response�_CS_IDLE�_HTTPConnection__staterL�_tunnel_host�_tunnel_port�_tunnel_headers�
_get_hostport�host�port�_validate_host�socketZcreate_connection�_create_connection)r1r�r�r�r�r�rrrrY4szHTTPConnection.__init__cCs<|jrtd��|�||�\|_|_|r.||_n
|j��dS)Nz.Can't set up tunnel for established connection)rV�RuntimeErrorr�r�r�r��clear)r1r�r�rArrr�
set_tunnelJszHTTPConnection.set_tunnelcCs�|dkr�|�d�}|�d�}||kr�zt||dd��}WnHtk
r�||dd�dkrh|j}ntd||dd���YnX|d|�}n|j}|r�|ddkr�|ddkr�|dd�}||fS)	Nr*�]r+r[znonnumeric port: '%s'r�[r�)�rfindrcr`�default_portr)r1r�r�r��jrrrr�bs

zHTTPConnection._get_hostportcCs
||_dSru)rK)r1�levelrrr�set_debuglevelvszHTTPConnection.set_debuglevelcCs�d|j|jf}|�d�}|�|�|j��D](\}}d||f}|�d�}|�|�q.|�d�|j|j|jd�}|�	�\}}	}
|	t
jjkr�|�
�td|	|
��f��|j�td�}t|�tkr�td	��|s�q�|d
kr�q�|jdkr�td|���q�dS)
NzCONNECT %s:%d HTTP/1.0
�asciiz%s: %s
rr:�rWzTunnel connection failed: %d %sr+r8r9rrg)r�r�r�sendr�rn�response_classrVrLrd�http�
HTTPStatusZOKrt�OSErrorrmr@r=r>r-rrKr]rF)r1Zconnect_strZ
connect_bytes�headerr�Z
header_strZheader_bytes�responserOrl�messager3rrr�_tunnelys4�



�
zHTTPConnection._tunnelcCsB|�|j|jf|j|j�|_|j�tjtj	d�|j
r>|��dS)Nr+)r�r�r�r�r�rVZ
setsockoptr�ZIPPROTO_TCPZTCP_NODELAYr�r�rwrrr�connect�s
�zHTTPConnection.connectcCsBt|_z|j}|r d|_|��W5|j}|r<d|_|��XdSru)r�r�r�rtrV)r1r�rVrrrrt�szHTTPConnection.closecCs|jdkr |jr|��nt��|jdkr8tdt|��t|d�r�|jdkrTtd�|�|�}|rt|jdkrttd�|�	|j
�}|s�q�|r�|�d�}|j�|�qtdSz|j�|�WnLt
k
�rt|tjj�r�|D]}|j�|�q�nt
dt|���YnXdS)Nrzsend:r��sendIng a read()able�encoding file using iso-8859-1rCz9data should be a bytes-like object or an iterable, got %r)rV�	auto_openr�rrKr]r^r�r�r�r�rZsendallr�r��collections�abc�Iterable�type)r1rr�	datablock�drrrr��s8






�zHTTPConnection.sendcCs|j�|�dSru)r�r0)r1r�rrr�_output�szHTTPConnection._outputccs^|jdkrtd�|�|�}|r2|jdkr2td�|�|j�}|sDqZ|rR|�d�}|Vq2dS)Nrr�r�rC)rKr]r�r�r�r)r1r{rr�rrr�_read_readable�s


zHTTPConnection._read_readableFcCs |j�d�d�|j�}|jdd�=|�|�|dk	�rt|d�rN|�|�}nZzt|�WnFtk
r�zt|�}Wn$tk
r�tdt	|���YnXYnX|f}|D]R}|s�|j
dkr�td�q�|r�|jdkr�t
|�d�d	��d
�|d}|�|�q�|�r|jdk�r|�d�dS)N)r<r<r:r�zAmessage_body should be a bytes-like object or an iterable, got %rrzZero length chunk ignoredrf�Xz
r�s0

)r��extendrEr�r�r�rr��iterr�rKr]�	_http_vsnr-r)r1�message_body�encode_chunkedrMZchunks�chunkrrr�_send_output�s:


�
�zHTTPConnection._send_outputcCs�|jr|j��rd|_|jtkr(t|_n
t|j��|�|�||_|pHd}|�|�d|||j	f}|�
|�|��|jdk�r�|�s�d}|�
d�r�t|�\}}}}}|r�z|�d�}Wntk
r�|�d�}YnX|�d|�n�|jr�|j}	|j}
n|j}	|j}
z|	�d�}Wn tk
�r4|	�d�}YnX|	�d	�d
k�rRd|d}|
|jk�rl|�d|�n|�d�}|�dd
||
f�|�s�|�dd�ndS)N�/z%s %s %srfr[r�r�ZidnaZHostr*r�[�]z%s:%szAccept-EncodingZidentity)r�r|r�r��_CS_REQ_STARTEDr
�_validate_methodrL�_validate_path�
_http_vsn_strr��_encode_requestr�rarrr �	putheaderr�r�r�r�r�r�rF)r1rWrX�	skip_host�skip_accept_encoding�requestZnetlocZnilZ
netloc_encr�r�Zhost_encrrr�
putrequest sP






zHTTPConnection.putrequestcCs
|�d�S)Nr�)r)r1r�rrrr��szHTTPConnection._encode_requestcCs,t�|�}|r(td|�d|���d���dS)Nz)method can't contain control characters. � (found at least �))�$_contains_disallowed_method_pchar_re�searchr`�group)r1rW�matchrrrr��s

�zHTTPConnection._validate_methodcCs,t�|�}|r(td|�d|���d���dS�Nz&URL can't contain control characters. r�r���!_contains_disallowed_url_pchar_rer�rr�)r1rXr�rrrr��s
zHTTPConnection._validate_pathcCs,t�|�}|r(td|�d|���d���dSr�r)r1r�r�rrrr��s
zHTTPConnection._validate_hostcGs�|jtkrt��t|d�r$|�d�}t|�s:td|f��t|�}t|�D]\\}}t|d�rl|�d�||<nt	|t
�r�t|��d�||<t||�rJtd||f��qJd�
|�}|d|}|�|�dS)Nrr�zInvalid header name %rrzInvalid header value %rs
	s: )r�r�rr�r�_is_legal_header_namer`r��	enumerater�rcr\�_is_illegal_header_valuerEr�)r1r��valuesr�Z	one_valuer�rrrr��s"





zHTTPConnection.putheader�r�cCs*|jtkrt|_nt��|j||d�dS)Nr)r�r��_CS_REQ_SENTrr�)r1r�r�rrr�
endheaders�s
zHTTPConnection.endheaderscCs|�|||||�dSru)�
_send_request)r1rWrXr�rAr�rrrr��szHTTPConnection.requestcCs�tdd�|D��}i}d|kr&d|d<d|kr6d|d<|j||f|�d|kr�d	|kr�d
}|�||�}|dkr�|dk	r�|jdkr�td|�d
}|�dd�q�|�dt|��nd
}|��D]\}	}
|�|	|
�q�t|t�r�t	|d�}|j
||d�dS)Ncss|]}|��VqdSru)r,)r�krrr�	<genexpr>�sz/HTTPConnection._send_request.<locals>.<genexpr>r�r+r�zaccept-encodingr�rirhFrzUnable to determine size of %rTzTransfer-EncodingrRzContent-Lengthr�r)�	frozensetr�r�rKr]r�r\rnr�r(r)r1rWrXr�rAr�Zheader_namesZskipsZcontent_lengthrqr�rrrr	�s0	


zHTTPConnection._send_requestcCs�|jr|j��rd|_|jtks&|jr0t|j��|jdkrR|j|j|j|jd�}n|j|j|jd�}zNz|�	�Wnt
k
r�|���YnXt|_|j
r�|��n||_|WS|���YnXdS)Nrr�)r�r|r�rrrKr�rVrLrs�ConnectionErrorrtr�rU)r1r�rrr�getresponses.

�
zHTTPConnection.getresponse)NN)NF)FF)N)%r5r6r7r�r�rr��	HTTP_PORTr�r�rK�staticmethodr�r�r��_GLOBAL_DEFAULT_TIMEOUTrYr�r�r�r�r�rtr�r�r�r�r�r�r�r�r�r�rr�r	rrrrrrsL

�

	&
6�
	
�.csDeZdZeZdddejdfdddd��fdd�Z�fdd�Z�Z	S)�HTTPSConnectionNr�)�context�check_hostnamer�cs�tt|�j|||||	d�|dk	s2|dk	s2|dk	rHddl}
|
�dtd�||_||_|dkrtt�	�}|j
dk	rtd|_
|jtjk}|dkr�|j
}|r�|s�td��|s�|r�|�||�|j
dk	r�d|_
||_|dk	r�||j_
dS)N)r�rzTkey_file, cert_file and check_hostname are deprecated, use a custom context instead.rZTzMcheck_hostname needs a SSL context with either CERT_OPTIONAL or CERT_REQUIRED)rvrrY�warnings�warn�DeprecationWarning�key_file�	cert_file�sslZ_create_default_https_contextZpost_handshake_authZverify_modeZ	CERT_NONErr`Zload_cert_chain�_context)r1r�r�rrr�r�rrr�rZwill_verifyrxrrrYcs<���

zHTTPSConnection.__init__cs6t���|jr|j}n|j}|jj|j|d�|_dS)N)�server_hostname)rvr�r�r�rZwrap_socketrV)r1rrxrrr��s

�zHTTPSConnection.connect)
r5r6r7�
HTTPS_PORTr�r�rrYr�r�rrrxrr\s��$rc@seZdZdS)rN�r5r6r7rrrrr�sc@seZdZdS)rNrrrrrr�sc@seZdZdS)rNrrrrrr�sc@seZdZdd�ZdS)rcCs|f|_||_dSru)�argsrO)r1rOrrrrY�szUnknownProtocol.__init__N�r5r6r7rYrrrrr�sc@seZdZdS)rNrrrrrr�sc@seZdZdS)r	Nrrrrrr	�sc@s$eZdZddd�Zdd�ZejZdS)r
NcCs|f|_||_||_dSru)r�partial�expected)r1r!r"rrrrY�szIncompleteRead.__init__cCs2|jdk	rd|j}nd}d|jjt|j�|fS)Nz, %i more expectedr[z%s(%i bytes read%s))r"ryr5r-r!)r1�errr�__repr__�s
�zIncompleteRead.__repr__)N)r5r6r7rYr$r"�__str__rrrrr
�s
c@seZdZdS)rNrrrrrr�sc@seZdZdS)r
Nrrrrrr
�sc@seZdZdS)rNrrrrrr�sc@seZdZdS)rNrrrrrr�sc@seZdZdd�ZdS)rcCs|st|�}|f|_||_dSru)r^rr3r�rrrrY�szBadStatusLine.__init__Nr rrrrr�sc@seZdZdd�ZdS)rcCst�|dt|f�dS)Nz&got more than %d bytes when reading %s)rrYr>)r1Z	line_typerrrrY�s�zLineTooLong.__init__Nr rrrrr�sc@seZdZdd�ZdS)rcOs"t�|d�tj|f|�|�dS)Nr[)rrY�ConnectionResetError)r1�pos�kwrrrrY�szRemoteDisconnected.__init__Nr rrrrr�s)r)@Zemail.parserrGZ
email.messager�r��rer�Zcollections.abcr�Zurllib.parser�__all__rrrNr�r�r�globals�updater��__members__rrr>r?�compile�	fullmatchrr�rrr�r�r(r�ZMessager)rBrI�BufferedIOBaserrr�ImportErrorrr0�	Exceptionrrrrrr	r
rr
rrrrr&rrrrrr�<module>Gs��



W8
http/__pycache__/cookies.cpython-38.opt-1.pyc000064400000035566151153537450015006 0ustar00U

e5d�O�
@stdZddlZddlZdddgZdjZdjZdjZGd	d�de�Z	ej
ejd
ZedZ
dd
�eed��eeee
��D�Ze�ed�ded�di�e�de�e��jZdd�Ze�d�Ze�d�Zdd�Zddddddd gZdd!d"d#d$d%d&d'd(d)d*d+d,g
Zdeefd-d.�ZGd/d0�d0e�Z d1Z!e!d2Z"e�d3e!d4e"d5ej#ej$B�Z%Gd6d�de�Z&Gd7d�de&�Z'dS)8a.

Here's a sample session to show how to use this module.
At the moment, this is the only documentation.

The Basics
----------

Importing is easy...

   >>> from http import cookies

Most of the time you start by creating a cookie.

   >>> C = cookies.SimpleCookie()

Once you've created your Cookie, you can add values just as if it were
a dictionary.

   >>> C = cookies.SimpleCookie()
   >>> C["fig"] = "newton"
   >>> C["sugar"] = "wafer"
   >>> C.output()
   'Set-Cookie: fig=newton\r\nSet-Cookie: sugar=wafer'

Notice that the printable representation of a Cookie is the
appropriate format for a Set-Cookie: header.  This is the
default behavior.  You can change the header and printed
attributes by using the .output() function

   >>> C = cookies.SimpleCookie()
   >>> C["rocky"] = "road"
   >>> C["rocky"]["path"] = "/cookie"
   >>> print(C.output(header="Cookie:"))
   Cookie: rocky=road; Path=/cookie
   >>> print(C.output(attrs=[], header="Cookie:"))
   Cookie: rocky=road

The load() method of a Cookie extracts cookies from a string.  In a
CGI script, you would use this method to extract the cookies from the
HTTP_COOKIE environment variable.

   >>> C = cookies.SimpleCookie()
   >>> C.load("chips=ahoy; vienna=finger")
   >>> C.output()
   'Set-Cookie: chips=ahoy\r\nSet-Cookie: vienna=finger'

The load() method is darn-tootin smart about identifying cookies
within a string.  Escaped quotation marks, nested semicolons, and other
such trickeries do not confuse it.

   >>> C = cookies.SimpleCookie()
   >>> C.load('keebler="E=everybody; L=\\"Loves\\"; fudge=\\012;";')
   >>> print(C)
   Set-Cookie: keebler="E=everybody; L=\"Loves\"; fudge=\012;"

Each element of the Cookie also supports all of the RFC 2109
Cookie attributes.  Here's an example which sets the Path
attribute.

   >>> C = cookies.SimpleCookie()
   >>> C["oreo"] = "doublestuff"
   >>> C["oreo"]["path"] = "/"
   >>> print(C)
   Set-Cookie: oreo=doublestuff; Path=/

Each dictionary element has a 'value' attribute, which gives you
back the value associated with the key.

   >>> C = cookies.SimpleCookie()
   >>> C["twix"] = "none for you"
   >>> C["twix"].value
   'none for you'

The SimpleCookie expects that all values should be standard strings.
Just to be sure, SimpleCookie invokes the str() builtin to convert
the value to a string, when the values are set dictionary-style.

   >>> C = cookies.SimpleCookie()
   >>> C["number"] = 7
   >>> C["string"] = "seven"
   >>> C["number"].value
   '7'
   >>> C["string"].value
   'seven'
   >>> C.output()
   'Set-Cookie: number=7\r\nSet-Cookie: string=seven'

Finis.
�N�CookieError�
BaseCookie�SimpleCookie�z; � c@seZdZdS)rN)�__name__�
__module__�__qualname__�r
r
�$/usr/lib64/python3.8/http/cookies.pyr�sz!#$%&'*+-.^_`|~:z
 ()/<=>?@[]{}cCsi|]}|d|�qS)z\%03or
)�.0�nr
r
r�
<dictcomp>�s�r��"�\"�\z\\z[%s]+cCs*|dkst|�r|Sd|�t�dSdS)z�Quote a string for use in a cookie header.

    If the string does not need to be double-quoted, then just return the
    string.  Otherwise, surround the string in doublequotes and quote
    (with a \) special characters.
    Nr)�
_is_legal_key�	translate�_Translator��strr
r
r�_quote�srz\\[0-3][0-7][0-7]z[\\].cCsN|dkst|�dkr|S|ddks0|ddkr4|S|dd�}d}t|�}g}d|krf|k�rFnn�t�||�}t�||�}|s�|s�|�||d���qFd}}|r�|�d�}|r�|�d�}|�r|r�||k�r|�|||��|�||d�|d}qP|�|||��|�tt||d|d�d���|d}qPt|�S)N�rr������)	�len�
_OctalPatt�search�
_QuotePatt�append�start�chr�int�	_nulljoin)r�ir
�resZo_matchZq_match�j�kr
r
r�_unquote�s6


$
r+ZMonZTueZWedZThuZFriZSatZSunZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDecc	CsRddlm}m}|�}|||�\	}}}}	}
}}}
}d|||||||	|
|fS)Nr)�gmtime�timez#%s, %02d %3s %4d %02d:%02d:%02d GMT)r-r,)ZfutureZweekdaynameZ	monthnamer,r-ZnowZyearZmonthZdayZhhZmmZssZwd�y�zr
r
r�_getdate�s�r0c
@s�eZdZdZdddddddd	d
d�	Zdd
hZdd�Zedd��Zedd��Z	edd��Z
dd�Zd2dd�Zdd�Z
ejZdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd3d*d+�ZeZd,d-�Zd4d.d/�Zd5d0d1�ZdS)6�MorselaCA class to hold ONE (key, value) pair.

    In a cookie, each such pair may have several attributes, so this class is
    used to keep the attributes associated with the appropriate key,value pair.
    This class also includes a coded_value attribute, which is used to hold
    the network representation of the value.
    �expires�Path�CommentZDomainzMax-AgeZSecureZHttpOnlyZVersionZSameSite)	r2�path�commentZdomain�max-age�secure�httponly�versionZsamesiter8r9cCs0d|_|_|_|jD]}t�||d�qdS)Nr)�_key�_value�_coded_value�	_reserved�dict�__setitem__)�self�keyr
r
r�__init__ s
zMorsel.__init__cCs|jS�N)r;�rAr
r
rrB(sz
Morsel.keycCs|jSrD)r<rEr
r
r�value,szMorsel.valuecCs|jSrD)r=rEr
r
r�coded_value0szMorsel.coded_valuecCs2|��}||jkr td|f��t�|||�dS�NzInvalid attribute %r)�lowerr>rr?r@)rA�K�Vr
r
rr@4s
zMorsel.__setitem__NcCs.|��}||jkr td|f��t�|||�SrH)rIr>rr?�
setdefault)rArB�valr
r
rrL:s
zMorsel.setdefaultcCs>t|t�stSt�||�o<|j|jko<|j|jko<|j|jkSrD)�
isinstancer1�NotImplementedr?�__eq__r<r;r=�rAZmorselr
r
rrP@s

�
�
�z
Morsel.__eq__cCs$t�}t�||�|j�|j�|SrD)r1r?�update�__dict__rQr
r
r�copyJszMorsel.copycCsRi}t|���D]0\}}|��}||jkr8td|f��|||<qt�||�dSrH)r?�itemsrIr>rrR)rA�values�datarBrMr
r
rrRPs

z
Morsel.updatecCs|��|jkSrD)rIr>)rArJr
r
r�
isReservedKeyYszMorsel.isReservedKeycCsH|��|jkrtd|f��t|�s2td|f��||_||_||_dS)Nz Attempt to set a reserved key %rzIllegal key %r)rIr>rrr;r<r=)rArBrMZ	coded_valr
r
r�set\sz
Morsel.setcCs|j|j|jd�S)N)rBrFrG�r;r<r=rEr
r
r�__getstate__gs�zMorsel.__getstate__cCs"|d|_|d|_|d|_dS)NrBrFrGrZ)rA�stater
r
r�__setstate__ns

zMorsel.__setstate__�Set-Cookie:cCsd||�|�fS)Nz%s %s)�OutputString)rA�attrs�headerr
r
r�outputssz
Morsel.outputcCsd|jj|��fS)N�<%s: %s>)�	__class__rr_rEr
r
r�__repr__xszMorsel.__repr__cCsd|�|��dd�S)Nz�
        <script type="text/javascript">
        <!-- begin hiding
        document.cookie = "%s";
        // end hiding -->
        </script>
        rr)r_�replace)rAr`r
r
r�	js_output{s�zMorsel.js_outputcCs$g}|j}|d|j|jf�|dkr,|j}t|���}|D]�\}}|dkrNq<||krXq<|dkr�t|t�r�|d|j|t|�f�q<|dkr�t|t�r�|d|j||f�q<|dkr�t|t	�r�|d|j|t
|�f�q<||jk�r|�r|t	|j|��q<|d|j||f�q<t|�S)N�%s=%srr2r7z%s=%dr6)
r"rBrGr>�sortedrUrNr%r0rr�_flags�_semispacejoin)rAr`�resultr"rUrBrFr
r
rr_�s,zMorsel.OutputString)N)Nr^)N)N)rrr	�__doc__r>rjrC�propertyrBrFrGr@rLrP�object�__ne__rTrRrXrYr[r]rb�__str__rergr_r
r
r
rr1�sD�



	


r1z,\w\d!#%&'~_`><@,:/\$\*\+\-\.\^\|\)\(\?\}\{\=z\[\]z�
    \s*                            # Optional whitespace at start of cookie
    (?P<key>                       # Start of group 'key'
    [a	]+?   # Any word of at least one letter
    )                              # End of group 'key'
    (                              # Optional group: there may not be a value.
    \s*=\s*                          # Equal Sign
    (?P<val>                         # Start of group 'val'
    "(?:[^\\"]|\\.)*"                  # Any doublequoted string
    |                                  # or
    \w{3},\s[\w\d\s-]{9,11}\s[\d:]{8}\sGMT  # Special case for "expires" attr
    |                                  # or
    [a-]*      # Any word or empty string
    )                                # End of group 'val'
    )?                             # End of optional value group
    \s*                            # Any number of spaces.
    (\s+|;|$)                      # Ending either at space, semicolon, or EOS.
    c@sneZdZdZdd�Zdd�Zddd�Zd	d
�Zdd�Zddd�Z	e	Z
dd�Zddd�Zdd�Z
efdd�ZdS)rz'A container class for a set of Morsels.cCs||fS)a
real_value, coded_value = value_decode(STRING)
        Called prior to setting a cookie's value from the network
        representation.  The VALUE is the value read from HTTP
        header.
        Override this function to modify the behavior of cookies.
        r
�rArMr
r
r�value_decode�szBaseCookie.value_decodecCst|�}||fS)z�real_value, coded_value = value_encode(VALUE)
        Called prior to setting a cookie's value from the dictionary
        representation.  The VALUE is the value being assigned.
        Override this function to modify the behavior of cookies.
        r�rArMZstrvalr
r
r�value_encode�szBaseCookie.value_encodeNcCs|r|�|�dSrD)�load)rA�inputr
r
rrC�szBaseCookie.__init__cCs.|�|t��}|�|||�t�|||�dS)z+Private method for setting a cookie's valueN)�getr1rYr?r@)rArBZ
real_valuerG�Mr
r
rZ__set�szBaseCookie.__setcCs:t|t�rt�|||�n|�|�\}}|�|||�dS)zDictionary style assignment.N)rNr1r?r@ru�_BaseCookie__set)rArBrF�rval�cvalr
r
rr@�s
zBaseCookie.__setitem__r^�
cCs:g}t|���}|D]\}}|�|�||��q|�|�S)z"Return a string suitable for HTTP.)rirUr"rb�join)rAr`ra�seprlrUrBrFr
r
rrb�s
zBaseCookie.outputcCsJg}t|���}|D] \}}|�d|t|j�f�qd|jjt|�fS)Nrhrc)rirUr"�reprrFrdr�
_spacejoin)rA�lrUrBrFr
r
rre�s
zBaseCookie.__repr__cCs6g}t|���}|D]\}}|�|�|��qt|�S)z(Return a string suitable for JavaScript.)rirUr"rgr&)rAr`rlrUrBrFr
r
rrgs
zBaseCookie.js_outputcCs4t|t�r|�|�n|��D]\}}|||<qdS)z�Load cookies from a string (presumably HTTP_COOKIE) or
        from a dictionary.  Loading cookies from a dictionary 'd'
        is equivalent to calling:
            map(Cookie.__setitem__, d.keys(), d.values())
        N)rNr�_BaseCookie__parse_stringrU)rAZrawdatarBrFr
r
rrv
s


zBaseCookie.loadcCshd}t|�}g}d}d}d}d|kr2|k�rnn�|�||�}	|	sJ�q|	�d�|	�d�}
}|	�d�}|
ddkr�|s|q|�||
dd�|f�q|
��tjkr�|s�dS|dkr�|
��tjkr�|�||
df�q�dSn|�||
t	|�f�q|dk	�r|�||
|�
|�f�d}qdSqd}|D]>\}
}
}|
|k�rB|||
<n|\}}|�|
||�||
}�q$dS)	NrFrrrBrM�$T)r�match�group�endr"rIr1r>rjr+rsrz)rArZpattr'r
Zparsed_itemsZmorsel_seenZTYPE_ATTRIBUTEZ
TYPE_KEYVALUEr�rBrFry�tpr{r|r
r
rZ__parse_stringsF



zBaseCookie.__parse_string)N)Nr^r})N)rrr	rmrsrurCrzr@rbrqrergrv�_CookiePatternr�r
r
r
rr�s		
	

c@s eZdZdZdd�Zdd�ZdS)rz�
    SimpleCookie supports strings as cookie values.  When setting
    the value using the dictionary assignment notation, SimpleCookie
    calls the builtin str() to convert the value to a string.  Values
    received from HTTP are kept as strings.
    cCst|�|fSrD)r+rrr
r
rrs\szSimpleCookie.value_decodecCst|�}|t|�fSrD)rrrtr
r
rru_szSimpleCookie.value_encodeN)rrr	rmrsrur
r
r
rrUs)(rm�re�string�__all__r~r&rkr��	ExceptionrZ
ascii_lettersZdigitsZ_LegalCharsZ_UnescapedCharsrY�range�map�ordrrR�compile�escape�	fullmatchrrrr!r+Z_weekdaynameZ
_monthnamer0r?r1Z_LegalKeyCharsZ_LegalValueChars�ASCII�VERBOSEr�rrr
r
r
r�<module>'sr]
��

2�4����
�
http/__pycache__/server.cpython-38.opt-1.pyc000064400000104101151153537450014636 0ustar00U

e5d��@s
dZdZdddddgZddlZddlZddlZddlZddlZ	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlZddlZddlZdd	lmZdd
l	mZdZdZGd
d�dej�ZGdd�deje�Z Gdd�dej!�Z"Gdd�de"�Z#dd�Z$da%dd�Z&dd�Z'Gdd�de#�Z(dd�Z)e"e dddfdd�Z*e+dk�rddl,Z,e,�-�Z.e.j/dd d!d"�e.j/d#d$d%d&d'�e.j/d(d)e
�0�d*d+�e.j/d,d-de1d.d/d0�e.�2�Z3e3j4�r�e(Z5nee#e3j6d1�Z5Gd2d3�d3e �Z7e*e5e7e3j8e3j9d4�dS)5a@HTTP server classes.

Note: BaseHTTPRequestHandler doesn't implement any HTTP request; see
SimpleHTTPRequestHandler for simple implementations of GET, HEAD and POST,
and CGIHTTPRequestHandler for CGI scripts.

It does, however, optionally implement HTTP/1.1 persistent connections,
as of version 0.3.

Notes on CGIHTTPRequestHandler
------------------------------

This class implements GET and POST requests to cgi-bin scripts.

If the os.fork() function is not present (e.g. on Windows),
subprocess.Popen() is used as a fallback, with slightly altered semantics.

In all cases, the implementation is intentionally naive -- all
requests are executed synchronously.

SECURITY WARNING: DON'T USE THIS CODE UNLESS YOU ARE INSIDE A FIREWALL
-- it may execute arbitrary Python code or external programs.

Note that status code 200 is sent prior to execution of a CGI script, so
scripts cannot send other status codes such as 302 (redirect).

XXX To do:

- log requests even later (to capture byte count)
- log user-agent header and other interesting goodies
- send error log to separate file
z0.6�
HTTPServer�ThreadingHTTPServer�BaseHTTPRequestHandler�SimpleHTTPRequestHandler�CGIHTTPRequestHandler�N)�partial)�
HTTPStatusa�<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
        <title>Error response</title>
    </head>
    <body>
        <h1>Error response</h1>
        <p>Error code: %(code)d</p>
        <p>Message: %(message)s.</p>
        <p>Error code explanation: %(code)s - %(explain)s.</p>
    </body>
</html>
ztext/html;charset=utf-8c@seZdZdZdd�ZdS)r�cCs4tj�|�|jdd�\}}t�|�|_||_dS)z.Override server_bind to store the server name.N�)�socketserver�	TCPServer�server_bindZserver_address�socketZgetfqdn�server_name�server_port)�self�host�port�r�#/usr/lib64/python3.8/http/server.pyr
�szHTTPServer.server_bindN)�__name__�
__module__�__qualname__Zallow_reuse_addressr
rrrrr�sc@seZdZdZdS)rTN)rrrZdaemon_threadsrrrrr�sc
@sJeZdZdZdej��dZdeZ	e
ZeZ
dZdd�Zdd	�Zd
d�Zdd
�ZdFdd�ZdGdd�ZdHdd�Zdd�Zdd�Zdd�ZdIdd�Zdd�Ze�d d!�e�ed"�ed#d$��D��Z d%e e!d&�<d'd(�Z"d)d*�Z#dJd+d,�Z$d-d.�Z%d/d0d1d2d3d4d5gZ&dd6d7d8d9d:d;d<d=d>d?d@dAg
Z'dBdC�Z(dDZ)e*j+j,Z-dEd!�e.j/�0�D�Z1dS)Kra�HTTP request handler base class.

    The following explanation of HTTP serves to guide you through the
    code as well as to expose any misunderstandings I may have about
    HTTP (so you don't need to read the code to figure out I'm wrong
    :-).

    HTTP (HyperText Transfer Protocol) is an extensible protocol on
    top of a reliable stream transport (e.g. TCP/IP).  The protocol
    recognizes three parts to a request:

    1. One line identifying the request type and path
    2. An optional set of RFC-822-style headers
    3. An optional data part

    The headers and data are separated by a blank line.

    The first line of the request has the form

    <command> <path> <version>

    where <command> is a (case-sensitive) keyword such as GET or POST,
    <path> is a string containing path information for the request,
    and <version> should be the string "HTTP/1.0" or "HTTP/1.1".
    <path> is encoded using the URL encoding scheme (using %xx to signify
    the ASCII character with hex code xx).

    The specification specifies that lines are separated by CRLF but
    for compatibility with the widest range of clients recommends
    servers also handle LF.  Similarly, whitespace in the request line
    is treated sensibly (allowing multiple spaces between components
    and allowing trailing whitespace).

    Similarly, for output, lines ought to be separated by CRLF pairs
    but most clients grok LF characters just fine.

    If the first line of the request has the form

    <command> <path>

    (i.e. <version> is left out) then this is assumed to be an HTTP
    0.9 request; this form has no optional headers and data part and
    the reply consists of just the data.

    The reply form of the HTTP 1.x protocol again has three parts:

    1. One line giving the response code
    2. An optional set of RFC-822-style headers
    3. The data

    Again, the headers and data are separated by a blank line.

    The response code line has the form

    <version> <responsecode> <responsestring>

    where <version> is the protocol version ("HTTP/1.0" or "HTTP/1.1"),
    <responsecode> is a 3-digit response code indicating success or
    failure of the request, and <responsestring> is an optional
    human-readable string explaining what the response code means.

    This server parses the request and the headers, and then calls a
    function specific to the request type (<command>).  Specifically,
    a request SPAM will be handled by a method do_SPAM().  If no
    such method exists the server sends an error response to the
    client.  If it exists, it is called with no arguments:

    do_SPAM()

    Note that the request name is case sensitive (i.e. SPAM and spam
    are different requests).

    The various request details are stored in instance variables:

    - client_address is the client IP address in the form (host,
    port);

    - command, path and version are the broken-down request line;

    - headers is an instance of email.message.Message (or a derived
    class) containing the header information;

    - rfile is a file object open for reading positioned at the
    start of the optional input data part;

    - wfile is a file object open for writing.

    IT IS IMPORTANT TO ADHERE TO THE PROTOCOL FOR WRITING!

    The first thing to be written must be the response line.  Then
    follow 0 or more header lines, then a blank line, and then the
    actual data (if any).  The meaning of the header lines depends on
    the command executed by the server; in most cases, when data is
    returned, there should be at least one header line of the form

    Content-type: <type>/<subtype>

    where <type> and <subtype> should be registered MIME types,
    e.g. "text/html" or "text/plain".

    zPython/rz	BaseHTTP/�HTTP/0.9c
Cs�d|_|j|_}d|_t|jd�}|�d�}||_|��}t	|�dkrLdSt	|�dk�r&|d}zT|�
d	�srt�|�d
d�d}|�d�}t	|�d
kr�t�t|d�t|d�f}Wn,tt
fk
r�|�tjd|�YdSX|dk�r|jdk�rd|_|dk�r |�tjd|�dS||_d
t	|�k�rBdk�sZn|�tjd|�dS|dd
�\}}t	|�d
k�r�d|_|dk�r�|�tjd|�dS|||_|_|j�
d��r�d
|j�d
�|_ztjj|j|jd�|_Wn�tjjk
�r(}z|�tjdt|��WY�dSd}~XYnBtjjk
�rh}z|�tjdt|��WY�dSd}~XYnX|j�dd�}	|	��dk�r�d|_n |	��dk�r�|jdk�r�d|_|j�dd�}
|
��dk�r�|jdk�r�|jdk�r�|� ��s�dSdS) aHParse a request (internal).

        The request should be stored in self.raw_requestline; the results
        are in self.command, self.path, self.request_version and
        self.headers.

        Return True for success, False for failure; on failure, any relevant
        error response has already been sent back.

        NTz
iso-8859-1z
rF����zHTTP/�/r	�.r
zBad request version (%r))r	r	zHTTP/1.1)r
rzInvalid HTTP version (%s)zBad request syntax (%r)ZGETzBad HTTP/0.9 request type (%r)z//)Z_classz
Line too longzToo many headers�
Connection��close�
keep-aliveZExpectz100-continue)!�command�default_request_version�request_version�close_connection�str�raw_requestline�rstrip�requestline�split�len�
startswith�
ValueError�int�
IndexError�
send_errorrZBAD_REQUEST�protocol_versionZHTTP_VERSION_NOT_SUPPORTED�path�lstrip�http�clientZ
parse_headers�rfile�MessageClass�headersZLineTooLongZREQUEST_HEADER_FIELDS_TOO_LARGEZ
HTTPException�get�lower�handle_expect_100)r�versionr)�wordsZbase_version_numberZversion_numberr"r2�errZconntypeZexpectrrr�
parse_requests�


�
��
�
������
z$BaseHTTPRequestHandler.parse_requestcCs|�tj�|��dS)a7Decide what to do with an "Expect: 100-continue" header.

        If the client is expecting a 100 Continue response, we must
        respond with either a 100 Continue or a final response before
        waiting for the request body. The default is to always respond
        with a 100 Continue. You can behave differently (for example,
        reject unauthorized requests) by overriding this method.

        This method should either return True (possibly after sending
        a 100 Continue response) or send an error response and return
        False.

        T)�send_response_onlyrZCONTINUE�end_headers�rrrrr;xsz(BaseHTTPRequestHandler.handle_expect_100c
Cs�z�|j�d�|_t|j�dkrBd|_d|_d|_|�tj	�WdS|jsTd|_
WdS|��sbWdSd|j}t||�s�|�tj
d|j�WdSt||�}|�|j��Wn<tjk
r�}z|�d|�d|_
WY�dSd}~XYnXdS)	z�Handle a single HTTP request.

        You normally don't need to override this method; see the class
        __doc__ string for information on how to handle specific HTTP
        commands such as GET and POST.

        iirNTZdo_zUnsupported method (%r)zRequest timed out: %r)r6�readliner'r+r)r$r"r0rZREQUEST_URI_TOO_LONGr%r?�hasattr�NOT_IMPLEMENTED�getattr�wfile�flushrZtimeout�	log_error)rZmname�method�errr�handle_one_request�s6

�
z)BaseHTTPRequestHandler.handle_one_requestcCs"d|_|��|js|��qdS)z&Handle multiple requests if necessary.TN)r%rLrBrrr�handle�szBaseHTTPRequestHandler.handleNcCsz|j|\}}Wntk
r.d\}}YnX|dkr<|}|dkrH|}|�d||�|�||�|�dd�d}|dkr�|tjtjtjfkr�|j	|t
j|dd�t
j|dd�d	�}|�d
d�}|�d|j
�|�d
tt|���|��|jdk�r|�r|j�|�dS)akSend and log an error reply.

        Arguments are
        * code:    an HTTP error code
                   3 digits
        * message: a simple optional 1 line reason phrase.
                   *( HTAB / SP / VCHAR / %x80-FF )
                   defaults to short entry matching the response code
        * explain: a detailed message defaults to the long entry
                   matching the response code.

        This sends an error response (so it must be called before any
        output has been generated), logs the error, and finally sends
        a piece of HTML explaining the error to the user.

        )�???rNNzcode %d, message %srr ��F��quote)�code�message�explainzUTF-8�replacezContent-Type�Content-LengthZHEAD)�	responses�KeyErrorrI�
send_response�send_headerrZ
NO_CONTENTZ
RESET_CONTENT�NOT_MODIFIED�error_message_format�html�escape�encode�error_content_typer&r+rAr"rG�write)rrRrSrTZshortmsgZlongmsgZbodyZcontentrrrr0�s:���z!BaseHTTPRequestHandler.send_errorcCs:|�|�|�||�|�d|���|�d|���dS)z�Add the response header to the headers buffer and log the
        response code.

        Also send two standard headers with the server software
        version and the current date.

        ZServerZDateN)�log_requestr@rZ�version_string�date_time_string�rrRrSrrrrY�s
z$BaseHTTPRequestHandler.send_responsecCsd|jdkr`|dkr0||jkr,|j|d}nd}t|d�s@g|_|j�d|j||f�dd��dS)	zSend the response header only.rNrr�_headers_bufferz
%s %d %s
�latin-1�strict)r$rWrDrf�appendr1r_rerrrr@�s



��z)BaseHTTPRequestHandler.send_response_onlycCsl|jdkr6t|d�sg|_|j�d||f�dd��|��dkrh|��dkrVd|_n|��d	krhd
|_dS)z)Send a MIME header to the headers buffer.rrfz%s: %s
rgrhZ
connectionr Tr!FN)r$rDrfrir_r:r%)r�keyword�valuerrrrZs

�z"BaseHTTPRequestHandler.send_headercCs"|jdkr|j�d�|��dS)z,Send the blank line ending the MIME headers.rs
N)r$rfri�
flush_headersrBrrrrAs
z"BaseHTTPRequestHandler.end_headerscCs(t|d�r$|j�d�|j��g|_dS)Nrf�)rDrGra�joinrfrBrrrrls
z$BaseHTTPRequestHandler.flush_headers�-cCs.t|t�r|j}|�d|jt|�t|��dS)zNLog an accepted request.

        This is called by send_response().

        z
"%s" %s %sN)�
isinstancerrk�log_messager)r&)rrR�sizerrrrb s
�z"BaseHTTPRequestHandler.log_requestcGs|j|f|��dS)z�Log an error.

        This is called when a request cannot be fulfilled.  By
        default it passes the message on to log_message().

        Arguments are the same as for log_message().

        XXX This should go to the separate error log.

        N)rq)r�format�argsrrrrI+sz BaseHTTPRequestHandler.log_errorcCsi|]}|d|d���qS)z\xZ02xr)�.0�crrr�
<dictcomp>;sz!BaseHTTPRequestHandler.<dictcomp>� ��z\\�\cGs2||}tj�d|��|��|�|j�f�dS)aZLog an arbitrary message.

        This is used by all other logging functions.  Override
        it if you have specific logging wishes.

        The first argument, FORMAT, is a format string for the
        message to be logged.  If the format string contains
        any % escapes requiring parameters, they should be
        specified as subsequent arguments (it's just like
        printf!).

        The client ip and current date/time are prefixed to
        every message.

        Unicode control characters are replaced with escaped hex
        before writing the output to stderr.

        z%s - - [%s] %s
N)�sys�stderrra�address_string�log_date_time_string�	translate�_control_char_table)rrsrtrSrrrrq>s
��z"BaseHTTPRequestHandler.log_messagecCs|jd|jS)z*Return the server software version string.� )�server_version�sys_versionrBrrrrcXsz%BaseHTTPRequestHandler.version_stringcCs |dkrt��}tjj|dd�S)z@Return the current date and time formatted for a message header.NT)Zusegmt)�time�email�utilsZ
formatdate)rZ	timestamprrrrd\sz'BaseHTTPRequestHandler.date_time_stringc	CsBt��}t�|�\	}}}}}}}}	}
d||j|||||f}|S)z.Return the current time formatted for logging.z%02d/%3s/%04d %02d:%02d:%02d)r��	localtime�	monthname)rZnowZyearZmonthZdayZhhZmmZss�x�y�z�srrrrbs�z+BaseHTTPRequestHandler.log_date_time_stringZMonZTueZWedZThuZFriZSatZSunZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDeccCs
|jdS)zReturn the client address.r)�client_addressrBrrrr~psz%BaseHTTPRequestHandler.address_string�HTTP/1.0cCsi|]}||j|jf�qSr)�phraseZdescription)ru�vrrrrws�)NN)N)N)roro)N)2rrr�__doc__r|r<r*r��__version__r��DEFAULT_ERROR_MESSAGEr\�DEFAULT_ERROR_CONTENT_TYPEr`r#r?r;rLrMr0rYr@rZrArlrbrIr&�	maketrans�	itertools�chain�ranger��ordrqrcrdrZweekdaynamer�r~r1r4r5ZHTTPMessager7r�__members__�valuesrWrrrrr�s^gj%
5


�
�	�cs�eZdZdZdeZdd��fdd�
Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
ejsle��ej��Ze�ddddd���ZS)raWSimple HTTP request handler with GET and HEAD commands.

    This serves files from the current directory and any of its
    subdirectories.  The MIME type for files is determined by
    calling the .guess_type() method.

    The GET and HEAD requests are identical except that the HEAD
    request omits the actual contents of the file.

    zSimpleHTTP/N��	directorycs(|dkrt��}||_t�j||�dS�N)�os�getcwdr��super�__init__)rr�rt�kwargs��	__class__rrr��sz!SimpleHTTPRequestHandler.__init__cCs.|��}|r*z|�||j�W5|��XdS)zServe a GET request.N)�	send_headr �copyfilerG�r�frrr�do_GET�s
zSimpleHTTPRequestHandler.do_GETcCs|��}|r|��dS)zServe a HEAD request.N)r�r r�rrr�do_HEAD�sz SimpleHTTPRequestHandler.do_HEADcCs^|�|j�}d}tj�|�r�tj�|j�}|j�d�s�|�t	j
�|d|d|dd|d|df}tj�|�}|�d|�|�
�dSd	D]&}tj�||�}tj�|�r�|}q�q�|�|�S|�|�}|�d�r�|�t	jd
�dSzt|d�}Wn&tk
�r|�t	jd
�YdSX�z"t�|���}d|jk�r�d
|jk�r�ztj�|jd�}	Wnttttfk
�r|YnzX|	j dk�r�|	j!t"j#j$d�}	|	j t"j#j$k�r�t"j"�%|j&t"j#j$�}
|
j!dd�}
|
|	k�r�|�t	j'�|�
�|�(�WdS|�t	j)�|�d|�|�dt*|d��|�d|�+|j&��|�
�|WS|�(��YnXdS)a{Common code for GET and HEAD commands.

        This sends the response code and MIME headers.

        Return value is either a file object (which has to be copied
        to the outputfile by the caller unless the command was HEAD,
        and must be closed by the caller under all circumstances), or
        None, in which case the caller has nothing further to do.

        Nrrr	r
r�ZLocation)z
index.htmlz	index.htmzFile not found�rbzIf-Modified-Sincez
If-None-Match)�tzinfo)Zmicrosecond�Content-typerV�z
Last-Modified),�translate_pathr2r��isdir�urllib�parseZurlsplit�endswithrYrZMOVED_PERMANENTLYZ
urlunsplitrZrArn�exists�list_directory�
guess_typer0�	NOT_FOUND�open�OSError�fstat�filenor8r�r�Zparsedate_to_datetime�	TypeErrorr/�
OverflowErrorr-r�rU�datetime�timezoneZutcZ
fromtimestamp�st_mtimer[r �OKr&rd)rr2r��partsZ	new_partsZnew_url�indexZctypeZfsZimsZ
last_modifrrrr��s��


���

�z"SimpleHTTPRequestHandler.send_headc
	Cs�zt�|�}Wn$tk
r2|�tjd�YdSX|jdd�d�g}ztjj	|j
dd�}Wn"tk
r�tj�	|j
�}YnXtj
|dd	�}t��}d
|}|�d�|�d�|�d
|�|�d|�|�d|�|�d�|D]v}tj
�||�}|}	}
tj
�|��r$|d}	|d}
tj
�|��r:|d}	|�dtjj|
dd�tj
|	dd	�f�q�|�d�d�|��|d�}t��}|�|�|�d�|�tj�|�dd|�|�dtt|���|��|S)z�Helper to produce a directory listing (absent index.html).

        Return value is either a file object, or None (indicating an
        error).  In either case, the headers are sent, making the
        interface the same as for send_head().

        zNo permission to list directoryNcSs|��Sr�)r:)�arrr�<lambda>rmz9SimpleHTTPRequestHandler.list_directory.<locals>.<lambda>)�key�
surrogatepass��errorsFrPzDirectory listing for %szZ<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">z
<html>
<head>z@<meta http-equiv="Content-Type" content="text/html; charset=%s">z<title>%s</title>
</head>z<body>
<h1>%s</h1>z	<hr>
<ul>r�@z<li><a href="%s">%s</a></li>z</ul>
<hr>
</body>
</html>
�
�surrogateescaperr�ztext/html; charset=%srV) r��listdirr�r0rr��sortr�r��unquoter2�UnicodeDecodeErrorr]r^r|�getfilesystemencodingrirnr��islinkrQr_�io�BytesIOra�seekrYr�rZr&r+rA)
rr2�list�rZdisplaypath�enc�title�name�fullnameZdisplaynameZlinknameZencodedr�rrrr�sh�
�


�
���


z'SimpleHTTPRequestHandler.list_directorycCs�|�dd�d}|�dd�d}|���d�}ztjj|dd�}Wn tk
rbtj�|�}YnXt�|�}|�d�}t	d|�}|j
}|D]0}tj�
|�s�|tjtjfkr�q�tj�||�}q�|r�|d7}|S)	z�Translate a /-separated PATH to the local filename syntax.

        Components that mean special things to the local file system
        (e.g. drive or directory names) are ignored.  (XXX They should
        probably be diagnosed.)

        �?r	r�#rr�r�N)r*r(r�r�r�r�r��	posixpath�normpath�filterr�r�r2�dirname�curdir�pardirrn)rr2Ztrailing_slashr=Zwordrrrr�:s$	


z'SimpleHTTPRequestHandler.translate_pathcCst�||�dS)a�Copy all data between two file objects.

        The SOURCE argument is a file object open for reading
        (or anything with a read() method) and the DESTINATION
        argument is a file object open for writing (or
        anything with a write() method).

        The only reason for overriding this would be to change
        the block size or perhaps to replace newlines by CRLF
        -- note however that this the default server uses this
        to copy binary data as well.

        N)�shutilZcopyfileobj)r�sourceZ
outputfilerrrr�Xsz!SimpleHTTPRequestHandler.copyfilecCsLt�|�\}}||jkr"|j|S|��}||jkr>|j|S|jdSdS)a�Guess the type of a file.

        Argument is a PATH (a filename).

        Return value is a string of the form type/subtype,
        usable for a MIME Content-type header.

        The default implementation looks the file's extension
        up in the table self.extensions_map, using application/octet-stream
        as a default; however it would be permissible (if
        slow) to look inside the data to make a better guess.

        rN)r��splitext�extensions_mapr:)rr2�baseZextrrrr�hs



z#SimpleHTTPRequestHandler.guess_typezapplication/octet-streamz
text/plain)r�.pyz.cz.h)rrrr�r�r�r�r�r�r�r�r�r�r��	mimetypesZinitedZinitZ	types_map�copyr��update�
__classcell__rrr�rr�s&	W:
�c	Cs�|�d�\}}}tj�|�}|�d�}g}|dd�D],}|dkrL|��q6|r6|dkr6|�|�q6|r�|��}|r�|dkr�|��d}q�|dkr�d}nd}|r�d�||f�}dd�|�|f}d�|�}|S)a�
    Given a URL path, remove extra '/'s and '.' path elements and collapse
    any '..' references and returns a collapsed path.

    Implements something akin to RFC-2396 5.2 step 6 to parse relative paths.
    The utility of this function is limited to is_cgi method and helps
    preventing some security attacks.

    Returns: The reconstituted URL, which will always start with a '/'.

    Raises: IndexError if too many '..' occur within the path.

    r�rNrz..rr)�	partitionr�r�r�r*�poprirn)	r2�_�query�
path_partsZ
head_parts�partZ	tail_partZ	splitpath�collapsed_pathrrr�_url_collapse_path�s.


r�cCsrtrtSzddl}Wntk
r*YdSXz|�d�daWn.tk
rldtdd�|��D��aYnXtS)	z$Internal routine to get nobody's uidrNr�nobodyr
r	css|]}|dVqdS)r
Nr)rur�rrr�	<genexpr>�sznobody_uid.<locals>.<genexpr>)r��pwd�ImportError�getpwnamrX�maxZgetpwall)r�rrr�
nobody_uid�s r�cCst�|tj�S)zTest for executable file.)r��access�X_OK)r2rrr�
executable�src@sVeZdZdZeed�ZdZdd�Zdd�Z	dd	�Z
d
dgZdd
�Zdd�Z
dd�ZdS)rz�Complete HTTP server with GET, HEAD and POST commands.

    GET and HEAD also support running CGI scripts.

    The POST command is *only* implemented for CGI scripts.

    �forkrcCs$|��r|��n|�tjd�dS)zRServe a POST request.

        This is only implemented for CGI scripts.

        zCan only POST to CGI scriptsN)�is_cgi�run_cgir0rrErBrrr�do_POST�s
�zCGIHTTPRequestHandler.do_POSTcCs|��r|��St�|�SdS)z-Version of send_head that support CGI scriptsN)rrrr�rBrrrr��szCGIHTTPRequestHandler.send_headcCsPt|j�}|�dd�}|d|�||dd�}}||jkrL||f|_dSdS)a3Test whether self.path corresponds to a CGI script.

        Returns True and updates the cgi_info attribute to the tuple
        (dir, rest) if self.path requires running a CGI script.
        Returns False otherwise.

        If any exception is raised, the caller should assume that
        self.path was rejected as invalid and act accordingly.

        The default implementation tests whether the normalized url
        path begins with one of the strings in self.cgi_directories
        (and the next character is a '/' or the end of the string).

        rr	NTF)r�r2�find�cgi_directories�cgi_info)rr�Zdir_sep�head�tailrrrr�s


zCGIHTTPRequestHandler.is_cgiz/cgi-binz/htbincCst|�S)z1Test whether argument path is an executable file.)r)rr2rrr�
is_executablesz#CGIHTTPRequestHandler.is_executablecCstj�|�\}}|��dkS)z.Test whether argument path is a Python script.)r�z.pyw)r�r2r�r:)rr2r
rrrr�	is_pythonszCGIHTTPRequestHandler.is_pythonc)	Cs�|j\}}|d|}|�dt|�d�}|dkr�|d|�}||dd�}|�|�}tj�|�r�||}}|�dt|�d�}q*q�q*|�d�\}}}	|�d�}|dkr�|d|�||d�}
}n
|d}
}|d|
}|�|�}tj�|��s
|�	t
jd|�dStj�|��s.|�	t
j
d|�dS|�|�}
|j�sF|
�sh|�|��sh|�	t
j
d	|�dSt�tj�}|��|d
<|jj|d<d|d
<|j|d<t|jj�|d<|j|d<tj�|�}||d<|�|�|d<||d<|	�r�|	|d<|jd|d<|j� d�}|�r�|�!�}t|�dk�r�ddl"}ddl#}|d|d<|d�$�dk�r�z"|d�%d�}|�&|��'d�}Wn|j(t)fk
�r�Yn&X|�!d�}t|�dk�r�|d|d<|j� d�dk�r�|j�*�|d<n|jd|d<|j� d�}|�r||d <|j� d!�}|�r||d"<g}|j�+d#�D]>}|dd�d$k�rR|�,|�-��n||d%d��!d&�}�q,d&�.|�|d'<|j� d(�}|�r�||d)<t/d|j�0d*g��}d+�.|�}|�r�||d,<d-D]}|�1|d��q�|�2t
j3d.�|�4�|	�5d/d0�}|j�r|
g}d1|k�r|�,|�t6�}|j7�8�t�9�}|dk�r�t�:|d�\}}t;�;|j<gggd�d�r~|j<�=d��sN�q~�qN|�r�|�>d2|�dSz\zt�?|�Wnt@k
�r�YnXt�A|j<�B�d�t�A|j7�B�d�t�C|||�Wn(|j�D|jE|j�t�Fd3�YnX�n�ddlG} |g}!|�|��rrtHjI}"|"�$��Jd4��rf|"dd5�|"d6d�}"|"d7g|!}!d1|	k�r�|!�,|	�|�Kd8| �L|!��ztM|�}#WntNtOfk
�r�d}#YnX| jP|!| jQ| jQ| jQ|d9�}$|j�$�d:k�r|#dk�r|j<�=|#�}%nd}%t;�;|j<jRgggd�d�r>|j<jR�Sd��s
�q>�q
|$�T|%�\}&}'|j7�U|&�|'�rj|�>d;|'�|$jV�W�|$jX�W�|$jY}(|(�r�|�>d2|(�n
|�Kd<�dS)=zExecute a CGI script.rr	rNr�rzNo such CGI script (%r)z#CGI script is not a plain file (%r)z!CGI script is not executable (%r)ZSERVER_SOFTWAREZSERVER_NAMEzCGI/1.1ZGATEWAY_INTERFACEZSERVER_PROTOCOLZSERVER_PORTZREQUEST_METHODZ	PATH_INFOZPATH_TRANSLATEDZSCRIPT_NAME�QUERY_STRINGZREMOTE_ADDR�
authorizationr
Z	AUTH_TYPEZbasic�ascii�:ZREMOTE_USERzcontent-typeZCONTENT_TYPEzcontent-length�CONTENT_LENGTH�referer�HTTP_REFERER�acceptz	

 ��,ZHTTP_ACCEPTz
user-agent�HTTP_USER_AGENTZcookiez, �HTTP_COOKIE)rZREMOTE_HOSTrrrrzScript output follows�+r��=zCGI script exit status %#xryzw.exe������z-uzcommand: %s)�stdin�stdoutr}�envZpostz%szCGI script exited OK)Zr	rr+r�r�r2r�r�r�r0rr��isfileZ	FORBIDDENr
�	have_forkrr�Zdeepcopy�environrcZserverrr1r&rr"r�r�r�r�r8r9r*�base64�binasciir:r_Zdecodebytes�decode�Error�UnicodeErrorZget_content_typeZgetallmatchingheadersri�striprnr�Zget_all�
setdefaultrYr�rlrUr�rGrHr�waitpid�selectr6�readrI�setuidr��dup2r��execveZhandle_errorZrequest�_exit�
subprocessr|rr�rqZlist2cmdliner.r�r-�Popen�PIPEZ_sockZrecvZcommunicaterar}r r�
returncode))r�dir�restr2�iZnextdirZnextrestZ	scriptdirr�r�ZscriptZ
scriptnameZ
scriptfileZispyr Zuqrestrr$r%Zlengthrr�lineZua�coZ
cookie_str�kZ
decoded_queryrtr��pid�stsr2ZcmdlineZinterp�nbytes�p�datarr}Zstatusrrrrs<





��
�


�








�

zCGIHTTPRequestHandler.run_cgiN)rrrr�rDr�r"Zrbufsizerr�rrrr
rrrrrr�s	
cGs4tj|tjtjd��}tt|��\}}}}}||fS)N)�type�flags)rZgetaddrinfoZSOCK_STREAMZ
AI_PASSIVE�next�iter)ZaddressZinfosZfamilyrA�protoZ	canonnameZsockaddrrrr�_get_best_family�s�rFr�i@c	Cs�t||�\|_}||_|||���}|j��dd�\}}d|krLd|�d�n|}td|�d|�d|�d|�d	�	�z|��Wn&tk
r�td
�t�	d�YnXW5QRXdS)zmTest the HTTP request handler class.

    This runs an HTTP server on port 8000 (or the port argument).

    Nr
r�[�]zServing HTTP on z port z	 (http://z/) ...z&
Keyboard interrupt received, exiting.r)
rFZaddress_familyr1rZgetsockname�printZ
serve_forever�KeyboardInterruptr|�exit)	�HandlerClass�ServerClassZprotocolr�bindZaddrZhttpdrZurl_hostrrr�test�s�rO�__main__z--cgi�
store_truezRun as CGI Server)�action�helpz--bindz-bZADDRESSz8Specify alternate bind address [default: all interfaces])�metavarrSz--directoryz-dz9Specify alternative directory [default:current directory])�defaultrSrZstorer�z&Specify alternate port [default: 8000])rRrUrA�nargsrSr�cseZdZ�fdd�Z�ZS)�DualStackServerc	s4t�t��|j�tjtjd�W5QRXt���S)Nr)	�
contextlib�suppress�	ExceptionrZ
setsockoptZIPPROTO_IPV6ZIPV6_V6ONLYr�r
rBr�rrr
s�zDualStackServer.server_bind)rrrr
r�rrr�rrWsrW)rLrMrrN):r�r��__all__r�r�Zemail.utilsr�r]Zhttp.clientr4r�r�r�r�r�r,r�rrr|r�Zurllib.parser�rX�	functoolsrrr�r�rrZThreadingMixInrZStreamRequestHandlerrrr�r�r�rrrFrOr�argparse�ArgumentParser�parser�add_argumentr�r.�
parse_argsrtZcgiZ
handler_classr�rWrrNrrrr�<module>s�R�s
0
�

�
�����http/__pycache__/__init__.cpython-38.opt-2.pyc000064400000012411151153537450015072 0ustar00U

e5d��@s&ddlmZdgZGdd�de�ZdS)�)�IntEnum�
HTTPStatusc@seZdZd@dd�ZdZdZdZdZdZd	Z	d
Z
dZdZd
Z
dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZd Z d!Z!d"Z"d#Z#d$Z$d%Z%d&Z&d'Z'd(Z(d)Z)d*Z*d+Z+d,Z,d-Z-d.Z.d/Z/d0Z0d1Z1d2Z2d3Z3d4Z4d5Z5d6Z6d7Z7d8Z8d9Z9d:Z:d;Z;d<Z<d=Z=d>Z>d?S)Ar�cCs"t�||�}||_||_||_|S)N)�int�__new__�_value_�phrase�description)�cls�valuerr	�obj�r
�%/usr/lib64/python3.8/http/__init__.pyrs
zHTTPStatus.__new__)�dZContinuez!Request received, please continue)�ezSwitching Protocolsz.Switching to new protocol; obey Upgrade header)�fZ
Processing)���OKz#Request fulfilled, document follows)��ZCreatedzDocument created, URL follows)��ZAcceptedz/Request accepted, processing continues off-line)��zNon-Authoritative InformationzRequest fulfilled from cache)��z
No Contentz"Request fulfilled, nothing follows)��z
Reset Contentz"Clear input form for further input)��zPartial ContentzPartial content follows)��zMulti-Status)��zAlready Reported)��zIM Used)i,zMultiple Choicesz,Object has several resources -- see URI list)i-zMoved Permanently�(Object moved permanently -- see URI list)i.ZFound�(Object moved temporarily -- see URI list)i/z	See Otherz'Object moved -- see Method and URL list)i0zNot Modifiedz)Document has not changed since given time)i1z	Use Proxyz@You must use proxy specified in Location to access this resource)i3zTemporary Redirectr)i4zPermanent Redirectr)i�zBad Requestz(Bad request syntax or unsupported method)i�ZUnauthorizedz*No permission -- see authorization schemes)i�zPayment Requiredz"No payment -- see charging schemes)i�Z	Forbiddenz0Request forbidden -- authorization will not help)i�z	Not FoundzNothing matches the given URI)i�zMethod Not Allowedz-Specified method is invalid for this resource)i�zNot Acceptablez%URI not available in preferred format)i�zProxy Authentication Requiredz7You must authenticate with this proxy before proceeding)i�zRequest Timeoutz"Request timed out; try again later)i�ZConflictzRequest conflict)i�ZGonez5URI no longer exists and has been permanently removed)i�zLength Requiredz"Client must specify Content-Length)i�zPrecondition Failedz Precondition in headers is false)i�zRequest Entity Too LargezEntity is too large)i�zRequest-URI Too LongzURI is too long)i�zUnsupported Media Typez!Entity body in unsupported format)i�zRequested Range Not SatisfiablezCannot satisfy request range)i�zExpectation Failedz'Expect condition could not be satisfied)i�zMisdirected Requestz(Server is not able to produce a response)i�zUnprocessable Entity)i�ZLocked)i�zFailed Dependency)i�zUpgrade Required)i�zPrecondition Requiredz8The origin server requires the request to be conditional)i�zToo Many RequestszOThe user has sent too many requests in a given amount of time ("rate limiting"))i�zRequest Header Fields Too LargezVThe server is unwilling to process the request because its header fields are too large)i�zUnavailable For Legal ReasonszOThe server is denying access to the resource as a consequence of a legal demand)i�zInternal Server ErrorzServer got itself in trouble)i�zNot Implementedz&Server does not support this operation)i�zBad Gatewayz+Invalid responses from another server/proxy)i�zService Unavailablez8The server cannot process the request due to a high load)i�zGateway Timeoutz4The gateway server did not receive a timely response)i�zHTTP Version Not SupportedzCannot fulfill request)i�zVariant Also Negotiates)i�zInsufficient Storage)i�z
Loop Detected)i�zNot Extended)i�zNetwork Authentication Requiredz7The client needs to authenticate to gain network accessN)r)?�__name__�
__module__�__qualname__rZCONTINUEZSWITCHING_PROTOCOLSZ
PROCESSINGrZCREATEDZACCEPTEDZNON_AUTHORITATIVE_INFORMATIONZ
NO_CONTENTZ
RESET_CONTENTZPARTIAL_CONTENTZMULTI_STATUSZALREADY_REPORTEDZIM_USEDZMULTIPLE_CHOICESZMOVED_PERMANENTLYZFOUNDZ	SEE_OTHERZNOT_MODIFIEDZ	USE_PROXYZTEMPORARY_REDIRECTZPERMANENT_REDIRECTZBAD_REQUESTZUNAUTHORIZEDZPAYMENT_REQUIREDZ	FORBIDDENZ	NOT_FOUNDZMETHOD_NOT_ALLOWEDZNOT_ACCEPTABLEZPROXY_AUTHENTICATION_REQUIREDZREQUEST_TIMEOUTZCONFLICTZGONEZLENGTH_REQUIREDZPRECONDITION_FAILEDZREQUEST_ENTITY_TOO_LARGEZREQUEST_URI_TOO_LONGZUNSUPPORTED_MEDIA_TYPEZREQUESTED_RANGE_NOT_SATISFIABLEZEXPECTATION_FAILEDZMISDIRECTED_REQUESTZUNPROCESSABLE_ENTITYZLOCKEDZFAILED_DEPENDENCYZUPGRADE_REQUIREDZPRECONDITION_REQUIREDZTOO_MANY_REQUESTSZREQUEST_HEADER_FIELDS_TOO_LARGEZUNAVAILABLE_FOR_LEGAL_REASONSZINTERNAL_SERVER_ERRORZNOT_IMPLEMENTEDZBAD_GATEWAYZSERVICE_UNAVAILABLEZGATEWAY_TIMEOUTZHTTP_VERSION_NOT_SUPPORTEDZVARIANT_ALSO_NEGOTIATESZINSUFFICIENT_STORAGEZ
LOOP_DETECTEDZNOT_EXTENDEDZNETWORK_AUTHENTICATION_REQUIREDr
r
r
rrsx
	N)�enumr�__all__rr
r
r
r�<module>shttp/__pycache__/__init__.cpython-38.pyc000064400000013662151153537450014143 0ustar00U

e5d��@s&ddlmZdgZGdd�de�ZdS)�)�IntEnum�
HTTPStatusc@seZdZdZdAdd�ZdZdZdZdZd	Z	d
Z
dZdZd
Z
dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZd Z d!Z!d"Z"d#Z#d$Z$d%Z%d&Z&d'Z'd(Z(d)Z)d*Z*d+Z+d,Z,d-Z-d.Z.d/Z/d0Z0d1Z1d2Z2d3Z3d4Z4d5Z5d6Z6d7Z7d8Z8d9Z9d:Z:d;Z;d<Z<d=Z=d>Z>d?Z?d@S)Bra�HTTP status codes and reason phrases

    Status codes from the following RFCs are all observed:

        * RFC 7231: Hypertext Transfer Protocol (HTTP/1.1), obsoletes 2616
        * RFC 6585: Additional HTTP Status Codes
        * RFC 3229: Delta encoding in HTTP
        * RFC 4918: HTTP Extensions for WebDAV, obsoletes 2518
        * RFC 5842: Binding Extensions to WebDAV
        * RFC 7238: Permanent Redirect
        * RFC 2295: Transparent Content Negotiation in HTTP
        * RFC 2774: An HTTP Extension Framework
        * RFC 7725: An HTTP Status Code to Report Legal Obstacles
        * RFC 7540: Hypertext Transfer Protocol Version 2 (HTTP/2)
    �cCs"t�||�}||_||_||_|S)N)�int�__new__�_value_�phrase�description)�cls�valuerr	�obj�r
�%/usr/lib64/python3.8/http/__init__.pyrs
zHTTPStatus.__new__)�dZContinuez!Request received, please continue)�ezSwitching Protocolsz.Switching to new protocol; obey Upgrade header)�fZ
Processing)���OKz#Request fulfilled, document follows)��ZCreatedzDocument created, URL follows)��ZAcceptedz/Request accepted, processing continues off-line)��zNon-Authoritative InformationzRequest fulfilled from cache)��z
No Contentz"Request fulfilled, nothing follows)��z
Reset Contentz"Clear input form for further input)��zPartial ContentzPartial content follows)��zMulti-Status)��zAlready Reported)��zIM Used)i,zMultiple Choicesz,Object has several resources -- see URI list)i-zMoved Permanently�(Object moved permanently -- see URI list)i.ZFound�(Object moved temporarily -- see URI list)i/z	See Otherz'Object moved -- see Method and URL list)i0zNot Modifiedz)Document has not changed since given time)i1z	Use Proxyz@You must use proxy specified in Location to access this resource)i3zTemporary Redirectr)i4zPermanent Redirectr)i�zBad Requestz(Bad request syntax or unsupported method)i�ZUnauthorizedz*No permission -- see authorization schemes)i�zPayment Requiredz"No payment -- see charging schemes)i�Z	Forbiddenz0Request forbidden -- authorization will not help)i�z	Not FoundzNothing matches the given URI)i�zMethod Not Allowedz-Specified method is invalid for this resource)i�zNot Acceptablez%URI not available in preferred format)i�zProxy Authentication Requiredz7You must authenticate with this proxy before proceeding)i�zRequest Timeoutz"Request timed out; try again later)i�ZConflictzRequest conflict)i�ZGonez5URI no longer exists and has been permanently removed)i�zLength Requiredz"Client must specify Content-Length)i�zPrecondition Failedz Precondition in headers is false)i�zRequest Entity Too LargezEntity is too large)i�zRequest-URI Too LongzURI is too long)i�zUnsupported Media Typez!Entity body in unsupported format)i�zRequested Range Not SatisfiablezCannot satisfy request range)i�zExpectation Failedz'Expect condition could not be satisfied)i�zMisdirected Requestz(Server is not able to produce a response)i�zUnprocessable Entity)i�ZLocked)i�zFailed Dependency)i�zUpgrade Required)i�zPrecondition Requiredz8The origin server requires the request to be conditional)i�zToo Many RequestszOThe user has sent too many requests in a given amount of time ("rate limiting"))i�zRequest Header Fields Too LargezVThe server is unwilling to process the request because its header fields are too large)i�zUnavailable For Legal ReasonszOThe server is denying access to the resource as a consequence of a legal demand)i�zInternal Server ErrorzServer got itself in trouble)i�zNot Implementedz&Server does not support this operation)i�zBad Gatewayz+Invalid responses from another server/proxy)i�zService Unavailablez8The server cannot process the request due to a high load)i�zGateway Timeoutz4The gateway server did not receive a timely response)i�zHTTP Version Not SupportedzCannot fulfill request)i�zVariant Also Negotiates)i�zInsufficient Storage)i�z
Loop Detected)i�zNot Extended)i�zNetwork Authentication Requiredz7The client needs to authenticate to gain network accessN)r)@�__name__�
__module__�__qualname__�__doc__rZCONTINUEZSWITCHING_PROTOCOLSZ
PROCESSINGrZCREATEDZACCEPTEDZNON_AUTHORITATIVE_INFORMATIONZ
NO_CONTENTZ
RESET_CONTENTZPARTIAL_CONTENTZMULTI_STATUSZALREADY_REPORTEDZIM_USEDZMULTIPLE_CHOICESZMOVED_PERMANENTLYZFOUNDZ	SEE_OTHERZNOT_MODIFIEDZ	USE_PROXYZTEMPORARY_REDIRECTZPERMANENT_REDIRECTZBAD_REQUESTZUNAUTHORIZEDZPAYMENT_REQUIREDZ	FORBIDDENZ	NOT_FOUNDZMETHOD_NOT_ALLOWEDZNOT_ACCEPTABLEZPROXY_AUTHENTICATION_REQUIREDZREQUEST_TIMEOUTZCONFLICTZGONEZLENGTH_REQUIREDZPRECONDITION_FAILEDZREQUEST_ENTITY_TOO_LARGEZREQUEST_URI_TOO_LONGZUNSUPPORTED_MEDIA_TYPEZREQUESTED_RANGE_NOT_SATISFIABLEZEXPECTATION_FAILEDZMISDIRECTED_REQUESTZUNPROCESSABLE_ENTITYZLOCKEDZFAILED_DEPENDENCYZUPGRADE_REQUIREDZPRECONDITION_REQUIREDZTOO_MANY_REQUESTSZREQUEST_HEADER_FIELDS_TOO_LARGEZUNAVAILABLE_FOR_LEGAL_REASONSZINTERNAL_SERVER_ERRORZNOT_IMPLEMENTEDZBAD_GATEWAYZSERVICE_UNAVAILABLEZGATEWAY_TIMEOUTZHTTP_VERSION_NOT_SUPPORTEDZVARIANT_ALSO_NEGOTIATESZINSUFFICIENT_STORAGEZ
LOOP_DETECTEDZNOT_EXTENDEDZNETWORK_AUTHENTICATION_REQUIREDr
r
r
rrsz
	N)�enumr�__all__rr
r
r
r�<module>shttp/__pycache__/server.cpython-38.opt-2.pyc000064400000054462151153537450014655 0ustar00U

e5d��@sdZdddddgZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlZddlZddlmZdd	lmZd
ZdZGdd�dej�ZGd
d�deje�ZGdd�dej �Z!Gdd�de!�Z"dd�Z#da$dd�Z%dd�Z&Gdd�de"�Z'dd�Z(e!edddfdd�Z)e*dk�rddl+Z+e+�,�Z-e-j.ddd d!�e-j.d"d#d$d%d&�e-j.d'd(e�/�d)d*�e-j.d+d,de0d-d.d/�e-�1�Z2e2j3�r�e'Z4nee"e2j5d0�Z4Gd1d2�d2e�Z6e)e4e6e2j7e2j8d3�dS)4z0.6�
HTTPServer�ThreadingHTTPServer�BaseHTTPRequestHandler�SimpleHTTPRequestHandler�CGIHTTPRequestHandler�N)�partial)�
HTTPStatusa�<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
        <title>Error response</title>
    </head>
    <body>
        <h1>Error response</h1>
        <p>Error code: %(code)d</p>
        <p>Message: %(message)s.</p>
        <p>Error code explanation: %(code)s - %(explain)s.</p>
    </body>
</html>
ztext/html;charset=utf-8c@seZdZdZdd�ZdS)r�cCs4tj�|�|jdd�\}}t�|�|_||_dS)N�)�socketserver�	TCPServer�server_bindZserver_address�socketZgetfqdn�server_name�server_port)�self�host�port�r�#/usr/lib64/python3.8/http/server.pyr
�szHTTPServer.server_bindN)�__name__�
__module__�__qualname__Zallow_reuse_addressr
rrrrr�sc@seZdZdZdS)rTN)rrrZdaemon_threadsrrrrr�sc
@sFeZdZdej��dZdeZe	Z
eZdZ
dd�Zdd�Zd	d
�Zdd�ZdEdd�ZdFdd�ZdGdd�Zdd�Zdd�Zdd�ZdHdd�Zdd�Ze�dd �e�ed!�ed"d#��D��Zd$ee d%�<d&d'�Z!d(d)�Z"dId*d+�Z#d,d-�Z$d.d/d0d1d2d3d4gZ%d
d5d6d7d8d9d:d;d<d=d>d?d@g
Z&dAdB�Z'dCZ(e)j*j+Z,dDd �e-j.�/�D�Z0d
S)JrzPython/rz	BaseHTTP/�HTTP/0.9c
Cs�d|_|j|_}d|_t|jd�}|�d�}||_|��}t	|�dkrLdSt	|�dk�r&|d}zT|�
d�srt�|�d	d
�d
}|�d�}t	|�dkr�t�t|d�t|d
�f}Wn,tt
fk
r�|�tjd
|�YdSX|dk�r|jdk�rd|_|dk�r |�tjd|�dS||_dt	|�k�rBdk�sZn|�tjd|�dS|dd�\}}t	|�dk�r�d|_|dk�r�|�tjd|�dS|||_|_|j�
d��r�d	|j�d	�|_ztjj|j|jd�|_Wn�tjjk
�r(}z|�tjdt|��WY�dSd}~XYnBtjjk
�rh}z|�tjdt|��WY�dSd}~XYnX|j�dd�}	|	��dk�r�d|_n |	��dk�r�|jdk�r�d|_|j�dd�}
|
��dk�r�|jdk�r�|jdk�r�|� ��s�dSdS)NTz
iso-8859-1z
rF����zHTTP/�/r	�.r
zBad request version (%r))r	r	zHTTP/1.1)r
rzInvalid HTTP version (%s)zBad request syntax (%r)ZGETzBad HTTP/0.9 request type (%r)z//)Z_classz
Line too longzToo many headers�
Connection��close�
keep-aliveZExpectz100-continue)!�command�default_request_version�request_version�close_connection�str�raw_requestline�rstrip�requestline�split�len�
startswith�
ValueError�int�
IndexError�
send_errorrZBAD_REQUEST�protocol_versionZHTTP_VERSION_NOT_SUPPORTED�path�lstrip�http�clientZ
parse_headers�rfile�MessageClass�headersZLineTooLongZREQUEST_HEADER_FIELDS_TOO_LARGEZ
HTTPException�get�lower�handle_expect_100)r�versionr)�wordsZbase_version_numberZversion_numberr"r2�errZconntypeZexpectrrr�
parse_requests�


�
��
�
������
z$BaseHTTPRequestHandler.parse_requestcCs|�tj�|��dS�NT)�send_response_onlyrZCONTINUE�end_headers�rrrrr;xsz(BaseHTTPRequestHandler.handle_expect_100c
Cs�z�|j�d�|_t|j�dkrBd|_d|_d|_|�tj	�WdS|jsTd|_
WdS|��sbWdSd|j}t||�s�|�tj
d|j�WdSt||�}|�|j��Wn<tjk
r�}z|�d|�d|_
WY�dSd}~XYnXdS)NiirTZdo_zUnsupported method (%r)zRequest timed out: %r)r6�readliner'r+r)r$r"r0rZREQUEST_URI_TOO_LONGr%r?�hasattr�NOT_IMPLEMENTED�getattr�wfile�flushrZtimeout�	log_error)rZmname�method�errr�handle_one_request�s6

�
z)BaseHTTPRequestHandler.handle_one_requestcCs"d|_|��|js|��qdSr@)r%rMrCrrr�handle�szBaseHTTPRequestHandler.handleNcCsz|j|\}}Wntk
r.d\}}YnX|dkr<|}|dkrH|}|�d||�|�||�|�dd�d}|dkr�|tjtjtjfkr�|j	|t
j|dd�t
j|dd�d�}|�d	d
�}|�d|j
�|�dtt|���|��|jd
k�r|�r|j�|�dS)N)�???rOzcode %d, message %srr ��F��quote)�code�message�explainzUTF-8�replacezContent-Type�Content-LengthZHEAD)�	responses�KeyErrorrJ�
send_response�send_headerrZ
NO_CONTENTZ
RESET_CONTENT�NOT_MODIFIED�error_message_format�html�escape�encode�error_content_typer&r+rBr"rH�write)rrSrTrUZshortmsgZlongmsgZbodyZcontentrrrr0�s:���z!BaseHTTPRequestHandler.send_errorcCs:|�|�|�||�|�d|���|�d|���dS)NZServerZDate)�log_requestrAr[�version_string�date_time_string�rrSrTrrrrZ�s
z$BaseHTTPRequestHandler.send_responsecCsd|jdkr`|dkr0||jkr,|j|d}nd}t|d�s@g|_|j�d|j||f�dd��dS)Nrrr�_headers_bufferz
%s %d %s
�latin-1�strict)r$rXrErg�appendr1r`rfrrrrA�s



��z)BaseHTTPRequestHandler.send_response_onlycCsl|jdkr6t|d�sg|_|j�d||f�dd��|��dkrh|��dkrVd|_n|��d	krhd
|_dS)Nrrgz%s: %s
rhriZ
connectionr Tr!F)r$rErgrjr`r:r%)r�keyword�valuerrrr[s

�z"BaseHTTPRequestHandler.send_headercCs"|jdkr|j�d�|��dS)Nrs
)r$rgrj�
flush_headersrCrrrrBs
z"BaseHTTPRequestHandler.end_headerscCs(t|d�r$|j�d�|j��g|_dS)Nrg�)rErHrb�joinrgrCrrrrms
z$BaseHTTPRequestHandler.flush_headers�-cCs.t|t�r|j}|�d|jt|�t|��dS)Nz
"%s" %s %s)�
isinstancerrl�log_messager)r&)rrS�sizerrrrc s
�z"BaseHTTPRequestHandler.log_requestcGs|j|f|��dS�N)rr)r�format�argsrrrrJ+sz BaseHTTPRequestHandler.log_errorcCsi|]}|d|d���qS)z\xZ02xr)�.0�crrr�
<dictcomp>;sz!BaseHTTPRequestHandler.<dictcomp>� ��z\\�\cGs2||}tj�d|��|��|�|j�f�dS)Nz%s - - [%s] %s
)�sys�stderrrb�address_string�log_date_time_string�	translate�_control_char_table)rrurvrTrrrrr>s
��z"BaseHTTPRequestHandler.log_messagecCs|jd|jS)N� )�server_version�sys_versionrCrrrrdXsz%BaseHTTPRequestHandler.version_stringcCs |dkrt��}tjj|dd�S)NT)Zusegmt)�time�email�utilsZ
formatdate)rZ	timestamprrrre\sz'BaseHTTPRequestHandler.date_time_stringc	CsBt��}t�|�\	}}}}}}}}	}
d||j|||||f}|S)Nz%02d/%3s/%04d %02d:%02d:%02d)r��	localtime�	monthname)rZnowZyearZmonthZdayZhhZmmZss�x�y�z�srrrr�bs�z+BaseHTTPRequestHandler.log_date_time_stringZMonZTueZWedZThuZFriZSatZSunZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDeccCs
|jdS�Nr)�client_addressrCrrrr�psz%BaseHTTPRequestHandler.address_string�HTTP/1.0cCsi|]}||j|jf�qSr)�phraseZdescription)rw�vrrrrys�)NN)N)N)rprp)N)1rrrr~r<r*r��__version__r��DEFAULT_ERROR_MESSAGEr]�DEFAULT_ERROR_CONTENT_TYPErar#r?r;rMrNr0rZrAr[rBrmrcrJr&�	maketrans�	itertools�chain�ranger��ordrrrdrer�Zweekdaynamer�r�r1r4r5ZHTTPMessager7r�__members__�valuesrXrrrrr�s\ij%
5


�
�	�cs�eZdZdeZdd��fdd�
Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Ze
jshe
��e
j��Ze�ddddd���ZS)rzSimpleHTTP/N��	directorycs(|dkrt��}||_t�j||�dSrt)�os�getcwdr��super�__init__)rr�rv�kwargs��	__class__rrr��sz!SimpleHTTPRequestHandler.__init__cCs.|��}|r*z|�||j�W5|��XdSrt)�	send_headr �copyfilerH�r�frrr�do_GET�s
zSimpleHTTPRequestHandler.do_GETcCs|��}|r|��dSrt)r�r r�rrr�do_HEAD�sz SimpleHTTPRequestHandler.do_HEADcCs^|�|j�}d}tj�|�r�tj�|j�}|j�d�s�|�t	j
�|d|d|dd|d|df}tj�|�}|�d|�|�
�dSdD]&}tj�||�}tj�|�r�|}q�q�|�|�S|�|�}|�d�r�|�t	jd	�dSzt|d
�}Wn&tk
�r|�t	jd	�YdSX�z"t�|���}d|jk�r�d|jk�r�ztj�|jd�}	Wnttttfk
�r|YnzX|	j dk�r�|	j!t"j#j$d
�}	|	j t"j#j$k�r�t"j"�%|j&t"j#j$�}
|
j!dd�}
|
|	k�r�|�t	j'�|�
�|�(�WdS|�t	j)�|�d|�|�dt*|d��|�d|�+|j&��|�
�|WS|�(��YnXdS)Nrrr	r
r�ZLocation)z
index.htmlz	index.htmzFile not found�rbzIf-Modified-Sincez
If-None-Match)�tzinfo)Zmicrosecond�Content-typerW�z
Last-Modified),�translate_pathr2r��isdir�urllib�parseZurlsplit�endswithrZrZMOVED_PERMANENTLYZ
urlunsplitr[rBro�exists�list_directory�
guess_typer0�	NOT_FOUND�open�OSError�fstat�filenor8r�r�Zparsedate_to_datetime�	TypeErrorr/�
OverflowErrorr-r�rV�datetime�timezoneZutcZ
fromtimestamp�st_mtimer\r �OKr&re)rr2r��partsZ	new_partsZnew_url�indexZctypeZfsZimsZ
last_modifrrrr��s��


���

�z"SimpleHTTPRequestHandler.send_headc
	Cs�zt�|�}Wn$tk
r2|�tjd�YdSX|jdd�d�g}ztjj	|j
dd�}Wn"tk
r�tj�	|j
�}YnXtj
|dd�}t��}d	|}|�d
�|�d�|�d|�|�d
|�|�d|�|�d�|D]v}tj
�||�}|}	}
tj
�|��r$|d}	|d}
tj
�|��r:|d}	|�dtjj|
dd�tj
|	dd�f�q�|�d�d�|��|d�}t��}|�|�|�d�|�tj�|�dd|�|�dtt|���|��|S)NzNo permission to list directorycSs|��Srt)r:)�arrr�<lambda>rnz9SimpleHTTPRequestHandler.list_directory.<locals>.<lambda>)�key�
surrogatepass��errorsFrQzDirectory listing for %szZ<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">z
<html>
<head>z@<meta http-equiv="Content-Type" content="text/html; charset=%s">z<title>%s</title>
</head>z<body>
<h1>%s</h1>z	<hr>
<ul>r�@z<li><a href="%s">%s</a></li>z</ul>
<hr>
</body>
</html>
�
�surrogateescaperr�ztext/html; charset=%srW) r��listdirr�r0rr��sortr�r��unquoter2�UnicodeDecodeErrorr^r_r~�getfilesystemencodingrjror��islinkrRr`�io�BytesIOrb�seekrZr�r[r&r+rB)
rr2�list�rZdisplaypath�enc�title�name�fullnameZdisplaynameZlinknameZencodedr�rrrr�sh�
�


�
���


z'SimpleHTTPRequestHandler.list_directorycCs�|�dd�d}|�dd�d}|���d�}ztjj|dd�}Wn tk
rbtj�|�}YnXt�|�}|�d�}t	d|�}|j
}|D]0}tj�
|�s�|tjtjfkr�q�tj�||�}q�|r�|d7}|S)N�?r	r�#rr�r�)r*r(r�r�r�r�r��	posixpath�normpath�filterr�r�r2�dirname�curdir�pardirro)rr2Ztrailing_slashr=Zwordrrrr�:s$	


z'SimpleHTTPRequestHandler.translate_pathcCst�||�dSrt)�shutilZcopyfileobj)r�sourceZ
outputfilerrrr�Xsz!SimpleHTTPRequestHandler.copyfilecCsLt�|�\}}||jkr"|j|S|��}||jkr>|j|S|jdSdS)Nr)r��splitext�extensions_mapr:)rr2�baseZextrrrr�hs



z#SimpleHTTPRequestHandler.guess_typezapplication/octet-streamz
text/plain)r�.pyz.cz.h)rrrr�r�r�r�r�r�r�r�r�r��	mimetypesZinitedZinitZ	types_map�copyr��update�
__classcell__rrr�rr�s$
	W:
�c	Cs�|�d�\}}}tj�|�}|�d�}g}|dd�D],}|dkrL|��q6|r6|dkr6|�|�q6|r�|��}|r�|dkr�|��d}q�|dkr�d}nd}|r�d�||f�}dd�|�|f}d�|�}|S)Nr�rrz..rr)�	partitionr�r�r�r*�poprjro)	r2�_�query�
path_partsZ
head_parts�partZ	tail_partZ	splitpath�collapsed_pathrrr�_url_collapse_path�s.


r�cCsrtrtSzddl}Wntk
r*YdSXz|�d�daWn.tk
rldtdd�|��D��aYnXtS)Nrr�nobodyr
r	css|]}|dVqdS)r
Nr)rwr�rrr�	<genexpr>�sznobody_uid.<locals>.<genexpr>)r��pwd�ImportError�getpwnamrY�maxZgetpwall)r�rrr�
nobody_uid�s rcCst�|tj�Srt)r��access�X_OK)r2rrr�
executable�src@sReZdZeed�ZdZdd�Zdd�Zdd�Z	d	d
gZ
dd�Zd
d�Zdd�Z
dS)r�forkrcCs$|��r|��n|�tjd�dS)NzCan only POST to CGI scripts)�is_cgi�run_cgir0rrFrCrrr�do_POST�s
�zCGIHTTPRequestHandler.do_POSTcCs|��r|��St�|�SdSrt)rrrr�rCrrrr��szCGIHTTPRequestHandler.send_headcCsPt|j�}|�dd�}|d|�||dd�}}||jkrL||f|_dSdS)Nrr	TF)r�r2�find�cgi_directories�cgi_info)rr�Zdir_sep�head�tailrrrr�s


zCGIHTTPRequestHandler.is_cgiz/cgi-binz/htbincCst|�Srt)r)rr2rrr�
is_executablesz#CGIHTTPRequestHandler.is_executablecCstj�|�\}}|��dkS)N)r�z.pyw)r�r2r�r:)rr2rrrrr�	is_pythonszCGIHTTPRequestHandler.is_pythonc)	Cs�|j\}}|d|}|�dt|�d�}|dkr�|d|�}||dd�}|�|�}tj�|�r�||}}|�dt|�d�}q*q�q*|�d�\}}}	|�d�}|dkr�|d|�||d�}
}n
|d}
}|d|
}|�|�}tj�|��s
|�	t
jd|�dStj�|��s.|�	t
j
d|�dS|�|�}
|j�sF|
�sh|�|��sh|�	t
j
d|�dSt�tj�}|��|d	<|jj|d
<d|d<|j|d
<t|jj�|d<|j|d<tj�|�}||d<|�|�|d<||d<|	�r�|	|d<|jd|d<|j� d�}|�r�|�!�}t|�dk�r�ddl"}ddl#}|d|d<|d�$�dk�r�z"|d�%d�}|�&|��'d�}Wn|j(t)fk
�r�Yn&X|�!d�}t|�dk�r�|d|d<|j� d�dk�r�|j�*�|d<n|jd|d<|j� d�}|�r||d<|j� d �}|�r||d!<g}|j�+d"�D]>}|dd�d#k�rR|�,|�-��n||d$d��!d%�}�q,d%�.|�|d&<|j� d'�}|�r�||d(<t/d|j�0d)g��}d*�.|�}|�r�||d+<d,D]}|�1|d��q�|�2t
j3d-�|�4�|	�5d.d/�}|j�r|
g}d0|k�r|�,|�t6�}|j7�8�t�9�}|dk�r�t�:|d�\}}t;�;|j<gggd�d�r~|j<�=d��sN�q~�qN|�r�|�>d1|�dSz\zt�?|�Wnt@k
�r�YnXt�A|j<�B�d�t�A|j7�B�d�t�C|||�Wn(|j�D|jE|j�t�Fd2�YnX�n�ddlG} |g}!|�|��rrtHjI}"|"�$��Jd3��rf|"dd4�|"d5d�}"|"d6g|!}!d0|	k�r�|!�,|	�|�Kd7| �L|!��ztM|�}#WntNtOfk
�r�d}#YnX| jP|!| jQ| jQ| jQ|d8�}$|j�$�d9k�r|#dk�r|j<�=|#�}%nd}%t;�;|j<jRgggd�d�r>|j<jR�Sd��s
�q>�q
|$�T|%�\}&}'|j7�U|&�|'�rj|�>d:|'�|$jV�W�|$jX�W�|$jY}(|(�r�|�>d1|(�n
|�Kd;�dS)<Nrr	rr�rzNo such CGI script (%r)z#CGI script is not a plain file (%r)z!CGI script is not executable (%r)ZSERVER_SOFTWAREZSERVER_NAMEzCGI/1.1ZGATEWAY_INTERFACEZSERVER_PROTOCOLZSERVER_PORTZREQUEST_METHODZ	PATH_INFOZPATH_TRANSLATEDZSCRIPT_NAME�QUERY_STRINGZREMOTE_ADDR�
authorizationr
Z	AUTH_TYPEZbasic�ascii�:ZREMOTE_USERzcontent-typeZCONTENT_TYPEzcontent-length�CONTENT_LENGTH�referer�HTTP_REFERER�acceptz	

 ��,ZHTTP_ACCEPTz
user-agent�HTTP_USER_AGENTZcookiez, �HTTP_COOKIE)rZREMOTE_HOSTrrrrzScript output follows�+r��=zCGI script exit status %#xr{zw.exe������z-uzcommand: %s)�stdin�stdoutr�envZpostz%szCGI script exited OK)Zr
rr+r�r�r2r�r�r�r0rr��isfileZ	FORBIDDENr�	have_forkr
r�Zdeepcopy�environrdZserverrr1r&rr"r�r�r�r�r8r9r*�base64�binasciir:r`Zdecodebytes�decode�Error�UnicodeErrorZget_content_typeZgetallmatchingheadersrj�stripror�Zget_all�
setdefaultrZr�rmrVrrHrIr�waitpid�selectr6�readrJ�setuidr��dup2r��execveZhandle_errorZrequest�_exit�
subprocessr~rr�rrZlist2cmdliner.r�r-�Popen�PIPEZ_sockZrecvZcommunicaterbrr r �
returncode))r�dir�restr2�iZnextdirZnextrestZ	scriptdirr�r�ZscriptZ
scriptnameZ
scriptfileZispyr!Zuqrestrr%r&Zlengthrr�lineZua�coZ
cookie_str�kZ
decoded_queryrvr��pid�stsr3ZcmdlineZinterp�nbytes�p�datar rZstatusrrrrs<





��
�


�








�

zCGIHTTPRequestHandler.run_cgiN)rrrrEr�r#Zrbufsizerr�rr	r
rrrrrrr�s
cGs4tj|tjtjd��}tt|��\}}}}}||fS)N)�type�flags)rZgetaddrinfoZSOCK_STREAMZ
AI_PASSIVE�next�iter)ZaddressZinfosZfamilyrB�protoZ	canonnameZsockaddrrrr�_get_best_family�s�rGr�i@c	Cs�t||�\|_}||_|||���}|j��dd�\}}d|krLd|�d�n|}td|�d|�d|�d|�d�	�z|��Wn&tk
r�td	�t�	d
�YnXW5QRXdS)Nr
r�[�]zServing HTTP on z port z	 (http://z/) ...z&
Keyboard interrupt received, exiting.r)
rGZaddress_familyr1rZgetsockname�printZ
serve_forever�KeyboardInterruptr~�exit)	�HandlerClass�ServerClassZprotocolr�bindZaddrZhttpdrZurl_hostrrr�test�s�rP�__main__z--cgi�
store_truezRun as CGI Server)�action�helpz--bindz-bZADDRESSz8Specify alternate bind address [default: all interfaces])�metavarrTz--directoryz-dz9Specify alternative directory [default:current directory])�defaultrTrZstorer�z&Specify alternate port [default: 8000])rSrVrB�nargsrTr�cseZdZ�fdd�Z�ZS)�DualStackServerc	s4t�t��|j�tjtjd�W5QRXt���Sr�)	�
contextlib�suppress�	ExceptionrZ
setsockoptZIPPROTO_IPV6ZIPV6_V6ONLYr�r
rCr�rrr
s�zDualStackServer.server_bind)rrrr
r�rrr�rrXsrX)rMrNrrO)9r��__all__r�r�Zemail.utilsr�r^Zhttp.clientr4r�r�r�r�r�r-r�rrr~r�Zurllib.parser�rY�	functoolsrrr�r�rrZThreadingMixInrZStreamRequestHandlerrrr�r�rrrrGrPr�argparse�ArgumentParser�parser�add_argumentr�r.�
parse_argsrvZcgiZ
handler_classr�rXrrOrrrr�<module>Ss��s
0
�

�
�����http/client.py000064400000154231151153537450007372 0ustar00r"""HTTP/1.1 client library

<intro stuff goes here>
<other stuff, too>

HTTPConnection goes through a number of "states", which define when a client
may legally make another request or fetch the response for a particular
request. This diagram details these state transitions:

    (null)
      |
      | HTTPConnection()
      v
    Idle
      |
      | putrequest()
      v
    Request-started
      |
      | ( putheader() )*  endheaders()
      v
    Request-sent
      |\_____________________________
      |                              | getresponse() raises
      | response = getresponse()     | ConnectionError
      v                              v
    Unread-response                Idle
    [Response-headers-read]
      |\____________________
      |                     |
      | response.read()     | putrequest()
      v                     v
    Idle                  Req-started-unread-response
                     ______/|
                   /        |
   response.read() |        | ( putheader() )*  endheaders()
                   v        v
       Request-started    Req-sent-unread-response
                            |
                            | response.read()
                            v
                          Request-sent

This diagram presents the following rules:
  -- a second request may not be started until {response-headers-read}
  -- a response [object] cannot be retrieved until {request-sent}
  -- there is no differentiation between an unread response body and a
     partially read response body

Note: this enforcement is applied by the HTTPConnection class. The
      HTTPResponse class does not enforce this state machine, which
      implies sophisticated clients may accelerate the request/response
      pipeline. Caution should be taken, though: accelerating the states
      beyond the above pattern may imply knowledge of the server's
      connection-close behavior for certain requests. For example, it
      is impossible to tell whether the server will close the connection
      UNTIL the response headers have been read; this means that further
      requests cannot be placed into the pipeline until it is known that
      the server will NOT be closing the connection.

Logical State                  __state            __response
-------------                  -------            ----------
Idle                           _CS_IDLE           None
Request-started                _CS_REQ_STARTED    None
Request-sent                   _CS_REQ_SENT       None
Unread-response                _CS_IDLE           <response_class>
Req-started-unread-response    _CS_REQ_STARTED    <response_class>
Req-sent-unread-response       _CS_REQ_SENT       <response_class>
"""

import email.parser
import email.message
import http
import io
import re
import socket
import collections.abc
from urllib.parse import urlsplit

# HTTPMessage, parse_headers(), and the HTTP status code constants are
# intentionally omitted for simplicity
__all__ = ["HTTPResponse", "HTTPConnection",
           "HTTPException", "NotConnected", "UnknownProtocol",
           "UnknownTransferEncoding", "UnimplementedFileMode",
           "IncompleteRead", "InvalidURL", "ImproperConnectionState",
           "CannotSendRequest", "CannotSendHeader", "ResponseNotReady",
           "BadStatusLine", "LineTooLong", "RemoteDisconnected", "error",
           "responses"]

HTTP_PORT = 80
HTTPS_PORT = 443

_UNKNOWN = 'UNKNOWN'

# connection states
_CS_IDLE = 'Idle'
_CS_REQ_STARTED = 'Request-started'
_CS_REQ_SENT = 'Request-sent'


# hack to maintain backwards compatibility
globals().update(http.HTTPStatus.__members__)

# another hack to maintain backwards compatibility
# Mapping status codes to official W3C names
responses = {v: v.phrase for v in http.HTTPStatus.__members__.values()}

# maximal line length when calling readline().
_MAXLINE = 65536
_MAXHEADERS = 100

# Header name/value ABNF (http://tools.ietf.org/html/rfc7230#section-3.2)
#
# VCHAR          = %x21-7E
# obs-text       = %x80-FF
# header-field   = field-name ":" OWS field-value OWS
# field-name     = token
# field-value    = *( field-content / obs-fold )
# field-content  = field-vchar [ 1*( SP / HTAB ) field-vchar ]
# field-vchar    = VCHAR / obs-text
#
# obs-fold       = CRLF 1*( SP / HTAB )
#                ; obsolete line folding
#                ; see Section 3.2.4

# token          = 1*tchar
#
# tchar          = "!" / "#" / "$" / "%" / "&" / "'" / "*"
#                / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
#                / DIGIT / ALPHA
#                ; any VCHAR, except delimiters
#
# VCHAR defined in http://tools.ietf.org/html/rfc5234#appendix-B.1

# the patterns for both name and value are more lenient than RFC
# definitions to allow for backwards compatibility
_is_legal_header_name = re.compile(rb'[^:\s][^:\r\n]*').fullmatch
_is_illegal_header_value = re.compile(rb'\n(?![ \t])|\r(?![ \t\n])').search

# These characters are not allowed within HTTP URL paths.
#  See https://tools.ietf.org/html/rfc3986#section-3.3 and the
#  https://tools.ietf.org/html/rfc3986#appendix-A pchar definition.
# Prevents CVE-2019-9740.  Includes control characters such as \r\n.
# We don't restrict chars above \x7f as putrequest() limits us to ASCII.
_contains_disallowed_url_pchar_re = re.compile('[\x00-\x20\x7f]')
# Arguably only these _should_ allowed:
#  _is_allowed_url_pchars_re = re.compile(r"^[/!$&'()*+,;=:@%a-zA-Z0-9._~-]+$")
# We are more lenient for assumed real world compatibility purposes.

# These characters are not allowed within HTTP method names
# to prevent http header injection.
_contains_disallowed_method_pchar_re = re.compile('[\x00-\x1f]')

# We always set the Content-Length header for these methods because some
# servers will otherwise respond with a 411
_METHODS_EXPECTING_BODY = {'PATCH', 'POST', 'PUT'}


def _encode(data, name='data'):
    """Call data.encode("latin-1") but show a better error message."""
    try:
        return data.encode("latin-1")
    except UnicodeEncodeError as err:
        raise UnicodeEncodeError(
            err.encoding,
            err.object,
            err.start,
            err.end,
            "%s (%.20r) is not valid Latin-1. Use %s.encode('utf-8') "
            "if you want to send it encoded in UTF-8." %
            (name.title(), data[err.start:err.end], name)) from None


class HTTPMessage(email.message.Message):
    # XXX The only usage of this method is in
    # http.server.CGIHTTPRequestHandler.  Maybe move the code there so
    # that it doesn't need to be part of the public API.  The API has
    # never been defined so this could cause backwards compatibility
    # issues.

    def getallmatchingheaders(self, name):
        """Find all header lines matching a given header name.

        Look through the list of headers and find all lines matching a given
        header name (and their continuation lines).  A list of the lines is
        returned, without interpretation.  If the header does not occur, an
        empty list is returned.  If the header occurs multiple times, all
        occurrences are returned.  Case is not important in the header name.

        """
        name = name.lower() + ':'
        n = len(name)
        lst = []
        hit = 0
        for line in self.keys():
            if line[:n].lower() == name:
                hit = 1
            elif not line[:1].isspace():
                hit = 0
            if hit:
                lst.append(line)
        return lst

def _read_headers(fp):
    """Reads potential header lines into a list from a file pointer.

    Length of line is limited by _MAXLINE, and number of
    headers is limited by _MAXHEADERS.
    """
    headers = []
    while True:
        line = fp.readline(_MAXLINE + 1)
        if len(line) > _MAXLINE:
            raise LineTooLong("header line")
        headers.append(line)
        if len(headers) > _MAXHEADERS:
            raise HTTPException("got more than %d headers" % _MAXHEADERS)
        if line in (b'\r\n', b'\n', b''):
            break
    return headers

def parse_headers(fp, _class=HTTPMessage):
    """Parses only RFC2822 headers from a file pointer.

    email Parser wants to see strings rather than bytes.
    But a TextIOWrapper around self.rfile would buffer too many bytes
    from the stream, bytes which we later need to read as bytes.
    So we read the correct bytes here, as bytes, for email Parser
    to parse.

    """
    headers = _read_headers(fp)
    hstring = b''.join(headers).decode('iso-8859-1')
    return email.parser.Parser(_class=_class).parsestr(hstring)


class HTTPResponse(io.BufferedIOBase):

    # See RFC 2616 sec 19.6 and RFC 1945 sec 6 for details.

    # The bytes from the socket object are iso-8859-1 strings.
    # See RFC 2616 sec 2.2 which notes an exception for MIME-encoded
    # text following RFC 2047.  The basic status line parsing only
    # accepts iso-8859-1.

    def __init__(self, sock, debuglevel=0, method=None, url=None):
        # If the response includes a content-length header, we need to
        # make sure that the client doesn't read more than the
        # specified number of bytes.  If it does, it will block until
        # the server times out and closes the connection.  This will
        # happen if a self.fp.read() is done (without a size) whether
        # self.fp is buffered or not.  So, no self.fp.read() by
        # clients unless they know what they are doing.
        self.fp = sock.makefile("rb")
        self.debuglevel = debuglevel
        self._method = method

        # The HTTPResponse object is returned via urllib.  The clients
        # of http and urllib expect different attributes for the
        # headers.  headers is used here and supports urllib.  msg is
        # provided as a backwards compatibility layer for http
        # clients.

        self.headers = self.msg = None

        # from the Status-Line of the response
        self.version = _UNKNOWN # HTTP-Version
        self.status = _UNKNOWN  # Status-Code
        self.reason = _UNKNOWN  # Reason-Phrase

        self.chunked = _UNKNOWN         # is "chunked" being used?
        self.chunk_left = _UNKNOWN      # bytes left to read in current chunk
        self.length = _UNKNOWN          # number of bytes left in response
        self.will_close = _UNKNOWN      # conn will close at end of response

    def _read_status(self):
        line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
        if len(line) > _MAXLINE:
            raise LineTooLong("status line")
        if self.debuglevel > 0:
            print("reply:", repr(line))
        if not line:
            # Presumably, the server closed the connection before
            # sending a valid response.
            raise RemoteDisconnected("Remote end closed connection without"
                                     " response")
        try:
            version, status, reason = line.split(None, 2)
        except ValueError:
            try:
                version, status = line.split(None, 1)
                reason = ""
            except ValueError:
                # empty version will cause next test to fail.
                version = ""
        if not version.startswith("HTTP/"):
            self._close_conn()
            raise BadStatusLine(line)

        # The status code is a three-digit number
        try:
            status = int(status)
            if status < 100 or status > 999:
                raise BadStatusLine(line)
        except ValueError:
            raise BadStatusLine(line)
        return version, status, reason

    def begin(self):
        if self.headers is not None:
            # we've already started reading the response
            return

        # read until we get a non-100 response
        while True:
            version, status, reason = self._read_status()
            if status != CONTINUE:
                break
            # skip the header from the 100 response
            skipped_headers = _read_headers(self.fp)
            if self.debuglevel > 0:
                print("headers:", skipped_headers)
            del skipped_headers

        self.code = self.status = status
        self.reason = reason.strip()
        if version in ("HTTP/1.0", "HTTP/0.9"):
            # Some servers might still return "0.9", treat it as 1.0 anyway
            self.version = 10
        elif version.startswith("HTTP/1."):
            self.version = 11   # use HTTP/1.1 code for HTTP/1.x where x>=1
        else:
            raise UnknownProtocol(version)

        self.headers = self.msg = parse_headers(self.fp)

        if self.debuglevel > 0:
            for hdr, val in self.headers.items():
                print("header:", hdr + ":", val)

        # are we using the chunked-style of transfer encoding?
        tr_enc = self.headers.get("transfer-encoding")
        if tr_enc and tr_enc.lower() == "chunked":
            self.chunked = True
            self.chunk_left = None
        else:
            self.chunked = False

        # will the connection close at the end of the response?
        self.will_close = self._check_close()

        # do we have a Content-Length?
        # NOTE: RFC 2616, S4.4, #3 says we ignore this if tr_enc is "chunked"
        self.length = None
        length = self.headers.get("content-length")
        if length and not self.chunked:
            try:
                self.length = int(length)
            except ValueError:
                self.length = None
            else:
                if self.length < 0:  # ignore nonsensical negative lengths
                    self.length = None
        else:
            self.length = None

        # does the body have a fixed length? (of zero)
        if (status == NO_CONTENT or status == NOT_MODIFIED or
            100 <= status < 200 or      # 1xx codes
            self._method == "HEAD"):
            self.length = 0

        # if the connection remains open, and we aren't using chunked, and
        # a content-length was not provided, then assume that the connection
        # WILL close.
        if (not self.will_close and
            not self.chunked and
            self.length is None):
            self.will_close = True

    def _check_close(self):
        conn = self.headers.get("connection")
        if self.version == 11:
            # An HTTP/1.1 proxy is assumed to stay open unless
            # explicitly closed.
            if conn and "close" in conn.lower():
                return True
            return False

        # Some HTTP/1.0 implementations have support for persistent
        # connections, using rules different than HTTP/1.1.

        # For older HTTP, Keep-Alive indicates persistent connection.
        if self.headers.get("keep-alive"):
            return False

        # At least Akamai returns a "Connection: Keep-Alive" header,
        # which was supposed to be sent by the client.
        if conn and "keep-alive" in conn.lower():
            return False

        # Proxy-Connection is a netscape hack.
        pconn = self.headers.get("proxy-connection")
        if pconn and "keep-alive" in pconn.lower():
            return False

        # otherwise, assume it will close
        return True

    def _close_conn(self):
        fp = self.fp
        self.fp = None
        fp.close()

    def close(self):
        try:
            super().close() # set "closed" flag
        finally:
            if self.fp:
                self._close_conn()

    # These implementations are for the benefit of io.BufferedReader.

    # XXX This class should probably be revised to act more like
    # the "raw stream" that BufferedReader expects.

    def flush(self):
        super().flush()
        if self.fp:
            self.fp.flush()

    def readable(self):
        """Always returns True"""
        return True

    # End of "raw stream" methods

    def isclosed(self):
        """True if the connection is closed."""
        # NOTE: it is possible that we will not ever call self.close(). This
        #       case occurs when will_close is TRUE, length is None, and we
        #       read up to the last byte, but NOT past it.
        #
        # IMPLIES: if will_close is FALSE, then self.close() will ALWAYS be
        #          called, meaning self.isclosed() is meaningful.
        return self.fp is None

    def read(self, amt=None):
        if self.fp is None:
            return b""

        if self._method == "HEAD":
            self._close_conn()
            return b""

        if amt is not None:
            # Amount is given, implement using readinto
            b = bytearray(amt)
            n = self.readinto(b)
            return memoryview(b)[:n].tobytes()
        else:
            # Amount is not given (unbounded read) so we must check self.length
            # and self.chunked

            if self.chunked:
                return self._readall_chunked()

            if self.length is None:
                s = self.fp.read()
            else:
                try:
                    s = self._safe_read(self.length)
                except IncompleteRead:
                    self._close_conn()
                    raise
                self.length = 0
            self._close_conn()        # we read everything
            return s

    def readinto(self, b):
        """Read up to len(b) bytes into bytearray b and return the number
        of bytes read.
        """

        if self.fp is None:
            return 0

        if self._method == "HEAD":
            self._close_conn()
            return 0

        if self.chunked:
            return self._readinto_chunked(b)

        if self.length is not None:
            if len(b) > self.length:
                # clip the read to the "end of response"
                b = memoryview(b)[0:self.length]

        # we do not use _safe_read() here because this may be a .will_close
        # connection, and the user is reading more bytes than will be provided
        # (for example, reading in 1k chunks)
        n = self.fp.readinto(b)
        if not n and b:
            # Ideally, we would raise IncompleteRead if the content-length
            # wasn't satisfied, but it might break compatibility.
            self._close_conn()
        elif self.length is not None:
            self.length -= n
            if not self.length:
                self._close_conn()
        return n

    def _read_next_chunk_size(self):
        # Read the next chunk size from the file
        line = self.fp.readline(_MAXLINE + 1)
        if len(line) > _MAXLINE:
            raise LineTooLong("chunk size")
        i = line.find(b";")
        if i >= 0:
            line = line[:i] # strip chunk-extensions
        try:
            return int(line, 16)
        except ValueError:
            # close the connection as protocol synchronisation is
            # probably lost
            self._close_conn()
            raise

    def _read_and_discard_trailer(self):
        # read and discard trailer up to the CRLF terminator
        ### note: we shouldn't have any trailers!
        while True:
            line = self.fp.readline(_MAXLINE + 1)
            if len(line) > _MAXLINE:
                raise LineTooLong("trailer line")
            if not line:
                # a vanishingly small number of sites EOF without
                # sending the trailer
                break
            if line in (b'\r\n', b'\n', b''):
                break

    def _get_chunk_left(self):
        # return self.chunk_left, reading a new chunk if necessary.
        # chunk_left == 0: at the end of the current chunk, need to close it
        # chunk_left == None: No current chunk, should read next.
        # This function returns non-zero or None if the last chunk has
        # been read.
        chunk_left = self.chunk_left
        if not chunk_left: # Can be 0 or None
            if chunk_left is not None:
                # We are at the end of chunk, discard chunk end
                self._safe_read(2)  # toss the CRLF at the end of the chunk
            try:
                chunk_left = self._read_next_chunk_size()
            except ValueError:
                raise IncompleteRead(b'')
            if chunk_left == 0:
                # last chunk: 1*("0") [ chunk-extension ] CRLF
                self._read_and_discard_trailer()
                # we read everything; close the "file"
                self._close_conn()
                chunk_left = None
            self.chunk_left = chunk_left
        return chunk_left

    def _readall_chunked(self):
        assert self.chunked != _UNKNOWN
        value = []
        try:
            while True:
                chunk_left = self._get_chunk_left()
                if chunk_left is None:
                    break
                value.append(self._safe_read(chunk_left))
                self.chunk_left = 0
            return b''.join(value)
        except IncompleteRead:
            raise IncompleteRead(b''.join(value))

    def _readinto_chunked(self, b):
        assert self.chunked != _UNKNOWN
        total_bytes = 0
        mvb = memoryview(b)
        try:
            while True:
                chunk_left = self._get_chunk_left()
                if chunk_left is None:
                    return total_bytes

                if len(mvb) <= chunk_left:
                    n = self._safe_readinto(mvb)
                    self.chunk_left = chunk_left - n
                    return total_bytes + n

                temp_mvb = mvb[:chunk_left]
                n = self._safe_readinto(temp_mvb)
                mvb = mvb[n:]
                total_bytes += n
                self.chunk_left = 0

        except IncompleteRead:
            raise IncompleteRead(bytes(b[0:total_bytes]))

    def _safe_read(self, amt):
        """Read the number of bytes requested.

        This function should be used when <amt> bytes "should" be present for
        reading. If the bytes are truly not available (due to EOF), then the
        IncompleteRead exception can be used to detect the problem.
        """
        data = self.fp.read(amt)
        if len(data) < amt:
            raise IncompleteRead(data, amt-len(data))
        return data

    def _safe_readinto(self, b):
        """Same as _safe_read, but for reading into a buffer."""
        amt = len(b)
        n = self.fp.readinto(b)
        if n < amt:
            raise IncompleteRead(bytes(b[:n]), amt-n)
        return n

    def read1(self, n=-1):
        """Read with at most one underlying system call.  If at least one
        byte is buffered, return that instead.
        """
        if self.fp is None or self._method == "HEAD":
            return b""
        if self.chunked:
            return self._read1_chunked(n)
        if self.length is not None and (n < 0 or n > self.length):
            n = self.length
        result = self.fp.read1(n)
        if not result and n:
            self._close_conn()
        elif self.length is not None:
            self.length -= len(result)
        return result

    def peek(self, n=-1):
        # Having this enables IOBase.readline() to read more than one
        # byte at a time
        if self.fp is None or self._method == "HEAD":
            return b""
        if self.chunked:
            return self._peek_chunked(n)
        return self.fp.peek(n)

    def readline(self, limit=-1):
        if self.fp is None or self._method == "HEAD":
            return b""
        if self.chunked:
            # Fallback to IOBase readline which uses peek() and read()
            return super().readline(limit)
        if self.length is not None and (limit < 0 or limit > self.length):
            limit = self.length
        result = self.fp.readline(limit)
        if not result and limit:
            self._close_conn()
        elif self.length is not None:
            self.length -= len(result)
        return result

    def _read1_chunked(self, n):
        # Strictly speaking, _get_chunk_left() may cause more than one read,
        # but that is ok, since that is to satisfy the chunked protocol.
        chunk_left = self._get_chunk_left()
        if chunk_left is None or n == 0:
            return b''
        if not (0 <= n <= chunk_left):
            n = chunk_left # if n is negative or larger than chunk_left
        read = self.fp.read1(n)
        self.chunk_left -= len(read)
        if not read:
            raise IncompleteRead(b"")
        return read

    def _peek_chunked(self, n):
        # Strictly speaking, _get_chunk_left() may cause more than one read,
        # but that is ok, since that is to satisfy the chunked protocol.
        try:
            chunk_left = self._get_chunk_left()
        except IncompleteRead:
            return b'' # peek doesn't worry about protocol
        if chunk_left is None:
            return b'' # eof
        # peek is allowed to return more than requested.  Just request the
        # entire chunk, and truncate what we get.
        return self.fp.peek(chunk_left)[:chunk_left]

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

    def getheader(self, name, default=None):
        '''Returns the value of the header matching *name*.

        If there are multiple matching headers, the values are
        combined into a single string separated by commas and spaces.

        If no matching header is found, returns *default* or None if
        the *default* is not specified.

        If the headers are unknown, raises http.client.ResponseNotReady.

        '''
        if self.headers is None:
            raise ResponseNotReady()
        headers = self.headers.get_all(name) or default
        if isinstance(headers, str) or not hasattr(headers, '__iter__'):
            return headers
        else:
            return ', '.join(headers)

    def getheaders(self):
        """Return list of (header, value) tuples."""
        if self.headers is None:
            raise ResponseNotReady()
        return list(self.headers.items())

    # We override IOBase.__iter__ so that it doesn't check for closed-ness

    def __iter__(self):
        return self

    # For compatibility with old-style urllib responses.

    def info(self):
        '''Returns an instance of the class mimetools.Message containing
        meta-information associated with the URL.

        When the method is HTTP, these headers are those returned by
        the server at the head of the retrieved HTML page (including
        Content-Length and Content-Type).

        When the method is FTP, a Content-Length header will be
        present if (as is now usual) the server passed back a file
        length in response to the FTP retrieval request. A
        Content-Type header will be present if the MIME type can be
        guessed.

        When the method is local-file, returned headers will include
        a Date representing the file's last-modified time, a
        Content-Length giving file size, and a Content-Type
        containing a guess at the file's type. See also the
        description of the mimetools module.

        '''
        return self.headers

    def geturl(self):
        '''Return the real URL of the page.

        In some cases, the HTTP server redirects a client to another
        URL. The urlopen() function handles this transparently, but in
        some cases the caller needs to know which URL the client was
        redirected to. The geturl() method can be used to get at this
        redirected URL.

        '''
        return self.url

    def getcode(self):
        '''Return the HTTP status code that was sent with the response,
        or None if the URL is not an HTTP URL.

        '''
        return self.status

class HTTPConnection:

    _http_vsn = 11
    _http_vsn_str = 'HTTP/1.1'

    response_class = HTTPResponse
    default_port = HTTP_PORT
    auto_open = 1
    debuglevel = 0

    @staticmethod
    def _is_textIO(stream):
        """Test whether a file-like object is a text or a binary stream.
        """
        return isinstance(stream, io.TextIOBase)

    @staticmethod
    def _get_content_length(body, method):
        """Get the content-length based on the body.

        If the body is None, we set Content-Length: 0 for methods that expect
        a body (RFC 7230, Section 3.3.2). We also set the Content-Length for
        any method if the body is a str or bytes-like object and not a file.
        """
        if body is None:
            # do an explicit check for not None here to distinguish
            # between unset and set but empty
            if method.upper() in _METHODS_EXPECTING_BODY:
                return 0
            else:
                return None

        if hasattr(body, 'read'):
            # file-like object.
            return None

        try:
            # does it implement the buffer protocol (bytes, bytearray, array)?
            mv = memoryview(body)
            return mv.nbytes
        except TypeError:
            pass

        if isinstance(body, str):
            return len(body)

        return None

    def __init__(self, host, port=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
                 source_address=None, blocksize=8192):
        self.timeout = timeout
        self.source_address = source_address
        self.blocksize = blocksize
        self.sock = None
        self._buffer = []
        self.__response = None
        self.__state = _CS_IDLE
        self._method = None
        self._tunnel_host = None
        self._tunnel_port = None
        self._tunnel_headers = {}

        (self.host, self.port) = self._get_hostport(host, port)

        self._validate_host(self.host)

        # This is stored as an instance variable to allow unit
        # tests to replace it with a suitable mockup
        self._create_connection = socket.create_connection

    def set_tunnel(self, host, port=None, headers=None):
        """Set up host and port for HTTP CONNECT tunnelling.

        In a connection that uses HTTP CONNECT tunneling, the host passed to the
        constructor is used as a proxy server that relays all communication to
        the endpoint passed to `set_tunnel`. This done by sending an HTTP
        CONNECT request to the proxy server when the connection is established.

        This method must be called before the HTTP connection has been
        established.

        The headers argument should be a mapping of extra HTTP headers to send
        with the CONNECT request.
        """

        if self.sock:
            raise RuntimeError("Can't set up tunnel for established connection")

        self._tunnel_host, self._tunnel_port = self._get_hostport(host, port)
        if headers:
            self._tunnel_headers = headers
        else:
            self._tunnel_headers.clear()

    def _get_hostport(self, host, port):
        if port is None:
            i = host.rfind(':')
            j = host.rfind(']')         # ipv6 addresses have [...]
            if i > j:
                try:
                    port = int(host[i+1:])
                except ValueError:
                    if host[i+1:] == "": # http://foo.com:/ == http://foo.com/
                        port = self.default_port
                    else:
                        raise InvalidURL("nonnumeric port: '%s'" % host[i+1:])
                host = host[:i]
            else:
                port = self.default_port
            if host and host[0] == '[' and host[-1] == ']':
                host = host[1:-1]

        return (host, port)

    def set_debuglevel(self, level):
        self.debuglevel = level

    def _tunnel(self):
        connect_str = "CONNECT %s:%d HTTP/1.0\r\n" % (self._tunnel_host,
            self._tunnel_port)
        connect_bytes = connect_str.encode("ascii")
        self.send(connect_bytes)
        for header, value in self._tunnel_headers.items():
            header_str = "%s: %s\r\n" % (header, value)
            header_bytes = header_str.encode("latin-1")
            self.send(header_bytes)
        self.send(b'\r\n')

        response = self.response_class(self.sock, method=self._method)
        (version, code, message) = response._read_status()

        if code != http.HTTPStatus.OK:
            self.close()
            raise OSError("Tunnel connection failed: %d %s" % (code,
                                                               message.strip()))
        while True:
            line = response.fp.readline(_MAXLINE + 1)
            if len(line) > _MAXLINE:
                raise LineTooLong("header line")
            if not line:
                # for sites which EOF without sending a trailer
                break
            if line in (b'\r\n', b'\n', b''):
                break

            if self.debuglevel > 0:
                print('header:', line.decode())

    def connect(self):
        """Connect to the host and port specified in __init__."""
        self.sock = self._create_connection(
            (self.host,self.port), self.timeout, self.source_address)
        self.sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)

        if self._tunnel_host:
            self._tunnel()

    def close(self):
        """Close the connection to the HTTP server."""
        self.__state = _CS_IDLE
        try:
            sock = self.sock
            if sock:
                self.sock = None
                sock.close()   # close it manually... there may be other refs
        finally:
            response = self.__response
            if response:
                self.__response = None
                response.close()

    def send(self, data):
        """Send `data' to the server.
        ``data`` can be a string object, a bytes object, an array object, a
        file-like object that supports a .read() method, or an iterable object.
        """

        if self.sock is None:
            if self.auto_open:
                self.connect()
            else:
                raise NotConnected()

        if self.debuglevel > 0:
            print("send:", repr(data))
        if hasattr(data, "read") :
            if self.debuglevel > 0:
                print("sendIng a read()able")
            encode = self._is_textIO(data)
            if encode and self.debuglevel > 0:
                print("encoding file using iso-8859-1")
            while 1:
                datablock = data.read(self.blocksize)
                if not datablock:
                    break
                if encode:
                    datablock = datablock.encode("iso-8859-1")
                self.sock.sendall(datablock)
            return
        try:
            self.sock.sendall(data)
        except TypeError:
            if isinstance(data, collections.abc.Iterable):
                for d in data:
                    self.sock.sendall(d)
            else:
                raise TypeError("data should be a bytes-like object "
                                "or an iterable, got %r" % type(data))

    def _output(self, s):
        """Add a line of output to the current request buffer.

        Assumes that the line does *not* end with \\r\\n.
        """
        self._buffer.append(s)

    def _read_readable(self, readable):
        if self.debuglevel > 0:
            print("sendIng a read()able")
        encode = self._is_textIO(readable)
        if encode and self.debuglevel > 0:
            print("encoding file using iso-8859-1")
        while True:
            datablock = readable.read(self.blocksize)
            if not datablock:
                break
            if encode:
                datablock = datablock.encode("iso-8859-1")
            yield datablock

    def _send_output(self, message_body=None, encode_chunked=False):
        """Send the currently buffered request and clear the buffer.

        Appends an extra \\r\\n to the buffer.
        A message_body may be specified, to be appended to the request.
        """
        self._buffer.extend((b"", b""))
        msg = b"\r\n".join(self._buffer)
        del self._buffer[:]
        self.send(msg)

        if message_body is not None:

            # create a consistent interface to message_body
            if hasattr(message_body, 'read'):
                # Let file-like take precedence over byte-like.  This
                # is needed to allow the current position of mmap'ed
                # files to be taken into account.
                chunks = self._read_readable(message_body)
            else:
                try:
                    # this is solely to check to see if message_body
                    # implements the buffer API.  it /would/ be easier
                    # to capture if PyObject_CheckBuffer was exposed
                    # to Python.
                    memoryview(message_body)
                except TypeError:
                    try:
                        chunks = iter(message_body)
                    except TypeError:
                        raise TypeError("message_body should be a bytes-like "
                                        "object or an iterable, got %r"
                                        % type(message_body))
                else:
                    # the object implements the buffer interface and
                    # can be passed directly into socket methods
                    chunks = (message_body,)

            for chunk in chunks:
                if not chunk:
                    if self.debuglevel > 0:
                        print('Zero length chunk ignored')
                    continue

                if encode_chunked and self._http_vsn == 11:
                    # chunked encoding
                    chunk = f'{len(chunk):X}\r\n'.encode('ascii') + chunk \
                        + b'\r\n'
                self.send(chunk)

            if encode_chunked and self._http_vsn == 11:
                # end chunked transfer
                self.send(b'0\r\n\r\n')

    def putrequest(self, method, url, skip_host=False,
                   skip_accept_encoding=False):
        """Send a request to the server.

        `method' specifies an HTTP request method, e.g. 'GET'.
        `url' specifies the object being requested, e.g. '/index.html'.
        `skip_host' if True does not add automatically a 'Host:' header
        `skip_accept_encoding' if True does not add automatically an
           'Accept-Encoding:' header
        """

        # if a prior response has been completed, then forget about it.
        if self.__response and self.__response.isclosed():
            self.__response = None


        # in certain cases, we cannot issue another request on this connection.
        # this occurs when:
        #   1) we are in the process of sending a request.   (_CS_REQ_STARTED)
        #   2) a response to a previous request has signalled that it is going
        #      to close the connection upon completion.
        #   3) the headers for the previous response have not been read, thus
        #      we cannot determine whether point (2) is true.   (_CS_REQ_SENT)
        #
        # if there is no prior response, then we can request at will.
        #
        # if point (2) is true, then we will have passed the socket to the
        # response (effectively meaning, "there is no prior response"), and
        # will open a new one when a new request is made.
        #
        # Note: if a prior response exists, then we *can* start a new request.
        #       We are not allowed to begin fetching the response to this new
        #       request, however, until that prior response is complete.
        #
        if self.__state == _CS_IDLE:
            self.__state = _CS_REQ_STARTED
        else:
            raise CannotSendRequest(self.__state)

        self._validate_method(method)

        # Save the method for use later in the response phase
        self._method = method

        url = url or '/'
        self._validate_path(url)

        request = '%s %s %s' % (method, url, self._http_vsn_str)

        self._output(self._encode_request(request))

        if self._http_vsn == 11:
            # Issue some standard headers for better HTTP/1.1 compliance

            if not skip_host:
                # this header is issued *only* for HTTP/1.1
                # connections. more specifically, this means it is
                # only issued when the client uses the new
                # HTTPConnection() class. backwards-compat clients
                # will be using HTTP/1.0 and those clients may be
                # issuing this header themselves. we should NOT issue
                # it twice; some web servers (such as Apache) barf
                # when they see two Host: headers

                # If we need a non-standard port,include it in the
                # header.  If the request is going through a proxy,
                # but the host of the actual URL, not the host of the
                # proxy.

                netloc = ''
                if url.startswith('http'):
                    nil, netloc, nil, nil, nil = urlsplit(url)

                if netloc:
                    try:
                        netloc_enc = netloc.encode("ascii")
                    except UnicodeEncodeError:
                        netloc_enc = netloc.encode("idna")
                    self.putheader('Host', netloc_enc)
                else:
                    if self._tunnel_host:
                        host = self._tunnel_host
                        port = self._tunnel_port
                    else:
                        host = self.host
                        port = self.port

                    try:
                        host_enc = host.encode("ascii")
                    except UnicodeEncodeError:
                        host_enc = host.encode("idna")

                    # As per RFC 273, IPv6 address should be wrapped with []
                    # when used as Host header

                    if host.find(':') >= 0:
                        host_enc = b'[' + host_enc + b']'

                    if port == self.default_port:
                        self.putheader('Host', host_enc)
                    else:
                        host_enc = host_enc.decode("ascii")
                        self.putheader('Host', "%s:%s" % (host_enc, port))

            # note: we are assuming that clients will not attempt to set these
            #       headers since *this* library must deal with the
            #       consequences. this also means that when the supporting
            #       libraries are updated to recognize other forms, then this
            #       code should be changed (removed or updated).

            # we only want a Content-Encoding of "identity" since we don't
            # support encodings such as x-gzip or x-deflate.
            if not skip_accept_encoding:
                self.putheader('Accept-Encoding', 'identity')

            # we can accept "chunked" Transfer-Encodings, but no others
            # NOTE: no TE header implies *only* "chunked"
            #self.putheader('TE', 'chunked')

            # if TE is supplied in the header, then it must appear in a
            # Connection header.
            #self.putheader('Connection', 'TE')

        else:
            # For HTTP/1.0, the server will assume "not chunked"
            pass

    def _encode_request(self, request):
        # ASCII also helps prevent CVE-2019-9740.
        return request.encode('ascii')

    def _validate_method(self, method):
        """Validate a method name for putrequest."""
        # prevent http header injection
        match = _contains_disallowed_method_pchar_re.search(method)
        if match:
            raise ValueError(
                    f"method can't contain control characters. {method!r} "
                    f"(found at least {match.group()!r})")

    def _validate_path(self, url):
        """Validate a url for putrequest."""
        # Prevent CVE-2019-9740.
        match = _contains_disallowed_url_pchar_re.search(url)
        if match:
            raise InvalidURL(f"URL can't contain control characters. {url!r} "
                             f"(found at least {match.group()!r})")

    def _validate_host(self, host):
        """Validate a host so it doesn't contain control characters."""
        # Prevent CVE-2019-18348.
        match = _contains_disallowed_url_pchar_re.search(host)
        if match:
            raise InvalidURL(f"URL can't contain control characters. {host!r} "
                             f"(found at least {match.group()!r})")

    def putheader(self, header, *values):
        """Send a request header line to the server.

        For example: h.putheader('Accept', 'text/html')
        """
        if self.__state != _CS_REQ_STARTED:
            raise CannotSendHeader()

        if hasattr(header, 'encode'):
            header = header.encode('ascii')

        if not _is_legal_header_name(header):
            raise ValueError('Invalid header name %r' % (header,))

        values = list(values)
        for i, one_value in enumerate(values):
            if hasattr(one_value, 'encode'):
                values[i] = one_value.encode('latin-1')
            elif isinstance(one_value, int):
                values[i] = str(one_value).encode('ascii')

            if _is_illegal_header_value(values[i]):
                raise ValueError('Invalid header value %r' % (values[i],))

        value = b'\r\n\t'.join(values)
        header = header + b': ' + value
        self._output(header)

    def endheaders(self, message_body=None, *, encode_chunked=False):
        """Indicate that the last header line has been sent to the server.

        This method sends the request to the server.  The optional message_body
        argument can be used to pass a message body associated with the
        request.
        """
        if self.__state == _CS_REQ_STARTED:
            self.__state = _CS_REQ_SENT
        else:
            raise CannotSendHeader()
        self._send_output(message_body, encode_chunked=encode_chunked)

    def request(self, method, url, body=None, headers={}, *,
                encode_chunked=False):
        """Send a complete request to the server."""
        self._send_request(method, url, body, headers, encode_chunked)

    def _send_request(self, method, url, body, headers, encode_chunked):
        # Honor explicitly requested Host: and Accept-Encoding: headers.
        header_names = frozenset(k.lower() for k in headers)
        skips = {}
        if 'host' in header_names:
            skips['skip_host'] = 1
        if 'accept-encoding' in header_names:
            skips['skip_accept_encoding'] = 1

        self.putrequest(method, url, **skips)

        # chunked encoding will happen if HTTP/1.1 is used and either
        # the caller passes encode_chunked=True or the following
        # conditions hold:
        # 1. content-length has not been explicitly set
        # 2. the body is a file or iterable, but not a str or bytes-like
        # 3. Transfer-Encoding has NOT been explicitly set by the caller

        if 'content-length' not in header_names:
            # only chunk body if not explicitly set for backwards
            # compatibility, assuming the client code is already handling the
            # chunking
            if 'transfer-encoding' not in header_names:
                # if content-length cannot be automatically determined, fall
                # back to chunked encoding
                encode_chunked = False
                content_length = self._get_content_length(body, method)
                if content_length is None:
                    if body is not None:
                        if self.debuglevel > 0:
                            print('Unable to determine size of %r' % body)
                        encode_chunked = True
                        self.putheader('Transfer-Encoding', 'chunked')
                else:
                    self.putheader('Content-Length', str(content_length))
        else:
            encode_chunked = False

        for hdr, value in headers.items():
            self.putheader(hdr, value)
        if isinstance(body, str):
            # RFC 2616 Section 3.7.1 says that text default has a
            # default charset of iso-8859-1.
            body = _encode(body, 'body')
        self.endheaders(body, encode_chunked=encode_chunked)

    def getresponse(self):
        """Get the response from the server.

        If the HTTPConnection is in the correct state, returns an
        instance of HTTPResponse or of whatever object is returned by
        the response_class variable.

        If a request has not been sent or if a previous response has
        not be handled, ResponseNotReady is raised.  If the HTTP
        response indicates that the connection should be closed, then
        it will be closed before the response is returned.  When the
        connection is closed, the underlying socket is closed.
        """

        # if a prior response has been completed, then forget about it.
        if self.__response and self.__response.isclosed():
            self.__response = None

        # if a prior response exists, then it must be completed (otherwise, we
        # cannot read this response's header to determine the connection-close
        # behavior)
        #
        # note: if a prior response existed, but was connection-close, then the
        # socket and response were made independent of this HTTPConnection
        # object since a new request requires that we open a whole new
        # connection
        #
        # this means the prior response had one of two states:
        #   1) will_close: this connection was reset and the prior socket and
        #                  response operate independently
        #   2) persistent: the response was retained and we await its
        #                  isclosed() status to become true.
        #
        if self.__state != _CS_REQ_SENT or self.__response:
            raise ResponseNotReady(self.__state)

        if self.debuglevel > 0:
            response = self.response_class(self.sock, self.debuglevel,
                                           method=self._method)
        else:
            response = self.response_class(self.sock, method=self._method)

        try:
            try:
                response.begin()
            except ConnectionError:
                self.close()
                raise
            assert response.will_close != _UNKNOWN
            self.__state = _CS_IDLE

            if response.will_close:
                # this effectively passes the connection to the response
                self.close()
            else:
                # remember this, so we can tell when it is complete
                self.__response = response

            return response
        except:
            response.close()
            raise

try:
    import ssl
except ImportError:
    pass
else:
    class HTTPSConnection(HTTPConnection):
        "This class allows communication via SSL."

        default_port = HTTPS_PORT

        # XXX Should key_file and cert_file be deprecated in favour of context?

        def __init__(self, host, port=None, key_file=None, cert_file=None,
                     timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
                     source_address=None, *, context=None,
                     check_hostname=None, blocksize=8192):
            super(HTTPSConnection, self).__init__(host, port, timeout,
                                                  source_address,
                                                  blocksize=blocksize)
            if (key_file is not None or cert_file is not None or
                        check_hostname is not None):
                import warnings
                warnings.warn("key_file, cert_file and check_hostname are "
                              "deprecated, use a custom context instead.",
                              DeprecationWarning, 2)
            self.key_file = key_file
            self.cert_file = cert_file
            if context is None:
                context = ssl._create_default_https_context()
                # enable PHA for TLS 1.3 connections if available
                if context.post_handshake_auth is not None:
                    context.post_handshake_auth = True
            will_verify = context.verify_mode != ssl.CERT_NONE
            if check_hostname is None:
                check_hostname = context.check_hostname
            if check_hostname and not will_verify:
                raise ValueError("check_hostname needs a SSL context with "
                                 "either CERT_OPTIONAL or CERT_REQUIRED")
            if key_file or cert_file:
                context.load_cert_chain(cert_file, key_file)
                # cert and key file means the user wants to authenticate.
                # enable TLS 1.3 PHA implicitly even for custom contexts.
                if context.post_handshake_auth is not None:
                    context.post_handshake_auth = True
            self._context = context
            if check_hostname is not None:
                self._context.check_hostname = check_hostname

        def connect(self):
            "Connect to a host on a given (SSL) port."

            super().connect()

            if self._tunnel_host:
                server_hostname = self._tunnel_host
            else:
                server_hostname = self.host

            self.sock = self._context.wrap_socket(self.sock,
                                                  server_hostname=server_hostname)

    __all__.append("HTTPSConnection")

class HTTPException(Exception):
    # Subclasses that define an __init__ must call Exception.__init__
    # or define self.args.  Otherwise, str() will fail.
    pass

class NotConnected(HTTPException):
    pass

class InvalidURL(HTTPException):
    pass

class UnknownProtocol(HTTPException):
    def __init__(self, version):
        self.args = version,
        self.version = version

class UnknownTransferEncoding(HTTPException):
    pass

class UnimplementedFileMode(HTTPException):
    pass

class IncompleteRead(HTTPException):
    def __init__(self, partial, expected=None):
        self.args = partial,
        self.partial = partial
        self.expected = expected
    def __repr__(self):
        if self.expected is not None:
            e = ', %i more expected' % self.expected
        else:
            e = ''
        return '%s(%i bytes read%s)' % (self.__class__.__name__,
                                        len(self.partial), e)
    __str__ = object.__str__

class ImproperConnectionState(HTTPException):
    pass

class CannotSendRequest(ImproperConnectionState):
    pass

class CannotSendHeader(ImproperConnectionState):
    pass

class ResponseNotReady(ImproperConnectionState):
    pass

class BadStatusLine(HTTPException):
    def __init__(self, line):
        if not line:
            line = repr(line)
        self.args = line,
        self.line = line

class LineTooLong(HTTPException):
    def __init__(self, line_type):
        HTTPException.__init__(self, "got more than %d bytes when reading %s"
                                     % (_MAXLINE, line_type))

class RemoteDisconnected(ConnectionResetError, BadStatusLine):
    def __init__(self, *pos, **kw):
        BadStatusLine.__init__(self, "")
        ConnectionResetError.__init__(self, *pos, **kw)

# for backwards compatibility
error = HTTPException
locale.py000064400000230557151153537450006402 0ustar00"""Locale support module.

The module provides low-level access to the C lib's locale APIs and adds high
level number formatting APIs as well as a locale aliasing engine to complement
these.

The aliasing engine includes support for many commonly used locale names and
maps them to values suitable for passing to the C lib's setlocale() function. It
also includes default encodings for all supported locale names.

"""

import sys
import encodings
import encodings.aliases
import re
import _collections_abc
from builtins import str as _builtin_str
import functools

# Try importing the _locale module.
#
# If this fails, fall back on a basic 'C' locale emulation.

# Yuck:  LC_MESSAGES is non-standard:  can't tell whether it exists before
# trying the import.  So __all__ is also fiddled at the end of the file.
__all__ = ["getlocale", "getdefaultlocale", "getpreferredencoding", "Error",
           "setlocale", "resetlocale", "localeconv", "strcoll", "strxfrm",
           "str", "atof", "atoi", "format", "format_string", "currency",
           "normalize", "LC_CTYPE", "LC_COLLATE", "LC_TIME", "LC_MONETARY",
           "LC_NUMERIC", "LC_ALL", "CHAR_MAX"]

def _strcoll(a,b):
    """ strcoll(string,string) -> int.
        Compares two strings according to the locale.
    """
    return (a > b) - (a < b)

def _strxfrm(s):
    """ strxfrm(string) -> string.
        Returns a string that behaves for cmp locale-aware.
    """
    return s

try:

    from _locale import *

except ImportError:

    # Locale emulation

    CHAR_MAX = 127
    LC_ALL = 6
    LC_COLLATE = 3
    LC_CTYPE = 0
    LC_MESSAGES = 5
    LC_MONETARY = 4
    LC_NUMERIC = 1
    LC_TIME = 2
    Error = ValueError

    def localeconv():
        """ localeconv() -> dict.
            Returns numeric and monetary locale-specific parameters.
        """
        # 'C' locale default values
        return {'grouping': [127],
                'currency_symbol': '',
                'n_sign_posn': 127,
                'p_cs_precedes': 127,
                'n_cs_precedes': 127,
                'mon_grouping': [],
                'n_sep_by_space': 127,
                'decimal_point': '.',
                'negative_sign': '',
                'positive_sign': '',
                'p_sep_by_space': 127,
                'int_curr_symbol': '',
                'p_sign_posn': 127,
                'thousands_sep': '',
                'mon_thousands_sep': '',
                'frac_digits': 127,
                'mon_decimal_point': '',
                'int_frac_digits': 127}

    def setlocale(category, value=None):
        """ setlocale(integer,string=None) -> string.
            Activates/queries locale processing.
        """
        if value not in (None, '', 'C'):
            raise Error('_locale emulation only supports "C" locale')
        return 'C'

# These may or may not exist in _locale, so be sure to set them.
if 'strxfrm' not in globals():
    strxfrm = _strxfrm
if 'strcoll' not in globals():
    strcoll = _strcoll


_localeconv = localeconv

# With this dict, you can override some items of localeconv's return value.
# This is useful for testing purposes.
_override_localeconv = {}

@functools.wraps(_localeconv)
def localeconv():
    d = _localeconv()
    if _override_localeconv:
        d.update(_override_localeconv)
    return d


### Number formatting APIs

# Author: Martin von Loewis
# improved by Georg Brandl

# Iterate over grouping intervals
def _grouping_intervals(grouping):
    last_interval = None
    for interval in grouping:
        # if grouping is -1, we are done
        if interval == CHAR_MAX:
            return
        # 0: re-use last group ad infinitum
        if interval == 0:
            if last_interval is None:
                raise ValueError("invalid grouping")
            while True:
                yield last_interval
        yield interval
        last_interval = interval

#perform the grouping from right to left
def _group(s, monetary=False):
    conv = localeconv()
    thousands_sep = conv[monetary and 'mon_thousands_sep' or 'thousands_sep']
    grouping = conv[monetary and 'mon_grouping' or 'grouping']
    if not grouping:
        return (s, 0)
    if s[-1] == ' ':
        stripped = s.rstrip()
        right_spaces = s[len(stripped):]
        s = stripped
    else:
        right_spaces = ''
    left_spaces = ''
    groups = []
    for interval in _grouping_intervals(grouping):
        if not s or s[-1] not in "0123456789":
            # only non-digit characters remain (sign, spaces)
            left_spaces = s
            s = ''
            break
        groups.append(s[-interval:])
        s = s[:-interval]
    if s:
        groups.append(s)
    groups.reverse()
    return (
        left_spaces + thousands_sep.join(groups) + right_spaces,
        len(thousands_sep) * (len(groups) - 1)
    )

# Strip a given amount of excess padding from the given string
def _strip_padding(s, amount):
    lpos = 0
    while amount and s[lpos] == ' ':
        lpos += 1
        amount -= 1
    rpos = len(s) - 1
    while amount and s[rpos] == ' ':
        rpos -= 1
        amount -= 1
    return s[lpos:rpos+1]

_percent_re = re.compile(r'%(?:\((?P<key>.*?)\))?'
                         r'(?P<modifiers>[-#0-9 +*.hlL]*?)[eEfFgGdiouxXcrs%]')

def _format(percent, value, grouping=False, monetary=False, *additional):
    if additional:
        formatted = percent % ((value,) + additional)
    else:
        formatted = percent % value
    # floats and decimal ints need special action!
    if percent[-1] in 'eEfFgG':
        seps = 0
        parts = formatted.split('.')
        if grouping:
            parts[0], seps = _group(parts[0], monetary=monetary)
        decimal_point = localeconv()[monetary and 'mon_decimal_point'
                                              or 'decimal_point']
        formatted = decimal_point.join(parts)
        if seps:
            formatted = _strip_padding(formatted, seps)
    elif percent[-1] in 'diu':
        seps = 0
        if grouping:
            formatted, seps = _group(formatted, monetary=monetary)
        if seps:
            formatted = _strip_padding(formatted, seps)
    return formatted

def format_string(f, val, grouping=False, monetary=False):
    """Formats a string in the same way that the % formatting would use,
    but takes the current locale into account.

    Grouping is applied if the third parameter is true.
    Conversion uses monetary thousands separator and grouping strings if
    forth parameter monetary is true."""
    percents = list(_percent_re.finditer(f))
    new_f = _percent_re.sub('%s', f)

    if isinstance(val, _collections_abc.Mapping):
        new_val = []
        for perc in percents:
            if perc.group()[-1]=='%':
                new_val.append('%')
            else:
                new_val.append(_format(perc.group(), val, grouping, monetary))
    else:
        if not isinstance(val, tuple):
            val = (val,)
        new_val = []
        i = 0
        for perc in percents:
            if perc.group()[-1]=='%':
                new_val.append('%')
            else:
                starcount = perc.group('modifiers').count('*')
                new_val.append(_format(perc.group(),
                                      val[i],
                                      grouping,
                                      monetary,
                                      *val[i+1:i+1+starcount]))
                i += (1 + starcount)
    val = tuple(new_val)

    return new_f % val

def format(percent, value, grouping=False, monetary=False, *additional):
    """Deprecated, use format_string instead."""
    import warnings
    warnings.warn(
        "This method will be removed in a future version of Python. "
        "Use 'locale.format_string()' instead.",
        DeprecationWarning, stacklevel=2
    )

    match = _percent_re.match(percent)
    if not match or len(match.group())!= len(percent):
        raise ValueError(("format() must be given exactly one %%char "
                         "format specifier, %s not valid") % repr(percent))
    return _format(percent, value, grouping, monetary, *additional)

def currency(val, symbol=True, grouping=False, international=False):
    """Formats val according to the currency settings
    in the current locale."""
    conv = localeconv()

    # check for illegal values
    digits = conv[international and 'int_frac_digits' or 'frac_digits']
    if digits == 127:
        raise ValueError("Currency formatting is not possible using "
                         "the 'C' locale.")

    s = _format('%%.%if' % digits, abs(val), grouping, monetary=True)
    # '<' and '>' are markers if the sign must be inserted between symbol and value
    s = '<' + s + '>'

    if symbol:
        smb = conv[international and 'int_curr_symbol' or 'currency_symbol']
        precedes = conv[val<0 and 'n_cs_precedes' or 'p_cs_precedes']
        separated = conv[val<0 and 'n_sep_by_space' or 'p_sep_by_space']

        if precedes:
            s = smb + (separated and ' ' or '') + s
        else:
            s = s + (separated and ' ' or '') + smb

    sign_pos = conv[val<0 and 'n_sign_posn' or 'p_sign_posn']
    sign = conv[val<0 and 'negative_sign' or 'positive_sign']

    if sign_pos == 0:
        s = '(' + s + ')'
    elif sign_pos == 1:
        s = sign + s
    elif sign_pos == 2:
        s = s + sign
    elif sign_pos == 3:
        s = s.replace('<', sign)
    elif sign_pos == 4:
        s = s.replace('>', sign)
    else:
        # the default if nothing specified;
        # this should be the most fitting sign position
        s = sign + s

    return s.replace('<', '').replace('>', '')

def str(val):
    """Convert float to string, taking the locale into account."""
    return _format("%.12g", val)

def delocalize(string):
    "Parses a string as a normalized number according to the locale settings."

    conv = localeconv()

    #First, get rid of the grouping
    ts = conv['thousands_sep']
    if ts:
        string = string.replace(ts, '')

    #next, replace the decimal point with a dot
    dd = conv['decimal_point']
    if dd:
        string = string.replace(dd, '.')
    return string

def atof(string, func=float):
    "Parses a string as a float according to the locale settings."
    return func(delocalize(string))

def atoi(string):
    "Converts a string to an integer according to the locale settings."
    return int(delocalize(string))

def _test():
    setlocale(LC_ALL, "")
    #do grouping
    s1 = format_string("%d", 123456789,1)
    print(s1, "is", atoi(s1))
    #standard formatting
    s1 = str(3.14)
    print(s1, "is", atof(s1))

### Locale name aliasing engine

# Author: Marc-Andre Lemburg, mal@lemburg.com
# Various tweaks by Fredrik Lundh <fredrik@pythonware.com>

# store away the low-level version of setlocale (it's
# overridden below)
_setlocale = setlocale

def _replace_encoding(code, encoding):
    if '.' in code:
        langname = code[:code.index('.')]
    else:
        langname = code
    # Convert the encoding to a C lib compatible encoding string
    norm_encoding = encodings.normalize_encoding(encoding)
    #print('norm encoding: %r' % norm_encoding)
    norm_encoding = encodings.aliases.aliases.get(norm_encoding.lower(),
                                                  norm_encoding)
    #print('aliased encoding: %r' % norm_encoding)
    encoding = norm_encoding
    norm_encoding = norm_encoding.lower()
    if norm_encoding in locale_encoding_alias:
        encoding = locale_encoding_alias[norm_encoding]
    else:
        norm_encoding = norm_encoding.replace('_', '')
        norm_encoding = norm_encoding.replace('-', '')
        if norm_encoding in locale_encoding_alias:
            encoding = locale_encoding_alias[norm_encoding]
    #print('found encoding %r' % encoding)
    return langname + '.' + encoding

def _append_modifier(code, modifier):
    if modifier == 'euro':
        if '.' not in code:
            return code + '.ISO8859-15'
        _, _, encoding = code.partition('.')
        if encoding in ('ISO8859-15', 'UTF-8'):
            return code
        if encoding == 'ISO8859-1':
            return _replace_encoding(code, 'ISO8859-15')
    return code + '@' + modifier

def normalize(localename):

    """ Returns a normalized locale code for the given locale
        name.

        The returned locale code is formatted for use with
        setlocale().

        If normalization fails, the original name is returned
        unchanged.

        If the given encoding is not known, the function defaults to
        the default encoding for the locale code just like setlocale()
        does.

    """
    # Normalize the locale name and extract the encoding and modifier
    code = localename.lower()
    if ':' in code:
        # ':' is sometimes used as encoding delimiter.
        code = code.replace(':', '.')
    if '@' in code:
        code, modifier = code.split('@', 1)
    else:
        modifier = ''
    if '.' in code:
        langname, encoding = code.split('.')[:2]
    else:
        langname = code
        encoding = ''

    # First lookup: fullname (possibly with encoding and modifier)
    lang_enc = langname
    if encoding:
        norm_encoding = encoding.replace('-', '')
        norm_encoding = norm_encoding.replace('_', '')
        lang_enc += '.' + norm_encoding
    lookup_name = lang_enc
    if modifier:
        lookup_name += '@' + modifier
    code = locale_alias.get(lookup_name, None)
    if code is not None:
        return code
    #print('first lookup failed')

    if modifier:
        # Second try: fullname without modifier (possibly with encoding)
        code = locale_alias.get(lang_enc, None)
        if code is not None:
            #print('lookup without modifier succeeded')
            if '@' not in code:
                return _append_modifier(code, modifier)
            if code.split('@', 1)[1].lower() == modifier:
                return code
        #print('second lookup failed')

    if encoding:
        # Third try: langname (without encoding, possibly with modifier)
        lookup_name = langname
        if modifier:
            lookup_name += '@' + modifier
        code = locale_alias.get(lookup_name, None)
        if code is not None:
            #print('lookup without encoding succeeded')
            if '@' not in code:
                return _replace_encoding(code, encoding)
            code, modifier = code.split('@', 1)
            return _replace_encoding(code, encoding) + '@' + modifier

        if modifier:
            # Fourth try: langname (without encoding and modifier)
            code = locale_alias.get(langname, None)
            if code is not None:
                #print('lookup without modifier and encoding succeeded')
                if '@' not in code:
                    code = _replace_encoding(code, encoding)
                    return _append_modifier(code, modifier)
                code, defmod = code.split('@', 1)
                if defmod.lower() == modifier:
                    return _replace_encoding(code, encoding) + '@' + defmod

    return localename

def _parse_localename(localename):

    """ Parses the locale code for localename and returns the
        result as tuple (language code, encoding).

        The localename is normalized and passed through the locale
        alias engine. A ValueError is raised in case the locale name
        cannot be parsed.

        The language code corresponds to RFC 1766.  code and encoding
        can be None in case the values cannot be determined or are
        unknown to this implementation.

    """
    code = normalize(localename)
    if '@' in code:
        # Deal with locale modifiers
        code, modifier = code.split('@', 1)
        if modifier == 'euro' and '.' not in code:
            # Assume Latin-9 for @euro locales. This is bogus,
            # since some systems may use other encodings for these
            # locales. Also, we ignore other modifiers.
            return code, 'iso-8859-15'

    if '.' in code:
        return tuple(code.split('.')[:2])
    elif code == 'C':
        return None, None
    elif code == 'UTF-8':
        # On macOS "LC_CTYPE=UTF-8" is a valid locale setting
        # for getting UTF-8 handling for text.
        return None, 'UTF-8'
    raise ValueError('unknown locale: %s' % localename)

def _build_localename(localetuple):

    """ Builds a locale code from the given tuple (language code,
        encoding).

        No aliasing or normalizing takes place.

    """
    try:
        language, encoding = localetuple

        if language is None:
            language = 'C'
        if encoding is None:
            return language
        else:
            return language + '.' + encoding
    except (TypeError, ValueError):
        raise TypeError('Locale must be None, a string, or an iterable of '
                        'two strings -- language code, encoding.') from None

def getdefaultlocale(envvars=('LC_ALL', 'LC_CTYPE', 'LANG', 'LANGUAGE')):

    """ Tries to determine the default locale settings and returns
        them as tuple (language code, encoding).

        According to POSIX, a program which has not called
        setlocale(LC_ALL, "") runs using the portable 'C' locale.
        Calling setlocale(LC_ALL, "") lets it use the default locale as
        defined by the LANG variable. Since we don't want to interfere
        with the current locale setting we thus emulate the behavior
        in the way described above.

        To maintain compatibility with other platforms, not only the
        LANG variable is tested, but a list of variables given as
        envvars parameter. The first found to be defined will be
        used. envvars defaults to the search path used in GNU gettext;
        it must always contain the variable name 'LANG'.

        Except for the code 'C', the language code corresponds to RFC
        1766.  code and encoding can be None in case the values cannot
        be determined.

    """

    try:
        # check if it's supported by the _locale module
        import _locale
        code, encoding = _locale._getdefaultlocale()
    except (ImportError, AttributeError):
        pass
    else:
        # make sure the code/encoding values are valid
        if sys.platform == "win32" and code and code[:2] == "0x":
            # map windows language identifier to language name
            code = windows_locale.get(int(code, 0))
        # ...add other platform-specific processing here, if
        # necessary...
        return code, encoding

    # fall back on POSIX behaviour
    import os
    lookup = os.environ.get
    for variable in envvars:
        localename = lookup(variable,None)
        if localename:
            if variable == 'LANGUAGE':
                localename = localename.split(':')[0]
            break
    else:
        localename = 'C'
    return _parse_localename(localename)


def getlocale(category=LC_CTYPE):

    """ Returns the current setting for the given locale category as
        tuple (language code, encoding).

        category may be one of the LC_* value except LC_ALL. It
        defaults to LC_CTYPE.

        Except for the code 'C', the language code corresponds to RFC
        1766.  code and encoding can be None in case the values cannot
        be determined.

    """
    localename = _setlocale(category)
    if category == LC_ALL and ';' in localename:
        raise TypeError('category LC_ALL is not supported')
    return _parse_localename(localename)

def setlocale(category, locale=None):

    """ Set the locale for the given category.  The locale can be
        a string, an iterable of two strings (language code and encoding),
        or None.

        Iterables are converted to strings using the locale aliasing
        engine.  Locale strings are passed directly to the C lib.

        category may be given as one of the LC_* values.

    """
    if locale and not isinstance(locale, _builtin_str):
        # convert to string
        locale = normalize(_build_localename(locale))
    return _setlocale(category, locale)

def resetlocale(category=LC_ALL):

    """ Sets the locale for category to the default setting.

        The default setting is determined by calling
        getdefaultlocale(). category defaults to LC_ALL.

    """
    _setlocale(category, _build_localename(getdefaultlocale()))

if sys.platform.startswith("win"):
    # On Win32, this will return the ANSI code page
    def getpreferredencoding(do_setlocale = True):
        """Return the charset that the user is likely using."""
        if sys.flags.utf8_mode:
            return 'UTF-8'
        import _bootlocale
        return _bootlocale.getpreferredencoding(False)
else:
    # On Unix, if CODESET is available, use that.
    try:
        CODESET
    except NameError:
        if hasattr(sys, 'getandroidapilevel'):
            # On Android langinfo.h and CODESET are missing, and UTF-8 is
            # always used in mbstowcs() and wcstombs().
            def getpreferredencoding(do_setlocale = True):
                return 'UTF-8'
        else:
            # Fall back to parsing environment variables :-(
            def getpreferredencoding(do_setlocale = True):
                """Return the charset that the user is likely using,
                by looking at environment variables."""
                if sys.flags.utf8_mode:
                    return 'UTF-8'
                res = getdefaultlocale()[1]
                if res is None:
                    # LANG not set, default conservatively to ASCII
                    res = 'ascii'
                return res
    else:
        def getpreferredencoding(do_setlocale = True):
            """Return the charset that the user is likely using,
            according to the system configuration."""
            if sys.flags.utf8_mode:
                return 'UTF-8'
            import _bootlocale
            if do_setlocale:
                oldloc = setlocale(LC_CTYPE)
                try:
                    setlocale(LC_CTYPE, "")
                except Error:
                    pass
            result = _bootlocale.getpreferredencoding(False)
            if do_setlocale:
                setlocale(LC_CTYPE, oldloc)
            return result


### Database
#
# The following data was extracted from the locale.alias file which
# comes with X11 and then hand edited removing the explicit encoding
# definitions and adding some more aliases. The file is usually
# available as /usr/lib/X11/locale/locale.alias.
#

#
# The local_encoding_alias table maps lowercase encoding alias names
# to C locale encoding names (case-sensitive). Note that normalize()
# first looks up the encoding in the encodings.aliases dictionary and
# then applies this mapping to find the correct C lib name for the
# encoding.
#
locale_encoding_alias = {

    # Mappings for non-standard encoding names used in locale names
    '437':                          'C',
    'c':                            'C',
    'en':                           'ISO8859-1',
    'jis':                          'JIS7',
    'jis7':                         'JIS7',
    'ajec':                         'eucJP',
    'koi8c':                        'KOI8-C',
    'microsoftcp1251':              'CP1251',
    'microsoftcp1255':              'CP1255',
    'microsoftcp1256':              'CP1256',
    '88591':                        'ISO8859-1',
    '88592':                        'ISO8859-2',
    '88595':                        'ISO8859-5',
    '885915':                       'ISO8859-15',

    # Mappings from Python codec names to C lib encoding names
    'ascii':                        'ISO8859-1',
    'latin_1':                      'ISO8859-1',
    'iso8859_1':                    'ISO8859-1',
    'iso8859_10':                   'ISO8859-10',
    'iso8859_11':                   'ISO8859-11',
    'iso8859_13':                   'ISO8859-13',
    'iso8859_14':                   'ISO8859-14',
    'iso8859_15':                   'ISO8859-15',
    'iso8859_16':                   'ISO8859-16',
    'iso8859_2':                    'ISO8859-2',
    'iso8859_3':                    'ISO8859-3',
    'iso8859_4':                    'ISO8859-4',
    'iso8859_5':                    'ISO8859-5',
    'iso8859_6':                    'ISO8859-6',
    'iso8859_7':                    'ISO8859-7',
    'iso8859_8':                    'ISO8859-8',
    'iso8859_9':                    'ISO8859-9',
    'iso2022_jp':                   'JIS7',
    'shift_jis':                    'SJIS',
    'tactis':                       'TACTIS',
    'euc_jp':                       'eucJP',
    'euc_kr':                       'eucKR',
    'utf_8':                        'UTF-8',
    'koi8_r':                       'KOI8-R',
    'koi8_t':                       'KOI8-T',
    'koi8_u':                       'KOI8-U',
    'kz1048':                       'RK1048',
    'cp1251':                       'CP1251',
    'cp1255':                       'CP1255',
    'cp1256':                       'CP1256',

    # XXX This list is still incomplete. If you know more
    # mappings, please file a bug report. Thanks.
}

for k, v in sorted(locale_encoding_alias.items()):
    k = k.replace('_', '')
    locale_encoding_alias.setdefault(k, v)

#
# The locale_alias table maps lowercase alias names to C locale names
# (case-sensitive). Encodings are always separated from the locale
# name using a dot ('.'); they should only be given in case the
# language name is needed to interpret the given encoding alias
# correctly (CJK codes often have this need).
#
# Note that the normalize() function which uses this tables
# removes '_' and '-' characters from the encoding part of the
# locale name before doing the lookup. This saves a lot of
# space in the table.
#
# MAL 2004-12-10:
# Updated alias mapping to most recent locale.alias file
# from X.org distribution using makelocalealias.py.
#
# These are the differences compared to the old mapping (Python 2.4
# and older):
#
#    updated 'bg' -> 'bg_BG.ISO8859-5' to 'bg_BG.CP1251'
#    updated 'bg_bg' -> 'bg_BG.ISO8859-5' to 'bg_BG.CP1251'
#    updated 'bulgarian' -> 'bg_BG.ISO8859-5' to 'bg_BG.CP1251'
#    updated 'cz' -> 'cz_CZ.ISO8859-2' to 'cs_CZ.ISO8859-2'
#    updated 'cz_cz' -> 'cz_CZ.ISO8859-2' to 'cs_CZ.ISO8859-2'
#    updated 'czech' -> 'cs_CS.ISO8859-2' to 'cs_CZ.ISO8859-2'
#    updated 'dutch' -> 'nl_BE.ISO8859-1' to 'nl_NL.ISO8859-1'
#    updated 'et' -> 'et_EE.ISO8859-4' to 'et_EE.ISO8859-15'
#    updated 'et_ee' -> 'et_EE.ISO8859-4' to 'et_EE.ISO8859-15'
#    updated 'fi' -> 'fi_FI.ISO8859-1' to 'fi_FI.ISO8859-15'
#    updated 'fi_fi' -> 'fi_FI.ISO8859-1' to 'fi_FI.ISO8859-15'
#    updated 'iw' -> 'iw_IL.ISO8859-8' to 'he_IL.ISO8859-8'
#    updated 'iw_il' -> 'iw_IL.ISO8859-8' to 'he_IL.ISO8859-8'
#    updated 'japanese' -> 'ja_JP.SJIS' to 'ja_JP.eucJP'
#    updated 'lt' -> 'lt_LT.ISO8859-4' to 'lt_LT.ISO8859-13'
#    updated 'lv' -> 'lv_LV.ISO8859-4' to 'lv_LV.ISO8859-13'
#    updated 'sl' -> 'sl_CS.ISO8859-2' to 'sl_SI.ISO8859-2'
#    updated 'slovene' -> 'sl_CS.ISO8859-2' to 'sl_SI.ISO8859-2'
#    updated 'th_th' -> 'th_TH.TACTIS' to 'th_TH.ISO8859-11'
#    updated 'zh_cn' -> 'zh_CN.eucCN' to 'zh_CN.gb2312'
#    updated 'zh_cn.big5' -> 'zh_TW.eucTW' to 'zh_TW.big5'
#    updated 'zh_tw' -> 'zh_TW.eucTW' to 'zh_TW.big5'
#
# MAL 2008-05-30:
# Updated alias mapping to most recent locale.alias file
# from X.org distribution using makelocalealias.py.
#
# These are the differences compared to the old mapping (Python 2.5
# and older):
#
#    updated 'cs_cs.iso88592' -> 'cs_CZ.ISO8859-2' to 'cs_CS.ISO8859-2'
#    updated 'serbocroatian' -> 'sh_YU.ISO8859-2' to 'sr_CS.ISO8859-2'
#    updated 'sh' -> 'sh_YU.ISO8859-2' to 'sr_CS.ISO8859-2'
#    updated 'sh_hr.iso88592' -> 'sh_HR.ISO8859-2' to 'hr_HR.ISO8859-2'
#    updated 'sh_sp' -> 'sh_YU.ISO8859-2' to 'sr_CS.ISO8859-2'
#    updated 'sh_yu' -> 'sh_YU.ISO8859-2' to 'sr_CS.ISO8859-2'
#    updated 'sp' -> 'sp_YU.ISO8859-5' to 'sr_CS.ISO8859-5'
#    updated 'sp_yu' -> 'sp_YU.ISO8859-5' to 'sr_CS.ISO8859-5'
#    updated 'sr' -> 'sr_YU.ISO8859-5' to 'sr_CS.ISO8859-5'
#    updated 'sr@cyrillic' -> 'sr_YU.ISO8859-5' to 'sr_CS.ISO8859-5'
#    updated 'sr_sp' -> 'sr_SP.ISO8859-2' to 'sr_CS.ISO8859-2'
#    updated 'sr_yu' -> 'sr_YU.ISO8859-5' to 'sr_CS.ISO8859-5'
#    updated 'sr_yu.cp1251@cyrillic' -> 'sr_YU.CP1251' to 'sr_CS.CP1251'
#    updated 'sr_yu.iso88592' -> 'sr_YU.ISO8859-2' to 'sr_CS.ISO8859-2'
#    updated 'sr_yu.iso88595' -> 'sr_YU.ISO8859-5' to 'sr_CS.ISO8859-5'
#    updated 'sr_yu.iso88595@cyrillic' -> 'sr_YU.ISO8859-5' to 'sr_CS.ISO8859-5'
#    updated 'sr_yu.microsoftcp1251@cyrillic' -> 'sr_YU.CP1251' to 'sr_CS.CP1251'
#    updated 'sr_yu.utf8@cyrillic' -> 'sr_YU.UTF-8' to 'sr_CS.UTF-8'
#    updated 'sr_yu@cyrillic' -> 'sr_YU.ISO8859-5' to 'sr_CS.ISO8859-5'
#
# AP 2010-04-12:
# Updated alias mapping to most recent locale.alias file
# from X.org distribution using makelocalealias.py.
#
# These are the differences compared to the old mapping (Python 2.6.5
# and older):
#
#    updated 'ru' -> 'ru_RU.ISO8859-5' to 'ru_RU.UTF-8'
#    updated 'ru_ru' -> 'ru_RU.ISO8859-5' to 'ru_RU.UTF-8'
#    updated 'serbocroatian' -> 'sr_CS.ISO8859-2' to 'sr_RS.UTF-8@latin'
#    updated 'sh' -> 'sr_CS.ISO8859-2' to 'sr_RS.UTF-8@latin'
#    updated 'sh_yu' -> 'sr_CS.ISO8859-2' to 'sr_RS.UTF-8@latin'
#    updated 'sr' -> 'sr_CS.ISO8859-5' to 'sr_RS.UTF-8'
#    updated 'sr@cyrillic' -> 'sr_CS.ISO8859-5' to 'sr_RS.UTF-8'
#    updated 'sr@latn' -> 'sr_CS.ISO8859-2' to 'sr_RS.UTF-8@latin'
#    updated 'sr_cs.utf8@latn' -> 'sr_CS.UTF-8' to 'sr_RS.UTF-8@latin'
#    updated 'sr_cs@latn' -> 'sr_CS.ISO8859-2' to 'sr_RS.UTF-8@latin'
#    updated 'sr_yu' -> 'sr_CS.ISO8859-5' to 'sr_RS.UTF-8@latin'
#    updated 'sr_yu.utf8@cyrillic' -> 'sr_CS.UTF-8' to 'sr_RS.UTF-8'
#    updated 'sr_yu@cyrillic' -> 'sr_CS.ISO8859-5' to 'sr_RS.UTF-8'
#
# SS 2013-12-20:
# Updated alias mapping to most recent locale.alias file
# from X.org distribution using makelocalealias.py.
#
# These are the differences compared to the old mapping (Python 3.3.3
# and older):
#
#    updated 'a3' -> 'a3_AZ.KOI8-C' to 'az_AZ.KOI8-C'
#    updated 'a3_az' -> 'a3_AZ.KOI8-C' to 'az_AZ.KOI8-C'
#    updated 'a3_az.koi8c' -> 'a3_AZ.KOI8-C' to 'az_AZ.KOI8-C'
#    updated 'cs_cs.iso88592' -> 'cs_CS.ISO8859-2' to 'cs_CZ.ISO8859-2'
#    updated 'hebrew' -> 'iw_IL.ISO8859-8' to 'he_IL.ISO8859-8'
#    updated 'hebrew.iso88598' -> 'iw_IL.ISO8859-8' to 'he_IL.ISO8859-8'
#    updated 'sd' -> 'sd_IN@devanagari.UTF-8' to 'sd_IN.UTF-8'
#    updated 'sr@latn' -> 'sr_RS.UTF-8@latin' to 'sr_CS.UTF-8@latin'
#    updated 'sr_cs' -> 'sr_RS.UTF-8' to 'sr_CS.UTF-8'
#    updated 'sr_cs.utf8@latn' -> 'sr_RS.UTF-8@latin' to 'sr_CS.UTF-8@latin'
#    updated 'sr_cs@latn' -> 'sr_RS.UTF-8@latin' to 'sr_CS.UTF-8@latin'
#
# SS 2014-10-01:
# Updated alias mapping with glibc 2.19 supported locales.
#
# SS 2018-05-05:
# Updated alias mapping with glibc 2.27 supported locales.
#
# These are the differences compared to the old mapping (Python 3.6.5
# and older):
#
#    updated 'ca_es@valencia' -> 'ca_ES.ISO8859-15@valencia' to 'ca_ES.UTF-8@valencia'
#    updated 'kk_kz' -> 'kk_KZ.RK1048' to 'kk_KZ.ptcp154'
#    updated 'russian' -> 'ru_RU.ISO8859-5' to 'ru_RU.KOI8-R'

locale_alias = {
    'a3':                                   'az_AZ.KOI8-C',
    'a3_az':                                'az_AZ.KOI8-C',
    'a3_az.koic':                           'az_AZ.KOI8-C',
    'aa_dj':                                'aa_DJ.ISO8859-1',
    'aa_er':                                'aa_ER.UTF-8',
    'aa_et':                                'aa_ET.UTF-8',
    'af':                                   'af_ZA.ISO8859-1',
    'af_za':                                'af_ZA.ISO8859-1',
    'agr_pe':                               'agr_PE.UTF-8',
    'ak_gh':                                'ak_GH.UTF-8',
    'am':                                   'am_ET.UTF-8',
    'am_et':                                'am_ET.UTF-8',
    'american':                             'en_US.ISO8859-1',
    'an_es':                                'an_ES.ISO8859-15',
    'anp_in':                               'anp_IN.UTF-8',
    'ar':                                   'ar_AA.ISO8859-6',
    'ar_aa':                                'ar_AA.ISO8859-6',
    'ar_ae':                                'ar_AE.ISO8859-6',
    'ar_bh':                                'ar_BH.ISO8859-6',
    'ar_dz':                                'ar_DZ.ISO8859-6',
    'ar_eg':                                'ar_EG.ISO8859-6',
    'ar_in':                                'ar_IN.UTF-8',
    'ar_iq':                                'ar_IQ.ISO8859-6',
    'ar_jo':                                'ar_JO.ISO8859-6',
    'ar_kw':                                'ar_KW.ISO8859-6',
    'ar_lb':                                'ar_LB.ISO8859-6',
    'ar_ly':                                'ar_LY.ISO8859-6',
    'ar_ma':                                'ar_MA.ISO8859-6',
    'ar_om':                                'ar_OM.ISO8859-6',
    'ar_qa':                                'ar_QA.ISO8859-6',
    'ar_sa':                                'ar_SA.ISO8859-6',
    'ar_sd':                                'ar_SD.ISO8859-6',
    'ar_ss':                                'ar_SS.UTF-8',
    'ar_sy':                                'ar_SY.ISO8859-6',
    'ar_tn':                                'ar_TN.ISO8859-6',
    'ar_ye':                                'ar_YE.ISO8859-6',
    'arabic':                               'ar_AA.ISO8859-6',
    'as':                                   'as_IN.UTF-8',
    'as_in':                                'as_IN.UTF-8',
    'ast_es':                               'ast_ES.ISO8859-15',
    'ayc_pe':                               'ayc_PE.UTF-8',
    'az':                                   'az_AZ.ISO8859-9E',
    'az_az':                                'az_AZ.ISO8859-9E',
    'az_az.iso88599e':                      'az_AZ.ISO8859-9E',
    'az_ir':                                'az_IR.UTF-8',
    'be':                                   'be_BY.CP1251',
    'be@latin':                             'be_BY.UTF-8@latin',
    'be_bg.utf8':                           'bg_BG.UTF-8',
    'be_by':                                'be_BY.CP1251',
    'be_by@latin':                          'be_BY.UTF-8@latin',
    'bem_zm':                               'bem_ZM.UTF-8',
    'ber_dz':                               'ber_DZ.UTF-8',
    'ber_ma':                               'ber_MA.UTF-8',
    'bg':                                   'bg_BG.CP1251',
    'bg_bg':                                'bg_BG.CP1251',
    'bhb_in.utf8':                          'bhb_IN.UTF-8',
    'bho_in':                               'bho_IN.UTF-8',
    'bho_np':                               'bho_NP.UTF-8',
    'bi_vu':                                'bi_VU.UTF-8',
    'bn_bd':                                'bn_BD.UTF-8',
    'bn_in':                                'bn_IN.UTF-8',
    'bo_cn':                                'bo_CN.UTF-8',
    'bo_in':                                'bo_IN.UTF-8',
    'bokmal':                               'nb_NO.ISO8859-1',
    'bokm\xe5l':                            'nb_NO.ISO8859-1',
    'br':                                   'br_FR.ISO8859-1',
    'br_fr':                                'br_FR.ISO8859-1',
    'brx_in':                               'brx_IN.UTF-8',
    'bs':                                   'bs_BA.ISO8859-2',
    'bs_ba':                                'bs_BA.ISO8859-2',
    'bulgarian':                            'bg_BG.CP1251',
    'byn_er':                               'byn_ER.UTF-8',
    'c':                                    'C',
    'c-french':                             'fr_CA.ISO8859-1',
    'c.ascii':                              'C',
    'c.en':                                 'C',
    'c.iso88591':                           'en_US.ISO8859-1',
    'c.utf8':                               'en_US.UTF-8',
    'c_c':                                  'C',
    'c_c.c':                                'C',
    'ca':                                   'ca_ES.ISO8859-1',
    'ca_ad':                                'ca_AD.ISO8859-1',
    'ca_es':                                'ca_ES.ISO8859-1',
    'ca_es@valencia':                       'ca_ES.UTF-8@valencia',
    'ca_fr':                                'ca_FR.ISO8859-1',
    'ca_it':                                'ca_IT.ISO8859-1',
    'catalan':                              'ca_ES.ISO8859-1',
    'ce_ru':                                'ce_RU.UTF-8',
    'cextend':                              'en_US.ISO8859-1',
    'chinese-s':                            'zh_CN.eucCN',
    'chinese-t':                            'zh_TW.eucTW',
    'chr_us':                               'chr_US.UTF-8',
    'ckb_iq':                               'ckb_IQ.UTF-8',
    'cmn_tw':                               'cmn_TW.UTF-8',
    'crh_ua':                               'crh_UA.UTF-8',
    'croatian':                             'hr_HR.ISO8859-2',
    'cs':                                   'cs_CZ.ISO8859-2',
    'cs_cs':                                'cs_CZ.ISO8859-2',
    'cs_cz':                                'cs_CZ.ISO8859-2',
    'csb_pl':                               'csb_PL.UTF-8',
    'cv_ru':                                'cv_RU.UTF-8',
    'cy':                                   'cy_GB.ISO8859-1',
    'cy_gb':                                'cy_GB.ISO8859-1',
    'cz':                                   'cs_CZ.ISO8859-2',
    'cz_cz':                                'cs_CZ.ISO8859-2',
    'czech':                                'cs_CZ.ISO8859-2',
    'da':                                   'da_DK.ISO8859-1',
    'da_dk':                                'da_DK.ISO8859-1',
    'danish':                               'da_DK.ISO8859-1',
    'dansk':                                'da_DK.ISO8859-1',
    'de':                                   'de_DE.ISO8859-1',
    'de_at':                                'de_AT.ISO8859-1',
    'de_be':                                'de_BE.ISO8859-1',
    'de_ch':                                'de_CH.ISO8859-1',
    'de_de':                                'de_DE.ISO8859-1',
    'de_it':                                'de_IT.ISO8859-1',
    'de_li.utf8':                           'de_LI.UTF-8',
    'de_lu':                                'de_LU.ISO8859-1',
    'deutsch':                              'de_DE.ISO8859-1',
    'doi_in':                               'doi_IN.UTF-8',
    'dutch':                                'nl_NL.ISO8859-1',
    'dutch.iso88591':                       'nl_BE.ISO8859-1',
    'dv_mv':                                'dv_MV.UTF-8',
    'dz_bt':                                'dz_BT.UTF-8',
    'ee':                                   'ee_EE.ISO8859-4',
    'ee_ee':                                'ee_EE.ISO8859-4',
    'eesti':                                'et_EE.ISO8859-1',
    'el':                                   'el_GR.ISO8859-7',
    'el_cy':                                'el_CY.ISO8859-7',
    'el_gr':                                'el_GR.ISO8859-7',
    'el_gr@euro':                           'el_GR.ISO8859-15',
    'en':                                   'en_US.ISO8859-1',
    'en_ag':                                'en_AG.UTF-8',
    'en_au':                                'en_AU.ISO8859-1',
    'en_be':                                'en_BE.ISO8859-1',
    'en_bw':                                'en_BW.ISO8859-1',
    'en_ca':                                'en_CA.ISO8859-1',
    'en_dk':                                'en_DK.ISO8859-1',
    'en_dl.utf8':                           'en_DL.UTF-8',
    'en_gb':                                'en_GB.ISO8859-1',
    'en_hk':                                'en_HK.ISO8859-1',
    'en_ie':                                'en_IE.ISO8859-1',
    'en_il':                                'en_IL.UTF-8',
    'en_in':                                'en_IN.ISO8859-1',
    'en_ng':                                'en_NG.UTF-8',
    'en_nz':                                'en_NZ.ISO8859-1',
    'en_ph':                                'en_PH.ISO8859-1',
    'en_sc.utf8':                           'en_SC.UTF-8',
    'en_sg':                                'en_SG.ISO8859-1',
    'en_uk':                                'en_GB.ISO8859-1',
    'en_us':                                'en_US.ISO8859-1',
    'en_us@euro@euro':                      'en_US.ISO8859-15',
    'en_za':                                'en_ZA.ISO8859-1',
    'en_zm':                                'en_ZM.UTF-8',
    'en_zw':                                'en_ZW.ISO8859-1',
    'en_zw.utf8':                           'en_ZS.UTF-8',
    'eng_gb':                               'en_GB.ISO8859-1',
    'english':                              'en_EN.ISO8859-1',
    'english.iso88591':                     'en_US.ISO8859-1',
    'english_uk':                           'en_GB.ISO8859-1',
    'english_united-states':                'en_US.ISO8859-1',
    'english_united-states.437':            'C',
    'english_us':                           'en_US.ISO8859-1',
    'eo':                                   'eo_XX.ISO8859-3',
    'eo.utf8':                              'eo.UTF-8',
    'eo_eo':                                'eo_EO.ISO8859-3',
    'eo_us.utf8':                           'eo_US.UTF-8',
    'eo_xx':                                'eo_XX.ISO8859-3',
    'es':                                   'es_ES.ISO8859-1',
    'es_ar':                                'es_AR.ISO8859-1',
    'es_bo':                                'es_BO.ISO8859-1',
    'es_cl':                                'es_CL.ISO8859-1',
    'es_co':                                'es_CO.ISO8859-1',
    'es_cr':                                'es_CR.ISO8859-1',
    'es_cu':                                'es_CU.UTF-8',
    'es_do':                                'es_DO.ISO8859-1',
    'es_ec':                                'es_EC.ISO8859-1',
    'es_es':                                'es_ES.ISO8859-1',
    'es_gt':                                'es_GT.ISO8859-1',
    'es_hn':                                'es_HN.ISO8859-1',
    'es_mx':                                'es_MX.ISO8859-1',
    'es_ni':                                'es_NI.ISO8859-1',
    'es_pa':                                'es_PA.ISO8859-1',
    'es_pe':                                'es_PE.ISO8859-1',
    'es_pr':                                'es_PR.ISO8859-1',
    'es_py':                                'es_PY.ISO8859-1',
    'es_sv':                                'es_SV.ISO8859-1',
    'es_us':                                'es_US.ISO8859-1',
    'es_uy':                                'es_UY.ISO8859-1',
    'es_ve':                                'es_VE.ISO8859-1',
    'estonian':                             'et_EE.ISO8859-1',
    'et':                                   'et_EE.ISO8859-15',
    'et_ee':                                'et_EE.ISO8859-15',
    'eu':                                   'eu_ES.ISO8859-1',
    'eu_es':                                'eu_ES.ISO8859-1',
    'eu_fr':                                'eu_FR.ISO8859-1',
    'fa':                                   'fa_IR.UTF-8',
    'fa_ir':                                'fa_IR.UTF-8',
    'fa_ir.isiri3342':                      'fa_IR.ISIRI-3342',
    'ff_sn':                                'ff_SN.UTF-8',
    'fi':                                   'fi_FI.ISO8859-15',
    'fi_fi':                                'fi_FI.ISO8859-15',
    'fil_ph':                               'fil_PH.UTF-8',
    'finnish':                              'fi_FI.ISO8859-1',
    'fo':                                   'fo_FO.ISO8859-1',
    'fo_fo':                                'fo_FO.ISO8859-1',
    'fr':                                   'fr_FR.ISO8859-1',
    'fr_be':                                'fr_BE.ISO8859-1',
    'fr_ca':                                'fr_CA.ISO8859-1',
    'fr_ch':                                'fr_CH.ISO8859-1',
    'fr_fr':                                'fr_FR.ISO8859-1',
    'fr_lu':                                'fr_LU.ISO8859-1',
    'fran\xe7ais':                          'fr_FR.ISO8859-1',
    'fre_fr':                               'fr_FR.ISO8859-1',
    'french':                               'fr_FR.ISO8859-1',
    'french.iso88591':                      'fr_CH.ISO8859-1',
    'french_france':                        'fr_FR.ISO8859-1',
    'fur_it':                               'fur_IT.UTF-8',
    'fy_de':                                'fy_DE.UTF-8',
    'fy_nl':                                'fy_NL.UTF-8',
    'ga':                                   'ga_IE.ISO8859-1',
    'ga_ie':                                'ga_IE.ISO8859-1',
    'galego':                               'gl_ES.ISO8859-1',
    'galician':                             'gl_ES.ISO8859-1',
    'gd':                                   'gd_GB.ISO8859-1',
    'gd_gb':                                'gd_GB.ISO8859-1',
    'ger_de':                               'de_DE.ISO8859-1',
    'german':                               'de_DE.ISO8859-1',
    'german.iso88591':                      'de_CH.ISO8859-1',
    'german_germany':                       'de_DE.ISO8859-1',
    'gez_er':                               'gez_ER.UTF-8',
    'gez_et':                               'gez_ET.UTF-8',
    'gl':                                   'gl_ES.ISO8859-1',
    'gl_es':                                'gl_ES.ISO8859-1',
    'greek':                                'el_GR.ISO8859-7',
    'gu_in':                                'gu_IN.UTF-8',
    'gv':                                   'gv_GB.ISO8859-1',
    'gv_gb':                                'gv_GB.ISO8859-1',
    'ha_ng':                                'ha_NG.UTF-8',
    'hak_tw':                               'hak_TW.UTF-8',
    'he':                                   'he_IL.ISO8859-8',
    'he_il':                                'he_IL.ISO8859-8',
    'hebrew':                               'he_IL.ISO8859-8',
    'hi':                                   'hi_IN.ISCII-DEV',
    'hi_in':                                'hi_IN.ISCII-DEV',
    'hi_in.isciidev':                       'hi_IN.ISCII-DEV',
    'hif_fj':                               'hif_FJ.UTF-8',
    'hne':                                  'hne_IN.UTF-8',
    'hne_in':                               'hne_IN.UTF-8',
    'hr':                                   'hr_HR.ISO8859-2',
    'hr_hr':                                'hr_HR.ISO8859-2',
    'hrvatski':                             'hr_HR.ISO8859-2',
    'hsb_de':                               'hsb_DE.ISO8859-2',
    'ht_ht':                                'ht_HT.UTF-8',
    'hu':                                   'hu_HU.ISO8859-2',
    'hu_hu':                                'hu_HU.ISO8859-2',
    'hungarian':                            'hu_HU.ISO8859-2',
    'hy_am':                                'hy_AM.UTF-8',
    'hy_am.armscii8':                       'hy_AM.ARMSCII_8',
    'ia':                                   'ia.UTF-8',
    'ia_fr':                                'ia_FR.UTF-8',
    'icelandic':                            'is_IS.ISO8859-1',
    'id':                                   'id_ID.ISO8859-1',
    'id_id':                                'id_ID.ISO8859-1',
    'ig_ng':                                'ig_NG.UTF-8',
    'ik_ca':                                'ik_CA.UTF-8',
    'in':                                   'id_ID.ISO8859-1',
    'in_id':                                'id_ID.ISO8859-1',
    'is':                                   'is_IS.ISO8859-1',
    'is_is':                                'is_IS.ISO8859-1',
    'iso-8859-1':                           'en_US.ISO8859-1',
    'iso-8859-15':                          'en_US.ISO8859-15',
    'iso8859-1':                            'en_US.ISO8859-1',
    'iso8859-15':                           'en_US.ISO8859-15',
    'iso_8859_1':                           'en_US.ISO8859-1',
    'iso_8859_15':                          'en_US.ISO8859-15',
    'it':                                   'it_IT.ISO8859-1',
    'it_ch':                                'it_CH.ISO8859-1',
    'it_it':                                'it_IT.ISO8859-1',
    'italian':                              'it_IT.ISO8859-1',
    'iu':                                   'iu_CA.NUNACOM-8',
    'iu_ca':                                'iu_CA.NUNACOM-8',
    'iu_ca.nunacom8':                       'iu_CA.NUNACOM-8',
    'iw':                                   'he_IL.ISO8859-8',
    'iw_il':                                'he_IL.ISO8859-8',
    'iw_il.utf8':                           'iw_IL.UTF-8',
    'ja':                                   'ja_JP.eucJP',
    'ja_jp':                                'ja_JP.eucJP',
    'ja_jp.euc':                            'ja_JP.eucJP',
    'ja_jp.mscode':                         'ja_JP.SJIS',
    'ja_jp.pck':                            'ja_JP.SJIS',
    'japan':                                'ja_JP.eucJP',
    'japanese':                             'ja_JP.eucJP',
    'japanese-euc':                         'ja_JP.eucJP',
    'japanese.euc':                         'ja_JP.eucJP',
    'jp_jp':                                'ja_JP.eucJP',
    'ka':                                   'ka_GE.GEORGIAN-ACADEMY',
    'ka_ge':                                'ka_GE.GEORGIAN-ACADEMY',
    'ka_ge.georgianacademy':                'ka_GE.GEORGIAN-ACADEMY',
    'ka_ge.georgianps':                     'ka_GE.GEORGIAN-PS',
    'ka_ge.georgianrs':                     'ka_GE.GEORGIAN-ACADEMY',
    'kab_dz':                               'kab_DZ.UTF-8',
    'kk_kz':                                'kk_KZ.ptcp154',
    'kl':                                   'kl_GL.ISO8859-1',
    'kl_gl':                                'kl_GL.ISO8859-1',
    'km_kh':                                'km_KH.UTF-8',
    'kn':                                   'kn_IN.UTF-8',
    'kn_in':                                'kn_IN.UTF-8',
    'ko':                                   'ko_KR.eucKR',
    'ko_kr':                                'ko_KR.eucKR',
    'ko_kr.euc':                            'ko_KR.eucKR',
    'kok_in':                               'kok_IN.UTF-8',
    'korean':                               'ko_KR.eucKR',
    'korean.euc':                           'ko_KR.eucKR',
    'ks':                                   'ks_IN.UTF-8',
    'ks_in':                                'ks_IN.UTF-8',
    'ks_in@devanagari.utf8':                'ks_IN.UTF-8@devanagari',
    'ku_tr':                                'ku_TR.ISO8859-9',
    'kw':                                   'kw_GB.ISO8859-1',
    'kw_gb':                                'kw_GB.ISO8859-1',
    'ky':                                   'ky_KG.UTF-8',
    'ky_kg':                                'ky_KG.UTF-8',
    'lb_lu':                                'lb_LU.UTF-8',
    'lg_ug':                                'lg_UG.ISO8859-10',
    'li_be':                                'li_BE.UTF-8',
    'li_nl':                                'li_NL.UTF-8',
    'lij_it':                               'lij_IT.UTF-8',
    'lithuanian':                           'lt_LT.ISO8859-13',
    'ln_cd':                                'ln_CD.UTF-8',
    'lo':                                   'lo_LA.MULELAO-1',
    'lo_la':                                'lo_LA.MULELAO-1',
    'lo_la.cp1133':                         'lo_LA.IBM-CP1133',
    'lo_la.ibmcp1133':                      'lo_LA.IBM-CP1133',
    'lo_la.mulelao1':                       'lo_LA.MULELAO-1',
    'lt':                                   'lt_LT.ISO8859-13',
    'lt_lt':                                'lt_LT.ISO8859-13',
    'lv':                                   'lv_LV.ISO8859-13',
    'lv_lv':                                'lv_LV.ISO8859-13',
    'lzh_tw':                               'lzh_TW.UTF-8',
    'mag_in':                               'mag_IN.UTF-8',
    'mai':                                  'mai_IN.UTF-8',
    'mai_in':                               'mai_IN.UTF-8',
    'mai_np':                               'mai_NP.UTF-8',
    'mfe_mu':                               'mfe_MU.UTF-8',
    'mg_mg':                                'mg_MG.ISO8859-15',
    'mhr_ru':                               'mhr_RU.UTF-8',
    'mi':                                   'mi_NZ.ISO8859-1',
    'mi_nz':                                'mi_NZ.ISO8859-1',
    'miq_ni':                               'miq_NI.UTF-8',
    'mjw_in':                               'mjw_IN.UTF-8',
    'mk':                                   'mk_MK.ISO8859-5',
    'mk_mk':                                'mk_MK.ISO8859-5',
    'ml':                                   'ml_IN.UTF-8',
    'ml_in':                                'ml_IN.UTF-8',
    'mn_mn':                                'mn_MN.UTF-8',
    'mni_in':                               'mni_IN.UTF-8',
    'mr':                                   'mr_IN.UTF-8',
    'mr_in':                                'mr_IN.UTF-8',
    'ms':                                   'ms_MY.ISO8859-1',
    'ms_my':                                'ms_MY.ISO8859-1',
    'mt':                                   'mt_MT.ISO8859-3',
    'mt_mt':                                'mt_MT.ISO8859-3',
    'my_mm':                                'my_MM.UTF-8',
    'nan_tw':                               'nan_TW.UTF-8',
    'nb':                                   'nb_NO.ISO8859-1',
    'nb_no':                                'nb_NO.ISO8859-1',
    'nds_de':                               'nds_DE.UTF-8',
    'nds_nl':                               'nds_NL.UTF-8',
    'ne_np':                                'ne_NP.UTF-8',
    'nhn_mx':                               'nhn_MX.UTF-8',
    'niu_nu':                               'niu_NU.UTF-8',
    'niu_nz':                               'niu_NZ.UTF-8',
    'nl':                                   'nl_NL.ISO8859-1',
    'nl_aw':                                'nl_AW.UTF-8',
    'nl_be':                                'nl_BE.ISO8859-1',
    'nl_nl':                                'nl_NL.ISO8859-1',
    'nn':                                   'nn_NO.ISO8859-1',
    'nn_no':                                'nn_NO.ISO8859-1',
    'no':                                   'no_NO.ISO8859-1',
    'no@nynorsk':                           'ny_NO.ISO8859-1',
    'no_no':                                'no_NO.ISO8859-1',
    'no_no.iso88591@bokmal':                'no_NO.ISO8859-1',
    'no_no.iso88591@nynorsk':               'no_NO.ISO8859-1',
    'norwegian':                            'no_NO.ISO8859-1',
    'nr':                                   'nr_ZA.ISO8859-1',
    'nr_za':                                'nr_ZA.ISO8859-1',
    'nso':                                  'nso_ZA.ISO8859-15',
    'nso_za':                               'nso_ZA.ISO8859-15',
    'ny':                                   'ny_NO.ISO8859-1',
    'ny_no':                                'ny_NO.ISO8859-1',
    'nynorsk':                              'nn_NO.ISO8859-1',
    'oc':                                   'oc_FR.ISO8859-1',
    'oc_fr':                                'oc_FR.ISO8859-1',
    'om_et':                                'om_ET.UTF-8',
    'om_ke':                                'om_KE.ISO8859-1',
    'or':                                   'or_IN.UTF-8',
    'or_in':                                'or_IN.UTF-8',
    'os_ru':                                'os_RU.UTF-8',
    'pa':                                   'pa_IN.UTF-8',
    'pa_in':                                'pa_IN.UTF-8',
    'pa_pk':                                'pa_PK.UTF-8',
    'pap_an':                               'pap_AN.UTF-8',
    'pap_aw':                               'pap_AW.UTF-8',
    'pap_cw':                               'pap_CW.UTF-8',
    'pd':                                   'pd_US.ISO8859-1',
    'pd_de':                                'pd_DE.ISO8859-1',
    'pd_us':                                'pd_US.ISO8859-1',
    'ph':                                   'ph_PH.ISO8859-1',
    'ph_ph':                                'ph_PH.ISO8859-1',
    'pl':                                   'pl_PL.ISO8859-2',
    'pl_pl':                                'pl_PL.ISO8859-2',
    'polish':                               'pl_PL.ISO8859-2',
    'portuguese':                           'pt_PT.ISO8859-1',
    'portuguese_brazil':                    'pt_BR.ISO8859-1',
    'posix':                                'C',
    'posix-utf2':                           'C',
    'pp':                                   'pp_AN.ISO8859-1',
    'pp_an':                                'pp_AN.ISO8859-1',
    'ps_af':                                'ps_AF.UTF-8',
    'pt':                                   'pt_PT.ISO8859-1',
    'pt_br':                                'pt_BR.ISO8859-1',
    'pt_pt':                                'pt_PT.ISO8859-1',
    'quz_pe':                               'quz_PE.UTF-8',
    'raj_in':                               'raj_IN.UTF-8',
    'ro':                                   'ro_RO.ISO8859-2',
    'ro_ro':                                'ro_RO.ISO8859-2',
    'romanian':                             'ro_RO.ISO8859-2',
    'ru':                                   'ru_RU.UTF-8',
    'ru_ru':                                'ru_RU.UTF-8',
    'ru_ua':                                'ru_UA.KOI8-U',
    'rumanian':                             'ro_RO.ISO8859-2',
    'russian':                              'ru_RU.KOI8-R',
    'rw':                                   'rw_RW.ISO8859-1',
    'rw_rw':                                'rw_RW.ISO8859-1',
    'sa_in':                                'sa_IN.UTF-8',
    'sat_in':                               'sat_IN.UTF-8',
    'sc_it':                                'sc_IT.UTF-8',
    'sd':                                   'sd_IN.UTF-8',
    'sd_in':                                'sd_IN.UTF-8',
    'sd_in@devanagari.utf8':                'sd_IN.UTF-8@devanagari',
    'sd_pk':                                'sd_PK.UTF-8',
    'se_no':                                'se_NO.UTF-8',
    'serbocroatian':                        'sr_RS.UTF-8@latin',
    'sgs_lt':                               'sgs_LT.UTF-8',
    'sh':                                   'sr_RS.UTF-8@latin',
    'sh_ba.iso88592@bosnia':                'sr_CS.ISO8859-2',
    'sh_hr':                                'sh_HR.ISO8859-2',
    'sh_hr.iso88592':                       'hr_HR.ISO8859-2',
    'sh_sp':                                'sr_CS.ISO8859-2',
    'sh_yu':                                'sr_RS.UTF-8@latin',
    'shn_mm':                               'shn_MM.UTF-8',
    'shs_ca':                               'shs_CA.UTF-8',
    'si':                                   'si_LK.UTF-8',
    'si_lk':                                'si_LK.UTF-8',
    'sid_et':                               'sid_ET.UTF-8',
    'sinhala':                              'si_LK.UTF-8',
    'sk':                                   'sk_SK.ISO8859-2',
    'sk_sk':                                'sk_SK.ISO8859-2',
    'sl':                                   'sl_SI.ISO8859-2',
    'sl_cs':                                'sl_CS.ISO8859-2',
    'sl_si':                                'sl_SI.ISO8859-2',
    'slovak':                               'sk_SK.ISO8859-2',
    'slovene':                              'sl_SI.ISO8859-2',
    'slovenian':                            'sl_SI.ISO8859-2',
    'sm_ws':                                'sm_WS.UTF-8',
    'so_dj':                                'so_DJ.ISO8859-1',
    'so_et':                                'so_ET.UTF-8',
    'so_ke':                                'so_KE.ISO8859-1',
    'so_so':                                'so_SO.ISO8859-1',
    'sp':                                   'sr_CS.ISO8859-5',
    'sp_yu':                                'sr_CS.ISO8859-5',
    'spanish':                              'es_ES.ISO8859-1',
    'spanish_spain':                        'es_ES.ISO8859-1',
    'sq':                                   'sq_AL.ISO8859-2',
    'sq_al':                                'sq_AL.ISO8859-2',
    'sq_mk':                                'sq_MK.UTF-8',
    'sr':                                   'sr_RS.UTF-8',
    'sr@cyrillic':                          'sr_RS.UTF-8',
    'sr@latn':                              'sr_CS.UTF-8@latin',
    'sr_cs':                                'sr_CS.UTF-8',
    'sr_cs.iso88592@latn':                  'sr_CS.ISO8859-2',
    'sr_cs@latn':                           'sr_CS.UTF-8@latin',
    'sr_me':                                'sr_ME.UTF-8',
    'sr_rs':                                'sr_RS.UTF-8',
    'sr_rs@latn':                           'sr_RS.UTF-8@latin',
    'sr_sp':                                'sr_CS.ISO8859-2',
    'sr_yu':                                'sr_RS.UTF-8@latin',
    'sr_yu.cp1251@cyrillic':                'sr_CS.CP1251',
    'sr_yu.iso88592':                       'sr_CS.ISO8859-2',
    'sr_yu.iso88595':                       'sr_CS.ISO8859-5',
    'sr_yu.iso88595@cyrillic':              'sr_CS.ISO8859-5',
    'sr_yu.microsoftcp1251@cyrillic':       'sr_CS.CP1251',
    'sr_yu.utf8':                           'sr_RS.UTF-8',
    'sr_yu.utf8@cyrillic':                  'sr_RS.UTF-8',
    'sr_yu@cyrillic':                       'sr_RS.UTF-8',
    'ss':                                   'ss_ZA.ISO8859-1',
    'ss_za':                                'ss_ZA.ISO8859-1',
    'st':                                   'st_ZA.ISO8859-1',
    'st_za':                                'st_ZA.ISO8859-1',
    'sv':                                   'sv_SE.ISO8859-1',
    'sv_fi':                                'sv_FI.ISO8859-1',
    'sv_se':                                'sv_SE.ISO8859-1',
    'sw_ke':                                'sw_KE.UTF-8',
    'sw_tz':                                'sw_TZ.UTF-8',
    'swedish':                              'sv_SE.ISO8859-1',
    'szl_pl':                               'szl_PL.UTF-8',
    'ta':                                   'ta_IN.TSCII-0',
    'ta_in':                                'ta_IN.TSCII-0',
    'ta_in.tscii':                          'ta_IN.TSCII-0',
    'ta_in.tscii0':                         'ta_IN.TSCII-0',
    'ta_lk':                                'ta_LK.UTF-8',
    'tcy_in.utf8':                          'tcy_IN.UTF-8',
    'te':                                   'te_IN.UTF-8',
    'te_in':                                'te_IN.UTF-8',
    'tg':                                   'tg_TJ.KOI8-C',
    'tg_tj':                                'tg_TJ.KOI8-C',
    'th':                                   'th_TH.ISO8859-11',
    'th_th':                                'th_TH.ISO8859-11',
    'th_th.tactis':                         'th_TH.TIS620',
    'th_th.tis620':                         'th_TH.TIS620',
    'thai':                                 'th_TH.ISO8859-11',
    'the_np':                               'the_NP.UTF-8',
    'ti_er':                                'ti_ER.UTF-8',
    'ti_et':                                'ti_ET.UTF-8',
    'tig_er':                               'tig_ER.UTF-8',
    'tk_tm':                                'tk_TM.UTF-8',
    'tl':                                   'tl_PH.ISO8859-1',
    'tl_ph':                                'tl_PH.ISO8859-1',
    'tn':                                   'tn_ZA.ISO8859-15',
    'tn_za':                                'tn_ZA.ISO8859-15',
    'to_to':                                'to_TO.UTF-8',
    'tpi_pg':                               'tpi_PG.UTF-8',
    'tr':                                   'tr_TR.ISO8859-9',
    'tr_cy':                                'tr_CY.ISO8859-9',
    'tr_tr':                                'tr_TR.ISO8859-9',
    'ts':                                   'ts_ZA.ISO8859-1',
    'ts_za':                                'ts_ZA.ISO8859-1',
    'tt':                                   'tt_RU.TATAR-CYR',
    'tt_ru':                                'tt_RU.TATAR-CYR',
    'tt_ru.tatarcyr':                       'tt_RU.TATAR-CYR',
    'tt_ru@iqtelif':                        'tt_RU.UTF-8@iqtelif',
    'turkish':                              'tr_TR.ISO8859-9',
    'ug_cn':                                'ug_CN.UTF-8',
    'uk':                                   'uk_UA.KOI8-U',
    'uk_ua':                                'uk_UA.KOI8-U',
    'univ':                                 'en_US.utf',
    'universal':                            'en_US.utf',
    'universal.utf8@ucs4':                  'en_US.UTF-8',
    'unm_us':                               'unm_US.UTF-8',
    'ur':                                   'ur_PK.CP1256',
    'ur_in':                                'ur_IN.UTF-8',
    'ur_pk':                                'ur_PK.CP1256',
    'uz':                                   'uz_UZ.UTF-8',
    'uz_uz':                                'uz_UZ.UTF-8',
    'uz_uz@cyrillic':                       'uz_UZ.UTF-8',
    've':                                   've_ZA.UTF-8',
    've_za':                                've_ZA.UTF-8',
    'vi':                                   'vi_VN.TCVN',
    'vi_vn':                                'vi_VN.TCVN',
    'vi_vn.tcvn':                           'vi_VN.TCVN',
    'vi_vn.tcvn5712':                       'vi_VN.TCVN',
    'vi_vn.viscii':                         'vi_VN.VISCII',
    'vi_vn.viscii111':                      'vi_VN.VISCII',
    'wa':                                   'wa_BE.ISO8859-1',
    'wa_be':                                'wa_BE.ISO8859-1',
    'wae_ch':                               'wae_CH.UTF-8',
    'wal_et':                               'wal_ET.UTF-8',
    'wo_sn':                                'wo_SN.UTF-8',
    'xh':                                   'xh_ZA.ISO8859-1',
    'xh_za':                                'xh_ZA.ISO8859-1',
    'yi':                                   'yi_US.CP1255',
    'yi_us':                                'yi_US.CP1255',
    'yo_ng':                                'yo_NG.UTF-8',
    'yue_hk':                               'yue_HK.UTF-8',
    'yuw_pg':                               'yuw_PG.UTF-8',
    'zh':                                   'zh_CN.eucCN',
    'zh_cn':                                'zh_CN.gb2312',
    'zh_cn.big5':                           'zh_TW.big5',
    'zh_cn.euc':                            'zh_CN.eucCN',
    'zh_hk':                                'zh_HK.big5hkscs',
    'zh_hk.big5hk':                         'zh_HK.big5hkscs',
    'zh_sg':                                'zh_SG.GB2312',
    'zh_sg.gbk':                            'zh_SG.GBK',
    'zh_tw':                                'zh_TW.big5',
    'zh_tw.euc':                            'zh_TW.eucTW',
    'zh_tw.euctw':                          'zh_TW.eucTW',
    'zu':                                   'zu_ZA.ISO8859-1',
    'zu_za':                                'zu_ZA.ISO8859-1',
}

#
# This maps Windows language identifiers to locale strings.
#
# This list has been updated from
# http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/nls_238z.asp
# to include every locale up to Windows Vista.
#
# NOTE: this mapping is incomplete.  If your language is missing, please
# submit a bug report to the Python bug tracker at http://bugs.python.org/
# Make sure you include the missing language identifier and the suggested
# locale code.
#

windows_locale = {
    0x0436: "af_ZA", # Afrikaans
    0x041c: "sq_AL", # Albanian
    0x0484: "gsw_FR",# Alsatian - France
    0x045e: "am_ET", # Amharic - Ethiopia
    0x0401: "ar_SA", # Arabic - Saudi Arabia
    0x0801: "ar_IQ", # Arabic - Iraq
    0x0c01: "ar_EG", # Arabic - Egypt
    0x1001: "ar_LY", # Arabic - Libya
    0x1401: "ar_DZ", # Arabic - Algeria
    0x1801: "ar_MA", # Arabic - Morocco
    0x1c01: "ar_TN", # Arabic - Tunisia
    0x2001: "ar_OM", # Arabic - Oman
    0x2401: "ar_YE", # Arabic - Yemen
    0x2801: "ar_SY", # Arabic - Syria
    0x2c01: "ar_JO", # Arabic - Jordan
    0x3001: "ar_LB", # Arabic - Lebanon
    0x3401: "ar_KW", # Arabic - Kuwait
    0x3801: "ar_AE", # Arabic - United Arab Emirates
    0x3c01: "ar_BH", # Arabic - Bahrain
    0x4001: "ar_QA", # Arabic - Qatar
    0x042b: "hy_AM", # Armenian
    0x044d: "as_IN", # Assamese - India
    0x042c: "az_AZ", # Azeri - Latin
    0x082c: "az_AZ", # Azeri - Cyrillic
    0x046d: "ba_RU", # Bashkir
    0x042d: "eu_ES", # Basque - Russia
    0x0423: "be_BY", # Belarusian
    0x0445: "bn_IN", # Begali
    0x201a: "bs_BA", # Bosnian - Cyrillic
    0x141a: "bs_BA", # Bosnian - Latin
    0x047e: "br_FR", # Breton - France
    0x0402: "bg_BG", # Bulgarian
#    0x0455: "my_MM", # Burmese - Not supported
    0x0403: "ca_ES", # Catalan
    0x0004: "zh_CHS",# Chinese - Simplified
    0x0404: "zh_TW", # Chinese - Taiwan
    0x0804: "zh_CN", # Chinese - PRC
    0x0c04: "zh_HK", # Chinese - Hong Kong S.A.R.
    0x1004: "zh_SG", # Chinese - Singapore
    0x1404: "zh_MO", # Chinese - Macao S.A.R.
    0x7c04: "zh_CHT",# Chinese - Traditional
    0x0483: "co_FR", # Corsican - France
    0x041a: "hr_HR", # Croatian
    0x101a: "hr_BA", # Croatian - Bosnia
    0x0405: "cs_CZ", # Czech
    0x0406: "da_DK", # Danish
    0x048c: "gbz_AF",# Dari - Afghanistan
    0x0465: "div_MV",# Divehi - Maldives
    0x0413: "nl_NL", # Dutch - The Netherlands
    0x0813: "nl_BE", # Dutch - Belgium
    0x0409: "en_US", # English - United States
    0x0809: "en_GB", # English - United Kingdom
    0x0c09: "en_AU", # English - Australia
    0x1009: "en_CA", # English - Canada
    0x1409: "en_NZ", # English - New Zealand
    0x1809: "en_IE", # English - Ireland
    0x1c09: "en_ZA", # English - South Africa
    0x2009: "en_JA", # English - Jamaica
    0x2409: "en_CB", # English - Caribbean
    0x2809: "en_BZ", # English - Belize
    0x2c09: "en_TT", # English - Trinidad
    0x3009: "en_ZW", # English - Zimbabwe
    0x3409: "en_PH", # English - Philippines
    0x4009: "en_IN", # English - India
    0x4409: "en_MY", # English - Malaysia
    0x4809: "en_IN", # English - Singapore
    0x0425: "et_EE", # Estonian
    0x0438: "fo_FO", # Faroese
    0x0464: "fil_PH",# Filipino
    0x040b: "fi_FI", # Finnish
    0x040c: "fr_FR", # French - France
    0x080c: "fr_BE", # French - Belgium
    0x0c0c: "fr_CA", # French - Canada
    0x100c: "fr_CH", # French - Switzerland
    0x140c: "fr_LU", # French - Luxembourg
    0x180c: "fr_MC", # French - Monaco
    0x0462: "fy_NL", # Frisian - Netherlands
    0x0456: "gl_ES", # Galician
    0x0437: "ka_GE", # Georgian
    0x0407: "de_DE", # German - Germany
    0x0807: "de_CH", # German - Switzerland
    0x0c07: "de_AT", # German - Austria
    0x1007: "de_LU", # German - Luxembourg
    0x1407: "de_LI", # German - Liechtenstein
    0x0408: "el_GR", # Greek
    0x046f: "kl_GL", # Greenlandic - Greenland
    0x0447: "gu_IN", # Gujarati
    0x0468: "ha_NG", # Hausa - Latin
    0x040d: "he_IL", # Hebrew
    0x0439: "hi_IN", # Hindi
    0x040e: "hu_HU", # Hungarian
    0x040f: "is_IS", # Icelandic
    0x0421: "id_ID", # Indonesian
    0x045d: "iu_CA", # Inuktitut - Syllabics
    0x085d: "iu_CA", # Inuktitut - Latin
    0x083c: "ga_IE", # Irish - Ireland
    0x0410: "it_IT", # Italian - Italy
    0x0810: "it_CH", # Italian - Switzerland
    0x0411: "ja_JP", # Japanese
    0x044b: "kn_IN", # Kannada - India
    0x043f: "kk_KZ", # Kazakh
    0x0453: "kh_KH", # Khmer - Cambodia
    0x0486: "qut_GT",# K'iche - Guatemala
    0x0487: "rw_RW", # Kinyarwanda - Rwanda
    0x0457: "kok_IN",# Konkani
    0x0412: "ko_KR", # Korean
    0x0440: "ky_KG", # Kyrgyz
    0x0454: "lo_LA", # Lao - Lao PDR
    0x0426: "lv_LV", # Latvian
    0x0427: "lt_LT", # Lithuanian
    0x082e: "dsb_DE",# Lower Sorbian - Germany
    0x046e: "lb_LU", # Luxembourgish
    0x042f: "mk_MK", # FYROM Macedonian
    0x043e: "ms_MY", # Malay - Malaysia
    0x083e: "ms_BN", # Malay - Brunei Darussalam
    0x044c: "ml_IN", # Malayalam - India
    0x043a: "mt_MT", # Maltese
    0x0481: "mi_NZ", # Maori
    0x047a: "arn_CL",# Mapudungun
    0x044e: "mr_IN", # Marathi
    0x047c: "moh_CA",# Mohawk - Canada
    0x0450: "mn_MN", # Mongolian - Cyrillic
    0x0850: "mn_CN", # Mongolian - PRC
    0x0461: "ne_NP", # Nepali
    0x0414: "nb_NO", # Norwegian - Bokmal
    0x0814: "nn_NO", # Norwegian - Nynorsk
    0x0482: "oc_FR", # Occitan - France
    0x0448: "or_IN", # Oriya - India
    0x0463: "ps_AF", # Pashto - Afghanistan
    0x0429: "fa_IR", # Persian
    0x0415: "pl_PL", # Polish
    0x0416: "pt_BR", # Portuguese - Brazil
    0x0816: "pt_PT", # Portuguese - Portugal
    0x0446: "pa_IN", # Punjabi
    0x046b: "quz_BO",# Quechua (Bolivia)
    0x086b: "quz_EC",# Quechua (Ecuador)
    0x0c6b: "quz_PE",# Quechua (Peru)
    0x0418: "ro_RO", # Romanian - Romania
    0x0417: "rm_CH", # Romansh
    0x0419: "ru_RU", # Russian
    0x243b: "smn_FI",# Sami Finland
    0x103b: "smj_NO",# Sami Norway
    0x143b: "smj_SE",# Sami Sweden
    0x043b: "se_NO", # Sami Northern Norway
    0x083b: "se_SE", # Sami Northern Sweden
    0x0c3b: "se_FI", # Sami Northern Finland
    0x203b: "sms_FI",# Sami Skolt
    0x183b: "sma_NO",# Sami Southern Norway
    0x1c3b: "sma_SE",# Sami Southern Sweden
    0x044f: "sa_IN", # Sanskrit
    0x0c1a: "sr_SP", # Serbian - Cyrillic
    0x1c1a: "sr_BA", # Serbian - Bosnia Cyrillic
    0x081a: "sr_SP", # Serbian - Latin
    0x181a: "sr_BA", # Serbian - Bosnia Latin
    0x045b: "si_LK", # Sinhala - Sri Lanka
    0x046c: "ns_ZA", # Northern Sotho
    0x0432: "tn_ZA", # Setswana - Southern Africa
    0x041b: "sk_SK", # Slovak
    0x0424: "sl_SI", # Slovenian
    0x040a: "es_ES", # Spanish - Spain
    0x080a: "es_MX", # Spanish - Mexico
    0x0c0a: "es_ES", # Spanish - Spain (Modern)
    0x100a: "es_GT", # Spanish - Guatemala
    0x140a: "es_CR", # Spanish - Costa Rica
    0x180a: "es_PA", # Spanish - Panama
    0x1c0a: "es_DO", # Spanish - Dominican Republic
    0x200a: "es_VE", # Spanish - Venezuela
    0x240a: "es_CO", # Spanish - Colombia
    0x280a: "es_PE", # Spanish - Peru
    0x2c0a: "es_AR", # Spanish - Argentina
    0x300a: "es_EC", # Spanish - Ecuador
    0x340a: "es_CL", # Spanish - Chile
    0x380a: "es_UR", # Spanish - Uruguay
    0x3c0a: "es_PY", # Spanish - Paraguay
    0x400a: "es_BO", # Spanish - Bolivia
    0x440a: "es_SV", # Spanish - El Salvador
    0x480a: "es_HN", # Spanish - Honduras
    0x4c0a: "es_NI", # Spanish - Nicaragua
    0x500a: "es_PR", # Spanish - Puerto Rico
    0x540a: "es_US", # Spanish - United States
#    0x0430: "", # Sutu - Not supported
    0x0441: "sw_KE", # Swahili
    0x041d: "sv_SE", # Swedish - Sweden
    0x081d: "sv_FI", # Swedish - Finland
    0x045a: "syr_SY",# Syriac
    0x0428: "tg_TJ", # Tajik - Cyrillic
    0x085f: "tmz_DZ",# Tamazight - Latin
    0x0449: "ta_IN", # Tamil
    0x0444: "tt_RU", # Tatar
    0x044a: "te_IN", # Telugu
    0x041e: "th_TH", # Thai
    0x0851: "bo_BT", # Tibetan - Bhutan
    0x0451: "bo_CN", # Tibetan - PRC
    0x041f: "tr_TR", # Turkish
    0x0442: "tk_TM", # Turkmen - Cyrillic
    0x0480: "ug_CN", # Uighur - Arabic
    0x0422: "uk_UA", # Ukrainian
    0x042e: "wen_DE",# Upper Sorbian - Germany
    0x0420: "ur_PK", # Urdu
    0x0820: "ur_IN", # Urdu - India
    0x0443: "uz_UZ", # Uzbek - Latin
    0x0843: "uz_UZ", # Uzbek - Cyrillic
    0x042a: "vi_VN", # Vietnamese
    0x0452: "cy_GB", # Welsh
    0x0488: "wo_SN", # Wolof - Senegal
    0x0434: "xh_ZA", # Xhosa - South Africa
    0x0485: "sah_RU",# Yakut - Cyrillic
    0x0478: "ii_CN", # Yi - PRC
    0x046a: "yo_NG", # Yoruba - Nigeria
    0x0435: "zu_ZA", # Zulu
}

def _print_locale():

    """ Test function.
    """
    categories = {}
    def _init_categories(categories=categories):
        for k,v in globals().items():
            if k[:3] == 'LC_':
                categories[k] = v
    _init_categories()
    del categories['LC_ALL']

    print('Locale defaults as determined by getdefaultlocale():')
    print('-'*72)
    lang, enc = getdefaultlocale()
    print('Language: ', lang or '(undefined)')
    print('Encoding: ', enc or '(undefined)')
    print()

    print('Locale settings on startup:')
    print('-'*72)
    for name,category in categories.items():
        print(name, '...')
        lang, enc = getlocale(category)
        print('   Language: ', lang or '(undefined)')
        print('   Encoding: ', enc or '(undefined)')
        print()

    print()
    print('Locale settings after calling resetlocale():')
    print('-'*72)
    resetlocale()
    for name,category in categories.items():
        print(name, '...')
        lang, enc = getlocale(category)
        print('   Language: ', lang or '(undefined)')
        print('   Encoding: ', enc or '(undefined)')
        print()

    try:
        setlocale(LC_ALL, "")
    except:
        print('NOTE:')
        print('setlocale(LC_ALL, "") does not support the default locale')
        print('given in the OS environment variables.')
    else:
        print()
        print('Locale settings after calling setlocale(LC_ALL, ""):')
        print('-'*72)
        for name,category in categories.items():
            print(name, '...')
            lang, enc = getlocale(category)
            print('   Language: ', lang or '(undefined)')
            print('   Encoding: ', enc or '(undefined)')
            print()

###

try:
    LC_MESSAGES
except NameError:
    pass
else:
    __all__.append("LC_MESSAGES")

if __name__=='__main__':
    print('Locale aliasing:')
    print()
    _print_locale()
    print()
    print('Number formatting:')
    print()
    _test()
tabnanny.py000075500000026216151153537450006753 0ustar00#! /usr/bin/python3.8

"""The Tab Nanny despises ambiguous indentation.  She knows no mercy.

tabnanny -- Detection of ambiguous indentation

For the time being this module is intended to be called as a script.
However it is possible to import it into an IDE and use the function
check() described below.

Warning: The API provided by this module is likely to change in future
releases; such changes may not be backward compatible.
"""

# Released to the public domain, by Tim Peters, 15 April 1998.

# XXX Note: this is now a standard library module.
# XXX The API needs to undergo changes however; the current code is too
# XXX script-like.  This will be addressed later.

__version__ = "6"

import os
import sys
import tokenize
if not hasattr(tokenize, 'NL'):
    raise ValueError("tokenize.NL doesn't exist -- tokenize module too old")

__all__ = ["check", "NannyNag", "process_tokens"]

verbose = 0
filename_only = 0

def errprint(*args):
    sep = ""
    for arg in args:
        sys.stderr.write(sep + str(arg))
        sep = " "
    sys.stderr.write("\n")

def main():
    import getopt

    global verbose, filename_only
    try:
        opts, args = getopt.getopt(sys.argv[1:], "qv")
    except getopt.error as msg:
        errprint(msg)
        return
    for o, a in opts:
        if o == '-q':
            filename_only = filename_only + 1
        if o == '-v':
            verbose = verbose + 1
    if not args:
        errprint("Usage:", sys.argv[0], "[-v] file_or_directory ...")
        return
    for arg in args:
        check(arg)

class NannyNag(Exception):
    """
    Raised by process_tokens() if detecting an ambiguous indent.
    Captured and handled in check().
    """
    def __init__(self, lineno, msg, line):
        self.lineno, self.msg, self.line = lineno, msg, line
    def get_lineno(self):
        return self.lineno
    def get_msg(self):
        return self.msg
    def get_line(self):
        return self.line

def check(file):
    """check(file_or_dir)

    If file_or_dir is a directory and not a symbolic link, then recursively
    descend the directory tree named by file_or_dir, checking all .py files
    along the way. If file_or_dir is an ordinary Python source file, it is
    checked for whitespace related problems. The diagnostic messages are
    written to standard output using the print statement.
    """

    if os.path.isdir(file) and not os.path.islink(file):
        if verbose:
            print("%r: listing directory" % (file,))
        names = os.listdir(file)
        for name in names:
            fullname = os.path.join(file, name)
            if (os.path.isdir(fullname) and
                not os.path.islink(fullname) or
                os.path.normcase(name[-3:]) == ".py"):
                check(fullname)
        return

    try:
        f = tokenize.open(file)
    except OSError as msg:
        errprint("%r: I/O Error: %s" % (file, msg))
        return

    if verbose > 1:
        print("checking %r ..." % file)

    try:
        process_tokens(tokenize.generate_tokens(f.readline))

    except tokenize.TokenError as msg:
        errprint("%r: Token Error: %s" % (file, msg))
        return

    except IndentationError as msg:
        errprint("%r: Indentation Error: %s" % (file, msg))
        return

    except NannyNag as nag:
        badline = nag.get_lineno()
        line = nag.get_line()
        if verbose:
            print("%r: *** Line %d: trouble in tab city! ***" % (file, badline))
            print("offending line: %r" % (line,))
            print(nag.get_msg())
        else:
            if ' ' in file: file = '"' + file + '"'
            if filename_only: print(file)
            else: print(file, badline, repr(line))
        return

    finally:
        f.close()

    if verbose:
        print("%r: Clean bill of health." % (file,))

class Whitespace:
    # the characters used for space and tab
    S, T = ' \t'

    # members:
    #   raw
    #       the original string
    #   n
    #       the number of leading whitespace characters in raw
    #   nt
    #       the number of tabs in raw[:n]
    #   norm
    #       the normal form as a pair (count, trailing), where:
    #       count
    #           a tuple such that raw[:n] contains count[i]
    #           instances of S * i + T
    #       trailing
    #           the number of trailing spaces in raw[:n]
    #       It's A Theorem that m.indent_level(t) ==
    #       n.indent_level(t) for all t >= 1 iff m.norm == n.norm.
    #   is_simple
    #       true iff raw[:n] is of the form (T*)(S*)

    def __init__(self, ws):
        self.raw  = ws
        S, T = Whitespace.S, Whitespace.T
        count = []
        b = n = nt = 0
        for ch in self.raw:
            if ch == S:
                n = n + 1
                b = b + 1
            elif ch == T:
                n = n + 1
                nt = nt + 1
                if b >= len(count):
                    count = count + [0] * (b - len(count) + 1)
                count[b] = count[b] + 1
                b = 0
            else:
                break
        self.n    = n
        self.nt   = nt
        self.norm = tuple(count), b
        self.is_simple = len(count) <= 1

    # return length of longest contiguous run of spaces (whether or not
    # preceding a tab)
    def longest_run_of_spaces(self):
        count, trailing = self.norm
        return max(len(count)-1, trailing)

    def indent_level(self, tabsize):
        # count, il = self.norm
        # for i in range(len(count)):
        #    if count[i]:
        #        il = il + (i//tabsize + 1)*tabsize * count[i]
        # return il

        # quicker:
        # il = trailing + sum (i//ts + 1)*ts*count[i] =
        # trailing + ts * sum (i//ts + 1)*count[i] =
        # trailing + ts * sum i//ts*count[i] + count[i] =
        # trailing + ts * [(sum i//ts*count[i]) + (sum count[i])] =
        # trailing + ts * [(sum i//ts*count[i]) + num_tabs]
        # and note that i//ts*count[i] is 0 when i < ts

        count, trailing = self.norm
        il = 0
        for i in range(tabsize, len(count)):
            il = il + i//tabsize * count[i]
        return trailing + tabsize * (il + self.nt)

    # return true iff self.indent_level(t) == other.indent_level(t)
    # for all t >= 1
    def equal(self, other):
        return self.norm == other.norm

    # return a list of tuples (ts, i1, i2) such that
    # i1 == self.indent_level(ts) != other.indent_level(ts) == i2.
    # Intended to be used after not self.equal(other) is known, in which
    # case it will return at least one witnessing tab size.
    def not_equal_witness(self, other):
        n = max(self.longest_run_of_spaces(),
                other.longest_run_of_spaces()) + 1
        a = []
        for ts in range(1, n+1):
            if self.indent_level(ts) != other.indent_level(ts):
                a.append( (ts,
                           self.indent_level(ts),
                           other.indent_level(ts)) )
        return a

    # Return True iff self.indent_level(t) < other.indent_level(t)
    # for all t >= 1.
    # The algorithm is due to Vincent Broman.
    # Easy to prove it's correct.
    # XXXpost that.
    # Trivial to prove n is sharp (consider T vs ST).
    # Unknown whether there's a faster general way.  I suspected so at
    # first, but no longer.
    # For the special (but common!) case where M and N are both of the
    # form (T*)(S*), M.less(N) iff M.len() < N.len() and
    # M.num_tabs() <= N.num_tabs(). Proof is easy but kinda long-winded.
    # XXXwrite that up.
    # Note that M is of the form (T*)(S*) iff len(M.norm[0]) <= 1.
    def less(self, other):
        if self.n >= other.n:
            return False
        if self.is_simple and other.is_simple:
            return self.nt <= other.nt
        n = max(self.longest_run_of_spaces(),
                other.longest_run_of_spaces()) + 1
        # the self.n >= other.n test already did it for ts=1
        for ts in range(2, n+1):
            if self.indent_level(ts) >= other.indent_level(ts):
                return False
        return True

    # return a list of tuples (ts, i1, i2) such that
    # i1 == self.indent_level(ts) >= other.indent_level(ts) == i2.
    # Intended to be used after not self.less(other) is known, in which
    # case it will return at least one witnessing tab size.
    def not_less_witness(self, other):
        n = max(self.longest_run_of_spaces(),
                other.longest_run_of_spaces()) + 1
        a = []
        for ts in range(1, n+1):
            if self.indent_level(ts) >= other.indent_level(ts):
                a.append( (ts,
                           self.indent_level(ts),
                           other.indent_level(ts)) )
        return a

def format_witnesses(w):
    firsts = (str(tup[0]) for tup in w)
    prefix = "at tab size"
    if len(w) > 1:
        prefix = prefix + "s"
    return prefix + " " + ', '.join(firsts)

def process_tokens(tokens):
    INDENT = tokenize.INDENT
    DEDENT = tokenize.DEDENT
    NEWLINE = tokenize.NEWLINE
    JUNK = tokenize.COMMENT, tokenize.NL
    indents = [Whitespace("")]
    check_equal = 0

    for (type, token, start, end, line) in tokens:
        if type == NEWLINE:
            # a program statement, or ENDMARKER, will eventually follow,
            # after some (possibly empty) run of tokens of the form
            #     (NL | COMMENT)* (INDENT | DEDENT+)?
            # If an INDENT appears, setting check_equal is wrong, and will
            # be undone when we see the INDENT.
            check_equal = 1

        elif type == INDENT:
            check_equal = 0
            thisguy = Whitespace(token)
            if not indents[-1].less(thisguy):
                witness = indents[-1].not_less_witness(thisguy)
                msg = "indent not greater e.g. " + format_witnesses(witness)
                raise NannyNag(start[0], msg, line)
            indents.append(thisguy)

        elif type == DEDENT:
            # there's nothing we need to check here!  what's important is
            # that when the run of DEDENTs ends, the indentation of the
            # program statement (or ENDMARKER) that triggered the run is
            # equal to what's left at the top of the indents stack

            # Ouch!  This assert triggers if the last line of the source
            # is indented *and* lacks a newline -- then DEDENTs pop out
            # of thin air.
            # assert check_equal  # else no earlier NEWLINE, or an earlier INDENT
            check_equal = 1

            del indents[-1]

        elif check_equal and type not in JUNK:
            # this is the first "real token" following a NEWLINE, so it
            # must be the first token of the next program statement, or an
            # ENDMARKER; the "line" argument exposes the leading whitespace
            # for this statement; in the case of ENDMARKER, line is an empty
            # string, so will properly match the empty string with which the
            # "indents" stack was seeded
            check_equal = 0
            thisguy = Whitespace(line)
            if not indents[-1].equal(thisguy):
                witness = indents[-1].not_equal_witness(thisguy)
                msg = "indent not equal e.g. " + format_witnesses(witness)
                raise NannyNag(start[0], msg, line)


if __name__ == '__main__':
    main()
io.py000064400000006725151153537450005550 0ustar00"""The io module provides the Python interfaces to stream handling. The
builtin open function is defined in this module.

At the top of the I/O hierarchy is the abstract base class IOBase. It
defines the basic interface to a stream. Note, however, that there is no
separation between reading and writing to streams; implementations are
allowed to raise an OSError if they do not support a given operation.

Extending IOBase is RawIOBase which deals simply with the reading and
writing of raw bytes to a stream. FileIO subclasses RawIOBase to provide
an interface to OS files.

BufferedIOBase deals with buffering on a raw byte stream (RawIOBase). Its
subclasses, BufferedWriter, BufferedReader, and BufferedRWPair buffer
streams that are readable, writable, and both respectively.
BufferedRandom provides a buffered interface to random access
streams. BytesIO is a simple stream of in-memory bytes.

Another IOBase subclass, TextIOBase, deals with the encoding and decoding
of streams into text. TextIOWrapper, which extends it, is a buffered text
interface to a buffered raw stream (`BufferedIOBase`). Finally, StringIO
is an in-memory stream for text.

Argument names are not part of the specification, and only the arguments
of open() are intended to be used as keyword arguments.

data:

DEFAULT_BUFFER_SIZE

   An int containing the default buffer size used by the module's buffered
   I/O classes. open() uses the file's blksize (as obtained by os.stat) if
   possible.
"""
# New I/O library conforming to PEP 3116.

__author__ = ("Guido van Rossum <guido@python.org>, "
              "Mike Verdone <mike.verdone@gmail.com>, "
              "Mark Russell <mark.russell@zen.co.uk>, "
              "Antoine Pitrou <solipsis@pitrou.net>, "
              "Amaury Forgeot d'Arc <amauryfa@gmail.com>, "
              "Benjamin Peterson <benjamin@python.org>")

__all__ = ["BlockingIOError", "open", "open_code", "IOBase", "RawIOBase",
           "FileIO", "BytesIO", "StringIO", "BufferedIOBase",
           "BufferedReader", "BufferedWriter", "BufferedRWPair",
           "BufferedRandom", "TextIOBase", "TextIOWrapper",
           "UnsupportedOperation", "SEEK_SET", "SEEK_CUR", "SEEK_END"]


import _io
import abc

from _io import (DEFAULT_BUFFER_SIZE, BlockingIOError, UnsupportedOperation,
                 open, open_code, FileIO, BytesIO, StringIO, BufferedReader,
                 BufferedWriter, BufferedRWPair, BufferedRandom,
                 IncrementalNewlineDecoder, TextIOWrapper)

OpenWrapper = _io.open # for compatibility with _pyio

# Pretend this exception was created here.
UnsupportedOperation.__module__ = "io"

# for seek()
SEEK_SET = 0
SEEK_CUR = 1
SEEK_END = 2

# Declaring ABCs in C is tricky so we do it here.
# Method descriptions and default implementations are inherited from the C
# version however.
class IOBase(_io._IOBase, metaclass=abc.ABCMeta):
    __doc__ = _io._IOBase.__doc__

class RawIOBase(_io._RawIOBase, IOBase):
    __doc__ = _io._RawIOBase.__doc__

class BufferedIOBase(_io._BufferedIOBase, IOBase):
    __doc__ = _io._BufferedIOBase.__doc__

class TextIOBase(_io._TextIOBase, IOBase):
    __doc__ = _io._TextIOBase.__doc__

RawIOBase.register(FileIO)

for klass in (BytesIO, BufferedReader, BufferedWriter, BufferedRandom,
              BufferedRWPair):
    BufferedIOBase.register(klass)

for klass in (StringIO, TextIOWrapper):
    TextIOBase.register(klass)
del klass

try:
    from _io import _WindowsConsoleIO
except ImportError:
    pass
else:
    RawIOBase.register(_WindowsConsoleIO)
logging/config.py000064400000107005151153537450010025 0ustar00# Copyright 2001-2019 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permission notice appear in
# supporting documentation, and that the name of Vinay Sajip
# not be used in advertising or publicity pertaining to distribution
# of the software without specific, written prior permission.
# VINAY SAJIP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
# ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
# VINAY SAJIP BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
# ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
# IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

"""
Configuration functions for the logging package for Python. The core package
is based on PEP 282 and comments thereto in comp.lang.python, and influenced
by Apache's log4j system.

Copyright (C) 2001-2019 Vinay Sajip. All Rights Reserved.

To use, simply 'import logging' and log away!
"""

import errno
import io
import logging
import logging.handlers
import re
import struct
import sys
import threading
import traceback

from socketserver import ThreadingTCPServer, StreamRequestHandler


DEFAULT_LOGGING_CONFIG_PORT = 9030

RESET_ERROR = errno.ECONNRESET

#
#   The following code implements a socket listener for on-the-fly
#   reconfiguration of logging.
#
#   _listener holds the server object doing the listening
_listener = None

def fileConfig(fname, defaults=None, disable_existing_loggers=True):
    """
    Read the logging configuration from a ConfigParser-format file.

    This can be called several times from an application, allowing an end user
    the ability to select from various pre-canned configurations (if the
    developer provides a mechanism to present the choices and load the chosen
    configuration).
    """
    import configparser

    if isinstance(fname, configparser.RawConfigParser):
        cp = fname
    else:
        cp = configparser.ConfigParser(defaults)
        if hasattr(fname, 'readline'):
            cp.read_file(fname)
        else:
            cp.read(fname)

    formatters = _create_formatters(cp)

    # critical section
    logging._acquireLock()
    try:
        _clearExistingHandlers()

        # Handlers add themselves to logging._handlers
        handlers = _install_handlers(cp, formatters)
        _install_loggers(cp, handlers, disable_existing_loggers)
    finally:
        logging._releaseLock()


def _resolve(name):
    """Resolve a dotted name to a global object."""
    name = name.split('.')
    used = name.pop(0)
    found = __import__(used)
    for n in name:
        used = used + '.' + n
        try:
            found = getattr(found, n)
        except AttributeError:
            __import__(used)
            found = getattr(found, n)
    return found

def _strip_spaces(alist):
    return map(str.strip, alist)

def _create_formatters(cp):
    """Create and return formatters"""
    flist = cp["formatters"]["keys"]
    if not len(flist):
        return {}
    flist = flist.split(",")
    flist = _strip_spaces(flist)
    formatters = {}
    for form in flist:
        sectname = "formatter_%s" % form
        fs = cp.get(sectname, "format", raw=True, fallback=None)
        dfs = cp.get(sectname, "datefmt", raw=True, fallback=None)
        stl = cp.get(sectname, "style", raw=True, fallback='%')
        c = logging.Formatter
        class_name = cp[sectname].get("class")
        if class_name:
            c = _resolve(class_name)
        f = c(fs, dfs, stl)
        formatters[form] = f
    return formatters


def _install_handlers(cp, formatters):
    """Install and return handlers"""
    hlist = cp["handlers"]["keys"]
    if not len(hlist):
        return {}
    hlist = hlist.split(",")
    hlist = _strip_spaces(hlist)
    handlers = {}
    fixups = [] #for inter-handler references
    for hand in hlist:
        section = cp["handler_%s" % hand]
        klass = section["class"]
        fmt = section.get("formatter", "")
        try:
            klass = eval(klass, vars(logging))
        except (AttributeError, NameError):
            klass = _resolve(klass)
        args = section.get("args", '()')
        args = eval(args, vars(logging))
        kwargs = section.get("kwargs", '{}')
        kwargs = eval(kwargs, vars(logging))
        h = klass(*args, **kwargs)
        if "level" in section:
            level = section["level"]
            h.setLevel(level)
        if len(fmt):
            h.setFormatter(formatters[fmt])
        if issubclass(klass, logging.handlers.MemoryHandler):
            target = section.get("target", "")
            if len(target): #the target handler may not be loaded yet, so keep for later...
                fixups.append((h, target))
        handlers[hand] = h
    #now all handlers are loaded, fixup inter-handler references...
    for h, t in fixups:
        h.setTarget(handlers[t])
    return handlers

def _handle_existing_loggers(existing, child_loggers, disable_existing):
    """
    When (re)configuring logging, handle loggers which were in the previous
    configuration but are not in the new configuration. There's no point
    deleting them as other threads may continue to hold references to them;
    and by disabling them, you stop them doing any logging.

    However, don't disable children of named loggers, as that's probably not
    what was intended by the user. Also, allow existing loggers to NOT be
    disabled if disable_existing is false.
    """
    root = logging.root
    for log in existing:
        logger = root.manager.loggerDict[log]
        if log in child_loggers:
            if not isinstance(logger, logging.PlaceHolder):
                logger.setLevel(logging.NOTSET)
                logger.handlers = []
                logger.propagate = True
        else:
            logger.disabled = disable_existing

def _install_loggers(cp, handlers, disable_existing):
    """Create and install loggers"""

    # configure the root first
    llist = cp["loggers"]["keys"]
    llist = llist.split(",")
    llist = list(_strip_spaces(llist))
    llist.remove("root")
    section = cp["logger_root"]
    root = logging.root
    log = root
    if "level" in section:
        level = section["level"]
        log.setLevel(level)
    for h in root.handlers[:]:
        root.removeHandler(h)
    hlist = section["handlers"]
    if len(hlist):
        hlist = hlist.split(",")
        hlist = _strip_spaces(hlist)
        for hand in hlist:
            log.addHandler(handlers[hand])

    #and now the others...
    #we don't want to lose the existing loggers,
    #since other threads may have pointers to them.
    #existing is set to contain all existing loggers,
    #and as we go through the new configuration we
    #remove any which are configured. At the end,
    #what's left in existing is the set of loggers
    #which were in the previous configuration but
    #which are not in the new configuration.
    existing = list(root.manager.loggerDict.keys())
    #The list needs to be sorted so that we can
    #avoid disabling child loggers of explicitly
    #named loggers. With a sorted list it is easier
    #to find the child loggers.
    existing.sort()
    #We'll keep the list of existing loggers
    #which are children of named loggers here...
    child_loggers = []
    #now set up the new ones...
    for log in llist:
        section = cp["logger_%s" % log]
        qn = section["qualname"]
        propagate = section.getint("propagate", fallback=1)
        logger = logging.getLogger(qn)
        if qn in existing:
            i = existing.index(qn) + 1 # start with the entry after qn
            prefixed = qn + "."
            pflen = len(prefixed)
            num_existing = len(existing)
            while i < num_existing:
                if existing[i][:pflen] == prefixed:
                    child_loggers.append(existing[i])
                i += 1
            existing.remove(qn)
        if "level" in section:
            level = section["level"]
            logger.setLevel(level)
        for h in logger.handlers[:]:
            logger.removeHandler(h)
        logger.propagate = propagate
        logger.disabled = 0
        hlist = section["handlers"]
        if len(hlist):
            hlist = hlist.split(",")
            hlist = _strip_spaces(hlist)
            for hand in hlist:
                logger.addHandler(handlers[hand])

    #Disable any old loggers. There's no point deleting
    #them as other threads may continue to hold references
    #and by disabling them, you stop them doing any logging.
    #However, don't disable children of named loggers, as that's
    #probably not what was intended by the user.
    #for log in existing:
    #    logger = root.manager.loggerDict[log]
    #    if log in child_loggers:
    #        logger.level = logging.NOTSET
    #        logger.handlers = []
    #        logger.propagate = 1
    #    elif disable_existing_loggers:
    #        logger.disabled = 1
    _handle_existing_loggers(existing, child_loggers, disable_existing)


def _clearExistingHandlers():
    """Clear and close existing handlers"""
    logging._handlers.clear()
    logging.shutdown(logging._handlerList[:])
    del logging._handlerList[:]


IDENTIFIER = re.compile('^[a-z_][a-z0-9_]*$', re.I)


def valid_ident(s):
    m = IDENTIFIER.match(s)
    if not m:
        raise ValueError('Not a valid Python identifier: %r' % s)
    return True


class ConvertingMixin(object):
    """For ConvertingXXX's, this mixin class provides common functions"""

    def convert_with_key(self, key, value, replace=True):
        result = self.configurator.convert(value)
        #If the converted value is different, save for next time
        if value is not result:
            if replace:
                self[key] = result
            if type(result) in (ConvertingDict, ConvertingList,
                               ConvertingTuple):
                result.parent = self
                result.key = key
        return result

    def convert(self, value):
        result = self.configurator.convert(value)
        if value is not result:
            if type(result) in (ConvertingDict, ConvertingList,
                               ConvertingTuple):
                result.parent = self
        return result


# The ConvertingXXX classes are wrappers around standard Python containers,
# and they serve to convert any suitable values in the container. The
# conversion converts base dicts, lists and tuples to their wrapped
# equivalents, whereas strings which match a conversion format are converted
# appropriately.
#
# Each wrapper should have a configurator attribute holding the actual
# configurator to use for conversion.

class ConvertingDict(dict, ConvertingMixin):
    """A converting dictionary wrapper."""

    def __getitem__(self, key):
        value = dict.__getitem__(self, key)
        return self.convert_with_key(key, value)

    def get(self, key, default=None):
        value = dict.get(self, key, default)
        return self.convert_with_key(key, value)

    def pop(self, key, default=None):
        value = dict.pop(self, key, default)
        return self.convert_with_key(key, value, replace=False)

class ConvertingList(list, ConvertingMixin):
    """A converting list wrapper."""
    def __getitem__(self, key):
        value = list.__getitem__(self, key)
        return self.convert_with_key(key, value)

    def pop(self, idx=-1):
        value = list.pop(self, idx)
        return self.convert(value)

class ConvertingTuple(tuple, ConvertingMixin):
    """A converting tuple wrapper."""
    def __getitem__(self, key):
        value = tuple.__getitem__(self, key)
        # Can't replace a tuple entry.
        return self.convert_with_key(key, value, replace=False)

class BaseConfigurator(object):
    """
    The configurator base class which defines some useful defaults.
    """

    CONVERT_PATTERN = re.compile(r'^(?P<prefix>[a-z]+)://(?P<suffix>.*)$')

    WORD_PATTERN = re.compile(r'^\s*(\w+)\s*')
    DOT_PATTERN = re.compile(r'^\.\s*(\w+)\s*')
    INDEX_PATTERN = re.compile(r'^\[\s*(\w+)\s*\]\s*')
    DIGIT_PATTERN = re.compile(r'^\d+$')

    value_converters = {
        'ext' : 'ext_convert',
        'cfg' : 'cfg_convert',
    }

    # We might want to use a different one, e.g. importlib
    importer = staticmethod(__import__)

    def __init__(self, config):
        self.config = ConvertingDict(config)
        self.config.configurator = self

    def resolve(self, s):
        """
        Resolve strings to objects using standard import and attribute
        syntax.
        """
        name = s.split('.')
        used = name.pop(0)
        try:
            found = self.importer(used)
            for frag in name:
                used += '.' + frag
                try:
                    found = getattr(found, frag)
                except AttributeError:
                    self.importer(used)
                    found = getattr(found, frag)
            return found
        except ImportError:
            e, tb = sys.exc_info()[1:]
            v = ValueError('Cannot resolve %r: %s' % (s, e))
            v.__cause__, v.__traceback__ = e, tb
            raise v

    def ext_convert(self, value):
        """Default converter for the ext:// protocol."""
        return self.resolve(value)

    def cfg_convert(self, value):
        """Default converter for the cfg:// protocol."""
        rest = value
        m = self.WORD_PATTERN.match(rest)
        if m is None:
            raise ValueError("Unable to convert %r" % value)
        else:
            rest = rest[m.end():]
            d = self.config[m.groups()[0]]
            #print d, rest
            while rest:
                m = self.DOT_PATTERN.match(rest)
                if m:
                    d = d[m.groups()[0]]
                else:
                    m = self.INDEX_PATTERN.match(rest)
                    if m:
                        idx = m.groups()[0]
                        if not self.DIGIT_PATTERN.match(idx):
                            d = d[idx]
                        else:
                            try:
                                n = int(idx) # try as number first (most likely)
                                d = d[n]
                            except TypeError:
                                d = d[idx]
                if m:
                    rest = rest[m.end():]
                else:
                    raise ValueError('Unable to convert '
                                     '%r at %r' % (value, rest))
        #rest should be empty
        return d

    def convert(self, value):
        """
        Convert values to an appropriate type. dicts, lists and tuples are
        replaced by their converting alternatives. Strings are checked to
        see if they have a conversion format and are converted if they do.
        """
        if not isinstance(value, ConvertingDict) and isinstance(value, dict):
            value = ConvertingDict(value)
            value.configurator = self
        elif not isinstance(value, ConvertingList) and isinstance(value, list):
            value = ConvertingList(value)
            value.configurator = self
        elif not isinstance(value, ConvertingTuple) and\
                 isinstance(value, tuple) and not hasattr(value, '_fields'):
            value = ConvertingTuple(value)
            value.configurator = self
        elif isinstance(value, str): # str for py3k
            m = self.CONVERT_PATTERN.match(value)
            if m:
                d = m.groupdict()
                prefix = d['prefix']
                converter = self.value_converters.get(prefix, None)
                if converter:
                    suffix = d['suffix']
                    converter = getattr(self, converter)
                    value = converter(suffix)
        return value

    def configure_custom(self, config):
        """Configure an object with a user-supplied factory."""
        c = config.pop('()')
        if not callable(c):
            c = self.resolve(c)
        props = config.pop('.', None)
        # Check for valid identifiers
        kwargs = {k: config[k] for k in config if valid_ident(k)}
        result = c(**kwargs)
        if props:
            for name, value in props.items():
                setattr(result, name, value)
        return result

    def as_tuple(self, value):
        """Utility function which converts lists to tuples."""
        if isinstance(value, list):
            value = tuple(value)
        return value

class DictConfigurator(BaseConfigurator):
    """
    Configure logging using a dictionary-like object to describe the
    configuration.
    """

    def configure(self):
        """Do the configuration."""

        config = self.config
        if 'version' not in config:
            raise ValueError("dictionary doesn't specify a version")
        if config['version'] != 1:
            raise ValueError("Unsupported version: %s" % config['version'])
        incremental = config.pop('incremental', False)
        EMPTY_DICT = {}
        logging._acquireLock()
        try:
            if incremental:
                handlers = config.get('handlers', EMPTY_DICT)
                for name in handlers:
                    if name not in logging._handlers:
                        raise ValueError('No handler found with '
                                         'name %r'  % name)
                    else:
                        try:
                            handler = logging._handlers[name]
                            handler_config = handlers[name]
                            level = handler_config.get('level', None)
                            if level:
                                handler.setLevel(logging._checkLevel(level))
                        except Exception as e:
                            raise ValueError('Unable to configure handler '
                                             '%r' % name) from e
                loggers = config.get('loggers', EMPTY_DICT)
                for name in loggers:
                    try:
                        self.configure_logger(name, loggers[name], True)
                    except Exception as e:
                        raise ValueError('Unable to configure logger '
                                         '%r' % name) from e
                root = config.get('root', None)
                if root:
                    try:
                        self.configure_root(root, True)
                    except Exception as e:
                        raise ValueError('Unable to configure root '
                                         'logger') from e
            else:
                disable_existing = config.pop('disable_existing_loggers', True)

                _clearExistingHandlers()

                # Do formatters first - they don't refer to anything else
                formatters = config.get('formatters', EMPTY_DICT)
                for name in formatters:
                    try:
                        formatters[name] = self.configure_formatter(
                                                            formatters[name])
                    except Exception as e:
                        raise ValueError('Unable to configure '
                                         'formatter %r' % name) from e
                # Next, do filters - they don't refer to anything else, either
                filters = config.get('filters', EMPTY_DICT)
                for name in filters:
                    try:
                        filters[name] = self.configure_filter(filters[name])
                    except Exception as e:
                        raise ValueError('Unable to configure '
                                         'filter %r' % name) from e

                # Next, do handlers - they refer to formatters and filters
                # As handlers can refer to other handlers, sort the keys
                # to allow a deterministic order of configuration
                handlers = config.get('handlers', EMPTY_DICT)
                deferred = []
                for name in sorted(handlers):
                    try:
                        handler = self.configure_handler(handlers[name])
                        handler.name = name
                        handlers[name] = handler
                    except Exception as e:
                        if 'target not configured yet' in str(e.__cause__):
                            deferred.append(name)
                        else:
                            raise ValueError('Unable to configure handler '
                                             '%r' % name) from e

                # Now do any that were deferred
                for name in deferred:
                    try:
                        handler = self.configure_handler(handlers[name])
                        handler.name = name
                        handlers[name] = handler
                    except Exception as e:
                        raise ValueError('Unable to configure handler '
                                         '%r' % name) from e

                # Next, do loggers - they refer to handlers and filters

                #we don't want to lose the existing loggers,
                #since other threads may have pointers to them.
                #existing is set to contain all existing loggers,
                #and as we go through the new configuration we
                #remove any which are configured. At the end,
                #what's left in existing is the set of loggers
                #which were in the previous configuration but
                #which are not in the new configuration.
                root = logging.root
                existing = list(root.manager.loggerDict.keys())
                #The list needs to be sorted so that we can
                #avoid disabling child loggers of explicitly
                #named loggers. With a sorted list it is easier
                #to find the child loggers.
                existing.sort()
                #We'll keep the list of existing loggers
                #which are children of named loggers here...
                child_loggers = []
                #now set up the new ones...
                loggers = config.get('loggers', EMPTY_DICT)
                for name in loggers:
                    if name in existing:
                        i = existing.index(name) + 1 # look after name
                        prefixed = name + "."
                        pflen = len(prefixed)
                        num_existing = len(existing)
                        while i < num_existing:
                            if existing[i][:pflen] == prefixed:
                                child_loggers.append(existing[i])
                            i += 1
                        existing.remove(name)
                    try:
                        self.configure_logger(name, loggers[name])
                    except Exception as e:
                        raise ValueError('Unable to configure logger '
                                         '%r' % name) from e

                #Disable any old loggers. There's no point deleting
                #them as other threads may continue to hold references
                #and by disabling them, you stop them doing any logging.
                #However, don't disable children of named loggers, as that's
                #probably not what was intended by the user.
                #for log in existing:
                #    logger = root.manager.loggerDict[log]
                #    if log in child_loggers:
                #        logger.level = logging.NOTSET
                #        logger.handlers = []
                #        logger.propagate = True
                #    elif disable_existing:
                #        logger.disabled = True
                _handle_existing_loggers(existing, child_loggers,
                                         disable_existing)

                # And finally, do the root logger
                root = config.get('root', None)
                if root:
                    try:
                        self.configure_root(root)
                    except Exception as e:
                        raise ValueError('Unable to configure root '
                                         'logger') from e
        finally:
            logging._releaseLock()

    def configure_formatter(self, config):
        """Configure a formatter from a dictionary."""
        if '()' in config:
            factory = config['()'] # for use in exception handler
            try:
                result = self.configure_custom(config)
            except TypeError as te:
                if "'format'" not in str(te):
                    raise
                #Name of parameter changed from fmt to format.
                #Retry with old name.
                #This is so that code can be used with older Python versions
                #(e.g. by Django)
                config['fmt'] = config.pop('format')
                config['()'] = factory
                result = self.configure_custom(config)
        else:
            fmt = config.get('format', None)
            dfmt = config.get('datefmt', None)
            style = config.get('style', '%')
            cname = config.get('class', None)

            if not cname:
                c = logging.Formatter
            else:
                c = _resolve(cname)

            # A TypeError would be raised if "validate" key is passed in with a formatter callable
            # that does not accept "validate" as a parameter
            if 'validate' in config:  # if user hasn't mentioned it, the default will be fine
                result = c(fmt, dfmt, style, config['validate'])
            else:
                result = c(fmt, dfmt, style)

        return result

    def configure_filter(self, config):
        """Configure a filter from a dictionary."""
        if '()' in config:
            result = self.configure_custom(config)
        else:
            name = config.get('name', '')
            result = logging.Filter(name)
        return result

    def add_filters(self, filterer, filters):
        """Add filters to a filterer from a list of names."""
        for f in filters:
            try:
                filterer.addFilter(self.config['filters'][f])
            except Exception as e:
                raise ValueError('Unable to add filter %r' % f) from e

    def configure_handler(self, config):
        """Configure a handler from a dictionary."""
        config_copy = dict(config)  # for restoring in case of error
        formatter = config.pop('formatter', None)
        if formatter:
            try:
                formatter = self.config['formatters'][formatter]
            except Exception as e:
                raise ValueError('Unable to set formatter '
                                 '%r' % formatter) from e
        level = config.pop('level', None)
        filters = config.pop('filters', None)
        if '()' in config:
            c = config.pop('()')
            if not callable(c):
                c = self.resolve(c)
            factory = c
        else:
            cname = config.pop('class')
            klass = self.resolve(cname)
            #Special case for handler which refers to another handler
            if issubclass(klass, logging.handlers.MemoryHandler) and\
                'target' in config:
                try:
                    th = self.config['handlers'][config['target']]
                    if not isinstance(th, logging.Handler):
                        config.update(config_copy)  # restore for deferred cfg
                        raise TypeError('target not configured yet')
                    config['target'] = th
                except Exception as e:
                    raise ValueError('Unable to set target handler '
                                     '%r' % config['target']) from e
            elif issubclass(klass, logging.handlers.SMTPHandler) and\
                'mailhost' in config:
                config['mailhost'] = self.as_tuple(config['mailhost'])
            elif issubclass(klass, logging.handlers.SysLogHandler) and\
                'address' in config:
                config['address'] = self.as_tuple(config['address'])
            factory = klass
        props = config.pop('.', None)
        kwargs = {k: config[k] for k in config if valid_ident(k)}
        try:
            result = factory(**kwargs)
        except TypeError as te:
            if "'stream'" not in str(te):
                raise
            #The argument name changed from strm to stream
            #Retry with old name.
            #This is so that code can be used with older Python versions
            #(e.g. by Django)
            kwargs['strm'] = kwargs.pop('stream')
            result = factory(**kwargs)
        if formatter:
            result.setFormatter(formatter)
        if level is not None:
            result.setLevel(logging._checkLevel(level))
        if filters:
            self.add_filters(result, filters)
        if props:
            for name, value in props.items():
                setattr(result, name, value)
        return result

    def add_handlers(self, logger, handlers):
        """Add handlers to a logger from a list of names."""
        for h in handlers:
            try:
                logger.addHandler(self.config['handlers'][h])
            except Exception as e:
                raise ValueError('Unable to add handler %r' % h) from e

    def common_logger_config(self, logger, config, incremental=False):
        """
        Perform configuration which is common to root and non-root loggers.
        """
        level = config.get('level', None)
        if level is not None:
            logger.setLevel(logging._checkLevel(level))
        if not incremental:
            #Remove any existing handlers
            for h in logger.handlers[:]:
                logger.removeHandler(h)
            handlers = config.get('handlers', None)
            if handlers:
                self.add_handlers(logger, handlers)
            filters = config.get('filters', None)
            if filters:
                self.add_filters(logger, filters)

    def configure_logger(self, name, config, incremental=False):
        """Configure a non-root logger from a dictionary."""
        logger = logging.getLogger(name)
        self.common_logger_config(logger, config, incremental)
        propagate = config.get('propagate', None)
        if propagate is not None:
            logger.propagate = propagate

    def configure_root(self, config, incremental=False):
        """Configure a root logger from a dictionary."""
        root = logging.getLogger()
        self.common_logger_config(root, config, incremental)

dictConfigClass = DictConfigurator

def dictConfig(config):
    """Configure logging using a dictionary."""
    dictConfigClass(config).configure()


def listen(port=DEFAULT_LOGGING_CONFIG_PORT, verify=None):
    """
    Start up a socket server on the specified port, and listen for new
    configurations.

    These will be sent as a file suitable for processing by fileConfig().
    Returns a Thread object on which you can call start() to start the server,
    and which you can join() when appropriate. To stop the server, call
    stopListening().

    Use the ``verify`` argument to verify any bytes received across the wire
    from a client. If specified, it should be a callable which receives a
    single argument - the bytes of configuration data received across the
    network - and it should return either ``None``, to indicate that the
    passed in bytes could not be verified and should be discarded, or a
    byte string which is then passed to the configuration machinery as
    normal. Note that you can return transformed bytes, e.g. by decrypting
    the bytes passed in.
    """

    class ConfigStreamHandler(StreamRequestHandler):
        """
        Handler for a logging configuration request.

        It expects a completely new logging configuration and uses fileConfig
        to install it.
        """
        def handle(self):
            """
            Handle a request.

            Each request is expected to be a 4-byte length, packed using
            struct.pack(">L", n), followed by the config file.
            Uses fileConfig() to do the grunt work.
            """
            try:
                conn = self.connection
                chunk = conn.recv(4)
                if len(chunk) == 4:
                    slen = struct.unpack(">L", chunk)[0]
                    chunk = self.connection.recv(slen)
                    while len(chunk) < slen:
                        chunk = chunk + conn.recv(slen - len(chunk))
                    if self.server.verify is not None:
                        chunk = self.server.verify(chunk)
                    if chunk is not None:   # verified, can process
                        chunk = chunk.decode("utf-8")
                        try:
                            import json
                            d =json.loads(chunk)
                            assert isinstance(d, dict)
                            dictConfig(d)
                        except Exception:
                            #Apply new configuration.

                            file = io.StringIO(chunk)
                            try:
                                fileConfig(file)
                            except Exception:
                                traceback.print_exc()
                    if self.server.ready:
                        self.server.ready.set()
            except OSError as e:
                if e.errno != RESET_ERROR:
                    raise

    class ConfigSocketReceiver(ThreadingTCPServer):
        """
        A simple TCP socket-based logging config receiver.
        """

        allow_reuse_address = 1

        def __init__(self, host='localhost', port=DEFAULT_LOGGING_CONFIG_PORT,
                     handler=None, ready=None, verify=None):
            ThreadingTCPServer.__init__(self, (host, port), handler)
            logging._acquireLock()
            self.abort = 0
            logging._releaseLock()
            self.timeout = 1
            self.ready = ready
            self.verify = verify

        def serve_until_stopped(self):
            import select
            abort = 0
            while not abort:
                rd, wr, ex = select.select([self.socket.fileno()],
                                           [], [],
                                           self.timeout)
                if rd:
                    self.handle_request()
                logging._acquireLock()
                abort = self.abort
                logging._releaseLock()
            self.server_close()

    class Server(threading.Thread):

        def __init__(self, rcvr, hdlr, port, verify):
            super(Server, self).__init__()
            self.rcvr = rcvr
            self.hdlr = hdlr
            self.port = port
            self.verify = verify
            self.ready = threading.Event()

        def run(self):
            server = self.rcvr(port=self.port, handler=self.hdlr,
                               ready=self.ready,
                               verify=self.verify)
            if self.port == 0:
                self.port = server.server_address[1]
            self.ready.set()
            global _listener
            logging._acquireLock()
            _listener = server
            logging._releaseLock()
            server.serve_until_stopped()

    return Server(ConfigSocketReceiver, ConfigStreamHandler, port, verify)

def stopListening():
    """
    Stop the listening server which was created with a call to listen().
    """
    global _listener
    logging._acquireLock()
    try:
        if _listener:
            _listener.abort = 1
            _listener = None
    finally:
        logging._releaseLock()
logging/__init__.py000064400000230204151153537450010315 0ustar00# Copyright 2001-2017 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permission notice appear in
# supporting documentation, and that the name of Vinay Sajip
# not be used in advertising or publicity pertaining to distribution
# of the software without specific, written prior permission.
# VINAY SAJIP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
# ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
# VINAY SAJIP BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
# ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
# IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

"""
Logging package for Python. Based on PEP 282 and comments thereto in
comp.lang.python.

Copyright (C) 2001-2017 Vinay Sajip. All Rights Reserved.

To use, simply 'import logging' and log away!
"""

import sys, os, time, io, re, traceback, warnings, weakref, collections.abc

from string import Template
from string import Formatter as StrFormatter


__all__ = ['BASIC_FORMAT', 'BufferingFormatter', 'CRITICAL', 'DEBUG', 'ERROR',
           'FATAL', 'FileHandler', 'Filter', 'Formatter', 'Handler', 'INFO',
           'LogRecord', 'Logger', 'LoggerAdapter', 'NOTSET', 'NullHandler',
           'StreamHandler', 'WARN', 'WARNING', 'addLevelName', 'basicConfig',
           'captureWarnings', 'critical', 'debug', 'disable', 'error',
           'exception', 'fatal', 'getLevelName', 'getLogger', 'getLoggerClass',
           'info', 'log', 'makeLogRecord', 'setLoggerClass', 'shutdown',
           'warn', 'warning', 'getLogRecordFactory', 'setLogRecordFactory',
           'lastResort', 'raiseExceptions']

import threading

__author__  = "Vinay Sajip <vinay_sajip@red-dove.com>"
__status__  = "production"
# The following module attributes are no longer updated.
__version__ = "0.5.1.2"
__date__    = "07 February 2010"

#---------------------------------------------------------------------------
#   Miscellaneous module data
#---------------------------------------------------------------------------

#
#_startTime is used as the base when calculating the relative time of events
#
_startTime = time.time()

#
#raiseExceptions is used to see if exceptions during handling should be
#propagated
#
raiseExceptions = True

#
# If you don't want threading information in the log, set this to zero
#
logThreads = True

#
# If you don't want multiprocessing information in the log, set this to zero
#
logMultiprocessing = True

#
# If you don't want process information in the log, set this to zero
#
logProcesses = True

#---------------------------------------------------------------------------
#   Level related stuff
#---------------------------------------------------------------------------
#
# Default levels and level names, these can be replaced with any positive set
# of values having corresponding names. There is a pseudo-level, NOTSET, which
# is only really there as a lower limit for user-defined levels. Handlers and
# loggers are initialized with NOTSET so that they will log all messages, even
# at user-defined levels.
#

CRITICAL = 50
FATAL = CRITICAL
ERROR = 40
WARNING = 30
WARN = WARNING
INFO = 20
DEBUG = 10
NOTSET = 0

_levelToName = {
    CRITICAL: 'CRITICAL',
    ERROR: 'ERROR',
    WARNING: 'WARNING',
    INFO: 'INFO',
    DEBUG: 'DEBUG',
    NOTSET: 'NOTSET',
}
_nameToLevel = {
    'CRITICAL': CRITICAL,
    'FATAL': FATAL,
    'ERROR': ERROR,
    'WARN': WARNING,
    'WARNING': WARNING,
    'INFO': INFO,
    'DEBUG': DEBUG,
    'NOTSET': NOTSET,
}

def getLevelName(level):
    """
    Return the textual or numeric representation of logging level 'level'.

    If the level is one of the predefined levels (CRITICAL, ERROR, WARNING,
    INFO, DEBUG) then you get the corresponding string. If you have
    associated levels with names using addLevelName then the name you have
    associated with 'level' is returned.

    If a numeric value corresponding to one of the defined levels is passed
    in, the corresponding string representation is returned.

    If a string representation of the level is passed in, the corresponding
    numeric value is returned.

    If no matching numeric or string value is passed in, the string
    'Level %s' % level is returned.
    """
    # See Issues #22386, #27937 and #29220 for why it's this way
    result = _levelToName.get(level)
    if result is not None:
        return result
    result = _nameToLevel.get(level)
    if result is not None:
        return result
    return "Level %s" % level

def addLevelName(level, levelName):
    """
    Associate 'levelName' with 'level'.

    This is used when converting levels to text during message formatting.
    """
    _acquireLock()
    try:    #unlikely to cause an exception, but you never know...
        _levelToName[level] = levelName
        _nameToLevel[levelName] = level
    finally:
        _releaseLock()

if hasattr(sys, '_getframe'):
    currentframe = lambda: sys._getframe(3)
else: #pragma: no cover
    def currentframe():
        """Return the frame object for the caller's stack frame."""
        try:
            raise Exception
        except Exception:
            return sys.exc_info()[2].tb_frame.f_back

#
# _srcfile is used when walking the stack to check when we've got the first
# caller stack frame, by skipping frames whose filename is that of this
# module's source. It therefore should contain the filename of this module's
# source file.
#
# Ordinarily we would use __file__ for this, but frozen modules don't always
# have __file__ set, for some reason (see Issue #21736). Thus, we get the
# filename from a handy code object from a function defined in this module.
# (There's no particular reason for picking addLevelName.)
#

_srcfile = os.path.normcase(addLevelName.__code__.co_filename)

# _srcfile is only used in conjunction with sys._getframe().
# To provide compatibility with older versions of Python, set _srcfile
# to None if _getframe() is not available; this value will prevent
# findCaller() from being called. You can also do this if you want to avoid
# the overhead of fetching caller information, even when _getframe() is
# available.
#if not hasattr(sys, '_getframe'):
#    _srcfile = None


def _checkLevel(level):
    if isinstance(level, int):
        rv = level
    elif str(level) == level:
        if level not in _nameToLevel:
            raise ValueError("Unknown level: %r" % level)
        rv = _nameToLevel[level]
    else:
        raise TypeError("Level not an integer or a valid string: %r" % level)
    return rv

#---------------------------------------------------------------------------
#   Thread-related stuff
#---------------------------------------------------------------------------

#
#_lock is used to serialize access to shared data structures in this module.
#This needs to be an RLock because fileConfig() creates and configures
#Handlers, and so might arbitrary user threads. Since Handler code updates the
#shared dictionary _handlers, it needs to acquire the lock. But if configuring,
#the lock would already have been acquired - so we need an RLock.
#The same argument applies to Loggers and Manager.loggerDict.
#
_lock = threading.RLock()

def _acquireLock():
    """
    Acquire the module-level lock for serializing access to shared data.

    This should be released with _releaseLock().
    """
    if _lock:
        _lock.acquire()

def _releaseLock():
    """
    Release the module-level lock acquired by calling _acquireLock().
    """
    if _lock:
        _lock.release()


# Prevent a held logging lock from blocking a child from logging.

if not hasattr(os, 'register_at_fork'):  # Windows and friends.
    def _register_at_fork_reinit_lock(instance):
        pass  # no-op when os.register_at_fork does not exist.
else:
    # A collection of instances with a createLock method (logging.Handler)
    # to be called in the child after forking.  The weakref avoids us keeping
    # discarded Handler instances alive.  A set is used to avoid accumulating
    # duplicate registrations as createLock() is responsible for registering
    # a new Handler instance with this set in the first place.
    _at_fork_reinit_lock_weakset = weakref.WeakSet()

    def _register_at_fork_reinit_lock(instance):
        _acquireLock()
        try:
            _at_fork_reinit_lock_weakset.add(instance)
        finally:
            _releaseLock()

    def _after_at_fork_child_reinit_locks():
        # _acquireLock() was called in the parent before forking.
        for handler in _at_fork_reinit_lock_weakset:
            try:
                handler.createLock()
            except Exception as err:
                # Similar to what PyErr_WriteUnraisable does.
                print("Ignoring exception from logging atfork", instance,
                      "._reinit_lock() method:", err, file=sys.stderr)
        _releaseLock()  # Acquired by os.register_at_fork(before=.


    os.register_at_fork(before=_acquireLock,
                        after_in_child=_after_at_fork_child_reinit_locks,
                        after_in_parent=_releaseLock)


#---------------------------------------------------------------------------
#   The logging record
#---------------------------------------------------------------------------

class LogRecord(object):
    """
    A LogRecord instance represents an event being logged.

    LogRecord instances are created every time something is logged. They
    contain all the information pertinent to the event being logged. The
    main information passed in is in msg and args, which are combined
    using str(msg) % args to create the message field of the record. The
    record also includes information such as when the record was created,
    the source line where the logging call was made, and any exception
    information to be logged.
    """
    def __init__(self, name, level, pathname, lineno,
                 msg, args, exc_info, func=None, sinfo=None, **kwargs):
        """
        Initialize a logging record with interesting information.
        """
        ct = time.time()
        self.name = name
        self.msg = msg
        #
        # The following statement allows passing of a dictionary as a sole
        # argument, so that you can do something like
        #  logging.debug("a %(a)d b %(b)s", {'a':1, 'b':2})
        # Suggested by Stefan Behnel.
        # Note that without the test for args[0], we get a problem because
        # during formatting, we test to see if the arg is present using
        # 'if self.args:'. If the event being logged is e.g. 'Value is %d'
        # and if the passed arg fails 'if self.args:' then no formatting
        # is done. For example, logger.warning('Value is %d', 0) would log
        # 'Value is %d' instead of 'Value is 0'.
        # For the use case of passing a dictionary, this should not be a
        # problem.
        # Issue #21172: a request was made to relax the isinstance check
        # to hasattr(args[0], '__getitem__'). However, the docs on string
        # formatting still seem to suggest a mapping object is required.
        # Thus, while not removing the isinstance check, it does now look
        # for collections.abc.Mapping rather than, as before, dict.
        if (args and len(args) == 1 and isinstance(args[0], collections.abc.Mapping)
            and args[0]):
            args = args[0]
        self.args = args
        self.levelname = getLevelName(level)
        self.levelno = level
        self.pathname = pathname
        try:
            self.filename = os.path.basename(pathname)
            self.module = os.path.splitext(self.filename)[0]
        except (TypeError, ValueError, AttributeError):
            self.filename = pathname
            self.module = "Unknown module"
        self.exc_info = exc_info
        self.exc_text = None      # used to cache the traceback text
        self.stack_info = sinfo
        self.lineno = lineno
        self.funcName = func
        self.created = ct
        self.msecs = (ct - int(ct)) * 1000
        self.relativeCreated = (self.created - _startTime) * 1000
        if logThreads:
            self.thread = threading.get_ident()
            self.threadName = threading.current_thread().name
        else: # pragma: no cover
            self.thread = None
            self.threadName = None
        if not logMultiprocessing: # pragma: no cover
            self.processName = None
        else:
            self.processName = 'MainProcess'
            mp = sys.modules.get('multiprocessing')
            if mp is not None:
                # Errors may occur if multiprocessing has not finished loading
                # yet - e.g. if a custom import hook causes third-party code
                # to run when multiprocessing calls import. See issue 8200
                # for an example
                try:
                    self.processName = mp.current_process().name
                except Exception: #pragma: no cover
                    pass
        if logProcesses and hasattr(os, 'getpid'):
            self.process = os.getpid()
        else:
            self.process = None

    def __repr__(self):
        return '<LogRecord: %s, %s, %s, %s, "%s">'%(self.name, self.levelno,
            self.pathname, self.lineno, self.msg)

    def getMessage(self):
        """
        Return the message for this LogRecord.

        Return the message for this LogRecord after merging any user-supplied
        arguments with the message.
        """
        msg = str(self.msg)
        if self.args:
            msg = msg % self.args
        return msg

#
#   Determine which class to use when instantiating log records.
#
_logRecordFactory = LogRecord

def setLogRecordFactory(factory):
    """
    Set the factory to be used when instantiating a log record.

    :param factory: A callable which will be called to instantiate
    a log record.
    """
    global _logRecordFactory
    _logRecordFactory = factory

def getLogRecordFactory():
    """
    Return the factory to be used when instantiating a log record.
    """

    return _logRecordFactory

def makeLogRecord(dict):
    """
    Make a LogRecord whose attributes are defined by the specified dictionary,
    This function is useful for converting a logging event received over
    a socket connection (which is sent as a dictionary) into a LogRecord
    instance.
    """
    rv = _logRecordFactory(None, None, "", 0, "", (), None, None)
    rv.__dict__.update(dict)
    return rv


#---------------------------------------------------------------------------
#   Formatter classes and functions
#---------------------------------------------------------------------------
_str_formatter = StrFormatter()
del StrFormatter


class PercentStyle(object):

    default_format = '%(message)s'
    asctime_format = '%(asctime)s'
    asctime_search = '%(asctime)'
    validation_pattern = re.compile(r'%\(\w+\)[#0+ -]*(\*|\d+)?(\.(\*|\d+))?[diouxefgcrsa%]', re.I)

    def __init__(self, fmt):
        self._fmt = fmt or self.default_format

    def usesTime(self):
        return self._fmt.find(self.asctime_search) >= 0

    def validate(self):
        """Validate the input format, ensure it matches the correct style"""
        if not self.validation_pattern.search(self._fmt):
            raise ValueError("Invalid format '%s' for '%s' style" % (self._fmt, self.default_format[0]))

    def _format(self, record):
        return self._fmt % record.__dict__

    def format(self, record):
        try:
            return self._format(record)
        except KeyError as e:
            raise ValueError('Formatting field not found in record: %s' % e)


class StrFormatStyle(PercentStyle):
    default_format = '{message}'
    asctime_format = '{asctime}'
    asctime_search = '{asctime'

    fmt_spec = re.compile(r'^(.?[<>=^])?[+ -]?#?0?(\d+|{\w+})?[,_]?(\.(\d+|{\w+}))?[bcdefgnosx%]?$', re.I)
    field_spec = re.compile(r'^(\d+|\w+)(\.\w+|\[[^]]+\])*$')

    def _format(self, record):
        return self._fmt.format(**record.__dict__)

    def validate(self):
        """Validate the input format, ensure it is the correct string formatting style"""
        fields = set()
        try:
            for _, fieldname, spec, conversion in _str_formatter.parse(self._fmt):
                if fieldname:
                    if not self.field_spec.match(fieldname):
                        raise ValueError('invalid field name/expression: %r' % fieldname)
                    fields.add(fieldname)
                if conversion and conversion not in 'rsa':
                    raise ValueError('invalid conversion: %r' % conversion)
                if spec and not self.fmt_spec.match(spec):
                    raise ValueError('bad specifier: %r' % spec)
        except ValueError as e:
            raise ValueError('invalid format: %s' % e)
        if not fields:
            raise ValueError('invalid format: no fields')


class StringTemplateStyle(PercentStyle):
    default_format = '${message}'
    asctime_format = '${asctime}'
    asctime_search = '${asctime}'

    def __init__(self, fmt):
        self._fmt = fmt or self.default_format
        self._tpl = Template(self._fmt)

    def usesTime(self):
        fmt = self._fmt
        return fmt.find('$asctime') >= 0 or fmt.find(self.asctime_format) >= 0

    def validate(self):
        pattern = Template.pattern
        fields = set()
        for m in pattern.finditer(self._fmt):
            d = m.groupdict()
            if d['named']:
                fields.add(d['named'])
            elif d['braced']:
                fields.add(d['braced'])
            elif m.group(0) == '$':
                raise ValueError('invalid format: bare \'$\' not allowed')
        if not fields:
            raise ValueError('invalid format: no fields')

    def _format(self, record):
        return self._tpl.substitute(**record.__dict__)


BASIC_FORMAT = "%(levelname)s:%(name)s:%(message)s"

_STYLES = {
    '%': (PercentStyle, BASIC_FORMAT),
    '{': (StrFormatStyle, '{levelname}:{name}:{message}'),
    '$': (StringTemplateStyle, '${levelname}:${name}:${message}'),
}

class Formatter(object):
    """
    Formatter instances are used to convert a LogRecord to text.

    Formatters need to know how a LogRecord is constructed. They are
    responsible for converting a LogRecord to (usually) a string which can
    be interpreted by either a human or an external system. The base Formatter
    allows a formatting string to be specified. If none is supplied, the
    style-dependent default value, "%(message)s", "{message}", or
    "${message}", is used.

    The Formatter can be initialized with a format string which makes use of
    knowledge of the LogRecord attributes - e.g. the default value mentioned
    above makes use of the fact that the user's message and arguments are pre-
    formatted into a LogRecord's message attribute. Currently, the useful
    attributes in a LogRecord are described by:

    %(name)s            Name of the logger (logging channel)
    %(levelno)s         Numeric logging level for the message (DEBUG, INFO,
                        WARNING, ERROR, CRITICAL)
    %(levelname)s       Text logging level for the message ("DEBUG", "INFO",
                        "WARNING", "ERROR", "CRITICAL")
    %(pathname)s        Full pathname of the source file where the logging
                        call was issued (if available)
    %(filename)s        Filename portion of pathname
    %(module)s          Module (name portion of filename)
    %(lineno)d          Source line number where the logging call was issued
                        (if available)
    %(funcName)s        Function name
    %(created)f         Time when the LogRecord was created (time.time()
                        return value)
    %(asctime)s         Textual time when the LogRecord was created
    %(msecs)d           Millisecond portion of the creation time
    %(relativeCreated)d Time in milliseconds when the LogRecord was created,
                        relative to the time the logging module was loaded
                        (typically at application startup time)
    %(thread)d          Thread ID (if available)
    %(threadName)s      Thread name (if available)
    %(process)d         Process ID (if available)
    %(message)s         The result of record.getMessage(), computed just as
                        the record is emitted
    """

    converter = time.localtime

    def __init__(self, fmt=None, datefmt=None, style='%', validate=True):
        """
        Initialize the formatter with specified format strings.

        Initialize the formatter either with the specified format string, or a
        default as described above. Allow for specialized date formatting with
        the optional datefmt argument. If datefmt is omitted, you get an
        ISO8601-like (or RFC 3339-like) format.

        Use a style parameter of '%', '{' or '$' to specify that you want to
        use one of %-formatting, :meth:`str.format` (``{}``) formatting or
        :class:`string.Template` formatting in your format string.

        .. versionchanged:: 3.2
           Added the ``style`` parameter.
        """
        if style not in _STYLES:
            raise ValueError('Style must be one of: %s' % ','.join(
                             _STYLES.keys()))
        self._style = _STYLES[style][0](fmt)
        if validate:
            self._style.validate()

        self._fmt = self._style._fmt
        self.datefmt = datefmt

    default_time_format = '%Y-%m-%d %H:%M:%S'
    default_msec_format = '%s,%03d'

    def formatTime(self, record, datefmt=None):
        """
        Return the creation time of the specified LogRecord as formatted text.

        This method should be called from format() by a formatter which
        wants to make use of a formatted time. This method can be overridden
        in formatters to provide for any specific requirement, but the
        basic behaviour is as follows: if datefmt (a string) is specified,
        it is used with time.strftime() to format the creation time of the
        record. Otherwise, an ISO8601-like (or RFC 3339-like) format is used.
        The resulting string is returned. This function uses a user-configurable
        function to convert the creation time to a tuple. By default,
        time.localtime() is used; to change this for a particular formatter
        instance, set the 'converter' attribute to a function with the same
        signature as time.localtime() or time.gmtime(). To change it for all
        formatters, for example if you want all logging times to be shown in GMT,
        set the 'converter' attribute in the Formatter class.
        """
        ct = self.converter(record.created)
        if datefmt:
            s = time.strftime(datefmt, ct)
        else:
            t = time.strftime(self.default_time_format, ct)
            s = self.default_msec_format % (t, record.msecs)
        return s

    def formatException(self, ei):
        """
        Format and return the specified exception information as a string.

        This default implementation just uses
        traceback.print_exception()
        """
        sio = io.StringIO()
        tb = ei[2]
        # See issues #9427, #1553375. Commented out for now.
        #if getattr(self, 'fullstack', False):
        #    traceback.print_stack(tb.tb_frame.f_back, file=sio)
        traceback.print_exception(ei[0], ei[1], tb, None, sio)
        s = sio.getvalue()
        sio.close()
        if s[-1:] == "\n":
            s = s[:-1]
        return s

    def usesTime(self):
        """
        Check if the format uses the creation time of the record.
        """
        return self._style.usesTime()

    def formatMessage(self, record):
        return self._style.format(record)

    def formatStack(self, stack_info):
        """
        This method is provided as an extension point for specialized
        formatting of stack information.

        The input data is a string as returned from a call to
        :func:`traceback.print_stack`, but with the last trailing newline
        removed.

        The base implementation just returns the value passed in.
        """
        return stack_info

    def format(self, record):
        """
        Format the specified record as text.

        The record's attribute dictionary is used as the operand to a
        string formatting operation which yields the returned string.
        Before formatting the dictionary, a couple of preparatory steps
        are carried out. The message attribute of the record is computed
        using LogRecord.getMessage(). If the formatting string uses the
        time (as determined by a call to usesTime(), formatTime() is
        called to format the event time. If there is exception information,
        it is formatted using formatException() and appended to the message.
        """
        record.message = record.getMessage()
        if self.usesTime():
            record.asctime = self.formatTime(record, self.datefmt)
        s = self.formatMessage(record)
        if record.exc_info:
            # Cache the traceback text to avoid converting it multiple times
            # (it's constant anyway)
            if not record.exc_text:
                record.exc_text = self.formatException(record.exc_info)
        if record.exc_text:
            if s[-1:] != "\n":
                s = s + "\n"
            s = s + record.exc_text
        if record.stack_info:
            if s[-1:] != "\n":
                s = s + "\n"
            s = s + self.formatStack(record.stack_info)
        return s

#
#   The default formatter to use when no other is specified
#
_defaultFormatter = Formatter()

class BufferingFormatter(object):
    """
    A formatter suitable for formatting a number of records.
    """
    def __init__(self, linefmt=None):
        """
        Optionally specify a formatter which will be used to format each
        individual record.
        """
        if linefmt:
            self.linefmt = linefmt
        else:
            self.linefmt = _defaultFormatter

    def formatHeader(self, records):
        """
        Return the header string for the specified records.
        """
        return ""

    def formatFooter(self, records):
        """
        Return the footer string for the specified records.
        """
        return ""

    def format(self, records):
        """
        Format the specified records and return the result as a string.
        """
        rv = ""
        if len(records) > 0:
            rv = rv + self.formatHeader(records)
            for record in records:
                rv = rv + self.linefmt.format(record)
            rv = rv + self.formatFooter(records)
        return rv

#---------------------------------------------------------------------------
#   Filter classes and functions
#---------------------------------------------------------------------------

class Filter(object):
    """
    Filter instances are used to perform arbitrary filtering of LogRecords.

    Loggers and Handlers can optionally use Filter instances to filter
    records as desired. The base filter class only allows events which are
    below a certain point in the logger hierarchy. For example, a filter
    initialized with "A.B" will allow events logged by loggers "A.B",
    "A.B.C", "A.B.C.D", "A.B.D" etc. but not "A.BB", "B.A.B" etc. If
    initialized with the empty string, all events are passed.
    """
    def __init__(self, name=''):
        """
        Initialize a filter.

        Initialize with the name of the logger which, together with its
        children, will have its events allowed through the filter. If no
        name is specified, allow every event.
        """
        self.name = name
        self.nlen = len(name)

    def filter(self, record):
        """
        Determine if the specified record is to be logged.

        Returns True if the record should be logged, or False otherwise.
        If deemed appropriate, the record may be modified in-place.
        """
        if self.nlen == 0:
            return True
        elif self.name == record.name:
            return True
        elif record.name.find(self.name, 0, self.nlen) != 0:
            return False
        return (record.name[self.nlen] == ".")

class Filterer(object):
    """
    A base class for loggers and handlers which allows them to share
    common code.
    """
    def __init__(self):
        """
        Initialize the list of filters to be an empty list.
        """
        self.filters = []

    def addFilter(self, filter):
        """
        Add the specified filter to this handler.
        """
        if not (filter in self.filters):
            self.filters.append(filter)

    def removeFilter(self, filter):
        """
        Remove the specified filter from this handler.
        """
        if filter in self.filters:
            self.filters.remove(filter)

    def filter(self, record):
        """
        Determine if a record is loggable by consulting all the filters.

        The default is to allow the record to be logged; any filter can veto
        this and the record is then dropped. Returns a zero value if a record
        is to be dropped, else non-zero.

        .. versionchanged:: 3.2

           Allow filters to be just callables.
        """
        rv = True
        for f in self.filters:
            if hasattr(f, 'filter'):
                result = f.filter(record)
            else:
                result = f(record) # assume callable - will raise if not
            if not result:
                rv = False
                break
        return rv

#---------------------------------------------------------------------------
#   Handler classes and functions
#---------------------------------------------------------------------------

_handlers = weakref.WeakValueDictionary()  #map of handler names to handlers
_handlerList = [] # added to allow handlers to be removed in reverse of order initialized

def _removeHandlerRef(wr):
    """
    Remove a handler reference from the internal cleanup list.
    """
    # This function can be called during module teardown, when globals are
    # set to None. It can also be called from another thread. So we need to
    # pre-emptively grab the necessary globals and check if they're None,
    # to prevent race conditions and failures during interpreter shutdown.
    acquire, release, handlers = _acquireLock, _releaseLock, _handlerList
    if acquire and release and handlers:
        acquire()
        try:
            if wr in handlers:
                handlers.remove(wr)
        finally:
            release()

def _addHandlerRef(handler):
    """
    Add a handler to the internal cleanup list using a weak reference.
    """
    _acquireLock()
    try:
        _handlerList.append(weakref.ref(handler, _removeHandlerRef))
    finally:
        _releaseLock()

class Handler(Filterer):
    """
    Handler instances dispatch logging events to specific destinations.

    The base handler class. Acts as a placeholder which defines the Handler
    interface. Handlers can optionally use Formatter instances to format
    records as desired. By default, no formatter is specified; in this case,
    the 'raw' message as determined by record.message is logged.
    """
    def __init__(self, level=NOTSET):
        """
        Initializes the instance - basically setting the formatter to None
        and the filter list to empty.
        """
        Filterer.__init__(self)
        self._name = None
        self.level = _checkLevel(level)
        self.formatter = None
        # Add the handler to the global _handlerList (for cleanup on shutdown)
        _addHandlerRef(self)
        self.createLock()

    def get_name(self):
        return self._name

    def set_name(self, name):
        _acquireLock()
        try:
            if self._name in _handlers:
                del _handlers[self._name]
            self._name = name
            if name:
                _handlers[name] = self
        finally:
            _releaseLock()

    name = property(get_name, set_name)

    def createLock(self):
        """
        Acquire a thread lock for serializing access to the underlying I/O.
        """
        self.lock = threading.RLock()
        _register_at_fork_reinit_lock(self)

    def acquire(self):
        """
        Acquire the I/O thread lock.
        """
        if self.lock:
            self.lock.acquire()

    def release(self):
        """
        Release the I/O thread lock.
        """
        if self.lock:
            self.lock.release()

    def setLevel(self, level):
        """
        Set the logging level of this handler.  level must be an int or a str.
        """
        self.level = _checkLevel(level)

    def format(self, record):
        """
        Format the specified record.

        If a formatter is set, use it. Otherwise, use the default formatter
        for the module.
        """
        if self.formatter:
            fmt = self.formatter
        else:
            fmt = _defaultFormatter
        return fmt.format(record)

    def emit(self, record):
        """
        Do whatever it takes to actually log the specified logging record.

        This version is intended to be implemented by subclasses and so
        raises a NotImplementedError.
        """
        raise NotImplementedError('emit must be implemented '
                                  'by Handler subclasses')

    def handle(self, record):
        """
        Conditionally emit the specified logging record.

        Emission depends on filters which may have been added to the handler.
        Wrap the actual emission of the record with acquisition/release of
        the I/O thread lock. Returns whether the filter passed the record for
        emission.
        """
        rv = self.filter(record)
        if rv:
            self.acquire()
            try:
                self.emit(record)
            finally:
                self.release()
        return rv

    def setFormatter(self, fmt):
        """
        Set the formatter for this handler.
        """
        self.formatter = fmt

    def flush(self):
        """
        Ensure all logging output has been flushed.

        This version does nothing and is intended to be implemented by
        subclasses.
        """
        pass

    def close(self):
        """
        Tidy up any resources used by the handler.

        This version removes the handler from an internal map of handlers,
        _handlers, which is used for handler lookup by name. Subclasses
        should ensure that this gets called from overridden close()
        methods.
        """
        #get the module data lock, as we're updating a shared structure.
        _acquireLock()
        try:    #unlikely to raise an exception, but you never know...
            if self._name and self._name in _handlers:
                del _handlers[self._name]
        finally:
            _releaseLock()

    def handleError(self, record):
        """
        Handle errors which occur during an emit() call.

        This method should be called from handlers when an exception is
        encountered during an emit() call. If raiseExceptions is false,
        exceptions get silently ignored. This is what is mostly wanted
        for a logging system - most users will not care about errors in
        the logging system, they are more interested in application errors.
        You could, however, replace this with a custom handler if you wish.
        The record which was being processed is passed in to this method.
        """
        if raiseExceptions and sys.stderr:  # see issue 13807
            t, v, tb = sys.exc_info()
            try:
                sys.stderr.write('--- Logging error ---\n')
                traceback.print_exception(t, v, tb, None, sys.stderr)
                sys.stderr.write('Call stack:\n')
                # Walk the stack frame up until we're out of logging,
                # so as to print the calling context.
                frame = tb.tb_frame
                while (frame and os.path.dirname(frame.f_code.co_filename) ==
                       __path__[0]):
                    frame = frame.f_back
                if frame:
                    traceback.print_stack(frame, file=sys.stderr)
                else:
                    # couldn't find the right stack frame, for some reason
                    sys.stderr.write('Logged from file %s, line %s\n' % (
                                     record.filename, record.lineno))
                # Issue 18671: output logging message and arguments
                try:
                    sys.stderr.write('Message: %r\n'
                                     'Arguments: %s\n' % (record.msg,
                                                          record.args))
                except RecursionError:  # See issue 36272
                    raise
                except Exception:
                    sys.stderr.write('Unable to print the message and arguments'
                                     ' - possible formatting error.\nUse the'
                                     ' traceback above to help find the error.\n'
                                    )
            except OSError: #pragma: no cover
                pass    # see issue 5971
            finally:
                del t, v, tb

    def __repr__(self):
        level = getLevelName(self.level)
        return '<%s (%s)>' % (self.__class__.__name__, level)

class StreamHandler(Handler):
    """
    A handler class which writes logging records, appropriately formatted,
    to a stream. Note that this class does not close the stream, as
    sys.stdout or sys.stderr may be used.
    """

    terminator = '\n'

    def __init__(self, stream=None):
        """
        Initialize the handler.

        If stream is not specified, sys.stderr is used.
        """
        Handler.__init__(self)
        if stream is None:
            stream = sys.stderr
        self.stream = stream

    def flush(self):
        """
        Flushes the stream.
        """
        self.acquire()
        try:
            if self.stream and hasattr(self.stream, "flush"):
                self.stream.flush()
        finally:
            self.release()

    def emit(self, record):
        """
        Emit a record.

        If a formatter is specified, it is used to format the record.
        The record is then written to the stream with a trailing newline.  If
        exception information is present, it is formatted using
        traceback.print_exception and appended to the stream.  If the stream
        has an 'encoding' attribute, it is used to determine how to do the
        output to the stream.
        """
        try:
            msg = self.format(record)
            stream = self.stream
            # issue 35046: merged two stream.writes into one.
            stream.write(msg + self.terminator)
            self.flush()
        except RecursionError:  # See issue 36272
            raise
        except Exception:
            self.handleError(record)

    def setStream(self, stream):
        """
        Sets the StreamHandler's stream to the specified value,
        if it is different.

        Returns the old stream, if the stream was changed, or None
        if it wasn't.
        """
        if stream is self.stream:
            result = None
        else:
            result = self.stream
            self.acquire()
            try:
                self.flush()
                self.stream = stream
            finally:
                self.release()
        return result

    def __repr__(self):
        level = getLevelName(self.level)
        name = getattr(self.stream, 'name', '')
        #  bpo-36015: name can be an int
        name = str(name)
        if name:
            name += ' '
        return '<%s %s(%s)>' % (self.__class__.__name__, name, level)


class FileHandler(StreamHandler):
    """
    A handler class which writes formatted logging records to disk files.
    """
    def __init__(self, filename, mode='a', encoding=None, delay=False):
        """
        Open the specified file and use it as the stream for logging.
        """
        # Issue #27493: add support for Path objects to be passed in
        filename = os.fspath(filename)
        #keep the absolute path, otherwise derived classes which use this
        #may come a cropper when the current directory changes
        self.baseFilename = os.path.abspath(filename)
        self.mode = mode
        self.encoding = encoding
        self.delay = delay
        if delay:
            #We don't open the stream, but we still need to call the
            #Handler constructor to set level, formatter, lock etc.
            Handler.__init__(self)
            self.stream = None
        else:
            StreamHandler.__init__(self, self._open())

    def close(self):
        """
        Closes the stream.
        """
        self.acquire()
        try:
            try:
                if self.stream:
                    try:
                        self.flush()
                    finally:
                        stream = self.stream
                        self.stream = None
                        if hasattr(stream, "close"):
                            stream.close()
            finally:
                # Issue #19523: call unconditionally to
                # prevent a handler leak when delay is set
                StreamHandler.close(self)
        finally:
            self.release()

    def _open(self):
        """
        Open the current base file with the (original) mode and encoding.
        Return the resulting stream.
        """
        return open(self.baseFilename, self.mode, encoding=self.encoding)

    def emit(self, record):
        """
        Emit a record.

        If the stream was not opened because 'delay' was specified in the
        constructor, open it before calling the superclass's emit.
        """
        if self.stream is None:
            self.stream = self._open()
        StreamHandler.emit(self, record)

    def __repr__(self):
        level = getLevelName(self.level)
        return '<%s %s (%s)>' % (self.__class__.__name__, self.baseFilename, level)


class _StderrHandler(StreamHandler):
    """
    This class is like a StreamHandler using sys.stderr, but always uses
    whatever sys.stderr is currently set to rather than the value of
    sys.stderr at handler construction time.
    """
    def __init__(self, level=NOTSET):
        """
        Initialize the handler.
        """
        Handler.__init__(self, level)

    @property
    def stream(self):
        return sys.stderr


_defaultLastResort = _StderrHandler(WARNING)
lastResort = _defaultLastResort

#---------------------------------------------------------------------------
#   Manager classes and functions
#---------------------------------------------------------------------------

class PlaceHolder(object):
    """
    PlaceHolder instances are used in the Manager logger hierarchy to take
    the place of nodes for which no loggers have been defined. This class is
    intended for internal use only and not as part of the public API.
    """
    def __init__(self, alogger):
        """
        Initialize with the specified logger being a child of this placeholder.
        """
        self.loggerMap = { alogger : None }

    def append(self, alogger):
        """
        Add the specified logger as a child of this placeholder.
        """
        if alogger not in self.loggerMap:
            self.loggerMap[alogger] = None

#
#   Determine which class to use when instantiating loggers.
#

def setLoggerClass(klass):
    """
    Set the class to be used when instantiating a logger. The class should
    define __init__() such that only a name argument is required, and the
    __init__() should call Logger.__init__()
    """
    if klass != Logger:
        if not issubclass(klass, Logger):
            raise TypeError("logger not derived from logging.Logger: "
                            + klass.__name__)
    global _loggerClass
    _loggerClass = klass

def getLoggerClass():
    """
    Return the class to be used when instantiating a logger.
    """
    return _loggerClass

class Manager(object):
    """
    There is [under normal circumstances] just one Manager instance, which
    holds the hierarchy of loggers.
    """
    def __init__(self, rootnode):
        """
        Initialize the manager with the root node of the logger hierarchy.
        """
        self.root = rootnode
        self.disable = 0
        self.emittedNoHandlerWarning = False
        self.loggerDict = {}
        self.loggerClass = None
        self.logRecordFactory = None

    @property
    def disable(self):
        return self._disable

    @disable.setter
    def disable(self, value):
        self._disable = _checkLevel(value)

    def getLogger(self, name):
        """
        Get a logger with the specified name (channel name), creating it
        if it doesn't yet exist. This name is a dot-separated hierarchical
        name, such as "a", "a.b", "a.b.c" or similar.

        If a PlaceHolder existed for the specified name [i.e. the logger
        didn't exist but a child of it did], replace it with the created
        logger and fix up the parent/child references which pointed to the
        placeholder to now point to the logger.
        """
        rv = None
        if not isinstance(name, str):
            raise TypeError('A logger name must be a string')
        _acquireLock()
        try:
            if name in self.loggerDict:
                rv = self.loggerDict[name]
                if isinstance(rv, PlaceHolder):
                    ph = rv
                    rv = (self.loggerClass or _loggerClass)(name)
                    rv.manager = self
                    self.loggerDict[name] = rv
                    self._fixupChildren(ph, rv)
                    self._fixupParents(rv)
            else:
                rv = (self.loggerClass or _loggerClass)(name)
                rv.manager = self
                self.loggerDict[name] = rv
                self._fixupParents(rv)
        finally:
            _releaseLock()
        return rv

    def setLoggerClass(self, klass):
        """
        Set the class to be used when instantiating a logger with this Manager.
        """
        if klass != Logger:
            if not issubclass(klass, Logger):
                raise TypeError("logger not derived from logging.Logger: "
                                + klass.__name__)
        self.loggerClass = klass

    def setLogRecordFactory(self, factory):
        """
        Set the factory to be used when instantiating a log record with this
        Manager.
        """
        self.logRecordFactory = factory

    def _fixupParents(self, alogger):
        """
        Ensure that there are either loggers or placeholders all the way
        from the specified logger to the root of the logger hierarchy.
        """
        name = alogger.name
        i = name.rfind(".")
        rv = None
        while (i > 0) and not rv:
            substr = name[:i]
            if substr not in self.loggerDict:
                self.loggerDict[substr] = PlaceHolder(alogger)
            else:
                obj = self.loggerDict[substr]
                if isinstance(obj, Logger):
                    rv = obj
                else:
                    assert isinstance(obj, PlaceHolder)
                    obj.append(alogger)
            i = name.rfind(".", 0, i - 1)
        if not rv:
            rv = self.root
        alogger.parent = rv

    def _fixupChildren(self, ph, alogger):
        """
        Ensure that children of the placeholder ph are connected to the
        specified logger.
        """
        name = alogger.name
        namelen = len(name)
        for c in ph.loggerMap.keys():
            #The if means ... if not c.parent.name.startswith(nm)
            if c.parent.name[:namelen] != name:
                alogger.parent = c.parent
                c.parent = alogger

    def _clear_cache(self):
        """
        Clear the cache for all loggers in loggerDict
        Called when level changes are made
        """

        _acquireLock()
        for logger in self.loggerDict.values():
            if isinstance(logger, Logger):
                logger._cache.clear()
        self.root._cache.clear()
        _releaseLock()

#---------------------------------------------------------------------------
#   Logger classes and functions
#---------------------------------------------------------------------------

class Logger(Filterer):
    """
    Instances of the Logger class represent a single logging channel. A
    "logging channel" indicates an area of an application. Exactly how an
    "area" is defined is up to the application developer. Since an
    application can have any number of areas, logging channels are identified
    by a unique string. Application areas can be nested (e.g. an area
    of "input processing" might include sub-areas "read CSV files", "read
    XLS files" and "read Gnumeric files"). To cater for this natural nesting,
    channel names are organized into a namespace hierarchy where levels are
    separated by periods, much like the Java or Python package namespace. So
    in the instance given above, channel names might be "input" for the upper
    level, and "input.csv", "input.xls" and "input.gnu" for the sub-levels.
    There is no arbitrary limit to the depth of nesting.
    """
    def __init__(self, name, level=NOTSET):
        """
        Initialize the logger with a name and an optional level.
        """
        Filterer.__init__(self)
        self.name = name
        self.level = _checkLevel(level)
        self.parent = None
        self.propagate = True
        self.handlers = []
        self.disabled = False
        self._cache = {}

    def setLevel(self, level):
        """
        Set the logging level of this logger.  level must be an int or a str.
        """
        self.level = _checkLevel(level)
        self.manager._clear_cache()

    def debug(self, msg, *args, **kwargs):
        """
        Log 'msg % args' with severity 'DEBUG'.

        To pass exception information, use the keyword argument exc_info with
        a true value, e.g.

        logger.debug("Houston, we have a %s", "thorny problem", exc_info=1)
        """
        if self.isEnabledFor(DEBUG):
            self._log(DEBUG, msg, args, **kwargs)

    def info(self, msg, *args, **kwargs):
        """
        Log 'msg % args' with severity 'INFO'.

        To pass exception information, use the keyword argument exc_info with
        a true value, e.g.

        logger.info("Houston, we have a %s", "interesting problem", exc_info=1)
        """
        if self.isEnabledFor(INFO):
            self._log(INFO, msg, args, **kwargs)

    def warning(self, msg, *args, **kwargs):
        """
        Log 'msg % args' with severity 'WARNING'.

        To pass exception information, use the keyword argument exc_info with
        a true value, e.g.

        logger.warning("Houston, we have a %s", "bit of a problem", exc_info=1)
        """
        if self.isEnabledFor(WARNING):
            self._log(WARNING, msg, args, **kwargs)

    def warn(self, msg, *args, **kwargs):
        warnings.warn("The 'warn' method is deprecated, "
            "use 'warning' instead", DeprecationWarning, 2)
        self.warning(msg, *args, **kwargs)

    def error(self, msg, *args, **kwargs):
        """
        Log 'msg % args' with severity 'ERROR'.

        To pass exception information, use the keyword argument exc_info with
        a true value, e.g.

        logger.error("Houston, we have a %s", "major problem", exc_info=1)
        """
        if self.isEnabledFor(ERROR):
            self._log(ERROR, msg, args, **kwargs)

    def exception(self, msg, *args, exc_info=True, **kwargs):
        """
        Convenience method for logging an ERROR with exception information.
        """
        self.error(msg, *args, exc_info=exc_info, **kwargs)

    def critical(self, msg, *args, **kwargs):
        """
        Log 'msg % args' with severity 'CRITICAL'.

        To pass exception information, use the keyword argument exc_info with
        a true value, e.g.

        logger.critical("Houston, we have a %s", "major disaster", exc_info=1)
        """
        if self.isEnabledFor(CRITICAL):
            self._log(CRITICAL, msg, args, **kwargs)

    fatal = critical

    def log(self, level, msg, *args, **kwargs):
        """
        Log 'msg % args' with the integer severity 'level'.

        To pass exception information, use the keyword argument exc_info with
        a true value, e.g.

        logger.log(level, "We have a %s", "mysterious problem", exc_info=1)
        """
        if not isinstance(level, int):
            if raiseExceptions:
                raise TypeError("level must be an integer")
            else:
                return
        if self.isEnabledFor(level):
            self._log(level, msg, args, **kwargs)

    def findCaller(self, stack_info=False, stacklevel=1):
        """
        Find the stack frame of the caller so that we can note the source
        file name, line number and function name.
        """
        f = currentframe()
        #On some versions of IronPython, currentframe() returns None if
        #IronPython isn't run with -X:Frames.
        if f is not None:
            f = f.f_back
        orig_f = f
        while f and stacklevel > 1:
            f = f.f_back
            stacklevel -= 1
        if not f:
            f = orig_f
        rv = "(unknown file)", 0, "(unknown function)", None
        while hasattr(f, "f_code"):
            co = f.f_code
            filename = os.path.normcase(co.co_filename)
            if filename == _srcfile:
                f = f.f_back
                continue
            sinfo = None
            if stack_info:
                sio = io.StringIO()
                sio.write('Stack (most recent call last):\n')
                traceback.print_stack(f, file=sio)
                sinfo = sio.getvalue()
                if sinfo[-1] == '\n':
                    sinfo = sinfo[:-1]
                sio.close()
            rv = (co.co_filename, f.f_lineno, co.co_name, sinfo)
            break
        return rv

    def makeRecord(self, name, level, fn, lno, msg, args, exc_info,
                   func=None, extra=None, sinfo=None):
        """
        A factory method which can be overridden in subclasses to create
        specialized LogRecords.
        """
        rv = _logRecordFactory(name, level, fn, lno, msg, args, exc_info, func,
                             sinfo)
        if extra is not None:
            for key in extra:
                if (key in ["message", "asctime"]) or (key in rv.__dict__):
                    raise KeyError("Attempt to overwrite %r in LogRecord" % key)
                rv.__dict__[key] = extra[key]
        return rv

    def _log(self, level, msg, args, exc_info=None, extra=None, stack_info=False,
             stacklevel=1):
        """
        Low-level logging routine which creates a LogRecord and then calls
        all the handlers of this logger to handle the record.
        """
        sinfo = None
        if _srcfile:
            #IronPython doesn't track Python frames, so findCaller raises an
            #exception on some versions of IronPython. We trap it here so that
            #IronPython can use logging.
            try:
                fn, lno, func, sinfo = self.findCaller(stack_info, stacklevel)
            except ValueError: # pragma: no cover
                fn, lno, func = "(unknown file)", 0, "(unknown function)"
        else: # pragma: no cover
            fn, lno, func = "(unknown file)", 0, "(unknown function)"
        if exc_info:
            if isinstance(exc_info, BaseException):
                exc_info = (type(exc_info), exc_info, exc_info.__traceback__)
            elif not isinstance(exc_info, tuple):
                exc_info = sys.exc_info()
        record = self.makeRecord(self.name, level, fn, lno, msg, args,
                                 exc_info, func, extra, sinfo)
        self.handle(record)

    def handle(self, record):
        """
        Call the handlers for the specified record.

        This method is used for unpickled records received from a socket, as
        well as those created locally. Logger-level filtering is applied.
        """
        if (not self.disabled) and self.filter(record):
            self.callHandlers(record)

    def addHandler(self, hdlr):
        """
        Add the specified handler to this logger.
        """
        _acquireLock()
        try:
            if not (hdlr in self.handlers):
                self.handlers.append(hdlr)
        finally:
            _releaseLock()

    def removeHandler(self, hdlr):
        """
        Remove the specified handler from this logger.
        """
        _acquireLock()
        try:
            if hdlr in self.handlers:
                self.handlers.remove(hdlr)
        finally:
            _releaseLock()

    def hasHandlers(self):
        """
        See if this logger has any handlers configured.

        Loop through all handlers for this logger and its parents in the
        logger hierarchy. Return True if a handler was found, else False.
        Stop searching up the hierarchy whenever a logger with the "propagate"
        attribute set to zero is found - that will be the last logger which
        is checked for the existence of handlers.
        """
        c = self
        rv = False
        while c:
            if c.handlers:
                rv = True
                break
            if not c.propagate:
                break
            else:
                c = c.parent
        return rv

    def callHandlers(self, record):
        """
        Pass a record to all relevant handlers.

        Loop through all handlers for this logger and its parents in the
        logger hierarchy. If no handler was found, output a one-off error
        message to sys.stderr. Stop searching up the hierarchy whenever a
        logger with the "propagate" attribute set to zero is found - that
        will be the last logger whose handlers are called.
        """
        c = self
        found = 0
        while c:
            for hdlr in c.handlers:
                found = found + 1
                if record.levelno >= hdlr.level:
                    hdlr.handle(record)
            if not c.propagate:
                c = None    #break out
            else:
                c = c.parent
        if (found == 0):
            if lastResort:
                if record.levelno >= lastResort.level:
                    lastResort.handle(record)
            elif raiseExceptions and not self.manager.emittedNoHandlerWarning:
                sys.stderr.write("No handlers could be found for logger"
                                 " \"%s\"\n" % self.name)
                self.manager.emittedNoHandlerWarning = True

    def getEffectiveLevel(self):
        """
        Get the effective level for this logger.

        Loop through this logger and its parents in the logger hierarchy,
        looking for a non-zero logging level. Return the first one found.
        """
        logger = self
        while logger:
            if logger.level:
                return logger.level
            logger = logger.parent
        return NOTSET

    def isEnabledFor(self, level):
        """
        Is this logger enabled for level 'level'?
        """
        if self.disabled:
            return False

        try:
            return self._cache[level]
        except KeyError:
            _acquireLock()
            try:
                if self.manager.disable >= level:
                    is_enabled = self._cache[level] = False
                else:
                    is_enabled = self._cache[level] = (
                        level >= self.getEffectiveLevel()
                    )
            finally:
                _releaseLock()
            return is_enabled

    def getChild(self, suffix):
        """
        Get a logger which is a descendant to this one.

        This is a convenience method, such that

        logging.getLogger('abc').getChild('def.ghi')

        is the same as

        logging.getLogger('abc.def.ghi')

        It's useful, for example, when the parent logger is named using
        __name__ rather than a literal string.
        """
        if self.root is not self:
            suffix = '.'.join((self.name, suffix))
        return self.manager.getLogger(suffix)

    def __repr__(self):
        level = getLevelName(self.getEffectiveLevel())
        return '<%s %s (%s)>' % (self.__class__.__name__, self.name, level)

    def __reduce__(self):
        # In general, only the root logger will not be accessible via its name.
        # However, the root logger's class has its own __reduce__ method.
        if getLogger(self.name) is not self:
            import pickle
            raise pickle.PicklingError('logger cannot be pickled')
        return getLogger, (self.name,)


class RootLogger(Logger):
    """
    A root logger is not that different to any other logger, except that
    it must have a logging level and there is only one instance of it in
    the hierarchy.
    """
    def __init__(self, level):
        """
        Initialize the logger with the name "root".
        """
        Logger.__init__(self, "root", level)

    def __reduce__(self):
        return getLogger, ()

_loggerClass = Logger

class LoggerAdapter(object):
    """
    An adapter for loggers which makes it easier to specify contextual
    information in logging output.
    """

    def __init__(self, logger, extra):
        """
        Initialize the adapter with a logger and a dict-like object which
        provides contextual information. This constructor signature allows
        easy stacking of LoggerAdapters, if so desired.

        You can effectively pass keyword arguments as shown in the
        following example:

        adapter = LoggerAdapter(someLogger, dict(p1=v1, p2="v2"))
        """
        self.logger = logger
        self.extra = extra

    def process(self, msg, kwargs):
        """
        Process the logging message and keyword arguments passed in to
        a logging call to insert contextual information. You can either
        manipulate the message itself, the keyword args or both. Return
        the message and kwargs modified (or not) to suit your needs.

        Normally, you'll only need to override this one method in a
        LoggerAdapter subclass for your specific needs.
        """
        kwargs["extra"] = self.extra
        return msg, kwargs

    #
    # Boilerplate convenience methods
    #
    def debug(self, msg, *args, **kwargs):
        """
        Delegate a debug call to the underlying logger.
        """
        self.log(DEBUG, msg, *args, **kwargs)

    def info(self, msg, *args, **kwargs):
        """
        Delegate an info call to the underlying logger.
        """
        self.log(INFO, msg, *args, **kwargs)

    def warning(self, msg, *args, **kwargs):
        """
        Delegate a warning call to the underlying logger.
        """
        self.log(WARNING, msg, *args, **kwargs)

    def warn(self, msg, *args, **kwargs):
        warnings.warn("The 'warn' method is deprecated, "
            "use 'warning' instead", DeprecationWarning, 2)
        self.warning(msg, *args, **kwargs)

    def error(self, msg, *args, **kwargs):
        """
        Delegate an error call to the underlying logger.
        """
        self.log(ERROR, msg, *args, **kwargs)

    def exception(self, msg, *args, exc_info=True, **kwargs):
        """
        Delegate an exception call to the underlying logger.
        """
        self.log(ERROR, msg, *args, exc_info=exc_info, **kwargs)

    def critical(self, msg, *args, **kwargs):
        """
        Delegate a critical call to the underlying logger.
        """
        self.log(CRITICAL, msg, *args, **kwargs)

    def log(self, level, msg, *args, **kwargs):
        """
        Delegate a log call to the underlying logger, after adding
        contextual information from this adapter instance.
        """
        if self.isEnabledFor(level):
            msg, kwargs = self.process(msg, kwargs)
            self.logger.log(level, msg, *args, **kwargs)

    def isEnabledFor(self, level):
        """
        Is this logger enabled for level 'level'?
        """
        return self.logger.isEnabledFor(level)

    def setLevel(self, level):
        """
        Set the specified level on the underlying logger.
        """
        self.logger.setLevel(level)

    def getEffectiveLevel(self):
        """
        Get the effective level for the underlying logger.
        """
        return self.logger.getEffectiveLevel()

    def hasHandlers(self):
        """
        See if the underlying logger has any handlers.
        """
        return self.logger.hasHandlers()

    def _log(self, level, msg, args, exc_info=None, extra=None, stack_info=False):
        """
        Low-level log implementation, proxied to allow nested logger adapters.
        """
        return self.logger._log(
            level,
            msg,
            args,
            exc_info=exc_info,
            extra=extra,
            stack_info=stack_info,
        )

    @property
    def manager(self):
        return self.logger.manager

    @manager.setter
    def manager(self, value):
        self.logger.manager = value

    @property
    def name(self):
        return self.logger.name

    def __repr__(self):
        logger = self.logger
        level = getLevelName(logger.getEffectiveLevel())
        return '<%s %s (%s)>' % (self.__class__.__name__, logger.name, level)

root = RootLogger(WARNING)
Logger.root = root
Logger.manager = Manager(Logger.root)

#---------------------------------------------------------------------------
# Configuration classes and functions
#---------------------------------------------------------------------------

def basicConfig(**kwargs):
    """
    Do basic configuration for the logging system.

    This function does nothing if the root logger already has handlers
    configured, unless the keyword argument *force* is set to ``True``.
    It is a convenience method intended for use by simple scripts
    to do one-shot configuration of the logging package.

    The default behaviour is to create a StreamHandler which writes to
    sys.stderr, set a formatter using the BASIC_FORMAT format string, and
    add the handler to the root logger.

    A number of optional keyword arguments may be specified, which can alter
    the default behaviour.

    filename  Specifies that a FileHandler be created, using the specified
              filename, rather than a StreamHandler.
    filemode  Specifies the mode to open the file, if filename is specified
              (if filemode is unspecified, it defaults to 'a').
    format    Use the specified format string for the handler.
    datefmt   Use the specified date/time format.
    style     If a format string is specified, use this to specify the
              type of format string (possible values '%', '{', '$', for
              %-formatting, :meth:`str.format` and :class:`string.Template`
              - defaults to '%').
    level     Set the root logger level to the specified level.
    stream    Use the specified stream to initialize the StreamHandler. Note
              that this argument is incompatible with 'filename' - if both
              are present, 'stream' is ignored.
    handlers  If specified, this should be an iterable of already created
              handlers, which will be added to the root handler. Any handler
              in the list which does not have a formatter assigned will be
              assigned the formatter created in this function.
    force     If this keyword  is specified as true, any existing handlers
              attached to the root logger are removed and closed, before
              carrying out the configuration as specified by the other
              arguments.
    Note that you could specify a stream created using open(filename, mode)
    rather than passing the filename and mode in. However, it should be
    remembered that StreamHandler does not close its stream (since it may be
    using sys.stdout or sys.stderr), whereas FileHandler closes its stream
    when the handler is closed.

    .. versionchanged:: 3.8
       Added the ``force`` parameter.

    .. versionchanged:: 3.2
       Added the ``style`` parameter.

    .. versionchanged:: 3.3
       Added the ``handlers`` parameter. A ``ValueError`` is now thrown for
       incompatible arguments (e.g. ``handlers`` specified together with
       ``filename``/``filemode``, or ``filename``/``filemode`` specified
       together with ``stream``, or ``handlers`` specified together with
       ``stream``.
    """
    # Add thread safety in case someone mistakenly calls
    # basicConfig() from multiple threads
    _acquireLock()
    try:
        force = kwargs.pop('force', False)
        if force:
            for h in root.handlers[:]:
                root.removeHandler(h)
                h.close()
        if len(root.handlers) == 0:
            handlers = kwargs.pop("handlers", None)
            if handlers is None:
                if "stream" in kwargs and "filename" in kwargs:
                    raise ValueError("'stream' and 'filename' should not be "
                                     "specified together")
            else:
                if "stream" in kwargs or "filename" in kwargs:
                    raise ValueError("'stream' or 'filename' should not be "
                                     "specified together with 'handlers'")
            if handlers is None:
                filename = kwargs.pop("filename", None)
                mode = kwargs.pop("filemode", 'a')
                if filename:
                    h = FileHandler(filename, mode)
                else:
                    stream = kwargs.pop("stream", None)
                    h = StreamHandler(stream)
                handlers = [h]
            dfs = kwargs.pop("datefmt", None)
            style = kwargs.pop("style", '%')
            if style not in _STYLES:
                raise ValueError('Style must be one of: %s' % ','.join(
                                 _STYLES.keys()))
            fs = kwargs.pop("format", _STYLES[style][1])
            fmt = Formatter(fs, dfs, style)
            for h in handlers:
                if h.formatter is None:
                    h.setFormatter(fmt)
                root.addHandler(h)
            level = kwargs.pop("level", None)
            if level is not None:
                root.setLevel(level)
            if kwargs:
                keys = ', '.join(kwargs.keys())
                raise ValueError('Unrecognised argument(s): %s' % keys)
    finally:
        _releaseLock()

#---------------------------------------------------------------------------
# Utility functions at module level.
# Basically delegate everything to the root logger.
#---------------------------------------------------------------------------

def getLogger(name=None):
    """
    Return a logger with the specified name, creating it if necessary.

    If no name is specified, return the root logger.
    """
    if name:
        return Logger.manager.getLogger(name)
    else:
        return root

def critical(msg, *args, **kwargs):
    """
    Log a message with severity 'CRITICAL' on the root logger. If the logger
    has no handlers, call basicConfig() to add a console handler with a
    pre-defined format.
    """
    if len(root.handlers) == 0:
        basicConfig()
    root.critical(msg, *args, **kwargs)

fatal = critical

def error(msg, *args, **kwargs):
    """
    Log a message with severity 'ERROR' on the root logger. If the logger has
    no handlers, call basicConfig() to add a console handler with a pre-defined
    format.
    """
    if len(root.handlers) == 0:
        basicConfig()
    root.error(msg, *args, **kwargs)

def exception(msg, *args, exc_info=True, **kwargs):
    """
    Log a message with severity 'ERROR' on the root logger, with exception
    information. If the logger has no handlers, basicConfig() is called to add
    a console handler with a pre-defined format.
    """
    error(msg, *args, exc_info=exc_info, **kwargs)

def warning(msg, *args, **kwargs):
    """
    Log a message with severity 'WARNING' on the root logger. If the logger has
    no handlers, call basicConfig() to add a console handler with a pre-defined
    format.
    """
    if len(root.handlers) == 0:
        basicConfig()
    root.warning(msg, *args, **kwargs)

def warn(msg, *args, **kwargs):
    warnings.warn("The 'warn' function is deprecated, "
        "use 'warning' instead", DeprecationWarning, 2)
    warning(msg, *args, **kwargs)

def info(msg, *args, **kwargs):
    """
    Log a message with severity 'INFO' on the root logger. If the logger has
    no handlers, call basicConfig() to add a console handler with a pre-defined
    format.
    """
    if len(root.handlers) == 0:
        basicConfig()
    root.info(msg, *args, **kwargs)

def debug(msg, *args, **kwargs):
    """
    Log a message with severity 'DEBUG' on the root logger. If the logger has
    no handlers, call basicConfig() to add a console handler with a pre-defined
    format.
    """
    if len(root.handlers) == 0:
        basicConfig()
    root.debug(msg, *args, **kwargs)

def log(level, msg, *args, **kwargs):
    """
    Log 'msg % args' with the integer severity 'level' on the root logger. If
    the logger has no handlers, call basicConfig() to add a console handler
    with a pre-defined format.
    """
    if len(root.handlers) == 0:
        basicConfig()
    root.log(level, msg, *args, **kwargs)

def disable(level=CRITICAL):
    """
    Disable all logging calls of severity 'level' and below.
    """
    root.manager.disable = level
    root.manager._clear_cache()

def shutdown(handlerList=_handlerList):
    """
    Perform any cleanup actions in the logging system (e.g. flushing
    buffers).

    Should be called at application exit.
    """
    for wr in reversed(handlerList[:]):
        #errors might occur, for example, if files are locked
        #we just ignore them if raiseExceptions is not set
        try:
            h = wr()
            if h:
                try:
                    h.acquire()
                    h.flush()
                    h.close()
                except (OSError, ValueError):
                    # Ignore errors which might be caused
                    # because handlers have been closed but
                    # references to them are still around at
                    # application exit.
                    pass
                finally:
                    h.release()
        except: # ignore everything, as we're shutting down
            if raiseExceptions:
                raise
            #else, swallow

#Let's try and shutdown automatically on application exit...
import atexit
atexit.register(shutdown)

# Null handler

class NullHandler(Handler):
    """
    This handler does nothing. It's intended to be used to avoid the
    "No handlers could be found for logger XXX" one-off warning. This is
    important for library code, which may contain code to log events. If a user
    of the library does not configure logging, the one-off warning might be
    produced; to avoid this, the library developer simply needs to instantiate
    a NullHandler and add it to the top-level logger of the library module or
    package.
    """
    def handle(self, record):
        """Stub."""

    def emit(self, record):
        """Stub."""

    def createLock(self):
        self.lock = None

# Warnings integration

_warnings_showwarning = None

def _showwarning(message, category, filename, lineno, file=None, line=None):
    """
    Implementation of showwarnings which redirects to logging, which will first
    check to see if the file parameter is None. If a file is specified, it will
    delegate to the original warnings implementation of showwarning. Otherwise,
    it will call warnings.formatwarning and will log the resulting string to a
    warnings logger named "py.warnings" with level logging.WARNING.
    """
    if file is not None:
        if _warnings_showwarning is not None:
            _warnings_showwarning(message, category, filename, lineno, file, line)
    else:
        s = warnings.formatwarning(message, category, filename, lineno, line)
        logger = getLogger("py.warnings")
        if not logger.handlers:
            logger.addHandler(NullHandler())
        logger.warning("%s", s)

def captureWarnings(capture):
    """
    If capture is true, redirect all warnings to the logging package.
    If capture is False, ensure that warnings are not redirected to logging
    but to their original destinations.
    """
    global _warnings_showwarning
    if capture:
        if _warnings_showwarning is None:
            _warnings_showwarning = warnings.showwarning
            warnings.showwarning = _showwarning
    else:
        if _warnings_showwarning is not None:
            warnings.showwarning = _warnings_showwarning
            _warnings_showwarning = None
logging/handlers.py000064400000161161151153537450010363 0ustar00# Copyright 2001-2016 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permission notice appear in
# supporting documentation, and that the name of Vinay Sajip
# not be used in advertising or publicity pertaining to distribution
# of the software without specific, written prior permission.
# VINAY SAJIP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
# ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
# VINAY SAJIP BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
# ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
# IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

"""
Additional handlers for the logging package for Python. The core package is
based on PEP 282 and comments thereto in comp.lang.python.

Copyright (C) 2001-2016 Vinay Sajip. All Rights Reserved.

To use, simply 'import logging.handlers' and log away!
"""

import logging, socket, os, pickle, struct, time, re
from stat import ST_DEV, ST_INO, ST_MTIME
import queue
import threading
import copy

#
# Some constants...
#

DEFAULT_TCP_LOGGING_PORT    = 9020
DEFAULT_UDP_LOGGING_PORT    = 9021
DEFAULT_HTTP_LOGGING_PORT   = 9022
DEFAULT_SOAP_LOGGING_PORT   = 9023
SYSLOG_UDP_PORT             = 514
SYSLOG_TCP_PORT             = 514

_MIDNIGHT = 24 * 60 * 60  # number of seconds in a day

class BaseRotatingHandler(logging.FileHandler):
    """
    Base class for handlers that rotate log files at a certain point.
    Not meant to be instantiated directly.  Instead, use RotatingFileHandler
    or TimedRotatingFileHandler.
    """
    def __init__(self, filename, mode, encoding=None, delay=False):
        """
        Use the specified filename for streamed logging
        """
        logging.FileHandler.__init__(self, filename, mode, encoding, delay)
        self.mode = mode
        self.encoding = encoding
        self.namer = None
        self.rotator = None

    def emit(self, record):
        """
        Emit a record.

        Output the record to the file, catering for rollover as described
        in doRollover().
        """
        try:
            if self.shouldRollover(record):
                self.doRollover()
            logging.FileHandler.emit(self, record)
        except Exception:
            self.handleError(record)

    def rotation_filename(self, default_name):
        """
        Modify the filename of a log file when rotating.

        This is provided so that a custom filename can be provided.

        The default implementation calls the 'namer' attribute of the
        handler, if it's callable, passing the default name to
        it. If the attribute isn't callable (the default is None), the name
        is returned unchanged.

        :param default_name: The default name for the log file.
        """
        if not callable(self.namer):
            result = default_name
        else:
            result = self.namer(default_name)
        return result

    def rotate(self, source, dest):
        """
        When rotating, rotate the current log.

        The default implementation calls the 'rotator' attribute of the
        handler, if it's callable, passing the source and dest arguments to
        it. If the attribute isn't callable (the default is None), the source
        is simply renamed to the destination.

        :param source: The source filename. This is normally the base
                       filename, e.g. 'test.log'
        :param dest:   The destination filename. This is normally
                       what the source is rotated to, e.g. 'test.log.1'.
        """
        if not callable(self.rotator):
            # Issue 18940: A file may not have been created if delay is True.
            if os.path.exists(source):
                os.rename(source, dest)
        else:
            self.rotator(source, dest)

class RotatingFileHandler(BaseRotatingHandler):
    """
    Handler for logging to a set of files, which switches from one file
    to the next when the current file reaches a certain size.
    """
    def __init__(self, filename, mode='a', maxBytes=0, backupCount=0, encoding=None, delay=False):
        """
        Open the specified file and use it as the stream for logging.

        By default, the file grows indefinitely. You can specify particular
        values of maxBytes and backupCount to allow the file to rollover at
        a predetermined size.

        Rollover occurs whenever the current log file is nearly maxBytes in
        length. If backupCount is >= 1, the system will successively create
        new files with the same pathname as the base file, but with extensions
        ".1", ".2" etc. appended to it. For example, with a backupCount of 5
        and a base file name of "app.log", you would get "app.log",
        "app.log.1", "app.log.2", ... through to "app.log.5". The file being
        written to is always "app.log" - when it gets filled up, it is closed
        and renamed to "app.log.1", and if files "app.log.1", "app.log.2" etc.
        exist, then they are renamed to "app.log.2", "app.log.3" etc.
        respectively.

        If maxBytes is zero, rollover never occurs.
        """
        # If rotation/rollover is wanted, it doesn't make sense to use another
        # mode. If for example 'w' were specified, then if there were multiple
        # runs of the calling application, the logs from previous runs would be
        # lost if the 'w' is respected, because the log file would be truncated
        # on each run.
        if maxBytes > 0:
            mode = 'a'
        BaseRotatingHandler.__init__(self, filename, mode, encoding, delay)
        self.maxBytes = maxBytes
        self.backupCount = backupCount

    def doRollover(self):
        """
        Do a rollover, as described in __init__().
        """
        if self.stream:
            self.stream.close()
            self.stream = None
        if self.backupCount > 0:
            for i in range(self.backupCount - 1, 0, -1):
                sfn = self.rotation_filename("%s.%d" % (self.baseFilename, i))
                dfn = self.rotation_filename("%s.%d" % (self.baseFilename,
                                                        i + 1))
                if os.path.exists(sfn):
                    if os.path.exists(dfn):
                        os.remove(dfn)
                    os.rename(sfn, dfn)
            dfn = self.rotation_filename(self.baseFilename + ".1")
            if os.path.exists(dfn):
                os.remove(dfn)
            self.rotate(self.baseFilename, dfn)
        if not self.delay:
            self.stream = self._open()

    def shouldRollover(self, record):
        """
        Determine if rollover should occur.

        Basically, see if the supplied record would cause the file to exceed
        the size limit we have.
        """
        if self.stream is None:                 # delay was set...
            self.stream = self._open()
        if self.maxBytes > 0:                   # are we rolling over?
            msg = "%s\n" % self.format(record)
            self.stream.seek(0, 2)  #due to non-posix-compliant Windows feature
            if self.stream.tell() + len(msg) >= self.maxBytes:
                return 1
        return 0

class TimedRotatingFileHandler(BaseRotatingHandler):
    """
    Handler for logging to a file, rotating the log file at certain timed
    intervals.

    If backupCount is > 0, when rollover is done, no more than backupCount
    files are kept - the oldest ones are deleted.
    """
    def __init__(self, filename, when='h', interval=1, backupCount=0, encoding=None, delay=False, utc=False, atTime=None):
        BaseRotatingHandler.__init__(self, filename, 'a', encoding, delay)
        self.when = when.upper()
        self.backupCount = backupCount
        self.utc = utc
        self.atTime = atTime
        # Calculate the real rollover interval, which is just the number of
        # seconds between rollovers.  Also set the filename suffix used when
        # a rollover occurs.  Current 'when' events supported:
        # S - Seconds
        # M - Minutes
        # H - Hours
        # D - Days
        # midnight - roll over at midnight
        # W{0-6} - roll over on a certain day; 0 - Monday
        #
        # Case of the 'when' specifier is not important; lower or upper case
        # will work.
        if self.when == 'S':
            self.interval = 1 # one second
            self.suffix = "%Y-%m-%d_%H-%M-%S"
            self.extMatch = r"^\d{4}-\d{2}-\d{2}_\d{2}-\d{2}-\d{2}(\.\w+)?$"
        elif self.when == 'M':
            self.interval = 60 # one minute
            self.suffix = "%Y-%m-%d_%H-%M"
            self.extMatch = r"^\d{4}-\d{2}-\d{2}_\d{2}-\d{2}(\.\w+)?$"
        elif self.when == 'H':
            self.interval = 60 * 60 # one hour
            self.suffix = "%Y-%m-%d_%H"
            self.extMatch = r"^\d{4}-\d{2}-\d{2}_\d{2}(\.\w+)?$"
        elif self.when == 'D' or self.when == 'MIDNIGHT':
            self.interval = 60 * 60 * 24 # one day
            self.suffix = "%Y-%m-%d"
            self.extMatch = r"^\d{4}-\d{2}-\d{2}(\.\w+)?$"
        elif self.when.startswith('W'):
            self.interval = 60 * 60 * 24 * 7 # one week
            if len(self.when) != 2:
                raise ValueError("You must specify a day for weekly rollover from 0 to 6 (0 is Monday): %s" % self.when)
            if self.when[1] < '0' or self.when[1] > '6':
                raise ValueError("Invalid day specified for weekly rollover: %s" % self.when)
            self.dayOfWeek = int(self.when[1])
            self.suffix = "%Y-%m-%d"
            self.extMatch = r"^\d{4}-\d{2}-\d{2}(\.\w+)?$"
        else:
            raise ValueError("Invalid rollover interval specified: %s" % self.when)

        self.extMatch = re.compile(self.extMatch, re.ASCII)
        self.interval = self.interval * interval # multiply by units requested
        # The following line added because the filename passed in could be a
        # path object (see Issue #27493), but self.baseFilename will be a string
        filename = self.baseFilename
        if os.path.exists(filename):
            t = os.stat(filename)[ST_MTIME]
        else:
            t = int(time.time())
        self.rolloverAt = self.computeRollover(t)

    def computeRollover(self, currentTime):
        """
        Work out the rollover time based on the specified time.
        """
        result = currentTime + self.interval
        # If we are rolling over at midnight or weekly, then the interval is already known.
        # What we need to figure out is WHEN the next interval is.  In other words,
        # if you are rolling over at midnight, then your base interval is 1 day,
        # but you want to start that one day clock at midnight, not now.  So, we
        # have to fudge the rolloverAt value in order to trigger the first rollover
        # at the right time.  After that, the regular interval will take care of
        # the rest.  Note that this code doesn't care about leap seconds. :)
        if self.when == 'MIDNIGHT' or self.when.startswith('W'):
            # This could be done with less code, but I wanted it to be clear
            if self.utc:
                t = time.gmtime(currentTime)
            else:
                t = time.localtime(currentTime)
            currentHour = t[3]
            currentMinute = t[4]
            currentSecond = t[5]
            currentDay = t[6]
            # r is the number of seconds left between now and the next rotation
            if self.atTime is None:
                rotate_ts = _MIDNIGHT
            else:
                rotate_ts = ((self.atTime.hour * 60 + self.atTime.minute)*60 +
                    self.atTime.second)

            r = rotate_ts - ((currentHour * 60 + currentMinute) * 60 +
                currentSecond)
            if r < 0:
                # Rotate time is before the current time (for example when
                # self.rotateAt is 13:45 and it now 14:15), rotation is
                # tomorrow.
                r += _MIDNIGHT
                currentDay = (currentDay + 1) % 7
            result = currentTime + r
            # If we are rolling over on a certain day, add in the number of days until
            # the next rollover, but offset by 1 since we just calculated the time
            # until the next day starts.  There are three cases:
            # Case 1) The day to rollover is today; in this case, do nothing
            # Case 2) The day to rollover is further in the interval (i.e., today is
            #         day 2 (Wednesday) and rollover is on day 6 (Sunday).  Days to
            #         next rollover is simply 6 - 2 - 1, or 3.
            # Case 3) The day to rollover is behind us in the interval (i.e., today
            #         is day 5 (Saturday) and rollover is on day 3 (Thursday).
            #         Days to rollover is 6 - 5 + 3, or 4.  In this case, it's the
            #         number of days left in the current week (1) plus the number
            #         of days in the next week until the rollover day (3).
            # The calculations described in 2) and 3) above need to have a day added.
            # This is because the above time calculation takes us to midnight on this
            # day, i.e. the start of the next day.
            if self.when.startswith('W'):
                day = currentDay # 0 is Monday
                if day != self.dayOfWeek:
                    if day < self.dayOfWeek:
                        daysToWait = self.dayOfWeek - day
                    else:
                        daysToWait = 6 - day + self.dayOfWeek + 1
                    newRolloverAt = result + (daysToWait * (60 * 60 * 24))
                    if not self.utc:
                        dstNow = t[-1]
                        dstAtRollover = time.localtime(newRolloverAt)[-1]
                        if dstNow != dstAtRollover:
                            if not dstNow:  # DST kicks in before next rollover, so we need to deduct an hour
                                addend = -3600
                            else:           # DST bows out before next rollover, so we need to add an hour
                                addend = 3600
                            newRolloverAt += addend
                    result = newRolloverAt
        return result

    def shouldRollover(self, record):
        """
        Determine if rollover should occur.

        record is not used, as we are just comparing times, but it is needed so
        the method signatures are the same
        """
        t = int(time.time())
        if t >= self.rolloverAt:
            return 1
        return 0

    def getFilesToDelete(self):
        """
        Determine the files to delete when rolling over.

        More specific than the earlier method, which just used glob.glob().
        """
        dirName, baseName = os.path.split(self.baseFilename)
        fileNames = os.listdir(dirName)
        result = []
        prefix = baseName + "."
        plen = len(prefix)
        for fileName in fileNames:
            if fileName[:plen] == prefix:
                suffix = fileName[plen:]
                if self.extMatch.match(suffix):
                    result.append(os.path.join(dirName, fileName))
        if len(result) < self.backupCount:
            result = []
        else:
            result.sort()
            result = result[:len(result) - self.backupCount]
        return result

    def doRollover(self):
        """
        do a rollover; in this case, a date/time stamp is appended to the filename
        when the rollover happens.  However, you want the file to be named for the
        start of the interval, not the current time.  If there is a backup count,
        then we have to get a list of matching filenames, sort them and remove
        the one with the oldest suffix.
        """
        if self.stream:
            self.stream.close()
            self.stream = None
        # get the time that this sequence started at and make it a TimeTuple
        currentTime = int(time.time())
        dstNow = time.localtime(currentTime)[-1]
        t = self.rolloverAt - self.interval
        if self.utc:
            timeTuple = time.gmtime(t)
        else:
            timeTuple = time.localtime(t)
            dstThen = timeTuple[-1]
            if dstNow != dstThen:
                if dstNow:
                    addend = 3600
                else:
                    addend = -3600
                timeTuple = time.localtime(t + addend)
        dfn = self.rotation_filename(self.baseFilename + "." +
                                     time.strftime(self.suffix, timeTuple))
        if os.path.exists(dfn):
            os.remove(dfn)
        self.rotate(self.baseFilename, dfn)
        if self.backupCount > 0:
            for s in self.getFilesToDelete():
                os.remove(s)
        if not self.delay:
            self.stream = self._open()
        newRolloverAt = self.computeRollover(currentTime)
        while newRolloverAt <= currentTime:
            newRolloverAt = newRolloverAt + self.interval
        #If DST changes and midnight or weekly rollover, adjust for this.
        if (self.when == 'MIDNIGHT' or self.when.startswith('W')) and not self.utc:
            dstAtRollover = time.localtime(newRolloverAt)[-1]
            if dstNow != dstAtRollover:
                if not dstNow:  # DST kicks in before next rollover, so we need to deduct an hour
                    addend = -3600
                else:           # DST bows out before next rollover, so we need to add an hour
                    addend = 3600
                newRolloverAt += addend
        self.rolloverAt = newRolloverAt

class WatchedFileHandler(logging.FileHandler):
    """
    A handler for logging to a file, which watches the file
    to see if it has changed while in use. This can happen because of
    usage of programs such as newsyslog and logrotate which perform
    log file rotation. This handler, intended for use under Unix,
    watches the file to see if it has changed since the last emit.
    (A file has changed if its device or inode have changed.)
    If it has changed, the old file stream is closed, and the file
    opened to get a new stream.

    This handler is not appropriate for use under Windows, because
    under Windows open files cannot be moved or renamed - logging
    opens the files with exclusive locks - and so there is no need
    for such a handler. Furthermore, ST_INO is not supported under
    Windows; stat always returns zero for this value.

    This handler is based on a suggestion and patch by Chad J.
    Schroeder.
    """
    def __init__(self, filename, mode='a', encoding=None, delay=False):
        logging.FileHandler.__init__(self, filename, mode, encoding, delay)
        self.dev, self.ino = -1, -1
        self._statstream()

    def _statstream(self):
        if self.stream:
            sres = os.fstat(self.stream.fileno())
            self.dev, self.ino = sres[ST_DEV], sres[ST_INO]

    def reopenIfNeeded(self):
        """
        Reopen log file if needed.

        Checks if the underlying file has changed, and if it
        has, close the old stream and reopen the file to get the
        current stream.
        """
        # Reduce the chance of race conditions by stat'ing by path only
        # once and then fstat'ing our new fd if we opened a new log stream.
        # See issue #14632: Thanks to John Mulligan for the problem report
        # and patch.
        try:
            # stat the file by path, checking for existence
            sres = os.stat(self.baseFilename)
        except FileNotFoundError:
            sres = None
        # compare file system stat with that of our stream file handle
        if not sres or sres[ST_DEV] != self.dev or sres[ST_INO] != self.ino:
            if self.stream is not None:
                # we have an open file handle, clean it up
                self.stream.flush()
                self.stream.close()
                self.stream = None  # See Issue #21742: _open () might fail.
                # open a new file handle and get new stat info from that fd
                self.stream = self._open()
                self._statstream()

    def emit(self, record):
        """
        Emit a record.

        If underlying file has changed, reopen the file before emitting the
        record to it.
        """
        self.reopenIfNeeded()
        logging.FileHandler.emit(self, record)


class SocketHandler(logging.Handler):
    """
    A handler class which writes logging records, in pickle format, to
    a streaming socket. The socket is kept open across logging calls.
    If the peer resets it, an attempt is made to reconnect on the next call.
    The pickle which is sent is that of the LogRecord's attribute dictionary
    (__dict__), so that the receiver does not need to have the logging module
    installed in order to process the logging event.

    To unpickle the record at the receiving end into a LogRecord, use the
    makeLogRecord function.
    """

    def __init__(self, host, port):
        """
        Initializes the handler with a specific host address and port.

        When the attribute *closeOnError* is set to True - if a socket error
        occurs, the socket is silently closed and then reopened on the next
        logging call.
        """
        logging.Handler.__init__(self)
        self.host = host
        self.port = port
        if port is None:
            self.address = host
        else:
            self.address = (host, port)
        self.sock = None
        self.closeOnError = False
        self.retryTime = None
        #
        # Exponential backoff parameters.
        #
        self.retryStart = 1.0
        self.retryMax = 30.0
        self.retryFactor = 2.0

    def makeSocket(self, timeout=1):
        """
        A factory method which allows subclasses to define the precise
        type of socket they want.
        """
        if self.port is not None:
            result = socket.create_connection(self.address, timeout=timeout)
        else:
            result = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
            result.settimeout(timeout)
            try:
                result.connect(self.address)
            except OSError:
                result.close()  # Issue 19182
                raise
        return result

    def createSocket(self):
        """
        Try to create a socket, using an exponential backoff with
        a max retry time. Thanks to Robert Olson for the original patch
        (SF #815911) which has been slightly refactored.
        """
        now = time.time()
        # Either retryTime is None, in which case this
        # is the first time back after a disconnect, or
        # we've waited long enough.
        if self.retryTime is None:
            attempt = True
        else:
            attempt = (now >= self.retryTime)
        if attempt:
            try:
                self.sock = self.makeSocket()
                self.retryTime = None # next time, no delay before trying
            except OSError:
                #Creation failed, so set the retry time and return.
                if self.retryTime is None:
                    self.retryPeriod = self.retryStart
                else:
                    self.retryPeriod = self.retryPeriod * self.retryFactor
                    if self.retryPeriod > self.retryMax:
                        self.retryPeriod = self.retryMax
                self.retryTime = now + self.retryPeriod

    def send(self, s):
        """
        Send a pickled string to the socket.

        This function allows for partial sends which can happen when the
        network is busy.
        """
        if self.sock is None:
            self.createSocket()
        #self.sock can be None either because we haven't reached the retry
        #time yet, or because we have reached the retry time and retried,
        #but are still unable to connect.
        if self.sock:
            try:
                self.sock.sendall(s)
            except OSError: #pragma: no cover
                self.sock.close()
                self.sock = None  # so we can call createSocket next time

    def makePickle(self, record):
        """
        Pickles the record in binary format with a length prefix, and
        returns it ready for transmission across the socket.
        """
        ei = record.exc_info
        if ei:
            # just to get traceback text into record.exc_text ...
            dummy = self.format(record)
        # See issue #14436: If msg or args are objects, they may not be
        # available on the receiving end. So we convert the msg % args
        # to a string, save it as msg and zap the args.
        d = dict(record.__dict__)
        d['msg'] = record.getMessage()
        d['args'] = None
        d['exc_info'] = None
        # Issue #25685: delete 'message' if present: redundant with 'msg'
        d.pop('message', None)
        s = pickle.dumps(d, 1)
        slen = struct.pack(">L", len(s))
        return slen + s

    def handleError(self, record):
        """
        Handle an error during logging.

        An error has occurred during logging. Most likely cause -
        connection lost. Close the socket so that we can retry on the
        next event.
        """
        if self.closeOnError and self.sock:
            self.sock.close()
            self.sock = None        #try to reconnect next time
        else:
            logging.Handler.handleError(self, record)

    def emit(self, record):
        """
        Emit a record.

        Pickles the record and writes it to the socket in binary format.
        If there is an error with the socket, silently drop the packet.
        If there was a problem with the socket, re-establishes the
        socket.
        """
        try:
            s = self.makePickle(record)
            self.send(s)
        except Exception:
            self.handleError(record)

    def close(self):
        """
        Closes the socket.
        """
        self.acquire()
        try:
            sock = self.sock
            if sock:
                self.sock = None
                sock.close()
            logging.Handler.close(self)
        finally:
            self.release()

class DatagramHandler(SocketHandler):
    """
    A handler class which writes logging records, in pickle format, to
    a datagram socket.  The pickle which is sent is that of the LogRecord's
    attribute dictionary (__dict__), so that the receiver does not need to
    have the logging module installed in order to process the logging event.

    To unpickle the record at the receiving end into a LogRecord, use the
    makeLogRecord function.

    """
    def __init__(self, host, port):
        """
        Initializes the handler with a specific host address and port.
        """
        SocketHandler.__init__(self, host, port)
        self.closeOnError = False

    def makeSocket(self):
        """
        The factory method of SocketHandler is here overridden to create
        a UDP socket (SOCK_DGRAM).
        """
        if self.port is None:
            family = socket.AF_UNIX
        else:
            family = socket.AF_INET
        s = socket.socket(family, socket.SOCK_DGRAM)
        return s

    def send(self, s):
        """
        Send a pickled string to a socket.

        This function no longer allows for partial sends which can happen
        when the network is busy - UDP does not guarantee delivery and
        can deliver packets out of sequence.
        """
        if self.sock is None:
            self.createSocket()
        self.sock.sendto(s, self.address)

class SysLogHandler(logging.Handler):
    """
    A handler class which sends formatted logging records to a syslog
    server. Based on Sam Rushing's syslog module:
    http://www.nightmare.com/squirl/python-ext/misc/syslog.py
    Contributed by Nicolas Untz (after which minor refactoring changes
    have been made).
    """

    # from <linux/sys/syslog.h>:
    # ======================================================================
    # priorities/facilities are encoded into a single 32-bit quantity, where
    # the bottom 3 bits are the priority (0-7) and the top 28 bits are the
    # facility (0-big number). Both the priorities and the facilities map
    # roughly one-to-one to strings in the syslogd(8) source code.  This
    # mapping is included in this file.
    #
    # priorities (these are ordered)

    LOG_EMERG     = 0       #  system is unusable
    LOG_ALERT     = 1       #  action must be taken immediately
    LOG_CRIT      = 2       #  critical conditions
    LOG_ERR       = 3       #  error conditions
    LOG_WARNING   = 4       #  warning conditions
    LOG_NOTICE    = 5       #  normal but significant condition
    LOG_INFO      = 6       #  informational
    LOG_DEBUG     = 7       #  debug-level messages

    #  facility codes
    LOG_KERN      = 0       #  kernel messages
    LOG_USER      = 1       #  random user-level messages
    LOG_MAIL      = 2       #  mail system
    LOG_DAEMON    = 3       #  system daemons
    LOG_AUTH      = 4       #  security/authorization messages
    LOG_SYSLOG    = 5       #  messages generated internally by syslogd
    LOG_LPR       = 6       #  line printer subsystem
    LOG_NEWS      = 7       #  network news subsystem
    LOG_UUCP      = 8       #  UUCP subsystem
    LOG_CRON      = 9       #  clock daemon
    LOG_AUTHPRIV  = 10      #  security/authorization messages (private)
    LOG_FTP       = 11      #  FTP daemon

    #  other codes through 15 reserved for system use
    LOG_LOCAL0    = 16      #  reserved for local use
    LOG_LOCAL1    = 17      #  reserved for local use
    LOG_LOCAL2    = 18      #  reserved for local use
    LOG_LOCAL3    = 19      #  reserved for local use
    LOG_LOCAL4    = 20      #  reserved for local use
    LOG_LOCAL5    = 21      #  reserved for local use
    LOG_LOCAL6    = 22      #  reserved for local use
    LOG_LOCAL7    = 23      #  reserved for local use

    priority_names = {
        "alert":    LOG_ALERT,
        "crit":     LOG_CRIT,
        "critical": LOG_CRIT,
        "debug":    LOG_DEBUG,
        "emerg":    LOG_EMERG,
        "err":      LOG_ERR,
        "error":    LOG_ERR,        #  DEPRECATED
        "info":     LOG_INFO,
        "notice":   LOG_NOTICE,
        "panic":    LOG_EMERG,      #  DEPRECATED
        "warn":     LOG_WARNING,    #  DEPRECATED
        "warning":  LOG_WARNING,
        }

    facility_names = {
        "auth":     LOG_AUTH,
        "authpriv": LOG_AUTHPRIV,
        "cron":     LOG_CRON,
        "daemon":   LOG_DAEMON,
        "ftp":      LOG_FTP,
        "kern":     LOG_KERN,
        "lpr":      LOG_LPR,
        "mail":     LOG_MAIL,
        "news":     LOG_NEWS,
        "security": LOG_AUTH,       #  DEPRECATED
        "syslog":   LOG_SYSLOG,
        "user":     LOG_USER,
        "uucp":     LOG_UUCP,
        "local0":   LOG_LOCAL0,
        "local1":   LOG_LOCAL1,
        "local2":   LOG_LOCAL2,
        "local3":   LOG_LOCAL3,
        "local4":   LOG_LOCAL4,
        "local5":   LOG_LOCAL5,
        "local6":   LOG_LOCAL6,
        "local7":   LOG_LOCAL7,
        }

    #The map below appears to be trivially lowercasing the key. However,
    #there's more to it than meets the eye - in some locales, lowercasing
    #gives unexpected results. See SF #1524081: in the Turkish locale,
    #"INFO".lower() != "info"
    priority_map = {
        "DEBUG" : "debug",
        "INFO" : "info",
        "WARNING" : "warning",
        "ERROR" : "error",
        "CRITICAL" : "critical"
    }

    def __init__(self, address=('localhost', SYSLOG_UDP_PORT),
                 facility=LOG_USER, socktype=None):
        """
        Initialize a handler.

        If address is specified as a string, a UNIX socket is used. To log to a
        local syslogd, "SysLogHandler(address="/dev/log")" can be used.
        If facility is not specified, LOG_USER is used. If socktype is
        specified as socket.SOCK_DGRAM or socket.SOCK_STREAM, that specific
        socket type will be used. For Unix sockets, you can also specify a
        socktype of None, in which case socket.SOCK_DGRAM will be used, falling
        back to socket.SOCK_STREAM.
        """
        logging.Handler.__init__(self)

        self.address = address
        self.facility = facility
        self.socktype = socktype

        if isinstance(address, str):
            self.unixsocket = True
            # Syslog server may be unavailable during handler initialisation.
            # C's openlog() function also ignores connection errors.
            # Moreover, we ignore these errors while logging, so it not worse
            # to ignore it also here.
            try:
                self._connect_unixsocket(address)
            except OSError:
                pass
        else:
            self.unixsocket = False
            if socktype is None:
                socktype = socket.SOCK_DGRAM
            host, port = address
            ress = socket.getaddrinfo(host, port, 0, socktype)
            if not ress:
                raise OSError("getaddrinfo returns an empty list")
            for res in ress:
                af, socktype, proto, _, sa = res
                err = sock = None
                try:
                    sock = socket.socket(af, socktype, proto)
                    if socktype == socket.SOCK_STREAM:
                        sock.connect(sa)
                    break
                except OSError as exc:
                    err = exc
                    if sock is not None:
                        sock.close()
            if err is not None:
                raise err
            self.socket = sock
            self.socktype = socktype

    def _connect_unixsocket(self, address):
        use_socktype = self.socktype
        if use_socktype is None:
            use_socktype = socket.SOCK_DGRAM
        self.socket = socket.socket(socket.AF_UNIX, use_socktype)
        try:
            self.socket.connect(address)
            # it worked, so set self.socktype to the used type
            self.socktype = use_socktype
        except OSError:
            self.socket.close()
            if self.socktype is not None:
                # user didn't specify falling back, so fail
                raise
            use_socktype = socket.SOCK_STREAM
            self.socket = socket.socket(socket.AF_UNIX, use_socktype)
            try:
                self.socket.connect(address)
                # it worked, so set self.socktype to the used type
                self.socktype = use_socktype
            except OSError:
                self.socket.close()
                raise

    def encodePriority(self, facility, priority):
        """
        Encode the facility and priority. You can pass in strings or
        integers - if strings are passed, the facility_names and
        priority_names mapping dictionaries are used to convert them to
        integers.
        """
        if isinstance(facility, str):
            facility = self.facility_names[facility]
        if isinstance(priority, str):
            priority = self.priority_names[priority]
        return (facility << 3) | priority

    def close(self):
        """
        Closes the socket.
        """
        self.acquire()
        try:
            self.socket.close()
            logging.Handler.close(self)
        finally:
            self.release()

    def mapPriority(self, levelName):
        """
        Map a logging level name to a key in the priority_names map.
        This is useful in two scenarios: when custom levels are being
        used, and in the case where you can't do a straightforward
        mapping by lowercasing the logging level name because of locale-
        specific issues (see SF #1524081).
        """
        return self.priority_map.get(levelName, "warning")

    ident = ''          # prepended to all messages
    append_nul = True   # some old syslog daemons expect a NUL terminator

    def emit(self, record):
        """
        Emit a record.

        The record is formatted, and then sent to the syslog server. If
        exception information is present, it is NOT sent to the server.
        """
        try:
            msg = self.format(record)
            if self.ident:
                msg = self.ident + msg
            if self.append_nul:
                msg += '\000'

            # We need to convert record level to lowercase, maybe this will
            # change in the future.
            prio = '<%d>' % self.encodePriority(self.facility,
                                                self.mapPriority(record.levelname))
            prio = prio.encode('utf-8')
            # Message is a string. Convert to bytes as required by RFC 5424
            msg = msg.encode('utf-8')
            msg = prio + msg
            if self.unixsocket:
                try:
                    self.socket.send(msg)
                except OSError:
                    self.socket.close()
                    self._connect_unixsocket(self.address)
                    self.socket.send(msg)
            elif self.socktype == socket.SOCK_DGRAM:
                self.socket.sendto(msg, self.address)
            else:
                self.socket.sendall(msg)
        except Exception:
            self.handleError(record)

class SMTPHandler(logging.Handler):
    """
    A handler class which sends an SMTP email for each logging event.
    """
    def __init__(self, mailhost, fromaddr, toaddrs, subject,
                 credentials=None, secure=None, timeout=5.0):
        """
        Initialize the handler.

        Initialize the instance with the from and to addresses and subject
        line of the email. To specify a non-standard SMTP port, use the
        (host, port) tuple format for the mailhost argument. To specify
        authentication credentials, supply a (username, password) tuple
        for the credentials argument. To specify the use of a secure
        protocol (TLS), pass in a tuple for the secure argument. This will
        only be used when authentication credentials are supplied. The tuple
        will be either an empty tuple, or a single-value tuple with the name
        of a keyfile, or a 2-value tuple with the names of the keyfile and
        certificate file. (This tuple is passed to the `starttls` method).
        A timeout in seconds can be specified for the SMTP connection (the
        default is one second).
        """
        logging.Handler.__init__(self)
        if isinstance(mailhost, (list, tuple)):
            self.mailhost, self.mailport = mailhost
        else:
            self.mailhost, self.mailport = mailhost, None
        if isinstance(credentials, (list, tuple)):
            self.username, self.password = credentials
        else:
            self.username = None
        self.fromaddr = fromaddr
        if isinstance(toaddrs, str):
            toaddrs = [toaddrs]
        self.toaddrs = toaddrs
        self.subject = subject
        self.secure = secure
        self.timeout = timeout

    def getSubject(self, record):
        """
        Determine the subject for the email.

        If you want to specify a subject line which is record-dependent,
        override this method.
        """
        return self.subject

    def emit(self, record):
        """
        Emit a record.

        Format the record and send it to the specified addressees.
        """
        try:
            import smtplib
            from email.message import EmailMessage
            import email.utils

            port = self.mailport
            if not port:
                port = smtplib.SMTP_PORT
            smtp = smtplib.SMTP(self.mailhost, port, timeout=self.timeout)
            msg = EmailMessage()
            msg['From'] = self.fromaddr
            msg['To'] = ','.join(self.toaddrs)
            msg['Subject'] = self.getSubject(record)
            msg['Date'] = email.utils.localtime()
            msg.set_content(self.format(record))
            if self.username:
                if self.secure is not None:
                    smtp.ehlo()
                    smtp.starttls(*self.secure)
                    smtp.ehlo()
                smtp.login(self.username, self.password)
            smtp.send_message(msg)
            smtp.quit()
        except Exception:
            self.handleError(record)

class NTEventLogHandler(logging.Handler):
    """
    A handler class which sends events to the NT Event Log. Adds a
    registry entry for the specified application name. If no dllname is
    provided, win32service.pyd (which contains some basic message
    placeholders) is used. Note that use of these placeholders will make
    your event logs big, as the entire message source is held in the log.
    If you want slimmer logs, you have to pass in the name of your own DLL
    which contains the message definitions you want to use in the event log.
    """
    def __init__(self, appname, dllname=None, logtype="Application"):
        logging.Handler.__init__(self)
        try:
            import win32evtlogutil, win32evtlog
            self.appname = appname
            self._welu = win32evtlogutil
            if not dllname:
                dllname = os.path.split(self._welu.__file__)
                dllname = os.path.split(dllname[0])
                dllname = os.path.join(dllname[0], r'win32service.pyd')
            self.dllname = dllname
            self.logtype = logtype
            self._welu.AddSourceToRegistry(appname, dllname, logtype)
            self.deftype = win32evtlog.EVENTLOG_ERROR_TYPE
            self.typemap = {
                logging.DEBUG   : win32evtlog.EVENTLOG_INFORMATION_TYPE,
                logging.INFO    : win32evtlog.EVENTLOG_INFORMATION_TYPE,
                logging.WARNING : win32evtlog.EVENTLOG_WARNING_TYPE,
                logging.ERROR   : win32evtlog.EVENTLOG_ERROR_TYPE,
                logging.CRITICAL: win32evtlog.EVENTLOG_ERROR_TYPE,
         }
        except ImportError:
            print("The Python Win32 extensions for NT (service, event "\
                        "logging) appear not to be available.")
            self._welu = None

    def getMessageID(self, record):
        """
        Return the message ID for the event record. If you are using your
        own messages, you could do this by having the msg passed to the
        logger being an ID rather than a formatting string. Then, in here,
        you could use a dictionary lookup to get the message ID. This
        version returns 1, which is the base message ID in win32service.pyd.
        """
        return 1

    def getEventCategory(self, record):
        """
        Return the event category for the record.

        Override this if you want to specify your own categories. This version
        returns 0.
        """
        return 0

    def getEventType(self, record):
        """
        Return the event type for the record.

        Override this if you want to specify your own types. This version does
        a mapping using the handler's typemap attribute, which is set up in
        __init__() to a dictionary which contains mappings for DEBUG, INFO,
        WARNING, ERROR and CRITICAL. If you are using your own levels you will
        either need to override this method or place a suitable dictionary in
        the handler's typemap attribute.
        """
        return self.typemap.get(record.levelno, self.deftype)

    def emit(self, record):
        """
        Emit a record.

        Determine the message ID, event category and event type. Then
        log the message in the NT event log.
        """
        if self._welu:
            try:
                id = self.getMessageID(record)
                cat = self.getEventCategory(record)
                type = self.getEventType(record)
                msg = self.format(record)
                self._welu.ReportEvent(self.appname, id, cat, type, [msg])
            except Exception:
                self.handleError(record)

    def close(self):
        """
        Clean up this handler.

        You can remove the application name from the registry as a
        source of event log entries. However, if you do this, you will
        not be able to see the events as you intended in the Event Log
        Viewer - it needs to be able to access the registry to get the
        DLL name.
        """
        #self._welu.RemoveSourceFromRegistry(self.appname, self.logtype)
        logging.Handler.close(self)

class HTTPHandler(logging.Handler):
    """
    A class which sends records to a Web server, using either GET or
    POST semantics.
    """
    def __init__(self, host, url, method="GET", secure=False, credentials=None,
                 context=None):
        """
        Initialize the instance with the host, the request URL, and the method
        ("GET" or "POST")
        """
        logging.Handler.__init__(self)
        method = method.upper()
        if method not in ["GET", "POST"]:
            raise ValueError("method must be GET or POST")
        if not secure and context is not None:
            raise ValueError("context parameter only makes sense "
                             "with secure=True")
        self.host = host
        self.url = url
        self.method = method
        self.secure = secure
        self.credentials = credentials
        self.context = context

    def mapLogRecord(self, record):
        """
        Default implementation of mapping the log record into a dict
        that is sent as the CGI data. Overwrite in your class.
        Contributed by Franz Glasner.
        """
        return record.__dict__

    def emit(self, record):
        """
        Emit a record.

        Send the record to the Web server as a percent-encoded dictionary
        """
        try:
            import http.client, urllib.parse
            host = self.host
            if self.secure:
                h = http.client.HTTPSConnection(host, context=self.context)
            else:
                h = http.client.HTTPConnection(host)
            url = self.url
            data = urllib.parse.urlencode(self.mapLogRecord(record))
            if self.method == "GET":
                if (url.find('?') >= 0):
                    sep = '&'
                else:
                    sep = '?'
                url = url + "%c%s" % (sep, data)
            h.putrequest(self.method, url)
            # support multiple hosts on one IP address...
            # need to strip optional :port from host, if present
            i = host.find(":")
            if i >= 0:
                host = host[:i]
            # See issue #30904: putrequest call above already adds this header
            # on Python 3.x.
            # h.putheader("Host", host)
            if self.method == "POST":
                h.putheader("Content-type",
                            "application/x-www-form-urlencoded")
                h.putheader("Content-length", str(len(data)))
            if self.credentials:
                import base64
                s = ('%s:%s' % self.credentials).encode('utf-8')
                s = 'Basic ' + base64.b64encode(s).strip().decode('ascii')
                h.putheader('Authorization', s)
            h.endheaders()
            if self.method == "POST":
                h.send(data.encode('utf-8'))
            h.getresponse()    #can't do anything with the result
        except Exception:
            self.handleError(record)

class BufferingHandler(logging.Handler):
    """
  A handler class which buffers logging records in memory. Whenever each
  record is added to the buffer, a check is made to see if the buffer should
  be flushed. If it should, then flush() is expected to do what's needed.
    """
    def __init__(self, capacity):
        """
        Initialize the handler with the buffer size.
        """
        logging.Handler.__init__(self)
        self.capacity = capacity
        self.buffer = []

    def shouldFlush(self, record):
        """
        Should the handler flush its buffer?

        Returns true if the buffer is up to capacity. This method can be
        overridden to implement custom flushing strategies.
        """
        return (len(self.buffer) >= self.capacity)

    def emit(self, record):
        """
        Emit a record.

        Append the record. If shouldFlush() tells us to, call flush() to process
        the buffer.
        """
        self.buffer.append(record)
        if self.shouldFlush(record):
            self.flush()

    def flush(self):
        """
        Override to implement custom flushing behaviour.

        This version just zaps the buffer to empty.
        """
        self.acquire()
        try:
            self.buffer = []
        finally:
            self.release()

    def close(self):
        """
        Close the handler.

        This version just flushes and chains to the parent class' close().
        """
        try:
            self.flush()
        finally:
            logging.Handler.close(self)

class MemoryHandler(BufferingHandler):
    """
    A handler class which buffers logging records in memory, periodically
    flushing them to a target handler. Flushing occurs whenever the buffer
    is full, or when an event of a certain severity or greater is seen.
    """
    def __init__(self, capacity, flushLevel=logging.ERROR, target=None,
                 flushOnClose=True):
        """
        Initialize the handler with the buffer size, the level at which
        flushing should occur and an optional target.

        Note that without a target being set either here or via setTarget(),
        a MemoryHandler is no use to anyone!

        The ``flushOnClose`` argument is ``True`` for backward compatibility
        reasons - the old behaviour is that when the handler is closed, the
        buffer is flushed, even if the flush level hasn't been exceeded nor the
        capacity exceeded. To prevent this, set ``flushOnClose`` to ``False``.
        """
        BufferingHandler.__init__(self, capacity)
        self.flushLevel = flushLevel
        self.target = target
        # See Issue #26559 for why this has been added
        self.flushOnClose = flushOnClose

    def shouldFlush(self, record):
        """
        Check for buffer full or a record at the flushLevel or higher.
        """
        return (len(self.buffer) >= self.capacity) or \
                (record.levelno >= self.flushLevel)

    def setTarget(self, target):
        """
        Set the target handler for this handler.
        """
        self.acquire()
        try:
            self.target = target
        finally:
            self.release()

    def flush(self):
        """
        For a MemoryHandler, flushing means just sending the buffered
        records to the target, if there is one. Override if you want
        different behaviour.

        The record buffer is also cleared by this operation.
        """
        self.acquire()
        try:
            if self.target:
                for record in self.buffer:
                    self.target.handle(record)
                self.buffer = []
        finally:
            self.release()

    def close(self):
        """
        Flush, if appropriately configured, set the target to None and lose the
        buffer.
        """
        try:
            if self.flushOnClose:
                self.flush()
        finally:
            self.acquire()
            try:
                self.target = None
                BufferingHandler.close(self)
            finally:
                self.release()


class QueueHandler(logging.Handler):
    """
    This handler sends events to a queue. Typically, it would be used together
    with a multiprocessing Queue to centralise logging to file in one process
    (in a multi-process application), so as to avoid file write contention
    between processes.

    This code is new in Python 3.2, but this class can be copy pasted into
    user code for use with earlier Python versions.
    """

    def __init__(self, queue):
        """
        Initialise an instance, using the passed queue.
        """
        logging.Handler.__init__(self)
        self.queue = queue

    def enqueue(self, record):
        """
        Enqueue a record.

        The base implementation uses put_nowait. You may want to override
        this method if you want to use blocking, timeouts or custom queue
        implementations.
        """
        self.queue.put_nowait(record)

    def prepare(self, record):
        """
        Prepares a record for queuing. The object returned by this method is
        enqueued.

        The base implementation formats the record to merge the message
        and arguments, and removes unpickleable items from the record
        in-place.

        You might want to override this method if you want to convert
        the record to a dict or JSON string, or send a modified copy
        of the record while leaving the original intact.
        """
        # The format operation gets traceback text into record.exc_text
        # (if there's exception data), and also returns the formatted
        # message. We can then use this to replace the original
        # msg + args, as these might be unpickleable. We also zap the
        # exc_info and exc_text attributes, as they are no longer
        # needed and, if not None, will typically not be pickleable.
        msg = self.format(record)
        # bpo-35726: make copy of record to avoid affecting other handlers in the chain.
        record = copy.copy(record)
        record.message = msg
        record.msg = msg
        record.args = None
        record.exc_info = None
        record.exc_text = None
        return record

    def emit(self, record):
        """
        Emit a record.

        Writes the LogRecord to the queue, preparing it for pickling first.
        """
        try:
            self.enqueue(self.prepare(record))
        except Exception:
            self.handleError(record)


class QueueListener(object):
    """
    This class implements an internal threaded listener which watches for
    LogRecords being added to a queue, removes them and passes them to a
    list of handlers for processing.
    """
    _sentinel = None

    def __init__(self, queue, *handlers, respect_handler_level=False):
        """
        Initialise an instance with the specified queue and
        handlers.
        """
        self.queue = queue
        self.handlers = handlers
        self._thread = None
        self.respect_handler_level = respect_handler_level

    def dequeue(self, block):
        """
        Dequeue a record and return it, optionally blocking.

        The base implementation uses get. You may want to override this method
        if you want to use timeouts or work with custom queue implementations.
        """
        return self.queue.get(block)

    def start(self):
        """
        Start the listener.

        This starts up a background thread to monitor the queue for
        LogRecords to process.
        """
        self._thread = t = threading.Thread(target=self._monitor)
        t.daemon = True
        t.start()

    def prepare(self, record):
        """
        Prepare a record for handling.

        This method just returns the passed-in record. You may want to
        override this method if you need to do any custom marshalling or
        manipulation of the record before passing it to the handlers.
        """
        return record

    def handle(self, record):
        """
        Handle a record.

        This just loops through the handlers offering them the record
        to handle.
        """
        record = self.prepare(record)
        for handler in self.handlers:
            if not self.respect_handler_level:
                process = True
            else:
                process = record.levelno >= handler.level
            if process:
                handler.handle(record)

    def _monitor(self):
        """
        Monitor the queue for records, and ask the handler
        to deal with them.

        This method runs on a separate, internal thread.
        The thread will terminate if it sees a sentinel object in the queue.
        """
        q = self.queue
        has_task_done = hasattr(q, 'task_done')
        while True:
            try:
                record = self.dequeue(True)
                if record is self._sentinel:
                    if has_task_done:
                        q.task_done()
                    break
                self.handle(record)
                if has_task_done:
                    q.task_done()
            except queue.Empty:
                break

    def enqueue_sentinel(self):
        """
        This is used to enqueue the sentinel record.

        The base implementation uses put_nowait. You may want to override this
        method if you want to use timeouts or work with custom queue
        implementations.
        """
        self.queue.put_nowait(self._sentinel)

    def stop(self):
        """
        Stop the listener.

        This asks the thread to terminate, and then waits for it to do so.
        Note that if you don't call this before your application exits, there
        may be some records still left on the queue, which won't be processed.
        """
        self.enqueue_sentinel()
        self._thread.join()
        self._thread = None
logging/__pycache__/__init__.cpython-38.opt-1.pyc000064400000177340151153537450015555 0ustar00U

e5d�0�*@s6dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z
ddlmZddlm
Zddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.g*ZddlZd/Zd0Zd1Zd2Ze��Zd3Zd3Zd3Zd3Zd4ZeZd5Zd6ZeZd7Zd8Z dZ!eded	edede de!diZ"eeeeeee e!d9�Z#d:d!�Z$d;d�Z%e&ed<��rdd=d>�Z'nd?d@�Z'ej(�)e%j*j+�Z,dAdB�Z-e�.�Z/dCdD�Z0dEdF�Z1e&edG��s�dHdI�Z2n(e�3�Z4dJdI�Z2dKdL�Z5ej6e0e5e1dM�GdNd�de7�Z8e8a9dOd,�Z:dPd+�Z;dQd&�Z<e�Z=[GdRdS�dSe7�Z>GdTdU�dUe>�Z?GdVdW�dWe>�Z@dXZAe>eAfe?dYfe@dZfd[�ZBGd\d
�d
e7�Z
e
�ZCGd]d�de7�ZDGd^d�de7�ZEGd_d`�d`e7�ZFe�G�ZHgZIdadb�ZJdcdd�ZKGded�deF�ZLGdfd�deL�ZMGdgd�deM�ZNGdhdi�dieM�ZOeOe�ZPePZQGdjdk�dke7�ZRdld'�ZSdmd#�ZTGdndo�doe7�ZUGdpd�deF�ZVGdqdr�dreV�ZWeVaXGdsd�de7�ZYeWe�ZZeZeV_ZeUeVjZ�eV_[dtd�Z\d�dud"�Z]dvd�Z^e^Z_dwd�Z`d3dx�dyd�Zadzd*�Zbd{d)�Zcd|d$�Zdd}d�Zed~d%�Zfefdd�ZgeIfd�d(�ZhddliZiei�jeh�Gd�d�deL�Zkdald�d�d��Zmd�d�ZndS)�z�
Logging package for Python. Based on PEP 282 and comments thereto in
comp.lang.python.

Copyright (C) 2001-2017 Vinay Sajip. All Rights Reserved.

To use, simply 'import logging' and log away!
�N)�Template)�	Formatter�BASIC_FORMAT�BufferingFormatter�CRITICAL�DEBUG�ERROR�FATAL�FileHandler�Filterr�Handler�INFO�	LogRecord�Logger�
LoggerAdapter�NOTSET�NullHandler�
StreamHandler�WARN�WARNING�addLevelName�basicConfig�captureWarnings�critical�debug�disable�error�	exception�fatal�getLevelName�	getLogger�getLoggerClass�info�log�
makeLogRecord�setLoggerClass�shutdown�warn�warning�getLogRecordFactory�setLogRecordFactory�
lastResort�raiseExceptionsz&Vinay Sajip <vinay_sajip@red-dove.com>Z
productionz0.5.1.2z07 February 2010T�2�(���
)rr	rrrr
rrcCs4t�|�}|dk	r|St�|�}|dk	r,|Sd|S)a�
    Return the textual or numeric representation of logging level 'level'.

    If the level is one of the predefined levels (CRITICAL, ERROR, WARNING,
    INFO, DEBUG) then you get the corresponding string. If you have
    associated levels with names using addLevelName then the name you have
    associated with 'level' is returned.

    If a numeric value corresponding to one of the defined levels is passed
    in, the corresponding string representation is returned.

    If a string representation of the level is passed in, the corresponding
    numeric value is returned.

    If no matching numeric or string value is passed in, the string
    'Level %s' % level is returned.
    NzLevel %s)�_levelToName�get�_nameToLevel)�level�result�r7�(/usr/lib64/python3.8/logging/__init__.pyrws

cCs(t�z|t|<|t|<W5t�XdS)zy
    Associate 'levelName' with 'level'.

    This is used when converting levels to text during message formatting.
    N)�_acquireLock�_releaseLockr2r4)r5Z	levelNamer7r7r8r�s
�	_getframecCs
t�d�S)N�)�sysr;r7r7r7r8�<lambda>��r>cCs2zt�Wn$tk
r,t��djjYSXdS)z5Return the frame object for the caller's stack frame.�N)�	Exceptionr=�exc_info�tb_frame�f_backr7r7r7r8�currentframe�srEcCsJt|t�r|}n6t|�|kr:|tkr0td|��t|}ntd|��|S)NzUnknown level: %rz*Level not an integer or a valid string: %r)�
isinstance�int�strr4�
ValueError�	TypeError)r5�rvr7r7r8�_checkLevel�s

rLcCstrt��dS)z�
    Acquire the module-level lock for serializing access to shared data.

    This should be released with _releaseLock().
    N)�_lock�acquirer7r7r7r8r9�sr9cCstrt��dS)zK
    Release the module-level lock acquired by calling _acquireLock().
    N)rM�releaser7r7r7r8r:�sr:�register_at_forkcCsdS�Nr7��instancer7r7r8�_register_at_fork_reinit_lock�srTcCs"t�zt�|�W5t�XdSrQ)r9r:�_at_fork_reinit_lock_weakset�addrRr7r7r8rT�scCsXtD]H}z|��Wqtk
rJ}ztdtd|tjd�W5d}~XYqXqt�dS)Nz&Ignoring exception from logging atforkz._reinit_lock() method:��file)rU�
createLockrA�printrSr=�stderrr:)�handler�errr7r7r8�!_after_at_fork_child_reinit_locks�s�r^)ZbeforeZafter_in_childZafter_in_parentc@s*eZdZdZd	dd�Zdd�Zdd�ZdS)
ra
    A LogRecord instance represents an event being logged.

    LogRecord instances are created every time something is logged. They
    contain all the information pertinent to the event being logged. The
    main information passed in is in msg and args, which are combined
    using str(msg) % args to create the message field of the record. The
    record also includes information such as when the record was created,
    the source line where the logging call was made, and any exception
    information to be logged.
    Nc


Ks�t��}||_||_|rFt|�dkrFt|dtjj�rF|drF|d}||_t	|�|_
||_||_z&t
j�|�|_t
j�|j�d|_Wn&tttfk
r�||_d|_YnX||_d|_|	|_||_||_||_|t|�d|_|jtd|_t �rt!�"�|_#t!�$�j|_%nd|_#d|_%t&�s.d|_'nDd|_'t(j)�*d�}|dk	�rrz|�+�j|_'Wnt,k
�rpYnXt-�r�t.t
d��r�t
�/�|_0nd|_0dS)	zK
        Initialize a logging record with interesting information.
        �rzUnknown moduleNi�ZMainProcessZmultiprocessing�getpid)1�time�name�msg�lenrF�collections�abc�Mapping�argsrZ	levelname�levelno�pathname�os�path�basename�filename�splitext�modulerJrI�AttributeErrorrB�exc_text�
stack_info�linenoZfuncName�createdrG�msecs�
_startTimeZrelativeCreated�
logThreads�	threading�	get_ident�threadZcurrent_threadZ
threadName�logMultiprocessingZprocessNamer=�modulesr3Zcurrent_processrA�logProcesses�hasattrr`�process)
�selfrbr5rjrtrcrhrB�func�sinfo�kwargs�ctZmpr7r7r8�__init__ sT"�


zLogRecord.__init__cCsd|j|j|j|j|jfS)Nz!<LogRecord: %s, %s, %s, %s, "%s">)rbrirjrtrc�r�r7r7r8�__repr__hs

�zLogRecord.__repr__cCst|j�}|jr||j}|S)z�
        Return the message for this LogRecord.

        Return the message for this LogRecord after merging any user-supplied
        arguments with the message.
        )rHrcrh)r�rcr7r7r8�
getMessagels

zLogRecord.getMessage)NN)�__name__�
__module__�__qualname__�__doc__r�r�r�r7r7r7r8rs�
HcCs|adS)z�
    Set the factory to be used when instantiating a log record.

    :param factory: A callable which will be called to instantiate
    a log record.
    N��_logRecordFactory)�factoryr7r7r8r*}scCstS)zH
    Return the factory to be used when instantiating a log record.
    r�r7r7r7r8r)�sc	Cs&tdddddddd�}|j�|�|S)z�
    Make a LogRecord whose attributes are defined by the specified dictionary,
    This function is useful for converting a logging event received over
    a socket connection (which is sent as a dictionary) into a LogRecord
    instance.
    N�rr7)r��__dict__�update)�dictrKr7r7r8r$�sc@sNeZdZdZdZdZe�dej�Z	dd�Z
dd�Zd	d
�Zdd�Z
d
d�ZdS)�PercentStylez%(message)sz%(asctime)sz
%(asctime)z5%\(\w+\)[#0+ -]*(\*|\d+)?(\.(\*|\d+))?[diouxefgcrsa%]cCs|p|j|_dSrQ)�default_format�_fmt�r��fmtr7r7r8r��szPercentStyle.__init__cCs|j�|j�dkS)Nr)r��find�asctime_searchr�r7r7r8�usesTime�szPercentStyle.usesTimecCs*|j�|j�s&td|j|jdf��dS)z>Validate the input format, ensure it matches the correct stylez"Invalid format '%s' for '%s' stylerN)�validation_pattern�searchr�rIr�r�r7r7r8�validate�szPercentStyle.validatecCs|j|jSrQ)r�r��r��recordr7r7r8�_format�szPercentStyle._formatc
Cs@z|�|�WStk
r:}ztd|��W5d}~XYnXdS)Nz(Formatting field not found in record: %s)r��KeyErrorrI)r�r��er7r7r8�format�szPercentStyle.formatN)r�r�r�r��asctime_formatr��re�compile�Ir�r�r�r�r�r�r7r7r7r8r��sr�c@s@eZdZdZdZdZe�dej�Z	e�d�Z
dd�Zdd	�Zd
S)�StrFormatStylez	{message}z	{asctime}z{asctimezF^(.?[<>=^])?[+ -]?#?0?(\d+|{\w+})?[,_]?(\.(\d+|{\w+}))?[bcdefgnosx%]?$z^(\d+|\w+)(\.\w+|\[[^]]+\])*$cCs|jjf|j�SrQ)r�r�r�r�r7r7r8r��szStrFormatStyle._formatc
Cs�t�}zxt�|j�D]f\}}}}|rF|j�|�s<td|��|�|�|r^|dkr^td|��|r|j�|�std|��qWn.tk
r�}ztd|��W5d}~XYnX|s�td��dS)zKValidate the input format, ensure it is the correct string formatting stylez!invalid field name/expression: %rZrsazinvalid conversion: %rzbad specifier: %rzinvalid format: %sN�invalid format: no fields)	�set�_str_formatter�parser��
field_spec�matchrIrV�fmt_spec)r��fields�_Z	fieldname�specZ
conversionr�r7r7r8r��s
zStrFormatStyle.validateN)
r�r�r�r�r�r�r�r�r�r�r�r�r�r7r7r7r8r��s
r�c@s8eZdZdZdZdZdd�Zdd�Zdd�Zd	d
�Z	dS)�StringTemplateStylez
${message}z
${asctime}cCs|p|j|_t|j�|_dSrQ)r�r�r�_tplr�r7r7r8r��szStringTemplateStyle.__init__cCs$|j}|�d�dkp"|�|j�dkS)Nz$asctimer)r�r�r�r�r7r7r8r��szStringTemplateStyle.usesTimecCs|tj}t�}|�|j�D]R}|��}|dr<|�|d�q|drT|�|d�q|�d�dkrtd��q|sxtd��dS)NZnamedZbracedr�$z$invalid format: bare '$' not allowedr�)	r�patternr��finditerr��	groupdictrV�grouprI)r�r�r��m�dr7r7r8r��s
zStringTemplateStyle.validatecCs|jjf|j�SrQ)r�Z
substituter�r�r7r7r8r��szStringTemplateStyle._formatN)
r�r�r�r�r�r�r�r�r�r�r7r7r7r8r��sr�z"%(levelname)s:%(name)s:%(message)sz{levelname}:{name}:{message}z${levelname}:${name}:${message})�%�{r�c@sZeZdZdZejZddd�ZdZdZ	dd	d
�Z
dd�Zd
d�Zdd�Z
dd�Zdd�ZdS)ra�
    Formatter instances are used to convert a LogRecord to text.

    Formatters need to know how a LogRecord is constructed. They are
    responsible for converting a LogRecord to (usually) a string which can
    be interpreted by either a human or an external system. The base Formatter
    allows a formatting string to be specified. If none is supplied, the
    style-dependent default value, "%(message)s", "{message}", or
    "${message}", is used.

    The Formatter can be initialized with a format string which makes use of
    knowledge of the LogRecord attributes - e.g. the default value mentioned
    above makes use of the fact that the user's message and arguments are pre-
    formatted into a LogRecord's message attribute. Currently, the useful
    attributes in a LogRecord are described by:

    %(name)s            Name of the logger (logging channel)
    %(levelno)s         Numeric logging level for the message (DEBUG, INFO,
                        WARNING, ERROR, CRITICAL)
    %(levelname)s       Text logging level for the message ("DEBUG", "INFO",
                        "WARNING", "ERROR", "CRITICAL")
    %(pathname)s        Full pathname of the source file where the logging
                        call was issued (if available)
    %(filename)s        Filename portion of pathname
    %(module)s          Module (name portion of filename)
    %(lineno)d          Source line number where the logging call was issued
                        (if available)
    %(funcName)s        Function name
    %(created)f         Time when the LogRecord was created (time.time()
                        return value)
    %(asctime)s         Textual time when the LogRecord was created
    %(msecs)d           Millisecond portion of the creation time
    %(relativeCreated)d Time in milliseconds when the LogRecord was created,
                        relative to the time the logging module was loaded
                        (typically at application startup time)
    %(thread)d          Thread ID (if available)
    %(threadName)s      Thread name (if available)
    %(process)d         Process ID (if available)
    %(message)s         The result of record.getMessage(), computed just as
                        the record is emitted
    Nr�TcCsR|tkrtdd�t�����t|d|�|_|r>|j��|jj|_||_dS)a�
        Initialize the formatter with specified format strings.

        Initialize the formatter either with the specified format string, or a
        default as described above. Allow for specialized date formatting with
        the optional datefmt argument. If datefmt is omitted, you get an
        ISO8601-like (or RFC 3339-like) format.

        Use a style parameter of '%', '{' or '$' to specify that you want to
        use one of %-formatting, :meth:`str.format` (``{}``) formatting or
        :class:`string.Template` formatting in your format string.

        .. versionchanged:: 3.2
           Added the ``style`` parameter.
        �Style must be one of: %s�,rN)�_STYLESrI�join�keys�_styler�r��datefmt)r�r�r��styler�r7r7r8r�/s�

zFormatter.__init__z%Y-%m-%d %H:%M:%Sz%s,%03dcCs@|�|j�}|rt�||�}nt�|j|�}|j||jf}|S)a%
        Return the creation time of the specified LogRecord as formatted text.

        This method should be called from format() by a formatter which
        wants to make use of a formatted time. This method can be overridden
        in formatters to provide for any specific requirement, but the
        basic behaviour is as follows: if datefmt (a string) is specified,
        it is used with time.strftime() to format the creation time of the
        record. Otherwise, an ISO8601-like (or RFC 3339-like) format is used.
        The resulting string is returned. This function uses a user-configurable
        function to convert the creation time to a tuple. By default,
        time.localtime() is used; to change this for a particular formatter
        instance, set the 'converter' attribute to a function with the same
        signature as time.localtime() or time.gmtime(). To change it for all
        formatters, for example if you want all logging times to be shown in GMT,
        set the 'converter' attribute in the Formatter class.
        )�	converterrura�strftime�default_time_format�default_msec_formatrv)r�r�r�r��s�tr7r7r8�
formatTimeLszFormatter.formatTimecCsZt��}|d}t�|d|d|d|�|��}|��|dd�dkrV|dd�}|S)z�
        Format and return the specified exception information as a string.

        This default implementation just uses
        traceback.print_exception()
        r@rr_N����
)�io�StringIO�	traceback�print_exception�getvalue�close)r�Zei�sio�tbr�r7r7r8�formatExceptionfszFormatter.formatExceptioncCs
|j��S)zK
        Check if the format uses the creation time of the record.
        )r�r�r�r7r7r8r�yszFormatter.usesTimecCs|j�|�SrQ)r�r�r�r7r7r8�
formatMessageszFormatter.formatMessagecCs|S)aU
        This method is provided as an extension point for specialized
        formatting of stack information.

        The input data is a string as returned from a call to
        :func:`traceback.print_stack`, but with the last trailing newline
        removed.

        The base implementation just returns the value passed in.
        r7)r�rsr7r7r8�formatStack�szFormatter.formatStackcCs�|��|_|��r"|�||j�|_|�|�}|jrF|jsF|�	|j�|_|jrn|dd�dkrd|d}||j}|j
r�|dd�dkr�|d}||�|j
�}|S)az
        Format the specified record as text.

        The record's attribute dictionary is used as the operand to a
        string formatting operation which yields the returned string.
        Before formatting the dictionary, a couple of preparatory steps
        are carried out. The message attribute of the record is computed
        using LogRecord.getMessage(). If the formatting string uses the
        time (as determined by a call to usesTime(), formatTime() is
        called to format the event time. If there is exception information,
        it is formatted using formatException() and appended to the message.
        r�Nr�)r��messager�r�r��asctimer�rBrrr�rsr�)r�r�r�r7r7r8r��s 


zFormatter.format)NNr�T)N)r�r�r�r�ra�	localtimer�r�r�r�r�r�r�r�r�r�r7r7r7r8rs*


c@s2eZdZdZddd�Zdd�Zdd�Zd	d
�ZdS)rzB
    A formatter suitable for formatting a number of records.
    NcCs|r||_nt|_dS)zm
        Optionally specify a formatter which will be used to format each
        individual record.
        N)�linefmt�_defaultFormatter)r�r�r7r7r8r��szBufferingFormatter.__init__cCsdS)zE
        Return the header string for the specified records.
        r�r7�r��recordsr7r7r8�formatHeader�szBufferingFormatter.formatHeadercCsdS)zE
        Return the footer string for the specified records.
        r�r7r�r7r7r8�formatFooter�szBufferingFormatter.formatFootercCsJd}t|�dkrF||�|�}|D]}||j�|�}q"||�|�}|S)zQ
        Format the specified records and return the result as a string.
        r�r)rdr�r�r�r�)r�r�rKr�r7r7r8r��szBufferingFormatter.format)N)r�r�r�r�r�r�r�r�r7r7r7r8r�s


c@s"eZdZdZddd�Zdd�ZdS)	ra�
    Filter instances are used to perform arbitrary filtering of LogRecords.

    Loggers and Handlers can optionally use Filter instances to filter
    records as desired. The base filter class only allows events which are
    below a certain point in the logger hierarchy. For example, a filter
    initialized with "A.B" will allow events logged by loggers "A.B",
    "A.B.C", "A.B.C.D", "A.B.D" etc. but not "A.BB", "B.A.B" etc. If
    initialized with the empty string, all events are passed.
    r�cCs||_t|�|_dS)z�
        Initialize a filter.

        Initialize with the name of the logger which, together with its
        children, will have its events allowed through the filter. If no
        name is specified, allow every event.
        N)rbrd�nlen�r�rbr7r7r8r��szFilter.__init__cCsJ|jdkrdS|j|jkrdS|j�|jd|j�dkr:dS|j|jdkS)z�
        Determine if the specified record is to be logged.

        Returns True if the record should be logged, or False otherwise.
        If deemed appropriate, the record may be modified in-place.
        rTF�.)r�rbr�r�r7r7r8�filter�s
z
Filter.filterN)r�)r�r�r�r�r�r�r7r7r7r8r�s

c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�Filtererz[
    A base class for loggers and handlers which allows them to share
    common code.
    cCs
g|_dS)zE
        Initialize the list of filters to be an empty list.
        N)�filtersr�r7r7r8r�szFilterer.__init__cCs||jkr|j�|�dS)z;
        Add the specified filter to this handler.
        N)r��append�r�r�r7r7r8�	addFilters
zFilterer.addFiltercCs||jkr|j�|�dS)z@
        Remove the specified filter from this handler.
        N)r��remover�r7r7r8�removeFilters
zFilterer.removeFiltercCs>d}|jD].}t|d�r$|�|�}n||�}|s
d}q:q
|S)ah
        Determine if a record is loggable by consulting all the filters.

        The default is to allow the record to be logged; any filter can veto
        this and the record is then dropped. Returns a zero value if a record
        is to be dropped, else non-zero.

        .. versionchanged:: 3.2

           Allow filters to be just callables.
        Tr�F)r�rr�)r�r�rK�fr6r7r7r8r�s

zFilterer.filterN)r�r�r�r�r�r�r�r�r7r7r7r8r�s
r�cCsFttt}}}|rB|rB|rB|�z||kr6|�|�W5|�XdS)zD
    Remove a handler reference from the internal cleanup list.
    N)r9r:�_handlerListr�)�wrrNrO�handlersr7r7r8�_removeHandlerRef:sr�cCs*t�zt�t�|t��W5t�XdS)zL
    Add a handler to the internal cleanup list using a weak reference.
    N)r9r:r�r��weakref�refr�)r\r7r7r8�_addHandlerRefKsr�c@s�eZdZdZefdd�Zdd�Zdd�Zeee�Z	dd	�Z
d
d�Zdd
�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd S)!raq
    Handler instances dispatch logging events to specific destinations.

    The base handler class. Acts as a placeholder which defines the Handler
    interface. Handlers can optionally use Formatter instances to format
    records as desired. By default, no formatter is specified; in this case,
    the 'raw' message as determined by record.message is logged.
    cCs4t�|�d|_t|�|_d|_t|�|��dS)zz
        Initializes the instance - basically setting the formatter to None
        and the filter list to empty.
        N)r�r��_namerLr5�	formatterr�rY�r�r5r7r7r8r�^s

zHandler.__init__cCs|jSrQ)r�r�r7r7r8�get_namekszHandler.get_namecCs<t�z(|jtkrt|j=||_|r,|t|<W5t�XdSrQ�r9r:r��	_handlersr�r7r7r8�set_namens
zHandler.set_namecCst��|_t|�dS)zU
        Acquire a thread lock for serializing access to the underlying I/O.
        N)ry�RLock�lockrTr�r7r7r8rY{s
zHandler.createLockcCs|jr|j��dS)z.
        Acquire the I/O thread lock.
        N)rrNr�r7r7r8rN�szHandler.acquirecCs|jr|j��dS)z.
        Release the I/O thread lock.
        N)rrOr�r7r7r8rO�szHandler.releasecCst|�|_dS)zX
        Set the logging level of this handler.  level must be an int or a str.
        N)rLr5r�r7r7r8�setLevel�szHandler.setLevelcCs|jr|j}nt}|�|�S)z�
        Format the specified record.

        If a formatter is set, use it. Otherwise, use the default formatter
        for the module.
        )r�r�r�)r�r�r�r7r7r8r��szHandler.formatcCstd��dS)z�
        Do whatever it takes to actually log the specified logging record.

        This version is intended to be implemented by subclasses and so
        raises a NotImplementedError.
        z.emit must be implemented by Handler subclassesN)�NotImplementedErrorr�r7r7r8�emit�szHandler.emitcCs4|�|�}|r0|��z|�|�W5|��X|S)a<
        Conditionally emit the specified logging record.

        Emission depends on filters which may have been added to the handler.
        Wrap the actual emission of the record with acquisition/release of
        the I/O thread lock. Returns whether the filter passed the record for
        emission.
        )r�rNrOr)r�r�rKr7r7r8�handle�s	

zHandler.handlecCs
||_dS)z5
        Set the formatter for this handler.
        N)r�r�r7r7r8�setFormatter�szHandler.setFormattercCsdS)z�
        Ensure all logging output has been flushed.

        This version does nothing and is intended to be implemented by
        subclasses.
        Nr7r�r7r7r8�flush�sz
Handler.flushcCs0t�z|jr |jtkr t|j=W5t�XdS)a%
        Tidy up any resources used by the handler.

        This version removes the handler from an internal map of handlers,
        _handlers, which is used for handler lookup by name. Subclasses
        should ensure that this gets called from overridden close()
        methods.
        Nr�r�r7r7r8r��s

z
Handler.closecCs t�rtj�rt��\}}}z�z�tj�d�t�|||dtj�tj�d�|j}|rvtj	�
|jj�t
dkrv|j}qR|r�tj|tjd�ntj�d|j|jf�ztj�d|j|jf�Wn4tk
r��Yn tk
r�tj�d�YnXWntk
�rYnXW5~~~XdS)	aD
        Handle errors which occur during an emit() call.

        This method should be called from handlers when an exception is
        encountered during an emit() call. If raiseExceptions is false,
        exceptions get silently ignored. This is what is mostly wanted
        for a logging system - most users will not care about errors in
        the logging system, they are more interested in application errors.
        You could, however, replace this with a custom handler if you wish.
        The record which was being processed is passed in to this method.
        z--- Logging error ---
NzCall stack:
rrWzLogged from file %s, line %s
zMessage: %r
Arguments: %s
zwUnable to print the message and arguments - possible formatting error.
Use the traceback above to help find the error.
)r,r=r[rB�writer�r�rCrkrl�dirname�f_code�co_filename�__path__rD�print_stackrnrtrcrh�RecursionErrorrA�OSError)r�r�r��vr��framer7r7r8�handleError�s<����

zHandler.handleErrorcCst|j�}d|jj|fS)Nz	<%s (%s)>)rr5�	__class__r�r�r7r7r8r�s
zHandler.__repr__N)r�r�r�r�rr�r�r��propertyrbrYrNrOrr�rrrrr�rr�r7r7r7r8rUs"



	/c@s>eZdZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)rz�
    A handler class which writes logging records, appropriately formatted,
    to a stream. Note that this class does not close the stream, as
    sys.stdout or sys.stderr may be used.
    r�NcCs"t�|�|dkrtj}||_dS)zb
        Initialize the handler.

        If stream is not specified, sys.stderr is used.
        N)rr�r=r[�stream�r�rr7r7r8r�s
zStreamHandler.__init__cCs8|��z |jr&t|jd�r&|j��W5|��XdS)z%
        Flushes the stream.
        rN)rNrOrrrr�r7r7r8r&s
zStreamHandler.flushcCsdz,|�|�}|j}|�||j�|��Wn2tk
rB�Yntk
r^|�|�YnXdS)a�
        Emit a record.

        If a formatter is specified, it is used to format the record.
        The record is then written to the stream with a trailing newline.  If
        exception information is present, it is formatted using
        traceback.print_exception and appended to the stream.  If the stream
        has an 'encoding' attribute, it is used to determine how to do the
        output to the stream.
        N)r�rr�
terminatorrr
rAr)r�r�rcrr7r7r8r1s
zStreamHandler.emitcCs@||jkrd}n,|j}|��z|��||_W5|��X|S)z�
        Sets the StreamHandler's stream to the specified value,
        if it is different.

        Returns the old stream, if the stream was changed, or None
        if it wasn't.
        N)rrNrOr)r�rr6r7r7r8�	setStreamGs


zStreamHandler.setStreamcCs>t|j�}t|jdd�}t|�}|r,|d7}d|jj||fS)Nrbr�� z<%s %s(%s)>)rr5�getattrrrHrr�)r�r5rbr7r7r8r�[s
zStreamHandler.__repr__)N)
r�r�r�r�rr�rrrr�r7r7r7r8rs
c@s:eZdZdZddd�Zdd�Zd	d
�Zdd�Zd
d�ZdS)r
zO
    A handler class which writes formatted logging records to disk files.
    �aNFcCsTt�|�}tj�|�|_||_||_||_|r@t�	|�d|_
nt�	||���dS)zO
        Open the specified file and use it as the stream for logging.
        N)
rk�fspathrl�abspath�baseFilename�mode�encoding�delayrr�rr�_open)r�rnrrr r7r7r8r�is

zFileHandler.__init__c	Csb|��zJz8|jr@z|��W5|j}d|_t|d�r>|��XW5t�|�XW5|��XdS)z$
        Closes the stream.
        Nr�)rNrOrr�rrrrr7r7r8r�}s
zFileHandler.closecCst|j|j|jd�S)zx
        Open the current base file with the (original) mode and encoding.
        Return the resulting stream.
        )r)�openrrrr�r7r7r8r!�szFileHandler._opencCs$|jdkr|��|_t�||�dS)z�
        Emit a record.

        If the stream was not opened because 'delay' was specified in the
        constructor, open it before calling the superclass's emit.
        N)rr!rrr�r7r7r8r�s

zFileHandler.emitcCst|j�}d|jj|j|fS�Nz<%s %s (%s)>)rr5rr�rr�r7r7r8r��s
zFileHandler.__repr__)rNF)	r�r�r�r�r�r�r!rr�r7r7r7r8r
es
c@s(eZdZdZefdd�Zedd��ZdS)�_StderrHandlerz�
    This class is like a StreamHandler using sys.stderr, but always uses
    whatever sys.stderr is currently set to rather than the value of
    sys.stderr at handler construction time.
    cCst�||�dS)z)
        Initialize the handler.
        N)rr�r�r7r7r8r��sz_StderrHandler.__init__cCstjSrQ)r=r[r�r7r7r8r�sz_StderrHandler.streamN)r�r�r�r�rr�rrr7r7r7r8r$�sr$c@s eZdZdZdd�Zdd�ZdS)�PlaceHolderz�
    PlaceHolder instances are used in the Manager logger hierarchy to take
    the place of nodes for which no loggers have been defined. This class is
    intended for internal use only and not as part of the public API.
    cCs|di|_dS)zY
        Initialize with the specified logger being a child of this placeholder.
        N��	loggerMap�r��aloggerr7r7r8r��szPlaceHolder.__init__cCs||jkrd|j|<dS)zJ
        Add the specified logger as a child of this placeholder.
        Nr&r(r7r7r8r��s
zPlaceHolder.appendN)r�r�r�r�r�r�r7r7r7r8r%�sr%cCs(|tkr t|t�s td|j��|adS)z�
    Set the class to be used when instantiating a logger. The class should
    define __init__() such that only a name argument is required, and the
    __init__() should call Logger.__init__()
    �(logger not derived from logging.Logger: N)r�
issubclassrJr��_loggerClass)�klassr7r7r8r%�s
�cCstS)zB
    Return the class to be used when instantiating a logger.
    )r,r7r7r7r8r!�sc@sbeZdZdZdd�Zedd��Zejdd��Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dS)�Managerzt
    There is [under normal circumstances] just one Manager instance, which
    holds the hierarchy of loggers.
    cCs(||_d|_d|_i|_d|_d|_dS)zT
        Initialize the manager with the root node of the logger hierarchy.
        rFN)�rootr�emittedNoHandlerWarning�
loggerDict�loggerClass�logRecordFactory)r�Zrootnoder7r7r8r��szManager.__init__cCs|jSrQ)�_disabler�r7r7r8r�szManager.disablecCst|�|_dSrQ)rLr4�r��valuer7r7r8rscCs�d}t|t�std��t�z�||jkrv|j|}t|t�r�|}|jpHt|�}||_	||j|<|�
||�|�|�n(|jp~t|�}||_	||j|<|�|�W5t�X|S)a�
        Get a logger with the specified name (channel name), creating it
        if it doesn't yet exist. This name is a dot-separated hierarchical
        name, such as "a", "a.b", "a.b.c" or similar.

        If a PlaceHolder existed for the specified name [i.e. the logger
        didn't exist but a child of it did], replace it with the created
        logger and fix up the parent/child references which pointed to the
        placeholder to now point to the logger.
        NzA logger name must be a string)rFrHrJr9r:r1r%r2r,�manager�_fixupChildren�
_fixupParents)r�rbrK�phr7r7r8r s(





zManager.getLoggercCs*|tkr t|t�s td|j��||_dS)zY
        Set the class to be used when instantiating a logger with this Manager.
        r*N)rr+rJr�r2)r�r-r7r7r8r%&s
�zManager.setLoggerClasscCs
||_dS)zg
        Set the factory to be used when instantiating a log record with this
        Manager.
        N)r3)r�r�r7r7r8r*0szManager.setLogRecordFactorycCs�|j}|�d�}d}|dkr~|s~|d|�}||jkrFt|�|j|<n$|j|}t|t�r`|}n
|�|�|�dd|d�}q|s�|j}||_dS)z�
        Ensure that there are either loggers or placeholders all the way
        from the specified logger to the root of the logger hierarchy.
        r�Nrr_)	rb�rfindr1r%rFrr�r/�parent)r�r)rb�irKZsubstr�objr7r7r8r97s




zManager._fixupParentscCsD|j}t|�}|j��D]&}|jjd|�|kr|j|_||_qdS)zk
        Ensure that children of the placeholder ph are connected to the
        specified logger.
        N)rbrdr'r�r<)r�r:r)rbZnamelen�cr7r7r8r8OszManager._fixupChildrencCs@t�|j��D]}t|t�r|j��q|jj��t�dS)zj
        Clear the cache for all loggers in loggerDict
        Called when level changes are made
        N)	r9r1�valuesrFr�_cache�clearr/r:�r��loggerr7r7r8�_clear_cache\s
zManager._clear_cacheN)r�r�r�r�r�rr�setterr r%r*r9r8rEr7r7r7r8r.�s

"

r.c@s�eZdZdZefdd�Zdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�dd�Zdd�Z
e
Zdd�Zd5dd�Zd6dd�Zd7dd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�ZdS)8rar
    Instances of the Logger class represent a single logging channel. A
    "logging channel" indicates an area of an application. Exactly how an
    "area" is defined is up to the application developer. Since an
    application can have any number of areas, logging channels are identified
    by a unique string. Application areas can be nested (e.g. an area
    of "input processing" might include sub-areas "read CSV files", "read
    XLS files" and "read Gnumeric files"). To cater for this natural nesting,
    channel names are organized into a namespace hierarchy where levels are
    separated by periods, much like the Java or Python package namespace. So
    in the instance given above, channel names might be "input" for the upper
    level, and "input.csv", "input.xls" and "input.gnu" for the sub-levels.
    There is no arbitrary limit to the depth of nesting.
    cCs<t�|�||_t|�|_d|_d|_g|_d|_i|_	dS)zJ
        Initialize the logger with a name and an optional level.
        NTF)
r�r�rbrLr5r<�	propagater��disabledrA)r�rbr5r7r7r8r�|s

zLogger.__init__cCst|�|_|j��dS)zW
        Set the logging level of this logger.  level must be an int or a str.
        N)rLr5r7rEr�r7r7r8r�s
zLogger.setLevelcOs |�t�r|jt||f|�dS)z�
        Log 'msg % args' with severity 'DEBUG'.

        To pass exception information, use the keyword argument exc_info with
        a true value, e.g.

        logger.debug("Houston, we have a %s", "thorny problem", exc_info=1)
        N)�isEnabledForr�_log�r�rcrhr�r7r7r8r�s	
zLogger.debugcOs |�t�r|jt||f|�dS)z�
        Log 'msg % args' with severity 'INFO'.

        To pass exception information, use the keyword argument exc_info with
        a true value, e.g.

        logger.info("Houston, we have a %s", "interesting problem", exc_info=1)
        N)rIr
rJrKr7r7r8r"�s	
zLogger.infocOs |�t�r|jt||f|�dS)z�
        Log 'msg % args' with severity 'WARNING'.

        To pass exception information, use the keyword argument exc_info with
        a true value, e.g.

        logger.warning("Houston, we have a %s", "bit of a problem", exc_info=1)
        N)rIrrJrKr7r7r8r(�s	
zLogger.warningcOs$t�dtd�|j|f|�|�dS�Nz6The 'warn' method is deprecated, use 'warning' insteadr@��warningsr'�DeprecationWarningr(rKr7r7r8r'�s
�zLogger.warncOs |�t�r|jt||f|�dS)z�
        Log 'msg % args' with severity 'ERROR'.

        To pass exception information, use the keyword argument exc_info with
        a true value, e.g.

        logger.error("Houston, we have a %s", "major problem", exc_info=1)
        N)rIrrJrKr7r7r8r�s	
zLogger.errorT�rBcOs|j|f|�d|i|��dS)zU
        Convenience method for logging an ERROR with exception information.
        rBN�r�r�rcrBrhr�r7r7r8r�szLogger.exceptioncOs |�t�r|jt||f|�dS)z�
        Log 'msg % args' with severity 'CRITICAL'.

        To pass exception information, use the keyword argument exc_info with
        a true value, e.g.

        logger.critical("Houston, we have a %s", "major disaster", exc_info=1)
        N)rIrrJrKr7r7r8r�s	
zLogger.criticalcOs<t|t�strtd��ndS|�|�r8|j|||f|�dS)z�
        Log 'msg % args' with the integer severity 'level'.

        To pass exception information, use the keyword argument exc_info with
        a true value, e.g.

        logger.log(level, "We have a %s", "mysterious problem", exc_info=1)
        zlevel must be an integerN)rFrGr,rJrIrJ�r�r5rcrhr�r7r7r8r#�s	


z
Logger.logFr_c
Cs�t�}|dk	r|j}|}|r4|dkr4|j}|d8}q|s<|}d}t|d�r�|j}tj�|j�}|tkrn|j}q@d}|r�t	�
�}	|	�d�tj
||	d�|	��}|ddkr�|dd�}|	��|j|j|j|f}q�q@|S)	z�
        Find the stack frame of the caller so that we can note the source
        file name, line number and function name.
        Nr_)�(unknown file)r�(unknown function)Nr	zStack (most recent call last):
rWr�r�)rErDrr	rkrl�normcaser
�_srcfiler�r�rr�rr�r��f_lineno�co_name)
r�rs�
stacklevelr�Zorig_frK�cornr�r�r7r7r8�
findCaller�s8


zLogger.findCallerNc

CsZt|||||||||
�	}|	dk	rV|	D]0}|dks:||jkrFtd|��|	||j|<q$|S)zr
        A factory method which can be overridden in subclasses to create
        specialized LogRecords.
        N)r�r�z$Attempt to overwrite %r in LogRecord)r�r�r�)
r�rbr5�fn�lnorcrhrBr��extrar�rK�keyr7r7r8�
makeRecords�zLogger.makeRecordc
Cs�d}trBz|�||�\}	}
}}WqLtk
r>d\}	}
}YqLXn
d\}	}
}|r~t|t�rlt|�||jf}nt|t�s~t�	�}|�
|j||	|
||||||�
}|�|�dS)z�
        Low-level logging routine which creates a LogRecord and then calls
        all the handlers of this logger to handle the record.
        N)rTrrU)
rWr\rIrF�
BaseException�type�
__traceback__�tupler=rBrarbr)
r�r5rcrhrBr_rsrZr�r]r^r�r�r7r7r8rJs&


�zLogger._logcCs|js|�|�r|�|�dS)z�
        Call the handlers for the specified record.

        This method is used for unpickled records received from a socket, as
        well as those created locally. Logger-level filtering is applied.
        N)rHr��callHandlersr�r7r7r8r7sz
Logger.handlecCs.t�z||jkr|j�|�W5t�XdS)z;
        Add the specified handler to this logger.
        N)r9r:r�r��r��hdlrr7r7r8�
addHandlerAs

zLogger.addHandlercCs.t�z||jkr|j�|�W5t�XdS)z@
        Remove the specified handler from this logger.
        N)r9r:r�r�rgr7r7r8�
removeHandlerLs

zLogger.removeHandlercCs.|}d}|r*|jrd}q*|js"q*q|j}q|S)a�
        See if this logger has any handlers configured.

        Loop through all handlers for this logger and its parents in the
        logger hierarchy. Return True if a handler was found, else False.
        Stop searching up the hierarchy whenever a logger with the "propagate"
        attribute set to zero is found - that will be the last logger which
        is checked for the existence of handlers.
        FT)r�rGr<)r�r?rKr7r7r8�hasHandlersWs
zLogger.hasHandlerscCs�|}d}|rJ|jD]"}|d}|j|jkr|�|�q|jsBd}q|j}q|dkr�trn|jtjkr�t�|�n&tr�|jj	s�t
j�d|j
�d|j_	dS)a�
        Pass a record to all relevant handlers.

        Loop through all handlers for this logger and its parents in the
        logger hierarchy. If no handler was found, output a one-off error
        message to sys.stderr. Stop searching up the hierarchy whenever a
        logger with the "propagate" attribute set to zero is found - that
        will be the last logger whose handlers are called.
        rr_Nz+No handlers could be found for logger "%s"
T)r�rir5rrGr<r+r,r7r0r=r[rrb)r�r�r?�foundrhr7r7r8rfms&

�zLogger.callHandlerscCs |}|r|jr|jS|j}qtS)z�
        Get the effective level for this logger.

        Loop through this logger and its parents in the logger hierarchy,
        looking for a non-zero logging level. Return the first one found.
        )r5r<rrCr7r7r8�getEffectiveLevel�szLogger.getEffectiveLevelc
Csz|jr
dSz|j|WStk
rtt�z6|jj|krJd}|j|<n||��k}|j|<W5t�X|YSXdS)�;
        Is this logger enabled for level 'level'?
        FN)rHrAr�r9r:r7rrm)r�r5Z
is_enabledr7r7r8rI�s
�zLogger.isEnabledForcCs&|j|k	rd�|j|f�}|j�|�S)ab
        Get a logger which is a descendant to this one.

        This is a convenience method, such that

        logging.getLogger('abc').getChild('def.ghi')

        is the same as

        logging.getLogger('abc.def.ghi')

        It's useful, for example, when the parent logger is named using
        __name__ rather than a literal string.
        r�)r/r�rbr7r )r��suffixr7r7r8�getChild�s
zLogger.getChildcCs t|���}d|jj|j|fSr#)rrmrr�rbr�r7r7r8r��szLogger.__repr__cCs,t|j�|k	r ddl}|�d��t|jffS)Nrzlogger cannot be pickled)r rb�pickleZ
PicklingError)r�rqr7r7r8�
__reduce__�s
zLogger.__reduce__)Fr_)NNN)NNFr_)r�r�r�r�rr�rrr"r(r'rrrrr#r\rarJrrirjrkrfrmrIrpr�rrr7r7r7r8rms<

%�
�

c@s eZdZdZdd�Zdd�ZdS)�
RootLoggerz�
    A root logger is not that different to any other logger, except that
    it must have a logging level and there is only one instance of it in
    the hierarchy.
    cCst�|d|�dS)z=
        Initialize the logger with the name "root".
        r/N)rr�r�r7r7r8r��szRootLogger.__init__cCstdfS)Nr7)r r�r7r7r8rr�szRootLogger.__reduce__N)r�r�r�r�r�rrr7r7r7r8rs�srsc@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd+d"d#�Zed$d%��Zejd&d%��Zed'd(��Zd)d*�Zd S),rzo
    An adapter for loggers which makes it easier to specify contextual
    information in logging output.
    cCs||_||_dS)ax
        Initialize the adapter with a logger and a dict-like object which
        provides contextual information. This constructor signature allows
        easy stacking of LoggerAdapters, if so desired.

        You can effectively pass keyword arguments as shown in the
        following example:

        adapter = LoggerAdapter(someLogger, dict(p1=v1, p2="v2"))
        N)rDr_)r�rDr_r7r7r8r��szLoggerAdapter.__init__cCs|j|d<||fS)a�
        Process the logging message and keyword arguments passed in to
        a logging call to insert contextual information. You can either
        manipulate the message itself, the keyword args or both. Return
        the message and kwargs modified (or not) to suit your needs.

        Normally, you'll only need to override this one method in a
        LoggerAdapter subclass for your specific needs.
        r_)r_)r�rcr�r7r7r8r��s

zLoggerAdapter.processcOs|jt|f|�|�dS)zA
        Delegate a debug call to the underlying logger.
        N)r#rrKr7r7r8rszLoggerAdapter.debugcOs|jt|f|�|�dS)zA
        Delegate an info call to the underlying logger.
        N)r#r
rKr7r7r8r"
szLoggerAdapter.infocOs|jt|f|�|�dS)zC
        Delegate a warning call to the underlying logger.
        N)r#rrKr7r7r8r(szLoggerAdapter.warningcOs$t�dtd�|j|f|�|�dSrLrMrKr7r7r8r's
�zLoggerAdapter.warncOs|jt|f|�|�dS)zB
        Delegate an error call to the underlying logger.
        N�r#rrKr7r7r8rszLoggerAdapter.errorTrPcOs |jt|f|�d|i|��dS)zF
        Delegate an exception call to the underlying logger.
        rBNrtrRr7r7r8r!szLoggerAdapter.exceptioncOs|jt|f|�|�dS)zD
        Delegate a critical call to the underlying logger.
        N)r#rrKr7r7r8r'szLoggerAdapter.criticalcOs4|�|�r0|�||�\}}|jj||f|�|�dS)z�
        Delegate a log call to the underlying logger, after adding
        contextual information from this adapter instance.
        N)rIr�rDr#rSr7r7r8r#-s
zLoggerAdapter.logcCs|j�|�S)rn)rDrIr�r7r7r8rI6szLoggerAdapter.isEnabledForcCs|j�|�dS)zC
        Set the specified level on the underlying logger.
        N)rDrr�r7r7r8r<szLoggerAdapter.setLevelcCs
|j��S)zD
        Get the effective level for the underlying logger.
        )rDrmr�r7r7r8rmBszLoggerAdapter.getEffectiveLevelcCs
|j��S)z@
        See if the underlying logger has any handlers.
        )rDrkr�r7r7r8rkHszLoggerAdapter.hasHandlersNFcCs|jj||||||d�S)zX
        Low-level log implementation, proxied to allow nested logger adapters.
        )rBr_rs)rDrJ)r�r5rcrhrBr_rsr7r7r8rJNs�zLoggerAdapter._logcCs|jjSrQ�rDr7r�r7r7r8r7[szLoggerAdapter.managercCs||j_dSrQrur5r7r7r8r7_scCs|jjSrQ)rDrbr�r7r7r8rbcszLoggerAdapter.namecCs&|j}t|���}d|jj|j|fSr#)rDrrmrr�rb)r�rDr5r7r7r8r�gszLoggerAdapter.__repr__)NNF)r�r�r�r�r�r�rr"r(r'rrrr#rIrrmrkrJrr7rFrbr�r7r7r7r8r�s.	




c
Ks�t��z�|�dd�}|r@tjdd�D]}t�|�|��q(ttj�dk�r�|�dd�}|dkr~d|kr�d|kr�td��nd|ks�d|kr�td	��|dkr�|�dd�}|�d
d�}|r�t	||�}n|�dd�}t
|�}|g}|�dd�}|�d
d�}|tk�rtdd�t�
����|�dt|d�}	t|	||�}
|D]&}|jdk�rV|�|
�t�|��q<|�dd�}|dk	�r�t�|�|�r�d�|�
��}td|��W5t�XdS)a'
    Do basic configuration for the logging system.

    This function does nothing if the root logger already has handlers
    configured, unless the keyword argument *force* is set to ``True``.
    It is a convenience method intended for use by simple scripts
    to do one-shot configuration of the logging package.

    The default behaviour is to create a StreamHandler which writes to
    sys.stderr, set a formatter using the BASIC_FORMAT format string, and
    add the handler to the root logger.

    A number of optional keyword arguments may be specified, which can alter
    the default behaviour.

    filename  Specifies that a FileHandler be created, using the specified
              filename, rather than a StreamHandler.
    filemode  Specifies the mode to open the file, if filename is specified
              (if filemode is unspecified, it defaults to 'a').
    format    Use the specified format string for the handler.
    datefmt   Use the specified date/time format.
    style     If a format string is specified, use this to specify the
              type of format string (possible values '%', '{', '$', for
              %-formatting, :meth:`str.format` and :class:`string.Template`
              - defaults to '%').
    level     Set the root logger level to the specified level.
    stream    Use the specified stream to initialize the StreamHandler. Note
              that this argument is incompatible with 'filename' - if both
              are present, 'stream' is ignored.
    handlers  If specified, this should be an iterable of already created
              handlers, which will be added to the root handler. Any handler
              in the list which does not have a formatter assigned will be
              assigned the formatter created in this function.
    force     If this keyword  is specified as true, any existing handlers
              attached to the root logger are removed and closed, before
              carrying out the configuration as specified by the other
              arguments.
    Note that you could specify a stream created using open(filename, mode)
    rather than passing the filename and mode in. However, it should be
    remembered that StreamHandler does not close its stream (since it may be
    using sys.stdout or sys.stderr), whereas FileHandler closes its stream
    when the handler is closed.

    .. versionchanged:: 3.8
       Added the ``force`` parameter.

    .. versionchanged:: 3.2
       Added the ``style`` parameter.

    .. versionchanged:: 3.3
       Added the ``handlers`` parameter. A ``ValueError`` is now thrown for
       incompatible arguments (e.g. ``handlers`` specified together with
       ``filename``/``filemode``, or ``filename``/``filemode`` specified
       together with ``stream``, or ``handlers`` specified together with
       ``stream``.
    �forceFNrr�rrnz8'stream' and 'filename' should not be specified togetherzG'stream' or 'filename' should not be specified together with 'handlers'�filemoderr�r�r�r�r�r�r_r5z, zUnrecognised argument(s): %s)r9r:�popr/r�rjr�rdrIr
rr�r�r�rr�rrir)
r�rv�hr�rnrrZdfsr�Zfsr�r5r�r7r7r8rtsR;



�


cCs|rtj�|�StSdS)z�
    Return a logger with the specified name, creating it if necessary.

    If no name is specified, return the root logger.
    N)rr7r r/)rbr7r7r8r �scOs*ttj�dkrt�tj|f|�|�dS)z�
    Log a message with severity 'CRITICAL' on the root logger. If the logger
    has no handlers, call basicConfig() to add a console handler with a
    pre-defined format.
    rN)rdr/r�rr�rcrhr�r7r7r8r�scOs*ttj�dkrt�tj|f|�|�dS)z�
    Log a message with severity 'ERROR' on the root logger. If the logger has
    no handlers, call basicConfig() to add a console handler with a pre-defined
    format.
    rN)rdr/r�rrrzr7r7r8r�srPcOst|f|�d|i|��dS)z�
    Log a message with severity 'ERROR' on the root logger, with exception
    information. If the logger has no handlers, basicConfig() is called to add
    a console handler with a pre-defined format.
    rBNrQ)rcrBrhr�r7r7r8rscOs*ttj�dkrt�tj|f|�|�dS)z�
    Log a message with severity 'WARNING' on the root logger. If the logger has
    no handlers, call basicConfig() to add a console handler with a pre-defined
    format.
    rN)rdr/r�rr(rzr7r7r8r(scOs"t�dtd�t|f|�|�dS)Nz8The 'warn' function is deprecated, use 'warning' insteadr@rMrzr7r7r8r's
�cOs*ttj�dkrt�tj|f|�|�dS)z�
    Log a message with severity 'INFO' on the root logger. If the logger has
    no handlers, call basicConfig() to add a console handler with a pre-defined
    format.
    rN)rdr/r�rr"rzr7r7r8r"scOs*ttj�dkrt�tj|f|�|�dS)z�
    Log a message with severity 'DEBUG' on the root logger. If the logger has
    no handlers, call basicConfig() to add a console handler with a pre-defined
    format.
    rN)rdr/r�rrrzr7r7r8r$scOs,ttj�dkrt�tj||f|�|�dS)z�
    Log 'msg % args' with the integer severity 'level' on the root logger. If
    the logger has no handlers, call basicConfig() to add a console handler
    with a pre-defined format.
    rN)rdr/r�rr#)r5rcrhr�r7r7r8r#.scCs|tj_tj��dS)zB
    Disable all logging calls of severity 'level' and below.
    N)r/r7rrE)r5r7r7r8r8sc
Cs�t|dd��D]l}zT|�}|rfz:z|��|��|��Wnttfk
rVYnXW5|��XWqtrv�YqXqdS)z�
    Perform any cleanup actions in the logging system (e.g. flushing
    buffers).

    Should be called at application exit.
    N)�reversedrOrNrr�rrIr,)ZhandlerListr�ryr7r7r8r&?s
c@s(eZdZdZdd�Zdd�Zdd�ZdS)	ra�
    This handler does nothing. It's intended to be used to avoid the
    "No handlers could be found for logger XXX" one-off warning. This is
    important for library code, which may contain code to log events. If a user
    of the library does not configure logging, the one-off warning might be
    produced; to avoid this, the library developer simply needs to instantiate
    a NullHandler and add it to the top-level logger of the library module or
    package.
    cCsdS�zStub.Nr7r�r7r7r8rmszNullHandler.handlecCsdSr|r7r�r7r7r8rpszNullHandler.emitcCs
d|_dSrQ)rr�r7r7r8rYsszNullHandler.createLockN)r�r�r�r�rrrYr7r7r7r8rcs	cCs`|dk	r$tdk	r\t||||||�n8t�|||||�}td�}|jsP|�t��|�d|�dS)a�
    Implementation of showwarnings which redirects to logging, which will first
    check to see if the file parameter is None. If a file is specified, it will
    delegate to the original warnings implementation of showwarning. Otherwise,
    it will call warnings.formatwarning and will log the resulting string to a
    warnings logger named "py.warnings" with level logging.WARNING.
    Nzpy.warningsz%s)�_warnings_showwarningrN�
formatwarningr r�rirr()r��categoryrnrtrX�liner�rDr7r7r8�_showwarningzsr�cCs0|rtdkr,tjatt_ntdk	r,tt_dadS)z�
    If capture is true, redirect all warnings to the logging package.
    If capture is False, ensure that warnings are not redirected to logging
    but to their original destinations.
    N)r}rN�showwarningr�)Zcapturer7r7r8r�s)N)NN)or�r=rkrar�r�r�rNr�Zcollections.abcre�stringrrZStrFormatter�__all__ry�
__author__Z
__status__�__version__Z__date__rwr,rxr|r~rr	rrrr
rrr2r4rrrrErlrV�__code__r
rWrLr�rMr9r:rTZWeakSetrUr^rP�objectrr�r*r)r$r�r�r�r�rr�r�rrr�ZWeakValueDictionaryr�r�r�r�rrr
r$Z_defaultLastResortr+r%r%r!r.rrsr,rr/r7rr rrrrr(r'r"rr#rr&�atexit�registerrr}r�rr7r7r7r8�<module>sN	H
�
	
�	�

	

�	g
�1*%4
>SE
d
n








logging/__pycache__/handlers.cpython-38.opt-2.pyc000064400000057655151153537460015626 0ustar00U

e5dq��@svddlZddlZddlZddlZddlZddlZddlZddlmZm	Z	m
Z
ddlZddlZddl
Z
dZdZdZdZdZdZdZGd	d
�d
ej�ZGdd�de�ZGd
d�de�ZGdd�dej�ZGdd�dej�ZGdd�de�ZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd�dej�Z Gdd�dej�Z!Gdd �d e!�Z"Gd!d"�d"ej�Z#Gd#d$�d$e$�Z%dS)%�N)�ST_DEV�ST_INO�ST_MTIMEi<#i=#i>#i?#i�Qc@s.eZdZddd�Zdd�Zdd�Zd	d
�ZdS)�BaseRotatingHandlerNFcCs0tj�|||||�||_||_d|_d|_dS�N)�logging�FileHandler�__init__�mode�encoding�namer�rotator��self�filenamerr�delay�r�(/usr/lib64/python3.8/logging/handlers.pyr
3s
zBaseRotatingHandler.__init__cCsHz$|�|�r|��tj�||�Wntk
rB|�|�YnXdSr)�shouldRollover�
doRolloverrr	�emit�	Exception�handleError�r�recordrrrr=s
zBaseRotatingHandler.emitcCst|j�s|}n
|�|�}|Sr)�callabler
)rZdefault_name�resultrrr�rotation_filenameKs

z%BaseRotatingHandler.rotation_filenamecCs4t|j�s$tj�|�r0t�||�n|�||�dSr)rr�os�path�exists�rename)r�source�destrrr�rotate^s
zBaseRotatingHandler.rotate)NF)�__name__�
__module__�__qualname__r
rrr%rrrrr-s

rc@s&eZdZddd�Zdd�Zd	d
�ZdS)�RotatingFileHandler�arNFcCs.|dkrd}t�|||||�||_||_dS)Nrr*)rr
�maxBytes�backupCount)rrrr+r,rrrrrr
xs
zRotatingFileHandler.__init__cCs�|jr|j��d|_|jdkr�t|jddd�D]^}|�d|j|f�}|�d|j|df�}tj�|�r2tj�|�r�t�	|�t�
||�q2|�|jd�}tj�|�r�t�	|�|�|j|�|js�|�
�|_dS)Nr����z%s.%dz.1)�stream�closer,�ranger�baseFilenamerr r!�remover"r%r�_open)r�iZsfn�dfnrrrr�s&


�

zRotatingFileHandler.doRollovercCsZ|jdkr|��|_|jdkrVd|�|�}|j�dd�|j��t|�|jkrVdSdS)Nrz%s
�r-)r/r4r+�format�seek�tell�len�rr�msgrrrr�s


z"RotatingFileHandler.shouldRollover)r*rrNF)r&r'r(r
rrrrrrr)ss
 r)c@s6eZdZddd�Zdd	�Zd
d�Zdd
�Zdd�ZdS)�TimedRotatingFileHandler�hr-rNFc	
Cs�t�||d||�|��|_||_||_||_|jdkrLd|_d|_d|_	n�|jdkrjd|_d|_d	|_	n�|jd
kr�d|_d|_d
|_	n�|jdks�|jdkr�d|_d|_d|_	n�|j�
d��r*d|_t|j�dkr�td|j��|jddks�|jddk�rtd|j��t
|jd�|_d|_d|_	ntd|j��t�|j	tj�|_	|j||_|j}tj�|��rzt�|�t}	nt
t���}	|�|	�|_dS)Nr*�Sr-z%Y-%m-%d_%H-%M-%Sz-^\d{4}-\d{2}-\d{2}_\d{2}-\d{2}-\d{2}(\.\w+)?$�M�<z%Y-%m-%d_%H-%Mz'^\d{4}-\d{2}-\d{2}_\d{2}-\d{2}(\.\w+)?$�H�z%Y-%m-%d_%Hz!^\d{4}-\d{2}-\d{2}_\d{2}(\.\w+)?$�D�MIDNIGHTrz%Y-%m-%dz^\d{4}-\d{2}-\d{2}(\.\w+)?$�Wi�:	r7zHYou must specify a day for weekly rollover from 0 to 6 (0 is Monday): %s�0�6z-Invalid day specified for weekly rollover: %sz'Invalid rollover interval specified: %s)rr
�upper�whenr,�utc�atTime�interval�suffix�extMatch�
startswithr;�
ValueError�int�	dayOfWeek�re�compile�ASCIIr2rr r!�statr�time�computeRollover�
rolloverAt)
rrrKrNr,rrrLrM�trrrr
�sL



z!TimedRotatingFileHandler.__init__cCsd||j}|jdks"|j�d��r`|jr4t�|�}n
t�|�}|d}|d}|d}|d}|jdkrnt}n |jj	d|jj
d|jj}||d|d|}	|	dkr�|	t7}	|d	d
}||	}|j�d��r`|}
|
|jk�r`|
|jkr�|j|
}nd|
|jd	}||d}|j�s\|d}
t�|�d}|
|k�r\|
�sPd
}nd}||7}|}|S)NrFrG����rBrr-�rr.���rD)
rNrKrQrLrY�gmtime�	localtimerM�	_MIDNIGHTZhourZminute�secondrT)r�currentTimerr\ZcurrentHourZ
currentMinuteZ
currentSecondZ
currentDayZ	rotate_ts�rZdayZ
daysToWait�
newRolloverAt�dstNow�
dstAtRollover�addendrrrrZsL


��

z(TimedRotatingFileHandler.computeRollovercCstt���}||jkrdSdS)Nr-r)rSrYr[)rrr\rrrrIs
z'TimedRotatingFileHandler.shouldRolloverc	Cs�tj�|j�\}}t�|�}g}|d}t|�}|D]@}|d|�|kr4||d�}|j�|�r4|�tj�	||��q4t|�|j
kr�g}n|��|dt|�|j
�}|S)N�.)rr �splitr2�listdirr;rP�match�append�joinr,�sort)	rZdirNameZbaseNameZ	fileNamesr�prefixZplenZfileNamerOrrr�getFilesToDeleteUs
z)TimedRotatingFileHandler.getFilesToDeletecCsv|jr|j��d|_tt���}t�|�d}|j|j}|jrNt�|�}n6t�|�}|d}||kr�|rrd}nd}t�||�}|�	|j
dt�|j|��}t
j�|�r�t
�|�|�|j
|�|jdkr�|��D]}t
�|�q�|js�|��|_|�|�}	|	|k�r|	|j}	�q|jdk�s4|j�d��rl|j�slt�|	�d}
||
k�rl|�s`d}nd}|	|7}	|	|_dS)Nr.rDrbrmrrFrG)r/r0rSrYrdr[rNrLrcrr2�strftimerOrr r!r3r%r,rurr4rZrKrQ)rrgrjr\Z	timeTupleZdstThenrlr6�srirkrrrrlsJ

�




"
z#TimedRotatingFileHandler.doRollover)r?r-rNFFN)r&r'r(r
rZrrurrrrrr>�s

9Ir>c@s.eZdZddd�Zdd�Zdd	�Zd
d�ZdS)
�WatchedFileHandlerr*NFcCs,tj�|||||�d\|_|_|��dS)N)r.r.)rr	r
�dev�ino�_statstreamrrrrr
�szWatchedFileHandler.__init__cCs0|jr,t�|j���}|t|t|_|_dSr)r/r�fstat�filenorrryrz�rZsresrrrr{�szWatchedFileHandler._statstreamcCs�zt�|j�}Wntk
r(d}YnX|rJ|t|jksJ|t|jkr�|jdk	r�|j�	�|j�
�d|_|��|_|��dSr)
rrXr2�FileNotFoundErrorrryrrzr/�flushr0r4r{r~rrr�reopenIfNeeded�s
 



z!WatchedFileHandler.reopenIfNeededcCs|��tj�||�dSr)r�rr	rrrrrr�szWatchedFileHandler.emit)r*NF)r&r'r(r
r{r�rrrrrrx�s
rxc@sNeZdZdd�Zddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dS)�
SocketHandlercCsZtj�|�||_||_|dkr(||_n
||f|_d|_d|_d|_d|_	d|_
d|_dS)NFg�?g>@g@)r�Handlerr
�host�port�address�sock�closeOnError�	retryTime�
retryStart�retryMax�retryFactor�rr�r�rrrr
�s
zSocketHandler.__init__r-cCsj|jdk	rtj|j|d�}nJt�tjtj�}|�|�z|�|j�Wntk
rd|�	��YnX|S)N��timeout)
r��socketZcreate_connectionr��AF_UNIX�SOCK_STREAMZ
settimeout�connect�OSErrorr0)rr�rrrr�
makeSocket	s

zSocketHandler.makeSocketcCs�t��}|jdkrd}n
||jk}|r�z|��|_d|_WnVtk
r�|jdkr^|j|_n"|j|j|_|j|jkr�|j|_||j|_YnXdS�NT)	rYr�r�r�r�r�ZretryPeriodr�r�)rZnowZattemptrrr�createSockets





zSocketHandler.createSocketcCsR|jdkr|��|jrNz|j�|�Wn$tk
rL|j��d|_YnXdSr)r�r��sendallr�r0�rrwrrr�send6s

zSocketHandler.sendcCsj|j}|r|�|�}t|j�}|��|d<d|d<d|d<|�dd�t�|d�}t�	dt
|��}||S)Nr=�args�exc_info�messager-z>L)r�r8�dict�__dict__Z
getMessage�pop�pickle�dumps�structZpackr;)rrZeiZdummy�drwZslenrrr�
makePickleIs

zSocketHandler.makePicklecCs0|jr|jr|j��d|_ntj�||�dSr)r�r�r0rr�rrrrrr_s
zSocketHandler.handleErrorcCs<z|�|�}|�|�Wntk
r6|�|�YnXdSr)r�r�rr)rrrwrrrrms
	
zSocketHandler.emitcCs@|��z(|j}|r"d|_|��tj�|�W5|��XdSr)�acquire�releaser�r0rr�)rr�rrrr0|szSocketHandler.closeN)r-)r&r'r(r
r�r�r�r�rrr0rrrrr��s

r�c@s$eZdZdd�Zdd�Zdd�ZdS)�DatagramHandlercCst�|||�d|_dS)NF)r�r
r�r�rrrr
�szDatagramHandler.__init__cCs*|jdkrtj}ntj}t�|tj�}|Sr)r�r�r�ZAF_INET�
SOCK_DGRAM)rZfamilyrwrrrr��s

zDatagramHandler.makeSocketcCs&|jdkr|��|j�||j�dSr)r�r��sendtor�r�rrrr��s
zDatagramHandler.sendN)r&r'r(r
r�r�rrrrr��sr�c@seZdZdZdZdZdZdZdZdZ	dZ
dZdZdZ
dZdZdZdZdZd	Zd
ZdZdZd
ZdZdZdZdZdZdZdZeeee
eeee	eeeed�Zeeeeeeee
eeeeeeeeeeeeed�Z dddddd�Z!de"fedfdd �Z#d!d"�Z$d#d$�Z%d%d&�Z&d'd(�Z'd)Z(d*Z)d+d,�Z*dS)-�
SysLogHandlerrr-r7r]r^r_r`ra��	�
���������)ZalertZcrit�critical�debugZemerg�err�error�infoZnoticeZpanic�warn�warning)ZauthZauthprivZcron�daemonZftpZkernZlprZmailZnewsZsecurityZsyslog�userZuucpZlocal0Zlocal1Zlocal2Zlocal3Zlocal4Zlocal5Zlocal6Zlocal7r�r�r�r�r�)�DEBUG�INFO�WARNING�ERROR�CRITICALZ	localhostNcCs4tj�|�||_||_||_t|t�rTd|_z|�	|�Wnt
k
rPYnXn�d|_|dkrhtj}|\}}t�
||d|�}|s�t
d��|D]�}|\}}}	}
}d}}
z.t�|||	�}
|tjkr�|
�|�W�qWq�t
k
�r}z|}|
dk	�r|
��W5d}~XYq�Xq�|dk	�r$|�|
|_||_dS)NTFrz!getaddrinfo returns an empty list)rr�r
r��facility�socktype�
isinstance�str�
unixsocket�_connect_unixsocketr�r�r�Zgetaddrinfor�r�r0)rr�r�r�r�r�Zress�resZaf�proto�_Zsar�r��excrrrr
sB





zSysLogHandler.__init__cCs�|j}|dkrtj}t�tj|�|_z|j�|�||_Wnxtk
r�|j��|jdk	r`�tj}t�tj|�|_z|j�|�||_Wn tk
r�|j���YnXYnXdSr)r�r�r�r�r�r�r0r�)rr�Zuse_socktyperrrr�Qs&




z!SysLogHandler._connect_unixsocketcCs4t|t�r|j|}t|t�r(|j|}|d>|BS)Nr])r�r��facility_names�priority_names)rr�Zpriorityrrr�encodePriorityis




zSysLogHandler.encodePrioritycCs2|��z|j��tj�|�W5|��XdSr)r�r�r�r0rr��rrrrr0vs

zSysLogHandler.closecCs|j�|d�S)Nr�)�priority_map�get)rZ	levelNamerrr�mapPriority�szSysLogHandler.mapPriority�TcCsz�|�|�}|jr|j|}|jr*|d7}d|�|j|�|j��}|�d�}|�d�}||}|jr�z|j	�
|�Wq�tk
r�|j	��|�
|j�|j	�
|�Yq�Xn*|jt	jkr�|j	�||j�n|j	�|�Wntk
r�|�|�YnXdS)N�z<%d>�utf-8)r8�ident�
append_nulr�r�r�Z	levelname�encoder�r�r�r�r0r�r�r�r�r�r�rr)rrr=Zpriorrrr�s0



�


zSysLogHandler.emit)+r&r'r(Z	LOG_EMERGZ	LOG_ALERTZLOG_CRITZLOG_ERRZLOG_WARNINGZ
LOG_NOTICEZLOG_INFOZ	LOG_DEBUGZLOG_KERNZLOG_USERZLOG_MAILZ
LOG_DAEMONZLOG_AUTHZ
LOG_SYSLOGZLOG_LPRZLOG_NEWSZLOG_UUCPZLOG_CRONZLOG_AUTHPRIVZLOG_FTPZ
LOG_LOCAL0Z
LOG_LOCAL1Z
LOG_LOCAL2Z
LOG_LOCAL3Z
LOG_LOCAL4Z
LOG_LOCAL5Z
LOG_LOCAL6Z
LOG_LOCAL7r�r�r��SYSLOG_UDP_PORTr
r�r�r0r�r�r�rrrrrr��s�����
6

r�c@s&eZdZd	dd�Zdd�Zdd�ZdS)
�SMTPHandlerN�@cCs�tj�|�t|ttf�r(|\|_|_n|d|_|_t|ttf�rR|\|_|_	nd|_||_
t|t�rn|g}||_||_
||_||_dSr)rr�r
r��list�tuple�mailhost�mailport�username�password�fromaddrr��toaddrs�subject�securer�)rr�r�r�r��credentialsr�r�rrrr
�s
zSMTPHandler.__init__cCs|jSr)r�rrrr�
getSubject�szSMTPHandler.getSubjectcCsz�ddl}ddlm}ddl}|j}|s.|j}|j|j||jd�}|�}|j	|d<d�
|j�|d<|�|�|d<|j
��|d<|�|�|��|jr�|jdk	r�|��|j|j�|��|�|j|j�|�|�|��Wntk
r�|�|�YnXdS)	Nr)�EmailMessager�ZFrom�,ZToZSubjectZDate)�smtplibZ
email.messager�Zemail.utilsr�Z	SMTP_PORTZSMTPr�r�r�rrr�r�ZutilsrdZset_contentr8r�r�ZehloZstarttlsZloginr�Zsend_message�quitrr)rrr�r�Zemailr�Zsmtpr=rrrr�s0


zSMTPHandler.emit)NNr�)r&r'r(r
r�rrrrrr��s�
#	r�c@s>eZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�ZdS)�NTEventLogHandlerN�Applicationc
Cs�tj�|�z�ddl}ddl}||_||_|s`tj�	|jj
�}tj�	|d�}tj�|dd�}||_||_
|j�|||�|j|_tj|jtj|jtj|jtj|jtj|ji|_Wn"tk
r�td�d|_YnXdS)Nrzwin32service.pydzWThe Python Win32 extensions for NT (service, event logging) appear not to be available.)rr�r
�win32evtlogutil�win32evtlog�appname�_welurr rn�__file__rr�dllname�logtypeZAddSourceToRegistryZEVENTLOG_ERROR_TYPE�deftyper�ZEVENTLOG_INFORMATION_TYPEr�r�ZEVENTLOG_WARNING_TYPEr�r��typemap�ImportError�print)rr�r�r�r�r�rrrr
s6�
zNTEventLogHandler.__init__cCsdS)Nr-rrrrr�getMessageID&szNTEventLogHandler.getMessageIDcCsdS)Nrrrrrr�getEventCategory0sz"NTEventLogHandler.getEventCategorycCs|j�|j|j�Sr)r�r��levelnor�rrrr�getEventType9szNTEventLogHandler.getEventTypecCsn|jrjzD|�|�}|�|�}|�|�}|�|�}|j�|j||||g�Wntk
rh|�|�YnXdSr)	r�r�r�rr8ZReportEventr�rr)rr�id�cat�typer=rrrrFs



zNTEventLogHandler.emitcCstj�|�dSr)rr�r0r�rrrr0WszNTEventLogHandler.close)Nr�)	r&r'r(r
r�r�rrr0rrrrr�s


	
r�c@s&eZdZd
dd�Zdd�Zdd	�ZdS)�HTTPHandler�GETFNcCs`tj�|�|��}|dkr$td��|s8|dk	r8td��||_||_||_||_||_	||_
dS)N)r�POSTzmethod must be GET or POSTz3context parameter only makes sense with secure=True)rr�r
rJrRr��url�methodr�r��context)rr�rrr�r�r	rrrr
iszHTTPHandler.__init__cCs|jSr)r�rrrr�mapLogRecord}szHTTPHandler.mapLogRecordcCsx�zPddl}ddl}|j}|jr4|jj||jd�}n|j�|�}|j}|j	�
|�|��}|jdkr�|�
d�dkrvd}nd}|d||f}|�|j|�|�
d�}	|	dkr�|d|	�}|jdkr�|�d	d
�|�dtt|���|j�r$ddl}
d|j�d
�}d|
�|����d�}|�d|�|��|jdk�rH|�|�d
��|��Wn tk
�rr|�|�YnXdS)Nr)r	r�?�&z%c%s�:rzContent-typez!application/x-www-form-urlencodedzContent-lengthz%s:%sr�zBasic �asciiZ
Authorization)Zhttp.clientZurllib.parser�r�ZclientZHTTPSConnectionr	ZHTTPConnectionr�parseZ	urlencoder
r�findZ
putrequestZ	putheaderr�r;r��base64r�Z	b64encode�strip�decodeZ
endheadersr�Zgetresponserr)rrZhttpZurllibr�r?r�data�sepr5rrwrrrr�sB


�zHTTPHandler.emit)rFNN)r&r'r(r
r
rrrrrrds
�
rc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�BufferingHandlercCstj�|�||_g|_dSr)rr�r
�capacity�buffer)rrrrrr
�szBufferingHandler.__init__cCst|j�|jkSr)r;rrrrrr�shouldFlush�szBufferingHandler.shouldFlushcCs"|j�|�|�|�r|��dSr)rrqrr�rrrrr�s
zBufferingHandler.emitcCs"|��z
g|_W5|��XdSr)r�r�rr�rrrr��s
zBufferingHandler.flushc	Cs z|��W5tj�|�XdSr)rr�r0r�r�rrrr0�szBufferingHandler.closeN)r&r'r(r
rrr�r0rrrrr�s
	rc@s>eZdZejddfdd�Zdd�Zdd�Zd	d
�Zdd�Z	dS)
�
MemoryHandlerNTcCs"t�||�||_||_||_dSr)rr
�
flushLevel�target�flushOnClose)rrrrrrrrr
�szMemoryHandler.__init__cCst|j�|jkp|j|jkSr)r;rrr�rrrrrrs
�zMemoryHandler.shouldFlushcCs"|��z
||_W5|��XdSr)r�r�r)rrrrr�	setTarget
s
zMemoryHandler.setTargetcCs@|��z(|jr.|jD]}|j�|�qg|_W5|��XdSr)r�r�rr�handlerrrrr�s

zMemoryHandler.flushcCsBz|jr|��W5|��zd|_t�|�W5|��XXdSr)r�r�rrr0rr�r�rrrr0(szMemoryHandler.close)
r&r'r(rr�r
rrr�r0rrrrr�s�

rc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�QueueHandlercCstj�|�||_dSr)rr�r
�queue)rr!rrrr
DszQueueHandler.__init__cCs|j�|�dSr)r!�
put_nowaitrrrr�enqueueKszQueueHandler.enqueuecCs6|�|�}t�|�}||_||_d|_d|_d|_|Sr)r8�copyr�r=r�r�Zexc_textr<rrr�prepareUs

zQueueHandler.preparecCs8z|�|�|��Wntk
r2|�|�YnXdSr)r#r%rrrrrrrrszQueueHandler.emitN)r&r'r(r
r#r%rrrrrr 9s
r c@sVeZdZdZdd�dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�ZdS)�
QueueListenerNF)�respect_handler_levelcGs||_||_d|_||_dSr)r!�handlers�_threadr')rr!r'r(rrrr
�szQueueListener.__init__cCs|j�|�Sr)r!r�)r�blockrrr�dequeue�szQueueListener.dequeuecCs&tj|jd�|_}d|_|��dS)N)rT)�	threadingZThread�_monitorr)r��start)rr\rrrr.�szQueueListener.startcCs|Srrrrrrr%�szQueueListener.preparecCs@|�|�}|jD]*}|js d}n|j|jk}|r|�|�qdSr�)r%r(r'r��levelr)rrZhandlerZprocessrrrr�s

zQueueListener.handlecCsp|j}t|d�}z>|�d�}||jkr6|r2|��Wql|�|�|rL|��Wqtjk
rhYqlYqXqdS)N�	task_doneT)r!�hasattrr+�	_sentinelr0rZEmpty)r�qZ
has_task_donerrrrr-�s



zQueueListener._monitorcCs|j�|j�dSr)r!r"r2r�rrr�enqueue_sentinel�szQueueListener.enqueue_sentinelcCs|��|j��d|_dSr)r4r)rrr�rrr�stop�s
zQueueListener.stop)r&r'r(r2r
r+r.r%rr-r4r5rrrrr&~s
	

r&)&rr�rr�r�rYrUrXrrrr!r,r$ZDEFAULT_TCP_LOGGING_PORTZDEFAULT_UDP_LOGGING_PORTZDEFAULT_HTTP_LOGGING_PORTZDEFAULT_SOAP_LOGGING_PORTr�ZSYSLOG_TCP_PORTrer	rr)r>rxr�r�r�r�r�r�rrrr �objectr&rrrr�<module>s:8FL`E(*PbO9MElogging/__pycache__/config.cpython-38.pyc000064400000055272151153537460014324 0ustar00U

e5d��@sNdZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZmZdZ
ejZdad+dd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Ze�dej�Zdd�ZGdd�de�ZGdd�dee�Z Gdd�de!e�Z"Gdd �d e#e�Z$Gd!d"�d"e�Z%Gd#d$�d$e%�Z&e&Z'd%d&�Z(e
dfd'd(�Z)d)d*�Z*dS),a
Configuration functions for the logging package for Python. The core package
is based on PEP 282 and comments thereto in comp.lang.python, and influenced
by Apache's log4j system.

Copyright (C) 2001-2019 Vinay Sajip. All Rights Reserved.

To use, simply 'import logging' and log away!
�N)�ThreadingTCPServer�StreamRequestHandleriF#TcCs�ddl}t||j�r|}n*|�|�}t|d�r:|�|�n
|�|�t|�}t�	�z t�t||�}t
|||�W5t�
�XdS)aD
    Read the logging configuration from a ConfigParser-format file.

    This can be called several times from an application, allowing an end user
    the ability to select from various pre-canned configurations (if the
    developer provides a mechanism to present the choices and load the chosen
    configuration).
    rN�readline)�configparser�
isinstanceZRawConfigParserZConfigParser�hasattrZ	read_file�read�_create_formatters�logging�_acquireLock�_releaseLock�_clearExistingHandlers�_install_handlers�_install_loggers)Zfname�defaults�disable_existing_loggersr�cp�
formatters�handlers�r�&/usr/lib64/python3.8/logging/config.py�
fileConfig3s	



rc	Csl|�d�}|�d�}t|�}|D]F}|d|}zt||�}Wq tk
rdt|�t||�}Yq Xq |S)z)Resolve a dotted name to a global object.�.r)�split�pop�
__import__�getattr�AttributeError)�name�used�found�nrrr�_resolveUs

r"cCsttj|�S�N)�map�str�strip)Zalistrrr�
_strip_spacescsr'cCs�|dd}t|�siS|�d�}t|�}i}|D]v}d|}|j|dddd�}|j|d	ddd�}|j|d
ddd�}tj}||�d�}	|	r�t|	�}||||�}
|
||<q2|S)
zCreate and return formattersr�keys�,zformatter_%s�formatTN)�raw�fallback�datefmt�style�%�class)�lenrr'�getr
�	Formatterr")rZflistrZformZsectnameZfsZdfsZstl�c�
class_name�frrrr	fs$

r	c
Cs^|dd}t|�siS|�d�}t|�}i}g}|D�]}|d|}|d}|�dd�}zt|tt��}Wn ttfk
r�t	|�}YnX|�dd	�}	t|	tt��}	|�d
d�}
t|
tt��}
||	|
�}d|kr�|d}|�
|�t|�r�|�||�t|tj
j��r2|�d
d�}
t|
��r2|�||
f�|||<q6|D]\}}|�||��q@|S)zInstall and return handlersrr(r)z
handler_%sr0�	formatter��args�()�kwargsz{}�level�target)r1rr'r2�eval�varsr
r�	NameErrorr"�setLevel�setFormatter�
issubclassr�
MemoryHandler�appendZ	setTarget)rr�hlistrZfixups�hand�section�klass�fmtr9r;�hr<r=�trrrr|sB





rcCsTtj}|D]D}|jj|}||krHt|tj�sN|�tj�g|_d|_	q
||_
q
dS)a�
    When (re)configuring logging, handle loggers which were in the previous
    configuration but are not in the new configuration. There's no point
    deleting them as other threads may continue to hold references to them;
    and by disabling them, you stop them doing any logging.

    However, don't disable children of named loggers, as that's probably not
    what was intended by the user. Also, allow existing loggers to NOT be
    disabled if disable_existing is false.
    TN)r
�root�manager�
loggerDictrZPlaceHolderrAZNOTSETr�	propagate�disabled)�existing�
child_loggers�disable_existingrM�log�loggerrrr�_handle_existing_loggers�srWcCs|dd}|�d�}tt|��}|�d�|d}tj}|}d|krX|d}|�|�|jdd�D]}|�|�qf|d}	t	|	�r�|	�d�}	t|	�}	|	D]}
|�
||
�q�t|jj�
��}|��g}|D�](}|d	|}|d
}
|jddd
�}t�|
�}|
|k�rv|�|
�d}|
d}t	|�}t	|�}||k�rl||d|�|k�r`|�||�|d7}�q2|�|
�d|k�r�|d}|�|�|jdd�D]}|�|��q�||_d|_|d}	t	|	�r�|	�d�}	t|	�}	|	D]}
|�
||
��q�q�t|||�dS)zCreate and install loggers�loggersr(r)rMZlogger_rootr<Nrz	logger_%s�qualnamerP�)r,rr)r�listr'�remover
rMrAr�
removeHandlerr1�
addHandlerrNrOr(�sortZgetint�	getLogger�indexrErPrQrW)rrrTZllistrHrMrUr<rKrFrGrRrSZqnrPrV�i�prefixed�pflen�num_existingrrrr�sd











rcCs.tj��t�tjdd��tjdd�=dS)z!Clear and close existing handlersN)r
�	_handlers�clearZshutdownZ_handlerListrrrrr
s
r
z^[a-z_][a-z0-9_]*$cCst�|�}|std|��dS)Nz!Not a valid Python identifier: %rT)�
IDENTIFIER�match�
ValueError)�s�mrrr�valid_idents
rmc@s"eZdZdZddd�Zdd�ZdS)	�ConvertingMixinz?For ConvertingXXX's, this mixin class provides common functionsTcCsB|j�|�}||k	r>|r |||<t|�tttfkr>||_||_|Sr#)�configurator�convert�type�ConvertingDict�ConvertingList�ConvertingTuple�parent�key)�selfrv�value�replace�resultrrr�convert_with_key"s
�z ConvertingMixin.convert_with_keycCs0|j�|�}||k	r,t|�tttfkr,||_|Sr#)rorprqrrrsrtru)rwrxrzrrrrp.s
�zConvertingMixin.convertN)T)�__name__�
__module__�__qualname__�__doc__r{rprrrrrns
rnc@s,eZdZdZdd�Zd	dd�Zd
dd�ZdS)rrz A converting dictionary wrapper.cCst�||�}|�||�Sr#)�dict�__getitem__r{�rwrvrxrrrr�CszConvertingDict.__getitem__NcCst�|||�}|�||�Sr#)r�r2r{�rwrv�defaultrxrrrr2GszConvertingDict.getcCst�|||�}|j||dd�S�NF)ry)r�rr{r�rrrrKszConvertingDict.pop)N)N)r|r}r~rr�r2rrrrrrr@s
rrc@s"eZdZdZdd�Zddd�ZdS)	rszA converting list wrapper.cCst�||�}|�||�Sr#)r[r�r{r�rrrr�QszConvertingList.__getitem__���cCst�||�}|�|�Sr#)r[rrp)rw�idxrxrrrrUszConvertingList.popN)r�)r|r}r~rr�rrrrrrsOsrsc@seZdZdZdd�ZdS)rtzA converting tuple wrapper.cCst�||�}|j||dd�Sr�)�tupler�r{r�rrrr�[szConvertingTuple.__getitem__N)r|r}r~rr�rrrrrtYsrtc@s�eZdZdZe�d�Ze�d�Ze�d�Ze�d�Z	e�d�Z
ddd	�Zee
�Zd
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Zdd�ZdS)�BaseConfiguratorzI
    The configurator base class which defines some useful defaults.
    z%^(?P<prefix>[a-z]+)://(?P<suffix>.*)$z^\s*(\w+)\s*z^\.\s*(\w+)\s*z^\[\s*(\w+)\s*\]\s*z^\d+$�ext_convert�cfg_convert)ZextZcfgcCst|�|_||j_dSr#)rr�configro)rwr�rrr�__init__ts
zBaseConfigurator.__init__c		Cs�|�d�}|�d�}z^|�|�}|D]H}|d|7}zt||�}Wq$tk
rj|�|�t||�}Yq$Xq$|WStk
r�t��dd�\}}td||f�}|||_	|_
|�YnXdS)z`
        Resolve strings to objects using standard import and attribute
        syntax.
        rrrZNzCannot resolve %r: %s)rr�importerrr�ImportError�sys�exc_inforj�	__cause__�
__traceback__)	rwrkrrr Zfrag�e�tb�vrrr�resolvexs"



zBaseConfigurator.resolvecCs
|�|�S)z*Default converter for the ext:// protocol.)r��rwrxrrrr��szBaseConfigurator.ext_convertcCs�|}|j�|�}|dkr&td|��n�||��d�}|j|��d}|r�|j�|�}|rn||��d}nd|j�|�}|r�|��d}|j�|�s�||}n2zt	|�}||}Wnt
k
r�||}YnX|r�||��d�}qHtd||f��qH|S)z*Default converter for the cfg:// protocol.NzUnable to convert %rrzUnable to convert %r at %r)�WORD_PATTERNrirj�endr��groups�DOT_PATTERN�
INDEX_PATTERN�
DIGIT_PATTERN�int�	TypeError)rwrx�restrl�dr�r!rrrr��s4
�zBaseConfigurator.cfg_convertcCs�t|t�s$t|t�r$t|�}||_n�t|t�sHt|t�rHt|�}||_n�t|t�svt|t�rvt|d�svt|�}||_nVt|t	�r�|j
�|�}|r�|��}|d}|j
�|d�}|r�|d}t||�}||�}|S)z�
        Convert values to an appropriate type. dicts, lists and tuples are
        replaced by their converting alternatives. Strings are checked to
        see if they have a conversion format and are converted if they do.
        �_fields�prefixN�suffix)rrrr�rorsr[rtr�rr%�CONVERT_PATTERNri�	groupdict�value_convertersr2r)rwrxrlr�r�Z	converterr�rrrrp�s0
��

zBaseConfigurator.convertcsj��d�}t|�s|�|�}��dd�}�fdd��D�}|f|�}|rf|��D]\}}t|||�qP|S)z1Configure an object with a user-supplied factory.r:rNcsi|]}t|�r|�|�qSr�rm��.0�k�r�rr�
<dictcomp>�sz5BaseConfigurator.configure_custom.<locals>.<dictcomp>)r�callabler��items�setattr)rwr�r4�propsr;rzrrxrr�r�configure_custom�s


z!BaseConfigurator.configure_customcCst|t�rt|�}|S)z0Utility function which converts lists to tuples.)rr[r�r�rrr�as_tuple�s
zBaseConfigurator.as_tupleN)r|r}r~r�re�compiler�r�r�r�r�r��staticmethodrr�r�r�r�r�rpr�r�rrrrr�`s"




�"r�c@s^eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	ddd�Z
ddd�Zddd�ZdS)�DictConfiguratorz]
    Configure logging using a dictionary-like object to describe the
    configuration.
    cCs�|j}d|krtd��|ddkr2td|d��|�dd�}i}t���zn|�r�|�d|�}|D]�}|tjkr�td|��qdz6tj|}||}|�d	d
�}|r�|�t�	|��Wqdt
k
r�}	ztd|�|	�W5d
}	~	XYqdXqd|�d|�}
|
D]N}z|�||
|d
�Wq�t
k
�rF}	ztd|�|	�W5d
}	~	XYq�Xq�|�dd
�}|�r�z|�|d
�Wn.t
k
�r�}	ztd�|	�W5d
}	~	XYnX�n|�dd
�}t
�|�d|�}
|
D]P}z|�|
|�|
|<Wn2t
k
�r}	ztd|�|	�W5d
}	~	XYnX�q�|�d|�}|D]P}z|�||�||<Wn2t
k
�rp}	ztd|�|	�W5d
}	~	XYnX�q$|�d|�}g}t|�D]v}z |�||�}||_|||<WnNt
k
�r}	z.dt|	j�k�r�|�|�ntd|�|	�W5d
}	~	XYnX�q�|D]Z}z |�||�}||_|||<Wn2t
k
�r`}	ztd|�|	�W5d
}	~	XYnX�q
tj}t|jj���}|��g}|�d|�}
|
D]�}||k�r|�|�d}|d}t|�}t|�}||k�r||d
|�|k�r�|�||�|d7}�q�|�|�z|�||
|�Wn2t
k
�rV}	ztd|�|	�W5d
}	~	XYnX�q�t|||�|�dd
�}|�r�z|�|�Wn.t
k
�r�}	ztd�|	�W5d
}	~	XYnXW5t��Xd
S)zDo the configuration.�versionz$dictionary doesn't specify a versionrZzUnsupported version: %s�incrementalFrzNo handler found with name %rr<NzUnable to configure handler %rrXTzUnable to configure logger %rrMzUnable to configure root loggerrrz Unable to configure formatter %r�filterszUnable to configure filter %r�target not configured yetr) r�rjrr
rrr2rfrA�_checkLevel�	Exception�configure_logger�configure_rootr
�configure_formatter�configure_filter�sorted�configure_handlerrr%r�rErMr[rNrOr(r_rar1r\rW)rwr�r�Z
EMPTY_DICTrr�handlerZhandler_configr<r�rXrMrTrr�ZdeferredrRrSrbrcrdrerrr�	configure�s
�
��������������



����zDictConfigurator.configurec

Cs�d|krr|d}z|�|�}Wq�tk
rn}z2dt|�kr>�|�d�|d<||d<|�|�}W5d}~XYq�Xnl|�dd�}|�dd�}|�dd�}|�d	d�}|s�tj}	nt|�}	d
|kr�|	||||d
�}n|	|||�}|S)z(Configure a formatter from a dictionary.r:z'format'r*rJNr-r.r/r0Zvalidate)r�r�r%rr2r
r3r")
rwr��factoryrz�terJZdfmtr.�cnamer4rrrr��s*z$DictConfigurator.configure_formattercCs.d|kr|�|�}n|�dd�}t�|�}|S)z%Configure a filter from a dictionary.r:rr8)r�r2r
ZFilter)rwr�rzrrrrr��s

z!DictConfigurator.configure_filtercCsX|D]N}z|�|jd|�Wqtk
rP}ztd|�|�W5d}~XYqXqdS)z/Add filters to a filterer from a list of names.r�zUnable to add filter %rN)Z	addFilterr�r�rj)rwZfiltererr�r6r�rrr�add_filters�s
zDictConfigurator.add_filtersc
s�t��}��dd�}|r\z|jd|}Wn0tk
rZ}ztd|�|�W5d}~XYnX��dd�}��dd�}d�kr���d�}t|�s�|�|�}|}�n��d�}	|�|	�}
t|
tj	j
��rFd	�k�rFz>|jd
�d	}t|tj��s��
|�td��|�d	<Wn6tk
�rB}ztd�d	�|�W5d}~XYnXnZt|
tj	j��rtd
�k�rt|��d
��d
<n,t|
tj	j��r�d�k�r�|��d��d<|
}��dd�}�fdd��D�}
z|f|
�}WnLtk
�r}z,dt|�k�r�|
�d�|
d<|f|
�}W5d}~XYnX|�r.|�|�|dk	�rH|�t�|��|�rZ|�||�|�r�|��D]\}}t|||��qh|S)z&Configure a handler from a dictionary.r7NrzUnable to set formatter %rr<r�r:r0r=rr�zUnable to set target handler %rZmailhostZaddressrcsi|]}t|�r|�|�qSrr�r�r�rrr��sz6DictConfigurator.configure_handler.<locals>.<dictcomp>z'stream'�streamZstrm)r�rr�r�rjr�r�rCr
rrDrZHandler�updater�ZSMTPHandlerr�Z
SysLogHandlerr%rBrAr�r�r�r�)rwr�Zconfig_copyr7r�r<r�r4r�r�rIZthr�r;rzr�rrxrr�rr��s~��



�
����

z"DictConfigurator.configure_handlercCsX|D]N}z|�|jd|�Wqtk
rP}ztd|�|�W5d}~XYqXqdS)z.Add handlers to a logger from a list of names.rzUnable to add handler %rN)r^r�r�rj)rwrVrrKr�rrr�add_handlers�s
zDictConfigurator.add_handlersFcCs�|�dd�}|dk	r$|�t�|��|s~|jdd�D]}|�|�q6|�dd�}|rb|�||�|�dd�}|r~|�||�dS)zU
        Perform configuration which is common to root and non-root loggers.
        r<Nrr�)r2rAr
r�rr]r�r�)rwrVr�r�r<rKrr�rrr�common_logger_configsz%DictConfigurator.common_logger_configcCs6t�|�}|�|||�|�dd�}|dk	r2||_dS)z.Configure a non-root logger from a dictionary.rPN)r
r`r�r2rP)rwrr�r�rVrPrrrr�s

z!DictConfigurator.configure_loggercCst��}|�|||�dS)z*Configure a root logger from a dictionary.N)r
r`r�)rwr�r�rMrrrr�szDictConfigurator.configure_rootN)F)F)F)
r|r}r~rr�r�r�r�r�r�r�r�r�rrrrr��s$	?

r�cCst|���dS)z%Configure logging using a dictionary.N)�dictConfigClassr�r�rrr�
dictConfig&sr�csDGdd�dt�}Gdd�dt�}G�fdd�dtj���||||�S)au
    Start up a socket server on the specified port, and listen for new
    configurations.

    These will be sent as a file suitable for processing by fileConfig().
    Returns a Thread object on which you can call start() to start the server,
    and which you can join() when appropriate. To stop the server, call
    stopListening().

    Use the ``verify`` argument to verify any bytes received across the wire
    from a client. If specified, it should be a callable which receives a
    single argument - the bytes of configuration data received across the
    network - and it should return either ``None``, to indicate that the
    passed in bytes could not be verified and should be discarded, or a
    byte string which is then passed to the configuration machinery as
    normal. Note that you can return transformed bytes, e.g. by decrypting
    the bytes passed in.
    c@seZdZdZdd�ZdS)z#listen.<locals>.ConfigStreamHandlerz�
        Handler for a logging configuration request.

        It expects a completely new logging configuration and uses fileConfig
        to install it.
        cSsV�z|j}|�d�}t|�dk�rt�d|�d}|j�|�}t|�|krb||�|t|��}q>|jjdk	rz|j�|�}|dk	�r|�d�}z,ddl}|�	|�}t
|t�s�t�t
|�WnJtk
�rt�|�}zt|�Wntk
r�t��YnXYnX|jj�r|jj��Wn2tk
�rP}z|jtk�r@�W5d}~XYnXdS)z�
            Handle a request.

            Each request is expected to be a 4-byte length, packed using
            struct.pack(">L", n), followed by the config file.
            Uses fileConfig() to do the grunt work.
            �z>LrNzutf-8)Z
connectionZrecvr1�structZunpack�server�verify�decode�json�loadsrr��AssertionErrorr�r��io�StringIOr�	traceback�	print_exc�ready�set�OSError�errno�RESET_ERROR)rwZconn�chunkZslenr�r��filer�rrr�handleFs8





z*listen.<locals>.ConfigStreamHandler.handleN)r|r}r~rr�rrrr�ConfigStreamHandler?sr�c@s0eZdZdZdZdedddfdd�Zdd�ZdS)	z$listen.<locals>.ConfigSocketReceiverzD
        A simple TCP socket-based logging config receiver.
        rZZ	localhostNcSs>t�|||f|�t��d|_t��d|_||_||_dS)NrrZ)	rr�r
r�abortr�timeoutr�r�)rwZhost�portr�r�r�rrrr�tsz-listen.<locals>.ConfigSocketReceiver.__init__cSs`ddl}d}|sT|�|j��ggg|j�\}}}|r<|��t��|j}t��q|�	�dS)Nr)
�selectZsocket�filenor�Zhandle_requestr
rr�rZserver_close)rwr�r�ZrdZwrZexrrr�serve_until_stopped~s�

z8listen.<locals>.ConfigSocketReceiver.serve_until_stopped)r|r}r~rZallow_reuse_address�DEFAULT_LOGGING_CONFIG_PORTr�r�rrrr�ConfigSocketReceiverms�

r�cs&eZdZ��fdd�Zdd�Z�ZS)zlisten.<locals>.Servercs4t�|���||_||_||_||_t��|_dSr#)	�superr��rcvr�hdlrr�r��	threadingZEventr�)rwr�r�r�r�)�Server�	__class__rrr��szlisten.<locals>.Server.__init__cSsZ|j|j|j|j|jd�}|jdkr0|jd|_|j��t��|a	t�
�|��dS)N)r�r�r�r�rrZ)r�r�r�r�r�Zserver_addressr�r
r�	_listenerrr�)rwr�rrr�run�s�

zlisten.<locals>.Server.run)r|r}r~r�r��
__classcell__r�r�)r�rr��sr�)rrr�ZThread)r�r�r�r�rr�r�listen+s.r�cCs*t��ztrdt_daW5t��XdS)zN
    Stop the listening server which was created with a call to listen().
    rZN)r
rrr�r�rrrr�
stopListening�sr�)NT)+rr�r�r
Zlogging.handlersr�r�r�r�r�Zsocketserverrrr�Z
ECONNRESETr�r�rr"r'r	rrWrr
r��Irhrm�objectrnr�rrr[rsr�rtr�r�r�r�r�r�rrrr�<module>sH

"%W!
Azlogging/__pycache__/handlers.cpython-38.pyc000064400000124300151153537460014644 0ustar00U

e5dq��@szdZddlZddlZddlZddlZddlZddlZddlZddlm	Z	m
Z
mZddlZddl
Z
ddlZdZdZdZdZdZdZd	ZGd
d�dej�ZGdd
�d
e�ZGdd�de�ZGdd�dej�ZGdd�dej�ZGdd�de�ZGdd�dej�ZGdd�dej�ZGdd�dej�Z Gdd�dej�Z!Gdd�dej�Z"Gd d!�d!e"�Z#Gd"d#�d#ej�Z$Gd$d%�d%e%�Z&dS)&z�
Additional handlers for the logging package for Python. The core package is
based on PEP 282 and comments thereto in comp.lang.python.

Copyright (C) 2001-2016 Vinay Sajip. All Rights Reserved.

To use, simply 'import logging.handlers' and log away!
�N)�ST_DEV�ST_INO�ST_MTIMEi<#i=#i>#i?#i�Qc@s2eZdZdZddd�Zdd�Zdd	�Zd
d�ZdS)
�BaseRotatingHandlerz�
    Base class for handlers that rotate log files at a certain point.
    Not meant to be instantiated directly.  Instead, use RotatingFileHandler
    or TimedRotatingFileHandler.
    NFcCs0tj�|||||�||_||_d|_d|_dS)zA
        Use the specified filename for streamed logging
        N)�logging�FileHandler�__init__�mode�encoding�namer�rotator��self�filenamer
r�delay�r�(/usr/lib64/python3.8/logging/handlers.pyr	3s
zBaseRotatingHandler.__init__cCsHz$|�|�r|��tj�||�Wntk
rB|�|�YnXdS)z�
        Emit a record.

        Output the record to the file, catering for rollover as described
        in doRollover().
        N)�shouldRollover�
doRolloverrr�emit�	Exception�handleError�r�recordrrrr=s
zBaseRotatingHandler.emitcCst|j�s|}n
|�|�}|S)a�
        Modify the filename of a log file when rotating.

        This is provided so that a custom filename can be provided.

        The default implementation calls the 'namer' attribute of the
        handler, if it's callable, passing the default name to
        it. If the attribute isn't callable (the default is None), the name
        is returned unchanged.

        :param default_name: The default name for the log file.
        )�callabler)rZdefault_name�resultrrr�rotation_filenameKs

z%BaseRotatingHandler.rotation_filenamecCs4t|j�s$tj�|�r0t�||�n|�||�dS)aL
        When rotating, rotate the current log.

        The default implementation calls the 'rotator' attribute of the
        handler, if it's callable, passing the source and dest arguments to
        it. If the attribute isn't callable (the default is None), the source
        is simply renamed to the destination.

        :param source: The source filename. This is normally the base
                       filename, e.g. 'test.log'
        :param dest:   The destination filename. This is normally
                       what the source is rotated to, e.g. 'test.log.1'.
        N)rr
�os�path�exists�rename)r�source�destrrr�rotate^s
zBaseRotatingHandler.rotate)NF)�__name__�
__module__�__qualname__�__doc__r	rrr$rrrrr-s


rc@s*eZdZdZddd�Zdd	�Zd
d�ZdS)
�RotatingFileHandlerz�
    Handler for logging to a set of files, which switches from one file
    to the next when the current file reaches a certain size.
    �arNFcCs.|dkrd}t�|||||�||_||_dS)a�
        Open the specified file and use it as the stream for logging.

        By default, the file grows indefinitely. You can specify particular
        values of maxBytes and backupCount to allow the file to rollover at
        a predetermined size.

        Rollover occurs whenever the current log file is nearly maxBytes in
        length. If backupCount is >= 1, the system will successively create
        new files with the same pathname as the base file, but with extensions
        ".1", ".2" etc. appended to it. For example, with a backupCount of 5
        and a base file name of "app.log", you would get "app.log",
        "app.log.1", "app.log.2", ... through to "app.log.5". The file being
        written to is always "app.log" - when it gets filled up, it is closed
        and renamed to "app.log.1", and if files "app.log.1", "app.log.2" etc.
        exist, then they are renamed to "app.log.2", "app.log.3" etc.
        respectively.

        If maxBytes is zero, rollover never occurs.
        rr*N)rr	�maxBytes�backupCount)rrr
r+r,rrrrrr	xs
zRotatingFileHandler.__init__cCs�|jr|j��d|_|jdkr�t|jddd�D]^}|�d|j|f�}|�d|j|df�}tj�|�r2tj�|�r�t�	|�t�
||�q2|�|jd�}tj�|�r�t�	|�|�|j|�|js�|�
�|_dS)z<
        Do a rollover, as described in __init__().
        Nr����z%s.%dz.1)�stream�closer,�ranger�baseFilenamerrr �remover!r$r�_open)r�iZsfn�dfnrrrr�s&


�

zRotatingFileHandler.doRollovercCsZ|jdkr|��|_|jdkrVd|�|�}|j�dd�|j��t|�|jkrVdSdS)z�
        Determine if rollover should occur.

        Basically, see if the supplied record would cause the file to exceed
        the size limit we have.
        Nrz%s
�r-)r/r4r+�format�seek�tell�len�rr�msgrrrr�s


z"RotatingFileHandler.shouldRollover)r*rrNF)r%r&r'r(r	rrrrrrr)ss
 r)c@s:eZdZdZddd�Zd	d
�Zdd�Zd
d�Zdd�ZdS)�TimedRotatingFileHandlerz�
    Handler for logging to a file, rotating the log file at certain timed
    intervals.

    If backupCount is > 0, when rollover is done, no more than backupCount
    files are kept - the oldest ones are deleted.
    �hr-rNFc	
Cs�t�||d||�|��|_||_||_||_|jdkrLd|_d|_d|_	n�|jdkrjd|_d|_d	|_	n�|jd
kr�d|_d|_d
|_	n�|jdks�|jdkr�d|_d|_d|_	n�|j�
d��r*d|_t|j�dkr�td|j��|jddks�|jddk�rtd|j��t
|jd�|_d|_d|_	ntd|j��t�|j	tj�|_	|j||_|j}tj�|��rzt�|�t}	nt
t���}	|�|	�|_dS)Nr*�Sr-z%Y-%m-%d_%H-%M-%Sz-^\d{4}-\d{2}-\d{2}_\d{2}-\d{2}-\d{2}(\.\w+)?$�M�<z%Y-%m-%d_%H-%Mz'^\d{4}-\d{2}-\d{2}_\d{2}-\d{2}(\.\w+)?$�H�z%Y-%m-%d_%Hz!^\d{4}-\d{2}-\d{2}_\d{2}(\.\w+)?$�D�MIDNIGHTrz%Y-%m-%dz^\d{4}-\d{2}-\d{2}(\.\w+)?$�Wi�:	r7zHYou must specify a day for weekly rollover from 0 to 6 (0 is Monday): %s�0�6z-Invalid day specified for weekly rollover: %sz'Invalid rollover interval specified: %s)rr	�upper�whenr,�utc�atTime�interval�suffix�extMatch�
startswithr;�
ValueError�int�	dayOfWeek�re�compile�ASCIIr2rrr �statr�time�computeRollover�
rolloverAt)
rrrKrNr,rrrLrM�trrrr	�sL



z!TimedRotatingFileHandler.__init__cCsd||j}|jdks"|j�d��r`|jr4t�|�}n
t�|�}|d}|d}|d}|d}|jdkrnt}n |jj	d|jj
d|jj}||d|d|}	|	d	kr�|	t7}	|d
d}||	}|j�d��r`|}
|
|jk�r`|
|jkr�|j|
}nd|
|jd
}||d}|j�s\|d
}
t�|�d
}|
|k�r\|
�sPd}nd}||7}|}|S)zI
        Work out the rollover time based on the specified time.
        rFrG����NrBrr-�rr.���rD)
rNrKrQrLrY�gmtime�	localtimerM�	_MIDNIGHTZhourZminute�secondrT)r�currentTimerr\ZcurrentHourZ
currentMinuteZ
currentSecondZ
currentDayZ	rotate_ts�rZdayZ
daysToWait�
newRolloverAt�dstNow�
dstAtRollover�addendrrrrZsL


��

z(TimedRotatingFileHandler.computeRollovercCstt���}||jkrdSdS)z�
        Determine if rollover should occur.

        record is not used, as we are just comparing times, but it is needed so
        the method signatures are the same
        r-r)rSrYr[)rrr\rrrrIs
z'TimedRotatingFileHandler.shouldRolloverc	Cs�tj�|j�\}}t�|�}g}|d}t|�}|D]@}|d|�|kr4||d�}|j�|�r4|�tj�	||��q4t|�|j
kr�g}n|��|dt|�|j
�}|S)z�
        Determine the files to delete when rolling over.

        More specific than the earlier method, which just used glob.glob().
        �.N)rr�splitr2�listdirr;rP�match�append�joinr,�sort)	rZdirNameZbaseNameZ	fileNamesr�prefixZplenZfileNamerOrrr�getFilesToDeleteUs
z)TimedRotatingFileHandler.getFilesToDeletecCsv|jr|j��d|_tt���}t�|�d}|j|j}|jrNt�|�}n6t�|�}|d}||kr�|rrd}nd}t�||�}|�	|j
dt�|j|��}t
j�|�r�t
�|�|�|j
|�|jdkr�|��D]}t
�|�q�|js�|��|_|�|�}	|	|k�r|	|j}	�q|jdk�s4|j�d��rl|j�slt�|	�d}
||
k�rl|�s`d}nd}|	|7}	|	|_dS)	ax
        do a rollover; in this case, a date/time stamp is appended to the filename
        when the rollover happens.  However, you want the file to be named for the
        start of the interval, not the current time.  If there is a backup count,
        then we have to get a list of matching filenames, sort them and remove
        the one with the oldest suffix.
        Nr.rDrbrmrrFrG)r/r0rSrYrdr[rNrLrcrr2�strftimerOrrr r3r$r,rurr4rZrKrQ)rrgrjr\Z	timeTupleZdstThenrlr6�srirkrrrrlsJ

�




"
z#TimedRotatingFileHandler.doRollover)r?r-rNFFN)	r%r&r'r(r	rZrrurrrrrr>�s
9Ir>c@s2eZdZdZd
dd�Zdd�Zd	d
�Zdd�ZdS)�WatchedFileHandlera�
    A handler for logging to a file, which watches the file
    to see if it has changed while in use. This can happen because of
    usage of programs such as newsyslog and logrotate which perform
    log file rotation. This handler, intended for use under Unix,
    watches the file to see if it has changed since the last emit.
    (A file has changed if its device or inode have changed.)
    If it has changed, the old file stream is closed, and the file
    opened to get a new stream.

    This handler is not appropriate for use under Windows, because
    under Windows open files cannot be moved or renamed - logging
    opens the files with exclusive locks - and so there is no need
    for such a handler. Furthermore, ST_INO is not supported under
    Windows; stat always returns zero for this value.

    This handler is based on a suggestion and patch by Chad J.
    Schroeder.
    r*NFcCs,tj�|||||�d\|_|_|��dS)N)r.r.)rrr	�dev�ino�_statstreamrrrrr	�szWatchedFileHandler.__init__cCs0|jr,t�|j���}|t|t|_|_dS�N)r/r�fstat�filenorrryrz�rZsresrrrr{�szWatchedFileHandler._statstreamcCs�zt�|j�}Wntk
r(d}YnX|rJ|t|jksJ|t|jkr�|jdk	r�|j�	�|j�
�d|_|��|_|��dS)z�
        Reopen log file if needed.

        Checks if the underlying file has changed, and if it
        has, close the old stream and reopen the file to get the
        current stream.
        N)
rrXr2�FileNotFoundErrorrryrrzr/�flushr0r4r{rrrr�reopenIfNeeded�s
 



z!WatchedFileHandler.reopenIfNeededcCs|��tj�||�dS)z�
        Emit a record.

        If underlying file has changed, reopen the file before emitting the
        record to it.
        N)r�rrrrrrrr�szWatchedFileHandler.emit)r*NF)r%r&r'r(r	r{r�rrrrrrx�s

rxc@sReZdZdZdd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�
SocketHandlera
    A handler class which writes logging records, in pickle format, to
    a streaming socket. The socket is kept open across logging calls.
    If the peer resets it, an attempt is made to reconnect on the next call.
    The pickle which is sent is that of the LogRecord's attribute dictionary
    (__dict__), so that the receiver does not need to have the logging module
    installed in order to process the logging event.

    To unpickle the record at the receiving end into a LogRecord, use the
    makeLogRecord function.
    cCsZtj�|�||_||_|dkr(||_n
||f|_d|_d|_d|_d|_	d|_
d|_dS)a
        Initializes the handler with a specific host address and port.

        When the attribute *closeOnError* is set to True - if a socket error
        occurs, the socket is silently closed and then reopened on the next
        logging call.
        NFg�?g>@g@)r�Handlerr	�host�port�address�sock�closeOnError�	retryTime�
retryStart�retryMax�retryFactor�rr�r�rrrr	�s
zSocketHandler.__init__r-cCsj|jdk	rtj|j|d�}nJt�tjtj�}|�|�z|�|j�Wntk
rd|�	��YnX|S)zr
        A factory method which allows subclasses to define the precise
        type of socket they want.
        N��timeout)
r��socketZcreate_connectionr��AF_UNIX�SOCK_STREAMZ
settimeout�connect�OSErrorr0)rr�rrrr�
makeSocket	s

zSocketHandler.makeSocketcCs�t��}|jdkrd}n
||jk}|r�z|��|_d|_WnVtk
r�|jdkr^|j|_n"|j|j|_|j|jkr�|j|_||j|_YnXdS)z�
        Try to create a socket, using an exponential backoff with
        a max retry time. Thanks to Robert Olson for the original patch
        (SF #815911) which has been slightly refactored.
        NT)	rYr�r�r�r�r�ZretryPeriodr�r�)rZnowZattemptrrr�createSockets





zSocketHandler.createSocketcCsR|jdkr|��|jrNz|j�|�Wn$tk
rL|j��d|_YnXdS)z�
        Send a pickled string to the socket.

        This function allows for partial sends which can happen when the
        network is busy.
        N)r�r��sendallr�r0�rrwrrr�send6s

zSocketHandler.sendcCsj|j}|r|�|�}t|j�}|��|d<d|d<d|d<|�dd�t�|d�}t�	dt
|��}||S)z�
        Pickles the record in binary format with a length prefix, and
        returns it ready for transmission across the socket.
        r=N�args�exc_info�messager-z>L)r�r8�dict�__dict__Z
getMessage�pop�pickle�dumps�structZpackr;)rrZeiZdummy�drwZslenrrr�
makePickleIs

zSocketHandler.makePicklecCs0|jr|jr|j��d|_ntj�||�dS)z�
        Handle an error during logging.

        An error has occurred during logging. Most likely cause -
        connection lost. Close the socket so that we can retry on the
        next event.
        N)r�r�r0rr�rrrrrr_s
zSocketHandler.handleErrorcCs<z|�|�}|�|�Wntk
r6|�|�YnXdS)a
        Emit a record.

        Pickles the record and writes it to the socket in binary format.
        If there is an error with the socket, silently drop the packet.
        If there was a problem with the socket, re-establishes the
        socket.
        N)r�r�rr)rrrwrrrrms
	
zSocketHandler.emitcCs@|��z(|j}|r"d|_|��tj�|�W5|��XdS�z$
        Closes the socket.
        N)�acquire�releaser�r0rr�)rr�rrrr0|szSocketHandler.closeN)r-)r%r&r'r(r	r�r�r�r�rrr0rrrrr��s
r�c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�DatagramHandlera�
    A handler class which writes logging records, in pickle format, to
    a datagram socket.  The pickle which is sent is that of the LogRecord's
    attribute dictionary (__dict__), so that the receiver does not need to
    have the logging module installed in order to process the logging event.

    To unpickle the record at the receiving end into a LogRecord, use the
    makeLogRecord function.

    cCst�|||�d|_dS)zP
        Initializes the handler with a specific host address and port.
        FN)r�r	r�r�rrrr	�szDatagramHandler.__init__cCs*|jdkrtj}ntj}t�|tj�}|S)zu
        The factory method of SocketHandler is here overridden to create
        a UDP socket (SOCK_DGRAM).
        N)r�r�r�ZAF_INET�
SOCK_DGRAM)rZfamilyrwrrrr��s

zDatagramHandler.makeSocketcCs&|jdkr|��|j�||j�dS)z�
        Send a pickled string to a socket.

        This function no longer allows for partial sends which can happen
        when the network is busy - UDP does not guarantee delivery and
        can deliver packets out of sequence.
        N)r�r��sendtor�r�rrrr��s
zDatagramHandler.sendN)r%r&r'r(r	r�r�rrrrr��s
r�c@s"eZdZdZdZdZdZdZdZdZ	dZ
d	ZdZdZ
dZdZdZdZdZd	Zd
ZdZdZd
ZdZdZdZdZdZdZdZdZeeeeeeee
e	eeed�Z eeeeeeeeeeee
eeeeeeeeed�Z!dddddd�Z"de#fe
dfd d!�Z$d"d#�Z%d$d%�Z&d&d'�Z'd(d)�Z(d*Z)d+Z*d,d-�Z+dS).�
SysLogHandlera
    A handler class which sends formatted logging records to a syslog
    server. Based on Sam Rushing's syslog module:
    http://www.nightmare.com/squirl/python-ext/misc/syslog.py
    Contributed by Nicolas Untz (after which minor refactoring changes
    have been made).
    rr-r7r]r^r_r`ra��	�
���������)ZalertZcrit�critical�debugZemerg�err�error�infoZnoticeZpanic�warn�warning)ZauthZauthprivZcron�daemonZftpZkernZlprZmailZnewsZsecurityZsyslog�userZuucpZlocal0Zlocal1Zlocal2Zlocal3Zlocal4Zlocal5Zlocal6Zlocal7r�r�r�r�r�)�DEBUG�INFO�WARNING�ERROR�CRITICALZ	localhostNcCs4tj�|�||_||_||_t|t�rTd|_z|�	|�Wnt
k
rPYnXn�d|_|dkrhtj}|\}}t�
||d|�}|s�t
d��|D]�}|\}}}	}
}d}}
z.t�|||	�}
|tjkr�|
�|�W�qWq�t
k
�r}z|}|
dk	�r|
��W5d}~XYq�Xq�|dk	�r$|�|
|_||_dS)a
        Initialize a handler.

        If address is specified as a string, a UNIX socket is used. To log to a
        local syslogd, "SysLogHandler(address="/dev/log")" can be used.
        If facility is not specified, LOG_USER is used. If socktype is
        specified as socket.SOCK_DGRAM or socket.SOCK_STREAM, that specific
        socket type will be used. For Unix sockets, you can also specify a
        socktype of None, in which case socket.SOCK_DGRAM will be used, falling
        back to socket.SOCK_STREAM.
        TFNrz!getaddrinfo returns an empty list)rr�r	r��facility�socktype�
isinstance�str�
unixsocket�_connect_unixsocketr�r�r�Zgetaddrinfor�r�r0)rr�r�r�r�r�Zress�resZaf�proto�_Zsar�r��excrrrr	sB





zSysLogHandler.__init__cCs�|j}|dkrtj}t�tj|�|_z|j�|�||_Wnxtk
r�|j��|jdk	r`�tj}t�tj|�|_z|j�|�||_Wn tk
r�|j���YnXYnXdSr|)r�r�r�r�r�r�r0r�)rr�Zuse_socktyperrrr�Qs&




z!SysLogHandler._connect_unixsocketcCs4t|t�r|j|}t|t�r(|j|}|d>|BS)z�
        Encode the facility and priority. You can pass in strings or
        integers - if strings are passed, the facility_names and
        priority_names mapping dictionaries are used to convert them to
        integers.
        r])r�r��facility_names�priority_names)rr�Zpriorityrrr�encodePriorityis




zSysLogHandler.encodePrioritycCs2|��z|j��tj�|�W5|��XdSr�)r�r�r�r0rr��rrrrr0vs

zSysLogHandler.closecCs|j�|d�S)aK
        Map a logging level name to a key in the priority_names map.
        This is useful in two scenarios: when custom levels are being
        used, and in the case where you can't do a straightforward
        mapping by lowercasing the logging level name because of locale-
        specific issues (see SF #1524081).
        r�)�priority_map�get)rZ	levelNamerrr�mapPriority�szSysLogHandler.mapPriority�TcCsz�|�|�}|jr|j|}|jr*|d7}d|�|j|�|j��}|�d�}|�d�}||}|jr�z|j	�
|�Wq�tk
r�|j	��|�
|j�|j	�
|�Yq�Xn*|jt	jkr�|j	�||j�n|j	�|�Wntk
r�|�|�YnXdS)z�
        Emit a record.

        The record is formatted, and then sent to the syslog server. If
        exception information is present, it is NOT sent to the server.
        �z<%d>�utf-8N)r8�ident�
append_nulr�r�r�Z	levelname�encoder�r�r�r�r0r�r�r�r�r�r�rr)rrr=Zpriorrrr�s0



�


zSysLogHandler.emit),r%r&r'r(Z	LOG_EMERGZ	LOG_ALERTZLOG_CRITZLOG_ERRZLOG_WARNINGZ
LOG_NOTICEZLOG_INFOZ	LOG_DEBUGZLOG_KERNZLOG_USERZLOG_MAILZ
LOG_DAEMONZLOG_AUTHZ
LOG_SYSLOGZLOG_LPRZLOG_NEWSZLOG_UUCPZLOG_CRONZLOG_AUTHPRIVZLOG_FTPZ
LOG_LOCAL0Z
LOG_LOCAL1Z
LOG_LOCAL2Z
LOG_LOCAL3Z
LOG_LOCAL4Z
LOG_LOCAL5Z
LOG_LOCAL6Z
LOG_LOCAL7r�r�r��SYSLOG_UDP_PORTr	r�r�r0r�r�r�rrrrrr��s�����
6

r�c@s*eZdZdZd
dd�Zdd�Zdd	�ZdS)�SMTPHandlerzK
    A handler class which sends an SMTP email for each logging event.
    N�@cCs�tj�|�t|ttf�r(|\|_|_n|d|_|_t|ttf�rR|\|_|_	nd|_||_
t|t�rn|g}||_||_
||_||_dS)ax
        Initialize the handler.

        Initialize the instance with the from and to addresses and subject
        line of the email. To specify a non-standard SMTP port, use the
        (host, port) tuple format for the mailhost argument. To specify
        authentication credentials, supply a (username, password) tuple
        for the credentials argument. To specify the use of a secure
        protocol (TLS), pass in a tuple for the secure argument. This will
        only be used when authentication credentials are supplied. The tuple
        will be either an empty tuple, or a single-value tuple with the name
        of a keyfile, or a 2-value tuple with the names of the keyfile and
        certificate file. (This tuple is passed to the `starttls` method).
        A timeout in seconds can be specified for the SMTP connection (the
        default is one second).
        N)rr�r	r��list�tuple�mailhost�mailport�username�password�fromaddrr��toaddrs�subject�securer�)rr�r�r�r��credentialsr�r�rrrr	�s
zSMTPHandler.__init__cCs|jS)z�
        Determine the subject for the email.

        If you want to specify a subject line which is record-dependent,
        override this method.
        )r�rrrr�
getSubject�szSMTPHandler.getSubjectcCsz�ddl}ddlm}ddl}|j}|s.|j}|j|j||jd�}|�}|j	|d<d�
|j�|d<|�|�|d<|j
��|d	<|�|�|��|jr�|jdk	r�|��|j|j�|��|�|j|j�|�|�|��Wntk
r�|�|�YnXdS)
zd
        Emit a record.

        Format the record and send it to the specified addressees.
        rN)�EmailMessager�ZFrom�,ZToZSubjectZDate)�smtplibZ
email.messager�Zemail.utilsr�Z	SMTP_PORTZSMTPr�r�r�rrr�r�ZutilsrdZset_contentr8r�r�ZehloZstarttlsZloginr�Zsend_message�quitrr)rrr�r�Zemailr�Zsmtpr=rrrr�s0


zSMTPHandler.emit)NNr�)r%r&r'r(r	r�rrrrrr��s�
#	r�c@sBeZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dS)�NTEventLogHandlera�
    A handler class which sends events to the NT Event Log. Adds a
    registry entry for the specified application name. If no dllname is
    provided, win32service.pyd (which contains some basic message
    placeholders) is used. Note that use of these placeholders will make
    your event logs big, as the entire message source is held in the log.
    If you want slimmer logs, you have to pass in the name of your own DLL
    which contains the message definitions you want to use in the event log.
    N�Applicationc
Cs�tj�|�z�ddl}ddl}||_||_|s`tj�	|jj
�}tj�	|d�}tj�|dd�}||_||_
|j�|||�|j|_tj|jtj|jtj|jtj|jtj|ji|_Wn"tk
r�td�d|_YnXdS)Nrzwin32service.pydzWThe Python Win32 extensions for NT (service, event logging) appear not to be available.)rr�r	�win32evtlogutil�win32evtlog�appname�_welurrrn�__file__rr�dllname�logtypeZAddSourceToRegistryZEVENTLOG_ERROR_TYPE�deftyper�ZEVENTLOG_INFORMATION_TYPEr�r�ZEVENTLOG_WARNING_TYPEr�r��typemap�ImportError�print)rr�r�r�r�r�rrrr	s6�
zNTEventLogHandler.__init__cCsdS)ay
        Return the message ID for the event record. If you are using your
        own messages, you could do this by having the msg passed to the
        logger being an ID rather than a formatting string. Then, in here,
        you could use a dictionary lookup to get the message ID. This
        version returns 1, which is the base message ID in win32service.pyd.
        r-rrrrr�getMessageID&szNTEventLogHandler.getMessageIDcCsdS)z�
        Return the event category for the record.

        Override this if you want to specify your own categories. This version
        returns 0.
        rrrrrr�getEventCategory0sz"NTEventLogHandler.getEventCategorycCs|j�|j|j�S)a�
        Return the event type for the record.

        Override this if you want to specify your own types. This version does
        a mapping using the handler's typemap attribute, which is set up in
        __init__() to a dictionary which contains mappings for DEBUG, INFO,
        WARNING, ERROR and CRITICAL. If you are using your own levels you will
        either need to override this method or place a suitable dictionary in
        the handler's typemap attribute.
        )r�r��levelnor�rrrr�getEventType9szNTEventLogHandler.getEventTypecCsn|jrjzD|�|�}|�|�}|�|�}|�|�}|j�|j||||g�Wntk
rh|�|�YnXdS)z�
        Emit a record.

        Determine the message ID, event category and event type. Then
        log the message in the NT event log.
        N)	r�r�r�rr8ZReportEventr�rr)rr�id�cat�typer=rrrrFs



zNTEventLogHandler.emitcCstj�|�dS)aS
        Clean up this handler.

        You can remove the application name from the registry as a
        source of event log entries. However, if you do this, you will
        not be able to see the events as you intended in the Event Log
        Viewer - it needs to be able to access the registry to get the
        DLL name.
        N)rr�r0r�rrrr0WszNTEventLogHandler.close)Nr�)
r%r&r'r(r	r�r�rrr0rrrrr�s	

	
r�c@s*eZdZdZddd�Zdd�Zd	d
�ZdS)�HTTPHandlerz^
    A class which sends records to a Web server, using either GET or
    POST semantics.
    �GETFNcCs`tj�|�|��}|dkr$td��|s8|dk	r8td��||_||_||_||_||_	||_
dS)zr
        Initialize the instance with the host, the request URL, and the method
        ("GET" or "POST")
        )r�POSTzmethod must be GET or POSTNz3context parameter only makes sense with secure=True)rr�r	rJrRr��url�methodr�r��context)rr�rr	r�r�r
rrrr	iszHTTPHandler.__init__cCs|jS)z�
        Default implementation of mapping the log record into a dict
        that is sent as the CGI data. Overwrite in your class.
        Contributed by Franz Glasner.
        )r�rrrr�mapLogRecord}szHTTPHandler.mapLogRecordcCsx�zPddl}ddl}|j}|jr4|jj||jd�}n|j�|�}|j}|j	�
|�|��}|jdkr�|�
d�dkrvd}nd}|d||f}|�|j|�|�
d�}	|	dkr�|d|	�}|jd	kr�|�d
d�|�dtt|���|j�r$ddl}
d
|j�d�}d|
�|����d�}|�d|�|��|jd	k�rH|�|�d��|��Wn tk
�rr|�|�YnXdS)zk
        Emit a record.

        Send the record to the Web server as a percent-encoded dictionary
        rN)r
r�?�&z%c%s�:rzContent-typez!application/x-www-form-urlencodedzContent-lengthz%s:%sr�zBasic �asciiZ
Authorization)Zhttp.clientZurllib.parser�r�ZclientZHTTPSConnectionr
ZHTTPConnectionr�parseZ	urlencoderr	�findZ
putrequestZ	putheaderr�r;r��base64r�Z	b64encode�strip�decodeZ
endheadersr�Zgetresponserr)rrZhttpZurllibr�r?r�data�sepr5rrwrrrr�sB


�zHTTPHandler.emit)rFNN)r%r&r'r(r	rrrrrrrds�
rc@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�BufferingHandlerz�
  A handler class which buffers logging records in memory. Whenever each
  record is added to the buffer, a check is made to see if the buffer should
  be flushed. If it should, then flush() is expected to do what's needed.
    cCstj�|�||_g|_dS)z>
        Initialize the handler with the buffer size.
        N)rr�r	�capacity�buffer)rrrrrr	�szBufferingHandler.__init__cCst|j�|jkS)z�
        Should the handler flush its buffer?

        Returns true if the buffer is up to capacity. This method can be
        overridden to implement custom flushing strategies.
        )r;rrrrrr�shouldFlush�szBufferingHandler.shouldFlushcCs"|j�|�|�|�r|��dS)z�
        Emit a record.

        Append the record. If shouldFlush() tells us to, call flush() to process
        the buffer.
        N)rrqrr�rrrrr�s
zBufferingHandler.emitcCs"|��z
g|_W5|��XdS)zw
        Override to implement custom flushing behaviour.

        This version just zaps the buffer to empty.
        N)r�r�rr�rrrr��s
zBufferingHandler.flushc	Cs z|��W5tj�|�XdS)zp
        Close the handler.

        This version just flushes and chains to the parent class' close().
        N)rr�r0r�r�rrrr0�szBufferingHandler.closeN)	r%r&r'r(r	rrr�r0rrrrr�s	rc@sBeZdZdZejddfdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dS)�
MemoryHandlerz�
    A handler class which buffers logging records in memory, periodically
    flushing them to a target handler. Flushing occurs whenever the buffer
    is full, or when an event of a certain severity or greater is seen.
    NTcCs"t�||�||_||_||_dS)a;
        Initialize the handler with the buffer size, the level at which
        flushing should occur and an optional target.

        Note that without a target being set either here or via setTarget(),
        a MemoryHandler is no use to anyone!

        The ``flushOnClose`` argument is ``True`` for backward compatibility
        reasons - the old behaviour is that when the handler is closed, the
        buffer is flushed, even if the flush level hasn't been exceeded nor the
        capacity exceeded. To prevent this, set ``flushOnClose`` to ``False``.
        N)rr	�
flushLevel�target�flushOnClose)rrrrrrrrr	�szMemoryHandler.__init__cCst|j�|jkp|j|jkS)zP
        Check for buffer full or a record at the flushLevel or higher.
        )r;rrrrrrrrrs
�zMemoryHandler.shouldFlushcCs"|��z
||_W5|��XdS)z:
        Set the target handler for this handler.
        N)r�r�r)rrrrr�	setTarget
s
zMemoryHandler.setTargetcCs@|��z(|jr.|jD]}|j�|�qg|_W5|��XdS)z�
        For a MemoryHandler, flushing means just sending the buffered
        records to the target, if there is one. Override if you want
        different behaviour.

        The record buffer is also cleared by this operation.
        N)r�r�rr�handlerrrrr�s

zMemoryHandler.flushcCsBz|jr|��W5|��zd|_t�|�W5|��XXdS)zi
        Flush, if appropriately configured, set the target to None and lose the
        buffer.
        N)r�r�rrr0rr�r�rrrr0(szMemoryHandler.close)r%r&r'r(rr�r	rrr�r0rrrrr�s�

rc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�QueueHandlera�
    This handler sends events to a queue. Typically, it would be used together
    with a multiprocessing Queue to centralise logging to file in one process
    (in a multi-process application), so as to avoid file write contention
    between processes.

    This code is new in Python 3.2, but this class can be copy pasted into
    user code for use with earlier Python versions.
    cCstj�|�||_dS)zA
        Initialise an instance, using the passed queue.
        N)rr�r	�queue)rr"rrrr	DszQueueHandler.__init__cCs|j�|�dS)z�
        Enqueue a record.

        The base implementation uses put_nowait. You may want to override
        this method if you want to use blocking, timeouts or custom queue
        implementations.
        N)r"�
put_nowaitrrrr�enqueueKszQueueHandler.enqueuecCs6|�|�}t�|�}||_||_d|_d|_d|_|S)a�
        Prepares a record for queuing. The object returned by this method is
        enqueued.

        The base implementation formats the record to merge the message
        and arguments, and removes unpickleable items from the record
        in-place.

        You might want to override this method if you want to convert
        the record to a dict or JSON string, or send a modified copy
        of the record while leaving the original intact.
        N)r8�copyr�r=r�r�Zexc_textr<rrr�prepareUs

zQueueHandler.preparecCs8z|�|�|��Wntk
r2|�|�YnXdS)zm
        Emit a record.

        Writes the LogRecord to the queue, preparing it for pickling first.
        N)r$r&rrrrrrrrszQueueHandler.emitN)r%r&r'r(r	r$r&rrrrrr!9s


r!c@sZeZdZdZdZdd�dd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)�
QueueListenerz�
    This class implements an internal threaded listener which watches for
    LogRecords being added to a queue, removes them and passes them to a
    list of handlers for processing.
    NF)�respect_handler_levelcGs||_||_d|_||_dS)zW
        Initialise an instance with the specified queue and
        handlers.
        N)r"�handlers�_threadr()rr"r(r)rrrr	�szQueueListener.__init__cCs|j�|�S)z�
        Dequeue a record and return it, optionally blocking.

        The base implementation uses get. You may want to override this method
        if you want to use timeouts or work with custom queue implementations.
        )r"r�)r�blockrrr�dequeue�szQueueListener.dequeuecCs&tj|jd�|_}d|_|��dS)z�
        Start the listener.

        This starts up a background thread to monitor the queue for
        LogRecords to process.
        )rTN)�	threadingZThread�_monitorr*r��start)rr\rrrr/�szQueueListener.startcCs|S)a
        Prepare a record for handling.

        This method just returns the passed-in record. You may want to
        override this method if you need to do any custom marshalling or
        manipulation of the record before passing it to the handlers.
        rrrrrr&�szQueueListener.preparecCs@|�|�}|jD]*}|js d}n|j|jk}|r|�|�qdS)z|
        Handle a record.

        This just loops through the handlers offering them the record
        to handle.
        TN)r&r)r(r�levelr )rrZhandlerZprocessrrrr �s

zQueueListener.handlecCsp|j}t|d�}z>|�d�}||jkr6|r2|��Wql|�|�|rL|��Wqtjk
rhYqlYqXqdS)z�
        Monitor the queue for records, and ask the handler
        to deal with them.

        This method runs on a separate, internal thread.
        The thread will terminate if it sees a sentinel object in the queue.
        �	task_doneTN)r"�hasattrr,�	_sentinelr1r ZEmpty)r�qZ
has_task_donerrrrr.�s



zQueueListener._monitorcCs|j�|j�dS)z�
        This is used to enqueue the sentinel record.

        The base implementation uses put_nowait. You may want to override this
        method if you want to use timeouts or work with custom queue
        implementations.
        N)r"r#r3r�rrr�enqueue_sentinel�szQueueListener.enqueue_sentinelcCs|��|j��d|_dS)a

        Stop the listener.

        This asks the thread to terminate, and then waits for it to do so.
        Note that if you don't call this before your application exits, there
        may be some records still left on the queue, which won't be processed.
        N)r5r*rrr�rrr�stop�s
zQueueListener.stop)
r%r&r'r(r3r	r,r/r&r r.r5r6rrrrr'~s
	

r')'r(rr�rr�r�rYrUrXrrrr"r-r%ZDEFAULT_TCP_LOGGING_PORTZDEFAULT_UDP_LOGGING_PORTZDEFAULT_HTTP_LOGGING_PORTZDEFAULT_SOAP_LOGGING_PORTr�ZSYSLOG_TCP_PORTrerrr)r>rxr�r�r�r�r�r�rrrr!�objectr'rrrr�<module>s<	8FL`E(*PbO9MElogging/__pycache__/config.cpython-38.opt-2.pyc000064400000045176151153537460015266 0ustar00U

e5d��@sJddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
mZdZej
Zdad*dd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�Zdd�Ze�dej�Zdd�ZGdd�de�ZGdd�dee�ZGdd�de e�Z!Gdd�de"e�Z#Gd d!�d!e�Z$Gd"d#�d#e$�Z%e%Z&d$d%�Z'edfd&d'�Z(d(d)�Z)dS)+�N)�ThreadingTCPServer�StreamRequestHandleriF#TcCs�ddl}t||j�r|}n*|�|�}t|d�r:|�|�n
|�|�t|�}t�	�z t�t||�}t
|||�W5t�
�XdS)Nr�readline)�configparser�
isinstanceZRawConfigParserZConfigParser�hasattrZ	read_file�read�_create_formatters�logging�_acquireLock�_releaseLock�_clearExistingHandlers�_install_handlers�_install_loggers)Zfname�defaults�disable_existing_loggersr�cp�
formatters�handlers�r�&/usr/lib64/python3.8/logging/config.py�
fileConfig3s	



rc	Csl|�d�}|�d�}t|�}|D]F}|d|}zt||�}Wq tk
rdt|�t||�}Yq Xq |S)N�.r)�split�pop�
__import__�getattr�AttributeError)�name�used�found�nrrr�_resolveUs

r"cCsttj|�S�N)�map�str�strip)Zalistrrr�
_strip_spacescsr'cCs�|dd}t|�siS|�d�}t|�}i}|D]v}d|}|j|dddd�}|j|dddd�}|j|d	dd
d�}tj}||�d�}	|	r�t|	�}||||�}
|
||<q2|S)Nr�keys�,zformatter_%s�formatT)�raw�fallback�datefmt�style�%�class)�lenrr'�getr
�	Formatterr")rZflistrZformZsectnameZfsZdfsZstl�c�
class_name�frrrr	fs$

r	c
Cs^|dd}t|�siS|�d�}t|�}i}g}|D�]}|d|}|d}|�dd�}zt|tt��}Wn ttfk
r�t	|�}YnX|�dd	�}	t|	tt��}	|�d
d�}
t|
tt��}
||	|
�}d|kr�|d}|�
|�t|�r�|�||�t|tj
j��r2|�d
d�}
t|
��r2|�||
f�|||<q6|D]\}}|�||��q@|S)Nrr(r)z
handler_%sr0�	formatter��args�()�kwargsz{}�level�target)r1rr'r2�eval�varsr
r�	NameErrorr"�setLevel�setFormatter�
issubclassr�
MemoryHandler�appendZ	setTarget)rr�hlistrZfixups�hand�section�klass�fmtr9r;�hr<r=�trrrr|sB





rcCsTtj}|D]D}|jj|}||krHt|tj�sN|�tj�g|_d|_	q
||_
q
dS)NT)r
�root�manager�
loggerDictrZPlaceHolderrAZNOTSETr�	propagate�disabled)�existing�
child_loggers�disable_existingrM�log�loggerrrr�_handle_existing_loggers�srWcCs|dd}|�d�}tt|��}|�d�|d}tj}|}d|krX|d}|�|�|jdd�D]}|�|�qf|d}	t	|	�r�|	�d�}	t|	�}	|	D]}
|�
||
�q�t|jj�
��}|��g}|D�](}|d|}|d	}
|jd
dd�}t�|
�}|
|k�rv|�|
�d}|
d
}t	|�}t	|�}||k�rl||d|�|k�r`|�||�|d7}�q2|�|
�d|k�r�|d}|�|�|jdd�D]}|�|��q�||_d|_|d}	t	|	�r�|	�d�}	t|	�}	|	D]}
|�
||
��q�q�t|||�dS)N�loggersr(r)rMZlogger_rootr<rz	logger_%s�qualnamerP�)r,rr)r�listr'�remover
rMrAr�
removeHandlerr1�
addHandlerrNrOr(�sortZgetint�	getLogger�indexrErPrQrW)rrrTZllistrHrMrUr<rKrFrGrRrSZqnrPrV�i�prefixed�pflen�num_existingrrrr�sd











rcCs.tj��t�tjdd��tjdd�=dSr#)r
�	_handlers�clearZshutdownZ_handlerListrrrrr
s
r
z^[a-z_][a-z0-9_]*$cCst�|�}|std|��dS)Nz!Not a valid Python identifier: %rT)�
IDENTIFIER�match�
ValueError)�s�mrrr�valid_idents
rmc@seZdZddd�Zdd�ZdS)�ConvertingMixinTcCsB|j�|�}||k	r>|r |||<t|�tttfkr>||_||_|Sr#)�configurator�convert�type�ConvertingDict�ConvertingList�ConvertingTuple�parent�key)�selfrv�value�replace�resultrrr�convert_with_key"s
�z ConvertingMixin.convert_with_keycCs0|j�|�}||k	r,t|�tttfkr,||_|Sr#)rorprqrrrsrtru)rwrxrzrrrrp.s
�zConvertingMixin.convertN)T)�__name__�
__module__�__qualname__r{rprrrrrns
rnc@s(eZdZdd�Zddd�Zd	dd�ZdS)
rrcCst�||�}|�||�Sr#)�dict�__getitem__r{�rwrvrxrrrr�CszConvertingDict.__getitem__NcCst�|||�}|�||�Sr#)rr2r{�rwrv�defaultrxrrrr2GszConvertingDict.getcCst�|||�}|j||dd�S�NF)ry)rrr{r�rrrrKszConvertingDict.pop)N)N)r|r}r~r�r2rrrrrrr@s
rrc@seZdZdd�Zddd�ZdS)rscCst�||�}|�||�Sr#)r[r�r{r�rrrr�QszConvertingList.__getitem__���cCst�||�}|�|�Sr#)r[rrp)rw�idxrxrrrrUszConvertingList.popN)r�)r|r}r~r�rrrrrrsOsrsc@seZdZdd�ZdS)rtcCst�||�}|j||dd�Sr�)�tupler�r{r�rrrr�[szConvertingTuple.__getitem__N)r|r}r~r�rrrrrtYsrtc@s�eZdZe�d�Ze�d�Ze�d�Ze�d�Ze�d�Z	ddd�Z
ee�Z
d	d
�Zdd�Zd
d�Zdd�Zdd�Zdd�Zdd�ZdS)�BaseConfiguratorz%^(?P<prefix>[a-z]+)://(?P<suffix>.*)$z^\s*(\w+)\s*z^\.\s*(\w+)\s*z^\[\s*(\w+)\s*\]\s*z^\d+$�ext_convert�cfg_convert)ZextZcfgcCst|�|_||j_dSr#)rr�configro)rwr�rrr�__init__ts
zBaseConfigurator.__init__c		Cs�|�d�}|�d�}z^|�|�}|D]H}|d|7}zt||�}Wq$tk
rj|�|�t||�}Yq$Xq$|WStk
r�t��dd�\}}td||f�}|||_	|_
|�YnXdS)NrrrZzCannot resolve %r: %s)rr�importerrr�ImportError�sys�exc_inforj�	__cause__�
__traceback__)	rwrkrrr Zfrag�e�tb�vrrr�resolvexs"



zBaseConfigurator.resolvecCs
|�|�Sr#)r��rwrxrrrr��szBaseConfigurator.ext_convertcCs�|}|j�|�}|dkr&td|��n�||��d�}|j|��d}|r�|j�|�}|rn||��d}nd|j�|�}|r�|��d}|j�|�s�||}n2zt	|�}||}Wnt
k
r�||}YnX|r�||��d�}qHtd||f��qH|S)NzUnable to convert %rrzUnable to convert %r at %r)�WORD_PATTERNrirj�endr��groups�DOT_PATTERN�
INDEX_PATTERN�
DIGIT_PATTERN�int�	TypeError)rwrx�restrl�dr�r!rrrr��s4
�zBaseConfigurator.cfg_convertcCs�t|t�s$t|t�r$t|�}||_n�t|t�sHt|t�rHt|�}||_n�t|t�svt|t�rvt|d�svt|�}||_nVt|t	�r�|j
�|�}|r�|��}|d}|j
�|d�}|r�|d}t||�}||�}|S)N�_fields�prefix�suffix)rrrrrorsr[rtr�rr%�CONVERT_PATTERNri�	groupdict�value_convertersr2r)rwrxrlr�r�Z	converterr�rrrrp�s0
��

zBaseConfigurator.convertcsj��d�}t|�s|�|�}��dd�}�fdd��D�}|f|�}|rf|��D]\}}t|||�qP|S)Nr:rcsi|]}t|�r|�|�qSr�rm��.0�k�r�rr�
<dictcomp>�sz5BaseConfigurator.configure_custom.<locals>.<dictcomp>)r�callabler��items�setattr)rwr�r4�propsr;rzrrxrr�r�configure_custom�s


z!BaseConfigurator.configure_customcCst|t�rt|�}|Sr#)rr[r�r�rrr�as_tuple�s
zBaseConfigurator.as_tupleN)r|r}r~�re�compiler�r�r�r�r�r��staticmethodrr�r�r�r�r�rpr�r�rrrrr�`s 




�"r�c@sZeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zddd�Z	ddd�Z
ddd�ZdS)�DictConfiguratorcCs�|j}d|krtd��|ddkr2td|d��|�dd�}i}t���zn|�r�|�d|�}|D]�}|tjkr�td|��qdz6tj|}||}|�d	d�}|r�|�t�	|��Wqdt
k
r�}	ztd
|�|	�W5d}	~	XYqdXqd|�d|�}
|
D]N}z|�||
|d�Wq�t
k
�rF}	ztd
|�|	�W5d}	~	XYq�Xq�|�dd�}|�r�z|�|d�Wn.t
k
�r�}	ztd�|	�W5d}	~	XYnX�n|�dd�}t
�|�d|�}
|
D]P}z|�|
|�|
|<Wn2t
k
�r}	ztd|�|	�W5d}	~	XYnX�q�|�d|�}|D]P}z|�||�||<Wn2t
k
�rp}	ztd|�|	�W5d}	~	XYnX�q$|�d|�}g}t|�D]v}z |�||�}||_|||<WnNt
k
�r}	z.dt|	j�k�r�|�|�ntd
|�|	�W5d}	~	XYnX�q�|D]Z}z |�||�}||_|||<Wn2t
k
�r`}	ztd
|�|	�W5d}	~	XYnX�q
tj}t|jj���}|��g}|�d|�}
|
D]�}||k�r|�|�d}|d}t|�}t|�}||k�r||d|�|k�r�|�||�|d7}�q�|�|�z|�||
|�Wn2t
k
�rV}	ztd
|�|	�W5d}	~	XYnX�q�t|||�|�dd�}|�r�z|�|�Wn.t
k
�r�}	ztd�|	�W5d}	~	XYnXW5t��XdS)N�versionz$dictionary doesn't specify a versionrZzUnsupported version: %s�incrementalFrzNo handler found with name %rr<zUnable to configure handler %rrXTzUnable to configure logger %rrMzUnable to configure root loggerrrz Unable to configure formatter %r�filterszUnable to configure filter %r�target not configured yetr) r�rjrr
rrr2rfrA�_checkLevel�	Exception�configure_logger�configure_rootr
�configure_formatter�configure_filter�sorted�configure_handlerrr%r�rErMr[rNrOr(r_rar1r\rW)rwr�r�Z
EMPTY_DICTrr�handlerZhandler_configr<r�rXrMrTrr�ZdeferredrRrSrbrcrdrerrr�	configure�s
�
��������������



����zDictConfigurator.configurec

Cs�d|krr|d}z|�|�}Wq�tk
rn}z2dt|�kr>�|�d�|d<||d<|�|�}W5d}~XYq�Xnl|�dd�}|�dd�}|�dd�}|�dd�}|s�tj}	nt|�}	d	|kr�|	||||d	�}n|	|||�}|S)
Nr:z'format'r*rJr-r.r/r0Zvalidate)r�r�r%rr2r
r3r")
rwr��factoryrz�terJZdfmtr.�cnamer4rrrr��s*z$DictConfigurator.configure_formattercCs.d|kr|�|�}n|�dd�}t�|�}|S)Nr:rr8)r�r2r
ZFilter)rwr�rzrrrrr��s

z!DictConfigurator.configure_filtercCsX|D]N}z|�|jd|�Wqtk
rP}ztd|�|�W5d}~XYqXqdS)Nr�zUnable to add filter %r)Z	addFilterr�r�rj)rwZfiltererr�r6r�rrr�add_filters�s
zDictConfigurator.add_filtersc
s�t��}��dd�}|r\z|jd|}Wn0tk
rZ}ztd|�|�W5d}~XYnX��dd�}��dd�}d�kr���d�}t|�s�|�|�}|}�n��d�}	|�|	�}
t|
tj	j
��rFd�k�rFz>|jd	�d}t|tj��s��
|�td
��|�d<Wn6tk
�rB}ztd�d�|�W5d}~XYnXnZt|
tj	j��rtd�k�rt|��d��d<n,t|
tj	j��r�d
�k�r�|��d
��d
<|
}��dd�}�fdd��D�}
z|f|
�}WnLtk
�r}z,dt|�k�r�|
�d�|
d<|f|
�}W5d}~XYnX|�r.|�|�|dk	�rH|�t�|��|�rZ|�||�|�r�|��D]\}}t|||��qh|S)Nr7rzUnable to set formatter %rr<r�r:r0r=rr�zUnable to set target handler %rZmailhostZaddressrcsi|]}t|�r|�|�qSrr�r�r�rrr��sz6DictConfigurator.configure_handler.<locals>.<dictcomp>z'stream'�streamZstrm)rrr�r�rjr�r�rCr
rrDrZHandler�updater�ZSMTPHandlerr�Z
SysLogHandlerr%rBrAr�r�r�r�)rwr�Zconfig_copyr7r�r<r�r4r�r�rIZthr�r;rzr�rrxrr�rr��s~��



�
����

z"DictConfigurator.configure_handlercCsX|D]N}z|�|jd|�Wqtk
rP}ztd|�|�W5d}~XYqXqdS)NrzUnable to add handler %r)r^r�r�rj)rwrVrrKr�rrr�add_handlers�s
zDictConfigurator.add_handlersFcCs�|�dd�}|dk	r$|�t�|��|s~|jdd�D]}|�|�q6|�dd�}|rb|�||�|�dd�}|r~|�||�dS)Nr<rr�)r2rAr
r�rr]r�r�)rwrVr�r�r<rKrr�rrr�common_logger_configsz%DictConfigurator.common_logger_configcCs6t�|�}|�|||�|�dd�}|dk	r2||_dS)NrP)r
r`r�r2rP)rwrr�r�rVrPrrrr�s

z!DictConfigurator.configure_loggercCst��}|�|||�dSr#)r
r`r�)rwr�r�rMrrrr�szDictConfigurator.configure_rootN)F)F)F)r|r}r~r�r�r�r�r�r�r�r�r�rrrrr��s$	?

r�cCst|���dSr#)�dictConfigClassr�r�rrr�
dictConfig&sr�csDGdd�dt�}Gdd�dt�}G�fdd�dtj���||||�S)Nc@seZdZdd�ZdS)z#listen.<locals>.ConfigStreamHandlercSsD�z
|j}|�d�}t|�dk�r
t�d|�d}|j�|�}t|�|krb||�|t|��}q>|jjdk	rz|j�|�}|dk	r�|�d�}zddl}|�	|�}t
|�WnHtk
r�t�
|�}zt|�Wntk
r�t��YnXYnX|jj�r
|jj��Wn2tk
�r>}z|jtk�r.�W5d}~XYnXdS)N�z>Lrzutf-8)Z
connectionZrecvr1�structZunpack�server�verify�decode�json�loadsr�r��io�StringIOr�	traceback�	print_exc�ready�set�OSError�errno�RESET_ERROR)rwZconn�chunkZslenr�r��filer�rrr�handleFs6




z*listen.<locals>.ConfigStreamHandler.handleN)r|r}r~r�rrrr�ConfigStreamHandler?sr�c@s,eZdZdZdedddfdd�Zdd�ZdS)z$listen.<locals>.ConfigSocketReceiverrZZ	localhostNcSs>t�|||f|�t��d|_t��d|_||_||_dS)NrrZ)	rr�r
r�abortr�timeoutr�r�)rwZhost�portr�r�r�rrrr�tsz-listen.<locals>.ConfigSocketReceiver.__init__cSs`ddl}d}|sT|�|j��ggg|j�\}}}|r<|��t��|j}t��q|�	�dS)Nr)
�selectZsocket�filenor�Zhandle_requestr
rr�rZserver_close)rwr�r�ZrdZwrZexrrr�serve_until_stopped~s�

z8listen.<locals>.ConfigSocketReceiver.serve_until_stopped)r|r}r~Zallow_reuse_address�DEFAULT_LOGGING_CONFIG_PORTr�r�rrrr�ConfigSocketReceiverms�

r�cs&eZdZ��fdd�Zdd�Z�ZS)zlisten.<locals>.Servercs4t�|���||_||_||_||_t��|_dSr#)	�superr��rcvr�hdlrr�r��	threadingZEventr�)rwr�r�r�r�)�Server�	__class__rrr��szlisten.<locals>.Server.__init__cSsZ|j|j|j|j|jd�}|jdkr0|jd|_|j��t��|a	t�
�|��dS)N)r�r�r�r�rrZ)r�r�r�r�r�Zserver_addressr�r
r�	_listenerrr�)rwr�rrr�run�s�

zlisten.<locals>.Server.run)r|r}r~r�r��
__classcell__r�r�)r�rr��sr�)rrr�ZThread)r�r�r�r�rr�r�listen+s.r�cCs*t��ztrdt_daW5t��XdS)NrZ)r
rrr�r�rrrr�
stopListening�sr�)NT)*r�r�r
Zlogging.handlersr�r�r�r�r�Zsocketserverrrr�Z
ECONNRESETr�r�rr"r'r	rrWrr
r��Irhrm�objectrnrrrr[rsr�rtr�r�r�r�r�r�rrrr�<module>sF
"%W!
Azlogging/__pycache__/__init__.cpython-38.opt-2.pyc000064400000107365151153537460015557 0ustar00U

e5d�0�*@s2ddlZddlZddlZddlZddlZddlZddlZddlZddlZ	ddl
mZddl
mZ
dddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-g*ZddlZd.Zd/Zd0Zd1Ze��Zd2Zd2Zd2Zd2Zd3ZeZd4Zd5ZeZd6Zd7ZdZ ededededede diZ!eeeeeeee d8�Z"d9d �Z#d:d�Z$e%ed;��r`d<d=�Z&nd>d?�Z&ej'�(e$j)j*�Z+d@dA�Z,e�-�Z.dBdC�Z/dDdE�Z0e%edF��s�dGdH�Z1n(e�2�Z3dIdH�Z1dJdK�Z4ej5e/e4e0dL�GdMd�de6�Z7e7a8dNd+�Z9dOd*�Z:dPd%�Z;e
�Z<[
GdQdR�dRe6�Z=GdSdT�dTe=�Z>GdUdV�dVe=�Z?dWZ@e=e@fe>dXfe?dYfdZ�ZAGd[d�de6�Ze�ZBGd\d�de6�ZCGd]d�de6�ZDGd^d_�d_e6�ZEe�F�ZGgZHd`da�ZIdbdc�ZJGddd
�d
eE�ZKGded�deK�ZLGdfd
�d
eL�ZMGdgdh�dheL�ZNeNe�ZOeOZPGdidj�dje6�ZQdkd&�ZRdld"�ZSGdmdn�dne6�ZTGdod�deE�ZUGdpdq�dqeU�ZVeUaWGdrd�de6�ZXeVe�ZYeYeU_YeTeUjY�eU_Zdsd�Z[d�dtd!�Z\dud�Z]e]Z^dvd�Z_d2dw�dxd�Z`dyd)�Zadzd(�Zbd{d#�Zcd|d�Zdd}d$�Zeefd~d�ZfeHfdd'�ZgddlhZheh�ieg�Gd�d�deK�Zjdakd�d�d��Zld�d�ZmdS)��N)�Template)�	Formatter�BASIC_FORMAT�BufferingFormatter�CRITICAL�DEBUG�ERROR�FATAL�FileHandler�Filterr�Handler�INFO�	LogRecord�Logger�
LoggerAdapter�NOTSET�NullHandler�
StreamHandler�WARN�WARNING�addLevelName�basicConfig�captureWarnings�critical�debug�disable�error�	exception�fatal�getLevelName�	getLogger�getLoggerClass�info�log�
makeLogRecord�setLoggerClass�shutdown�warn�warning�getLogRecordFactory�setLogRecordFactory�
lastResort�raiseExceptionsz&Vinay Sajip <vinay_sajip@red-dove.com>Z
productionz0.5.1.2z07 February 2010T�2�(���
)rr	rrrr
rrcCs4t�|�}|dk	r|St�|�}|dk	r,|Sd|S)NzLevel %s)�_levelToName�get�_nameToLevel)�level�result�r7�(/usr/lib64/python3.8/logging/__init__.pyrws

cCs(t�z|t|<|t|<W5t�XdS�N)�_acquireLock�_releaseLockr2r4)r5Z	levelNamer7r7r8r�s
�	_getframecCs
t�d�S)N�)�sysr<r7r7r7r8�<lambda>��r?cCs2zt�Wn$tk
r,t��djjYSXdS)N�)�	Exceptionr>�exc_info�tb_frame�f_backr7r7r7r8�currentframe�srFcCsJt|t�r|}n6t|�|kr:|tkr0td|��t|}ntd|��|S)NzUnknown level: %rz*Level not an integer or a valid string: %r)�
isinstance�int�strr4�
ValueError�	TypeError)r5�rvr7r7r8�_checkLevel�s

rMcCstrt��dSr9)�_lock�acquirer7r7r7r8r:�sr:cCstrt��dSr9)rN�releaser7r7r7r8r;�sr;�register_at_forkcCsdSr9r7��instancer7r7r8�_register_at_fork_reinit_lock�srTcCs"t�zt�|�W5t�XdSr9)r:r;�_at_fork_reinit_lock_weakset�addrRr7r7r8rT�scCsXtD]H}z|��Wqtk
rJ}ztdtd|tjd�W5d}~XYqXqt�dS)Nz&Ignoring exception from logging atforkz._reinit_lock() method:��file)rU�
createLockrB�printrSr>�stderrr;)�handler�errr7r7r8�!_after_at_fork_child_reinit_locks�s�r^)ZbeforeZafter_in_childZafter_in_parentc@s&eZdZddd�Zdd�Zdd�ZdS)	rNc


Ks�t��}||_||_|rFt|�dkrFt|dtjj�rF|drF|d}||_t	|�|_
||_||_z&t
j�|�|_t
j�|j�d|_Wn&tttfk
r�||_d|_YnX||_d|_|	|_||_||_||_|t|�d|_|jtd|_t �rt!�"�|_#t!�$�j|_%nd|_#d|_%t&�s.d|_'nDd|_'t(j)�*d�}|dk	�rrz|�+�j|_'Wnt,k
�rpYnXt-�r�t.t
d��r�t
�/�|_0nd|_0dS)N�rzUnknown modulei�ZMainProcessZmultiprocessing�getpid)1�time�name�msg�lenrG�collections�abc�Mapping�argsrZ	levelname�levelno�pathname�os�path�basename�filename�splitext�modulerKrJ�AttributeErrorrC�exc_text�
stack_info�linenoZfuncName�createdrH�msecs�
_startTimeZrelativeCreated�
logThreads�	threading�	get_ident�threadZcurrent_threadZ
threadName�logMultiprocessingZprocessNamer>�modulesr3Zcurrent_processrB�logProcesses�hasattrr`�process)
�selfrbr5rjrtrcrhrC�func�sinfo�kwargs�ctZmpr7r7r8�__init__ sT"�


zLogRecord.__init__cCsd|j|j|j|j|jfS)Nz!<LogRecord: %s, %s, %s, %s, "%s">)rbrirjrtrc�r�r7r7r8�__repr__hs

�zLogRecord.__repr__cCst|j�}|jr||j}|Sr9)rIrcrh)r�rcr7r7r8�
getMessagels

zLogRecord.getMessage)NN)�__name__�
__module__�__qualname__r�r�r�r7r7r7r8rs

�
HcCs|adSr9��_logRecordFactory)�factoryr7r7r8r*}scCstSr9r�r7r7r7r8r)�sc	Cs&tdddddddd�}|j�|�|S)N�rr7)r��__dict__�update)�dictrLr7r7r8r$�sc@sNeZdZdZdZdZe�dej�Z	dd�Z
dd�Zd	d
�Zdd�Z
d
d�ZdS)�PercentStylez%(message)sz%(asctime)sz
%(asctime)z5%\(\w+\)[#0+ -]*(\*|\d+)?(\.(\*|\d+))?[diouxefgcrsa%]cCs|p|j|_dSr9)�default_format�_fmt�r��fmtr7r7r8r��szPercentStyle.__init__cCs|j�|j�dkS�Nr)r��find�asctime_searchr�r7r7r8�usesTime�szPercentStyle.usesTimecCs*|j�|j�s&td|j|jdf��dS)Nz"Invalid format '%s' for '%s' styler)�validation_pattern�searchr�rJr�r�r7r7r8�validate�szPercentStyle.validatecCs|j|jSr9)r�r��r��recordr7r7r8�_format�szPercentStyle._formatc
Cs@z|�|�WStk
r:}ztd|��W5d}~XYnXdS)Nz(Formatting field not found in record: %s)r��KeyErrorrJ)r�r��er7r7r8�format�szPercentStyle.formatN)r�r�r�r��asctime_formatr��re�compile�Ir�r�r�r�r�r�r7r7r7r8r��sr�c@s@eZdZdZdZdZe�dej�Z	e�d�Z
dd�Zdd	�Zd
S)�StrFormatStylez	{message}z	{asctime}z{asctimezF^(.?[<>=^])?[+ -]?#?0?(\d+|{\w+})?[,_]?(\.(\d+|{\w+}))?[bcdefgnosx%]?$z^(\d+|\w+)(\.\w+|\[[^]]+\])*$cCs|jjf|j�Sr9)r�r�r�r�r7r7r8r��szStrFormatStyle._formatc
Cs�t�}zxt�|j�D]f\}}}}|rF|j�|�s<td|��|�|�|r^|dkr^td|��|r|j�|�std|��qWn.tk
r�}ztd|��W5d}~XYnX|s�td��dS)Nz!invalid field name/expression: %rZrsazinvalid conversion: %rzbad specifier: %rzinvalid format: %s�invalid format: no fields)	�set�_str_formatter�parser��
field_spec�matchrJrV�fmt_spec)r��fields�_Z	fieldname�specZ
conversionr�r7r7r8r��s
zStrFormatStyle.validateN)
r�r�r�r�r�r�r�r�r�r�r�r�r�r7r7r7r8r��s
r�c@s8eZdZdZdZdZdd�Zdd�Zdd�Zd	d
�Z	dS)�StringTemplateStylez
${message}z
${asctime}cCs|p|j|_t|j�|_dSr9)r�r�r�_tplr�r7r7r8r��szStringTemplateStyle.__init__cCs$|j}|�d�dkp"|�|j�dkS)Nz$asctimer)r�r�r�r�r7r7r8r��szStringTemplateStyle.usesTimecCs|tj}t�}|�|j�D]R}|��}|dr<|�|d�q|drT|�|d�q|�d�dkrtd��q|sxtd��dS)NZnamedZbracedr�$z$invalid format: bare '$' not allowedr�)	r�patternr��finditerr��	groupdictrV�grouprJ)r�r�r��m�dr7r7r8r��s
zStringTemplateStyle.validatecCs|jjf|j�Sr9)r�Z
substituter�r�r7r7r8r��szStringTemplateStyle._formatN)
r�r�r�r�r�r�r�r�r�r�r7r7r7r8r��sr�z"%(levelname)s:%(name)s:%(message)sz{levelname}:{name}:{message}z${levelname}:${name}:${message})�%�{r�c@sVeZdZejZddd�ZdZdZddd	�Z	d
d�Z
dd
�Zdd�Zdd�Z
dd�ZdS)rNr�TcCsR|tkrtdd�t�����t|d|�|_|r>|j��|jj|_||_dS)N�Style must be one of: %s�,r)�_STYLESrJ�join�keys�_styler�r��datefmt)r�r�r��styler�r7r7r8r�/s�

zFormatter.__init__z%Y-%m-%d %H:%M:%Sz%s,%03dcCs@|�|j�}|rt�||�}nt�|j|�}|j||jf}|Sr9)�	converterrura�strftime�default_time_format�default_msec_formatrv)r�r�r�r��s�tr7r7r8�
formatTimeLszFormatter.formatTimecCsZt��}|d}t�|d|d|d|�|��}|��|dd�dkrV|dd�}|S)NrArr_����
)�io�StringIO�	traceback�print_exception�getvalue�close)r�Zei�sio�tbr�r7r7r8�formatExceptionfszFormatter.formatExceptioncCs
|j��Sr9)r�r�r�r7r7r8r�yszFormatter.usesTimecCs|j�|�Sr9)r�r�r�r7r7r8�
formatMessageszFormatter.formatMessagecCs|Sr9r7)r�rsr7r7r8�formatStack�szFormatter.formatStackcCs�|��|_|��r"|�||j�|_|�|�}|jrF|jsF|�	|j�|_|jrn|dd�dkrd|d}||j}|j
r�|dd�dkr�|d}||�|j
�}|S)Nr�r�)r��messager�r�r��asctimer�rCrrr�rsr�)r�r�r�r7r7r8r��s 


zFormatter.format)NNr�T)N)r�r�r�ra�	localtimer�r�r�r�r�r�r�r�r�r�r7r7r7r8rs+


c@s.eZdZd
dd�Zdd�Zdd�Zdd	�ZdS)rNcCs|r||_nt|_dSr9)�linefmt�_defaultFormatter)r�r�r7r7r8r��szBufferingFormatter.__init__cCsdS�Nr�r7�r��recordsr7r7r8�formatHeader�szBufferingFormatter.formatHeadercCsdSr�r7r�r7r7r8�formatFooter�szBufferingFormatter.formatFootercCsJd}t|�dkrF||�|�}|D]}||j�|�}q"||�|�}|S)Nr�r)rdr�r�r�r�)r�r�rLr�r7r7r8r��szBufferingFormatter.format)N)r�r�r�r�r�r�r�r7r7r7r8r�s

c@seZdZddd�Zdd�ZdS)rr�cCs||_t|�|_dSr9)rbrd�nlen�r�rbr7r7r8r��szFilter.__init__cCsJ|jdkrdS|j|jkrdS|j�|jd|j�dkr:dS|j|jdkS)NrTF�.)r�rbr�r�r7r7r8�filter�s
z
Filter.filterN)r�)r�r�r�r�r�r7r7r7r8r�s
c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�FilterercCs
g|_dSr9)�filtersr�r7r7r8r�szFilterer.__init__cCs||jkr|j�|�dSr9)r��append�r�r�r7r7r8�	addFilters
zFilterer.addFiltercCs||jkr|j�|�dSr9)r��remover�r7r7r8�removeFilters
zFilterer.removeFiltercCs>d}|jD].}t|d�r$|�|�}n||�}|s
d}q:q
|S)NTr�F)r�rr�)r�r�rL�fr6r7r7r8r�s

zFilterer.filterN)r�r�r�r�r�r�r�r7r7r7r8r�sr�cCsFttt}}}|rB|rB|rB|�z||kr6|�|�W5|�XdSr9)r:r;�_handlerListr�)�wrrOrP�handlersr7r7r8�_removeHandlerRef:sr�cCs*t�zt�t�|t��W5t�XdSr9)r:r;r�r��weakref�refr�)r\r7r7r8�_addHandlerRefKsr�c@s�eZdZefdd�Zdd�Zdd�Zeee�Zdd�Z	d	d
�Z
dd�Zd
d�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�ZdS) rcCs4t�|�d|_t|�|_d|_t|�|��dSr9)r�r��_namerMr5�	formatterr�rY�r�r5r7r7r8r�^s

zHandler.__init__cCs|jSr9)r�r�r7r7r8�get_namekszHandler.get_namecCs<t�z(|jtkrt|j=||_|r,|t|<W5t�XdSr9�r:r;r��	_handlersr�r7r7r8�set_namens
zHandler.set_namecCst��|_t|�dSr9)ry�RLock�lockrTr�r7r7r8rY{s
zHandler.createLockcCs|jr|j��dSr9)rrOr�r7r7r8rO�szHandler.acquirecCs|jr|j��dSr9)rrPr�r7r7r8rP�szHandler.releasecCst|�|_dSr9)rMr5r�r7r7r8�setLevel�szHandler.setLevelcCs|jr|j}nt}|�|�Sr9)r�r�r�)r�r�r�r7r7r8r��szHandler.formatcCstd��dS)Nz.emit must be implemented by Handler subclasses)�NotImplementedErrorr�r7r7r8�emit�szHandler.emitcCs4|�|�}|r0|��z|�|�W5|��X|Sr9)r�rOrPr)r�r�rLr7r7r8�handle�s	

zHandler.handlecCs
||_dSr9)r�r�r7r7r8�setFormatter�szHandler.setFormattercCsdSr9r7r�r7r7r8�flush�sz
Handler.flushcCs0t�z|jr |jtkr t|j=W5t�XdSr9r�r�r7r7r8r��s

z
Handler.closecCs t�rtj�rt��\}}}z�z�tj�d�t�|||dtj�tj�d�|j}|rvtj	�
|jj�t
dkrv|j}qR|r�tj|tjd�ntj�d|j|jf�ztj�d|j|jf�Wn4tk
r��Yn tk
r�tj�d�YnXWntk
�rYnXW5~~~XdS)Nz--- Logging error ---
zCall stack:
rrWzLogged from file %s, line %s
zMessage: %r
Arguments: %s
zwUnable to print the message and arguments - possible formatting error.
Use the traceback above to help find the error.
)r,r>r[rC�writer�r�rDrkrl�dirname�f_code�co_filename�__path__rE�print_stackrnrtrcrh�RecursionErrorrB�OSError)r�r�r��vr��framer7r7r8�handleError�s<����

zHandler.handleErrorcCst|j�}d|jj|fS)Nz	<%s (%s)>)rr5�	__class__r�r�r7r7r8r�s
zHandler.__repr__N)r�r�r�rr�r�r��propertyrbrYrOrPrr�rrrrr�rr�r7r7r7r8rUs 	



	/c@s:eZdZdZd
dd�Zdd�Zdd�Zd	d
�Zdd�ZdS)rr�NcCs"t�|�|dkrtj}||_dSr9)rr�r>r[�stream�r�rr7r7r8r�s
zStreamHandler.__init__cCs8|��z |jr&t|jd�r&|j��W5|��XdS)Nr)rOrPrrrr�r7r7r8r&s
zStreamHandler.flushcCsdz,|�|�}|j}|�||j�|��Wn2tk
rB�Yntk
r^|�|�YnXdSr9)r�rr�
terminatorrrrBr)r�r�rcrr7r7r8r1s
zStreamHandler.emitcCs@||jkrd}n,|j}|��z|��||_W5|��X|Sr9)rrOrPr)r�rr6r7r7r8�	setStreamGs


zStreamHandler.setStreamcCs>t|j�}t|jdd�}t|�}|r,|d7}d|jj||fS)Nrbr�� z<%s %s(%s)>)rr5�getattrrrIrr�)r�r5rbr7r7r8r�[s
zStreamHandler.__repr__)N)	r�r�r�rr�rrrr�r7r7r7r8rs
c@s6eZdZddd�Zdd�Zdd	�Zd
d�Zdd
�ZdS)r
�aNFcCsTt�|�}tj�|�|_||_||_||_|r@t�	|�d|_
nt�	||���dSr9)
rk�fspathrl�abspath�baseFilename�mode�encoding�delayrr�rr�_open)r�rnrr r!r7r7r8r�is

zFileHandler.__init__c	Csb|��zJz8|jr@z|��W5|j}d|_t|d�r>|��XW5t�|�XW5|��XdS)Nr�)rOrPrr�rrrrr7r7r8r�}s
zFileHandler.closecCst|j|j|jd�S)N)r )�openrrr r�r7r7r8r"�szFileHandler._opencCs$|jdkr|��|_t�||�dSr9)rr"rrr�r7r7r8r�s

zFileHandler.emitcCst|j�}d|jj|j|fS�Nz<%s %s (%s)>)rr5rr�rr�r7r7r8r��s
zFileHandler.__repr__)rNF)r�r�r�r�r�r"rr�r7r7r7r8r
es

c@s$eZdZefdd�Zedd��ZdS)�_StderrHandlercCst�||�dSr9)rr�r�r7r7r8r��sz_StderrHandler.__init__cCstjSr9)r>r[r�r7r7r8r�sz_StderrHandler.streamN)r�r�r�rr�rrr7r7r7r8r%�sr%c@seZdZdd�Zdd�ZdS)�PlaceHoldercCs|di|_dSr9��	loggerMap�r��aloggerr7r7r8r��szPlaceHolder.__init__cCs||jkrd|j|<dSr9r'r)r7r7r8r��s
zPlaceHolder.appendN)r�r�r�r�r�r7r7r7r8r&�sr&cCs(|tkr t|t�s td|j��|adS�Nz(logger not derived from logging.Logger: )r�
issubclassrKr��_loggerClass)�klassr7r7r8r%�s
�cCstSr9)r-r7r7r7r8r!�sc@s^eZdZdd�Zedd��Zejdd��Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�ZdS)�ManagercCs(||_d|_d|_i|_d|_d|_dS)NrF)�rootr�emittedNoHandlerWarning�
loggerDict�loggerClass�logRecordFactory)r�Zrootnoder7r7r8r��szManager.__init__cCs|jSr9)�_disabler�r7r7r8r�szManager.disablecCst|�|_dSr9)rMr5�r��valuer7r7r8rscCs�d}t|t�std��t�z�||jkrv|j|}t|t�r�|}|jpHt|�}||_	||j|<|�
||�|�|�n(|jp~t|�}||_	||j|<|�|�W5t�X|S)NzA logger name must be a string)rGrIrKr:r;r2r&r3r-�manager�_fixupChildren�
_fixupParents)r�rbrL�phr7r7r8r s(





zManager.getLoggercCs*|tkr t|t�s td|j��||_dSr+)rr,rKr�r3)r�r.r7r7r8r%&s
�zManager.setLoggerClasscCs
||_dSr9)r4)r�r�r7r7r8r*0szManager.setLogRecordFactorycCs�|j}|�d�}d}|dkr~|s~|d|�}||jkrFt|�|j|<n$|j|}t|t�r`|}n
|�|�|�dd|d�}q|s�|j}||_dS)Nr�rr_)	rb�rfindr2r&rGrr�r0�parent)r�r*rb�irLZsubstr�objr7r7r8r:7s




zManager._fixupParentscCsD|j}t|�}|j��D]&}|jjd|�|kr|j|_||_qdSr9)rbrdr(r�r=)r�r;r*rbZnamelen�cr7r7r8r9OszManager._fixupChildrencCs@t�|j��D]}t|t�r|j��q|jj��t�dSr9)	r:r2�valuesrGr�_cache�clearr0r;�r��loggerr7r7r8�_clear_cache\s
zManager._clear_cacheN)
r�r�r�r�rr�setterr r%r*r:r9rFr7r7r7r8r/�s

"

r/c@s�eZdZefdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�dd�Zdd�ZeZ
dd�Zd4dd�Zd5dd�Zd6dd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�ZdS)7rcCs<t�|�||_t|�|_d|_d|_g|_d|_i|_	dS)NTF)
r�r�rbrMr5r=�	propagater��disabledrB)r�rbr5r7r7r8r�|s

zLogger.__init__cCst|�|_|j��dSr9)rMr5r8rFr�r7r7r8r�s
zLogger.setLevelcOs |�t�r|jt||f|�dSr9)�isEnabledForr�_log�r�rcrhr�r7r7r8r�s	
zLogger.debugcOs |�t�r|jt||f|�dSr9)rJr
rKrLr7r7r8r"�s	
zLogger.infocOs |�t�r|jt||f|�dSr9)rJrrKrLr7r7r8r(�s	
zLogger.warningcOs$t�dtd�|j|f|�|�dS�Nz6The 'warn' method is deprecated, use 'warning' insteadrA��warningsr'�DeprecationWarningr(rLr7r7r8r'�s
�zLogger.warncOs |�t�r|jt||f|�dSr9)rJrrKrLr7r7r8r�s	
zLogger.errorT�rCcOs|j|f|�d|i|��dS�NrC�r�r�rcrCrhr�r7r7r8r�szLogger.exceptioncOs |�t�r|jt||f|�dSr9)rJrrKrLr7r7r8r�s	
zLogger.criticalcOs<t|t�strtd��ndS|�|�r8|j|||f|�dS)Nzlevel must be an integer)rGrHr,rKrJrK�r�r5rcrhr�r7r7r8r#�s	


z
Logger.logFr_c
Cs�t�}|dk	r|j}|}|r4|dkr4|j}|d8}q|s<|}d}t|d�r�|j}tj�|j�}|tkrn|j}q@d}|r�t	�
�}	|	�d�tj
||	d�|	��}|ddkr�|dd�}|	��|j|j|j|f}q�q@|S)Nr_)�(unknown file)r�(unknown function)Nr
zStack (most recent call last):
rWr�r�)rFrErr
rkrl�normcaser�_srcfiler�r�rr�r
r�r��f_lineno�co_name)
r�rs�
stacklevelr�Zorig_frL�cornr�r�r7r7r8�
findCaller�s8


zLogger.findCallerNc

CsZt|||||||||
�	}|	dk	rV|	D]0}|dks:||jkrFtd|��|	||j|<q$|S)N)r�r�z$Attempt to overwrite %r in LogRecord)r�r�r�)
r�rbr5�fn�lnorcrhrCr��extrar�rL�keyr7r7r8�
makeRecords�zLogger.makeRecordc
Cs�d}trBz|�||�\}	}
}}WqLtk
r>d\}	}
}YqLXn
d\}	}
}|r~t|t�rlt|�||jf}nt|t�s~t�	�}|�
|j||	|
||||||�
}|�|�dS)N)rVrrW)
rYr^rJrG�
BaseException�type�
__traceback__�tupler>rCrcrbr)
r�r5rcrhrCrarsr\r�r_r`r�r�r7r7r8rKs&


�zLogger._logcCs|js|�|�r|�|�dSr9)rIr��callHandlersr�r7r7r8r7sz
Logger.handlecCs.t�z||jkr|j�|�W5t�XdSr9)r:r;r�r��r��hdlrr7r7r8�
addHandlerAs

zLogger.addHandlercCs.t�z||jkr|j�|�W5t�XdSr9)r:r;r�r�rir7r7r8�
removeHandlerLs

zLogger.removeHandlercCs.|}d}|r*|jrd}q*|js"q*q|j}q|S)NFT)r�rHr=)r�r@rLr7r7r8�hasHandlersWs
zLogger.hasHandlerscCs�|}d}|rJ|jD]"}|d}|j|jkr|�|�q|jsBd}q|j}q|dkr�trn|jtjkr�t�|�n&tr�|jj	s�t
j�d|j
�d|j_	dS)Nrr_z+No handlers could be found for logger "%s"
T)r�rir5rrHr=r+r,r8r1r>r[rrb)r�r�r@�foundrjr7r7r8rhms&

�zLogger.callHandlerscCs |}|r|jr|jS|j}qtSr9)r5r=rrDr7r7r8�getEffectiveLevel�szLogger.getEffectiveLevelc
Csz|jr
dSz|j|WStk
rtt�z6|jj|krJd}|j|<n||��k}|j|<W5t�X|YSXdS)NF)rIrBr�r:r;r8rro)r�r5Z
is_enabledr7r7r8rJ�s
�zLogger.isEnabledForcCs&|j|k	rd�|j|f�}|j�|�S)Nr�)r0r�rbr8r )r��suffixr7r7r8�getChild�s
zLogger.getChildcCs t|���}d|jj|j|fSr$)rrorr�rbr�r7r7r8r��szLogger.__repr__cCs,t|j�|k	r ddl}|�d��t|jffS)Nrzlogger cannot be pickled)r rb�pickleZ
PicklingError)r�rrr7r7r8�
__reduce__�s
zLogger.__reduce__)Fr_)NNN)NNFr_)r�r�r�rr�rrr"r(r'rrrrr#r^rcrKrrkrlrmrhrorJrqr�rsr7r7r7r8rms:

%�
�

c@seZdZdd�Zdd�ZdS)�
RootLoggercCst�|d|�dS)Nr0)rr�r�r7r7r8r��szRootLogger.__init__cCstdfS)Nr7)r r�r7r7r8rs�szRootLogger.__reduce__N)r�r�r�r�rsr7r7r7r8rt�srtc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd*d!d"�Zed#d$��Zejd%d$��Zed&d'��Zd(d)�ZdS)+rcCs||_||_dSr9)rEra)r�rErar7r7r8r��szLoggerAdapter.__init__cCs|j|d<||fS)Nra)ra)r�rcr�r7r7r8r��s

zLoggerAdapter.processcOs|jt|f|�|�dSr9)r#rrLr7r7r8rszLoggerAdapter.debugcOs|jt|f|�|�dSr9)r#r
rLr7r7r8r"
szLoggerAdapter.infocOs|jt|f|�|�dSr9)r#rrLr7r7r8r(szLoggerAdapter.warningcOs$t�dtd�|j|f|�|�dSrMrNrLr7r7r8r's
�zLoggerAdapter.warncOs|jt|f|�|�dSr9�r#rrLr7r7r8rszLoggerAdapter.errorTrQcOs |jt|f|�d|i|��dSrRrurTr7r7r8r!szLoggerAdapter.exceptioncOs|jt|f|�|�dSr9)r#rrLr7r7r8r'szLoggerAdapter.criticalcOs4|�|�r0|�||�\}}|jj||f|�|�dSr9)rJr�rEr#rUr7r7r8r#-s
zLoggerAdapter.logcCs|j�|�Sr9)rErJr�r7r7r8rJ6szLoggerAdapter.isEnabledForcCs|j�|�dSr9)rErr�r7r7r8r<szLoggerAdapter.setLevelcCs
|j��Sr9)rEror�r7r7r8roBszLoggerAdapter.getEffectiveLevelcCs
|j��Sr9)rErmr�r7r7r8rmHszLoggerAdapter.hasHandlersNFcCs|jj||||||d�S)N)rCrars)rErK)r�r5rcrhrCrarsr7r7r8rKNs�zLoggerAdapter._logcCs|jjSr9�rEr8r�r7r7r8r8[szLoggerAdapter.managercCs||j_dSr9rvr6r7r7r8r8_scCs|jjSr9)rErbr�r7r7r8rbcszLoggerAdapter.namecCs&|j}t|���}d|jj|j|fSr$)rErrorr�rb)r�rEr5r7r7r8r�gszLoggerAdapter.__repr__)NNF)r�r�r�r�r�rr"r(r'rrrr#rJrrormrKrr8rGrbr�r7r7r7r8r�s,	




c
Ks�t��z�|�dd�}|r@tjdd�D]}t�|�|��q(ttj�dk�r�|�dd�}|dkr~d|kr�d|kr�td��nd|ks�d|kr�td��|dkr�|�dd�}|�d	d
�}|r�t	||�}n|�dd�}t
|�}|g}|�dd�}|�dd
�}|tk�rtdd�t�
����|�dt|d�}	t|	||�}
|D]&}|jdk�rV|�|
�t�|��q<|�dd�}|dk	�r�t�|�|�r�d�|�
��}td|��W5t�XdS)N�forceFrr�rrnz8'stream' and 'filename' should not be specified togetherzG'stream' or 'filename' should not be specified together with 'handlers'�filemoderr�r�r�r�r�r�r_r5z, zUnrecognised argument(s): %s)r:r;�popr0r�rlr�rdrJr
rr�r�r�rr�rrkr)
r�rw�hr�rnrrZdfsr�Zfsr�r5r�r7r7r8rtsR;



�


cCs|rtj�|�StSdSr9)rr8r r0)rbr7r7r8r �scOs*ttj�dkrt�tj|f|�|�dSr�)rdr0r�rr�rcrhr�r7r7r8r�scOs*ttj�dkrt�tj|f|�|�dSr�)rdr0r�rrr{r7r7r8r�srQcOst|f|�d|i|��dSrRrS)rcrCrhr�r7r7r8rscOs*ttj�dkrt�tj|f|�|�dSr�)rdr0r�rr(r{r7r7r8r(scOs"t�dtd�t|f|�|�dS)Nz8The 'warn' function is deprecated, use 'warning' insteadrArNr{r7r7r8r's
�cOs*ttj�dkrt�tj|f|�|�dSr�)rdr0r�rr"r{r7r7r8r"scOs*ttj�dkrt�tj|f|�|�dSr�)rdr0r�rrr{r7r7r8r$scOs,ttj�dkrt�tj||f|�|�dSr�)rdr0r�rr#)r5rcrhr�r7r7r8r#.scCs|tj_tj��dSr9)r0r8rrF)r5r7r7r8r8sc
Cs�t|dd��D]l}zT|�}|rfz:z|��|��|��Wnttfk
rVYnXW5|��XWqtrv�YqXqdSr9)�reversedrPrOrr�rrJr,)ZhandlerListr�rzr7r7r8r&?s
c@s$eZdZdd�Zdd�Zdd�ZdS)rcCsdSr9r7r�r7r7r8rmszNullHandler.handlecCsdSr9r7r�r7r7r8rpszNullHandler.emitcCs
d|_dSr9)rr�r7r7r8rYsszNullHandler.createLockN)r�r�r�rrrYr7r7r7r8rcs
cCs`|dk	r$tdk	r\t||||||�n8t�|||||�}td�}|jsP|�t��|�d|�dS)Nzpy.warningsz%s)�_warnings_showwarningrO�
formatwarningr r�rkrr()r��categoryrnrtrX�liner�rEr7r7r8�_showwarningzsr�cCs0|rtdkr,tjatt_ntdk	r,tt_dadSr9)r}rO�showwarningr�)Zcapturer7r7r8r�s)N)NN)nr>rkrar�r�r�rOr�Zcollections.abcre�stringrrZStrFormatter�__all__ry�
__author__Z
__status__�__version__Z__date__rwr,rxr|r~rr	rrrr
rrr2r4rrrrFrlrX�__code__rrYrMrrNr:r;rTZWeakSetrUr^rQ�objectrr�r*r)r$r�r�r�r�rr�r�rrr�ZWeakValueDictionaryr�r�r�r�rrr
r%Z_defaultLastResortr+r&r%r!r/rrtr-rr0r8rr rrrrr(r'r"rr#rr&�atexit�registerrr}r�rr7r7r7r8�<module>sLH
�
	
�	�

	

�	g
�1*%4
>SE
d
n








logging/__pycache__/config.cpython-38.opt-1.pyc000064400000055214151153537460015257 0ustar00U

e5d��@sNdZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZmZdZ
ejZdad+dd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Ze�dej�Zdd�ZGdd�de�ZGdd�dee�Z Gdd�de!e�Z"Gdd �d e#e�Z$Gd!d"�d"e�Z%Gd#d$�d$e%�Z&e&Z'd%d&�Z(e
dfd'd(�Z)d)d*�Z*dS),a
Configuration functions for the logging package for Python. The core package
is based on PEP 282 and comments thereto in comp.lang.python, and influenced
by Apache's log4j system.

Copyright (C) 2001-2019 Vinay Sajip. All Rights Reserved.

To use, simply 'import logging' and log away!
�N)�ThreadingTCPServer�StreamRequestHandleriF#TcCs�ddl}t||j�r|}n*|�|�}t|d�r:|�|�n
|�|�t|�}t�	�z t�t||�}t
|||�W5t�
�XdS)aD
    Read the logging configuration from a ConfigParser-format file.

    This can be called several times from an application, allowing an end user
    the ability to select from various pre-canned configurations (if the
    developer provides a mechanism to present the choices and load the chosen
    configuration).
    rN�readline)�configparser�
isinstanceZRawConfigParserZConfigParser�hasattrZ	read_file�read�_create_formatters�logging�_acquireLock�_releaseLock�_clearExistingHandlers�_install_handlers�_install_loggers)Zfname�defaults�disable_existing_loggersr�cp�
formatters�handlers�r�&/usr/lib64/python3.8/logging/config.py�
fileConfig3s	



rc	Csl|�d�}|�d�}t|�}|D]F}|d|}zt||�}Wq tk
rdt|�t||�}Yq Xq |S)z)Resolve a dotted name to a global object.�.r)�split�pop�
__import__�getattr�AttributeError)�name�used�found�nrrr�_resolveUs

r"cCsttj|�S�N)�map�str�strip)Zalistrrr�
_strip_spacescsr'cCs�|dd}t|�siS|�d�}t|�}i}|D]v}d|}|j|dddd�}|j|d	ddd�}|j|d
ddd�}tj}||�d�}	|	r�t|	�}||||�}
|
||<q2|S)
zCreate and return formattersr�keys�,zformatter_%s�formatTN)�raw�fallback�datefmt�style�%�class)�lenrr'�getr
�	Formatterr")rZflistrZformZsectnameZfsZdfsZstl�c�
class_name�frrrr	fs$

r	c
Cs^|dd}t|�siS|�d�}t|�}i}g}|D�]}|d|}|d}|�dd�}zt|tt��}Wn ttfk
r�t	|�}YnX|�dd	�}	t|	tt��}	|�d
d�}
t|
tt��}
||	|
�}d|kr�|d}|�
|�t|�r�|�||�t|tj
j��r2|�d
d�}
t|
��r2|�||
f�|||<q6|D]\}}|�||��q@|S)zInstall and return handlersrr(r)z
handler_%sr0�	formatter��args�()�kwargsz{}�level�target)r1rr'r2�eval�varsr
r�	NameErrorr"�setLevel�setFormatter�
issubclassr�
MemoryHandler�appendZ	setTarget)rr�hlistrZfixups�hand�section�klass�fmtr9r;�hr<r=�trrrr|sB





rcCsTtj}|D]D}|jj|}||krHt|tj�sN|�tj�g|_d|_	q
||_
q
dS)a�
    When (re)configuring logging, handle loggers which were in the previous
    configuration but are not in the new configuration. There's no point
    deleting them as other threads may continue to hold references to them;
    and by disabling them, you stop them doing any logging.

    However, don't disable children of named loggers, as that's probably not
    what was intended by the user. Also, allow existing loggers to NOT be
    disabled if disable_existing is false.
    TN)r
�root�manager�
loggerDictrZPlaceHolderrAZNOTSETr�	propagate�disabled)�existing�
child_loggers�disable_existingrM�log�loggerrrr�_handle_existing_loggers�srWcCs|dd}|�d�}tt|��}|�d�|d}tj}|}d|krX|d}|�|�|jdd�D]}|�|�qf|d}	t	|	�r�|	�d�}	t|	�}	|	D]}
|�
||
�q�t|jj�
��}|��g}|D�](}|d	|}|d
}
|jddd
�}t�|
�}|
|k�rv|�|
�d}|
d}t	|�}t	|�}||k�rl||d|�|k�r`|�||�|d7}�q2|�|
�d|k�r�|d}|�|�|jdd�D]}|�|��q�||_d|_|d}	t	|	�r�|	�d�}	t|	�}	|	D]}
|�
||
��q�q�t|||�dS)zCreate and install loggers�loggersr(r)rMZlogger_rootr<Nrz	logger_%s�qualnamerP�)r,rr)r�listr'�remover
rMrAr�
removeHandlerr1�
addHandlerrNrOr(�sortZgetint�	getLogger�indexrErPrQrW)rrrTZllistrHrMrUr<rKrFrGrRrSZqnrPrV�i�prefixed�pflen�num_existingrrrr�sd











rcCs.tj��t�tjdd��tjdd�=dS)z!Clear and close existing handlersN)r
�	_handlers�clearZshutdownZ_handlerListrrrrr
s
r
z^[a-z_][a-z0-9_]*$cCst�|�}|std|��dS)Nz!Not a valid Python identifier: %rT)�
IDENTIFIER�match�
ValueError)�s�mrrr�valid_idents
rmc@s"eZdZdZddd�Zdd�ZdS)	�ConvertingMixinz?For ConvertingXXX's, this mixin class provides common functionsTcCsB|j�|�}||k	r>|r |||<t|�tttfkr>||_||_|Sr#)�configurator�convert�type�ConvertingDict�ConvertingList�ConvertingTuple�parent�key)�selfrv�value�replace�resultrrr�convert_with_key"s
�z ConvertingMixin.convert_with_keycCs0|j�|�}||k	r,t|�tttfkr,||_|Sr#)rorprqrrrsrtru)rwrxrzrrrrp.s
�zConvertingMixin.convertN)T)�__name__�
__module__�__qualname__�__doc__r{rprrrrrns
rnc@s,eZdZdZdd�Zd	dd�Zd
dd�ZdS)rrz A converting dictionary wrapper.cCst�||�}|�||�Sr#)�dict�__getitem__r{�rwrvrxrrrr�CszConvertingDict.__getitem__NcCst�|||�}|�||�Sr#)r�r2r{�rwrv�defaultrxrrrr2GszConvertingDict.getcCst�|||�}|j||dd�S�NF)ry)r�rr{r�rrrrKszConvertingDict.pop)N)N)r|r}r~rr�r2rrrrrrr@s
rrc@s"eZdZdZdd�Zddd�ZdS)	rszA converting list wrapper.cCst�||�}|�||�Sr#)r[r�r{r�rrrr�QszConvertingList.__getitem__���cCst�||�}|�|�Sr#)r[rrp)rw�idxrxrrrrUszConvertingList.popN)r�)r|r}r~rr�rrrrrrsOsrsc@seZdZdZdd�ZdS)rtzA converting tuple wrapper.cCst�||�}|j||dd�Sr�)�tupler�r{r�rrrr�[szConvertingTuple.__getitem__N)r|r}r~rr�rrrrrtYsrtc@s�eZdZdZe�d�Ze�d�Ze�d�Ze�d�Z	e�d�Z
ddd	�Zee
�Zd
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Zdd�ZdS)�BaseConfiguratorzI
    The configurator base class which defines some useful defaults.
    z%^(?P<prefix>[a-z]+)://(?P<suffix>.*)$z^\s*(\w+)\s*z^\.\s*(\w+)\s*z^\[\s*(\w+)\s*\]\s*z^\d+$�ext_convert�cfg_convert)ZextZcfgcCst|�|_||j_dSr#)rr�configro)rwr�rrr�__init__ts
zBaseConfigurator.__init__c		Cs�|�d�}|�d�}z^|�|�}|D]H}|d|7}zt||�}Wq$tk
rj|�|�t||�}Yq$Xq$|WStk
r�t��dd�\}}td||f�}|||_	|_
|�YnXdS)z`
        Resolve strings to objects using standard import and attribute
        syntax.
        rrrZNzCannot resolve %r: %s)rr�importerrr�ImportError�sys�exc_inforj�	__cause__�
__traceback__)	rwrkrrr Zfrag�e�tb�vrrr�resolvexs"



zBaseConfigurator.resolvecCs
|�|�S)z*Default converter for the ext:// protocol.)r��rwrxrrrr��szBaseConfigurator.ext_convertcCs�|}|j�|�}|dkr&td|��n�||��d�}|j|��d}|r�|j�|�}|rn||��d}nd|j�|�}|r�|��d}|j�|�s�||}n2zt	|�}||}Wnt
k
r�||}YnX|r�||��d�}qHtd||f��qH|S)z*Default converter for the cfg:// protocol.NzUnable to convert %rrzUnable to convert %r at %r)�WORD_PATTERNrirj�endr��groups�DOT_PATTERN�
INDEX_PATTERN�
DIGIT_PATTERN�int�	TypeError)rwrx�restrl�dr�r!rrrr��s4
�zBaseConfigurator.cfg_convertcCs�t|t�s$t|t�r$t|�}||_n�t|t�sHt|t�rHt|�}||_n�t|t�svt|t�rvt|d�svt|�}||_nVt|t	�r�|j
�|�}|r�|��}|d}|j
�|d�}|r�|d}t||�}||�}|S)z�
        Convert values to an appropriate type. dicts, lists and tuples are
        replaced by their converting alternatives. Strings are checked to
        see if they have a conversion format and are converted if they do.
        �_fields�prefixN�suffix)rrrr�rorsr[rtr�rr%�CONVERT_PATTERNri�	groupdict�value_convertersr2r)rwrxrlr�r�Z	converterr�rrrrp�s0
��

zBaseConfigurator.convertcsj��d�}t|�s|�|�}��dd�}�fdd��D�}|f|�}|rf|��D]\}}t|||�qP|S)z1Configure an object with a user-supplied factory.r:rNcsi|]}t|�r|�|�qSr�rm��.0�k�r�rr�
<dictcomp>�sz5BaseConfigurator.configure_custom.<locals>.<dictcomp>)r�callabler��items�setattr)rwr�r4�propsr;rzrrxrr�r�configure_custom�s


z!BaseConfigurator.configure_customcCst|t�rt|�}|S)z0Utility function which converts lists to tuples.)rr[r�r�rrr�as_tuple�s
zBaseConfigurator.as_tupleN)r|r}r~r�re�compiler�r�r�r�r�r��staticmethodrr�r�r�r�r�rpr�r�rrrrr�`s"




�"r�c@s^eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	ddd�Z
ddd�Zddd�ZdS)�DictConfiguratorz]
    Configure logging using a dictionary-like object to describe the
    configuration.
    cCs�|j}d|krtd��|ddkr2td|d��|�dd�}i}t���zn|�r�|�d|�}|D]�}|tjkr�td|��qdz6tj|}||}|�d	d
�}|r�|�t�	|��Wqdt
k
r�}	ztd|�|	�W5d
}	~	XYqdXqd|�d|�}
|
D]N}z|�||
|d
�Wq�t
k
�rF}	ztd|�|	�W5d
}	~	XYq�Xq�|�dd
�}|�r�z|�|d
�Wn.t
k
�r�}	ztd�|	�W5d
}	~	XYnX�n|�dd
�}t
�|�d|�}
|
D]P}z|�|
|�|
|<Wn2t
k
�r}	ztd|�|	�W5d
}	~	XYnX�q�|�d|�}|D]P}z|�||�||<Wn2t
k
�rp}	ztd|�|	�W5d
}	~	XYnX�q$|�d|�}g}t|�D]v}z |�||�}||_|||<WnNt
k
�r}	z.dt|	j�k�r�|�|�ntd|�|	�W5d
}	~	XYnX�q�|D]Z}z |�||�}||_|||<Wn2t
k
�r`}	ztd|�|	�W5d
}	~	XYnX�q
tj}t|jj���}|��g}|�d|�}
|
D]�}||k�r|�|�d}|d}t|�}t|�}||k�r||d
|�|k�r�|�||�|d7}�q�|�|�z|�||
|�Wn2t
k
�rV}	ztd|�|	�W5d
}	~	XYnX�q�t|||�|�dd
�}|�r�z|�|�Wn.t
k
�r�}	ztd�|	�W5d
}	~	XYnXW5t��Xd
S)zDo the configuration.�versionz$dictionary doesn't specify a versionrZzUnsupported version: %s�incrementalFrzNo handler found with name %rr<NzUnable to configure handler %rrXTzUnable to configure logger %rrMzUnable to configure root loggerrrz Unable to configure formatter %r�filterszUnable to configure filter %r�target not configured yetr) r�rjrr
rrr2rfrA�_checkLevel�	Exception�configure_logger�configure_rootr
�configure_formatter�configure_filter�sorted�configure_handlerrr%r�rErMr[rNrOr(r_rar1r\rW)rwr�r�Z
EMPTY_DICTrr�handlerZhandler_configr<r�rXrMrTrr�ZdeferredrRrSrbrcrdrerrr�	configure�s
�
��������������



����zDictConfigurator.configurec

Cs�d|krr|d}z|�|�}Wq�tk
rn}z2dt|�kr>�|�d�|d<||d<|�|�}W5d}~XYq�Xnl|�dd�}|�dd�}|�dd�}|�d	d�}|s�tj}	nt|�}	d
|kr�|	||||d
�}n|	|||�}|S)z(Configure a formatter from a dictionary.r:z'format'r*rJNr-r.r/r0Zvalidate)r�r�r%rr2r
r3r")
rwr��factoryrz�terJZdfmtr.�cnamer4rrrr��s*z$DictConfigurator.configure_formattercCs.d|kr|�|�}n|�dd�}t�|�}|S)z%Configure a filter from a dictionary.r:rr8)r�r2r
ZFilter)rwr�rzrrrrr��s

z!DictConfigurator.configure_filtercCsX|D]N}z|�|jd|�Wqtk
rP}ztd|�|�W5d}~XYqXqdS)z/Add filters to a filterer from a list of names.r�zUnable to add filter %rN)Z	addFilterr�r�rj)rwZfiltererr�r6r�rrr�add_filters�s
zDictConfigurator.add_filtersc
s�t��}��dd�}|r\z|jd|}Wn0tk
rZ}ztd|�|�W5d}~XYnX��dd�}��dd�}d�kr���d�}t|�s�|�|�}|}�n��d�}	|�|	�}
t|
tj	j
��rFd	�k�rFz>|jd
�d	}t|tj��s��
|�td��|�d	<Wn6tk
�rB}ztd�d	�|�W5d}~XYnXnZt|
tj	j��rtd
�k�rt|��d
��d
<n,t|
tj	j��r�d�k�r�|��d��d<|
}��dd�}�fdd��D�}
z|f|
�}WnLtk
�r}z,dt|�k�r�|
�d�|
d<|f|
�}W5d}~XYnX|�r.|�|�|dk	�rH|�t�|��|�rZ|�||�|�r�|��D]\}}t|||��qh|S)z&Configure a handler from a dictionary.r7NrzUnable to set formatter %rr<r�r:r0r=rr�zUnable to set target handler %rZmailhostZaddressrcsi|]}t|�r|�|�qSrr�r�r�rrr��sz6DictConfigurator.configure_handler.<locals>.<dictcomp>z'stream'�streamZstrm)r�rr�r�rjr�r�rCr
rrDrZHandler�updater�ZSMTPHandlerr�Z
SysLogHandlerr%rBrAr�r�r�r�)rwr�Zconfig_copyr7r�r<r�r4r�r�rIZthr�r;rzr�rrxrr�rr��s~��



�
����

z"DictConfigurator.configure_handlercCsX|D]N}z|�|jd|�Wqtk
rP}ztd|�|�W5d}~XYqXqdS)z.Add handlers to a logger from a list of names.rzUnable to add handler %rN)r^r�r�rj)rwrVrrKr�rrr�add_handlers�s
zDictConfigurator.add_handlersFcCs�|�dd�}|dk	r$|�t�|��|s~|jdd�D]}|�|�q6|�dd�}|rb|�||�|�dd�}|r~|�||�dS)zU
        Perform configuration which is common to root and non-root loggers.
        r<Nrr�)r2rAr
r�rr]r�r�)rwrVr�r�r<rKrr�rrr�common_logger_configsz%DictConfigurator.common_logger_configcCs6t�|�}|�|||�|�dd�}|dk	r2||_dS)z.Configure a non-root logger from a dictionary.rPN)r
r`r�r2rP)rwrr�r�rVrPrrrr�s

z!DictConfigurator.configure_loggercCst��}|�|||�dS)z*Configure a root logger from a dictionary.N)r
r`r�)rwr�r�rMrrrr�szDictConfigurator.configure_rootN)F)F)F)
r|r}r~rr�r�r�r�r�r�r�r�r�rrrrr��s$	?

r�cCst|���dS)z%Configure logging using a dictionary.N)�dictConfigClassr�r�rrr�
dictConfig&sr�csDGdd�dt�}Gdd�dt�}G�fdd�dtj���||||�S)au
    Start up a socket server on the specified port, and listen for new
    configurations.

    These will be sent as a file suitable for processing by fileConfig().
    Returns a Thread object on which you can call start() to start the server,
    and which you can join() when appropriate. To stop the server, call
    stopListening().

    Use the ``verify`` argument to verify any bytes received across the wire
    from a client. If specified, it should be a callable which receives a
    single argument - the bytes of configuration data received across the
    network - and it should return either ``None``, to indicate that the
    passed in bytes could not be verified and should be discarded, or a
    byte string which is then passed to the configuration machinery as
    normal. Note that you can return transformed bytes, e.g. by decrypting
    the bytes passed in.
    c@seZdZdZdd�ZdS)z#listen.<locals>.ConfigStreamHandlerz�
        Handler for a logging configuration request.

        It expects a completely new logging configuration and uses fileConfig
        to install it.
        cSsD�z
|j}|�d�}t|�dk�r
t�d|�d}|j�|�}t|�|krb||�|t|��}q>|jjdk	rz|j�|�}|dk	r�|�d�}zddl}|�	|�}t
|�WnHtk
r�t�
|�}zt|�Wntk
r�t��YnXYnX|jj�r
|jj��Wn2tk
�r>}z|jtk�r.�W5d}~XYnXdS)z�
            Handle a request.

            Each request is expected to be a 4-byte length, packed using
            struct.pack(">L", n), followed by the config file.
            Uses fileConfig() to do the grunt work.
            �z>LrNzutf-8)Z
connectionZrecvr1�structZunpack�server�verify�decode�json�loadsr�r��io�StringIOr�	traceback�	print_exc�ready�set�OSError�errno�RESET_ERROR)rwZconn�chunkZslenr�r��filer�rrr�handleFs6




z*listen.<locals>.ConfigStreamHandler.handleN)r|r}r~rr�rrrr�ConfigStreamHandler?sr�c@s0eZdZdZdZdedddfdd�Zdd�ZdS)	z$listen.<locals>.ConfigSocketReceiverzD
        A simple TCP socket-based logging config receiver.
        rZZ	localhostNcSs>t�|||f|�t��d|_t��d|_||_||_dS)NrrZ)	rr�r
r�abortr�timeoutr�r�)rwZhost�portr�r�r�rrrr�tsz-listen.<locals>.ConfigSocketReceiver.__init__cSs`ddl}d}|sT|�|j��ggg|j�\}}}|r<|��t��|j}t��q|�	�dS)Nr)
�selectZsocket�filenor�Zhandle_requestr
rr�rZserver_close)rwr�r�ZrdZwrZexrrr�serve_until_stopped~s�

z8listen.<locals>.ConfigSocketReceiver.serve_until_stopped)r|r}r~rZallow_reuse_address�DEFAULT_LOGGING_CONFIG_PORTr�r�rrrr�ConfigSocketReceiverms�

r�cs&eZdZ��fdd�Zdd�Z�ZS)zlisten.<locals>.Servercs4t�|���||_||_||_||_t��|_dSr#)	�superr��rcvr�hdlrr�r��	threadingZEventr�)rwr�r�r�r�)�Server�	__class__rrr��szlisten.<locals>.Server.__init__cSsZ|j|j|j|j|jd�}|jdkr0|jd|_|j��t��|a	t�
�|��dS)N)r�r�r�r�rrZ)r�r�r�r�r�Zserver_addressr�r
r�	_listenerrr�)rwr�rrr�run�s�

zlisten.<locals>.Server.run)r|r}r~r�r��
__classcell__r�r�)r�rr��sr�)rrr�ZThread)r�r�r�r�rr�r�listen+s.r�cCs*t��ztrdt_daW5t��XdS)zN
    Stop the listening server which was created with a call to listen().
    rZN)r
rrr�r�rrrr�
stopListening�sr�)NT)+rr�r�r
Zlogging.handlersr�r�r�r�r�Zsocketserverrrr�Z
ECONNRESETr�r�rr"r'r	rrWrr
r��Irhrm�objectrnr�rrr[rsr�rtr�r�r�r�r�r�rrrr�<module>sH

"%W!
Azlogging/__pycache__/handlers.cpython-38.opt-1.pyc000064400000124300151153537460015603 0ustar00U

e5dq��@szdZddlZddlZddlZddlZddlZddlZddlZddlm	Z	m
Z
mZddlZddl
Z
ddlZdZdZdZdZdZdZd	ZGd
d�dej�ZGdd
�d
e�ZGdd�de�ZGdd�dej�ZGdd�dej�ZGdd�de�ZGdd�dej�ZGdd�dej�ZGdd�dej�Z Gdd�dej�Z!Gdd�dej�Z"Gd d!�d!e"�Z#Gd"d#�d#ej�Z$Gd$d%�d%e%�Z&dS)&z�
Additional handlers for the logging package for Python. The core package is
based on PEP 282 and comments thereto in comp.lang.python.

Copyright (C) 2001-2016 Vinay Sajip. All Rights Reserved.

To use, simply 'import logging.handlers' and log away!
�N)�ST_DEV�ST_INO�ST_MTIMEi<#i=#i>#i?#i�Qc@s2eZdZdZddd�Zdd�Zdd	�Zd
d�ZdS)
�BaseRotatingHandlerz�
    Base class for handlers that rotate log files at a certain point.
    Not meant to be instantiated directly.  Instead, use RotatingFileHandler
    or TimedRotatingFileHandler.
    NFcCs0tj�|||||�||_||_d|_d|_dS)zA
        Use the specified filename for streamed logging
        N)�logging�FileHandler�__init__�mode�encoding�namer�rotator��self�filenamer
r�delay�r�(/usr/lib64/python3.8/logging/handlers.pyr	3s
zBaseRotatingHandler.__init__cCsHz$|�|�r|��tj�||�Wntk
rB|�|�YnXdS)z�
        Emit a record.

        Output the record to the file, catering for rollover as described
        in doRollover().
        N)�shouldRollover�
doRolloverrr�emit�	Exception�handleError�r�recordrrrr=s
zBaseRotatingHandler.emitcCst|j�s|}n
|�|�}|S)a�
        Modify the filename of a log file when rotating.

        This is provided so that a custom filename can be provided.

        The default implementation calls the 'namer' attribute of the
        handler, if it's callable, passing the default name to
        it. If the attribute isn't callable (the default is None), the name
        is returned unchanged.

        :param default_name: The default name for the log file.
        )�callabler)rZdefault_name�resultrrr�rotation_filenameKs

z%BaseRotatingHandler.rotation_filenamecCs4t|j�s$tj�|�r0t�||�n|�||�dS)aL
        When rotating, rotate the current log.

        The default implementation calls the 'rotator' attribute of the
        handler, if it's callable, passing the source and dest arguments to
        it. If the attribute isn't callable (the default is None), the source
        is simply renamed to the destination.

        :param source: The source filename. This is normally the base
                       filename, e.g. 'test.log'
        :param dest:   The destination filename. This is normally
                       what the source is rotated to, e.g. 'test.log.1'.
        N)rr
�os�path�exists�rename)r�source�destrrr�rotate^s
zBaseRotatingHandler.rotate)NF)�__name__�
__module__�__qualname__�__doc__r	rrr$rrrrr-s


rc@s*eZdZdZddd�Zdd	�Zd
d�ZdS)
�RotatingFileHandlerz�
    Handler for logging to a set of files, which switches from one file
    to the next when the current file reaches a certain size.
    �arNFcCs.|dkrd}t�|||||�||_||_dS)a�
        Open the specified file and use it as the stream for logging.

        By default, the file grows indefinitely. You can specify particular
        values of maxBytes and backupCount to allow the file to rollover at
        a predetermined size.

        Rollover occurs whenever the current log file is nearly maxBytes in
        length. If backupCount is >= 1, the system will successively create
        new files with the same pathname as the base file, but with extensions
        ".1", ".2" etc. appended to it. For example, with a backupCount of 5
        and a base file name of "app.log", you would get "app.log",
        "app.log.1", "app.log.2", ... through to "app.log.5". The file being
        written to is always "app.log" - when it gets filled up, it is closed
        and renamed to "app.log.1", and if files "app.log.1", "app.log.2" etc.
        exist, then they are renamed to "app.log.2", "app.log.3" etc.
        respectively.

        If maxBytes is zero, rollover never occurs.
        rr*N)rr	�maxBytes�backupCount)rrr
r+r,rrrrrr	xs
zRotatingFileHandler.__init__cCs�|jr|j��d|_|jdkr�t|jddd�D]^}|�d|j|f�}|�d|j|df�}tj�|�r2tj�|�r�t�	|�t�
||�q2|�|jd�}tj�|�r�t�	|�|�|j|�|js�|�
�|_dS)z<
        Do a rollover, as described in __init__().
        Nr����z%s.%dz.1)�stream�closer,�ranger�baseFilenamerrr �remover!r$r�_open)r�iZsfn�dfnrrrr�s&


�

zRotatingFileHandler.doRollovercCsZ|jdkr|��|_|jdkrVd|�|�}|j�dd�|j��t|�|jkrVdSdS)z�
        Determine if rollover should occur.

        Basically, see if the supplied record would cause the file to exceed
        the size limit we have.
        Nrz%s
�r-)r/r4r+�format�seek�tell�len�rr�msgrrrr�s


z"RotatingFileHandler.shouldRollover)r*rrNF)r%r&r'r(r	rrrrrrr)ss
 r)c@s:eZdZdZddd�Zd	d
�Zdd�Zd
d�Zdd�ZdS)�TimedRotatingFileHandlerz�
    Handler for logging to a file, rotating the log file at certain timed
    intervals.

    If backupCount is > 0, when rollover is done, no more than backupCount
    files are kept - the oldest ones are deleted.
    �hr-rNFc	
Cs�t�||d||�|��|_||_||_||_|jdkrLd|_d|_d|_	n�|jdkrjd|_d|_d	|_	n�|jd
kr�d|_d|_d
|_	n�|jdks�|jdkr�d|_d|_d|_	n�|j�
d��r*d|_t|j�dkr�td|j��|jddks�|jddk�rtd|j��t
|jd�|_d|_d|_	ntd|j��t�|j	tj�|_	|j||_|j}tj�|��rzt�|�t}	nt
t���}	|�|	�|_dS)Nr*�Sr-z%Y-%m-%d_%H-%M-%Sz-^\d{4}-\d{2}-\d{2}_\d{2}-\d{2}-\d{2}(\.\w+)?$�M�<z%Y-%m-%d_%H-%Mz'^\d{4}-\d{2}-\d{2}_\d{2}-\d{2}(\.\w+)?$�H�z%Y-%m-%d_%Hz!^\d{4}-\d{2}-\d{2}_\d{2}(\.\w+)?$�D�MIDNIGHTrz%Y-%m-%dz^\d{4}-\d{2}-\d{2}(\.\w+)?$�Wi�:	r7zHYou must specify a day for weekly rollover from 0 to 6 (0 is Monday): %s�0�6z-Invalid day specified for weekly rollover: %sz'Invalid rollover interval specified: %s)rr	�upper�whenr,�utc�atTime�interval�suffix�extMatch�
startswithr;�
ValueError�int�	dayOfWeek�re�compile�ASCIIr2rrr �statr�time�computeRollover�
rolloverAt)
rrrKrNr,rrrLrM�trrrr	�sL



z!TimedRotatingFileHandler.__init__cCsd||j}|jdks"|j�d��r`|jr4t�|�}n
t�|�}|d}|d}|d}|d}|jdkrnt}n |jj	d|jj
d|jj}||d|d|}	|	d	kr�|	t7}	|d
d}||	}|j�d��r`|}
|
|jk�r`|
|jkr�|j|
}nd|
|jd
}||d}|j�s\|d
}
t�|�d
}|
|k�r\|
�sPd}nd}||7}|}|S)zI
        Work out the rollover time based on the specified time.
        rFrG����NrBrr-�rr.���rD)
rNrKrQrLrY�gmtime�	localtimerM�	_MIDNIGHTZhourZminute�secondrT)r�currentTimerr\ZcurrentHourZ
currentMinuteZ
currentSecondZ
currentDayZ	rotate_ts�rZdayZ
daysToWait�
newRolloverAt�dstNow�
dstAtRollover�addendrrrrZsL


��

z(TimedRotatingFileHandler.computeRollovercCstt���}||jkrdSdS)z�
        Determine if rollover should occur.

        record is not used, as we are just comparing times, but it is needed so
        the method signatures are the same
        r-r)rSrYr[)rrr\rrrrIs
z'TimedRotatingFileHandler.shouldRolloverc	Cs�tj�|j�\}}t�|�}g}|d}t|�}|D]@}|d|�|kr4||d�}|j�|�r4|�tj�	||��q4t|�|j
kr�g}n|��|dt|�|j
�}|S)z�
        Determine the files to delete when rolling over.

        More specific than the earlier method, which just used glob.glob().
        �.N)rr�splitr2�listdirr;rP�match�append�joinr,�sort)	rZdirNameZbaseNameZ	fileNamesr�prefixZplenZfileNamerOrrr�getFilesToDeleteUs
z)TimedRotatingFileHandler.getFilesToDeletecCsv|jr|j��d|_tt���}t�|�d}|j|j}|jrNt�|�}n6t�|�}|d}||kr�|rrd}nd}t�||�}|�	|j
dt�|j|��}t
j�|�r�t
�|�|�|j
|�|jdkr�|��D]}t
�|�q�|js�|��|_|�|�}	|	|k�r|	|j}	�q|jdk�s4|j�d��rl|j�slt�|	�d}
||
k�rl|�s`d}nd}|	|7}	|	|_dS)	ax
        do a rollover; in this case, a date/time stamp is appended to the filename
        when the rollover happens.  However, you want the file to be named for the
        start of the interval, not the current time.  If there is a backup count,
        then we have to get a list of matching filenames, sort them and remove
        the one with the oldest suffix.
        Nr.rDrbrmrrFrG)r/r0rSrYrdr[rNrLrcrr2�strftimerOrrr r3r$r,rurr4rZrKrQ)rrgrjr\Z	timeTupleZdstThenrlr6�srirkrrrrlsJ

�




"
z#TimedRotatingFileHandler.doRollover)r?r-rNFFN)	r%r&r'r(r	rZrrurrrrrr>�s
9Ir>c@s2eZdZdZd
dd�Zdd�Zd	d
�Zdd�ZdS)�WatchedFileHandlera�
    A handler for logging to a file, which watches the file
    to see if it has changed while in use. This can happen because of
    usage of programs such as newsyslog and logrotate which perform
    log file rotation. This handler, intended for use under Unix,
    watches the file to see if it has changed since the last emit.
    (A file has changed if its device or inode have changed.)
    If it has changed, the old file stream is closed, and the file
    opened to get a new stream.

    This handler is not appropriate for use under Windows, because
    under Windows open files cannot be moved or renamed - logging
    opens the files with exclusive locks - and so there is no need
    for such a handler. Furthermore, ST_INO is not supported under
    Windows; stat always returns zero for this value.

    This handler is based on a suggestion and patch by Chad J.
    Schroeder.
    r*NFcCs,tj�|||||�d\|_|_|��dS)N)r.r.)rrr	�dev�ino�_statstreamrrrrr	�szWatchedFileHandler.__init__cCs0|jr,t�|j���}|t|t|_|_dS�N)r/r�fstat�filenorrryrz�rZsresrrrr{�szWatchedFileHandler._statstreamcCs�zt�|j�}Wntk
r(d}YnX|rJ|t|jksJ|t|jkr�|jdk	r�|j�	�|j�
�d|_|��|_|��dS)z�
        Reopen log file if needed.

        Checks if the underlying file has changed, and if it
        has, close the old stream and reopen the file to get the
        current stream.
        N)
rrXr2�FileNotFoundErrorrryrrzr/�flushr0r4r{rrrr�reopenIfNeeded�s
 



z!WatchedFileHandler.reopenIfNeededcCs|��tj�||�dS)z�
        Emit a record.

        If underlying file has changed, reopen the file before emitting the
        record to it.
        N)r�rrrrrrrr�szWatchedFileHandler.emit)r*NF)r%r&r'r(r	r{r�rrrrrrx�s

rxc@sReZdZdZdd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�
SocketHandlera
    A handler class which writes logging records, in pickle format, to
    a streaming socket. The socket is kept open across logging calls.
    If the peer resets it, an attempt is made to reconnect on the next call.
    The pickle which is sent is that of the LogRecord's attribute dictionary
    (__dict__), so that the receiver does not need to have the logging module
    installed in order to process the logging event.

    To unpickle the record at the receiving end into a LogRecord, use the
    makeLogRecord function.
    cCsZtj�|�||_||_|dkr(||_n
||f|_d|_d|_d|_d|_	d|_
d|_dS)a
        Initializes the handler with a specific host address and port.

        When the attribute *closeOnError* is set to True - if a socket error
        occurs, the socket is silently closed and then reopened on the next
        logging call.
        NFg�?g>@g@)r�Handlerr	�host�port�address�sock�closeOnError�	retryTime�
retryStart�retryMax�retryFactor�rr�r�rrrr	�s
zSocketHandler.__init__r-cCsj|jdk	rtj|j|d�}nJt�tjtj�}|�|�z|�|j�Wntk
rd|�	��YnX|S)zr
        A factory method which allows subclasses to define the precise
        type of socket they want.
        N��timeout)
r��socketZcreate_connectionr��AF_UNIX�SOCK_STREAMZ
settimeout�connect�OSErrorr0)rr�rrrr�
makeSocket	s

zSocketHandler.makeSocketcCs�t��}|jdkrd}n
||jk}|r�z|��|_d|_WnVtk
r�|jdkr^|j|_n"|j|j|_|j|jkr�|j|_||j|_YnXdS)z�
        Try to create a socket, using an exponential backoff with
        a max retry time. Thanks to Robert Olson for the original patch
        (SF #815911) which has been slightly refactored.
        NT)	rYr�r�r�r�r�ZretryPeriodr�r�)rZnowZattemptrrr�createSockets





zSocketHandler.createSocketcCsR|jdkr|��|jrNz|j�|�Wn$tk
rL|j��d|_YnXdS)z�
        Send a pickled string to the socket.

        This function allows for partial sends which can happen when the
        network is busy.
        N)r�r��sendallr�r0�rrwrrr�send6s

zSocketHandler.sendcCsj|j}|r|�|�}t|j�}|��|d<d|d<d|d<|�dd�t�|d�}t�	dt
|��}||S)z�
        Pickles the record in binary format with a length prefix, and
        returns it ready for transmission across the socket.
        r=N�args�exc_info�messager-z>L)r�r8�dict�__dict__Z
getMessage�pop�pickle�dumps�structZpackr;)rrZeiZdummy�drwZslenrrr�
makePickleIs

zSocketHandler.makePicklecCs0|jr|jr|j��d|_ntj�||�dS)z�
        Handle an error during logging.

        An error has occurred during logging. Most likely cause -
        connection lost. Close the socket so that we can retry on the
        next event.
        N)r�r�r0rr�rrrrrr_s
zSocketHandler.handleErrorcCs<z|�|�}|�|�Wntk
r6|�|�YnXdS)a
        Emit a record.

        Pickles the record and writes it to the socket in binary format.
        If there is an error with the socket, silently drop the packet.
        If there was a problem with the socket, re-establishes the
        socket.
        N)r�r�rr)rrrwrrrrms
	
zSocketHandler.emitcCs@|��z(|j}|r"d|_|��tj�|�W5|��XdS�z$
        Closes the socket.
        N)�acquire�releaser�r0rr�)rr�rrrr0|szSocketHandler.closeN)r-)r%r&r'r(r	r�r�r�r�rrr0rrrrr��s
r�c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�DatagramHandlera�
    A handler class which writes logging records, in pickle format, to
    a datagram socket.  The pickle which is sent is that of the LogRecord's
    attribute dictionary (__dict__), so that the receiver does not need to
    have the logging module installed in order to process the logging event.

    To unpickle the record at the receiving end into a LogRecord, use the
    makeLogRecord function.

    cCst�|||�d|_dS)zP
        Initializes the handler with a specific host address and port.
        FN)r�r	r�r�rrrr	�szDatagramHandler.__init__cCs*|jdkrtj}ntj}t�|tj�}|S)zu
        The factory method of SocketHandler is here overridden to create
        a UDP socket (SOCK_DGRAM).
        N)r�r�r�ZAF_INET�
SOCK_DGRAM)rZfamilyrwrrrr��s

zDatagramHandler.makeSocketcCs&|jdkr|��|j�||j�dS)z�
        Send a pickled string to a socket.

        This function no longer allows for partial sends which can happen
        when the network is busy - UDP does not guarantee delivery and
        can deliver packets out of sequence.
        N)r�r��sendtor�r�rrrr��s
zDatagramHandler.sendN)r%r&r'r(r	r�r�rrrrr��s
r�c@s"eZdZdZdZdZdZdZdZdZ	dZ
d	ZdZdZ
dZdZdZdZdZd	Zd
ZdZdZd
ZdZdZdZdZdZdZdZdZeeeeeeee
e	eeed�Z eeeeeeeeeeee
eeeeeeeeed�Z!dddddd�Z"de#fe
dfd d!�Z$d"d#�Z%d$d%�Z&d&d'�Z'd(d)�Z(d*Z)d+Z*d,d-�Z+dS).�
SysLogHandlera
    A handler class which sends formatted logging records to a syslog
    server. Based on Sam Rushing's syslog module:
    http://www.nightmare.com/squirl/python-ext/misc/syslog.py
    Contributed by Nicolas Untz (after which minor refactoring changes
    have been made).
    rr-r7r]r^r_r`ra��	�
���������)ZalertZcrit�critical�debugZemerg�err�error�infoZnoticeZpanic�warn�warning)ZauthZauthprivZcron�daemonZftpZkernZlprZmailZnewsZsecurityZsyslog�userZuucpZlocal0Zlocal1Zlocal2Zlocal3Zlocal4Zlocal5Zlocal6Zlocal7r�r�r�r�r�)�DEBUG�INFO�WARNING�ERROR�CRITICALZ	localhostNcCs4tj�|�||_||_||_t|t�rTd|_z|�	|�Wnt
k
rPYnXn�d|_|dkrhtj}|\}}t�
||d|�}|s�t
d��|D]�}|\}}}	}
}d}}
z.t�|||	�}
|tjkr�|
�|�W�qWq�t
k
�r}z|}|
dk	�r|
��W5d}~XYq�Xq�|dk	�r$|�|
|_||_dS)a
        Initialize a handler.

        If address is specified as a string, a UNIX socket is used. To log to a
        local syslogd, "SysLogHandler(address="/dev/log")" can be used.
        If facility is not specified, LOG_USER is used. If socktype is
        specified as socket.SOCK_DGRAM or socket.SOCK_STREAM, that specific
        socket type will be used. For Unix sockets, you can also specify a
        socktype of None, in which case socket.SOCK_DGRAM will be used, falling
        back to socket.SOCK_STREAM.
        TFNrz!getaddrinfo returns an empty list)rr�r	r��facility�socktype�
isinstance�str�
unixsocket�_connect_unixsocketr�r�r�Zgetaddrinfor�r�r0)rr�r�r�r�r�Zress�resZaf�proto�_Zsar�r��excrrrr	sB





zSysLogHandler.__init__cCs�|j}|dkrtj}t�tj|�|_z|j�|�||_Wnxtk
r�|j��|jdk	r`�tj}t�tj|�|_z|j�|�||_Wn tk
r�|j���YnXYnXdSr|)r�r�r�r�r�r�r0r�)rr�Zuse_socktyperrrr�Qs&




z!SysLogHandler._connect_unixsocketcCs4t|t�r|j|}t|t�r(|j|}|d>|BS)z�
        Encode the facility and priority. You can pass in strings or
        integers - if strings are passed, the facility_names and
        priority_names mapping dictionaries are used to convert them to
        integers.
        r])r�r��facility_names�priority_names)rr�Zpriorityrrr�encodePriorityis




zSysLogHandler.encodePrioritycCs2|��z|j��tj�|�W5|��XdSr�)r�r�r�r0rr��rrrrr0vs

zSysLogHandler.closecCs|j�|d�S)aK
        Map a logging level name to a key in the priority_names map.
        This is useful in two scenarios: when custom levels are being
        used, and in the case where you can't do a straightforward
        mapping by lowercasing the logging level name because of locale-
        specific issues (see SF #1524081).
        r�)�priority_map�get)rZ	levelNamerrr�mapPriority�szSysLogHandler.mapPriority�TcCsz�|�|�}|jr|j|}|jr*|d7}d|�|j|�|j��}|�d�}|�d�}||}|jr�z|j	�
|�Wq�tk
r�|j	��|�
|j�|j	�
|�Yq�Xn*|jt	jkr�|j	�||j�n|j	�|�Wntk
r�|�|�YnXdS)z�
        Emit a record.

        The record is formatted, and then sent to the syslog server. If
        exception information is present, it is NOT sent to the server.
        �z<%d>�utf-8N)r8�ident�
append_nulr�r�r�Z	levelname�encoder�r�r�r�r0r�r�r�r�r�r�rr)rrr=Zpriorrrr�s0



�


zSysLogHandler.emit),r%r&r'r(Z	LOG_EMERGZ	LOG_ALERTZLOG_CRITZLOG_ERRZLOG_WARNINGZ
LOG_NOTICEZLOG_INFOZ	LOG_DEBUGZLOG_KERNZLOG_USERZLOG_MAILZ
LOG_DAEMONZLOG_AUTHZ
LOG_SYSLOGZLOG_LPRZLOG_NEWSZLOG_UUCPZLOG_CRONZLOG_AUTHPRIVZLOG_FTPZ
LOG_LOCAL0Z
LOG_LOCAL1Z
LOG_LOCAL2Z
LOG_LOCAL3Z
LOG_LOCAL4Z
LOG_LOCAL5Z
LOG_LOCAL6Z
LOG_LOCAL7r�r�r��SYSLOG_UDP_PORTr	r�r�r0r�r�r�rrrrrr��s�����
6

r�c@s*eZdZdZd
dd�Zdd�Zdd	�ZdS)�SMTPHandlerzK
    A handler class which sends an SMTP email for each logging event.
    N�@cCs�tj�|�t|ttf�r(|\|_|_n|d|_|_t|ttf�rR|\|_|_	nd|_||_
t|t�rn|g}||_||_
||_||_dS)ax
        Initialize the handler.

        Initialize the instance with the from and to addresses and subject
        line of the email. To specify a non-standard SMTP port, use the
        (host, port) tuple format for the mailhost argument. To specify
        authentication credentials, supply a (username, password) tuple
        for the credentials argument. To specify the use of a secure
        protocol (TLS), pass in a tuple for the secure argument. This will
        only be used when authentication credentials are supplied. The tuple
        will be either an empty tuple, or a single-value tuple with the name
        of a keyfile, or a 2-value tuple with the names of the keyfile and
        certificate file. (This tuple is passed to the `starttls` method).
        A timeout in seconds can be specified for the SMTP connection (the
        default is one second).
        N)rr�r	r��list�tuple�mailhost�mailport�username�password�fromaddrr��toaddrs�subject�securer�)rr�r�r�r��credentialsr�r�rrrr	�s
zSMTPHandler.__init__cCs|jS)z�
        Determine the subject for the email.

        If you want to specify a subject line which is record-dependent,
        override this method.
        )r�rrrr�
getSubject�szSMTPHandler.getSubjectcCsz�ddl}ddlm}ddl}|j}|s.|j}|j|j||jd�}|�}|j	|d<d�
|j�|d<|�|�|d<|j
��|d	<|�|�|��|jr�|jdk	r�|��|j|j�|��|�|j|j�|�|�|��Wntk
r�|�|�YnXdS)
zd
        Emit a record.

        Format the record and send it to the specified addressees.
        rN)�EmailMessager�ZFrom�,ZToZSubjectZDate)�smtplibZ
email.messager�Zemail.utilsr�Z	SMTP_PORTZSMTPr�r�r�rrr�r�ZutilsrdZset_contentr8r�r�ZehloZstarttlsZloginr�Zsend_message�quitrr)rrr�r�Zemailr�Zsmtpr=rrrr�s0


zSMTPHandler.emit)NNr�)r%r&r'r(r	r�rrrrrr��s�
#	r�c@sBeZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dS)�NTEventLogHandlera�
    A handler class which sends events to the NT Event Log. Adds a
    registry entry for the specified application name. If no dllname is
    provided, win32service.pyd (which contains some basic message
    placeholders) is used. Note that use of these placeholders will make
    your event logs big, as the entire message source is held in the log.
    If you want slimmer logs, you have to pass in the name of your own DLL
    which contains the message definitions you want to use in the event log.
    N�Applicationc
Cs�tj�|�z�ddl}ddl}||_||_|s`tj�	|jj
�}tj�	|d�}tj�|dd�}||_||_
|j�|||�|j|_tj|jtj|jtj|jtj|jtj|ji|_Wn"tk
r�td�d|_YnXdS)Nrzwin32service.pydzWThe Python Win32 extensions for NT (service, event logging) appear not to be available.)rr�r	�win32evtlogutil�win32evtlog�appname�_welurrrn�__file__rr�dllname�logtypeZAddSourceToRegistryZEVENTLOG_ERROR_TYPE�deftyper�ZEVENTLOG_INFORMATION_TYPEr�r�ZEVENTLOG_WARNING_TYPEr�r��typemap�ImportError�print)rr�r�r�r�r�rrrr	s6�
zNTEventLogHandler.__init__cCsdS)ay
        Return the message ID for the event record. If you are using your
        own messages, you could do this by having the msg passed to the
        logger being an ID rather than a formatting string. Then, in here,
        you could use a dictionary lookup to get the message ID. This
        version returns 1, which is the base message ID in win32service.pyd.
        r-rrrrr�getMessageID&szNTEventLogHandler.getMessageIDcCsdS)z�
        Return the event category for the record.

        Override this if you want to specify your own categories. This version
        returns 0.
        rrrrrr�getEventCategory0sz"NTEventLogHandler.getEventCategorycCs|j�|j|j�S)a�
        Return the event type for the record.

        Override this if you want to specify your own types. This version does
        a mapping using the handler's typemap attribute, which is set up in
        __init__() to a dictionary which contains mappings for DEBUG, INFO,
        WARNING, ERROR and CRITICAL. If you are using your own levels you will
        either need to override this method or place a suitable dictionary in
        the handler's typemap attribute.
        )r�r��levelnor�rrrr�getEventType9szNTEventLogHandler.getEventTypecCsn|jrjzD|�|�}|�|�}|�|�}|�|�}|j�|j||||g�Wntk
rh|�|�YnXdS)z�
        Emit a record.

        Determine the message ID, event category and event type. Then
        log the message in the NT event log.
        N)	r�r�r�rr8ZReportEventr�rr)rr�id�cat�typer=rrrrFs



zNTEventLogHandler.emitcCstj�|�dS)aS
        Clean up this handler.

        You can remove the application name from the registry as a
        source of event log entries. However, if you do this, you will
        not be able to see the events as you intended in the Event Log
        Viewer - it needs to be able to access the registry to get the
        DLL name.
        N)rr�r0r�rrrr0WszNTEventLogHandler.close)Nr�)
r%r&r'r(r	r�r�rrr0rrrrr�s	

	
r�c@s*eZdZdZddd�Zdd�Zd	d
�ZdS)�HTTPHandlerz^
    A class which sends records to a Web server, using either GET or
    POST semantics.
    �GETFNcCs`tj�|�|��}|dkr$td��|s8|dk	r8td��||_||_||_||_||_	||_
dS)zr
        Initialize the instance with the host, the request URL, and the method
        ("GET" or "POST")
        )r�POSTzmethod must be GET or POSTNz3context parameter only makes sense with secure=True)rr�r	rJrRr��url�methodr�r��context)rr�rr	r�r�r
rrrr	iszHTTPHandler.__init__cCs|jS)z�
        Default implementation of mapping the log record into a dict
        that is sent as the CGI data. Overwrite in your class.
        Contributed by Franz Glasner.
        )r�rrrr�mapLogRecord}szHTTPHandler.mapLogRecordcCsx�zPddl}ddl}|j}|jr4|jj||jd�}n|j�|�}|j}|j	�
|�|��}|jdkr�|�
d�dkrvd}nd}|d||f}|�|j|�|�
d�}	|	dkr�|d|	�}|jd	kr�|�d
d�|�dtt|���|j�r$ddl}
d
|j�d�}d|
�|����d�}|�d|�|��|jd	k�rH|�|�d��|��Wn tk
�rr|�|�YnXdS)zk
        Emit a record.

        Send the record to the Web server as a percent-encoded dictionary
        rN)r
r�?�&z%c%s�:rzContent-typez!application/x-www-form-urlencodedzContent-lengthz%s:%sr�zBasic �asciiZ
Authorization)Zhttp.clientZurllib.parser�r�ZclientZHTTPSConnectionr
ZHTTPConnectionr�parseZ	urlencoderr	�findZ
putrequestZ	putheaderr�r;r��base64r�Z	b64encode�strip�decodeZ
endheadersr�Zgetresponserr)rrZhttpZurllibr�r?r�data�sepr5rrwrrrr�sB


�zHTTPHandler.emit)rFNN)r%r&r'r(r	rrrrrrrds�
rc@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�BufferingHandlerz�
  A handler class which buffers logging records in memory. Whenever each
  record is added to the buffer, a check is made to see if the buffer should
  be flushed. If it should, then flush() is expected to do what's needed.
    cCstj�|�||_g|_dS)z>
        Initialize the handler with the buffer size.
        N)rr�r	�capacity�buffer)rrrrrr	�szBufferingHandler.__init__cCst|j�|jkS)z�
        Should the handler flush its buffer?

        Returns true if the buffer is up to capacity. This method can be
        overridden to implement custom flushing strategies.
        )r;rrrrrr�shouldFlush�szBufferingHandler.shouldFlushcCs"|j�|�|�|�r|��dS)z�
        Emit a record.

        Append the record. If shouldFlush() tells us to, call flush() to process
        the buffer.
        N)rrqrr�rrrrr�s
zBufferingHandler.emitcCs"|��z
g|_W5|��XdS)zw
        Override to implement custom flushing behaviour.

        This version just zaps the buffer to empty.
        N)r�r�rr�rrrr��s
zBufferingHandler.flushc	Cs z|��W5tj�|�XdS)zp
        Close the handler.

        This version just flushes and chains to the parent class' close().
        N)rr�r0r�r�rrrr0�szBufferingHandler.closeN)	r%r&r'r(r	rrr�r0rrrrr�s	rc@sBeZdZdZejddfdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dS)�
MemoryHandlerz�
    A handler class which buffers logging records in memory, periodically
    flushing them to a target handler. Flushing occurs whenever the buffer
    is full, or when an event of a certain severity or greater is seen.
    NTcCs"t�||�||_||_||_dS)a;
        Initialize the handler with the buffer size, the level at which
        flushing should occur and an optional target.

        Note that without a target being set either here or via setTarget(),
        a MemoryHandler is no use to anyone!

        The ``flushOnClose`` argument is ``True`` for backward compatibility
        reasons - the old behaviour is that when the handler is closed, the
        buffer is flushed, even if the flush level hasn't been exceeded nor the
        capacity exceeded. To prevent this, set ``flushOnClose`` to ``False``.
        N)rr	�
flushLevel�target�flushOnClose)rrrrrrrrr	�szMemoryHandler.__init__cCst|j�|jkp|j|jkS)zP
        Check for buffer full or a record at the flushLevel or higher.
        )r;rrrrrrrrrs
�zMemoryHandler.shouldFlushcCs"|��z
||_W5|��XdS)z:
        Set the target handler for this handler.
        N)r�r�r)rrrrr�	setTarget
s
zMemoryHandler.setTargetcCs@|��z(|jr.|jD]}|j�|�qg|_W5|��XdS)z�
        For a MemoryHandler, flushing means just sending the buffered
        records to the target, if there is one. Override if you want
        different behaviour.

        The record buffer is also cleared by this operation.
        N)r�r�rr�handlerrrrr�s

zMemoryHandler.flushcCsBz|jr|��W5|��zd|_t�|�W5|��XXdS)zi
        Flush, if appropriately configured, set the target to None and lose the
        buffer.
        N)r�r�rrr0rr�r�rrrr0(szMemoryHandler.close)r%r&r'r(rr�r	rrr�r0rrrrr�s�

rc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�QueueHandlera�
    This handler sends events to a queue. Typically, it would be used together
    with a multiprocessing Queue to centralise logging to file in one process
    (in a multi-process application), so as to avoid file write contention
    between processes.

    This code is new in Python 3.2, but this class can be copy pasted into
    user code for use with earlier Python versions.
    cCstj�|�||_dS)zA
        Initialise an instance, using the passed queue.
        N)rr�r	�queue)rr"rrrr	DszQueueHandler.__init__cCs|j�|�dS)z�
        Enqueue a record.

        The base implementation uses put_nowait. You may want to override
        this method if you want to use blocking, timeouts or custom queue
        implementations.
        N)r"�
put_nowaitrrrr�enqueueKszQueueHandler.enqueuecCs6|�|�}t�|�}||_||_d|_d|_d|_|S)a�
        Prepares a record for queuing. The object returned by this method is
        enqueued.

        The base implementation formats the record to merge the message
        and arguments, and removes unpickleable items from the record
        in-place.

        You might want to override this method if you want to convert
        the record to a dict or JSON string, or send a modified copy
        of the record while leaving the original intact.
        N)r8�copyr�r=r�r�Zexc_textr<rrr�prepareUs

zQueueHandler.preparecCs8z|�|�|��Wntk
r2|�|�YnXdS)zm
        Emit a record.

        Writes the LogRecord to the queue, preparing it for pickling first.
        N)r$r&rrrrrrrrszQueueHandler.emitN)r%r&r'r(r	r$r&rrrrrr!9s


r!c@sZeZdZdZdZdd�dd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)�
QueueListenerz�
    This class implements an internal threaded listener which watches for
    LogRecords being added to a queue, removes them and passes them to a
    list of handlers for processing.
    NF)�respect_handler_levelcGs||_||_d|_||_dS)zW
        Initialise an instance with the specified queue and
        handlers.
        N)r"�handlers�_threadr()rr"r(r)rrrr	�szQueueListener.__init__cCs|j�|�S)z�
        Dequeue a record and return it, optionally blocking.

        The base implementation uses get. You may want to override this method
        if you want to use timeouts or work with custom queue implementations.
        )r"r�)r�blockrrr�dequeue�szQueueListener.dequeuecCs&tj|jd�|_}d|_|��dS)z�
        Start the listener.

        This starts up a background thread to monitor the queue for
        LogRecords to process.
        )rTN)�	threadingZThread�_monitorr*r��start)rr\rrrr/�szQueueListener.startcCs|S)a
        Prepare a record for handling.

        This method just returns the passed-in record. You may want to
        override this method if you need to do any custom marshalling or
        manipulation of the record before passing it to the handlers.
        rrrrrr&�szQueueListener.preparecCs@|�|�}|jD]*}|js d}n|j|jk}|r|�|�qdS)z|
        Handle a record.

        This just loops through the handlers offering them the record
        to handle.
        TN)r&r)r(r�levelr )rrZhandlerZprocessrrrr �s

zQueueListener.handlecCsp|j}t|d�}z>|�d�}||jkr6|r2|��Wql|�|�|rL|��Wqtjk
rhYqlYqXqdS)z�
        Monitor the queue for records, and ask the handler
        to deal with them.

        This method runs on a separate, internal thread.
        The thread will terminate if it sees a sentinel object in the queue.
        �	task_doneTN)r"�hasattrr,�	_sentinelr1r ZEmpty)r�qZ
has_task_donerrrrr.�s



zQueueListener._monitorcCs|j�|j�dS)z�
        This is used to enqueue the sentinel record.

        The base implementation uses put_nowait. You may want to override this
        method if you want to use timeouts or work with custom queue
        implementations.
        N)r"r#r3r�rrr�enqueue_sentinel�szQueueListener.enqueue_sentinelcCs|��|j��d|_dS)a

        Stop the listener.

        This asks the thread to terminate, and then waits for it to do so.
        Note that if you don't call this before your application exits, there
        may be some records still left on the queue, which won't be processed.
        N)r5r*rrr�rrr�stop�s
zQueueListener.stop)
r%r&r'r(r3r	r,r/r&r r.r5r6rrrrr'~s
	

r')'r(rr�rr�r�rYrUrXrrrr"r-r%ZDEFAULT_TCP_LOGGING_PORTZDEFAULT_UDP_LOGGING_PORTZDEFAULT_HTTP_LOGGING_PORTZDEFAULT_SOAP_LOGGING_PORTr�ZSYSLOG_TCP_PORTrerrr)r>rxr�r�r�r�r�r�rrrr!�objectr'rrrr�<module>s<	8FL`E(*PbO9MElogging/__pycache__/__init__.cpython-38.pyc000064400000177400151153537460014614 0ustar00U

e5d�0�*@s6dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z
ddlmZddlm
Zddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.g*ZddlZd/Zd0Zd1Zd2Ze��Zd3Zd3Zd3Zd3Zd4ZeZd5Zd6ZeZd7Zd8Z dZ!eded	edede de!diZ"eeeeeee e!d9�Z#d:d!�Z$d;d�Z%e&ed<��rdd=d>�Z'nd?d@�Z'ej(�)e%j*j+�Z,dAdB�Z-e�.�Z/dCdD�Z0dEdF�Z1e&edG��s�dHdI�Z2n(e�3�Z4dJdI�Z2dKdL�Z5ej6e0e5e1dM�GdNd�de7�Z8e8a9dOd,�Z:dPd+�Z;dQd&�Z<e�Z=[GdRdS�dSe7�Z>GdTdU�dUe>�Z?GdVdW�dWe>�Z@dXZAe>eAfe?dYfe@dZfd[�ZBGd\d
�d
e7�Z
e
�ZCGd]d�de7�ZDGd^d�de7�ZEGd_d`�d`e7�ZFe�G�ZHgZIdadb�ZJdcdd�ZKGded�deF�ZLGdfd�deL�ZMGdgd�deM�ZNGdhdi�dieM�ZOeOe�ZPePZQGdjdk�dke7�ZRdld'�ZSdmd#�ZTGdndo�doe7�ZUGdpd�deF�ZVGdqdr�dreV�ZWeVaXGdsd�de7�ZYeWe�ZZeZeV_ZeUeVjZ�eV_[dtd�Z\d�dud"�Z]dvd�Z^e^Z_dwd�Z`d3dx�dyd�Zadzd*�Zbd{d)�Zcd|d$�Zdd}d�Zed~d%�Zfefdd�ZgeIfd�d(�ZhddliZiei�jeh�Gd�d�deL�Zkdald�d�d��Zmd�d�ZndS)�z�
Logging package for Python. Based on PEP 282 and comments thereto in
comp.lang.python.

Copyright (C) 2001-2017 Vinay Sajip. All Rights Reserved.

To use, simply 'import logging' and log away!
�N)�Template)�	Formatter�BASIC_FORMAT�BufferingFormatter�CRITICAL�DEBUG�ERROR�FATAL�FileHandler�Filterr�Handler�INFO�	LogRecord�Logger�
LoggerAdapter�NOTSET�NullHandler�
StreamHandler�WARN�WARNING�addLevelName�basicConfig�captureWarnings�critical�debug�disable�error�	exception�fatal�getLevelName�	getLogger�getLoggerClass�info�log�
makeLogRecord�setLoggerClass�shutdown�warn�warning�getLogRecordFactory�setLogRecordFactory�
lastResort�raiseExceptionsz&Vinay Sajip <vinay_sajip@red-dove.com>Z
productionz0.5.1.2z07 February 2010T�2�(���
)rr	rrrr
rrcCs4t�|�}|dk	r|St�|�}|dk	r,|Sd|S)a�
    Return the textual or numeric representation of logging level 'level'.

    If the level is one of the predefined levels (CRITICAL, ERROR, WARNING,
    INFO, DEBUG) then you get the corresponding string. If you have
    associated levels with names using addLevelName then the name you have
    associated with 'level' is returned.

    If a numeric value corresponding to one of the defined levels is passed
    in, the corresponding string representation is returned.

    If a string representation of the level is passed in, the corresponding
    numeric value is returned.

    If no matching numeric or string value is passed in, the string
    'Level %s' % level is returned.
    NzLevel %s)�_levelToName�get�_nameToLevel)�level�result�r7�(/usr/lib64/python3.8/logging/__init__.pyrws

cCs(t�z|t|<|t|<W5t�XdS)zy
    Associate 'levelName' with 'level'.

    This is used when converting levels to text during message formatting.
    N)�_acquireLock�_releaseLockr2r4)r5Z	levelNamer7r7r8r�s
�	_getframecCs
t�d�S)N�)�sysr;r7r7r7r8�<lambda>��r>cCs2zt�Wn$tk
r,t��djjYSXdS)z5Return the frame object for the caller's stack frame.�N)�	Exceptionr=�exc_info�tb_frame�f_backr7r7r7r8�currentframe�srEcCsJt|t�r|}n6t|�|kr:|tkr0td|��t|}ntd|��|S)NzUnknown level: %rz*Level not an integer or a valid string: %r)�
isinstance�int�strr4�
ValueError�	TypeError)r5�rvr7r7r8�_checkLevel�s

rLcCstrt��dS)z�
    Acquire the module-level lock for serializing access to shared data.

    This should be released with _releaseLock().
    N)�_lock�acquirer7r7r7r8r9�sr9cCstrt��dS)zK
    Release the module-level lock acquired by calling _acquireLock().
    N)rM�releaser7r7r7r8r:�sr:�register_at_forkcCsdS�Nr7��instancer7r7r8�_register_at_fork_reinit_lock�srTcCs"t�zt�|�W5t�XdSrQ)r9r:�_at_fork_reinit_lock_weakset�addrRr7r7r8rT�scCsXtD]H}z|��Wqtk
rJ}ztdtd|tjd�W5d}~XYqXqt�dS)Nz&Ignoring exception from logging atforkz._reinit_lock() method:��file)rU�
createLockrA�printrSr=�stderrr:)�handler�errr7r7r8�!_after_at_fork_child_reinit_locks�s�r^)ZbeforeZafter_in_childZafter_in_parentc@s*eZdZdZd	dd�Zdd�Zdd�ZdS)
ra
    A LogRecord instance represents an event being logged.

    LogRecord instances are created every time something is logged. They
    contain all the information pertinent to the event being logged. The
    main information passed in is in msg and args, which are combined
    using str(msg) % args to create the message field of the record. The
    record also includes information such as when the record was created,
    the source line where the logging call was made, and any exception
    information to be logged.
    Nc


Ks�t��}||_||_|rFt|�dkrFt|dtjj�rF|drF|d}||_t	|�|_
||_||_z&t
j�|�|_t
j�|j�d|_Wn&tttfk
r�||_d|_YnX||_d|_|	|_||_||_||_|t|�d|_|jtd|_t �rt!�"�|_#t!�$�j|_%nd|_#d|_%t&�s.d|_'nDd|_'t(j)�*d�}|dk	�rrz|�+�j|_'Wnt,k
�rpYnXt-�r�t.t
d��r�t
�/�|_0nd|_0dS)	zK
        Initialize a logging record with interesting information.
        �rzUnknown moduleNi�ZMainProcessZmultiprocessing�getpid)1�time�name�msg�lenrF�collections�abc�Mapping�argsrZ	levelname�levelno�pathname�os�path�basename�filename�splitext�modulerJrI�AttributeErrorrB�exc_text�
stack_info�linenoZfuncName�createdrG�msecs�
_startTimeZrelativeCreated�
logThreads�	threading�	get_ident�threadZcurrent_threadZ
threadName�logMultiprocessingZprocessNamer=�modulesr3Zcurrent_processrA�logProcesses�hasattrr`�process)
�selfrbr5rjrtrcrhrB�func�sinfo�kwargs�ctZmpr7r7r8�__init__ sT"�


zLogRecord.__init__cCsd|j|j|j|j|jfS)Nz!<LogRecord: %s, %s, %s, %s, "%s">)rbrirjrtrc�r�r7r7r8�__repr__hs

�zLogRecord.__repr__cCst|j�}|jr||j}|S)z�
        Return the message for this LogRecord.

        Return the message for this LogRecord after merging any user-supplied
        arguments with the message.
        )rHrcrh)r�rcr7r7r8�
getMessagels

zLogRecord.getMessage)NN)�__name__�
__module__�__qualname__�__doc__r�r�r�r7r7r7r8rs�
HcCs|adS)z�
    Set the factory to be used when instantiating a log record.

    :param factory: A callable which will be called to instantiate
    a log record.
    N��_logRecordFactory)�factoryr7r7r8r*}scCstS)zH
    Return the factory to be used when instantiating a log record.
    r�r7r7r7r8r)�sc	Cs&tdddddddd�}|j�|�|S)z�
    Make a LogRecord whose attributes are defined by the specified dictionary,
    This function is useful for converting a logging event received over
    a socket connection (which is sent as a dictionary) into a LogRecord
    instance.
    N�rr7)r��__dict__�update)�dictrKr7r7r8r$�sc@sNeZdZdZdZdZe�dej�Z	dd�Z
dd�Zd	d
�Zdd�Z
d
d�ZdS)�PercentStylez%(message)sz%(asctime)sz
%(asctime)z5%\(\w+\)[#0+ -]*(\*|\d+)?(\.(\*|\d+))?[diouxefgcrsa%]cCs|p|j|_dSrQ)�default_format�_fmt�r��fmtr7r7r8r��szPercentStyle.__init__cCs|j�|j�dkS)Nr)r��find�asctime_searchr�r7r7r8�usesTime�szPercentStyle.usesTimecCs*|j�|j�s&td|j|jdf��dS)z>Validate the input format, ensure it matches the correct stylez"Invalid format '%s' for '%s' stylerN)�validation_pattern�searchr�rIr�r�r7r7r8�validate�szPercentStyle.validatecCs|j|jSrQ)r�r��r��recordr7r7r8�_format�szPercentStyle._formatc
Cs@z|�|�WStk
r:}ztd|��W5d}~XYnXdS)Nz(Formatting field not found in record: %s)r��KeyErrorrI)r�r��er7r7r8�format�szPercentStyle.formatN)r�r�r�r��asctime_formatr��re�compile�Ir�r�r�r�r�r�r7r7r7r8r��sr�c@s@eZdZdZdZdZe�dej�Z	e�d�Z
dd�Zdd	�Zd
S)�StrFormatStylez	{message}z	{asctime}z{asctimezF^(.?[<>=^])?[+ -]?#?0?(\d+|{\w+})?[,_]?(\.(\d+|{\w+}))?[bcdefgnosx%]?$z^(\d+|\w+)(\.\w+|\[[^]]+\])*$cCs|jjf|j�SrQ)r�r�r�r�r7r7r8r��szStrFormatStyle._formatc
Cs�t�}zxt�|j�D]f\}}}}|rF|j�|�s<td|��|�|�|r^|dkr^td|��|r|j�|�std|��qWn.tk
r�}ztd|��W5d}~XYnX|s�td��dS)zKValidate the input format, ensure it is the correct string formatting stylez!invalid field name/expression: %rZrsazinvalid conversion: %rzbad specifier: %rzinvalid format: %sN�invalid format: no fields)	�set�_str_formatter�parser��
field_spec�matchrIrV�fmt_spec)r��fields�_Z	fieldname�specZ
conversionr�r7r7r8r��s
zStrFormatStyle.validateN)
r�r�r�r�r�r�r�r�r�r�r�r�r�r7r7r7r8r��s
r�c@s8eZdZdZdZdZdd�Zdd�Zdd�Zd	d
�Z	dS)�StringTemplateStylez
${message}z
${asctime}cCs|p|j|_t|j�|_dSrQ)r�r�r�_tplr�r7r7r8r��szStringTemplateStyle.__init__cCs$|j}|�d�dkp"|�|j�dkS)Nz$asctimer)r�r�r�r�r7r7r8r��szStringTemplateStyle.usesTimecCs|tj}t�}|�|j�D]R}|��}|dr<|�|d�q|drT|�|d�q|�d�dkrtd��q|sxtd��dS)NZnamedZbracedr�$z$invalid format: bare '$' not allowedr�)	r�patternr��finditerr��	groupdictrV�grouprI)r�r�r��m�dr7r7r8r��s
zStringTemplateStyle.validatecCs|jjf|j�SrQ)r�Z
substituter�r�r7r7r8r��szStringTemplateStyle._formatN)
r�r�r�r�r�r�r�r�r�r�r7r7r7r8r��sr�z"%(levelname)s:%(name)s:%(message)sz{levelname}:{name}:{message}z${levelname}:${name}:${message})�%�{r�c@sZeZdZdZejZddd�ZdZdZ	dd	d
�Z
dd�Zd
d�Zdd�Z
dd�Zdd�ZdS)ra�
    Formatter instances are used to convert a LogRecord to text.

    Formatters need to know how a LogRecord is constructed. They are
    responsible for converting a LogRecord to (usually) a string which can
    be interpreted by either a human or an external system. The base Formatter
    allows a formatting string to be specified. If none is supplied, the
    style-dependent default value, "%(message)s", "{message}", or
    "${message}", is used.

    The Formatter can be initialized with a format string which makes use of
    knowledge of the LogRecord attributes - e.g. the default value mentioned
    above makes use of the fact that the user's message and arguments are pre-
    formatted into a LogRecord's message attribute. Currently, the useful
    attributes in a LogRecord are described by:

    %(name)s            Name of the logger (logging channel)
    %(levelno)s         Numeric logging level for the message (DEBUG, INFO,
                        WARNING, ERROR, CRITICAL)
    %(levelname)s       Text logging level for the message ("DEBUG", "INFO",
                        "WARNING", "ERROR", "CRITICAL")
    %(pathname)s        Full pathname of the source file where the logging
                        call was issued (if available)
    %(filename)s        Filename portion of pathname
    %(module)s          Module (name portion of filename)
    %(lineno)d          Source line number where the logging call was issued
                        (if available)
    %(funcName)s        Function name
    %(created)f         Time when the LogRecord was created (time.time()
                        return value)
    %(asctime)s         Textual time when the LogRecord was created
    %(msecs)d           Millisecond portion of the creation time
    %(relativeCreated)d Time in milliseconds when the LogRecord was created,
                        relative to the time the logging module was loaded
                        (typically at application startup time)
    %(thread)d          Thread ID (if available)
    %(threadName)s      Thread name (if available)
    %(process)d         Process ID (if available)
    %(message)s         The result of record.getMessage(), computed just as
                        the record is emitted
    Nr�TcCsR|tkrtdd�t�����t|d|�|_|r>|j��|jj|_||_dS)a�
        Initialize the formatter with specified format strings.

        Initialize the formatter either with the specified format string, or a
        default as described above. Allow for specialized date formatting with
        the optional datefmt argument. If datefmt is omitted, you get an
        ISO8601-like (or RFC 3339-like) format.

        Use a style parameter of '%', '{' or '$' to specify that you want to
        use one of %-formatting, :meth:`str.format` (``{}``) formatting or
        :class:`string.Template` formatting in your format string.

        .. versionchanged:: 3.2
           Added the ``style`` parameter.
        �Style must be one of: %s�,rN)�_STYLESrI�join�keys�_styler�r��datefmt)r�r�r��styler�r7r7r8r�/s�

zFormatter.__init__z%Y-%m-%d %H:%M:%Sz%s,%03dcCs@|�|j�}|rt�||�}nt�|j|�}|j||jf}|S)a%
        Return the creation time of the specified LogRecord as formatted text.

        This method should be called from format() by a formatter which
        wants to make use of a formatted time. This method can be overridden
        in formatters to provide for any specific requirement, but the
        basic behaviour is as follows: if datefmt (a string) is specified,
        it is used with time.strftime() to format the creation time of the
        record. Otherwise, an ISO8601-like (or RFC 3339-like) format is used.
        The resulting string is returned. This function uses a user-configurable
        function to convert the creation time to a tuple. By default,
        time.localtime() is used; to change this for a particular formatter
        instance, set the 'converter' attribute to a function with the same
        signature as time.localtime() or time.gmtime(). To change it for all
        formatters, for example if you want all logging times to be shown in GMT,
        set the 'converter' attribute in the Formatter class.
        )�	converterrura�strftime�default_time_format�default_msec_formatrv)r�r�r�r��s�tr7r7r8�
formatTimeLszFormatter.formatTimecCsZt��}|d}t�|d|d|d|�|��}|��|dd�dkrV|dd�}|S)z�
        Format and return the specified exception information as a string.

        This default implementation just uses
        traceback.print_exception()
        r@rr_N����
)�io�StringIO�	traceback�print_exception�getvalue�close)r�Zei�sio�tbr�r7r7r8�formatExceptionfszFormatter.formatExceptioncCs
|j��S)zK
        Check if the format uses the creation time of the record.
        )r�r�r�r7r7r8r�yszFormatter.usesTimecCs|j�|�SrQ)r�r�r�r7r7r8�
formatMessageszFormatter.formatMessagecCs|S)aU
        This method is provided as an extension point for specialized
        formatting of stack information.

        The input data is a string as returned from a call to
        :func:`traceback.print_stack`, but with the last trailing newline
        removed.

        The base implementation just returns the value passed in.
        r7)r�rsr7r7r8�formatStack�szFormatter.formatStackcCs�|��|_|��r"|�||j�|_|�|�}|jrF|jsF|�	|j�|_|jrn|dd�dkrd|d}||j}|j
r�|dd�dkr�|d}||�|j
�}|S)az
        Format the specified record as text.

        The record's attribute dictionary is used as the operand to a
        string formatting operation which yields the returned string.
        Before formatting the dictionary, a couple of preparatory steps
        are carried out. The message attribute of the record is computed
        using LogRecord.getMessage(). If the formatting string uses the
        time (as determined by a call to usesTime(), formatTime() is
        called to format the event time. If there is exception information,
        it is formatted using formatException() and appended to the message.
        r�Nr�)r��messager�r�r��asctimer�rBrrr�rsr�)r�r�r�r7r7r8r��s 


zFormatter.format)NNr�T)N)r�r�r�r�ra�	localtimer�r�r�r�r�r�r�r�r�r�r7r7r7r8rs*


c@s2eZdZdZddd�Zdd�Zdd�Zd	d
�ZdS)rzB
    A formatter suitable for formatting a number of records.
    NcCs|r||_nt|_dS)zm
        Optionally specify a formatter which will be used to format each
        individual record.
        N)�linefmt�_defaultFormatter)r�r�r7r7r8r��szBufferingFormatter.__init__cCsdS)zE
        Return the header string for the specified records.
        r�r7�r��recordsr7r7r8�formatHeader�szBufferingFormatter.formatHeadercCsdS)zE
        Return the footer string for the specified records.
        r�r7r�r7r7r8�formatFooter�szBufferingFormatter.formatFootercCsJd}t|�dkrF||�|�}|D]}||j�|�}q"||�|�}|S)zQ
        Format the specified records and return the result as a string.
        r�r)rdr�r�r�r�)r�r�rKr�r7r7r8r��szBufferingFormatter.format)N)r�r�r�r�r�r�r�r�r7r7r7r8r�s


c@s"eZdZdZddd�Zdd�ZdS)	ra�
    Filter instances are used to perform arbitrary filtering of LogRecords.

    Loggers and Handlers can optionally use Filter instances to filter
    records as desired. The base filter class only allows events which are
    below a certain point in the logger hierarchy. For example, a filter
    initialized with "A.B" will allow events logged by loggers "A.B",
    "A.B.C", "A.B.C.D", "A.B.D" etc. but not "A.BB", "B.A.B" etc. If
    initialized with the empty string, all events are passed.
    r�cCs||_t|�|_dS)z�
        Initialize a filter.

        Initialize with the name of the logger which, together with its
        children, will have its events allowed through the filter. If no
        name is specified, allow every event.
        N)rbrd�nlen�r�rbr7r7r8r��szFilter.__init__cCsJ|jdkrdS|j|jkrdS|j�|jd|j�dkr:dS|j|jdkS)z�
        Determine if the specified record is to be logged.

        Returns True if the record should be logged, or False otherwise.
        If deemed appropriate, the record may be modified in-place.
        rTF�.)r�rbr�r�r7r7r8�filter�s
z
Filter.filterN)r�)r�r�r�r�r�r�r7r7r7r8r�s

c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�Filtererz[
    A base class for loggers and handlers which allows them to share
    common code.
    cCs
g|_dS)zE
        Initialize the list of filters to be an empty list.
        N)�filtersr�r7r7r8r�szFilterer.__init__cCs||jkr|j�|�dS)z;
        Add the specified filter to this handler.
        N)r��append�r�r�r7r7r8�	addFilters
zFilterer.addFiltercCs||jkr|j�|�dS)z@
        Remove the specified filter from this handler.
        N)r��remover�r7r7r8�removeFilters
zFilterer.removeFiltercCs>d}|jD].}t|d�r$|�|�}n||�}|s
d}q:q
|S)ah
        Determine if a record is loggable by consulting all the filters.

        The default is to allow the record to be logged; any filter can veto
        this and the record is then dropped. Returns a zero value if a record
        is to be dropped, else non-zero.

        .. versionchanged:: 3.2

           Allow filters to be just callables.
        Tr�F)r�rr�)r�r�rK�fr6r7r7r8r�s

zFilterer.filterN)r�r�r�r�r�r�r�r�r7r7r7r8r�s
r�cCsFttt}}}|rB|rB|rB|�z||kr6|�|�W5|�XdS)zD
    Remove a handler reference from the internal cleanup list.
    N)r9r:�_handlerListr�)�wrrNrO�handlersr7r7r8�_removeHandlerRef:sr�cCs*t�zt�t�|t��W5t�XdS)zL
    Add a handler to the internal cleanup list using a weak reference.
    N)r9r:r�r��weakref�refr�)r\r7r7r8�_addHandlerRefKsr�c@s�eZdZdZefdd�Zdd�Zdd�Zeee�Z	dd	�Z
d
d�Zdd
�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd S)!raq
    Handler instances dispatch logging events to specific destinations.

    The base handler class. Acts as a placeholder which defines the Handler
    interface. Handlers can optionally use Formatter instances to format
    records as desired. By default, no formatter is specified; in this case,
    the 'raw' message as determined by record.message is logged.
    cCs4t�|�d|_t|�|_d|_t|�|��dS)zz
        Initializes the instance - basically setting the formatter to None
        and the filter list to empty.
        N)r�r��_namerLr5�	formatterr�rY�r�r5r7r7r8r�^s

zHandler.__init__cCs|jSrQ)r�r�r7r7r8�get_namekszHandler.get_namecCs<t�z(|jtkrt|j=||_|r,|t|<W5t�XdSrQ�r9r:r��	_handlersr�r7r7r8�set_namens
zHandler.set_namecCst��|_t|�dS)zU
        Acquire a thread lock for serializing access to the underlying I/O.
        N)ry�RLock�lockrTr�r7r7r8rY{s
zHandler.createLockcCs|jr|j��dS)z.
        Acquire the I/O thread lock.
        N)rrNr�r7r7r8rN�szHandler.acquirecCs|jr|j��dS)z.
        Release the I/O thread lock.
        N)rrOr�r7r7r8rO�szHandler.releasecCst|�|_dS)zX
        Set the logging level of this handler.  level must be an int or a str.
        N)rLr5r�r7r7r8�setLevel�szHandler.setLevelcCs|jr|j}nt}|�|�S)z�
        Format the specified record.

        If a formatter is set, use it. Otherwise, use the default formatter
        for the module.
        )r�r�r�)r�r�r�r7r7r8r��szHandler.formatcCstd��dS)z�
        Do whatever it takes to actually log the specified logging record.

        This version is intended to be implemented by subclasses and so
        raises a NotImplementedError.
        z.emit must be implemented by Handler subclassesN)�NotImplementedErrorr�r7r7r8�emit�szHandler.emitcCs4|�|�}|r0|��z|�|�W5|��X|S)a<
        Conditionally emit the specified logging record.

        Emission depends on filters which may have been added to the handler.
        Wrap the actual emission of the record with acquisition/release of
        the I/O thread lock. Returns whether the filter passed the record for
        emission.
        )r�rNrOr)r�r�rKr7r7r8�handle�s	

zHandler.handlecCs
||_dS)z5
        Set the formatter for this handler.
        N)r�r�r7r7r8�setFormatter�szHandler.setFormattercCsdS)z�
        Ensure all logging output has been flushed.

        This version does nothing and is intended to be implemented by
        subclasses.
        Nr7r�r7r7r8�flush�sz
Handler.flushcCs0t�z|jr |jtkr t|j=W5t�XdS)a%
        Tidy up any resources used by the handler.

        This version removes the handler from an internal map of handlers,
        _handlers, which is used for handler lookup by name. Subclasses
        should ensure that this gets called from overridden close()
        methods.
        Nr�r�r7r7r8r��s

z
Handler.closecCs t�rtj�rt��\}}}z�z�tj�d�t�|||dtj�tj�d�|j}|rvtj	�
|jj�t
dkrv|j}qR|r�tj|tjd�ntj�d|j|jf�ztj�d|j|jf�Wn4tk
r��Yn tk
r�tj�d�YnXWntk
�rYnXW5~~~XdS)	aD
        Handle errors which occur during an emit() call.

        This method should be called from handlers when an exception is
        encountered during an emit() call. If raiseExceptions is false,
        exceptions get silently ignored. This is what is mostly wanted
        for a logging system - most users will not care about errors in
        the logging system, they are more interested in application errors.
        You could, however, replace this with a custom handler if you wish.
        The record which was being processed is passed in to this method.
        z--- Logging error ---
NzCall stack:
rrWzLogged from file %s, line %s
zMessage: %r
Arguments: %s
zwUnable to print the message and arguments - possible formatting error.
Use the traceback above to help find the error.
)r,r=r[rB�writer�r�rCrkrl�dirname�f_code�co_filename�__path__rD�print_stackrnrtrcrh�RecursionErrorrA�OSError)r�r�r��vr��framer7r7r8�handleError�s<����

zHandler.handleErrorcCst|j�}d|jj|fS)Nz	<%s (%s)>)rr5�	__class__r�r�r7r7r8r�s
zHandler.__repr__N)r�r�r�r�rr�r�r��propertyrbrYrNrOrr�rrrrr�rr�r7r7r7r8rUs"



	/c@s>eZdZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)rz�
    A handler class which writes logging records, appropriately formatted,
    to a stream. Note that this class does not close the stream, as
    sys.stdout or sys.stderr may be used.
    r�NcCs"t�|�|dkrtj}||_dS)zb
        Initialize the handler.

        If stream is not specified, sys.stderr is used.
        N)rr�r=r[�stream�r�rr7r7r8r�s
zStreamHandler.__init__cCs8|��z |jr&t|jd�r&|j��W5|��XdS)z%
        Flushes the stream.
        rN)rNrOrrrr�r7r7r8r&s
zStreamHandler.flushcCsdz,|�|�}|j}|�||j�|��Wn2tk
rB�Yntk
r^|�|�YnXdS)a�
        Emit a record.

        If a formatter is specified, it is used to format the record.
        The record is then written to the stream with a trailing newline.  If
        exception information is present, it is formatted using
        traceback.print_exception and appended to the stream.  If the stream
        has an 'encoding' attribute, it is used to determine how to do the
        output to the stream.
        N)r�rr�
terminatorrr
rAr)r�r�rcrr7r7r8r1s
zStreamHandler.emitcCs@||jkrd}n,|j}|��z|��||_W5|��X|S)z�
        Sets the StreamHandler's stream to the specified value,
        if it is different.

        Returns the old stream, if the stream was changed, or None
        if it wasn't.
        N)rrNrOr)r�rr6r7r7r8�	setStreamGs


zStreamHandler.setStreamcCs>t|j�}t|jdd�}t|�}|r,|d7}d|jj||fS)Nrbr�� z<%s %s(%s)>)rr5�getattrrrHrr�)r�r5rbr7r7r8r�[s
zStreamHandler.__repr__)N)
r�r�r�r�rr�rrrr�r7r7r7r8rs
c@s:eZdZdZddd�Zdd�Zd	d
�Zdd�Zd
d�ZdS)r
zO
    A handler class which writes formatted logging records to disk files.
    �aNFcCsTt�|�}tj�|�|_||_||_||_|r@t�	|�d|_
nt�	||���dS)zO
        Open the specified file and use it as the stream for logging.
        N)
rk�fspathrl�abspath�baseFilename�mode�encoding�delayrr�rr�_open)r�rnrrr r7r7r8r�is

zFileHandler.__init__c	Csb|��zJz8|jr@z|��W5|j}d|_t|d�r>|��XW5t�|�XW5|��XdS)z$
        Closes the stream.
        Nr�)rNrOrr�rrrrr7r7r8r�}s
zFileHandler.closecCst|j|j|jd�S)zx
        Open the current base file with the (original) mode and encoding.
        Return the resulting stream.
        )r)�openrrrr�r7r7r8r!�szFileHandler._opencCs$|jdkr|��|_t�||�dS)z�
        Emit a record.

        If the stream was not opened because 'delay' was specified in the
        constructor, open it before calling the superclass's emit.
        N)rr!rrr�r7r7r8r�s

zFileHandler.emitcCst|j�}d|jj|j|fS�Nz<%s %s (%s)>)rr5rr�rr�r7r7r8r��s
zFileHandler.__repr__)rNF)	r�r�r�r�r�r�r!rr�r7r7r7r8r
es
c@s(eZdZdZefdd�Zedd��ZdS)�_StderrHandlerz�
    This class is like a StreamHandler using sys.stderr, but always uses
    whatever sys.stderr is currently set to rather than the value of
    sys.stderr at handler construction time.
    cCst�||�dS)z)
        Initialize the handler.
        N)rr�r�r7r7r8r��sz_StderrHandler.__init__cCstjSrQ)r=r[r�r7r7r8r�sz_StderrHandler.streamN)r�r�r�r�rr�rrr7r7r7r8r$�sr$c@s eZdZdZdd�Zdd�ZdS)�PlaceHolderz�
    PlaceHolder instances are used in the Manager logger hierarchy to take
    the place of nodes for which no loggers have been defined. This class is
    intended for internal use only and not as part of the public API.
    cCs|di|_dS)zY
        Initialize with the specified logger being a child of this placeholder.
        N��	loggerMap�r��aloggerr7r7r8r��szPlaceHolder.__init__cCs||jkrd|j|<dS)zJ
        Add the specified logger as a child of this placeholder.
        Nr&r(r7r7r8r��s
zPlaceHolder.appendN)r�r�r�r�r�r�r7r7r7r8r%�sr%cCs(|tkr t|t�s td|j��|adS)z�
    Set the class to be used when instantiating a logger. The class should
    define __init__() such that only a name argument is required, and the
    __init__() should call Logger.__init__()
    �(logger not derived from logging.Logger: N)r�
issubclassrJr��_loggerClass)�klassr7r7r8r%�s
�cCstS)zB
    Return the class to be used when instantiating a logger.
    )r,r7r7r7r8r!�sc@sbeZdZdZdd�Zedd��Zejdd��Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dS)�Managerzt
    There is [under normal circumstances] just one Manager instance, which
    holds the hierarchy of loggers.
    cCs(||_d|_d|_i|_d|_d|_dS)zT
        Initialize the manager with the root node of the logger hierarchy.
        rFN)�rootr�emittedNoHandlerWarning�
loggerDict�loggerClass�logRecordFactory)r�Zrootnoder7r7r8r��szManager.__init__cCs|jSrQ)�_disabler�r7r7r8r�szManager.disablecCst|�|_dSrQ)rLr4�r��valuer7r7r8rscCs�d}t|t�std��t�z�||jkrv|j|}t|t�r�|}|jpHt|�}||_	||j|<|�
||�|�|�n(|jp~t|�}||_	||j|<|�|�W5t�X|S)a�
        Get a logger with the specified name (channel name), creating it
        if it doesn't yet exist. This name is a dot-separated hierarchical
        name, such as "a", "a.b", "a.b.c" or similar.

        If a PlaceHolder existed for the specified name [i.e. the logger
        didn't exist but a child of it did], replace it with the created
        logger and fix up the parent/child references which pointed to the
        placeholder to now point to the logger.
        NzA logger name must be a string)rFrHrJr9r:r1r%r2r,�manager�_fixupChildren�
_fixupParents)r�rbrK�phr7r7r8r s(





zManager.getLoggercCs*|tkr t|t�s td|j��||_dS)zY
        Set the class to be used when instantiating a logger with this Manager.
        r*N)rr+rJr�r2)r�r-r7r7r8r%&s
�zManager.setLoggerClasscCs
||_dS)zg
        Set the factory to be used when instantiating a log record with this
        Manager.
        N)r3)r�r�r7r7r8r*0szManager.setLogRecordFactorycCs�|j}|�d�}d}|dkr�|s�|d|�}||jkrFt|�|j|<n2|j|}t|t�r`|}nt|t�snt�|�|�|�dd|d�}q|s�|j}||_	dS)z�
        Ensure that there are either loggers or placeholders all the way
        from the specified logger to the root of the logger hierarchy.
        r�Nrr_)
rb�rfindr1r%rFr�AssertionErrorr�r/�parent)r�r)rb�irKZsubstr�objr7r7r8r97s 




zManager._fixupParentscCsD|j}t|�}|j��D]&}|jjd|�|kr|j|_||_qdS)zk
        Ensure that children of the placeholder ph are connected to the
        specified logger.
        N)rbrdr'r�r=)r�r:r)rbZnamelen�cr7r7r8r8OszManager._fixupChildrencCs@t�|j��D]}t|t�r|j��q|jj��t�dS)zj
        Clear the cache for all loggers in loggerDict
        Called when level changes are made
        N)	r9r1�valuesrFr�_cache�clearr/r:�r��loggerr7r7r8�_clear_cache\s
zManager._clear_cacheN)r�r�r�r�r�rr�setterr r%r*r9r8rFr7r7r7r8r.�s

"

r.c@s�eZdZdZefdd�Zdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�dd�Zdd�Z
e
Zdd�Zd5dd�Zd6dd�Zd7dd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�ZdS)8rar
    Instances of the Logger class represent a single logging channel. A
    "logging channel" indicates an area of an application. Exactly how an
    "area" is defined is up to the application developer. Since an
    application can have any number of areas, logging channels are identified
    by a unique string. Application areas can be nested (e.g. an area
    of "input processing" might include sub-areas "read CSV files", "read
    XLS files" and "read Gnumeric files"). To cater for this natural nesting,
    channel names are organized into a namespace hierarchy where levels are
    separated by periods, much like the Java or Python package namespace. So
    in the instance given above, channel names might be "input" for the upper
    level, and "input.csv", "input.xls" and "input.gnu" for the sub-levels.
    There is no arbitrary limit to the depth of nesting.
    cCs<t�|�||_t|�|_d|_d|_g|_d|_i|_	dS)zJ
        Initialize the logger with a name and an optional level.
        NTF)
r�r�rbrLr5r=�	propagater��disabledrB)r�rbr5r7r7r8r�|s

zLogger.__init__cCst|�|_|j��dS)zW
        Set the logging level of this logger.  level must be an int or a str.
        N)rLr5r7rFr�r7r7r8r�s
zLogger.setLevelcOs |�t�r|jt||f|�dS)z�
        Log 'msg % args' with severity 'DEBUG'.

        To pass exception information, use the keyword argument exc_info with
        a true value, e.g.

        logger.debug("Houston, we have a %s", "thorny problem", exc_info=1)
        N)�isEnabledForr�_log�r�rcrhr�r7r7r8r�s	
zLogger.debugcOs |�t�r|jt||f|�dS)z�
        Log 'msg % args' with severity 'INFO'.

        To pass exception information, use the keyword argument exc_info with
        a true value, e.g.

        logger.info("Houston, we have a %s", "interesting problem", exc_info=1)
        N)rJr
rKrLr7r7r8r"�s	
zLogger.infocOs |�t�r|jt||f|�dS)z�
        Log 'msg % args' with severity 'WARNING'.

        To pass exception information, use the keyword argument exc_info with
        a true value, e.g.

        logger.warning("Houston, we have a %s", "bit of a problem", exc_info=1)
        N)rJrrKrLr7r7r8r(�s	
zLogger.warningcOs$t�dtd�|j|f|�|�dS�Nz6The 'warn' method is deprecated, use 'warning' insteadr@��warningsr'�DeprecationWarningr(rLr7r7r8r'�s
�zLogger.warncOs |�t�r|jt||f|�dS)z�
        Log 'msg % args' with severity 'ERROR'.

        To pass exception information, use the keyword argument exc_info with
        a true value, e.g.

        logger.error("Houston, we have a %s", "major problem", exc_info=1)
        N)rJrrKrLr7r7r8r�s	
zLogger.errorT�rBcOs|j|f|�d|i|��dS)zU
        Convenience method for logging an ERROR with exception information.
        rBN�r�r�rcrBrhr�r7r7r8r�szLogger.exceptioncOs |�t�r|jt||f|�dS)z�
        Log 'msg % args' with severity 'CRITICAL'.

        To pass exception information, use the keyword argument exc_info with
        a true value, e.g.

        logger.critical("Houston, we have a %s", "major disaster", exc_info=1)
        N)rJrrKrLr7r7r8r�s	
zLogger.criticalcOs<t|t�strtd��ndS|�|�r8|j|||f|�dS)z�
        Log 'msg % args' with the integer severity 'level'.

        To pass exception information, use the keyword argument exc_info with
        a true value, e.g.

        logger.log(level, "We have a %s", "mysterious problem", exc_info=1)
        zlevel must be an integerN)rFrGr,rJrJrK�r�r5rcrhr�r7r7r8r#�s	


z
Logger.logFr_c
Cs�t�}|dk	r|j}|}|r4|dkr4|j}|d8}q|s<|}d}t|d�r�|j}tj�|j�}|tkrn|j}q@d}|r�t	�
�}	|	�d�tj
||	d�|	��}|ddkr�|dd�}|	��|j|j|j|f}q�q@|S)	z�
        Find the stack frame of the caller so that we can note the source
        file name, line number and function name.
        Nr_)�(unknown file)r�(unknown function)Nr	zStack (most recent call last):
rWr�r�)rErDrr	rkrl�normcaser
�_srcfiler�r�rr�rr�r��f_lineno�co_name)
r�rs�
stacklevelr�Zorig_frK�cornr�r�r7r7r8�
findCaller�s8


zLogger.findCallerNc

CsZt|||||||||
�	}|	dk	rV|	D]0}|dks:||jkrFtd|��|	||j|<q$|S)zr
        A factory method which can be overridden in subclasses to create
        specialized LogRecords.
        N)r�r�z$Attempt to overwrite %r in LogRecord)r�r�r�)
r�rbr5�fn�lnorcrhrBr��extrar�rK�keyr7r7r8�
makeRecords�zLogger.makeRecordc
Cs�d}trBz|�||�\}	}
}}WqLtk
r>d\}	}
}YqLXn
d\}	}
}|r~t|t�rlt|�||jf}nt|t�s~t�	�}|�
|j||	|
||||||�
}|�|�dS)z�
        Low-level logging routine which creates a LogRecord and then calls
        all the handlers of this logger to handle the record.
        N)rUrrV)
rXr]rIrF�
BaseException�type�
__traceback__�tupler=rBrbrbr)
r�r5rcrhrBr`rsr[r�r^r_r�r�r7r7r8rKs&


�zLogger._logcCs|js|�|�r|�|�dS)z�
        Call the handlers for the specified record.

        This method is used for unpickled records received from a socket, as
        well as those created locally. Logger-level filtering is applied.
        N)rIr��callHandlersr�r7r7r8r7sz
Logger.handlecCs.t�z||jkr|j�|�W5t�XdS)z;
        Add the specified handler to this logger.
        N)r9r:r�r��r��hdlrr7r7r8�
addHandlerAs

zLogger.addHandlercCs.t�z||jkr|j�|�W5t�XdS)z@
        Remove the specified handler from this logger.
        N)r9r:r�r�rhr7r7r8�
removeHandlerLs

zLogger.removeHandlercCs.|}d}|r*|jrd}q*|js"q*q|j}q|S)a�
        See if this logger has any handlers configured.

        Loop through all handlers for this logger and its parents in the
        logger hierarchy. Return True if a handler was found, else False.
        Stop searching up the hierarchy whenever a logger with the "propagate"
        attribute set to zero is found - that will be the last logger which
        is checked for the existence of handlers.
        FT)r�rHr=)r�r@rKr7r7r8�hasHandlersWs
zLogger.hasHandlerscCs�|}d}|rJ|jD]"}|d}|j|jkr|�|�q|jsBd}q|j}q|dkr�trn|jtjkr�t�|�n&tr�|jj	s�t
j�d|j
�d|j_	dS)a�
        Pass a record to all relevant handlers.

        Loop through all handlers for this logger and its parents in the
        logger hierarchy. If no handler was found, output a one-off error
        message to sys.stderr. Stop searching up the hierarchy whenever a
        logger with the "propagate" attribute set to zero is found - that
        will be the last logger whose handlers are called.
        rr_Nz+No handlers could be found for logger "%s"
T)r�rir5rrHr=r+r,r7r0r=r[rrb)r�r�r@�foundrir7r7r8rgms&

�zLogger.callHandlerscCs |}|r|jr|jS|j}qtS)z�
        Get the effective level for this logger.

        Loop through this logger and its parents in the logger hierarchy,
        looking for a non-zero logging level. Return the first one found.
        )r5r=rrDr7r7r8�getEffectiveLevel�szLogger.getEffectiveLevelc
Csz|jr
dSz|j|WStk
rtt�z6|jj|krJd}|j|<n||��k}|j|<W5t�X|YSXdS)�;
        Is this logger enabled for level 'level'?
        FN)rIrBr�r9r:r7rrn)r�r5Z
is_enabledr7r7r8rJ�s
�zLogger.isEnabledForcCs&|j|k	rd�|j|f�}|j�|�S)ab
        Get a logger which is a descendant to this one.

        This is a convenience method, such that

        logging.getLogger('abc').getChild('def.ghi')

        is the same as

        logging.getLogger('abc.def.ghi')

        It's useful, for example, when the parent logger is named using
        __name__ rather than a literal string.
        r�)r/r�rbr7r )r��suffixr7r7r8�getChild�s
zLogger.getChildcCs t|���}d|jj|j|fSr#)rrnrr�rbr�r7r7r8r��szLogger.__repr__cCs,t|j�|k	r ddl}|�d��t|jffS)Nrzlogger cannot be pickled)r rb�pickleZ
PicklingError)r�rrr7r7r8�
__reduce__�s
zLogger.__reduce__)Fr_)NNN)NNFr_)r�r�r�r�rr�rrr"r(r'rrrrr#r]rbrKrrjrkrlrgrnrJrqr�rsr7r7r7r8rms<

%�
�

c@s eZdZdZdd�Zdd�ZdS)�
RootLoggerz�
    A root logger is not that different to any other logger, except that
    it must have a logging level and there is only one instance of it in
    the hierarchy.
    cCst�|d|�dS)z=
        Initialize the logger with the name "root".
        r/N)rr�r�r7r7r8r��szRootLogger.__init__cCstdfS)Nr7)r r�r7r7r8rs�szRootLogger.__reduce__N)r�r�r�r�r�rsr7r7r7r8rt�srtc@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd+d"d#�Zed$d%��Zejd&d%��Zed'd(��Zd)d*�Zd S),rzo
    An adapter for loggers which makes it easier to specify contextual
    information in logging output.
    cCs||_||_dS)ax
        Initialize the adapter with a logger and a dict-like object which
        provides contextual information. This constructor signature allows
        easy stacking of LoggerAdapters, if so desired.

        You can effectively pass keyword arguments as shown in the
        following example:

        adapter = LoggerAdapter(someLogger, dict(p1=v1, p2="v2"))
        N)rEr`)r�rEr`r7r7r8r��szLoggerAdapter.__init__cCs|j|d<||fS)a�
        Process the logging message and keyword arguments passed in to
        a logging call to insert contextual information. You can either
        manipulate the message itself, the keyword args or both. Return
        the message and kwargs modified (or not) to suit your needs.

        Normally, you'll only need to override this one method in a
        LoggerAdapter subclass for your specific needs.
        r`)r`)r�rcr�r7r7r8r��s

zLoggerAdapter.processcOs|jt|f|�|�dS)zA
        Delegate a debug call to the underlying logger.
        N)r#rrLr7r7r8rszLoggerAdapter.debugcOs|jt|f|�|�dS)zA
        Delegate an info call to the underlying logger.
        N)r#r
rLr7r7r8r"
szLoggerAdapter.infocOs|jt|f|�|�dS)zC
        Delegate a warning call to the underlying logger.
        N)r#rrLr7r7r8r(szLoggerAdapter.warningcOs$t�dtd�|j|f|�|�dSrMrNrLr7r7r8r's
�zLoggerAdapter.warncOs|jt|f|�|�dS)zB
        Delegate an error call to the underlying logger.
        N�r#rrLr7r7r8rszLoggerAdapter.errorTrQcOs |jt|f|�d|i|��dS)zF
        Delegate an exception call to the underlying logger.
        rBNrurSr7r7r8r!szLoggerAdapter.exceptioncOs|jt|f|�|�dS)zD
        Delegate a critical call to the underlying logger.
        N)r#rrLr7r7r8r'szLoggerAdapter.criticalcOs4|�|�r0|�||�\}}|jj||f|�|�dS)z�
        Delegate a log call to the underlying logger, after adding
        contextual information from this adapter instance.
        N)rJr�rEr#rTr7r7r8r#-s
zLoggerAdapter.logcCs|j�|�S)ro)rErJr�r7r7r8rJ6szLoggerAdapter.isEnabledForcCs|j�|�dS)zC
        Set the specified level on the underlying logger.
        N)rErr�r7r7r8r<szLoggerAdapter.setLevelcCs
|j��S)zD
        Get the effective level for the underlying logger.
        )rErnr�r7r7r8rnBszLoggerAdapter.getEffectiveLevelcCs
|j��S)z@
        See if the underlying logger has any handlers.
        )rErlr�r7r7r8rlHszLoggerAdapter.hasHandlersNFcCs|jj||||||d�S)zX
        Low-level log implementation, proxied to allow nested logger adapters.
        )rBr`rs)rErK)r�r5rcrhrBr`rsr7r7r8rKNs�zLoggerAdapter._logcCs|jjSrQ�rEr7r�r7r7r8r7[szLoggerAdapter.managercCs||j_dSrQrvr5r7r7r8r7_scCs|jjSrQ)rErbr�r7r7r8rbcszLoggerAdapter.namecCs&|j}t|���}d|jj|j|fSr#)rErrnrr�rb)r�rEr5r7r7r8r�gszLoggerAdapter.__repr__)NNF)r�r�r�r�r�r�rr"r(r'rrrr#rJrrnrlrKrr7rGrbr�r7r7r7r8r�s.	




c
Ks�t��z�|�dd�}|r@tjdd�D]}t�|�|��q(ttj�dk�r�|�dd�}|dkr~d|kr�d|kr�td��nd|ks�d|kr�td	��|dkr�|�dd�}|�d
d�}|r�t	||�}n|�dd�}t
|�}|g}|�dd�}|�d
d�}|tk�rtdd�t�
����|�dt|d�}	t|	||�}
|D]&}|jdk�rV|�|
�t�|��q<|�dd�}|dk	�r�t�|�|�r�d�|�
��}td|��W5t�XdS)a'
    Do basic configuration for the logging system.

    This function does nothing if the root logger already has handlers
    configured, unless the keyword argument *force* is set to ``True``.
    It is a convenience method intended for use by simple scripts
    to do one-shot configuration of the logging package.

    The default behaviour is to create a StreamHandler which writes to
    sys.stderr, set a formatter using the BASIC_FORMAT format string, and
    add the handler to the root logger.

    A number of optional keyword arguments may be specified, which can alter
    the default behaviour.

    filename  Specifies that a FileHandler be created, using the specified
              filename, rather than a StreamHandler.
    filemode  Specifies the mode to open the file, if filename is specified
              (if filemode is unspecified, it defaults to 'a').
    format    Use the specified format string for the handler.
    datefmt   Use the specified date/time format.
    style     If a format string is specified, use this to specify the
              type of format string (possible values '%', '{', '$', for
              %-formatting, :meth:`str.format` and :class:`string.Template`
              - defaults to '%').
    level     Set the root logger level to the specified level.
    stream    Use the specified stream to initialize the StreamHandler. Note
              that this argument is incompatible with 'filename' - if both
              are present, 'stream' is ignored.
    handlers  If specified, this should be an iterable of already created
              handlers, which will be added to the root handler. Any handler
              in the list which does not have a formatter assigned will be
              assigned the formatter created in this function.
    force     If this keyword  is specified as true, any existing handlers
              attached to the root logger are removed and closed, before
              carrying out the configuration as specified by the other
              arguments.
    Note that you could specify a stream created using open(filename, mode)
    rather than passing the filename and mode in. However, it should be
    remembered that StreamHandler does not close its stream (since it may be
    using sys.stdout or sys.stderr), whereas FileHandler closes its stream
    when the handler is closed.

    .. versionchanged:: 3.8
       Added the ``force`` parameter.

    .. versionchanged:: 3.2
       Added the ``style`` parameter.

    .. versionchanged:: 3.3
       Added the ``handlers`` parameter. A ``ValueError`` is now thrown for
       incompatible arguments (e.g. ``handlers`` specified together with
       ``filename``/``filemode``, or ``filename``/``filemode`` specified
       together with ``stream``, or ``handlers`` specified together with
       ``stream``.
    �forceFNrr�rrnz8'stream' and 'filename' should not be specified togetherzG'stream' or 'filename' should not be specified together with 'handlers'�filemoderr�r�r�r�r�r�r_r5z, zUnrecognised argument(s): %s)r9r:�popr/r�rkr�rdrIr
rr�r�r�rr�rrjr)
r�rw�hr�rnrrZdfsr�Zfsr�r5r�r7r7r8rtsR;



�


cCs|rtj�|�StSdS)z�
    Return a logger with the specified name, creating it if necessary.

    If no name is specified, return the root logger.
    N)rr7r r/)rbr7r7r8r �scOs*ttj�dkrt�tj|f|�|�dS)z�
    Log a message with severity 'CRITICAL' on the root logger. If the logger
    has no handlers, call basicConfig() to add a console handler with a
    pre-defined format.
    rN)rdr/r�rr�rcrhr�r7r7r8r�scOs*ttj�dkrt�tj|f|�|�dS)z�
    Log a message with severity 'ERROR' on the root logger. If the logger has
    no handlers, call basicConfig() to add a console handler with a pre-defined
    format.
    rN)rdr/r�rrr{r7r7r8r�srQcOst|f|�d|i|��dS)z�
    Log a message with severity 'ERROR' on the root logger, with exception
    information. If the logger has no handlers, basicConfig() is called to add
    a console handler with a pre-defined format.
    rBNrR)rcrBrhr�r7r7r8rscOs*ttj�dkrt�tj|f|�|�dS)z�
    Log a message with severity 'WARNING' on the root logger. If the logger has
    no handlers, call basicConfig() to add a console handler with a pre-defined
    format.
    rN)rdr/r�rr(r{r7r7r8r(scOs"t�dtd�t|f|�|�dS)Nz8The 'warn' function is deprecated, use 'warning' insteadr@rNr{r7r7r8r's
�cOs*ttj�dkrt�tj|f|�|�dS)z�
    Log a message with severity 'INFO' on the root logger. If the logger has
    no handlers, call basicConfig() to add a console handler with a pre-defined
    format.
    rN)rdr/r�rr"r{r7r7r8r"scOs*ttj�dkrt�tj|f|�|�dS)z�
    Log a message with severity 'DEBUG' on the root logger. If the logger has
    no handlers, call basicConfig() to add a console handler with a pre-defined
    format.
    rN)rdr/r�rrr{r7r7r8r$scOs,ttj�dkrt�tj||f|�|�dS)z�
    Log 'msg % args' with the integer severity 'level' on the root logger. If
    the logger has no handlers, call basicConfig() to add a console handler
    with a pre-defined format.
    rN)rdr/r�rr#)r5rcrhr�r7r7r8r#.scCs|tj_tj��dS)zB
    Disable all logging calls of severity 'level' and below.
    N)r/r7rrF)r5r7r7r8r8sc
Cs�t|dd��D]l}zT|�}|rfz:z|��|��|��Wnttfk
rVYnXW5|��XWqtrv�YqXqdS)z�
    Perform any cleanup actions in the logging system (e.g. flushing
    buffers).

    Should be called at application exit.
    N)�reversedrOrNrr�rrIr,)ZhandlerListr�rzr7r7r8r&?s
c@s(eZdZdZdd�Zdd�Zdd�ZdS)	ra�
    This handler does nothing. It's intended to be used to avoid the
    "No handlers could be found for logger XXX" one-off warning. This is
    important for library code, which may contain code to log events. If a user
    of the library does not configure logging, the one-off warning might be
    produced; to avoid this, the library developer simply needs to instantiate
    a NullHandler and add it to the top-level logger of the library module or
    package.
    cCsdS�zStub.Nr7r�r7r7r8rmszNullHandler.handlecCsdSr}r7r�r7r7r8rpszNullHandler.emitcCs
d|_dSrQ)rr�r7r7r8rYsszNullHandler.createLockN)r�r�r�r�rrrYr7r7r7r8rcs	cCs`|dk	r$tdk	r\t||||||�n8t�|||||�}td�}|jsP|�t��|�d|�dS)a�
    Implementation of showwarnings which redirects to logging, which will first
    check to see if the file parameter is None. If a file is specified, it will
    delegate to the original warnings implementation of showwarning. Otherwise,
    it will call warnings.formatwarning and will log the resulting string to a
    warnings logger named "py.warnings" with level logging.WARNING.
    Nzpy.warningsz%s)�_warnings_showwarningrO�
formatwarningr r�rjrr()r��categoryrnrtrX�liner�rEr7r7r8�_showwarningzsr�cCs0|rtdkr,tjatt_ntdk	r,tt_dadS)z�
    If capture is true, redirect all warnings to the logging package.
    If capture is False, ensure that warnings are not redirected to logging
    but to their original destinations.
    N)r~rO�showwarningr�)Zcapturer7r7r8r�s)N)NN)or�r=rkrar�r�r�rOr�Zcollections.abcre�stringrrZStrFormatter�__all__ry�
__author__Z
__status__�__version__Z__date__rwr,rxr|r~rr	rrrr
rrr2r4rrrrErlrW�__code__r
rXrLr�rMr9r:rTZWeakSetrUr^rP�objectrr�r*r)r$r�r�r�r�rr�r�rrr�ZWeakValueDictionaryr�r�r�r�rrr
r$Z_defaultLastResortr+r%r%r!r.rrtr,rr/r7rr rrrrr(r'r"rr#rr&�atexit�registerrr~r�rr7r7r7r8�<module>sN	H
�
	
�	�

	

�	g
�1*%4
>SE
d
n








imghdr.py000064400000007340151153537460006406 0ustar00"""Recognize image file formats based on their first few bytes."""

from os import PathLike

__all__ = ["what"]

#-------------------------#
# Recognize image headers #
#-------------------------#

def what(file, h=None):
    f = None
    try:
        if h is None:
            if isinstance(file, (str, PathLike)):
                f = open(file, 'rb')
                h = f.read(32)
            else:
                location = file.tell()
                h = file.read(32)
                file.seek(location)
        for tf in tests:
            res = tf(h, f)
            if res:
                return res
    finally:
        if f: f.close()
    return None


#---------------------------------#
# Subroutines per image file type #
#---------------------------------#

tests = []

def test_jpeg(h, f):
    """JPEG data in JFIF or Exif format"""
    if h[6:10] in (b'JFIF', b'Exif'):
        return 'jpeg'

tests.append(test_jpeg)

def test_png(h, f):
    if h.startswith(b'\211PNG\r\n\032\n'):
        return 'png'

tests.append(test_png)

def test_gif(h, f):
    """GIF ('87 and '89 variants)"""
    if h[:6] in (b'GIF87a', b'GIF89a'):
        return 'gif'

tests.append(test_gif)

def test_tiff(h, f):
    """TIFF (can be in Motorola or Intel byte order)"""
    if h[:2] in (b'MM', b'II'):
        return 'tiff'

tests.append(test_tiff)

def test_rgb(h, f):
    """SGI image library"""
    if h.startswith(b'\001\332'):
        return 'rgb'

tests.append(test_rgb)

def test_pbm(h, f):
    """PBM (portable bitmap)"""
    if len(h) >= 3 and \
        h[0] == ord(b'P') and h[1] in b'14' and h[2] in b' \t\n\r':
        return 'pbm'

tests.append(test_pbm)

def test_pgm(h, f):
    """PGM (portable graymap)"""
    if len(h) >= 3 and \
        h[0] == ord(b'P') and h[1] in b'25' and h[2] in b' \t\n\r':
        return 'pgm'

tests.append(test_pgm)

def test_ppm(h, f):
    """PPM (portable pixmap)"""
    if len(h) >= 3 and \
        h[0] == ord(b'P') and h[1] in b'36' and h[2] in b' \t\n\r':
        return 'ppm'

tests.append(test_ppm)

def test_rast(h, f):
    """Sun raster file"""
    if h.startswith(b'\x59\xA6\x6A\x95'):
        return 'rast'

tests.append(test_rast)

def test_xbm(h, f):
    """X bitmap (X10 or X11)"""
    if h.startswith(b'#define '):
        return 'xbm'

tests.append(test_xbm)

def test_bmp(h, f):
    if h.startswith(b'BM'):
        return 'bmp'

tests.append(test_bmp)

def test_webp(h, f):
    if h.startswith(b'RIFF') and h[8:12] == b'WEBP':
        return 'webp'

tests.append(test_webp)

def test_exr(h, f):
    if h.startswith(b'\x76\x2f\x31\x01'):
        return 'exr'

tests.append(test_exr)

#--------------------#
# Small test program #
#--------------------#

def test():
    import sys
    recursive = 0
    if sys.argv[1:] and sys.argv[1] == '-r':
        del sys.argv[1:2]
        recursive = 1
    try:
        if sys.argv[1:]:
            testall(sys.argv[1:], recursive, 1)
        else:
            testall(['.'], recursive, 1)
    except KeyboardInterrupt:
        sys.stderr.write('\n[Interrupted]\n')
        sys.exit(1)

def testall(list, recursive, toplevel):
    import sys
    import os
    for filename in list:
        if os.path.isdir(filename):
            print(filename + '/:', end=' ')
            if recursive or toplevel:
                print('recursing down:')
                import glob
                names = glob.glob(os.path.join(glob.escape(filename), '*'))
                testall(names, recursive, 0)
            else:
                print('*** directory (use -r) ***')
        else:
            print(filename + ':', end=' ')
            sys.stdout.flush()
            try:
                print(what(filename))
            except OSError:
                print('*** not found ***')

if __name__ == '__main__':
    test()
re.py000064400000036765151153537460005557 0ustar00#
# Secret Labs' Regular Expression Engine
#
# re-compatible interface for the sre matching engine
#
# Copyright (c) 1998-2001 by Secret Labs AB.  All rights reserved.
#
# This version of the SRE library can be redistributed under CNRI's
# Python 1.6 license.  For any other use, please contact Secret Labs
# AB (info@pythonware.com).
#
# Portions of this engine have been developed in cooperation with
# CNRI.  Hewlett-Packard provided funding for 1.6 integration and
# other compatibility work.
#

r"""Support for regular expressions (RE).

This module provides regular expression matching operations similar to
those found in Perl.  It supports both 8-bit and Unicode strings; both
the pattern and the strings being processed can contain null bytes and
characters outside the US ASCII range.

Regular expressions can contain both special and ordinary characters.
Most ordinary characters, like "A", "a", or "0", are the simplest
regular expressions; they simply match themselves.  You can
concatenate ordinary characters, so last matches the string 'last'.

The special characters are:
    "."      Matches any character except a newline.
    "^"      Matches the start of the string.
    "$"      Matches the end of the string or just before the newline at
             the end of the string.
    "*"      Matches 0 or more (greedy) repetitions of the preceding RE.
             Greedy means that it will match as many repetitions as possible.
    "+"      Matches 1 or more (greedy) repetitions of the preceding RE.
    "?"      Matches 0 or 1 (greedy) of the preceding RE.
    *?,+?,?? Non-greedy versions of the previous three special characters.
    {m,n}    Matches from m to n repetitions of the preceding RE.
    {m,n}?   Non-greedy version of the above.
    "\\"     Either escapes special characters or signals a special sequence.
    []       Indicates a set of characters.
             A "^" as the first character indicates a complementing set.
    "|"      A|B, creates an RE that will match either A or B.
    (...)    Matches the RE inside the parentheses.
             The contents can be retrieved or matched later in the string.
    (?aiLmsux) The letters set the corresponding flags defined below.
    (?:...)  Non-grouping version of regular parentheses.
    (?P<name>...) The substring matched by the group is accessible by name.
    (?P=name)     Matches the text matched earlier by the group named name.
    (?#...)  A comment; ignored.
    (?=...)  Matches if ... matches next, but doesn't consume the string.
    (?!...)  Matches if ... doesn't match next.
    (?<=...) Matches if preceded by ... (must be fixed length).
    (?<!...) Matches if not preceded by ... (must be fixed length).
    (?(id/name)yes|no) Matches yes pattern if the group with id/name matched,
                       the (optional) no pattern otherwise.

The special sequences consist of "\\" and a character from the list
below.  If the ordinary character is not on the list, then the
resulting RE will match the second character.
    \number  Matches the contents of the group of the same number.
    \A       Matches only at the start of the string.
    \Z       Matches only at the end of the string.
    \b       Matches the empty string, but only at the start or end of a word.
    \B       Matches the empty string, but not at the start or end of a word.
    \d       Matches any decimal digit; equivalent to the set [0-9] in
             bytes patterns or string patterns with the ASCII flag.
             In string patterns without the ASCII flag, it will match the whole
             range of Unicode digits.
    \D       Matches any non-digit character; equivalent to [^\d].
    \s       Matches any whitespace character; equivalent to [ \t\n\r\f\v] in
             bytes patterns or string patterns with the ASCII flag.
             In string patterns without the ASCII flag, it will match the whole
             range of Unicode whitespace characters.
    \S       Matches any non-whitespace character; equivalent to [^\s].
    \w       Matches any alphanumeric character; equivalent to [a-zA-Z0-9_]
             in bytes patterns or string patterns with the ASCII flag.
             In string patterns without the ASCII flag, it will match the
             range of Unicode alphanumeric characters (letters plus digits
             plus underscore).
             With LOCALE, it will match the set [0-9_] plus characters defined
             as letters for the current locale.
    \W       Matches the complement of \w.
    \\       Matches a literal backslash.

This module exports the following functions:
    match     Match a regular expression pattern to the beginning of a string.
    fullmatch Match a regular expression pattern to all of a string.
    search    Search a string for the presence of a pattern.
    sub       Substitute occurrences of a pattern found in a string.
    subn      Same as sub, but also return the number of substitutions made.
    split     Split a string by the occurrences of a pattern.
    findall   Find all occurrences of a pattern in a string.
    finditer  Return an iterator yielding a Match object for each match.
    compile   Compile a pattern into a Pattern object.
    purge     Clear the regular expression cache.
    escape    Backslash all non-alphanumerics in a string.

Each function other than purge and escape can take an optional 'flags' argument
consisting of one or more of the following module constants, joined by "|".
A, L, and U are mutually exclusive.
    A  ASCII       For string patterns, make \w, \W, \b, \B, \d, \D
                   match the corresponding ASCII character categories
                   (rather than the whole Unicode categories, which is the
                   default).
                   For bytes patterns, this flag is the only available
                   behaviour and needn't be specified.
    I  IGNORECASE  Perform case-insensitive matching.
    L  LOCALE      Make \w, \W, \b, \B, dependent on the current locale.
    M  MULTILINE   "^" matches the beginning of lines (after a newline)
                   as well as the string.
                   "$" matches the end of lines (before a newline) as well
                   as the end of the string.
    S  DOTALL      "." matches any character at all, including the newline.
    X  VERBOSE     Ignore whitespace and comments for nicer looking RE's.
    U  UNICODE     For compatibility only. Ignored for string patterns (it
                   is the default), and forbidden for bytes patterns.

This module also defines an exception 'error'.

"""

import enum
import sre_compile
import sre_parse
import functools
try:
    import _locale
except ImportError:
    _locale = None


# public symbols
__all__ = [
    "match", "fullmatch", "search", "sub", "subn", "split",
    "findall", "finditer", "compile", "purge", "template", "escape",
    "error", "Pattern", "Match", "A", "I", "L", "M", "S", "X", "U",
    "ASCII", "IGNORECASE", "LOCALE", "MULTILINE", "DOTALL", "VERBOSE",
    "UNICODE",
]

__version__ = "2.2.1"

class RegexFlag(enum.IntFlag):
    ASCII = A = sre_compile.SRE_FLAG_ASCII # assume ascii "locale"
    IGNORECASE = I = sre_compile.SRE_FLAG_IGNORECASE # ignore case
    LOCALE = L = sre_compile.SRE_FLAG_LOCALE # assume current 8-bit locale
    UNICODE = U = sre_compile.SRE_FLAG_UNICODE # assume unicode "locale"
    MULTILINE = M = sre_compile.SRE_FLAG_MULTILINE # make anchors look for newline
    DOTALL = S = sre_compile.SRE_FLAG_DOTALL # make dot match newline
    VERBOSE = X = sre_compile.SRE_FLAG_VERBOSE # ignore whitespace and comments
    # sre extensions (experimental, don't rely on these)
    TEMPLATE = T = sre_compile.SRE_FLAG_TEMPLATE # disable backtracking
    DEBUG = sre_compile.SRE_FLAG_DEBUG # dump pattern after compilation

    def __repr__(self):
        if self._name_ is not None:
            return f're.{self._name_}'
        value = self._value_
        members = []
        negative = value < 0
        if negative:
            value = ~value
        for m in self.__class__:
            if value & m._value_:
                value &= ~m._value_
                members.append(f're.{m._name_}')
        if value:
            members.append(hex(value))
        res = '|'.join(members)
        if negative:
            if len(members) > 1:
                res = f'~({res})'
            else:
                res = f'~{res}'
        return res
    __str__ = object.__str__

globals().update(RegexFlag.__members__)

# sre exception
error = sre_compile.error

# --------------------------------------------------------------------
# public interface

def match(pattern, string, flags=0):
    """Try to apply the pattern at the start of the string, returning
    a Match object, or None if no match was found."""
    return _compile(pattern, flags).match(string)

def fullmatch(pattern, string, flags=0):
    """Try to apply the pattern to all of the string, returning
    a Match object, or None if no match was found."""
    return _compile(pattern, flags).fullmatch(string)

def search(pattern, string, flags=0):
    """Scan through string looking for a match to the pattern, returning
    a Match object, or None if no match was found."""
    return _compile(pattern, flags).search(string)

def sub(pattern, repl, string, count=0, flags=0):
    """Return the string obtained by replacing the leftmost
    non-overlapping occurrences of the pattern in string by the
    replacement repl.  repl can be either a string or a callable;
    if a string, backslash escapes in it are processed.  If it is
    a callable, it's passed the Match object and must return
    a replacement string to be used."""
    return _compile(pattern, flags).sub(repl, string, count)

def subn(pattern, repl, string, count=0, flags=0):
    """Return a 2-tuple containing (new_string, number).
    new_string is the string obtained by replacing the leftmost
    non-overlapping occurrences of the pattern in the source
    string by the replacement repl.  number is the number of
    substitutions that were made. repl can be either a string or a
    callable; if a string, backslash escapes in it are processed.
    If it is a callable, it's passed the Match object and must
    return a replacement string to be used."""
    return _compile(pattern, flags).subn(repl, string, count)

def split(pattern, string, maxsplit=0, flags=0):
    """Split the source string by the occurrences of the pattern,
    returning a list containing the resulting substrings.  If
    capturing parentheses are used in pattern, then the text of all
    groups in the pattern are also returned as part of the resulting
    list.  If maxsplit is nonzero, at most maxsplit splits occur,
    and the remainder of the string is returned as the final element
    of the list."""
    return _compile(pattern, flags).split(string, maxsplit)

def findall(pattern, string, flags=0):
    """Return a list of all non-overlapping matches in the string.

    If one or more capturing groups are present in the pattern, return
    a list of groups; this will be a list of tuples if the pattern
    has more than one group.

    Empty matches are included in the result."""
    return _compile(pattern, flags).findall(string)

def finditer(pattern, string, flags=0):
    """Return an iterator over all non-overlapping matches in the
    string.  For each match, the iterator returns a Match object.

    Empty matches are included in the result."""
    return _compile(pattern, flags).finditer(string)

def compile(pattern, flags=0):
    "Compile a regular expression pattern, returning a Pattern object."
    return _compile(pattern, flags)

def purge():
    "Clear the regular expression caches"
    _cache.clear()
    _compile_repl.cache_clear()

def template(pattern, flags=0):
    "Compile a template pattern, returning a Pattern object"
    return _compile(pattern, flags|T)

# SPECIAL_CHARS
# closing ')', '}' and ']'
# '-' (a range in character set)
# '&', '~', (extended character set operations)
# '#' (comment) and WHITESPACE (ignored) in verbose mode
_special_chars_map = {i: '\\' + chr(i) for i in b'()[]{}?*+-|^$\\.&~# \t\n\r\v\f'}

def escape(pattern):
    """
    Escape special characters in a string.
    """
    if isinstance(pattern, str):
        return pattern.translate(_special_chars_map)
    else:
        pattern = str(pattern, 'latin1')
        return pattern.translate(_special_chars_map).encode('latin1')

Pattern = type(sre_compile.compile('', 0))
Match = type(sre_compile.compile('', 0).match(''))

# --------------------------------------------------------------------
# internals

_cache = {}  # ordered!

_MAXCACHE = 512
def _compile(pattern, flags):
    # internal: compile pattern
    if isinstance(flags, RegexFlag):
        flags = flags.value
    try:
        return _cache[type(pattern), pattern, flags]
    except KeyError:
        pass
    if isinstance(pattern, Pattern):
        if flags:
            raise ValueError(
                "cannot process flags argument with a compiled pattern")
        return pattern
    if not sre_compile.isstring(pattern):
        raise TypeError("first argument must be string or compiled pattern")
    p = sre_compile.compile(pattern, flags)
    if not (flags & DEBUG):
        if len(_cache) >= _MAXCACHE:
            # Drop the oldest item
            try:
                del _cache[next(iter(_cache))]
            except (StopIteration, RuntimeError, KeyError):
                pass
        _cache[type(pattern), pattern, flags] = p
    return p

@functools.lru_cache(_MAXCACHE)
def _compile_repl(repl, pattern):
    # internal: compile replacement pattern
    return sre_parse.parse_template(repl, pattern)

def _expand(pattern, match, template):
    # internal: Match.expand implementation hook
    template = sre_parse.parse_template(template, pattern)
    return sre_parse.expand_template(template, match)

def _subx(pattern, template):
    # internal: Pattern.sub/subn implementation helper
    template = _compile_repl(template, pattern)
    if not template[0] and len(template[1]) == 1:
        # literal replacement
        return template[1][0]
    def filter(match, template=template):
        return sre_parse.expand_template(template, match)
    return filter

# register myself for pickling

import copyreg

def _pickle(p):
    return _compile, (p.pattern, p.flags)

copyreg.pickle(Pattern, _pickle, _compile)

# --------------------------------------------------------------------
# experimental stuff (see python-dev discussions for details)

class Scanner:
    def __init__(self, lexicon, flags=0):
        from sre_constants import BRANCH, SUBPATTERN
        if isinstance(flags, RegexFlag):
            flags = flags.value
        self.lexicon = lexicon
        # combine phrases into a compound pattern
        p = []
        s = sre_parse.State()
        s.flags = flags
        for phrase, action in lexicon:
            gid = s.opengroup()
            p.append(sre_parse.SubPattern(s, [
                (SUBPATTERN, (gid, 0, 0, sre_parse.parse(phrase, flags))),
                ]))
            s.closegroup(gid, p[-1])
        p = sre_parse.SubPattern(s, [(BRANCH, (None, p))])
        self.scanner = sre_compile.compile(p)
    def scan(self, string):
        result = []
        append = result.append
        match = self.scanner.scanner(string).match
        i = 0
        while True:
            m = match()
            if not m:
                break
            j = m.end()
            if i == j:
                break
            action = self.lexicon[m.lastindex-1][1]
            if callable(action):
                self.match = m
                action = action(self, m.group())
            if action is not None:
                append(action)
            i = j
        return result, string[i:]
statistics.py000064400000115412151153537460007326 0ustar00"""
Basic statistics module.

This module provides functions for calculating statistics of data, including
averages, variance, and standard deviation.

Calculating averages
--------------------

==================  ==================================================
Function            Description
==================  ==================================================
mean                Arithmetic mean (average) of data.
fmean               Fast, floating point arithmetic mean.
geometric_mean      Geometric mean of data.
harmonic_mean       Harmonic mean of data.
median              Median (middle value) of data.
median_low          Low median of data.
median_high         High median of data.
median_grouped      Median, or 50th percentile, of grouped data.
mode                Mode (most common value) of data.
multimode           List of modes (most common values of data).
quantiles           Divide data into intervals with equal probability.
==================  ==================================================

Calculate the arithmetic mean ("the average") of data:

>>> mean([-1.0, 2.5, 3.25, 5.75])
2.625


Calculate the standard median of discrete data:

>>> median([2, 3, 4, 5])
3.5


Calculate the median, or 50th percentile, of data grouped into class intervals
centred on the data values provided. E.g. if your data points are rounded to
the nearest whole number:

>>> median_grouped([2, 2, 3, 3, 3, 4])  #doctest: +ELLIPSIS
2.8333333333...

This should be interpreted in this way: you have two data points in the class
interval 1.5-2.5, three data points in the class interval 2.5-3.5, and one in
the class interval 3.5-4.5. The median of these data points is 2.8333...


Calculating variability or spread
---------------------------------

==================  =============================================
Function            Description
==================  =============================================
pvariance           Population variance of data.
variance            Sample variance of data.
pstdev              Population standard deviation of data.
stdev               Sample standard deviation of data.
==================  =============================================

Calculate the standard deviation of sample data:

>>> stdev([2.5, 3.25, 5.5, 11.25, 11.75])  #doctest: +ELLIPSIS
4.38961843444...

If you have previously calculated the mean, you can pass it as the optional
second argument to the four "spread" functions to avoid recalculating it:

>>> data = [1, 2, 2, 4, 4, 4, 5, 6]
>>> mu = mean(data)
>>> pvariance(data, mu)
2.5


Exceptions
----------

A single exception is defined: StatisticsError is a subclass of ValueError.

"""

__all__ = [
    'NormalDist',
    'StatisticsError',
    'fmean',
    'geometric_mean',
    'harmonic_mean',
    'mean',
    'median',
    'median_grouped',
    'median_high',
    'median_low',
    'mode',
    'multimode',
    'pstdev',
    'pvariance',
    'quantiles',
    'stdev',
    'variance',
]

import math
import numbers
import random

from fractions import Fraction
from decimal import Decimal
from itertools import groupby
from bisect import bisect_left, bisect_right
from math import hypot, sqrt, fabs, exp, erf, tau, log, fsum
from operator import itemgetter
from collections import Counter

# === Exceptions ===

class StatisticsError(ValueError):
    pass


# === Private utilities ===

def _sum(data, start=0):
    """_sum(data [, start]) -> (type, sum, count)

    Return a high-precision sum of the given numeric data as a fraction,
    together with the type to be converted to and the count of items.

    If optional argument ``start`` is given, it is added to the total.
    If ``data`` is empty, ``start`` (defaulting to 0) is returned.


    Examples
    --------

    >>> _sum([3, 2.25, 4.5, -0.5, 1.0], 0.75)
    (<class 'float'>, Fraction(11, 1), 5)

    Some sources of round-off error will be avoided:

    # Built-in sum returns zero.
    >>> _sum([1e50, 1, -1e50] * 1000)
    (<class 'float'>, Fraction(1000, 1), 3000)

    Fractions and Decimals are also supported:

    >>> from fractions import Fraction as F
    >>> _sum([F(2, 3), F(7, 5), F(1, 4), F(5, 6)])
    (<class 'fractions.Fraction'>, Fraction(63, 20), 4)

    >>> from decimal import Decimal as D
    >>> data = [D("0.1375"), D("0.2108"), D("0.3061"), D("0.0419")]
    >>> _sum(data)
    (<class 'decimal.Decimal'>, Fraction(6963, 10000), 4)

    Mixed types are currently treated as an error, except that int is
    allowed.
    """
    count = 0
    n, d = _exact_ratio(start)
    partials = {d: n}
    partials_get = partials.get
    T = _coerce(int, type(start))
    for typ, values in groupby(data, type):
        T = _coerce(T, typ)  # or raise TypeError
        for n,d in map(_exact_ratio, values):
            count += 1
            partials[d] = partials_get(d, 0) + n
    if None in partials:
        # The sum will be a NAN or INF. We can ignore all the finite
        # partials, and just look at this special one.
        total = partials[None]
        assert not _isfinite(total)
    else:
        # Sum all the partial sums using builtin sum.
        # FIXME is this faster if we sum them in order of the denominator?
        total = sum(Fraction(n, d) for d, n in sorted(partials.items()))
    return (T, total, count)


def _isfinite(x):
    try:
        return x.is_finite()  # Likely a Decimal.
    except AttributeError:
        return math.isfinite(x)  # Coerces to float first.


def _coerce(T, S):
    """Coerce types T and S to a common type, or raise TypeError.

    Coercion rules are currently an implementation detail. See the CoerceTest
    test class in test_statistics for details.
    """
    # See http://bugs.python.org/issue24068.
    assert T is not bool, "initial type T is bool"
    # If the types are the same, no need to coerce anything. Put this
    # first, so that the usual case (no coercion needed) happens as soon
    # as possible.
    if T is S:  return T
    # Mixed int & other coerce to the other type.
    if S is int or S is bool:  return T
    if T is int:  return S
    # If one is a (strict) subclass of the other, coerce to the subclass.
    if issubclass(S, T):  return S
    if issubclass(T, S):  return T
    # Ints coerce to the other type.
    if issubclass(T, int):  return S
    if issubclass(S, int):  return T
    # Mixed fraction & float coerces to float (or float subclass).
    if issubclass(T, Fraction) and issubclass(S, float):
        return S
    if issubclass(T, float) and issubclass(S, Fraction):
        return T
    # Any other combination is disallowed.
    msg = "don't know how to coerce %s and %s"
    raise TypeError(msg % (T.__name__, S.__name__))


def _exact_ratio(x):
    """Return Real number x to exact (numerator, denominator) pair.

    >>> _exact_ratio(0.25)
    (1, 4)

    x is expected to be an int, Fraction, Decimal or float.
    """
    try:
        # Optimise the common case of floats. We expect that the most often
        # used numeric type will be builtin floats, so try to make this as
        # fast as possible.
        if type(x) is float or type(x) is Decimal:
            return x.as_integer_ratio()
        try:
            # x may be an int, Fraction, or Integral ABC.
            return (x.numerator, x.denominator)
        except AttributeError:
            try:
                # x may be a float or Decimal subclass.
                return x.as_integer_ratio()
            except AttributeError:
                # Just give up?
                pass
    except (OverflowError, ValueError):
        # float NAN or INF.
        assert not _isfinite(x)
        return (x, None)
    msg = "can't convert type '{}' to numerator/denominator"
    raise TypeError(msg.format(type(x).__name__))


def _convert(value, T):
    """Convert value to given numeric type T."""
    if type(value) is T:
        # This covers the cases where T is Fraction, or where value is
        # a NAN or INF (Decimal or float).
        return value
    if issubclass(T, int) and value.denominator != 1:
        T = float
    try:
        # FIXME: what do we do if this overflows?
        return T(value)
    except TypeError:
        if issubclass(T, Decimal):
            return T(value.numerator)/T(value.denominator)
        else:
            raise


def _find_lteq(a, x):
    'Locate the leftmost value exactly equal to x'
    i = bisect_left(a, x)
    if i != len(a) and a[i] == x:
        return i
    raise ValueError


def _find_rteq(a, l, x):
    'Locate the rightmost value exactly equal to x'
    i = bisect_right(a, x, lo=l)
    if i != (len(a)+1) and a[i-1] == x:
        return i-1
    raise ValueError


def _fail_neg(values, errmsg='negative value'):
    """Iterate over values, failing if any are less than zero."""
    for x in values:
        if x < 0:
            raise StatisticsError(errmsg)
        yield x


# === Measures of central tendency (averages) ===

def mean(data):
    """Return the sample arithmetic mean of data.

    >>> mean([1, 2, 3, 4, 4])
    2.8

    >>> from fractions import Fraction as F
    >>> mean([F(3, 7), F(1, 21), F(5, 3), F(1, 3)])
    Fraction(13, 21)

    >>> from decimal import Decimal as D
    >>> mean([D("0.5"), D("0.75"), D("0.625"), D("0.375")])
    Decimal('0.5625')

    If ``data`` is empty, StatisticsError will be raised.
    """
    if iter(data) is data:
        data = list(data)
    n = len(data)
    if n < 1:
        raise StatisticsError('mean requires at least one data point')
    T, total, count = _sum(data)
    assert count == n
    return _convert(total/n, T)


def fmean(data):
    """Convert data to floats and compute the arithmetic mean.

    This runs faster than the mean() function and it always returns a float.
    If the input dataset is empty, it raises a StatisticsError.

    >>> fmean([3.5, 4.0, 5.25])
    4.25
    """
    try:
        n = len(data)
    except TypeError:
        # Handle iterators that do not define __len__().
        n = 0
        def count(iterable):
            nonlocal n
            for n, x in enumerate(iterable, start=1):
                yield x
        total = fsum(count(data))
    else:
        total = fsum(data)
    try:
        return total / n
    except ZeroDivisionError:
        raise StatisticsError('fmean requires at least one data point') from None


def geometric_mean(data):
    """Convert data to floats and compute the geometric mean.

    Raises a StatisticsError if the input dataset is empty,
    if it contains a zero, or if it contains a negative value.

    No special efforts are made to achieve exact results.
    (However, this may change in the future.)

    >>> round(geometric_mean([54, 24, 36]), 9)
    36.0
    """
    try:
        return exp(fmean(map(log, data)))
    except ValueError:
        raise StatisticsError('geometric mean requires a non-empty dataset '
                              ' containing positive numbers') from None


def harmonic_mean(data):
    """Return the harmonic mean of data.

    The harmonic mean, sometimes called the subcontrary mean, is the
    reciprocal of the arithmetic mean of the reciprocals of the data,
    and is often appropriate when averaging quantities which are rates
    or ratios, for example speeds. Example:

    Suppose an investor purchases an equal value of shares in each of
    three companies, with P/E (price/earning) ratios of 2.5, 3 and 10.
    What is the average P/E ratio for the investor's portfolio?

    >>> harmonic_mean([2.5, 3, 10])  # For an equal investment portfolio.
    3.6

    Using the arithmetic mean would give an average of about 5.167, which
    is too high.

    If ``data`` is empty, or any element is less than zero,
    ``harmonic_mean`` will raise ``StatisticsError``.
    """
    # For a justification for using harmonic mean for P/E ratios, see
    # http://fixthepitch.pellucid.com/comps-analysis-the-missing-harmony-of-summary-statistics/
    # http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2621087
    if iter(data) is data:
        data = list(data)
    errmsg = 'harmonic mean does not support negative values'
    n = len(data)
    if n < 1:
        raise StatisticsError('harmonic_mean requires at least one data point')
    elif n == 1:
        x = data[0]
        if isinstance(x, (numbers.Real, Decimal)):
            if x < 0:
                raise StatisticsError(errmsg)
            return x
        else:
            raise TypeError('unsupported type')
    try:
        T, total, count = _sum(1/x for x in _fail_neg(data, errmsg))
    except ZeroDivisionError:
        return 0
    assert count == n
    return _convert(n/total, T)


# FIXME: investigate ways to calculate medians without sorting? Quickselect?
def median(data):
    """Return the median (middle value) of numeric data.

    When the number of data points is odd, return the middle data point.
    When the number of data points is even, the median is interpolated by
    taking the average of the two middle values:

    >>> median([1, 3, 5])
    3
    >>> median([1, 3, 5, 7])
    4.0

    """
    data = sorted(data)
    n = len(data)
    if n == 0:
        raise StatisticsError("no median for empty data")
    if n%2 == 1:
        return data[n//2]
    else:
        i = n//2
        return (data[i - 1] + data[i])/2


def median_low(data):
    """Return the low median of numeric data.

    When the number of data points is odd, the middle value is returned.
    When it is even, the smaller of the two middle values is returned.

    >>> median_low([1, 3, 5])
    3
    >>> median_low([1, 3, 5, 7])
    3

    """
    data = sorted(data)
    n = len(data)
    if n == 0:
        raise StatisticsError("no median for empty data")
    if n%2 == 1:
        return data[n//2]
    else:
        return data[n//2 - 1]


def median_high(data):
    """Return the high median of data.

    When the number of data points is odd, the middle value is returned.
    When it is even, the larger of the two middle values is returned.

    >>> median_high([1, 3, 5])
    3
    >>> median_high([1, 3, 5, 7])
    5

    """
    data = sorted(data)
    n = len(data)
    if n == 0:
        raise StatisticsError("no median for empty data")
    return data[n//2]


def median_grouped(data, interval=1):
    """Return the 50th percentile (median) of grouped continuous data.

    >>> median_grouped([1, 2, 2, 3, 4, 4, 4, 4, 4, 5])
    3.7
    >>> median_grouped([52, 52, 53, 54])
    52.5

    This calculates the median as the 50th percentile, and should be
    used when your data is continuous and grouped. In the above example,
    the values 1, 2, 3, etc. actually represent the midpoint of classes
    0.5-1.5, 1.5-2.5, 2.5-3.5, etc. The middle value falls somewhere in
    class 3.5-4.5, and interpolation is used to estimate it.

    Optional argument ``interval`` represents the class interval, and
    defaults to 1. Changing the class interval naturally will change the
    interpolated 50th percentile value:

    >>> median_grouped([1, 3, 3, 5, 7], interval=1)
    3.25
    >>> median_grouped([1, 3, 3, 5, 7], interval=2)
    3.5

    This function does not check whether the data points are at least
    ``interval`` apart.
    """
    data = sorted(data)
    n = len(data)
    if n == 0:
        raise StatisticsError("no median for empty data")
    elif n == 1:
        return data[0]
    # Find the value at the midpoint. Remember this corresponds to the
    # centre of the class interval.
    x = data[n//2]
    for obj in (x, interval):
        if isinstance(obj, (str, bytes)):
            raise TypeError('expected number but got %r' % obj)
    try:
        L = x - interval/2  # The lower limit of the median interval.
    except TypeError:
        # Mixed type. For now we just coerce to float.
        L = float(x) - float(interval)/2

    # Uses bisection search to search for x in data with log(n) time complexity
    # Find the position of leftmost occurrence of x in data
    l1 = _find_lteq(data, x)
    # Find the position of rightmost occurrence of x in data[l1...len(data)]
    # Assuming always l1 <= l2
    l2 = _find_rteq(data, l1, x)
    cf = l1
    f = l2 - l1 + 1
    return L + interval*(n/2 - cf)/f


def mode(data):
    """Return the most common data point from discrete or nominal data.

    ``mode`` assumes discrete data, and returns a single value. This is the
    standard treatment of the mode as commonly taught in schools:

        >>> mode([1, 1, 2, 3, 3, 3, 3, 4])
        3

    This also works with nominal (non-numeric) data:

        >>> mode(["red", "blue", "blue", "red", "green", "red", "red"])
        'red'

    If there are multiple modes with same frequency, return the first one
    encountered:

        >>> mode(['red', 'red', 'green', 'blue', 'blue'])
        'red'

    If *data* is empty, ``mode``, raises StatisticsError.

    """
    data = iter(data)
    pairs = Counter(data).most_common(1)
    try:
        return pairs[0][0]
    except IndexError:
        raise StatisticsError('no mode for empty data') from None


def multimode(data):
    """Return a list of the most frequently occurring values.

    Will return more than one result if there are multiple modes
    or an empty list if *data* is empty.

    >>> multimode('aabbbbbbbbcc')
    ['b']
    >>> multimode('aabbbbccddddeeffffgg')
    ['b', 'd', 'f']
    >>> multimode('')
    []
    """
    counts = Counter(iter(data)).most_common()
    maxcount, mode_items = next(groupby(counts, key=itemgetter(1)), (0, []))
    return list(map(itemgetter(0), mode_items))


# Notes on methods for computing quantiles
# ----------------------------------------
#
# There is no one perfect way to compute quantiles.  Here we offer
# two methods that serve common needs.  Most other packages
# surveyed offered at least one or both of these two, making them
# "standard" in the sense of "widely-adopted and reproducible".
# They are also easy to explain, easy to compute manually, and have
# straight-forward interpretations that aren't surprising.

# The default method is known as "R6", "PERCENTILE.EXC", or "expected
# value of rank order statistics". The alternative method is known as
# "R7", "PERCENTILE.INC", or "mode of rank order statistics".

# For sample data where there is a positive probability for values
# beyond the range of the data, the R6 exclusive method is a
# reasonable choice.  Consider a random sample of nine values from a
# population with a uniform distribution from 0.0 to 100.0.  The
# distribution of the third ranked sample point is described by
# betavariate(alpha=3, beta=7) which has mode=0.250, median=0.286, and
# mean=0.300.  Only the latter (which corresponds with R6) gives the
# desired cut point with 30% of the population falling below that
# value, making it comparable to a result from an inv_cdf() function.
# The R6 exclusive method is also idempotent.

# For describing population data where the end points are known to
# be included in the data, the R7 inclusive method is a reasonable
# choice.  Instead of the mean, it uses the mode of the beta
# distribution for the interior points.  Per Hyndman & Fan, "One nice
# property is that the vertices of Q7(p) divide the range into n - 1
# intervals, and exactly 100p% of the intervals lie to the left of
# Q7(p) and 100(1 - p)% of the intervals lie to the right of Q7(p)."

# If needed, other methods could be added.  However, for now, the
# position is that fewer options make for easier choices and that
# external packages can be used for anything more advanced.

def quantiles(data, *, n=4, method='exclusive'):
    """Divide *data* into *n* continuous intervals with equal probability.

    Returns a list of (n - 1) cut points separating the intervals.

    Set *n* to 4 for quartiles (the default).  Set *n* to 10 for deciles.
    Set *n* to 100 for percentiles which gives the 99 cuts points that
    separate *data* in to 100 equal sized groups.

    The *data* can be any iterable containing sample.
    The cut points are linearly interpolated between data points.

    If *method* is set to *inclusive*, *data* is treated as population
    data.  The minimum value is treated as the 0th percentile and the
    maximum value is treated as the 100th percentile.
    """
    if n < 1:
        raise StatisticsError('n must be at least 1')
    data = sorted(data)
    ld = len(data)
    if ld < 2:
        raise StatisticsError('must have at least two data points')
    if method == 'inclusive':
        m = ld - 1
        result = []
        for i in range(1, n):
            j = i * m // n
            delta = i*m - j*n
            interpolated = (data[j] * (n - delta) + data[j+1] * delta) / n
            result.append(interpolated)
        return result
    if method == 'exclusive':
        m = ld + 1
        result = []
        for i in range(1, n):
            j = i * m // n                               # rescale i to m/n
            j = 1 if j < 1 else ld-1 if j > ld-1 else j  # clamp to 1 .. ld-1
            delta = i*m - j*n                            # exact integer math
            interpolated = (data[j-1] * (n - delta) + data[j] * delta) / n
            result.append(interpolated)
        return result
    raise ValueError(f'Unknown method: {method!r}')


# === Measures of spread ===

# See http://mathworld.wolfram.com/Variance.html
#     http://mathworld.wolfram.com/SampleVariance.html
#     http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
#
# Under no circumstances use the so-called "computational formula for
# variance", as that is only suitable for hand calculations with a small
# amount of low-precision data. It has terrible numeric properties.
#
# See a comparison of three computational methods here:
# http://www.johndcook.com/blog/2008/09/26/comparing-three-methods-of-computing-standard-deviation/

def _ss(data, c=None):
    """Return sum of square deviations of sequence data.

    If ``c`` is None, the mean is calculated in one pass, and the deviations
    from the mean are calculated in a second pass. Otherwise, deviations are
    calculated from ``c`` as given. Use the second case with care, as it can
    lead to garbage results.
    """
    if c is not None:
        T, total, count = _sum((x-c)**2 for x in data)
        return (T, total)
    c = mean(data)
    T, total, count = _sum((x-c)**2 for x in data)
    # The following sum should mathematically equal zero, but due to rounding
    # error may not.
    U, total2, count2 = _sum((x-c) for x in data)
    assert T == U and count == count2
    total -=  total2**2/len(data)
    assert not total < 0, 'negative sum of square deviations: %f' % total
    return (T, total)


def variance(data, xbar=None):
    """Return the sample variance of data.

    data should be an iterable of Real-valued numbers, with at least two
    values. The optional argument xbar, if given, should be the mean of
    the data. If it is missing or None, the mean is automatically calculated.

    Use this function when your data is a sample from a population. To
    calculate the variance from the entire population, see ``pvariance``.

    Examples:

    >>> data = [2.75, 1.75, 1.25, 0.25, 0.5, 1.25, 3.5]
    >>> variance(data)
    1.3720238095238095

    If you have already calculated the mean of your data, you can pass it as
    the optional second argument ``xbar`` to avoid recalculating it:

    >>> m = mean(data)
    >>> variance(data, m)
    1.3720238095238095

    This function does not check that ``xbar`` is actually the mean of
    ``data``. Giving arbitrary values for ``xbar`` may lead to invalid or
    impossible results.

    Decimals and Fractions are supported:

    >>> from decimal import Decimal as D
    >>> variance([D("27.5"), D("30.25"), D("30.25"), D("34.5"), D("41.75")])
    Decimal('31.01875')

    >>> from fractions import Fraction as F
    >>> variance([F(1, 6), F(1, 2), F(5, 3)])
    Fraction(67, 108)

    """
    if iter(data) is data:
        data = list(data)
    n = len(data)
    if n < 2:
        raise StatisticsError('variance requires at least two data points')
    T, ss = _ss(data, xbar)
    return _convert(ss/(n-1), T)


def pvariance(data, mu=None):
    """Return the population variance of ``data``.

    data should be a sequence or iterable of Real-valued numbers, with at least one
    value. The optional argument mu, if given, should be the mean of
    the data. If it is missing or None, the mean is automatically calculated.

    Use this function to calculate the variance from the entire population.
    To estimate the variance from a sample, the ``variance`` function is
    usually a better choice.

    Examples:

    >>> data = [0.0, 0.25, 0.25, 1.25, 1.5, 1.75, 2.75, 3.25]
    >>> pvariance(data)
    1.25

    If you have already calculated the mean of the data, you can pass it as
    the optional second argument to avoid recalculating it:

    >>> mu = mean(data)
    >>> pvariance(data, mu)
    1.25

    Decimals and Fractions are supported:

    >>> from decimal import Decimal as D
    >>> pvariance([D("27.5"), D("30.25"), D("30.25"), D("34.5"), D("41.75")])
    Decimal('24.815')

    >>> from fractions import Fraction as F
    >>> pvariance([F(1, 4), F(5, 4), F(1, 2)])
    Fraction(13, 72)

    """
    if iter(data) is data:
        data = list(data)
    n = len(data)
    if n < 1:
        raise StatisticsError('pvariance requires at least one data point')
    T, ss = _ss(data, mu)
    return _convert(ss/n, T)


def stdev(data, xbar=None):
    """Return the square root of the sample variance.

    See ``variance`` for arguments and other details.

    >>> stdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75])
    1.0810874155219827

    """
    var = variance(data, xbar)
    try:
        return var.sqrt()
    except AttributeError:
        return math.sqrt(var)


def pstdev(data, mu=None):
    """Return the square root of the population variance.

    See ``pvariance`` for arguments and other details.

    >>> pstdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75])
    0.986893273527251

    """
    var = pvariance(data, mu)
    try:
        return var.sqrt()
    except AttributeError:
        return math.sqrt(var)


## Normal Distribution #####################################################


def _normal_dist_inv_cdf(p, mu, sigma):
    # There is no closed-form solution to the inverse CDF for the normal
    # distribution, so we use a rational approximation instead:
    # Wichura, M.J. (1988). "Algorithm AS241: The Percentage Points of the
    # Normal Distribution".  Applied Statistics. Blackwell Publishing. 37
    # (3): 477–484. doi:10.2307/2347330. JSTOR 2347330.
    q = p - 0.5
    if fabs(q) <= 0.425:
        r = 0.180625 - q * q
        # Hash sum: 55.88319_28806_14901_4439
        num = (((((((2.50908_09287_30122_6727e+3 * r +
                     3.34305_75583_58812_8105e+4) * r +
                     6.72657_70927_00870_0853e+4) * r +
                     4.59219_53931_54987_1457e+4) * r +
                     1.37316_93765_50946_1125e+4) * r +
                     1.97159_09503_06551_4427e+3) * r +
                     1.33141_66789_17843_7745e+2) * r +
                     3.38713_28727_96366_6080e+0) * q
        den = (((((((5.22649_52788_52854_5610e+3 * r +
                     2.87290_85735_72194_2674e+4) * r +
                     3.93078_95800_09271_0610e+4) * r +
                     2.12137_94301_58659_5867e+4) * r +
                     5.39419_60214_24751_1077e+3) * r +
                     6.87187_00749_20579_0830e+2) * r +
                     4.23133_30701_60091_1252e+1) * r +
                     1.0)
        x = num / den
        return mu + (x * sigma)
    r = p if q <= 0.0 else 1.0 - p
    r = sqrt(-log(r))
    if r <= 5.0:
        r = r - 1.6
        # Hash sum: 49.33206_50330_16102_89036
        num = (((((((7.74545_01427_83414_07640e-4 * r +
                     2.27238_44989_26918_45833e-2) * r +
                     2.41780_72517_74506_11770e-1) * r +
                     1.27045_82524_52368_38258e+0) * r +
                     3.64784_83247_63204_60504e+0) * r +
                     5.76949_72214_60691_40550e+0) * r +
                     4.63033_78461_56545_29590e+0) * r +
                     1.42343_71107_49683_57734e+0)
        den = (((((((1.05075_00716_44416_84324e-9 * r +
                     5.47593_80849_95344_94600e-4) * r +
                     1.51986_66563_61645_71966e-2) * r +
                     1.48103_97642_74800_74590e-1) * r +
                     6.89767_33498_51000_04550e-1) * r +
                     1.67638_48301_83803_84940e+0) * r +
                     2.05319_16266_37758_82187e+0) * r +
                     1.0)
    else:
        r = r - 5.0
        # Hash sum: 47.52583_31754_92896_71629
        num = (((((((2.01033_43992_92288_13265e-7 * r +
                     2.71155_55687_43487_57815e-5) * r +
                     1.24266_09473_88078_43860e-3) * r +
                     2.65321_89526_57612_30930e-2) * r +
                     2.96560_57182_85048_91230e-1) * r +
                     1.78482_65399_17291_33580e+0) * r +
                     5.46378_49111_64114_36990e+0) * r +
                     6.65790_46435_01103_77720e+0)
        den = (((((((2.04426_31033_89939_78564e-15 * r +
                     1.42151_17583_16445_88870e-7) * r +
                     1.84631_83175_10054_68180e-5) * r +
                     7.86869_13114_56132_59100e-4) * r +
                     1.48753_61290_85061_48525e-2) * r +
                     1.36929_88092_27358_05310e-1) * r +
                     5.99832_20655_58879_37690e-1) * r +
                     1.0)
    x = num / den
    if q < 0.0:
        x = -x
    return mu + (x * sigma)


class NormalDist:
    "Normal distribution of a random variable"
    # https://en.wikipedia.org/wiki/Normal_distribution
    # https://en.wikipedia.org/wiki/Variance#Properties

    __slots__ = {
        '_mu': 'Arithmetic mean of a normal distribution',
        '_sigma': 'Standard deviation of a normal distribution',
    }

    def __init__(self, mu=0.0, sigma=1.0):
        "NormalDist where mu is the mean and sigma is the standard deviation."
        if sigma < 0.0:
            raise StatisticsError('sigma must be non-negative')
        self._mu = float(mu)
        self._sigma = float(sigma)

    @classmethod
    def from_samples(cls, data):
        "Make a normal distribution instance from sample data."
        if not isinstance(data, (list, tuple)):
            data = list(data)
        xbar = fmean(data)
        return cls(xbar, stdev(data, xbar))

    def samples(self, n, *, seed=None):
        "Generate *n* samples for a given mean and standard deviation."
        gauss = random.gauss if seed is None else random.Random(seed).gauss
        mu, sigma = self._mu, self._sigma
        return [gauss(mu, sigma) for i in range(n)]

    def pdf(self, x):
        "Probability density function.  P(x <= X < x+dx) / dx"
        variance = self._sigma ** 2.0
        if not variance:
            raise StatisticsError('pdf() not defined when sigma is zero')
        return exp((x - self._mu)**2.0 / (-2.0*variance)) / sqrt(tau*variance)

    def cdf(self, x):
        "Cumulative distribution function.  P(X <= x)"
        if not self._sigma:
            raise StatisticsError('cdf() not defined when sigma is zero')
        return 0.5 * (1.0 + erf((x - self._mu) / (self._sigma * sqrt(2.0))))

    def inv_cdf(self, p):
        """Inverse cumulative distribution function.  x : P(X <= x) = p

        Finds the value of the random variable such that the probability of
        the variable being less than or equal to that value equals the given
        probability.

        This function is also called the percent point function or quantile
        function.
        """
        if p <= 0.0 or p >= 1.0:
            raise StatisticsError('p must be in the range 0.0 < p < 1.0')
        if self._sigma <= 0.0:
            raise StatisticsError('cdf() not defined when sigma at or below zero')
        return _normal_dist_inv_cdf(p, self._mu, self._sigma)

    def quantiles(self, n=4):
        """Divide into *n* continuous intervals with equal probability.

        Returns a list of (n - 1) cut points separating the intervals.

        Set *n* to 4 for quartiles (the default).  Set *n* to 10 for deciles.
        Set *n* to 100 for percentiles which gives the 99 cuts points that
        separate the normal distribution in to 100 equal sized groups.
        """
        return [self.inv_cdf(i / n) for i in range(1, n)]

    def overlap(self, other):
        """Compute the overlapping coefficient (OVL) between two normal distributions.

        Measures the agreement between two normal probability distributions.
        Returns a value between 0.0 and 1.0 giving the overlapping area in
        the two underlying probability density functions.

            >>> N1 = NormalDist(2.4, 1.6)
            >>> N2 = NormalDist(3.2, 2.0)
            >>> N1.overlap(N2)
            0.8035050657330205
        """
        # See: "The overlapping coefficient as a measure of agreement between
        # probability distributions and point estimation of the overlap of two
        # normal densities" -- Henry F. Inman and Edwin L. Bradley Jr
        # http://dx.doi.org/10.1080/03610928908830127
        if not isinstance(other, NormalDist):
            raise TypeError('Expected another NormalDist instance')
        X, Y = self, other
        if (Y._sigma, Y._mu) < (X._sigma, X._mu):   # sort to assure commutativity
            X, Y = Y, X
        X_var, Y_var = X.variance, Y.variance
        if not X_var or not Y_var:
            raise StatisticsError('overlap() not defined when sigma is zero')
        dv = Y_var - X_var
        dm = fabs(Y._mu - X._mu)
        if not dv:
            return 1.0 - erf(dm / (2.0 * X._sigma * sqrt(2.0)))
        a = X._mu * Y_var - Y._mu * X_var
        b = X._sigma * Y._sigma * sqrt(dm**2.0 + dv * log(Y_var / X_var))
        x1 = (a + b) / dv
        x2 = (a - b) / dv
        return 1.0 - (fabs(Y.cdf(x1) - X.cdf(x1)) + fabs(Y.cdf(x2) - X.cdf(x2)))

    @property
    def mean(self):
        "Arithmetic mean of the normal distribution."
        return self._mu

    @property
    def median(self):
        "Return the median of the normal distribution"
        return self._mu

    @property
    def mode(self):
        """Return the mode of the normal distribution

        The mode is the value x where which the probability density
        function (pdf) takes its maximum value.
        """
        return self._mu

    @property
    def stdev(self):
        "Standard deviation of the normal distribution."
        return self._sigma

    @property
    def variance(self):
        "Square of the standard deviation."
        return self._sigma ** 2.0

    def __add__(x1, x2):
        """Add a constant or another NormalDist instance.

        If *other* is a constant, translate mu by the constant,
        leaving sigma unchanged.

        If *other* is a NormalDist, add both the means and the variances.
        Mathematically, this works only if the two distributions are
        independent or if they are jointly normally distributed.
        """
        if isinstance(x2, NormalDist):
            return NormalDist(x1._mu + x2._mu, hypot(x1._sigma, x2._sigma))
        return NormalDist(x1._mu + x2, x1._sigma)

    def __sub__(x1, x2):
        """Subtract a constant or another NormalDist instance.

        If *other* is a constant, translate by the constant mu,
        leaving sigma unchanged.

        If *other* is a NormalDist, subtract the means and add the variances.
        Mathematically, this works only if the two distributions are
        independent or if they are jointly normally distributed.
        """
        if isinstance(x2, NormalDist):
            return NormalDist(x1._mu - x2._mu, hypot(x1._sigma, x2._sigma))
        return NormalDist(x1._mu - x2, x1._sigma)

    def __mul__(x1, x2):
        """Multiply both mu and sigma by a constant.

        Used for rescaling, perhaps to change measurement units.
        Sigma is scaled with the absolute value of the constant.
        """
        return NormalDist(x1._mu * x2, x1._sigma * fabs(x2))

    def __truediv__(x1, x2):
        """Divide both mu and sigma by a constant.

        Used for rescaling, perhaps to change measurement units.
        Sigma is scaled with the absolute value of the constant.
        """
        return NormalDist(x1._mu / x2, x1._sigma / fabs(x2))

    def __pos__(x1):
        "Return a copy of the instance."
        return NormalDist(x1._mu, x1._sigma)

    def __neg__(x1):
        "Negates mu while keeping sigma the same."
        return NormalDist(-x1._mu, x1._sigma)

    __radd__ = __add__

    def __rsub__(x1, x2):
        "Subtract a NormalDist from a constant or another NormalDist."
        return -(x1 - x2)

    __rmul__ = __mul__

    def __eq__(x1, x2):
        "Two NormalDist objects are equal if their mu and sigma are both equal."
        if not isinstance(x2, NormalDist):
            return NotImplemented
        return x1._mu == x2._mu and x1._sigma == x2._sigma

    def __hash__(self):
        "NormalDist objects hash equal if their mu and sigma are both equal."
        return hash((self._mu, self._sigma))

    def __repr__(self):
        return f'{type(self).__name__}(mu={self._mu!r}, sigma={self._sigma!r})'

# If available, use C implementation
try:
    from _statistics import _normal_dist_inv_cdf
except ImportError:
    pass


if __name__ == '__main__':

    # Show math operations computed analytically in comparsion
    # to a monte carlo simulation of the same operations

    from math import isclose
    from operator import add, sub, mul, truediv
    from itertools import repeat
    import doctest

    g1 = NormalDist(10, 20)
    g2 = NormalDist(-5, 25)

    # Test scaling by a constant
    assert (g1 * 5 / 5).mean == g1.mean
    assert (g1 * 5 / 5).stdev == g1.stdev

    n = 100_000
    G1 = g1.samples(n)
    G2 = g2.samples(n)

    for func in (add, sub):
        print(f'\nTest {func.__name__} with another NormalDist:')
        print(func(g1, g2))
        print(NormalDist.from_samples(map(func, G1, G2)))

    const = 11
    for func in (add, sub, mul, truediv):
        print(f'\nTest {func.__name__} with a constant:')
        print(func(g1, const))
        print(NormalDist.from_samples(map(func, G1, repeat(const))))

    const = 19
    for func in (add, sub, mul):
        print(f'\nTest constant with {func.__name__}:')
        print(func(const, g1))
        print(NormalDist.from_samples(map(func, repeat(const), G1)))

    def assert_close(G1, G2):
        assert isclose(G1.mean, G1.mean, rel_tol=0.01), (G1, G2)
        assert isclose(G1.stdev, G2.stdev, rel_tol=0.01), (G1, G2)

    X = NormalDist(-105, 73)
    Y = NormalDist(31, 47)
    s = 32.75
    n = 100_000

    S = NormalDist.from_samples([x + s for x in X.samples(n)])
    assert_close(X + s, S)

    S = NormalDist.from_samples([x - s for x in X.samples(n)])
    assert_close(X - s, S)

    S = NormalDist.from_samples([x * s for x in X.samples(n)])
    assert_close(X * s, S)

    S = NormalDist.from_samples([x / s for x in X.samples(n)])
    assert_close(X / s, S)

    S = NormalDist.from_samples([x + y for x, y in zip(X.samples(n),
                                                       Y.samples(n))])
    assert_close(X + Y, S)

    S = NormalDist.from_samples([x - y for x, y in zip(X.samples(n),
                                                       Y.samples(n))])
    assert_close(X - Y, S)

    print(doctest.testmod())
site.py000064400000052516151153537460006105 0ustar00"""Append module search paths for third-party packages to sys.path.

****************************************************************
* This module is automatically imported during initialization. *
****************************************************************

This will append site-specific paths to the module search path.  On
Unix (including Mac OSX), it starts with sys.prefix and
sys.exec_prefix (if different) and appends
lib/python<version>/site-packages.
On other platforms (such as Windows), it tries each of the
prefixes directly, as well as with lib/site-packages appended.  The
resulting directories, if they exist, are appended to sys.path, and
also inspected for path configuration files.

If a file named "pyvenv.cfg" exists one directory above sys.executable,
sys.prefix and sys.exec_prefix are set to that directory and
it is also checked for site-packages (sys.base_prefix and
sys.base_exec_prefix will always be the "real" prefixes of the Python
installation). If "pyvenv.cfg" (a bootstrap configuration file) contains
the key "include-system-site-packages" set to anything other than "false"
(case-insensitive), the system-level prefixes will still also be
searched for site-packages; otherwise they won't.

All of the resulting site-specific directories, if they exist, are
appended to sys.path, and also inspected for path configuration
files.

A path configuration file is a file whose name has the form
<package>.pth; its contents are additional directories (one per line)
to be added to sys.path.  Non-existing directories (or
non-directories) are never added to sys.path; no directory is added to
sys.path more than once.  Blank lines and lines beginning with
'#' are skipped. Lines starting with 'import' are executed.

For example, suppose sys.prefix and sys.exec_prefix are set to
/usr/local and there is a directory /usr/local/lib/python2.5/site-packages
with three subdirectories, foo, bar and spam, and two path
configuration files, foo.pth and bar.pth.  Assume foo.pth contains the
following:

  # foo package configuration
  foo
  bar
  bletch

and bar.pth contains:

  # bar package configuration
  bar

Then the following directories are added to sys.path, in this order:

  /usr/local/lib/python2.5/site-packages/bar
  /usr/local/lib/python2.5/site-packages/foo

Note that bletch is omitted because it doesn't exist; bar precedes foo
because bar.pth comes alphabetically before foo.pth; and spam is
omitted because it is not mentioned in either path configuration file.

The readline module is also automatically configured to enable
completion for systems that support it.  This can be overridden in
sitecustomize, usercustomize or PYTHONSTARTUP.  Starting Python in
isolated mode (-I) disables automatic readline configuration.

After these operations, an attempt is made to import a module
named sitecustomize, which can perform arbitrary additional
site-specific customizations.  If this import fails with an
ImportError exception, it is silently ignored.
"""

import sys
import os
import builtins
import _sitebuiltins
import io

# Prefixes for site-packages; add additional prefixes like /usr/local here
PREFIXES = [sys.prefix, sys.exec_prefix]
# Enable per user site-packages directory
# set it to False to disable the feature or True to force the feature
ENABLE_USER_SITE = None

# for distutils.commands.install
# These values are initialized by the getuserbase() and getusersitepackages()
# functions, through the main() function when Python starts.
USER_SITE = None
USER_BASE = None


def makepath(*paths):
    dir = os.path.join(*paths)
    try:
        dir = os.path.abspath(dir)
    except OSError:
        pass
    return dir, os.path.normcase(dir)


def abs_paths():
    """Set all module __file__ and __cached__ attributes to an absolute path"""
    for m in set(sys.modules.values()):
        if (getattr(getattr(m, '__loader__', None), '__module__', None) not in
                ('_frozen_importlib', '_frozen_importlib_external')):
            continue   # don't mess with a PEP 302-supplied __file__
        try:
            m.__file__ = os.path.abspath(m.__file__)
        except (AttributeError, OSError, TypeError):
            pass
        try:
            m.__cached__ = os.path.abspath(m.__cached__)
        except (AttributeError, OSError, TypeError):
            pass


def removeduppaths():
    """ Remove duplicate entries from sys.path along with making them
    absolute"""
    # This ensures that the initial path provided by the interpreter contains
    # only absolute pathnames, even if we're running from the build directory.
    L = []
    known_paths = set()
    for dir in sys.path:
        # Filter out duplicate paths (on case-insensitive file systems also
        # if they only differ in case); turn relative paths into absolute
        # paths.
        dir, dircase = makepath(dir)
        if dircase not in known_paths:
            L.append(dir)
            known_paths.add(dircase)
    sys.path[:] = L
    return known_paths


def _init_pathinfo():
    """Return a set containing all existing file system items from sys.path."""
    d = set()
    for item in sys.path:
        try:
            if os.path.exists(item):
                _, itemcase = makepath(item)
                d.add(itemcase)
        except TypeError:
            continue
    return d


def addpackage(sitedir, name, known_paths):
    """Process a .pth file within the site-packages directory:
       For each line in the file, either combine it with sitedir to a path
       and add that to known_paths, or execute it if it starts with 'import '.
    """
    if known_paths is None:
        known_paths = _init_pathinfo()
        reset = True
    else:
        reset = False
    fullname = os.path.join(sitedir, name)
    try:
        f = io.TextIOWrapper(io.open_code(fullname))
    except OSError:
        return
    with f:
        for n, line in enumerate(f):
            if line.startswith("#"):
                continue
            try:
                if line.startswith(("import ", "import\t")):
                    exec(line)
                    continue
                line = line.rstrip()
                dir, dircase = makepath(sitedir, line)
                if not dircase in known_paths and os.path.exists(dir):
                    sys.path.append(dir)
                    known_paths.add(dircase)
            except Exception:
                print("Error processing line {:d} of {}:\n".format(n+1, fullname),
                      file=sys.stderr)
                import traceback
                for record in traceback.format_exception(*sys.exc_info()):
                    for line in record.splitlines():
                        print('  '+line, file=sys.stderr)
                print("\nRemainder of file ignored", file=sys.stderr)
                break
    if reset:
        known_paths = None
    return known_paths


def addsitedir(sitedir, known_paths=None):
    """Add 'sitedir' argument to sys.path if missing and handle .pth files in
    'sitedir'"""
    if known_paths is None:
        known_paths = _init_pathinfo()
        reset = True
    else:
        reset = False
    sitedir, sitedircase = makepath(sitedir)
    if not sitedircase in known_paths:
        sys.path.append(sitedir)        # Add path component
        known_paths.add(sitedircase)
    try:
        names = os.listdir(sitedir)
    except OSError:
        return
    names = [name for name in names if name.endswith(".pth")]
    for name in sorted(names):
        addpackage(sitedir, name, known_paths)
    if reset:
        known_paths = None
    return known_paths


def check_enableusersite():
    """Check if user site directory is safe for inclusion

    The function tests for the command line flag (including environment var),
    process uid/gid equal to effective uid/gid.

    None: Disabled for security reasons
    False: Disabled by user (command line option)
    True: Safe and enabled
    """
    if sys.flags.no_user_site:
        return False

    if hasattr(os, "getuid") and hasattr(os, "geteuid"):
        # check process uid == effective uid
        if os.geteuid() != os.getuid():
            return None
    if hasattr(os, "getgid") and hasattr(os, "getegid"):
        # check process gid == effective gid
        if os.getegid() != os.getgid():
            return None

    return True


# NOTE: sysconfig and it's dependencies are relatively large but site module
# needs very limited part of them.
# To speedup startup time, we have copy of them.
#
# See https://bugs.python.org/issue29585

# Copy of sysconfig._getuserbase()
def _getuserbase():
    env_base = os.environ.get("PYTHONUSERBASE", None)
    if env_base:
        return env_base

    def joinuser(*args):
        return os.path.expanduser(os.path.join(*args))

    if os.name == "nt":
        base = os.environ.get("APPDATA") or "~"
        return joinuser(base, "Python")

    if sys.platform == "darwin" and sys._framework:
        return joinuser("~", "Library", sys._framework,
                        "%d.%d" % sys.version_info[:2])

    return joinuser("~", ".local")


# Same to sysconfig.get_path('purelib', os.name+'_user')
def _get_path(userbase):
    version = sys.version_info

    if os.name == 'nt':
        return f'{userbase}\\Python{version[0]}{version[1]}\\site-packages'

    if sys.platform == 'darwin' and sys._framework:
        return f'{userbase}/lib/python/site-packages'

    return f'{userbase}/lib/python{version[0]}.{version[1]}/site-packages'


def getuserbase():
    """Returns the `user base` directory path.

    The `user base` directory can be used to store data. If the global
    variable ``USER_BASE`` is not initialized yet, this function will also set
    it.
    """
    global USER_BASE
    if USER_BASE is None:
        USER_BASE = _getuserbase()
    return USER_BASE


def getusersitepackages():
    """Returns the user-specific site-packages directory path.

    If the global variable ``USER_SITE`` is not initialized yet, this
    function will also set it.
    """
    global USER_SITE
    userbase = getuserbase() # this will also set USER_BASE

    if USER_SITE is None:
        USER_SITE = _get_path(userbase)

    return USER_SITE

def addusersitepackages(known_paths):
    """Add a per user site-package to sys.path

    Each user has its own python directory with site-packages in the
    home directory.
    """
    # get the per user site-package path
    # this call will also make sure USER_BASE and USER_SITE are set
    user_site = getusersitepackages()

    if ENABLE_USER_SITE and os.path.isdir(user_site):
        addsitedir(user_site, known_paths)
    return known_paths

def getsitepackages(prefixes=None):
    """Returns a list containing all global site-packages directories.

    For each directory present in ``prefixes`` (or the global ``PREFIXES``),
    this function will find its `site-packages` subdirectory depending on the
    system environment, and will return a list of full paths.
    """
    sitepackages = []
    seen = set()

    if prefixes is None:
        prefixes = PREFIXES

    for prefix in prefixes:
        if not prefix or prefix in seen:
            continue
        seen.add(prefix)

        if os.sep == '/':
            sitepackages.append(os.path.join(prefix, "lib64",
                                        "python" + sys.version[:3],
                                        "site-packages"))
            sitepackages.append(os.path.join(prefix, "lib",
                                        "python%d.%d" % sys.version_info[:2],
                                        "site-packages"))
        else:
            sitepackages.append(prefix)
            sitepackages.append(os.path.join(prefix, "lib64", "site-packages"))
            sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
    return sitepackages

def addsitepackages(known_paths, prefixes=None):
    """Add site-packages to sys.path

    '/usr/local' is included in PREFIXES if RPM build is not detected
    to make packages installed into this location visible.

    """
    if ENABLE_USER_SITE and 'RPM_BUILD_ROOT' not in os.environ:
        PREFIXES.insert(0, "/usr/local")
    for sitedir in getsitepackages(prefixes):
        if os.path.isdir(sitedir):
            addsitedir(sitedir, known_paths)

    return known_paths

def setquit():
    """Define new builtins 'quit' and 'exit'.

    These are objects which make the interpreter exit when called.
    The repr of each object contains a hint at how it works.

    """
    if os.sep == '\\':
        eof = 'Ctrl-Z plus Return'
    else:
        eof = 'Ctrl-D (i.e. EOF)'

    builtins.quit = _sitebuiltins.Quitter('quit', eof)
    builtins.exit = _sitebuiltins.Quitter('exit', eof)


def setcopyright():
    """Set 'copyright' and 'credits' in builtins"""
    builtins.copyright = _sitebuiltins._Printer("copyright", sys.copyright)
    if sys.platform[:4] == 'java':
        builtins.credits = _sitebuiltins._Printer(
            "credits",
            "Jython is maintained by the Jython developers (www.jython.org).")
    else:
        builtins.credits = _sitebuiltins._Printer("credits", """\
    Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
    for supporting Python development.  See www.python.org for more information.""")
    files, dirs = [], []
    # Not all modules are required to have a __file__ attribute.  See
    # PEP 420 for more details.
    if hasattr(os, '__file__'):
        here = os.path.dirname(os.__file__)
        files.extend(["LICENSE.txt", "LICENSE"])
        dirs.extend([os.path.join(here, os.pardir), here, os.curdir])
    builtins.license = _sitebuiltins._Printer(
        "license",
        "See https://www.python.org/psf/license/",
        files, dirs)


def sethelper():
    builtins.help = _sitebuiltins._Helper()

def enablerlcompleter():
    """Enable default readline configuration on interactive prompts, by
    registering a sys.__interactivehook__.

    If the readline module can be imported, the hook will set the Tab key
    as completion key and register ~/.python_history as history file.
    This can be overridden in the sitecustomize or usercustomize module,
    or in a PYTHONSTARTUP file.
    """
    def register_readline():
        import atexit
        try:
            import readline
            import rlcompleter
        except ImportError:
            return

        # Reading the initialization (config) file may not be enough to set a
        # completion key, so we set one first and then read the file.
        readline_doc = getattr(readline, '__doc__', '')
        if readline_doc is not None and 'libedit' in readline_doc:
            readline.parse_and_bind('bind ^I rl_complete')
        else:
            readline.parse_and_bind('tab: complete')

        try:
            readline.read_init_file()
        except OSError:
            # An OSError here could have many causes, but the most likely one
            # is that there's no .inputrc file (or .editrc file in the case of
            # Mac OS X + libedit) in the expected location.  In that case, we
            # want to ignore the exception.
            pass

        if readline.get_current_history_length() == 0:
            # If no history was loaded, default to .python_history.
            # The guard is necessary to avoid doubling history size at
            # each interpreter exit when readline was already configured
            # through a PYTHONSTARTUP hook, see:
            # http://bugs.python.org/issue5845#msg198636
            history = os.path.join(os.path.expanduser('~'),
                                   '.python_history')
            try:
                readline.read_history_file(history)
            except OSError:
                pass

            def write_history():
                try:
                    readline.write_history_file(history)
                except OSError:
                    # bpo-19891, bpo-41193: Home directory does not exist
                    # or is not writable, or the filesystem is read-only.
                    pass

            atexit.register(write_history)

    sys.__interactivehook__ = register_readline

def venv(known_paths):
    global PREFIXES, ENABLE_USER_SITE

    env = os.environ
    if sys.platform == 'darwin' and '__PYVENV_LAUNCHER__' in env:
        executable = sys._base_executable = os.environ['__PYVENV_LAUNCHER__']
    else:
        executable = sys.executable
    exe_dir, _ = os.path.split(os.path.abspath(executable))
    site_prefix = os.path.dirname(exe_dir)
    sys._home = None
    conf_basename = 'pyvenv.cfg'
    candidate_confs = [
        conffile for conffile in (
            os.path.join(exe_dir, conf_basename),
            os.path.join(site_prefix, conf_basename)
            )
        if os.path.isfile(conffile)
        ]

    if candidate_confs:
        virtual_conf = candidate_confs[0]
        system_site = "true"
        # Issue 25185: Use UTF-8, as that's what the venv module uses when
        # writing the file.
        with open(virtual_conf, encoding='utf-8') as f:
            for line in f:
                if '=' in line:
                    key, _, value = line.partition('=')
                    key = key.strip().lower()
                    value = value.strip()
                    if key == 'include-system-site-packages':
                        system_site = value.lower()
                    elif key == 'home':
                        sys._home = value

        sys.prefix = sys.exec_prefix = site_prefix

        # Doing this here ensures venv takes precedence over user-site
        addsitepackages(known_paths, [sys.prefix])

        # addsitepackages will process site_prefix again if its in PREFIXES,
        # but that's ok; known_paths will prevent anything being added twice
        if system_site == "true":
            PREFIXES.insert(0, sys.prefix)
        else:
            PREFIXES = [sys.prefix]
            ENABLE_USER_SITE = False

    return known_paths


def execsitecustomize():
    """Run custom site specific code, if available."""
    try:
        try:
            import sitecustomize
        except ImportError as exc:
            if exc.name == 'sitecustomize':
                pass
            else:
                raise
    except Exception as err:
        if sys.flags.verbose:
            sys.excepthook(*sys.exc_info())
        else:
            sys.stderr.write(
                "Error in sitecustomize; set PYTHONVERBOSE for traceback:\n"
                "%s: %s\n" %
                (err.__class__.__name__, err))


def execusercustomize():
    """Run custom user specific code, if available."""
    try:
        try:
            import usercustomize
        except ImportError as exc:
            if exc.name == 'usercustomize':
                pass
            else:
                raise
    except Exception as err:
        if sys.flags.verbose:
            sys.excepthook(*sys.exc_info())
        else:
            sys.stderr.write(
                "Error in usercustomize; set PYTHONVERBOSE for traceback:\n"
                "%s: %s\n" %
                (err.__class__.__name__, err))


def main():
    """Add standard site-specific directories to the module search path.

    This function is called automatically when this module is imported,
    unless the python interpreter was started with the -S flag.
    """
    global ENABLE_USER_SITE

    orig_path = sys.path[:]
    known_paths = removeduppaths()
    if orig_path != sys.path:
        # removeduppaths() might make sys.path absolute.
        # fix __file__ and __cached__ of already imported modules too.
        abs_paths()

    known_paths = venv(known_paths)
    if ENABLE_USER_SITE is None:
        ENABLE_USER_SITE = check_enableusersite()
    known_paths = addusersitepackages(known_paths)
    known_paths = addsitepackages(known_paths)
    setquit()
    setcopyright()
    sethelper()
    if not sys.flags.isolated:
        enablerlcompleter()
    execsitecustomize()
    if ENABLE_USER_SITE:
        execusercustomize()

# Prevent extending of sys.path when python was started with -S and
# site is imported later.
if not sys.flags.no_site:
    main()

def _script():
    help = """\
    %s [--user-base] [--user-site]

    Without arguments print some useful information
    With arguments print the value of USER_BASE and/or USER_SITE separated
    by '%s'.

    Exit codes with --user-base or --user-site:
      0 - user site directory is enabled
      1 - user site directory is disabled by user
      2 - uses site directory is disabled by super user
          or for security reasons
     >2 - unknown error
    """
    args = sys.argv[1:]
    if not args:
        user_base = getuserbase()
        user_site = getusersitepackages()
        print("sys.path = [")
        for dir in sys.path:
            print("    %r," % (dir,))
        print("]")
        print("USER_BASE: %r (%s)" % (user_base,
            "exists" if os.path.isdir(user_base) else "doesn't exist"))
        print("USER_SITE: %r (%s)" % (user_site,
            "exists" if os.path.isdir(user_site) else "doesn't exist"))
        print("ENABLE_USER_SITE: %r" %  ENABLE_USER_SITE)
        sys.exit(0)

    buffer = []
    if '--user-base' in args:
        buffer.append(USER_BASE)
    if '--user-site' in args:
        buffer.append(USER_SITE)

    if buffer:
        print(os.pathsep.join(buffer))
        if ENABLE_USER_SITE:
            sys.exit(0)
        elif ENABLE_USER_SITE is False:
            sys.exit(1)
        elif ENABLE_USER_SITE is None:
            sys.exit(2)
        else:
            sys.exit(3)
    else:
        import textwrap
        print(textwrap.dedent(help % (sys.argv[0], os.pathsep)))
        sys.exit(10)

if __name__ == '__main__':
    _script()
dummy_threading.py000064400000005377151153537460010324 0ustar00"""Faux ``threading`` version using ``dummy_thread`` instead of ``thread``.

The module ``_dummy_threading`` is added to ``sys.modules`` in order
to not have ``threading`` considered imported.  Had ``threading`` been
directly imported it would have made all subsequent imports succeed
regardless of whether ``_thread`` was available which is not desired.

"""
from sys import modules as sys_modules

import _dummy_thread

# Declaring now so as to not have to nest ``try``s to get proper clean-up.
holding_thread = False
holding_threading = False
holding__threading_local = False

try:
    # Could have checked if ``_thread`` was not in sys.modules and gone
    # a different route, but decided to mirror technique used with
    # ``threading`` below.
    if '_thread' in sys_modules:
        held_thread = sys_modules['_thread']
        holding_thread = True
    # Must have some module named ``_thread`` that implements its API
    # in order to initially import ``threading``.
    sys_modules['_thread'] = sys_modules['_dummy_thread']

    if 'threading' in sys_modules:
        # If ``threading`` is already imported, might as well prevent
        # trying to import it more than needed by saving it if it is
        # already imported before deleting it.
        held_threading = sys_modules['threading']
        holding_threading = True
        del sys_modules['threading']

    if '_threading_local' in sys_modules:
        # If ``_threading_local`` is already imported, might as well prevent
        # trying to import it more than needed by saving it if it is
        # already imported before deleting it.
        held__threading_local = sys_modules['_threading_local']
        holding__threading_local = True
        del sys_modules['_threading_local']

    import threading
    # Need a copy of the code kept somewhere...
    sys_modules['_dummy_threading'] = sys_modules['threading']
    del sys_modules['threading']
    sys_modules['_dummy__threading_local'] = sys_modules['_threading_local']
    del sys_modules['_threading_local']
    from _dummy_threading import *
    from _dummy_threading import __all__

finally:
    # Put back ``threading`` if we overwrote earlier

    if holding_threading:
        sys_modules['threading'] = held_threading
        del held_threading
    del holding_threading

    # Put back ``_threading_local`` if we overwrote earlier

    if holding__threading_local:
        sys_modules['_threading_local'] = held__threading_local
        del held__threading_local
    del holding__threading_local

    # Put back ``thread`` if we overwrote, else del the entry we made
    if holding_thread:
        sys_modules['_thread'] = held_thread
        del held_thread
    else:
        del sys_modules['_thread']
    del holding_thread

    del _dummy_thread
    del sys_modules
traceback.py000064400000056073151153537460007062 0ustar00"""Extract, format and print information about Python stack traces."""

import collections
import itertools
import linecache
import sys

__all__ = ['extract_stack', 'extract_tb', 'format_exception',
           'format_exception_only', 'format_list', 'format_stack',
           'format_tb', 'print_exc', 'format_exc', 'print_exception',
           'print_last', 'print_stack', 'print_tb', 'clear_frames',
           'FrameSummary', 'StackSummary', 'TracebackException',
           'walk_stack', 'walk_tb']

#
# Formatting and printing lists of traceback lines.
#

def print_list(extracted_list, file=None):
    """Print the list of tuples as returned by extract_tb() or
    extract_stack() as a formatted stack trace to the given file."""
    if file is None:
        file = sys.stderr
    for item in StackSummary.from_list(extracted_list).format():
        print(item, file=file, end="")

def format_list(extracted_list):
    """Format a list of tuples or FrameSummary objects for printing.

    Given a list of tuples or FrameSummary objects as returned by
    extract_tb() or extract_stack(), return a list of strings ready
    for printing.

    Each string in the resulting list corresponds to the item with the
    same index in the argument list.  Each string ends in a newline;
    the strings may contain internal newlines as well, for those items
    whose source text line is not None.
    """
    return StackSummary.from_list(extracted_list).format()

#
# Printing and Extracting Tracebacks.
#

def print_tb(tb, limit=None, file=None):
    """Print up to 'limit' stack trace entries from the traceback 'tb'.

    If 'limit' is omitted or None, all entries are printed.  If 'file'
    is omitted or None, the output goes to sys.stderr; otherwise
    'file' should be an open file or file-like object with a write()
    method.
    """
    print_list(extract_tb(tb, limit=limit), file=file)

def format_tb(tb, limit=None):
    """A shorthand for 'format_list(extract_tb(tb, limit))'."""
    return extract_tb(tb, limit=limit).format()

def extract_tb(tb, limit=None):
    """
    Return a StackSummary object representing a list of
    pre-processed entries from traceback.

    This is useful for alternate formatting of stack traces.  If
    'limit' is omitted or None, all entries are extracted.  A
    pre-processed stack trace entry is a FrameSummary object
    containing attributes filename, lineno, name, and line
    representing the information that is usually printed for a stack
    trace.  The line is a string with leading and trailing
    whitespace stripped; if the source is not available it is None.
    """
    return StackSummary.extract(walk_tb(tb), limit=limit)

#
# Exception formatting and output.
#

_cause_message = (
    "\nThe above exception was the direct cause "
    "of the following exception:\n\n")

_context_message = (
    "\nDuring handling of the above exception, "
    "another exception occurred:\n\n")


def print_exception(etype, value, tb, limit=None, file=None, chain=True):
    """Print exception up to 'limit' stack trace entries from 'tb' to 'file'.

    This differs from print_tb() in the following ways: (1) if
    traceback is not None, it prints a header "Traceback (most recent
    call last):"; (2) it prints the exception type and value after the
    stack trace; (3) if type is SyntaxError and value has the
    appropriate format, it prints the line where the syntax error
    occurred with a caret on the next line indicating the approximate
    position of the error.
    """
    # format_exception has ignored etype for some time, and code such as cgitb
    # passes in bogus values as a result. For compatibility with such code we
    # ignore it here (rather than in the new TracebackException API).
    if file is None:
        file = sys.stderr
    for line in TracebackException(
            type(value), value, tb, limit=limit).format(chain=chain):
        print(line, file=file, end="")


def format_exception(etype, value, tb, limit=None, chain=True):
    """Format a stack trace and the exception information.

    The arguments have the same meaning as the corresponding arguments
    to print_exception().  The return value is a list of strings, each
    ending in a newline and some containing internal newlines.  When
    these lines are concatenated and printed, exactly the same text is
    printed as does print_exception().
    """
    # format_exception has ignored etype for some time, and code such as cgitb
    # passes in bogus values as a result. For compatibility with such code we
    # ignore it here (rather than in the new TracebackException API).
    return list(TracebackException(
        type(value), value, tb, limit=limit).format(chain=chain))


def format_exception_only(etype, value):
    """Format the exception part of a traceback.

    The arguments are the exception type and value such as given by
    sys.last_type and sys.last_value. The return value is a list of
    strings, each ending in a newline.

    Normally, the list contains a single string; however, for
    SyntaxError exceptions, it contains several lines that (when
    printed) display detailed information about where the syntax
    error occurred.

    The message indicating which exception occurred is always the last
    string in the list.

    """
    return list(TracebackException(etype, value, None).format_exception_only())


# -- not official API but folk probably use these two functions.

def _format_final_exc_line(etype, value):
    valuestr = _some_str(value)
    if value is None or not valuestr:
        line = "%s\n" % etype
    else:
        line = "%s: %s\n" % (etype, valuestr)
    return line

def _some_str(value):
    try:
        return str(value)
    except:
        return '<unprintable %s object>' % type(value).__name__

# --

def print_exc(limit=None, file=None, chain=True):
    """Shorthand for 'print_exception(*sys.exc_info(), limit, file)'."""
    print_exception(*sys.exc_info(), limit=limit, file=file, chain=chain)

def format_exc(limit=None, chain=True):
    """Like print_exc() but return a string."""
    return "".join(format_exception(*sys.exc_info(), limit=limit, chain=chain))

def print_last(limit=None, file=None, chain=True):
    """This is a shorthand for 'print_exception(sys.last_type,
    sys.last_value, sys.last_traceback, limit, file)'."""
    if not hasattr(sys, "last_type"):
        raise ValueError("no last exception")
    print_exception(sys.last_type, sys.last_value, sys.last_traceback,
                    limit, file, chain)

#
# Printing and Extracting Stacks.
#

def print_stack(f=None, limit=None, file=None):
    """Print a stack trace from its invocation point.

    The optional 'f' argument can be used to specify an alternate
    stack frame at which to start. The optional 'limit' and 'file'
    arguments have the same meaning as for print_exception().
    """
    if f is None:
        f = sys._getframe().f_back
    print_list(extract_stack(f, limit=limit), file=file)


def format_stack(f=None, limit=None):
    """Shorthand for 'format_list(extract_stack(f, limit))'."""
    if f is None:
        f = sys._getframe().f_back
    return format_list(extract_stack(f, limit=limit))


def extract_stack(f=None, limit=None):
    """Extract the raw traceback from the current stack frame.

    The return value has the same format as for extract_tb().  The
    optional 'f' and 'limit' arguments have the same meaning as for
    print_stack().  Each item in the list is a quadruple (filename,
    line number, function name, text), and the entries are in order
    from oldest to newest stack frame.
    """
    if f is None:
        f = sys._getframe().f_back
    stack = StackSummary.extract(walk_stack(f), limit=limit)
    stack.reverse()
    return stack


def clear_frames(tb):
    "Clear all references to local variables in the frames of a traceback."
    while tb is not None:
        try:
            tb.tb_frame.clear()
        except RuntimeError:
            # Ignore the exception raised if the frame is still executing.
            pass
        tb = tb.tb_next


class FrameSummary:
    """A single frame from a traceback.

    - :attr:`filename` The filename for the frame.
    - :attr:`lineno` The line within filename for the frame that was
      active when the frame was captured.
    - :attr:`name` The name of the function or method that was executing
      when the frame was captured.
    - :attr:`line` The text from the linecache module for the
      of code that was running when the frame was captured.
    - :attr:`locals` Either None if locals were not supplied, or a dict
      mapping the name to the repr() of the variable.
    """

    __slots__ = ('filename', 'lineno', 'name', '_line', 'locals')

    def __init__(self, filename, lineno, name, *, lookup_line=True,
            locals=None, line=None):
        """Construct a FrameSummary.

        :param lookup_line: If True, `linecache` is consulted for the source
            code line. Otherwise, the line will be looked up when first needed.
        :param locals: If supplied the frame locals, which will be captured as
            object representations.
        :param line: If provided, use this instead of looking up the line in
            the linecache.
        """
        self.filename = filename
        self.lineno = lineno
        self.name = name
        self._line = line
        if lookup_line:
            self.line
        self.locals = {k: repr(v) for k, v in locals.items()} if locals else None

    def __eq__(self, other):
        if isinstance(other, FrameSummary):
            return (self.filename == other.filename and
                    self.lineno == other.lineno and
                    self.name == other.name and
                    self.locals == other.locals)
        if isinstance(other, tuple):
            return (self.filename, self.lineno, self.name, self.line) == other
        return NotImplemented

    def __getitem__(self, pos):
        return (self.filename, self.lineno, self.name, self.line)[pos]

    def __iter__(self):
        return iter([self.filename, self.lineno, self.name, self.line])

    def __repr__(self):
        return "<FrameSummary file {filename}, line {lineno} in {name}>".format(
            filename=self.filename, lineno=self.lineno, name=self.name)

    def __len__(self):
        return 4

    @property
    def line(self):
        if self._line is None:
            self._line = linecache.getline(self.filename, self.lineno).strip()
        return self._line


def walk_stack(f):
    """Walk a stack yielding the frame and line number for each frame.

    This will follow f.f_back from the given frame. If no frame is given, the
    current stack is used. Usually used with StackSummary.extract.
    """
    if f is None:
        f = sys._getframe().f_back.f_back
    while f is not None:
        yield f, f.f_lineno
        f = f.f_back


def walk_tb(tb):
    """Walk a traceback yielding the frame and line number for each frame.

    This will follow tb.tb_next (and thus is in the opposite order to
    walk_stack). Usually used with StackSummary.extract.
    """
    while tb is not None:
        yield tb.tb_frame, tb.tb_lineno
        tb = tb.tb_next


_RECURSIVE_CUTOFF = 3 # Also hardcoded in traceback.c.

class StackSummary(list):
    """A stack of frames."""

    @classmethod
    def extract(klass, frame_gen, *, limit=None, lookup_lines=True,
            capture_locals=False):
        """Create a StackSummary from a traceback or stack object.

        :param frame_gen: A generator that yields (frame, lineno) tuples to
            include in the stack.
        :param limit: None to include all frames or the number of frames to
            include.
        :param lookup_lines: If True, lookup lines for each frame immediately,
            otherwise lookup is deferred until the frame is rendered.
        :param capture_locals: If True, the local variables from each frame will
            be captured as object representations into the FrameSummary.
        """
        if limit is None:
            limit = getattr(sys, 'tracebacklimit', None)
            if limit is not None and limit < 0:
                limit = 0
        if limit is not None:
            if limit >= 0:
                frame_gen = itertools.islice(frame_gen, limit)
            else:
                frame_gen = collections.deque(frame_gen, maxlen=-limit)

        result = klass()
        fnames = set()
        for f, lineno in frame_gen:
            co = f.f_code
            filename = co.co_filename
            name = co.co_name

            fnames.add(filename)
            linecache.lazycache(filename, f.f_globals)
            # Must defer line lookups until we have called checkcache.
            if capture_locals:
                f_locals = f.f_locals
            else:
                f_locals = None
            result.append(FrameSummary(
                filename, lineno, name, lookup_line=False, locals=f_locals))
        for filename in fnames:
            linecache.checkcache(filename)
        # If immediate lookup was desired, trigger lookups now.
        if lookup_lines:
            for f in result:
                f.line
        return result

    @classmethod
    def from_list(klass, a_list):
        """
        Create a StackSummary object from a supplied list of
        FrameSummary objects or old-style list of tuples.
        """
        # While doing a fast-path check for isinstance(a_list, StackSummary) is
        # appealing, idlelib.run.cleanup_traceback and other similar code may
        # break this by making arbitrary frames plain tuples, so we need to
        # check on a frame by frame basis.
        result = StackSummary()
        for frame in a_list:
            if isinstance(frame, FrameSummary):
                result.append(frame)
            else:
                filename, lineno, name, line = frame
                result.append(FrameSummary(filename, lineno, name, line=line))
        return result

    def format(self):
        """Format the stack ready for printing.

        Returns a list of strings ready for printing.  Each string in the
        resulting list corresponds to a single frame from the stack.
        Each string ends in a newline; the strings may contain internal
        newlines as well, for those items with source text lines.

        For long sequences of the same frame and line, the first few
        repetitions are shown, followed by a summary line stating the exact
        number of further repetitions.
        """
        result = []
        last_file = None
        last_line = None
        last_name = None
        count = 0
        for frame in self:
            if (last_file is None or last_file != frame.filename or
                last_line is None or last_line != frame.lineno or
                last_name is None or last_name != frame.name):
                if count > _RECURSIVE_CUTOFF:
                    count -= _RECURSIVE_CUTOFF
                    result.append(
                        f'  [Previous line repeated {count} more '
                        f'time{"s" if count > 1 else ""}]\n'
                    )
                last_file = frame.filename
                last_line = frame.lineno
                last_name = frame.name
                count = 0
            count += 1
            if count > _RECURSIVE_CUTOFF:
                continue
            row = []
            row.append('  File "{}", line {}, in {}\n'.format(
                frame.filename, frame.lineno, frame.name))
            if frame.line:
                row.append('    {}\n'.format(frame.line.strip()))
            if frame.locals:
                for name, value in sorted(frame.locals.items()):
                    row.append('    {name} = {value}\n'.format(name=name, value=value))
            result.append(''.join(row))
        if count > _RECURSIVE_CUTOFF:
            count -= _RECURSIVE_CUTOFF
            result.append(
                f'  [Previous line repeated {count} more '
                f'time{"s" if count > 1 else ""}]\n'
            )
        return result


class TracebackException:
    """An exception ready for rendering.

    The traceback module captures enough attributes from the original exception
    to this intermediary form to ensure that no references are held, while
    still being able to fully print or format it.

    Use `from_exception` to create TracebackException instances from exception
    objects, or the constructor to create TracebackException instances from
    individual components.

    - :attr:`__cause__` A TracebackException of the original *__cause__*.
    - :attr:`__context__` A TracebackException of the original *__context__*.
    - :attr:`__suppress_context__` The *__suppress_context__* value from the
      original exception.
    - :attr:`stack` A `StackSummary` representing the traceback.
    - :attr:`exc_type` The class of the original traceback.
    - :attr:`filename` For syntax errors - the filename where the error
      occurred.
    - :attr:`lineno` For syntax errors - the linenumber where the error
      occurred.
    - :attr:`text` For syntax errors - the text where the error
      occurred.
    - :attr:`offset` For syntax errors - the offset into the text where the
      error occurred.
    - :attr:`msg` For syntax errors - the compiler error message.
    """

    def __init__(self, exc_type, exc_value, exc_traceback, *, limit=None,
            lookup_lines=True, capture_locals=False, _seen=None):
        # NB: we need to accept exc_traceback, exc_value, exc_traceback to
        # permit backwards compat with the existing API, otherwise we
        # need stub thunk objects just to glue it together.
        # Handle loops in __cause__ or __context__.
        if _seen is None:
            _seen = set()
        _seen.add(id(exc_value))
        # Gracefully handle (the way Python 2.4 and earlier did) the case of
        # being called with no type or value (None, None, None).
        if (exc_value and exc_value.__cause__ is not None
            and id(exc_value.__cause__) not in _seen):
            cause = TracebackException(
                type(exc_value.__cause__),
                exc_value.__cause__,
                exc_value.__cause__.__traceback__,
                limit=limit,
                lookup_lines=False,
                capture_locals=capture_locals,
                _seen=_seen)
        else:
            cause = None
        if (exc_value and exc_value.__context__ is not None
            and id(exc_value.__context__) not in _seen):
            context = TracebackException(
                type(exc_value.__context__),
                exc_value.__context__,
                exc_value.__context__.__traceback__,
                limit=limit,
                lookup_lines=False,
                capture_locals=capture_locals,
                _seen=_seen)
        else:
            context = None
        self.__cause__ = cause
        self.__context__ = context
        self.__suppress_context__ = \
            exc_value.__suppress_context__ if exc_value else False
        # TODO: locals.
        self.stack = StackSummary.extract(
            walk_tb(exc_traceback), limit=limit, lookup_lines=lookup_lines,
            capture_locals=capture_locals)
        self.exc_type = exc_type
        # Capture now to permit freeing resources: only complication is in the
        # unofficial API _format_final_exc_line
        self._str = _some_str(exc_value)
        if exc_type and issubclass(exc_type, SyntaxError):
            # Handle SyntaxError's specially
            self.filename = exc_value.filename
            lno = exc_value.lineno
            self.lineno = str(lno) if lno is not None else None
            self.text = exc_value.text
            self.offset = exc_value.offset
            self.msg = exc_value.msg
        if lookup_lines:
            self._load_lines()

    @classmethod
    def from_exception(cls, exc, *args, **kwargs):
        """Create a TracebackException from an exception."""
        return cls(type(exc), exc, exc.__traceback__, *args, **kwargs)

    def _load_lines(self):
        """Private API. force all lines in the stack to be loaded."""
        for frame in self.stack:
            frame.line
        if self.__context__:
            self.__context__._load_lines()
        if self.__cause__:
            self.__cause__._load_lines()

    def __eq__(self, other):
        return self.__dict__ == other.__dict__

    def __str__(self):
        return self._str

    def format_exception_only(self):
        """Format the exception part of the traceback.

        The return value is a generator of strings, each ending in a newline.

        Normally, the generator emits a single string; however, for
        SyntaxError exceptions, it emits several lines that (when
        printed) display detailed information about where the syntax
        error occurred.

        The message indicating which exception occurred is always the last
        string in the output.
        """
        if self.exc_type is None:
            yield _format_final_exc_line(None, self._str)
            return

        stype = self.exc_type.__qualname__
        smod = self.exc_type.__module__
        if smod not in ("__main__", "builtins"):
            stype = smod + '.' + stype

        if not issubclass(self.exc_type, SyntaxError):
            yield _format_final_exc_line(stype, self._str)
            return

        # It was a syntax error; show exactly where the problem was found.
        filename_suffix = ''
        if self.lineno is not None:
            yield '  File "{}", line {}\n'.format(
                self.filename or "<string>", self.lineno)
        elif self.filename is not None:
            filename_suffix = ' ({})'.format(self.filename)

        badline = self.text
        offset = self.offset
        if badline is not None:
            yield '    {}\n'.format(badline.strip())
            if offset is not None:
                caretspace = badline.rstrip('\n')
                offset = min(len(caretspace), offset) - 1
                caretspace = caretspace[:offset].lstrip()
                # non-space whitespace (likes tabs) must be kept for alignment
                caretspace = ((c.isspace() and c or ' ') for c in caretspace)
                yield '    {}^\n'.format(''.join(caretspace))
        msg = self.msg or "<no detail available>"
        yield "{}: {}{}\n".format(stype, msg, filename_suffix)

    def format(self, *, chain=True):
        """Format the exception.

        If chain is not *True*, *__cause__* and *__context__* will not be formatted.

        The return value is a generator of strings, each ending in a newline and
        some containing internal newlines. `print_exception` is a wrapper around
        this method which just prints the lines to a file.

        The message indicating which exception occurred is always the last
        string in the output.
        """
        if chain:
            if self.__cause__ is not None:
                yield from self.__cause__.format(chain=chain)
                yield _cause_message
            elif (self.__context__ is not None and
                not self.__suppress_context__):
                yield from self.__context__.format(chain=chain)
                yield _context_message
        if self.stack:
            yield 'Traceback (most recent call last):\n'
            yield from self.stack.format()
        yield from self.format_exception_only()
contextlib.py000064400000060643151153537460007314 0ustar00"""Utilities for with-statement contexts.  See PEP 343."""
import abc
import sys
import _collections_abc
from collections import deque
from functools import wraps
from types import MethodType

__all__ = ["asynccontextmanager", "contextmanager", "closing", "nullcontext",
           "AbstractContextManager", "AbstractAsyncContextManager",
           "AsyncExitStack", "ContextDecorator", "ExitStack",
           "redirect_stdout", "redirect_stderr", "suppress"]


class AbstractContextManager(abc.ABC):

    """An abstract base class for context managers."""

    def __enter__(self):
        """Return `self` upon entering the runtime context."""
        return self

    @abc.abstractmethod
    def __exit__(self, exc_type, exc_value, traceback):
        """Raise any exception triggered within the runtime context."""
        return None

    @classmethod
    def __subclasshook__(cls, C):
        if cls is AbstractContextManager:
            return _collections_abc._check_methods(C, "__enter__", "__exit__")
        return NotImplemented


class AbstractAsyncContextManager(abc.ABC):

    """An abstract base class for asynchronous context managers."""

    async def __aenter__(self):
        """Return `self` upon entering the runtime context."""
        return self

    @abc.abstractmethod
    async def __aexit__(self, exc_type, exc_value, traceback):
        """Raise any exception triggered within the runtime context."""
        return None

    @classmethod
    def __subclasshook__(cls, C):
        if cls is AbstractAsyncContextManager:
            return _collections_abc._check_methods(C, "__aenter__",
                                                   "__aexit__")
        return NotImplemented


class ContextDecorator(object):
    "A base class or mixin that enables context managers to work as decorators."

    def _recreate_cm(self):
        """Return a recreated instance of self.

        Allows an otherwise one-shot context manager like
        _GeneratorContextManager to support use as
        a decorator via implicit recreation.

        This is a private interface just for _GeneratorContextManager.
        See issue #11647 for details.
        """
        return self

    def __call__(self, func):
        @wraps(func)
        def inner(*args, **kwds):
            with self._recreate_cm():
                return func(*args, **kwds)
        return inner


class _GeneratorContextManagerBase:
    """Shared functionality for @contextmanager and @asynccontextmanager."""

    def __init__(self, func, args, kwds):
        self.gen = func(*args, **kwds)
        self.func, self.args, self.kwds = func, args, kwds
        # Issue 19330: ensure context manager instances have good docstrings
        doc = getattr(func, "__doc__", None)
        if doc is None:
            doc = type(self).__doc__
        self.__doc__ = doc
        # Unfortunately, this still doesn't provide good help output when
        # inspecting the created context manager instances, since pydoc
        # currently bypasses the instance docstring and shows the docstring
        # for the class instead.
        # See http://bugs.python.org/issue19404 for more details.


class _GeneratorContextManager(_GeneratorContextManagerBase,
                               AbstractContextManager,
                               ContextDecorator):
    """Helper for @contextmanager decorator."""

    def _recreate_cm(self):
        # _GCM instances are one-shot context managers, so the
        # CM must be recreated each time a decorated function is
        # called
        return self.__class__(self.func, self.args, self.kwds)

    def __enter__(self):
        # do not keep args and kwds alive unnecessarily
        # they are only needed for recreation, which is not possible anymore
        del self.args, self.kwds, self.func
        try:
            return next(self.gen)
        except StopIteration:
            raise RuntimeError("generator didn't yield") from None

    def __exit__(self, type, value, traceback):
        if type is None:
            try:
                next(self.gen)
            except StopIteration:
                return False
            else:
                raise RuntimeError("generator didn't stop")
        else:
            if value is None:
                # Need to force instantiation so we can reliably
                # tell if we get the same exception back
                value = type()
            try:
                self.gen.throw(type, value, traceback)
            except StopIteration as exc:
                # Suppress StopIteration *unless* it's the same exception that
                # was passed to throw().  This prevents a StopIteration
                # raised inside the "with" statement from being suppressed.
                return exc is not value
            except RuntimeError as exc:
                # Don't re-raise the passed in exception. (issue27122)
                if exc is value:
                    return False
                # Likewise, avoid suppressing if a StopIteration exception
                # was passed to throw() and later wrapped into a RuntimeError
                # (see PEP 479).
                if type is StopIteration and exc.__cause__ is value:
                    return False
                raise
            except:
                # only re-raise if it's *not* the exception that was
                # passed to throw(), because __exit__() must not raise
                # an exception unless __exit__() itself failed.  But throw()
                # has to raise the exception to signal propagation, so this
                # fixes the impedance mismatch between the throw() protocol
                # and the __exit__() protocol.
                #
                # This cannot use 'except BaseException as exc' (as in the
                # async implementation) to maintain compatibility with
                # Python 2, where old-style class exceptions are not caught
                # by 'except BaseException'.
                if sys.exc_info()[1] is value:
                    return False
                raise
            raise RuntimeError("generator didn't stop after throw()")


class _AsyncGeneratorContextManager(_GeneratorContextManagerBase,
                                    AbstractAsyncContextManager):
    """Helper for @asynccontextmanager."""

    async def __aenter__(self):
        try:
            return await self.gen.__anext__()
        except StopAsyncIteration:
            raise RuntimeError("generator didn't yield") from None

    async def __aexit__(self, typ, value, traceback):
        if typ is None:
            try:
                await self.gen.__anext__()
            except StopAsyncIteration:
                return
            else:
                raise RuntimeError("generator didn't stop")
        else:
            if value is None:
                value = typ()
            # See _GeneratorContextManager.__exit__ for comments on subtleties
            # in this implementation
            try:
                await self.gen.athrow(typ, value, traceback)
                raise RuntimeError("generator didn't stop after athrow()")
            except StopAsyncIteration as exc:
                return exc is not value
            except RuntimeError as exc:
                if exc is value:
                    return False
                # Avoid suppressing if a StopIteration exception
                # was passed to throw() and later wrapped into a RuntimeError
                # (see PEP 479 for sync generators; async generators also
                # have this behavior). But do this only if the exception wrapped
                # by the RuntimeError is actully Stop(Async)Iteration (see
                # issue29692).
                if isinstance(value, (StopIteration, StopAsyncIteration)):
                    if exc.__cause__ is value:
                        return False
                raise
            except BaseException as exc:
                if exc is not value:
                    raise


def contextmanager(func):
    """@contextmanager decorator.

    Typical usage:

        @contextmanager
        def some_generator(<arguments>):
            <setup>
            try:
                yield <value>
            finally:
                <cleanup>

    This makes this:

        with some_generator(<arguments>) as <variable>:
            <body>

    equivalent to this:

        <setup>
        try:
            <variable> = <value>
            <body>
        finally:
            <cleanup>
    """
    @wraps(func)
    def helper(*args, **kwds):
        return _GeneratorContextManager(func, args, kwds)
    return helper


def asynccontextmanager(func):
    """@asynccontextmanager decorator.

    Typical usage:

        @asynccontextmanager
        async def some_async_generator(<arguments>):
            <setup>
            try:
                yield <value>
            finally:
                <cleanup>

    This makes this:

        async with some_async_generator(<arguments>) as <variable>:
            <body>

    equivalent to this:

        <setup>
        try:
            <variable> = <value>
            <body>
        finally:
            <cleanup>
    """
    @wraps(func)
    def helper(*args, **kwds):
        return _AsyncGeneratorContextManager(func, args, kwds)
    return helper


class closing(AbstractContextManager):
    """Context to automatically close something at the end of a block.

    Code like this:

        with closing(<module>.open(<arguments>)) as f:
            <block>

    is equivalent to this:

        f = <module>.open(<arguments>)
        try:
            <block>
        finally:
            f.close()

    """
    def __init__(self, thing):
        self.thing = thing
    def __enter__(self):
        return self.thing
    def __exit__(self, *exc_info):
        self.thing.close()


class _RedirectStream(AbstractContextManager):

    _stream = None

    def __init__(self, new_target):
        self._new_target = new_target
        # We use a list of old targets to make this CM re-entrant
        self._old_targets = []

    def __enter__(self):
        self._old_targets.append(getattr(sys, self._stream))
        setattr(sys, self._stream, self._new_target)
        return self._new_target

    def __exit__(self, exctype, excinst, exctb):
        setattr(sys, self._stream, self._old_targets.pop())


class redirect_stdout(_RedirectStream):
    """Context manager for temporarily redirecting stdout to another file.

        # How to send help() to stderr
        with redirect_stdout(sys.stderr):
            help(dir)

        # How to write help() to a file
        with open('help.txt', 'w') as f:
            with redirect_stdout(f):
                help(pow)
    """

    _stream = "stdout"


class redirect_stderr(_RedirectStream):
    """Context manager for temporarily redirecting stderr to another file."""

    _stream = "stderr"


class suppress(AbstractContextManager):
    """Context manager to suppress specified exceptions

    After the exception is suppressed, execution proceeds with the next
    statement following the with statement.

         with suppress(FileNotFoundError):
             os.remove(somefile)
         # Execution still resumes here if the file was already removed
    """

    def __init__(self, *exceptions):
        self._exceptions = exceptions

    def __enter__(self):
        pass

    def __exit__(self, exctype, excinst, exctb):
        # Unlike isinstance and issubclass, CPython exception handling
        # currently only looks at the concrete type hierarchy (ignoring
        # the instance and subclass checking hooks). While Guido considers
        # that a bug rather than a feature, it's a fairly hard one to fix
        # due to various internal implementation details. suppress provides
        # the simpler issubclass based semantics, rather than trying to
        # exactly reproduce the limitations of the CPython interpreter.
        #
        # See http://bugs.python.org/issue12029 for more details
        return exctype is not None and issubclass(exctype, self._exceptions)


class _BaseExitStack:
    """A base class for ExitStack and AsyncExitStack."""

    @staticmethod
    def _create_exit_wrapper(cm, cm_exit):
        return MethodType(cm_exit, cm)

    @staticmethod
    def _create_cb_wrapper(callback, /, *args, **kwds):
        def _exit_wrapper(exc_type, exc, tb):
            callback(*args, **kwds)
        return _exit_wrapper

    def __init__(self):
        self._exit_callbacks = deque()

    def pop_all(self):
        """Preserve the context stack by transferring it to a new instance."""
        new_stack = type(self)()
        new_stack._exit_callbacks = self._exit_callbacks
        self._exit_callbacks = deque()
        return new_stack

    def push(self, exit):
        """Registers a callback with the standard __exit__ method signature.

        Can suppress exceptions the same way __exit__ method can.
        Also accepts any object with an __exit__ method (registering a call
        to the method instead of the object itself).
        """
        # We use an unbound method rather than a bound method to follow
        # the standard lookup behaviour for special methods.
        _cb_type = type(exit)

        try:
            exit_method = _cb_type.__exit__
        except AttributeError:
            # Not a context manager, so assume it's a callable.
            self._push_exit_callback(exit)
        else:
            self._push_cm_exit(exit, exit_method)
        return exit  # Allow use as a decorator.

    def enter_context(self, cm):
        """Enters the supplied context manager.

        If successful, also pushes its __exit__ method as a callback and
        returns the result of the __enter__ method.
        """
        # We look up the special methods on the type to match the with
        # statement.
        _cm_type = type(cm)
        _exit = _cm_type.__exit__
        result = _cm_type.__enter__(cm)
        self._push_cm_exit(cm, _exit)
        return result

    def callback(*args, **kwds):
        """Registers an arbitrary callback and arguments.

        Cannot suppress exceptions.
        """
        if len(args) >= 2:
            self, callback, *args = args
        elif not args:
            raise TypeError("descriptor 'callback' of '_BaseExitStack' object "
                            "needs an argument")
        elif 'callback' in kwds:
            callback = kwds.pop('callback')
            self, *args = args
            import warnings
            warnings.warn("Passing 'callback' as keyword argument is deprecated",
                          DeprecationWarning, stacklevel=2)
        else:
            raise TypeError('callback expected at least 1 positional argument, '
                            'got %d' % (len(args)-1))

        _exit_wrapper = self._create_cb_wrapper(callback, *args, **kwds)

        # We changed the signature, so using @wraps is not appropriate, but
        # setting __wrapped__ may still help with introspection.
        _exit_wrapper.__wrapped__ = callback
        self._push_exit_callback(_exit_wrapper)
        return callback  # Allow use as a decorator
    callback.__text_signature__ = '($self, callback, /, *args, **kwds)'

    def _push_cm_exit(self, cm, cm_exit):
        """Helper to correctly register callbacks to __exit__ methods."""
        _exit_wrapper = self._create_exit_wrapper(cm, cm_exit)
        self._push_exit_callback(_exit_wrapper, True)

    def _push_exit_callback(self, callback, is_sync=True):
        self._exit_callbacks.append((is_sync, callback))


# Inspired by discussions on http://bugs.python.org/issue13585
class ExitStack(_BaseExitStack, AbstractContextManager):
    """Context manager for dynamic management of a stack of exit callbacks.

    For example:
        with ExitStack() as stack:
            files = [stack.enter_context(open(fname)) for fname in filenames]
            # All opened files will automatically be closed at the end of
            # the with statement, even if attempts to open files later
            # in the list raise an exception.
    """

    def __enter__(self):
        return self

    def __exit__(self, *exc_details):
        received_exc = exc_details[0] is not None

        # We manipulate the exception state so it behaves as though
        # we were actually nesting multiple with statements
        frame_exc = sys.exc_info()[1]
        def _fix_exception_context(new_exc, old_exc):
            # Context may not be correct, so find the end of the chain
            while 1:
                exc_context = new_exc.__context__
                if exc_context is old_exc:
                    # Context is already set correctly (see issue 20317)
                    return
                if exc_context is None or exc_context is frame_exc:
                    break
                new_exc = exc_context
            # Change the end of the chain to point to the exception
            # we expect it to reference
            new_exc.__context__ = old_exc

        # Callbacks are invoked in LIFO order to match the behaviour of
        # nested context managers
        suppressed_exc = False
        pending_raise = False
        while self._exit_callbacks:
            is_sync, cb = self._exit_callbacks.pop()
            assert is_sync
            try:
                if cb(*exc_details):
                    suppressed_exc = True
                    pending_raise = False
                    exc_details = (None, None, None)
            except:
                new_exc_details = sys.exc_info()
                # simulate the stack of exceptions by setting the context
                _fix_exception_context(new_exc_details[1], exc_details[1])
                pending_raise = True
                exc_details = new_exc_details
        if pending_raise:
            try:
                # bare "raise exc_details[1]" replaces our carefully
                # set-up context
                fixed_ctx = exc_details[1].__context__
                raise exc_details[1]
            except BaseException:
                exc_details[1].__context__ = fixed_ctx
                raise
        return received_exc and suppressed_exc

    def close(self):
        """Immediately unwind the context stack."""
        self.__exit__(None, None, None)


# Inspired by discussions on https://bugs.python.org/issue29302
class AsyncExitStack(_BaseExitStack, AbstractAsyncContextManager):
    """Async context manager for dynamic management of a stack of exit
    callbacks.

    For example:
        async with AsyncExitStack() as stack:
            connections = [await stack.enter_async_context(get_connection())
                for i in range(5)]
            # All opened connections will automatically be released at the
            # end of the async with statement, even if attempts to open a
            # connection later in the list raise an exception.
    """

    @staticmethod
    def _create_async_exit_wrapper(cm, cm_exit):
        return MethodType(cm_exit, cm)

    @staticmethod
    def _create_async_cb_wrapper(callback, /, *args, **kwds):
        async def _exit_wrapper(exc_type, exc, tb):
            await callback(*args, **kwds)
        return _exit_wrapper

    async def enter_async_context(self, cm):
        """Enters the supplied async context manager.

        If successful, also pushes its __aexit__ method as a callback and
        returns the result of the __aenter__ method.
        """
        _cm_type = type(cm)
        _exit = _cm_type.__aexit__
        result = await _cm_type.__aenter__(cm)
        self._push_async_cm_exit(cm, _exit)
        return result

    def push_async_exit(self, exit):
        """Registers a coroutine function with the standard __aexit__ method
        signature.

        Can suppress exceptions the same way __aexit__ method can.
        Also accepts any object with an __aexit__ method (registering a call
        to the method instead of the object itself).
        """
        _cb_type = type(exit)
        try:
            exit_method = _cb_type.__aexit__
        except AttributeError:
            # Not an async context manager, so assume it's a coroutine function
            self._push_exit_callback(exit, False)
        else:
            self._push_async_cm_exit(exit, exit_method)
        return exit  # Allow use as a decorator

    def push_async_callback(*args, **kwds):
        """Registers an arbitrary coroutine function and arguments.

        Cannot suppress exceptions.
        """
        if len(args) >= 2:
            self, callback, *args = args
        elif not args:
            raise TypeError("descriptor 'push_async_callback' of "
                            "'AsyncExitStack' object needs an argument")
        elif 'callback' in kwds:
            callback = kwds.pop('callback')
            self, *args = args
            import warnings
            warnings.warn("Passing 'callback' as keyword argument is deprecated",
                          DeprecationWarning, stacklevel=2)
        else:
            raise TypeError('push_async_callback expected at least 1 '
                            'positional argument, got %d' % (len(args)-1))

        _exit_wrapper = self._create_async_cb_wrapper(callback, *args, **kwds)

        # We changed the signature, so using @wraps is not appropriate, but
        # setting __wrapped__ may still help with introspection.
        _exit_wrapper.__wrapped__ = callback
        self._push_exit_callback(_exit_wrapper, False)
        return callback  # Allow use as a decorator
    push_async_callback.__text_signature__ = '($self, callback, /, *args, **kwds)'

    async def aclose(self):
        """Immediately unwind the context stack."""
        await self.__aexit__(None, None, None)

    def _push_async_cm_exit(self, cm, cm_exit):
        """Helper to correctly register coroutine function to __aexit__
        method."""
        _exit_wrapper = self._create_async_exit_wrapper(cm, cm_exit)
        self._push_exit_callback(_exit_wrapper, False)

    async def __aenter__(self):
        return self

    async def __aexit__(self, *exc_details):
        received_exc = exc_details[0] is not None

        # We manipulate the exception state so it behaves as though
        # we were actually nesting multiple with statements
        frame_exc = sys.exc_info()[1]
        def _fix_exception_context(new_exc, old_exc):
            # Context may not be correct, so find the end of the chain
            while 1:
                exc_context = new_exc.__context__
                if exc_context is old_exc:
                    # Context is already set correctly (see issue 20317)
                    return
                if exc_context is None or exc_context is frame_exc:
                    break
                new_exc = exc_context
            # Change the end of the chain to point to the exception
            # we expect it to reference
            new_exc.__context__ = old_exc

        # Callbacks are invoked in LIFO order to match the behaviour of
        # nested context managers
        suppressed_exc = False
        pending_raise = False
        while self._exit_callbacks:
            is_sync, cb = self._exit_callbacks.pop()
            try:
                if is_sync:
                    cb_suppress = cb(*exc_details)
                else:
                    cb_suppress = await cb(*exc_details)

                if cb_suppress:
                    suppressed_exc = True
                    pending_raise = False
                    exc_details = (None, None, None)
            except:
                new_exc_details = sys.exc_info()
                # simulate the stack of exceptions by setting the context
                _fix_exception_context(new_exc_details[1], exc_details[1])
                pending_raise = True
                exc_details = new_exc_details
        if pending_raise:
            try:
                # bare "raise exc_details[1]" replaces our carefully
                # set-up context
                fixed_ctx = exc_details[1].__context__
                raise exc_details[1]
            except BaseException:
                exc_details[1].__context__ = fixed_ctx
                raise
        return received_exc and suppressed_exc


class nullcontext(AbstractContextManager):
    """Context manager that does no additional processing.

    Used as a stand-in for a normal context manager, when a particular
    block of code is only sometimes used with a normal context manager:

    cm = optional_cm if condition else nullcontext()
    with cm:
        # Perform operation, using optional_cm if condition is True
    """

    def __init__(self, enter_result=None):
        self.enter_result = enter_result

    def __enter__(self):
        return self.enter_result

    def __exit__(self, *excinfo):
        pass
pty.py000064400000011307151153537460005746 0ustar00"""Pseudo terminal utilities."""

# Bugs: No signal handling.  Doesn't set slave termios and window size.
#       Only tested on Linux.
# See:  W. Richard Stevens. 1992.  Advanced Programming in the
#       UNIX Environment.  Chapter 19.
# Author: Steen Lumholt -- with additions by Guido.

from select import select
import os
import sys
import tty

__all__ = ["openpty","fork","spawn"]

STDIN_FILENO = 0
STDOUT_FILENO = 1
STDERR_FILENO = 2

CHILD = 0

def openpty():
    """openpty() -> (master_fd, slave_fd)
    Open a pty master/slave pair, using os.openpty() if possible."""

    try:
        return os.openpty()
    except (AttributeError, OSError):
        pass
    master_fd, slave_name = _open_terminal()
    slave_fd = slave_open(slave_name)
    return master_fd, slave_fd

def master_open():
    """master_open() -> (master_fd, slave_name)
    Open a pty master and return the fd, and the filename of the slave end.
    Deprecated, use openpty() instead."""

    try:
        master_fd, slave_fd = os.openpty()
    except (AttributeError, OSError):
        pass
    else:
        slave_name = os.ttyname(slave_fd)
        os.close(slave_fd)
        return master_fd, slave_name

    return _open_terminal()

def _open_terminal():
    """Open pty master and return (master_fd, tty_name)."""
    for x in 'pqrstuvwxyzPQRST':
        for y in '0123456789abcdef':
            pty_name = '/dev/pty' + x + y
            try:
                fd = os.open(pty_name, os.O_RDWR)
            except OSError:
                continue
            return (fd, '/dev/tty' + x + y)
    raise OSError('out of pty devices')

def slave_open(tty_name):
    """slave_open(tty_name) -> slave_fd
    Open the pty slave and acquire the controlling terminal, returning
    opened filedescriptor.
    Deprecated, use openpty() instead."""

    result = os.open(tty_name, os.O_RDWR)
    try:
        from fcntl import ioctl, I_PUSH
    except ImportError:
        return result
    try:
        ioctl(result, I_PUSH, "ptem")
        ioctl(result, I_PUSH, "ldterm")
    except OSError:
        pass
    return result

def fork():
    """fork() -> (pid, master_fd)
    Fork and make the child a session leader with a controlling terminal."""

    try:
        pid, fd = os.forkpty()
    except (AttributeError, OSError):
        pass
    else:
        if pid == CHILD:
            try:
                os.setsid()
            except OSError:
                # os.forkpty() already set us session leader
                pass
        return pid, fd

    master_fd, slave_fd = openpty()
    pid = os.fork()
    if pid == CHILD:
        # Establish a new session.
        os.setsid()
        os.close(master_fd)

        # Slave becomes stdin/stdout/stderr of child.
        os.dup2(slave_fd, STDIN_FILENO)
        os.dup2(slave_fd, STDOUT_FILENO)
        os.dup2(slave_fd, STDERR_FILENO)
        if (slave_fd > STDERR_FILENO):
            os.close (slave_fd)

        # Explicitly open the tty to make it become a controlling tty.
        tmp_fd = os.open(os.ttyname(STDOUT_FILENO), os.O_RDWR)
        os.close(tmp_fd)
    else:
        os.close(slave_fd)

    # Parent and child process.
    return pid, master_fd

def _writen(fd, data):
    """Write all the data to a descriptor."""
    while data:
        n = os.write(fd, data)
        data = data[n:]

def _read(fd):
    """Default read function."""
    return os.read(fd, 1024)

def _copy(master_fd, master_read=_read, stdin_read=_read):
    """Parent copy loop.
    Copies
            pty master -> standard output   (master_read)
            standard input -> pty master    (stdin_read)"""
    fds = [master_fd, STDIN_FILENO]
    while True:
        rfds, wfds, xfds = select(fds, [], [])
        if master_fd in rfds:
            data = master_read(master_fd)
            if not data:  # Reached EOF.
                fds.remove(master_fd)
            else:
                os.write(STDOUT_FILENO, data)
        if STDIN_FILENO in rfds:
            data = stdin_read(STDIN_FILENO)
            if not data:
                fds.remove(STDIN_FILENO)
            else:
                _writen(master_fd, data)

def spawn(argv, master_read=_read, stdin_read=_read):
    """Create a spawned process."""
    if type(argv) == type(''):
        argv = (argv,)
    sys.audit('pty.spawn', argv)
    pid, master_fd = fork()
    if pid == CHILD:
        os.execlp(argv[0], *argv)
    try:
        mode = tty.tcgetattr(STDIN_FILENO)
        tty.setraw(STDIN_FILENO)
        restore = 1
    except tty.error:    # This is the same as termios.error
        restore = 0
    try:
        _copy(master_fd, master_read, stdin_read)
    except OSError:
        if restore:
            tty.tcsetattr(STDIN_FILENO, tty.TCSAFLUSH, mode)

    os.close(master_fd)
    return os.waitpid(pid, 0)[1]
chunk.py000064400000012473151153537460006247 0ustar00"""Simple class to read IFF chunks.

An IFF chunk (used in formats such as AIFF, TIFF, RMFF (RealMedia File
Format)) has the following structure:

+----------------+
| ID (4 bytes)   |
+----------------+
| size (4 bytes) |
+----------------+
| data           |
| ...            |
+----------------+

The ID is a 4-byte string which identifies the type of chunk.

The size field (a 32-bit value, encoded using big-endian byte order)
gives the size of the whole chunk, including the 8-byte header.

Usually an IFF-type file consists of one or more chunks.  The proposed
usage of the Chunk class defined here is to instantiate an instance at
the start of each chunk and read from the instance until it reaches
the end, after which a new instance can be instantiated.  At the end
of the file, creating a new instance will fail with an EOFError
exception.

Usage:
while True:
    try:
        chunk = Chunk(file)
    except EOFError:
        break
    chunktype = chunk.getname()
    while True:
        data = chunk.read(nbytes)
        if not data:
            pass
        # do something with data

The interface is file-like.  The implemented methods are:
read, close, seek, tell, isatty.
Extra methods are: skip() (called by close, skips to the end of the chunk),
getname() (returns the name (ID) of the chunk)

The __init__ method has one required argument, a file-like object
(including a chunk instance), and one optional argument, a flag which
specifies whether or not chunks are aligned on 2-byte boundaries.  The
default is 1, i.e. aligned.
"""

class Chunk:
    def __init__(self, file, align=True, bigendian=True, inclheader=False):
        import struct
        self.closed = False
        self.align = align      # whether to align to word (2-byte) boundaries
        if bigendian:
            strflag = '>'
        else:
            strflag = '<'
        self.file = file
        self.chunkname = file.read(4)
        if len(self.chunkname) < 4:
            raise EOFError
        try:
            self.chunksize = struct.unpack_from(strflag+'L', file.read(4))[0]
        except struct.error:
            raise EOFError from None
        if inclheader:
            self.chunksize = self.chunksize - 8 # subtract header
        self.size_read = 0
        try:
            self.offset = self.file.tell()
        except (AttributeError, OSError):
            self.seekable = False
        else:
            self.seekable = True

    def getname(self):
        """Return the name (ID) of the current chunk."""
        return self.chunkname

    def getsize(self):
        """Return the size of the current chunk."""
        return self.chunksize

    def close(self):
        if not self.closed:
            try:
                self.skip()
            finally:
                self.closed = True

    def isatty(self):
        if self.closed:
            raise ValueError("I/O operation on closed file")
        return False

    def seek(self, pos, whence=0):
        """Seek to specified position into the chunk.
        Default position is 0 (start of chunk).
        If the file is not seekable, this will result in an error.
        """

        if self.closed:
            raise ValueError("I/O operation on closed file")
        if not self.seekable:
            raise OSError("cannot seek")
        if whence == 1:
            pos = pos + self.size_read
        elif whence == 2:
            pos = pos + self.chunksize
        if pos < 0 or pos > self.chunksize:
            raise RuntimeError
        self.file.seek(self.offset + pos, 0)
        self.size_read = pos

    def tell(self):
        if self.closed:
            raise ValueError("I/O operation on closed file")
        return self.size_read

    def read(self, size=-1):
        """Read at most size bytes from the chunk.
        If size is omitted or negative, read until the end
        of the chunk.
        """

        if self.closed:
            raise ValueError("I/O operation on closed file")
        if self.size_read >= self.chunksize:
            return b''
        if size < 0:
            size = self.chunksize - self.size_read
        if size > self.chunksize - self.size_read:
            size = self.chunksize - self.size_read
        data = self.file.read(size)
        self.size_read = self.size_read + len(data)
        if self.size_read == self.chunksize and \
           self.align and \
           (self.chunksize & 1):
            dummy = self.file.read(1)
            self.size_read = self.size_read + len(dummy)
        return data

    def skip(self):
        """Skip the rest of the chunk.
        If you are not interested in the contents of the chunk,
        this method should be called so that the file points to
        the start of the next chunk.
        """

        if self.closed:
            raise ValueError("I/O operation on closed file")
        if self.seekable:
            try:
                n = self.chunksize - self.size_read
                # maybe fix alignment
                if self.align and (self.chunksize & 1):
                    n = n + 1
                self.file.seek(n, 1)
                self.size_read = self.size_read + n
                return
            except OSError:
                pass
        while self.size_read < self.chunksize:
            n = min(8192, self.chunksize - self.size_read)
            dummy = self.read(n)
            if not dummy:
                raise EOFError
netrc.py000064400000012676151153537460006257 0ustar00"""An object-oriented interface to .netrc files."""

# Module and documentation by Eric S. Raymond, 21 Dec 1998

import os, shlex, stat

__all__ = ["netrc", "NetrcParseError"]


class NetrcParseError(Exception):
    """Exception raised on syntax errors in the .netrc file."""
    def __init__(self, msg, filename=None, lineno=None):
        self.filename = filename
        self.lineno = lineno
        self.msg = msg
        Exception.__init__(self, msg)

    def __str__(self):
        return "%s (%s, line %s)" % (self.msg, self.filename, self.lineno)


class netrc:
    def __init__(self, file=None):
        default_netrc = file is None
        if file is None:
            file = os.path.join(os.path.expanduser("~"), ".netrc")
        self.hosts = {}
        self.macros = {}
        with open(file) as fp:
            self._parse(file, fp, default_netrc)

    def _parse(self, file, fp, default_netrc):
        lexer = shlex.shlex(fp)
        lexer.wordchars += r"""!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~"""
        lexer.commenters = lexer.commenters.replace('#', '')
        while 1:
            # Look for a machine, default, or macdef top-level keyword
            saved_lineno = lexer.lineno
            toplevel = tt = lexer.get_token()
            if not tt:
                break
            elif tt[0] == '#':
                if lexer.lineno == saved_lineno and len(tt) == 1:
                    lexer.instream.readline()
                continue
            elif tt == 'machine':
                entryname = lexer.get_token()
            elif tt == 'default':
                entryname = 'default'
            elif tt == 'macdef':                # Just skip to end of macdefs
                entryname = lexer.get_token()
                self.macros[entryname] = []
                lexer.whitespace = ' \t'
                while 1:
                    line = lexer.instream.readline()
                    if not line or line == '\012':
                        lexer.whitespace = ' \t\r\n'
                        break
                    self.macros[entryname].append(line)
                continue
            else:
                raise NetrcParseError(
                    "bad toplevel token %r" % tt, file, lexer.lineno)

            # We're looking at start of an entry for a named machine or default.
            login = ''
            account = password = None
            self.hosts[entryname] = {}
            while 1:
                tt = lexer.get_token()
                if (tt.startswith('#') or
                    tt in {'', 'machine', 'default', 'macdef'}):
                    if password:
                        self.hosts[entryname] = (login, account, password)
                        lexer.push_token(tt)
                        break
                    else:
                        raise NetrcParseError(
                            "malformed %s entry %s terminated by %s"
                            % (toplevel, entryname, repr(tt)),
                            file, lexer.lineno)
                elif tt == 'login' or tt == 'user':
                    login = lexer.get_token()
                elif tt == 'account':
                    account = lexer.get_token()
                elif tt == 'password':
                    if os.name == 'posix' and default_netrc:
                        prop = os.fstat(fp.fileno())
                        if prop.st_uid != os.getuid():
                            import pwd
                            try:
                                fowner = pwd.getpwuid(prop.st_uid)[0]
                            except KeyError:
                                fowner = 'uid %s' % prop.st_uid
                            try:
                                user = pwd.getpwuid(os.getuid())[0]
                            except KeyError:
                                user = 'uid %s' % os.getuid()
                            raise NetrcParseError(
                                ("~/.netrc file owner (%s) does not match"
                                 " current user (%s)") % (fowner, user),
                                file, lexer.lineno)
                        if (prop.st_mode & (stat.S_IRWXG | stat.S_IRWXO)):
                            raise NetrcParseError(
                               "~/.netrc access too permissive: access"
                               " permissions must restrict access to only"
                               " the owner", file, lexer.lineno)
                    password = lexer.get_token()
                else:
                    raise NetrcParseError("bad follower token %r" % tt,
                                          file, lexer.lineno)

    def authenticators(self, host):
        """Return a (user, account, password) tuple for given host."""
        if host in self.hosts:
            return self.hosts[host]
        elif 'default' in self.hosts:
            return self.hosts['default']
        else:
            return None

    def __repr__(self):
        """Dump the class data in the format of a .netrc file."""
        rep = ""
        for host in self.hosts.keys():
            attrs = self.hosts[host]
            rep += f"machine {host}\n\tlogin {attrs[0]}\n"
            if attrs[1]:
                rep += f"\taccount {attrs[1]}\n"
            rep += f"\tpassword {attrs[2]}\n"
        for macro in self.macros.keys():
            rep += f"macdef {macro}\n"
            for line in self.macros[macro]:
                rep += line
            rep += "\n"
        return rep

if __name__ == '__main__':
    print(netrc())
ipaddress.py000064400000213734151153537460007120 0ustar00# Copyright 2007 Google Inc.
#  Licensed to PSF under a Contributor Agreement.

"""A fast, lightweight IPv4/IPv6 manipulation library in Python.

This library is used to create/poke/manipulate IPv4 and IPv6 addresses
and networks.

"""

__version__ = '1.0'


import functools

IPV4LENGTH = 32
IPV6LENGTH = 128

class AddressValueError(ValueError):
    """A Value Error related to the address."""


class NetmaskValueError(ValueError):
    """A Value Error related to the netmask."""


def ip_address(address):
    """Take an IP string/int and return an object of the correct type.

    Args:
        address: A string or integer, the IP address.  Either IPv4 or
          IPv6 addresses may be supplied; integers less than 2**32 will
          be considered to be IPv4 by default.

    Returns:
        An IPv4Address or IPv6Address object.

    Raises:
        ValueError: if the *address* passed isn't either a v4 or a v6
          address

    """
    try:
        return IPv4Address(address)
    except (AddressValueError, NetmaskValueError):
        pass

    try:
        return IPv6Address(address)
    except (AddressValueError, NetmaskValueError):
        pass

    raise ValueError('%r does not appear to be an IPv4 or IPv6 address' %
                     address)


def ip_network(address, strict=True):
    """Take an IP string/int and return an object of the correct type.

    Args:
        address: A string or integer, the IP network.  Either IPv4 or
          IPv6 networks may be supplied; integers less than 2**32 will
          be considered to be IPv4 by default.

    Returns:
        An IPv4Network or IPv6Network object.

    Raises:
        ValueError: if the string passed isn't either a v4 or a v6
          address. Or if the network has host bits set.

    """
    try:
        return IPv4Network(address, strict)
    except (AddressValueError, NetmaskValueError):
        pass

    try:
        return IPv6Network(address, strict)
    except (AddressValueError, NetmaskValueError):
        pass

    raise ValueError('%r does not appear to be an IPv4 or IPv6 network' %
                     address)


def ip_interface(address):
    """Take an IP string/int and return an object of the correct type.

    Args:
        address: A string or integer, the IP address.  Either IPv4 or
          IPv6 addresses may be supplied; integers less than 2**32 will
          be considered to be IPv4 by default.

    Returns:
        An IPv4Interface or IPv6Interface object.

    Raises:
        ValueError: if the string passed isn't either a v4 or a v6
          address.

    Notes:
        The IPv?Interface classes describe an Address on a particular
        Network, so they're basically a combination of both the Address
        and Network classes.

    """
    try:
        return IPv4Interface(address)
    except (AddressValueError, NetmaskValueError):
        pass

    try:
        return IPv6Interface(address)
    except (AddressValueError, NetmaskValueError):
        pass

    raise ValueError('%r does not appear to be an IPv4 or IPv6 interface' %
                     address)


def v4_int_to_packed(address):
    """Represent an address as 4 packed bytes in network (big-endian) order.

    Args:
        address: An integer representation of an IPv4 IP address.

    Returns:
        The integer address packed as 4 bytes in network (big-endian) order.

    Raises:
        ValueError: If the integer is negative or too large to be an
          IPv4 IP address.

    """
    try:
        return address.to_bytes(4, 'big')
    except OverflowError:
        raise ValueError("Address negative or too large for IPv4")


def v6_int_to_packed(address):
    """Represent an address as 16 packed bytes in network (big-endian) order.

    Args:
        address: An integer representation of an IPv6 IP address.

    Returns:
        The integer address packed as 16 bytes in network (big-endian) order.

    """
    try:
        return address.to_bytes(16, 'big')
    except OverflowError:
        raise ValueError("Address negative or too large for IPv6")


def _split_optional_netmask(address):
    """Helper to split the netmask and raise AddressValueError if needed"""
    addr = str(address).split('/')
    if len(addr) > 2:
        raise AddressValueError("Only one '/' permitted in %r" % address)
    return addr


def _find_address_range(addresses):
    """Find a sequence of sorted deduplicated IPv#Address.

    Args:
        addresses: a list of IPv#Address objects.

    Yields:
        A tuple containing the first and last IP addresses in the sequence.

    """
    it = iter(addresses)
    first = last = next(it)
    for ip in it:
        if ip._ip != last._ip + 1:
            yield first, last
            first = ip
        last = ip
    yield first, last


def _count_righthand_zero_bits(number, bits):
    """Count the number of zero bits on the right hand side.

    Args:
        number: an integer.
        bits: maximum number of bits to count.

    Returns:
        The number of zero bits on the right hand side of the number.

    """
    if number == 0:
        return bits
    return min(bits, (~number & (number-1)).bit_length())


def summarize_address_range(first, last):
    """Summarize a network range given the first and last IP addresses.

    Example:
        >>> list(summarize_address_range(IPv4Address('192.0.2.0'),
        ...                              IPv4Address('192.0.2.130')))
        ...                                #doctest: +NORMALIZE_WHITESPACE
        [IPv4Network('192.0.2.0/25'), IPv4Network('192.0.2.128/31'),
         IPv4Network('192.0.2.130/32')]

    Args:
        first: the first IPv4Address or IPv6Address in the range.
        last: the last IPv4Address or IPv6Address in the range.

    Returns:
        An iterator of the summarized IPv(4|6) network objects.

    Raise:
        TypeError:
            If the first and last objects are not IP addresses.
            If the first and last objects are not the same version.
        ValueError:
            If the last object is not greater than the first.
            If the version of the first address is not 4 or 6.

    """
    if (not (isinstance(first, _BaseAddress) and
             isinstance(last, _BaseAddress))):
        raise TypeError('first and last must be IP addresses, not networks')
    if first.version != last.version:
        raise TypeError("%s and %s are not of the same version" % (
                         first, last))
    if first > last:
        raise ValueError('last IP address must be greater than first')

    if first.version == 4:
        ip = IPv4Network
    elif first.version == 6:
        ip = IPv6Network
    else:
        raise ValueError('unknown IP version')

    ip_bits = first._max_prefixlen
    first_int = first._ip
    last_int = last._ip
    while first_int <= last_int:
        nbits = min(_count_righthand_zero_bits(first_int, ip_bits),
                    (last_int - first_int + 1).bit_length() - 1)
        net = ip((first_int, ip_bits - nbits))
        yield net
        first_int += 1 << nbits
        if first_int - 1 == ip._ALL_ONES:
            break


def _collapse_addresses_internal(addresses):
    """Loops through the addresses, collapsing concurrent netblocks.

    Example:

        ip1 = IPv4Network('192.0.2.0/26')
        ip2 = IPv4Network('192.0.2.64/26')
        ip3 = IPv4Network('192.0.2.128/26')
        ip4 = IPv4Network('192.0.2.192/26')

        _collapse_addresses_internal([ip1, ip2, ip3, ip4]) ->
          [IPv4Network('192.0.2.0/24')]

        This shouldn't be called directly; it is called via
          collapse_addresses([]).

    Args:
        addresses: A list of IPv4Network's or IPv6Network's

    Returns:
        A list of IPv4Network's or IPv6Network's depending on what we were
        passed.

    """
    # First merge
    to_merge = list(addresses)
    subnets = {}
    while to_merge:
        net = to_merge.pop()
        supernet = net.supernet()
        existing = subnets.get(supernet)
        if existing is None:
            subnets[supernet] = net
        elif existing != net:
            # Merge consecutive subnets
            del subnets[supernet]
            to_merge.append(supernet)
    # Then iterate over resulting networks, skipping subsumed subnets
    last = None
    for net in sorted(subnets.values()):
        if last is not None:
            # Since they are sorted, last.network_address <= net.network_address
            # is a given.
            if last.broadcast_address >= net.broadcast_address:
                continue
        yield net
        last = net


def collapse_addresses(addresses):
    """Collapse a list of IP objects.

    Example:
        collapse_addresses([IPv4Network('192.0.2.0/25'),
                            IPv4Network('192.0.2.128/25')]) ->
                           [IPv4Network('192.0.2.0/24')]

    Args:
        addresses: An iterator of IPv4Network or IPv6Network objects.

    Returns:
        An iterator of the collapsed IPv(4|6)Network objects.

    Raises:
        TypeError: If passed a list of mixed version objects.

    """
    addrs = []
    ips = []
    nets = []

    # split IP addresses and networks
    for ip in addresses:
        if isinstance(ip, _BaseAddress):
            if ips and ips[-1]._version != ip._version:
                raise TypeError("%s and %s are not of the same version" % (
                                 ip, ips[-1]))
            ips.append(ip)
        elif ip._prefixlen == ip._max_prefixlen:
            if ips and ips[-1]._version != ip._version:
                raise TypeError("%s and %s are not of the same version" % (
                                 ip, ips[-1]))
            try:
                ips.append(ip.ip)
            except AttributeError:
                ips.append(ip.network_address)
        else:
            if nets and nets[-1]._version != ip._version:
                raise TypeError("%s and %s are not of the same version" % (
                                 ip, nets[-1]))
            nets.append(ip)

    # sort and dedup
    ips = sorted(set(ips))

    # find consecutive address ranges in the sorted sequence and summarize them
    if ips:
        for first, last in _find_address_range(ips):
            addrs.extend(summarize_address_range(first, last))

    return _collapse_addresses_internal(addrs + nets)


def get_mixed_type_key(obj):
    """Return a key suitable for sorting between networks and addresses.

    Address and Network objects are not sortable by default; they're
    fundamentally different so the expression

        IPv4Address('192.0.2.0') <= IPv4Network('192.0.2.0/24')

    doesn't make any sense.  There are some times however, where you may wish
    to have ipaddress sort these for you anyway. If you need to do this, you
    can use this function as the key= argument to sorted().

    Args:
      obj: either a Network or Address object.
    Returns:
      appropriate key.

    """
    if isinstance(obj, _BaseNetwork):
        return obj._get_networks_key()
    elif isinstance(obj, _BaseAddress):
        return obj._get_address_key()
    return NotImplemented


class _IPAddressBase:

    """The mother class."""

    __slots__ = ()

    @property
    def exploded(self):
        """Return the longhand version of the IP address as a string."""
        return self._explode_shorthand_ip_string()

    @property
    def compressed(self):
        """Return the shorthand version of the IP address as a string."""
        return str(self)

    @property
    def reverse_pointer(self):
        """The name of the reverse DNS pointer for the IP address, e.g.:
            >>> ipaddress.ip_address("127.0.0.1").reverse_pointer
            '1.0.0.127.in-addr.arpa'
            >>> ipaddress.ip_address("2001:db8::1").reverse_pointer
            '1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa'

        """
        return self._reverse_pointer()

    @property
    def version(self):
        msg = '%200s has no version specified' % (type(self),)
        raise NotImplementedError(msg)

    def _check_int_address(self, address):
        if address < 0:
            msg = "%d (< 0) is not permitted as an IPv%d address"
            raise AddressValueError(msg % (address, self._version))
        if address > self._ALL_ONES:
            msg = "%d (>= 2**%d) is not permitted as an IPv%d address"
            raise AddressValueError(msg % (address, self._max_prefixlen,
                                           self._version))

    def _check_packed_address(self, address, expected_len):
        address_len = len(address)
        if address_len != expected_len:
            msg = "%r (len %d != %d) is not permitted as an IPv%d address"
            raise AddressValueError(msg % (address, address_len,
                                           expected_len, self._version))

    @classmethod
    def _ip_int_from_prefix(cls, prefixlen):
        """Turn the prefix length into a bitwise netmask

        Args:
            prefixlen: An integer, the prefix length.

        Returns:
            An integer.

        """
        return cls._ALL_ONES ^ (cls._ALL_ONES >> prefixlen)

    @classmethod
    def _prefix_from_ip_int(cls, ip_int):
        """Return prefix length from the bitwise netmask.

        Args:
            ip_int: An integer, the netmask in expanded bitwise format

        Returns:
            An integer, the prefix length.

        Raises:
            ValueError: If the input intermingles zeroes & ones
        """
        trailing_zeroes = _count_righthand_zero_bits(ip_int,
                                                     cls._max_prefixlen)
        prefixlen = cls._max_prefixlen - trailing_zeroes
        leading_ones = ip_int >> trailing_zeroes
        all_ones = (1 << prefixlen) - 1
        if leading_ones != all_ones:
            byteslen = cls._max_prefixlen // 8
            details = ip_int.to_bytes(byteslen, 'big')
            msg = 'Netmask pattern %r mixes zeroes & ones'
            raise ValueError(msg % details)
        return prefixlen

    @classmethod
    def _report_invalid_netmask(cls, netmask_str):
        msg = '%r is not a valid netmask' % netmask_str
        raise NetmaskValueError(msg) from None

    @classmethod
    def _prefix_from_prefix_string(cls, prefixlen_str):
        """Return prefix length from a numeric string

        Args:
            prefixlen_str: The string to be converted

        Returns:
            An integer, the prefix length.

        Raises:
            NetmaskValueError: If the input is not a valid netmask
        """
        # int allows a leading +/- as well as surrounding whitespace,
        # so we ensure that isn't the case
        if not (prefixlen_str.isascii() and prefixlen_str.isdigit()):
            cls._report_invalid_netmask(prefixlen_str)
        try:
            prefixlen = int(prefixlen_str)
        except ValueError:
            cls._report_invalid_netmask(prefixlen_str)
        if not (0 <= prefixlen <= cls._max_prefixlen):
            cls._report_invalid_netmask(prefixlen_str)
        return prefixlen

    @classmethod
    def _prefix_from_ip_string(cls, ip_str):
        """Turn a netmask/hostmask string into a prefix length

        Args:
            ip_str: The netmask/hostmask to be converted

        Returns:
            An integer, the prefix length.

        Raises:
            NetmaskValueError: If the input is not a valid netmask/hostmask
        """
        # Parse the netmask/hostmask like an IP address.
        try:
            ip_int = cls._ip_int_from_string(ip_str)
        except AddressValueError:
            cls._report_invalid_netmask(ip_str)

        # Try matching a netmask (this would be /1*0*/ as a bitwise regexp).
        # Note that the two ambiguous cases (all-ones and all-zeroes) are
        # treated as netmasks.
        try:
            return cls._prefix_from_ip_int(ip_int)
        except ValueError:
            pass

        # Invert the bits, and try matching a /0+1+/ hostmask instead.
        ip_int ^= cls._ALL_ONES
        try:
            return cls._prefix_from_ip_int(ip_int)
        except ValueError:
            cls._report_invalid_netmask(ip_str)

    @classmethod
    def _split_addr_prefix(cls, address):
        """Helper function to parse address of Network/Interface.

        Arg:
            address: Argument of Network/Interface.

        Returns:
            (addr, prefix) tuple.
        """
        # a packed address or integer
        if isinstance(address, (bytes, int)):
            return address, cls._max_prefixlen

        if not isinstance(address, tuple):
            # Assume input argument to be string or any object representation
            # which converts into a formatted IP prefix string.
            address = _split_optional_netmask(address)

        # Constructing from a tuple (addr, [mask])
        if len(address) > 1:
            return address
        return address[0], cls._max_prefixlen

    def __reduce__(self):
        return self.__class__, (str(self),)


@functools.total_ordering
class _BaseAddress(_IPAddressBase):

    """A generic IP object.

    This IP class contains the version independent methods which are
    used by single IP addresses.
    """

    __slots__ = ()

    def __int__(self):
        return self._ip

    def __eq__(self, other):
        try:
            return (self._ip == other._ip
                    and self._version == other._version)
        except AttributeError:
            return NotImplemented

    def __lt__(self, other):
        if not isinstance(other, _BaseAddress):
            return NotImplemented
        if self._version != other._version:
            raise TypeError('%s and %s are not of the same version' % (
                             self, other))
        if self._ip != other._ip:
            return self._ip < other._ip
        return False

    # Shorthand for Integer addition and subtraction. This is not
    # meant to ever support addition/subtraction of addresses.
    def __add__(self, other):
        if not isinstance(other, int):
            return NotImplemented
        return self.__class__(int(self) + other)

    def __sub__(self, other):
        if not isinstance(other, int):
            return NotImplemented
        return self.__class__(int(self) - other)

    def __repr__(self):
        return '%s(%r)' % (self.__class__.__name__, str(self))

    def __str__(self):
        return str(self._string_from_ip_int(self._ip))

    def __hash__(self):
        return hash(hex(int(self._ip)))

    def _get_address_key(self):
        return (self._version, self)

    def __reduce__(self):
        return self.__class__, (self._ip,)


@functools.total_ordering
class _BaseNetwork(_IPAddressBase):
    """A generic IP network object.

    This IP class contains the version independent methods which are
    used by networks.
    """

    def __repr__(self):
        return '%s(%r)' % (self.__class__.__name__, str(self))

    def __str__(self):
        return '%s/%d' % (self.network_address, self.prefixlen)

    def hosts(self):
        """Generate Iterator over usable hosts in a network.

        This is like __iter__ except it doesn't return the network
        or broadcast addresses.

        """
        network = int(self.network_address)
        broadcast = int(self.broadcast_address)
        for x in range(network + 1, broadcast):
            yield self._address_class(x)

    def __iter__(self):
        network = int(self.network_address)
        broadcast = int(self.broadcast_address)
        for x in range(network, broadcast + 1):
            yield self._address_class(x)

    def __getitem__(self, n):
        network = int(self.network_address)
        broadcast = int(self.broadcast_address)
        if n >= 0:
            if network + n > broadcast:
                raise IndexError('address out of range')
            return self._address_class(network + n)
        else:
            n += 1
            if broadcast + n < network:
                raise IndexError('address out of range')
            return self._address_class(broadcast + n)

    def __lt__(self, other):
        if not isinstance(other, _BaseNetwork):
            return NotImplemented
        if self._version != other._version:
            raise TypeError('%s and %s are not of the same version' % (
                             self, other))
        if self.network_address != other.network_address:
            return self.network_address < other.network_address
        if self.netmask != other.netmask:
            return self.netmask < other.netmask
        return False

    def __eq__(self, other):
        try:
            return (self._version == other._version and
                    self.network_address == other.network_address and
                    int(self.netmask) == int(other.netmask))
        except AttributeError:
            return NotImplemented

    def __hash__(self):
        return hash(int(self.network_address) ^ int(self.netmask))

    def __contains__(self, other):
        # always false if one is v4 and the other is v6.
        if self._version != other._version:
            return False
        # dealing with another network.
        if isinstance(other, _BaseNetwork):
            return False
        # dealing with another address
        else:
            # address
            return other._ip & self.netmask._ip == self.network_address._ip

    def overlaps(self, other):
        """Tell if self is partly contained in other."""
        return self.network_address in other or (
            self.broadcast_address in other or (
                other.network_address in self or (
                    other.broadcast_address in self)))

    @functools.cached_property
    def broadcast_address(self):
        return self._address_class(int(self.network_address) |
                                   int(self.hostmask))

    @functools.cached_property
    def hostmask(self):
        return self._address_class(int(self.netmask) ^ self._ALL_ONES)

    @property
    def with_prefixlen(self):
        return '%s/%d' % (self.network_address, self._prefixlen)

    @property
    def with_netmask(self):
        return '%s/%s' % (self.network_address, self.netmask)

    @property
    def with_hostmask(self):
        return '%s/%s' % (self.network_address, self.hostmask)

    @property
    def num_addresses(self):
        """Number of hosts in the current subnet."""
        return int(self.broadcast_address) - int(self.network_address) + 1

    @property
    def _address_class(self):
        # Returning bare address objects (rather than interfaces) allows for
        # more consistent behaviour across the network address, broadcast
        # address and individual host addresses.
        msg = '%200s has no associated address class' % (type(self),)
        raise NotImplementedError(msg)

    @property
    def prefixlen(self):
        return self._prefixlen

    def address_exclude(self, other):
        """Remove an address from a larger block.

        For example:

            addr1 = ip_network('192.0.2.0/28')
            addr2 = ip_network('192.0.2.1/32')
            list(addr1.address_exclude(addr2)) =
                [IPv4Network('192.0.2.0/32'), IPv4Network('192.0.2.2/31'),
                 IPv4Network('192.0.2.4/30'), IPv4Network('192.0.2.8/29')]

        or IPv6:

            addr1 = ip_network('2001:db8::1/32')
            addr2 = ip_network('2001:db8::1/128')
            list(addr1.address_exclude(addr2)) =
                [ip_network('2001:db8::1/128'),
                 ip_network('2001:db8::2/127'),
                 ip_network('2001:db8::4/126'),
                 ip_network('2001:db8::8/125'),
                 ...
                 ip_network('2001:db8:8000::/33')]

        Args:
            other: An IPv4Network or IPv6Network object of the same type.

        Returns:
            An iterator of the IPv(4|6)Network objects which is self
            minus other.

        Raises:
            TypeError: If self and other are of differing address
              versions, or if other is not a network object.
            ValueError: If other is not completely contained by self.

        """
        if not self._version == other._version:
            raise TypeError("%s and %s are not of the same version" % (
                             self, other))

        if not isinstance(other, _BaseNetwork):
            raise TypeError("%s is not a network object" % other)

        if not other.subnet_of(self):
            raise ValueError('%s not contained in %s' % (other, self))
        if other == self:
            return

        # Make sure we're comparing the network of other.
        other = other.__class__('%s/%s' % (other.network_address,
                                           other.prefixlen))

        s1, s2 = self.subnets()
        while s1 != other and s2 != other:
            if other.subnet_of(s1):
                yield s2
                s1, s2 = s1.subnets()
            elif other.subnet_of(s2):
                yield s1
                s1, s2 = s2.subnets()
            else:
                # If we got here, there's a bug somewhere.
                raise AssertionError('Error performing exclusion: '
                                     's1: %s s2: %s other: %s' %
                                     (s1, s2, other))
        if s1 == other:
            yield s2
        elif s2 == other:
            yield s1
        else:
            # If we got here, there's a bug somewhere.
            raise AssertionError('Error performing exclusion: '
                                 's1: %s s2: %s other: %s' %
                                 (s1, s2, other))

    def compare_networks(self, other):
        """Compare two IP objects.

        This is only concerned about the comparison of the integer
        representation of the network addresses.  This means that the
        host bits aren't considered at all in this method.  If you want
        to compare host bits, you can easily enough do a
        'HostA._ip < HostB._ip'

        Args:
            other: An IP object.

        Returns:
            If the IP versions of self and other are the same, returns:

            -1 if self < other:
              eg: IPv4Network('192.0.2.0/25') < IPv4Network('192.0.2.128/25')
              IPv6Network('2001:db8::1000/124') <
                  IPv6Network('2001:db8::2000/124')
            0 if self == other
              eg: IPv4Network('192.0.2.0/24') == IPv4Network('192.0.2.0/24')
              IPv6Network('2001:db8::1000/124') ==
                  IPv6Network('2001:db8::1000/124')
            1 if self > other
              eg: IPv4Network('192.0.2.128/25') > IPv4Network('192.0.2.0/25')
                  IPv6Network('2001:db8::2000/124') >
                      IPv6Network('2001:db8::1000/124')

          Raises:
              TypeError if the IP versions are different.

        """
        # does this need to raise a ValueError?
        if self._version != other._version:
            raise TypeError('%s and %s are not of the same type' % (
                             self, other))
        # self._version == other._version below here:
        if self.network_address < other.network_address:
            return -1
        if self.network_address > other.network_address:
            return 1
        # self.network_address == other.network_address below here:
        if self.netmask < other.netmask:
            return -1
        if self.netmask > other.netmask:
            return 1
        return 0

    def _get_networks_key(self):
        """Network-only key function.

        Returns an object that identifies this address' network and
        netmask. This function is a suitable "key" argument for sorted()
        and list.sort().

        """
        return (self._version, self.network_address, self.netmask)

    def subnets(self, prefixlen_diff=1, new_prefix=None):
        """The subnets which join to make the current subnet.

        In the case that self contains only one IP
        (self._prefixlen == 32 for IPv4 or self._prefixlen == 128
        for IPv6), yield an iterator with just ourself.

        Args:
            prefixlen_diff: An integer, the amount the prefix length
              should be increased by. This should not be set if
              new_prefix is also set.
            new_prefix: The desired new prefix length. This must be a
              larger number (smaller prefix) than the existing prefix.
              This should not be set if prefixlen_diff is also set.

        Returns:
            An iterator of IPv(4|6) objects.

        Raises:
            ValueError: The prefixlen_diff is too small or too large.
                OR
            prefixlen_diff and new_prefix are both set or new_prefix
              is a smaller number than the current prefix (smaller
              number means a larger network)

        """
        if self._prefixlen == self._max_prefixlen:
            yield self
            return

        if new_prefix is not None:
            if new_prefix < self._prefixlen:
                raise ValueError('new prefix must be longer')
            if prefixlen_diff != 1:
                raise ValueError('cannot set prefixlen_diff and new_prefix')
            prefixlen_diff = new_prefix - self._prefixlen

        if prefixlen_diff < 0:
            raise ValueError('prefix length diff must be > 0')
        new_prefixlen = self._prefixlen + prefixlen_diff

        if new_prefixlen > self._max_prefixlen:
            raise ValueError(
                'prefix length diff %d is invalid for netblock %s' % (
                    new_prefixlen, self))

        start = int(self.network_address)
        end = int(self.broadcast_address) + 1
        step = (int(self.hostmask) + 1) >> prefixlen_diff
        for new_addr in range(start, end, step):
            current = self.__class__((new_addr, new_prefixlen))
            yield current

    def supernet(self, prefixlen_diff=1, new_prefix=None):
        """The supernet containing the current network.

        Args:
            prefixlen_diff: An integer, the amount the prefix length of
              the network should be decreased by.  For example, given a
              /24 network and a prefixlen_diff of 3, a supernet with a
              /21 netmask is returned.

        Returns:
            An IPv4 network object.

        Raises:
            ValueError: If self.prefixlen - prefixlen_diff < 0. I.e., you have
              a negative prefix length.
                OR
            If prefixlen_diff and new_prefix are both set or new_prefix is a
              larger number than the current prefix (larger number means a
              smaller network)

        """
        if self._prefixlen == 0:
            return self

        if new_prefix is not None:
            if new_prefix > self._prefixlen:
                raise ValueError('new prefix must be shorter')
            if prefixlen_diff != 1:
                raise ValueError('cannot set prefixlen_diff and new_prefix')
            prefixlen_diff = self._prefixlen - new_prefix

        new_prefixlen = self.prefixlen - prefixlen_diff
        if new_prefixlen < 0:
            raise ValueError(
                'current prefixlen is %d, cannot have a prefixlen_diff of %d' %
                (self.prefixlen, prefixlen_diff))
        return self.__class__((
            int(self.network_address) & (int(self.netmask) << prefixlen_diff),
            new_prefixlen
            ))

    @property
    def is_multicast(self):
        """Test if the address is reserved for multicast use.

        Returns:
            A boolean, True if the address is a multicast address.
            See RFC 2373 2.7 for details.

        """
        return (self.network_address.is_multicast and
                self.broadcast_address.is_multicast)

    @staticmethod
    def _is_subnet_of(a, b):
        try:
            # Always false if one is v4 and the other is v6.
            if a._version != b._version:
                raise TypeError(f"{a} and {b} are not of the same version")
            return (b.network_address <= a.network_address and
                    b.broadcast_address >= a.broadcast_address)
        except AttributeError:
            raise TypeError(f"Unable to test subnet containment "
                            f"between {a} and {b}")

    def subnet_of(self, other):
        """Return True if this network is a subnet of other."""
        return self._is_subnet_of(self, other)

    def supernet_of(self, other):
        """Return True if this network is a supernet of other."""
        return self._is_subnet_of(other, self)

    @property
    def is_reserved(self):
        """Test if the address is otherwise IETF reserved.

        Returns:
            A boolean, True if the address is within one of the
            reserved IPv6 Network ranges.

        """
        return (self.network_address.is_reserved and
                self.broadcast_address.is_reserved)

    @property
    def is_link_local(self):
        """Test if the address is reserved for link-local.

        Returns:
            A boolean, True if the address is reserved per RFC 4291.

        """
        return (self.network_address.is_link_local and
                self.broadcast_address.is_link_local)

    @property
    def is_private(self):
        """Test if this address is allocated for private networks.

        Returns:
            A boolean, True if the address is reserved per
            iana-ipv4-special-registry or iana-ipv6-special-registry.

        """
        return (self.network_address.is_private and
                self.broadcast_address.is_private)

    @property
    def is_global(self):
        """Test if this address is allocated for public networks.

        Returns:
            A boolean, True if the address is not reserved per
            iana-ipv4-special-registry or iana-ipv6-special-registry.

        """
        return not self.is_private

    @property
    def is_unspecified(self):
        """Test if the address is unspecified.

        Returns:
            A boolean, True if this is the unspecified address as defined in
            RFC 2373 2.5.2.

        """
        return (self.network_address.is_unspecified and
                self.broadcast_address.is_unspecified)

    @property
    def is_loopback(self):
        """Test if the address is a loopback address.

        Returns:
            A boolean, True if the address is a loopback address as defined in
            RFC 2373 2.5.3.

        """
        return (self.network_address.is_loopback and
                self.broadcast_address.is_loopback)


class _BaseV4:

    """Base IPv4 object.

    The following methods are used by IPv4 objects in both single IP
    addresses and networks.

    """

    __slots__ = ()
    _version = 4
    # Equivalent to 255.255.255.255 or 32 bits of 1's.
    _ALL_ONES = (2**IPV4LENGTH) - 1

    _max_prefixlen = IPV4LENGTH
    # There are only a handful of valid v4 netmasks, so we cache them all
    # when constructed (see _make_netmask()).
    _netmask_cache = {}

    def _explode_shorthand_ip_string(self):
        return str(self)

    @classmethod
    def _make_netmask(cls, arg):
        """Make a (netmask, prefix_len) tuple from the given argument.

        Argument can be:
        - an integer (the prefix length)
        - a string representing the prefix length (e.g. "24")
        - a string representing the prefix netmask (e.g. "255.255.255.0")
        """
        if arg not in cls._netmask_cache:
            if isinstance(arg, int):
                prefixlen = arg
                if not (0 <= prefixlen <= cls._max_prefixlen):
                    cls._report_invalid_netmask(prefixlen)
            else:
                try:
                    # Check for a netmask in prefix length form
                    prefixlen = cls._prefix_from_prefix_string(arg)
                except NetmaskValueError:
                    # Check for a netmask or hostmask in dotted-quad form.
                    # This may raise NetmaskValueError.
                    prefixlen = cls._prefix_from_ip_string(arg)
            netmask = IPv4Address(cls._ip_int_from_prefix(prefixlen))
            cls._netmask_cache[arg] = netmask, prefixlen
        return cls._netmask_cache[arg]

    @classmethod
    def _ip_int_from_string(cls, ip_str):
        """Turn the given IP string into an integer for comparison.

        Args:
            ip_str: A string, the IP ip_str.

        Returns:
            The IP ip_str as an integer.

        Raises:
            AddressValueError: if ip_str isn't a valid IPv4 Address.

        """
        if not ip_str:
            raise AddressValueError('Address cannot be empty')

        octets = ip_str.split('.')
        if len(octets) != 4:
            raise AddressValueError("Expected 4 octets in %r" % ip_str)

        try:
            return int.from_bytes(map(cls._parse_octet, octets), 'big')
        except ValueError as exc:
            raise AddressValueError("%s in %r" % (exc, ip_str)) from None

    @classmethod
    def _parse_octet(cls, octet_str):
        """Convert a decimal octet into an integer.

        Args:
            octet_str: A string, the number to parse.

        Returns:
            The octet as an integer.

        Raises:
            ValueError: if the octet isn't strictly a decimal from [0..255].

        """
        if not octet_str:
            raise ValueError("Empty octet not permitted")
        # Whitelist the characters, since int() allows a lot of bizarre stuff.
        if not (octet_str.isascii() and octet_str.isdigit()):
            msg = "Only decimal digits permitted in %r"
            raise ValueError(msg % octet_str)
        # We do the length check second, since the invalid character error
        # is likely to be more informative for the user
        if len(octet_str) > 3:
            msg = "At most 3 characters permitted in %r"
            raise ValueError(msg % octet_str)
        # Handle leading zeros as strict as glibc's inet_pton()
        # See security bug bpo-36384
        if octet_str != '0' and octet_str[0] == '0':
            msg = "Leading zeros are not permitted in %r"
            raise ValueError(msg % octet_str)
        # Convert to integer (we know digits are legal)
        octet_int = int(octet_str, 10)
        if octet_int > 255:
            raise ValueError("Octet %d (> 255) not permitted" % octet_int)
        return octet_int

    @classmethod
    def _string_from_ip_int(cls, ip_int):
        """Turns a 32-bit integer into dotted decimal notation.

        Args:
            ip_int: An integer, the IP address.

        Returns:
            The IP address as a string in dotted decimal notation.

        """
        return '.'.join(map(str, ip_int.to_bytes(4, 'big')))

    def _reverse_pointer(self):
        """Return the reverse DNS pointer name for the IPv4 address.

        This implements the method described in RFC1035 3.5.

        """
        reverse_octets = str(self).split('.')[::-1]
        return '.'.join(reverse_octets) + '.in-addr.arpa'

    @property
    def max_prefixlen(self):
        return self._max_prefixlen

    @property
    def version(self):
        return self._version


class IPv4Address(_BaseV4, _BaseAddress):

    """Represent and manipulate single IPv4 Addresses."""

    __slots__ = ('_ip', '__weakref__')

    def __init__(self, address):

        """
        Args:
            address: A string or integer representing the IP

              Additionally, an integer can be passed, so
              IPv4Address('192.0.2.1') == IPv4Address(3221225985).
              or, more generally
              IPv4Address(int(IPv4Address('192.0.2.1'))) ==
                IPv4Address('192.0.2.1')

        Raises:
            AddressValueError: If ipaddress isn't a valid IPv4 address.

        """
        # Efficient constructor from integer.
        if isinstance(address, int):
            self._check_int_address(address)
            self._ip = address
            return

        # Constructing from a packed address
        if isinstance(address, bytes):
            self._check_packed_address(address, 4)
            self._ip = int.from_bytes(address, 'big')
            return

        # Assume input argument to be string or any object representation
        # which converts into a formatted IP string.
        addr_str = str(address)
        if '/' in addr_str:
            raise AddressValueError("Unexpected '/' in %r" % address)
        self._ip = self._ip_int_from_string(addr_str)

    @property
    def packed(self):
        """The binary representation of this address."""
        return v4_int_to_packed(self._ip)

    @property
    def is_reserved(self):
        """Test if the address is otherwise IETF reserved.

         Returns:
             A boolean, True if the address is within the
             reserved IPv4 Network range.

        """
        return self in self._constants._reserved_network

    @property
    @functools.lru_cache()
    def is_private(self):
        """Test if this address is allocated for private networks.

        Returns:
            A boolean, True if the address is reserved per
            iana-ipv4-special-registry.

        """
        return any(self in net for net in self._constants._private_networks)

    @property
    @functools.lru_cache()
    def is_global(self):
        return self not in self._constants._public_network and not self.is_private

    @property
    def is_multicast(self):
        """Test if the address is reserved for multicast use.

        Returns:
            A boolean, True if the address is multicast.
            See RFC 3171 for details.

        """
        return self in self._constants._multicast_network

    @property
    def is_unspecified(self):
        """Test if the address is unspecified.

        Returns:
            A boolean, True if this is the unspecified address as defined in
            RFC 5735 3.

        """
        return self == self._constants._unspecified_address

    @property
    def is_loopback(self):
        """Test if the address is a loopback address.

        Returns:
            A boolean, True if the address is a loopback per RFC 3330.

        """
        return self in self._constants._loopback_network

    @property
    def is_link_local(self):
        """Test if the address is reserved for link-local.

        Returns:
            A boolean, True if the address is link-local per RFC 3927.

        """
        return self in self._constants._linklocal_network


class IPv4Interface(IPv4Address):

    def __init__(self, address):
        addr, mask = self._split_addr_prefix(address)

        IPv4Address.__init__(self, addr)
        self.network = IPv4Network((addr, mask), strict=False)
        self.netmask = self.network.netmask
        self._prefixlen = self.network._prefixlen

    @functools.cached_property
    def hostmask(self):
        return self.network.hostmask

    def __str__(self):
        return '%s/%d' % (self._string_from_ip_int(self._ip),
                          self._prefixlen)

    def __eq__(self, other):
        address_equal = IPv4Address.__eq__(self, other)
        if not address_equal or address_equal is NotImplemented:
            return address_equal
        try:
            return self.network == other.network
        except AttributeError:
            # An interface with an associated network is NOT the
            # same as an unassociated address. That's why the hash
            # takes the extra info into account.
            return False

    def __lt__(self, other):
        address_less = IPv4Address.__lt__(self, other)
        if address_less is NotImplemented:
            return NotImplemented
        try:
            return (self.network < other.network or
                    self.network == other.network and address_less)
        except AttributeError:
            # We *do* allow addresses and interfaces to be sorted. The
            # unassociated address is considered less than all interfaces.
            return False

    def __hash__(self):
        return hash((self._ip, self._prefixlen, int(self.network.network_address)))

    __reduce__ = _IPAddressBase.__reduce__

    @property
    def ip(self):
        return IPv4Address(self._ip)

    @property
    def with_prefixlen(self):
        return '%s/%s' % (self._string_from_ip_int(self._ip),
                          self._prefixlen)

    @property
    def with_netmask(self):
        return '%s/%s' % (self._string_from_ip_int(self._ip),
                          self.netmask)

    @property
    def with_hostmask(self):
        return '%s/%s' % (self._string_from_ip_int(self._ip),
                          self.hostmask)


class IPv4Network(_BaseV4, _BaseNetwork):

    """This class represents and manipulates 32-bit IPv4 network + addresses..

    Attributes: [examples for IPv4Network('192.0.2.0/27')]
        .network_address: IPv4Address('192.0.2.0')
        .hostmask: IPv4Address('0.0.0.31')
        .broadcast_address: IPv4Address('192.0.2.32')
        .netmask: IPv4Address('255.255.255.224')
        .prefixlen: 27

    """
    # Class to use when creating address objects
    _address_class = IPv4Address

    def __init__(self, address, strict=True):
        """Instantiate a new IPv4 network object.

        Args:
            address: A string or integer representing the IP [& network].
              '192.0.2.0/24'
              '192.0.2.0/255.255.255.0'
              '192.0.2.0/0.0.0.255'
              are all functionally the same in IPv4. Similarly,
              '192.0.2.1'
              '192.0.2.1/255.255.255.255'
              '192.0.2.1/32'
              are also functionally equivalent. That is to say, failing to
              provide a subnetmask will create an object with a mask of /32.

              If the mask (portion after the / in the argument) is given in
              dotted quad form, it is treated as a netmask if it starts with a
              non-zero field (e.g. /255.0.0.0 == /8) and as a hostmask if it
              starts with a zero field (e.g. 0.255.255.255 == /8), with the
              single exception of an all-zero mask which is treated as a
              netmask == /0. If no mask is given, a default of /32 is used.

              Additionally, an integer can be passed, so
              IPv4Network('192.0.2.1') == IPv4Network(3221225985)
              or, more generally
              IPv4Interface(int(IPv4Interface('192.0.2.1'))) ==
                IPv4Interface('192.0.2.1')

        Raises:
            AddressValueError: If ipaddress isn't a valid IPv4 address.
            NetmaskValueError: If the netmask isn't valid for
              an IPv4 address.
            ValueError: If strict is True and a network address is not
              supplied.
        """
        addr, mask = self._split_addr_prefix(address)

        self.network_address = IPv4Address(addr)
        self.netmask, self._prefixlen = self._make_netmask(mask)
        packed = int(self.network_address)
        if packed & int(self.netmask) != packed:
            if strict:
                raise ValueError('%s has host bits set' % self)
            else:
                self.network_address = IPv4Address(packed &
                                                   int(self.netmask))

        if self._prefixlen == (self._max_prefixlen - 1):
            self.hosts = self.__iter__
        elif self._prefixlen == (self._max_prefixlen):
            self.hosts = lambda: [IPv4Address(addr)]

    @property
    @functools.lru_cache()
    def is_global(self):
        """Test if this address is allocated for public networks.

        Returns:
            A boolean, True if the address is not reserved per
            iana-ipv4-special-registry.

        """
        return (not (self.network_address in IPv4Network('100.64.0.0/10') and
                    self.broadcast_address in IPv4Network('100.64.0.0/10')) and
                not self.is_private)


class _IPv4Constants:
    _linklocal_network = IPv4Network('169.254.0.0/16')

    _loopback_network = IPv4Network('127.0.0.0/8')

    _multicast_network = IPv4Network('224.0.0.0/4')

    _public_network = IPv4Network('100.64.0.0/10')

    _private_networks = [
        IPv4Network('0.0.0.0/8'),
        IPv4Network('10.0.0.0/8'),
        IPv4Network('127.0.0.0/8'),
        IPv4Network('169.254.0.0/16'),
        IPv4Network('172.16.0.0/12'),
        IPv4Network('192.0.0.0/29'),
        IPv4Network('192.0.0.170/31'),
        IPv4Network('192.0.2.0/24'),
        IPv4Network('192.168.0.0/16'),
        IPv4Network('198.18.0.0/15'),
        IPv4Network('198.51.100.0/24'),
        IPv4Network('203.0.113.0/24'),
        IPv4Network('240.0.0.0/4'),
        IPv4Network('255.255.255.255/32'),
        ]

    _reserved_network = IPv4Network('240.0.0.0/4')

    _unspecified_address = IPv4Address('0.0.0.0')


IPv4Address._constants = _IPv4Constants


class _BaseV6:

    """Base IPv6 object.

    The following methods are used by IPv6 objects in both single IP
    addresses and networks.

    """

    __slots__ = ()
    _version = 6
    _ALL_ONES = (2**IPV6LENGTH) - 1
    _HEXTET_COUNT = 8
    _HEX_DIGITS = frozenset('0123456789ABCDEFabcdef')
    _max_prefixlen = IPV6LENGTH

    # There are only a bunch of valid v6 netmasks, so we cache them all
    # when constructed (see _make_netmask()).
    _netmask_cache = {}

    @classmethod
    def _make_netmask(cls, arg):
        """Make a (netmask, prefix_len) tuple from the given argument.

        Argument can be:
        - an integer (the prefix length)
        - a string representing the prefix length (e.g. "24")
        - a string representing the prefix netmask (e.g. "255.255.255.0")
        """
        if arg not in cls._netmask_cache:
            if isinstance(arg, int):
                prefixlen = arg
                if not (0 <= prefixlen <= cls._max_prefixlen):
                    cls._report_invalid_netmask(prefixlen)
            else:
                prefixlen = cls._prefix_from_prefix_string(arg)
            netmask = IPv6Address(cls._ip_int_from_prefix(prefixlen))
            cls._netmask_cache[arg] = netmask, prefixlen
        return cls._netmask_cache[arg]

    @classmethod
    def _ip_int_from_string(cls, ip_str):
        """Turn an IPv6 ip_str into an integer.

        Args:
            ip_str: A string, the IPv6 ip_str.

        Returns:
            An int, the IPv6 address

        Raises:
            AddressValueError: if ip_str isn't a valid IPv6 Address.

        """
        if not ip_str:
            raise AddressValueError('Address cannot be empty')

        parts = ip_str.split(':')

        # An IPv6 address needs at least 2 colons (3 parts).
        _min_parts = 3
        if len(parts) < _min_parts:
            msg = "At least %d parts expected in %r" % (_min_parts, ip_str)
            raise AddressValueError(msg)

        # If the address has an IPv4-style suffix, convert it to hexadecimal.
        if '.' in parts[-1]:
            try:
                ipv4_int = IPv4Address(parts.pop())._ip
            except AddressValueError as exc:
                raise AddressValueError("%s in %r" % (exc, ip_str)) from None
            parts.append('%x' % ((ipv4_int >> 16) & 0xFFFF))
            parts.append('%x' % (ipv4_int & 0xFFFF))

        # An IPv6 address can't have more than 8 colons (9 parts).
        # The extra colon comes from using the "::" notation for a single
        # leading or trailing zero part.
        _max_parts = cls._HEXTET_COUNT + 1
        if len(parts) > _max_parts:
            msg = "At most %d colons permitted in %r" % (_max_parts-1, ip_str)
            raise AddressValueError(msg)

        # Disregarding the endpoints, find '::' with nothing in between.
        # This indicates that a run of zeroes has been skipped.
        skip_index = None
        for i in range(1, len(parts) - 1):
            if not parts[i]:
                if skip_index is not None:
                    # Can't have more than one '::'
                    msg = "At most one '::' permitted in %r" % ip_str
                    raise AddressValueError(msg)
                skip_index = i

        # parts_hi is the number of parts to copy from above/before the '::'
        # parts_lo is the number of parts to copy from below/after the '::'
        if skip_index is not None:
            # If we found a '::', then check if it also covers the endpoints.
            parts_hi = skip_index
            parts_lo = len(parts) - skip_index - 1
            if not parts[0]:
                parts_hi -= 1
                if parts_hi:
                    msg = "Leading ':' only permitted as part of '::' in %r"
                    raise AddressValueError(msg % ip_str)  # ^: requires ^::
            if not parts[-1]:
                parts_lo -= 1
                if parts_lo:
                    msg = "Trailing ':' only permitted as part of '::' in %r"
                    raise AddressValueError(msg % ip_str)  # :$ requires ::$
            parts_skipped = cls._HEXTET_COUNT - (parts_hi + parts_lo)
            if parts_skipped < 1:
                msg = "Expected at most %d other parts with '::' in %r"
                raise AddressValueError(msg % (cls._HEXTET_COUNT-1, ip_str))
        else:
            # Otherwise, allocate the entire address to parts_hi.  The
            # endpoints could still be empty, but _parse_hextet() will check
            # for that.
            if len(parts) != cls._HEXTET_COUNT:
                msg = "Exactly %d parts expected without '::' in %r"
                raise AddressValueError(msg % (cls._HEXTET_COUNT, ip_str))
            if not parts[0]:
                msg = "Leading ':' only permitted as part of '::' in %r"
                raise AddressValueError(msg % ip_str)  # ^: requires ^::
            if not parts[-1]:
                msg = "Trailing ':' only permitted as part of '::' in %r"
                raise AddressValueError(msg % ip_str)  # :$ requires ::$
            parts_hi = len(parts)
            parts_lo = 0
            parts_skipped = 0

        try:
            # Now, parse the hextets into a 128-bit integer.
            ip_int = 0
            for i in range(parts_hi):
                ip_int <<= 16
                ip_int |= cls._parse_hextet(parts[i])
            ip_int <<= 16 * parts_skipped
            for i in range(-parts_lo, 0):
                ip_int <<= 16
                ip_int |= cls._parse_hextet(parts[i])
            return ip_int
        except ValueError as exc:
            raise AddressValueError("%s in %r" % (exc, ip_str)) from None

    @classmethod
    def _parse_hextet(cls, hextet_str):
        """Convert an IPv6 hextet string into an integer.

        Args:
            hextet_str: A string, the number to parse.

        Returns:
            The hextet as an integer.

        Raises:
            ValueError: if the input isn't strictly a hex number from
              [0..FFFF].

        """
        # Whitelist the characters, since int() allows a lot of bizarre stuff.
        if not cls._HEX_DIGITS.issuperset(hextet_str):
            raise ValueError("Only hex digits permitted in %r" % hextet_str)
        # We do the length check second, since the invalid character error
        # is likely to be more informative for the user
        if len(hextet_str) > 4:
            msg = "At most 4 characters permitted in %r"
            raise ValueError(msg % hextet_str)
        # Length check means we can skip checking the integer value
        return int(hextet_str, 16)

    @classmethod
    def _compress_hextets(cls, hextets):
        """Compresses a list of hextets.

        Compresses a list of strings, replacing the longest continuous
        sequence of "0" in the list with "" and adding empty strings at
        the beginning or at the end of the string such that subsequently
        calling ":".join(hextets) will produce the compressed version of
        the IPv6 address.

        Args:
            hextets: A list of strings, the hextets to compress.

        Returns:
            A list of strings.

        """
        best_doublecolon_start = -1
        best_doublecolon_len = 0
        doublecolon_start = -1
        doublecolon_len = 0
        for index, hextet in enumerate(hextets):
            if hextet == '0':
                doublecolon_len += 1
                if doublecolon_start == -1:
                    # Start of a sequence of zeros.
                    doublecolon_start = index
                if doublecolon_len > best_doublecolon_len:
                    # This is the longest sequence of zeros so far.
                    best_doublecolon_len = doublecolon_len
                    best_doublecolon_start = doublecolon_start
            else:
                doublecolon_len = 0
                doublecolon_start = -1

        if best_doublecolon_len > 1:
            best_doublecolon_end = (best_doublecolon_start +
                                    best_doublecolon_len)
            # For zeros at the end of the address.
            if best_doublecolon_end == len(hextets):
                hextets += ['']
            hextets[best_doublecolon_start:best_doublecolon_end] = ['']
            # For zeros at the beginning of the address.
            if best_doublecolon_start == 0:
                hextets = [''] + hextets

        return hextets

    @classmethod
    def _string_from_ip_int(cls, ip_int=None):
        """Turns a 128-bit integer into hexadecimal notation.

        Args:
            ip_int: An integer, the IP address.

        Returns:
            A string, the hexadecimal representation of the address.

        Raises:
            ValueError: The address is bigger than 128 bits of all ones.

        """
        if ip_int is None:
            ip_int = int(cls._ip)

        if ip_int > cls._ALL_ONES:
            raise ValueError('IPv6 address is too large')

        hex_str = '%032x' % ip_int
        hextets = ['%x' % int(hex_str[x:x+4], 16) for x in range(0, 32, 4)]

        hextets = cls._compress_hextets(hextets)
        return ':'.join(hextets)

    def _explode_shorthand_ip_string(self):
        """Expand a shortened IPv6 address.

        Args:
            ip_str: A string, the IPv6 address.

        Returns:
            A string, the expanded IPv6 address.

        """
        if isinstance(self, IPv6Network):
            ip_str = str(self.network_address)
        elif isinstance(self, IPv6Interface):
            ip_str = str(self.ip)
        else:
            ip_str = str(self)

        ip_int = self._ip_int_from_string(ip_str)
        hex_str = '%032x' % ip_int
        parts = [hex_str[x:x+4] for x in range(0, 32, 4)]
        if isinstance(self, (_BaseNetwork, IPv6Interface)):
            return '%s/%d' % (':'.join(parts), self._prefixlen)
        return ':'.join(parts)

    def _reverse_pointer(self):
        """Return the reverse DNS pointer name for the IPv6 address.

        This implements the method described in RFC3596 2.5.

        """
        reverse_chars = self.exploded[::-1].replace(':', '')
        return '.'.join(reverse_chars) + '.ip6.arpa'

    @property
    def max_prefixlen(self):
        return self._max_prefixlen

    @property
    def version(self):
        return self._version


class IPv6Address(_BaseV6, _BaseAddress):

    """Represent and manipulate single IPv6 Addresses."""

    __slots__ = ('_ip', '__weakref__')

    def __init__(self, address):
        """Instantiate a new IPv6 address object.

        Args:
            address: A string or integer representing the IP

              Additionally, an integer can be passed, so
              IPv6Address('2001:db8::') ==
                IPv6Address(42540766411282592856903984951653826560)
              or, more generally
              IPv6Address(int(IPv6Address('2001:db8::'))) ==
                IPv6Address('2001:db8::')

        Raises:
            AddressValueError: If address isn't a valid IPv6 address.

        """
        # Efficient constructor from integer.
        if isinstance(address, int):
            self._check_int_address(address)
            self._ip = address
            return

        # Constructing from a packed address
        if isinstance(address, bytes):
            self._check_packed_address(address, 16)
            self._ip = int.from_bytes(address, 'big')
            return

        # Assume input argument to be string or any object representation
        # which converts into a formatted IP string.
        addr_str = str(address)
        if '/' in addr_str:
            raise AddressValueError("Unexpected '/' in %r" % address)
        self._ip = self._ip_int_from_string(addr_str)

    @property
    def packed(self):
        """The binary representation of this address."""
        return v6_int_to_packed(self._ip)

    @property
    def is_multicast(self):
        """Test if the address is reserved for multicast use.

        Returns:
            A boolean, True if the address is a multicast address.
            See RFC 2373 2.7 for details.

        """
        return self in self._constants._multicast_network

    @property
    def is_reserved(self):
        """Test if the address is otherwise IETF reserved.

        Returns:
            A boolean, True if the address is within one of the
            reserved IPv6 Network ranges.

        """
        return any(self in x for x in self._constants._reserved_networks)

    @property
    def is_link_local(self):
        """Test if the address is reserved for link-local.

        Returns:
            A boolean, True if the address is reserved per RFC 4291.

        """
        return self in self._constants._linklocal_network

    @property
    def is_site_local(self):
        """Test if the address is reserved for site-local.

        Note that the site-local address space has been deprecated by RFC 3879.
        Use is_private to test if this address is in the space of unique local
        addresses as defined by RFC 4193.

        Returns:
            A boolean, True if the address is reserved per RFC 3513 2.5.6.

        """
        return self in self._constants._sitelocal_network

    @property
    @functools.lru_cache()
    def is_private(self):
        """Test if this address is allocated for private networks.

        Returns:
            A boolean, True if the address is reserved per
            iana-ipv6-special-registry.

        """
        return any(self in net for net in self._constants._private_networks)

    @property
    def is_global(self):
        """Test if this address is allocated for public networks.

        Returns:
            A boolean, true if the address is not reserved per
            iana-ipv6-special-registry.

        """
        return not self.is_private

    @property
    def is_unspecified(self):
        """Test if the address is unspecified.

        Returns:
            A boolean, True if this is the unspecified address as defined in
            RFC 2373 2.5.2.

        """
        return self._ip == 0

    @property
    def is_loopback(self):
        """Test if the address is a loopback address.

        Returns:
            A boolean, True if the address is a loopback address as defined in
            RFC 2373 2.5.3.

        """
        return self._ip == 1

    @property
    def ipv4_mapped(self):
        """Return the IPv4 mapped address.

        Returns:
            If the IPv6 address is a v4 mapped address, return the
            IPv4 mapped address. Return None otherwise.

        """
        if (self._ip >> 32) != 0xFFFF:
            return None
        return IPv4Address(self._ip & 0xFFFFFFFF)

    @property
    def teredo(self):
        """Tuple of embedded teredo IPs.

        Returns:
            Tuple of the (server, client) IPs or None if the address
            doesn't appear to be a teredo address (doesn't start with
            2001::/32)

        """
        if (self._ip >> 96) != 0x20010000:
            return None
        return (IPv4Address((self._ip >> 64) & 0xFFFFFFFF),
                IPv4Address(~self._ip & 0xFFFFFFFF))

    @property
    def sixtofour(self):
        """Return the IPv4 6to4 embedded address.

        Returns:
            The IPv4 6to4-embedded address if present or None if the
            address doesn't appear to contain a 6to4 embedded address.

        """
        if (self._ip >> 112) != 0x2002:
            return None
        return IPv4Address((self._ip >> 80) & 0xFFFFFFFF)


class IPv6Interface(IPv6Address):

    def __init__(self, address):
        addr, mask = self._split_addr_prefix(address)

        IPv6Address.__init__(self, addr)
        self.network = IPv6Network((addr, mask), strict=False)
        self.netmask = self.network.netmask
        self._prefixlen = self.network._prefixlen

    @functools.cached_property
    def hostmask(self):
        return self.network.hostmask

    def __str__(self):
        return '%s/%d' % (self._string_from_ip_int(self._ip),
                          self._prefixlen)

    def __eq__(self, other):
        address_equal = IPv6Address.__eq__(self, other)
        if not address_equal or address_equal is NotImplemented:
            return address_equal
        try:
            return self.network == other.network
        except AttributeError:
            # An interface with an associated network is NOT the
            # same as an unassociated address. That's why the hash
            # takes the extra info into account.
            return False

    def __lt__(self, other):
        address_less = IPv6Address.__lt__(self, other)
        if address_less is NotImplemented:
            return NotImplemented
        try:
            return (self.network < other.network or
                    self.network == other.network and address_less)
        except AttributeError:
            # We *do* allow addresses and interfaces to be sorted. The
            # unassociated address is considered less than all interfaces.
            return False

    def __hash__(self):
        return hash((self._ip, self._prefixlen, int(self.network.network_address)))

    __reduce__ = _IPAddressBase.__reduce__

    @property
    def ip(self):
        return IPv6Address(self._ip)

    @property
    def with_prefixlen(self):
        return '%s/%s' % (self._string_from_ip_int(self._ip),
                          self._prefixlen)

    @property
    def with_netmask(self):
        return '%s/%s' % (self._string_from_ip_int(self._ip),
                          self.netmask)

    @property
    def with_hostmask(self):
        return '%s/%s' % (self._string_from_ip_int(self._ip),
                          self.hostmask)

    @property
    def is_unspecified(self):
        return self._ip == 0 and self.network.is_unspecified

    @property
    def is_loopback(self):
        return self._ip == 1 and self.network.is_loopback


class IPv6Network(_BaseV6, _BaseNetwork):

    """This class represents and manipulates 128-bit IPv6 networks.

    Attributes: [examples for IPv6('2001:db8::1000/124')]
        .network_address: IPv6Address('2001:db8::1000')
        .hostmask: IPv6Address('::f')
        .broadcast_address: IPv6Address('2001:db8::100f')
        .netmask: IPv6Address('ffff:ffff:ffff:ffff:ffff:ffff:ffff:fff0')
        .prefixlen: 124

    """

    # Class to use when creating address objects
    _address_class = IPv6Address

    def __init__(self, address, strict=True):
        """Instantiate a new IPv6 Network object.

        Args:
            address: A string or integer representing the IPv6 network or the
              IP and prefix/netmask.
              '2001:db8::/128'
              '2001:db8:0000:0000:0000:0000:0000:0000/128'
              '2001:db8::'
              are all functionally the same in IPv6.  That is to say,
              failing to provide a subnetmask will create an object with
              a mask of /128.

              Additionally, an integer can be passed, so
              IPv6Network('2001:db8::') ==
                IPv6Network(42540766411282592856903984951653826560)
              or, more generally
              IPv6Network(int(IPv6Network('2001:db8::'))) ==
                IPv6Network('2001:db8::')

            strict: A boolean. If true, ensure that we have been passed
              A true network address, eg, 2001:db8::1000/124 and not an
              IP address on a network, eg, 2001:db8::1/124.

        Raises:
            AddressValueError: If address isn't a valid IPv6 address.
            NetmaskValueError: If the netmask isn't valid for
              an IPv6 address.
            ValueError: If strict was True and a network address was not
              supplied.
        """
        addr, mask = self._split_addr_prefix(address)

        self.network_address = IPv6Address(addr)
        self.netmask, self._prefixlen = self._make_netmask(mask)
        packed = int(self.network_address)
        if packed & int(self.netmask) != packed:
            if strict:
                raise ValueError('%s has host bits set' % self)
            else:
                self.network_address = IPv6Address(packed &
                                                   int(self.netmask))

        if self._prefixlen == (self._max_prefixlen - 1):
            self.hosts = self.__iter__
        elif self._prefixlen == self._max_prefixlen:
            self.hosts = lambda: [IPv6Address(addr)]

    def hosts(self):
        """Generate Iterator over usable hosts in a network.

          This is like __iter__ except it doesn't return the
          Subnet-Router anycast address.

        """
        network = int(self.network_address)
        broadcast = int(self.broadcast_address)
        for x in range(network + 1, broadcast + 1):
            yield self._address_class(x)

    @property
    def is_site_local(self):
        """Test if the address is reserved for site-local.

        Note that the site-local address space has been deprecated by RFC 3879.
        Use is_private to test if this address is in the space of unique local
        addresses as defined by RFC 4193.

        Returns:
            A boolean, True if the address is reserved per RFC 3513 2.5.6.

        """
        return (self.network_address.is_site_local and
                self.broadcast_address.is_site_local)


class _IPv6Constants:

    _linklocal_network = IPv6Network('fe80::/10')

    _multicast_network = IPv6Network('ff00::/8')

    _private_networks = [
        IPv6Network('::1/128'),
        IPv6Network('::/128'),
        IPv6Network('::ffff:0:0/96'),
        IPv6Network('100::/64'),
        IPv6Network('2001::/23'),
        IPv6Network('2001:2::/48'),
        IPv6Network('2001:db8::/32'),
        IPv6Network('2001:10::/28'),
        IPv6Network('fc00::/7'),
        IPv6Network('fe80::/10'),
        ]

    _reserved_networks = [
        IPv6Network('::/8'), IPv6Network('100::/8'),
        IPv6Network('200::/7'), IPv6Network('400::/6'),
        IPv6Network('800::/5'), IPv6Network('1000::/4'),
        IPv6Network('4000::/3'), IPv6Network('6000::/3'),
        IPv6Network('8000::/3'), IPv6Network('A000::/3'),
        IPv6Network('C000::/3'), IPv6Network('E000::/4'),
        IPv6Network('F000::/5'), IPv6Network('F800::/6'),
        IPv6Network('FE00::/9'),
    ]

    _sitelocal_network = IPv6Network('fec0::/10')


IPv6Address._constants = _IPv6Constants
lib2to3/Grammar.txt000064400000020744151153537460010172 0ustar00# Grammar for 2to3. This grammar supports Python 2.x and 3.x.

# NOTE WELL: You should also follow all the steps listed at
# https://devguide.python.org/grammar/

# Start symbols for the grammar:
#	file_input is a module or sequence of commands read from an input file;
#	single_input is a single interactive statement;
#	eval_input is the input for the eval() and input() functions.
# NB: compound_stmt in single_input is followed by extra NEWLINE!
file_input: (NEWLINE | stmt)* ENDMARKER
single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE
eval_input: testlist NEWLINE* ENDMARKER

decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE
decorators: decorator+
decorated: decorators (classdef | funcdef | async_funcdef)
async_funcdef: ASYNC funcdef
funcdef: 'def' NAME parameters ['->' test] ':' suite
parameters: '(' [typedargslist] ')'

# The following definition for typedarglist is equivalent to this set of rules:
#
#     arguments = argument (',' argument)*
#     argument = tfpdef ['=' test]
#     kwargs = '**' tname [',']
#     args = '*' [tname]
#     kwonly_kwargs = (',' argument)* [',' [kwargs]]
#     args_kwonly_kwargs = args kwonly_kwargs | kwargs
#     poskeyword_args_kwonly_kwargs = arguments [',' [args_kwonly_kwargs]]
#     typedargslist_no_posonly  = poskeyword_args_kwonly_kwargs | args_kwonly_kwargs
#     typedarglist = arguments ',' '/' [',' [typedargslist_no_posonly]])|(typedargslist_no_posonly)"
#
# It needs to be fully expanded to allow our LL(1) parser to work on it.

typedargslist: tfpdef ['=' test] (',' tfpdef ['=' test])* ',' '/' [
                     ',' [((tfpdef ['=' test] ',')* ('*' [tname] (',' tname ['=' test])*
                            [',' ['**' tname [',']]] | '**' tname [','])
                     | tfpdef ['=' test] (',' tfpdef ['=' test])* [','])]
                ] | ((tfpdef ['=' test] ',')* ('*' [tname] (',' tname ['=' test])*
                     [',' ['**' tname [',']]] | '**' tname [','])
                     | tfpdef ['=' test] (',' tfpdef ['=' test])* [','])

tname: NAME [':' test]
tfpdef: tname | '(' tfplist ')'
tfplist: tfpdef (',' tfpdef)* [',']

# The following definition for varargslist is equivalent to this set of rules:
#
#     arguments = argument (',' argument )*
#     argument = vfpdef ['=' test]
#     kwargs = '**' vname [',']
#     args = '*' [vname]
#     kwonly_kwargs = (',' argument )* [',' [kwargs]]
#     args_kwonly_kwargs = args kwonly_kwargs | kwargs
#     poskeyword_args_kwonly_kwargs = arguments [',' [args_kwonly_kwargs]]
#     vararglist_no_posonly = poskeyword_args_kwonly_kwargs | args_kwonly_kwargs
#     varargslist = arguments ',' '/' [','[(vararglist_no_posonly)]] | (vararglist_no_posonly)
#
# It needs to be fully expanded to allow our LL(1) parser to work on it.

varargslist: vfpdef ['=' test ](',' vfpdef ['=' test])* ',' '/' [',' [
                     ((vfpdef ['=' test] ',')* ('*' [vname] (',' vname ['=' test])*
                            [',' ['**' vname [',']]] | '**' vname [','])
                            | vfpdef ['=' test] (',' vfpdef ['=' test])* [','])
                     ]] | ((vfpdef ['=' test] ',')*
                     ('*' [vname] (',' vname ['=' test])*  [',' ['**' vname [',']]]| '**' vname [','])
                     | vfpdef ['=' test] (',' vfpdef ['=' test])* [','])

vname: NAME
vfpdef: vname | '(' vfplist ')'
vfplist: vfpdef (',' vfpdef)* [',']

stmt: simple_stmt | compound_stmt
simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE
small_stmt: (expr_stmt | print_stmt  | del_stmt | pass_stmt | flow_stmt |
             import_stmt | global_stmt | exec_stmt | assert_stmt)
expr_stmt: testlist_star_expr (annassign | augassign (yield_expr|testlist) |
                     ('=' (yield_expr|testlist_star_expr))*)
annassign: ':' test ['=' test]
testlist_star_expr: (test|star_expr) (',' (test|star_expr))* [',']
augassign: ('+=' | '-=' | '*=' | '@=' | '/=' | '%=' | '&=' | '|=' | '^=' |
            '<<=' | '>>=' | '**=' | '//=')
# For normal and annotated assignments, additional restrictions enforced by the interpreter
print_stmt: 'print' ( [ test (',' test)* [','] ] |
                      '>>' test [ (',' test)+ [','] ] )
del_stmt: 'del' exprlist
pass_stmt: 'pass'
flow_stmt: break_stmt | continue_stmt | return_stmt | raise_stmt | yield_stmt
break_stmt: 'break'
continue_stmt: 'continue'
return_stmt: 'return' [testlist]
yield_stmt: yield_expr
raise_stmt: 'raise' [test ['from' test | ',' test [',' test]]]
import_stmt: import_name | import_from
import_name: 'import' dotted_as_names
import_from: ('from' ('.'* dotted_name | '.'+)
              'import' ('*' | '(' import_as_names ')' | import_as_names))
import_as_name: NAME ['as' NAME]
dotted_as_name: dotted_name ['as' NAME]
import_as_names: import_as_name (',' import_as_name)* [',']
dotted_as_names: dotted_as_name (',' dotted_as_name)*
dotted_name: NAME ('.' NAME)*
global_stmt: ('global' | 'nonlocal') NAME (',' NAME)*
exec_stmt: 'exec' expr ['in' test [',' test]]
assert_stmt: 'assert' test [',' test]

compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | with_stmt | funcdef | classdef | decorated | async_stmt
async_stmt: ASYNC (funcdef | with_stmt | for_stmt)
if_stmt: 'if' namedexpr_test ':' suite ('elif' namedexpr_test ':' suite)* ['else' ':' suite]
while_stmt: 'while' namedexpr_test ':' suite ['else' ':' suite]
for_stmt: 'for' exprlist 'in' testlist ':' suite ['else' ':' suite]
try_stmt: ('try' ':' suite
           ((except_clause ':' suite)+
	    ['else' ':' suite]
	    ['finally' ':' suite] |
	   'finally' ':' suite))
with_stmt: 'with' with_item (',' with_item)*  ':' suite
with_item: test ['as' expr]
with_var: 'as' expr
# NB compile.c makes sure that the default except clause is last
except_clause: 'except' [test [(',' | 'as') test]]
suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT

# Backward compatibility cruft to support:
# [ x for x in lambda: True, lambda: False if x() ]
# even while also allowing:
# lambda x: 5 if x else 2
# (But not a mix of the two)
testlist_safe: old_test [(',' old_test)+ [',']]
old_test: or_test | old_lambdef
old_lambdef: 'lambda' [varargslist] ':' old_test

namedexpr_test: test [':=' test]
test: or_test ['if' or_test 'else' test] | lambdef
or_test: and_test ('or' and_test)*
and_test: not_test ('and' not_test)*
not_test: 'not' not_test | comparison
comparison: expr (comp_op expr)*
comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not'
star_expr: '*' expr
expr: xor_expr ('|' xor_expr)*
xor_expr: and_expr ('^' and_expr)*
and_expr: shift_expr ('&' shift_expr)*
shift_expr: arith_expr (('<<'|'>>') arith_expr)*
arith_expr: term (('+'|'-') term)*
term: factor (('*'|'@'|'/'|'%'|'//') factor)*
factor: ('+'|'-'|'~') factor | power
power: [AWAIT] atom trailer* ['**' factor]
atom: ('(' [yield_expr|testlist_gexp] ')' |
       '[' [listmaker] ']' |
       '{' [dictsetmaker] '}' |
       '`' testlist1 '`' |
       NAME | NUMBER | STRING+ | '.' '.' '.')
listmaker: (namedexpr_test|star_expr) ( comp_for | (',' (namedexpr_test|star_expr))* [','] )
testlist_gexp: (namedexpr_test|star_expr) ( comp_for | (',' (namedexpr_test|star_expr))* [','] )
lambdef: 'lambda' [varargslist] ':' test
trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME
subscriptlist: subscript (',' subscript)* [',']
subscript: test | [test] ':' [test] [sliceop]
sliceop: ':' [test]
exprlist: (expr|star_expr) (',' (expr|star_expr))* [',']
testlist: test (',' test)* [',']
dictsetmaker: ( ((test ':' test | '**' expr)
                 (comp_for | (',' (test ':' test | '**' expr))* [','])) |
                ((test | star_expr)
		 (comp_for | (',' (test | star_expr))* [','])) )

classdef: 'class' NAME ['(' [arglist] ')'] ':' suite

arglist: argument (',' argument)* [',']

# "test '=' test" is really "keyword '=' test", but we have no such token.
# These need to be in a single rule to avoid grammar that is ambiguous
# to our LL(1) parser. Even though 'test' includes '*expr' in star_expr,
# we explicitly match '*' here, too, to give it proper precedence.
# Illegal combinations and orderings are blocked in ast.c:
# multiple (test comp_for) arguments are blocked; keyword unpackings
# that precede iterable unpackings are blocked; etc.
argument: ( test [comp_for] |
            test ':=' test |
            test '=' test |
            '**' test |
	        '*' test )

comp_iter: comp_for | comp_if
comp_for: [ASYNC] 'for' exprlist 'in' testlist_safe [comp_iter]
comp_if: 'if' old_test [comp_iter]

testlist1: test (',' test)*

# not used in grammar, but may appear in "node" passed from Parser to Compiler
encoding_decl: NAME

yield_expr: 'yield' [yield_arg]
yield_arg: 'from' test | testlist
lib2to3/PatternGrammar.txt000064400000001431151153537460011520 0ustar00# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

# A grammar to describe tree matching patterns.
# Not shown here:
# - 'TOKEN' stands for any token (leaf node)
# - 'any' stands for any node (leaf or interior)
# With 'any' we can still specify the sub-structure.

# The start symbol is 'Matcher'.

Matcher: Alternatives ENDMARKER

Alternatives: Alternative ('|' Alternative)*

Alternative: (Unit | NegatedUnit)+

Unit: [NAME '='] ( STRING [Repeater]
                 | NAME [Details] [Repeater]
                 | '(' Alternatives ')' [Repeater]
                 | '[' Alternatives ']'
		 )

NegatedUnit: 'not' (STRING | NAME [Details] | '(' Alternatives ')')

Repeater: '*' | '+' | '{' NUMBER [',' NUMBER] '}'

Details: '<' Alternatives '>'
lib2to3/fixer_util.py000064400000035547151153537460010576 0ustar00"""Utility functions, node construction macros, etc."""
# Author: Collin Winter

# Local imports
from .pgen2 import token
from .pytree import Leaf, Node
from .pygram import python_symbols as syms
from . import patcomp


###########################################################
### Common node-construction "macros"
###########################################################

def KeywordArg(keyword, value):
    return Node(syms.argument,
                [keyword, Leaf(token.EQUAL, "="), value])

def LParen():
    return Leaf(token.LPAR, "(")

def RParen():
    return Leaf(token.RPAR, ")")

def Assign(target, source):
    """Build an assignment statement"""
    if not isinstance(target, list):
        target = [target]
    if not isinstance(source, list):
        source.prefix = " "
        source = [source]

    return Node(syms.atom,
                target + [Leaf(token.EQUAL, "=", prefix=" ")] + source)

def Name(name, prefix=None):
    """Return a NAME leaf"""
    return Leaf(token.NAME, name, prefix=prefix)

def Attr(obj, attr):
    """A node tuple for obj.attr"""
    return [obj, Node(syms.trailer, [Dot(), attr])]

def Comma():
    """A comma leaf"""
    return Leaf(token.COMMA, ",")

def Dot():
    """A period (.) leaf"""
    return Leaf(token.DOT, ".")

def ArgList(args, lparen=LParen(), rparen=RParen()):
    """A parenthesised argument list, used by Call()"""
    node = Node(syms.trailer, [lparen.clone(), rparen.clone()])
    if args:
        node.insert_child(1, Node(syms.arglist, args))
    return node

def Call(func_name, args=None, prefix=None):
    """A function call"""
    node = Node(syms.power, [func_name, ArgList(args)])
    if prefix is not None:
        node.prefix = prefix
    return node

def Newline():
    """A newline literal"""
    return Leaf(token.NEWLINE, "\n")

def BlankLine():
    """A blank line"""
    return Leaf(token.NEWLINE, "")

def Number(n, prefix=None):
    return Leaf(token.NUMBER, n, prefix=prefix)

def Subscript(index_node):
    """A numeric or string subscript"""
    return Node(syms.trailer, [Leaf(token.LBRACE, "["),
                               index_node,
                               Leaf(token.RBRACE, "]")])

def String(string, prefix=None):
    """A string leaf"""
    return Leaf(token.STRING, string, prefix=prefix)

def ListComp(xp, fp, it, test=None):
    """A list comprehension of the form [xp for fp in it if test].

    If test is None, the "if test" part is omitted.
    """
    xp.prefix = ""
    fp.prefix = " "
    it.prefix = " "
    for_leaf = Leaf(token.NAME, "for")
    for_leaf.prefix = " "
    in_leaf = Leaf(token.NAME, "in")
    in_leaf.prefix = " "
    inner_args = [for_leaf, fp, in_leaf, it]
    if test:
        test.prefix = " "
        if_leaf = Leaf(token.NAME, "if")
        if_leaf.prefix = " "
        inner_args.append(Node(syms.comp_if, [if_leaf, test]))
    inner = Node(syms.listmaker, [xp, Node(syms.comp_for, inner_args)])
    return Node(syms.atom,
                       [Leaf(token.LBRACE, "["),
                        inner,
                        Leaf(token.RBRACE, "]")])

def FromImport(package_name, name_leafs):
    """ Return an import statement in the form:
        from package import name_leafs"""
    # XXX: May not handle dotted imports properly (eg, package_name='foo.bar')
    #assert package_name == '.' or '.' not in package_name, "FromImport has "\
    #       "not been tested with dotted package names -- use at your own "\
    #       "peril!"

    for leaf in name_leafs:
        # Pull the leaves out of their old tree
        leaf.remove()

    children = [Leaf(token.NAME, "from"),
                Leaf(token.NAME, package_name, prefix=" "),
                Leaf(token.NAME, "import", prefix=" "),
                Node(syms.import_as_names, name_leafs)]
    imp = Node(syms.import_from, children)
    return imp

def ImportAndCall(node, results, names):
    """Returns an import statement and calls a method
    of the module:

    import module
    module.name()"""
    obj = results["obj"].clone()
    if obj.type == syms.arglist:
        newarglist = obj.clone()
    else:
        newarglist = Node(syms.arglist, [obj.clone()])
    after = results["after"]
    if after:
        after = [n.clone() for n in after]
    new = Node(syms.power,
               Attr(Name(names[0]), Name(names[1])) +
               [Node(syms.trailer,
                     [results["lpar"].clone(),
                      newarglist,
                      results["rpar"].clone()])] + after)
    new.prefix = node.prefix
    return new


###########################################################
### Determine whether a node represents a given literal
###########################################################

def is_tuple(node):
    """Does the node represent a tuple literal?"""
    if isinstance(node, Node) and node.children == [LParen(), RParen()]:
        return True
    return (isinstance(node, Node)
            and len(node.children) == 3
            and isinstance(node.children[0], Leaf)
            and isinstance(node.children[1], Node)
            and isinstance(node.children[2], Leaf)
            and node.children[0].value == "("
            and node.children[2].value == ")")

def is_list(node):
    """Does the node represent a list literal?"""
    return (isinstance(node, Node)
            and len(node.children) > 1
            and isinstance(node.children[0], Leaf)
            and isinstance(node.children[-1], Leaf)
            and node.children[0].value == "["
            and node.children[-1].value == "]")


###########################################################
### Misc
###########################################################

def parenthesize(node):
    return Node(syms.atom, [LParen(), node, RParen()])


consuming_calls = {"sorted", "list", "set", "any", "all", "tuple", "sum",
                   "min", "max", "enumerate"}

def attr_chain(obj, attr):
    """Follow an attribute chain.

    If you have a chain of objects where a.foo -> b, b.foo-> c, etc,
    use this to iterate over all objects in the chain. Iteration is
    terminated by getattr(x, attr) is None.

    Args:
        obj: the starting object
        attr: the name of the chaining attribute

    Yields:
        Each successive object in the chain.
    """
    next = getattr(obj, attr)
    while next:
        yield next
        next = getattr(next, attr)

p0 = """for_stmt< 'for' any 'in' node=any ':' any* >
        | comp_for< 'for' any 'in' node=any any* >
     """
p1 = """
power<
    ( 'iter' | 'list' | 'tuple' | 'sorted' | 'set' | 'sum' |
      'any' | 'all' | 'enumerate' | (any* trailer< '.' 'join' >) )
    trailer< '(' node=any ')' >
    any*
>
"""
p2 = """
power<
    ( 'sorted' | 'enumerate' )
    trailer< '(' arglist<node=any any*> ')' >
    any*
>
"""
pats_built = False
def in_special_context(node):
    """ Returns true if node is in an environment where all that is required
        of it is being iterable (ie, it doesn't matter if it returns a list
        or an iterator).
        See test_map_nochange in test_fixers.py for some examples and tests.
        """
    global p0, p1, p2, pats_built
    if not pats_built:
        p0 = patcomp.compile_pattern(p0)
        p1 = patcomp.compile_pattern(p1)
        p2 = patcomp.compile_pattern(p2)
        pats_built = True
    patterns = [p0, p1, p2]
    for pattern, parent in zip(patterns, attr_chain(node, "parent")):
        results = {}
        if pattern.match(parent, results) and results["node"] is node:
            return True
    return False

def is_probably_builtin(node):
    """
    Check that something isn't an attribute or function name etc.
    """
    prev = node.prev_sibling
    if prev is not None and prev.type == token.DOT:
        # Attribute lookup.
        return False
    parent = node.parent
    if parent.type in (syms.funcdef, syms.classdef):
        return False
    if parent.type == syms.expr_stmt and parent.children[0] is node:
        # Assignment.
        return False
    if parent.type == syms.parameters or \
            (parent.type == syms.typedargslist and (
            (prev is not None and prev.type == token.COMMA) or
            parent.children[0] is node
            )):
        # The name of an argument.
        return False
    return True

def find_indentation(node):
    """Find the indentation of *node*."""
    while node is not None:
        if node.type == syms.suite and len(node.children) > 2:
            indent = node.children[1]
            if indent.type == token.INDENT:
                return indent.value
        node = node.parent
    return ""

###########################################################
### The following functions are to find bindings in a suite
###########################################################

def make_suite(node):
    if node.type == syms.suite:
        return node
    node = node.clone()
    parent, node.parent = node.parent, None
    suite = Node(syms.suite, [node])
    suite.parent = parent
    return suite

def find_root(node):
    """Find the top level namespace."""
    # Scamper up to the top level namespace
    while node.type != syms.file_input:
        node = node.parent
        if not node:
            raise ValueError("root found before file_input node was found.")
    return node

def does_tree_import(package, name, node):
    """ Returns true if name is imported from package at the
        top level of the tree which node belongs to.
        To cover the case of an import like 'import foo', use
        None for the package and 'foo' for the name. """
    binding = find_binding(name, find_root(node), package)
    return bool(binding)

def is_import(node):
    """Returns true if the node is an import statement."""
    return node.type in (syms.import_name, syms.import_from)

def touch_import(package, name, node):
    """ Works like `does_tree_import` but adds an import statement
        if it was not imported. """
    def is_import_stmt(node):
        return (node.type == syms.simple_stmt and node.children and
                is_import(node.children[0]))

    root = find_root(node)

    if does_tree_import(package, name, root):
        return

    # figure out where to insert the new import.  First try to find
    # the first import and then skip to the last one.
    insert_pos = offset = 0
    for idx, node in enumerate(root.children):
        if not is_import_stmt(node):
            continue
        for offset, node2 in enumerate(root.children[idx:]):
            if not is_import_stmt(node2):
                break
        insert_pos = idx + offset
        break

    # if there are no imports where we can insert, find the docstring.
    # if that also fails, we stick to the beginning of the file
    if insert_pos == 0:
        for idx, node in enumerate(root.children):
            if (node.type == syms.simple_stmt and node.children and
               node.children[0].type == token.STRING):
                insert_pos = idx + 1
                break

    if package is None:
        import_ = Node(syms.import_name, [
            Leaf(token.NAME, "import"),
            Leaf(token.NAME, name, prefix=" ")
        ])
    else:
        import_ = FromImport(package, [Leaf(token.NAME, name, prefix=" ")])

    children = [import_, Newline()]
    root.insert_child(insert_pos, Node(syms.simple_stmt, children))


_def_syms = {syms.classdef, syms.funcdef}
def find_binding(name, node, package=None):
    """ Returns the node which binds variable name, otherwise None.
        If optional argument package is supplied, only imports will
        be returned.
        See test cases for examples."""
    for child in node.children:
        ret = None
        if child.type == syms.for_stmt:
            if _find(name, child.children[1]):
                return child
            n = find_binding(name, make_suite(child.children[-1]), package)
            if n: ret = n
        elif child.type in (syms.if_stmt, syms.while_stmt):
            n = find_binding(name, make_suite(child.children[-1]), package)
            if n: ret = n
        elif child.type == syms.try_stmt:
            n = find_binding(name, make_suite(child.children[2]), package)
            if n:
                ret = n
            else:
                for i, kid in enumerate(child.children[3:]):
                    if kid.type == token.COLON and kid.value == ":":
                        # i+3 is the colon, i+4 is the suite
                        n = find_binding(name, make_suite(child.children[i+4]), package)
                        if n: ret = n
        elif child.type in _def_syms and child.children[1].value == name:
            ret = child
        elif _is_import_binding(child, name, package):
            ret = child
        elif child.type == syms.simple_stmt:
            ret = find_binding(name, child, package)
        elif child.type == syms.expr_stmt:
            if _find(name, child.children[0]):
                ret = child

        if ret:
            if not package:
                return ret
            if is_import(ret):
                return ret
    return None

_block_syms = {syms.funcdef, syms.classdef, syms.trailer}
def _find(name, node):
    nodes = [node]
    while nodes:
        node = nodes.pop()
        if node.type > 256 and node.type not in _block_syms:
            nodes.extend(node.children)
        elif node.type == token.NAME and node.value == name:
            return node
    return None

def _is_import_binding(node, name, package=None):
    """ Will reuturn node if node will import name, or node
        will import * from package.  None is returned otherwise.
        See test cases for examples. """

    if node.type == syms.import_name and not package:
        imp = node.children[1]
        if imp.type == syms.dotted_as_names:
            for child in imp.children:
                if child.type == syms.dotted_as_name:
                    if child.children[2].value == name:
                        return node
                elif child.type == token.NAME and child.value == name:
                    return node
        elif imp.type == syms.dotted_as_name:
            last = imp.children[-1]
            if last.type == token.NAME and last.value == name:
                return node
        elif imp.type == token.NAME and imp.value == name:
            return node
    elif node.type == syms.import_from:
        # str(...) is used to make life easier here, because
        # from a.b import parses to ['import', ['a', '.', 'b'], ...]
        if package and str(node.children[1]).strip() != package:
            return None
        n = node.children[3]
        if package and _find("as", n):
            # See test_from_import_as for explanation
            return None
        elif n.type == syms.import_as_names and _find(name, n):
            return node
        elif n.type == syms.import_as_name:
            child = n.children[2]
            if child.type == token.NAME and child.value == name:
                return node
        elif n.type == token.NAME and n.value == name:
            return node
        elif package and n.type == token.STAR:
            return node
    return None
lib2to3/PatternGrammar3.8.17.final.0.pickle000064400000002311151153537460014053 0ustar00���}�(�
symbol2number�}�(�Matcher�M�Alternative�M�Alternatives�M�Details�M�NegatedUnit�M�Repeater�M�Unit�Mu�
number2symbol�}�(MhMhMhMhMhMhMh	u�states�]�(]�(]�KK��a]�KK��a]�KK��ae]�(]�(KK��K	K��e]�(KK��K	K��KK��ee]�(]�K
K��a]�(KK��KK��ee]�(]�KK��a]�KK��a]�K
K��a]�KK��ae]�(]�KK��a]�(KK��KK��KK��e]�KK��a]�(KK��KK��e]�KK��a]�KK��ae]�(]�(KK��KK��KK��e]�KK��a]�KK��a]�(KK��KK��e]�KK��a]�KK��ae]�(]�(KK��KK��KK��KK��e]�KK��a]�KK��a]�(KK��KK��KK��KK��e]�(KK��KK��e]�KK��a]�KK��a]�(KK��KK��KK	��KK��e]�KK��a]�(KK��KK��KK	��eee�dfas�}�(Mh}�(KKKKKKKKKKu��Mh}�(KKKKKKKKKKu��Mh}�(KKKKKKKKKKu��Mh#}�KKs��Mh,}�KKs��Mh<}�(KKKKKKu��MhL}�(KKKKKKKKu��u�labels�]�(K�EMPTY���MN��KN��KN��K	N��K�not���KN��KN��MN��MN��MN��KN��KN��KN��MN��KN��KN��KN��KN��KN��KN��KN��KN��MN��K
N��e�keywords�}�h�Ks�tokens�}�(KKKKK	KKKKKKKKKKK
KKKKKKKKKKKKKKKKK
Ku�symbol2label�}�(�Alternatives�K�NegatedUnit�K�Unit�K	�Alternative�K
�Details�K�Repeater�Ku�start�Mu.lib2to3/patcomp.py000064400000015616151153537460010062 0ustar00# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Pattern compiler.

The grammar is taken from PatternGrammar.txt.

The compiler compiles a pattern to a pytree.*Pattern instance.
"""

__author__ = "Guido van Rossum <guido@python.org>"

# Python imports
import io

# Fairly local imports
from .pgen2 import driver, literals, token, tokenize, parse, grammar

# Really local imports
from . import pytree
from . import pygram


class PatternSyntaxError(Exception):
    pass


def tokenize_wrapper(input):
    """Tokenizes a string suppressing significant whitespace."""
    skip = {token.NEWLINE, token.INDENT, token.DEDENT}
    tokens = tokenize.generate_tokens(io.StringIO(input).readline)
    for quintuple in tokens:
        type, value, start, end, line_text = quintuple
        if type not in skip:
            yield quintuple


class PatternCompiler(object):

    def __init__(self, grammar_file=None):
        """Initializer.

        Takes an optional alternative filename for the pattern grammar.
        """
        if grammar_file is None:
            self.grammar = pygram.pattern_grammar
            self.syms = pygram.pattern_symbols
        else:
            self.grammar = driver.load_grammar(grammar_file)
            self.syms = pygram.Symbols(self.grammar)
        self.pygrammar = pygram.python_grammar
        self.pysyms = pygram.python_symbols
        self.driver = driver.Driver(self.grammar, convert=pattern_convert)

    def compile_pattern(self, input, debug=False, with_tree=False):
        """Compiles a pattern string to a nested pytree.*Pattern object."""
        tokens = tokenize_wrapper(input)
        try:
            root = self.driver.parse_tokens(tokens, debug=debug)
        except parse.ParseError as e:
            raise PatternSyntaxError(str(e)) from None
        if with_tree:
            return self.compile_node(root), root
        else:
            return self.compile_node(root)

    def compile_node(self, node):
        """Compiles a node, recursively.

        This is one big switch on the node type.
        """
        # XXX Optimize certain Wildcard-containing-Wildcard patterns
        # that can be merged
        if node.type == self.syms.Matcher:
            node = node.children[0] # Avoid unneeded recursion

        if node.type == self.syms.Alternatives:
            # Skip the odd children since they are just '|' tokens
            alts = [self.compile_node(ch) for ch in node.children[::2]]
            if len(alts) == 1:
                return alts[0]
            p = pytree.WildcardPattern([[a] for a in alts], min=1, max=1)
            return p.optimize()

        if node.type == self.syms.Alternative:
            units = [self.compile_node(ch) for ch in node.children]
            if len(units) == 1:
                return units[0]
            p = pytree.WildcardPattern([units], min=1, max=1)
            return p.optimize()

        if node.type == self.syms.NegatedUnit:
            pattern = self.compile_basic(node.children[1:])
            p = pytree.NegatedPattern(pattern)
            return p.optimize()

        assert node.type == self.syms.Unit

        name = None
        nodes = node.children
        if len(nodes) >= 3 and nodes[1].type == token.EQUAL:
            name = nodes[0].value
            nodes = nodes[2:]
        repeat = None
        if len(nodes) >= 2 and nodes[-1].type == self.syms.Repeater:
            repeat = nodes[-1]
            nodes = nodes[:-1]

        # Now we've reduced it to: STRING | NAME [Details] | (...) | [...]
        pattern = self.compile_basic(nodes, repeat)

        if repeat is not None:
            assert repeat.type == self.syms.Repeater
            children = repeat.children
            child = children[0]
            if child.type == token.STAR:
                min = 0
                max = pytree.HUGE
            elif child.type == token.PLUS:
                min = 1
                max = pytree.HUGE
            elif child.type == token.LBRACE:
                assert children[-1].type == token.RBRACE
                assert  len(children) in (3, 5)
                min = max = self.get_int(children[1])
                if len(children) == 5:
                    max = self.get_int(children[3])
            else:
                assert False
            if min != 1 or max != 1:
                pattern = pattern.optimize()
                pattern = pytree.WildcardPattern([[pattern]], min=min, max=max)

        if name is not None:
            pattern.name = name
        return pattern.optimize()

    def compile_basic(self, nodes, repeat=None):
        # Compile STRING | NAME [Details] | (...) | [...]
        assert len(nodes) >= 1
        node = nodes[0]
        if node.type == token.STRING:
            value = str(literals.evalString(node.value))
            return pytree.LeafPattern(_type_of_literal(value), value)
        elif node.type == token.NAME:
            value = node.value
            if value.isupper():
                if value not in TOKEN_MAP:
                    raise PatternSyntaxError("Invalid token: %r" % value)
                if nodes[1:]:
                    raise PatternSyntaxError("Can't have details for token")
                return pytree.LeafPattern(TOKEN_MAP[value])
            else:
                if value == "any":
                    type = None
                elif not value.startswith("_"):
                    type = getattr(self.pysyms, value, None)
                    if type is None:
                        raise PatternSyntaxError("Invalid symbol: %r" % value)
                if nodes[1:]: # Details present
                    content = [self.compile_node(nodes[1].children[1])]
                else:
                    content = None
                return pytree.NodePattern(type, content)
        elif node.value == "(":
            return self.compile_node(nodes[1])
        elif node.value == "[":
            assert repeat is None
            subpattern = self.compile_node(nodes[1])
            return pytree.WildcardPattern([[subpattern]], min=0, max=1)
        assert False, node

    def get_int(self, node):
        assert node.type == token.NUMBER
        return int(node.value)


# Map named tokens to the type value for a LeafPattern
TOKEN_MAP = {"NAME": token.NAME,
             "STRING": token.STRING,
             "NUMBER": token.NUMBER,
             "TOKEN": None}


def _type_of_literal(value):
    if value[0].isalpha():
        return token.NAME
    elif value in grammar.opmap:
        return grammar.opmap[value]
    else:
        return None


def pattern_convert(grammar, raw_node_info):
    """Converts raw node information to a Node or Leaf instance."""
    type, value, context, children = raw_node_info
    if children or type in grammar.number2symbol:
        return pytree.Node(type, children, context=context)
    else:
        return pytree.Leaf(type, value, context=context)


def compile_pattern(pattern):
    return PatternCompiler().compile_pattern(pattern)
lib2to3/__main__.py000064400000000103151153537460010120 0ustar00import sys
from .main import main

sys.exit(main("lib2to3.fixes"))
lib2to3/btm_matcher.py000064400000014737151153537460010707 0ustar00"""A bottom-up tree matching algorithm implementation meant to speed
up 2to3's matching process. After the tree patterns are reduced to
their rarest linear path, a linear Aho-Corasick automaton is
created. The linear automaton traverses the linear paths from the
leaves to the root of the AST and returns a set of nodes for further
matching. This reduces significantly the number of candidate nodes."""

__author__ = "George Boutsioukis <gboutsioukis@gmail.com>"

import logging
import itertools
from collections import defaultdict

from . import pytree
from .btm_utils import reduce_tree

class BMNode(object):
    """Class for a node of the Aho-Corasick automaton used in matching"""
    count = itertools.count()
    def __init__(self):
        self.transition_table = {}
        self.fixers = []
        self.id = next(BMNode.count)
        self.content = ''

class BottomMatcher(object):
    """The main matcher class. After instantiating the patterns should
    be added using the add_fixer method"""

    def __init__(self):
        self.match = set()
        self.root = BMNode()
        self.nodes = [self.root]
        self.fixers = []
        self.logger = logging.getLogger("RefactoringTool")

    def add_fixer(self, fixer):
        """Reduces a fixer's pattern tree to a linear path and adds it
        to the matcher(a common Aho-Corasick automaton). The fixer is
        appended on the matching states and called when they are
        reached"""
        self.fixers.append(fixer)
        tree = reduce_tree(fixer.pattern_tree)
        linear = tree.get_linear_subpattern()
        match_nodes = self.add(linear, start=self.root)
        for match_node in match_nodes:
            match_node.fixers.append(fixer)

    def add(self, pattern, start):
        "Recursively adds a linear pattern to the AC automaton"
        #print("adding pattern", pattern, "to", start)
        if not pattern:
            #print("empty pattern")
            return [start]
        if isinstance(pattern[0], tuple):
            #alternatives
            #print("alternatives")
            match_nodes = []
            for alternative in pattern[0]:
                #add all alternatives, and add the rest of the pattern
                #to each end node
                end_nodes = self.add(alternative, start=start)
                for end in end_nodes:
                    match_nodes.extend(self.add(pattern[1:], end))
            return match_nodes
        else:
            #single token
            #not last
            if pattern[0] not in start.transition_table:
                #transition did not exist, create new
                next_node = BMNode()
                start.transition_table[pattern[0]] = next_node
            else:
                #transition exists already, follow
                next_node = start.transition_table[pattern[0]]

            if pattern[1:]:
                end_nodes = self.add(pattern[1:], start=next_node)
            else:
                end_nodes = [next_node]
            return end_nodes

    def run(self, leaves):
        """The main interface with the bottom matcher. The tree is
        traversed from the bottom using the constructed
        automaton. Nodes are only checked once as the tree is
        retraversed. When the automaton fails, we give it one more
        shot(in case the above tree matches as a whole with the
        rejected leaf), then we break for the next leaf. There is the
        special case of multiple arguments(see code comments) where we
        recheck the nodes

        Args:
           The leaves of the AST tree to be matched

        Returns:
           A dictionary of node matches with fixers as the keys
        """
        current_ac_node = self.root
        results = defaultdict(list)
        for leaf in leaves:
            current_ast_node = leaf
            while current_ast_node:
                current_ast_node.was_checked = True
                for child in current_ast_node.children:
                    # multiple statements, recheck
                    if isinstance(child, pytree.Leaf) and child.value == ";":
                        current_ast_node.was_checked = False
                        break
                if current_ast_node.type == 1:
                    #name
                    node_token = current_ast_node.value
                else:
                    node_token = current_ast_node.type

                if node_token in current_ac_node.transition_table:
                    #token matches
                    current_ac_node = current_ac_node.transition_table[node_token]
                    for fixer in current_ac_node.fixers:
                        results[fixer].append(current_ast_node)
                else:
                    #matching failed, reset automaton
                    current_ac_node = self.root
                    if (current_ast_node.parent is not None
                        and current_ast_node.parent.was_checked):
                        #the rest of the tree upwards has been checked, next leaf
                        break

                    #recheck the rejected node once from the root
                    if node_token in current_ac_node.transition_table:
                        #token matches
                        current_ac_node = current_ac_node.transition_table[node_token]
                        for fixer in current_ac_node.fixers:
                            results[fixer].append(current_ast_node)

                current_ast_node = current_ast_node.parent
        return results

    def print_ac(self):
        "Prints a graphviz diagram of the BM automaton(for debugging)"
        print("digraph g{")
        def print_node(node):
            for subnode_key in node.transition_table.keys():
                subnode = node.transition_table[subnode_key]
                print("%d -> %d [label=%s] //%s" %
                      (node.id, subnode.id, type_repr(subnode_key), str(subnode.fixers)))
                if subnode_key == 1:
                    print(subnode.content)
                print_node(subnode)
        print_node(self.root)
        print("}")

# taken from pytree.py for debugging; only used by print_ac
_type_reprs = {}
def type_repr(type_num):
    global _type_reprs
    if not _type_reprs:
        from .pygram import python_symbols
        # printing tokens is possible but not as useful
        # from .pgen2 import token // token.__dict__.items():
        for name, val in python_symbols.__dict__.items():
            if type(val) == int: _type_reprs[val] = name
    return _type_reprs.setdefault(type_num, type_num)
lib2to3/btm_utils.py000064400000023356151153537460010421 0ustar00"Utility functions used by the btm_matcher module"

from . import pytree
from .pgen2 import grammar, token
from .pygram import pattern_symbols, python_symbols

syms = pattern_symbols
pysyms = python_symbols
tokens = grammar.opmap
token_labels = token

TYPE_ANY = -1
TYPE_ALTERNATIVES = -2
TYPE_GROUP = -3

class MinNode(object):
    """This class serves as an intermediate representation of the
    pattern tree during the conversion to sets of leaf-to-root
    subpatterns"""

    def __init__(self, type=None, name=None):
        self.type = type
        self.name = name
        self.children = []
        self.leaf = False
        self.parent = None
        self.alternatives = []
        self.group = []

    def __repr__(self):
        return str(self.type) + ' ' + str(self.name)

    def leaf_to_root(self):
        """Internal method. Returns a characteristic path of the
        pattern tree. This method must be run for all leaves until the
        linear subpatterns are merged into a single"""
        node = self
        subp = []
        while node:
            if node.type == TYPE_ALTERNATIVES:
                node.alternatives.append(subp)
                if len(node.alternatives) == len(node.children):
                    #last alternative
                    subp = [tuple(node.alternatives)]
                    node.alternatives = []
                    node = node.parent
                    continue
                else:
                    node = node.parent
                    subp = None
                    break

            if node.type == TYPE_GROUP:
                node.group.append(subp)
                #probably should check the number of leaves
                if len(node.group) == len(node.children):
                    subp = get_characteristic_subpattern(node.group)
                    node.group = []
                    node = node.parent
                    continue
                else:
                    node = node.parent
                    subp = None
                    break

            if node.type == token_labels.NAME and node.name:
                #in case of type=name, use the name instead
                subp.append(node.name)
            else:
                subp.append(node.type)

            node = node.parent
        return subp

    def get_linear_subpattern(self):
        """Drives the leaf_to_root method. The reason that
        leaf_to_root must be run multiple times is because we need to
        reject 'group' matches; for example the alternative form
        (a | b c) creates a group [b c] that needs to be matched. Since
        matching multiple linear patterns overcomes the automaton's
        capabilities, leaf_to_root merges each group into a single
        choice based on 'characteristic'ity,

        i.e. (a|b c) -> (a|b) if b more characteristic than c

        Returns: The most 'characteristic'(as defined by
          get_characteristic_subpattern) path for the compiled pattern
          tree.
        """

        for l in self.leaves():
            subp = l.leaf_to_root()
            if subp:
                return subp

    def leaves(self):
        "Generator that returns the leaves of the tree"
        for child in self.children:
            yield from child.leaves()
        if not self.children:
            yield self

def reduce_tree(node, parent=None):
    """
    Internal function. Reduces a compiled pattern tree to an
    intermediate representation suitable for feeding the
    automaton. This also trims off any optional pattern elements(like
    [a], a*).
    """

    new_node = None
    #switch on the node type
    if node.type == syms.Matcher:
        #skip
        node = node.children[0]

    if node.type == syms.Alternatives  :
        #2 cases
        if len(node.children) <= 2:
            #just a single 'Alternative', skip this node
            new_node = reduce_tree(node.children[0], parent)
        else:
            #real alternatives
            new_node = MinNode(type=TYPE_ALTERNATIVES)
            #skip odd children('|' tokens)
            for child in node.children:
                if node.children.index(child)%2:
                    continue
                reduced = reduce_tree(child, new_node)
                if reduced is not None:
                    new_node.children.append(reduced)
    elif node.type == syms.Alternative:
        if len(node.children) > 1:

            new_node = MinNode(type=TYPE_GROUP)
            for child in node.children:
                reduced = reduce_tree(child, new_node)
                if reduced:
                    new_node.children.append(reduced)
            if not new_node.children:
                # delete the group if all of the children were reduced to None
                new_node = None

        else:
            new_node = reduce_tree(node.children[0], parent)

    elif node.type == syms.Unit:
        if (isinstance(node.children[0], pytree.Leaf) and
            node.children[0].value == '('):
            #skip parentheses
            return reduce_tree(node.children[1], parent)
        if ((isinstance(node.children[0], pytree.Leaf) and
               node.children[0].value == '[')
               or
               (len(node.children)>1 and
               hasattr(node.children[1], "value") and
               node.children[1].value == '[')):
            #skip whole unit if its optional
            return None

        leaf = True
        details_node = None
        alternatives_node = None
        has_repeater = False
        repeater_node = None
        has_variable_name = False

        for child in node.children:
            if child.type == syms.Details:
                leaf = False
                details_node = child
            elif child.type == syms.Repeater:
                has_repeater = True
                repeater_node = child
            elif child.type == syms.Alternatives:
                alternatives_node = child
            if hasattr(child, 'value') and child.value == '=': # variable name
                has_variable_name = True

        #skip variable name
        if has_variable_name:
            #skip variable name, '='
            name_leaf = node.children[2]
            if hasattr(name_leaf, 'value') and name_leaf.value == '(':
                # skip parenthesis
                name_leaf = node.children[3]
        else:
            name_leaf = node.children[0]

        #set node type
        if name_leaf.type == token_labels.NAME:
            #(python) non-name or wildcard
            if name_leaf.value == 'any':
                new_node = MinNode(type=TYPE_ANY)
            else:
                if hasattr(token_labels, name_leaf.value):
                    new_node = MinNode(type=getattr(token_labels, name_leaf.value))
                else:
                    new_node = MinNode(type=getattr(pysyms, name_leaf.value))

        elif name_leaf.type == token_labels.STRING:
            #(python) name or character; remove the apostrophes from
            #the string value
            name = name_leaf.value.strip("'")
            if name in tokens:
                new_node = MinNode(type=tokens[name])
            else:
                new_node = MinNode(type=token_labels.NAME, name=name)
        elif name_leaf.type == syms.Alternatives:
            new_node = reduce_tree(alternatives_node, parent)

        #handle repeaters
        if has_repeater:
            if repeater_node.children[0].value == '*':
                #reduce to None
                new_node = None
            elif repeater_node.children[0].value == '+':
                #reduce to a single occurrence i.e. do nothing
                pass
            else:
                #TODO: handle {min, max} repeaters
                raise NotImplementedError
                pass

        #add children
        if details_node and new_node is not None:
            for child in details_node.children[1:-1]:
                #skip '<', '>' markers
                reduced = reduce_tree(child, new_node)
                if reduced is not None:
                    new_node.children.append(reduced)
    if new_node:
        new_node.parent = parent
    return new_node


def get_characteristic_subpattern(subpatterns):
    """Picks the most characteristic from a list of linear patterns
    Current order used is:
    names > common_names > common_chars
    """
    if not isinstance(subpatterns, list):
        return subpatterns
    if len(subpatterns)==1:
        return subpatterns[0]

    # first pick out the ones containing variable names
    subpatterns_with_names = []
    subpatterns_with_common_names = []
    common_names = ['in', 'for', 'if' , 'not', 'None']
    subpatterns_with_common_chars = []
    common_chars = "[]().,:"
    for subpattern in subpatterns:
        if any(rec_test(subpattern, lambda x: type(x) is str)):
            if any(rec_test(subpattern,
                            lambda x: isinstance(x, str) and x in common_chars)):
                subpatterns_with_common_chars.append(subpattern)
            elif any(rec_test(subpattern,
                              lambda x: isinstance(x, str) and x in common_names)):
                subpatterns_with_common_names.append(subpattern)

            else:
                subpatterns_with_names.append(subpattern)

    if subpatterns_with_names:
        subpatterns = subpatterns_with_names
    elif subpatterns_with_common_names:
        subpatterns = subpatterns_with_common_names
    elif subpatterns_with_common_chars:
        subpatterns = subpatterns_with_common_chars
    # of the remaining subpatterns pick out the longest one
    return max(subpatterns, key=len)

def rec_test(sequence, test_func):
    """Tests test_func on all items of sequence and items of included
    sub-iterables"""
    for x in sequence:
        if isinstance(x, (list, tuple)):
            yield from rec_test(x, test_func)
        else:
            yield test_func(x)
lib2to3/pgen2/conv.py000064400000022652151153537460010375 0ustar00# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Convert graminit.[ch] spit out by pgen to Python code.

Pgen is the Python parser generator.  It is useful to quickly create a
parser from a grammar file in Python's grammar notation.  But I don't
want my parsers to be written in C (yet), so I'm translating the
parsing tables to Python data structures and writing a Python parse
engine.

Note that the token numbers are constants determined by the standard
Python tokenizer.  The standard token module defines these numbers and
their names (the names are not used much).  The token numbers are
hardcoded into the Python tokenizer and into pgen.  A Python
implementation of the Python tokenizer is also available, in the
standard tokenize module.

On the other hand, symbol numbers (representing the grammar's
non-terminals) are assigned by pgen based on the actual grammar
input.

Note: this module is pretty much obsolete; the pgen module generates
equivalent grammar tables directly from the Grammar.txt input file
without having to invoke the Python pgen C program.

"""

# Python imports
import re

# Local imports
from pgen2 import grammar, token


class Converter(grammar.Grammar):
    """Grammar subclass that reads classic pgen output files.

    The run() method reads the tables as produced by the pgen parser
    generator, typically contained in two C files, graminit.h and
    graminit.c.  The other methods are for internal use only.

    See the base class for more documentation.

    """

    def run(self, graminit_h, graminit_c):
        """Load the grammar tables from the text files written by pgen."""
        self.parse_graminit_h(graminit_h)
        self.parse_graminit_c(graminit_c)
        self.finish_off()

    def parse_graminit_h(self, filename):
        """Parse the .h file written by pgen.  (Internal)

        This file is a sequence of #define statements defining the
        nonterminals of the grammar as numbers.  We build two tables
        mapping the numbers to names and back.

        """
        try:
            f = open(filename)
        except OSError as err:
            print("Can't open %s: %s" % (filename, err))
            return False
        self.symbol2number = {}
        self.number2symbol = {}
        lineno = 0
        for line in f:
            lineno += 1
            mo = re.match(r"^#define\s+(\w+)\s+(\d+)$", line)
            if not mo and line.strip():
                print("%s(%s): can't parse %s" % (filename, lineno,
                                                  line.strip()))
            else:
                symbol, number = mo.groups()
                number = int(number)
                assert symbol not in self.symbol2number
                assert number not in self.number2symbol
                self.symbol2number[symbol] = number
                self.number2symbol[number] = symbol
        return True

    def parse_graminit_c(self, filename):
        """Parse the .c file written by pgen.  (Internal)

        The file looks as follows.  The first two lines are always this:

        #include "pgenheaders.h"
        #include "grammar.h"

        After that come four blocks:

        1) one or more state definitions
        2) a table defining dfas
        3) a table defining labels
        4) a struct defining the grammar

        A state definition has the following form:
        - one or more arc arrays, each of the form:
          static arc arcs_<n>_<m>[<k>] = {
                  {<i>, <j>},
                  ...
          };
        - followed by a state array, of the form:
          static state states_<s>[<t>] = {
                  {<k>, arcs_<n>_<m>},
                  ...
          };

        """
        try:
            f = open(filename)
        except OSError as err:
            print("Can't open %s: %s" % (filename, err))
            return False
        # The code below essentially uses f's iterator-ness!
        lineno = 0

        # Expect the two #include lines
        lineno, line = lineno+1, next(f)
        assert line == '#include "pgenheaders.h"\n', (lineno, line)
        lineno, line = lineno+1, next(f)
        assert line == '#include "grammar.h"\n', (lineno, line)

        # Parse the state definitions
        lineno, line = lineno+1, next(f)
        allarcs = {}
        states = []
        while line.startswith("static arc "):
            while line.startswith("static arc "):
                mo = re.match(r"static arc arcs_(\d+)_(\d+)\[(\d+)\] = {$",
                              line)
                assert mo, (lineno, line)
                n, m, k = list(map(int, mo.groups()))
                arcs = []
                for _ in range(k):
                    lineno, line = lineno+1, next(f)
                    mo = re.match(r"\s+{(\d+), (\d+)},$", line)
                    assert mo, (lineno, line)
                    i, j = list(map(int, mo.groups()))
                    arcs.append((i, j))
                lineno, line = lineno+1, next(f)
                assert line == "};\n", (lineno, line)
                allarcs[(n, m)] = arcs
                lineno, line = lineno+1, next(f)
            mo = re.match(r"static state states_(\d+)\[(\d+)\] = {$", line)
            assert mo, (lineno, line)
            s, t = list(map(int, mo.groups()))
            assert s == len(states), (lineno, line)
            state = []
            for _ in range(t):
                lineno, line = lineno+1, next(f)
                mo = re.match(r"\s+{(\d+), arcs_(\d+)_(\d+)},$", line)
                assert mo, (lineno, line)
                k, n, m = list(map(int, mo.groups()))
                arcs = allarcs[n, m]
                assert k == len(arcs), (lineno, line)
                state.append(arcs)
            states.append(state)
            lineno, line = lineno+1, next(f)
            assert line == "};\n", (lineno, line)
            lineno, line = lineno+1, next(f)
        self.states = states

        # Parse the dfas
        dfas = {}
        mo = re.match(r"static dfa dfas\[(\d+)\] = {$", line)
        assert mo, (lineno, line)
        ndfas = int(mo.group(1))
        for i in range(ndfas):
            lineno, line = lineno+1, next(f)
            mo = re.match(r'\s+{(\d+), "(\w+)", (\d+), (\d+), states_(\d+),$',
                          line)
            assert mo, (lineno, line)
            symbol = mo.group(2)
            number, x, y, z = list(map(int, mo.group(1, 3, 4, 5)))
            assert self.symbol2number[symbol] == number, (lineno, line)
            assert self.number2symbol[number] == symbol, (lineno, line)
            assert x == 0, (lineno, line)
            state = states[z]
            assert y == len(state), (lineno, line)
            lineno, line = lineno+1, next(f)
            mo = re.match(r'\s+("(?:\\\d\d\d)*")},$', line)
            assert mo, (lineno, line)
            first = {}
            rawbitset = eval(mo.group(1))
            for i, c in enumerate(rawbitset):
                byte = ord(c)
                for j in range(8):
                    if byte & (1<<j):
                        first[i*8 + j] = 1
            dfas[number] = (state, first)
        lineno, line = lineno+1, next(f)
        assert line == "};\n", (lineno, line)
        self.dfas = dfas

        # Parse the labels
        labels = []
        lineno, line = lineno+1, next(f)
        mo = re.match(r"static label labels\[(\d+)\] = {$", line)
        assert mo, (lineno, line)
        nlabels = int(mo.group(1))
        for i in range(nlabels):
            lineno, line = lineno+1, next(f)
            mo = re.match(r'\s+{(\d+), (0|"\w+")},$', line)
            assert mo, (lineno, line)
            x, y = mo.groups()
            x = int(x)
            if y == "0":
                y = None
            else:
                y = eval(y)
            labels.append((x, y))
        lineno, line = lineno+1, next(f)
        assert line == "};\n", (lineno, line)
        self.labels = labels

        # Parse the grammar struct
        lineno, line = lineno+1, next(f)
        assert line == "grammar _PyParser_Grammar = {\n", (lineno, line)
        lineno, line = lineno+1, next(f)
        mo = re.match(r"\s+(\d+),$", line)
        assert mo, (lineno, line)
        ndfas = int(mo.group(1))
        assert ndfas == len(self.dfas)
        lineno, line = lineno+1, next(f)
        assert line == "\tdfas,\n", (lineno, line)
        lineno, line = lineno+1, next(f)
        mo = re.match(r"\s+{(\d+), labels},$", line)
        assert mo, (lineno, line)
        nlabels = int(mo.group(1))
        assert nlabels == len(self.labels), (lineno, line)
        lineno, line = lineno+1, next(f)
        mo = re.match(r"\s+(\d+)$", line)
        assert mo, (lineno, line)
        start = int(mo.group(1))
        assert start in self.number2symbol, (lineno, line)
        self.start = start
        lineno, line = lineno+1, next(f)
        assert line == "};\n", (lineno, line)
        try:
            lineno, line = lineno+1, next(f)
        except StopIteration:
            pass
        else:
            assert 0, (lineno, line)

    def finish_off(self):
        """Create additional useful structures.  (Internal)."""
        self.keywords = {} # map from keyword strings to arc labels
        self.tokens = {}   # map from numeric token values to arc labels
        for ilabel, (type, value) in enumerate(self.labels):
            if type == token.NAME and value is not None:
                self.keywords[value] = ilabel
            elif value is None:
                self.tokens[type] = ilabel
lib2to3/pgen2/__init__.py000064400000000217151153537460011160 0ustar00# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""The pgen2 package."""
lib2to3/pgen2/tokenize.py000064400000051077151153537460011263 0ustar00# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation.
# All rights reserved.

"""Tokenization help for Python programs.

generate_tokens(readline) is a generator that breaks a stream of
text into Python tokens.  It accepts a readline-like method which is called
repeatedly to get the next line of input (or "" for EOF).  It generates
5-tuples with these members:

    the token type (see token.py)
    the token (a string)
    the starting (row, column) indices of the token (a 2-tuple of ints)
    the ending (row, column) indices of the token (a 2-tuple of ints)
    the original line (string)

It is designed to match the working of the Python tokenizer exactly, except
that it produces COMMENT tokens for comments and gives type OP for all
operators

Older entry points
    tokenize_loop(readline, tokeneater)
    tokenize(readline, tokeneater=printtoken)
are the same, except instead of generating tokens, tokeneater is a callback
function to which the 5 fields described above are passed as 5 arguments,
each time a new token is found."""

__author__ = 'Ka-Ping Yee <ping@lfw.org>'
__credits__ = \
    'GvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, Skip Montanaro'

import string, re
from codecs import BOM_UTF8, lookup
from lib2to3.pgen2.token import *

from . import token
__all__ = [x for x in dir(token) if x[0] != '_'] + ["tokenize",
           "generate_tokens", "untokenize"]
del token

try:
    bytes
except NameError:
    # Support bytes type in Python <= 2.5, so 2to3 turns itself into
    # valid Python 3 code.
    bytes = str

def group(*choices): return '(' + '|'.join(choices) + ')'
def any(*choices): return group(*choices) + '*'
def maybe(*choices): return group(*choices) + '?'
def _combinations(*l):
    return set(
        x + y for x in l for y in l + ("",) if x.casefold() != y.casefold()
    )

Whitespace = r'[ \f\t]*'
Comment = r'#[^\r\n]*'
Ignore = Whitespace + any(r'\\\r?\n' + Whitespace) + maybe(Comment)
Name = r'\w+'

Binnumber = r'0[bB]_?[01]+(?:_[01]+)*'
Hexnumber = r'0[xX]_?[\da-fA-F]+(?:_[\da-fA-F]+)*[lL]?'
Octnumber = r'0[oO]?_?[0-7]+(?:_[0-7]+)*[lL]?'
Decnumber = group(r'[1-9]\d*(?:_\d+)*[lL]?', '0[lL]?')
Intnumber = group(Binnumber, Hexnumber, Octnumber, Decnumber)
Exponent = r'[eE][-+]?\d+(?:_\d+)*'
Pointfloat = group(r'\d+(?:_\d+)*\.(?:\d+(?:_\d+)*)?', r'\.\d+(?:_\d+)*') + maybe(Exponent)
Expfloat = r'\d+(?:_\d+)*' + Exponent
Floatnumber = group(Pointfloat, Expfloat)
Imagnumber = group(r'\d+(?:_\d+)*[jJ]', Floatnumber + r'[jJ]')
Number = group(Imagnumber, Floatnumber, Intnumber)

# Tail end of ' string.
Single = r"[^'\\]*(?:\\.[^'\\]*)*'"
# Tail end of " string.
Double = r'[^"\\]*(?:\\.[^"\\]*)*"'
# Tail end of ''' string.
Single3 = r"[^'\\]*(?:(?:\\.|'(?!''))[^'\\]*)*'''"
# Tail end of """ string.
Double3 = r'[^"\\]*(?:(?:\\.|"(?!""))[^"\\]*)*"""'
_litprefix = r"(?:[uUrRbBfF]|[rR][fFbB]|[fFbBuU][rR])?"
Triple = group(_litprefix + "'''", _litprefix + '"""')
# Single-line ' or " string.
String = group(_litprefix + r"'[^\n'\\]*(?:\\.[^\n'\\]*)*'",
               _litprefix + r'"[^\n"\\]*(?:\\.[^\n"\\]*)*"')

# Because of leftmost-then-longest match semantics, be sure to put the
# longest operators first (e.g., if = came before ==, == would get
# recognized as two instances of =).
Operator = group(r"\*\*=?", r">>=?", r"<<=?", r"<>", r"!=",
                 r"//=?", r"->",
                 r"[+\-*/%&@|^=<>]=?",
                 r"~")

Bracket = '[][(){}]'
Special = group(r'\r?\n', r':=', r'[:;.,`@]')
Funny = group(Operator, Bracket, Special)

PlainToken = group(Number, Funny, String, Name)
Token = Ignore + PlainToken

# First (or only) line of ' or " string.
ContStr = group(_litprefix + r"'[^\n'\\]*(?:\\.[^\n'\\]*)*" +
                group("'", r'\\\r?\n'),
                _litprefix + r'"[^\n"\\]*(?:\\.[^\n"\\]*)*' +
                group('"', r'\\\r?\n'))
PseudoExtras = group(r'\\\r?\n', Comment, Triple)
PseudoToken = Whitespace + group(PseudoExtras, Number, Funny, ContStr, Name)

tokenprog, pseudoprog, single3prog, double3prog = map(
    re.compile, (Token, PseudoToken, Single3, Double3))

_strprefixes = (
    _combinations('r', 'R', 'f', 'F') |
    _combinations('r', 'R', 'b', 'B') |
    {'u', 'U', 'ur', 'uR', 'Ur', 'UR'}
)

endprogs = {"'": re.compile(Single), '"': re.compile(Double),
            "'''": single3prog, '"""': double3prog,
            **{f"{prefix}'''": single3prog for prefix in _strprefixes},
            **{f'{prefix}"""': double3prog for prefix in _strprefixes},
            **{prefix: None for prefix in _strprefixes}}

triple_quoted = (
    {"'''", '"""'} |
    {f"{prefix}'''" for prefix in _strprefixes} |
    {f'{prefix}"""' for prefix in _strprefixes}
)
single_quoted = (
    {"'", '"'} |
    {f"{prefix}'" for prefix in _strprefixes} |
    {f'{prefix}"' for prefix in _strprefixes}
)

tabsize = 8

class TokenError(Exception): pass

class StopTokenizing(Exception): pass

def printtoken(type, token, xxx_todo_changeme, xxx_todo_changeme1, line): # for testing
    (srow, scol) = xxx_todo_changeme
    (erow, ecol) = xxx_todo_changeme1
    print("%d,%d-%d,%d:\t%s\t%s" % \
        (srow, scol, erow, ecol, tok_name[type], repr(token)))

def tokenize(readline, tokeneater=printtoken):
    """
    The tokenize() function accepts two parameters: one representing the
    input stream, and one providing an output mechanism for tokenize().

    The first parameter, readline, must be a callable object which provides
    the same interface as the readline() method of built-in file objects.
    Each call to the function should return one line of input as a string.

    The second parameter, tokeneater, must also be a callable object. It is
    called once for each token, with five arguments, corresponding to the
    tuples generated by generate_tokens().
    """
    try:
        tokenize_loop(readline, tokeneater)
    except StopTokenizing:
        pass

# backwards compatible interface
def tokenize_loop(readline, tokeneater):
    for token_info in generate_tokens(readline):
        tokeneater(*token_info)

class Untokenizer:

    def __init__(self):
        self.tokens = []
        self.prev_row = 1
        self.prev_col = 0

    def add_whitespace(self, start):
        row, col = start
        assert row <= self.prev_row
        col_offset = col - self.prev_col
        if col_offset:
            self.tokens.append(" " * col_offset)

    def untokenize(self, iterable):
        for t in iterable:
            if len(t) == 2:
                self.compat(t, iterable)
                break
            tok_type, token, start, end, line = t
            self.add_whitespace(start)
            self.tokens.append(token)
            self.prev_row, self.prev_col = end
            if tok_type in (NEWLINE, NL):
                self.prev_row += 1
                self.prev_col = 0
        return "".join(self.tokens)

    def compat(self, token, iterable):
        startline = False
        indents = []
        toks_append = self.tokens.append
        toknum, tokval = token
        if toknum in (NAME, NUMBER):
            tokval += ' '
        if toknum in (NEWLINE, NL):
            startline = True
        for tok in iterable:
            toknum, tokval = tok[:2]

            if toknum in (NAME, NUMBER, ASYNC, AWAIT):
                tokval += ' '

            if toknum == INDENT:
                indents.append(tokval)
                continue
            elif toknum == DEDENT:
                indents.pop()
                continue
            elif toknum in (NEWLINE, NL):
                startline = True
            elif startline and indents:
                toks_append(indents[-1])
                startline = False
            toks_append(tokval)

cookie_re = re.compile(r'^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)', re.ASCII)
blank_re = re.compile(br'^[ \t\f]*(?:[#\r\n]|$)', re.ASCII)

def _get_normal_name(orig_enc):
    """Imitates get_normal_name in tokenizer.c."""
    # Only care about the first 12 characters.
    enc = orig_enc[:12].lower().replace("_", "-")
    if enc == "utf-8" or enc.startswith("utf-8-"):
        return "utf-8"
    if enc in ("latin-1", "iso-8859-1", "iso-latin-1") or \
       enc.startswith(("latin-1-", "iso-8859-1-", "iso-latin-1-")):
        return "iso-8859-1"
    return orig_enc

def detect_encoding(readline):
    """
    The detect_encoding() function is used to detect the encoding that should
    be used to decode a Python source file. It requires one argument, readline,
    in the same way as the tokenize() generator.

    It will call readline a maximum of twice, and return the encoding used
    (as a string) and a list of any lines (left as bytes) it has read
    in.

    It detects the encoding from the presence of a utf-8 bom or an encoding
    cookie as specified in pep-0263. If both a bom and a cookie are present, but
    disagree, a SyntaxError will be raised. If the encoding cookie is an invalid
    charset, raise a SyntaxError.  Note that if a utf-8 bom is found,
    'utf-8-sig' is returned.

    If no encoding is specified, then the default of 'utf-8' will be returned.
    """
    bom_found = False
    encoding = None
    default = 'utf-8'
    def read_or_stop():
        try:
            return readline()
        except StopIteration:
            return bytes()

    def find_cookie(line):
        try:
            line_string = line.decode('ascii')
        except UnicodeDecodeError:
            return None
        match = cookie_re.match(line_string)
        if not match:
            return None
        encoding = _get_normal_name(match.group(1))
        try:
            codec = lookup(encoding)
        except LookupError:
            # This behaviour mimics the Python interpreter
            raise SyntaxError("unknown encoding: " + encoding)

        if bom_found:
            if codec.name != 'utf-8':
                # This behaviour mimics the Python interpreter
                raise SyntaxError('encoding problem: utf-8')
            encoding += '-sig'
        return encoding

    first = read_or_stop()
    if first.startswith(BOM_UTF8):
        bom_found = True
        first = first[3:]
        default = 'utf-8-sig'
    if not first:
        return default, []

    encoding = find_cookie(first)
    if encoding:
        return encoding, [first]
    if not blank_re.match(first):
        return default, [first]

    second = read_or_stop()
    if not second:
        return default, [first]

    encoding = find_cookie(second)
    if encoding:
        return encoding, [first, second]

    return default, [first, second]

def untokenize(iterable):
    """Transform tokens back into Python source code.

    Each element returned by the iterable must be a token sequence
    with at least two elements, a token number and token value.  If
    only two tokens are passed, the resulting output is poor.

    Round-trip invariant for full input:
        Untokenized source will match input source exactly

    Round-trip invariant for limited input:
        # Output text will tokenize the back to the input
        t1 = [tok[:2] for tok in generate_tokens(f.readline)]
        newcode = untokenize(t1)
        readline = iter(newcode.splitlines(1)).next
        t2 = [tok[:2] for tokin generate_tokens(readline)]
        assert t1 == t2
    """
    ut = Untokenizer()
    return ut.untokenize(iterable)

def generate_tokens(readline):
    """
    The generate_tokens() generator requires one argument, readline, which
    must be a callable object which provides the same interface as the
    readline() method of built-in file objects. Each call to the function
    should return one line of input as a string.  Alternately, readline
    can be a callable function terminating with StopIteration:
        readline = open(myfile).next    # Example of alternate readline

    The generator produces 5-tuples with these members: the token type; the
    token string; a 2-tuple (srow, scol) of ints specifying the row and
    column where the token begins in the source; a 2-tuple (erow, ecol) of
    ints specifying the row and column where the token ends in the source;
    and the line on which the token was found. The line passed is the
    physical line.
    """
    lnum = parenlev = continued = 0
    contstr, needcont = '', 0
    contline = None
    indents = [0]

    # 'stashed' and 'async_*' are used for async/await parsing
    stashed = None
    async_def = False
    async_def_indent = 0
    async_def_nl = False

    while 1:                                   # loop over lines in stream
        try:
            line = readline()
        except StopIteration:
            line = ''
        lnum = lnum + 1
        pos, max = 0, len(line)

        if contstr:                            # continued string
            if not line:
                raise TokenError("EOF in multi-line string", strstart)
            endmatch = endprog.match(line)
            if endmatch:
                pos = end = endmatch.end(0)
                yield (STRING, contstr + line[:end],
                       strstart, (lnum, end), contline + line)
                contstr, needcont = '', 0
                contline = None
            elif needcont and line[-2:] != '\\\n' and line[-3:] != '\\\r\n':
                yield (ERRORTOKEN, contstr + line,
                           strstart, (lnum, len(line)), contline)
                contstr = ''
                contline = None
                continue
            else:
                contstr = contstr + line
                contline = contline + line
                continue

        elif parenlev == 0 and not continued:  # new statement
            if not line: break
            column = 0
            while pos < max:                   # measure leading whitespace
                if line[pos] == ' ': column = column + 1
                elif line[pos] == '\t': column = (column//tabsize + 1)*tabsize
                elif line[pos] == '\f': column = 0
                else: break
                pos = pos + 1
            if pos == max: break

            if stashed:
                yield stashed
                stashed = None

            if line[pos] in '#\r\n':           # skip comments or blank lines
                if line[pos] == '#':
                    comment_token = line[pos:].rstrip('\r\n')
                    nl_pos = pos + len(comment_token)
                    yield (COMMENT, comment_token,
                           (lnum, pos), (lnum, pos + len(comment_token)), line)
                    yield (NL, line[nl_pos:],
                           (lnum, nl_pos), (lnum, len(line)), line)
                else:
                    yield ((NL, COMMENT)[line[pos] == '#'], line[pos:],
                           (lnum, pos), (lnum, len(line)), line)
                continue

            if column > indents[-1]:           # count indents or dedents
                indents.append(column)
                yield (INDENT, line[:pos], (lnum, 0), (lnum, pos), line)
            while column < indents[-1]:
                if column not in indents:
                    raise IndentationError(
                        "unindent does not match any outer indentation level",
                        ("<tokenize>", lnum, pos, line))
                indents = indents[:-1]

                if async_def and async_def_indent >= indents[-1]:
                    async_def = False
                    async_def_nl = False
                    async_def_indent = 0

                yield (DEDENT, '', (lnum, pos), (lnum, pos), line)

            if async_def and async_def_nl and async_def_indent >= indents[-1]:
                async_def = False
                async_def_nl = False
                async_def_indent = 0

        else:                                  # continued statement
            if not line:
                raise TokenError("EOF in multi-line statement", (lnum, 0))
            continued = 0

        while pos < max:
            pseudomatch = pseudoprog.match(line, pos)
            if pseudomatch:                                # scan for tokens
                start, end = pseudomatch.span(1)
                spos, epos, pos = (lnum, start), (lnum, end), end
                token, initial = line[start:end], line[start]

                if initial in string.digits or \
                   (initial == '.' and token != '.'):      # ordinary number
                    yield (NUMBER, token, spos, epos, line)
                elif initial in '\r\n':
                    newline = NEWLINE
                    if parenlev > 0:
                        newline = NL
                    elif async_def:
                        async_def_nl = True
                    if stashed:
                        yield stashed
                        stashed = None
                    yield (newline, token, spos, epos, line)

                elif initial == '#':
                    assert not token.endswith("\n")
                    if stashed:
                        yield stashed
                        stashed = None
                    yield (COMMENT, token, spos, epos, line)
                elif token in triple_quoted:
                    endprog = endprogs[token]
                    endmatch = endprog.match(line, pos)
                    if endmatch:                           # all on one line
                        pos = endmatch.end(0)
                        token = line[start:pos]
                        if stashed:
                            yield stashed
                            stashed = None
                        yield (STRING, token, spos, (lnum, pos), line)
                    else:
                        strstart = (lnum, start)           # multiple lines
                        contstr = line[start:]
                        contline = line
                        break
                elif initial in single_quoted or \
                    token[:2] in single_quoted or \
                    token[:3] in single_quoted:
                    if token[-1] == '\n':                  # continued string
                        strstart = (lnum, start)
                        endprog = (endprogs[initial] or endprogs[token[1]] or
                                   endprogs[token[2]])
                        contstr, needcont = line[start:], 1
                        contline = line
                        break
                    else:                                  # ordinary string
                        if stashed:
                            yield stashed
                            stashed = None
                        yield (STRING, token, spos, epos, line)
                elif initial.isidentifier():               # ordinary name
                    if token in ('async', 'await'):
                        if async_def:
                            yield (ASYNC if token == 'async' else AWAIT,
                                   token, spos, epos, line)
                            continue

                    tok = (NAME, token, spos, epos, line)
                    if token == 'async' and not stashed:
                        stashed = tok
                        continue

                    if token == 'def':
                        if (stashed
                                and stashed[0] == NAME
                                and stashed[1] == 'async'):

                            async_def = True
                            async_def_indent = indents[-1]

                            yield (ASYNC, stashed[1],
                                   stashed[2], stashed[3],
                                   stashed[4])
                            stashed = None

                    if stashed:
                        yield stashed
                        stashed = None

                    yield tok
                elif initial == '\\':                      # continued stmt
                    # This yield is new; needed for better idempotency:
                    if stashed:
                        yield stashed
                        stashed = None
                    yield (NL, token, spos, (lnum, pos), line)
                    continued = 1
                else:
                    if initial in '([{': parenlev = parenlev + 1
                    elif initial in ')]}': parenlev = parenlev - 1
                    if stashed:
                        yield stashed
                        stashed = None
                    yield (OP, token, spos, epos, line)
            else:
                yield (ERRORTOKEN, line[pos],
                           (lnum, pos), (lnum, pos+1), line)
                pos = pos + 1

    if stashed:
        yield stashed
        stashed = None

    for indent in indents[1:]:                 # pop remaining indent levels
        yield (DEDENT, '', (lnum, 0), (lnum, 0), '')
    yield (ENDMARKER, '', (lnum, 0), (lnum, 0), '')

if __name__ == '__main__':                     # testing
    import sys
    if len(sys.argv) > 1: tokenize(open(sys.argv[1]).readline)
    else: tokenize(sys.stdin.readline)
lib2to3/pgen2/pgen.py000064400000032764151153537460010366 0ustar00# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

# Pgen imports
from . import grammar, token, tokenize

class PgenGrammar(grammar.Grammar):
    pass

class ParserGenerator(object):

    def __init__(self, filename, stream=None):
        close_stream = None
        if stream is None:
            stream = open(filename)
            close_stream = stream.close
        self.filename = filename
        self.stream = stream
        self.generator = tokenize.generate_tokens(stream.readline)
        self.gettoken() # Initialize lookahead
        self.dfas, self.startsymbol = self.parse()
        if close_stream is not None:
            close_stream()
        self.first = {} # map from symbol name to set of tokens
        self.addfirstsets()

    def make_grammar(self):
        c = PgenGrammar()
        names = list(self.dfas.keys())
        names.sort()
        names.remove(self.startsymbol)
        names.insert(0, self.startsymbol)
        for name in names:
            i = 256 + len(c.symbol2number)
            c.symbol2number[name] = i
            c.number2symbol[i] = name
        for name in names:
            dfa = self.dfas[name]
            states = []
            for state in dfa:
                arcs = []
                for label, next in sorted(state.arcs.items()):
                    arcs.append((self.make_label(c, label), dfa.index(next)))
                if state.isfinal:
                    arcs.append((0, dfa.index(state)))
                states.append(arcs)
            c.states.append(states)
            c.dfas[c.symbol2number[name]] = (states, self.make_first(c, name))
        c.start = c.symbol2number[self.startsymbol]
        return c

    def make_first(self, c, name):
        rawfirst = self.first[name]
        first = {}
        for label in sorted(rawfirst):
            ilabel = self.make_label(c, label)
            ##assert ilabel not in first # XXX failed on <> ... !=
            first[ilabel] = 1
        return first

    def make_label(self, c, label):
        # XXX Maybe this should be a method on a subclass of converter?
        ilabel = len(c.labels)
        if label[0].isalpha():
            # Either a symbol name or a named token
            if label in c.symbol2number:
                # A symbol name (a non-terminal)
                if label in c.symbol2label:
                    return c.symbol2label[label]
                else:
                    c.labels.append((c.symbol2number[label], None))
                    c.symbol2label[label] = ilabel
                    return ilabel
            else:
                # A named token (NAME, NUMBER, STRING)
                itoken = getattr(token, label, None)
                assert isinstance(itoken, int), label
                assert itoken in token.tok_name, label
                if itoken in c.tokens:
                    return c.tokens[itoken]
                else:
                    c.labels.append((itoken, None))
                    c.tokens[itoken] = ilabel
                    return ilabel
        else:
            # Either a keyword or an operator
            assert label[0] in ('"', "'"), label
            value = eval(label)
            if value[0].isalpha():
                # A keyword
                if value in c.keywords:
                    return c.keywords[value]
                else:
                    c.labels.append((token.NAME, value))
                    c.keywords[value] = ilabel
                    return ilabel
            else:
                # An operator (any non-numeric token)
                itoken = grammar.opmap[value] # Fails if unknown token
                if itoken in c.tokens:
                    return c.tokens[itoken]
                else:
                    c.labels.append((itoken, None))
                    c.tokens[itoken] = ilabel
                    return ilabel

    def addfirstsets(self):
        names = list(self.dfas.keys())
        names.sort()
        for name in names:
            if name not in self.first:
                self.calcfirst(name)
            #print name, self.first[name].keys()

    def calcfirst(self, name):
        dfa = self.dfas[name]
        self.first[name] = None # dummy to detect left recursion
        state = dfa[0]
        totalset = {}
        overlapcheck = {}
        for label, next in state.arcs.items():
            if label in self.dfas:
                if label in self.first:
                    fset = self.first[label]
                    if fset is None:
                        raise ValueError("recursion for rule %r" % name)
                else:
                    self.calcfirst(label)
                    fset = self.first[label]
                totalset.update(fset)
                overlapcheck[label] = fset
            else:
                totalset[label] = 1
                overlapcheck[label] = {label: 1}
        inverse = {}
        for label, itsfirst in overlapcheck.items():
            for symbol in itsfirst:
                if symbol in inverse:
                    raise ValueError("rule %s is ambiguous; %s is in the"
                                     " first sets of %s as well as %s" %
                                     (name, symbol, label, inverse[symbol]))
                inverse[symbol] = label
        self.first[name] = totalset

    def parse(self):
        dfas = {}
        startsymbol = None
        # MSTART: (NEWLINE | RULE)* ENDMARKER
        while self.type != token.ENDMARKER:
            while self.type == token.NEWLINE:
                self.gettoken()
            # RULE: NAME ':' RHS NEWLINE
            name = self.expect(token.NAME)
            self.expect(token.OP, ":")
            a, z = self.parse_rhs()
            self.expect(token.NEWLINE)
            #self.dump_nfa(name, a, z)
            dfa = self.make_dfa(a, z)
            #self.dump_dfa(name, dfa)
            oldlen = len(dfa)
            self.simplify_dfa(dfa)
            newlen = len(dfa)
            dfas[name] = dfa
            #print name, oldlen, newlen
            if startsymbol is None:
                startsymbol = name
        return dfas, startsymbol

    def make_dfa(self, start, finish):
        # To turn an NFA into a DFA, we define the states of the DFA
        # to correspond to *sets* of states of the NFA.  Then do some
        # state reduction.  Let's represent sets as dicts with 1 for
        # values.
        assert isinstance(start, NFAState)
        assert isinstance(finish, NFAState)
        def closure(state):
            base = {}
            addclosure(state, base)
            return base
        def addclosure(state, base):
            assert isinstance(state, NFAState)
            if state in base:
                return
            base[state] = 1
            for label, next in state.arcs:
                if label is None:
                    addclosure(next, base)
        states = [DFAState(closure(start), finish)]
        for state in states: # NB states grows while we're iterating
            arcs = {}
            for nfastate in state.nfaset:
                for label, next in nfastate.arcs:
                    if label is not None:
                        addclosure(next, arcs.setdefault(label, {}))
            for label, nfaset in sorted(arcs.items()):
                for st in states:
                    if st.nfaset == nfaset:
                        break
                else:
                    st = DFAState(nfaset, finish)
                    states.append(st)
                state.addarc(st, label)
        return states # List of DFAState instances; first one is start

    def dump_nfa(self, name, start, finish):
        print("Dump of NFA for", name)
        todo = [start]
        for i, state in enumerate(todo):
            print("  State", i, state is finish and "(final)" or "")
            for label, next in state.arcs:
                if next in todo:
                    j = todo.index(next)
                else:
                    j = len(todo)
                    todo.append(next)
                if label is None:
                    print("    -> %d" % j)
                else:
                    print("    %s -> %d" % (label, j))

    def dump_dfa(self, name, dfa):
        print("Dump of DFA for", name)
        for i, state in enumerate(dfa):
            print("  State", i, state.isfinal and "(final)" or "")
            for label, next in sorted(state.arcs.items()):
                print("    %s -> %d" % (label, dfa.index(next)))

    def simplify_dfa(self, dfa):
        # This is not theoretically optimal, but works well enough.
        # Algorithm: repeatedly look for two states that have the same
        # set of arcs (same labels pointing to the same nodes) and
        # unify them, until things stop changing.

        # dfa is a list of DFAState instances
        changes = True
        while changes:
            changes = False
            for i, state_i in enumerate(dfa):
                for j in range(i+1, len(dfa)):
                    state_j = dfa[j]
                    if state_i == state_j:
                        #print "  unify", i, j
                        del dfa[j]
                        for state in dfa:
                            state.unifystate(state_j, state_i)
                        changes = True
                        break

    def parse_rhs(self):
        # RHS: ALT ('|' ALT)*
        a, z = self.parse_alt()
        if self.value != "|":
            return a, z
        else:
            aa = NFAState()
            zz = NFAState()
            aa.addarc(a)
            z.addarc(zz)
            while self.value == "|":
                self.gettoken()
                a, z = self.parse_alt()
                aa.addarc(a)
                z.addarc(zz)
            return aa, zz

    def parse_alt(self):
        # ALT: ITEM+
        a, b = self.parse_item()
        while (self.value in ("(", "[") or
               self.type in (token.NAME, token.STRING)):
            c, d = self.parse_item()
            b.addarc(c)
            b = d
        return a, b

    def parse_item(self):
        # ITEM: '[' RHS ']' | ATOM ['+' | '*']
        if self.value == "[":
            self.gettoken()
            a, z = self.parse_rhs()
            self.expect(token.OP, "]")
            a.addarc(z)
            return a, z
        else:
            a, z = self.parse_atom()
            value = self.value
            if value not in ("+", "*"):
                return a, z
            self.gettoken()
            z.addarc(a)
            if value == "+":
                return a, z
            else:
                return a, a

    def parse_atom(self):
        # ATOM: '(' RHS ')' | NAME | STRING
        if self.value == "(":
            self.gettoken()
            a, z = self.parse_rhs()
            self.expect(token.OP, ")")
            return a, z
        elif self.type in (token.NAME, token.STRING):
            a = NFAState()
            z = NFAState()
            a.addarc(z, self.value)
            self.gettoken()
            return a, z
        else:
            self.raise_error("expected (...) or NAME or STRING, got %s/%s",
                             self.type, self.value)

    def expect(self, type, value=None):
        if self.type != type or (value is not None and self.value != value):
            self.raise_error("expected %s/%s, got %s/%s",
                             type, value, self.type, self.value)
        value = self.value
        self.gettoken()
        return value

    def gettoken(self):
        tup = next(self.generator)
        while tup[0] in (tokenize.COMMENT, tokenize.NL):
            tup = next(self.generator)
        self.type, self.value, self.begin, self.end, self.line = tup
        #print token.tok_name[self.type], repr(self.value)

    def raise_error(self, msg, *args):
        if args:
            try:
                msg = msg % args
            except:
                msg = " ".join([msg] + list(map(str, args)))
        raise SyntaxError(msg, (self.filename, self.end[0],
                                self.end[1], self.line))

class NFAState(object):

    def __init__(self):
        self.arcs = [] # list of (label, NFAState) pairs

    def addarc(self, next, label=None):
        assert label is None or isinstance(label, str)
        assert isinstance(next, NFAState)
        self.arcs.append((label, next))

class DFAState(object):

    def __init__(self, nfaset, final):
        assert isinstance(nfaset, dict)
        assert isinstance(next(iter(nfaset)), NFAState)
        assert isinstance(final, NFAState)
        self.nfaset = nfaset
        self.isfinal = final in nfaset
        self.arcs = {} # map from label to DFAState

    def addarc(self, next, label):
        assert isinstance(label, str)
        assert label not in self.arcs
        assert isinstance(next, DFAState)
        self.arcs[label] = next

    def unifystate(self, old, new):
        for label, next in self.arcs.items():
            if next is old:
                self.arcs[label] = new

    def __eq__(self, other):
        # Equality test -- ignore the nfaset instance variable
        assert isinstance(other, DFAState)
        if self.isfinal != other.isfinal:
            return False
        # Can't just return self.arcs == other.arcs, because that
        # would invoke this method recursively, with cycles...
        if len(self.arcs) != len(other.arcs):
            return False
        for label, next in self.arcs.items():
            if next is not other.arcs.get(label):
                return False
        return True

    __hash__ = None # For Py3 compatibility.

def generate_grammar(filename="Grammar.txt"):
    p = ParserGenerator(filename)
    return p.make_grammar()
lib2to3/pgen2/grammar.py000064400000012635151153537460011056 0ustar00# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""This module defines the data structures used to represent a grammar.

These are a bit arcane because they are derived from the data
structures used by Python's 'pgen' parser generator.

There's also a table here mapping operators to their names in the
token module; the Python tokenize module reports all operators as the
fallback token code OP, but the parser needs the actual token code.

"""

# Python imports
import pickle

# Local imports
from . import token


class Grammar(object):
    """Pgen parsing tables conversion class.

    Once initialized, this class supplies the grammar tables for the
    parsing engine implemented by parse.py.  The parsing engine
    accesses the instance variables directly.  The class here does not
    provide initialization of the tables; several subclasses exist to
    do this (see the conv and pgen modules).

    The load() method reads the tables from a pickle file, which is
    much faster than the other ways offered by subclasses.  The pickle
    file is written by calling dump() (after loading the grammar
    tables using a subclass).  The report() method prints a readable
    representation of the tables to stdout, for debugging.

    The instance variables are as follows:

    symbol2number -- a dict mapping symbol names to numbers.  Symbol
                     numbers are always 256 or higher, to distinguish
                     them from token numbers, which are between 0 and
                     255 (inclusive).

    number2symbol -- a dict mapping numbers to symbol names;
                     these two are each other's inverse.

    states        -- a list of DFAs, where each DFA is a list of
                     states, each state is a list of arcs, and each
                     arc is a (i, j) pair where i is a label and j is
                     a state number.  The DFA number is the index into
                     this list.  (This name is slightly confusing.)
                     Final states are represented by a special arc of
                     the form (0, j) where j is its own state number.

    dfas          -- a dict mapping symbol numbers to (DFA, first)
                     pairs, where DFA is an item from the states list
                     above, and first is a set of tokens that can
                     begin this grammar rule (represented by a dict
                     whose values are always 1).

    labels        -- a list of (x, y) pairs where x is either a token
                     number or a symbol number, and y is either None
                     or a string; the strings are keywords.  The label
                     number is the index in this list; label numbers
                     are used to mark state transitions (arcs) in the
                     DFAs.

    start         -- the number of the grammar's start symbol.

    keywords      -- a dict mapping keyword strings to arc labels.

    tokens        -- a dict mapping token numbers to arc labels.

    """

    def __init__(self):
        self.symbol2number = {}
        self.number2symbol = {}
        self.states = []
        self.dfas = {}
        self.labels = [(0, "EMPTY")]
        self.keywords = {}
        self.tokens = {}
        self.symbol2label = {}
        self.start = 256

    def dump(self, filename):
        """Dump the grammar tables to a pickle file."""
        with open(filename, "wb") as f:
            pickle.dump(self.__dict__, f, pickle.HIGHEST_PROTOCOL)

    def load(self, filename):
        """Load the grammar tables from a pickle file."""
        with open(filename, "rb") as f:
            d = pickle.load(f)
        self.__dict__.update(d)

    def loads(self, pkl):
        """Load the grammar tables from a pickle bytes object."""
        self.__dict__.update(pickle.loads(pkl))

    def copy(self):
        """
        Copy the grammar.
        """
        new = self.__class__()
        for dict_attr in ("symbol2number", "number2symbol", "dfas", "keywords",
                          "tokens", "symbol2label"):
            setattr(new, dict_attr, getattr(self, dict_attr).copy())
        new.labels = self.labels[:]
        new.states = self.states[:]
        new.start = self.start
        return new

    def report(self):
        """Dump the grammar tables to standard output, for debugging."""
        from pprint import pprint
        print("s2n")
        pprint(self.symbol2number)
        print("n2s")
        pprint(self.number2symbol)
        print("states")
        pprint(self.states)
        print("dfas")
        pprint(self.dfas)
        print("labels")
        pprint(self.labels)
        print("start", self.start)


# Map from operator to number (since tokenize doesn't do this)

opmap_raw = """
( LPAR
) RPAR
[ LSQB
] RSQB
: COLON
, COMMA
; SEMI
+ PLUS
- MINUS
* STAR
/ SLASH
| VBAR
& AMPER
< LESS
> GREATER
= EQUAL
. DOT
% PERCENT
` BACKQUOTE
{ LBRACE
} RBRACE
@ AT
@= ATEQUAL
== EQEQUAL
!= NOTEQUAL
<> NOTEQUAL
<= LESSEQUAL
>= GREATEREQUAL
~ TILDE
^ CIRCUMFLEX
<< LEFTSHIFT
>> RIGHTSHIFT
** DOUBLESTAR
+= PLUSEQUAL
-= MINEQUAL
*= STAREQUAL
/= SLASHEQUAL
%= PERCENTEQUAL
&= AMPEREQUAL
|= VBAREQUAL
^= CIRCUMFLEXEQUAL
<<= LEFTSHIFTEQUAL
>>= RIGHTSHIFTEQUAL
**= DOUBLESTAREQUAL
// DOUBLESLASH
//= DOUBLESLASHEQUAL
-> RARROW
:= COLONEQUAL
"""

opmap = {}
for line in opmap_raw.splitlines():
    if line:
        op, name = line.split()
        opmap[op] = getattr(token, name)
lib2to3/pgen2/__pycache__/pgen.cpython-38.pyc000064400000023062151153537460014643 0ustar00U

e5d�5�@sdddlmZmZmZGdd�dej�ZGdd�de�ZGdd�de�ZGdd	�d	e�Z	ddd�Z
d
S)�)�grammar�token�tokenizec@seZdZdS)�PgenGrammarN)�__name__�
__module__�__qualname__�r	r	�*/usr/lib64/python3.8/lib2to3/pgen2/pgen.pyrsrc@s�eZdZd&dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd'd d!�Zd"d#�Zd$d%�ZdS)(�ParserGeneratorNcCsld}|dkrt|�}|j}||_||_t�|j�|_|��|�	�\|_
|_|dk	rZ|�i|_|�
�dS�N)�open�close�filename�streamr�generate_tokens�readline�	generator�gettoken�parse�dfas�startsymbol�first�addfirstsets)�selfrrZclose_streamr	r	r
�__init__szParserGenerator.__init__c	Cst�}t|j���}|��|�|j�|�d|j�|D]&}dt|j	�}||j	|<||j
|<q:|D]�}|j|}g}|D]`}g}t|j�
��D]$\}	}
|�|�||	�|�|
�f�q�|jr�|�d|�|�f�|�|�q||j�|�||�||�f|j|j	|<qf|j	|j|_|S)N��)r�listr�keys�sort�remover�insert�len�
symbol2numberZ
number2symbol�sorted�arcs�items�append�
make_label�index�isfinal�states�
make_first�start)r�c�names�name�i�dfar,�stater&�label�nextr	r	r
�make_grammars.

zParserGenerator.make_grammarcCs4|j|}i}t|�D]}|�||�}d||<q|S�Nr)rr%r))rr/r1Zrawfirstrr5�ilabelr	r	r
r-4s

zParserGenerator.make_firstcCsbt|j�}|d��r�||jkrZ||jkr4|j|S|j�|j|df�||j|<|Snbtt|d�}t|t	�sxt
|��|tjks�t
|��||jkr�|j|S|j�|df�||j|<|Sn�|ddks�t
|��t
|�}|d���r ||jk�r�|j|S|j�tj|f�||j|<|Sn>tj|}||jk�r@|j|S|j�|df�||j|<|SdS)Nr)�"�')r#�labels�isalphar$Zsymbol2labelr(�getattrr�
isinstance�int�AssertionError�tok_name�tokens�eval�keywords�NAMErZopmap)rr/r5r9Zitoken�valuer	r	r
r)=s<












zParserGenerator.make_labelcCs8t|j���}|��|D]}||jkr|�|�qdSr)rrrr r�	calcfirst)rr0r1r	r	r
rks

zParserGenerator.addfirstsetsc	Cs�|j|}d|j|<|d}i}i}|j��D]x\}}||jkr�||jkrj|j|}|dkr~td|��n|�|�|j|}|�|�|||<q.d||<|di||<q.i}	|��D]:\}}
|
D],}||	kr�td||||	|f��||	|<q�q�||j|<dS)Nrzrecursion for rule %rrzArule %s is ambiguous; %s is in the first sets of %s as well as %s)rrr&r'�
ValueErrorrH�update)rr1r3r4ZtotalsetZoverlapcheckr5r6�fsetZinverseZitsfirstZsymbolr	r	r
rHss4








�zParserGenerator.calcfirstc	Cs�i}d}|jtjkr�|jtjkr*|��q|�tj�}|�tjd�|��\}}|�tj�|�	||�}t
|�}|�|�t
|�}|||<|dkr|}q||fS)N�:)�typer�	ENDMARKER�NEWLINEr�expectrF�OP�	parse_rhs�make_dfar#�simplify_dfa)	rrrr1�a�zr3ZoldlenZnewlenr	r	r
r�s"

zParserGenerator.parsec	s�t|t�st�t|t�st��fdd�}�fdd��t||�|�g}|D]�}i}|jD].}|jD]"\}}	|dk	r`�|	|�|i��q`qVt|���D]@\}}
|D]}|j|
kr�q�q�t|
|�}|�	|�|�
||�q�qH|S)Ncsi}�||�|Srr	)r4�base��
addclosurer	r
�closure�s
z)ParserGenerator.make_dfa.<locals>.closurecsHt|t�st�||krdSd||<|jD]\}}|dkr(�||�q(dSr8)r?�NFAStaterAr&)r4rWr5r6rXr	r
rY�sz,ParserGenerator.make_dfa.<locals>.addclosure)r?r[rA�DFAState�nfasetr&�
setdefaultr%r'r(�addarc)rr.�finishrZr,r4r&Znfastater5r6r]�str	rXr
rS�s&



zParserGenerator.make_dfac
Cs�td|�|g}t|�D]|\}}td|||kr2dp4d�|jD]T\}}||krZ|�|�}	nt|�}	|�|�|dkr�td|	�q>td||	f�q>qdS)NzDump of NFA for�  State�(final)�z	    -> %d�    %s -> %d)�print�	enumerater&r*r#r()
rr1r.r`Ztodor2r4r5r6�jr	r	r
�dump_nfa�s

zParserGenerator.dump_nfacCsdtd|�t|�D]L\}}td||jr*dp,d�t|j���D]\}}td||�|�f�q>qdS)NzDump of DFA forrbrcrdre)rfrgr+r%r&r'r*)rr1r3r2r4r5r6r	r	r
�dump_dfa�s

zParserGenerator.dump_dfacCspd}|rld}t|�D]T\}}t|dt|��D]8}||}||kr.||=|D]}|�||�qLd}qq.qqdS)NTFr)rg�ranger#�
unifystate)rr3Zchangesr2Zstate_irhZstate_jr4r	r	r
rT�szParserGenerator.simplify_dfacCs~|��\}}|jdkr||fSt�}t�}|�|�|�|�|jdkrr|��|��\}}|�|�|�|�q>||fSdS)N�|)�	parse_altrGr[r_r)rrUrVZaaZzzr	r	r
rR�s




zParserGenerator.parse_rhscCsL|��\}}|jdks(|jtjtjfkrD|��\}}|�|�|}q||fS)N)�(�[)�
parse_itemrGrMrrF�STRINGr_)rrU�br/�dr	r	r
rn
s
�
zParserGenerator.parse_altcCs�|jdkr>|��|��\}}|�tjd�|�|�||fS|��\}}|j}|dkr`||fS|��|�|�|dkr�||fS||fSdS)Nrp�])�+�*rv)rGrrRrPrrQr_�
parse_atom)rrUrVrGr	r	r
rqs


zParserGenerator.parse_itemcCs�|jdkr4|��|��\}}|�tjd�||fS|jtjtjfkrpt	�}t	�}|�
||j�|��||fS|�d|j|j�dS)Nro�)z+expected (...) or NAME or STRING, got %s/%s)rGrrRrPrrQrMrFrrr[r_�raise_error)rrUrVr	r	r
rx(s
�zParserGenerator.parse_atomcCsD|j|ks|dk	r2|j|kr2|�d|||j|j�|j}|��|S)Nzexpected %s/%s, got %s/%s)rMrGrzr)rrMrGr	r	r
rP9s�zParserGenerator.expectcCsFt|j�}|dtjtjfkr*t|j�}q
|\|_|_|_|_|_	dS)Nr)
r6rr�COMMENT�NLrMrGZbegin�end�line)r�tupr	r	r
rAs
zParserGenerator.gettokenc
Gs^|r8z||}Wn&d�|gttt|���}YnXt||j|jd|jd|jf��dS)N� rr)�joinr�map�str�SyntaxErrorrr}r~)r�msg�argsr	r	r
rzHs �zParserGenerator.raise_error)N)N)rrrrr7r-r)rrHrrSrirjrTrRrnrqrxrPrrzr	r	r	r
r
s$
	.$

rc@seZdZdd�Zddd�ZdS)r[cCs
g|_dSr)r&)rr	r	r
rSszNFAState.__init__NcCs8|dkst|t�st�t|t�s$t�|j�||f�dSr)r?r�rAr[r&r(�rr6r5r	r	r
r_VszNFAState.addarc)N)rrrrr_r	r	r	r
r[Qsr[c@s0eZdZdd�Zdd�Zdd�Zdd�Zd	Zd	S)
r\cCsLt|t�st�ttt|��t�s$t�t|t�s2t�||_||k|_i|_dSr)	r?�dictrAr6�iterr[r]r+r&)rr]�finalr	r	r
r]s
zDFAState.__init__cCs8t|t�st�||jkst�t|t�s*t�||j|<dSr)r?r�rAr&r\r�r	r	r
r_eszDFAState.addarccCs*|j��D]\}}||kr
||j|<q
dSr)r&r')r�old�newr5r6r	r	r
rlkszDFAState.unifystatecCsdt|t�st�|j|jkrdSt|j�t|j�kr6dS|j��D]\}}||j�|�k	r@dSq@dS)NFT)r?r\rAr+r#r&r'�get)r�otherr5r6r	r	r
�__eq__pszDFAState.__eq__N)rrrrr_rlr��__hash__r	r	r	r
r\[s
r\�Grammar.txtcCst|�}|��Sr)rr7)r�pr	r	r
�generate_grammar�sr�N)r�)rdrrrZGrammarr�objectrr[r\r�r	r	r	r
�<module>sI
%lib2to3/pgen2/__pycache__/literals.cpython-38.pyc000064400000003024151153537460015525 0ustar00U

e5dc�@sPdZddlZddddddd	d
ddd
�
Zdd�Zdd�Zdd�ZedkrLe�dS)z<Safely evaluate Python string literals without using eval().�N����
�
�	��'�"�\)
�a�b�f�n�r�t�vr	r
rcCs�|�dd�\}}|�d�st�t�|�}|dk	r4|S|�d�r�|dd�}t|�dkrbtd|��zt|d�}Wq�tk
r�td|�d�Yq�Xn2zt|d�}Wn"tk
r�td	|�d�YnXt|�S)
Nr�r�x�z!invalid hex string escape ('\%s')��z#invalid octal string escape ('\%s'))	�group�
startswith�AssertionError�simple_escapes�get�len�
ValueError�int�chr)�m�all�tailZescZhexes�i�r%�./usr/lib64/python3.8/lib2to3/pgen2/literals.py�escapes$

r'cCs�|�d�s(|�d�s(tt|dd����|d}|dd�|dkrL|d}|�|�sptt|t|�d����t|�dt|�ks�t�|t|�t|��}t�dt|�S)Nr	r
rr�rz)\\(\'|\"|\\|[abfnrtv]|x.{0,2}|[0-7]{1,3}))rr�repr�endswithr�re�subr')�s�qr%r%r&�
evalString(s($r/cCs@td�D]2}t|�}t|�}t|�}||krt||||�qdS)N�)�ranger r)r/�print)r$�cr-�er%r%r&�test2sr5�__main__)�__doc__r+rr'r/r5�__name__r%r%r%r&�<module>s"�
	lib2to3/pgen2/__pycache__/parse.cpython-38.opt-2.pyc000064400000006256151153537460015772 0ustar00U

e5d��@s0ddlmZGdd�de�ZGdd�de�ZdS)�)�tokenc@seZdZdd�Zdd�ZdS)�
ParseErrorcCs4t�|d||||f�||_||_||_||_dS)Nz!%s: type=%r, value=%r, context=%r)�	Exception�__init__�msg�type�value�context)�selfrrrr	�r�+/usr/lib64/python3.8/lib2to3/pgen2/parse.pyrs
�zParseError.__init__cCst|�|j|j|j|jffS�N)rrrr	)r
rrr�
__reduce__szParseError.__reduce__N)�__name__�
__module__�__qualname__rrrrrrrsrc@sHeZdZddd�Zddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dS)�ParserNcCs||_|pdd�|_dS)NcSs|Sr
r)�grammar�noderrr�<lambda>Z�z!Parser.__init__.<locals>.<lambda>)r�convert)r
rrrrrr<szParser.__init__cCsH|dkr|jj}|ddgf}|jj|d|f}|g|_d|_t�|_dS)N�)r�start�dfas�stack�rootnode�set�
used_names)r
r�newnodeZ
stackentryrrr�setup\s
zParser.setupcCs0|�|||�}|jd\}}}|\}}	||}
|
D]�\}}|jj|\}
}||kr�|�||||�|}||d|fgkr�|��|js�dS|jd\}}}|\}}	qfdS|
dkr2|jj|
}|\}}||kr2|�|
|jj|
||�qq2d|f|
k�r|��|j�s*td|||��qtd|||��qdS)N���rTF�ztoo much inputz	bad input)	�classifyrr�labels�shift�popr�pushr)r
rrr	�ilabel�dfa�staterZstates�firstZarcs�i�newstate�t�vZitsdfaZ	itsstatesZitsfirstrrr�addtokents>
�zParser.addtokencCsX|tjkr0|j�|�|jj�|�}|dk	r0|S|jj�|�}|dkrTtd|||��|S)Nz	bad token)	r�NAMEr�addr�keywords�get�tokensr)r
rrr	r(rrrr#�s
zParser.classifyc	CsT|jd\}}}|||df}|�|j|�}|dk	r@|d�|�|||f|jd<dS�Nr!)rrr�append)	r
rrr-r	r)r*rrrrrr%�szParser.shiftc	CsB|jd\}}}|d|gf}|||f|jd<|j�|d|f�dS)Nr!r)rr7)	r
rZnewdfar-r	r)r*rrrrrr'�szParser.pushcCs`|j��\}}}|�|j|�}|dk	r\|jrL|jd\}}}|d�|�n||_|j|j_dSr6)rr&rrr7rr)r
ZpopdfaZpopstateZpopnoderr)r*rrrrr&�sz
Parser.pop)N)N)
rrrrr r0r#r%r'r&rrrrrs
 
0	rN)�rrr�objectrrrrr�<module>slib2to3/pgen2/__pycache__/literals.cpython-38.opt-1.pyc000064400000002530151153537460016465 0ustar00U

e5dc�@sPdZddlZddddddd	d
ddd
�
Zdd�Zdd�Zdd�ZedkrLe�dS)z<Safely evaluate Python string literals without using eval().�N����
�
�	��'�"�\)
�a�b�f�n�r�t�vr	r
rcCs�|�dd�\}}t�|�}|dk	r&|S|�d�r�|dd�}t|�dkrTtd|��zt|d�}Wq�tk
r�td|�d�Yq�Xn2zt|d�}Wn"tk
r�td|�d�YnXt|�S)	Nr��x�z!invalid hex string escape ('\%s')��z#invalid octal string escape ('\%s'))�group�simple_escapes�get�
startswith�len�
ValueError�int�chr)�m�all�tailZescZhexes�i�r$�./usr/lib64/python3.8/lib2to3/pgen2/literals.py�escapes"

r&cCsH|d}|dd�|dkr$|d}|t|�t|��}t�dt|�S)Nr�z)\\(\'|\"|\\|[abfnrtv]|x.{0,2}|[0-7]{1,3}))r�re�subr&)�s�qr$r$r%�
evalString(s
r,cCs@td�D]2}t|�}t|�}t|�}||krt||||�qdS)N�)�ranger�reprr,�print)r#�cr*�er$r$r%�test2sr3�__main__)�__doc__r(rr&r,r3�__name__r$r$r$r%�<module>s"�
	lib2to3/pgen2/__pycache__/__init__.cpython-38.opt-1.pyc000064400000000247151153537460016410 0ustar00U

e5d��@sdZdS)zThe pgen2 package.N)�__doc__�rr�./usr/lib64/python3.8/lib2to3/pgen2/__init__.py�<module>�lib2to3/pgen2/__pycache__/tokenize.cpython-38.pyc000064400000035652151153537460015552 0ustar00U

e5d?R�
@s�dZdZdZddlZddlZddlmZmZddlTddl	m
Z
d	d
�ee
�D�ddd
gZ[
ze
Wnek
r~eZ
YnXdd�Zdd�Zdd�Zdd�ZdZdZeede�ee�ZdZdZdZdZedd�Zeeeee�ZdZed d!�ee�Zd"eZeee�Z ed#e d$�Z!ee!e e�Z"d%Z#d&Z$d'Z%d(Z&d)Z'ee'd*e'd+�Z(ee'd,e'd-�Z)ed.d/d0d1d2d3d4d5d6�	Z*d7Z+ed8d9d:�Z,ee*e+e,�Z-ee"e-e)e�Z.ee.Z/ee'd;ed<d�e'd=ed>d��Z0edee(�Z1eee1e"e-e0e�Z2e3ej4e/e2e%e&f�\Z5Z6Z7Z8ed?d@dAdB�ed?d@dCdD�BdEdFdGdHdIdJhBZ9e�4e#�e�4e$�e7e8dK�dLdM�e9D�dNdM�e9D�dOdM�e9D��Z:d*d+hdPdQ�e9D�BdRdQ�e9D�BZ;d<d>hdSdQ�e9D�BdTdQ�e9D�BZ<dUZ=GdVdW�dWe>�Z?GdXdY�dYe>�Z@dZd[�ZAeAfd\d�ZBd]d^�ZCGd_d`�d`�ZDe�4daejE�ZFe�4dbejE�ZGdcdd�ZHdedf�ZIdgd
�ZJdhd�ZKeLdik�r�ddlMZMeNeMjO�dk�r�eBePeMjOd�jQ�neBeMjRjQ�dS)ja�Tokenization help for Python programs.

generate_tokens(readline) is a generator that breaks a stream of
text into Python tokens.  It accepts a readline-like method which is called
repeatedly to get the next line of input (or "" for EOF).  It generates
5-tuples with these members:

    the token type (see token.py)
    the token (a string)
    the starting (row, column) indices of the token (a 2-tuple of ints)
    the ending (row, column) indices of the token (a 2-tuple of ints)
    the original line (string)

It is designed to match the working of the Python tokenizer exactly, except
that it produces COMMENT tokens for comments and gives type OP for all
operators

Older entry points
    tokenize_loop(readline, tokeneater)
    tokenize(readline, tokeneater=printtoken)
are the same, except instead of generating tokens, tokeneater is a callback
function to which the 5 fields described above are passed as 5 arguments,
each time a new token is found.zKa-Ping Yee <ping@lfw.org>z@GvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, Skip Montanaro�N)�BOM_UTF8�lookup)�*�)�tokencCsg|]}|ddkr|�qS)r�_�)�.0�xrr�./usr/lib64/python3.8/lib2to3/pgen2/tokenize.py�
<listcomp>%sr�tokenize�generate_tokens�
untokenizecGsdd�|�dS)N�(�|�))�join��choicesrrr�group0�rcGst|�dS)Nr�rrrrr�any1rrcGst|�dS)N�?rrrrr�maybe2rrcst�fdd��D��S)Nc3s4|],}�dD]}|��|��kr||VqqdS))�N)�casefold)r	r
�y��lrr�	<genexpr>4s

z _combinations.<locals>.<genexpr>)�setrrrr�
_combinations3s�r#z[ \f\t]*z	#[^\r\n]*z\\\r?\nz\w+z0[bB]_?[01]+(?:_[01]+)*z(0[xX]_?[\da-fA-F]+(?:_[\da-fA-F]+)*[lL]?z0[oO]?_?[0-7]+(?:_[0-7]+)*[lL]?z[1-9]\d*(?:_\d+)*[lL]?z0[lL]?z[eE][-+]?\d+(?:_\d+)*z\d+(?:_\d+)*\.(?:\d+(?:_\d+)*)?z\.\d+(?:_\d+)*z\d+(?:_\d+)*z\d+(?:_\d+)*[jJ]z[jJ]z[^'\\]*(?:\\.[^'\\]*)*'z[^"\\]*(?:\\.[^"\\]*)*"z%[^'\\]*(?:(?:\\.|'(?!''))[^'\\]*)*'''z%[^"\\]*(?:(?:\\.|"(?!""))[^"\\]*)*"""z'(?:[uUrRbBfF]|[rR][fFbB]|[fFbBuU][rR])?�'''�"""z'[^\n'\\]*(?:\\.[^\n'\\]*)*'z"[^\n"\\]*(?:\\.[^\n"\\]*)*"z\*\*=?z>>=?z<<=?z<>z!=z//=?z->z[+\-*/%&@|^=<>]=?�~z[][(){}]z\r?\nz:=z[:;.,`@]z'[^\n'\\]*(?:\\.[^\n'\\]*)*�'z"[^\n"\\]*(?:\\.[^\n"\\]*)*�"�r�R�f�F�b�B�u�UZurZuRZUrZUR)r'r(r$r%cCsi|]}|�d�t�qS�r$)�single3prog�r	�prefixrrr�
<dictcomp>ysr5cCsi|]}|�d�t�qS�r%)�double3progr3rrrr5zscCsi|]
}|d�qS�Nrr3rrrr5{scCsh|]}|�d��qSr1rr3rrr�	<setcomp>sr9cCsh|]}|�d��qSr6rr3rrrr9�scCsh|]}|�d��qS)r'rr3rrrr9�scCsh|]}|�d��qS)r(rr3rrrr9�s�c@seZdZdS)�
TokenErrorN��__name__�
__module__�__qualname__rrrrr;�sr;c@seZdZdS)�StopTokenizingNr<rrrrr@�sr@c		Cs4|\}}|\}}td||||t|t|�f�dS)Nz%d,%d-%d,%d:	%s	%s)�print�tok_name�repr)	�typerZxxx_todo_changemeZxxx_todo_changeme1�lineZsrowZscolZerowZecolrrr�
printtoken�s
�rFcCs(zt||�Wntk
r"YnXdS)a:
    The tokenize() function accepts two parameters: one representing the
    input stream, and one providing an output mechanism for tokenize().

    The first parameter, readline, must be a callable object which provides
    the same interface as the readline() method of built-in file objects.
    Each call to the function should return one line of input as a string.

    The second parameter, tokeneater, must also be a callable object. It is
    called once for each token, with five arguments, corresponding to the
    tuples generated by generate_tokens().
    N)�
tokenize_loopr@)�readline�
tokeneaterrrrr
�s
cCst|�D]}||�qdSr8)r)rHrIZ
token_inforrrrG�srGc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�UntokenizercCsg|_d|_d|_dS)Nrr)�tokens�prev_row�prev_col)�selfrrr�__init__�szUntokenizer.__init__cCs8|\}}||jkst�||j}|r4|j�d|�dS)N� )rL�AssertionErrorrMrK�append)rN�start�row�col�
col_offsetrrr�add_whitespace�s

zUntokenizer.add_whitespacecCs�|D]p}t|�dkr$|�||�qv|\}}}}}|�|�|j�|�|\|_|_|ttfkr|jd7_d|_qd�	|j�S)N�rrr)
�len�compatrWrKrRrLrM�NEWLINE�NLr)rN�iterable�t�tok_typerrS�endrErrrr�s
zUntokenizer.untokenizec	Cs�d}g}|jj}|\}}|ttfkr,|d7}|ttfkr<d}|D]�}|dd�\}}|ttttfkrl|d7}|tkr�|�|�q@n>|t	kr�|�
�q@n*|ttfkr�d}n|r�|r�||d�d}||�q@dS)NFrPTrX���)rKrR�NAME�NUMBERr[r\�ASYNC�AWAIT�INDENT�DEDENT�pop)	rNrr]�	startline�indents�toks_append�toknum�tokval�tokrrrrZ�s0
zUntokenizer.compatN)r=r>r?rOrWrrZrrrrrJ�srJz&^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)s^[ \t\f]*(?:[#\r\n]|$)cCsH|dd����dd�}|dks*|�d�r.dS|dks@|�d�rDd	S|S)
z(Imitates get_normal_name in tokenizer.c.N�r�-�utf-8zutf-8-)zlatin-1�
iso-8859-1ziso-latin-1)zlatin-1-ziso-8859-1-ziso-latin-1-rr)�lower�replace�
startswith)�orig_enc�encrrr�_get_normal_name�s�rxcs�d�d}d}�fdd�}�fdd�}|�}|�t�rHd�|d	d�}d
}|sT|gfS||�}|rj||gfSt�|�s~||gfS|�}|s�||gfS||�}|r�|||gfS|||gfS)a
    The detect_encoding() function is used to detect the encoding that should
    be used to decode a Python source file. It requires one argument, readline,
    in the same way as the tokenize() generator.

    It will call readline a maximum of twice, and return the encoding used
    (as a string) and a list of any lines (left as bytes) it has read
    in.

    It detects the encoding from the presence of a utf-8 bom or an encoding
    cookie as specified in pep-0263. If both a bom and a cookie are present, but
    disagree, a SyntaxError will be raised. If the encoding cookie is an invalid
    charset, raise a SyntaxError.  Note that if a utf-8 bom is found,
    'utf-8-sig' is returned.

    If no encoding is specified, then the default of 'utf-8' will be returned.
    FNrqcs(z��WStk
r"t�YSXdSr8)�
StopIteration�bytesr)rHrr�read_or_stopsz%detect_encoding.<locals>.read_or_stopcs�z|�d�}Wntk
r$YdSXt�|�}|s8dSt|�d��}zt|�}Wn tk
rrtd|��YnX�r�|j	dkr�td��|d7}|S)N�asciirzunknown encoding: rqzencoding problem: utf-8z-sig)
�decode�UnicodeDecodeError�	cookie_re�matchrxrr�LookupError�SyntaxError�name)rE�line_stringr��encoding�codec)�	bom_foundrr�find_cookies"

z$detect_encoding.<locals>.find_cookieT�z	utf-8-sig)rur�blank_rer�)rHr��defaultr{r��first�secondr)r�rHr�detect_encoding�s0




r�cCst�}|�|�S)a�Transform tokens back into Python source code.

    Each element returned by the iterable must be a token sequence
    with at least two elements, a token number and token value.  If
    only two tokens are passed, the resulting output is poor.

    Round-trip invariant for full input:
        Untokenized source will match input source exactly

    Round-trip invariant for limited input:
        # Output text will tokenize the back to the input
        t1 = [tok[:2] for tok in generate_tokens(f.readline)]
        newcode = untokenize(t1)
        readline = iter(newcode.splitlines(1)).next
        t2 = [tok[:2] for tokin generate_tokens(readline)]
        assert t1 == t2
    )rJr)r]�utrrrr:sccs�d}}}d\}}d}dg}d}d}	d}
d}z
|�}Wntk
rPd}YnX|d}dt|�}
}|�r2|s|td|��|�|�}|r�|�d�}
}t||d|�|||f||fVd\}}d}nd|�r|dd�d	k�r|d
d�dk�rt||||t|�f|fVd}d}q.n||}||}q.�nB|dk�r\|�s\|�sL�q,d}|
|k�r�||
dk�rr|d}n8||
d
k�r�|tdt}n||
dk�r�d}n�q�|
d}
�qP|
|k�rĐq,|�r�|Vd}||
dk�r�||
dk�rT||
d��d�}|
t|�}t	|||
f||
t|�f|fVt
||d�||f|t|�f|fVq.t
t	f||
dk||
d�||
f|t|�f|fVq.||dk�r�|�|�t|d|
�|df||
f|fV||dk�r4||k�r�t
dd||
|f��|dd�}|	�r|
|dk�rd}	d}d}
td||
f||
f|fV�q�|	�rt|�rt|
|dk�rtd}	d}d}
n|�sptd|df��d}|
|kr.t�||
�}|�r�|�d�\}}||f||f|}}}
|||�||}}|tjk�s�|dk�r�|dk�r�t||||fV�q&|dk�rJt}|dk�rt
}n
|	�r&d}|�r6|Vd}|||||fV�q&|dk�r�|�d��rdt�|�rt|Vd}t	||||fV�q&|tk�rt|}|�||
�}|�r�|�d�}
|||
�}|�r�|Vd}t||||
f|fVn||f}||d�}|}q.�q&|tk�s4|dd�tk�s4|dd�tk�r�|ddk�r�||f}t|�plt|d�plt|d}||d�d}}|}q.n |�r�|Vd}t||||fV�q&|���r�|dk�r�|	�r�|dk�r�tnt||||fV�qtt||||f}|dk�r|�s|}�qt|dk�rj|�rj|dtk�rj|ddk�rjd}	|d}
t|d|d|d|dfVd}|�rz|Vd}|Vnz|dk�r�|�r�|Vd}t
||||
f|fVd}nF|d k�r�|d}n|d!k�r�|d}|�r�|Vd}t||||fVn(t||
||
f||
df|fV|
d}
�qtq.|�r<|Vd}|dd�D]}td|df|dfdfV�qHtd|df|dfdfVdS)"a4
    The generate_tokens() generator requires one argument, readline, which
    must be a callable object which provides the same interface as the
    readline() method of built-in file objects. Each call to the function
    should return one line of input as a string.  Alternately, readline
    can be a callable function terminating with StopIteration:
        readline = open(myfile).next    # Example of alternate readline

    The generator produces 5-tuples with these members: the token type; the
    token string; a 2-tuple (srow, scol) of ints specifying the row and
    column where the token begins in the source; a 2-tuple (erow, ecol) of
    ints specifying the row and column where the token ends in the source;
    and the line on which the token was found. The line passed is the
    physical line.
    r)rrNFrrzEOF in multi-line string���z\
���z\
rP�	�z#
�#z
raz3unindent does not match any outer indentation levelz
<tokenize>zEOF in multi-line statement�.T�
rXr�)�async�awaitr��def��\z([{z)]}) ryrYr;r�r`�STRING�
ERRORTOKEN�tabsize�rstrip�COMMENTr\rRrf�IndentationErrorrg�
pseudoprog�span�stringZdigitsrcr[�endswithrQ�
triple_quoted�endprogs�
single_quoted�isidentifierrdrerb�OP�	ENDMARKER)rH�lnum�parenlev�	continued�contstr�needcont�contlinerjZstashedZ	async_defZasync_def_indentZasync_def_nlrE�pos�max�strstart�endprog�endmatchr`�column�
comment_tokenZnl_pos�pseudomatchrS�spos�eposr�initial�newlinern�indentrrrrOs�



�*
�


�
�
�
 

���





��
�

�

�
��




��__main__)S�__doc__�
__author__�__credits__r��re�codecsrrZlib2to3.pgen2.tokenrr�dir�__all__rz�	NameError�strrrrr#�
Whitespace�Comment�Ignore�Name�	Binnumber�	Hexnumber�	Octnumber�	Decnumber�	Intnumber�Exponent�
Pointfloat�Expfloat�Floatnumber�
Imagnumber�Number�Single�Double�Single3�Double3Z
_litprefix�Triple�StringZOperatorZBracket�Special�Funny�
PlainToken�Token�ContStr�PseudoExtras�PseudoToken�map�compileZ	tokenprogr�r2r7Z_strprefixesr�r�r�r��	Exceptionr;r@rFr
rGrJ�ASCIIrr�rxr�rrr=�sysrY�argv�openrH�stdinrrrr�<module>s���


�����
������������8Ib
lib2to3/pgen2/__pycache__/tokenize.cpython-38.opt-2.pyc000064400000026056151153537460016510 0ustar00U

e5d?R�
@s�dZdZddlZddlZddlmZmZddlTddlm	Z	dd	�e
e	�D�d
ddgZ[	zeWne
k
rzeZYnXd
d�Zdd�Zdd�Zdd�ZdZdZeede�ee�ZdZdZdZdZedd�Zeeeee�ZdZedd �ee�Zd!eZeee�Zed"ed#�Z ee ee�Z!d$Z"d%Z#d&Z$d'Z%d(Z&ee&d)e&d*�Z'ee&d+e&d,�Z(ed-d.d/d0d1d2d3d4d5�	Z)d6Z*ed7d8d9�Z+ee)e*e+�Z,ee!e,e(e�Z-ee-Z.ee&d:ed;d�e&d<ed=d��Z/edee'�Z0eee0e!e,e/e�Z1e2ej3e.e1e$e%f�\Z4Z5Z6Z7ed>d?d@dA�ed>d?dBdC�BdDdEdFdGdHdIhBZ8e�3e"�e�3e#�e6e7dJ�dKdL�e8D�dMdL�e8D�dNdL�e8D��Z9d)d*hdOdP�e8D�BdQdP�e8D�BZ:d;d=hdRdP�e8D�BdSdP�e8D�BZ;dTZ<GdUdV�dVe=�Z>GdWdX�dXe=�Z?dYdZ�Z@e@fd[d
�ZAd\d]�ZBGd^d_�d_�ZCe�3d`ejD�ZEe�3daejD�ZFdbdc�ZGddde�ZHdfd�ZIdgd�ZJeKdhk�r�ddlLZLeMeLjN�dk�r�eAeOeLjNd�jP�neAeLjQjP�dS)izKa-Ping Yee <ping@lfw.org>z@GvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, Skip Montanaro�N)�BOM_UTF8�lookup)�*�)�tokencCsg|]}|ddkr|�qS)r�_�)�.0�xrr�./usr/lib64/python3.8/lib2to3/pgen2/tokenize.py�
<listcomp>%sr�tokenize�generate_tokens�
untokenizecGsdd�|�dS)N�(�|�))�join��choicesrrr�group0�rcGst|�dS)Nr�rrrrr�any1rrcGst|�dS)N�?rrrrr�maybe2rrcst�fdd��D��S)Nc3s4|],}�dD]}|��|��kr||VqqdS))�N)�casefold)r	r
�y��lrr�	<genexpr>4s

z _combinations.<locals>.<genexpr>)�setrrrr�
_combinations3s�r#z[ \f\t]*z	#[^\r\n]*z\\\r?\nz\w+z0[bB]_?[01]+(?:_[01]+)*z(0[xX]_?[\da-fA-F]+(?:_[\da-fA-F]+)*[lL]?z0[oO]?_?[0-7]+(?:_[0-7]+)*[lL]?z[1-9]\d*(?:_\d+)*[lL]?z0[lL]?z[eE][-+]?\d+(?:_\d+)*z\d+(?:_\d+)*\.(?:\d+(?:_\d+)*)?z\.\d+(?:_\d+)*z\d+(?:_\d+)*z\d+(?:_\d+)*[jJ]z[jJ]z[^'\\]*(?:\\.[^'\\]*)*'z[^"\\]*(?:\\.[^"\\]*)*"z%[^'\\]*(?:(?:\\.|'(?!''))[^'\\]*)*'''z%[^"\\]*(?:(?:\\.|"(?!""))[^"\\]*)*"""z'(?:[uUrRbBfF]|[rR][fFbB]|[fFbBuU][rR])?�'''�"""z'[^\n'\\]*(?:\\.[^\n'\\]*)*'z"[^\n"\\]*(?:\\.[^\n"\\]*)*"z\*\*=?z>>=?z<<=?z<>z!=z//=?z->z[+\-*/%&@|^=<>]=?�~z[][(){}]z\r?\nz:=z[:;.,`@]z'[^\n'\\]*(?:\\.[^\n'\\]*)*�'z"[^\n"\\]*(?:\\.[^\n"\\]*)*�"�r�R�f�F�b�B�u�UZurZuRZUrZUR)r'r(r$r%cCsi|]}|�d�t�qS�r$)�single3prog�r	�prefixrrr�
<dictcomp>ysr5cCsi|]}|�d�t�qS�r%)�double3progr3rrrr5zscCsi|]
}|d�qS�Nrr3rrrr5{scCsh|]}|�d��qSr1rr3rrr�	<setcomp>sr9cCsh|]}|�d��qSr6rr3rrrr9�scCsh|]}|�d��qS)r'rr3rrrr9�scCsh|]}|�d��qS)r(rr3rrrr9�s�c@seZdZdS)�
TokenErrorN��__name__�
__module__�__qualname__rrrrr;�sr;c@seZdZdS)�StopTokenizingNr<rrrrr@�sr@c		Cs4|\}}|\}}td||||t|t|�f�dS)Nz%d,%d-%d,%d:	%s	%s)�print�tok_name�repr)	�typerZxxx_todo_changemeZxxx_todo_changeme1�lineZsrowZscolZerowZecolrrr�
printtoken�s
�rFcCs(zt||�Wntk
r"YnXdSr8)�
tokenize_loopr@)�readline�
tokeneaterrrrr
�s
cCst|�D]}||�qdSr8)r)rHrIZ
token_inforrrrG�srGc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�UntokenizercCsg|_d|_d|_dS)Nrr)�tokens�prev_row�prev_col)�selfrrr�__init__�szUntokenizer.__init__cCs*|\}}||j}|r&|j�d|�dS)N� )rMrK�append)rN�start�row�col�
col_offsetrrr�add_whitespace�s
zUntokenizer.add_whitespacecCs�|D]p}t|�dkr$|�||�qv|\}}}}}|�|�|j�|�|\|_|_|ttfkr|jd7_d|_qd�	|j�S)N�rrr)
�len�compatrVrKrQrLrM�NEWLINE�NLr)rN�iterable�t�tok_typerrR�endrErrrr�s
zUntokenizer.untokenizec	Cs�d}g}|jj}|\}}|ttfkr,|d7}|ttfkr<d}|D]�}|dd�\}}|ttttfkrl|d7}|tkr�|�|�q@n>|t	kr�|�
�q@n*|ttfkr�d}n|r�|r�||d�d}||�q@dS)NFrPTrW���)rKrQ�NAME�NUMBERrZr[�ASYNC�AWAIT�INDENT�DEDENT�pop)	rNrr\�	startline�indents�toks_append�toknum�tokval�tokrrrrY�s0
zUntokenizer.compatN)r=r>r?rOrVrrYrrrrrJ�srJz&^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)s^[ \t\f]*(?:[#\r\n]|$)cCsH|dd����dd�}|dks*|�d�r.dS|dks@|�d�rDdS|S)	N�r�-�utf-8zutf-8-)zlatin-1�
iso-8859-1ziso-latin-1)zlatin-1-ziso-8859-1-ziso-latin-1-rq)�lower�replace�
startswith)�orig_enc�encrrr�_get_normal_name�s�rwcs�d�d}d}�fdd�}�fdd�}|�}|�t�rHd�|dd�}d	}|sT|gfS||�}|rj||gfSt�|�s~||gfS|�}|s�||gfS||�}|r�|||gfS|||gfS)
NFrpcs(z��WStk
r"t�YSXdSr8)�
StopIteration�bytesr)rHrr�read_or_stopsz%detect_encoding.<locals>.read_or_stopcs�z|�d�}Wntk
r$YdSXt�|�}|s8dSt|�d��}zt|�}Wn tk
rrtd|��YnX�r�|j	dkr�td��|d7}|S)N�asciirzunknown encoding: rpzencoding problem: utf-8z-sig)
�decode�UnicodeDecodeError�	cookie_re�matchrwrr�LookupError�SyntaxError�name)rE�line_stringr�encoding�codec)�	bom_foundrr�find_cookies"

z$detect_encoding.<locals>.find_cookieT�z	utf-8-sig)rtr�blank_rer)rHr��defaultrzr��first�secondr)r�rHr�detect_encoding�s0




r�cCst�}|�|�Sr8)rJr)r\�utrrrr:sccstd}}}d\}}d}dg}d}d}	d}
d}z
|�}Wntk
rPd}YnX|d}dt|�}
}|�r2|s|td|��|�|�}|r�|�d�}
}t||d|�|||f||fVd\}}d}nd|�r|dd�dk�r|d	d�d
k�rt||||t|�f|fVd}d}q.n||}||}q.�nB|dk�r\|�s\|�sL�qd}|
|k�r�||
dk�rr|d}n8||
dk�r�|tdt}n||
d
k�r�d}n�q�|
d}
�qP|
|k�rĐq|�r�|Vd}||
dk�r�||
dk�rT||
d��d�}|
t|�}t	|||
f||
t|�f|fVt
||d�||f|t|�f|fVq.t
t	f||
dk||
d�||
f|t|�f|fVq.||dk�r�|�|�t|d|
�|df||
f|fV||dk�r4||k�r�t
dd||
|f��|dd�}|	�r|
|dk�rd}	d}d}
td||
f||
f|fV�q�|	�rt|�rt|
|dk�rtd}	d}d}
n|�sptd|df��d}|
|kr.t�||
�}|�r�|�d�\}}||f||f|}}}
|||�||}}|tjk�s�|dk�r�|dk�r�t||||fV�q|dk�rJt}|dk�rt
}n
|	�r&d}|�r6|Vd}|||||fV�q|dk�rx|�rd|Vd}t	||||fV�q|tk�r�t|}|�||
�}|�r�|�d�}
|||
�}|�r�|Vd}t||||
f|fVn||f}||d�}|}q.�q|tk�s$|dd�tk�s$|dd�tk�r�|ddk�rx||f}t|�p\t|d�p\t|d}||d�d}}|}q.n |�r�|Vd}t||||fV�q|���rr|dk�r�|	�r�|dk�r�tnt||||fV�qtt||||f}|dk�r�|�s�|}�qt|dk�rZ|�rZ|dtk�rZ|ddk�rZd}	|d}
t|d|d|d|dfVd}|�rj|Vd}|Vnz|dk�r�|�r�|Vd}t
||||
f|fVd}nF|dk�r�|d}n|d k�r�|d}|�r�|Vd}t||||fVn(t||
||
f||
df|fV|
d}
�qtq.|�r,|Vd}|dd�D]}td|df|dfdfV�q8td|df|dfdfVdS)!Nr)rrFrrzEOF in multi-line string���z\
���z\
rP�	�z#
�#z
r`z3unindent does not match any outer indentation levelz
<tokenize>zEOF in multi-line statement�.TrWr��
)�async�awaitr��def��\z([{z)]})rxrXr;rr_�STRING�
ERRORTOKEN�tabsize�rstrip�COMMENTr[rQre�IndentationErrorrf�
pseudoprog�span�stringZdigitsrbrZ�
triple_quoted�endprogs�
single_quoted�isidentifierrcrdra�OP�	ENDMARKER)rH�lnum�parenlev�	continued�contstr�needcont�contlineriZstashedZ	async_defZasync_def_indentZasync_def_nlrE�pos�max�strstart�endprog�endmatchr_�column�
comment_tokenZnl_pos�pseudomatchrR�spos�eposr�initial�newlinerm�indentrrrrOs�



�*
�


�
�
�
 

���





��
�

�

�
��




��__main__)R�
__author__�__credits__r��re�codecsrrZlib2to3.pgen2.tokenrr�dir�__all__ry�	NameError�strrrrr#�
Whitespace�Comment�Ignore�Name�	Binnumber�	Hexnumber�	Octnumber�	Decnumber�	Intnumber�Exponent�
Pointfloat�Expfloat�Floatnumber�
Imagnumber�Number�Single�Double�Single3�Double3Z
_litprefix�Triple�StringZOperatorZBracket�Special�Funny�
PlainToken�Token�ContStr�PseudoExtras�PseudoToken�map�compileZ	tokenprogr�r2r7Z_strprefixesr�r�r�r��	Exceptionr;r@rFr
rGrJ�ASCIIr~r�rwr�rrr=�sysrX�argv�openrH�stdinrrrr�<module>s���


�����
������������8Ib
lib2to3/pgen2/__pycache__/grammar.cpython-38.opt-2.pyc000064400000004724151153537460016304 0ustar00U

e5d��@s\ddlZddlmZGdd�de�ZdZiZe��D]"Zer4e�	�\Z
Zeee�ee
<q4dS)�N�)�tokenc@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�GrammarcCs<i|_i|_g|_i|_dg|_i|_i|_i|_d|_dS)N)rZEMPTY�)	�
symbol2number�
number2symbol�states�dfas�labels�keywords�tokens�symbol2label�start)�self�r�-/usr/lib64/python3.8/lib2to3/pgen2/grammar.py�__init__LszGrammar.__init__c	Cs,t|d��}t�|j|tj�W5QRXdS)N�wb)�open�pickle�dump�__dict__ZHIGHEST_PROTOCOL)r�filename�frrrrWszGrammar.dumpc	Cs0t|d��}t�|�}W5QRX|j�|�dS)N�rb)rr�loadr�update)rrr�drrrr\szGrammar.loadcCs|j�t�|��dS)N)rrr�loads)rZpklrrrrbsz
Grammar.loadscCsT|��}dD]}t||t||����q|jdd�|_|jdd�|_|j|_|S)N)rrr	rrr
)�	__class__�setattr�getattr�copyr
rr)r�newZ	dict_attrrrrr"fszGrammar.copycCsvddlm}td�||j�td�||j�td�||j�td�||j�td�||j�td|j�dS)	Nr)�pprintZs2nZn2srr	r
r)r$�printrrrr	r
r)rr$rrr�reportss




zGrammar.reportN)	�__name__�
__module__�__qualname__rrrrr"r&rrrrrs6
ra
( LPAR
) RPAR
[ LSQB
] RSQB
: COLON
, COMMA
; SEMI
+ PLUS
- MINUS
* STAR
/ SLASH
| VBAR
& AMPER
< LESS
> GREATER
= EQUAL
. DOT
% PERCENT
` BACKQUOTE
{ LBRACE
} RBRACE
@ AT
@= ATEQUAL
== EQEQUAL
!= NOTEQUAL
<> NOTEQUAL
<= LESSEQUAL
>= GREATEREQUAL
~ TILDE
^ CIRCUMFLEX
<< LEFTSHIFT
>> RIGHTSHIFT
** DOUBLESTAR
+= PLUSEQUAL
-= MINEQUAL
*= STAREQUAL
/= SLASHEQUAL
%= PERCENTEQUAL
&= AMPEREQUAL
|= VBAREQUAL
^= CIRCUMFLEXEQUAL
<<= LEFTSHIFTEQUAL
>>= RIGHTSHIFTEQUAL
**= DOUBLESTAREQUAL
// DOUBLESLASH
//= DOUBLESLASHEQUAL
-> RARROW
:= COLONEQUAL
)
r�r�objectrZ	opmap_rawZopmap�
splitlines�line�split�op�namer!rrrr�<module>so3lib2to3/pgen2/__pycache__/conv.cpython-38.opt-2.pyc000064400000007112151153537460015615 0ustar00U

e5d�%�@s.ddlZddlmZmZGdd�dej�ZdS)�N)�grammar�tokenc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�	ConvertercCs |�|�|�|�|��dS�N)�parse_graminit_h�parse_graminit_c�
finish_off)�selfZ
graminit_hZ
graminit_c�r
�*/usr/lib64/python3.8/lib2to3/pgen2/conv.py�run/s

z
Converter.runc	
Cs�zt|�}Wn8tk
rD}ztd||f�WY�dSd}~XYnXi|_i|_d}|D]d}|d7}t�d|�}|s�|��r�td|||��f�qZ|��\}}t	|�}||j|<||j|<qZdS)N�Can't open %s: %sFr�z^#define\s+(\w+)\s+(\d+)$z%s(%s): can't parse %sT)
�open�OSError�printZ
symbol2numberZ
number2symbol�re�match�strip�groups�int)	r	�filename�f�err�lineno�line�mo�symbol�numberr
r
rr5s(�

zConverter.parse_graminit_hc!
Cs�zt|�}Wn8tk
rD}ztd||f�WY�dSd}~XYnXd}|dt|�}}|dt|�}}|dt|�}}i}g}|�d��r�|�d��rJt�d|�}ttt	|�
���\}	}
}g}t|�D]F}
|dt|�}}t�d|�}ttt	|�
���\}}|�||f�q�|dt|�}}|||	|
f<|dt|�}}q�t�d|�}ttt	|�
���\}}g}t|�D]R}
|dt|�}}t�d	|�}ttt	|�
���\}}	}
||	|
f}|�|��qx|�|�|dt|�}}|dt|�}}q�||_
i}t�d
|�}t	|�d��}t|�D]�}|dt|�}}t�d|�}|�d�}ttt	|�dd
dd���\}}}}||}|dt|�}}t�d|�}i}t|�d��}t|�D]@\}}t|�}td�D]$}|d|>@�r�d||d|<�qΐq�||f||<�q(|dt|�}}||_g}|dt|�}}t�d|�}t	|�d��}t|�D]^}|dt|�}}t�d|�}|�
�\}}t	|�}|dk�r�d}nt|�}|�||f��qX|dt|�}}||_|dt|�}}|dt|�}}t�d|�}t	|�d��}|dt|�}}|dt|�}}t�d|�}t	|�d��}|dt|�}}t�d|�}t	|�d��} | |_|dt|�}}z|dt|�}}Wntk
�r�YnXdS)Nr
Frrzstatic arc z)static arc arcs_(\d+)_(\d+)\[(\d+)\] = {$z\s+{(\d+), (\d+)},$z'static state states_(\d+)\[(\d+)\] = {$z\s+{(\d+), arcs_(\d+)_(\d+)},$zstatic dfa dfas\[(\d+)\] = {$z0\s+{(\d+), "(\w+)", (\d+), (\d+), states_(\d+),$����z\s+("(?:\\\d\d\d)*")},$�z!static label labels\[(\d+)\] = {$z\s+{(\d+), (0|"\w+")},$�0z
\s+(\d+),$z\s+{(\d+), labels},$z	\s+(\d+)$)rrr�next�
startswithrr�list�maprr�range�append�states�group�eval�	enumerate�ord�dfas�labels�start�
StopIteration)!r	rrrrrZallarcsr+r�n�m�kZarcs�_�i�j�s�t�stater0Zndfasrr�x�y�z�firstZ	rawbitset�cZbyter1Znlabelsr2r
r
rrTs��
�
"
zConverter.parse_graminit_ccCsXi|_i|_t|j�D]<\}\}}|tjkr@|dk	r@||j|<q|dkr||j|<qdSr)�keywords�tokensr.r1r�NAME)r	Zilabel�type�valuer
r
rr�szConverter.finish_offN)�__name__�
__module__�__qualname__rrrrr
r
r
rr$s
&r)rZpgen2rrZGrammarrr
r
r
r�<module>slib2to3/pgen2/__pycache__/token.cpython-38.pyc000064400000003541151153537460015032 0ustar00U

e5d�@sPdZdZdZdZdZdZdZdZdZd	Z	d
Z
dZdZd
Z
dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZd Z d!Z!d"Z"d#Z#d$Z$d%Z%d&Z&d'Z'd(Z(d)Z)d*Z*d+Z+d,Z,d-Z-d.Z.d/Z/d0Z0d1Z1d2Z2d3Z3d4Z4d5Z5d6Z6d7Z7d8Z8d9Z9d:Z:d;Z;d<Z<d=Z=d>Z>iZ?e@eA��B��D]$\ZCZDeEeD�eEd�k�reCe?eD<�qd?d@�ZFdAdB�ZGdCdD�ZHdES)Fz!Token constants (from "token.h").����������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�cCs|tkS�N��	NT_OFFSET��x�rD�+/usr/lib64/python3.8/lib2to3/pgen2/token.py�
ISTERMINALOsrFcCs|tkSr?r@rBrDrDrE�
ISNONTERMINALRsrGcCs|tkSr?)�	ENDMARKERrBrDrDrE�ISEOFUsrIN)I�__doc__rH�NAME�NUMBER�STRING�NEWLINE�INDENT�DEDENT�LPAR�RPAR�LSQB�RSQB�COLON�COMMA�SEMI�PLUS�MINUS�STAR�SLASH�VBAR�AMPER�LESS�GREATER�EQUAL�DOT�PERCENTZ	BACKQUOTE�LBRACE�RBRACE�EQEQUAL�NOTEQUAL�	LESSEQUAL�GREATEREQUAL�TILDE�
CIRCUMFLEX�	LEFTSHIFT�
RIGHTSHIFT�
DOUBLESTAR�	PLUSEQUAL�MINEQUAL�	STAREQUAL�
SLASHEQUAL�PERCENTEQUAL�
AMPEREQUAL�	VBAREQUAL�CIRCUMFLEXEQUAL�LEFTSHIFTEQUAL�RIGHTSHIFTEQUAL�DOUBLESTAREQUAL�DOUBLESLASH�DOUBLESLASHEQUAL�AT�ATEQUAL�OP�COMMENT�NL�RARROW�AWAIT�ASYNC�
ERRORTOKEN�
COLONEQUAL�N_TOKENSrA�tok_name�list�globals�items�_nameZ_value�typerFrGrIrDrDrDrE�<module>s�lib2to3/pgen2/__pycache__/grammar.cpython-38.pyc000064400000013043151153537460015336 0ustar00U

e5d��@s`dZddlZddlmZGdd�de�ZdZiZe��D]"Z	e	r8e	�
�\ZZe
ee�ee<q8dS)a�This module defines the data structures used to represent a grammar.

These are a bit arcane because they are derived from the data
structures used by Python's 'pgen' parser generator.

There's also a table here mapping operators to their names in the
token module; the Python tokenize module reports all operators as the
fallback token code OP, but the parser needs the actual token code.

�N�)�tokenc@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�Grammara�	Pgen parsing tables conversion class.

    Once initialized, this class supplies the grammar tables for the
    parsing engine implemented by parse.py.  The parsing engine
    accesses the instance variables directly.  The class here does not
    provide initialization of the tables; several subclasses exist to
    do this (see the conv and pgen modules).

    The load() method reads the tables from a pickle file, which is
    much faster than the other ways offered by subclasses.  The pickle
    file is written by calling dump() (after loading the grammar
    tables using a subclass).  The report() method prints a readable
    representation of the tables to stdout, for debugging.

    The instance variables are as follows:

    symbol2number -- a dict mapping symbol names to numbers.  Symbol
                     numbers are always 256 or higher, to distinguish
                     them from token numbers, which are between 0 and
                     255 (inclusive).

    number2symbol -- a dict mapping numbers to symbol names;
                     these two are each other's inverse.

    states        -- a list of DFAs, where each DFA is a list of
                     states, each state is a list of arcs, and each
                     arc is a (i, j) pair where i is a label and j is
                     a state number.  The DFA number is the index into
                     this list.  (This name is slightly confusing.)
                     Final states are represented by a special arc of
                     the form (0, j) where j is its own state number.

    dfas          -- a dict mapping symbol numbers to (DFA, first)
                     pairs, where DFA is an item from the states list
                     above, and first is a set of tokens that can
                     begin this grammar rule (represented by a dict
                     whose values are always 1).

    labels        -- a list of (x, y) pairs where x is either a token
                     number or a symbol number, and y is either None
                     or a string; the strings are keywords.  The label
                     number is the index in this list; label numbers
                     are used to mark state transitions (arcs) in the
                     DFAs.

    start         -- the number of the grammar's start symbol.

    keywords      -- a dict mapping keyword strings to arc labels.

    tokens        -- a dict mapping token numbers to arc labels.

    cCs<i|_i|_g|_i|_dg|_i|_i|_i|_d|_dS)N)rZEMPTY�)	�
symbol2number�
number2symbol�states�dfas�labels�keywords�tokens�symbol2label�start)�self�r�-/usr/lib64/python3.8/lib2to3/pgen2/grammar.py�__init__LszGrammar.__init__c	Cs,t|d��}t�|j|tj�W5QRXdS)z)Dump the grammar tables to a pickle file.�wbN)�open�pickle�dump�__dict__ZHIGHEST_PROTOCOL)r�filename�frrrrWszGrammar.dumpc	Cs0t|d��}t�|�}W5QRX|j�|�dS)z+Load the grammar tables from a pickle file.�rbN)rr�loadr�update)rrr�drrrr\szGrammar.loadcCs|j�t�|��dS)z3Load the grammar tables from a pickle bytes object.N)rrr�loads)rZpklrrrrbsz
Grammar.loadscCsT|��}dD]}t||t||����q|jdd�|_|jdd�|_|j|_|S)z#
        Copy the grammar.
        )rrr	rrr
N)�	__class__�setattr�getattr�copyr
rr)r�newZ	dict_attrrrrr"fszGrammar.copycCsvddlm}td�||j�td�||j�td�||j�td�||j�td�||j�td|j�d	S)
z:Dump the grammar tables to standard output, for debugging.r)�pprintZs2nZn2srr	r
rN)r$�printrrrr	r
r)rr$rrr�reportss




zGrammar.reportN)
�__name__�
__module__�__qualname__�__doc__rrrrr"r&rrrrrs5
ra
( LPAR
) RPAR
[ LSQB
] RSQB
: COLON
, COMMA
; SEMI
+ PLUS
- MINUS
* STAR
/ SLASH
| VBAR
& AMPER
< LESS
> GREATER
= EQUAL
. DOT
% PERCENT
` BACKQUOTE
{ LBRACE
} RBRACE
@ AT
@= ATEQUAL
== EQEQUAL
!= NOTEQUAL
<> NOTEQUAL
<= LESSEQUAL
>= GREATEREQUAL
~ TILDE
^ CIRCUMFLEX
<< LEFTSHIFT
>> RIGHTSHIFT
** DOUBLESTAR
+= PLUSEQUAL
-= MINEQUAL
*= STAREQUAL
/= SLASHEQUAL
%= PERCENTEQUAL
&= AMPEREQUAL
|= VBAREQUAL
^= CIRCUMFLEXEQUAL
<<= LEFTSHIFTEQUAL
>>= RIGHTSHIFTEQUAL
**= DOUBLESTAREQUAL
// DOUBLESLASH
//= DOUBLESLASHEQUAL
-> RARROW
:= COLONEQUAL
)r*r�r�objectrZ	opmap_rawZopmap�
splitlines�line�split�op�namer!rrrr�<module>so3lib2to3/pgen2/__pycache__/pgen.cpython-38.opt-1.pyc000064400000022161151153537460015601 0ustar00U

e5d�5�@sdddlmZmZmZGdd�dej�ZGdd�de�ZGdd�de�ZGdd	�d	e�Z	ddd�Z
d
S)�)�grammar�token�tokenizec@seZdZdS)�PgenGrammarN)�__name__�
__module__�__qualname__�r	r	�*/usr/lib64/python3.8/lib2to3/pgen2/pgen.pyrsrc@s�eZdZd&dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd'd d!�Zd"d#�Zd$d%�ZdS)(�ParserGeneratorNcCsld}|dkrt|�}|j}||_||_t�|j�|_|��|�	�\|_
|_|dk	rZ|�i|_|�
�dS�N)�open�close�filename�streamr�generate_tokens�readline�	generator�gettoken�parse�dfas�startsymbol�first�addfirstsets)�selfrrZclose_streamr	r	r
�__init__szParserGenerator.__init__c	Cst�}t|j���}|��|�|j�|�d|j�|D]&}dt|j	�}||j	|<||j
|<q:|D]�}|j|}g}|D]`}g}t|j�
��D]$\}	}
|�|�||	�|�|
�f�q�|jr�|�d|�|�f�|�|�q||j�|�||�||�f|j|j	|<qf|j	|j|_|S)N��)r�listr�keys�sort�remover�insert�len�
symbol2numberZ
number2symbol�sorted�arcs�items�append�
make_label�index�isfinal�states�
make_first�start)r�c�names�name�i�dfar,�stater&�label�nextr	r	r
�make_grammars.

zParserGenerator.make_grammarcCs4|j|}i}t|�D]}|�||�}d||<q|S�Nr)rr%r))rr/r1Zrawfirstrr5�ilabelr	r	r
r-4s

zParserGenerator.make_firstcCs&t|j�}|d��r�||jkrZ||jkr4|j|S|j�|j|df�||j|<|Sn>tt|d�}||jkrz|j|S|j�|df�||j|<|Sn�t	|�}|d��r�||j
kr�|j
|S|j�tj|f�||j
|<|Sn>tj
|}||jk�r|j|S|j�|df�||j|<|SdS�Nr)r#�labels�isalphar$Zsymbol2labelr(�getattrr�tokens�eval�keywords�NAMErZopmap)rr/r5r9Zitoken�valuer	r	r
r)=s6













zParserGenerator.make_labelcCs8t|j���}|��|D]}||jkr|�|�qdSr)rrrr r�	calcfirst)rr0r1r	r	r
rks

zParserGenerator.addfirstsetsc	Cs�|j|}d|j|<|d}i}i}|j��D]x\}}||jkr�||jkrj|j|}|dkr~td|��n|�|�|j|}|�|�|||<q.d||<|di||<q.i}	|��D]:\}}
|
D],}||	kr�td||||	|f��||	|<q�q�||j|<dS)Nrzrecursion for rule %rrzArule %s is ambiguous; %s is in the first sets of %s as well as %s)rrr&r'�
ValueErrorrC�update)rr1r3r4ZtotalsetZoverlapcheckr5r6�fsetZinverseZitsfirstZsymbolr	r	r
rCss4








�zParserGenerator.calcfirstc	Cs�i}d}|jtjkr�|jtjkr*|��q|�tj�}|�tjd�|��\}}|�tj�|�	||�}t
|�}|�|�t
|�}|||<|dkr|}q||fS)N�:)�typer�	ENDMARKER�NEWLINEr�expectrA�OP�	parse_rhs�make_dfar#�simplify_dfa)	rrrr1�a�zr3ZoldlenZnewlenr	r	r
r�s"

zParserGenerator.parsec	s��fdd�}�fdd��t||�|�g}|D]�}i}|jD].}|jD]"\}}	|dk	rD�|	|�|i��qDq:t|���D]@\}}
|D]}|j|
kr�q�q�t|
|�}|�|�|�||�qvq,|S)Ncsi}�||�|Srr	)r4�base��
addclosurer	r
�closure�s
z)ParserGenerator.make_dfa.<locals>.closurecs:||krdSd||<|jD]\}}|dkr�||�qdSr8�r&)r4rRr5r6rSr	r
rT�sz,ParserGenerator.make_dfa.<locals>.addclosure)�DFAState�nfasetr&�
setdefaultr%r'r(�addarc)rr.�finishrUr,r4r&Znfastater5r6rX�str	rSr
rN�s"



zParserGenerator.make_dfac
Cs�td|�|g}t|�D]|\}}td|||kr2dp4d�|jD]T\}}||krZ|�|�}	nt|�}	|�|�|dkr�td|	�q>td||	f�q>qdS)NzDump of NFA for�  State�(final)�z	    -> %d�    %s -> %d)�print�	enumerater&r*r#r()
rr1r.r[Ztodor2r4r5r6�jr	r	r
�dump_nfa�s

zParserGenerator.dump_nfacCsdtd|�t|�D]L\}}td||jr*dp,d�t|j���D]\}}td||�|�f�q>qdS)NzDump of DFA forr]r^r_r`)rarbr+r%r&r'r*)rr1r3r2r4r5r6r	r	r
�dump_dfa�s

zParserGenerator.dump_dfacCspd}|rld}t|�D]T\}}t|dt|��D]8}||}||kr.||=|D]}|�||�qLd}qq.qqdS)NTFr)rb�ranger#�
unifystate)rr3Zchangesr2Zstate_ircZstate_jr4r	r	r
rO�szParserGenerator.simplify_dfacCs~|��\}}|jdkr||fSt�}t�}|�|�|�|�|jdkrr|��|��\}}|�|�|�|�q>||fSdS)N�|)�	parse_altrB�NFAStaterZr)rrPrQZaaZzzr	r	r
rM�s




zParserGenerator.parse_rhscCsL|��\}}|jdks(|jtjtjfkrD|��\}}|�|�|}q||fS)N)�(�[)�
parse_itemrBrHrrA�STRINGrZ)rrP�br/�dr	r	r
ri
s
�
zParserGenerator.parse_altcCs�|jdkr>|��|��\}}|�tjd�|�|�||fS|��\}}|j}|dkr`||fS|��|�|�|dkr�||fS||fSdS)Nrl�])�+�*rr)rBrrMrKrrLrZ�
parse_atom)rrPrQrBr	r	r
rms


zParserGenerator.parse_itemcCs�|jdkr4|��|��\}}|�tjd�||fS|jtjtjfkrpt	�}t	�}|�
||j�|��||fS|�d|j|j�dS)Nrk�)z+expected (...) or NAME or STRING, got %s/%s)rBrrMrKrrLrHrArnrjrZ�raise_error)rrPrQr	r	r
rt(s
�zParserGenerator.parse_atomcCsD|j|ks|dk	r2|j|kr2|�d|||j|j�|j}|��|S)Nzexpected %s/%s, got %s/%s)rHrBrvr)rrHrBr	r	r
rK9s�zParserGenerator.expectcCsFt|j�}|dtjtjfkr*t|j�}q
|\|_|_|_|_|_	dSr:)
r6rr�COMMENT�NLrHrBZbegin�end�line)r�tupr	r	r
rAs
zParserGenerator.gettokenc
Gs^|r8z||}Wn&d�|gttt|���}YnXt||j|jd|jd|jf��dS)N� rr)�joinr�map�str�SyntaxErrorrryrz)r�msg�argsr	r	r
rvHs �zParserGenerator.raise_error)N)N)rrrrr7r-r)rrCrrNrdrerOrMrirmrtrKrrvr	r	r	r
r
s$
	.$

rc@seZdZdd�Zddd�ZdS)rjcCs
g|_dSrrV)rr	r	r
rSszNFAState.__init__NcCs|j�||f�dSr)r&r(�rr6r5r	r	r
rZVszNFAState.addarc)N)rrrrrZr	r	r	r
rjQsrjc@s0eZdZdd�Zdd�Zdd�Zdd�Zd	Zd	S)
rWcCs||_||k|_i|_dSr)rXr+r&)rrX�finalr	r	r
r]s
zDFAState.__init__cCs||j|<dSrrVr�r	r	r
rZeszDFAState.addarccCs*|j��D]\}}||kr
||j|<q
dSr)r&r')r�old�newr5r6r	r	r
rgkszDFAState.unifystatecCsV|j|jkrdSt|j�t|j�kr(dS|j��D]\}}||j�|�k	r2dSq2dS)NFT)r+r#r&r'�get)r�otherr5r6r	r	r
�__eq__pszDFAState.__eq__N)rrrrrZrgr��__hash__r	r	r	r
rW[s
rW�Grammar.txtcCst|�}|��Sr)rr7)r�pr	r	r
�generate_grammar�sr�N)r�)r_rrrZGrammarr�objectrrjrWr�r	r	r	r
�<module>sI
%lib2to3/pgen2/__pycache__/parse.cpython-38.opt-1.pyc000064400000014506151153537460015766 0ustar00U

e5d��@s4dZddlmZGdd�de�ZGdd�de�ZdS)z�Parser engine for the grammar tables generated by pgen.

The grammar table must be loaded first.

See Parser/parser.c in the Python distribution for additional info on
how this parsing engine works.

�)�tokenc@s eZdZdZdd�Zdd�ZdS)�
ParseErrorz(Exception to signal the parser is stuck.cCs4t�|d||||f�||_||_||_||_dS)Nz!%s: type=%r, value=%r, context=%r)�	Exception�__init__�msg�type�value�context)�selfrrrr	�r�+/usr/lib64/python3.8/lib2to3/pgen2/parse.pyrs
�zParseError.__init__cCst|�|j|j|j|jffS�N)rrrr	)r
rrr�
__reduce__szParseError.__reduce__N)�__name__�
__module__�__qualname__�__doc__rrrrrrrsrc@sLeZdZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�Parsera5Parser engine.

    The proper usage sequence is:

    p = Parser(grammar, [converter])  # create instance
    p.setup([start])                  # prepare for parsing
    <for each input token>:
        if p.addtoken(...):           # parse a token; may raise ParseError
            break
    root = p.rootnode                 # root of abstract syntax tree

    A Parser instance may be reused by calling setup() repeatedly.

    A Parser instance contains state pertaining to the current token
    sequence, and should not be used concurrently by different threads
    to parse separate token sequences.

    See driver.py for how to get input tokens by tokenizing a file or
    string.

    Parsing is complete when addtoken() returns True; the root of the
    abstract syntax tree can then be retrieved from the rootnode
    instance variable.  When a syntax error occurs, addtoken() raises
    the ParseError exception.  There is no error recovery; the parser
    cannot be used after a syntax error was reported (but it can be
    reinitialized by calling setup()).

    NcCs||_|pdd�|_dS)a�Constructor.

        The grammar argument is a grammar.Grammar instance; see the
        grammar module for more information.

        The parser is not ready yet for parsing; you must call the
        setup() method to get it started.

        The optional convert argument is a function mapping concrete
        syntax tree nodes to abstract syntax tree nodes.  If not
        given, no conversion is done and the syntax tree produced is
        the concrete syntax tree.  If given, it must be a function of
        two arguments, the first being the grammar (a grammar.Grammar
        instance), and the second being the concrete syntax tree node
        to be converted.  The syntax tree is converted from the bottom
        up.

        A concrete syntax tree node is a (type, value, context, nodes)
        tuple, where type is the node type (a token or symbol number),
        value is None for symbols and a string for tokens, context is
        None or an opaque value used for error reporting (typically a
        (lineno, offset) pair), and nodes is a list of children for
        symbols, and None for tokens.

        An abstract syntax tree node may be anything; this is entirely
        up to the converter function.

        cSs|Sr
r)�grammar�noderrr�<lambda>Z�z!Parser.__init__.<locals>.<lambda>N)r�convert)r
rrrrrr<szParser.__init__cCsH|dkr|jj}|ddgf}|jj|d|f}|g|_d|_t�|_dS)a�Prepare for parsing.

        This *must* be called before starting to parse.

        The optional argument is an alternative start symbol; it
        defaults to the grammar's start symbol.

        You can use a Parser instance to parse any number of programs;
        each time you call setup() the parser is reset to an initial
        state determined by the (implicit or explicit) start symbol.

        N�)r�start�dfas�stack�rootnode�set�
used_names)r
r�newnodeZ
stackentryrrr�setup\s
zParser.setupcCs0|�|||�}|jd\}}}|\}}	||}
|
D]�\}}|jj|\}
}||kr�|�||||�|}||d|fgkr�|��|js�dS|jd\}}}|\}}	qfdS|
dkr2|jj|
}|\}}||kr2|�|
|jj|
||�qq2d|f|
k�r|��|j�s*td|||��qtd|||��qdS)	z<Add a token; return True iff this is the end of the program.���rTF�ztoo much inputz	bad inputN)	�classifyrr�labels�shift�popr�pushr)r
rrr	�ilabel�dfa�staterZstates�firstZarcs�i�newstate�t�vZitsdfaZ	itsstatesZitsfirstrrr�addtokents>
�zParser.addtokencCsX|tjkr0|j�|�|jj�|�}|dk	r0|S|jj�|�}|dkrTtd|||��|S)z&Turn a token into a label.  (Internal)Nz	bad token)	r�NAMEr�addr�keywords�get�tokensr)r
rrr	r)rrrr$�s
zParser.classifyc	CsT|jd\}}}|||df}|�|j|�}|dk	r@|d�|�|||f|jd<dS)zShift a token.  (Internal)r"N)rrr�append)	r
rrr.r	r*r+rr rrrr&�szParser.shiftc	CsB|jd\}}}|d|gf}|||f|jd<|j�|d|f�dS)zPush a nonterminal.  (Internal)r"Nr)rr7)	r
rZnewdfar.r	r*r+rr rrrr(�szParser.pushcCs`|j��\}}}|�|j|�}|dk	r\|jrL|jd\}}}|d�|�n||_|j|j_dS)zPop a nonterminal.  (Internal)Nr")rr'rrr7rr)r
ZpopdfaZpopstateZpopnoder r*r+rrrrr'�sz
Parser.pop)N)N)rrrrrr!r1r$r&r(r'rrrrrs
 
0	rN)r�rrr�objectrrrrr�<module>s
lib2to3/pgen2/__pycache__/parse.cpython-38.pyc000064400000014544151153537460015031 0ustar00U

e5d��@s4dZddlmZGdd�de�ZGdd�de�ZdS)z�Parser engine for the grammar tables generated by pgen.

The grammar table must be loaded first.

See Parser/parser.c in the Python distribution for additional info on
how this parsing engine works.

�)�tokenc@s eZdZdZdd�Zdd�ZdS)�
ParseErrorz(Exception to signal the parser is stuck.cCs4t�|d||||f�||_||_||_||_dS)Nz!%s: type=%r, value=%r, context=%r)�	Exception�__init__�msg�type�value�context)�selfrrrr	�r�+/usr/lib64/python3.8/lib2to3/pgen2/parse.pyrs
�zParseError.__init__cCst|�|j|j|j|jffS�N)rrrr	)r
rrr�
__reduce__szParseError.__reduce__N)�__name__�
__module__�__qualname__�__doc__rrrrrrrsrc@sLeZdZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�Parsera5Parser engine.

    The proper usage sequence is:

    p = Parser(grammar, [converter])  # create instance
    p.setup([start])                  # prepare for parsing
    <for each input token>:
        if p.addtoken(...):           # parse a token; may raise ParseError
            break
    root = p.rootnode                 # root of abstract syntax tree

    A Parser instance may be reused by calling setup() repeatedly.

    A Parser instance contains state pertaining to the current token
    sequence, and should not be used concurrently by different threads
    to parse separate token sequences.

    See driver.py for how to get input tokens by tokenizing a file or
    string.

    Parsing is complete when addtoken() returns True; the root of the
    abstract syntax tree can then be retrieved from the rootnode
    instance variable.  When a syntax error occurs, addtoken() raises
    the ParseError exception.  There is no error recovery; the parser
    cannot be used after a syntax error was reported (but it can be
    reinitialized by calling setup()).

    NcCs||_|pdd�|_dS)a�Constructor.

        The grammar argument is a grammar.Grammar instance; see the
        grammar module for more information.

        The parser is not ready yet for parsing; you must call the
        setup() method to get it started.

        The optional convert argument is a function mapping concrete
        syntax tree nodes to abstract syntax tree nodes.  If not
        given, no conversion is done and the syntax tree produced is
        the concrete syntax tree.  If given, it must be a function of
        two arguments, the first being the grammar (a grammar.Grammar
        instance), and the second being the concrete syntax tree node
        to be converted.  The syntax tree is converted from the bottom
        up.

        A concrete syntax tree node is a (type, value, context, nodes)
        tuple, where type is the node type (a token or symbol number),
        value is None for symbols and a string for tokens, context is
        None or an opaque value used for error reporting (typically a
        (lineno, offset) pair), and nodes is a list of children for
        symbols, and None for tokens.

        An abstract syntax tree node may be anything; this is entirely
        up to the converter function.

        cSs|Sr
r)�grammar�noderrr�<lambda>Z�z!Parser.__init__.<locals>.<lambda>N)r�convert)r
rrrrrr<szParser.__init__cCsH|dkr|jj}|ddgf}|jj|d|f}|g|_d|_t�|_dS)a�Prepare for parsing.

        This *must* be called before starting to parse.

        The optional argument is an alternative start symbol; it
        defaults to the grammar's start symbol.

        You can use a Parser instance to parse any number of programs;
        each time you call setup() the parser is reset to an initial
        state determined by the (implicit or explicit) start symbol.

        N�)r�start�dfas�stack�rootnode�set�
used_names)r
r�newnodeZ
stackentryrrr�setup\s
zParser.setupcCs<|�|||�}|jd\}}}|\}}	||}
|
D]�\}}|jj|\}
}||kr�|
dks^t�|�||||�|}||d|fgkr�|��|js�dS|jd\}}}|\}}	qrdS|
dkr2|jj|
}|\}}||kr2|�|
|jj|
||�qq2d|f|
k�r(|��|j�s6t	d|||��qt	d|||��qdS)	z<Add a token; return True iff this is the end of the program.����rTFztoo much inputz	bad inputN)
�classifyrr�labels�AssertionError�shift�popr�pushr)r
rrr	�ilabel�dfa�staterZstates�firstZarcs�i�newstate�t�vZitsdfaZ	itsstatesZitsfirstrrr�addtokents@
�zParser.addtokencCsX|tjkr0|j�|�|jj�|�}|dk	r0|S|jj�|�}|dkrTtd|||��|S)z&Turn a token into a label.  (Internal)Nz	bad token)	r�NAMEr�addr�keywords�get�tokensr)r
rrr	r*rrrr$�s
zParser.classifyc	CsT|jd\}}}|||df}|�|j|�}|dk	r@|d�|�|||f|jd<dS)zShift a token.  (Internal)r"N)rrr�append)	r
rrr/r	r+r,rr rrrr'�szParser.shiftc	CsB|jd\}}}|d|gf}|||f|jd<|j�|d|f�dS)zPush a nonterminal.  (Internal)r"Nr)rr8)	r
rZnewdfar/r	r+r,rr rrrr)�szParser.pushcCs`|j��\}}}|�|j|�}|dk	r\|jrL|jd\}}}|d�|�n||_|j|j_dS)zPop a nonterminal.  (Internal)Nr")rr(rrr8rr)r
ZpopdfaZpopstateZpopnoder r+r,rrrrr(�sz
Parser.pop)N)N)rrrrrr!r2r$r'r)r(rrrrrs
 
0	rN)r�rrr�objectrrrrr�<module>s
lib2to3/pgen2/__pycache__/token.cpython-38.opt-1.pyc000064400000003541151153537460015771 0ustar00U

e5d�@sPdZdZdZdZdZdZdZdZdZd	Z	d
Z
dZdZd
Z
dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZd Z d!Z!d"Z"d#Z#d$Z$d%Z%d&Z&d'Z'd(Z(d)Z)d*Z*d+Z+d,Z,d-Z-d.Z.d/Z/d0Z0d1Z1d2Z2d3Z3d4Z4d5Z5d6Z6d7Z7d8Z8d9Z9d:Z:d;Z;d<Z<d=Z=d>Z>iZ?e@eA��B��D]$\ZCZDeEeD�eEd�k�reCe?eD<�qd?d@�ZFdAdB�ZGdCdD�ZHdES)Fz!Token constants (from "token.h").����������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�cCs|tkS�N��	NT_OFFSET��x�rD�+/usr/lib64/python3.8/lib2to3/pgen2/token.py�
ISTERMINALOsrFcCs|tkSr?r@rBrDrDrE�
ISNONTERMINALRsrGcCs|tkSr?)�	ENDMARKERrBrDrDrE�ISEOFUsrIN)I�__doc__rH�NAME�NUMBER�STRING�NEWLINE�INDENT�DEDENT�LPAR�RPAR�LSQB�RSQB�COLON�COMMA�SEMI�PLUS�MINUS�STAR�SLASH�VBAR�AMPER�LESS�GREATER�EQUAL�DOT�PERCENTZ	BACKQUOTE�LBRACE�RBRACE�EQEQUAL�NOTEQUAL�	LESSEQUAL�GREATEREQUAL�TILDE�
CIRCUMFLEX�	LEFTSHIFT�
RIGHTSHIFT�
DOUBLESTAR�	PLUSEQUAL�MINEQUAL�	STAREQUAL�
SLASHEQUAL�PERCENTEQUAL�
AMPEREQUAL�	VBAREQUAL�CIRCUMFLEXEQUAL�LEFTSHIFTEQUAL�RIGHTSHIFTEQUAL�DOUBLESTAREQUAL�DOUBLESLASH�DOUBLESLASHEQUAL�AT�ATEQUAL�OP�COMMENT�NL�RARROW�AWAIT�ASYNC�
ERRORTOKEN�
COLONEQUAL�N_TOKENSrA�tok_name�list�globals�items�_nameZ_value�typerFrGrIrDrDrDrE�<module>s�lib2to3/pgen2/__pycache__/driver.cpython-38.opt-2.pyc000064400000010003151153537460016134 0ustar00U

e5dQ�@s�dZddgZddlZddlZddlZddlZddlZddlmZm	Z	m
Z
mZmZGdd�de
�Zdd	�Zdd
d�Zdd�Zdd�Zdd�Zedkr�e�ee���dS)z#Guido van Rossum <guido@python.org>�Driver�load_grammar�N�)�grammar�parse�token�tokenize�pgenc@sHeZdZddd�Zddd�Zddd�Zdd	d
�Zddd�Zdd
d�ZdS)rNcCs&||_|dkrt��}||_||_dS�N)r�logging�	getLogger�logger�convert)�selfrrr
�r�,/usr/lib64/python3.8/lib2to3/pgen2/driver.py�__init__s
zDriver.__init__FcCstt�|j|j�}|��d}d}d}}}}	}
d}|D�]}|\}}}}	}
|||fkr�|\}
}||
kr�|d|
|7}|
}d}||kr�||
||�7}|}|tjtjfkr�||7}|	\}}|�d�r<|d7}d}q<|t	j
kr�tj|}|�r
|j�
dt	j|||�|�||||f��r6|�r0|j�
d��qnd}|	\}}|�d�r<|d7}d}q<t�d||||f��|jS)Nrr��
z%s %r (prefix=%r)zStop.zincomplete input)rZParserrrZsetupr�COMMENT�NL�endswithr�OPZopmapr
�debug�tok_nameZaddtokenZ
ParseErrorZrootnode)r�tokensr�p�lineno�column�type�value�start�endZ	line_text�prefixZ	quintupleZs_linenoZs_columnrrr�parse_tokens&s^



�
�zDriver.parse_tokenscCst�|j�}|�||�Sr
)r�generate_tokens�readliner$)r�streamrrrrr�parse_stream_rawVszDriver.parse_stream_rawcCs|�||�Sr
)r()rr'rrrr�parse_stream[szDriver.parse_streamc
Cs4tj|d|d��}|�||�W5QR�SQRXdS)N�r)�encoding)�io�openr))r�filenamer+rr'rrr�
parse_file_szDriver.parse_filecCst�t�|�j�}|�||�Sr
)rr%r,�StringIOr&r$)r�textrrrrr�parse_stringdszDriver.parse_string)NN)F)F)F)NF)F)	�__name__�
__module__�__qualname__rr$r(r)r/r2rrrrrs

0


cCs:tj�|�\}}|dkrd}||d�tttj��dS)Nz.txtr�.z.pickle)�os�path�splitext�join�map�str�sys�version_info)�gt�head�tailrrr�_generate_pickle_namejsrB�Grammar.txtTFc
Cs�|dkrt��}|dkr t|�n|}|s2t||�s�|�d|�t�|�}|r�|�d|�z|�|�Wq�tk
r�}z|�d|�W5d}~XYq�Xnt	�
�}|�|�|S)Nz!Generating grammar tables from %szWriting grammar tables to %szWriting failed: %s)rrrB�_newer�infor	Zgenerate_grammar�dump�OSErrorr�Grammar�load)r?Zgp�save�forcer
�g�errrrqs
 
cCs8tj�|�sdStj�|�s dStj�|�tj�|�kS)NFT)r7r8�exists�getmtime)�a�brrrrD�s
rDcCsFtj�|�rt|�Sttj�|��}t�||�}t�	�}|�
|�|Sr
)r7r8�isfilerrB�basename�pkgutil�get_datarrH�loads)�packageZgrammar_sourceZpickled_name�datarLrrr�load_packaged_grammar�s
rYcGsB|stjdd�}tjtjtjdd�|D]}t|ddd�q*dS)Nrz%(message)s)�levelr'�formatT)rJrK)r=�argvrZbasicConfig�INFO�stdoutr)�argsr?rrr�main�s�r`�__main__)rCNTFN)�
__author__�__all__r,r7rrTr=rrrrrr	�objectrrBrrDrYr`r3�exit�intrrrr�<module>s&M�
	
lib2to3/pgen2/__pycache__/token.cpython-38.opt-2.pyc000064400000003457151153537460016000 0ustar00U

e5d�@sLdZdZdZdZdZdZdZdZdZd	Z	d
Z
dZdZd
Z
dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZd Z d!Z!d"Z"d#Z#d$Z$d%Z%d&Z&d'Z'd(Z(d)Z)d*Z*d+Z+d,Z,d-Z-d.Z.d/Z/d0Z0d1Z1d2Z2d3Z3d4Z4d5Z5d6Z6d7Z7d8Z8d9Z9d:Z:d;Z;d<Z<d=Z=iZ>e?e@��A��D]$\ZBZCeDeC�eDd�k�r
eBe>eC<�q
d>d?�ZEd@dA�ZFdBdC�ZGdDS)E����������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�cCs|tkS�N��	NT_OFFSET��x�rD�+/usr/lib64/python3.8/lib2to3/pgen2/token.py�
ISTERMINALOsrFcCs|tkSr?r@rBrDrDrE�
ISNONTERMINALRsrGcCs|tkSr?)�	ENDMARKERrBrDrDrE�ISEOFUsrIN)HrH�NAME�NUMBER�STRING�NEWLINE�INDENT�DEDENT�LPAR�RPAR�LSQB�RSQB�COLON�COMMA�SEMI�PLUS�MINUS�STAR�SLASH�VBAR�AMPER�LESS�GREATER�EQUAL�DOT�PERCENTZ	BACKQUOTE�LBRACE�RBRACE�EQEQUAL�NOTEQUAL�	LESSEQUAL�GREATEREQUAL�TILDE�
CIRCUMFLEX�	LEFTSHIFT�
RIGHTSHIFT�
DOUBLESTAR�	PLUSEQUAL�MINEQUAL�	STAREQUAL�
SLASHEQUAL�PERCENTEQUAL�
AMPEREQUAL�	VBAREQUAL�CIRCUMFLEXEQUAL�LEFTSHIFTEQUAL�RIGHTSHIFTEQUAL�DOUBLESTAREQUAL�DOUBLESLASH�DOUBLESLASHEQUAL�AT�ATEQUAL�OP�COMMENT�NL�RARROW�AWAIT�ASYNC�
ERRORTOKEN�
COLONEQUAL�N_TOKENSrA�tok_name�list�globals�items�_nameZ_value�typerFrGrIrDrDrDrE�<module>	s�lib2to3/pgen2/__pycache__/tokenize.cpython-38.opt-1.pyc000064400000035544151153537460016511 0ustar00U

e5d?R�
@s�dZdZdZddlZddlZddlmZmZddlTddl	m
Z
d	d
�ee
�D�ddd
gZ[
ze
Wnek
r~eZ
YnXdd�Zdd�Zdd�Zdd�ZdZdZeede�ee�ZdZdZdZdZedd�Zeeeee�ZdZed d!�ee�Zd"eZeee�Z ed#e d$�Z!ee!e e�Z"d%Z#d&Z$d'Z%d(Z&d)Z'ee'd*e'd+�Z(ee'd,e'd-�Z)ed.d/d0d1d2d3d4d5d6�	Z*d7Z+ed8d9d:�Z,ee*e+e,�Z-ee"e-e)e�Z.ee.Z/ee'd;ed<d�e'd=ed>d��Z0edee(�Z1eee1e"e-e0e�Z2e3ej4e/e2e%e&f�\Z5Z6Z7Z8ed?d@dAdB�ed?d@dCdD�BdEdFdGdHdIdJhBZ9e�4e#�e�4e$�e7e8dK�dLdM�e9D�dNdM�e9D�dOdM�e9D��Z:d*d+hdPdQ�e9D�BdRdQ�e9D�BZ;d<d>hdSdQ�e9D�BdTdQ�e9D�BZ<dUZ=GdVdW�dWe>�Z?GdXdY�dYe>�Z@dZd[�ZAeAfd\d�ZBd]d^�ZCGd_d`�d`�ZDe�4daejE�ZFe�4dbejE�ZGdcdd�ZHdedf�ZIdgd
�ZJdhd�ZKeLdik�r�ddlMZMeNeMjO�dk�r�eBePeMjOd�jQ�neBeMjRjQ�dS)ja�Tokenization help for Python programs.

generate_tokens(readline) is a generator that breaks a stream of
text into Python tokens.  It accepts a readline-like method which is called
repeatedly to get the next line of input (or "" for EOF).  It generates
5-tuples with these members:

    the token type (see token.py)
    the token (a string)
    the starting (row, column) indices of the token (a 2-tuple of ints)
    the ending (row, column) indices of the token (a 2-tuple of ints)
    the original line (string)

It is designed to match the working of the Python tokenizer exactly, except
that it produces COMMENT tokens for comments and gives type OP for all
operators

Older entry points
    tokenize_loop(readline, tokeneater)
    tokenize(readline, tokeneater=printtoken)
are the same, except instead of generating tokens, tokeneater is a callback
function to which the 5 fields described above are passed as 5 arguments,
each time a new token is found.zKa-Ping Yee <ping@lfw.org>z@GvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, Skip Montanaro�N)�BOM_UTF8�lookup)�*�)�tokencCsg|]}|ddkr|�qS)r�_�)�.0�xrr�./usr/lib64/python3.8/lib2to3/pgen2/tokenize.py�
<listcomp>%sr�tokenize�generate_tokens�
untokenizecGsdd�|�dS)N�(�|�))�join��choicesrrr�group0�rcGst|�dS)Nr�rrrrr�any1rrcGst|�dS)N�?rrrrr�maybe2rrcst�fdd��D��S)Nc3s4|],}�dD]}|��|��kr||VqqdS))�N)�casefold)r	r
�y��lrr�	<genexpr>4s

z _combinations.<locals>.<genexpr>)�setrrrr�
_combinations3s�r#z[ \f\t]*z	#[^\r\n]*z\\\r?\nz\w+z0[bB]_?[01]+(?:_[01]+)*z(0[xX]_?[\da-fA-F]+(?:_[\da-fA-F]+)*[lL]?z0[oO]?_?[0-7]+(?:_[0-7]+)*[lL]?z[1-9]\d*(?:_\d+)*[lL]?z0[lL]?z[eE][-+]?\d+(?:_\d+)*z\d+(?:_\d+)*\.(?:\d+(?:_\d+)*)?z\.\d+(?:_\d+)*z\d+(?:_\d+)*z\d+(?:_\d+)*[jJ]z[jJ]z[^'\\]*(?:\\.[^'\\]*)*'z[^"\\]*(?:\\.[^"\\]*)*"z%[^'\\]*(?:(?:\\.|'(?!''))[^'\\]*)*'''z%[^"\\]*(?:(?:\\.|"(?!""))[^"\\]*)*"""z'(?:[uUrRbBfF]|[rR][fFbB]|[fFbBuU][rR])?�'''�"""z'[^\n'\\]*(?:\\.[^\n'\\]*)*'z"[^\n"\\]*(?:\\.[^\n"\\]*)*"z\*\*=?z>>=?z<<=?z<>z!=z//=?z->z[+\-*/%&@|^=<>]=?�~z[][(){}]z\r?\nz:=z[:;.,`@]z'[^\n'\\]*(?:\\.[^\n'\\]*)*�'z"[^\n"\\]*(?:\\.[^\n"\\]*)*�"�r�R�f�F�b�B�u�UZurZuRZUrZUR)r'r(r$r%cCsi|]}|�d�t�qS�r$)�single3prog�r	�prefixrrr�
<dictcomp>ysr5cCsi|]}|�d�t�qS�r%)�double3progr3rrrr5zscCsi|]
}|d�qS�Nrr3rrrr5{scCsh|]}|�d��qSr1rr3rrr�	<setcomp>sr9cCsh|]}|�d��qSr6rr3rrrr9�scCsh|]}|�d��qS)r'rr3rrrr9�scCsh|]}|�d��qS)r(rr3rrrr9�s�c@seZdZdS)�
TokenErrorN��__name__�
__module__�__qualname__rrrrr;�sr;c@seZdZdS)�StopTokenizingNr<rrrrr@�sr@c		Cs4|\}}|\}}td||||t|t|�f�dS)Nz%d,%d-%d,%d:	%s	%s)�print�tok_name�repr)	�typerZxxx_todo_changemeZxxx_todo_changeme1�lineZsrowZscolZerowZecolrrr�
printtoken�s
�rFcCs(zt||�Wntk
r"YnXdS)a:
    The tokenize() function accepts two parameters: one representing the
    input stream, and one providing an output mechanism for tokenize().

    The first parameter, readline, must be a callable object which provides
    the same interface as the readline() method of built-in file objects.
    Each call to the function should return one line of input as a string.

    The second parameter, tokeneater, must also be a callable object. It is
    called once for each token, with five arguments, corresponding to the
    tuples generated by generate_tokens().
    N)�
tokenize_loopr@)�readline�
tokeneaterrrrr
�s
cCst|�D]}||�qdSr8)r)rHrIZ
token_inforrrrG�srGc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�UntokenizercCsg|_d|_d|_dS)Nrr)�tokens�prev_row�prev_col)�selfrrr�__init__�szUntokenizer.__init__cCs*|\}}||j}|r&|j�d|�dS)N� )rMrK�append)rN�start�row�col�
col_offsetrrr�add_whitespace�s
zUntokenizer.add_whitespacecCs�|D]p}t|�dkr$|�||�qv|\}}}}}|�|�|j�|�|\|_|_|ttfkr|jd7_d|_qd�	|j�S)N�rrr)
�len�compatrVrKrQrLrM�NEWLINE�NLr)rN�iterable�t�tok_typerrR�endrErrrr�s
zUntokenizer.untokenizec	Cs�d}g}|jj}|\}}|ttfkr,|d7}|ttfkr<d}|D]�}|dd�\}}|ttttfkrl|d7}|tkr�|�|�q@n>|t	kr�|�
�q@n*|ttfkr�d}n|r�|r�||d�d}||�q@dS)NFrPTrW���)rKrQ�NAME�NUMBERrZr[�ASYNC�AWAIT�INDENT�DEDENT�pop)	rNrr\�	startline�indents�toks_append�toknum�tokval�tokrrrrY�s0
zUntokenizer.compatN)r=r>r?rOrVrrYrrrrrJ�srJz&^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)s^[ \t\f]*(?:[#\r\n]|$)cCsH|dd����dd�}|dks*|�d�r.dS|dks@|�d�rDd	S|S)
z(Imitates get_normal_name in tokenizer.c.N�r�-�utf-8zutf-8-)zlatin-1�
iso-8859-1ziso-latin-1)zlatin-1-ziso-8859-1-ziso-latin-1-rq)�lower�replace�
startswith)�orig_enc�encrrr�_get_normal_name�s�rwcs�d�d}d}�fdd�}�fdd�}|�}|�t�rHd�|d	d�}d
}|sT|gfS||�}|rj||gfSt�|�s~||gfS|�}|s�||gfS||�}|r�|||gfS|||gfS)a
    The detect_encoding() function is used to detect the encoding that should
    be used to decode a Python source file. It requires one argument, readline,
    in the same way as the tokenize() generator.

    It will call readline a maximum of twice, and return the encoding used
    (as a string) and a list of any lines (left as bytes) it has read
    in.

    It detects the encoding from the presence of a utf-8 bom or an encoding
    cookie as specified in pep-0263. If both a bom and a cookie are present, but
    disagree, a SyntaxError will be raised. If the encoding cookie is an invalid
    charset, raise a SyntaxError.  Note that if a utf-8 bom is found,
    'utf-8-sig' is returned.

    If no encoding is specified, then the default of 'utf-8' will be returned.
    FNrpcs(z��WStk
r"t�YSXdSr8)�
StopIteration�bytesr)rHrr�read_or_stopsz%detect_encoding.<locals>.read_or_stopcs�z|�d�}Wntk
r$YdSXt�|�}|s8dSt|�d��}zt|�}Wn tk
rrtd|��YnX�r�|j	dkr�td��|d7}|S)N�asciirzunknown encoding: rpzencoding problem: utf-8z-sig)
�decode�UnicodeDecodeError�	cookie_re�matchrwrr�LookupError�SyntaxError�name)rE�line_stringr�encoding�codec)�	bom_foundrr�find_cookies"

z$detect_encoding.<locals>.find_cookieT�z	utf-8-sig)rtr�blank_rer)rHr��defaultrzr��first�secondr)r�rHr�detect_encoding�s0




r�cCst�}|�|�S)a�Transform tokens back into Python source code.

    Each element returned by the iterable must be a token sequence
    with at least two elements, a token number and token value.  If
    only two tokens are passed, the resulting output is poor.

    Round-trip invariant for full input:
        Untokenized source will match input source exactly

    Round-trip invariant for limited input:
        # Output text will tokenize the back to the input
        t1 = [tok[:2] for tok in generate_tokens(f.readline)]
        newcode = untokenize(t1)
        readline = iter(newcode.splitlines(1)).next
        t2 = [tok[:2] for tokin generate_tokens(readline)]
        assert t1 == t2
    )rJr)r\�utrrrr:sccstd}}}d\}}d}dg}d}d}	d}
d}z
|�}Wntk
rPd}YnX|d}dt|�}
}|�r2|s|td|��|�|�}|r�|�d�}
}t||d|�|||f||fVd\}}d}nd|�r|dd�d	k�r|d
d�dk�rt||||t|�f|fVd}d}q.n||}||}q.�nB|dk�r\|�s\|�sL�qd}|
|k�r�||
dk�rr|d}n8||
d
k�r�|tdt}n||
dk�r�d}n�q�|
d}
�qP|
|k�rĐq|�r�|Vd}||
dk�r�||
dk�rT||
d��d�}|
t|�}t	|||
f||
t|�f|fVt
||d�||f|t|�f|fVq.t
t	f||
dk||
d�||
f|t|�f|fVq.||dk�r�|�|�t|d|
�|df||
f|fV||dk�r4||k�r�t
dd||
|f��|dd�}|	�r|
|dk�rd}	d}d}
td||
f||
f|fV�q�|	�rt|�rt|
|dk�rtd}	d}d}
n|�sptd|df��d}|
|kr.t�||
�}|�r�|�d�\}}||f||f|}}}
|||�||}}|tjk�s�|dk�r�|dk�r�t||||fV�q|dk�rJt}|dk�rt
}n
|	�r&d}|�r6|Vd}|||||fV�q|dk�rx|�rd|Vd}t	||||fV�q|tk�r�t|}|�||
�}|�r�|�d�}
|||
�}|�r�|Vd}t||||
f|fVn||f}||d�}|}q.�q|tk�s$|dd�tk�s$|dd�tk�r�|ddk�rx||f}t|�p\t|d�p\t|d}||d�d}}|}q.n |�r�|Vd}t||||fV�q|���rr|dk�r�|	�r�|dk�r�tnt||||fV�qtt||||f}|dk�r�|�s�|}�qt|dk�rZ|�rZ|dtk�rZ|ddk�rZd}	|d}
t|d|d|d|dfVd}|�rj|Vd}|Vnz|dk�r�|�r�|Vd}t
||||
f|fVd}nF|d k�r�|d}n|d!k�r�|d}|�r�|Vd}t||||fVn(t||
||
f||
df|fV|
d}
�qtq.|�r,|Vd}|dd�D]}td|df|dfdfV�q8td|df|dfdfVdS)"a4
    The generate_tokens() generator requires one argument, readline, which
    must be a callable object which provides the same interface as the
    readline() method of built-in file objects. Each call to the function
    should return one line of input as a string.  Alternately, readline
    can be a callable function terminating with StopIteration:
        readline = open(myfile).next    # Example of alternate readline

    The generator produces 5-tuples with these members: the token type; the
    token string; a 2-tuple (srow, scol) of ints specifying the row and
    column where the token begins in the source; a 2-tuple (erow, ecol) of
    ints specifying the row and column where the token ends in the source;
    and the line on which the token was found. The line passed is the
    physical line.
    r)rrNFrrzEOF in multi-line string���z\
���z\
rP�	�z#
�#z
r`z3unindent does not match any outer indentation levelz
<tokenize>zEOF in multi-line statement�.TrWr��
)�async�awaitr��def��\z([{z)]})rxrXr;rr_�STRING�
ERRORTOKEN�tabsize�rstrip�COMMENTr[rQre�IndentationErrorrf�
pseudoprog�span�stringZdigitsrbrZ�
triple_quoted�endprogs�
single_quoted�isidentifierrcrdra�OP�	ENDMARKER)rH�lnum�parenlev�	continued�contstr�needcont�contlineriZstashedZ	async_defZasync_def_indentZasync_def_nlrE�pos�max�strstart�endprog�endmatchr_�column�
comment_tokenZnl_pos�pseudomatchrR�spos�eposr�initial�newlinerm�indentrrrrOs�



�*
�


�
�
�
 

���





��
�

�

�
��




��__main__)S�__doc__�
__author__�__credits__r��re�codecsrrZlib2to3.pgen2.tokenrr�dir�__all__ry�	NameError�strrrrr#�
Whitespace�Comment�Ignore�Name�	Binnumber�	Hexnumber�	Octnumber�	Decnumber�	Intnumber�Exponent�
Pointfloat�Expfloat�Floatnumber�
Imagnumber�Number�Single�Double�Single3�Double3Z
_litprefix�Triple�StringZOperatorZBracket�Special�Funny�
PlainToken�Token�ContStr�PseudoExtras�PseudoToken�map�compileZ	tokenprogr�r2r7Z_strprefixesr�r�r�r��	Exceptionr;r@rFr
rGrJ�ASCIIr~r�rwr�rrr=�sysrX�argv�openrH�stdinrrrr�<module>s���


�����
������������8Ib
lib2to3/pgen2/__pycache__/conv.cpython-38.pyc000064400000015556151153537460014670 0ustar00U

e5d�%�@s2dZddlZddlmZmZGdd�dej�ZdS)a�Convert graminit.[ch] spit out by pgen to Python code.

Pgen is the Python parser generator.  It is useful to quickly create a
parser from a grammar file in Python's grammar notation.  But I don't
want my parsers to be written in C (yet), so I'm translating the
parsing tables to Python data structures and writing a Python parse
engine.

Note that the token numbers are constants determined by the standard
Python tokenizer.  The standard token module defines these numbers and
their names (the names are not used much).  The token numbers are
hardcoded into the Python tokenizer and into pgen.  A Python
implementation of the Python tokenizer is also available, in the
standard tokenize module.

On the other hand, symbol numbers (representing the grammar's
non-terminals) are assigned by pgen based on the actual grammar
input.

Note: this module is pretty much obsolete; the pgen module generates
equivalent grammar tables directly from the Grammar.txt input file
without having to invoke the Python pgen C program.

�N)�grammar�tokenc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�	Convertera2Grammar subclass that reads classic pgen output files.

    The run() method reads the tables as produced by the pgen parser
    generator, typically contained in two C files, graminit.h and
    graminit.c.  The other methods are for internal use only.

    See the base class for more documentation.

    cCs |�|�|�|�|��dS)z<Load the grammar tables from the text files written by pgen.N)�parse_graminit_h�parse_graminit_c�
finish_off)�selfZ
graminit_hZ
graminit_c�r	�*/usr/lib64/python3.8/lib2to3/pgen2/conv.py�run/s

z
Converter.runc	
Cs�zt|�}Wn8tk
rD}ztd||f�WY�dSd}~XYnXi|_i|_d}|D]�}|d7}t�d|�}|s�|��r�td|||��f�qZ|��\}}t	|�}||jks�t
�||jks�t
�||j|<||j|<qZdS)	z�Parse the .h file written by pgen.  (Internal)

        This file is a sequence of #define statements defining the
        nonterminals of the grammar as numbers.  We build two tables
        mapping the numbers to names and back.

        �Can't open %s: %sFNr�z^#define\s+(\w+)\s+(\d+)$z%s(%s): can't parse %sT)�open�OSError�print�
symbol2number�
number2symbol�re�match�strip�groups�int�AssertionError)	r�filename�f�err�lineno�line�mo�symbol�numberr	r	r
r5s,�

zConverter.parse_graminit_hc!
CsTzt|�}Wn8tk
rD}ztd||f�WY�dSd}~XYnXd}|dt|�}}|dkspt||f��|dt|�}}|dks�t||f��|dt|�}}i}g}|�d��r�|�d��r�t�d	|�}|s�t||f��tt	t
|����\}	}
}g}t|�D]Z}
|dt|�}}t�d
|�}|�s<t||f��tt	t
|����\}}|�
||f��q|dt|�}}|dk�s�t||f��|||	|
f<|dt|�}}q�t�d|�}|�s�t||f��tt	t
|����\}}|t|�k�s�t||f��g}t|�D]~}
|dt|�}}t�d
|�}|�s:t||f��tt	t
|����\}}	}
||	|
f}|t|�k�sxt||f��|�
|��q|�
|�|dt|�}}|dk�s�t||f��|dt|�}}q�||_i}t�d|�}|�s�t||f��t
|�d��}t|�D�]j}|dt|�}}t�d|�}|�s@t||f��|�d�}tt	t
|�dddd���\}}}}|j||k�s�t||f��|j||k�s�t||f��|dk�s�t||f��||}|t|�k�s�t||f��|dt|�}}t�d|�}|�st||f��i}t|�d��}t|�D]@\}}t|�}td�D]$}|d|>@�r>d||d|<�q>�q&||f||<�q
|dt|�}}|dk�s�t||f��||_g}|dt|�}}t�d|�}|�s�t||f��t
|�d��}t|�D]p}|dt|�}}t�d|�}|�s$t||f��|��\}}t
|�}|dk�rHd}nt|�}|�
||f��q�|dt|�}}|dk�s�t||f��||_|dt|�}}|dk�s�t||f��|dt|�}}t�d|�}|�s�t||f��t
|�d��}|t|j�k�s
t�|dt|�}}|dk�s2t||f��|dt|�}}t�d|�}|�sbt||f��t
|�d��}|t|j�k�s�t||f��|dt|�}}t�d|�}|�s�t||f��t
|�d��} | |jk�s�t||f��| |_|dt|�}}|dk�st||f��z|dt|�}}Wntk
�r<YnXd�sPt||f��dS)a�Parse the .c file written by pgen.  (Internal)

        The file looks as follows.  The first two lines are always this:

        #include "pgenheaders.h"
        #include "grammar.h"

        After that come four blocks:

        1) one or more state definitions
        2) a table defining dfas
        3) a table defining labels
        4) a struct defining the grammar

        A state definition has the following form:
        - one or more arc arrays, each of the form:
          static arc arcs_<n>_<m>[<k>] = {
                  {<i>, <j>},
                  ...
          };
        - followed by a state array, of the form:
          static state states_<s>[<t>] = {
                  {<k>, arcs_<n>_<m>},
                  ...
          };

        rFNrr
z#include "pgenheaders.h"
z#include "grammar.h"
zstatic arc z)static arc arcs_(\d+)_(\d+)\[(\d+)\] = {$z\s+{(\d+), (\d+)},$z};
z'static state states_(\d+)\[(\d+)\] = {$z\s+{(\d+), arcs_(\d+)_(\d+)},$zstatic dfa dfas\[(\d+)\] = {$z0\s+{(\d+), "(\w+)", (\d+), (\d+), states_(\d+),$����z\s+("(?:\\\d\d\d)*")},$�z!static label labels\[(\d+)\] = {$z\s+{(\d+), (0|"\w+")},$�0zgrammar _PyParser_Grammar = {
z
\s+(\d+),$z	dfas,
z\s+{(\d+), labels},$z	\s+(\d+)$)rrr�nextr�
startswithrr�list�maprr�range�append�len�states�grouprr�eval�	enumerate�ord�dfas�labels�start�
StopIteration)!rrrrrrZallarcsr.r�n�m�kZarcs�_�i�j�s�t�stater3Zndfasrr �x�y�z�firstZ	rawbitset�cZbyter4Znlabelsr5r	r	r
rTs��
�
"
zConverter.parse_graminit_ccCsXi|_i|_t|j�D]<\}\}}|tjkr@|dk	r@||j|<q|dkr||j|<qdS)z1Create additional useful structures.  (Internal).N)�keywords�tokensr1r4r�NAME)rZilabel�type�valuer	r	r
r�szConverter.finish_offN)�__name__�
__module__�__qualname__�__doc__rrrrr	r	r	r
r$s
&r)rMrZpgen2rrZGrammarrr	r	r	r
�<module>slib2to3/pgen2/__pycache__/grammar.cpython-38.opt-1.pyc000064400000013043151153537460016275 0ustar00U

e5d��@s`dZddlZddlmZGdd�de�ZdZiZe��D]"Z	e	r8e	�
�\ZZe
ee�ee<q8dS)a�This module defines the data structures used to represent a grammar.

These are a bit arcane because they are derived from the data
structures used by Python's 'pgen' parser generator.

There's also a table here mapping operators to their names in the
token module; the Python tokenize module reports all operators as the
fallback token code OP, but the parser needs the actual token code.

�N�)�tokenc@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�Grammara�	Pgen parsing tables conversion class.

    Once initialized, this class supplies the grammar tables for the
    parsing engine implemented by parse.py.  The parsing engine
    accesses the instance variables directly.  The class here does not
    provide initialization of the tables; several subclasses exist to
    do this (see the conv and pgen modules).

    The load() method reads the tables from a pickle file, which is
    much faster than the other ways offered by subclasses.  The pickle
    file is written by calling dump() (after loading the grammar
    tables using a subclass).  The report() method prints a readable
    representation of the tables to stdout, for debugging.

    The instance variables are as follows:

    symbol2number -- a dict mapping symbol names to numbers.  Symbol
                     numbers are always 256 or higher, to distinguish
                     them from token numbers, which are between 0 and
                     255 (inclusive).

    number2symbol -- a dict mapping numbers to symbol names;
                     these two are each other's inverse.

    states        -- a list of DFAs, where each DFA is a list of
                     states, each state is a list of arcs, and each
                     arc is a (i, j) pair where i is a label and j is
                     a state number.  The DFA number is the index into
                     this list.  (This name is slightly confusing.)
                     Final states are represented by a special arc of
                     the form (0, j) where j is its own state number.

    dfas          -- a dict mapping symbol numbers to (DFA, first)
                     pairs, where DFA is an item from the states list
                     above, and first is a set of tokens that can
                     begin this grammar rule (represented by a dict
                     whose values are always 1).

    labels        -- a list of (x, y) pairs where x is either a token
                     number or a symbol number, and y is either None
                     or a string; the strings are keywords.  The label
                     number is the index in this list; label numbers
                     are used to mark state transitions (arcs) in the
                     DFAs.

    start         -- the number of the grammar's start symbol.

    keywords      -- a dict mapping keyword strings to arc labels.

    tokens        -- a dict mapping token numbers to arc labels.

    cCs<i|_i|_g|_i|_dg|_i|_i|_i|_d|_dS)N)rZEMPTY�)	�
symbol2number�
number2symbol�states�dfas�labels�keywords�tokens�symbol2label�start)�self�r�-/usr/lib64/python3.8/lib2to3/pgen2/grammar.py�__init__LszGrammar.__init__c	Cs,t|d��}t�|j|tj�W5QRXdS)z)Dump the grammar tables to a pickle file.�wbN)�open�pickle�dump�__dict__ZHIGHEST_PROTOCOL)r�filename�frrrrWszGrammar.dumpc	Cs0t|d��}t�|�}W5QRX|j�|�dS)z+Load the grammar tables from a pickle file.�rbN)rr�loadr�update)rrr�drrrr\szGrammar.loadcCs|j�t�|��dS)z3Load the grammar tables from a pickle bytes object.N)rrr�loads)rZpklrrrrbsz
Grammar.loadscCsT|��}dD]}t||t||����q|jdd�|_|jdd�|_|j|_|S)z#
        Copy the grammar.
        )rrr	rrr
N)�	__class__�setattr�getattr�copyr
rr)r�newZ	dict_attrrrrr"fszGrammar.copycCsvddlm}td�||j�td�||j�td�||j�td�||j�td�||j�td|j�d	S)
z:Dump the grammar tables to standard output, for debugging.r)�pprintZs2nZn2srr	r
rN)r$�printrrrr	r
r)rr$rrr�reportss




zGrammar.reportN)
�__name__�
__module__�__qualname__�__doc__rrrrr"r&rrrrrs5
ra
( LPAR
) RPAR
[ LSQB
] RSQB
: COLON
, COMMA
; SEMI
+ PLUS
- MINUS
* STAR
/ SLASH
| VBAR
& AMPER
< LESS
> GREATER
= EQUAL
. DOT
% PERCENT
` BACKQUOTE
{ LBRACE
} RBRACE
@ AT
@= ATEQUAL
== EQEQUAL
!= NOTEQUAL
<> NOTEQUAL
<= LESSEQUAL
>= GREATEREQUAL
~ TILDE
^ CIRCUMFLEX
<< LEFTSHIFT
>> RIGHTSHIFT
** DOUBLESTAR
+= PLUSEQUAL
-= MINEQUAL
*= STAREQUAL
/= SLASHEQUAL
%= PERCENTEQUAL
&= AMPEREQUAL
|= VBAREQUAL
^= CIRCUMFLEXEQUAL
<<= LEFTSHIFTEQUAL
>>= RIGHTSHIFTEQUAL
**= DOUBLESTAREQUAL
// DOUBLESLASH
//= DOUBLESLASHEQUAL
-> RARROW
:= COLONEQUAL
)r*r�r�objectrZ	opmap_rawZopmap�
splitlines�line�split�op�namer!rrrr�<module>so3lib2to3/pgen2/__pycache__/__init__.cpython-38.opt-2.pyc000064400000000213151153537460016402 0ustar00U

e5d��@sdS)N�rrr�./usr/lib64/python3.8/lib2to3/pgen2/__init__.py�<module>slib2to3/pgen2/__pycache__/pgen.cpython-38.opt-2.pyc000064400000022161151153537460015602 0ustar00U

e5d�5�@sdddlmZmZmZGdd�dej�ZGdd�de�ZGdd�de�ZGdd	�d	e�Z	ddd�Z
d
S)�)�grammar�token�tokenizec@seZdZdS)�PgenGrammarN)�__name__�
__module__�__qualname__�r	r	�*/usr/lib64/python3.8/lib2to3/pgen2/pgen.pyrsrc@s�eZdZd&dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd'd d!�Zd"d#�Zd$d%�ZdS)(�ParserGeneratorNcCsld}|dkrt|�}|j}||_||_t�|j�|_|��|�	�\|_
|_|dk	rZ|�i|_|�
�dS�N)�open�close�filename�streamr�generate_tokens�readline�	generator�gettoken�parse�dfas�startsymbol�first�addfirstsets)�selfrrZclose_streamr	r	r
�__init__szParserGenerator.__init__c	Cst�}t|j���}|��|�|j�|�d|j�|D]&}dt|j	�}||j	|<||j
|<q:|D]�}|j|}g}|D]`}g}t|j�
��D]$\}	}
|�|�||	�|�|
�f�q�|jr�|�d|�|�f�|�|�q||j�|�||�||�f|j|j	|<qf|j	|j|_|S)N��)r�listr�keys�sort�remover�insert�len�
symbol2numberZ
number2symbol�sorted�arcs�items�append�
make_label�index�isfinal�states�
make_first�start)r�c�names�name�i�dfar,�stater&�label�nextr	r	r
�make_grammars.

zParserGenerator.make_grammarcCs4|j|}i}t|�D]}|�||�}d||<q|S�Nr)rr%r))rr/r1Zrawfirstrr5�ilabelr	r	r
r-4s

zParserGenerator.make_firstcCs&t|j�}|d��r�||jkrZ||jkr4|j|S|j�|j|df�||j|<|Sn>tt|d�}||jkrz|j|S|j�|df�||j|<|Sn�t	|�}|d��r�||j
kr�|j
|S|j�tj|f�||j
|<|Sn>tj
|}||jk�r|j|S|j�|df�||j|<|SdS�Nr)r#�labels�isalphar$Zsymbol2labelr(�getattrr�tokens�eval�keywords�NAMErZopmap)rr/r5r9Zitoken�valuer	r	r
r)=s6













zParserGenerator.make_labelcCs8t|j���}|��|D]}||jkr|�|�qdSr)rrrr r�	calcfirst)rr0r1r	r	r
rks

zParserGenerator.addfirstsetsc	Cs�|j|}d|j|<|d}i}i}|j��D]x\}}||jkr�||jkrj|j|}|dkr~td|��n|�|�|j|}|�|�|||<q.d||<|di||<q.i}	|��D]:\}}
|
D],}||	kr�td||||	|f��||	|<q�q�||j|<dS)Nrzrecursion for rule %rrzArule %s is ambiguous; %s is in the first sets of %s as well as %s)rrr&r'�
ValueErrorrC�update)rr1r3r4ZtotalsetZoverlapcheckr5r6�fsetZinverseZitsfirstZsymbolr	r	r
rCss4








�zParserGenerator.calcfirstc	Cs�i}d}|jtjkr�|jtjkr*|��q|�tj�}|�tjd�|��\}}|�tj�|�	||�}t
|�}|�|�t
|�}|||<|dkr|}q||fS)N�:)�typer�	ENDMARKER�NEWLINEr�expectrA�OP�	parse_rhs�make_dfar#�simplify_dfa)	rrrr1�a�zr3ZoldlenZnewlenr	r	r
r�s"

zParserGenerator.parsec	s��fdd�}�fdd��t||�|�g}|D]�}i}|jD].}|jD]"\}}	|dk	rD�|	|�|i��qDq:t|���D]@\}}
|D]}|j|
kr�q�q�t|
|�}|�|�|�||�qvq,|S)Ncsi}�||�|Srr	)r4�base��
addclosurer	r
�closure�s
z)ParserGenerator.make_dfa.<locals>.closurecs:||krdSd||<|jD]\}}|dkr�||�qdSr8�r&)r4rRr5r6rSr	r
rT�sz,ParserGenerator.make_dfa.<locals>.addclosure)�DFAState�nfasetr&�
setdefaultr%r'r(�addarc)rr.�finishrUr,r4r&Znfastater5r6rX�str	rSr
rN�s"



zParserGenerator.make_dfac
Cs�td|�|g}t|�D]|\}}td|||kr2dp4d�|jD]T\}}||krZ|�|�}	nt|�}	|�|�|dkr�td|	�q>td||	f�q>qdS)NzDump of NFA for�  State�(final)�z	    -> %d�    %s -> %d)�print�	enumerater&r*r#r()
rr1r.r[Ztodor2r4r5r6�jr	r	r
�dump_nfa�s

zParserGenerator.dump_nfacCsdtd|�t|�D]L\}}td||jr*dp,d�t|j���D]\}}td||�|�f�q>qdS)NzDump of DFA forr]r^r_r`)rarbr+r%r&r'r*)rr1r3r2r4r5r6r	r	r
�dump_dfa�s

zParserGenerator.dump_dfacCspd}|rld}t|�D]T\}}t|dt|��D]8}||}||kr.||=|D]}|�||�qLd}qq.qqdS)NTFr)rb�ranger#�
unifystate)rr3Zchangesr2Zstate_ircZstate_jr4r	r	r
rO�szParserGenerator.simplify_dfacCs~|��\}}|jdkr||fSt�}t�}|�|�|�|�|jdkrr|��|��\}}|�|�|�|�q>||fSdS)N�|)�	parse_altrB�NFAStaterZr)rrPrQZaaZzzr	r	r
rM�s




zParserGenerator.parse_rhscCsL|��\}}|jdks(|jtjtjfkrD|��\}}|�|�|}q||fS)N)�(�[)�
parse_itemrBrHrrA�STRINGrZ)rrP�br/�dr	r	r
ri
s
�
zParserGenerator.parse_altcCs�|jdkr>|��|��\}}|�tjd�|�|�||fS|��\}}|j}|dkr`||fS|��|�|�|dkr�||fS||fSdS)Nrl�])�+�*rr)rBrrMrKrrLrZ�
parse_atom)rrPrQrBr	r	r
rms


zParserGenerator.parse_itemcCs�|jdkr4|��|��\}}|�tjd�||fS|jtjtjfkrpt	�}t	�}|�
||j�|��||fS|�d|j|j�dS)Nrk�)z+expected (...) or NAME or STRING, got %s/%s)rBrrMrKrrLrHrArnrjrZ�raise_error)rrPrQr	r	r
rt(s
�zParserGenerator.parse_atomcCsD|j|ks|dk	r2|j|kr2|�d|||j|j�|j}|��|S)Nzexpected %s/%s, got %s/%s)rHrBrvr)rrHrBr	r	r
rK9s�zParserGenerator.expectcCsFt|j�}|dtjtjfkr*t|j�}q
|\|_|_|_|_|_	dSr:)
r6rr�COMMENT�NLrHrBZbegin�end�line)r�tupr	r	r
rAs
zParserGenerator.gettokenc
Gs^|r8z||}Wn&d�|gttt|���}YnXt||j|jd|jd|jf��dS)N� rr)�joinr�map�str�SyntaxErrorrryrz)r�msg�argsr	r	r
rvHs �zParserGenerator.raise_error)N)N)rrrrr7r-r)rrCrrNrdrerOrMrirmrtrKrrvr	r	r	r
r
s$
	.$

rc@seZdZdd�Zddd�ZdS)rjcCs
g|_dSrrV)rr	r	r
rSszNFAState.__init__NcCs|j�||f�dSr)r&r(�rr6r5r	r	r
rZVszNFAState.addarc)N)rrrrrZr	r	r	r
rjQsrjc@s0eZdZdd�Zdd�Zdd�Zdd�Zd	Zd	S)
rWcCs||_||k|_i|_dSr)rXr+r&)rrX�finalr	r	r
r]s
zDFAState.__init__cCs||j|<dSrrVr�r	r	r
rZeszDFAState.addarccCs*|j��D]\}}||kr
||j|<q
dSr)r&r')r�old�newr5r6r	r	r
rgkszDFAState.unifystatecCsV|j|jkrdSt|j�t|j�kr(dS|j��D]\}}||j�|�k	r2dSq2dS)NFT)r+r#r&r'�get)r�otherr5r6r	r	r
�__eq__pszDFAState.__eq__N)rrrrrZrgr��__hash__r	r	r	r
rW[s
rW�Grammar.txtcCst|�}|��Sr)rr7)r�pr	r	r
�generate_grammar�sr�N)r�)r_rrrZGrammarr�objectrrjrWr�r	r	r	r
�<module>sI
%lib2to3/pgen2/__pycache__/literals.cpython-38.opt-2.pyc000064400000002413151153537460016466 0ustar00U

e5dc�@sLddlZdddddddd	d
dd�
Zd
d�Zdd�Zdd�ZedkrHe�dS)�N����
�
�	��'�"�\)
�a�b�f�n�r�t�vr	r
rcCs�|�dd�\}}t�|�}|dk	r&|S|�d�r�|dd�}t|�dkrTtd|��zt|d�}Wq�tk
r�td|�d�Yq�Xn2zt|d�}Wn"tk
r�td|�d�YnXt|�S)	Nr��x�z!invalid hex string escape ('\%s')��z#invalid octal string escape ('\%s'))�group�simple_escapes�get�
startswith�len�
ValueError�int�chr)�m�all�tailZescZhexes�i�r$�./usr/lib64/python3.8/lib2to3/pgen2/literals.py�escapes"

r&cCsH|d}|dd�|dkr$|d}|t|�t|��}t�dt|�S)Nr�z)\\(\'|\"|\\|[abfnrtv]|x.{0,2}|[0-7]{1,3}))r�re�subr&)�s�qr$r$r%�
evalString(s
r,cCs@td�D]2}t|�}t|�}t|�}||krt||||�qdS)N�)�ranger�reprr,�print)r#�cr*�er$r$r%�test2sr3�__main__)r(rr&r,r3�__name__r$r$r$r%�<module>s �
	lib2to3/pgen2/__pycache__/conv.cpython-38.opt-1.pyc000064400000013774151153537460015627 0ustar00U

e5d�%�@s2dZddlZddlmZmZGdd�dej�ZdS)a�Convert graminit.[ch] spit out by pgen to Python code.

Pgen is the Python parser generator.  It is useful to quickly create a
parser from a grammar file in Python's grammar notation.  But I don't
want my parsers to be written in C (yet), so I'm translating the
parsing tables to Python data structures and writing a Python parse
engine.

Note that the token numbers are constants determined by the standard
Python tokenizer.  The standard token module defines these numbers and
their names (the names are not used much).  The token numbers are
hardcoded into the Python tokenizer and into pgen.  A Python
implementation of the Python tokenizer is also available, in the
standard tokenize module.

On the other hand, symbol numbers (representing the grammar's
non-terminals) are assigned by pgen based on the actual grammar
input.

Note: this module is pretty much obsolete; the pgen module generates
equivalent grammar tables directly from the Grammar.txt input file
without having to invoke the Python pgen C program.

�N)�grammar�tokenc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�	Convertera2Grammar subclass that reads classic pgen output files.

    The run() method reads the tables as produced by the pgen parser
    generator, typically contained in two C files, graminit.h and
    graminit.c.  The other methods are for internal use only.

    See the base class for more documentation.

    cCs |�|�|�|�|��dS)z<Load the grammar tables from the text files written by pgen.N)�parse_graminit_h�parse_graminit_c�
finish_off)�selfZ
graminit_hZ
graminit_c�r	�*/usr/lib64/python3.8/lib2to3/pgen2/conv.py�run/s

z
Converter.runc	
Cs�zt|�}Wn8tk
rD}ztd||f�WY�dSd}~XYnXi|_i|_d}|D]d}|d7}t�d|�}|s�|��r�td|||��f�qZ|��\}}t	|�}||j|<||j|<qZdS)	z�Parse the .h file written by pgen.  (Internal)

        This file is a sequence of #define statements defining the
        nonterminals of the grammar as numbers.  We build two tables
        mapping the numbers to names and back.

        �Can't open %s: %sFNr�z^#define\s+(\w+)\s+(\d+)$z%s(%s): can't parse %sT)
�open�OSError�printZ
symbol2numberZ
number2symbol�re�match�strip�groups�int)	r�filename�f�err�lineno�line�mo�symbol�numberr	r	r
r5s(�

zConverter.parse_graminit_hc!
Cs�zt|�}Wn8tk
rD}ztd||f�WY�dSd}~XYnXd}|dt|�}}|dt|�}}|dt|�}}i}g}|�d��r�|�d��rJt�d|�}ttt	|�
���\}	}
}g}t|�D]F}
|dt|�}}t�d|�}ttt	|�
���\}}|�||f�q�|dt|�}}|||	|
f<|dt|�}}q�t�d	|�}ttt	|�
���\}}g}t|�D]R}
|dt|�}}t�d
|�}ttt	|�
���\}}	}
||	|
f}|�|��qx|�|�|dt|�}}|dt|�}}q�||_
i}t�d|�}t	|�d��}t|�D]�}|dt|�}}t�d|�}|�d
�}ttt	|�dddd���\}}}}||}|dt|�}}t�d|�}i}t|�d��}t|�D]@\}}t|�}td�D]$}|d|>@�r�d||d|<�qΐq�||f||<�q(|dt|�}}||_g}|dt|�}}t�d|�}t	|�d��}t|�D]^}|dt|�}}t�d|�}|�
�\}}t	|�}|dk�r�d}nt|�}|�||f��qX|dt|�}}||_|dt|�}}|dt|�}}t�d|�}t	|�d��}|dt|�}}|dt|�}}t�d|�}t	|�d��}|dt|�}}t�d|�}t	|�d��} | |_|dt|�}}z|dt|�}}Wntk
�r�YnXdS)a�Parse the .c file written by pgen.  (Internal)

        The file looks as follows.  The first two lines are always this:

        #include "pgenheaders.h"
        #include "grammar.h"

        After that come four blocks:

        1) one or more state definitions
        2) a table defining dfas
        3) a table defining labels
        4) a struct defining the grammar

        A state definition has the following form:
        - one or more arc arrays, each of the form:
          static arc arcs_<n>_<m>[<k>] = {
                  {<i>, <j>},
                  ...
          };
        - followed by a state array, of the form:
          static state states_<s>[<t>] = {
                  {<k>, arcs_<n>_<m>},
                  ...
          };

        rFNrr
zstatic arc z)static arc arcs_(\d+)_(\d+)\[(\d+)\] = {$z\s+{(\d+), (\d+)},$z'static state states_(\d+)\[(\d+)\] = {$z\s+{(\d+), arcs_(\d+)_(\d+)},$zstatic dfa dfas\[(\d+)\] = {$z0\s+{(\d+), "(\w+)", (\d+), (\d+), states_(\d+),$����z\s+("(?:\\\d\d\d)*")},$�z!static label labels\[(\d+)\] = {$z\s+{(\d+), (0|"\w+")},$�0z
\s+(\d+),$z\s+{(\d+), labels},$z	\s+(\d+)$)rrr�next�
startswithrr�list�maprr�range�append�states�group�eval�	enumerate�ord�dfas�labels�start�
StopIteration)!rrrrrrZallarcsr*r�n�m�kZarcs�_�i�j�s�t�stater/Zndfasrr�x�y�z�firstZ	rawbitset�cZbyter0Znlabelsr1r	r	r
rTs��
�
"
zConverter.parse_graminit_ccCsXi|_i|_t|j�D]<\}\}}|tjkr@|dk	r@||j|<q|dkr||j|<qdS)z1Create additional useful structures.  (Internal).N)�keywords�tokensr-r0r�NAME)rZilabel�type�valuer	r	r
r�szConverter.finish_offN)�__name__�
__module__�__qualname__�__doc__rrrrr	r	r	r
r$s
&r)rIrZpgen2rrZGrammarrr	r	r	r
�<module>slib2to3/pgen2/__pycache__/driver.cpython-38.opt-1.pyc000064400000011747151153537460016153 0ustar00U

e5dQ�@s�dZdZddgZddlZddlZddlZddlZddlZddlm	Z	m
Z
mZmZm
Z
Gdd�de�Zd	d
�Zddd�Zdd�Zdd�Zdd�Zedkr�e�ee���dS)zZParser driver.

This provides a high-level interface to parse a file into a syntax tree.

z#Guido van Rossum <guido@python.org>�Driver�load_grammar�N�)�grammar�parse�token�tokenize�pgenc@sHeZdZddd�Zddd�Zddd�Zdd	d
�Zddd�Zdd
d�ZdS)rNcCs&||_|dkrt��}||_||_dS)N)r�logging�	getLogger�logger�convert)�selfrr
r�r�,/usr/lib64/python3.8/lib2to3/pgen2/driver.py�__init__s
zDriver.__init__FcCstt�|j|j�}|��d}d}d}}}}	}
d}|D�]}|\}}}}	}
|||fkr�|\}
}||
kr�|d|
|7}|
}d}||kr�||
||�7}|}|tjtjfkr�||7}|	\}}|�d�r<|d7}d}q<|t	j
kr�tj|}|�r
|j�
dt	j|||�|�||||f��r6|�r0|j�
d��qnd}|	\}}|�d�r<|d7}d}q<t�d||||f��|jS)	z4Parse a series of tokens and return the syntax tree.rrN��
z%s %r (prefix=%r)zStop.zincomplete input)rZParserrr
Zsetupr�COMMENT�NL�endswithr�OPZopmapr�debug�tok_nameZaddtokenZ
ParseErrorZrootnode)r�tokensr�p�lineno�column�type�value�start�endZ	line_text�prefixZ	quintupleZs_linenoZs_columnrrr�parse_tokens&s^



�
�zDriver.parse_tokenscCst�|j�}|�||�S�z*Parse a stream and return the syntax tree.)r�generate_tokens�readliner#)r�streamrrrrr�parse_stream_rawVszDriver.parse_stream_rawcCs|�||�Sr$)r()rr'rrrr�parse_stream[szDriver.parse_streamc
Cs4tj|d|d��}|�||�W5QR�SQRXdS)z(Parse a file and return the syntax tree.�r)�encodingN)�io�openr))r�filenamer+rr'rrr�
parse_file_szDriver.parse_filecCst�t�|�j�}|�||�S)z*Parse a string and return the syntax tree.)rr%r,�StringIOr&r#)r�textrrrrr�parse_stringdszDriver.parse_string)NN)F)F)F)NF)F)	�__name__�
__module__�__qualname__rr#r(r)r/r2rrrrrs

0


cCs:tj�|�\}}|dkrd}||d�tttj��dS)Nz.txtr�.z.pickle)�os�path�splitext�join�map�str�sys�version_info)�gt�head�tailrrr�_generate_pickle_namejsrB�Grammar.txtTFc
Cs�|dkrt��}|dkr t|�n|}|s2t||�s�|�d|�t�|�}|r�|�d|�z|�|�Wq�tk
r�}z|�d|�W5d}~XYq�Xnt	�
�}|�|�|S)z'Load the grammar (maybe from a pickle).Nz!Generating grammar tables from %szWriting grammar tables to %szWriting failed: %s)r
rrB�_newer�infor	Zgenerate_grammar�dump�OSErrorr�Grammar�load)r?Zgp�save�forcer�g�errrrqs
 
cCs8tj�|�sdStj�|�s dStj�|�tj�|�kS)z0Inquire whether file a was written since file b.FT)r7r8�exists�getmtime)�a�brrrrD�s
rDcCsFtj�|�rt|�Sttj�|��}t�||�}t�	�}|�
|�|S)a�Normally, loads a pickled grammar by doing
        pkgutil.get_data(package, pickled_grammar)
    where *pickled_grammar* is computed from *grammar_source* by adding the
    Python version and using a ``.pickle`` extension.

    However, if *grammar_source* is an extant file, load_grammar(grammar_source)
    is called instead. This facilitates using a packaged grammar file when needed
    but preserves load_grammar's automatic regeneration behavior when possible.

    )r7r8�isfilerrB�basename�pkgutil�get_datarrH�loads)�packageZgrammar_sourceZpickled_name�datarLrrr�load_packaged_grammar�s
rYcGsB|stjdd�}tjtjtjdd�|D]}t|ddd�q*dS)z�Main program, when run as a script: produce grammar pickle files.

    Calls load_grammar for each argument, a path to a grammar text file.
    rNz%(message)s)�levelr'�formatT)rJrK)r=�argvr
ZbasicConfig�INFO�stdoutr)�argsr?rrr�main�s�r`�__main__)rCNTFN)�__doc__�
__author__�__all__r,r7r
rTr=rrrrrr	�objectrrBrrDrYr`r3�exit�intrrrr�<module>s(M�
	
lib2to3/pgen2/__pycache__/driver.cpython-38.pyc000064400000012027151153537460015204 0ustar00U

e5dQ�@s�dZdZddgZddlZddlZddlZddlZddlZddlm	Z	m
Z
mZmZm
Z
Gdd�de�Zd	d
�Zddd�Zdd�Zdd�Zdd�Zedkr�e�ee���dS)zZParser driver.

This provides a high-level interface to parse a file into a syntax tree.

z#Guido van Rossum <guido@python.org>�Driver�load_grammar�N�)�grammar�parse�token�tokenize�pgenc@sHeZdZddd�Zddd�Zddd�Zdd	d
�Zddd�Zdd
d�ZdS)rNcCs&||_|dkrt��}||_||_dS)N)r�logging�	getLogger�logger�convert)�selfrr
r�r�,/usr/lib64/python3.8/lib2to3/pgen2/driver.py�__init__s
zDriver.__init__FcCs�t�|j|j�}|��d}d}d}}}}	}
d}|D�]8}|\}}}}	}
|||fkr�||f|ksxt||f|f��|\}
}||
kr�|d|
|7}|
}d}||kr�||
||�7}|}|tjtjfkr�||7}|	\}}|�	d�r<|d7}d}q<|t
jk�r
tj|}|�r(|j
�dt
j|||�|�||||f��rT|�rN|j
�d��q�d}|	\}}|�	d�r<|d7}d}q<t�d||||f��|jS)	z4Parse a series of tokens and return the syntax tree.rrN��
z%s %r (prefix=%r)zStop.zincomplete input)rZParserrr
Zsetup�AssertionErrorr�COMMENT�NL�endswithr�OPZopmapr�debug�tok_nameZaddtokenZ
ParseErrorZrootnode)r�tokensr�p�lineno�column�type�value�start�endZ	line_text�prefixZ	quintupleZs_linenoZs_columnrrr�parse_tokens&s`


�
�zDriver.parse_tokenscCst�|j�}|�||�S�z*Parse a stream and return the syntax tree.)r�generate_tokens�readliner$)r�streamrrrrr�parse_stream_rawVszDriver.parse_stream_rawcCs|�||�Sr%)r))rr(rrrr�parse_stream[szDriver.parse_streamc
Cs4tj|d|d��}|�||�W5QR�SQRXdS)z(Parse a file and return the syntax tree.�r)�encodingN)�io�openr*)r�filenamer,rr(rrr�
parse_file_szDriver.parse_filecCst�t�|�j�}|�||�S)z*Parse a string and return the syntax tree.)rr&r-�StringIOr'r$)r�textrrrrr�parse_stringdszDriver.parse_string)NN)F)F)F)NF)F)	�__name__�
__module__�__qualname__rr$r)r*r0r3rrrrrs

0


cCs:tj�|�\}}|dkrd}||d�tttj��dS)Nz.txtr�.z.pickle)�os�path�splitext�join�map�str�sys�version_info)�gt�head�tailrrr�_generate_pickle_namejsrC�Grammar.txtTFc
Cs�|dkrt��}|dkr t|�n|}|s2t||�s�|�d|�t�|�}|r�|�d|�z|�|�Wq�tk
r�}z|�d|�W5d}~XYq�Xnt	�
�}|�|�|S)z'Load the grammar (maybe from a pickle).Nz!Generating grammar tables from %szWriting grammar tables to %szWriting failed: %s)r
rrC�_newer�infor	Zgenerate_grammar�dump�OSErrorr�Grammar�load)r@Zgp�save�forcer�g�errrrqs
 
cCs8tj�|�sdStj�|�s dStj�|�tj�|�kS)z0Inquire whether file a was written since file b.FT)r8r9�exists�getmtime)�a�brrrrE�s
rEcCsFtj�|�rt|�Sttj�|��}t�||�}t�	�}|�
|�|S)a�Normally, loads a pickled grammar by doing
        pkgutil.get_data(package, pickled_grammar)
    where *pickled_grammar* is computed from *grammar_source* by adding the
    Python version and using a ``.pickle`` extension.

    However, if *grammar_source* is an extant file, load_grammar(grammar_source)
    is called instead. This facilitates using a packaged grammar file when needed
    but preserves load_grammar's automatic regeneration behavior when possible.

    )r8r9�isfilerrC�basename�pkgutil�get_datarrI�loads)�packageZgrammar_sourceZpickled_name�datarMrrr�load_packaged_grammar�s
rZcGsB|stjdd�}tjtjtjdd�|D]}t|ddd�q*dS)z�Main program, when run as a script: produce grammar pickle files.

    Calls load_grammar for each argument, a path to a grammar text file.
    rNz%(message)s)�levelr(�formatT)rKrL)r>�argvr
ZbasicConfig�INFO�stdoutr)�argsr@rrr�main�s�ra�__main__)rDNTFN)�__doc__�
__author__�__all__r-r8r
rUr>rrrrrr	�objectrrCrrErZrar4�exit�intrrrr�<module>s(M�
	
lib2to3/pgen2/__pycache__/__init__.cpython-38.pyc000064400000000247151153537460015451 0ustar00U

e5d��@sdZdS)zThe pgen2 package.N)�__doc__�rr�./usr/lib64/python3.8/lib2to3/pgen2/__init__.py�<module>�lib2to3/pgen2/literals.py000064400000003143151153537460011241 0ustar00# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Safely evaluate Python string literals without using eval()."""

import re

simple_escapes = {"a": "\a",
                  "b": "\b",
                  "f": "\f",
                  "n": "\n",
                  "r": "\r",
                  "t": "\t",
                  "v": "\v",
                  "'": "'",
                  '"': '"',
                  "\\": "\\"}

def escape(m):
    all, tail = m.group(0, 1)
    assert all.startswith("\\")
    esc = simple_escapes.get(tail)
    if esc is not None:
        return esc
    if tail.startswith("x"):
        hexes = tail[1:]
        if len(hexes) < 2:
            raise ValueError("invalid hex string escape ('\\%s')" % tail)
        try:
            i = int(hexes, 16)
        except ValueError:
            raise ValueError("invalid hex string escape ('\\%s')" % tail) from None
    else:
        try:
            i = int(tail, 8)
        except ValueError:
            raise ValueError("invalid octal string escape ('\\%s')" % tail) from None
    return chr(i)

def evalString(s):
    assert s.startswith("'") or s.startswith('"'), repr(s[:1])
    q = s[0]
    if s[:3] == q*3:
        q = q*3
    assert s.endswith(q), repr(s[-len(q):])
    assert len(s) >= 2*len(q)
    s = s[len(q):-len(q)]
    return re.sub(r"\\(\'|\"|\\|[abfnrtv]|x.{0,2}|[0-7]{1,3})", escape, s)

def test():
    for i in range(256):
        c = chr(i)
        s = repr(c)
        e = evalString(s)
        if e != c:
            print(i, c, s, e)


if __name__ == "__main__":
    test()
lib2to3/pgen2/token.py000075500000002424151153537460010546 0ustar00#! /usr/bin/python3.8

"""Token constants (from "token.h")."""

#  Taken from Python (r53757) and modified to include some tokens
#   originally monkeypatched in by pgen2.tokenize

#--start constants--
ENDMARKER = 0
NAME = 1
NUMBER = 2
STRING = 3
NEWLINE = 4
INDENT = 5
DEDENT = 6
LPAR = 7
RPAR = 8
LSQB = 9
RSQB = 10
COLON = 11
COMMA = 12
SEMI = 13
PLUS = 14
MINUS = 15
STAR = 16
SLASH = 17
VBAR = 18
AMPER = 19
LESS = 20
GREATER = 21
EQUAL = 22
DOT = 23
PERCENT = 24
BACKQUOTE = 25
LBRACE = 26
RBRACE = 27
EQEQUAL = 28
NOTEQUAL = 29
LESSEQUAL = 30
GREATEREQUAL = 31
TILDE = 32
CIRCUMFLEX = 33
LEFTSHIFT = 34
RIGHTSHIFT = 35
DOUBLESTAR = 36
PLUSEQUAL = 37
MINEQUAL = 38
STAREQUAL = 39
SLASHEQUAL = 40
PERCENTEQUAL = 41
AMPEREQUAL = 42
VBAREQUAL = 43
CIRCUMFLEXEQUAL = 44
LEFTSHIFTEQUAL = 45
RIGHTSHIFTEQUAL = 46
DOUBLESTAREQUAL = 47
DOUBLESLASH = 48
DOUBLESLASHEQUAL = 49
AT = 50
ATEQUAL = 51
OP = 52
COMMENT = 53
NL = 54
RARROW = 55
AWAIT = 56
ASYNC = 57
ERRORTOKEN = 58
COLONEQUAL = 59
N_TOKENS = 60
NT_OFFSET = 256
#--end constants--

tok_name = {}
for _name, _value in list(globals().items()):
    if type(_value) is type(0):
        tok_name[_value] = _name


def ISTERMINAL(x):
    return x < NT_OFFSET

def ISNONTERMINAL(x):
    return x >= NT_OFFSET

def ISEOF(x):
    return x == ENDMARKER
lib2to3/pgen2/parse.py000064400000017733151153537460010546 0ustar00# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Parser engine for the grammar tables generated by pgen.

The grammar table must be loaded first.

See Parser/parser.c in the Python distribution for additional info on
how this parsing engine works.

"""

# Local imports
from . import token

class ParseError(Exception):
    """Exception to signal the parser is stuck."""

    def __init__(self, msg, type, value, context):
        Exception.__init__(self, "%s: type=%r, value=%r, context=%r" %
                           (msg, type, value, context))
        self.msg = msg
        self.type = type
        self.value = value
        self.context = context

    def __reduce__(self):
        return type(self), (self.msg, self.type, self.value, self.context)

class Parser(object):
    """Parser engine.

    The proper usage sequence is:

    p = Parser(grammar, [converter])  # create instance
    p.setup([start])                  # prepare for parsing
    <for each input token>:
        if p.addtoken(...):           # parse a token; may raise ParseError
            break
    root = p.rootnode                 # root of abstract syntax tree

    A Parser instance may be reused by calling setup() repeatedly.

    A Parser instance contains state pertaining to the current token
    sequence, and should not be used concurrently by different threads
    to parse separate token sequences.

    See driver.py for how to get input tokens by tokenizing a file or
    string.

    Parsing is complete when addtoken() returns True; the root of the
    abstract syntax tree can then be retrieved from the rootnode
    instance variable.  When a syntax error occurs, addtoken() raises
    the ParseError exception.  There is no error recovery; the parser
    cannot be used after a syntax error was reported (but it can be
    reinitialized by calling setup()).

    """

    def __init__(self, grammar, convert=None):
        """Constructor.

        The grammar argument is a grammar.Grammar instance; see the
        grammar module for more information.

        The parser is not ready yet for parsing; you must call the
        setup() method to get it started.

        The optional convert argument is a function mapping concrete
        syntax tree nodes to abstract syntax tree nodes.  If not
        given, no conversion is done and the syntax tree produced is
        the concrete syntax tree.  If given, it must be a function of
        two arguments, the first being the grammar (a grammar.Grammar
        instance), and the second being the concrete syntax tree node
        to be converted.  The syntax tree is converted from the bottom
        up.

        A concrete syntax tree node is a (type, value, context, nodes)
        tuple, where type is the node type (a token or symbol number),
        value is None for symbols and a string for tokens, context is
        None or an opaque value used for error reporting (typically a
        (lineno, offset) pair), and nodes is a list of children for
        symbols, and None for tokens.

        An abstract syntax tree node may be anything; this is entirely
        up to the converter function.

        """
        self.grammar = grammar
        self.convert = convert or (lambda grammar, node: node)

    def setup(self, start=None):
        """Prepare for parsing.

        This *must* be called before starting to parse.

        The optional argument is an alternative start symbol; it
        defaults to the grammar's start symbol.

        You can use a Parser instance to parse any number of programs;
        each time you call setup() the parser is reset to an initial
        state determined by the (implicit or explicit) start symbol.

        """
        if start is None:
            start = self.grammar.start
        # Each stack entry is a tuple: (dfa, state, node).
        # A node is a tuple: (type, value, context, children),
        # where children is a list of nodes or None, and context may be None.
        newnode = (start, None, None, [])
        stackentry = (self.grammar.dfas[start], 0, newnode)
        self.stack = [stackentry]
        self.rootnode = None
        self.used_names = set() # Aliased to self.rootnode.used_names in pop()

    def addtoken(self, type, value, context):
        """Add a token; return True iff this is the end of the program."""
        # Map from token to label
        ilabel = self.classify(type, value, context)
        # Loop until the token is shifted; may raise exceptions
        while True:
            dfa, state, node = self.stack[-1]
            states, first = dfa
            arcs = states[state]
            # Look for a state with this label
            for i, newstate in arcs:
                t, v = self.grammar.labels[i]
                if ilabel == i:
                    # Look it up in the list of labels
                    assert t < 256
                    # Shift a token; we're done with it
                    self.shift(type, value, newstate, context)
                    # Pop while we are in an accept-only state
                    state = newstate
                    while states[state] == [(0, state)]:
                        self.pop()
                        if not self.stack:
                            # Done parsing!
                            return True
                        dfa, state, node = self.stack[-1]
                        states, first = dfa
                    # Done with this token
                    return False
                elif t >= 256:
                    # See if it's a symbol and if we're in its first set
                    itsdfa = self.grammar.dfas[t]
                    itsstates, itsfirst = itsdfa
                    if ilabel in itsfirst:
                        # Push a symbol
                        self.push(t, self.grammar.dfas[t], newstate, context)
                        break # To continue the outer while loop
            else:
                if (0, state) in arcs:
                    # An accepting state, pop it and try something else
                    self.pop()
                    if not self.stack:
                        # Done parsing, but another token is input
                        raise ParseError("too much input",
                                         type, value, context)
                else:
                    # No success finding a transition
                    raise ParseError("bad input", type, value, context)

    def classify(self, type, value, context):
        """Turn a token into a label.  (Internal)"""
        if type == token.NAME:
            # Keep a listing of all used names
            self.used_names.add(value)
            # Check for reserved words
            ilabel = self.grammar.keywords.get(value)
            if ilabel is not None:
                return ilabel
        ilabel = self.grammar.tokens.get(type)
        if ilabel is None:
            raise ParseError("bad token", type, value, context)
        return ilabel

    def shift(self, type, value, newstate, context):
        """Shift a token.  (Internal)"""
        dfa, state, node = self.stack[-1]
        newnode = (type, value, context, None)
        newnode = self.convert(self.grammar, newnode)
        if newnode is not None:
            node[-1].append(newnode)
        self.stack[-1] = (dfa, newstate, node)

    def push(self, type, newdfa, newstate, context):
        """Push a nonterminal.  (Internal)"""
        dfa, state, node = self.stack[-1]
        newnode = (type, None, context, [])
        self.stack[-1] = (dfa, newstate, node)
        self.stack.append((newdfa, 0, newnode))

    def pop(self):
        """Pop a nonterminal.  (Internal)"""
        popdfa, popstate, popnode = self.stack.pop()
        newnode = self.convert(self.grammar, popnode)
        if newnode is not None:
            if self.stack:
                dfa, state, node = self.stack[-1]
                node[-1].append(newnode)
            else:
                self.rootnode = newnode
                self.rootnode.used_names = self.used_names
lib2to3/pgen2/driver.py000064400000013521151153537460010716 0ustar00# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

# Modifications:
# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Parser driver.

This provides a high-level interface to parse a file into a syntax tree.

"""

__author__ = "Guido van Rossum <guido@python.org>"

__all__ = ["Driver", "load_grammar"]

# Python imports
import io
import os
import logging
import pkgutil
import sys

# Pgen imports
from . import grammar, parse, token, tokenize, pgen


class Driver(object):

    def __init__(self, grammar, convert=None, logger=None):
        self.grammar = grammar
        if logger is None:
            logger = logging.getLogger()
        self.logger = logger
        self.convert = convert

    def parse_tokens(self, tokens, debug=False):
        """Parse a series of tokens and return the syntax tree."""
        # XXX Move the prefix computation into a wrapper around tokenize.
        p = parse.Parser(self.grammar, self.convert)
        p.setup()
        lineno = 1
        column = 0
        type = value = start = end = line_text = None
        prefix = ""
        for quintuple in tokens:
            type, value, start, end, line_text = quintuple
            if start != (lineno, column):
                assert (lineno, column) <= start, ((lineno, column), start)
                s_lineno, s_column = start
                if lineno < s_lineno:
                    prefix += "\n" * (s_lineno - lineno)
                    lineno = s_lineno
                    column = 0
                if column < s_column:
                    prefix += line_text[column:s_column]
                    column = s_column
            if type in (tokenize.COMMENT, tokenize.NL):
                prefix += value
                lineno, column = end
                if value.endswith("\n"):
                    lineno += 1
                    column = 0
                continue
            if type == token.OP:
                type = grammar.opmap[value]
            if debug:
                self.logger.debug("%s %r (prefix=%r)",
                                  token.tok_name[type], value, prefix)
            if p.addtoken(type, value, (prefix, start)):
                if debug:
                    self.logger.debug("Stop.")
                break
            prefix = ""
            lineno, column = end
            if value.endswith("\n"):
                lineno += 1
                column = 0
        else:
            # We never broke out -- EOF is too soon (how can this happen???)
            raise parse.ParseError("incomplete input",
                                   type, value, (prefix, start))
        return p.rootnode

    def parse_stream_raw(self, stream, debug=False):
        """Parse a stream and return the syntax tree."""
        tokens = tokenize.generate_tokens(stream.readline)
        return self.parse_tokens(tokens, debug)

    def parse_stream(self, stream, debug=False):
        """Parse a stream and return the syntax tree."""
        return self.parse_stream_raw(stream, debug)

    def parse_file(self, filename, encoding=None, debug=False):
        """Parse a file and return the syntax tree."""
        with io.open(filename, "r", encoding=encoding) as stream:
            return self.parse_stream(stream, debug)

    def parse_string(self, text, debug=False):
        """Parse a string and return the syntax tree."""
        tokens = tokenize.generate_tokens(io.StringIO(text).readline)
        return self.parse_tokens(tokens, debug)


def _generate_pickle_name(gt):
    head, tail = os.path.splitext(gt)
    if tail == ".txt":
        tail = ""
    return head + tail + ".".join(map(str, sys.version_info)) + ".pickle"


def load_grammar(gt="Grammar.txt", gp=None,
                 save=True, force=False, logger=None):
    """Load the grammar (maybe from a pickle)."""
    if logger is None:
        logger = logging.getLogger()
    gp = _generate_pickle_name(gt) if gp is None else gp
    if force or not _newer(gp, gt):
        logger.info("Generating grammar tables from %s", gt)
        g = pgen.generate_grammar(gt)
        if save:
            logger.info("Writing grammar tables to %s", gp)
            try:
                g.dump(gp)
            except OSError as e:
                logger.info("Writing failed: %s", e)
    else:
        g = grammar.Grammar()
        g.load(gp)
    return g


def _newer(a, b):
    """Inquire whether file a was written since file b."""
    if not os.path.exists(a):
        return False
    if not os.path.exists(b):
        return True
    return os.path.getmtime(a) >= os.path.getmtime(b)


def load_packaged_grammar(package, grammar_source):
    """Normally, loads a pickled grammar by doing
        pkgutil.get_data(package, pickled_grammar)
    where *pickled_grammar* is computed from *grammar_source* by adding the
    Python version and using a ``.pickle`` extension.

    However, if *grammar_source* is an extant file, load_grammar(grammar_source)
    is called instead. This facilitates using a packaged grammar file when needed
    but preserves load_grammar's automatic regeneration behavior when possible.

    """
    if os.path.isfile(grammar_source):
        return load_grammar(grammar_source)
    pickled_name = _generate_pickle_name(os.path.basename(grammar_source))
    data = pkgutil.get_data(package, pickled_name)
    g = grammar.Grammar()
    g.loads(data)
    return g


def main(*args):
    """Main program, when run as a script: produce grammar pickle files.

    Calls load_grammar for each argument, a path to a grammar text file.
    """
    if not args:
        args = sys.argv[1:]
    logging.basicConfig(level=logging.INFO, stream=sys.stdout,
                        format='%(message)s')
    for gt in args:
        load_grammar(gt, save=True, force=True)
    return True

if __name__ == "__main__":
    sys.exit(int(not main()))
lib2to3/__init__.py000064400000000007151153537460010142 0ustar00#empty
lib2to3/Grammar3.8.17.final.0.pickle000064400000035715151153537460012533 0ustar00���;}�(�
symbol2number�}�(�
file_input�M�and_expr�M�and_test�M�	annassign�M�arglist�M�argument�M�
arith_expr�M�assert_stmt�M�
async_funcdef�M�
async_stmt�M	�atom�M
�	augassign�M�
break_stmt�M�classdef�M
�comp_for�M�comp_if�M�	comp_iter�M�comp_op�M�
comparison�M�
compound_stmt�M�
continue_stmt�M�	decorated�M�	decorator�M�
decorators�M�del_stmt�M�dictsetmaker�M�dotted_as_name�M�dotted_as_names�M�dotted_name�M�
encoding_decl�M�
eval_input�M�
except_clause�M�	exec_stmt�M �expr�M!�	expr_stmt�M"�exprlist�M#�factor�M$�	flow_stmt�M%�for_stmt�M&�funcdef�M'�global_stmt�M(�if_stmt�M)�import_as_name�M*�import_as_names�M+�import_from�M,�import_name�M-�import_stmt�M.�lambdef�M/�	listmaker�M0�namedexpr_test�M1�not_test�M2�old_lambdef�M3�old_test�M4�or_test�M5�
parameters�M6�	pass_stmt�M7�power�M8�
print_stmt�M9�
raise_stmt�M:�return_stmt�M;�
shift_expr�M<�simple_stmt�M=�single_input�M>�sliceop�M?�
small_stmt�M@�	star_expr�MA�stmt�MB�	subscript�MC�
subscriptlist�MD�suite�ME�term�MF�test�MG�testlist�MH�	testlist1�MI�
testlist_gexp�MJ�
testlist_safe�MK�testlist_star_expr�ML�tfpdef�MM�tfplist�MN�tname�MO�trailer�MP�try_stmt�MQ�
typedargslist�MR�varargslist�MS�vfpdef�MT�vfplist�MU�vname�MV�
while_stmt�MW�	with_item�MX�	with_stmt�MY�with_var�MZ�xor_expr�M[�	yield_arg�M\�
yield_expr�M]�
yield_stmt�M^u�
number2symbol�}�(MhMhMhMhMhMhMh	Mh
MhM	hM
h
MhMhM
hMhMhMhMhMhMhMhMhMhMhMhMhMhMhMhMh Mh!Mh"M h#M!h$M"h%M#h&M$h'M%h(M&h)M'h*M(h+M)h,M*h-M+h.M,h/M-h0M.h1M/h2M0h3M1h4M2h5M3h6M4h7M5h8M6h9M7h:M8h;M9h<M:h=M;h>M<h?M=h@M>hAM?hBM@hCMAhDMBhEMChFMDhGMEhHMFhIMGhJMHhKMIhLMJhMMKhNMLhOMMhPMNhQMOhRMPhSMQhTMRhUMShVMThWMUhXMVhYMWhZMXh[MYh\MZh]M[h^M\h_M]h`M^hau�states�]�(]�(]�(KK��KK��KK��e]�KK��ae]�(]�K*K��a]�(K+K��KK��ee]�(]�K,K��a]�(K-K��KK��ee]�(]�K.K��a]�K/K��a]�(K0K��KK��e]�K/K��a]�KK��ae]�(]�K1K��a]�(K2K��KK��e]�(K1K��KK��ee]�(]�(KK��K3K��K/K��e]�K/K��a]�(K4K��K0K��K5K��KK��e]�KK��ae]�(]�K6K��a]�(KK��KK��KK��ee]�(]�KK��a]�K/K��a]�(K2K��KK��e]�K/K��a]�KK��ae]�(]�K%K��a]�K7K��a]�KK��ae]�(]�K%K��a]�(K8K��K7K��K9K��e]�KK��ae]�(]�(KK��KK��K
K��KK��K#K��K'K��K(K��K)K��e]�(K:K��K;K��K<K��e]�KK	��a]�(K=K��K>K
��e]�K?K��a]�(K@K��KAK��e]�KK��a]�(K)K��KK��e]�K:K��a]�KK��a]�K=K��a]�KK��a]�K@K��ae]�(]�(KBK��KCK��KDK��KEK��KFK��KGK��KHK��KIK��KJK��KKK��KLK��KMK��KNK��e]�KK��ae]�(]�K
K��a]�KK��ae]�(]�KK��a]�K'K��a]�(KK��K.K��e]�(K:K��KOK��e]�KPK��a]�K.K��a]�K:K��a]�KK��ae]�(]�(KK��K%K��e]�KQK��a]�KK��a]�KRK��a]�KSK��a]�(KTK��KK��e]�KK��ae]�(]�KK��a]�KUK��a]�(KTK��KK��e]�KK��ae]�(]�(K5K��KVK��e]�KK��ae]�(]�(KWK��KXK��KYK��KWK��KZK��K[K��K\K��KRK��K]K��KK��e]�KK��a]�(KK��KK��e]�KRK��ae]�(]�K^K��a]�(K_K��KK��ee]�(]�(K`K��KaK��KbK��K8K��K7K��KcK��KdK��KeK��K9K��e]�KK��ae]�(]�KK��a]�KK��ae]�(]�KfK��a]�(KgK��KaK��K7K��e]�KK��ae]�(]�K	K��a]�KhK��a]�(KK��KK��e]�(K:K��KOK��e]�KK��a]�KK��a]�K:K��ae]�(]�KiK��a]�(KiK��KK��ee]�(]�KK��a]�KQK��a]�KK��ae]�(]�(K3K��KjK��K/K��e]�K^K��a]�(K2K��K5K��KK��e]�(K2K��K.K��K5K��KK��e]�(K2K��K5K��KK��e]�(KjK	��K/K	��KK��e]�KK��a]�K/K��a]�(K3K
��K/K��KK��e]�(K2K��KK	��e]�K^K��a]�K.K
��a]�(K2K��KK��e]�K/K��ae]�(]�KhK��a]�(KkK��KK��e]�K'K��a]�KK��ae]�(]�KlK��a]�(K2K��KK��ee]�(]�K'K��a]�(KK��KK��ee]�(]�K'K��a]�KK��ae]�(]�KmK��a]�(KK��KK��e]�KK��ae]�(]�KnK��a]�(K/K��KK��e]�(K2K��KkK��KK��e]�K/K��a]�KK��ae]�(]�KK��a]�K^K��a]�(KRK��KK��e]�K/K��a]�(K2K��KK��e]�K/K��a]�KK��ae]�(]�KoK��a]�(KpK��KK��ee]�(]�KqK��a]�(K0K��KrK��KsK��KK��e]�(KqK��K<K��e]�KK��a]�(KmK��K<K��e]�(K0K��KK��ee]�(]�(K^K��KjK��e]�(K2K��KK��e]�(K^K��KjK��KK��ee]�(]�(KK��KK��K$K��KtK��e]�KuK��a]�KK��ae]�(]�(KvK��KwK��KxK��KyK��KzK��e]�KK��ae]�(]�KK��a]�KQK��a]�KRK��a]�KmK��a]�K.K��a]�KPK��a]�(K{K��KK��e]�K.K��a]�KPK	��a]�KK	��ae]�(]�KK��a]�K'K��a]�K|K��a]�(K}K��K.K��e]�K/K��a]�KPK��a]�K.K��a]�KK��ae]�(]�(KK��KK��e]�K'K��a]�(K2K��KK��ee]�(]�KK��a]�K~K��a]�K.K��a]�KPK��a]�(KK��K{K��KK��e]�K.K��a]�KPK��a]�KK��ae]�(]�K'K��a]�(KkK��KK��e]�K'K��a]�KK��ae]�(]�K�K��a]�(K2K��KK��e]�(K�K��KK��ee]�(]�KK��a]�(KK��KhK��e]�(KK��KK��KhK��e]�KK��a]�(KK��KK��K�K��e]�K�K��a]�KK��a]�K:K��ae]�(]�KK��a]�K�K��a]�KK��ae]�(]�(K�K��K�K��e]�KK��ae]�(]�KK��a]�(K.K��K�K��e]�K/K��a]�K.K��a]�KK��ae]�(]�(K~K��KjK��e]�(K2K��K5K��KK��e]�(K~K��KjK��KK��e]�KK��a]�(K2K��KK��ee]�(]�K/K��a]�(K4K��KK��e]�K/K��a]�KK��ae]�(]�(KK��K�K��e]�K,K��a]�KK��ae]�(]�KK��a]�(K.K��K�K��e]�KUK��a]�K.K��a]�KK��ae]�(]�(K�K��K�K��e]�KK��ae]�(]�K�K��a]�(K�K��KK��ee]�(]�KK��a]�(K:K��K�K��e]�KK��a]�K:K��ae]�(]�KK��a]�KK��ae]�(]�(K&K��K�K��e]�K�K��a]�(K3K��K�K��KK��e]�KuK��a]�KK��ae]�(]�KK��a]�(K�K��K/K��KK��e]�K/K��a]�(K2K��KK��e]�(K2K��KK��e]�(K/K��KK��e]�K/K��a]�(K2K��KK��e]�(K/K��KK��ee]�(]�KK��a]�(K/K��KK��e]�(K2K��KK��KK��e]�K/K��a]�K/K��a]�(K2K��KK��e]�KK��ae]�(]�KK��a]�(KmK��KK��e]�KK��ae]�(]�K�K��a]�(K�K��K�K��KK��ee]�(]�K�K��a]�(K�K��KK��e]�(KK��K�K��e]�KK��ae]�(]�(KK��K�K��K�K��e]�KK��a]�KK��ae]�(]�K.K��a]�(K/K��KK��e]�KK��ae]�(]�(K�K��K�K��K�K��K�K��K�K��K�K��K�K��K�K��K�K��e]�KK��ae]�(]�KK��a]�K^K��a]�KK��ae]�(]�(K�K��K�K��e]�KK��ae]�(]�(K.K��K/K��e]�(K�K��K/K��KK��e]�(K.K��KK��e]�KK��a]�(K�K��KK��ee]�(]�K�K��a]�(K2K��KK��e]�(K�K��KK��ee]�(]�(KK��K�K��e]�K�K��a]�KK��a]�KK��a]�(K�K��KK��ee]�(]�KuK��a]�(K�K��KK��K�K��K�K��K	K��KK��ee]�(]�(K�K��K�K��e]�KK��a]�(KK��KK��e]�K�K��a]�K{K��a]�K/K��ae]�(]�K/K��a]�(K2K��KK��e]�(K/K��KK��ee]�(]�K/K��a]�(K2K��KK��ee]�(]�(K~K��KjK��e]�(K2K��K5K��KK��e]�(K~K��KjK��KK��e]�KK��a]�(K2K��KK��ee]�(]�KUK��a]�(K2K��KK��e]�KUK��a]�(K2K��KK��e]�(KUK��KK��ee]�(]�(KjK��K/K��e]�(K2K��KK��e]�(KjK��K/K��KK��ee]�(]�(KK��K�K��e]�K�K��a]�KK��a]�K:K��ae]�(]�K�K��a]�(K2K��KK��e]�(K�K��KK��ee]�(]�K'K��a]�(K.K��KK��e]�K/K��a]�KK��ae]�(]�(KK��KK��K
K��e]�(K:K��KOK��e]�K'K��a]�K�K��a]�KK��a]�K:K��a]�K=K��ae]�(]�KK��a]�K.K��a]�KPK��a]�(K�K��K�K��e]�K.K��a]�K.K��a]�KPK��a]�KPK	��a]�KK��a]�(K{K
��K�K��K�K��KK	��e]�K.K��a]�KPK��a]�(K�K��KK��ee]�(]�(KK��K3K��K�K��e]�(K2K��K�K��KK��e]�K�K��a]�(K2K��K0K��KK��e]�(K3K��K�K	��KK��e]�(K2K��KK��e]�(K2K
��KK��e]�(KK��K3K��K�K��K�K��KK��e]�K/K��a]�(K2K��K0K
��KK	��e]�KK
��a]�(K2K��KK��e]�(K2K��KK��e]�K/K��a]�(KK��K3K��K�K��KK��e]�(K2K��K�K��KK��e]�(K2K��K0K��KK��e]�(K3K��K�K��KK��e]�(K2K��KK��e]�K/K��a]�(K2K��K0K��KK��e]�K/K��ae]�(]�(KK��K3K��K�K��e]�(K2K��K�K��KK��e]�K�K��a]�(K2K��K0K��KK��e]�(K3K��K�K	��KK��e]�(K2K��KK��e]�(K2K
��KK��e]�(KK��K3K��K�K��K�K��KK��e]�K/K��a]�(K2K��K0K
��KK	��e]�KK
��a]�(K2K��KK��e]�(K2K��KK��e]�K/K��a]�(KK��K3K��K�K��KK��e]�(K2K��K�K��KK��e]�(K2K��K0K��KK��e]�(K3K��K�K��KK��e]�(K2K��KK��e]�K/K��a]�(K2K��K0K��KK��e]�K/K��ae]�(]�(KK��K�K��e]�K�K��a]�KK��a]�K:K��ae]�(]�K�K��a]�(K2K��KK��e]�(K�K��KK��ee]�(]�K'K��a]�KK��ae]�(]�K K��a]�K~K��a]�K.K��a]�KPK��a]�(K{K��KK��e]�K.K��a]�KPK��a]�KK��ae]�(]�K/K��a]�(KkK��KK��e]�K^K��a]�KK��ae]�(]�K!K��a]�K�K��a]�(K2K��K.K��e]�KPK��a]�KK��ae]�(]�KkK��a]�K^K��a]�KK��ae]�(]�K�K��a]�(K�K��KK��ee]�(]�(KK��KmK��e]�K/K��a]�KK��ae]�(]�K"K��a]�(K�K��KK��e]�KK��ae]�(]�K<K��a]�KK��aee�dfas�}�(Mhf}�(KKKKKKKKKKK	KK
KKKKKK
KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK KK!KK"KK#KK$KK%KK&KKKK'KKKK(KK)Ku��Mhm}�(KKKKKKKKK
KKKK#KK$KK&KK'KK(KK)Ku��Mhs}�(KKKKKKKKK
KKKKKK#KK$KK&KK'KK(KK)Ku��Mhy}�K.Ks��Mh�}�(KKKKK3KKKKKKKK
KKKKKKKK#KK$KK&KK'KK(KK)Ku��Mh�}�(KKKKK3KKKKKKKK
KKKKKKKK#KK$KK&KK'KK(KK)Ku��Mh�}�(KKKKKKKKK
KKKK#KK$KK&KK'KK(KK)Ku��Mh�}�KKs��Mh�}�K%Ks��M	h�}�K%Ks��M
h�}�(KKKKK
KKKK#KK'KK(KK)Ku��Mh�}�(KBKKCKKDKKEKKFKKGKKHKKIKKJKKKKKLKKMKKNKu��Mh�}�K
Ks��M
h�}�KKs��Mj}�(KKK%Ku��Mj }�KKs��Mj*}�(KKKKK%Ku��Mj0}�(KWKKXKKYKKZKK[KK\KKRKK]KKKu��MjC}�(KKKKKKKKK
KKKK#KK$KK&KK'KK(KK)Ku��MjI}�(K	KKKKKKKKKKKK KK!KK%Ku��MjV}�KKs��Mj[}�K	Ks��Mjd}�K	Ks��Mju}�K	Ks��Mj{}�KKs��Mj�}�(KKKKK3KKKKKKKK
KKKKKKKK#KK$KK&KK'KK(KK)Ku��Mj�}�K'Ks��Mj�}�K'Ks��Mj�}�K'Ks��Mj�}�K'Ks��Mj�}�(KKKKKKKKK
KKKKKKKK#KK$KK&KK'KK(KK)Ku��Mj�}�KnKs��M j�}�KKs��M!j�}�(KKKKKKKKK
KKKK#KK$KK&KK'KK(KK)Ku��M"j�}�(KKKKKKKKKKK
KKKKKKKK#KK$KK&KK'KK(KK)Ku��M#j	}�(KKKKKKKKKKK
KKKK#KK$KK&KK'KK(KK)Ku��M$j}�(KKKKKKKKK
KKKK#KK$KK&KK'KK(KK)Ku��M%j}�(K
KKKKKKKK"Ku��M&j'}�KKs��M'j=}�KKs��M(jO}�(KKKKu��M)jX}�KKs��M*jk}�K'Ks��M+ju}�K'Ks��M,j~}�KKs��M-j�}�KKs��M.j�}�(KKKKu��M/j�}�KKs��M0j�}�(KKKKKKKKKKK
KKKKKKKK#KK$KK&KK'KK(KK)Ku��M1j�}�(KKKKKKKKK
KKKKKKKK#KK$KK&KK'KK(KK)Ku��M2j�}�(KKKKKKKKK
KKKKKK#KK$KK&KK'KK(KK)Ku��M3j�}�KKs��M4j�}�(KKKKKKKKK
KKKKKKKK#KK$KK&KK'KK(KK)Ku��M5j�}�(KKKKKKKKK
KKKKKK#KK$KK&KK'KK(KK)Ku��M6j�}�KKs��M7j�}�KKs��M8j�}�(KKKKK
KKKK#KK&KK'KK(KK)Ku��M9j}�KKs��M:j}�KKs��M;j2}�KKs��M<j:}�(KKKKKKKKK
KKKK#KK$KK&KK'KK(KK)Ku��M=jA}�(KKKKKKKKKKK
KKKKKK
KKKKKKKKKKKKKKKKKKKKKKKKKKKK"KK#KK$KK&KK'KK(KK)Ku��M>jL}�(KKKKKKKKKKK	KK
KKKKKK
KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK KK!KK"KK#KK$KK%KK&KK'KKKK(KK)Ku��M?jU}�K.Ks��M@j]}�(KKKKKKKKKKK
KKKKKK
KKKKKKKKKKKKKKKKKKKKKKKKKKKK"KK#KK$KK&KK'KK(KK)Ku��MAjj}�KKs��MBjq}�(KKKKKKKKKKK	KK
KKKKKK
KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK KK!KK"KK#KK$KK%KK&KK'KK(KK)Ku��MCjw}�(KKKKKKKKK.KK
KKKKKKKK#KK$KK&KK'KK(KK)Ku��MDj�}�(KKKKKKKKK.KK
KKKKKKKK#KK$KK&KK'KK(KK)Ku��MEj�}�(KKKKKKKKKKK
KKKKKK
KKKKKKKKKKKKKKKKKKKKKKKKKKKK"KK#KK$KK&KK'KKKK(KK)Ku��MFj�}�(KKKKKKKKK
KKKK#KK$KK&KK'KK(KK)Ku��MGj�}�(KKKKKKKKK
KKKKKKKK#KK$KK&KK'KK(KK)Ku��MHj�}�(KKKKKKKKK
KKKKKKKK#KK$KK&KK'KK(KK)Ku��MIj�}�(KKKKKKKKK
KKKKKKKK#KK$KK&KK'KK(KK)Ku��MJj�}�(KKKKKKKKKKK
KKKKKKKK#KK$KK&KK'KK(KK)Ku��MKj�}�(KKKKKKKKK
KKKKKKKK#KK$KK&KK'KK(KK)Ku��MLj�}�(KKKKKKKKKKK
KKKKKKKK#KK$KK&KK'KK(KK)Ku��MMj�}�(KKK'Ku��MNj�}�(KKK'Ku��MOj}�K'Ks��MPj}�(KKKKK
Ku��MQj}�KKs��MRj>}�(KKKKK3KK'Ku��MSj�}�(KKKKK3KK'Ku��MTj�}�(KKK'Ku��MUj�}�(KKK'Ku��MVj�}�K'Ks��MWj�}�K Ks��MXj�}�(KKKKKKKKK
KKKKKKKK#KK$KK&KK'KK(KK)Ku��MYj}�K!Ks��MZj}�KkKs��M[j}�(KKKKKKKKK
KKKK#KK$KK&KK'KK(KK)Ku��M\j!}�(KKKKKKKKK
KKKKKKKKKK#KK$KK&KK'KK(KK)Ku��M]j)}�K"Ks��M^j1}�K"Ks��u�labels�]�(K�EMPTY���KN��KN��MBN��KN��KN��KN��KN��KN��K2N��K	N��KN��K�assert���K�break���K�class���K�continue���K�def���K�del���K�exec���K�for���K�from���K�global���K�if���K�import���K�lambda���K�nonlocal���K�not���K�pass���K�print���K�raise���K�return���K�try���K�while���K�with���K�yield���KN��K N��K9N��K8N��KN��KN��KN��M<N��KN��M2N��K�and���KN��MGN��KN��MN��KN��K$N��K;N��MN��MFN��M'N��M&N��MYN��KN��MJN��M]N��K
N��M0N��MIN��KN��MN��K)N��K*N��K/N��K'N��K%N��K&N��K1N��K(N��K-N��K.N��K3N��K,N��K+N��MN��MEN��M#N��K�in���MKN��MN��M4N��MN��KN��KN��KN��KN��KN��KN��K�is���M!N��MN��M	N��M
N��MN��M)N��MQN��MWN��MN��MN��MN��MN��MAN��K�as���MN��MHN��K�except���M[N��KN��MLN��MN��MN��M8N��M$N��MN��MN��M:N��M;N��M^N��K�else���M6N��K7N��M1N��K�elif���M*N��M+N��MN��M,N��M-N��MSN��MN��M3N��M5N��MN��K�or���MRN��M
N��MPN��K#N��MN��K"N��M@N��K
N��MN��M=N��MN��MN��M N��M"N��M%N��M(N��M.N��M7N��M9N��M?N��MCN��KN��KN��KN��KN��K0N��M/N��MON��MNN��MMN��MDN��K�finally���MN��MTN��MVN��MUN��MXN��MN��K!N��M\N��e�keywords�}�(jKjK
j	KjKj
KjKjKjKjKjKjKjKjKjKj!Kj#Kj%Kj'Kj)Kj+Kj-K j/K!j1K"j=K-jcKRjoK]j~Kkj�Knj�K{j�Kj�K�j�K�u�tokens�}�(KKKKKKKKKKKKKKK2K	K	K
KKKK#K K$K9K%K8K&KK'KK(KK)KK+KK.KK0KK2K$K3K;K4KK:K
K=KK@K)KBK*KCK/KDK'KEK%KFK&KGK1KHK(KIK-KJK.KKK3KLK,KMK+KNKKWKKXKKYKKZKK[KK\KKpK7K}K#K�K"K�K
K�KK�KK�KK�KK�K0K�K!K�u�symbol2label�}�(�stmt�K�
shift_expr�K*�not_test�K,�test�K/�argument�K1�comp_for�K5�term�K6�funcdef�K7�for_stmt�K8�	with_stmt�K9�
testlist_gexp�K;�
yield_expr�K<�	listmaker�K>�	testlist1�K?�dictsetmaker�KA�arglist�KO�suite�KP�exprlist�KQ�
testlist_safe�KS�	comp_iter�KT�old_test�KU�comp_if�KV�expr�K^�comp_op�K_�
async_stmt�K`�classdef�Ka�	decorated�Kb�if_stmt�Kc�try_stmt�Kd�
while_stmt�Ke�
decorators�Kf�
async_funcdef�Kg�dotted_name�Kh�	decorator�Ki�	star_expr�Kj�dotted_as_name�Kl�testlist�Km�xor_expr�Ko�testlist_star_expr�Kq�	annassign�Kr�	augassign�Ks�power�Kt�factor�Ku�
break_stmt�Kv�
continue_stmt�Kw�
raise_stmt�Kx�return_stmt�Ky�
yield_stmt�Kz�
parameters�K|�namedexpr_test�K~�import_as_name�K��import_as_names�K��dotted_as_names�K��import_from�K��import_name�K��varargslist�K��
comparison�K��old_lambdef�K��or_test�K��and_test�K��
typedargslist�K��atom�K��trailer�K��
arith_expr�K��
small_stmt�K��
compound_stmt�K��simple_stmt�K��assert_stmt�K��del_stmt�K��	exec_stmt�K��	expr_stmt�K��	flow_stmt�K��global_stmt�K��import_stmt�K��	pass_stmt�K��
print_stmt�K��sliceop�K��	subscript�K��lambdef�K��tname�K��tfplist�K��tfpdef�K��
subscriptlist�K��
except_clause�K��vfpdef�K��vname�K��vfplist�K��	with_item�K��and_expr�K��	yield_arg�K�u�start�Mu.lib2to3/main.py000064400000026605151153537460007343 0ustar00"""
Main program for 2to3.
"""

from __future__ import with_statement, print_function

import sys
import os
import difflib
import logging
import shutil
import optparse

from . import refactor


def diff_texts(a, b, filename):
    """Return a unified diff of two strings."""
    a = a.splitlines()
    b = b.splitlines()
    return difflib.unified_diff(a, b, filename, filename,
                                "(original)", "(refactored)",
                                lineterm="")


class StdoutRefactoringTool(refactor.MultiprocessRefactoringTool):
    """
    A refactoring tool that can avoid overwriting its input files.
    Prints output to stdout.

    Output files can optionally be written to a different directory and or
    have an extra file suffix appended to their name for use in situations
    where you do not want to replace the input files.
    """

    def __init__(self, fixers, options, explicit, nobackups, show_diffs,
                 input_base_dir='', output_dir='', append_suffix=''):
        """
        Args:
            fixers: A list of fixers to import.
            options: A dict with RefactoringTool configuration.
            explicit: A list of fixers to run even if they are explicit.
            nobackups: If true no backup '.bak' files will be created for those
                files that are being refactored.
            show_diffs: Should diffs of the refactoring be printed to stdout?
            input_base_dir: The base directory for all input files.  This class
                will strip this path prefix off of filenames before substituting
                it with output_dir.  Only meaningful if output_dir is supplied.
                All files processed by refactor() must start with this path.
            output_dir: If supplied, all converted files will be written into
                this directory tree instead of input_base_dir.
            append_suffix: If supplied, all files output by this tool will have
                this appended to their filename.  Useful for changing .py to
                .py3 for example by passing append_suffix='3'.
        """
        self.nobackups = nobackups
        self.show_diffs = show_diffs
        if input_base_dir and not input_base_dir.endswith(os.sep):
            input_base_dir += os.sep
        self._input_base_dir = input_base_dir
        self._output_dir = output_dir
        self._append_suffix = append_suffix
        super(StdoutRefactoringTool, self).__init__(fixers, options, explicit)

    def log_error(self, msg, *args, **kwargs):
        self.errors.append((msg, args, kwargs))
        self.logger.error(msg, *args, **kwargs)

    def write_file(self, new_text, filename, old_text, encoding):
        orig_filename = filename
        if self._output_dir:
            if filename.startswith(self._input_base_dir):
                filename = os.path.join(self._output_dir,
                                        filename[len(self._input_base_dir):])
            else:
                raise ValueError('filename %s does not start with the '
                                 'input_base_dir %s' % (
                                         filename, self._input_base_dir))
        if self._append_suffix:
            filename += self._append_suffix
        if orig_filename != filename:
            output_dir = os.path.dirname(filename)
            if not os.path.isdir(output_dir) and output_dir:
                os.makedirs(output_dir)
            self.log_message('Writing converted %s to %s.', orig_filename,
                             filename)
        if not self.nobackups:
            # Make backup
            backup = filename + ".bak"
            if os.path.lexists(backup):
                try:
                    os.remove(backup)
                except OSError as err:
                    self.log_message("Can't remove backup %s", backup)
            try:
                os.rename(filename, backup)
            except OSError as err:
                self.log_message("Can't rename %s to %s", filename, backup)
        # Actually write the new file
        write = super(StdoutRefactoringTool, self).write_file
        write(new_text, filename, old_text, encoding)
        if not self.nobackups:
            shutil.copymode(backup, filename)
        if orig_filename != filename:
            # Preserve the file mode in the new output directory.
            shutil.copymode(orig_filename, filename)

    def print_output(self, old, new, filename, equal):
        if equal:
            self.log_message("No changes to %s", filename)
        else:
            self.log_message("Refactored %s", filename)
            if self.show_diffs:
                diff_lines = diff_texts(old, new, filename)
                try:
                    if self.output_lock is not None:
                        with self.output_lock:
                            for line in diff_lines:
                                print(line)
                            sys.stdout.flush()
                    else:
                        for line in diff_lines:
                            print(line)
                except UnicodeEncodeError:
                    warn("couldn't encode %s's diff for your terminal" %
                         (filename,))
                    return

def warn(msg):
    print("WARNING: %s" % (msg,), file=sys.stderr)


def main(fixer_pkg, args=None):
    """Main program.

    Args:
        fixer_pkg: the name of a package where the fixers are located.
        args: optional; a list of command line arguments. If omitted,
              sys.argv[1:] is used.

    Returns a suggested exit status (0, 1, 2).
    """
    # Set up option parser
    parser = optparse.OptionParser(usage="2to3 [options] file|dir ...")
    parser.add_option("-d", "--doctests_only", action="store_true",
                      help="Fix up doctests only")
    parser.add_option("-f", "--fix", action="append", default=[],
                      help="Each FIX specifies a transformation; default: all")
    parser.add_option("-j", "--processes", action="store", default=1,
                      type="int", help="Run 2to3 concurrently")
    parser.add_option("-x", "--nofix", action="append", default=[],
                      help="Prevent a transformation from being run")
    parser.add_option("-l", "--list-fixes", action="store_true",
                      help="List available transformations")
    parser.add_option("-p", "--print-function", action="store_true",
                      help="Modify the grammar so that print() is a function")
    parser.add_option("-v", "--verbose", action="store_true",
                      help="More verbose logging")
    parser.add_option("--no-diffs", action="store_true",
                      help="Don't show diffs of the refactoring")
    parser.add_option("-w", "--write", action="store_true",
                      help="Write back modified files")
    parser.add_option("-n", "--nobackups", action="store_true", default=False,
                      help="Don't write backups for modified files")
    parser.add_option("-o", "--output-dir", action="store", type="str",
                      default="", help="Put output files in this directory "
                      "instead of overwriting the input files.  Requires -n.")
    parser.add_option("-W", "--write-unchanged-files", action="store_true",
                      help="Also write files even if no changes were required"
                      " (useful with --output-dir); implies -w.")
    parser.add_option("--add-suffix", action="store", type="str", default="",
                      help="Append this string to all output filenames."
                      " Requires -n if non-empty.  "
                      "ex: --add-suffix='3' will generate .py3 files.")

    # Parse command line arguments
    refactor_stdin = False
    flags = {}
    options, args = parser.parse_args(args)
    if options.write_unchanged_files:
        flags["write_unchanged_files"] = True
        if not options.write:
            warn("--write-unchanged-files/-W implies -w.")
        options.write = True
    # If we allowed these, the original files would be renamed to backup names
    # but not replaced.
    if options.output_dir and not options.nobackups:
        parser.error("Can't use --output-dir/-o without -n.")
    if options.add_suffix and not options.nobackups:
        parser.error("Can't use --add-suffix without -n.")

    if not options.write and options.no_diffs:
        warn("not writing files and not printing diffs; that's not very useful")
    if not options.write and options.nobackups:
        parser.error("Can't use -n without -w")
    if options.list_fixes:
        print("Available transformations for the -f/--fix option:")
        for fixname in refactor.get_all_fix_names(fixer_pkg):
            print(fixname)
        if not args:
            return 0
    if not args:
        print("At least one file or directory argument required.", file=sys.stderr)
        print("Use --help to show usage.", file=sys.stderr)
        return 2
    if "-" in args:
        refactor_stdin = True
        if options.write:
            print("Can't write to stdin.", file=sys.stderr)
            return 2
    if options.print_function:
        flags["print_function"] = True

    # Set up logging handler
    level = logging.DEBUG if options.verbose else logging.INFO
    logging.basicConfig(format='%(name)s: %(message)s', level=level)
    logger = logging.getLogger('lib2to3.main')

    # Initialize the refactoring tool
    avail_fixes = set(refactor.get_fixers_from_package(fixer_pkg))
    unwanted_fixes = set(fixer_pkg + ".fix_" + fix for fix in options.nofix)
    explicit = set()
    if options.fix:
        all_present = False
        for fix in options.fix:
            if fix == "all":
                all_present = True
            else:
                explicit.add(fixer_pkg + ".fix_" + fix)
        requested = avail_fixes.union(explicit) if all_present else explicit
    else:
        requested = avail_fixes.union(explicit)
    fixer_names = requested.difference(unwanted_fixes)
    input_base_dir = os.path.commonprefix(args)
    if (input_base_dir and not input_base_dir.endswith(os.sep)
        and not os.path.isdir(input_base_dir)):
        # One or more similar names were passed, their directory is the base.
        # os.path.commonprefix() is ignorant of path elements, this corrects
        # for that weird API.
        input_base_dir = os.path.dirname(input_base_dir)
    if options.output_dir:
        input_base_dir = input_base_dir.rstrip(os.sep)
        logger.info('Output in %r will mirror the input directory %r layout.',
                    options.output_dir, input_base_dir)
    rt = StdoutRefactoringTool(
            sorted(fixer_names), flags, sorted(explicit),
            options.nobackups, not options.no_diffs,
            input_base_dir=input_base_dir,
            output_dir=options.output_dir,
            append_suffix=options.add_suffix)

    # Refactor all files and directories passed as arguments
    if not rt.errors:
        if refactor_stdin:
            rt.refactor_stdin()
        else:
            try:
                rt.refactor(args, options.write, options.doctests_only,
                            options.processes)
            except refactor.MultiprocessingUnsupported:
                assert options.processes > 1
                print("Sorry, -j isn't supported on this platform.",
                      file=sys.stderr)
                return 1
        rt.summarize()

    # Return error status (0 if rt.errors is zero)
    return int(bool(rt.errors))
lib2to3/refactor.py000064400000065407151153537460010227 0ustar00# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Refactoring framework.

Used as a main program, this can refactor any number of files and/or
recursively descend down directories.  Imported as a module, this
provides infrastructure to write your own refactoring tool.
"""

__author__ = "Guido van Rossum <guido@python.org>"


# Python imports
import io
import os
import pkgutil
import sys
import logging
import operator
import collections
from itertools import chain

# Local imports
from .pgen2 import driver, tokenize, token
from .fixer_util import find_root
from . import pytree, pygram
from . import btm_matcher as bm


def get_all_fix_names(fixer_pkg, remove_prefix=True):
    """Return a sorted list of all available fix names in the given package."""
    pkg = __import__(fixer_pkg, [], [], ["*"])
    fix_names = []
    for finder, name, ispkg in pkgutil.iter_modules(pkg.__path__):
        if name.startswith("fix_"):
            if remove_prefix:
                name = name[4:]
            fix_names.append(name)
    return fix_names


class _EveryNode(Exception):
    pass


def _get_head_types(pat):
    """ Accepts a pytree Pattern Node and returns a set
        of the pattern types which will match first. """

    if isinstance(pat, (pytree.NodePattern, pytree.LeafPattern)):
        # NodePatters must either have no type and no content
        #   or a type and content -- so they don't get any farther
        # Always return leafs
        if pat.type is None:
            raise _EveryNode
        return {pat.type}

    if isinstance(pat, pytree.NegatedPattern):
        if pat.content:
            return _get_head_types(pat.content)
        raise _EveryNode # Negated Patterns don't have a type

    if isinstance(pat, pytree.WildcardPattern):
        # Recurse on each node in content
        r = set()
        for p in pat.content:
            for x in p:
                r.update(_get_head_types(x))
        return r

    raise Exception("Oh no! I don't understand pattern %s" %(pat))


def _get_headnode_dict(fixer_list):
    """ Accepts a list of fixers and returns a dictionary
        of head node type --> fixer list.  """
    head_nodes = collections.defaultdict(list)
    every = []
    for fixer in fixer_list:
        if fixer.pattern:
            try:
                heads = _get_head_types(fixer.pattern)
            except _EveryNode:
                every.append(fixer)
            else:
                for node_type in heads:
                    head_nodes[node_type].append(fixer)
        else:
            if fixer._accept_type is not None:
                head_nodes[fixer._accept_type].append(fixer)
            else:
                every.append(fixer)
    for node_type in chain(pygram.python_grammar.symbol2number.values(),
                           pygram.python_grammar.tokens):
        head_nodes[node_type].extend(every)
    return dict(head_nodes)


def get_fixers_from_package(pkg_name):
    """
    Return the fully qualified names for fixers in the package pkg_name.
    """
    return [pkg_name + "." + fix_name
            for fix_name in get_all_fix_names(pkg_name, False)]

def _identity(obj):
    return obj


def _detect_future_features(source):
    have_docstring = False
    gen = tokenize.generate_tokens(io.StringIO(source).readline)
    def advance():
        tok = next(gen)
        return tok[0], tok[1]
    ignore = frozenset({token.NEWLINE, tokenize.NL, token.COMMENT})
    features = set()
    try:
        while True:
            tp, value = advance()
            if tp in ignore:
                continue
            elif tp == token.STRING:
                if have_docstring:
                    break
                have_docstring = True
            elif tp == token.NAME and value == "from":
                tp, value = advance()
                if tp != token.NAME or value != "__future__":
                    break
                tp, value = advance()
                if tp != token.NAME or value != "import":
                    break
                tp, value = advance()
                if tp == token.OP and value == "(":
                    tp, value = advance()
                while tp == token.NAME:
                    features.add(value)
                    tp, value = advance()
                    if tp != token.OP or value != ",":
                        break
                    tp, value = advance()
            else:
                break
    except StopIteration:
        pass
    return frozenset(features)


class FixerError(Exception):
    """A fixer could not be loaded."""


class RefactoringTool(object):

    _default_options = {"print_function" : False,
                        "write_unchanged_files" : False}

    CLASS_PREFIX = "Fix" # The prefix for fixer classes
    FILE_PREFIX = "fix_" # The prefix for modules with a fixer within

    def __init__(self, fixer_names, options=None, explicit=None):
        """Initializer.

        Args:
            fixer_names: a list of fixers to import
            options: a dict with configuration.
            explicit: a list of fixers to run even if they are explicit.
        """
        self.fixers = fixer_names
        self.explicit = explicit or []
        self.options = self._default_options.copy()
        if options is not None:
            self.options.update(options)
        if self.options["print_function"]:
            self.grammar = pygram.python_grammar_no_print_statement
        else:
            self.grammar = pygram.python_grammar
        # When this is True, the refactor*() methods will call write_file() for
        # files processed even if they were not changed during refactoring. If
        # and only if the refactor method's write parameter was True.
        self.write_unchanged_files = self.options.get("write_unchanged_files")
        self.errors = []
        self.logger = logging.getLogger("RefactoringTool")
        self.fixer_log = []
        self.wrote = False
        self.driver = driver.Driver(self.grammar,
                                    convert=pytree.convert,
                                    logger=self.logger)
        self.pre_order, self.post_order = self.get_fixers()


        self.files = []  # List of files that were or should be modified

        self.BM = bm.BottomMatcher()
        self.bmi_pre_order = [] # Bottom Matcher incompatible fixers
        self.bmi_post_order = []

        for fixer in chain(self.post_order, self.pre_order):
            if fixer.BM_compatible:
                self.BM.add_fixer(fixer)
                # remove fixers that will be handled by the bottom-up
                # matcher
            elif fixer in self.pre_order:
                self.bmi_pre_order.append(fixer)
            elif fixer in self.post_order:
                self.bmi_post_order.append(fixer)

        self.bmi_pre_order_heads = _get_headnode_dict(self.bmi_pre_order)
        self.bmi_post_order_heads = _get_headnode_dict(self.bmi_post_order)



    def get_fixers(self):
        """Inspects the options to load the requested patterns and handlers.

        Returns:
          (pre_order, post_order), where pre_order is the list of fixers that
          want a pre-order AST traversal, and post_order is the list that want
          post-order traversal.
        """
        pre_order_fixers = []
        post_order_fixers = []
        for fix_mod_path in self.fixers:
            mod = __import__(fix_mod_path, {}, {}, ["*"])
            fix_name = fix_mod_path.rsplit(".", 1)[-1]
            if fix_name.startswith(self.FILE_PREFIX):
                fix_name = fix_name[len(self.FILE_PREFIX):]
            parts = fix_name.split("_")
            class_name = self.CLASS_PREFIX + "".join([p.title() for p in parts])
            try:
                fix_class = getattr(mod, class_name)
            except AttributeError:
                raise FixerError("Can't find %s.%s" % (fix_name, class_name)) from None
            fixer = fix_class(self.options, self.fixer_log)
            if fixer.explicit and self.explicit is not True and \
                    fix_mod_path not in self.explicit:
                self.log_message("Skipping optional fixer: %s", fix_name)
                continue

            self.log_debug("Adding transformation: %s", fix_name)
            if fixer.order == "pre":
                pre_order_fixers.append(fixer)
            elif fixer.order == "post":
                post_order_fixers.append(fixer)
            else:
                raise FixerError("Illegal fixer order: %r" % fixer.order)

        key_func = operator.attrgetter("run_order")
        pre_order_fixers.sort(key=key_func)
        post_order_fixers.sort(key=key_func)
        return (pre_order_fixers, post_order_fixers)

    def log_error(self, msg, *args, **kwds):
        """Called when an error occurs."""
        raise

    def log_message(self, msg, *args):
        """Hook to log a message."""
        if args:
            msg = msg % args
        self.logger.info(msg)

    def log_debug(self, msg, *args):
        if args:
            msg = msg % args
        self.logger.debug(msg)

    def print_output(self, old_text, new_text, filename, equal):
        """Called with the old version, new version, and filename of a
        refactored file."""
        pass

    def refactor(self, items, write=False, doctests_only=False):
        """Refactor a list of files and directories."""

        for dir_or_file in items:
            if os.path.isdir(dir_or_file):
                self.refactor_dir(dir_or_file, write, doctests_only)
            else:
                self.refactor_file(dir_or_file, write, doctests_only)

    def refactor_dir(self, dir_name, write=False, doctests_only=False):
        """Descends down a directory and refactor every Python file found.

        Python files are assumed to have a .py extension.

        Files and subdirectories starting with '.' are skipped.
        """
        py_ext = os.extsep + "py"
        for dirpath, dirnames, filenames in os.walk(dir_name):
            self.log_debug("Descending into %s", dirpath)
            dirnames.sort()
            filenames.sort()
            for name in filenames:
                if (not name.startswith(".") and
                    os.path.splitext(name)[1] == py_ext):
                    fullname = os.path.join(dirpath, name)
                    self.refactor_file(fullname, write, doctests_only)
            # Modify dirnames in-place to remove subdirs with leading dots
            dirnames[:] = [dn for dn in dirnames if not dn.startswith(".")]

    def _read_python_source(self, filename):
        """
        Do our best to decode a Python source file correctly.
        """
        try:
            f = open(filename, "rb")
        except OSError as err:
            self.log_error("Can't open %s: %s", filename, err)
            return None, None
        try:
            encoding = tokenize.detect_encoding(f.readline)[0]
        finally:
            f.close()
        with io.open(filename, "r", encoding=encoding, newline='') as f:
            return f.read(), encoding

    def refactor_file(self, filename, write=False, doctests_only=False):
        """Refactors a file."""
        input, encoding = self._read_python_source(filename)
        if input is None:
            # Reading the file failed.
            return
        input += "\n" # Silence certain parse errors
        if doctests_only:
            self.log_debug("Refactoring doctests in %s", filename)
            output = self.refactor_docstring(input, filename)
            if self.write_unchanged_files or output != input:
                self.processed_file(output, filename, input, write, encoding)
            else:
                self.log_debug("No doctest changes in %s", filename)
        else:
            tree = self.refactor_string(input, filename)
            if self.write_unchanged_files or (tree and tree.was_changed):
                # The [:-1] is to take off the \n we added earlier
                self.processed_file(str(tree)[:-1], filename,
                                    write=write, encoding=encoding)
            else:
                self.log_debug("No changes in %s", filename)

    def refactor_string(self, data, name):
        """Refactor a given input string.

        Args:
            data: a string holding the code to be refactored.
            name: a human-readable name for use in error/log messages.

        Returns:
            An AST corresponding to the refactored input stream; None if
            there were errors during the parse.
        """
        features = _detect_future_features(data)
        if "print_function" in features:
            self.driver.grammar = pygram.python_grammar_no_print_statement
        try:
            tree = self.driver.parse_string(data)
        except Exception as err:
            self.log_error("Can't parse %s: %s: %s",
                           name, err.__class__.__name__, err)
            return
        finally:
            self.driver.grammar = self.grammar
        tree.future_features = features
        self.log_debug("Refactoring %s", name)
        self.refactor_tree(tree, name)
        return tree

    def refactor_stdin(self, doctests_only=False):
        input = sys.stdin.read()
        if doctests_only:
            self.log_debug("Refactoring doctests in stdin")
            output = self.refactor_docstring(input, "<stdin>")
            if self.write_unchanged_files or output != input:
                self.processed_file(output, "<stdin>", input)
            else:
                self.log_debug("No doctest changes in stdin")
        else:
            tree = self.refactor_string(input, "<stdin>")
            if self.write_unchanged_files or (tree and tree.was_changed):
                self.processed_file(str(tree), "<stdin>", input)
            else:
                self.log_debug("No changes in stdin")

    def refactor_tree(self, tree, name):
        """Refactors a parse tree (modifying the tree in place).

        For compatible patterns the bottom matcher module is
        used. Otherwise the tree is traversed node-to-node for
        matches.

        Args:
            tree: a pytree.Node instance representing the root of the tree
                  to be refactored.
            name: a human-readable name for this tree.

        Returns:
            True if the tree was modified, False otherwise.
        """

        for fixer in chain(self.pre_order, self.post_order):
            fixer.start_tree(tree, name)

        #use traditional matching for the incompatible fixers
        self.traverse_by(self.bmi_pre_order_heads, tree.pre_order())
        self.traverse_by(self.bmi_post_order_heads, tree.post_order())

        # obtain a set of candidate nodes
        match_set = self.BM.run(tree.leaves())

        while any(match_set.values()):
            for fixer in self.BM.fixers:
                if fixer in match_set and match_set[fixer]:
                    #sort by depth; apply fixers from bottom(of the AST) to top
                    match_set[fixer].sort(key=pytree.Base.depth, reverse=True)

                    if fixer.keep_line_order:
                        #some fixers(eg fix_imports) must be applied
                        #with the original file's line order
                        match_set[fixer].sort(key=pytree.Base.get_lineno)

                    for node in list(match_set[fixer]):
                        if node in match_set[fixer]:
                            match_set[fixer].remove(node)

                        try:
                            find_root(node)
                        except ValueError:
                            # this node has been cut off from a
                            # previous transformation ; skip
                            continue

                        if node.fixers_applied and fixer in node.fixers_applied:
                            # do not apply the same fixer again
                            continue

                        results = fixer.match(node)

                        if results:
                            new = fixer.transform(node, results)
                            if new is not None:
                                node.replace(new)
                                #new.fixers_applied.append(fixer)
                                for node in new.post_order():
                                    # do not apply the fixer again to
                                    # this or any subnode
                                    if not node.fixers_applied:
                                        node.fixers_applied = []
                                    node.fixers_applied.append(fixer)

                                # update the original match set for
                                # the added code
                                new_matches = self.BM.run(new.leaves())
                                for fxr in new_matches:
                                    if not fxr in match_set:
                                        match_set[fxr]=[]

                                    match_set[fxr].extend(new_matches[fxr])

        for fixer in chain(self.pre_order, self.post_order):
            fixer.finish_tree(tree, name)
        return tree.was_changed

    def traverse_by(self, fixers, traversal):
        """Traverse an AST, applying a set of fixers to each node.

        This is a helper method for refactor_tree().

        Args:
            fixers: a list of fixer instances.
            traversal: a generator that yields AST nodes.

        Returns:
            None
        """
        if not fixers:
            return
        for node in traversal:
            for fixer in fixers[node.type]:
                results = fixer.match(node)
                if results:
                    new = fixer.transform(node, results)
                    if new is not None:
                        node.replace(new)
                        node = new

    def processed_file(self, new_text, filename, old_text=None, write=False,
                       encoding=None):
        """
        Called when a file has been refactored and there may be changes.
        """
        self.files.append(filename)
        if old_text is None:
            old_text = self._read_python_source(filename)[0]
            if old_text is None:
                return
        equal = old_text == new_text
        self.print_output(old_text, new_text, filename, equal)
        if equal:
            self.log_debug("No changes to %s", filename)
            if not self.write_unchanged_files:
                return
        if write:
            self.write_file(new_text, filename, old_text, encoding)
        else:
            self.log_debug("Not writing changes to %s", filename)

    def write_file(self, new_text, filename, old_text, encoding=None):
        """Writes a string to a file.

        It first shows a unified diff between the old text and the new text, and
        then rewrites the file; the latter is only done if the write option is
        set.
        """
        try:
            fp = io.open(filename, "w", encoding=encoding, newline='')
        except OSError as err:
            self.log_error("Can't create %s: %s", filename, err)
            return

        with fp:
            try:
                fp.write(new_text)
            except OSError as err:
                self.log_error("Can't write %s: %s", filename, err)
        self.log_debug("Wrote changes to %s", filename)
        self.wrote = True

    PS1 = ">>> "
    PS2 = "... "

    def refactor_docstring(self, input, filename):
        """Refactors a docstring, looking for doctests.

        This returns a modified version of the input string.  It looks
        for doctests, which start with a ">>>" prompt, and may be
        continued with "..." prompts, as long as the "..." is indented
        the same as the ">>>".

        (Unfortunately we can't use the doctest module's parser,
        since, like most parsers, it is not geared towards preserving
        the original source.)
        """
        result = []
        block = None
        block_lineno = None
        indent = None
        lineno = 0
        for line in input.splitlines(keepends=True):
            lineno += 1
            if line.lstrip().startswith(self.PS1):
                if block is not None:
                    result.extend(self.refactor_doctest(block, block_lineno,
                                                        indent, filename))
                block_lineno = lineno
                block = [line]
                i = line.find(self.PS1)
                indent = line[:i]
            elif (indent is not None and
                  (line.startswith(indent + self.PS2) or
                   line == indent + self.PS2.rstrip() + "\n")):
                block.append(line)
            else:
                if block is not None:
                    result.extend(self.refactor_doctest(block, block_lineno,
                                                        indent, filename))
                block = None
                indent = None
                result.append(line)
        if block is not None:
            result.extend(self.refactor_doctest(block, block_lineno,
                                                indent, filename))
        return "".join(result)

    def refactor_doctest(self, block, lineno, indent, filename):
        """Refactors one doctest.

        A doctest is given as a block of lines, the first of which starts
        with ">>>" (possibly indented), while the remaining lines start
        with "..." (identically indented).

        """
        try:
            tree = self.parse_block(block, lineno, indent)
        except Exception as err:
            if self.logger.isEnabledFor(logging.DEBUG):
                for line in block:
                    self.log_debug("Source: %s", line.rstrip("\n"))
            self.log_error("Can't parse docstring in %s line %s: %s: %s",
                           filename, lineno, err.__class__.__name__, err)
            return block
        if self.refactor_tree(tree, filename):
            new = str(tree).splitlines(keepends=True)
            # Undo the adjustment of the line numbers in wrap_toks() below.
            clipped, new = new[:lineno-1], new[lineno-1:]
            assert clipped == ["\n"] * (lineno-1), clipped
            if not new[-1].endswith("\n"):
                new[-1] += "\n"
            block = [indent + self.PS1 + new.pop(0)]
            if new:
                block += [indent + self.PS2 + line for line in new]
        return block

    def summarize(self):
        if self.wrote:
            were = "were"
        else:
            were = "need to be"
        if not self.files:
            self.log_message("No files %s modified.", were)
        else:
            self.log_message("Files that %s modified:", were)
            for file in self.files:
                self.log_message(file)
        if self.fixer_log:
            self.log_message("Warnings/messages while refactoring:")
            for message in self.fixer_log:
                self.log_message(message)
        if self.errors:
            if len(self.errors) == 1:
                self.log_message("There was 1 error:")
            else:
                self.log_message("There were %d errors:", len(self.errors))
            for msg, args, kwds in self.errors:
                self.log_message(msg, *args, **kwds)

    def parse_block(self, block, lineno, indent):
        """Parses a block into a tree.

        This is necessary to get correct line number / offset information
        in the parser diagnostics and embedded into the parse tree.
        """
        tree = self.driver.parse_tokens(self.wrap_toks(block, lineno, indent))
        tree.future_features = frozenset()
        return tree

    def wrap_toks(self, block, lineno, indent):
        """Wraps a tokenize stream to systematically modify start/end."""
        tokens = tokenize.generate_tokens(self.gen_lines(block, indent).__next__)
        for type, value, (line0, col0), (line1, col1), line_text in tokens:
            line0 += lineno - 1
            line1 += lineno - 1
            # Don't bother updating the columns; this is too complicated
            # since line_text would also have to be updated and it would
            # still break for tokens spanning lines.  Let the user guess
            # that the column numbers for doctests are relative to the
            # end of the prompt string (PS1 or PS2).
            yield type, value, (line0, col0), (line1, col1), line_text


    def gen_lines(self, block, indent):
        """Generates lines as expected by tokenize from a list of lines.

        This strips the first len(indent + self.PS1) characters off each line.
        """
        prefix1 = indent + self.PS1
        prefix2 = indent + self.PS2
        prefix = prefix1
        for line in block:
            if line.startswith(prefix):
                yield line[len(prefix):]
            elif line == prefix.rstrip() + "\n":
                yield "\n"
            else:
                raise AssertionError("line=%r, prefix=%r" % (line, prefix))
            prefix = prefix2
        while True:
            yield ""


class MultiprocessingUnsupported(Exception):
    pass


class MultiprocessRefactoringTool(RefactoringTool):

    def __init__(self, *args, **kwargs):
        super(MultiprocessRefactoringTool, self).__init__(*args, **kwargs)
        self.queue = None
        self.output_lock = None

    def refactor(self, items, write=False, doctests_only=False,
                 num_processes=1):
        if num_processes == 1:
            return super(MultiprocessRefactoringTool, self).refactor(
                items, write, doctests_only)
        try:
            import multiprocessing
        except ImportError:
            raise MultiprocessingUnsupported
        if self.queue is not None:
            raise RuntimeError("already doing multiple processes")
        self.queue = multiprocessing.JoinableQueue()
        self.output_lock = multiprocessing.Lock()
        processes = [multiprocessing.Process(target=self._child)
                     for i in range(num_processes)]
        try:
            for p in processes:
                p.start()
            super(MultiprocessRefactoringTool, self).refactor(items, write,
                                                              doctests_only)
        finally:
            self.queue.join()
            for i in range(num_processes):
                self.queue.put(None)
            for p in processes:
                if p.is_alive():
                    p.join()
            self.queue = None

    def _child(self):
        task = self.queue.get()
        while task is not None:
            args, kwargs = task
            try:
                super(MultiprocessRefactoringTool, self).refactor_file(
                    *args, **kwargs)
            finally:
                self.queue.task_done()
            task = self.queue.get()

    def refactor_file(self, *args, **kwargs):
        if self.queue is not None:
            self.queue.put((args, kwargs))
        else:
            return super(MultiprocessRefactoringTool, self).refactor_file(
                *args, **kwargs)
lib2to3/fixes/fix_sys_exc.py000064400000002012151153537460012042 0ustar00"""Fixer for sys.exc_{type, value, traceback}

sys.exc_type -> sys.exc_info()[0]
sys.exc_value -> sys.exc_info()[1]
sys.exc_traceback -> sys.exc_info()[2]
"""

# By Jeff Balogh and Benjamin Peterson

# Local imports
from .. import fixer_base
from ..fixer_util import Attr, Call, Name, Number, Subscript, Node, syms

class FixSysExc(fixer_base.BaseFix):
    # This order matches the ordering of sys.exc_info().
    exc_info = ["exc_type", "exc_value", "exc_traceback"]
    BM_compatible = True
    PATTERN = """
              power< 'sys' trailer< dot='.' attribute=(%s) > >
              """ % '|'.join("'%s'" % e for e in exc_info)

    def transform(self, node, results):
        sys_attr = results["attribute"][0]
        index = Number(self.exc_info.index(sys_attr.value))

        call = Call(Name("exc_info"), prefix=sys_attr.prefix)
        attr = Attr(Name("sys"), call)
        attr[1].children[0].prefix = results["dot"].prefix
        attr.append(Subscript(index))
        return Node(syms.power, attr, prefix=node.prefix)
lib2to3/fixes/fix_print.py000064400000005434151153537460011534 0ustar00# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Fixer for print.

Change:
    'print'          into 'print()'
    'print ...'      into 'print(...)'
    'print ... ,'    into 'print(..., end=" ")'
    'print >>x, ...' into 'print(..., file=x)'

No changes are applied if print_function is imported from __future__

"""

# Local imports
from .. import patcomp
from .. import pytree
from ..pgen2 import token
from .. import fixer_base
from ..fixer_util import Name, Call, Comma, String


parend_expr = patcomp.compile_pattern(
              """atom< '(' [atom|STRING|NAME] ')' >"""
              )


class FixPrint(fixer_base.BaseFix):

    BM_compatible = True

    PATTERN = """
              simple_stmt< any* bare='print' any* > | print_stmt
              """

    def transform(self, node, results):
        assert results

        bare_print = results.get("bare")

        if bare_print:
            # Special-case print all by itself
            bare_print.replace(Call(Name("print"), [],
                               prefix=bare_print.prefix))
            return
        assert node.children[0] == Name("print")
        args = node.children[1:]
        if len(args) == 1 and parend_expr.match(args[0]):
            # We don't want to keep sticking parens around an
            # already-parenthesised expression.
            return

        sep = end = file = None
        if args and args[-1] == Comma():
            args = args[:-1]
            end = " "
        if args and args[0] == pytree.Leaf(token.RIGHTSHIFT, ">>"):
            assert len(args) >= 2
            file = args[1].clone()
            args = args[3:] # Strip a possible comma after the file expression
        # Now synthesize a print(args, sep=..., end=..., file=...) node.
        l_args = [arg.clone() for arg in args]
        if l_args:
            l_args[0].prefix = ""
        if sep is not None or end is not None or file is not None:
            if sep is not None:
                self.add_kwarg(l_args, "sep", String(repr(sep)))
            if end is not None:
                self.add_kwarg(l_args, "end", String(repr(end)))
            if file is not None:
                self.add_kwarg(l_args, "file", file)
        n_stmt = Call(Name("print"), l_args)
        n_stmt.prefix = node.prefix
        return n_stmt

    def add_kwarg(self, l_nodes, s_kwd, n_expr):
        # XXX All this prefix-setting may lose comments (though rarely)
        n_expr.prefix = ""
        n_argument = pytree.Node(self.syms.argument,
                                 (Name(s_kwd),
                                  pytree.Leaf(token.EQUAL, "="),
                                  n_expr))
        if l_nodes:
            l_nodes.append(Comma())
            n_argument.prefix = " "
        l_nodes.append(n_argument)
lib2to3/fixes/fix_renames.py000064400000004255151153537460012032 0ustar00"""Fix incompatible renames

Fixes:
  * sys.maxint -> sys.maxsize
"""
# Author: Christian Heimes
# based on Collin Winter's fix_import

# Local imports
from .. import fixer_base
from ..fixer_util import Name, attr_chain

MAPPING = {"sys":  {"maxint" : "maxsize"},
          }
LOOKUP = {}

def alternates(members):
    return "(" + "|".join(map(repr, members)) + ")"


def build_pattern():
    #bare = set()
    for module, replace in list(MAPPING.items()):
        for old_attr, new_attr in list(replace.items()):
            LOOKUP[(module, old_attr)] = new_attr
            #bare.add(module)
            #bare.add(old_attr)
            #yield """
            #      import_name< 'import' (module=%r
            #          | dotted_as_names< any* module=%r any* >) >
            #      """ % (module, module)
            yield """
                  import_from< 'from' module_name=%r 'import'
                      ( attr_name=%r | import_as_name< attr_name=%r 'as' any >) >
                  """ % (module, old_attr, old_attr)
            yield """
                  power< module_name=%r trailer< '.' attr_name=%r > any* >
                  """ % (module, old_attr)
    #yield """bare_name=%s""" % alternates(bare)


class FixRenames(fixer_base.BaseFix):
    BM_compatible = True
    PATTERN = "|".join(build_pattern())

    order = "pre" # Pre-order tree traversal

    # Don't match the node if it's within another match
    def match(self, node):
        match = super(FixRenames, self).match
        results = match(node)
        if results:
            if any(match(obj) for obj in attr_chain(node, "parent")):
                return False
            return results
        return False

    #def start_tree(self, tree, filename):
    #    super(FixRenames, self).start_tree(tree, filename)
    #    self.replace = {}

    def transform(self, node, results):
        mod_name = results.get("module_name")
        attr_name = results.get("attr_name")
        #bare_name = results.get("bare_name")
        #import_mod = results.get("module")

        if mod_name and attr_name:
            new_attr = LOOKUP[(mod_name.value, attr_name.value)]
            attr_name.replace(Name(new_attr, prefix=attr_name.prefix))
lib2to3/fixes/fix_intern.py000064400000002170151153537460011671 0ustar00# Copyright 2006 Georg Brandl.
# Licensed to PSF under a Contributor Agreement.

"""Fixer for intern().

intern(s) -> sys.intern(s)"""

# Local imports
from .. import fixer_base
from ..fixer_util import ImportAndCall, touch_import


class FixIntern(fixer_base.BaseFix):
    BM_compatible = True
    order = "pre"

    PATTERN = """
    power< 'intern'
           trailer< lpar='('
                    ( not(arglist | argument<any '=' any>) obj=any
                      | obj=arglist<(not argument<any '=' any>) any ','> )
                    rpar=')' >
           after=any*
    >
    """

    def transform(self, node, results):
        if results:
            # I feel like we should be able to express this logic in the
            # PATTERN above but I don't know how to do it so...
            obj = results['obj']
            if obj:
                if (obj.type == self.syms.argument and
                    obj.children[0].value in {'**', '*'}):
                    return  # Make no change.
        names = ('sys', 'intern')
        new = ImportAndCall(node, results, names)
        touch_import(None, 'sys', node)
        return new
lib2to3/fixes/fix_itertools.py000064400000003014151153537460012414 0ustar00""" Fixer for itertools.(imap|ifilter|izip) --> (map|filter|zip) and
    itertools.ifilterfalse --> itertools.filterfalse (bugs 2360-2363)

    imports from itertools are fixed in fix_itertools_import.py

    If itertools is imported as something else (ie: import itertools as it;
    it.izip(spam, eggs)) method calls will not get fixed.
    """

# Local imports
from .. import fixer_base
from ..fixer_util import Name

class FixItertools(fixer_base.BaseFix):
    BM_compatible = True
    it_funcs = "('imap'|'ifilter'|'izip'|'izip_longest'|'ifilterfalse')"
    PATTERN = """
              power< it='itertools'
                  trailer<
                     dot='.' func=%(it_funcs)s > trailer< '(' [any] ')' > >
              |
              power< func=%(it_funcs)s trailer< '(' [any] ')' > >
              """ %(locals())

    # Needs to be run after fix_(map|zip|filter)
    run_order = 6

    def transform(self, node, results):
        prefix = None
        func = results['func'][0]
        if ('it' in results and
            func.value not in ('ifilterfalse', 'izip_longest')):
            dot, it = (results['dot'], results['it'])
            # Remove the 'itertools'
            prefix = it.prefix
            it.remove()
            # Replace the node which contains ('.', 'function') with the
            # function (to be consistent with the second part of the pattern)
            dot.remove()
            func.parent.replace(func)

        prefix = prefix or func.prefix
        func.replace(Name(func.value[1:], prefix=prefix))
lib2to3/fixes/fix_metaclass.py000064400000020004151153537460012342 0ustar00"""Fixer for __metaclass__ = X -> (metaclass=X) methods.

   The various forms of classef (inherits nothing, inherits once, inherits
   many) don't parse the same in the CST so we look at ALL classes for
   a __metaclass__ and if we find one normalize the inherits to all be
   an arglist.

   For one-liner classes ('class X: pass') there is no indent/dedent so
   we normalize those into having a suite.

   Moving the __metaclass__ into the classdef can also cause the class
   body to be empty so there is some special casing for that as well.

   This fixer also tries very hard to keep original indenting and spacing
   in all those corner cases.

"""
# Author: Jack Diederich

# Local imports
from .. import fixer_base
from ..pygram import token
from ..fixer_util import syms, Node, Leaf


def has_metaclass(parent):
    """ we have to check the cls_node without changing it.
        There are two possibilities:
          1)  clsdef => suite => simple_stmt => expr_stmt => Leaf('__meta')
          2)  clsdef => simple_stmt => expr_stmt => Leaf('__meta')
    """
    for node in parent.children:
        if node.type == syms.suite:
            return has_metaclass(node)
        elif node.type == syms.simple_stmt and node.children:
            expr_node = node.children[0]
            if expr_node.type == syms.expr_stmt and expr_node.children:
                left_side = expr_node.children[0]
                if isinstance(left_side, Leaf) and \
                        left_side.value == '__metaclass__':
                    return True
    return False


def fixup_parse_tree(cls_node):
    """ one-line classes don't get a suite in the parse tree so we add
        one to normalize the tree
    """
    for node in cls_node.children:
        if node.type == syms.suite:
            # already in the preferred format, do nothing
            return

    # !%@#! oneliners have no suite node, we have to fake one up
    for i, node in enumerate(cls_node.children):
        if node.type == token.COLON:
            break
    else:
        raise ValueError("No class suite and no ':'!")

    # move everything into a suite node
    suite = Node(syms.suite, [])
    while cls_node.children[i+1:]:
        move_node = cls_node.children[i+1]
        suite.append_child(move_node.clone())
        move_node.remove()
    cls_node.append_child(suite)
    node = suite


def fixup_simple_stmt(parent, i, stmt_node):
    """ if there is a semi-colon all the parts count as part of the same
        simple_stmt.  We just want the __metaclass__ part so we move
        everything after the semi-colon into its own simple_stmt node
    """
    for semi_ind, node in enumerate(stmt_node.children):
        if node.type == token.SEMI: # *sigh*
            break
    else:
        return

    node.remove() # kill the semicolon
    new_expr = Node(syms.expr_stmt, [])
    new_stmt = Node(syms.simple_stmt, [new_expr])
    while stmt_node.children[semi_ind:]:
        move_node = stmt_node.children[semi_ind]
        new_expr.append_child(move_node.clone())
        move_node.remove()
    parent.insert_child(i, new_stmt)
    new_leaf1 = new_stmt.children[0].children[0]
    old_leaf1 = stmt_node.children[0].children[0]
    new_leaf1.prefix = old_leaf1.prefix


def remove_trailing_newline(node):
    if node.children and node.children[-1].type == token.NEWLINE:
        node.children[-1].remove()


def find_metas(cls_node):
    # find the suite node (Mmm, sweet nodes)
    for node in cls_node.children:
        if node.type == syms.suite:
            break
    else:
        raise ValueError("No class suite!")

    # look for simple_stmt[ expr_stmt[ Leaf('__metaclass__') ] ]
    for i, simple_node in list(enumerate(node.children)):
        if simple_node.type == syms.simple_stmt and simple_node.children:
            expr_node = simple_node.children[0]
            if expr_node.type == syms.expr_stmt and expr_node.children:
                # Check if the expr_node is a simple assignment.
                left_node = expr_node.children[0]
                if isinstance(left_node, Leaf) and \
                        left_node.value == '__metaclass__':
                    # We found an assignment to __metaclass__.
                    fixup_simple_stmt(node, i, simple_node)
                    remove_trailing_newline(simple_node)
                    yield (node, i, simple_node)


def fixup_indent(suite):
    """ If an INDENT is followed by a thing with a prefix then nuke the prefix
        Otherwise we get in trouble when removing __metaclass__ at suite start
    """
    kids = suite.children[::-1]
    # find the first indent
    while kids:
        node = kids.pop()
        if node.type == token.INDENT:
            break

    # find the first Leaf
    while kids:
        node = kids.pop()
        if isinstance(node, Leaf) and node.type != token.DEDENT:
            if node.prefix:
                node.prefix = ''
            return
        else:
            kids.extend(node.children[::-1])


class FixMetaclass(fixer_base.BaseFix):
    BM_compatible = True

    PATTERN = """
    classdef<any*>
    """

    def transform(self, node, results):
        if not has_metaclass(node):
            return

        fixup_parse_tree(node)

        # find metaclasses, keep the last one
        last_metaclass = None
        for suite, i, stmt in find_metas(node):
            last_metaclass = stmt
            stmt.remove()

        text_type = node.children[0].type # always Leaf(nnn, 'class')

        # figure out what kind of classdef we have
        if len(node.children) == 7:
            # Node(classdef, ['class', 'name', '(', arglist, ')', ':', suite])
            #                 0        1       2    3        4    5    6
            if node.children[3].type == syms.arglist:
                arglist = node.children[3]
            # Node(classdef, ['class', 'name', '(', 'Parent', ')', ':', suite])
            else:
                parent = node.children[3].clone()
                arglist = Node(syms.arglist, [parent])
                node.set_child(3, arglist)
        elif len(node.children) == 6:
            # Node(classdef, ['class', 'name', '(',  ')', ':', suite])
            #                 0        1       2     3    4    5
            arglist = Node(syms.arglist, [])
            node.insert_child(3, arglist)
        elif len(node.children) == 4:
            # Node(classdef, ['class', 'name', ':', suite])
            #                 0        1       2    3
            arglist = Node(syms.arglist, [])
            node.insert_child(2, Leaf(token.RPAR, ')'))
            node.insert_child(2, arglist)
            node.insert_child(2, Leaf(token.LPAR, '('))
        else:
            raise ValueError("Unexpected class definition")

        # now stick the metaclass in the arglist
        meta_txt = last_metaclass.children[0].children[0]
        meta_txt.value = 'metaclass'
        orig_meta_prefix = meta_txt.prefix

        if arglist.children:
            arglist.append_child(Leaf(token.COMMA, ','))
            meta_txt.prefix = ' '
        else:
            meta_txt.prefix = ''

        # compact the expression "metaclass = Meta" -> "metaclass=Meta"
        expr_stmt = last_metaclass.children[0]
        assert expr_stmt.type == syms.expr_stmt
        expr_stmt.children[1].prefix = ''
        expr_stmt.children[2].prefix = ''

        arglist.append_child(last_metaclass)

        fixup_indent(suite)

        # check for empty suite
        if not suite.children:
            # one-liner that was just __metaclass_
            suite.remove()
            pass_leaf = Leaf(text_type, 'pass')
            pass_leaf.prefix = orig_meta_prefix
            node.append_child(pass_leaf)
            node.append_child(Leaf(token.NEWLINE, '\n'))

        elif len(suite.children) > 1 and \
                 (suite.children[-2].type == token.INDENT and
                  suite.children[-1].type == token.DEDENT):
            # there was only one line in the class body and it was __metaclass__
            pass_leaf = Leaf(text_type, 'pass')
            suite.insert_child(-1, pass_leaf)
            suite.insert_child(-1, Leaf(token.NEWLINE, '\n'))
lib2to3/fixes/fix_getcwdu.py000064400000000703151153537460012034 0ustar00"""
Fixer that changes os.getcwdu() to os.getcwd().
"""
# Author: Victor Stinner

# Local imports
from .. import fixer_base
from ..fixer_util import Name

class FixGetcwdu(fixer_base.BaseFix):
    BM_compatible = True

    PATTERN = """
              power< 'os' trailer< dot='.' name='getcwdu' > any* >
              """

    def transform(self, node, results):
        name = results["name"]
        name.replace(Name("getcwd", prefix=name.prefix))
lib2to3/fixes/fix_standarderror.py000064400000000701151153537460013242 0ustar00# Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Fixer for StandardError -> Exception."""

# Local imports
from .. import fixer_base
from ..fixer_util import Name


class FixStandarderror(fixer_base.BaseFix):
    BM_compatible = True
    PATTERN = """
              'StandardError'
              """

    def transform(self, node, results):
        return Name("Exception", prefix=node.prefix)
lib2to3/fixes/fix_apply.py000064400000004452151153537460011524 0ustar00# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Fixer for apply().

This converts apply(func, v, k) into (func)(*v, **k)."""

# Local imports
from .. import pytree
from ..pgen2 import token
from .. import fixer_base
from ..fixer_util import Call, Comma, parenthesize

class FixApply(fixer_base.BaseFix):
    BM_compatible = True

    PATTERN = """
    power< 'apply'
        trailer<
            '('
            arglist<
                (not argument<NAME '=' any>) func=any ','
                (not argument<NAME '=' any>) args=any [','
                (not argument<NAME '=' any>) kwds=any] [',']
            >
            ')'
        >
    >
    """

    def transform(self, node, results):
        syms = self.syms
        assert results
        func = results["func"]
        args = results["args"]
        kwds = results.get("kwds")
        # I feel like we should be able to express this logic in the
        # PATTERN above but I don't know how to do it so...
        if args:
            if (args.type == self.syms.argument and
                args.children[0].value in {'**', '*'}):
                return  # Make no change.
        if kwds and (kwds.type == self.syms.argument and
                     kwds.children[0].value == '**'):
            return  # Make no change.
        prefix = node.prefix
        func = func.clone()
        if (func.type not in (token.NAME, syms.atom) and
            (func.type != syms.power or
             func.children[-2].type == token.DOUBLESTAR)):
            # Need to parenthesize
            func = parenthesize(func)
        func.prefix = ""
        args = args.clone()
        args.prefix = ""
        if kwds is not None:
            kwds = kwds.clone()
            kwds.prefix = ""
        l_newargs = [pytree.Leaf(token.STAR, "*"), args]
        if kwds is not None:
            l_newargs.extend([Comma(),
                              pytree.Leaf(token.DOUBLESTAR, "**"),
                              kwds])
            l_newargs[-2].prefix = " " # that's the ** token
        # XXX Sometimes we could be cleverer, e.g. apply(f, (x, y) + t)
        # can be translated into f(x, y, *t) instead of f(*(x, y) + t)
        #new = pytree.Node(syms.power, (func, ArgList(l_newargs)))
        return Call(func, l_newargs, prefix=prefix)
lib2to3/fixes/fix_basestring.py000064400000000500151153537460012526 0ustar00"""Fixer for basestring -> str."""
# Author: Christian Heimes

# Local imports
from .. import fixer_base
from ..fixer_util import Name

class FixBasestring(fixer_base.BaseFix):
    BM_compatible = True

    PATTERN = "'basestring'"

    def transform(self, node, results):
        return Name("str", prefix=node.prefix)
lib2to3/fixes/fix_numliterals.py000064400000001400151153537460012724 0ustar00"""Fixer that turns 1L into 1, 0755 into 0o755.
"""
# Copyright 2007 Georg Brandl.
# Licensed to PSF under a Contributor Agreement.

# Local imports
from ..pgen2 import token
from .. import fixer_base
from ..fixer_util import Number


class FixNumliterals(fixer_base.BaseFix):
    # This is so simple that we don't need the pattern compiler.

    _accept_type = token.NUMBER

    def match(self, node):
        # Override
        return (node.value.startswith("0") or node.value[-1] in "Ll")

    def transform(self, node, results):
        val = node.value
        if val[-1] in 'Ll':
            val = val[:-1]
        elif val.startswith('0') and val.isdigit() and len(set(val)) > 1:
            val = "0o" + val[1:]

        return Number(val, prefix=node.prefix)
lib2to3/fixes/fix_unicode.py000064400000002350151153537460012020 0ustar00r"""Fixer for unicode.

* Changes unicode to str and unichr to chr.

* If "...\u..." is not unicode literal change it into "...\\u...".

* Change u"..." into "...".

"""

from ..pgen2 import token
from .. import fixer_base

_mapping = {"unichr" : "chr", "unicode" : "str"}

class FixUnicode(fixer_base.BaseFix):
    BM_compatible = True
    PATTERN = "STRING | 'unicode' | 'unichr'"

    def start_tree(self, tree, filename):
        super(FixUnicode, self).start_tree(tree, filename)
        self.unicode_literals = 'unicode_literals' in tree.future_features

    def transform(self, node, results):
        if node.type == token.NAME:
            new = node.clone()
            new.value = _mapping[node.value]
            return new
        elif node.type == token.STRING:
            val = node.value
            if not self.unicode_literals and val[0] in '\'"' and '\\' in val:
                val = r'\\'.join([
                    v.replace('\\u', r'\\u').replace('\\U', r'\\U')
                    for v in val.split(r'\\')
                ])
            if val[0] in 'uU':
                val = val[1:]
            if val == node.value:
                return node
            new = node.clone()
            new.value = val
            return new
lib2to3/fixes/fix_set_literal.py000064400000003241151153537460012701 0ustar00"""
Optional fixer to transform set() calls to set literals.
"""

# Author: Benjamin Peterson

from lib2to3 import fixer_base, pytree
from lib2to3.fixer_util import token, syms



class FixSetLiteral(fixer_base.BaseFix):

    BM_compatible = True
    explicit = True

    PATTERN = """power< 'set' trailer< '('
                     (atom=atom< '[' (items=listmaker< any ((',' any)* [',']) >
                                |
                                single=any) ']' >
                     |
                     atom< '(' items=testlist_gexp< any ((',' any)* [',']) > ')' >
                     )
                     ')' > >
              """

    def transform(self, node, results):
        single = results.get("single")
        if single:
            # Make a fake listmaker
            fake = pytree.Node(syms.listmaker, [single.clone()])
            single.replace(fake)
            items = fake
        else:
            items = results["items"]

        # Build the contents of the literal
        literal = [pytree.Leaf(token.LBRACE, "{")]
        literal.extend(n.clone() for n in items.children)
        literal.append(pytree.Leaf(token.RBRACE, "}"))
        # Set the prefix of the right brace to that of the ')' or ']'
        literal[-1].prefix = items.next_sibling.prefix
        maker = pytree.Node(syms.dictsetmaker, literal)
        maker.prefix = node.prefix

        # If the original was a one tuple, we need to remove the extra comma.
        if len(maker.children) == 4:
            n = maker.children[2]
            n.remove()
            maker.children[-1].prefix = n.prefix

        # Finally, replace the set call with our shiny new literal.
        return maker
lib2to3/fixes/fix_throw.py000064400000003056151153537460011541 0ustar00"""Fixer for generator.throw(E, V, T).

g.throw(E)       -> g.throw(E)
g.throw(E, V)    -> g.throw(E(V))
g.throw(E, V, T) -> g.throw(E(V).with_traceback(T))

g.throw("foo"[, V[, T]]) will warn about string exceptions."""
# Author: Collin Winter

# Local imports
from .. import pytree
from ..pgen2 import token
from .. import fixer_base
from ..fixer_util import Name, Call, ArgList, Attr, is_tuple

class FixThrow(fixer_base.BaseFix):
    BM_compatible = True
    PATTERN = """
    power< any trailer< '.' 'throw' >
           trailer< '(' args=arglist< exc=any ',' val=any [',' tb=any] > ')' >
    >
    |
    power< any trailer< '.' 'throw' > trailer< '(' exc=any ')' > >
    """

    def transform(self, node, results):
        syms = self.syms

        exc = results["exc"].clone()
        if exc.type is token.STRING:
            self.cannot_convert(node, "Python 3 does not support string exceptions")
            return

        # Leave "g.throw(E)" alone
        val = results.get("val")
        if val is None:
            return

        val = val.clone()
        if is_tuple(val):
            args = [c.clone() for c in val.children[1:-1]]
        else:
            val.prefix = ""
            args = [val]

        throw_args = results["args"]

        if "tb" in results:
            tb = results["tb"].clone()
            tb.prefix = ""

            e = Call(exc, args)
            with_tb = Attr(e, Name('with_traceback')) + [ArgList([tb])]
            throw_args.replace(pytree.Node(syms.power, with_tb))
        else:
            throw_args.replace(Call(exc, args))
lib2to3/fixes/fix_exitfunc.py000064400000004677151153537460012235 0ustar00"""
Convert use of sys.exitfunc to use the atexit module.
"""

# Author: Benjamin Peterson

from lib2to3 import pytree, fixer_base
from lib2to3.fixer_util import Name, Attr, Call, Comma, Newline, syms


class FixExitfunc(fixer_base.BaseFix):
    keep_line_order = True
    BM_compatible = True

    PATTERN = """
              (
                  sys_import=import_name<'import'
                      ('sys'
                      |
                      dotted_as_names< (any ',')* 'sys' (',' any)* >
                      )
                  >
              |
                  expr_stmt<
                      power< 'sys' trailer< '.' 'exitfunc' > >
                  '=' func=any >
              )
              """

    def __init__(self, *args):
        super(FixExitfunc, self).__init__(*args)

    def start_tree(self, tree, filename):
        super(FixExitfunc, self).start_tree(tree, filename)
        self.sys_import = None

    def transform(self, node, results):
        # First, find the sys import. We'll just hope it's global scope.
        if "sys_import" in results:
            if self.sys_import is None:
                self.sys_import = results["sys_import"]
            return

        func = results["func"].clone()
        func.prefix = ""
        register = pytree.Node(syms.power,
                               Attr(Name("atexit"), Name("register"))
                               )
        call = Call(register, [func], node.prefix)
        node.replace(call)

        if self.sys_import is None:
            # That's interesting.
            self.warning(node, "Can't find sys import; Please add an atexit "
                             "import at the top of your file.")
            return

        # Now add an atexit import after the sys import.
        names = self.sys_import.children[1]
        if names.type == syms.dotted_as_names:
            names.append_child(Comma())
            names.append_child(Name("atexit", " "))
        else:
            containing_stmt = self.sys_import.parent
            position = containing_stmt.children.index(self.sys_import)
            stmt_container = containing_stmt.parent
            new_import = pytree.Node(syms.import_name,
                              [Name("import"), Name("atexit", " ")]
                              )
            new = pytree.Node(syms.simple_stmt, [new_import])
            containing_stmt.insert_child(position + 1, Newline())
            containing_stmt.insert_child(position + 2, new)
lib2to3/fixes/__init__.py000064400000000057151153537460011265 0ustar00# Dummy file to make this directory a package.
lib2to3/fixes/fix_funcattrs.py000064400000001204151153537460012400 0ustar00"""Fix function attribute names (f.func_x -> f.__x__)."""
# Author: Collin Winter

# Local imports
from .. import fixer_base
from ..fixer_util import Name


class FixFuncattrs(fixer_base.BaseFix):
    BM_compatible = True

    PATTERN = """
    power< any+ trailer< '.' attr=('func_closure' | 'func_doc' | 'func_globals'
                                  | 'func_name' | 'func_defaults' | 'func_code'
                                  | 'func_dict') > any* >
    """

    def transform(self, node, results):
        attr = results["attr"][0]
        attr.replace(Name(("__%s__" % attr.value[5:]),
                          prefix=attr.prefix))
lib2to3/fixes/fix_asserts.py000064400000001730151153537460012057 0ustar00"""Fixer that replaces deprecated unittest method names."""

# Author: Ezio Melotti

from ..fixer_base import BaseFix
from ..fixer_util import Name

NAMES = dict(
    assert_="assertTrue",
    assertEquals="assertEqual",
    assertNotEquals="assertNotEqual",
    assertAlmostEquals="assertAlmostEqual",
    assertNotAlmostEquals="assertNotAlmostEqual",
    assertRegexpMatches="assertRegex",
    assertRaisesRegexp="assertRaisesRegex",
    failUnlessEqual="assertEqual",
    failIfEqual="assertNotEqual",
    failUnlessAlmostEqual="assertAlmostEqual",
    failIfAlmostEqual="assertNotAlmostEqual",
    failUnless="assertTrue",
    failUnlessRaises="assertRaises",
    failIf="assertFalse",
)


class FixAsserts(BaseFix):

    PATTERN = """
              power< any+ trailer< '.' meth=(%s)> any* >
              """ % '|'.join(map(repr, NAMES))

    def transform(self, node, results):
        name = results["meth"][0]
        name.replace(Name(NAMES[str(name)], prefix=name.prefix))
lib2to3/fixes/fix_long.py000064400000000734151153537460011335 0ustar00# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Fixer that turns 'long' into 'int' everywhere.
"""

# Local imports
from lib2to3 import fixer_base
from lib2to3.fixer_util import is_probably_builtin


class FixLong(fixer_base.BaseFix):
    BM_compatible = True
    PATTERN = "'long'"

    def transform(self, node, results):
        if is_probably_builtin(node):
            node.value = "int"
            node.changed()
lib2to3/fixes/fix_except.py000064400000006420151153537460011664 0ustar00"""Fixer for except statements with named exceptions.

The following cases will be converted:

- "except E, T:" where T is a name:

    except E as T:

- "except E, T:" where T is not a name, tuple or list:

        except E as t:
            T = t

    This is done because the target of an "except" clause must be a
    name.

- "except E, T:" where T is a tuple or list literal:

        except E as t:
            T = t.args
"""
# Author: Collin Winter

# Local imports
from .. import pytree
from ..pgen2 import token
from .. import fixer_base
from ..fixer_util import Assign, Attr, Name, is_tuple, is_list, syms

def find_excepts(nodes):
    for i, n in enumerate(nodes):
        if n.type == syms.except_clause:
            if n.children[0].value == 'except':
                yield (n, nodes[i+2])

class FixExcept(fixer_base.BaseFix):
    BM_compatible = True

    PATTERN = """
    try_stmt< 'try' ':' (simple_stmt | suite)
                  cleanup=(except_clause ':' (simple_stmt | suite))+
                  tail=(['except' ':' (simple_stmt | suite)]
                        ['else' ':' (simple_stmt | suite)]
                        ['finally' ':' (simple_stmt | suite)]) >
    """

    def transform(self, node, results):
        syms = self.syms

        tail = [n.clone() for n in results["tail"]]

        try_cleanup = [ch.clone() for ch in results["cleanup"]]
        for except_clause, e_suite in find_excepts(try_cleanup):
            if len(except_clause.children) == 4:
                (E, comma, N) = except_clause.children[1:4]
                comma.replace(Name("as", prefix=" "))

                if N.type != token.NAME:
                    # Generate a new N for the except clause
                    new_N = Name(self.new_name(), prefix=" ")
                    target = N.clone()
                    target.prefix = ""
                    N.replace(new_N)
                    new_N = new_N.clone()

                    # Insert "old_N = new_N" as the first statement in
                    #  the except body. This loop skips leading whitespace
                    #  and indents
                    #TODO(cwinter) suite-cleanup
                    suite_stmts = e_suite.children
                    for i, stmt in enumerate(suite_stmts):
                        if isinstance(stmt, pytree.Node):
                            break

                    # The assignment is different if old_N is a tuple or list
                    # In that case, the assignment is old_N = new_N.args
                    if is_tuple(N) or is_list(N):
                        assign = Assign(target, Attr(new_N, Name('args')))
                    else:
                        assign = Assign(target, new_N)

                    #TODO(cwinter) stopgap until children becomes a smart list
                    for child in reversed(suite_stmts[:i]):
                        e_suite.insert_child(0, child)
                    e_suite.insert_child(i, assign)
                elif N.prefix == "":
                    # No space after a comma is legal; no space after "as",
                    # not so much.
                    N.prefix = " "

        #TODO(cwinter) fix this when children becomes a smart list
        children = [c.clone() for c in node.children[:3]] + try_cleanup + tail
        return pytree.Node(node.type, children)
lib2to3/fixes/fix_operator.py000064400000006542151153537460012234 0ustar00"""Fixer for operator functions.

operator.isCallable(obj)       -> callable(obj)
operator.sequenceIncludes(obj) -> operator.contains(obj)
operator.isSequenceType(obj)   -> isinstance(obj, collections.abc.Sequence)
operator.isMappingType(obj)    -> isinstance(obj, collections.abc.Mapping)
operator.isNumberType(obj)     -> isinstance(obj, numbers.Number)
operator.repeat(obj, n)        -> operator.mul(obj, n)
operator.irepeat(obj, n)       -> operator.imul(obj, n)
"""

import collections.abc

# Local imports
from lib2to3 import fixer_base
from lib2to3.fixer_util import Call, Name, String, touch_import


def invocation(s):
    def dec(f):
        f.invocation = s
        return f
    return dec


class FixOperator(fixer_base.BaseFix):
    BM_compatible = True
    order = "pre"

    methods = """
              method=('isCallable'|'sequenceIncludes'
                     |'isSequenceType'|'isMappingType'|'isNumberType'
                     |'repeat'|'irepeat')
              """
    obj = "'(' obj=any ')'"
    PATTERN = """
              power< module='operator'
                trailer< '.' %(methods)s > trailer< %(obj)s > >
              |
              power< %(methods)s trailer< %(obj)s > >
              """ % dict(methods=methods, obj=obj)

    def transform(self, node, results):
        method = self._check_method(node, results)
        if method is not None:
            return method(node, results)

    @invocation("operator.contains(%s)")
    def _sequenceIncludes(self, node, results):
        return self._handle_rename(node, results, "contains")

    @invocation("callable(%s)")
    def _isCallable(self, node, results):
        obj = results["obj"]
        return Call(Name("callable"), [obj.clone()], prefix=node.prefix)

    @invocation("operator.mul(%s)")
    def _repeat(self, node, results):
        return self._handle_rename(node, results, "mul")

    @invocation("operator.imul(%s)")
    def _irepeat(self, node, results):
        return self._handle_rename(node, results, "imul")

    @invocation("isinstance(%s, collections.abc.Sequence)")
    def _isSequenceType(self, node, results):
        return self._handle_type2abc(node, results, "collections.abc", "Sequence")

    @invocation("isinstance(%s, collections.abc.Mapping)")
    def _isMappingType(self, node, results):
        return self._handle_type2abc(node, results, "collections.abc", "Mapping")

    @invocation("isinstance(%s, numbers.Number)")
    def _isNumberType(self, node, results):
        return self._handle_type2abc(node, results, "numbers", "Number")

    def _handle_rename(self, node, results, name):
        method = results["method"][0]
        method.value = name
        method.changed()

    def _handle_type2abc(self, node, results, module, abc):
        touch_import(None, module, node)
        obj = results["obj"]
        args = [obj.clone(), String(", " + ".".join([module, abc]))]
        return Call(Name("isinstance"), args, prefix=node.prefix)

    def _check_method(self, node, results):
        method = getattr(self, "_" + results["method"][0].value)
        if isinstance(method, collections.abc.Callable):
            if "module" in results:
                return method
            else:
                sub = (str(results["obj"]),)
                invocation_str = method.invocation % sub
                self.warning(node, "You should use '%s' here." % invocation_str)
        return None
lib2to3/fixes/fix_future.py000064400000001043151153537460011702 0ustar00"""Remove __future__ imports

from __future__ import foo is replaced with an empty line.
"""
# Author: Christian Heimes

# Local imports
from .. import fixer_base
from ..fixer_util import BlankLine

class FixFuture(fixer_base.BaseFix):
    BM_compatible = True

    PATTERN = """import_from< 'from' module_name="__future__" 'import' any >"""

    # This should be run last -- some things check for the import
    run_order = 10

    def transform(self, node, results):
        new = BlankLine()
        new.prefix = node.prefix
        return new
lib2to3/fixes/fix_map.py000064400000007070151153537460011153 0ustar00# Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Fixer that changes map(F, ...) into list(map(F, ...)) unless there
exists a 'from future_builtins import map' statement in the top-level
namespace.

As a special case, map(None, X) is changed into list(X).  (This is
necessary because the semantics are changed in this case -- the new
map(None, X) is equivalent to [(x,) for x in X].)

We avoid the transformation (except for the special case mentioned
above) if the map() call is directly contained in iter(<>), list(<>),
tuple(<>), sorted(<>), ...join(<>), or for V in <>:.

NOTE: This is still not correct if the original code was depending on
map(F, X, Y, ...) to go on until the longest argument is exhausted,
substituting None for missing values -- like zip(), it now stops as
soon as the shortest argument is exhausted.
"""

# Local imports
from ..pgen2 import token
from .. import fixer_base
from ..fixer_util import Name, ArgList, Call, ListComp, in_special_context
from ..pygram import python_symbols as syms
from ..pytree import Node


class FixMap(fixer_base.ConditionalFix):
    BM_compatible = True

    PATTERN = """
    map_none=power<
        'map'
        trailer< '(' arglist< 'None' ',' arg=any [','] > ')' >
        [extra_trailers=trailer*]
    >
    |
    map_lambda=power<
        'map'
        trailer<
            '('
            arglist<
                lambdef< 'lambda'
                         (fp=NAME | vfpdef< '(' fp=NAME ')'> ) ':' xp=any
                >
                ','
                it=any
            >
            ')'
        >
        [extra_trailers=trailer*]
    >
    |
    power<
        'map' args=trailer< '(' [any] ')' >
        [extra_trailers=trailer*]
    >
    """

    skip_on = 'future_builtins.map'

    def transform(self, node, results):
        if self.should_skip(node):
            return

        trailers = []
        if 'extra_trailers' in results:
            for t in results['extra_trailers']:
                trailers.append(t.clone())

        if node.parent.type == syms.simple_stmt:
            self.warning(node, "You should use a for loop here")
            new = node.clone()
            new.prefix = ""
            new = Call(Name("list"), [new])
        elif "map_lambda" in results:
            new = ListComp(results["xp"].clone(),
                           results["fp"].clone(),
                           results["it"].clone())
            new = Node(syms.power, [new] + trailers, prefix="")

        else:
            if "map_none" in results:
                new = results["arg"].clone()
                new.prefix = ""
            else:
                if "args" in results:
                    args = results["args"]
                    if args.type == syms.trailer and \
                       args.children[1].type == syms.arglist and \
                       args.children[1].children[0].type == token.NAME and \
                       args.children[1].children[0].value == "None":
                        self.warning(node, "cannot convert map(None, ...) "
                                     "with multiple arguments because map() "
                                     "now truncates to the shortest sequence")
                        return

                    new = Node(syms.power, [Name("map"), args.clone()])
                    new.prefix = ""

                if in_special_context(node):
                    return None

            new = Node(syms.power, [Name("list"), ArgList([new])] + trailers)
            new.prefix = ""

        new.prefix = node.prefix
        return new
lib2to3/fixes/fix_raise.py000064400000005556151153537460011510 0ustar00"""Fixer for 'raise E, V, T'

raise         -> raise
raise E       -> raise E
raise E, V    -> raise E(V)
raise E, V, T -> raise E(V).with_traceback(T)
raise E, None, T -> raise E.with_traceback(T)

raise (((E, E'), E''), E'''), V -> raise E(V)
raise "foo", V, T               -> warns about string exceptions


CAVEATS:
1) "raise E, V" will be incorrectly translated if V is an exception
   instance. The correct Python 3 idiom is

        raise E from V

   but since we can't detect instance-hood by syntax alone and since
   any client code would have to be changed as well, we don't automate
   this.
"""
# Author: Collin Winter

# Local imports
from .. import pytree
from ..pgen2 import token
from .. import fixer_base
from ..fixer_util import Name, Call, Attr, ArgList, is_tuple

class FixRaise(fixer_base.BaseFix):

    BM_compatible = True
    PATTERN = """
    raise_stmt< 'raise' exc=any [',' val=any [',' tb=any]] >
    """

    def transform(self, node, results):
        syms = self.syms

        exc = results["exc"].clone()
        if exc.type == token.STRING:
            msg = "Python 3 does not support string exceptions"
            self.cannot_convert(node, msg)
            return

        # Python 2 supports
        #  raise ((((E1, E2), E3), E4), E5), V
        # as a synonym for
        #  raise E1, V
        # Since Python 3 will not support this, we recurse down any tuple
        # literals, always taking the first element.
        if is_tuple(exc):
            while is_tuple(exc):
                # exc.children[1:-1] is the unparenthesized tuple
                # exc.children[1].children[0] is the first element of the tuple
                exc = exc.children[1].children[0].clone()
            exc.prefix = " "

        if "val" not in results:
            # One-argument raise
            new = pytree.Node(syms.raise_stmt, [Name("raise"), exc])
            new.prefix = node.prefix
            return new

        val = results["val"].clone()
        if is_tuple(val):
            args = [c.clone() for c in val.children[1:-1]]
        else:
            val.prefix = ""
            args = [val]

        if "tb" in results:
            tb = results["tb"].clone()
            tb.prefix = ""

            e = exc
            # If there's a traceback and None is passed as the value, then don't
            # add a call, since the user probably just wants to add a
            # traceback. See issue #9661.
            if val.type != token.NAME or val.value != "None":
                e = Call(exc, args)
            with_tb = Attr(e, Name('with_traceback')) + [ArgList([tb])]
            new = pytree.Node(syms.simple_stmt, [Name("raise")] + with_tb)
            new.prefix = node.prefix
            return new
        else:
            return pytree.Node(syms.raise_stmt,
                               [Name("raise"), Call(exc, args)],
                               prefix=node.prefix)
lib2to3/fixes/fix_nonzero.py000064400000001117151153537460012064 0ustar00"""Fixer for __nonzero__ -> __bool__ methods."""
# Author: Collin Winter

# Local imports
from .. import fixer_base
from ..fixer_util import Name

class FixNonzero(fixer_base.BaseFix):
    BM_compatible = True
    PATTERN = """
    classdef< 'class' any+ ':'
              suite< any*
                     funcdef< 'def' name='__nonzero__'
                              parameters< '(' NAME ')' > any+ >
                     any* > >
    """

    def transform(self, node, results):
        name = results["name"]
        new = Name("__bool__", prefix=name.prefix)
        name.replace(new)
lib2to3/fixes/fix_dict.py000064400000007260151153537460011322 0ustar00# Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Fixer for dict methods.

d.keys() -> list(d.keys())
d.items() -> list(d.items())
d.values() -> list(d.values())

d.iterkeys() -> iter(d.keys())
d.iteritems() -> iter(d.items())
d.itervalues() -> iter(d.values())

d.viewkeys() -> d.keys()
d.viewitems() -> d.items()
d.viewvalues() -> d.values()

Except in certain very specific contexts: the iter() can be dropped
when the context is list(), sorted(), iter() or for...in; the list()
can be dropped when the context is list() or sorted() (but not iter()
or for...in!). Special contexts that apply to both: list(), sorted(), tuple()
set(), any(), all(), sum().

Note: iter(d.keys()) could be written as iter(d) but since the
original d.iterkeys() was also redundant we don't fix this.  And there
are (rare) contexts where it makes a difference (e.g. when passing it
as an argument to a function that introspects the argument).
"""

# Local imports
from .. import pytree
from .. import patcomp
from .. import fixer_base
from ..fixer_util import Name, Call, Dot
from .. import fixer_util


iter_exempt = fixer_util.consuming_calls | {"iter"}


class FixDict(fixer_base.BaseFix):
    BM_compatible = True

    PATTERN = """
    power< head=any+
         trailer< '.' method=('keys'|'items'|'values'|
                              'iterkeys'|'iteritems'|'itervalues'|
                              'viewkeys'|'viewitems'|'viewvalues') >
         parens=trailer< '(' ')' >
         tail=any*
    >
    """

    def transform(self, node, results):
        head = results["head"]
        method = results["method"][0] # Extract node for method name
        tail = results["tail"]
        syms = self.syms
        method_name = method.value
        isiter = method_name.startswith("iter")
        isview = method_name.startswith("view")
        if isiter or isview:
            method_name = method_name[4:]
        assert method_name in ("keys", "items", "values"), repr(method)
        head = [n.clone() for n in head]
        tail = [n.clone() for n in tail]
        special = not tail and self.in_special_context(node, isiter)
        args = head + [pytree.Node(syms.trailer,
                                   [Dot(),
                                    Name(method_name,
                                         prefix=method.prefix)]),
                       results["parens"].clone()]
        new = pytree.Node(syms.power, args)
        if not (special or isview):
            new.prefix = ""
            new = Call(Name("iter" if isiter else "list"), [new])
        if tail:
            new = pytree.Node(syms.power, [new] + tail)
        new.prefix = node.prefix
        return new

    P1 = "power< func=NAME trailer< '(' node=any ')' > any* >"
    p1 = patcomp.compile_pattern(P1)

    P2 = """for_stmt< 'for' any 'in' node=any ':' any* >
            | comp_for< 'for' any 'in' node=any any* >
         """
    p2 = patcomp.compile_pattern(P2)

    def in_special_context(self, node, isiter):
        if node.parent is None:
            return False
        results = {}
        if (node.parent.parent is not None and
               self.p1.match(node.parent.parent, results) and
               results["node"] is node):
            if isiter:
                # iter(d.iterkeys()) -> iter(d.keys()), etc.
                return results["func"].value in iter_exempt
            else:
                # list(d.keys()) -> list(d.keys()), etc.
                return results["func"].value in fixer_util.consuming_calls
        if not isiter:
            return False
        # for ... in d.iterkeys() -> for ... in d.keys(), etc.
        return self.p2.match(node.parent, results) and results["node"] is node
lib2to3/fixes/fix_idioms.py000064400000011414151153537460011657 0ustar00"""Adjust some old Python 2 idioms to their modern counterparts.

* Change some type comparisons to isinstance() calls:
    type(x) == T -> isinstance(x, T)
    type(x) is T -> isinstance(x, T)
    type(x) != T -> not isinstance(x, T)
    type(x) is not T -> not isinstance(x, T)

* Change "while 1:" into "while True:".

* Change both

    v = list(EXPR)
    v.sort()
    foo(v)

and the more general

    v = EXPR
    v.sort()
    foo(v)

into

    v = sorted(EXPR)
    foo(v)
"""
# Author: Jacques Frechet, Collin Winter

# Local imports
from .. import fixer_base
from ..fixer_util import Call, Comma, Name, Node, BlankLine, syms

CMP = "(n='!=' | '==' | 'is' | n=comp_op< 'is' 'not' >)"
TYPE = "power< 'type' trailer< '(' x=any ')' > >"

class FixIdioms(fixer_base.BaseFix):
    explicit = True # The user must ask for this fixer

    PATTERN = r"""
        isinstance=comparison< %s %s T=any >
        |
        isinstance=comparison< T=any %s %s >
        |
        while_stmt< 'while' while='1' ':' any+ >
        |
        sorted=any<
            any*
            simple_stmt<
              expr_stmt< id1=any '='
                         power< list='list' trailer< '(' (not arglist<any+>) any ')' > >
              >
              '\n'
            >
            sort=
            simple_stmt<
              power< id2=any
                     trailer< '.' 'sort' > trailer< '(' ')' >
              >
              '\n'
            >
            next=any*
        >
        |
        sorted=any<
            any*
            simple_stmt< expr_stmt< id1=any '=' expr=any > '\n' >
            sort=
            simple_stmt<
              power< id2=any
                     trailer< '.' 'sort' > trailer< '(' ')' >
              >
              '\n'
            >
            next=any*
        >
    """ % (TYPE, CMP, CMP, TYPE)

    def match(self, node):
        r = super(FixIdioms, self).match(node)
        # If we've matched one of the sort/sorted subpatterns above, we
        # want to reject matches where the initial assignment and the
        # subsequent .sort() call involve different identifiers.
        if r and "sorted" in r:
            if r["id1"] == r["id2"]:
                return r
            return None
        return r

    def transform(self, node, results):
        if "isinstance" in results:
            return self.transform_isinstance(node, results)
        elif "while" in results:
            return self.transform_while(node, results)
        elif "sorted" in results:
            return self.transform_sort(node, results)
        else:
            raise RuntimeError("Invalid match")

    def transform_isinstance(self, node, results):
        x = results["x"].clone() # The thing inside of type()
        T = results["T"].clone() # The type being compared against
        x.prefix = ""
        T.prefix = " "
        test = Call(Name("isinstance"), [x, Comma(), T])
        if "n" in results:
            test.prefix = " "
            test = Node(syms.not_test, [Name("not"), test])
        test.prefix = node.prefix
        return test

    def transform_while(self, node, results):
        one = results["while"]
        one.replace(Name("True", prefix=one.prefix))

    def transform_sort(self, node, results):
        sort_stmt = results["sort"]
        next_stmt = results["next"]
        list_call = results.get("list")
        simple_expr = results.get("expr")

        if list_call:
            list_call.replace(Name("sorted", prefix=list_call.prefix))
        elif simple_expr:
            new = simple_expr.clone()
            new.prefix = ""
            simple_expr.replace(Call(Name("sorted"), [new],
                                     prefix=simple_expr.prefix))
        else:
            raise RuntimeError("should not have reached here")
        sort_stmt.remove()

        btwn = sort_stmt.prefix
        # Keep any prefix lines between the sort_stmt and the list_call and
        # shove them right after the sorted() call.
        if "\n" in btwn:
            if next_stmt:
                # The new prefix should be everything from the sort_stmt's
                # prefix up to the last newline, then the old prefix after a new
                # line.
                prefix_lines = (btwn.rpartition("\n")[0], next_stmt[0].prefix)
                next_stmt[0].prefix = "\n".join(prefix_lines)
            else:
                assert list_call.parent
                assert list_call.next_sibling is None
                # Put a blank line after list_call and set its prefix.
                end_line = BlankLine()
                list_call.parent.append_child(end_line)
                assert list_call.next_sibling is end_line
                # The new prefix should be everything up to the first new line
                # of sort_stmt's prefix.
                end_line.prefix = btwn.rpartition("\n")[0]
lib2to3/fixes/fix_reduce.py000064400000001505151153537460011642 0ustar00# Copyright 2008 Armin Ronacher.
# Licensed to PSF under a Contributor Agreement.

"""Fixer for reduce().

Makes sure reduce() is imported from the functools module if reduce is
used in that module.
"""

from lib2to3 import fixer_base
from lib2to3.fixer_util import touch_import



class FixReduce(fixer_base.BaseFix):

    BM_compatible = True
    order = "pre"

    PATTERN = """
    power< 'reduce'
        trailer< '('
            arglist< (
                (not(argument<any '=' any>) any ','
                 not(argument<any '=' any>) any) |
                (not(argument<any '=' any>) any ','
                 not(argument<any '=' any>) any ','
                 not(argument<any '=' any>) any)
            ) >
        ')' >
    >
    """

    def transform(self, node, results):
        touch_import('functools', 'reduce', node)
lib2to3/fixes/fix_execfile.py000064400000004000151153537460012150 0ustar00# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Fixer for execfile.

This converts usages of the execfile function into calls to the built-in
exec() function.
"""

from .. import fixer_base
from ..fixer_util import (Comma, Name, Call, LParen, RParen, Dot, Node,
                          ArgList, String, syms)


class FixExecfile(fixer_base.BaseFix):
    BM_compatible = True

    PATTERN = """
    power< 'execfile' trailer< '(' arglist< filename=any [',' globals=any [',' locals=any ] ] > ')' > >
    |
    power< 'execfile' trailer< '(' filename=any ')' > >
    """

    def transform(self, node, results):
        assert results
        filename = results["filename"]
        globals = results.get("globals")
        locals = results.get("locals")

        # Copy over the prefix from the right parentheses end of the execfile
        # call.
        execfile_paren = node.children[-1].children[-1].clone()
        # Construct open().read().
        open_args = ArgList([filename.clone(), Comma(), String('"rb"', ' ')],
                            rparen=execfile_paren)
        open_call = Node(syms.power, [Name("open"), open_args])
        read = [Node(syms.trailer, [Dot(), Name('read')]),
                Node(syms.trailer, [LParen(), RParen()])]
        open_expr = [open_call] + read
        # Wrap the open call in a compile call. This is so the filename will be
        # preserved in the execed code.
        filename_arg = filename.clone()
        filename_arg.prefix = " "
        exec_str = String("'exec'", " ")
        compile_args = open_expr + [Comma(), filename_arg, Comma(), exec_str]
        compile_call = Call(Name("compile"), compile_args, "")
        # Finally, replace the execfile call with an exec call.
        args = [compile_call]
        if globals is not None:
            args.extend([Comma(), globals.clone()])
        if locals is not None:
            args.extend([Comma(), locals.clone()])
        return Call(Name("exec"), args, prefix=node.prefix)
lib2to3/fixes/fix_reload.py000064400000002071151153537460011640 0ustar00"""Fixer for reload().

reload(s) -> importlib.reload(s)"""

# Local imports
from .. import fixer_base
from ..fixer_util import ImportAndCall, touch_import


class FixReload(fixer_base.BaseFix):
    BM_compatible = True
    order = "pre"

    PATTERN = """
    power< 'reload'
           trailer< lpar='('
                    ( not(arglist | argument<any '=' any>) obj=any
                      | obj=arglist<(not argument<any '=' any>) any ','> )
                    rpar=')' >
           after=any*
    >
    """

    def transform(self, node, results):
        if results:
            # I feel like we should be able to express this logic in the
            # PATTERN above but I don't know how to do it so...
            obj = results['obj']
            if obj:
                if (obj.type == self.syms.argument and
                    obj.children[0].value in {'**', '*'}):
                    return  # Make no change.
        names = ('importlib', 'reload')
        new = ImportAndCall(node, results, names)
        touch_import(None, 'importlib', node)
        return new
lib2to3/fixes/fix_filter.py000064400000005315151153537460011663 0ustar00# Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Fixer that changes filter(F, X) into list(filter(F, X)).

We avoid the transformation if the filter() call is directly contained
in iter(<>), list(<>), tuple(<>), sorted(<>), ...join(<>), or
for V in <>:.

NOTE: This is still not correct if the original code was depending on
filter(F, X) to return a string if X is a string and a tuple if X is a
tuple.  That would require type inference, which we don't do.  Let
Python 2.6 figure it out.
"""

# Local imports
from .. import fixer_base
from ..pytree import Node
from ..pygram import python_symbols as syms
from ..fixer_util import Name, ArgList, ListComp, in_special_context, parenthesize


class FixFilter(fixer_base.ConditionalFix):
    BM_compatible = True

    PATTERN = """
    filter_lambda=power<
        'filter'
        trailer<
            '('
            arglist<
                lambdef< 'lambda'
                         (fp=NAME | vfpdef< '(' fp=NAME ')'> ) ':' xp=any
                >
                ','
                it=any
            >
            ')'
        >
        [extra_trailers=trailer*]
    >
    |
    power<
        'filter'
        trailer< '(' arglist< none='None' ',' seq=any > ')' >
        [extra_trailers=trailer*]
    >
    |
    power<
        'filter'
        args=trailer< '(' [any] ')' >
        [extra_trailers=trailer*]
    >
    """

    skip_on = "future_builtins.filter"

    def transform(self, node, results):
        if self.should_skip(node):
            return

        trailers = []
        if 'extra_trailers' in results:
            for t in results['extra_trailers']:
                trailers.append(t.clone())

        if "filter_lambda" in results:
            xp = results.get("xp").clone()
            if xp.type == syms.test:
                xp.prefix = ""
                xp = parenthesize(xp)

            new = ListComp(results.get("fp").clone(),
                           results.get("fp").clone(),
                           results.get("it").clone(), xp)
            new = Node(syms.power, [new] + trailers, prefix="")

        elif "none" in results:
            new = ListComp(Name("_f"),
                           Name("_f"),
                           results["seq"].clone(),
                           Name("_f"))
            new = Node(syms.power, [new] + trailers, prefix="")

        else:
            if in_special_context(node):
                return None

            args = results['args'].clone()
            new = Node(syms.power, [Name("filter"), args], prefix="")
            new = Node(syms.power, [Name("list"), ArgList([new])] + trailers)
            new.prefix = ""
        new.prefix = node.prefix
        return new
lib2to3/fixes/fix_imports.py000064400000013064151153537460012073 0ustar00"""Fix incompatible imports and module references."""
# Authors: Collin Winter, Nick Edds

# Local imports
from .. import fixer_base
from ..fixer_util import Name, attr_chain

MAPPING = {'StringIO':  'io',
           'cStringIO': 'io',
           'cPickle': 'pickle',
           '__builtin__' : 'builtins',
           'copy_reg': 'copyreg',
           'Queue': 'queue',
           'SocketServer': 'socketserver',
           'ConfigParser': 'configparser',
           'repr': 'reprlib',
           'FileDialog': 'tkinter.filedialog',
           'tkFileDialog': 'tkinter.filedialog',
           'SimpleDialog': 'tkinter.simpledialog',
           'tkSimpleDialog': 'tkinter.simpledialog',
           'tkColorChooser': 'tkinter.colorchooser',
           'tkCommonDialog': 'tkinter.commondialog',
           'Dialog': 'tkinter.dialog',
           'Tkdnd': 'tkinter.dnd',
           'tkFont': 'tkinter.font',
           'tkMessageBox': 'tkinter.messagebox',
           'ScrolledText': 'tkinter.scrolledtext',
           'Tkconstants': 'tkinter.constants',
           'Tix': 'tkinter.tix',
           'ttk': 'tkinter.ttk',
           'Tkinter': 'tkinter',
           'markupbase': '_markupbase',
           '_winreg': 'winreg',
           'thread': '_thread',
           'dummy_thread': '_dummy_thread',
           # anydbm and whichdb are handled by fix_imports2
           'dbhash': 'dbm.bsd',
           'dumbdbm': 'dbm.dumb',
           'dbm': 'dbm.ndbm',
           'gdbm': 'dbm.gnu',
           'xmlrpclib': 'xmlrpc.client',
           'DocXMLRPCServer': 'xmlrpc.server',
           'SimpleXMLRPCServer': 'xmlrpc.server',
           'httplib': 'http.client',
           'htmlentitydefs' : 'html.entities',
           'HTMLParser' : 'html.parser',
           'Cookie': 'http.cookies',
           'cookielib': 'http.cookiejar',
           'BaseHTTPServer': 'http.server',
           'SimpleHTTPServer': 'http.server',
           'CGIHTTPServer': 'http.server',
           #'test.test_support': 'test.support',
           'commands': 'subprocess',
           'UserString' : 'collections',
           'UserList' : 'collections',
           'urlparse' : 'urllib.parse',
           'robotparser' : 'urllib.robotparser',
}


def alternates(members):
    return "(" + "|".join(map(repr, members)) + ")"


def build_pattern(mapping=MAPPING):
    mod_list = ' | '.join(["module_name='%s'" % key for key in mapping])
    bare_names = alternates(mapping.keys())

    yield """name_import=import_name< 'import' ((%s) |
               multiple_imports=dotted_as_names< any* (%s) any* >) >
          """ % (mod_list, mod_list)
    yield """import_from< 'from' (%s) 'import' ['(']
              ( any | import_as_name< any 'as' any > |
                import_as_names< any* >)  [')'] >
          """ % mod_list
    yield """import_name< 'import' (dotted_as_name< (%s) 'as' any > |
               multiple_imports=dotted_as_names<
                 any* dotted_as_name< (%s) 'as' any > any* >) >
          """ % (mod_list, mod_list)

    # Find usages of module members in code e.g. thread.foo(bar)
    yield "power< bare_with_attr=(%s) trailer<'.' any > any* >" % bare_names


class FixImports(fixer_base.BaseFix):

    BM_compatible = True
    keep_line_order = True
    # This is overridden in fix_imports2.
    mapping = MAPPING

    # We want to run this fixer late, so fix_import doesn't try to make stdlib
    # renames into relative imports.
    run_order = 6

    def build_pattern(self):
        return "|".join(build_pattern(self.mapping))

    def compile_pattern(self):
        # We override this, so MAPPING can be pragmatically altered and the
        # changes will be reflected in PATTERN.
        self.PATTERN = self.build_pattern()
        super(FixImports, self).compile_pattern()

    # Don't match the node if it's within another match.
    def match(self, node):
        match = super(FixImports, self).match
        results = match(node)
        if results:
            # Module usage could be in the trailer of an attribute lookup, so we
            # might have nested matches when "bare_with_attr" is present.
            if "bare_with_attr" not in results and \
                    any(match(obj) for obj in attr_chain(node, "parent")):
                return False
            return results
        return False

    def start_tree(self, tree, filename):
        super(FixImports, self).start_tree(tree, filename)
        self.replace = {}

    def transform(self, node, results):
        import_mod = results.get("module_name")
        if import_mod:
            mod_name = import_mod.value
            new_name = self.mapping[mod_name]
            import_mod.replace(Name(new_name, prefix=import_mod.prefix))
            if "name_import" in results:
                # If it's not a "from x import x, y" or "import x as y" import,
                # marked its usage to be replaced.
                self.replace[mod_name] = new_name
            if "multiple_imports" in results:
                # This is a nasty hack to fix multiple imports on a line (e.g.,
                # "import StringIO, urlparse"). The problem is that I can't
                # figure out an easy way to make a pattern recognize the keys of
                # MAPPING randomly sprinkled in an import statement.
                results = self.match(node)
                if results:
                    self.transform(node, results)
        else:
            # Replace usage of the module.
            bare_name = results["bare_with_attr"][0]
            new_name = self.replace.get(bare_name.value)
            if new_name:
                bare_name.replace(Name(new_name, prefix=bare_name.prefix))
lib2to3/fixes/fix_itertools_imports.py000064400000004046151153537460014177 0ustar00""" Fixer for imports of itertools.(imap|ifilter|izip|ifilterfalse) """

# Local imports
from lib2to3 import fixer_base
from lib2to3.fixer_util import BlankLine, syms, token


class FixItertoolsImports(fixer_base.BaseFix):
    BM_compatible = True
    PATTERN = """
              import_from< 'from' 'itertools' 'import' imports=any >
              """ %(locals())

    def transform(self, node, results):
        imports = results['imports']
        if imports.type == syms.import_as_name or not imports.children:
            children = [imports]
        else:
            children = imports.children
        for child in children[::2]:
            if child.type == token.NAME:
                member = child.value
                name_node = child
            elif child.type == token.STAR:
                # Just leave the import as is.
                return
            else:
                assert child.type == syms.import_as_name
                name_node = child.children[0]
            member_name = name_node.value
            if member_name in ('imap', 'izip', 'ifilter'):
                child.value = None
                child.remove()
            elif member_name in ('ifilterfalse', 'izip_longest'):
                node.changed()
                name_node.value = ('filterfalse' if member_name[1] == 'f'
                                   else 'zip_longest')

        # Make sure the import statement is still sane
        children = imports.children[:] or [imports]
        remove_comma = True
        for child in children:
            if remove_comma and child.type == token.COMMA:
                child.remove()
            else:
                remove_comma ^= True

        while children and children[-1].type == token.COMMA:
            children.pop().remove()

        # If there are no imports left, just get rid of the entire statement
        if (not (imports.children or getattr(imports, 'value', None)) or
            imports.parent is None):
            p = node.prefix
            node = BlankLine()
            node.prefix = p
            return node
lib2to3/fixes/fix_raw_input.py000064400000000706151153537460012405 0ustar00"""Fixer that changes raw_input(...) into input(...)."""
# Author: Andre Roberge

# Local imports
from .. import fixer_base
from ..fixer_util import Name

class FixRawInput(fixer_base.BaseFix):

    BM_compatible = True
    PATTERN = """
              power< name='raw_input' trailer< '(' [any] ')' > any* >
              """

    def transform(self, node, results):
        name = results["name"]
        name.replace(Name("input", prefix=name.prefix))
lib2to3/fixes/fix_has_key.py000064400000006174151153537460012025 0ustar00# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Fixer for has_key().

Calls to .has_key() methods are expressed in terms of the 'in'
operator:

    d.has_key(k) -> k in d

CAVEATS:
1) While the primary target of this fixer is dict.has_key(), the
   fixer will change any has_key() method call, regardless of its
   class.

2) Cases like this will not be converted:

    m = d.has_key
    if m(k):
        ...

   Only *calls* to has_key() are converted. While it is possible to
   convert the above to something like

    m = d.__contains__
    if m(k):
        ...

   this is currently not done.
"""

# Local imports
from .. import pytree
from .. import fixer_base
from ..fixer_util import Name, parenthesize


class FixHasKey(fixer_base.BaseFix):
    BM_compatible = True

    PATTERN = """
    anchor=power<
        before=any+
        trailer< '.' 'has_key' >
        trailer<
            '('
            ( not(arglist | argument<any '=' any>) arg=any
            | arglist<(not argument<any '=' any>) arg=any ','>
            )
            ')'
        >
        after=any*
    >
    |
    negation=not_test<
        'not'
        anchor=power<
            before=any+
            trailer< '.' 'has_key' >
            trailer<
                '('
                ( not(arglist | argument<any '=' any>) arg=any
                | arglist<(not argument<any '=' any>) arg=any ','>
                )
                ')'
            >
        >
    >
    """

    def transform(self, node, results):
        assert results
        syms = self.syms
        if (node.parent.type == syms.not_test and
            self.pattern.match(node.parent)):
            # Don't transform a node matching the first alternative of the
            # pattern when its parent matches the second alternative
            return None
        negation = results.get("negation")
        anchor = results["anchor"]
        prefix = node.prefix
        before = [n.clone() for n in results["before"]]
        arg = results["arg"].clone()
        after = results.get("after")
        if after:
            after = [n.clone() for n in after]
        if arg.type in (syms.comparison, syms.not_test, syms.and_test,
                        syms.or_test, syms.test, syms.lambdef, syms.argument):
            arg = parenthesize(arg)
        if len(before) == 1:
            before = before[0]
        else:
            before = pytree.Node(syms.power, before)
        before.prefix = " "
        n_op = Name("in", prefix=" ")
        if negation:
            n_not = Name("not", prefix=" ")
            n_op = pytree.Node(syms.comp_op, (n_not, n_op))
        new = pytree.Node(syms.comparison, (arg, n_op, before))
        if after:
            new = parenthesize(new)
            new = pytree.Node(syms.power, (new,) + tuple(after))
        if node.parent.type in (syms.comparison, syms.expr, syms.xor_expr,
                                syms.and_expr, syms.shift_expr,
                                syms.arith_expr, syms.term,
                                syms.factor, syms.power):
            new = parenthesize(new)
        new.prefix = prefix
        return new
lib2to3/fixes/fix_next.py000064400000006146151153537460011357 0ustar00"""Fixer for it.next() -> next(it), per PEP 3114."""
# Author: Collin Winter

# Things that currently aren't covered:
#   - listcomp "next" names aren't warned
#   - "with" statement targets aren't checked

# Local imports
from ..pgen2 import token
from ..pygram import python_symbols as syms
from .. import fixer_base
from ..fixer_util import Name, Call, find_binding

bind_warning = "Calls to builtin next() possibly shadowed by global binding"


class FixNext(fixer_base.BaseFix):
    BM_compatible = True
    PATTERN = """
    power< base=any+ trailer< '.' attr='next' > trailer< '(' ')' > >
    |
    power< head=any+ trailer< '.' attr='next' > not trailer< '(' ')' > >
    |
    classdef< 'class' any+ ':'
              suite< any*
                     funcdef< 'def'
                              name='next'
                              parameters< '(' NAME ')' > any+ >
                     any* > >
    |
    global=global_stmt< 'global' any* 'next' any* >
    """

    order = "pre" # Pre-order tree traversal

    def start_tree(self, tree, filename):
        super(FixNext, self).start_tree(tree, filename)

        n = find_binding('next', tree)
        if n:
            self.warning(n, bind_warning)
            self.shadowed_next = True
        else:
            self.shadowed_next = False

    def transform(self, node, results):
        assert results

        base = results.get("base")
        attr = results.get("attr")
        name = results.get("name")

        if base:
            if self.shadowed_next:
                attr.replace(Name("__next__", prefix=attr.prefix))
            else:
                base = [n.clone() for n in base]
                base[0].prefix = ""
                node.replace(Call(Name("next", prefix=node.prefix), base))
        elif name:
            n = Name("__next__", prefix=name.prefix)
            name.replace(n)
        elif attr:
            # We don't do this transformation if we're assigning to "x.next".
            # Unfortunately, it doesn't seem possible to do this in PATTERN,
            #  so it's being done here.
            if is_assign_target(node):
                head = results["head"]
                if "".join([str(n) for n in head]).strip() == '__builtin__':
                    self.warning(node, bind_warning)
                return
            attr.replace(Name("__next__"))
        elif "global" in results:
            self.warning(node, bind_warning)
            self.shadowed_next = True


### The following functions help test if node is part of an assignment
###  target.

def is_assign_target(node):
    assign = find_assign(node)
    if assign is None:
        return False

    for child in assign.children:
        if child.type == token.EQUAL:
            return False
        elif is_subtree(child, node):
            return True
    return False

def find_assign(node):
    if node.type == syms.expr_stmt:
        return node
    if node.type == syms.simple_stmt or node.parent is None:
        return None
    return find_assign(node.parent)

def is_subtree(root, node):
    if root == node:
        return True
    return any(is_subtree(c, node) for c in root.children)
lib2to3/fixes/fix_tuple_params.py000064400000012675151153537460013101 0ustar00"""Fixer for function definitions with tuple parameters.

def func(((a, b), c), d):
    ...

    ->

def func(x, d):
    ((a, b), c) = x
    ...

It will also support lambdas:

    lambda (x, y): x + y -> lambda t: t[0] + t[1]

    # The parens are a syntax error in Python 3
    lambda (x): x + y -> lambda x: x + y
"""
# Author: Collin Winter

# Local imports
from .. import pytree
from ..pgen2 import token
from .. import fixer_base
from ..fixer_util import Assign, Name, Newline, Number, Subscript, syms

def is_docstring(stmt):
    return isinstance(stmt, pytree.Node) and \
           stmt.children[0].type == token.STRING

class FixTupleParams(fixer_base.BaseFix):
    run_order = 4 #use a lower order since lambda is part of other
                  #patterns
    BM_compatible = True

    PATTERN = """
              funcdef< 'def' any parameters< '(' args=any ')' >
                       ['->' any] ':' suite=any+ >
              |
              lambda=
              lambdef< 'lambda' args=vfpdef< '(' inner=any ')' >
                       ':' body=any
              >
              """

    def transform(self, node, results):
        if "lambda" in results:
            return self.transform_lambda(node, results)

        new_lines = []
        suite = results["suite"]
        args = results["args"]
        # This crap is so "def foo(...): x = 5; y = 7" is handled correctly.
        # TODO(cwinter): suite-cleanup
        if suite[0].children[1].type == token.INDENT:
            start = 2
            indent = suite[0].children[1].value
            end = Newline()
        else:
            start = 0
            indent = "; "
            end = pytree.Leaf(token.INDENT, "")

        # We need access to self for new_name(), and making this a method
        #  doesn't feel right. Closing over self and new_lines makes the
        #  code below cleaner.
        def handle_tuple(tuple_arg, add_prefix=False):
            n = Name(self.new_name())
            arg = tuple_arg.clone()
            arg.prefix = ""
            stmt = Assign(arg, n.clone())
            if add_prefix:
                n.prefix = " "
            tuple_arg.replace(n)
            new_lines.append(pytree.Node(syms.simple_stmt,
                                         [stmt, end.clone()]))

        if args.type == syms.tfpdef:
            handle_tuple(args)
        elif args.type == syms.typedargslist:
            for i, arg in enumerate(args.children):
                if arg.type == syms.tfpdef:
                    # Without add_prefix, the emitted code is correct,
                    #  just ugly.
                    handle_tuple(arg, add_prefix=(i > 0))

        if not new_lines:
            return

        # This isn't strictly necessary, but it plays nicely with other fixers.
        # TODO(cwinter) get rid of this when children becomes a smart list
        for line in new_lines:
            line.parent = suite[0]

        # TODO(cwinter) suite-cleanup
        after = start
        if start == 0:
            new_lines[0].prefix = " "
        elif is_docstring(suite[0].children[start]):
            new_lines[0].prefix = indent
            after = start + 1

        for line in new_lines:
            line.parent = suite[0]
        suite[0].children[after:after] = new_lines
        for i in range(after+1, after+len(new_lines)+1):
            suite[0].children[i].prefix = indent
        suite[0].changed()

    def transform_lambda(self, node, results):
        args = results["args"]
        body = results["body"]
        inner = simplify_args(results["inner"])

        # Replace lambda ((((x)))): x  with lambda x: x
        if inner.type == token.NAME:
            inner = inner.clone()
            inner.prefix = " "
            args.replace(inner)
            return

        params = find_params(args)
        to_index = map_to_index(params)
        tup_name = self.new_name(tuple_name(params))

        new_param = Name(tup_name, prefix=" ")
        args.replace(new_param.clone())
        for n in body.post_order():
            if n.type == token.NAME and n.value in to_index:
                subscripts = [c.clone() for c in to_index[n.value]]
                new = pytree.Node(syms.power,
                                  [new_param.clone()] + subscripts)
                new.prefix = n.prefix
                n.replace(new)


### Helper functions for transform_lambda()

def simplify_args(node):
    if node.type in (syms.vfplist, token.NAME):
        return node
    elif node.type == syms.vfpdef:
        # These look like vfpdef< '(' x ')' > where x is NAME
        # or another vfpdef instance (leading to recursion).
        while node.type == syms.vfpdef:
            node = node.children[1]
        return node
    raise RuntimeError("Received unexpected node %s" % node)

def find_params(node):
    if node.type == syms.vfpdef:
        return find_params(node.children[1])
    elif node.type == token.NAME:
        return node.value
    return [find_params(c) for c in node.children if c.type != token.COMMA]

def map_to_index(param_list, prefix=[], d=None):
    if d is None:
        d = {}
    for i, obj in enumerate(param_list):
        trailer = [Subscript(Number(str(i)))]
        if isinstance(obj, list):
            map_to_index(obj, trailer, d=d)
        else:
            d[obj] = prefix + trailer
    return d

def tuple_name(param_list):
    l = []
    for obj in param_list:
        if isinstance(obj, list):
            l.append(tuple_name(obj))
        else:
            l.append(obj)
    return "_".join(l)
lib2to3/fixes/__pycache__/fix_types.cpython-38.pyc000064400000003450151153537460016026 0ustar00U

e5d��@spdZddlmZddlmZddddddd	d
dddd
dddddddddd�Zdd�eD�ZGdd�dej�ZdS)a�Fixer for removing uses of the types module.

These work for only the known names in the types module.  The forms above
can include types. or not.  ie, It is assumed the module is imported either as:

    import types
    from types import ... # either * or specific types

The import statements are not modified.

There should be another fixer that handles at least the following constants:

   type([]) -> list
   type(()) -> tuple
   type('') -> str

�)�
fixer_base)�Name�bool�
memoryview�type�complex�dictztype(Ellipsis)�float�int�list�objectz
type(None)ztype(NotImplemented)�slice�bytesz(str,)�tuple�str�range)ZBooleanTypeZ
BufferTypeZ	ClassTypeZComplexTypeZDictTypeZDictionaryTypeZEllipsisTypeZ	FloatTypeZIntTypeZListTypeZLongTypeZ
ObjectTypeZNoneTypeZNotImplementedTypeZ	SliceTypeZ
StringTypeZStringTypesZ	TupleTypeZTypeTypeZUnicodeTypeZ
XRangeTypecCsg|]}d|�qS)z)power< 'types' trailer< '.' name='%s' > >�)�.0�trr�//usr/lib64/python3.8/lib2to3/fixes/fix_types.py�
<listcomp>3src@s"eZdZdZd�e�Zdd�ZdS)�FixTypesT�|cCs&t�|dj�}|r"t||jd�SdS)N�name)�prefix)�
_TYPE_MAPPING�get�valuerr)�selfZnodeZresultsZ	new_valuerrr�	transform9szFixTypes.transformN)�__name__�
__module__�__qualname__Z
BM_compatible�join�_patsZPATTERNrrrrrr5s
rN)	�__doc__�rZ
fixer_utilrrr$ZBaseFixrrrrr�<module>s4�lib2to3/fixes/__pycache__/fix_metaclass.cpython-38.pyc000064400000012336151153537460016641 0ustar00U

e5d �@svdZddlmZddlmZddlmZmZmZdd�Z	dd�Z
d	d
�Zdd�Zd
d�Z
dd�ZGdd�dej�ZdS)a�Fixer for __metaclass__ = X -> (metaclass=X) methods.

   The various forms of classef (inherits nothing, inherits once, inherits
   many) don't parse the same in the CST so we look at ALL classes for
   a __metaclass__ and if we find one normalize the inherits to all be
   an arglist.

   For one-liner classes ('class X: pass') there is no indent/dedent so
   we normalize those into having a suite.

   Moving the __metaclass__ into the classdef can also cause the class
   body to be empty so there is some special casing for that as well.

   This fixer also tries very hard to keep original indenting and spacing
   in all those corner cases.

�)�
fixer_base)�token)�syms�Node�LeafcCsz|jD]n}|jtjkr"t|�S|jtjkr|jr|jd}|jtjkr|jr|jd}t|t�r|j	dkrdSqdS)z� we have to check the cls_node without changing it.
        There are two possibilities:
          1)  clsdef => suite => simple_stmt => expr_stmt => Leaf('__meta')
          2)  clsdef => simple_stmt => expr_stmt => Leaf('__meta')
    ��
__metaclass__TF)
�children�typer�suite�
has_metaclass�simple_stmt�	expr_stmt�
isinstancer�value)�parent�node�	expr_nodeZ	left_side�r�3/usr/lib64/python3.8/lib2to3/fixes/fix_metaclass.pyrs



�rcCs�|jD]}|jtjkrdSqt|j�D]\}}|jtjkr(qJq(td��ttjg�}|j|dd�r�|j|d}|�	|�
��|��qV|�	|�|}dS)zf one-line classes don't get a suite in the parse tree so we add
        one to normalize the tree
    NzNo class suite and no ':'!�)r	r
rr�	enumerater�COLON�
ValueErrorr�append_child�clone�remove)�cls_noder�ir�	move_noderrr�fixup_parse_tree-s


r c
Cs�t|j�D]\}}|jtjkr
q(q
dS|��ttjg�}ttj	|g�}|j|d�rz|j|}|�
|���|��qJ|�||�|jdjd}|jdjd}	|	j
|_
dS)z� if there is a semi-colon all the parts count as part of the same
        simple_stmt.  We just want the __metaclass__ part so we move
        everything after the semi-colon into its own simple_stmt node
    Nr)rr	r
r�SEMIrrrrr
rr�insert_child�prefix)
rrZ	stmt_nodeZsemi_indrZnew_exprZnew_stmtrZ	new_leaf1Z	old_leaf1rrr�fixup_simple_stmtGs

r$cCs*|jr&|jdjtjkr&|jd��dS)N���)r	r
r�NEWLINEr)rrrr�remove_trailing_newline_sr'ccs�|jD]}|jtjkrq$qtd��tt|j��D]t\}}|jtjkr2|jr2|jd}|jtjkr2|jr2|jd}t	|t
�r2|jdkr2t|||�t
|�|||fVq2dS)NzNo class suite!rr)r	r
rrr�listrr
rrrrr$r')rrrZsimple_noderZ	left_noderrr�
find_metasds



�r)cCsz|jddd�}|r,|��}|jtjkrq,q|rv|��}t|t�r^|jtjkr^|jrZd|_dS|�	|jddd��q,dS)z� If an INDENT is followed by a thing with a prefix then nuke the prefix
        Otherwise we get in trouble when removing __metaclass__ at suite start
    Nr%�)
r	�popr
r�INDENTrr�DEDENTr#�extend)rZkidsrrrr�fixup_indent{sr/c@seZdZdZdZdd�ZdS)�FixMetaclassTz
    classdef<any*>
    cCsJt|�sdSt|�d}t|�D]\}}}|}|��q |jdj}t|j�dkr�|jdjtjkrp|jd}n(|jd�	�}	t
tj|	g�}|�d|�n�t|j�dkr�t
tjg�}|�d|�nZt|j�dk�rt
tjg�}|�dt
tjd��|�d|�|�dt
tjd��ntd	��|jdjd}
d
|
_|
j}|j�rZ|�t
tjd��d|
_nd
|
_|jd}|jtjk�s|t�d
|jd_d
|jd_|�|�t|�|j�s�|��t
|d�}
||
_|�|
�|�t
tjd��nbt|j�dk�rF|jdjtjk�rF|jdjtjk�rFt
|d�}
|�d|
�|�dt
tjd��dS)Nr����r�)�(zUnexpected class definition�	metaclass�,� r*r�pass�
���r%)rr r)rr	r
�lenr�arglistrrZ	set_childr"rr�RPAR�LPARrrr#r�COMMAr�AssertionErrorr/r&r,r-)�selfrZresultsZlast_metaclassrrZstmtZ	text_typer>rZmeta_txtZorig_meta_prefixrZ	pass_leafrrr�	transform�sd




��
zFixMetaclass.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrDrrrrr0�sr0N)�__doc__r*rZpygramrZ
fixer_utilrrrrr r$r'r)r/ZBaseFixr0rrrr�<module>slib2to3/fixes/__pycache__/fix_zip.cpython-38.opt-1.pyc000064400000003052151153537460016421 0ustar00U

e5d	�@sRdZddlmZddlmZddlmZddlm	Z	m
Z
mZGdd�dej�Z
dS)	a7
Fixer that changes zip(seq0, seq1, ...) into list(zip(seq0, seq1, ...)
unless there exists a 'from future_builtins import zip' statement in the
top-level namespace.

We avoid the transformation if the zip() call is directly contained in
iter(<>), list(<>), tuple(<>), sorted(<>), ...join(<>), or for V in <>:.
�)�
fixer_base)�Node)�python_symbols)�Name�ArgList�in_special_contextc@s eZdZdZdZdZdd�ZdS)�FixZipTzN
    power< 'zip' args=trailer< '(' [any] ')' > [trailers=trailer*]
    >
    zfuture_builtins.zipcCs�|�|�rdSt|�rdS|d��}d|_g}d|krZdd�|dD�}|D]
}d|_qNttjtd�|gdd�}ttjtd�t|g�g|�}|j|_|S)	N�args��trailerscSsg|]}|���qS�)�clone)�.0�nrr�-/usr/lib64/python3.8/lib2to3/fixes/fix_zip.py�
<listcomp>'sz$FixZip.transform.<locals>.<listcomp>�zip)�prefix�list)	Zshould_skiprr
rr�symsZpowerrr)�selfZnodeZresultsr	rr�newrrr�	transforms
zFixZip.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNZskip_onrrrrrrsrN)�__doc__r
rZpytreerZpygramrrZ
fixer_utilrrrZConditionalFixrrrrr�<module>s

lib2to3/fixes/__pycache__/fix_execfile.cpython-38.pyc000064400000003234151153537460016446 0ustar00U

e5d�@sVdZddlmZddlmZmZmZmZmZm	Z	m
Z
mZmZm
Z
Gdd�dej�ZdS)zoFixer for execfile.

This converts usages of the execfile function into calls to the built-in
exec() function.
�)�
fixer_base)
�Comma�Name�Call�LParen�RParen�Dot�Node�ArgList�String�symsc@seZdZdZdZdd�ZdS)�FixExecfileTz�
    power< 'execfile' trailer< '(' arglist< filename=any [',' globals=any [',' locals=any ] ] > ')' > >
    |
    power< 'execfile' trailer< '(' filename=any ')' > >
    cCs.|st�|d}|�d�}|�d�}|jdjd��}t|��t�tdd�g|d�}ttj	t
d�|g�}ttjt�t
d	�g�ttjt
�t�g�g}	|g|	}
|��}d|_td
d�}|
t�|t�|g}
tt
d�|
d�}|g}|dk	r�|�t�|��g�|dk	�r|�t�|��g�tt
d
�||jd�S)N�filename�globals�locals���z"rb"� )Zrparen�open�readz'exec'�compile��exec)�prefix)�AssertionError�getZchildrenZcloner
rrr	rZpowerrZtrailerrrrrr�extend)�selfZnodeZresultsrrrZexecfile_parenZ	open_argsZ	open_callrZ	open_exprZfilename_argZexec_strZcompile_argsZcompile_call�args�r�2/usr/lib64/python3.8/lib2to3/fixes/fix_execfile.py�	transforms0

��


zFixExecfile.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr rrrrr
sr
N)�__doc__rrZ
fixer_utilrrrrrrr	r
rrZBaseFixr
rrrr�<module>s0lib2to3/fixes/__pycache__/fix_dict.cpython-38.pyc000064400000006402151153537460015605 0ustar00U

e5d��@sjdZddlmZddlmZddlmZddlmZmZmZddlmZej	dhBZ
Gdd	�d	ej�Zd
S)ajFixer for dict methods.

d.keys() -> list(d.keys())
d.items() -> list(d.items())
d.values() -> list(d.values())

d.iterkeys() -> iter(d.keys())
d.iteritems() -> iter(d.items())
d.itervalues() -> iter(d.values())

d.viewkeys() -> d.keys()
d.viewitems() -> d.items()
d.viewvalues() -> d.values()

Except in certain very specific contexts: the iter() can be dropped
when the context is list(), sorted(), iter() or for...in; the list()
can be dropped when the context is list() or sorted() (but not iter()
or for...in!). Special contexts that apply to both: list(), sorted(), tuple()
set(), any(), all(), sum().

Note: iter(d.keys()) could be written as iter(d) but since the
original d.iterkeys() was also redundant we don't fix this.  And there
are (rare) contexts where it makes a difference (e.g. when passing it
as an argument to a function that introspects the argument).
�)�pytree)�patcomp)�
fixer_base)�Name�Call�Dot)�
fixer_util�iterc@s@eZdZdZdZdd�ZdZe�e�Z	dZ
e�e
�Zdd�Zd	S)
�FixDictTa
    power< head=any+
         trailer< '.' method=('keys'|'items'|'values'|
                              'iterkeys'|'iteritems'|'itervalues'|
                              'viewkeys'|'viewitems'|'viewvalues') >
         parens=trailer< '(' ')' >
         tail=any*
    >
    c
	Cs|d}|dd}|d}|j}|j}|�d�}|�d�}	|sD|	rP|dd�}|dksdtt|���d	d
�|D�}dd
�|D�}|o�|�||�}
|t�|jt	�t
||jd�g�|d
��g}t�|j
|�}|
s�|	s�d|_tt
|r�dnd�|g�}|�rt�|j
|g|�}|j|_|S)N�head�method��tailr	Zview�)�keys�items�valuescSsg|]}|���qS���clone��.0�nrr�./usr/lib64/python3.8/lib2to3/fixes/fix_dict.py�
<listcomp>Asz%FixDict.transform.<locals>.<listcomp>cSsg|]}|���qSrrrrrrrBs)�prefixZparens��list)�syms�value�
startswith�AssertionError�repr�in_special_contextrZNodeZtrailerrrrrZpowerr)
�self�node�resultsrrrrZmethod_name�isiterZisviewZspecial�args�newrrr�	transform6s<


���
�zFixDict.transformz3power< func=NAME trailer< '(' node=any ')' > any* >zmfor_stmt< 'for' any 'in' node=any ':' any* >
            | comp_for< 'for' any 'in' node=any any* >
         cCs�|jdkrdSi}|jjdk	r^|j�|jj|�r^|d|kr^|rN|djtkS|djtjkS|sfdS|j�|j|�o�|d|kS)NFr%�func)�parent�p1�matchr�iter_exemptr�consuming_calls�p2)r$r%r'r&rrrr#Zs
�
�zFixDict.in_special_contextN)
�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr*ZP1rZcompile_patternr-ZP2r1r#rrrrr
)s


r
N)
�__doc__rrrrrrrrr0r/ZBaseFixr
rrrr�<module>slib2to3/fixes/__pycache__/fix_reduce.cpython-38.opt-1.pyc000064400000002143151153537460017066 0ustar00U

e5dE�@s2dZddlmZddlmZGdd�dej�ZdS)zqFixer for reduce().

Makes sure reduce() is imported from the functools module if reduce is
used in that module.
�)�
fixer_base��touch_importc@s eZdZdZdZdZdd�ZdS)�	FixReduceTZpreai
    power< 'reduce'
        trailer< '('
            arglist< (
                (not(argument<any '=' any>) any ','
                 not(argument<any '=' any>) any) |
                (not(argument<any '=' any>) any ','
                 not(argument<any '=' any>) any ','
                 not(argument<any '=' any>) any)
            ) >
        ')' >
    >
    cCstdd|�dS)N�	functools�reducer)�selfZnodeZresults�r	�0/usr/lib64/python3.8/lib2to3/fixes/fix_reduce.py�	transform"szFixReduce.transformN)�__name__�
__module__�__qualname__Z
BM_compatible�orderZPATTERNrr	r	r	r
rsrN)�__doc__Zlib2to3rZlib2to3.fixer_utilrZBaseFixrr	r	r	r
�<module>slib2to3/fixes/__pycache__/fix_execfile.cpython-38.opt-2.pyc000064400000003002151153537460017377 0ustar00U

e5d�@sRddlmZddlmZmZmZmZmZmZm	Z	m
Z
mZmZGdd�dej
�ZdS)�)�
fixer_base)
�Comma�Name�Call�LParen�RParen�Dot�Node�ArgList�String�symsc@seZdZdZdZdd�ZdS)�FixExecfileTz�
    power< 'execfile' trailer< '(' arglist< filename=any [',' globals=any [',' locals=any ] ] > ')' > >
    |
    power< 'execfile' trailer< '(' filename=any ')' > >
    cCs&|d}|�d�}|�d�}|jdjd��}t|��t�tdd�g|d�}ttjt	d�|g�}ttj
t�t	d	�g�ttj
t�t
�g�g}	|g|	}
|��}d|_td
d�}|
t�|t�|g}
tt	d�|
d�}|g}|dk	r�|�t�|��g�|dk	�r|�t�|��g�tt	d
�||jd�S)N�filename�globals�locals���z"rb"� )Zrparen�open�readz'exec'�compile��exec)�prefix)�getZchildrenZcloner
rrr	rZpowerrZtrailerrrrrr�extend)�selfZnodeZresultsrrrZexecfile_parenZ	open_argsZ	open_callrZ	open_exprZfilename_argZexec_strZcompile_argsZcompile_call�args�r�2/usr/lib64/python3.8/lib2to3/fixes/fix_execfile.py�	transforms.

��


zFixExecfile.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrrrrrr
sr
N)rrZ
fixer_utilrrrrrrr	r
rrZBaseFixr
rrrr�<module>
s0lib2to3/fixes/__pycache__/fix_intern.cpython-38.opt-2.pyc000064400000002051151153537460017115 0ustar00U

e5dx�@s2ddlmZddlmZmZGdd�dej�ZdS)�)�
fixer_base)�
ImportAndCall�touch_importc@s eZdZdZdZdZdd�ZdS)�	FixInternTZprez�
    power< 'intern'
           trailer< lpar='('
                    ( not(arglist | argument<any '=' any>) obj=any
                      | obj=arglist<(not argument<any '=' any>) any ','> )
                    rpar=')' >
           after=any*
    >
    cCsR|r2|d}|r2|j|jjkr2|jdjdkr2dSd}t|||�}tdd|�|S)N�obj�>�**�*)�sys�internr
)�typeZsymsZargumentZchildren�valuerr)�selfZnodeZresultsr�names�new�r�0/usr/lib64/python3.8/lib2to3/fixes/fix_intern.py�	transforms�zFixIntern.transformN)�__name__�
__module__�__qualname__Z
BM_compatible�orderZPATTERNrrrrrr
s
rN)�rZ
fixer_utilrrZBaseFixrrrrr�<module>	slib2to3/fixes/__pycache__/fix_reduce.cpython-38.pyc000064400000002143151153537460016127 0ustar00U

e5dE�@s2dZddlmZddlmZGdd�dej�ZdS)zqFixer for reduce().

Makes sure reduce() is imported from the functools module if reduce is
used in that module.
�)�
fixer_base��touch_importc@s eZdZdZdZdZdd�ZdS)�	FixReduceTZpreai
    power< 'reduce'
        trailer< '('
            arglist< (
                (not(argument<any '=' any>) any ','
                 not(argument<any '=' any>) any) |
                (not(argument<any '=' any>) any ','
                 not(argument<any '=' any>) any ','
                 not(argument<any '=' any>) any)
            ) >
        ')' >
    >
    cCstdd|�dS)N�	functools�reducer)�selfZnodeZresults�r	�0/usr/lib64/python3.8/lib2to3/fixes/fix_reduce.py�	transform"szFixReduce.transformN)�__name__�
__module__�__qualname__Z
BM_compatible�orderZPATTERNrr	r	r	r
rsrN)�__doc__Zlib2to3rZlib2to3.fixer_utilrZBaseFixrr	r	r	r
�<module>slib2to3/fixes/__pycache__/fix_repr.cpython-38.opt-1.pyc000064400000001510151153537460016564 0ustar00U

e5de�@s:dZddlmZddlmZmZmZGdd�dej�ZdS)z/Fixer that transforms `xyzzy` into repr(xyzzy).�)�
fixer_base)�Call�Name�parenthesizec@seZdZdZdZdd�ZdS)�FixReprTz7
              atom < '`' expr=any '`' >
              cCs8|d��}|j|jjkr"t|�}ttd�|g|jd�S)N�expr�repr)�prefix)Zclone�typeZsymsZ	testlist1rrrr	)�selfZnodeZresultsr�r�./usr/lib64/python3.8/lib2to3/fixes/fix_repr.py�	transformszFixRepr.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrrrrr
rsrN)	�__doc__�rZ
fixer_utilrrrZBaseFixrrrrr
�<module>slib2to3/fixes/__pycache__/fix_map.cpython-38.pyc000064400000006024151153537460015437 0ustar00U

e5d8�@sfdZddlmZddlmZddlmZmZmZm	Z	m
Z
ddlmZ
ddlmZGdd�dej�Zd	S)
aFixer that changes map(F, ...) into list(map(F, ...)) unless there
exists a 'from future_builtins import map' statement in the top-level
namespace.

As a special case, map(None, X) is changed into list(X).  (This is
necessary because the semantics are changed in this case -- the new
map(None, X) is equivalent to [(x,) for x in X].)

We avoid the transformation (except for the special case mentioned
above) if the map() call is directly contained in iter(<>), list(<>),
tuple(<>), sorted(<>), ...join(<>), or for V in <>:.

NOTE: This is still not correct if the original code was depending on
map(F, X, Y, ...) to go on until the longest argument is exhausted,
substituting None for missing values -- like zip(), it now stops as
soon as the shortest argument is exhausted.
�)�token)�
fixer_base)�Name�ArgList�Call�ListComp�in_special_context)�python_symbols)�Nodec@s eZdZdZdZdZdd�ZdS)�FixMapTaL
    map_none=power<
        'map'
        trailer< '(' arglist< 'None' ',' arg=any [','] > ')' >
        [extra_trailers=trailer*]
    >
    |
    map_lambda=power<
        'map'
        trailer<
            '('
            arglist<
                lambdef< 'lambda'
                         (fp=NAME | vfpdef< '(' fp=NAME ')'> ) ':' xp=any
                >
                ','
                it=any
            >
            ')'
        >
        [extra_trailers=trailer*]
    >
    |
    power<
        'map' args=trailer< '(' [any] ')' >
        [extra_trailers=trailer*]
    >
    zfuture_builtins.mapcCs�|�|�rdSg}d|kr6|dD]}|�|���q"|jjtjkrr|�|d�|��}d|_t	t
d�|g�}�n&d|kr�t|d��|d��|d���}ttj
|g|dd	�}n�d
|kr�|d��}d|_n�d|k�rf|d}|jtjk�rH|jd
jtjk�rH|jd
jdjtjk�rH|jd
jdjdk�rH|�|d�dSttj
t
d�|��g�}d|_t|��rtdSttj
t
d�t|g�g|�}d|_|j|_|S)NZextra_trailerszYou should use a for loop here��listZ
map_lambdaZxp�fp�it)�prefixZmap_none�arg�args���Nonezjcannot convert map(None, ...) with multiple arguments because map() now truncates to the shortest sequence�map)Zshould_skip�appendZclone�parent�type�symsZsimple_stmtZwarningrrrrr
ZpowerZtrailerZchildrenZarglistr�NAME�valuerr)�selfZnodeZresultsZtrailers�t�newr�r �-/usr/lib64/python3.8/lib2to3/fixes/fix_map.py�	transform@sN


�
���
zFixMap.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNZskip_onr"r r r r!rsrN)�__doc__Zpgen2rrrZ
fixer_utilrrrrrZpygramr	rZpytreer
ZConditionalFixrr r r r!�<module>slib2to3/fixes/__pycache__/fix_reload.cpython-38.pyc000064400000002165151153537460016132 0ustar00U

e5d9�@s6dZddlmZddlmZmZGdd�dej�ZdS)z5Fixer for reload().

reload(s) -> importlib.reload(s)�)�
fixer_base)�
ImportAndCall�touch_importc@s eZdZdZdZdZdd�ZdS)�	FixReloadTZprez�
    power< 'reload'
           trailer< lpar='('
                    ( not(arglist | argument<any '=' any>) obj=any
                      | obj=arglist<(not argument<any '=' any>) any ','> )
                    rpar=')' >
           after=any*
    >
    cCsR|r2|d}|r2|j|jjkr2|jdjdkr2dSd}t|||�}tdd|�|S)N�obj�>�**�*)�	importlib�reloadr
)�typeZsymsZargumentZchildren�valuerr)�selfZnodeZresultsr�names�new�r�0/usr/lib64/python3.8/lib2to3/fixes/fix_reload.py�	transforms�zFixReload.transformN)�__name__�
__module__�__qualname__Z
BM_compatible�orderZPATTERNrrrrrr
s
rN)�__doc__�rZ
fixer_utilrrZBaseFixrrrrr�<module>slib2to3/fixes/__pycache__/fix_methodattrs.cpython-38.opt-1.pyc000064400000001645151153537460020163 0ustar00U

e5d^�@s>dZddlmZddlmZdddd�ZGdd	�d	ej�Zd
S)z;Fix bound method attributes (method.im_? -> method.__?__).
�)�
fixer_base)�Name�__func__�__self__z__self__.__class__)Zim_funcZim_selfZim_classc@seZdZdZdZdd�ZdS)�FixMethodattrsTzU
    power< any+ trailer< '.' attr=('im_func' | 'im_self' | 'im_class') > any* >
    cCs.|dd}t|j}|�t||jd��dS)N�attr�)�prefix)�MAP�value�replacerr	)�selfZnodeZresultsr�new�r�5/usr/lib64/python3.8/lib2to3/fixes/fix_methodattrs.py�	transforms
zFixMethodattrs.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrrrrrrsrN)�__doc__�rZ
fixer_utilrr
ZBaseFixrrrrr�<module>s�lib2to3/fixes/__pycache__/fix_apply.cpython-38.pyc000064400000003213151153537460016004 0ustar00U

e5d*	�@sRdZddlmZddlmZddlmZddlmZmZm	Z	Gdd�dej
�ZdS)	zIFixer for apply().

This converts apply(func, v, k) into (func)(*v, **k).�)�pytree)�token)�
fixer_base)�Call�Comma�parenthesizec@seZdZdZdZdd�ZdS)�FixApplyTa.
    power< 'apply'
        trailer<
            '('
            arglist<
                (not argument<NAME '=' any>) func=any ','
                (not argument<NAME '=' any>) args=any [','
                (not argument<NAME '=' any>) kwds=any] [',']
            >
            ')'
        >
    >
    c	Cs4|j}|st�|d}|d}|�d�}|rN|j|jjkrN|jdjdkrNdS|rt|j|jjkrt|jdjdkrtdS|j}|��}|jt	j
|jfkr�|j|jks�|jdjt	j
kr�t|�}d|_|��}d|_|dk	r�|��}d|_t�t	jd	�|g}|dk	�r&|�t�t�t	j
d�|g�d
|d_t|||d�S)N�func�args�kwds�>�**�*r
����r� )�prefix)�syms�AssertionError�get�typeZargumentZchildren�valuerZcloner�NAMEZatomZpower�
DOUBLESTARrrZLeaf�STAR�extendrr)	�selfZnodeZresultsrr	r
rrZ	l_newargs�r�//usr/lib64/python3.8/lib2to3/fixes/fix_apply.py�	transformsH
��
��
�
zFixApply.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrrrrrrsrN)�__doc__rrZpgen2rrZ
fixer_utilrrrZBaseFixrrrrr�<module>s
lib2to3/fixes/__pycache__/fix_ne.cpython-38.pyc000064400000001446151153537460015267 0ustar00U

e5d;�@s>dZddlmZddlmZddlmZGdd�dej�ZdS)zFixer that turns <> into !=.�)�pytree)�token)�
fixer_basec@s"eZdZejZdd�Zdd�ZdS)�FixNecCs
|jdkS)Nz<>)�value)�self�node�r	�,/usr/lib64/python3.8/lib2to3/fixes/fix_ne.py�matchszFixNe.matchcCstjtjd|jd�}|S)Nz!=)�prefix)rZLeafr�NOTEQUALr)rrZresults�newr	r	r
�	transformszFixNe.transformN)�__name__�
__module__�__qualname__rr
Z_accept_typerrr	r	r	r
rsrN)�__doc__�rZpgen2rrZBaseFixrr	r	r	r
�<module>slib2to3/fixes/__pycache__/fix_standarderror.cpython-38.pyc000064400000001313151153537460017530 0ustar00U

e5d��@s2dZddlmZddlmZGdd�dej�ZdS)z%Fixer for StandardError -> Exception.�)�
fixer_base)�Namec@seZdZdZdZdd�ZdS)�FixStandarderrorTz-
              'StandardError'
              cCstd|jd�S)N�	Exception)�prefix)rr)�selfZnodeZresults�r�7/usr/lib64/python3.8/lib2to3/fixes/fix_standarderror.py�	transformszFixStandarderror.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr
rrrr	rsrN)�__doc__�rZ
fixer_utilrZBaseFixrrrrr	�<module>slib2to3/fixes/__pycache__/fix_next.cpython-38.pyc000064400000006006151153537460015640 0ustar00U

e5df�@sndZddlmZddlmZddlmZddlm	Z	m
Z
mZdZGdd�dej
�Zd	d
�Zdd�Zd
d�ZdS)z.Fixer for it.next() -> next(it), per PEP 3114.�)�token)�python_symbols)�
fixer_base)�Name�Call�find_bindingz;Calls to builtin next() possibly shadowed by global bindingcs0eZdZdZdZdZ�fdd�Zdd�Z�ZS)�FixNextTa�
    power< base=any+ trailer< '.' attr='next' > trailer< '(' ')' > >
    |
    power< head=any+ trailer< '.' attr='next' > not trailer< '(' ')' > >
    |
    classdef< 'class' any+ ':'
              suite< any*
                     funcdef< 'def'
                              name='next'
                              parameters< '(' NAME ')' > any+ >
                     any* > >
    |
    global=global_stmt< 'global' any* 'next' any* >
    Zprecs>tt|��||�td|�}|r4|�|t�d|_nd|_dS)N�nextTF)�superr�
start_treer�warning�bind_warning�
shadowed_next)�selfZtree�filename�n��	__class__��./usr/lib64/python3.8/lib2to3/fixes/fix_next.pyr$s
zFixNext.start_treecCs|st�|�d�}|�d�}|�d�}|rz|jrF|�td|jd��n2dd�|D�}d|d	_|�ttd
|jd�|��n�|r�td|jd�}|�|�nl|r�t|�r�|d}d�dd�|D���	�d
kr�|�
|t�dS|�td��nd|k�r|�
|t�d|_dS)N�base�attr�name�__next__)�prefixcSsg|]}|���qSr)Zclone��.0rrrr�
<listcomp>9sz%FixNext.transform.<locals>.<listcomp>��r	�headcSsg|]}t|��qSr)�strrrrrrEsZ__builtin__�globalT)�AssertionError�getr�replacerrr�is_assign_target�join�striprr
)r�nodeZresultsrrrrr rrr�	transform.s.




zFixNext.transform)	�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERN�orderrr*�
__classcell__rrrrrs

rcCsFt|�}|dkrdS|jD]&}|jtjkr0dSt||�rdSqdS)NFT)�find_assign�children�typer�EQUAL�
is_subtree)r)ZassignZchildrrrr&Qs

r&cCs4|jtjkr|S|jtjks&|jdkr*dSt|j�S�N)r2�symsZ	expr_stmtZsimple_stmt�parentr0�r)rrrr0]s
r0cs$|�krdSt�fdd�|jD��S)NTc3s|]}t|��VqdSr5)r4)r�cr8rr�	<genexpr>gszis_subtree.<locals>.<genexpr>)�anyr1)�rootr)rr8rr4dsr4N)�__doc__Zpgen2rZpygramrr6rrZ
fixer_utilrrrr
ZBaseFixrr&r0r4rrrr�<module>s@lib2to3/fixes/__pycache__/fix_ws_comma.cpython-38.opt-1.pyc000064400000002132151153537460017422 0ustar00U

e5dB�@s>dZddlmZddlmZddlmZGdd�dej�ZdS)z�Fixer that changes 'a ,b' into 'a, b'.

This also changes '{a :b}' into '{a: b}', but does not touch other
uses of colons.  It does not touch other uses of whitespace.

�)�pytree)�token)�
fixer_basec@s@eZdZdZdZe�ejd�Ze�ej	d�Z	ee	fZ
dd�ZdS)�
FixWsCommaTzH
    any<(not(',') any)+ ',' ((not(',') any)+ ',')* [not(',') any]>
    �,�:cCs`|��}d}|jD]H}||jkrB|j}|��r<d|kr<d|_d}q|rV|j}|sVd|_d}q|S)NF�
�T� )ZcloneZchildren�SEPS�prefix�isspace)�selfZnodeZresults�newZcommaZchildr�r�2/usr/lib64/python3.8/lib2to3/fixes/fix_ws_comma.py�	transforms

zFixWsComma.transformN)�__name__�
__module__�__qualname__ZexplicitZPATTERNrZLeafr�COMMA�COLONrrrrrrrsrN)�__doc__r	rZpgen2rrZBaseFixrrrrr�<module>slib2to3/fixes/__pycache__/fix_itertools.cpython-38.opt-2.pyc000064400000002241151153537460017643 0ustar00U

e5d�@s.ddlmZddlmZGdd�dej�ZdS)�)�
fixer_base)�Namec@s*eZdZdZdZde�ZdZdd�ZdS)�FixItertoolsTz7('imap'|'ifilter'|'izip'|'izip_longest'|'ifilterfalse')z�
              power< it='itertools'
                  trailer<
                     dot='.' func=%(it_funcs)s > trailer< '(' [any] ')' > >
              |
              power< func=%(it_funcs)s trailer< '(' [any] ')' > >
              �cCs�d}|dd}d|krV|jdkrV|d|d}}|j}|��|��|j�|�|p^|j}|�t|jdd�|d��dS)N�func��it)ZifilterfalseZizip_longest�dot�)�prefix)�valuer�remove�parent�replacer)�selfZnodeZresultsrrr	r�r�3/usr/lib64/python3.8/lib2to3/fixes/fix_itertools.py�	transforms�
zFixItertools.transformN)	�__name__�
__module__�__qualname__Z
BM_compatibleZit_funcs�localsZPATTERNZ	run_orderrrrrrrs�	rN)�rZ
fixer_utilrZBaseFixrrrrr�<module>slib2to3/fixes/__pycache__/fix_exitfunc.cpython-38.opt-2.pyc000064400000004265151153537460017454 0ustar00U

e5d�	�@sFddlmZmZddlmZmZmZmZmZm	Z	Gdd�dej
�ZdS)�)�pytree�
fixer_base)�Name�Attr�Call�Comma�Newline�symscs<eZdZdZdZdZ�fdd�Z�fdd�Zdd�Z�Z	S)	�FixExitfuncTa�
              (
                  sys_import=import_name<'import'
                      ('sys'
                      |
                      dotted_as_names< (any ',')* 'sys' (',' any)* >
                      )
                  >
              |
                  expr_stmt<
                      power< 'sys' trailer< '.' 'exitfunc' > >
                  '=' func=any >
              )
              cstt|�j|�dS�N)�superr
�__init__)�self�args��	__class__��2/usr/lib64/python3.8/lib2to3/fixes/fix_exitfunc.pyr
szFixExitfunc.__init__cstt|��||�d|_dSr)rr
�
start_tree�
sys_import)rZtree�filenamerrrr!szFixExitfunc.start_treecCs&d|kr |jdkr|d|_dS|d��}d|_t�tjttd�td���}t	||g|j�}|�
|�|jdkr�|�|d�dS|jjd}|j
tjkr�|�t��|�tdd��nj|jj}|j�|j�}|j}	t�tjtd	�tdd�g�}
t�tj|
g�}|�|dt��|�|d
|�dS)Nr�func��atexit�registerzKCan't find sys import; Please add an atexit import at the top of your file.�� �import�)rZclone�prefixrZNoder	Zpowerrrr�replaceZwarningZchildren�typeZdotted_as_namesZappend_childr�parent�indexZimport_nameZsimple_stmtZinsert_childr)rZnodeZresultsrrZcall�namesZcontaining_stmtZpositionZstmt_containerZ
new_import�newrrr�	transform%s6

�

�zFixExitfunc.transform)
�__name__�
__module__�__qualname__Zkeep_line_orderZ
BM_compatibleZPATTERNr
rr&�
__classcell__rrrrr
sr
N)Zlib2to3rrZlib2to3.fixer_utilrrrrrr	ZBaseFixr
rrrr�<module>s lib2to3/fixes/__pycache__/fix_throw.cpython-38.pyc000064400000003413151153537460016024 0ustar00U

e5d.�@sZdZddlmZddlmZddlmZddlmZmZm	Z	m
Z
mZGdd�dej�Z
dS)	z�Fixer for generator.throw(E, V, T).

g.throw(E)       -> g.throw(E)
g.throw(E, V)    -> g.throw(E(V))
g.throw(E, V, T) -> g.throw(E(V).with_traceback(T))

g.throw("foo"[, V[, T]]) will warn about string exceptions.�)�pytree)�token)�
fixer_base)�Name�Call�ArgList�Attr�is_tuplec@seZdZdZdZdd�ZdS)�FixThrowTz�
    power< any trailer< '.' 'throw' >
           trailer< '(' args=arglist< exc=any ',' val=any [',' tb=any] > ')' >
    >
    |
    power< any trailer< '.' 'throw' > trailer< '(' exc=any ')' > >
    cCs�|j}|d��}|jtjkr.|�|d�dS|�d�}|dkrDdS|��}t|�rndd�|jdd�D�}nd|_	|g}|d	}d
|kr�|d
��}d|_	t
||�}	t|	td��t
|g�g}
|�t�|j|
��n|�t
||��dS)N�excz+Python 3 does not support string exceptions�valcSsg|]}|���qS�)�clone)�.0�cr
r
�//usr/lib64/python3.8/lib2to3/fixes/fix_throw.py�
<listcomp>)sz&FixThrow.transform.<locals>.<listcomp>������args�tb�with_traceback)�symsr�typer�STRINGZcannot_convert�getr	Zchildren�prefixrrrr�replacerZNodeZpower)�selfZnodeZresultsrrrrZ
throw_argsr�eZwith_tbr
r
r�	transforms*

zFixThrow.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr!r
r
r
rr
sr
N)�__doc__rrZpgen2rrZ
fixer_utilrrrrr	ZBaseFixr
r
r
r
r�<module>s

lib2to3/fixes/__pycache__/fix_reload.cpython-38.opt-2.pyc000064400000002057151153537460017072 0ustar00U

e5d9�@s2ddlmZddlmZmZGdd�dej�ZdS)�)�
fixer_base)�
ImportAndCall�touch_importc@s eZdZdZdZdZdd�ZdS)�	FixReloadTZprez�
    power< 'reload'
           trailer< lpar='('
                    ( not(arglist | argument<any '=' any>) obj=any
                      | obj=arglist<(not argument<any '=' any>) any ','> )
                    rpar=')' >
           after=any*
    >
    cCsR|r2|d}|r2|j|jjkr2|jdjdkr2dSd}t|||�}tdd|�|S)N�obj�>�**�*)�	importlib�reloadr
)�typeZsymsZargumentZchildren�valuerr)�selfZnodeZresultsr�names�new�r�0/usr/lib64/python3.8/lib2to3/fixes/fix_reload.py�	transforms�zFixReload.transformN)�__name__�
__module__�__qualname__Z
BM_compatible�orderZPATTERNrrrrrr
s
rN)�rZ
fixer_utilrrZBaseFixrrrrr�<module>slib2to3/fixes/__pycache__/fix_xreadlines.cpython-38.opt-2.pyc000064400000001735151153537460017764 0ustar00U

e5d��@s.ddlmZddlmZGdd�dej�ZdS)�)�
fixer_base)�Namec@seZdZdZdZdd�ZdS)�
FixXreadlinesTz�
    power< call=any+ trailer< '.' 'xreadlines' > trailer< '(' ')' > >
    |
    power< any+ trailer< '.' no_call='xreadlines' > >
    cCs@|�d�}|r$|�td|jd��n|�dd�|dD��dS)N�no_call�__iter__)�prefixcSsg|]}|���qS�)Zclone)�.0�xrr�4/usr/lib64/python3.8/lib2to3/fixes/fix_xreadlines.py�
<listcomp>sz+FixXreadlines.transform.<locals>.<listcomp>Zcall)�get�replacerr)�selfZnodeZresultsrrrr�	transforms
zFixXreadlines.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrrrrrrsrN)�rZ
fixer_utilrZBaseFixrrrrr�<module>slib2to3/fixes/__pycache__/fix_tuple_params.cpython-38.pyc000064400000010752151153537460017361 0ustar00U

e5d��@s�dZddlmZddlmZddlmZddlmZmZm	Z	m
Z
mZmZdd�Z
Gdd	�d	ej�Zd
d�Zdd
�Zgdfdd�Zdd�ZdS)a:Fixer for function definitions with tuple parameters.

def func(((a, b), c), d):
    ...

    ->

def func(x, d):
    ((a, b), c) = x
    ...

It will also support lambdas:

    lambda (x, y): x + y -> lambda t: t[0] + t[1]

    # The parens are a syntax error in Python 3
    lambda (x): x + y -> lambda x: x + y
�)�pytree)�token)�
fixer_base)�Assign�Name�Newline�Number�	Subscript�symscCst|tj�o|jdjtjkS)N�)�
isinstancer�Node�children�typer�STRING)�stmt�r�6/usr/lib64/python3.8/lib2to3/fixes/fix_tuple_params.py�is_docstrings�rc@s(eZdZdZdZdZdd�Zdd�ZdS)	�FixTupleParams�Ta
              funcdef< 'def' any parameters< '(' args=any ')' >
                       ['->' any] ':' suite=any+ >
              |
              lambda=
              lambdef< 'lambda' args=vfpdef< '(' inner=any ')' >
                       ':' body=any
              >
              cs�d|kr��||�Sg�|d}|d}|djdjtjkrZd}|djdj}t��nd}d}t�tjd��d���fd
d�	}|jt	j
kr�||�n<|jt	jkr�t|j�D]$\}}	|	jt	j
kr�||	|dkd�q��s�dS�D]}
|d|
_
q�|}|dk�r
d
�d_n&t|dj|��r0|�d_|d}�D]}
|d|
_
�q4�|dj||�<t|d|t��d�D]}||dj|_�qr|d��dS)N�lambda�suite�argsr�rz; �Fcs\t����}|��}d|_t||���}|r2d|_|�|���t�t	j
|���g��dS)Nr� )r�new_name�clone�prefixr�replace�appendrr
r
Zsimple_stmt)Z	tuple_arg�
add_prefix�n�argr��endZ	new_lines�selfrr�handle_tupleCs

�z.FixTupleParams.transform.<locals>.handle_tuple)r"r)F)�transform_lambdarrr�INDENT�valuerrZLeafr
ZtfpdefZ
typedargslist�	enumerate�parentrr�range�lenZchanged)r'�node�resultsrr�start�indentr(�ir$�lineZafterrr%r�	transform.sF


zFixTupleParams.transformc
Cs�|d}|d}t|d�}|jtjkrD|��}d|_|�|�dSt|�}t|�}|�	t
|��}t|dd�}	|�|	���|��D]X}
|
jtjkr�|
j
|kr�dd�||
j
D�}t�tj|	��g|�}|
j|_|
�|�q�dS)Nr�body�innerr)rcSsg|]}|���qSr)r��.0�crrr�
<listcomp>�sz3FixTupleParams.transform_lambda.<locals>.<listcomp>)�
simplify_argsrr�NAMErrr �find_params�map_to_indexr�
tuple_namerZ
post_orderr+rr
r
Zpower)
r'r0r1rr7r8ZparamsZto_indexZtup_nameZ	new_paramr#Z
subscripts�newrrrr)ns*
�zFixTupleParams.transform_lambdaN)�__name__�
__module__�__qualname__Z	run_orderZ
BM_compatibleZPATTERNr6r)rrrrrs

@rcCsN|jtjtjfkr|S|jtjkr>|jtjkr:|jd}q"|Std|��dS)NrzReceived unexpected node %s)rr
Zvfplistrr>�vfpdefr�RuntimeError�r0rrrr=�sr=cCs<|jtjkrt|jd�S|jtjkr,|jSdd�|jD�S)NrcSs g|]}|jtjkrt|��qSr)rr�COMMAr?r9rrrr<�szfind_params.<locals>.<listcomp>)rr
rFr?rrr>r+rHrrrr?�s
r?NcCsZ|dkri}t|�D]@\}}ttt|���g}t|t�rHt|||d�q||||<q|S)N)�d)r,r	r�strr�listr@)�
param_listrrJr4�objZtrailerrrrr@�s
r@cCs<g}|D](}t|t�r&|�t|��q|�|�qd�|�S)N�_)rrLr!rA�join)rM�lrNrrrrA�s
rA)�__doc__rrZpgen2rrZ
fixer_utilrrrrr	r
rZBaseFixrr=r?r@rArrrr�<module>s llib2to3/fixes/__pycache__/fix_itertools_imports.cpython-38.opt-1.pyc000064400000002775151153537460021433 0ustar00U

e5d&�@s:dZddlmZddlmZmZmZGdd�dej�ZdS)zA Fixer for imports of itertools.(imap|ifilter|izip|ifilterfalse) �)�
fixer_base)�	BlankLine�syms�tokenc@s"eZdZdZde�Zdd�ZdS)�FixItertoolsImportsTzT
              import_from< 'from' 'itertools' 'import' imports=any >
              cCsZ|d}|jtjks|js"|g}n|j}|ddd�D]|}|jtjkrR|j}|}n|jtjkrddS|jd}|j}|dkr�d|_|��q6|dkr6|�	�|ddkr�dnd	|_q6|jdd�p�|g}d
}	|D]&}|	r�|jtj
kr�|��q�|	d
N}	q�|�r|djtj
k�r|����q�|j�s4t|dd��r@|j
dk�rV|j}
t�}|
|_|SdS)
N�imports�r)ZimapZizipZifilter)ZifilterfalseZizip_longest��f�filterfalse�zip_longestT����value)�typerZimport_as_name�childrenr�NAMEr�STAR�removeZchanged�COMMA�pop�getattr�parent�prefixr)�selfZnodeZresultsrrZchild�memberZ	name_node�member_nameZremove_comma�p�r�;/usr/lib64/python3.8/lib2to3/fixes/fix_itertools_imports.py�	transformsF

�

�zFixItertoolsImports.transformN)�__name__�
__module__�__qualname__Z
BM_compatible�localsZPATTERNrrrrrrs
�rN)	�__doc__Zlib2to3rZlib2to3.fixer_utilrrrZBaseFixrrrrr�<module>slib2to3/fixes/__pycache__/fix_renames.cpython-38.opt-2.pyc000064400000003602151153537460017253 0ustar00U

e5d��@sRddlmZddlmZmZdddiiZiZdd�Zdd	�ZGd
d�dej	�Z
dS)
�)�
fixer_base)�Name�
attr_chain�sysZmaxint�maxsizecCsdd�tt|��dS)N�(�|�))�join�map�repr)�members�r�1/usr/lib64/python3.8/lib2to3/fixes/fix_renames.py�
alternatessrccsZtt���D]H\}}t|���D]2\}}|t||f<d|||fVd||fVq qdS)Nz�
                  import_from< 'from' module_name=%r 'import'
                      ( attr_name=%r | import_as_name< attr_name=%r 'as' any >) >
                  z^
                  power< module_name=%r trailer< '.' attr_name=%r > any* >
                  )�list�MAPPING�items�LOOKUP)�module�replaceZold_attr�new_attrrrr�
build_patterns��rcs8eZdZdZd�e��ZdZ�fdd�Zdd�Z	�Z
S)�
FixRenamesTrZprecs@tt|�j��|�}|r<t�fdd�t|d�D��r8dS|SdS)Nc3s|]}�|�VqdS)Nr)�.0�obj��matchrr�	<genexpr>5sz#FixRenames.match.<locals>.<genexpr>�parentF)�superrr�anyr)�self�node�results��	__class__rrr1szFixRenames.matchcCsD|�d�}|�d�}|r@|r@t|j|jf}|�t||jd��dS)NZmodule_name�	attr_name)�prefix)�getr�valuerrr()r"r#r$Zmod_namer'rrrr�	transform>s


zFixRenames.transform)�__name__�
__module__�__qualname__Z
BM_compatibler
rZPATTERN�orderrr+�
__classcell__rrr%rr*s

rN)�rZ
fixer_utilrrrrrrZBaseFixrrrrr�<module>
slib2to3/fixes/__pycache__/fix_xrange.cpython-38.opt-1.pyc000064400000004734151153537460017113 0ustar00U

e5d�
�@sFdZddlmZddlmZmZmZddlmZGdd�dej�Z	dS)z/Fixer that changes xrange(...) into range(...).�)�
fixer_base)�Name�Call�consuming_calls)�patcompcsheZdZdZdZ�fdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
Z
e�e
�Z
dZe�e�Zdd�Z�ZS)�	FixXrangeTz�
              power<
                 (name='range'|name='xrange') trailer< '(' args=any ')' >
              rest=any* >
              cstt|��||�t�|_dS�N)�superr�
start_tree�set�transformed_xranges��selfZtree�filename��	__class__��0/usr/lib64/python3.8/lib2to3/fixes/fix_xrange.pyr
szFixXrange.start_treecCs
d|_dSr)rr
rrr�finish_treeszFixXrange.finish_treecCsD|d}|jdkr|�||�S|jdkr4|�||�Stt|���dS)N�nameZxrange�range)�value�transform_xrange�transform_range�
ValueError�repr�r�node�resultsrrrr�	transforms

zFixXrange.transformcCs0|d}|�td|jd��|j�t|��dS)Nrr��prefix)�replacerr!r�add�idrrrrr$szFixXrange.transform_xrangecCsft|�|jkrb|�|�sbttd�|d��g�}ttd�|g|jd�}|dD]}|�|�qN|SdS)Nr�args�listr �rest)r$r�in_special_contextrrZcloner!Zappend_child)rrrZ
range_callZ	list_call�nrrrr*s��zFixXrange.transform_rangez3power< func=NAME trailer< '(' node=any ')' > any* >z�for_stmt< 'for' any 'in' node=any ':' any* >
            | comp_for< 'for' any 'in' node=any any* >
            | comparison< any 'in' node=any any*>
         cCsf|jdkrdSi}|jjdk	rJ|j�|jj|�rJ|d|krJ|djtkS|j�|j|�od|d|kS)NFr�func)�parent�p1�matchrr�p2)rrrrrrr(?s
�
�zFixXrange.in_special_context)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr
rrrrZP1rZcompile_patternr,ZP2r.r(�
__classcell__rrrrrs	

rN)
�__doc__�rZ
fixer_utilrrrrZBaseFixrrrrr�<module>slib2to3/fixes/__pycache__/fix_zip.cpython-38.opt-2.pyc000064400000002337151153537460016427 0ustar00U

e5d	�@sNddlmZddlmZddlmZddlmZm	Z	m
Z
Gdd�dej�ZdS)�)�
fixer_base)�Node)�python_symbols)�Name�ArgList�in_special_contextc@s eZdZdZdZdZdd�ZdS)�FixZipTzN
    power< 'zip' args=trailer< '(' [any] ')' > [trailers=trailer*]
    >
    zfuture_builtins.zipcCs�|�|�rdSt|�rdS|d��}d|_g}d|krZdd�|dD�}|D]
}d|_qNttjtd�|gdd�}ttjtd�t|g�g|�}|j|_|S)	N�args��trailerscSsg|]}|���qS�)�clone)�.0�nrr�-/usr/lib64/python3.8/lib2to3/fixes/fix_zip.py�
<listcomp>'sz$FixZip.transform.<locals>.<listcomp>�zip)�prefix�list)	Zshould_skiprr
rr�symsZpowerrr)�selfZnodeZresultsr	rr�newrrr�	transforms
zFixZip.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNZskip_onrrrrrrsrN)
r
rZpytreerZpygramrrZ
fixer_utilrrrZConditionalFixrrrrr�<module>slib2to3/fixes/__pycache__/fix_has_key.cpython-38.pyc000064400000005566151153537460016317 0ustar00U

e5d|�@sBdZddlmZddlmZddlmZmZGdd�dej�ZdS)a&Fixer for has_key().

Calls to .has_key() methods are expressed in terms of the 'in'
operator:

    d.has_key(k) -> k in d

CAVEATS:
1) While the primary target of this fixer is dict.has_key(), the
   fixer will change any has_key() method call, regardless of its
   class.

2) Cases like this will not be converted:

    m = d.has_key
    if m(k):
        ...

   Only *calls* to has_key() are converted. While it is possible to
   convert the above to something like

    m = d.__contains__
    if m(k):
        ...

   this is currently not done.
�)�pytree)�
fixer_base)�Name�parenthesizec@seZdZdZdZdd�ZdS)�	FixHasKeyTa�
    anchor=power<
        before=any+
        trailer< '.' 'has_key' >
        trailer<
            '('
            ( not(arglist | argument<any '=' any>) arg=any
            | arglist<(not argument<any '=' any>) arg=any ','>
            )
            ')'
        >
        after=any*
    >
    |
    negation=not_test<
        'not'
        anchor=power<
            before=any+
            trailer< '.' 'has_key' >
            trailer<
                '('
                ( not(arglist | argument<any '=' any>) arg=any
                | arglist<(not argument<any '=' any>) arg=any ','>
                )
                ')'
            >
        >
    >
    c

Cs�|st�|j}|jj|jkr.|j�|j�r.dS|�d�}|d}|j}dd�|dD�}|d�	�}|�d�}	|	r�dd�|	D�}	|j|j
|j|j|j|j
|j|jfkr�t|�}t|�d	kr�|d
}nt�|j|�}d|_tddd
�}
|�rtddd
�}t�|j||
f�}
t�|j
||
|f�}|	�rBt|�}t�|j|ft|	��}|jj|j
|j|j|j|j|j|j|j|jf	k�r|t|�}||_|S)N�negation�anchorcSsg|]}|���qS���clone��.0�nr	r	�1/usr/lib64/python3.8/lib2to3/fixes/fix_has_key.py�
<listcomp>Rsz'FixHasKey.transform.<locals>.<listcomp>�before�arg�aftercSsg|]}|���qSr	r
rr	r	rrVs��� �in)�prefix�not)�AssertionError�syms�parent�typeZnot_test�pattern�match�getrrZ
comparisonZand_testZor_testZtestZlambdefZargumentr�lenrZNodeZpowerrZcomp_op�tuple�exprZxor_exprZand_exprZ
shift_exprZ
arith_exprZtermZfactor)
�selfZnodeZresultsrrrrrrrZn_opZn_not�newr	r	r�	transformGsX�

�
�zFixHasKey.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr&r	r	r	rr&srN)	�__doc__�rrZ
fixer_utilrrZBaseFixrr	r	r	r�<module>slib2to3/fixes/__pycache__/fix_imports.cpython-38.opt-2.pyc000064400000010346151153537460017321 0ustar00U

e5d4�1@s�ddlmZddlmZmZdddddddd	d
ddddd
ddddddddddddddddddd d!d!d"d#d$d%d&d'd'd'd(d)d)d*d+d,�0Zd-d.�Zefd/d0�ZGd1d2�d2ej�Z	d3S)4�)�
fixer_base)�Name�
attr_chain�io�pickle�builtins�copyregZqueueZsocketserverZconfigparser�reprlibztkinter.filedialogztkinter.simpledialogztkinter.colorchooserztkinter.commondialogztkinter.dialogztkinter.dndztkinter.fontztkinter.messageboxztkinter.scrolledtextztkinter.constantsztkinter.tixztkinter.ttkZtkinterZ_markupbase�winreg�_threadZ
_dummy_threadzdbm.bsdzdbm.dumbzdbm.ndbmzdbm.gnuz
xmlrpc.clientz
xmlrpc.serverzhttp.clientz
html.entitieszhtml.parserzhttp.cookieszhttp.cookiejarzhttp.server�
subprocess�collectionszurllib.parsezurllib.robotparser)0�StringIOZ	cStringIOZcPickleZ__builtin__Zcopy_regZQueueZSocketServerZConfigParser�reprZ
FileDialogZtkFileDialogZSimpleDialogZtkSimpleDialogZtkColorChooserZtkCommonDialogZDialogZTkdndZtkFontZtkMessageBoxZScrolledTextZTkconstantsZTixZttkZTkinterZ
markupbase�_winreg�threadZdummy_threadZdbhashZdumbdbmZdbmZgdbmZ	xmlrpclibZDocXMLRPCServerZSimpleXMLRPCServerZhttplibZhtmlentitydefsZ
HTMLParserZCookieZ	cookielibZBaseHTTPServerZSimpleHTTPServerZ
CGIHTTPServerZcommands�
UserString�UserListZurlparseZrobotparsercCsdd�tt|��dS)N�(�|�))�join�mapr)�members�r�1/usr/lib64/python3.8/lib2to3/fixes/fix_imports.py�
alternates=srccsTd�dd�|D��}t|���}d||fVd|Vd||fVd|VdS)Nz | cSsg|]}d|�qS)zmodule_name='%s'r)�.0�keyrrr�
<listcomp>Bsz!build_pattern.<locals>.<listcomp>zyname_import=import_name< 'import' ((%s) |
               multiple_imports=dotted_as_names< any* (%s) any* >) >
          z�import_from< 'from' (%s) 'import' ['(']
              ( any | import_as_name< any 'as' any > |
                import_as_names< any* >)  [')'] >
          z�import_name< 'import' (dotted_as_name< (%s) 'as' any > |
               multiple_imports=dotted_as_names<
                 any* dotted_as_name< (%s) 'as' any > any* >) >
          z3power< bare_with_attr=(%s) trailer<'.' any > any* >)rr�keys)�mappingZmod_listZ
bare_namesrrr�
build_patternAs���r"csTeZdZdZdZeZdZdd�Z�fdd�Z	�fdd�Z
�fd	d
�Zdd�Z�Z
S)
�
FixImportsT�cCsd�t|j��S)Nr)rr"r!��selfrrrr"`szFixImports.build_patterncs|��|_tt|���dS�N)r"ZPATTERN�superr#�compile_patternr%��	__class__rrr)cs
zFixImports.compile_patterncsHtt|�j��|�}|rDd|kr@t�fdd�t|d�D��r@dS|SdS)N�bare_with_attrc3s|]}�|�VqdSr'r)r�obj��matchrr�	<genexpr>qsz#FixImports.match.<locals>.<genexpr>�parentF)r(r#r/�anyr)r&�node�resultsr*r.rr/js�zFixImports.matchcstt|��||�i|_dSr')r(r#�
start_tree�replace)r&Ztree�filenamer*rrr5vszFixImports.start_treecCs�|�d�}|rh|j}|j|}|�t||jd��d|krD||j|<d|kr�|�|�}|r�|�||�n2|dd}|j�|j�}|r�|�t||jd��dS)NZmodule_name)�prefixZname_importZmultiple_importsr,�)�get�valuer!r6rr8r/�	transform)r&r3r4Z
import_modZmod_name�new_nameZ	bare_namerrrr<zs



zFixImports.transform)�__name__�
__module__�__qualname__Z
BM_compatibleZkeep_line_order�MAPPINGr!Z	run_orderr"r)r/r5r<�
__classcell__rrr*rr#Usr#N)
�rZ
fixer_utilrrrArr"ZBaseFixr#rrrr�<module>sj�5lib2to3/fixes/__pycache__/fix_metaclass.cpython-38.opt-1.pyc000064400000012265151153537460017601 0ustar00U

e5d �@svdZddlmZddlmZddlmZmZmZdd�Z	dd�Z
d	d
�Zdd�Zd
d�Z
dd�ZGdd�dej�ZdS)a�Fixer for __metaclass__ = X -> (metaclass=X) methods.

   The various forms of classef (inherits nothing, inherits once, inherits
   many) don't parse the same in the CST so we look at ALL classes for
   a __metaclass__ and if we find one normalize the inherits to all be
   an arglist.

   For one-liner classes ('class X: pass') there is no indent/dedent so
   we normalize those into having a suite.

   Moving the __metaclass__ into the classdef can also cause the class
   body to be empty so there is some special casing for that as well.

   This fixer also tries very hard to keep original indenting and spacing
   in all those corner cases.

�)�
fixer_base)�token)�syms�Node�LeafcCsz|jD]n}|jtjkr"t|�S|jtjkr|jr|jd}|jtjkr|jr|jd}t|t�r|j	dkrdSqdS)z� we have to check the cls_node without changing it.
        There are two possibilities:
          1)  clsdef => suite => simple_stmt => expr_stmt => Leaf('__meta')
          2)  clsdef => simple_stmt => expr_stmt => Leaf('__meta')
    ��
__metaclass__TF)
�children�typer�suite�
has_metaclass�simple_stmt�	expr_stmt�
isinstancer�value)�parent�node�	expr_nodeZ	left_side�r�3/usr/lib64/python3.8/lib2to3/fixes/fix_metaclass.pyrs



�rcCs�|jD]}|jtjkrdSqt|j�D]\}}|jtjkr(qJq(td��ttjg�}|j|dd�r�|j|d}|�	|�
��|��qV|�	|�|}dS)zf one-line classes don't get a suite in the parse tree so we add
        one to normalize the tree
    NzNo class suite and no ':'!�)r	r
rr�	enumerater�COLON�
ValueErrorr�append_child�clone�remove)�cls_noder�ir�	move_noderrr�fixup_parse_tree-s


r c
Cs�t|j�D]\}}|jtjkr
q(q
dS|��ttjg�}ttj	|g�}|j|d�rz|j|}|�
|���|��qJ|�||�|jdjd}|jdjd}	|	j
|_
dS)z� if there is a semi-colon all the parts count as part of the same
        simple_stmt.  We just want the __metaclass__ part so we move
        everything after the semi-colon into its own simple_stmt node
    Nr)rr	r
r�SEMIrrrrr
rr�insert_child�prefix)
rrZ	stmt_nodeZsemi_indrZnew_exprZnew_stmtrZ	new_leaf1Z	old_leaf1rrr�fixup_simple_stmtGs

r$cCs*|jr&|jdjtjkr&|jd��dS)N���)r	r
r�NEWLINEr)rrrr�remove_trailing_newline_sr'ccs�|jD]}|jtjkrq$qtd��tt|j��D]t\}}|jtjkr2|jr2|jd}|jtjkr2|jr2|jd}t	|t
�r2|jdkr2t|||�t
|�|||fVq2dS)NzNo class suite!rr)r	r
rrr�listrr
rrrrr$r')rrrZsimple_noderZ	left_noderrr�
find_metasds



�r)cCsz|jddd�}|r,|��}|jtjkrq,q|rv|��}t|t�r^|jtjkr^|jrZd|_dS|�	|jddd��q,dS)z� If an INDENT is followed by a thing with a prefix then nuke the prefix
        Otherwise we get in trouble when removing __metaclass__ at suite start
    Nr%�)
r	�popr
r�INDENTrr�DEDENTr#�extend)rZkidsrrrr�fixup_indent{sr/c@seZdZdZdZdd�ZdS)�FixMetaclassTz
    classdef<any*>
    cCs8t|�sdSt|�d}t|�D]\}}}|}|��q |jdj}t|j�dkr�|jdjtjkrp|jd}n(|jd�	�}	t
tj|	g�}|�d|�n�t|j�dkr�t
tjg�}|�d|�nZt|j�dk�rt
tjg�}|�dt
tjd��|�d|�|�dt
tjd��ntd	��|jdjd}
d
|
_|
j}|j�rZ|�t
tjd��d|
_nd
|
_|jd}d
|jd_d
|jd_|�|�t|�|j�s�|��t
|d�}
||
_|�|
�|�t
tjd��nbt|j�dk�r4|jdjtjk�r4|jdjtjk�r4t
|d�}
|�d|
�|�dt
tjd��dS)Nr����r�)�(zUnexpected class definition�	metaclass�,� r*r�pass�
���r%)rr r)rr	r
�lenr�arglistrrZ	set_childr"rr�RPAR�LPARrrr#r�COMMAr/r&r,r-)�selfrZresultsZlast_metaclassrrZstmtZ	text_typer>rZmeta_txtZorig_meta_prefixrZ	pass_leafrrr�	transform�sb




��
zFixMetaclass.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrCrrrrr0�sr0N)�__doc__r*rZpygramrZ
fixer_utilrrrrr r$r'r)r/ZBaseFixr0rrrr�<module>slib2to3/fixes/__pycache__/fix_print.cpython-38.opt-1.pyc000064400000004323151153537460016755 0ustar00U

e5d�@sldZddlmZddlmZddlmZddlmZddlmZm	Z	m
Z
mZe�d�Z
Gdd	�d	ej�Zd
S)aFixer for print.

Change:
    'print'          into 'print()'
    'print ...'      into 'print(...)'
    'print ... ,'    into 'print(..., end=" ")'
    'print >>x, ...' into 'print(..., file=x)'

No changes are applied if print_function is imported from __future__

�)�patcomp)�pytree)�token)�
fixer_base)�Name�Call�Comma�Stringz"atom< '(' [atom|STRING|NAME] ')' >c@s$eZdZdZdZdd�Zdd�ZdS)�FixPrintTzP
              simple_stmt< any* bare='print' any* > | print_stmt
              c
Cs`|�d�}|r,|�ttd�g|jd��dS|jdd�}t|�dkrXt�|d�rXdSd}}}|r�|dt	�kr�|dd�}d}|r�|dt
�tj
d�kr�|d��}|d	d�}d
d�|D�}|r�d|d_|dk	s�|dk	s�|dk	�rF|dk	�r|�|d
tt|���|dk	�r.|�|dtt|���|dk	�rF|�|d|�ttd�|�}	|j|	_|	S)NZbare�print)�prefix������ z>>�cSsg|]}|���qS�)�clone)�.0�argrr�//usr/lib64/python3.8/lib2to3/fixes/fix_print.py�
<listcomp>?sz&FixPrint.transform.<locals>.<listcomp>��sep�end�file)�get�replacerrrZchildren�len�parend_expr�matchrr�Leafr�
RIGHTSHIFTr�	add_kwargr	�repr)
�selfZnodeZresultsZ
bare_print�argsrrrZl_argsZn_stmtrrr�	transform%s:
�



zFixPrint.transformcCsNd|_t�|jjt|�t�tjd�|f�}|r@|�	t
��d|_|�	|�dS)Nr�=r)rrZNodeZsymsZargumentrr!r�EQUAL�appendr)r%Zl_nodesZs_kwdZn_exprZ
n_argumentrrrr#Ms
��zFixPrint.add_kwargN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr'r#rrrrr
s(r
N)�__doc__rrrZpgen2rrZ
fixer_utilrrrr	Zcompile_patternrZBaseFixr
rrrr�<module>s
�lib2to3/fixes/__pycache__/fix_reload.cpython-38.opt-1.pyc000064400000002165151153537460017071 0ustar00U

e5d9�@s6dZddlmZddlmZmZGdd�dej�ZdS)z5Fixer for reload().

reload(s) -> importlib.reload(s)�)�
fixer_base)�
ImportAndCall�touch_importc@s eZdZdZdZdZdd�ZdS)�	FixReloadTZprez�
    power< 'reload'
           trailer< lpar='('
                    ( not(arglist | argument<any '=' any>) obj=any
                      | obj=arglist<(not argument<any '=' any>) any ','> )
                    rpar=')' >
           after=any*
    >
    cCsR|r2|d}|r2|j|jjkr2|jdjdkr2dSd}t|||�}tdd|�|S)N�obj�>�**�*)�	importlib�reloadr
)�typeZsymsZargumentZchildren�valuerr)�selfZnodeZresultsr�names�new�r�0/usr/lib64/python3.8/lib2to3/fixes/fix_reload.py�	transforms�zFixReload.transformN)�__name__�
__module__�__qualname__Z
BM_compatible�orderZPATTERNrrrrrr
s
rN)�__doc__�rZ
fixer_utilrrZBaseFixrrrrr�<module>slib2to3/fixes/__pycache__/fix_input.cpython-38.opt-2.pyc000064400000001554151153537460016764 0ustar00U

e5d��@sHddlmZddlmZmZddlmZe�d�ZGdd�dej�Z	dS)�)�
fixer_base)�Call�Name)�patcompz&power< 'eval' trailer< '(' any ')' > >c@seZdZdZdZdd�ZdS)�FixInputTzL
              power< 'input' args=trailer< '(' [any] ')' > >
              cCs6t�|jj�rdS|��}d|_ttd�|g|jd�S)N��eval)�prefix)�context�match�parentZcloner	rr)�selfZnodeZresults�new�r�//usr/lib64/python3.8/lib2to3/fixes/fix_input.py�	transforms
zFixInput.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrrrrrr
srN)
rrZ
fixer_utilrrrZcompile_patternr
ZBaseFixrrrrr�<module>s
lib2to3/fixes/__pycache__/fix_has_key.cpython-38.opt-2.pyc000064400000004440151153537460017245 0ustar00U

e5d|�@s>ddlmZddlmZddlmZmZGdd�dej�ZdS)�)�pytree)�
fixer_base)�Name�parenthesizec@seZdZdZdZdd�ZdS)�	FixHasKeyTa�
    anchor=power<
        before=any+
        trailer< '.' 'has_key' >
        trailer<
            '('
            ( not(arglist | argument<any '=' any>) arg=any
            | arglist<(not argument<any '=' any>) arg=any ','>
            )
            ')'
        >
        after=any*
    >
    |
    negation=not_test<
        'not'
        anchor=power<
            before=any+
            trailer< '.' 'has_key' >
            trailer<
                '('
                ( not(arglist | argument<any '=' any>) arg=any
                | arglist<(not argument<any '=' any>) arg=any ','>
                )
                ')'
            >
        >
    >
    c

Cs||j}|jj|jkr&|j�|j�r&dS|�d�}|d}|j}dd�|dD�}|d��}|�d�}	|	rxdd�|	D�}	|j|j	|j|j
|j|j|j
|jfkr�t|�}t|�d	kr�|d
}nt�|j|�}d|_tddd
�}
|r�tddd
�}t�|j||
f�}
t�|j	||
|f�}|	�r8t|�}t�|j|ft|	��}|jj|j	|j|j|j|j|j|j|j|jf	k�rrt|�}||_|S)N�negation�anchorcSsg|]}|���qS���clone��.0�nr	r	�1/usr/lib64/python3.8/lib2to3/fixes/fix_has_key.py�
<listcomp>Rsz'FixHasKey.transform.<locals>.<listcomp>�before�arg�aftercSsg|]}|���qSr	r
rr	r	rrVs��� �in)�prefix�not)�syms�parent�typeZnot_test�pattern�match�getrrZ
comparisonZand_testZor_testZtestZlambdefZargumentr�lenrZNodeZpowerrZcomp_op�tuple�exprZxor_exprZand_exprZ
shift_exprZ
arith_exprZtermZfactor)
�selfZnodeZresultsrrrrrrrZn_opZn_not�newr	r	r�	transformGsV�

�
�zFixHasKey.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr%r	r	r	rr&srN)�rrZ
fixer_utilrrZBaseFixrr	r	r	r�<module>!slib2to3/fixes/__pycache__/fix_xrange.cpython-38.opt-2.pyc000064400000004634151153537460017113 0ustar00U

e5d�
�@sBddlmZddlmZmZmZddlmZGdd�dej�ZdS)�)�
fixer_base)�Name�Call�consuming_calls)�patcompcsheZdZdZdZ�fdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
Z
e�e
�Z
dZe�e�Zdd�Z�ZS)�	FixXrangeTz�
              power<
                 (name='range'|name='xrange') trailer< '(' args=any ')' >
              rest=any* >
              cstt|��||�t�|_dS�N)�superr�
start_tree�set�transformed_xranges��selfZtree�filename��	__class__��0/usr/lib64/python3.8/lib2to3/fixes/fix_xrange.pyr
szFixXrange.start_treecCs
d|_dSr)rr
rrr�finish_treeszFixXrange.finish_treecCsD|d}|jdkr|�||�S|jdkr4|�||�Stt|���dS)N�nameZxrange�range)�value�transform_xrange�transform_range�
ValueError�repr�r�node�resultsrrrr�	transforms

zFixXrange.transformcCs0|d}|�td|jd��|j�t|��dS)Nrr��prefix)�replacerr!r�add�idrrrrr$szFixXrange.transform_xrangecCsft|�|jkrb|�|�sbttd�|d��g�}ttd�|g|jd�}|dD]}|�|�qN|SdS)Nr�args�listr �rest)r$r�in_special_contextrrZcloner!Zappend_child)rrrZ
range_callZ	list_call�nrrrr*s��zFixXrange.transform_rangez3power< func=NAME trailer< '(' node=any ')' > any* >z�for_stmt< 'for' any 'in' node=any ':' any* >
            | comp_for< 'for' any 'in' node=any any* >
            | comparison< any 'in' node=any any*>
         cCsf|jdkrdSi}|jjdk	rJ|j�|jj|�rJ|d|krJ|djtkS|j�|j|�od|d|kS)NFr�func)�parent�p1�matchrr�p2)rrrrrrr(?s
�
�zFixXrange.in_special_context)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr
rrrrZP1rZcompile_patternr,ZP2r.r(�
__classcell__rrrrrs	

rN)	�rZ
fixer_utilrrrrZBaseFixrrrrr�<module>slib2to3/fixes/__pycache__/fix_raise.cpython-38.pyc000064400000004310151153537460015761 0ustar00U

e5dn�@sZdZddlmZddlmZddlmZddlmZmZm	Z	m
Z
mZGdd�dej�Z
dS)	a[Fixer for 'raise E, V, T'

raise         -> raise
raise E       -> raise E
raise E, V    -> raise E(V)
raise E, V, T -> raise E(V).with_traceback(T)
raise E, None, T -> raise E.with_traceback(T)

raise (((E, E'), E''), E'''), V -> raise E(V)
raise "foo", V, T               -> warns about string exceptions


CAVEATS:
1) "raise E, V" will be incorrectly translated if V is an exception
   instance. The correct Python 3 idiom is

        raise E from V

   but since we can't detect instance-hood by syntax alone and since
   any client code would have to be changed as well, we don't automate
   this.
�)�pytree)�token)�
fixer_base)�Name�Call�Attr�ArgList�is_tuplec@seZdZdZdZdd�ZdS)�FixRaiseTzB
    raise_stmt< 'raise' exc=any [',' val=any [',' tb=any]] >
    cCsh|j}|d��}|jtjkr2d}|�||�dSt|�r^t|�rX|jdjd��}q:d|_d|kr�t	�
|jtd�|g�}|j|_|S|d��}t|�r�dd	�|jdd
�D�}nd|_|g}d|k�rB|d��}	d|	_|}
|jtj
ks�|jd
k�rt||�}
t|
td��t|	g�g}t	�
|jtd�g|�}|j|_|St	j
|jtd�t||�g|jd�SdS)N�excz+Python 3 does not support string exceptions��� �val�raisecSsg|]}|���qS�)�clone)�.0�crr�//usr/lib64/python3.8/lib2to3/fixes/fix_raise.py�
<listcomp>Dsz&FixRaise.transform.<locals>.<listcomp>�����tb�None�with_traceback)�prefix)�symsr�typer�STRINGZcannot_convertr	ZchildrenrrZNodeZ
raise_stmtr�NAME�valuerrrZsimple_stmt)�selfZnodeZresultsrr�msg�newr�argsr�eZwith_tbrrr�	transform&sB

�zFixRaise.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr'rrrrr
sr
N)�__doc__rrZpgen2rrZ
fixer_utilrrrrr	ZBaseFixr
rrrr�<module>s
lib2to3/fixes/__pycache__/fix_urllib.cpython-38.pyc000064400000013552151153537460016157 0ustar00U

e5d� �@s�dZddlmZmZddlmZmZmZmZm	Z	m
Z
mZdddddd	d
ddgfd
dddddddddddddddgfddgfgdd	dd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5gfdd6d7gfgd8�Zed9�
ed:d;�d<d=�ZGd>d?�d?e�Zd@S)Az�Fix changes imports of urllib which are now incompatible.
   This is rather similar to fix_imports, but because of the more
   complex nature of the fixing for urllib, it has its own fixer.
�)�
alternates�
FixImports)�Name�Comma�
FromImport�Newline�find_indentation�Node�symszurllib.requestZ	URLopenerZFancyURLopenerZurlretrieveZ
_urlopenerZurlopenZ
urlcleanupZpathname2urlZurl2pathnamezurllib.parseZquoteZ
quote_plusZunquoteZunquote_plusZ	urlencodeZ	splitattrZ	splithostZ
splitnportZsplitpasswdZ	splitportZ
splitqueryZsplittagZ	splittypeZ	splituserZ
splitvaluezurllib.errorZContentTooShortErrorZinstall_openerZbuild_openerZRequestZOpenerDirectorZBaseHandlerZHTTPDefaultErrorHandlerZHTTPRedirectHandlerZHTTPCookieProcessorZProxyHandlerZHTTPPasswordMgrZHTTPPasswordMgrWithDefaultRealmZAbstractBasicAuthHandlerZHTTPBasicAuthHandlerZProxyBasicAuthHandlerZAbstractDigestAuthHandlerZHTTPDigestAuthHandlerZProxyDigestAuthHandlerZHTTPHandlerZHTTPSHandlerZFileHandlerZ
FTPHandlerZCacheFTPHandlerZUnknownHandlerZURLErrorZ	HTTPError)�urllib�urllib2rr�ccsvt�}t��D]b\}}|D]T}|\}}t|�}d||fVd|||fVd|Vd|Vd||fVqqdS)Nz�import_name< 'import' (module=%r
                                  | dotted_as_names< any* module=%r any* >) >
                  z�import_from< 'from' mod_member=%r 'import'
                       ( member=%s | import_as_name< member=%s 'as' any > |
                         import_as_names< members=any*  >) >
                  zIimport_from< 'from' module_star=%r 'import' star='*' >
                  ztimport_name< 'import'
                                  dotted_as_name< module_as=%r 'as' any > >
                  zKpower< bare_with_attr=%r trailer< '.' member=%s > any* >
                  )�set�MAPPING�itemsr)ZbareZ
old_moduleZchanges�changeZ
new_module�members�r�0/usr/lib64/python3.8/lib2to3/fixes/fix_urllib.py�
build_pattern0s(�����rc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�	FixUrllibcCsd�t��S)N�|)�joinr)�selfrrrrIszFixUrllib.build_patterncCsv|�d�}|j}g}t|jdd�D] }|�t|d|d�t�g�q&|�tt|jdd|d��|�|�dS)z�Transform for the basic import case. Replaces the old
           import name with a comma separated list of its
           replacements.
        �moduleN���r��prefix)	�getrr�value�extendrr�append�replace)r�node�resultsZ
import_mod�pref�names�namerrr�transform_importLs
 zFixUrllib.transform_importcCs&|�d�}|j}|�d�}|r�t|t�r0|d}d}t|jD]}|j|dkr>|d}q^q>|rv|�t||d��n|�|d��n�g}i}	|d}
|
D]�}|j	t
jkr�|jd	j}|jdj}n
|j}d}|d
kr�t|jD]B}||dkr�|d|	k�r|�
|d�|	�|dg��
|�q�q�g}
t|�}d}dd
�}|D]�}|	|}g}|dd�D]"}|�|||��|�
t���q^|�||d|��t||�}|�r�|jj�|��r�||_|
�
|�d}�qB|
�rg}|
dd�D]}|�|t�g��q�|�
|
d�|�|�n|�|d�dS)z�Transform for imports of specific module elements. Replaces
           the module to be imported from with the appropriate new
           module.
        �
mod_member�memberrNr
r�!This is an invalid module elementr��,TcSsX|jtjkrHt|jdj|d�|jd��|jd��g}ttj|�gSt|j|d�gS)Nrrr
r,)�typer
�import_as_namer�childrenrZcloner	)r'rZkidsrrr�handle_name�s�z/FixUrllib.transform_member.<locals>.handle_namerFzAll module elements are invalid)rr�
isinstance�listrrr"r�cannot_convertr.r
r/r0r!�
setdefaultrr rr�parent�endswithr)rr#r$r)r%r*�new_namer�modulesZmod_dictrZas_name�member_nameZ	new_nodesZindentation�firstr1rZeltsr&Zelt�newZnodesZnew_noderrr�transform_member\sh




zFixUrllib.transform_membercCs~|�d�}|�d�}d}t|t�r*|d}t|jD]}|j|dkr4|d}qTq4|rn|�t||jd��n|�|d�dS)z.Transform for calls to module members in code.�bare_with_attrr*Nrr
rr+)	rr2r3rrr"rrr4)rr#r$Z
module_dotr*r8rrrr�
transform_dot�s


�
zFixUrllib.transform_dotcCsz|�d�r|�||�n^|�d�r0|�||�nF|�d�rH|�||�n.|�d�r`|�|d�n|�d�rv|�|d�dS)Nrr)r>Zmodule_starzCannot handle star imports.Z	module_asz#This module is now multiple modules)rr(r=r?r4)rr#r$rrr�	transform�s




zFixUrllib.transformN)�__name__�
__module__�__qualname__rr(r=r?r@rrrrrGs
LrN)�__doc__Zlib2to3.fixes.fix_importsrrZlib2to3.fixer_utilrrrrrr	r
rr!rrrrrr�<module>s~$������
�����!lib2to3/fixes/__pycache__/fix_repr.cpython-38.opt-2.pyc000064400000001410151153537460016564 0ustar00U

e5de�@s6ddlmZddlmZmZmZGdd�dej�ZdS)�)�
fixer_base)�Call�Name�parenthesizec@seZdZdZdZdd�ZdS)�FixReprTz7
              atom < '`' expr=any '`' >
              cCs8|d��}|j|jjkr"t|�}ttd�|g|jd�S)N�expr�repr)�prefix)Zclone�typeZsymsZ	testlist1rrrr	)�selfZnodeZresultsr�r�./usr/lib64/python3.8/lib2to3/fixes/fix_repr.py�	transformszFixRepr.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrrrrr
rsrN)�rZ
fixer_utilrrrZBaseFixrrrrr
�<module>slib2to3/fixes/__pycache__/fix_basestring.cpython-38.opt-1.pyc000064400000001222151153537460017755 0ustar00U

e5d@�@s2dZddlmZddlmZGdd�dej�ZdS)zFixer for basestring -> str.�)�
fixer_base)�Namec@seZdZdZdZdd�ZdS)�
FixBasestringTz'basestring'cCstd|jd�S)N�str)�prefix)rr)�selfZnodeZresults�r�4/usr/lib64/python3.8/lib2to3/fixes/fix_basestring.py�	transform
szFixBasestring.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr
rrrr	rsrN)�__doc__�rZ
fixer_utilrZBaseFixrrrrr	�<module>slib2to3/fixes/__pycache__/__init__.cpython-38.opt-1.pyc000064400000000211151153537460016502 0ustar00U

e5d/�@sdS)N�rrr�./usr/lib64/python3.8/lib2to3/fixes/__init__.py�<module>�lib2to3/fixes/__pycache__/fix_xreadlines.cpython-38.pyc000064400000002136151153537460017020 0ustar00U

e5d��@s2dZddlmZddlmZGdd�dej�ZdS)zpFix "for x in f.xreadlines()" -> "for x in f".

This fixer will also convert g(f.xreadlines) into g(f.__iter__).�)�
fixer_base)�Namec@seZdZdZdZdd�ZdS)�
FixXreadlinesTz�
    power< call=any+ trailer< '.' 'xreadlines' > trailer< '(' ')' > >
    |
    power< any+ trailer< '.' no_call='xreadlines' > >
    cCs@|�d�}|r$|�td|jd��n|�dd�|dD��dS)N�no_call�__iter__)�prefixcSsg|]}|���qS�)Zclone)�.0�xrr�4/usr/lib64/python3.8/lib2to3/fixes/fix_xreadlines.py�
<listcomp>sz+FixXreadlines.transform.<locals>.<listcomp>Zcall)�get�replacerr)�selfZnodeZresultsrrrr�	transforms
zFixXreadlines.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrrrrrrsrN)�__doc__�rZ
fixer_utilrZBaseFixrrrrr�<module>slib2to3/fixes/__pycache__/fix_reduce.cpython-38.opt-2.pyc000064400000001741151153537460017072 0ustar00U

e5dE�@s.ddlmZddlmZGdd�dej�ZdS)�)�
fixer_base��touch_importc@s eZdZdZdZdZdd�ZdS)�	FixReduceTZpreai
    power< 'reduce'
        trailer< '('
            arglist< (
                (not(argument<any '=' any>) any ','
                 not(argument<any '=' any>) any) |
                (not(argument<any '=' any>) any ','
                 not(argument<any '=' any>) any ','
                 not(argument<any '=' any>) any)
            ) >
        ')' >
    >
    cCstdd|�dS)N�	functools�reducer)�selfZnodeZresults�r	�0/usr/lib64/python3.8/lib2to3/fixes/fix_reduce.py�	transform"szFixReduce.transformN)�__name__�
__module__�__qualname__Z
BM_compatible�orderZPATTERNrr	r	r	r
rsrN)Zlib2to3rZlib2to3.fixer_utilrZBaseFixrr	r	r	r
�<module>
slib2to3/fixes/__pycache__/fix_ne.cpython-38.opt-2.pyc000064400000001371151153537460016224 0ustar00U

e5d;�@s:ddlmZddlmZddlmZGdd�dej�ZdS)�)�pytree)�token)�
fixer_basec@s"eZdZejZdd�Zdd�ZdS)�FixNecCs
|jdkS)Nz<>)�value)�self�node�r	�,/usr/lib64/python3.8/lib2to3/fixes/fix_ne.py�matchszFixNe.matchcCstjtjd|jd�}|S)Nz!=)�prefix)rZLeafr�NOTEQUALr)rrZresults�newr	r	r
�	transformszFixNe.transformN)�__name__�
__module__�__qualname__rr
Z_accept_typerrr	r	r	r
rsrN)�rZpgen2rrZBaseFixrr	r	r	r
�<module>slib2to3/fixes/__pycache__/fix_exec.cpython-38.opt-1.pyc000064400000002136151153537460016545 0ustar00U

e5d��@s:dZddlmZddlmZmZmZGdd�dej�ZdS)z�Fixer for exec.

This converts usages of the exec statement into calls to a built-in
exec() function.

exec code in ns1, ns2 -> exec(code, ns1, ns2)
�)�
fixer_base)�Comma�Name�Callc@seZdZdZdZdd�ZdS)�FixExecTzx
    exec_stmt< 'exec' a=any 'in' b=any [',' c=any] >
    |
    exec_stmt< 'exec' (not atom<'(' [any] ')'>) a=any >
    cCs�|j}|d}|�d�}|�d�}|��g}d|d_|dk	rR|�t�|��g�|dk	rn|�t�|��g�ttd�||jd�S)N�a�b�c���exec)�prefix)�syms�getZcloner
�extendrrr)�selfZnodeZresultsrrrr	�args�r�./usr/lib64/python3.8/lib2to3/fixes/fix_exec.py�	transforms



zFixExec.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrrrrrrsrN)	�__doc__r
rZ
fixer_utilrrrZBaseFixrrrrr�<module>s	lib2to3/fixes/__pycache__/fix_filter.cpython-38.pyc000064400000004607151153537460016154 0ustar00U

e5d�
�@sZdZddlmZddlmZddlmZddlm	Z	m
Z
mZmZm
Z
Gdd�dej�ZdS)	a�Fixer that changes filter(F, X) into list(filter(F, X)).

We avoid the transformation if the filter() call is directly contained
in iter(<>), list(<>), tuple(<>), sorted(<>), ...join(<>), or
for V in <>:.

NOTE: This is still not correct if the original code was depending on
filter(F, X) to return a string if X is a string and a tuple if X is a
tuple.  That would require type inference, which we don't do.  Let
Python 2.6 figure it out.
�)�
fixer_base)�Node)�python_symbols)�Name�ArgList�ListComp�in_special_context�parenthesizec@s eZdZdZdZdZdd�ZdS)�	FixFilterTaV
    filter_lambda=power<
        'filter'
        trailer<
            '('
            arglist<
                lambdef< 'lambda'
                         (fp=NAME | vfpdef< '(' fp=NAME ')'> ) ':' xp=any
                >
                ','
                it=any
            >
            ')'
        >
        [extra_trailers=trailer*]
    >
    |
    power<
        'filter'
        trailer< '(' arglist< none='None' ',' seq=any > ')' >
        [extra_trailers=trailer*]
    >
    |
    power<
        'filter'
        args=trailer< '(' [any] ')' >
        [extra_trailers=trailer*]
    >
    zfuture_builtins.filtercCsL|�|�rdSg}d|kr6|dD]}|�|���q"d|kr�|�d���}|jtjkrfd|_t|�}t	|�d���|�d���|�d���|�}t
tj|g|dd�}n�d|kr�t	td	�td	�|d
��td	��}t
tj|g|dd�}nTt
|�r�dS|d��}t
tjtd�|gdd�}t
tjtd
�t|g�g|�}d|_|j|_|S)NZextra_trailersZ
filter_lambda�xp��fp�it)�prefixZnoneZ_f�seq�args�filter�list)Zshould_skip�appendZclone�get�type�symsZtestrr	rrZpowerrrr)�selfZnodeZresultsZtrailers�tr�newr�r�0/usr/lib64/python3.8/lib2to3/fixes/fix_filter.py�	transform:s@
�
�zFixFilter.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNZskip_onrrrrrr
sr
N)�__doc__rrZpytreerZpygramrrZ
fixer_utilrrrrr	ZConditionalFixr
rrrr�<module>s

lib2to3/fixes/__pycache__/fix_imports2.cpython-38.pyc000064400000001035151153537460016436 0ustar00U

e5d!�@s0dZddlmZddd�ZGdd�dej�ZdS)zTFix incompatible imports and module references that must be fixed after
fix_imports.�)�fix_importsZdbm)ZwhichdbZanydbmc@seZdZdZeZdS)�FixImports2�N)�__name__�
__module__�__qualname__Z	run_order�MAPPING�mapping�r
r
�2/usr/lib64/python3.8/lib2to3/fixes/fix_imports2.pyrsrN)�__doc__�rrZ
FixImportsrr
r
r
r�<module>s
�lib2to3/fixes/__pycache__/fix_numliterals.cpython-38.pyc000064400000001772151153537460017226 0ustar00U

e5d�@s>dZddlmZddlmZddlmZGdd�dej�ZdS)z-Fixer that turns 1L into 1, 0755 into 0o755.
�)�token)�
fixer_base)�Numberc@s"eZdZejZdd�Zdd�ZdS)�FixNumliteralscCs|j�d�p|jddkS)N�0����Ll)�value�
startswith)�self�node�r
�5/usr/lib64/python3.8/lib2to3/fixes/fix_numliterals.py�matchszFixNumliterals.matchcCs`|j}|ddkr |dd�}n2|�d�rR|��rRtt|��dkrRd|dd�}t||jd�S)Nrrr�Z0o)�prefix)r	r
�isdigit�len�setrr)rrZresults�valr
r
r�	transforms"zFixNumliterals.transformN)�__name__�
__module__�__qualname__r�NUMBERZ_accept_typerrr
r
r
rrsrN)	�__doc__Zpgen2r�rZ
fixer_utilrZBaseFixrr
r
r
r�<module>slib2to3/fixes/__pycache__/fix_renames.cpython-38.opt-1.pyc000064400000003722151153537460017255 0ustar00U

e5d��@sVdZddlmZddlmZmZdddiiZiZdd�Zd	d
�Z	Gdd�dej
�Zd
S)z?Fix incompatible renames

Fixes:
  * sys.maxint -> sys.maxsize
�)�
fixer_base)�Name�
attr_chain�sysZmaxint�maxsizecCsdd�tt|��dS)N�(�|�))�join�map�repr)�members�r�1/usr/lib64/python3.8/lib2to3/fixes/fix_renames.py�
alternatessrccsZtt���D]H\}}t|���D]2\}}|t||f<d|||fVd||fVq qdS)Nz�
                  import_from< 'from' module_name=%r 'import'
                      ( attr_name=%r | import_as_name< attr_name=%r 'as' any >) >
                  z^
                  power< module_name=%r trailer< '.' attr_name=%r > any* >
                  )�list�MAPPING�items�LOOKUP)�module�replaceZold_attr�new_attrrrr�
build_patterns��rcs8eZdZdZd�e��ZdZ�fdd�Zdd�Z	�Z
S)�
FixRenamesTrZprecs@tt|�j��|�}|r<t�fdd�t|d�D��r8dS|SdS)Nc3s|]}�|�VqdS)Nr)�.0�obj��matchrr�	<genexpr>5sz#FixRenames.match.<locals>.<genexpr>�parentF)�superrr�anyr)�self�node�results��	__class__rrr1szFixRenames.matchcCsD|�d�}|�d�}|r@|r@t|j|jf}|�t||jd��dS)NZmodule_name�	attr_name)�prefix)�getr�valuerrr()r"r#r$Zmod_namer'rrrr�	transform>s


zFixRenames.transform)�__name__�
__module__�__qualname__Z
BM_compatibler
rZPATTERN�orderrr+�
__classcell__rrr%rr*s

rN)�__doc__�rZ
fixer_utilrrrrrrZBaseFixrrrrr�<module>s	lib2to3/fixes/__pycache__/fix_basestring.cpython-38.opt-2.pyc000064400000001145151153537460017762 0ustar00U

e5d@�@s.ddlmZddlmZGdd�dej�ZdS)�)�
fixer_base)�Namec@seZdZdZdZdd�ZdS)�
FixBasestringTz'basestring'cCstd|jd�S)N�str)�prefix)rr)�selfZnodeZresults�r�4/usr/lib64/python3.8/lib2to3/fixes/fix_basestring.py�	transform
szFixBasestring.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr
rrrr	rsrN)�rZ
fixer_utilrZBaseFixrrrrr	�<module>slib2to3/fixes/__pycache__/fix_intern.cpython-38.pyc000064400000002151151153537460016156 0ustar00U

e5dx�@s6dZddlmZddlmZmZGdd�dej�ZdS)z/Fixer for intern().

intern(s) -> sys.intern(s)�)�
fixer_base)�
ImportAndCall�touch_importc@s eZdZdZdZdZdd�ZdS)�	FixInternTZprez�
    power< 'intern'
           trailer< lpar='('
                    ( not(arglist | argument<any '=' any>) obj=any
                      | obj=arglist<(not argument<any '=' any>) any ','> )
                    rpar=')' >
           after=any*
    >
    cCsR|r2|d}|r2|j|jjkr2|jdjdkr2dSd}t|||�}tdd|�|S)N�obj�>�**�*)�sys�internr
)�typeZsymsZargumentZchildren�valuerr)�selfZnodeZresultsr�names�new�r�0/usr/lib64/python3.8/lib2to3/fixes/fix_intern.py�	transforms�zFixIntern.transformN)�__name__�
__module__�__qualname__Z
BM_compatible�orderZPATTERNrrrrrr
s
rN)�__doc__�rZ
fixer_utilrrZBaseFixrrrrr�<module>slib2to3/fixes/__pycache__/fix_urllib.cpython-38.opt-1.pyc000064400000013552151153537460017116 0ustar00U

e5d� �@s�dZddlmZmZddlmZmZmZmZm	Z	m
Z
mZdddddd	d
ddgfd
dddddddddddddddgfddgfgdd	dd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5gfdd6d7gfgd8�Zed9�
ed:d;�d<d=�ZGd>d?�d?e�Zd@S)Az�Fix changes imports of urllib which are now incompatible.
   This is rather similar to fix_imports, but because of the more
   complex nature of the fixing for urllib, it has its own fixer.
�)�
alternates�
FixImports)�Name�Comma�
FromImport�Newline�find_indentation�Node�symszurllib.requestZ	URLopenerZFancyURLopenerZurlretrieveZ
_urlopenerZurlopenZ
urlcleanupZpathname2urlZurl2pathnamezurllib.parseZquoteZ
quote_plusZunquoteZunquote_plusZ	urlencodeZ	splitattrZ	splithostZ
splitnportZsplitpasswdZ	splitportZ
splitqueryZsplittagZ	splittypeZ	splituserZ
splitvaluezurllib.errorZContentTooShortErrorZinstall_openerZbuild_openerZRequestZOpenerDirectorZBaseHandlerZHTTPDefaultErrorHandlerZHTTPRedirectHandlerZHTTPCookieProcessorZProxyHandlerZHTTPPasswordMgrZHTTPPasswordMgrWithDefaultRealmZAbstractBasicAuthHandlerZHTTPBasicAuthHandlerZProxyBasicAuthHandlerZAbstractDigestAuthHandlerZHTTPDigestAuthHandlerZProxyDigestAuthHandlerZHTTPHandlerZHTTPSHandlerZFileHandlerZ
FTPHandlerZCacheFTPHandlerZUnknownHandlerZURLErrorZ	HTTPError)�urllib�urllib2rr�ccsvt�}t��D]b\}}|D]T}|\}}t|�}d||fVd|||fVd|Vd|Vd||fVqqdS)Nz�import_name< 'import' (module=%r
                                  | dotted_as_names< any* module=%r any* >) >
                  z�import_from< 'from' mod_member=%r 'import'
                       ( member=%s | import_as_name< member=%s 'as' any > |
                         import_as_names< members=any*  >) >
                  zIimport_from< 'from' module_star=%r 'import' star='*' >
                  ztimport_name< 'import'
                                  dotted_as_name< module_as=%r 'as' any > >
                  zKpower< bare_with_attr=%r trailer< '.' member=%s > any* >
                  )�set�MAPPING�itemsr)ZbareZ
old_moduleZchanges�changeZ
new_module�members�r�0/usr/lib64/python3.8/lib2to3/fixes/fix_urllib.py�
build_pattern0s(�����rc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�	FixUrllibcCsd�t��S)N�|)�joinr)�selfrrrrIszFixUrllib.build_patterncCsv|�d�}|j}g}t|jdd�D] }|�t|d|d�t�g�q&|�tt|jdd|d��|�|�dS)z�Transform for the basic import case. Replaces the old
           import name with a comma separated list of its
           replacements.
        �moduleN���r��prefix)	�getrr�value�extendrr�append�replace)r�node�resultsZ
import_mod�pref�names�namerrr�transform_importLs
 zFixUrllib.transform_importcCs&|�d�}|j}|�d�}|r�t|t�r0|d}d}t|jD]}|j|dkr>|d}q^q>|rv|�t||d��n|�|d��n�g}i}	|d}
|
D]�}|j	t
jkr�|jd	j}|jdj}n
|j}d}|d
kr�t|jD]B}||dkr�|d|	k�r|�
|d�|	�|dg��
|�q�q�g}
t|�}d}dd
�}|D]�}|	|}g}|dd�D]"}|�|||��|�
t���q^|�||d|��t||�}|�r�|jj�|��r�||_|
�
|�d}�qB|
�rg}|
dd�D]}|�|t�g��q�|�
|
d�|�|�n|�|d�dS)z�Transform for imports of specific module elements. Replaces
           the module to be imported from with the appropriate new
           module.
        �
mod_member�memberrNr
r�!This is an invalid module elementr��,TcSsX|jtjkrHt|jdj|d�|jd��|jd��g}ttj|�gSt|j|d�gS)Nrrr
r,)�typer
�import_as_namer�childrenrZcloner	)r'rZkidsrrr�handle_name�s�z/FixUrllib.transform_member.<locals>.handle_namerFzAll module elements are invalid)rr�
isinstance�listrrr"r�cannot_convertr.r
r/r0r!�
setdefaultrr rr�parent�endswithr)rr#r$r)r%r*�new_namer�modulesZmod_dictrZas_name�member_nameZ	new_nodesZindentation�firstr1rZeltsr&Zelt�newZnodesZnew_noderrr�transform_member\sh




zFixUrllib.transform_membercCs~|�d�}|�d�}d}t|t�r*|d}t|jD]}|j|dkr4|d}qTq4|rn|�t||jd��n|�|d�dS)z.Transform for calls to module members in code.�bare_with_attrr*Nrr
rr+)	rr2r3rrr"rrr4)rr#r$Z
module_dotr*r8rrrr�
transform_dot�s


�
zFixUrllib.transform_dotcCsz|�d�r|�||�n^|�d�r0|�||�nF|�d�rH|�||�n.|�d�r`|�|d�n|�d�rv|�|d�dS)Nrr)r>Zmodule_starzCannot handle star imports.Z	module_asz#This module is now multiple modules)rr(r=r?r4)rr#r$rrr�	transform�s




zFixUrllib.transformN)�__name__�
__module__�__qualname__rr(r=r?r@rrrrrGs
LrN)�__doc__Zlib2to3.fixes.fix_importsrrZlib2to3.fixer_utilrrrrrr	r
rr!rrrrrr�<module>s~$������
�����!lib2to3/fixes/__pycache__/fix_asserts.cpython-38.pyc000064400000002372151153537460016350 0ustar00U

e5d��@sTdZddlmZddlmZedddddd	d
dddddddd
�ZGdd�de�ZdS)z5Fixer that replaces deprecated unittest method names.�)�BaseFix)�NameZ
assertTrueZassertEqualZassertNotEqualZassertAlmostEqualZassertNotAlmostEqualZassertRegexZassertRaisesRegexZassertRaisesZassertFalse)Zassert_ZassertEqualsZassertNotEqualsZassertAlmostEqualsZassertNotAlmostEqualsZassertRegexpMatchesZassertRaisesRegexpZfailUnlessEqualZfailIfEqualZfailUnlessAlmostEqualZfailIfAlmostEqualZ
failUnlessZfailUnlessRaisesZfailIfc@s(eZdZdd�eee��Zdd�ZdS)�
FixAssertszH
              power< any+ trailer< '.' meth=(%s)> any* >
              �|cCs,|dd}|�ttt|�|jd��dS)NZmeth�)�prefix)�replacer�NAMES�strr)�selfZnodeZresults�name�r
�1/usr/lib64/python3.8/lib2to3/fixes/fix_asserts.py�	transform szFixAsserts.transformN)	�__name__�
__module__�__qualname__�join�map�reprr	ZPATTERNrr
r
r
rrs�rN)�__doc__Z
fixer_baserZ
fixer_utilr�dictr	rr
r
r
r�<module>s&�lib2to3/fixes/__pycache__/fix_idioms.cpython-38.pyc000064400000007514151153537460016153 0ustar00U

e5d�@sNdZddlmZddlmZmZmZmZmZm	Z	dZ
dZGdd�dej�Z
dS)	a�Adjust some old Python 2 idioms to their modern counterparts.

* Change some type comparisons to isinstance() calls:
    type(x) == T -> isinstance(x, T)
    type(x) is T -> isinstance(x, T)
    type(x) != T -> not isinstance(x, T)
    type(x) is not T -> not isinstance(x, T)

* Change "while 1:" into "while True:".

* Change both

    v = list(EXPR)
    v.sort()
    foo(v)

and the more general

    v = EXPR
    v.sort()
    foo(v)

into

    v = sorted(EXPR)
    foo(v)
�)�
fixer_base)�Call�Comma�Name�Node�	BlankLine�symsz0(n='!=' | '==' | 'is' | n=comp_op< 'is' 'not' >)z(power< 'type' trailer< '(' x=any ')' > >csPeZdZdZdeeeefZ�fdd�Zdd�Zdd�Z	d	d
�Z
dd�Z�ZS)
�	FixIdiomsTa�
        isinstance=comparison< %s %s T=any >
        |
        isinstance=comparison< T=any %s %s >
        |
        while_stmt< 'while' while='1' ':' any+ >
        |
        sorted=any<
            any*
            simple_stmt<
              expr_stmt< id1=any '='
                         power< list='list' trailer< '(' (not arglist<any+>) any ')' > >
              >
              '\n'
            >
            sort=
            simple_stmt<
              power< id2=any
                     trailer< '.' 'sort' > trailer< '(' ')' >
              >
              '\n'
            >
            next=any*
        >
        |
        sorted=any<
            any*
            simple_stmt< expr_stmt< id1=any '=' expr=any > '\n' >
            sort=
            simple_stmt<
              power< id2=any
                     trailer< '.' 'sort' > trailer< '(' ')' >
              >
              '\n'
            >
            next=any*
        >
    cs8tt|��|�}|r4d|kr4|d|dkr0|SdS|S)N�sortedZid1Zid2)�superr	�match)�self�node�r��	__class__��0/usr/lib64/python3.8/lib2to3/fixes/fix_idioms.pyrOszFixIdioms.matchcCsHd|kr|�||�Sd|kr(|�||�Sd|kr<|�||�Std��dS)N�
isinstance�whiler
z
Invalid match)�transform_isinstance�transform_while�transform_sort�RuntimeError)r
r�resultsrrr�	transformZszFixIdioms.transformcCsh|d��}|d��}d|_d|_ttd�|t�|g�}d|kr\d|_ttjtd�|g�}|j|_|S)N�x�T�� r�n�not)�clone�prefixrrrrrZnot_test)r
rrrrZtestrrrrdszFixIdioms.transform_isinstancecCs |d}|�td|jd��dS)Nr�True�r#)�replacerr#)r
rrZonerrrrpszFixIdioms.transform_whilecCs|d}|d}|�d�}|�d�}|r>|�td|jd��n8|rn|��}d|_|�ttd�|g|jd��ntd��|��|j}d	|k�r|r�|�d	�d
|d
jf}	d	�	|	�|d
_nH|j
s�t�|jdks�t�t
�}
|j
�|
�|j|
ks�t�|�d	�d
|
_dS)N�sort�next�list�exprr
r%rzshould not have reached here�
�)�getr&rr#r"rr�remove�
rpartition�join�parent�AssertionErrorZnext_siblingrZappend_child)r
rrZ	sort_stmtZ	next_stmtZ	list_callZsimple_expr�newZbtwnZprefix_linesZend_linerrrrts2

�


zFixIdioms.transform_sort)
�__name__�
__module__�__qualname__Zexplicit�TYPE�CMPZPATTERNrrrrr�
__classcell__rrrrr	%s%
�'
r	N)�__doc__rrZ
fixer_utilrrrrrrr8r7ZBaseFixr	rrrr�<module>s
 lib2to3/fixes/__pycache__/fix_sys_exc.cpython-38.opt-1.pyc000064400000002576151153537460017306 0ustar00U

e5d
�@sJdZddlmZddlmZmZmZmZmZm	Z	m
Z
Gdd�dej�ZdS)z�Fixer for sys.exc_{type, value, traceback}

sys.exc_type -> sys.exc_info()[0]
sys.exc_value -> sys.exc_info()[1]
sys.exc_traceback -> sys.exc_info()[2]
�)�
fixer_base)�Attr�Call�Name�Number�	Subscript�Node�symsc@s:eZdZdddgZdZdd�dd�eD��Zd	d
�ZdS)�	FixSysExc�exc_type�	exc_value�
exc_tracebackTzN
              power< 'sys' trailer< dot='.' attribute=(%s) > >
              �|ccs|]}d|VqdS)z'%s'N�)�.0�err�1/usr/lib64/python3.8/lib2to3/fixes/fix_sys_exc.py�	<genexpr>szFixSysExc.<genexpr>cCst|dd}t|j�|j��}ttd�|jd�}ttd�|�}|dj|djd_|�	t
|��ttj
||jd�S)NZ	attribute��exc_info)�prefix�sys�dot�)rr�index�valuerrrrZchildren�appendrrr	Zpower)�selfZnodeZresultsZsys_attrrZcall�attrrrr�	transformszFixSysExc.transformN)�__name__�
__module__�__qualname__rZ
BM_compatible�joinZPATTERNrrrrrr
s
�r
N)
�__doc__�rZ
fixer_utilrrrrrrr	ZBaseFixr
rrrr�<module>s
$lib2to3/fixes/__pycache__/fix_has_key.cpython-38.opt-1.pyc000064400000005532151153537460017247 0ustar00U

e5d|�@sBdZddlmZddlmZddlmZmZGdd�dej�ZdS)a&Fixer for has_key().

Calls to .has_key() methods are expressed in terms of the 'in'
operator:

    d.has_key(k) -> k in d

CAVEATS:
1) While the primary target of this fixer is dict.has_key(), the
   fixer will change any has_key() method call, regardless of its
   class.

2) Cases like this will not be converted:

    m = d.has_key
    if m(k):
        ...

   Only *calls* to has_key() are converted. While it is possible to
   convert the above to something like

    m = d.__contains__
    if m(k):
        ...

   this is currently not done.
�)�pytree)�
fixer_base)�Name�parenthesizec@seZdZdZdZdd�ZdS)�	FixHasKeyTa�
    anchor=power<
        before=any+
        trailer< '.' 'has_key' >
        trailer<
            '('
            ( not(arglist | argument<any '=' any>) arg=any
            | arglist<(not argument<any '=' any>) arg=any ','>
            )
            ')'
        >
        after=any*
    >
    |
    negation=not_test<
        'not'
        anchor=power<
            before=any+
            trailer< '.' 'has_key' >
            trailer<
                '('
                ( not(arglist | argument<any '=' any>) arg=any
                | arglist<(not argument<any '=' any>) arg=any ','>
                )
                ')'
            >
        >
    >
    c

Cs||j}|jj|jkr&|j�|j�r&dS|�d�}|d}|j}dd�|dD�}|d��}|�d�}	|	rxdd�|	D�}	|j|j	|j|j
|j|j|j
|jfkr�t|�}t|�d	kr�|d
}nt�|j|�}d|_tddd
�}
|r�tddd
�}t�|j||
f�}
t�|j	||
|f�}|	�r8t|�}t�|j|ft|	��}|jj|j	|j|j|j|j|j|j|j|jf	k�rrt|�}||_|S)N�negation�anchorcSsg|]}|���qS���clone��.0�nr	r	�1/usr/lib64/python3.8/lib2to3/fixes/fix_has_key.py�
<listcomp>Rsz'FixHasKey.transform.<locals>.<listcomp>�before�arg�aftercSsg|]}|���qSr	r
rr	r	rrVs��� �in)�prefix�not)�syms�parent�typeZnot_test�pattern�match�getrrZ
comparisonZand_testZor_testZtestZlambdefZargumentr�lenrZNodeZpowerrZcomp_op�tuple�exprZxor_exprZand_exprZ
shift_exprZ
arith_exprZtermZfactor)
�selfZnodeZresultsrrrrrrrZn_opZn_not�newr	r	r�	transformGsV�

�
�zFixHasKey.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr%r	r	r	rr&srN)	�__doc__�rrZ
fixer_utilrrZBaseFixrr	r	r	r�<module>slib2to3/fixes/__pycache__/fix_execfile.cpython-38.opt-1.pyc000064400000003202151153537460017400 0ustar00U

e5d�@sVdZddlmZddlmZmZmZmZmZm	Z	m
Z
mZmZm
Z
Gdd�dej�ZdS)zoFixer for execfile.

This converts usages of the execfile function into calls to the built-in
exec() function.
�)�
fixer_base)
�Comma�Name�Call�LParen�RParen�Dot�Node�ArgList�String�symsc@seZdZdZdZdd�ZdS)�FixExecfileTz�
    power< 'execfile' trailer< '(' arglist< filename=any [',' globals=any [',' locals=any ] ] > ')' > >
    |
    power< 'execfile' trailer< '(' filename=any ')' > >
    cCs&|d}|�d�}|�d�}|jdjd��}t|��t�tdd�g|d�}ttjt	d�|g�}ttj
t�t	d	�g�ttj
t�t
�g�g}	|g|	}
|��}d|_td
d�}|
t�|t�|g}
tt	d�|
d�}|g}|dk	r�|�t�|��g�|dk	�r|�t�|��g�tt	d
�||jd�S)N�filename�globals�locals���z"rb"� )Zrparen�open�readz'exec'�compile��exec)�prefix)�getZchildrenZcloner
rrr	rZpowerrZtrailerrrrrr�extend)�selfZnodeZresultsrrrZexecfile_parenZ	open_argsZ	open_callrZ	open_exprZfilename_argZexec_strZcompile_argsZcompile_call�args�r�2/usr/lib64/python3.8/lib2to3/fixes/fix_execfile.py�	transforms.

��


zFixExecfile.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrrrrrr
sr
N)�__doc__rrZ
fixer_utilrrrrrrr	r
rrZBaseFixr
rrrr�<module>s0lib2to3/fixes/__pycache__/fix_paren.cpython-38.opt-1.pyc000064400000002551151153537460016727 0ustar00U

e5d��@s6dZddlmZddlmZmZGdd�dej�ZdS)zuFixer that addes parentheses where they are required

This converts ``[x for x in 1, 2]`` to ``[x for x in (1, 2)]``.�)�
fixer_base)�LParen�RParenc@seZdZdZdZdd�ZdS)�FixParenTa
        atom< ('[' | '(')
            (listmaker< any
                comp_for<
                    'for' NAME 'in'
                    target=testlist_safe< any (',' any)+ [',']
                     >
                    [any]
                >
            >
            |
            testlist_gexp< any
                comp_for<
                    'for' NAME 'in'
                    target=testlist_safe< any (',' any)+ [',']
                     >
                    [any]
                >
            >)
        (']' | ')') >
    cCs8|d}t�}|j|_d|_|�d|�|�t��dS)N�target��)r�prefixZinsert_childZappend_childr)�selfZnodeZresultsrZlparen�r�//usr/lib64/python3.8/lib2to3/fixes/fix_paren.py�	transform%szFixParen.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr
rrrrrsrN)�__doc__rrZ
fixer_utilrrZBaseFixrrrrr�<module>slib2to3/fixes/__pycache__/fix_import.cpython-38.pyc000064400000005336151153537460016201 0ustar00U

e5d��@sZdZddlmZddlmZmZmZmZddlm	Z	m
Z
mZdd�ZGdd	�d	ej
�Zd
S)z�Fixer for import statements.
If spam is being imported from the local directory, this import:
    from spam import eggs
Becomes:
    from .spam import eggs

And this import:
    import spam
Becomes:
    from . import spam
�)�
fixer_base�)�dirname�join�exists�sep)�
FromImport�syms�tokenccs�|g}|r�|��}|jtjkr(|jVq|jtjkrNd�dd�|jD��Vq|jtj	krl|�
|jd�q|jtjkr�|�|jddd��qt
d��qdS)zF
    Walks over all the names imported in a dotted_as_names node.
    �cSsg|]
}|j�qS�)�value)�.0Zchrr�0/usr/lib64/python3.8/lib2to3/fixes/fix_import.py�
<listcomp>sz$traverse_imports.<locals>.<listcomp>rN���zunknown node type)�pop�typer
�NAMEr
r	Zdotted_namer�childrenZdotted_as_name�appendZdotted_as_names�extend�AssertionError)�namesZpending�noderrr�traverse_importss
rcs4eZdZdZdZ�fdd�Zdd�Zdd�Z�ZS)	�	FixImportTzj
    import_from< 'from' imp=any 'import' ['('] any [')'] >
    |
    import_name< 'import' imp=any >
    cs"tt|��||�d|jk|_dS)NZabsolute_import)�superr�
start_treeZfuture_features�skip)�selfZtree�name��	__class__rrr/szFixImport.start_treecCs�|jr
dS|d}|jtjkrVt|d�s4|jd}q|�|j�r�d|j|_|��nZd}d}t	|�D]}|�|�rzd}qfd}qf|r�|r�|�
|d�dStd|g�}|j|_|SdS)N�impr
r�.FTz#absolute and local imports together)
rrr	Zimport_from�hasattrr�probably_a_local_importr
ZchangedrZwarningr�prefix)r rZresultsr$Z
have_localZ
have_absoluteZmod_name�newrrr�	transform3s,


zFixImport.transformcCst|�d�rdS|�dd�d}t|j�}t||�}ttt|�d��sHdSdtddd	d
fD]}t||�rXdSqXdS)Nr%F�rz__init__.pyz.pyz.pycz.soz.slz.pydT)�
startswith�splitr�filenamerrr)r Zimp_name�	base_pathZextrrrr'Us


z!FixImport.probably_a_local_import)	�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrr*r'�
__classcell__rrr"rr&s
"rN)�__doc__rrZos.pathrrrrZ
fixer_utilrr	r
rZBaseFixrrrrr�<module>s

lib2to3/fixes/__pycache__/fix_numliterals.cpython-38.opt-1.pyc000064400000001772151153537460020165 0ustar00U

e5d�@s>dZddlmZddlmZddlmZGdd�dej�ZdS)z-Fixer that turns 1L into 1, 0755 into 0o755.
�)�token)�
fixer_base)�Numberc@s"eZdZejZdd�Zdd�ZdS)�FixNumliteralscCs|j�d�p|jddkS)N�0����Ll)�value�
startswith)�self�node�r
�5/usr/lib64/python3.8/lib2to3/fixes/fix_numliterals.py�matchszFixNumliterals.matchcCs`|j}|ddkr |dd�}n2|�d�rR|��rRtt|��dkrRd|dd�}t||jd�S)Nrrr�Z0o)�prefix)r	r
�isdigit�len�setrr)rrZresults�valr
r
r�	transforms"zFixNumliterals.transformN)�__name__�
__module__�__qualname__r�NUMBERZ_accept_typerrr
r
r
rrsrN)	�__doc__Zpgen2r�rZ
fixer_utilrZBaseFixrr
r
r
r�<module>slib2to3/fixes/__pycache__/fix_exitfunc.cpython-38.pyc000064400000004375151153537460016516 0ustar00U

e5d�	�@sJdZddlmZmZddlmZmZmZmZm	Z	m
Z
Gdd�dej�ZdS)z7
Convert use of sys.exitfunc to use the atexit module.
�)�pytree�
fixer_base)�Name�Attr�Call�Comma�Newline�symscs<eZdZdZdZdZ�fdd�Z�fdd�Zdd�Z�Z	S)	�FixExitfuncTa�
              (
                  sys_import=import_name<'import'
                      ('sys'
                      |
                      dotted_as_names< (any ',')* 'sys' (',' any)* >
                      )
                  >
              |
                  expr_stmt<
                      power< 'sys' trailer< '.' 'exitfunc' > >
                  '=' func=any >
              )
              cstt|�j|�dS�N)�superr
�__init__)�self�args��	__class__��2/usr/lib64/python3.8/lib2to3/fixes/fix_exitfunc.pyr
szFixExitfunc.__init__cstt|��||�d|_dSr)rr
�
start_tree�
sys_import)rZtree�filenamerrrr!szFixExitfunc.start_treecCs&d|kr |jdkr|d|_dS|d��}d|_t�tjttd�td���}t	||g|j�}|�
|�|jdkr�|�|d�dS|jjd}|j
tjkr�|�t��|�tdd��nj|jj}|j�|j�}|j}	t�tjtd	�tdd�g�}
t�tj|
g�}|�|dt��|�|d
|�dS)Nr�func��atexit�registerzKCan't find sys import; Please add an atexit import at the top of your file.�� �import�)rZclone�prefixrZNoder	Zpowerrrr�replaceZwarningZchildren�typeZdotted_as_namesZappend_childr�parent�indexZimport_nameZsimple_stmtZinsert_childr)rZnodeZresultsrrZcall�namesZcontaining_stmtZpositionZstmt_containerZ
new_import�newrrr�	transform%s6

�

�zFixExitfunc.transform)
�__name__�
__module__�__qualname__Zkeep_line_orderZ
BM_compatibleZPATTERNr
rr&�
__classcell__rrrrr
sr
N)
�__doc__Zlib2to3rrZlib2to3.fixer_utilrrrrrr	ZBaseFixr
rrrr�<module>s lib2to3/fixes/__pycache__/fix_apply.cpython-38.opt-1.pyc000064400000003161151153537460016745 0ustar00U

e5d*	�@sRdZddlmZddlmZddlmZddlmZmZm	Z	Gdd�dej
�ZdS)	zIFixer for apply().

This converts apply(func, v, k) into (func)(*v, **k).�)�pytree)�token)�
fixer_base)�Call�Comma�parenthesizec@seZdZdZdZdd�ZdS)�FixApplyTa.
    power< 'apply'
        trailer<
            '('
            arglist<
                (not argument<NAME '=' any>) func=any ','
                (not argument<NAME '=' any>) args=any [','
                (not argument<NAME '=' any>) kwds=any] [',']
            >
            ')'
        >
    >
    c	Cs,|j}|d}|d}|�d�}|rF|j|jjkrF|jdjdkrFdS|rl|j|jjkrl|jdjdkrldS|j}|��}|jtj	|j
fkr�|j|jks�|jdjtjkr�t
|�}d|_|��}d|_|dk	r�|��}d|_t�tjd	�|g}|dk	�r|�t�t�tjd�|g�d
|d_t|||d�S)N�func�args�kwds�>�**�*r
����r� )�prefix)�syms�get�typeZargumentZchildren�valuerZcloner�NAMEZatomZpower�
DOUBLESTARrrZLeaf�STAR�extendrr)	�selfZnodeZresultsrr	r
rrZ	l_newargs�r�//usr/lib64/python3.8/lib2to3/fixes/fix_apply.py�	transformsF
��
��
�
zFixApply.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrrrrrrsrN)�__doc__rrZpgen2rrZ
fixer_utilrrrZBaseFixrrrrr�<module>s
lib2to3/fixes/__pycache__/fix_raw_input.cpython-38.opt-2.pyc000064400000001323151153537460017627 0ustar00U

e5d��@s.ddlmZddlmZGdd�dej�ZdS)�)�
fixer_base)�Namec@seZdZdZdZdd�ZdS)�FixRawInputTzU
              power< name='raw_input' trailer< '(' [any] ')' > any* >
              cCs |d}|�td|jd��dS)N�name�input)�prefix)�replacerr)�selfZnodeZresultsr�r
�3/usr/lib64/python3.8/lib2to3/fixes/fix_raw_input.py�	transformszFixRawInput.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrr
r
r
rrsrN)�rZ
fixer_utilrZBaseFixrr
r
r
r�<module>slib2to3/fixes/__pycache__/fix_metaclass.cpython-38.opt-2.pyc000064400000007521151153537460017601 0ustar00U

e5d �@srddlmZddlmZddlmZmZmZdd�Zdd�Z	dd	�Z
d
d�Zdd
�Zdd�Z
Gdd�dej�ZdS)�)�
fixer_base)�token)�syms�Node�LeafcCsz|jD]n}|jtjkr"t|�S|jtjkr|jr|jd}|jtjkr|jr|jd}t|t�r|j	dkrdSqdS)N��
__metaclass__TF)
�children�typer�suite�
has_metaclass�simple_stmt�	expr_stmt�
isinstancer�value)�parent�node�	expr_nodeZ	left_side�r�3/usr/lib64/python3.8/lib2to3/fixes/fix_metaclass.pyrs



�rcCs�|jD]}|jtjkrdSqt|j�D]\}}|jtjkr(qJq(td��ttjg�}|j|dd�r�|j|d}|�	|�
��|��qV|�	|�|}dS)NzNo class suite and no ':'!�)r	r
rr�	enumerater�COLON�
ValueErrorr�append_child�clone�remove)�cls_noder�ir�	move_noderrr�fixup_parse_tree-s


r c
Cs�t|j�D]\}}|jtjkr
q(q
dS|��ttjg�}ttj	|g�}|j|d�rz|j|}|�
|���|��qJ|�||�|jdjd}|jdjd}	|	j
|_
dS)Nr)rr	r
r�SEMIrrrrr
rr�insert_child�prefix)
rrZ	stmt_nodeZsemi_indrZnew_exprZnew_stmtrZ	new_leaf1Z	old_leaf1rrr�fixup_simple_stmtGs

r$cCs*|jr&|jdjtjkr&|jd��dS)N���)r	r
r�NEWLINEr)rrrr�remove_trailing_newline_sr'ccs�|jD]}|jtjkrq$qtd��tt|j��D]t\}}|jtjkr2|jr2|jd}|jtjkr2|jr2|jd}t	|t
�r2|jdkr2t|||�t
|�|||fVq2dS)NzNo class suite!rr)r	r
rrr�listrr
rrrrr$r')rrrZsimple_noderZ	left_noderrr�
find_metasds



�r)cCsz|jddd�}|r,|��}|jtjkrq,q|rv|��}t|t�r^|jtjkr^|jrZd|_dS|�	|jddd��q,dS)Nr%�)
r	�popr
r�INDENTrr�DEDENTr#�extend)rZkidsrrrr�fixup_indent{sr/c@seZdZdZdZdd�ZdS)�FixMetaclassTz
    classdef<any*>
    cCs8t|�sdSt|�d}t|�D]\}}}|}|��q |jdj}t|j�dkr�|jdjtjkrp|jd}n(|jd�	�}	t
tj|	g�}|�d|�n�t|j�dkr�t
tjg�}|�d|�nZt|j�dk�rt
tjg�}|�dt
tjd��|�d|�|�dt
tjd��ntd	��|jdjd}
d
|
_|
j}|j�rZ|�t
tjd��d|
_nd
|
_|jd}d
|jd_d
|jd_|�|�t|�|j�s�|��t
|d�}
||
_|�|
�|�t
tjd��nbt|j�dk�r4|jdjtjk�r4|jdjtjk�r4t
|d�}
|�d|
�|�dt
tjd��dS)Nr����r�)�(zUnexpected class definition�	metaclass�,� r*r�pass�
���r%)rr r)rr	r
�lenr�arglistrrZ	set_childr"rr�RPAR�LPARrrr#r�COMMAr/r&r,r-)�selfrZresultsZlast_metaclassrrZstmtZ	text_typer>rZmeta_txtZorig_meta_prefixrZ	pass_leafrrr�	transform�sb




��
zFixMetaclass.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrCrrrrr0�sr0N)r*rZpygramrZ
fixer_utilrrrrr r$r'r)r/ZBaseFixr0rrrr�<module>slib2to3/fixes/__pycache__/fix_apply.cpython-38.opt-2.pyc000064400000003027151153537460016747 0ustar00U

e5d*	�@sNddlmZddlmZddlmZddlmZmZmZGdd�dej	�Z
dS)�)�pytree)�token)�
fixer_base)�Call�Comma�parenthesizec@seZdZdZdZdd�ZdS)�FixApplyTa.
    power< 'apply'
        trailer<
            '('
            arglist<
                (not argument<NAME '=' any>) func=any ','
                (not argument<NAME '=' any>) args=any [','
                (not argument<NAME '=' any>) kwds=any] [',']
            >
            ')'
        >
    >
    c	Cs,|j}|d}|d}|�d�}|rF|j|jjkrF|jdjdkrFdS|rl|j|jjkrl|jdjdkrldS|j}|��}|jtj	|j
fkr�|j|jks�|jdjtjkr�t
|�}d|_|��}d|_|dk	r�|��}d|_t�tjd	�|g}|dk	�r|�t�t�tjd�|g�d
|d_t|||d�S)N�func�args�kwds�>�**�*r
����r� )�prefix)�syms�get�typeZargumentZchildren�valuerZcloner�NAMEZatomZpower�
DOUBLESTARrrZLeaf�STAR�extendrr)	�selfZnodeZresultsrr	r
rrZ	l_newargs�r�//usr/lib64/python3.8/lib2to3/fixes/fix_apply.py�	transformsF
��
��
�
zFixApply.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrrrrrrsrN)rrZpgen2rrZ
fixer_utilrrrZBaseFixrrrrr�<module>	slib2to3/fixes/__pycache__/fix_next.cpython-38.opt-1.pyc000064400000005752151153537460016606 0ustar00U

e5df�@sndZddlmZddlmZddlmZddlm	Z	m
Z
mZdZGdd�dej
�Zd	d
�Zdd�Zd
d�ZdS)z.Fixer for it.next() -> next(it), per PEP 3114.�)�token)�python_symbols)�
fixer_base)�Name�Call�find_bindingz;Calls to builtin next() possibly shadowed by global bindingcs0eZdZdZdZdZ�fdd�Zdd�Z�ZS)�FixNextTa�
    power< base=any+ trailer< '.' attr='next' > trailer< '(' ')' > >
    |
    power< head=any+ trailer< '.' attr='next' > not trailer< '(' ')' > >
    |
    classdef< 'class' any+ ':'
              suite< any*
                     funcdef< 'def'
                              name='next'
                              parameters< '(' NAME ')' > any+ >
                     any* > >
    |
    global=global_stmt< 'global' any* 'next' any* >
    Zprecs>tt|��||�td|�}|r4|�|t�d|_nd|_dS)N�nextTF)�superr�
start_treer�warning�bind_warning�
shadowed_next)�selfZtree�filename�n��	__class__��./usr/lib64/python3.8/lib2to3/fixes/fix_next.pyr$s
zFixNext.start_treecCs�|�d�}|�d�}|�d�}|rr|jr>|�td|jd��q�dd�|D�}d|d	_|�ttd
|jd�|��n�|r�td|jd�}|�|�nj|r�t|�r�|d}d�dd�|D����d
kr�|�	|t
�dS|�td��nd|kr�|�	|t
�d|_dS)N�base�attr�name�__next__)�prefixcSsg|]}|���qSr)Zclone��.0rrrr�
<listcomp>9sz%FixNext.transform.<locals>.<listcomp>��r	�headcSsg|]}t|��qSr)�strrrrrrEsZ__builtin__�globalT)�getr�replacerrr�is_assign_target�join�striprr
)r�nodeZresultsrrrrr rrr�	transform.s,



zFixNext.transform)	�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERN�orderrr)�
__classcell__rrrrrs

rcCsFt|�}|dkrdS|jD]&}|jtjkr0dSt||�rdSqdS)NFT)�find_assign�children�typer�EQUAL�
is_subtree)r(ZassignZchildrrrr%Qs

r%cCs4|jtjkr|S|jtjks&|jdkr*dSt|j�S�N)r1�symsZ	expr_stmtZsimple_stmt�parentr/�r(rrrr/]s
r/cs$|�krdSt�fdd�|jD��S)NTc3s|]}t|��VqdSr4)r3)r�cr7rr�	<genexpr>gszis_subtree.<locals>.<genexpr>)�anyr0)�rootr(rr7rr3dsr3N)�__doc__Zpgen2rZpygramrr5rrZ
fixer_utilrrrr
ZBaseFixrr%r/r3rrrr�<module>s@lib2to3/fixes/__pycache__/fix_types.cpython-38.opt-1.pyc000064400000003450151153537460016765 0ustar00U

e5d��@spdZddlmZddlmZddddddd	d
dddd
dddddddddd�Zdd�eD�ZGdd�dej�ZdS)a�Fixer for removing uses of the types module.

These work for only the known names in the types module.  The forms above
can include types. or not.  ie, It is assumed the module is imported either as:

    import types
    from types import ... # either * or specific types

The import statements are not modified.

There should be another fixer that handles at least the following constants:

   type([]) -> list
   type(()) -> tuple
   type('') -> str

�)�
fixer_base)�Name�bool�
memoryview�type�complex�dictztype(Ellipsis)�float�int�list�objectz
type(None)ztype(NotImplemented)�slice�bytesz(str,)�tuple�str�range)ZBooleanTypeZ
BufferTypeZ	ClassTypeZComplexTypeZDictTypeZDictionaryTypeZEllipsisTypeZ	FloatTypeZIntTypeZListTypeZLongTypeZ
ObjectTypeZNoneTypeZNotImplementedTypeZ	SliceTypeZ
StringTypeZStringTypesZ	TupleTypeZTypeTypeZUnicodeTypeZ
XRangeTypecCsg|]}d|�qS)z)power< 'types' trailer< '.' name='%s' > >�)�.0�trr�//usr/lib64/python3.8/lib2to3/fixes/fix_types.py�
<listcomp>3src@s"eZdZdZd�e�Zdd�ZdS)�FixTypesT�|cCs&t�|dj�}|r"t||jd�SdS)N�name)�prefix)�
_TYPE_MAPPING�get�valuerr)�selfZnodeZresultsZ	new_valuerrr�	transform9szFixTypes.transformN)�__name__�
__module__�__qualname__Z
BM_compatible�join�_patsZPATTERNrrrrrr5s
rN)	�__doc__�rZ
fixer_utilrrr$ZBaseFixrrrrr�<module>s4�lib2to3/fixes/__pycache__/fix_xrange.cpython-38.pyc000064400000004734151153537460016154 0ustar00U

e5d�
�@sFdZddlmZddlmZmZmZddlmZGdd�dej�Z	dS)z/Fixer that changes xrange(...) into range(...).�)�
fixer_base)�Name�Call�consuming_calls)�patcompcsheZdZdZdZ�fdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
Z
e�e
�Z
dZe�e�Zdd�Z�ZS)�	FixXrangeTz�
              power<
                 (name='range'|name='xrange') trailer< '(' args=any ')' >
              rest=any* >
              cstt|��||�t�|_dS�N)�superr�
start_tree�set�transformed_xranges��selfZtree�filename��	__class__��0/usr/lib64/python3.8/lib2to3/fixes/fix_xrange.pyr
szFixXrange.start_treecCs
d|_dSr)rr
rrr�finish_treeszFixXrange.finish_treecCsD|d}|jdkr|�||�S|jdkr4|�||�Stt|���dS)N�nameZxrange�range)�value�transform_xrange�transform_range�
ValueError�repr�r�node�resultsrrrr�	transforms

zFixXrange.transformcCs0|d}|�td|jd��|j�t|��dS)Nrr��prefix)�replacerr!r�add�idrrrrr$szFixXrange.transform_xrangecCsft|�|jkrb|�|�sbttd�|d��g�}ttd�|g|jd�}|dD]}|�|�qN|SdS)Nr�args�listr �rest)r$r�in_special_contextrrZcloner!Zappend_child)rrrZ
range_callZ	list_call�nrrrr*s��zFixXrange.transform_rangez3power< func=NAME trailer< '(' node=any ')' > any* >z�for_stmt< 'for' any 'in' node=any ':' any* >
            | comp_for< 'for' any 'in' node=any any* >
            | comparison< any 'in' node=any any*>
         cCsf|jdkrdSi}|jjdk	rJ|j�|jj|�rJ|d|krJ|djtkS|j�|j|�od|d|kS)NFr�func)�parent�p1�matchrr�p2)rrrrrrr(?s
�
�zFixXrange.in_special_context)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr
rrrrZP1rZcompile_patternr,ZP2r.r(�
__classcell__rrrrrs	

rN)
�__doc__�rZ
fixer_utilrrrrZBaseFixrrrrr�<module>slib2to3/fixes/__pycache__/fix_future.cpython-38.pyc000064400000001413151153537460016171 0ustar00U

e5d#�@s2dZddlmZddlmZGdd�dej�ZdS)zVRemove __future__ imports

from __future__ import foo is replaced with an empty line.
�)�
fixer_base)�	BlankLinec@s eZdZdZdZdZdd�ZdS)�	FixFutureTz;import_from< 'from' module_name="__future__" 'import' any >�
cCst�}|j|_|S)N)r�prefix)�selfZnodeZresults�new�r	�0/usr/lib64/python3.8/lib2to3/fixes/fix_future.py�	transformszFixFuture.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNZ	run_orderrr	r	r	r
rsrN)�__doc__�rZ
fixer_utilrZBaseFixrr	r	r	r
�<module>slib2to3/fixes/__pycache__/fix_print.cpython-38.pyc000064400000004442151153537460016020 0ustar00U

e5d�@sldZddlmZddlmZddlmZddlmZddlmZm	Z	m
Z
mZe�d�Z
Gdd	�d	ej�Zd
S)aFixer for print.

Change:
    'print'          into 'print()'
    'print ...'      into 'print(...)'
    'print ... ,'    into 'print(..., end=" ")'
    'print >>x, ...' into 'print(..., file=x)'

No changes are applied if print_function is imported from __future__

�)�patcomp)�pytree)�token)�
fixer_base)�Name�Call�Comma�Stringz"atom< '(' [atom|STRING|NAME] ')' >c@s$eZdZdZdZdd�Zdd�ZdS)�FixPrintTzP
              simple_stmt< any* bare='print' any* > | print_stmt
              c
Cs�|st�|�d�}|r4|�ttd�g|jd��dS|jdtd�ksJt�|jdd�}t|�dkrvt�	|d�rvdSd}}}|r�|dt
�kr�|dd�}d}|r�|dt�t
jd�kr�t|�d	ks�t�|d��}|d
d�}dd�|D�}|�rd
|d_|dk	�s"|dk	�s"|dk	�rz|dk	�rB|�|dtt|���|dk	�rb|�|dtt|���|dk	�rz|�|d|�ttd�|�}	|j|	_|	S)NZbare�print)�prefix������ z>>r�cSsg|]}|���qS�)�clone)�.0�argrr�//usr/lib64/python3.8/lib2to3/fixes/fix_print.py�
<listcomp>?sz&FixPrint.transform.<locals>.<listcomp>��sep�end�file)�AssertionError�get�replacerrrZchildren�len�parend_expr�matchrr�Leafr�
RIGHTSHIFTr�	add_kwargr	�repr)
�selfZnodeZresultsZ
bare_print�argsrrrZl_argsZn_stmtrrr�	transform%s@
�



zFixPrint.transformcCsNd|_t�|jjt|�t�tjd�|f�}|r@|�	t
��d|_|�	|�dS)Nr�=r)rrZNodeZsymsZargumentrr"r�EQUAL�appendr)r&Zl_nodesZs_kwdZn_exprZ
n_argumentrrrr$Ms
��zFixPrint.add_kwargN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr(r$rrrrr
s(r
N)�__doc__rrrZpgen2rrZ
fixer_utilrrrr	Zcompile_patternr ZBaseFixr
rrrr�<module>s
�lib2to3/fixes/__pycache__/fix_zip.cpython-38.pyc000064400000003052151153537460015462 0ustar00U

e5d	�@sRdZddlmZddlmZddlmZddlm	Z	m
Z
mZGdd�dej�Z
dS)	a7
Fixer that changes zip(seq0, seq1, ...) into list(zip(seq0, seq1, ...)
unless there exists a 'from future_builtins import zip' statement in the
top-level namespace.

We avoid the transformation if the zip() call is directly contained in
iter(<>), list(<>), tuple(<>), sorted(<>), ...join(<>), or for V in <>:.
�)�
fixer_base)�Node)�python_symbols)�Name�ArgList�in_special_contextc@s eZdZdZdZdZdd�ZdS)�FixZipTzN
    power< 'zip' args=trailer< '(' [any] ')' > [trailers=trailer*]
    >
    zfuture_builtins.zipcCs�|�|�rdSt|�rdS|d��}d|_g}d|krZdd�|dD�}|D]
}d|_qNttjtd�|gdd�}ttjtd�t|g�g|�}|j|_|S)	N�args��trailerscSsg|]}|���qS�)�clone)�.0�nrr�-/usr/lib64/python3.8/lib2to3/fixes/fix_zip.py�
<listcomp>'sz$FixZip.transform.<locals>.<listcomp>�zip)�prefix�list)	Zshould_skiprr
rr�symsZpowerrr)�selfZnodeZresultsr	rr�newrrr�	transforms
zFixZip.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNZskip_onrrrrrrsrN)�__doc__r
rZpytreerZpygramrrZ
fixer_utilrrrZConditionalFixrrrrr�<module>s

lib2to3/fixes/__pycache__/fix_funcattrs.cpython-38.opt-1.pyc000064400000001713151153537460017632 0ustar00U

e5d��@s2dZddlmZddlmZGdd�dej�ZdS)z3Fix function attribute names (f.func_x -> f.__x__).�)�
fixer_base)�Namec@seZdZdZdZdd�ZdS)�FixFuncattrsTz�
    power< any+ trailer< '.' attr=('func_closure' | 'func_doc' | 'func_globals'
                                  | 'func_name' | 'func_defaults' | 'func_code'
                                  | 'func_dict') > any* >
    cCs2|dd}|�td|jdd�|jd��dS)N�attr�z__%s__�)�prefix)�replacer�valuer)�selfZnodeZresultsr�r�3/usr/lib64/python3.8/lib2to3/fixes/fix_funcattrs.py�	transforms�zFixFuncattrs.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrrrrr
r	srN)�__doc__�rZ
fixer_utilrZBaseFixrrrrr
�<module>slib2to3/fixes/__pycache__/fix_except.cpython-38.opt-2.pyc000064400000004477151153537460017124 0ustar00U

e5d
�@sbddlmZddlmZddlmZddlmZmZmZm	Z	m
Z
mZdd�ZGdd�dej
�Zd	S)
�)�pytree)�token)�
fixer_base)�Assign�Attr�Name�is_tuple�is_list�symsccsDt|�D]6\}}|jtjkr|jdjdkr|||dfVqdS)N��exceptr)�	enumerate�typer
�
except_clause�children�value)Znodes�i�n�r�0/usr/lib64/python3.8/lib2to3/fixes/fix_except.py�find_exceptssrc@seZdZdZdZdd�ZdS)�	FixExceptTa1
    try_stmt< 'try' ':' (simple_stmt | suite)
                  cleanup=(except_clause ':' (simple_stmt | suite))+
                  tail=(['except' ':' (simple_stmt | suite)]
                        ['else' ':' (simple_stmt | suite)]
                        ['finally' ':' (simple_stmt | suite)]) >
    cCsx|j}dd�|dD�}dd�|dD�}t|�D�]\}}t|j�dkr2|jdd�\}}	}
|	�tdd	d
��|
jtjk�r8t|�	�d	d
�}|
�
�}d|_|
�|�|�
�}|j}
t|
�D]\}}t
|tj�r�q�q�t|
�s�t|
�r�t|t|td���}n
t||�}t|
d|��D]}|�d
|��q|�||�q2|
jdkr2d	|
_q2dd�|jdd�D�||}t�|j|�S)NcSsg|]}|���qSr��clone)�.0rrrr�
<listcomp>2sz'FixExcept.transform.<locals>.<listcomp>�tailcSsg|]}|���qSrr)rZchrrrr4sZcleanup���as� )�prefix��argsrcSsg|]}|���qSrr)r�crrrr\s�)r
r�lenr�replacerrr�NAME�new_namerr!r
�
isinstancerZNoderr	rr�reversedZinsert_child)�selfZnodeZresultsr
rZtry_cleanuprZe_suite�EZcomma�NZnew_N�targetZsuite_stmtsrZstmtZassignZchildrrrr�	transform/s6


 zFixExcept.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr0rrrrr$srN)r"rZpgen2rrZ
fixer_utilrrrrr	r
rZBaseFixrrrrr�<module>s
 lib2to3/fixes/__pycache__/fix_nonzero.cpython-38.pyc000064400000001626151153537460016357 0ustar00U

e5dO�@s2dZddlmZddlmZGdd�dej�ZdS)z*Fixer for __nonzero__ -> __bool__ methods.�)�
fixer_base)�Namec@seZdZdZdZdd�ZdS)�
FixNonzeroTz�
    classdef< 'class' any+ ':'
              suite< any*
                     funcdef< 'def' name='__nonzero__'
                              parameters< '(' NAME ')' > any+ >
                     any* > >
    cCs$|d}td|jd�}|�|�dS)N�name�__bool__)�prefix)rr�replace)�selfZnodeZresultsr�new�r�1/usr/lib64/python3.8/lib2to3/fixes/fix_nonzero.py�	transformszFixNonzero.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr
rrrrrsrN)�__doc__�rZ
fixer_utilrZBaseFixrrrrr�<module>slib2to3/fixes/__pycache__/fix_imports2.cpython-38.opt-2.pyc000064400000000670151153537460017402 0ustar00U

e5d!�@s,ddlmZddd�ZGdd�dej�ZdS)�)�fix_importsZdbm)ZwhichdbZanydbmc@seZdZdZeZdS)�FixImports2�N)�__name__�
__module__�__qualname__Z	run_order�MAPPING�mapping�r
r
�2/usr/lib64/python3.8/lib2to3/fixes/fix_imports2.pyrsrN)�rrZ
FixImportsrr
r
r
r�<module>s�lib2to3/fixes/__pycache__/fix_input.cpython-38.pyc000064400000001661151153537460016023 0ustar00U

e5d��@sLdZddlmZddlmZmZddlmZe�d�ZGdd�dej	�Z
dS)	z4Fixer that changes input(...) into eval(input(...)).�)�
fixer_base)�Call�Name)�patcompz&power< 'eval' trailer< '(' any ')' > >c@seZdZdZdZdd�ZdS)�FixInputTzL
              power< 'input' args=trailer< '(' [any] ')' > >
              cCs6t�|jj�rdS|��}d|_ttd�|g|jd�S)N��eval)�prefix)�context�match�parentZcloner	rr)�selfZnodeZresults�new�r�//usr/lib64/python3.8/lib2to3/fixes/fix_input.py�	transforms
zFixInput.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrrrrrr
srN)�__doc__rrZ
fixer_utilrrrZcompile_patternr
ZBaseFixrrrrr�<module>s

lib2to3/fixes/__pycache__/fix_funcattrs.cpython-38.opt-2.pyc000064400000001607151153537460017635 0ustar00U

e5d��@s.ddlmZddlmZGdd�dej�ZdS)�)�
fixer_base)�Namec@seZdZdZdZdd�ZdS)�FixFuncattrsTz�
    power< any+ trailer< '.' attr=('func_closure' | 'func_doc' | 'func_globals'
                                  | 'func_name' | 'func_defaults' | 'func_code'
                                  | 'func_dict') > any* >
    cCs2|dd}|�td|jdd�|jd��dS)N�attr�z__%s__�)�prefix)�replacer�valuer)�selfZnodeZresultsr�r�3/usr/lib64/python3.8/lib2to3/fixes/fix_funcattrs.py�	transforms�zFixFuncattrs.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrrrrr
r	srN)�rZ
fixer_utilrZBaseFixrrrrr
�<module>slib2to3/fixes/__pycache__/fix_itertools_imports.cpython-38.pyc000064400000003045151153537460020463 0ustar00U

e5d&�@s:dZddlmZddlmZmZmZGdd�dej�ZdS)zA Fixer for imports of itertools.(imap|ifilter|izip|ifilterfalse) �)�
fixer_base)�	BlankLine�syms�tokenc@s"eZdZdZde�Zdd�ZdS)�FixItertoolsImportsTzT
              import_from< 'from' 'itertools' 'import' imports=any >
              cCsp|d}|jtjks|js"|g}n|j}|ddd�D]�}|jtjkrR|j}|}n,|jtjkrddS|jtjkstt�|jd}|j}|dkr�d|_|�	�q6|dkr6|�
�|ddkr�dnd	|_q6|jdd�p�|g}d
}	|D]*}|	�r|jtjk�r|�	�q�|	d
N}	q�|�r4|djtjk�r4|���	��q|j�sJt
|dd��rV|jdk�rl|j}
t�}|
|_|SdS)
N�imports�r)ZimapZizipZifilter)ZifilterfalseZizip_longest��f�filterfalse�zip_longestT����value)�typerZimport_as_name�childrenr�NAMEr�STAR�AssertionError�removeZchanged�COMMA�pop�getattr�parent�prefixr)�selfZnodeZresultsrrZchild�memberZ	name_node�member_nameZremove_comma�p�r�;/usr/lib64/python3.8/lib2to3/fixes/fix_itertools_imports.py�	transformsH

�

�zFixItertoolsImports.transformN)�__name__�
__module__�__qualname__Z
BM_compatible�localsZPATTERNr rrrrrs
�rN)	�__doc__Zlib2to3rZlib2to3.fixer_utilrrrZBaseFixrrrrr�<module>slib2to3/fixes/__pycache__/fix_methodattrs.cpython-38.pyc000064400000001645151153537460017224 0ustar00U

e5d^�@s>dZddlmZddlmZdddd�ZGdd	�d	ej�Zd
S)z;Fix bound method attributes (method.im_? -> method.__?__).
�)�
fixer_base)�Name�__func__�__self__z__self__.__class__)Zim_funcZim_selfZim_classc@seZdZdZdZdd�ZdS)�FixMethodattrsTzU
    power< any+ trailer< '.' attr=('im_func' | 'im_self' | 'im_class') > any* >
    cCs.|dd}t|j}|�t||jd��dS)N�attr�)�prefix)�MAP�value�replacerr	)�selfZnodeZresultsr�new�r�5/usr/lib64/python3.8/lib2to3/fixes/fix_methodattrs.py�	transforms
zFixMethodattrs.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrrrrrrsrN)�__doc__�rZ
fixer_utilrr
ZBaseFixrrrrr�<module>s�lib2to3/fixes/__pycache__/fix_isinstance.cpython-38.pyc000064400000003012151153537460017014 0ustar00U

e5dH�@s2dZddlmZddlmZGdd�dej�ZdS)a,Fixer that cleans up a tuple argument to isinstance after the tokens
in it were fixed.  This is mainly used to remove double occurrences of
tokens as a leftover of the long -> int / unicode -> str conversion.

eg.  isinstance(x, (int, long)) -> isinstance(x, (int, int))
       -> isinstance(x, int)
�)�
fixer_base)�tokenc@s eZdZdZdZdZdd�ZdS)�
FixIsinstanceTz�
    power<
        'isinstance'
        trailer< '(' arglist< any ',' atom< '('
            args=testlist_gexp< any+ >
        ')' > > ')' >
    >
    �cCs�t�}|d}|j}g}t|�}|D]p\}}	|	jtjkrr|	j|krr|t|�dkr�||djtjkr�t	|�q$q$|�
|	�|	jtjkr$|�|	j�q$|r�|djtjkr�|d=t|�dkr�|j}
|
j
|d_
|
�|d�n||dd�<|��dS)N�args�����)�setZchildren�	enumerate�typer�NAME�value�len�COMMA�next�append�add�parent�prefix�replaceZchanged)�selfZnodeZresultsZnames_insertedZtestlistrZnew_args�iterator�idx�argZatom�r�4/usr/lib64/python3.8/lib2to3/fixes/fix_isinstance.py�	transforms*$
zFixIsinstance.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNZ	run_orderrrrrrrs	rN)�__doc__�rZ
fixer_utilrZBaseFixrrrrr�<module>slib2to3/fixes/__pycache__/fix_dict.cpython-38.opt-2.pyc000064400000004477151153537460016557 0ustar00U

e5d��@sfddlmZddlmZddlmZddlmZmZmZddlmZejdhBZ	Gdd�dej
�Zd	S)
�)�pytree)�patcomp)�
fixer_base)�Name�Call�Dot)�
fixer_util�iterc@s@eZdZdZdZdd�ZdZe�e�Z	dZ
e�e
�Zdd�Zd	S)
�FixDictTa
    power< head=any+
         trailer< '.' method=('keys'|'items'|'values'|
                              'iterkeys'|'iteritems'|'itervalues'|
                              'viewkeys'|'viewitems'|'viewvalues') >
         parens=trailer< '(' ')' >
         tail=any*
    >
    c
	Cs|d}|dd}|d}|j}|j}|�d�}|�d�}	|sD|	rP|dd�}dd	�|D�}d
d	�|D�}|o||�||�}
|t�|jt�t||j	d�g�|d�
�g}t�|j|�}|
s�|	s�d
|_	tt|r�dnd�|g�}|r�t�|j|g|�}|j	|_	|S)N�head�method��tailr	Zview�cSsg|]}|���qS���clone��.0�nrr�./usr/lib64/python3.8/lib2to3/fixes/fix_dict.py�
<listcomp>Asz%FixDict.transform.<locals>.<listcomp>cSsg|]}|���qSrrrrrrrBs)�prefixZparens��list)
�syms�value�
startswith�in_special_contextrZNodeZtrailerrrrrZpowerr)
�self�node�resultsrrrrZmethod_name�isiterZisviewZspecial�args�newrrr�	transform6s:


���
�zFixDict.transformz3power< func=NAME trailer< '(' node=any ')' > any* >zmfor_stmt< 'for' any 'in' node=any ':' any* >
            | comp_for< 'for' any 'in' node=any any* >
         cCs�|jdkrdSi}|jjdk	r^|j�|jj|�r^|d|kr^|rN|djtkS|djtjkS|sfdS|j�|j|�o�|d|kS)NFr �func)�parent�p1�matchr�iter_exemptr�consuming_calls�p2)rr r"r!rrrrZs
�
�zFixDict.in_special_contextN)
�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr%ZP1rZcompile_patternr(ZP2r,rrrrrr
)s


r
N)rrrrrrrrr+r*ZBaseFixr
rrrr�<module>slib2to3/fixes/__pycache__/fix_ws_comma.cpython-38.pyc000064400000002132151153537460016463 0ustar00U

e5dB�@s>dZddlmZddlmZddlmZGdd�dej�ZdS)z�Fixer that changes 'a ,b' into 'a, b'.

This also changes '{a :b}' into '{a: b}', but does not touch other
uses of colons.  It does not touch other uses of whitespace.

�)�pytree)�token)�
fixer_basec@s@eZdZdZdZe�ejd�Ze�ej	d�Z	ee	fZ
dd�ZdS)�
FixWsCommaTzH
    any<(not(',') any)+ ',' ((not(',') any)+ ',')* [not(',') any]>
    �,�:cCs`|��}d}|jD]H}||jkrB|j}|��r<d|kr<d|_d}q|rV|j}|sVd|_d}q|S)NF�
�T� )ZcloneZchildren�SEPS�prefix�isspace)�selfZnodeZresults�newZcommaZchildr�r�2/usr/lib64/python3.8/lib2to3/fixes/fix_ws_comma.py�	transforms

zFixWsComma.transformN)�__name__�
__module__�__qualname__ZexplicitZPATTERNrZLeafr�COMMA�COLONrrrrrrrsrN)�__doc__r	rZpgen2rrZBaseFixrrrrr�<module>slib2to3/fixes/__pycache__/fix_sys_exc.cpython-38.opt-2.pyc000064400000002325151153537460017277 0ustar00U

e5d
�@sFddlmZddlmZmZmZmZmZmZm	Z	Gdd�dej
�ZdS)�)�
fixer_base)�Attr�Call�Name�Number�	Subscript�Node�symsc@s:eZdZdddgZdZdd�dd�eD��Zd	d
�ZdS)�	FixSysExc�exc_type�	exc_value�
exc_tracebackTzN
              power< 'sys' trailer< dot='.' attribute=(%s) > >
              �|ccs|]}d|VqdS)z'%s'N�)�.0�err�1/usr/lib64/python3.8/lib2to3/fixes/fix_sys_exc.py�	<genexpr>szFixSysExc.<genexpr>cCst|dd}t|j�|j��}ttd�|jd�}ttd�|�}|dj|djd_|�	t
|��ttj
||jd�S)NZ	attribute��exc_info)�prefix�sys�dot�)rr�index�valuerrrrZchildren�appendrrr	Zpower)�selfZnodeZresultsZsys_attrrZcall�attrrrr�	transformszFixSysExc.transformN)�__name__�
__module__�__qualname__rZ
BM_compatible�joinZPATTERNrrrrrr
s
�r
N)�rZ
fixer_utilrrrrrrr	ZBaseFixr
rrrr�<module>s$lib2to3/fixes/__pycache__/fix_idioms.cpython-38.opt-1.pyc000064400000007400151153537460017104 0ustar00U

e5d�@sNdZddlmZddlmZmZmZmZmZm	Z	dZ
dZGdd�dej�Z
dS)	a�Adjust some old Python 2 idioms to their modern counterparts.

* Change some type comparisons to isinstance() calls:
    type(x) == T -> isinstance(x, T)
    type(x) is T -> isinstance(x, T)
    type(x) != T -> not isinstance(x, T)
    type(x) is not T -> not isinstance(x, T)

* Change "while 1:" into "while True:".

* Change both

    v = list(EXPR)
    v.sort()
    foo(v)

and the more general

    v = EXPR
    v.sort()
    foo(v)

into

    v = sorted(EXPR)
    foo(v)
�)�
fixer_base)�Call�Comma�Name�Node�	BlankLine�symsz0(n='!=' | '==' | 'is' | n=comp_op< 'is' 'not' >)z(power< 'type' trailer< '(' x=any ')' > >csPeZdZdZdeeeefZ�fdd�Zdd�Zdd�Z	d	d
�Z
dd�Z�ZS)
�	FixIdiomsTa�
        isinstance=comparison< %s %s T=any >
        |
        isinstance=comparison< T=any %s %s >
        |
        while_stmt< 'while' while='1' ':' any+ >
        |
        sorted=any<
            any*
            simple_stmt<
              expr_stmt< id1=any '='
                         power< list='list' trailer< '(' (not arglist<any+>) any ')' > >
              >
              '\n'
            >
            sort=
            simple_stmt<
              power< id2=any
                     trailer< '.' 'sort' > trailer< '(' ')' >
              >
              '\n'
            >
            next=any*
        >
        |
        sorted=any<
            any*
            simple_stmt< expr_stmt< id1=any '=' expr=any > '\n' >
            sort=
            simple_stmt<
              power< id2=any
                     trailer< '.' 'sort' > trailer< '(' ')' >
              >
              '\n'
            >
            next=any*
        >
    cs8tt|��|�}|r4d|kr4|d|dkr0|SdS|S)N�sortedZid1Zid2)�superr	�match)�self�node�r��	__class__��0/usr/lib64/python3.8/lib2to3/fixes/fix_idioms.pyrOszFixIdioms.matchcCsHd|kr|�||�Sd|kr(|�||�Sd|kr<|�||�Std��dS)N�
isinstance�whiler
z
Invalid match)�transform_isinstance�transform_while�transform_sort�RuntimeError)r
r�resultsrrr�	transformZszFixIdioms.transformcCsh|d��}|d��}d|_d|_ttd�|t�|g�}d|kr\d|_ttjtd�|g�}|j|_|S)N�x�T�� r�n�not)�clone�prefixrrrrrZnot_test)r
rrrrZtestrrrrdszFixIdioms.transform_isinstancecCs |d}|�td|jd��dS)Nr�True�r#)�replacerr#)r
rrZonerrrrpszFixIdioms.transform_whilecCs�|d}|d}|�d�}|�d�}|r>|�td|jd��n8|rn|��}d|_|�ttd�|g|jd��ntd��|��|j}d	|kr�|r�|�d	�d
|d
jf}	d	�	|	�|d
_n"t
�}
|j�|
�|�d	�d
|
_dS)N�sort�next�list�exprr
r%rzshould not have reached here�
�)
�getr&rr#r"rr�remove�
rpartition�joinr�parentZappend_child)r
rrZ	sort_stmtZ	next_stmtZ	list_callZsimple_expr�newZbtwnZprefix_linesZend_linerrrrts,

�
zFixIdioms.transform_sort)
�__name__�
__module__�__qualname__Zexplicit�TYPE�CMPZPATTERNrrrrr�
__classcell__rrrrr	%s%
�'
r	N)�__doc__rrZ
fixer_utilrrrrrrr7r6ZBaseFixr	rrrr�<module>s
 lib2to3/fixes/__pycache__/fix_raw_input.cpython-38.opt-1.pyc000064400000001426151153537460017632 0ustar00U

e5d��@s2dZddlmZddlmZGdd�dej�ZdS)z2Fixer that changes raw_input(...) into input(...).�)�
fixer_base)�Namec@seZdZdZdZdd�ZdS)�FixRawInputTzU
              power< name='raw_input' trailer< '(' [any] ')' > any* >
              cCs |d}|�td|jd��dS)N�name�input)�prefix)�replacerr)�selfZnodeZresultsr�r
�3/usr/lib64/python3.8/lib2to3/fixes/fix_raw_input.py�	transformszFixRawInput.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrr
r
r
rrsrN)�__doc__�rZ
fixer_utilrZBaseFixrr
r
r
r�<module>slib2to3/fixes/__pycache__/fix_paren.cpython-38.pyc000064400000002551151153537460015770 0ustar00U

e5d��@s6dZddlmZddlmZmZGdd�dej�ZdS)zuFixer that addes parentheses where they are required

This converts ``[x for x in 1, 2]`` to ``[x for x in (1, 2)]``.�)�
fixer_base)�LParen�RParenc@seZdZdZdZdd�ZdS)�FixParenTa
        atom< ('[' | '(')
            (listmaker< any
                comp_for<
                    'for' NAME 'in'
                    target=testlist_safe< any (',' any)+ [',']
                     >
                    [any]
                >
            >
            |
            testlist_gexp< any
                comp_for<
                    'for' NAME 'in'
                    target=testlist_safe< any (',' any)+ [',']
                     >
                    [any]
                >
            >)
        (']' | ')') >
    cCs8|d}t�}|j|_d|_|�d|�|�t��dS)N�target��)r�prefixZinsert_childZappend_childr)�selfZnodeZresultsrZlparen�r�//usr/lib64/python3.8/lib2to3/fixes/fix_paren.py�	transform%szFixParen.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr
rrrrrsrN)�__doc__rrZ
fixer_utilrrZBaseFixrrrrr�<module>slib2to3/fixes/__pycache__/fix_urllib.cpython-38.opt-2.pyc000064400000012474151153537460017121 0ustar00U

e5d� �@s�ddlmZmZddlmZmZmZmZmZm	Z	m
Z
ddddddd	d
dgfdd
ddddddddddddddgfddgfgddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4gfdd5d6gfgd7�Zed8�ed9d:�d;d<�Z
Gd=d>�d>e�Zd?S)@�)�
alternates�
FixImports)�Name�Comma�
FromImport�Newline�find_indentation�Node�symszurllib.requestZ	URLopenerZFancyURLopenerZurlretrieveZ
_urlopenerZurlopenZ
urlcleanupZpathname2urlZurl2pathnamezurllib.parseZquoteZ
quote_plusZunquoteZunquote_plusZ	urlencodeZ	splitattrZ	splithostZ
splitnportZsplitpasswdZ	splitportZ
splitqueryZsplittagZ	splittypeZ	splituserZ
splitvaluezurllib.errorZContentTooShortErrorZinstall_openerZbuild_openerZRequestZOpenerDirectorZBaseHandlerZHTTPDefaultErrorHandlerZHTTPRedirectHandlerZHTTPCookieProcessorZProxyHandlerZHTTPPasswordMgrZHTTPPasswordMgrWithDefaultRealmZAbstractBasicAuthHandlerZHTTPBasicAuthHandlerZProxyBasicAuthHandlerZAbstractDigestAuthHandlerZHTTPDigestAuthHandlerZProxyDigestAuthHandlerZHTTPHandlerZHTTPSHandlerZFileHandlerZ
FTPHandlerZCacheFTPHandlerZUnknownHandlerZURLErrorZ	HTTPError)�urllib�urllib2rr�ccsvt�}t��D]b\}}|D]T}|\}}t|�}d||fVd|||fVd|Vd|Vd||fVqqdS)Nz�import_name< 'import' (module=%r
                                  | dotted_as_names< any* module=%r any* >) >
                  z�import_from< 'from' mod_member=%r 'import'
                       ( member=%s | import_as_name< member=%s 'as' any > |
                         import_as_names< members=any*  >) >
                  zIimport_from< 'from' module_star=%r 'import' star='*' >
                  ztimport_name< 'import'
                                  dotted_as_name< module_as=%r 'as' any > >
                  zKpower< bare_with_attr=%r trailer< '.' member=%s > any* >
                  )�set�MAPPING�itemsr)ZbareZ
old_moduleZchanges�changeZ
new_module�members�r�0/usr/lib64/python3.8/lib2to3/fixes/fix_urllib.py�
build_pattern0s(�����rc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�	FixUrllibcCsd�t��S)N�|)�joinr)�selfrrrrIszFixUrllib.build_patterncCsv|�d�}|j}g}t|jdd�D] }|�t|d|d�t�g�q&|�tt|jdd|d��|�|�dS)N�module���r��prefix)	�getrr�value�extendrr�append�replace)r�node�resultsZ
import_mod�pref�names�namerrr�transform_importLs
 zFixUrllib.transform_importcCs&|�d�}|j}|�d�}|r�t|t�r0|d}d}t|jD]}|j|dkr>|d}q^q>|rv|�t||d��n|�|d��n�g}i}	|d}
|
D]�}|j	t
jkr�|jdj}|jdj}n
|j}d}|d	kr�t|jD]B}||dkr�|d|	k�r|�
|d�|	�|dg��
|�q�q�g}
t|�}d
}dd�}|D]�}|	|}g}|dd
�D]"}|�|||��|�
t���q^|�||d
|��t||�}|�r�|jj�|��r�||_|
�
|�d}�qB|
�rg}|
dd
�D]}|�|t�g��q�|�
|
d
�|�|�n|�|d�dS)N�
mod_member�memberrr
r�!This is an invalid module elementr��,TcSsX|jtjkrHt|jdj|d�|jd��|jd��g}ttj|�gSt|j|d�gS)Nrrr
r,)�typer
�import_as_namer�childrenrZcloner	)r'rZkidsrrr�handle_name�s�z/FixUrllib.transform_member.<locals>.handle_namerFzAll module elements are invalid)rr�
isinstance�listrrr"r�cannot_convertr.r
r/r0r!�
setdefaultrr rr�parent�endswithr)rr#r$r)r%r*�new_namer�modulesZmod_dictrZas_name�member_nameZ	new_nodesZindentation�firstr1rZeltsr&Zelt�newZnodesZnew_noderrr�transform_member\sh




zFixUrllib.transform_membercCs~|�d�}|�d�}d}t|t�r*|d}t|jD]}|j|dkr4|d}qTq4|rn|�t||jd��n|�|d�dS)N�bare_with_attrr*rr
rr+)	rr2r3rrr"rrr4)rr#r$Z
module_dotr*r8rrrr�
transform_dot�s


�
zFixUrllib.transform_dotcCsz|�d�r|�||�n^|�d�r0|�||�nF|�d�rH|�||�n.|�d�r`|�|d�n|�d�rv|�|d�dS)Nrr)r>Zmodule_starzCannot handle star imports.Z	module_asz#This module is now multiple modules)rr(r=r?r4)rr#r$rrr�	transform�s




zFixUrllib.transformN)�__name__�
__module__�__qualname__rr(r=r?r@rrrrrGs
LrN)Zlib2to3.fixes.fix_importsrrZlib2to3.fixer_utilrrrrrr	r
rr!rrrrrr�<module>s|$������
�����!lib2to3/fixes/__pycache__/fix_renames.cpython-38.pyc000064400000003722151153537460016316 0ustar00U

e5d��@sVdZddlmZddlmZmZdddiiZiZdd�Zd	d
�Z	Gdd�dej
�Zd
S)z?Fix incompatible renames

Fixes:
  * sys.maxint -> sys.maxsize
�)�
fixer_base)�Name�
attr_chain�sysZmaxint�maxsizecCsdd�tt|��dS)N�(�|�))�join�map�repr)�members�r�1/usr/lib64/python3.8/lib2to3/fixes/fix_renames.py�
alternatessrccsZtt���D]H\}}t|���D]2\}}|t||f<d|||fVd||fVq qdS)Nz�
                  import_from< 'from' module_name=%r 'import'
                      ( attr_name=%r | import_as_name< attr_name=%r 'as' any >) >
                  z^
                  power< module_name=%r trailer< '.' attr_name=%r > any* >
                  )�list�MAPPING�items�LOOKUP)�module�replaceZold_attr�new_attrrrr�
build_patterns��rcs8eZdZdZd�e��ZdZ�fdd�Zdd�Z	�Z
S)�
FixRenamesTrZprecs@tt|�j��|�}|r<t�fdd�t|d�D��r8dS|SdS)Nc3s|]}�|�VqdS)Nr)�.0�obj��matchrr�	<genexpr>5sz#FixRenames.match.<locals>.<genexpr>�parentF)�superrr�anyr)�self�node�results��	__class__rrr1szFixRenames.matchcCsD|�d�}|�d�}|r@|r@t|j|jf}|�t||jd��dS)NZmodule_name�	attr_name)�prefix)�getr�valuerrr()r"r#r$Zmod_namer'rrrr�	transform>s


zFixRenames.transform)�__name__�
__module__�__qualname__Z
BM_compatibler
rZPATTERN�orderrr+�
__classcell__rrr%rr*s

rN)�__doc__�rZ
fixer_utilrrrrrrZBaseFixrrrrr�<module>s	lib2to3/fixes/__pycache__/fix_raw_input.cpython-38.pyc000064400000001426151153537460016673 0ustar00U

e5d��@s2dZddlmZddlmZGdd�dej�ZdS)z2Fixer that changes raw_input(...) into input(...).�)�
fixer_base)�Namec@seZdZdZdZdd�ZdS)�FixRawInputTzU
              power< name='raw_input' trailer< '(' [any] ')' > any* >
              cCs |d}|�td|jd��dS)N�name�input)�prefix)�replacerr)�selfZnodeZresultsr�r
�3/usr/lib64/python3.8/lib2to3/fixes/fix_raw_input.py�	transformszFixRawInput.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrr
r
r
rrsrN)�__doc__�rZ
fixer_utilrZBaseFixrr
r
r
r�<module>slib2to3/fixes/__pycache__/fix_types.cpython-38.opt-2.pyc000064400000002516151153537460016770 0ustar00U

e5d��@slddlmZddlmZdddddddd	d
dd
dd
ddddddddd�Zdd�eD�ZGdd�dej�ZdS)�)�
fixer_base)�Name�bool�
memoryview�type�complex�dictztype(Ellipsis)�float�int�list�objectz
type(None)ztype(NotImplemented)�slice�bytesz(str,)�tuple�str�range)ZBooleanTypeZ
BufferTypeZ	ClassTypeZComplexTypeZDictTypeZDictionaryTypeZEllipsisTypeZ	FloatTypeZIntTypeZListTypeZLongTypeZ
ObjectTypeZNoneTypeZNotImplementedTypeZ	SliceTypeZ
StringTypeZStringTypesZ	TupleTypeZTypeTypeZUnicodeTypeZ
XRangeTypecCsg|]}d|�qS)z)power< 'types' trailer< '.' name='%s' > >�)�.0�trr�//usr/lib64/python3.8/lib2to3/fixes/fix_types.py�
<listcomp>3src@s"eZdZdZd�e�Zdd�ZdS)�FixTypesT�|cCs&t�|dj�}|r"t||jd�SdS)N�name)�prefix)�
_TYPE_MAPPING�get�valuerr)�selfZnodeZresultsZ	new_valuerrr�	transform9szFixTypes.transformN)�__name__�
__module__�__qualname__Z
BM_compatible�join�_patsZPATTERNrrrrrr5s
rN)�rZ
fixer_utilrrr$ZBaseFixrrrrr�<module>s2�lib2to3/fixes/__pycache__/fix_set_literal.cpython-38.pyc000064400000003216151153537460017171 0ustar00U

e5d��@s:dZddlmZmZddlmZmZGdd�dej�ZdS)z:
Optional fixer to transform set() calls to set literals.
�)�
fixer_base�pytree)�token�symsc@s eZdZdZdZdZdd�ZdS)�
FixSetLiteralTajpower< 'set' trailer< '('
                     (atom=atom< '[' (items=listmaker< any ((',' any)* [',']) >
                                |
                                single=any) ']' >
                     |
                     atom< '(' items=testlist_gexp< any ((',' any)* [',']) > ')' >
                     )
                     ')' > >
              c	Cs�|�d�}|r2t�tj|��g�}|�|�|}n|d}t�tj	d�g}|�
dd�|jD��|�t�tj
d��|jj|d_t�tj|�}|j|_t|j�dkr�|jd	}|��|j|jd_|S)
N�single�items�{css|]}|��VqdS)N)�clone)�.0�n�r
�5/usr/lib64/python3.8/lib2to3/fixes/fix_set_literal.py�	<genexpr>'sz*FixSetLiteral.transform.<locals>.<genexpr>�}�����)�getrZNoderZ	listmakerr
�replaceZLeafr�LBRACE�extendZchildren�append�RBRACEZnext_sibling�prefixZdictsetmaker�len�remove)	�selfZnodeZresultsrZfaker�literalZmakerrr
r
r�	transforms"


zFixSetLiteral.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZexplicitZPATTERNrr
r
r
rrs
rN)	�__doc__Zlib2to3rrZlib2to3.fixer_utilrrZBaseFixrr
r
r
r�<module>slib2to3/fixes/__pycache__/fix_unicode.cpython-38.pyc000064400000003010151153537460016300 0ustar00U

e5d��@s<dZddlmZddlmZddd�ZGdd�dej�Zd	S)
z�Fixer for unicode.

* Changes unicode to str and unichr to chr.

* If "...\u..." is not unicode literal change it into "...\\u...".

* Change u"..." into "...".

�)�token)�
fixer_base�chr�str)ZunichrZunicodecs,eZdZdZdZ�fdd�Zdd�Z�ZS)�
FixUnicodeTzSTRING | 'unicode' | 'unichr'cs"tt|��||�d|jk|_dS)N�unicode_literals)�superr�
start_treeZfuture_featuresr)�selfZtree�filename��	__class__��1/usr/lib64/python3.8/lib2to3/fixes/fix_unicode.pyr	szFixUnicode.start_treecCs�|jtjkr$|��}t|j|_|S|jtjkr�|j}|jsj|ddkrjd|krjd�dd�|�	d�D��}|ddkr�|dd�}||jkr�|S|��}||_|SdS)	N�z'"�\z\\cSs g|]}|�dd��dd��qS)z\uz\\uz\Uz\\U)�replace)�.0�vrrr�
<listcomp> s�z(FixUnicode.transform.<locals>.<listcomp>ZuU�)
�typer�NAMEZclone�_mapping�value�STRINGr�join�split)r
ZnodeZresults�new�valrrr�	transforms"
�
zFixUnicode.transform)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr	r �
__classcell__rrrrrsrN)�__doc__Zpgen2r�rrZBaseFixrrrrr�<module>s

lib2to3/fixes/__pycache__/fix_methodattrs.cpython-38.opt-2.pyc000064400000001531151153537460020156 0ustar00U

e5d^�@s:ddlmZddlmZdddd�ZGdd�dej�Zd	S)
�)�
fixer_base)�Name�__func__�__self__z__self__.__class__)Zim_funcZim_selfZim_classc@seZdZdZdZdd�ZdS)�FixMethodattrsTzU
    power< any+ trailer< '.' attr=('im_func' | 'im_self' | 'im_class') > any* >
    cCs.|dd}t|j}|�t||jd��dS)N�attr�)�prefix)�MAP�value�replacerr	)�selfZnodeZresultsr�new�r�5/usr/lib64/python3.8/lib2to3/fixes/fix_methodattrs.py�	transforms
zFixMethodattrs.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrrrrrrsrN)�rZ
fixer_utilrr
ZBaseFixrrrrr�<module>s�lib2to3/fixes/__pycache__/fix_print.cpython-38.opt-2.pyc000064400000003664151153537460016765 0ustar00U

e5d�@shddlmZddlmZddlmZddlmZddlmZmZm	Z	m
Z
e�d�ZGdd�dej
�Zd	S)
�)�patcomp)�pytree)�token)�
fixer_base)�Name�Call�Comma�Stringz"atom< '(' [atom|STRING|NAME] ')' >c@s$eZdZdZdZdd�Zdd�ZdS)�FixPrintTzP
              simple_stmt< any* bare='print' any* > | print_stmt
              c
Cs`|�d�}|r,|�ttd�g|jd��dS|jdd�}t|�dkrXt�|d�rXdSd}}}|r�|dt	�kr�|dd�}d}|r�|dt
�tj
d�kr�|d��}|d	d�}d
d�|D�}|r�d|d_|dk	s�|dk	s�|dk	�rF|dk	�r|�|d
tt|���|dk	�r.|�|dtt|���|dk	�rF|�|d|�ttd�|�}	|j|	_|	S)NZbare�print)�prefix������ z>>�cSsg|]}|���qS�)�clone)�.0�argrr�//usr/lib64/python3.8/lib2to3/fixes/fix_print.py�
<listcomp>?sz&FixPrint.transform.<locals>.<listcomp>��sep�end�file)�get�replacerrrZchildren�len�parend_expr�matchrr�Leafr�
RIGHTSHIFTr�	add_kwargr	�repr)
�selfZnodeZresultsZ
bare_print�argsrrrZl_argsZn_stmtrrr�	transform%s:
�



zFixPrint.transformcCsNd|_t�|jjt|�t�tjd�|f�}|r@|�	t
��d|_|�	|�dS)Nr�=r)rrZNodeZsymsZargumentrr!r�EQUAL�appendr)r%Zl_nodesZs_kwdZn_exprZ
n_argumentrrrr#Ms
��zFixPrint.add_kwargN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr'r#rrrrr
s(r
N)rrrZpgen2rrZ
fixer_utilrrrr	Zcompile_patternrZBaseFixr
rrrr�<module>s�lib2to3/fixes/__pycache__/fix_long.cpython-38.pyc000064400000001274151153537460015623 0ustar00U

e5d��@s2dZddlmZddlmZGdd�dej�ZdS)z/Fixer that turns 'long' into 'int' everywhere.
�)�
fixer_base)�is_probably_builtinc@seZdZdZdZdd�ZdS)�FixLongTz'long'cCst|�rd|_|��dS)N�int)r�valueZchanged)�selfZnodeZresults�r�./usr/lib64/python3.8/lib2to3/fixes/fix_long.py�	transformszFixLong.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr
rrrr	rsrN)�__doc__Zlib2to3rZlib2to3.fixer_utilrZBaseFixrrrrr	�<module>slib2to3/fixes/__pycache__/fix_isinstance.cpython-38.opt-2.pyc000064400000002312151153537460017756 0ustar00U

e5dH�@s.ddlmZddlmZGdd�dej�ZdS)�)�
fixer_base)�tokenc@s eZdZdZdZdZdd�ZdS)�
FixIsinstanceTz�
    power<
        'isinstance'
        trailer< '(' arglist< any ',' atom< '('
            args=testlist_gexp< any+ >
        ')' > > ')' >
    >
    �cCs�t�}|d}|j}g}t|�}|D]p\}}	|	jtjkrr|	j|krr|t|�dkr�||djtjkr�t	|�q$q$|�
|	�|	jtjkr$|�|	j�q$|r�|djtjkr�|d=t|�dkr�|j}
|
j
|d_
|
�|d�n||dd�<|��dS)N�args�����)�setZchildren�	enumerate�typer�NAME�value�len�COMMA�next�append�add�parent�prefix�replaceZchanged)�selfZnodeZresultsZnames_insertedZtestlistrZnew_args�iterator�idx�argZatom�r�4/usr/lib64/python3.8/lib2to3/fixes/fix_isinstance.py�	transforms*$
zFixIsinstance.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNZ	run_orderrrrrrrs	rN)�rZ
fixer_utilrZBaseFixrrrrr�<module>slib2to3/fixes/__pycache__/fix_ws_comma.cpython-38.opt-2.pyc000064400000001640151153537460017426 0ustar00U

e5dB�@s:ddlmZddlmZddlmZGdd�dej�ZdS)�)�pytree)�token)�
fixer_basec@s@eZdZdZdZe�ejd�Ze�ej	d�Z	ee	fZ
dd�ZdS)�
FixWsCommaTzH
    any<(not(',') any)+ ',' ((not(',') any)+ ',')* [not(',') any]>
    �,�:cCs`|��}d}|jD]H}||jkrB|j}|��r<d|kr<d|_d}q|rV|j}|sVd|_d}q|S)NF�
�T� )ZcloneZchildren�SEPS�prefix�isspace)�selfZnodeZresults�newZcommaZchildr�r�2/usr/lib64/python3.8/lib2to3/fixes/fix_ws_comma.py�	transforms

zFixWsComma.transformN)�__name__�
__module__�__qualname__ZexplicitZPATTERNrZLeafr�COMMA�COLONrrrrrrrsrN)r	rZpgen2rrZBaseFixrrrrr�<module>slib2to3/fixes/__pycache__/fix_itertools.cpython-38.pyc000064400000003011151153537460016677 0ustar00U

e5d�@s2dZddlmZddlmZGdd�dej�ZdS)aT Fixer for itertools.(imap|ifilter|izip) --> (map|filter|zip) and
    itertools.ifilterfalse --> itertools.filterfalse (bugs 2360-2363)

    imports from itertools are fixed in fix_itertools_import.py

    If itertools is imported as something else (ie: import itertools as it;
    it.izip(spam, eggs)) method calls will not get fixed.
    �)�
fixer_base)�Namec@s*eZdZdZdZde�ZdZdd�ZdS)�FixItertoolsTz7('imap'|'ifilter'|'izip'|'izip_longest'|'ifilterfalse')z�
              power< it='itertools'
                  trailer<
                     dot='.' func=%(it_funcs)s > trailer< '(' [any] ')' > >
              |
              power< func=%(it_funcs)s trailer< '(' [any] ')' > >
              �cCs�d}|dd}d|krV|jdkrV|d|d}}|j}|��|��|j�|�|p^|j}|�t|jdd�|d��dS)N�func��it)ZifilterfalseZizip_longest�dot�)�prefix)�valuer�remove�parent�replacer)�selfZnodeZresultsrrr	r�r�3/usr/lib64/python3.8/lib2to3/fixes/fix_itertools.py�	transforms�
zFixItertools.transformN)	�__name__�
__module__�__qualname__Z
BM_compatibleZit_funcs�localsZPATTERNZ	run_orderrrrrrrs�	rN)�__doc__�rZ
fixer_utilrZBaseFixrrrrr�<module>s
lib2to3/fixes/__pycache__/fix_set_literal.cpython-38.opt-1.pyc000064400000003216151153537460020130 0ustar00U

e5d��@s:dZddlmZmZddlmZmZGdd�dej�ZdS)z:
Optional fixer to transform set() calls to set literals.
�)�
fixer_base�pytree)�token�symsc@s eZdZdZdZdZdd�ZdS)�
FixSetLiteralTajpower< 'set' trailer< '('
                     (atom=atom< '[' (items=listmaker< any ((',' any)* [',']) >
                                |
                                single=any) ']' >
                     |
                     atom< '(' items=testlist_gexp< any ((',' any)* [',']) > ')' >
                     )
                     ')' > >
              c	Cs�|�d�}|r2t�tj|��g�}|�|�|}n|d}t�tj	d�g}|�
dd�|jD��|�t�tj
d��|jj|d_t�tj|�}|j|_t|j�dkr�|jd	}|��|j|jd_|S)
N�single�items�{css|]}|��VqdS)N)�clone)�.0�n�r
�5/usr/lib64/python3.8/lib2to3/fixes/fix_set_literal.py�	<genexpr>'sz*FixSetLiteral.transform.<locals>.<genexpr>�}�����)�getrZNoderZ	listmakerr
�replaceZLeafr�LBRACE�extendZchildren�append�RBRACEZnext_sibling�prefixZdictsetmaker�len�remove)	�selfZnodeZresultsrZfaker�literalZmakerrr
r
r�	transforms"


zFixSetLiteral.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZexplicitZPATTERNrr
r
r
rrs
rN)	�__doc__Zlib2to3rrZlib2to3.fixer_utilrrZBaseFixrr
r
r
r�<module>slib2to3/fixes/__pycache__/fix_isinstance.cpython-38.opt-1.pyc000064400000003012151153537460017753 0ustar00U

e5dH�@s2dZddlmZddlmZGdd�dej�ZdS)a,Fixer that cleans up a tuple argument to isinstance after the tokens
in it were fixed.  This is mainly used to remove double occurrences of
tokens as a leftover of the long -> int / unicode -> str conversion.

eg.  isinstance(x, (int, long)) -> isinstance(x, (int, int))
       -> isinstance(x, int)
�)�
fixer_base)�tokenc@s eZdZdZdZdZdd�ZdS)�
FixIsinstanceTz�
    power<
        'isinstance'
        trailer< '(' arglist< any ',' atom< '('
            args=testlist_gexp< any+ >
        ')' > > ')' >
    >
    �cCs�t�}|d}|j}g}t|�}|D]p\}}	|	jtjkrr|	j|krr|t|�dkr�||djtjkr�t	|�q$q$|�
|	�|	jtjkr$|�|	j�q$|r�|djtjkr�|d=t|�dkr�|j}
|
j
|d_
|
�|d�n||dd�<|��dS)N�args�����)�setZchildren�	enumerate�typer�NAME�value�len�COMMA�next�append�add�parent�prefix�replaceZchanged)�selfZnodeZresultsZnames_insertedZtestlistrZnew_args�iterator�idx�argZatom�r�4/usr/lib64/python3.8/lib2to3/fixes/fix_isinstance.py�	transforms*$
zFixIsinstance.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNZ	run_orderrrrrrrs	rN)�__doc__�rZ
fixer_utilrZBaseFixrrrrr�<module>slib2to3/fixes/__pycache__/fix_import.cpython-38.opt-2.pyc000064400000004647151153537460017145 0ustar00U

e5d��@sVddlmZddlmZmZmZmZddlmZm	Z	m
Z
dd�ZGdd�dej�Z
d	S)
�)�
fixer_base�)�dirname�join�exists�sep)�
FromImport�syms�tokenccs�|g}|r�|��}|jtjkr(|jVq|jtjkrNd�dd�|jD��Vq|jtj	krl|�
|jd�q|jtjkr�|�|jddd��qt
d��qdS)N�cSsg|]
}|j�qS�)�value)�.0Zchrr�0/usr/lib64/python3.8/lib2to3/fixes/fix_import.py�
<listcomp>sz$traverse_imports.<locals>.<listcomp>r���zunknown node type)�pop�typer
�NAMEr
r	Zdotted_namer�childrenZdotted_as_name�appendZdotted_as_names�extend�AssertionError)�namesZpending�noderrr�traverse_importss
rcs4eZdZdZdZ�fdd�Zdd�Zdd�Z�ZS)	�	FixImportTzj
    import_from< 'from' imp=any 'import' ['('] any [')'] >
    |
    import_name< 'import' imp=any >
    cs"tt|��||�d|jk|_dS)NZabsolute_import)�superr�
start_treeZfuture_features�skip)�selfZtree�name��	__class__rrr/szFixImport.start_treecCs�|jr
dS|d}|jtjkrVt|d�s4|jd}q|�|j�r�d|j|_|��nZd}d}t	|�D]}|�|�rzd}qfd}qf|r�|r�|�
|d�dStd|g�}|j|_|SdS)N�impr
r�.FTz#absolute and local imports together)
rrr	Zimport_from�hasattrr�probably_a_local_importr
ZchangedrZwarningr�prefix)r rZresultsr$Z
have_localZ
have_absoluteZmod_name�newrrr�	transform3s,


zFixImport.transformcCst|�d�rdS|�dd�d}t|j�}t||�}ttt|�d��sHdSdtddd	d
fD]}t||�rXdSqXdS)Nr%F�rz__init__.pyz.pyz.pycz.soz.slz.pydT)�
startswith�splitr�filenamerrr)r Zimp_name�	base_pathZextrrrr'Us


z!FixImport.probably_a_local_import)	�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrr*r'�
__classcell__rrr"rr&s
"rN)rrZos.pathrrrrZ
fixer_utilrr	r
rZBaseFixrrrrr�<module>slib2to3/fixes/__pycache__/fix_idioms.cpython-38.opt-2.pyc000064400000006420151153537460017106 0ustar00U

e5d�@sJddlmZddlmZmZmZmZmZmZdZ	dZ
Gdd�dej�ZdS)�)�
fixer_base)�Call�Comma�Name�Node�	BlankLine�symsz0(n='!=' | '==' | 'is' | n=comp_op< 'is' 'not' >)z(power< 'type' trailer< '(' x=any ')' > >csPeZdZdZdeeeefZ�fdd�Zdd�Zdd�Z	d	d
�Z
dd�Z�ZS)
�	FixIdiomsTa�
        isinstance=comparison< %s %s T=any >
        |
        isinstance=comparison< T=any %s %s >
        |
        while_stmt< 'while' while='1' ':' any+ >
        |
        sorted=any<
            any*
            simple_stmt<
              expr_stmt< id1=any '='
                         power< list='list' trailer< '(' (not arglist<any+>) any ')' > >
              >
              '\n'
            >
            sort=
            simple_stmt<
              power< id2=any
                     trailer< '.' 'sort' > trailer< '(' ')' >
              >
              '\n'
            >
            next=any*
        >
        |
        sorted=any<
            any*
            simple_stmt< expr_stmt< id1=any '=' expr=any > '\n' >
            sort=
            simple_stmt<
              power< id2=any
                     trailer< '.' 'sort' > trailer< '(' ')' >
              >
              '\n'
            >
            next=any*
        >
    cs8tt|��|�}|r4d|kr4|d|dkr0|SdS|S)N�sortedZid1Zid2)�superr	�match)�self�node�r��	__class__��0/usr/lib64/python3.8/lib2to3/fixes/fix_idioms.pyrOszFixIdioms.matchcCsHd|kr|�||�Sd|kr(|�||�Sd|kr<|�||�Std��dS)N�
isinstance�whiler
z
Invalid match)�transform_isinstance�transform_while�transform_sort�RuntimeError)r
r�resultsrrr�	transformZszFixIdioms.transformcCsh|d��}|d��}d|_d|_ttd�|t�|g�}d|kr\d|_ttjtd�|g�}|j|_|S)N�x�T�� r�n�not)�clone�prefixrrrrrZnot_test)r
rrrrZtestrrrrdszFixIdioms.transform_isinstancecCs |d}|�td|jd��dS)Nr�True�r#)�replacerr#)r
rrZonerrrrpszFixIdioms.transform_whilecCs�|d}|d}|�d�}|�d�}|r>|�td|jd��n8|rn|��}d|_|�ttd�|g|jd��ntd��|��|j}d	|kr�|r�|�d	�d
|d
jf}	d	�	|	�|d
_n"t
�}
|j�|
�|�d	�d
|
_dS)N�sort�next�list�exprr
r%rzshould not have reached here�
�)
�getr&rr#r"rr�remove�
rpartition�joinr�parentZappend_child)r
rrZ	sort_stmtZ	next_stmtZ	list_callZsimple_expr�newZbtwnZprefix_linesZend_linerrrrts,

�
zFixIdioms.transform_sort)
�__name__�
__module__�__qualname__Zexplicit�TYPE�CMPZPATTERNrrrrr�
__classcell__rrrrr	%s%
�'
r	N)
rrZ
fixer_utilrrrrrrr7r6ZBaseFixr	rrrr�<module>s lib2to3/fixes/__pycache__/fix_unicode.cpython-38.opt-2.pyc000064400000002525151153537460017252 0ustar00U

e5d��@s8ddlmZddlmZddd�ZGdd�dej�ZdS)	�)�token)�
fixer_base�chr�str)ZunichrZunicodecs,eZdZdZdZ�fdd�Zdd�Z�ZS)�
FixUnicodeTzSTRING | 'unicode' | 'unichr'cs"tt|��||�d|jk|_dS)N�unicode_literals)�superr�
start_treeZfuture_featuresr)�selfZtree�filename��	__class__��1/usr/lib64/python3.8/lib2to3/fixes/fix_unicode.pyr	szFixUnicode.start_treecCs�|jtjkr$|��}t|j|_|S|jtjkr�|j}|jsj|ddkrjd|krjd�dd�|�	d�D��}|ddkr�|dd�}||jkr�|S|��}||_|SdS)	N�z'"�\z\\cSs g|]}|�dd��dd��qS)z\uz\\uz\Uz\\U)�replace)�.0�vrrr�
<listcomp> s�z(FixUnicode.transform.<locals>.<listcomp>ZuU�)
�typer�NAMEZclone�_mapping�value�STRINGr�join�split)r
ZnodeZresults�new�valrrr�	transforms"
�
zFixUnicode.transform)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr	r �
__classcell__rrrrrsrN)Zpgen2r�rrZBaseFixrrrrr�<module>s
lib2to3/fixes/__pycache__/fix_imports.cpython-38.opt-1.pyc000064400000010446151153537460017321 0ustar00U

e5d4�1@s�dZddlmZddlmZmZddddddd	d
dddd
d
ddddddddddddddddddd d!d"d"d#d$d%d&d'd(d(d(d)d*d*d+d,d-�0Zd.d/�Zefd0d1�ZGd2d3�d3ej	�Z
d4S)5z/Fix incompatible imports and module references.�)�
fixer_base)�Name�
attr_chain�io�pickle�builtins�copyregZqueueZsocketserverZconfigparser�reprlibztkinter.filedialogztkinter.simpledialogztkinter.colorchooserztkinter.commondialogztkinter.dialogztkinter.dndztkinter.fontztkinter.messageboxztkinter.scrolledtextztkinter.constantsztkinter.tixztkinter.ttkZtkinterZ_markupbase�winreg�_threadZ
_dummy_threadzdbm.bsdzdbm.dumbzdbm.ndbmzdbm.gnuz
xmlrpc.clientz
xmlrpc.serverzhttp.clientz
html.entitieszhtml.parserzhttp.cookieszhttp.cookiejarzhttp.server�
subprocess�collectionszurllib.parsezurllib.robotparser)0�StringIOZ	cStringIOZcPickleZ__builtin__Zcopy_regZQueueZSocketServerZConfigParser�reprZ
FileDialogZtkFileDialogZSimpleDialogZtkSimpleDialogZtkColorChooserZtkCommonDialogZDialogZTkdndZtkFontZtkMessageBoxZScrolledTextZTkconstantsZTixZttkZTkinterZ
markupbase�_winreg�threadZdummy_threadZdbhashZdumbdbmZdbmZgdbmZ	xmlrpclibZDocXMLRPCServerZSimpleXMLRPCServerZhttplibZhtmlentitydefsZ
HTMLParserZCookieZ	cookielibZBaseHTTPServerZSimpleHTTPServerZ
CGIHTTPServerZcommands�
UserString�UserListZurlparseZrobotparsercCsdd�tt|��dS)N�(�|�))�join�mapr)�members�r�1/usr/lib64/python3.8/lib2to3/fixes/fix_imports.py�
alternates=srccsTd�dd�|D��}t|���}d||fVd|Vd||fVd|VdS)Nz | cSsg|]}d|�qS)zmodule_name='%s'r)�.0�keyrrr�
<listcomp>Bsz!build_pattern.<locals>.<listcomp>zyname_import=import_name< 'import' ((%s) |
               multiple_imports=dotted_as_names< any* (%s) any* >) >
          z�import_from< 'from' (%s) 'import' ['(']
              ( any | import_as_name< any 'as' any > |
                import_as_names< any* >)  [')'] >
          z�import_name< 'import' (dotted_as_name< (%s) 'as' any > |
               multiple_imports=dotted_as_names<
                 any* dotted_as_name< (%s) 'as' any > any* >) >
          z3power< bare_with_attr=(%s) trailer<'.' any > any* >)rr�keys)�mappingZmod_listZ
bare_namesrrr�
build_patternAs���r"csTeZdZdZdZeZdZdd�Z�fdd�Z	�fdd�Z
�fd	d
�Zdd�Z�Z
S)
�
FixImportsT�cCsd�t|j��S)Nr)rr"r!��selfrrrr"`szFixImports.build_patterncs|��|_tt|���dS�N)r"ZPATTERN�superr#�compile_patternr%��	__class__rrr)cs
zFixImports.compile_patterncsHtt|�j��|�}|rDd|kr@t�fdd�t|d�D��r@dS|SdS)N�bare_with_attrc3s|]}�|�VqdSr'r)r�obj��matchrr�	<genexpr>qsz#FixImports.match.<locals>.<genexpr>�parentF)r(r#r/�anyr)r&�node�resultsr*r.rr/js�zFixImports.matchcstt|��||�i|_dSr')r(r#�
start_tree�replace)r&Ztree�filenamer*rrr5vszFixImports.start_treecCs�|�d�}|rh|j}|j|}|�t||jd��d|krD||j|<d|kr�|�|�}|r�|�||�n2|dd}|j�|j�}|r�|�t||jd��dS)NZmodule_name)�prefixZname_importZmultiple_importsr,�)�get�valuer!r6rr8r/�	transform)r&r3r4Z
import_modZmod_name�new_nameZ	bare_namerrrr<zs



zFixImports.transform)�__name__�
__module__�__qualname__Z
BM_compatibleZkeep_line_order�MAPPINGr!Z	run_orderr"r)r/r5r<�
__classcell__rrr*rr#Usr#N)�__doc__�rZ
fixer_utilrrrArr"ZBaseFixr#rrrr�<module>sl�5lib2to3/fixes/__pycache__/fix_throw.cpython-38.opt-2.pyc000064400000003044151153537460016764 0ustar00U

e5d.�@sVddlmZddlmZddlmZddlmZmZmZm	Z	m
Z
Gdd�dej�ZdS)�)�pytree)�token)�
fixer_base)�Name�Call�ArgList�Attr�is_tuplec@seZdZdZdZdd�ZdS)�FixThrowTz�
    power< any trailer< '.' 'throw' >
           trailer< '(' args=arglist< exc=any ',' val=any [',' tb=any] > ')' >
    >
    |
    power< any trailer< '.' 'throw' > trailer< '(' exc=any ')' > >
    cCs�|j}|d��}|jtjkr.|�|d�dS|�d�}|dkrDdS|��}t|�rndd�|jdd�D�}nd|_	|g}|d	}d
|kr�|d
��}d|_	t
||�}	t|	td��t
|g�g}
|�t�|j|
��n|�t
||��dS)N�excz+Python 3 does not support string exceptions�valcSsg|]}|���qS�)�clone)�.0�cr
r
�//usr/lib64/python3.8/lib2to3/fixes/fix_throw.py�
<listcomp>)sz&FixThrow.transform.<locals>.<listcomp>������args�tb�with_traceback)�symsr�typer�STRINGZcannot_convert�getr	Zchildren�prefixrrrr�replacerZNodeZpower)�selfZnodeZresultsrrrrZ
throw_argsr�eZwith_tbr
r
r�	transforms*

zFixThrow.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr!r
r
r
rr
sr
N)
rrZpgen2rrZ
fixer_utilrrrrr	ZBaseFixr
r
r
r
r�<module>slib2to3/fixes/__pycache__/fix_exec.cpython-38.opt-2.pyc000064400000001670151153537460016550 0ustar00U

e5d��@s6ddlmZddlmZmZmZGdd�dej�ZdS)�)�
fixer_base)�Comma�Name�Callc@seZdZdZdZdd�ZdS)�FixExecTzx
    exec_stmt< 'exec' a=any 'in' b=any [',' c=any] >
    |
    exec_stmt< 'exec' (not atom<'(' [any] ')'>) a=any >
    cCs�|j}|d}|�d�}|�d�}|��g}d|d_|dk	rR|�t�|��g�|dk	rn|�t�|��g�ttd�||jd�S)N�a�b�c���exec)�prefix)�syms�getZcloner
�extendrrr)�selfZnodeZresultsrrrr	�args�r�./usr/lib64/python3.8/lib2to3/fixes/fix_exec.py�	transforms



zFixExec.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrrrrrrsrN)r
rZ
fixer_utilrrrZBaseFixrrrrr�<module>
slib2to3/fixes/__pycache__/fix_filter.cpython-38.opt-2.pyc000064400000003673151153537460017116 0ustar00U

e5d�
�@sVddlmZddlmZddlmZddlmZm	Z	m
Z
mZmZGdd�dej
�ZdS)�)�
fixer_base)�Node)�python_symbols)�Name�ArgList�ListComp�in_special_context�parenthesizec@s eZdZdZdZdZdd�ZdS)�	FixFilterTaV
    filter_lambda=power<
        'filter'
        trailer<
            '('
            arglist<
                lambdef< 'lambda'
                         (fp=NAME | vfpdef< '(' fp=NAME ')'> ) ':' xp=any
                >
                ','
                it=any
            >
            ')'
        >
        [extra_trailers=trailer*]
    >
    |
    power<
        'filter'
        trailer< '(' arglist< none='None' ',' seq=any > ')' >
        [extra_trailers=trailer*]
    >
    |
    power<
        'filter'
        args=trailer< '(' [any] ')' >
        [extra_trailers=trailer*]
    >
    zfuture_builtins.filtercCsL|�|�rdSg}d|kr6|dD]}|�|���q"d|kr�|�d���}|jtjkrfd|_t|�}t	|�d���|�d���|�d���|�}t
tj|g|dd�}n�d|kr�t	td	�td	�|d
��td	��}t
tj|g|dd�}nTt
|�r�dS|d��}t
tjtd�|gdd�}t
tjtd
�t|g�g|�}d|_|j|_|S)NZextra_trailersZ
filter_lambda�xp��fp�it)�prefixZnoneZ_f�seq�args�filter�list)Zshould_skip�appendZclone�get�type�symsZtestrr	rrZpowerrrr)�selfZnodeZresultsZtrailers�tr�newr�r�0/usr/lib64/python3.8/lib2to3/fixes/fix_filter.py�	transform:s@
�
�zFixFilter.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNZskip_onrrrrrr
sr
N)rrZpytreerZpygramrrZ
fixer_utilrrrrr	ZConditionalFixr
rrrr�<module>slib2to3/fixes/__pycache__/fix_xreadlines.cpython-38.opt-1.pyc000064400000002136151153537460017757 0ustar00U

e5d��@s2dZddlmZddlmZGdd�dej�ZdS)zpFix "for x in f.xreadlines()" -> "for x in f".

This fixer will also convert g(f.xreadlines) into g(f.__iter__).�)�
fixer_base)�Namec@seZdZdZdZdd�ZdS)�
FixXreadlinesTz�
    power< call=any+ trailer< '.' 'xreadlines' > trailer< '(' ')' > >
    |
    power< any+ trailer< '.' no_call='xreadlines' > >
    cCs@|�d�}|r$|�td|jd��n|�dd�|dD��dS)N�no_call�__iter__)�prefixcSsg|]}|���qS�)Zclone)�.0�xrr�4/usr/lib64/python3.8/lib2to3/fixes/fix_xreadlines.py�
<listcomp>sz+FixXreadlines.transform.<locals>.<listcomp>Zcall)�get�replacerr)�selfZnodeZresultsrrrr�	transforms
zFixXreadlines.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrrrrrrsrN)�__doc__�rZ
fixer_utilrZBaseFixrrrrr�<module>slib2to3/fixes/__pycache__/fix_imports2.cpython-38.opt-1.pyc000064400000001035151153537460017375 0ustar00U

e5d!�@s0dZddlmZddd�ZGdd�dej�ZdS)zTFix incompatible imports and module references that must be fixed after
fix_imports.�)�fix_importsZdbm)ZwhichdbZanydbmc@seZdZdZeZdS)�FixImports2�N)�__name__�
__module__�__qualname__Z	run_order�MAPPING�mapping�r
r
�2/usr/lib64/python3.8/lib2to3/fixes/fix_imports2.pyrsrN)�__doc__�rrZ
FixImportsrr
r
r
r�<module>s
�lib2to3/fixes/__pycache__/fix_filter.cpython-38.opt-1.pyc000064400000004607151153537460017113 0ustar00U

e5d�
�@sZdZddlmZddlmZddlmZddlm	Z	m
Z
mZmZm
Z
Gdd�dej�ZdS)	a�Fixer that changes filter(F, X) into list(filter(F, X)).

We avoid the transformation if the filter() call is directly contained
in iter(<>), list(<>), tuple(<>), sorted(<>), ...join(<>), or
for V in <>:.

NOTE: This is still not correct if the original code was depending on
filter(F, X) to return a string if X is a string and a tuple if X is a
tuple.  That would require type inference, which we don't do.  Let
Python 2.6 figure it out.
�)�
fixer_base)�Node)�python_symbols)�Name�ArgList�ListComp�in_special_context�parenthesizec@s eZdZdZdZdZdd�ZdS)�	FixFilterTaV
    filter_lambda=power<
        'filter'
        trailer<
            '('
            arglist<
                lambdef< 'lambda'
                         (fp=NAME | vfpdef< '(' fp=NAME ')'> ) ':' xp=any
                >
                ','
                it=any
            >
            ')'
        >
        [extra_trailers=trailer*]
    >
    |
    power<
        'filter'
        trailer< '(' arglist< none='None' ',' seq=any > ')' >
        [extra_trailers=trailer*]
    >
    |
    power<
        'filter'
        args=trailer< '(' [any] ')' >
        [extra_trailers=trailer*]
    >
    zfuture_builtins.filtercCsL|�|�rdSg}d|kr6|dD]}|�|���q"d|kr�|�d���}|jtjkrfd|_t|�}t	|�d���|�d���|�d���|�}t
tj|g|dd�}n�d|kr�t	td	�td	�|d
��td	��}t
tj|g|dd�}nTt
|�r�dS|d��}t
tjtd�|gdd�}t
tjtd
�t|g�g|�}d|_|j|_|S)NZextra_trailersZ
filter_lambda�xp��fp�it)�prefixZnoneZ_f�seq�args�filter�list)Zshould_skip�appendZclone�get�type�symsZtestrr	rrZpowerrrr)�selfZnodeZresultsZtrailers�tr�newr�r�0/usr/lib64/python3.8/lib2to3/fixes/fix_filter.py�	transform:s@
�
�zFixFilter.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNZskip_onrrrrrr
sr
N)�__doc__rrZpytreerZpygramrrZ
fixer_utilrrrrr	ZConditionalFixr
rrrr�<module>s

lib2to3/fixes/__pycache__/fix_itertools_imports.cpython-38.opt-2.pyc000064400000002653151153537460021427 0ustar00U

e5d&�@s6ddlmZddlmZmZmZGdd�dej�ZdS)�)�
fixer_base)�	BlankLine�syms�tokenc@s"eZdZdZde�Zdd�ZdS)�FixItertoolsImportsTzT
              import_from< 'from' 'itertools' 'import' imports=any >
              cCsZ|d}|jtjks|js"|g}n|j}|ddd�D]|}|jtjkrR|j}|}n|jtjkrddS|jd}|j}|dkr�d|_|��q6|dkr6|�	�|ddkr�dnd	|_q6|jdd�p�|g}d
}	|D]&}|	r�|jtj
kr�|��q�|	d
N}	q�|�r|djtj
k�r|����q�|j�s4t|dd��r@|j
dk�rV|j}
t�}|
|_|SdS)
N�imports�r)ZimapZizipZifilter)ZifilterfalseZizip_longest��f�filterfalse�zip_longestT����value)�typerZimport_as_name�childrenr�NAMEr�STAR�removeZchanged�COMMA�pop�getattr�parent�prefixr)�selfZnodeZresultsrrZchild�memberZ	name_node�member_nameZremove_comma�p�r�;/usr/lib64/python3.8/lib2to3/fixes/fix_itertools_imports.py�	transformsF

�

�zFixItertoolsImports.transformN)�__name__�
__module__�__qualname__Z
BM_compatible�localsZPATTERNrrrrrrs
�rN)Zlib2to3rZlib2to3.fixer_utilrrrZBaseFixrrrrr�<module>slib2to3/fixes/__pycache__/fix_nonzero.cpython-38.opt-1.pyc000064400000001626151153537460017316 0ustar00U

e5dO�@s2dZddlmZddlmZGdd�dej�ZdS)z*Fixer for __nonzero__ -> __bool__ methods.�)�
fixer_base)�Namec@seZdZdZdZdd�ZdS)�
FixNonzeroTz�
    classdef< 'class' any+ ':'
              suite< any*
                     funcdef< 'def' name='__nonzero__'
                              parameters< '(' NAME ')' > any+ >
                     any* > >
    cCs$|d}td|jd�}|�|�dS)N�name�__bool__)�prefix)rr�replace)�selfZnodeZresultsr�new�r�1/usr/lib64/python3.8/lib2to3/fixes/fix_nonzero.py�	transformszFixNonzero.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr
rrrrrsrN)�__doc__�rZ
fixer_utilrZBaseFixrrrrr�<module>slib2to3/fixes/__pycache__/fix_itertools.cpython-38.opt-1.pyc000064400000003011151153537460017636 0ustar00U

e5d�@s2dZddlmZddlmZGdd�dej�ZdS)aT Fixer for itertools.(imap|ifilter|izip) --> (map|filter|zip) and
    itertools.ifilterfalse --> itertools.filterfalse (bugs 2360-2363)

    imports from itertools are fixed in fix_itertools_import.py

    If itertools is imported as something else (ie: import itertools as it;
    it.izip(spam, eggs)) method calls will not get fixed.
    �)�
fixer_base)�Namec@s*eZdZdZdZde�ZdZdd�ZdS)�FixItertoolsTz7('imap'|'ifilter'|'izip'|'izip_longest'|'ifilterfalse')z�
              power< it='itertools'
                  trailer<
                     dot='.' func=%(it_funcs)s > trailer< '(' [any] ')' > >
              |
              power< func=%(it_funcs)s trailer< '(' [any] ')' > >
              �cCs�d}|dd}d|krV|jdkrV|d|d}}|j}|��|��|j�|�|p^|j}|�t|jdd�|d��dS)N�func��it)ZifilterfalseZizip_longest�dot�)�prefix)�valuer�remove�parent�replacer)�selfZnodeZresultsrrr	r�r�3/usr/lib64/python3.8/lib2to3/fixes/fix_itertools.py�	transforms�
zFixItertools.transformN)	�__name__�
__module__�__qualname__Z
BM_compatibleZit_funcs�localsZPATTERNZ	run_orderrrrrrrs�	rN)�__doc__�rZ
fixer_utilrZBaseFixrrrrr�<module>s
lib2to3/fixes/__pycache__/__init__.cpython-38.opt-2.pyc000064400000000211151153537460016503 0ustar00U

e5d/�@sdS)N�rrr�./usr/lib64/python3.8/lib2to3/fixes/__init__.py�<module>�lib2to3/fixes/__pycache__/fix_repr.cpython-38.pyc000064400000001510151153537460015625 0ustar00U

e5de�@s:dZddlmZddlmZmZmZGdd�dej�ZdS)z/Fixer that transforms `xyzzy` into repr(xyzzy).�)�
fixer_base)�Call�Name�parenthesizec@seZdZdZdZdd�ZdS)�FixReprTz7
              atom < '`' expr=any '`' >
              cCs8|d��}|j|jjkr"t|�}ttd�|g|jd�S)N�expr�repr)�prefix)Zclone�typeZsymsZ	testlist1rrrr	)�selfZnodeZresultsr�r�./usr/lib64/python3.8/lib2to3/fixes/fix_repr.py�	transformszFixRepr.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrrrrr
rsrN)	�__doc__�rZ
fixer_utilrrrZBaseFixrrrrr
�<module>slib2to3/fixes/__pycache__/fix_operator.cpython-38.pyc000064400000010167151153537460016520 0ustar00U

e5db
�@sNdZddlZddlmZddlmZmZmZm	Z	dd�Z
Gdd�dej�ZdS)	a�Fixer for operator functions.

operator.isCallable(obj)       -> callable(obj)
operator.sequenceIncludes(obj) -> operator.contains(obj)
operator.isSequenceType(obj)   -> isinstance(obj, collections.abc.Sequence)
operator.isMappingType(obj)    -> isinstance(obj, collections.abc.Mapping)
operator.isNumberType(obj)     -> isinstance(obj, numbers.Number)
operator.repeat(obj, n)        -> operator.mul(obj, n)
operator.irepeat(obj, n)       -> operator.imul(obj, n)
�N)�
fixer_base)�Call�Name�String�touch_importcs�fdd�}|S)Ncs
�|_|S�N)�
invocation)�f��s��2/usr/lib64/python3.8/lib2to3/fixes/fix_operator.py�decszinvocation.<locals>.decr)rrrr
r
rsrc@s�eZdZdZdZdZdZdeeed�Zdd�Z	e
d	�d
d��Ze
d�d
d��Ze
d�dd��Z
e
d�dd��Ze
d�dd��Ze
d�dd��Ze
d�dd��Zdd�Zd d!�Zd"d#�Zd$S)%�FixOperatorTZprez�
              method=('isCallable'|'sequenceIncludes'
                     |'isSequenceType'|'isMappingType'|'isNumberType'
                     |'repeat'|'irepeat')
              z'(' obj=any ')'z�
              power< module='operator'
                trailer< '.' %(methods)s > trailer< %(obj)s > >
              |
              power< %(methods)s trailer< %(obj)s > >
              )�methods�objcCs"|�||�}|dk	r|||�SdSr)�
_check_method)�self�node�results�methodrrr
�	transform+szFixOperator.transformzoperator.contains(%s)cCs|�||d�S)N�contains��_handle_rename�rrrrrr
�_sequenceIncludes0szFixOperator._sequenceIncludeszcallable(%s)cCs"|d}ttd�|��g|jd�S)Nr�callable��prefix)rr�cloner)rrrrrrr
�_isCallable4szFixOperator._isCallablezoperator.mul(%s)cCs|�||d�S)N�mulrrrrr
�_repeat9szFixOperator._repeatzoperator.imul(%s)cCs|�||d�S)N�imulrrrrr
�_irepeat=szFixOperator._irepeatz(isinstance(%s, collections.abc.Sequence)cCs|�||dd�S)N�collections.abc�Sequence��_handle_type2abcrrrr
�_isSequenceTypeAszFixOperator._isSequenceTypez'isinstance(%s, collections.abc.Mapping)cCs|�||dd�S)Nr&�Mappingr(rrrr
�_isMappingTypeEszFixOperator._isMappingTypezisinstance(%s, numbers.Number)cCs|�||dd�S)NZnumbers�Numberr(rrrr
�
_isNumberTypeIszFixOperator._isNumberTypecCs|dd}||_|��dS)Nrr)�valueZchanged)rrr�namerrrr
rMszFixOperator._handle_renamecCsFtd||�|d}|��tdd�||g��g}ttd�||jd�S)Nrz, �.�
isinstancer)rr r�joinrrr)rrr�module�abcr�argsrrr
r)RszFixOperator._handle_type2abccCs^t|d|ddj�}t|tjj�rZd|kr2|St|d�f}|j|}|�|d|�dS)N�_rrr4rzYou should use '%s' here.)	�getattrr/r2�collectionsr5�Callable�strrZwarning)rrrr�subZinvocation_strrrr
rXs
zFixOperator._check_methodN)�__name__�
__module__�__qualname__Z
BM_compatible�orderrr�dictZPATTERNrrrr!r#r%r*r,r.rr)rrrrr
rs2
�






r)
�__doc__Zcollections.abcr9Zlib2to3rZlib2to3.fixer_utilrrrrrZBaseFixrrrrr
�<module>s
lib2to3/fixes/__pycache__/fix_next.cpython-38.opt-2.pyc000064400000005653151153537460016607 0ustar00U

e5df�@sjddlmZddlmZddlmZddlmZm	Z	m
Z
dZGdd�dej�Z
dd	�Zd
d�Zdd
�ZdS)�)�token)�python_symbols)�
fixer_base)�Name�Call�find_bindingz;Calls to builtin next() possibly shadowed by global bindingcs0eZdZdZdZdZ�fdd�Zdd�Z�ZS)�FixNextTa�
    power< base=any+ trailer< '.' attr='next' > trailer< '(' ')' > >
    |
    power< head=any+ trailer< '.' attr='next' > not trailer< '(' ')' > >
    |
    classdef< 'class' any+ ':'
              suite< any*
                     funcdef< 'def'
                              name='next'
                              parameters< '(' NAME ')' > any+ >
                     any* > >
    |
    global=global_stmt< 'global' any* 'next' any* >
    Zprecs>tt|��||�td|�}|r4|�|t�d|_nd|_dS)N�nextTF)�superr�
start_treer�warning�bind_warning�
shadowed_next)�selfZtree�filename�n��	__class__��./usr/lib64/python3.8/lib2to3/fixes/fix_next.pyr$s
zFixNext.start_treecCs�|�d�}|�d�}|�d�}|rr|jr>|�td|jd��q�dd�|D�}d|d	_|�ttd
|jd�|��n�|r�td|jd�}|�|�nj|r�t|�r�|d}d�dd�|D����d
kr�|�	|t
�dS|�td��nd|kr�|�	|t
�d|_dS)N�base�attr�name�__next__)�prefixcSsg|]}|���qSr)Zclone��.0rrrr�
<listcomp>9sz%FixNext.transform.<locals>.<listcomp>��r	�headcSsg|]}t|��qSr)�strrrrrrEsZ__builtin__�globalT)�getr�replacerrr�is_assign_target�join�striprr
)r�nodeZresultsrrrrr rrr�	transform.s,



zFixNext.transform)	�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERN�orderrr)�
__classcell__rrrrrs

rcCsFt|�}|dkrdS|jD]&}|jtjkr0dSt||�rdSqdS)NFT)�find_assign�children�typer�EQUAL�
is_subtree)r(ZassignZchildrrrr%Qs

r%cCs4|jtjkr|S|jtjks&|jdkr*dSt|j�S�N)r1�symsZ	expr_stmtZsimple_stmt�parentr/�r(rrrr/]s
r/cs$|�krdSt�fdd�|jD��S)NTc3s|]}t|��VqdSr4)r3)r�cr7rr�	<genexpr>gszis_subtree.<locals>.<genexpr>)�anyr0)�rootr(rr7rr3dsr3N)Zpgen2rZpygramrr5rrZ
fixer_utilrrrr
ZBaseFixrr%r/r3rrrr�<module>	s@lib2to3/fixes/__pycache__/fix_import.cpython-38.opt-1.pyc000064400000005336151153537460017140 0ustar00U

e5d��@sZdZddlmZddlmZmZmZmZddlm	Z	m
Z
mZdd�ZGdd	�d	ej
�Zd
S)z�Fixer for import statements.
If spam is being imported from the local directory, this import:
    from spam import eggs
Becomes:
    from .spam import eggs

And this import:
    import spam
Becomes:
    from . import spam
�)�
fixer_base�)�dirname�join�exists�sep)�
FromImport�syms�tokenccs�|g}|r�|��}|jtjkr(|jVq|jtjkrNd�dd�|jD��Vq|jtj	krl|�
|jd�q|jtjkr�|�|jddd��qt
d��qdS)zF
    Walks over all the names imported in a dotted_as_names node.
    �cSsg|]
}|j�qS�)�value)�.0Zchrr�0/usr/lib64/python3.8/lib2to3/fixes/fix_import.py�
<listcomp>sz$traverse_imports.<locals>.<listcomp>rN���zunknown node type)�pop�typer
�NAMEr
r	Zdotted_namer�childrenZdotted_as_name�appendZdotted_as_names�extend�AssertionError)�namesZpending�noderrr�traverse_importss
rcs4eZdZdZdZ�fdd�Zdd�Zdd�Z�ZS)	�	FixImportTzj
    import_from< 'from' imp=any 'import' ['('] any [')'] >
    |
    import_name< 'import' imp=any >
    cs"tt|��||�d|jk|_dS)NZabsolute_import)�superr�
start_treeZfuture_features�skip)�selfZtree�name��	__class__rrr/szFixImport.start_treecCs�|jr
dS|d}|jtjkrVt|d�s4|jd}q|�|j�r�d|j|_|��nZd}d}t	|�D]}|�|�rzd}qfd}qf|r�|r�|�
|d�dStd|g�}|j|_|SdS)N�impr
r�.FTz#absolute and local imports together)
rrr	Zimport_from�hasattrr�probably_a_local_importr
ZchangedrZwarningr�prefix)r rZresultsr$Z
have_localZ
have_absoluteZmod_name�newrrr�	transform3s,


zFixImport.transformcCst|�d�rdS|�dd�d}t|j�}t||�}ttt|�d��sHdSdtddd	d
fD]}t||�rXdSqXdS)Nr%F�rz__init__.pyz.pyz.pycz.soz.slz.pydT)�
startswith�splitr�filenamerrr)r Zimp_name�	base_pathZextrrrr'Us


z!FixImport.probably_a_local_import)	�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrr*r'�
__classcell__rrr"rr&s
"rN)�__doc__rrZos.pathrrrrZ
fixer_utilrr	r
rZBaseFixrrrrr�<module>s

lib2to3/fixes/__pycache__/fix_standarderror.cpython-38.opt-1.pyc000064400000001313151153537460020467 0ustar00U

e5d��@s2dZddlmZddlmZGdd�dej�ZdS)z%Fixer for StandardError -> Exception.�)�
fixer_base)�Namec@seZdZdZdZdd�ZdS)�FixStandarderrorTz-
              'StandardError'
              cCstd|jd�S)N�	Exception)�prefix)rr)�selfZnodeZresults�r�7/usr/lib64/python3.8/lib2to3/fixes/fix_standarderror.py�	transformszFixStandarderror.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr
rrrr	rsrN)�__doc__�rZ
fixer_utilrZBaseFixrrrrr	�<module>slib2to3/fixes/__pycache__/fix_ne.cpython-38.opt-1.pyc000064400000001446151153537460016226 0ustar00U

e5d;�@s>dZddlmZddlmZddlmZGdd�dej�ZdS)zFixer that turns <> into !=.�)�pytree)�token)�
fixer_basec@s"eZdZejZdd�Zdd�ZdS)�FixNecCs
|jdkS)Nz<>)�value)�self�node�r	�,/usr/lib64/python3.8/lib2to3/fixes/fix_ne.py�matchszFixNe.matchcCstjtjd|jd�}|S)Nz!=)�prefix)rZLeafr�NOTEQUALr)rrZresults�newr	r	r
�	transformszFixNe.transformN)�__name__�
__module__�__qualname__rr
Z_accept_typerrr	r	r	r
rsrN)�__doc__�rZpgen2rrZBaseFixrr	r	r	r
�<module>slib2to3/fixes/__pycache__/fix_nonzero.cpython-38.opt-2.pyc000064400000001533151153537460017314 0ustar00U

e5dO�@s.ddlmZddlmZGdd�dej�ZdS)�)�
fixer_base)�Namec@seZdZdZdZdd�ZdS)�
FixNonzeroTz�
    classdef< 'class' any+ ':'
              suite< any*
                     funcdef< 'def' name='__nonzero__'
                              parameters< '(' NAME ')' > any+ >
                     any* > >
    cCs$|d}td|jd�}|�|�dS)N�name�__bool__)�prefix)rr�replace)�selfZnodeZresultsr�new�r�1/usr/lib64/python3.8/lib2to3/fixes/fix_nonzero.py�	transformszFixNonzero.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr
rrrrrsrN)�rZ
fixer_utilrZBaseFixrrrrr�<module>slib2to3/fixes/__pycache__/fix_except.cpython-38.pyc000064400000005375151153537460016162 0ustar00U

e5d
�@sfdZddlmZddlmZddlmZddlmZmZm	Z	m
Z
mZmZdd�Z
Gdd	�d	ej�Zd
S)a�Fixer for except statements with named exceptions.

The following cases will be converted:

- "except E, T:" where T is a name:

    except E as T:

- "except E, T:" where T is not a name, tuple or list:

        except E as t:
            T = t

    This is done because the target of an "except" clause must be a
    name.

- "except E, T:" where T is a tuple or list literal:

        except E as t:
            T = t.args
�)�pytree)�token)�
fixer_base)�Assign�Attr�Name�is_tuple�is_list�symsccsDt|�D]6\}}|jtjkr|jdjdkr|||dfVqdS)N��exceptr)�	enumerate�typer
�
except_clause�children�value)Znodes�i�n�r�0/usr/lib64/python3.8/lib2to3/fixes/fix_except.py�find_exceptssrc@seZdZdZdZdd�ZdS)�	FixExceptTa1
    try_stmt< 'try' ':' (simple_stmt | suite)
                  cleanup=(except_clause ':' (simple_stmt | suite))+
                  tail=(['except' ':' (simple_stmt | suite)]
                        ['else' ':' (simple_stmt | suite)]
                        ['finally' ':' (simple_stmt | suite)]) >
    cCsx|j}dd�|dD�}dd�|dD�}t|�D�]\}}t|j�dkr2|jdd�\}}	}
|	�tdd	d
��|
jtjk�r8t|�	�d	d
�}|
�
�}d|_|
�|�|�
�}|j}
t|
�D]\}}t
|tj�r�q�q�t|
�s�t|
�r�t|t|td���}n
t||�}t|
d|��D]}|�d
|��q|�||�q2|
jdkr2d	|
_q2dd�|jdd�D�||}t�|j|�S)NcSsg|]}|���qSr��clone)�.0rrrr�
<listcomp>2sz'FixExcept.transform.<locals>.<listcomp>�tailcSsg|]}|���qSrr)rZchrrrr4sZcleanup���as� )�prefix��argsrcSsg|]}|���qSrr)r�crrrr\s�)r
r�lenr�replacerrr�NAME�new_namerr!r
�
isinstancerZNoderr	rr�reversedZinsert_child)�selfZnodeZresultsr
rZtry_cleanuprZe_suite�EZcomma�NZnew_N�targetZsuite_stmtsrZstmtZassignZchildrrrr�	transform/s6


 zFixExcept.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr0rrrrr$srN)�__doc__r"rZpgen2rrZ
fixer_utilrrrrr	r
rZBaseFixrrrrr�<module>s lib2to3/fixes/__pycache__/fix_map.cpython-38.opt-2.pyc000064400000004370151153537460016401 0ustar00U

e5d8�@sbddlmZddlmZddlmZmZmZmZm	Z	ddl
mZddl
mZGdd�dej�ZdS)	�)�token)�
fixer_base)�Name�ArgList�Call�ListComp�in_special_context)�python_symbols)�Nodec@s eZdZdZdZdZdd�ZdS)�FixMapTaL
    map_none=power<
        'map'
        trailer< '(' arglist< 'None' ',' arg=any [','] > ')' >
        [extra_trailers=trailer*]
    >
    |
    map_lambda=power<
        'map'
        trailer<
            '('
            arglist<
                lambdef< 'lambda'
                         (fp=NAME | vfpdef< '(' fp=NAME ')'> ) ':' xp=any
                >
                ','
                it=any
            >
            ')'
        >
        [extra_trailers=trailer*]
    >
    |
    power<
        'map' args=trailer< '(' [any] ')' >
        [extra_trailers=trailer*]
    >
    zfuture_builtins.mapcCs�|�|�rdSg}d|kr6|dD]}|�|���q"|jjtjkrr|�|d�|��}d|_t	t
d�|g�}�n&d|kr�t|d��|d��|d���}ttj
|g|dd	�}n�d
|kr�|d��}d|_n�d|k�rf|d}|jtjk�rH|jd
jtjk�rH|jd
jdjtjk�rH|jd
jdjdk�rH|�|d�dSttj
t
d�|��g�}d|_t|��rtdSttj
t
d�t|g�g|�}d|_|j|_|S)NZextra_trailerszYou should use a for loop here��listZ
map_lambdaZxp�fp�it)�prefixZmap_none�arg�args���Nonezjcannot convert map(None, ...) with multiple arguments because map() now truncates to the shortest sequence�map)Zshould_skip�appendZclone�parent�type�symsZsimple_stmtZwarningrrrrr
ZpowerZtrailerZchildrenZarglistr�NAME�valuerr)�selfZnodeZresultsZtrailers�t�newr�r �-/usr/lib64/python3.8/lib2to3/fixes/fix_map.py�	transform@sN


�
���
zFixMap.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNZskip_onr"r r r r!rsrN)Zpgen2rrrZ
fixer_utilrrrrrZpygramr	rZpytreer
ZConditionalFixrr r r r!�<module>s
lib2to3/fixes/__pycache__/fix_tuple_params.cpython-38.opt-1.pyc000064400000010752151153537460020320 0ustar00U

e5d��@s�dZddlmZddlmZddlmZddlmZmZm	Z	m
Z
mZmZdd�Z
Gdd	�d	ej�Zd
d�Zdd
�Zgdfdd�Zdd�ZdS)a:Fixer for function definitions with tuple parameters.

def func(((a, b), c), d):
    ...

    ->

def func(x, d):
    ((a, b), c) = x
    ...

It will also support lambdas:

    lambda (x, y): x + y -> lambda t: t[0] + t[1]

    # The parens are a syntax error in Python 3
    lambda (x): x + y -> lambda x: x + y
�)�pytree)�token)�
fixer_base)�Assign�Name�Newline�Number�	Subscript�symscCst|tj�o|jdjtjkS)N�)�
isinstancer�Node�children�typer�STRING)�stmt�r�6/usr/lib64/python3.8/lib2to3/fixes/fix_tuple_params.py�is_docstrings�rc@s(eZdZdZdZdZdd�Zdd�ZdS)	�FixTupleParams�Ta
              funcdef< 'def' any parameters< '(' args=any ')' >
                       ['->' any] ':' suite=any+ >
              |
              lambda=
              lambdef< 'lambda' args=vfpdef< '(' inner=any ')' >
                       ':' body=any
              >
              cs�d|kr��||�Sg�|d}|d}|djdjtjkrZd}|djdj}t��nd}d}t�tjd��d���fd
d�	}|jt	j
kr�||�n<|jt	jkr�t|j�D]$\}}	|	jt	j
kr�||	|dkd�q��s�dS�D]}
|d|
_
q�|}|dk�r
d
�d_n&t|dj|��r0|�d_|d}�D]}
|d|
_
�q4�|dj||�<t|d|t��d�D]}||dj|_�qr|d��dS)N�lambda�suite�argsr�rz; �Fcs\t����}|��}d|_t||���}|r2d|_|�|���t�t	j
|���g��dS)Nr� )r�new_name�clone�prefixr�replace�appendrr
r
Zsimple_stmt)Z	tuple_arg�
add_prefix�n�argr��endZ	new_lines�selfrr�handle_tupleCs

�z.FixTupleParams.transform.<locals>.handle_tuple)r"r)F)�transform_lambdarrr�INDENT�valuerrZLeafr
ZtfpdefZ
typedargslist�	enumerate�parentrr�range�lenZchanged)r'�node�resultsrr�start�indentr(�ir$�lineZafterrr%r�	transform.sF


zFixTupleParams.transformc
Cs�|d}|d}t|d�}|jtjkrD|��}d|_|�|�dSt|�}t|�}|�	t
|��}t|dd�}	|�|	���|��D]X}
|
jtjkr�|
j
|kr�dd�||
j
D�}t�tj|	��g|�}|
j|_|
�|�q�dS)Nr�body�innerr)rcSsg|]}|���qSr)r��.0�crrr�
<listcomp>�sz3FixTupleParams.transform_lambda.<locals>.<listcomp>)�
simplify_argsrr�NAMErrr �find_params�map_to_indexr�
tuple_namerZ
post_orderr+rr
r
Zpower)
r'r0r1rr7r8ZparamsZto_indexZtup_nameZ	new_paramr#Z
subscripts�newrrrr)ns*
�zFixTupleParams.transform_lambdaN)�__name__�
__module__�__qualname__Z	run_orderZ
BM_compatibleZPATTERNr6r)rrrrrs

@rcCsN|jtjtjfkr|S|jtjkr>|jtjkr:|jd}q"|Std|��dS)NrzReceived unexpected node %s)rr
Zvfplistrr>�vfpdefr�RuntimeError�r0rrrr=�sr=cCs<|jtjkrt|jd�S|jtjkr,|jSdd�|jD�S)NrcSs g|]}|jtjkrt|��qSr)rr�COMMAr?r9rrrr<�szfind_params.<locals>.<listcomp>)rr
rFr?rrr>r+rHrrrr?�s
r?NcCsZ|dkri}t|�D]@\}}ttt|���g}t|t�rHt|||d�q||||<q|S)N)�d)r,r	r�strr�listr@)�
param_listrrJr4�objZtrailerrrrr@�s
r@cCs<g}|D](}t|t�r&|�t|��q|�|�qd�|�S)N�_)rrLr!rA�join)rM�lrNrrrrA�s
rA)�__doc__rrZpgen2rrZ
fixer_utilrrrrr	r
rZBaseFixrr=r?r@rArrrr�<module>s llib2to3/fixes/__pycache__/fix_numliterals.cpython-38.opt-2.pyc000064400000001674151153537460020167 0ustar00U

e5d�@s:ddlmZddlmZddlmZGdd�dej�ZdS)�)�token)�
fixer_base)�Numberc@s"eZdZejZdd�Zdd�ZdS)�FixNumliteralscCs|j�d�p|jddkS)N�0����Ll)�value�
startswith)�self�node�r
�5/usr/lib64/python3.8/lib2to3/fixes/fix_numliterals.py�matchszFixNumliterals.matchcCs`|j}|ddkr |dd�}n2|�d�rR|��rRtt|��dkrRd|dd�}t||jd�S)Nrrr�Z0o)�prefix)r	r
�isdigit�len�setrr)rrZresults�valr
r
r�	transforms"zFixNumliterals.transformN)�__name__�
__module__�__qualname__r�NUMBERZ_accept_typerrr
r
r
rrsrN)Zpgen2r�rZ
fixer_utilrZBaseFixrr
r
r
r�<module>slib2to3/fixes/__pycache__/fix_throw.cpython-38.opt-1.pyc000064400000003413151153537460016763 0ustar00U

e5d.�@sZdZddlmZddlmZddlmZddlmZmZm	Z	m
Z
mZGdd�dej�Z
dS)	z�Fixer for generator.throw(E, V, T).

g.throw(E)       -> g.throw(E)
g.throw(E, V)    -> g.throw(E(V))
g.throw(E, V, T) -> g.throw(E(V).with_traceback(T))

g.throw("foo"[, V[, T]]) will warn about string exceptions.�)�pytree)�token)�
fixer_base)�Name�Call�ArgList�Attr�is_tuplec@seZdZdZdZdd�ZdS)�FixThrowTz�
    power< any trailer< '.' 'throw' >
           trailer< '(' args=arglist< exc=any ',' val=any [',' tb=any] > ')' >
    >
    |
    power< any trailer< '.' 'throw' > trailer< '(' exc=any ')' > >
    cCs�|j}|d��}|jtjkr.|�|d�dS|�d�}|dkrDdS|��}t|�rndd�|jdd�D�}nd|_	|g}|d	}d
|kr�|d
��}d|_	t
||�}	t|	td��t
|g�g}
|�t�|j|
��n|�t
||��dS)N�excz+Python 3 does not support string exceptions�valcSsg|]}|���qS�)�clone)�.0�cr
r
�//usr/lib64/python3.8/lib2to3/fixes/fix_throw.py�
<listcomp>)sz&FixThrow.transform.<locals>.<listcomp>������args�tb�with_traceback)�symsr�typer�STRINGZcannot_convert�getr	Zchildren�prefixrrrr�replacerZNodeZpower)�selfZnodeZresultsrrrrZ
throw_argsr�eZwith_tbr
r
r�	transforms*

zFixThrow.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr!r
r
r
rr
sr
N)�__doc__rrZpgen2rrZ
fixer_utilrrrrr	ZBaseFixr
r
r
r
r�<module>s

lib2to3/fixes/__pycache__/fix_imports.cpython-38.pyc000064400000010446151153537460016362 0ustar00U

e5d4�1@s�dZddlmZddlmZmZddddddd	d
dddd
d
ddddddddddddddddddd d!d"d"d#d$d%d&d'd(d(d(d)d*d*d+d,d-�0Zd.d/�Zefd0d1�ZGd2d3�d3ej	�Z
d4S)5z/Fix incompatible imports and module references.�)�
fixer_base)�Name�
attr_chain�io�pickle�builtins�copyregZqueueZsocketserverZconfigparser�reprlibztkinter.filedialogztkinter.simpledialogztkinter.colorchooserztkinter.commondialogztkinter.dialogztkinter.dndztkinter.fontztkinter.messageboxztkinter.scrolledtextztkinter.constantsztkinter.tixztkinter.ttkZtkinterZ_markupbase�winreg�_threadZ
_dummy_threadzdbm.bsdzdbm.dumbzdbm.ndbmzdbm.gnuz
xmlrpc.clientz
xmlrpc.serverzhttp.clientz
html.entitieszhtml.parserzhttp.cookieszhttp.cookiejarzhttp.server�
subprocess�collectionszurllib.parsezurllib.robotparser)0�StringIOZ	cStringIOZcPickleZ__builtin__Zcopy_regZQueueZSocketServerZConfigParser�reprZ
FileDialogZtkFileDialogZSimpleDialogZtkSimpleDialogZtkColorChooserZtkCommonDialogZDialogZTkdndZtkFontZtkMessageBoxZScrolledTextZTkconstantsZTixZttkZTkinterZ
markupbase�_winreg�threadZdummy_threadZdbhashZdumbdbmZdbmZgdbmZ	xmlrpclibZDocXMLRPCServerZSimpleXMLRPCServerZhttplibZhtmlentitydefsZ
HTMLParserZCookieZ	cookielibZBaseHTTPServerZSimpleHTTPServerZ
CGIHTTPServerZcommands�
UserString�UserListZurlparseZrobotparsercCsdd�tt|��dS)N�(�|�))�join�mapr)�members�r�1/usr/lib64/python3.8/lib2to3/fixes/fix_imports.py�
alternates=srccsTd�dd�|D��}t|���}d||fVd|Vd||fVd|VdS)Nz | cSsg|]}d|�qS)zmodule_name='%s'r)�.0�keyrrr�
<listcomp>Bsz!build_pattern.<locals>.<listcomp>zyname_import=import_name< 'import' ((%s) |
               multiple_imports=dotted_as_names< any* (%s) any* >) >
          z�import_from< 'from' (%s) 'import' ['(']
              ( any | import_as_name< any 'as' any > |
                import_as_names< any* >)  [')'] >
          z�import_name< 'import' (dotted_as_name< (%s) 'as' any > |
               multiple_imports=dotted_as_names<
                 any* dotted_as_name< (%s) 'as' any > any* >) >
          z3power< bare_with_attr=(%s) trailer<'.' any > any* >)rr�keys)�mappingZmod_listZ
bare_namesrrr�
build_patternAs���r"csTeZdZdZdZeZdZdd�Z�fdd�Z	�fdd�Z
�fd	d
�Zdd�Z�Z
S)
�
FixImportsT�cCsd�t|j��S)Nr)rr"r!��selfrrrr"`szFixImports.build_patterncs|��|_tt|���dS�N)r"ZPATTERN�superr#�compile_patternr%��	__class__rrr)cs
zFixImports.compile_patterncsHtt|�j��|�}|rDd|kr@t�fdd�t|d�D��r@dS|SdS)N�bare_with_attrc3s|]}�|�VqdSr'r)r�obj��matchrr�	<genexpr>qsz#FixImports.match.<locals>.<genexpr>�parentF)r(r#r/�anyr)r&�node�resultsr*r.rr/js�zFixImports.matchcstt|��||�i|_dSr')r(r#�
start_tree�replace)r&Ztree�filenamer*rrr5vszFixImports.start_treecCs�|�d�}|rh|j}|j|}|�t||jd��d|krD||j|<d|kr�|�|�}|r�|�||�n2|dd}|j�|j�}|r�|�t||jd��dS)NZmodule_name)�prefixZname_importZmultiple_importsr,�)�get�valuer!r6rr8r/�	transform)r&r3r4Z
import_modZmod_name�new_nameZ	bare_namerrrr<zs



zFixImports.transform)�__name__�
__module__�__qualname__Z
BM_compatibleZkeep_line_order�MAPPINGr!Z	run_orderr"r)r/r5r<�
__classcell__rrr*rr#Usr#N)�__doc__�rZ
fixer_utilrrrArr"ZBaseFixr#rrrr�<module>sl�5lib2to3/fixes/__pycache__/fix_standarderror.cpython-38.opt-2.pyc000064400000001225151153537460020472 0ustar00U

e5d��@s.ddlmZddlmZGdd�dej�ZdS)�)�
fixer_base)�Namec@seZdZdZdZdd�ZdS)�FixStandarderrorTz-
              'StandardError'
              cCstd|jd�S)N�	Exception)�prefix)rr)�selfZnodeZresults�r�7/usr/lib64/python3.8/lib2to3/fixes/fix_standarderror.py�	transformszFixStandarderror.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr
rrrr	rsrN)�rZ
fixer_utilrZBaseFixrrrrr	�<module>slib2to3/fixes/__pycache__/fix_buffer.cpython-38.pyc000064400000001443151153537460016133 0ustar00U

e5dN�@s2dZddlmZddlmZGdd�dej�ZdS)z4Fixer that changes buffer(...) into memoryview(...).�)�
fixer_base)�Namec@s eZdZdZdZdZdd�ZdS)�	FixBufferTzR
              power< name='buffer' trailer< '(' [any] ')' > any* >
              cCs |d}|�td|jd��dS)N�name�
memoryview)�prefix)�replacerr)�selfZnodeZresultsr�r
�0/usr/lib64/python3.8/lib2to3/fixes/fix_buffer.py�	transformszFixBuffer.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZexplicitZPATTERNrr
r
r
rrsrN)�__doc__�rZ
fixer_utilrZBaseFixrr
r
r
r�<module>slib2to3/fixes/__pycache__/fix_operator.cpython-38.opt-2.pyc000064400000007223151153537460017457 0ustar00U

e5db
�@sJddlZddlmZddlmZmZmZmZdd�Z	Gdd�dej
�ZdS)�N)�
fixer_base)�Call�Name�String�touch_importcs�fdd�}|S)Ncs
�|_|S�N)�
invocation)�f��s��2/usr/lib64/python3.8/lib2to3/fixes/fix_operator.py�decszinvocation.<locals>.decr)rrrr
r
rsrc@s�eZdZdZdZdZdZdeeed�Zdd�Z	e
d	�d
d��Ze
d�d
d��Ze
d�dd��Z
e
d�dd��Ze
d�dd��Ze
d�dd��Ze
d�dd��Zdd�Zd d!�Zd"d#�Zd$S)%�FixOperatorTZprez�
              method=('isCallable'|'sequenceIncludes'
                     |'isSequenceType'|'isMappingType'|'isNumberType'
                     |'repeat'|'irepeat')
              z'(' obj=any ')'z�
              power< module='operator'
                trailer< '.' %(methods)s > trailer< %(obj)s > >
              |
              power< %(methods)s trailer< %(obj)s > >
              )�methods�objcCs"|�||�}|dk	r|||�SdSr)�
_check_method)�self�node�results�methodrrr
�	transform+szFixOperator.transformzoperator.contains(%s)cCs|�||d�S)N�contains��_handle_rename�rrrrrr
�_sequenceIncludes0szFixOperator._sequenceIncludeszcallable(%s)cCs"|d}ttd�|��g|jd�S)Nr�callable��prefix)rr�cloner)rrrrrrr
�_isCallable4szFixOperator._isCallablezoperator.mul(%s)cCs|�||d�S)N�mulrrrrr
�_repeat9szFixOperator._repeatzoperator.imul(%s)cCs|�||d�S)N�imulrrrrr
�_irepeat=szFixOperator._irepeatz(isinstance(%s, collections.abc.Sequence)cCs|�||dd�S)N�collections.abc�Sequence��_handle_type2abcrrrr
�_isSequenceTypeAszFixOperator._isSequenceTypez'isinstance(%s, collections.abc.Mapping)cCs|�||dd�S)Nr&�Mappingr(rrrr
�_isMappingTypeEszFixOperator._isMappingTypezisinstance(%s, numbers.Number)cCs|�||dd�S)NZnumbers�Numberr(rrrr
�
_isNumberTypeIszFixOperator._isNumberTypecCs|dd}||_|��dS)Nrr)�valueZchanged)rrr�namerrrr
rMszFixOperator._handle_renamecCsFtd||�|d}|��tdd�||g��g}ttd�||jd�S)Nrz, �.�
isinstancer)rr r�joinrrr)rrr�module�abcr�argsrrr
r)RszFixOperator._handle_type2abccCs^t|d|ddj�}t|tjj�rZd|kr2|St|d�f}|j|}|�|d|�dS)N�_rrr4rzYou should use '%s' here.)	�getattrr/r2�collectionsr5�Callable�strrZwarning)rrrr�subZinvocation_strrrr
rXs
zFixOperator._check_methodN)�__name__�
__module__�__qualname__Z
BM_compatible�orderrr�dictZPATTERNrrrr!r#r%r*r,r.rr)rrrrr
rs2
�






r)Zcollections.abcr9Zlib2to3rZlib2to3.fixer_utilrrrrrZBaseFixrrrrr
�<module>slib2to3/fixes/__pycache__/fix_future.cpython-38.opt-1.pyc000064400000001413151153537460017130 0ustar00U

e5d#�@s2dZddlmZddlmZGdd�dej�ZdS)zVRemove __future__ imports

from __future__ import foo is replaced with an empty line.
�)�
fixer_base)�	BlankLinec@s eZdZdZdZdZdd�ZdS)�	FixFutureTz;import_from< 'from' module_name="__future__" 'import' any >�
cCst�}|j|_|S)N)r�prefix)�selfZnodeZresults�new�r	�0/usr/lib64/python3.8/lib2to3/fixes/fix_future.py�	transformszFixFuture.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNZ	run_orderrr	r	r	r
rsrN)�__doc__�rZ
fixer_utilrZBaseFixrr	r	r	r
�<module>slib2to3/fixes/__pycache__/fix_getcwdu.cpython-38.opt-2.pyc000064400000001315151153537460017262 0ustar00U

e5d��@s.ddlmZddlmZGdd�dej�ZdS)�)�
fixer_base)�Namec@seZdZdZdZdd�ZdS)�
FixGetcwduTzR
              power< 'os' trailer< dot='.' name='getcwdu' > any* >
              cCs |d}|�td|jd��dS)N�name�getcwd)�prefix)�replacerr)�selfZnodeZresultsr�r
�1/usr/lib64/python3.8/lib2to3/fixes/fix_getcwdu.py�	transformszFixGetcwdu.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrr
r
r
rr
srN)�rZ
fixer_utilrZBaseFixrr
r
r
r�<module>slib2to3/fixes/__pycache__/fix_operator.cpython-38.opt-1.pyc000064400000010167151153537460017457 0ustar00U

e5db
�@sNdZddlZddlmZddlmZmZmZm	Z	dd�Z
Gdd�dej�ZdS)	a�Fixer for operator functions.

operator.isCallable(obj)       -> callable(obj)
operator.sequenceIncludes(obj) -> operator.contains(obj)
operator.isSequenceType(obj)   -> isinstance(obj, collections.abc.Sequence)
operator.isMappingType(obj)    -> isinstance(obj, collections.abc.Mapping)
operator.isNumberType(obj)     -> isinstance(obj, numbers.Number)
operator.repeat(obj, n)        -> operator.mul(obj, n)
operator.irepeat(obj, n)       -> operator.imul(obj, n)
�N)�
fixer_base)�Call�Name�String�touch_importcs�fdd�}|S)Ncs
�|_|S�N)�
invocation)�f��s��2/usr/lib64/python3.8/lib2to3/fixes/fix_operator.py�decszinvocation.<locals>.decr)rrrr
r
rsrc@s�eZdZdZdZdZdZdeeed�Zdd�Z	e
d	�d
d��Ze
d�d
d��Ze
d�dd��Z
e
d�dd��Ze
d�dd��Ze
d�dd��Ze
d�dd��Zdd�Zd d!�Zd"d#�Zd$S)%�FixOperatorTZprez�
              method=('isCallable'|'sequenceIncludes'
                     |'isSequenceType'|'isMappingType'|'isNumberType'
                     |'repeat'|'irepeat')
              z'(' obj=any ')'z�
              power< module='operator'
                trailer< '.' %(methods)s > trailer< %(obj)s > >
              |
              power< %(methods)s trailer< %(obj)s > >
              )�methods�objcCs"|�||�}|dk	r|||�SdSr)�
_check_method)�self�node�results�methodrrr
�	transform+szFixOperator.transformzoperator.contains(%s)cCs|�||d�S)N�contains��_handle_rename�rrrrrr
�_sequenceIncludes0szFixOperator._sequenceIncludeszcallable(%s)cCs"|d}ttd�|��g|jd�S)Nr�callable��prefix)rr�cloner)rrrrrrr
�_isCallable4szFixOperator._isCallablezoperator.mul(%s)cCs|�||d�S)N�mulrrrrr
�_repeat9szFixOperator._repeatzoperator.imul(%s)cCs|�||d�S)N�imulrrrrr
�_irepeat=szFixOperator._irepeatz(isinstance(%s, collections.abc.Sequence)cCs|�||dd�S)N�collections.abc�Sequence��_handle_type2abcrrrr
�_isSequenceTypeAszFixOperator._isSequenceTypez'isinstance(%s, collections.abc.Mapping)cCs|�||dd�S)Nr&�Mappingr(rrrr
�_isMappingTypeEszFixOperator._isMappingTypezisinstance(%s, numbers.Number)cCs|�||dd�S)NZnumbers�Numberr(rrrr
�
_isNumberTypeIszFixOperator._isNumberTypecCs|dd}||_|��dS)Nrr)�valueZchanged)rrr�namerrrr
rMszFixOperator._handle_renamecCsFtd||�|d}|��tdd�||g��g}ttd�||jd�S)Nrz, �.�
isinstancer)rr r�joinrrr)rrr�module�abcr�argsrrr
r)RszFixOperator._handle_type2abccCs^t|d|ddj�}t|tjj�rZd|kr2|St|d�f}|j|}|�|d|�dS)N�_rrr4rzYou should use '%s' here.)	�getattrr/r2�collectionsr5�Callable�strrZwarning)rrrr�subZinvocation_strrrr
rXs
zFixOperator._check_methodN)�__name__�
__module__�__qualname__Z
BM_compatible�orderrr�dictZPATTERNrrrr!r#r%r*r,r.rr)rrrrr
rs2
�






r)
�__doc__Zcollections.abcr9Zlib2to3rZlib2to3.fixer_utilrrrrrZBaseFixrrrrr
�<module>s
lib2to3/fixes/__pycache__/fix_long.cpython-38.opt-2.pyc000064400000001174151153537460016562 0ustar00U

e5d��@s.ddlmZddlmZGdd�dej�ZdS)�)�
fixer_base)�is_probably_builtinc@seZdZdZdZdd�ZdS)�FixLongTz'long'cCst|�rd|_|��dS)N�int)r�valueZchanged)�selfZnodeZresults�r�./usr/lib64/python3.8/lib2to3/fixes/fix_long.py�	transformszFixLong.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr
rrrr	rsrN)Zlib2to3rZlib2to3.fixer_utilrZBaseFixrrrrr	�<module>slib2to3/fixes/__pycache__/fix_raise.cpython-38.opt-1.pyc000064400000004310151153537460016720 0ustar00U

e5dn�@sZdZddlmZddlmZddlmZddlmZmZm	Z	m
Z
mZGdd�dej�Z
dS)	a[Fixer for 'raise E, V, T'

raise         -> raise
raise E       -> raise E
raise E, V    -> raise E(V)
raise E, V, T -> raise E(V).with_traceback(T)
raise E, None, T -> raise E.with_traceback(T)

raise (((E, E'), E''), E'''), V -> raise E(V)
raise "foo", V, T               -> warns about string exceptions


CAVEATS:
1) "raise E, V" will be incorrectly translated if V is an exception
   instance. The correct Python 3 idiom is

        raise E from V

   but since we can't detect instance-hood by syntax alone and since
   any client code would have to be changed as well, we don't automate
   this.
�)�pytree)�token)�
fixer_base)�Name�Call�Attr�ArgList�is_tuplec@seZdZdZdZdd�ZdS)�FixRaiseTzB
    raise_stmt< 'raise' exc=any [',' val=any [',' tb=any]] >
    cCsh|j}|d��}|jtjkr2d}|�||�dSt|�r^t|�rX|jdjd��}q:d|_d|kr�t	�
|jtd�|g�}|j|_|S|d��}t|�r�dd	�|jdd
�D�}nd|_|g}d|k�rB|d��}	d|	_|}
|jtj
ks�|jd
k�rt||�}
t|
td��t|	g�g}t	�
|jtd�g|�}|j|_|St	j
|jtd�t||�g|jd�SdS)N�excz+Python 3 does not support string exceptions��� �val�raisecSsg|]}|���qS�)�clone)�.0�crr�//usr/lib64/python3.8/lib2to3/fixes/fix_raise.py�
<listcomp>Dsz&FixRaise.transform.<locals>.<listcomp>�����tb�None�with_traceback)�prefix)�symsr�typer�STRINGZcannot_convertr	ZchildrenrrZNodeZ
raise_stmtr�NAME�valuerrrZsimple_stmt)�selfZnodeZresultsrr�msg�newr�argsr�eZwith_tbrrr�	transform&sB

�zFixRaise.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr'rrrrr
sr
N)�__doc__rrZpgen2rrZ
fixer_utilrrrrr	ZBaseFixr
rrrr�<module>s
lib2to3/fixes/__pycache__/fix_future.cpython-38.opt-2.pyc000064400000001244151153537460017133 0ustar00U

e5d#�@s.ddlmZddlmZGdd�dej�ZdS)�)�
fixer_base)�	BlankLinec@s eZdZdZdZdZdd�ZdS)�	FixFutureTz;import_from< 'from' module_name="__future__" 'import' any >�
cCst�}|j|_|S)N)r�prefix)�selfZnodeZresults�new�r	�0/usr/lib64/python3.8/lib2to3/fixes/fix_future.py�	transformszFixFuture.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNZ	run_orderrr	r	r	r
rsrN)�rZ
fixer_utilrZBaseFixrr	r	r	r
�<module>slib2to3/fixes/__pycache__/fix_asserts.cpython-38.opt-2.pyc000064400000002264151153537460017310 0ustar00U

e5d��@sPddlmZddlmZeddddddd	dddddd
dd�ZGd
d�de�ZdS)�)�BaseFix)�NameZ
assertTrueZassertEqualZassertNotEqualZassertAlmostEqualZassertNotAlmostEqualZassertRegexZassertRaisesRegexZassertRaisesZassertFalse)Zassert_ZassertEqualsZassertNotEqualsZassertAlmostEqualsZassertNotAlmostEqualsZassertRegexpMatchesZassertRaisesRegexpZfailUnlessEqualZfailIfEqualZfailUnlessAlmostEqualZfailIfAlmostEqualZ
failUnlessZfailUnlessRaisesZfailIfc@s(eZdZdd�eee��Zdd�ZdS)�
FixAssertszH
              power< any+ trailer< '.' meth=(%s)> any* >
              �|cCs,|dd}|�ttt|�|jd��dS)NZmeth�)�prefix)�replacer�NAMES�strr)�selfZnodeZresults�name�r
�1/usr/lib64/python3.8/lib2to3/fixes/fix_asserts.py�	transform szFixAsserts.transformN)	�__name__�
__module__�__qualname__�join�map�reprr	ZPATTERNrr
r
r
rrs�rN)Z
fixer_baserZ
fixer_utilr�dictr	rr
r
r
r�<module>s$�lib2to3/fixes/__pycache__/fix_tuple_params.cpython-38.opt-2.pyc000064400000010234151153537460020314 0ustar00U

e5d��@s�ddlmZddlmZddlmZddlmZmZmZm	Z	m
Z
mZdd�ZGdd�dej
�Zd	d
�Zdd�Zgd
fdd�Zdd�Zd
S)�)�pytree)�token)�
fixer_base)�Assign�Name�Newline�Number�	Subscript�symscCst|tj�o|jdjtjkS)N�)�
isinstancer�Node�children�typer�STRING)�stmt�r�6/usr/lib64/python3.8/lib2to3/fixes/fix_tuple_params.py�is_docstrings�rc@s(eZdZdZdZdZdd�Zdd�ZdS)	�FixTupleParams�Ta
              funcdef< 'def' any parameters< '(' args=any ')' >
                       ['->' any] ':' suite=any+ >
              |
              lambda=
              lambdef< 'lambda' args=vfpdef< '(' inner=any ')' >
                       ':' body=any
              >
              cs�d|kr��||�Sg�|d}|d}|djdjtjkrZd}|djdj}t��nd}d}t�tjd��d���fd
d�	}|jt	j
kr�||�n<|jt	jkr�t|j�D]$\}}	|	jt	j
kr�||	|dkd�q��s�dS�D]}
|d|
_
q�|}|dk�r
d
�d_n&t|dj|��r0|�d_|d}�D]}
|d|
_
�q4�|dj||�<t|d|t��d�D]}||dj|_�qr|d��dS)N�lambda�suite�argsr�rz; �Fcs\t����}|��}d|_t||���}|r2d|_|�|���t�t	j
|���g��dS)Nr� )r�new_name�clone�prefixr�replace�appendrr
r
Zsimple_stmt)Z	tuple_arg�
add_prefix�n�argr��endZ	new_lines�selfrr�handle_tupleCs

�z.FixTupleParams.transform.<locals>.handle_tuple)r"r)F)�transform_lambdarrr�INDENT�valuerrZLeafr
ZtfpdefZ
typedargslist�	enumerate�parentrr�range�lenZchanged)r'�node�resultsrr�start�indentr(�ir$�lineZafterrr%r�	transform.sF


zFixTupleParams.transformc
Cs�|d}|d}t|d�}|jtjkrD|��}d|_|�|�dSt|�}t|�}|�	t
|��}t|dd�}	|�|	���|��D]X}
|
jtjkr�|
j
|kr�dd�||
j
D�}t�tj|	��g|�}|
j|_|
�|�q�dS)Nr�body�innerr)rcSsg|]}|���qSr)r��.0�crrr�
<listcomp>�sz3FixTupleParams.transform_lambda.<locals>.<listcomp>)�
simplify_argsrr�NAMErrr �find_params�map_to_indexr�
tuple_namerZ
post_orderr+rr
r
Zpower)
r'r0r1rr7r8ZparamsZto_indexZtup_nameZ	new_paramr#Z
subscripts�newrrrr)ns*
�zFixTupleParams.transform_lambdaN)�__name__�
__module__�__qualname__Z	run_orderZ
BM_compatibleZPATTERNr6r)rrrrrs

@rcCsN|jtjtjfkr|S|jtjkr>|jtjkr:|jd}q"|Std|��dS)NrzReceived unexpected node %s)rr
Zvfplistrr>�vfpdefr�RuntimeError�r0rrrr=�sr=cCs<|jtjkrt|jd�S|jtjkr,|jSdd�|jD�S)NrcSs g|]}|jtjkrt|��qSr)rr�COMMAr?r9rrrr<�szfind_params.<locals>.<listcomp>)rr
rFr?rrr>r+rHrrrr?�s
r?NcCsZ|dkri}t|�D]@\}}ttt|���g}t|t�rHt|||d�q||||<q|S)N)�d)r,r	r�strr�listr@)�
param_listrrJr4�objZtrailerrrrr@�s
r@cCs<g}|D](}t|t�r&|�t|��q|�|�qd�|�S)N�_)rrLr!rA�join)rM�lrNrrrrA�s
rA)rrZpgen2rrZ
fixer_utilrrrrr	r
rZBaseFixrr=r?r@rArrrr�<module>s llib2to3/fixes/__pycache__/fix_map.cpython-38.opt-1.pyc000064400000006024151153537460016376 0ustar00U

e5d8�@sfdZddlmZddlmZddlmZmZmZm	Z	m
Z
ddlmZ
ddlmZGdd�dej�Zd	S)
aFixer that changes map(F, ...) into list(map(F, ...)) unless there
exists a 'from future_builtins import map' statement in the top-level
namespace.

As a special case, map(None, X) is changed into list(X).  (This is
necessary because the semantics are changed in this case -- the new
map(None, X) is equivalent to [(x,) for x in X].)

We avoid the transformation (except for the special case mentioned
above) if the map() call is directly contained in iter(<>), list(<>),
tuple(<>), sorted(<>), ...join(<>), or for V in <>:.

NOTE: This is still not correct if the original code was depending on
map(F, X, Y, ...) to go on until the longest argument is exhausted,
substituting None for missing values -- like zip(), it now stops as
soon as the shortest argument is exhausted.
�)�token)�
fixer_base)�Name�ArgList�Call�ListComp�in_special_context)�python_symbols)�Nodec@s eZdZdZdZdZdd�ZdS)�FixMapTaL
    map_none=power<
        'map'
        trailer< '(' arglist< 'None' ',' arg=any [','] > ')' >
        [extra_trailers=trailer*]
    >
    |
    map_lambda=power<
        'map'
        trailer<
            '('
            arglist<
                lambdef< 'lambda'
                         (fp=NAME | vfpdef< '(' fp=NAME ')'> ) ':' xp=any
                >
                ','
                it=any
            >
            ')'
        >
        [extra_trailers=trailer*]
    >
    |
    power<
        'map' args=trailer< '(' [any] ')' >
        [extra_trailers=trailer*]
    >
    zfuture_builtins.mapcCs�|�|�rdSg}d|kr6|dD]}|�|���q"|jjtjkrr|�|d�|��}d|_t	t
d�|g�}�n&d|kr�t|d��|d��|d���}ttj
|g|dd	�}n�d
|kr�|d��}d|_n�d|k�rf|d}|jtjk�rH|jd
jtjk�rH|jd
jdjtjk�rH|jd
jdjdk�rH|�|d�dSttj
t
d�|��g�}d|_t|��rtdSttj
t
d�t|g�g|�}d|_|j|_|S)NZextra_trailerszYou should use a for loop here��listZ
map_lambdaZxp�fp�it)�prefixZmap_none�arg�args���Nonezjcannot convert map(None, ...) with multiple arguments because map() now truncates to the shortest sequence�map)Zshould_skip�appendZclone�parent�type�symsZsimple_stmtZwarningrrrrr
ZpowerZtrailerZchildrenZarglistr�NAME�valuerr)�selfZnodeZresultsZtrailers�t�newr�r �-/usr/lib64/python3.8/lib2to3/fixes/fix_map.py�	transform@sN


�
���
zFixMap.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNZskip_onr"r r r r!rsrN)�__doc__Zpgen2rrrZ
fixer_utilrrrrrZpygramr	rZpytreer
ZConditionalFixrr r r r!�<module>slib2to3/fixes/__pycache__/fix_getcwdu.cpython-38.opt-1.pyc000064400000001417151153537460017264 0ustar00U

e5d��@s2dZddlmZddlmZGdd�dej�ZdS)z1
Fixer that changes os.getcwdu() to os.getcwd().
�)�
fixer_base)�Namec@seZdZdZdZdd�ZdS)�
FixGetcwduTzR
              power< 'os' trailer< dot='.' name='getcwdu' > any* >
              cCs |d}|�td|jd��dS)N�name�getcwd)�prefix)�replacerr)�selfZnodeZresultsr�r
�1/usr/lib64/python3.8/lib2to3/fixes/fix_getcwdu.py�	transformszFixGetcwdu.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrr
r
r
rr
srN)�__doc__�rZ
fixer_utilrZBaseFixrr
r
r
r�<module>slib2to3/fixes/__pycache__/fix_basestring.cpython-38.pyc000064400000001222151153537460017016 0ustar00U

e5d@�@s2dZddlmZddlmZGdd�dej�ZdS)zFixer for basestring -> str.�)�
fixer_base)�Namec@seZdZdZdZdd�ZdS)�
FixBasestringTz'basestring'cCstd|jd�S)N�str)�prefix)rr)�selfZnodeZresults�r�4/usr/lib64/python3.8/lib2to3/fixes/fix_basestring.py�	transform
szFixBasestring.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr
rrrr	rsrN)�__doc__�rZ
fixer_utilrZBaseFixrrrrr	�<module>slib2to3/fixes/__pycache__/fix_exitfunc.cpython-38.opt-1.pyc000064400000004375151153537460017455 0ustar00U

e5d�	�@sJdZddlmZmZddlmZmZmZmZm	Z	m
Z
Gdd�dej�ZdS)z7
Convert use of sys.exitfunc to use the atexit module.
�)�pytree�
fixer_base)�Name�Attr�Call�Comma�Newline�symscs<eZdZdZdZdZ�fdd�Z�fdd�Zdd�Z�Z	S)	�FixExitfuncTa�
              (
                  sys_import=import_name<'import'
                      ('sys'
                      |
                      dotted_as_names< (any ',')* 'sys' (',' any)* >
                      )
                  >
              |
                  expr_stmt<
                      power< 'sys' trailer< '.' 'exitfunc' > >
                  '=' func=any >
              )
              cstt|�j|�dS�N)�superr
�__init__)�self�args��	__class__��2/usr/lib64/python3.8/lib2to3/fixes/fix_exitfunc.pyr
szFixExitfunc.__init__cstt|��||�d|_dSr)rr
�
start_tree�
sys_import)rZtree�filenamerrrr!szFixExitfunc.start_treecCs&d|kr |jdkr|d|_dS|d��}d|_t�tjttd�td���}t	||g|j�}|�
|�|jdkr�|�|d�dS|jjd}|j
tjkr�|�t��|�tdd��nj|jj}|j�|j�}|j}	t�tjtd	�tdd�g�}
t�tj|
g�}|�|dt��|�|d
|�dS)Nr�func��atexit�registerzKCan't find sys import; Please add an atexit import at the top of your file.�� �import�)rZclone�prefixrZNoder	Zpowerrrr�replaceZwarningZchildren�typeZdotted_as_namesZappend_childr�parent�indexZimport_nameZsimple_stmtZinsert_childr)rZnodeZresultsrrZcall�namesZcontaining_stmtZpositionZstmt_containerZ
new_import�newrrr�	transform%s6

�

�zFixExitfunc.transform)
�__name__�
__module__�__qualname__Zkeep_line_orderZ
BM_compatibleZPATTERNr
rr&�
__classcell__rrrrr
sr
N)
�__doc__Zlib2to3rrZlib2to3.fixer_utilrrrrrr	ZBaseFixr
rrrr�<module>s lib2to3/fixes/__pycache__/fix_paren.cpython-38.opt-2.pyc000064400000002343151153537460016727 0ustar00U

e5d��@s2ddlmZddlmZmZGdd�dej�ZdS)�)�
fixer_base)�LParen�RParenc@seZdZdZdZdd�ZdS)�FixParenTa
        atom< ('[' | '(')
            (listmaker< any
                comp_for<
                    'for' NAME 'in'
                    target=testlist_safe< any (',' any)+ [',']
                     >
                    [any]
                >
            >
            |
            testlist_gexp< any
                comp_for<
                    'for' NAME 'in'
                    target=testlist_safe< any (',' any)+ [',']
                     >
                    [any]
                >
            >)
        (']' | ')') >
    cCs8|d}t�}|j|_d|_|�d|�|�t��dS)N�target��)r�prefixZinsert_childZappend_childr)�selfZnodeZresultsrZlparen�r�//usr/lib64/python3.8/lib2to3/fixes/fix_paren.py�	transform%szFixParen.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr
rrrrrsrN)rrZ
fixer_utilrrZBaseFixrrrrr�<module>slib2to3/fixes/__pycache__/fix_exec.cpython-38.pyc000064400000002170151153537460015604 0ustar00U

e5d��@s:dZddlmZddlmZmZmZGdd�dej�ZdS)z�Fixer for exec.

This converts usages of the exec statement into calls to a built-in
exec() function.

exec code in ns1, ns2 -> exec(code, ns1, ns2)
�)�
fixer_base)�Comma�Name�Callc@seZdZdZdZdd�ZdS)�FixExecTzx
    exec_stmt< 'exec' a=any 'in' b=any [',' c=any] >
    |
    exec_stmt< 'exec' (not atom<'(' [any] ')'>) a=any >
    cCs�|st�|j}|d}|�d�}|�d�}|��g}d|d_|dk	rZ|�t�|��g�|dk	rv|�t�|��g�ttd�||jd�S)N�a�b�c���exec)�prefix)	�AssertionError�syms�getZcloner
�extendrrr)�selfZnodeZresultsrrrr	�args�r�./usr/lib64/python3.8/lib2to3/fixes/fix_exec.py�	transforms



zFixExec.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrrrrrrsrN)	�__doc__r
rZ
fixer_utilrrrZBaseFixrrrrr�<module>s	lib2to3/fixes/__pycache__/__init__.cpython-38.pyc000064400000000211151153537460015543 0ustar00U

e5d/�@sdS)N�rrr�./usr/lib64/python3.8/lib2to3/fixes/__init__.py�<module>�lib2to3/fixes/__pycache__/fix_set_literal.cpython-38.opt-2.pyc000064400000003103151153537460020124 0ustar00U

e5d��@s6ddlmZmZddlmZmZGdd�dej�ZdS)�)�
fixer_base�pytree)�token�symsc@s eZdZdZdZdZdd�ZdS)�
FixSetLiteralTajpower< 'set' trailer< '('
                     (atom=atom< '[' (items=listmaker< any ((',' any)* [',']) >
                                |
                                single=any) ']' >
                     |
                     atom< '(' items=testlist_gexp< any ((',' any)* [',']) > ')' >
                     )
                     ')' > >
              c	Cs�|�d�}|r2t�tj|��g�}|�|�|}n|d}t�tj	d�g}|�
dd�|jD��|�t�tj
d��|jj|d_t�tj|�}|j|_t|j�dkr�|jd	}|��|j|jd_|S)
N�single�items�{css|]}|��VqdS)N)�clone)�.0�n�r
�5/usr/lib64/python3.8/lib2to3/fixes/fix_set_literal.py�	<genexpr>'sz*FixSetLiteral.transform.<locals>.<genexpr>�}�����)�getrZNoderZ	listmakerr
�replaceZLeafr�LBRACE�extendZchildren�append�RBRACEZnext_sibling�prefixZdictsetmaker�len�remove)	�selfZnodeZresultsrZfaker�literalZmakerrr
r
r�	transforms"


zFixSetLiteral.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZexplicitZPATTERNrr
r
r
rrs
rN)Zlib2to3rrZlib2to3.fixer_utilrrZBaseFixrr
r
r
r�<module>slib2to3/fixes/__pycache__/fix_long.cpython-38.opt-1.pyc000064400000001274151153537460016562 0ustar00U

e5d��@s2dZddlmZddlmZGdd�dej�ZdS)z/Fixer that turns 'long' into 'int' everywhere.
�)�
fixer_base)�is_probably_builtinc@seZdZdZdZdd�ZdS)�FixLongTz'long'cCst|�rd|_|��dS)N�int)r�valueZchanged)�selfZnodeZresults�r�./usr/lib64/python3.8/lib2to3/fixes/fix_long.py�	transformszFixLong.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr
rrrr	rsrN)�__doc__Zlib2to3rZlib2to3.fixer_utilrZBaseFixrrrrr	�<module>slib2to3/fixes/__pycache__/fix_unicode.cpython-38.opt-1.pyc000064400000003010151153537460017237 0ustar00U

e5d��@s<dZddlmZddlmZddd�ZGdd�dej�Zd	S)
z�Fixer for unicode.

* Changes unicode to str and unichr to chr.

* If "...\u..." is not unicode literal change it into "...\\u...".

* Change u"..." into "...".

�)�token)�
fixer_base�chr�str)ZunichrZunicodecs,eZdZdZdZ�fdd�Zdd�Z�ZS)�
FixUnicodeTzSTRING | 'unicode' | 'unichr'cs"tt|��||�d|jk|_dS)N�unicode_literals)�superr�
start_treeZfuture_featuresr)�selfZtree�filename��	__class__��1/usr/lib64/python3.8/lib2to3/fixes/fix_unicode.pyr	szFixUnicode.start_treecCs�|jtjkr$|��}t|j|_|S|jtjkr�|j}|jsj|ddkrjd|krjd�dd�|�	d�D��}|ddkr�|dd�}||jkr�|S|��}||_|SdS)	N�z'"�\z\\cSs g|]}|�dd��dd��qS)z\uz\\uz\Uz\\U)�replace)�.0�vrrr�
<listcomp> s�z(FixUnicode.transform.<locals>.<listcomp>ZuU�)
�typer�NAMEZclone�_mapping�value�STRINGr�join�split)r
ZnodeZresults�new�valrrr�	transforms"
�
zFixUnicode.transform)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr	r �
__classcell__rrrrrsrN)�__doc__Zpgen2r�rrZBaseFixrrrrr�<module>s

lib2to3/fixes/__pycache__/fix_intern.cpython-38.opt-1.pyc000064400000002151151153537460017115 0ustar00U

e5dx�@s6dZddlmZddlmZmZGdd�dej�ZdS)z/Fixer for intern().

intern(s) -> sys.intern(s)�)�
fixer_base)�
ImportAndCall�touch_importc@s eZdZdZdZdZdd�ZdS)�	FixInternTZprez�
    power< 'intern'
           trailer< lpar='('
                    ( not(arglist | argument<any '=' any>) obj=any
                      | obj=arglist<(not argument<any '=' any>) any ','> )
                    rpar=')' >
           after=any*
    >
    cCsR|r2|d}|r2|j|jjkr2|jdjdkr2dSd}t|||�}tdd|�|S)N�obj�>�**�*)�sys�internr
)�typeZsymsZargumentZchildren�valuerr)�selfZnodeZresultsr�names�new�r�0/usr/lib64/python3.8/lib2to3/fixes/fix_intern.py�	transforms�zFixIntern.transformN)�__name__�
__module__�__qualname__Z
BM_compatible�orderZPATTERNrrrrrr
s
rN)�__doc__�rZ
fixer_utilrrZBaseFixrrrrr�<module>slib2to3/fixes/__pycache__/fix_getcwdu.cpython-38.pyc000064400000001417151153537460016325 0ustar00U

e5d��@s2dZddlmZddlmZGdd�dej�ZdS)z1
Fixer that changes os.getcwdu() to os.getcwd().
�)�
fixer_base)�Namec@seZdZdZdZdd�ZdS)�
FixGetcwduTzR
              power< 'os' trailer< dot='.' name='getcwdu' > any* >
              cCs |d}|�td|jd��dS)N�name�getcwd)�prefix)�replacerr)�selfZnodeZresultsr�r
�1/usr/lib64/python3.8/lib2to3/fixes/fix_getcwdu.py�	transformszFixGetcwdu.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrr
r
r
rr
srN)�__doc__�rZ
fixer_utilrZBaseFixrr
r
r
r�<module>slib2to3/fixes/__pycache__/fix_funcattrs.cpython-38.pyc000064400000001713151153537460016673 0ustar00U

e5d��@s2dZddlmZddlmZGdd�dej�ZdS)z3Fix function attribute names (f.func_x -> f.__x__).�)�
fixer_base)�Namec@seZdZdZdZdd�ZdS)�FixFuncattrsTz�
    power< any+ trailer< '.' attr=('func_closure' | 'func_doc' | 'func_globals'
                                  | 'func_name' | 'func_defaults' | 'func_code'
                                  | 'func_dict') > any* >
    cCs2|dd}|�td|jdd�|jd��dS)N�attr�z__%s__�)�prefix)�replacer�valuer)�selfZnodeZresultsr�r�3/usr/lib64/python3.8/lib2to3/fixes/fix_funcattrs.py�	transforms�zFixFuncattrs.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrrrrr
r	srN)�__doc__�rZ
fixer_utilrZBaseFixrrrrr
�<module>slib2to3/fixes/__pycache__/fix_sys_exc.cpython-38.pyc000064400000002576151153537460016347 0ustar00U

e5d
�@sJdZddlmZddlmZmZmZmZmZm	Z	m
Z
Gdd�dej�ZdS)z�Fixer for sys.exc_{type, value, traceback}

sys.exc_type -> sys.exc_info()[0]
sys.exc_value -> sys.exc_info()[1]
sys.exc_traceback -> sys.exc_info()[2]
�)�
fixer_base)�Attr�Call�Name�Number�	Subscript�Node�symsc@s:eZdZdddgZdZdd�dd�eD��Zd	d
�ZdS)�	FixSysExc�exc_type�	exc_value�
exc_tracebackTzN
              power< 'sys' trailer< dot='.' attribute=(%s) > >
              �|ccs|]}d|VqdS)z'%s'N�)�.0�err�1/usr/lib64/python3.8/lib2to3/fixes/fix_sys_exc.py�	<genexpr>szFixSysExc.<genexpr>cCst|dd}t|j�|j��}ttd�|jd�}ttd�|�}|dj|djd_|�	t
|��ttj
||jd�S)NZ	attribute��exc_info)�prefix�sys�dot�)rr�index�valuerrrrZchildren�appendrrr	Zpower)�selfZnodeZresultsZsys_attrrZcall�attrrrr�	transformszFixSysExc.transformN)�__name__�
__module__�__qualname__rZ
BM_compatible�joinZPATTERNrrrrrr
s
�r
N)
�__doc__�rZ
fixer_utilrrrrrrr	ZBaseFixr
rrrr�<module>s
$lib2to3/fixes/__pycache__/fix_asserts.cpython-38.opt-1.pyc000064400000002372151153537460017307 0ustar00U

e5d��@sTdZddlmZddlmZedddddd	d
dddddddd
�ZGdd�de�ZdS)z5Fixer that replaces deprecated unittest method names.�)�BaseFix)�NameZ
assertTrueZassertEqualZassertNotEqualZassertAlmostEqualZassertNotAlmostEqualZassertRegexZassertRaisesRegexZassertRaisesZassertFalse)Zassert_ZassertEqualsZassertNotEqualsZassertAlmostEqualsZassertNotAlmostEqualsZassertRegexpMatchesZassertRaisesRegexpZfailUnlessEqualZfailIfEqualZfailUnlessAlmostEqualZfailIfAlmostEqualZ
failUnlessZfailUnlessRaisesZfailIfc@s(eZdZdd�eee��Zdd�ZdS)�
FixAssertszH
              power< any+ trailer< '.' meth=(%s)> any* >
              �|cCs,|dd}|�ttt|�|jd��dS)NZmeth�)�prefix)�replacer�NAMES�strr)�selfZnodeZresults�name�r
�1/usr/lib64/python3.8/lib2to3/fixes/fix_asserts.py�	transform szFixAsserts.transformN)	�__name__�
__module__�__qualname__�join�map�reprr	ZPATTERNrr
r
r
rrs�rN)�__doc__Z
fixer_baserZ
fixer_utilr�dictr	rr
r
r
r�<module>s&�lib2to3/fixes/__pycache__/fix_except.cpython-38.opt-1.pyc000064400000005375151153537460017121 0ustar00U

e5d
�@sfdZddlmZddlmZddlmZddlmZmZm	Z	m
Z
mZmZdd�Z
Gdd	�d	ej�Zd
S)a�Fixer for except statements with named exceptions.

The following cases will be converted:

- "except E, T:" where T is a name:

    except E as T:

- "except E, T:" where T is not a name, tuple or list:

        except E as t:
            T = t

    This is done because the target of an "except" clause must be a
    name.

- "except E, T:" where T is a tuple or list literal:

        except E as t:
            T = t.args
�)�pytree)�token)�
fixer_base)�Assign�Attr�Name�is_tuple�is_list�symsccsDt|�D]6\}}|jtjkr|jdjdkr|||dfVqdS)N��exceptr)�	enumerate�typer
�
except_clause�children�value)Znodes�i�n�r�0/usr/lib64/python3.8/lib2to3/fixes/fix_except.py�find_exceptssrc@seZdZdZdZdd�ZdS)�	FixExceptTa1
    try_stmt< 'try' ':' (simple_stmt | suite)
                  cleanup=(except_clause ':' (simple_stmt | suite))+
                  tail=(['except' ':' (simple_stmt | suite)]
                        ['else' ':' (simple_stmt | suite)]
                        ['finally' ':' (simple_stmt | suite)]) >
    cCsx|j}dd�|dD�}dd�|dD�}t|�D�]\}}t|j�dkr2|jdd�\}}	}
|	�tdd	d
��|
jtjk�r8t|�	�d	d
�}|
�
�}d|_|
�|�|�
�}|j}
t|
�D]\}}t
|tj�r�q�q�t|
�s�t|
�r�t|t|td���}n
t||�}t|
d|��D]}|�d
|��q|�||�q2|
jdkr2d	|
_q2dd�|jdd�D�||}t�|j|�S)NcSsg|]}|���qSr��clone)�.0rrrr�
<listcomp>2sz'FixExcept.transform.<locals>.<listcomp>�tailcSsg|]}|���qSrr)rZchrrrr4sZcleanup���as� )�prefix��argsrcSsg|]}|���qSrr)r�crrrr\s�)r
r�lenr�replacerrr�NAME�new_namerr!r
�
isinstancerZNoderr	rr�reversedZinsert_child)�selfZnodeZresultsr
rZtry_cleanuprZe_suite�EZcomma�NZnew_N�targetZsuite_stmtsrZstmtZassignZchildrrrr�	transform/s6


 zFixExcept.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr0rrrrr$srN)�__doc__r"rZpgen2rrZ
fixer_utilrrrrr	r
rZBaseFixrrrrr�<module>s lib2to3/fixes/__pycache__/fix_input.cpython-38.opt-1.pyc000064400000001661151153537460016762 0ustar00U

e5d��@sLdZddlmZddlmZmZddlmZe�d�ZGdd�dej	�Z
dS)	z4Fixer that changes input(...) into eval(input(...)).�)�
fixer_base)�Call�Name)�patcompz&power< 'eval' trailer< '(' any ')' > >c@seZdZdZdZdd�ZdS)�FixInputTzL
              power< 'input' args=trailer< '(' [any] ')' > >
              cCs6t�|jj�rdS|��}d|_ttd�|g|jd�S)N��eval)�prefix)�context�match�parentZcloner	rr)�selfZnodeZresults�new�r�//usr/lib64/python3.8/lib2to3/fixes/fix_input.py�	transforms
zFixInput.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNrrrrrr
srN)�__doc__rrZ
fixer_utilrrrZcompile_patternr
ZBaseFixrrrrr�<module>s

lib2to3/fixes/__pycache__/fix_buffer.cpython-38.opt-2.pyc000064400000001336151153537460017074 0ustar00U

e5dN�@s.ddlmZddlmZGdd�dej�ZdS)�)�
fixer_base)�Namec@s eZdZdZdZdZdd�ZdS)�	FixBufferTzR
              power< name='buffer' trailer< '(' [any] ')' > any* >
              cCs |d}|�td|jd��dS)N�name�
memoryview)�prefix)�replacerr)�selfZnodeZresultsr�r
�0/usr/lib64/python3.8/lib2to3/fixes/fix_buffer.py�	transformszFixBuffer.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZexplicitZPATTERNrr
r
r
rrsrN)�rZ
fixer_utilrZBaseFixrr
r
r
r�<module>slib2to3/fixes/__pycache__/fix_dict.cpython-38.opt-1.pyc000064400000006275151153537460016554 0ustar00U

e5d��@sjdZddlmZddlmZddlmZddlmZmZmZddlmZej	dhBZ
Gdd	�d	ej�Zd
S)ajFixer for dict methods.

d.keys() -> list(d.keys())
d.items() -> list(d.items())
d.values() -> list(d.values())

d.iterkeys() -> iter(d.keys())
d.iteritems() -> iter(d.items())
d.itervalues() -> iter(d.values())

d.viewkeys() -> d.keys()
d.viewitems() -> d.items()
d.viewvalues() -> d.values()

Except in certain very specific contexts: the iter() can be dropped
when the context is list(), sorted(), iter() or for...in; the list()
can be dropped when the context is list() or sorted() (but not iter()
or for...in!). Special contexts that apply to both: list(), sorted(), tuple()
set(), any(), all(), sum().

Note: iter(d.keys()) could be written as iter(d) but since the
original d.iterkeys() was also redundant we don't fix this.  And there
are (rare) contexts where it makes a difference (e.g. when passing it
as an argument to a function that introspects the argument).
�)�pytree)�patcomp)�
fixer_base)�Name�Call�Dot)�
fixer_util�iterc@s@eZdZdZdZdd�ZdZe�e�Z	dZ
e�e
�Zdd�Zd	S)
�FixDictTa
    power< head=any+
         trailer< '.' method=('keys'|'items'|'values'|
                              'iterkeys'|'iteritems'|'itervalues'|
                              'viewkeys'|'viewitems'|'viewvalues') >
         parens=trailer< '(' ')' >
         tail=any*
    >
    c
	Cs|d}|dd}|d}|j}|j}|�d�}|�d�}	|sD|	rP|dd�}dd	�|D�}d
d	�|D�}|o||�||�}
|t�|jt�t||j	d�g�|d�
�g}t�|j|�}|
s�|	s�d
|_	tt|r�dnd�|g�}|r�t�|j|g|�}|j	|_	|S)N�head�method��tailr	Zview�cSsg|]}|���qS���clone��.0�nrr�./usr/lib64/python3.8/lib2to3/fixes/fix_dict.py�
<listcomp>Asz%FixDict.transform.<locals>.<listcomp>cSsg|]}|���qSrrrrrrrBs)�prefixZparens��list)
�syms�value�
startswith�in_special_contextrZNodeZtrailerrrrrZpowerr)
�self�node�resultsrrrrZmethod_name�isiterZisviewZspecial�args�newrrr�	transform6s:


���
�zFixDict.transformz3power< func=NAME trailer< '(' node=any ')' > any* >zmfor_stmt< 'for' any 'in' node=any ':' any* >
            | comp_for< 'for' any 'in' node=any any* >
         cCs�|jdkrdSi}|jjdk	r^|j�|jj|�r^|d|kr^|rN|djtkS|djtjkS|sfdS|j�|j|�o�|d|kS)NFr �func)�parent�p1�matchr�iter_exemptr�consuming_calls�p2)rr r"r!rrrrZs
�
�zFixDict.in_special_contextN)
�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr%ZP1rZcompile_patternr(ZP2r,rrrrrr
)s


r
N)
�__doc__rrrrrrrrr+r*ZBaseFixr
rrrr�<module>slib2to3/fixes/__pycache__/fix_buffer.cpython-38.opt-1.pyc000064400000001443151153537460017072 0ustar00U

e5dN�@s2dZddlmZddlmZGdd�dej�ZdS)z4Fixer that changes buffer(...) into memoryview(...).�)�
fixer_base)�Namec@s eZdZdZdZdZdd�ZdS)�	FixBufferTzR
              power< name='buffer' trailer< '(' [any] ')' > any* >
              cCs |d}|�td|jd��dS)N�name�
memoryview)�prefix)�replacerr)�selfZnodeZresultsr�r
�0/usr/lib64/python3.8/lib2to3/fixes/fix_buffer.py�	transformszFixBuffer.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZexplicitZPATTERNrr
r
r
rrsrN)�__doc__�rZ
fixer_utilrZBaseFixrr
r
r
r�<module>slib2to3/fixes/__pycache__/fix_raise.cpython-38.opt-2.pyc000064400000003131151153537460016721 0ustar00U

e5dn�@sVddlmZddlmZddlmZddlmZmZmZm	Z	m
Z
Gdd�dej�ZdS)�)�pytree)�token)�
fixer_base)�Name�Call�Attr�ArgList�is_tuplec@seZdZdZdZdd�ZdS)�FixRaiseTzB
    raise_stmt< 'raise' exc=any [',' val=any [',' tb=any]] >
    cCsh|j}|d��}|jtjkr2d}|�||�dSt|�r^t|�rX|jdjd��}q:d|_d|kr�t	�
|jtd�|g�}|j|_|S|d��}t|�r�dd	�|jdd
�D�}nd|_|g}d|k�rB|d��}	d|	_|}
|jtj
ks�|jd
k�rt||�}
t|
td��t|	g�g}t	�
|jtd�g|�}|j|_|St	j
|jtd�t||�g|jd�SdS)N�excz+Python 3 does not support string exceptions��� �val�raisecSsg|]}|���qS�)�clone)�.0�crr�//usr/lib64/python3.8/lib2to3/fixes/fix_raise.py�
<listcomp>Dsz&FixRaise.transform.<locals>.<listcomp>�����tb�None�with_traceback)�prefix)�symsr�typer�STRINGZcannot_convertr	ZchildrenrrZNodeZ
raise_stmtr�NAME�valuerrrZsimple_stmt)�selfZnodeZresultsrr�msg�newr�argsr�eZwith_tbrrr�	transform&sB

�zFixRaise.transformN)�__name__�
__module__�__qualname__Z
BM_compatibleZPATTERNr'rrrrr
sr
N)
rrZpgen2rrZ
fixer_utilrrrrr	ZBaseFixr
rrrr�<module>slib2to3/fixes/fix_xrange.py000064400000005206151153537460011661 0ustar00# Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Fixer that changes xrange(...) into range(...)."""

# Local imports
from .. import fixer_base
from ..fixer_util import Name, Call, consuming_calls
from .. import patcomp


class FixXrange(fixer_base.BaseFix):
    BM_compatible = True
    PATTERN = """
              power<
                 (name='range'|name='xrange') trailer< '(' args=any ')' >
              rest=any* >
              """

    def start_tree(self, tree, filename):
        super(FixXrange, self).start_tree(tree, filename)
        self.transformed_xranges = set()

    def finish_tree(self, tree, filename):
        self.transformed_xranges = None

    def transform(self, node, results):
        name = results["name"]
        if name.value == "xrange":
            return self.transform_xrange(node, results)
        elif name.value == "range":
            return self.transform_range(node, results)
        else:
            raise ValueError(repr(name))

    def transform_xrange(self, node, results):
        name = results["name"]
        name.replace(Name("range", prefix=name.prefix))
        # This prevents the new range call from being wrapped in a list later.
        self.transformed_xranges.add(id(node))

    def transform_range(self, node, results):
        if (id(node) not in self.transformed_xranges and
            not self.in_special_context(node)):
            range_call = Call(Name("range"), [results["args"].clone()])
            # Encase the range call in list().
            list_call = Call(Name("list"), [range_call],
                             prefix=node.prefix)
            # Put things that were after the range() call after the list call.
            for n in results["rest"]:
                list_call.append_child(n)
            return list_call

    P1 = "power< func=NAME trailer< '(' node=any ')' > any* >"
    p1 = patcomp.compile_pattern(P1)

    P2 = """for_stmt< 'for' any 'in' node=any ':' any* >
            | comp_for< 'for' any 'in' node=any any* >
            | comparison< any 'in' node=any any*>
         """
    p2 = patcomp.compile_pattern(P2)

    def in_special_context(self, node):
        if node.parent is None:
            return False
        results = {}
        if (node.parent.parent is not None and
               self.p1.match(node.parent.parent, results) and
               results["node"] is node):
            # list(d.keys()) -> list(d.keys()), etc.
            return results["func"].value in consuming_calls
        # for ... in d.iterkeys() -> for ... in d.keys(), etc.
        return self.p2.match(node.parent, results) and results["node"] is node
lib2to3/fixes/fix_urllib.py000064400000020241151153537460011662 0ustar00"""Fix changes imports of urllib which are now incompatible.
   This is rather similar to fix_imports, but because of the more
   complex nature of the fixing for urllib, it has its own fixer.
"""
# Author: Nick Edds

# Local imports
from lib2to3.fixes.fix_imports import alternates, FixImports
from lib2to3.fixer_util import (Name, Comma, FromImport, Newline,
                                find_indentation, Node, syms)

MAPPING = {"urllib":  [
                ("urllib.request",
                    ["URLopener", "FancyURLopener", "urlretrieve",
                     "_urlopener", "urlopen", "urlcleanup",
                     "pathname2url", "url2pathname"]),
                ("urllib.parse",
                    ["quote", "quote_plus", "unquote", "unquote_plus",
                     "urlencode", "splitattr", "splithost", "splitnport",
                     "splitpasswd", "splitport", "splitquery", "splittag",
                     "splittype", "splituser", "splitvalue", ]),
                ("urllib.error",
                    ["ContentTooShortError"])],
           "urllib2" : [
                ("urllib.request",
                    ["urlopen", "install_opener", "build_opener",
                     "Request", "OpenerDirector", "BaseHandler",
                     "HTTPDefaultErrorHandler", "HTTPRedirectHandler",
                     "HTTPCookieProcessor", "ProxyHandler",
                     "HTTPPasswordMgr",
                     "HTTPPasswordMgrWithDefaultRealm",
                     "AbstractBasicAuthHandler",
                     "HTTPBasicAuthHandler", "ProxyBasicAuthHandler",
                     "AbstractDigestAuthHandler",
                     "HTTPDigestAuthHandler", "ProxyDigestAuthHandler",
                     "HTTPHandler", "HTTPSHandler", "FileHandler",
                     "FTPHandler", "CacheFTPHandler",
                     "UnknownHandler"]),
                ("urllib.error",
                    ["URLError", "HTTPError"]),
           ]
}

# Duplicate the url parsing functions for urllib2.
MAPPING["urllib2"].append(MAPPING["urllib"][1])


def build_pattern():
    bare = set()
    for old_module, changes in MAPPING.items():
        for change in changes:
            new_module, members = change
            members = alternates(members)
            yield """import_name< 'import' (module=%r
                                  | dotted_as_names< any* module=%r any* >) >
                  """ % (old_module, old_module)
            yield """import_from< 'from' mod_member=%r 'import'
                       ( member=%s | import_as_name< member=%s 'as' any > |
                         import_as_names< members=any*  >) >
                  """ % (old_module, members, members)
            yield """import_from< 'from' module_star=%r 'import' star='*' >
                  """ % old_module
            yield """import_name< 'import'
                                  dotted_as_name< module_as=%r 'as' any > >
                  """ % old_module
            # bare_with_attr has a special significance for FixImports.match().
            yield """power< bare_with_attr=%r trailer< '.' member=%s > any* >
                  """ % (old_module, members)


class FixUrllib(FixImports):

    def build_pattern(self):
        return "|".join(build_pattern())

    def transform_import(self, node, results):
        """Transform for the basic import case. Replaces the old
           import name with a comma separated list of its
           replacements.
        """
        import_mod = results.get("module")
        pref = import_mod.prefix

        names = []

        # create a Node list of the replacement modules
        for name in MAPPING[import_mod.value][:-1]:
            names.extend([Name(name[0], prefix=pref), Comma()])
        names.append(Name(MAPPING[import_mod.value][-1][0], prefix=pref))
        import_mod.replace(names)

    def transform_member(self, node, results):
        """Transform for imports of specific module elements. Replaces
           the module to be imported from with the appropriate new
           module.
        """
        mod_member = results.get("mod_member")
        pref = mod_member.prefix
        member = results.get("member")

        # Simple case with only a single member being imported
        if member:
            # this may be a list of length one, or just a node
            if isinstance(member, list):
                member = member[0]
            new_name = None
            for change in MAPPING[mod_member.value]:
                if member.value in change[1]:
                    new_name = change[0]
                    break
            if new_name:
                mod_member.replace(Name(new_name, prefix=pref))
            else:
                self.cannot_convert(node, "This is an invalid module element")

        # Multiple members being imported
        else:
            # a dictionary for replacements, order matters
            modules = []
            mod_dict = {}
            members = results["members"]
            for member in members:
                # we only care about the actual members
                if member.type == syms.import_as_name:
                    as_name = member.children[2].value
                    member_name = member.children[0].value
                else:
                    member_name = member.value
                    as_name = None
                if member_name != ",":
                    for change in MAPPING[mod_member.value]:
                        if member_name in change[1]:
                            if change[0] not in mod_dict:
                                modules.append(change[0])
                            mod_dict.setdefault(change[0], []).append(member)

            new_nodes = []
            indentation = find_indentation(node)
            first = True
            def handle_name(name, prefix):
                if name.type == syms.import_as_name:
                    kids = [Name(name.children[0].value, prefix=prefix),
                            name.children[1].clone(),
                            name.children[2].clone()]
                    return [Node(syms.import_as_name, kids)]
                return [Name(name.value, prefix=prefix)]
            for module in modules:
                elts = mod_dict[module]
                names = []
                for elt in elts[:-1]:
                    names.extend(handle_name(elt, pref))
                    names.append(Comma())
                names.extend(handle_name(elts[-1], pref))
                new = FromImport(module, names)
                if not first or node.parent.prefix.endswith(indentation):
                    new.prefix = indentation
                new_nodes.append(new)
                first = False
            if new_nodes:
                nodes = []
                for new_node in new_nodes[:-1]:
                    nodes.extend([new_node, Newline()])
                nodes.append(new_nodes[-1])
                node.replace(nodes)
            else:
                self.cannot_convert(node, "All module elements are invalid")

    def transform_dot(self, node, results):
        """Transform for calls to module members in code."""
        module_dot = results.get("bare_with_attr")
        member = results.get("member")
        new_name = None
        if isinstance(member, list):
            member = member[0]
        for change in MAPPING[module_dot.value]:
            if member.value in change[1]:
                new_name = change[0]
                break
        if new_name:
            module_dot.replace(Name(new_name,
                                    prefix=module_dot.prefix))
        else:
            self.cannot_convert(node, "This is an invalid module element")

    def transform(self, node, results):
        if results.get("module"):
            self.transform_import(node, results)
        elif results.get("mod_member"):
            self.transform_member(node, results)
        elif results.get("bare_with_attr"):
            self.transform_dot(node, results)
        # Renaming and star imports are not supported for these modules.
        elif results.get("module_star"):
            self.cannot_convert(node, "Cannot handle star imports.")
        elif results.get("module_as"):
            self.cannot_convert(node, "This module is now multiple modules")
lib2to3/fixes/fix_ne.py000064400000001073151153537460010775 0ustar00# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Fixer that turns <> into !=."""

# Local imports
from .. import pytree
from ..pgen2 import token
from .. import fixer_base


class FixNe(fixer_base.BaseFix):
    # This is so simple that we don't need the pattern compiler.

    _accept_type = token.NOTEQUAL

    def match(self, node):
        # Override
        return node.value == "<>"

    def transform(self, node, results):
        new = pytree.Leaf(token.NOTEQUAL, "!=", prefix=node.prefix)
        return new
lib2to3/fixes/fix_repr.py000064400000001145151153537460011343 0ustar00# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Fixer that transforms `xyzzy` into repr(xyzzy)."""

# Local imports
from .. import fixer_base
from ..fixer_util import Call, Name, parenthesize


class FixRepr(fixer_base.BaseFix):

    BM_compatible = True
    PATTERN = """
              atom < '`' expr=any '`' >
              """

    def transform(self, node, results):
        expr = results["expr"].clone()

        if expr.type == self.syms.testlist1:
            expr = parenthesize(expr)
        return Call(Name("repr"), [expr], prefix=node.prefix)
lib2to3/fixes/fix_imports2.py000064400000000441151153537460012150 0ustar00"""Fix incompatible imports and module references that must be fixed after
fix_imports."""
from . import fix_imports


MAPPING = {
            'whichdb': 'dbm',
            'anydbm': 'dbm',
          }


class FixImports2(fix_imports.FixImports):

    run_order = 7

    mapping = MAPPING
lib2to3/fixes/fix_buffer.py000064400000001116151153537460011642 0ustar00# Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Fixer that changes buffer(...) into memoryview(...)."""

# Local imports
from .. import fixer_base
from ..fixer_util import Name


class FixBuffer(fixer_base.BaseFix):
    BM_compatible = True

    explicit = True # The user must ask for this fixer

    PATTERN = """
              power< name='buffer' trailer< '(' [any] ')' > any* >
              """

    def transform(self, node, results):
        name = results["name"]
        name.replace(Name("memoryview", prefix=name.prefix))
lib2to3/fixes/fix_xreadlines.py000064400000001261151153537460012530 0ustar00"""Fix "for x in f.xreadlines()" -> "for x in f".

This fixer will also convert g(f.xreadlines) into g(f.__iter__)."""
# Author: Collin Winter

# Local imports
from .. import fixer_base
from ..fixer_util import Name


class FixXreadlines(fixer_base.BaseFix):
    BM_compatible = True
    PATTERN = """
    power< call=any+ trailer< '.' 'xreadlines' > trailer< '(' ')' > >
    |
    power< any+ trailer< '.' no_call='xreadlines' > >
    """

    def transform(self, node, results):
        no_call = results.get("no_call")

        if no_call:
            no_call.replace(Name("__iter__", prefix=no_call.prefix))
        else:
            node.replace([x.clone() for x in results["call"]])
lib2to3/fixes/fix_exec.py000064400000001723151153537460011321 0ustar00# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Fixer for exec.

This converts usages of the exec statement into calls to a built-in
exec() function.

exec code in ns1, ns2 -> exec(code, ns1, ns2)
"""

# Local imports
from .. import fixer_base
from ..fixer_util import Comma, Name, Call


class FixExec(fixer_base.BaseFix):
    BM_compatible = True

    PATTERN = """
    exec_stmt< 'exec' a=any 'in' b=any [',' c=any] >
    |
    exec_stmt< 'exec' (not atom<'(' [any] ')'>) a=any >
    """

    def transform(self, node, results):
        assert results
        syms = self.syms
        a = results["a"]
        b = results.get("b")
        c = results.get("c")
        args = [a.clone()]
        args[0].prefix = ""
        if b is not None:
            args.extend([Comma(), b.clone()])
        if c is not None:
            args.extend([Comma(), c.clone()])

        return Call(Name("exec"), args, prefix=node.prefix)
lib2to3/fixes/fix_zip.py000064400000002411151153537460011172 0ustar00"""
Fixer that changes zip(seq0, seq1, ...) into list(zip(seq0, seq1, ...)
unless there exists a 'from future_builtins import zip' statement in the
top-level namespace.

We avoid the transformation if the zip() call is directly contained in
iter(<>), list(<>), tuple(<>), sorted(<>), ...join(<>), or for V in <>:.
"""

# Local imports
from .. import fixer_base
from ..pytree import Node
from ..pygram import python_symbols as syms
from ..fixer_util import Name, ArgList, in_special_context


class FixZip(fixer_base.ConditionalFix):

    BM_compatible = True
    PATTERN = """
    power< 'zip' args=trailer< '(' [any] ')' > [trailers=trailer*]
    >
    """

    skip_on = "future_builtins.zip"

    def transform(self, node, results):
        if self.should_skip(node):
            return

        if in_special_context(node):
            return None

        args = results['args'].clone()
        args.prefix = ""

        trailers = []
        if 'trailers' in results:
            trailers = [n.clone() for n in results['trailers']]
            for n in trailers:
                n.prefix = ""

        new = Node(syms.power, [Name("zip"), args], prefix="")
        new = Node(syms.power, [Name("list"), ArgList([new])] + trailers)
        new.prefix = node.prefix
        return new
lib2to3/fixes/fix_paren.py000064400000002313151153537460011476 0ustar00"""Fixer that addes parentheses where they are required

This converts ``[x for x in 1, 2]`` to ``[x for x in (1, 2)]``."""

# By Taek Joo Kim and Benjamin Peterson

# Local imports
from .. import fixer_base
from ..fixer_util import LParen, RParen

# XXX This doesn't support nested for loops like [x for x in 1, 2 for x in 1, 2]
class FixParen(fixer_base.BaseFix):
    BM_compatible = True

    PATTERN = """
        atom< ('[' | '(')
            (listmaker< any
                comp_for<
                    'for' NAME 'in'
                    target=testlist_safe< any (',' any)+ [',']
                     >
                    [any]
                >
            >
            |
            testlist_gexp< any
                comp_for<
                    'for' NAME 'in'
                    target=testlist_safe< any (',' any)+ [',']
                     >
                    [any]
                >
            >)
        (']' | ')') >
    """

    def transform(self, node, results):
        target = results["target"]

        lparen = LParen()
        lparen.prefix = target.prefix
        target.prefix = "" # Make it hug the parentheses
        target.insert_child(0, lparen)
        target.append_child(RParen())
lib2to3/fixes/fix_ws_comma.py000064400000002102151153537460012172 0ustar00"""Fixer that changes 'a ,b' into 'a, b'.

This also changes '{a :b}' into '{a: b}', but does not touch other
uses of colons.  It does not touch other uses of whitespace.

"""

from .. import pytree
from ..pgen2 import token
from .. import fixer_base

class FixWsComma(fixer_base.BaseFix):

    explicit = True # The user must ask for this fixers

    PATTERN = """
    any<(not(',') any)+ ',' ((not(',') any)+ ',')* [not(',') any]>
    """

    COMMA = pytree.Leaf(token.COMMA, ",")
    COLON = pytree.Leaf(token.COLON, ":")
    SEPS = (COMMA, COLON)

    def transform(self, node, results):
        new = node.clone()
        comma = False
        for child in new.children:
            if child in self.SEPS:
                prefix = child.prefix
                if prefix.isspace() and "\n" not in prefix:
                    child.prefix = ""
                comma = True
            else:
                if comma:
                    prefix = child.prefix
                    if not prefix:
                        child.prefix = " "
                comma = False
        return new
lib2to3/fixes/fix_input.py000064400000001304151153537460011527 0ustar00"""Fixer that changes input(...) into eval(input(...))."""
# Author: Andre Roberge

# Local imports
from .. import fixer_base
from ..fixer_util import Call, Name
from .. import patcomp


context = patcomp.compile_pattern("power< 'eval' trailer< '(' any ')' > >")


class FixInput(fixer_base.BaseFix):
    BM_compatible = True
    PATTERN = """
              power< 'input' args=trailer< '(' [any] ')' > >
              """

    def transform(self, node, results):
        # If we're already wrapped in an eval() call, we're done.
        if context.match(node.parent.parent):
            return

        new = node.clone()
        new.prefix = ""
        return Call(Name("eval"), [new], prefix=node.prefix)
lib2to3/fixes/fix_types.py000064400000003356151153537460011545 0ustar00# Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Fixer for removing uses of the types module.

These work for only the known names in the types module.  The forms above
can include types. or not.  ie, It is assumed the module is imported either as:

    import types
    from types import ... # either * or specific types

The import statements are not modified.

There should be another fixer that handles at least the following constants:

   type([]) -> list
   type(()) -> tuple
   type('') -> str

"""

# Local imports
from .. import fixer_base
from ..fixer_util import Name

_TYPE_MAPPING = {
        'BooleanType' : 'bool',
        'BufferType' : 'memoryview',
        'ClassType' : 'type',
        'ComplexType' : 'complex',
        'DictType': 'dict',
        'DictionaryType' : 'dict',
        'EllipsisType' : 'type(Ellipsis)',
        #'FileType' : 'io.IOBase',
        'FloatType': 'float',
        'IntType': 'int',
        'ListType': 'list',
        'LongType': 'int',
        'ObjectType' : 'object',
        'NoneType': 'type(None)',
        'NotImplementedType' : 'type(NotImplemented)',
        'SliceType' : 'slice',
        'StringType': 'bytes', # XXX ?
        'StringTypes' : '(str,)', # XXX ?
        'TupleType': 'tuple',
        'TypeType' : 'type',
        'UnicodeType': 'str',
        'XRangeType' : 'range',
    }

_pats = ["power< 'types' trailer< '.' name='%s' > >" % t for t in _TYPE_MAPPING]

class FixTypes(fixer_base.BaseFix):
    BM_compatible = True
    PATTERN = '|'.join(_pats)

    def transform(self, node, results):
        new_value = _TYPE_MAPPING.get(results["name"].value)
        if new_value:
            return Name(new_value, prefix=node.prefix)
        return None
lib2to3/fixes/fix_import.py000064400000006270151153537460011711 0ustar00"""Fixer for import statements.
If spam is being imported from the local directory, this import:
    from spam import eggs
Becomes:
    from .spam import eggs

And this import:
    import spam
Becomes:
    from . import spam
"""

# Local imports
from .. import fixer_base
from os.path import dirname, join, exists, sep
from ..fixer_util import FromImport, syms, token


def traverse_imports(names):
    """
    Walks over all the names imported in a dotted_as_names node.
    """
    pending = [names]
    while pending:
        node = pending.pop()
        if node.type == token.NAME:
            yield node.value
        elif node.type == syms.dotted_name:
            yield "".join([ch.value for ch in node.children])
        elif node.type == syms.dotted_as_name:
            pending.append(node.children[0])
        elif node.type == syms.dotted_as_names:
            pending.extend(node.children[::-2])
        else:
            raise AssertionError("unknown node type")


class FixImport(fixer_base.BaseFix):
    BM_compatible = True

    PATTERN = """
    import_from< 'from' imp=any 'import' ['('] any [')'] >
    |
    import_name< 'import' imp=any >
    """

    def start_tree(self, tree, name):
        super(FixImport, self).start_tree(tree, name)
        self.skip = "absolute_import" in tree.future_features

    def transform(self, node, results):
        if self.skip:
            return
        imp = results['imp']

        if node.type == syms.import_from:
            # Some imps are top-level (eg: 'import ham')
            # some are first level (eg: 'import ham.eggs')
            # some are third level (eg: 'import ham.eggs as spam')
            # Hence, the loop
            while not hasattr(imp, 'value'):
                imp = imp.children[0]
            if self.probably_a_local_import(imp.value):
                imp.value = "." + imp.value
                imp.changed()
        else:
            have_local = False
            have_absolute = False
            for mod_name in traverse_imports(imp):
                if self.probably_a_local_import(mod_name):
                    have_local = True
                else:
                    have_absolute = True
            if have_absolute:
                if have_local:
                    # We won't handle both sibling and absolute imports in the
                    # same statement at the moment.
                    self.warning(node, "absolute and local imports together")
                return

            new = FromImport(".", [imp])
            new.prefix = node.prefix
            return new

    def probably_a_local_import(self, imp_name):
        if imp_name.startswith("."):
            # Relative imports are certainly not local imports.
            return False
        imp_name = imp_name.split(".", 1)[0]
        base_path = dirname(self.filename)
        base_path = join(base_path, imp_name)
        # If there is no __init__.py next to the file its not in a package
        # so can't be a relative import.
        if not exists(join(dirname(base_path), "__init__.py")):
            return False
        for ext in [".py", sep, ".pyc", ".so", ".sl", ".pyd"]:
            if exists(base_path + ext):
                return True
        return False
lib2to3/fixes/fix_isinstance.py000064400000003110151153537460012525 0ustar00# Copyright 2008 Armin Ronacher.
# Licensed to PSF under a Contributor Agreement.

"""Fixer that cleans up a tuple argument to isinstance after the tokens
in it were fixed.  This is mainly used to remove double occurrences of
tokens as a leftover of the long -> int / unicode -> str conversion.

eg.  isinstance(x, (int, long)) -> isinstance(x, (int, int))
       -> isinstance(x, int)
"""

from .. import fixer_base
from ..fixer_util import token


class FixIsinstance(fixer_base.BaseFix):
    BM_compatible = True
    PATTERN = """
    power<
        'isinstance'
        trailer< '(' arglist< any ',' atom< '('
            args=testlist_gexp< any+ >
        ')' > > ')' >
    >
    """

    run_order = 6

    def transform(self, node, results):
        names_inserted = set()
        testlist = results["args"]
        args = testlist.children
        new_args = []
        iterator = enumerate(args)
        for idx, arg in iterator:
            if arg.type == token.NAME and arg.value in names_inserted:
                if idx < len(args) - 1 and args[idx + 1].type == token.COMMA:
                    next(iterator)
                    continue
            else:
                new_args.append(arg)
                if arg.type == token.NAME:
                    names_inserted.add(arg.value)
        if new_args and new_args[-1].type == token.COMMA:
            del new_args[-1]
        if len(new_args) == 1:
            atom = testlist.parent
            new_args[0].prefix = atom.prefix
            atom.replace(new_args[0])
        else:
            args[:] = new_args
            node.changed()
lib2to3/fixes/fix_methodattrs.py000064400000001136151153537460012731 0ustar00"""Fix bound method attributes (method.im_? -> method.__?__).
"""
# Author: Christian Heimes

# Local imports
from .. import fixer_base
from ..fixer_util import Name

MAP = {
    "im_func" : "__func__",
    "im_self" : "__self__",
    "im_class" : "__self__.__class__"
    }

class FixMethodattrs(fixer_base.BaseFix):
    BM_compatible = True
    PATTERN = """
    power< any+ trailer< '.' attr=('im_func' | 'im_self' | 'im_class') > any* >
    """

    def transform(self, node, results):
        attr = results["attr"][0]
        new = MAP[attr.value]
        attr.replace(Name(new, prefix=attr.prefix))
lib2to3/__pycache__/patcomp.cpython-38.pyc000064400000013011151153537460014333 0ustar00U

e5d��@s�dZdZddlZddlmZmZmZmZmZm	Z	ddl
mZddl
mZGdd	�d	e
�Zd
d�ZGdd
�d
e�Zejejejdd�Zdd�Zdd�Zdd�ZdS)z�Pattern compiler.

The grammar is taken from PatternGrammar.txt.

The compiler compiles a pattern to a pytree.*Pattern instance.
z#Guido van Rossum <guido@python.org>�N�)�driver�literals�token�tokenize�parse�grammar)�pytree)�pygramc@seZdZdS)�PatternSyntaxErrorN)�__name__�
__module__�__qualname__�rr�'/usr/lib64/python3.8/lib2to3/patcomp.pyrsrc	csLtjtjtjh}t�t�|�j�}|D] }|\}}}}}||kr&|Vq&dS)z6Tokenizes a string suppressing significant whitespace.N)	r�NEWLINE�INDENT�DEDENTr�generate_tokens�io�StringIO�readline)	�input�skip�tokensZ	quintuple�type�value�start�endZ	line_textrrr�tokenize_wrappersrc@s:eZdZd
dd�Zddd�Zdd�Zdd	d
�Zdd�ZdS)�PatternCompilerNcCsZ|dkrtj|_tj|_nt�|�|_t�|j�|_tj|_	tj
|_tj|jt
d�|_dS)z^Initializer.

        Takes an optional alternative filename for the pattern grammar.
        N)Zconvert)r
Zpattern_grammarrZpattern_symbols�symsrZload_grammarZSymbolsZpython_grammarZ	pygrammarZpython_symbols�pysymsZDriver�pattern_convert)�selfZgrammar_filerrr�__init__(s
zPatternCompiler.__init__Fc
Cspt|�}z|jj||d�}Wn2tjk
rN}ztt|��d�W5d}~XYnX|rb|�|�|fS|�|�SdS)z=Compiles a pattern string to a nested pytree.*Pattern object.)�debugN)rrZparse_tokensrZ
ParseErrorr�str�compile_node)r$rr&Z	with_treer�root�errr�compile_pattern7s zPatternCompiler.compile_patternc
s�|j�jjkr|jd}|j�jjkrz�fdd�|jddd�D�}t|�dkrX|dStjdd�|D�ddd�}|��S|j�jj	krʇfd	d�|jD�}t|�dkr�|dStj|gddd�}|��S|j�jj
kr���|jdd��}t�|�}|��S|j�jj
k�st�d}|j}t|�d
k�rR|djtjk�rR|dj}|dd�}d}t|�dk�r�|dj�jjk�r�|d}|dd�}��||�}|dk	�r�|j�jjk�s�t�|j}	|	d}
|
jtjk�r�d}tj}n�|
jtjk�r�d}tj}np|
jtjk�r^|	djtjk�st�t|	�dk�s.t���|	d�}}t|	�d
k�rh��|	d
�}n
d�sht�|dk�s||dk�r�|��}tj|gg||d�}|dk	�r�||_|��S)zXCompiles a node, recursively.

        This is one big switch on the node type.
        rcsg|]}��|��qSr�r(��.0Zch�r$rr�
<listcomp>Osz0PatternCompiler.compile_node.<locals>.<listcomp>N�rcSsg|]
}|g�qSrr)r.�arrrr0Rs��min�maxcsg|]}��|��qSrr,r-r/rrr0Vs����)r6�r8F)rr!ZMatcher�childrenZAlternatives�lenr	�WildcardPattern�optimizeZAlternativeZNegatedUnit�
compile_basicZNegatedPatternZUnit�AssertionErrorr�EQUALrZRepeater�STARZHUGE�PLUS�LBRACE�RBRACE�get_int�name)
r$�nodeZalts�pZunits�patternrE�nodes�repeatr9Zchildr4r5rr/rr(Csh

 
"


zPatternCompiler.compile_nodecCsnt|�dkst�|d}|jtjkrDtt�|j��}t	�
t|�|�S|jtjk�r|j}|�
�r�|tkrttd|��|dd�r�td��t	�
t|�S|dkr�d}n,|�d�s�t|j|d�}|dkr�td|��|dd�r�|�|djd�g}nd}t	�||�SnV|jdk�r |�|d�S|jd	k�r\|dk�s:t�|�|d�}t	j|ggddd
�Sd�sjt|��dS)NrrzInvalid token: %rzCan't have details for token�any�_zInvalid symbol: %r�(�[r3F)r:r>rr�STRINGr'rZ
evalStringrr	ZLeafPattern�_type_of_literal�NAME�isupper�	TOKEN_MAPr�
startswith�getattrr"r(r9ZNodePatternr;)r$rIrJrFrrZcontent�
subpatternrrrr=�s<
zPatternCompiler.compile_basiccCs|jtjkst�t|j�S�N)rr�NUMBERr>�intr)r$rFrrrrD�szPatternCompiler.get_int)N)FF)N)rr
rr%r+r(r=rDrrrrr &s


G
#r )rQrOrXZTOKENcCs.|d��rtjS|tjkr&tj|SdSdS)Nr)�isalpharrQrZopmap)rrrrrP�s


rPcCs>|\}}}}|s||jkr*tj|||d�Stj|||d�SdS)z9Converts raw node information to a Node or Leaf instance.)�contextN)Z
number2symbolr	ZNodeZLeaf)rZ
raw_node_inforrr[r9rrrr#�sr#cCst��|�SrW)r r+)rHrrrr+�sr+)�__doc__�
__author__rZpgen2rrrrrr�r	r
�	Exceptionrr�objectr rQrOrXrSrPr#r+rrrr�<module>s" 
�		lib2to3/__pycache__/pytree.cpython-38.opt-1.pyc000064400000056154151153537460015156 0ustar00U

e5d8m�@s�dZdZddlZddlmZdZiadd�ZGdd	�d	e�Z	Gd
d�de	�Z
Gdd
�d
e	�Zdd�ZGdd�de�Z
Gdd�de
�ZGdd�de
�ZGdd�de
�ZGdd�de
�Zdd�ZdS)z�
Python parse tree definitions.

This is a very concrete parse tree; we need to keep every token and
even the comments and whitespace between tokens.

There's also a pattern matching implementation here.
z#Guido van Rossum <guido@python.org>�N)�StringIOi���cCsDts8ddlm}|j��D]\}}t|�tkr|t|<qt�||�S)N�)�python_symbols)�_type_reprsZpygramr�__dict__�items�type�int�
setdefault)Ztype_numr�name�val�r
�&/usr/lib64/python3.8/lib2to3/pytree.py�	type_reprs
rc@s�eZdZdZdZdZdZdZdZdd�Z	dd�Z
dZd	d
�Zdd�Z
d
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zedd��Zedd��Zdd�Zdd �Zd!d"�Zejd#kr�d$d%�ZdS)&�Basez�
    Abstract base class for Node and Leaf.

    This provides some default functionality and boilerplate using the
    template pattern.

    A node may be a subnode of at most one parent.
    Nr
FcOs
t�|�S)z7Constructor that prevents Base from being instantiated.��object�__new__��cls�args�kwdsr
r
rr1szBase.__new__cCs|j|jk	rtS|�|�S)zW
        Compare two nodes for equality.

        This calls the method _eq().
        )�	__class__�NotImplemented�_eq��self�otherr
r
r�__eq__6szBase.__eq__cCst�dS)a_
        Compare two nodes for equality.

        This is called by __eq__ and __ne__.  It is only called if the two nodes
        have the same type.  This must be implemented by the concrete subclass.
        Nodes should be considered equal if they have the same structure,
        ignoring the prefix string and other context information.
        N��NotImplementedErrorrr
r
rrBs	zBase._eqcCst�dS)zr
        Return a cloned (deep) copy of self.

        This must be implemented by the concrete subclass.
        Nr�rr
r
r�cloneMsz
Base.clonecCst�dS)zx
        Return a post-order iterator for the tree.

        This must be implemented by the concrete subclass.
        Nrr!r
r
r�
post_orderUszBase.post_ordercCst�dS)zw
        Return a pre-order iterator for the tree.

        This must be implemented by the concrete subclass.
        Nrr!r
r
r�	pre_order]szBase.pre_ordercCs~t|t�s|g}g}d}|jjD].}||krD|dk	r>|�|�d}q |�|�q |j��||j_|D]}|j|_qfd|_dS)z/Replace this node with a new one in the parent.FNT)�
isinstance�list�parent�children�extend�append�changed)r�newZ
l_children�found�ch�xr
r
r�replacees



zBase.replacecCs*|}t|t�s$|jsdS|jd}q|jS)z9Return the line number which generated the invocant node.Nr)r%�Leafr(�lineno�r�noder
r
r�
get_lineno|s
zBase.get_linenocCs|jr|j��d|_dS)NT)r'r+�was_changedr!r
r
rr+�s
zBase.changedcCsJ|jrFt|jj�D]2\}}||kr|j��|jj|=d|_|SqdS)z�
        Remove the node from the tree. Returns the position of the node in its
        parent's children before it was removed.
        N)r'�	enumerater(r+)r�ir4r
r
r�remove�s

zBase.removec	Cs`|jdkrdSt|jj�D]@\}}||krz|jj|dWStk
rXYdSXqdS)z�
        The node immediately following the invocant in their parent's children
        list. If the invocant does not have a next sibling, it is None
        Nr)r'r7r(�
IndexError�rr8�childr
r
r�next_sibling�s
zBase.next_siblingcCsR|jdkrdSt|jj�D]2\}}||kr|dkr8dS|jj|dSqdS)z�
        The node immediately preceding the invocant in their parent's children
        list. If the invocant does not have a previous sibling, it is None.
        Nrr)r'r7r(r;r
r
r�prev_sibling�s
zBase.prev_siblingccs|jD]}|��EdHqdS�N)r(�leaves�rr<r
r
rr@�s
zBase.leavescCs|jdkrdSd|j��S)Nrr)r'�depthr!r
r
rrB�s
z
Base.depthcCs|j}|dkrdS|jS)z�
        Return the string immediately following the invocant node. This is
        effectively equivalent to node.next_sibling.prefix
        N�)r=�prefix)rZnext_sibr
r
r�
get_suffix�szBase.get_suffix��rcCst|��d�S)N�ascii)�str�encoder!r
r
r�__str__�szBase.__str__)�__name__�
__module__�__qualname__�__doc__rr'r(r6Zwas_checkedrr�__hash__rr"r#r$r0r5r+r9�propertyr=r>r@rBrE�sys�version_inforKr
r
r
rrs4

	




rc@s�eZdZdZddd�Zdd�Zdd�Zejd	kr4eZ	d
d�Z
dd
�Zdd�Zdd�Z
edd��Zejdd��Zdd�Zdd�Zdd�ZdS)�Nodez+Concrete implementation for interior nodes.NcCsN||_t|�|_|jD]
}||_q|dk	r0||_|rD|dd�|_nd|_dS)z�
        Initializer.

        Takes a type constant (a symbol number >= 256), a sequence of
        child nodes, and an optional context keyword argument.

        As a side effect, the parent pointers of the children are updated.
        N)rr&r(r'rD�fixers_applied)rrr(�contextrDrUr.r
r
r�__init__�s


z
Node.__init__cCsd|jjt|j�|jfS)�)Return a canonical string representation.z
%s(%s, %r))rrLrrr(r!r
r
r�__repr__�s�z
Node.__repr__cCsd�tt|j��S)�k
        Return a pretty string representation.

        This reproduces the input source exactly.
        rC)�join�maprIr(r!r
r
r�__unicode__�szNode.__unicode__rFcCs|j|jf|j|jfkS�zCompare two nodes for equality.)rr(rr
r
rr�szNode._eqcCst|jdd�|jD�|jd�S)�$Return a cloned (deep) copy of self.cSsg|]}|���qSr
)r")�.0r.r
r
r�
<listcomp>szNode.clone.<locals>.<listcomp>�rU)rTrr(rUr!r
r
rr"s�z
Node.cloneccs$|jD]}|��EdHq|VdS�z*Return a post-order iterator for the tree.N)r(r#rAr
r
rr#s
zNode.post_orderccs$|V|jD]}|��EdHqdS�z)Return a pre-order iterator for the tree.N)r(r$rAr
r
rr$s
zNode.pre_ordercCs|js
dS|jdjS)zO
        The whitespace and comments preceding this node in the input.
        rCr�r(rDr!r
r
rrDszNode.prefixcCs|jr||jd_dS�Nrre�rrDr
r
rrDscCs(||_d|j|_||j|<|��dS)z�
        Equivalent to 'node.children[i] = child'. This method also sets the
        child's parent attribute appropriately.
        N)r'r(r+r;r
r
r�	set_child s
zNode.set_childcCs ||_|j�||�|��dS)z�
        Equivalent to 'node.children.insert(i, child)'. This method also sets
        the child's parent attribute appropriately.
        N)r'r(�insertr+r;r
r
r�insert_child*szNode.insert_childcCs||_|j�|�|��dS)z�
        Equivalent to 'node.children.append(child)'. This method also sets the
        child's parent attribute appropriately.
        N)r'r(r*r+rAr
r
r�append_child3szNode.append_child)NNN)rLrMrNrOrWrYr]rRrSrKrr"r#r$rQrD�setterrhrjrkr
r
r
rrT�s(�




	rTc@s�eZdZdZdZdZdZddgfdd�Zdd�Zd	d
�Z	e
jdkrFe	Zdd
�Z
dd�Zdd�Zdd�Zdd�Zedd��Zejdd��ZdS)r1z'Concrete implementation for leaf nodes.rCrNcCsF|dk	r|\|_\|_|_||_||_|dk	r4||_|dd�|_dS)z�
        Initializer.

        Takes a type constant (a token number < 256), a string value, and an
        optional context keyword argument.
        N)�_prefixr2�columnr�valuerU)rrrorVrDrUr
r
rrWFsz
Leaf.__init__cCsd|jj|j|jfS)rXz
%s(%r, %r))rrLrror!r
r
rrYYs�z
Leaf.__repr__cCs|jt|j�S)rZ)rDrIror!r
r
rr]_szLeaf.__unicode__rFcCs|j|jf|j|jfkSr^)rrorr
r
rrjszLeaf._eqcCs$t|j|j|j|j|jff|jd�S)r_rb)r1rrorDr2rnrUr!r
r
rr"ns
�z
Leaf.cloneccs
|VdSr?r
r!r
r
rr@tszLeaf.leavesccs
|VdSrcr
r!r
r
rr#wszLeaf.post_orderccs
|VdSrdr
r!r
r
rr${szLeaf.pre_ordercCs|jS)zP
        The whitespace and comments preceding this token in the input.
        )rmr!r
r
rrDszLeaf.prefixcCs|��||_dSr?)r+rmrgr
r
rrD�s)rLrMrNrOrmr2rnrWrYr]rRrSrKrr"r@r#r$rQrDrlr
r
r
rr1=s*�


r1cCsN|\}}}}|s||jkr<t|�dkr.|dSt|||d�St|||d�SdS)z�
    Convert raw node information to a Node or Leaf instance.

    This is passed to the parser driver which calls it whenever a reduction of a
    grammar rule produces a new complete node, so that the tree is build
    strictly bottom-up.
    rr)rVN)Z
number2symbol�lenrTr1)ZgrZraw_noderrorVr(r
r
r�convert�srqc@sPeZdZdZdZdZdZdd�Zdd�Zdd�Z	dd	d
�Z
ddd�Zd
d�ZdS)�BasePatterna�
    A pattern is a tree matching pattern.

    It looks for a specific node type (token or symbol), and
    optionally for a specific content.

    This is an abstract base class.  There are three concrete
    subclasses:

    - LeafPattern matches a single leaf node;
    - NodePattern matches a single node (usually non-leaf);
    - WildcardPattern matches a sequence of nodes of variable length.
    NcOs
t�|�S)z>Constructor that prevents BasePattern from being instantiated.rrr
r
rr�szBasePattern.__new__cCsHt|j�|j|jg}|r,|ddkr,|d=qd|jjd�tt|��fS)N���z%s(%s)z, )	rr�contentrrrLr[r\�repr)rrr
r
rrY�szBasePattern.__repr__cCs|S)z�
        A subclass can define this as a hook for optimizations.

        Returns either self or another node with the same effect.
        r
r!r
r
r�optimize�szBasePattern.optimizecCsn|jdk	r|j|jkrdS|jdk	rRd}|dk	r4i}|�||�sDdS|rR|�|�|dk	rj|jrj|||j<dS)a#
        Does this pattern exactly match a node?

        Returns True if it matches, False if not.

        If results is not None, it must be a dict which will be
        updated with the nodes matching named subpatterns.

        Default implementation for non-wildcard patterns.
        NFT)rrt�	_submatch�updater)rr4�results�rr
r
r�match�s


zBasePattern.matchcCs t|�dkrdS|�|d|�S)z�
        Does this pattern exactly match a sequence of nodes?

        Default implementation for non-wildcard patterns.
        rFr)rpr{)r�nodesryr
r
r�	match_seq�szBasePattern.match_seqccs&i}|r"|�|d|�r"d|fVdS)z}
        Generator yielding all matches for this pattern.

        Default implementation for non-wildcard patterns.
        rrN)r{)rr|rzr
r
r�generate_matches�szBasePattern.generate_matches)N)N)
rLrMrNrOrrtrrrYrvr{r}r~r
r
r
rrr�s


rrc@s*eZdZddd�Zd	dd�Zd
dd�ZdS)�LeafPatternNcCs&|dk	r|dk	r||_||_||_dS)ap
        Initializer.  Takes optional type, content, and name.

        The type, if given must be a token type (< 256).  If not given,
        this matches any *leaf* node; the content may still be required.

        The content, if given, must be a string.

        If a name is given, the matching node is stored in the results
        dict under that key.
        N)rrtr)rrrtrr
r
rrW�s
zLeafPattern.__init__cCst|t�sdSt�|||�S)z*Override match() to insist on a leaf node.F)r%r1rrr{�rr4ryr
r
rr{
s
zLeafPattern.matchcCs|j|jkS)�
        Match the pattern's content to the node's children.

        This assumes the node type matches and self.content is not None.

        Returns True if it matches, False if not.

        If results is not None, it must be a dict which will be
        updated with the nodes matching named subpatterns.

        When returning False, the results dict may still be updated.
        )rtror�r
r
rrws
zLeafPattern._submatch)NNN)N)N)rLrMrNrWr{rwr
r
r
rr�s

rc@s$eZdZdZddd�Zddd�ZdS)	�NodePatternFNcCsP|dk	r|dk	r:t|�}t|�D]\}}t|t�r d|_q ||_||_||_dS)ad
        Initializer.  Takes optional type, content, and name.

        The type, if given, must be a symbol type (>= 256).  If the
        type is None this matches *any* single node (leaf or not),
        except if content is not None, in which it only matches
        non-leaf nodes that also match the content pattern.

        The content, if not None, must be a sequence of Patterns that
        must match the node's children exactly.  If the content is
        given, the type must not be None.

        If a name is given, the matching node is stored in the results
        dict under that key.
        NT)r&r7r%�WildcardPattern�	wildcardsrrtr)rrrtrr8�itemr
r
rrW$s
zNodePattern.__init__cCs�|jrHt|j|j�D].\}}|t|j�kr|dk	r<|�|�dSqdSt|j�t|j�kr`dSt|j|j�D]\}}|�||�sndSqndS)r�NTF)r�r~rtr(rprx�zipr{)rr4ry�crz�
subpatternr<r
r
rrwAs

zNodePattern._submatch)NNN)N)rLrMrNr�rWrwr
r
r
rr� s
r�c@s^eZdZdZddedfdd�Zdd�Zddd	�Zdd
d�Zdd
�Z	dd�Z
dd�Zdd�ZdS)r�a
    A wildcard pattern can match zero or more nodes.

    This has all the flexibility needed to implement patterns like:

    .*      .+      .?      .{m,n}
    (a b c | d e | f)
    (...)*  (...)+  (...)?  (...){m,n}

    except it always uses non-greedy matching.
    NrcCs<|dk	r ttt|��}|D]}q||_||_||_||_dS)a�
        Initializer.

        Args:
            content: optional sequence of subsequences of patterns;
                     if absent, matches one node;
                     if present, each subsequence is an alternative [*]
            min: optional minimum number of times to match, default 0
            max: optional maximum number of times to match, default HUGE
            name: optional name assigned to this match

        [*] Thus, if content is [[a, b, c], [d, e], [f, g, h]] this is
            equivalent to (a b c | d e | f g h); if content is None,
            this is equivalent to '.' in regular expression terms.
            The min and max parameters work as follows:
                min=0, max=maxint: .*
                min=1, max=maxint: .+
                min=0, max=1: .?
                min=1, max=1: .
            If content is not None, replace the dot with the parenthesized
            list of alternatives, e.g. (a b c | d e | f g h)*
        N)�tupler\rt�min�maxr)rrtr�r�r�altr
r
rrWkszWildcardPattern.__init__cCs�d}|jdk	r<t|j�dkr<t|jd�dkr<|jdd}|jdkr�|jdkr�|jdkrft|jd�S|dk	r�|j|jkr�|��S|jdkr�t|t�r�|jdkr�|j|jkr�t|j|j|j|j|j|j�S|S)z+Optimize certain stacked wildcard patterns.Nrr)r)	rtrpr�r�r�rrvr%r�)rr�r
r
rrv�s.
��
�
�

�zWildcardPattern.optimizecCs|�|g|�S)z'Does this pattern exactly match a node?)r}r�r
r
rr{�szWildcardPattern.matchcCsP|�|�D]@\}}|t|�kr
|dk	rD|�|�|jrDt|�||j<dSq
dS)z4Does this pattern exactly match a sequence of nodes?NTF)r~rprxrr&)rr|ryr�rzr
r
rr}�s
zWildcardPattern.match_seqc	cs,|jdkrTt|jdtt|�|j��D]*}i}|jrF|d|�||j<||fVq&n�|jdkrl|�|�Vn�ttd�r�tj	}t
�t_	z�z<|�|d�D]*\}}|jr�|d|�||j<||fVq�WnLtk
�r|�
|�D]*\}}|jr�|d|�||j<||fVq�YnXW5ttd��r&|t_	XdS)a"
        Generator yielding matches for a sequence of nodes.

        Args:
            nodes: sequence of nodes

        Yields:
            (count, results) tuples where:
            count: the match comprises nodes[:count];
            results: dict containing named submatches.
        NrZ	bare_name�getrefcountr)rt�ranger�rpr�r�_bare_name_matches�hasattrrR�stderrr�_recursive_matches�RuntimeError�_iterative_matches)rr|�countrzZsave_stderrr
r
rr~�s.
 

z WildcardPattern.generate_matchesccs�t|�}d|jkrdifVg}|jD]0}t||�D] \}}||fV|�||f�q4q&|r�g}|D]�\}}	||krd||jkrd|jD]`}t|||d��D]H\}
}|
dkr�i}|�|	�|�|�||
|fV|�||
|f�q�q�qd|}qXdS)z(Helper to iteratively yield the matches.rN)rpr�rtr~r*r�rx)rr|Znodelenryr�r�rzZnew_results�c0�r0�c1�r1r
r
rr��s*






z"WildcardPattern._iterative_matchescCspd}i}d}t|�}|sV||krVd}|jD](}|d�|||�r*|d7}d}qq*q|d|�||j<||fS)z(Special optimized matcher for bare_name.rFTrN)rprtr{r)rr|r�rzZdoner�Zleafr
r
rr��s
z"WildcardPattern._bare_name_matchesc	cs�||jkrdifV||jkr�|jD]`}t||�D]P\}}|�||d�|d�D].\}}i}|�|�|�|�|||fVqRq2q$dS)z(Helper to recursively yield the matches.rNr)r�r�rtr~r�rx)	rr|r�r�r�r�r�r�rzr
r
rr�
s



 

z"WildcardPattern._recursive_matches)N)N)
rLrMrNrO�HUGErWrvr{r}r~r�r�r�r
r
r
rr�]s#

-r�c@s.eZdZd
dd�Zdd�Zdd�Zdd	�ZdS)�NegatedPatternNcCs|dk	r||_dS)a
        Initializer.

        The argument is either a pattern or None.  If it is None, this
        only matches an empty sequence (effectively '$' in regex
        lingo).  If it is not None, this matches whenever the argument
        pattern doesn't have any matches.
        N)rt)rrtr
r
rrWs	zNegatedPattern.__init__cCsdS)NFr
r3r
r
rr{(szNegatedPattern.matchcCst|�dkSrf)rp)rr|r
r
rr},szNegatedPattern.match_seqccsJ|jdkr"t|�dkrFdifVn$|j�|�D]\}}dSdifVdSrf)rtrpr~)rr|r�rzr
r
rr~0s
zNegatedPattern.generate_matches)N)rLrMrNrWr{r}r~r
r
r
rr�s

r�c	cs�|sdifVn||d|dd�}}|�|�D]Z\}}|sH||fVq0t|||d��D].\}}i}|�|�|�|�|||fVqZq0dS)aR
    Generator yielding matches for a sequence of patterns and nodes.

    Args:
        patterns: a sequence of patterns
        nodes: a sequence of nodes

    Yields:
        (count, results) tuples where:
        count: the entire sequence of patterns matches nodes[:count];
        results: dict containing named submatches.
        rrN)r~rx)	Zpatternsr|�p�restr�r�r�r�rzr
r
rr~<s


r~)rO�
__author__rR�iorr�rrrrrTr1rqrrrr�r�r�r~r
r
r
r�<module>s$	
1nNV,==#lib2to3/__pycache__/patcomp.cpython-38.opt-1.pyc000064400000012427151153537460015304 0ustar00U

e5d��@s�dZdZddlZddlmZmZmZmZmZm	Z	ddl
mZddl
mZGdd	�d	e
�Zd
d�ZGdd
�d
e�Zejejejdd�Zdd�Zdd�Zdd�ZdS)z�Pattern compiler.

The grammar is taken from PatternGrammar.txt.

The compiler compiles a pattern to a pytree.*Pattern instance.
z#Guido van Rossum <guido@python.org>�N�)�driver�literals�token�tokenize�parse�grammar)�pytree)�pygramc@seZdZdS)�PatternSyntaxErrorN)�__name__�
__module__�__qualname__�rr�'/usr/lib64/python3.8/lib2to3/patcomp.pyrsrc	csLtjtjtjh}t�t�|�j�}|D] }|\}}}}}||kr&|Vq&dS)z6Tokenizes a string suppressing significant whitespace.N)	r�NEWLINE�INDENT�DEDENTr�generate_tokens�io�StringIO�readline)	�input�skip�tokensZ	quintuple�type�value�start�endZ	line_textrrr�tokenize_wrappersrc@s:eZdZd
dd�Zddd�Zdd�Zdd	d
�Zdd�ZdS)�PatternCompilerNcCsZ|dkrtj|_tj|_nt�|�|_t�|j�|_tj|_	tj
|_tj|jt
d�|_dS)z^Initializer.

        Takes an optional alternative filename for the pattern grammar.
        N)Zconvert)r
Zpattern_grammarrZpattern_symbols�symsrZload_grammarZSymbolsZpython_grammarZ	pygrammarZpython_symbols�pysymsZDriver�pattern_convert)�selfZgrammar_filerrr�__init__(s
zPatternCompiler.__init__Fc
Cspt|�}z|jj||d�}Wn2tjk
rN}ztt|��d�W5d}~XYnX|rb|�|�|fS|�|�SdS)z=Compiles a pattern string to a nested pytree.*Pattern object.)�debugN)rrZparse_tokensrZ
ParseErrorr�str�compile_node)r$rr&Z	with_treer�root�errr�compile_pattern7s zPatternCompiler.compile_patternc
sV|j�jjkr|jd}|j�jjkrz�fdd�|jddd�D�}t|�dkrX|dStjdd�|D�ddd�}|��S|j�jj	krʇfd	d�|jD�}t|�dkr�|dStj|gddd�}|��S|j�jj
kr���|jdd��}t�|�}|��Sd}|j}t|�d
k�r>|djt
jk�r>|dj}|dd�}d}t|�dk�rx|dj�jjk�rx|d}|dd�}��||�}|dk	�r>|j}	|	d}
|
jt
jk�r�d}tj}nX|
jt
jk�r�d}tj}n>|
jt
jk�r��|	d�}}t|	�dk�r��|	d
�}n|dk�s"|dk�r>|��}tj|gg||d�}|dk	�rN||_|��S)
zXCompiles a node, recursively.

        This is one big switch on the node type.
        rcsg|]}��|��qSr�r(��.0Zch�r$rr�
<listcomp>Osz0PatternCompiler.compile_node.<locals>.<listcomp>N�rcSsg|]
}|g�qSrr)r.�arrrr0Rs��min�maxcsg|]}��|��qSrr,r-r/rrr0Vs�����)rr!ZMatcher�childrenZAlternatives�lenr	�WildcardPattern�optimizeZAlternativeZNegatedUnit�
compile_basicZNegatedPatternr�EQUALrZRepeater�STARZHUGE�PLUS�LBRACE�get_int�name)
r$�nodeZalts�pZunits�patternrC�nodes�repeatr9Zchildr4r5rr/rr(Cs^

 
"

zPatternCompiler.compile_nodecCs@|d}|jtjkr4tt�|j��}t�t	|�|�S|jtj
kr�|j}|��r�|tkrbt
d|��|dd�rvt
d��t�t|�S|dkr�d}n,|�d�s�t|j|d�}|dkr�t
d|��|dd�r�|�|djd�g}nd}t�||�SnH|jdk�r|�|d�S|jd	k�r<|�|d�}tj|ggddd
�SdS)NrzInvalid token: %rrzCan't have details for token�any�_zInvalid symbol: %r�(�[r3)rr�STRINGr'rZ
evalStringrr	ZLeafPattern�_type_of_literal�NAME�isupper�	TOKEN_MAPr�
startswith�getattrr"r(r9ZNodePatternr;)r$rGrHrDrrZcontent�
subpatternrrrr=�s8
zPatternCompiler.compile_basiccCs
t|j�S�N)�intr)r$rDrrrrB�szPatternCompiler.get_int)N)FF)N)rr
rr%r+r(r=rBrrrrr &s


G
#r )rOrM�NUMBERZTOKENcCs.|d��rtjS|tjkr&tj|SdSdS)Nr)�isalpharrOrZopmap)rrrrrN�s


rNcCs>|\}}}}|s||jkr*tj|||d�Stj|||d�SdS)z9Converts raw node information to a Node or Leaf instance.)�contextN)Z
number2symbolr	ZNodeZLeaf)rZ
raw_node_inforrrYr9rrrr#�sr#cCst��|�SrU)r r+)rFrrrr+�sr+)�__doc__�
__author__rZpgen2rrrrrr�r	r
�	Exceptionrr�objectr rOrMrWrQrNr#r+rrrr�<module>s" 
�		lib2to3/__pycache__/main.cpython-38.pyc000064400000020642151153537460013624 0ustar00U

e5d�-�@s�dZddlmZmZddlZddlZddlZddlZddlZddl	Z	ddl
mZdd�ZGdd	�d	ej
�Zd
d�Zddd
�ZdS)z
Main program for 2to3.
�)�with_statement�print_functionN�)�refactorc	Cs(|��}|��}tj||||dddd�S)z%Return a unified diff of two strings.z
(original)z(refactored)�)Zlineterm)�
splitlines�difflibZunified_diff)�a�b�filename�r�$/usr/lib64/python3.8/lib2to3/main.py�
diff_textss�rcs>eZdZdZd�fdd�	Zdd�Z�fdd�Zd	d
�Z�ZS)�StdoutRefactoringToola2
    A refactoring tool that can avoid overwriting its input files.
    Prints output to stdout.

    Output files can optionally be written to a different directory and or
    have an extra file suffix appended to their name for use in situations
    where you do not want to replace the input files.
    rc		sP||_||_|r&|�tj�s&|tj7}||_||_||_tt	|��
|||�dS)aF
        Args:
            fixers: A list of fixers to import.
            options: A dict with RefactoringTool configuration.
            explicit: A list of fixers to run even if they are explicit.
            nobackups: If true no backup '.bak' files will be created for those
                files that are being refactored.
            show_diffs: Should diffs of the refactoring be printed to stdout?
            input_base_dir: The base directory for all input files.  This class
                will strip this path prefix off of filenames before substituting
                it with output_dir.  Only meaningful if output_dir is supplied.
                All files processed by refactor() must start with this path.
            output_dir: If supplied, all converted files will be written into
                this directory tree instead of input_base_dir.
            append_suffix: If supplied, all files output by this tool will have
                this appended to their filename.  Useful for changing .py to
                .py3 for example by passing append_suffix='3'.
        N)�	nobackups�
show_diffs�endswith�os�sep�_input_base_dir�_output_dir�_append_suffix�superr�__init__)	�selfZfixers�options�explicitrr�input_base_dir�
output_dir�
append_suffix��	__class__rr
r$s
zStdoutRefactoringTool.__init__cOs*|j�|||f�|jj|f|�|�dS)N)�errors�append�logger�error)r�msg�args�kwargsrrr
�	log_errorAszStdoutRefactoringTool.log_errorc

sz|}|jrH|�|j�r6tj�|j|t|j�d��}ntd||jf��|jrX||j7}||kr�tj�	|�}tj�
|�s�|r�t�|�|�d||�|j
�s2|d}tj�|�r�zt�|�Wn.tk
r�}z|�d|�W5d}~XYnXzt�||�Wn2tk
�r0}z|�d||�W5d}~XYnXtt|�j}	|	||||�|j
�s`t�||�||k�rvt�||�dS)Nz5filename %s does not start with the input_base_dir %szWriting converted %s to %s.z.bakzCan't remove backup %szCan't rename %s to %s)r�
startswithrr�path�join�len�
ValueErrorr�dirname�isdir�makedirs�log_messager�lexists�remove�OSError�renamerr�
write_file�shutilZcopymode)
rZnew_textrZold_text�encodingZ
orig_filenamerZbackup�err�writer rr
r7EsJ
���

� 
z StdoutRefactoringTool.write_filec	Cs�|r|�d|�n�|�d|�|jr�t|||�}zP|jdk	rl|j�"|D]}t|�qHtj��W5QRXn|D]}t|�qpWn$tk
r�t	d|f�YdSXdS)NzNo changes to %sz
Refactored %sz+couldn't encode %s's diff for your terminal)
r2rrZoutput_lock�print�sys�stdout�flush�UnicodeEncodeError�warn)r�old�newrZequalZ
diff_lines�linerrr
�print_outputls$

�z"StdoutRefactoringTool.print_output)rrr)	�__name__�
__module__�__qualname__�__doc__rr)r7rE�
__classcell__rrr r
rs
�'rcCstd|ftjd�dS)NzWARNING: %s��file)r<r=�stderr)r&rrr
rA�srAc
stjdd�}|jddddd�|jdd	d
gdd�|jd
dddddd�|jddd
gdd�|jddddd�|jddddd�|jddddd�|jd dd!d�|jd"d#dd$d�|jd%d&dd'd(d�|jd)d*dd+d,d-d.�|jd/d0dd1d�|jd2dd+d,d3d.�d'}i}|�|�\}}|j�r@d4|d5<|j�s:td6�d4|_|j�rZ|j�sZ|�	d7�|j
�rt|j�st|�	d8�|j�s�|j�r�td9�|j�s�|j�r�|�	d:�|j�r�t
d;�t���D]}t
|��q�|�s�d<S|�st
d=tjd>�t
d?tjd>�d@SdA|k�r(d4}|j�r(t
dBtjd>�d@S|j�r8d4|dC<|j�rFtjntj}tjdD|dE�t�dF�}tt����}	t�fdGdH�|jD��}
t�}|j�r�d'}|jD](}
|
dIk�r�d4}n|��dJ|
��q�|�r�|	�|�n|}n
|	�|�}|�|
�}t j!�"|�}|�r0|�#t j$��s0t j!�%|��s0t j!�&|�}|j�rT|�'t j$�}|�(dK|j|�t)t*|�|t*|�|j|j||j|j
dL�}|j+�s�|�r�|�,�nTz|�||j|j-|j.�Wn8tj/k
�r�|j.dk�s�t0�t
dMtjd>�YdSX|�1�t2t3|j+��S)Nz�Main program.

    Args:
        fixer_pkg: the name of a package where the fixers are located.
        args: optional; a list of command line arguments. If omitted,
              sys.argv[1:] is used.

    Returns a suggested exit status (0, 1, 2).
    z2to3 [options] file|dir ...)Zusagez-dz--doctests_only�
store_truezFix up doctests only)�action�helpz-fz--fixr#z1Each FIX specifies a transformation; default: all)rO�defaultrPz-jz--processesZstorer�intzRun 2to3 concurrently)rOrQ�typerPz-xz--nofixz'Prevent a transformation from being runz-lz--list-fixeszList available transformationsz-pz--print-functionz0Modify the grammar so that print() is a functionz-vz	--verbosezMore verbose loggingz
--no-diffsz#Don't show diffs of the refactoringz-wz--writezWrite back modified filesz-nz--nobackupsFz&Don't write backups for modified filesz-oz--output-dir�strrzXPut output files in this directory instead of overwriting the input files.  Requires -n.)rOrSrQrPz-Wz--write-unchanged-fileszYAlso write files even if no changes were required (useful with --output-dir); implies -w.z--add-suffixzuAppend this string to all output filenames. Requires -n if non-empty.  ex: --add-suffix='3' will generate .py3 files.T�write_unchanged_filesz&--write-unchanged-files/-W implies -w.z%Can't use --output-dir/-o without -n.z"Can't use --add-suffix without -n.z@not writing files and not printing diffs; that's not very usefulzCan't use -n without -wz2Available transformations for the -f/--fix option:rz1At least one file or directory argument required.rKzUse --help to show usage.��-zCan't write to stdin.rz%(name)s: %(message)s)�format�levelzlib2to3.mainc3s|]}�d|VqdS)�.fix_Nr)�.0�fix��	fixer_pkgrr
�	<genexpr>�szmain.<locals>.<genexpr>�allrZz7Output in %r will mirror the input directory %r layout.)rrrz+Sorry, -j isn't supported on this platform.)4�optparseZOptionParserZ
add_option�
parse_argsrUr;rArrr%Z
add_suffixZno_diffsZ
list_fixesr<rZget_all_fix_namesr=rMr�verbose�logging�DEBUG�INFOZbasicConfigZ	getLogger�setZget_fixers_from_packageZnofixr\�add�union�
differencerr+�commonprefixrrr0r/�rstrip�infor�sortedr"�refactor_stdinZ
doctests_onlyZ	processesZMultiprocessingUnsupported�AssertionErrorZ	summarizerR�bool)r^r'�parserro�flagsrZfixnamerYr$Zavail_fixesZunwanted_fixesrZall_presentr\Z	requestedZfixer_namesrZrtrr]r
�main�s�
����
�
�
��
���
��









���
��rt)N)rIZ
__future__rrr=rrrdr8rarrrZMultiprocessRefactoringToolrrArtrrrr
�<module>s	glib2to3/__pycache__/btm_utils.cpython-38.opt-1.pyc000064400000014010151153537460015631 0ustar00U

e5d�&�@s|dZddlmZddlmZmZddlmZmZeZ	eZ
ejZeZ
dZdZdZGdd	�d	e�Zddd�Zd
d�Zdd�Zd
S)z0Utility functions used by the btm_matcher module�)�pytree)�grammar�token)�pattern_symbols�python_symbols���������c@s:eZdZdZd
dd�Zdd�Zdd�Zd	d
�Zdd�ZdS)�MinNodez�This class serves as an intermediate representation of the
    pattern tree during the conversion to sets of leaf-to-root
    subpatternsNcCs.||_||_g|_d|_d|_g|_g|_dS)NF)�type�name�children�leaf�parent�alternatives�group)�selfrr�r�)/usr/lib64/python3.8/lib2to3/btm_utils.py�__init__szMinNode.__init__cCst|j�dt|j�S)N� )�strrr)rrrr�__repr__szMinNode.__repr__cCs�|}g}|r�|jtkr^|j�|�t|j�t|j�krRt|j�g}g|_|j}qn|j}d}q�|jtkr�|j	�|�t|j	�t|j�kr�t
|j	�}g|_	|j}qn|j}d}q�|jtjkr�|j
r�|�|j
�n|�|j�|j}q|S)z�Internal method. Returns a characteristic path of the
        pattern tree. This method must be run for all leaves until the
        linear subpatterns are merged into a singleN)r�TYPE_ALTERNATIVESr�append�lenr
�tupler�
TYPE_GROUPr�get_characteristic_subpattern�token_labels�NAMEr)r�node�subprrr�leaf_to_root!s8


zMinNode.leaf_to_rootcCs&|��D]}|��}|r|SqdS)a�Drives the leaf_to_root method. The reason that
        leaf_to_root must be run multiple times is because we need to
        reject 'group' matches; for example the alternative form
        (a | b c) creates a group [b c] that needs to be matched. Since
        matching multiple linear patterns overcomes the automaton's
        capabilities, leaf_to_root merges each group into a single
        choice based on 'characteristic'ity,

        i.e. (a|b c) -> (a|b) if b more characteristic than c

        Returns: The most 'characteristic'(as defined by
          get_characteristic_subpattern) path for the compiled pattern
          tree.
        N)�leavesr#)r�lr"rrr�get_linear_subpatternKszMinNode.get_linear_subpatternccs*|jD]}|��EdHq|js&|VdS)z-Generator that returns the leaves of the treeN)r
r$)r�childrrrr$`s
zMinNode.leaves)NN)	�__name__�
__module__�__qualname__�__doc__rrr#r&r$rrrrr
s
	*r
Nc
Cs�d}|jtjkr|jd}|jtjkr�t|j�dkrFt|jd|�}nFttd�}|jD]4}|j�	|�drlqVt||�}|dk	rV|j�
|�qV�n|jtjkr�t|j�dkr�ttd�}|jD]}t||�}|r�|j�
|�q�|js�d}nt|jd|�}�n�|jtj
k�r�t|jdtj��r>|jdjdk�r>t|jd|�St|jdtj��rd|jdjdk�s�t|j�dk�r�t|jdd��r�|jdjdk�r�dSd	}d}d}d
}d}	d
}
|jD]d}|jtjk�r�d
}|}n*|jtjk�r�d	}|}	n|jtjk�r|}t|d��r�|jdk�r�d	}
�q�|
�rT|jd}t|d��r^|jdk�r^|jd}n
|jd}|jtjk�r�|jd
k�r�ttd�}n4tt|j��r�ttt|j�d�}nttt|j�d�}n\|jtjk�r�|j�d�}|tk�r�tt|d�}nttj|d�}n|jtjk�rt||�}|�rL|	jdjdk�r4d}n|	jdjdk�rHnt�|�r�|dk	�r�|jdd�D]&}t||�}|dk	�rj|j�
|��qj|�r�||_|S)z�
    Internal function. Reduces a compiled pattern tree to an
    intermediate representation suitable for feeding the
    automaton. This also trims off any optional pattern elements(like
    [a], a*).
    N��)rr�(�[�valueTF�=��any�')rr�*�+r)r�symsZMatcherr
ZAlternativesr�reduce_treer
r�indexrZAlternativerZUnit�
isinstancerZLeafr0�hasattrZDetailsZRepeaterrr �TYPE_ANY�getattr�pysyms�STRING�strip�tokens�NotImplementedErrorr)
r!rZnew_noder'ZreducedrZdetails_nodeZalternatives_nodeZhas_repeaterZ
repeater_nodeZhas_variable_nameZ	name_leafrrrrr8gs�






�����






r8cs�t|t�s|St|�dkr"|dSg}g}dddddg�g}d�|D]d}tt|d	d
���rDtt|�fdd
���r||�|�qDtt|�fdd
���r�|�|�qD|�|�qD|r�|}n|r�|}n|r�|}t|td
�S)z�Picks the most characteristic from a list of linear patterns
    Current order used is:
    names > common_names > common_chars
    rr,�in�for�if�not�Nonez[]().,:cSst|�tkS�N)rr��xrrr�<lambda>��z/get_characteristic_subpattern.<locals>.<lambda>cst|t�o|�kSrH�r:rrI)�common_charsrrrKrLcst|t�o|�kSrHrMrI)�common_namesrrrKrL)�key)r:�listrr3�rec_testr�max)ZsubpatternsZsubpatterns_with_namesZsubpatterns_with_common_namesZsubpatterns_with_common_chars�
subpatternr)rNrOrr�s6

�
�rccs8|D].}t|ttf�r(t||�EdHq||�VqdS)zPTests test_func on all items of sequence and items of included
    sub-iterablesN)r:rQrrR)ZsequenceZ	test_funcrJrrrrRsrR)N)r+�rZpgen2rrZpygramrrr7r>ZopmaprArr<rr�objectr
r8rrRrrrr�<module>sW
%lib2to3/__pycache__/__init__.cpython-38.opt-1.pyc000064400000000203151153537460015365 0ustar00U

e5d�@sdS)N�rrr�(/usr/lib64/python3.8/lib2to3/__init__.py�<module>�lib2to3/__pycache__/fixer_util.cpython-38.opt-1.pyc000064400000027650151153537460016017 0ustar00U

e5dg;�
@s�dZddlmZddlmZmZddlmZddl	m
Z
dd�Zdd	�Zd
d�Z
dd
�ZdWdd�Zdd�Zdd�Zdd�Ze�e
�fdd�ZdXdd�Zdd�Zdd�ZdYdd �Zd!d"�ZdZd#d$�Zd[d%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2d3d4d5d6d7d8d9d:h
Z d;d<�Z!d=a"d>a#d?a$d@a%dAdB�Z&dCdD�Z'dEdF�Z(dGdH�Z)dIdJ�Z*dKdL�Z+dMdN�Z,dOdP�Z-ej.ej/hZ0d\dQdR�Z1ej/ej.ej2hZ3dSdT�Z4d]dUdV�Z5dS)^z1Utility functions, node construction macros, etc.�)�token)�Leaf�Node)�python_symbols)�patcompcCsttj|ttjd�|g�S)N�=)r�symsZargumentrr�EQUAL)�keyword�value�r�*/usr/lib64/python3.8/lib2to3/fixer_util.py�
KeywordArgs�rcCsttjd�S)N�()rr�LPARrrrr
�LParensrcCsttjd�S)N�))rr�RPARrrrr
�RParensrcCsHt|t�s|g}t|t�s&d|_|g}ttj|ttjddd�g|�S)zBuild an assignment statement� r��prefix)	�
isinstance�listrrr�atomrrr	)�target�sourcerrr
�Assigns

�rNcCsttj||d�S)zReturn a NAME leafr)rr�NAME)�namerrrr
�Name$sr cCs|ttjt�|g�gS)zA node tuple for obj.attr)rr�trailer�Dot)�obj�attrrrr
�Attr(sr%cCsttjd�S)zA comma leaf�,)rr�COMMArrrr
�Comma,sr(cCsttjd�S)zA period (.) leaf�.)rr�DOTrrrr
r"0sr"cCs4ttj|��|��g�}|r0|�dttj|��|S)z-A parenthesised argument list, used by Call()r)rrr!�clone�insert_child�arglist)�argsZlparenZrparen�noderrr
�ArgList4sr0cCs&ttj|t|�g�}|dk	r"||_|S)zA function callN)rr�powerr0r)Z	func_namer.rr/rrr
�Call;sr2cCsttjd�S)zA newline literal�
�rr�NEWLINErrrr
�NewlineBsr6cCsttjd�S)zA blank line�r4rrrr
�	BlankLineFsr8cCsttj||d�S)Nr)rr�NUMBER)�nrrrr
�NumberJsr;cCs"ttjttjd�|ttjd�g�S)zA numeric or string subscript�[�])rrr!rr�LBRACE�RBRACE)Z
index_noderrr
�	SubscriptMs
�r@cCsttj||d�S)z
A string leafr)rr�STRING)�stringrrrr
�StringSsrCc	Cs�d|_d|_d|_ttjd�}d|_ttjd�}d|_||||g}|rtd|_ttjd�}d|_|�ttj||g��ttj|ttj	|�g�}ttj
ttjd�|ttjd�g�S)zuA list comprehension of the form [xp for fp in it if test].

    If test is None, the "if test" part is omitted.
    r7r�for�in�ifr<r=)
rrrr�appendrrZcomp_ifZ	listmakerZcomp_forrr>r?)	Zxp�fp�itZtestZfor_leafZin_leafZ
inner_argsZif_leaf�innerrrr
�ListCompWs(

��rKcCsV|D]}|��qttjd�ttj|dd�ttjddd�ttj|�g}ttj|�}|S)zO Return an import statement in the form:
        from package import name_leafs�fromrr�import)�removerrrrr�import_as_names�import_from)Zpackage_nameZ
name_leafsZleaf�children�imprrr
�
FromImportos


�rSc	Cs�|d��}|jtjkr"|��}nttj|��g�}|d}|rNdd�|D�}ttjtt|d�t|d��ttj|d��||d��g�g|�}|j	|_	|S)	zfReturns an import statement and calls a method
    of the module:

    import module
    module.name()r#�aftercSsg|]}|���qSr)r+)�.0r:rrr
�
<listcomp>�sz!ImportAndCall.<locals>.<listcomp>�rZlparZrpar)
r+�typerr-rr1r%r r!r)r/�results�namesr#Z
newarglistrT�newrrr
�
ImportAndCall�s*


�����r\cCs�t|t�r |jt�t�gkr dSt|t�o�t|j�dko�t|jdt�o�t|jdt�o�t|jdt�o�|jdjdko�|jdjdkS)z(Does the node represent a tuple literal?T�rWr�rr)rrrQrr�lenrr�r/rrr
�is_tuple�s
������racCsXt|t�oVt|j�dkoVt|jdt�oVt|jdt�oV|jdjdkoV|jdjdkS)z'Does the node represent a list literal?rrW���r<r=)rrr_rQrrr`rrr
�is_list�s
�����rccCsttjt�|t�g�S�N)rrrrrr`rrr
�parenthesize�sre�sortedr�set�any�all�tuple�sum�min�max�	enumerateccs$t||�}|r |Vt||�}q
dS)alFollow an attribute chain.

    If you have a chain of objects where a.foo -> b, b.foo-> c, etc,
    use this to iterate over all objects in the chain. Iteration is
    terminated by getattr(x, attr) is None.

    Args:
        obj: the starting object
        attr: the name of the chaining attribute

    Yields:
        Each successive object in the chain.
    N)�getattr)r#r$�nextrrr
�
attr_chain�s
rqzefor_stmt< 'for' any 'in' node=any ':' any* >
        | comp_for< 'for' any 'in' node=any any* >
     z�
power<
    ( 'iter' | 'list' | 'tuple' | 'sorted' | 'set' | 'sum' |
      'any' | 'all' | 'enumerate' | (any* trailer< '.' 'join' >) )
    trailer< '(' node=any ')' >
    any*
>
z`
power<
    ( 'sorted' | 'enumerate' )
    trailer< '(' arglist<node=any any*> ')' >
    any*
>
FcCspts&t�t�at�t�at�t�adatttg}t|t|d��D]*\}}i}|�||�r@|d|kr@dSq@dS)a Returns true if node is in an environment where all that is required
        of it is being iterable (ie, it doesn't matter if it returns a list
        or an iterator).
        See test_map_nochange in test_fixers.py for some examples and tests.
        T�parentr/F)	�
pats_builtrZcompile_pattern�p0�p1�p2�ziprq�match)r/Zpatterns�patternrrrYrrr
�in_special_context�s



rzcCs�|j}|dk	r|jtjkrdS|j}|jtjtjfkr:dS|jtjkrX|j	d|krXdS|jtj
ks�|jtjkr�|dk	r�|jtjks�|j	d|kr�dSdS)zG
    Check that something isn't an attribute or function name etc.
    NFrWT)
Zprev_siblingrXrr*rrr�funcdef�classdef�	expr_stmtrQZ
parametersZ
typedargslistr')r/�prevrrrrr
�is_probably_builtin�s&
��
��rcCsJ|dk	rF|jtjkr>t|j�dkr>|jd}|jtjkr>|jS|j}qdS)zFind the indentation of *node*.Nr^rr7)	rXr�suiter_rQr�INDENTrrr)r/�indentrrr
�find_indentations
r�cCs>|jtjkr|S|��}|jd}|_ttj|g�}||_|Srd)rXrr�r+rrr)r/rrr�rrr
�
make_suitesr�cCs$|jtjkr |j}|std��q|S)zFind the top level namespace.z,root found before file_input node was found.)rXrZ
file_inputrr�
ValueErrorr`rrr
�	find_root&s

r�cCst|t|�|�}t|�S)z� Returns true if name is imported from package at the
        top level of the tree which node belongs to.
        To cover the case of an import like 'import foo', use
        None for the package and 'foo' for the name. )�find_bindingr��bool)�packagerr/Zbindingrrr
�does_tree_import/sr�cCs|jtjtjfkS)z0Returns true if the node is an import statement.)rXr�import_namerPr`rrr
�	is_import7sr�cCs.dd�}t|�}t|||�r dSd}}t|j�D]F\}}||�sDq2t|j|d��D]\}}||�sVqlqV||}qzq2|dkr�t|j�D]8\}}|jtjkr�|jr�|jdjtjkr�|d}q�q�|dkr�t	tj
ttjd�ttj|dd�g�}	nt
|ttj|dd�g�}	|	t�g}
|�|t	tj|
��dS)	z\ Works like `does_tree_import` but adds an import statement
        if it was not imported. cSs |jtjko|jot|jd�S)NrW)rXr�simple_stmtrQr�r`rrr
�is_import_stmt>s�z$touch_import.<locals>.is_import_stmtNrWrrMrr)r�r�rnrQrXrr�rrArr�rrrSr6r,)r�rr/r��rootZ
insert_pos�offset�idxZnode2�import_rQrrr
�touch_import;s8�
�
r�cCs�|jD�]�}d}|jtjkrVt||jd�r4|St|t|jd�|�}|rR|}�n0|jtjtjfkr�t|t|jd�|�}|r�|}�n�|jtj	k�rt|t|jd�|�}|r�|}nTt
|jdd��D]@\}}|jtjkr�|j
dkr�t|t|j|d�|�}|r�|}q�nx|jtk�r2|jdj
|k�r2|}nTt|||��rF|}n@|jtjk�rbt|||�}n$|jtjk�r�t||jd��r�|}|r|�s�|St|�r|SqdS)	z� Returns the node which binds variable name, otherwise None.
        If optional argument package is supplied, only imports will
        be returned.
        See test cases for examples.Nrrbr^r]�:�rW)rQrXrZfor_stmt�_findr�r�Zif_stmtZ
while_stmtZtry_stmtrnr�COLONr�	_def_syms�_is_import_bindingr�r}r�)rr/r��childZretr:�iZkidrrr
r�isH
r�cCsT|g}|rP|��}|jdkr4|jtkr4|�|j�q|jtjkr|j|kr|SqdS)N�)�poprX�_block_syms�extendrQrrr)rr/Znodesrrr
r��sr�cCs�|jtjkr�|s�|jd}|jtjkrx|jD]H}|jtjkrV|jdj|krt|Sq,|jtjkr,|j|kr,|Sq,nL|jtjkr�|jd}|jtjkr�|j|kr�|Sn|jtjkr�|j|kr�|Sn�|jtj	k�r�|r�t
|jd���|kr�dS|jd}|�rtd|��rdS|jtj
k�r0t||��r0|S|jtjk�rh|jd}|jtjk�r�|j|k�r�|Sn6|jtjk�r�|j|k�r�|S|�r�|jtjk�r�|SdS)z� Will reuturn node if node will import name, or node
        will import * from package.  None is returned otherwise.
        See test cases for examples. rr^rbNr]�as)rXrr�rQZdotted_as_namesZdotted_as_namerrrrP�str�stripr�rOZimport_as_name�STAR)r/rr�rRr�Zlastr:rrr
r��s@





r�)N)NN)N)N)N)N)N)6�__doc__Zpgen2rZpytreerrZpygramrrr7rrrrrr r%r(r"r0r2r6r8r;r@rCrKrSr\rarcreZconsuming_callsrqrtrurvrsrzrr�r�r�r�r�r�r|r{r�r�r!r�r�r�rrrr
�<module>s`




�		-
*
lib2to3/__pycache__/fixer_util.cpython-38.pyc000064400000027650151153537460015060 0ustar00U

e5dg;�
@s�dZddlmZddlmZmZddlmZddl	m
Z
dd�Zdd	�Zd
d�Z
dd
�ZdWdd�Zdd�Zdd�Zdd�Ze�e
�fdd�ZdXdd�Zdd�Zdd�ZdYdd �Zd!d"�ZdZd#d$�Zd[d%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2d3d4d5d6d7d8d9d:h
Z d;d<�Z!d=a"d>a#d?a$d@a%dAdB�Z&dCdD�Z'dEdF�Z(dGdH�Z)dIdJ�Z*dKdL�Z+dMdN�Z,dOdP�Z-ej.ej/hZ0d\dQdR�Z1ej/ej.ej2hZ3dSdT�Z4d]dUdV�Z5dS)^z1Utility functions, node construction macros, etc.�)�token)�Leaf�Node)�python_symbols)�patcompcCsttj|ttjd�|g�S)N�=)r�symsZargumentrr�EQUAL)�keyword�value�r�*/usr/lib64/python3.8/lib2to3/fixer_util.py�
KeywordArgs�rcCsttjd�S)N�()rr�LPARrrrr
�LParensrcCsttjd�S)N�))rr�RPARrrrr
�RParensrcCsHt|t�s|g}t|t�s&d|_|g}ttj|ttjddd�g|�S)zBuild an assignment statement� r��prefix)	�
isinstance�listrrr�atomrrr	)�target�sourcerrr
�Assigns

�rNcCsttj||d�S)zReturn a NAME leafr)rr�NAME)�namerrrr
�Name$sr cCs|ttjt�|g�gS)zA node tuple for obj.attr)rr�trailer�Dot)�obj�attrrrr
�Attr(sr%cCsttjd�S)zA comma leaf�,)rr�COMMArrrr
�Comma,sr(cCsttjd�S)zA period (.) leaf�.)rr�DOTrrrr
r"0sr"cCs4ttj|��|��g�}|r0|�dttj|��|S)z-A parenthesised argument list, used by Call()r)rrr!�clone�insert_child�arglist)�argsZlparenZrparen�noderrr
�ArgList4sr0cCs&ttj|t|�g�}|dk	r"||_|S)zA function callN)rr�powerr0r)Z	func_namer.rr/rrr
�Call;sr2cCsttjd�S)zA newline literal�
�rr�NEWLINErrrr
�NewlineBsr6cCsttjd�S)zA blank line�r4rrrr
�	BlankLineFsr8cCsttj||d�S)Nr)rr�NUMBER)�nrrrr
�NumberJsr;cCs"ttjttjd�|ttjd�g�S)zA numeric or string subscript�[�])rrr!rr�LBRACE�RBRACE)Z
index_noderrr
�	SubscriptMs
�r@cCsttj||d�S)z
A string leafr)rr�STRING)�stringrrrr
�StringSsrCc	Cs�d|_d|_d|_ttjd�}d|_ttjd�}d|_||||g}|rtd|_ttjd�}d|_|�ttj||g��ttj|ttj	|�g�}ttj
ttjd�|ttjd�g�S)zuA list comprehension of the form [xp for fp in it if test].

    If test is None, the "if test" part is omitted.
    r7r�for�in�ifr<r=)
rrrr�appendrrZcomp_ifZ	listmakerZcomp_forrr>r?)	Zxp�fp�itZtestZfor_leafZin_leafZ
inner_argsZif_leaf�innerrrr
�ListCompWs(

��rKcCsV|D]}|��qttjd�ttj|dd�ttjddd�ttj|�g}ttj|�}|S)zO Return an import statement in the form:
        from package import name_leafs�fromrr�import)�removerrrrr�import_as_names�import_from)Zpackage_nameZ
name_leafsZleaf�children�imprrr
�
FromImportos


�rSc	Cs�|d��}|jtjkr"|��}nttj|��g�}|d}|rNdd�|D�}ttjtt|d�t|d��ttj|d��||d��g�g|�}|j	|_	|S)	zfReturns an import statement and calls a method
    of the module:

    import module
    module.name()r#�aftercSsg|]}|���qSr)r+)�.0r:rrr
�
<listcomp>�sz!ImportAndCall.<locals>.<listcomp>�rZlparZrpar)
r+�typerr-rr1r%r r!r)r/�results�namesr#Z
newarglistrT�newrrr
�
ImportAndCall�s*


�����r\cCs�t|t�r |jt�t�gkr dSt|t�o�t|j�dko�t|jdt�o�t|jdt�o�t|jdt�o�|jdjdko�|jdjdkS)z(Does the node represent a tuple literal?T�rWr�rr)rrrQrr�lenrr�r/rrr
�is_tuple�s
������racCsXt|t�oVt|j�dkoVt|jdt�oVt|jdt�oV|jdjdkoV|jdjdkS)z'Does the node represent a list literal?rrW���r<r=)rrr_rQrrr`rrr
�is_list�s
�����rccCsttjt�|t�g�S�N)rrrrrr`rrr
�parenthesize�sre�sortedr�set�any�all�tuple�sum�min�max�	enumerateccs$t||�}|r |Vt||�}q
dS)alFollow an attribute chain.

    If you have a chain of objects where a.foo -> b, b.foo-> c, etc,
    use this to iterate over all objects in the chain. Iteration is
    terminated by getattr(x, attr) is None.

    Args:
        obj: the starting object
        attr: the name of the chaining attribute

    Yields:
        Each successive object in the chain.
    N)�getattr)r#r$�nextrrr
�
attr_chain�s
rqzefor_stmt< 'for' any 'in' node=any ':' any* >
        | comp_for< 'for' any 'in' node=any any* >
     z�
power<
    ( 'iter' | 'list' | 'tuple' | 'sorted' | 'set' | 'sum' |
      'any' | 'all' | 'enumerate' | (any* trailer< '.' 'join' >) )
    trailer< '(' node=any ')' >
    any*
>
z`
power<
    ( 'sorted' | 'enumerate' )
    trailer< '(' arglist<node=any any*> ')' >
    any*
>
FcCspts&t�t�at�t�at�t�adatttg}t|t|d��D]*\}}i}|�||�r@|d|kr@dSq@dS)a Returns true if node is in an environment where all that is required
        of it is being iterable (ie, it doesn't matter if it returns a list
        or an iterator).
        See test_map_nochange in test_fixers.py for some examples and tests.
        T�parentr/F)	�
pats_builtrZcompile_pattern�p0�p1�p2�ziprq�match)r/Zpatterns�patternrrrYrrr
�in_special_context�s



rzcCs�|j}|dk	r|jtjkrdS|j}|jtjtjfkr:dS|jtjkrX|j	d|krXdS|jtj
ks�|jtjkr�|dk	r�|jtjks�|j	d|kr�dSdS)zG
    Check that something isn't an attribute or function name etc.
    NFrWT)
Zprev_siblingrXrr*rrr�funcdef�classdef�	expr_stmtrQZ
parametersZ
typedargslistr')r/�prevrrrrr
�is_probably_builtin�s&
��
��rcCsJ|dk	rF|jtjkr>t|j�dkr>|jd}|jtjkr>|jS|j}qdS)zFind the indentation of *node*.Nr^rr7)	rXr�suiter_rQr�INDENTrrr)r/�indentrrr
�find_indentations
r�cCs>|jtjkr|S|��}|jd}|_ttj|g�}||_|Srd)rXrr�r+rrr)r/rrr�rrr
�
make_suitesr�cCs$|jtjkr |j}|std��q|S)zFind the top level namespace.z,root found before file_input node was found.)rXrZ
file_inputrr�
ValueErrorr`rrr
�	find_root&s

r�cCst|t|�|�}t|�S)z� Returns true if name is imported from package at the
        top level of the tree which node belongs to.
        To cover the case of an import like 'import foo', use
        None for the package and 'foo' for the name. )�find_bindingr��bool)�packagerr/Zbindingrrr
�does_tree_import/sr�cCs|jtjtjfkS)z0Returns true if the node is an import statement.)rXr�import_namerPr`rrr
�	is_import7sr�cCs.dd�}t|�}t|||�r dSd}}t|j�D]F\}}||�sDq2t|j|d��D]\}}||�sVqlqV||}qzq2|dkr�t|j�D]8\}}|jtjkr�|jr�|jdjtjkr�|d}q�q�|dkr�t	tj
ttjd�ttj|dd�g�}	nt
|ttj|dd�g�}	|	t�g}
|�|t	tj|
��dS)	z\ Works like `does_tree_import` but adds an import statement
        if it was not imported. cSs |jtjko|jot|jd�S)NrW)rXr�simple_stmtrQr�r`rrr
�is_import_stmt>s�z$touch_import.<locals>.is_import_stmtNrWrrMrr)r�r�rnrQrXrr�rrArr�rrrSr6r,)r�rr/r��rootZ
insert_pos�offset�idxZnode2�import_rQrrr
�touch_import;s8�
�
r�cCs�|jD�]�}d}|jtjkrVt||jd�r4|St|t|jd�|�}|rR|}�n0|jtjtjfkr�t|t|jd�|�}|r�|}�n�|jtj	k�rt|t|jd�|�}|r�|}nTt
|jdd��D]@\}}|jtjkr�|j
dkr�t|t|j|d�|�}|r�|}q�nx|jtk�r2|jdj
|k�r2|}nTt|||��rF|}n@|jtjk�rbt|||�}n$|jtjk�r�t||jd��r�|}|r|�s�|St|�r|SqdS)	z� Returns the node which binds variable name, otherwise None.
        If optional argument package is supplied, only imports will
        be returned.
        See test cases for examples.Nrrbr^r]�:�rW)rQrXrZfor_stmt�_findr�r�Zif_stmtZ
while_stmtZtry_stmtrnr�COLONr�	_def_syms�_is_import_bindingr�r}r�)rr/r��childZretr:�iZkidrrr
r�isH
r�cCsT|g}|rP|��}|jdkr4|jtkr4|�|j�q|jtjkr|j|kr|SqdS)N�)�poprX�_block_syms�extendrQrrr)rr/Znodesrrr
r��sr�cCs�|jtjkr�|s�|jd}|jtjkrx|jD]H}|jtjkrV|jdj|krt|Sq,|jtjkr,|j|kr,|Sq,nL|jtjkr�|jd}|jtjkr�|j|kr�|Sn|jtjkr�|j|kr�|Sn�|jtj	k�r�|r�t
|jd���|kr�dS|jd}|�rtd|��rdS|jtj
k�r0t||��r0|S|jtjk�rh|jd}|jtjk�r�|j|k�r�|Sn6|jtjk�r�|j|k�r�|S|�r�|jtjk�r�|SdS)z� Will reuturn node if node will import name, or node
        will import * from package.  None is returned otherwise.
        See test cases for examples. rr^rbNr]�as)rXrr�rQZdotted_as_namesZdotted_as_namerrrrP�str�stripr�rOZimport_as_name�STAR)r/rr�rRr�Zlastr:rrr
r��s@





r�)N)NN)N)N)N)N)N)6�__doc__Zpgen2rZpytreerrZpygramrrr7rrrrrr r%r(r"r0r2r6r8r;r@rCrKrSr\rarcreZconsuming_callsrqrtrurvrsrzrr�r�r�r�r�r�r|r{r�r�r!r�r�r�rrrr
�<module>s`




�		-
*
lib2to3/__pycache__/pygram.cpython-38.opt-2.pyc000064400000002041151153537460015130 0ustar00U

e5d�@s�ddlZddlmZddlmZddlmZej�ej�e	�d�Z
ej�ej�e	�d�ZGdd	�d	e�Z
e�d
e
�Ze
e�Ze��Zejd=e��Zejd=e�d
e�Ze
e�ZdS)
�N�)�token)�driver)�pytreezGrammar.txtzPatternGrammar.txtc@seZdZdd�ZdS)�SymbolscCs$|j��D]\}}t|||�q
dS)N)Z
symbol2number�items�setattr)�selfZgrammar�nameZsymbol�r�&/usr/lib64/python3.8/lib2to3/pygram.py�__init__szSymbols.__init__N)�__name__�
__module__�__qualname__r
rrrrrsrZlib2to3�print�exec)�osZpgen2rr�r�path�join�dirname�__file__Z
_GRAMMAR_FILEZ_PATTERN_GRAMMAR_FILE�objectrZload_packaged_grammarZpython_grammarZpython_symbols�copyZ!python_grammar_no_print_statement�keywordsZ*python_grammar_no_print_and_exec_statementZpattern_grammarZpattern_symbolsrrrr�<module>s �lib2to3/__pycache__/refactor.cpython-38.opt-2.pyc000064400000037753151153537460015460 0ustar00U

e5dk�@s
dZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZmZm
Z
ddlmZddlmZmZddlmZd d
d�ZGdd
�d
e�Zdd�Zdd�Zdd�Zdd�Zdd�ZGdd�de�ZGdd�de�ZGdd�de�Z Gdd�de�Z!dS)!z#Guido van Rossum <guido@python.org>�N)�chain�)�driver�tokenize�token)�	find_root)�pytree�pygram)�btm_matcherTcCsTt|ggdg�}g}t�|j�D].\}}}|�d�r |rD|dd�}|�|�q |S)N�*�fix_�)�
__import__�pkgutilZiter_modules�__path__�
startswith�append)Z	fixer_pkgZ
remove_prefixZpkgZ	fix_names�finder�nameZispkg�r�(/usr/lib64/python3.8/lib2to3/refactor.py�get_all_fix_namess
rc@seZdZdS)�
_EveryNodeN��__name__�
__module__�__qualname__rrrrr+srcCs�t|tjtjf�r(|jdkr t�|jhSt|tj�rH|jrDt|j�St�t|tj	�r�t
�}|jD]}|D]}|�t|��qhq`|Std|��dS)Nz$Oh no! I don't understand pattern %s)
�
isinstancerZNodePatternZLeafPattern�typerZNegatedPatternZcontent�_get_head_typesZWildcardPattern�set�update�	Exception)Zpat�r�p�xrrrr/s


rc	Cs�t�t�}g}|D]x}|jrdzt|j�}Wntk
rH|�|�Yq�X|D]}||�|�qNq|jdk	r�||j�|�q|�|�qtt	j
j��t	j
j
�D]}||�|�q�t|�S�N)�collections�defaultdict�list�patternrrrZ_accept_typerr	�python_grammarZ
symbol2number�values�tokens�extend�dict)Z
fixer_listZ
head_nodesZevery�fixerZheadsZ	node_typerrr�_get_headnode_dictKs$

�r1cs�fdd�t�d�D�S)Ncsg|]}�d|�qS��.r)�.0�fix_name�Zpkg_namerr�
<listcomp>hs�z+get_fixers_from_package.<locals>.<listcomp>F)rr6rr6r�get_fixers_from_packageds
�r8cCs|Sr&r)�objrrr�	_identityksr:csXd}t�t�|�j���fdd�}ttjtjtj	h�}t
�}z�|�\}}||krTq>q>|tjkrl|rf�q6d}q>|tjk�r6|dk�r6|�\}}|tjks�|dkr��q6|�\}}|tjks�|dkrq6|�\}}|tj
kr�|dkr�|�\}}|tjk�r4|�|�|�\}}|tj
k�s.|d	k�r"�q4|�\}}q�q>�q6q>Wntk
�rNYnXt|�S)
NFcst��}|d|dfS)Nrr)�next)�tok��genrr�advancersz(_detect_future_features.<locals>.advanceT�fromZ
__future__�import�(�,)r�generate_tokens�io�StringIO�readline�	frozensetr�NEWLINE�NL�COMMENTr �STRING�NAME�OP�add�
StopIteration)�sourceZhave_docstringr?�ignore�features�tp�valuerr=r�_detect_future_featuresosB








rVc@seZdZdS)�
FixerErrorNrrrrrrW�srWc@s�eZdZddd�ZdZdZd4dd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zd5dd�Zd6dd�Z
dd�Zd7dd�Zdd�Zd8dd�Zdd�Zd d!�Zd9d"d#�Zd:d$d%�Zd&Zd'Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�ZdS);�RefactoringToolF)�print_function�write_unchanged_filesZFixrNcCs.||_|pg|_|j��|_|dk	r0|j�|�|jdrDtj|_ntj	|_|j�
d�|_g|_t
�d�|_g|_d|_tj|jtj|jd�|_|��\|_|_g|_t��|_g|_g|_t|j|j�D]F}|j r�|j�!|�q�||jkr�|j�"|�q�||jkr�|j�"|�q�t#|j�|_$t#|j�|_%dS)NrYrZrXF)�convert�logger)&�fixers�explicit�_default_options�copy�optionsr!r	�!python_grammar_no_print_statement�grammarr+�getrZ�errors�loggingZ	getLoggerr\�	fixer_log�wroterZDriverrr[�
get_fixers�	pre_order�
post_order�files�bmZ
BottomMatcher�BMZ
bmi_pre_orderZbmi_post_orderrZ
BM_compatibleZ	add_fixerrr1�bmi_pre_order_heads�bmi_post_order_heads)�selfZfixer_namesrar^r0rrr�__init__�s>


�


zRefactoringTool.__init__c	CsXg}g}|jD�]}t|iidg�}|�dd�d}|�|j�rR|t|j�d�}|�d�}|jd�dd�|D��}zt	||�}Wn&t
k
r�td	||f�d�YnX||j|j
�}	|	jr�|jd
k	r�||jkr�|�d|�q|�d|�|	jd
k�r|�|	�q|	jdk�r|�|	�qtd|	j��qt�d�}
|j|
d�|j|
d�||fS)Nrr3r����_�cSsg|]}|���qSr)�title)r4r$rrrr7�sz.RefactoringTool.get_fixers.<locals>.<listcomp>zCan't find %s.%sTzSkipping optional fixer: %szAdding transformation: %sZpreZpostzIllegal fixer order: %rZ	run_order��key)r]r�rsplitr�FILE_PREFIX�len�split�CLASS_PREFIX�join�getattr�AttributeErrorrWrargr^�log_message�	log_debug�orderr�operator�
attrgetter�sort)rqZpre_order_fixersZpost_order_fixersZfix_mod_path�modr5�parts�
class_nameZ	fix_classr0Zkey_funcrrrri�s:
�
zRefactoringTool.get_fixerscOs�dSr&r)rq�msg�args�kwdsrrr�	log_error�szRefactoringTool.log_errorcGs|r||}|j�|�dSr&)r\�info�rqr�r�rrrr�szRefactoringTool.log_messagecGs|r||}|j�|�dSr&)r\�debugr�rrrr�	szRefactoringTool.log_debugcCsdSr&r)rq�old_text�new_text�filename�equalrrr�print_outputszRefactoringTool.print_outputcCs8|D].}tj�|�r$|�|||�q|�|||�qdSr&)�os�path�isdir�refactor_dir�
refactor_file)rq�items�write�
doctests_onlyZdir_or_filerrr�refactorszRefactoringTool.refactorc
Cs�tjd}t�|�D]�\}}}|�d|�|��|��|D]>}|�d�s>tj�|�d|kr>tj�||�}	|�	|	||�q>dd�|D�|dd�<qdS)N�pyzDescending into %sr3rcSsg|]}|�d�s|�qSr2)r)r4Zdnrrrr7.s
z0RefactoringTool.refactor_dir.<locals>.<listcomp>)
r��extsep�walkr�r�rr��splitextr~r�)
rqZdir_namer�r�Zpy_ext�dirpathZdirnames�	filenamesr�fullnamerrrr�s

�zRefactoringTool.refactor_dirc
Cs�zt|d�}Wn6tk
rD}z|�d||�WY�dSd}~XYnXzt�|j�d}W5|��Xtj|d|dd��}|��|fW5QR�SQRXdS)N�rbzCan't open %s: %s)NNrr#ru��encoding�newline)	�open�OSErrorr��closer�detect_encodingrGrE�read)rqr��f�errr�rrr�_read_python_source0s
z#RefactoringTool._read_python_sourcecCs�|�|�\}}|dkrdS|d7}|rn|�d|�|�||�}|jsL||kr`|�|||||�q�|�d|�nH|�||�}|js�|r�|jr�|jt|�dd�|||d�n|�d|�dS)N�
zRefactoring doctests in %szNo doctest changes in %srs)r�r�zNo changes in %s)r�r��refactor_docstringrZ�processed_file�refactor_string�was_changed�str)rqr�r�r��inputr��output�treerrrr�@s"�zRefactoringTool.refactor_filec
Cs�t|�}d|krtj|j_zVz|j�|�}Wn@tk
rl}z"|�d||jj	|�WY�W�dSd}~XYnXW5|j|j_X||_
|�d|�|�||�|S)NrYzCan't parse %s: %s: %szRefactoring %s)
rVr	rbrrcZparse_stringr"r��	__class__r�future_featuresr��
refactor_tree)rq�datarrSr�r�rrrr�Ws"
� zRefactoringTool.refactor_stringcCs�tj��}|rN|�d�|�|d�}|js2||krB|�|d|�q�|�d�n:|�|d�}|jsj|r~|jr~|�t	|�d|�n
|�d�dS)NzRefactoring doctests in stdinz<stdin>zNo doctest changes in stdinzNo changes in stdin)
�sys�stdinr�r�r�rZr�r�r�r�)rqr�r�r�r�rrr�refactor_stdinrs

zRefactoringTool.refactor_stdinc

Cs�t|j|j�D]}|�||�q|�|j|���|�|j|���|j�|�	��}t
|����r�|jjD�]D}||krj||rj||j
tjjdd�|jr�||j
tjjd�t||�D]�}|||kr�||�|�zt|�Wntk
�rYq�YnX|j�r||jk�rq�|�|�}|r�|�||�}|dk	r�|�|�|��D] }|j�s^g|_|j�|��qL|j�|�	��}|D]*}	|	|k�r�g||	<||	�||	��q�q�qjqTt|j|j�D]}|�||��q�|jS)NT)rx�reverserw)rrjrkZ
start_tree�traverse_byrorprn�runZleaves�anyr,r]r�rZBaseZdepthZkeep_line_orderZ
get_linenor)�remover�
ValueErrorZfixers_applied�match�	transform�replacerr.Zfinish_treer�)
rqr�rr0Z	match_set�node�results�newZnew_matchesZfxrrrrr��sJ



zRefactoringTool.refactor_treecCsV|sdS|D]D}||jD]4}|�|�}|r|�||�}|dk	r|�|�|}qqdSr&)rr�r�r�)rqr]Z	traversalr�r0r�r�rrrr��s

zRefactoringTool.traverse_bycCs�|j�|�|dkr.|�|�d}|dkr.dS||k}|�||||�|r`|�d|�|js`dS|rv|�||||�n|�d|�dS)NrzNo changes to %szNot writing changes to %s)rlrr�r�r�rZ�
write_file)rqr�r�r�r�r�r�rrrr��szRefactoringTool.processed_filecCs�ztj|d|dd�}Wn6tk
rL}z|�d||�WY�dSd}~XYnX|�Fz|�|�Wn0tk
r�}z|�d||�W5d}~XYnXW5QRX|�d|�d|_dS)N�wrur�zCan't create %s: %szCan't write %s: %szWrote changes to %sT)rEr�r�r�r�r�rh)rqr�r�r�r��fpr�rrrr��s*zRefactoringTool.write_filez>>> z... c
	Csg}d}d}d}d}|jdd�D]�}|d7}|���|j�r~|dk	rZ|�|�||||��|}|g}|�|j�}	|d|	�}q |dk	r�|�||j�s�|||j��dkr�|�	|�q |dk	r�|�|�||||��d}d}|�	|�q |dk	�r
|�|�||||��d�
|�S)NrT��keependsrr�ru)�
splitlines�lstripr�PS1r.�refactor_doctest�find�PS2�rstriprr~)
rqr�r��result�blockZblock_lineno�indent�lineno�line�irrrr�sJ����
�z"RefactoringTool.refactor_docstringc

sz��||��}Wnjtk
r|}zL�j�tj�rN|D]}��d|�d��q6��d|||j	j
|�|WY�Sd}~XYnX��||��rt|�j
dd�}|d|d�||dd�}	}|d�d�s�|dd7<��j|�d�g}|�r|��fd	d
�|D�7}|S)Nz
Source: %sr�z+Can't parse docstring in %s line %s: %s: %sTr�rrsrcsg|]}��j|�qSr)r�)r4r��r�rqrrr7Zsz4RefactoringTool.refactor_doctest.<locals>.<listcomp>)�parse_blockr"r\ZisEnabledForrf�DEBUGr�r�r�r�rr�r�r��endswithr��pop)
rqr�r�r�r�r�r�r�r�Zclippedrr�rr�@s,�"z RefactoringTool.refactor_doctestcCs�|jrd}nd}|js$|�d|�n"|�d|�|jD]}|�|�q6|jrl|�d�|jD]}|�|�q\|jr�t|j�dkr�|�d�n|�dt|j��|jD]\}}}|j|f|�|�q�dS)	N�werez
need to bezNo files %s modified.zFiles that %s modified:z$Warnings/messages while refactoring:rzThere was 1 error:zThere were %d errors:)rhrlr�rgrer{)rqr��file�messager�r�r�rrr�	summarize]s$


zRefactoringTool.summarizecCs"|j�|�|||��}t�|_|Sr&)rZparse_tokens�	wrap_toksrHr�)rqr�r�r�r�rrrr�tszRefactoringTool.parse_blockccsdt�|�||�j�}|D]F\}}\}}\}	}
}||d7}|	|d7}	||||f|	|
f|fVqdS)Nr)rrD�	gen_lines�__next__)rqr�r�r�r-rrUZline0Zcol0Zline1Zcol1Z	line_textrrrr�~s
zRefactoringTool.wrap_toksccsx||j}||j}|}|D]N}|�|�r>|t|�d�Vn(||��dkrVdVntd||f��|}qdVqldS)Nr�zline=%r, prefix=%rru)r�r�rr{r��AssertionError)rqr�r��prefix1Zprefix2�prefixr�rrrr��s


zRefactoringTool.gen_lines)NN)FF)FF)FF)F)NFN)N)rrrr_r}rzrrrir�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrX�s>�
4(
	


O�

+
rXc@seZdZdS)�MultiprocessingUnsupportedNrrrrrr��sr�csBeZdZ�fdd�Zd�fdd�	Z�fdd�Z�fd	d
�Z�ZS)�MultiprocessRefactoringToolcs"tt|�j||�d|_d|_dSr&)�superr�rr�queue�output_lock�rqr��kwargs�r�rrrr�sz$MultiprocessRefactoringTool.__init__Frc
s�|dkrtt���|||�Szddl�Wntk
r@t�YnX�jdk	rTtd������_��	��_
��fdd�t|�D�}z*|D]}|��q�tt���|||�W5�j��t|�D]}�j�
d�q�|D]}|��r�|��q�d�_XdS)Nrrz already doing multiple processescsg|]}�j�jd��qS))�target)ZProcess�_child)r4r���multiprocessingrqrrr7�s�z8MultiprocessRefactoringTool.refactor.<locals>.<listcomp>)r�r�r�r��ImportErrorr�r��RuntimeErrorZ
JoinableQueueZLockr��ranger~�putZis_alive�start)rqr�r�r�Z
num_processesZ	processesr�r$r�r�rr��s<
�



�
�

z$MultiprocessRefactoringTool.refactorcsN|j��}|dk	rJ|\}}ztt|�j||�W5|j��X|j��}q
dSr&)r�rdZ	task_doner�r�r�)rqZtaskr�r�r�rrr��s

�z"MultiprocessRefactoringTool._childcs2|jdk	r|j�||f�ntt|�j||�SdSr&)r�r�r�r�r�r�r�rrr��s

�z)MultiprocessRefactoringTool.refactor_file)FFr)rrrrrr�r�r��
__classcell__rrr�rr��s�r�)T)"�
__author__rEr�rr�rfr�r'�	itertoolsrZpgen2rrrZ
fixer_utilrrurr	r
rmrr"rrr1r8r:rVrW�objectrXr�r�rrrr�<module>s6
(	lib2to3/__pycache__/__main__.cpython-38.opt-2.pyc000064400000000327151153537460015356 0ustar00U

e5dC�@s&ddlZddlmZe�ed��dS)�N�)�mainz
lib2to3.fixes)�sysr�exit�rr�(/usr/lib64/python3.8/lib2to3/__main__.py�<module>slib2to3/__pycache__/fixer_base.cpython-38.opt-1.pyc000064400000014157151153537460015752 0ustar00U

e5d"�@sTdZddlZddlmZddlmZddlmZGdd�de�Z	Gd	d
�d
e	�Z
dS)z2Base class for fixers (optional, but recommended).�N�)�PatternCompiler)�pygram)�does_tree_importc@s�eZdZdZdZdZdZdZdZe	�
d�Ze�Z
dZdZdZdZdZdZejZdd�Zd	d
�Zdd�Zd
d�Zdd�Zddd�Zdd�Zddd�Zdd�Zdd�Z dd�Z!dS) �BaseFixaOptional base class for fixers.

    The subclass name must be FixFooBar where FooBar is the result of
    removing underscores and capitalizing the words of the fix name.
    For example, the class name for a fixer named 'has_key' should be
    FixHasKey.
    NrZpostF�cCs||_||_|��dS)aInitializer.  Subclass may override.

        Args:
            options: a dict containing the options passed to RefactoringTool
            that could be used to customize the fixer through the command line.
            log: a list to append warnings and other messages to.
        N)�options�log�compile_pattern)�selfrr	�r�*/usr/lib64/python3.8/lib2to3/fixer_base.py�__init__/szBaseFix.__init__cCs,|jdk	r(t�}|j|jdd�\|_|_dS)z�Compiles self.PATTERN into self.pattern.

        Subclass may override if it doesn't want to use
        self.{pattern,PATTERN} in .match().
        NT)Z	with_tree)�PATTERNrr
�pattern�pattern_tree)rZPCrrr
r
;s

�zBaseFix.compile_patterncCs
||_dS)zOSet the filename.

        The main refactoring tool should call this.
        N)�filename)rrrrr
�set_filenameFszBaseFix.set_filenamecCsd|i}|j�||�o|S)aReturns match for a given parse tree node.

        Should return a true or false object (not necessarily a bool).
        It may return a non-empty dict of matching sub-nodes as
        returned by a matching pattern.

        Subclass may override.
        �node)r�match�rrZresultsrrr
rMs	z
BaseFix.matchcCs
t��dS)a�Returns the transformation for a given parse tree node.

        Args:
          node: the root of the parse tree that matched the fixer.
          results: a dict mapping symbolic names to part of the match.

        Returns:
          None, or a node that is a modified copy of the
          argument node.  The node argument may also be modified in-place to
          effect the same change.

        Subclass *must* override.
        N)�NotImplementedErrorrrrr
�	transformYszBaseFix.transform�xxx_todo_changemecCs2|}||jkr"|tt|j��}q|j�|�|S)z�Return a string suitable for use as an identifier

        The new name is guaranteed not to conflict with other identifiers.
        )�
used_names�str�next�numbers�add)r�template�namerrr
�new_nameis

zBaseFix.new_namecCs.|jrd|_|j�d|j�|j�|�dS)NFz### In file %s ###)�	first_logr	�appendr)r�messagerrr
�log_messagetszBaseFix.log_messagecCs>|��}|��}d|_d}|�|||f�|r:|�|�dS)aWarn the user that a given chunk of code is not valid Python 3,
        but that it cannot be converted automatically.

        First argument is the top-level node for the code in question.
        Optional second argument is why it can't be converted.
        �zLine %d: could not convert: %sN)�
get_linenoZclone�prefixr%)rr�reason�linenoZ
for_output�msgrrr
�cannot_convertzszBaseFix.cannot_convertcCs|��}|�d||f�dS)z�Used for warning the user about possible uncertainty in the
        translation.

        First argument is the top-level node for the code in question.
        Optional second argument is why it can't be converted.
        zLine %d: %sN)r'r%)rrr)r*rrr
�warning�szBaseFix.warningcCs(|j|_|�|�t�d�|_d|_dS)z�Some fixers need to maintain tree-wide state.
        This method is called once, at the start of tree fix-up.

        tree - the root node of the tree to be processed.
        filename - the name of the file the tree came from.
        rTN)rr�	itertools�countrr"�rZtreerrrr
�
start_tree�s
zBaseFix.start_treecCsdS)z�Some fixers need to maintain tree-wide state.
        This method is called once, at the conclusion of tree fix-up.

        tree - the root node of the tree to be processed.
        filename - the name of the file the tree came from.
        Nrr0rrr
�finish_tree�szBaseFix.finish_tree)r)N)"�__name__�
__module__�__qualname__�__doc__rrrrrr.r/r�setr�orderZexplicitZ	run_orderZ_accept_typeZkeep_line_orderZ
BM_compatiblerZpython_symbolsZsymsrr
rrrr!r%r,r-r1r2rrrr
rs4



rcs,eZdZdZdZ�fdd�Zdd�Z�ZS)�ConditionalFixz@ Base class for fixers which not execute if an import is found. Ncstt|�j|�d|_dS)N)�superr9r1�_should_skip)r�args��	__class__rr
r1�szConditionalFix.start_treecCsJ|jdk	r|jS|j�d�}|d}d�|dd��}t|||�|_|jS)N�.���)r;�skip_on�split�joinr)rrZpkgr rrr
�should_skip�s
zConditionalFix.should_skip)r3r4r5r6rAr1rD�
__classcell__rrr=r
r9�sr9)r6r.Zpatcomprr&rZ
fixer_utilr�objectrr9rrrr
�<module>slib2to3/__pycache__/main.cpython-38.opt-2.pyc000064400000015247151153537460014571 0ustar00U

e5d�-�@s|ddlmZmZddlZddlZddlZddlZddlZddlZddl	m
Z
dd�ZGdd�de
j�Z
d	d
�Zd
dd�ZdS)�)�with_statement�print_functionN�)�refactorc	Cs(|��}|��}tj||||dddd�S)Nz
(original)z(refactored)�)Zlineterm)�
splitlines�difflibZunified_diff)�a�b�filename�r�$/usr/lib64/python3.8/lib2to3/main.py�
diff_textss�rcs:eZdZd
�fdd�	Zdd�Z�fdd�Zdd	�Z�ZS)�StdoutRefactoringToolrc		sP||_||_|r&|�tj�s&|tj7}||_||_||_tt	|��
|||�dS�N)�	nobackups�
show_diffs�endswith�os�sep�_input_base_dir�_output_dir�_append_suffix�superr�__init__)	�selfZfixers�options�explicitrr�input_base_dir�
output_dir�
append_suffix��	__class__rr
r$s
zStdoutRefactoringTool.__init__cOs*|j�|||f�|jj|f|�|�dSr)�errors�append�logger�error)r�msg�args�kwargsrrr
�	log_errorAszStdoutRefactoringTool.log_errorc

sz|}|jrH|�|j�r6tj�|j|t|j�d��}ntd||jf��|jrX||j7}||kr�tj�	|�}tj�
|�s�|r�t�|�|�d||�|j
�s2|d}tj�|�r�zt�|�Wn.tk
r�}z|�d|�W5d}~XYnXzt�||�Wn2tk
�r0}z|�d||�W5d}~XYnXtt|�j}	|	||||�|j
�s`t�||�||k�rvt�||�dS)Nz5filename %s does not start with the input_base_dir %szWriting converted %s to %s.z.bakzCan't remove backup %szCan't rename %s to %s)r�
startswithrr�path�join�len�
ValueErrorr�dirname�isdir�makedirs�log_messager�lexists�remove�OSError�renamerr�
write_file�shutilZcopymode)
rZnew_textrZold_text�encodingZ
orig_filenamerZbackup�err�writer!rr
r8EsJ
���

� 
z StdoutRefactoringTool.write_filec	Cs�|r|�d|�n�|�d|�|jr�t|||�}zP|jdk	rl|j�"|D]}t|�qHtj��W5QRXn|D]}t|�qpWn$tk
r�t	d|f�YdSXdS)NzNo changes to %sz
Refactored %sz+couldn't encode %s's diff for your terminal)
r3rrZoutput_lock�print�sys�stdout�flush�UnicodeEncodeError�warn)r�old�newrZequalZ
diff_lines�linerrr
�print_outputls$

�z"StdoutRefactoringTool.print_output)rrr)�__name__�
__module__�__qualname__rr*r8rF�
__classcell__rrr!r
rs�'rcCstd|ftjd�dS)NzWARNING: %s��file)r=r>�stderr)r'rrr
rB�srBc
s�tjdd�}|jddddd�|jdd	d
gdd�|jd
dddddd�|jddd
gdd�|jddddd�|jddddd�|jddddd�|jd dd!d�|jd"d#dd$d�|jd%d&dd'd(d�|jd)d*dd+d,d-d.�|jd/d0dd1d�|jd2dd+d,d3d.�d'}i}|�|�\}}|j�r@d4|d5<|j�s:td6�d4|_|j�rZ|j�sZ|�	d7�|j
�rt|j�st|�	d8�|j�s�|j�r�td9�|j�s�|j�r�|�	d:�|j�r�t
d;�t���D]}t
|��q�|�s�d<S|�st
d=tjd>�t
d?tjd>�d@SdA|k�r(d4}|j�r(t
dBtjd>�d@S|j�r8d4|dC<|j�rFtjntj}tjdD|dE�t�dF�}tt����}	t�fdGdH�|jD��}
t�}|j�r�d'}|jD](}
|
dIk�r�d4}n|��dJ|
��q�|�r�|	�|�n|}n
|	�|�}|�|
�}t j!�"|�}|�r0|�#t j$��s0t j!�%|��s0t j!�&|�}|j�rT|�'t j$�}|�(dK|j|�t)t*|�|t*|�|j|j||j|j
dL�}|j+�s�|�r�|�,�nDz|�||j|j-|j.�Wn(tj/k
�r�t
dMtjd>�YdSX|�0�t1t2|j+��S)NNz2to3 [options] file|dir ...)Zusagez-dz--doctests_only�
store_truezFix up doctests only)�action�helpz-fz--fixr$z1Each FIX specifies a transformation; default: all)rO�defaultrPz-jz--processesZstorer�intzRun 2to3 concurrently)rOrQ�typerPz-xz--nofixz'Prevent a transformation from being runz-lz--list-fixeszList available transformationsz-pz--print-functionz0Modify the grammar so that print() is a functionz-vz	--verbosezMore verbose loggingz
--no-diffsz#Don't show diffs of the refactoringz-wz--writezWrite back modified filesz-nz--nobackupsFz&Don't write backups for modified filesz-oz--output-dir�strrzXPut output files in this directory instead of overwriting the input files.  Requires -n.)rOrSrQrPz-Wz--write-unchanged-fileszYAlso write files even if no changes were required (useful with --output-dir); implies -w.z--add-suffixzuAppend this string to all output filenames. Requires -n if non-empty.  ex: --add-suffix='3' will generate .py3 files.T�write_unchanged_filesz&--write-unchanged-files/-W implies -w.z%Can't use --output-dir/-o without -n.z"Can't use --add-suffix without -n.z@not writing files and not printing diffs; that's not very usefulzCan't use -n without -wz2Available transformations for the -f/--fix option:rz1At least one file or directory argument required.rKzUse --help to show usage.��-zCan't write to stdin.rz%(name)s: %(message)s)�format�levelzlib2to3.mainc3s|]}�d|VqdS)�.fix_Nr)�.0�fix��	fixer_pkgrr
�	<genexpr>�szmain.<locals>.<genexpr>�allrZz7Output in %r will mirror the input directory %r layout.)rrr z+Sorry, -j isn't supported on this platform.)3�optparseZOptionParserZ
add_option�
parse_argsrUr<rBrrr&Z
add_suffixZno_diffsZ
list_fixesr=rZget_all_fix_namesr>rMr�verbose�logging�DEBUG�INFOZbasicConfigZ	getLogger�setZget_fixers_from_packageZnofixr\�add�union�
differencerr,�commonprefixrrr1r0�rstrip�infor�sortedr#�refactor_stdinZ
doctests_onlyZ	processesZMultiprocessingUnsupportedZ	summarizerR�bool)r^r(�parserro�flagsrZfixnamerYr%Zavail_fixesZunwanted_fixesrZall_presentr\Z	requestedZfixer_namesrZrtrr]r
�main�s�
����
�
�
��
���
��









���
��rs)N)Z
__future__rrr>rrrdr9rarrrZMultiprocessRefactoringToolrrBrsrrrr
�<module>s	glib2to3/__pycache__/refactor.cpython-38.opt-1.pyc000064400000047671151153537460015457 0ustar00U

e5dk�@sdZdZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddlmZm
Z
mZddlmZddlmZmZdd	lmZd!dd�ZGd
d�de�Zdd�Zdd�Zdd�Zdd�Zdd�ZGdd�de�ZGdd�de�Z Gdd�de�Z!Gdd �d e �Z"dS)"z�Refactoring framework.

Used as a main program, this can refactor any number of files and/or
recursively descend down directories.  Imported as a module, this
provides infrastructure to write your own refactoring tool.
z#Guido van Rossum <guido@python.org>�N)�chain�)�driver�tokenize�token)�	find_root)�pytree�pygram)�btm_matcherTcCsTt|ggdg�}g}t�|j�D].\}}}|�d�r |rD|dd�}|�|�q |S)zEReturn a sorted list of all available fix names in the given package.�*�fix_�N)�
__import__�pkgutilZiter_modules�__path__�
startswith�append)Z	fixer_pkgZ
remove_prefixZpkgZ	fix_names�finder�nameZispkg�r�(/usr/lib64/python3.8/lib2to3/refactor.py�get_all_fix_namess
rc@seZdZdS)�
_EveryNodeN��__name__�
__module__�__qualname__rrrrr+srcCs�t|tjtjf�r(|jdkr t�|jhSt|tj�rH|jrDt|j�St�t|tj	�r�t
�}|jD]}|D]}|�t|��qhq`|Std|��dS)zf Accepts a pytree Pattern Node and returns a set
        of the pattern types which will match first. Nz$Oh no! I don't understand pattern %s)
�
isinstancerZNodePatternZLeafPattern�typerZNegatedPatternZcontent�_get_head_typesZWildcardPattern�set�update�	Exception)Zpat�r�p�xrrrr/s


rc	Cs�t�t�}g}|D]x}|jrdzt|j�}Wntk
rH|�|�Yq�X|D]}||�|�qNq|jdk	r�||j�|�q|�|�qtt	j
j��t	j
j
�D]}||�|�q�t|�S)z^ Accepts a list of fixers and returns a dictionary
        of head node type --> fixer list.  N)�collections�defaultdict�list�patternrrrZ_accept_typerr	�python_grammarZ
symbol2number�values�tokens�extend�dict)Z
fixer_listZ
head_nodesZevery�fixerZheadsZ	node_typerrr�_get_headnode_dictKs$

�r0cs�fdd�t�d�D�S)zN
    Return the fully qualified names for fixers in the package pkg_name.
    csg|]}�d|�qS��.r)�.0�fix_name�Zpkg_namerr�
<listcomp>hs�z+get_fixers_from_package.<locals>.<listcomp>F)rr5rr5r�get_fixers_from_packageds
�r7cCs|S�Nr)�objrrr�	_identityksr:csXd}t�t�|�j���fdd�}ttjtjtj	h�}t
�}z�|�\}}||krTq>q>|tjkrl|rf�q6d}q>|tjk�r6|dk�r6|�\}}|tjks�|dkr��q6|�\}}|tjks�|dkrq6|�\}}|tj
kr�|dkr�|�\}}|tjk�r4|�|�|�\}}|tj
k�s.|d	k�r"�q4|�\}}q�q>�q6q>Wntk
�rNYnXt|�S)
NFcst��}|d|dfS)Nrr)�next)�tok��genrr�advancersz(_detect_future_features.<locals>.advanceT�fromZ
__future__�import�(�,)r�generate_tokens�io�StringIO�readline�	frozensetr�NEWLINE�NL�COMMENTr �STRING�NAME�OP�add�
StopIteration)�sourceZhave_docstringr?�ignore�features�tp�valuerr=r�_detect_future_featuresosB








rVc@seZdZdZdS)�
FixerErrorzA fixer could not be loaded.N)rrr�__doc__rrrrrW�srWc@s�eZdZddd�ZdZdZd4dd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zd5dd�Zd6dd�Z
dd�Zd7dd�Zdd�Zd8dd�Zdd�Zd d!�Zd9d"d#�Zd:d$d%�Zd&Zd'Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�ZdS);�RefactoringToolF)�print_function�write_unchanged_filesZFixrNcCs.||_|pg|_|j��|_|dk	r0|j�|�|jdrDtj|_ntj	|_|j�
d�|_g|_t
�d�|_g|_d|_tj|jtj|jd�|_|��\|_|_g|_t��|_g|_g|_t|j|j�D]F}|j r�|j�!|�q�||jkr�|j�"|�q�||jkr�|j�"|�q�t#|j�|_$t#|j�|_%dS)z�Initializer.

        Args:
            fixer_names: a list of fixers to import
            options: a dict with configuration.
            explicit: a list of fixers to run even if they are explicit.
        NrZr[rYF)�convert�logger)&�fixers�explicit�_default_options�copy�optionsr!r	�!python_grammar_no_print_statement�grammarr*�getr[�errors�loggingZ	getLoggerr]�	fixer_log�wroterZDriverrr\�
get_fixers�	pre_order�
post_order�files�bmZ
BottomMatcher�BMZ
bmi_pre_orderZbmi_post_orderrZ
BM_compatibleZ	add_fixerrr0�bmi_pre_order_heads�bmi_post_order_heads)�selfZfixer_namesrbr_r/rrr�__init__�s>


�


zRefactoringTool.__init__c	CsXg}g}|jD�]}t|iidg�}|�dd�d}|�|j�rR|t|j�d�}|�d�}|jd�dd	�|D��}zt	||�}Wn&t
k
r�td
||f�d�YnX||j|j
�}	|	jr�|jdk	r�||jkr�|�d|�q|�d
|�|	jdk�r|�|	�q|	jdk�r|�|	�qtd|	j��qt�d�}
|j|
d�|j|
d�||fS)aInspects the options to load the requested patterns and handlers.

        Returns:
          (pre_order, post_order), where pre_order is the list of fixers that
          want a pre-order AST traversal, and post_order is the list that want
          post-order traversal.
        rr2r���N�_�cSsg|]}|���qSr)�title)r3r$rrrr6�sz.RefactoringTool.get_fixers.<locals>.<listcomp>zCan't find %s.%sTzSkipping optional fixer: %szAdding transformation: %sZpreZpostzIllegal fixer order: %rZ	run_order��key)r^r�rsplitr�FILE_PREFIX�len�split�CLASS_PREFIX�join�getattr�AttributeErrorrWrbrhr_�log_message�	log_debug�orderr�operator�
attrgetter�sort)rrZpre_order_fixersZpost_order_fixersZfix_mod_path�modr4�parts�
class_nameZ	fix_classr/Zkey_funcrrrrj�s:
�
zRefactoringTool.get_fixerscOs�dS)zCalled when an error occurs.Nr)rr�msg�args�kwdsrrr�	log_error�szRefactoringTool.log_errorcGs|r||}|j�|�dS)zHook to log a message.N)r]�info�rrr�r�rrrr�szRefactoringTool.log_messagecGs|r||}|j�|�dSr8)r]�debugr�rrrr�	szRefactoringTool.log_debugcCsdS)zTCalled with the old version, new version, and filename of a
        refactored file.Nr)rr�old_text�new_text�filename�equalrrr�print_outputszRefactoringTool.print_outputcCs8|D].}tj�|�r$|�|||�q|�|||�qdS)z)Refactor a list of files and directories.N)�os�path�isdir�refactor_dir�
refactor_file)rr�items�write�
doctests_onlyZdir_or_filerrr�refactorszRefactoringTool.refactorc
Cs�tjd}t�|�D]�\}}}|�d|�|��|��|D]>}|�d�s>tj�|�d|kr>tj�||�}	|�	|	||�q>dd�|D�|dd�<qdS)z�Descends down a directory and refactor every Python file found.

        Python files are assumed to have a .py extension.

        Files and subdirectories starting with '.' are skipped.
        �pyzDescending into %sr2rcSsg|]}|�d�s|�qSr1)r)r3Zdnrrrr6.s
z0RefactoringTool.refactor_dir.<locals>.<listcomp>N)
r��extsep�walkr�r�rr��splitextrr�)
rrZdir_namer�r�Zpy_ext�dirpathZdirnames�	filenamesr�fullnamerrrr�s

�zRefactoringTool.refactor_dirc
Cs�zt|d�}Wn6tk
rD}z|�d||�WY�dSd}~XYnXzt�|j�d}W5|��Xtj|d|dd��}|��|fW5QR�SQRXdS)	zG
        Do our best to decode a Python source file correctly.
        �rbzCan't open %s: %s)NNNrr#rv��encoding�newline)	�open�OSErrorr��closer�detect_encodingrGrE�read)rrr��f�errr�rrr�_read_python_source0s
z#RefactoringTool._read_python_sourcecCs�|�|�\}}|dkrdS|d7}|rn|�d|�|�||�}|jsL||kr`|�|||||�q�|�d|�nH|�||�}|js�|r�|jr�|jt|�dd�|||d�n|�d|�dS)zRefactors a file.N�
zRefactoring doctests in %szNo doctest changes in %srt)r�r�zNo changes in %s)r�r��refactor_docstringr[�processed_file�refactor_string�was_changed�str)rrr�r�r��inputr��output�treerrrr�@s"�zRefactoringTool.refactor_filec
Cs�t|�}d|krtj|j_zVz|j�|�}Wn@tk
rl}z"|�d||jj	|�WY�W�dSd}~XYnXW5|j|j_X||_
|�d|�|�||�|S)aFRefactor a given input string.

        Args:
            data: a string holding the code to be refactored.
            name: a human-readable name for use in error/log messages.

        Returns:
            An AST corresponding to the refactored input stream; None if
            there were errors during the parse.
        rZzCan't parse %s: %s: %sNzRefactoring %s)
rVr	rcrrdZparse_stringr"r��	__class__r�future_featuresr��
refactor_tree)rr�datarrSr�r�rrrr�Ws"
� zRefactoringTool.refactor_stringcCs�tj��}|rN|�d�|�|d�}|js2||krB|�|d|�q�|�d�n:|�|d�}|jsj|r~|jr~|�t	|�d|�n
|�d�dS)NzRefactoring doctests in stdinz<stdin>zNo doctest changes in stdinzNo changes in stdin)
�sys�stdinr�r�r�r[r�r�r�r�)rrr�r�r�r�rrr�refactor_stdinrs

zRefactoringTool.refactor_stdinc

Cs�t|j|j�D]}|�||�q|�|j|���|�|j|���|j�|�	��}t
|����r�|jjD�]D}||krj||rj||j
tjjdd�|jr�||j
tjjd�t||�D]�}|||kr�||�|�zt|�Wntk
�rYq�YnX|j�r||jk�rq�|�|�}|r�|�||�}|dk	r�|�|�|��D] }|j�s^g|_|j�|��qL|j�|�	��}|D]*}	|	|k�r�g||	<||	�||	��q�q�qjqTt|j|j�D]}|�||��q�|jS)a�Refactors a parse tree (modifying the tree in place).

        For compatible patterns the bottom matcher module is
        used. Otherwise the tree is traversed node-to-node for
        matches.

        Args:
            tree: a pytree.Node instance representing the root of the tree
                  to be refactored.
            name: a human-readable name for this tree.

        Returns:
            True if the tree was modified, False otherwise.
        T)ry�reverserxN)rrkrlZ
start_tree�traverse_byrprqro�runZleaves�anyr+r^r�rZBaseZdepthZkeep_line_orderZ
get_linenor(�remover�
ValueErrorZfixers_applied�match�	transform�replacerr-Zfinish_treer�)
rrr�rr/Z	match_set�node�results�newZnew_matchesZfxrrrrr��sJ



zRefactoringTool.refactor_treecCsV|sdS|D]D}||jD]4}|�|�}|r|�||�}|dk	r|�|�|}qqdS)aTraverse an AST, applying a set of fixers to each node.

        This is a helper method for refactor_tree().

        Args:
            fixers: a list of fixer instances.
            traversal: a generator that yields AST nodes.

        Returns:
            None
        N)rr�r�r�)rrr^Z	traversalr�r/r�r�rrrr��s

zRefactoringTool.traverse_bycCs�|j�|�|dkr.|�|�d}|dkr.dS||k}|�||||�|r`|�d|�|js`dS|rv|�||||�n|�d|�dS)zR
        Called when a file has been refactored and there may be changes.
        NrzNo changes to %szNot writing changes to %s)rmrr�r�r�r[�
write_file)rrr�r�r�r�r�r�rrrr��szRefactoringTool.processed_filecCs�ztj|d|dd�}Wn6tk
rL}z|�d||�WY�dSd}~XYnX|�Fz|�|�Wn0tk
r�}z|�d||�W5d}~XYnXW5QRX|�d|�d|_dS)	z�Writes a string to a file.

        It first shows a unified diff between the old text and the new text, and
        then rewrites the file; the latter is only done if the write option is
        set.
        �wrvr�zCan't create %s: %sNzCan't write %s: %szWrote changes to %sT)rEr�r�r�r�r�ri)rrr�r�r�r��fpr�rrrr��s*zRefactoringTool.write_filez>>> z... c
	Csg}d}d}d}d}|jdd�D]�}|d7}|���|j�r~|dk	rZ|�|�||||��|}|g}|�|j�}	|d|	�}q |dk	r�|�||j�s�|||j��dkr�|�	|�q |dk	r�|�|�||||��d}d}|�	|�q |dk	�r
|�|�||||��d�
|�S)a�Refactors a docstring, looking for doctests.

        This returns a modified version of the input string.  It looks
        for doctests, which start with a ">>>" prompt, and may be
        continued with "..." prompts, as long as the "..." is indented
        the same as the ">>>".

        (Unfortunately we can't use the doctest module's parser,
        since, like most parsers, it is not geared towards preserving
        the original source.)
        NrT��keependsrr�rv)�
splitlines�lstripr�PS1r-�refactor_doctest�find�PS2�rstriprr)
rrr�r��result�blockZblock_lineno�indent�lineno�line�irrrr�sJ����
�z"RefactoringTool.refactor_docstringc

sz��||��}Wnjtk
r|}zL�j�tj�rN|D]}��d|�d��q6��d|||j	j
|�|WY�Sd}~XYnX��||��rt|�j
dd�}|d|d�||dd�}	}|d�d�s�|dd7<��j|�d	�g}|�r|��fd
d�|D�7}|S)z�Refactors one doctest.

        A doctest is given as a block of lines, the first of which starts
        with ">>>" (possibly indented), while the remaining lines start
        with "..." (identically indented).

        z
Source: %sr�z+Can't parse docstring in %s line %s: %s: %sNTr�rrtrcsg|]}��j|�qSr)r�)r3r��r�rrrrr6Zsz4RefactoringTool.refactor_doctest.<locals>.<listcomp>)�parse_blockr"r]ZisEnabledForrg�DEBUGr�r�r�r�rr�r�r��endswithr��pop)
rrr�r�r�r�r�r�r�r�Zclippedrr�rr�@s,�"z RefactoringTool.refactor_doctestcCs�|jrd}nd}|js$|�d|�n"|�d|�|jD]}|�|�q6|jrl|�d�|jD]}|�|�q\|jr�t|j�dkr�|�d�n|�dt|j��|jD]\}}}|j|f|�|�q�dS)	N�werez
need to bezNo files %s modified.zFiles that %s modified:z$Warnings/messages while refactoring:rzThere was 1 error:zThere were %d errors:)rirmr�rhrfr|)rrr��file�messager�r�r�rrr�	summarize]s$


zRefactoringTool.summarizecCs"|j�|�|||��}t�|_|S)z�Parses a block into a tree.

        This is necessary to get correct line number / offset information
        in the parser diagnostics and embedded into the parse tree.
        )rZparse_tokens�	wrap_toksrHr�)rrr�r�r�r�rrrr�tszRefactoringTool.parse_blockccsdt�|�||�j�}|D]F\}}\}}\}	}
}||d7}|	|d7}	||||f|	|
f|fVqdS)z;Wraps a tokenize stream to systematically modify start/end.rN)rrD�	gen_lines�__next__)rrr�r�r�r,rrUZline0Zcol0Zline1Zcol1Z	line_textrrrr�~s
zRefactoringTool.wrap_toksccsx||j}||j}|}|D]N}|�|�r>|t|�d�Vn(||��dkrVdVntd||f��|}qdVqldS)z�Generates lines as expected by tokenize from a list of lines.

        This strips the first len(indent + self.PS1) characters off each line.
        Nr�zline=%r, prefix=%rrv)r�r�rr|r��AssertionError)rrr�r��prefix1Zprefix2�prefixr�rrrr��s


zRefactoringTool.gen_lines)NN)FF)FF)FF)F)NFN)N)rrrr`r~r{rsrjr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrY�s>�
4(
	


O�

+
rYc@seZdZdS)�MultiprocessingUnsupportedNrrrrrr��sr�csBeZdZ�fdd�Zd�fdd�	Z�fdd�Z�fd	d
�Z�ZS)�MultiprocessRefactoringToolcs"tt|�j||�d|_d|_dSr8)�superr�rs�queue�output_lock�rrr��kwargs�r�rrrs�sz$MultiprocessRefactoringTool.__init__Frc
s�|dkrtt���|||�Szddl�Wntk
r@t�YnX�jdk	rTtd������_��	��_
��fdd�t|�D�}z*|D]}|��q�tt���|||�W5�j��t|�D]}�j�
d�q�|D]}|��r�|��q�d�_XdS)Nrrz already doing multiple processescsg|]}�j�jd��qS))�target)ZProcess�_child)r3r���multiprocessingrrrrr6�s�z8MultiprocessRefactoringTool.refactor.<locals>.<listcomp>)r�r�r�r��ImportErrorr�r��RuntimeErrorZ
JoinableQueueZLockr��ranger�putZis_alive�start)rrr�r�r�Z
num_processesZ	processesr�r$r�r�rr��s<
�



�
�

z$MultiprocessRefactoringTool.refactorcsN|j��}|dk	rJ|\}}ztt|�j||�W5|j��X|j��}q
dSr8)r�reZ	task_doner�r�r�)rrZtaskr�r�r�rrr��s

�z"MultiprocessRefactoringTool._childcs2|jdk	r|j�||f�ntt|�j||�SdSr8)r�r�r�r�r�r�r�rrr��s

�z)MultiprocessRefactoringTool.refactor_file)FFr)rrrrsr�r�r��
__classcell__rrr�rr��s�r�)T)#rX�
__author__rEr�rr�rgr�r&�	itertoolsrZpgen2rrrZ
fixer_utilrrvrr	r
rnrr"rrr0r7r:rVrW�objectrYr�r�rrrr�<module>s8
(	lib2to3/__pycache__/main.cpython-38.opt-1.pyc000064400000020600151153537460014555 0ustar00U

e5d�-�@s�dZddlmZmZddlZddlZddlZddlZddlZddl	Z	ddl
mZdd�ZGdd	�d	ej
�Zd
d�Zddd
�ZdS)z
Main program for 2to3.
�)�with_statement�print_functionN�)�refactorc	Cs(|��}|��}tj||||dddd�S)z%Return a unified diff of two strings.z
(original)z(refactored)�)Zlineterm)�
splitlines�difflibZunified_diff)�a�b�filename�r�$/usr/lib64/python3.8/lib2to3/main.py�
diff_textss�rcs>eZdZdZd�fdd�	Zdd�Z�fdd�Zd	d
�Z�ZS)�StdoutRefactoringToola2
    A refactoring tool that can avoid overwriting its input files.
    Prints output to stdout.

    Output files can optionally be written to a different directory and or
    have an extra file suffix appended to their name for use in situations
    where you do not want to replace the input files.
    rc		sP||_||_|r&|�tj�s&|tj7}||_||_||_tt	|��
|||�dS)aF
        Args:
            fixers: A list of fixers to import.
            options: A dict with RefactoringTool configuration.
            explicit: A list of fixers to run even if they are explicit.
            nobackups: If true no backup '.bak' files will be created for those
                files that are being refactored.
            show_diffs: Should diffs of the refactoring be printed to stdout?
            input_base_dir: The base directory for all input files.  This class
                will strip this path prefix off of filenames before substituting
                it with output_dir.  Only meaningful if output_dir is supplied.
                All files processed by refactor() must start with this path.
            output_dir: If supplied, all converted files will be written into
                this directory tree instead of input_base_dir.
            append_suffix: If supplied, all files output by this tool will have
                this appended to their filename.  Useful for changing .py to
                .py3 for example by passing append_suffix='3'.
        N)�	nobackups�
show_diffs�endswith�os�sep�_input_base_dir�_output_dir�_append_suffix�superr�__init__)	�selfZfixers�options�explicitrr�input_base_dir�
output_dir�
append_suffix��	__class__rr
r$s
zStdoutRefactoringTool.__init__cOs*|j�|||f�|jj|f|�|�dS)N)�errors�append�logger�error)r�msg�args�kwargsrrr
�	log_errorAszStdoutRefactoringTool.log_errorc

sz|}|jrH|�|j�r6tj�|j|t|j�d��}ntd||jf��|jrX||j7}||kr�tj�	|�}tj�
|�s�|r�t�|�|�d||�|j
�s2|d}tj�|�r�zt�|�Wn.tk
r�}z|�d|�W5d}~XYnXzt�||�Wn2tk
�r0}z|�d||�W5d}~XYnXtt|�j}	|	||||�|j
�s`t�||�||k�rvt�||�dS)Nz5filename %s does not start with the input_base_dir %szWriting converted %s to %s.z.bakzCan't remove backup %szCan't rename %s to %s)r�
startswithrr�path�join�len�
ValueErrorr�dirname�isdir�makedirs�log_messager�lexists�remove�OSError�renamerr�
write_file�shutilZcopymode)
rZnew_textrZold_text�encodingZ
orig_filenamerZbackup�err�writer rr
r7EsJ
���

� 
z StdoutRefactoringTool.write_filec	Cs�|r|�d|�n�|�d|�|jr�t|||�}zP|jdk	rl|j�"|D]}t|�qHtj��W5QRXn|D]}t|�qpWn$tk
r�t	d|f�YdSXdS)NzNo changes to %sz
Refactored %sz+couldn't encode %s's diff for your terminal)
r2rrZoutput_lock�print�sys�stdout�flush�UnicodeEncodeError�warn)r�old�newrZequalZ
diff_lines�linerrr
�print_outputls$

�z"StdoutRefactoringTool.print_output)rrr)	�__name__�
__module__�__qualname__�__doc__rr)r7rE�
__classcell__rrr r
rs
�'rcCstd|ftjd�dS)NzWARNING: %s��file)r<r=�stderr)r&rrr
rA�srAc
s�tjdd�}|jddddd�|jdd	d
gdd�|jd
dddddd�|jddd
gdd�|jddddd�|jddddd�|jddddd�|jd dd!d�|jd"d#dd$d�|jd%d&dd'd(d�|jd)d*dd+d,d-d.�|jd/d0dd1d�|jd2dd+d,d3d.�d'}i}|�|�\}}|j�r@d4|d5<|j�s:td6�d4|_|j�rZ|j�sZ|�	d7�|j
�rt|j�st|�	d8�|j�s�|j�r�td9�|j�s�|j�r�|�	d:�|j�r�t
d;�t���D]}t
|��q�|�s�d<S|�st
d=tjd>�t
d?tjd>�d@SdA|k�r(d4}|j�r(t
dBtjd>�d@S|j�r8d4|dC<|j�rFtjntj}tjdD|dE�t�dF�}tt����}	t�fdGdH�|jD��}
t�}|j�r�d'}|jD](}
|
dIk�r�d4}n|��dJ|
��q�|�r�|	�|�n|}n
|	�|�}|�|
�}t j!�"|�}|�r0|�#t j$��s0t j!�%|��s0t j!�&|�}|j�rT|�'t j$�}|�(dK|j|�t)t*|�|t*|�|j|j||j|j
dL�}|j+�s�|�r�|�,�nDz|�||j|j-|j.�Wn(tj/k
�r�t
dMtjd>�YdSX|�0�t1t2|j+��S)Nz�Main program.

    Args:
        fixer_pkg: the name of a package where the fixers are located.
        args: optional; a list of command line arguments. If omitted,
              sys.argv[1:] is used.

    Returns a suggested exit status (0, 1, 2).
    z2to3 [options] file|dir ...)Zusagez-dz--doctests_only�
store_truezFix up doctests only)�action�helpz-fz--fixr#z1Each FIX specifies a transformation; default: all)rO�defaultrPz-jz--processesZstorer�intzRun 2to3 concurrently)rOrQ�typerPz-xz--nofixz'Prevent a transformation from being runz-lz--list-fixeszList available transformationsz-pz--print-functionz0Modify the grammar so that print() is a functionz-vz	--verbosezMore verbose loggingz
--no-diffsz#Don't show diffs of the refactoringz-wz--writezWrite back modified filesz-nz--nobackupsFz&Don't write backups for modified filesz-oz--output-dir�strrzXPut output files in this directory instead of overwriting the input files.  Requires -n.)rOrSrQrPz-Wz--write-unchanged-fileszYAlso write files even if no changes were required (useful with --output-dir); implies -w.z--add-suffixzuAppend this string to all output filenames. Requires -n if non-empty.  ex: --add-suffix='3' will generate .py3 files.T�write_unchanged_filesz&--write-unchanged-files/-W implies -w.z%Can't use --output-dir/-o without -n.z"Can't use --add-suffix without -n.z@not writing files and not printing diffs; that's not very usefulzCan't use -n without -wz2Available transformations for the -f/--fix option:rz1At least one file or directory argument required.rKzUse --help to show usage.��-zCan't write to stdin.rz%(name)s: %(message)s)�format�levelzlib2to3.mainc3s|]}�d|VqdS)�.fix_Nr)�.0�fix��	fixer_pkgrr
�	<genexpr>�szmain.<locals>.<genexpr>�allrZz7Output in %r will mirror the input directory %r layout.)rrrz+Sorry, -j isn't supported on this platform.)3�optparseZOptionParserZ
add_option�
parse_argsrUr;rArrr%Z
add_suffixZno_diffsZ
list_fixesr<rZget_all_fix_namesr=rMr�verbose�logging�DEBUG�INFOZbasicConfigZ	getLogger�setZget_fixers_from_packageZnofixr\�add�union�
differencerr+�commonprefixrrr0r/�rstrip�infor�sortedr"�refactor_stdinZ
doctests_onlyZ	processesZMultiprocessingUnsupportedZ	summarizerR�bool)r^r'�parserro�flagsrZfixnamerYr$Zavail_fixesZunwanted_fixesrZall_presentr\Z	requestedZfixer_namesrZrtrr]r
�main�s�
����
�
�
��
���
��









���
��rs)N)rIZ
__future__rrr=rrrdr8rarrrZMultiprocessRefactoringToolrrArsrrrr
�<module>s	glib2to3/__pycache__/fixer_base.cpython-38.opt-2.pyc000064400000006660151153537460015753 0ustar00U

e5d"�@sPddlZddlmZddlmZddlmZGdd�de�ZGdd	�d	e�Z	dS)
�N�)�PatternCompiler)�pygram)�does_tree_importc@s�eZdZdZdZdZdZdZe�	d�Z
e�ZdZ
dZdZdZdZdZejZdd�Zdd	�Zd
d�Zdd
�Zdd�Zddd�Zdd�Zddd�Zdd�Zdd�Zdd�Z dS)�BaseFixNrZpostF�cCs||_||_|��dS�N)�options�log�compile_pattern)�selfr	r
�r
�*/usr/lib64/python3.8/lib2to3/fixer_base.py�__init__/szBaseFix.__init__cCs,|jdk	r(t�}|j|jdd�\|_|_dS)NT)Z	with_tree)�PATTERNrr�pattern�pattern_tree)rZPCr
r
rr;s

�zBaseFix.compile_patterncCs
||_dSr)�filename)rrr
r
r�set_filenameFszBaseFix.set_filenamecCsd|i}|j�||�o|S)N�node)r�match�rrZresultsr
r
rrMs	z
BaseFix.matchcCs
t��dSr)�NotImplementedErrorrr
r
r�	transformYszBaseFix.transform�xxx_todo_changemecCs2|}||jkr"|tt|j��}q|j�|�|Sr)�
used_names�str�next�numbers�add)r�template�namer
r
r�new_nameis

zBaseFix.new_namecCs.|jrd|_|j�d|j�|j�|�dS)NFz### In file %s ###)�	first_logr
�appendr)r�messager
r
r�log_messagetszBaseFix.log_messagecCs>|��}|��}d|_d}|�|||f�|r:|�|�dS)N�zLine %d: could not convert: %s)�
get_linenoZclone�prefixr&)rr�reason�linenoZ
for_output�msgr
r
r�cannot_convertzszBaseFix.cannot_convertcCs|��}|�d||f�dS)NzLine %d: %s)r(r&)rrr*r+r
r
r�warning�szBaseFix.warningcCs(|j|_|�|�t�d�|_d|_dS)NrT)rr�	itertools�countrr#�rZtreerr
r
r�
start_tree�s
zBaseFix.start_treecCsdSrr
r1r
r
r�finish_tree�szBaseFix.finish_tree)r)N)!�__name__�
__module__�__qualname__rrrr	rr/r0r�setr�orderZexplicitZ	run_orderZ_accept_typeZkeep_line_orderZ
BM_compatiblerZpython_symbolsZsymsrrrrrr"r&r-r.r2r3r
r
r
rrs2




rcs(eZdZdZ�fdd�Zdd�Z�ZS)�ConditionalFixNcstt|�j|�d|_dSr)�superr9r2�_should_skip)r�args��	__class__r
rr2�szConditionalFix.start_treecCsJ|jdk	r|jS|j�d�}|d}d�|dd��}t|||�|_|jS)N�.���)r;�skip_on�split�joinr)rrZpkgr!r
r
r�should_skip�s
zConditionalFix.should_skip)r4r5r6rAr2rD�
__classcell__r
r
r=rr9�sr9)
r/Zpatcomprr'rZ
fixer_utilr�objectrr9r
r
r
r�<module>slib2to3/__pycache__/pytree.cpython-38.pyc000064400000057430151153537460014215 0ustar00U

e5d8m�@s�dZdZddlZddlmZdZiadd�ZGdd	�d	e�Z	Gd
d�de	�Z
Gdd
�d
e	�Zdd�ZGdd�de�Z
Gdd�de
�ZGdd�de
�ZGdd�de
�ZGdd�de
�Zdd�ZdS)z�
Python parse tree definitions.

This is a very concrete parse tree; we need to keep every token and
even the comments and whitespace between tokens.

There's also a pattern matching implementation here.
z#Guido van Rossum <guido@python.org>�N)�StringIOi���cCsDts8ddlm}|j��D]\}}t|�tkr|t|<qt�||�S)N�)�python_symbols)�_type_reprsZpygramr�__dict__�items�type�int�
setdefault)Ztype_numr�name�val�r
�&/usr/lib64/python3.8/lib2to3/pytree.py�	type_reprs
rc@s�eZdZdZdZdZdZdZdZdd�Z	dd�Z
dZd	d
�Zdd�Z
d
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zedd��Zedd��Zdd�Zdd �Zd!d"�Zejd#kr�d$d%�ZdS)&�Basez�
    Abstract base class for Node and Leaf.

    This provides some default functionality and boilerplate using the
    template pattern.

    A node may be a subnode of at most one parent.
    Nr
FcOs|tk	std��t�|�S)z7Constructor that prevents Base from being instantiated.zCannot instantiate Base)r�AssertionError�object�__new__��cls�args�kwdsr
r
rr1szBase.__new__cCs|j|jk	rtS|�|�S)zW
        Compare two nodes for equality.

        This calls the method _eq().
        )�	__class__�NotImplemented�_eq��self�otherr
r
r�__eq__6szBase.__eq__cCst�dS)a_
        Compare two nodes for equality.

        This is called by __eq__ and __ne__.  It is only called if the two nodes
        have the same type.  This must be implemented by the concrete subclass.
        Nodes should be considered equal if they have the same structure,
        ignoring the prefix string and other context information.
        N��NotImplementedErrorrr
r
rrBs	zBase._eqcCst�dS)zr
        Return a cloned (deep) copy of self.

        This must be implemented by the concrete subclass.
        Nr�rr
r
r�cloneMsz
Base.clonecCst�dS)zx
        Return a post-order iterator for the tree.

        This must be implemented by the concrete subclass.
        Nrr!r
r
r�
post_orderUszBase.post_ordercCst�dS)zw
        Return a pre-order iterator for the tree.

        This must be implemented by the concrete subclass.
        Nrr!r
r
r�	pre_order]szBase.pre_ordercCs�|jdk	stt|���|dk	s"t�t|t�s2|g}g}d}|jjD]D}||kr||rdt|jj||f��|dk	rv|�|�d}qB|�|�qB|s�t|j||f��|j��||j_|D]}|j|_q�d|_dS)z/Replace this node with a new one in the parent.NFT)	�parentr�str�
isinstance�list�children�extend�append�changed)r�newZ
l_children�found�ch�xr
r
r�replacees&



zBase.replacecCs*|}t|t�s$|jsdS|jd}q|jS)z9Return the line number which generated the invocant node.Nr)r'�Leafr)�lineno�r�noder
r
r�
get_lineno|s
zBase.get_linenocCs|jr|j��d|_dS)NT)r%r,�was_changedr!r
r
rr,�s
zBase.changedcCsJ|jrFt|jj�D]2\}}||kr|j��|jj|=d|_|SqdS)z�
        Remove the node from the tree. Returns the position of the node in its
        parent's children before it was removed.
        N)r%�	enumerater)r,)r�ir5r
r
r�remove�s

zBase.removec	Cs`|jdkrdSt|jj�D]@\}}||krz|jj|dWStk
rXYdSXqdS)z�
        The node immediately following the invocant in their parent's children
        list. If the invocant does not have a next sibling, it is None
        Nr)r%r8r)�
IndexError�rr9�childr
r
r�next_sibling�s
zBase.next_siblingcCsR|jdkrdSt|jj�D]2\}}||kr|dkr8dS|jj|dSqdS)z�
        The node immediately preceding the invocant in their parent's children
        list. If the invocant does not have a previous sibling, it is None.
        Nrr)r%r8r)r<r
r
r�prev_sibling�s
zBase.prev_siblingccs|jD]}|��EdHqdS�N)r)�leaves�rr=r
r
rrA�s
zBase.leavescCs|jdkrdSd|j��S)Nrr)r%�depthr!r
r
rrC�s
z
Base.depthcCs|j}|dkrdS|jS)z�
        Return the string immediately following the invocant node. This is
        effectively equivalent to node.next_sibling.prefix
        N�)r>�prefix)rZnext_sibr
r
r�
get_suffix�szBase.get_suffix��rcCst|��d�S)N�ascii)r&�encoder!r
r
r�__str__�szBase.__str__)�__name__�
__module__�__qualname__�__doc__rr%r)r7Zwas_checkedrr�__hash__rr"r#r$r1r6r,r:�propertyr>r?rArCrF�sys�version_inforKr
r
r
rrs4

	




rc@s�eZdZdZddd�Zdd�Zdd�Zejd	kr4eZ	d
d�Z
dd
�Zdd�Zdd�Z
edd��Zejdd��Zdd�Zdd�Zdd�ZdS)�Nodez+Concrete implementation for interior nodes.NcCst|dkst|��||_t|�|_|jD] }|jdks@tt|���||_q&|dk	rV||_|rj|dd�|_nd|_dS)z�
        Initializer.

        Takes a type constant (a symbol number >= 256), a sequence of
        child nodes, and an optional context keyword argument.

        As a side effect, the parent pointers of the children are updated.
        �N)rrr(r)r%�reprrE�fixers_applied)rrr)�contextrErWr/r
r
r�__init__�s

z
Node.__init__cCsd|jjt|j�|jfS)�)Return a canonical string representation.z
%s(%s, %r))rrLrrr)r!r
r
r�__repr__�s�z
Node.__repr__cCsd�tt|j��S)�k
        Return a pretty string representation.

        This reproduces the input source exactly.
        rD)�join�mapr&r)r!r
r
r�__unicode__�szNode.__unicode__rGcCs|j|jf|j|jfkS�zCompare two nodes for equality.)rr)rr
r
rr�szNode._eqcCst|jdd�|jD�|jd�S)�$Return a cloned (deep) copy of self.cSsg|]}|���qSr
)r")�.0r/r
r
r�
<listcomp>szNode.clone.<locals>.<listcomp>�rW)rTrr)rWr!r
r
rr"s�z
Node.cloneccs$|jD]}|��EdHq|VdS�z*Return a post-order iterator for the tree.N)r)r#rBr
r
rr#s
zNode.post_orderccs$|V|jD]}|��EdHqdS�z)Return a pre-order iterator for the tree.N)r)r$rBr
r
rr$s
zNode.pre_ordercCs|js
dS|jdjS)zO
        The whitespace and comments preceding this node in the input.
        rDr�r)rEr!r
r
rrEszNode.prefixcCs|jr||jd_dS�Nrrg�rrEr
r
rrEscCs(||_d|j|_||j|<|��dS)z�
        Equivalent to 'node.children[i] = child'. This method also sets the
        child's parent attribute appropriately.
        N)r%r)r,r<r
r
r�	set_child s
zNode.set_childcCs ||_|j�||�|��dS)z�
        Equivalent to 'node.children.insert(i, child)'. This method also sets
        the child's parent attribute appropriately.
        N)r%r)�insertr,r<r
r
r�insert_child*szNode.insert_childcCs||_|j�|�|��dS)z�
        Equivalent to 'node.children.append(child)'. This method also sets the
        child's parent attribute appropriately.
        N)r%r)r+r,rBr
r
r�append_child3szNode.append_child)NNN)rLrMrNrOrYr[r_rRrSrKrr"r#r$rQrE�setterrjrlrmr
r
r
rrT�s(�




	rTc@s�eZdZdZdZdZdZddgfdd�Zdd�Zd	d
�Z	e
jdkrFe	Zdd
�Z
dd�Zdd�Zdd�Zdd�Zedd��Zejdd��ZdS)r2z'Concrete implementation for leaf nodes.rDrNcCsdd|krdksnt|��|dk	r8|\|_\|_|_||_||_|dk	rR||_|dd�|_dS)z�
        Initializer.

        Takes a type constant (a token number < 256), a string value, and an
        optional context keyword argument.
        rrUN)r�_prefixr3�columnr�valuerW)rrrqrXrErWr
r
rrYFs
z
Leaf.__init__cCsd|jj|j|jfS)rZz
%s(%r, %r))rrLrrqr!r
r
rr[Ys�z
Leaf.__repr__cCs|jt|j�S)r\)rEr&rqr!r
r
rr__szLeaf.__unicode__rGcCs|j|jf|j|jfkSr`)rrqrr
r
rrjszLeaf._eqcCs$t|j|j|j|j|jff|jd�S)rard)r2rrqrEr3rprWr!r
r
rr"ns
�z
Leaf.cloneccs
|VdSr@r
r!r
r
rrAtszLeaf.leavesccs
|VdSrer
r!r
r
rr#wszLeaf.post_orderccs
|VdSrfr
r!r
r
rr${szLeaf.pre_ordercCs|jS)zP
        The whitespace and comments preceding this token in the input.
        )ror!r
r
rrEszLeaf.prefixcCs|��||_dSr@)r,rorir
r
rrE�s)rLrMrNrOror3rprYr[r_rRrSrKrr"rAr#r$rQrErnr
r
r
rr2=s*�


r2cCsN|\}}}}|s||jkr<t|�dkr.|dSt|||d�St|||d�SdS)z�
    Convert raw node information to a Node or Leaf instance.

    This is passed to the parser driver which calls it whenever a reduction of a
    grammar rule produces a new complete node, so that the tree is build
    strictly bottom-up.
    rr)rXN)Z
number2symbol�lenrTr2)ZgrZraw_noderrqrXr)r
r
r�convert�srsc@sPeZdZdZdZdZdZdd�Zdd�Zdd�Z	dd	d
�Z
ddd�Zd
d�ZdS)�BasePatterna�
    A pattern is a tree matching pattern.

    It looks for a specific node type (token or symbol), and
    optionally for a specific content.

    This is an abstract base class.  There are three concrete
    subclasses:

    - LeafPattern matches a single leaf node;
    - NodePattern matches a single node (usually non-leaf);
    - WildcardPattern matches a sequence of nodes of variable length.
    NcOs|tk	std��t�|�S)z>Constructor that prevents BasePattern from being instantiated.zCannot instantiate BasePattern)rtrrrrr
r
rr�szBasePattern.__new__cCsHt|j�|j|jg}|r,|ddkr,|d=qd|jjd�tt|��fS)N���z%s(%s)z, )	rr�contentrrrLr]r^rV)rrr
r
rr[�szBasePattern.__repr__cCs|S)z�
        A subclass can define this as a hook for optimizations.

        Returns either self or another node with the same effect.
        r
r!r
r
r�optimize�szBasePattern.optimizecCsn|jdk	r|j|jkrdS|jdk	rRd}|dk	r4i}|�||�sDdS|rR|�|�|dk	rj|jrj|||j<dS)a#
        Does this pattern exactly match a node?

        Returns True if it matches, False if not.

        If results is not None, it must be a dict which will be
        updated with the nodes matching named subpatterns.

        Default implementation for non-wildcard patterns.
        NFT)rrv�	_submatch�updater)rr5�results�rr
r
r�match�s


zBasePattern.matchcCs t|�dkrdS|�|d|�S)z�
        Does this pattern exactly match a sequence of nodes?

        Default implementation for non-wildcard patterns.
        rFr)rrr|)r�nodesrzr
r
r�	match_seq�szBasePattern.match_seqccs&i}|r"|�|d|�r"d|fVdS)z}
        Generator yielding all matches for this pattern.

        Default implementation for non-wildcard patterns.
        rrN)r|)rr}r{r
r
r�generate_matches�szBasePattern.generate_matches)N)N)
rLrMrNrOrrvrrr[rwr|r~rr
r
r
rrt�s


rtc@s*eZdZddd�Zd	dd�Zd
dd�ZdS)�LeafPatternNcCsZ|dk	r&d|krdks&nt|��|dk	rDt|t�sDtt|���||_||_||_dS)ap
        Initializer.  Takes optional type, content, and name.

        The type, if given must be a token type (< 256).  If not given,
        this matches any *leaf* node; the content may still be required.

        The content, if given, must be a string.

        If a name is given, the matching node is stored in the results
        dict under that key.
        NrrU)rr'r&rVrrvr)rrrvrr
r
rrY�szLeafPattern.__init__cCst|t�sdSt�|||�S)z*Override match() to insist on a leaf node.F)r'r2rtr|�rr5rzr
r
rr|
s
zLeafPattern.matchcCs|j|jkS)�
        Match the pattern's content to the node's children.

        This assumes the node type matches and self.content is not None.

        Returns True if it matches, False if not.

        If results is not None, it must be a dict which will be
        updated with the nodes matching named subpatterns.

        When returning False, the results dict may still be updated.
        )rvrqr�r
r
rrxs
zLeafPattern._submatch)NNN)N)N)rLrMrNrYr|rxr
r
r
rr��s

r�c@s$eZdZdZddd�Zddd�ZdS)	�NodePatternFNcCs�|dk	r|dkst|��|dk	rvt|t�r6tt|���t|�}t|�D].\}}t|t�sdt||f��t|t�rFd|_qF||_	||_
||_dS)ad
        Initializer.  Takes optional type, content, and name.

        The type, if given, must be a symbol type (>= 256).  If the
        type is None this matches *any* single node (leaf or not),
        except if content is not None, in which it only matches
        non-leaf nodes that also match the content pattern.

        The content, if not None, must be a sequence of Patterns that
        must match the node's children exactly.  If the content is
        given, the type must not be None.

        If a name is given, the matching node is stored in the results
        dict under that key.
        NrUT)rr'r&rVr(r8rt�WildcardPattern�	wildcardsrrvr)rrrvrr9�itemr
r
rrY$s
zNodePattern.__init__cCs�|jrHt|j|j�D].\}}|t|j�kr|dk	r<|�|�dSqdSt|j�t|j�kr`dSt|j|j�D]\}}|�||�sndSqndS)r�NTF)r�rrvr)rrry�zipr|)rr5rz�cr{�
subpatternr=r
r
rrxAs

zNodePattern._submatch)NNN)N)rLrMrNr�rYrxr
r
r
rr� s
r�c@s^eZdZdZddedfdd�Zdd�Zddd	�Zdd
d�Zdd
�Z	dd�Z
dd�Zdd�ZdS)r�a
    A wildcard pattern can match zero or more nodes.

    This has all the flexibility needed to implement patterns like:

    .*      .+      .?      .{m,n}
    (a b c | d e | f)
    (...)*  (...)+  (...)?  (...){m,n}

    except it always uses non-greedy matching.
    NrcCs�d|kr|krtks,nt||f��|dk	rtttt|��}t|�sVtt|���|D]}t|�sZtt|���qZ||_||_||_||_	dS)a�
        Initializer.

        Args:
            content: optional sequence of subsequences of patterns;
                     if absent, matches one node;
                     if present, each subsequence is an alternative [*]
            min: optional minimum number of times to match, default 0
            max: optional maximum number of times to match, default HUGE
            name: optional name assigned to this match

        [*] Thus, if content is [[a, b, c], [d, e], [f, g, h]] this is
            equivalent to (a b c | d e | f g h); if content is None,
            this is equivalent to '.' in regular expression terms.
            The min and max parameters work as follows:
                min=0, max=maxint: .*
                min=1, max=maxint: .+
                min=0, max=1: .?
                min=1, max=1: .
            If content is not None, replace the dot with the parenthesized
            list of alternatives, e.g. (a b c | d e | f g h)*
        rN)
�HUGEr�tupler^rrrVrv�min�maxr)rrvr�r�r�altr
r
rrYks,zWildcardPattern.__init__cCs�d}|jdk	r<t|j�dkr<t|jd�dkr<|jdd}|jdkr�|jdkr�|jdkrft|jd�S|dk	r�|j|jkr�|��S|jdkr�t|t�r�|jdkr�|j|jkr�t|j|j|j|j|j|j�S|S)z+Optimize certain stacked wildcard patterns.Nrr)r)	rvrrr�r�r�rrwr'r�)rr�r
r
rrw�s.
��
�
�

�zWildcardPattern.optimizecCs|�|g|�S)z'Does this pattern exactly match a node?)r~r�r
r
rr|�szWildcardPattern.matchcCsP|�|�D]@\}}|t|�kr
|dk	rD|�|�|jrDt|�||j<dSq
dS)z4Does this pattern exactly match a sequence of nodes?NTF)rrrryrr()rr}rzr�r{r
r
rr~�s
zWildcardPattern.match_seqc	cs,|jdkrTt|jdtt|�|j��D]*}i}|jrF|d|�||j<||fVq&n�|jdkrl|�|�Vn�ttd�r�tj	}t
�t_	z�z<|�|d�D]*\}}|jr�|d|�||j<||fVq�WnLtk
�r|�
|�D]*\}}|jr�|d|�||j<||fVq�YnXW5ttd��r&|t_	XdS)a"
        Generator yielding matches for a sequence of nodes.

        Args:
            nodes: sequence of nodes

        Yields:
            (count, results) tuples where:
            count: the match comprises nodes[:count];
            results: dict containing named submatches.
        NrZ	bare_name�getrefcountr)rv�ranger�rrr�r�_bare_name_matches�hasattrrR�stderrr�_recursive_matches�RuntimeError�_iterative_matches)rr}�countr{Zsave_stderrr
r
rr�s.
 

z WildcardPattern.generate_matchesccs�t|�}d|jkrdifVg}|jD]0}t||�D] \}}||fV|�||f�q4q&|r�g}|D]�\}}	||krd||jkrd|jD]`}t|||d��D]H\}
}|
dkr�i}|�|	�|�|�||
|fV|�||
|f�q�q�qd|}qXdS)z(Helper to iteratively yield the matches.rN)rrr�rvrr+r�ry)rr}Znodelenrzr�r�r{Znew_results�c0�r0�c1�r1r
r
rr��s*






z"WildcardPattern._iterative_matchescCspd}i}d}t|�}|sV||krVd}|jD](}|d�|||�r*|d7}d}qq*q|d|�||j<||fS)z(Special optimized matcher for bare_name.rFTrN)rrrvr|r)rr}r�r{Zdoner�Zleafr
r
rr��s
z"WildcardPattern._bare_name_matchesc	cs�|jdk	st�||jkr"difV||jkr�|jD]`}t||�D]P\}}|�||d�|d�D].\}}i}|�|�|�|�|||fVq`q@q2dS)z(Helper to recursively yield the matches.Nrr)rvrr�r�rr�ry)	rr}r�r�r�r�r�r�r{r
r
rr�
s



 

z"WildcardPattern._recursive_matches)N)N)
rLrMrNrOr�rYrwr|r~rr�r�r�r
r
r
rr�]s#

-r�c@s.eZdZd
dd�Zdd�Zdd�Zdd	�ZdS)�NegatedPatternNcCs(|dk	rt|t�stt|���||_dS)a
        Initializer.

        The argument is either a pattern or None.  If it is None, this
        only matches an empty sequence (effectively '$' in regex
        lingo).  If it is not None, this matches whenever the argument
        pattern doesn't have any matches.
        N)r'rtrrVrv)rrvr
r
rrYs	zNegatedPattern.__init__cCsdS)NFr
r4r
r
rr|(szNegatedPattern.matchcCst|�dkSrh)rr)rr}r
r
rr~,szNegatedPattern.match_seqccsJ|jdkr"t|�dkrFdifVn$|j�|�D]\}}dSdifVdSrh)rvrrr)rr}r�r{r
r
rr0s
zNegatedPattern.generate_matches)N)rLrMrNrYr|r~rr
r
r
rr�s

r�c	cs�|sdifVn||d|dd�}}|�|�D]Z\}}|sH||fVq0t|||d��D].\}}i}|�|�|�|�|||fVqZq0dS)aR
    Generator yielding matches for a sequence of patterns and nodes.

    Args:
        patterns: a sequence of patterns
        nodes: a sequence of nodes

    Yields:
        (count, results) tuples where:
        count: the entire sequence of patterns matches nodes[:count];
        results: dict containing named submatches.
        rrN)rry)	Zpatternsr}�p�restr�r�r�r�r{r
r
rr<s


r)rO�
__author__rR�iorr�rrrrrTr2rsrtr�r�r�r�rr
r
r
r�<module>s$	
1nNV,==#lib2to3/__pycache__/btm_utils.cpython-38.opt-2.pyc000064400000011040151153537460015632 0ustar00U

e5d�&�@sxddlmZddlmZmZddlmZmZeZeZ	ej
ZeZdZ
dZdZGdd�de�Zdd
d�Zdd
�Zdd�Zd	S)�)�pytree)�grammar�token)�pattern_symbols�python_symbols���������c@s6eZdZddd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�MinNodeNcCs.||_||_g|_d|_d|_g|_g|_dS)NF)�type�name�children�leaf�parent�alternatives�group)�selfrr�r�)/usr/lib64/python3.8/lib2to3/btm_utils.py�__init__szMinNode.__init__cCst|j�dt|j�S)N� )�strrr)rrrr�__repr__szMinNode.__repr__cCs�|}g}|r�|jtkr^|j�|�t|j�t|j�krRt|j�g}g|_|j}qn|j}d}q�|jtkr�|j	�|�t|j	�t|j�kr�t
|j	�}g|_	|j}qn|j}d}q�|jtjkr�|j
r�|�|j
�n|�|j�|j}q|S�N)r�TYPE_ALTERNATIVESr�append�lenr
�tupler�
TYPE_GROUPr�get_characteristic_subpattern�token_labels�NAMEr)r�node�subprrr�leaf_to_root!s8


zMinNode.leaf_to_rootcCs&|��D]}|��}|r|SqdSr)�leavesr$)r�lr#rrr�get_linear_subpatternKszMinNode.get_linear_subpatternccs*|jD]}|��EdHq|js&|VdSr)r
r%)r�childrrrr%`s
zMinNode.leaves)NN)�__name__�
__module__�__qualname__rrr$r'r%rrrrr
s

	*r
Nc
Cs�d}|jtjkr|jd}|jtjkr�t|j�dkrFt|jd|�}nFttd�}|jD]4}|j�	|�drlqVt||�}|dk	rV|j�
|�qV�n|jtjkr�t|j�dkr�ttd�}|jD]}t||�}|r�|j�
|�q�|js�d}nt|jd|�}�n�|jtj
k�r�t|jdtj��r>|jdjdk�r>t|jd|�St|jdtj��rd|jdjdk�s�t|j�dk�r�t|jdd��r�|jdjdk�r�dSd}d}d}d	}d}	d	}
|jD]d}|jtjk�r�d	}|}n*|jtjk�r�d}|}	n|jtjk�r|}t|d��r�|jd
k�r�d}
�q�|
�rT|jd}t|d��r^|jdk�r^|jd}n
|jd}|jtjk�r�|jdk�r�ttd�}n4tt|j��r�ttt|j�d�}nttt|j�d�}n\|jtjk�r�|j�d
�}|tk�r�tt|d�}nttj|d�}n|jtjk�rt||�}|�rL|	jdjdk�r4d}n|	jdjdk�rHnt�|�r�|dk	�r�|jdd�D]&}t||�}|dk	�rj|j�
|��qj|�r�||_|S)N��)rr�(�[�valueTF�=��any�')rr�*�+r)r�symsZMatcherr
ZAlternativesr�reduce_treer
r�indexrZAlternativerZUnit�
isinstancerZLeafr0�hasattrZDetailsZRepeaterr r!�TYPE_ANY�getattr�pysyms�STRING�strip�tokens�NotImplementedErrorr)
r"rZnew_noder(ZreducedrZdetails_nodeZalternatives_nodeZhas_repeaterZ
repeater_nodeZhas_variable_nameZ	name_leafrrrrr8gs�






�����






r8cs�t|t�s|St|�dkr"|dSg}g}dddddg�g}d�|D]d}tt|d	d
���rDtt|�fdd
���r||�|�qDtt|�fdd
���r�|�|�qD|�|�qD|r�|}n|r�|}n|r�|}t|td
�S)Nrr,�in�for�if�not�Nonez[]().,:cSst|�tkSr)rr��xrrr�<lambda>��z/get_characteristic_subpattern.<locals>.<lambda>cst|t�o|�kSr�r:rrH)�common_charsrrrJrKcst|t�o|�kSrrLrH)�common_namesrrrJrK)�key)r:�listrr3�rec_testr�max)ZsubpatternsZsubpatterns_with_namesZsubpatterns_with_common_namesZsubpatterns_with_common_chars�
subpatternr)rMrNrr�s6

�
�rccs8|D].}t|ttf�r(t||�EdHq||�VqdSr)r:rPrrQ)ZsequenceZ	test_funcrIrrrrQsrQ)N)�rZpgen2rrZpygramrrr7r>ZopmaprAr r<rr�objectr
r8rrQrrrr�<module>sW
%lib2to3/__pycache__/patcomp.cpython-38.opt-2.pyc000064400000011433151153537460015301 0ustar00U

e5d��@s�dZddlZddlmZmZmZmZmZmZddl	m
Z
ddl	mZGdd�de�Z
d	d
�ZGdd�de�Zejejejdd
�Zdd�Zdd�Zdd�ZdS)z#Guido van Rossum <guido@python.org>�N�)�driver�literals�token�tokenize�parse�grammar)�pytree)�pygramc@seZdZdS)�PatternSyntaxErrorN)�__name__�
__module__�__qualname__�rr�'/usr/lib64/python3.8/lib2to3/patcomp.pyrsrc	csLtjtjtjh}t�t�|�j�}|D] }|\}}}}}||kr&|Vq&dS�N)	r�NEWLINE�INDENT�DEDENTr�generate_tokens�io�StringIO�readline)	�input�skip�tokensZ	quintuple�type�value�start�endZ	line_textrrr�tokenize_wrappersr c@s:eZdZd
dd�Zddd�Zdd�Zdd	d
�Zdd�ZdS)�PatternCompilerNcCsZ|dkrtj|_tj|_nt�|�|_t�|j�|_tj|_	tj
|_tj|jt
d�|_dS)N)Zconvert)r
Zpattern_grammarrZpattern_symbols�symsrZload_grammarZSymbolsZpython_grammarZ	pygrammarZpython_symbols�pysymsZDriver�pattern_convert)�selfZgrammar_filerrr�__init__(s
zPatternCompiler.__init__Fc
Cspt|�}z|jj||d�}Wn2tjk
rN}ztt|��d�W5d}~XYnX|rb|�|�|fS|�|�SdS)N)�debug)r rZparse_tokensrZ
ParseErrorr�str�compile_node)r%rr'Z	with_treer�root�errr�compile_pattern7s zPatternCompiler.compile_patternc
sV|j�jjkr|jd}|j�jjkrz�fdd�|jddd�D�}t|�dkrX|dStjdd�|D�ddd�}|��S|j�jj	krʇfdd�|jD�}t|�dkr�|dStj|gddd�}|��S|j�jj
kr���|jdd��}t�|�}|��Sd}|j}t|�d	k�r>|djt
jk�r>|dj}|dd�}d}t|�dk�rx|d
j�jjk�rx|d
}|dd
�}��||�}|dk	�r>|j}	|	d}
|
jt
jk�r�d}tj}nX|
jt
jk�r�d}tj}n>|
jt
jk�r��|	d�}}t|	�dk�r��|	d	�}n|dk�s"|dk�r>|��}tj|gg||d�}|dk	�rN||_|��S)Nrcsg|]}��|��qSr�r)��.0Zch�r%rr�
<listcomp>Osz0PatternCompiler.compile_node.<locals>.<listcomp>�rcSsg|]
}|g�qSrr)r/�arrrr1Rs��min�maxcsg|]}��|��qSrr-r.r0rrr1Vs�����)rr"ZMatcher�childrenZAlternatives�lenr	�WildcardPattern�optimizeZAlternativeZNegatedUnit�
compile_basicZNegatedPatternr�EQUALrZRepeater�STARZHUGE�PLUS�LBRACE�get_int�name)
r%�nodeZalts�pZunits�patternrD�nodes�repeatr:Zchildr5r6rr0rr)Cs^

 
"

zPatternCompiler.compile_nodecCs@|d}|jtjkr4tt�|j��}t�t	|�|�S|jtj
kr�|j}|��r�|tkrbt
d|��|dd�rvt
d��t�t|�S|dkr�d}n,|�d�s�t|j|d�}|dkr�t
d|��|dd�r�|�|djd�g}nd}t�||�SnH|jdk�r|�|d�S|jd	k�r<|�|d�}tj|ggddd
�SdS)NrzInvalid token: %rrzCan't have details for token�any�_zInvalid symbol: %r�(�[r4)rr�STRINGr(rZ
evalStringrr	ZLeafPattern�_type_of_literal�NAME�isupper�	TOKEN_MAPr�
startswith�getattrr#r)r:ZNodePatternr<)r%rHrIrErrZcontent�
subpatternrrrr>�s8
zPatternCompiler.compile_basiccCs
t|j�Sr)�intr)r%rErrrrC�szPatternCompiler.get_int)N)FF)N)rr
rr&r,r)r>rCrrrrr!&s


G
#r!)rPrN�NUMBERZTOKENcCs.|d��rtjS|tjkr&tj|SdSdS)Nr)�isalpharrPrZopmap)rrrrrO�s


rOcCs>|\}}}}|s||jkr*tj|||d�Stj|||d�SdS)N)�context)Z
number2symbolr	ZNodeZLeaf)rZ
raw_node_inforrrYr:rrrr$�sr$cCst��|�Sr)r!r,)rGrrrr,�sr,)�
__author__rZpgen2rrrrrr�r	r
�	Exceptionrr �objectr!rPrNrWrRrOr$r,rrrr�<module>s  
�		lib2to3/__pycache__/btm_matcher.cpython-38.opt-1.pyc000064400000011417151153537460016124 0ustar00U

e5d��@sldZdZddlZddlZddlmZddlmZddlm	Z	Gdd	�d	e
�ZGd
d�de
�Zia
dd
�ZdS)a�A bottom-up tree matching algorithm implementation meant to speed
up 2to3's matching process. After the tree patterns are reduced to
their rarest linear path, a linear Aho-Corasick automaton is
created. The linear automaton traverses the linear paths from the
leaves to the root of the AST and returns a set of nodes for further
matching. This reduces significantly the number of candidate nodes.z+George Boutsioukis <gboutsioukis@gmail.com>�N)�defaultdict�)�pytree)�reduce_treec@s eZdZdZe��Zdd�ZdS)�BMNodez?Class for a node of the Aho-Corasick automaton used in matchingcCs"i|_g|_ttj�|_d|_dS)N�)�transition_table�fixers�nextr�count�id�content��self�r�+/usr/lib64/python3.8/lib2to3/btm_matcher.py�__init__szBMNode.__init__N)�__name__�
__module__�__qualname__�__doc__�	itertoolsrrrrrrrsrc@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�
BottomMatcherzgThe main matcher class. After instantiating the patterns should
    be added using the add_fixer methodcCs0t�|_t�|_|jg|_g|_t�d�|_dS)NZRefactoringTool)	�set�matchr�rootZnodesr	�loggingZ	getLoggerZloggerrrrrrs

zBottomMatcher.__init__cCsH|j�|�t|j�}|��}|j||jd�}|D]}|j�|�q2dS)z�Reduces a fixer's pattern tree to a linear path and adds it
        to the matcher(a common Aho-Corasick automaton). The fixer is
        appended on the matching states and called when they are
        reached��startN)r	�appendrZpattern_treeZget_linear_subpattern�addr)r�fixerZtreeZlinear�match_nodesZ
match_noderrr�	add_fixer%s
zBottomMatcher.add_fixerc	Cs�|s
|gSt|dt�r`g}|dD]6}|j||d�}|D]}|�|�|dd�|��q:q$|S|d|jkr�t�}||j|d<n|j|d}|dd�r�|j|dd�|d�}n|g}|SdS)z5Recursively adds a linear pattern to the AC automatonrrrN)�
isinstance�tupler �extendrr)r�patternrr"�alternativeZ	end_nodes�endZ	next_noderrrr 1s"zBottomMatcher.addc	Cs�|j}tt�}|D]�}|}|rd|_|jD]$}t|tj�r*|jdkr*d|_qPq*|j	dkrb|j}n|j	}||j
kr�|j
|}|jD]}||�|�q�nH|j}|j
dk	r�|j
jr�q||j
kr�|j
|}|jD]}||�|�q�|j
}qq|S)auThe main interface with the bottom matcher. The tree is
        traversed from the bottom using the constructed
        automaton. Nodes are only checked once as the tree is
        retraversed. When the automaton fails, we give it one more
        shot(in case the above tree matches as a whole with the
        rejected leaf), then we break for the next leaf. There is the
        special case of multiple arguments(see code comments) where we
        recheck the nodes

        Args:
           The leaves of the AST tree to be matched

        Returns:
           A dictionary of node matches with fixers as the keys
        T�;FrN)rr�listZwas_checkedZchildrenr$rZLeaf�value�typerr	r�parent)	rZleavesZcurrent_ac_nodeZresultsZleafZcurrent_ast_nodeZchildZ
node_tokenr!rrr�runSs8





�



zBottomMatcher.runcs*td��fdd���|j�td�dS)z<Prints a graphviz diagram of the BM automaton(for debugging)z
digraph g{csZ|j��D]J}|j|}td|j|jt|�t|j�f�|dkrLt|j��|�q
dS)Nz%d -> %d [label=%s] //%sr)r�keys�printr�	type_repr�strr	r
)ZnodeZsubnode_keyZsubnode��
print_noderrr5�s
�
z*BottomMatcher.print_ac.<locals>.print_node�}N)r1rrrr4r�print_ac�s
zBottomMatcher.print_acN)	rrrrrr#r r/r7rrrrrs"8rcCsDts8ddlm}|j��D]\}}t|�tkr|t|<qt�||�S)Nr)�python_symbols)�_type_reprsZpygramr8�__dict__�itemsr-�int�
setdefault)Ztype_numr8�name�valrrrr2�s
r2)r�
__author__rr�collectionsrrrZ	btm_utilsr�objectrrr9r2rrrr�<module>s	lib2to3/__pycache__/__main__.cpython-38.opt-1.pyc000064400000000327151153537460015355 0ustar00U

e5dC�@s&ddlZddlmZe�ed��dS)�N�)�mainz
lib2to3.fixes)�sysr�exit�rr�(/usr/lib64/python3.8/lib2to3/__main__.py�<module>slib2to3/__pycache__/btm_matcher.cpython-38.pyc000064400000011417151153537460015165 0ustar00U

e5d��@sldZdZddlZddlZddlmZddlmZddlm	Z	Gdd	�d	e
�ZGd
d�de
�Zia
dd
�ZdS)a�A bottom-up tree matching algorithm implementation meant to speed
up 2to3's matching process. After the tree patterns are reduced to
their rarest linear path, a linear Aho-Corasick automaton is
created. The linear automaton traverses the linear paths from the
leaves to the root of the AST and returns a set of nodes for further
matching. This reduces significantly the number of candidate nodes.z+George Boutsioukis <gboutsioukis@gmail.com>�N)�defaultdict�)�pytree)�reduce_treec@s eZdZdZe��Zdd�ZdS)�BMNodez?Class for a node of the Aho-Corasick automaton used in matchingcCs"i|_g|_ttj�|_d|_dS)N�)�transition_table�fixers�nextr�count�id�content��self�r�+/usr/lib64/python3.8/lib2to3/btm_matcher.py�__init__szBMNode.__init__N)�__name__�
__module__�__qualname__�__doc__�	itertoolsrrrrrrrsrc@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�
BottomMatcherzgThe main matcher class. After instantiating the patterns should
    be added using the add_fixer methodcCs0t�|_t�|_|jg|_g|_t�d�|_dS)NZRefactoringTool)	�set�matchr�rootZnodesr	�loggingZ	getLoggerZloggerrrrrrs

zBottomMatcher.__init__cCsH|j�|�t|j�}|��}|j||jd�}|D]}|j�|�q2dS)z�Reduces a fixer's pattern tree to a linear path and adds it
        to the matcher(a common Aho-Corasick automaton). The fixer is
        appended on the matching states and called when they are
        reached��startN)r	�appendrZpattern_treeZget_linear_subpattern�addr)r�fixerZtreeZlinear�match_nodesZ
match_noderrr�	add_fixer%s
zBottomMatcher.add_fixerc	Cs�|s
|gSt|dt�r`g}|dD]6}|j||d�}|D]}|�|�|dd�|��q:q$|S|d|jkr�t�}||j|d<n|j|d}|dd�r�|j|dd�|d�}n|g}|SdS)z5Recursively adds a linear pattern to the AC automatonrrrN)�
isinstance�tupler �extendrr)r�patternrr"�alternativeZ	end_nodes�endZ	next_noderrrr 1s"zBottomMatcher.addc	Cs�|j}tt�}|D]�}|}|rd|_|jD]$}t|tj�r*|jdkr*d|_qPq*|j	dkrb|j}n|j	}||j
kr�|j
|}|jD]}||�|�q�nH|j}|j
dk	r�|j
jr�q||j
kr�|j
|}|jD]}||�|�q�|j
}qq|S)auThe main interface with the bottom matcher. The tree is
        traversed from the bottom using the constructed
        automaton. Nodes are only checked once as the tree is
        retraversed. When the automaton fails, we give it one more
        shot(in case the above tree matches as a whole with the
        rejected leaf), then we break for the next leaf. There is the
        special case of multiple arguments(see code comments) where we
        recheck the nodes

        Args:
           The leaves of the AST tree to be matched

        Returns:
           A dictionary of node matches with fixers as the keys
        T�;FrN)rr�listZwas_checkedZchildrenr$rZLeaf�value�typerr	r�parent)	rZleavesZcurrent_ac_nodeZresultsZleafZcurrent_ast_nodeZchildZ
node_tokenr!rrr�runSs8





�



zBottomMatcher.runcs*td��fdd���|j�td�dS)z<Prints a graphviz diagram of the BM automaton(for debugging)z
digraph g{csZ|j��D]J}|j|}td|j|jt|�t|j�f�|dkrLt|j��|�q
dS)Nz%d -> %d [label=%s] //%sr)r�keys�printr�	type_repr�strr	r
)ZnodeZsubnode_keyZsubnode��
print_noderrr5�s
�
z*BottomMatcher.print_ac.<locals>.print_node�}N)r1rrrr4r�print_ac�s
zBottomMatcher.print_acN)	rrrrrr#r r/r7rrrrrs"8rcCsDts8ddlm}|j��D]\}}t|�tkr|t|<qt�||�S)Nr)�python_symbols)�_type_reprsZpygramr8�__dict__�itemsr-�int�
setdefault)Ztype_numr8�name�valrrrr2�s
r2)r�
__author__rr�collectionsrrrZ	btm_utilsr�objectrrr9r2rrrr�<module>s	lib2to3/__pycache__/pygram.cpython-38.pyc000064400000002356151153537460014201 0ustar00U

e5d�@s�dZddlZddlmZddlmZddlmZej�ej�	e
�d�Zej�ej�	e
�d�ZGd	d
�d
e
�Ze�de�Zee�Ze��Zejd=e��Zejd
=e�de�Zee�ZdS)z&Export the Python grammar and symbols.�N�)�token)�driver)�pytreezGrammar.txtzPatternGrammar.txtc@seZdZdd�ZdS)�SymbolscCs$|j��D]\}}t|||�q
dS)z�Initializer.

        Creates an attribute for each grammar symbol (nonterminal),
        whose value is the symbol's type (an int >= 256).
        N)Z
symbol2number�items�setattr)�selfZgrammar�nameZsymbol�r�&/usr/lib64/python3.8/lib2to3/pygram.py�__init__szSymbols.__init__N)�__name__�
__module__�__qualname__r
rrrrrsrZlib2to3�print�exec)�__doc__�osZpgen2rr�r�path�join�dirname�__file__Z
_GRAMMAR_FILEZ_PATTERN_GRAMMAR_FILE�objectrZload_packaged_grammarZpython_grammarZpython_symbols�copyZ!python_grammar_no_print_statement�keywordsZ*python_grammar_no_print_and_exec_statementZpattern_grammarZpattern_symbolsrrrr�<module>s"�lib2to3/__pycache__/fixer_util.cpython-38.opt-2.pyc000064400000023464151153537460016017 0ustar00U

e5dg;�
@s�ddlmZddlmZmZddlmZddlm	Z	dd�Z
dd�Zd	d
�Zdd�Z
dVdd�Zdd�Zdd�Zdd�Ze�e�fdd�ZdWdd�Zdd�Zdd�ZdXdd�Zd d!�ZdYd"d#�ZdZd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1d2d3d4d5d6d7d8d9h
Zd:d;�Z d<a!d=a"d>a#d?a$d@dA�Z%dBdC�Z&dDdE�Z'dFdG�Z(dHdI�Z)dJdK�Z*dLdM�Z+dNdO�Z,ej-ej.hZ/d[dPdQ�Z0ej.ej-ej1hZ2dRdS�Z3d\dTdU�Z4d
S)]�)�token)�Leaf�Node)�python_symbols)�patcompcCsttj|ttjd�|g�S)N�=)r�symsZargumentrr�EQUAL)�keyword�value�r�*/usr/lib64/python3.8/lib2to3/fixer_util.py�
KeywordArgs�rcCsttjd�S)N�()rr�LPARrrrr
�LParensrcCsttjd�S)N�))rr�RPARrrrr
�RParensrcCsHt|t�s|g}t|t�s&d|_|g}ttj|ttjddd�g|�S)N� r��prefix)	�
isinstance�listrrr�atomrrr	)�target�sourcerrr
�Assigns

�rNcCsttj||d�S�Nr)rr�NAME)�namerrrr
�Name$sr!cCs|ttjt�|g�gS�N)rr�trailer�Dot)�obj�attrrrr
�Attr(sr'cCsttjd�S)N�,)rr�COMMArrrr
�Comma,sr*cCsttjd�S)N�.)rr�DOTrrrr
r$0sr$cCs4ttj|��|��g�}|r0|�dttj|��|S)Nr)rrr#�clone�insert_child�arglist)�argsZlparenZrparen�noderrr
�ArgList4sr2cCs&ttj|t|�g�}|dk	r"||_|Sr")rr�powerr2r)Z	func_namer0rr1rrr
�Call;sr4cCsttjd�S)N�
�rr�NEWLINErrrr
�NewlineBsr8cCsttjd�S)N�r6rrrr
�	BlankLineFsr:cCsttj||d�Sr)rr�NUMBER)�nrrrr
�NumberJsr=cCs"ttjttjd�|ttjd�g�S)N�[�])rrr#rr�LBRACE�RBRACE)Z
index_noderrr
�	SubscriptMs
�rBcCsttj||d�Sr)rr�STRING)�stringrrrr
�StringSsrEc	Cs�d|_d|_d|_ttjd�}d|_ttjd�}d|_||||g}|rtd|_ttjd�}d|_|�ttj||g��ttj|ttj	|�g�}ttj
ttjd�|ttjd�g�S)Nr9r�for�in�ifr>r?)
rrrr�appendrrZcomp_ifZ	listmakerZcomp_forrr@rA)	Zxp�fp�itZtestZfor_leafZin_leafZ
inner_argsZif_leaf�innerrrr
�ListCompWs(

��rMcCsV|D]}|��qttjd�ttj|dd�ttjddd�ttj|�g}ttj|�}|S)N�fromrr�import)�removerrrrr�import_as_names�import_from)Zpackage_nameZ
name_leafsZleaf�children�imprrr
�
FromImportos


�rUc	Cs�|d��}|jtjkr"|��}nttj|��g�}|d}|rNdd�|D�}ttjtt|d�t|d��ttj|d��||d��g�g|�}|j	|_	|S)	Nr%�aftercSsg|]}|���qSr)r-)�.0r<rrr
�
<listcomp>�sz!ImportAndCall.<locals>.<listcomp>�rZlparZrpar)
r-�typerr/rr3r'r!r#r)r1�results�namesr%Z
newarglistrV�newrrr
�
ImportAndCall�s*


�����r^cCs�t|t�r |jt�t�gkr dSt|t�o�t|j�dko�t|jdt�o�t|jdt�o�t|jdt�o�|jdjdko�|jdjdkS)NT�rYr�rr)rrrSrr�lenrr�r1rrr
�is_tuple�s
������rccCsXt|t�oVt|j�dkoVt|jdt�oVt|jdt�oV|jdjdkoV|jdjdkS)NrrY���r>r?)rrrarSrrrbrrr
�is_list�s
�����recCsttjt�|t�g�Sr")rrrrrrbrrr
�parenthesize�srf�sortedr�set�any�all�tuple�sum�min�max�	enumerateccs$t||�}|r |Vt||�}q
dSr")�getattr)r%r&�nextrrr
�
attr_chain�s
rrzefor_stmt< 'for' any 'in' node=any ':' any* >
        | comp_for< 'for' any 'in' node=any any* >
     z�
power<
    ( 'iter' | 'list' | 'tuple' | 'sorted' | 'set' | 'sum' |
      'any' | 'all' | 'enumerate' | (any* trailer< '.' 'join' >) )
    trailer< '(' node=any ')' >
    any*
>
z`
power<
    ( 'sorted' | 'enumerate' )
    trailer< '(' arglist<node=any any*> ')' >
    any*
>
FcCspts&t�t�at�t�at�t�adatttg}t|t|d��D]*\}}i}|�||�r@|d|kr@dSq@dS)NT�parentr1F)	�
pats_builtrZcompile_pattern�p0�p1�p2�ziprr�match)r1Zpatterns�patternrsr[rrr
�in_special_context�s



r{cCs�|j}|dk	r|jtjkrdS|j}|jtjtjfkr:dS|jtjkrX|j	d|krXdS|jtj
ks�|jtjkr�|dk	r�|jtjks�|j	d|kr�dSdS)NFrYT)
Zprev_siblingrZrr,rsr�funcdef�classdef�	expr_stmtrSZ
parametersZ
typedargslistr))r1�prevrsrrr
�is_probably_builtin�s&
��
��r�cCsJ|dk	rF|jtjkr>t|j�dkr>|jd}|jtjkr>|jS|j}qdS)Nr`rr9)	rZr�suiterarSr�INDENTrrs)r1�indentrrr
�find_indentations
r�cCs>|jtjkr|S|��}|jd}|_ttj|g�}||_|Sr")rZrr�r-rsr)r1rsr�rrr
�
make_suitesr�cCs$|jtjkr |j}|std��q|S)Nz,root found before file_input node was found.)rZrZ
file_inputrs�
ValueErrorrbrrr
�	find_root&s

r�cCst|t|�|�}t|�Sr")�find_bindingr��bool)�packager r1Zbindingrrr
�does_tree_import/sr�cCs|jtjtjfkSr")rZr�import_namerRrbrrr
�	is_import7sr�cCs.dd�}t|�}t|||�r dSd}}t|j�D]F\}}||�sDq2t|j|d��D]\}}||�sVqlqV||}qzq2|dkr�t|j�D]8\}}|jtjkr�|jr�|jdjtjkr�|d}q�q�|dkr�t	tj
ttjd�ttj|dd�g�}	nt
|ttj|dd�g�}	|	t�g}
|�|t	tj|
��dS)NcSs |jtjko|jot|jd�S)NrY)rZr�simple_stmtrSr�rbrrr
�is_import_stmt>s�z$touch_import.<locals>.is_import_stmtrYrrOrr)r�r�rorSrZrr�rrCrr�rrrUr8r.)r�r r1r��rootZ
insert_pos�offset�idxZnode2�import_rSrrr
�touch_import;s8�
�
r�cCs�|jD�]�}d}|jtjkrVt||jd�r4|St|t|jd�|�}|rR|}�n0|jtjtjfkr�t|t|jd�|�}|r�|}�n�|jtj	k�rt|t|jd�|�}|r�|}nTt
|jdd��D]@\}}|jtjkr�|j
dkr�t|t|j|d�|�}|r�|}q�nx|jtk�r2|jdj
|k�r2|}nTt|||��rF|}n@|jtjk�rbt|||�}n$|jtjk�r�t||jd��r�|}|r|�s�|St|�r|SqdS)Nrrdr`r_�:�rY)rSrZrZfor_stmt�_findr�r�Zif_stmtZ
while_stmtZtry_stmtror�COLONr�	_def_syms�_is_import_bindingr�r~r�)r r1r��childZretr<�iZkidrrr
r�isH
r�cCsT|g}|rP|��}|jdkr4|jtkr4|�|j�q|jtjkr|j|kr|SqdS)N�)�poprZ�_block_syms�extendrSrrr)r r1Znodesrrr
r��sr�cCs�|jtjkr�|s�|jd}|jtjkrx|jD]H}|jtjkrV|jdj|krt|Sq,|jtjkr,|j|kr,|Sq,nL|jtjkr�|jd}|jtjkr�|j|kr�|Sn|jtjkr�|j|kr�|Sn�|jtj	k�r�|r�t
|jd���|kr�dS|jd}|�rtd|��rdS|jtj
k�r0t||��r0|S|jtjk�rh|jd}|jtjk�r�|j|k�r�|Sn6|jtjk�r�|j|k�r�|S|�r�|jtjk�r�|SdS)Nrr`rdr_�as)rZrr�rSZdotted_as_namesZdotted_as_namerrrrR�str�stripr�rQZimport_as_name�STAR)r1r r�rTr�Zlastr<rrr
r��s@





r�)N)NN)N)N)N)N)N)5Zpgen2rZpytreerrZpygramrrr9rrrrrr!r'r*r$r2r4r8r:r=rBrErMrUr^rcrerfZconsuming_callsrrrurvrwrtr{r�r�r�r�r�r�r�r}r|r�r�r#r�r�r�rrrr
�<module>s^




�		-
*
lib2to3/__pycache__/__init__.cpython-38.opt-2.pyc000064400000000203151153537460015366 0ustar00U

e5d�@sdS)N�rrr�(/usr/lib64/python3.8/lib2to3/__init__.py�<module>�lib2to3/__pycache__/pytree.cpython-38.opt-2.pyc000064400000035155151153537460015155 0ustar00U

e5d8m�@s�dZddlZddlmZdZiadd�ZGdd�de�ZGd	d
�d
e�Z	Gdd�de�Z
d
d�ZGdd�de�ZGdd�de�Z
Gdd�de�ZGdd�de�ZGdd�de�Zdd�ZdS)z#Guido van Rossum <guido@python.org>�N)�StringIOi���cCsDts8ddlm}|j��D]\}}t|�tkr|t|<qt�||�S)N�)�python_symbols)�_type_reprsZpygramr�__dict__�items�type�int�
setdefault)Ztype_numr�name�val�r
�&/usr/lib64/python3.8/lib2to3/pytree.py�	type_reprs
rc@s�eZdZdZdZdZdZdZdd�Zdd�Z	dZ
dd	�Zd
d�Zdd
�Z
dd�Zdd�Zdd�Zdd�Zdd�Zedd��Zedd��Zdd�Zdd�Zd d!�Zejd"kr�d#d$�ZdS)%�BaseNr
FcOs
t�|�S�N��object�__new__��cls�args�kwdsr
r
rr1szBase.__new__cCs|j|jk	rtS|�|�Sr)�	__class__�NotImplemented�_eq��self�otherr
r
r�__eq__6szBase.__eq__cCst�dSr��NotImplementedErrorrr
r
rrBs	zBase._eqcCst�dSrr �rr
r
r�cloneMsz
Base.clonecCst�dSrr r"r
r
r�
post_orderUszBase.post_ordercCst�dSrr r"r
r
r�	pre_order]szBase.pre_ordercCs~t|t�s|g}g}d}|jjD].}||krD|dk	r>|�|�d}q |�|�q |j��||j_|D]}|j|_qfd|_dS�NFT)�
isinstance�list�parent�children�extend�append�changed)r�newZ
l_children�found�ch�xr
r
r�replacees



zBase.replacecCs*|}t|t�s$|jsdS|jd}q|jS�Nr)r'�Leafr*�lineno�r�noder
r
r�
get_lineno|s
zBase.get_linenocCs|jr|j��d|_dS�NT)r)r-�was_changedr"r
r
rr-�s
zBase.changedcCsJ|jrFt|jj�D]2\}}||kr|j��|jj|=d|_|SqdSr)r)�	enumerater*r-)r�ir7r
r
r�remove�s

zBase.removec	Cs`|jdkrdSt|jj�D]@\}}||krz|jj|dWStk
rXYdSXqdS)Nr)r)r;r*�
IndexError�rr<�childr
r
r�next_sibling�s
zBase.next_siblingcCsR|jdkrdSt|jj�D]2\}}||kr|dkr8dS|jj|dSqdS�Nrr)r)r;r*r?r
r
r�prev_sibling�s
zBase.prev_siblingccs|jD]}|��EdHqdSr)r*�leaves�rr@r
r
rrD�s
zBase.leavescCs|jdkrdSd|j��SrB)r)�depthr"r
r
rrF�s
z
Base.depthcCs|j}|dkrdS|jS�N�)rA�prefix)rZnext_sibr
r
r�
get_suffix�szBase.get_suffix��rcCst|��d�S)N�ascii)�str�encoder"r
r
r�__str__�szBase.__str__)�__name__�
__module__�__qualname__rr)r*r:Zwas_checkedrr�__hash__rr#r$r%r2r8r-r=�propertyrArCrDrFrJ�sys�version_inforPr
r
r
rrs2
	




rc@s�eZdZddd�Zdd�Zdd�Zejdkr0eZd	d
�Z	dd�Z
d
d�Zdd�Ze
dd��Zejdd��Zdd�Zdd�Zdd�ZdS)�NodeNcCsN||_t|�|_|jD]
}||_q|dk	r0||_|rD|dd�|_nd|_dSr)rr(r*r)rI�fixers_applied)rrr*�contextrIrYr0r
r
r�__init__�s


z
Node.__init__cCsd|jjt|j�|jfS)Nz
%s(%s, %r))rrQrrr*r"r
r
r�__repr__�s�z
Node.__repr__cCsd�tt|j��SrG)�join�maprNr*r"r
r
r�__unicode__�szNode.__unicode__rKcCs|j|jf|j|jfkSr)rr*rr
r
rr�szNode._eqcCst|jdd�|jD�|jd�S)NcSsg|]}|���qSr
)r#)�.0r0r
r
r�
<listcomp>szNode.clone.<locals>.<listcomp>�rY)rXrr*rYr"r
r
rr#s�z
Node.cloneccs$|jD]}|��EdHq|VdSr)r*r$rEr
r
rr$s
zNode.post_orderccs$|V|jD]}|��EdHqdSr)r*r%rEr
r
rr%s
zNode.pre_ordercCs|js
dS|jdjS)NrHr�r*rIr"r
r
rrIszNode.prefixcCs|jr||jd_dSr3rc�rrIr
r
rrIscCs(||_d|j|_||j|<|��dSr)r)r*r-r?r
r
r�	set_child s
zNode.set_childcCs ||_|j�||�|��dSr)r)r*�insertr-r?r
r
r�insert_child*szNode.insert_childcCs||_|j�|�|��dSr)r)r*r,r-rEr
r
r�append_child3szNode.append_child)NNN)rQrRrSr[r\r_rVrWrPrr#r$r%rUrI�setterrergrhr
r
r
rrX�s&�




	rXc@s�eZdZdZdZdZddgfdd�Zdd�Zdd	�Ze	j
d
krBeZdd�Zd
d�Z
dd�Zdd�Zdd�Zedd��Zejdd��ZdS)r4rHrNcCsF|dk	r|\|_\|_|_||_||_|dk	r4||_|dd�|_dSr)�_prefixr5�columnr�valuerY)rrrlrZrIrYr
r
rr[Fsz
Leaf.__init__cCsd|jj|j|jfS)Nz
%s(%r, %r))rrQrrlr"r
r
rr\Ys�z
Leaf.__repr__cCs|jt|j�Sr)rIrNrlr"r
r
rr__szLeaf.__unicode__rKcCs|j|jf|j|jfkSr)rrlrr
r
rrjszLeaf._eqcCs$t|j|j|j|j|jff|jd�S)Nrb)r4rrlrIr5rkrYr"r
r
rr#ns
�z
Leaf.cloneccs
|VdSrr
r"r
r
rrDtszLeaf.leavesccs
|VdSrr
r"r
r
rr$wszLeaf.post_orderccs
|VdSrr
r"r
r
rr%{szLeaf.pre_ordercCs|jSr)rjr"r
r
rrIszLeaf.prefixcCs|��||_dSr)r-rjrdr
r
rrI�s)rQrRrSrjr5rkr[r\r_rVrWrPrr#rDr$r%rUrIrir
r
r
rr4=s(�


r4cCsN|\}}}}|s||jkr<t|�dkr.|dSt|||d�St|||d�SdS)Nrr)rZ)Z
number2symbol�lenrXr4)ZgrZraw_noderrlrZr*r
r
r�convert�srnc@sLeZdZdZdZdZdd�Zdd�Zdd�Zddd	�Z	dd
d�Z
dd
�ZdS)�BasePatternNcOs
t�|�Srrrr
r
rr�szBasePattern.__new__cCsHt|j�|j|jg}|r,|ddkr,|d=qd|jjd�tt|��fS)N���z%s(%s)z, )	rr�contentrrrQr]r^�repr)rrr
r
rr\�szBasePattern.__repr__cCs|Srr
r"r
r
r�optimize�szBasePattern.optimizecCsn|jdk	r|j|jkrdS|jdk	rRd}|dk	r4i}|�||�sDdS|rR|�|�|dk	rj|jrj|||j<dSr&)rrq�	_submatch�updater)rr7�results�rr
r
r�match�s


zBasePattern.matchcCs t|�dkrdS|�|d|�S)NrFr)rmrx)r�nodesrvr
r
r�	match_seq�szBasePattern.match_seqccs&i}|r"|�|d|�r"d|fVdSrB)rx)rryrwr
r
r�generate_matches�szBasePattern.generate_matches)N)N)rQrRrSrrqrrr\rsrxrzr{r
r
r
rro�s


roc@s*eZdZddd�Zd	dd�Zd
dd�ZdS)�LeafPatternNcCs&|dk	r|dk	r||_||_||_dSr)rrqr)rrrqrr
r
rr[�s
zLeafPattern.__init__cCst|t�sdSt�|||�S�NF)r'r4rorx�rr7rvr
r
rrx
s
zLeafPattern.matchcCs|j|jkSr)rqrlr~r
r
rrts
zLeafPattern._submatch)NNN)N)N)rQrRrSr[rxrtr
r
r
rr|�s

r|c@s$eZdZdZddd�Zddd�ZdS)	�NodePatternFNcCsP|dk	r|dk	r:t|�}t|�D]\}}t|t�r d|_q ||_||_||_dSr9)r(r;r'�WildcardPattern�	wildcardsrrqr)rrrqrr<�itemr
r
rr[$s
zNodePattern.__init__cCs�|jrHt|j|j�D].\}}|t|j�kr|dk	r<|�|�dSqdSt|j�t|j�kr`dSt|j|j�D]\}}|�||�sndSqndS�NTF)r�r{rqr*rmru�ziprx)rr7rv�crw�
subpatternr@r
r
rrtAs

zNodePattern._submatch)NNN)N)rQrRrSr�r[rtr
r
r
rr s
rc@sZeZdZddedfdd�Zdd�Zddd�Zdd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)r�NrcCs<|dk	r ttt|��}|D]}q||_||_||_||_dSr)�tupler^rq�min�maxr)rrqr�r�r�altr
r
rr[kszWildcardPattern.__init__cCs�d}|jdk	r<t|j�dkr<t|jd�dkr<|jdd}|jdkr�|jdkr�|jdkrft|jd�S|dk	r�|j|jkr�|��S|jdkr�t|t�r�|jdkr�|j|jkr�t|j|j|j|j|j|j�S|S)Nrr)r)	rqrmr�r�rrrsr'r�)rr�r
r
rrs�s.
��
�
�

�zWildcardPattern.optimizecCs|�|g|�Sr)rzr~r
r
rrx�szWildcardPattern.matchcCsP|�|�D]@\}}|t|�kr
|dk	rD|�|�|jrDt|�||j<dSq
dSr�)r{rmrurr()rryrvr�rwr
r
rrz�s
zWildcardPattern.match_seqc	cs,|jdkrTt|jdtt|�|j��D]*}i}|jrF|d|�||j<||fVq&n�|jdkrl|�|�Vn�ttd�r�tj	}t
�t_	z�z<|�|d�D]*\}}|jr�|d|�||j<||fVq�WnLtk
�r|�
|�D]*\}}|jr�|d|�||j<||fVq�YnXW5ttd��r&|t_	XdS)NrZ	bare_name�getrefcountr)rq�ranger�rmr�r�_bare_name_matches�hasattrrV�stderrr�_recursive_matches�RuntimeError�_iterative_matches)rry�countrwZsave_stderrr
r
rr{�s.
 

z WildcardPattern.generate_matchesccs�t|�}d|jkrdifVg}|jD]0}t||�D] \}}||fV|�||f�q4q&|r�g}|D]�\}}	||krd||jkrd|jD]`}t|||d��D]H\}
}|
dkr�i}|�|	�|�|�||
|fV|�||
|f�q�q�qd|}qXdSr3)rmr�rqr{r,r�ru)rryZnodelenrvr�r�rwZnew_results�c0�r0�c1�r1r
r
rr��s*






z"WildcardPattern._iterative_matchescCspd}i}d}t|�}|sV||krVd}|jD](}|d�|||�r*|d7}d}qq*q|d|�||j<||fS)NrFTr)rmrqrxr)rryr�rwZdoner�Zleafr
r
rr��s
z"WildcardPattern._bare_name_matchesc	cs�||jkrdifV||jkr�|jD]`}t||�D]P\}}|�||d�|d�D].\}}i}|�|�|�|�|||fVqRq2q$dSrB)r�r�rqr{r�ru)	rryr�r�r�r�r�r�rwr
r
rr�
s



 

z"WildcardPattern._recursive_matches)N)N)rQrRrS�HUGEr[rsrxrzr{r�r�r�r
r
r
rr�]s#

-r�c@s.eZdZd
dd�Zdd�Zdd�Zdd	�ZdS)�NegatedPatternNcCs|dk	r||_dSr)rq)rrqr
r
rr[s	zNegatedPattern.__init__cCsdSr}r
r6r
r
rrx(szNegatedPattern.matchcCst|�dkSr3)rm)rryr
r
rrz,szNegatedPattern.match_seqccsJ|jdkr"t|�dkrFdifVn$|j�|�D]\}}dSdifVdSr3)rqrmr{)rryr�rwr
r
rr{0s
zNegatedPattern.generate_matches)N)rQrRrSr[rxrzr{r
r
r
rr�s

r�c	cs�|sdifVn||d|dd�}}|�|�D]Z\}}|sH||fVq0t|||d��D].\}}i}|�|�|�|�|||fVqZq0dSrB)r{ru)	Zpatternsry�p�restr�r�r�r�rwr
r
rr{<s


r{)�
__author__rV�iorr�rrrrrXr4rnror|rr�r�r{r
r
r
r�<module>
s"
1nNV,==#lib2to3/__pycache__/btm_utils.cpython-38.pyc000064400000014010151153537460014672 0ustar00U

e5d�&�@s|dZddlmZddlmZmZddlmZmZeZ	eZ
ejZeZ
dZdZdZGdd	�d	e�Zddd�Zd
d�Zdd�Zd
S)z0Utility functions used by the btm_matcher module�)�pytree)�grammar�token)�pattern_symbols�python_symbols���������c@s:eZdZdZd
dd�Zdd�Zdd�Zd	d
�Zdd�ZdS)�MinNodez�This class serves as an intermediate representation of the
    pattern tree during the conversion to sets of leaf-to-root
    subpatternsNcCs.||_||_g|_d|_d|_g|_g|_dS)NF)�type�name�children�leaf�parent�alternatives�group)�selfrr�r�)/usr/lib64/python3.8/lib2to3/btm_utils.py�__init__szMinNode.__init__cCst|j�dt|j�S)N� )�strrr)rrrr�__repr__szMinNode.__repr__cCs�|}g}|r�|jtkr^|j�|�t|j�t|j�krRt|j�g}g|_|j}qn|j}d}q�|jtkr�|j	�|�t|j	�t|j�kr�t
|j	�}g|_	|j}qn|j}d}q�|jtjkr�|j
r�|�|j
�n|�|j�|j}q|S)z�Internal method. Returns a characteristic path of the
        pattern tree. This method must be run for all leaves until the
        linear subpatterns are merged into a singleN)r�TYPE_ALTERNATIVESr�append�lenr
�tupler�
TYPE_GROUPr�get_characteristic_subpattern�token_labels�NAMEr)r�node�subprrr�leaf_to_root!s8


zMinNode.leaf_to_rootcCs&|��D]}|��}|r|SqdS)a�Drives the leaf_to_root method. The reason that
        leaf_to_root must be run multiple times is because we need to
        reject 'group' matches; for example the alternative form
        (a | b c) creates a group [b c] that needs to be matched. Since
        matching multiple linear patterns overcomes the automaton's
        capabilities, leaf_to_root merges each group into a single
        choice based on 'characteristic'ity,

        i.e. (a|b c) -> (a|b) if b more characteristic than c

        Returns: The most 'characteristic'(as defined by
          get_characteristic_subpattern) path for the compiled pattern
          tree.
        N)�leavesr#)r�lr"rrr�get_linear_subpatternKszMinNode.get_linear_subpatternccs*|jD]}|��EdHq|js&|VdS)z-Generator that returns the leaves of the treeN)r
r$)r�childrrrr$`s
zMinNode.leaves)NN)	�__name__�
__module__�__qualname__�__doc__rrr#r&r$rrrrr
s
	*r
Nc
Cs�d}|jtjkr|jd}|jtjkr�t|j�dkrFt|jd|�}nFttd�}|jD]4}|j�	|�drlqVt||�}|dk	rV|j�
|�qV�n|jtjkr�t|j�dkr�ttd�}|jD]}t||�}|r�|j�
|�q�|js�d}nt|jd|�}�n�|jtj
k�r�t|jdtj��r>|jdjdk�r>t|jd|�St|jdtj��rd|jdjdk�s�t|j�dk�r�t|jdd��r�|jdjdk�r�dSd	}d}d}d
}d}	d
}
|jD]d}|jtjk�r�d
}|}n*|jtjk�r�d	}|}	n|jtjk�r|}t|d��r�|jdk�r�d	}
�q�|
�rT|jd}t|d��r^|jdk�r^|jd}n
|jd}|jtjk�r�|jd
k�r�ttd�}n4tt|j��r�ttt|j�d�}nttt|j�d�}n\|jtjk�r�|j�d�}|tk�r�tt|d�}nttj|d�}n|jtjk�rt||�}|�rL|	jdjdk�r4d}n|	jdjdk�rHnt�|�r�|dk	�r�|jdd�D]&}t||�}|dk	�rj|j�
|��qj|�r�||_|S)z�
    Internal function. Reduces a compiled pattern tree to an
    intermediate representation suitable for feeding the
    automaton. This also trims off any optional pattern elements(like
    [a], a*).
    N��)rr�(�[�valueTF�=��any�')rr�*�+r)r�symsZMatcherr
ZAlternativesr�reduce_treer
r�indexrZAlternativerZUnit�
isinstancerZLeafr0�hasattrZDetailsZRepeaterrr �TYPE_ANY�getattr�pysyms�STRING�strip�tokens�NotImplementedErrorr)
r!rZnew_noder'ZreducedrZdetails_nodeZalternatives_nodeZhas_repeaterZ
repeater_nodeZhas_variable_nameZ	name_leafrrrrr8gs�






�����






r8cs�t|t�s|St|�dkr"|dSg}g}dddddg�g}d�|D]d}tt|d	d
���rDtt|�fdd
���r||�|�qDtt|�fdd
���r�|�|�qD|�|�qD|r�|}n|r�|}n|r�|}t|td
�S)z�Picks the most characteristic from a list of linear patterns
    Current order used is:
    names > common_names > common_chars
    rr,�in�for�if�not�Nonez[]().,:cSst|�tkS�N)rr��xrrr�<lambda>��z/get_characteristic_subpattern.<locals>.<lambda>cst|t�o|�kSrH�r:rrI)�common_charsrrrKrLcst|t�o|�kSrHrMrI)�common_namesrrrKrL)�key)r:�listrr3�rec_testr�max)ZsubpatternsZsubpatterns_with_namesZsubpatterns_with_common_namesZsubpatterns_with_common_chars�
subpatternr)rNrOrr�s6

�
�rccs8|D].}t|ttf�r(t||�EdHq||�VqdS)zPTests test_func on all items of sequence and items of included
    sub-iterablesN)r:rQrrR)ZsequenceZ	test_funcrJrrrrRsrR)N)r+�rZpgen2rrZpygramrrr7r>ZopmaprArr<rr�objectr
r8rrRrrrr�<module>sW
%lib2to3/__pycache__/btm_matcher.cpython-38.opt-2.pyc000064400000006354151153537460016131 0ustar00U

e5d��@shdZddlZddlZddlmZddlmZddlmZGdd�de	�Z
Gd	d
�d
e	�Ziadd�Z
dS)
z+George Boutsioukis <gboutsioukis@gmail.com>�N)�defaultdict�)�pytree)�reduce_treec@seZdZe��Zdd�ZdS)�BMNodecCs"i|_g|_ttj�|_d|_dS)N�)�transition_table�fixers�nextr�count�id�content��self�r�+/usr/lib64/python3.8/lib2to3/btm_matcher.py�__init__szBMNode.__init__N)�__name__�
__module__�__qualname__�	itertoolsrrrrrrrsrc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�
BottomMatchercCs0t�|_t�|_|jg|_g|_t�d�|_dS)NZRefactoringTool)	�set�matchr�rootZnodesr	�loggingZ	getLoggerZloggerrrrrrs

zBottomMatcher.__init__cCsH|j�|�t|j�}|��}|j||jd�}|D]}|j�|�q2dS)N��start)r	�appendrZpattern_treeZget_linear_subpattern�addr)r�fixerZtreeZlinear�match_nodesZ
match_noderrr�	add_fixer%s
zBottomMatcher.add_fixerc	Cs�|s
|gSt|dt�r`g}|dD]6}|j||d�}|D]}|�|�|dd�|��q:q$|S|d|jkr�t�}||j|d<n|j|d}|dd�r�|j|dd�|d�}n|g}|SdS)Nrrr)�
isinstance�tupler�extendrr)r�patternrr!�alternativeZ	end_nodes�endZ	next_noderrrr1s"zBottomMatcher.addc	Cs�|j}tt�}|D]�}|}|rd|_|jD]$}t|tj�r*|jdkr*d|_qPq*|j	dkrb|j}n|j	}||j
kr�|j
|}|jD]}||�|�q�nH|j}|j
dk	r�|j
jr�q||j
kr�|j
|}|jD]}||�|�q�|j
}qq|S)NT�;Fr)rr�listZwas_checkedZchildrenr#rZLeaf�value�typerr	r�parent)	rZleavesZcurrent_ac_nodeZresultsZleafZcurrent_ast_nodeZchildZ
node_tokenr rrr�runSs8





�



zBottomMatcher.runcs*td��fdd���|j�td�dS)Nz
digraph g{csZ|j��D]J}|j|}td|j|jt|�t|j�f�|dkrLt|j��|�q
dS)Nz%d -> %d [label=%s] //%sr)r�keys�printr�	type_repr�strr	r
)ZnodeZsubnode_keyZsubnode��
print_noderrr4�s
�
z*BottomMatcher.print_ac.<locals>.print_node�})r0rrrr3r�print_ac�s
zBottomMatcher.print_acN)rrrrr"rr.r6rrrrrs
"8rcCsDts8ddlm}|j��D]\}}t|�tkr|t|<qt�||�S)Nr)�python_symbols)�_type_reprsZpygramr7�__dict__�itemsr,�int�
setdefault)Ztype_numr7�name�valrrrr1�s
r1)�
__author__rr�collectionsrrrZ	btm_utilsr�objectrrr8r1rrrr�<module>s	lib2to3/__pycache__/__init__.cpython-38.pyc000064400000000203151153537460014426 0ustar00U

e5d�@sdS)N�rrr�(/usr/lib64/python3.8/lib2to3/__init__.py�<module>�lib2to3/__pycache__/__main__.cpython-38.pyc000064400000000327151153537460014416 0ustar00U

e5dC�@s&ddlZddlmZe�ed��dS)�N�)�mainz
lib2to3.fixes)�sysr�exit�rr�(/usr/lib64/python3.8/lib2to3/__main__.py�<module>slib2to3/__pycache__/refactor.cpython-38.pyc000064400000047732151153537460014516 0ustar00U

e5dk�@sdZdZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddlmZm
Z
mZddlmZddlmZmZdd	lmZd!dd�ZGd
d�de�Zdd�Zdd�Zdd�Zdd�Zdd�ZGdd�de�ZGdd�de�Z Gdd�de�Z!Gdd �d e �Z"dS)"z�Refactoring framework.

Used as a main program, this can refactor any number of files and/or
recursively descend down directories.  Imported as a module, this
provides infrastructure to write your own refactoring tool.
z#Guido van Rossum <guido@python.org>�N)�chain�)�driver�tokenize�token)�	find_root)�pytree�pygram)�btm_matcherTcCsTt|ggdg�}g}t�|j�D].\}}}|�d�r |rD|dd�}|�|�q |S)zEReturn a sorted list of all available fix names in the given package.�*�fix_�N)�
__import__�pkgutilZiter_modules�__path__�
startswith�append)Z	fixer_pkgZ
remove_prefixZpkgZ	fix_names�finder�nameZispkg�r�(/usr/lib64/python3.8/lib2to3/refactor.py�get_all_fix_namess
rc@seZdZdS)�
_EveryNodeN��__name__�
__module__�__qualname__rrrrr+srcCs�t|tjtjf�r(|jdkr t�|jhSt|tj�rH|jrDt|j�St�t|tj	�r�t
�}|jD]}|D]}|�t|��qhq`|Std|��dS)zf Accepts a pytree Pattern Node and returns a set
        of the pattern types which will match first. Nz$Oh no! I don't understand pattern %s)
�
isinstancerZNodePatternZLeafPattern�typerZNegatedPatternZcontent�_get_head_typesZWildcardPattern�set�update�	Exception)Zpat�r�p�xrrrr/s


rc	Cs�t�t�}g}|D]x}|jrdzt|j�}Wntk
rH|�|�Yq�X|D]}||�|�qNq|jdk	r�||j�|�q|�|�qtt	j
j��t	j
j
�D]}||�|�q�t|�S)z^ Accepts a list of fixers and returns a dictionary
        of head node type --> fixer list.  N)�collections�defaultdict�list�patternrrrZ_accept_typerr	�python_grammarZ
symbol2number�values�tokens�extend�dict)Z
fixer_listZ
head_nodesZevery�fixerZheadsZ	node_typerrr�_get_headnode_dictKs$

�r0cs�fdd�t�d�D�S)zN
    Return the fully qualified names for fixers in the package pkg_name.
    csg|]}�d|�qS��.r)�.0�fix_name�Zpkg_namerr�
<listcomp>hs�z+get_fixers_from_package.<locals>.<listcomp>F)rr5rr5r�get_fixers_from_packageds
�r7cCs|S�Nr)�objrrr�	_identityksr:csXd}t�t�|�j���fdd�}ttjtjtj	h�}t
�}z�|�\}}||krTq>q>|tjkrl|rf�q6d}q>|tjk�r6|dk�r6|�\}}|tjks�|dkr��q6|�\}}|tjks�|dkrq6|�\}}|tj
kr�|dkr�|�\}}|tjk�r4|�|�|�\}}|tj
k�s.|d	k�r"�q4|�\}}q�q>�q6q>Wntk
�rNYnXt|�S)
NFcst��}|d|dfS)Nrr)�next)�tok��genrr�advancersz(_detect_future_features.<locals>.advanceT�fromZ
__future__�import�(�,)r�generate_tokens�io�StringIO�readline�	frozensetr�NEWLINE�NL�COMMENTr �STRING�NAME�OP�add�
StopIteration)�sourceZhave_docstringr?�ignore�features�tp�valuerr=r�_detect_future_featuresosB








rVc@seZdZdZdS)�
FixerErrorzA fixer could not be loaded.N)rrr�__doc__rrrrrW�srWc@s�eZdZddd�ZdZdZd4dd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zd5dd�Zd6dd�Z
dd�Zd7dd�Zdd�Zd8dd�Zdd�Zd d!�Zd9d"d#�Zd:d$d%�Zd&Zd'Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�ZdS);�RefactoringToolF)�print_function�write_unchanged_filesZFixrNcCs.||_|pg|_|j��|_|dk	r0|j�|�|jdrDtj|_ntj	|_|j�
d�|_g|_t
�d�|_g|_d|_tj|jtj|jd�|_|��\|_|_g|_t��|_g|_g|_t|j|j�D]F}|j r�|j�!|�q�||jkr�|j�"|�q�||jkr�|j�"|�q�t#|j�|_$t#|j�|_%dS)z�Initializer.

        Args:
            fixer_names: a list of fixers to import
            options: a dict with configuration.
            explicit: a list of fixers to run even if they are explicit.
        NrZr[rYF)�convert�logger)&�fixers�explicit�_default_options�copy�optionsr!r	�!python_grammar_no_print_statement�grammarr*�getr[�errors�loggingZ	getLoggerr]�	fixer_log�wroterZDriverrr\�
get_fixers�	pre_order�
post_order�files�bmZ
BottomMatcher�BMZ
bmi_pre_orderZbmi_post_orderrZ
BM_compatibleZ	add_fixerrr0�bmi_pre_order_heads�bmi_post_order_heads)�selfZfixer_namesrbr_r/rrr�__init__�s>


�


zRefactoringTool.__init__c	CsXg}g}|jD�]}t|iidg�}|�dd�d}|�|j�rR|t|j�d�}|�d�}|jd�dd	�|D��}zt	||�}Wn&t
k
r�td
||f�d�YnX||j|j
�}	|	jr�|jdk	r�||jkr�|�d|�q|�d
|�|	jdk�r|�|	�q|	jdk�r|�|	�qtd|	j��qt�d�}
|j|
d�|j|
d�||fS)aInspects the options to load the requested patterns and handlers.

        Returns:
          (pre_order, post_order), where pre_order is the list of fixers that
          want a pre-order AST traversal, and post_order is the list that want
          post-order traversal.
        rr2r���N�_�cSsg|]}|���qSr)�title)r3r$rrrr6�sz.RefactoringTool.get_fixers.<locals>.<listcomp>zCan't find %s.%sTzSkipping optional fixer: %szAdding transformation: %sZpreZpostzIllegal fixer order: %rZ	run_order��key)r^r�rsplitr�FILE_PREFIX�len�split�CLASS_PREFIX�join�getattr�AttributeErrorrWrbrhr_�log_message�	log_debug�orderr�operator�
attrgetter�sort)rrZpre_order_fixersZpost_order_fixersZfix_mod_path�modr4�parts�
class_nameZ	fix_classr/Zkey_funcrrrrj�s:
�
zRefactoringTool.get_fixerscOs�dS)zCalled when an error occurs.Nr)rr�msg�args�kwdsrrr�	log_error�szRefactoringTool.log_errorcGs|r||}|j�|�dS)zHook to log a message.N)r]�info�rrr�r�rrrr�szRefactoringTool.log_messagecGs|r||}|j�|�dSr8)r]�debugr�rrrr�	szRefactoringTool.log_debugcCsdS)zTCalled with the old version, new version, and filename of a
        refactored file.Nr)rr�old_text�new_text�filename�equalrrr�print_outputszRefactoringTool.print_outputcCs8|D].}tj�|�r$|�|||�q|�|||�qdS)z)Refactor a list of files and directories.N)�os�path�isdir�refactor_dir�
refactor_file)rr�items�write�
doctests_onlyZdir_or_filerrr�refactorszRefactoringTool.refactorc
Cs�tjd}t�|�D]�\}}}|�d|�|��|��|D]>}|�d�s>tj�|�d|kr>tj�||�}	|�	|	||�q>dd�|D�|dd�<qdS)z�Descends down a directory and refactor every Python file found.

        Python files are assumed to have a .py extension.

        Files and subdirectories starting with '.' are skipped.
        �pyzDescending into %sr2rcSsg|]}|�d�s|�qSr1)r)r3Zdnrrrr6.s
z0RefactoringTool.refactor_dir.<locals>.<listcomp>N)
r��extsep�walkr�r�rr��splitextrr�)
rrZdir_namer�r�Zpy_ext�dirpathZdirnames�	filenamesr�fullnamerrrr�s

�zRefactoringTool.refactor_dirc
Cs�zt|d�}Wn6tk
rD}z|�d||�WY�dSd}~XYnXzt�|j�d}W5|��Xtj|d|dd��}|��|fW5QR�SQRXdS)	zG
        Do our best to decode a Python source file correctly.
        �rbzCan't open %s: %s)NNNrr#rv��encoding�newline)	�open�OSErrorr��closer�detect_encodingrGrE�read)rrr��f�errr�rrr�_read_python_source0s
z#RefactoringTool._read_python_sourcecCs�|�|�\}}|dkrdS|d7}|rn|�d|�|�||�}|jsL||kr`|�|||||�q�|�d|�nH|�||�}|js�|r�|jr�|jt|�dd�|||d�n|�d|�dS)zRefactors a file.N�
zRefactoring doctests in %szNo doctest changes in %srt)r�r�zNo changes in %s)r�r��refactor_docstringr[�processed_file�refactor_string�was_changed�str)rrr�r�r��inputr��output�treerrrr�@s"�zRefactoringTool.refactor_filec
Cs�t|�}d|krtj|j_zVz|j�|�}Wn@tk
rl}z"|�d||jj	|�WY�W�dSd}~XYnXW5|j|j_X||_
|�d|�|�||�|S)aFRefactor a given input string.

        Args:
            data: a string holding the code to be refactored.
            name: a human-readable name for use in error/log messages.

        Returns:
            An AST corresponding to the refactored input stream; None if
            there were errors during the parse.
        rZzCan't parse %s: %s: %sNzRefactoring %s)
rVr	rcrrdZparse_stringr"r��	__class__r�future_featuresr��
refactor_tree)rr�datarrSr�r�rrrr�Ws"
� zRefactoringTool.refactor_stringcCs�tj��}|rN|�d�|�|d�}|js2||krB|�|d|�q�|�d�n:|�|d�}|jsj|r~|jr~|�t	|�d|�n
|�d�dS)NzRefactoring doctests in stdinz<stdin>zNo doctest changes in stdinzNo changes in stdin)
�sys�stdinr�r�r�r[r�r�r�r�)rrr�r�r�r�rrr�refactor_stdinrs

zRefactoringTool.refactor_stdinc

Cs�t|j|j�D]}|�||�q|�|j|���|�|j|���|j�|�	��}t
|����r�|jjD�]D}||krj||rj||j
tjjdd�|jr�||j
tjjd�t||�D]�}|||kr�||�|�zt|�Wntk
�rYq�YnX|j�r||jk�rq�|�|�}|r�|�||�}|dk	r�|�|�|��D] }|j�s^g|_|j�|��qL|j�|�	��}|D]*}	|	|k�r�g||	<||	�||	��q�q�qjqTt|j|j�D]}|�||��q�|jS)a�Refactors a parse tree (modifying the tree in place).

        For compatible patterns the bottom matcher module is
        used. Otherwise the tree is traversed node-to-node for
        matches.

        Args:
            tree: a pytree.Node instance representing the root of the tree
                  to be refactored.
            name: a human-readable name for this tree.

        Returns:
            True if the tree was modified, False otherwise.
        T)ry�reverserxN)rrkrlZ
start_tree�traverse_byrprqro�runZleaves�anyr+r^r�rZBaseZdepthZkeep_line_orderZ
get_linenor(�remover�
ValueErrorZfixers_applied�match�	transform�replacerr-Zfinish_treer�)
rrr�rr/Z	match_set�node�results�newZnew_matchesZfxrrrrr��sJ



zRefactoringTool.refactor_treecCsV|sdS|D]D}||jD]4}|�|�}|r|�||�}|dk	r|�|�|}qqdS)aTraverse an AST, applying a set of fixers to each node.

        This is a helper method for refactor_tree().

        Args:
            fixers: a list of fixer instances.
            traversal: a generator that yields AST nodes.

        Returns:
            None
        N)rr�r�r�)rrr^Z	traversalr�r/r�r�rrrr��s

zRefactoringTool.traverse_bycCs�|j�|�|dkr.|�|�d}|dkr.dS||k}|�||||�|r`|�d|�|js`dS|rv|�||||�n|�d|�dS)zR
        Called when a file has been refactored and there may be changes.
        NrzNo changes to %szNot writing changes to %s)rmrr�r�r�r[�
write_file)rrr�r�r�r�r�r�rrrr��szRefactoringTool.processed_filecCs�ztj|d|dd�}Wn6tk
rL}z|�d||�WY�dSd}~XYnX|�Fz|�|�Wn0tk
r�}z|�d||�W5d}~XYnXW5QRX|�d|�d|_dS)	z�Writes a string to a file.

        It first shows a unified diff between the old text and the new text, and
        then rewrites the file; the latter is only done if the write option is
        set.
        �wrvr�zCan't create %s: %sNzCan't write %s: %szWrote changes to %sT)rEr�r�r�r�r�ri)rrr�r�r�r��fpr�rrrr��s*zRefactoringTool.write_filez>>> z... c
	Csg}d}d}d}d}|jdd�D]�}|d7}|���|j�r~|dk	rZ|�|�||||��|}|g}|�|j�}	|d|	�}q |dk	r�|�||j�s�|||j��dkr�|�	|�q |dk	r�|�|�||||��d}d}|�	|�q |dk	�r
|�|�||||��d�
|�S)a�Refactors a docstring, looking for doctests.

        This returns a modified version of the input string.  It looks
        for doctests, which start with a ">>>" prompt, and may be
        continued with "..." prompts, as long as the "..." is indented
        the same as the ">>>".

        (Unfortunately we can't use the doctest module's parser,
        since, like most parsers, it is not geared towards preserving
        the original source.)
        NrT��keependsrr�rv)�
splitlines�lstripr�PS1r-�refactor_doctest�find�PS2�rstriprr)
rrr�r��result�blockZblock_lineno�indent�lineno�line�irrrr�sJ����
�z"RefactoringTool.refactor_docstringc

s.z��||��}Wnjtk
r|}zL�j�tj�rN|D]}��d|�d��q6��d|||j	j
|�|WY�Sd}~XYnX��||��r*t|�j
dd�}|d|d�||dd�}	}|	dg|dks�t|	��|d�d�s�|dd7<��j|�d	�g}|�r*|��fd
d�|D�7}|S)z�Refactors one doctest.

        A doctest is given as a block of lines, the first of which starts
        with ">>>" (possibly indented), while the remaining lines start
        with "..." (identically indented).

        z
Source: %sr�z+Can't parse docstring in %s line %s: %s: %sNTr�rrtrcsg|]}��j|�qSr)r�)r3r��r�rrrrr6Zsz4RefactoringTool.refactor_doctest.<locals>.<listcomp>)�parse_blockr"r]ZisEnabledForrg�DEBUGr�r�r�r�rr�r�r��AssertionError�endswithr��pop)
rrr�r�r�r�r�r�r�r�Zclippedrr�rr�@s.�"z RefactoringTool.refactor_doctestcCs�|jrd}nd}|js$|�d|�n"|�d|�|jD]}|�|�q6|jrl|�d�|jD]}|�|�q\|jr�t|j�dkr�|�d�n|�dt|j��|jD]\}}}|j|f|�|�q�dS)	N�werez
need to bezNo files %s modified.zFiles that %s modified:z$Warnings/messages while refactoring:rzThere was 1 error:zThere were %d errors:)rirmr�rhrfr|)rrr��file�messager�r�r�rrr�	summarize]s$


zRefactoringTool.summarizecCs"|j�|�|||��}t�|_|S)z�Parses a block into a tree.

        This is necessary to get correct line number / offset information
        in the parser diagnostics and embedded into the parse tree.
        )rZparse_tokens�	wrap_toksrHr�)rrr�r�r�r�rrrr�tszRefactoringTool.parse_blockccsdt�|�||�j�}|D]F\}}\}}\}	}
}||d7}|	|d7}	||||f|	|
f|fVqdS)z;Wraps a tokenize stream to systematically modify start/end.rN)rrD�	gen_lines�__next__)rrr�r�r�r,rrUZline0Zcol0Zline1Zcol1Z	line_textrrrr�~s
zRefactoringTool.wrap_toksccsx||j}||j}|}|D]N}|�|�r>|t|�d�Vn(||��dkrVdVntd||f��|}qdVqldS)z�Generates lines as expected by tokenize from a list of lines.

        This strips the first len(indent + self.PS1) characters off each line.
        Nr�zline=%r, prefix=%rrv)r�r�rr|r�r�)rrr�r��prefix1Zprefix2�prefixr�rrrr��s


zRefactoringTool.gen_lines)NN)FF)FF)FF)F)NFN)N)rrrr`r~r{rsrjr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrY�s>�
4(
	


O�

+
rYc@seZdZdS)�MultiprocessingUnsupportedNrrrrrr��sr�csBeZdZ�fdd�Zd�fdd�	Z�fdd�Z�fd	d
�Z�ZS)�MultiprocessRefactoringToolcs"tt|�j||�d|_d|_dSr8)�superr�rs�queue�output_lock�rrr��kwargs�r�rrrs�sz$MultiprocessRefactoringTool.__init__Frc
s�|dkrtt���|||�Szddl�Wntk
r@t�YnX�jdk	rTtd������_��	��_
��fdd�t|�D�}z*|D]}|��q�tt���|||�W5�j��t|�D]}�j�
d�q�|D]}|��r�|��q�d�_XdS)Nrrz already doing multiple processescsg|]}�j�jd��qS))�target)ZProcess�_child)r3r���multiprocessingrrrrr6�s�z8MultiprocessRefactoringTool.refactor.<locals>.<listcomp>)r�r�r�r��ImportErrorr�r��RuntimeErrorZ
JoinableQueueZLockr��ranger�putZis_alive�start)rrr�r�r�Z
num_processesZ	processesr�r$r�r�rr��s<
�



�
�

z$MultiprocessRefactoringTool.refactorcsN|j��}|dk	rJ|\}}ztt|�j||�W5|j��X|j��}q
dSr8)r�reZ	task_doner�r�r�)rrZtaskr�r�r�rrr��s

�z"MultiprocessRefactoringTool._childcs2|jdk	r|j�||f�ntt|�j||�SdSr8)r�r�r�r�r�r�r�rrr��s

�z)MultiprocessRefactoringTool.refactor_file)FFr)rrrrsr�r�r��
__classcell__rrr�rr��s�r�)T)#rX�
__author__rEr�rr�rgr�r&�	itertoolsrZpgen2rrrZ
fixer_utilrrvrr	r
rnrr"rrr0r7r:rVrW�objectrYr�r�rrrr�<module>s8
(	lib2to3/__pycache__/fixer_base.cpython-38.pyc000064400000014157151153537460015013 0ustar00U

e5d"�@sTdZddlZddlmZddlmZddlmZGdd�de�Z	Gd	d
�d
e	�Z
dS)z2Base class for fixers (optional, but recommended).�N�)�PatternCompiler)�pygram)�does_tree_importc@s�eZdZdZdZdZdZdZdZe	�
d�Ze�Z
dZdZdZdZdZdZejZdd�Zd	d
�Zdd�Zd
d�Zdd�Zddd�Zdd�Zddd�Zdd�Zdd�Z dd�Z!dS) �BaseFixaOptional base class for fixers.

    The subclass name must be FixFooBar where FooBar is the result of
    removing underscores and capitalizing the words of the fix name.
    For example, the class name for a fixer named 'has_key' should be
    FixHasKey.
    NrZpostF�cCs||_||_|��dS)aInitializer.  Subclass may override.

        Args:
            options: a dict containing the options passed to RefactoringTool
            that could be used to customize the fixer through the command line.
            log: a list to append warnings and other messages to.
        N)�options�log�compile_pattern)�selfrr	�r�*/usr/lib64/python3.8/lib2to3/fixer_base.py�__init__/szBaseFix.__init__cCs,|jdk	r(t�}|j|jdd�\|_|_dS)z�Compiles self.PATTERN into self.pattern.

        Subclass may override if it doesn't want to use
        self.{pattern,PATTERN} in .match().
        NT)Z	with_tree)�PATTERNrr
�pattern�pattern_tree)rZPCrrr
r
;s

�zBaseFix.compile_patterncCs
||_dS)zOSet the filename.

        The main refactoring tool should call this.
        N)�filename)rrrrr
�set_filenameFszBaseFix.set_filenamecCsd|i}|j�||�o|S)aReturns match for a given parse tree node.

        Should return a true or false object (not necessarily a bool).
        It may return a non-empty dict of matching sub-nodes as
        returned by a matching pattern.

        Subclass may override.
        �node)r�match�rrZresultsrrr
rMs	z
BaseFix.matchcCs
t��dS)a�Returns the transformation for a given parse tree node.

        Args:
          node: the root of the parse tree that matched the fixer.
          results: a dict mapping symbolic names to part of the match.

        Returns:
          None, or a node that is a modified copy of the
          argument node.  The node argument may also be modified in-place to
          effect the same change.

        Subclass *must* override.
        N)�NotImplementedErrorrrrr
�	transformYszBaseFix.transform�xxx_todo_changemecCs2|}||jkr"|tt|j��}q|j�|�|S)z�Return a string suitable for use as an identifier

        The new name is guaranteed not to conflict with other identifiers.
        )�
used_names�str�next�numbers�add)r�template�namerrr
�new_nameis

zBaseFix.new_namecCs.|jrd|_|j�d|j�|j�|�dS)NFz### In file %s ###)�	first_logr	�appendr)r�messagerrr
�log_messagetszBaseFix.log_messagecCs>|��}|��}d|_d}|�|||f�|r:|�|�dS)aWarn the user that a given chunk of code is not valid Python 3,
        but that it cannot be converted automatically.

        First argument is the top-level node for the code in question.
        Optional second argument is why it can't be converted.
        �zLine %d: could not convert: %sN)�
get_linenoZclone�prefixr%)rr�reason�linenoZ
for_output�msgrrr
�cannot_convertzszBaseFix.cannot_convertcCs|��}|�d||f�dS)z�Used for warning the user about possible uncertainty in the
        translation.

        First argument is the top-level node for the code in question.
        Optional second argument is why it can't be converted.
        zLine %d: %sN)r'r%)rrr)r*rrr
�warning�szBaseFix.warningcCs(|j|_|�|�t�d�|_d|_dS)z�Some fixers need to maintain tree-wide state.
        This method is called once, at the start of tree fix-up.

        tree - the root node of the tree to be processed.
        filename - the name of the file the tree came from.
        rTN)rr�	itertools�countrr"�rZtreerrrr
�
start_tree�s
zBaseFix.start_treecCsdS)z�Some fixers need to maintain tree-wide state.
        This method is called once, at the conclusion of tree fix-up.

        tree - the root node of the tree to be processed.
        filename - the name of the file the tree came from.
        Nrr0rrr
�finish_tree�szBaseFix.finish_tree)r)N)"�__name__�
__module__�__qualname__�__doc__rrrrrr.r/r�setr�orderZexplicitZ	run_orderZ_accept_typeZkeep_line_orderZ
BM_compatiblerZpython_symbolsZsymsrr
rrrr!r%r,r-r1r2rrrr
rs4



rcs,eZdZdZdZ�fdd�Zdd�Z�ZS)�ConditionalFixz@ Base class for fixers which not execute if an import is found. Ncstt|�j|�d|_dS)N)�superr9r1�_should_skip)r�args��	__class__rr
r1�szConditionalFix.start_treecCsJ|jdk	r|jS|j�d�}|d}d�|dd��}t|||�|_|jS)N�.���)r;�skip_on�split�joinr)rrZpkgr rrr
�should_skip�s
zConditionalFix.should_skip)r3r4r5r6rAr1rD�
__classcell__rrr=r
r9�sr9)r6r.Zpatcomprr&rZ
fixer_utilr�objectrr9rrrr
�<module>slib2to3/__pycache__/pygram.cpython-38.opt-1.pyc000064400000002356151153537460015140 0ustar00U

e5d�@s�dZddlZddlmZddlmZddlmZej�ej�	e
�d�Zej�ej�	e
�d�ZGd	d
�d
e
�Ze�de�Zee�Ze��Zejd=e��Zejd
=e�de�Zee�ZdS)z&Export the Python grammar and symbols.�N�)�token)�driver)�pytreezGrammar.txtzPatternGrammar.txtc@seZdZdd�ZdS)�SymbolscCs$|j��D]\}}t|||�q
dS)z�Initializer.

        Creates an attribute for each grammar symbol (nonterminal),
        whose value is the symbol's type (an int >= 256).
        N)Z
symbol2number�items�setattr)�selfZgrammar�nameZsymbol�r�&/usr/lib64/python3.8/lib2to3/pygram.py�__init__szSymbols.__init__N)�__name__�
__module__�__qualname__r
rrrrrsrZlib2to3�print�exec)�__doc__�osZpgen2rr�r�path�join�dirname�__file__Z
_GRAMMAR_FILEZ_PATTERN_GRAMMAR_FILE�objectrZload_packaged_grammarZpython_grammarZpython_symbols�copyZ!python_grammar_no_print_statement�keywordsZ*python_grammar_no_print_and_exec_statementZpattern_grammarZpattern_symbolsrrrr�<module>s"�lib2to3/pygram.py000064400000002431151153537460007705 0ustar00# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Export the Python grammar and symbols."""

# Python imports
import os

# Local imports
from .pgen2 import token
from .pgen2 import driver
from . import pytree

# The grammar file
_GRAMMAR_FILE = os.path.join(os.path.dirname(__file__), "Grammar.txt")
_PATTERN_GRAMMAR_FILE = os.path.join(os.path.dirname(__file__),
                                     "PatternGrammar.txt")


class Symbols(object):

    def __init__(self, grammar):
        """Initializer.

        Creates an attribute for each grammar symbol (nonterminal),
        whose value is the symbol's type (an int >= 256).
        """
        for name, symbol in grammar.symbol2number.items():
            setattr(self, name, symbol)


python_grammar = driver.load_packaged_grammar("lib2to3", _GRAMMAR_FILE)

python_symbols = Symbols(python_grammar)

python_grammar_no_print_statement = python_grammar.copy()
del python_grammar_no_print_statement.keywords["print"]

python_grammar_no_print_and_exec_statement = python_grammar_no_print_statement.copy()
del python_grammar_no_print_and_exec_statement.keywords["exec"]

pattern_grammar = driver.load_packaged_grammar("lib2to3", _PATTERN_GRAMMAR_FILE)
pattern_symbols = Symbols(pattern_grammar)
lib2to3/pytree.py000064400000066470151153537460007733 0ustar00# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""
Python parse tree definitions.

This is a very concrete parse tree; we need to keep every token and
even the comments and whitespace between tokens.

There's also a pattern matching implementation here.
"""

__author__ = "Guido van Rossum <guido@python.org>"

import sys
from io import StringIO

HUGE = 0x7FFFFFFF  # maximum repeat count, default max

_type_reprs = {}
def type_repr(type_num):
    global _type_reprs
    if not _type_reprs:
        from .pygram import python_symbols
        # printing tokens is possible but not as useful
        # from .pgen2 import token // token.__dict__.items():
        for name, val in python_symbols.__dict__.items():
            if type(val) == int: _type_reprs[val] = name
    return _type_reprs.setdefault(type_num, type_num)

class Base(object):

    """
    Abstract base class for Node and Leaf.

    This provides some default functionality and boilerplate using the
    template pattern.

    A node may be a subnode of at most one parent.
    """

    # Default values for instance variables
    type = None    # int: token number (< 256) or symbol number (>= 256)
    parent = None  # Parent node pointer, or None
    children = ()  # Tuple of subnodes
    was_changed = False
    was_checked = False

    def __new__(cls, *args, **kwds):
        """Constructor that prevents Base from being instantiated."""
        assert cls is not Base, "Cannot instantiate Base"
        return object.__new__(cls)

    def __eq__(self, other):
        """
        Compare two nodes for equality.

        This calls the method _eq().
        """
        if self.__class__ is not other.__class__:
            return NotImplemented
        return self._eq(other)

    __hash__ = None # For Py3 compatibility.

    def _eq(self, other):
        """
        Compare two nodes for equality.

        This is called by __eq__ and __ne__.  It is only called if the two nodes
        have the same type.  This must be implemented by the concrete subclass.
        Nodes should be considered equal if they have the same structure,
        ignoring the prefix string and other context information.
        """
        raise NotImplementedError

    def clone(self):
        """
        Return a cloned (deep) copy of self.

        This must be implemented by the concrete subclass.
        """
        raise NotImplementedError

    def post_order(self):
        """
        Return a post-order iterator for the tree.

        This must be implemented by the concrete subclass.
        """
        raise NotImplementedError

    def pre_order(self):
        """
        Return a pre-order iterator for the tree.

        This must be implemented by the concrete subclass.
        """
        raise NotImplementedError

    def replace(self, new):
        """Replace this node with a new one in the parent."""
        assert self.parent is not None, str(self)
        assert new is not None
        if not isinstance(new, list):
            new = [new]
        l_children = []
        found = False
        for ch in self.parent.children:
            if ch is self:
                assert not found, (self.parent.children, self, new)
                if new is not None:
                    l_children.extend(new)
                found = True
            else:
                l_children.append(ch)
        assert found, (self.children, self, new)
        self.parent.changed()
        self.parent.children = l_children
        for x in new:
            x.parent = self.parent
        self.parent = None

    def get_lineno(self):
        """Return the line number which generated the invocant node."""
        node = self
        while not isinstance(node, Leaf):
            if not node.children:
                return
            node = node.children[0]
        return node.lineno

    def changed(self):
        if self.parent:
            self.parent.changed()
        self.was_changed = True

    def remove(self):
        """
        Remove the node from the tree. Returns the position of the node in its
        parent's children before it was removed.
        """
        if self.parent:
            for i, node in enumerate(self.parent.children):
                if node is self:
                    self.parent.changed()
                    del self.parent.children[i]
                    self.parent = None
                    return i

    @property
    def next_sibling(self):
        """
        The node immediately following the invocant in their parent's children
        list. If the invocant does not have a next sibling, it is None
        """
        if self.parent is None:
            return None

        # Can't use index(); we need to test by identity
        for i, child in enumerate(self.parent.children):
            if child is self:
                try:
                    return self.parent.children[i+1]
                except IndexError:
                    return None

    @property
    def prev_sibling(self):
        """
        The node immediately preceding the invocant in their parent's children
        list. If the invocant does not have a previous sibling, it is None.
        """
        if self.parent is None:
            return None

        # Can't use index(); we need to test by identity
        for i, child in enumerate(self.parent.children):
            if child is self:
                if i == 0:
                    return None
                return self.parent.children[i-1]

    def leaves(self):
        for child in self.children:
            yield from child.leaves()

    def depth(self):
        if self.parent is None:
            return 0
        return 1 + self.parent.depth()

    def get_suffix(self):
        """
        Return the string immediately following the invocant node. This is
        effectively equivalent to node.next_sibling.prefix
        """
        next_sib = self.next_sibling
        if next_sib is None:
            return ""
        return next_sib.prefix

    if sys.version_info < (3, 0):
        def __str__(self):
            return str(self).encode("ascii")

class Node(Base):

    """Concrete implementation for interior nodes."""

    def __init__(self,type, children,
                 context=None,
                 prefix=None,
                 fixers_applied=None):
        """
        Initializer.

        Takes a type constant (a symbol number >= 256), a sequence of
        child nodes, and an optional context keyword argument.

        As a side effect, the parent pointers of the children are updated.
        """
        assert type >= 256, type
        self.type = type
        self.children = list(children)
        for ch in self.children:
            assert ch.parent is None, repr(ch)
            ch.parent = self
        if prefix is not None:
            self.prefix = prefix
        if fixers_applied:
            self.fixers_applied = fixers_applied[:]
        else:
            self.fixers_applied = None

    def __repr__(self):
        """Return a canonical string representation."""
        return "%s(%s, %r)" % (self.__class__.__name__,
                               type_repr(self.type),
                               self.children)

    def __unicode__(self):
        """
        Return a pretty string representation.

        This reproduces the input source exactly.
        """
        return "".join(map(str, self.children))

    if sys.version_info > (3, 0):
        __str__ = __unicode__

    def _eq(self, other):
        """Compare two nodes for equality."""
        return (self.type, self.children) == (other.type, other.children)

    def clone(self):
        """Return a cloned (deep) copy of self."""
        return Node(self.type, [ch.clone() for ch in self.children],
                    fixers_applied=self.fixers_applied)

    def post_order(self):
        """Return a post-order iterator for the tree."""
        for child in self.children:
            yield from child.post_order()
        yield self

    def pre_order(self):
        """Return a pre-order iterator for the tree."""
        yield self
        for child in self.children:
            yield from child.pre_order()

    @property
    def prefix(self):
        """
        The whitespace and comments preceding this node in the input.
        """
        if not self.children:
            return ""
        return self.children[0].prefix

    @prefix.setter
    def prefix(self, prefix):
        if self.children:
            self.children[0].prefix = prefix

    def set_child(self, i, child):
        """
        Equivalent to 'node.children[i] = child'. This method also sets the
        child's parent attribute appropriately.
        """
        child.parent = self
        self.children[i].parent = None
        self.children[i] = child
        self.changed()

    def insert_child(self, i, child):
        """
        Equivalent to 'node.children.insert(i, child)'. This method also sets
        the child's parent attribute appropriately.
        """
        child.parent = self
        self.children.insert(i, child)
        self.changed()

    def append_child(self, child):
        """
        Equivalent to 'node.children.append(child)'. This method also sets the
        child's parent attribute appropriately.
        """
        child.parent = self
        self.children.append(child)
        self.changed()


class Leaf(Base):

    """Concrete implementation for leaf nodes."""

    # Default values for instance variables
    _prefix = ""  # Whitespace and comments preceding this token in the input
    lineno = 0    # Line where this token starts in the input
    column = 0    # Column where this token tarts in the input

    def __init__(self, type, value,
                 context=None,
                 prefix=None,
                 fixers_applied=[]):
        """
        Initializer.

        Takes a type constant (a token number < 256), a string value, and an
        optional context keyword argument.
        """
        assert 0 <= type < 256, type
        if context is not None:
            self._prefix, (self.lineno, self.column) = context
        self.type = type
        self.value = value
        if prefix is not None:
            self._prefix = prefix
        self.fixers_applied = fixers_applied[:]

    def __repr__(self):
        """Return a canonical string representation."""
        return "%s(%r, %r)" % (self.__class__.__name__,
                               self.type,
                               self.value)

    def __unicode__(self):
        """
        Return a pretty string representation.

        This reproduces the input source exactly.
        """
        return self.prefix + str(self.value)

    if sys.version_info > (3, 0):
        __str__ = __unicode__

    def _eq(self, other):
        """Compare two nodes for equality."""
        return (self.type, self.value) == (other.type, other.value)

    def clone(self):
        """Return a cloned (deep) copy of self."""
        return Leaf(self.type, self.value,
                    (self.prefix, (self.lineno, self.column)),
                    fixers_applied=self.fixers_applied)

    def leaves(self):
        yield self

    def post_order(self):
        """Return a post-order iterator for the tree."""
        yield self

    def pre_order(self):
        """Return a pre-order iterator for the tree."""
        yield self

    @property
    def prefix(self):
        """
        The whitespace and comments preceding this token in the input.
        """
        return self._prefix

    @prefix.setter
    def prefix(self, prefix):
        self.changed()
        self._prefix = prefix

def convert(gr, raw_node):
    """
    Convert raw node information to a Node or Leaf instance.

    This is passed to the parser driver which calls it whenever a reduction of a
    grammar rule produces a new complete node, so that the tree is build
    strictly bottom-up.
    """
    type, value, context, children = raw_node
    if children or type in gr.number2symbol:
        # If there's exactly one child, return that child instead of
        # creating a new node.
        if len(children) == 1:
            return children[0]
        return Node(type, children, context=context)
    else:
        return Leaf(type, value, context=context)


class BasePattern(object):

    """
    A pattern is a tree matching pattern.

    It looks for a specific node type (token or symbol), and
    optionally for a specific content.

    This is an abstract base class.  There are three concrete
    subclasses:

    - LeafPattern matches a single leaf node;
    - NodePattern matches a single node (usually non-leaf);
    - WildcardPattern matches a sequence of nodes of variable length.
    """

    # Defaults for instance variables
    type = None     # Node type (token if < 256, symbol if >= 256)
    content = None  # Optional content matching pattern
    name = None     # Optional name used to store match in results dict

    def __new__(cls, *args, **kwds):
        """Constructor that prevents BasePattern from being instantiated."""
        assert cls is not BasePattern, "Cannot instantiate BasePattern"
        return object.__new__(cls)

    def __repr__(self):
        args = [type_repr(self.type), self.content, self.name]
        while args and args[-1] is None:
            del args[-1]
        return "%s(%s)" % (self.__class__.__name__, ", ".join(map(repr, args)))

    def optimize(self):
        """
        A subclass can define this as a hook for optimizations.

        Returns either self or another node with the same effect.
        """
        return self

    def match(self, node, results=None):
        """
        Does this pattern exactly match a node?

        Returns True if it matches, False if not.

        If results is not None, it must be a dict which will be
        updated with the nodes matching named subpatterns.

        Default implementation for non-wildcard patterns.
        """
        if self.type is not None and node.type != self.type:
            return False
        if self.content is not None:
            r = None
            if results is not None:
                r = {}
            if not self._submatch(node, r):
                return False
            if r:
                results.update(r)
        if results is not None and self.name:
            results[self.name] = node
        return True

    def match_seq(self, nodes, results=None):
        """
        Does this pattern exactly match a sequence of nodes?

        Default implementation for non-wildcard patterns.
        """
        if len(nodes) != 1:
            return False
        return self.match(nodes[0], results)

    def generate_matches(self, nodes):
        """
        Generator yielding all matches for this pattern.

        Default implementation for non-wildcard patterns.
        """
        r = {}
        if nodes and self.match(nodes[0], r):
            yield 1, r


class LeafPattern(BasePattern):

    def __init__(self, type=None, content=None, name=None):
        """
        Initializer.  Takes optional type, content, and name.

        The type, if given must be a token type (< 256).  If not given,
        this matches any *leaf* node; the content may still be required.

        The content, if given, must be a string.

        If a name is given, the matching node is stored in the results
        dict under that key.
        """
        if type is not None:
            assert 0 <= type < 256, type
        if content is not None:
            assert isinstance(content, str), repr(content)
        self.type = type
        self.content = content
        self.name = name

    def match(self, node, results=None):
        """Override match() to insist on a leaf node."""
        if not isinstance(node, Leaf):
            return False
        return BasePattern.match(self, node, results)

    def _submatch(self, node, results=None):
        """
        Match the pattern's content to the node's children.

        This assumes the node type matches and self.content is not None.

        Returns True if it matches, False if not.

        If results is not None, it must be a dict which will be
        updated with the nodes matching named subpatterns.

        When returning False, the results dict may still be updated.
        """
        return self.content == node.value


class NodePattern(BasePattern):

    wildcards = False

    def __init__(self, type=None, content=None, name=None):
        """
        Initializer.  Takes optional type, content, and name.

        The type, if given, must be a symbol type (>= 256).  If the
        type is None this matches *any* single node (leaf or not),
        except if content is not None, in which it only matches
        non-leaf nodes that also match the content pattern.

        The content, if not None, must be a sequence of Patterns that
        must match the node's children exactly.  If the content is
        given, the type must not be None.

        If a name is given, the matching node is stored in the results
        dict under that key.
        """
        if type is not None:
            assert type >= 256, type
        if content is not None:
            assert not isinstance(content, str), repr(content)
            content = list(content)
            for i, item in enumerate(content):
                assert isinstance(item, BasePattern), (i, item)
                if isinstance(item, WildcardPattern):
                    self.wildcards = True
        self.type = type
        self.content = content
        self.name = name

    def _submatch(self, node, results=None):
        """
        Match the pattern's content to the node's children.

        This assumes the node type matches and self.content is not None.

        Returns True if it matches, False if not.

        If results is not None, it must be a dict which will be
        updated with the nodes matching named subpatterns.

        When returning False, the results dict may still be updated.
        """
        if self.wildcards:
            for c, r in generate_matches(self.content, node.children):
                if c == len(node.children):
                    if results is not None:
                        results.update(r)
                    return True
            return False
        if len(self.content) != len(node.children):
            return False
        for subpattern, child in zip(self.content, node.children):
            if not subpattern.match(child, results):
                return False
        return True


class WildcardPattern(BasePattern):

    """
    A wildcard pattern can match zero or more nodes.

    This has all the flexibility needed to implement patterns like:

    .*      .+      .?      .{m,n}
    (a b c | d e | f)
    (...)*  (...)+  (...)?  (...){m,n}

    except it always uses non-greedy matching.
    """

    def __init__(self, content=None, min=0, max=HUGE, name=None):
        """
        Initializer.

        Args:
            content: optional sequence of subsequences of patterns;
                     if absent, matches one node;
                     if present, each subsequence is an alternative [*]
            min: optional minimum number of times to match, default 0
            max: optional maximum number of times to match, default HUGE
            name: optional name assigned to this match

        [*] Thus, if content is [[a, b, c], [d, e], [f, g, h]] this is
            equivalent to (a b c | d e | f g h); if content is None,
            this is equivalent to '.' in regular expression terms.
            The min and max parameters work as follows:
                min=0, max=maxint: .*
                min=1, max=maxint: .+
                min=0, max=1: .?
                min=1, max=1: .
            If content is not None, replace the dot with the parenthesized
            list of alternatives, e.g. (a b c | d e | f g h)*
        """
        assert 0 <= min <= max <= HUGE, (min, max)
        if content is not None:
            content = tuple(map(tuple, content))  # Protect against alterations
            # Check sanity of alternatives
            assert len(content), repr(content)  # Can't have zero alternatives
            for alt in content:
                assert len(alt), repr(alt) # Can have empty alternatives
        self.content = content
        self.min = min
        self.max = max
        self.name = name

    def optimize(self):
        """Optimize certain stacked wildcard patterns."""
        subpattern = None
        if (self.content is not None and
            len(self.content) == 1 and len(self.content[0]) == 1):
            subpattern = self.content[0][0]
        if self.min == 1 and self.max == 1:
            if self.content is None:
                return NodePattern(name=self.name)
            if subpattern is not None and  self.name == subpattern.name:
                return subpattern.optimize()
        if (self.min <= 1 and isinstance(subpattern, WildcardPattern) and
            subpattern.min <= 1 and self.name == subpattern.name):
            return WildcardPattern(subpattern.content,
                                   self.min*subpattern.min,
                                   self.max*subpattern.max,
                                   subpattern.name)
        return self

    def match(self, node, results=None):
        """Does this pattern exactly match a node?"""
        return self.match_seq([node], results)

    def match_seq(self, nodes, results=None):
        """Does this pattern exactly match a sequence of nodes?"""
        for c, r in self.generate_matches(nodes):
            if c == len(nodes):
                if results is not None:
                    results.update(r)
                    if self.name:
                        results[self.name] = list(nodes)
                return True
        return False

    def generate_matches(self, nodes):
        """
        Generator yielding matches for a sequence of nodes.

        Args:
            nodes: sequence of nodes

        Yields:
            (count, results) tuples where:
            count: the match comprises nodes[:count];
            results: dict containing named submatches.
        """
        if self.content is None:
            # Shortcut for special case (see __init__.__doc__)
            for count in range(self.min, 1 + min(len(nodes), self.max)):
                r = {}
                if self.name:
                    r[self.name] = nodes[:count]
                yield count, r
        elif self.name == "bare_name":
            yield self._bare_name_matches(nodes)
        else:
            # The reason for this is that hitting the recursion limit usually
            # results in some ugly messages about how RuntimeErrors are being
            # ignored. We only have to do this on CPython, though, because other
            # implementations don't have this nasty bug in the first place.
            if hasattr(sys, "getrefcount"):
                save_stderr = sys.stderr
                sys.stderr = StringIO()
            try:
                for count, r in self._recursive_matches(nodes, 0):
                    if self.name:
                        r[self.name] = nodes[:count]
                    yield count, r
            except RuntimeError:
                # We fall back to the iterative pattern matching scheme if the recursive
                # scheme hits the recursion limit.
                for count, r in self._iterative_matches(nodes):
                    if self.name:
                        r[self.name] = nodes[:count]
                    yield count, r
            finally:
                if hasattr(sys, "getrefcount"):
                    sys.stderr = save_stderr

    def _iterative_matches(self, nodes):
        """Helper to iteratively yield the matches."""
        nodelen = len(nodes)
        if 0 >= self.min:
            yield 0, {}

        results = []
        # generate matches that use just one alt from self.content
        for alt in self.content:
            for c, r in generate_matches(alt, nodes):
                yield c, r
                results.append((c, r))

        # for each match, iterate down the nodes
        while results:
            new_results = []
            for c0, r0 in results:
                # stop if the entire set of nodes has been matched
                if c0 < nodelen and c0 <= self.max:
                    for alt in self.content:
                        for c1, r1 in generate_matches(alt, nodes[c0:]):
                            if c1 > 0:
                                r = {}
                                r.update(r0)
                                r.update(r1)
                                yield c0 + c1, r
                                new_results.append((c0 + c1, r))
            results = new_results

    def _bare_name_matches(self, nodes):
        """Special optimized matcher for bare_name."""
        count = 0
        r = {}
        done = False
        max = len(nodes)
        while not done and count < max:
            done = True
            for leaf in self.content:
                if leaf[0].match(nodes[count], r):
                    count += 1
                    done = False
                    break
        r[self.name] = nodes[:count]
        return count, r

    def _recursive_matches(self, nodes, count):
        """Helper to recursively yield the matches."""
        assert self.content is not None
        if count >= self.min:
            yield 0, {}
        if count < self.max:
            for alt in self.content:
                for c0, r0 in generate_matches(alt, nodes):
                    for c1, r1 in self._recursive_matches(nodes[c0:], count+1):
                        r = {}
                        r.update(r0)
                        r.update(r1)
                        yield c0 + c1, r


class NegatedPattern(BasePattern):

    def __init__(self, content=None):
        """
        Initializer.

        The argument is either a pattern or None.  If it is None, this
        only matches an empty sequence (effectively '$' in regex
        lingo).  If it is not None, this matches whenever the argument
        pattern doesn't have any matches.
        """
        if content is not None:
            assert isinstance(content, BasePattern), repr(content)
        self.content = content

    def match(self, node):
        # We never match a node in its entirety
        return False

    def match_seq(self, nodes):
        # We only match an empty sequence of nodes in its entirety
        return len(nodes) == 0

    def generate_matches(self, nodes):
        if self.content is None:
            # Return a match if there is an empty sequence
            if len(nodes) == 0:
                yield 0, {}
        else:
            # Return a match if the argument pattern has no matches
            for c, r in self.content.generate_matches(nodes):
                return
            yield 0, {}


def generate_matches(patterns, nodes):
    """
    Generator yielding matches for a sequence of patterns and nodes.

    Args:
        patterns: a sequence of patterns
        nodes: a sequence of nodes

    Yields:
        (count, results) tuples where:
        count: the entire sequence of patterns matches nodes[:count];
        results: dict containing named submatches.
        """
    if not patterns:
        yield 0, {}
    else:
        p, rest = patterns[0], patterns[1:]
        for c0, r0 in p.generate_matches(nodes):
            if not rest:
                yield c0, r0
            else:
                for c1, r1 in generate_matches(rest, nodes[c0:]):
                    r = {}
                    r.update(r0)
                    r.update(r1)
                    yield c0 + c1, r
lib2to3/fixer_base.py000064400000015042151153537460010517 0ustar00# Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Base class for fixers (optional, but recommended)."""

# Python imports
import itertools

# Local imports
from .patcomp import PatternCompiler
from . import pygram
from .fixer_util import does_tree_import

class BaseFix(object):

    """Optional base class for fixers.

    The subclass name must be FixFooBar where FooBar is the result of
    removing underscores and capitalizing the words of the fix name.
    For example, the class name for a fixer named 'has_key' should be
    FixHasKey.
    """

    PATTERN = None  # Most subclasses should override with a string literal
    pattern = None  # Compiled pattern, set by compile_pattern()
    pattern_tree = None # Tree representation of the pattern
    options = None  # Options object passed to initializer
    filename = None # The filename (set by set_filename)
    numbers = itertools.count(1) # For new_name()
    used_names = set() # A set of all used NAMEs
    order = "post" # Does the fixer prefer pre- or post-order traversal
    explicit = False # Is this ignored by refactor.py -f all?
    run_order = 5   # Fixers will be sorted by run order before execution
                    # Lower numbers will be run first.
    _accept_type = None # [Advanced and not public] This tells RefactoringTool
                        # which node type to accept when there's not a pattern.

    keep_line_order = False # For the bottom matcher: match with the
                            # original line order
    BM_compatible = False # Compatibility with the bottom matching
                          # module; every fixer should set this
                          # manually

    # Shortcut for access to Python grammar symbols
    syms = pygram.python_symbols

    def __init__(self, options, log):
        """Initializer.  Subclass may override.

        Args:
            options: a dict containing the options passed to RefactoringTool
            that could be used to customize the fixer through the command line.
            log: a list to append warnings and other messages to.
        """
        self.options = options
        self.log = log
        self.compile_pattern()

    def compile_pattern(self):
        """Compiles self.PATTERN into self.pattern.

        Subclass may override if it doesn't want to use
        self.{pattern,PATTERN} in .match().
        """
        if self.PATTERN is not None:
            PC = PatternCompiler()
            self.pattern, self.pattern_tree = PC.compile_pattern(self.PATTERN,
                                                                 with_tree=True)

    def set_filename(self, filename):
        """Set the filename.

        The main refactoring tool should call this.
        """
        self.filename = filename

    def match(self, node):
        """Returns match for a given parse tree node.

        Should return a true or false object (not necessarily a bool).
        It may return a non-empty dict of matching sub-nodes as
        returned by a matching pattern.

        Subclass may override.
        """
        results = {"node": node}
        return self.pattern.match(node, results) and results

    def transform(self, node, results):
        """Returns the transformation for a given parse tree node.

        Args:
          node: the root of the parse tree that matched the fixer.
          results: a dict mapping symbolic names to part of the match.

        Returns:
          None, or a node that is a modified copy of the
          argument node.  The node argument may also be modified in-place to
          effect the same change.

        Subclass *must* override.
        """
        raise NotImplementedError()

    def new_name(self, template="xxx_todo_changeme"):
        """Return a string suitable for use as an identifier

        The new name is guaranteed not to conflict with other identifiers.
        """
        name = template
        while name in self.used_names:
            name = template + str(next(self.numbers))
        self.used_names.add(name)
        return name

    def log_message(self, message):
        if self.first_log:
            self.first_log = False
            self.log.append("### In file %s ###" % self.filename)
        self.log.append(message)

    def cannot_convert(self, node, reason=None):
        """Warn the user that a given chunk of code is not valid Python 3,
        but that it cannot be converted automatically.

        First argument is the top-level node for the code in question.
        Optional second argument is why it can't be converted.
        """
        lineno = node.get_lineno()
        for_output = node.clone()
        for_output.prefix = ""
        msg = "Line %d: could not convert: %s"
        self.log_message(msg % (lineno, for_output))
        if reason:
            self.log_message(reason)

    def warning(self, node, reason):
        """Used for warning the user about possible uncertainty in the
        translation.

        First argument is the top-level node for the code in question.
        Optional second argument is why it can't be converted.
        """
        lineno = node.get_lineno()
        self.log_message("Line %d: %s" % (lineno, reason))

    def start_tree(self, tree, filename):
        """Some fixers need to maintain tree-wide state.
        This method is called once, at the start of tree fix-up.

        tree - the root node of the tree to be processed.
        filename - the name of the file the tree came from.
        """
        self.used_names = tree.used_names
        self.set_filename(filename)
        self.numbers = itertools.count(1)
        self.first_log = True

    def finish_tree(self, tree, filename):
        """Some fixers need to maintain tree-wide state.
        This method is called once, at the conclusion of tree fix-up.

        tree - the root node of the tree to be processed.
        filename - the name of the file the tree came from.
        """
        pass


class ConditionalFix(BaseFix):
    """ Base class for fixers which not execute if an import is found. """

    # This is the name of the import which, if found, will cause the test to be skipped
    skip_on = None

    def start_tree(self, *args):
        super(ConditionalFix, self).start_tree(*args)
        self._should_skip = None

    def should_skip(self, node):
        if self._should_skip is not None:
            return self._should_skip
        pkg = self.skip_on.split(".")
        name = pkg[-1]
        pkg = ".".join(pkg[:-1])
        self._should_skip = does_tree_import(pkg, name, node)
        return self._should_skip
collections/__init__.py000064400000135503151153537460011214 0ustar00'''This module implements specialized container datatypes providing
alternatives to Python's general purpose built-in containers, dict,
list, set, and tuple.

* namedtuple   factory function for creating tuple subclasses with named fields
* deque        list-like container with fast appends and pops on either end
* ChainMap     dict-like class for creating a single view of multiple mappings
* Counter      dict subclass for counting hashable objects
* OrderedDict  dict subclass that remembers the order entries were added
* defaultdict  dict subclass that calls a factory function to supply missing values
* UserDict     wrapper around dictionary objects for easier dict subclassing
* UserList     wrapper around list objects for easier list subclassing
* UserString   wrapper around string objects for easier string subclassing

'''

__all__ = ['deque', 'defaultdict', 'namedtuple', 'UserDict', 'UserList',
            'UserString', 'Counter', 'OrderedDict', 'ChainMap']

import _collections_abc
from operator import itemgetter as _itemgetter, eq as _eq
from keyword import iskeyword as _iskeyword
import sys as _sys
import heapq as _heapq
from _weakref import proxy as _proxy
from itertools import repeat as _repeat, chain as _chain, starmap as _starmap
from reprlib import recursive_repr as _recursive_repr

try:
    from _collections import deque
except ImportError:
    pass
else:
    _collections_abc.MutableSequence.register(deque)

try:
    from _collections import defaultdict
except ImportError:
    pass


def __getattr__(name):
    # For backwards compatibility, continue to make the collections ABCs
    # through Python 3.6 available through the collections module.
    # Note, no new collections ABCs were added in Python 3.7
    if name in _collections_abc.__all__:
        obj = getattr(_collections_abc, name)
        import warnings
        warnings.warn("Using or importing the ABCs from 'collections' instead "
                      "of from 'collections.abc' is deprecated since Python 3.3, "
                      "and in 3.10 it will stop working",
                      DeprecationWarning, stacklevel=2)
        globals()[name] = obj
        return obj
    raise AttributeError(f'module {__name__!r} has no attribute {name!r}')

################################################################################
### OrderedDict
################################################################################

class _OrderedDictKeysView(_collections_abc.KeysView):

    def __reversed__(self):
        yield from reversed(self._mapping)

class _OrderedDictItemsView(_collections_abc.ItemsView):

    def __reversed__(self):
        for key in reversed(self._mapping):
            yield (key, self._mapping[key])

class _OrderedDictValuesView(_collections_abc.ValuesView):

    def __reversed__(self):
        for key in reversed(self._mapping):
            yield self._mapping[key]

class _Link(object):
    __slots__ = 'prev', 'next', 'key', '__weakref__'

class OrderedDict(dict):
    'Dictionary that remembers insertion order'
    # An inherited dict maps keys to values.
    # The inherited dict provides __getitem__, __len__, __contains__, and get.
    # The remaining methods are order-aware.
    # Big-O running times for all methods are the same as regular dictionaries.

    # The internal self.__map dict maps keys to links in a doubly linked list.
    # The circular doubly linked list starts and ends with a sentinel element.
    # The sentinel element never gets deleted (this simplifies the algorithm).
    # The sentinel is in self.__hardroot with a weakref proxy in self.__root.
    # The prev links are weakref proxies (to prevent circular references).
    # Individual links are kept alive by the hard reference in self.__map.
    # Those hard references disappear when a key is deleted from an OrderedDict.

    def __init__(self, other=(), /, **kwds):
        '''Initialize an ordered dictionary.  The signature is the same as
        regular dictionaries.  Keyword argument order is preserved.
        '''
        try:
            self.__root
        except AttributeError:
            self.__hardroot = _Link()
            self.__root = root = _proxy(self.__hardroot)
            root.prev = root.next = root
            self.__map = {}
        self.__update(other, **kwds)

    def __setitem__(self, key, value,
                    dict_setitem=dict.__setitem__, proxy=_proxy, Link=_Link):
        'od.__setitem__(i, y) <==> od[i]=y'
        # Setting a new item creates a new link at the end of the linked list,
        # and the inherited dictionary is updated with the new key/value pair.
        if key not in self:
            self.__map[key] = link = Link()
            root = self.__root
            last = root.prev
            link.prev, link.next, link.key = last, root, key
            last.next = link
            root.prev = proxy(link)
        dict_setitem(self, key, value)

    def __delitem__(self, key, dict_delitem=dict.__delitem__):
        'od.__delitem__(y) <==> del od[y]'
        # Deleting an existing item uses self.__map to find the link which gets
        # removed by updating the links in the predecessor and successor nodes.
        dict_delitem(self, key)
        link = self.__map.pop(key)
        link_prev = link.prev
        link_next = link.next
        link_prev.next = link_next
        link_next.prev = link_prev
        link.prev = None
        link.next = None

    def __iter__(self):
        'od.__iter__() <==> iter(od)'
        # Traverse the linked list in order.
        root = self.__root
        curr = root.next
        while curr is not root:
            yield curr.key
            curr = curr.next

    def __reversed__(self):
        'od.__reversed__() <==> reversed(od)'
        # Traverse the linked list in reverse order.
        root = self.__root
        curr = root.prev
        while curr is not root:
            yield curr.key
            curr = curr.prev

    def clear(self):
        'od.clear() -> None.  Remove all items from od.'
        root = self.__root
        root.prev = root.next = root
        self.__map.clear()
        dict.clear(self)

    def popitem(self, last=True):
        '''Remove and return a (key, value) pair from the dictionary.

        Pairs are returned in LIFO order if last is true or FIFO order if false.
        '''
        if not self:
            raise KeyError('dictionary is empty')
        root = self.__root
        if last:
            link = root.prev
            link_prev = link.prev
            link_prev.next = root
            root.prev = link_prev
        else:
            link = root.next
            link_next = link.next
            root.next = link_next
            link_next.prev = root
        key = link.key
        del self.__map[key]
        value = dict.pop(self, key)
        return key, value

    def move_to_end(self, key, last=True):
        '''Move an existing element to the end (or beginning if last is false).

        Raise KeyError if the element does not exist.
        '''
        link = self.__map[key]
        link_prev = link.prev
        link_next = link.next
        soft_link = link_next.prev
        link_prev.next = link_next
        link_next.prev = link_prev
        root = self.__root
        if last:
            last = root.prev
            link.prev = last
            link.next = root
            root.prev = soft_link
            last.next = link
        else:
            first = root.next
            link.prev = root
            link.next = first
            first.prev = soft_link
            root.next = link

    def __sizeof__(self):
        sizeof = _sys.getsizeof
        n = len(self) + 1                       # number of links including root
        size = sizeof(self.__dict__)            # instance dictionary
        size += sizeof(self.__map) * 2          # internal dict and inherited dict
        size += sizeof(self.__hardroot) * n     # link objects
        size += sizeof(self.__root) * n         # proxy objects
        return size

    update = __update = _collections_abc.MutableMapping.update

    def keys(self):
        "D.keys() -> a set-like object providing a view on D's keys"
        return _OrderedDictKeysView(self)

    def items(self):
        "D.items() -> a set-like object providing a view on D's items"
        return _OrderedDictItemsView(self)

    def values(self):
        "D.values() -> an object providing a view on D's values"
        return _OrderedDictValuesView(self)

    __ne__ = _collections_abc.MutableMapping.__ne__

    __marker = object()

    def pop(self, key, default=__marker):
        '''od.pop(k[,d]) -> v, remove specified key and return the corresponding
        value.  If key is not found, d is returned if given, otherwise KeyError
        is raised.

        '''
        if key in self:
            result = self[key]
            del self[key]
            return result
        if default is self.__marker:
            raise KeyError(key)
        return default

    def setdefault(self, key, default=None):
        '''Insert key with a value of default if key is not in the dictionary.

        Return the value for key if key is in the dictionary, else default.
        '''
        if key in self:
            return self[key]
        self[key] = default
        return default

    @_recursive_repr()
    def __repr__(self):
        'od.__repr__() <==> repr(od)'
        if not self:
            return '%s()' % (self.__class__.__name__,)
        return '%s(%r)' % (self.__class__.__name__, list(self.items()))

    def __reduce__(self):
        'Return state information for pickling'
        inst_dict = vars(self).copy()
        for k in vars(OrderedDict()):
            inst_dict.pop(k, None)
        return self.__class__, (), inst_dict or None, None, iter(self.items())

    def copy(self):
        'od.copy() -> a shallow copy of od'
        return self.__class__(self)

    @classmethod
    def fromkeys(cls, iterable, value=None):
        '''Create a new ordered dictionary with keys from iterable and values set to value.
        '''
        self = cls()
        for key in iterable:
            self[key] = value
        return self

    def __eq__(self, other):
        '''od.__eq__(y) <==> od==y.  Comparison to another OD is order-sensitive
        while comparison to a regular mapping is order-insensitive.

        '''
        if isinstance(other, OrderedDict):
            return dict.__eq__(self, other) and all(map(_eq, self, other))
        return dict.__eq__(self, other)


try:
    from _collections import OrderedDict
except ImportError:
    # Leave the pure Python version in place.
    pass


################################################################################
### namedtuple
################################################################################

try:
    from _collections import _tuplegetter
except ImportError:
    _tuplegetter = lambda index, doc: property(_itemgetter(index), doc=doc)

def namedtuple(typename, field_names, *, rename=False, defaults=None, module=None):
    """Returns a new subclass of tuple with named fields.

    >>> Point = namedtuple('Point', ['x', 'y'])
    >>> Point.__doc__                   # docstring for the new class
    'Point(x, y)'
    >>> p = Point(11, y=22)             # instantiate with positional args or keywords
    >>> p[0] + p[1]                     # indexable like a plain tuple
    33
    >>> x, y = p                        # unpack like a regular tuple
    >>> x, y
    (11, 22)
    >>> p.x + p.y                       # fields also accessible by name
    33
    >>> d = p._asdict()                 # convert to a dictionary
    >>> d['x']
    11
    >>> Point(**d)                      # convert from a dictionary
    Point(x=11, y=22)
    >>> p._replace(x=100)               # _replace() is like str.replace() but targets named fields
    Point(x=100, y=22)

    """

    # Validate the field names.  At the user's option, either generate an error
    # message or automatically replace the field name with a valid name.
    if isinstance(field_names, str):
        field_names = field_names.replace(',', ' ').split()
    field_names = list(map(str, field_names))
    typename = _sys.intern(str(typename))

    if rename:
        seen = set()
        for index, name in enumerate(field_names):
            if (not name.isidentifier()
                or _iskeyword(name)
                or name.startswith('_')
                or name in seen):
                field_names[index] = f'_{index}'
            seen.add(name)

    for name in [typename] + field_names:
        if type(name) is not str:
            raise TypeError('Type names and field names must be strings')
        if not name.isidentifier():
            raise ValueError('Type names and field names must be valid '
                             f'identifiers: {name!r}')
        if _iskeyword(name):
            raise ValueError('Type names and field names cannot be a '
                             f'keyword: {name!r}')

    seen = set()
    for name in field_names:
        if name.startswith('_') and not rename:
            raise ValueError('Field names cannot start with an underscore: '
                             f'{name!r}')
        if name in seen:
            raise ValueError(f'Encountered duplicate field name: {name!r}')
        seen.add(name)

    field_defaults = {}
    if defaults is not None:
        defaults = tuple(defaults)
        if len(defaults) > len(field_names):
            raise TypeError('Got more default values than field names')
        field_defaults = dict(reversed(list(zip(reversed(field_names),
                                                reversed(defaults)))))

    # Variables used in the methods and docstrings
    field_names = tuple(map(_sys.intern, field_names))
    num_fields = len(field_names)
    arg_list = repr(field_names).replace("'", "")[1:-1]
    repr_fmt = '(' + ', '.join(f'{name}=%r' for name in field_names) + ')'
    tuple_new = tuple.__new__
    _dict, _tuple, _len, _map, _zip = dict, tuple, len, map, zip

    # Create all the named tuple methods to be added to the class namespace

    s = f'def __new__(_cls, {arg_list}): return _tuple_new(_cls, ({arg_list}))'
    namespace = {'_tuple_new': tuple_new, '__name__': f'namedtuple_{typename}'}
    # Note: exec() has the side-effect of interning the field names
    exec(s, namespace)
    __new__ = namespace['__new__']
    __new__.__doc__ = f'Create new instance of {typename}({arg_list})'
    if defaults is not None:
        __new__.__defaults__ = defaults

    @classmethod
    def _make(cls, iterable):
        result = tuple_new(cls, iterable)
        if _len(result) != num_fields:
            raise TypeError(f'Expected {num_fields} arguments, got {len(result)}')
        return result

    _make.__func__.__doc__ = (f'Make a new {typename} object from a sequence '
                              'or iterable')

    def _replace(self, /, **kwds):
        result = self._make(_map(kwds.pop, field_names, self))
        if kwds:
            raise ValueError(f'Got unexpected field names: {list(kwds)!r}')
        return result

    _replace.__doc__ = (f'Return a new {typename} object replacing specified '
                        'fields with new values')

    def __repr__(self):
        'Return a nicely formatted representation string'
        return self.__class__.__name__ + repr_fmt % self

    def _asdict(self):
        'Return a new dict which maps field names to their values.'
        return _dict(_zip(self._fields, self))

    def __getnewargs__(self):
        'Return self as a plain tuple.  Used by copy and pickle.'
        return _tuple(self)

    # Modify function metadata to help with introspection and debugging
    for method in (__new__, _make.__func__, _replace,
                   __repr__, _asdict, __getnewargs__):
        method.__qualname__ = f'{typename}.{method.__name__}'

    # Build-up the class namespace dictionary
    # and use type() to build the result class
    class_namespace = {
        '__doc__': f'{typename}({arg_list})',
        '__slots__': (),
        '_fields': field_names,
        '_field_defaults': field_defaults,
        # alternate spelling for backward compatibility
        '_fields_defaults': field_defaults,
        '__new__': __new__,
        '_make': _make,
        '_replace': _replace,
        '__repr__': __repr__,
        '_asdict': _asdict,
        '__getnewargs__': __getnewargs__,
    }
    for index, name in enumerate(field_names):
        doc = _sys.intern(f'Alias for field number {index}')
        class_namespace[name] = _tuplegetter(index, doc)

    result = type(typename, (tuple,), class_namespace)

    # For pickling to work, the __module__ variable needs to be set to the frame
    # where the named tuple is created.  Bypass this step in environments where
    # sys._getframe is not defined (Jython for example) or sys._getframe is not
    # defined for arguments greater than 0 (IronPython), or where the user has
    # specified a particular module.
    if module is None:
        try:
            module = _sys._getframe(1).f_globals.get('__name__', '__main__')
        except (AttributeError, ValueError):
            pass
    if module is not None:
        result.__module__ = module

    return result


########################################################################
###  Counter
########################################################################

def _count_elements(mapping, iterable):
    'Tally elements from the iterable.'
    mapping_get = mapping.get
    for elem in iterable:
        mapping[elem] = mapping_get(elem, 0) + 1

try:                                    # Load C helper function if available
    from _collections import _count_elements
except ImportError:
    pass

class Counter(dict):
    '''Dict subclass for counting hashable items.  Sometimes called a bag
    or multiset.  Elements are stored as dictionary keys and their counts
    are stored as dictionary values.

    >>> c = Counter('abcdeabcdabcaba')  # count elements from a string

    >>> c.most_common(3)                # three most common elements
    [('a', 5), ('b', 4), ('c', 3)]
    >>> sorted(c)                       # list all unique elements
    ['a', 'b', 'c', 'd', 'e']
    >>> ''.join(sorted(c.elements()))   # list elements with repetitions
    'aaaaabbbbcccdde'
    >>> sum(c.values())                 # total of all counts
    15

    >>> c['a']                          # count of letter 'a'
    5
    >>> for elem in 'shazam':           # update counts from an iterable
    ...     c[elem] += 1                # by adding 1 to each element's count
    >>> c['a']                          # now there are seven 'a'
    7
    >>> del c['b']                      # remove all 'b'
    >>> c['b']                          # now there are zero 'b'
    0

    >>> d = Counter('simsalabim')       # make another counter
    >>> c.update(d)                     # add in the second counter
    >>> c['a']                          # now there are nine 'a'
    9

    >>> c.clear()                       # empty the counter
    >>> c
    Counter()

    Note:  If a count is set to zero or reduced to zero, it will remain
    in the counter until the entry is deleted or the counter is cleared:

    >>> c = Counter('aaabbc')
    >>> c['b'] -= 2                     # reduce the count of 'b' by two
    >>> c.most_common()                 # 'b' is still in, but its count is zero
    [('a', 3), ('c', 1), ('b', 0)]

    '''
    # References:
    #   http://en.wikipedia.org/wiki/Multiset
    #   http://www.gnu.org/software/smalltalk/manual-base/html_node/Bag.html
    #   http://www.demo2s.com/Tutorial/Cpp/0380__set-multiset/Catalog0380__set-multiset.htm
    #   http://code.activestate.com/recipes/259174/
    #   Knuth, TAOCP Vol. II section 4.6.3

    def __init__(self, iterable=None, /, **kwds):
        '''Create a new, empty Counter object.  And if given, count elements
        from an input iterable.  Or, initialize the count from another mapping
        of elements to their counts.

        >>> c = Counter()                           # a new, empty counter
        >>> c = Counter('gallahad')                 # a new counter from an iterable
        >>> c = Counter({'a': 4, 'b': 2})           # a new counter from a mapping
        >>> c = Counter(a=4, b=2)                   # a new counter from keyword args

        '''
        super(Counter, self).__init__()
        self.update(iterable, **kwds)

    def __missing__(self, key):
        'The count of elements not in the Counter is zero.'
        # Needed so that self[missing_item] does not raise KeyError
        return 0

    def most_common(self, n=None):
        '''List the n most common elements and their counts from the most
        common to the least.  If n is None, then list all element counts.

        >>> Counter('abracadabra').most_common(3)
        [('a', 5), ('b', 2), ('r', 2)]

        '''
        # Emulate Bag.sortedByCount from Smalltalk
        if n is None:
            return sorted(self.items(), key=_itemgetter(1), reverse=True)
        return _heapq.nlargest(n, self.items(), key=_itemgetter(1))

    def elements(self):
        '''Iterator over elements repeating each as many times as its count.

        >>> c = Counter('ABCABC')
        >>> sorted(c.elements())
        ['A', 'A', 'B', 'B', 'C', 'C']

        # Knuth's example for prime factors of 1836:  2**2 * 3**3 * 17**1
        >>> prime_factors = Counter({2: 2, 3: 3, 17: 1})
        >>> product = 1
        >>> for factor in prime_factors.elements():     # loop over factors
        ...     product *= factor                       # and multiply them
        >>> product
        1836

        Note, if an element's count has been set to zero or is a negative
        number, elements() will ignore it.

        '''
        # Emulate Bag.do from Smalltalk and Multiset.begin from C++.
        return _chain.from_iterable(_starmap(_repeat, self.items()))

    # Override dict methods where necessary

    @classmethod
    def fromkeys(cls, iterable, v=None):
        # There is no equivalent method for counters because the semantics
        # would be ambiguous in cases such as Counter.fromkeys('aaabbc', v=2).
        # Initializing counters to zero values isn't necessary because zero
        # is already the default value for counter lookups.  Initializing
        # to one is easily accomplished with Counter(set(iterable)).  For
        # more exotic cases, create a dictionary first using a dictionary
        # comprehension or dict.fromkeys().
        raise NotImplementedError(
            'Counter.fromkeys() is undefined.  Use Counter(iterable) instead.')

    def update(self, iterable=None, /, **kwds):
        '''Like dict.update() but add counts instead of replacing them.

        Source can be an iterable, a dictionary, or another Counter instance.

        >>> c = Counter('which')
        >>> c.update('witch')           # add elements from another iterable
        >>> d = Counter('watch')
        >>> c.update(d)                 # add elements from another counter
        >>> c['h']                      # four 'h' in which, witch, and watch
        4

        '''
        # The regular dict.update() operation makes no sense here because the
        # replace behavior results in the some of original untouched counts
        # being mixed-in with all of the other counts for a mismash that
        # doesn't have a straight-forward interpretation in most counting
        # contexts.  Instead, we implement straight-addition.  Both the inputs
        # and outputs are allowed to contain zero and negative counts.

        if iterable is not None:
            if isinstance(iterable, _collections_abc.Mapping):
                if self:
                    self_get = self.get
                    for elem, count in iterable.items():
                        self[elem] = count + self_get(elem, 0)
                else:
                    super(Counter, self).update(iterable) # fast path when counter is empty
            else:
                _count_elements(self, iterable)
        if kwds:
            self.update(kwds)

    def subtract(self, iterable=None, /, **kwds):
        '''Like dict.update() but subtracts counts instead of replacing them.
        Counts can be reduced below zero.  Both the inputs and outputs are
        allowed to contain zero and negative counts.

        Source can be an iterable, a dictionary, or another Counter instance.

        >>> c = Counter('which')
        >>> c.subtract('witch')             # subtract elements from another iterable
        >>> c.subtract(Counter('watch'))    # subtract elements from another counter
        >>> c['h']                          # 2 in which, minus 1 in witch, minus 1 in watch
        0
        >>> c['w']                          # 1 in which, minus 1 in witch, minus 1 in watch
        -1

        '''
        if iterable is not None:
            self_get = self.get
            if isinstance(iterable, _collections_abc.Mapping):
                for elem, count in iterable.items():
                    self[elem] = self_get(elem, 0) - count
            else:
                for elem in iterable:
                    self[elem] = self_get(elem, 0) - 1
        if kwds:
            self.subtract(kwds)

    def copy(self):
        'Return a shallow copy.'
        return self.__class__(self)

    def __reduce__(self):
        return self.__class__, (dict(self),)

    def __delitem__(self, elem):
        'Like dict.__delitem__() but does not raise KeyError for missing values.'
        if elem in self:
            super().__delitem__(elem)

    def __repr__(self):
        if not self:
            return '%s()' % self.__class__.__name__
        try:
            items = ', '.join(map('%r: %r'.__mod__, self.most_common()))
            return '%s({%s})' % (self.__class__.__name__, items)
        except TypeError:
            # handle case where values are not orderable
            return '{0}({1!r})'.format(self.__class__.__name__, dict(self))

    # Multiset-style mathematical operations discussed in:
    #       Knuth TAOCP Volume II section 4.6.3 exercise 19
    #       and at http://en.wikipedia.org/wiki/Multiset
    #
    # Outputs guaranteed to only include positive counts.
    #
    # To strip negative and zero counts, add-in an empty counter:
    #       c += Counter()
    #
    # Rich comparison operators for multiset subset and superset tests
    # are deliberately omitted due to semantic conflicts with the
    # existing inherited dict equality method.  Subset and superset
    # semantics ignore zero counts and require that p≤q ∧ p≥q → p=q;
    # however, that would not be the case for p=Counter(a=1, b=0)
    # and q=Counter(a=1) where the dictionaries are not equal.

    def __add__(self, other):
        '''Add counts from two counters.

        >>> Counter('abbb') + Counter('bcc')
        Counter({'b': 4, 'c': 2, 'a': 1})

        '''
        if not isinstance(other, Counter):
            return NotImplemented
        result = Counter()
        for elem, count in self.items():
            newcount = count + other[elem]
            if newcount > 0:
                result[elem] = newcount
        for elem, count in other.items():
            if elem not in self and count > 0:
                result[elem] = count
        return result

    def __sub__(self, other):
        ''' Subtract count, but keep only results with positive counts.

        >>> Counter('abbbc') - Counter('bccd')
        Counter({'b': 2, 'a': 1})

        '''
        if not isinstance(other, Counter):
            return NotImplemented
        result = Counter()
        for elem, count in self.items():
            newcount = count - other[elem]
            if newcount > 0:
                result[elem] = newcount
        for elem, count in other.items():
            if elem not in self and count < 0:
                result[elem] = 0 - count
        return result

    def __or__(self, other):
        '''Union is the maximum of value in either of the input counters.

        >>> Counter('abbb') | Counter('bcc')
        Counter({'b': 3, 'c': 2, 'a': 1})

        '''
        if not isinstance(other, Counter):
            return NotImplemented
        result = Counter()
        for elem, count in self.items():
            other_count = other[elem]
            newcount = other_count if count < other_count else count
            if newcount > 0:
                result[elem] = newcount
        for elem, count in other.items():
            if elem not in self and count > 0:
                result[elem] = count
        return result

    def __and__(self, other):
        ''' Intersection is the minimum of corresponding counts.

        >>> Counter('abbb') & Counter('bcc')
        Counter({'b': 1})

        '''
        if not isinstance(other, Counter):
            return NotImplemented
        result = Counter()
        for elem, count in self.items():
            other_count = other[elem]
            newcount = count if count < other_count else other_count
            if newcount > 0:
                result[elem] = newcount
        return result

    def __pos__(self):
        'Adds an empty counter, effectively stripping negative and zero counts'
        result = Counter()
        for elem, count in self.items():
            if count > 0:
                result[elem] = count
        return result

    def __neg__(self):
        '''Subtracts from an empty counter.  Strips positive and zero counts,
        and flips the sign on negative counts.

        '''
        result = Counter()
        for elem, count in self.items():
            if count < 0:
                result[elem] = 0 - count
        return result

    def _keep_positive(self):
        '''Internal method to strip elements with a negative or zero count'''
        nonpositive = [elem for elem, count in self.items() if not count > 0]
        for elem in nonpositive:
            del self[elem]
        return self

    def __iadd__(self, other):
        '''Inplace add from another counter, keeping only positive counts.

        >>> c = Counter('abbb')
        >>> c += Counter('bcc')
        >>> c
        Counter({'b': 4, 'c': 2, 'a': 1})

        '''
        for elem, count in other.items():
            self[elem] += count
        return self._keep_positive()

    def __isub__(self, other):
        '''Inplace subtract counter, but keep only results with positive counts.

        >>> c = Counter('abbbc')
        >>> c -= Counter('bccd')
        >>> c
        Counter({'b': 2, 'a': 1})

        '''
        for elem, count in other.items():
            self[elem] -= count
        return self._keep_positive()

    def __ior__(self, other):
        '''Inplace union is the maximum of value from either counter.

        >>> c = Counter('abbb')
        >>> c |= Counter('bcc')
        >>> c
        Counter({'b': 3, 'c': 2, 'a': 1})

        '''
        for elem, other_count in other.items():
            count = self[elem]
            if other_count > count:
                self[elem] = other_count
        return self._keep_positive()

    def __iand__(self, other):
        '''Inplace intersection is the minimum of corresponding counts.

        >>> c = Counter('abbb')
        >>> c &= Counter('bcc')
        >>> c
        Counter({'b': 1})

        '''
        for elem, count in self.items():
            other_count = other[elem]
            if other_count < count:
                self[elem] = other_count
        return self._keep_positive()


########################################################################
###  ChainMap
########################################################################

class ChainMap(_collections_abc.MutableMapping):
    ''' A ChainMap groups multiple dicts (or other mappings) together
    to create a single, updateable view.

    The underlying mappings are stored in a list.  That list is public and can
    be accessed or updated using the *maps* attribute.  There is no other
    state.

    Lookups search the underlying mappings successively until a key is found.
    In contrast, writes, updates, and deletions only operate on the first
    mapping.

    '''

    def __init__(self, *maps):
        '''Initialize a ChainMap by setting *maps* to the given mappings.
        If no mappings are provided, a single empty dictionary is used.

        '''
        self.maps = list(maps) or [{}]          # always at least one map

    def __missing__(self, key):
        raise KeyError(key)

    def __getitem__(self, key):
        for mapping in self.maps:
            try:
                return mapping[key]             # can't use 'key in mapping' with defaultdict
            except KeyError:
                pass
        return self.__missing__(key)            # support subclasses that define __missing__

    def get(self, key, default=None):
        return self[key] if key in self else default

    def __len__(self):
        return len(set().union(*self.maps))     # reuses stored hash values if possible

    def __iter__(self):
        d = {}
        for mapping in reversed(self.maps):
            d.update(mapping)                   # reuses stored hash values if possible
        return iter(d)

    def __contains__(self, key):
        return any(key in m for m in self.maps)

    def __bool__(self):
        return any(self.maps)

    @_recursive_repr()
    def __repr__(self):
        return f'{self.__class__.__name__}({", ".join(map(repr, self.maps))})'

    @classmethod
    def fromkeys(cls, iterable, *args):
        'Create a ChainMap with a single dict created from the iterable.'
        return cls(dict.fromkeys(iterable, *args))

    def copy(self):
        'New ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]'
        return self.__class__(self.maps[0].copy(), *self.maps[1:])

    __copy__ = copy

    def new_child(self, m=None):                # like Django's Context.push()
        '''New ChainMap with a new map followed by all previous maps.
        If no map is provided, an empty dict is used.
        '''
        if m is None:
            m = {}
        return self.__class__(m, *self.maps)

    @property
    def parents(self):                          # like Django's Context.pop()
        'New ChainMap from maps[1:].'
        return self.__class__(*self.maps[1:])

    def __setitem__(self, key, value):
        self.maps[0][key] = value

    def __delitem__(self, key):
        try:
            del self.maps[0][key]
        except KeyError:
            raise KeyError('Key not found in the first mapping: {!r}'.format(key))

    def popitem(self):
        'Remove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.'
        try:
            return self.maps[0].popitem()
        except KeyError:
            raise KeyError('No keys found in the first mapping.')

    def pop(self, key, *args):
        'Remove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].'
        try:
            return self.maps[0].pop(key, *args)
        except KeyError:
            raise KeyError('Key not found in the first mapping: {!r}'.format(key))

    def clear(self):
        'Clear maps[0], leaving maps[1:] intact.'
        self.maps[0].clear()


################################################################################
### UserDict
################################################################################

class UserDict(_collections_abc.MutableMapping):

    # Start by filling-out the abstract methods
    def __init__(*args, **kwargs):
        if not args:
            raise TypeError("descriptor '__init__' of 'UserDict' object "
                            "needs an argument")
        self, *args = args
        if len(args) > 1:
            raise TypeError('expected at most 1 arguments, got %d' % len(args))
        if args:
            dict = args[0]
        elif 'dict' in kwargs:
            dict = kwargs.pop('dict')
            import warnings
            warnings.warn("Passing 'dict' as keyword argument is deprecated",
                          DeprecationWarning, stacklevel=2)
        else:
            dict = None
        self.data = {}
        if dict is not None:
            self.update(dict)
        if kwargs:
            self.update(kwargs)
    __init__.__text_signature__ = '($self, dict=None, /, **kwargs)'

    def __len__(self): return len(self.data)
    def __getitem__(self, key):
        if key in self.data:
            return self.data[key]
        if hasattr(self.__class__, "__missing__"):
            return self.__class__.__missing__(self, key)
        raise KeyError(key)
    def __setitem__(self, key, item): self.data[key] = item
    def __delitem__(self, key): del self.data[key]
    def __iter__(self):
        return iter(self.data)

    # Modify __contains__ to work correctly when __missing__ is present
    def __contains__(self, key):
        return key in self.data

    # Now, add the methods in dicts but not in MutableMapping
    def __repr__(self): return repr(self.data)
    def __copy__(self):
        inst = self.__class__.__new__(self.__class__)
        inst.__dict__.update(self.__dict__)
        # Create a copy and avoid triggering descriptors
        inst.__dict__["data"] = self.__dict__["data"].copy()
        return inst

    def copy(self):
        if self.__class__ is UserDict:
            return UserDict(self.data.copy())
        import copy
        data = self.data
        try:
            self.data = {}
            c = copy.copy(self)
        finally:
            self.data = data
        c.update(self)
        return c

    @classmethod
    def fromkeys(cls, iterable, value=None):
        d = cls()
        for key in iterable:
            d[key] = value
        return d



################################################################################
### UserList
################################################################################

class UserList(_collections_abc.MutableSequence):
    """A more or less complete user-defined wrapper around list objects."""
    def __init__(self, initlist=None):
        self.data = []
        if initlist is not None:
            # XXX should this accept an arbitrary sequence?
            if type(initlist) == type(self.data):
                self.data[:] = initlist
            elif isinstance(initlist, UserList):
                self.data[:] = initlist.data[:]
            else:
                self.data = list(initlist)
    def __repr__(self): return repr(self.data)
    def __lt__(self, other): return self.data <  self.__cast(other)
    def __le__(self, other): return self.data <= self.__cast(other)
    def __eq__(self, other): return self.data == self.__cast(other)
    def __gt__(self, other): return self.data >  self.__cast(other)
    def __ge__(self, other): return self.data >= self.__cast(other)
    def __cast(self, other):
        return other.data if isinstance(other, UserList) else other
    def __contains__(self, item): return item in self.data
    def __len__(self): return len(self.data)
    def __getitem__(self, i):
        if isinstance(i, slice):
            return self.__class__(self.data[i])
        else:
            return self.data[i]
    def __setitem__(self, i, item): self.data[i] = item
    def __delitem__(self, i): del self.data[i]
    def __add__(self, other):
        if isinstance(other, UserList):
            return self.__class__(self.data + other.data)
        elif isinstance(other, type(self.data)):
            return self.__class__(self.data + other)
        return self.__class__(self.data + list(other))
    def __radd__(self, other):
        if isinstance(other, UserList):
            return self.__class__(other.data + self.data)
        elif isinstance(other, type(self.data)):
            return self.__class__(other + self.data)
        return self.__class__(list(other) + self.data)
    def __iadd__(self, other):
        if isinstance(other, UserList):
            self.data += other.data
        elif isinstance(other, type(self.data)):
            self.data += other
        else:
            self.data += list(other)
        return self
    def __mul__(self, n):
        return self.__class__(self.data*n)
    __rmul__ = __mul__
    def __imul__(self, n):
        self.data *= n
        return self
    def __copy__(self):
        inst = self.__class__.__new__(self.__class__)
        inst.__dict__.update(self.__dict__)
        # Create a copy and avoid triggering descriptors
        inst.__dict__["data"] = self.__dict__["data"][:]
        return inst
    def append(self, item): self.data.append(item)
    def insert(self, i, item): self.data.insert(i, item)
    def pop(self, i=-1): return self.data.pop(i)
    def remove(self, item): self.data.remove(item)
    def clear(self): self.data.clear()
    def copy(self): return self.__class__(self)
    def count(self, item): return self.data.count(item)
    def index(self, item, *args): return self.data.index(item, *args)
    def reverse(self): self.data.reverse()
    def sort(self, /, *args, **kwds): self.data.sort(*args, **kwds)
    def extend(self, other):
        if isinstance(other, UserList):
            self.data.extend(other.data)
        else:
            self.data.extend(other)



################################################################################
### UserString
################################################################################

class UserString(_collections_abc.Sequence):
    def __init__(self, seq):
        if isinstance(seq, str):
            self.data = seq
        elif isinstance(seq, UserString):
            self.data = seq.data[:]
        else:
            self.data = str(seq)
    def __str__(self): return str(self.data)
    def __repr__(self): return repr(self.data)
    def __int__(self): return int(self.data)
    def __float__(self): return float(self.data)
    def __complex__(self): return complex(self.data)
    def __hash__(self): return hash(self.data)
    def __getnewargs__(self):
        return (self.data[:],)

    def __eq__(self, string):
        if isinstance(string, UserString):
            return self.data == string.data
        return self.data == string
    def __lt__(self, string):
        if isinstance(string, UserString):
            return self.data < string.data
        return self.data < string
    def __le__(self, string):
        if isinstance(string, UserString):
            return self.data <= string.data
        return self.data <= string
    def __gt__(self, string):
        if isinstance(string, UserString):
            return self.data > string.data
        return self.data > string
    def __ge__(self, string):
        if isinstance(string, UserString):
            return self.data >= string.data
        return self.data >= string

    def __contains__(self, char):
        if isinstance(char, UserString):
            char = char.data
        return char in self.data

    def __len__(self): return len(self.data)
    def __getitem__(self, index): return self.__class__(self.data[index])
    def __add__(self, other):
        if isinstance(other, UserString):
            return self.__class__(self.data + other.data)
        elif isinstance(other, str):
            return self.__class__(self.data + other)
        return self.__class__(self.data + str(other))
    def __radd__(self, other):
        if isinstance(other, str):
            return self.__class__(other + self.data)
        return self.__class__(str(other) + self.data)
    def __mul__(self, n):
        return self.__class__(self.data*n)
    __rmul__ = __mul__
    def __mod__(self, args):
        return self.__class__(self.data % args)
    def __rmod__(self, template):
        return self.__class__(str(template) % self)
    # the following methods are defined in alphabetical order:
    def capitalize(self): return self.__class__(self.data.capitalize())
    def casefold(self):
        return self.__class__(self.data.casefold())
    def center(self, width, *args):
        return self.__class__(self.data.center(width, *args))
    def count(self, sub, start=0, end=_sys.maxsize):
        if isinstance(sub, UserString):
            sub = sub.data
        return self.data.count(sub, start, end)
    def encode(self, encoding='utf-8', errors='strict'):
        encoding = 'utf-8' if encoding is None else encoding
        errors = 'strict' if errors is None else errors
        return self.data.encode(encoding, errors)
    def endswith(self, suffix, start=0, end=_sys.maxsize):
        return self.data.endswith(suffix, start, end)
    def expandtabs(self, tabsize=8):
        return self.__class__(self.data.expandtabs(tabsize))
    def find(self, sub, start=0, end=_sys.maxsize):
        if isinstance(sub, UserString):
            sub = sub.data
        return self.data.find(sub, start, end)
    def format(self, /, *args, **kwds):
        return self.data.format(*args, **kwds)
    def format_map(self, mapping):
        return self.data.format_map(mapping)
    def index(self, sub, start=0, end=_sys.maxsize):
        return self.data.index(sub, start, end)
    def isalpha(self): return self.data.isalpha()
    def isalnum(self): return self.data.isalnum()
    def isascii(self): return self.data.isascii()
    def isdecimal(self): return self.data.isdecimal()
    def isdigit(self): return self.data.isdigit()
    def isidentifier(self): return self.data.isidentifier()
    def islower(self): return self.data.islower()
    def isnumeric(self): return self.data.isnumeric()
    def isprintable(self): return self.data.isprintable()
    def isspace(self): return self.data.isspace()
    def istitle(self): return self.data.istitle()
    def isupper(self): return self.data.isupper()
    def join(self, seq): return self.data.join(seq)
    def ljust(self, width, *args):
        return self.__class__(self.data.ljust(width, *args))
    def lower(self): return self.__class__(self.data.lower())
    def lstrip(self, chars=None): return self.__class__(self.data.lstrip(chars))
    maketrans = str.maketrans
    def partition(self, sep):
        return self.data.partition(sep)
    def replace(self, old, new, maxsplit=-1):
        if isinstance(old, UserString):
            old = old.data
        if isinstance(new, UserString):
            new = new.data
        return self.__class__(self.data.replace(old, new, maxsplit))
    def rfind(self, sub, start=0, end=_sys.maxsize):
        if isinstance(sub, UserString):
            sub = sub.data
        return self.data.rfind(sub, start, end)
    def rindex(self, sub, start=0, end=_sys.maxsize):
        return self.data.rindex(sub, start, end)
    def rjust(self, width, *args):
        return self.__class__(self.data.rjust(width, *args))
    def rpartition(self, sep):
        return self.data.rpartition(sep)
    def rstrip(self, chars=None):
        return self.__class__(self.data.rstrip(chars))
    def split(self, sep=None, maxsplit=-1):
        return self.data.split(sep, maxsplit)
    def rsplit(self, sep=None, maxsplit=-1):
        return self.data.rsplit(sep, maxsplit)
    def splitlines(self, keepends=False): return self.data.splitlines(keepends)
    def startswith(self, prefix, start=0, end=_sys.maxsize):
        return self.data.startswith(prefix, start, end)
    def strip(self, chars=None): return self.__class__(self.data.strip(chars))
    def swapcase(self): return self.__class__(self.data.swapcase())
    def title(self): return self.__class__(self.data.title())
    def translate(self, *args):
        return self.__class__(self.data.translate(*args))
    def upper(self): return self.__class__(self.data.upper())
    def zfill(self, width): return self.__class__(self.data.zfill(width))
collections/__pycache__/abc.cpython-38.pyc000064400000000301151153537460014453 0ustar00U

e5dD�@sddlTddlmZdS)�)�*)�__all__N)�_collections_abcr�rr�'/usr/lib64/python3.8/collections/abc.py�<module>scollections/__pycache__/__init__.cpython-38.opt-1.pyc000064400000132546151153537460016445 0ustar00U

e5dC��	@s&dZddddddddd	g	Zd
dlZd
dlmZmZd
d
lm	Z
d
dlZd
dl
Zd
dlmZd
dlmZmZmZd
dlmZzd
dlmZWnek
r�YnXej� e�zd
dlm!Z!Wnek
r�YnXdd�Z"Gdd�dej#�Z$Gdd�dej%�Z&Gdd�dej'�Z(Gdd�de)�Z*Gdd�de+�Z,zd
dlm,Z,Wnek
�rVYnXzd
dlm-Z-Wnek
�r�d d!�Z-YnXd"ddd#�d$d�Z.d%d&�Z/zd
d'lm/Z/Wnek
�r�YnXGd(d�de+�Z0Gd)d	�d	ej1�Z2Gd*d�dej1�Z3Gd+d�dej�Z4Gd,d�dej5�Z6dS)-a?This module implements specialized container datatypes providing
alternatives to Python's general purpose built-in containers, dict,
list, set, and tuple.

* namedtuple   factory function for creating tuple subclasses with named fields
* deque        list-like container with fast appends and pops on either end
* ChainMap     dict-like class for creating a single view of multiple mappings
* Counter      dict subclass for counting hashable objects
* OrderedDict  dict subclass that remembers the order entries were added
* defaultdict  dict subclass that calls a factory function to supply missing values
* UserDict     wrapper around dictionary objects for easier dict subclassing
* UserList     wrapper around list objects for easier list subclassing
* UserString   wrapper around string objects for easier string subclassing

�deque�defaultdict�
namedtuple�UserDict�UserList�
UserString�Counter�OrderedDict�ChainMap�N)�
itemgetter�eq)�	iskeyword)�proxy)�repeat�chain�starmap)�recursive_repr)r)rcCsR|tjkr:tt|�}ddl}|jdtdd�|t�|<|Stdt�d|����dS)Nr
z�Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working���
stacklevelzmodule z has no attribute )	�_collections_abc�__all__�getattr�warnings�warn�DeprecationWarning�globals�AttributeError�__name__)�name�objr�r!�,/usr/lib64/python3.8/collections/__init__.py�__getattr__*s

�
r#c@seZdZdd�ZdS)�_OrderedDictKeysViewccst|j�EdHdS�N��reversed�_mapping��selfr!r!r"�__reversed__?sz!_OrderedDictKeysView.__reversed__N�r�
__module__�__qualname__r+r!r!r!r"r$=sr$c@seZdZdd�ZdS)�_OrderedDictItemsViewccs$t|j�D]}||j|fVq
dSr%r&�r*�keyr!r!r"r+Dsz"_OrderedDictItemsView.__reversed__Nr,r!r!r!r"r/Bsr/c@seZdZdd�ZdS)�_OrderedDictValuesViewccs t|j�D]}|j|Vq
dSr%r&r0r!r!r"r+Jsz#_OrderedDictValuesView.__reversed__Nr,r!r!r!r"r2Hsr2c@seZdZdZdS)�_Link)�prev�nextr1�__weakref__N)rr-r.�	__slots__r!r!r!r"r3Nsr3c@s�eZdZdZd+dd�Zejeefdd�Zej	fdd�Z	d	d
�Z
dd�Zd
d�Zd,dd�Z
d-dd�Zdd�ZejjZZdd�Zdd�Zdd�ZejjZe�Zefdd�Zd.dd �Ze�d!d"��Zd#d$�Zd%d&�Ze d/d'd(��Z!d)d*�Z"dS)0rz)Dictionary that remembers insertion orderr!cKs\z
|jWn>tk
rHt�|_t|j�|_}||_|_i|_YnX|j|f|�dS)z�Initialize an ordered dictionary.  The signature is the same as
        regular dictionaries.  Keyword argument order is preserved.
        N)	�_OrderedDict__rootrr3�_OrderedDict__hardroot�_proxyr4r5�_OrderedDict__map�_OrderedDict__update)r*�other�kwds�rootr!r!r"�__init__`s
zOrderedDict.__init__c	CsZ||krJ|�|j|<}|j}|j}||||_|_|_||_||�|_||||�dS)z!od.__setitem__(i, y) <==> od[i]=yN)r;r8r4r5r1)	r*r1�valueZdict_setitemrZLink�linkr?�lastr!r!r"�__setitem__ms
zOrderedDict.__setitem__cCs>|||�|j�|�}|j}|j}||_||_d|_d|_dS)z od.__delitem__(y) <==> del od[y]N)r;�popr4r5)r*r1Zdict_delitemrB�	link_prev�	link_nextr!r!r"�__delitem__{s
zOrderedDict.__delitem__ccs(|j}|j}||k	r$|jV|j}qdS)zod.__iter__() <==> iter(od)N)r8r5r1�r*r?Zcurrr!r!r"�__iter__�s
zOrderedDict.__iter__ccs(|j}|j}||k	r$|jV|j}qdS)z#od.__reversed__() <==> reversed(od)N)r8r4r1rIr!r!r"r+�s
zOrderedDict.__reversed__cCs*|j}||_|_|j��t�|�dS)z.od.clear() -> None.  Remove all items from od.N)r8r4r5r;�clear�dict)r*r?r!r!r"rK�s
zOrderedDict.clearTcCsj|std��|j}|r0|j}|j}||_||_n|j}|j}||_||_|j}|j|=t�||�}||fS)z�Remove and return a (key, value) pair from the dictionary.

        Pairs are returned in LIFO order if last is true or FIFO order if false.
        zdictionary is empty)�KeyErrorr8r4r5r1r;rLrE)r*rCr?rBrFrGr1rAr!r!r"�popitem�s zOrderedDict.popitemc	Cst|j|}|j}|j}|j}||_||_|j}|rR|j}||_||_||_||_n|j}||_||_||_||_dS)z�Move an existing element to the end (or beginning if last is false).

        Raise KeyError if the element does not exist.
        N)r;r4r5r8)	r*r1rCrBrFrGZ	soft_linkr?�firstr!r!r"�move_to_end�s$
zOrderedDict.move_to_endcCsVtj}t|�d}||j�}|||j�d7}|||j�|7}|||j�|7}|S)N�r)�_sys�	getsizeof�len�__dict__r;r9r8)r*Zsizeof�n�sizer!r!r"�
__sizeof__�s
zOrderedDict.__sizeof__cCst|�S)z:D.keys() -> a set-like object providing a view on D's keys)r$r)r!r!r"�keys�szOrderedDict.keyscCst|�S)z<D.items() -> a set-like object providing a view on D's items)r/r)r!r!r"�items�szOrderedDict.itemscCst|�S)z6D.values() -> an object providing a view on D's values)r2r)r!r!r"�values�szOrderedDict.valuescCs0||kr||}||=|S||jkr,t|��|S)z�od.pop(k[,d]) -> v, remove specified key and return the corresponding
        value.  If key is not found, d is returned if given, otherwise KeyError
        is raised.

        )�_OrderedDict__markerrM)r*r1�default�resultr!r!r"rE�s
zOrderedDict.popNcCs||kr||S|||<|S)z�Insert key with a value of default if key is not in the dictionary.

        Return the value for key if key is in the dictionary, else default.
        r!�r*r1r]r!r!r"�
setdefault�szOrderedDict.setdefaultcCs*|sd|jjfSd|jjt|���fS)zod.__repr__() <==> repr(od)�%s()z%s(%r))�	__class__r�listrZr)r!r!r"�__repr__szOrderedDict.__repr__cCsDt|���}tt��D]}|�|d�q|jd|p4ddt|���fS)z%Return state information for picklingNr!)�vars�copyrrErb�iterrZ)r*Z	inst_dict�kr!r!r"�
__reduce__szOrderedDict.__reduce__cCs
|�|�S)z!od.copy() -> a shallow copy of od�rbr)r!r!r"rfszOrderedDict.copycCs|�}|D]}|||<q
|S)zYCreate a new ordered dictionary with keys from iterable and values set to value.
        r!)�cls�iterablerAr*r1r!r!r"�fromkeyss
zOrderedDict.fromkeyscCs2t|t�r&t�||�o$ttt||��St�||�S)z�od.__eq__(y) <==> od==y.  Comparison to another OD is order-sensitive
        while comparison to a regular mapping is order-insensitive.

        )�
isinstancerrL�__eq__�all�map�_eq�r*r=r!r!r"ros
zOrderedDict.__eq__)r!)T)T)N)N)#rr-r.�__doc__r@rLrDr:r3rHrJr+rKrNrPrXr�MutableMapping�updater<rYrZr[�__ne__�objectr\rEr`�_recursive_reprrdrirf�classmethodrmror!r!r!r"rQs8
�

		

	


)r)�_tuplegettercCstt|�|d�S)N)�doc)�property�_itemgetter)�indexr|r!r!r"�<lambda>7�r�F)�rename�defaults�modulecs�t�t�r��dd����ttt����t�t|��}|r�t�}t	��D]B\}}|�
�rrt|�sr|�d�sr||kr�d|���|<|�
|�qH|g�D]D}t|�tk	r�td��|�
�s�td|����t|�r�td|����q�t�}�D]F}|�d��r
|�s
td|����||k�r"td|����|�
|�q�i}|d	k	�r|t|�}t|�t��k�r^td
��ttttt��t|�����}tttj����t���t���dd�d
d�}	dd�dd��D��d�tj�tttttf\�����d|	�d|	�d�}
�d|��d�}t|
|�|d}d|�d|	�d�|_|d	k	�r>||_t���fdd��}
d|�d�|
j_��fdd �}d!|�d"�|_�fd#d$�}��fd%d&�}�fd'd(�}||
j||||fD]}|�d)|j��|_�q�|�d|	�d�d*�||||
||||d+�}t	��D](\}}t�d,|���}t ||�||<�qt|tf|�}|d	k�rvzt�!d
�j"�#d-d.�}Wnt$tfk
�rtYnX|d	k	�r�||_%|S)/aCReturns a new subclass of tuple with named fields.

    >>> Point = namedtuple('Point', ['x', 'y'])
    >>> Point.__doc__                   # docstring for the new class
    'Point(x, y)'
    >>> p = Point(11, y=22)             # instantiate with positional args or keywords
    >>> p[0] + p[1]                     # indexable like a plain tuple
    33
    >>> x, y = p                        # unpack like a regular tuple
    >>> x, y
    (11, 22)
    >>> p.x + p.y                       # fields also accessible by name
    33
    >>> d = p._asdict()                 # convert to a dictionary
    >>> d['x']
    11
    >>> Point(**d)                      # convert from a dictionary
    Point(x=11, y=22)
    >>> p._replace(x=100)               # _replace() is like str.replace() but targets named fields
    Point(x=100, y=22)

    �,� �_z*Type names and field names must be stringsz6Type names and field names must be valid identifiers: z0Type names and field names cannot be a keyword: z-Field names cannot start with an underscore: z"Encountered duplicate field name: Nz(Got more default values than field names�'�rQ����(�, css|]}|�d�VqdS)z=%rNr!)�.0rr!r!r"�	<genexpr>�sznamedtuple.<locals>.<genexpr>�)zdef __new__(_cls, z): return _tuple_new(_cls, (z))�namedtuple_)�
_tuple_newr�__new__zCreate new instance of cs2�||�}�|��kr.td��dt|�����|S)Nz	Expected z arguments, got )�	TypeErrorrT)rkrlr^)�_len�
num_fields�	tuple_newr!r"�_make�s
znamedtuple.<locals>._makezMake a new z# object from a sequence or iterablecs.|��|j�|��}|r*tdt|�����|S)NzGot unexpected field names: )r�rE�
ValueErrorrc)r*r>r^)�_map�field_namesr!r"�_replace�sznamedtuple.<locals>._replacez
Return a new z2 object replacing specified fields with new valuescs|jj�|S)z/Return a nicely formatted representation string)rbrr))�repr_fmtr!r"rd�sznamedtuple.<locals>.__repr__cs��|j|��S)z9Return a new dict which maps field names to their values.)�_fieldsr))�_dict�_zipr!r"�_asdict�sznamedtuple.<locals>._asdictcs�|�S)z7Return self as a plain tuple.  Used by copy and pickle.r!r))�_tupler!r"�__getnewargs__�sz"namedtuple.<locals>.__getnewargs__�.r!)rtr7r��_field_defaults�_fields_defaultsr�r�r�rdr�r�zAlias for field number r�__main__)&rn�str�replace�splitrcrqrR�intern�set�	enumerate�isidentifier�
_iskeyword�
startswith�add�typer�r��tuplerTrLr'�zip�repr�joinr��execrt�__defaults__rz�__func__rr.r{�	_getframe�	f_globals�getrr-)�typenamer�r�r�r��seenrr�field_defaults�arg_list�s�	namespacer�r�r�rdr�r��method�class_namespacer|r^r!)	r�r�r�r�r�r�r�r�r�r"r9s�
���

�


��

cCs&|j}|D]}||d�d||<q
dS)z!Tally elements from the iterable.r
rQN)r�)�mappingrlZmapping_get�elemr!r!r"�_count_elements�sr�)r�cs�eZdZdZd/�fdd�	Zdd�Zd0dd�Zd	d
�Zed1dd��Z	d2�fd
d�	Z
d3dd�Zdd�Zdd�Z
�fdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Z�ZS)4ra�Dict subclass for counting hashable items.  Sometimes called a bag
    or multiset.  Elements are stored as dictionary keys and their counts
    are stored as dictionary values.

    >>> c = Counter('abcdeabcdabcaba')  # count elements from a string

    >>> c.most_common(3)                # three most common elements
    [('a', 5), ('b', 4), ('c', 3)]
    >>> sorted(c)                       # list all unique elements
    ['a', 'b', 'c', 'd', 'e']
    >>> ''.join(sorted(c.elements()))   # list elements with repetitions
    'aaaaabbbbcccdde'
    >>> sum(c.values())                 # total of all counts
    15

    >>> c['a']                          # count of letter 'a'
    5
    >>> for elem in 'shazam':           # update counts from an iterable
    ...     c[elem] += 1                # by adding 1 to each element's count
    >>> c['a']                          # now there are seven 'a'
    7
    >>> del c['b']                      # remove all 'b'
    >>> c['b']                          # now there are zero 'b'
    0

    >>> d = Counter('simsalabim')       # make another counter
    >>> c.update(d)                     # add in the second counter
    >>> c['a']                          # now there are nine 'a'
    9

    >>> c.clear()                       # empty the counter
    >>> c
    Counter()

    Note:  If a count is set to zero or reduced to zero, it will remain
    in the counter until the entry is deleted or the counter is cleared:

    >>> c = Counter('aaabbc')
    >>> c['b'] -= 2                     # reduce the count of 'b' by two
    >>> c.most_common()                 # 'b' is still in, but its count is zero
    [('a', 3), ('c', 1), ('b', 0)]

    Ncs tt|���|j|f|�dS)a	Create a new, empty Counter object.  And if given, count elements
        from an input iterable.  Or, initialize the count from another mapping
        of elements to their counts.

        >>> c = Counter()                           # a new, empty counter
        >>> c = Counter('gallahad')                 # a new counter from an iterable
        >>> c = Counter({'a': 4, 'b': 2})           # a new counter from a mapping
        >>> c = Counter(a=4, b=2)                   # a new counter from keyword args

        N)�superrr@rv)r*rlr>rjr!r"r@szCounter.__init__cCsdS)z1The count of elements not in the Counter is zero.r
r!r0r!r!r"�__missing__*szCounter.__missing__cCs6|dkrt|��td�dd�Stj||��td�d�S)z�List the n most common elements and their counts from the most
        common to the least.  If n is None, then list all element counts.

        >>> Counter('abracadabra').most_common(3)
        [('a', 5), ('b', 2), ('r', 2)]

        NrQT)r1�reverse�r1)�sortedrZr~�_heapq�nlargest�r*rVr!r!r"�most_common/s	zCounter.most_commoncCst�tt|����S)a�Iterator over elements repeating each as many times as its count.

        >>> c = Counter('ABCABC')
        >>> sorted(c.elements())
        ['A', 'A', 'B', 'B', 'C', 'C']

        # Knuth's example for prime factors of 1836:  2**2 * 3**3 * 17**1
        >>> prime_factors = Counter({2: 2, 3: 3, 17: 1})
        >>> product = 1
        >>> for factor in prime_factors.elements():     # loop over factors
        ...     product *= factor                       # and multiply them
        >>> product
        1836

        Note, if an element's count has been set to zero or is a negative
        number, elements() will ignore it.

        )�_chain�
from_iterable�_starmap�_repeatrZr)r!r!r"�elements<szCounter.elementscCstd��dS)Nz@Counter.fromkeys() is undefined.  Use Counter(iterable) instead.)�NotImplementedError)rkrl�vr!r!r"rmTs	�zCounter.fromkeyscsr|dk	r`t|tj�rV|rD|j}|��D]\}}|||d�||<q&q`tt|��|�n
t||�|rn|�|�dS)a�Like dict.update() but add counts instead of replacing them.

        Source can be an iterable, a dictionary, or another Counter instance.

        >>> c = Counter('which')
        >>> c.update('witch')           # add elements from another iterable
        >>> d = Counter('watch')
        >>> c.update(d)                 # add elements from another counter
        >>> c['h']                      # four 'h' in which, witch, and watch
        4

        Nr
)	rnr�Mappingr�rZr�rrvr��r*rlr>�self_getr��countrjr!r"rv`s
zCounter.updatecKsn|dk	r\|j}t|tj�r@|��D]\}}||d�|||<q"n|D]}||d�d||<qD|rj|�|�dS)a�Like dict.update() but subtracts counts instead of replacing them.
        Counts can be reduced below zero.  Both the inputs and outputs are
        allowed to contain zero and negative counts.

        Source can be an iterable, a dictionary, or another Counter instance.

        >>> c = Counter('which')
        >>> c.subtract('witch')             # subtract elements from another iterable
        >>> c.subtract(Counter('watch'))    # subtract elements from another counter
        >>> c['h']                          # 2 in which, minus 1 in witch, minus 1 in watch
        0
        >>> c['w']                          # 1 in which, minus 1 in witch, minus 1 in watch
        -1

        Nr
rQ)r�rnrr�rZ�subtractr�r!r!r"r��szCounter.subtractcCs
|�|�S)zReturn a shallow copy.rjr)r!r!r"rf�szCounter.copycCs|jt|�ffSr%)rbrLr)r!r!r"ri�szCounter.__reduce__cs||krt��|�dS)zGLike dict.__delitem__() but does not raise KeyError for missing values.N)r�rH)r*r�rjr!r"rH�szCounter.__delitem__cCsf|sd|jjSz(d�tdj|����}d|jj|fWStk
r`d�|jjt|��YSXdS)Nrar�z%r: %rz%s({%s})z
{0}({1!r}))	rbrr�rq�__mod__r�r��formatrL)r*rZr!r!r"rd�szCounter.__repr__cCspt|t�stSt�}|��D]$\}}|||}|dkr|||<q|��D] \}}||krJ|dkrJ|||<qJ|S)zAdd counts from two counters.

        >>> Counter('abbb') + Counter('bcc')
        Counter({'b': 4, 'c': 2, 'a': 1})

        r
�rnr�NotImplementedrZ�r*r=r^r�r��newcountr!r!r"�__add__�s


zCounter.__add__cCstt|t�stSt�}|��D]$\}}|||}|dkr|||<q|��D]$\}}||krJ|dkrJd|||<qJ|S)z� Subtract count, but keep only results with positive counts.

        >>> Counter('abbbc') - Counter('bccd')
        Counter({'b': 2, 'a': 1})

        r
r�r�r!r!r"�__sub__�s

zCounter.__sub__cCs|t|t�stSt�}|��D]0\}}||}||kr8|n|}|dkr|||<q|��D] \}}||krV|dkrV|||<qV|S)z�Union is the maximum of value in either of the input counters.

        >>> Counter('abbb') | Counter('bcc')
        Counter({'b': 3, 'c': 2, 'a': 1})

        r
r��r*r=r^r�r��other_countr�r!r!r"�__or__�s


zCounter.__or__cCsRt|t�stSt�}|��D]0\}}||}||kr8|n|}|dkr|||<q|S)z� Intersection is the minimum of corresponding counts.

        >>> Counter('abbb') & Counter('bcc')
        Counter({'b': 1})

        r
r�r�r!r!r"�__and__�s

zCounter.__and__cCs,t�}|��D]\}}|dkr|||<q|S)zEAdds an empty counter, effectively stripping negative and zero countsr
�rrZ�r*r^r�r�r!r!r"�__pos__
s

zCounter.__pos__cCs0t�}|��D]\}}|dkrd|||<q|S)z{Subtracts from an empty counter.  Strips positive and zero counts,
        and flips the sign on negative counts.

        r
r�r�r!r!r"�__neg__s
zCounter.__neg__cCs&dd�|��D�}|D]
}||=q|S)z?Internal method to strip elements with a negative or zero countcSsg|]\}}|dks|�qS)r
r!)r�r�r�r!r!r"�
<listcomp>"sz*Counter._keep_positive.<locals>.<listcomp>)rZ)r*�nonpositiver�r!r!r"�_keep_positive szCounter._keep_positivecCs*|��D]\}}|||7<q|��S)z�Inplace add from another counter, keeping only positive counts.

        >>> c = Counter('abbb')
        >>> c += Counter('bcc')
        >>> c
        Counter({'b': 4, 'c': 2, 'a': 1})

        �rZr��r*r=r�r�r!r!r"�__iadd__'s	zCounter.__iadd__cCs*|��D]\}}|||8<q|��S)z�Inplace subtract counter, but keep only results with positive counts.

        >>> c = Counter('abbbc')
        >>> c -= Counter('bccd')
        >>> c
        Counter({'b': 2, 'a': 1})

        r�r�r!r!r"�__isub__4s	zCounter.__isub__cCs2|��D] \}}||}||kr|||<q|��S)z�Inplace union is the maximum of value from either counter.

        >>> c = Counter('abbb')
        >>> c |= Counter('bcc')
        >>> c
        Counter({'b': 3, 'c': 2, 'a': 1})

        r�)r*r=r�r�r�r!r!r"�__ior__As
	
zCounter.__ior__cCs2|��D] \}}||}||kr|||<q|��S)z�Inplace intersection is the minimum of corresponding counts.

        >>> c = Counter('abbb')
        >>> c &= Counter('bcc')
        >>> c
        Counter({'b': 1})

        r�)r*r=r�r�r�r!r!r"�__iand__Ps
	
zCounter.__iand__)N)N)N)N)N)rr-r.rtr@r�r�r�rzrmrvr�rfrirHrdr�r�r�r�r�r�r�r�r�r�r��
__classcell__r!r!rjr"r�s02

!


c@s�eZdZdZdd�Zdd�Zdd�Zd'd	d
�Zdd�Zd
d�Z	dd�Z
dd�Ze�dd��Z
edd��Zdd�ZeZd(dd�Zedd��Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�ZdS))r	a� A ChainMap groups multiple dicts (or other mappings) together
    to create a single, updateable view.

    The underlying mappings are stored in a list.  That list is public and can
    be accessed or updated using the *maps* attribute.  There is no other
    state.

    Lookups search the underlying mappings successively until a key is found.
    In contrast, writes, updates, and deletions only operate on the first
    mapping.

    cGst|�pig|_dS)z�Initialize a ChainMap by setting *maps* to the given mappings.
        If no mappings are provided, a single empty dictionary is used.

        N)rc�maps)r*r�r!r!r"r@rszChainMap.__init__cCst|��dSr%)rMr0r!r!r"r�yszChainMap.__missing__c	Cs:|jD](}z||WStk
r,YqXq|�|�Sr%)r�rMr�)r*r1r�r!r!r"�__getitem__|s
zChainMap.__getitem__NcCs||kr||S|Sr%r!r_r!r!r"r��szChainMap.getcCstt�j|j��Sr%)rTr��unionr�r)r!r!r"�__len__�szChainMap.__len__cCs&i}t|j�D]}|�|�qt|�Sr%)r'r�rvrg)r*�dr�r!r!r"rJ�szChainMap.__iter__cst�fdd�|jD��S)Nc3s|]}�|kVqdSr%r!)r��mr�r!r"r��sz(ChainMap.__contains__.<locals>.<genexpr>��anyr�r0r!r�r"�__contains__�szChainMap.__contains__cCs
t|j�Sr%r�r)r!r!r"�__bool__�szChainMap.__bool__cCs"|jj�dd�tt|j���d�S)Nr�r�r�)rbrr�rqr�r�r)r!r!r"rd�szChainMap.__repr__cGs|tj|f|���S)z?Create a ChainMap with a single dict created from the iterable.)rLrm)rkrl�argsr!r!r"rm�szChainMap.fromkeyscCs$|j|jd��f|jdd���S)zHNew ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]r
rQN)rbr�rfr)r!r!r"rf�sz
ChainMap.copycCs|dkri}|j|f|j��S)zyNew ChainMap with a new map followed by all previous maps.
        If no map is provided, an empty dict is used.
        N�rbr�)r*r�r!r!r"�	new_child�szChainMap.new_childcCs|j|jdd��S)zNew ChainMap from maps[1:].rQNrr)r!r!r"�parents�szChainMap.parentscCs||jd|<dS�Nr
)r�)r*r1rAr!r!r"rD�szChainMap.__setitem__cCs8z|jd|=Wn"tk
r2td�|���YnXdS)Nr
�(Key not found in the first mapping: {!r})r�rMr�r0r!r!r"rH�szChainMap.__delitem__cCs2z|jd��WStk
r,td��YnXdS)zPRemove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.r
z#No keys found in the first mapping.N)r�rNrMr)r!r!r"rN�szChainMap.popitemcGs@z|jdj|f|��WStk
r:td�|���YnXdS)zWRemove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].r
rN)r�rErMr�)r*r1rr!r!r"rE�szChainMap.popcCs|jd��dS)z'Clear maps[0], leaving maps[1:] intact.r
N)r�rKr)r!r!r"rK�szChainMap.clear)N)N)rr-r.rtr@r�r�r�r�rJr�r�ryrdrzrmrf�__copy__rr}rrDrHrNrErKr!r!r!r"r	ds.





c@speZdZdd�Zde_dd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
eddd��ZdS)rcOs�|std��|^}}t|�dkr0tdt|���|r>|d}n0d|krj|�d�}ddl}|jdtdd�nd}i|_|dk	r�|�|�|r�|�|�dS)	Nz<descriptor '__init__' of 'UserDict' object needs an argumentrQz$expected at most 1 arguments, got %dr
rLz0Passing 'dict' as keyword argument is deprecatedrr)r�rTrErrr�datarv)r�kwargsr*rLrr!r!r"r@�s(

�
zUserDict.__init__z($self, dict=None, /, **kwargs)cCs
t|j�Sr%�rTrr)r!r!r"r��r�zUserDict.__len__cCs:||jkr|j|St|jd�r.|j�||�St|��dS)Nr�)r�hasattrrbr�rMr0r!r!r"r��s


zUserDict.__getitem__cCs||j|<dSr%�r)r*r1�itemr!r!r"rD�r�zUserDict.__setitem__cCs|j|=dSr%rr0r!r!r"rH�r�zUserDict.__delitem__cCs
t|j�Sr%)rgrr)r!r!r"rJ�szUserDict.__iter__cCs
||jkSr%rr0r!r!r"r��szUserDict.__contains__cCs
t|j�Sr%�r�rr)r!r!r"rd�r�zUserDict.__repr__cCs4|j�|j�}|j�|j�|jd��|jd<|S�Nr)rbr�rUrvrf�r*�instr!r!r"r�szUserDict.__copy__cCsR|jtkrt|j���Sddl}|j}zi|_|�|�}W5||_X|�|�|Sr)rbrrrfrv)r*rfr�cr!r!r"rfs

z
UserDict.copyNcCs|�}|D]}|||<q
|Sr%r!)rkrlrAr�r1r!r!r"rms
zUserDict.fromkeys)N)rr-r.r@�__text_signature__r�r�rDrHrJr�rdrrfrzrmr!r!r!r"r�s
c@seZdZdZd@dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�ZeZd%d&�Zd'd(�Zd)d*�Zd+d,�ZdAd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Z d<d=�Z!d>d?�Z"dS)BrzAA more or less complete user-defined wrapper around list objects.NcCsbg|_|dk	r^t|�t|j�kr0||jdd�<n.t|t�rT|jdd�|jdd�<n
t|�|_dSr%)rr�rnrrc)r*�initlistr!r!r"r@!s
zUserList.__init__cCs
t|j�Sr%r
r)r!r!r"rd+r�zUserList.__repr__cCs|j|�|�kSr%�r�_UserList__castrsr!r!r"�__lt__,r�zUserList.__lt__cCs|j|�|�kSr%rrsr!r!r"�__le__-r�zUserList.__le__cCs|j|�|�kSr%rrsr!r!r"ro.r�zUserList.__eq__cCs|j|�|�kSr%rrsr!r!r"�__gt__/r�zUserList.__gt__cCs|j|�|�kSr%rrsr!r!r"�__ge__0r�zUserList.__ge__cCst|t�r|jS|Sr%)rnrrrsr!r!r"�__cast1szUserList.__castcCs
||jkSr%r�r*rr!r!r"r�3r�zUserList.__contains__cCs
t|j�Sr%r	r)r!r!r"r�4r�zUserList.__len__cCs(t|t�r|�|j|�S|j|SdSr%)rn�slicerbr�r*�ir!r!r"r�5s
zUserList.__getitem__cCs||j|<dSr%r�r*rrr!r!r"rD:r�zUserList.__setitem__cCs|j|=dSr%rrr!r!r"rH;r�zUserList.__delitem__cCsPt|t�r|�|j|j�St|t|j��r<|�|j|�S|�|jt|��Sr%�rnrrbrr�rcrsr!r!r"r�<s

zUserList.__add__cCsPt|t�r|�|j|j�St|t|j��r<|�||j�S|�t|�|j�Sr%r rsr!r!r"�__radd__Bs

zUserList.__radd__cCsRt|t�r|j|j7_n2t|t|j��r<|j|7_n|jt|�7_|Sr%)rnrrr�rcrsr!r!r"r�Hs
zUserList.__iadd__cCs|�|j|�Sr%�rbrr�r!r!r"�__mul__PszUserList.__mul__cCs|j|9_|Sr%rr�r!r!r"�__imul__SszUserList.__imul__cCs8|j�|j�}|j�|j�|jddd�|jd<|Sr)rbr�rUrvrr!r!r"rVszUserList.__copy__cCs|j�|�dSr%)r�appendrr!r!r"r%\r�zUserList.appendcCs|j�||�dSr%)r�insertrr!r!r"r&]r�zUserList.insertr�cCs|j�|�Sr%)rrErr!r!r"rE^r�zUserList.popcCs|j�|�dSr%)r�removerr!r!r"r'_r�zUserList.removecCs|j��dSr%)rrKr)r!r!r"rK`r�zUserList.clearcCs
|�|�Sr%rjr)r!r!r"rfar�z
UserList.copycCs|j�|�Sr%)rr�rr!r!r"r�br�zUserList.countcGs|jj|f|��Sr%�rr)r*rrr!r!r"rcr�zUserList.indexcCs|j��dSr%)rr�r)r!r!r"r�dr�zUserList.reversecOs|jj||�dSr%)r�sort�r*rr>r!r!r"r)er�z
UserList.sortcCs*t|t�r|j�|j�n|j�|�dSr%)rnrr�extendrsr!r!r"r+fs
zUserList.extend)N)r�)#rr-r.rtr@rdrrrorrrr�r�r�rDrHr�r!r�r#�__rmul__r$rr%r&rEr'rKrfr�rr�r)r+r!r!r!r"rs@


c@sheZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�ZeZd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1ejfd2d3�Zd�d6d7�Zd1ejfd8d9�Z d�d;d<�Z!d1ejfd=d>�Z"d?d@�Z#dAdB�Z$d1ejfdCdD�Z%dEdF�Z&dGdH�Z'dIdJ�Z(dKdL�Z)dMdN�Z*dOdP�Z+dQdR�Z,dSdT�Z-dUdV�Z.dWdX�Z/dYdZ�Z0d[d\�Z1d]d^�Z2d_d`�Z3dadb�Z4d�ddde�Z5e6j7Z7dfdg�Z8d�didj�Z9d1ejfdkdl�Z:d1ejfdmdn�Z;dodp�Z<dqdr�Z=d�dsdt�Z>d�dudv�Z?d�dwdx�Z@d�dzd{�ZAd1ejfd|d}�ZBd�d~d�ZCd�d��ZDd�d��ZEd�d��ZFd�d��ZGd�d��ZHdcS)�rcCs<t|t�r||_n&t|t�r.|jdd�|_n
t|�|_dSr%)rnr�rr�r*�seqr!r!r"r@ss


zUserString.__init__cCs
t|j�Sr%)r�rr)r!r!r"�__str__zr�zUserString.__str__cCs
t|j�Sr%r
r)r!r!r"rd{r�zUserString.__repr__cCs
t|j�Sr%)�intrr)r!r!r"�__int__|r�zUserString.__int__cCs
t|j�Sr%)�floatrr)r!r!r"�	__float__}r�zUserString.__float__cCs
t|j�Sr%)�complexrr)r!r!r"�__complex__~r�zUserString.__complex__cCs
t|j�Sr%)�hashrr)r!r!r"�__hash__r�zUserString.__hash__cCs|jdd�fSr%rr)r!r!r"r��szUserString.__getnewargs__cCs t|t�r|j|jkS|j|kSr%�rnrr�r*�stringr!r!r"ro�s
zUserString.__eq__cCs t|t�r|j|jkS|j|kSr%r8r9r!r!r"r�s
zUserString.__lt__cCs t|t�r|j|jkS|j|kSr%r8r9r!r!r"r�s
zUserString.__le__cCs t|t�r|j|jkS|j|kSr%r8r9r!r!r"r�s
zUserString.__gt__cCs t|t�r|j|jkS|j|kSr%r8r9r!r!r"r�s
zUserString.__ge__cCst|t�r|j}||jkSr%r8)r*�charr!r!r"r��s
zUserString.__contains__cCs
t|j�Sr%r	r)r!r!r"r��r�zUserString.__len__cCs|�|j|�Sr%r")r*rr!r!r"r��r�zUserString.__getitem__cCsJt|t�r|�|j|j�St|t�r6|�|j|�S|�|jt|��Sr%)rnrrbrr�rsr!r!r"r��s


zUserString.__add__cCs.t|t�r|�||j�S|�t|�|j�Sr%)rnr�rbrrsr!r!r"r!�s
zUserString.__radd__cCs|�|j|�Sr%r"r�r!r!r"r#�szUserString.__mul__cCs|�|j|�Sr%r"�r*rr!r!r"r��szUserString.__mod__cCs|�t|�|�Sr%)rbr�)r*�templater!r!r"�__rmod__�szUserString.__rmod__cCs|�|j���Sr%)rbr�
capitalizer)r!r!r"r?�r�zUserString.capitalizecCs|�|j���Sr%)rbr�casefoldr)r!r!r"r@�szUserString.casefoldcGs|�|jj|f|���Sr%)rbr�center�r*�widthrr!r!r"rA�szUserString.centerr
cCs t|t�r|j}|j�|||�Sr%)rnrrr��r*�sub�start�endr!r!r"r��s
zUserString.count�utf-8�strictcCs.|dkrdn|}|dkrdn|}|j�||�S)NrHrI)r�encode)r*�encoding�errorsr!r!r"rJ�szUserString.encodecCs|j�|||�Sr%)r�endswith)r*�suffixrFrGr!r!r"rM�szUserString.endswith�cCs|�|j�|��Sr%)rbr�
expandtabs)r*�tabsizer!r!r"rP�szUserString.expandtabscCs t|t�r|j}|j�|||�Sr%)rnrr�findrDr!r!r"rR�s
zUserString.findcOs|jj||�Sr%)rr�r*r!r!r"r��szUserString.formatcCs|j�|�Sr%)r�
format_map)r*r�r!r!r"rS�szUserString.format_mapcCs|j�|||�Sr%r(rDr!r!r"r�szUserString.indexcCs
|j��Sr%)r�isalphar)r!r!r"rT�r�zUserString.isalphacCs
|j��Sr%)r�isalnumr)r!r!r"rU�r�zUserString.isalnumcCs
|j��Sr%)r�isasciir)r!r!r"rV�r�zUserString.isasciicCs
|j��Sr%)r�	isdecimalr)r!r!r"rW�r�zUserString.isdecimalcCs
|j��Sr%)r�isdigitr)r!r!r"rX�r�zUserString.isdigitcCs
|j��Sr%)rr�r)r!r!r"r��r�zUserString.isidentifiercCs
|j��Sr%)r�islowerr)r!r!r"rY�r�zUserString.islowercCs
|j��Sr%)r�	isnumericr)r!r!r"rZ�r�zUserString.isnumericcCs
|j��Sr%)r�isprintabler)r!r!r"r[�r�zUserString.isprintablecCs
|j��Sr%)r�isspacer)r!r!r"r\�r�zUserString.isspacecCs
|j��Sr%)r�istitler)r!r!r"r]�r�zUserString.istitlecCs
|j��Sr%)r�isupperr)r!r!r"r^�r�zUserString.isuppercCs|j�|�Sr%)rr�r-r!r!r"r��r�zUserString.joincGs|�|jj|f|���Sr%)rbr�ljustrBr!r!r"r_�szUserString.ljustcCs|�|j���Sr%)rbr�lowerr)r!r!r"r`�r�zUserString.lowerNcCs|�|j�|��Sr%)rbr�lstrip�r*�charsr!r!r"ra�r�zUserString.lstripcCs|j�|�Sr%)r�	partition�r*�sepr!r!r"rd�szUserString.partitionr�cCs6t|t�r|j}t|t�r |j}|�|j�|||��Sr%)rnrrrbr�)r*�old�new�maxsplitr!r!r"r��s


zUserString.replacecCs t|t�r|j}|j�|||�Sr%)rnrr�rfindrDr!r!r"rj�s
zUserString.rfindcCs|j�|||�Sr%)r�rindexrDr!r!r"rk�szUserString.rindexcGs|�|jj|f|���Sr%)rbr�rjustrBr!r!r"rl�szUserString.rjustcCs|j�|�Sr%)r�
rpartitionrer!r!r"rm�szUserString.rpartitioncCs|�|j�|��Sr%)rbr�rstriprbr!r!r"rn�szUserString.rstripcCs|j�||�Sr%)rr��r*rfrir!r!r"r��szUserString.splitcCs|j�||�Sr%)r�rsplitror!r!r"rp�szUserString.rsplitFcCs|j�|�Sr%)r�
splitlines)r*�keependsr!r!r"rq�r�zUserString.splitlinescCs|j�|||�Sr%)rr�)r*�prefixrFrGr!r!r"r��szUserString.startswithcCs|�|j�|��Sr%)rbr�striprbr!r!r"rt�r�zUserString.stripcCs|�|j���Sr%)rbr�swapcaser)r!r!r"ru�r�zUserString.swapcasecCs|�|j���Sr%)rbr�titler)r!r!r"rv�r�zUserString.titlecGs|�|jj|��Sr%)rbr�	translater<r!r!r"rw�szUserString.translatecCs|�|j���Sr%)rbr�upperr)r!r!r"rx�r�zUserString.uppercCs|�|j�|��Sr%)rbr�zfill)r*rCr!r!r"ry�r�zUserString.zfill)rHrI)rO)N)r�)N)Nr�)Nr�)F)N)Irr-r.r@r/rdr1r3r5r7r�rorrrrr�r�r�r�r!r#r,r�r>r?r@rArR�maxsizer�rJrMrPrRr�rSrrTrUrVrWrXr�rYrZr[r\r]r^r�r_r`rar��	maketransrdr�rjrkrlrmrnr�rprqr�rtrurvrwrxryr!r!r!r"rrs�








)7rtrr�operatorrr~rrr�keywordr
r��sysrR�heapqr��_weakrefrr:�	itertoolsrr�rr�rr��reprlibrry�_collectionsr�ImportError�MutableSequence�registerrr#�KeysViewr$�	ItemsViewr/�
ValuesViewr2rxr3rLrr{rr�rrur	rr�Sequencerr!r!r!r"�<module>sh
�Y&}nMScollections/__pycache__/abc.cpython-38.opt-2.pyc000064400000000301151153537460015413 0ustar00U

e5dD�@sddlTddlmZdS)�)�*)�__all__N)�_collections_abcr�rr�'/usr/lib64/python3.8/collections/abc.py�<module>scollections/__pycache__/__init__.cpython-38.opt-2.pyc000064400000106011151153537460016432 0ustar00U

e5dC��	@s"dddddddddg	Zd	d
lZd	dlmZmZd	dlmZ	d	d
l
Zd	d
lZ
d	d
lmZd	dlmZmZmZd	dlmZzd	dlmZWnek
r�YnXej�e�zd	dlm Z Wnek
r�YnXdd�Z!Gdd�dej"�Z#Gdd�dej$�Z%Gdd�dej&�Z'Gdd�de(�Z)Gdd�de*�Z+zd	dlm+Z+Wnek
�rRYnXzd	dlm,Z,Wnek
�r�dd �Z,YnXd!d
d
d"�d#d�Z-d$d%�Z.zd	d&lm.Z.Wnek
�r�YnXGd'd�de*�Z/Gd(d�dej0�Z1Gd)d�dej0�Z2Gd*d�dej�Z3Gd+d�dej4�Z5d
S),�deque�defaultdict�
namedtuple�UserDict�UserList�
UserString�Counter�OrderedDict�ChainMap�N)�
itemgetter�eq)�	iskeyword)�proxy)�repeat�chain�starmap)�recursive_repr)r)rcCsR|tjkr:tt|�}ddl}|jdtdd�|t�|<|Stdt�d|����dS)Nr
z�Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working���
stacklevelzmodule z has no attribute )	�_collections_abc�__all__�getattr�warnings�warn�DeprecationWarning�globals�AttributeError�__name__)�name�objr�r!�,/usr/lib64/python3.8/collections/__init__.py�__getattr__*s

�
r#c@seZdZdd�ZdS)�_OrderedDictKeysViewccst|j�EdHdS�N��reversed�_mapping��selfr!r!r"�__reversed__?sz!_OrderedDictKeysView.__reversed__N�r�
__module__�__qualname__r+r!r!r!r"r$=sr$c@seZdZdd�ZdS)�_OrderedDictItemsViewccs$t|j�D]}||j|fVq
dSr%r&�r*�keyr!r!r"r+Dsz"_OrderedDictItemsView.__reversed__Nr,r!r!r!r"r/Bsr/c@seZdZdd�ZdS)�_OrderedDictValuesViewccs t|j�D]}|j|Vq
dSr%r&r0r!r!r"r+Jsz#_OrderedDictValuesView.__reversed__Nr,r!r!r!r"r2Hsr2c@seZdZdZdS)�_Link)�prev�nextr1�__weakref__N)rr-r.�	__slots__r!r!r!r"r3Nsr3c@s�eZdZd*dd�Zejeefdd�Zejfdd�Zdd	�Z	d
d�Z
dd
�Zd+dd�Zd,dd�Z
dd�ZejjZZdd�Zdd�Zdd�ZejjZe�Zefdd�Zd-dd�Ze�d d!��Zd"d#�Zd$d%�Zed.d&d'��Z d(d)�Z!dS)/rr!cKs\z
|jWn>tk
rHt�|_t|j�|_}||_|_i|_YnX|j|f|�dSr%)	�_OrderedDict__rootrr3�_OrderedDict__hardroot�_proxyr4r5�_OrderedDict__map�_OrderedDict__update)r*�other�kwds�rootr!r!r"�__init__`s
zOrderedDict.__init__c	CsZ||krJ|�|j|<}|j}|j}||||_|_|_||_||�|_||||�dSr%)r;r8r4r5r1)	r*r1�valueZdict_setitemrZLink�linkr?�lastr!r!r"�__setitem__ms
zOrderedDict.__setitem__cCs>|||�|j�|�}|j}|j}||_||_d|_d|_dSr%)r;�popr4r5)r*r1Zdict_delitemrB�	link_prev�	link_nextr!r!r"�__delitem__{s
zOrderedDict.__delitem__ccs(|j}|j}||k	r$|jV|j}qdSr%)r8r5r1�r*r?Zcurrr!r!r"�__iter__�s
zOrderedDict.__iter__ccs(|j}|j}||k	r$|jV|j}qdSr%)r8r4r1rIr!r!r"r+�s
zOrderedDict.__reversed__cCs*|j}||_|_|j��t�|�dSr%)r8r4r5r;�clear�dict)r*r?r!r!r"rK�s
zOrderedDict.clearTcCsj|std��|j}|r0|j}|j}||_||_n|j}|j}||_||_|j}|j|=t�||�}||fS)Nzdictionary is empty)�KeyErrorr8r4r5r1r;rLrE)r*rCr?rBrFrGr1rAr!r!r"�popitem�s zOrderedDict.popitemc	Cst|j|}|j}|j}|j}||_||_|j}|rR|j}||_||_||_||_n|j}||_||_||_||_dSr%)r;r4r5r8)	r*r1rCrBrFrGZ	soft_linkr?�firstr!r!r"�move_to_end�s$
zOrderedDict.move_to_endcCsVtj}t|�d}||j�}|||j�d7}|||j�|7}|||j�|7}|S)N�r)�_sys�	getsizeof�len�__dict__r;r9r8)r*Zsizeof�n�sizer!r!r"�
__sizeof__�s
zOrderedDict.__sizeof__cCst|�Sr%)r$r)r!r!r"�keys�szOrderedDict.keyscCst|�Sr%)r/r)r!r!r"�items�szOrderedDict.itemscCst|�Sr%)r2r)r!r!r"�values�szOrderedDict.valuescCs0||kr||}||=|S||jkr,t|��|Sr%)�_OrderedDict__markerrM)r*r1�default�resultr!r!r"rE�s
zOrderedDict.popNcCs||kr||S|||<|Sr%r!�r*r1r]r!r!r"�
setdefault�szOrderedDict.setdefaultcCs*|sd|jjfSd|jjt|���fS)N�%s()z%s(%r))�	__class__r�listrZr)r!r!r"�__repr__szOrderedDict.__repr__cCsDt|���}tt��D]}|�|d�q|jd|p4ddt|���fS)Nr!)�vars�copyrrErb�iterrZ)r*Z	inst_dict�kr!r!r"�
__reduce__szOrderedDict.__reduce__cCs
|�|�Sr%�rbr)r!r!r"rfszOrderedDict.copycCs|�}|D]}|||<q
|Sr%r!)�cls�iterablerAr*r1r!r!r"�fromkeyss
zOrderedDict.fromkeyscCs2t|t�r&t�||�o$ttt||��St�||�Sr%)�
isinstancerrL�__eq__�all�map�_eq�r*r=r!r!r"ros
zOrderedDict.__eq__)r!)T)T)N)N)"rr-r.r@rLrDr:r3rHrJr+rKrNrPrXr�MutableMapping�updater<rYrZr[�__ne__�objectr\rEr`�_recursive_reprrdrirf�classmethodrmror!r!r!r"rQs6
�

		

	


)r)�_tuplegettercCstt|�|d�S)N)�doc)�property�_itemgetter)�indexr{r!r!r"�<lambda>7�rF)�rename�defaults�modulecs�t�t�r��dd����ttt����t�t|��}|r�t�}t	��D]B\}}|�
�rrt|�sr|�d�sr||kr�d|���|<|�
|�qH|g�D]D}t|�tk	r�td��|�
�s�td|����t|�r�td|����q�t�}�D]F}|�d��r
|�s
td|����||k�r"td|����|�
|�q�i}|dk	�r|t|�}t|�t��k�r^td	��ttttt��t|�����}tttj����t���t���d
d�dd
�}	dd�dd��D��d�tj�tttttf\�����d|	�d|	�d�}
�d|��d�}t|
|�|d}d|�d|	�d�|_|dk	�r>||_t���fdd��}
d|�d�|
j_��fdd�}d |�d!�|_�fd"d#�}��fd$d%�}�fd&d'�}||
j||||fD]}|�d(|j��|_�q�|�d|	�d�d)�||||
||||d*�}t	��D](\}}t�d+|���}t ||�||<�qt|tf|�}|dk�rvzt�!d�j"�#d,d-�}Wnt$tfk
�rtYnX|dk	�r�||_%|S).N�,� �_z*Type names and field names must be stringsz6Type names and field names must be valid identifiers: z0Type names and field names cannot be a keyword: z-Field names cannot start with an underscore: z"Encountered duplicate field name: z(Got more default values than field names�'�rQ����(�, css|]}|�d�VqdS)z=%rNr!)�.0rr!r!r"�	<genexpr>�sznamedtuple.<locals>.<genexpr>�)zdef __new__(_cls, z): return _tuple_new(_cls, (z))�namedtuple_)�
_tuple_newr�__new__zCreate new instance of cs2�||�}�|��kr.td��dt|�����|S)Nz	Expected z arguments, got )�	TypeErrorrT)rkrlr^)�_len�
num_fields�	tuple_newr!r"�_make�s
znamedtuple.<locals>._makezMake a new z# object from a sequence or iterablecs.|��|j�|��}|r*tdt|�����|S)NzGot unexpected field names: )r�rE�
ValueErrorrc)r*r>r^)�_map�field_namesr!r"�_replace�sznamedtuple.<locals>._replacez
Return a new z2 object replacing specified fields with new valuescs|jj�|Sr%)rbrr))�repr_fmtr!r"rd�sznamedtuple.<locals>.__repr__cs��|j|��Sr%)�_fieldsr))�_dict�_zipr!r"�_asdict�sznamedtuple.<locals>._asdictcs�|�Sr%r!r))�_tupler!r"�__getnewargs__�sz"namedtuple.<locals>.__getnewargs__�.r!)�__doc__r7r��_field_defaults�_fields_defaultsr�r�r�rdr�r�zAlias for field number r�__main__)&rn�str�replace�splitrcrqrR�intern�set�	enumerate�isidentifier�
_iskeyword�
startswith�add�typer�r��tuplerTrLr'�zip�repr�joinr��execr��__defaults__ry�__func__rr.rz�	_getframe�	f_globals�getrr-)�typenamer�r�r�r��seenr~r�field_defaults�arg_list�s�	namespacer�r�r�rdr�r��method�class_namespacer{r^r!)	r�r�r�r�r�r�r�r�r�r"r9s�
���

�


��

cCs&|j}|D]}||d�d||<q
dS�Nr
rQ)r�)�mappingrlZmapping_get�elemr!r!r"�_count_elements�sr�)r�cs�eZdZd.�fdd�	Zdd�Zd/dd�Zdd	�Zed0d
d��Zd1�fdd
�	Z	d2dd�Z
dd�Zdd�Z�fdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Z�ZS)3rNcs tt|���|j|f|�dSr%)�superrr@ru)r*rlr>rjr!r"r@szCounter.__init__cCsdS�Nr
r!r0r!r!r"�__missing__*szCounter.__missing__cCs6|dkrt|��td�dd�Stj||��td�d�S)NrQT)r1�reverse�r1)�sortedrZr}�_heapq�nlargest�r*rVr!r!r"�most_common/s	zCounter.most_commoncCst�tt|����Sr%)�_chain�
from_iterable�_starmap�_repeatrZr)r!r!r"�elements<szCounter.elementscCstd��dS)Nz@Counter.fromkeys() is undefined.  Use Counter(iterable) instead.)�NotImplementedError)rkrl�vr!r!r"rmTs	�zCounter.fromkeyscsr|dk	r`t|tj�rV|rD|j}|��D]\}}|||d�||<q&q`tt|��|�n
t||�|rn|�|�dSr�)	rnr�Mappingr�rZr�rrur��r*rlr>�self_getr��countrjr!r"ru`s
zCounter.updatecKsn|dk	r\|j}t|tj�r@|��D]\}}||d�|||<q"n|D]}||d�d||<qD|rj|�|�dSr�)r�rnrr�rZ�subtractr�r!r!r"r��szCounter.subtractcCs
|�|�Sr%rjr)r!r!r"rf�szCounter.copycCs|jt|�ffSr%)rbrLr)r!r!r"ri�szCounter.__reduce__cs||krt��|�dSr%)r�rH)r*r�rjr!r"rH�szCounter.__delitem__cCsf|sd|jjSz(d�tdj|����}d|jj|fWStk
r`d�|jjt|��YSXdS)Nrar�z%r: %rz%s({%s})z
{0}({1!r}))	rbrr�rq�__mod__r�r��formatrL)r*rZr!r!r"rd�szCounter.__repr__cCspt|t�stSt�}|��D]$\}}|||}|dkr|||<q|��D] \}}||krJ|dkrJ|||<qJ|Sr��rnr�NotImplementedrZ�r*r=r^r�r��newcountr!r!r"�__add__�s


zCounter.__add__cCstt|t�stSt�}|��D]$\}}|||}|dkr|||<q|��D]$\}}||krJ|dkrJd|||<qJ|Sr�r�r�r!r!r"�__sub__�s

zCounter.__sub__cCs|t|t�stSt�}|��D]0\}}||}||kr8|n|}|dkr|||<q|��D] \}}||krV|dkrV|||<qV|Sr�r��r*r=r^r�r��other_countr�r!r!r"�__or__�s


zCounter.__or__cCsRt|t�stSt�}|��D]0\}}||}||kr8|n|}|dkr|||<q|Sr�r�r�r!r!r"�__and__�s

zCounter.__and__cCs,t�}|��D]\}}|dkr|||<q|Sr��rrZ�r*r^r�r�r!r!r"�__pos__
s

zCounter.__pos__cCs0t�}|��D]\}}|dkrd|||<q|Sr�r�r�r!r!r"�__neg__s
zCounter.__neg__cCs&dd�|��D�}|D]
}||=q|S)NcSsg|]\}}|dks|�qS)r
r!)r�r�r�r!r!r"�
<listcomp>"sz*Counter._keep_positive.<locals>.<listcomp>)rZ)r*�nonpositiver�r!r!r"�_keep_positive szCounter._keep_positivecCs*|��D]\}}|||7<q|��Sr%�rZr��r*r=r�r�r!r!r"�__iadd__'s	zCounter.__iadd__cCs*|��D]\}}|||8<q|��Sr%r�r�r!r!r"�__isub__4s	zCounter.__isub__cCs2|��D] \}}||}||kr|||<q|��Sr%r�)r*r=r�r�r�r!r!r"�__ior__As
	
zCounter.__ior__cCs2|��D] \}}||}||kr|||<q|��Sr%r�)r*r=r�r�r�r!r!r"�__iand__Ps
	
zCounter.__iand__)N)N)N)N)N)rr-r.r@r�r�r�ryrmrur�rfrirHrdr�r�r�r�r�r�r�r�r�r�r��
__classcell__r!r!rjr"r�s.3

!


c@s�eZdZdd�Zdd�Zdd�Zd&dd	�Zd
d�Zdd
�Zdd�Z	dd�Z
e�dd��Ze
dd��Zdd�ZeZd'dd�Zedd��Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�ZdS)(r	cGst|�pig|_dSr%)rc�maps)r*r�r!r!r"r@rszChainMap.__init__cCst|��dSr%)rMr0r!r!r"r�yszChainMap.__missing__c	Cs:|jD](}z||WStk
r,YqXq|�|�Sr%)r�rMr�)r*r1r�r!r!r"�__getitem__|s
zChainMap.__getitem__NcCs||kr||S|Sr%r!r_r!r!r"r��szChainMap.getcCstt�j|j��Sr%)rTr��unionr�r)r!r!r"�__len__�szChainMap.__len__cCs&i}t|j�D]}|�|�qt|�Sr%)r'r�rurg)r*�dr�r!r!r"rJ�szChainMap.__iter__cst�fdd�|jD��S)Nc3s|]}�|kVqdSr%r!)r��mr�r!r"r��sz(ChainMap.__contains__.<locals>.<genexpr>��anyr�r0r!r�r"�__contains__�szChainMap.__contains__cCs
t|j�Sr%r�r)r!r!r"�__bool__�szChainMap.__bool__cCs"|jj�dd�tt|j���d�S)Nr�r�r�)rbrr�rqr�r�r)r!r!r"rd�szChainMap.__repr__cGs|tj|f|���Sr%)rLrm)rkrl�argsr!r!r"rm�szChainMap.fromkeyscCs$|j|jd��f|jdd���Sr�)rbr�rfr)r!r!r"rf�sz
ChainMap.copycCs|dkri}|j|f|j��Sr%�rbr�)r*r�r!r!r"�	new_child�szChainMap.new_childcCs|j|jdd��S)NrQrr)r!r!r"�parents�szChainMap.parentscCs||jd|<dSr�)r�)r*r1rAr!r!r"rD�szChainMap.__setitem__cCs8z|jd|=Wn"tk
r2td�|���YnXdS�Nr
z(Key not found in the first mapping: {!r})r�rMr�r0r!r!r"rH�szChainMap.__delitem__cCs2z|jd��WStk
r,td��YnXdS)Nr
z#No keys found in the first mapping.)r�rNrMr)r!r!r"rN�szChainMap.popitemcGs@z|jdj|f|��WStk
r:td�|���YnXdSr)r�rErMr�)r*r1rr!r!r"rE�szChainMap.popcCs|jd��dSr�)r�rKr)r!r!r"rK�szChainMap.clear)N)N)rr-r.r@r�r�r�r�rJrrrxrdryrmrf�__copy__rr|rrDrHrNrErKr!r!r!r"r	ds,




c@speZdZdd�Zde_dd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
eddd��ZdS)rcOs�|std��|^}}t|�dkr0tdt|���|r>|d}n0d|krj|�d�}ddl}|jdtdd�nd}i|_|dk	r�|�|�|r�|�|�dS)	Nz<descriptor '__init__' of 'UserDict' object needs an argumentrQz$expected at most 1 arguments, got %dr
rLz0Passing 'dict' as keyword argument is deprecatedrr)r�rTrErrr�dataru)r�kwargsr*rLrr!r!r"r@�s(

�
zUserDict.__init__z($self, dict=None, /, **kwargs)cCs
t|j�Sr%�rTrr)r!r!r"r��r�zUserDict.__len__cCs:||jkr|j|St|jd�r.|j�||�St|��dS)Nr�)r�hasattrrbr�rMr0r!r!r"r��s


zUserDict.__getitem__cCs||j|<dSr%�r)r*r1�itemr!r!r"rD�r�zUserDict.__setitem__cCs|j|=dSr%rr0r!r!r"rH�r�zUserDict.__delitem__cCs
t|j�Sr%)rgrr)r!r!r"rJ�szUserDict.__iter__cCs
||jkSr%rr0r!r!r"r�szUserDict.__contains__cCs
t|j�Sr%�r�rr)r!r!r"rd�r�zUserDict.__repr__cCs4|j�|j�}|j�|j�|jd��|jd<|S�Nr)rbr�rUrurf�r*�instr!r!r"r�szUserDict.__copy__cCsR|jtkrt|j���Sddl}|j}zi|_|�|�}W5||_X|�|�|Sr�)rbrrrfru)r*rfr�cr!r!r"rfs

z
UserDict.copyNcCs|�}|D]}|||<q
|Sr%r!)rkrlrAr�r1r!r!r"rms
zUserDict.fromkeys)N)rr-r.r@�__text_signature__r�r�rDrHrJrrdrrfryrmr!r!r!r"r�s
c@seZdZd?dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�ZeZd$d%�Zd&d'�Zd(d)�Zd*d+�Zd@d-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z d=d>�Z!dS)ArNcCsbg|_|dk	r^t|�t|j�kr0||jdd�<n.t|t�rT|jdd�|jdd�<n
t|�|_dSr%)rr�rnrrc)r*�initlistr!r!r"r@!s
zUserList.__init__cCs
t|j�Sr%rr)r!r!r"rd+r�zUserList.__repr__cCs|j|�|�kSr%�r�_UserList__castrsr!r!r"�__lt__,r�zUserList.__lt__cCs|j|�|�kSr%rrsr!r!r"�__le__-r�zUserList.__le__cCs|j|�|�kSr%rrsr!r!r"ro.r�zUserList.__eq__cCs|j|�|�kSr%rrsr!r!r"�__gt__/r�zUserList.__gt__cCs|j|�|�kSr%rrsr!r!r"�__ge__0r�zUserList.__ge__cCst|t�r|jS|Sr%)rnrrrsr!r!r"�__cast1szUserList.__castcCs
||jkSr%r�r*r
r!r!r"r3r�zUserList.__contains__cCs
t|j�Sr%r
r)r!r!r"r�4r�zUserList.__len__cCs(t|t�r|�|j|�S|j|SdSr%)rn�slicerbr�r*�ir!r!r"r�5s
zUserList.__getitem__cCs||j|<dSr%r�r*rr
r!r!r"rD:r�zUserList.__setitem__cCs|j|=dSr%rrr!r!r"rH;r�zUserList.__delitem__cCsPt|t�r|�|j|j�St|t|j��r<|�|j|�S|�|jt|��Sr%�rnrrbrr�rcrsr!r!r"r�<s

zUserList.__add__cCsPt|t�r|�|j|j�St|t|j��r<|�||j�S|�t|�|j�Sr%r!rsr!r!r"�__radd__Bs

zUserList.__radd__cCsRt|t�r|j|j7_n2t|t|j��r<|j|7_n|jt|�7_|Sr%)rnrrr�rcrsr!r!r"r�Hs
zUserList.__iadd__cCs|�|j|�Sr%�rbrr�r!r!r"�__mul__PszUserList.__mul__cCs|j|9_|Sr%rr�r!r!r"�__imul__SszUserList.__imul__cCs8|j�|j�}|j�|j�|jddd�|jd<|Sr)rbr�rUrurr!r!r"rVszUserList.__copy__cCs|j�|�dSr%)r�appendrr!r!r"r&\r�zUserList.appendcCs|j�||�dSr%)r�insertr r!r!r"r']r�zUserList.insertr�cCs|j�|�Sr%)rrErr!r!r"rE^r�zUserList.popcCs|j�|�dSr%)r�removerr!r!r"r(_r�zUserList.removecCs|j��dSr%)rrKr)r!r!r"rK`r�zUserList.clearcCs
|�|�Sr%rjr)r!r!r"rfar�z
UserList.copycCs|j�|�Sr%)rr�rr!r!r"r�br�zUserList.countcGs|jj|f|��Sr%�rr~)r*r
rr!r!r"r~cr�zUserList.indexcCs|j��dSr%)rr�r)r!r!r"r�dr�zUserList.reversecOs|jj||�dSr%)r�sort�r*rr>r!r!r"r*er�z
UserList.sortcCs*t|t�r|j�|j�n|j�|�dSr%)rnrr�extendrsr!r!r"r,fs
zUserList.extend)N)r�)"rr-r.r@rdrrrorrrrr�r�rDrHr�r"r�r$�__rmul__r%rr&r'rEr(rKrfr�r~r�r*r,r!r!r!r"rs>


c@sheZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�ZeZd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1ejfd2d3�Zd�d6d7�Zd1ejfd8d9�Z d�d;d<�Z!d1ejfd=d>�Z"d?d@�Z#dAdB�Z$d1ejfdCdD�Z%dEdF�Z&dGdH�Z'dIdJ�Z(dKdL�Z)dMdN�Z*dOdP�Z+dQdR�Z,dSdT�Z-dUdV�Z.dWdX�Z/dYdZ�Z0d[d\�Z1d]d^�Z2d_d`�Z3dadb�Z4d�ddde�Z5e6j7Z7dfdg�Z8d�didj�Z9d1ejfdkdl�Z:d1ejfdmdn�Z;dodp�Z<dqdr�Z=d�dsdt�Z>d�dudv�Z?d�dwdx�Z@d�dzd{�ZAd1ejfd|d}�ZBd�d~d�ZCd�d��ZDd�d��ZEd�d��ZFd�d��ZGd�d��ZHdcS)�rcCs<t|t�r||_n&t|t�r.|jdd�|_n
t|�|_dSr%)rnr�rr�r*�seqr!r!r"r@ss


zUserString.__init__cCs
t|j�Sr%)r�rr)r!r!r"�__str__zr�zUserString.__str__cCs
t|j�Sr%rr)r!r!r"rd{r�zUserString.__repr__cCs
t|j�Sr%)�intrr)r!r!r"�__int__|r�zUserString.__int__cCs
t|j�Sr%)�floatrr)r!r!r"�	__float__}r�zUserString.__float__cCs
t|j�Sr%)�complexrr)r!r!r"�__complex__~r�zUserString.__complex__cCs
t|j�Sr%)�hashrr)r!r!r"�__hash__r�zUserString.__hash__cCs|jdd�fSr%rr)r!r!r"r��szUserString.__getnewargs__cCs t|t�r|j|jkS|j|kSr%�rnrr�r*�stringr!r!r"ro�s
zUserString.__eq__cCs t|t�r|j|jkS|j|kSr%r9r:r!r!r"r�s
zUserString.__lt__cCs t|t�r|j|jkS|j|kSr%r9r:r!r!r"r�s
zUserString.__le__cCs t|t�r|j|jkS|j|kSr%r9r:r!r!r"r�s
zUserString.__gt__cCs t|t�r|j|jkS|j|kSr%r9r:r!r!r"r�s
zUserString.__ge__cCst|t�r|j}||jkSr%r9)r*�charr!r!r"r�s
zUserString.__contains__cCs
t|j�Sr%r
r)r!r!r"r��r�zUserString.__len__cCs|�|j|�Sr%r#)r*r~r!r!r"r��r�zUserString.__getitem__cCsJt|t�r|�|j|j�St|t�r6|�|j|�S|�|jt|��Sr%)rnrrbrr�rsr!r!r"r��s


zUserString.__add__cCs.t|t�r|�||j�S|�t|�|j�Sr%)rnr�rbrrsr!r!r"r"�s
zUserString.__radd__cCs|�|j|�Sr%r#r�r!r!r"r$�szUserString.__mul__cCs|�|j|�Sr%r#�r*rr!r!r"r��szUserString.__mod__cCs|�t|�|�Sr%)rbr�)r*�templater!r!r"�__rmod__�szUserString.__rmod__cCs|�|j���Sr%)rbr�
capitalizer)r!r!r"r@�r�zUserString.capitalizecCs|�|j���Sr%)rbr�casefoldr)r!r!r"rA�szUserString.casefoldcGs|�|jj|f|���Sr%)rbr�center�r*�widthrr!r!r"rB�szUserString.centerr
cCs t|t�r|j}|j�|||�Sr%)rnrrr��r*�sub�start�endr!r!r"r��s
zUserString.count�utf-8�strictcCs.|dkrdn|}|dkrdn|}|j�||�S)NrIrJ)r�encode)r*�encoding�errorsr!r!r"rK�szUserString.encodecCs|j�|||�Sr%)r�endswith)r*�suffixrGrHr!r!r"rN�szUserString.endswith�cCs|�|j�|��Sr%)rbr�
expandtabs)r*�tabsizer!r!r"rQ�szUserString.expandtabscCs t|t�r|j}|j�|||�Sr%)rnrr�findrEr!r!r"rS�s
zUserString.findcOs|jj||�Sr%)rr�r+r!r!r"r��szUserString.formatcCs|j�|�Sr%)r�
format_map)r*r�r!r!r"rT�szUserString.format_mapcCs|j�|||�Sr%r)rEr!r!r"r~�szUserString.indexcCs
|j��Sr%)r�isalphar)r!r!r"rU�r�zUserString.isalphacCs
|j��Sr%)r�isalnumr)r!r!r"rV�r�zUserString.isalnumcCs
|j��Sr%)r�isasciir)r!r!r"rW�r�zUserString.isasciicCs
|j��Sr%)r�	isdecimalr)r!r!r"rX�r�zUserString.isdecimalcCs
|j��Sr%)r�isdigitr)r!r!r"rY�r�zUserString.isdigitcCs
|j��Sr%)rr�r)r!r!r"r��r�zUserString.isidentifiercCs
|j��Sr%)r�islowerr)r!r!r"rZ�r�zUserString.islowercCs
|j��Sr%)r�	isnumericr)r!r!r"r[�r�zUserString.isnumericcCs
|j��Sr%)r�isprintabler)r!r!r"r\�r�zUserString.isprintablecCs
|j��Sr%)r�isspacer)r!r!r"r]�r�zUserString.isspacecCs
|j��Sr%)r�istitler)r!r!r"r^�r�zUserString.istitlecCs
|j��Sr%)r�isupperr)r!r!r"r_�r�zUserString.isuppercCs|j�|�Sr%)rr�r.r!r!r"r��r�zUserString.joincGs|�|jj|f|���Sr%)rbr�ljustrCr!r!r"r`�szUserString.ljustcCs|�|j���Sr%)rbr�lowerr)r!r!r"ra�r�zUserString.lowerNcCs|�|j�|��Sr%)rbr�lstrip�r*�charsr!r!r"rb�r�zUserString.lstripcCs|j�|�Sr%)r�	partition�r*�sepr!r!r"re�szUserString.partitionr�cCs6t|t�r|j}t|t�r |j}|�|j�|||��Sr%)rnrrrbr�)r*�old�new�maxsplitr!r!r"r��s


zUserString.replacecCs t|t�r|j}|j�|||�Sr%)rnrr�rfindrEr!r!r"rk�s
zUserString.rfindcCs|j�|||�Sr%)r�rindexrEr!r!r"rl�szUserString.rindexcGs|�|jj|f|���Sr%)rbr�rjustrCr!r!r"rm�szUserString.rjustcCs|j�|�Sr%)r�
rpartitionrfr!r!r"rn�szUserString.rpartitioncCs|�|j�|��Sr%)rbr�rstriprcr!r!r"ro�szUserString.rstripcCs|j�||�Sr%)rr��r*rgrjr!r!r"r��szUserString.splitcCs|j�||�Sr%)r�rsplitrpr!r!r"rq�szUserString.rsplitFcCs|j�|�Sr%)r�
splitlines)r*�keependsr!r!r"rr�r�zUserString.splitlinescCs|j�|||�Sr%)rr�)r*�prefixrGrHr!r!r"r��szUserString.startswithcCs|�|j�|��Sr%)rbr�striprcr!r!r"ru�r�zUserString.stripcCs|�|j���Sr%)rbr�swapcaser)r!r!r"rv�r�zUserString.swapcasecCs|�|j���Sr%)rbr�titler)r!r!r"rw�r�zUserString.titlecGs|�|jj|��Sr%)rbr�	translater=r!r!r"rx�szUserString.translatecCs|�|j���Sr%)rbr�upperr)r!r!r"ry�r�zUserString.uppercCs|�|j�|��Sr%)rbr�zfill)r*rDr!r!r"rz�r�zUserString.zfill)rIrJ)rP)N)r�)N)Nr�)Nr�)F)N)Irr-r.r@r0rdr2r4r6r8r�rorrrrrr�r�r�r"r$r-r�r?r@rArBrR�maxsizer�rKrNrQrSr�rTr~rUrVrWrXrYr�rZr[r\r]r^r_r�r`rarbr��	maketransrer�rkrlrmrnror�rqrrr�rurvrwrxryrzr!r!r!r"rrs�








)6rr�operatorrr}rrr�keywordr
r��sysrR�heapqr��_weakrefrr:�	itertoolsrr�rr�rr��reprlibrrx�_collectionsr�ImportError�MutableSequence�registerrr#�KeysViewr$�	ItemsViewr/�
ValuesViewr2rwr3rLrrzrr�rrtr	rr�Sequencerr!r!r!r"�<module>sf
�Y&}nMScollections/__pycache__/__init__.cpython-38.pyc000064400000132546151153537460015506 0ustar00U

e5dC��	@s&dZddddddddd	g	Zd
dlZd
dlmZmZd
d
lm	Z
d
dlZd
dl
Zd
dlmZd
dlmZmZmZd
dlmZzd
dlmZWnek
r�YnXej� e�zd
dlm!Z!Wnek
r�YnXdd�Z"Gdd�dej#�Z$Gdd�dej%�Z&Gdd�dej'�Z(Gdd�de)�Z*Gdd�de+�Z,zd
dlm,Z,Wnek
�rVYnXzd
dlm-Z-Wnek
�r�d d!�Z-YnXd"ddd#�d$d�Z.d%d&�Z/zd
d'lm/Z/Wnek
�r�YnXGd(d�de+�Z0Gd)d	�d	ej1�Z2Gd*d�dej1�Z3Gd+d�dej�Z4Gd,d�dej5�Z6dS)-a?This module implements specialized container datatypes providing
alternatives to Python's general purpose built-in containers, dict,
list, set, and tuple.

* namedtuple   factory function for creating tuple subclasses with named fields
* deque        list-like container with fast appends and pops on either end
* ChainMap     dict-like class for creating a single view of multiple mappings
* Counter      dict subclass for counting hashable objects
* OrderedDict  dict subclass that remembers the order entries were added
* defaultdict  dict subclass that calls a factory function to supply missing values
* UserDict     wrapper around dictionary objects for easier dict subclassing
* UserList     wrapper around list objects for easier list subclassing
* UserString   wrapper around string objects for easier string subclassing

�deque�defaultdict�
namedtuple�UserDict�UserList�
UserString�Counter�OrderedDict�ChainMap�N)�
itemgetter�eq)�	iskeyword)�proxy)�repeat�chain�starmap)�recursive_repr)r)rcCsR|tjkr:tt|�}ddl}|jdtdd�|t�|<|Stdt�d|����dS)Nr
z�Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working���
stacklevelzmodule z has no attribute )	�_collections_abc�__all__�getattr�warnings�warn�DeprecationWarning�globals�AttributeError�__name__)�name�objr�r!�,/usr/lib64/python3.8/collections/__init__.py�__getattr__*s

�
r#c@seZdZdd�ZdS)�_OrderedDictKeysViewccst|j�EdHdS�N��reversed�_mapping��selfr!r!r"�__reversed__?sz!_OrderedDictKeysView.__reversed__N�r�
__module__�__qualname__r+r!r!r!r"r$=sr$c@seZdZdd�ZdS)�_OrderedDictItemsViewccs$t|j�D]}||j|fVq
dSr%r&�r*�keyr!r!r"r+Dsz"_OrderedDictItemsView.__reversed__Nr,r!r!r!r"r/Bsr/c@seZdZdd�ZdS)�_OrderedDictValuesViewccs t|j�D]}|j|Vq
dSr%r&r0r!r!r"r+Jsz#_OrderedDictValuesView.__reversed__Nr,r!r!r!r"r2Hsr2c@seZdZdZdS)�_Link)�prev�nextr1�__weakref__N)rr-r.�	__slots__r!r!r!r"r3Nsr3c@s�eZdZdZd+dd�Zejeefdd�Zej	fdd�Z	d	d
�Z
dd�Zd
d�Zd,dd�Z
d-dd�Zdd�ZejjZZdd�Zdd�Zdd�ZejjZe�Zefdd�Zd.dd �Ze�d!d"��Zd#d$�Zd%d&�Ze d/d'd(��Z!d)d*�Z"dS)0rz)Dictionary that remembers insertion orderr!cKs\z
|jWn>tk
rHt�|_t|j�|_}||_|_i|_YnX|j|f|�dS)z�Initialize an ordered dictionary.  The signature is the same as
        regular dictionaries.  Keyword argument order is preserved.
        N)	�_OrderedDict__rootrr3�_OrderedDict__hardroot�_proxyr4r5�_OrderedDict__map�_OrderedDict__update)r*�other�kwds�rootr!r!r"�__init__`s
zOrderedDict.__init__c	CsZ||krJ|�|j|<}|j}|j}||||_|_|_||_||�|_||||�dS)z!od.__setitem__(i, y) <==> od[i]=yN)r;r8r4r5r1)	r*r1�valueZdict_setitemrZLink�linkr?�lastr!r!r"�__setitem__ms
zOrderedDict.__setitem__cCs>|||�|j�|�}|j}|j}||_||_d|_d|_dS)z od.__delitem__(y) <==> del od[y]N)r;�popr4r5)r*r1Zdict_delitemrB�	link_prev�	link_nextr!r!r"�__delitem__{s
zOrderedDict.__delitem__ccs(|j}|j}||k	r$|jV|j}qdS)zod.__iter__() <==> iter(od)N)r8r5r1�r*r?Zcurrr!r!r"�__iter__�s
zOrderedDict.__iter__ccs(|j}|j}||k	r$|jV|j}qdS)z#od.__reversed__() <==> reversed(od)N)r8r4r1rIr!r!r"r+�s
zOrderedDict.__reversed__cCs*|j}||_|_|j��t�|�dS)z.od.clear() -> None.  Remove all items from od.N)r8r4r5r;�clear�dict)r*r?r!r!r"rK�s
zOrderedDict.clearTcCsj|std��|j}|r0|j}|j}||_||_n|j}|j}||_||_|j}|j|=t�||�}||fS)z�Remove and return a (key, value) pair from the dictionary.

        Pairs are returned in LIFO order if last is true or FIFO order if false.
        zdictionary is empty)�KeyErrorr8r4r5r1r;rLrE)r*rCr?rBrFrGr1rAr!r!r"�popitem�s zOrderedDict.popitemc	Cst|j|}|j}|j}|j}||_||_|j}|rR|j}||_||_||_||_n|j}||_||_||_||_dS)z�Move an existing element to the end (or beginning if last is false).

        Raise KeyError if the element does not exist.
        N)r;r4r5r8)	r*r1rCrBrFrGZ	soft_linkr?�firstr!r!r"�move_to_end�s$
zOrderedDict.move_to_endcCsVtj}t|�d}||j�}|||j�d7}|||j�|7}|||j�|7}|S)N�r)�_sys�	getsizeof�len�__dict__r;r9r8)r*Zsizeof�n�sizer!r!r"�
__sizeof__�s
zOrderedDict.__sizeof__cCst|�S)z:D.keys() -> a set-like object providing a view on D's keys)r$r)r!r!r"�keys�szOrderedDict.keyscCst|�S)z<D.items() -> a set-like object providing a view on D's items)r/r)r!r!r"�items�szOrderedDict.itemscCst|�S)z6D.values() -> an object providing a view on D's values)r2r)r!r!r"�values�szOrderedDict.valuescCs0||kr||}||=|S||jkr,t|��|S)z�od.pop(k[,d]) -> v, remove specified key and return the corresponding
        value.  If key is not found, d is returned if given, otherwise KeyError
        is raised.

        )�_OrderedDict__markerrM)r*r1�default�resultr!r!r"rE�s
zOrderedDict.popNcCs||kr||S|||<|S)z�Insert key with a value of default if key is not in the dictionary.

        Return the value for key if key is in the dictionary, else default.
        r!�r*r1r]r!r!r"�
setdefault�szOrderedDict.setdefaultcCs*|sd|jjfSd|jjt|���fS)zod.__repr__() <==> repr(od)�%s()z%s(%r))�	__class__r�listrZr)r!r!r"�__repr__szOrderedDict.__repr__cCsDt|���}tt��D]}|�|d�q|jd|p4ddt|���fS)z%Return state information for picklingNr!)�vars�copyrrErb�iterrZ)r*Z	inst_dict�kr!r!r"�
__reduce__szOrderedDict.__reduce__cCs
|�|�S)z!od.copy() -> a shallow copy of od�rbr)r!r!r"rfszOrderedDict.copycCs|�}|D]}|||<q
|S)zYCreate a new ordered dictionary with keys from iterable and values set to value.
        r!)�cls�iterablerAr*r1r!r!r"�fromkeyss
zOrderedDict.fromkeyscCs2t|t�r&t�||�o$ttt||��St�||�S)z�od.__eq__(y) <==> od==y.  Comparison to another OD is order-sensitive
        while comparison to a regular mapping is order-insensitive.

        )�
isinstancerrL�__eq__�all�map�_eq�r*r=r!r!r"ros
zOrderedDict.__eq__)r!)T)T)N)N)#rr-r.�__doc__r@rLrDr:r3rHrJr+rKrNrPrXr�MutableMapping�updater<rYrZr[�__ne__�objectr\rEr`�_recursive_reprrdrirf�classmethodrmror!r!r!r"rQs8
�

		

	


)r)�_tuplegettercCstt|�|d�S)N)�doc)�property�_itemgetter)�indexr|r!r!r"�<lambda>7�r�F)�rename�defaults�modulecs�t�t�r��dd����ttt����t�t|��}|r�t�}t	��D]B\}}|�
�rrt|�sr|�d�sr||kr�d|���|<|�
|�qH|g�D]D}t|�tk	r�td��|�
�s�td|����t|�r�td|����q�t�}�D]F}|�d��r
|�s
td|����||k�r"td|����|�
|�q�i}|d	k	�r|t|�}t|�t��k�r^td
��ttttt��t|�����}tttj����t���t���dd�d
d�}	dd�dd��D��d�tj�tttttf\�����d|	�d|	�d�}
�d|��d�}t|
|�|d}d|�d|	�d�|_|d	k	�r>||_t���fdd��}
d|�d�|
j_��fdd �}d!|�d"�|_�fd#d$�}��fd%d&�}�fd'd(�}||
j||||fD]}|�d)|j��|_�q�|�d|	�d�d*�||||
||||d+�}t	��D](\}}t�d,|���}t ||�||<�qt|tf|�}|d	k�rvzt�!d
�j"�#d-d.�}Wnt$tfk
�rtYnX|d	k	�r�||_%|S)/aCReturns a new subclass of tuple with named fields.

    >>> Point = namedtuple('Point', ['x', 'y'])
    >>> Point.__doc__                   # docstring for the new class
    'Point(x, y)'
    >>> p = Point(11, y=22)             # instantiate with positional args or keywords
    >>> p[0] + p[1]                     # indexable like a plain tuple
    33
    >>> x, y = p                        # unpack like a regular tuple
    >>> x, y
    (11, 22)
    >>> p.x + p.y                       # fields also accessible by name
    33
    >>> d = p._asdict()                 # convert to a dictionary
    >>> d['x']
    11
    >>> Point(**d)                      # convert from a dictionary
    Point(x=11, y=22)
    >>> p._replace(x=100)               # _replace() is like str.replace() but targets named fields
    Point(x=100, y=22)

    �,� �_z*Type names and field names must be stringsz6Type names and field names must be valid identifiers: z0Type names and field names cannot be a keyword: z-Field names cannot start with an underscore: z"Encountered duplicate field name: Nz(Got more default values than field names�'�rQ����(�, css|]}|�d�VqdS)z=%rNr!)�.0rr!r!r"�	<genexpr>�sznamedtuple.<locals>.<genexpr>�)zdef __new__(_cls, z): return _tuple_new(_cls, (z))�namedtuple_)�
_tuple_newr�__new__zCreate new instance of cs2�||�}�|��kr.td��dt|�����|S)Nz	Expected z arguments, got )�	TypeErrorrT)rkrlr^)�_len�
num_fields�	tuple_newr!r"�_make�s
znamedtuple.<locals>._makezMake a new z# object from a sequence or iterablecs.|��|j�|��}|r*tdt|�����|S)NzGot unexpected field names: )r�rE�
ValueErrorrc)r*r>r^)�_map�field_namesr!r"�_replace�sznamedtuple.<locals>._replacez
Return a new z2 object replacing specified fields with new valuescs|jj�|S)z/Return a nicely formatted representation string)rbrr))�repr_fmtr!r"rd�sznamedtuple.<locals>.__repr__cs��|j|��S)z9Return a new dict which maps field names to their values.)�_fieldsr))�_dict�_zipr!r"�_asdict�sznamedtuple.<locals>._asdictcs�|�S)z7Return self as a plain tuple.  Used by copy and pickle.r!r))�_tupler!r"�__getnewargs__�sz"namedtuple.<locals>.__getnewargs__�.r!)rtr7r��_field_defaults�_fields_defaultsr�r�r�rdr�r�zAlias for field number r�__main__)&rn�str�replace�splitrcrqrR�intern�set�	enumerate�isidentifier�
_iskeyword�
startswith�add�typer�r��tuplerTrLr'�zip�repr�joinr��execrt�__defaults__rz�__func__rr.r{�	_getframe�	f_globals�getrr-)�typenamer�r�r�r��seenrr�field_defaults�arg_list�s�	namespacer�r�r�rdr�r��method�class_namespacer|r^r!)	r�r�r�r�r�r�r�r�r�r"r9s�
���

�


��

cCs&|j}|D]}||d�d||<q
dS)z!Tally elements from the iterable.r
rQN)r�)�mappingrlZmapping_get�elemr!r!r"�_count_elements�sr�)r�cs�eZdZdZd/�fdd�	Zdd�Zd0dd�Zd	d
�Zed1dd��Z	d2�fd
d�	Z
d3dd�Zdd�Zdd�Z
�fdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Z�ZS)4ra�Dict subclass for counting hashable items.  Sometimes called a bag
    or multiset.  Elements are stored as dictionary keys and their counts
    are stored as dictionary values.

    >>> c = Counter('abcdeabcdabcaba')  # count elements from a string

    >>> c.most_common(3)                # three most common elements
    [('a', 5), ('b', 4), ('c', 3)]
    >>> sorted(c)                       # list all unique elements
    ['a', 'b', 'c', 'd', 'e']
    >>> ''.join(sorted(c.elements()))   # list elements with repetitions
    'aaaaabbbbcccdde'
    >>> sum(c.values())                 # total of all counts
    15

    >>> c['a']                          # count of letter 'a'
    5
    >>> for elem in 'shazam':           # update counts from an iterable
    ...     c[elem] += 1                # by adding 1 to each element's count
    >>> c['a']                          # now there are seven 'a'
    7
    >>> del c['b']                      # remove all 'b'
    >>> c['b']                          # now there are zero 'b'
    0

    >>> d = Counter('simsalabim')       # make another counter
    >>> c.update(d)                     # add in the second counter
    >>> c['a']                          # now there are nine 'a'
    9

    >>> c.clear()                       # empty the counter
    >>> c
    Counter()

    Note:  If a count is set to zero or reduced to zero, it will remain
    in the counter until the entry is deleted or the counter is cleared:

    >>> c = Counter('aaabbc')
    >>> c['b'] -= 2                     # reduce the count of 'b' by two
    >>> c.most_common()                 # 'b' is still in, but its count is zero
    [('a', 3), ('c', 1), ('b', 0)]

    Ncs tt|���|j|f|�dS)a	Create a new, empty Counter object.  And if given, count elements
        from an input iterable.  Or, initialize the count from another mapping
        of elements to their counts.

        >>> c = Counter()                           # a new, empty counter
        >>> c = Counter('gallahad')                 # a new counter from an iterable
        >>> c = Counter({'a': 4, 'b': 2})           # a new counter from a mapping
        >>> c = Counter(a=4, b=2)                   # a new counter from keyword args

        N)�superrr@rv)r*rlr>rjr!r"r@szCounter.__init__cCsdS)z1The count of elements not in the Counter is zero.r
r!r0r!r!r"�__missing__*szCounter.__missing__cCs6|dkrt|��td�dd�Stj||��td�d�S)z�List the n most common elements and their counts from the most
        common to the least.  If n is None, then list all element counts.

        >>> Counter('abracadabra').most_common(3)
        [('a', 5), ('b', 2), ('r', 2)]

        NrQT)r1�reverse�r1)�sortedrZr~�_heapq�nlargest�r*rVr!r!r"�most_common/s	zCounter.most_commoncCst�tt|����S)a�Iterator over elements repeating each as many times as its count.

        >>> c = Counter('ABCABC')
        >>> sorted(c.elements())
        ['A', 'A', 'B', 'B', 'C', 'C']

        # Knuth's example for prime factors of 1836:  2**2 * 3**3 * 17**1
        >>> prime_factors = Counter({2: 2, 3: 3, 17: 1})
        >>> product = 1
        >>> for factor in prime_factors.elements():     # loop over factors
        ...     product *= factor                       # and multiply them
        >>> product
        1836

        Note, if an element's count has been set to zero or is a negative
        number, elements() will ignore it.

        )�_chain�
from_iterable�_starmap�_repeatrZr)r!r!r"�elements<szCounter.elementscCstd��dS)Nz@Counter.fromkeys() is undefined.  Use Counter(iterable) instead.)�NotImplementedError)rkrl�vr!r!r"rmTs	�zCounter.fromkeyscsr|dk	r`t|tj�rV|rD|j}|��D]\}}|||d�||<q&q`tt|��|�n
t||�|rn|�|�dS)a�Like dict.update() but add counts instead of replacing them.

        Source can be an iterable, a dictionary, or another Counter instance.

        >>> c = Counter('which')
        >>> c.update('witch')           # add elements from another iterable
        >>> d = Counter('watch')
        >>> c.update(d)                 # add elements from another counter
        >>> c['h']                      # four 'h' in which, witch, and watch
        4

        Nr
)	rnr�Mappingr�rZr�rrvr��r*rlr>�self_getr��countrjr!r"rv`s
zCounter.updatecKsn|dk	r\|j}t|tj�r@|��D]\}}||d�|||<q"n|D]}||d�d||<qD|rj|�|�dS)a�Like dict.update() but subtracts counts instead of replacing them.
        Counts can be reduced below zero.  Both the inputs and outputs are
        allowed to contain zero and negative counts.

        Source can be an iterable, a dictionary, or another Counter instance.

        >>> c = Counter('which')
        >>> c.subtract('witch')             # subtract elements from another iterable
        >>> c.subtract(Counter('watch'))    # subtract elements from another counter
        >>> c['h']                          # 2 in which, minus 1 in witch, minus 1 in watch
        0
        >>> c['w']                          # 1 in which, minus 1 in witch, minus 1 in watch
        -1

        Nr
rQ)r�rnrr�rZ�subtractr�r!r!r"r��szCounter.subtractcCs
|�|�S)zReturn a shallow copy.rjr)r!r!r"rf�szCounter.copycCs|jt|�ffSr%)rbrLr)r!r!r"ri�szCounter.__reduce__cs||krt��|�dS)zGLike dict.__delitem__() but does not raise KeyError for missing values.N)r�rH)r*r�rjr!r"rH�szCounter.__delitem__cCsf|sd|jjSz(d�tdj|����}d|jj|fWStk
r`d�|jjt|��YSXdS)Nrar�z%r: %rz%s({%s})z
{0}({1!r}))	rbrr�rq�__mod__r�r��formatrL)r*rZr!r!r"rd�szCounter.__repr__cCspt|t�stSt�}|��D]$\}}|||}|dkr|||<q|��D] \}}||krJ|dkrJ|||<qJ|S)zAdd counts from two counters.

        >>> Counter('abbb') + Counter('bcc')
        Counter({'b': 4, 'c': 2, 'a': 1})

        r
�rnr�NotImplementedrZ�r*r=r^r�r��newcountr!r!r"�__add__�s


zCounter.__add__cCstt|t�stSt�}|��D]$\}}|||}|dkr|||<q|��D]$\}}||krJ|dkrJd|||<qJ|S)z� Subtract count, but keep only results with positive counts.

        >>> Counter('abbbc') - Counter('bccd')
        Counter({'b': 2, 'a': 1})

        r
r�r�r!r!r"�__sub__�s

zCounter.__sub__cCs|t|t�stSt�}|��D]0\}}||}||kr8|n|}|dkr|||<q|��D] \}}||krV|dkrV|||<qV|S)z�Union is the maximum of value in either of the input counters.

        >>> Counter('abbb') | Counter('bcc')
        Counter({'b': 3, 'c': 2, 'a': 1})

        r
r��r*r=r^r�r��other_countr�r!r!r"�__or__�s


zCounter.__or__cCsRt|t�stSt�}|��D]0\}}||}||kr8|n|}|dkr|||<q|S)z� Intersection is the minimum of corresponding counts.

        >>> Counter('abbb') & Counter('bcc')
        Counter({'b': 1})

        r
r�r�r!r!r"�__and__�s

zCounter.__and__cCs,t�}|��D]\}}|dkr|||<q|S)zEAdds an empty counter, effectively stripping negative and zero countsr
�rrZ�r*r^r�r�r!r!r"�__pos__
s

zCounter.__pos__cCs0t�}|��D]\}}|dkrd|||<q|S)z{Subtracts from an empty counter.  Strips positive and zero counts,
        and flips the sign on negative counts.

        r
r�r�r!r!r"�__neg__s
zCounter.__neg__cCs&dd�|��D�}|D]
}||=q|S)z?Internal method to strip elements with a negative or zero countcSsg|]\}}|dks|�qS)r
r!)r�r�r�r!r!r"�
<listcomp>"sz*Counter._keep_positive.<locals>.<listcomp>)rZ)r*�nonpositiver�r!r!r"�_keep_positive szCounter._keep_positivecCs*|��D]\}}|||7<q|��S)z�Inplace add from another counter, keeping only positive counts.

        >>> c = Counter('abbb')
        >>> c += Counter('bcc')
        >>> c
        Counter({'b': 4, 'c': 2, 'a': 1})

        �rZr��r*r=r�r�r!r!r"�__iadd__'s	zCounter.__iadd__cCs*|��D]\}}|||8<q|��S)z�Inplace subtract counter, but keep only results with positive counts.

        >>> c = Counter('abbbc')
        >>> c -= Counter('bccd')
        >>> c
        Counter({'b': 2, 'a': 1})

        r�r�r!r!r"�__isub__4s	zCounter.__isub__cCs2|��D] \}}||}||kr|||<q|��S)z�Inplace union is the maximum of value from either counter.

        >>> c = Counter('abbb')
        >>> c |= Counter('bcc')
        >>> c
        Counter({'b': 3, 'c': 2, 'a': 1})

        r�)r*r=r�r�r�r!r!r"�__ior__As
	
zCounter.__ior__cCs2|��D] \}}||}||kr|||<q|��S)z�Inplace intersection is the minimum of corresponding counts.

        >>> c = Counter('abbb')
        >>> c &= Counter('bcc')
        >>> c
        Counter({'b': 1})

        r�)r*r=r�r�r�r!r!r"�__iand__Ps
	
zCounter.__iand__)N)N)N)N)N)rr-r.rtr@r�r�r�rzrmrvr�rfrirHrdr�r�r�r�r�r�r�r�r�r�r��
__classcell__r!r!rjr"r�s02

!


c@s�eZdZdZdd�Zdd�Zdd�Zd'd	d
�Zdd�Zd
d�Z	dd�Z
dd�Ze�dd��Z
edd��Zdd�ZeZd(dd�Zedd��Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�ZdS))r	a� A ChainMap groups multiple dicts (or other mappings) together
    to create a single, updateable view.

    The underlying mappings are stored in a list.  That list is public and can
    be accessed or updated using the *maps* attribute.  There is no other
    state.

    Lookups search the underlying mappings successively until a key is found.
    In contrast, writes, updates, and deletions only operate on the first
    mapping.

    cGst|�pig|_dS)z�Initialize a ChainMap by setting *maps* to the given mappings.
        If no mappings are provided, a single empty dictionary is used.

        N)rc�maps)r*r�r!r!r"r@rszChainMap.__init__cCst|��dSr%)rMr0r!r!r"r�yszChainMap.__missing__c	Cs:|jD](}z||WStk
r,YqXq|�|�Sr%)r�rMr�)r*r1r�r!r!r"�__getitem__|s
zChainMap.__getitem__NcCs||kr||S|Sr%r!r_r!r!r"r��szChainMap.getcCstt�j|j��Sr%)rTr��unionr�r)r!r!r"�__len__�szChainMap.__len__cCs&i}t|j�D]}|�|�qt|�Sr%)r'r�rvrg)r*�dr�r!r!r"rJ�szChainMap.__iter__cst�fdd�|jD��S)Nc3s|]}�|kVqdSr%r!)r��mr�r!r"r��sz(ChainMap.__contains__.<locals>.<genexpr>��anyr�r0r!r�r"�__contains__�szChainMap.__contains__cCs
t|j�Sr%r�r)r!r!r"�__bool__�szChainMap.__bool__cCs"|jj�dd�tt|j���d�S)Nr�r�r�)rbrr�rqr�r�r)r!r!r"rd�szChainMap.__repr__cGs|tj|f|���S)z?Create a ChainMap with a single dict created from the iterable.)rLrm)rkrl�argsr!r!r"rm�szChainMap.fromkeyscCs$|j|jd��f|jdd���S)zHNew ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]r
rQN)rbr�rfr)r!r!r"rf�sz
ChainMap.copycCs|dkri}|j|f|j��S)zyNew ChainMap with a new map followed by all previous maps.
        If no map is provided, an empty dict is used.
        N�rbr�)r*r�r!r!r"�	new_child�szChainMap.new_childcCs|j|jdd��S)zNew ChainMap from maps[1:].rQNrr)r!r!r"�parents�szChainMap.parentscCs||jd|<dS�Nr
)r�)r*r1rAr!r!r"rD�szChainMap.__setitem__cCs8z|jd|=Wn"tk
r2td�|���YnXdS)Nr
�(Key not found in the first mapping: {!r})r�rMr�r0r!r!r"rH�szChainMap.__delitem__cCs2z|jd��WStk
r,td��YnXdS)zPRemove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.r
z#No keys found in the first mapping.N)r�rNrMr)r!r!r"rN�szChainMap.popitemcGs@z|jdj|f|��WStk
r:td�|���YnXdS)zWRemove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].r
rN)r�rErMr�)r*r1rr!r!r"rE�szChainMap.popcCs|jd��dS)z'Clear maps[0], leaving maps[1:] intact.r
N)r�rKr)r!r!r"rK�szChainMap.clear)N)N)rr-r.rtr@r�r�r�r�rJr�r�ryrdrzrmrf�__copy__rr}rrDrHrNrErKr!r!r!r"r	ds.





c@speZdZdd�Zde_dd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
eddd��ZdS)rcOs�|std��|^}}t|�dkr0tdt|���|r>|d}n0d|krj|�d�}ddl}|jdtdd�nd}i|_|dk	r�|�|�|r�|�|�dS)	Nz<descriptor '__init__' of 'UserDict' object needs an argumentrQz$expected at most 1 arguments, got %dr
rLz0Passing 'dict' as keyword argument is deprecatedrr)r�rTrErrr�datarv)r�kwargsr*rLrr!r!r"r@�s(

�
zUserDict.__init__z($self, dict=None, /, **kwargs)cCs
t|j�Sr%�rTrr)r!r!r"r��r�zUserDict.__len__cCs:||jkr|j|St|jd�r.|j�||�St|��dS)Nr�)r�hasattrrbr�rMr0r!r!r"r��s


zUserDict.__getitem__cCs||j|<dSr%�r)r*r1�itemr!r!r"rD�r�zUserDict.__setitem__cCs|j|=dSr%rr0r!r!r"rH�r�zUserDict.__delitem__cCs
t|j�Sr%)rgrr)r!r!r"rJ�szUserDict.__iter__cCs
||jkSr%rr0r!r!r"r��szUserDict.__contains__cCs
t|j�Sr%�r�rr)r!r!r"rd�r�zUserDict.__repr__cCs4|j�|j�}|j�|j�|jd��|jd<|S�Nr)rbr�rUrvrf�r*�instr!r!r"r�szUserDict.__copy__cCsR|jtkrt|j���Sddl}|j}zi|_|�|�}W5||_X|�|�|Sr)rbrrrfrv)r*rfr�cr!r!r"rfs

z
UserDict.copyNcCs|�}|D]}|||<q
|Sr%r!)rkrlrAr�r1r!r!r"rms
zUserDict.fromkeys)N)rr-r.r@�__text_signature__r�r�rDrHrJr�rdrrfrzrmr!r!r!r"r�s
c@seZdZdZd@dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�ZeZd%d&�Zd'd(�Zd)d*�Zd+d,�ZdAd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Z d<d=�Z!d>d?�Z"dS)BrzAA more or less complete user-defined wrapper around list objects.NcCsbg|_|dk	r^t|�t|j�kr0||jdd�<n.t|t�rT|jdd�|jdd�<n
t|�|_dSr%)rr�rnrrc)r*�initlistr!r!r"r@!s
zUserList.__init__cCs
t|j�Sr%r
r)r!r!r"rd+r�zUserList.__repr__cCs|j|�|�kSr%�r�_UserList__castrsr!r!r"�__lt__,r�zUserList.__lt__cCs|j|�|�kSr%rrsr!r!r"�__le__-r�zUserList.__le__cCs|j|�|�kSr%rrsr!r!r"ro.r�zUserList.__eq__cCs|j|�|�kSr%rrsr!r!r"�__gt__/r�zUserList.__gt__cCs|j|�|�kSr%rrsr!r!r"�__ge__0r�zUserList.__ge__cCst|t�r|jS|Sr%)rnrrrsr!r!r"�__cast1szUserList.__castcCs
||jkSr%r�r*rr!r!r"r�3r�zUserList.__contains__cCs
t|j�Sr%r	r)r!r!r"r�4r�zUserList.__len__cCs(t|t�r|�|j|�S|j|SdSr%)rn�slicerbr�r*�ir!r!r"r�5s
zUserList.__getitem__cCs||j|<dSr%r�r*rrr!r!r"rD:r�zUserList.__setitem__cCs|j|=dSr%rrr!r!r"rH;r�zUserList.__delitem__cCsPt|t�r|�|j|j�St|t|j��r<|�|j|�S|�|jt|��Sr%�rnrrbrr�rcrsr!r!r"r�<s

zUserList.__add__cCsPt|t�r|�|j|j�St|t|j��r<|�||j�S|�t|�|j�Sr%r rsr!r!r"�__radd__Bs

zUserList.__radd__cCsRt|t�r|j|j7_n2t|t|j��r<|j|7_n|jt|�7_|Sr%)rnrrr�rcrsr!r!r"r�Hs
zUserList.__iadd__cCs|�|j|�Sr%�rbrr�r!r!r"�__mul__PszUserList.__mul__cCs|j|9_|Sr%rr�r!r!r"�__imul__SszUserList.__imul__cCs8|j�|j�}|j�|j�|jddd�|jd<|Sr)rbr�rUrvrr!r!r"rVszUserList.__copy__cCs|j�|�dSr%)r�appendrr!r!r"r%\r�zUserList.appendcCs|j�||�dSr%)r�insertrr!r!r"r&]r�zUserList.insertr�cCs|j�|�Sr%)rrErr!r!r"rE^r�zUserList.popcCs|j�|�dSr%)r�removerr!r!r"r'_r�zUserList.removecCs|j��dSr%)rrKr)r!r!r"rK`r�zUserList.clearcCs
|�|�Sr%rjr)r!r!r"rfar�z
UserList.copycCs|j�|�Sr%)rr�rr!r!r"r�br�zUserList.countcGs|jj|f|��Sr%�rr)r*rrr!r!r"rcr�zUserList.indexcCs|j��dSr%)rr�r)r!r!r"r�dr�zUserList.reversecOs|jj||�dSr%)r�sort�r*rr>r!r!r"r)er�z
UserList.sortcCs*t|t�r|j�|j�n|j�|�dSr%)rnrr�extendrsr!r!r"r+fs
zUserList.extend)N)r�)#rr-r.rtr@rdrrrorrrr�r�r�rDrHr�r!r�r#�__rmul__r$rr%r&rEr'rKrfr�rr�r)r+r!r!r!r"rs@


c@sheZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�ZeZd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1ejfd2d3�Zd�d6d7�Zd1ejfd8d9�Z d�d;d<�Z!d1ejfd=d>�Z"d?d@�Z#dAdB�Z$d1ejfdCdD�Z%dEdF�Z&dGdH�Z'dIdJ�Z(dKdL�Z)dMdN�Z*dOdP�Z+dQdR�Z,dSdT�Z-dUdV�Z.dWdX�Z/dYdZ�Z0d[d\�Z1d]d^�Z2d_d`�Z3dadb�Z4d�ddde�Z5e6j7Z7dfdg�Z8d�didj�Z9d1ejfdkdl�Z:d1ejfdmdn�Z;dodp�Z<dqdr�Z=d�dsdt�Z>d�dudv�Z?d�dwdx�Z@d�dzd{�ZAd1ejfd|d}�ZBd�d~d�ZCd�d��ZDd�d��ZEd�d��ZFd�d��ZGd�d��ZHdcS)�rcCs<t|t�r||_n&t|t�r.|jdd�|_n
t|�|_dSr%)rnr�rr�r*�seqr!r!r"r@ss


zUserString.__init__cCs
t|j�Sr%)r�rr)r!r!r"�__str__zr�zUserString.__str__cCs
t|j�Sr%r
r)r!r!r"rd{r�zUserString.__repr__cCs
t|j�Sr%)�intrr)r!r!r"�__int__|r�zUserString.__int__cCs
t|j�Sr%)�floatrr)r!r!r"�	__float__}r�zUserString.__float__cCs
t|j�Sr%)�complexrr)r!r!r"�__complex__~r�zUserString.__complex__cCs
t|j�Sr%)�hashrr)r!r!r"�__hash__r�zUserString.__hash__cCs|jdd�fSr%rr)r!r!r"r��szUserString.__getnewargs__cCs t|t�r|j|jkS|j|kSr%�rnrr�r*�stringr!r!r"ro�s
zUserString.__eq__cCs t|t�r|j|jkS|j|kSr%r8r9r!r!r"r�s
zUserString.__lt__cCs t|t�r|j|jkS|j|kSr%r8r9r!r!r"r�s
zUserString.__le__cCs t|t�r|j|jkS|j|kSr%r8r9r!r!r"r�s
zUserString.__gt__cCs t|t�r|j|jkS|j|kSr%r8r9r!r!r"r�s
zUserString.__ge__cCst|t�r|j}||jkSr%r8)r*�charr!r!r"r��s
zUserString.__contains__cCs
t|j�Sr%r	r)r!r!r"r��r�zUserString.__len__cCs|�|j|�Sr%r")r*rr!r!r"r��r�zUserString.__getitem__cCsJt|t�r|�|j|j�St|t�r6|�|j|�S|�|jt|��Sr%)rnrrbrr�rsr!r!r"r��s


zUserString.__add__cCs.t|t�r|�||j�S|�t|�|j�Sr%)rnr�rbrrsr!r!r"r!�s
zUserString.__radd__cCs|�|j|�Sr%r"r�r!r!r"r#�szUserString.__mul__cCs|�|j|�Sr%r"�r*rr!r!r"r��szUserString.__mod__cCs|�t|�|�Sr%)rbr�)r*�templater!r!r"�__rmod__�szUserString.__rmod__cCs|�|j���Sr%)rbr�
capitalizer)r!r!r"r?�r�zUserString.capitalizecCs|�|j���Sr%)rbr�casefoldr)r!r!r"r@�szUserString.casefoldcGs|�|jj|f|���Sr%)rbr�center�r*�widthrr!r!r"rA�szUserString.centerr
cCs t|t�r|j}|j�|||�Sr%)rnrrr��r*�sub�start�endr!r!r"r��s
zUserString.count�utf-8�strictcCs.|dkrdn|}|dkrdn|}|j�||�S)NrHrI)r�encode)r*�encoding�errorsr!r!r"rJ�szUserString.encodecCs|j�|||�Sr%)r�endswith)r*�suffixrFrGr!r!r"rM�szUserString.endswith�cCs|�|j�|��Sr%)rbr�
expandtabs)r*�tabsizer!r!r"rP�szUserString.expandtabscCs t|t�r|j}|j�|||�Sr%)rnrr�findrDr!r!r"rR�s
zUserString.findcOs|jj||�Sr%)rr�r*r!r!r"r��szUserString.formatcCs|j�|�Sr%)r�
format_map)r*r�r!r!r"rS�szUserString.format_mapcCs|j�|||�Sr%r(rDr!r!r"r�szUserString.indexcCs
|j��Sr%)r�isalphar)r!r!r"rT�r�zUserString.isalphacCs
|j��Sr%)r�isalnumr)r!r!r"rU�r�zUserString.isalnumcCs
|j��Sr%)r�isasciir)r!r!r"rV�r�zUserString.isasciicCs
|j��Sr%)r�	isdecimalr)r!r!r"rW�r�zUserString.isdecimalcCs
|j��Sr%)r�isdigitr)r!r!r"rX�r�zUserString.isdigitcCs
|j��Sr%)rr�r)r!r!r"r��r�zUserString.isidentifiercCs
|j��Sr%)r�islowerr)r!r!r"rY�r�zUserString.islowercCs
|j��Sr%)r�	isnumericr)r!r!r"rZ�r�zUserString.isnumericcCs
|j��Sr%)r�isprintabler)r!r!r"r[�r�zUserString.isprintablecCs
|j��Sr%)r�isspacer)r!r!r"r\�r�zUserString.isspacecCs
|j��Sr%)r�istitler)r!r!r"r]�r�zUserString.istitlecCs
|j��Sr%)r�isupperr)r!r!r"r^�r�zUserString.isuppercCs|j�|�Sr%)rr�r-r!r!r"r��r�zUserString.joincGs|�|jj|f|���Sr%)rbr�ljustrBr!r!r"r_�szUserString.ljustcCs|�|j���Sr%)rbr�lowerr)r!r!r"r`�r�zUserString.lowerNcCs|�|j�|��Sr%)rbr�lstrip�r*�charsr!r!r"ra�r�zUserString.lstripcCs|j�|�Sr%)r�	partition�r*�sepr!r!r"rd�szUserString.partitionr�cCs6t|t�r|j}t|t�r |j}|�|j�|||��Sr%)rnrrrbr�)r*�old�new�maxsplitr!r!r"r��s


zUserString.replacecCs t|t�r|j}|j�|||�Sr%)rnrr�rfindrDr!r!r"rj�s
zUserString.rfindcCs|j�|||�Sr%)r�rindexrDr!r!r"rk�szUserString.rindexcGs|�|jj|f|���Sr%)rbr�rjustrBr!r!r"rl�szUserString.rjustcCs|j�|�Sr%)r�
rpartitionrer!r!r"rm�szUserString.rpartitioncCs|�|j�|��Sr%)rbr�rstriprbr!r!r"rn�szUserString.rstripcCs|j�||�Sr%)rr��r*rfrir!r!r"r��szUserString.splitcCs|j�||�Sr%)r�rsplitror!r!r"rp�szUserString.rsplitFcCs|j�|�Sr%)r�
splitlines)r*�keependsr!r!r"rq�r�zUserString.splitlinescCs|j�|||�Sr%)rr�)r*�prefixrFrGr!r!r"r��szUserString.startswithcCs|�|j�|��Sr%)rbr�striprbr!r!r"rt�r�zUserString.stripcCs|�|j���Sr%)rbr�swapcaser)r!r!r"ru�r�zUserString.swapcasecCs|�|j���Sr%)rbr�titler)r!r!r"rv�r�zUserString.titlecGs|�|jj|��Sr%)rbr�	translater<r!r!r"rw�szUserString.translatecCs|�|j���Sr%)rbr�upperr)r!r!r"rx�r�zUserString.uppercCs|�|j�|��Sr%)rbr�zfill)r*rCr!r!r"ry�r�zUserString.zfill)rHrI)rO)N)r�)N)Nr�)Nr�)F)N)Irr-r.r@r/rdr1r3r5r7r�rorrrrr�r�r�r�r!r#r,r�r>r?r@rArR�maxsizer�rJrMrPrRr�rSrrTrUrVrWrXr�rYrZr[r\r]r^r�r_r`rar��	maketransrdr�rjrkrlrmrnr�rprqr�rtrurvrwrxryr!r!r!r"rrs�








)7rtrr�operatorrr~rrr�keywordr
r��sysrR�heapqr��_weakrefrr:�	itertoolsrr�rr�rr��reprlibrry�_collectionsr�ImportError�MutableSequence�registerrr#�KeysViewr$�	ItemsViewr/�
ValuesViewr2rxr3rLrr{rr�rrur	rr�Sequencerr!r!r!r"�<module>sh
�Y&}nMScollections/__pycache__/abc.cpython-38.opt-1.pyc000064400000000301151153537460015412 0ustar00U

e5dD�@sddlTddlmZdS)�)�*)�__all__N)�_collections_abcr�rr�'/usr/lib64/python3.8/collections/abc.py�<module>scollections/abc.py000064400000000104151153537460010166 0ustar00from _collections_abc import *
from _collections_abc import __all__
keyword.py000064400000001661151153537460006620 0ustar00"""Keywords (from "Grammar/Grammar")

This file is automatically generated; please don't muck it up!

To update the symbols in this file, 'cd' to the top directory of
the python source tree and run:

    python3 -m Parser.pgen.keywordgen Grammar/Grammar \
                                      Grammar/Tokens \
                                      Lib/keyword.py

Alternatively, you can run 'make regen-keyword'.
"""

__all__ = ["iskeyword", "kwlist"]

kwlist = [
    'False',
    'None',
    'True',
    'and',
    'as',
    'assert',
    'async',
    'await',
    'break',
    'class',
    'continue',
    'def',
    'del',
    'elif',
    'else',
    'except',
    'finally',
    'for',
    'from',
    'global',
    'if',
    'import',
    'in',
    'is',
    'lambda',
    'nonlocal',
    'not',
    'or',
    'pass',
    'raise',
    'return',
    'try',
    'while',
    'with',
    'yield'
]

iskeyword = frozenset(kwlist).__contains__
struct.py000064400000000401151153537460006447 0ustar00__all__ = [
    # Functions
    'calcsize', 'pack', 'pack_into', 'unpack', 'unpack_from',
    'iter_unpack',

    # Classes
    'Struct',

    # Exceptions
    'error'
    ]

from _struct import *
from _struct import _clearcache
from _struct import __doc__
typing.py000064400000206542151153537460006453 0ustar00"""
The typing module: Support for gradual typing as defined by PEP 484.

At large scale, the structure of the module is following:
* Imports and exports, all public names should be explicitly added to __all__.
* Internal helper functions: these should never be used in code outside this module.
* _SpecialForm and its instances (special forms): Any, NoReturn, ClassVar, Union, Optional
* Two classes whose instances can be type arguments in addition to types: ForwardRef and TypeVar
* The core of internal generics API: _GenericAlias and _VariadicGenericAlias, the latter is
  currently only used by Tuple and Callable. All subscripted types like X[int], Union[int, str],
  etc., are instances of either of these classes.
* The public counterpart of the generics API consists of two classes: Generic and Protocol.
* Public helper functions: get_type_hints, overload, cast, no_type_check,
  no_type_check_decorator.
* Generic aliases for collections.abc ABCs and few additional protocols.
* Special types: NewType, NamedTuple, TypedDict.
* Wrapper submodules for re and io related types.
"""

from abc import abstractmethod, ABCMeta
import collections
import collections.abc
import contextlib
import functools
import operator
import re as stdlib_re  # Avoid confusion with the re we export.
import sys
import types
from types import WrapperDescriptorType, MethodWrapperType, MethodDescriptorType

# Please keep __all__ alphabetized within each category.
__all__ = [
    # Super-special typing primitives.
    'Any',
    'Callable',
    'ClassVar',
    'Final',
    'ForwardRef',
    'Generic',
    'Literal',
    'Optional',
    'Protocol',
    'Tuple',
    'Type',
    'TypeVar',
    'Union',

    # ABCs (from collections.abc).
    'AbstractSet',  # collections.abc.Set.
    'ByteString',
    'Container',
    'ContextManager',
    'Hashable',
    'ItemsView',
    'Iterable',
    'Iterator',
    'KeysView',
    'Mapping',
    'MappingView',
    'MutableMapping',
    'MutableSequence',
    'MutableSet',
    'Sequence',
    'Sized',
    'ValuesView',
    'Awaitable',
    'AsyncIterator',
    'AsyncIterable',
    'Coroutine',
    'Collection',
    'AsyncGenerator',
    'AsyncContextManager',

    # Structural checks, a.k.a. protocols.
    'Reversible',
    'SupportsAbs',
    'SupportsBytes',
    'SupportsComplex',
    'SupportsFloat',
    'SupportsIndex',
    'SupportsInt',
    'SupportsRound',

    # Concrete collection types.
    'ChainMap',
    'Counter',
    'Deque',
    'Dict',
    'DefaultDict',
    'List',
    'OrderedDict',
    'Set',
    'FrozenSet',
    'NamedTuple',  # Not really a type.
    'TypedDict',  # Not really a type.
    'Generator',

    # One-off things.
    'AnyStr',
    'cast',
    'final',
    'get_args',
    'get_origin',
    'get_type_hints',
    'NewType',
    'no_type_check',
    'no_type_check_decorator',
    'NoReturn',
    'overload',
    'runtime_checkable',
    'Text',
    'TYPE_CHECKING',
]

# The pseudo-submodules 're' and 'io' are part of the public
# namespace, but excluded from __all__ because they might stomp on
# legitimate imports of those modules.


def _type_check(arg, msg, is_argument=True):
    """Check that the argument is a type, and return it (internal helper).

    As a special case, accept None and return type(None) instead. Also wrap strings
    into ForwardRef instances. Consider several corner cases, for example plain
    special forms like Union are not valid, while Union[int, str] is OK, etc.
    The msg argument is a human-readable error message, e.g::

        "Union[arg, ...]: arg should be a type."

    We append the repr() of the actual value (truncated to 100 chars).
    """
    invalid_generic_forms = (Generic, Protocol)
    if is_argument:
        invalid_generic_forms = invalid_generic_forms + (ClassVar, Final)

    if arg is None:
        return type(None)
    if isinstance(arg, str):
        return ForwardRef(arg)
    if (isinstance(arg, _GenericAlias) and
            arg.__origin__ in invalid_generic_forms):
        raise TypeError(f"{arg} is not valid as type argument")
    if (isinstance(arg, _SpecialForm) and arg not in (Any, NoReturn) or
            arg in (Generic, Protocol)):
        raise TypeError(f"Plain {arg} is not valid as type argument")
    if isinstance(arg, (type, TypeVar, ForwardRef)):
        return arg
    if not callable(arg):
        raise TypeError(f"{msg} Got {arg!r:.100}.")
    return arg


def _type_repr(obj):
    """Return the repr() of an object, special-casing types (internal helper).

    If obj is a type, we return a shorter version than the default
    type.__repr__, based on the module and qualified name, which is
    typically enough to uniquely identify a type.  For everything
    else, we fall back on repr(obj).
    """
    if isinstance(obj, type):
        if obj.__module__ == 'builtins':
            return obj.__qualname__
        return f'{obj.__module__}.{obj.__qualname__}'
    if obj is ...:
        return('...')
    if isinstance(obj, types.FunctionType):
        return obj.__name__
    return repr(obj)


def _collect_type_vars(types):
    """Collect all type variable contained in types in order of
    first appearance (lexicographic order). For example::

        _collect_type_vars((T, List[S, T])) == (T, S)
    """
    tvars = []
    for t in types:
        if isinstance(t, TypeVar) and t not in tvars:
            tvars.append(t)
        if isinstance(t, _GenericAlias) and not t._special:
            tvars.extend([t for t in t.__parameters__ if t not in tvars])
    return tuple(tvars)


def _subs_tvars(tp, tvars, subs):
    """Substitute type variables 'tvars' with substitutions 'subs'.
    These two must have the same length.
    """
    if not isinstance(tp, _GenericAlias):
        return tp
    new_args = list(tp.__args__)
    for a, arg in enumerate(tp.__args__):
        if isinstance(arg, TypeVar):
            for i, tvar in enumerate(tvars):
                if arg == tvar:
                    new_args[a] = subs[i]
        else:
            new_args[a] = _subs_tvars(arg, tvars, subs)
    if tp.__origin__ is Union:
        return Union[tuple(new_args)]
    return tp.copy_with(tuple(new_args))


def _check_generic(cls, parameters):
    """Check correct count for parameters of a generic cls (internal helper).
    This gives a nice error message in case of count mismatch.
    """
    if not cls.__parameters__:
        raise TypeError(f"{cls} is not a generic class")
    alen = len(parameters)
    elen = len(cls.__parameters__)
    if alen != elen:
        raise TypeError(f"Too {'many' if alen > elen else 'few'} parameters for {cls};"
                        f" actual {alen}, expected {elen}")


def _remove_dups_flatten(parameters):
    """An internal helper for Union creation and substitution: flatten Unions
    among parameters, then remove duplicates.
    """
    # Flatten out Union[Union[...], ...].
    params = []
    for p in parameters:
        if isinstance(p, _GenericAlias) and p.__origin__ is Union:
            params.extend(p.__args__)
        elif isinstance(p, tuple) and len(p) > 0 and p[0] is Union:
            params.extend(p[1:])
        else:
            params.append(p)
    # Weed out strict duplicates, preserving the first of each occurrence.
    all_params = set(params)
    if len(all_params) < len(params):
        new_params = []
        for t in params:
            if t in all_params:
                new_params.append(t)
                all_params.remove(t)
        params = new_params
        assert not all_params, all_params
    return tuple(params)


_cleanups = []


def _tp_cache(func):
    """Internal wrapper caching __getitem__ of generic types with a fallback to
    original function for non-hashable arguments.
    """
    cached = functools.lru_cache()(func)
    _cleanups.append(cached.cache_clear)

    @functools.wraps(func)
    def inner(*args, **kwds):
        try:
            return cached(*args, **kwds)
        except TypeError:
            pass  # All real errors (not unhashable args) are raised below.
        return func(*args, **kwds)
    return inner


def _eval_type(t, globalns, localns):
    """Evaluate all forward references in the given type t.
    For use of globalns and localns see the docstring for get_type_hints().
    """
    if isinstance(t, ForwardRef):
        return t._evaluate(globalns, localns)
    if isinstance(t, _GenericAlias):
        ev_args = tuple(_eval_type(a, globalns, localns) for a in t.__args__)
        if ev_args == t.__args__:
            return t
        res = t.copy_with(ev_args)
        res._special = t._special
        return res
    return t


class _Final:
    """Mixin to prohibit subclassing"""

    __slots__ = ('__weakref__',)

    def __init_subclass__(self, /, *args, **kwds):
        if '_root' not in kwds:
            raise TypeError("Cannot subclass special typing classes")

class _Immutable:
    """Mixin to indicate that object should not be copied."""

    def __copy__(self):
        return self

    def __deepcopy__(self, memo):
        return self


class _SpecialForm(_Final, _Immutable, _root=True):
    """Internal indicator of special typing constructs.
    See _doc instance attribute for specific docs.
    """

    __slots__ = ('_name', '_doc')

    def __new__(cls, *args, **kwds):
        """Constructor.

        This only exists to give a better error message in case
        someone tries to subclass a special typing object (not a good idea).
        """
        if (len(args) == 3 and
                isinstance(args[0], str) and
                isinstance(args[1], tuple)):
            # Close enough.
            raise TypeError(f"Cannot subclass {cls!r}")
        return super().__new__(cls)

    def __init__(self, name, doc):
        self._name = name
        self._doc = doc

    def __eq__(self, other):
        if not isinstance(other, _SpecialForm):
            return NotImplemented
        return self._name == other._name

    def __hash__(self):
        return hash((self._name,))

    def __repr__(self):
        return 'typing.' + self._name

    def __reduce__(self):
        return self._name

    def __call__(self, *args, **kwds):
        raise TypeError(f"Cannot instantiate {self!r}")

    def __instancecheck__(self, obj):
        raise TypeError(f"{self} cannot be used with isinstance()")

    def __subclasscheck__(self, cls):
        raise TypeError(f"{self} cannot be used with issubclass()")

    @_tp_cache
    def __getitem__(self, parameters):
        if self._name in ('ClassVar', 'Final'):
            item = _type_check(parameters, f'{self._name} accepts only single type.')
            return _GenericAlias(self, (item,))
        if self._name == 'Union':
            if parameters == ():
                raise TypeError("Cannot take a Union of no types.")
            if not isinstance(parameters, tuple):
                parameters = (parameters,)
            msg = "Union[arg, ...]: each arg must be a type."
            parameters = tuple(_type_check(p, msg) for p in parameters)
            parameters = _remove_dups_flatten(parameters)
            if len(parameters) == 1:
                return parameters[0]
            return _GenericAlias(self, parameters)
        if self._name == 'Optional':
            arg = _type_check(parameters, "Optional[t] requires a single type.")
            return Union[arg, type(None)]
        if self._name == 'Literal':
            # There is no '_type_check' call because arguments to Literal[...] are
            # values, not types.
            return _GenericAlias(self, parameters)
        raise TypeError(f"{self} is not subscriptable")


Any = _SpecialForm('Any', doc=
    """Special type indicating an unconstrained type.

    - Any is compatible with every type.
    - Any assumed to have all methods.
    - All values assumed to be instances of Any.

    Note that all the above statements are true from the point of view of
    static type checkers. At runtime, Any should not be used with instance
    or class checks.
    """)

NoReturn = _SpecialForm('NoReturn', doc=
    """Special type indicating functions that never return.
    Example::

      from typing import NoReturn

      def stop() -> NoReturn:
          raise Exception('no way')

    This type is invalid in other positions, e.g., ``List[NoReturn]``
    will fail in static type checkers.
    """)

ClassVar = _SpecialForm('ClassVar', doc=
    """Special type construct to mark class variables.

    An annotation wrapped in ClassVar indicates that a given
    attribute is intended to be used as a class variable and
    should not be set on instances of that class. Usage::

      class Starship:
          stats: ClassVar[Dict[str, int]] = {} # class variable
          damage: int = 10                     # instance variable

    ClassVar accepts only types and cannot be further subscribed.

    Note that ClassVar is not a class itself, and should not
    be used with isinstance() or issubclass().
    """)

Final = _SpecialForm('Final', doc=
    """Special typing construct to indicate final names to type checkers.

    A final name cannot be re-assigned or overridden in a subclass.
    For example:

      MAX_SIZE: Final = 9000
      MAX_SIZE += 1  # Error reported by type checker

      class Connection:
          TIMEOUT: Final[int] = 10

      class FastConnector(Connection):
          TIMEOUT = 1  # Error reported by type checker

    There is no runtime checking of these properties.
    """)

Union = _SpecialForm('Union', doc=
    """Union type; Union[X, Y] means either X or Y.

    To define a union, use e.g. Union[int, str].  Details:
    - The arguments must be types and there must be at least one.
    - None as an argument is a special case and is replaced by
      type(None).
    - Unions of unions are flattened, e.g.::

        Union[Union[int, str], float] == Union[int, str, float]

    - Unions of a single argument vanish, e.g.::

        Union[int] == int  # The constructor actually returns int

    - Redundant arguments are skipped, e.g.::

        Union[int, str, int] == Union[int, str]

    - When comparing unions, the argument order is ignored, e.g.::

        Union[int, str] == Union[str, int]

    - You cannot subclass or instantiate a union.
    - You can use Optional[X] as a shorthand for Union[X, None].
    """)

Optional = _SpecialForm('Optional', doc=
    """Optional type.

    Optional[X] is equivalent to Union[X, None].
    """)

Literal = _SpecialForm('Literal', doc=
    """Special typing form to define literal types (a.k.a. value types).

    This form can be used to indicate to type checkers that the corresponding
    variable or function parameter has a value equivalent to the provided
    literal (or one of several literals):

      def validate_simple(data: Any) -> Literal[True]:  # always returns True
          ...

      MODE = Literal['r', 'rb', 'w', 'wb']
      def open_helper(file: str, mode: MODE) -> str:
          ...

      open_helper('/some/path', 'r')  # Passes type check
      open_helper('/other/path', 'typo')  # Error in type checker

   Literal[...] cannot be subclassed. At runtime, an arbitrary value
   is allowed as type argument to Literal[...], but type checkers may
   impose restrictions.
    """)


class ForwardRef(_Final, _root=True):
    """Internal wrapper to hold a forward reference."""

    __slots__ = ('__forward_arg__', '__forward_code__',
                 '__forward_evaluated__', '__forward_value__',
                 '__forward_is_argument__')

    def __init__(self, arg, is_argument=True):
        if not isinstance(arg, str):
            raise TypeError(f"Forward reference must be a string -- got {arg!r}")
        try:
            code = compile(arg, '<string>', 'eval')
        except SyntaxError:
            raise SyntaxError(f"Forward reference must be an expression -- got {arg!r}")
        self.__forward_arg__ = arg
        self.__forward_code__ = code
        self.__forward_evaluated__ = False
        self.__forward_value__ = None
        self.__forward_is_argument__ = is_argument

    def _evaluate(self, globalns, localns):
        if not self.__forward_evaluated__ or localns is not globalns:
            if globalns is None and localns is None:
                globalns = localns = {}
            elif globalns is None:
                globalns = localns
            elif localns is None:
                localns = globalns
            self.__forward_value__ = _type_check(
                eval(self.__forward_code__, globalns, localns),
                "Forward references must evaluate to types.",
                is_argument=self.__forward_is_argument__)
            self.__forward_evaluated__ = True
        return self.__forward_value__

    def __eq__(self, other):
        if not isinstance(other, ForwardRef):
            return NotImplemented
        if self.__forward_evaluated__ and other.__forward_evaluated__:
            return (self.__forward_arg__ == other.__forward_arg__ and
                    self.__forward_value__ == other.__forward_value__)
        return self.__forward_arg__ == other.__forward_arg__

    def __hash__(self):
        return hash(self.__forward_arg__)

    def __repr__(self):
        return f'ForwardRef({self.__forward_arg__!r})'


class TypeVar(_Final, _Immutable, _root=True):
    """Type variable.

    Usage::

      T = TypeVar('T')  # Can be anything
      A = TypeVar('A', str, bytes)  # Must be str or bytes

    Type variables exist primarily for the benefit of static type
    checkers.  They serve as the parameters for generic types as well
    as for generic function definitions.  See class Generic for more
    information on generic types.  Generic functions work as follows:

      def repeat(x: T, n: int) -> List[T]:
          '''Return a list containing n references to x.'''
          return [x]*n

      def longest(x: A, y: A) -> A:
          '''Return the longest of two strings.'''
          return x if len(x) >= len(y) else y

    The latter example's signature is essentially the overloading
    of (str, str) -> str and (bytes, bytes) -> bytes.  Also note
    that if the arguments are instances of some subclass of str,
    the return type is still plain str.

    At runtime, isinstance(x, T) and issubclass(C, T) will raise TypeError.

    Type variables defined with covariant=True or contravariant=True
    can be used to declare covariant or contravariant generic types.
    See PEP 484 for more details. By default generic types are invariant
    in all type variables.

    Type variables can be introspected. e.g.:

      T.__name__ == 'T'
      T.__constraints__ == ()
      T.__covariant__ == False
      T.__contravariant__ = False
      A.__constraints__ == (str, bytes)

    Note that only type variables defined in global scope can be pickled.
    """

    __slots__ = ('__name__', '__bound__', '__constraints__',
                 '__covariant__', '__contravariant__')

    def __init__(self, name, *constraints, bound=None,
                 covariant=False, contravariant=False):
        self.__name__ = name
        if covariant and contravariant:
            raise ValueError("Bivariant types are not supported.")
        self.__covariant__ = bool(covariant)
        self.__contravariant__ = bool(contravariant)
        if constraints and bound is not None:
            raise TypeError("Constraints cannot be combined with bound=...")
        if constraints and len(constraints) == 1:
            raise TypeError("A single constraint is not allowed")
        msg = "TypeVar(name, constraint, ...): constraints must be types."
        self.__constraints__ = tuple(_type_check(t, msg) for t in constraints)
        if bound:
            self.__bound__ = _type_check(bound, "Bound must be a type.")
        else:
            self.__bound__ = None
        try:
            def_mod = sys._getframe(1).f_globals.get('__name__', '__main__')  # for pickling
        except (AttributeError, ValueError):
            def_mod = None
        if def_mod != 'typing':
            self.__module__ = def_mod

    def __repr__(self):
        if self.__covariant__:
            prefix = '+'
        elif self.__contravariant__:
            prefix = '-'
        else:
            prefix = '~'
        return prefix + self.__name__

    def __reduce__(self):
        return self.__name__


# Special typing constructs Union, Optional, Generic, Callable and Tuple
# use three special attributes for internal bookkeeping of generic types:
# * __parameters__ is a tuple of unique free type parameters of a generic
#   type, for example, Dict[T, T].__parameters__ == (T,);
# * __origin__ keeps a reference to a type that was subscripted,
#   e.g., Union[T, int].__origin__ == Union, or the non-generic version of
#   the type.
# * __args__ is a tuple of all arguments used in subscripting,
#   e.g., Dict[T, int].__args__ == (T, int).


# Mapping from non-generic type names that have a generic alias in typing
# but with a different name.
_normalize_alias = {'list': 'List',
                    'tuple': 'Tuple',
                    'dict': 'Dict',
                    'set': 'Set',
                    'frozenset': 'FrozenSet',
                    'deque': 'Deque',
                    'defaultdict': 'DefaultDict',
                    'type': 'Type',
                    'Set': 'AbstractSet'}

def _is_dunder(attr):
    return attr.startswith('__') and attr.endswith('__')


class _GenericAlias(_Final, _root=True):
    """The central part of internal API.

    This represents a generic version of type 'origin' with type arguments 'params'.
    There are two kind of these aliases: user defined and special. The special ones
    are wrappers around builtin collections and ABCs in collections.abc. These must
    have 'name' always set. If 'inst' is False, then the alias can't be instantiated,
    this is used by e.g. typing.List and typing.Dict.
    """
    def __init__(self, origin, params, *, inst=True, special=False, name=None):
        self._inst = inst
        self._special = special
        if special and name is None:
            orig_name = origin.__name__
            name = _normalize_alias.get(orig_name, orig_name)
        self._name = name
        if not isinstance(params, tuple):
            params = (params,)
        self.__origin__ = origin
        self.__args__ = tuple(... if a is _TypingEllipsis else
                              () if a is _TypingEmpty else
                              a for a in params)
        self.__parameters__ = _collect_type_vars(params)
        self.__slots__ = None  # This is not documented.
        if not name:
            self.__module__ = origin.__module__

    @_tp_cache
    def __getitem__(self, params):
        if self.__origin__ in (Generic, Protocol):
            # Can't subscript Generic[...] or Protocol[...].
            raise TypeError(f"Cannot subscript already-subscripted {self}")
        if not isinstance(params, tuple):
            params = (params,)
        msg = "Parameters to generic types must be types."
        params = tuple(_type_check(p, msg) for p in params)
        _check_generic(self, params)
        return _subs_tvars(self, self.__parameters__, params)

    def copy_with(self, params):
        # We don't copy self._special.
        return _GenericAlias(self.__origin__, params, name=self._name, inst=self._inst)

    def __repr__(self):
        if (self._name != 'Callable' or
                len(self.__args__) == 2 and self.__args__[0] is Ellipsis):
            if self._name:
                name = 'typing.' + self._name
            else:
                name = _type_repr(self.__origin__)
            if not self._special:
                args = f'[{", ".join([_type_repr(a) for a in self.__args__])}]'
            else:
                args = ''
            return (f'{name}{args}')
        if self._special:
            return 'typing.Callable'
        return (f'typing.Callable'
                f'[[{", ".join([_type_repr(a) for a in self.__args__[:-1]])}], '
                f'{_type_repr(self.__args__[-1])}]')

    def __eq__(self, other):
        if not isinstance(other, _GenericAlias):
            return NotImplemented
        if self.__origin__ != other.__origin__:
            return False
        if self.__origin__ is Union and other.__origin__ is Union:
            return frozenset(self.__args__) == frozenset(other.__args__)
        return self.__args__ == other.__args__

    def __hash__(self):
        if self.__origin__ is Union:
            return hash((Union, frozenset(self.__args__)))
        return hash((self.__origin__, self.__args__))

    def __call__(self, *args, **kwargs):
        if not self._inst:
            raise TypeError(f"Type {self._name} cannot be instantiated; "
                            f"use {self._name.lower()}() instead")
        result = self.__origin__(*args, **kwargs)
        try:
            result.__orig_class__ = self
        except AttributeError:
            pass
        return result

    def __mro_entries__(self, bases):
        if self._name:  # generic version of an ABC or built-in class
            res = []
            if self.__origin__ not in bases:
                res.append(self.__origin__)
            i = bases.index(self)
            if not any(isinstance(b, _GenericAlias) or issubclass(b, Generic)
                       for b in bases[i+1:]):
                res.append(Generic)
            return tuple(res)
        if self.__origin__ is Generic:
            if Protocol in bases:
                return ()
            i = bases.index(self)
            for b in bases[i+1:]:
                if isinstance(b, _GenericAlias) and b is not self:
                    return ()
        return (self.__origin__,)

    def __getattr__(self, attr):
        # We are careful for copy and pickle.
        # Also for simplicity we just don't relay all dunder names
        if '__origin__' in self.__dict__ and not _is_dunder(attr):
            return getattr(self.__origin__, attr)
        raise AttributeError(attr)

    def __setattr__(self, attr, val):
        if _is_dunder(attr) or attr in ('_name', '_inst', '_special'):
            super().__setattr__(attr, val)
        else:
            setattr(self.__origin__, attr, val)

    def __instancecheck__(self, obj):
        return self.__subclasscheck__(type(obj))

    def __subclasscheck__(self, cls):
        if self._special:
            if not isinstance(cls, _GenericAlias):
                return issubclass(cls, self.__origin__)
            if cls._special:
                return issubclass(cls.__origin__, self.__origin__)
        raise TypeError("Subscripted generics cannot be used with"
                        " class and instance checks")

    def __reduce__(self):
        if self._special:
            return self._name

        if self._name:
            origin = globals()[self._name]
        else:
            origin = self.__origin__
        if (origin is Callable and
            not (len(self.__args__) == 2 and self.__args__[0] is Ellipsis)):
            args = list(self.__args__[:-1]), self.__args__[-1]
        else:
            args = tuple(self.__args__)
            if len(args) == 1 and not isinstance(args[0], tuple):
                args, = args
        return operator.getitem, (origin, args)


class _VariadicGenericAlias(_GenericAlias, _root=True):
    """Same as _GenericAlias above but for variadic aliases. Currently,
    this is used only by special internal aliases: Tuple and Callable.
    """
    def __getitem__(self, params):
        if self._name != 'Callable' or not self._special:
            return self.__getitem_inner__(params)
        if not isinstance(params, tuple) or len(params) != 2:
            raise TypeError("Callable must be used as "
                            "Callable[[arg, ...], result].")
        args, result = params
        if args is Ellipsis:
            params = (Ellipsis, result)
        else:
            if not isinstance(args, list):
                raise TypeError(f"Callable[args, result]: args must be a list."
                                f" Got {args}")
            params = (tuple(args), result)
        return self.__getitem_inner__(params)

    @_tp_cache
    def __getitem_inner__(self, params):
        if self.__origin__ is tuple and self._special:
            if params == ():
                return self.copy_with((_TypingEmpty,))
            if not isinstance(params, tuple):
                params = (params,)
            if len(params) == 2 and params[1] is ...:
                msg = "Tuple[t, ...]: t must be a type."
                p = _type_check(params[0], msg)
                return self.copy_with((p, _TypingEllipsis))
            msg = "Tuple[t0, t1, ...]: each t must be a type."
            params = tuple(_type_check(p, msg) for p in params)
            return self.copy_with(params)
        if self.__origin__ is collections.abc.Callable and self._special:
            args, result = params
            msg = "Callable[args, result]: result must be a type."
            result = _type_check(result, msg)
            if args is Ellipsis:
                return self.copy_with((_TypingEllipsis, result))
            msg = "Callable[[arg, ...], result]: each arg must be a type."
            args = tuple(_type_check(arg, msg) for arg in args)
            params = args + (result,)
            return self.copy_with(params)
        return super().__getitem__(params)


class Generic:
    """Abstract base class for generic types.

    A generic type is typically declared by inheriting from
    this class parameterized with one or more type variables.
    For example, a generic mapping type might be defined as::

      class Mapping(Generic[KT, VT]):
          def __getitem__(self, key: KT) -> VT:
              ...
          # Etc.

    This class can then be used as follows::

      def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
          try:
              return mapping[key]
          except KeyError:
              return default
    """
    __slots__ = ()
    _is_protocol = False

    def __new__(cls, *args, **kwds):
        if cls in (Generic, Protocol):
            raise TypeError(f"Type {cls.__name__} cannot be instantiated; "
                            "it can be used only as a base class")
        if super().__new__ is object.__new__ and cls.__init__ is not object.__init__:
            obj = super().__new__(cls)
        else:
            obj = super().__new__(cls, *args, **kwds)
        return obj

    @_tp_cache
    def __class_getitem__(cls, params):
        if not isinstance(params, tuple):
            params = (params,)
        if not params and cls is not Tuple:
            raise TypeError(
                f"Parameter list to {cls.__qualname__}[...] cannot be empty")
        msg = "Parameters to generic types must be types."
        params = tuple(_type_check(p, msg) for p in params)
        if cls in (Generic, Protocol):
            # Generic and Protocol can only be subscripted with unique type variables.
            if not all(isinstance(p, TypeVar) for p in params):
                raise TypeError(
                    f"Parameters to {cls.__name__}[...] must all be type variables")
            if len(set(params)) != len(params):
                raise TypeError(
                    f"Parameters to {cls.__name__}[...] must all be unique")
        else:
            # Subscripting a regular Generic subclass.
            _check_generic(cls, params)
        return _GenericAlias(cls, params)

    def __init_subclass__(cls, *args, **kwargs):
        super().__init_subclass__(*args, **kwargs)
        tvars = []
        if '__orig_bases__' in cls.__dict__:
            error = Generic in cls.__orig_bases__
        else:
            error = Generic in cls.__bases__ and cls.__name__ != 'Protocol'
        if error:
            raise TypeError("Cannot inherit from plain Generic")
        if '__orig_bases__' in cls.__dict__:
            tvars = _collect_type_vars(cls.__orig_bases__)
            # Look for Generic[T1, ..., Tn].
            # If found, tvars must be a subset of it.
            # If not found, tvars is it.
            # Also check for and reject plain Generic,
            # and reject multiple Generic[...].
            gvars = None
            for base in cls.__orig_bases__:
                if (isinstance(base, _GenericAlias) and
                        base.__origin__ is Generic):
                    if gvars is not None:
                        raise TypeError(
                            "Cannot inherit from Generic[...] multiple types.")
                    gvars = base.__parameters__
            if gvars is not None:
                tvarset = set(tvars)
                gvarset = set(gvars)
                if not tvarset <= gvarset:
                    s_vars = ', '.join(str(t) for t in tvars if t not in gvarset)
                    s_args = ', '.join(str(g) for g in gvars)
                    raise TypeError(f"Some type variables ({s_vars}) are"
                                    f" not listed in Generic[{s_args}]")
                tvars = gvars
        cls.__parameters__ = tuple(tvars)


class _TypingEmpty:
    """Internal placeholder for () or []. Used by TupleMeta and CallableMeta
    to allow empty list/tuple in specific places, without allowing them
    to sneak in where prohibited.
    """


class _TypingEllipsis:
    """Internal placeholder for ... (ellipsis)."""


_TYPING_INTERNALS = ['__parameters__', '__orig_bases__',  '__orig_class__',
                     '_is_protocol', '_is_runtime_protocol']

_SPECIAL_NAMES = ['__abstractmethods__', '__annotations__', '__dict__', '__doc__',
                  '__init__', '__module__', '__new__', '__slots__',
                  '__subclasshook__', '__weakref__']

# These special attributes will be not collected as protocol members.
EXCLUDED_ATTRIBUTES = _TYPING_INTERNALS + _SPECIAL_NAMES + ['_MutableMapping__marker']


def _get_protocol_attrs(cls):
    """Collect protocol members from a protocol class objects.

    This includes names actually defined in the class dictionary, as well
    as names that appear in annotations. Special names (above) are skipped.
    """
    attrs = set()
    for base in cls.__mro__[:-1]:  # without object
        if base.__name__ in ('Protocol', 'Generic'):
            continue
        annotations = getattr(base, '__annotations__', {})
        for attr in list(base.__dict__.keys()) + list(annotations.keys()):
            if not attr.startswith('_abc_') and attr not in EXCLUDED_ATTRIBUTES:
                attrs.add(attr)
    return attrs


def _is_callable_members_only(cls):
    # PEP 544 prohibits using issubclass() with protocols that have non-method members.
    return all(callable(getattr(cls, attr, None)) for attr in _get_protocol_attrs(cls))


def _no_init(self, *args, **kwargs):
    if type(self)._is_protocol:
        raise TypeError('Protocols cannot be instantiated')


def _allow_reckless_class_cheks():
    """Allow instnance and class checks for special stdlib modules.

    The abc and functools modules indiscriminately call isinstance() and
    issubclass() on the whole MRO of a user class, which may contain protocols.
    """
    try:
        return sys._getframe(3).f_globals['__name__'] in ['abc', 'functools']
    except (AttributeError, ValueError):  # For platforms without _getframe().
        return True


_PROTO_WHITELIST = {
    'collections.abc': [
        'Callable', 'Awaitable', 'Iterable', 'Iterator', 'AsyncIterable',
        'Hashable', 'Sized', 'Container', 'Collection', 'Reversible',
    ],
    'contextlib': ['AbstractContextManager', 'AbstractAsyncContextManager'],
}


class _ProtocolMeta(ABCMeta):
    # This metaclass is really unfortunate and exists only because of
    # the lack of __instancehook__.
    def __instancecheck__(cls, instance):
        # We need this method for situations where attributes are
        # assigned in __init__.
        if ((not getattr(cls, '_is_protocol', False) or
                _is_callable_members_only(cls)) and
                issubclass(instance.__class__, cls)):
            return True
        if cls._is_protocol:
            if all(hasattr(instance, attr) and
                    # All *methods* can be blocked by setting them to None.
                    (not callable(getattr(cls, attr, None)) or
                     getattr(instance, attr) is not None)
                    for attr in _get_protocol_attrs(cls)):
                return True
        return super().__instancecheck__(instance)


class Protocol(Generic, metaclass=_ProtocolMeta):
    """Base class for protocol classes.

    Protocol classes are defined as::

        class Proto(Protocol):
            def meth(self) -> int:
                ...

    Such classes are primarily used with static type checkers that recognize
    structural subtyping (static duck-typing), for example::

        class C:
            def meth(self) -> int:
                return 0

        def func(x: Proto) -> int:
            return x.meth()

        func(C())  # Passes static type check

    See PEP 544 for details. Protocol classes decorated with
    @typing.runtime_checkable act as simple-minded runtime protocols that check
    only the presence of given attributes, ignoring their type signatures.
    Protocol classes can be generic, they are defined as::

        class GenProto(Protocol[T]):
            def meth(self) -> T:
                ...
    """
    __slots__ = ()
    _is_protocol = True
    _is_runtime_protocol = False

    def __init_subclass__(cls, *args, **kwargs):
        super().__init_subclass__(*args, **kwargs)

        # Determine if this is a protocol or a concrete subclass.
        if not cls.__dict__.get('_is_protocol', False):
            cls._is_protocol = any(b is Protocol for b in cls.__bases__)

        # Set (or override) the protocol subclass hook.
        def _proto_hook(other):
            if not cls.__dict__.get('_is_protocol', False):
                return NotImplemented

            # First, perform various sanity checks.
            if not getattr(cls, '_is_runtime_protocol', False):
                if _allow_reckless_class_cheks():
                    return NotImplemented
                raise TypeError("Instance and class checks can only be used with"
                                " @runtime_checkable protocols")
            if not _is_callable_members_only(cls):
                if _allow_reckless_class_cheks():
                    return NotImplemented
                raise TypeError("Protocols with non-method members"
                                " don't support issubclass()")
            if not isinstance(other, type):
                # Same error message as for issubclass(1, int).
                raise TypeError('issubclass() arg 1 must be a class')

            # Second, perform the actual structural compatibility check.
            for attr in _get_protocol_attrs(cls):
                for base in other.__mro__:
                    # Check if the members appears in the class dictionary...
                    if attr in base.__dict__:
                        if base.__dict__[attr] is None:
                            return NotImplemented
                        break

                    # ...or in annotations, if it is a sub-protocol.
                    annotations = getattr(base, '__annotations__', {})
                    if (isinstance(annotations, collections.abc.Mapping) and
                            attr in annotations and
                            issubclass(other, Generic) and other._is_protocol):
                        break
                else:
                    return NotImplemented
            return True

        if '__subclasshook__' not in cls.__dict__:
            cls.__subclasshook__ = _proto_hook

        # We have nothing more to do for non-protocols...
        if not cls._is_protocol:
            return

        # ... otherwise check consistency of bases, and prohibit instantiation.
        for base in cls.__bases__:
            if not (base in (object, Generic) or
                    base.__module__ in _PROTO_WHITELIST and
                    base.__name__ in _PROTO_WHITELIST[base.__module__] or
                    issubclass(base, Generic) and base._is_protocol):
                raise TypeError('Protocols can only inherit from other'
                                ' protocols, got %r' % base)
        cls.__init__ = _no_init


def runtime_checkable(cls):
    """Mark a protocol class as a runtime protocol.

    Such protocol can be used with isinstance() and issubclass().
    Raise TypeError if applied to a non-protocol class.
    This allows a simple-minded structural check very similar to
    one trick ponies in collections.abc such as Iterable.
    For example::

        @runtime_checkable
        class Closable(Protocol):
            def close(self): ...

        assert isinstance(open('/some/file'), Closable)

    Warning: this will check only the presence of the required methods,
    not their type signatures!
    """
    if not issubclass(cls, Generic) or not cls._is_protocol:
        raise TypeError('@runtime_checkable can be only applied to protocol classes,'
                        ' got %r' % cls)
    cls._is_runtime_protocol = True
    return cls


def cast(typ, val):
    """Cast a value to a type.

    This returns the value unchanged.  To the type checker this
    signals that the return value has the designated type, but at
    runtime we intentionally don't check anything (we want this
    to be as fast as possible).
    """
    return val


def _get_defaults(func):
    """Internal helper to extract the default arguments, by name."""
    try:
        code = func.__code__
    except AttributeError:
        # Some built-in functions don't have __code__, __defaults__, etc.
        return {}
    pos_count = code.co_argcount
    arg_names = code.co_varnames
    arg_names = arg_names[:pos_count]
    defaults = func.__defaults__ or ()
    kwdefaults = func.__kwdefaults__
    res = dict(kwdefaults) if kwdefaults else {}
    pos_offset = pos_count - len(defaults)
    for name, value in zip(arg_names[pos_offset:], defaults):
        assert name not in res
        res[name] = value
    return res


_allowed_types = (types.FunctionType, types.BuiltinFunctionType,
                  types.MethodType, types.ModuleType,
                  WrapperDescriptorType, MethodWrapperType, MethodDescriptorType)


def get_type_hints(obj, globalns=None, localns=None):
    """Return type hints for an object.

    This is often the same as obj.__annotations__, but it handles
    forward references encoded as string literals, and if necessary
    adds Optional[t] if a default value equal to None is set.

    The argument may be a module, class, method, or function. The annotations
    are returned as a dictionary. For classes, annotations include also
    inherited members.

    TypeError is raised if the argument is not of a type that can contain
    annotations, and an empty dictionary is returned if no annotations are
    present.

    BEWARE -- the behavior of globalns and localns is counterintuitive
    (unless you are familiar with how eval() and exec() work).  The
    search order is locals first, then globals.

    - If no dict arguments are passed, an attempt is made to use the
      globals from obj (or the respective module's globals for classes),
      and these are also used as the locals.  If the object does not appear
      to have globals, an empty dictionary is used.

    - If one dict argument is passed, it is used for both globals and
      locals.

    - If two dict arguments are passed, they specify globals and
      locals, respectively.
    """

    if getattr(obj, '__no_type_check__', None):
        return {}
    # Classes require a special treatment.
    if isinstance(obj, type):
        hints = {}
        for base in reversed(obj.__mro__):
            if globalns is None:
                base_globals = sys.modules[base.__module__].__dict__
            else:
                base_globals = globalns
            ann = base.__dict__.get('__annotations__', {})
            for name, value in ann.items():
                if value is None:
                    value = type(None)
                if isinstance(value, str):
                    value = ForwardRef(value, is_argument=False)
                value = _eval_type(value, base_globals, localns)
                hints[name] = value
        return hints

    if globalns is None:
        if isinstance(obj, types.ModuleType):
            globalns = obj.__dict__
        else:
            nsobj = obj
            # Find globalns for the unwrapped object.
            while hasattr(nsobj, '__wrapped__'):
                nsobj = nsobj.__wrapped__
            globalns = getattr(nsobj, '__globals__', {})
        if localns is None:
            localns = globalns
    elif localns is None:
        localns = globalns
    hints = getattr(obj, '__annotations__', None)
    if hints is None:
        # Return empty annotations for something that _could_ have them.
        if isinstance(obj, _allowed_types):
            return {}
        else:
            raise TypeError('{!r} is not a module, class, method, '
                            'or function.'.format(obj))
    defaults = _get_defaults(obj)
    hints = dict(hints)
    for name, value in hints.items():
        if value is None:
            value = type(None)
        if isinstance(value, str):
            value = ForwardRef(value)
        value = _eval_type(value, globalns, localns)
        if name in defaults and defaults[name] is None:
            value = Optional[value]
        hints[name] = value
    return hints


def get_origin(tp):
    """Get the unsubscripted version of a type.

    This supports generic types, Callable, Tuple, Union, Literal, Final and ClassVar.
    Return None for unsupported types. Examples::

        get_origin(Literal[42]) is Literal
        get_origin(int) is None
        get_origin(ClassVar[int]) is ClassVar
        get_origin(Generic) is Generic
        get_origin(Generic[T]) is Generic
        get_origin(Union[T, int]) is Union
        get_origin(List[Tuple[T, T]][int]) == list
    """
    if isinstance(tp, _GenericAlias):
        return tp.__origin__
    if tp is Generic:
        return Generic
    return None


def get_args(tp):
    """Get type arguments with all substitutions performed.

    For unions, basic simplifications used by Union constructor are performed.
    Examples::
        get_args(Dict[str, int]) == (str, int)
        get_args(int) == ()
        get_args(Union[int, Union[T, int], str][int]) == (int, str)
        get_args(Union[int, Tuple[T, int]][str]) == (int, Tuple[str, int])
        get_args(Callable[[], T][int]) == ([], int)
    """
    if isinstance(tp, _GenericAlias) and not tp._special:
        res = tp.__args__
        if get_origin(tp) is collections.abc.Callable and res[0] is not Ellipsis:
            res = (list(res[:-1]), res[-1])
        return res
    return ()


def no_type_check(arg):
    """Decorator to indicate that annotations are not type hints.

    The argument must be a class or function; if it is a class, it
    applies recursively to all methods and classes defined in that class
    (but not to methods defined in its superclasses or subclasses).

    This mutates the function(s) or class(es) in place.
    """
    if isinstance(arg, type):
        arg_attrs = arg.__dict__.copy()
        for attr, val in arg.__dict__.items():
            if val in arg.__bases__ + (arg,):
                arg_attrs.pop(attr)
        for obj in arg_attrs.values():
            if isinstance(obj, types.FunctionType):
                obj.__no_type_check__ = True
            if isinstance(obj, type):
                no_type_check(obj)
    try:
        arg.__no_type_check__ = True
    except TypeError:  # built-in classes
        pass
    return arg


def no_type_check_decorator(decorator):
    """Decorator to give another decorator the @no_type_check effect.

    This wraps the decorator with something that wraps the decorated
    function in @no_type_check.
    """

    @functools.wraps(decorator)
    def wrapped_decorator(*args, **kwds):
        func = decorator(*args, **kwds)
        func = no_type_check(func)
        return func

    return wrapped_decorator


def _overload_dummy(*args, **kwds):
    """Helper for @overload to raise when called."""
    raise NotImplementedError(
        "You should not call an overloaded function. "
        "A series of @overload-decorated functions "
        "outside a stub module should always be followed "
        "by an implementation that is not @overload-ed.")


def overload(func):
    """Decorator for overloaded functions/methods.

    In a stub file, place two or more stub definitions for the same
    function in a row, each decorated with @overload.  For example:

      @overload
      def utf8(value: None) -> None: ...
      @overload
      def utf8(value: bytes) -> bytes: ...
      @overload
      def utf8(value: str) -> bytes: ...

    In a non-stub file (i.e. a regular .py file), do the same but
    follow it with an implementation.  The implementation should *not*
    be decorated with @overload.  For example:

      @overload
      def utf8(value: None) -> None: ...
      @overload
      def utf8(value: bytes) -> bytes: ...
      @overload
      def utf8(value: str) -> bytes: ...
      def utf8(value):
          # implementation goes here
    """
    return _overload_dummy


def final(f):
    """A decorator to indicate final methods and final classes.

    Use this decorator to indicate to type checkers that the decorated
    method cannot be overridden, and decorated class cannot be subclassed.
    For example:

      class Base:
          @final
          def done(self) -> None:
              ...
      class Sub(Base):
          def done(self) -> None:  # Error reported by type checker
                ...

      @final
      class Leaf:
          ...
      class Other(Leaf):  # Error reported by type checker
          ...

    There is no runtime checking of these properties.
    """
    return f


# Some unconstrained type variables.  These are used by the container types.
# (These are not for export.)
T = TypeVar('T')  # Any type.
KT = TypeVar('KT')  # Key type.
VT = TypeVar('VT')  # Value type.
T_co = TypeVar('T_co', covariant=True)  # Any type covariant containers.
V_co = TypeVar('V_co', covariant=True)  # Any type covariant containers.
VT_co = TypeVar('VT_co', covariant=True)  # Value type covariant containers.
T_contra = TypeVar('T_contra', contravariant=True)  # Ditto contravariant.
# Internal type variable used for Type[].
CT_co = TypeVar('CT_co', covariant=True, bound=type)

# A useful type variable with constraints.  This represents string types.
# (This one *is* for export!)
AnyStr = TypeVar('AnyStr', bytes, str)


# Various ABCs mimicking those in collections.abc.
def _alias(origin, params, inst=True):
    return _GenericAlias(origin, params, special=True, inst=inst)

Hashable = _alias(collections.abc.Hashable, ())  # Not generic.
Awaitable = _alias(collections.abc.Awaitable, T_co)
Coroutine = _alias(collections.abc.Coroutine, (T_co, T_contra, V_co))
AsyncIterable = _alias(collections.abc.AsyncIterable, T_co)
AsyncIterator = _alias(collections.abc.AsyncIterator, T_co)
Iterable = _alias(collections.abc.Iterable, T_co)
Iterator = _alias(collections.abc.Iterator, T_co)
Reversible = _alias(collections.abc.Reversible, T_co)
Sized = _alias(collections.abc.Sized, ())  # Not generic.
Container = _alias(collections.abc.Container, T_co)
Collection = _alias(collections.abc.Collection, T_co)
Callable = _VariadicGenericAlias(collections.abc.Callable, (), special=True)
Callable.__doc__ = \
    """Callable type; Callable[[int], str] is a function of (int) -> str.

    The subscription syntax must always be used with exactly two
    values: the argument list and the return type.  The argument list
    must be a list of types or ellipsis; the return type must be a single type.

    There is no syntax to indicate optional or keyword arguments,
    such function types are rarely used as callback types.
    """
AbstractSet = _alias(collections.abc.Set, T_co)
MutableSet = _alias(collections.abc.MutableSet, T)
# NOTE: Mapping is only covariant in the value type.
Mapping = _alias(collections.abc.Mapping, (KT, VT_co))
MutableMapping = _alias(collections.abc.MutableMapping, (KT, VT))
Sequence = _alias(collections.abc.Sequence, T_co)
MutableSequence = _alias(collections.abc.MutableSequence, T)
ByteString = _alias(collections.abc.ByteString, ())  # Not generic
Tuple = _VariadicGenericAlias(tuple, (), inst=False, special=True)
Tuple.__doc__ = \
    """Tuple type; Tuple[X, Y] is the cross-product type of X and Y.

    Example: Tuple[T1, T2] is a tuple of two elements corresponding
    to type variables T1 and T2.  Tuple[int, float, str] is a tuple
    of an int, a float and a string.

    To specify a variable-length tuple of homogeneous type, use Tuple[T, ...].
    """
List = _alias(list, T, inst=False)
Deque = _alias(collections.deque, T)
Set = _alias(set, T, inst=False)
FrozenSet = _alias(frozenset, T_co, inst=False)
MappingView = _alias(collections.abc.MappingView, T_co)
KeysView = _alias(collections.abc.KeysView, KT)
ItemsView = _alias(collections.abc.ItemsView, (KT, VT_co))
ValuesView = _alias(collections.abc.ValuesView, VT_co)
ContextManager = _alias(contextlib.AbstractContextManager, T_co)
AsyncContextManager = _alias(contextlib.AbstractAsyncContextManager, T_co)
Dict = _alias(dict, (KT, VT), inst=False)
DefaultDict = _alias(collections.defaultdict, (KT, VT))
OrderedDict = _alias(collections.OrderedDict, (KT, VT))
Counter = _alias(collections.Counter, T)
ChainMap = _alias(collections.ChainMap, (KT, VT))
Generator = _alias(collections.abc.Generator, (T_co, T_contra, V_co))
AsyncGenerator = _alias(collections.abc.AsyncGenerator, (T_co, T_contra))
Type = _alias(type, CT_co, inst=False)
Type.__doc__ = \
    """A special construct usable to annotate class objects.

    For example, suppose we have the following classes::

      class User: ...  # Abstract base for User classes
      class BasicUser(User): ...
      class ProUser(User): ...
      class TeamUser(User): ...

    And a function that takes a class argument that's a subclass of
    User and returns an instance of the corresponding class::

      U = TypeVar('U', bound=User)
      def new_user(user_class: Type[U]) -> U:
          user = user_class()
          # (Here we could write the user object to a database)
          return user

      joe = new_user(BasicUser)

    At this point the type checker knows that joe has type BasicUser.
    """


@runtime_checkable
class SupportsInt(Protocol):
    """An ABC with one abstract method __int__."""
    __slots__ = ()

    @abstractmethod
    def __int__(self) -> int:
        pass


@runtime_checkable
class SupportsFloat(Protocol):
    """An ABC with one abstract method __float__."""
    __slots__ = ()

    @abstractmethod
    def __float__(self) -> float:
        pass


@runtime_checkable
class SupportsComplex(Protocol):
    """An ABC with one abstract method __complex__."""
    __slots__ = ()

    @abstractmethod
    def __complex__(self) -> complex:
        pass


@runtime_checkable
class SupportsBytes(Protocol):
    """An ABC with one abstract method __bytes__."""
    __slots__ = ()

    @abstractmethod
    def __bytes__(self) -> bytes:
        pass


@runtime_checkable
class SupportsIndex(Protocol):
    """An ABC with one abstract method __index__."""
    __slots__ = ()

    @abstractmethod
    def __index__(self) -> int:
        pass


@runtime_checkable
class SupportsAbs(Protocol[T_co]):
    """An ABC with one abstract method __abs__ that is covariant in its return type."""
    __slots__ = ()

    @abstractmethod
    def __abs__(self) -> T_co:
        pass


@runtime_checkable
class SupportsRound(Protocol[T_co]):
    """An ABC with one abstract method __round__ that is covariant in its return type."""
    __slots__ = ()

    @abstractmethod
    def __round__(self, ndigits: int = 0) -> T_co:
        pass


def _make_nmtuple(name, types):
    msg = "NamedTuple('Name', [(f0, t0), (f1, t1), ...]); each t must be a type"
    types = [(n, _type_check(t, msg)) for n, t in types]
    nm_tpl = collections.namedtuple(name, [n for n, t in types])
    # Prior to PEP 526, only _field_types attribute was assigned.
    # Now __annotations__ are used and _field_types is deprecated (remove in 3.9)
    nm_tpl.__annotations__ = nm_tpl._field_types = dict(types)
    try:
        nm_tpl.__module__ = sys._getframe(2).f_globals.get('__name__', '__main__')
    except (AttributeError, ValueError):
        pass
    return nm_tpl


# attributes prohibited to set in NamedTuple class syntax
_prohibited = ('__new__', '__init__', '__slots__', '__getnewargs__',
               '_fields', '_field_defaults', '_field_types',
               '_make', '_replace', '_asdict', '_source')

_special = ('__module__', '__name__', '__annotations__')


class NamedTupleMeta(type):

    def __new__(cls, typename, bases, ns):
        if ns.get('_root', False):
            return super().__new__(cls, typename, bases, ns)
        types = ns.get('__annotations__', {})
        nm_tpl = _make_nmtuple(typename, types.items())
        defaults = []
        defaults_dict = {}
        for field_name in types:
            if field_name in ns:
                default_value = ns[field_name]
                defaults.append(default_value)
                defaults_dict[field_name] = default_value
            elif defaults:
                raise TypeError("Non-default namedtuple field {field_name} cannot "
                                "follow default field(s) {default_names}"
                                .format(field_name=field_name,
                                        default_names=', '.join(defaults_dict.keys())))
        nm_tpl.__new__.__annotations__ = dict(types)
        nm_tpl.__new__.__defaults__ = tuple(defaults)
        nm_tpl._field_defaults = defaults_dict
        # update from user namespace without overriding special namedtuple attributes
        for key in ns:
            if key in _prohibited:
                raise AttributeError("Cannot overwrite NamedTuple attribute " + key)
            elif key not in _special and key not in nm_tpl._fields:
                setattr(nm_tpl, key, ns[key])
        return nm_tpl


class NamedTuple(metaclass=NamedTupleMeta):
    """Typed version of namedtuple.

    Usage in Python versions >= 3.6::

        class Employee(NamedTuple):
            name: str
            id: int

    This is equivalent to::

        Employee = collections.namedtuple('Employee', ['name', 'id'])

    The resulting class has an extra __annotations__ attribute, giving a
    dict that maps field names to types.  (The field names are also in
    the _fields attribute, which is part of the namedtuple API.)
    Alternative equivalent keyword syntax is also accepted::

        Employee = NamedTuple('Employee', name=str, id=int)

    In Python versions <= 3.5 use::

        Employee = NamedTuple('Employee', [('name', str), ('id', int)])
    """
    _root = True

    def __new__(*args, **kwargs):
        if not args:
            raise TypeError('NamedTuple.__new__(): not enough arguments')
        cls, *args = args  # allow the "cls" keyword be passed
        if args:
            typename, *args = args # allow the "typename" keyword be passed
        elif 'typename' in kwargs:
            typename = kwargs.pop('typename')
            import warnings
            warnings.warn("Passing 'typename' as keyword argument is deprecated",
                          DeprecationWarning, stacklevel=2)
        else:
            raise TypeError("NamedTuple.__new__() missing 1 required positional "
                            "argument: 'typename'")
        if args:
            try:
                fields, = args # allow the "fields" keyword be passed
            except ValueError:
                raise TypeError(f'NamedTuple.__new__() takes from 2 to 3 '
                                f'positional arguments but {len(args) + 2} '
                                f'were given') from None
        elif 'fields' in kwargs and len(kwargs) == 1:
            fields = kwargs.pop('fields')
            import warnings
            warnings.warn("Passing 'fields' as keyword argument is deprecated",
                          DeprecationWarning, stacklevel=2)
        else:
            fields = None

        if fields is None:
            fields = kwargs.items()
        elif kwargs:
            raise TypeError("Either list of fields or keywords"
                            " can be provided to NamedTuple, not both")
        return _make_nmtuple(typename, fields)
    __new__.__text_signature__ = '($cls, typename, fields=None, /, **kwargs)'


def _dict_new(cls, /, *args, **kwargs):
    return dict(*args, **kwargs)


def _typeddict_new(cls, typename, fields=None, /, *, total=True, **kwargs):
    if fields is None:
        fields = kwargs
    elif kwargs:
        raise TypeError("TypedDict takes either a dict or keyword arguments,"
                        " but not both")

    ns = {'__annotations__': dict(fields), '__total__': total}
    try:
        # Setting correct module is necessary to make typed dict classes pickleable.
        ns['__module__'] = sys._getframe(1).f_globals.get('__name__', '__main__')
    except (AttributeError, ValueError):
        pass

    return _TypedDictMeta(typename, (), ns)


def _check_fails(cls, other):
    # Typed dicts are only for static structural subtyping.
    raise TypeError('TypedDict does not support instance and class checks')


class _TypedDictMeta(type):
    def __new__(cls, name, bases, ns, total=True):
        """Create new typed dict class object.

        This method is called directly when TypedDict is subclassed,
        or via _typeddict_new when TypedDict is instantiated. This way
        TypedDict supports all three syntax forms described in its docstring.
        Subclasses and instances of TypedDict return actual dictionaries
        via _dict_new.
        """
        ns['__new__'] = _typeddict_new if name == 'TypedDict' else _dict_new
        tp_dict = super(_TypedDictMeta, cls).__new__(cls, name, (dict,), ns)

        anns = ns.get('__annotations__', {})
        msg = "TypedDict('Name', {f0: t0, f1: t1, ...}); each t must be a type"
        anns = {n: _type_check(tp, msg) for n, tp in anns.items()}
        for base in bases:
            anns.update(base.__dict__.get('__annotations__', {}))
        tp_dict.__annotations__ = anns
        if not hasattr(tp_dict, '__total__'):
            tp_dict.__total__ = total
        return tp_dict

    __instancecheck__ = __subclasscheck__ = _check_fails


class TypedDict(dict, metaclass=_TypedDictMeta):
    """A simple typed namespace. At runtime it is equivalent to a plain dict.

    TypedDict creates a dictionary type that expects all of its
    instances to have a certain set of keys, where each key is
    associated with a value of a consistent type. This expectation
    is not checked at runtime but is only enforced by type checkers.
    Usage::

        class Point2D(TypedDict):
            x: int
            y: int
            label: str

        a: Point2D = {'x': 1, 'y': 2, 'label': 'good'}  # OK
        b: Point2D = {'z': 3, 'label': 'bad'}           # Fails type check

        assert Point2D(x=1, y=2, label='first') == dict(x=1, y=2, label='first')

    The type info can be accessed via Point2D.__annotations__. TypedDict
    supports two additional equivalent forms::

        Point2D = TypedDict('Point2D', x=int, y=int, label=str)
        Point2D = TypedDict('Point2D', {'x': int, 'y': int, 'label': str})

    By default, all keys must be present in a TypedDict. It is possible
    to override this by specifying totality.
    Usage::

        class point2D(TypedDict, total=False):
            x: int
            y: int

    This means that a point2D TypedDict can have any of the keys omitted.A type
    checker is only expected to support a literal False or True as the value of
    the total argument. True is the default, and makes all items defined in the
    class body be required.

    The class syntax is only supported in Python 3.6+, while two other
    syntax forms work for Python 2.7 and 3.2+
    """


def NewType(name, tp):
    """NewType creates simple unique types with almost zero
    runtime overhead. NewType(name, tp) is considered a subtype of tp
    by static type checkers. At runtime, NewType(name, tp) returns
    a dummy function that simply returns its argument. Usage::

        UserId = NewType('UserId', int)

        def name_by_id(user_id: UserId) -> str:
            ...

        UserId('user')          # Fails type check

        name_by_id(42)          # Fails type check
        name_by_id(UserId(42))  # OK

        num = UserId(5) + 1     # type: int
    """

    def new_type(x):
        return x

    new_type.__name__ = name
    new_type.__supertype__ = tp
    return new_type


# Python-version-specific alias (Python 2: unicode; Python 3: str)
Text = str


# Constant that's True when type checking, but False here.
TYPE_CHECKING = False


class IO(Generic[AnyStr]):
    """Generic base class for TextIO and BinaryIO.

    This is an abstract, generic version of the return of open().

    NOTE: This does not distinguish between the different possible
    classes (text vs. binary, read vs. write vs. read/write,
    append-only, unbuffered).  The TextIO and BinaryIO subclasses
    below capture the distinctions between text vs. binary, which is
    pervasive in the interface; however we currently do not offer a
    way to track the other distinctions in the type system.
    """

    __slots__ = ()

    @property
    @abstractmethod
    def mode(self) -> str:
        pass

    @property
    @abstractmethod
    def name(self) -> str:
        pass

    @abstractmethod
    def close(self) -> None:
        pass

    @property
    @abstractmethod
    def closed(self) -> bool:
        pass

    @abstractmethod
    def fileno(self) -> int:
        pass

    @abstractmethod
    def flush(self) -> None:
        pass

    @abstractmethod
    def isatty(self) -> bool:
        pass

    @abstractmethod
    def read(self, n: int = -1) -> AnyStr:
        pass

    @abstractmethod
    def readable(self) -> bool:
        pass

    @abstractmethod
    def readline(self, limit: int = -1) -> AnyStr:
        pass

    @abstractmethod
    def readlines(self, hint: int = -1) -> List[AnyStr]:
        pass

    @abstractmethod
    def seek(self, offset: int, whence: int = 0) -> int:
        pass

    @abstractmethod
    def seekable(self) -> bool:
        pass

    @abstractmethod
    def tell(self) -> int:
        pass

    @abstractmethod
    def truncate(self, size: int = None) -> int:
        pass

    @abstractmethod
    def writable(self) -> bool:
        pass

    @abstractmethod
    def write(self, s: AnyStr) -> int:
        pass

    @abstractmethod
    def writelines(self, lines: List[AnyStr]) -> None:
        pass

    @abstractmethod
    def __enter__(self) -> 'IO[AnyStr]':
        pass

    @abstractmethod
    def __exit__(self, type, value, traceback) -> None:
        pass


class BinaryIO(IO[bytes]):
    """Typed version of the return of open() in binary mode."""

    __slots__ = ()

    @abstractmethod
    def write(self, s: Union[bytes, bytearray]) -> int:
        pass

    @abstractmethod
    def __enter__(self) -> 'BinaryIO':
        pass


class TextIO(IO[str]):
    """Typed version of the return of open() in text mode."""

    __slots__ = ()

    @property
    @abstractmethod
    def buffer(self) -> BinaryIO:
        pass

    @property
    @abstractmethod
    def encoding(self) -> str:
        pass

    @property
    @abstractmethod
    def errors(self) -> Optional[str]:
        pass

    @property
    @abstractmethod
    def line_buffering(self) -> bool:
        pass

    @property
    @abstractmethod
    def newlines(self) -> Any:
        pass

    @abstractmethod
    def __enter__(self) -> 'TextIO':
        pass


class io:
    """Wrapper namespace for IO generic classes."""

    __all__ = ['IO', 'TextIO', 'BinaryIO']
    IO = IO
    TextIO = TextIO
    BinaryIO = BinaryIO


io.__name__ = __name__ + '.io'
sys.modules[io.__name__] = io

Pattern = _alias(stdlib_re.Pattern, AnyStr)
Match = _alias(stdlib_re.Match, AnyStr)

class re:
    """Wrapper namespace for re type aliases."""

    __all__ = ['Pattern', 'Match']
    Pattern = Pattern
    Match = Match


re.__name__ = __name__ + '.re'
sys.modules[re.__name__] = re
tty.py000064400000001557151153537460005760 0ustar00"""Terminal utilities."""

# Author: Steen Lumholt.

from termios import *

__all__ = ["setraw", "setcbreak"]

# Indexes for termios list.
IFLAG = 0
OFLAG = 1
CFLAG = 2
LFLAG = 3
ISPEED = 4
OSPEED = 5
CC = 6

def setraw(fd, when=TCSAFLUSH):
    """Put terminal into a raw mode."""
    mode = tcgetattr(fd)
    mode[IFLAG] = mode[IFLAG] & ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON)
    mode[OFLAG] = mode[OFLAG] & ~(OPOST)
    mode[CFLAG] = mode[CFLAG] & ~(CSIZE | PARENB)
    mode[CFLAG] = mode[CFLAG] | CS8
    mode[LFLAG] = mode[LFLAG] & ~(ECHO | ICANON | IEXTEN | ISIG)
    mode[CC][VMIN] = 1
    mode[CC][VTIME] = 0
    tcsetattr(fd, when, mode)

def setcbreak(fd, when=TCSAFLUSH):
    """Put terminal into a cbreak mode."""
    mode = tcgetattr(fd)
    mode[LFLAG] = mode[LFLAG] & ~(ECHO | ICANON)
    mode[CC][VMIN] = 1
    mode[CC][VTIME] = 0
    tcsetattr(fd, when, mode)
pyclbr.py000064400000035627151153537460006440 0ustar00"""Parse a Python module and describe its classes and functions.

Parse enough of a Python file to recognize imports and class and
function definitions, and to find out the superclasses of a class.

The interface consists of a single function:
    readmodule_ex(module, path=None)
where module is the name of a Python module, and path is an optional
list of directories where the module is to be searched.  If present,
path is prepended to the system search path sys.path.  The return value
is a dictionary.  The keys of the dictionary are the names of the
classes and functions defined in the module (including classes that are
defined via the from XXX import YYY construct).  The values are
instances of classes Class and Function.  One special key/value pair is
present for packages: the key '__path__' has a list as its value which
contains the package search path.

Classes and Functions have a common superclass: _Object.  Every instance
has the following attributes:
    module  -- name of the module;
    name    -- name of the object;
    file    -- file in which the object is defined;
    lineno  -- line in the file where the object's definition starts;
    parent  -- parent of this object, if any;
    children -- nested objects contained in this object.
The 'children' attribute is a dictionary mapping names to objects.

Instances of Function describe functions with the attributes from _Object.

Instances of Class describe classes with the attributes from _Object,
plus the following:
    super   -- list of super classes (Class instances if possible);
    methods -- mapping of method names to beginning line numbers.
If the name of a super class is not recognized, the corresponding
entry in the list of super classes is not a class instance but a
string giving the name of the super class.  Since import statements
are recognized and imported modules are scanned as well, this
shouldn't happen often.
"""

import io
import sys
import importlib.util
import tokenize
from token import NAME, DEDENT, OP

__all__ = ["readmodule", "readmodule_ex", "Class", "Function"]

_modules = {}  # Initialize cache of modules we've seen.


class _Object:
    "Information about Python class or function."
    def __init__(self, module, name, file, lineno, parent):
        self.module = module
        self.name = name
        self.file = file
        self.lineno = lineno
        self.parent = parent
        self.children = {}

    def _addchild(self, name, obj):
        self.children[name] = obj


class Function(_Object):
    "Information about a Python function, including methods."
    def __init__(self, module, name, file, lineno, parent=None):
        _Object.__init__(self, module, name, file, lineno, parent)


class Class(_Object):
    "Information about a Python class."
    def __init__(self, module, name, super, file, lineno, parent=None):
        _Object.__init__(self, module, name, file, lineno, parent)
        self.super = [] if super is None else super
        self.methods = {}

    def _addmethod(self, name, lineno):
        self.methods[name] = lineno


def _nest_function(ob, func_name, lineno):
    "Return a Function after nesting within ob."
    newfunc = Function(ob.module, func_name, ob.file, lineno, ob)
    ob._addchild(func_name, newfunc)
    if isinstance(ob, Class):
        ob._addmethod(func_name, lineno)
    return newfunc

def _nest_class(ob, class_name, lineno, super=None):
    "Return a Class after nesting within ob."
    newclass = Class(ob.module, class_name, super, ob.file, lineno, ob)
    ob._addchild(class_name, newclass)
    return newclass

def readmodule(module, path=None):
    """Return Class objects for the top-level classes in module.

    This is the original interface, before Functions were added.
    """

    res = {}
    for key, value in _readmodule(module, path or []).items():
        if isinstance(value, Class):
            res[key] = value
    return res

def readmodule_ex(module, path=None):
    """Return a dictionary with all functions and classes in module.

    Search for module in PATH + sys.path.
    If possible, include imported superclasses.
    Do this by reading source, without importing (and executing) it.
    """
    return _readmodule(module, path or [])

def _readmodule(module, path, inpackage=None):
    """Do the hard work for readmodule[_ex].

    If inpackage is given, it must be the dotted name of the package in
    which we are searching for a submodule, and then PATH must be the
    package search path; otherwise, we are searching for a top-level
    module, and path is combined with sys.path.
    """
    # Compute the full module name (prepending inpackage if set).
    if inpackage is not None:
        fullmodule = "%s.%s" % (inpackage, module)
    else:
        fullmodule = module

    # Check in the cache.
    if fullmodule in _modules:
        return _modules[fullmodule]

    # Initialize the dict for this module's contents.
    tree = {}

    # Check if it is a built-in module; we don't do much for these.
    if module in sys.builtin_module_names and inpackage is None:
        _modules[module] = tree
        return tree

    # Check for a dotted module name.
    i = module.rfind('.')
    if i >= 0:
        package = module[:i]
        submodule = module[i+1:]
        parent = _readmodule(package, path, inpackage)
        if inpackage is not None:
            package = "%s.%s" % (inpackage, package)
        if not '__path__' in parent:
            raise ImportError('No package named {}'.format(package))
        return _readmodule(submodule, parent['__path__'], package)

    # Search the path for the module.
    f = None
    if inpackage is not None:
        search_path = path
    else:
        search_path = path + sys.path
    spec = importlib.util._find_spec_from_path(fullmodule, search_path)
    if spec is None:
        raise ModuleNotFoundError(f"no module named {fullmodule!r}", name=fullmodule)
    _modules[fullmodule] = tree
    # Is module a package?
    if spec.submodule_search_locations is not None:
        tree['__path__'] = spec.submodule_search_locations
    try:
        source = spec.loader.get_source(fullmodule)
    except (AttributeError, ImportError):
        # If module is not Python source, we cannot do anything.
        return tree
    else:
        if source is None:
            return tree

    fname = spec.loader.get_filename(fullmodule)
    return _create_tree(fullmodule, path, fname, source, tree, inpackage)


def _create_tree(fullmodule, path, fname, source, tree, inpackage):
    """Return the tree for a particular module.

    fullmodule (full module name), inpackage+module, becomes o.module.
    path is passed to recursive calls of _readmodule.
    fname becomes o.file.
    source is tokenized.  Imports cause recursive calls to _readmodule.
    tree is {} or {'__path__': <submodule search locations>}.
    inpackage, None or string, is passed to recursive calls of _readmodule.

    The effect of recursive calls is mutation of global _modules.
    """
    f = io.StringIO(source)

    stack = [] # Initialize stack of (class, indent) pairs.

    g = tokenize.generate_tokens(f.readline)
    try:
        for tokentype, token, start, _end, _line in g:
            if tokentype == DEDENT:
                lineno, thisindent = start
                # Close previous nested classes and defs.
                while stack and stack[-1][1] >= thisindent:
                    del stack[-1]
            elif token == 'def':
                lineno, thisindent = start
                # Close previous nested classes and defs.
                while stack and stack[-1][1] >= thisindent:
                    del stack[-1]
                tokentype, func_name, start = next(g)[0:3]
                if tokentype != NAME:
                    continue  # Skip def with syntax error.
                cur_func = None
                if stack:
                    cur_obj = stack[-1][0]
                    cur_func = _nest_function(cur_obj, func_name, lineno)
                else:
                    # It is just a function.
                    cur_func = Function(fullmodule, func_name, fname, lineno)
                    tree[func_name] = cur_func
                stack.append((cur_func, thisindent))
            elif token == 'class':
                lineno, thisindent = start
                # Close previous nested classes and defs.
                while stack and stack[-1][1] >= thisindent:
                    del stack[-1]
                tokentype, class_name, start = next(g)[0:3]
                if tokentype != NAME:
                    continue # Skip class with syntax error.
                # Parse what follows the class name.
                tokentype, token, start = next(g)[0:3]
                inherit = None
                if token == '(':
                    names = [] # Initialize list of superclasses.
                    level = 1
                    super = [] # Tokens making up current superclass.
                    while True:
                        tokentype, token, start = next(g)[0:3]
                        if token in (')', ',') and level == 1:
                            n = "".join(super)
                            if n in tree:
                                # We know this super class.
                                n = tree[n]
                            else:
                                c = n.split('.')
                                if len(c) > 1:
                                    # Super class form is module.class:
                                    # look in module for class.
                                    m = c[-2]
                                    c = c[-1]
                                    if m in _modules:
                                        d = _modules[m]
                                        if c in d:
                                            n = d[c]
                            names.append(n)
                            super = []
                        if token == '(':
                            level += 1
                        elif token == ')':
                            level -= 1
                            if level == 0:
                                break
                        elif token == ',' and level == 1:
                            pass
                        # Only use NAME and OP (== dot) tokens for type name.
                        elif tokentype in (NAME, OP) and level == 1:
                            super.append(token)
                        # Expressions in the base list are not supported.
                    inherit = names
                if stack:
                    cur_obj = stack[-1][0]
                    cur_class = _nest_class(
                            cur_obj, class_name, lineno, inherit)
                else:
                    cur_class = Class(fullmodule, class_name, inherit,
                                      fname, lineno)
                    tree[class_name] = cur_class
                stack.append((cur_class, thisindent))
            elif token == 'import' and start[1] == 0:
                modules = _getnamelist(g)
                for mod, _mod2 in modules:
                    try:
                        # Recursively read the imported module.
                        if inpackage is None:
                            _readmodule(mod, path)
                        else:
                            try:
                                _readmodule(mod, path, inpackage)
                            except ImportError:
                                _readmodule(mod, [])
                    except:
                        # If we can't find or parse the imported module,
                        # too bad -- don't die here.
                        pass
            elif token == 'from' and start[1] == 0:
                mod, token = _getname(g)
                if not mod or token != "import":
                    continue
                names = _getnamelist(g)
                try:
                    # Recursively read the imported module.
                    d = _readmodule(mod, path, inpackage)
                except:
                    # If we can't find or parse the imported module,
                    # too bad -- don't die here.
                    continue
                # Add any classes that were defined in the imported module
                # to our name space if they were mentioned in the list.
                for n, n2 in names:
                    if n in d:
                        tree[n2 or n] = d[n]
                    elif n == '*':
                        # Don't add names that start with _.
                        for n in d:
                            if n[0] != '_':
                                tree[n] = d[n]
    except StopIteration:
        pass

    f.close()
    return tree


def _getnamelist(g):
    """Return list of (dotted-name, as-name or None) tuples for token source g.

    An as-name is the name that follows 'as' in an as clause.
    """
    names = []
    while True:
        name, token = _getname(g)
        if not name:
            break
        if token == 'as':
            name2, token = _getname(g)
        else:
            name2 = None
        names.append((name, name2))
        while token != "," and "\n" not in token:
            token = next(g)[1]
        if token != ",":
            break
    return names


def _getname(g):
    "Return (dotted-name or None, next-token) tuple for token source g."
    parts = []
    tokentype, token = next(g)[0:2]
    if tokentype != NAME and token != '*':
        return (None, token)
    parts.append(token)
    while True:
        tokentype, token = next(g)[0:2]
        if token != '.':
            break
        tokentype, token = next(g)[0:2]
        if tokentype != NAME:
            break
        parts.append(token)
    return (".".join(parts), token)


def _main():
    "Print module output (default this file) for quick visual check."
    import os
    try:
        mod = sys.argv[1]
    except:
        mod = __file__
    if os.path.exists(mod):
        path = [os.path.dirname(mod)]
        mod = os.path.basename(mod)
        if mod.lower().endswith(".py"):
            mod = mod[:-3]
    else:
        path = []
    tree = readmodule_ex(mod, path)
    lineno_key = lambda a: getattr(a, 'lineno', 0)
    objs = sorted(tree.values(), key=lineno_key, reverse=True)
    indent_level = 2
    while objs:
        obj = objs.pop()
        if isinstance(obj, list):
            # Value is a __path__ key.
            continue
        if not hasattr(obj, 'indent'):
            obj.indent = 0

        if isinstance(obj, _Object):
            new_objs = sorted(obj.children.values(),
                              key=lineno_key, reverse=True)
            for ob in new_objs:
                ob.indent = obj.indent + indent_level
            objs.extend(new_objs)
        if isinstance(obj, Class):
            print("{}class {} {} {}"
                  .format(' ' * obj.indent, obj.name, obj.super, obj.lineno))
        elif isinstance(obj, Function):
            print("{}def {} {}".format(' ' * obj.indent, obj.name, obj.lineno))

if __name__ == "__main__":
    _main()
operator.py000064400000024727151153537460006777 0ustar00"""
Operator Interface

This module exports a set of functions corresponding to the intrinsic
operators of Python.  For example, operator.add(x, y) is equivalent
to the expression x+y.  The function names are those used for special
methods; variants without leading and trailing '__' are also provided
for convenience.

This is the pure Python implementation of the module.
"""

__all__ = ['abs', 'add', 'and_', 'attrgetter', 'concat', 'contains', 'countOf',
           'delitem', 'eq', 'floordiv', 'ge', 'getitem', 'gt', 'iadd', 'iand',
           'iconcat', 'ifloordiv', 'ilshift', 'imatmul', 'imod', 'imul',
           'index', 'indexOf', 'inv', 'invert', 'ior', 'ipow', 'irshift',
           'is_', 'is_not', 'isub', 'itemgetter', 'itruediv', 'ixor', 'le',
           'length_hint', 'lshift', 'lt', 'matmul', 'methodcaller', 'mod',
           'mul', 'ne', 'neg', 'not_', 'or_', 'pos', 'pow', 'rshift',
           'setitem', 'sub', 'truediv', 'truth', 'xor']

from builtins import abs as _abs


# Comparison Operations *******************************************************#

def lt(a, b):
    "Same as a < b."
    return a < b

def le(a, b):
    "Same as a <= b."
    return a <= b

def eq(a, b):
    "Same as a == b."
    return a == b

def ne(a, b):
    "Same as a != b."
    return a != b

def ge(a, b):
    "Same as a >= b."
    return a >= b

def gt(a, b):
    "Same as a > b."
    return a > b

# Logical Operations **********************************************************#

def not_(a):
    "Same as not a."
    return not a

def truth(a):
    "Return True if a is true, False otherwise."
    return True if a else False

def is_(a, b):
    "Same as a is b."
    return a is b

def is_not(a, b):
    "Same as a is not b."
    return a is not b

# Mathematical/Bitwise Operations *********************************************#

def abs(a):
    "Same as abs(a)."
    return _abs(a)

def add(a, b):
    "Same as a + b."
    return a + b

def and_(a, b):
    "Same as a & b."
    return a & b

def floordiv(a, b):
    "Same as a // b."
    return a // b

def index(a):
    "Same as a.__index__()."
    return a.__index__()

def inv(a):
    "Same as ~a."
    return ~a
invert = inv

def lshift(a, b):
    "Same as a << b."
    return a << b

def mod(a, b):
    "Same as a % b."
    return a % b

def mul(a, b):
    "Same as a * b."
    return a * b

def matmul(a, b):
    "Same as a @ b."
    return a @ b

def neg(a):
    "Same as -a."
    return -a

def or_(a, b):
    "Same as a | b."
    return a | b

def pos(a):
    "Same as +a."
    return +a

def pow(a, b):
    "Same as a ** b."
    return a ** b

def rshift(a, b):
    "Same as a >> b."
    return a >> b

def sub(a, b):
    "Same as a - b."
    return a - b

def truediv(a, b):
    "Same as a / b."
    return a / b

def xor(a, b):
    "Same as a ^ b."
    return a ^ b

# Sequence Operations *********************************************************#

def concat(a, b):
    "Same as a + b, for a and b sequences."
    if not hasattr(a, '__getitem__'):
        msg = "'%s' object can't be concatenated" % type(a).__name__
        raise TypeError(msg)
    return a + b

def contains(a, b):
    "Same as b in a (note reversed operands)."
    return b in a

def countOf(a, b):
    "Return the number of times b occurs in a."
    count = 0
    for i in a:
        if i == b:
            count += 1
    return count

def delitem(a, b):
    "Same as del a[b]."
    del a[b]

def getitem(a, b):
    "Same as a[b]."
    return a[b]

def indexOf(a, b):
    "Return the first index of b in a."
    for i, j in enumerate(a):
        if j == b:
            return i
    else:
        raise ValueError('sequence.index(x): x not in sequence')

def setitem(a, b, c):
    "Same as a[b] = c."
    a[b] = c

def length_hint(obj, default=0):
    """
    Return an estimate of the number of items in obj.
    This is useful for presizing containers when building from an iterable.

    If the object supports len(), the result will be exact. Otherwise, it may
    over- or under-estimate by an arbitrary amount. The result will be an
    integer >= 0.
    """
    if not isinstance(default, int):
        msg = ("'%s' object cannot be interpreted as an integer" %
               type(default).__name__)
        raise TypeError(msg)

    try:
        return len(obj)
    except TypeError:
        pass

    try:
        hint = type(obj).__length_hint__
    except AttributeError:
        return default

    try:
        val = hint(obj)
    except TypeError:
        return default
    if val is NotImplemented:
        return default
    if not isinstance(val, int):
        msg = ('__length_hint__ must be integer, not %s' %
               type(val).__name__)
        raise TypeError(msg)
    if val < 0:
        msg = '__length_hint__() should return >= 0'
        raise ValueError(msg)
    return val

# Generalized Lookup Objects **************************************************#

class attrgetter:
    """
    Return a callable object that fetches the given attribute(s) from its operand.
    After f = attrgetter('name'), the call f(r) returns r.name.
    After g = attrgetter('name', 'date'), the call g(r) returns (r.name, r.date).
    After h = attrgetter('name.first', 'name.last'), the call h(r) returns
    (r.name.first, r.name.last).
    """
    __slots__ = ('_attrs', '_call')

    def __init__(self, attr, *attrs):
        if not attrs:
            if not isinstance(attr, str):
                raise TypeError('attribute name must be a string')
            self._attrs = (attr,)
            names = attr.split('.')
            def func(obj):
                for name in names:
                    obj = getattr(obj, name)
                return obj
            self._call = func
        else:
            self._attrs = (attr,) + attrs
            getters = tuple(map(attrgetter, self._attrs))
            def func(obj):
                return tuple(getter(obj) for getter in getters)
            self._call = func

    def __call__(self, obj):
        return self._call(obj)

    def __repr__(self):
        return '%s.%s(%s)' % (self.__class__.__module__,
                              self.__class__.__qualname__,
                              ', '.join(map(repr, self._attrs)))

    def __reduce__(self):
        return self.__class__, self._attrs

class itemgetter:
    """
    Return a callable object that fetches the given item(s) from its operand.
    After f = itemgetter(2), the call f(r) returns r[2].
    After g = itemgetter(2, 5, 3), the call g(r) returns (r[2], r[5], r[3])
    """
    __slots__ = ('_items', '_call')

    def __init__(self, item, *items):
        if not items:
            self._items = (item,)
            def func(obj):
                return obj[item]
            self._call = func
        else:
            self._items = items = (item,) + items
            def func(obj):
                return tuple(obj[i] for i in items)
            self._call = func

    def __call__(self, obj):
        return self._call(obj)

    def __repr__(self):
        return '%s.%s(%s)' % (self.__class__.__module__,
                              self.__class__.__name__,
                              ', '.join(map(repr, self._items)))

    def __reduce__(self):
        return self.__class__, self._items

class methodcaller:
    """
    Return a callable object that calls the given method on its operand.
    After f = methodcaller('name'), the call f(r) returns r.name().
    After g = methodcaller('name', 'date', foo=1), the call g(r) returns
    r.name('date', foo=1).
    """
    __slots__ = ('_name', '_args', '_kwargs')

    def __init__(self, name, /, *args, **kwargs):
        self._name = name
        if not isinstance(self._name, str):
            raise TypeError('method name must be a string')
        self._args = args
        self._kwargs = kwargs

    def __call__(self, obj):
        return getattr(obj, self._name)(*self._args, **self._kwargs)

    def __repr__(self):
        args = [repr(self._name)]
        args.extend(map(repr, self._args))
        args.extend('%s=%r' % (k, v) for k, v in self._kwargs.items())
        return '%s.%s(%s)' % (self.__class__.__module__,
                              self.__class__.__name__,
                              ', '.join(args))

    def __reduce__(self):
        if not self._kwargs:
            return self.__class__, (self._name,) + self._args
        else:
            from functools import partial
            return partial(self.__class__, self._name, **self._kwargs), self._args


# In-place Operations *********************************************************#

def iadd(a, b):
    "Same as a += b."
    a += b
    return a

def iand(a, b):
    "Same as a &= b."
    a &= b
    return a

def iconcat(a, b):
    "Same as a += b, for a and b sequences."
    if not hasattr(a, '__getitem__'):
        msg = "'%s' object can't be concatenated" % type(a).__name__
        raise TypeError(msg)
    a += b
    return a

def ifloordiv(a, b):
    "Same as a //= b."
    a //= b
    return a

def ilshift(a, b):
    "Same as a <<= b."
    a <<= b
    return a

def imod(a, b):
    "Same as a %= b."
    a %= b
    return a

def imul(a, b):
    "Same as a *= b."
    a *= b
    return a

def imatmul(a, b):
    "Same as a @= b."
    a @= b
    return a

def ior(a, b):
    "Same as a |= b."
    a |= b
    return a

def ipow(a, b):
    "Same as a **= b."
    a **=b
    return a

def irshift(a, b):
    "Same as a >>= b."
    a >>= b
    return a

def isub(a, b):
    "Same as a -= b."
    a -= b
    return a

def itruediv(a, b):
    "Same as a /= b."
    a /= b
    return a

def ixor(a, b):
    "Same as a ^= b."
    a ^= b
    return a


try:
    from _operator import *
except ImportError:
    pass
else:
    from _operator import __doc__

# All of these "__func__ = func" assignments have to happen after importing
# from _operator to make sure they're set to the right function
__lt__ = lt
__le__ = le
__eq__ = eq
__ne__ = ne
__ge__ = ge
__gt__ = gt
__not__ = not_
__abs__ = abs
__add__ = add
__and__ = and_
__floordiv__ = floordiv
__index__ = index
__inv__ = inv
__invert__ = invert
__lshift__ = lshift
__mod__ = mod
__mul__ = mul
__matmul__ = matmul
__neg__ = neg
__or__ = or_
__pos__ = pos
__pow__ = pow
__rshift__ = rshift
__sub__ = sub
__truediv__ = truediv
__xor__ = xor
__concat__ = concat
__contains__ = contains
__delitem__ = delitem
__getitem__ = getitem
__setitem__ = setitem
__iadd__ = iadd
__iand__ = iand
__iconcat__ = iconcat
__ifloordiv__ = ifloordiv
__ilshift__ = ilshift
__imod__ = imod
__imul__ = imul
__imatmul__ = imatmul
__ior__ = ior
__ipow__ = ipow
__irshift__ = irshift
__isub__ = isub
__itruediv__ = itruediv
__ixor__ = ixor
linecache.py000064400000012322151153537460007043 0ustar00"""Cache lines from Python source files.

This is intended to read lines from modules imported -- hence if a filename
is not found, it will look down the module search path for a file by
that name.
"""

import functools
import sys
import os
import tokenize

__all__ = ["getline", "clearcache", "checkcache"]

def getline(filename, lineno, module_globals=None):
    lines = getlines(filename, module_globals)
    if 1 <= lineno <= len(lines):
        return lines[lineno-1]
    else:
        return ''


# The cache

# The cache. Maps filenames to either a thunk which will provide source code,
# or a tuple (size, mtime, lines, fullname) once loaded.
cache = {}


def clearcache():
    """Clear the cache entirely."""

    global cache
    cache = {}


def getlines(filename, module_globals=None):
    """Get the lines for a Python source file from the cache.
    Update the cache if it doesn't contain an entry for this file already."""

    if filename in cache:
        entry = cache[filename]
        if len(entry) != 1:
            return cache[filename][2]

    try:
        return updatecache(filename, module_globals)
    except MemoryError:
        clearcache()
        return []


def checkcache(filename=None):
    """Discard cache entries that are out of date.
    (This is not checked upon each call!)"""

    if filename is None:
        filenames = list(cache.keys())
    else:
        if filename in cache:
            filenames = [filename]
        else:
            return

    for filename in filenames:
        entry = cache[filename]
        if len(entry) == 1:
            # lazy cache entry, leave it lazy.
            continue
        size, mtime, lines, fullname = entry
        if mtime is None:
            continue   # no-op for files loaded via a __loader__
        try:
            stat = os.stat(fullname)
        except OSError:
            cache.pop(filename, None)
            continue
        if size != stat.st_size or mtime != stat.st_mtime:
            cache.pop(filename, None)


def updatecache(filename, module_globals=None):
    """Update a cache entry and return its list of lines.
    If something's wrong, print a message, discard the cache entry,
    and return an empty list."""

    if filename in cache:
        if len(cache[filename]) != 1:
            cache.pop(filename, None)
    if not filename or (filename.startswith('<') and filename.endswith('>')):
        return []

    fullname = filename
    try:
        stat = os.stat(fullname)
    except OSError:
        basename = filename

        # Realise a lazy loader based lookup if there is one
        # otherwise try to lookup right now.
        if lazycache(filename, module_globals):
            try:
                data = cache[filename][0]()
            except (ImportError, OSError):
                pass
            else:
                if data is None:
                    # No luck, the PEP302 loader cannot find the source
                    # for this module.
                    return []
                cache[filename] = (
                    len(data), None,
                    [line+'\n' for line in data.splitlines()], fullname
                )
                return cache[filename][2]

        # Try looking through the module search path, which is only useful
        # when handling a relative filename.
        if os.path.isabs(filename):
            return []

        for dirname in sys.path:
            try:
                fullname = os.path.join(dirname, basename)
            except (TypeError, AttributeError):
                # Not sufficiently string-like to do anything useful with.
                continue
            try:
                stat = os.stat(fullname)
                break
            except OSError:
                pass
        else:
            return []
    try:
        with tokenize.open(fullname) as fp:
            lines = fp.readlines()
    except OSError:
        return []
    if lines and not lines[-1].endswith('\n'):
        lines[-1] += '\n'
    size, mtime = stat.st_size, stat.st_mtime
    cache[filename] = size, mtime, lines, fullname
    return lines


def lazycache(filename, module_globals):
    """Seed the cache for filename with module_globals.

    The module loader will be asked for the source only when getlines is
    called, not immediately.

    If there is an entry in the cache already, it is not altered.

    :return: True if a lazy load is registered in the cache,
        otherwise False. To register such a load a module loader with a
        get_source method must be found, the filename must be a cachable
        filename, and the filename must not be already cached.
    """
    if filename in cache:
        if len(cache[filename]) == 1:
            return True
        else:
            return False
    if not filename or (filename.startswith('<') and filename.endswith('>')):
        return False
    # Try for a __loader__, if available
    if module_globals and '__loader__' in module_globals:
        name = module_globals.get('__name__')
        loader = module_globals['__loader__']
        get_source = getattr(loader, 'get_source', None)

        if name and get_source:
            get_lines = functools.partial(get_source, name)
            cache[filename] = (get_lines,)
            return True
    return False
bisect.py000064400000004246151153537460006407 0ustar00"""Bisection algorithms."""

def insort_right(a, x, lo=0, hi=None):
    """Insert item x in list a, and keep it sorted assuming a is sorted.

    If x is already in a, insert it to the right of the rightmost x.

    Optional args lo (default 0) and hi (default len(a)) bound the
    slice of a to be searched.
    """

    lo = bisect_right(a, x, lo, hi)
    a.insert(lo, x)

def bisect_right(a, x, lo=0, hi=None):
    """Return the index where to insert item x in list a, assuming a is sorted.

    The return value i is such that all e in a[:i] have e <= x, and all e in
    a[i:] have e > x.  So if x already appears in the list, a.insert(x) will
    insert just after the rightmost x already there.

    Optional args lo (default 0) and hi (default len(a)) bound the
    slice of a to be searched.
    """

    if lo < 0:
        raise ValueError('lo must be non-negative')
    if hi is None:
        hi = len(a)
    while lo < hi:
        mid = (lo+hi)//2
        if x < a[mid]: hi = mid
        else: lo = mid+1
    return lo

def insort_left(a, x, lo=0, hi=None):
    """Insert item x in list a, and keep it sorted assuming a is sorted.

    If x is already in a, insert it to the left of the leftmost x.

    Optional args lo (default 0) and hi (default len(a)) bound the
    slice of a to be searched.
    """

    lo = bisect_left(a, x, lo, hi)
    a.insert(lo, x)


def bisect_left(a, x, lo=0, hi=None):
    """Return the index where to insert item x in list a, assuming a is sorted.

    The return value i is such that all e in a[:i] have e < x, and all e in
    a[i:] have e >= x.  So if x already appears in the list, a.insert(x) will
    insert just before the leftmost x already there.

    Optional args lo (default 0) and hi (default len(a)) bound the
    slice of a to be searched.
    """

    if lo < 0:
        raise ValueError('lo must be non-negative')
    if hi is None:
        hi = len(a)
    while lo < hi:
        mid = (lo+hi)//2
        if a[mid] < x: lo = mid+1
        else: hi = mid
    return lo

# Overwrite above definitions with a fast C implementation
try:
    from _bisect import *
except ImportError:
    pass

# Create aliases
bisect = bisect_right
insort = insort_right
__phello__.foo.py000064400000000100151153537460007760 0ustar00# This file exists as a helper for the test.test_frozen module.
rlcompleter.py000064400000015671151153537460007472 0ustar00"""Word completion for GNU readline.

The completer completes keywords, built-ins and globals in a selectable
namespace (which defaults to __main__); when completing NAME.NAME..., it
evaluates (!) the expression up to the last dot and completes its attributes.

It's very cool to do "import sys" type "sys.", hit the completion key (twice),
and see the list of names defined by the sys module!

Tip: to use the tab key as the completion key, call

    readline.parse_and_bind("tab: complete")

Notes:

- Exceptions raised by the completer function are *ignored* (and generally cause
  the completion to fail).  This is a feature -- since readline sets the tty
  device in raw (or cbreak) mode, printing a traceback wouldn't work well
  without some complicated hoopla to save, reset and restore the tty state.

- The evaluation of the NAME.NAME... form may cause arbitrary application
  defined code to be executed if an object with a __getattr__ hook is found.
  Since it is the responsibility of the application (or the user) to enable this
  feature, I consider this an acceptable risk.  More complicated expressions
  (e.g. function calls or indexing operations) are *not* evaluated.

- When the original stdin is not a tty device, GNU readline is never
  used, and this module (and the readline module) are silently inactive.

"""

import atexit
import builtins
import __main__

__all__ = ["Completer"]

class Completer:
    def __init__(self, namespace = None):
        """Create a new completer for the command line.

        Completer([namespace]) -> completer instance.

        If unspecified, the default namespace where completions are performed
        is __main__ (technically, __main__.__dict__). Namespaces should be
        given as dictionaries.

        Completer instances should be used as the completion mechanism of
        readline via the set_completer() call:

        readline.set_completer(Completer(my_namespace).complete)
        """

        if namespace and not isinstance(namespace, dict):
            raise TypeError('namespace must be a dictionary')

        # Don't bind to namespace quite yet, but flag whether the user wants a
        # specific namespace or to use __main__.__dict__. This will allow us
        # to bind to __main__.__dict__ at completion time, not now.
        if namespace is None:
            self.use_main_ns = 1
        else:
            self.use_main_ns = 0
            self.namespace = namespace

    def complete(self, text, state):
        """Return the next possible completion for 'text'.

        This is called successively with state == 0, 1, 2, ... until it
        returns None.  The completion should begin with 'text'.

        """
        if self.use_main_ns:
            self.namespace = __main__.__dict__

        if not text.strip():
            if state == 0:
                if _readline_available:
                    readline.insert_text('\t')
                    readline.redisplay()
                    return ''
                else:
                    return '\t'
            else:
                return None

        if state == 0:
            if "." in text:
                self.matches = self.attr_matches(text)
            else:
                self.matches = self.global_matches(text)
        try:
            return self.matches[state]
        except IndexError:
            return None

    def _callable_postfix(self, val, word):
        if callable(val):
            word = word + "("
        return word

    def global_matches(self, text):
        """Compute matches when text is a simple name.

        Return a list of all keywords, built-in functions and names currently
        defined in self.namespace that match.

        """
        import keyword
        matches = []
        seen = {"__builtins__"}
        n = len(text)
        for word in keyword.kwlist:
            if word[:n] == text:
                seen.add(word)
                if word in {'finally', 'try'}:
                    word = word + ':'
                elif word not in {'False', 'None', 'True',
                                  'break', 'continue', 'pass',
                                  'else'}:
                    word = word + ' '
                matches.append(word)
        for nspace in [self.namespace, builtins.__dict__]:
            for word, val in nspace.items():
                if word[:n] == text and word not in seen:
                    seen.add(word)
                    matches.append(self._callable_postfix(val, word))
        return matches

    def attr_matches(self, text):
        """Compute matches when text contains a dot.

        Assuming the text is of the form NAME.NAME....[NAME], and is
        evaluable in self.namespace, it will be evaluated and its attributes
        (as revealed by dir()) are used as possible completions.  (For class
        instances, class members are also considered.)

        WARNING: this can still invoke arbitrary C code, if an object
        with a __getattr__ hook is evaluated.

        """
        import re
        m = re.match(r"(\w+(\.\w+)*)\.(\w*)", text)
        if not m:
            return []
        expr, attr = m.group(1, 3)
        try:
            thisobject = eval(expr, self.namespace)
        except Exception:
            return []

        # get the content of the object, except __builtins__
        words = set(dir(thisobject))
        words.discard("__builtins__")

        if hasattr(thisobject, '__class__'):
            words.add('__class__')
            words.update(get_class_members(thisobject.__class__))
        matches = []
        n = len(attr)
        if attr == '':
            noprefix = '_'
        elif attr == '_':
            noprefix = '__'
        else:
            noprefix = None
        while True:
            for word in words:
                if (word[:n] == attr and
                    not (noprefix and word[:n+1] == noprefix)):
                    match = "%s.%s" % (expr, word)
                    try:
                        val = getattr(thisobject, word)
                    except Exception:
                        pass  # Include even if attribute not set
                    else:
                        match = self._callable_postfix(val, match)
                    matches.append(match)
            if matches or not noprefix:
                break
            if noprefix == '_':
                noprefix = '__'
            else:
                noprefix = None
        matches.sort()
        return matches

def get_class_members(klass):
    ret = dir(klass)
    if hasattr(klass,'__bases__'):
        for base in klass.__bases__:
            ret = ret + get_class_members(base)
    return ret

try:
    import readline
except ImportError:
    _readline_available = False
else:
    readline.set_completer(Completer().complete)
    # Release references early at shutdown (the readline module's
    # contents are quasi-immortal, and the completer function holds a
    # reference to globals).
    atexit.register(lambda: readline.set_completer(None))
    _readline_available = True
lzma.py000064400000031267151153537460006104 0ustar00"""Interface to the liblzma compression library.

This module provides a class for reading and writing compressed files,
classes for incremental (de)compression, and convenience functions for
one-shot (de)compression.

These classes and functions support both the XZ and legacy LZMA
container formats, as well as raw compressed data streams.
"""

__all__ = [
    "CHECK_NONE", "CHECK_CRC32", "CHECK_CRC64", "CHECK_SHA256",
    "CHECK_ID_MAX", "CHECK_UNKNOWN",
    "FILTER_LZMA1", "FILTER_LZMA2", "FILTER_DELTA", "FILTER_X86", "FILTER_IA64",
    "FILTER_ARM", "FILTER_ARMTHUMB", "FILTER_POWERPC", "FILTER_SPARC",
    "FORMAT_AUTO", "FORMAT_XZ", "FORMAT_ALONE", "FORMAT_RAW",
    "MF_HC3", "MF_HC4", "MF_BT2", "MF_BT3", "MF_BT4",
    "MODE_FAST", "MODE_NORMAL", "PRESET_DEFAULT", "PRESET_EXTREME",

    "LZMACompressor", "LZMADecompressor", "LZMAFile", "LZMAError",
    "open", "compress", "decompress", "is_check_supported",
]

import builtins
import io
import os
from _lzma import *
from _lzma import _encode_filter_properties, _decode_filter_properties
import _compression


_MODE_CLOSED   = 0
_MODE_READ     = 1
# Value 2 no longer used
_MODE_WRITE    = 3


class LZMAFile(_compression.BaseStream):

    """A file object providing transparent LZMA (de)compression.

    An LZMAFile can act as a wrapper for an existing file object, or
    refer directly to a named file on disk.

    Note that LZMAFile provides a *binary* file interface - data read
    is returned as bytes, and data to be written must be given as bytes.
    """

    def __init__(self, filename=None, mode="r", *,
                 format=None, check=-1, preset=None, filters=None):
        """Open an LZMA-compressed file in binary mode.

        filename can be either an actual file name (given as a str,
        bytes, or PathLike object), in which case the named file is
        opened, or it can be an existing file object to read from or
        write to.

        mode can be "r" for reading (default), "w" for (over)writing,
        "x" for creating exclusively, or "a" for appending. These can
        equivalently be given as "rb", "wb", "xb" and "ab" respectively.

        format specifies the container format to use for the file.
        If mode is "r", this defaults to FORMAT_AUTO. Otherwise, the
        default is FORMAT_XZ.

        check specifies the integrity check to use. This argument can
        only be used when opening a file for writing. For FORMAT_XZ,
        the default is CHECK_CRC64. FORMAT_ALONE and FORMAT_RAW do not
        support integrity checks - for these formats, check must be
        omitted, or be CHECK_NONE.

        When opening a file for reading, the *preset* argument is not
        meaningful, and should be omitted. The *filters* argument should
        also be omitted, except when format is FORMAT_RAW (in which case
        it is required).

        When opening a file for writing, the settings used by the
        compressor can be specified either as a preset compression
        level (with the *preset* argument), or in detail as a custom
        filter chain (with the *filters* argument). For FORMAT_XZ and
        FORMAT_ALONE, the default is to use the PRESET_DEFAULT preset
        level. For FORMAT_RAW, the caller must always specify a filter
        chain; the raw compressor does not support preset compression
        levels.

        preset (if provided) should be an integer in the range 0-9,
        optionally OR-ed with the constant PRESET_EXTREME.

        filters (if provided) should be a sequence of dicts. Each dict
        should have an entry for "id" indicating ID of the filter, plus
        additional entries for options to the filter.
        """
        self._fp = None
        self._closefp = False
        self._mode = _MODE_CLOSED

        if mode in ("r", "rb"):
            if check != -1:
                raise ValueError("Cannot specify an integrity check "
                                 "when opening a file for reading")
            if preset is not None:
                raise ValueError("Cannot specify a preset compression "
                                 "level when opening a file for reading")
            if format is None:
                format = FORMAT_AUTO
            mode_code = _MODE_READ
        elif mode in ("w", "wb", "a", "ab", "x", "xb"):
            if format is None:
                format = FORMAT_XZ
            mode_code = _MODE_WRITE
            self._compressor = LZMACompressor(format=format, check=check,
                                              preset=preset, filters=filters)
            self._pos = 0
        else:
            raise ValueError("Invalid mode: {!r}".format(mode))

        if isinstance(filename, (str, bytes, os.PathLike)):
            if "b" not in mode:
                mode += "b"
            self._fp = builtins.open(filename, mode)
            self._closefp = True
            self._mode = mode_code
        elif hasattr(filename, "read") or hasattr(filename, "write"):
            self._fp = filename
            self._mode = mode_code
        else:
            raise TypeError("filename must be a str, bytes, file or PathLike object")

        if self._mode == _MODE_READ:
            raw = _compression.DecompressReader(self._fp, LZMADecompressor,
                trailing_error=LZMAError, format=format, filters=filters)
            self._buffer = io.BufferedReader(raw)

    def close(self):
        """Flush and close the file.

        May be called more than once without error. Once the file is
        closed, any other operation on it will raise a ValueError.
        """
        if self._mode == _MODE_CLOSED:
            return
        try:
            if self._mode == _MODE_READ:
                self._buffer.close()
                self._buffer = None
            elif self._mode == _MODE_WRITE:
                self._fp.write(self._compressor.flush())
                self._compressor = None
        finally:
            try:
                if self._closefp:
                    self._fp.close()
            finally:
                self._fp = None
                self._closefp = False
                self._mode = _MODE_CLOSED

    @property
    def closed(self):
        """True if this file is closed."""
        return self._mode == _MODE_CLOSED

    def fileno(self):
        """Return the file descriptor for the underlying file."""
        self._check_not_closed()
        return self._fp.fileno()

    def seekable(self):
        """Return whether the file supports seeking."""
        return self.readable() and self._buffer.seekable()

    def readable(self):
        """Return whether the file was opened for reading."""
        self._check_not_closed()
        return self._mode == _MODE_READ

    def writable(self):
        """Return whether the file was opened for writing."""
        self._check_not_closed()
        return self._mode == _MODE_WRITE

    def peek(self, size=-1):
        """Return buffered data without advancing the file position.

        Always returns at least one byte of data, unless at EOF.
        The exact number of bytes returned is unspecified.
        """
        self._check_can_read()
        # Relies on the undocumented fact that BufferedReader.peek() always
        # returns at least one byte (except at EOF)
        return self._buffer.peek(size)

    def read(self, size=-1):
        """Read up to size uncompressed bytes from the file.

        If size is negative or omitted, read until EOF is reached.
        Returns b"" if the file is already at EOF.
        """
        self._check_can_read()
        return self._buffer.read(size)

    def read1(self, size=-1):
        """Read up to size uncompressed bytes, while trying to avoid
        making multiple reads from the underlying stream. Reads up to a
        buffer's worth of data if size is negative.

        Returns b"" if the file is at EOF.
        """
        self._check_can_read()
        if size < 0:
            size = io.DEFAULT_BUFFER_SIZE
        return self._buffer.read1(size)

    def readline(self, size=-1):
        """Read a line of uncompressed bytes from the file.

        The terminating newline (if present) is retained. If size is
        non-negative, no more than size bytes will be read (in which
        case the line may be incomplete). Returns b'' if already at EOF.
        """
        self._check_can_read()
        return self._buffer.readline(size)

    def write(self, data):
        """Write a bytes object to the file.

        Returns the number of uncompressed bytes written, which is
        always len(data). Note that due to buffering, the file on disk
        may not reflect the data written until close() is called.
        """
        self._check_can_write()
        compressed = self._compressor.compress(data)
        self._fp.write(compressed)
        self._pos += len(data)
        return len(data)

    def seek(self, offset, whence=io.SEEK_SET):
        """Change the file position.

        The new position is specified by offset, relative to the
        position indicated by whence. Possible values for whence are:

            0: start of stream (default): offset must not be negative
            1: current stream position
            2: end of stream; offset must not be positive

        Returns the new file position.

        Note that seeking is emulated, so depending on the parameters,
        this operation may be extremely slow.
        """
        self._check_can_seek()
        return self._buffer.seek(offset, whence)

    def tell(self):
        """Return the current file position."""
        self._check_not_closed()
        if self._mode == _MODE_READ:
            return self._buffer.tell()
        return self._pos


def open(filename, mode="rb", *,
         format=None, check=-1, preset=None, filters=None,
         encoding=None, errors=None, newline=None):
    """Open an LZMA-compressed file in binary or text mode.

    filename can be either an actual file name (given as a str, bytes,
    or PathLike object), in which case the named file is opened, or it
    can be an existing file object to read from or write to.

    The mode argument can be "r", "rb" (default), "w", "wb", "x", "xb",
    "a", or "ab" for binary mode, or "rt", "wt", "xt", or "at" for text
    mode.

    The format, check, preset and filters arguments specify the
    compression settings, as for LZMACompressor, LZMADecompressor and
    LZMAFile.

    For binary mode, this function is equivalent to the LZMAFile
    constructor: LZMAFile(filename, mode, ...). In this case, the
    encoding, errors and newline arguments must not be provided.

    For text mode, an LZMAFile object is created, and wrapped in an
    io.TextIOWrapper instance with the specified encoding, error
    handling behavior, and line ending(s).

    """
    if "t" in mode:
        if "b" in mode:
            raise ValueError("Invalid mode: %r" % (mode,))
    else:
        if encoding is not None:
            raise ValueError("Argument 'encoding' not supported in binary mode")
        if errors is not None:
            raise ValueError("Argument 'errors' not supported in binary mode")
        if newline is not None:
            raise ValueError("Argument 'newline' not supported in binary mode")

    lz_mode = mode.replace("t", "")
    binary_file = LZMAFile(filename, lz_mode, format=format, check=check,
                           preset=preset, filters=filters)

    if "t" in mode:
        return io.TextIOWrapper(binary_file, encoding, errors, newline)
    else:
        return binary_file


def compress(data, format=FORMAT_XZ, check=-1, preset=None, filters=None):
    """Compress a block of data.

    Refer to LZMACompressor's docstring for a description of the
    optional arguments *format*, *check*, *preset* and *filters*.

    For incremental compression, use an LZMACompressor instead.
    """
    comp = LZMACompressor(format, check, preset, filters)
    return comp.compress(data) + comp.flush()


def decompress(data, format=FORMAT_AUTO, memlimit=None, filters=None):
    """Decompress a block of data.

    Refer to LZMADecompressor's docstring for a description of the
    optional arguments *format*, *check* and *filters*.

    For incremental decompression, use an LZMADecompressor instead.
    """
    results = []
    while True:
        decomp = LZMADecompressor(format, memlimit, filters)
        try:
            res = decomp.decompress(data)
        except LZMAError:
            if results:
                break  # Leftover data is not a valid LZMA/XZ stream; ignore it.
            else:
                raise  # Error on the first iteration; bail out.
        results.append(res)
        if not decomp.eof:
            raise LZMAError("Compressed data ended before the "
                            "end-of-stream marker was reached")
        data = decomp.unused_data
        if not data:
            break
    return b"".join(results)
compileall.py000064400000032556151153537460007264 0ustar00"""Module/script to byte-compile all .py files to .pyc files.

When called as a script with arguments, this compiles the directories
given as arguments recursively; the -l option prevents it from
recursing into directories.

Without arguments, if compiles all modules on sys.path, without
recursing into subdirectories.  (Even though it should do so for
packages -- for now, you'll have to deal with packages separately.)

See module py_compile for details of the actual byte-compilation.
"""
import os
import sys
import importlib.util
import py_compile
import struct

from functools import partial

__all__ = ["compile_dir","compile_file","compile_path"]

def _walk_dir(dir, ddir=None, maxlevels=10, quiet=0):
    if quiet < 2 and isinstance(dir, os.PathLike):
        dir = os.fspath(dir)
    if not quiet:
        print('Listing {!r}...'.format(dir))
    try:
        names = os.listdir(dir)
    except OSError:
        if quiet < 2:
            print("Can't list {!r}".format(dir))
        names = []
    names.sort()
    for name in names:
        if name == '__pycache__':
            continue
        fullname = os.path.join(dir, name)
        if ddir is not None:
            dfile = os.path.join(ddir, name)
        else:
            dfile = None
        if not os.path.isdir(fullname):
            yield fullname, ddir
        elif (maxlevels > 0 and name != os.curdir and name != os.pardir and
              os.path.isdir(fullname) and not os.path.islink(fullname)):
            yield from _walk_dir(fullname, ddir=dfile,
                                 maxlevels=maxlevels - 1, quiet=quiet)

def compile_dir(dir, maxlevels=10, ddir=None, force=False, rx=None,
                quiet=0, legacy=False, optimize=-1, workers=1,
                invalidation_mode=None):
    """Byte-compile all modules in the given directory tree.

    Arguments (only dir is required):

    dir:       the directory to byte-compile
    maxlevels: maximum recursion level (default 10)
    ddir:      the directory that will be prepended to the path to the
               file as it is compiled into each byte-code file.
    force:     if True, force compilation, even if timestamps are up-to-date
    quiet:     full output with False or 0, errors only with 1,
               no output with 2
    legacy:    if True, produce legacy pyc paths instead of PEP 3147 paths
    optimize:  optimization level or -1 for level of the interpreter
    workers:   maximum number of parallel workers
    invalidation_mode: how the up-to-dateness of the pyc will be checked
    """
    ProcessPoolExecutor = None
    if workers < 0:
        raise ValueError('workers must be greater or equal to 0')
    if workers != 1:
        try:
            # Only import when needed, as low resource platforms may
            # fail to import it
            from concurrent.futures import ProcessPoolExecutor
        except ImportError:
            workers = 1
    files_and_ddirs = _walk_dir(dir, quiet=quiet, maxlevels=maxlevels,
                                ddir=ddir)
    success = True
    if workers != 1 and ProcessPoolExecutor is not None:
        # If workers == 0, let ProcessPoolExecutor choose
        workers = workers or None
        with ProcessPoolExecutor(max_workers=workers) as executor:
            results = executor.map(
                    partial(_compile_file_tuple,
                            force=force, rx=rx, quiet=quiet,
                            legacy=legacy, optimize=optimize,
                            invalidation_mode=invalidation_mode,
                        ),
                    files_and_ddirs)
            success = min(results, default=True)
    else:
        for file, dfile in files_and_ddirs:
            if not compile_file(file, dfile, force, rx, quiet,
                                legacy, optimize, invalidation_mode):
                success = False
    return success

def _compile_file_tuple(file_and_dfile, **kwargs):
    """Needs to be toplevel for ProcessPoolExecutor."""
    file, dfile = file_and_dfile
    return compile_file(file, dfile, **kwargs)

def compile_file(fullname, ddir=None, force=False, rx=None, quiet=0,
                 legacy=False, optimize=-1,
                 invalidation_mode=None):
    """Byte-compile one file.

    Arguments (only fullname is required):

    fullname:  the file to byte-compile
    ddir:      if given, the directory name compiled in to the
               byte-code file.
    force:     if True, force compilation, even if timestamps are up-to-date
    quiet:     full output with False or 0, errors only with 1,
               no output with 2
    legacy:    if True, produce legacy pyc paths instead of PEP 3147 paths
    optimize:  optimization level or -1 for level of the interpreter
    invalidation_mode: how the up-to-dateness of the pyc will be checked
    """
    success = True
    if quiet < 2 and isinstance(fullname, os.PathLike):
        fullname = os.fspath(fullname)
    name = os.path.basename(fullname)
    if ddir is not None:
        dfile = os.path.join(ddir, name)
    else:
        dfile = None
    if rx is not None:
        mo = rx.search(fullname)
        if mo:
            return success
    if os.path.isfile(fullname):
        if legacy:
            cfile = fullname + 'c'
        else:
            if optimize >= 0:
                opt = optimize if optimize >= 1 else ''
                cfile = importlib.util.cache_from_source(
                                fullname, optimization=opt)
            else:
                cfile = importlib.util.cache_from_source(fullname)
            cache_dir = os.path.dirname(cfile)
        head, tail = name[:-3], name[-3:]
        if tail == '.py':
            if not force:
                try:
                    mtime = int(os.stat(fullname).st_mtime)
                    expect = struct.pack('<4sll', importlib.util.MAGIC_NUMBER,
                                         0, mtime)
                    with open(cfile, 'rb') as chandle:
                        actual = chandle.read(12)
                    if expect == actual:
                        return success
                except OSError:
                    pass
            if not quiet:
                print('Compiling {!r}...'.format(fullname))
            try:
                ok = py_compile.compile(fullname, cfile, dfile, True,
                                        optimize=optimize,
                                        invalidation_mode=invalidation_mode)
            except py_compile.PyCompileError as err:
                success = False
                if quiet >= 2:
                    return success
                elif quiet:
                    print('*** Error compiling {!r}...'.format(fullname))
                else:
                    print('*** ', end='')
                # escape non-printable characters in msg
                msg = err.msg.encode(sys.stdout.encoding,
                                     errors='backslashreplace')
                msg = msg.decode(sys.stdout.encoding)
                print(msg)
            except (SyntaxError, UnicodeError, OSError) as e:
                success = False
                if quiet >= 2:
                    return success
                elif quiet:
                    print('*** Error compiling {!r}...'.format(fullname))
                else:
                    print('*** ', end='')
                print(e.__class__.__name__ + ':', e)
            else:
                if ok == 0:
                    success = False
    return success

def compile_path(skip_curdir=1, maxlevels=0, force=False, quiet=0,
                 legacy=False, optimize=-1,
                 invalidation_mode=None):
    """Byte-compile all module on sys.path.

    Arguments (all optional):

    skip_curdir: if true, skip current directory (default True)
    maxlevels:   max recursion level (default 0)
    force: as for compile_dir() (default False)
    quiet: as for compile_dir() (default 0)
    legacy: as for compile_dir() (default False)
    optimize: as for compile_dir() (default -1)
    invalidation_mode: as for compiler_dir()
    """
    success = True
    for dir in sys.path:
        if (not dir or dir == os.curdir) and skip_curdir:
            if quiet < 2:
                print('Skipping current directory')
        else:
            success = success and compile_dir(
                dir,
                maxlevels,
                None,
                force,
                quiet=quiet,
                legacy=legacy,
                optimize=optimize,
                invalidation_mode=invalidation_mode,
            )
    return success


def main():
    """Script main program."""
    import argparse

    parser = argparse.ArgumentParser(
        description='Utilities to support installing Python libraries.')
    parser.add_argument('-l', action='store_const', const=0,
                        default=10, dest='maxlevels',
                        help="don't recurse into subdirectories")
    parser.add_argument('-r', type=int, dest='recursion',
                        help=('control the maximum recursion level. '
                              'if `-l` and `-r` options are specified, '
                              'then `-r` takes precedence.'))
    parser.add_argument('-f', action='store_true', dest='force',
                        help='force rebuild even if timestamps are up to date')
    parser.add_argument('-q', action='count', dest='quiet', default=0,
                        help='output only error messages; -qq will suppress '
                             'the error messages as well.')
    parser.add_argument('-b', action='store_true', dest='legacy',
                        help='use legacy (pre-PEP3147) compiled file locations')
    parser.add_argument('-d', metavar='DESTDIR',  dest='ddir', default=None,
                        help=('directory to prepend to file paths for use in '
                              'compile-time tracebacks and in runtime '
                              'tracebacks in cases where the source file is '
                              'unavailable'))
    parser.add_argument('-x', metavar='REGEXP', dest='rx', default=None,
                        help=('skip files matching the regular expression; '
                              'the regexp is searched for in the full path '
                              'of each file considered for compilation'))
    parser.add_argument('-i', metavar='FILE', dest='flist',
                        help=('add all the files and directories listed in '
                              'FILE to the list considered for compilation; '
                              'if "-", names are read from stdin'))
    parser.add_argument('compile_dest', metavar='FILE|DIR', nargs='*',
                        help=('zero or more file and directory names '
                              'to compile; if no arguments given, defaults '
                              'to the equivalent of -l sys.path'))
    parser.add_argument('-j', '--workers', default=1,
                        type=int, help='Run compileall concurrently')
    invalidation_modes = [mode.name.lower().replace('_', '-')
                          for mode in py_compile.PycInvalidationMode]
    parser.add_argument('--invalidation-mode',
                        choices=sorted(invalidation_modes),
                        help=('set .pyc invalidation mode; defaults to '
                              '"checked-hash" if the SOURCE_DATE_EPOCH '
                              'environment variable is set, and '
                              '"timestamp" otherwise.'))

    args = parser.parse_args()
    compile_dests = args.compile_dest

    if args.rx:
        import re
        args.rx = re.compile(args.rx)


    if args.recursion is not None:
        maxlevels = args.recursion
    else:
        maxlevels = args.maxlevels

    # if flist is provided then load it
    if args.flist:
        try:
            with (sys.stdin if args.flist=='-' else open(args.flist)) as f:
                for line in f:
                    compile_dests.append(line.strip())
        except OSError:
            if args.quiet < 2:
                print("Error reading file list {}".format(args.flist))
            return False

    if args.invalidation_mode:
        ivl_mode = args.invalidation_mode.replace('-', '_').upper()
        invalidation_mode = py_compile.PycInvalidationMode[ivl_mode]
    else:
        invalidation_mode = None

    success = True
    try:
        if compile_dests:
            for dest in compile_dests:
                if os.path.isfile(dest):
                    if not compile_file(dest, args.ddir, args.force, args.rx,
                                        args.quiet, args.legacy,
                                        invalidation_mode=invalidation_mode):
                        success = False
                else:
                    if not compile_dir(dest, maxlevels, args.ddir,
                                       args.force, args.rx, args.quiet,
                                       args.legacy, workers=args.workers,
                                       invalidation_mode=invalidation_mode):
                        success = False
            return success
        else:
            return compile_path(legacy=args.legacy, force=args.force,
                                quiet=args.quiet,
                                invalidation_mode=invalidation_mode)
    except KeyboardInterrupt:
        if args.quiet < 2:
            print("\n[interrupted]")
        return False
    return True


if __name__ == '__main__':
    exit_status = int(not main())
    sys.exit(exit_status)
signal.py000064400000004341151153537460006407 0ustar00import _signal
from _signal import *
from functools import wraps as _wraps
from enum import IntEnum as _IntEnum

_globals = globals()

_IntEnum._convert_(
        'Signals', __name__,
        lambda name:
            name.isupper()
            and (name.startswith('SIG') and not name.startswith('SIG_'))
            or name.startswith('CTRL_'))

_IntEnum._convert_(
        'Handlers', __name__,
        lambda name: name in ('SIG_DFL', 'SIG_IGN'))

if 'pthread_sigmask' in _globals:
    _IntEnum._convert_(
            'Sigmasks', __name__,
            lambda name: name in ('SIG_BLOCK', 'SIG_UNBLOCK', 'SIG_SETMASK'))


def _int_to_enum(value, enum_klass):
    """Convert a numeric value to an IntEnum member.
    If it's not a known member, return the numeric value itself.
    """
    try:
        return enum_klass(value)
    except ValueError:
        return value


def _enum_to_int(value):
    """Convert an IntEnum member to a numeric value.
    If it's not an IntEnum member return the value itself.
    """
    try:
        return int(value)
    except (ValueError, TypeError):
        return value


@_wraps(_signal.signal)
def signal(signalnum, handler):
    handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
    return _int_to_enum(handler, Handlers)


@_wraps(_signal.getsignal)
def getsignal(signalnum):
    handler = _signal.getsignal(signalnum)
    return _int_to_enum(handler, Handlers)


if 'pthread_sigmask' in _globals:
    @_wraps(_signal.pthread_sigmask)
    def pthread_sigmask(how, mask):
        sigs_set = _signal.pthread_sigmask(how, mask)
        return set(_int_to_enum(x, Signals) for x in sigs_set)
    pthread_sigmask.__doc__ = _signal.pthread_sigmask.__doc__


if 'sigpending' in _globals:
    @_wraps(_signal.sigpending)
    def sigpending():
        return {_int_to_enum(x, Signals) for x in _signal.sigpending()}


if 'sigwait' in _globals:
    @_wraps(_signal.sigwait)
    def sigwait(sigset):
        retsig = _signal.sigwait(sigset)
        return _int_to_enum(retsig, Signals)
    sigwait.__doc__ = _signal.sigwait


if 'valid_signals' in _globals:
    @_wraps(_signal.valid_signals)
    def valid_signals():
        return {_int_to_enum(x, Signals) for x in _signal.valid_signals()}


del _globals, _wraps
sre_parse.py000064400000116446151153537460007127 0ustar00#
# Secret Labs' Regular Expression Engine
#
# convert re-style regular expression to sre pattern
#
# Copyright (c) 1998-2001 by Secret Labs AB.  All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#

"""Internal support module for sre"""

# XXX: show string offset and offending character for all errors

from sre_constants import *

SPECIAL_CHARS = ".\\[{()*+?^$|"
REPEAT_CHARS = "*+?{"

DIGITS = frozenset("0123456789")

OCTDIGITS = frozenset("01234567")
HEXDIGITS = frozenset("0123456789abcdefABCDEF")
ASCIILETTERS = frozenset("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")

WHITESPACE = frozenset(" \t\n\r\v\f")

_REPEATCODES = frozenset({MIN_REPEAT, MAX_REPEAT})
_UNITCODES = frozenset({ANY, RANGE, IN, LITERAL, NOT_LITERAL, CATEGORY})

ESCAPES = {
    r"\a": (LITERAL, ord("\a")),
    r"\b": (LITERAL, ord("\b")),
    r"\f": (LITERAL, ord("\f")),
    r"\n": (LITERAL, ord("\n")),
    r"\r": (LITERAL, ord("\r")),
    r"\t": (LITERAL, ord("\t")),
    r"\v": (LITERAL, ord("\v")),
    r"\\": (LITERAL, ord("\\"))
}

CATEGORIES = {
    r"\A": (AT, AT_BEGINNING_STRING), # start of string
    r"\b": (AT, AT_BOUNDARY),
    r"\B": (AT, AT_NON_BOUNDARY),
    r"\d": (IN, [(CATEGORY, CATEGORY_DIGIT)]),
    r"\D": (IN, [(CATEGORY, CATEGORY_NOT_DIGIT)]),
    r"\s": (IN, [(CATEGORY, CATEGORY_SPACE)]),
    r"\S": (IN, [(CATEGORY, CATEGORY_NOT_SPACE)]),
    r"\w": (IN, [(CATEGORY, CATEGORY_WORD)]),
    r"\W": (IN, [(CATEGORY, CATEGORY_NOT_WORD)]),
    r"\Z": (AT, AT_END_STRING), # end of string
}

FLAGS = {
    # standard flags
    "i": SRE_FLAG_IGNORECASE,
    "L": SRE_FLAG_LOCALE,
    "m": SRE_FLAG_MULTILINE,
    "s": SRE_FLAG_DOTALL,
    "x": SRE_FLAG_VERBOSE,
    # extensions
    "a": SRE_FLAG_ASCII,
    "t": SRE_FLAG_TEMPLATE,
    "u": SRE_FLAG_UNICODE,
}

TYPE_FLAGS = SRE_FLAG_ASCII | SRE_FLAG_LOCALE | SRE_FLAG_UNICODE
GLOBAL_FLAGS = SRE_FLAG_DEBUG | SRE_FLAG_TEMPLATE

class Verbose(Exception):
    pass

class State:
    # keeps track of state for parsing
    def __init__(self):
        self.flags = 0
        self.groupdict = {}
        self.groupwidths = [None]  # group 0
        self.lookbehindgroups = None
    @property
    def groups(self):
        return len(self.groupwidths)
    def opengroup(self, name=None):
        gid = self.groups
        self.groupwidths.append(None)
        if self.groups > MAXGROUPS:
            raise error("too many groups")
        if name is not None:
            ogid = self.groupdict.get(name, None)
            if ogid is not None:
                raise error("redefinition of group name %r as group %d; "
                            "was group %d" % (name, gid,  ogid))
            self.groupdict[name] = gid
        return gid
    def closegroup(self, gid, p):
        self.groupwidths[gid] = p.getwidth()
    def checkgroup(self, gid):
        return gid < self.groups and self.groupwidths[gid] is not None

    def checklookbehindgroup(self, gid, source):
        if self.lookbehindgroups is not None:
            if not self.checkgroup(gid):
                raise source.error('cannot refer to an open group')
            if gid >= self.lookbehindgroups:
                raise source.error('cannot refer to group defined in the same '
                                   'lookbehind subpattern')

class SubPattern:
    # a subpattern, in intermediate form
    def __init__(self, state, data=None):
        self.state = state
        if data is None:
            data = []
        self.data = data
        self.width = None

    def dump(self, level=0):
        nl = True
        seqtypes = (tuple, list)
        for op, av in self.data:
            print(level*"  " + str(op), end='')
            if op is IN:
                # member sublanguage
                print()
                for op, a in av:
                    print((level+1)*"  " + str(op), a)
            elif op is BRANCH:
                print()
                for i, a in enumerate(av[1]):
                    if i:
                        print(level*"  " + "OR")
                    a.dump(level+1)
            elif op is GROUPREF_EXISTS:
                condgroup, item_yes, item_no = av
                print('', condgroup)
                item_yes.dump(level+1)
                if item_no:
                    print(level*"  " + "ELSE")
                    item_no.dump(level+1)
            elif isinstance(av, seqtypes):
                nl = False
                for a in av:
                    if isinstance(a, SubPattern):
                        if not nl:
                            print()
                        a.dump(level+1)
                        nl = True
                    else:
                        if not nl:
                            print(' ', end='')
                        print(a, end='')
                        nl = False
                if not nl:
                    print()
            else:
                print('', av)
    def __repr__(self):
        return repr(self.data)
    def __len__(self):
        return len(self.data)
    def __delitem__(self, index):
        del self.data[index]
    def __getitem__(self, index):
        if isinstance(index, slice):
            return SubPattern(self.state, self.data[index])
        return self.data[index]
    def __setitem__(self, index, code):
        self.data[index] = code
    def insert(self, index, code):
        self.data.insert(index, code)
    def append(self, code):
        self.data.append(code)
    def getwidth(self):
        # determine the width (min, max) for this subpattern
        if self.width is not None:
            return self.width
        lo = hi = 0
        for op, av in self.data:
            if op is BRANCH:
                i = MAXREPEAT - 1
                j = 0
                for av in av[1]:
                    l, h = av.getwidth()
                    i = min(i, l)
                    j = max(j, h)
                lo = lo + i
                hi = hi + j
            elif op is CALL:
                i, j = av.getwidth()
                lo = lo + i
                hi = hi + j
            elif op is SUBPATTERN:
                i, j = av[-1].getwidth()
                lo = lo + i
                hi = hi + j
            elif op in _REPEATCODES:
                i, j = av[2].getwidth()
                lo = lo + i * av[0]
                hi = hi + j * av[1]
            elif op in _UNITCODES:
                lo = lo + 1
                hi = hi + 1
            elif op is GROUPREF:
                i, j = self.state.groupwidths[av]
                lo = lo + i
                hi = hi + j
            elif op is GROUPREF_EXISTS:
                i, j = av[1].getwidth()
                if av[2] is not None:
                    l, h = av[2].getwidth()
                    i = min(i, l)
                    j = max(j, h)
                else:
                    i = 0
                lo = lo + i
                hi = hi + j
            elif op is SUCCESS:
                break
        self.width = min(lo, MAXREPEAT - 1), min(hi, MAXREPEAT)
        return self.width

class Tokenizer:
    def __init__(self, string):
        self.istext = isinstance(string, str)
        self.string = string
        if not self.istext:
            string = str(string, 'latin1')
        self.decoded_string = string
        self.index = 0
        self.next = None
        self.__next()
    def __next(self):
        index = self.index
        try:
            char = self.decoded_string[index]
        except IndexError:
            self.next = None
            return
        if char == "\\":
            index += 1
            try:
                char += self.decoded_string[index]
            except IndexError:
                raise error("bad escape (end of pattern)",
                            self.string, len(self.string) - 1) from None
        self.index = index + 1
        self.next = char
    def match(self, char):
        if char == self.next:
            self.__next()
            return True
        return False
    def get(self):
        this = self.next
        self.__next()
        return this
    def getwhile(self, n, charset):
        result = ''
        for _ in range(n):
            c = self.next
            if c not in charset:
                break
            result += c
            self.__next()
        return result
    def getuntil(self, terminator, name):
        result = ''
        while True:
            c = self.next
            self.__next()
            if c is None:
                if not result:
                    raise self.error("missing " + name)
                raise self.error("missing %s, unterminated name" % terminator,
                                 len(result))
            if c == terminator:
                if not result:
                    raise self.error("missing " + name, 1)
                break
            result += c
        return result
    @property
    def pos(self):
        return self.index - len(self.next or '')
    def tell(self):
        return self.index - len(self.next or '')
    def seek(self, index):
        self.index = index
        self.__next()

    def error(self, msg, offset=0):
        return error(msg, self.string, self.tell() - offset)

def _class_escape(source, escape):
    # handle escape code inside character class
    code = ESCAPES.get(escape)
    if code:
        return code
    code = CATEGORIES.get(escape)
    if code and code[0] is IN:
        return code
    try:
        c = escape[1:2]
        if c == "x":
            # hexadecimal escape (exactly two digits)
            escape += source.getwhile(2, HEXDIGITS)
            if len(escape) != 4:
                raise source.error("incomplete escape %s" % escape, len(escape))
            return LITERAL, int(escape[2:], 16)
        elif c == "u" and source.istext:
            # unicode escape (exactly four digits)
            escape += source.getwhile(4, HEXDIGITS)
            if len(escape) != 6:
                raise source.error("incomplete escape %s" % escape, len(escape))
            return LITERAL, int(escape[2:], 16)
        elif c == "U" and source.istext:
            # unicode escape (exactly eight digits)
            escape += source.getwhile(8, HEXDIGITS)
            if len(escape) != 10:
                raise source.error("incomplete escape %s" % escape, len(escape))
            c = int(escape[2:], 16)
            chr(c) # raise ValueError for invalid code
            return LITERAL, c
        elif c == "N" and source.istext:
            import unicodedata
            # named unicode escape e.g. \N{EM DASH}
            if not source.match('{'):
                raise source.error("missing {")
            charname = source.getuntil('}', 'character name')
            try:
                c = ord(unicodedata.lookup(charname))
            except KeyError:
                raise source.error("undefined character name %r" % charname,
                                   len(charname) + len(r'\N{}'))
            return LITERAL, c
        elif c in OCTDIGITS:
            # octal escape (up to three digits)
            escape += source.getwhile(2, OCTDIGITS)
            c = int(escape[1:], 8)
            if c > 0o377:
                raise source.error('octal escape value %s outside of '
                                   'range 0-0o377' % escape, len(escape))
            return LITERAL, c
        elif c in DIGITS:
            raise ValueError
        if len(escape) == 2:
            if c in ASCIILETTERS:
                raise source.error('bad escape %s' % escape, len(escape))
            return LITERAL, ord(escape[1])
    except ValueError:
        pass
    raise source.error("bad escape %s" % escape, len(escape))

def _escape(source, escape, state):
    # handle escape code in expression
    code = CATEGORIES.get(escape)
    if code:
        return code
    code = ESCAPES.get(escape)
    if code:
        return code
    try:
        c = escape[1:2]
        if c == "x":
            # hexadecimal escape
            escape += source.getwhile(2, HEXDIGITS)
            if len(escape) != 4:
                raise source.error("incomplete escape %s" % escape, len(escape))
            return LITERAL, int(escape[2:], 16)
        elif c == "u" and source.istext:
            # unicode escape (exactly four digits)
            escape += source.getwhile(4, HEXDIGITS)
            if len(escape) != 6:
                raise source.error("incomplete escape %s" % escape, len(escape))
            return LITERAL, int(escape[2:], 16)
        elif c == "U" and source.istext:
            # unicode escape (exactly eight digits)
            escape += source.getwhile(8, HEXDIGITS)
            if len(escape) != 10:
                raise source.error("incomplete escape %s" % escape, len(escape))
            c = int(escape[2:], 16)
            chr(c) # raise ValueError for invalid code
            return LITERAL, c
        elif c == "N" and source.istext:
            import unicodedata
            # named unicode escape e.g. \N{EM DASH}
            if not source.match('{'):
                raise source.error("missing {")
            charname = source.getuntil('}', 'character name')
            try:
                c = ord(unicodedata.lookup(charname))
            except KeyError:
                raise source.error("undefined character name %r" % charname,
                                   len(charname) + len(r'\N{}'))
            return LITERAL, c
        elif c == "0":
            # octal escape
            escape += source.getwhile(2, OCTDIGITS)
            return LITERAL, int(escape[1:], 8)
        elif c in DIGITS:
            # octal escape *or* decimal group reference (sigh)
            if source.next in DIGITS:
                escape += source.get()
                if (escape[1] in OCTDIGITS and escape[2] in OCTDIGITS and
                    source.next in OCTDIGITS):
                    # got three octal digits; this is an octal escape
                    escape += source.get()
                    c = int(escape[1:], 8)
                    if c > 0o377:
                        raise source.error('octal escape value %s outside of '
                                           'range 0-0o377' % escape,
                                           len(escape))
                    return LITERAL, c
            # not an octal escape, so this is a group reference
            group = int(escape[1:])
            if group < state.groups:
                if not state.checkgroup(group):
                    raise source.error("cannot refer to an open group",
                                       len(escape))
                state.checklookbehindgroup(group, source)
                return GROUPREF, group
            raise source.error("invalid group reference %d" % group, len(escape) - 1)
        if len(escape) == 2:
            if c in ASCIILETTERS:
                raise source.error("bad escape %s" % escape, len(escape))
            return LITERAL, ord(escape[1])
    except ValueError:
        pass
    raise source.error("bad escape %s" % escape, len(escape))

def _uniq(items):
    return list(dict.fromkeys(items))

def _parse_sub(source, state, verbose, nested):
    # parse an alternation: a|b|c

    items = []
    itemsappend = items.append
    sourcematch = source.match
    start = source.tell()
    while True:
        itemsappend(_parse(source, state, verbose, nested + 1,
                           not nested and not items))
        if not sourcematch("|"):
            break

    if len(items) == 1:
        return items[0]

    subpattern = SubPattern(state)

    # check if all items share a common prefix
    while True:
        prefix = None
        for item in items:
            if not item:
                break
            if prefix is None:
                prefix = item[0]
            elif item[0] != prefix:
                break
        else:
            # all subitems start with a common "prefix".
            # move it out of the branch
            for item in items:
                del item[0]
            subpattern.append(prefix)
            continue # check next one
        break

    # check if the branch can be replaced by a character set
    set = []
    for item in items:
        if len(item) != 1:
            break
        op, av = item[0]
        if op is LITERAL:
            set.append((op, av))
        elif op is IN and av[0][0] is not NEGATE:
            set.extend(av)
        else:
            break
    else:
        # we can store this as a character set instead of a
        # branch (the compiler may optimize this even more)
        subpattern.append((IN, _uniq(set)))
        return subpattern

    subpattern.append((BRANCH, (None, items)))
    return subpattern

def _parse(source, state, verbose, nested, first=False):
    # parse a simple pattern
    subpattern = SubPattern(state)

    # precompute constants into local variables
    subpatternappend = subpattern.append
    sourceget = source.get
    sourcematch = source.match
    _len = len
    _ord = ord

    while True:

        this = source.next
        if this is None:
            break # end of pattern
        if this in "|)":
            break # end of subpattern
        sourceget()

        if verbose:
            # skip whitespace and comments
            if this in WHITESPACE:
                continue
            if this == "#":
                while True:
                    this = sourceget()
                    if this is None or this == "\n":
                        break
                continue

        if this[0] == "\\":
            code = _escape(source, this, state)
            subpatternappend(code)

        elif this not in SPECIAL_CHARS:
            subpatternappend((LITERAL, _ord(this)))

        elif this == "[":
            here = source.tell() - 1
            # character set
            set = []
            setappend = set.append
##          if sourcematch(":"):
##              pass # handle character classes
            if source.next == '[':
                import warnings
                warnings.warn(
                    'Possible nested set at position %d' % source.tell(),
                    FutureWarning, stacklevel=nested + 6
                )
            negate = sourcematch("^")
            # check remaining characters
            while True:
                this = sourceget()
                if this is None:
                    raise source.error("unterminated character set",
                                       source.tell() - here)
                if this == "]" and set:
                    break
                elif this[0] == "\\":
                    code1 = _class_escape(source, this)
                else:
                    if set and this in '-&~|' and source.next == this:
                        import warnings
                        warnings.warn(
                            'Possible set %s at position %d' % (
                                'difference' if this == '-' else
                                'intersection' if this == '&' else
                                'symmetric difference' if this == '~' else
                                'union',
                                source.tell() - 1),
                            FutureWarning, stacklevel=nested + 6
                        )
                    code1 = LITERAL, _ord(this)
                if sourcematch("-"):
                    # potential range
                    that = sourceget()
                    if that is None:
                        raise source.error("unterminated character set",
                                           source.tell() - here)
                    if that == "]":
                        if code1[0] is IN:
                            code1 = code1[1][0]
                        setappend(code1)
                        setappend((LITERAL, _ord("-")))
                        break
                    if that[0] == "\\":
                        code2 = _class_escape(source, that)
                    else:
                        if that == '-':
                            import warnings
                            warnings.warn(
                                'Possible set difference at position %d' % (
                                    source.tell() - 2),
                                FutureWarning, stacklevel=nested + 6
                            )
                        code2 = LITERAL, _ord(that)
                    if code1[0] != LITERAL or code2[0] != LITERAL:
                        msg = "bad character range %s-%s" % (this, that)
                        raise source.error(msg, len(this) + 1 + len(that))
                    lo = code1[1]
                    hi = code2[1]
                    if hi < lo:
                        msg = "bad character range %s-%s" % (this, that)
                        raise source.error(msg, len(this) + 1 + len(that))
                    setappend((RANGE, (lo, hi)))
                else:
                    if code1[0] is IN:
                        code1 = code1[1][0]
                    setappend(code1)

            set = _uniq(set)
            # XXX: <fl> should move set optimization to compiler!
            if _len(set) == 1 and set[0][0] is LITERAL:
                # optimization
                if negate:
                    subpatternappend((NOT_LITERAL, set[0][1]))
                else:
                    subpatternappend(set[0])
            else:
                if negate:
                    set.insert(0, (NEGATE, None))
                # charmap optimization can't be added here because
                # global flags still are not known
                subpatternappend((IN, set))

        elif this in REPEAT_CHARS:
            # repeat previous item
            here = source.tell()
            if this == "?":
                min, max = 0, 1
            elif this == "*":
                min, max = 0, MAXREPEAT

            elif this == "+":
                min, max = 1, MAXREPEAT
            elif this == "{":
                if source.next == "}":
                    subpatternappend((LITERAL, _ord(this)))
                    continue

                min, max = 0, MAXREPEAT
                lo = hi = ""
                while source.next in DIGITS:
                    lo += sourceget()
                if sourcematch(","):
                    while source.next in DIGITS:
                        hi += sourceget()
                else:
                    hi = lo
                if not sourcematch("}"):
                    subpatternappend((LITERAL, _ord(this)))
                    source.seek(here)
                    continue

                if lo:
                    min = int(lo)
                    if min >= MAXREPEAT:
                        raise OverflowError("the repetition number is too large")
                if hi:
                    max = int(hi)
                    if max >= MAXREPEAT:
                        raise OverflowError("the repetition number is too large")
                    if max < min:
                        raise source.error("min repeat greater than max repeat",
                                           source.tell() - here)
            else:
                raise AssertionError("unsupported quantifier %r" % (char,))
            # figure out which item to repeat
            if subpattern:
                item = subpattern[-1:]
            else:
                item = None
            if not item or item[0][0] is AT:
                raise source.error("nothing to repeat",
                                   source.tell() - here + len(this))
            if item[0][0] in _REPEATCODES:
                raise source.error("multiple repeat",
                                   source.tell() - here + len(this))
            if item[0][0] is SUBPATTERN:
                group, add_flags, del_flags, p = item[0][1]
                if group is None and not add_flags and not del_flags:
                    item = p
            if sourcematch("?"):
                subpattern[-1] = (MIN_REPEAT, (min, max, item))
            else:
                subpattern[-1] = (MAX_REPEAT, (min, max, item))

        elif this == ".":
            subpatternappend((ANY, None))

        elif this == "(":
            start = source.tell() - 1
            group = True
            name = None
            add_flags = 0
            del_flags = 0
            if sourcematch("?"):
                # options
                char = sourceget()
                if char is None:
                    raise source.error("unexpected end of pattern")
                if char == "P":
                    # python extensions
                    if sourcematch("<"):
                        # named group: skip forward to end of name
                        name = source.getuntil(">", "group name")
                        if not name.isidentifier():
                            msg = "bad character in group name %r" % name
                            raise source.error(msg, len(name) + 1)
                    elif sourcematch("="):
                        # named backreference
                        name = source.getuntil(")", "group name")
                        if not name.isidentifier():
                            msg = "bad character in group name %r" % name
                            raise source.error(msg, len(name) + 1)
                        gid = state.groupdict.get(name)
                        if gid is None:
                            msg = "unknown group name %r" % name
                            raise source.error(msg, len(name) + 1)
                        if not state.checkgroup(gid):
                            raise source.error("cannot refer to an open group",
                                               len(name) + 1)
                        state.checklookbehindgroup(gid, source)
                        subpatternappend((GROUPREF, gid))
                        continue

                    else:
                        char = sourceget()
                        if char is None:
                            raise source.error("unexpected end of pattern")
                        raise source.error("unknown extension ?P" + char,
                                           len(char) + 2)
                elif char == ":":
                    # non-capturing group
                    group = None
                elif char == "#":
                    # comment
                    while True:
                        if source.next is None:
                            raise source.error("missing ), unterminated comment",
                                               source.tell() - start)
                        if sourceget() == ")":
                            break
                    continue

                elif char in "=!<":
                    # lookahead assertions
                    dir = 1
                    if char == "<":
                        char = sourceget()
                        if char is None:
                            raise source.error("unexpected end of pattern")
                        if char not in "=!":
                            raise source.error("unknown extension ?<" + char,
                                               len(char) + 2)
                        dir = -1 # lookbehind
                        lookbehindgroups = state.lookbehindgroups
                        if lookbehindgroups is None:
                            state.lookbehindgroups = state.groups
                    p = _parse_sub(source, state, verbose, nested + 1)
                    if dir < 0:
                        if lookbehindgroups is None:
                            state.lookbehindgroups = None
                    if not sourcematch(")"):
                        raise source.error("missing ), unterminated subpattern",
                                           source.tell() - start)
                    if char == "=":
                        subpatternappend((ASSERT, (dir, p)))
                    else:
                        subpatternappend((ASSERT_NOT, (dir, p)))
                    continue

                elif char == "(":
                    # conditional backreference group
                    condname = source.getuntil(")", "group name")
                    if condname.isidentifier():
                        condgroup = state.groupdict.get(condname)
                        if condgroup is None:
                            msg = "unknown group name %r" % condname
                            raise source.error(msg, len(condname) + 1)
                    else:
                        try:
                            condgroup = int(condname)
                            if condgroup < 0:
                                raise ValueError
                        except ValueError:
                            msg = "bad character in group name %r" % condname
                            raise source.error(msg, len(condname) + 1) from None
                        if not condgroup:
                            raise source.error("bad group number",
                                               len(condname) + 1)
                        if condgroup >= MAXGROUPS:
                            msg = "invalid group reference %d" % condgroup
                            raise source.error(msg, len(condname) + 1)
                    state.checklookbehindgroup(condgroup, source)
                    item_yes = _parse(source, state, verbose, nested + 1)
                    if source.match("|"):
                        item_no = _parse(source, state, verbose, nested + 1)
                        if source.next == "|":
                            raise source.error("conditional backref with more than two branches")
                    else:
                        item_no = None
                    if not source.match(")"):
                        raise source.error("missing ), unterminated subpattern",
                                           source.tell() - start)
                    subpatternappend((GROUPREF_EXISTS, (condgroup, item_yes, item_no)))
                    continue

                elif char in FLAGS or char == "-":
                    # flags
                    flags = _parse_flags(source, state, char)
                    if flags is None:  # global flags
                        if not first or subpattern:
                            import warnings
                            warnings.warn(
                                'Flags not at the start of the expression %r%s' % (
                                    source.string[:20],  # truncate long regexes
                                    ' (truncated)' if len(source.string) > 20 else '',
                                ),
                                DeprecationWarning, stacklevel=nested + 6
                            )
                        if (state.flags & SRE_FLAG_VERBOSE) and not verbose:
                            raise Verbose
                        continue

                    add_flags, del_flags = flags
                    group = None
                else:
                    raise source.error("unknown extension ?" + char,
                                       len(char) + 1)

            # parse group contents
            if group is not None:
                try:
                    group = state.opengroup(name)
                except error as err:
                    raise source.error(err.msg, len(name) + 1) from None
            sub_verbose = ((verbose or (add_flags & SRE_FLAG_VERBOSE)) and
                           not (del_flags & SRE_FLAG_VERBOSE))
            p = _parse_sub(source, state, sub_verbose, nested + 1)
            if not source.match(")"):
                raise source.error("missing ), unterminated subpattern",
                                   source.tell() - start)
            if group is not None:
                state.closegroup(group, p)
            subpatternappend((SUBPATTERN, (group, add_flags, del_flags, p)))

        elif this == "^":
            subpatternappend((AT, AT_BEGINNING))

        elif this == "$":
            subpatternappend((AT, AT_END))

        else:
            raise AssertionError("unsupported special character %r" % (char,))

    # unpack non-capturing groups
    for i in range(len(subpattern))[::-1]:
        op, av = subpattern[i]
        if op is SUBPATTERN:
            group, add_flags, del_flags, p = av
            if group is None and not add_flags and not del_flags:
                subpattern[i: i+1] = p

    return subpattern

def _parse_flags(source, state, char):
    sourceget = source.get
    add_flags = 0
    del_flags = 0
    if char != "-":
        while True:
            flag = FLAGS[char]
            if source.istext:
                if char == 'L':
                    msg = "bad inline flags: cannot use 'L' flag with a str pattern"
                    raise source.error(msg)
            else:
                if char == 'u':
                    msg = "bad inline flags: cannot use 'u' flag with a bytes pattern"
                    raise source.error(msg)
            add_flags |= flag
            if (flag & TYPE_FLAGS) and (add_flags & TYPE_FLAGS) != flag:
                msg = "bad inline flags: flags 'a', 'u' and 'L' are incompatible"
                raise source.error(msg)
            char = sourceget()
            if char is None:
                raise source.error("missing -, : or )")
            if char in ")-:":
                break
            if char not in FLAGS:
                msg = "unknown flag" if char.isalpha() else "missing -, : or )"
                raise source.error(msg, len(char))
    if char == ")":
        state.flags |= add_flags
        return None
    if add_flags & GLOBAL_FLAGS:
        raise source.error("bad inline flags: cannot turn on global flag", 1)
    if char == "-":
        char = sourceget()
        if char is None:
            raise source.error("missing flag")
        if char not in FLAGS:
            msg = "unknown flag" if char.isalpha() else "missing flag"
            raise source.error(msg, len(char))
        while True:
            flag = FLAGS[char]
            if flag & TYPE_FLAGS:
                msg = "bad inline flags: cannot turn off flags 'a', 'u' and 'L'"
                raise source.error(msg)
            del_flags |= flag
            char = sourceget()
            if char is None:
                raise source.error("missing :")
            if char == ":":
                break
            if char not in FLAGS:
                msg = "unknown flag" if char.isalpha() else "missing :"
                raise source.error(msg, len(char))
    assert char == ":"
    if del_flags & GLOBAL_FLAGS:
        raise source.error("bad inline flags: cannot turn off global flag", 1)
    if add_flags & del_flags:
        raise source.error("bad inline flags: flag turned on and off", 1)
    return add_flags, del_flags

def fix_flags(src, flags):
    # Check and fix flags according to the type of pattern (str or bytes)
    if isinstance(src, str):
        if flags & SRE_FLAG_LOCALE:
            raise ValueError("cannot use LOCALE flag with a str pattern")
        if not flags & SRE_FLAG_ASCII:
            flags |= SRE_FLAG_UNICODE
        elif flags & SRE_FLAG_UNICODE:
            raise ValueError("ASCII and UNICODE flags are incompatible")
    else:
        if flags & SRE_FLAG_UNICODE:
            raise ValueError("cannot use UNICODE flag with a bytes pattern")
        if flags & SRE_FLAG_LOCALE and flags & SRE_FLAG_ASCII:
            raise ValueError("ASCII and LOCALE flags are incompatible")
    return flags

def parse(str, flags=0, state=None):
    # parse 're' pattern into list of (opcode, argument) tuples

    source = Tokenizer(str)

    if state is None:
        state = State()
    state.flags = flags
    state.str = str

    try:
        p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
    except Verbose:
        # the VERBOSE flag was switched on inside the pattern.  to be
        # on the safe side, we'll parse the whole thing again...
        state = State()
        state.flags = flags | SRE_FLAG_VERBOSE
        state.str = str
        source.seek(0)
        p = _parse_sub(source, state, True, 0)

    p.state.flags = fix_flags(str, p.state.flags)

    if source.next is not None:
        assert source.next == ")"
        raise source.error("unbalanced parenthesis")

    if flags & SRE_FLAG_DEBUG:
        p.dump()

    return p

def parse_template(source, state):
    # parse 're' replacement string into list of literals and
    # group references
    s = Tokenizer(source)
    sget = s.get
    groups = []
    literals = []
    literal = []
    lappend = literal.append
    def addgroup(index, pos):
        if index > state.groups:
            raise s.error("invalid group reference %d" % index, pos)
        if literal:
            literals.append(''.join(literal))
            del literal[:]
        groups.append((len(literals), index))
        literals.append(None)
    groupindex = state.groupindex
    while True:
        this = sget()
        if this is None:
            break # end of replacement string
        if this[0] == "\\":
            # group
            c = this[1]
            if c == "g":
                name = ""
                if not s.match("<"):
                    raise s.error("missing <")
                name = s.getuntil(">", "group name")
                if name.isidentifier():
                    try:
                        index = groupindex[name]
                    except KeyError:
                        raise IndexError("unknown group name %r" % name)
                else:
                    try:
                        index = int(name)
                        if index < 0:
                            raise ValueError
                    except ValueError:
                        raise s.error("bad character in group name %r" % name,
                                      len(name) + 1) from None
                    if index >= MAXGROUPS:
                        raise s.error("invalid group reference %d" % index,
                                      len(name) + 1)
                addgroup(index, len(name) + 1)
            elif c == "0":
                if s.next in OCTDIGITS:
                    this += sget()
                    if s.next in OCTDIGITS:
                        this += sget()
                lappend(chr(int(this[1:], 8) & 0xff))
            elif c in DIGITS:
                isoctal = False
                if s.next in DIGITS:
                    this += sget()
                    if (c in OCTDIGITS and this[2] in OCTDIGITS and
                        s.next in OCTDIGITS):
                        this += sget()
                        isoctal = True
                        c = int(this[1:], 8)
                        if c > 0o377:
                            raise s.error('octal escape value %s outside of '
                                          'range 0-0o377' % this, len(this))
                        lappend(chr(c))
                if not isoctal:
                    addgroup(int(this[1:]), len(this) - 1)
            else:
                try:
                    this = chr(ESCAPES[this][1])
                except KeyError:
                    if c in ASCIILETTERS:
                        raise s.error('bad escape %s' % this, len(this))
                lappend(this)
        else:
            lappend(this)
    if literal:
        literals.append(''.join(literal))
    if not isinstance(source, str):
        # The tokenizer implicitly decodes bytes objects as latin-1, we must
        # therefore re-encode the final representation.
        literals = [None if s is None else s.encode('latin-1') for s in literals]
    return groups, literals

def expand_template(template, match):
    g = match.group
    empty = match.string[:0]
    groups, literals = template
    literals = literals[:]
    try:
        for index, group in groups:
            literals[index] = g(group) or empty
    except IndexError:
        raise error("invalid group reference %d" % index)
    return empty.join(literals)
sched.py000064400000014452151153537470006225 0ustar00"""A generally useful event scheduler class.

Each instance of this class manages its own queue.
No multi-threading is implied; you are supposed to hack that
yourself, or use a single instance per application.

Each instance is parametrized with two functions, one that is
supposed to return the current time, one that is supposed to
implement a delay.  You can implement real-time scheduling by
substituting time and sleep from built-in module time, or you can
implement simulated time by writing your own functions.  This can
also be used to integrate scheduling with STDWIN events; the delay
function is allowed to modify the queue.  Time can be expressed as
integers or floating point numbers, as long as it is consistent.

Events are specified by tuples (time, priority, action, argument, kwargs).
As in UNIX, lower priority numbers mean higher priority; in this
way the queue can be maintained as a priority queue.  Execution of the
event means calling the action function, passing it the argument
sequence in "argument" (remember that in Python, multiple function
arguments are be packed in a sequence) and keyword parameters in "kwargs".
The action function may be an instance method so it
has another way to reference private data (besides global variables).
"""

import time
import heapq
from collections import namedtuple
import threading
from time import monotonic as _time

__all__ = ["scheduler"]

class Event(namedtuple('Event', 'time, priority, action, argument, kwargs')):
    __slots__ = []
    def __eq__(s, o): return (s.time, s.priority) == (o.time, o.priority)
    def __lt__(s, o): return (s.time, s.priority) <  (o.time, o.priority)
    def __le__(s, o): return (s.time, s.priority) <= (o.time, o.priority)
    def __gt__(s, o): return (s.time, s.priority) >  (o.time, o.priority)
    def __ge__(s, o): return (s.time, s.priority) >= (o.time, o.priority)

Event.time.__doc__ = ('''Numeric type compatible with the return value of the
timefunc function passed to the constructor.''')
Event.priority.__doc__ = ('''Events scheduled for the same time will be executed
in the order of their priority.''')
Event.action.__doc__ = ('''Executing the event means executing
action(*argument, **kwargs)''')
Event.argument.__doc__ = ('''argument is a sequence holding the positional
arguments for the action.''')
Event.kwargs.__doc__ = ('''kwargs is a dictionary holding the keyword
arguments for the action.''')

_sentinel = object()

class scheduler:

    def __init__(self, timefunc=_time, delayfunc=time.sleep):
        """Initialize a new instance, passing the time and delay
        functions"""
        self._queue = []
        self._lock = threading.RLock()
        self.timefunc = timefunc
        self.delayfunc = delayfunc

    def enterabs(self, time, priority, action, argument=(), kwargs=_sentinel):
        """Enter a new event in the queue at an absolute time.

        Returns an ID for the event which can be used to remove it,
        if necessary.

        """
        if kwargs is _sentinel:
            kwargs = {}
        event = Event(time, priority, action, argument, kwargs)
        with self._lock:
            heapq.heappush(self._queue, event)
        return event # The ID

    def enter(self, delay, priority, action, argument=(), kwargs=_sentinel):
        """A variant that specifies the time as a relative time.

        This is actually the more commonly used interface.

        """
        time = self.timefunc() + delay
        return self.enterabs(time, priority, action, argument, kwargs)

    def cancel(self, event):
        """Remove an event from the queue.

        This must be presented the ID as returned by enter().
        If the event is not in the queue, this raises ValueError.

        """
        with self._lock:
            self._queue.remove(event)
            heapq.heapify(self._queue)

    def empty(self):
        """Check whether the queue is empty."""
        with self._lock:
            return not self._queue

    def run(self, blocking=True):
        """Execute events until the queue is empty.
        If blocking is False executes the scheduled events due to
        expire soonest (if any) and then return the deadline of the
        next scheduled call in the scheduler.

        When there is a positive delay until the first event, the
        delay function is called and the event is left in the queue;
        otherwise, the event is removed from the queue and executed
        (its action function is called, passing it the argument).  If
        the delay function returns prematurely, it is simply
        restarted.

        It is legal for both the delay function and the action
        function to modify the queue or to raise an exception;
        exceptions are not caught but the scheduler's state remains
        well-defined so run() may be called again.

        A questionable hack is added to allow other threads to run:
        just after an event is executed, a delay of 0 is executed, to
        avoid monopolizing the CPU when other threads are also
        runnable.

        """
        # localize variable access to minimize overhead
        # and to improve thread safety
        lock = self._lock
        q = self._queue
        delayfunc = self.delayfunc
        timefunc = self.timefunc
        pop = heapq.heappop
        while True:
            with lock:
                if not q:
                    break
                time, priority, action, argument, kwargs = q[0]
                now = timefunc()
                if time > now:
                    delay = True
                else:
                    delay = False
                    pop(q)
            if delay:
                if not blocking:
                    return time - now
                delayfunc(time - now)
            else:
                action(*argument, **kwargs)
                delayfunc(0)   # Let other threads run

    @property
    def queue(self):
        """An ordered list of upcoming events.

        Events are named tuples with fields for:
            time, priority, action, arguments, kwargs

        """
        # Use heapq to sort the queue rather than using 'sorted(self._queue)'.
        # With heapq, two events scheduled at the same time will show in
        # the actual order they would be retrieved.
        with self._lock:
            events = self._queue[:]
        return list(map(heapq.heappop, [events]*len(events)))
contextvars.py000064400000000201151153537470007502 0ustar00from _contextvars import Context, ContextVar, Token, copy_context


__all__ = ('Context', 'ContextVar', 'Token', 'copy_context')
getpass.py000064400000013552151153537470006605 0ustar00"""Utilities to get a password and/or the current user name.

getpass(prompt[, stream]) - Prompt for a password, with echo turned off.
getuser() - Get the user name from the environment or password database.

GetPassWarning - This UserWarning is issued when getpass() cannot prevent
                 echoing of the password contents while reading.

On Windows, the msvcrt module will be used.

"""

# Authors: Piers Lauder (original)
#          Guido van Rossum (Windows support and cleanup)
#          Gregory P. Smith (tty support & GetPassWarning)

import contextlib
import io
import os
import sys
import warnings

__all__ = ["getpass","getuser","GetPassWarning"]


class GetPassWarning(UserWarning): pass


def unix_getpass(prompt='Password: ', stream=None):
    """Prompt for a password, with echo turned off.

    Args:
      prompt: Written on stream to ask for the input.  Default: 'Password: '
      stream: A writable file object to display the prompt.  Defaults to
              the tty.  If no tty is available defaults to sys.stderr.
    Returns:
      The seKr3t input.
    Raises:
      EOFError: If our input tty or stdin was closed.
      GetPassWarning: When we were unable to turn echo off on the input.

    Always restores terminal settings before returning.
    """
    passwd = None
    with contextlib.ExitStack() as stack:
        try:
            # Always try reading and writing directly on the tty first.
            fd = os.open('/dev/tty', os.O_RDWR|os.O_NOCTTY)
            tty = io.FileIO(fd, 'w+')
            stack.enter_context(tty)
            input = io.TextIOWrapper(tty)
            stack.enter_context(input)
            if not stream:
                stream = input
        except OSError as e:
            # If that fails, see if stdin can be controlled.
            stack.close()
            try:
                fd = sys.stdin.fileno()
            except (AttributeError, ValueError):
                fd = None
                passwd = fallback_getpass(prompt, stream)
            input = sys.stdin
            if not stream:
                stream = sys.stderr

        if fd is not None:
            try:
                old = termios.tcgetattr(fd)     # a copy to save
                new = old[:]
                new[3] &= ~termios.ECHO  # 3 == 'lflags'
                tcsetattr_flags = termios.TCSAFLUSH
                if hasattr(termios, 'TCSASOFT'):
                    tcsetattr_flags |= termios.TCSASOFT
                try:
                    termios.tcsetattr(fd, tcsetattr_flags, new)
                    passwd = _raw_input(prompt, stream, input=input)
                finally:
                    termios.tcsetattr(fd, tcsetattr_flags, old)
                    stream.flush()  # issue7208
            except termios.error:
                if passwd is not None:
                    # _raw_input succeeded.  The final tcsetattr failed.  Reraise
                    # instead of leaving the terminal in an unknown state.
                    raise
                # We can't control the tty or stdin.  Give up and use normal IO.
                # fallback_getpass() raises an appropriate warning.
                if stream is not input:
                    # clean up unused file objects before blocking
                    stack.close()
                passwd = fallback_getpass(prompt, stream)

        stream.write('\n')
        return passwd


def win_getpass(prompt='Password: ', stream=None):
    """Prompt for password with echo off, using Windows getch()."""
    if sys.stdin is not sys.__stdin__:
        return fallback_getpass(prompt, stream)

    for c in prompt:
        msvcrt.putwch(c)
    pw = ""
    while 1:
        c = msvcrt.getwch()
        if c == '\r' or c == '\n':
            break
        if c == '\003':
            raise KeyboardInterrupt
        if c == '\b':
            pw = pw[:-1]
        else:
            pw = pw + c
    msvcrt.putwch('\r')
    msvcrt.putwch('\n')
    return pw


def fallback_getpass(prompt='Password: ', stream=None):
    warnings.warn("Can not control echo on the terminal.", GetPassWarning,
                  stacklevel=2)
    if not stream:
        stream = sys.stderr
    print("Warning: Password input may be echoed.", file=stream)
    return _raw_input(prompt, stream)


def _raw_input(prompt="", stream=None, input=None):
    # This doesn't save the string in the GNU readline history.
    if not stream:
        stream = sys.stderr
    if not input:
        input = sys.stdin
    prompt = str(prompt)
    if prompt:
        try:
            stream.write(prompt)
        except UnicodeEncodeError:
            # Use replace error handler to get as much as possible printed.
            prompt = prompt.encode(stream.encoding, 'replace')
            prompt = prompt.decode(stream.encoding)
            stream.write(prompt)
        stream.flush()
    # NOTE: The Python C API calls flockfile() (and unlock) during readline.
    line = input.readline()
    if not line:
        raise EOFError
    if line[-1] == '\n':
        line = line[:-1]
    return line


def getuser():
    """Get the username from the environment or password database.

    First try various environment variables, then the password
    database.  This works on Windows as long as USERNAME is set.

    """

    for name in ('LOGNAME', 'USER', 'LNAME', 'USERNAME'):
        user = os.environ.get(name)
        if user:
            return user

    # If this fails, the exception will "explain" why
    import pwd
    return pwd.getpwuid(os.getuid())[0]

# Bind the name getpass to the appropriate function
try:
    import termios
    # it's possible there is an incompatible termios from the
    # McMillan Installer, make sure we have a UNIX-compatible termios
    termios.tcgetattr, termios.tcsetattr
except (ImportError, AttributeError):
    try:
        import msvcrt
    except ImportError:
        getpass = fallback_getpass
    else:
        getpass = win_getpass
else:
    getpass = unix_getpass
doctest.py000064400000314137151153537470006607 0ustar00# Module doctest.
# Released to the public domain 16-Jan-2001, by Tim Peters (tim@python.org).
# Major enhancements and refactoring by:
#     Jim Fulton
#     Edward Loper

# Provided as-is; use at your own risk; no warranty; no promises; enjoy!

r"""Module doctest -- a framework for running examples in docstrings.

In simplest use, end each module M to be tested with:

def _test():
    import doctest
    doctest.testmod()

if __name__ == "__main__":
    _test()

Then running the module as a script will cause the examples in the
docstrings to get executed and verified:

python M.py

This won't display anything unless an example fails, in which case the
failing example(s) and the cause(s) of the failure(s) are printed to stdout
(why not stderr? because stderr is a lame hack <0.2 wink>), and the final
line of output is "Test failed.".

Run it with the -v switch instead:

python M.py -v

and a detailed report of all examples tried is printed to stdout, along
with assorted summaries at the end.

You can force verbose mode by passing "verbose=True" to testmod, or prohibit
it by passing "verbose=False".  In either of those cases, sys.argv is not
examined by testmod.

There are a variety of other ways to run doctests, including integration
with the unittest framework, and support for running non-Python text
files containing doctests.  There are also many ways to override parts
of doctest's default behaviors.  See the Library Reference Manual for
details.
"""

__docformat__ = 'reStructuredText en'

__all__ = [
    # 0, Option Flags
    'register_optionflag',
    'DONT_ACCEPT_TRUE_FOR_1',
    'DONT_ACCEPT_BLANKLINE',
    'NORMALIZE_WHITESPACE',
    'ELLIPSIS',
    'SKIP',
    'IGNORE_EXCEPTION_DETAIL',
    'COMPARISON_FLAGS',
    'REPORT_UDIFF',
    'REPORT_CDIFF',
    'REPORT_NDIFF',
    'REPORT_ONLY_FIRST_FAILURE',
    'REPORTING_FLAGS',
    'FAIL_FAST',
    # 1. Utility Functions
    # 2. Example & DocTest
    'Example',
    'DocTest',
    # 3. Doctest Parser
    'DocTestParser',
    # 4. Doctest Finder
    'DocTestFinder',
    # 5. Doctest Runner
    'DocTestRunner',
    'OutputChecker',
    'DocTestFailure',
    'UnexpectedException',
    'DebugRunner',
    # 6. Test Functions
    'testmod',
    'testfile',
    'run_docstring_examples',
    # 7. Unittest Support
    'DocTestSuite',
    'DocFileSuite',
    'set_unittest_reportflags',
    # 8. Debugging Support
    'script_from_examples',
    'testsource',
    'debug_src',
    'debug',
]

import __future__
import difflib
import inspect
import linecache
import os
import pdb
import re
import sys
import traceback
import unittest
from io import StringIO
from collections import namedtuple

TestResults = namedtuple('TestResults', 'failed attempted')

# There are 4 basic classes:
#  - Example: a <source, want> pair, plus an intra-docstring line number.
#  - DocTest: a collection of examples, parsed from a docstring, plus
#    info about where the docstring came from (name, filename, lineno).
#  - DocTestFinder: extracts DocTests from a given object's docstring and
#    its contained objects' docstrings.
#  - DocTestRunner: runs DocTest cases, and accumulates statistics.
#
# So the basic picture is:
#
#                             list of:
# +------+                   +---------+                   +-------+
# |object| --DocTestFinder-> | DocTest | --DocTestRunner-> |results|
# +------+                   +---------+                   +-------+
#                            | Example |
#                            |   ...   |
#                            | Example |
#                            +---------+

# Option constants.

OPTIONFLAGS_BY_NAME = {}
def register_optionflag(name):
    # Create a new flag unless `name` is already known.
    return OPTIONFLAGS_BY_NAME.setdefault(name, 1 << len(OPTIONFLAGS_BY_NAME))

DONT_ACCEPT_TRUE_FOR_1 = register_optionflag('DONT_ACCEPT_TRUE_FOR_1')
DONT_ACCEPT_BLANKLINE = register_optionflag('DONT_ACCEPT_BLANKLINE')
NORMALIZE_WHITESPACE = register_optionflag('NORMALIZE_WHITESPACE')
ELLIPSIS = register_optionflag('ELLIPSIS')
SKIP = register_optionflag('SKIP')
IGNORE_EXCEPTION_DETAIL = register_optionflag('IGNORE_EXCEPTION_DETAIL')

COMPARISON_FLAGS = (DONT_ACCEPT_TRUE_FOR_1 |
                    DONT_ACCEPT_BLANKLINE |
                    NORMALIZE_WHITESPACE |
                    ELLIPSIS |
                    SKIP |
                    IGNORE_EXCEPTION_DETAIL)

REPORT_UDIFF = register_optionflag('REPORT_UDIFF')
REPORT_CDIFF = register_optionflag('REPORT_CDIFF')
REPORT_NDIFF = register_optionflag('REPORT_NDIFF')
REPORT_ONLY_FIRST_FAILURE = register_optionflag('REPORT_ONLY_FIRST_FAILURE')
FAIL_FAST = register_optionflag('FAIL_FAST')

REPORTING_FLAGS = (REPORT_UDIFF |
                   REPORT_CDIFF |
                   REPORT_NDIFF |
                   REPORT_ONLY_FIRST_FAILURE |
                   FAIL_FAST)

# Special string markers for use in `want` strings:
BLANKLINE_MARKER = '<BLANKLINE>'
ELLIPSIS_MARKER = '...'

######################################################################
## Table of Contents
######################################################################
#  1. Utility Functions
#  2. Example & DocTest -- store test cases
#  3. DocTest Parser -- extracts examples from strings
#  4. DocTest Finder -- extracts test cases from objects
#  5. DocTest Runner -- runs test cases
#  6. Test Functions -- convenient wrappers for testing
#  7. Unittest Support
#  8. Debugging Support
#  9. Example Usage

######################################################################
## 1. Utility Functions
######################################################################

def _extract_future_flags(globs):
    """
    Return the compiler-flags associated with the future features that
    have been imported into the given namespace (globs).
    """
    flags = 0
    for fname in __future__.all_feature_names:
        feature = globs.get(fname, None)
        if feature is getattr(__future__, fname):
            flags |= feature.compiler_flag
    return flags

def _normalize_module(module, depth=2):
    """
    Return the module specified by `module`.  In particular:
      - If `module` is a module, then return module.
      - If `module` is a string, then import and return the
        module with that name.
      - If `module` is None, then return the calling module.
        The calling module is assumed to be the module of
        the stack frame at the given depth in the call stack.
    """
    if inspect.ismodule(module):
        return module
    elif isinstance(module, str):
        return __import__(module, globals(), locals(), ["*"])
    elif module is None:
        return sys.modules[sys._getframe(depth).f_globals['__name__']]
    else:
        raise TypeError("Expected a module, string, or None")

def _newline_convert(data):
    # We have two cases to cover and we need to make sure we do
    # them in the right order
    for newline in ('\r\n', '\r'):
        data = data.replace(newline, '\n')
    return data

def _load_testfile(filename, package, module_relative, encoding):
    if module_relative:
        package = _normalize_module(package, 3)
        filename = _module_relative_path(package, filename)
        if getattr(package, '__loader__', None) is not None:
            if hasattr(package.__loader__, 'get_data'):
                file_contents = package.__loader__.get_data(filename)
                file_contents = file_contents.decode(encoding)
                # get_data() opens files as 'rb', so one must do the equivalent
                # conversion as universal newlines would do.
                return _newline_convert(file_contents), filename
    with open(filename, encoding=encoding) as f:
        return f.read(), filename

def _indent(s, indent=4):
    """
    Add the given number of space characters to the beginning of
    every non-blank line in `s`, and return the result.
    """
    # This regexp matches the start of non-blank lines:
    return re.sub('(?m)^(?!$)', indent*' ', s)

def _exception_traceback(exc_info):
    """
    Return a string containing a traceback message for the given
    exc_info tuple (as returned by sys.exc_info()).
    """
    # Get a traceback message.
    excout = StringIO()
    exc_type, exc_val, exc_tb = exc_info
    traceback.print_exception(exc_type, exc_val, exc_tb, file=excout)
    return excout.getvalue()

# Override some StringIO methods.
class _SpoofOut(StringIO):
    def getvalue(self):
        result = StringIO.getvalue(self)
        # If anything at all was written, make sure there's a trailing
        # newline.  There's no way for the expected output to indicate
        # that a trailing newline is missing.
        if result and not result.endswith("\n"):
            result += "\n"
        return result

    def truncate(self, size=None):
        self.seek(size)
        StringIO.truncate(self)

# Worst-case linear-time ellipsis matching.
def _ellipsis_match(want, got):
    """
    Essentially the only subtle case:
    >>> _ellipsis_match('aa...aa', 'aaa')
    False
    """
    if ELLIPSIS_MARKER not in want:
        return want == got

    # Find "the real" strings.
    ws = want.split(ELLIPSIS_MARKER)
    assert len(ws) >= 2

    # Deal with exact matches possibly needed at one or both ends.
    startpos, endpos = 0, len(got)
    w = ws[0]
    if w:   # starts with exact match
        if got.startswith(w):
            startpos = len(w)
            del ws[0]
        else:
            return False
    w = ws[-1]
    if w:   # ends with exact match
        if got.endswith(w):
            endpos -= len(w)
            del ws[-1]
        else:
            return False

    if startpos > endpos:
        # Exact end matches required more characters than we have, as in
        # _ellipsis_match('aa...aa', 'aaa')
        return False

    # For the rest, we only need to find the leftmost non-overlapping
    # match for each piece.  If there's no overall match that way alone,
    # there's no overall match period.
    for w in ws:
        # w may be '' at times, if there are consecutive ellipses, or
        # due to an ellipsis at the start or end of `want`.  That's OK.
        # Search for an empty string succeeds, and doesn't change startpos.
        startpos = got.find(w, startpos, endpos)
        if startpos < 0:
            return False
        startpos += len(w)

    return True

def _comment_line(line):
    "Return a commented form of the given line"
    line = line.rstrip()
    if line:
        return '# '+line
    else:
        return '#'

def _strip_exception_details(msg):
    # Support for IGNORE_EXCEPTION_DETAIL.
    # Get rid of everything except the exception name; in particular, drop
    # the possibly dotted module path (if any) and the exception message (if
    # any).  We assume that a colon is never part of a dotted name, or of an
    # exception name.
    # E.g., given
    #    "foo.bar.MyError: la di da"
    # return "MyError"
    # Or for "abc.def" or "abc.def:\n" return "def".

    start, end = 0, len(msg)
    # The exception name must appear on the first line.
    i = msg.find("\n")
    if i >= 0:
        end = i
    # retain up to the first colon (if any)
    i = msg.find(':', 0, end)
    if i >= 0:
        end = i
    # retain just the exception name
    i = msg.rfind('.', 0, end)
    if i >= 0:
        start = i+1
    return msg[start: end]

class _OutputRedirectingPdb(pdb.Pdb):
    """
    A specialized version of the python debugger that redirects stdout
    to a given stream when interacting with the user.  Stdout is *not*
    redirected when traced code is executed.
    """
    def __init__(self, out):
        self.__out = out
        self.__debugger_used = False
        # do not play signal games in the pdb
        pdb.Pdb.__init__(self, stdout=out, nosigint=True)
        # still use input() to get user input
        self.use_rawinput = 1

    def set_trace(self, frame=None):
        self.__debugger_used = True
        if frame is None:
            frame = sys._getframe().f_back
        pdb.Pdb.set_trace(self, frame)

    def set_continue(self):
        # Calling set_continue unconditionally would break unit test
        # coverage reporting, as Bdb.set_continue calls sys.settrace(None).
        if self.__debugger_used:
            pdb.Pdb.set_continue(self)

    def trace_dispatch(self, *args):
        # Redirect stdout to the given stream.
        save_stdout = sys.stdout
        sys.stdout = self.__out
        # Call Pdb's trace dispatch method.
        try:
            return pdb.Pdb.trace_dispatch(self, *args)
        finally:
            sys.stdout = save_stdout

# [XX] Normalize with respect to os.path.pardir?
def _module_relative_path(module, test_path):
    if not inspect.ismodule(module):
        raise TypeError('Expected a module: %r' % module)
    if test_path.startswith('/'):
        raise ValueError('Module-relative files may not have absolute paths')

    # Normalize the path. On Windows, replace "/" with "\".
    test_path = os.path.join(*(test_path.split('/')))

    # Find the base directory for the path.
    if hasattr(module, '__file__'):
        # A normal module/package
        basedir = os.path.split(module.__file__)[0]
    elif module.__name__ == '__main__':
        # An interactive session.
        if len(sys.argv)>0 and sys.argv[0] != '':
            basedir = os.path.split(sys.argv[0])[0]
        else:
            basedir = os.curdir
    else:
        if hasattr(module, '__path__'):
            for directory in module.__path__:
                fullpath = os.path.join(directory, test_path)
                if os.path.exists(fullpath):
                    return fullpath

        # A module w/o __file__ (this includes builtins)
        raise ValueError("Can't resolve paths relative to the module "
                         "%r (it has no __file__)"
                         % module.__name__)

    # Combine the base directory and the test path.
    return os.path.join(basedir, test_path)

######################################################################
## 2. Example & DocTest
######################################################################
## - An "example" is a <source, want> pair, where "source" is a
##   fragment of source code, and "want" is the expected output for
##   "source."  The Example class also includes information about
##   where the example was extracted from.
##
## - A "doctest" is a collection of examples, typically extracted from
##   a string (such as an object's docstring).  The DocTest class also
##   includes information about where the string was extracted from.

class Example:
    """
    A single doctest example, consisting of source code and expected
    output.  `Example` defines the following attributes:

      - source: A single Python statement, always ending with a newline.
        The constructor adds a newline if needed.

      - want: The expected output from running the source code (either
        from stdout, or a traceback in case of exception).  `want` ends
        with a newline unless it's empty, in which case it's an empty
        string.  The constructor adds a newline if needed.

      - exc_msg: The exception message generated by the example, if
        the example is expected to generate an exception; or `None` if
        it is not expected to generate an exception.  This exception
        message is compared against the return value of
        `traceback.format_exception_only()`.  `exc_msg` ends with a
        newline unless it's `None`.  The constructor adds a newline
        if needed.

      - lineno: The line number within the DocTest string containing
        this Example where the Example begins.  This line number is
        zero-based, with respect to the beginning of the DocTest.

      - indent: The example's indentation in the DocTest string.
        I.e., the number of space characters that precede the
        example's first prompt.

      - options: A dictionary mapping from option flags to True or
        False, which is used to override default options for this
        example.  Any option flags not contained in this dictionary
        are left at their default value (as specified by the
        DocTestRunner's optionflags).  By default, no options are set.
    """
    def __init__(self, source, want, exc_msg=None, lineno=0, indent=0,
                 options=None):
        # Normalize inputs.
        if not source.endswith('\n'):
            source += '\n'
        if want and not want.endswith('\n'):
            want += '\n'
        if exc_msg is not None and not exc_msg.endswith('\n'):
            exc_msg += '\n'
        # Store properties.
        self.source = source
        self.want = want
        self.lineno = lineno
        self.indent = indent
        if options is None: options = {}
        self.options = options
        self.exc_msg = exc_msg

    def __eq__(self, other):
        if type(self) is not type(other):
            return NotImplemented

        return self.source == other.source and \
               self.want == other.want and \
               self.lineno == other.lineno and \
               self.indent == other.indent and \
               self.options == other.options and \
               self.exc_msg == other.exc_msg

    def __hash__(self):
        return hash((self.source, self.want, self.lineno, self.indent,
                     self.exc_msg))

class DocTest:
    """
    A collection of doctest examples that should be run in a single
    namespace.  Each `DocTest` defines the following attributes:

      - examples: the list of examples.

      - globs: The namespace (aka globals) that the examples should
        be run in.

      - name: A name identifying the DocTest (typically, the name of
        the object whose docstring this DocTest was extracted from).

      - filename: The name of the file that this DocTest was extracted
        from, or `None` if the filename is unknown.

      - lineno: The line number within filename where this DocTest
        begins, or `None` if the line number is unavailable.  This
        line number is zero-based, with respect to the beginning of
        the file.

      - docstring: The string that the examples were extracted from,
        or `None` if the string is unavailable.
    """
    def __init__(self, examples, globs, name, filename, lineno, docstring):
        """
        Create a new DocTest containing the given examples.  The
        DocTest's globals are initialized with a copy of `globs`.
        """
        assert not isinstance(examples, str), \
               "DocTest no longer accepts str; use DocTestParser instead"
        self.examples = examples
        self.docstring = docstring
        self.globs = globs.copy()
        self.name = name
        self.filename = filename
        self.lineno = lineno

    def __repr__(self):
        if len(self.examples) == 0:
            examples = 'no examples'
        elif len(self.examples) == 1:
            examples = '1 example'
        else:
            examples = '%d examples' % len(self.examples)
        return ('<%s %s from %s:%s (%s)>' %
                (self.__class__.__name__,
                 self.name, self.filename, self.lineno, examples))

    def __eq__(self, other):
        if type(self) is not type(other):
            return NotImplemented

        return self.examples == other.examples and \
               self.docstring == other.docstring and \
               self.globs == other.globs and \
               self.name == other.name and \
               self.filename == other.filename and \
               self.lineno == other.lineno

    def __hash__(self):
        return hash((self.docstring, self.name, self.filename, self.lineno))

    # This lets us sort tests by name:
    def __lt__(self, other):
        if not isinstance(other, DocTest):
            return NotImplemented
        return ((self.name, self.filename, self.lineno, id(self))
                <
                (other.name, other.filename, other.lineno, id(other)))

######################################################################
## 3. DocTestParser
######################################################################

class DocTestParser:
    """
    A class used to parse strings containing doctest examples.
    """
    # This regular expression is used to find doctest examples in a
    # string.  It defines three groups: `source` is the source code
    # (including leading indentation and prompts); `indent` is the
    # indentation of the first (PS1) line of the source code; and
    # `want` is the expected output (including leading indentation).
    _EXAMPLE_RE = re.compile(r'''
        # Source consists of a PS1 line followed by zero or more PS2 lines.
        (?P<source>
            (?:^(?P<indent> [ ]*) >>>    .*)    # PS1 line
            (?:\n           [ ]*  \.\.\. .*)*)  # PS2 lines
        \n?
        # Want consists of any non-blank lines that do not start with PS1.
        (?P<want> (?:(?![ ]*$)    # Not a blank line
                     (?![ ]*>>>)  # Not a line starting with PS1
                     .+$\n?       # But any other line
                  )*)
        ''', re.MULTILINE | re.VERBOSE)

    # A regular expression for handling `want` strings that contain
    # expected exceptions.  It divides `want` into three pieces:
    #    - the traceback header line (`hdr`)
    #    - the traceback stack (`stack`)
    #    - the exception message (`msg`), as generated by
    #      traceback.format_exception_only()
    # `msg` may have multiple lines.  We assume/require that the
    # exception message is the first non-indented line starting with a word
    # character following the traceback header line.
    _EXCEPTION_RE = re.compile(r"""
        # Grab the traceback header.  Different versions of Python have
        # said different things on the first traceback line.
        ^(?P<hdr> Traceback\ \(
            (?: most\ recent\ call\ last
            |   innermost\ last
            ) \) :
        )
        \s* $                # toss trailing whitespace on the header.
        (?P<stack> .*?)      # don't blink: absorb stuff until...
        ^ (?P<msg> \w+ .*)   #     a line *starts* with alphanum.
        """, re.VERBOSE | re.MULTILINE | re.DOTALL)

    # A callable returning a true value iff its argument is a blank line
    # or contains a single comment.
    _IS_BLANK_OR_COMMENT = re.compile(r'^[ ]*(#.*)?$').match

    def parse(self, string, name='<string>'):
        """
        Divide the given string into examples and intervening text,
        and return them as a list of alternating Examples and strings.
        Line numbers for the Examples are 0-based.  The optional
        argument `name` is a name identifying this string, and is only
        used for error messages.
        """
        string = string.expandtabs()
        # If all lines begin with the same indentation, then strip it.
        min_indent = self._min_indent(string)
        if min_indent > 0:
            string = '\n'.join([l[min_indent:] for l in string.split('\n')])

        output = []
        charno, lineno = 0, 0
        # Find all doctest examples in the string:
        for m in self._EXAMPLE_RE.finditer(string):
            # Add the pre-example text to `output`.
            output.append(string[charno:m.start()])
            # Update lineno (lines before this example)
            lineno += string.count('\n', charno, m.start())
            # Extract info from the regexp match.
            (source, options, want, exc_msg) = \
                     self._parse_example(m, name, lineno)
            # Create an Example, and add it to the list.
            if not self._IS_BLANK_OR_COMMENT(source):
                output.append( Example(source, want, exc_msg,
                                    lineno=lineno,
                                    indent=min_indent+len(m.group('indent')),
                                    options=options) )
            # Update lineno (lines inside this example)
            lineno += string.count('\n', m.start(), m.end())
            # Update charno.
            charno = m.end()
        # Add any remaining post-example text to `output`.
        output.append(string[charno:])
        return output

    def get_doctest(self, string, globs, name, filename, lineno):
        """
        Extract all doctest examples from the given string, and
        collect them into a `DocTest` object.

        `globs`, `name`, `filename`, and `lineno` are attributes for
        the new `DocTest` object.  See the documentation for `DocTest`
        for more information.
        """
        return DocTest(self.get_examples(string, name), globs,
                       name, filename, lineno, string)

    def get_examples(self, string, name='<string>'):
        """
        Extract all doctest examples from the given string, and return
        them as a list of `Example` objects.  Line numbers are
        0-based, because it's most common in doctests that nothing
        interesting appears on the same line as opening triple-quote,
        and so the first interesting line is called \"line 1\" then.

        The optional argument `name` is a name identifying this
        string, and is only used for error messages.
        """
        return [x for x in self.parse(string, name)
                if isinstance(x, Example)]

    def _parse_example(self, m, name, lineno):
        """
        Given a regular expression match from `_EXAMPLE_RE` (`m`),
        return a pair `(source, want)`, where `source` is the matched
        example's source code (with prompts and indentation stripped);
        and `want` is the example's expected output (with indentation
        stripped).

        `name` is the string's name, and `lineno` is the line number
        where the example starts; both are used for error messages.
        """
        # Get the example's indentation level.
        indent = len(m.group('indent'))

        # Divide source into lines; check that they're properly
        # indented; and then strip their indentation & prompts.
        source_lines = m.group('source').split('\n')
        self._check_prompt_blank(source_lines, indent, name, lineno)
        self._check_prefix(source_lines[1:], ' '*indent + '.', name, lineno)
        source = '\n'.join([sl[indent+4:] for sl in source_lines])

        # Divide want into lines; check that it's properly indented; and
        # then strip the indentation.  Spaces before the last newline should
        # be preserved, so plain rstrip() isn't good enough.
        want = m.group('want')
        want_lines = want.split('\n')
        if len(want_lines) > 1 and re.match(r' *$', want_lines[-1]):
            del want_lines[-1]  # forget final newline & spaces after it
        self._check_prefix(want_lines, ' '*indent, name,
                           lineno + len(source_lines))
        want = '\n'.join([wl[indent:] for wl in want_lines])

        # If `want` contains a traceback message, then extract it.
        m = self._EXCEPTION_RE.match(want)
        if m:
            exc_msg = m.group('msg')
        else:
            exc_msg = None

        # Extract options from the source.
        options = self._find_options(source, name, lineno)

        return source, options, want, exc_msg

    # This regular expression looks for option directives in the
    # source code of an example.  Option directives are comments
    # starting with "doctest:".  Warning: this may give false
    # positives for string-literals that contain the string
    # "#doctest:".  Eliminating these false positives would require
    # actually parsing the string; but we limit them by ignoring any
    # line containing "#doctest:" that is *followed* by a quote mark.
    _OPTION_DIRECTIVE_RE = re.compile(r'#\s*doctest:\s*([^\n\'"]*)$',
                                      re.MULTILINE)

    def _find_options(self, source, name, lineno):
        """
        Return a dictionary containing option overrides extracted from
        option directives in the given source string.

        `name` is the string's name, and `lineno` is the line number
        where the example starts; both are used for error messages.
        """
        options = {}
        # (note: with the current regexp, this will match at most once:)
        for m in self._OPTION_DIRECTIVE_RE.finditer(source):
            option_strings = m.group(1).replace(',', ' ').split()
            for option in option_strings:
                if (option[0] not in '+-' or
                    option[1:] not in OPTIONFLAGS_BY_NAME):
                    raise ValueError('line %r of the doctest for %s '
                                     'has an invalid option: %r' %
                                     (lineno+1, name, option))
                flag = OPTIONFLAGS_BY_NAME[option[1:]]
                options[flag] = (option[0] == '+')
        if options and self._IS_BLANK_OR_COMMENT(source):
            raise ValueError('line %r of the doctest for %s has an option '
                             'directive on a line with no example: %r' %
                             (lineno, name, source))
        return options

    # This regular expression finds the indentation of every non-blank
    # line in a string.
    _INDENT_RE = re.compile(r'^([ ]*)(?=\S)', re.MULTILINE)

    def _min_indent(self, s):
        "Return the minimum indentation of any non-blank line in `s`"
        indents = [len(indent) for indent in self._INDENT_RE.findall(s)]
        if len(indents) > 0:
            return min(indents)
        else:
            return 0

    def _check_prompt_blank(self, lines, indent, name, lineno):
        """
        Given the lines of a source string (including prompts and
        leading indentation), check to make sure that every prompt is
        followed by a space character.  If any line is not followed by
        a space character, then raise ValueError.
        """
        for i, line in enumerate(lines):
            if len(line) >= indent+4 and line[indent+3] != ' ':
                raise ValueError('line %r of the docstring for %s '
                                 'lacks blank after %s: %r' %
                                 (lineno+i+1, name,
                                  line[indent:indent+3], line))

    def _check_prefix(self, lines, prefix, name, lineno):
        """
        Check that every line in the given list starts with the given
        prefix; if any line does not, then raise a ValueError.
        """
        for i, line in enumerate(lines):
            if line and not line.startswith(prefix):
                raise ValueError('line %r of the docstring for %s has '
                                 'inconsistent leading whitespace: %r' %
                                 (lineno+i+1, name, line))


######################################################################
## 4. DocTest Finder
######################################################################

class DocTestFinder:
    """
    A class used to extract the DocTests that are relevant to a given
    object, from its docstring and the docstrings of its contained
    objects.  Doctests can currently be extracted from the following
    object types: modules, functions, classes, methods, staticmethods,
    classmethods, and properties.
    """

    def __init__(self, verbose=False, parser=DocTestParser(),
                 recurse=True, exclude_empty=True):
        """
        Create a new doctest finder.

        The optional argument `parser` specifies a class or
        function that should be used to create new DocTest objects (or
        objects that implement the same interface as DocTest).  The
        signature for this factory function should match the signature
        of the DocTest constructor.

        If the optional argument `recurse` is false, then `find` will
        only examine the given object, and not any contained objects.

        If the optional argument `exclude_empty` is false, then `find`
        will include tests for objects with empty docstrings.
        """
        self._parser = parser
        self._verbose = verbose
        self._recurse = recurse
        self._exclude_empty = exclude_empty

    def find(self, obj, name=None, module=None, globs=None, extraglobs=None):
        """
        Return a list of the DocTests that are defined by the given
        object's docstring, or by any of its contained objects'
        docstrings.

        The optional parameter `module` is the module that contains
        the given object.  If the module is not specified or is None, then
        the test finder will attempt to automatically determine the
        correct module.  The object's module is used:

            - As a default namespace, if `globs` is not specified.
            - To prevent the DocTestFinder from extracting DocTests
              from objects that are imported from other modules.
            - To find the name of the file containing the object.
            - To help find the line number of the object within its
              file.

        Contained objects whose module does not match `module` are ignored.

        If `module` is False, no attempt to find the module will be made.
        This is obscure, of use mostly in tests:  if `module` is False, or
        is None but cannot be found automatically, then all objects are
        considered to belong to the (non-existent) module, so all contained
        objects will (recursively) be searched for doctests.

        The globals for each DocTest is formed by combining `globs`
        and `extraglobs` (bindings in `extraglobs` override bindings
        in `globs`).  A new copy of the globals dictionary is created
        for each DocTest.  If `globs` is not specified, then it
        defaults to the module's `__dict__`, if specified, or {}
        otherwise.  If `extraglobs` is not specified, then it defaults
        to {}.

        """
        # If name was not specified, then extract it from the object.
        if name is None:
            name = getattr(obj, '__name__', None)
            if name is None:
                raise ValueError("DocTestFinder.find: name must be given "
                        "when obj.__name__ doesn't exist: %r" %
                                 (type(obj),))

        # Find the module that contains the given object (if obj is
        # a module, then module=obj.).  Note: this may fail, in which
        # case module will be None.
        if module is False:
            module = None
        elif module is None:
            module = inspect.getmodule(obj)

        # Read the module's source code.  This is used by
        # DocTestFinder._find_lineno to find the line number for a
        # given object's docstring.
        try:
            file = inspect.getsourcefile(obj)
        except TypeError:
            source_lines = None
        else:
            if not file:
                # Check to see if it's one of our special internal "files"
                # (see __patched_linecache_getlines).
                file = inspect.getfile(obj)
                if not file[0]+file[-2:] == '<]>': file = None
            if file is None:
                source_lines = None
            else:
                if module is not None:
                    # Supply the module globals in case the module was
                    # originally loaded via a PEP 302 loader and
                    # file is not a valid filesystem path
                    source_lines = linecache.getlines(file, module.__dict__)
                else:
                    # No access to a loader, so assume it's a normal
                    # filesystem path
                    source_lines = linecache.getlines(file)
                if not source_lines:
                    source_lines = None

        # Initialize globals, and merge in extraglobs.
        if globs is None:
            if module is None:
                globs = {}
            else:
                globs = module.__dict__.copy()
        else:
            globs = globs.copy()
        if extraglobs is not None:
            globs.update(extraglobs)
        if '__name__' not in globs:
            globs['__name__'] = '__main__'  # provide a default module name

        # Recursively explore `obj`, extracting DocTests.
        tests = []
        self._find(tests, obj, name, module, source_lines, globs, {})
        # Sort the tests by alpha order of names, for consistency in
        # verbose-mode output.  This was a feature of doctest in Pythons
        # <= 2.3 that got lost by accident in 2.4.  It was repaired in
        # 2.4.4 and 2.5.
        tests.sort()
        return tests

    def _from_module(self, module, object):
        """
        Return true if the given object is defined in the given
        module.
        """
        if module is None:
            return True
        elif inspect.getmodule(object) is not None:
            return module is inspect.getmodule(object)
        elif inspect.isfunction(object):
            return module.__dict__ is object.__globals__
        elif inspect.ismethoddescriptor(object):
            if hasattr(object, '__objclass__'):
                obj_mod = object.__objclass__.__module__
            elif hasattr(object, '__module__'):
                obj_mod = object.__module__
            else:
                return True # [XX] no easy way to tell otherwise
            return module.__name__ == obj_mod
        elif inspect.isclass(object):
            return module.__name__ == object.__module__
        elif hasattr(object, '__module__'):
            return module.__name__ == object.__module__
        elif isinstance(object, property):
            return True # [XX] no way not be sure.
        else:
            raise ValueError("object must be a class or function")

    def _find(self, tests, obj, name, module, source_lines, globs, seen):
        """
        Find tests for the given object and any contained objects, and
        add them to `tests`.
        """
        if self._verbose:
            print('Finding tests in %s' % name)

        # If we've already processed this object, then ignore it.
        if id(obj) in seen:
            return
        seen[id(obj)] = 1

        # Find a test for this object, and add it to the list of tests.
        test = self._get_test(obj, name, module, globs, source_lines)
        if test is not None:
            tests.append(test)

        # Look for tests in a module's contained objects.
        if inspect.ismodule(obj) and self._recurse:
            for valname, val in obj.__dict__.items():
                valname = '%s.%s' % (name, valname)
                # Recurse to functions & classes.
                if ((inspect.isroutine(inspect.unwrap(val))
                     or inspect.isclass(val)) and
                    self._from_module(module, val)):
                    self._find(tests, val, valname, module, source_lines,
                               globs, seen)

        # Look for tests in a module's __test__ dictionary.
        if inspect.ismodule(obj) and self._recurse:
            for valname, val in getattr(obj, '__test__', {}).items():
                if not isinstance(valname, str):
                    raise ValueError("DocTestFinder.find: __test__ keys "
                                     "must be strings: %r" %
                                     (type(valname),))
                if not (inspect.isroutine(val) or inspect.isclass(val) or
                        inspect.ismodule(val) or isinstance(val, str)):
                    raise ValueError("DocTestFinder.find: __test__ values "
                                     "must be strings, functions, methods, "
                                     "classes, or modules: %r" %
                                     (type(val),))
                valname = '%s.__test__.%s' % (name, valname)
                self._find(tests, val, valname, module, source_lines,
                           globs, seen)

        # Look for tests in a class's contained objects.
        if inspect.isclass(obj) and self._recurse:
            for valname, val in obj.__dict__.items():
                # Special handling for staticmethod/classmethod.
                if isinstance(val, staticmethod):
                    val = getattr(obj, valname)
                if isinstance(val, classmethod):
                    val = getattr(obj, valname).__func__

                # Recurse to methods, properties, and nested classes.
                if ((inspect.isroutine(val) or inspect.isclass(val) or
                      isinstance(val, property)) and
                      self._from_module(module, val)):
                    valname = '%s.%s' % (name, valname)
                    self._find(tests, val, valname, module, source_lines,
                               globs, seen)

    def _get_test(self, obj, name, module, globs, source_lines):
        """
        Return a DocTest for the given object, if it defines a docstring;
        otherwise, return None.
        """
        # Extract the object's docstring.  If it doesn't have one,
        # then return None (no test for this object).
        if isinstance(obj, str):
            docstring = obj
        else:
            try:
                if obj.__doc__ is None:
                    docstring = ''
                else:
                    docstring = obj.__doc__
                    if not isinstance(docstring, str):
                        docstring = str(docstring)
            except (TypeError, AttributeError):
                docstring = ''

        # Find the docstring's location in the file.
        lineno = self._find_lineno(obj, source_lines)

        # Don't bother if the docstring is empty.
        if self._exclude_empty and not docstring:
            return None

        # Return a DocTest for this object.
        if module is None:
            filename = None
        else:
            # __file__ can be None for namespace packages.
            filename = getattr(module, '__file__', None) or module.__name__
            if filename[-4:] == ".pyc":
                filename = filename[:-1]
        return self._parser.get_doctest(docstring, globs, name,
                                        filename, lineno)

    def _find_lineno(self, obj, source_lines):
        """
        Return a line number of the given object's docstring.  Note:
        this method assumes that the object has a docstring.
        """
        lineno = None

        # Find the line number for modules.
        if inspect.ismodule(obj):
            lineno = 0

        # Find the line number for classes.
        # Note: this could be fooled if a class is defined multiple
        # times in a single file.
        if inspect.isclass(obj):
            if source_lines is None:
                return None
            pat = re.compile(r'^\s*class\s*%s\b' %
                             getattr(obj, '__name__', '-'))
            for i, line in enumerate(source_lines):
                if pat.match(line):
                    lineno = i
                    break

        # Find the line number for functions & methods.
        if inspect.ismethod(obj): obj = obj.__func__
        if inspect.isfunction(obj): obj = obj.__code__
        if inspect.istraceback(obj): obj = obj.tb_frame
        if inspect.isframe(obj): obj = obj.f_code
        if inspect.iscode(obj):
            lineno = getattr(obj, 'co_firstlineno', None)-1

        # Find the line number where the docstring starts.  Assume
        # that it's the first line that begins with a quote mark.
        # Note: this could be fooled by a multiline function
        # signature, where a continuation line begins with a quote
        # mark.
        if lineno is not None:
            if source_lines is None:
                return lineno+1
            pat = re.compile(r'(^|.*:)\s*\w*("|\')')
            for lineno in range(lineno, len(source_lines)):
                if pat.match(source_lines[lineno]):
                    return lineno

        # We couldn't find the line number.
        return None

######################################################################
## 5. DocTest Runner
######################################################################

class DocTestRunner:
    """
    A class used to run DocTest test cases, and accumulate statistics.
    The `run` method is used to process a single DocTest case.  It
    returns a tuple `(f, t)`, where `t` is the number of test cases
    tried, and `f` is the number of test cases that failed.

        >>> tests = DocTestFinder().find(_TestClass)
        >>> runner = DocTestRunner(verbose=False)
        >>> tests.sort(key = lambda test: test.name)
        >>> for test in tests:
        ...     print(test.name, '->', runner.run(test))
        _TestClass -> TestResults(failed=0, attempted=2)
        _TestClass.__init__ -> TestResults(failed=0, attempted=2)
        _TestClass.get -> TestResults(failed=0, attempted=2)
        _TestClass.square -> TestResults(failed=0, attempted=1)

    The `summarize` method prints a summary of all the test cases that
    have been run by the runner, and returns an aggregated `(f, t)`
    tuple:

        >>> runner.summarize(verbose=1)
        4 items passed all tests:
           2 tests in _TestClass
           2 tests in _TestClass.__init__
           2 tests in _TestClass.get
           1 tests in _TestClass.square
        7 tests in 4 items.
        7 passed and 0 failed.
        Test passed.
        TestResults(failed=0, attempted=7)

    The aggregated number of tried examples and failed examples is
    also available via the `tries` and `failures` attributes:

        >>> runner.tries
        7
        >>> runner.failures
        0

    The comparison between expected outputs and actual outputs is done
    by an `OutputChecker`.  This comparison may be customized with a
    number of option flags; see the documentation for `testmod` for
    more information.  If the option flags are insufficient, then the
    comparison may also be customized by passing a subclass of
    `OutputChecker` to the constructor.

    The test runner's display output can be controlled in two ways.
    First, an output function (`out) can be passed to
    `TestRunner.run`; this function will be called with strings that
    should be displayed.  It defaults to `sys.stdout.write`.  If
    capturing the output is not sufficient, then the display output
    can be also customized by subclassing DocTestRunner, and
    overriding the methods `report_start`, `report_success`,
    `report_unexpected_exception`, and `report_failure`.
    """
    # This divider string is used to separate failure messages, and to
    # separate sections of the summary.
    DIVIDER = "*" * 70

    def __init__(self, checker=None, verbose=None, optionflags=0):
        """
        Create a new test runner.

        Optional keyword arg `checker` is the `OutputChecker` that
        should be used to compare the expected outputs and actual
        outputs of doctest examples.

        Optional keyword arg 'verbose' prints lots of stuff if true,
        only failures if false; by default, it's true iff '-v' is in
        sys.argv.

        Optional argument `optionflags` can be used to control how the
        test runner compares expected output to actual output, and how
        it displays failures.  See the documentation for `testmod` for
        more information.
        """
        self._checker = checker or OutputChecker()
        if verbose is None:
            verbose = '-v' in sys.argv
        self._verbose = verbose
        self.optionflags = optionflags
        self.original_optionflags = optionflags

        # Keep track of the examples we've run.
        self.tries = 0
        self.failures = 0
        self._name2ft = {}

        # Create a fake output target for capturing doctest output.
        self._fakeout = _SpoofOut()

    #/////////////////////////////////////////////////////////////////
    # Reporting methods
    #/////////////////////////////////////////////////////////////////

    def report_start(self, out, test, example):
        """
        Report that the test runner is about to process the given
        example.  (Only displays a message if verbose=True)
        """
        if self._verbose:
            if example.want:
                out('Trying:\n' + _indent(example.source) +
                    'Expecting:\n' + _indent(example.want))
            else:
                out('Trying:\n' + _indent(example.source) +
                    'Expecting nothing\n')

    def report_success(self, out, test, example, got):
        """
        Report that the given example ran successfully.  (Only
        displays a message if verbose=True)
        """
        if self._verbose:
            out("ok\n")

    def report_failure(self, out, test, example, got):
        """
        Report that the given example failed.
        """
        out(self._failure_header(test, example) +
            self._checker.output_difference(example, got, self.optionflags))

    def report_unexpected_exception(self, out, test, example, exc_info):
        """
        Report that the given example raised an unexpected exception.
        """
        out(self._failure_header(test, example) +
            'Exception raised:\n' + _indent(_exception_traceback(exc_info)))

    def _failure_header(self, test, example):
        out = [self.DIVIDER]
        if test.filename:
            if test.lineno is not None and example.lineno is not None:
                lineno = test.lineno + example.lineno + 1
            else:
                lineno = '?'
            out.append('File "%s", line %s, in %s' %
                       (test.filename, lineno, test.name))
        else:
            out.append('Line %s, in %s' % (example.lineno+1, test.name))
        out.append('Failed example:')
        source = example.source
        out.append(_indent(source))
        return '\n'.join(out)

    #/////////////////////////////////////////////////////////////////
    # DocTest Running
    #/////////////////////////////////////////////////////////////////

    def __run(self, test, compileflags, out):
        """
        Run the examples in `test`.  Write the outcome of each example
        with one of the `DocTestRunner.report_*` methods, using the
        writer function `out`.  `compileflags` is the set of compiler
        flags that should be used to execute examples.  Return a tuple
        `(f, t)`, where `t` is the number of examples tried, and `f`
        is the number of examples that failed.  The examples are run
        in the namespace `test.globs`.
        """
        # Keep track of the number of failures and tries.
        failures = tries = 0

        # Save the option flags (since option directives can be used
        # to modify them).
        original_optionflags = self.optionflags

        SUCCESS, FAILURE, BOOM = range(3) # `outcome` state

        check = self._checker.check_output

        # Process each example.
        for examplenum, example in enumerate(test.examples):

            # If REPORT_ONLY_FIRST_FAILURE is set, then suppress
            # reporting after the first failure.
            quiet = (self.optionflags & REPORT_ONLY_FIRST_FAILURE and
                     failures > 0)

            # Merge in the example's options.
            self.optionflags = original_optionflags
            if example.options:
                for (optionflag, val) in example.options.items():
                    if val:
                        self.optionflags |= optionflag
                    else:
                        self.optionflags &= ~optionflag

            # If 'SKIP' is set, then skip this example.
            if self.optionflags & SKIP:
                continue

            # Record that we started this example.
            tries += 1
            if not quiet:
                self.report_start(out, test, example)

            # Use a special filename for compile(), so we can retrieve
            # the source code during interactive debugging (see
            # __patched_linecache_getlines).
            filename = '<doctest %s[%d]>' % (test.name, examplenum)

            # Run the example in the given context (globs), and record
            # any exception that gets raised.  (But don't intercept
            # keyboard interrupts.)
            try:
                # Don't blink!  This is where the user's code gets run.
                exec(compile(example.source, filename, "single",
                             compileflags, 1), test.globs)
                self.debugger.set_continue() # ==== Example Finished ====
                exception = None
            except KeyboardInterrupt:
                raise
            except:
                exception = sys.exc_info()
                self.debugger.set_continue() # ==== Example Finished ====

            got = self._fakeout.getvalue()  # the actual output
            self._fakeout.truncate(0)
            outcome = FAILURE   # guilty until proved innocent or insane

            # If the example executed without raising any exceptions,
            # verify its output.
            if exception is None:
                if check(example.want, got, self.optionflags):
                    outcome = SUCCESS

            # The example raised an exception:  check if it was expected.
            else:
                exc_msg = traceback.format_exception_only(*exception[:2])[-1]
                if not quiet:
                    got += _exception_traceback(exception)

                # If `example.exc_msg` is None, then we weren't expecting
                # an exception.
                if example.exc_msg is None:
                    outcome = BOOM

                # We expected an exception:  see whether it matches.
                elif check(example.exc_msg, exc_msg, self.optionflags):
                    outcome = SUCCESS

                # Another chance if they didn't care about the detail.
                elif self.optionflags & IGNORE_EXCEPTION_DETAIL:
                    if check(_strip_exception_details(example.exc_msg),
                             _strip_exception_details(exc_msg),
                             self.optionflags):
                        outcome = SUCCESS

            # Report the outcome.
            if outcome is SUCCESS:
                if not quiet:
                    self.report_success(out, test, example, got)
            elif outcome is FAILURE:
                if not quiet:
                    self.report_failure(out, test, example, got)
                failures += 1
            elif outcome is BOOM:
                if not quiet:
                    self.report_unexpected_exception(out, test, example,
                                                     exception)
                failures += 1
            else:
                assert False, ("unknown outcome", outcome)

            if failures and self.optionflags & FAIL_FAST:
                break

        # Restore the option flags (in case they were modified)
        self.optionflags = original_optionflags

        # Record and return the number of failures and tries.
        self.__record_outcome(test, failures, tries)
        return TestResults(failures, tries)

    def __record_outcome(self, test, f, t):
        """
        Record the fact that the given DocTest (`test`) generated `f`
        failures out of `t` tried examples.
        """
        f2, t2 = self._name2ft.get(test.name, (0,0))
        self._name2ft[test.name] = (f+f2, t+t2)
        self.failures += f
        self.tries += t

    __LINECACHE_FILENAME_RE = re.compile(r'<doctest '
                                         r'(?P<name>.+)'
                                         r'\[(?P<examplenum>\d+)\]>$')
    def __patched_linecache_getlines(self, filename, module_globals=None):
        m = self.__LINECACHE_FILENAME_RE.match(filename)
        if m and m.group('name') == self.test.name:
            example = self.test.examples[int(m.group('examplenum'))]
            return example.source.splitlines(keepends=True)
        else:
            return self.save_linecache_getlines(filename, module_globals)

    def run(self, test, compileflags=None, out=None, clear_globs=True):
        """
        Run the examples in `test`, and display the results using the
        writer function `out`.

        The examples are run in the namespace `test.globs`.  If
        `clear_globs` is true (the default), then this namespace will
        be cleared after the test runs, to help with garbage
        collection.  If you would like to examine the namespace after
        the test completes, then use `clear_globs=False`.

        `compileflags` gives the set of flags that should be used by
        the Python compiler when running the examples.  If not
        specified, then it will default to the set of future-import
        flags that apply to `globs`.

        The output of each example is checked using
        `DocTestRunner.check_output`, and the results are formatted by
        the `DocTestRunner.report_*` methods.
        """
        self.test = test

        if compileflags is None:
            compileflags = _extract_future_flags(test.globs)

        save_stdout = sys.stdout
        if out is None:
            encoding = save_stdout.encoding
            if encoding is None or encoding.lower() == 'utf-8':
                out = save_stdout.write
            else:
                # Use backslashreplace error handling on write
                def out(s):
                    s = str(s.encode(encoding, 'backslashreplace'), encoding)
                    save_stdout.write(s)
        sys.stdout = self._fakeout

        # Patch pdb.set_trace to restore sys.stdout during interactive
        # debugging (so it's not still redirected to self._fakeout).
        # Note that the interactive output will go to *our*
        # save_stdout, even if that's not the real sys.stdout; this
        # allows us to write test cases for the set_trace behavior.
        save_trace = sys.gettrace()
        save_set_trace = pdb.set_trace
        self.debugger = _OutputRedirectingPdb(save_stdout)
        self.debugger.reset()
        pdb.set_trace = self.debugger.set_trace

        # Patch linecache.getlines, so we can see the example's source
        # when we're inside the debugger.
        self.save_linecache_getlines = linecache.getlines
        linecache.getlines = self.__patched_linecache_getlines

        # Make sure sys.displayhook just prints the value to stdout
        save_displayhook = sys.displayhook
        sys.displayhook = sys.__displayhook__

        try:
            return self.__run(test, compileflags, out)
        finally:
            sys.stdout = save_stdout
            pdb.set_trace = save_set_trace
            sys.settrace(save_trace)
            linecache.getlines = self.save_linecache_getlines
            sys.displayhook = save_displayhook
            if clear_globs:
                test.globs.clear()
                import builtins
                builtins._ = None

    #/////////////////////////////////////////////////////////////////
    # Summarization
    #/////////////////////////////////////////////////////////////////
    def summarize(self, verbose=None):
        """
        Print a summary of all the test cases that have been run by
        this DocTestRunner, and return a tuple `(f, t)`, where `f` is
        the total number of failed examples, and `t` is the total
        number of tried examples.

        The optional `verbose` argument controls how detailed the
        summary is.  If the verbosity is not specified, then the
        DocTestRunner's verbosity is used.
        """
        if verbose is None:
            verbose = self._verbose
        notests = []
        passed = []
        failed = []
        totalt = totalf = 0
        for x in self._name2ft.items():
            name, (f, t) = x
            assert f <= t
            totalt += t
            totalf += f
            if t == 0:
                notests.append(name)
            elif f == 0:
                passed.append( (name, t) )
            else:
                failed.append(x)
        if verbose:
            if notests:
                print(len(notests), "items had no tests:")
                notests.sort()
                for thing in notests:
                    print("   ", thing)
            if passed:
                print(len(passed), "items passed all tests:")
                passed.sort()
                for thing, count in passed:
                    print(" %3d tests in %s" % (count, thing))
        if failed:
            print(self.DIVIDER)
            print(len(failed), "items had failures:")
            failed.sort()
            for thing, (f, t) in failed:
                print(" %3d of %3d in %s" % (f, t, thing))
        if verbose:
            print(totalt, "tests in", len(self._name2ft), "items.")
            print(totalt - totalf, "passed and", totalf, "failed.")
        if totalf:
            print("***Test Failed***", totalf, "failures.")
        elif verbose:
            print("Test passed.")
        return TestResults(totalf, totalt)

    #/////////////////////////////////////////////////////////////////
    # Backward compatibility cruft to maintain doctest.master.
    #/////////////////////////////////////////////////////////////////
    def merge(self, other):
        d = self._name2ft
        for name, (f, t) in other._name2ft.items():
            if name in d:
                # Don't print here by default, since doing
                #     so breaks some of the buildbots
                #print("*** DocTestRunner.merge: '" + name + "' in both" \
                #    " testers; summing outcomes.")
                f2, t2 = d[name]
                f = f + f2
                t = t + t2
            d[name] = f, t

class OutputChecker:
    """
    A class used to check the whether the actual output from a doctest
    example matches the expected output.  `OutputChecker` defines two
    methods: `check_output`, which compares a given pair of outputs,
    and returns true if they match; and `output_difference`, which
    returns a string describing the differences between two outputs.
    """
    def _toAscii(self, s):
        """
        Convert string to hex-escaped ASCII string.
        """
        return str(s.encode('ASCII', 'backslashreplace'), "ASCII")

    def check_output(self, want, got, optionflags):
        """
        Return True iff the actual output from an example (`got`)
        matches the expected output (`want`).  These strings are
        always considered to match if they are identical; but
        depending on what option flags the test runner is using,
        several non-exact match types are also possible.  See the
        documentation for `TestRunner` for more information about
        option flags.
        """

        # If `want` contains hex-escaped character such as "\u1234",
        # then `want` is a string of six characters(e.g. [\,u,1,2,3,4]).
        # On the other hand, `got` could be another sequence of
        # characters such as [\u1234], so `want` and `got` should
        # be folded to hex-escaped ASCII string to compare.
        got = self._toAscii(got)
        want = self._toAscii(want)

        # Handle the common case first, for efficiency:
        # if they're string-identical, always return true.
        if got == want:
            return True

        # The values True and False replaced 1 and 0 as the return
        # value for boolean comparisons in Python 2.3.
        if not (optionflags & DONT_ACCEPT_TRUE_FOR_1):
            if (got,want) == ("True\n", "1\n"):
                return True
            if (got,want) == ("False\n", "0\n"):
                return True

        # <BLANKLINE> can be used as a special sequence to signify a
        # blank line, unless the DONT_ACCEPT_BLANKLINE flag is used.
        if not (optionflags & DONT_ACCEPT_BLANKLINE):
            # Replace <BLANKLINE> in want with a blank line.
            want = re.sub(r'(?m)^%s\s*?$' % re.escape(BLANKLINE_MARKER),
                          '', want)
            # If a line in got contains only spaces, then remove the
            # spaces.
            got = re.sub(r'(?m)^[^\S\n]+$', '', got)
            if got == want:
                return True

        # This flag causes doctest to ignore any differences in the
        # contents of whitespace strings.  Note that this can be used
        # in conjunction with the ELLIPSIS flag.
        if optionflags & NORMALIZE_WHITESPACE:
            got = ' '.join(got.split())
            want = ' '.join(want.split())
            if got == want:
                return True

        # The ELLIPSIS flag says to let the sequence "..." in `want`
        # match any substring in `got`.
        if optionflags & ELLIPSIS:
            if _ellipsis_match(want, got):
                return True

        # We didn't find any match; return false.
        return False

    # Should we do a fancy diff?
    def _do_a_fancy_diff(self, want, got, optionflags):
        # Not unless they asked for a fancy diff.
        if not optionflags & (REPORT_UDIFF |
                              REPORT_CDIFF |
                              REPORT_NDIFF):
            return False

        # If expected output uses ellipsis, a meaningful fancy diff is
        # too hard ... or maybe not.  In two real-life failures Tim saw,
        # a diff was a major help anyway, so this is commented out.
        # [todo] _ellipsis_match() knows which pieces do and don't match,
        # and could be the basis for a kick-ass diff in this case.
        ##if optionflags & ELLIPSIS and ELLIPSIS_MARKER in want:
        ##    return False

        # ndiff does intraline difference marking, so can be useful even
        # for 1-line differences.
        if optionflags & REPORT_NDIFF:
            return True

        # The other diff types need at least a few lines to be helpful.
        return want.count('\n') > 2 and got.count('\n') > 2

    def output_difference(self, example, got, optionflags):
        """
        Return a string describing the differences between the
        expected output for a given example (`example`) and the actual
        output (`got`).  `optionflags` is the set of option flags used
        to compare `want` and `got`.
        """
        want = example.want
        # If <BLANKLINE>s are being used, then replace blank lines
        # with <BLANKLINE> in the actual output string.
        if not (optionflags & DONT_ACCEPT_BLANKLINE):
            got = re.sub('(?m)^[ ]*(?=\n)', BLANKLINE_MARKER, got)

        # Check if we should use diff.
        if self._do_a_fancy_diff(want, got, optionflags):
            # Split want & got into lines.
            want_lines = want.splitlines(keepends=True)
            got_lines = got.splitlines(keepends=True)
            # Use difflib to find their differences.
            if optionflags & REPORT_UDIFF:
                diff = difflib.unified_diff(want_lines, got_lines, n=2)
                diff = list(diff)[2:] # strip the diff header
                kind = 'unified diff with -expected +actual'
            elif optionflags & REPORT_CDIFF:
                diff = difflib.context_diff(want_lines, got_lines, n=2)
                diff = list(diff)[2:] # strip the diff header
                kind = 'context diff with expected followed by actual'
            elif optionflags & REPORT_NDIFF:
                engine = difflib.Differ(charjunk=difflib.IS_CHARACTER_JUNK)
                diff = list(engine.compare(want_lines, got_lines))
                kind = 'ndiff with -expected +actual'
            else:
                assert 0, 'Bad diff option'
            return 'Differences (%s):\n' % kind + _indent(''.join(diff))

        # If we're not using diff, then simply list the expected
        # output followed by the actual output.
        if want and got:
            return 'Expected:\n%sGot:\n%s' % (_indent(want), _indent(got))
        elif want:
            return 'Expected:\n%sGot nothing\n' % _indent(want)
        elif got:
            return 'Expected nothing\nGot:\n%s' % _indent(got)
        else:
            return 'Expected nothing\nGot nothing\n'

class DocTestFailure(Exception):
    """A DocTest example has failed in debugging mode.

    The exception instance has variables:

    - test: the DocTest object being run

    - example: the Example object that failed

    - got: the actual output
    """
    def __init__(self, test, example, got):
        self.test = test
        self.example = example
        self.got = got

    def __str__(self):
        return str(self.test)

class UnexpectedException(Exception):
    """A DocTest example has encountered an unexpected exception

    The exception instance has variables:

    - test: the DocTest object being run

    - example: the Example object that failed

    - exc_info: the exception info
    """
    def __init__(self, test, example, exc_info):
        self.test = test
        self.example = example
        self.exc_info = exc_info

    def __str__(self):
        return str(self.test)

class DebugRunner(DocTestRunner):
    r"""Run doc tests but raise an exception as soon as there is a failure.

       If an unexpected exception occurs, an UnexpectedException is raised.
       It contains the test, the example, and the original exception:

         >>> runner = DebugRunner(verbose=False)
         >>> test = DocTestParser().get_doctest('>>> raise KeyError\n42',
         ...                                    {}, 'foo', 'foo.py', 0)
         >>> try:
         ...     runner.run(test)
         ... except UnexpectedException as f:
         ...     failure = f

         >>> failure.test is test
         True

         >>> failure.example.want
         '42\n'

         >>> exc_info = failure.exc_info
         >>> raise exc_info[1] # Already has the traceback
         Traceback (most recent call last):
         ...
         KeyError

       We wrap the original exception to give the calling application
       access to the test and example information.

       If the output doesn't match, then a DocTestFailure is raised:

         >>> test = DocTestParser().get_doctest('''
         ...      >>> x = 1
         ...      >>> x
         ...      2
         ...      ''', {}, 'foo', 'foo.py', 0)

         >>> try:
         ...    runner.run(test)
         ... except DocTestFailure as f:
         ...    failure = f

       DocTestFailure objects provide access to the test:

         >>> failure.test is test
         True

       As well as to the example:

         >>> failure.example.want
         '2\n'

       and the actual output:

         >>> failure.got
         '1\n'

       If a failure or error occurs, the globals are left intact:

         >>> del test.globs['__builtins__']
         >>> test.globs
         {'x': 1}

         >>> test = DocTestParser().get_doctest('''
         ...      >>> x = 2
         ...      >>> raise KeyError
         ...      ''', {}, 'foo', 'foo.py', 0)

         >>> runner.run(test)
         Traceback (most recent call last):
         ...
         doctest.UnexpectedException: <DocTest foo from foo.py:0 (2 examples)>

         >>> del test.globs['__builtins__']
         >>> test.globs
         {'x': 2}

       But the globals are cleared if there is no error:

         >>> test = DocTestParser().get_doctest('''
         ...      >>> x = 2
         ...      ''', {}, 'foo', 'foo.py', 0)

         >>> runner.run(test)
         TestResults(failed=0, attempted=1)

         >>> test.globs
         {}

       """

    def run(self, test, compileflags=None, out=None, clear_globs=True):
        r = DocTestRunner.run(self, test, compileflags, out, False)
        if clear_globs:
            test.globs.clear()
        return r

    def report_unexpected_exception(self, out, test, example, exc_info):
        raise UnexpectedException(test, example, exc_info)

    def report_failure(self, out, test, example, got):
        raise DocTestFailure(test, example, got)

######################################################################
## 6. Test Functions
######################################################################
# These should be backwards compatible.

# For backward compatibility, a global instance of a DocTestRunner
# class, updated by testmod.
master = None

def testmod(m=None, name=None, globs=None, verbose=None,
            report=True, optionflags=0, extraglobs=None,
            raise_on_error=False, exclude_empty=False):
    """m=None, name=None, globs=None, verbose=None, report=True,
       optionflags=0, extraglobs=None, raise_on_error=False,
       exclude_empty=False

    Test examples in docstrings in functions and classes reachable
    from module m (or the current module if m is not supplied), starting
    with m.__doc__.

    Also test examples reachable from dict m.__test__ if it exists and is
    not None.  m.__test__ maps names to functions, classes and strings;
    function and class docstrings are tested even if the name is private;
    strings are tested directly, as if they were docstrings.

    Return (#failures, #tests).

    See help(doctest) for an overview.

    Optional keyword arg "name" gives the name of the module; by default
    use m.__name__.

    Optional keyword arg "globs" gives a dict to be used as the globals
    when executing examples; by default, use m.__dict__.  A copy of this
    dict is actually used for each docstring, so that each docstring's
    examples start with a clean slate.

    Optional keyword arg "extraglobs" gives a dictionary that should be
    merged into the globals that are used to execute examples.  By
    default, no extra globals are used.  This is new in 2.4.

    Optional keyword arg "verbose" prints lots of stuff if true, prints
    only failures if false; by default, it's true iff "-v" is in sys.argv.

    Optional keyword arg "report" prints a summary at the end when true,
    else prints nothing at the end.  In verbose mode, the summary is
    detailed, else very brief (in fact, empty if all tests passed).

    Optional keyword arg "optionflags" or's together module constants,
    and defaults to 0.  This is new in 2.3.  Possible values (see the
    docs for details):

        DONT_ACCEPT_TRUE_FOR_1
        DONT_ACCEPT_BLANKLINE
        NORMALIZE_WHITESPACE
        ELLIPSIS
        SKIP
        IGNORE_EXCEPTION_DETAIL
        REPORT_UDIFF
        REPORT_CDIFF
        REPORT_NDIFF
        REPORT_ONLY_FIRST_FAILURE

    Optional keyword arg "raise_on_error" raises an exception on the
    first unexpected exception or failure. This allows failures to be
    post-mortem debugged.

    Advanced tomfoolery:  testmod runs methods of a local instance of
    class doctest.Tester, then merges the results into (or creates)
    global Tester instance doctest.master.  Methods of doctest.master
    can be called directly too, if you want to do something unusual.
    Passing report=0 to testmod is especially useful then, to delay
    displaying a summary.  Invoke doctest.master.summarize(verbose)
    when you're done fiddling.
    """
    global master

    # If no module was given, then use __main__.
    if m is None:
        # DWA - m will still be None if this wasn't invoked from the command
        # line, in which case the following TypeError is about as good an error
        # as we should expect
        m = sys.modules.get('__main__')

    # Check that we were actually given a module.
    if not inspect.ismodule(m):
        raise TypeError("testmod: module required; %r" % (m,))

    # If no name was given, then use the module's name.
    if name is None:
        name = m.__name__

    # Find, parse, and run all tests in the given module.
    finder = DocTestFinder(exclude_empty=exclude_empty)

    if raise_on_error:
        runner = DebugRunner(verbose=verbose, optionflags=optionflags)
    else:
        runner = DocTestRunner(verbose=verbose, optionflags=optionflags)

    for test in finder.find(m, name, globs=globs, extraglobs=extraglobs):
        runner.run(test)

    if report:
        runner.summarize()

    if master is None:
        master = runner
    else:
        master.merge(runner)

    return TestResults(runner.failures, runner.tries)

def testfile(filename, module_relative=True, name=None, package=None,
             globs=None, verbose=None, report=True, optionflags=0,
             extraglobs=None, raise_on_error=False, parser=DocTestParser(),
             encoding=None):
    """
    Test examples in the given file.  Return (#failures, #tests).

    Optional keyword arg "module_relative" specifies how filenames
    should be interpreted:

      - If "module_relative" is True (the default), then "filename"
         specifies a module-relative path.  By default, this path is
         relative to the calling module's directory; but if the
         "package" argument is specified, then it is relative to that
         package.  To ensure os-independence, "filename" should use
         "/" characters to separate path segments, and should not
         be an absolute path (i.e., it may not begin with "/").

      - If "module_relative" is False, then "filename" specifies an
        os-specific path.  The path may be absolute or relative (to
        the current working directory).

    Optional keyword arg "name" gives the name of the test; by default
    use the file's basename.

    Optional keyword argument "package" is a Python package or the
    name of a Python package whose directory should be used as the
    base directory for a module relative filename.  If no package is
    specified, then the calling module's directory is used as the base
    directory for module relative filenames.  It is an error to
    specify "package" if "module_relative" is False.

    Optional keyword arg "globs" gives a dict to be used as the globals
    when executing examples; by default, use {}.  A copy of this dict
    is actually used for each docstring, so that each docstring's
    examples start with a clean slate.

    Optional keyword arg "extraglobs" gives a dictionary that should be
    merged into the globals that are used to execute examples.  By
    default, no extra globals are used.

    Optional keyword arg "verbose" prints lots of stuff if true, prints
    only failures if false; by default, it's true iff "-v" is in sys.argv.

    Optional keyword arg "report" prints a summary at the end when true,
    else prints nothing at the end.  In verbose mode, the summary is
    detailed, else very brief (in fact, empty if all tests passed).

    Optional keyword arg "optionflags" or's together module constants,
    and defaults to 0.  Possible values (see the docs for details):

        DONT_ACCEPT_TRUE_FOR_1
        DONT_ACCEPT_BLANKLINE
        NORMALIZE_WHITESPACE
        ELLIPSIS
        SKIP
        IGNORE_EXCEPTION_DETAIL
        REPORT_UDIFF
        REPORT_CDIFF
        REPORT_NDIFF
        REPORT_ONLY_FIRST_FAILURE

    Optional keyword arg "raise_on_error" raises an exception on the
    first unexpected exception or failure. This allows failures to be
    post-mortem debugged.

    Optional keyword arg "parser" specifies a DocTestParser (or
    subclass) that should be used to extract tests from the files.

    Optional keyword arg "encoding" specifies an encoding that should
    be used to convert the file to unicode.

    Advanced tomfoolery:  testmod runs methods of a local instance of
    class doctest.Tester, then merges the results into (or creates)
    global Tester instance doctest.master.  Methods of doctest.master
    can be called directly too, if you want to do something unusual.
    Passing report=0 to testmod is especially useful then, to delay
    displaying a summary.  Invoke doctest.master.summarize(verbose)
    when you're done fiddling.
    """
    global master

    if package and not module_relative:
        raise ValueError("Package may only be specified for module-"
                         "relative paths.")

    # Relativize the path
    text, filename = _load_testfile(filename, package, module_relative,
                                    encoding or "utf-8")

    # If no name was given, then use the file's name.
    if name is None:
        name = os.path.basename(filename)

    # Assemble the globals.
    if globs is None:
        globs = {}
    else:
        globs = globs.copy()
    if extraglobs is not None:
        globs.update(extraglobs)
    if '__name__' not in globs:
        globs['__name__'] = '__main__'

    if raise_on_error:
        runner = DebugRunner(verbose=verbose, optionflags=optionflags)
    else:
        runner = DocTestRunner(verbose=verbose, optionflags=optionflags)

    # Read the file, convert it to a test, and run it.
    test = parser.get_doctest(text, globs, name, filename, 0)
    runner.run(test)

    if report:
        runner.summarize()

    if master is None:
        master = runner
    else:
        master.merge(runner)

    return TestResults(runner.failures, runner.tries)

def run_docstring_examples(f, globs, verbose=False, name="NoName",
                           compileflags=None, optionflags=0):
    """
    Test examples in the given object's docstring (`f`), using `globs`
    as globals.  Optional argument `name` is used in failure messages.
    If the optional argument `verbose` is true, then generate output
    even if there are no failures.

    `compileflags` gives the set of flags that should be used by the
    Python compiler when running the examples.  If not specified, then
    it will default to the set of future-import flags that apply to
    `globs`.

    Optional keyword arg `optionflags` specifies options for the
    testing and output.  See the documentation for `testmod` for more
    information.
    """
    # Find, parse, and run all tests in the given module.
    finder = DocTestFinder(verbose=verbose, recurse=False)
    runner = DocTestRunner(verbose=verbose, optionflags=optionflags)
    for test in finder.find(f, name, globs=globs):
        runner.run(test, compileflags=compileflags)

######################################################################
## 7. Unittest Support
######################################################################

_unittest_reportflags = 0

def set_unittest_reportflags(flags):
    """Sets the unittest option flags.

    The old flag is returned so that a runner could restore the old
    value if it wished to:

      >>> import doctest
      >>> old = doctest._unittest_reportflags
      >>> doctest.set_unittest_reportflags(REPORT_NDIFF |
      ...                          REPORT_ONLY_FIRST_FAILURE) == old
      True

      >>> doctest._unittest_reportflags == (REPORT_NDIFF |
      ...                                   REPORT_ONLY_FIRST_FAILURE)
      True

    Only reporting flags can be set:

      >>> doctest.set_unittest_reportflags(ELLIPSIS)
      Traceback (most recent call last):
      ...
      ValueError: ('Only reporting flags allowed', 8)

      >>> doctest.set_unittest_reportflags(old) == (REPORT_NDIFF |
      ...                                   REPORT_ONLY_FIRST_FAILURE)
      True
    """
    global _unittest_reportflags

    if (flags & REPORTING_FLAGS) != flags:
        raise ValueError("Only reporting flags allowed", flags)
    old = _unittest_reportflags
    _unittest_reportflags = flags
    return old


class DocTestCase(unittest.TestCase):

    def __init__(self, test, optionflags=0, setUp=None, tearDown=None,
                 checker=None):

        unittest.TestCase.__init__(self)
        self._dt_optionflags = optionflags
        self._dt_checker = checker
        self._dt_test = test
        self._dt_setUp = setUp
        self._dt_tearDown = tearDown

    def setUp(self):
        test = self._dt_test

        if self._dt_setUp is not None:
            self._dt_setUp(test)

    def tearDown(self):
        test = self._dt_test

        if self._dt_tearDown is not None:
            self._dt_tearDown(test)

        test.globs.clear()

    def runTest(self):
        test = self._dt_test
        old = sys.stdout
        new = StringIO()
        optionflags = self._dt_optionflags

        if not (optionflags & REPORTING_FLAGS):
            # The option flags don't include any reporting flags,
            # so add the default reporting flags
            optionflags |= _unittest_reportflags

        runner = DocTestRunner(optionflags=optionflags,
                               checker=self._dt_checker, verbose=False)

        try:
            runner.DIVIDER = "-"*70
            failures, tries = runner.run(
                test, out=new.write, clear_globs=False)
        finally:
            sys.stdout = old

        if failures:
            raise self.failureException(self.format_failure(new.getvalue()))

    def format_failure(self, err):
        test = self._dt_test
        if test.lineno is None:
            lineno = 'unknown line number'
        else:
            lineno = '%s' % test.lineno
        lname = '.'.join(test.name.split('.')[-1:])
        return ('Failed doctest test for %s\n'
                '  File "%s", line %s, in %s\n\n%s'
                % (test.name, test.filename, lineno, lname, err)
                )

    def debug(self):
        r"""Run the test case without results and without catching exceptions

           The unit test framework includes a debug method on test cases
           and test suites to support post-mortem debugging.  The test code
           is run in such a way that errors are not caught.  This way a
           caller can catch the errors and initiate post-mortem debugging.

           The DocTestCase provides a debug method that raises
           UnexpectedException errors if there is an unexpected
           exception:

             >>> test = DocTestParser().get_doctest('>>> raise KeyError\n42',
             ...                {}, 'foo', 'foo.py', 0)
             >>> case = DocTestCase(test)
             >>> try:
             ...     case.debug()
             ... except UnexpectedException as f:
             ...     failure = f

           The UnexpectedException contains the test, the example, and
           the original exception:

             >>> failure.test is test
             True

             >>> failure.example.want
             '42\n'

             >>> exc_info = failure.exc_info
             >>> raise exc_info[1] # Already has the traceback
             Traceback (most recent call last):
             ...
             KeyError

           If the output doesn't match, then a DocTestFailure is raised:

             >>> test = DocTestParser().get_doctest('''
             ...      >>> x = 1
             ...      >>> x
             ...      2
             ...      ''', {}, 'foo', 'foo.py', 0)
             >>> case = DocTestCase(test)

             >>> try:
             ...    case.debug()
             ... except DocTestFailure as f:
             ...    failure = f

           DocTestFailure objects provide access to the test:

             >>> failure.test is test
             True

           As well as to the example:

             >>> failure.example.want
             '2\n'

           and the actual output:

             >>> failure.got
             '1\n'

           """

        self.setUp()
        runner = DebugRunner(optionflags=self._dt_optionflags,
                             checker=self._dt_checker, verbose=False)
        runner.run(self._dt_test, clear_globs=False)
        self.tearDown()

    def id(self):
        return self._dt_test.name

    def __eq__(self, other):
        if type(self) is not type(other):
            return NotImplemented

        return self._dt_test == other._dt_test and \
               self._dt_optionflags == other._dt_optionflags and \
               self._dt_setUp == other._dt_setUp and \
               self._dt_tearDown == other._dt_tearDown and \
               self._dt_checker == other._dt_checker

    def __hash__(self):
        return hash((self._dt_optionflags, self._dt_setUp, self._dt_tearDown,
                     self._dt_checker))

    def __repr__(self):
        name = self._dt_test.name.split('.')
        return "%s (%s)" % (name[-1], '.'.join(name[:-1]))

    __str__ = object.__str__

    def shortDescription(self):
        return "Doctest: " + self._dt_test.name

class SkipDocTestCase(DocTestCase):
    def __init__(self, module):
        self.module = module
        DocTestCase.__init__(self, None)

    def setUp(self):
        self.skipTest("DocTestSuite will not work with -O2 and above")

    def test_skip(self):
        pass

    def shortDescription(self):
        return "Skipping tests from %s" % self.module.__name__

    __str__ = shortDescription


class _DocTestSuite(unittest.TestSuite):

    def _removeTestAtIndex(self, index):
        pass


def DocTestSuite(module=None, globs=None, extraglobs=None, test_finder=None,
                 **options):
    """
    Convert doctest tests for a module to a unittest test suite.

    This converts each documentation string in a module that
    contains doctest tests to a unittest test case.  If any of the
    tests in a doc string fail, then the test case fails.  An exception
    is raised showing the name of the file containing the test and a
    (sometimes approximate) line number.

    The `module` argument provides the module to be tested.  The argument
    can be either a module or a module name.

    If no argument is given, the calling module is used.

    A number of options may be provided as keyword arguments:

    setUp
      A set-up function.  This is called before running the
      tests in each file. The setUp function will be passed a DocTest
      object.  The setUp function can access the test globals as the
      globs attribute of the test passed.

    tearDown
      A tear-down function.  This is called after running the
      tests in each file.  The tearDown function will be passed a DocTest
      object.  The tearDown function can access the test globals as the
      globs attribute of the test passed.

    globs
      A dictionary containing initial global variables for the tests.

    optionflags
       A set of doctest option flags expressed as an integer.
    """

    if test_finder is None:
        test_finder = DocTestFinder()

    module = _normalize_module(module)
    tests = test_finder.find(module, globs=globs, extraglobs=extraglobs)

    if not tests and sys.flags.optimize >=2:
        # Skip doctests when running with -O2
        suite = _DocTestSuite()
        suite.addTest(SkipDocTestCase(module))
        return suite

    tests.sort()
    suite = _DocTestSuite()

    for test in tests:
        if len(test.examples) == 0:
            continue
        if not test.filename:
            filename = module.__file__
            if filename[-4:] == ".pyc":
                filename = filename[:-1]
            test.filename = filename
        suite.addTest(DocTestCase(test, **options))

    return suite

class DocFileCase(DocTestCase):

    def id(self):
        return '_'.join(self._dt_test.name.split('.'))

    def __repr__(self):
        return self._dt_test.filename

    def format_failure(self, err):
        return ('Failed doctest test for %s\n  File "%s", line 0\n\n%s'
                % (self._dt_test.name, self._dt_test.filename, err)
                )

def DocFileTest(path, module_relative=True, package=None,
                globs=None, parser=DocTestParser(),
                encoding=None, **options):
    if globs is None:
        globs = {}
    else:
        globs = globs.copy()

    if package and not module_relative:
        raise ValueError("Package may only be specified for module-"
                         "relative paths.")

    # Relativize the path.
    doc, path = _load_testfile(path, package, module_relative,
                               encoding or "utf-8")

    if "__file__" not in globs:
        globs["__file__"] = path

    # Find the file and read it.
    name = os.path.basename(path)

    # Convert it to a test, and wrap it in a DocFileCase.
    test = parser.get_doctest(doc, globs, name, path, 0)
    return DocFileCase(test, **options)

def DocFileSuite(*paths, **kw):
    """A unittest suite for one or more doctest files.

    The path to each doctest file is given as a string; the
    interpretation of that string depends on the keyword argument
    "module_relative".

    A number of options may be provided as keyword arguments:

    module_relative
      If "module_relative" is True, then the given file paths are
      interpreted as os-independent module-relative paths.  By
      default, these paths are relative to the calling module's
      directory; but if the "package" argument is specified, then
      they are relative to that package.  To ensure os-independence,
      "filename" should use "/" characters to separate path
      segments, and may not be an absolute path (i.e., it may not
      begin with "/").

      If "module_relative" is False, then the given file paths are
      interpreted as os-specific paths.  These paths may be absolute
      or relative (to the current working directory).

    package
      A Python package or the name of a Python package whose directory
      should be used as the base directory for module relative paths.
      If "package" is not specified, then the calling module's
      directory is used as the base directory for module relative
      filenames.  It is an error to specify "package" if
      "module_relative" is False.

    setUp
      A set-up function.  This is called before running the
      tests in each file. The setUp function will be passed a DocTest
      object.  The setUp function can access the test globals as the
      globs attribute of the test passed.

    tearDown
      A tear-down function.  This is called after running the
      tests in each file.  The tearDown function will be passed a DocTest
      object.  The tearDown function can access the test globals as the
      globs attribute of the test passed.

    globs
      A dictionary containing initial global variables for the tests.

    optionflags
      A set of doctest option flags expressed as an integer.

    parser
      A DocTestParser (or subclass) that should be used to extract
      tests from the files.

    encoding
      An encoding that will be used to convert the files to unicode.
    """
    suite = _DocTestSuite()

    # We do this here so that _normalize_module is called at the right
    # level.  If it were called in DocFileTest, then this function
    # would be the caller and we might guess the package incorrectly.
    if kw.get('module_relative', True):
        kw['package'] = _normalize_module(kw.get('package'))

    for path in paths:
        suite.addTest(DocFileTest(path, **kw))

    return suite

######################################################################
## 8. Debugging Support
######################################################################

def script_from_examples(s):
    r"""Extract script from text with examples.

       Converts text with examples to a Python script.  Example input is
       converted to regular code.  Example output and all other words
       are converted to comments:

       >>> text = '''
       ...       Here are examples of simple math.
       ...
       ...           Python has super accurate integer addition
       ...
       ...           >>> 2 + 2
       ...           5
       ...
       ...           And very friendly error messages:
       ...
       ...           >>> 1/0
       ...           To Infinity
       ...           And
       ...           Beyond
       ...
       ...           You can use logic if you want:
       ...
       ...           >>> if 0:
       ...           ...    blah
       ...           ...    blah
       ...           ...
       ...
       ...           Ho hum
       ...           '''

       >>> print(script_from_examples(text))
       # Here are examples of simple math.
       #
       #     Python has super accurate integer addition
       #
       2 + 2
       # Expected:
       ## 5
       #
       #     And very friendly error messages:
       #
       1/0
       # Expected:
       ## To Infinity
       ## And
       ## Beyond
       #
       #     You can use logic if you want:
       #
       if 0:
          blah
          blah
       #
       #     Ho hum
       <BLANKLINE>
       """
    output = []
    for piece in DocTestParser().parse(s):
        if isinstance(piece, Example):
            # Add the example's source code (strip trailing NL)
            output.append(piece.source[:-1])
            # Add the expected output:
            want = piece.want
            if want:
                output.append('# Expected:')
                output += ['## '+l for l in want.split('\n')[:-1]]
        else:
            # Add non-example text.
            output += [_comment_line(l)
                       for l in piece.split('\n')[:-1]]

    # Trim junk on both ends.
    while output and output[-1] == '#':
        output.pop()
    while output and output[0] == '#':
        output.pop(0)
    # Combine the output, and return it.
    # Add a courtesy newline to prevent exec from choking (see bug #1172785)
    return '\n'.join(output) + '\n'

def testsource(module, name):
    """Extract the test sources from a doctest docstring as a script.

    Provide the module (or dotted name of the module) containing the
    test to be debugged and the name (within the module) of the object
    with the doc string with tests to be debugged.
    """
    module = _normalize_module(module)
    tests = DocTestFinder().find(module)
    test = [t for t in tests if t.name == name]
    if not test:
        raise ValueError(name, "not found in tests")
    test = test[0]
    testsrc = script_from_examples(test.docstring)
    return testsrc

def debug_src(src, pm=False, globs=None):
    """Debug a single doctest docstring, in argument `src`'"""
    testsrc = script_from_examples(src)
    debug_script(testsrc, pm, globs)

def debug_script(src, pm=False, globs=None):
    "Debug a test script.  `src` is the script, as a string."
    import pdb

    if globs:
        globs = globs.copy()
    else:
        globs = {}

    if pm:
        try:
            exec(src, globs, globs)
        except:
            print(sys.exc_info()[1])
            p = pdb.Pdb(nosigint=True)
            p.reset()
            p.interaction(None, sys.exc_info()[2])
    else:
        pdb.Pdb(nosigint=True).run("exec(%r)" % src, globs, globs)

def debug(module, name, pm=False):
    """Debug a single doctest docstring.

    Provide the module (or dotted name of the module) containing the
    test to be debugged and the name (within the module) of the object
    with the docstring with tests to be debugged.
    """
    module = _normalize_module(module)
    testsrc = testsource(module, name)
    debug_script(testsrc, pm, module.__dict__)

######################################################################
## 9. Example Usage
######################################################################
class _TestClass:
    """
    A pointless class, for sanity-checking of docstring testing.

    Methods:
        square()
        get()

    >>> _TestClass(13).get() + _TestClass(-12).get()
    1
    >>> hex(_TestClass(13).square().get())
    '0xa9'
    """

    def __init__(self, val):
        """val -> _TestClass object with associated value val.

        >>> t = _TestClass(123)
        >>> print(t.get())
        123
        """

        self.val = val

    def square(self):
        """square() -> square TestClass's associated value

        >>> _TestClass(13).square().get()
        169
        """

        self.val = self.val ** 2
        return self

    def get(self):
        """get() -> return TestClass's associated value.

        >>> x = _TestClass(-42)
        >>> print(x.get())
        -42
        """

        return self.val

__test__ = {"_TestClass": _TestClass,
            "string": r"""
                      Example of a string object, searched as-is.
                      >>> x = 1; y = 2
                      >>> x + y, x * y
                      (3, 2)
                      """,

            "bool-int equivalence": r"""
                                    In 2.2, boolean expressions displayed
                                    0 or 1.  By default, we still accept
                                    them.  This can be disabled by passing
                                    DONT_ACCEPT_TRUE_FOR_1 to the new
                                    optionflags argument.
                                    >>> 4 == 4
                                    1
                                    >>> 4 == 4
                                    True
                                    >>> 4 > 4
                                    0
                                    >>> 4 > 4
                                    False
                                    """,

            "blank lines": r"""
                Blank lines can be marked with <BLANKLINE>:
                    >>> print('foo\n\nbar\n')
                    foo
                    <BLANKLINE>
                    bar
                    <BLANKLINE>
            """,

            "ellipsis": r"""
                If the ellipsis flag is used, then '...' can be used to
                elide substrings in the desired output:
                    >>> print(list(range(1000))) #doctest: +ELLIPSIS
                    [0, 1, 2, ..., 999]
            """,

            "whitespace normalization": r"""
                If the whitespace normalization flag is used, then
                differences in whitespace are ignored.
                    >>> print(list(range(30))) #doctest: +NORMALIZE_WHITESPACE
                    [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
                     15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
                     27, 28, 29]
            """,
           }


def _test():
    import argparse

    parser = argparse.ArgumentParser(description="doctest runner")
    parser.add_argument('-v', '--verbose', action='store_true', default=False,
                        help='print very verbose output for all tests')
    parser.add_argument('-o', '--option', action='append',
                        choices=OPTIONFLAGS_BY_NAME.keys(), default=[],
                        help=('specify a doctest option flag to apply'
                              ' to the test run; may be specified more'
                              ' than once to apply multiple options'))
    parser.add_argument('-f', '--fail-fast', action='store_true',
                        help=('stop running tests after first failure (this'
                              ' is a shorthand for -o FAIL_FAST, and is'
                              ' in addition to any other -o options)'))
    parser.add_argument('file', nargs='+',
                        help='file containing the tests to run')
    args = parser.parse_args()
    testfiles = args.file
    # Verbose used to be handled by the "inspect argv" magic in DocTestRunner,
    # but since we are using argparse we are passing it manually now.
    verbose = args.verbose
    options = 0
    for option in args.option:
        options |= OPTIONFLAGS_BY_NAME[option]
    if args.fail_fast:
        options |= FAIL_FAST
    for filename in testfiles:
        if filename.endswith(".py"):
            # It is a module -- insert its dir into sys.path and try to
            # import it. If it is part of a package, that possibly
            # won't work because of package imports.
            dirname, filename = os.path.split(filename)
            sys.path.insert(0, dirname)
            m = __import__(filename[:-3])
            del sys.path[0]
            failures, _ = testmod(m, verbose=verbose, optionflags=options)
        else:
            failures, _ = testfile(filename, module_relative=False,
                                     verbose=verbose, optionflags=options)
        if failures:
            return 1
    return 0


if __name__ == "__main__":
    sys.exit(_test())
_sitebuiltins.py000064400000006053151153537470010012 0ustar00"""
The objects used by the site module to add custom builtins.
"""

# Those objects are almost immortal and they keep a reference to their module
# globals.  Defining them in the site module would keep too many references
# alive.
# Note this means this module should also avoid keep things alive in its
# globals.

import sys

class Quitter(object):
    def __init__(self, name, eof):
        self.name = name
        self.eof = eof
    def __repr__(self):
        return 'Use %s() or %s to exit' % (self.name, self.eof)
    def __call__(self, code=None):
        # Shells like IDLE catch the SystemExit, but listen when their
        # stdin wrapper is closed.
        try:
            sys.stdin.close()
        except:
            pass
        raise SystemExit(code)


class _Printer(object):
    """interactive prompt objects for printing the license text, a list of
    contributors and the copyright notice."""

    MAXLINES = 23

    def __init__(self, name, data, files=(), dirs=()):
        import os
        self.__name = name
        self.__data = data
        self.__lines = None
        self.__filenames = [os.path.join(dir, filename)
                            for dir in dirs
                            for filename in files]

    def __setup(self):
        if self.__lines:
            return
        data = None
        for filename in self.__filenames:
            try:
                with open(filename, "r") as fp:
                    data = fp.read()
                break
            except OSError:
                pass
        if not data:
            data = self.__data
        self.__lines = data.split('\n')
        self.__linecnt = len(self.__lines)

    def __repr__(self):
        self.__setup()
        if len(self.__lines) <= self.MAXLINES:
            return "\n".join(self.__lines)
        else:
            return "Type %s() to see the full %s text" % ((self.__name,)*2)

    def __call__(self):
        self.__setup()
        prompt = 'Hit Return for more, or q (and Return) to quit: '
        lineno = 0
        while 1:
            try:
                for i in range(lineno, lineno + self.MAXLINES):
                    print(self.__lines[i])
            except IndexError:
                break
            else:
                lineno += self.MAXLINES
                key = None
                while key is None:
                    key = input(prompt)
                    if key not in ('', 'q'):
                        key = None
                if key == 'q':
                    break


class _Helper(object):
    """Define the builtin 'help'.

    This is a wrapper around pydoc.help that provides a helpful message
    when 'help' is typed at the Python interactive prompt.

    Calling help() at the Python prompt starts an interactive help session.
    Calling help(thing) prints help for the python object 'thing'.
    """

    def __repr__(self):
        return "Type help() for interactive help, " \
               "or help(object) for help about object."
    def __call__(self, *args, **kwds):
        import pydoc
        return pydoc.help(*args, **kwds)
config-3.8-x86_64-linux-gnu/Makefile000064400000233533151153537470012663 0ustar00# Generated automatically from Makefile.pre by makesetup.
# Top-level Makefile for Python
#
# As distributed, this file is called Makefile.pre.in; it is processed
# into the real Makefile by running the script ./configure, which
# replaces things like @spam@ with values appropriate for your system.
# This means that if you edit Makefile, your changes get lost the next
# time you run the configure script.  Ideally, you can do:
#
#	./configure
#	make
#	make test
#	make install
#
# If you have a previous version of Python installed that you don't
# want to overwrite, you can use "make altinstall" instead of "make
# install".  Refer to the "Installing" section in the README file for
# additional details.
#
# See also the section "Build instructions" in the README file.

# === Variables set by makesetup ===

MODBUILT_NAMES=      posix  errno  pwd  _sre  _codecs  _weakref  _functools  _operator  _collections  _abc  itertools  atexit  _signal  _stat  time  _thread  _locale  _io  faulthandler  _tracemalloc  _symtable  xxsubtype
MODDISABLED_NAMES= 
MODOBJS=             Modules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  Modules/_sre.o  Modules/_codecsmodule.o  Modules/_weakref.o  Modules/_functoolsmodule.o  Modules/_operator.o  Modules/_collectionsmodule.o  Modules/_abc.o  Modules/itertoolsmodule.o  Modules/atexitmodule.o  Modules/signalmodule.o  Modules/_stat.o  Modules/timemodule.o  Modules/_threadmodule.o  Modules/_localemodule.o  Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o  Modules/faulthandler.o  Modules/_tracemalloc.o Modules/hashtable.o  Modules/symtablemodule.o  Modules/xxsubtype.o
MODLIBS=           $(LOCALMODLIBS) $(BASEMODLIBS)

# === Variables set by configure
VERSION=	3.8
srcdir=		/builddir/build/BUILD/Python-3.8.17
VPATH=		/builddir/build/BUILD/Python-3.8.17
abs_srcdir=	/builddir/build/BUILD/Python-3.8.17
abs_builddir=	/builddir/build/BUILD/Python-3.8.17/build/optimized


CC=		gcc -pthread
CXX=		g++ -pthread
MAINCC=		$(CC)
LINKCC=		gcc
AR=		ar
READELF=	readelf
SOABI=		cpython-38-x86_64-linux-gnu
LDVERSION=	$(VERSION)$(ABIFLAGS)
LIBPYTHON=	
GITVERSION=	
GITTAG=		
GITBRANCH=	
PGO_PROF_GEN_FLAG=-fprofile-generate
PGO_PROF_USE_FLAG=-fprofile-use -fprofile-correction
LLVM_PROF_MERGER=true
LLVM_PROF_FILE=
LLVM_PROF_ERR=no
DTRACE=         /usr/bin/dtrace
DFLAGS=         
DTRACE_HEADERS= Include/pydtrace_probes.h
DTRACE_OBJS=    Python/pydtrace.o

GNULD=		yes

# Shell used by make (some versions default to the login shell, which is bad)
SHELL=		/bin/sh

# Use this to make a link between python$(VERSION) and python in $(BINDIR)
LN=		ln

# Portable install script (configure doesn't always guess right)
INSTALL=	/usr/bin/install -c
INSTALL_PROGRAM=${INSTALL}
INSTALL_SCRIPT= ${INSTALL}
INSTALL_DATA=	${INSTALL} -m 644
# Shared libraries must be installed with executable mode on some systems;
# rather than figuring out exactly which, we always give them executable mode.
INSTALL_SHARED= ${INSTALL} -m 755

MKDIR_P=	/usr/bin/mkdir -p

MAKESETUP=      $(srcdir)/Modules/makesetup

# Compiler options
OPT=		-DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv
BASECFLAGS=	 -Wno-unused-result -Wsign-compare
BASECPPFLAGS=	-IObjects -IInclude -IPython
CONFIGURE_CFLAGS=	 -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv 
# CFLAGS_NODIST is used for building the interpreter and stdlib C extensions.
# Use it when a compiler flag should _not_ be part of the distutils CFLAGS
# once Python is installed (Issue #21121).
CONFIGURE_CFLAGS_NODIST=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration
# LDFLAGS_NODIST is used in the same manner as CFLAGS_NODIST.
# Use it when a linker flag should _not_ be part of the distutils LDFLAGS
# once Python is installed (bpo-35257)
CONFIGURE_LDFLAGS_NODIST=-Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g
CONFIGURE_CPPFLAGS=	
CONFIGURE_LDFLAGS=	 -Wl,-z,relro  -Wl,-z,now  -g 
# Avoid assigning CFLAGS, LDFLAGS, etc. so users can use them on the
# command line to append to these values without stomping the pre-set
# values.
PY_CFLAGS=	$(BASECFLAGS) $(OPT) $(CONFIGURE_CFLAGS) $(CFLAGS) $(EXTRA_CFLAGS)
PY_CFLAGS_NODIST=$(CONFIGURE_CFLAGS_NODIST) $(CFLAGS_NODIST) -I$(srcdir)/Include/internal
# Both CPPFLAGS and LDFLAGS need to contain the shell's value for setup.py to
# be able to build extension modules using the directories specified in the
# environment variables
PY_CPPFLAGS=	$(BASECPPFLAGS) -I. -I$(srcdir)/Include $(CONFIGURE_CPPFLAGS) $(CPPFLAGS)
PY_LDFLAGS=	$(CONFIGURE_LDFLAGS) $(LDFLAGS)
PY_LDFLAGS_NODIST=$(CONFIGURE_LDFLAGS_NODIST) $(LDFLAGS_NODIST)
NO_AS_NEEDED=	-Wl,--no-as-needed
SGI_ABI=	@SGI_ABI@
CCSHARED=	-fPIC
# LINKFORSHARED are the flags passed to the $(CC) command that links
# the python executable -- this is only needed for a few systems
LINKFORSHARED=	-Xlinker -export-dynamic
ARFLAGS=	rcs
# Extra C flags added for building the interpreter object files.
CFLAGSFORSHARED=$(CCSHARED)
# C flags used for building the interpreter object files
PY_STDMODULE_CFLAGS= $(PY_CFLAGS) $(PY_CFLAGS_NODIST) $(PY_CPPFLAGS) $(CFLAGSFORSHARED)
PY_BUILTIN_MODULE_CFLAGS= $(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE_BUILTIN
PY_CORE_CFLAGS=	$(PY_STDMODULE_CFLAGS) -DPy_BUILD_CORE
# Linker flags used for building the interpreter object files
PY_CORE_LDFLAGS=$(PY_LDFLAGS) $(PY_LDFLAGS_NODIST) -lcrypto
# Strict or non-strict aliasing flags used to compile dtoa.c, see above
CFLAGS_ALIASING=


# Machine-dependent subdirectories
MACHDEP=	linux

# Multiarch directory (may be empty)
MULTIARCH=	x86_64-linux-gnu
MULTIARCH_CPPFLAGS = -DMULTIARCH=\"x86_64-linux-gnu\"

# Install prefix for architecture-independent files
prefix=		/usr

# Install prefix for architecture-dependent files
exec_prefix=	/usr

# Install prefix for data files
datarootdir=    ${prefix}/share

# Expanded directories
BINDIR=		/usr/bin
LIBDIR=		/usr/lib64
MANDIR=		/usr/share/man
INCLUDEDIR=	/usr/include
CONFINCLUDEDIR=	$(exec_prefix)/include
SCRIPTDIR=	$(prefix)/lib64
ABIFLAGS=	

# Detailed destination directories
BINLIBDEST=	$(LIBDIR)/python$(VERSION)
LIBDEST=	$(SCRIPTDIR)/python$(VERSION)
INCLUDEPY=	$(INCLUDEDIR)/python$(LDVERSION)
CONFINCLUDEPY=	$(CONFINCLUDEDIR)/python$(LDVERSION)

# Symbols used for using shared libraries
SHLIB_SUFFIX=	.so
EXT_SUFFIX=	.cpython-38-x86_64-linux-gnu.so
LDSHARED=	$(CC) -shared $(PY_LDFLAGS)
BLDSHARED=	$(CC) -shared $(PY_CORE_LDFLAGS)
LDCXXSHARED=	$(CXX) -shared
DESTSHARED=	$(BINLIBDEST)/lib-dynload

# Executable suffix (.exe on Windows and Mac OS X)
EXE=		
BUILDEXE=	

# Short name and location for Mac OS X Python framework
UNIVERSALSDK=
PYTHONFRAMEWORK=	
PYTHONFRAMEWORKDIR=	no-framework
PYTHONFRAMEWORKPREFIX=	
PYTHONFRAMEWORKINSTALLDIR= 
# Deployment target selected during configure, to be checked
# by distutils. The export statement is needed to ensure that the
# deployment target is active during build.
MACOSX_DEPLOYMENT_TARGET=
#export MACOSX_DEPLOYMENT_TARGET

# Option to install to strip binaries
STRIPFLAG=-s

# Flags to lipo to produce a 32-bit-only universal executable
LIPO_32BIT_FLAGS=

# Flags to lipo to produce an intel-64-only universal executable
LIPO_INTEL64_FLAGS=

# Options to enable prebinding (for fast startup prior to Mac OS X 10.3)
OTHER_LIBTOOL_OPT=

# Environment to run shared python without installed libraries
RUNSHARED=       LD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/optimized

# ensurepip options
ENSUREPIP=      no

# OpenSSL options for setup.py so sysconfig can pick up AC_SUBST() vars.
OPENSSL_INCLUDES=
OPENSSL_LIBS=-lssl -lcrypto 
OPENSSL_LDFLAGS=

# Modes for directories, executables and data files created by the
# install process.  Default to user-only-writable for all file types.
DIRMODE=	755
EXEMODE=	755
FILEMODE=	644

# configure script arguments
CONFIG_ARGS=	 '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--enable-ipv6' '--enable-shared' '--with-computed-gotos=yes' '--with-dbmliborder=gdbm:ndbm:bdb' '--with-system-expat' '--with-system-ffi' '--enable-loadable-sqlite-extensions' '--with-dtrace' '--with-lto' '--with-ssl-default-suites=openssl' '--with-valgrind' '--without-ensurepip' '--enable-optimizations' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'CFLAGS= -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv ' 'LDFLAGS= -Wl,-z,relro  -Wl,-z,now  -g ' 'CPPFLAGS=' 'PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'


# Subdirectories with code
SRCDIRS= 	Parser Objects Python Modules Modules/_io Programs

# Other subdirectories
SUBDIRSTOO=	Include Lib Misc

# Files and directories to be distributed
CONFIGFILES=	configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in
DISTFILES=	README.rst ChangeLog $(CONFIGFILES)
DISTDIRS=	$(SUBDIRS) $(SUBDIRSTOO) Ext-dummy
DIST=		$(DISTFILES) $(DISTDIRS)


LIBRARY=	libpython$(VERSION)$(ABIFLAGS).a
LDLIBRARY=      libpython$(LDVERSION).so
BLDLIBRARY=     -L. -lpython$(LDVERSION)
PY3LIBRARY=     libpython3.so
DLLLIBRARY=	
LDLIBRARYDIR=   
INSTSONAME=	libpython$(LDVERSION).so.1.0


LIBS=		-lcrypt -lpthread -ldl  -lutil -lm
LIBM=		-lm
LIBC=		
SYSLIBS=	$(LIBM) $(LIBC)
SHLIBS=		$(LIBS)

DLINCLDIR=	.
DYNLOADFILE=	dynload_shlib.o
MACHDEP_OBJS=	
LIBOBJDIR=	Python/
LIBOBJS=	

PYTHON=		python$(EXE)
BUILDPYTHON=	python$(BUILDEXE)

PYTHON_FOR_REGEN=python3.8
UPDATE_FILE=python3.8 $(srcdir)/Tools/scripts/update_file.py
PYTHON_FOR_BUILD=./$(BUILDPYTHON) -E
_PYTHON_HOST_PLATFORM=
BUILD_GNU_TYPE=	x86_64-redhat-linux-gnu
HOST_GNU_TYPE=	x86_64-redhat-linux-gnu

# Tcl and Tk config info from --with-tcltk-includes and -libs options
TCLTK_INCLUDES=	
TCLTK_LIBS=	

# The task to run while instrumented when building the profile-opt target.
# To speed up profile generation, we don't run the full unit test suite
# by default. The default is "-m test --pgo". To run more tests, use
# PROFILE_TASK="-m test --pgo-extended"
PROFILE_TASK=	-m test --pgo

# report files for gcov / lcov coverage report
COVERAGE_INFO=	$(abs_builddir)/coverage.info
COVERAGE_REPORT=$(abs_builddir)/lcov-report
COVERAGE_REPORT_OPTIONS=--no-branch-coverage --title "CPython lcov report"


# === Definitions added by makesetup ===

LOCALMODLIBS=                      
BASEMODLIBS=
PYTHONPATH=$(COREPYTHONPATH)
COREPYTHONPATH=$(DESTPATH)$(SITEPATH)$(TESTPATH)
TESTPATH=
SITEPATH=
DESTPATH=
MACHDESTLIB=$(BINLIBDEST)
DESTLIB=$(LIBDEST)



##########################################################################
# Modules
MODULE_OBJS=	\
		Modules/config.o \
		Modules/getpath.o \
		Modules/main.o \
		Modules/gcmodule.o

IO_H=		Modules/_io/_iomodule.h

IO_OBJS=	\
		Modules/_io/_iomodule.o \
		Modules/_io/iobase.o \
		Modules/_io/fileio.o \
		Modules/_io/bufferedio.o \
		Modules/_io/textio.o \
		Modules/_io/bytesio.o \
		Modules/_io/stringio.o

##########################################################################

LIBFFI_INCLUDEDIR=	

##########################################################################
# Parser
POBJS=		\
		Parser/acceler.o \
		Parser/grammar1.o \
		Parser/listnode.o \
		Parser/node.o \
		Parser/parser.o \
		Parser/token.o \

PARSER_OBJS=	$(POBJS) Parser/myreadline.o Parser/parsetok.o Parser/tokenizer.o

PARSER_HEADERS= \
		$(srcdir)/Include/grammar.h \
		$(srcdir)/Include/parsetok.h \
		$(srcdir)/Parser/parser.h \
		$(srcdir)/Parser/tokenizer.h

##########################################################################
# Python

PYTHON_OBJS=	\
		Python/_warnings.o \
		Python/Python-ast.o \
		Python/asdl.o \
		Python/ast.o \
		Python/ast_opt.o \
		Python/ast_unparse.o \
		Python/bltinmodule.o \
		Python/ceval.o \
		Python/codecs.o \
		Python/compile.o \
		Python/context.o \
		Python/dynamic_annotations.o \
		Python/errors.o \
		Python/frozenmain.o \
		Python/future.o \
		Python/getargs.o \
		Python/getcompiler.o \
		Python/getcopyright.o \
		Python/getplatform.o \
		Python/getversion.o \
		Python/graminit.o \
		Python/hamt.o \
		Python/import.o \
		Python/importdl.o \
		Python/initconfig.o \
		Python/marshal.o \
		Python/modsupport.o \
		Python/mysnprintf.o \
		Python/mystrtoul.o \
		Python/pathconfig.o \
		Python/peephole.o \
		Python/preconfig.o \
		Python/pyarena.o \
		Python/pyctype.o \
		Python/pyfpe.o \
		Python/pyhash.o \
		Python/pylifecycle.o \
		Python/pymath.o \
		Python/pystate.o \
		Python/pythonrun.o \
		Python/pytime.o \
		Python/bootstrap_hash.o \
		Python/structmember.o \
		Python/symtable.o \
		Python/sysmodule.o \
		Python/thread.o \
		Python/traceback.o \
		Python/getopt.o \
		Python/pystrcmp.o \
		Python/pystrtod.o \
		Python/pystrhex.o \
		Python/dtoa.o \
		Python/formatter_unicode.o \
		Python/fileutils.o \
		Python/$(DYNLOADFILE) \
		$(LIBOBJS) \
		$(MACHDEP_OBJS) \
		$(DTRACE_OBJS)


##########################################################################
# Objects
OBJECT_OBJS=	\
		Objects/abstract.o \
		Objects/accu.o \
		Objects/boolobject.o \
		Objects/bytes_methods.o \
		Objects/bytearrayobject.o \
		Objects/bytesobject.o \
		Objects/call.o \
		Objects/capsule.o \
		Objects/cellobject.o \
		Objects/classobject.o \
		Objects/codeobject.o \
		Objects/complexobject.o \
		Objects/descrobject.o \
		Objects/enumobject.o \
		Objects/exceptions.o \
		Objects/genobject.o \
		Objects/fileobject.o \
		Objects/floatobject.o \
		Objects/frameobject.o \
		Objects/funcobject.o \
		Objects/interpreteridobject.o \
		Objects/iterobject.o \
		Objects/listobject.o \
		Objects/longobject.o \
		Objects/dictobject.o \
		Objects/odictobject.o \
		Objects/memoryobject.o \
		Objects/methodobject.o \
		Objects/moduleobject.o \
		Objects/namespaceobject.o \
		Objects/object.o \
		Objects/obmalloc.o \
		Objects/picklebufobject.o \
		Objects/rangeobject.o \
		Objects/setobject.o \
		Objects/sliceobject.o \
		Objects/structseq.o \
		Objects/tupleobject.o \
		Objects/typeobject.o \
		Objects/unicodeobject.o \
		Objects/unicodectype.o \
		Objects/weakrefobject.o

##########################################################################
# objects that get linked into the Python library
LIBRARY_OBJS_OMIT_FROZEN=	\
		Modules/getbuildinfo.o \
		$(PARSER_OBJS) \
		$(OBJECT_OBJS) \
		$(PYTHON_OBJS) \
		$(MODULE_OBJS) \
		$(MODOBJS)

LIBRARY_OBJS=	\
		$(LIBRARY_OBJS_OMIT_FROZEN) \
		Python/frozen.o

##########################################################################
# DTrace

# On some systems, object files that reference DTrace probes need to be modified
# in-place by dtrace(1).
DTRACE_DEPS = \
	Python/ceval.o Python/import.o Python/sysmodule.o Modules/gcmodule.o

#########################################################################
# Rules

# Default target
all:		profile-opt
build_all:	check-clean-src $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks \
		Programs/_testembed python-config

# Check that the source is clean when building out of source.
check-clean-src:
	@if test -n "$(VPATH)" -a -f "$(srcdir)/Programs/python.o"; then \
		echo "Error: The source directory ($(srcdir)) is not clean" ; \
		echo "Building Python out of the source tree (in $(abs_builddir)) requires a clean source tree ($(abs_srcdir))" ; \
		echo "Try to run: make -C \"$(srcdir)\" clean" ; \
		exit 1; \
	fi

# Profile generation build must start from a clean tree.
profile-clean-stamp:
	$(MAKE) clean profile-removal
	touch $@

# Compile with profile generation enabled.
profile-gen-stamp: profile-clean-stamp
	@if [ $(LLVM_PROF_ERR) = yes ]; then \
		echo "Error: Cannot perform PGO build because llvm-profdata was not found in PATH" ;\
		echo "Please add it to PATH and run ./configure again" ;\
		exit 1;\
	fi
	@echo "Building with support for profile generation:"
	$(MAKE) build_all_generate_profile
	touch $@

# Run task with profile generation build to create profile information.
profile-run-stamp:
	@echo "Running code to generate profile data (this can take a while):"
	# First, we need to create a clean build with profile generation
	# enabled.
	$(MAKE) profile-gen-stamp
	# Next, run the profile task to generate the profile information.
	$(MAKE) run_profile_task
	$(MAKE) build_all_merge_profile
	# Remove profile generation binary since we are done with it.
	$(MAKE) clean
	# This is an expensive target to build and it does not have proper
	# makefile dependency information.  So, we create a "stamp" file
	# to record its completion and avoid re-running it.
	touch $@

build_all_generate_profile:
	$(MAKE) build_all CFLAGS_NODIST="$(CFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LDFLAGS_NODIST="$(LDFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)" LIBS="$(LIBS)"

run_profile_task:
	@ # FIXME: can't run for a cross build
	$(LLVM_PROF_FILE) $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) || true

build_all_merge_profile:
	$(LLVM_PROF_MERGER)

# Compile Python binary with profile guided optimization.
# To force re-running of the profile task, remove the profile-run-stamp file.
profile-opt: profile-run-stamp
	@echo "Rebuilding with profile guided optimizations:"
	-rm -f profile-clean-stamp
	$(MAKE) build_all CFLAGS_NODIST="$(CFLAGS_NODIST) $(PGO_PROF_USE_FLAG)" LDFLAGS_NODIST="$(LDFLAGS_NODIST)"

# Compile and run with gcov
.PHONY=coverage coverage-lcov coverage-report
coverage:
	@echo "Building with support for coverage checking:"
	$(MAKE) clean profile-removal
	$(MAKE) build_all CFLAGS="$(CFLAGS) -O0 -pg -fprofile-arcs -ftest-coverage" LIBS="$(LIBS) -lgcov"

coverage-lcov:
	@echo "Creating Coverage HTML report with LCOV:"
	@rm -f $(COVERAGE_INFO)
	@rm -rf $(COVERAGE_REPORT)
	@lcov --capture --directory $(abs_builddir) \
	    --base-directory $(realpath $(abs_builddir)) \
	    --path $(realpath $(abs_srcdir)) \
	    --output-file $(COVERAGE_INFO)
	@ # remove 3rd party modules, system headers and internal files with
	@ # debug, test or dummy functions.
	@lcov --remove $(COVERAGE_INFO) \
	    '*/Modules/_blake2/impl/*' \
	    '*/Modules/_ctypes/libffi*/*' \
	    '*/Modules/_decimal/libmpdec/*' \
	    '*/Modules/_sha3/kcp/*' \
	    '*/Modules/expat/*' \
	    '*/Modules/zlib/*' \
	    '*/Include/*' \
	    '*/Modules/xx*.c' \
	    '*/Parser/listnode.c' \
	    '*/Python/pyfpe.c' \
	    '*/Python/pystrcmp.c' \
	    '/usr/include/*' \
	    '/usr/local/include/*' \
	    '/usr/lib/gcc/*' \
	    --output-file $(COVERAGE_INFO)
	@genhtml $(COVERAGE_INFO) --output-directory $(COVERAGE_REPORT) \
	    $(COVERAGE_REPORT_OPTIONS)
	@echo
	@echo "lcov report at $(COVERAGE_REPORT)/index.html"
	@echo

# Force regeneration of parser and importlib
coverage-report: regen-grammar regen-token regen-importlib
	@ # build with coverage info
	$(MAKE) coverage
	@ # run tests, ignore failures
	$(TESTRUNNER) $(TESTOPTS) || true
	@ # build lcov report
	$(MAKE) coverage-lcov

# Run "Argument Clinic" over all source files
.PHONY=clinic
clinic: check-clean-src $(srcdir)/Modules/_blake2/blake2s_impl.c
	$(PYTHON_FOR_REGEN) $(srcdir)/Tools/clinic/clinic.py --make --srcdir $(srcdir)

# Build the interpreter
$(BUILDPYTHON):	Programs/python.o $(LDLIBRARY) $(PY3LIBRARY)
	$(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS)

platform: $(BUILDPYTHON) pybuilddir.txt
	$(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform

# Create build directory and generate the sysconfig build-time data there.
# pybuilddir.txt contains the name of the build dir and is used for
# sys.path fixup -- see Modules/getpath.c.
# Since this step runs before shared modules are built, try to avoid bootstrap
# problems by creating a dummy pybuilddir.txt just to allow interpreter
# initialization to succeed.  It will be overwritten by generate-posix-vars
# or removed in case of failure.
pybuilddir.txt: $(BUILDPYTHON)
	@echo "none" > ./pybuilddir.txt
	$(RUNSHARED) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars ;\
	if test $$? -ne 0 ; then \
		echo "generate-posix-vars failed" ; \
		rm -f ./pybuilddir.txt ; \
		exit 1 ; \
	fi

# This is shared by the math and cmath modules
Modules/_math.o: Modules/_math.c Modules/_math.h
	$(CC) -c $(CCSHARED) $(PY_CORE_CFLAGS) -o $@ $<

# blake2s is auto-generated from blake2b
$(srcdir)/Modules/_blake2/blake2s_impl.c: $(srcdir)/Modules/_blake2/blake2b_impl.c $(srcdir)/Modules/_blake2/blake2b2s.py
	$(PYTHON_FOR_REGEN) $(srcdir)/Modules/_blake2/blake2b2s.py
	$(PYTHON_FOR_REGEN) $(srcdir)/Tools/clinic/clinic.py -f $@

# Build the shared modules
# Under GNU make, MAKEFLAGS are sorted and normalized; the 's' for
# -s, --silent or --quiet is always the first char.
# Under BSD make, MAKEFLAGS might be " -s -v x=y".
# Ignore macros passed by GNU make, passed after --
sharedmods: $(BUILDPYTHON) pybuilddir.txt Modules/_math.o
	@case "`echo X $$MAKEFLAGS | sed 's/^X //;s/ -- .*//'`" in \
	    *\ -s*|s*) quiet="-q";; \
	    *) quiet="";; \
	esac; \
	echo "$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
		_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
		$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build"; \
	$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
		_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
		$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build

libpython$(LDVERSION).so: $(LIBRARY_OBJS) $(DTRACE_OBJS)
	if test $(INSTSONAME) != $(LDLIBRARY); then \
		$(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM); \
		$(LN) -f $(INSTSONAME) $@; \
	else \
		$(BLDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM); \
	fi

libpython3.so:	libpython$(LDVERSION).so
	$(BLDSHARED) $(NO_AS_NEEDED) -o $@ -Wl,-h$@ $^

libpython$(LDVERSION).dylib: $(LIBRARY_OBJS)
	 $(CC) -dynamiclib -Wl,-single_module $(PY_CORE_LDFLAGS) -undefined dynamic_lookup -Wl,-install_name,$(prefix)/lib/libpython$(LDVERSION).dylib -Wl,-compatibility_version,$(VERSION) -Wl,-current_version,$(VERSION) -o $@ $(LIBRARY_OBJS) $(DTRACE_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \


libpython$(VERSION).sl: $(LIBRARY_OBJS)
	$(LDSHARED) -o $@ $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM)

# Copy up the gdb python hooks into a position where they can be automatically
# loaded by gdb during Lib/test/test_gdb.py
#
# Distributors are likely to want to install this somewhere else e.g. relative
# to the stripped DWARF data for the shared library.
gdbhooks: $(BUILDPYTHON)-gdb.py

SRC_GDB_HOOKS=$(srcdir)/Tools/gdb/libpython.py
$(BUILDPYTHON)-gdb.py: $(SRC_GDB_HOOKS)
	$(INSTALL_DATA) $(SRC_GDB_HOOKS) $(BUILDPYTHON)-gdb.py

# This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary
# minimal framework (not including the Lib directory and such) in the current
# directory.
RESSRCDIR=Mac/Resources/framework
$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \
		$(LIBRARY) \
		$(RESSRCDIR)/Info.plist
	$(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)
	$(CC) -o $(LDLIBRARY) $(PY_CORE_LDFLAGS) -dynamiclib \
		-all_load $(LIBRARY) -Wl,-single_module \
		-install_name $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK) \
		-compatibility_version $(VERSION) \
		-current_version $(VERSION) \
		-framework CoreFoundation $(LIBS);
	$(INSTALL) -d -m $(DIRMODE)  \
		$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/English.lproj
	$(INSTALL_DATA) $(RESSRCDIR)/Info.plist \
		$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/Info.plist
	$(LN) -fsn $(VERSION) $(PYTHONFRAMEWORKDIR)/Versions/Current
	$(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK)
	$(LN) -fsn Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources

# This rule builds the Cygwin Python DLL and import library if configured
# for a shared core library; otherwise, this rule is a noop.
$(DLLLIBRARY) libpython$(LDVERSION).dll.a: $(LIBRARY_OBJS)
	if test -n "$(DLLLIBRARY)"; then \
		$(LDSHARED) -Wl,--out-implib=$@ -o $(DLLLIBRARY) $^ \
			$(LIBS) $(MODLIBS) $(SYSLIBS); \
	else true; \
	fi


oldsharedmods: $(SHAREDMODS)


Makefile Modules/config.c: Makefile.pre \
				$(srcdir)/Modules/config.c.in \
				$(MAKESETUP) \
				$(srcdir)/Modules/Setup \
				Modules/Setup.local
	$(SHELL) $(MAKESETUP) -c $(srcdir)/Modules/config.c.in \
				-s Modules \
				Modules/Setup.local \
				$(srcdir)/Modules/Setup
	@mv config.c Modules
	@echo "The Makefile was updated, you may need to re-run make."


Programs/_testembed: Programs/_testembed.o $(LDLIBRARY) $(PY3LIBRARY)
	$(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS)

############################################################################
# Importlib

Programs/_freeze_importlib.o: Programs/_freeze_importlib.c Makefile

Programs/_freeze_importlib: Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN)
	$(LINKCC) $(PY_CORE_LDFLAGS) -o $@ Programs/_freeze_importlib.o $(LIBRARY_OBJS_OMIT_FROZEN) $(LIBS) $(MODLIBS) $(SYSLIBS)

.PHONY: regen-importlib
regen-importlib: Programs/_freeze_importlib
	# Regenerate Python/importlib_external.h
	# from Lib/importlib/_bootstrap_external.py using _freeze_importlib
	./Programs/_freeze_importlib importlib._bootstrap_external \
	    $(srcdir)/Lib/importlib/_bootstrap_external.py \
	    $(srcdir)/Python/importlib_external.h.new
	$(UPDATE_FILE) $(srcdir)/Python/importlib_external.h $(srcdir)/Python/importlib_external.h.new
	# Regenerate Python/importlib.h from Lib/importlib/_bootstrap.py
	# using _freeze_importlib
	./Programs/_freeze_importlib importlib._bootstrap \
	    $(srcdir)/Lib/importlib/_bootstrap.py \
	    $(srcdir)/Python/importlib.h.new
	$(UPDATE_FILE) $(srcdir)/Python/importlib.h $(srcdir)/Python/importlib.h.new
	# Regenerate Python/importlib_zipimport.h from Lib/zipimport.py
	# using _freeze_importlib
	./Programs/_freeze_importlib zipimport \
	    $(srcdir)/Lib/zipimport.py \
	    $(srcdir)/Python/importlib_zipimport.h.new
	$(UPDATE_FILE) $(srcdir)/Python/importlib_zipimport.h $(srcdir)/Python/importlib_zipimport.h.new

regen-abidump: all
	@$(MKDIR_P) $(srcdir)/Doc/data/
	abidw "libpython$(LDVERSION).so" --no-architecture --out-file $(srcdir)/Doc/data/python$(LDVERSION).abi.new
	@$(UPDATE_FILE) $(srcdir)/Doc/data/python$(LDVERSION).abi $(srcdir)/Doc/data/python$(LDVERSION).abi.new

check-abidump: all
		abidiff "libpython$(LDVERSION).so" $(srcdir)/Doc/data/python$(LDVERSION).abi --drop-private-types \
		--suppressions $(srcdir)/Doc/data/python$(LDVERSION).abi.ignorefile \
		--no-architecture --no-added-syms

############################################################################
# Regenerate all generated files

regen-all: regen-opcode regen-opcode-targets regen-typeslots regen-grammar \
	regen-token regen-keyword regen-symbol regen-ast regen-importlib clinic

############################################################################
# Special rules for object files

Modules/getbuildinfo.o: $(PARSER_OBJS) \
		$(OBJECT_OBJS) \
		$(PYTHON_OBJS) \
		$(MODULE_OBJS) \
		$(MODOBJS) \
		$(DTRACE_OBJS) \
		$(srcdir)/Modules/getbuildinfo.c
	$(CC) -c $(PY_CORE_CFLAGS) \
	      -DGITVERSION="\"`LC_ALL=C $(GITVERSION)`\"" \
	      -DGITTAG="\"`LC_ALL=C $(GITTAG)`\"" \
	      -DGITBRANCH="\"`LC_ALL=C $(GITBRANCH)`\"" \
	      -o $@ $(srcdir)/Modules/getbuildinfo.c

Modules/getpath.o: $(srcdir)/Modules/getpath.c Makefile
	$(CC) -c $(PY_CORE_CFLAGS) -DPYTHONPATH='"$(PYTHONPATH)"' \
		-DPREFIX='"$(prefix)"' \
		-DEXEC_PREFIX='"$(exec_prefix)"' \
		-DVERSION='"$(VERSION)"' \
		-DVPATH='"$(VPATH)"' \
		-o $@ $(srcdir)/Modules/getpath.c

Programs/python.o: $(srcdir)/Programs/python.c
	$(MAINCC) -c $(PY_CORE_CFLAGS) -o $@ $(srcdir)/Programs/python.c

Programs/_testembed.o: $(srcdir)/Programs/_testembed.c
	$(MAINCC) -c $(PY_CORE_CFLAGS) -o $@ $(srcdir)/Programs/_testembed.c

Modules/_sre.o: $(srcdir)/Modules/_sre.c $(srcdir)/Modules/sre.h $(srcdir)/Modules/sre_constants.h $(srcdir)/Modules/sre_lib.h

Modules/posixmodule.o: $(srcdir)/Modules/posixmodule.c $(srcdir)/Modules/posixmodule.h

Modules/grpmodule.o: $(srcdir)/Modules/grpmodule.c $(srcdir)/Modules/posixmodule.h

Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c $(srcdir)/Modules/posixmodule.h

Modules/signalmodule.o: $(srcdir)/Modules/signalmodule.c $(srcdir)/Modules/posixmodule.h

Python/dynload_shlib.o: $(srcdir)/Python/dynload_shlib.c Makefile
	$(CC) -c $(PY_CORE_CFLAGS) \
		-DSOABI='"$(SOABI)"' \
		-o $@ $(srcdir)/Python/dynload_shlib.c

Python/dynload_hpux.o: $(srcdir)/Python/dynload_hpux.c Makefile
	$(CC) -c $(PY_CORE_CFLAGS) \
		-DSHLIB_EXT='"$(EXT_SUFFIX)"' \
		-o $@ $(srcdir)/Python/dynload_hpux.c

Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile $(srcdir)/Include/pydtrace.h
	$(CC) -c $(PY_CORE_CFLAGS) \
		-DABIFLAGS='"$(ABIFLAGS)"' \
		$(MULTIARCH_CPPFLAGS) \
		-o $@ $(srcdir)/Python/sysmodule.c

$(IO_OBJS): $(IO_H)

.PHONY: regen-grammar
regen-grammar: regen-token
	# Regenerate Include/graminit.h and Python/graminit.c
	# from Grammar/Grammar using pgen
	@$(MKDIR_P) Include
	PYTHONPATH=$(srcdir) $(PYTHON_FOR_REGEN) -m Parser.pgen $(srcdir)/Grammar/Grammar \
		$(srcdir)/Grammar/Tokens \
		$(srcdir)/Include/graminit.h.new \
		$(srcdir)/Python/graminit.c.new
	$(UPDATE_FILE) $(srcdir)/Include/graminit.h $(srcdir)/Include/graminit.h.new
	$(UPDATE_FILE) $(srcdir)/Python/graminit.c $(srcdir)/Python/graminit.c.new

.PHONY=regen-ast
regen-ast:
	# Regenerate Include/Python-ast.h using Parser/asdl_c.py -h
	$(MKDIR_P) $(srcdir)/Include
	$(PYTHON_FOR_REGEN) $(srcdir)/Parser/asdl_c.py \
		-h $(srcdir)/Include/Python-ast.h.new \
		$(srcdir)/Parser/Python.asdl
	$(UPDATE_FILE) $(srcdir)/Include/Python-ast.h $(srcdir)/Include/Python-ast.h.new
	# Regenerate Python/Python-ast.c using Parser/asdl_c.py -c
	$(MKDIR_P) $(srcdir)/Python
	$(PYTHON_FOR_REGEN) $(srcdir)/Parser/asdl_c.py \
		-c $(srcdir)/Python/Python-ast.c.new \
		$(srcdir)/Parser/Python.asdl
	$(UPDATE_FILE) $(srcdir)/Python/Python-ast.c $(srcdir)/Python/Python-ast.c.new

.PHONY: regen-opcode
regen-opcode:
	# Regenerate Include/opcode.h from Lib/opcode.py
	# using Tools/scripts/generate_opcode_h.py
	$(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_opcode_h.py \
		$(srcdir)/Lib/opcode.py \
		$(srcdir)/Include/opcode.h.new
	$(UPDATE_FILE) $(srcdir)/Include/opcode.h $(srcdir)/Include/opcode.h.new

.PHONY: regen-token
regen-token:
	# Regenerate Doc/library/token-list.inc from Grammar/Tokens
	# using Tools/scripts/generate_token.py
	$(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_token.py rst \
		$(srcdir)/Grammar/Tokens \
		$(srcdir)/Doc/library/token-list.inc
	# Regenerate Include/token.h from Grammar/Tokens
	# using Tools/scripts/generate_token.py
	$(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_token.py h \
		$(srcdir)/Grammar/Tokens \
		$(srcdir)/Include/token.h
	# Regenerate Parser/token.c from Grammar/Tokens
	# using Tools/scripts/generate_token.py
	$(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_token.py c \
		$(srcdir)/Grammar/Tokens \
		$(srcdir)/Parser/token.c
	# Regenerate Lib/token.py from Grammar/Tokens
	# using Tools/scripts/generate_token.py
	$(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_token.py py \
		$(srcdir)/Grammar/Tokens \
		$(srcdir)/Lib/token.py

.PHONY: regen-keyword
regen-keyword:
	# Regenerate Lib/keyword.py from Grammar/Grammar and Grammar/Tokens
	# using Parser/pgen
	PYTHONPATH=$(srcdir) $(PYTHON_FOR_REGEN) -m Parser.pgen.keywordgen $(srcdir)/Grammar/Grammar \
		$(srcdir)/Grammar/Tokens \
		$(srcdir)/Lib/keyword.py.new
	$(UPDATE_FILE) $(srcdir)/Lib/keyword.py $(srcdir)/Lib/keyword.py.new

.PHONY: regen-symbol
regen-symbol: $(srcdir)/Include/graminit.h
	# Regenerate Lib/symbol.py from Include/graminit.h
	# using Tools/scripts/generate_symbol_py.py
	$(PYTHON_FOR_REGEN) $(srcdir)/Tools/scripts/generate_symbol_py.py \
		$(srcdir)/Include/graminit.h \
		$(srcdir)/Lib/symbol.py

Python/compile.o Python/symtable.o Python/ast_unparse.o Python/ast.o Python/future.o Parser/parsetok.o: $(srcdir)/Include/graminit.h $(srcdir)/Include/Python-ast.h

Python/getplatform.o: $(srcdir)/Python/getplatform.c
		$(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c

Python/importdl.o: $(srcdir)/Python/importdl.c
		$(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c

Objects/unicodectype.o:	$(srcdir)/Objects/unicodectype.c \
				$(srcdir)/Objects/unicodetype_db.h

BYTESTR_DEPS = \
		$(srcdir)/Objects/stringlib/count.h \
		$(srcdir)/Objects/stringlib/ctype.h \
		$(srcdir)/Objects/stringlib/fastsearch.h \
		$(srcdir)/Objects/stringlib/find.h \
		$(srcdir)/Objects/stringlib/join.h \
		$(srcdir)/Objects/stringlib/partition.h \
		$(srcdir)/Objects/stringlib/split.h \
		$(srcdir)/Objects/stringlib/stringdefs.h \
		$(srcdir)/Objects/stringlib/transmogrify.h

UNICODE_DEPS = \
		$(srcdir)/Objects/stringlib/asciilib.h \
		$(srcdir)/Objects/stringlib/codecs.h \
		$(srcdir)/Objects/stringlib/count.h \
		$(srcdir)/Objects/stringlib/fastsearch.h \
		$(srcdir)/Objects/stringlib/find.h \
		$(srcdir)/Objects/stringlib/find_max_char.h \
		$(srcdir)/Objects/stringlib/localeutil.h \
		$(srcdir)/Objects/stringlib/partition.h \
		$(srcdir)/Objects/stringlib/replace.h \
		$(srcdir)/Objects/stringlib/split.h \
		$(srcdir)/Objects/stringlib/ucs1lib.h \
		$(srcdir)/Objects/stringlib/ucs2lib.h \
		$(srcdir)/Objects/stringlib/ucs4lib.h \
		$(srcdir)/Objects/stringlib/undef.h \
		$(srcdir)/Objects/stringlib/unicode_format.h \
		$(srcdir)/Objects/stringlib/unicodedefs.h

Objects/bytes_methods.o: $(srcdir)/Objects/bytes_methods.c $(BYTESTR_DEPS)
Objects/bytesobject.o: $(srcdir)/Objects/bytesobject.c $(BYTESTR_DEPS)
Objects/bytearrayobject.o: $(srcdir)/Objects/bytearrayobject.c $(BYTESTR_DEPS)

Objects/unicodeobject.o: $(srcdir)/Objects/unicodeobject.c $(UNICODE_DEPS)

Objects/odictobject.o: $(srcdir)/Objects/dict-common.h
Objects/dictobject.o: $(srcdir)/Objects/stringlib/eq.h $(srcdir)/Objects/dict-common.h
Objects/setobject.o: $(srcdir)/Objects/stringlib/eq.h

.PHONY: regen-opcode-targets
regen-opcode-targets:
	# Regenerate Python/opcode_targets.h from Lib/opcode.py
	# using Python/makeopcodetargets.py
	$(PYTHON_FOR_REGEN) $(srcdir)/Python/makeopcodetargets.py \
		$(srcdir)/Python/opcode_targets.h.new
	$(UPDATE_FILE) $(srcdir)/Python/opcode_targets.h $(srcdir)/Python/opcode_targets.h.new

Python/ceval.o: $(srcdir)/Python/opcode_targets.h $(srcdir)/Python/ceval_gil.h \
		$(srcdir)/Python/condvar.h

Python/frozen.o: $(srcdir)/Python/importlib.h $(srcdir)/Python/importlib_external.h \
		$(srcdir)/Python/importlib_zipimport.h

# Generate DTrace probe macros, then rename them (PYTHON_ -> PyDTrace_) to
# follow our naming conventions. dtrace(1) uses the output filename to generate
# an include guard, so we can't use a pipeline to transform its output.
Include/pydtrace_probes.h: $(srcdir)/Include/pydtrace.d
	$(MKDIR_P) Include
	$(DTRACE) $(DFLAGS) -o $@ -h -s $<
	: sed in-place edit with POSIX-only tools
	sed 's/PYTHON_/PyDTrace_/' $@ > $@.tmp
	mv $@.tmp $@

Python/ceval.o: $(srcdir)/Include/pydtrace.h
Python/import.o: $(srcdir)/Include/pydtrace.h
Modules/gcmodule.o: $(srcdir)/Include/pydtrace.h

Python/pydtrace.o: $(srcdir)/Include/pydtrace.d $(DTRACE_DEPS)
	$(DTRACE) $(DFLAGS) -o $@ -G -s $< $(DTRACE_DEPS)

Objects/typeobject.o: Objects/typeslots.inc

.PHONY: regen-typeslots
regen-typeslots:
	# Regenerate Objects/typeslots.inc from Include/typeslotsh
	# using Objects/typeslots.py
	$(PYTHON_FOR_REGEN) $(srcdir)/Objects/typeslots.py \
		< $(srcdir)/Include/typeslots.h \
		$(srcdir)/Objects/typeslots.inc.new
	$(UPDATE_FILE) $(srcdir)/Objects/typeslots.inc $(srcdir)/Objects/typeslots.inc.new

############################################################################
# Header files

PYTHON_HEADERS= \
		$(srcdir)/Include/Python.h \
		$(srcdir)/Include/abstract.h \
		$(srcdir)/Include/asdl.h \
		$(srcdir)/Include/ast.h \
		$(srcdir)/Include/bitset.h \
		$(srcdir)/Include/bltinmodule.h \
		$(srcdir)/Include/boolobject.h \
		$(srcdir)/Include/bytearrayobject.h \
		$(srcdir)/Include/bytes_methods.h \
		$(srcdir)/Include/bytesobject.h \
		$(srcdir)/Include/cellobject.h \
		$(srcdir)/Include/ceval.h \
		$(srcdir)/Include/classobject.h \
		$(srcdir)/Include/code.h \
		$(srcdir)/Include/codecs.h \
		$(srcdir)/Include/compile.h \
		$(srcdir)/Include/complexobject.h \
		$(srcdir)/Include/context.h \
		$(srcdir)/Include/descrobject.h \
		$(srcdir)/Include/dictobject.h \
		$(srcdir)/Include/dtoa.h \
		$(srcdir)/Include/dynamic_annotations.h \
		$(srcdir)/Include/enumobject.h \
		$(srcdir)/Include/errcode.h \
		$(srcdir)/Include/eval.h \
		$(srcdir)/Include/fileobject.h \
		$(srcdir)/Include/fileutils.h \
		$(srcdir)/Include/floatobject.h \
		$(srcdir)/Include/frameobject.h \
		$(srcdir)/Include/funcobject.h \
		$(srcdir)/Include/genobject.h \
		$(srcdir)/Include/import.h \
		$(srcdir)/Include/interpreteridobject.h \
		$(srcdir)/Include/intrcheck.h \
		$(srcdir)/Include/iterobject.h \
		$(srcdir)/Include/listobject.h \
		$(srcdir)/Include/longintrepr.h \
		$(srcdir)/Include/longobject.h \
		$(srcdir)/Include/marshal.h \
		$(srcdir)/Include/memoryobject.h \
		$(srcdir)/Include/methodobject.h \
		$(srcdir)/Include/modsupport.h \
		$(srcdir)/Include/moduleobject.h \
		$(srcdir)/Include/namespaceobject.h \
		$(srcdir)/Include/node.h \
		$(srcdir)/Include/object.h \
		$(srcdir)/Include/objimpl.h \
		$(srcdir)/Include/odictobject.h \
		$(srcdir)/Include/opcode.h \
		$(srcdir)/Include/osdefs.h \
		$(srcdir)/Include/osmodule.h \
		$(srcdir)/Include/patchlevel.h \
		$(srcdir)/Include/picklebufobject.h \
		$(srcdir)/Include/pyarena.h \
		$(srcdir)/Include/pycapsule.h \
		$(srcdir)/Include/pyctype.h \
		$(srcdir)/Include/pydebug.h \
		$(srcdir)/Include/pydtrace.h \
		$(srcdir)/Include/pyerrors.h \
		$(srcdir)/Include/pyfpe.h \
		$(srcdir)/Include/pyhash.h \
		$(srcdir)/Include/pylifecycle.h \
		$(srcdir)/Include/pymacconfig.h \
		$(srcdir)/Include/pymacro.h \
		$(srcdir)/Include/pymath.h \
		$(srcdir)/Include/pymem.h \
		$(srcdir)/Include/pyport.h \
		$(srcdir)/Include/pystate.h \
		$(srcdir)/Include/pystrcmp.h \
		$(srcdir)/Include/pystrhex.h \
		$(srcdir)/Include/pystrtod.h \
		$(srcdir)/Include/pythonrun.h \
		$(srcdir)/Include/pythread.h \
		$(srcdir)/Include/pytime.h \
		$(srcdir)/Include/rangeobject.h \
		$(srcdir)/Include/setobject.h \
		$(srcdir)/Include/sliceobject.h \
		$(srcdir)/Include/structmember.h \
		$(srcdir)/Include/structseq.h \
		$(srcdir)/Include/symtable.h \
		$(srcdir)/Include/sysmodule.h \
		$(srcdir)/Include/token.h \
		$(srcdir)/Include/traceback.h \
		$(srcdir)/Include/tracemalloc.h \
		$(srcdir)/Include/tupleobject.h \
		$(srcdir)/Include/ucnhash.h \
		$(srcdir)/Include/unicodeobject.h \
		$(srcdir)/Include/warnings.h \
		$(srcdir)/Include/weakrefobject.h \
		\
		pyconfig.h \
		$(PARSER_HEADERS) \
		$(srcdir)/Include/Python-ast.h \
		\
		$(srcdir)/Include/cpython/abstract.h \
		$(srcdir)/Include/cpython/dictobject.h \
		$(srcdir)/Include/cpython/fileobject.h \
		$(srcdir)/Include/cpython/initconfig.h \
		$(srcdir)/Include/cpython/interpreteridobject.h \
		$(srcdir)/Include/cpython/object.h \
		$(srcdir)/Include/cpython/objimpl.h \
		$(srcdir)/Include/cpython/pyerrors.h \
		$(srcdir)/Include/cpython/pylifecycle.h \
		$(srcdir)/Include/cpython/pymem.h \
		$(srcdir)/Include/cpython/pystate.h \
		$(srcdir)/Include/cpython/sysmodule.h \
		$(srcdir)/Include/cpython/traceback.h \
		$(srcdir)/Include/cpython/tupleobject.h \
		$(srcdir)/Include/cpython/unicodeobject.h \
		\
		$(srcdir)/Include/internal/pycore_accu.h \
		$(srcdir)/Include/internal/pycore_atomic.h \
		$(srcdir)/Include/internal/pycore_ceval.h \
		$(srcdir)/Include/internal/pycore_code.h \
		$(srcdir)/Include/internal/pycore_condvar.h \
		$(srcdir)/Include/internal/pycore_context.h \
		$(srcdir)/Include/internal/pycore_fileutils.h \
		$(srcdir)/Include/internal/pycore_getopt.h \
		$(srcdir)/Include/internal/pycore_gil.h \
		$(srcdir)/Include/internal/pycore_hamt.h \
		$(srcdir)/Include/internal/pycore_initconfig.h \
		$(srcdir)/Include/internal/pycore_object.h \
		$(srcdir)/Include/internal/pycore_pathconfig.h \
		$(srcdir)/Include/internal/pycore_pyerrors.h \
		$(srcdir)/Include/internal/pycore_pyhash.h \
		$(srcdir)/Include/internal/pycore_pylifecycle.h \
		$(srcdir)/Include/internal/pycore_pymem.h \
		$(srcdir)/Include/internal/pycore_pystate.h \
		$(srcdir)/Include/internal/pycore_traceback.h \
		$(srcdir)/Include/internal/pycore_tupleobject.h \
		$(srcdir)/Include/internal/pycore_warnings.h \
		$(DTRACE_HEADERS)

$(LIBRARY_OBJS) $(MODOBJS) Programs/python.o: $(PYTHON_HEADERS)


######################################################################

TESTOPTS=	$(EXTRATESTOPTS)
TESTPYTHON=	$(RUNSHARED) ./$(BUILDPYTHON) $(TESTPYTHONOPTS)
TESTRUNNER=	$(TESTPYTHON) $(srcdir)/Tools/scripts/run_tests.py
TESTTIMEOUT=	1200

.PHONY: test testall testuniversal buildbottest pythoninfo

# Remove "test_python_*" directories of previous failed test jobs.
# Pass TESTOPTS options because it can contain --tempdir option.
cleantest: build_all
	$(TESTRUNNER) $(TESTOPTS) --cleanup

# Run a basic set of regression tests.
# This excludes some tests that are particularly resource-intensive.
test:		build_all platform
		$(TESTRUNNER) $(TESTOPTS)

# Run the full test suite twice - once without .pyc files, and once with.
# In the past, we've had problems where bugs in the marshalling or
# elsewhere caused bytecode read from .pyc files to behave differently
# than bytecode generated directly from a .py source file.  Sometimes
# the bytecode read from a .pyc file had the bug, sometimes the directly
# generated bytecode.  This is sometimes a very shy bug needing a lot of
# sample data.
testall:	build_all platform
		-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
		$(TESTPYTHON) -E $(srcdir)/Lib/compileall.py
		-find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
		-$(TESTRUNNER) -u all $(TESTOPTS)
		$(TESTRUNNER) -u all $(TESTOPTS)

# Run the test suite for both architectures in a Universal build on OSX.
# Must be run on an Intel box.
testuniversal:	build_all platform
		@if [ `arch` != 'i386' ]; then \
			echo "This can only be used on OSX/i386" ;\
			exit 1 ;\
		fi
		$(TESTRUNNER) -u all $(TESTOPTS)
		$(RUNSHARED) /usr/libexec/oah/translate \
			./$(BUILDPYTHON) -E -m test -j 0 -u all $(TESTOPTS)

# Like testall, but with only one pass and without multiple processes.
# Run an optional script to include information about the build environment.
buildbottest:	build_all platform
		-@if which pybuildbot.identify >/dev/null 2>&1; then \
			pybuildbot.identify "CC='$(CC)'" "CXX='$(CXX)'"; \
		fi
		$(TESTRUNNER) -j 1 -u all -W --slowest --fail-env-changed --timeout=$(TESTTIMEOUT) $(TESTOPTS)

pythoninfo: build_all
		$(RUNSHARED) ./$(BUILDPYTHON) -m test.pythoninfo

QUICKTESTOPTS=	$(TESTOPTS) -x test_subprocess test_io test_lib2to3 \
		test_multibytecodec test_urllib2_localnet test_itertools \
		test_multiprocessing_fork test_multiprocessing_spawn \
		test_multiprocessing_forkserver \
		test_mailbox test_socket test_poll \
		test_select test_zipfile test_concurrent_futures
quicktest:	build_all platform
		$(TESTRUNNER) $(QUICKTESTOPTS)

# SSL tests
.PHONY: multisslcompile multissltest
multisslcompile: build_all
	$(RUNSHARED) ./$(BUILDPYTHON) Tools/ssl/multissltests.py --steps=modules

multissltest: build_all
	$(RUNSHARED) ./$(BUILDPYTHON) Tools/ssl/multissltests.py

install:  commoninstall bininstall maninstall 
	if test "x$(ENSUREPIP)" != "xno"  ; then \
		case $(ENSUREPIP) in \
			upgrade) ensurepip="--upgrade" ;; \
			install|*) ensurepip="" ;; \
		esac; \
		$(RUNSHARED) $(PYTHON_FOR_BUILD) -m ensurepip \
			$$ensurepip --root=$(DESTDIR)/ ; \
	fi

altinstall: commoninstall
	if test "x$(ENSUREPIP)" != "xno"  ; then \
		case $(ENSUREPIP) in \
			upgrade) ensurepip="--altinstall --upgrade" ;; \
			install|*) ensurepip="--altinstall" ;; \
		esac; \
		$(RUNSHARED) $(PYTHON_FOR_BUILD) -m ensurepip \
			$$ensurepip --root=$(DESTDIR)/ ; \
	fi

commoninstall:  check-clean-src  \
		altbininstall libinstall inclinstall libainstall \
		sharedinstall oldsharedinstall altmaninstall \
		

# Install shared libraries enabled by Setup
DESTDIRS=	$(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)

oldsharedinstall: $(DESTSHARED) $(SHAREDMODS)
		@for i in X $(SHAREDMODS); do \
		  if test $$i != X; then \
		    echo $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \
		    $(INSTALL_SHARED) $$i $(DESTDIR)$(DESTSHARED)/`basename $$i`; \
		  fi; \
		done

$(DESTSHARED):
		@for i in $(DESTDIRS); \
		do \
			if test ! -d $(DESTDIR)$$i; then \
				echo "Creating directory $$i"; \
				$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
			else    true; \
			fi; \
		done

# Install the interpreter with $(VERSION) affixed
# This goes into $(exec_prefix)
altbininstall: $(BUILDPYTHON) 
	@for i in $(BINDIR) $(LIBDIR); \
	do \
		if test ! -d $(DESTDIR)$$i; then \
			echo "Creating directory $$i"; \
			$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
		else	true; \
		fi; \
	done
	if test "$(PYTHONFRAMEWORKDIR)" = "no-framework" ; then \
		$(INSTALL_PROGRAM) $(BUILDPYTHON) $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \
	else \
		$(INSTALL_PROGRAM) $(STRIPFLAG) Mac/pythonw $(DESTDIR)$(BINDIR)/python$(LDVERSION)$(EXE); \
	fi
	-if test "$(VERSION)" != "$(LDVERSION)"; then \
		if test -f $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE) -o -h $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \
		then rm -f $(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \
		fi; \
		(cd $(DESTDIR)$(BINDIR); $(LN) python$(LDVERSION)$(EXE) python$(VERSION)$(EXE)); \
	fi
	if test -f $(LDLIBRARY) && test "$(PYTHONFRAMEWORKDIR)" = "no-framework" ; then \
		if test -n "$(DLLLIBRARY)" ; then \
			$(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
		else \
			$(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \
			if test $(LDLIBRARY) != $(INSTSONAME); then \
				(cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) $(LDLIBRARY)) \
			fi \
		fi; \
		if test -n "$(PY3LIBRARY)"; then \
			$(INSTALL_SHARED) $(PY3LIBRARY) $(DESTDIR)$(LIBDIR)/$(PY3LIBRARY); \
		fi; \
	else	true; \
	fi
	if test "x$(LIPO_32BIT_FLAGS)" != "x" ; then \
		rm -f $(DESTDIR)$(BINDIR)python$(VERSION)-32$(EXE); \
		lipo $(LIPO_32BIT_FLAGS) \
			-output $(DESTDIR)$(BINDIR)/python$(VERSION)-32$(EXE) \
			$(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \
	fi
	if test "x$(LIPO_INTEL64_FLAGS)" != "x" ; then \
		rm -f $(DESTDIR)$(BINDIR)python$(VERSION)-intel64$(EXE); \
		lipo $(LIPO_INTEL64_FLAGS) \
			-output $(DESTDIR)$(BINDIR)/python$(VERSION)-intel64$(EXE) \
			$(DESTDIR)$(BINDIR)/python$(VERSION)$(EXE); \
	fi

bininstall: altbininstall
	if test ! -d $(DESTDIR)$(LIBPC); then \
		echo "Creating directory $(LIBPC)"; \
		$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(LIBPC); \
	fi
	-if test -f $(DESTDIR)$(BINDIR)/python3$(EXE) -o -h $(DESTDIR)$(BINDIR)/python3$(EXE); \
	then rm -f $(DESTDIR)$(BINDIR)/python3$(EXE); \
	else true; \
	fi
	(cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)$(EXE) python3$(EXE))
	-if test "$(VERSION)" != "$(LDVERSION)"; then \
		rm -f $(DESTDIR)$(BINDIR)/python$(VERSION)-config; \
		(cd $(DESTDIR)$(BINDIR); $(LN) -s python$(LDVERSION)-config python$(VERSION)-config); \
		rm -f $(DESTDIR)$(LIBPC)/python-$(LDVERSION).pc; \
		(cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python-$(LDVERSION).pc); \
		rm -f $(DESTDIR)$(LIBPC)/python-$(LDVERSION)-embed.pc; \
		(cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION)-embed.pc python-$(LDVERSION)-embed.pc); \
	fi
	-rm -f $(DESTDIR)$(BINDIR)/python3-config
	(cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-config python3-config)
	-rm -f $(DESTDIR)$(LIBPC)/python3.pc
	(cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION).pc python3.pc)
	-rm -f $(DESTDIR)$(LIBPC)/python3-embed.pc
	(cd $(DESTDIR)$(LIBPC); $(LN) -s python-$(VERSION)-embed.pc python3-embed.pc)
	-rm -f $(DESTDIR)$(BINDIR)/idle3
	(cd $(DESTDIR)$(BINDIR); $(LN) -s idle$(VERSION) idle3)
	-rm -f $(DESTDIR)$(BINDIR)/pydoc3
	(cd $(DESTDIR)$(BINDIR); $(LN) -s pydoc$(VERSION) pydoc3)
	-rm -f $(DESTDIR)$(BINDIR)/2to3
	(cd $(DESTDIR)$(BINDIR); $(LN) -s 2to3-$(VERSION) 2to3)
	if test "x$(LIPO_32BIT_FLAGS)" != "x" ; then \
		rm -f $(DESTDIR)$(BINDIR)/python3-32$(EXE); \
		(cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-32$(EXE) python3-32$(EXE)) \
	fi
	if test "x$(LIPO_INTEL64_FLAGS)" != "x" ; then \
		rm -f $(DESTDIR)$(BINDIR)/python3-intel64$(EXE); \
		(cd $(DESTDIR)$(BINDIR); $(LN) -s python$(VERSION)-intel64$(EXE) python3-intel64$(EXE)) \
	fi

# Install the versioned manual page
altmaninstall:
	@for i in $(MANDIR) $(MANDIR)/man1; \
	do \
		if test ! -d $(DESTDIR)$$i; then \
			echo "Creating directory $$i"; \
			$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
		else	true; \
		fi; \
	done
	$(INSTALL_DATA) $(srcdir)/Misc/python.man \
		$(DESTDIR)$(MANDIR)/man1/python$(VERSION).1

# Install the unversioned manual page
maninstall:	altmaninstall
	-rm -f $(DESTDIR)$(MANDIR)/man1/python3.1
	(cd $(DESTDIR)$(MANDIR)/man1; $(LN) -s python$(VERSION).1 python3.1)

# Install the library
XMLLIBSUBDIRS=  xml xml/dom xml/etree xml/parsers xml/sax
LIBSUBDIRS=	tkinter tkinter/test tkinter/test/test_tkinter \
		tkinter/test/test_ttk site-packages test \
		test/audiodata \
		test/capath test/data \
		test/cjkencodings test/decimaltestdata \
		test/xmltestdata test/xmltestdata/c14n-20 \
		test/dtracedata \
		test/eintrdata \
		test/imghdrdata \
		test/libregrtest \
		test/subprocessdata test/sndhdrdata test/support \
		test/tracedmodules test/encoded_modules \
		test/test_import \
		test/test_import/data \
		test/test_import/data/circular_imports \
		test/test_import/data/circular_imports/subpkg \
		test/test_import/data/package \
		test/test_import/data/package2 \
		importlib \
		importlib/metadata \
		test/test_importlib \
		test/test_importlib/builtin \
		test/test_importlib/data \
		test/test_importlib/data01 \
		test/test_importlib/data01/subdirectory \
		test/test_importlib/data02 \
		test/test_importlib/data02/one \
		test/test_importlib/data02/two \
		test/test_importlib/data03 \
		test/test_importlib/data03/namespace \
		test/test_importlib/data03/namespace/portion1 \
		test/test_importlib/data03/namespace/portion2 \
		test/test_importlib/extension \
		test/test_importlib/frozen \
		test/test_importlib/import_ \
		test/test_importlib/namespace_pkgs \
		test/test_importlib/namespace_pkgs/both_portions \
		test/test_importlib/namespace_pkgs/both_portions/foo \
		test/test_importlib/namespace_pkgs/module_and_namespace_package \
		test/test_importlib/namespace_pkgs/module_and_namespace_package/a_test \
		test/test_importlib/namespace_pkgs/not_a_namespace_pkg \
		test/test_importlib/namespace_pkgs/not_a_namespace_pkg/foo \
		test/test_importlib/namespace_pkgs/portion1 \
		test/test_importlib/namespace_pkgs/portion1/foo \
		test/test_importlib/namespace_pkgs/portion2 \
		test/test_importlib/namespace_pkgs/portion2/foo \
		test/test_importlib/namespace_pkgs/project1 \
		test/test_importlib/namespace_pkgs/project1/parent \
		test/test_importlib/namespace_pkgs/project1/parent/child \
		test/test_importlib/namespace_pkgs/project2 \
		test/test_importlib/namespace_pkgs/project2/parent \
		test/test_importlib/namespace_pkgs/project2/parent/child \
		test/test_importlib/namespace_pkgs/project3 \
		test/test_importlib/namespace_pkgs/project3/parent \
		test/test_importlib/namespace_pkgs/project3/parent/child \
		test/test_importlib/source \
		test/test_importlib/zipdata01 \
		test/test_importlib/zipdata02 \
		test/ziptestdata \
		asyncio \
		test/test_asyncio \
		collections concurrent concurrent/futures encodings \
		email email/mime test/test_email test/test_email/data \
		ensurepip ensurepip/_bundled \
		html json test/test_json http dbm xmlrpc \
		sqlite3 sqlite3/test \
		logging csv wsgiref urllib \
		lib2to3 lib2to3/fixes lib2to3/pgen2 lib2to3/tests \
		lib2to3/tests/data lib2to3/tests/data/fixers \
		lib2to3/tests/data/fixers/myfixes \
		ctypes ctypes/test ctypes/macholib \
		idlelib idlelib/Icons idlelib/idle_test \
		distutils distutils/command distutils/tests $(XMLLIBSUBDIRS) \
		test/test_tools test/test_warnings test/test_warnings/data \
		turtledemo \
		multiprocessing multiprocessing/dummy \
		unittest unittest/test unittest/test/testmock \
		venv venv/scripts venv/scripts/common venv/scripts/posix \
		curses pydoc_data
libinstall:	build_all $(srcdir)/Modules/xxmodule.c
	@for i in $(SCRIPTDIR) $(LIBDEST); \
	do \
		if test ! -d $(DESTDIR)$$i; then \
			echo "Creating directory $$i"; \
			$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
		else	true; \
		fi; \
	done
	@for d in $(LIBSUBDIRS); \
	do \
		a=$(srcdir)/Lib/$$d; \
		if test ! -d $$a; then continue; else true; fi; \
		b=$(LIBDEST)/$$d; \
		if test ! -d $(DESTDIR)$$b; then \
			echo "Creating directory $$b"; \
			$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$b; \
		else	true; \
		fi; \
	done
	@for i in $(srcdir)/Lib/*.py; \
	do \
		if test -x $$i; then \
			$(INSTALL_SCRIPT) $$i $(DESTDIR)$(LIBDEST); \
			echo $(INSTALL_SCRIPT) $$i $(LIBDEST); \
		else \
			$(INSTALL_DATA) $$i $(DESTDIR)$(LIBDEST); \
			echo $(INSTALL_DATA) $$i $(LIBDEST); \
		fi; \
	done
	@for d in $(LIBSUBDIRS); \
	do \
		a=$(srcdir)/Lib/$$d; \
		if test ! -d $$a; then continue; else true; fi; \
		if test `ls $$a | wc -l` -lt 1; then continue; fi; \
		b=$(LIBDEST)/$$d; \
		for i in $$a/*; \
		do \
			case $$i in \
			*CVS) ;; \
			*.py[co]) ;; \
			*.orig) ;; \
			*~) ;; \
			*) \
				if test -d $$i; then continue; fi; \
				if test -x $$i; then \
				    echo $(INSTALL_SCRIPT) $$i $$b; \
				    $(INSTALL_SCRIPT) $$i $(DESTDIR)$$b; \
				else \
				    echo $(INSTALL_DATA) $$i $$b; \
				    $(INSTALL_DATA) $$i $(DESTDIR)$$b; \
				fi;; \
			esac; \
		done; \
	done
	$(INSTALL_DATA) `cat pybuilddir.txt`/_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH).py \
		$(DESTDIR)$(LIBDEST); \
	$(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
	if test -d $(DESTDIR)$(LIBDEST)/distutils/tests; then \
		$(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
			$(DESTDIR)$(LIBDEST)/distutils/tests ; \
	fi
	-PYTHONPATH=$(DESTDIR)$(LIBDEST)  $(RUNSHARED) \
		$(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
		-j0 -d $(LIBDEST) -f \
		-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
		$(DESTDIR)$(LIBDEST)
	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
		$(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
		-j0 -d $(LIBDEST) -f \
		-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
		$(DESTDIR)$(LIBDEST)
	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
		$(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \
		-j0 -d $(LIBDEST) -f \
		-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
		$(DESTDIR)$(LIBDEST)
	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
		$(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
		-j0 -d $(LIBDEST)/site-packages -f \
		-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
		$(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
		-j0 -d $(LIBDEST)/site-packages -f \
		-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
		$(PYTHON_FOR_BUILD) -Wi -OO $(DESTDIR)$(LIBDEST)/compileall.py \
		-j0 -d $(LIBDEST)/site-packages -f \
		-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
		$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
	-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
		$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/PatternGrammar.txt

# bpo-21536: Misc/python-config.sh is generated in the build directory
# from $(srcdir)Misc/python-config.sh.in.
python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh
	@ # Substitution happens here, as the completely-expanded BINDIR
	@ # is not available in configure
	sed -e "s,@EXENAME@,$(BINDIR)/python$(LDVERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config.py
	@ # Replace makefile compat. variable references with shell script compat. ones; $(VAR) -> ${VAR}
	LC_ALL=C sed -e 's,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g' < Misc/python-config.sh >python-config
	@ # On Darwin, always use the python version of the script, the shell
	@ # version doesn't use the compiler customizations that are provided
	@ # in python (_osx_support.py).
	@if test `uname -s` = Darwin; then \
		cp python-config.py python-config; \
	fi


# Install the include files
INCLDIRSTOMAKE=$(INCLUDEDIR) $(CONFINCLUDEDIR) $(INCLUDEPY) $(CONFINCLUDEPY)
inclinstall:
	@for i in $(INCLDIRSTOMAKE); \
	do \
		if test ! -d $(DESTDIR)$$i; then \
			echo "Creating directory $$i"; \
			$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
		else	true; \
		fi; \
	done
	@if test ! -d $(DESTDIR)$(INCLUDEPY)/cpython; then \
		echo "Creating directory $(DESTDIR)$(INCLUDEPY)/cpython"; \
		$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(INCLUDEPY)/cpython; \
	else	true; \
	fi
	@if test ! -d $(DESTDIR)$(INCLUDEPY)/internal; then \
		echo "Creating directory $(DESTDIR)$(INCLUDEPY)/internal"; \
		$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(INCLUDEPY)/internal; \
	else	true; \
	fi
	@for i in $(srcdir)/Include/*.h; \
	do \
		echo $(INSTALL_DATA) $$i $(INCLUDEPY); \
		$(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY); \
	done
	@for i in $(srcdir)/Include/cpython/*.h; \
	do \
		echo $(INSTALL_DATA) $$i $(INCLUDEPY)/cpython; \
		$(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY)/cpython; \
	done
	@for i in $(srcdir)/Include/internal/*.h; \
	do \
		echo $(INSTALL_DATA) $$i $(INCLUDEPY)/internal; \
		$(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY)/internal; \
	done
	$(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h

# Install the library and miscellaneous stuff needed for extending/embedding
# This goes into $(exec_prefix)
LIBPL=		$(prefix)/lib64/python3.8/config-$(VERSION)$(ABIFLAGS)-x86_64-linux-gnu

# pkgconfig directory
LIBPC=		$(LIBDIR)/pkgconfig

libainstall:	build_all python-config
	@for i in $(LIBDIR) $(LIBPL) $(LIBPC); \
	do \
		if test ! -d $(DESTDIR)$$i; then \
			echo "Creating directory $$i"; \
			$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
		else	true; \
		fi; \
	done
	$(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
	$(INSTALL_DATA) Programs/python.o $(DESTDIR)$(LIBPL)/python.o
	$(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
	$(INSTALL_DATA) Makefile $(DESTDIR)$(LIBPL)/Makefile
	$(INSTALL_DATA) $(srcdir)/Modules/Setup $(DESTDIR)$(LIBPL)/Setup
	$(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local
	$(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc
	$(INSTALL_DATA) Misc/python-embed.pc $(DESTDIR)$(LIBPC)/python-$(VERSION)-embed.pc
	$(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
	$(INSTALL_SCRIPT) $(srcdir)/install-sh $(DESTDIR)$(LIBPL)/install-sh
	$(INSTALL_SCRIPT) python-config.py $(DESTDIR)$(LIBPL)/python-config.py
	$(INSTALL_SCRIPT) python-config $(DESTDIR)$(BINDIR)/python$(LDVERSION)-config
	@if [ -s Modules/python.exp -a \
		"`echo $(MACHDEP) | sed 's/^\(...\).*/\1/'`" = "aix" ]; then \
		echo; echo "Installing support files for building shared extension modules on AIX:"; \
		$(INSTALL_DATA) Modules/python.exp		\
				$(DESTDIR)$(LIBPL)/python.exp;		\
		echo; echo "$(LIBPL)/python.exp";		\
		$(INSTALL_SCRIPT) $(srcdir)/Modules/makexp_aix	\
				$(DESTDIR)$(LIBPL)/makexp_aix;		\
		echo "$(LIBPL)/makexp_aix";			\
		$(INSTALL_SCRIPT) Modules/ld_so_aix	\
				$(DESTDIR)$(LIBPL)/ld_so_aix;		\
		echo "$(LIBPL)/ld_so_aix";			\
		echo; echo "See Misc/AIX-NOTES for details.";	\
	else true; \
	fi

# Install the dynamically loadable modules
# This goes into $(exec_prefix)
sharedinstall: sharedmods
	$(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
	   	--prefix=$(prefix) \
		--install-scripts=$(BINDIR) \
		--install-platlib=$(DESTSHARED) \
		--root=$(DESTDIR)/
	-rm $(DESTDIR)$(DESTSHARED)/_sysconfigdata_$(ABIFLAGS)_$(MACHDEP)_$(MULTIARCH).py
	-rm -r $(DESTDIR)$(DESTSHARED)/__pycache__

# Here are a couple of targets for MacOSX again, to install a full
# framework-based Python. frameworkinstall installs everything, the
# subtargets install specific parts. Much of the actual work is offloaded to
# the Makefile in Mac
#
#
# This target is here for backward compatibility, previous versions of Python
# hadn't integrated framework installation in the normal install process.
frameworkinstall: install

# On install, we re-make the framework
# structure in the install location, /Library/Frameworks/ or the argument to
# --enable-framework. If --enable-framework has been specified then we have
# automatically set prefix to the location deep down in the framework, so we
# only have to cater for the structural bits of the framework.

frameworkinstallframework: frameworkinstallstructure install frameworkinstallmaclib

frameworkinstallstructure:	$(LDLIBRARY)
	@if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \
		echo Not configured with --enable-framework; \
		exit 1; \
	else true; \
	fi
	@for i in $(prefix)/Resources/English.lproj $(prefix)/lib; do\
		if test ! -d $(DESTDIR)$$i; then \
			echo "Creating directory $(DESTDIR)$$i"; \
			$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
		else	true; \
		fi; \
	done
	$(LN) -fsn include/python$(LDVERSION) $(DESTDIR)$(prefix)/Headers
	sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
	$(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
	$(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
	$(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
	$(LN) -fsn Versions/Current/Resources $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Resources
	$(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY)

# This installs Mac/Lib into the framework
# Install a number of symlinks to keep software that expects a normal unix
# install (which includes python-config) happy.
frameworkinstallmaclib:
	$(LN) -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(LIBPL)/libpython$(LDVERSION).a"
	$(LN) -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(LIBPL)/libpython$(LDVERSION).dylib"
	$(LN) -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(LIBPL)/libpython$(VERSION).a"
	$(LN) -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(LIBPL)/libpython$(VERSION).dylib"
	$(LN) -fs "../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/libpython$(LDVERSION).dylib"
	$(LN) -fs "../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/libpython$(VERSION).dylib"

# This installs the IDE, the Launcher and other apps into /Applications
frameworkinstallapps:
	cd Mac && $(MAKE) installapps DESTDIR="$(DESTDIR)"

# Build the bootstrap executable that will spawn the interpreter inside
# an app bundle within the framework.  This allows the interpreter to
# run OS X GUI APIs.
frameworkpythonw:
	cd Mac && $(MAKE) pythonw

# This installs the python* and other bin symlinks in $prefix/bin or in
# a bin directory relative to the framework root
frameworkinstallunixtools:
	cd Mac && $(MAKE) installunixtools DESTDIR="$(DESTDIR)"

frameworkaltinstallunixtools:
	cd Mac && $(MAKE) altinstallunixtools DESTDIR="$(DESTDIR)"

# This installs the Tools into the applications directory.
# It is not part of a normal frameworkinstall
frameworkinstallextras:
	cd Mac && $(MAKE) installextras DESTDIR="$(DESTDIR)"

# Build the toplevel Makefile
Makefile.pre: $(srcdir)/Makefile.pre.in config.status
	CONFIG_FILES=Makefile.pre CONFIG_HEADERS= $(SHELL) config.status
	$(MAKE) -f Makefile.pre Makefile

# Run the configure script.
config.status:	$(srcdir)/configure
	$(SHELL) $(srcdir)/configure $(CONFIG_ARGS)

.PRECIOUS: config.status $(BUILDPYTHON) Makefile Makefile.pre

# Some make's put the object file in the current directory
.c.o:
	$(CC) -c $(PY_CORE_CFLAGS) -o $@ $<

# bpo-30104: dtoa.c uses union to cast double to unsigned long[2]. clang 4.0
# with -O2 or higher and strict aliasing miscompiles the ratio() function
# causing rounding issues. Compile dtoa.c using -fno-strict-aliasing on clang.
# https://bugs.llvm.org//show_bug.cgi?id=31928
Python/dtoa.o: Python/dtoa.c
	$(CC) -c $(PY_CORE_CFLAGS) $(CFLAGS_ALIASING) -o $@ $<

# Run reindent on the library
reindent:
	./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib

# Rerun configure with the same options as it was run last time,
# provided the config.status script exists
recheck:
	$(SHELL) config.status --recheck
	$(SHELL) config.status

# Regenerate configure and pyconfig.h.in
.PHONY: autoconf
autoconf:
	# Regenerate the configure script from configure.ac using autoconf
	(cd $(srcdir); autoconf -Wall)
	# Regenerate pyconfig.h.in from configure.ac using autoheader
	(cd $(srcdir); autoheader -Wall)

# Create a tags file for vi
tags::
	ctags -w $(srcdir)/Include/*.h $(srcdir)/Include/cpython/*.h $(srcdir)/Include/internal/*.h
	for i in $(SRCDIRS); do ctags -f tags -w -a $(srcdir)/$$i/*.[ch]; done
	ctags -f tags -w -a $(srcdir)/Modules/_ctypes/*.[ch]
	find $(srcdir)/Lib -type f -name "*.py" -not -name "test_*.py" -not -path "*/test/*" -not -path "*/tests/*" -not -path "*/*_test/*" | ctags -f tags -w -a -L -
	LC_ALL=C sort -o tags tags

# Create a tags file for GNU Emacs
TAGS::
	cd $(srcdir); \
	etags Include/*.h Include/cpython/*.h Include/internal/*.h; \
	for i in $(SRCDIRS); do etags -a $$i/*.[ch]; done
	etags -a $(srcdir)/Modules/_ctypes/*.[ch]
	find $(srcdir)/Lib -type f -name "*.py" -not -name "test_*.py" -not -path "*/test/*" -not -path "*/tests/*" -not -path "*/*_test/*" | etags - -a

# Sanitation targets -- clean leaves libraries, executables and tags
# files, which clobber removes as well
pycremoval:
	-find $(srcdir) -depth -name '__pycache__' -exec rm -rf {} ';'
	-find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'

rmtestturds:
	-rm -f *BAD *GOOD *SKIPPED
	-rm -rf OUT
	-rm -f *.TXT
	-rm -f *.txt
	-rm -f gb-18030-2000.xml

docclean:
	-rm -rf Doc/build
	-rm -rf Doc/tools/sphinx Doc/tools/pygments Doc/tools/docutils

clean: pycremoval
	find . -name '*.[oa]' -exec rm -f {} ';'
	find . -name '*.s[ol]' -exec rm -f {} ';'
	find . -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';'
	find build -name 'fficonfig.h' -exec rm -f {} ';' || true
	find build -name '*.py' -exec rm -f {} ';' || true
	find build -name '*.py[co]' -exec rm -f {} ';' || true
	-rm -f pybuilddir.txt
	-rm -f Lib/lib2to3/*Grammar*.pickle
	-rm -f Programs/_testembed Programs/_freeze_importlib
	-find build -type f -a ! -name '*.gc??' -exec rm -f {} ';'
	-rm -f Include/pydtrace_probes.h
	-rm -f profile-gen-stamp

profile-removal:
	find . -name '*.gc??' -exec rm -f {} ';'
	find . -name '*.profclang?' -exec rm -f {} ';'
	find . -name '*.dyn' -exec rm -f {} ';'
	rm -f $(COVERAGE_INFO)
	rm -rf $(COVERAGE_REPORT)
	rm -f profile-run-stamp

clobber: clean profile-removal
	-rm -f $(BUILDPYTHON) $(LIBRARY) $(LDLIBRARY) $(DLLLIBRARY) \
		tags TAGS \
		config.cache config.log pyconfig.h Modules/config.c
	-rm -rf build platform
	-rm -rf $(PYTHONFRAMEWORKDIR)
	-rm -f python-config.py python-config
	-rm -f profile-gen-stamp profile-clean-stamp

# Make things extra clean, before making a distribution:
# remove all generated files, even Makefile[.pre]
# Keep configure and Python-ast.[ch], it's possible they can't be generated
distclean: clobber
	for file in $(srcdir)/Lib/test/data/* ; do \
	    if test "$$file" != "$(srcdir)/Lib/test/data/README"; then rm "$$file"; fi; \
	done
	-rm -f core Makefile Makefile.pre config.status Modules/Setup.local \
		Modules/ld_so_aix Modules/python.exp Misc/python.pc \
		Misc/python-embed.pc Misc/python-config.sh
	-rm -f python*-gdb.py
	# Issue #28258: set LC_ALL to avoid issues with Estonian locale.
	# Expansion is performed here by shell (spawned by make) itself before
	# arguments are passed to find. So LC_ALL=C must be set as a separate
	# command.
	LC_ALL=C; find $(srcdir)/[a-zA-Z]* '(' -name '*.fdc' -o -name '*~' \
				     -o -name '[@,#]*' -o -name '*.old' \
				     -o -name '*.orig' -o -name '*.rej' \
				     -o -name '*.bak' ')' \
				     -exec rm -f {} ';'

# Check that all symbols exported by libpython start with "Py" or "_Py"
smelly: build_all
	$(RUNSHARED) ./$(BUILDPYTHON) Tools/scripts/smelly.py

# Find files with funny names
funny:
	find $(SUBDIRS) $(SUBDIRSTOO) \
		-type d \
		-o -name '*.[chs]' \
		-o -name '*.py' \
		-o -name '*.pyw' \
		-o -name '*.dat' \
		-o -name '*.el' \
		-o -name '*.fd' \
		-o -name '*.in' \
		-o -name '*.gif' \
		-o -name '*.txt' \
		-o -name '*.xml' \
		-o -name '*.xbm' \
		-o -name '*.xpm' \
		-o -name '*.uue' \
		-o -name '*.decTest' \
		-o -name '*.tmCommand' \
		-o -name '*.tmSnippet' \
		-o -name 'Setup' \
		-o -name 'Setup.*' \
		-o -name README \
		-o -name NEWS \
		-o -name HISTORY \
		-o -name Makefile \
		-o -name ChangeLog \
		-o -name .hgignore \
		-o -name MANIFEST \
		-o -print

# Perform some verification checks on any modified files.
patchcheck: build_all
	$(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py

# Dependencies

Python/thread.o:  $(srcdir)/Python/thread_nt.h $(srcdir)/Python/thread_pthread.h $(srcdir)/Python/condvar.h

# Declare targets that aren't real files
.PHONY: all build_all sharedmods check-clean-src oldsharedmods test quicktest
.PHONY: install altinstall oldsharedinstall bininstall altbininstall
.PHONY: maninstall libinstall inclinstall libainstall sharedinstall
.PHONY: frameworkinstall frameworkinstallframework frameworkinstallstructure
.PHONY: frameworkinstallmaclib frameworkinstallapps frameworkinstallunixtools
.PHONY: frameworkaltinstallunixtools recheck clean clobber distclean
.PHONY: smelly funny patchcheck touch altmaninstall commoninstall
.PHONY: gdbhooks

# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
# Local Variables:
# mode: makefile
# End:

# Rules appended by makesetup

Modules/posixmodule.o: $(srcdir)/Modules/posixmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS)  -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -c $(srcdir)/Modules/posixmodule.c -o Modules/posixmodule.o
Modules/posix$(EXT_SUFFIX):  Modules/posixmodule.o; $(BLDSHARED)  Modules/posixmodule.o   -o Modules/posix$(EXT_SUFFIX)
Modules/errnomodule.o: $(srcdir)/Modules/errnomodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS)  -c $(srcdir)/Modules/errnomodule.c -o Modules/errnomodule.o
Modules/errno$(EXT_SUFFIX):  Modules/errnomodule.o; $(BLDSHARED)  Modules/errnomodule.o   -o Modules/errno$(EXT_SUFFIX)
Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS)  -c $(srcdir)/Modules/pwdmodule.c -o Modules/pwdmodule.o
Modules/pwd$(EXT_SUFFIX):  Modules/pwdmodule.o; $(BLDSHARED)  Modules/pwdmodule.o   -o Modules/pwd$(EXT_SUFFIX)
Modules/_sre.o: $(srcdir)/Modules/_sre.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS)  -c $(srcdir)/Modules/_sre.c -o Modules/_sre.o
Modules/_sre$(EXT_SUFFIX):  Modules/_sre.o; $(BLDSHARED)  Modules/_sre.o   -o Modules/_sre$(EXT_SUFFIX)
Modules/_codecsmodule.o: $(srcdir)/Modules/_codecsmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS)  -c $(srcdir)/Modules/_codecsmodule.c -o Modules/_codecsmodule.o
Modules/_codecs$(EXT_SUFFIX):  Modules/_codecsmodule.o; $(BLDSHARED)  Modules/_codecsmodule.o   -o Modules/_codecs$(EXT_SUFFIX)
Modules/_weakref.o: $(srcdir)/Modules/_weakref.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS)  -c $(srcdir)/Modules/_weakref.c -o Modules/_weakref.o
Modules/_weakref$(EXT_SUFFIX):  Modules/_weakref.o; $(BLDSHARED)  Modules/_weakref.o   -o Modules/_weakref$(EXT_SUFFIX)
Modules/_functoolsmodule.o: $(srcdir)/Modules/_functoolsmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS)  -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -c $(srcdir)/Modules/_functoolsmodule.c -o Modules/_functoolsmodule.o
Modules/_functools$(EXT_SUFFIX):  Modules/_functoolsmodule.o; $(BLDSHARED)  Modules/_functoolsmodule.o   -o Modules/_functools$(EXT_SUFFIX)
Modules/_operator.o: $(srcdir)/Modules/_operator.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS)  -c $(srcdir)/Modules/_operator.c -o Modules/_operator.o
Modules/_operator$(EXT_SUFFIX):  Modules/_operator.o; $(BLDSHARED)  Modules/_operator.o   -o Modules/_operator$(EXT_SUFFIX)
Modules/_collectionsmodule.o: $(srcdir)/Modules/_collectionsmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS)  -c $(srcdir)/Modules/_collectionsmodule.c -o Modules/_collectionsmodule.o
Modules/_collections$(EXT_SUFFIX):  Modules/_collectionsmodule.o; $(BLDSHARED)  Modules/_collectionsmodule.o   -o Modules/_collections$(EXT_SUFFIX)
Modules/_abc.o: $(srcdir)/Modules/_abc.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS)  -c $(srcdir)/Modules/_abc.c -o Modules/_abc.o
Modules/_abc$(EXT_SUFFIX):  Modules/_abc.o; $(BLDSHARED)  Modules/_abc.o   -o Modules/_abc$(EXT_SUFFIX)
Modules/itertoolsmodule.o: $(srcdir)/Modules/itertoolsmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS)  -c $(srcdir)/Modules/itertoolsmodule.c -o Modules/itertoolsmodule.o
Modules/itertools$(EXT_SUFFIX):  Modules/itertoolsmodule.o; $(BLDSHARED)  Modules/itertoolsmodule.o   -o Modules/itertools$(EXT_SUFFIX)
Modules/atexitmodule.o: $(srcdir)/Modules/atexitmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS)  -c $(srcdir)/Modules/atexitmodule.c -o Modules/atexitmodule.o
Modules/atexit$(EXT_SUFFIX):  Modules/atexitmodule.o; $(BLDSHARED)  Modules/atexitmodule.o   -o Modules/atexit$(EXT_SUFFIX)
Modules/signalmodule.o: $(srcdir)/Modules/signalmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS)  -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -c $(srcdir)/Modules/signalmodule.c -o Modules/signalmodule.o
Modules/_signal$(EXT_SUFFIX):  Modules/signalmodule.o; $(BLDSHARED)  Modules/signalmodule.o   -o Modules/_signal$(EXT_SUFFIX)
Modules/_stat.o: $(srcdir)/Modules/_stat.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS)  -c $(srcdir)/Modules/_stat.c -o Modules/_stat.o
Modules/_stat$(EXT_SUFFIX):  Modules/_stat.o; $(BLDSHARED)  Modules/_stat.o   -o Modules/_stat$(EXT_SUFFIX)
Modules/timemodule.o: $(srcdir)/Modules/timemodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS)  -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -c $(srcdir)/Modules/timemodule.c -o Modules/timemodule.o
Modules/time$(EXT_SUFFIX):  Modules/timemodule.o; $(BLDSHARED)  Modules/timemodule.o   -o Modules/time$(EXT_SUFFIX)
Modules/_threadmodule.o: $(srcdir)/Modules/_threadmodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS)  -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -c $(srcdir)/Modules/_threadmodule.c -o Modules/_threadmodule.o
Modules/_thread$(EXT_SUFFIX):  Modules/_threadmodule.o; $(BLDSHARED)  Modules/_threadmodule.o   -o Modules/_thread$(EXT_SUFFIX)
Modules/_localemodule.o: $(srcdir)/Modules/_localemodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS)  -DPy_BUILD_CORE_BUILTIN -c $(srcdir)/Modules/_localemodule.c -o Modules/_localemodule.o
Modules/_locale$(EXT_SUFFIX):  Modules/_localemodule.o; $(BLDSHARED)  Modules/_localemodule.o   -o Modules/_locale$(EXT_SUFFIX)
Modules/_iomodule.o: $(srcdir)/Modules/_io/_iomodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS)  -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io -c $(srcdir)/Modules/_io/_iomodule.c -o Modules/_iomodule.o
Modules/iobase.o: $(srcdir)/Modules/_io/iobase.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS)  -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io -c $(srcdir)/Modules/_io/iobase.c -o Modules/iobase.o
Modules/fileio.o: $(srcdir)/Modules/_io/fileio.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS)  -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io -c $(srcdir)/Modules/_io/fileio.c -o Modules/fileio.o
Modules/bytesio.o: $(srcdir)/Modules/_io/bytesio.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS)  -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io -c $(srcdir)/Modules/_io/bytesio.c -o Modules/bytesio.o
Modules/bufferedio.o: $(srcdir)/Modules/_io/bufferedio.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS)  -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io -c $(srcdir)/Modules/_io/bufferedio.c -o Modules/bufferedio.o
Modules/textio.o: $(srcdir)/Modules/_io/textio.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS)  -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io -c $(srcdir)/Modules/_io/textio.c -o Modules/textio.o
Modules/stringio.o: $(srcdir)/Modules/_io/stringio.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS)  -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal -I$(srcdir)/Modules/_io -c $(srcdir)/Modules/_io/stringio.c -o Modules/stringio.o
Modules/_io$(EXT_SUFFIX):  Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o; $(BLDSHARED)  Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o   -o Modules/_io$(EXT_SUFFIX)
Modules/faulthandler.o: $(srcdir)/Modules/faulthandler.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS)  -c $(srcdir)/Modules/faulthandler.c -o Modules/faulthandler.o
Modules/faulthandler$(EXT_SUFFIX):  Modules/faulthandler.o; $(BLDSHARED)  Modules/faulthandler.o   -o Modules/faulthandler$(EXT_SUFFIX)
Modules/_tracemalloc.o: $(srcdir)/Modules/_tracemalloc.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS)  -c $(srcdir)/Modules/_tracemalloc.c -o Modules/_tracemalloc.o
Modules/hashtable.o: $(srcdir)/Modules/hashtable.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS)  -c $(srcdir)/Modules/hashtable.c -o Modules/hashtable.o
Modules/_tracemalloc$(EXT_SUFFIX):  Modules/_tracemalloc.o Modules/hashtable.o; $(BLDSHARED)  Modules/_tracemalloc.o Modules/hashtable.o   -o Modules/_tracemalloc$(EXT_SUFFIX)
Modules/symtablemodule.o: $(srcdir)/Modules/symtablemodule.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS)  -c $(srcdir)/Modules/symtablemodule.c -o Modules/symtablemodule.o
Modules/_symtable$(EXT_SUFFIX):  Modules/symtablemodule.o; $(BLDSHARED)  Modules/symtablemodule.o   -o Modules/_symtable$(EXT_SUFFIX)
Modules/xxsubtype.o: $(srcdir)/Modules/xxsubtype.c; $(CC) $(PY_BUILTIN_MODULE_CFLAGS)  -c $(srcdir)/Modules/xxsubtype.c -o Modules/xxsubtype.o
Modules/xxsubtype$(EXT_SUFFIX):  Modules/xxsubtype.o; $(BLDSHARED)  Modules/xxsubtype.o   -o Modules/xxsubtype$(EXT_SUFFIX)
cgi.py000075500000102216151153537470005700 0ustar00#! /usr/bin/python3.8

# NOTE: the above "/usr/local/bin/python" is NOT a mistake.  It is
# intentionally NOT "/usr/bin/env python".  On many systems
# (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI
# scripts, and /usr/local/bin is the default directory where Python is
# installed, so /usr/bin/env would be unable to find python.  Granted,
# binary installations by Linux vendors often install Python in
# /usr/bin.  So let those vendors patch cgi.py to match their choice
# of installation.

"""Support module for CGI (Common Gateway Interface) scripts.

This module defines a number of utilities for use by CGI scripts
written in Python.
"""

# History
# -------
#
# Michael McLay started this module.  Steve Majewski changed the
# interface to SvFormContentDict and FormContentDict.  The multipart
# parsing was inspired by code submitted by Andreas Paepcke.  Guido van
# Rossum rewrote, reformatted and documented the module and is currently
# responsible for its maintenance.
#

__version__ = "2.6"


# Imports
# =======

from io import StringIO, BytesIO, TextIOWrapper
from collections.abc import Mapping
import sys
import os
import urllib.parse
from email.parser import FeedParser
from email.message import Message
import html
import locale
import tempfile

__all__ = ["MiniFieldStorage", "FieldStorage", "parse", "parse_multipart",
           "parse_header", "test", "print_exception", "print_environ",
           "print_form", "print_directory", "print_arguments",
           "print_environ_usage"]

# Logging support
# ===============

logfile = ""            # Filename to log to, if not empty
logfp = None            # File object to log to, if not None

def initlog(*allargs):
    """Write a log message, if there is a log file.

    Even though this function is called initlog(), you should always
    use log(); log is a variable that is set either to initlog
    (initially), to dolog (once the log file has been opened), or to
    nolog (when logging is disabled).

    The first argument is a format string; the remaining arguments (if
    any) are arguments to the % operator, so e.g.
        log("%s: %s", "a", "b")
    will write "a: b" to the log file, followed by a newline.

    If the global logfp is not None, it should be a file object to
    which log data is written.

    If the global logfp is None, the global logfile may be a string
    giving a filename to open, in append mode.  This file should be
    world writable!!!  If the file can't be opened, logging is
    silently disabled (since there is no safe place where we could
    send an error message).

    """
    global log, logfile, logfp
    if logfile and not logfp:
        try:
            logfp = open(logfile, "a")
        except OSError:
            pass
    if not logfp:
        log = nolog
    else:
        log = dolog
    log(*allargs)

def dolog(fmt, *args):
    """Write a log message to the log file.  See initlog() for docs."""
    logfp.write(fmt%args + "\n")

def nolog(*allargs):
    """Dummy function, assigned to log when logging is disabled."""
    pass

def closelog():
    """Close the log file."""
    global log, logfile, logfp
    logfile = ''
    if logfp:
        logfp.close()
        logfp = None
    log = initlog

log = initlog           # The current logging function


# Parsing functions
# =================

# Maximum input we will accept when REQUEST_METHOD is POST
# 0 ==> unlimited input
maxlen = 0

def parse(fp=None, environ=os.environ, keep_blank_values=0,
          strict_parsing=0, separator=None):
    """Parse a query in the environment or from a file (default stdin)

        Arguments, all optional:

        fp              : file pointer; default: sys.stdin.buffer

        environ         : environment dictionary; default: os.environ

        keep_blank_values: flag indicating whether blank values in
            percent-encoded forms should be treated as blank strings.
            A true value indicates that blanks should be retained as
            blank strings.  The default false value indicates that
            blank values are to be ignored and treated as if they were
            not included.

        strict_parsing: flag indicating what to do with parsing errors.
            If false (the default), errors are silently ignored.
            If true, errors raise a ValueError exception.

        separator: str. The symbol to use for separating the query arguments.
            Defaults to &.
    """
    if fp is None:
        fp = sys.stdin

    # field keys and values (except for files) are returned as strings
    # an encoding is required to decode the bytes read from self.fp
    if hasattr(fp,'encoding'):
        encoding = fp.encoding
    else:
        encoding = 'latin-1'

    # fp.read() must return bytes
    if isinstance(fp, TextIOWrapper):
        fp = fp.buffer

    if not 'REQUEST_METHOD' in environ:
        environ['REQUEST_METHOD'] = 'GET'       # For testing stand-alone
    if environ['REQUEST_METHOD'] == 'POST':
        ctype, pdict = parse_header(environ['CONTENT_TYPE'])
        if ctype == 'multipart/form-data':
            return parse_multipart(fp, pdict, separator=separator)
        elif ctype == 'application/x-www-form-urlencoded':
            clength = int(environ['CONTENT_LENGTH'])
            if maxlen and clength > maxlen:
                raise ValueError('Maximum content length exceeded')
            qs = fp.read(clength).decode(encoding)
        else:
            qs = ''                     # Unknown content-type
        if 'QUERY_STRING' in environ:
            if qs: qs = qs + '&'
            qs = qs + environ['QUERY_STRING']
        elif sys.argv[1:]:
            if qs: qs = qs + '&'
            qs = qs + sys.argv[1]
        environ['QUERY_STRING'] = qs    # XXX Shouldn't, really
    elif 'QUERY_STRING' in environ:
        qs = environ['QUERY_STRING']
    else:
        if sys.argv[1:]:
            qs = sys.argv[1]
        else:
            qs = ""
        environ['QUERY_STRING'] = qs    # XXX Shouldn't, really
    return urllib.parse.parse_qs(qs, keep_blank_values, strict_parsing,
                                 encoding=encoding, separator=separator)


def parse_multipart(fp, pdict, encoding="utf-8", errors="replace", separator='&'):
    """Parse multipart input.

    Arguments:
    fp   : input file
    pdict: dictionary containing other parameters of content-type header
    encoding, errors: request encoding and error handler, passed to
        FieldStorage

    Returns a dictionary just like parse_qs(): keys are the field names, each
    value is a list of values for that field. For non-file fields, the value
    is a list of strings.
    """
    # RFC 2026, Section 5.1 : The "multipart" boundary delimiters are always
    # represented as 7bit US-ASCII.
    boundary = pdict['boundary'].decode('ascii')
    ctype = "multipart/form-data; boundary={}".format(boundary)
    headers = Message()
    headers.set_type(ctype)
    try:
        headers['Content-Length'] = pdict['CONTENT-LENGTH']
    except KeyError:
        pass
    fs = FieldStorage(fp, headers=headers, encoding=encoding, errors=errors,
        environ={'REQUEST_METHOD': 'POST'}, separator=separator)
    return {k: fs.getlist(k) for k in fs}

def _parseparam(s):
    while s[:1] == ';':
        s = s[1:]
        end = s.find(';')
        while end > 0 and (s.count('"', 0, end) - s.count('\\"', 0, end)) % 2:
            end = s.find(';', end + 1)
        if end < 0:
            end = len(s)
        f = s[:end]
        yield f.strip()
        s = s[end:]

def parse_header(line):
    """Parse a Content-type like header.

    Return the main content-type and a dictionary of options.

    """
    parts = _parseparam(';' + line)
    key = parts.__next__()
    pdict = {}
    for p in parts:
        i = p.find('=')
        if i >= 0:
            name = p[:i].strip().lower()
            value = p[i+1:].strip()
            if len(value) >= 2 and value[0] == value[-1] == '"':
                value = value[1:-1]
                value = value.replace('\\\\', '\\').replace('\\"', '"')
            pdict[name] = value
    return key, pdict


# Classes for field storage
# =========================

class MiniFieldStorage:

    """Like FieldStorage, for use when no file uploads are possible."""

    # Dummy attributes
    filename = None
    list = None
    type = None
    file = None
    type_options = {}
    disposition = None
    disposition_options = {}
    headers = {}

    def __init__(self, name, value):
        """Constructor from field name and value."""
        self.name = name
        self.value = value
        # self.file = StringIO(value)

    def __repr__(self):
        """Return printable representation."""
        return "MiniFieldStorage(%r, %r)" % (self.name, self.value)


class FieldStorage:

    """Store a sequence of fields, reading multipart/form-data.

    This class provides naming, typing, files stored on disk, and
    more.  At the top level, it is accessible like a dictionary, whose
    keys are the field names.  (Note: None can occur as a field name.)
    The items are either a Python list (if there's multiple values) or
    another FieldStorage or MiniFieldStorage object.  If it's a single
    object, it has the following attributes:

    name: the field name, if specified; otherwise None

    filename: the filename, if specified; otherwise None; this is the
        client side filename, *not* the file name on which it is
        stored (that's a temporary file you don't deal with)

    value: the value as a *string*; for file uploads, this
        transparently reads the file every time you request the value
        and returns *bytes*

    file: the file(-like) object from which you can read the data *as
        bytes* ; None if the data is stored a simple string

    type: the content-type, or None if not specified

    type_options: dictionary of options specified on the content-type
        line

    disposition: content-disposition, or None if not specified

    disposition_options: dictionary of corresponding options

    headers: a dictionary(-like) object (sometimes email.message.Message or a
        subclass thereof) containing *all* headers

    The class is subclassable, mostly for the purpose of overriding
    the make_file() method, which is called internally to come up with
    a file open for reading and writing.  This makes it possible to
    override the default choice of storing all files in a temporary
    directory and unlinking them as soon as they have been opened.

    """
    def __init__(self, fp=None, headers=None, outerboundary=b'',
                 environ=os.environ, keep_blank_values=0, strict_parsing=0,
                 limit=None, encoding='utf-8', errors='replace',
                 max_num_fields=None, separator=None):
        """Constructor.  Read multipart/* until last part.

        Arguments, all optional:

        fp              : file pointer; default: sys.stdin.buffer
            (not used when the request method is GET)
            Can be :
            1. a TextIOWrapper object
            2. an object whose read() and readline() methods return bytes

        headers         : header dictionary-like object; default:
            taken from environ as per CGI spec

        outerboundary   : terminating multipart boundary
            (for internal use only)

        environ         : environment dictionary; default: os.environ

        keep_blank_values: flag indicating whether blank values in
            percent-encoded forms should be treated as blank strings.
            A true value indicates that blanks should be retained as
            blank strings.  The default false value indicates that
            blank values are to be ignored and treated as if they were
            not included.

        strict_parsing: flag indicating what to do with parsing errors.
            If false (the default), errors are silently ignored.
            If true, errors raise a ValueError exception.

        limit : used internally to read parts of multipart/form-data forms,
            to exit from the reading loop when reached. It is the difference
            between the form content-length and the number of bytes already
            read

        encoding, errors : the encoding and error handler used to decode the
            binary stream to strings. Must be the same as the charset defined
            for the page sending the form (content-type : meta http-equiv or
            header)

        max_num_fields: int. If set, then __init__ throws a ValueError
            if there are more than n fields read by parse_qsl().

        """
        method = 'GET'
        self.keep_blank_values = keep_blank_values
        self.strict_parsing = strict_parsing
        self.max_num_fields = max_num_fields
        self.separator = separator
        if 'REQUEST_METHOD' in environ:
            method = environ['REQUEST_METHOD'].upper()
        self.qs_on_post = None
        if method == 'GET' or method == 'HEAD':
            if 'QUERY_STRING' in environ:
                qs = environ['QUERY_STRING']
            elif sys.argv[1:]:
                qs = sys.argv[1]
            else:
                qs = ""
            qs = qs.encode(locale.getpreferredencoding(), 'surrogateescape')
            fp = BytesIO(qs)
            if headers is None:
                headers = {'content-type':
                           "application/x-www-form-urlencoded"}
        if headers is None:
            headers = {}
            if method == 'POST':
                # Set default content-type for POST to what's traditional
                headers['content-type'] = "application/x-www-form-urlencoded"
            if 'CONTENT_TYPE' in environ:
                headers['content-type'] = environ['CONTENT_TYPE']
            if 'QUERY_STRING' in environ:
                self.qs_on_post = environ['QUERY_STRING']
            if 'CONTENT_LENGTH' in environ:
                headers['content-length'] = environ['CONTENT_LENGTH']
        else:
            if not (isinstance(headers, (Mapping, Message))):
                raise TypeError("headers must be mapping or an instance of "
                                "email.message.Message")
        self.headers = headers
        if fp is None:
            self.fp = sys.stdin.buffer
        # self.fp.read() must return bytes
        elif isinstance(fp, TextIOWrapper):
            self.fp = fp.buffer
        else:
            if not (hasattr(fp, 'read') and hasattr(fp, 'readline')):
                raise TypeError("fp must be file pointer")
            self.fp = fp

        self.encoding = encoding
        self.errors = errors

        if not isinstance(outerboundary, bytes):
            raise TypeError('outerboundary must be bytes, not %s'
                            % type(outerboundary).__name__)
        self.outerboundary = outerboundary

        self.bytes_read = 0
        self.limit = limit

        # Process content-disposition header
        cdisp, pdict = "", {}
        if 'content-disposition' in self.headers:
            cdisp, pdict = parse_header(self.headers['content-disposition'])
        self.disposition = cdisp
        self.disposition_options = pdict
        self.name = None
        if 'name' in pdict:
            self.name = pdict['name']
        self.filename = None
        if 'filename' in pdict:
            self.filename = pdict['filename']
        self._binary_file = self.filename is not None

        # Process content-type header
        #
        # Honor any existing content-type header.  But if there is no
        # content-type header, use some sensible defaults.  Assume
        # outerboundary is "" at the outer level, but something non-false
        # inside a multi-part.  The default for an inner part is text/plain,
        # but for an outer part it should be urlencoded.  This should catch
        # bogus clients which erroneously forget to include a content-type
        # header.
        #
        # See below for what we do if there does exist a content-type header,
        # but it happens to be something we don't understand.
        if 'content-type' in self.headers:
            ctype, pdict = parse_header(self.headers['content-type'])
        elif self.outerboundary or method != 'POST':
            ctype, pdict = "text/plain", {}
        else:
            ctype, pdict = 'application/x-www-form-urlencoded', {}
        self.type = ctype
        self.type_options = pdict
        if 'boundary' in pdict:
            self.innerboundary = pdict['boundary'].encode(self.encoding,
                                                          self.errors)
        else:
            self.innerboundary = b""

        clen = -1
        if 'content-length' in self.headers:
            try:
                clen = int(self.headers['content-length'])
            except ValueError:
                pass
            if maxlen and clen > maxlen:
                raise ValueError('Maximum content length exceeded')
        self.length = clen
        if self.limit is None and clen >= 0:
            self.limit = clen

        self.list = self.file = None
        self.done = 0
        if ctype == 'application/x-www-form-urlencoded':
            self.read_urlencoded()
        elif ctype[:10] == 'multipart/':
            self.read_multi(environ, keep_blank_values, strict_parsing)
        else:
            self.read_single()

    def __del__(self):
        try:
            self.file.close()
        except AttributeError:
            pass

    def __enter__(self):
        return self

    def __exit__(self, *args):
        self.file.close()

    def __repr__(self):
        """Return a printable representation."""
        return "FieldStorage(%r, %r, %r)" % (
                self.name, self.filename, self.value)

    def __iter__(self):
        return iter(self.keys())

    def __getattr__(self, name):
        if name != 'value':
            raise AttributeError(name)
        if self.file:
            self.file.seek(0)
            value = self.file.read()
            self.file.seek(0)
        elif self.list is not None:
            value = self.list
        else:
            value = None
        return value

    def __getitem__(self, key):
        """Dictionary style indexing."""
        if self.list is None:
            raise TypeError("not indexable")
        found = []
        for item in self.list:
            if item.name == key: found.append(item)
        if not found:
            raise KeyError(key)
        if len(found) == 1:
            return found[0]
        else:
            return found

    def getvalue(self, key, default=None):
        """Dictionary style get() method, including 'value' lookup."""
        if key in self:
            value = self[key]
            if isinstance(value, list):
                return [x.value for x in value]
            else:
                return value.value
        else:
            return default

    def getfirst(self, key, default=None):
        """ Return the first value received."""
        if key in self:
            value = self[key]
            if isinstance(value, list):
                return value[0].value
            else:
                return value.value
        else:
            return default

    def getlist(self, key):
        """ Return list of received values."""
        if key in self:
            value = self[key]
            if isinstance(value, list):
                return [x.value for x in value]
            else:
                return [value.value]
        else:
            return []

    def keys(self):
        """Dictionary style keys() method."""
        if self.list is None:
            raise TypeError("not indexable")
        return list(set(item.name for item in self.list))

    def __contains__(self, key):
        """Dictionary style __contains__ method."""
        if self.list is None:
            raise TypeError("not indexable")
        return any(item.name == key for item in self.list)

    def __len__(self):
        """Dictionary style len(x) support."""
        return len(self.keys())

    def __bool__(self):
        if self.list is None:
            raise TypeError("Cannot be converted to bool.")
        return bool(self.list)

    def read_urlencoded(self):
        """Internal: read data in query string format."""
        qs = self.fp.read(self.length)
        if not isinstance(qs, bytes):
            raise ValueError("%s should return bytes, got %s" \
                             % (self.fp, type(qs).__name__))
        qs = qs.decode(self.encoding, self.errors)
        if self.qs_on_post:
            qs += '&' + self.qs_on_post
        query = urllib.parse.parse_qsl(
            qs, self.keep_blank_values, self.strict_parsing,
            encoding=self.encoding, errors=self.errors,
            max_num_fields=self.max_num_fields, separator=self.separator)
        self.list = [MiniFieldStorage(key, value) for key, value in query]
        self.skip_lines()

    FieldStorageClass = None

    def read_multi(self, environ, keep_blank_values, strict_parsing):
        """Internal: read a part that is itself multipart."""
        ib = self.innerboundary
        if not valid_boundary(ib):
            raise ValueError('Invalid boundary in multipart form: %r' % (ib,))
        self.list = []
        if self.qs_on_post:
            query = urllib.parse.parse_qsl(
                self.qs_on_post, self.keep_blank_values, self.strict_parsing,
                encoding=self.encoding, errors=self.errors,
                max_num_fields=self.max_num_fields, separator=self.separator)
            self.list.extend(MiniFieldStorage(key, value) for key, value in query)

        klass = self.FieldStorageClass or self.__class__
        first_line = self.fp.readline() # bytes
        if not isinstance(first_line, bytes):
            raise ValueError("%s should return bytes, got %s" \
                             % (self.fp, type(first_line).__name__))
        self.bytes_read += len(first_line)

        # Ensure that we consume the file until we've hit our inner boundary
        while (first_line.strip() != (b"--" + self.innerboundary) and
                first_line):
            first_line = self.fp.readline()
            self.bytes_read += len(first_line)

        # Propagate max_num_fields into the sub class appropriately
        max_num_fields = self.max_num_fields
        if max_num_fields is not None:
            max_num_fields -= len(self.list)

        while True:
            parser = FeedParser()
            hdr_text = b""
            while True:
                data = self.fp.readline()
                hdr_text += data
                if not data.strip():
                    break
            if not hdr_text:
                break
            # parser takes strings, not bytes
            self.bytes_read += len(hdr_text)
            parser.feed(hdr_text.decode(self.encoding, self.errors))
            headers = parser.close()

            # Some clients add Content-Length for part headers, ignore them
            if 'content-length' in headers:
                del headers['content-length']

            limit = None if self.limit is None \
                else self.limit - self.bytes_read
            part = klass(self.fp, headers, ib, environ, keep_blank_values,
                         strict_parsing, limit,
                         self.encoding, self.errors, max_num_fields, self.separator)

            if max_num_fields is not None:
                max_num_fields -= 1
                if part.list:
                    max_num_fields -= len(part.list)
                if max_num_fields < 0:
                    raise ValueError('Max number of fields exceeded')

            self.bytes_read += part.bytes_read
            self.list.append(part)
            if part.done or self.bytes_read >= self.length > 0:
                break
        self.skip_lines()

    def read_single(self):
        """Internal: read an atomic part."""
        if self.length >= 0:
            self.read_binary()
            self.skip_lines()
        else:
            self.read_lines()
        self.file.seek(0)

    bufsize = 8*1024            # I/O buffering size for copy to file

    def read_binary(self):
        """Internal: read binary data."""
        self.file = self.make_file()
        todo = self.length
        if todo >= 0:
            while todo > 0:
                data = self.fp.read(min(todo, self.bufsize)) # bytes
                if not isinstance(data, bytes):
                    raise ValueError("%s should return bytes, got %s"
                                     % (self.fp, type(data).__name__))
                self.bytes_read += len(data)
                if not data:
                    self.done = -1
                    break
                self.file.write(data)
                todo = todo - len(data)

    def read_lines(self):
        """Internal: read lines until EOF or outerboundary."""
        if self._binary_file:
            self.file = self.__file = BytesIO() # store data as bytes for files
        else:
            self.file = self.__file = StringIO() # as strings for other fields
        if self.outerboundary:
            self.read_lines_to_outerboundary()
        else:
            self.read_lines_to_eof()

    def __write(self, line):
        """line is always bytes, not string"""
        if self.__file is not None:
            if self.__file.tell() + len(line) > 1000:
                self.file = self.make_file()
                data = self.__file.getvalue()
                self.file.write(data)
                self.__file = None
        if self._binary_file:
            # keep bytes
            self.file.write(line)
        else:
            # decode to string
            self.file.write(line.decode(self.encoding, self.errors))

    def read_lines_to_eof(self):
        """Internal: read lines until EOF."""
        while 1:
            line = self.fp.readline(1<<16) # bytes
            self.bytes_read += len(line)
            if not line:
                self.done = -1
                break
            self.__write(line)

    def read_lines_to_outerboundary(self):
        """Internal: read lines until outerboundary.
        Data is read as bytes: boundaries and line ends must be converted
        to bytes for comparisons.
        """
        next_boundary = b"--" + self.outerboundary
        last_boundary = next_boundary + b"--"
        delim = b""
        last_line_lfend = True
        _read = 0
        while 1:

            if self.limit is not None and 0 <= self.limit <= _read:
                break
            line = self.fp.readline(1<<16) # bytes
            self.bytes_read += len(line)
            _read += len(line)
            if not line:
                self.done = -1
                break
            if delim == b"\r":
                line = delim + line
                delim = b""
            if line.startswith(b"--") and last_line_lfend:
                strippedline = line.rstrip()
                if strippedline == next_boundary:
                    break
                if strippedline == last_boundary:
                    self.done = 1
                    break
            odelim = delim
            if line.endswith(b"\r\n"):
                delim = b"\r\n"
                line = line[:-2]
                last_line_lfend = True
            elif line.endswith(b"\n"):
                delim = b"\n"
                line = line[:-1]
                last_line_lfend = True
            elif line.endswith(b"\r"):
                # We may interrupt \r\n sequences if they span the 2**16
                # byte boundary
                delim = b"\r"
                line = line[:-1]
                last_line_lfend = False
            else:
                delim = b""
                last_line_lfend = False
            self.__write(odelim + line)

    def skip_lines(self):
        """Internal: skip lines until outer boundary if defined."""
        if not self.outerboundary or self.done:
            return
        next_boundary = b"--" + self.outerboundary
        last_boundary = next_boundary + b"--"
        last_line_lfend = True
        while True:
            line = self.fp.readline(1<<16)
            self.bytes_read += len(line)
            if not line:
                self.done = -1
                break
            if line.endswith(b"--") and last_line_lfend:
                strippedline = line.strip()
                if strippedline == next_boundary:
                    break
                if strippedline == last_boundary:
                    self.done = 1
                    break
            last_line_lfend = line.endswith(b'\n')

    def make_file(self):
        """Overridable: return a readable & writable file.

        The file will be used as follows:
        - data is written to it
        - seek(0)
        - data is read from it

        The file is opened in binary mode for files, in text mode
        for other fields

        This version opens a temporary file for reading and writing,
        and immediately deletes (unlinks) it.  The trick (on Unix!) is
        that the file can still be used, but it can't be opened by
        another process, and it will automatically be deleted when it
        is closed or when the current process terminates.

        If you want a more permanent file, you derive a class which
        overrides this method.  If you want a visible temporary file
        that is nevertheless automatically deleted when the script
        terminates, try defining a __del__ method in a derived class
        which unlinks the temporary files you have created.

        """
        if self._binary_file:
            return tempfile.TemporaryFile("wb+")
        else:
            return tempfile.TemporaryFile("w+",
                encoding=self.encoding, newline = '\n')


# Test/debug code
# ===============

def test(environ=os.environ):
    """Robust test CGI script, usable as main program.

    Write minimal HTTP headers and dump all information provided to
    the script in HTML form.

    """
    print("Content-type: text/html")
    print()
    sys.stderr = sys.stdout
    try:
        form = FieldStorage()   # Replace with other classes to test those
        print_directory()
        print_arguments()
        print_form(form)
        print_environ(environ)
        print_environ_usage()
        def f():
            exec("testing print_exception() -- <I>italics?</I>")
        def g(f=f):
            f()
        print("<H3>What follows is a test, not an actual exception:</H3>")
        g()
    except:
        print_exception()

    print("<H1>Second try with a small maxlen...</H1>")

    global maxlen
    maxlen = 50
    try:
        form = FieldStorage()   # Replace with other classes to test those
        print_directory()
        print_arguments()
        print_form(form)
        print_environ(environ)
    except:
        print_exception()

def print_exception(type=None, value=None, tb=None, limit=None):
    if type is None:
        type, value, tb = sys.exc_info()
    import traceback
    print()
    print("<H3>Traceback (most recent call last):</H3>")
    list = traceback.format_tb(tb, limit) + \
           traceback.format_exception_only(type, value)
    print("<PRE>%s<B>%s</B></PRE>" % (
        html.escape("".join(list[:-1])),
        html.escape(list[-1]),
        ))
    del tb

def print_environ(environ=os.environ):
    """Dump the shell environment as HTML."""
    keys = sorted(environ.keys())
    print()
    print("<H3>Shell Environment:</H3>")
    print("<DL>")
    for key in keys:
        print("<DT>", html.escape(key), "<DD>", html.escape(environ[key]))
    print("</DL>")
    print()

def print_form(form):
    """Dump the contents of a form as HTML."""
    keys = sorted(form.keys())
    print()
    print("<H3>Form Contents:</H3>")
    if not keys:
        print("<P>No form fields.")
    print("<DL>")
    for key in keys:
        print("<DT>" + html.escape(key) + ":", end=' ')
        value = form[key]
        print("<i>" + html.escape(repr(type(value))) + "</i>")
        print("<DD>" + html.escape(repr(value)))
    print("</DL>")
    print()

def print_directory():
    """Dump the current directory as HTML."""
    print()
    print("<H3>Current Working Directory:</H3>")
    try:
        pwd = os.getcwd()
    except OSError as msg:
        print("OSError:", html.escape(str(msg)))
    else:
        print(html.escape(pwd))
    print()

def print_arguments():
    print()
    print("<H3>Command Line Arguments:</H3>")
    print()
    print(sys.argv)
    print()

def print_environ_usage():
    """Dump a list of environment variables used by CGI as HTML."""
    print("""
<H3>These environment variables could have been set:</H3>
<UL>
<LI>AUTH_TYPE
<LI>CONTENT_LENGTH
<LI>CONTENT_TYPE
<LI>DATE_GMT
<LI>DATE_LOCAL
<LI>DOCUMENT_NAME
<LI>DOCUMENT_ROOT
<LI>DOCUMENT_URI
<LI>GATEWAY_INTERFACE
<LI>LAST_MODIFIED
<LI>PATH
<LI>PATH_INFO
<LI>PATH_TRANSLATED
<LI>QUERY_STRING
<LI>REMOTE_ADDR
<LI>REMOTE_HOST
<LI>REMOTE_IDENT
<LI>REMOTE_USER
<LI>REQUEST_METHOD
<LI>SCRIPT_NAME
<LI>SERVER_NAME
<LI>SERVER_PORT
<LI>SERVER_PROTOCOL
<LI>SERVER_ROOT
<LI>SERVER_SOFTWARE
</UL>
In addition, HTTP headers sent by the server may be passed in the
environment as well.  Here are some common variable names:
<UL>
<LI>HTTP_ACCEPT
<LI>HTTP_CONNECTION
<LI>HTTP_HOST
<LI>HTTP_PRAGMA
<LI>HTTP_REFERER
<LI>HTTP_USER_AGENT
</UL>
""")


# Utilities
# =========

def valid_boundary(s):
    import re
    if isinstance(s, bytes):
        _vb_pattern = b"^[ -~]{0,200}[!-~]$"
    else:
        _vb_pattern = "^[ -~]{0,200}[!-~]$"
    return re.match(_vb_pattern, s)

# Invoke mainline
# ===============

# Call test() when this file is run as a script (not imported as a module)
if __name__ == '__main__':
    test()
trace.py000075500000072256151153537470006246 0ustar00#! /usr/bin/python3.8

# portions copyright 2001, Autonomous Zones Industries, Inc., all rights...
# err...  reserved and offered to the public under the terms of the
# Python 2.2 license.
# Author: Zooko O'Whielacronx
# http://zooko.com/
# mailto:zooko@zooko.com
#
# Copyright 2000, Mojam Media, Inc., all rights reserved.
# Author: Skip Montanaro
#
# Copyright 1999, Bioreason, Inc., all rights reserved.
# Author: Andrew Dalke
#
# Copyright 1995-1997, Automatrix, Inc., all rights reserved.
# Author: Skip Montanaro
#
# Copyright 1991-1995, Stichting Mathematisch Centrum, all rights reserved.
#
#
# Permission to use, copy, modify, and distribute this Python software and
# its associated documentation for any purpose without fee is hereby
# granted, provided that the above copyright notice appears in all copies,
# and that both that copyright notice and this permission notice appear in
# supporting documentation, and that the name of neither Automatrix,
# Bioreason or Mojam Media be used in advertising or publicity pertaining to
# distribution of the software without specific, written prior permission.
#
"""program/module to trace Python program or function execution

Sample use, command line:
  trace.py -c -f counts --ignore-dir '$prefix' spam.py eggs
  trace.py -t --ignore-dir '$prefix' spam.py eggs
  trace.py --trackcalls spam.py eggs

Sample use, programmatically
  import sys

  # create a Trace object, telling it what to ignore, and whether to
  # do tracing or line-counting or both.
  tracer = trace.Trace(ignoredirs=[sys.base_prefix, sys.base_exec_prefix,],
                       trace=0, count=1)
  # run the new command using the given tracer
  tracer.run('main()')
  # make a report, placing output in /tmp
  r = tracer.results()
  r.write_results(show_missing=True, coverdir="/tmp")
"""
__all__ = ['Trace', 'CoverageResults']

import io
import linecache
import os
import sys
import sysconfig
import token
import tokenize
import inspect
import gc
import dis
import pickle
from time import monotonic as _time

import threading

PRAGMA_NOCOVER = "#pragma NO COVER"

class _Ignore:
    def __init__(self, modules=None, dirs=None):
        self._mods = set() if not modules else set(modules)
        self._dirs = [] if not dirs else [os.path.normpath(d)
                                          for d in dirs]
        self._ignore = { '<string>': 1 }

    def names(self, filename, modulename):
        if modulename in self._ignore:
            return self._ignore[modulename]

        # haven't seen this one before, so see if the module name is
        # on the ignore list.
        if modulename in self._mods:  # Identical names, so ignore
            self._ignore[modulename] = 1
            return 1

        # check if the module is a proper submodule of something on
        # the ignore list
        for mod in self._mods:
            # Need to take some care since ignoring
            # "cmp" mustn't mean ignoring "cmpcache" but ignoring
            # "Spam" must also mean ignoring "Spam.Eggs".
            if modulename.startswith(mod + '.'):
                self._ignore[modulename] = 1
                return 1

        # Now check that filename isn't in one of the directories
        if filename is None:
            # must be a built-in, so we must ignore
            self._ignore[modulename] = 1
            return 1

        # Ignore a file when it contains one of the ignorable paths
        for d in self._dirs:
            # The '+ os.sep' is to ensure that d is a parent directory,
            # as compared to cases like:
            #  d = "/usr/local"
            #  filename = "/usr/local.py"
            # or
            #  d = "/usr/local.py"
            #  filename = "/usr/local.py"
            if filename.startswith(d + os.sep):
                self._ignore[modulename] = 1
                return 1

        # Tried the different ways, so we don't ignore this module
        self._ignore[modulename] = 0
        return 0

def _modname(path):
    """Return a plausible module name for the patch."""

    base = os.path.basename(path)
    filename, ext = os.path.splitext(base)
    return filename

def _fullmodname(path):
    """Return a plausible module name for the path."""

    # If the file 'path' is part of a package, then the filename isn't
    # enough to uniquely identify it.  Try to do the right thing by
    # looking in sys.path for the longest matching prefix.  We'll
    # assume that the rest is the package name.

    comparepath = os.path.normcase(path)
    longest = ""
    for dir in sys.path:
        dir = os.path.normcase(dir)
        if comparepath.startswith(dir) and comparepath[len(dir)] == os.sep:
            if len(dir) > len(longest):
                longest = dir

    if longest:
        base = path[len(longest) + 1:]
    else:
        base = path
    # the drive letter is never part of the module name
    drive, base = os.path.splitdrive(base)
    base = base.replace(os.sep, ".")
    if os.altsep:
        base = base.replace(os.altsep, ".")
    filename, ext = os.path.splitext(base)
    return filename.lstrip(".")

class CoverageResults:
    def __init__(self, counts=None, calledfuncs=None, infile=None,
                 callers=None, outfile=None):
        self.counts = counts
        if self.counts is None:
            self.counts = {}
        self.counter = self.counts.copy() # map (filename, lineno) to count
        self.calledfuncs = calledfuncs
        if self.calledfuncs is None:
            self.calledfuncs = {}
        self.calledfuncs = self.calledfuncs.copy()
        self.callers = callers
        if self.callers is None:
            self.callers = {}
        self.callers = self.callers.copy()
        self.infile = infile
        self.outfile = outfile
        if self.infile:
            # Try to merge existing counts file.
            try:
                with open(self.infile, 'rb') as f:
                    counts, calledfuncs, callers = pickle.load(f)
                self.update(self.__class__(counts, calledfuncs, callers))
            except (OSError, EOFError, ValueError) as err:
                print(("Skipping counts file %r: %s"
                                      % (self.infile, err)), file=sys.stderr)

    def is_ignored_filename(self, filename):
        """Return True if the filename does not refer to a file
        we want to have reported.
        """
        return filename.startswith('<') and filename.endswith('>')

    def update(self, other):
        """Merge in the data from another CoverageResults"""
        counts = self.counts
        calledfuncs = self.calledfuncs
        callers = self.callers
        other_counts = other.counts
        other_calledfuncs = other.calledfuncs
        other_callers = other.callers

        for key in other_counts:
            counts[key] = counts.get(key, 0) + other_counts[key]

        for key in other_calledfuncs:
            calledfuncs[key] = 1

        for key in other_callers:
            callers[key] = 1

    def write_results(self, show_missing=True, summary=False, coverdir=None):
        """
        Write the coverage results.

        :param show_missing: Show lines that had no hits.
        :param summary: Include coverage summary per module.
        :param coverdir: If None, the results of each module are placed in its
                         directory, otherwise it is included in the directory
                         specified.
        """
        if self.calledfuncs:
            print()
            print("functions called:")
            calls = self.calledfuncs
            for filename, modulename, funcname in sorted(calls):
                print(("filename: %s, modulename: %s, funcname: %s"
                       % (filename, modulename, funcname)))

        if self.callers:
            print()
            print("calling relationships:")
            lastfile = lastcfile = ""
            for ((pfile, pmod, pfunc), (cfile, cmod, cfunc)) \
                    in sorted(self.callers):
                if pfile != lastfile:
                    print()
                    print("***", pfile, "***")
                    lastfile = pfile
                    lastcfile = ""
                if cfile != pfile and lastcfile != cfile:
                    print("  -->", cfile)
                    lastcfile = cfile
                print("    %s.%s -> %s.%s" % (pmod, pfunc, cmod, cfunc))

        # turn the counts data ("(filename, lineno) = count") into something
        # accessible on a per-file basis
        per_file = {}
        for filename, lineno in self.counts:
            lines_hit = per_file[filename] = per_file.get(filename, {})
            lines_hit[lineno] = self.counts[(filename, lineno)]

        # accumulate summary info, if needed
        sums = {}

        for filename, count in per_file.items():
            if self.is_ignored_filename(filename):
                continue

            if filename.endswith(".pyc"):
                filename = filename[:-1]

            if coverdir is None:
                dir = os.path.dirname(os.path.abspath(filename))
                modulename = _modname(filename)
            else:
                dir = coverdir
                if not os.path.exists(dir):
                    os.makedirs(dir)
                modulename = _fullmodname(filename)

            # If desired, get a list of the line numbers which represent
            # executable content (returned as a dict for better lookup speed)
            if show_missing:
                lnotab = _find_executable_linenos(filename)
            else:
                lnotab = {}
            source = linecache.getlines(filename)
            coverpath = os.path.join(dir, modulename + ".cover")
            with open(filename, 'rb') as fp:
                encoding, _ = tokenize.detect_encoding(fp.readline)
            n_hits, n_lines = self.write_results_file(coverpath, source,
                                                      lnotab, count, encoding)
            if summary and n_lines:
                percent = int(100 * n_hits / n_lines)
                sums[modulename] = n_lines, percent, modulename, filename


        if summary and sums:
            print("lines   cov%   module   (path)")
            for m in sorted(sums):
                n_lines, percent, modulename, filename = sums[m]
                print("%5d   %3d%%   %s   (%s)" % sums[m])

        if self.outfile:
            # try and store counts and module info into self.outfile
            try:
                with open(self.outfile, 'wb') as f:
                    pickle.dump((self.counts, self.calledfuncs, self.callers),
                                f, 1)
            except OSError as err:
                print("Can't save counts files because %s" % err, file=sys.stderr)

    def write_results_file(self, path, lines, lnotab, lines_hit, encoding=None):
        """Return a coverage results file in path."""
        # ``lnotab`` is a dict of executable lines, or a line number "table"

        try:
            outfile = open(path, "w", encoding=encoding)
        except OSError as err:
            print(("trace: Could not open %r for writing: %s "
                                  "- skipping" % (path, err)), file=sys.stderr)
            return 0, 0

        n_lines = 0
        n_hits = 0
        with outfile:
            for lineno, line in enumerate(lines, 1):
                # do the blank/comment match to try to mark more lines
                # (help the reader find stuff that hasn't been covered)
                if lineno in lines_hit:
                    outfile.write("%5d: " % lines_hit[lineno])
                    n_hits += 1
                    n_lines += 1
                elif lineno in lnotab and not PRAGMA_NOCOVER in line:
                    # Highlight never-executed lines, unless the line contains
                    # #pragma: NO COVER
                    outfile.write(">>>>>> ")
                    n_lines += 1
                else:
                    outfile.write("       ")
                outfile.write(line.expandtabs(8))

        return n_hits, n_lines

def _find_lines_from_code(code, strs):
    """Return dict where keys are lines in the line number table."""
    linenos = {}

    for _, lineno in dis.findlinestarts(code):
        if lineno not in strs:
            linenos[lineno] = 1

    return linenos

def _find_lines(code, strs):
    """Return lineno dict for all code objects reachable from code."""
    # get all of the lineno information from the code of this scope level
    linenos = _find_lines_from_code(code, strs)

    # and check the constants for references to other code objects
    for c in code.co_consts:
        if inspect.iscode(c):
            # find another code object, so recurse into it
            linenos.update(_find_lines(c, strs))
    return linenos

def _find_strings(filename, encoding=None):
    """Return a dict of possible docstring positions.

    The dict maps line numbers to strings.  There is an entry for
    line that contains only a string or a part of a triple-quoted
    string.
    """
    d = {}
    # If the first token is a string, then it's the module docstring.
    # Add this special case so that the test in the loop passes.
    prev_ttype = token.INDENT
    with open(filename, encoding=encoding) as f:
        tok = tokenize.generate_tokens(f.readline)
        for ttype, tstr, start, end, line in tok:
            if ttype == token.STRING:
                if prev_ttype == token.INDENT:
                    sline, scol = start
                    eline, ecol = end
                    for i in range(sline, eline + 1):
                        d[i] = 1
            prev_ttype = ttype
    return d

def _find_executable_linenos(filename):
    """Return dict where keys are line numbers in the line number table."""
    try:
        with tokenize.open(filename) as f:
            prog = f.read()
            encoding = f.encoding
    except OSError as err:
        print(("Not printing coverage data for %r: %s"
                              % (filename, err)), file=sys.stderr)
        return {}
    code = compile(prog, filename, "exec")
    strs = _find_strings(filename, encoding)
    return _find_lines(code, strs)

class Trace:
    def __init__(self, count=1, trace=1, countfuncs=0, countcallers=0,
                 ignoremods=(), ignoredirs=(), infile=None, outfile=None,
                 timing=False):
        """
        @param count true iff it should count number of times each
                     line is executed
        @param trace true iff it should print out each line that is
                     being counted
        @param countfuncs true iff it should just output a list of
                     (filename, modulename, funcname,) for functions
                     that were called at least once;  This overrides
                     `count' and `trace'
        @param ignoremods a list of the names of modules to ignore
        @param ignoredirs a list of the names of directories to ignore
                     all of the (recursive) contents of
        @param infile file from which to read stored counts to be
                     added into the results
        @param outfile file in which to write the results
        @param timing true iff timing information be displayed
        """
        self.infile = infile
        self.outfile = outfile
        self.ignore = _Ignore(ignoremods, ignoredirs)
        self.counts = {}   # keys are (filename, linenumber)
        self.pathtobasename = {} # for memoizing os.path.basename
        self.donothing = 0
        self.trace = trace
        self._calledfuncs = {}
        self._callers = {}
        self._caller_cache = {}
        self.start_time = None
        if timing:
            self.start_time = _time()
        if countcallers:
            self.globaltrace = self.globaltrace_trackcallers
        elif countfuncs:
            self.globaltrace = self.globaltrace_countfuncs
        elif trace and count:
            self.globaltrace = self.globaltrace_lt
            self.localtrace = self.localtrace_trace_and_count
        elif trace:
            self.globaltrace = self.globaltrace_lt
            self.localtrace = self.localtrace_trace
        elif count:
            self.globaltrace = self.globaltrace_lt
            self.localtrace = self.localtrace_count
        else:
            # Ahem -- do nothing?  Okay.
            self.donothing = 1

    def run(self, cmd):
        import __main__
        dict = __main__.__dict__
        self.runctx(cmd, dict, dict)

    def runctx(self, cmd, globals=None, locals=None):
        if globals is None: globals = {}
        if locals is None: locals = {}
        if not self.donothing:
            threading.settrace(self.globaltrace)
            sys.settrace(self.globaltrace)
        try:
            exec(cmd, globals, locals)
        finally:
            if not self.donothing:
                sys.settrace(None)
                threading.settrace(None)

    def runfunc(*args, **kw):
        if len(args) >= 2:
            self, func, *args = args
        elif not args:
            raise TypeError("descriptor 'runfunc' of 'Trace' object "
                            "needs an argument")
        elif 'func' in kw:
            func = kw.pop('func')
            self, *args = args
            import warnings
            warnings.warn("Passing 'func' as keyword argument is deprecated",
                          DeprecationWarning, stacklevel=2)
        else:
            raise TypeError('runfunc expected at least 1 positional argument, '
                            'got %d' % (len(args)-1))

        result = None
        if not self.donothing:
            sys.settrace(self.globaltrace)
        try:
            result = func(*args, **kw)
        finally:
            if not self.donothing:
                sys.settrace(None)
        return result
    runfunc.__text_signature__ = '($self, func, /, *args, **kw)'

    def file_module_function_of(self, frame):
        code = frame.f_code
        filename = code.co_filename
        if filename:
            modulename = _modname(filename)
        else:
            modulename = None

        funcname = code.co_name
        clsname = None
        if code in self._caller_cache:
            if self._caller_cache[code] is not None:
                clsname = self._caller_cache[code]
        else:
            self._caller_cache[code] = None
            ## use of gc.get_referrers() was suggested by Michael Hudson
            # all functions which refer to this code object
            funcs = [f for f in gc.get_referrers(code)
                         if inspect.isfunction(f)]
            # require len(func) == 1 to avoid ambiguity caused by calls to
            # new.function(): "In the face of ambiguity, refuse the
            # temptation to guess."
            if len(funcs) == 1:
                dicts = [d for d in gc.get_referrers(funcs[0])
                             if isinstance(d, dict)]
                if len(dicts) == 1:
                    classes = [c for c in gc.get_referrers(dicts[0])
                                   if hasattr(c, "__bases__")]
                    if len(classes) == 1:
                        # ditto for new.classobj()
                        clsname = classes[0].__name__
                        # cache the result - assumption is that new.* is
                        # not called later to disturb this relationship
                        # _caller_cache could be flushed if functions in
                        # the new module get called.
                        self._caller_cache[code] = clsname
        if clsname is not None:
            funcname = "%s.%s" % (clsname, funcname)

        return filename, modulename, funcname

    def globaltrace_trackcallers(self, frame, why, arg):
        """Handler for call events.

        Adds information about who called who to the self._callers dict.
        """
        if why == 'call':
            # XXX Should do a better job of identifying methods
            this_func = self.file_module_function_of(frame)
            parent_func = self.file_module_function_of(frame.f_back)
            self._callers[(parent_func, this_func)] = 1

    def globaltrace_countfuncs(self, frame, why, arg):
        """Handler for call events.

        Adds (filename, modulename, funcname) to the self._calledfuncs dict.
        """
        if why == 'call':
            this_func = self.file_module_function_of(frame)
            self._calledfuncs[this_func] = 1

    def globaltrace_lt(self, frame, why, arg):
        """Handler for call events.

        If the code block being entered is to be ignored, returns `None',
        else returns self.localtrace.
        """
        if why == 'call':
            code = frame.f_code
            filename = frame.f_globals.get('__file__', None)
            if filename:
                # XXX _modname() doesn't work right for packages, so
                # the ignore support won't work right for packages
                modulename = _modname(filename)
                if modulename is not None:
                    ignore_it = self.ignore.names(filename, modulename)
                    if not ignore_it:
                        if self.trace:
                            print((" --- modulename: %s, funcname: %s"
                                   % (modulename, code.co_name)))
                        return self.localtrace
            else:
                return None

    def localtrace_trace_and_count(self, frame, why, arg):
        if why == "line":
            # record the file name and line number of every trace
            filename = frame.f_code.co_filename
            lineno = frame.f_lineno
            key = filename, lineno
            self.counts[key] = self.counts.get(key, 0) + 1

            if self.start_time:
                print('%.2f' % (_time() - self.start_time), end=' ')
            bname = os.path.basename(filename)
            print("%s(%d): %s" % (bname, lineno,
                                  linecache.getline(filename, lineno)), end='')
        return self.localtrace

    def localtrace_trace(self, frame, why, arg):
        if why == "line":
            # record the file name and line number of every trace
            filename = frame.f_code.co_filename
            lineno = frame.f_lineno

            if self.start_time:
                print('%.2f' % (_time() - self.start_time), end=' ')
            bname = os.path.basename(filename)
            print("%s(%d): %s" % (bname, lineno,
                                  linecache.getline(filename, lineno)), end='')
        return self.localtrace

    def localtrace_count(self, frame, why, arg):
        if why == "line":
            filename = frame.f_code.co_filename
            lineno = frame.f_lineno
            key = filename, lineno
            self.counts[key] = self.counts.get(key, 0) + 1
        return self.localtrace

    def results(self):
        return CoverageResults(self.counts, infile=self.infile,
                               outfile=self.outfile,
                               calledfuncs=self._calledfuncs,
                               callers=self._callers)

def main():
    import argparse

    parser = argparse.ArgumentParser()
    parser.add_argument('--version', action='version', version='trace 2.0')

    grp = parser.add_argument_group('Main options',
            'One of these (or --report) must be given')

    grp.add_argument('-c', '--count', action='store_true',
            help='Count the number of times each line is executed and write '
                 'the counts to <module>.cover for each module executed, in '
                 'the module\'s directory. See also --coverdir, --file, '
                 '--no-report below.')
    grp.add_argument('-t', '--trace', action='store_true',
            help='Print each line to sys.stdout before it is executed')
    grp.add_argument('-l', '--listfuncs', action='store_true',
            help='Keep track of which functions are executed at least once '
                 'and write the results to sys.stdout after the program exits. '
                 'Cannot be specified alongside --trace or --count.')
    grp.add_argument('-T', '--trackcalls', action='store_true',
            help='Keep track of caller/called pairs and write the results to '
                 'sys.stdout after the program exits.')

    grp = parser.add_argument_group('Modifiers')

    _grp = grp.add_mutually_exclusive_group()
    _grp.add_argument('-r', '--report', action='store_true',
            help='Generate a report from a counts file; does not execute any '
                 'code. --file must specify the results file to read, which '
                 'must have been created in a previous run with --count '
                 '--file=FILE')
    _grp.add_argument('-R', '--no-report', action='store_true',
            help='Do not generate the coverage report files. '
                 'Useful if you want to accumulate over several runs.')

    grp.add_argument('-f', '--file',
            help='File to accumulate counts over several runs')
    grp.add_argument('-C', '--coverdir',
            help='Directory where the report files go. The coverage report '
                 'for <package>.<module> will be written to file '
                 '<dir>/<package>/<module>.cover')
    grp.add_argument('-m', '--missing', action='store_true',
            help='Annotate executable lines that were not executed with '
                 '">>>>>> "')
    grp.add_argument('-s', '--summary', action='store_true',
            help='Write a brief summary for each file to sys.stdout. '
                 'Can only be used with --count or --report')
    grp.add_argument('-g', '--timing', action='store_true',
            help='Prefix each line with the time since the program started. '
                 'Only used while tracing')

    grp = parser.add_argument_group('Filters',
            'Can be specified multiple times')
    grp.add_argument('--ignore-module', action='append', default=[],
            help='Ignore the given module(s) and its submodules '
                 '(if it is a package). Accepts comma separated list of '
                 'module names.')
    grp.add_argument('--ignore-dir', action='append', default=[],
            help='Ignore files in the given directory '
                 '(multiple directories can be joined by os.pathsep).')

    parser.add_argument('--module', action='store_true', default=False,
                        help='Trace a module. ')
    parser.add_argument('progname', nargs='?',
            help='file to run as main program')
    parser.add_argument('arguments', nargs=argparse.REMAINDER,
            help='arguments to the program')

    opts = parser.parse_args()

    if opts.ignore_dir:
        _prefix = sysconfig.get_path("stdlib")
        _exec_prefix = sysconfig.get_path("platstdlib")

    def parse_ignore_dir(s):
        s = os.path.expanduser(os.path.expandvars(s))
        s = s.replace('$prefix', _prefix).replace('$exec_prefix', _exec_prefix)
        return os.path.normpath(s)

    opts.ignore_module = [mod.strip()
                          for i in opts.ignore_module for mod in i.split(',')]
    opts.ignore_dir = [parse_ignore_dir(s)
                       for i in opts.ignore_dir for s in i.split(os.pathsep)]

    if opts.report:
        if not opts.file:
            parser.error('-r/--report requires -f/--file')
        results = CoverageResults(infile=opts.file, outfile=opts.file)
        return results.write_results(opts.missing, opts.summary, opts.coverdir)

    if not any([opts.trace, opts.count, opts.listfuncs, opts.trackcalls]):
        parser.error('must specify one of --trace, --count, --report, '
                     '--listfuncs, or --trackcalls')

    if opts.listfuncs and (opts.count or opts.trace):
        parser.error('cannot specify both --listfuncs and (--trace or --count)')

    if opts.summary and not opts.count:
        parser.error('--summary can only be used with --count or --report')

    if opts.progname is None:
        parser.error('progname is missing: required with the main options')

    t = Trace(opts.count, opts.trace, countfuncs=opts.listfuncs,
              countcallers=opts.trackcalls, ignoremods=opts.ignore_module,
              ignoredirs=opts.ignore_dir, infile=opts.file,
              outfile=opts.file, timing=opts.timing)
    try:
        if opts.module:
            import runpy
            module_name = opts.progname
            mod_name, mod_spec, code = runpy._get_module_details(module_name)
            sys.argv = [code.co_filename, *opts.arguments]
            globs = {
                '__name__': '__main__',
                '__file__': code.co_filename,
                '__package__': mod_spec.parent,
                '__loader__': mod_spec.loader,
                '__spec__': mod_spec,
                '__cached__': None,
            }
        else:
            sys.argv = [opts.progname, *opts.arguments]
            sys.path[0] = os.path.dirname(opts.progname)

            with io.open_code(opts.progname) as fp:
                code = compile(fp.read(), opts.progname, 'exec')
            # try to emulate __main__ namespace as much as possible
            globs = {
                '__file__': opts.progname,
                '__name__': '__main__',
                '__package__': None,
                '__cached__': None,
            }
        t.runctx(code, globs, globs)
    except OSError as err:
        sys.exit("Cannot run file %r because: %s" % (sys.argv[0], err))
    except SystemExit:
        pass

    results = t.results()

    if not opts.no_report:
        results.write_results(opts.missing, opts.summary, opts.coverdir)

if __name__=='__main__':
    main()
numbers.py000064400000024004151153537470006604 0ustar00# Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Abstract Base Classes (ABCs) for numbers, according to PEP 3141.

TODO: Fill out more detailed documentation on the operators."""

from abc import ABCMeta, abstractmethod

__all__ = ["Number", "Complex", "Real", "Rational", "Integral"]

class Number(metaclass=ABCMeta):
    """All numbers inherit from this class.

    If you just want to check if an argument x is a number, without
    caring what kind, use isinstance(x, Number).
    """
    __slots__ = ()

    # Concrete numeric types must provide their own hash implementation
    __hash__ = None


## Notes on Decimal
## ----------------
## Decimal has all of the methods specified by the Real abc, but it should
## not be registered as a Real because decimals do not interoperate with
## binary floats (i.e.  Decimal('3.14') + 2.71828 is undefined).  But,
## abstract reals are expected to interoperate (i.e. R1 + R2 should be
## expected to work if R1 and R2 are both Reals).

class Complex(Number):
    """Complex defines the operations that work on the builtin complex type.

    In short, those are: a conversion to complex, .real, .imag, +, -,
    *, /, abs(), .conjugate, ==, and !=.

    If it is given heterogeneous arguments, and doesn't have special
    knowledge about them, it should fall back to the builtin complex
    type as described below.
    """

    __slots__ = ()

    @abstractmethod
    def __complex__(self):
        """Return a builtin complex instance. Called for complex(self)."""

    def __bool__(self):
        """True if self != 0. Called for bool(self)."""
        return self != 0

    @property
    @abstractmethod
    def real(self):
        """Retrieve the real component of this number.

        This should subclass Real.
        """
        raise NotImplementedError

    @property
    @abstractmethod
    def imag(self):
        """Retrieve the imaginary component of this number.

        This should subclass Real.
        """
        raise NotImplementedError

    @abstractmethod
    def __add__(self, other):
        """self + other"""
        raise NotImplementedError

    @abstractmethod
    def __radd__(self, other):
        """other + self"""
        raise NotImplementedError

    @abstractmethod
    def __neg__(self):
        """-self"""
        raise NotImplementedError

    @abstractmethod
    def __pos__(self):
        """+self"""
        raise NotImplementedError

    def __sub__(self, other):
        """self - other"""
        return self + -other

    def __rsub__(self, other):
        """other - self"""
        return -self + other

    @abstractmethod
    def __mul__(self, other):
        """self * other"""
        raise NotImplementedError

    @abstractmethod
    def __rmul__(self, other):
        """other * self"""
        raise NotImplementedError

    @abstractmethod
    def __truediv__(self, other):
        """self / other: Should promote to float when necessary."""
        raise NotImplementedError

    @abstractmethod
    def __rtruediv__(self, other):
        """other / self"""
        raise NotImplementedError

    @abstractmethod
    def __pow__(self, exponent):
        """self**exponent; should promote to float or complex when necessary."""
        raise NotImplementedError

    @abstractmethod
    def __rpow__(self, base):
        """base ** self"""
        raise NotImplementedError

    @abstractmethod
    def __abs__(self):
        """Returns the Real distance from 0. Called for abs(self)."""
        raise NotImplementedError

    @abstractmethod
    def conjugate(self):
        """(x+y*i).conjugate() returns (x-y*i)."""
        raise NotImplementedError

    @abstractmethod
    def __eq__(self, other):
        """self == other"""
        raise NotImplementedError

Complex.register(complex)


class Real(Complex):
    """To Complex, Real adds the operations that work on real numbers.

    In short, those are: a conversion to float, trunc(), divmod,
    %, <, <=, >, and >=.

    Real also provides defaults for the derived operations.
    """

    __slots__ = ()

    @abstractmethod
    def __float__(self):
        """Any Real can be converted to a native float object.

        Called for float(self)."""
        raise NotImplementedError

    @abstractmethod
    def __trunc__(self):
        """trunc(self): Truncates self to an Integral.

        Returns an Integral i such that:
          * i>0 iff self>0;
          * abs(i) <= abs(self);
          * for any Integral j satisfying the first two conditions,
            abs(i) >= abs(j) [i.e. i has "maximal" abs among those].
        i.e. "truncate towards 0".
        """
        raise NotImplementedError

    @abstractmethod
    def __floor__(self):
        """Finds the greatest Integral <= self."""
        raise NotImplementedError

    @abstractmethod
    def __ceil__(self):
        """Finds the least Integral >= self."""
        raise NotImplementedError

    @abstractmethod
    def __round__(self, ndigits=None):
        """Rounds self to ndigits decimal places, defaulting to 0.

        If ndigits is omitted or None, returns an Integral, otherwise
        returns a Real. Rounds half toward even.
        """
        raise NotImplementedError

    def __divmod__(self, other):
        """divmod(self, other): The pair (self // other, self % other).

        Sometimes this can be computed faster than the pair of
        operations.
        """
        return (self // other, self % other)

    def __rdivmod__(self, other):
        """divmod(other, self): The pair (self // other, self % other).

        Sometimes this can be computed faster than the pair of
        operations.
        """
        return (other // self, other % self)

    @abstractmethod
    def __floordiv__(self, other):
        """self // other: The floor() of self/other."""
        raise NotImplementedError

    @abstractmethod
    def __rfloordiv__(self, other):
        """other // self: The floor() of other/self."""
        raise NotImplementedError

    @abstractmethod
    def __mod__(self, other):
        """self % other"""
        raise NotImplementedError

    @abstractmethod
    def __rmod__(self, other):
        """other % self"""
        raise NotImplementedError

    @abstractmethod
    def __lt__(self, other):
        """self < other

        < on Reals defines a total ordering, except perhaps for NaN."""
        raise NotImplementedError

    @abstractmethod
    def __le__(self, other):
        """self <= other"""
        raise NotImplementedError

    # Concrete implementations of Complex abstract methods.
    def __complex__(self):
        """complex(self) == complex(float(self), 0)"""
        return complex(float(self))

    @property
    def real(self):
        """Real numbers are their real component."""
        return +self

    @property
    def imag(self):
        """Real numbers have no imaginary component."""
        return 0

    def conjugate(self):
        """Conjugate is a no-op for Reals."""
        return +self

Real.register(float)


class Rational(Real):
    """.numerator and .denominator should be in lowest terms."""

    __slots__ = ()

    @property
    @abstractmethod
    def numerator(self):
        raise NotImplementedError

    @property
    @abstractmethod
    def denominator(self):
        raise NotImplementedError

    # Concrete implementation of Real's conversion to float.
    def __float__(self):
        """float(self) = self.numerator / self.denominator

        It's important that this conversion use the integer's "true"
        division rather than casting one side to float before dividing
        so that ratios of huge integers convert without overflowing.

        """
        return self.numerator / self.denominator


class Integral(Rational):
    """Integral adds a conversion to int and the bit-string operations."""

    __slots__ = ()

    @abstractmethod
    def __int__(self):
        """int(self)"""
        raise NotImplementedError

    def __index__(self):
        """Called whenever an index is needed, such as in slicing"""
        return int(self)

    @abstractmethod
    def __pow__(self, exponent, modulus=None):
        """self ** exponent % modulus, but maybe faster.

        Accept the modulus argument if you want to support the
        3-argument version of pow(). Raise a TypeError if exponent < 0
        or any argument isn't Integral. Otherwise, just implement the
        2-argument version described in Complex.
        """
        raise NotImplementedError

    @abstractmethod
    def __lshift__(self, other):
        """self << other"""
        raise NotImplementedError

    @abstractmethod
    def __rlshift__(self, other):
        """other << self"""
        raise NotImplementedError

    @abstractmethod
    def __rshift__(self, other):
        """self >> other"""
        raise NotImplementedError

    @abstractmethod
    def __rrshift__(self, other):
        """other >> self"""
        raise NotImplementedError

    @abstractmethod
    def __and__(self, other):
        """self & other"""
        raise NotImplementedError

    @abstractmethod
    def __rand__(self, other):
        """other & self"""
        raise NotImplementedError

    @abstractmethod
    def __xor__(self, other):
        """self ^ other"""
        raise NotImplementedError

    @abstractmethod
    def __rxor__(self, other):
        """other ^ self"""
        raise NotImplementedError

    @abstractmethod
    def __or__(self, other):
        """self | other"""
        raise NotImplementedError

    @abstractmethod
    def __ror__(self, other):
        """other | self"""
        raise NotImplementedError

    @abstractmethod
    def __invert__(self):
        """~self"""
        raise NotImplementedError

    # Concrete implementations of Rational and Real abstract methods.
    def __float__(self):
        """float(self) == float(int(self))"""
        return float(int(self))

    @property
    def numerator(self):
        """Integers are their own numerators."""
        return +self

    @property
    def denominator(self):
        """Integers have a denominator of 1."""
        return 1

Integral.register(int)
colorsys.py000064400000007740151153537470007016 0ustar00"""Conversion functions between RGB and other color systems.

This modules provides two functions for each color system ABC:

  rgb_to_abc(r, g, b) --> a, b, c
  abc_to_rgb(a, b, c) --> r, g, b

All inputs and outputs are triples of floats in the range [0.0...1.0]
(with the exception of I and Q, which covers a slightly larger range).
Inputs outside the valid range may cause exceptions or invalid outputs.

Supported color systems:
RGB: Red, Green, Blue components
YIQ: Luminance, Chrominance (used by composite video signals)
HLS: Hue, Luminance, Saturation
HSV: Hue, Saturation, Value
"""

# References:
# http://en.wikipedia.org/wiki/YIQ
# http://en.wikipedia.org/wiki/HLS_color_space
# http://en.wikipedia.org/wiki/HSV_color_space

__all__ = ["rgb_to_yiq","yiq_to_rgb","rgb_to_hls","hls_to_rgb",
           "rgb_to_hsv","hsv_to_rgb"]

# Some floating point constants

ONE_THIRD = 1.0/3.0
ONE_SIXTH = 1.0/6.0
TWO_THIRD = 2.0/3.0

# YIQ: used by composite video signals (linear combinations of RGB)
# Y: perceived grey level (0.0 == black, 1.0 == white)
# I, Q: color components
#
# There are a great many versions of the constants used in these formulae.
# The ones in this library uses constants from the FCC version of NTSC.

def rgb_to_yiq(r, g, b):
    y = 0.30*r + 0.59*g + 0.11*b
    i = 0.74*(r-y) - 0.27*(b-y)
    q = 0.48*(r-y) + 0.41*(b-y)
    return (y, i, q)

def yiq_to_rgb(y, i, q):
    # r = y + (0.27*q + 0.41*i) / (0.74*0.41 + 0.27*0.48)
    # b = y + (0.74*q - 0.48*i) / (0.74*0.41 + 0.27*0.48)
    # g = y - (0.30*(r-y) + 0.11*(b-y)) / 0.59

    r = y + 0.9468822170900693*i + 0.6235565819861433*q
    g = y - 0.27478764629897834*i - 0.6356910791873801*q
    b = y - 1.1085450346420322*i + 1.7090069284064666*q

    if r < 0.0:
        r = 0.0
    if g < 0.0:
        g = 0.0
    if b < 0.0:
        b = 0.0
    if r > 1.0:
        r = 1.0
    if g > 1.0:
        g = 1.0
    if b > 1.0:
        b = 1.0
    return (r, g, b)


# HLS: Hue, Luminance, Saturation
# H: position in the spectrum
# L: color lightness
# S: color saturation

def rgb_to_hls(r, g, b):
    maxc = max(r, g, b)
    minc = min(r, g, b)
    # XXX Can optimize (maxc+minc) and (maxc-minc)
    l = (minc+maxc)/2.0
    if minc == maxc:
        return 0.0, l, 0.0
    if l <= 0.5:
        s = (maxc-minc) / (maxc+minc)
    else:
        s = (maxc-minc) / (2.0-maxc-minc)
    rc = (maxc-r) / (maxc-minc)
    gc = (maxc-g) / (maxc-minc)
    bc = (maxc-b) / (maxc-minc)
    if r == maxc:
        h = bc-gc
    elif g == maxc:
        h = 2.0+rc-bc
    else:
        h = 4.0+gc-rc
    h = (h/6.0) % 1.0
    return h, l, s

def hls_to_rgb(h, l, s):
    if s == 0.0:
        return l, l, l
    if l <= 0.5:
        m2 = l * (1.0+s)
    else:
        m2 = l+s-(l*s)
    m1 = 2.0*l - m2
    return (_v(m1, m2, h+ONE_THIRD), _v(m1, m2, h), _v(m1, m2, h-ONE_THIRD))

def _v(m1, m2, hue):
    hue = hue % 1.0
    if hue < ONE_SIXTH:
        return m1 + (m2-m1)*hue*6.0
    if hue < 0.5:
        return m2
    if hue < TWO_THIRD:
        return m1 + (m2-m1)*(TWO_THIRD-hue)*6.0
    return m1


# HSV: Hue, Saturation, Value
# H: position in the spectrum
# S: color saturation ("purity")
# V: color brightness

def rgb_to_hsv(r, g, b):
    maxc = max(r, g, b)
    minc = min(r, g, b)
    v = maxc
    if minc == maxc:
        return 0.0, 0.0, v
    s = (maxc-minc) / maxc
    rc = (maxc-r) / (maxc-minc)
    gc = (maxc-g) / (maxc-minc)
    bc = (maxc-b) / (maxc-minc)
    if r == maxc:
        h = bc-gc
    elif g == maxc:
        h = 2.0+rc-bc
    else:
        h = 4.0+gc-rc
    h = (h/6.0) % 1.0
    return h, s, v

def hsv_to_rgb(h, s, v):
    if s == 0.0:
        return v, v, v
    i = int(h*6.0) # XXX assume int() truncates!
    f = (h*6.0) - i
    p = v*(1.0 - s)
    q = v*(1.0 - s*f)
    t = v*(1.0 - s*(1.0-f))
    i = i%6
    if i == 0:
        return v, t, p
    if i == 1:
        return q, v, p
    if i == 2:
        return p, v, t
    if i == 3:
        return p, q, v
    if i == 4:
        return t, p, v
    if i == 5:
        return v, p, q
    # Cannot get here
pipes.py000064400000021324151153537470006253 0ustar00"""Conversion pipeline templates.

The problem:
------------

Suppose you have some data that you want to convert to another format,
such as from GIF image format to PPM image format.  Maybe the
conversion involves several steps (e.g. piping it through compress or
uuencode).  Some of the conversion steps may require that their input
is a disk file, others may be able to read standard input; similar for
their output.  The input to the entire conversion may also be read
from a disk file or from an open file, and similar for its output.

The module lets you construct a pipeline template by sticking one or
more conversion steps together.  It will take care of creating and
removing temporary files if they are necessary to hold intermediate
data.  You can then use the template to do conversions from many
different sources to many different destinations.  The temporary
file names used are different each time the template is used.

The templates are objects so you can create templates for many
different conversion steps and store them in a dictionary, for
instance.


Directions:
-----------

To create a template:
    t = Template()

To add a conversion step to a template:
   t.append(command, kind)
where kind is a string of two characters: the first is '-' if the
command reads its standard input or 'f' if it requires a file; the
second likewise for the output. The command must be valid /bin/sh
syntax.  If input or output files are required, they are passed as
$IN and $OUT; otherwise, it must be  possible to use the command in
a pipeline.

To add a conversion step at the beginning:
   t.prepend(command, kind)

To convert a file to another file using a template:
  sts = t.copy(infile, outfile)
If infile or outfile are the empty string, standard input is read or
standard output is written, respectively.  The return value is the
exit status of the conversion pipeline.

To open a file for reading or writing through a conversion pipeline:
   fp = t.open(file, mode)
where mode is 'r' to read the file, or 'w' to write it -- just like
for the built-in function open() or for os.popen().

To create a new template object initialized to a given one:
   t2 = t.clone()
"""                                     # '


import re
import os
import tempfile
# we import the quote function rather than the module for backward compat
# (quote used to be an undocumented but used function in pipes)
from shlex import quote

__all__ = ["Template"]

# Conversion step kinds

FILEIN_FILEOUT = 'ff'                   # Must read & write real files
STDIN_FILEOUT  = '-f'                   # Must write a real file
FILEIN_STDOUT  = 'f-'                   # Must read a real file
STDIN_STDOUT   = '--'                   # Normal pipeline element
SOURCE         = '.-'                   # Must be first, writes stdout
SINK           = '-.'                   # Must be last, reads stdin

stepkinds = [FILEIN_FILEOUT, STDIN_FILEOUT, FILEIN_STDOUT, STDIN_STDOUT, \
             SOURCE, SINK]


class Template:
    """Class representing a pipeline template."""

    def __init__(self):
        """Template() returns a fresh pipeline template."""
        self.debugging = 0
        self.reset()

    def __repr__(self):
        """t.__repr__() implements repr(t)."""
        return '<Template instance, steps=%r>' % (self.steps,)

    def reset(self):
        """t.reset() restores a pipeline template to its initial state."""
        self.steps = []

    def clone(self):
        """t.clone() returns a new pipeline template with identical
        initial state as the current one."""
        t = Template()
        t.steps = self.steps[:]
        t.debugging = self.debugging
        return t

    def debug(self, flag):
        """t.debug(flag) turns debugging on or off."""
        self.debugging = flag

    def append(self, cmd, kind):
        """t.append(cmd, kind) adds a new step at the end."""
        if type(cmd) is not type(''):
            raise TypeError('Template.append: cmd must be a string')
        if kind not in stepkinds:
            raise ValueError('Template.append: bad kind %r' % (kind,))
        if kind == SOURCE:
            raise ValueError('Template.append: SOURCE can only be prepended')
        if self.steps and self.steps[-1][1] == SINK:
            raise ValueError('Template.append: already ends with SINK')
        if kind[0] == 'f' and not re.search(r'\$IN\b', cmd):
            raise ValueError('Template.append: missing $IN in cmd')
        if kind[1] == 'f' and not re.search(r'\$OUT\b', cmd):
            raise ValueError('Template.append: missing $OUT in cmd')
        self.steps.append((cmd, kind))

    def prepend(self, cmd, kind):
        """t.prepend(cmd, kind) adds a new step at the front."""
        if type(cmd) is not type(''):
            raise TypeError('Template.prepend: cmd must be a string')
        if kind not in stepkinds:
            raise ValueError('Template.prepend: bad kind %r' % (kind,))
        if kind == SINK:
            raise ValueError('Template.prepend: SINK can only be appended')
        if self.steps and self.steps[0][1] == SOURCE:
            raise ValueError('Template.prepend: already begins with SOURCE')
        if kind[0] == 'f' and not re.search(r'\$IN\b', cmd):
            raise ValueError('Template.prepend: missing $IN in cmd')
        if kind[1] == 'f' and not re.search(r'\$OUT\b', cmd):
            raise ValueError('Template.prepend: missing $OUT in cmd')
        self.steps.insert(0, (cmd, kind))

    def open(self, file, rw):
        """t.open(file, rw) returns a pipe or file object open for
        reading or writing; the file is the other end of the pipeline."""
        if rw == 'r':
            return self.open_r(file)
        if rw == 'w':
            return self.open_w(file)
        raise ValueError('Template.open: rw must be \'r\' or \'w\', not %r'
                         % (rw,))

    def open_r(self, file):
        """t.open_r(file) and t.open_w(file) implement
        t.open(file, 'r') and t.open(file, 'w') respectively."""
        if not self.steps:
            return open(file, 'r')
        if self.steps[-1][1] == SINK:
            raise ValueError('Template.open_r: pipeline ends width SINK')
        cmd = self.makepipeline(file, '')
        return os.popen(cmd, 'r')

    def open_w(self, file):
        if not self.steps:
            return open(file, 'w')
        if self.steps[0][1] == SOURCE:
            raise ValueError('Template.open_w: pipeline begins with SOURCE')
        cmd = self.makepipeline('', file)
        return os.popen(cmd, 'w')

    def copy(self, infile, outfile):
        return os.system(self.makepipeline(infile, outfile))

    def makepipeline(self, infile, outfile):
        cmd = makepipeline(infile, self.steps, outfile)
        if self.debugging:
            print(cmd)
            cmd = 'set -x; ' + cmd
        return cmd


def makepipeline(infile, steps, outfile):
    # Build a list with for each command:
    # [input filename or '', command string, kind, output filename or '']

    list = []
    for cmd, kind in steps:
        list.append(['', cmd, kind, ''])
    #
    # Make sure there is at least one step
    #
    if not list:
        list.append(['', 'cat', '--', ''])
    #
    # Take care of the input and output ends
    #
    [cmd, kind] = list[0][1:3]
    if kind[0] == 'f' and not infile:
        list.insert(0, ['', 'cat', '--', ''])
    list[0][0] = infile
    #
    [cmd, kind] = list[-1][1:3]
    if kind[1] == 'f' and not outfile:
        list.append(['', 'cat', '--', ''])
    list[-1][-1] = outfile
    #
    # Invent temporary files to connect stages that need files
    #
    garbage = []
    for i in range(1, len(list)):
        lkind = list[i-1][2]
        rkind = list[i][2]
        if lkind[1] == 'f' or rkind[0] == 'f':
            (fd, temp) = tempfile.mkstemp()
            os.close(fd)
            garbage.append(temp)
            list[i-1][-1] = list[i][0] = temp
    #
    for item in list:
        [inf, cmd, kind, outf] = item
        if kind[1] == 'f':
            cmd = 'OUT=' + quote(outf) + '; ' + cmd
        if kind[0] == 'f':
            cmd = 'IN=' + quote(inf) + '; ' + cmd
        if kind[0] == '-' and inf:
            cmd = cmd + ' <' + quote(inf)
        if kind[1] == '-' and outf:
            cmd = cmd + ' >' + quote(outf)
        item[1] = cmd
    #
    cmdlist = list[0][1]
    for item in list[1:]:
        [cmd, kind] = item[1:3]
        if item[0] == '':
            if 'f' in kind:
                cmd = '{ ' + cmd + '; }'
            cmdlist = cmdlist + ' |\n' + cmd
        else:
            cmdlist = cmdlist + '\n' + cmd
    #
    if garbage:
        rmcmd = 'rm -f'
        for file in garbage:
            rmcmd = rmcmd + ' ' + quote(file)
        trapcmd = 'trap ' + quote(rmcmd + '; exit') + ' 1 2 3 13 14 15'
        cmdlist = trapcmd + '\n' + cmdlist + '\n' + rmcmd
    #
    return cmdlist
pprint.py000064400000051754151153537470006461 0ustar00#  Author:      Fred L. Drake, Jr.
#               fdrake@acm.org
#
#  This is a simple little module I wrote to make life easier.  I didn't
#  see anything quite like it in the library, though I may have overlooked
#  something.  I wrote this when I was trying to read some heavily nested
#  tuples with fairly non-descriptive content.  This is modeled very much
#  after Lisp/Scheme - style pretty-printing of lists.  If you find it
#  useful, thank small children who sleep at night.

"""Support to pretty-print lists, tuples, & dictionaries recursively.

Very simple, but useful, especially in debugging data structures.

Classes
-------

PrettyPrinter()
    Handle pretty-printing operations onto a stream using a configured
    set of formatting parameters.

Functions
---------

pformat()
    Format a Python object into a pretty-printed representation.

pprint()
    Pretty-print a Python object to a stream [default is sys.stdout].

saferepr()
    Generate a 'standard' repr()-like value, but protect against recursive
    data structures.

"""

import collections as _collections
import re
import sys as _sys
import types as _types
from io import StringIO as _StringIO

__all__ = ["pprint","pformat","isreadable","isrecursive","saferepr",
           "PrettyPrinter", "pp"]


def pprint(object, stream=None, indent=1, width=80, depth=None, *,
           compact=False, sort_dicts=True):
    """Pretty-print a Python object to a stream [default is sys.stdout]."""
    printer = PrettyPrinter(
        stream=stream, indent=indent, width=width, depth=depth,
        compact=compact, sort_dicts=sort_dicts)
    printer.pprint(object)

def pformat(object, indent=1, width=80, depth=None, *,
            compact=False, sort_dicts=True):
    """Format a Python object into a pretty-printed representation."""
    return PrettyPrinter(indent=indent, width=width, depth=depth,
                         compact=compact, sort_dicts=sort_dicts).pformat(object)

def pp(object, *args, sort_dicts=False, **kwargs):
    """Pretty-print a Python object"""
    pprint(object, *args, sort_dicts=sort_dicts, **kwargs)

def saferepr(object):
    """Version of repr() which can handle recursive data structures."""
    return _safe_repr(object, {}, None, 0, True)[0]

def isreadable(object):
    """Determine if saferepr(object) is readable by eval()."""
    return _safe_repr(object, {}, None, 0, True)[1]

def isrecursive(object):
    """Determine if object requires a recursive representation."""
    return _safe_repr(object, {}, None, 0, True)[2]

class _safe_key:
    """Helper function for key functions when sorting unorderable objects.

    The wrapped-object will fallback to a Py2.x style comparison for
    unorderable types (sorting first comparing the type name and then by
    the obj ids).  Does not work recursively, so dict.items() must have
    _safe_key applied to both the key and the value.

    """

    __slots__ = ['obj']

    def __init__(self, obj):
        self.obj = obj

    def __lt__(self, other):
        try:
            return self.obj < other.obj
        except TypeError:
            return ((str(type(self.obj)), id(self.obj)) < \
                    (str(type(other.obj)), id(other.obj)))

def _safe_tuple(t):
    "Helper function for comparing 2-tuples"
    return _safe_key(t[0]), _safe_key(t[1])

class PrettyPrinter:
    def __init__(self, indent=1, width=80, depth=None, stream=None, *,
                 compact=False, sort_dicts=True):
        """Handle pretty printing operations onto a stream using a set of
        configured parameters.

        indent
            Number of spaces to indent for each level of nesting.

        width
            Attempted maximum number of columns in the output.

        depth
            The maximum depth to print out nested structures.

        stream
            The desired output stream.  If omitted (or false), the standard
            output stream available at construction will be used.

        compact
            If true, several items will be combined in one line.

        sort_dicts
            If true, dict keys are sorted.

        """
        indent = int(indent)
        width = int(width)
        if indent < 0:
            raise ValueError('indent must be >= 0')
        if depth is not None and depth <= 0:
            raise ValueError('depth must be > 0')
        if not width:
            raise ValueError('width must be != 0')
        self._depth = depth
        self._indent_per_level = indent
        self._width = width
        if stream is not None:
            self._stream = stream
        else:
            self._stream = _sys.stdout
        self._compact = bool(compact)
        self._sort_dicts = sort_dicts

    def pprint(self, object):
        self._format(object, self._stream, 0, 0, {}, 0)
        self._stream.write("\n")

    def pformat(self, object):
        sio = _StringIO()
        self._format(object, sio, 0, 0, {}, 0)
        return sio.getvalue()

    def isrecursive(self, object):
        return self.format(object, {}, 0, 0)[2]

    def isreadable(self, object):
        s, readable, recursive = self.format(object, {}, 0, 0)
        return readable and not recursive

    def _format(self, object, stream, indent, allowance, context, level):
        objid = id(object)
        if objid in context:
            stream.write(_recursion(object))
            self._recursive = True
            self._readable = False
            return
        rep = self._repr(object, context, level)
        max_width = self._width - indent - allowance
        if len(rep) > max_width:
            p = self._dispatch.get(type(object).__repr__, None)
            if p is not None:
                context[objid] = 1
                p(self, object, stream, indent, allowance, context, level + 1)
                del context[objid]
                return
            elif isinstance(object, dict):
                context[objid] = 1
                self._pprint_dict(object, stream, indent, allowance,
                                  context, level + 1)
                del context[objid]
                return
        stream.write(rep)

    _dispatch = {}

    def _pprint_dict(self, object, stream, indent, allowance, context, level):
        write = stream.write
        write('{')
        if self._indent_per_level > 1:
            write((self._indent_per_level - 1) * ' ')
        length = len(object)
        if length:
            if self._sort_dicts:
                items = sorted(object.items(), key=_safe_tuple)
            else:
                items = object.items()
            self._format_dict_items(items, stream, indent, allowance + 1,
                                    context, level)
        write('}')

    _dispatch[dict.__repr__] = _pprint_dict

    def _pprint_ordered_dict(self, object, stream, indent, allowance, context, level):
        if not len(object):
            stream.write(repr(object))
            return
        cls = object.__class__
        stream.write(cls.__name__ + '(')
        self._format(list(object.items()), stream,
                     indent + len(cls.__name__) + 1, allowance + 1,
                     context, level)
        stream.write(')')

    _dispatch[_collections.OrderedDict.__repr__] = _pprint_ordered_dict

    def _pprint_list(self, object, stream, indent, allowance, context, level):
        stream.write('[')
        self._format_items(object, stream, indent, allowance + 1,
                           context, level)
        stream.write(']')

    _dispatch[list.__repr__] = _pprint_list

    def _pprint_tuple(self, object, stream, indent, allowance, context, level):
        stream.write('(')
        endchar = ',)' if len(object) == 1 else ')'
        self._format_items(object, stream, indent, allowance + len(endchar),
                           context, level)
        stream.write(endchar)

    _dispatch[tuple.__repr__] = _pprint_tuple

    def _pprint_set(self, object, stream, indent, allowance, context, level):
        if not len(object):
            stream.write(repr(object))
            return
        typ = object.__class__
        if typ is set:
            stream.write('{')
            endchar = '}'
        else:
            stream.write(typ.__name__ + '({')
            endchar = '})'
            indent += len(typ.__name__) + 1
        object = sorted(object, key=_safe_key)
        self._format_items(object, stream, indent, allowance + len(endchar),
                           context, level)
        stream.write(endchar)

    _dispatch[set.__repr__] = _pprint_set
    _dispatch[frozenset.__repr__] = _pprint_set

    def _pprint_str(self, object, stream, indent, allowance, context, level):
        write = stream.write
        if not len(object):
            write(repr(object))
            return
        chunks = []
        lines = object.splitlines(True)
        if level == 1:
            indent += 1
            allowance += 1
        max_width1 = max_width = self._width - indent
        for i, line in enumerate(lines):
            rep = repr(line)
            if i == len(lines) - 1:
                max_width1 -= allowance
            if len(rep) <= max_width1:
                chunks.append(rep)
            else:
                # A list of alternating (non-space, space) strings
                parts = re.findall(r'\S*\s*', line)
                assert parts
                assert not parts[-1]
                parts.pop()  # drop empty last part
                max_width2 = max_width
                current = ''
                for j, part in enumerate(parts):
                    candidate = current + part
                    if j == len(parts) - 1 and i == len(lines) - 1:
                        max_width2 -= allowance
                    if len(repr(candidate)) > max_width2:
                        if current:
                            chunks.append(repr(current))
                        current = part
                    else:
                        current = candidate
                if current:
                    chunks.append(repr(current))
        if len(chunks) == 1:
            write(rep)
            return
        if level == 1:
            write('(')
        for i, rep in enumerate(chunks):
            if i > 0:
                write('\n' + ' '*indent)
            write(rep)
        if level == 1:
            write(')')

    _dispatch[str.__repr__] = _pprint_str

    def _pprint_bytes(self, object, stream, indent, allowance, context, level):
        write = stream.write
        if len(object) <= 4:
            write(repr(object))
            return
        parens = level == 1
        if parens:
            indent += 1
            allowance += 1
            write('(')
        delim = ''
        for rep in _wrap_bytes_repr(object, self._width - indent, allowance):
            write(delim)
            write(rep)
            if not delim:
                delim = '\n' + ' '*indent
        if parens:
            write(')')

    _dispatch[bytes.__repr__] = _pprint_bytes

    def _pprint_bytearray(self, object, stream, indent, allowance, context, level):
        write = stream.write
        write('bytearray(')
        self._pprint_bytes(bytes(object), stream, indent + 10,
                           allowance + 1, context, level + 1)
        write(')')

    _dispatch[bytearray.__repr__] = _pprint_bytearray

    def _pprint_mappingproxy(self, object, stream, indent, allowance, context, level):
        stream.write('mappingproxy(')
        self._format(object.copy(), stream, indent + 13, allowance + 1,
                     context, level)
        stream.write(')')

    _dispatch[_types.MappingProxyType.__repr__] = _pprint_mappingproxy

    def _format_dict_items(self, items, stream, indent, allowance, context,
                           level):
        write = stream.write
        indent += self._indent_per_level
        delimnl = ',\n' + ' ' * indent
        last_index = len(items) - 1
        for i, (key, ent) in enumerate(items):
            last = i == last_index
            rep = self._repr(key, context, level)
            write(rep)
            write(': ')
            self._format(ent, stream, indent + len(rep) + 2,
                         allowance if last else 1,
                         context, level)
            if not last:
                write(delimnl)

    def _format_items(self, items, stream, indent, allowance, context, level):
        write = stream.write
        indent += self._indent_per_level
        if self._indent_per_level > 1:
            write((self._indent_per_level - 1) * ' ')
        delimnl = ',\n' + ' ' * indent
        delim = ''
        width = max_width = self._width - indent + 1
        it = iter(items)
        try:
            next_ent = next(it)
        except StopIteration:
            return
        last = False
        while not last:
            ent = next_ent
            try:
                next_ent = next(it)
            except StopIteration:
                last = True
                max_width -= allowance
                width -= allowance
            if self._compact:
                rep = self._repr(ent, context, level)
                w = len(rep) + 2
                if width < w:
                    width = max_width
                    if delim:
                        delim = delimnl
                if width >= w:
                    width -= w
                    write(delim)
                    delim = ', '
                    write(rep)
                    continue
            write(delim)
            delim = delimnl
            self._format(ent, stream, indent,
                         allowance if last else 1,
                         context, level)

    def _repr(self, object, context, level):
        repr, readable, recursive = self.format(object, context.copy(),
                                                self._depth, level)
        if not readable:
            self._readable = False
        if recursive:
            self._recursive = True
        return repr

    def format(self, object, context, maxlevels, level):
        """Format object for a specific context, returning a string
        and flags indicating whether the representation is 'readable'
        and whether the object represents a recursive construct.
        """
        return _safe_repr(object, context, maxlevels, level, self._sort_dicts)

    def _pprint_default_dict(self, object, stream, indent, allowance, context, level):
        if not len(object):
            stream.write(repr(object))
            return
        rdf = self._repr(object.default_factory, context, level)
        cls = object.__class__
        indent += len(cls.__name__) + 1
        stream.write('%s(%s,\n%s' % (cls.__name__, rdf, ' ' * indent))
        self._pprint_dict(object, stream, indent, allowance + 1, context, level)
        stream.write(')')

    _dispatch[_collections.defaultdict.__repr__] = _pprint_default_dict

    def _pprint_counter(self, object, stream, indent, allowance, context, level):
        if not len(object):
            stream.write(repr(object))
            return
        cls = object.__class__
        stream.write(cls.__name__ + '({')
        if self._indent_per_level > 1:
            stream.write((self._indent_per_level - 1) * ' ')
        items = object.most_common()
        self._format_dict_items(items, stream,
                                indent + len(cls.__name__) + 1, allowance + 2,
                                context, level)
        stream.write('})')

    _dispatch[_collections.Counter.__repr__] = _pprint_counter

    def _pprint_chain_map(self, object, stream, indent, allowance, context, level):
        if not len(object.maps):
            stream.write(repr(object))
            return
        cls = object.__class__
        stream.write(cls.__name__ + '(')
        indent += len(cls.__name__) + 1
        for i, m in enumerate(object.maps):
            if i == len(object.maps) - 1:
                self._format(m, stream, indent, allowance + 1, context, level)
                stream.write(')')
            else:
                self._format(m, stream, indent, 1, context, level)
                stream.write(',\n' + ' ' * indent)

    _dispatch[_collections.ChainMap.__repr__] = _pprint_chain_map

    def _pprint_deque(self, object, stream, indent, allowance, context, level):
        if not len(object):
            stream.write(repr(object))
            return
        cls = object.__class__
        stream.write(cls.__name__ + '(')
        indent += len(cls.__name__) + 1
        stream.write('[')
        if object.maxlen is None:
            self._format_items(object, stream, indent, allowance + 2,
                               context, level)
            stream.write('])')
        else:
            self._format_items(object, stream, indent, 2,
                               context, level)
            rml = self._repr(object.maxlen, context, level)
            stream.write('],\n%smaxlen=%s)' % (' ' * indent, rml))

    _dispatch[_collections.deque.__repr__] = _pprint_deque

    def _pprint_user_dict(self, object, stream, indent, allowance, context, level):
        self._format(object.data, stream, indent, allowance, context, level - 1)

    _dispatch[_collections.UserDict.__repr__] = _pprint_user_dict

    def _pprint_user_list(self, object, stream, indent, allowance, context, level):
        self._format(object.data, stream, indent, allowance, context, level - 1)

    _dispatch[_collections.UserList.__repr__] = _pprint_user_list

    def _pprint_user_string(self, object, stream, indent, allowance, context, level):
        self._format(object.data, stream, indent, allowance, context, level - 1)

    _dispatch[_collections.UserString.__repr__] = _pprint_user_string

# Return triple (repr_string, isreadable, isrecursive).

def _safe_repr(object, context, maxlevels, level, sort_dicts):
    typ = type(object)
    if typ in _builtin_scalars:
        return repr(object), True, False

    r = getattr(typ, "__repr__", None)
    if issubclass(typ, dict) and r is dict.__repr__:
        if not object:
            return "{}", True, False
        objid = id(object)
        if maxlevels and level >= maxlevels:
            return "{...}", False, objid in context
        if objid in context:
            return _recursion(object), False, True
        context[objid] = 1
        readable = True
        recursive = False
        components = []
        append = components.append
        level += 1
        if sort_dicts:
            items = sorted(object.items(), key=_safe_tuple)
        else:
            items = object.items()
        for k, v in items:
            krepr, kreadable, krecur = _safe_repr(k, context, maxlevels, level, sort_dicts)
            vrepr, vreadable, vrecur = _safe_repr(v, context, maxlevels, level, sort_dicts)
            append("%s: %s" % (krepr, vrepr))
            readable = readable and kreadable and vreadable
            if krecur or vrecur:
                recursive = True
        del context[objid]
        return "{%s}" % ", ".join(components), readable, recursive

    if (issubclass(typ, list) and r is list.__repr__) or \
       (issubclass(typ, tuple) and r is tuple.__repr__):
        if issubclass(typ, list):
            if not object:
                return "[]", True, False
            format = "[%s]"
        elif len(object) == 1:
            format = "(%s,)"
        else:
            if not object:
                return "()", True, False
            format = "(%s)"
        objid = id(object)
        if maxlevels and level >= maxlevels:
            return format % "...", False, objid in context
        if objid in context:
            return _recursion(object), False, True
        context[objid] = 1
        readable = True
        recursive = False
        components = []
        append = components.append
        level += 1
        for o in object:
            orepr, oreadable, orecur = _safe_repr(o, context, maxlevels, level, sort_dicts)
            append(orepr)
            if not oreadable:
                readable = False
            if orecur:
                recursive = True
        del context[objid]
        return format % ", ".join(components), readable, recursive

    rep = repr(object)
    return rep, (rep and not rep.startswith('<')), False

_builtin_scalars = frozenset({str, bytes, bytearray, int, float, complex,
                              bool, type(None)})

def _recursion(object):
    return ("<Recursion on %s with id=%s>"
            % (type(object).__name__, id(object)))


def _perfcheck(object=None):
    import time
    if object is None:
        object = [("string", (1, 2), [3, 4], {5: 6, 7: 8})] * 100000
    p = PrettyPrinter()
    t1 = time.perf_counter()
    _safe_repr(object, {}, None, 0, True)
    t2 = time.perf_counter()
    p.pformat(object)
    t3 = time.perf_counter()
    print("_safe_repr:", t2 - t1)
    print("pformat:", t3 - t2)

def _wrap_bytes_repr(object, width, allowance):
    current = b''
    last = len(object) // 4 * 4
    for i in range(0, len(object), 4):
        part = object[i: i+4]
        candidate = current + part
        if i == last:
            width -= allowance
        if len(repr(candidate)) > width:
            if current:
                yield repr(current)
            current = part
        else:
            current = candidate
    if current:
        yield repr(current)

if __name__ == "__main__":
    _perfcheck()
cgitb.py000064400000027500151153537470006225 0ustar00"""More comprehensive traceback formatting for Python scripts.

To enable this module, do:

    import cgitb; cgitb.enable()

at the top of your script.  The optional arguments to enable() are:

    display     - if true, tracebacks are displayed in the web browser
    logdir      - if set, tracebacks are written to files in this directory
    context     - number of lines of source code to show for each stack frame
    format      - 'text' or 'html' controls the output format

By default, tracebacks are displayed but not saved, the context is 5 lines
and the output format is 'html' (for backwards compatibility with the
original use of this module)

Alternatively, if you have caught an exception and want cgitb to display it
for you, call cgitb.handler().  The optional argument to handler() is a
3-item tuple (etype, evalue, etb) just like the value of sys.exc_info().
The default handler displays output as HTML.

"""
import inspect
import keyword
import linecache
import os
import pydoc
import sys
import tempfile
import time
import tokenize
import traceback

def reset():
    """Return a string that resets the CGI and browser to a known state."""
    return '''<!--: spam
Content-Type: text/html

<body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> -->
<body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> --> -->
</font> </font> </font> </script> </object> </blockquote> </pre>
</table> </table> </table> </table> </table> </font> </font> </font>'''

__UNDEF__ = []                          # a special sentinel object
def small(text):
    if text:
        return '<small>' + text + '</small>'
    else:
        return ''

def strong(text):
    if text:
        return '<strong>' + text + '</strong>'
    else:
        return ''

def grey(text):
    if text:
        return '<font color="#909090">' + text + '</font>'
    else:
        return ''

def lookup(name, frame, locals):
    """Find the value for a given name in the given environment."""
    if name in locals:
        return 'local', locals[name]
    if name in frame.f_globals:
        return 'global', frame.f_globals[name]
    if '__builtins__' in frame.f_globals:
        builtins = frame.f_globals['__builtins__']
        if type(builtins) is type({}):
            if name in builtins:
                return 'builtin', builtins[name]
        else:
            if hasattr(builtins, name):
                return 'builtin', getattr(builtins, name)
    return None, __UNDEF__

def scanvars(reader, frame, locals):
    """Scan one logical line of Python and look up values of variables used."""
    vars, lasttoken, parent, prefix, value = [], None, None, '', __UNDEF__
    for ttype, token, start, end, line in tokenize.generate_tokens(reader):
        if ttype == tokenize.NEWLINE: break
        if ttype == tokenize.NAME and token not in keyword.kwlist:
            if lasttoken == '.':
                if parent is not __UNDEF__:
                    value = getattr(parent, token, __UNDEF__)
                    vars.append((prefix + token, prefix, value))
            else:
                where, value = lookup(token, frame, locals)
                vars.append((token, where, value))
        elif token == '.':
            prefix += lasttoken + '.'
            parent = value
        else:
            parent, prefix = None, ''
        lasttoken = token
    return vars

def html(einfo, context=5):
    """Return a nice HTML document describing a given traceback."""
    etype, evalue, etb = einfo
    if isinstance(etype, type):
        etype = etype.__name__
    pyver = 'Python ' + sys.version.split()[0] + ': ' + sys.executable
    date = time.ctime(time.time())
    head = '<body bgcolor="#f0f0f8">' + pydoc.html.heading(
        '<big><big>%s</big></big>' %
        strong(pydoc.html.escape(str(etype))),
        '#ffffff', '#6622aa', pyver + '<br>' + date) + '''
<p>A problem occurred in a Python script.  Here is the sequence of
function calls leading up to the error, in the order they occurred.</p>'''

    indent = '<tt>' + small('&nbsp;' * 5) + '&nbsp;</tt>'
    frames = []
    records = inspect.getinnerframes(etb, context)
    for frame, file, lnum, func, lines, index in records:
        if file:
            file = os.path.abspath(file)
            link = '<a href="file://%s">%s</a>' % (file, pydoc.html.escape(file))
        else:
            file = link = '?'
        args, varargs, varkw, locals = inspect.getargvalues(frame)
        call = ''
        if func != '?':
            call = 'in ' + strong(pydoc.html.escape(func))
            if func != "<module>":
                call += inspect.formatargvalues(args, varargs, varkw, locals,
                    formatvalue=lambda value: '=' + pydoc.html.repr(value))

        highlight = {}
        def reader(lnum=[lnum]):
            highlight[lnum[0]] = 1
            try: return linecache.getline(file, lnum[0])
            finally: lnum[0] += 1
        vars = scanvars(reader, frame, locals)

        rows = ['<tr><td bgcolor="#d8bbff">%s%s %s</td></tr>' %
                ('<big>&nbsp;</big>', link, call)]
        if index is not None:
            i = lnum - index
            for line in lines:
                num = small('&nbsp;' * (5-len(str(i))) + str(i)) + '&nbsp;'
                if i in highlight:
                    line = '<tt>=&gt;%s%s</tt>' % (num, pydoc.html.preformat(line))
                    rows.append('<tr><td bgcolor="#ffccee">%s</td></tr>' % line)
                else:
                    line = '<tt>&nbsp;&nbsp;%s%s</tt>' % (num, pydoc.html.preformat(line))
                    rows.append('<tr><td>%s</td></tr>' % grey(line))
                i += 1

        done, dump = {}, []
        for name, where, value in vars:
            if name in done: continue
            done[name] = 1
            if value is not __UNDEF__:
                if where in ('global', 'builtin'):
                    name = ('<em>%s</em> ' % where) + strong(name)
                elif where == 'local':
                    name = strong(name)
                else:
                    name = where + strong(name.split('.')[-1])
                dump.append('%s&nbsp;= %s' % (name, pydoc.html.repr(value)))
            else:
                dump.append(name + ' <em>undefined</em>')

        rows.append('<tr><td>%s</td></tr>' % small(grey(', '.join(dump))))
        frames.append('''
<table width="100%%" cellspacing=0 cellpadding=0 border=0>
%s</table>''' % '\n'.join(rows))

    exception = ['<p>%s: %s' % (strong(pydoc.html.escape(str(etype))),
                                pydoc.html.escape(str(evalue)))]
    for name in dir(evalue):
        if name[:1] == '_': continue
        value = pydoc.html.repr(getattr(evalue, name))
        exception.append('\n<br>%s%s&nbsp;=\n%s' % (indent, name, value))

    return head + ''.join(frames) + ''.join(exception) + '''


<!-- The above is a description of an error in a Python program, formatted
     for a Web browser because the 'cgitb' module was enabled.  In case you
     are not reading this in a Web browser, here is the original traceback:

%s
-->
''' % pydoc.html.escape(
          ''.join(traceback.format_exception(etype, evalue, etb)))

def text(einfo, context=5):
    """Return a plain text document describing a given traceback."""
    etype, evalue, etb = einfo
    if isinstance(etype, type):
        etype = etype.__name__
    pyver = 'Python ' + sys.version.split()[0] + ': ' + sys.executable
    date = time.ctime(time.time())
    head = "%s\n%s\n%s\n" % (str(etype), pyver, date) + '''
A problem occurred in a Python script.  Here is the sequence of
function calls leading up to the error, in the order they occurred.
'''

    frames = []
    records = inspect.getinnerframes(etb, context)
    for frame, file, lnum, func, lines, index in records:
        file = file and os.path.abspath(file) or '?'
        args, varargs, varkw, locals = inspect.getargvalues(frame)
        call = ''
        if func != '?':
            call = 'in ' + func
            if func != "<module>":
                call += inspect.formatargvalues(args, varargs, varkw, locals,
                    formatvalue=lambda value: '=' + pydoc.text.repr(value))

        highlight = {}
        def reader(lnum=[lnum]):
            highlight[lnum[0]] = 1
            try: return linecache.getline(file, lnum[0])
            finally: lnum[0] += 1
        vars = scanvars(reader, frame, locals)

        rows = [' %s %s' % (file, call)]
        if index is not None:
            i = lnum - index
            for line in lines:
                num = '%5d ' % i
                rows.append(num+line.rstrip())
                i += 1

        done, dump = {}, []
        for name, where, value in vars:
            if name in done: continue
            done[name] = 1
            if value is not __UNDEF__:
                if where == 'global': name = 'global ' + name
                elif where != 'local': name = where + name.split('.')[-1]
                dump.append('%s = %s' % (name, pydoc.text.repr(value)))
            else:
                dump.append(name + ' undefined')

        rows.append('\n'.join(dump))
        frames.append('\n%s\n' % '\n'.join(rows))

    exception = ['%s: %s' % (str(etype), str(evalue))]
    for name in dir(evalue):
        value = pydoc.text.repr(getattr(evalue, name))
        exception.append('\n%s%s = %s' % (" "*4, name, value))

    return head + ''.join(frames) + ''.join(exception) + '''

The above is a description of an error in a Python program.  Here is
the original traceback:

%s
''' % ''.join(traceback.format_exception(etype, evalue, etb))

class Hook:
    """A hook to replace sys.excepthook that shows tracebacks in HTML."""

    def __init__(self, display=1, logdir=None, context=5, file=None,
                 format="html"):
        self.display = display          # send tracebacks to browser if true
        self.logdir = logdir            # log tracebacks to files if not None
        self.context = context          # number of source code lines per frame
        self.file = file or sys.stdout  # place to send the output
        self.format = format

    def __call__(self, etype, evalue, etb):
        self.handle((etype, evalue, etb))

    def handle(self, info=None):
        info = info or sys.exc_info()
        if self.format == "html":
            self.file.write(reset())

        formatter = (self.format=="html") and html or text
        plain = False
        try:
            doc = formatter(info, self.context)
        except:                         # just in case something goes wrong
            doc = ''.join(traceback.format_exception(*info))
            plain = True

        if self.display:
            if plain:
                doc = pydoc.html.escape(doc)
                self.file.write('<pre>' + doc + '</pre>\n')
            else:
                self.file.write(doc + '\n')
        else:
            self.file.write('<p>A problem occurred in a Python script.\n')

        if self.logdir is not None:
            suffix = ['.txt', '.html'][self.format=="html"]
            (fd, path) = tempfile.mkstemp(suffix=suffix, dir=self.logdir)

            try:
                with os.fdopen(fd, 'w') as file:
                    file.write(doc)
                msg = '%s contains the description of this error.' % path
            except:
                msg = 'Tried to save traceback to %s, but failed.' % path

            if self.format == 'html':
                self.file.write('<p>%s</p>\n' % msg)
            else:
                self.file.write(msg + '\n')
        try:
            self.file.flush()
        except: pass

handler = Hook().handle
def enable(display=1, logdir=None, context=5, format="html"):
    """Install an exception handler that formats tracebacks as HTML.

    The optional argument 'display' can be set to 0 to suppress sending the
    traceback to the browser, and 'logdir' can be set to a directory to cause
    tracebacks to be written to files there."""
    sys.excepthook = Hook(display=display, logdir=logdir,
                          context=context, format=format)
getopt.py000064400000016501151153537470006436 0ustar00"""Parser for command line options.

This module helps scripts to parse the command line arguments in
sys.argv.  It supports the same conventions as the Unix getopt()
function (including the special meanings of arguments of the form `-'
and `--').  Long options similar to those supported by GNU software
may be used as well via an optional third argument.  This module
provides two functions and an exception:

getopt() -- Parse command line options
gnu_getopt() -- Like getopt(), but allow option and non-option arguments
to be intermixed.
GetoptError -- exception (class) raised with 'opt' attribute, which is the
option involved with the exception.
"""

# Long option support added by Lars Wirzenius <liw@iki.fi>.
#
# Gerrit Holl <gerrit@nl.linux.org> moved the string-based exceptions
# to class-based exceptions.
#
# Peter Åstrand <astrand@lysator.liu.se> added gnu_getopt().
#
# TODO for gnu_getopt():
#
# - GNU getopt_long_only mechanism
# - allow the caller to specify ordering
# - RETURN_IN_ORDER option
# - GNU extension with '-' as first character of option string
# - optional arguments, specified by double colons
# - an option string with a W followed by semicolon should
#   treat "-W foo" as "--foo"

__all__ = ["GetoptError","error","getopt","gnu_getopt"]

import os
try:
    from gettext import gettext as _
except ImportError:
    # Bootstrapping Python: gettext's dependencies not built yet
    def _(s): return s

class GetoptError(Exception):
    opt = ''
    msg = ''
    def __init__(self, msg, opt=''):
        self.msg = msg
        self.opt = opt
        Exception.__init__(self, msg, opt)

    def __str__(self):
        return self.msg

error = GetoptError # backward compatibility

def getopt(args, shortopts, longopts = []):
    """getopt(args, options[, long_options]) -> opts, args

    Parses command line options and parameter list.  args is the
    argument list to be parsed, without the leading reference to the
    running program.  Typically, this means "sys.argv[1:]".  shortopts
    is the string of option letters that the script wants to
    recognize, with options that require an argument followed by a
    colon (i.e., the same format that Unix getopt() uses).  If
    specified, longopts is a list of strings with the names of the
    long options which should be supported.  The leading '--'
    characters should not be included in the option name.  Options
    which require an argument should be followed by an equal sign
    ('=').

    The return value consists of two elements: the first is a list of
    (option, value) pairs; the second is the list of program arguments
    left after the option list was stripped (this is a trailing slice
    of the first argument).  Each option-and-value pair returned has
    the option as its first element, prefixed with a hyphen (e.g.,
    '-x'), and the option argument as its second element, or an empty
    string if the option has no argument.  The options occur in the
    list in the same order in which they were found, thus allowing
    multiple occurrences.  Long and short options may be mixed.

    """

    opts = []
    if type(longopts) == type(""):
        longopts = [longopts]
    else:
        longopts = list(longopts)
    while args and args[0].startswith('-') and args[0] != '-':
        if args[0] == '--':
            args = args[1:]
            break
        if args[0].startswith('--'):
            opts, args = do_longs(opts, args[0][2:], longopts, args[1:])
        else:
            opts, args = do_shorts(opts, args[0][1:], shortopts, args[1:])

    return opts, args

def gnu_getopt(args, shortopts, longopts = []):
    """getopt(args, options[, long_options]) -> opts, args

    This function works like getopt(), except that GNU style scanning
    mode is used by default. This means that option and non-option
    arguments may be intermixed. The getopt() function stops
    processing options as soon as a non-option argument is
    encountered.

    If the first character of the option string is `+', or if the
    environment variable POSIXLY_CORRECT is set, then option
    processing stops as soon as a non-option argument is encountered.

    """

    opts = []
    prog_args = []
    if isinstance(longopts, str):
        longopts = [longopts]
    else:
        longopts = list(longopts)

    # Allow options after non-option arguments?
    if shortopts.startswith('+'):
        shortopts = shortopts[1:]
        all_options_first = True
    elif os.environ.get("POSIXLY_CORRECT"):
        all_options_first = True
    else:
        all_options_first = False

    while args:
        if args[0] == '--':
            prog_args += args[1:]
            break

        if args[0][:2] == '--':
            opts, args = do_longs(opts, args[0][2:], longopts, args[1:])
        elif args[0][:1] == '-' and args[0] != '-':
            opts, args = do_shorts(opts, args[0][1:], shortopts, args[1:])
        else:
            if all_options_first:
                prog_args += args
                break
            else:
                prog_args.append(args[0])
                args = args[1:]

    return opts, prog_args

def do_longs(opts, opt, longopts, args):
    try:
        i = opt.index('=')
    except ValueError:
        optarg = None
    else:
        opt, optarg = opt[:i], opt[i+1:]

    has_arg, opt = long_has_args(opt, longopts)
    if has_arg:
        if optarg is None:
            if not args:
                raise GetoptError(_('option --%s requires argument') % opt, opt)
            optarg, args = args[0], args[1:]
    elif optarg is not None:
        raise GetoptError(_('option --%s must not have an argument') % opt, opt)
    opts.append(('--' + opt, optarg or ''))
    return opts, args

# Return:
#   has_arg?
#   full option name
def long_has_args(opt, longopts):
    possibilities = [o for o in longopts if o.startswith(opt)]
    if not possibilities:
        raise GetoptError(_('option --%s not recognized') % opt, opt)
    # Is there an exact match?
    if opt in possibilities:
        return False, opt
    elif opt + '=' in possibilities:
        return True, opt
    # No exact match, so better be unique.
    if len(possibilities) > 1:
        # XXX since possibilities contains all valid continuations, might be
        # nice to work them into the error msg
        raise GetoptError(_('option --%s not a unique prefix') % opt, opt)
    assert len(possibilities) == 1
    unique_match = possibilities[0]
    has_arg = unique_match.endswith('=')
    if has_arg:
        unique_match = unique_match[:-1]
    return has_arg, unique_match

def do_shorts(opts, optstring, shortopts, args):
    while optstring != '':
        opt, optstring = optstring[0], optstring[1:]
        if short_has_arg(opt, shortopts):
            if optstring == '':
                if not args:
                    raise GetoptError(_('option -%s requires argument') % opt,
                                      opt)
                optstring, args = args[0], args[1:]
            optarg, optstring = optstring, ''
        else:
            optarg = ''
        opts.append(('-' + opt, optarg))
    return opts, args

def short_has_arg(opt, shortopts):
    for i in range(len(shortopts)):
        if opt == shortopts[i] != ':':
            return shortopts.startswith(':', i+1)
    raise GetoptError(_('option -%s not recognized') % opt, opt)

if __name__ == '__main__':
    import sys
    print(getopt(sys.argv[1:], "a:b", ["alpha=", "beta"]))
functools.py000064400000111036151153537470007147 0ustar00"""functools.py - Tools for working with functions and callable objects
"""
# Python module wrapper for _functools C module
# to allow utilities written in Python to be added
# to the functools module.
# Written by Nick Coghlan <ncoghlan at gmail.com>,
# Raymond Hettinger <python at rcn.com>,
# and Łukasz Langa <lukasz at langa.pl>.
#   Copyright (C) 2006-2013 Python Software Foundation.
# See C source code for _functools credits/copyright

__all__ = ['update_wrapper', 'wraps', 'WRAPPER_ASSIGNMENTS', 'WRAPPER_UPDATES',
           'total_ordering', 'cmp_to_key', 'lru_cache', 'reduce', 'partial',
           'partialmethod', 'singledispatch', 'singledispatchmethod',
           "cached_property"]

from abc import get_cache_token
from collections import namedtuple
# import types, weakref  # Deferred to single_dispatch()
from reprlib import recursive_repr
from _thread import RLock


################################################################################
### update_wrapper() and wraps() decorator
################################################################################

# update_wrapper() and wraps() are tools to help write
# wrapper functions that can handle naive introspection

WRAPPER_ASSIGNMENTS = ('__module__', '__name__', '__qualname__', '__doc__',
                       '__annotations__')
WRAPPER_UPDATES = ('__dict__',)
def update_wrapper(wrapper,
                   wrapped,
                   assigned = WRAPPER_ASSIGNMENTS,
                   updated = WRAPPER_UPDATES):
    """Update a wrapper function to look like the wrapped function

       wrapper is the function to be updated
       wrapped is the original function
       assigned is a tuple naming the attributes assigned directly
       from the wrapped function to the wrapper function (defaults to
       functools.WRAPPER_ASSIGNMENTS)
       updated is a tuple naming the attributes of the wrapper that
       are updated with the corresponding attribute from the wrapped
       function (defaults to functools.WRAPPER_UPDATES)
    """
    for attr in assigned:
        try:
            value = getattr(wrapped, attr)
        except AttributeError:
            pass
        else:
            setattr(wrapper, attr, value)
    for attr in updated:
        getattr(wrapper, attr).update(getattr(wrapped, attr, {}))
    # Issue #17482: set __wrapped__ last so we don't inadvertently copy it
    # from the wrapped function when updating __dict__
    wrapper.__wrapped__ = wrapped
    # Return the wrapper so this can be used as a decorator via partial()
    return wrapper

def wraps(wrapped,
          assigned = WRAPPER_ASSIGNMENTS,
          updated = WRAPPER_UPDATES):
    """Decorator factory to apply update_wrapper() to a wrapper function

       Returns a decorator that invokes update_wrapper() with the decorated
       function as the wrapper argument and the arguments to wraps() as the
       remaining arguments. Default arguments are as for update_wrapper().
       This is a convenience function to simplify applying partial() to
       update_wrapper().
    """
    return partial(update_wrapper, wrapped=wrapped,
                   assigned=assigned, updated=updated)


################################################################################
### total_ordering class decorator
################################################################################

# The total ordering functions all invoke the root magic method directly
# rather than using the corresponding operator.  This avoids possible
# infinite recursion that could occur when the operator dispatch logic
# detects a NotImplemented result and then calls a reflected method.

def _gt_from_lt(self, other, NotImplemented=NotImplemented):
    'Return a > b.  Computed by @total_ordering from (not a < b) and (a != b).'
    op_result = self.__lt__(other)
    if op_result is NotImplemented:
        return op_result
    return not op_result and self != other

def _le_from_lt(self, other, NotImplemented=NotImplemented):
    'Return a <= b.  Computed by @total_ordering from (a < b) or (a == b).'
    op_result = self.__lt__(other)
    return op_result or self == other

def _ge_from_lt(self, other, NotImplemented=NotImplemented):
    'Return a >= b.  Computed by @total_ordering from (not a < b).'
    op_result = self.__lt__(other)
    if op_result is NotImplemented:
        return op_result
    return not op_result

def _ge_from_le(self, other, NotImplemented=NotImplemented):
    'Return a >= b.  Computed by @total_ordering from (not a <= b) or (a == b).'
    op_result = self.__le__(other)
    if op_result is NotImplemented:
        return op_result
    return not op_result or self == other

def _lt_from_le(self, other, NotImplemented=NotImplemented):
    'Return a < b.  Computed by @total_ordering from (a <= b) and (a != b).'
    op_result = self.__le__(other)
    if op_result is NotImplemented:
        return op_result
    return op_result and self != other

def _gt_from_le(self, other, NotImplemented=NotImplemented):
    'Return a > b.  Computed by @total_ordering from (not a <= b).'
    op_result = self.__le__(other)
    if op_result is NotImplemented:
        return op_result
    return not op_result

def _lt_from_gt(self, other, NotImplemented=NotImplemented):
    'Return a < b.  Computed by @total_ordering from (not a > b) and (a != b).'
    op_result = self.__gt__(other)
    if op_result is NotImplemented:
        return op_result
    return not op_result and self != other

def _ge_from_gt(self, other, NotImplemented=NotImplemented):
    'Return a >= b.  Computed by @total_ordering from (a > b) or (a == b).'
    op_result = self.__gt__(other)
    return op_result or self == other

def _le_from_gt(self, other, NotImplemented=NotImplemented):
    'Return a <= b.  Computed by @total_ordering from (not a > b).'
    op_result = self.__gt__(other)
    if op_result is NotImplemented:
        return op_result
    return not op_result

def _le_from_ge(self, other, NotImplemented=NotImplemented):
    'Return a <= b.  Computed by @total_ordering from (not a >= b) or (a == b).'
    op_result = self.__ge__(other)
    if op_result is NotImplemented:
        return op_result
    return not op_result or self == other

def _gt_from_ge(self, other, NotImplemented=NotImplemented):
    'Return a > b.  Computed by @total_ordering from (a >= b) and (a != b).'
    op_result = self.__ge__(other)
    if op_result is NotImplemented:
        return op_result
    return op_result and self != other

def _lt_from_ge(self, other, NotImplemented=NotImplemented):
    'Return a < b.  Computed by @total_ordering from (not a >= b).'
    op_result = self.__ge__(other)
    if op_result is NotImplemented:
        return op_result
    return not op_result

_convert = {
    '__lt__': [('__gt__', _gt_from_lt),
               ('__le__', _le_from_lt),
               ('__ge__', _ge_from_lt)],
    '__le__': [('__ge__', _ge_from_le),
               ('__lt__', _lt_from_le),
               ('__gt__', _gt_from_le)],
    '__gt__': [('__lt__', _lt_from_gt),
               ('__ge__', _ge_from_gt),
               ('__le__', _le_from_gt)],
    '__ge__': [('__le__', _le_from_ge),
               ('__gt__', _gt_from_ge),
               ('__lt__', _lt_from_ge)]
}

def total_ordering(cls):
    """Class decorator that fills in missing ordering methods"""
    # Find user-defined comparisons (not those inherited from object).
    roots = {op for op in _convert if getattr(cls, op, None) is not getattr(object, op, None)}
    if not roots:
        raise ValueError('must define at least one ordering operation: < > <= >=')
    root = max(roots)       # prefer __lt__ to __le__ to __gt__ to __ge__
    for opname, opfunc in _convert[root]:
        if opname not in roots:
            opfunc.__name__ = opname
            setattr(cls, opname, opfunc)
    return cls


################################################################################
### cmp_to_key() function converter
################################################################################

def cmp_to_key(mycmp):
    """Convert a cmp= function into a key= function"""
    class K(object):
        __slots__ = ['obj']
        def __init__(self, obj):
            self.obj = obj
        def __lt__(self, other):
            return mycmp(self.obj, other.obj) < 0
        def __gt__(self, other):
            return mycmp(self.obj, other.obj) > 0
        def __eq__(self, other):
            return mycmp(self.obj, other.obj) == 0
        def __le__(self, other):
            return mycmp(self.obj, other.obj) <= 0
        def __ge__(self, other):
            return mycmp(self.obj, other.obj) >= 0
        __hash__ = None
    return K

try:
    from _functools import cmp_to_key
except ImportError:
    pass


################################################################################
### reduce() sequence to a single item
################################################################################

_initial_missing = object()

def reduce(function, sequence, initial=_initial_missing):
    """
    reduce(function, sequence[, initial]) -> value

    Apply a function of two arguments cumulatively to the items of a sequence,
    from left to right, so as to reduce the sequence to a single value.
    For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates
    ((((1+2)+3)+4)+5).  If initial is present, it is placed before the items
    of the sequence in the calculation, and serves as a default when the
    sequence is empty.
    """

    it = iter(sequence)

    if initial is _initial_missing:
        try:
            value = next(it)
        except StopIteration:
            raise TypeError("reduce() of empty sequence with no initial value") from None
    else:
        value = initial

    for element in it:
        value = function(value, element)

    return value

try:
    from _functools import reduce
except ImportError:
    pass


################################################################################
### partial() argument application
################################################################################

# Purely functional, no descriptor behaviour
class partial:
    """New function with partial application of the given arguments
    and keywords.
    """

    __slots__ = "func", "args", "keywords", "__dict__", "__weakref__"

    def __new__(cls, func, /, *args, **keywords):
        if not callable(func):
            raise TypeError("the first argument must be callable")

        if hasattr(func, "func"):
            args = func.args + args
            keywords = {**func.keywords, **keywords}
            func = func.func

        self = super(partial, cls).__new__(cls)

        self.func = func
        self.args = args
        self.keywords = keywords
        return self

    def __call__(self, /, *args, **keywords):
        keywords = {**self.keywords, **keywords}
        return self.func(*self.args, *args, **keywords)

    @recursive_repr()
    def __repr__(self):
        qualname = type(self).__qualname__
        args = [repr(self.func)]
        args.extend(repr(x) for x in self.args)
        args.extend(f"{k}={v!r}" for (k, v) in self.keywords.items())
        if type(self).__module__ == "functools":
            return f"functools.{qualname}({', '.join(args)})"
        return f"{qualname}({', '.join(args)})"

    def __reduce__(self):
        return type(self), (self.func,), (self.func, self.args,
               self.keywords or None, self.__dict__ or None)

    def __setstate__(self, state):
        if not isinstance(state, tuple):
            raise TypeError("argument to __setstate__ must be a tuple")
        if len(state) != 4:
            raise TypeError(f"expected 4 items in state, got {len(state)}")
        func, args, kwds, namespace = state
        if (not callable(func) or not isinstance(args, tuple) or
           (kwds is not None and not isinstance(kwds, dict)) or
           (namespace is not None and not isinstance(namespace, dict))):
            raise TypeError("invalid partial state")

        args = tuple(args) # just in case it's a subclass
        if kwds is None:
            kwds = {}
        elif type(kwds) is not dict: # XXX does it need to be *exactly* dict?
            kwds = dict(kwds)
        if namespace is None:
            namespace = {}

        self.__dict__ = namespace
        self.func = func
        self.args = args
        self.keywords = kwds

try:
    from _functools import partial
except ImportError:
    pass

# Descriptor version
class partialmethod(object):
    """Method descriptor with partial application of the given arguments
    and keywords.

    Supports wrapping existing descriptors and handles non-descriptor
    callables as instance methods.
    """

    def __init__(*args, **keywords):
        if len(args) >= 2:
            self, func, *args = args
        elif not args:
            raise TypeError("descriptor '__init__' of partialmethod "
                            "needs an argument")
        elif 'func' in keywords:
            func = keywords.pop('func')
            self, *args = args
            import warnings
            warnings.warn("Passing 'func' as keyword argument is deprecated",
                          DeprecationWarning, stacklevel=2)
        else:
            raise TypeError("type 'partialmethod' takes at least one argument, "
                            "got %d" % (len(args)-1))
        args = tuple(args)

        if not callable(func) and not hasattr(func, "__get__"):
            raise TypeError("{!r} is not callable or a descriptor"
                                 .format(func))

        # func could be a descriptor like classmethod which isn't callable,
        # so we can't inherit from partial (it verifies func is callable)
        if isinstance(func, partialmethod):
            # flattening is mandatory in order to place cls/self before all
            # other arguments
            # it's also more efficient since only one function will be called
            self.func = func.func
            self.args = func.args + args
            self.keywords = {**func.keywords, **keywords}
        else:
            self.func = func
            self.args = args
            self.keywords = keywords
    __init__.__text_signature__ = '($self, func, /, *args, **keywords)'

    def __repr__(self):
        args = ", ".join(map(repr, self.args))
        keywords = ", ".join("{}={!r}".format(k, v)
                                 for k, v in self.keywords.items())
        format_string = "{module}.{cls}({func}, {args}, {keywords})"
        return format_string.format(module=self.__class__.__module__,
                                    cls=self.__class__.__qualname__,
                                    func=self.func,
                                    args=args,
                                    keywords=keywords)

    def _make_unbound_method(self):
        def _method(cls_or_self, /, *args, **keywords):
            keywords = {**self.keywords, **keywords}
            return self.func(cls_or_self, *self.args, *args, **keywords)
        _method.__isabstractmethod__ = self.__isabstractmethod__
        _method._partialmethod = self
        return _method

    def __get__(self, obj, cls=None):
        get = getattr(self.func, "__get__", None)
        result = None
        if get is not None:
            new_func = get(obj, cls)
            if new_func is not self.func:
                # Assume __get__ returning something new indicates the
                # creation of an appropriate callable
                result = partial(new_func, *self.args, **self.keywords)
                try:
                    result.__self__ = new_func.__self__
                except AttributeError:
                    pass
        if result is None:
            # If the underlying descriptor didn't do anything, treat this
            # like an instance method
            result = self._make_unbound_method().__get__(obj, cls)
        return result

    @property
    def __isabstractmethod__(self):
        return getattr(self.func, "__isabstractmethod__", False)

# Helper functions

def _unwrap_partial(func):
    while isinstance(func, partial):
        func = func.func
    return func

################################################################################
### LRU Cache function decorator
################################################################################

_CacheInfo = namedtuple("CacheInfo", ["hits", "misses", "maxsize", "currsize"])

class _HashedSeq(list):
    """ This class guarantees that hash() will be called no more than once
        per element.  This is important because the lru_cache() will hash
        the key multiple times on a cache miss.

    """

    __slots__ = 'hashvalue'

    def __init__(self, tup, hash=hash):
        self[:] = tup
        self.hashvalue = hash(tup)

    def __hash__(self):
        return self.hashvalue

def _make_key(args, kwds, typed,
             kwd_mark = (object(),),
             fasttypes = {int, str},
             tuple=tuple, type=type, len=len):
    """Make a cache key from optionally typed positional and keyword arguments

    The key is constructed in a way that is flat as possible rather than
    as a nested structure that would take more memory.

    If there is only a single argument and its data type is known to cache
    its hash value, then that argument is returned without a wrapper.  This
    saves space and improves lookup speed.

    """
    # All of code below relies on kwds preserving the order input by the user.
    # Formerly, we sorted() the kwds before looping.  The new way is *much*
    # faster; however, it means that f(x=1, y=2) will now be treated as a
    # distinct call from f(y=2, x=1) which will be cached separately.
    key = args
    if kwds:
        key += kwd_mark
        for item in kwds.items():
            key += item
    if typed:
        key += tuple(type(v) for v in args)
        if kwds:
            key += tuple(type(v) for v in kwds.values())
    elif len(key) == 1 and type(key[0]) in fasttypes:
        return key[0]
    return _HashedSeq(key)

def lru_cache(maxsize=128, typed=False):
    """Least-recently-used cache decorator.

    If *maxsize* is set to None, the LRU features are disabled and the cache
    can grow without bound.

    If *typed* is True, arguments of different types will be cached separately.
    For example, f(3.0) and f(3) will be treated as distinct calls with
    distinct results.

    Arguments to the cached function must be hashable.

    View the cache statistics named tuple (hits, misses, maxsize, currsize)
    with f.cache_info().  Clear the cache and statistics with f.cache_clear().
    Access the underlying function with f.__wrapped__.

    See:  http://en.wikipedia.org/wiki/Cache_replacement_policies#Least_recently_used_(LRU)

    """

    # Users should only access the lru_cache through its public API:
    #       cache_info, cache_clear, and f.__wrapped__
    # The internals of the lru_cache are encapsulated for thread safety and
    # to allow the implementation to change (including a possible C version).

    if isinstance(maxsize, int):
        # Negative maxsize is treated as 0
        if maxsize < 0:
            maxsize = 0
    elif callable(maxsize) and isinstance(typed, bool):
        # The user_function was passed in directly via the maxsize argument
        user_function, maxsize = maxsize, 128
        wrapper = _lru_cache_wrapper(user_function, maxsize, typed, _CacheInfo)
        return update_wrapper(wrapper, user_function)
    elif maxsize is not None:
        raise TypeError(
            'Expected first argument to be an integer, a callable, or None')

    def decorating_function(user_function):
        wrapper = _lru_cache_wrapper(user_function, maxsize, typed, _CacheInfo)
        return update_wrapper(wrapper, user_function)

    return decorating_function

def _lru_cache_wrapper(user_function, maxsize, typed, _CacheInfo):
    # Constants shared by all lru cache instances:
    sentinel = object()          # unique object used to signal cache misses
    make_key = _make_key         # build a key from the function arguments
    PREV, NEXT, KEY, RESULT = 0, 1, 2, 3   # names for the link fields

    cache = {}
    hits = misses = 0
    full = False
    cache_get = cache.get    # bound method to lookup a key or return None
    cache_len = cache.__len__  # get cache size without calling len()
    lock = RLock()           # because linkedlist updates aren't threadsafe
    root = []                # root of the circular doubly linked list
    root[:] = [root, root, None, None]     # initialize by pointing to self

    if maxsize == 0:

        def wrapper(*args, **kwds):
            # No caching -- just a statistics update
            nonlocal misses
            misses += 1
            result = user_function(*args, **kwds)
            return result

    elif maxsize is None:

        def wrapper(*args, **kwds):
            # Simple caching without ordering or size limit
            nonlocal hits, misses
            key = make_key(args, kwds, typed)
            result = cache_get(key, sentinel)
            if result is not sentinel:
                hits += 1
                return result
            misses += 1
            result = user_function(*args, **kwds)
            cache[key] = result
            return result

    else:

        def wrapper(*args, **kwds):
            # Size limited caching that tracks accesses by recency
            nonlocal root, hits, misses, full
            key = make_key(args, kwds, typed)
            with lock:
                link = cache_get(key)
                if link is not None:
                    # Move the link to the front of the circular queue
                    link_prev, link_next, _key, result = link
                    link_prev[NEXT] = link_next
                    link_next[PREV] = link_prev
                    last = root[PREV]
                    last[NEXT] = root[PREV] = link
                    link[PREV] = last
                    link[NEXT] = root
                    hits += 1
                    return result
                misses += 1
            result = user_function(*args, **kwds)
            with lock:
                if key in cache:
                    # Getting here means that this same key was added to the
                    # cache while the lock was released.  Since the link
                    # update is already done, we need only return the
                    # computed result and update the count of misses.
                    pass
                elif full:
                    # Use the old root to store the new key and result.
                    oldroot = root
                    oldroot[KEY] = key
                    oldroot[RESULT] = result
                    # Empty the oldest link and make it the new root.
                    # Keep a reference to the old key and old result to
                    # prevent their ref counts from going to zero during the
                    # update. That will prevent potentially arbitrary object
                    # clean-up code (i.e. __del__) from running while we're
                    # still adjusting the links.
                    root = oldroot[NEXT]
                    oldkey = root[KEY]
                    oldresult = root[RESULT]
                    root[KEY] = root[RESULT] = None
                    # Now update the cache dictionary.
                    del cache[oldkey]
                    # Save the potentially reentrant cache[key] assignment
                    # for last, after the root and links have been put in
                    # a consistent state.
                    cache[key] = oldroot
                else:
                    # Put result in a new link at the front of the queue.
                    last = root[PREV]
                    link = [last, root, key, result]
                    last[NEXT] = root[PREV] = cache[key] = link
                    # Use the cache_len bound method instead of the len() function
                    # which could potentially be wrapped in an lru_cache itself.
                    full = (cache_len() >= maxsize)
            return result

    def cache_info():
        """Report cache statistics"""
        with lock:
            return _CacheInfo(hits, misses, maxsize, cache_len())

    def cache_clear():
        """Clear the cache and cache statistics"""
        nonlocal hits, misses, full
        with lock:
            cache.clear()
            root[:] = [root, root, None, None]
            hits = misses = 0
            full = False

    wrapper.cache_info = cache_info
    wrapper.cache_clear = cache_clear
    return wrapper

try:
    from _functools import _lru_cache_wrapper
except ImportError:
    pass


################################################################################
### singledispatch() - single-dispatch generic function decorator
################################################################################

def _c3_merge(sequences):
    """Merges MROs in *sequences* to a single MRO using the C3 algorithm.

    Adapted from http://www.python.org/download/releases/2.3/mro/.

    """
    result = []
    while True:
        sequences = [s for s in sequences if s]   # purge empty sequences
        if not sequences:
            return result
        for s1 in sequences:   # find merge candidates among seq heads
            candidate = s1[0]
            for s2 in sequences:
                if candidate in s2[1:]:
                    candidate = None
                    break      # reject the current head, it appears later
            else:
                break
        if candidate is None:
            raise RuntimeError("Inconsistent hierarchy")
        result.append(candidate)
        # remove the chosen candidate
        for seq in sequences:
            if seq[0] == candidate:
                del seq[0]

def _c3_mro(cls, abcs=None):
    """Computes the method resolution order using extended C3 linearization.

    If no *abcs* are given, the algorithm works exactly like the built-in C3
    linearization used for method resolution.

    If given, *abcs* is a list of abstract base classes that should be inserted
    into the resulting MRO. Unrelated ABCs are ignored and don't end up in the
    result. The algorithm inserts ABCs where their functionality is introduced,
    i.e. issubclass(cls, abc) returns True for the class itself but returns
    False for all its direct base classes. Implicit ABCs for a given class
    (either registered or inferred from the presence of a special method like
    __len__) are inserted directly after the last ABC explicitly listed in the
    MRO of said class. If two implicit ABCs end up next to each other in the
    resulting MRO, their ordering depends on the order of types in *abcs*.

    """
    for i, base in enumerate(reversed(cls.__bases__)):
        if hasattr(base, '__abstractmethods__'):
            boundary = len(cls.__bases__) - i
            break   # Bases up to the last explicit ABC are considered first.
    else:
        boundary = 0
    abcs = list(abcs) if abcs else []
    explicit_bases = list(cls.__bases__[:boundary])
    abstract_bases = []
    other_bases = list(cls.__bases__[boundary:])
    for base in abcs:
        if issubclass(cls, base) and not any(
                issubclass(b, base) for b in cls.__bases__
            ):
            # If *cls* is the class that introduces behaviour described by
            # an ABC *base*, insert said ABC to its MRO.
            abstract_bases.append(base)
    for base in abstract_bases:
        abcs.remove(base)
    explicit_c3_mros = [_c3_mro(base, abcs=abcs) for base in explicit_bases]
    abstract_c3_mros = [_c3_mro(base, abcs=abcs) for base in abstract_bases]
    other_c3_mros = [_c3_mro(base, abcs=abcs) for base in other_bases]
    return _c3_merge(
        [[cls]] +
        explicit_c3_mros + abstract_c3_mros + other_c3_mros +
        [explicit_bases] + [abstract_bases] + [other_bases]
    )

def _compose_mro(cls, types):
    """Calculates the method resolution order for a given class *cls*.

    Includes relevant abstract base classes (with their respective bases) from
    the *types* iterable. Uses a modified C3 linearization algorithm.

    """
    bases = set(cls.__mro__)
    # Remove entries which are already present in the __mro__ or unrelated.
    def is_related(typ):
        return (typ not in bases and hasattr(typ, '__mro__')
                                 and issubclass(cls, typ))
    types = [n for n in types if is_related(n)]
    # Remove entries which are strict bases of other entries (they will end up
    # in the MRO anyway.
    def is_strict_base(typ):
        for other in types:
            if typ != other and typ in other.__mro__:
                return True
        return False
    types = [n for n in types if not is_strict_base(n)]
    # Subclasses of the ABCs in *types* which are also implemented by
    # *cls* can be used to stabilize ABC ordering.
    type_set = set(types)
    mro = []
    for typ in types:
        found = []
        for sub in typ.__subclasses__():
            if sub not in bases and issubclass(cls, sub):
                found.append([s for s in sub.__mro__ if s in type_set])
        if not found:
            mro.append(typ)
            continue
        # Favor subclasses with the biggest number of useful bases
        found.sort(key=len, reverse=True)
        for sub in found:
            for subcls in sub:
                if subcls not in mro:
                    mro.append(subcls)
    return _c3_mro(cls, abcs=mro)

def _find_impl(cls, registry):
    """Returns the best matching implementation from *registry* for type *cls*.

    Where there is no registered implementation for a specific type, its method
    resolution order is used to find a more generic implementation.

    Note: if *registry* does not contain an implementation for the base
    *object* type, this function may return None.

    """
    mro = _compose_mro(cls, registry.keys())
    match = None
    for t in mro:
        if match is not None:
            # If *match* is an implicit ABC but there is another unrelated,
            # equally matching implicit ABC, refuse the temptation to guess.
            if (t in registry and t not in cls.__mro__
                              and match not in cls.__mro__
                              and not issubclass(match, t)):
                raise RuntimeError("Ambiguous dispatch: {} or {}".format(
                    match, t))
            break
        if t in registry:
            match = t
    return registry.get(match)

def singledispatch(func):
    """Single-dispatch generic function decorator.

    Transforms a function into a generic function, which can have different
    behaviours depending upon the type of its first argument. The decorated
    function acts as the default implementation, and additional
    implementations can be registered using the register() attribute of the
    generic function.
    """
    # There are many programs that use functools without singledispatch, so we
    # trade-off making singledispatch marginally slower for the benefit of
    # making start-up of such applications slightly faster.
    import types, weakref

    registry = {}
    dispatch_cache = weakref.WeakKeyDictionary()
    cache_token = None

    def dispatch(cls):
        """generic_func.dispatch(cls) -> <function implementation>

        Runs the dispatch algorithm to return the best available implementation
        for the given *cls* registered on *generic_func*.

        """
        nonlocal cache_token
        if cache_token is not None:
            current_token = get_cache_token()
            if cache_token != current_token:
                dispatch_cache.clear()
                cache_token = current_token
        try:
            impl = dispatch_cache[cls]
        except KeyError:
            try:
                impl = registry[cls]
            except KeyError:
                impl = _find_impl(cls, registry)
            dispatch_cache[cls] = impl
        return impl

    def register(cls, func=None):
        """generic_func.register(cls, func) -> func

        Registers a new implementation for the given *cls* on a *generic_func*.

        """
        nonlocal cache_token
        if func is None:
            if isinstance(cls, type):
                return lambda f: register(cls, f)
            ann = getattr(cls, '__annotations__', {})
            if not ann:
                raise TypeError(
                    f"Invalid first argument to `register()`: {cls!r}. "
                    f"Use either `@register(some_class)` or plain `@register` "
                    f"on an annotated function."
                )
            func = cls

            # only import typing if annotation parsing is necessary
            from typing import get_type_hints
            argname, cls = next(iter(get_type_hints(func).items()))
            if not isinstance(cls, type):
                raise TypeError(
                    f"Invalid annotation for {argname!r}. "
                    f"{cls!r} is not a class."
                )
        registry[cls] = func
        if cache_token is None and hasattr(cls, '__abstractmethods__'):
            cache_token = get_cache_token()
        dispatch_cache.clear()
        return func

    def wrapper(*args, **kw):
        if not args:
            raise TypeError(f'{funcname} requires at least '
                            '1 positional argument')

        return dispatch(args[0].__class__)(*args, **kw)

    funcname = getattr(func, '__name__', 'singledispatch function')
    registry[object] = func
    wrapper.register = register
    wrapper.dispatch = dispatch
    wrapper.registry = types.MappingProxyType(registry)
    wrapper._clear_cache = dispatch_cache.clear
    update_wrapper(wrapper, func)
    return wrapper


# Descriptor version
class singledispatchmethod:
    """Single-dispatch generic method descriptor.

    Supports wrapping existing descriptors and handles non-descriptor
    callables as instance methods.
    """

    def __init__(self, func):
        if not callable(func) and not hasattr(func, "__get__"):
            raise TypeError(f"{func!r} is not callable or a descriptor")

        self.dispatcher = singledispatch(func)
        self.func = func

    def register(self, cls, method=None):
        """generic_method.register(cls, func) -> func

        Registers a new implementation for the given *cls* on a *generic_method*.
        """
        return self.dispatcher.register(cls, func=method)

    def __get__(self, obj, cls=None):
        def _method(*args, **kwargs):
            method = self.dispatcher.dispatch(args[0].__class__)
            return method.__get__(obj, cls)(*args, **kwargs)

        _method.__isabstractmethod__ = self.__isabstractmethod__
        _method.register = self.register
        update_wrapper(_method, self.func)
        return _method

    @property
    def __isabstractmethod__(self):
        return getattr(self.func, '__isabstractmethod__', False)


################################################################################
### cached_property() - computed once per instance, cached as attribute
################################################################################

_NOT_FOUND = object()


class cached_property:
    def __init__(self, func):
        self.func = func
        self.attrname = None
        self.__doc__ = func.__doc__
        self.lock = RLock()

    def __set_name__(self, owner, name):
        if self.attrname is None:
            self.attrname = name
        elif name != self.attrname:
            raise TypeError(
                "Cannot assign the same cached_property to two different names "
                f"({self.attrname!r} and {name!r})."
            )

    def __get__(self, instance, owner=None):
        if instance is None:
            return self
        if self.attrname is None:
            raise TypeError(
                "Cannot use cached_property instance without calling __set_name__ on it.")
        try:
            cache = instance.__dict__
        except AttributeError:  # not all objects have __dict__ (e.g. class defines slots)
            msg = (
                f"No '__dict__' attribute on {type(instance).__name__!r} "
                f"instance to cache {self.attrname!r} property."
            )
            raise TypeError(msg) from None
        val = cache.get(self.attrname, _NOT_FOUND)
        if val is _NOT_FOUND:
            with self.lock:
                # check if another thread filled cache while we awaited lock
                val = cache.get(self.attrname, _NOT_FOUND)
                if val is _NOT_FOUND:
                    val = self.func(instance)
                    try:
                        cache[self.attrname] = val
                    except TypeError:
                        msg = (
                            f"The '__dict__' attribute on {type(instance).__name__!r} instance "
                            f"does not support item assignment for caching {self.attrname!r} property."
                        )
                        raise TypeError(msg) from None
        return val
tarfile.py000075500000317751151153537470006600 0ustar00#! /usr/bin/python3.8
#-------------------------------------------------------------------
# tarfile.py
#-------------------------------------------------------------------
# Copyright (C) 2002 Lars Gustaebel <lars@gustaebel.de>
# All rights reserved.
#
# Permission  is  hereby granted,  free  of charge,  to  any person
# obtaining a  copy of  this software  and associated documentation
# files  (the  "Software"),  to   deal  in  the  Software   without
# restriction,  including  without limitation  the  rights to  use,
# copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies  of  the  Software,  and to  permit  persons  to  whom the
# Software  is  furnished  to  do  so,  subject  to  the  following
# conditions:
#
# The above copyright  notice and this  permission notice shall  be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS  IS", WITHOUT WARRANTY OF ANY  KIND,
# EXPRESS OR IMPLIED, INCLUDING  BUT NOT LIMITED TO  THE WARRANTIES
# OF  MERCHANTABILITY,  FITNESS   FOR  A  PARTICULAR   PURPOSE  AND
# NONINFRINGEMENT.  IN  NO  EVENT SHALL  THE  AUTHORS  OR COPYRIGHT
# HOLDERS  BE LIABLE  FOR ANY  CLAIM, DAMAGES  OR OTHER  LIABILITY,
# WHETHER  IN AN  ACTION OF  CONTRACT, TORT  OR OTHERWISE,  ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
#
"""Read from and write to tar format archives.
"""

version     = "0.9.0"
__author__  = "Lars Gust\u00e4bel (lars@gustaebel.de)"
__credits__ = "Gustavo Niemeyer, Niels Gust\u00e4bel, Richard Townsend."

#---------
# Imports
#---------
from builtins import open as bltn_open
import sys
import os
import io
import shutil
import stat
import time
import struct
import copy
import re
import warnings

try:
    import pwd
except ImportError:
    pwd = None
try:
    import grp
except ImportError:
    grp = None

# os.symlink on Windows prior to 6.0 raises NotImplementedError
symlink_exception = (AttributeError, NotImplementedError)
try:
    # OSError (winerror=1314) will be raised if the caller does not hold the
    # SeCreateSymbolicLinkPrivilege privilege
    symlink_exception += (OSError,)
except NameError:
    pass

# from tarfile import *
__all__ = ["TarFile", "TarInfo", "is_tarfile", "TarError", "ReadError",
           "CompressionError", "StreamError", "ExtractError", "HeaderError",
           "ENCODING", "USTAR_FORMAT", "GNU_FORMAT", "PAX_FORMAT",
           "DEFAULT_FORMAT", "open"]

# If true, use the safer (but backwards-incompatible) 'tar' extraction filter,
# rather than 'fully_trusted', by default.
# The emitted warning is changed to match.
_RH_SAFER_DEFAULT = True

# System-wide configuration file
_CONFIG_FILENAME = '/etc/python/tarfile.cfg'

#---------------------------------------------------------
# tar constants
#---------------------------------------------------------
NUL = b"\0"                     # the null character
BLOCKSIZE = 512                 # length of processing blocks
RECORDSIZE = BLOCKSIZE * 20     # length of records
GNU_MAGIC = b"ustar  \0"        # magic gnu tar string
POSIX_MAGIC = b"ustar\x0000"    # magic posix tar string

LENGTH_NAME = 100               # maximum length of a filename
LENGTH_LINK = 100               # maximum length of a linkname
LENGTH_PREFIX = 155             # maximum length of the prefix field

REGTYPE = b"0"                  # regular file
AREGTYPE = b"\0"                # regular file
LNKTYPE = b"1"                  # link (inside tarfile)
SYMTYPE = b"2"                  # symbolic link
CHRTYPE = b"3"                  # character special device
BLKTYPE = b"4"                  # block special device
DIRTYPE = b"5"                  # directory
FIFOTYPE = b"6"                 # fifo special device
CONTTYPE = b"7"                 # contiguous file

GNUTYPE_LONGNAME = b"L"         # GNU tar longname
GNUTYPE_LONGLINK = b"K"         # GNU tar longlink
GNUTYPE_SPARSE = b"S"           # GNU tar sparse file

XHDTYPE = b"x"                  # POSIX.1-2001 extended header
XGLTYPE = b"g"                  # POSIX.1-2001 global header
SOLARIS_XHDTYPE = b"X"          # Solaris extended header

USTAR_FORMAT = 0                # POSIX.1-1988 (ustar) format
GNU_FORMAT = 1                  # GNU tar format
PAX_FORMAT = 2                  # POSIX.1-2001 (pax) format
DEFAULT_FORMAT = PAX_FORMAT

#---------------------------------------------------------
# tarfile constants
#---------------------------------------------------------
# File types that tarfile supports:
SUPPORTED_TYPES = (REGTYPE, AREGTYPE, LNKTYPE,
                   SYMTYPE, DIRTYPE, FIFOTYPE,
                   CONTTYPE, CHRTYPE, BLKTYPE,
                   GNUTYPE_LONGNAME, GNUTYPE_LONGLINK,
                   GNUTYPE_SPARSE)

# File types that will be treated as a regular file.
REGULAR_TYPES = (REGTYPE, AREGTYPE,
                 CONTTYPE, GNUTYPE_SPARSE)

# File types that are part of the GNU tar format.
GNU_TYPES = (GNUTYPE_LONGNAME, GNUTYPE_LONGLINK,
             GNUTYPE_SPARSE)

# Fields from a pax header that override a TarInfo attribute.
PAX_FIELDS = ("path", "linkpath", "size", "mtime",
              "uid", "gid", "uname", "gname")

# Fields from a pax header that are affected by hdrcharset.
PAX_NAME_FIELDS = {"path", "linkpath", "uname", "gname"}

# Fields in a pax header that are numbers, all other fields
# are treated as strings.
PAX_NUMBER_FIELDS = {
    "atime": float,
    "ctime": float,
    "mtime": float,
    "uid": int,
    "gid": int,
    "size": int
}

#---------------------------------------------------------
# initialization
#---------------------------------------------------------
if os.name == "nt":
    ENCODING = "utf-8"
else:
    ENCODING = sys.getfilesystemencoding()

#---------------------------------------------------------
# Some useful functions
#---------------------------------------------------------

def stn(s, length, encoding, errors):
    """Convert a string to a null-terminated bytes object.
    """
    if s is None:
        raise ValueError("metadata cannot contain None")
    s = s.encode(encoding, errors)
    return s[:length] + (length - len(s)) * NUL

def nts(s, encoding, errors):
    """Convert a null-terminated bytes object to a string.
    """
    p = s.find(b"\0")
    if p != -1:
        s = s[:p]
    return s.decode(encoding, errors)

def nti(s):
    """Convert a number field to a python number.
    """
    # There are two possible encodings for a number field, see
    # itn() below.
    if s[0] in (0o200, 0o377):
        n = 0
        for i in range(len(s) - 1):
            n <<= 8
            n += s[i + 1]
        if s[0] == 0o377:
            n = -(256 ** (len(s) - 1) - n)
    else:
        try:
            s = nts(s, "ascii", "strict")
            n = int(s.strip() or "0", 8)
        except ValueError:
            raise InvalidHeaderError("invalid header")
    return n

def itn(n, digits=8, format=DEFAULT_FORMAT):
    """Convert a python number to a number field.
    """
    # POSIX 1003.1-1988 requires numbers to be encoded as a string of
    # octal digits followed by a null-byte, this allows values up to
    # (8**(digits-1))-1. GNU tar allows storing numbers greater than
    # that if necessary. A leading 0o200 or 0o377 byte indicate this
    # particular encoding, the following digits-1 bytes are a big-endian
    # base-256 representation. This allows values up to (256**(digits-1))-1.
    # A 0o200 byte indicates a positive number, a 0o377 byte a negative
    # number.
    n = int(n)
    if 0 <= n < 8 ** (digits - 1):
        s = bytes("%0*o" % (digits - 1, n), "ascii") + NUL
    elif format == GNU_FORMAT and -256 ** (digits - 1) <= n < 256 ** (digits - 1):
        if n >= 0:
            s = bytearray([0o200])
        else:
            s = bytearray([0o377])
            n = 256 ** digits + n

        for i in range(digits - 1):
            s.insert(1, n & 0o377)
            n >>= 8
    else:
        raise ValueError("overflow in number field")

    return s

def calc_chksums(buf):
    """Calculate the checksum for a member's header by summing up all
       characters except for the chksum field which is treated as if
       it was filled with spaces. According to the GNU tar sources,
       some tars (Sun and NeXT) calculate chksum with signed char,
       which will be different if there are chars in the buffer with
       the high bit set. So we calculate two checksums, unsigned and
       signed.
    """
    unsigned_chksum = 256 + sum(struct.unpack_from("148B8x356B", buf))
    signed_chksum = 256 + sum(struct.unpack_from("148b8x356b", buf))
    return unsigned_chksum, signed_chksum

def copyfileobj(src, dst, length=None, exception=OSError, bufsize=None):
    """Copy length bytes from fileobj src to fileobj dst.
       If length is None, copy the entire content.
    """
    bufsize = bufsize or 16 * 1024
    if length == 0:
        return
    if length is None:
        shutil.copyfileobj(src, dst, bufsize)
        return

    blocks, remainder = divmod(length, bufsize)
    for b in range(blocks):
        buf = src.read(bufsize)
        if len(buf) < bufsize:
            raise exception("unexpected end of data")
        dst.write(buf)

    if remainder != 0:
        buf = src.read(remainder)
        if len(buf) < remainder:
            raise exception("unexpected end of data")
        dst.write(buf)
    return

def _safe_print(s):
    encoding = getattr(sys.stdout, 'encoding', None)
    if encoding is not None:
        s = s.encode(encoding, 'backslashreplace').decode(encoding)
    print(s, end=' ')


class TarError(Exception):
    """Base exception."""
    pass
class ExtractError(TarError):
    """General exception for extract errors."""
    pass
class ReadError(TarError):
    """Exception for unreadable tar archives."""
    pass
class CompressionError(TarError):
    """Exception for unavailable compression methods."""
    pass
class StreamError(TarError):
    """Exception for unsupported operations on stream-like TarFiles."""
    pass
class HeaderError(TarError):
    """Base exception for header errors."""
    pass
class EmptyHeaderError(HeaderError):
    """Exception for empty headers."""
    pass
class TruncatedHeaderError(HeaderError):
    """Exception for truncated headers."""
    pass
class EOFHeaderError(HeaderError):
    """Exception for end of file headers."""
    pass
class InvalidHeaderError(HeaderError):
    """Exception for invalid headers."""
    pass
class SubsequentHeaderError(HeaderError):
    """Exception for missing and invalid extended headers."""
    pass

#---------------------------
# internal stream interface
#---------------------------
class _LowLevelFile:
    """Low-level file object. Supports reading and writing.
       It is used instead of a regular file object for streaming
       access.
    """

    def __init__(self, name, mode):
        mode = {
            "r": os.O_RDONLY,
            "w": os.O_WRONLY | os.O_CREAT | os.O_TRUNC,
        }[mode]
        if hasattr(os, "O_BINARY"):
            mode |= os.O_BINARY
        self.fd = os.open(name, mode, 0o666)

    def close(self):
        os.close(self.fd)

    def read(self, size):
        return os.read(self.fd, size)

    def write(self, s):
        os.write(self.fd, s)

class _Stream:
    """Class that serves as an adapter between TarFile and
       a stream-like object.  The stream-like object only
       needs to have a read() or write() method and is accessed
       blockwise.  Use of gzip or bzip2 compression is possible.
       A stream-like object could be for example: sys.stdin,
       sys.stdout, a socket, a tape device etc.

       _Stream is intended to be used only internally.
    """

    def __init__(self, name, mode, comptype, fileobj, bufsize):
        """Construct a _Stream object.
        """
        self._extfileobj = True
        if fileobj is None:
            fileobj = _LowLevelFile(name, mode)
            self._extfileobj = False

        if comptype == '*':
            # Enable transparent compression detection for the
            # stream interface
            fileobj = _StreamProxy(fileobj)
            comptype = fileobj.getcomptype()

        self.name     = name or ""
        self.mode     = mode
        self.comptype = comptype
        self.fileobj  = fileobj
        self.bufsize  = bufsize
        self.buf      = b""
        self.pos      = 0
        self.closed   = False

        try:
            if comptype == "gz":
                try:
                    import zlib
                except ImportError:
                    raise CompressionError("zlib module is not available")
                self.zlib = zlib
                self.crc = zlib.crc32(b"")
                if mode == "r":
                    self._init_read_gz()
                    self.exception = zlib.error
                else:
                    self._init_write_gz()

            elif comptype == "bz2":
                try:
                    import bz2
                except ImportError:
                    raise CompressionError("bz2 module is not available")
                if mode == "r":
                    self.dbuf = b""
                    self.cmp = bz2.BZ2Decompressor()
                    self.exception = OSError
                else:
                    self.cmp = bz2.BZ2Compressor()

            elif comptype == "xz":
                try:
                    import lzma
                except ImportError:
                    raise CompressionError("lzma module is not available")
                if mode == "r":
                    self.dbuf = b""
                    self.cmp = lzma.LZMADecompressor()
                    self.exception = lzma.LZMAError
                else:
                    self.cmp = lzma.LZMACompressor()

            elif comptype != "tar":
                raise CompressionError("unknown compression type %r" % comptype)

        except:
            if not self._extfileobj:
                self.fileobj.close()
            self.closed = True
            raise

    def __del__(self):
        if hasattr(self, "closed") and not self.closed:
            self.close()

    def _init_write_gz(self):
        """Initialize for writing with gzip compression.
        """
        self.cmp = self.zlib.compressobj(9, self.zlib.DEFLATED,
                                            -self.zlib.MAX_WBITS,
                                            self.zlib.DEF_MEM_LEVEL,
                                            0)
        timestamp = struct.pack("<L", int(time.time()))
        self.__write(b"\037\213\010\010" + timestamp + b"\002\377")
        if self.name.endswith(".gz"):
            self.name = self.name[:-3]
        # Honor "directory components removed" from RFC1952
        self.name = os.path.basename(self.name)
        # RFC1952 says we must use ISO-8859-1 for the FNAME field.
        self.__write(self.name.encode("iso-8859-1", "replace") + NUL)

    def write(self, s):
        """Write string s to the stream.
        """
        if self.comptype == "gz":
            self.crc = self.zlib.crc32(s, self.crc)
        self.pos += len(s)
        if self.comptype != "tar":
            s = self.cmp.compress(s)
        self.__write(s)

    def __write(self, s):
        """Write string s to the stream if a whole new block
           is ready to be written.
        """
        self.buf += s
        while len(self.buf) > self.bufsize:
            self.fileobj.write(self.buf[:self.bufsize])
            self.buf = self.buf[self.bufsize:]

    def close(self):
        """Close the _Stream object. No operation should be
           done on it afterwards.
        """
        if self.closed:
            return

        self.closed = True
        try:
            if self.mode == "w" and self.comptype != "tar":
                self.buf += self.cmp.flush()

            if self.mode == "w" and self.buf:
                self.fileobj.write(self.buf)
                self.buf = b""
                if self.comptype == "gz":
                    self.fileobj.write(struct.pack("<L", self.crc))
                    self.fileobj.write(struct.pack("<L", self.pos & 0xffffFFFF))
        finally:
            if not self._extfileobj:
                self.fileobj.close()

    def _init_read_gz(self):
        """Initialize for reading a gzip compressed fileobj.
        """
        self.cmp = self.zlib.decompressobj(-self.zlib.MAX_WBITS)
        self.dbuf = b""

        # taken from gzip.GzipFile with some alterations
        if self.__read(2) != b"\037\213":
            raise ReadError("not a gzip file")
        if self.__read(1) != b"\010":
            raise CompressionError("unsupported compression method")

        flag = ord(self.__read(1))
        self.__read(6)

        if flag & 4:
            xlen = ord(self.__read(1)) + 256 * ord(self.__read(1))
            self.read(xlen)
        if flag & 8:
            while True:
                s = self.__read(1)
                if not s or s == NUL:
                    break
        if flag & 16:
            while True:
                s = self.__read(1)
                if not s or s == NUL:
                    break
        if flag & 2:
            self.__read(2)

    def tell(self):
        """Return the stream's file pointer position.
        """
        return self.pos

    def seek(self, pos=0):
        """Set the stream's file pointer to pos. Negative seeking
           is forbidden.
        """
        if pos - self.pos >= 0:
            blocks, remainder = divmod(pos - self.pos, self.bufsize)
            for i in range(blocks):
                self.read(self.bufsize)
            self.read(remainder)
        else:
            raise StreamError("seeking backwards is not allowed")
        return self.pos

    def read(self, size):
        """Return the next size number of bytes from the stream."""
        assert size is not None
        buf = self._read(size)
        self.pos += len(buf)
        return buf

    def _read(self, size):
        """Return size bytes from the stream.
        """
        if self.comptype == "tar":
            return self.__read(size)

        c = len(self.dbuf)
        t = [self.dbuf]
        while c < size:
            # Skip underlying buffer to avoid unaligned double buffering.
            if self.buf:
                buf = self.buf
                self.buf = b""
            else:
                buf = self.fileobj.read(self.bufsize)
                if not buf:
                    break
            try:
                buf = self.cmp.decompress(buf)
            except self.exception:
                raise ReadError("invalid compressed data")
            t.append(buf)
            c += len(buf)
        t = b"".join(t)
        self.dbuf = t[size:]
        return t[:size]

    def __read(self, size):
        """Return size bytes from stream. If internal buffer is empty,
           read another block from the stream.
        """
        c = len(self.buf)
        t = [self.buf]
        while c < size:
            buf = self.fileobj.read(self.bufsize)
            if not buf:
                break
            t.append(buf)
            c += len(buf)
        t = b"".join(t)
        self.buf = t[size:]
        return t[:size]
# class _Stream

class _StreamProxy(object):
    """Small proxy class that enables transparent compression
       detection for the Stream interface (mode 'r|*').
    """

    def __init__(self, fileobj):
        self.fileobj = fileobj
        self.buf = self.fileobj.read(BLOCKSIZE)

    def read(self, size):
        self.read = self.fileobj.read
        return self.buf

    def getcomptype(self):
        if self.buf.startswith(b"\x1f\x8b\x08"):
            return "gz"
        elif self.buf[0:3] == b"BZh" and self.buf[4:10] == b"1AY&SY":
            return "bz2"
        elif self.buf.startswith((b"\x5d\x00\x00\x80", b"\xfd7zXZ")):
            return "xz"
        else:
            return "tar"

    def close(self):
        self.fileobj.close()
# class StreamProxy

#------------------------
# Extraction file object
#------------------------
class _FileInFile(object):
    """A thin wrapper around an existing file object that
       provides a part of its data as an individual file
       object.
    """

    def __init__(self, fileobj, offset, size, blockinfo=None):
        self.fileobj = fileobj
        self.offset = offset
        self.size = size
        self.position = 0
        self.name = getattr(fileobj, "name", None)
        self.closed = False

        if blockinfo is None:
            blockinfo = [(0, size)]

        # Construct a map with data and zero blocks.
        self.map_index = 0
        self.map = []
        lastpos = 0
        realpos = self.offset
        for offset, size in blockinfo:
            if offset > lastpos:
                self.map.append((False, lastpos, offset, None))
            self.map.append((True, offset, offset + size, realpos))
            realpos += size
            lastpos = offset + size
        if lastpos < self.size:
            self.map.append((False, lastpos, self.size, None))

    def flush(self):
        pass

    def readable(self):
        return True

    def writable(self):
        return False

    def seekable(self):
        return self.fileobj.seekable()

    def tell(self):
        """Return the current file position.
        """
        return self.position

    def seek(self, position, whence=io.SEEK_SET):
        """Seek to a position in the file.
        """
        if whence == io.SEEK_SET:
            self.position = min(max(position, 0), self.size)
        elif whence == io.SEEK_CUR:
            if position < 0:
                self.position = max(self.position + position, 0)
            else:
                self.position = min(self.position + position, self.size)
        elif whence == io.SEEK_END:
            self.position = max(min(self.size + position, self.size), 0)
        else:
            raise ValueError("Invalid argument")
        return self.position

    def read(self, size=None):
        """Read data from the file.
        """
        if size is None:
            size = self.size - self.position
        else:
            size = min(size, self.size - self.position)

        buf = b""
        while size > 0:
            while True:
                data, start, stop, offset = self.map[self.map_index]
                if start <= self.position < stop:
                    break
                else:
                    self.map_index += 1
                    if self.map_index == len(self.map):
                        self.map_index = 0
            length = min(size, stop - self.position)
            if data:
                self.fileobj.seek(offset + (self.position - start))
                b = self.fileobj.read(length)
                if len(b) != length:
                    raise ReadError("unexpected end of data")
                buf += b
            else:
                buf += NUL * length
            size -= length
            self.position += length
        return buf

    def readinto(self, b):
        buf = self.read(len(b))
        b[:len(buf)] = buf
        return len(buf)

    def close(self):
        self.closed = True
#class _FileInFile

class ExFileObject(io.BufferedReader):

    def __init__(self, tarfile, tarinfo):
        fileobj = _FileInFile(tarfile.fileobj, tarinfo.offset_data,
                tarinfo.size, tarinfo.sparse)
        super().__init__(fileobj)
#class ExFileObject


#-----------------------------
# extraction filters (PEP 706)
#-----------------------------

class FilterError(TarError):
    pass

class AbsolutePathError(FilterError):
    def __init__(self, tarinfo):
        self.tarinfo = tarinfo
        super().__init__(f'member {tarinfo.name!r} has an absolute path')

class OutsideDestinationError(FilterError):
    def __init__(self, tarinfo, path):
        self.tarinfo = tarinfo
        self._path = path
        super().__init__(f'{tarinfo.name!r} would be extracted to {path!r}, '
                         + 'which is outside the destination')

class SpecialFileError(FilterError):
    def __init__(self, tarinfo):
        self.tarinfo = tarinfo
        super().__init__(f'{tarinfo.name!r} is a special file')

class AbsoluteLinkError(FilterError):
    def __init__(self, tarinfo):
        self.tarinfo = tarinfo
        super().__init__(f'{tarinfo.name!r} is a symlink to an absolute path')

class LinkOutsideDestinationError(FilterError):
    def __init__(self, tarinfo, path):
        self.tarinfo = tarinfo
        self._path = path
        super().__init__(f'{tarinfo.name!r} would link to {path!r}, '
                         + 'which is outside the destination')

def _get_filtered_attrs(member, dest_path, for_data=True):
    new_attrs = {}
    name = member.name
    dest_path = os.path.realpath(dest_path)
    # Strip leading / (tar's directory separator) from filenames.
    # Include os.sep (target OS directory separator) as well.
    if name.startswith(('/', os.sep)):
        name = new_attrs['name'] = member.path.lstrip('/' + os.sep)
    if os.path.isabs(name):
        # Path is absolute even after stripping.
        # For example, 'C:/foo' on Windows.
        raise AbsolutePathError(member)
    # Ensure we stay in the destination
    target_path = os.path.realpath(os.path.join(dest_path, name))
    if os.path.commonpath([target_path, dest_path]) != dest_path:
        raise OutsideDestinationError(member, target_path)
    # Limit permissions (no high bits, and go-w)
    mode = member.mode
    if mode is not None:
        # Strip high bits & group/other write bits
        mode = mode & 0o755
        if for_data:
            # For data, handle permissions & file types
            if member.isreg() or member.islnk():
                if not mode & 0o100:
                    # Clear executable bits if not executable by user
                    mode &= ~0o111
                # Ensure owner can read & write
                mode |= 0o600
            elif member.isdir() or member.issym():
                # Ignore mode for directories & symlinks
                mode = None
            else:
                # Reject special files
                raise SpecialFileError(member)
        if mode != member.mode:
            new_attrs['mode'] = mode
    if for_data:
        # Ignore ownership for 'data'
        if member.uid is not None:
            new_attrs['uid'] = None
        if member.gid is not None:
            new_attrs['gid'] = None
        if member.uname is not None:
            new_attrs['uname'] = None
        if member.gname is not None:
            new_attrs['gname'] = None
        # Check link destination for 'data'
        if member.islnk() or member.issym():
            if os.path.isabs(member.linkname):
                raise AbsoluteLinkError(member)
            if member.issym():
                target_path = os.path.join(dest_path,
                                           os.path.dirname(name),
                                           member.linkname)
            else:
                target_path = os.path.join(dest_path,
                                           member.linkname)
            target_path = os.path.realpath(target_path)
            if os.path.commonpath([target_path, dest_path]) != dest_path:
                raise LinkOutsideDestinationError(member, target_path)
    return new_attrs

def fully_trusted_filter(member, dest_path):
    return member

def tar_filter(member, dest_path):
    new_attrs = _get_filtered_attrs(member, dest_path, False)
    if new_attrs:
        return member.replace(**new_attrs, deep=False)
    return member

def data_filter(member, dest_path):
    new_attrs = _get_filtered_attrs(member, dest_path, True)
    if new_attrs:
        return member.replace(**new_attrs, deep=False)
    return member

_NAMED_FILTERS = {
    "fully_trusted": fully_trusted_filter,
    "tar": tar_filter,
    "data": data_filter,
}

#------------------
# Exported Classes
#------------------

# Sentinel for replace() defaults, meaning "don't change the attribute"
_KEEP = object()

class TarInfo(object):
    """Informational class which holds the details about an
       archive member given by a tar header block.
       TarInfo objects are returned by TarFile.getmember(),
       TarFile.getmembers() and TarFile.gettarinfo() and are
       usually created internally.
    """

    __slots__ = dict(
        name = 'Name of the archive member.',
        mode = 'Permission bits.',
        uid = 'User ID of the user who originally stored this member.',
        gid = 'Group ID of the user who originally stored this member.',
        size = 'Size in bytes.',
        mtime = 'Time of last modification.',
        chksum = 'Header checksum.',
        type = ('File type. type is usually one of these constants: '
                'REGTYPE, AREGTYPE, LNKTYPE, SYMTYPE, DIRTYPE, FIFOTYPE, '
                'CONTTYPE, CHRTYPE, BLKTYPE, GNUTYPE_SPARSE.'),
        linkname = ('Name of the target file name, which is only present '
                    'in TarInfo objects of type LNKTYPE and SYMTYPE.'),
        uname = 'User name.',
        gname = 'Group name.',
        devmajor = 'Device major number.',
        devminor = 'Device minor number.',
        offset = 'The tar header starts here.',
        offset_data = "The file's data starts here.",
        pax_headers = ('A dictionary containing key-value pairs of an '
                       'associated pax extended header.'),
        sparse = 'Sparse member information.',
        tarfile = None,
        _sparse_structs = None,
        _link_target = None,
        )

    def __init__(self, name=""):
        """Construct a TarInfo object. name is the optional name
           of the member.
        """
        self.name = name        # member name
        self.mode = 0o644       # file permissions
        self.uid = 0            # user id
        self.gid = 0            # group id
        self.size = 0           # file size
        self.mtime = 0          # modification time
        self.chksum = 0         # header checksum
        self.type = REGTYPE     # member type
        self.linkname = ""      # link name
        self.uname = ""         # user name
        self.gname = ""         # group name
        self.devmajor = 0       # device major number
        self.devminor = 0       # device minor number

        self.offset = 0         # the tar header starts here
        self.offset_data = 0    # the file's data starts here

        self.sparse = None      # sparse member information
        self.pax_headers = {}   # pax header information

    @property
    def path(self):
        'In pax headers, "name" is called "path".'
        return self.name

    @path.setter
    def path(self, name):
        self.name = name

    @property
    def linkpath(self):
        'In pax headers, "linkname" is called "linkpath".'
        return self.linkname

    @linkpath.setter
    def linkpath(self, linkname):
        self.linkname = linkname

    def __repr__(self):
        return "<%s %r at %#x>" % (self.__class__.__name__,self.name,id(self))

    def replace(self, *,
                name=_KEEP, mtime=_KEEP, mode=_KEEP, linkname=_KEEP,
                uid=_KEEP, gid=_KEEP, uname=_KEEP, gname=_KEEP,
                deep=True, _KEEP=_KEEP):
        """Return a deep copy of self with the given attributes replaced.
        """
        if deep:
            result = copy.deepcopy(self)
        else:
            result = copy.copy(self)
        if name is not _KEEP:
            result.name = name
        if mtime is not _KEEP:
            result.mtime = mtime
        if mode is not _KEEP:
            result.mode = mode
        if linkname is not _KEEP:
            result.linkname = linkname
        if uid is not _KEEP:
            result.uid = uid
        if gid is not _KEEP:
            result.gid = gid
        if uname is not _KEEP:
            result.uname = uname
        if gname is not _KEEP:
            result.gname = gname
        return result

    def get_info(self):
        """Return the TarInfo's attributes as a dictionary.
        """
        if self.mode is None:
            mode = None
        else:
            mode = self.mode & 0o7777
        info = {
            "name":     self.name,
            "mode":     mode,
            "uid":      self.uid,
            "gid":      self.gid,
            "size":     self.size,
            "mtime":    self.mtime,
            "chksum":   self.chksum,
            "type":     self.type,
            "linkname": self.linkname,
            "uname":    self.uname,
            "gname":    self.gname,
            "devmajor": self.devmajor,
            "devminor": self.devminor
        }

        if info["type"] == DIRTYPE and not info["name"].endswith("/"):
            info["name"] += "/"

        return info

    def tobuf(self, format=DEFAULT_FORMAT, encoding=ENCODING, errors="surrogateescape"):
        """Return a tar header as a string of 512 byte blocks.
        """
        info = self.get_info()
        for name, value in info.items():
            if value is None:
                raise ValueError("%s may not be None" % name)

        if format == USTAR_FORMAT:
            return self.create_ustar_header(info, encoding, errors)
        elif format == GNU_FORMAT:
            return self.create_gnu_header(info, encoding, errors)
        elif format == PAX_FORMAT:
            return self.create_pax_header(info, encoding)
        else:
            raise ValueError("invalid format")

    def create_ustar_header(self, info, encoding, errors):
        """Return the object as a ustar header block.
        """
        info["magic"] = POSIX_MAGIC

        if len(info["linkname"].encode(encoding, errors)) > LENGTH_LINK:
            raise ValueError("linkname is too long")

        if len(info["name"].encode(encoding, errors)) > LENGTH_NAME:
            info["prefix"], info["name"] = self._posix_split_name(info["name"], encoding, errors)

        return self._create_header(info, USTAR_FORMAT, encoding, errors)

    def create_gnu_header(self, info, encoding, errors):
        """Return the object as a GNU header block sequence.
        """
        info["magic"] = GNU_MAGIC

        buf = b""
        if len(info["linkname"].encode(encoding, errors)) > LENGTH_LINK:
            buf += self._create_gnu_long_header(info["linkname"], GNUTYPE_LONGLINK, encoding, errors)

        if len(info["name"].encode(encoding, errors)) > LENGTH_NAME:
            buf += self._create_gnu_long_header(info["name"], GNUTYPE_LONGNAME, encoding, errors)

        return buf + self._create_header(info, GNU_FORMAT, encoding, errors)

    def create_pax_header(self, info, encoding):
        """Return the object as a ustar header block. If it cannot be
           represented this way, prepend a pax extended header sequence
           with supplement information.
        """
        info["magic"] = POSIX_MAGIC
        pax_headers = self.pax_headers.copy()

        # Test string fields for values that exceed the field length or cannot
        # be represented in ASCII encoding.
        for name, hname, length in (
                ("name", "path", LENGTH_NAME), ("linkname", "linkpath", LENGTH_LINK),
                ("uname", "uname", 32), ("gname", "gname", 32)):

            if hname in pax_headers:
                # The pax header has priority.
                continue

            # Try to encode the string as ASCII.
            try:
                info[name].encode("ascii", "strict")
            except UnicodeEncodeError:
                pax_headers[hname] = info[name]
                continue

            if len(info[name]) > length:
                pax_headers[hname] = info[name]

        # Test number fields for values that exceed the field limit or values
        # that like to be stored as float.
        for name, digits in (("uid", 8), ("gid", 8), ("size", 12), ("mtime", 12)):
            if name in pax_headers:
                # The pax header has priority. Avoid overflow.
                info[name] = 0
                continue

            val = info[name]
            if not 0 <= val < 8 ** (digits - 1) or isinstance(val, float):
                pax_headers[name] = str(val)
                info[name] = 0

        # Create a pax extended header if necessary.
        if pax_headers:
            buf = self._create_pax_generic_header(pax_headers, XHDTYPE, encoding)
        else:
            buf = b""

        return buf + self._create_header(info, USTAR_FORMAT, "ascii", "replace")

    @classmethod
    def create_pax_global_header(cls, pax_headers):
        """Return the object as a pax global header block sequence.
        """
        return cls._create_pax_generic_header(pax_headers, XGLTYPE, "utf-8")

    def _posix_split_name(self, name, encoding, errors):
        """Split a name longer than 100 chars into a prefix
           and a name part.
        """
        components = name.split("/")
        for i in range(1, len(components)):
            prefix = "/".join(components[:i])
            name = "/".join(components[i:])
            if len(prefix.encode(encoding, errors)) <= LENGTH_PREFIX and \
                    len(name.encode(encoding, errors)) <= LENGTH_NAME:
                break
        else:
            raise ValueError("name is too long")

        return prefix, name

    @staticmethod
    def _create_header(info, format, encoding, errors):
        """Return a header block. info is a dictionary with file
           information, format must be one of the *_FORMAT constants.
        """
        has_device_fields = info.get("type") in (CHRTYPE, BLKTYPE)
        if has_device_fields:
            devmajor = itn(info.get("devmajor", 0), 8, format)
            devminor = itn(info.get("devminor", 0), 8, format)
        else:
            devmajor = stn("", 8, encoding, errors)
            devminor = stn("", 8, encoding, errors)

        # None values in metadata should cause ValueError.
        # itn()/stn() do this for all fields except type.
        filetype = info.get("type", REGTYPE)
        if filetype is None:
            raise ValueError("TarInfo.type must not be None")

        parts = [
            stn(info.get("name", ""), 100, encoding, errors),
            itn(info.get("mode", 0) & 0o7777, 8, format),
            itn(info.get("uid", 0), 8, format),
            itn(info.get("gid", 0), 8, format),
            itn(info.get("size", 0), 12, format),
            itn(info.get("mtime", 0), 12, format),
            b"        ", # checksum field
            filetype,
            stn(info.get("linkname", ""), 100, encoding, errors),
            info.get("magic", POSIX_MAGIC),
            stn(info.get("uname", ""), 32, encoding, errors),
            stn(info.get("gname", ""), 32, encoding, errors),
            itn(info.get("devmajor", 0), 8, format),
            itn(info.get("devminor", 0), 8, format),
            stn(info.get("prefix", ""), 155, encoding, errors)
        ]

        buf = struct.pack("%ds" % BLOCKSIZE, b"".join(parts))
        chksum = calc_chksums(buf[-BLOCKSIZE:])[0]
        buf = buf[:-364] + bytes("%06o\0" % chksum, "ascii") + buf[-357:]
        return buf

    @staticmethod
    def _create_payload(payload):
        """Return the string payload filled with zero bytes
           up to the next 512 byte border.
        """
        blocks, remainder = divmod(len(payload), BLOCKSIZE)
        if remainder > 0:
            payload += (BLOCKSIZE - remainder) * NUL
        return payload

    @classmethod
    def _create_gnu_long_header(cls, name, type, encoding, errors):
        """Return a GNUTYPE_LONGNAME or GNUTYPE_LONGLINK sequence
           for name.
        """
        name = name.encode(encoding, errors) + NUL

        info = {}
        info["name"] = "././@LongLink"
        info["type"] = type
        info["size"] = len(name)
        info["magic"] = GNU_MAGIC

        # create extended header + name blocks.
        return cls._create_header(info, USTAR_FORMAT, encoding, errors) + \
                cls._create_payload(name)

    @classmethod
    def _create_pax_generic_header(cls, pax_headers, type, encoding):
        """Return a POSIX.1-2008 extended or global header sequence
           that contains a list of keyword, value pairs. The values
           must be strings.
        """
        # Check if one of the fields contains surrogate characters and thereby
        # forces hdrcharset=BINARY, see _proc_pax() for more information.
        binary = False
        for keyword, value in pax_headers.items():
            try:
                value.encode("utf-8", "strict")
            except UnicodeEncodeError:
                binary = True
                break

        records = b""
        if binary:
            # Put the hdrcharset field at the beginning of the header.
            records += b"21 hdrcharset=BINARY\n"

        for keyword, value in pax_headers.items():
            keyword = keyword.encode("utf-8")
            if binary:
                # Try to restore the original byte representation of `value'.
                # Needless to say, that the encoding must match the string.
                value = value.encode(encoding, "surrogateescape")
            else:
                value = value.encode("utf-8")

            l = len(keyword) + len(value) + 3   # ' ' + '=' + '\n'
            n = p = 0
            while True:
                n = l + len(str(p))
                if n == p:
                    break
                p = n
            records += bytes(str(p), "ascii") + b" " + keyword + b"=" + value + b"\n"

        # We use a hardcoded "././@PaxHeader" name like star does
        # instead of the one that POSIX recommends.
        info = {}
        info["name"] = "././@PaxHeader"
        info["type"] = type
        info["size"] = len(records)
        info["magic"] = POSIX_MAGIC

        # Create pax header + record blocks.
        return cls._create_header(info, USTAR_FORMAT, "ascii", "replace") + \
                cls._create_payload(records)

    @classmethod
    def frombuf(cls, buf, encoding, errors):
        """Construct a TarInfo object from a 512 byte bytes object.
        """
        if len(buf) == 0:
            raise EmptyHeaderError("empty header")
        if len(buf) != BLOCKSIZE:
            raise TruncatedHeaderError("truncated header")
        if buf.count(NUL) == BLOCKSIZE:
            raise EOFHeaderError("end of file header")

        chksum = nti(buf[148:156])
        if chksum not in calc_chksums(buf):
            raise InvalidHeaderError("bad checksum")

        obj = cls()
        obj.name = nts(buf[0:100], encoding, errors)
        obj.mode = nti(buf[100:108])
        obj.uid = nti(buf[108:116])
        obj.gid = nti(buf[116:124])
        obj.size = nti(buf[124:136])
        obj.mtime = nti(buf[136:148])
        obj.chksum = chksum
        obj.type = buf[156:157]
        obj.linkname = nts(buf[157:257], encoding, errors)
        obj.uname = nts(buf[265:297], encoding, errors)
        obj.gname = nts(buf[297:329], encoding, errors)
        obj.devmajor = nti(buf[329:337])
        obj.devminor = nti(buf[337:345])
        prefix = nts(buf[345:500], encoding, errors)

        # Old V7 tar format represents a directory as a regular
        # file with a trailing slash.
        if obj.type == AREGTYPE and obj.name.endswith("/"):
            obj.type = DIRTYPE

        # The old GNU sparse format occupies some of the unused
        # space in the buffer for up to 4 sparse structures.
        # Save them for later processing in _proc_sparse().
        if obj.type == GNUTYPE_SPARSE:
            pos = 386
            structs = []
            for i in range(4):
                try:
                    offset = nti(buf[pos:pos + 12])
                    numbytes = nti(buf[pos + 12:pos + 24])
                except ValueError:
                    break
                structs.append((offset, numbytes))
                pos += 24
            isextended = bool(buf[482])
            origsize = nti(buf[483:495])
            obj._sparse_structs = (structs, isextended, origsize)

        # Remove redundant slashes from directories.
        if obj.isdir():
            obj.name = obj.name.rstrip("/")

        # Reconstruct a ustar longname.
        if prefix and obj.type not in GNU_TYPES:
            obj.name = prefix + "/" + obj.name
        return obj

    @classmethod
    def fromtarfile(cls, tarfile):
        """Return the next TarInfo object from TarFile object
           tarfile.
        """
        buf = tarfile.fileobj.read(BLOCKSIZE)
        obj = cls.frombuf(buf, tarfile.encoding, tarfile.errors)
        obj.offset = tarfile.fileobj.tell() - BLOCKSIZE
        return obj._proc_member(tarfile)

    #--------------------------------------------------------------------------
    # The following are methods that are called depending on the type of a
    # member. The entry point is _proc_member() which can be overridden in a
    # subclass to add custom _proc_*() methods. A _proc_*() method MUST
    # implement the following
    # operations:
    # 1. Set self.offset_data to the position where the data blocks begin,
    #    if there is data that follows.
    # 2. Set tarfile.offset to the position where the next member's header will
    #    begin.
    # 3. Return self or another valid TarInfo object.
    def _proc_member(self, tarfile):
        """Choose the right processing method depending on
           the type and call it.
        """
        if self.type in (GNUTYPE_LONGNAME, GNUTYPE_LONGLINK):
            return self._proc_gnulong(tarfile)
        elif self.type == GNUTYPE_SPARSE:
            return self._proc_sparse(tarfile)
        elif self.type in (XHDTYPE, XGLTYPE, SOLARIS_XHDTYPE):
            return self._proc_pax(tarfile)
        else:
            return self._proc_builtin(tarfile)

    def _proc_builtin(self, tarfile):
        """Process a builtin type or an unknown type which
           will be treated as a regular file.
        """
        self.offset_data = tarfile.fileobj.tell()
        offset = self.offset_data
        if self.isreg() or self.type not in SUPPORTED_TYPES:
            # Skip the following data blocks.
            offset += self._block(self.size)
        tarfile.offset = offset

        # Patch the TarInfo object with saved global
        # header information.
        self._apply_pax_info(tarfile.pax_headers, tarfile.encoding, tarfile.errors)

        return self

    def _proc_gnulong(self, tarfile):
        """Process the blocks that hold a GNU longname
           or longlink member.
        """
        buf = tarfile.fileobj.read(self._block(self.size))

        # Fetch the next header and process it.
        try:
            next = self.fromtarfile(tarfile)
        except HeaderError:
            raise SubsequentHeaderError("missing or bad subsequent header")

        # Patch the TarInfo object from the next header with
        # the longname information.
        next.offset = self.offset
        if self.type == GNUTYPE_LONGNAME:
            next.name = nts(buf, tarfile.encoding, tarfile.errors)
        elif self.type == GNUTYPE_LONGLINK:
            next.linkname = nts(buf, tarfile.encoding, tarfile.errors)

        return next

    def _proc_sparse(self, tarfile):
        """Process a GNU sparse header plus extra headers.
        """
        # We already collected some sparse structures in frombuf().
        structs, isextended, origsize = self._sparse_structs
        del self._sparse_structs

        # Collect sparse structures from extended header blocks.
        while isextended:
            buf = tarfile.fileobj.read(BLOCKSIZE)
            pos = 0
            for i in range(21):
                try:
                    offset = nti(buf[pos:pos + 12])
                    numbytes = nti(buf[pos + 12:pos + 24])
                except ValueError:
                    break
                if offset and numbytes:
                    structs.append((offset, numbytes))
                pos += 24
            isextended = bool(buf[504])
        self.sparse = structs

        self.offset_data = tarfile.fileobj.tell()
        tarfile.offset = self.offset_data + self._block(self.size)
        self.size = origsize
        return self

    def _proc_pax(self, tarfile):
        """Process an extended or global header as described in
           POSIX.1-2008.
        """
        # Read the header information.
        buf = tarfile.fileobj.read(self._block(self.size))

        # A pax header stores supplemental information for either
        # the following file (extended) or all following files
        # (global).
        if self.type == XGLTYPE:
            pax_headers = tarfile.pax_headers
        else:
            pax_headers = tarfile.pax_headers.copy()

        # Check if the pax header contains a hdrcharset field. This tells us
        # the encoding of the path, linkpath, uname and gname fields. Normally,
        # these fields are UTF-8 encoded but since POSIX.1-2008 tar
        # implementations are allowed to store them as raw binary strings if
        # the translation to UTF-8 fails.
        match = re.search(br"\d+ hdrcharset=([^\n]+)\n", buf)
        if match is not None:
            pax_headers["hdrcharset"] = match.group(1).decode("utf-8")

        # For the time being, we don't care about anything other than "BINARY".
        # The only other value that is currently allowed by the standard is
        # "ISO-IR 10646 2000 UTF-8" in other words UTF-8.
        hdrcharset = pax_headers.get("hdrcharset")
        if hdrcharset == "BINARY":
            encoding = tarfile.encoding
        else:
            encoding = "utf-8"

        # Parse pax header information. A record looks like that:
        # "%d %s=%s\n" % (length, keyword, value). length is the size
        # of the complete record including the length field itself and
        # the newline. keyword and value are both UTF-8 encoded strings.
        regex = re.compile(br"(\d+) ([^=]+)=")
        pos = 0
        while True:
            match = regex.match(buf, pos)
            if not match:
                break

            length, keyword = match.groups()
            length = int(length)
            if length == 0:
                raise InvalidHeaderError("invalid header")
            value = buf[match.end(2) + 1:match.start(1) + length - 1]

            # Normally, we could just use "utf-8" as the encoding and "strict"
            # as the error handler, but we better not take the risk. For
            # example, GNU tar <= 1.23 is known to store filenames it cannot
            # translate to UTF-8 as raw strings (unfortunately without a
            # hdrcharset=BINARY header).
            # We first try the strict standard encoding, and if that fails we
            # fall back on the user's encoding and error handler.
            keyword = self._decode_pax_field(keyword, "utf-8", "utf-8",
                    tarfile.errors)
            if keyword in PAX_NAME_FIELDS:
                value = self._decode_pax_field(value, encoding, tarfile.encoding,
                        tarfile.errors)
            else:
                value = self._decode_pax_field(value, "utf-8", "utf-8",
                        tarfile.errors)

            pax_headers[keyword] = value
            pos += length

        # Fetch the next header.
        try:
            next = self.fromtarfile(tarfile)
        except HeaderError:
            raise SubsequentHeaderError("missing or bad subsequent header")

        # Process GNU sparse information.
        if "GNU.sparse.map" in pax_headers:
            # GNU extended sparse format version 0.1.
            self._proc_gnusparse_01(next, pax_headers)

        elif "GNU.sparse.size" in pax_headers:
            # GNU extended sparse format version 0.0.
            self._proc_gnusparse_00(next, pax_headers, buf)

        elif pax_headers.get("GNU.sparse.major") == "1" and pax_headers.get("GNU.sparse.minor") == "0":
            # GNU extended sparse format version 1.0.
            self._proc_gnusparse_10(next, pax_headers, tarfile)

        if self.type in (XHDTYPE, SOLARIS_XHDTYPE):
            # Patch the TarInfo object with the extended header info.
            next._apply_pax_info(pax_headers, tarfile.encoding, tarfile.errors)
            next.offset = self.offset

            if "size" in pax_headers:
                # If the extended header replaces the size field,
                # we need to recalculate the offset where the next
                # header starts.
                offset = next.offset_data
                if next.isreg() or next.type not in SUPPORTED_TYPES:
                    offset += next._block(next.size)
                tarfile.offset = offset

        return next

    def _proc_gnusparse_00(self, next, pax_headers, buf):
        """Process a GNU tar extended sparse header, version 0.0.
        """
        offsets = []
        for match in re.finditer(br"\d+ GNU.sparse.offset=(\d+)\n", buf):
            offsets.append(int(match.group(1)))
        numbytes = []
        for match in re.finditer(br"\d+ GNU.sparse.numbytes=(\d+)\n", buf):
            numbytes.append(int(match.group(1)))
        next.sparse = list(zip(offsets, numbytes))

    def _proc_gnusparse_01(self, next, pax_headers):
        """Process a GNU tar extended sparse header, version 0.1.
        """
        sparse = [int(x) for x in pax_headers["GNU.sparse.map"].split(",")]
        next.sparse = list(zip(sparse[::2], sparse[1::2]))

    def _proc_gnusparse_10(self, next, pax_headers, tarfile):
        """Process a GNU tar extended sparse header, version 1.0.
        """
        fields = None
        sparse = []
        buf = tarfile.fileobj.read(BLOCKSIZE)
        fields, buf = buf.split(b"\n", 1)
        fields = int(fields)
        while len(sparse) < fields * 2:
            if b"\n" not in buf:
                buf += tarfile.fileobj.read(BLOCKSIZE)
            number, buf = buf.split(b"\n", 1)
            sparse.append(int(number))
        next.offset_data = tarfile.fileobj.tell()
        next.sparse = list(zip(sparse[::2], sparse[1::2]))

    def _apply_pax_info(self, pax_headers, encoding, errors):
        """Replace fields with supplemental information from a previous
           pax extended or global header.
        """
        for keyword, value in pax_headers.items():
            if keyword == "GNU.sparse.name":
                setattr(self, "path", value)
            elif keyword == "GNU.sparse.size":
                setattr(self, "size", int(value))
            elif keyword == "GNU.sparse.realsize":
                setattr(self, "size", int(value))
            elif keyword in PAX_FIELDS:
                if keyword in PAX_NUMBER_FIELDS:
                    try:
                        value = PAX_NUMBER_FIELDS[keyword](value)
                    except ValueError:
                        value = 0
                if keyword == "path":
                    value = value.rstrip("/")
                setattr(self, keyword, value)

        self.pax_headers = pax_headers.copy()

    def _decode_pax_field(self, value, encoding, fallback_encoding, fallback_errors):
        """Decode a single field from a pax record.
        """
        try:
            return value.decode(encoding, "strict")
        except UnicodeDecodeError:
            return value.decode(fallback_encoding, fallback_errors)

    def _block(self, count):
        """Round up a byte count by BLOCKSIZE and return it,
           e.g. _block(834) => 1024.
        """
        blocks, remainder = divmod(count, BLOCKSIZE)
        if remainder:
            blocks += 1
        return blocks * BLOCKSIZE

    def isreg(self):
        'Return True if the Tarinfo object is a regular file.'
        return self.type in REGULAR_TYPES

    def isfile(self):
        'Return True if the Tarinfo object is a regular file.'
        return self.isreg()

    def isdir(self):
        'Return True if it is a directory.'
        return self.type == DIRTYPE

    def issym(self):
        'Return True if it is a symbolic link.'
        return self.type == SYMTYPE

    def islnk(self):
        'Return True if it is a hard link.'
        return self.type == LNKTYPE

    def ischr(self):
        'Return True if it is a character device.'
        return self.type == CHRTYPE

    def isblk(self):
        'Return True if it is a block device.'
        return self.type == BLKTYPE

    def isfifo(self):
        'Return True if it is a FIFO.'
        return self.type == FIFOTYPE

    def issparse(self):
        return self.sparse is not None

    def isdev(self):
        'Return True if it is one of character device, block device or FIFO.'
        return self.type in (CHRTYPE, BLKTYPE, FIFOTYPE)
# class TarInfo

class TarFile(object):
    """The TarFile Class provides an interface to tar archives.
    """

    debug = 0                   # May be set from 0 (no msgs) to 3 (all msgs)

    dereference = False         # If true, add content of linked file to the
                                # tar file, else the link.

    ignore_zeros = False        # If true, skips empty or invalid blocks and
                                # continues processing.

    errorlevel = 1              # If 0, fatal errors only appear in debug
                                # messages (if debug >= 0). If > 0, errors
                                # are passed to the caller as exceptions.

    format = DEFAULT_FORMAT     # The format to use when creating an archive.

    encoding = ENCODING         # Encoding for 8-bit character strings.

    errors = None               # Error handler for unicode conversion.

    tarinfo = TarInfo           # The default TarInfo class to use.

    fileobject = ExFileObject   # The file-object for extractfile().

    extraction_filter = None    # The default filter for extraction.

    def __init__(self, name=None, mode="r", fileobj=None, format=None,
            tarinfo=None, dereference=None, ignore_zeros=None, encoding=None,
            errors="surrogateescape", pax_headers=None, debug=None,
            errorlevel=None, copybufsize=None):
        """Open an (uncompressed) tar archive `name'. `mode' is either 'r' to
           read from an existing archive, 'a' to append data to an existing
           file or 'w' to create a new file overwriting an existing one. `mode'
           defaults to 'r'.
           If `fileobj' is given, it is used for reading or writing data. If it
           can be determined, `mode' is overridden by `fileobj's mode.
           `fileobj' is not closed, when TarFile is closed.
        """
        modes = {"r": "rb", "a": "r+b", "w": "wb", "x": "xb"}
        if mode not in modes:
            raise ValueError("mode must be 'r', 'a', 'w' or 'x'")
        self.mode = mode
        self._mode = modes[mode]

        if not fileobj:
            if self.mode == "a" and not os.path.exists(name):
                # Create nonexistent files in append mode.
                self.mode = "w"
                self._mode = "wb"
            fileobj = bltn_open(name, self._mode)
            self._extfileobj = False
        else:
            if (name is None and hasattr(fileobj, "name") and
                isinstance(fileobj.name, (str, bytes))):
                name = fileobj.name
            if hasattr(fileobj, "mode"):
                self._mode = fileobj.mode
            self._extfileobj = True
        self.name = os.path.abspath(name) if name else None
        self.fileobj = fileobj

        # Init attributes.
        if format is not None:
            self.format = format
        if tarinfo is not None:
            self.tarinfo = tarinfo
        if dereference is not None:
            self.dereference = dereference
        if ignore_zeros is not None:
            self.ignore_zeros = ignore_zeros
        if encoding is not None:
            self.encoding = encoding
        self.errors = errors

        if pax_headers is not None and self.format == PAX_FORMAT:
            self.pax_headers = pax_headers
        else:
            self.pax_headers = {}

        if debug is not None:
            self.debug = debug
        if errorlevel is not None:
            self.errorlevel = errorlevel

        # Init datastructures.
        self.copybufsize = copybufsize
        self.closed = False
        self.members = []       # list of members as TarInfo objects
        self._loaded = False    # flag if all members have been read
        self.offset = self.fileobj.tell()
                                # current position in the archive file
        self.inodes = {}        # dictionary caching the inodes of
                                # archive members already added

        try:
            if self.mode == "r":
                self.firstmember = None
                self.firstmember = self.next()

            if self.mode == "a":
                # Move to the end of the archive,
                # before the first empty block.
                while True:
                    self.fileobj.seek(self.offset)
                    try:
                        tarinfo = self.tarinfo.fromtarfile(self)
                        self.members.append(tarinfo)
                    except EOFHeaderError:
                        self.fileobj.seek(self.offset)
                        break
                    except HeaderError as e:
                        raise ReadError(str(e))

            if self.mode in ("a", "w", "x"):
                self._loaded = True

                if self.pax_headers:
                    buf = self.tarinfo.create_pax_global_header(self.pax_headers.copy())
                    self.fileobj.write(buf)
                    self.offset += len(buf)
        except:
            if not self._extfileobj:
                self.fileobj.close()
            self.closed = True
            raise

    #--------------------------------------------------------------------------
    # Below are the classmethods which act as alternate constructors to the
    # TarFile class. The open() method is the only one that is needed for
    # public use; it is the "super"-constructor and is able to select an
    # adequate "sub"-constructor for a particular compression using the mapping
    # from OPEN_METH.
    #
    # This concept allows one to subclass TarFile without losing the comfort of
    # the super-constructor. A sub-constructor is registered and made available
    # by adding it to the mapping in OPEN_METH.

    @classmethod
    def open(cls, name=None, mode="r", fileobj=None, bufsize=RECORDSIZE, **kwargs):
        """Open a tar archive for reading, writing or appending. Return
           an appropriate TarFile class.

           mode:
           'r' or 'r:*' open for reading with transparent compression
           'r:'         open for reading exclusively uncompressed
           'r:gz'       open for reading with gzip compression
           'r:bz2'      open for reading with bzip2 compression
           'r:xz'       open for reading with lzma compression
           'a' or 'a:'  open for appending, creating the file if necessary
           'w' or 'w:'  open for writing without compression
           'w:gz'       open for writing with gzip compression
           'w:bz2'      open for writing with bzip2 compression
           'w:xz'       open for writing with lzma compression

           'x' or 'x:'  create a tarfile exclusively without compression, raise
                        an exception if the file is already created
           'x:gz'       create a gzip compressed tarfile, raise an exception
                        if the file is already created
           'x:bz2'      create a bzip2 compressed tarfile, raise an exception
                        if the file is already created
           'x:xz'       create an lzma compressed tarfile, raise an exception
                        if the file is already created

           'r|*'        open a stream of tar blocks with transparent compression
           'r|'         open an uncompressed stream of tar blocks for reading
           'r|gz'       open a gzip compressed stream of tar blocks
           'r|bz2'      open a bzip2 compressed stream of tar blocks
           'r|xz'       open an lzma compressed stream of tar blocks
           'w|'         open an uncompressed stream for writing
           'w|gz'       open a gzip compressed stream for writing
           'w|bz2'      open a bzip2 compressed stream for writing
           'w|xz'       open an lzma compressed stream for writing
        """

        if not name and not fileobj:
            raise ValueError("nothing to open")

        if mode in ("r", "r:*"):
            # Find out which *open() is appropriate for opening the file.
            def not_compressed(comptype):
                return cls.OPEN_METH[comptype] == 'taropen'
            for comptype in sorted(cls.OPEN_METH, key=not_compressed):
                func = getattr(cls, cls.OPEN_METH[comptype])
                if fileobj is not None:
                    saved_pos = fileobj.tell()
                try:
                    return func(name, "r", fileobj, **kwargs)
                except (ReadError, CompressionError):
                    if fileobj is not None:
                        fileobj.seek(saved_pos)
                    continue
            raise ReadError("file could not be opened successfully")

        elif ":" in mode:
            filemode, comptype = mode.split(":", 1)
            filemode = filemode or "r"
            comptype = comptype or "tar"

            # Select the *open() function according to
            # given compression.
            if comptype in cls.OPEN_METH:
                func = getattr(cls, cls.OPEN_METH[comptype])
            else:
                raise CompressionError("unknown compression type %r" % comptype)
            return func(name, filemode, fileobj, **kwargs)

        elif "|" in mode:
            filemode, comptype = mode.split("|", 1)
            filemode = filemode or "r"
            comptype = comptype or "tar"

            if filemode not in ("r", "w"):
                raise ValueError("mode must be 'r' or 'w'")

            stream = _Stream(name, filemode, comptype, fileobj, bufsize)
            try:
                t = cls(name, filemode, stream, **kwargs)
            except:
                stream.close()
                raise
            t._extfileobj = False
            return t

        elif mode in ("a", "w", "x"):
            return cls.taropen(name, mode, fileobj, **kwargs)

        raise ValueError("undiscernible mode")

    @classmethod
    def taropen(cls, name, mode="r", fileobj=None, **kwargs):
        """Open uncompressed tar archive name for reading or writing.
        """
        if mode not in ("r", "a", "w", "x"):
            raise ValueError("mode must be 'r', 'a', 'w' or 'x'")
        return cls(name, mode, fileobj, **kwargs)

    @classmethod
    def gzopen(cls, name, mode="r", fileobj=None, compresslevel=9, **kwargs):
        """Open gzip compressed tar archive name for reading or writing.
           Appending is not allowed.
        """
        if mode not in ("r", "w", "x"):
            raise ValueError("mode must be 'r', 'w' or 'x'")

        try:
            from gzip import GzipFile
        except ImportError:
            raise CompressionError("gzip module is not available")

        try:
            fileobj = GzipFile(name, mode + "b", compresslevel, fileobj)
        except OSError:
            if fileobj is not None and mode == 'r':
                raise ReadError("not a gzip file")
            raise

        try:
            t = cls.taropen(name, mode, fileobj, **kwargs)
        except OSError:
            fileobj.close()
            if mode == 'r':
                raise ReadError("not a gzip file")
            raise
        except:
            fileobj.close()
            raise
        t._extfileobj = False
        return t

    @classmethod
    def bz2open(cls, name, mode="r", fileobj=None, compresslevel=9, **kwargs):
        """Open bzip2 compressed tar archive name for reading or writing.
           Appending is not allowed.
        """
        if mode not in ("r", "w", "x"):
            raise ValueError("mode must be 'r', 'w' or 'x'")

        try:
            from bz2 import BZ2File
        except ImportError:
            raise CompressionError("bz2 module is not available")

        fileobj = BZ2File(fileobj or name, mode, compresslevel=compresslevel)

        try:
            t = cls.taropen(name, mode, fileobj, **kwargs)
        except (OSError, EOFError):
            fileobj.close()
            if mode == 'r':
                raise ReadError("not a bzip2 file")
            raise
        except:
            fileobj.close()
            raise
        t._extfileobj = False
        return t

    @classmethod
    def xzopen(cls, name, mode="r", fileobj=None, preset=None, **kwargs):
        """Open lzma compressed tar archive name for reading or writing.
           Appending is not allowed.
        """
        if mode not in ("r", "w", "x"):
            raise ValueError("mode must be 'r', 'w' or 'x'")

        try:
            from lzma import LZMAFile, LZMAError
        except ImportError:
            raise CompressionError("lzma module is not available")

        fileobj = LZMAFile(fileobj or name, mode, preset=preset)

        try:
            t = cls.taropen(name, mode, fileobj, **kwargs)
        except (LZMAError, EOFError):
            fileobj.close()
            if mode == 'r':
                raise ReadError("not an lzma file")
            raise
        except:
            fileobj.close()
            raise
        t._extfileobj = False
        return t

    # All *open() methods are registered here.
    OPEN_METH = {
        "tar": "taropen",   # uncompressed tar
        "gz":  "gzopen",    # gzip compressed tar
        "bz2": "bz2open",   # bzip2 compressed tar
        "xz":  "xzopen"     # lzma compressed tar
    }

    #--------------------------------------------------------------------------
    # The public methods which TarFile provides:

    def close(self):
        """Close the TarFile. In write-mode, two finishing zero blocks are
           appended to the archive.
        """
        if self.closed:
            return

        self.closed = True
        try:
            if self.mode in ("a", "w", "x"):
                self.fileobj.write(NUL * (BLOCKSIZE * 2))
                self.offset += (BLOCKSIZE * 2)
                # fill up the end with zero-blocks
                # (like option -b20 for tar does)
                blocks, remainder = divmod(self.offset, RECORDSIZE)
                if remainder > 0:
                    self.fileobj.write(NUL * (RECORDSIZE - remainder))
        finally:
            if not self._extfileobj:
                self.fileobj.close()

    def getmember(self, name):
        """Return a TarInfo object for member `name'. If `name' can not be
           found in the archive, KeyError is raised. If a member occurs more
           than once in the archive, its last occurrence is assumed to be the
           most up-to-date version.
        """
        tarinfo = self._getmember(name)
        if tarinfo is None:
            raise KeyError("filename %r not found" % name)
        return tarinfo

    def getmembers(self):
        """Return the members of the archive as a list of TarInfo objects. The
           list has the same order as the members in the archive.
        """
        self._check()
        if not self._loaded:    # if we want to obtain a list of
            self._load()        # all members, we first have to
                                # scan the whole archive.
        return self.members

    def getnames(self):
        """Return the members of the archive as a list of their names. It has
           the same order as the list returned by getmembers().
        """
        return [tarinfo.name for tarinfo in self.getmembers()]

    def gettarinfo(self, name=None, arcname=None, fileobj=None):
        """Create a TarInfo object from the result of os.stat or equivalent
           on an existing file. The file is either named by `name', or
           specified as a file object `fileobj' with a file descriptor. If
           given, `arcname' specifies an alternative name for the file in the
           archive, otherwise, the name is taken from the 'name' attribute of
           'fileobj', or the 'name' argument. The name should be a text
           string.
        """
        self._check("awx")

        # When fileobj is given, replace name by
        # fileobj's real name.
        if fileobj is not None:
            name = fileobj.name

        # Building the name of the member in the archive.
        # Backward slashes are converted to forward slashes,
        # Absolute paths are turned to relative paths.
        if arcname is None:
            arcname = name
        drv, arcname = os.path.splitdrive(arcname)
        arcname = arcname.replace(os.sep, "/")
        arcname = arcname.lstrip("/")

        # Now, fill the TarInfo object with
        # information specific for the file.
        tarinfo = self.tarinfo()
        tarinfo.tarfile = self  # Not needed

        # Use os.stat or os.lstat, depending on if symlinks shall be resolved.
        if fileobj is None:
            if not self.dereference:
                statres = os.lstat(name)
            else:
                statres = os.stat(name)
        else:
            statres = os.fstat(fileobj.fileno())
        linkname = ""

        stmd = statres.st_mode
        if stat.S_ISREG(stmd):
            inode = (statres.st_ino, statres.st_dev)
            if not self.dereference and statres.st_nlink > 1 and \
                    inode in self.inodes and arcname != self.inodes[inode]:
                # Is it a hardlink to an already
                # archived file?
                type = LNKTYPE
                linkname = self.inodes[inode]
            else:
                # The inode is added only if its valid.
                # For win32 it is always 0.
                type = REGTYPE
                if inode[0]:
                    self.inodes[inode] = arcname
        elif stat.S_ISDIR(stmd):
            type = DIRTYPE
        elif stat.S_ISFIFO(stmd):
            type = FIFOTYPE
        elif stat.S_ISLNK(stmd):
            type = SYMTYPE
            linkname = os.readlink(name)
        elif stat.S_ISCHR(stmd):
            type = CHRTYPE
        elif stat.S_ISBLK(stmd):
            type = BLKTYPE
        else:
            return None

        # Fill the TarInfo object with all
        # information we can get.
        tarinfo.name = arcname
        tarinfo.mode = stmd
        tarinfo.uid = statres.st_uid
        tarinfo.gid = statres.st_gid
        if type == REGTYPE:
            tarinfo.size = statres.st_size
        else:
            tarinfo.size = 0
        tarinfo.mtime = statres.st_mtime
        tarinfo.type = type
        tarinfo.linkname = linkname
        if pwd:
            try:
                tarinfo.uname = pwd.getpwuid(tarinfo.uid)[0]
            except KeyError:
                pass
        if grp:
            try:
                tarinfo.gname = grp.getgrgid(tarinfo.gid)[0]
            except KeyError:
                pass

        if type in (CHRTYPE, BLKTYPE):
            if hasattr(os, "major") and hasattr(os, "minor"):
                tarinfo.devmajor = os.major(statres.st_rdev)
                tarinfo.devminor = os.minor(statres.st_rdev)
        return tarinfo

    def list(self, verbose=True, *, members=None):
        """Print a table of contents to sys.stdout. If `verbose' is False, only
           the names of the members are printed. If it is True, an `ls -l'-like
           output is produced. `members' is optional and must be a subset of the
           list returned by getmembers().
        """
        self._check()

        if members is None:
            members = self
        for tarinfo in members:
            if verbose:
                if tarinfo.mode is None:
                    _safe_print("??????????")
                else:
                    _safe_print(stat.filemode(tarinfo.mode))
                _safe_print("%s/%s" % (tarinfo.uname or tarinfo.uid,
                                       tarinfo.gname or tarinfo.gid))
                if tarinfo.ischr() or tarinfo.isblk():
                    _safe_print("%10s" %
                            ("%d,%d" % (tarinfo.devmajor, tarinfo.devminor)))
                else:
                    _safe_print("%10d" % tarinfo.size)
                if tarinfo.mtime is None:
                    _safe_print("????-??-?? ??:??:??")
                else:
                    _safe_print("%d-%02d-%02d %02d:%02d:%02d" \
                                % time.localtime(tarinfo.mtime)[:6])

            _safe_print(tarinfo.name + ("/" if tarinfo.isdir() else ""))

            if verbose:
                if tarinfo.issym():
                    _safe_print("-> " + tarinfo.linkname)
                if tarinfo.islnk():
                    _safe_print("link to " + tarinfo.linkname)
            print()

    def add(self, name, arcname=None, recursive=True, *, filter=None):
        """Add the file `name' to the archive. `name' may be any type of file
           (directory, fifo, symbolic link, etc.). If given, `arcname'
           specifies an alternative name for the file in the archive.
           Directories are added recursively by default. This can be avoided by
           setting `recursive' to False. `filter' is a function
           that expects a TarInfo object argument and returns the changed
           TarInfo object, if it returns None the TarInfo object will be
           excluded from the archive.
        """
        self._check("awx")

        if arcname is None:
            arcname = name

        # Skip if somebody tries to archive the archive...
        if self.name is not None and os.path.abspath(name) == self.name:
            self._dbg(2, "tarfile: Skipped %r" % name)
            return

        self._dbg(1, name)

        # Create a TarInfo object from the file.
        tarinfo = self.gettarinfo(name, arcname)

        if tarinfo is None:
            self._dbg(1, "tarfile: Unsupported type %r" % name)
            return

        # Change or exclude the TarInfo object.
        if filter is not None:
            tarinfo = filter(tarinfo)
            if tarinfo is None:
                self._dbg(2, "tarfile: Excluded %r" % name)
                return

        # Append the tar header and data to the archive.
        if tarinfo.isreg():
            with bltn_open(name, "rb") as f:
                self.addfile(tarinfo, f)

        elif tarinfo.isdir():
            self.addfile(tarinfo)
            if recursive:
                for f in sorted(os.listdir(name)):
                    self.add(os.path.join(name, f), os.path.join(arcname, f),
                            recursive, filter=filter)

        else:
            self.addfile(tarinfo)

    def addfile(self, tarinfo, fileobj=None):
        """Add the TarInfo object `tarinfo' to the archive. If `fileobj' is
           given, it should be a binary file, and tarinfo.size bytes are read
           from it and added to the archive. You can create TarInfo objects
           directly, or by using gettarinfo().
        """
        self._check("awx")

        tarinfo = copy.copy(tarinfo)

        buf = tarinfo.tobuf(self.format, self.encoding, self.errors)
        self.fileobj.write(buf)
        self.offset += len(buf)
        bufsize=self.copybufsize
        # If there's data to follow, append it.
        if fileobj is not None:
            copyfileobj(fileobj, self.fileobj, tarinfo.size, bufsize=bufsize)
            blocks, remainder = divmod(tarinfo.size, BLOCKSIZE)
            if remainder > 0:
                self.fileobj.write(NUL * (BLOCKSIZE - remainder))
                blocks += 1
            self.offset += blocks * BLOCKSIZE

        self.members.append(tarinfo)

    def _get_filter_function(self, filter):
        if filter is None:
            filter = self.extraction_filter
            if filter is None:
                name = os.environ.get('PYTHON_TARFILE_EXTRACTION_FILTER')
                if name is None:
                    try:
                        file = bltn_open(_CONFIG_FILENAME)
                    except FileNotFoundError:
                        pass
                    else:
                        import configparser
                        conf = configparser.ConfigParser(
                            interpolation=None,
                            comment_prefixes=('#', ),
                        )
                        with file:
                            conf.read_file(file)
                        name = conf.get('tarfile',
                                        'PYTHON_TARFILE_EXTRACTION_FILTER',
                                        fallback='')
                if name:
                    try:
                        filter = _NAMED_FILTERS[name]
                    except KeyError:
                        raise ValueError(f"filter {filter!r} not found") from None
                    self.extraction_filter = filter
                    return filter
                if _RH_SAFER_DEFAULT:
                    warnings.warn(
                        'The default behavior of tarfile extraction has been '
                        + 'changed to disallow common exploits '
                        + '(including CVE-2007-4559). '
                        + 'By default, absolute/parent paths are disallowed '
                        + 'and some mode bits are cleared. '
                        + 'See https://access.redhat.com/articles/7004769 '
                        + 'for more details.',
                        RuntimeWarning)
                    return tar_filter
                return fully_trusted_filter
            if isinstance(filter, str):
                raise TypeError(
                    'String names are not supported for '
                    + 'TarFile.extraction_filter. Use a function such as '
                    + 'tarfile.data_filter directly.')
            return filter
        if callable(filter):
            return filter
        try:
            return _NAMED_FILTERS[filter]
        except KeyError:
            raise ValueError(f"filter {filter!r} not found") from None

    def extractall(self, path=".", members=None, *, numeric_owner=False,
                   filter=None):
        """Extract all members from the archive to the current working
           directory and set owner, modification time and permissions on
           directories afterwards. `path' specifies a different directory
           to extract to. `members' is optional and must be a subset of the
           list returned by getmembers(). If `numeric_owner` is True, only
           the numbers for user/group names are used and not the names.

           The `filter` function will be called on each member just
           before extraction.
           It can return a changed TarInfo or None to skip the member.
           String names of common filters are accepted.
        """
        directories = []

        filter_function = self._get_filter_function(filter)
        if members is None:
            members = self

        for member in members:
            tarinfo = self._get_extract_tarinfo(member, filter_function, path)
            if tarinfo is None:
                continue
            if tarinfo.isdir():
                # For directories, delay setting attributes until later,
                # since permissions can interfere with extraction and
                # extracting contents can reset mtime.
                directories.append(tarinfo)
            self._extract_one(tarinfo, path, set_attrs=not tarinfo.isdir(),
                              numeric_owner=numeric_owner)

        # Reverse sort directories.
        directories.sort(key=lambda a: a.name, reverse=True)

        # Set correct owner, mtime and filemode on directories.
        for tarinfo in directories:
            dirpath = os.path.join(path, tarinfo.name)
            try:
                self.chown(tarinfo, dirpath, numeric_owner=numeric_owner)
                self.utime(tarinfo, dirpath)
                self.chmod(tarinfo, dirpath)
            except ExtractError as e:
                self._handle_nonfatal_error(e)

    def extract(self, member, path="", set_attrs=True, *, numeric_owner=False,
                filter=None):
        """Extract a member from the archive to the current working directory,
           using its full name. Its file information is extracted as accurately
           as possible. `member' may be a filename or a TarInfo object. You can
           specify a different directory using `path'. File attributes (owner,
           mtime, mode) are set unless `set_attrs' is False. If `numeric_owner`
           is True, only the numbers for user/group names are used and not
           the names.

           The `filter` function will be called before extraction.
           It can return a changed TarInfo or None to skip the member.
           String names of common filters are accepted.
        """
        filter_function = self._get_filter_function(filter)
        tarinfo = self._get_extract_tarinfo(member, filter_function, path)
        if tarinfo is not None:
            self._extract_one(tarinfo, path, set_attrs, numeric_owner)

    def _get_extract_tarinfo(self, member, filter_function, path):
        """Get filtered TarInfo (or None) from member, which might be a str"""
        if isinstance(member, str):
            tarinfo = self.getmember(member)
        else:
            tarinfo = member

        unfiltered = tarinfo
        try:
            tarinfo = filter_function(tarinfo, path)
        except (OSError, FilterError) as e:
            self._handle_fatal_error(e)
        except ExtractError as e:
            self._handle_nonfatal_error(e)
        if tarinfo is None:
            self._dbg(2, "tarfile: Excluded %r" % unfiltered.name)
            return None
        # Prepare the link target for makelink().
        if tarinfo.islnk():
            tarinfo = copy.copy(tarinfo)
            tarinfo._link_target = os.path.join(path, tarinfo.linkname)
        return tarinfo

    def _extract_one(self, tarinfo, path, set_attrs, numeric_owner):
        """Extract from filtered tarinfo to disk"""
        self._check("r")

        try:
            self._extract_member(tarinfo, os.path.join(path, tarinfo.name),
                                 set_attrs=set_attrs,
                                 numeric_owner=numeric_owner)
        except OSError as e:
            self._handle_fatal_error(e)
        except ExtractError as e:
            self._handle_nonfatal_error(e)

    def _handle_nonfatal_error(self, e):
        """Handle non-fatal error (ExtractError) according to errorlevel"""
        if self.errorlevel > 1:
            raise
        else:
            self._dbg(1, "tarfile: %s" % e)

    def _handle_fatal_error(self, e):
        """Handle "fatal" error according to self.errorlevel"""
        if self.errorlevel > 0:
            raise
        elif isinstance(e, OSError):
            if e.filename is None:
                self._dbg(1, "tarfile: %s" % e.strerror)
            else:
                self._dbg(1, "tarfile: %s %r" % (e.strerror, e.filename))
        else:
            self._dbg(1, "tarfile: %s %s" % (type(e).__name__, e))

    def extractfile(self, member):
        """Extract a member from the archive as a file object. `member' may be
           a filename or a TarInfo object. If `member' is a regular file or a
           link, an io.BufferedReader object is returned. Otherwise, None is
           returned.
        """
        self._check("r")

        if isinstance(member, str):
            tarinfo = self.getmember(member)
        else:
            tarinfo = member

        if tarinfo.isreg() or tarinfo.type not in SUPPORTED_TYPES:
            # Members with unknown types are treated as regular files.
            return self.fileobject(self, tarinfo)

        elif tarinfo.islnk() or tarinfo.issym():
            if isinstance(self.fileobj, _Stream):
                # A small but ugly workaround for the case that someone tries
                # to extract a (sym)link as a file-object from a non-seekable
                # stream of tar blocks.
                raise StreamError("cannot extract (sym)link as file object")
            else:
                # A (sym)link's file object is its target's file object.
                return self.extractfile(self._find_link_target(tarinfo))
        else:
            # If there's no data associated with the member (directory, chrdev,
            # blkdev, etc.), return None instead of a file object.
            return None

    def _extract_member(self, tarinfo, targetpath, set_attrs=True,
                        numeric_owner=False):
        """Extract the TarInfo object tarinfo to a physical
           file called targetpath.
        """
        # Fetch the TarInfo object for the given name
        # and build the destination pathname, replacing
        # forward slashes to platform specific separators.
        targetpath = targetpath.rstrip("/")
        targetpath = targetpath.replace("/", os.sep)

        # Create all upper directories.
        upperdirs = os.path.dirname(targetpath)
        if upperdirs and not os.path.exists(upperdirs):
            # Create directories that are not part of the archive with
            # default permissions.
            os.makedirs(upperdirs)

        if tarinfo.islnk() or tarinfo.issym():
            self._dbg(1, "%s -> %s" % (tarinfo.name, tarinfo.linkname))
        else:
            self._dbg(1, tarinfo.name)

        if tarinfo.isreg():
            self.makefile(tarinfo, targetpath)
        elif tarinfo.isdir():
            self.makedir(tarinfo, targetpath)
        elif tarinfo.isfifo():
            self.makefifo(tarinfo, targetpath)
        elif tarinfo.ischr() or tarinfo.isblk():
            self.makedev(tarinfo, targetpath)
        elif tarinfo.islnk() or tarinfo.issym():
            self.makelink(tarinfo, targetpath)
        elif tarinfo.type not in SUPPORTED_TYPES:
            self.makeunknown(tarinfo, targetpath)
        else:
            self.makefile(tarinfo, targetpath)

        if set_attrs:
            self.chown(tarinfo, targetpath, numeric_owner)
            if not tarinfo.issym():
                self.chmod(tarinfo, targetpath)
                self.utime(tarinfo, targetpath)

    #--------------------------------------------------------------------------
    # Below are the different file methods. They are called via
    # _extract_member() when extract() is called. They can be replaced in a
    # subclass to implement other functionality.

    def makedir(self, tarinfo, targetpath):
        """Make a directory called targetpath.
        """
        try:
            if tarinfo.mode is None:
                # Use the system's default mode
                os.mkdir(targetpath)
            else:
                # Use a safe mode for the directory, the real mode is set
                # later in _extract_member().
                os.mkdir(targetpath, 0o700)
        except FileExistsError:
            pass

    def makefile(self, tarinfo, targetpath):
        """Make a file called targetpath.
        """
        source = self.fileobj
        source.seek(tarinfo.offset_data)
        bufsize = self.copybufsize
        with bltn_open(targetpath, "wb") as target:
            if tarinfo.sparse is not None:
                for offset, size in tarinfo.sparse:
                    target.seek(offset)
                    copyfileobj(source, target, size, ReadError, bufsize)
                target.seek(tarinfo.size)
                target.truncate()
            else:
                copyfileobj(source, target, tarinfo.size, ReadError, bufsize)

    def makeunknown(self, tarinfo, targetpath):
        """Make a file from a TarInfo object with an unknown type
           at targetpath.
        """
        self.makefile(tarinfo, targetpath)
        self._dbg(1, "tarfile: Unknown file type %r, " \
                     "extracted as regular file." % tarinfo.type)

    def makefifo(self, tarinfo, targetpath):
        """Make a fifo called targetpath.
        """
        if hasattr(os, "mkfifo"):
            os.mkfifo(targetpath)
        else:
            raise ExtractError("fifo not supported by system")

    def makedev(self, tarinfo, targetpath):
        """Make a character or block device called targetpath.
        """
        if not hasattr(os, "mknod") or not hasattr(os, "makedev"):
            raise ExtractError("special devices not supported by system")

        mode = tarinfo.mode
        if mode is None:
            # Use mknod's default
            mode = 0o600
        if tarinfo.isblk():
            mode |= stat.S_IFBLK
        else:
            mode |= stat.S_IFCHR

        os.mknod(targetpath, mode,
                 os.makedev(tarinfo.devmajor, tarinfo.devminor))

    def makelink(self, tarinfo, targetpath):
        """Make a (symbolic) link called targetpath. If it cannot be created
          (platform limitation), we try to make a copy of the referenced file
          instead of a link.
        """
        try:
            # For systems that support symbolic and hard links.
            if tarinfo.issym():
                if os.path.lexists(targetpath):
                    # Avoid FileExistsError on following os.symlink.
                    os.unlink(targetpath)
                os.symlink(tarinfo.linkname, targetpath)
            else:
                if os.path.exists(tarinfo._link_target):
                    os.link(tarinfo._link_target, targetpath)
                else:
                    self._extract_member(self._find_link_target(tarinfo),
                                         targetpath)
        except symlink_exception:
            try:
                self._extract_member(self._find_link_target(tarinfo),
                                     targetpath)
            except KeyError:
                raise ExtractError("unable to resolve link inside archive")

    def chown(self, tarinfo, targetpath, numeric_owner):
        """Set owner of targetpath according to tarinfo. If numeric_owner
           is True, use .gid/.uid instead of .gname/.uname. If numeric_owner
           is False, fall back to .gid/.uid when the search based on name
           fails.
        """
        if hasattr(os, "geteuid") and os.geteuid() == 0:
            # We have to be root to do so.
            g = tarinfo.gid
            u = tarinfo.uid
            if not numeric_owner:
                try:
                    if grp and tarinfo.gname:
                        g = grp.getgrnam(tarinfo.gname)[2]
                except KeyError:
                    pass
                try:
                    if pwd and tarinfo.uname:
                        u = pwd.getpwnam(tarinfo.uname)[2]
                except KeyError:
                    pass
            if g is None:
                g = -1
            if u is None:
                u = -1
            try:
                if tarinfo.issym() and hasattr(os, "lchown"):
                    os.lchown(targetpath, u, g)
                else:
                    os.chown(targetpath, u, g)
            except OSError:
                raise ExtractError("could not change owner")

    def chmod(self, tarinfo, targetpath):
        """Set file permissions of targetpath according to tarinfo.
        """
        if tarinfo.mode is None:
            return
        try:
            os.chmod(targetpath, tarinfo.mode)
        except OSError:
            raise ExtractError("could not change mode")

    def utime(self, tarinfo, targetpath):
        """Set modification time of targetpath according to tarinfo.
        """
        mtime = tarinfo.mtime
        if mtime is None:
            return
        if not hasattr(os, 'utime'):
            return
        try:
            os.utime(targetpath, (mtime, mtime))
        except OSError:
            raise ExtractError("could not change modification time")

    #--------------------------------------------------------------------------
    def next(self):
        """Return the next member of the archive as a TarInfo object, when
           TarFile is opened for reading. Return None if there is no more
           available.
        """
        self._check("ra")
        if self.firstmember is not None:
            m = self.firstmember
            self.firstmember = None
            return m

        # Advance the file pointer.
        if self.offset != self.fileobj.tell():
            self.fileobj.seek(self.offset - 1)
            if not self.fileobj.read(1):
                raise ReadError("unexpected end of data")

        # Read the next block.
        tarinfo = None
        while True:
            try:
                tarinfo = self.tarinfo.fromtarfile(self)
            except EOFHeaderError as e:
                if self.ignore_zeros:
                    self._dbg(2, "0x%X: %s" % (self.offset, e))
                    self.offset += BLOCKSIZE
                    continue
            except InvalidHeaderError as e:
                if self.ignore_zeros:
                    self._dbg(2, "0x%X: %s" % (self.offset, e))
                    self.offset += BLOCKSIZE
                    continue
                elif self.offset == 0:
                    raise ReadError(str(e))
            except EmptyHeaderError:
                if self.offset == 0:
                    raise ReadError("empty file")
            except TruncatedHeaderError as e:
                if self.offset == 0:
                    raise ReadError(str(e))
            except SubsequentHeaderError as e:
                raise ReadError(str(e))
            break

        if tarinfo is not None:
            self.members.append(tarinfo)
        else:
            self._loaded = True

        return tarinfo

    #--------------------------------------------------------------------------
    # Little helper methods:

    def _getmember(self, name, tarinfo=None, normalize=False):
        """Find an archive member by name from bottom to top.
           If tarinfo is given, it is used as the starting point.
        """
        # Ensure that all members have been loaded.
        members = self.getmembers()

        # Limit the member search list up to tarinfo.
        skipping = False
        if tarinfo is not None:
            try:
                index = members.index(tarinfo)
            except ValueError:
                # The given starting point might be a (modified) copy.
                # We'll later skip members until we find an equivalent.
                skipping = True
            else:
                # Happy fast path
                members = members[:index]

        if normalize:
            name = os.path.normpath(name)

        for member in reversed(members):
            if skipping:
                if tarinfo.offset == member.offset:
                    skipping = False
                continue
            if normalize:
                member_name = os.path.normpath(member.name)
            else:
                member_name = member.name

            if name == member_name:
                return member

        if skipping:
            # Starting point was not found
            raise ValueError(tarinfo)

    def _load(self):
        """Read through the entire archive file and look for readable
           members.
        """
        while True:
            tarinfo = self.next()
            if tarinfo is None:
                break
        self._loaded = True

    def _check(self, mode=None):
        """Check if TarFile is still open, and if the operation's mode
           corresponds to TarFile's mode.
        """
        if self.closed:
            raise OSError("%s is closed" % self.__class__.__name__)
        if mode is not None and self.mode not in mode:
            raise OSError("bad operation for mode %r" % self.mode)

    def _find_link_target(self, tarinfo):
        """Find the target member of a symlink or hardlink member in the
           archive.
        """
        if tarinfo.issym():
            # Always search the entire archive.
            linkname = "/".join(filter(None, (os.path.dirname(tarinfo.name), tarinfo.linkname)))
            limit = None
        else:
            # Search the archive before the link, because a hard link is
            # just a reference to an already archived file.
            linkname = tarinfo.linkname
            limit = tarinfo

        member = self._getmember(linkname, tarinfo=limit, normalize=True)
        if member is None:
            raise KeyError("linkname %r not found" % linkname)
        return member

    def __iter__(self):
        """Provide an iterator object.
        """
        if self._loaded:
            yield from self.members
            return

        # Yield items using TarFile's next() method.
        # When all members have been read, set TarFile as _loaded.
        index = 0
        # Fix for SF #1100429: Under rare circumstances it can
        # happen that getmembers() is called during iteration,
        # which will have already exhausted the next() method.
        if self.firstmember is not None:
            tarinfo = self.next()
            index += 1
            yield tarinfo

        while True:
            if index < len(self.members):
                tarinfo = self.members[index]
            elif not self._loaded:
                tarinfo = self.next()
                if not tarinfo:
                    self._loaded = True
                    return
            else:
                return
            index += 1
            yield tarinfo

    def _dbg(self, level, msg):
        """Write debugging output to sys.stderr.
        """
        if level <= self.debug:
            print(msg, file=sys.stderr)

    def __enter__(self):
        self._check()
        return self

    def __exit__(self, type, value, traceback):
        if type is None:
            self.close()
        else:
            # An exception occurred. We must not call close() because
            # it would try to write end-of-archive blocks and padding.
            if not self._extfileobj:
                self.fileobj.close()
            self.closed = True

#--------------------
# exported functions
#--------------------

def is_tarfile(name):
    """Return True if name points to a tar archive that we
       are able to handle, else return False.
    """
    try:
        t = open(name)
        t.close()
        return True
    except TarError:
        return False

open = TarFile.open


def main():
    import argparse

    description = 'A simple command-line interface for tarfile module.'
    parser = argparse.ArgumentParser(description=description)
    parser.add_argument('-v', '--verbose', action='store_true', default=False,
                        help='Verbose output')
    parser.add_argument('--filter', metavar='<filtername>',
                        choices=_NAMED_FILTERS,
                        help='Filter for extraction')

    group = parser.add_mutually_exclusive_group(required=True)
    group.add_argument('-l', '--list', metavar='<tarfile>',
                       help='Show listing of a tarfile')
    group.add_argument('-e', '--extract', nargs='+',
                       metavar=('<tarfile>', '<output_dir>'),
                       help='Extract tarfile into target dir')
    group.add_argument('-c', '--create', nargs='+',
                       metavar=('<name>', '<file>'),
                       help='Create tarfile from sources')
    group.add_argument('-t', '--test', metavar='<tarfile>',
                       help='Test if a tarfile is valid')

    args = parser.parse_args()

    if args.filter and args.extract is None:
        parser.exit(1, '--filter is only valid for extraction\n')

    if args.test is not None:
        src = args.test
        if is_tarfile(src):
            with open(src, 'r') as tar:
                tar.getmembers()
                print(tar.getmembers(), file=sys.stderr)
            if args.verbose:
                print('{!r} is a tar archive.'.format(src))
        else:
            parser.exit(1, '{!r} is not a tar archive.\n'.format(src))

    elif args.list is not None:
        src = args.list
        if is_tarfile(src):
            with TarFile.open(src, 'r:*') as tf:
                tf.list(verbose=args.verbose)
        else:
            parser.exit(1, '{!r} is not a tar archive.\n'.format(src))

    elif args.extract is not None:
        if len(args.extract) == 1:
            src = args.extract[0]
            curdir = os.curdir
        elif len(args.extract) == 2:
            src, curdir = args.extract
        else:
            parser.exit(1, parser.format_help())

        if is_tarfile(src):
            with TarFile.open(src, 'r:*') as tf:
                tf.extractall(path=curdir, filter=args.filter)
            if args.verbose:
                if curdir == '.':
                    msg = '{!r} file is extracted.'.format(src)
                else:
                    msg = ('{!r} file is extracted '
                           'into {!r} directory.').format(src, curdir)
                print(msg)
        else:
            parser.exit(1, '{!r} is not a tar archive.\n'.format(src))

    elif args.create is not None:
        tar_name = args.create.pop(0)
        _, ext = os.path.splitext(tar_name)
        compressions = {
            # gz
            '.gz': 'gz',
            '.tgz': 'gz',
            # xz
            '.xz': 'xz',
            '.txz': 'xz',
            # bz2
            '.bz2': 'bz2',
            '.tbz': 'bz2',
            '.tbz2': 'bz2',
            '.tb2': 'bz2',
        }
        tar_mode = 'w:' + compressions[ext] if ext in compressions else 'w'
        tar_files = args.create

        with TarFile.open(tar_name, tar_mode) as tf:
            for file_name in tar_files:
                tf.add(file_name)

        if args.verbose:
            print('{!r} file created.'.format(tar_name))

if __name__ == '__main__':
    main()
csv.py000064400000037420151153537470005732 0ustar00
"""
csv.py - read/write/investigate CSV files
"""

import re
from _csv import Error, __version__, writer, reader, register_dialect, \
                 unregister_dialect, get_dialect, list_dialects, \
                 field_size_limit, \
                 QUOTE_MINIMAL, QUOTE_ALL, QUOTE_NONNUMERIC, QUOTE_NONE, \
                 __doc__
from _csv import Dialect as _Dialect

from io import StringIO

__all__ = ["QUOTE_MINIMAL", "QUOTE_ALL", "QUOTE_NONNUMERIC", "QUOTE_NONE",
           "Error", "Dialect", "__doc__", "excel", "excel_tab",
           "field_size_limit", "reader", "writer",
           "register_dialect", "get_dialect", "list_dialects", "Sniffer",
           "unregister_dialect", "__version__", "DictReader", "DictWriter",
           "unix_dialect"]

class Dialect:
    """Describe a CSV dialect.

    This must be subclassed (see csv.excel).  Valid attributes are:
    delimiter, quotechar, escapechar, doublequote, skipinitialspace,
    lineterminator, quoting.

    """
    _name = ""
    _valid = False
    # placeholders
    delimiter = None
    quotechar = None
    escapechar = None
    doublequote = None
    skipinitialspace = None
    lineterminator = None
    quoting = None

    def __init__(self):
        if self.__class__ != Dialect:
            self._valid = True
        self._validate()

    def _validate(self):
        try:
            _Dialect(self)
        except TypeError as e:
            # We do this for compatibility with py2.3
            raise Error(str(e))

class excel(Dialect):
    """Describe the usual properties of Excel-generated CSV files."""
    delimiter = ','
    quotechar = '"'
    doublequote = True
    skipinitialspace = False
    lineterminator = '\r\n'
    quoting = QUOTE_MINIMAL
register_dialect("excel", excel)

class excel_tab(excel):
    """Describe the usual properties of Excel-generated TAB-delimited files."""
    delimiter = '\t'
register_dialect("excel-tab", excel_tab)

class unix_dialect(Dialect):
    """Describe the usual properties of Unix-generated CSV files."""
    delimiter = ','
    quotechar = '"'
    doublequote = True
    skipinitialspace = False
    lineterminator = '\n'
    quoting = QUOTE_ALL
register_dialect("unix", unix_dialect)


class DictReader:
    def __init__(self, f, fieldnames=None, restkey=None, restval=None,
                 dialect="excel", *args, **kwds):
        self._fieldnames = fieldnames   # list of keys for the dict
        self.restkey = restkey          # key to catch long rows
        self.restval = restval          # default value for short rows
        self.reader = reader(f, dialect, *args, **kwds)
        self.dialect = dialect
        self.line_num = 0

    def __iter__(self):
        return self

    @property
    def fieldnames(self):
        if self._fieldnames is None:
            try:
                self._fieldnames = next(self.reader)
            except StopIteration:
                pass
        self.line_num = self.reader.line_num
        return self._fieldnames

    @fieldnames.setter
    def fieldnames(self, value):
        self._fieldnames = value

    def __next__(self):
        if self.line_num == 0:
            # Used only for its side effect.
            self.fieldnames
        row = next(self.reader)
        self.line_num = self.reader.line_num

        # unlike the basic reader, we prefer not to return blanks,
        # because we will typically wind up with a dict full of None
        # values
        while row == []:
            row = next(self.reader)
        d = dict(zip(self.fieldnames, row))
        lf = len(self.fieldnames)
        lr = len(row)
        if lf < lr:
            d[self.restkey] = row[lf:]
        elif lf > lr:
            for key in self.fieldnames[lr:]:
                d[key] = self.restval
        return d


class DictWriter:
    def __init__(self, f, fieldnames, restval="", extrasaction="raise",
                 dialect="excel", *args, **kwds):
        self.fieldnames = fieldnames    # list of keys for the dict
        self.restval = restval          # for writing short dicts
        if extrasaction.lower() not in ("raise", "ignore"):
            raise ValueError("extrasaction (%s) must be 'raise' or 'ignore'"
                             % extrasaction)
        self.extrasaction = extrasaction
        self.writer = writer(f, dialect, *args, **kwds)

    def writeheader(self):
        header = dict(zip(self.fieldnames, self.fieldnames))
        return self.writerow(header)

    def _dict_to_list(self, rowdict):
        if self.extrasaction == "raise":
            wrong_fields = rowdict.keys() - self.fieldnames
            if wrong_fields:
                raise ValueError("dict contains fields not in fieldnames: "
                                 + ", ".join([repr(x) for x in wrong_fields]))
        return (rowdict.get(key, self.restval) for key in self.fieldnames)

    def writerow(self, rowdict):
        return self.writer.writerow(self._dict_to_list(rowdict))

    def writerows(self, rowdicts):
        return self.writer.writerows(map(self._dict_to_list, rowdicts))

# Guard Sniffer's type checking against builds that exclude complex()
try:
    complex
except NameError:
    complex = float

class Sniffer:
    '''
    "Sniffs" the format of a CSV file (i.e. delimiter, quotechar)
    Returns a Dialect object.
    '''
    def __init__(self):
        # in case there is more than one possible delimiter
        self.preferred = [',', '\t', ';', ' ', ':']


    def sniff(self, sample, delimiters=None):
        """
        Returns a dialect (or None) corresponding to the sample
        """

        quotechar, doublequote, delimiter, skipinitialspace = \
                   self._guess_quote_and_delimiter(sample, delimiters)
        if not delimiter:
            delimiter, skipinitialspace = self._guess_delimiter(sample,
                                                                delimiters)

        if not delimiter:
            raise Error("Could not determine delimiter")

        class dialect(Dialect):
            _name = "sniffed"
            lineterminator = '\r\n'
            quoting = QUOTE_MINIMAL
            # escapechar = ''

        dialect.doublequote = doublequote
        dialect.delimiter = delimiter
        # _csv.reader won't accept a quotechar of ''
        dialect.quotechar = quotechar or '"'
        dialect.skipinitialspace = skipinitialspace

        return dialect


    def _guess_quote_and_delimiter(self, data, delimiters):
        """
        Looks for text enclosed between two identical quotes
        (the probable quotechar) which are preceded and followed
        by the same character (the probable delimiter).
        For example:
                         ,'some text',
        The quote with the most wins, same with the delimiter.
        If there is no quotechar the delimiter can't be determined
        this way.
        """

        matches = []
        for restr in (r'(?P<delim>[^\w\n"\'])(?P<space> ?)(?P<quote>["\']).*?(?P=quote)(?P=delim)', # ,".*?",
                      r'(?:^|\n)(?P<quote>["\']).*?(?P=quote)(?P<delim>[^\w\n"\'])(?P<space> ?)',   #  ".*?",
                      r'(?P<delim>[^\w\n"\'])(?P<space> ?)(?P<quote>["\']).*?(?P=quote)(?:$|\n)',   # ,".*?"
                      r'(?:^|\n)(?P<quote>["\']).*?(?P=quote)(?:$|\n)'):                            #  ".*?" (no delim, no space)
            regexp = re.compile(restr, re.DOTALL | re.MULTILINE)
            matches = regexp.findall(data)
            if matches:
                break

        if not matches:
            # (quotechar, doublequote, delimiter, skipinitialspace)
            return ('', False, None, 0)
        quotes = {}
        delims = {}
        spaces = 0
        groupindex = regexp.groupindex
        for m in matches:
            n = groupindex['quote'] - 1
            key = m[n]
            if key:
                quotes[key] = quotes.get(key, 0) + 1
            try:
                n = groupindex['delim'] - 1
                key = m[n]
            except KeyError:
                continue
            if key and (delimiters is None or key in delimiters):
                delims[key] = delims.get(key, 0) + 1
            try:
                n = groupindex['space'] - 1
            except KeyError:
                continue
            if m[n]:
                spaces += 1

        quotechar = max(quotes, key=quotes.get)

        if delims:
            delim = max(delims, key=delims.get)
            skipinitialspace = delims[delim] == spaces
            if delim == '\n': # most likely a file with a single column
                delim = ''
        else:
            # there is *no* delimiter, it's a single column of quoted data
            delim = ''
            skipinitialspace = 0

        # if we see an extra quote between delimiters, we've got a
        # double quoted format
        dq_regexp = re.compile(
                               r"((%(delim)s)|^)\W*%(quote)s[^%(delim)s\n]*%(quote)s[^%(delim)s\n]*%(quote)s\W*((%(delim)s)|$)" % \
                               {'delim':re.escape(delim), 'quote':quotechar}, re.MULTILINE)



        if dq_regexp.search(data):
            doublequote = True
        else:
            doublequote = False

        return (quotechar, doublequote, delim, skipinitialspace)


    def _guess_delimiter(self, data, delimiters):
        """
        The delimiter /should/ occur the same number of times on
        each row. However, due to malformed data, it may not. We don't want
        an all or nothing approach, so we allow for small variations in this
        number.
          1) build a table of the frequency of each character on every line.
          2) build a table of frequencies of this frequency (meta-frequency?),
             e.g.  'x occurred 5 times in 10 rows, 6 times in 1000 rows,
             7 times in 2 rows'
          3) use the mode of the meta-frequency to determine the /expected/
             frequency for that character
          4) find out how often the character actually meets that goal
          5) the character that best meets its goal is the delimiter
        For performance reasons, the data is evaluated in chunks, so it can
        try and evaluate the smallest portion of the data possible, evaluating
        additional chunks as necessary.
        """

        data = list(filter(None, data.split('\n')))

        ascii = [chr(c) for c in range(127)] # 7-bit ASCII

        # build frequency tables
        chunkLength = min(10, len(data))
        iteration = 0
        charFrequency = {}
        modes = {}
        delims = {}
        start, end = 0, chunkLength
        while start < len(data):
            iteration += 1
            for line in data[start:end]:
                for char in ascii:
                    metaFrequency = charFrequency.get(char, {})
                    # must count even if frequency is 0
                    freq = line.count(char)
                    # value is the mode
                    metaFrequency[freq] = metaFrequency.get(freq, 0) + 1
                    charFrequency[char] = metaFrequency

            for char in charFrequency.keys():
                items = list(charFrequency[char].items())
                if len(items) == 1 and items[0][0] == 0:
                    continue
                # get the mode of the frequencies
                if len(items) > 1:
                    modes[char] = max(items, key=lambda x: x[1])
                    # adjust the mode - subtract the sum of all
                    # other frequencies
                    items.remove(modes[char])
                    modes[char] = (modes[char][0], modes[char][1]
                                   - sum(item[1] for item in items))
                else:
                    modes[char] = items[0]

            # build a list of possible delimiters
            modeList = modes.items()
            total = float(min(chunkLength * iteration, len(data)))
            # (rows of consistent data) / (number of rows) = 100%
            consistency = 1.0
            # minimum consistency threshold
            threshold = 0.9
            while len(delims) == 0 and consistency >= threshold:
                for k, v in modeList:
                    if v[0] > 0 and v[1] > 0:
                        if ((v[1]/total) >= consistency and
                            (delimiters is None or k in delimiters)):
                            delims[k] = v
                consistency -= 0.01

            if len(delims) == 1:
                delim = list(delims.keys())[0]
                skipinitialspace = (data[0].count(delim) ==
                                    data[0].count("%c " % delim))
                return (delim, skipinitialspace)

            # analyze another chunkLength lines
            start = end
            end += chunkLength

        if not delims:
            return ('', 0)

        # if there's more than one, fall back to a 'preferred' list
        if len(delims) > 1:
            for d in self.preferred:
                if d in delims.keys():
                    skipinitialspace = (data[0].count(d) ==
                                        data[0].count("%c " % d))
                    return (d, skipinitialspace)

        # nothing else indicates a preference, pick the character that
        # dominates(?)
        items = [(v,k) for (k,v) in delims.items()]
        items.sort()
        delim = items[-1][1]

        skipinitialspace = (data[0].count(delim) ==
                            data[0].count("%c " % delim))
        return (delim, skipinitialspace)


    def has_header(self, sample):
        # Creates a dictionary of types of data in each column. If any
        # column is of a single type (say, integers), *except* for the first
        # row, then the first row is presumed to be labels. If the type
        # can't be determined, it is assumed to be a string in which case
        # the length of the string is the determining factor: if all of the
        # rows except for the first are the same length, it's a header.
        # Finally, a 'vote' is taken at the end for each column, adding or
        # subtracting from the likelihood of the first row being a header.

        rdr = reader(StringIO(sample), self.sniff(sample))

        header = next(rdr) # assume first row is header

        columns = len(header)
        columnTypes = {}
        for i in range(columns): columnTypes[i] = None

        checked = 0
        for row in rdr:
            # arbitrary number of rows to check, to keep it sane
            if checked > 20:
                break
            checked += 1

            if len(row) != columns:
                continue # skip rows that have irregular number of columns

            for col in list(columnTypes.keys()):

                for thisType in [int, float, complex]:
                    try:
                        thisType(row[col])
                        break
                    except (ValueError, OverflowError):
                        pass
                else:
                    # fallback to length of string
                    thisType = len(row[col])

                if thisType != columnTypes[col]:
                    if columnTypes[col] is None: # add new column type
                        columnTypes[col] = thisType
                    else:
                        # type is inconsistent, remove column from
                        # consideration
                        del columnTypes[col]

        # finally, compare results against first row and "vote"
        # on whether it's a header
        hasHeader = 0
        for col, colType in columnTypes.items():
            if type(colType) == type(0): # it's a length
                if len(header[col]) != colType:
                    hasHeader += 1
                else:
                    hasHeader -= 1
            else: # attempt typecast
                try:
                    colType(header[col])
                except (ValueError, TypeError):
                    hasHeader += 1
                else:
                    hasHeader -= 1

        return hasHeader > 0
shlex.py000064400000032015151153537470006255 0ustar00"""A lexical analyzer class for simple shell-like syntaxes."""

# Module and documentation by Eric S. Raymond, 21 Dec 1998
# Input stacking and error message cleanup added by ESR, March 2000
# push_source() and pop_source() made explicit by ESR, January 2001.
# Posix compliance, split(), string arguments, and
# iterator interface by Gustavo Niemeyer, April 2003.
# changes to tokenize more like Posix shells by Vinay Sajip, July 2016.

import os
import re
import sys
from collections import deque

from io import StringIO

__all__ = ["shlex", "split", "quote", "join"]

class shlex:
    "A lexical analyzer class for simple shell-like syntaxes."
    def __init__(self, instream=None, infile=None, posix=False,
                 punctuation_chars=False):
        if isinstance(instream, str):
            instream = StringIO(instream)
        if instream is not None:
            self.instream = instream
            self.infile = infile
        else:
            self.instream = sys.stdin
            self.infile = None
        self.posix = posix
        if posix:
            self.eof = None
        else:
            self.eof = ''
        self.commenters = '#'
        self.wordchars = ('abcdfeghijklmnopqrstuvwxyz'
                          'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_')
        if self.posix:
            self.wordchars += ('ßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ'
                               'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ')
        self.whitespace = ' \t\r\n'
        self.whitespace_split = False
        self.quotes = '\'"'
        self.escape = '\\'
        self.escapedquotes = '"'
        self.state = ' '
        self.pushback = deque()
        self.lineno = 1
        self.debug = 0
        self.token = ''
        self.filestack = deque()
        self.source = None
        if not punctuation_chars:
            punctuation_chars = ''
        elif punctuation_chars is True:
            punctuation_chars = '();<>|&'
        self._punctuation_chars = punctuation_chars
        if punctuation_chars:
            # _pushback_chars is a push back queue used by lookahead logic
            self._pushback_chars = deque()
            # these chars added because allowed in file names, args, wildcards
            self.wordchars += '~-./*?='
            #remove any punctuation chars from wordchars
            t = self.wordchars.maketrans(dict.fromkeys(punctuation_chars))
            self.wordchars = self.wordchars.translate(t)

    @property
    def punctuation_chars(self):
        return self._punctuation_chars

    def push_token(self, tok):
        "Push a token onto the stack popped by the get_token method"
        if self.debug >= 1:
            print("shlex: pushing token " + repr(tok))
        self.pushback.appendleft(tok)

    def push_source(self, newstream, newfile=None):
        "Push an input source onto the lexer's input source stack."
        if isinstance(newstream, str):
            newstream = StringIO(newstream)
        self.filestack.appendleft((self.infile, self.instream, self.lineno))
        self.infile = newfile
        self.instream = newstream
        self.lineno = 1
        if self.debug:
            if newfile is not None:
                print('shlex: pushing to file %s' % (self.infile,))
            else:
                print('shlex: pushing to stream %s' % (self.instream,))

    def pop_source(self):
        "Pop the input source stack."
        self.instream.close()
        (self.infile, self.instream, self.lineno) = self.filestack.popleft()
        if self.debug:
            print('shlex: popping to %s, line %d' \
                  % (self.instream, self.lineno))
        self.state = ' '

    def get_token(self):
        "Get a token from the input stream (or from stack if it's nonempty)"
        if self.pushback:
            tok = self.pushback.popleft()
            if self.debug >= 1:
                print("shlex: popping token " + repr(tok))
            return tok
        # No pushback.  Get a token.
        raw = self.read_token()
        # Handle inclusions
        if self.source is not None:
            while raw == self.source:
                spec = self.sourcehook(self.read_token())
                if spec:
                    (newfile, newstream) = spec
                    self.push_source(newstream, newfile)
                raw = self.get_token()
        # Maybe we got EOF instead?
        while raw == self.eof:
            if not self.filestack:
                return self.eof
            else:
                self.pop_source()
                raw = self.get_token()
        # Neither inclusion nor EOF
        if self.debug >= 1:
            if raw != self.eof:
                print("shlex: token=" + repr(raw))
            else:
                print("shlex: token=EOF")
        return raw

    def read_token(self):
        quoted = False
        escapedstate = ' '
        while True:
            if self.punctuation_chars and self._pushback_chars:
                nextchar = self._pushback_chars.pop()
            else:
                nextchar = self.instream.read(1)
            if nextchar == '\n':
                self.lineno += 1
            if self.debug >= 3:
                print("shlex: in state %r I see character: %r" % (self.state,
                                                                  nextchar))
            if self.state is None:
                self.token = ''        # past end of file
                break
            elif self.state == ' ':
                if not nextchar:
                    self.state = None  # end of file
                    break
                elif nextchar in self.whitespace:
                    if self.debug >= 2:
                        print("shlex: I see whitespace in whitespace state")
                    if self.token or (self.posix and quoted):
                        break   # emit current token
                    else:
                        continue
                elif nextchar in self.commenters:
                    self.instream.readline()
                    self.lineno += 1
                elif self.posix and nextchar in self.escape:
                    escapedstate = 'a'
                    self.state = nextchar
                elif nextchar in self.wordchars:
                    self.token = nextchar
                    self.state = 'a'
                elif nextchar in self.punctuation_chars:
                    self.token = nextchar
                    self.state = 'c'
                elif nextchar in self.quotes:
                    if not self.posix:
                        self.token = nextchar
                    self.state = nextchar
                elif self.whitespace_split:
                    self.token = nextchar
                    self.state = 'a'
                else:
                    self.token = nextchar
                    if self.token or (self.posix and quoted):
                        break   # emit current token
                    else:
                        continue
            elif self.state in self.quotes:
                quoted = True
                if not nextchar:      # end of file
                    if self.debug >= 2:
                        print("shlex: I see EOF in quotes state")
                    # XXX what error should be raised here?
                    raise ValueError("No closing quotation")
                if nextchar == self.state:
                    if not self.posix:
                        self.token += nextchar
                        self.state = ' '
                        break
                    else:
                        self.state = 'a'
                elif (self.posix and nextchar in self.escape and self.state
                      in self.escapedquotes):
                    escapedstate = self.state
                    self.state = nextchar
                else:
                    self.token += nextchar
            elif self.state in self.escape:
                if not nextchar:      # end of file
                    if self.debug >= 2:
                        print("shlex: I see EOF in escape state")
                    # XXX what error should be raised here?
                    raise ValueError("No escaped character")
                # In posix shells, only the quote itself or the escape
                # character may be escaped within quotes.
                if (escapedstate in self.quotes and
                        nextchar != self.state and nextchar != escapedstate):
                    self.token += self.state
                self.token += nextchar
                self.state = escapedstate
            elif self.state in ('a', 'c'):
                if not nextchar:
                    self.state = None   # end of file
                    break
                elif nextchar in self.whitespace:
                    if self.debug >= 2:
                        print("shlex: I see whitespace in word state")
                    self.state = ' '
                    if self.token or (self.posix and quoted):
                        break   # emit current token
                    else:
                        continue
                elif nextchar in self.commenters:
                    self.instream.readline()
                    self.lineno += 1
                    if self.posix:
                        self.state = ' '
                        if self.token or (self.posix and quoted):
                            break   # emit current token
                        else:
                            continue
                elif self.state == 'c':
                    if nextchar in self.punctuation_chars:
                        self.token += nextchar
                    else:
                        if nextchar not in self.whitespace:
                            self._pushback_chars.append(nextchar)
                        self.state = ' '
                        break
                elif self.posix and nextchar in self.quotes:
                    self.state = nextchar
                elif self.posix and nextchar in self.escape:
                    escapedstate = 'a'
                    self.state = nextchar
                elif (nextchar in self.wordchars or nextchar in self.quotes
                      or (self.whitespace_split and
                          nextchar not in self.punctuation_chars)):
                    self.token += nextchar
                else:
                    if self.punctuation_chars:
                        self._pushback_chars.append(nextchar)
                    else:
                        self.pushback.appendleft(nextchar)
                    if self.debug >= 2:
                        print("shlex: I see punctuation in word state")
                    self.state = ' '
                    if self.token or (self.posix and quoted):
                        break   # emit current token
                    else:
                        continue
        result = self.token
        self.token = ''
        if self.posix and not quoted and result == '':
            result = None
        if self.debug > 1:
            if result:
                print("shlex: raw token=" + repr(result))
            else:
                print("shlex: raw token=EOF")
        return result

    def sourcehook(self, newfile):
        "Hook called on a filename to be sourced."
        if newfile[0] == '"':
            newfile = newfile[1:-1]
        # This implements cpp-like semantics for relative-path inclusion.
        if isinstance(self.infile, str) and not os.path.isabs(newfile):
            newfile = os.path.join(os.path.dirname(self.infile), newfile)
        return (newfile, open(newfile, "r"))

    def error_leader(self, infile=None, lineno=None):
        "Emit a C-compiler-like, Emacs-friendly error-message leader."
        if infile is None:
            infile = self.infile
        if lineno is None:
            lineno = self.lineno
        return "\"%s\", line %d: " % (infile, lineno)

    def __iter__(self):
        return self

    def __next__(self):
        token = self.get_token()
        if token == self.eof:
            raise StopIteration
        return token

def split(s, comments=False, posix=True):
    """Split the string *s* using shell-like syntax."""
    lex = shlex(s, posix=posix)
    lex.whitespace_split = True
    if not comments:
        lex.commenters = ''
    return list(lex)


def join(split_command):
    """Return a shell-escaped string from *split_command*."""
    return ' '.join(quote(arg) for arg in split_command)


_find_unsafe = re.compile(r'[^\w@%+=:,./-]', re.ASCII).search

def quote(s):
    """Return a shell-escaped version of the string *s*."""
    if not s:
        return "''"
    if _find_unsafe(s) is None:
        return s

    # use single quotes, and put single quotes into double quotes
    # the string $'b is then quoted as '$'"'"'b'
    return "'" + s.replace("'", "'\"'\"'") + "'"


def _print_tokens(lexer):
    while 1:
        tt = lexer.get_token()
        if not tt:
            break
        print("Token: " + repr(tt))

if __name__ == '__main__':
    if len(sys.argv) == 1:
        _print_tokens(shlex())
    else:
        fn = sys.argv[1]
        with open(fn) as f:
            _print_tokens(shlex(f, fn))
xmlrpc/server.py000064400000107471151153537470007756 0ustar00r"""XML-RPC Servers.

This module can be used to create simple XML-RPC servers
by creating a server and either installing functions, a
class instance, or by extending the SimpleXMLRPCServer
class.

It can also be used to handle XML-RPC requests in a CGI
environment using CGIXMLRPCRequestHandler.

The Doc* classes can be used to create XML-RPC servers that
serve pydoc-style documentation in response to HTTP
GET requests. This documentation is dynamically generated
based on the functions and methods registered with the
server.

A list of possible usage patterns follows:

1. Install functions:

server = SimpleXMLRPCServer(("localhost", 8000))
server.register_function(pow)
server.register_function(lambda x,y: x+y, 'add')
server.serve_forever()

2. Install an instance:

class MyFuncs:
    def __init__(self):
        # make all of the sys functions available through sys.func_name
        import sys
        self.sys = sys
    def _listMethods(self):
        # implement this method so that system.listMethods
        # knows to advertise the sys methods
        return list_public_methods(self) + \
                ['sys.' + method for method in list_public_methods(self.sys)]
    def pow(self, x, y): return pow(x, y)
    def add(self, x, y) : return x + y

server = SimpleXMLRPCServer(("localhost", 8000))
server.register_introspection_functions()
server.register_instance(MyFuncs())
server.serve_forever()

3. Install an instance with custom dispatch method:

class Math:
    def _listMethods(self):
        # this method must be present for system.listMethods
        # to work
        return ['add', 'pow']
    def _methodHelp(self, method):
        # this method must be present for system.methodHelp
        # to work
        if method == 'add':
            return "add(2,3) => 5"
        elif method == 'pow':
            return "pow(x, y[, z]) => number"
        else:
            # By convention, return empty
            # string if no help is available
            return ""
    def _dispatch(self, method, params):
        if method == 'pow':
            return pow(*params)
        elif method == 'add':
            return params[0] + params[1]
        else:
            raise ValueError('bad method')

server = SimpleXMLRPCServer(("localhost", 8000))
server.register_introspection_functions()
server.register_instance(Math())
server.serve_forever()

4. Subclass SimpleXMLRPCServer:

class MathServer(SimpleXMLRPCServer):
    def _dispatch(self, method, params):
        try:
            # We are forcing the 'export_' prefix on methods that are
            # callable through XML-RPC to prevent potential security
            # problems
            func = getattr(self, 'export_' + method)
        except AttributeError:
            raise Exception('method "%s" is not supported' % method)
        else:
            return func(*params)

    def export_add(self, x, y):
        return x + y

server = MathServer(("localhost", 8000))
server.serve_forever()

5. CGI script:

server = CGIXMLRPCRequestHandler()
server.register_function(pow)
server.handle_request()
"""

# Written by Brian Quinlan (brian@sweetapp.com).
# Based on code written by Fredrik Lundh.

from xmlrpc.client import Fault, dumps, loads, gzip_encode, gzip_decode
from http.server import BaseHTTPRequestHandler
from functools import partial
from inspect import signature
import html
import http.server
import socketserver
import sys
import os
import re
import pydoc
import traceback
try:
    import fcntl
except ImportError:
    fcntl = None

def resolve_dotted_attribute(obj, attr, allow_dotted_names=True):
    """resolve_dotted_attribute(a, 'b.c.d') => a.b.c.d

    Resolves a dotted attribute name to an object.  Raises
    an AttributeError if any attribute in the chain starts with a '_'.

    If the optional allow_dotted_names argument is false, dots are not
    supported and this function operates similar to getattr(obj, attr).
    """

    if allow_dotted_names:
        attrs = attr.split('.')
    else:
        attrs = [attr]

    for i in attrs:
        if i.startswith('_'):
            raise AttributeError(
                'attempt to access private attribute "%s"' % i
                )
        else:
            obj = getattr(obj,i)
    return obj

def list_public_methods(obj):
    """Returns a list of attribute strings, found in the specified
    object, which represent callable attributes"""

    return [member for member in dir(obj)
                if not member.startswith('_') and
                    callable(getattr(obj, member))]

class SimpleXMLRPCDispatcher:
    """Mix-in class that dispatches XML-RPC requests.

    This class is used to register XML-RPC method handlers
    and then to dispatch them. This class doesn't need to be
    instanced directly when used by SimpleXMLRPCServer but it
    can be instanced when used by the MultiPathXMLRPCServer
    """

    def __init__(self, allow_none=False, encoding=None,
                 use_builtin_types=False):
        self.funcs = {}
        self.instance = None
        self.allow_none = allow_none
        self.encoding = encoding or 'utf-8'
        self.use_builtin_types = use_builtin_types

    def register_instance(self, instance, allow_dotted_names=False):
        """Registers an instance to respond to XML-RPC requests.

        Only one instance can be installed at a time.

        If the registered instance has a _dispatch method then that
        method will be called with the name of the XML-RPC method and
        its parameters as a tuple
        e.g. instance._dispatch('add',(2,3))

        If the registered instance does not have a _dispatch method
        then the instance will be searched to find a matching method
        and, if found, will be called. Methods beginning with an '_'
        are considered private and will not be called by
        SimpleXMLRPCServer.

        If a registered function matches an XML-RPC request, then it
        will be called instead of the registered instance.

        If the optional allow_dotted_names argument is true and the
        instance does not have a _dispatch method, method names
        containing dots are supported and resolved, as long as none of
        the name segments start with an '_'.

            *** SECURITY WARNING: ***

            Enabling the allow_dotted_names options allows intruders
            to access your module's global variables and may allow
            intruders to execute arbitrary code on your machine.  Only
            use this option on a secure, closed network.

        """

        self.instance = instance
        self.allow_dotted_names = allow_dotted_names

    def register_function(self, function=None, name=None):
        """Registers a function to respond to XML-RPC requests.

        The optional name argument can be used to set a Unicode name
        for the function.
        """
        # decorator factory
        if function is None:
            return partial(self.register_function, name=name)

        if name is None:
            name = function.__name__
        self.funcs[name] = function

        return function

    def register_introspection_functions(self):
        """Registers the XML-RPC introspection methods in the system
        namespace.

        see http://xmlrpc.usefulinc.com/doc/reserved.html
        """

        self.funcs.update({'system.listMethods' : self.system_listMethods,
                      'system.methodSignature' : self.system_methodSignature,
                      'system.methodHelp' : self.system_methodHelp})

    def register_multicall_functions(self):
        """Registers the XML-RPC multicall method in the system
        namespace.

        see http://www.xmlrpc.com/discuss/msgReader$1208"""

        self.funcs.update({'system.multicall' : self.system_multicall})

    def _marshaled_dispatch(self, data, dispatch_method = None, path = None):
        """Dispatches an XML-RPC method from marshalled (XML) data.

        XML-RPC methods are dispatched from the marshalled (XML) data
        using the _dispatch method and the result is returned as
        marshalled data. For backwards compatibility, a dispatch
        function can be provided as an argument (see comment in
        SimpleXMLRPCRequestHandler.do_POST) but overriding the
        existing method through subclassing is the preferred means
        of changing method dispatch behavior.
        """

        try:
            params, method = loads(data, use_builtin_types=self.use_builtin_types)

            # generate response
            if dispatch_method is not None:
                response = dispatch_method(method, params)
            else:
                response = self._dispatch(method, params)
            # wrap response in a singleton tuple
            response = (response,)
            response = dumps(response, methodresponse=1,
                             allow_none=self.allow_none, encoding=self.encoding)
        except Fault as fault:
            response = dumps(fault, allow_none=self.allow_none,
                             encoding=self.encoding)
        except:
            # report exception back to server
            exc_type, exc_value, exc_tb = sys.exc_info()
            try:
                response = dumps(
                    Fault(1, "%s:%s" % (exc_type, exc_value)),
                    encoding=self.encoding, allow_none=self.allow_none,
                    )
            finally:
                # Break reference cycle
                exc_type = exc_value = exc_tb = None

        return response.encode(self.encoding, 'xmlcharrefreplace')

    def system_listMethods(self):
        """system.listMethods() => ['add', 'subtract', 'multiple']

        Returns a list of the methods supported by the server."""

        methods = set(self.funcs.keys())
        if self.instance is not None:
            # Instance can implement _listMethod to return a list of
            # methods
            if hasattr(self.instance, '_listMethods'):
                methods |= set(self.instance._listMethods())
            # if the instance has a _dispatch method then we
            # don't have enough information to provide a list
            # of methods
            elif not hasattr(self.instance, '_dispatch'):
                methods |= set(list_public_methods(self.instance))
        return sorted(methods)

    def system_methodSignature(self, method_name):
        """system.methodSignature('add') => [double, int, int]

        Returns a list describing the signature of the method. In the
        above example, the add method takes two integers as arguments
        and returns a double result.

        This server does NOT support system.methodSignature."""

        # See http://xmlrpc.usefulinc.com/doc/sysmethodsig.html

        return 'signatures not supported'

    def system_methodHelp(self, method_name):
        """system.methodHelp('add') => "Adds two integers together"

        Returns a string containing documentation for the specified method."""

        method = None
        if method_name in self.funcs:
            method = self.funcs[method_name]
        elif self.instance is not None:
            # Instance can implement _methodHelp to return help for a method
            if hasattr(self.instance, '_methodHelp'):
                return self.instance._methodHelp(method_name)
            # if the instance has a _dispatch method then we
            # don't have enough information to provide help
            elif not hasattr(self.instance, '_dispatch'):
                try:
                    method = resolve_dotted_attribute(
                                self.instance,
                                method_name,
                                self.allow_dotted_names
                                )
                except AttributeError:
                    pass

        # Note that we aren't checking that the method actually
        # be a callable object of some kind
        if method is None:
            return ""
        else:
            return pydoc.getdoc(method)

    def system_multicall(self, call_list):
        """system.multicall([{'methodName': 'add', 'params': [2, 2]}, ...]) => \
[[4], ...]

        Allows the caller to package multiple XML-RPC calls into a single
        request.

        See http://www.xmlrpc.com/discuss/msgReader$1208
        """

        results = []
        for call in call_list:
            method_name = call['methodName']
            params = call['params']

            try:
                # XXX A marshalling error in any response will fail the entire
                # multicall. If someone cares they should fix this.
                results.append([self._dispatch(method_name, params)])
            except Fault as fault:
                results.append(
                    {'faultCode' : fault.faultCode,
                     'faultString' : fault.faultString}
                    )
            except:
                exc_type, exc_value, exc_tb = sys.exc_info()
                try:
                    results.append(
                        {'faultCode' : 1,
                         'faultString' : "%s:%s" % (exc_type, exc_value)}
                        )
                finally:
                    # Break reference cycle
                    exc_type = exc_value = exc_tb = None
        return results

    def _dispatch(self, method, params):
        """Dispatches the XML-RPC method.

        XML-RPC calls are forwarded to a registered function that
        matches the called XML-RPC method name. If no such function
        exists then the call is forwarded to the registered instance,
        if available.

        If the registered instance has a _dispatch method then that
        method will be called with the name of the XML-RPC method and
        its parameters as a tuple
        e.g. instance._dispatch('add',(2,3))

        If the registered instance does not have a _dispatch method
        then the instance will be searched to find a matching method
        and, if found, will be called.

        Methods beginning with an '_' are considered private and will
        not be called.
        """

        try:
            # call the matching registered function
            func = self.funcs[method]
        except KeyError:
            pass
        else:
            if func is not None:
                return func(*params)
            raise Exception('method "%s" is not supported' % method)

        if self.instance is not None:
            if hasattr(self.instance, '_dispatch'):
                # call the `_dispatch` method on the instance
                return self.instance._dispatch(method, params)

            # call the instance's method directly
            try:
                func = resolve_dotted_attribute(
                    self.instance,
                    method,
                    self.allow_dotted_names
                )
            except AttributeError:
                pass
            else:
                if func is not None:
                    return func(*params)

        raise Exception('method "%s" is not supported' % method)

class SimpleXMLRPCRequestHandler(BaseHTTPRequestHandler):
    """Simple XML-RPC request handler class.

    Handles all HTTP POST requests and attempts to decode them as
    XML-RPC requests.
    """

    # Class attribute listing the accessible path components;
    # paths not on this list will result in a 404 error.
    rpc_paths = ('/', '/RPC2')

    #if not None, encode responses larger than this, if possible
    encode_threshold = 1400 #a common MTU

    #Override form StreamRequestHandler: full buffering of output
    #and no Nagle.
    wbufsize = -1
    disable_nagle_algorithm = True

    # a re to match a gzip Accept-Encoding
    aepattern = re.compile(r"""
                            \s* ([^\s;]+) \s*            #content-coding
                            (;\s* q \s*=\s* ([0-9\.]+))? #q
                            """, re.VERBOSE | re.IGNORECASE)

    def accept_encodings(self):
        r = {}
        ae = self.headers.get("Accept-Encoding", "")
        for e in ae.split(","):
            match = self.aepattern.match(e)
            if match:
                v = match.group(3)
                v = float(v) if v else 1.0
                r[match.group(1)] = v
        return r

    def is_rpc_path_valid(self):
        if self.rpc_paths:
            return self.path in self.rpc_paths
        else:
            # If .rpc_paths is empty, just assume all paths are legal
            return True

    def do_POST(self):
        """Handles the HTTP POST request.

        Attempts to interpret all HTTP POST requests as XML-RPC calls,
        which are forwarded to the server's _dispatch method for handling.
        """

        # Check that the path is legal
        if not self.is_rpc_path_valid():
            self.report_404()
            return

        try:
            # Get arguments by reading body of request.
            # We read this in chunks to avoid straining
            # socket.read(); around the 10 or 15Mb mark, some platforms
            # begin to have problems (bug #792570).
            max_chunk_size = 10*1024*1024
            size_remaining = int(self.headers["content-length"])
            L = []
            while size_remaining:
                chunk_size = min(size_remaining, max_chunk_size)
                chunk = self.rfile.read(chunk_size)
                if not chunk:
                    break
                L.append(chunk)
                size_remaining -= len(L[-1])
            data = b''.join(L)

            data = self.decode_request_content(data)
            if data is None:
                return #response has been sent

            # In previous versions of SimpleXMLRPCServer, _dispatch
            # could be overridden in this class, instead of in
            # SimpleXMLRPCDispatcher. To maintain backwards compatibility,
            # check to see if a subclass implements _dispatch and dispatch
            # using that method if present.
            response = self.server._marshaled_dispatch(
                    data, getattr(self, '_dispatch', None), self.path
                )
        except Exception as e: # This should only happen if the module is buggy
            # internal error, report as HTTP server error
            self.send_response(500)

            # Send information about the exception if requested
            if hasattr(self.server, '_send_traceback_header') and \
                    self.server._send_traceback_header:
                self.send_header("X-exception", str(e))
                trace = traceback.format_exc()
                trace = str(trace.encode('ASCII', 'backslashreplace'), 'ASCII')
                self.send_header("X-traceback", trace)

            self.send_header("Content-length", "0")
            self.end_headers()
        else:
            self.send_response(200)
            self.send_header("Content-type", "text/xml")
            if self.encode_threshold is not None:
                if len(response) > self.encode_threshold:
                    q = self.accept_encodings().get("gzip", 0)
                    if q:
                        try:
                            response = gzip_encode(response)
                            self.send_header("Content-Encoding", "gzip")
                        except NotImplementedError:
                            pass
            self.send_header("Content-length", str(len(response)))
            self.end_headers()
            self.wfile.write(response)

    def decode_request_content(self, data):
        #support gzip encoding of request
        encoding = self.headers.get("content-encoding", "identity").lower()
        if encoding == "identity":
            return data
        if encoding == "gzip":
            try:
                return gzip_decode(data)
            except NotImplementedError:
                self.send_response(501, "encoding %r not supported" % encoding)
            except ValueError:
                self.send_response(400, "error decoding gzip content")
        else:
            self.send_response(501, "encoding %r not supported" % encoding)
        self.send_header("Content-length", "0")
        self.end_headers()

    def report_404 (self):
            # Report a 404 error
        self.send_response(404)
        response = b'No such page'
        self.send_header("Content-type", "text/plain")
        self.send_header("Content-length", str(len(response)))
        self.end_headers()
        self.wfile.write(response)

    def log_request(self, code='-', size='-'):
        """Selectively log an accepted request."""

        if self.server.logRequests:
            BaseHTTPRequestHandler.log_request(self, code, size)

class SimpleXMLRPCServer(socketserver.TCPServer,
                         SimpleXMLRPCDispatcher):
    """Simple XML-RPC server.

    Simple XML-RPC server that allows functions and a single instance
    to be installed to handle requests. The default implementation
    attempts to dispatch XML-RPC calls to the functions or instance
    installed in the server. Override the _dispatch method inherited
    from SimpleXMLRPCDispatcher to change this behavior.
    """

    allow_reuse_address = True

    # Warning: this is for debugging purposes only! Never set this to True in
    # production code, as will be sending out sensitive information (exception
    # and stack trace details) when exceptions are raised inside
    # SimpleXMLRPCRequestHandler.do_POST
    _send_traceback_header = False

    def __init__(self, addr, requestHandler=SimpleXMLRPCRequestHandler,
                 logRequests=True, allow_none=False, encoding=None,
                 bind_and_activate=True, use_builtin_types=False):
        self.logRequests = logRequests

        SimpleXMLRPCDispatcher.__init__(self, allow_none, encoding, use_builtin_types)
        socketserver.TCPServer.__init__(self, addr, requestHandler, bind_and_activate)


class MultiPathXMLRPCServer(SimpleXMLRPCServer):
    """Multipath XML-RPC Server
    This specialization of SimpleXMLRPCServer allows the user to create
    multiple Dispatcher instances and assign them to different
    HTTP request paths.  This makes it possible to run two or more
    'virtual XML-RPC servers' at the same port.
    Make sure that the requestHandler accepts the paths in question.
    """
    def __init__(self, addr, requestHandler=SimpleXMLRPCRequestHandler,
                 logRequests=True, allow_none=False, encoding=None,
                 bind_and_activate=True, use_builtin_types=False):

        SimpleXMLRPCServer.__init__(self, addr, requestHandler, logRequests, allow_none,
                                    encoding, bind_and_activate, use_builtin_types)
        self.dispatchers = {}
        self.allow_none = allow_none
        self.encoding = encoding or 'utf-8'

    def add_dispatcher(self, path, dispatcher):
        self.dispatchers[path] = dispatcher
        return dispatcher

    def get_dispatcher(self, path):
        return self.dispatchers[path]

    def _marshaled_dispatch(self, data, dispatch_method = None, path = None):
        try:
            response = self.dispatchers[path]._marshaled_dispatch(
               data, dispatch_method, path)
        except:
            # report low level exception back to server
            # (each dispatcher should have handled their own
            # exceptions)
            exc_type, exc_value = sys.exc_info()[:2]
            try:
                response = dumps(
                    Fault(1, "%s:%s" % (exc_type, exc_value)),
                    encoding=self.encoding, allow_none=self.allow_none)
                response = response.encode(self.encoding, 'xmlcharrefreplace')
            finally:
                # Break reference cycle
                exc_type = exc_value = None
        return response

class CGIXMLRPCRequestHandler(SimpleXMLRPCDispatcher):
    """Simple handler for XML-RPC data passed through CGI."""

    def __init__(self, allow_none=False, encoding=None, use_builtin_types=False):
        SimpleXMLRPCDispatcher.__init__(self, allow_none, encoding, use_builtin_types)

    def handle_xmlrpc(self, request_text):
        """Handle a single XML-RPC request"""

        response = self._marshaled_dispatch(request_text)

        print('Content-Type: text/xml')
        print('Content-Length: %d' % len(response))
        print()
        sys.stdout.flush()
        sys.stdout.buffer.write(response)
        sys.stdout.buffer.flush()

    def handle_get(self):
        """Handle a single HTTP GET request.

        Default implementation indicates an error because
        XML-RPC uses the POST method.
        """

        code = 400
        message, explain = BaseHTTPRequestHandler.responses[code]

        response = http.server.DEFAULT_ERROR_MESSAGE % \
            {
             'code' : code,
             'message' : message,
             'explain' : explain
            }
        response = response.encode('utf-8')
        print('Status: %d %s' % (code, message))
        print('Content-Type: %s' % http.server.DEFAULT_ERROR_CONTENT_TYPE)
        print('Content-Length: %d' % len(response))
        print()
        sys.stdout.flush()
        sys.stdout.buffer.write(response)
        sys.stdout.buffer.flush()

    def handle_request(self, request_text=None):
        """Handle a single XML-RPC request passed through a CGI post method.

        If no XML data is given then it is read from stdin. The resulting
        XML-RPC response is printed to stdout along with the correct HTTP
        headers.
        """

        if request_text is None and \
            os.environ.get('REQUEST_METHOD', None) == 'GET':
            self.handle_get()
        else:
            # POST data is normally available through stdin
            try:
                length = int(os.environ.get('CONTENT_LENGTH', None))
            except (ValueError, TypeError):
                length = -1
            if request_text is None:
                request_text = sys.stdin.read(length)

            self.handle_xmlrpc(request_text)


# -----------------------------------------------------------------------------
# Self documenting XML-RPC Server.

class ServerHTMLDoc(pydoc.HTMLDoc):
    """Class used to generate pydoc HTML document for a server"""

    def markup(self, text, escape=None, funcs={}, classes={}, methods={}):
        """Mark up some plain text, given a context of symbols to look for.
        Each context dictionary maps object names to anchor names."""
        escape = escape or self.escape
        results = []
        here = 0

        # XXX Note that this regular expression does not allow for the
        # hyperlinking of arbitrary strings being used as method
        # names. Only methods with names consisting of word characters
        # and '.'s are hyperlinked.
        pattern = re.compile(r'\b((http|ftp)://\S+[\w/]|'
                                r'RFC[- ]?(\d+)|'
                                r'PEP[- ]?(\d+)|'
                                r'(self\.)?((?:\w|\.)+))\b')
        while 1:
            match = pattern.search(text, here)
            if not match: break
            start, end = match.span()
            results.append(escape(text[here:start]))

            all, scheme, rfc, pep, selfdot, name = match.groups()
            if scheme:
                url = escape(all).replace('"', '&quot;')
                results.append('<a href="%s">%s</a>' % (url, url))
            elif rfc:
                url = 'http://www.rfc-editor.org/rfc/rfc%d.txt' % int(rfc)
                results.append('<a href="%s">%s</a>' % (url, escape(all)))
            elif pep:
                url = 'http://www.python.org/dev/peps/pep-%04d/' % int(pep)
                results.append('<a href="%s">%s</a>' % (url, escape(all)))
            elif text[end:end+1] == '(':
                results.append(self.namelink(name, methods, funcs, classes))
            elif selfdot:
                results.append('self.<strong>%s</strong>' % name)
            else:
                results.append(self.namelink(name, classes))
            here = end
        results.append(escape(text[here:]))
        return ''.join(results)

    def docroutine(self, object, name, mod=None,
                   funcs={}, classes={}, methods={}, cl=None):
        """Produce HTML documentation for a function or method object."""

        anchor = (cl and cl.__name__ or '') + '-' + name
        note = ''

        title = '<a name="%s"><strong>%s</strong></a>' % (
            self.escape(anchor), self.escape(name))

        if callable(object):
            argspec = str(signature(object))
        else:
            argspec = '(...)'

        if isinstance(object, tuple):
            argspec = object[0] or argspec
            docstring = object[1] or ""
        else:
            docstring = pydoc.getdoc(object)

        decl = title + argspec + (note and self.grey(
               '<font face="helvetica, arial">%s</font>' % note))

        doc = self.markup(
            docstring, self.preformat, funcs, classes, methods)
        doc = doc and '<dd><tt>%s</tt></dd>' % doc
        return '<dl><dt>%s</dt>%s</dl>\n' % (decl, doc)

    def docserver(self, server_name, package_documentation, methods):
        """Produce HTML documentation for an XML-RPC server."""

        fdict = {}
        for key, value in methods.items():
            fdict[key] = '#-' + key
            fdict[value] = fdict[key]

        server_name = self.escape(server_name)
        head = '<big><big><strong>%s</strong></big></big>' % server_name
        result = self.heading(head, '#ffffff', '#7799ee')

        doc = self.markup(package_documentation, self.preformat, fdict)
        doc = doc and '<tt>%s</tt>' % doc
        result = result + '<p>%s</p>\n' % doc

        contents = []
        method_items = sorted(methods.items())
        for key, value in method_items:
            contents.append(self.docroutine(value, key, funcs=fdict))
        result = result + self.bigsection(
            'Methods', '#ffffff', '#eeaa77', ''.join(contents))

        return result

class XMLRPCDocGenerator:
    """Generates documentation for an XML-RPC server.

    This class is designed as mix-in and should not
    be constructed directly.
    """

    def __init__(self):
        # setup variables used for HTML documentation
        self.server_name = 'XML-RPC Server Documentation'
        self.server_documentation = \
            "This server exports the following methods through the XML-RPC "\
            "protocol."
        self.server_title = 'XML-RPC Server Documentation'

    def set_server_title(self, server_title):
        """Set the HTML title of the generated server documentation"""

        self.server_title = server_title

    def set_server_name(self, server_name):
        """Set the name of the generated HTML server documentation"""

        self.server_name = server_name

    def set_server_documentation(self, server_documentation):
        """Set the documentation string for the entire server."""

        self.server_documentation = server_documentation

    def generate_html_documentation(self):
        """generate_html_documentation() => html documentation for the server

        Generates HTML documentation for the server using introspection for
        installed functions and instances that do not implement the
        _dispatch method. Alternatively, instances can choose to implement
        the _get_method_argstring(method_name) method to provide the
        argument string used in the documentation and the
        _methodHelp(method_name) method to provide the help text used
        in the documentation."""

        methods = {}

        for method_name in self.system_listMethods():
            if method_name in self.funcs:
                method = self.funcs[method_name]
            elif self.instance is not None:
                method_info = [None, None] # argspec, documentation
                if hasattr(self.instance, '_get_method_argstring'):
                    method_info[0] = self.instance._get_method_argstring(method_name)
                if hasattr(self.instance, '_methodHelp'):
                    method_info[1] = self.instance._methodHelp(method_name)

                method_info = tuple(method_info)
                if method_info != (None, None):
                    method = method_info
                elif not hasattr(self.instance, '_dispatch'):
                    try:
                        method = resolve_dotted_attribute(
                                    self.instance,
                                    method_name
                                    )
                    except AttributeError:
                        method = method_info
                else:
                    method = method_info
            else:
                assert 0, "Could not find method in self.functions and no "\
                          "instance installed"

            methods[method_name] = method

        documenter = ServerHTMLDoc()
        documentation = documenter.docserver(
                                self.server_name,
                                self.server_documentation,
                                methods
                            )

        return documenter.page(html.escape(self.server_title), documentation)

class DocXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
    """XML-RPC and documentation request handler class.

    Handles all HTTP POST requests and attempts to decode them as
    XML-RPC requests.

    Handles all HTTP GET requests and interprets them as requests
    for documentation.
    """

    def do_GET(self):
        """Handles the HTTP GET request.

        Interpret all HTTP GET requests as requests for server
        documentation.
        """
        # Check that the path is legal
        if not self.is_rpc_path_valid():
            self.report_404()
            return

        response = self.server.generate_html_documentation().encode('utf-8')
        self.send_response(200)
        self.send_header("Content-type", "text/html")
        self.send_header("Content-length", str(len(response)))
        self.end_headers()
        self.wfile.write(response)

class DocXMLRPCServer(  SimpleXMLRPCServer,
                        XMLRPCDocGenerator):
    """XML-RPC and HTML documentation server.

    Adds the ability to serve server documentation to the capabilities
    of SimpleXMLRPCServer.
    """

    def __init__(self, addr, requestHandler=DocXMLRPCRequestHandler,
                 logRequests=True, allow_none=False, encoding=None,
                 bind_and_activate=True, use_builtin_types=False):
        SimpleXMLRPCServer.__init__(self, addr, requestHandler, logRequests,
                                    allow_none, encoding, bind_and_activate,
                                    use_builtin_types)
        XMLRPCDocGenerator.__init__(self)

class DocCGIXMLRPCRequestHandler(   CGIXMLRPCRequestHandler,
                                    XMLRPCDocGenerator):
    """Handler for XML-RPC data and documentation requests passed through
    CGI"""

    def handle_get(self):
        """Handles the HTTP GET request.

        Interpret all HTTP GET requests as requests for server
        documentation.
        """

        response = self.generate_html_documentation().encode('utf-8')

        print('Content-Type: text/html')
        print('Content-Length: %d' % len(response))
        print()
        sys.stdout.flush()
        sys.stdout.buffer.write(response)
        sys.stdout.buffer.flush()

    def __init__(self):
        CGIXMLRPCRequestHandler.__init__(self)
        XMLRPCDocGenerator.__init__(self)


if __name__ == '__main__':
    import datetime

    class ExampleService:
        def getData(self):
            return '42'

        class currentTime:
            @staticmethod
            def getCurrentTime():
                return datetime.datetime.now()

    with SimpleXMLRPCServer(("localhost", 8000)) as server:
        server.register_function(pow)
        server.register_function(lambda x,y: x+y, 'add')
        server.register_instance(ExampleService(), allow_dotted_names=True)
        server.register_multicall_functions()
        print('Serving XML-RPC on localhost port 8000')
        print('It is advisable to run this example server within a secure, closed network.')
        try:
            server.serve_forever()
        except KeyboardInterrupt:
            print("\nKeyboard interrupt received, exiting.")
            sys.exit(0)
xmlrpc/__init__.py000064400000000046151153537470010175 0ustar00# This directory is a Python package.
xmlrpc/__pycache__/client.cpython-38.opt-1.pyc000064400000103134151153537470015143 0ustar00U

e5d���
@sfdZddlZddlZddlZddlmZddlmZddlZddl	Z
ddlmZddl
Z
ddlmZzddlZWnek
r�dZYnXdd�Zd	ejdd
�ZdZdZd
ZdZdZdZdZd
ZdZdZdZdZ dZ!dZ"Gdd�de#�Z$Gdd�de$�Z%Gdd�de$�Z&Gdd�de$�Z'e(Z)Z*eddd�Z+e+�,d �d!k�rJd"d#�Z-n"e+�,d$�d!k�rdd%d#�Z-nd&d#�Z-[+d'd(�Z.Gd)d*�d*�Z/d+d,�Z0d-d.�Z1Gd/d0�d0�Z2d1d2�Z3e/e2fZ4Gd3d4�d4�Z5Gd5d6�d6�Z6Gd7d8�d8�Z7Gd9d:�d:�Z8Gd;d<�d<�Z9Gd=d>�d>�Z:dZ;Z<Z=dYd@dA�Z>dZdBdC�Z?d[dDdE�Z@dFdG�ZAd\dIdJ�ZBGdKdL�dLe�rXejCneD�ZEGdMdN�dN�ZFGdOdP�dP�ZGGdQdR�dReG�ZHGdSdT�dT�ZIeIZJeKdUk�rbeIdV�ZLzeMeLjN�O��Wn.e$k
�r�ZPzeMdWeP�W5dZP[PXYnXe:eL�ZQeQ�R�eQ�Sd
dX�eQ�Tdd
�zeQ�D]ZUeMeU��q Wn.e$k
�r`ZPzeMdWeP�W5dZP[PXYnXdS)]a�
An XML-RPC client interface for Python.

The marshalling and response parser code can also be used to
implement XML-RPC servers.

Exported exceptions:

  Error          Base class for client errors
  ProtocolError  Indicates an HTTP protocol error
  ResponseError  Indicates a broken response package
  Fault          Indicates an XML-RPC fault package

Exported classes:

  ServerProxy    Represents a logical connection to an XML-RPC server

  MultiCall      Executor of boxcared xmlrpc requests
  DateTime       dateTime wrapper for an ISO 8601 string or time tuple or
                 localtime integer value to generate a "dateTime.iso8601"
                 XML-RPC value
  Binary         binary data wrapper

  Marshaller     Generate an XML-RPC params chunk from a Python data structure
  Unmarshaller   Unmarshal an XML-RPC response from incoming XML event message
  Transport      Handles an HTTP transaction to an XML-RPC server
  SafeTransport  Handles an HTTPS transaction to an XML-RPC server

Exported constants:

  (none)

Exported functions:

  getparser      Create instance of the fastest available parser & attach
                 to an unmarshalling object
  dumps          Convert an argument tuple or a Fault instance to an XML-RPC
                 request (or response, if the methodresponse option is used).
  loads          Convert an XML-RPC packet to unmarshalled data plus a method
                 name (None if not present).
�N)�datetime)�Decimal)�expat)�BytesIOcCs$|�dd�}|�dd�}|�dd�S)N�&z&amp;�<z&lt;�>z&gt;)�replace)�s�r�%/usr/lib64/python3.8/xmlrpc/client.py�escape�sr
z%d.%d�i���i�iD���i����i���ip���iԁ��iC���iB���i����i����i����c@seZdZdZejZdS)�ErrorzBase class for client errors.N)�__name__�
__module__�__qualname__�__doc__�object�__str__rrrrr�src@s eZdZdZdd�Zdd�ZdS)�
ProtocolErrorz!Indicates an HTTP protocol error.cCs&t�|�||_||_||_||_dS�N)r�__init__�url�errcode�errmsg�headers)�selfrrrrrrrr�s

zProtocolError.__init__cCsd|jj|j|j|jfS)Nz<%s for %s: %s %s>)�	__class__rrrr�rrrr�__repr__�s��zProtocolError.__repr__N�rrrrrr rrrrr�src@seZdZdZdS)�
ResponseErrorz$Indicates a broken response package.N)rrrrrrrrr"�sr"c@s eZdZdZdd�Zdd�ZdS)�Faultz#Indicates an XML-RPC fault package.cKst�|�||_||_dSr)rr�	faultCode�faultString)rr$r%Zextrarrrr�s
zFault.__init__cCsd|jj|j|jfS)Nz<%s %s: %r>)rrr$r%rrrrr �s�zFault.__repr__Nr!rrrrr#�sr#�z%YZ0001cCs
|�d�S�N�%Y%m%dT%H:%M:%S��strftime��valuerrr�_iso8601_formatsr-z%4YcCs
|�d�S)Nz%4Y%m%dT%H:%M:%Sr)r+rrrr-scCs|�d��d�S)Nr(�)r*�zfillr+rrrr-scCsLt|t�rt|�St|ttjf�s<|dkr2t��}t�|�}d|dd�S)Nrz%04d%02d%02dT%02d:%02d:%02d�)�
isinstancerr-�tuple�time�struct_time�	localtimer+rrr�	_strftimes

r6c@sreZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)�DateTimez�DateTime wrapper for an ISO 8601 string or time tuple or
    localtime integer value to generate 'dateTime.iso8601' XML-RPC
    value.
    rcCs t|t�r||_n
t|�|_dSr)r1�strr,r6)rr,rrrr(s
zDateTime.__init__cCs�t|t�r|j}|j}nzt|t�r2|j}t|�}n`t|t�rH|j}|}nJt|d�rd|��}|��}n.t|d�rv|jj	p|t
|�}td|jj	|f��||fS)N�	timetuplerzCan't compare %s and %s)r1r7r,rr-r8�hasattrr9rr�type�	TypeError)r�otherr
�oZotyperrr�make_comparable.s*






��
�zDateTime.make_comparablecCs|�|�\}}||kSr�r?�rr=r
r>rrr�__lt__CszDateTime.__lt__cCs|�|�\}}||kSrr@rArrr�__le__GszDateTime.__le__cCs|�|�\}}||kSrr@rArrr�__gt__KszDateTime.__gt__cCs|�|�\}}||kSrr@rArrr�__ge__OszDateTime.__ge__cCs|�|�\}}||kSrr@rArrr�__eq__SszDateTime.__eq__cCst�|jd�Sr')r3�strptimer,rrrrr9WszDateTime.timetuplecCs|jSrr+rrrrr_szDateTime.__str__cCsd|jj|jt|�fS)Nz<%s %r at %#x>)rrr,�idrrrrr bszDateTime.__repr__cCst|���|_dSr)r8�stripr,�r�datarrr�decodeeszDateTime.decodecCs$|�d�|�|j�|�d�dS�Nz<value><dateTime.iso8601>z</dateTime.iso8601></value>
)�writer,)r�outrrr�encodehs
zDateTime.encodeN)r)rrrrrr?rBrCrDrErFr9rr rLrPrrrrr7"s
r7cCst�}|�|�|Sr)r7rL�rKr,rrr�	_datetimems
rRcCst�|d�Sr')rrG)rKrrr�_datetime_typessrSc@s:eZdZdZd
dd�Zdd�Zdd�Zd	d
�Zdd�ZdS)�BinaryzWrapper for binary data.NcCs>|dkrd}n&t|ttf�s,td|jj��t|�}||_dS)N�z#expected bytes or bytearray, not %s)r1�bytes�	bytearrayr<rrrKrJrrrrs�zBinary.__init__cCst|jd�S)Nzlatin-1)r8rKrrrrr�szBinary.__str__cCst|t�r|j}|j|kSr)r1rTrK)rr=rrrrF�s
z
Binary.__eq__cCst�|�|_dSr)�base64�decodebytesrKrJrrrrL�sz
Binary.decodecCs4|�d�t�|j�}|�|�d��|�d�dS�Nz<value><base64>
�asciiz</base64></value>
)rNrX�encodebytesrKrL)rrO�encodedrrrrP�s
z
Binary.encode)N)	rrrrrrrFrLrPrrrrrT|s
rTcCst�}|�|�|Sr)rTrLrQrrr�_binary�s
r^c@s$eZdZdd�Zdd�Zdd�ZdS)�ExpatParsercCsDt�dd�|_}||_|j|_|j|_|j|_	d}|�
|d�dSr)rZParserCreate�_parser�_target�startZStartElementHandler�endZEndElementHandlerrKZCharacterDataHandler�xml)r�target�parser�encodingrrrr�szExpatParser.__init__cCs|j�|d�dS�Nr)r`�ParserJrrr�feed�szExpatParser.feedcCs8z
|j}Wntk
rYnX|`|`|�dd�dS)NrUT)r`�AttributeErrorrari)rrfrrr�close�s
zExpatParser.closeN)rrrrrjrlrrrrr_�s	r_c@s�eZdZdZddd�ZiZdd�Zdd	�Zd
d�Zeee	d�<dd
�Z
e
ee<dd�Zeee
<eZdd�Zeee<efdd�Zeee<dd�Zeee<eee<dd�Zeee<eee<efdd�Zeee<dd�Zeee<dd�Zeee<eee <eed<dS) �
MarshalleravGenerate an XML-RPC params chunk from a Python data structure.

    Create a Marshaller instance for each set of parameters, and use
    the "dumps" method to convert your data (represented as a tuple)
    to an XML-RPC params chunk.  To write a fault response, pass a
    Fault instance instead.  You may prefer to use the "dumps" module
    function for this purpose.
    NFcCsi|_d|_||_||_dSr)�memorKrg�
allow_none)rrgrorrrr�szMarshaller.__init__cCs�g}|j}|j}t|t�r@|d�||j|jd�|�|d�n4|d�|D]}|d�|||�|d�qL|d�d�|�}|S)	Nz<fault>
)r$r%z	</fault>
z	<params>
z<param>
z	</param>
z
</params>
�)�append�_Marshaller__dumpr1r#r$r%�join)r�valuesrOrN�dump�v�resultrrr�dumps�s&
��



zMarshaller.dumpscCs�z|jt|�}Wnftk
rxt|d�s<tdt|���t|�jD]"}||j��krFtdt|���qF|jd}YnX||||�dS)N�__dict__zcannot marshal %s objects�_arbitrary_instance)�dispatchr;�KeyErrorr:r<�__mro__�keys)rr,rN�fZtype_rrrZ__dump�s
zMarshaller.__dumpcCs|jstd��|d�dS)Nz0cannot marshal None unless allow_none is enabledz<value><nil/></value>)ror<�rr,rNrrr�dump_nil
szMarshaller.dump_nilcCs$|d�||rdpd�|d�dS)Nz<value><boolean>�1�0z</boolean></value>
rr�rrr�	dump_boolszMarshaller.dump_boolcCs<|tks|tkrtd��|d�|tt|���|d�dS)Nzint exceeds XML-RPC limitsz<value><int>z</int></value>
)�MAXINT�MININT�
OverflowErrorr8�intr�rrr�	dump_longs
zMarshaller.dump_longcCs |d�|t|��|d�dS)Nz<value><double>z</double></value>
)�reprr�rrr�dump_double$szMarshaller.dump_doublecCs |d�|||��|d�dS)Nz<value><string>z</string></value>
r)rr,rNr
rrr�dump_unicode*szMarshaller.dump_unicodecCs,|d�t�|�}||�d��|d�dSrZ)rXr\rL)rr,rNr]rrr�
dump_bytes0s
zMarshaller.dump_bytescCsZt|�}||jkrtd��d|j|<|j}|d�|D]}|||�q6|d�|j|=dS)Nz"cannot marshal recursive sequencesz<value><array><data>
z</data></array></value>
)rHrnr<rr)rr,rN�irurvrrr�
dump_array8s

zMarshaller.dump_arraycCs�t|�}||jkrtd��d|j|<|j}|d�|��D]D\}}|d�t|t�s\td��|d||��|||�|d�q:|d�|j|=dS)Nz%cannot marshal recursive dictionariesz<value><struct>
z	<member>
zdictionary key must be stringz<name>%s</name>
z
</member>
z</struct></value>
)rHrnr<rr�itemsr1r8)rr,rNr
r�ru�krvrrr�dump_structFs




zMarshaller.dump_structcCs |d�|t|��|d�dSrM)r6r�rrr�
dump_datetimeXszMarshaller.dump_datetimecCs2|jtkr ||_|�|�|`n|�|j|�dSr)r�WRAPPERSrNrPr�ryr�rrr�
dump_instance^s


zMarshaller.dump_instancerz)NF)!rrrrrr{rxrrr�r;r��boolr�r�Zdump_intr��floatr
r�r8r�rVrWr�r2�listr��dictr�rr�r7rTrrrrrm�s<
	rmc@sneZdZdZdEdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZiZdd�Z
e
ed<dd�Zeed<dd�Zeed<eed<eed<eed<eed<eed <d!d"�Zeed#<eed$<d%d&�Zeed'<d(d)�Zeed*<eed+<d,d-�Zeed.<d/d0�Zeed1<d2d3�Zeed4<d5d6�Zeed7<d8d9�Zeed:<d;d<�Zeed=<d>d?�Zeed@<dAdB�ZeedC<dDS)F�UnmarshalleraUnmarshal an XML-RPC response, based on incoming XML event
    messages (start, data, end).  Call close() to get the resulting
    data structure.

    Note that this reader is fairly tolerant, and gladly accepts bogus
    XML-RPC data without complaining (but not bogus XML).
    FcCsHd|_g|_g|_g|_d|_d|_d|_|jj|_|p:||_||_	dS)NF�utf-8)
�_type�_stack�_marks�_data�_value�_methodname�	_encodingrq�
_use_datetime�
_use_bytes)r�use_datetime�use_builtin_typesrrrr~s

zUnmarshaller.__init__cCs:|jdks|jrt��|jdkr0tf|jd��t|j�S)N�faultr)r�r�r"r#r�r2rrrrrl�s

zUnmarshaller.closecCs|jSr)r�rrrr�
getmethodname�szUnmarshaller.getmethodnamecCs
||_dSr)r�)rrgZ
standalonerrrrd�szUnmarshaller.xmlcCshd|kr|�d�d}|dks&|dkr8|j�t|j��g|_|jrZ||jkrZtd|��|dk|_dS)N�:����array�structzunknown tag %rr,)	�splitr�rq�lenr�r�r�r{r")r�tagZattrsrrrrb�szUnmarshaller.startcCs|j�|�dSr)r�rq)r�textrrrrK�szUnmarshaller.datacCsvz|j|}WnTtk
rbd|kr,YdSz|j|�d�d}Wntk
r\YYdSXYnX||d�|j��S)Nr�r�rp)r{r|r�rsr�)rr�rrrrrc�szUnmarshaller.endcCsnz|j|}WnTtk
rbd|kr,YdSz|j|�d�d}Wntk
r\YYdSXYnX|||�S)Nr�r�)r{r|r�)rr�rKrrrr�end_dispatch�szUnmarshaller.end_dispatchcCs|�d�d|_dSrh)rqr�rJrrr�end_nil�s
zUnmarshaller.end_nilZnilcCs:|dkr|�d�n|dkr(|�d�ntd��d|_dS)Nr�Fr�Tzbad boolean valuer)rqr<r�rJrrr�end_boolean�szUnmarshaller.end_boolean�booleancCs|�t|��d|_dSrh)rqr�r�rJrrr�end_int�szUnmarshaller.end_intZi1Zi2Zi4Zi8r�Z
bigintegercCs|�t|��d|_dSrh)rqr�r�rJrrr�
end_double�szUnmarshaller.end_doubleZdoubler�cCs|�t|��d|_dSrh)rqrr�rJrrr�end_bigdecimal�szUnmarshaller.end_bigdecimalZ
bigdecimalcCs&|jr|�|j�}|�|�d|_dSrh)r�rLrqr�rJrrr�
end_string�s
zUnmarshaller.end_string�string�namecCs.|j��}|j|d�g|j|d�<d|_dSrh)r��popr�r�)rrK�markrrr�	end_array�s
zUnmarshaller.end_arrayr�cCs`|j��}i}|j|d�}tdt|�d�D]}||d|||<q,|g|j|d�<d|_dS)Nrrr&)r�r�r��ranger�r�)rrKr�r�r�r�rrr�
end_struct�s
zUnmarshaller.end_structr�cCs6t�}|�|�d��|jr"|j}|�|�d|_dS)Nr[r)rTrLrPr�rKrqr��rrKr,rrr�
end_base64
s
zUnmarshaller.end_base64rXcCs,t�}|�|�|jrt|�}|�|�dSr)r7rLr�rSrqr�rrr�end_dateTimes

zUnmarshaller.end_dateTimezdateTime.iso8601cCs|jr|�|�dSr)r�r�rJrrr�	end_valueszUnmarshaller.end_valuer,cCs
d|_dS)N�params�r�rJrrr�
end_params"szUnmarshaller.end_paramsr�cCs
d|_dS)Nr�r�rJrrr�	end_fault&szUnmarshaller.end_faultr�cCs"|jr|�|j�}||_d|_dS)N�
methodName)r�rLr�r�rJrrr�end_methodName*szUnmarshaller.end_methodNamer�N)FF)rrrrrrlr�rdrbrKrcr�r{r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr�rsZ
	r�c@s$eZdZdd�Zdd�Zdd�ZdS)�_MultiCallMethodcCs||_||_dSr)�_MultiCallMethod__call_list�_MultiCallMethod__name)rZ	call_listr�rrrr7sz_MultiCallMethod.__init__cCst|jd|j|f�S�Nz%s.%s)r�r�r��rr�rrr�__getattr__:sz_MultiCallMethod.__getattr__cGs|j�|j|f�dSr)r�rqr��r�argsrrr�__call__<sz_MultiCallMethod.__call__N�rrrrr�r�rrrrr�4sr�c@s eZdZdZdd�Zdd�ZdS)�MultiCallIteratorzaIterates over the results of a multicall. Exceptions are
    raised in response to xmlrpc faults.cCs
||_dSr)�results)rr�rrrrCszMultiCallIterator.__init__cCsR|j|}t|�ti�kr.t|d|d��n t|�tg�krF|dStd��dS)Nr$r%rz#unexpected type in multicall result)r�r;r#�
ValueError)rr��itemrrr�__getitem__Fs
zMultiCallIterator.__getitem__N)rrrrrr�rrrrr�?sr�c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�	MultiCalla~server -> an object used to boxcar method calls

    server should be a ServerProxy object.

    Methods can be added to the MultiCall using normal
    method call syntax e.g.:

    multicall = MultiCall(server_proxy)
    multicall.add(2,3)
    multicall.get_address("Guido")

    To execute the multicall, call the MultiCall object e.g.:

    add_result, address = multicall()
    cCs||_g|_dSr)�_MultiCall__server�_MultiCall__call_list)r�serverrrrr`szMultiCall.__init__cCsd|jjt|�fS)Nz<%s at %#x>)rrrHrrrrr dszMultiCall.__repr__cCst|j|�Sr)r�r�r�rrrr�gszMultiCall.__getattr__cCs6g}|jD]\}}|�||d��q
t|jj�|��S)N)r�r�)r�rqr�r��systemZ	multicall)rZmarshalled_listr�r�rrrr�jszMultiCall.__call__N)rrrrrr r�r�rrrrr�Os
r�FcCsrtrHtrH|rt}tj}n|r&t}t}nt}t}tdd||t�}t|�}n"t||d�}trbt|�}nt	|�}||fS)z�getparser() -> parser, unmarshaller

    Create an instance of the fastest available parser, and attach it
    to an unmarshalling object.  Return both objects.
    TF�r�r�)
�
FastParser�FastUnmarshallerrSrXrYr^rRr#r�r_)r�r�Z
mkdatetimeZmkbytesrerfrrr�	getparser|s 

r�cCs�t|t�rd}n|rt|t�r|s&d}tr4t|�}n
t||�}|�|�}|dkr^dt|�}nd}|rx|d|d|df}n|r�|d|d	f}n|Sd
�|�S)a�data [,options] -> marshalled data

    Convert an argument tuple or a Fault instance to an XML-RPC
    request (or response, if the methodresponse option is used).

    In addition to the data object, the following options can be given
    as keyword arguments:

        methodname: the method name for a methodCall packet

        methodresponse: true to create a methodResponse packet.
        If this option is used with a tuple, the tuple must be
        a singleton (i.e. it can contain only one element).

        encoding: the packet encoding (default is UTF-8)

    All byte strings in the data structure are assumed to use the
    packet encoding.  Unicode strings are automatically converted,
    where necessary.
    r&r�z$<?xml version='1.0' encoding='%s'?>
z<?xml version='1.0'?>
z<methodCall>
<methodName>z</methodName>
z</methodCall>
z<methodResponse>
z</methodResponse>
rp)r1r#r2�FastMarshallerrmrxr8rs)r��
methodnameZmethodresponsergro�mrKZ	xmlheaderrrrrx�s8



��rxcCs2t||d�\}}|�|�|��|��|��fS)z�data -> unmarshalled data, method name

    Convert an XML-RPC packet to unmarshalled data plus a method
    name (None if not present).

    If the XML-RPC packet represents a fault condition, this function
    raises a Fault exception.
    r�)r�rjrlr�)rKr�r��p�urrr�loads�s	
r�c	Cs<tst�t�}tjd|dd��}|�|�W5QRX|��S)zhdata -> gzip encoded data

    Encode data using the gzip content encoding as described in RFC 1952
    �wbr&)�mode�fileobjZ
compresslevel)�gzip�NotImplementedErrorr�GzipFilerN�getvalue)rKr�gzfrrr�gzip_encodesr��@c	Cs�tst�tjdt|�d��H}z$|dkr0|��}n|�|d�}Wntk
r\td��YnXW5QRX|dkr�t|�|kr�td��|S)zrgzip encoded data -> unencoded data

    Decode data using the gzip content encoding as described in RFC 1952
    �rb�r�r�rr&zinvalid dataz#max gzipped payload length exceeded)r�r�r�r�read�OSErrorr�r�)rKZ
max_decoder�Zdecodedrrr�gzip_decodes
r�c@s eZdZdZdd�Zdd�ZdS)�GzipDecodedResponsezha file-like object to decode a response encoded with the gzip
    method, as described in RFC 1952.
    cCs.tst�t|���|_tjj|d|jd�dS)Nr�r�)r�r�rr��ior�r)r�responserrrr:szGzipDecodedResponse.__init__cCs"ztj�|�W5|j��XdSr)r�rlr�r�rrrrrlBszGzipDecodedResponse.closeN)rrrrrrlrrrrr�6sr�c@s$eZdZdd�Zdd�Zdd�ZdS)�_MethodcCs||_||_dSr��
_Method__send�
_Method__name)r�sendr�rrrrOsz_Method.__init__cCst|jd|j|f�Sr�)r�r�r�r�rrrr�Rsz_Method.__getattr__cGs|�|j|�Srr�r�rrrr�Tsz_Method.__call__Nr�rrrrr�Lsr�c@s�eZdZdZdeZdZdZddd�dd	�Zdd
d�Z	d dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�ZdS)!�	Transportz1Handles an HTTP transaction to an XML-RPC server.zPython-xmlrpc/%sTNFr)rcCs&||_||_d|_t|�|_g|_dS�N)NN)r��_use_builtin_types�_connectionr��_headers�_extra_headers)rr�r�rrrrrks

zTransport.__init__cCs�dD]v}z|�||||�WStjjk
r<|r8�Yqtk
rx}z |sf|jtjtjtjfkrh�W5d}~XYqXqdS)N)rr&)	�single_request�http�clientZRemoteDisconnectedr��errnoZ
ECONNRESETZECONNABORTEDZEPIPE)r�host�handler�request_body�verboser��errr�request}s�zTransport.requestcCs�z8|�||||�}|��}|jdkr6||_|�|�WSWn2tk
rN�Yntk
rj|���YnX|�dd�r�|�	�t
|||j|jt|�
����dS)N��zcontent-lengthrp)�send_requestZgetresponseZstatusr�parse_responser#�	Exceptionrl�	getheaderr�r�reasonr�Z
getheaders)rr	r
rrZ	http_connZresprrrr�s&

�zTransport.single_requestcCst|j|jd�S)Nr�)r�r�rrrrrr��s�zTransport.getparsercCsri}t|t�r|\}}tj�|�\}}|rdtj�|�}t�|��d�}d�	|�
��}dd|fg}ng}|||fS)Nr�rpZ
AuthorizationzBasic )r1r2�urllib�parseZ
_splituserZunquote_to_bytesrXr\rLrsr�)rr	�x509ZauthZ
extra_headersrrr�
get_host_info�s

�zTransport.get_host_infocCsL|jr||jdkr|jdS|�|�\}|_}|tj�|�f|_|jdS)Nrr&)rrrrrZHTTPConnection�rr	Zchostrrrr�make_connection�s

zTransport.make_connectioncCs |j\}}|rd|_|��dSr)rrl)rr	�
connectionrrrrl�s
zTransport.closecCs�|�|�}|j|j}|r$|�d�|jrJtrJ|jd|dd�|�d�n|�d|�|�d�|�d|jf�|�	||�|�
||�|S)Nr&ZPOSTT)Zskip_accept_encoding)zAccept-Encodingr�)zContent-Typeztext/xmlz
User-Agent)rrrZset_debuglevel�accept_gzip_encodingr�Z
putrequestrq�
user_agent�send_headers�send_content)rr	r
r�debugrrrrrr�s



zTransport.send_requestcCs|D]\}}|�||�qdSr)�	putheader)rrr�key�valrrrrszTransport.send_headerscCsR|jdk	r0|jt|�kr0tr0|�dd�t|�}|�dtt|���|�|�dS)N�Content-Encodingr�zContent-Length)�encode_thresholdr�r�r!r�r8Z
endheaders)rrrrrrrs
��zTransport.send_contentcCs�t|d�r*|�dd�dkr$t|�}q.|}n|}|��\}}|�d�}|sJqj|jr^tdt|��|�|�q:||k	rz|�	�|�	�|�	�S)Nrr$rpr�izbody:)
r:rr�r�r�r�printr�rjrl)rr��streamr�r�rKrrrr$s 


zTransport.parse_response)FF)F)F)rrrr�__version__rrr%rrrr�rrrlrrrrrrrrr�]s"�

!r�cs2eZdZdZd
ddd��fdd�Zdd	�Z�ZS)�
SafeTransportz2Handles an HTTPS transaction to an XML-RPC server.FrN�r�contextcst�j|||d�||_dS)N�r�r�r)�superrr+)rr�r�rr+�rrrrEs
�zSafeTransport.__init__cCst|jr||jdkr|jdSttjd�s2td��|�|�\}|_}|tjj|dfd|ji|p`i��f|_|jdS)Nrr&�HTTPSConnectionz1your version of http.client doesn't support HTTPSr+)	rr:rrr�rrr/r+rrrrrNs
�
���
zSafeTransport.make_connection)FF)rrrrrr�
__classcell__rrr.rr)Bs�	r)c@sZeZdZdZdddd�dd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�ZdS)�ServerProxya�uri [,options] -> a logical connection to an XML-RPC server

    uri is the connection point on the server, given as
    scheme://host/target.

    The standard implementation always supports the "http" scheme.  If
    SSL socket support is available (Python 2.0), it also supports
    "https".

    If the target part and the slash preceding it are both omitted,
    "/RPC2" is assumed.

    The following options can be given as keyword arguments:

        transport: a transport factory
        encoding: the request encoding (default is UTF-8)

    All 8-bit strings passed to the server proxy are assumed to use
    the given encoding.
    NFrr*c
Cs�tj�|�\}
}|
dkr td��tj�|�\|_|_|js@d|_|dkr||
dkr^t}d|	i}nt}i}|f|||d�|��}||_	|p�d|_
||_||_dS)N)r�httpszunsupported XML-RPC protocolz/RPC2r2r+r,r�)
rrZ
_splittyper�Z
_splithost�_ServerProxy__host�_ServerProxy__handlerr)r��_ServerProxy__transport�_ServerProxy__encoding�_ServerProxy__verbose�_ServerProxy__allow_none)
rZuri�	transportrgrror�r�rr+r;r
Zextra_kwargsrrrr�s,
��
zServerProxy.__init__cCs|j��dSr)r5rlrrrrZ__close�szServerProxy.__closecCsPt|||j|jd��|jd�}|jj|j|j||jd�}t	|�dkrL|d}|S)N)rgro�xmlcharrefreplace)rr&r)
rxr6r8rPr5rr3r4r7r�)rr�r�rr�rrrZ	__request�s
���zServerProxy.__requestcCsd|jj|j|jfS)Nz
<%s for %s%s>)rrr3r4rrrrr �s��zServerProxy.__repr__cCst|j|�Sr)r��_ServerProxy__requestr�rrrr��szServerProxy.__getattr__cCs.|dkr|jS|dkr|jStd|f��dS)z|A workaround to get special attributes on the ServerProxy
           without interfering with the magic __getattr__
        rlr9zAttribute %r not foundN)�_ServerProxy__closer5rk)r�attrrrrr��s
zServerProxy.__call__cCs|Srrrrrr�	__enter__�szServerProxy.__enter__cGs|��dSr)r<r�rrr�__exit__�szServerProxy.__exit__)NNFFFF)rrrrrr<r;r r�r�r>r?rrrrr1ms ��
r1�__main__zhttp://localhost:8000ZERROR�	)FF)NNNF)FF)r�)VrrX�sysr3r�decimalrZhttp.clientrZurllib.parserZxml.parsersrrr�rr��ImportErrorr
�version_infor(r�r�ZPARSE_ERRORZSERVER_ERRORZAPPLICATION_ERRORZSYSTEM_ERRORZTRANSPORT_ERRORZNOT_WELLFORMED_ERRORZUNSUPPORTED_ENCODINGZINVALID_ENCODING_CHARZINVALID_XMLRPCZMETHOD_NOT_FOUNDZINVALID_METHOD_PARAMSZINTERNAL_ERRORrrrr"r#r�r�ZBooleanZ_day0r*r-r6r7rRrSrTr^r�r_rmr�r�r�r�r�r�r�r�rxr�r�r�r�rr�r�r�r)r1ZServerrr�r&ZcurrentTimeZgetCurrentTimervZmultiZgetData�pow�addr�rrrr�<module>Ys�*



K	#!(C%
'�
K

f+h

xmlrpc/__pycache__/__init__.cpython-38.opt-1.pyc000064400000000202151153537470015414 0ustar00U

e5d&�@sdS)N�rrr�'/usr/lib64/python3.8/xmlrpc/__init__.py�<module>�xmlrpc/__pycache__/client.cpython-38.pyc000064400000103355151153537470014211 0ustar00U

e5d���
@sfdZddlZddlZddlZddlmZddlmZddlZddl	Z
ddlmZddl
Z
ddlmZzddlZWnek
r�dZYnXdd�Zd	ejdd
�ZdZdZd
ZdZdZdZdZd
ZdZdZdZdZ dZ!dZ"Gdd�de#�Z$Gdd�de$�Z%Gdd�de$�Z&Gdd�de$�Z'e(Z)Z*eddd�Z+e+�,d �d!k�rJd"d#�Z-n"e+�,d$�d!k�rdd%d#�Z-nd&d#�Z-[+d'd(�Z.Gd)d*�d*�Z/d+d,�Z0d-d.�Z1Gd/d0�d0�Z2d1d2�Z3e/e2fZ4Gd3d4�d4�Z5Gd5d6�d6�Z6Gd7d8�d8�Z7Gd9d:�d:�Z8Gd;d<�d<�Z9Gd=d>�d>�Z:dZ;Z<Z=dYd@dA�Z>dZdBdC�Z?d[dDdE�Z@dFdG�ZAd\dIdJ�ZBGdKdL�dLe�rXejCneD�ZEGdMdN�dN�ZFGdOdP�dP�ZGGdQdR�dReG�ZHGdSdT�dT�ZIeIZJeKdUk�rbeIdV�ZLzeMeLjN�O��Wn.e$k
�r�ZPzeMdWeP�W5dZP[PXYnXe:eL�ZQeQ�R�eQ�Sd
dX�eQ�Tdd
�zeQ�D]ZUeMeU��q Wn.e$k
�r`ZPzeMdWeP�W5dZP[PXYnXdS)]a�
An XML-RPC client interface for Python.

The marshalling and response parser code can also be used to
implement XML-RPC servers.

Exported exceptions:

  Error          Base class for client errors
  ProtocolError  Indicates an HTTP protocol error
  ResponseError  Indicates a broken response package
  Fault          Indicates an XML-RPC fault package

Exported classes:

  ServerProxy    Represents a logical connection to an XML-RPC server

  MultiCall      Executor of boxcared xmlrpc requests
  DateTime       dateTime wrapper for an ISO 8601 string or time tuple or
                 localtime integer value to generate a "dateTime.iso8601"
                 XML-RPC value
  Binary         binary data wrapper

  Marshaller     Generate an XML-RPC params chunk from a Python data structure
  Unmarshaller   Unmarshal an XML-RPC response from incoming XML event message
  Transport      Handles an HTTP transaction to an XML-RPC server
  SafeTransport  Handles an HTTPS transaction to an XML-RPC server

Exported constants:

  (none)

Exported functions:

  getparser      Create instance of the fastest available parser & attach
                 to an unmarshalling object
  dumps          Convert an argument tuple or a Fault instance to an XML-RPC
                 request (or response, if the methodresponse option is used).
  loads          Convert an XML-RPC packet to unmarshalled data plus a method
                 name (None if not present).
�N)�datetime)�Decimal)�expat)�BytesIOcCs$|�dd�}|�dd�}|�dd�S)N�&z&amp;�<z&lt;�>z&gt;)�replace)�s�r�%/usr/lib64/python3.8/xmlrpc/client.py�escape�sr
z%d.%d�i���i�iD���i����i���ip���iԁ��iC���iB���i����i����i����c@seZdZdZejZdS)�ErrorzBase class for client errors.N)�__name__�
__module__�__qualname__�__doc__�object�__str__rrrrr�src@s eZdZdZdd�Zdd�ZdS)�
ProtocolErrorz!Indicates an HTTP protocol error.cCs&t�|�||_||_||_||_dS�N)r�__init__�url�errcode�errmsg�headers)�selfrrrrrrrr�s

zProtocolError.__init__cCsd|jj|j|j|jfS)Nz<%s for %s: %s %s>)�	__class__rrrr�rrrr�__repr__�s��zProtocolError.__repr__N�rrrrrr rrrrr�src@seZdZdZdS)�
ResponseErrorz$Indicates a broken response package.N)rrrrrrrrr"�sr"c@s eZdZdZdd�Zdd�ZdS)�Faultz#Indicates an XML-RPC fault package.cKst�|�||_||_dSr)rr�	faultCode�faultString)rr$r%Zextrarrrr�s
zFault.__init__cCsd|jj|j|jfS)Nz<%s %s: %r>)rrr$r%rrrrr �s�zFault.__repr__Nr!rrrrr#�sr#�z%YZ0001cCs
|�d�S�N�%Y%m%dT%H:%M:%S��strftime��valuerrr�_iso8601_formatsr-z%4YcCs
|�d�S)Nz%4Y%m%dT%H:%M:%Sr)r+rrrr-scCs|�d��d�S)Nr(�)r*�zfillr+rrrr-scCsLt|t�rt|�St|ttjf�s<|dkr2t��}t�|�}d|dd�S)Nrz%04d%02d%02dT%02d:%02d:%02d�)�
isinstancerr-�tuple�time�struct_time�	localtimer+rrr�	_strftimes

r6c@sreZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)�DateTimez�DateTime wrapper for an ISO 8601 string or time tuple or
    localtime integer value to generate 'dateTime.iso8601' XML-RPC
    value.
    rcCs t|t�r||_n
t|�|_dSr)r1�strr,r6)rr,rrrr(s
zDateTime.__init__cCs�t|t�r|j}|j}nzt|t�r2|j}t|�}n`t|t�rH|j}|}nJt|d�rd|��}|��}n.t|d�rv|jj	p|t
|�}td|jj	|f��||fS)N�	timetuplerzCan't compare %s and %s)r1r7r,rr-r8�hasattrr9rr�type�	TypeError)r�otherr
�oZotyperrr�make_comparable.s*






��
�zDateTime.make_comparablecCs|�|�\}}||kSr�r?�rr=r
r>rrr�__lt__CszDateTime.__lt__cCs|�|�\}}||kSrr@rArrr�__le__GszDateTime.__le__cCs|�|�\}}||kSrr@rArrr�__gt__KszDateTime.__gt__cCs|�|�\}}||kSrr@rArrr�__ge__OszDateTime.__ge__cCs|�|�\}}||kSrr@rArrr�__eq__SszDateTime.__eq__cCst�|jd�Sr')r3�strptimer,rrrrr9WszDateTime.timetuplecCs|jSrr+rrrrr_szDateTime.__str__cCsd|jj|jt|�fS)Nz<%s %r at %#x>)rrr,�idrrrrr bszDateTime.__repr__cCst|���|_dSr)r8�stripr,�r�datarrr�decodeeszDateTime.decodecCs$|�d�|�|j�|�d�dS�Nz<value><dateTime.iso8601>z</dateTime.iso8601></value>
)�writer,)r�outrrr�encodehs
zDateTime.encodeN)r)rrrrrr?rBrCrDrErFr9rr rLrPrrrrr7"s
r7cCst�}|�|�|Sr)r7rL�rKr,rrr�	_datetimems
rRcCst�|d�Sr')rrG)rKrrr�_datetime_typessrSc@s:eZdZdZd
dd�Zdd�Zdd�Zd	d
�Zdd�ZdS)�BinaryzWrapper for binary data.NcCs>|dkrd}n&t|ttf�s,td|jj��t|�}||_dS)N�z#expected bytes or bytearray, not %s)r1�bytes�	bytearrayr<rrrKrJrrrrs�zBinary.__init__cCst|jd�S)Nzlatin-1)r8rKrrrrr�szBinary.__str__cCst|t�r|j}|j|kSr)r1rTrK)rr=rrrrF�s
z
Binary.__eq__cCst�|�|_dSr)�base64�decodebytesrKrJrrrrL�sz
Binary.decodecCs4|�d�t�|j�}|�|�d��|�d�dS�Nz<value><base64>
�asciiz</base64></value>
)rNrX�encodebytesrKrL)rrO�encodedrrrrP�s
z
Binary.encode)N)	rrrrrrrFrLrPrrrrrT|s
rTcCst�}|�|�|Sr)rTrLrQrrr�_binary�s
r^c@s$eZdZdd�Zdd�Zdd�ZdS)�ExpatParsercCsDt�dd�|_}||_|j|_|j|_|j|_	d}|�
|d�dSr)rZParserCreate�_parser�_target�startZStartElementHandler�endZEndElementHandlerrKZCharacterDataHandler�xml)r�target�parser�encodingrrrr�szExpatParser.__init__cCs|j�|d�dS�Nr)r`�ParserJrrr�feed�szExpatParser.feedcCs8z
|j}Wntk
rYnX|`|`|�dd�dS)NrUT)r`�AttributeErrorrari)rrfrrr�close�s
zExpatParser.closeN)rrrrrjrlrrrrr_�s	r_c@s�eZdZdZddd�ZiZdd�Zdd	�Zd
d�Zeee	d�<dd
�Z
e
ee<dd�Zeee
<eZdd�Zeee<efdd�Zeee<dd�Zeee<eee<dd�Zeee<eee<efdd�Zeee<dd�Zeee<dd�Zeee<eee <eed<dS) �
MarshalleravGenerate an XML-RPC params chunk from a Python data structure.

    Create a Marshaller instance for each set of parameters, and use
    the "dumps" method to convert your data (represented as a tuple)
    to an XML-RPC params chunk.  To write a fault response, pass a
    Fault instance instead.  You may prefer to use the "dumps" module
    function for this purpose.
    NFcCsi|_d|_||_||_dSr)�memorKrg�
allow_none)rrgrorrrr�szMarshaller.__init__cCs�g}|j}|j}t|t�r@|d�||j|jd�|�|d�n4|d�|D]}|d�|||�|d�qL|d�d�|�}|S)	Nz<fault>
)r$r%z	</fault>
z	<params>
z<param>
z	</param>
z
</params>
�)�append�_Marshaller__dumpr1r#r$r%�join)r�valuesrOrN�dump�v�resultrrr�dumps�s&
��



zMarshaller.dumpscCs�z|jt|�}Wnftk
rxt|d�s<tdt|���t|�jD]"}||j��krFtdt|���qF|jd}YnX||||�dS)N�__dict__zcannot marshal %s objects�_arbitrary_instance)�dispatchr;�KeyErrorr:r<�__mro__�keys)rr,rN�fZtype_rrrZ__dump�s
zMarshaller.__dumpcCs|jstd��|d�dS)Nz0cannot marshal None unless allow_none is enabledz<value><nil/></value>)ror<�rr,rNrrr�dump_nil
szMarshaller.dump_nilcCs$|d�||rdpd�|d�dS)Nz<value><boolean>�1�0z</boolean></value>
rr�rrr�	dump_boolszMarshaller.dump_boolcCs<|tks|tkrtd��|d�|tt|���|d�dS)Nzint exceeds XML-RPC limitsz<value><int>z</int></value>
)�MAXINT�MININT�
OverflowErrorr8�intr�rrr�	dump_longs
zMarshaller.dump_longcCs |d�|t|��|d�dS)Nz<value><double>z</double></value>
)�reprr�rrr�dump_double$szMarshaller.dump_doublecCs |d�|||��|d�dS)Nz<value><string>z</string></value>
r)rr,rNr
rrr�dump_unicode*szMarshaller.dump_unicodecCs,|d�t�|�}||�d��|d�dSrZ)rXr\rL)rr,rNr]rrr�
dump_bytes0s
zMarshaller.dump_bytescCsZt|�}||jkrtd��d|j|<|j}|d�|D]}|||�q6|d�|j|=dS)Nz"cannot marshal recursive sequencesz<value><array><data>
z</data></array></value>
)rHrnr<rr)rr,rN�irurvrrr�
dump_array8s

zMarshaller.dump_arraycCs�t|�}||jkrtd��d|j|<|j}|d�|��D]D\}}|d�t|t�s\td��|d||��|||�|d�q:|d�|j|=dS)Nz%cannot marshal recursive dictionariesz<value><struct>
z	<member>
zdictionary key must be stringz<name>%s</name>
z
</member>
z</struct></value>
)rHrnr<rr�itemsr1r8)rr,rNr
r�ru�krvrrr�dump_structFs




zMarshaller.dump_structcCs |d�|t|��|d�dSrM)r6r�rrr�
dump_datetimeXszMarshaller.dump_datetimecCs2|jtkr ||_|�|�|`n|�|j|�dSr)r�WRAPPERSrNrPr�ryr�rrr�
dump_instance^s


zMarshaller.dump_instancerz)NF)!rrrrrr{rxrrr�r;r��boolr�r�Zdump_intr��floatr
r�r8r�rVrWr�r2�listr��dictr�rr�r7rTrrrrrm�s<
	rmc@sneZdZdZdEdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZiZdd�Z
e
ed<dd�Zeed<dd�Zeed<eed<eed<eed<eed<eed <d!d"�Zeed#<eed$<d%d&�Zeed'<d(d)�Zeed*<eed+<d,d-�Zeed.<d/d0�Zeed1<d2d3�Zeed4<d5d6�Zeed7<d8d9�Zeed:<d;d<�Zeed=<d>d?�Zeed@<dAdB�ZeedC<dDS)F�UnmarshalleraUnmarshal an XML-RPC response, based on incoming XML event
    messages (start, data, end).  Call close() to get the resulting
    data structure.

    Note that this reader is fairly tolerant, and gladly accepts bogus
    XML-RPC data without complaining (but not bogus XML).
    FcCsHd|_g|_g|_g|_d|_d|_d|_|jj|_|p:||_||_	dS)NF�utf-8)
�_type�_stack�_marks�_data�_value�_methodname�	_encodingrq�
_use_datetime�
_use_bytes)r�use_datetime�use_builtin_typesrrrr~s

zUnmarshaller.__init__cCs:|jdks|jrt��|jdkr0tf|jd��t|j�S)N�faultr)r�r�r"r#r�r2rrrrrl�s

zUnmarshaller.closecCs|jSr)r�rrrr�
getmethodname�szUnmarshaller.getmethodnamecCs
||_dSr)r�)rrgZ
standalonerrrrd�szUnmarshaller.xmlcCshd|kr|�d�d}|dks&|dkr8|j�t|j��g|_|jrZ||jkrZtd|��|dk|_dS)N�:����array�structzunknown tag %rr,)	�splitr�rq�lenr�r�r�r{r")r�tag�attrsrrrrb�szUnmarshaller.startcCs|j�|�dSr)r�rq)r�textrrrrK�szUnmarshaller.datacCsvz|j|}WnTtk
rbd|kr,YdSz|j|�d�d}Wntk
r\YYdSXYnX||d�|j��S)Nr�r�rp)r{r|r�rsr�)rr�rrrrrc�szUnmarshaller.endcCsnz|j|}WnTtk
rbd|kr,YdSz|j|�d�d}Wntk
r\YYdSXYnX|||�S)Nr�r�)r{r|r�)rr�rKrrrr�end_dispatch�szUnmarshaller.end_dispatchcCs|�d�d|_dSrh)rqr�rJrrr�end_nil�s
zUnmarshaller.end_nilZnilcCs:|dkr|�d�n|dkr(|�d�ntd��d|_dS)Nr�Fr�Tzbad boolean valuer)rqr<r�rJrrr�end_boolean�szUnmarshaller.end_boolean�booleancCs|�t|��d|_dSrh)rqr�r�rJrrr�end_int�szUnmarshaller.end_intZi1Zi2Zi4Zi8r�Z
bigintegercCs|�t|��d|_dSrh)rqr�r�rJrrr�
end_double�szUnmarshaller.end_doubleZdoubler�cCs|�t|��d|_dSrh)rqrr�rJrrr�end_bigdecimal�szUnmarshaller.end_bigdecimalZ
bigdecimalcCs&|jr|�|j�}|�|�d|_dSrh)r�rLrqr�rJrrr�
end_string�s
zUnmarshaller.end_string�string�namecCs.|j��}|j|d�g|j|d�<d|_dSrh)r��popr�r�)rrK�markrrr�	end_array�s
zUnmarshaller.end_arrayr�cCs`|j��}i}|j|d�}tdt|�d�D]}||d|||<q,|g|j|d�<d|_dS)Nrrr&)r�r�r��ranger�r�)rrKr�r�r�r�rrr�
end_struct�s
zUnmarshaller.end_structr�cCs6t�}|�|�d��|jr"|j}|�|�d|_dS)Nr[r)rTrLrPr�rKrqr��rrKr,rrr�
end_base64
s
zUnmarshaller.end_base64rXcCs,t�}|�|�|jrt|�}|�|�dSr)r7rLr�rSrqr�rrr�end_dateTimes

zUnmarshaller.end_dateTimezdateTime.iso8601cCs|jr|�|�dSr)r�r�rJrrr�	end_valueszUnmarshaller.end_valuer,cCs
d|_dS)N�params�r�rJrrr�
end_params"szUnmarshaller.end_paramsr�cCs
d|_dS)Nr�r�rJrrr�	end_fault&szUnmarshaller.end_faultr�cCs"|jr|�|j�}||_d|_dS)N�
methodName)r�rLr�r�rJrrr�end_methodName*szUnmarshaller.end_methodNamer�N)FF)rrrrrrlr�rdrbrKrcr�r{r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr�rsZ
	r�c@s$eZdZdd�Zdd�Zdd�ZdS)�_MultiCallMethodcCs||_||_dSr)�_MultiCallMethod__call_list�_MultiCallMethod__name)rZ	call_listr�rrrr7sz_MultiCallMethod.__init__cCst|jd|j|f�S�Nz%s.%s)r�r�r��rr�rrr�__getattr__:sz_MultiCallMethod.__getattr__cGs|j�|j|f�dSr)r�rqr��r�argsrrr�__call__<sz_MultiCallMethod.__call__N�rrrrr�r�rrrrr�4sr�c@s eZdZdZdd�Zdd�ZdS)�MultiCallIteratorzaIterates over the results of a multicall. Exceptions are
    raised in response to xmlrpc faults.cCs
||_dSr)�results)rr�rrrrCszMultiCallIterator.__init__cCsR|j|}t|�ti�kr.t|d|d��n t|�tg�krF|dStd��dS)Nr$r%rz#unexpected type in multicall result)r�r;r#�
ValueError)rr��itemrrr�__getitem__Fs
zMultiCallIterator.__getitem__N)rrrrrr�rrrrr�?sr�c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�	MultiCalla~server -> an object used to boxcar method calls

    server should be a ServerProxy object.

    Methods can be added to the MultiCall using normal
    method call syntax e.g.:

    multicall = MultiCall(server_proxy)
    multicall.add(2,3)
    multicall.get_address("Guido")

    To execute the multicall, call the MultiCall object e.g.:

    add_result, address = multicall()
    cCs||_g|_dSr)�_MultiCall__server�_MultiCall__call_list)r�serverrrrr`szMultiCall.__init__cCsd|jjt|�fS)Nz<%s at %#x>)rrrHrrrrr dszMultiCall.__repr__cCst|j|�Sr)r�r�r�rrrr�gszMultiCall.__getattr__cCs6g}|jD]\}}|�||d��q
t|jj�|��S)N)r�r�)r�rqr�r��systemZ	multicall)rZmarshalled_listr�r�rrrr�jszMultiCall.__call__N)rrrrrr r�r�rrrrr�Os
r�FcCsrtrHtrH|rt}tj}n|r&t}t}nt}t}tdd||t�}t|�}n"t||d�}trbt|�}nt	|�}||fS)z�getparser() -> parser, unmarshaller

    Create an instance of the fastest available parser, and attach it
    to an unmarshalling object.  Return both objects.
    TF�r�r�)
�
FastParser�FastUnmarshallerrSrXrYr^rRr#r�r_)r�r�Z
mkdatetimeZmkbytesrerfrrr�	getparser|s 

r�cCs�t|ttf�std��t|t�r&d}n"|rHt|t�rHt|�dksHtd��|sPd}tr^t|�}n
t||�}|�|�}|dkr�dt|�}nd}|r�|d|d|d	f}n|r�|d
|df}n|Sd�	|�S)
a�data [,options] -> marshalled data

    Convert an argument tuple or a Fault instance to an XML-RPC
    request (or response, if the methodresponse option is used).

    In addition to the data object, the following options can be given
    as keyword arguments:

        methodname: the method name for a methodCall packet

        methodresponse: true to create a methodResponse packet.
        If this option is used with a tuple, the tuple must be
        a singleton (i.e. it can contain only one element).

        encoding: the packet encoding (default is UTF-8)

    All byte strings in the data structure are assumed to use the
    packet encoding.  Unicode strings are automatically converted,
    where necessary.
    z(argument must be tuple or Fault instancer&z"response tuple must be a singletonr�z$<?xml version='1.0' encoding='%s'?>
z<?xml version='1.0'?>
z<methodCall>
<methodName>z</methodName>
z</methodCall>
z<methodResponse>
z</methodResponse>
rp)
r1r2r#�AssertionErrorr��FastMarshallerrmrxr8rs)r��
methodnameZmethodresponsergro�mrKZ	xmlheaderrrrrx�s<



��rxcCs2t||d�\}}|�|�|��|��|��fS)z�data -> unmarshalled data, method name

    Convert an XML-RPC packet to unmarshalled data plus a method
    name (None if not present).

    If the XML-RPC packet represents a fault condition, this function
    raises a Fault exception.
    r�)r�rjrlr�)rKr�r��p�urrr�loads�s	
r�c	Cs<tst�t�}tjd|dd��}|�|�W5QRX|��S)zhdata -> gzip encoded data

    Encode data using the gzip content encoding as described in RFC 1952
    �wbr&)�mode�fileobjZ
compresslevel)�gzip�NotImplementedErrorr�GzipFilerN�getvalue)rKr�gzfrrr�gzip_encodesr��@c	Cs�tst�tjdt|�d��H}z$|dkr0|��}n|�|d�}Wntk
r\td��YnXW5QRX|dkr�t|�|kr�td��|S)zrgzip encoded data -> unencoded data

    Decode data using the gzip content encoding as described in RFC 1952
    �rb�r�r�rr&zinvalid dataz#max gzipped payload length exceeded)r�r�r�r�read�OSErrorr�r�)rKZ
max_decoder�Zdecodedrrr�gzip_decodes
r�c@s eZdZdZdd�Zdd�ZdS)�GzipDecodedResponsezha file-like object to decode a response encoded with the gzip
    method, as described in RFC 1952.
    cCs.tst�t|���|_tjj|d|jd�dS)Nr�r�)r�r�rr��ior�r)r�responserrrr:szGzipDecodedResponse.__init__cCs"ztj�|�W5|j��XdSr)r�rlr�r�rrrrrlBszGzipDecodedResponse.closeN)rrrrrrlrrrrr�6sr�c@s$eZdZdd�Zdd�Zdd�ZdS)�_MethodcCs||_||_dSr��
_Method__send�
_Method__name)r�sendr�rrrrOsz_Method.__init__cCst|jd|j|f�Sr�)r�r�r�r�rrrr�Rsz_Method.__getattr__cGs|�|j|�Srr�r�rrrr�Tsz_Method.__call__Nr�rrrrr�Lsr�c@s�eZdZdZdeZdZdZddd�dd	�Zdd
d�Z	d dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�ZdS)!�	Transportz1Handles an HTTP transaction to an XML-RPC server.zPython-xmlrpc/%sTNFr)rcCs&||_||_d|_t|�|_g|_dS�N)NN)r��_use_builtin_types�_connectionr��_headers�_extra_headers)rr�r�rrrrrks

zTransport.__init__cCs�dD]v}z|�||||�WStjjk
r<|r8�Yqtk
rx}z |sf|jtjtjtjfkrh�W5d}~XYqXqdS)N)rr&)	�single_request�http�clientZRemoteDisconnectedr��errnoZ
ECONNRESETZECONNABORTEDZEPIPE)r�host�handler�request_body�verboser��errr�request}s�zTransport.requestcCs�z8|�||||�}|��}|jdkr6||_|�|�WSWn2tk
rN�Yntk
rj|���YnX|�dd�r�|�	�t
|||j|jt|�
����dS)N��zcontent-lengthrp)�send_requestZgetresponseZstatusr�parse_responser#�	Exceptionrl�	getheaderr�r�reasonr�Z
getheaders)rrrr
rZ	http_connZresprrrr�s&

�zTransport.single_requestcCst|j|jd�S)Nr�)r�r�rrrrrr��s�zTransport.getparsercCsri}t|t�r|\}}tj�|�\}}|rdtj�|�}t�|��d�}d�	|�
��}dd|fg}ng}|||fS)Nr�rpZ
AuthorizationzBasic )r1r2�urllib�parseZ
_splituserZunquote_to_bytesrXr\rLrsr�)rr�x509ZauthZ
extra_headersrrr�
get_host_info�s

�zTransport.get_host_infocCsL|jr||jdkr|jdS|�|�\}|_}|tj�|�f|_|jdS)Nrr&)rrrrr	ZHTTPConnection�rrZchostrrrr�make_connection�s

zTransport.make_connectioncCs |j\}}|rd|_|��dSr)rrl)rr�
connectionrrrrl�s
zTransport.closecCs�|�|�}|j|j}|r$|�d�|jrJtrJ|jd|dd�|�d�n|�d|�|�d�|�d|jf�|�	||�|�
||�|S)Nr&ZPOSTT)Zskip_accept_encoding)zAccept-Encodingr�)zContent-Typeztext/xmlz
User-Agent)rrrZset_debuglevel�accept_gzip_encodingr�Z
putrequestrq�
user_agent�send_headers�send_content)rrrr
�debugrrrrrr�s



zTransport.send_requestcCs|D]\}}|�||�qdSr)�	putheader)rrr�key�valrrrr szTransport.send_headerscCsR|jdk	r0|jt|�kr0tr0|�dd�t|�}|�dtt|���|�|�dS)N�Content-Encodingr�zContent-Length)�encode_thresholdr�r�r#r�r8Z
endheaders)rrr
rrrr!s
��zTransport.send_contentcCs�t|d�r*|�dd�dkr$t|�}q.|}n|}|��\}}|�d�}|sJqj|jr^tdt|��|�|�q:||k	rz|�	�|�	�|�	�S)Nrr&rpr�izbody:)
r:rr�r�r�r�printr�rjrl)rr��streamr�r�rKrrrr$s 


zTransport.parse_response)FF)F)F)rrrr�__version__rrr'rrrr�rrrlrr r!rrrrrr]s"�

!rcs2eZdZdZd
ddd��fdd�Zdd	�Z�ZS)�
SafeTransportz2Handles an HTTPS transaction to an XML-RPC server.FrN�r�contextcst�j|||d�||_dS)N�r�r�r)�superrr-)rr�r�rr-�rrrrEs
�zSafeTransport.__init__cCst|jr||jdkr|jdSttjd�s2td��|�|�\}|_}|tjj|dfd|ji|p`i��f|_|jdS)Nrr&�HTTPSConnectionz1your version of http.client doesn't support HTTPSr-)	rr:rr	r�rrr1r-rrrrrNs
�
���
zSafeTransport.make_connection)FF)rrrrrr�
__classcell__rrr0rr+Bs�	r+c@sZeZdZdZdddd�dd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�ZdS)�ServerProxya�uri [,options] -> a logical connection to an XML-RPC server

    uri is the connection point on the server, given as
    scheme://host/target.

    The standard implementation always supports the "http" scheme.  If
    SSL socket support is available (Python 2.0), it also supports
    "https".

    If the target part and the slash preceding it are both omitted,
    "/RPC2" is assumed.

    The following options can be given as keyword arguments:

        transport: a transport factory
        encoding: the request encoding (default is UTF-8)

    All 8-bit strings passed to the server proxy are assumed to use
    the given encoding.
    NFrr,c
Cs�tj�|�\}
}|
dkr td��tj�|�\|_|_|js@d|_|dkr||
dkr^t}d|	i}nt}i}|f|||d�|��}||_	|p�d|_
||_||_dS)N)r�httpszunsupported XML-RPC protocolz/RPC2r4r-r.r�)
rrZ
_splittyper�Z
_splithost�_ServerProxy__host�_ServerProxy__handlerr+r�_ServerProxy__transport�_ServerProxy__encoding�_ServerProxy__verbose�_ServerProxy__allow_none)
rZuri�	transportrgrror�r�rr-r;rZextra_kwargsrrrr�s,
��
zServerProxy.__init__cCs|j��dSr)r7rlrrrrZ__close�szServerProxy.__closecCsPt|||j|jd��|jd�}|jj|j|j||jd�}t	|�dkrL|d}|S)N)rgro�xmlcharrefreplace)rr&r)
rxr8r:rPr7rr5r6r9r�)rr�r�rr�rrrZ	__request�s
���zServerProxy.__requestcCsd|jj|j|jfS)Nz
<%s for %s%s>)rrr5r6rrrrr �s��zServerProxy.__repr__cCst|j|�Sr)r��_ServerProxy__requestr�rrrr��szServerProxy.__getattr__cCs.|dkr|jS|dkr|jStd|f��dS)z|A workaround to get special attributes on the ServerProxy
           without interfering with the magic __getattr__
        rlr;zAttribute %r not foundN)�_ServerProxy__closer7rk)r�attrrrrr��s
zServerProxy.__call__cCs|Srrrrrr�	__enter__�szServerProxy.__enter__cGs|��dSr)r>r�rrr�__exit__�szServerProxy.__exit__)NNFFFF)rrrrrr>r=r r�r�r@rArrrrr3ms ��
r3�__main__zhttp://localhost:8000ZERROR�	)FF)NNNF)FF)r�)VrrX�sysr3r�decimalrZhttp.clientrZurllib.parserZxml.parsersrr
r�rr��ImportErrorr
�version_infor*r�r�ZPARSE_ERRORZSERVER_ERRORZAPPLICATION_ERRORZSYSTEM_ERRORZTRANSPORT_ERRORZNOT_WELLFORMED_ERRORZUNSUPPORTED_ENCODINGZINVALID_ENCODING_CHARZINVALID_XMLRPCZMETHOD_NOT_FOUNDZINVALID_METHOD_PARAMSZINTERNAL_ERRORrrrr"r#r�r�ZBooleanZ_day0r*r-r6r7rRrSrTr^r�r_rmr�r�r�r�r�r�r�r�rxr�r�r�r�rr�r�rr+r3ZServerrr�r(ZcurrentTimeZgetCurrentTimervZmultiZgetData�pow�addr�rrrr�<module>Ys�*



K	#!(C%
'�
K

f+h

xmlrpc/__pycache__/server.cpython-38.pyc000064400000071342151153537470014241 0ustar00U

e5d9��	@sdZddlmZmZmZmZmZddlmZddl	m
Z
ddlmZddl
Z
ddlZddlZddlZddlZddlZddlZddlZzddlZWnek
r�dZYnXd+dd	�Zd
d�ZGdd
�d
�ZGdd�de�ZGdd�deje�ZGdd�de�ZGdd�de�ZGdd�dej�Z Gdd�d�Z!Gdd�de�Z"Gdd�dee!�Z#Gdd�dee!�Z$e%d k�rddl&Z&Gd!d"�d"�Z'ed#��~Z(e(�)e*�e(�)d$d%�d&�e(j+e'�dd'�e(�,�e-d(�e-d)�ze(�.�Wn(e/k
�re-d*�e�0d�YnXW5QRXdS),aXML-RPC Servers.

This module can be used to create simple XML-RPC servers
by creating a server and either installing functions, a
class instance, or by extending the SimpleXMLRPCServer
class.

It can also be used to handle XML-RPC requests in a CGI
environment using CGIXMLRPCRequestHandler.

The Doc* classes can be used to create XML-RPC servers that
serve pydoc-style documentation in response to HTTP
GET requests. This documentation is dynamically generated
based on the functions and methods registered with the
server.

A list of possible usage patterns follows:

1. Install functions:

server = SimpleXMLRPCServer(("localhost", 8000))
server.register_function(pow)
server.register_function(lambda x,y: x+y, 'add')
server.serve_forever()

2. Install an instance:

class MyFuncs:
    def __init__(self):
        # make all of the sys functions available through sys.func_name
        import sys
        self.sys = sys
    def _listMethods(self):
        # implement this method so that system.listMethods
        # knows to advertise the sys methods
        return list_public_methods(self) + \
                ['sys.' + method for method in list_public_methods(self.sys)]
    def pow(self, x, y): return pow(x, y)
    def add(self, x, y) : return x + y

server = SimpleXMLRPCServer(("localhost", 8000))
server.register_introspection_functions()
server.register_instance(MyFuncs())
server.serve_forever()

3. Install an instance with custom dispatch method:

class Math:
    def _listMethods(self):
        # this method must be present for system.listMethods
        # to work
        return ['add', 'pow']
    def _methodHelp(self, method):
        # this method must be present for system.methodHelp
        # to work
        if method == 'add':
            return "add(2,3) => 5"
        elif method == 'pow':
            return "pow(x, y[, z]) => number"
        else:
            # By convention, return empty
            # string if no help is available
            return ""
    def _dispatch(self, method, params):
        if method == 'pow':
            return pow(*params)
        elif method == 'add':
            return params[0] + params[1]
        else:
            raise ValueError('bad method')

server = SimpleXMLRPCServer(("localhost", 8000))
server.register_introspection_functions()
server.register_instance(Math())
server.serve_forever()

4. Subclass SimpleXMLRPCServer:

class MathServer(SimpleXMLRPCServer):
    def _dispatch(self, method, params):
        try:
            # We are forcing the 'export_' prefix on methods that are
            # callable through XML-RPC to prevent potential security
            # problems
            func = getattr(self, 'export_' + method)
        except AttributeError:
            raise Exception('method "%s" is not supported' % method)
        else:
            return func(*params)

    def export_add(self, x, y):
        return x + y

server = MathServer(("localhost", 8000))
server.serve_forever()

5. CGI script:

server = CGIXMLRPCRequestHandler()
server.register_function(pow)
server.handle_request()
�)�Fault�dumps�loads�gzip_encode�gzip_decode)�BaseHTTPRequestHandler)�partial)�	signatureNTcCsF|r|�d�}n|g}|D]&}|�d�r6td|��qt||�}q|S)aGresolve_dotted_attribute(a, 'b.c.d') => a.b.c.d

    Resolves a dotted attribute name to an object.  Raises
    an AttributeError if any attribute in the chain starts with a '_'.

    If the optional allow_dotted_names argument is false, dots are not
    supported and this function operates similar to getattr(obj, attr).
    �.�_z(attempt to access private attribute "%s")�split�
startswith�AttributeError�getattr)�obj�attr�allow_dotted_names�attrs�i�r�%/usr/lib64/python3.8/xmlrpc/server.py�resolve_dotted_attribute|s

�rcs�fdd�t��D�S)zkReturns a list of attribute strings, found in the specified
    object, which represent callable attributescs(g|] }|�d�stt�|��r|�qS)r)r
�callabler)�.0�member�rrr�
<listcomp>�s
�z'list_public_methods.<locals>.<listcomp>)�dirrrrr�list_public_methods�src@speZdZdZddd�Zddd�Zddd	�Zd
d�Zdd
�Zddd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�SimpleXMLRPCDispatchera&Mix-in class that dispatches XML-RPC requests.

    This class is used to register XML-RPC method handlers
    and then to dispatch them. This class doesn't need to be
    instanced directly when used by SimpleXMLRPCServer but it
    can be instanced when used by the MultiPathXMLRPCServer
    FNcCs&i|_d|_||_|pd|_||_dS�N�utf-8)�funcs�instance�
allow_none�encoding�use_builtin_types��selfr$r%r&rrr�__init__�s

zSimpleXMLRPCDispatcher.__init__cCs||_||_dS)aRegisters an instance to respond to XML-RPC requests.

        Only one instance can be installed at a time.

        If the registered instance has a _dispatch method then that
        method will be called with the name of the XML-RPC method and
        its parameters as a tuple
        e.g. instance._dispatch('add',(2,3))

        If the registered instance does not have a _dispatch method
        then the instance will be searched to find a matching method
        and, if found, will be called. Methods beginning with an '_'
        are considered private and will not be called by
        SimpleXMLRPCServer.

        If a registered function matches an XML-RPC request, then it
        will be called instead of the registered instance.

        If the optional allow_dotted_names argument is true and the
        instance does not have a _dispatch method, method names
        containing dots are supported and resolved, as long as none of
        the name segments start with an '_'.

            *** SECURITY WARNING: ***

            Enabling the allow_dotted_names options allows intruders
            to access your module's global variables and may allow
            intruders to execute arbitrary code on your machine.  Only
            use this option on a secure, closed network.

        N)r#r)r(r#rrrr�register_instance�s!z(SimpleXMLRPCDispatcher.register_instancecCs2|dkrt|j|d�S|dkr$|j}||j|<|S)z�Registers a function to respond to XML-RPC requests.

        The optional name argument can be used to set a Unicode name
        for the function.
        N)�name)r�register_function�__name__r")r(Zfunctionr+rrrr,�s
z(SimpleXMLRPCDispatcher.register_functioncCs|j�|j|j|jd��dS)z�Registers the XML-RPC introspection methods in the system
        namespace.

        see http://xmlrpc.usefulinc.com/doc/reserved.html
        )zsystem.listMethodszsystem.methodSignaturezsystem.methodHelpN)r"�update�system_listMethods�system_methodSignature�system_methodHelp�r(rrr� register_introspection_functions�s
�z7SimpleXMLRPCDispatcher.register_introspection_functionscCs|j�d|ji�dS)z�Registers the XML-RPC multicall method in the system
        namespace.

        see http://www.xmlrpc.com/discuss/msgReader$1208zsystem.multicallN)r"r.�system_multicallr2rrr�register_multicall_functions�sz3SimpleXMLRPCDispatcher.register_multicall_functionscCs�zPt||jd�\}}|dk	r(|||�}n|�||�}|f}t|d|j|jd�}Wn�tk
r�}zt||j|jd�}W5d}~XYnNt��\}}	}
z$ttdd||	f�|j|jd�}W5d}}	}
XYnX|�	|jd�S)	a�Dispatches an XML-RPC method from marshalled (XML) data.

        XML-RPC methods are dispatched from the marshalled (XML) data
        using the _dispatch method and the result is returned as
        marshalled data. For backwards compatibility, a dispatch
        function can be provided as an argument (see comment in
        SimpleXMLRPCRequestHandler.do_POST) but overriding the
        existing method through subclassing is the preferred means
        of changing method dispatch behavior.
        )r&N�)Zmethodresponser$r%)r$r%�%s:%s�r%r$�xmlcharrefreplace)
rr&�	_dispatchrr$r%r�sys�exc_info�encode)r(�data�dispatch_method�path�params�method�response�fault�exc_type�	exc_value�exc_tbrrr�_marshaled_dispatch�s0�
��
z*SimpleXMLRPCDispatcher._marshaled_dispatchcCs^t|j���}|jdk	rVt|jd�r8|t|j���O}nt|jd�sV|tt|j��O}t|�S)zwsystem.listMethods() => ['add', 'subtract', 'multiple']

        Returns a list of the methods supported by the server.N�_listMethodsr:)�setr"�keysr#�hasattrrIr�sorted)r(�methodsrrrr/s
z)SimpleXMLRPCDispatcher.system_listMethodscCsdS)a#system.methodSignature('add') => [double, int, int]

        Returns a list describing the signature of the method. In the
        above example, the add method takes two integers as arguments
        and returns a double result.

        This server does NOT support system.methodSignature.zsignatures not supportedr)r(�method_namerrrr0/sz-SimpleXMLRPCDispatcher.system_methodSignaturecCs�d}||jkr|j|}nX|jdk	rrt|jd�r<|j�|�St|jd�srzt|j||j�}Wntk
rpYnX|dkr~dSt�|�SdS)z�system.methodHelp('add') => "Adds two integers together"

        Returns a string containing documentation for the specified method.N�_methodHelpr:�)	r"r#rLrPrrr�pydoc�getdoc)r(rOrBrrrr1<s$

�z(SimpleXMLRPCDispatcher.system_methodHelpc
Cs�g}|D]�}|d}|d}z|�|�||�g�Wqtk
rj}z|�|j|jd��W5d}~XYqt��\}}}	z|�dd||fd��W5d}}}	XYqXq|S)z�system.multicall([{'methodName': 'add', 'params': [2, 2]}, ...]) => [[4], ...]

        Allows the caller to package multiple XML-RPC calls into a single
        request.

        See http://www.xmlrpc.com/discuss/msgReader$1208
        Z
methodNamerA)�	faultCode�faultStringNr6r7)�appendr:rrTrUr;r<)
r(Z	call_list�resultsZcallrOrArDrErFrGrrrr4[s,
��
��z'SimpleXMLRPCDispatcher.system_multicallcCs�z|j|}Wntk
r"YnX|dk	r4||�Std|��|jdk	r�t|jd�rd|j�||�Szt|j||j�}Wntk
r�YnX|dk	r�||�Std|��dS)a�Dispatches the XML-RPC method.

        XML-RPC calls are forwarded to a registered function that
        matches the called XML-RPC method name. If no such function
        exists then the call is forwarded to the registered instance,
        if available.

        If the registered instance has a _dispatch method then that
        method will be called with the name of the XML-RPC method and
        its parameters as a tuple
        e.g. instance._dispatch('add',(2,3))

        If the registered instance does not have a _dispatch method
        then the instance will be searched to find a matching method
        and, if found, will be called.

        Methods beginning with an '_' are considered private and will
        not be called.
        Nzmethod "%s" is not supportedr:)	r"�KeyError�	Exceptionr#rLr:rrr)r(rBrA�funcrrrr:s*
�z SimpleXMLRPCDispatcher._dispatch)FNF)F)NN)NN)r-�
__module__�__qualname__�__doc__r)r*r,r3r5rHr/r0r1r4r:rrrrr�s�

$

)
$rc@sfeZdZdZdZdZdZdZe�	dej
ejB�Zdd�Z
d	d
�Zdd�Zd
d�Zdd�Zddd�ZdS)�SimpleXMLRPCRequestHandlerz�Simple XML-RPC request handler class.

    Handles all HTTP POST requests and attempts to decode them as
    XML-RPC requests.
    )�/z/RPC2ix���Tz�
                            \s* ([^\s;]+) \s*            #content-coding
                            (;\s* q \s*=\s* ([0-9\.]+))? #q
                            cCs^i}|j�dd�}|�d�D]<}|j�|�}|r|�d�}|rFt|�nd}|||�d�<q|S)NzAccept-EncodingrQ�,�g�?r6)�headers�getr�	aepattern�match�group�float)r(�rZae�erf�vrrr�accept_encodings�s
z+SimpleXMLRPCRequestHandler.accept_encodingscCs|jr|j|jkSdSdS)NT)�	rpc_pathsr@r2rrr�is_rpc_path_valid�sz,SimpleXMLRPCRequestHandler.is_rpc_path_validc
Cs�|��s|��dSz�d}t|jd�}g}|rht||�}|j�|�}|sLqh|�|�|t|d�8}q,d�	|�}|�
|�}|dkr�WdS|j�|t
|dd�|j�}Wn�tk
�r6}zp|�d�t|jd��r|jj�r|�d	t|��t��}	t|	�d
d�d
�}	|�d|	�|�d
d�|��W5d}~XYn�X|�d�|�dd�|jdk	�r�t|�|jk�r�|���dd�}
|
�r�zt|�}|�dd�Wntk
�r�YnX|�d
tt|���|��|j�|�dS)z�Handles the HTTP POST request.

        Attempts to interpret all HTTP POST requests as XML-RPC calls,
        which are forwarded to the server's _dispatch method for handling.
        Ni�zcontent-lengthr`�r:i��_send_traceback_headerzX-exception�ASCII�backslashreplacezX-traceback�Content-length�0���Content-typeztext/xml�gziprzContent-Encoding) rn�
report_404�intrc�minZrfile�readrV�len�join�decode_request_content�serverrHrr@rY�
send_responserLrp�send_header�str�	traceback�
format_excr=�end_headers�encode_thresholdrlrdr�NotImplementedError�wfile�write)r(Zmax_chunk_sizeZsize_remaining�LZ
chunk_size�chunkr>rCrjZtrace�qrrr�do_POST�s`




�
�
z"SimpleXMLRPCRequestHandler.do_POSTcCs�|j�dd���}|dkr|S|dkrvz
t|�WStk
rT|�dd|�Yq�tk
rr|�dd�Yq�Xn|�dd|�|�dd	�|��dS)
Nzcontent-encodingZidentityrwi�zencoding %r not supported�zerror decoding gzip contentrsrt)	rcrd�lowerrr�r��
ValueErrorr�r�)r(r>r%rrrr~$s
z1SimpleXMLRPCRequestHandler.decode_request_contentcCsF|�d�d}|�dd�|�dtt|���|��|j�|�dS)Ni�sNo such pagervz
text/plainrs)r�r�r�r|r�r�r��r(rCrrrrx5s
z%SimpleXMLRPCRequestHandler.report_404�-cCs|jjrt�|||�dS)z$Selectively log an accepted request.N)r�logRequestsr�log_request)r(�code�sizerrrr�>sz&SimpleXMLRPCRequestHandler.log_requestN)r�r�)r-r[r\r]rmr�ZwbufsizeZdisable_nagle_algorithm�re�compile�VERBOSE�
IGNORECASErerlrnr�r~rxr�rrrrr^�s
�G	r^c@s.eZdZdZdZdZedddddfdd�ZdS)�SimpleXMLRPCServeragSimple XML-RPC server.

    Simple XML-RPC server that allows functions and a single instance
    to be installed to handle requests. The default implementation
    attempts to dispatch XML-RPC calls to the functions or instance
    installed in the server. Override the _dispatch method inherited
    from SimpleXMLRPCDispatcher to change this behavior.
    TFNcCs,||_t�||||�tj�||||�dS�N)r�rr)�socketserver�	TCPServer�r(ZaddrZrequestHandlerr�r$r%Zbind_and_activater&rrrr)WszSimpleXMLRPCServer.__init__)r-r[r\r]Zallow_reuse_addressrpr^r)rrrrr�Ds	�r�c@s@eZdZdZedddddfdd�Zdd�Zd	d
�Zd
dd�ZdS)�MultiPathXMLRPCServera\Multipath XML-RPC Server
    This specialization of SimpleXMLRPCServer allows the user to create
    multiple Dispatcher instances and assign them to different
    HTTP request paths.  This makes it possible to run two or more
    'virtual XML-RPC servers' at the same port.
    Make sure that the requestHandler accepts the paths in question.
    TFNc
Cs2t�||||||||�i|_||_|p*d|_dSr )r�r)�dispatchersr$r%r�rrrr)hs�zMultiPathXMLRPCServer.__init__cCs||j|<|Sr��r�)r(r@�
dispatcherrrr�add_dispatcherrs
z$MultiPathXMLRPCServer.add_dispatchercCs
|j|Sr�r�)r(r@rrr�get_dispatchervsz$MultiPathXMLRPCServer.get_dispatchercCs|z|j|�|||�}Wn^t��dd�\}}z2ttdd||f�|j|jd�}|�|jd�}W5d}}XYnX|S)N�r6r7r8r9)	r�rHr;r<rrr%r$r=)r(r>r?r@rCrErFrrrrHys"
��z)MultiPathXMLRPCServer._marshaled_dispatch)NN)	r-r[r\r]r^r)r�r�rHrrrrr�`s�

r�c@s4eZdZdZddd�Zdd�Zdd	�Zd
d
d�ZdS)�CGIXMLRPCRequestHandlerz3Simple handler for XML-RPC data passed through CGI.FNcCst�||||�dSr�)rr)r'rrrr)�sz CGIXMLRPCRequestHandler.__init__cCsP|�|�}td�tdt|��t�tj��tjj�|�tjj��dS)zHandle a single XML-RPC requestzContent-Type: text/xml�Content-Length: %dN)rH�printr|r;�stdout�flush�bufferr�)r(�request_textrCrrr�
handle_xmlrpc�s

z%CGIXMLRPCRequestHandler.handle_xmlrpccCs�d}tj|\}}tjj|||d�}|�d�}td||f�tdtjj�tdt|��t�t	j
��t	j
j�
|�t	j
j��dS)z�Handle a single HTTP GET request.

        Default implementation indicates an error because
        XML-RPC uses the POST method.
        r�)r��message�explainr!z
Status: %d %szContent-Type: %sr�N)rZ	responses�httprZDEFAULT_ERROR_MESSAGEr=r�ZDEFAULT_ERROR_CONTENT_TYPEr|r;r�r�r�r�)r(r�r�r�rCrrr�
handle_get�s ��

z"CGIXMLRPCRequestHandler.handle_getc	Csz|dkr$tj�dd�dkr$|��nRzttj�dd��}Wnttfk
rVd}YnX|dkrltj�	|�}|�
|�dS)z�Handle a single XML-RPC request passed through a CGI post method.

        If no XML data is given then it is read from stdin. The resulting
        XML-RPC response is printed to stdout along with the correct HTTP
        headers.
        NZREQUEST_METHODZGETZCONTENT_LENGTHr`)�os�environrdr�ryr��	TypeErrorr;�stdinr{r�)r(r�Zlengthrrr�handle_request�s�

z&CGIXMLRPCRequestHandler.handle_request)FNF)N)r-r[r\r]r)r�r�r�rrrrr��s

r�c@s>eZdZdZdiiifdd�Zdiiidfdd�Zdd�ZdS)	�
ServerHTMLDocz7Class used to generate pydoc HTML document for a serverNcCsZ|p|j}g}d}t�d�}|�||�}	|	s0�q:|	��\}
}|�||||
���|	��\}}
}}}}|
r�||��dd�}|�d||f�n�|r�dt|�}|�d|||�f�n~|r�dt|�}|�d|||�f�nV|||d�d	k�r|�|�	||||��n(|�r"|�d
|�n|�|�	||��|}q|�|||d���d�
|�S)
z�Mark up some plain text, given a context of symbols to look for.
        Each context dictionary maps object names to anchor names.rzM\b((http|ftp)://\S+[\w/]|RFC[- ]?(\d+)|PEP[- ]?(\d+)|(self\.)?((?:\w|\.)+))\b�"z&quot;z<a href="%s">%s</a>z'http://www.rfc-editor.org/rfc/rfc%d.txtz(http://www.python.org/dev/peps/pep-%04d/r6�(zself.<strong>%s</strong>NrQ)�escaper�r��search�spanrV�groups�replaceryZnamelinkr})r(�textr�r"�classesrNrW�here�patternrf�start�end�allZschemeZrfcZpepZselfdotr+Zurlrrr�markup�s6

zServerHTMLDoc.markupcCs�|r
|jpdd|}d}	d|�|�|�|�f}
t|�rHtt|��}nd}t|t�rp|dp`|}|dpld}n
t�|�}|
||	o�|�	d|	�}
|�
||j|||�}|o�d|}d	|
|fS)
z;Produce HTML documentation for a function or method object.rQr�z$<a name="%s"><strong>%s</strong></a>z(...)rr6z'<font face="helvetica, arial">%s</font>z<dd><tt>%s</tt></dd>z<dl><dt>%s</dt>%s</dl>
)r-r�rr�r	�
isinstance�tuplerRrSZgreyr��	preformat)r(�objectr+�modr"r�rNZclZanchorZnote�titleZargspecZ	docstringZdecl�docrrr�
docroutine�s2�

��zServerHTMLDoc.docroutinec	Cs�i}|��D] \}}d|||<||||<q|�|�}d|}|�|dd�}|�||j|�}	|	ohd|	}	|d|	}g}
t|���}|D]\}}|
�|j|||d��q�||�ddd	d
�	|
��}|S)z1Produce HTML documentation for an XML-RPC server.z#-z)<big><big><strong>%s</strong></big></big>z#ffffffz#7799eez<tt>%s</tt>z
<p>%s</p>
)r"ZMethodsz#eeaa77rQ)
�itemsr�Zheadingr�r�rMrVr�Z
bigsectionr})r(�server_nameZpackage_documentationrNZfdict�key�value�head�resultr��contentsZmethod_itemsrrr�	docservers*
�zServerHTMLDoc.docserver)r-r[r\r]r�r�r�rrrrr��s)�
r�c@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�XMLRPCDocGeneratorz�Generates documentation for an XML-RPC server.

    This class is designed as mix-in and should not
    be constructed directly.
    cCsd|_d|_d|_dS)NzXML-RPC Server DocumentationzGThis server exports the following methods through the XML-RPC protocol.)r��server_documentation�server_titler2rrrr):s�zXMLRPCDocGenerator.__init__cCs
||_dS)z8Set the HTML title of the generated server documentationN)r�)r(r�rrr�set_server_titleBsz#XMLRPCDocGenerator.set_server_titlecCs
||_dS)z7Set the name of the generated HTML server documentationN)r�)r(r�rrr�set_server_nameGsz"XMLRPCDocGenerator.set_server_namecCs
||_dS)z3Set the documentation string for the entire server.N)r�)r(r�rrr�set_server_documentationLsz+XMLRPCDocGenerator.set_server_documentationc	Csi}|��D]�}||jkr&|j|}n�|jdk	r�ddg}t|jd�rT|j�|�|d<t|jd�rp|j�|�|d<t|�}|dkr�|}q�t|jd�s�zt|j|�}Wq�tk
r�|}Yq�Xq�|}nds�t	d��|||<qt
�}|�|j|j
|�}|�t�|j�|�S)	agenerate_html_documentation() => html documentation for the server

        Generates HTML documentation for the server using introspection for
        installed functions and instances that do not implement the
        _dispatch method. Alternatively, instances can choose to implement
        the _get_method_argstring(method_name) method to provide the
        argument string used in the documentation and the
        _methodHelp(method_name) method to provide the help text used
        in the documentation.N�_get_method_argstringrrPr6)NNr:zACould not find method in self.functions and no instance installed)r/r"r#rLr�rPr�rr�AssertionErrorr�r�r�r�Zpage�htmlr�r�)r(rNrOrBZmethod_infoZ
documenterZ
documentationrrr�generate_html_documentationQs>

�
�z.XMLRPCDocGenerator.generate_html_documentationN)	r-r[r\r]r)r�r�r�r�rrrrr�3sr�c@seZdZdZdd�ZdS)�DocXMLRPCRequestHandlerz�XML-RPC and documentation request handler class.

    Handles all HTTP POST requests and attempts to decode them as
    XML-RPC requests.

    Handles all HTTP GET requests and interprets them as requests
    for documentation.
    cCsf|��s|��dS|j���d�}|�d�|�dd�|�dtt|���|�	�|j
�|�dS)�}Handles the HTTP GET request.

        Interpret all HTTP GET requests as requests for server
        documentation.
        Nr!rurvz	text/htmlrs)rnrxrr�r=r�r�r�r|r�r�r�r�rrr�do_GET�s
zDocXMLRPCRequestHandler.do_GETN)r-r[r\r]r�rrrrr��s	r�c@s&eZdZdZedddddfdd�ZdS)�DocXMLRPCServerz�XML-RPC and HTML documentation server.

    Adds the ability to serve server documentation to the capabilities
    of SimpleXMLRPCServer.
    TFNc
Cs&t�||||||||�t�|�dSr�)r�r)r�r�rrrr)�s�zDocXMLRPCServer.__init__)r-r[r\r]r�r)rrrrr��s�r�c@s eZdZdZdd�Zdd�ZdS)�DocCGIXMLRPCRequestHandlerzJHandler for XML-RPC data and documentation requests passed through
    CGIcCsT|���d�}td�tdt|��t�tj��tjj�|�tjj��dS)r�r!zContent-Type: text/htmlr�N)	r�r=r�r|r;r�r�r�r�r�rrrr��s
z%DocCGIXMLRPCRequestHandler.handle_getcCst�|�t�|�dSr�)r�r)r�r2rrrr)�s
z#DocCGIXMLRPCRequestHandler.__init__N)r-r[r\r]r�r)rrrrr��sr��__main__c@s"eZdZdd�ZGdd�d�ZdS)�ExampleServicecCsdS)NZ42rr2rrr�getData�szExampleService.getDatac@seZdZedd��ZdS)zExampleService.currentTimecCs
tj��Sr�)�datetimeZnowrrrr�getCurrentTime�sz)ExampleService.currentTime.getCurrentTimeN)r-r[r\�staticmethodr�rrrr�currentTime�sr�N)r-r[r\r�r�rrrrr��sr�)Z	localhosti@cCs||Sr�r)�x�yrrr�<lambda>�ror��add)rz&Serving XML-RPC on localhost port 8000zKIt is advisable to run this example server within a secure, closed network.z&
Keyboard interrupt received, exiting.)T)1r]Z
xmlrpc.clientrrrrrZhttp.serverr�	functoolsr�inspectr	r�r�r�r;r�r�rRr�Zfcntl�ImportErrorrrrr^r�r�r�r�ZHTMLDocr�r�r�r�r�r-r�r�rr,�powr*r5r�Z
serve_forever�KeyboardInterrupt�exitrrrr�<module>shj

�,EbQ��
	

xmlrpc/__pycache__/client.cpython-38.opt-2.pyc000064400000070442151153537470015151 0ustar00U

e5d���
@sbddlZddlZddlZddlmZddlmZddlZddlZ	ddl
mZddlZddl
mZzddlZWnek
r�dZYnXdd�Zdejdd	�Zd
ZdZdZd
ZdZdZdZdZdZdZd
ZdZdZ dZ!Gdd�de"�Z#Gdd�de#�Z$Gdd�de#�Z%Gdd�de#�Z&e'Z(Z)eddd�Z*e*�+d�d k�rFd!d"�Z,n"e*�+d#�d k�r`d$d"�Z,nd%d"�Z,[*d&d'�Z-Gd(d)�d)�Z.d*d+�Z/d,d-�Z0Gd.d/�d/�Z1d0d1�Z2e.e1fZ3Gd2d3�d3�Z4Gd4d5�d5�Z5Gd6d7�d7�Z6Gd8d9�d9�Z7Gd:d;�d;�Z8Gd<d=�d=�Z9dZ:Z;Z<dXd?d@�Z=dYdAdB�Z>dZdCdD�Z?dEdF�Z@d[dHdI�ZAGdJdK�dKe�rTejBneC�ZDGdLdM�dM�ZEGdNdO�dO�ZFGdPdQ�dQeF�ZGGdRdS�dS�ZHeHZIeJdTk�r^eHdU�ZKzeLeKjM�N��Wn.e#k
�r�ZOzeLdVeO�W5dZO[OXYnXe9eK�ZPeP�Q�eP�Rd	dW�eP�Sdd	�zeP�D]ZTeLeT��qWn.e#k
�r\ZOzeLdVeO�W5dZO[OXYnXdS)\�N)�datetime)�Decimal)�expat)�BytesIOcCs$|�dd�}|�dd�}|�dd�S)N�&z&amp;�<z&lt;�>z&gt;)�replace)�s�r�%/usr/lib64/python3.8/xmlrpc/client.py�escape�sr
z%d.%d�i���i�iD���i����i���ip���iԁ��iC���iB���i����i����i����c@seZdZejZdS)�ErrorN)�__name__�
__module__�__qualname__�object�__str__rrrrr�src@seZdZdd�Zdd�ZdS)�
ProtocolErrorcCs&t�|�||_||_||_||_dS�N)r�__init__�url�errcode�errmsg�headers)�selfrrrrrrrr�s

zProtocolError.__init__cCsd|jj|j|j|jfS)Nz<%s for %s: %s %s>)�	__class__rrrr�rrrr�__repr__�s��zProtocolError.__repr__N�rrrrrrrrrr�src@seZdZdS)�
ResponseErrorN)rrrrrrrr!�sr!c@seZdZdd�Zdd�ZdS)�FaultcKst�|�||_||_dSr)rr�	faultCode�faultString)rr#r$Zextrarrrr�s
zFault.__init__cCsd|jj|j|jfS)Nz<%s %s: %r>)rrr#r$rrrrr�s�zFault.__repr__Nr rrrrr"�sr"�z%YZ0001cCs
|�d�S�N�%Y%m%dT%H:%M:%S��strftime��valuerrr�_iso8601_formatsr,z%4YcCs
|�d�S)Nz%4Y%m%dT%H:%M:%Sr(r*rrrr,scCs|�d��d�S)Nr'�)r)�zfillr*rrrr,scCsLt|t�rt|�St|ttjf�s<|dkr2t��}t�|�}d|dd�S)Nrz%04d%02d%02dT%02d:%02d:%02d�)�
isinstancerr,�tuple�time�struct_time�	localtimer*rrr�	_strftimes

r5c@sneZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�DateTimercCs t|t�r||_n
t|�|_dSr)r0�strr+r5)rr+rrrr(s
zDateTime.__init__cCs�t|t�r|j}|j}nzt|t�r2|j}t|�}n`t|t�rH|j}|}nJt|d�rd|��}|��}n.t|d�rv|jj	p|t
|�}td|jj	|f��||fS)N�	timetuplerzCan't compare %s and %s)r0r6r+rr,r7�hasattrr8rr�type�	TypeError)r�otherr
�oZotyperrr�make_comparable.s*






��
�zDateTime.make_comparablecCs|�|�\}}||kSr�r>�rr<r
r=rrr�__lt__CszDateTime.__lt__cCs|�|�\}}||kSrr?r@rrr�__le__GszDateTime.__le__cCs|�|�\}}||kSrr?r@rrr�__gt__KszDateTime.__gt__cCs|�|�\}}||kSrr?r@rrr�__ge__OszDateTime.__ge__cCs|�|�\}}||kSrr?r@rrr�__eq__SszDateTime.__eq__cCst�|jd�Sr&)r2�strptimer+rrrrr8WszDateTime.timetuplecCs|jSrr*rrrrr_szDateTime.__str__cCsd|jj|jt|�fS)Nz<%s %r at %#x>)rrr+�idrrrrrbszDateTime.__repr__cCst|���|_dSr)r7�stripr+�r�datarrr�decodeeszDateTime.decodecCs$|�d�|�|j�|�d�dS�Nz<value><dateTime.iso8601>z</dateTime.iso8601></value>
)�writer+)r�outrrr�encodehs
zDateTime.encodeN)r)rrrrr>rArBrCrDrEr8rrrKrOrrrrr6"s
r6cCst�}|�|�|Sr)r6rK�rJr+rrr�	_datetimems
rQcCst�|d�Sr&)rrF)rJrrr�_datetime_typessrRc@s6eZdZddd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�BinaryNcCs>|dkrd}n&t|ttf�s,td|jj��t|�}||_dS)N�z#expected bytes or bytearray, not %s)r0�bytes�	bytearrayr;rrrJrIrrrrs�zBinary.__init__cCst|jd�S)Nzlatin-1)r7rJrrrrr�szBinary.__str__cCst|t�r|j}|j|kSr)r0rSrJ)rr<rrrrE�s
z
Binary.__eq__cCst�|�|_dSr)�base64�decodebytesrJrIrrrrK�sz
Binary.decodecCs4|�d�t�|j�}|�|�d��|�d�dS�Nz<value><base64>
�asciiz</base64></value>
)rMrW�encodebytesrJrK)rrN�encodedrrrrO�s
z
Binary.encode)N)rrrrrrErKrOrrrrrS|s

rScCst�}|�|�|Sr)rSrKrPrrr�_binary�s
r]c@s$eZdZdd�Zdd�Zdd�ZdS)�ExpatParsercCsDt�dd�|_}||_|j|_|j|_|j|_	d}|�
|d�dSr)rZParserCreate�_parser�_target�startZStartElementHandler�endZEndElementHandlerrJZCharacterDataHandler�xml)r�target�parser�encodingrrrr�szExpatParser.__init__cCs|j�|d�dS�Nr)r_�ParserIrrr�feed�szExpatParser.feedcCs8z
|j}Wntk
rYnX|`|`|�dd�dS)NrTT)r_�AttributeErrorr`rh)rrerrr�close�s
zExpatParser.closeN)rrrrrirkrrrrr^�s	r^c@s�eZdZddd�ZiZdd�Zdd�Zd	d
�Zeeed�<dd�Z	e	ee
<d
d�Zeee<eZ
dd�Zeee<efdd�Zeee<dd�Zeee<eee<dd�Zeee<eee<efdd�Zeee<dd�Zeee<dd�Zeee<eee<eed<dS)�
MarshallerNFcCsi|_d|_||_||_dSr)�memorJrf�
allow_none)rrfrnrrrr�szMarshaller.__init__cCs�g}|j}|j}t|t�r@|d�||j|jd�|�|d�n4|d�|D]}|d�|||�|d�qL|d�d�|�}|S)	Nz<fault>
)r#r$z	</fault>
z	<params>
z<param>
z	</param>
z
</params>
�)�append�_Marshaller__dumpr0r"r#r$�join)r�valuesrNrM�dump�v�resultrrr�dumps�s&
��



zMarshaller.dumpscCs�z|jt|�}Wnftk
rxt|d�s<tdt|���t|�jD]"}||j��krFtdt|���qF|jd}YnX||||�dS)N�__dict__zcannot marshal %s objects�_arbitrary_instance)�dispatchr:�KeyErrorr9r;�__mro__�keys)rr+rM�fZtype_rrrZ__dump�s
zMarshaller.__dumpcCs|jstd��|d�dS)Nz0cannot marshal None unless allow_none is enabledz<value><nil/></value>)rnr;�rr+rMrrr�dump_nil
szMarshaller.dump_nilcCs$|d�||rdpd�|d�dS)Nz<value><boolean>�1�0z</boolean></value>
rrrrr�	dump_boolszMarshaller.dump_boolcCs<|tks|tkrtd��|d�|tt|���|d�dS)Nzint exceeds XML-RPC limitsz<value><int>z</int></value>
)�MAXINT�MININT�
OverflowErrorr7�intrrrr�	dump_longs
zMarshaller.dump_longcCs |d�|t|��|d�dS)Nz<value><double>z</double></value>
)�reprrrrr�dump_double$szMarshaller.dump_doublecCs |d�|||��|d�dS)Nz<value><string>z</string></value>
r)rr+rMr
rrr�dump_unicode*szMarshaller.dump_unicodecCs,|d�t�|�}||�d��|d�dSrY)rWr[rK)rr+rMr\rrr�
dump_bytes0s
zMarshaller.dump_bytescCsZt|�}||jkrtd��d|j|<|j}|d�|D]}|||�q6|d�|j|=dS)Nz"cannot marshal recursive sequencesz<value><array><data>
z</data></array></value>
)rGrmr;rq)rr+rM�irtrurrr�
dump_array8s

zMarshaller.dump_arraycCs�t|�}||jkrtd��d|j|<|j}|d�|��D]D\}}|d�t|t�s\td��|d||��|||�|d�q:|d�|j|=dS)Nz%cannot marshal recursive dictionariesz<value><struct>
z	<member>
zdictionary key must be stringz<name>%s</name>
z
</member>
z</struct></value>
)rGrmr;rq�itemsr0r7)rr+rMr
r�rt�krurrr�dump_structFs




zMarshaller.dump_structcCs |d�|t|��|d�dSrL)r5rrrr�
dump_datetimeXszMarshaller.dump_datetimecCs2|jtkr ||_|�|�|`n|�|j|�dSr)r�WRAPPERSrMrOr�rxrrrr�
dump_instance^s


zMarshaller.dump_instancery)NF) rrrrrzrwrqr�r:r��boolr�r�Zdump_intr��floatr
r�r7r�rUrVr�r1�listr��dictr�rr�r6rSrrrrrl�s:
	rlc@sjeZdZdDdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
iZdd�Zeed<dd�Z
e
ed<dd�Zeed<eed<eed<eed<eed<eed<d d!�Zeed"<eed#<d$d%�Zeed&<d'd(�Zeed)<eed*<d+d,�Zeed-<d.d/�Zeed0<d1d2�Zeed3<d4d5�Zeed6<d7d8�Zeed9<d:d;�Zeed<<d=d>�Zeed?<d@dA�ZeedB<dCS)E�UnmarshallerFcCsHd|_g|_g|_g|_d|_d|_d|_|jj|_|p:||_||_	dS)NF�utf-8)
�_type�_stack�_marks�_data�_value�_methodname�	_encodingrp�
_use_datetime�
_use_bytes)r�use_datetime�use_builtin_typesrrrr~s

zUnmarshaller.__init__cCs:|jdks|jrt��|jdkr0tf|jd��t|j�S)N�faultr)r�r�r!r"r�r1rrrrrk�s

zUnmarshaller.closecCs|jSr)r�rrrr�
getmethodname�szUnmarshaller.getmethodnamecCs
||_dSr)r�)rrfZ
standalonerrrrc�szUnmarshaller.xmlcCshd|kr|�d�d}|dks&|dkr8|j�t|j��g|_|jrZ||jkrZtd|��|dk|_dS)N�:����array�structzunknown tag %rr+)	�splitr�rp�lenr�r�r�rzr!)r�tagZattrsrrrra�szUnmarshaller.startcCs|j�|�dSr)r�rp)r�textrrrrJ�szUnmarshaller.datacCsvz|j|}WnTtk
rbd|kr,YdSz|j|�d�d}Wntk
r\YYdSXYnX||d�|j��S)Nr�r�ro)rzr{r�rrr�)rr�r~rrrrb�szUnmarshaller.endcCsnz|j|}WnTtk
rbd|kr,YdSz|j|�d�d}Wntk
r\YYdSXYnX|||�S)Nr�r�)rzr{r�)rr�rJr~rrr�end_dispatch�szUnmarshaller.end_dispatchcCs|�d�d|_dSrg)rpr�rIrrr�end_nil�s
zUnmarshaller.end_nilZnilcCs:|dkr|�d�n|dkr(|�d�ntd��d|_dS)Nr�Fr�Tzbad boolean valuer)rpr;r�rIrrr�end_boolean�szUnmarshaller.end_boolean�booleancCs|�t|��d|_dSrg)rpr�r�rIrrr�end_int�szUnmarshaller.end_intZi1Zi2Zi4Zi8r�Z
bigintegercCs|�t|��d|_dSrg)rpr�r�rIrrr�
end_double�szUnmarshaller.end_doubleZdoubler�cCs|�t|��d|_dSrg)rprr�rIrrr�end_bigdecimal�szUnmarshaller.end_bigdecimalZ
bigdecimalcCs&|jr|�|j�}|�|�d|_dSrg)r�rKrpr�rIrrr�
end_string�s
zUnmarshaller.end_string�string�namecCs.|j��}|j|d�g|j|d�<d|_dSrg)r��popr�r�)rrJ�markrrr�	end_array�s
zUnmarshaller.end_arrayr�cCs`|j��}i}|j|d�}tdt|�d�D]}||d|||<q,|g|j|d�<d|_dS)Nrrr%)r�r�r��ranger�r�)rrJr�r�r�r�rrr�
end_struct�s
zUnmarshaller.end_structr�cCs6t�}|�|�d��|jr"|j}|�|�d|_dS)NrZr)rSrKrOr�rJrpr��rrJr+rrr�
end_base64
s
zUnmarshaller.end_base64rWcCs,t�}|�|�|jrt|�}|�|�dSr)r6rKr�rRrpr�rrr�end_dateTimes

zUnmarshaller.end_dateTimezdateTime.iso8601cCs|jr|�|�dSr)r�r�rIrrr�	end_valueszUnmarshaller.end_valuer+cCs
d|_dS)N�params�r�rIrrr�
end_params"szUnmarshaller.end_paramsr�cCs
d|_dS)Nr�r�rIrrr�	end_fault&szUnmarshaller.end_faultr�cCs"|jr|�|j�}||_d|_dS)N�
methodName)r�rKr�r�rIrrr�end_methodName*szUnmarshaller.end_methodNamer�N)FF)rrrrrkr�rcrarJrbr�rzr�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr�rsX
	r�c@s$eZdZdd�Zdd�Zdd�ZdS)�_MultiCallMethodcCs||_||_dSr)�_MultiCallMethod__call_list�_MultiCallMethod__name)rZ	call_listr�rrrr7sz_MultiCallMethod.__init__cCst|jd|j|f�S�Nz%s.%s)r�r�r��rr�rrr�__getattr__:sz_MultiCallMethod.__getattr__cGs|j�|j|f�dSr)r�rpr��r�argsrrr�__call__<sz_MultiCallMethod.__call__N�rrrrr�r�rrrrr�4sr�c@seZdZdd�Zdd�ZdS)�MultiCallIteratorcCs
||_dSr)�results)rr�rrrrCszMultiCallIterator.__init__cCsR|j|}t|�ti�kr.t|d|d��n t|�tg�krF|dStd��dS)Nr#r$rz#unexpected type in multicall result)r�r:r"�
ValueError)rr��itemrrr�__getitem__Fs
zMultiCallIterator.__getitem__N)rrrrr�rrrrr�?sr�c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�	MultiCallcCs||_g|_dSr)�_MultiCall__server�_MultiCall__call_list)r�serverrrrr`szMultiCall.__init__cCsd|jjt|�fS)Nz<%s at %#x>)rrrGrrrrrdszMultiCall.__repr__cCst|j|�Sr)r�r�r�rrrr�gszMultiCall.__getattr__cCs6g}|jD]\}}|�||d��q
t|jj�|��S)N)r�r�)r�rpr�r��systemZ	multicall)rZmarshalled_listr�r�rrrr�jszMultiCall.__call__N)rrrrrr�r�rrrrr�Osr�FcCsrtrHtrH|rt}tj}n|r&t}t}nt}t}tdd||t�}t|�}n"t||d�}trbt|�}nt	|�}||fS)NTF�r�r�)
�
FastParser�FastUnmarshallerrRrWrXr]rQr"r�r^)r�r�Z
mkdatetimeZmkbytesrdrerrr�	getparser|s 

r�cCs�t|t�rd}n|rt|t�r|s&d}tr4t|�}n
t||�}|�|�}|dkr^dt|�}nd}|rx|d|d|df}n|r�|d|d	f}n|Sd
�|�S)Nr%r�z$<?xml version='1.0' encoding='%s'?>
z<?xml version='1.0'?>
z<methodCall>
<methodName>z</methodName>
z</methodCall>
z<methodResponse>
z</methodResponse>
ro)r0r"r1�FastMarshallerrlrwr7rr)r��
methodnameZmethodresponserfrn�mrJZ	xmlheaderrrrrw�s8



��rwcCs2t||d�\}}|�|�|��|��|��fS�Nr�)r�rirkr�)rJr�r��p�urrr�loads�s	
r�c	Cs<tst�t�}tjd|dd��}|�|�W5QRX|��S)N�wbr%)�mode�fileobjZ
compresslevel)�gzip�NotImplementedErrorr�GzipFilerM�getvalue)rJr~�gzfrrr�gzip_encodesr��@c	Cs�tst�tjdt|�d��H}z$|dkr0|��}n|�|d�}Wntk
r\td��YnXW5QRX|dkr�t|�|kr�td��|S)N�rb�r�r�rr%zinvalid dataz#max gzipped payload length exceeded)r�r�r�r�read�OSErrorr�r�)rJZ
max_decoder�Zdecodedrrr�gzip_decodes
r�c@seZdZdd�Zdd�ZdS)�GzipDecodedResponsecCs.tst�t|���|_tjj|d|jd�dS)Nr�r�)r�r�rr��ior�r)r�responserrrr:szGzipDecodedResponse.__init__cCs"ztj�|�W5|j��XdSr)r�rkr�r�rrrrrkBszGzipDecodedResponse.closeN)rrrrrkrrrrr�6sr�c@s$eZdZdd�Zdd�Zdd�ZdS)�_MethodcCs||_||_dSr��
_Method__send�
_Method__name)r�sendr�rrrrOsz_Method.__init__cCst|jd|j|f�Sr�)r�r�r�r�rrrr�Rsz_Method.__getattr__cGs|�|j|�Srr�r�rrrr�Tsz_Method.__call__Nr�rrrrr�Lsr�c@s�eZdZdeZdZdZddd�dd�Zdd	d
�Zddd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZdS) �	TransportzPython-xmlrpc/%sTNFr)rcCs&||_||_d|_t|�|_g|_dS�N)NN)r��_use_builtin_types�_connectionr��_headers�_extra_headers)rr�r�rrrrrks

zTransport.__init__cCs�dD]v}z|�||||�WStjjk
r<|r8�Yqtk
rx}z |sf|jtjtjtjfkrh�W5d}~XYqXqdS)N)rr%)	�single_request�http�clientZRemoteDisconnectedr��errnoZ
ECONNRESETZECONNABORTEDZEPIPE)r�host�handler�request_body�verboser��errr�request}s�zTransport.requestcCs�z8|�||||�}|��}|jdkr6||_|�|�WSWn2tk
rN�Yntk
rj|���YnX|�dd�r�|�	�t
|||j|jt|�
����dS)N��zcontent-lengthro)�send_requestZgetresponseZstatusr�parse_responser"�	Exceptionrk�	getheaderr�r�reasonr�Z
getheaders)rr	r
rrZ	http_connZresprrrr�s&

�zTransport.single_requestcCst|j|jd�Sr�)r�r�rrrrrr��s�zTransport.getparsercCsri}t|t�r|\}}tj�|�\}}|rdtj�|�}t�|��d�}d�	|�
��}dd|fg}ng}|||fS)Nr�roZ
AuthorizationzBasic )r0r1�urllib�parseZ
_splituserZunquote_to_bytesrWr[rKrrr�)rr	�x509ZauthZ
extra_headersrrr�
get_host_info�s

�zTransport.get_host_infocCsL|jr||jdkr|jdS|�|�\}|_}|tj�|�f|_|jdS)Nrr%)rrrrrZHTTPConnection�rr	Zchostrrrr�make_connection�s

zTransport.make_connectioncCs |j\}}|rd|_|��dSr)rrk)rr	�
connectionrrrrk�s
zTransport.closecCs�|�|�}|j|j}|r$|�d�|jrJtrJ|jd|dd�|�d�n|�d|�|�d�|�d|jf�|�	||�|�
||�|S)Nr%ZPOSTT)Zskip_accept_encoding)zAccept-Encodingr�)zContent-Typeztext/xmlz
User-Agent)rrrZset_debuglevel�accept_gzip_encodingr�Z
putrequestrp�
user_agent�send_headers�send_content)rr	r
r�debugrrrrrr�s



zTransport.send_requestcCs|D]\}}|�||�qdSr)�	putheader)rrr�key�valrrrrszTransport.send_headerscCsR|jdk	r0|jt|�kr0tr0|�dd�t|�}|�dtt|���|�|�dS)N�Content-Encodingr�zContent-Length)�encode_thresholdr�r�r!r�r7Z
endheaders)rrrrrrrs
��zTransport.send_contentcCs�t|d�r*|�dd�dkr$t|�}q.|}n|}|��\}}|�d�}|sJqj|jr^tdt|��|�|�q:||k	rz|�	�|�	�|�	�S)Nrr$ror�izbody:)
r9rr�r�r�r�printr�rirk)rr��streamr�r�rJrrrr$s 


zTransport.parse_response)FF)F)F)rrr�__version__rrr%rrrr�rrrkrrrrrrrrr�]s �

!r�cs.eZdZd	ddd��fdd�Zdd�Z�ZS)
�
SafeTransportFrN�r�contextcst�j|||d�||_dS)N�r�r�r)�superrr+)rr�r�rr+�rrrrEs
�zSafeTransport.__init__cCst|jr||jdkr|jdSttjd�s2td��|�|�\}|_}|tjj|dfd|ji|p`i��f|_|jdS)Nrr%�HTTPSConnectionz1your version of http.client doesn't support HTTPSr+)	rr9rrr�rrr/r+rrrrrNs
�
���
zSafeTransport.make_connection)FF)rrrrr�
__classcell__rrr.rr)Bs
�	r)c@sVeZdZdddd�dd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�Z	dd�Z
dS)�ServerProxyNFrr*c
Cs�tj�|�\}
}|
dkr td��tj�|�\|_|_|js@d|_|dkr||
dkr^t}d|	i}nt}i}|f|||d�|��}||_	|p�d|_
||_||_dS)N)r�httpszunsupported XML-RPC protocolz/RPC2r2r+r,r�)
rrZ
_splittyper�Z
_splithost�_ServerProxy__host�_ServerProxy__handlerr)r��_ServerProxy__transport�_ServerProxy__encoding�_ServerProxy__verbose�_ServerProxy__allow_none)
rZuri�	transportrfrrnr�r�rr+r:r
Zextra_kwargsrrrr�s,
��
zServerProxy.__init__cCs|j��dSr)r5rkrrrrZ__close�szServerProxy.__closecCsPt|||j|jd��|jd�}|jj|j|j||jd�}t	|�dkrL|d}|S)N)rfrn�xmlcharrefreplace)rr%r)
rwr6r8rOr5rr3r4r7r�)rr�r�rr�rrrZ	__request�s
���zServerProxy.__requestcCsd|jj|j|jfS)Nz
<%s for %s%s>)rrr3r4rrrrr�s��zServerProxy.__repr__cCst|j|�Sr)r��_ServerProxy__requestr�rrrr��szServerProxy.__getattr__cCs.|dkr|jS|dkr|jStd|f��dS)Nrkr9zAttribute %r not found)�_ServerProxy__closer5rj)r�attrrrrr��s
zServerProxy.__call__cCs|Srrrrrr�	__enter__�szServerProxy.__enter__cGs|��dSr)r<r�rrr�__exit__�szServerProxy.__exit__)NNFFFF)rrrrr<r;rr�r�r>r?rrrrr1ms��
r1�__main__zhttp://localhost:8000ZERROR�	)FF)NNNF)FF)r�)UrW�sysr2r�decimalrZhttp.clientrZurllib.parserZxml.parsersrrr�rr��ImportErrorr
�version_infor(r�r�ZPARSE_ERRORZSERVER_ERRORZAPPLICATION_ERRORZSYSTEM_ERRORZTRANSPORT_ERRORZNOT_WELLFORMED_ERRORZUNSUPPORTED_ENCODINGZINVALID_ENCODING_CHARZINVALID_XMLRPCZMETHOD_NOT_FOUNDZINVALID_METHOD_PARAMSZINTERNAL_ERRORrrrr!r"r�r�ZBooleanZ_day0r)r,r5r6rQrRrSr]r�r^rlr�r�r�r�r�r�r�r�rwr�r�r�r�rr�r�r�r)r1ZServerrr�r&ZcurrentTimeZgetCurrentTimeruZmultiZgetData�pow�addr�rrrr�<module>�s�



K	#!(C%
'�
K

f+h

xmlrpc/__pycache__/server.cpython-38.opt-1.pyc000064400000071201151153537470015172 0ustar00U

e5d9��	@sdZddlmZmZmZmZmZddlmZddl	m
Z
ddlmZddl
Z
ddlZddlZddlZddlZddlZddlZddlZzddlZWnek
r�dZYnXd+dd	�Zd
d�ZGdd
�d
�ZGdd�de�ZGdd�deje�ZGdd�de�ZGdd�de�ZGdd�dej�Z Gdd�d�Z!Gdd�de�Z"Gdd�dee!�Z#Gdd�dee!�Z$e%d k�rddl&Z&Gd!d"�d"�Z'ed#��~Z(e(�)e*�e(�)d$d%�d&�e(j+e'�dd'�e(�,�e-d(�e-d)�ze(�.�Wn(e/k
�re-d*�e�0d�YnXW5QRXdS),aXML-RPC Servers.

This module can be used to create simple XML-RPC servers
by creating a server and either installing functions, a
class instance, or by extending the SimpleXMLRPCServer
class.

It can also be used to handle XML-RPC requests in a CGI
environment using CGIXMLRPCRequestHandler.

The Doc* classes can be used to create XML-RPC servers that
serve pydoc-style documentation in response to HTTP
GET requests. This documentation is dynamically generated
based on the functions and methods registered with the
server.

A list of possible usage patterns follows:

1. Install functions:

server = SimpleXMLRPCServer(("localhost", 8000))
server.register_function(pow)
server.register_function(lambda x,y: x+y, 'add')
server.serve_forever()

2. Install an instance:

class MyFuncs:
    def __init__(self):
        # make all of the sys functions available through sys.func_name
        import sys
        self.sys = sys
    def _listMethods(self):
        # implement this method so that system.listMethods
        # knows to advertise the sys methods
        return list_public_methods(self) + \
                ['sys.' + method for method in list_public_methods(self.sys)]
    def pow(self, x, y): return pow(x, y)
    def add(self, x, y) : return x + y

server = SimpleXMLRPCServer(("localhost", 8000))
server.register_introspection_functions()
server.register_instance(MyFuncs())
server.serve_forever()

3. Install an instance with custom dispatch method:

class Math:
    def _listMethods(self):
        # this method must be present for system.listMethods
        # to work
        return ['add', 'pow']
    def _methodHelp(self, method):
        # this method must be present for system.methodHelp
        # to work
        if method == 'add':
            return "add(2,3) => 5"
        elif method == 'pow':
            return "pow(x, y[, z]) => number"
        else:
            # By convention, return empty
            # string if no help is available
            return ""
    def _dispatch(self, method, params):
        if method == 'pow':
            return pow(*params)
        elif method == 'add':
            return params[0] + params[1]
        else:
            raise ValueError('bad method')

server = SimpleXMLRPCServer(("localhost", 8000))
server.register_introspection_functions()
server.register_instance(Math())
server.serve_forever()

4. Subclass SimpleXMLRPCServer:

class MathServer(SimpleXMLRPCServer):
    def _dispatch(self, method, params):
        try:
            # We are forcing the 'export_' prefix on methods that are
            # callable through XML-RPC to prevent potential security
            # problems
            func = getattr(self, 'export_' + method)
        except AttributeError:
            raise Exception('method "%s" is not supported' % method)
        else:
            return func(*params)

    def export_add(self, x, y):
        return x + y

server = MathServer(("localhost", 8000))
server.serve_forever()

5. CGI script:

server = CGIXMLRPCRequestHandler()
server.register_function(pow)
server.handle_request()
�)�Fault�dumps�loads�gzip_encode�gzip_decode)�BaseHTTPRequestHandler)�partial)�	signatureNTcCsF|r|�d�}n|g}|D]&}|�d�r6td|��qt||�}q|S)aGresolve_dotted_attribute(a, 'b.c.d') => a.b.c.d

    Resolves a dotted attribute name to an object.  Raises
    an AttributeError if any attribute in the chain starts with a '_'.

    If the optional allow_dotted_names argument is false, dots are not
    supported and this function operates similar to getattr(obj, attr).
    �.�_z(attempt to access private attribute "%s")�split�
startswith�AttributeError�getattr)�obj�attr�allow_dotted_namesZattrs�i�r�%/usr/lib64/python3.8/xmlrpc/server.py�resolve_dotted_attribute|s

�rcs�fdd�t��D�S)zkReturns a list of attribute strings, found in the specified
    object, which represent callable attributescs(g|] }|�d�stt�|��r|�qS)r)r
�callabler)�.0�member�rrr�
<listcomp>�s
�z'list_public_methods.<locals>.<listcomp>)�dirrrrr�list_public_methods�src@speZdZdZddd�Zddd�Zddd	�Zd
d�Zdd
�Zddd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�SimpleXMLRPCDispatchera&Mix-in class that dispatches XML-RPC requests.

    This class is used to register XML-RPC method handlers
    and then to dispatch them. This class doesn't need to be
    instanced directly when used by SimpleXMLRPCServer but it
    can be instanced when used by the MultiPathXMLRPCServer
    FNcCs&i|_d|_||_|pd|_||_dS�N�utf-8)�funcs�instance�
allow_none�encoding�use_builtin_types��selfr#r$r%rrr�__init__�s

zSimpleXMLRPCDispatcher.__init__cCs||_||_dS)aRegisters an instance to respond to XML-RPC requests.

        Only one instance can be installed at a time.

        If the registered instance has a _dispatch method then that
        method will be called with the name of the XML-RPC method and
        its parameters as a tuple
        e.g. instance._dispatch('add',(2,3))

        If the registered instance does not have a _dispatch method
        then the instance will be searched to find a matching method
        and, if found, will be called. Methods beginning with an '_'
        are considered private and will not be called by
        SimpleXMLRPCServer.

        If a registered function matches an XML-RPC request, then it
        will be called instead of the registered instance.

        If the optional allow_dotted_names argument is true and the
        instance does not have a _dispatch method, method names
        containing dots are supported and resolved, as long as none of
        the name segments start with an '_'.

            *** SECURITY WARNING: ***

            Enabling the allow_dotted_names options allows intruders
            to access your module's global variables and may allow
            intruders to execute arbitrary code on your machine.  Only
            use this option on a secure, closed network.

        N)r"r)r'r"rrrr�register_instance�s!z(SimpleXMLRPCDispatcher.register_instancecCs2|dkrt|j|d�S|dkr$|j}||j|<|S)z�Registers a function to respond to XML-RPC requests.

        The optional name argument can be used to set a Unicode name
        for the function.
        N)�name)r�register_function�__name__r!)r'Zfunctionr*rrrr+�s
z(SimpleXMLRPCDispatcher.register_functioncCs|j�|j|j|jd��dS)z�Registers the XML-RPC introspection methods in the system
        namespace.

        see http://xmlrpc.usefulinc.com/doc/reserved.html
        )zsystem.listMethodszsystem.methodSignaturezsystem.methodHelpN)r!�update�system_listMethods�system_methodSignature�system_methodHelp�r'rrr� register_introspection_functions�s
�z7SimpleXMLRPCDispatcher.register_introspection_functionscCs|j�d|ji�dS)z�Registers the XML-RPC multicall method in the system
        namespace.

        see http://www.xmlrpc.com/discuss/msgReader$1208zsystem.multicallN)r!r-�system_multicallr1rrr�register_multicall_functions�sz3SimpleXMLRPCDispatcher.register_multicall_functionscCs�zPt||jd�\}}|dk	r(|||�}n|�||�}|f}t|d|j|jd�}Wn�tk
r�}zt||j|jd�}W5d}~XYnNt��\}}	}
z$ttdd||	f�|j|jd�}W5d}}	}
XYnX|�	|jd�S)	a�Dispatches an XML-RPC method from marshalled (XML) data.

        XML-RPC methods are dispatched from the marshalled (XML) data
        using the _dispatch method and the result is returned as
        marshalled data. For backwards compatibility, a dispatch
        function can be provided as an argument (see comment in
        SimpleXMLRPCRequestHandler.do_POST) but overriding the
        existing method through subclassing is the preferred means
        of changing method dispatch behavior.
        )r%N�)Zmethodresponser#r$)r#r$�%s:%s�r$r#�xmlcharrefreplace)
rr%�	_dispatchrr#r$r�sys�exc_info�encode)r'�data�dispatch_method�path�params�method�response�fault�exc_type�	exc_value�exc_tbrrr�_marshaled_dispatch�s0�
��
z*SimpleXMLRPCDispatcher._marshaled_dispatchcCs^t|j���}|jdk	rVt|jd�r8|t|j���O}nt|jd�sV|tt|j��O}t|�S)zwsystem.listMethods() => ['add', 'subtract', 'multiple']

        Returns a list of the methods supported by the server.N�_listMethodsr9)�setr!�keysr"�hasattrrHr�sorted)r'�methodsrrrr.s
z)SimpleXMLRPCDispatcher.system_listMethodscCsdS)a#system.methodSignature('add') => [double, int, int]

        Returns a list describing the signature of the method. In the
        above example, the add method takes two integers as arguments
        and returns a double result.

        This server does NOT support system.methodSignature.zsignatures not supportedr)r'�method_namerrrr//sz-SimpleXMLRPCDispatcher.system_methodSignaturecCs�d}||jkr|j|}nX|jdk	rrt|jd�r<|j�|�St|jd�srzt|j||j�}Wntk
rpYnX|dkr~dSt�|�SdS)z�system.methodHelp('add') => "Adds two integers together"

        Returns a string containing documentation for the specified method.N�_methodHelpr9�)	r!r"rKrOrrr�pydoc�getdoc)r'rNrArrrr0<s$

�z(SimpleXMLRPCDispatcher.system_methodHelpc
Cs�g}|D]�}|d}|d}z|�|�||�g�Wqtk
rj}z|�|j|jd��W5d}~XYqt��\}}}	z|�dd||fd��W5d}}}	XYqXq|S)z�system.multicall([{'methodName': 'add', 'params': [2, 2]}, ...]) => [[4], ...]

        Allows the caller to package multiple XML-RPC calls into a single
        request.

        See http://www.xmlrpc.com/discuss/msgReader$1208
        Z
methodNamer@)�	faultCode�faultStringNr5r6)�appendr9rrSrTr:r;)
r'Z	call_list�resultsZcallrNr@rCrDrErFrrrr3[s,
��
��z'SimpleXMLRPCDispatcher.system_multicallcCs�z|j|}Wntk
r"YnX|dk	r4||�Std|��|jdk	r�t|jd�rd|j�||�Szt|j||j�}Wntk
r�YnX|dk	r�||�Std|��dS)a�Dispatches the XML-RPC method.

        XML-RPC calls are forwarded to a registered function that
        matches the called XML-RPC method name. If no such function
        exists then the call is forwarded to the registered instance,
        if available.

        If the registered instance has a _dispatch method then that
        method will be called with the name of the XML-RPC method and
        its parameters as a tuple
        e.g. instance._dispatch('add',(2,3))

        If the registered instance does not have a _dispatch method
        then the instance will be searched to find a matching method
        and, if found, will be called.

        Methods beginning with an '_' are considered private and will
        not be called.
        Nzmethod "%s" is not supportedr9)	r!�KeyError�	Exceptionr"rKr9rrr)r'rAr@�funcrrrr9s*
�z SimpleXMLRPCDispatcher._dispatch)FNF)F)NN)NN)r,�
__module__�__qualname__�__doc__r(r)r+r2r4rGr.r/r0r3r9rrrrr�s�

$

)
$rc@sfeZdZdZdZdZdZdZe�	dej
ejB�Zdd�Z
d	d
�Zdd�Zd
d�Zdd�Zddd�ZdS)�SimpleXMLRPCRequestHandlerz�Simple XML-RPC request handler class.

    Handles all HTTP POST requests and attempts to decode them as
    XML-RPC requests.
    )�/z/RPC2ix���Tz�
                            \s* ([^\s;]+) \s*            #content-coding
                            (;\s* q \s*=\s* ([0-9\.]+))? #q
                            cCs^i}|j�dd�}|�d�D]<}|j�|�}|r|�d�}|rFt|�nd}|||�d�<q|S)NzAccept-EncodingrP�,�g�?r5)�headers�getr�	aepattern�match�group�float)r'�rZae�ere�vrrr�accept_encodings�s
z+SimpleXMLRPCRequestHandler.accept_encodingscCs|jr|j|jkSdSdS)NT)�	rpc_pathsr?r1rrr�is_rpc_path_valid�sz,SimpleXMLRPCRequestHandler.is_rpc_path_validc
Cs�|��s|��dSz�d}t|jd�}g}|rht||�}|j�|�}|sLqh|�|�|t|d�8}q,d�	|�}|�
|�}|dkr�WdS|j�|t
|dd�|j�}Wn�tk
�r6}zp|�d�t|jd��r|jj�r|�d	t|��t��}	t|	�d
d�d
�}	|�d|	�|�d
d�|��W5d}~XYn�X|�d�|�dd�|jdk	�r�t|�|jk�r�|���dd�}
|
�r�zt|�}|�dd�Wntk
�r�YnX|�d
tt|���|��|j�|�dS)z�Handles the HTTP POST request.

        Attempts to interpret all HTTP POST requests as XML-RPC calls,
        which are forwarded to the server's _dispatch method for handling.
        Ni�zcontent-lengthr_�r9i��_send_traceback_headerzX-exception�ASCII�backslashreplacezX-traceback�Content-length�0���Content-typeztext/xml�gziprzContent-Encoding) rm�
report_404�intrb�minZrfile�readrU�len�join�decode_request_content�serverrGrr?rX�
send_responserKro�send_header�str�	traceback�
format_excr<�end_headers�encode_thresholdrkrcr�NotImplementedError�wfile�write)r'Zmax_chunk_sizeZsize_remaining�LZ
chunk_size�chunkr=rBriZtrace�qrrr�do_POST�s`




�
�
z"SimpleXMLRPCRequestHandler.do_POSTcCs�|j�dd���}|dkr|S|dkrvz
t|�WStk
rT|�dd|�Yq�tk
rr|�dd�Yq�Xn|�dd|�|�dd	�|��dS)
Nzcontent-encodingZidentityrvi�zencoding %r not supported�zerror decoding gzip contentrrrs)	rbrc�lowerrr�r�
ValueErrorr�r�)r'r=r$rrrr}$s
z1SimpleXMLRPCRequestHandler.decode_request_contentcCsF|�d�d}|�dd�|�dtt|���|��|j�|�dS)Ni�sNo such pageruz
text/plainrr)rr�r�r{r�r�r��r'rBrrrrw5s
z%SimpleXMLRPCRequestHandler.report_404�-cCs|jjrt�|||�dS)z$Selectively log an accepted request.N)r~�logRequestsr�log_request)r'�code�sizerrrr�>sz&SimpleXMLRPCRequestHandler.log_requestN)r�r�)r,rZr[r\rlr�ZwbufsizeZdisable_nagle_algorithm�re�compile�VERBOSE�
IGNORECASErdrkrmr�r}rwr�rrrrr]�s
�G	r]c@s.eZdZdZdZdZedddddfdd�ZdS)�SimpleXMLRPCServeragSimple XML-RPC server.

    Simple XML-RPC server that allows functions and a single instance
    to be installed to handle requests. The default implementation
    attempts to dispatch XML-RPC calls to the functions or instance
    installed in the server. Override the _dispatch method inherited
    from SimpleXMLRPCDispatcher to change this behavior.
    TFNcCs,||_t�||||�tj�||||�dS�N)r�rr(�socketserver�	TCPServer�r'ZaddrZrequestHandlerr�r#r$Zbind_and_activater%rrrr(WszSimpleXMLRPCServer.__init__)r,rZr[r\Zallow_reuse_addressror]r(rrrrr�Ds	�r�c@s@eZdZdZedddddfdd�Zdd�Zd	d
�Zd
dd�ZdS)�MultiPathXMLRPCServera\Multipath XML-RPC Server
    This specialization of SimpleXMLRPCServer allows the user to create
    multiple Dispatcher instances and assign them to different
    HTTP request paths.  This makes it possible to run two or more
    'virtual XML-RPC servers' at the same port.
    Make sure that the requestHandler accepts the paths in question.
    TFNc
Cs2t�||||||||�i|_||_|p*d|_dSr)r�r(�dispatchersr#r$r�rrrr(hs�zMultiPathXMLRPCServer.__init__cCs||j|<|Sr��r�)r'r?�
dispatcherrrr�add_dispatcherrs
z$MultiPathXMLRPCServer.add_dispatchercCs
|j|Sr�r�)r'r?rrr�get_dispatchervsz$MultiPathXMLRPCServer.get_dispatchercCs|z|j|�|||�}Wn^t��dd�\}}z2ttdd||f�|j|jd�}|�|jd�}W5d}}XYnX|S)N�r5r6r7r8)	r�rGr:r;rrr$r#r<)r'r=r>r?rBrDrErrrrGys"
��z)MultiPathXMLRPCServer._marshaled_dispatch)NN)	r,rZr[r\r]r(r�r�rGrrrrr�`s�

r�c@s4eZdZdZddd�Zdd�Zdd	�Zd
d
d�ZdS)�CGIXMLRPCRequestHandlerz3Simple handler for XML-RPC data passed through CGI.FNcCst�||||�dSr�)rr(r&rrrr(�sz CGIXMLRPCRequestHandler.__init__cCsP|�|�}td�tdt|��t�tj��tjj�|�tjj��dS)zHandle a single XML-RPC requestzContent-Type: text/xml�Content-Length: %dN)rG�printr{r:�stdout�flush�bufferr�)r'�request_textrBrrr�
handle_xmlrpc�s

z%CGIXMLRPCRequestHandler.handle_xmlrpccCs�d}tj|\}}tjj|||d�}|�d�}td||f�tdtjj�tdt|��t�t	j
��t	j
j�
|�t	j
j��dS)z�Handle a single HTTP GET request.

        Default implementation indicates an error because
        XML-RPC uses the POST method.
        r�)r��message�explainr z
Status: %d %szContent-Type: %sr�N)rZ	responses�httpr~ZDEFAULT_ERROR_MESSAGEr<r�ZDEFAULT_ERROR_CONTENT_TYPEr{r:r�r�r�r�)r'r�r�r�rBrrr�
handle_get�s ��

z"CGIXMLRPCRequestHandler.handle_getc	Csz|dkr$tj�dd�dkr$|��nRzttj�dd��}Wnttfk
rVd}YnX|dkrltj�	|�}|�
|�dS)z�Handle a single XML-RPC request passed through a CGI post method.

        If no XML data is given then it is read from stdin. The resulting
        XML-RPC response is printed to stdout along with the correct HTTP
        headers.
        NZREQUEST_METHODZGETZCONTENT_LENGTHr_)�os�environrcr�rxr��	TypeErrorr:�stdinrzr�)r'r�Zlengthrrr�handle_request�s�

z&CGIXMLRPCRequestHandler.handle_request)FNF)N)r,rZr[r\r(r�r�r�rrrrr��s

r�c@s>eZdZdZdiiifdd�Zdiiidfdd�Zdd�ZdS)	�
ServerHTMLDocz7Class used to generate pydoc HTML document for a serverNcCsZ|p|j}g}d}t�d�}|�||�}	|	s0�q:|	��\}
}|�||||
���|	��\}}
}}}}|
r�||��dd�}|�d||f�n�|r�dt|�}|�d|||�f�n~|r�dt|�}|�d|||�f�nV|||d�d	k�r|�|�	||||��n(|�r"|�d
|�n|�|�	||��|}q|�|||d���d�
|�S)
z�Mark up some plain text, given a context of symbols to look for.
        Each context dictionary maps object names to anchor names.rzM\b((http|ftp)://\S+[\w/]|RFC[- ]?(\d+)|PEP[- ]?(\d+)|(self\.)?((?:\w|\.)+))\b�"z&quot;z<a href="%s">%s</a>z'http://www.rfc-editor.org/rfc/rfc%d.txtz(http://www.python.org/dev/peps/pep-%04d/r5�(zself.<strong>%s</strong>NrP)�escaper�r��search�spanrU�groups�replacerxZnamelinkr|)r'�textr�r!�classesrMrV�here�patternre�start�end�allZschemeZrfcZpepZselfdotr*Zurlrrr�markup�s6

zServerHTMLDoc.markupcCs�|r
|jpdd|}d}	d|�|�|�|�f}
t|�rHtt|��}nd}t|t�rp|dp`|}|dpld}n
t�|�}|
||	o�|�	d|	�}
|�
||j|||�}|o�d|}d	|
|fS)
z;Produce HTML documentation for a function or method object.rPr�z$<a name="%s"><strong>%s</strong></a>z(...)rr5z'<font face="helvetica, arial">%s</font>z<dd><tt>%s</tt></dd>z<dl><dt>%s</dt>%s</dl>
)r,r�rr�r	�
isinstance�tuplerQrRZgreyr��	preformat)r'�objectr*�modr!r�rMZclZanchorZnote�titleZargspecZ	docstringZdecl�docrrr�
docroutine�s2�

��zServerHTMLDoc.docroutinec	Cs�i}|��D] \}}d|||<||||<q|�|�}d|}|�|dd�}|�||j|�}	|	ohd|	}	|d|	}g}
t|���}|D]\}}|
�|j|||d��q�||�ddd	d
�	|
��}|S)z1Produce HTML documentation for an XML-RPC server.z#-z)<big><big><strong>%s</strong></big></big>z#ffffffz#7799eez<tt>%s</tt>z
<p>%s</p>
)r!ZMethodsz#eeaa77rP)
�itemsr�Zheadingr�r�rLrUr�Z
bigsectionr|)r'�server_nameZpackage_documentationrMZfdict�key�value�head�resultr��contentsZmethod_itemsrrr�	docservers*
�zServerHTMLDoc.docserver)r,rZr[r\r�r�r�rrrrr��s)�
r�c@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�XMLRPCDocGeneratorz�Generates documentation for an XML-RPC server.

    This class is designed as mix-in and should not
    be constructed directly.
    cCsd|_d|_d|_dS)NzXML-RPC Server DocumentationzGThis server exports the following methods through the XML-RPC protocol.)r��server_documentation�server_titler1rrrr(:s�zXMLRPCDocGenerator.__init__cCs
||_dS)z8Set the HTML title of the generated server documentationN)r�)r'r�rrr�set_server_titleBsz#XMLRPCDocGenerator.set_server_titlecCs
||_dS)z7Set the name of the generated HTML server documentationN)r�)r'r�rrr�set_server_nameGsz"XMLRPCDocGenerator.set_server_namecCs
||_dS)z3Set the documentation string for the entire server.N)r�)r'r�rrr�set_server_documentationLsz+XMLRPCDocGenerator.set_server_documentationc	Cs�i}|��D]�}||jkr&|j|}n�|jdk	r�ddg}t|jd�rT|j�|�|d<t|jd�rp|j�|�|d<t|�}|dkr�|}q�t|jd�s�zt|j|�}Wq�tk
r�|}Yq�Xq�|}n|||<qt	�}|�
|j|j|�}|�
t�|j�|�S)agenerate_html_documentation() => html documentation for the server

        Generates HTML documentation for the server using introspection for
        installed functions and instances that do not implement the
        _dispatch method. Alternatively, instances can choose to implement
        the _get_method_argstring(method_name) method to provide the
        argument string used in the documentation and the
        _methodHelp(method_name) method to provide the help text used
        in the documentation.N�_get_method_argstringrrOr5)NNr9)r.r!r"rKr�rOr�rrr�r�r�r�Zpage�htmlr�r�)r'rMrNrAZmethod_infoZ
documenterZ
documentationrrr�generate_html_documentationQs<

�
�z.XMLRPCDocGenerator.generate_html_documentationN)	r,rZr[r\r(r�r�r�r�rrrrr�3sr�c@seZdZdZdd�ZdS)�DocXMLRPCRequestHandlerz�XML-RPC and documentation request handler class.

    Handles all HTTP POST requests and attempts to decode them as
    XML-RPC requests.

    Handles all HTTP GET requests and interprets them as requests
    for documentation.
    cCsf|��s|��dS|j���d�}|�d�|�dd�|�dtt|���|�	�|j
�|�dS)�}Handles the HTTP GET request.

        Interpret all HTTP GET requests as requests for server
        documentation.
        Nr rtruz	text/htmlrr)rmrwr~r�r<rr�r�r{r�r�r�r�rrr�do_GET�s
zDocXMLRPCRequestHandler.do_GETN)r,rZr[r\r�rrrrr��s	r�c@s&eZdZdZedddddfdd�ZdS)�DocXMLRPCServerz�XML-RPC and HTML documentation server.

    Adds the ability to serve server documentation to the capabilities
    of SimpleXMLRPCServer.
    TFNc
Cs&t�||||||||�t�|�dSr�)r�r(r�r�rrrr(�s�zDocXMLRPCServer.__init__)r,rZr[r\r�r(rrrrr��s�r�c@s eZdZdZdd�Zdd�ZdS)�DocCGIXMLRPCRequestHandlerzJHandler for XML-RPC data and documentation requests passed through
    CGIcCsT|���d�}td�tdt|��t�tj��tjj�|�tjj��dS)r�r zContent-Type: text/htmlr�N)	r�r<r�r{r:r�r�r�r�r�rrrr��s
z%DocCGIXMLRPCRequestHandler.handle_getcCst�|�t�|�dSr�)r�r(r�r1rrrr(�s
z#DocCGIXMLRPCRequestHandler.__init__N)r,rZr[r\r�r(rrrrr��sr��__main__c@s"eZdZdd�ZGdd�d�ZdS)�ExampleServicecCsdS)NZ42rr1rrr�getData�szExampleService.getDatac@seZdZedd��ZdS)zExampleService.currentTimecCs
tj��Sr�)�datetimeZnowrrrr�getCurrentTime�sz)ExampleService.currentTime.getCurrentTimeN)r,rZr[�staticmethodr�rrrr�currentTime�sr�N)r,rZr[r�r�rrrrr��sr�)Z	localhosti@cCs||Sr�r)�x�yrrr�<lambda>�rnr��add)rz&Serving XML-RPC on localhost port 8000zKIt is advisable to run this example server within a secure, closed network.z&
Keyboard interrupt received, exiting.)T)1r\Z
xmlrpc.clientrrrrrZhttp.serverr�	functoolsr�inspectr	r�r�r�r:r�r�rQr�Zfcntl�ImportErrorrrrr]r�r�r�r�ZHTMLDocr�r�r�r�r�r,r�r�r~r+�powr)r4r�Z
serve_forever�KeyboardInterrupt�exitrrrr�<module>shj

�,EbQ��
	

xmlrpc/__pycache__/__init__.cpython-38.opt-2.pyc000064400000000202151153537470015415 0ustar00U

e5d&�@sdS)N�rrr�'/usr/lib64/python3.8/xmlrpc/__init__.py�<module>�xmlrpc/__pycache__/__init__.cpython-38.pyc000064400000000202151153537470014455 0ustar00U

e5d&�@sdS)N�rrr�'/usr/lib64/python3.8/xmlrpc/__init__.py�<module>�xmlrpc/__pycache__/server.cpython-38.opt-2.pyc000064400000043607151153537470015204 0ustar00U

e5d9��	@sddlmZmZmZmZmZddlmZddlm	Z	ddl
mZddlZddlZ
ddlZddlZddlZddlZddlZddlZzddlZWnek
r�dZYnXd*dd�Zd	d
�ZGdd�d�ZGd
d�de�ZGdd�deje�ZGdd�de�ZGdd�de�ZGdd�dej�ZGdd�d�Z Gdd�de�Z!Gdd�dee �Z"Gdd�dee �Z#e$dk�r
ddl%Z%Gd d!�d!�Z&ed"��~Z'e'�(e)�e'�(d#d$�d%�e'j*e&�dd&�e'�+�e,d'�e,d(�ze'�-�Wn(e.k
�r�e,d)�e�/d�YnXW5QRXdS)+�)�Fault�dumps�loads�gzip_encode�gzip_decode)�BaseHTTPRequestHandler)�partial)�	signatureNTcCsF|r|�d�}n|g}|D]&}|�d�r6td|��qt||�}q|S)N�.�_z(attempt to access private attribute "%s")�split�
startswith�AttributeError�getattr)�obj�attr�allow_dotted_namesZattrs�i�r�%/usr/lib64/python3.8/xmlrpc/server.py�resolve_dotted_attribute|s

�rcs�fdd�t��D�S)Ncs(g|] }|�d�stt�|��r|�qS)r)r
�callabler)�.0�member�rrr�
<listcomp>�s
�z'list_public_methods.<locals>.<listcomp>)�dirrrrr�list_public_methods�src@sleZdZddd�Zddd�Zddd�Zd	d
�Zdd�Zdd
d�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�SimpleXMLRPCDispatcherFNcCs&i|_d|_||_|pd|_||_dS�N�utf-8)�funcs�instance�
allow_none�encoding�use_builtin_types��selfr#r$r%rrr�__init__�s

zSimpleXMLRPCDispatcher.__init__cCs||_||_dS�N)r"r)r'r"rrrr�register_instance�s!z(SimpleXMLRPCDispatcher.register_instancecCs2|dkrt|j|d�S|dkr$|j}||j|<|S)N)�name)r�register_function�__name__r!)r'Zfunctionr+rrrr,�s
z(SimpleXMLRPCDispatcher.register_functioncCs|j�|j|j|jd��dS)N)zsystem.listMethodszsystem.methodSignaturezsystem.methodHelp)r!�update�system_listMethods�system_methodSignature�system_methodHelp�r'rrr� register_introspection_functions�s
�z7SimpleXMLRPCDispatcher.register_introspection_functionscCs|j�d|ji�dS)Nzsystem.multicall)r!r.�system_multicallr2rrr�register_multicall_functions�sz3SimpleXMLRPCDispatcher.register_multicall_functionscCs�zPt||jd�\}}|dk	r(|||�}n|�||�}|f}t|d|j|jd�}Wn�tk
r�}zt||j|jd�}W5d}~XYnNt��\}}	}
z$ttdd||	f�|j|jd�}W5d}}	}
XYnX|�	|jd�S)N)r%�)Zmethodresponser#r$)r#r$�%s:%s�r$r#�xmlcharrefreplace)
rr%�	_dispatchrr#r$r�sys�exc_info�encode)r'�data�dispatch_method�path�params�method�response�fault�exc_type�	exc_value�exc_tbrrr�_marshaled_dispatch�s0�
��
z*SimpleXMLRPCDispatcher._marshaled_dispatchcCs^t|j���}|jdk	rVt|jd�r8|t|j���O}nt|jd�sV|tt|j��O}t|�S)N�_listMethodsr:)�setr!�keysr"�hasattrrIr�sorted)r'�methodsrrrr/s
z)SimpleXMLRPCDispatcher.system_listMethodscCsdS)Nzsignatures not supportedr)r'�method_namerrrr0/sz-SimpleXMLRPCDispatcher.system_methodSignaturecCs�d}||jkr|j|}nX|jdk	rrt|jd�r<|j�|�St|jd�srzt|j||j�}Wntk
rpYnX|dkr~dSt�|�SdS)N�_methodHelpr:�)	r!r"rLrPrrr�pydoc�getdoc)r'rOrBrrrr1<s$

�z(SimpleXMLRPCDispatcher.system_methodHelpc
Cs�g}|D]�}|d}|d}z|�|�||�g�Wqtk
rj}z|�|j|jd��W5d}~XYqt��\}}}	z|�dd||fd��W5d}}}	XYqXq|S)NZ
methodNamerA)�	faultCode�faultStringr6r7)�appendr:rrTrUr;r<)
r'Z	call_list�resultsZcallrOrArDrErFrGrrrr4[s,
��
��z'SimpleXMLRPCDispatcher.system_multicallcCs�z|j|}Wntk
r"YnX|dk	r4||�Std|��|jdk	r�t|jd�rd|j�||�Szt|j||j�}Wntk
r�YnX|dk	r�||�Std|��dS)Nzmethod "%s" is not supportedr:)	r!�KeyError�	Exceptionr"rLr:rrr)r'rBrA�funcrrrr:s*
�z SimpleXMLRPCDispatcher._dispatch)FNF)F)NN)NN)r-�
__module__�__qualname__r(r*r,r3r5rHr/r0r1r4r:rrrrr�s	�

$

)
$rc@sbeZdZdZdZdZdZe�dej	ej
B�Zdd�Zdd	�Z
d
d�Zdd
�Zdd�Zddd�ZdS)�SimpleXMLRPCRequestHandler)�/z/RPC2ix���Tz�
                            \s* ([^\s;]+) \s*            #content-coding
                            (;\s* q \s*=\s* ([0-9\.]+))? #q
                            cCs^i}|j�dd�}|�d�D]<}|j�|�}|r|�d�}|rFt|�nd}|||�d�<q|S)NzAccept-EncodingrQ�,�g�?r6)�headers�getr�	aepattern�match�group�float)r'�rZae�ere�vrrr�accept_encodings�s
z+SimpleXMLRPCRequestHandler.accept_encodingscCs|jr|j|jkSdSdS)NT)�	rpc_pathsr@r2rrr�is_rpc_path_valid�sz,SimpleXMLRPCRequestHandler.is_rpc_path_validc
Cs�|��s|��dSz�d}t|jd�}g}|rht||�}|j�|�}|sLqh|�|�|t|d�8}q,d�	|�}|�
|�}|dkr�WdS|j�|t
|dd�|j�}Wn�tk
�r6}zp|�d�t|jd��r|jj�r|�dt|��t��}	t|	�d	d
�d	�}	|�d|	�|�dd
�|��W5d}~XYn�X|�d�|�dd�|jdk	�r�t|�|jk�r�|���dd�}
|
�r�zt|�}|�dd�Wntk
�r�YnX|�dtt|���|��|j�|�dS)Ni�zcontent-lengthr_�r:i��_send_traceback_headerzX-exception�ASCII�backslashreplacezX-traceback�Content-length�0���Content-typeztext/xml�gziprzContent-Encoding) rm�
report_404�intrb�minZrfile�readrV�len�join�decode_request_content�serverrHrr@rY�
send_responserLro�send_header�str�	traceback�
format_excr=�end_headers�encode_thresholdrkrcr�NotImplementedError�wfile�write)r'Zmax_chunk_sizeZsize_remaining�LZ
chunk_size�chunkr>rCriZtrace�qrrr�do_POST�s`




�
�
z"SimpleXMLRPCRequestHandler.do_POSTcCs�|j�dd���}|dkr|S|dkrvz
t|�WStk
rT|�dd|�Yq�tk
rr|�dd�Yq�Xn|�dd|�|�dd	�|��dS)
Nzcontent-encodingZidentityrvi�zencoding %r not supported�zerror decoding gzip contentrrrs)	rbrc�lowerrr�r�
ValueErrorr�r�)r'r>r$rrrr}$s
z1SimpleXMLRPCRequestHandler.decode_request_contentcCsF|�d�d}|�dd�|�dtt|���|��|j�|�dS)Ni�sNo such pageruz
text/plainrr)rr�r�r{r�r�r��r'rCrrrrw5s
z%SimpleXMLRPCRequestHandler.report_404�-cCs|jjrt�|||�dSr))r~�logRequestsr�log_request)r'�code�sizerrrr�>sz&SimpleXMLRPCRequestHandler.log_requestN)r�r�)r-r[r\rlr�ZwbufsizeZdisable_nagle_algorithm�re�compile�VERBOSE�
IGNORECASErdrkrmr�r}rwr�rrrrr]�s	
�G	r]c@s*eZdZdZdZedddddfdd�ZdS)�SimpleXMLRPCServerTFNcCs,||_t�||||�tj�||||�dSr))r�rr(�socketserver�	TCPServer�r'ZaddrZrequestHandlerr�r#r$Zbind_and_activater%rrrr(WszSimpleXMLRPCServer.__init__)r-r[r\Zallow_reuse_addressror]r(rrrrr�Ds�r�c@s<eZdZedddddfdd�Zdd�Zdd	�Zdd
d�ZdS)
�MultiPathXMLRPCServerTFNc
Cs2t�||||||||�i|_||_|p*d|_dSr)r�r(�dispatchersr#r$r�rrrr(hs�zMultiPathXMLRPCServer.__init__cCs||j|<|Sr)�r�)r'r@�
dispatcherrrr�add_dispatcherrs
z$MultiPathXMLRPCServer.add_dispatchercCs
|j|Sr)r�)r'r@rrr�get_dispatchervsz$MultiPathXMLRPCServer.get_dispatchercCs|z|j|�|||�}Wn^t��dd�\}}z2ttdd||f�|j|jd�}|�|jd�}W5d}}XYnX|S)N�r6r7r8r9)	r�rHr;r<rrr$r#r=)r'r>r?r@rCrErFrrrrHys"
��z)MultiPathXMLRPCServer._marshaled_dispatch)NN)r-r[r\r]r(r�r�rHrrrrr�`s�

r�c@s0eZdZddd�Zdd�Zdd�Zdd	d
�ZdS)
�CGIXMLRPCRequestHandlerFNcCst�||||�dSr))rr(r&rrrr(�sz CGIXMLRPCRequestHandler.__init__cCsP|�|�}td�tdt|��t�tj��tjj�|�tjj��dS)NzContent-Type: text/xml�Content-Length: %d)rH�printr{r;�stdout�flush�bufferr�)r'�request_textrCrrr�
handle_xmlrpc�s

z%CGIXMLRPCRequestHandler.handle_xmlrpccCs�d}tj|\}}tjj|||d�}|�d�}td||f�tdtjj�tdt|��t�t	j
��t	j
j�
|�t	j
j��dS)Nr�)r��message�explainr z
Status: %d %szContent-Type: %sr�)rZ	responses�httpr~ZDEFAULT_ERROR_MESSAGEr=r�ZDEFAULT_ERROR_CONTENT_TYPEr{r;r�r�r�r�)r'r�r�r�rCrrr�
handle_get�s ��

z"CGIXMLRPCRequestHandler.handle_getc	Csz|dkr$tj�dd�dkr$|��nRzttj�dd��}Wnttfk
rVd}YnX|dkrltj�	|�}|�
|�dS)NZREQUEST_METHODZGETZCONTENT_LENGTHr_)�os�environrcr�rxr��	TypeErrorr;�stdinrzr�)r'r�Zlengthrrr�handle_request�s�

z&CGIXMLRPCRequestHandler.handle_request)FNF)N)r-r[r\r(r�r�r�rrrrr��s
r�c@s:eZdZdiiifdd�Zdiiidfdd�Zdd�ZdS)�
ServerHTMLDocNcCsZ|p|j}g}d}t�d�}|�||�}	|	s0�q:|	��\}
}|�||||
���|	��\}}
}}}}|
r�||��dd�}|�d||f�n�|r�dt|�}|�d|||�f�n~|r�dt|�}|�d|||�f�nV|||d�d	k�r|�|�	||||��n(|�r"|�d
|�n|�|�	||��|}q|�|||d���d�
|�S)NrzM\b((http|ftp)://\S+[\w/]|RFC[- ]?(\d+)|PEP[- ]?(\d+)|(self\.)?((?:\w|\.)+))\b�"z&quot;z<a href="%s">%s</a>z'http://www.rfc-editor.org/rfc/rfc%d.txtz(http://www.python.org/dev/peps/pep-%04d/r6�(zself.<strong>%s</strong>rQ)�escaper�r��search�spanrV�groups�replacerxZnamelinkr|)r'�textr�r!�classesrNrW�here�patternre�start�end�allZschemeZrfcZpepZselfdotr+Zurlrrr�markup�s6

zServerHTMLDoc.markupcCs�|r
|jpdd|}d}	d|�|�|�|�f}
t|�rHtt|��}nd}t|t�rp|dp`|}|dpld}n
t�|�}|
||	o�|�	d|	�}
|�
||j|||�}|o�d|}d	|
|fS)
NrQr�z$<a name="%s"><strong>%s</strong></a>z(...)rr6z'<font face="helvetica, arial">%s</font>z<dd><tt>%s</tt></dd>z<dl><dt>%s</dt>%s</dl>
)r-r�rr�r	�
isinstance�tuplerRrSZgreyr��	preformat)r'�objectr+�modr!r�rNZclZanchorZnote�titleZargspecZ	docstringZdecl�docrrr�
docroutine�s2�

��zServerHTMLDoc.docroutinec	Cs�i}|��D] \}}d|||<||||<q|�|�}d|}|�|dd�}|�||j|�}	|	ohd|	}	|d|	}g}
t|���}|D]\}}|
�|j|||d��q�||�ddd	d
�	|
��}|S)Nz#-z)<big><big><strong>%s</strong></big></big>z#ffffffz#7799eez<tt>%s</tt>z
<p>%s</p>
)r!ZMethodsz#eeaa77rQ)
�itemsr�Zheadingr�r�rMrVr�Z
bigsectionr|)r'�server_nameZpackage_documentationrNZfdict�key�value�head�resultr��contentsZmethod_itemsrrr�	docservers*
�zServerHTMLDoc.docserver)r-r[r\r�r�r�rrrrr��s)�
r�c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�XMLRPCDocGeneratorcCsd|_d|_d|_dS)NzXML-RPC Server DocumentationzGThis server exports the following methods through the XML-RPC protocol.)r��server_documentation�server_titler2rrrr(:s�zXMLRPCDocGenerator.__init__cCs
||_dSr))r�)r'r�rrr�set_server_titleBsz#XMLRPCDocGenerator.set_server_titlecCs
||_dSr))r�)r'r�rrr�set_server_nameGsz"XMLRPCDocGenerator.set_server_namecCs
||_dSr))r�)r'r�rrr�set_server_documentationLsz+XMLRPCDocGenerator.set_server_documentationc	Cs�i}|��D]�}||jkr&|j|}n�|jdk	r�ddg}t|jd�rT|j�|�|d<t|jd�rp|j�|�|d<t|�}|dkr�|}q�t|jd�s�zt|j|�}Wq�tk
r�|}Yq�Xq�|}n|||<qt	�}|�
|j|j|�}|�
t�|j�|�S)N�_get_method_argstringrrPr6)NNr:)r/r!r"rLr�rPr�rrr�r�r�r�Zpage�htmlr�r�)r'rNrOrBZmethod_infoZ
documenterZ
documentationrrr�generate_html_documentationQs<

�
�z.XMLRPCDocGenerator.generate_html_documentationN)r-r[r\r(r�r�r�r�rrrrr�3s
r�c@seZdZdd�ZdS)�DocXMLRPCRequestHandlercCsf|��s|��dS|j���d�}|�d�|�dd�|�dtt|���|�	�|j
�|�dS)Nr rtruz	text/htmlrr)rmrwr~r�r=rr�r�r{r�r�r�r�rrr�do_GET�s
zDocXMLRPCRequestHandler.do_GETN)r-r[r\r�rrrrr��s
r�c@s"eZdZedddddfdd�ZdS)�DocXMLRPCServerTFNc
Cs&t�||||||||�t�|�dSr))r�r(r�r�rrrr(�s�zDocXMLRPCServer.__init__)r-r[r\r�r(rrrrr��s�r�c@seZdZdd�Zdd�ZdS)�DocCGIXMLRPCRequestHandlercCsT|���d�}td�tdt|��t�tj��tjj�|�tjj��dS)Nr zContent-Type: text/htmlr�)	r�r=r�r{r;r�r�r�r�r�rrrr��s
z%DocCGIXMLRPCRequestHandler.handle_getcCst�|�t�|�dSr))r�r(r�r2rrrr(�s
z#DocCGIXMLRPCRequestHandler.__init__N)r-r[r\r�r(rrrrr��sr��__main__c@s"eZdZdd�ZGdd�d�ZdS)�ExampleServicecCsdS)NZ42rr2rrr�getData�szExampleService.getDatac@seZdZedd��ZdS)zExampleService.currentTimecCs
tj��Sr))�datetimeZnowrrrr�getCurrentTime�sz)ExampleService.currentTime.getCurrentTimeN)r-r[r\�staticmethodr�rrrr�currentTime�sr�N)r-r[r\r�r�rrrrr��sr�)Z	localhosti@cCs||Sr)r)�x�yrrr�<lambda>�rnr��add)rz&Serving XML-RPC on localhost port 8000zKIt is advisable to run this example server within a secure, closed network.z&
Keyboard interrupt received, exiting.)T)0Z
xmlrpc.clientrrrrrZhttp.serverr�	functoolsr�inspectr	r�r�r�r;r�r�rRr�Zfcntl�ImportErrorrrrr]r�r�r�r�ZHTMLDocr�r�r�r�r�r-r�r�r~r,�powr*r5r�Z
serve_forever�KeyboardInterrupt�exitrrrr�<module>ksf

�,EbQ��
	

xmlrpc/client.py000064400000137774151153537470007737 0ustar00#
# XML-RPC CLIENT LIBRARY
# $Id$
#
# an XML-RPC client interface for Python.
#
# the marshalling and response parser code can also be used to
# implement XML-RPC servers.
#
# Notes:
# this version is designed to work with Python 2.1 or newer.
#
# History:
# 1999-01-14 fl  Created
# 1999-01-15 fl  Changed dateTime to use localtime
# 1999-01-16 fl  Added Binary/base64 element, default to RPC2 service
# 1999-01-19 fl  Fixed array data element (from Skip Montanaro)
# 1999-01-21 fl  Fixed dateTime constructor, etc.
# 1999-02-02 fl  Added fault handling, handle empty sequences, etc.
# 1999-02-10 fl  Fixed problem with empty responses (from Skip Montanaro)
# 1999-06-20 fl  Speed improvements, pluggable parsers/transports (0.9.8)
# 2000-11-28 fl  Changed boolean to check the truth value of its argument
# 2001-02-24 fl  Added encoding/Unicode/SafeTransport patches
# 2001-02-26 fl  Added compare support to wrappers (0.9.9/1.0b1)
# 2001-03-28 fl  Make sure response tuple is a singleton
# 2001-03-29 fl  Don't require empty params element (from Nicholas Riley)
# 2001-06-10 fl  Folded in _xmlrpclib accelerator support (1.0b2)
# 2001-08-20 fl  Base xmlrpclib.Error on built-in Exception (from Paul Prescod)
# 2001-09-03 fl  Allow Transport subclass to override getparser
# 2001-09-10 fl  Lazy import of urllib, cgi, xmllib (20x import speedup)
# 2001-10-01 fl  Remove containers from memo cache when done with them
# 2001-10-01 fl  Use faster escape method (80% dumps speedup)
# 2001-10-02 fl  More dumps microtuning
# 2001-10-04 fl  Make sure import expat gets a parser (from Guido van Rossum)
# 2001-10-10 sm  Allow long ints to be passed as ints if they don't overflow
# 2001-10-17 sm  Test for int and long overflow (allows use on 64-bit systems)
# 2001-11-12 fl  Use repr() to marshal doubles (from Paul Felix)
# 2002-03-17 fl  Avoid buffered read when possible (from James Rucker)
# 2002-04-07 fl  Added pythondoc comments
# 2002-04-16 fl  Added __str__ methods to datetime/binary wrappers
# 2002-05-15 fl  Added error constants (from Andrew Kuchling)
# 2002-06-27 fl  Merged with Python CVS version
# 2002-10-22 fl  Added basic authentication (based on code from Phillip Eby)
# 2003-01-22 sm  Add support for the bool type
# 2003-02-27 gvr Remove apply calls
# 2003-04-24 sm  Use cStringIO if available
# 2003-04-25 ak  Add support for nil
# 2003-06-15 gn  Add support for time.struct_time
# 2003-07-12 gp  Correct marshalling of Faults
# 2003-10-31 mvl Add multicall support
# 2004-08-20 mvl Bump minimum supported Python version to 2.1
# 2014-12-02 ch/doko  Add workaround for gzip bomb vulnerability
#
# Copyright (c) 1999-2002 by Secret Labs AB.
# Copyright (c) 1999-2002 by Fredrik Lundh.
#
# info@pythonware.com
# http://www.pythonware.com
#
# --------------------------------------------------------------------
# The XML-RPC client interface is
#
# Copyright (c) 1999-2002 by Secret Labs AB
# Copyright (c) 1999-2002 by Fredrik Lundh
#
# By obtaining, using, and/or copying this software and/or its
# associated documentation, you agree that you have read, understood,
# and will comply with the following terms and conditions:
#
# Permission to use, copy, modify, and distribute this software and
# its associated documentation for any purpose and without fee is
# hereby granted, provided that the above copyright notice appears in
# all copies, and that both that copyright notice and this permission
# notice appear in supporting documentation, and that the name of
# Secret Labs AB or the author not be used in advertising or publicity
# pertaining to distribution of the software without specific, written
# prior permission.
#
# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
# ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
# --------------------------------------------------------------------

"""
An XML-RPC client interface for Python.

The marshalling and response parser code can also be used to
implement XML-RPC servers.

Exported exceptions:

  Error          Base class for client errors
  ProtocolError  Indicates an HTTP protocol error
  ResponseError  Indicates a broken response package
  Fault          Indicates an XML-RPC fault package

Exported classes:

  ServerProxy    Represents a logical connection to an XML-RPC server

  MultiCall      Executor of boxcared xmlrpc requests
  DateTime       dateTime wrapper for an ISO 8601 string or time tuple or
                 localtime integer value to generate a "dateTime.iso8601"
                 XML-RPC value
  Binary         binary data wrapper

  Marshaller     Generate an XML-RPC params chunk from a Python data structure
  Unmarshaller   Unmarshal an XML-RPC response from incoming XML event message
  Transport      Handles an HTTP transaction to an XML-RPC server
  SafeTransport  Handles an HTTPS transaction to an XML-RPC server

Exported constants:

  (none)

Exported functions:

  getparser      Create instance of the fastest available parser & attach
                 to an unmarshalling object
  dumps          Convert an argument tuple or a Fault instance to an XML-RPC
                 request (or response, if the methodresponse option is used).
  loads          Convert an XML-RPC packet to unmarshalled data plus a method
                 name (None if not present).
"""

import base64
import sys
import time
from datetime import datetime
from decimal import Decimal
import http.client
import urllib.parse
from xml.parsers import expat
import errno
from io import BytesIO
try:
    import gzip
except ImportError:
    gzip = None #python can be built without zlib/gzip support

# --------------------------------------------------------------------
# Internal stuff

def escape(s):
    s = s.replace("&", "&amp;")
    s = s.replace("<", "&lt;")
    return s.replace(">", "&gt;",)

# used in User-Agent header sent
__version__ = '%d.%d' % sys.version_info[:2]

# xmlrpc integer limits
MAXINT =  2**31-1
MININT = -2**31

# --------------------------------------------------------------------
# Error constants (from Dan Libby's specification at
# http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php)

# Ranges of errors
PARSE_ERROR       = -32700
SERVER_ERROR      = -32600
APPLICATION_ERROR = -32500
SYSTEM_ERROR      = -32400
TRANSPORT_ERROR   = -32300

# Specific errors
NOT_WELLFORMED_ERROR  = -32700
UNSUPPORTED_ENCODING  = -32701
INVALID_ENCODING_CHAR = -32702
INVALID_XMLRPC        = -32600
METHOD_NOT_FOUND      = -32601
INVALID_METHOD_PARAMS = -32602
INTERNAL_ERROR        = -32603

# --------------------------------------------------------------------
# Exceptions

##
# Base class for all kinds of client-side errors.

class Error(Exception):
    """Base class for client errors."""
    __str__ = object.__str__

##
# Indicates an HTTP-level protocol error.  This is raised by the HTTP
# transport layer, if the server returns an error code other than 200
# (OK).
#
# @param url The target URL.
# @param errcode The HTTP error code.
# @param errmsg The HTTP error message.
# @param headers The HTTP header dictionary.

class ProtocolError(Error):
    """Indicates an HTTP protocol error."""
    def __init__(self, url, errcode, errmsg, headers):
        Error.__init__(self)
        self.url = url
        self.errcode = errcode
        self.errmsg = errmsg
        self.headers = headers
    def __repr__(self):
        return (
            "<%s for %s: %s %s>" %
            (self.__class__.__name__, self.url, self.errcode, self.errmsg)
            )

##
# Indicates a broken XML-RPC response package.  This exception is
# raised by the unmarshalling layer, if the XML-RPC response is
# malformed.

class ResponseError(Error):
    """Indicates a broken response package."""
    pass

##
# Indicates an XML-RPC fault response package.  This exception is
# raised by the unmarshalling layer, if the XML-RPC response contains
# a fault string.  This exception can also be used as a class, to
# generate a fault XML-RPC message.
#
# @param faultCode The XML-RPC fault code.
# @param faultString The XML-RPC fault string.

class Fault(Error):
    """Indicates an XML-RPC fault package."""
    def __init__(self, faultCode, faultString, **extra):
        Error.__init__(self)
        self.faultCode = faultCode
        self.faultString = faultString
    def __repr__(self):
        return "<%s %s: %r>" % (self.__class__.__name__,
                                self.faultCode, self.faultString)

# --------------------------------------------------------------------
# Special values

##
# Backwards compatibility

boolean = Boolean = bool

##
# Wrapper for XML-RPC DateTime values.  This converts a time value to
# the format used by XML-RPC.
# <p>
# The value can be given as a datetime object, as a string in the
# format "yyyymmddThh:mm:ss", as a 9-item time tuple (as returned by
# time.localtime()), or an integer value (as returned by time.time()).
# The wrapper uses time.localtime() to convert an integer to a time
# tuple.
#
# @param value The time, given as a datetime object, an ISO 8601 string,
#              a time tuple, or an integer time value.


# Issue #13305: different format codes across platforms
_day0 = datetime(1, 1, 1)
if _day0.strftime('%Y') == '0001':      # Mac OS X
    def _iso8601_format(value):
        return value.strftime("%Y%m%dT%H:%M:%S")
elif _day0.strftime('%4Y') == '0001':   # Linux
    def _iso8601_format(value):
        return value.strftime("%4Y%m%dT%H:%M:%S")
else:
    def _iso8601_format(value):
        return value.strftime("%Y%m%dT%H:%M:%S").zfill(17)
del _day0


def _strftime(value):
    if isinstance(value, datetime):
        return _iso8601_format(value)

    if not isinstance(value, (tuple, time.struct_time)):
        if value == 0:
            value = time.time()
        value = time.localtime(value)

    return "%04d%02d%02dT%02d:%02d:%02d" % value[:6]

class DateTime:
    """DateTime wrapper for an ISO 8601 string or time tuple or
    localtime integer value to generate 'dateTime.iso8601' XML-RPC
    value.
    """

    def __init__(self, value=0):
        if isinstance(value, str):
            self.value = value
        else:
            self.value = _strftime(value)

    def make_comparable(self, other):
        if isinstance(other, DateTime):
            s = self.value
            o = other.value
        elif isinstance(other, datetime):
            s = self.value
            o = _iso8601_format(other)
        elif isinstance(other, str):
            s = self.value
            o = other
        elif hasattr(other, "timetuple"):
            s = self.timetuple()
            o = other.timetuple()
        else:
            otype = (hasattr(other, "__class__")
                     and other.__class__.__name__
                     or type(other))
            raise TypeError("Can't compare %s and %s" %
                            (self.__class__.__name__, otype))
        return s, o

    def __lt__(self, other):
        s, o = self.make_comparable(other)
        return s < o

    def __le__(self, other):
        s, o = self.make_comparable(other)
        return s <= o

    def __gt__(self, other):
        s, o = self.make_comparable(other)
        return s > o

    def __ge__(self, other):
        s, o = self.make_comparable(other)
        return s >= o

    def __eq__(self, other):
        s, o = self.make_comparable(other)
        return s == o

    def timetuple(self):
        return time.strptime(self.value, "%Y%m%dT%H:%M:%S")

    ##
    # Get date/time value.
    #
    # @return Date/time value, as an ISO 8601 string.

    def __str__(self):
        return self.value

    def __repr__(self):
        return "<%s %r at %#x>" % (self.__class__.__name__, self.value, id(self))

    def decode(self, data):
        self.value = str(data).strip()

    def encode(self, out):
        out.write("<value><dateTime.iso8601>")
        out.write(self.value)
        out.write("</dateTime.iso8601></value>\n")

def _datetime(data):
    # decode xml element contents into a DateTime structure.
    value = DateTime()
    value.decode(data)
    return value

def _datetime_type(data):
    return datetime.strptime(data, "%Y%m%dT%H:%M:%S")

##
# Wrapper for binary data.  This can be used to transport any kind
# of binary data over XML-RPC, using BASE64 encoding.
#
# @param data An 8-bit string containing arbitrary data.

class Binary:
    """Wrapper for binary data."""

    def __init__(self, data=None):
        if data is None:
            data = b""
        else:
            if not isinstance(data, (bytes, bytearray)):
                raise TypeError("expected bytes or bytearray, not %s" %
                                data.__class__.__name__)
            data = bytes(data)  # Make a copy of the bytes!
        self.data = data

    ##
    # Get buffer contents.
    #
    # @return Buffer contents, as an 8-bit string.

    def __str__(self):
        return str(self.data, "latin-1")  # XXX encoding?!

    def __eq__(self, other):
        if isinstance(other, Binary):
            other = other.data
        return self.data == other

    def decode(self, data):
        self.data = base64.decodebytes(data)

    def encode(self, out):
        out.write("<value><base64>\n")
        encoded = base64.encodebytes(self.data)
        out.write(encoded.decode('ascii'))
        out.write("</base64></value>\n")

def _binary(data):
    # decode xml element contents into a Binary structure
    value = Binary()
    value.decode(data)
    return value

WRAPPERS = (DateTime, Binary)

# --------------------------------------------------------------------
# XML parsers

class ExpatParser:
    # fast expat parser for Python 2.0 and later.
    def __init__(self, target):
        self._parser = parser = expat.ParserCreate(None, None)
        self._target = target
        parser.StartElementHandler = target.start
        parser.EndElementHandler = target.end
        parser.CharacterDataHandler = target.data
        encoding = None
        target.xml(encoding, None)

    def feed(self, data):
        self._parser.Parse(data, 0)

    def close(self):
        try:
            parser = self._parser
        except AttributeError:
            pass
        else:
            del self._target, self._parser # get rid of circular references
            parser.Parse(b"", True) # end of data

# --------------------------------------------------------------------
# XML-RPC marshalling and unmarshalling code

##
# XML-RPC marshaller.
#
# @param encoding Default encoding for 8-bit strings.  The default
#     value is None (interpreted as UTF-8).
# @see dumps

class Marshaller:
    """Generate an XML-RPC params chunk from a Python data structure.

    Create a Marshaller instance for each set of parameters, and use
    the "dumps" method to convert your data (represented as a tuple)
    to an XML-RPC params chunk.  To write a fault response, pass a
    Fault instance instead.  You may prefer to use the "dumps" module
    function for this purpose.
    """

    # by the way, if you don't understand what's going on in here,
    # that's perfectly ok.

    def __init__(self, encoding=None, allow_none=False):
        self.memo = {}
        self.data = None
        self.encoding = encoding
        self.allow_none = allow_none

    dispatch = {}

    def dumps(self, values):
        out = []
        write = out.append
        dump = self.__dump
        if isinstance(values, Fault):
            # fault instance
            write("<fault>\n")
            dump({'faultCode': values.faultCode,
                  'faultString': values.faultString},
                 write)
            write("</fault>\n")
        else:
            # parameter block
            # FIXME: the xml-rpc specification allows us to leave out
            # the entire <params> block if there are no parameters.
            # however, changing this may break older code (including
            # old versions of xmlrpclib.py), so this is better left as
            # is for now.  See @XMLRPC3 for more information. /F
            write("<params>\n")
            for v in values:
                write("<param>\n")
                dump(v, write)
                write("</param>\n")
            write("</params>\n")
        result = "".join(out)
        return result

    def __dump(self, value, write):
        try:
            f = self.dispatch[type(value)]
        except KeyError:
            # check if this object can be marshalled as a structure
            if not hasattr(value, '__dict__'):
                raise TypeError("cannot marshal %s objects" % type(value))
            # check if this class is a sub-class of a basic type,
            # because we don't know how to marshal these types
            # (e.g. a string sub-class)
            for type_ in type(value).__mro__:
                if type_ in self.dispatch.keys():
                    raise TypeError("cannot marshal %s objects" % type(value))
            # XXX(twouters): using "_arbitrary_instance" as key as a quick-fix
            # for the p3yk merge, this should probably be fixed more neatly.
            f = self.dispatch["_arbitrary_instance"]
        f(self, value, write)

    def dump_nil (self, value, write):
        if not self.allow_none:
            raise TypeError("cannot marshal None unless allow_none is enabled")
        write("<value><nil/></value>")
    dispatch[type(None)] = dump_nil

    def dump_bool(self, value, write):
        write("<value><boolean>")
        write(value and "1" or "0")
        write("</boolean></value>\n")
    dispatch[bool] = dump_bool

    def dump_long(self, value, write):
        if value > MAXINT or value < MININT:
            raise OverflowError("int exceeds XML-RPC limits")
        write("<value><int>")
        write(str(int(value)))
        write("</int></value>\n")
    dispatch[int] = dump_long

    # backward compatible
    dump_int = dump_long

    def dump_double(self, value, write):
        write("<value><double>")
        write(repr(value))
        write("</double></value>\n")
    dispatch[float] = dump_double

    def dump_unicode(self, value, write, escape=escape):
        write("<value><string>")
        write(escape(value))
        write("</string></value>\n")
    dispatch[str] = dump_unicode

    def dump_bytes(self, value, write):
        write("<value><base64>\n")
        encoded = base64.encodebytes(value)
        write(encoded.decode('ascii'))
        write("</base64></value>\n")
    dispatch[bytes] = dump_bytes
    dispatch[bytearray] = dump_bytes

    def dump_array(self, value, write):
        i = id(value)
        if i in self.memo:
            raise TypeError("cannot marshal recursive sequences")
        self.memo[i] = None
        dump = self.__dump
        write("<value><array><data>\n")
        for v in value:
            dump(v, write)
        write("</data></array></value>\n")
        del self.memo[i]
    dispatch[tuple] = dump_array
    dispatch[list] = dump_array

    def dump_struct(self, value, write, escape=escape):
        i = id(value)
        if i in self.memo:
            raise TypeError("cannot marshal recursive dictionaries")
        self.memo[i] = None
        dump = self.__dump
        write("<value><struct>\n")
        for k, v in value.items():
            write("<member>\n")
            if not isinstance(k, str):
                raise TypeError("dictionary key must be string")
            write("<name>%s</name>\n" % escape(k))
            dump(v, write)
            write("</member>\n")
        write("</struct></value>\n")
        del self.memo[i]
    dispatch[dict] = dump_struct

    def dump_datetime(self, value, write):
        write("<value><dateTime.iso8601>")
        write(_strftime(value))
        write("</dateTime.iso8601></value>\n")
    dispatch[datetime] = dump_datetime

    def dump_instance(self, value, write):
        # check for special wrappers
        if value.__class__ in WRAPPERS:
            self.write = write
            value.encode(self)
            del self.write
        else:
            # store instance attributes as a struct (really?)
            self.dump_struct(value.__dict__, write)
    dispatch[DateTime] = dump_instance
    dispatch[Binary] = dump_instance
    # XXX(twouters): using "_arbitrary_instance" as key as a quick-fix
    # for the p3yk merge, this should probably be fixed more neatly.
    dispatch["_arbitrary_instance"] = dump_instance

##
# XML-RPC unmarshaller.
#
# @see loads

class Unmarshaller:
    """Unmarshal an XML-RPC response, based on incoming XML event
    messages (start, data, end).  Call close() to get the resulting
    data structure.

    Note that this reader is fairly tolerant, and gladly accepts bogus
    XML-RPC data without complaining (but not bogus XML).
    """

    # and again, if you don't understand what's going on in here,
    # that's perfectly ok.

    def __init__(self, use_datetime=False, use_builtin_types=False):
        self._type = None
        self._stack = []
        self._marks = []
        self._data = []
        self._value = False
        self._methodname = None
        self._encoding = "utf-8"
        self.append = self._stack.append
        self._use_datetime = use_builtin_types or use_datetime
        self._use_bytes = use_builtin_types

    def close(self):
        # return response tuple and target method
        if self._type is None or self._marks:
            raise ResponseError()
        if self._type == "fault":
            raise Fault(**self._stack[0])
        return tuple(self._stack)

    def getmethodname(self):
        return self._methodname

    #
    # event handlers

    def xml(self, encoding, standalone):
        self._encoding = encoding
        # FIXME: assert standalone == 1 ???

    def start(self, tag, attrs):
        # prepare to handle this element
        if ':' in tag:
            tag = tag.split(':')[-1]
        if tag == "array" or tag == "struct":
            self._marks.append(len(self._stack))
        self._data = []
        if self._value and tag not in self.dispatch:
            raise ResponseError("unknown tag %r" % tag)
        self._value = (tag == "value")

    def data(self, text):
        self._data.append(text)

    def end(self, tag):
        # call the appropriate end tag handler
        try:
            f = self.dispatch[tag]
        except KeyError:
            if ':' not in tag:
                return # unknown tag ?
            try:
                f = self.dispatch[tag.split(':')[-1]]
            except KeyError:
                return # unknown tag ?
        return f(self, "".join(self._data))

    #
    # accelerator support

    def end_dispatch(self, tag, data):
        # dispatch data
        try:
            f = self.dispatch[tag]
        except KeyError:
            if ':' not in tag:
                return # unknown tag ?
            try:
                f = self.dispatch[tag.split(':')[-1]]
            except KeyError:
                return # unknown tag ?
        return f(self, data)

    #
    # element decoders

    dispatch = {}

    def end_nil (self, data):
        self.append(None)
        self._value = 0
    dispatch["nil"] = end_nil

    def end_boolean(self, data):
        if data == "0":
            self.append(False)
        elif data == "1":
            self.append(True)
        else:
            raise TypeError("bad boolean value")
        self._value = 0
    dispatch["boolean"] = end_boolean

    def end_int(self, data):
        self.append(int(data))
        self._value = 0
    dispatch["i1"] = end_int
    dispatch["i2"] = end_int
    dispatch["i4"] = end_int
    dispatch["i8"] = end_int
    dispatch["int"] = end_int
    dispatch["biginteger"] = end_int

    def end_double(self, data):
        self.append(float(data))
        self._value = 0
    dispatch["double"] = end_double
    dispatch["float"] = end_double

    def end_bigdecimal(self, data):
        self.append(Decimal(data))
        self._value = 0
    dispatch["bigdecimal"] = end_bigdecimal

    def end_string(self, data):
        if self._encoding:
            data = data.decode(self._encoding)
        self.append(data)
        self._value = 0
    dispatch["string"] = end_string
    dispatch["name"] = end_string # struct keys are always strings

    def end_array(self, data):
        mark = self._marks.pop()
        # map arrays to Python lists
        self._stack[mark:] = [self._stack[mark:]]
        self._value = 0
    dispatch["array"] = end_array

    def end_struct(self, data):
        mark = self._marks.pop()
        # map structs to Python dictionaries
        dict = {}
        items = self._stack[mark:]
        for i in range(0, len(items), 2):
            dict[items[i]] = items[i+1]
        self._stack[mark:] = [dict]
        self._value = 0
    dispatch["struct"] = end_struct

    def end_base64(self, data):
        value = Binary()
        value.decode(data.encode("ascii"))
        if self._use_bytes:
            value = value.data
        self.append(value)
        self._value = 0
    dispatch["base64"] = end_base64

    def end_dateTime(self, data):
        value = DateTime()
        value.decode(data)
        if self._use_datetime:
            value = _datetime_type(data)
        self.append(value)
    dispatch["dateTime.iso8601"] = end_dateTime

    def end_value(self, data):
        # if we stumble upon a value element with no internal
        # elements, treat it as a string element
        if self._value:
            self.end_string(data)
    dispatch["value"] = end_value

    def end_params(self, data):
        self._type = "params"
    dispatch["params"] = end_params

    def end_fault(self, data):
        self._type = "fault"
    dispatch["fault"] = end_fault

    def end_methodName(self, data):
        if self._encoding:
            data = data.decode(self._encoding)
        self._methodname = data
        self._type = "methodName" # no params
    dispatch["methodName"] = end_methodName

## Multicall support
#

class _MultiCallMethod:
    # some lesser magic to store calls made to a MultiCall object
    # for batch execution
    def __init__(self, call_list, name):
        self.__call_list = call_list
        self.__name = name
    def __getattr__(self, name):
        return _MultiCallMethod(self.__call_list, "%s.%s" % (self.__name, name))
    def __call__(self, *args):
        self.__call_list.append((self.__name, args))

class MultiCallIterator:
    """Iterates over the results of a multicall. Exceptions are
    raised in response to xmlrpc faults."""

    def __init__(self, results):
        self.results = results

    def __getitem__(self, i):
        item = self.results[i]
        if type(item) == type({}):
            raise Fault(item['faultCode'], item['faultString'])
        elif type(item) == type([]):
            return item[0]
        else:
            raise ValueError("unexpected type in multicall result")

class MultiCall:
    """server -> an object used to boxcar method calls

    server should be a ServerProxy object.

    Methods can be added to the MultiCall using normal
    method call syntax e.g.:

    multicall = MultiCall(server_proxy)
    multicall.add(2,3)
    multicall.get_address("Guido")

    To execute the multicall, call the MultiCall object e.g.:

    add_result, address = multicall()
    """

    def __init__(self, server):
        self.__server = server
        self.__call_list = []

    def __repr__(self):
        return "<%s at %#x>" % (self.__class__.__name__, id(self))

    def __getattr__(self, name):
        return _MultiCallMethod(self.__call_list, name)

    def __call__(self):
        marshalled_list = []
        for name, args in self.__call_list:
            marshalled_list.append({'methodName' : name, 'params' : args})

        return MultiCallIterator(self.__server.system.multicall(marshalled_list))

# --------------------------------------------------------------------
# convenience functions

FastMarshaller = FastParser = FastUnmarshaller = None

##
# Create a parser object, and connect it to an unmarshalling instance.
# This function picks the fastest available XML parser.
#
# return A (parser, unmarshaller) tuple.

def getparser(use_datetime=False, use_builtin_types=False):
    """getparser() -> parser, unmarshaller

    Create an instance of the fastest available parser, and attach it
    to an unmarshalling object.  Return both objects.
    """
    if FastParser and FastUnmarshaller:
        if use_builtin_types:
            mkdatetime = _datetime_type
            mkbytes = base64.decodebytes
        elif use_datetime:
            mkdatetime = _datetime_type
            mkbytes = _binary
        else:
            mkdatetime = _datetime
            mkbytes = _binary
        target = FastUnmarshaller(True, False, mkbytes, mkdatetime, Fault)
        parser = FastParser(target)
    else:
        target = Unmarshaller(use_datetime=use_datetime, use_builtin_types=use_builtin_types)
        if FastParser:
            parser = FastParser(target)
        else:
            parser = ExpatParser(target)
    return parser, target

##
# Convert a Python tuple or a Fault instance to an XML-RPC packet.
#
# @def dumps(params, **options)
# @param params A tuple or Fault instance.
# @keyparam methodname If given, create a methodCall request for
#     this method name.
# @keyparam methodresponse If given, create a methodResponse packet.
#     If used with a tuple, the tuple must be a singleton (that is,
#     it must contain exactly one element).
# @keyparam encoding The packet encoding.
# @return A string containing marshalled data.

def dumps(params, methodname=None, methodresponse=None, encoding=None,
          allow_none=False):
    """data [,options] -> marshalled data

    Convert an argument tuple or a Fault instance to an XML-RPC
    request (or response, if the methodresponse option is used).

    In addition to the data object, the following options can be given
    as keyword arguments:

        methodname: the method name for a methodCall packet

        methodresponse: true to create a methodResponse packet.
        If this option is used with a tuple, the tuple must be
        a singleton (i.e. it can contain only one element).

        encoding: the packet encoding (default is UTF-8)

    All byte strings in the data structure are assumed to use the
    packet encoding.  Unicode strings are automatically converted,
    where necessary.
    """

    assert isinstance(params, (tuple, Fault)), "argument must be tuple or Fault instance"
    if isinstance(params, Fault):
        methodresponse = 1
    elif methodresponse and isinstance(params, tuple):
        assert len(params) == 1, "response tuple must be a singleton"

    if not encoding:
        encoding = "utf-8"

    if FastMarshaller:
        m = FastMarshaller(encoding)
    else:
        m = Marshaller(encoding, allow_none)

    data = m.dumps(params)

    if encoding != "utf-8":
        xmlheader = "<?xml version='1.0' encoding='%s'?>\n" % str(encoding)
    else:
        xmlheader = "<?xml version='1.0'?>\n" # utf-8 is default

    # standard XML-RPC wrappings
    if methodname:
        # a method call
        data = (
            xmlheader,
            "<methodCall>\n"
            "<methodName>", methodname, "</methodName>\n",
            data,
            "</methodCall>\n"
            )
    elif methodresponse:
        # a method response, or a fault structure
        data = (
            xmlheader,
            "<methodResponse>\n",
            data,
            "</methodResponse>\n"
            )
    else:
        return data # return as is
    return "".join(data)

##
# Convert an XML-RPC packet to a Python object.  If the XML-RPC packet
# represents a fault condition, this function raises a Fault exception.
#
# @param data An XML-RPC packet, given as an 8-bit string.
# @return A tuple containing the unpacked data, and the method name
#     (None if not present).
# @see Fault

def loads(data, use_datetime=False, use_builtin_types=False):
    """data -> unmarshalled data, method name

    Convert an XML-RPC packet to unmarshalled data plus a method
    name (None if not present).

    If the XML-RPC packet represents a fault condition, this function
    raises a Fault exception.
    """
    p, u = getparser(use_datetime=use_datetime, use_builtin_types=use_builtin_types)
    p.feed(data)
    p.close()
    return u.close(), u.getmethodname()

##
# Encode a string using the gzip content encoding such as specified by the
# Content-Encoding: gzip
# in the HTTP header, as described in RFC 1952
#
# @param data the unencoded data
# @return the encoded data

def gzip_encode(data):
    """data -> gzip encoded data

    Encode data using the gzip content encoding as described in RFC 1952
    """
    if not gzip:
        raise NotImplementedError
    f = BytesIO()
    with gzip.GzipFile(mode="wb", fileobj=f, compresslevel=1) as gzf:
        gzf.write(data)
    return f.getvalue()

##
# Decode a string using the gzip content encoding such as specified by the
# Content-Encoding: gzip
# in the HTTP header, as described in RFC 1952
#
# @param data The encoded data
# @keyparam max_decode Maximum bytes to decode (20 MiB default), use negative
#    values for unlimited decoding
# @return the unencoded data
# @raises ValueError if data is not correctly coded.
# @raises ValueError if max gzipped payload length exceeded

def gzip_decode(data, max_decode=20971520):
    """gzip encoded data -> unencoded data

    Decode data using the gzip content encoding as described in RFC 1952
    """
    if not gzip:
        raise NotImplementedError
    with gzip.GzipFile(mode="rb", fileobj=BytesIO(data)) as gzf:
        try:
            if max_decode < 0: # no limit
                decoded = gzf.read()
            else:
                decoded = gzf.read(max_decode + 1)
        except OSError:
            raise ValueError("invalid data")
    if max_decode >= 0 and len(decoded) > max_decode:
        raise ValueError("max gzipped payload length exceeded")
    return decoded

##
# Return a decoded file-like object for the gzip encoding
# as described in RFC 1952.
#
# @param response A stream supporting a read() method
# @return a file-like object that the decoded data can be read() from

class GzipDecodedResponse(gzip.GzipFile if gzip else object):
    """a file-like object to decode a response encoded with the gzip
    method, as described in RFC 1952.
    """
    def __init__(self, response):
        #response doesn't support tell() and read(), required by
        #GzipFile
        if not gzip:
            raise NotImplementedError
        self.io = BytesIO(response.read())
        gzip.GzipFile.__init__(self, mode="rb", fileobj=self.io)

    def close(self):
        try:
            gzip.GzipFile.close(self)
        finally:
            self.io.close()


# --------------------------------------------------------------------
# request dispatcher

class _Method:
    # some magic to bind an XML-RPC method to an RPC server.
    # supports "nested" methods (e.g. examples.getStateName)
    def __init__(self, send, name):
        self.__send = send
        self.__name = name
    def __getattr__(self, name):
        return _Method(self.__send, "%s.%s" % (self.__name, name))
    def __call__(self, *args):
        return self.__send(self.__name, args)

##
# Standard transport class for XML-RPC over HTTP.
# <p>
# You can create custom transports by subclassing this method, and
# overriding selected methods.

class Transport:
    """Handles an HTTP transaction to an XML-RPC server."""

    # client identifier (may be overridden)
    user_agent = "Python-xmlrpc/%s" % __version__

    #if true, we'll request gzip encoding
    accept_gzip_encoding = True

    # if positive, encode request using gzip if it exceeds this threshold
    # note that many servers will get confused, so only use it if you know
    # that they can decode such a request
    encode_threshold = None #None = don't encode

    def __init__(self, use_datetime=False, use_builtin_types=False,
                 *, headers=()):
        self._use_datetime = use_datetime
        self._use_builtin_types = use_builtin_types
        self._connection = (None, None)
        self._headers = list(headers)
        self._extra_headers = []

    ##
    # Send a complete request, and parse the response.
    # Retry request if a cached connection has disconnected.
    #
    # @param host Target host.
    # @param handler Target PRC handler.
    # @param request_body XML-RPC request body.
    # @param verbose Debugging flag.
    # @return Parsed response.

    def request(self, host, handler, request_body, verbose=False):
        #retry request once if cached connection has gone cold
        for i in (0, 1):
            try:
                return self.single_request(host, handler, request_body, verbose)
            except http.client.RemoteDisconnected:
                if i:
                    raise
            except OSError as e:
                if i or e.errno not in (errno.ECONNRESET, errno.ECONNABORTED,
                                        errno.EPIPE):
                    raise

    def single_request(self, host, handler, request_body, verbose=False):
        # issue XML-RPC request
        try:
            http_conn = self.send_request(host, handler, request_body, verbose)
            resp = http_conn.getresponse()
            if resp.status == 200:
                self.verbose = verbose
                return self.parse_response(resp)

        except Fault:
            raise
        except Exception:
            #All unexpected errors leave connection in
            # a strange state, so we clear it.
            self.close()
            raise

        #We got an error response.
        #Discard any response data and raise exception
        if resp.getheader("content-length", ""):
            resp.read()
        raise ProtocolError(
            host + handler,
            resp.status, resp.reason,
            dict(resp.getheaders())
            )


    ##
    # Create parser.
    #
    # @return A 2-tuple containing a parser and an unmarshaller.

    def getparser(self):
        # get parser and unmarshaller
        return getparser(use_datetime=self._use_datetime,
                         use_builtin_types=self._use_builtin_types)

    ##
    # Get authorization info from host parameter
    # Host may be a string, or a (host, x509-dict) tuple; if a string,
    # it is checked for a "user:pw@host" format, and a "Basic
    # Authentication" header is added if appropriate.
    #
    # @param host Host descriptor (URL or (URL, x509 info) tuple).
    # @return A 3-tuple containing (actual host, extra headers,
    #     x509 info).  The header and x509 fields may be None.

    def get_host_info(self, host):

        x509 = {}
        if isinstance(host, tuple):
            host, x509 = host

        auth, host = urllib.parse._splituser(host)

        if auth:
            auth = urllib.parse.unquote_to_bytes(auth)
            auth = base64.encodebytes(auth).decode("utf-8")
            auth = "".join(auth.split()) # get rid of whitespace
            extra_headers = [
                ("Authorization", "Basic " + auth)
                ]
        else:
            extra_headers = []

        return host, extra_headers, x509

    ##
    # Connect to server.
    #
    # @param host Target host.
    # @return An HTTPConnection object

    def make_connection(self, host):
        #return an existing connection if possible.  This allows
        #HTTP/1.1 keep-alive.
        if self._connection and host == self._connection[0]:
            return self._connection[1]
        # create a HTTP connection object from a host descriptor
        chost, self._extra_headers, x509 = self.get_host_info(host)
        self._connection = host, http.client.HTTPConnection(chost)
        return self._connection[1]

    ##
    # Clear any cached connection object.
    # Used in the event of socket errors.
    #
    def close(self):
        host, connection = self._connection
        if connection:
            self._connection = (None, None)
            connection.close()

    ##
    # Send HTTP request.
    #
    # @param host Host descriptor (URL or (URL, x509 info) tuple).
    # @param handler Target RPC handler (a path relative to host)
    # @param request_body The XML-RPC request body
    # @param debug Enable debugging if debug is true.
    # @return An HTTPConnection.

    def send_request(self, host, handler, request_body, debug):
        connection = self.make_connection(host)
        headers = self._headers + self._extra_headers
        if debug:
            connection.set_debuglevel(1)
        if self.accept_gzip_encoding and gzip:
            connection.putrequest("POST", handler, skip_accept_encoding=True)
            headers.append(("Accept-Encoding", "gzip"))
        else:
            connection.putrequest("POST", handler)
        headers.append(("Content-Type", "text/xml"))
        headers.append(("User-Agent", self.user_agent))
        self.send_headers(connection, headers)
        self.send_content(connection, request_body)
        return connection

    ##
    # Send request headers.
    # This function provides a useful hook for subclassing
    #
    # @param connection httpConnection.
    # @param headers list of key,value pairs for HTTP headers

    def send_headers(self, connection, headers):
        for key, val in headers:
            connection.putheader(key, val)

    ##
    # Send request body.
    # This function provides a useful hook for subclassing
    #
    # @param connection httpConnection.
    # @param request_body XML-RPC request body.

    def send_content(self, connection, request_body):
        #optionally encode the request
        if (self.encode_threshold is not None and
            self.encode_threshold < len(request_body) and
            gzip):
            connection.putheader("Content-Encoding", "gzip")
            request_body = gzip_encode(request_body)

        connection.putheader("Content-Length", str(len(request_body)))
        connection.endheaders(request_body)

    ##
    # Parse response.
    #
    # @param file Stream.
    # @return Response tuple and target method.

    def parse_response(self, response):
        # read response data from httpresponse, and parse it
        # Check for new http response object, otherwise it is a file object.
        if hasattr(response, 'getheader'):
            if response.getheader("Content-Encoding", "") == "gzip":
                stream = GzipDecodedResponse(response)
            else:
                stream = response
        else:
            stream = response

        p, u = self.getparser()

        while 1:
            data = stream.read(1024)
            if not data:
                break
            if self.verbose:
                print("body:", repr(data))
            p.feed(data)

        if stream is not response:
            stream.close()
        p.close()

        return u.close()

##
# Standard transport class for XML-RPC over HTTPS.

class SafeTransport(Transport):
    """Handles an HTTPS transaction to an XML-RPC server."""

    def __init__(self, use_datetime=False, use_builtin_types=False,
                 *, headers=(), context=None):
        super().__init__(use_datetime=use_datetime,
                         use_builtin_types=use_builtin_types,
                         headers=headers)
        self.context = context

    # FIXME: mostly untested

    def make_connection(self, host):
        if self._connection and host == self._connection[0]:
            return self._connection[1]

        if not hasattr(http.client, "HTTPSConnection"):
            raise NotImplementedError(
            "your version of http.client doesn't support HTTPS")
        # create a HTTPS connection object from a host descriptor
        # host may be a string, or a (host, x509-dict) tuple
        chost, self._extra_headers, x509 = self.get_host_info(host)
        self._connection = host, http.client.HTTPSConnection(chost,
            None, context=self.context, **(x509 or {}))
        return self._connection[1]

##
# Standard server proxy.  This class establishes a virtual connection
# to an XML-RPC server.
# <p>
# This class is available as ServerProxy and Server.  New code should
# use ServerProxy, to avoid confusion.
#
# @def ServerProxy(uri, **options)
# @param uri The connection point on the server.
# @keyparam transport A transport factory, compatible with the
#    standard transport class.
# @keyparam encoding The default encoding used for 8-bit strings
#    (default is UTF-8).
# @keyparam verbose Use a true value to enable debugging output.
#    (printed to standard output).
# @see Transport

class ServerProxy:
    """uri [,options] -> a logical connection to an XML-RPC server

    uri is the connection point on the server, given as
    scheme://host/target.

    The standard implementation always supports the "http" scheme.  If
    SSL socket support is available (Python 2.0), it also supports
    "https".

    If the target part and the slash preceding it are both omitted,
    "/RPC2" is assumed.

    The following options can be given as keyword arguments:

        transport: a transport factory
        encoding: the request encoding (default is UTF-8)

    All 8-bit strings passed to the server proxy are assumed to use
    the given encoding.
    """

    def __init__(self, uri, transport=None, encoding=None, verbose=False,
                 allow_none=False, use_datetime=False, use_builtin_types=False,
                 *, headers=(), context=None):
        # establish a "logical" server connection

        # get the url
        type, uri = urllib.parse._splittype(uri)
        if type not in ("http", "https"):
            raise OSError("unsupported XML-RPC protocol")
        self.__host, self.__handler = urllib.parse._splithost(uri)
        if not self.__handler:
            self.__handler = "/RPC2"

        if transport is None:
            if type == "https":
                handler = SafeTransport
                extra_kwargs = {"context": context}
            else:
                handler = Transport
                extra_kwargs = {}
            transport = handler(use_datetime=use_datetime,
                                use_builtin_types=use_builtin_types,
                                headers=headers,
                                **extra_kwargs)
        self.__transport = transport

        self.__encoding = encoding or 'utf-8'
        self.__verbose = verbose
        self.__allow_none = allow_none

    def __close(self):
        self.__transport.close()

    def __request(self, methodname, params):
        # call a method on the remote server

        request = dumps(params, methodname, encoding=self.__encoding,
                        allow_none=self.__allow_none).encode(self.__encoding, 'xmlcharrefreplace')

        response = self.__transport.request(
            self.__host,
            self.__handler,
            request,
            verbose=self.__verbose
            )

        if len(response) == 1:
            response = response[0]

        return response

    def __repr__(self):
        return (
            "<%s for %s%s>" %
            (self.__class__.__name__, self.__host, self.__handler)
            )

    def __getattr__(self, name):
        # magic method dispatcher
        return _Method(self.__request, name)

    # note: to call a remote object with a non-standard name, use
    # result getattr(server, "strange-python-name")(args)

    def __call__(self, attr):
        """A workaround to get special attributes on the ServerProxy
           without interfering with the magic __getattr__
        """
        if attr == "close":
            return self.__close
        elif attr == "transport":
            return self.__transport
        raise AttributeError("Attribute %r not found" % (attr,))

    def __enter__(self):
        return self

    def __exit__(self, *args):
        self.__close()

# compatibility

Server = ServerProxy

# --------------------------------------------------------------------
# test code

if __name__ == "__main__":

    # simple test program (from the XML-RPC specification)

    # local server, available from Lib/xmlrpc/server.py
    server = ServerProxy("http://localhost:8000")

    try:
        print(server.currentTime.getCurrentTime())
    except Error as v:
        print("ERROR", v)

    multi = MultiCall(server)
    multi.getData()
    multi.pow(2,9)
    multi.add(1,2)
    try:
        for response in multi():
            print(response)
    except Error as v:
        print("ERROR", v)
filecmp.py000064400000023146151153537470006556 0ustar00"""Utilities for comparing files and directories.

Classes:
    dircmp

Functions:
    cmp(f1, f2, shallow=True) -> int
    cmpfiles(a, b, common) -> ([], [], [])
    clear_cache()

"""

import os
import stat
from itertools import filterfalse

__all__ = ['clear_cache', 'cmp', 'dircmp', 'cmpfiles', 'DEFAULT_IGNORES']

_cache = {}
BUFSIZE = 8*1024

DEFAULT_IGNORES = [
    'RCS', 'CVS', 'tags', '.git', '.hg', '.bzr', '_darcs', '__pycache__']

def clear_cache():
    """Clear the filecmp cache."""
    _cache.clear()

def cmp(f1, f2, shallow=True):
    """Compare two files.

    Arguments:

    f1 -- First file name

    f2 -- Second file name

    shallow -- Just check stat signature (do not read the files).
               defaults to True.

    Return value:

    True if the files are the same, False otherwise.

    This function uses a cache for past comparisons and the results,
    with cache entries invalidated if their stat information
    changes.  The cache may be cleared by calling clear_cache().

    """

    s1 = _sig(os.stat(f1))
    s2 = _sig(os.stat(f2))
    if s1[0] != stat.S_IFREG or s2[0] != stat.S_IFREG:
        return False
    if shallow and s1 == s2:
        return True
    if s1[1] != s2[1]:
        return False

    outcome = _cache.get((f1, f2, s1, s2))
    if outcome is None:
        outcome = _do_cmp(f1, f2)
        if len(_cache) > 100:      # limit the maximum size of the cache
            clear_cache()
        _cache[f1, f2, s1, s2] = outcome
    return outcome

def _sig(st):
    return (stat.S_IFMT(st.st_mode),
            st.st_size,
            st.st_mtime)

def _do_cmp(f1, f2):
    bufsize = BUFSIZE
    with open(f1, 'rb') as fp1, open(f2, 'rb') as fp2:
        while True:
            b1 = fp1.read(bufsize)
            b2 = fp2.read(bufsize)
            if b1 != b2:
                return False
            if not b1:
                return True

# Directory comparison class.
#
class dircmp:
    """A class that manages the comparison of 2 directories.

    dircmp(a, b, ignore=None, hide=None)
      A and B are directories.
      IGNORE is a list of names to ignore,
        defaults to DEFAULT_IGNORES.
      HIDE is a list of names to hide,
        defaults to [os.curdir, os.pardir].

    High level usage:
      x = dircmp(dir1, dir2)
      x.report() -> prints a report on the differences between dir1 and dir2
       or
      x.report_partial_closure() -> prints report on differences between dir1
            and dir2, and reports on common immediate subdirectories.
      x.report_full_closure() -> like report_partial_closure,
            but fully recursive.

    Attributes:
     left_list, right_list: The files in dir1 and dir2,
        filtered by hide and ignore.
     common: a list of names in both dir1 and dir2.
     left_only, right_only: names only in dir1, dir2.
     common_dirs: subdirectories in both dir1 and dir2.
     common_files: files in both dir1 and dir2.
     common_funny: names in both dir1 and dir2 where the type differs between
        dir1 and dir2, or the name is not stat-able.
     same_files: list of identical files.
     diff_files: list of filenames which differ.
     funny_files: list of files which could not be compared.
     subdirs: a dictionary of dircmp objects, keyed by names in common_dirs.
     """

    def __init__(self, a, b, ignore=None, hide=None): # Initialize
        self.left = a
        self.right = b
        if hide is None:
            self.hide = [os.curdir, os.pardir] # Names never to be shown
        else:
            self.hide = hide
        if ignore is None:
            self.ignore = DEFAULT_IGNORES
        else:
            self.ignore = ignore

    def phase0(self): # Compare everything except common subdirectories
        self.left_list = _filter(os.listdir(self.left),
                                 self.hide+self.ignore)
        self.right_list = _filter(os.listdir(self.right),
                                  self.hide+self.ignore)
        self.left_list.sort()
        self.right_list.sort()

    def phase1(self): # Compute common names
        a = dict(zip(map(os.path.normcase, self.left_list), self.left_list))
        b = dict(zip(map(os.path.normcase, self.right_list), self.right_list))
        self.common = list(map(a.__getitem__, filter(b.__contains__, a)))
        self.left_only = list(map(a.__getitem__, filterfalse(b.__contains__, a)))
        self.right_only = list(map(b.__getitem__, filterfalse(a.__contains__, b)))

    def phase2(self): # Distinguish files, directories, funnies
        self.common_dirs = []
        self.common_files = []
        self.common_funny = []

        for x in self.common:
            a_path = os.path.join(self.left, x)
            b_path = os.path.join(self.right, x)

            ok = 1
            try:
                a_stat = os.stat(a_path)
            except OSError as why:
                # print('Can\'t stat', a_path, ':', why.args[1])
                ok = 0
            try:
                b_stat = os.stat(b_path)
            except OSError as why:
                # print('Can\'t stat', b_path, ':', why.args[1])
                ok = 0

            if ok:
                a_type = stat.S_IFMT(a_stat.st_mode)
                b_type = stat.S_IFMT(b_stat.st_mode)
                if a_type != b_type:
                    self.common_funny.append(x)
                elif stat.S_ISDIR(a_type):
                    self.common_dirs.append(x)
                elif stat.S_ISREG(a_type):
                    self.common_files.append(x)
                else:
                    self.common_funny.append(x)
            else:
                self.common_funny.append(x)

    def phase3(self): # Find out differences between common files
        xx = cmpfiles(self.left, self.right, self.common_files)
        self.same_files, self.diff_files, self.funny_files = xx

    def phase4(self): # Find out differences between common subdirectories
        # A new dircmp object is created for each common subdirectory,
        # these are stored in a dictionary indexed by filename.
        # The hide and ignore properties are inherited from the parent
        self.subdirs = {}
        for x in self.common_dirs:
            a_x = os.path.join(self.left, x)
            b_x = os.path.join(self.right, x)
            self.subdirs[x]  = dircmp(a_x, b_x, self.ignore, self.hide)

    def phase4_closure(self): # Recursively call phase4() on subdirectories
        self.phase4()
        for sd in self.subdirs.values():
            sd.phase4_closure()

    def report(self): # Print a report on the differences between a and b
        # Output format is purposely lousy
        print('diff', self.left, self.right)
        if self.left_only:
            self.left_only.sort()
            print('Only in', self.left, ':', self.left_only)
        if self.right_only:
            self.right_only.sort()
            print('Only in', self.right, ':', self.right_only)
        if self.same_files:
            self.same_files.sort()
            print('Identical files :', self.same_files)
        if self.diff_files:
            self.diff_files.sort()
            print('Differing files :', self.diff_files)
        if self.funny_files:
            self.funny_files.sort()
            print('Trouble with common files :', self.funny_files)
        if self.common_dirs:
            self.common_dirs.sort()
            print('Common subdirectories :', self.common_dirs)
        if self.common_funny:
            self.common_funny.sort()
            print('Common funny cases :', self.common_funny)

    def report_partial_closure(self): # Print reports on self and on subdirs
        self.report()
        for sd in self.subdirs.values():
            print()
            sd.report()

    def report_full_closure(self): # Report on self and subdirs recursively
        self.report()
        for sd in self.subdirs.values():
            print()
            sd.report_full_closure()

    methodmap = dict(subdirs=phase4,
                     same_files=phase3, diff_files=phase3, funny_files=phase3,
                     common_dirs = phase2, common_files=phase2, common_funny=phase2,
                     common=phase1, left_only=phase1, right_only=phase1,
                     left_list=phase0, right_list=phase0)

    def __getattr__(self, attr):
        if attr not in self.methodmap:
            raise AttributeError(attr)
        self.methodmap[attr](self)
        return getattr(self, attr)

def cmpfiles(a, b, common, shallow=True):
    """Compare common files in two directories.

    a, b -- directory names
    common -- list of file names found in both directories
    shallow -- if true, do comparison based solely on stat() information

    Returns a tuple of three lists:
      files that compare equal
      files that are different
      filenames that aren't regular files.

    """
    res = ([], [], [])
    for x in common:
        ax = os.path.join(a, x)
        bx = os.path.join(b, x)
        res[_cmp(ax, bx, shallow)].append(x)
    return res


# Compare two files.
# Return:
#       0 for equal
#       1 for different
#       2 for funny cases (can't stat, etc.)
#
def _cmp(a, b, sh, abs=abs, cmp=cmp):
    try:
        return not abs(cmp(a, b, sh))
    except OSError:
        return 2


# Return a copy with items that occur in skip removed.
#
def _filter(flist, skip):
    return list(filterfalse(skip.__contains__, flist))


# Demonstration and testing.
#
def demo():
    import sys
    import getopt
    options, args = getopt.getopt(sys.argv[1:], 'r')
    if len(args) != 2:
        raise getopt.GetoptError('need exactly two args', None)
    dd = dircmp(args[0], args[1])
    if ('-r', '') in options:
        dd.report_full_closure()
    else:
        dd.report()

if __name__ == '__main__':
    demo()
curses/__init__.py000064400000007330151153537470010177 0ustar00"""curses

The main package for curses support for Python.  Normally used by importing
the package, and perhaps a particular module inside it.

   import curses
   from curses import textpad
   curses.initscr()
   ...

"""

from _curses import *
import os as _os
import sys as _sys

# Some constants, most notably the ACS_* ones, are only added to the C
# _curses module's dictionary after initscr() is called.  (Some
# versions of SGI's curses don't define values for those constants
# until initscr() has been called.)  This wrapper function calls the
# underlying C initscr(), and then copies the constants from the
# _curses module to the curses package's dictionary.  Don't do 'from
# curses import *' if you'll be needing the ACS_* constants.

def initscr():
    import _curses, curses
    # we call setupterm() here because it raises an error
    # instead of calling exit() in error cases.
    setupterm(term=_os.environ.get("TERM", "unknown"),
              fd=_sys.__stdout__.fileno())
    stdscr = _curses.initscr()
    for key, value in _curses.__dict__.items():
        if key[0:4] == 'ACS_' or key in ('LINES', 'COLS'):
            setattr(curses, key, value)

    return stdscr

# This is a similar wrapper for start_color(), which adds the COLORS and
# COLOR_PAIRS variables which are only available after start_color() is
# called.

def start_color():
    import _curses, curses
    retval = _curses.start_color()
    if hasattr(_curses, 'COLORS'):
        curses.COLORS = _curses.COLORS
    if hasattr(_curses, 'COLOR_PAIRS'):
        curses.COLOR_PAIRS = _curses.COLOR_PAIRS
    return retval

# Import Python has_key() implementation if _curses doesn't contain has_key()

try:
    has_key
except NameError:
    from .has_key import has_key

# Wrapper for the entire curses-based application.  Runs a function which
# should be the rest of your curses-based application.  If the application
# raises an exception, wrapper() will restore the terminal to a sane state so
# you can read the resulting traceback.

def wrapper(*args, **kwds):
    """Wrapper function that initializes curses and calls another function,
    restoring normal keyboard/screen behavior on error.
    The callable object 'func' is then passed the main window 'stdscr'
    as its first argument, followed by any other arguments passed to
    wrapper().
    """

    if args:
        func, *args = args
    elif 'func' in kwds:
        func = kwds.pop('func')
        import warnings
        warnings.warn("Passing 'func' as keyword argument is deprecated",
                      DeprecationWarning, stacklevel=2)
    else:
        raise TypeError('wrapper expected at least 1 positional argument, '
                        'got %d' % len(args))

    try:
        # Initialize curses
        stdscr = initscr()

        # Turn off echoing of keys, and enter cbreak mode,
        # where no buffering is performed on keyboard input
        noecho()
        cbreak()

        # In keypad mode, escape sequences for special keys
        # (like the cursor keys) will be interpreted and
        # a special value like curses.KEY_LEFT will be returned
        stdscr.keypad(1)

        # Start color, too.  Harmless if the terminal doesn't have
        # color; user can test with has_color() later on.  The try/catch
        # works around a minor bit of over-conscientiousness in the curses
        # module -- the error return from C start_color() is ignorable.
        try:
            start_color()
        except:
            pass

        return func(stdscr, *args, **kwds)
    finally:
        # Set everything back to normal
        if 'stdscr' in locals():
            stdscr.keypad(0)
            echo()
            nocbreak()
            endwin()
wrapper.__text_signature__ = '(func, /, *args, **kwds)'
curses/ascii.py000064400000004763151153537470007537 0ustar00"""Constants and membership tests for ASCII characters"""

NUL     = 0x00  # ^@
SOH     = 0x01  # ^A
STX     = 0x02  # ^B
ETX     = 0x03  # ^C
EOT     = 0x04  # ^D
ENQ     = 0x05  # ^E
ACK     = 0x06  # ^F
BEL     = 0x07  # ^G
BS      = 0x08  # ^H
TAB     = 0x09  # ^I
HT      = 0x09  # ^I
LF      = 0x0a  # ^J
NL      = 0x0a  # ^J
VT      = 0x0b  # ^K
FF      = 0x0c  # ^L
CR      = 0x0d  # ^M
SO      = 0x0e  # ^N
SI      = 0x0f  # ^O
DLE     = 0x10  # ^P
DC1     = 0x11  # ^Q
DC2     = 0x12  # ^R
DC3     = 0x13  # ^S
DC4     = 0x14  # ^T
NAK     = 0x15  # ^U
SYN     = 0x16  # ^V
ETB     = 0x17  # ^W
CAN     = 0x18  # ^X
EM      = 0x19  # ^Y
SUB     = 0x1a  # ^Z
ESC     = 0x1b  # ^[
FS      = 0x1c  # ^\
GS      = 0x1d  # ^]
RS      = 0x1e  # ^^
US      = 0x1f  # ^_
SP      = 0x20  # space
DEL     = 0x7f  # delete

controlnames = [
"NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL",
"BS",  "HT",  "LF",  "VT",  "FF",  "CR",  "SO",  "SI",
"DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB",
"CAN", "EM",  "SUB", "ESC", "FS",  "GS",  "RS",  "US",
"SP"
]

def _ctoi(c):
    if type(c) == type(""):
        return ord(c)
    else:
        return c

def isalnum(c): return isalpha(c) or isdigit(c)
def isalpha(c): return isupper(c) or islower(c)
def isascii(c): return 0 <= _ctoi(c) <= 127          # ?
def isblank(c): return _ctoi(c) in (9, 32)
def iscntrl(c): return 0 <= _ctoi(c) <= 31 or _ctoi(c) == 127
def isdigit(c): return 48 <= _ctoi(c) <= 57
def isgraph(c): return 33 <= _ctoi(c) <= 126
def islower(c): return 97 <= _ctoi(c) <= 122
def isprint(c): return 32 <= _ctoi(c) <= 126
def ispunct(c): return isgraph(c) and not isalnum(c)
def isspace(c): return _ctoi(c) in (9, 10, 11, 12, 13, 32)
def isupper(c): return 65 <= _ctoi(c) <= 90
def isxdigit(c): return isdigit(c) or \
    (65 <= _ctoi(c) <= 70) or (97 <= _ctoi(c) <= 102)
def isctrl(c): return 0 <= _ctoi(c) < 32
def ismeta(c): return _ctoi(c) > 127

def ascii(c):
    if type(c) == type(""):
        return chr(_ctoi(c) & 0x7f)
    else:
        return _ctoi(c) & 0x7f

def ctrl(c):
    if type(c) == type(""):
        return chr(_ctoi(c) & 0x1f)
    else:
        return _ctoi(c) & 0x1f

def alt(c):
    if type(c) == type(""):
        return chr(_ctoi(c) | 0x80)
    else:
        return _ctoi(c) | 0x80

def unctrl(c):
    bits = _ctoi(c)
    if bits == 0x7f:
        rep = "^?"
    elif isprint(bits & 0x7f):
        rep = chr(bits & 0x7f)
    else:
        rep = "^" + chr(((bits & 0x7f) | 0x20) + 0x20)
    if bits & 0x80:
        return "!" + rep
    return rep
curses/__pycache__/panel.cpython-38.opt-2.pyc000064400000000235151153537470014762 0ustar00U

e5dW�@sddlTdS)�)�*N)Z
_curses_panel�rr�$/usr/lib64/python3.8/curses/panel.py�<module>�curses/__pycache__/has_key.cpython-38.opt-2.pyc000064400000010715151153537470015312 0ustar00U

e5d�*@sddlZejdejdejdejdejdejdejdejd	ej	d
ej
dejdejd
ej
dejdejdejdejdejdejdejdejdejdejdejdejdejdejdejdejdejdejd ej d!ej!d"ej"d#ej#d$ej$d%ej%d&ej&d'ej'd(ej(d)ej)d*ej*d+ej+d,ej,d-ej-d.ej.d/ej/d0ej0d1ej1d2ej2d3ej3d4ej4d5ej5d6ej6d7ej7d8ej8d9ej9d:ej:d;ej;d<ej<d=ej=d>ej>d?ej?d@ej@dAejAdBejBdCejCdDejDdEejEdFejFdGejGdHejHdIejIdJejJdKejKdLejLdMejMdNejNdOejOdPejPdQejQdRejRdSejSdTejTdUejUdVejVdWejWdXejXdYejYdZejZd[ej[d\ej\d]ej]d^ej^d_ej_d`ej`daejadbejbdcejcddejddeejedfejfdgejgdhejhdiejidjejjdkejkdlejldmejmdnejndoejodpejpdqejqdrejrdsejsdtejtduejudvejvdwejwdxejxdyejydzejzd{ej{d|ej|d}ej}d~ej~dejd�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�i�Z�d�d��Z�e�d�k�rzVgZ�e���e����D]<Z�e��e��Z�e�e��Z�e�e�k�r�e���d�e��e��e�e�f��q�W5e���e�D]Z�e�e���qXdS)��NZka1Zka3Zkb2ZkbsZkbegZkcbtZkc1Zkc3ZkcanZktbcZkclrZkcloZkcmdZkcpyZkcrtZkctabZkdch1Zkdl1Zkcud1ZkrmirZkendZkentZkelZkedZkextZkf0Zkf1Zkf10Zkf11Zkf12Zkf13Zkf14Zkf15Zkf16Zkf17Zkf18Zkf19Zkf2Zkf20Zkf21Zkf22Zkf23Zkf24Zkf25Zkf26Zkf27Zkf28Zkf29Zkf3Zkf30Zkf31Zkf32Zkf33Zkf34Zkf35Zkf36Zkf37Zkf38Zkf39Zkf4Zkf40Zkf41Zkf42Zkf43Zkf44Zkf45Zkf46Zkf47Zkf48Zkf49Zkf5Zkf50Zkf51Zkf52Zkf53Zkf54Zkf55Zkf56Zkf57Zkf58Zkf59Zkf6Zkf60Zkf61Zkf62Zkf63Zkf7Zkf8Zkf9ZkfndZkhlpZkhomeZkich1Zkil1Zkcub1ZkllZkmrkZkmsgZkmovZknxtZknpZkopnZkoptZkppZkprvZkprtZkrdoZkrefZkrfrZkrplZkrstZkresZkcuf1ZksavZkBEGZkCANZkCMDZkCPYZkCRTZkDCZkDLZksltZkENDZkEOLZkEXTZkindZkFNDZkHLPZkHOMZkICZkLFTZkMSGZkMOVZkNXTZkOPTZkPRVZkPRTZkriZkRDOZkRPLZkRITZkRESZkSAVZkSPDZkhtsZkUNDZkspdZkundZkcuu1cCs>t|t�rt|�}t�|�}|dkr(dSt�|�r6dSdSdS)NFT)�
isinstance�str�ord�_capability_names�get�_cursesZtigetstr)ZchZcapability_name�r�&/usr/lib64/python3.8/curses/has_key.py�has_key�s


r
�__main__z)Mismatch for key %s, system=%i, Python=%i)�rZKEY_A1ZKEY_A3ZKEY_B2Z
KEY_BACKSPACEZKEY_BEGZKEY_BTABZKEY_C1ZKEY_C3Z
KEY_CANCELZ	KEY_CATABZ	KEY_CLEARZ	KEY_CLOSEZKEY_COMMANDZKEY_COPYZ
KEY_CREATEZKEY_CTABZKEY_DCZKEY_DLZKEY_DOWNZKEY_EICZKEY_ENDZ	KEY_ENTERZKEY_EOLZKEY_EOSZKEY_EXITZKEY_F0ZKEY_F1ZKEY_F10ZKEY_F11ZKEY_F12ZKEY_F13ZKEY_F14ZKEY_F15ZKEY_F16ZKEY_F17ZKEY_F18ZKEY_F19ZKEY_F2ZKEY_F20ZKEY_F21ZKEY_F22ZKEY_F23ZKEY_F24ZKEY_F25ZKEY_F26ZKEY_F27ZKEY_F28ZKEY_F29ZKEY_F3ZKEY_F30ZKEY_F31ZKEY_F32ZKEY_F33ZKEY_F34ZKEY_F35ZKEY_F36ZKEY_F37ZKEY_F38ZKEY_F39ZKEY_F4ZKEY_F40ZKEY_F41ZKEY_F42ZKEY_F43ZKEY_F44ZKEY_F45ZKEY_F46ZKEY_F47ZKEY_F48ZKEY_F49ZKEY_F5ZKEY_F50ZKEY_F51ZKEY_F52ZKEY_F53ZKEY_F54ZKEY_F55ZKEY_F56ZKEY_F57ZKEY_F58ZKEY_F59ZKEY_F6ZKEY_F60ZKEY_F61ZKEY_F62ZKEY_F63ZKEY_F7ZKEY_F8ZKEY_F9ZKEY_FINDZKEY_HELPZKEY_HOMEZKEY_ICZKEY_ILZKEY_LEFTZKEY_LLZKEY_MARKZKEY_MESSAGEZKEY_MOVEZKEY_NEXTZ	KEY_NPAGEZKEY_OPENZKEY_OPTIONSZ	KEY_PPAGEZKEY_PREVIOUSZ	KEY_PRINTZKEY_REDOZ
KEY_REFERENCEZKEY_REFRESHZKEY_REPLACEZKEY_RESTARTZ
KEY_RESUMEZ	KEY_RIGHTZKEY_SAVEZKEY_SBEGZKEY_SCANCELZKEY_SCOMMANDZ	KEY_SCOPYZKEY_SCREATEZKEY_SDCZKEY_SDLZ
KEY_SELECTZKEY_SENDZKEY_SEOLZ	KEY_SEXITZKEY_SFZ	KEY_SFINDZ	KEY_SHELPZ	KEY_SHOMEZKEY_SICZ	KEY_SLEFTZKEY_SMESSAGEZ	KEY_SMOVEZ	KEY_SNEXTZKEY_SOPTIONSZ
KEY_SPREVIOUSZ
KEY_SPRINTZKEY_SRZ	KEY_SREDOZKEY_SREPLACEZ
KEY_SRIGHTZ
KEY_SRSUMEZ	KEY_SSAVEZKEY_SSUSPENDZKEY_STABZ	KEY_SUNDOZKEY_SUSPENDZKEY_UNDOZKEY_UPrr
�__name__Zendwin�L�i�printZinitscr�keys�key�system�python�appendZkeynamerrrr	�<module>sx��


�curses/__pycache__/has_key.cpython-38.pyc000064400000010715151153537470014352 0ustar00U

e5d�*@sddlZejdejdejdejdejdejdejdejd	ej	d
ej
dejdejd
ej
dejdejdejdejdejdejdejdejdejdejdejdejdejdejdejdejdejdejd ej d!ej!d"ej"d#ej#d$ej$d%ej%d&ej&d'ej'd(ej(d)ej)d*ej*d+ej+d,ej,d-ej-d.ej.d/ej/d0ej0d1ej1d2ej2d3ej3d4ej4d5ej5d6ej6d7ej7d8ej8d9ej9d:ej:d;ej;d<ej<d=ej=d>ej>d?ej?d@ej@dAejAdBejBdCejCdDejDdEejEdFejFdGejGdHejHdIejIdJejJdKejKdLejLdMejMdNejNdOejOdPejPdQejQdRejRdSejSdTejTdUejUdVejVdWejWdXejXdYejYdZejZd[ej[d\ej\d]ej]d^ej^d_ej_d`ej`daejadbejbdcejcddejddeejedfejfdgejgdhejhdiejidjejjdkejkdlejldmejmdnejndoejodpejpdqejqdrejrdsejsdtejtduejudvejvdwejwdxejxdyejydzejzd{ej{d|ej|d}ej}d~ej~dejd�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�i�Z�d�d��Z�e�d�k�rzVgZ�e���e����D]<Z�e��e��Z�e�e��Z�e�e�k�r�e���d�e��e��e�e�f��q�W5e���e�D]Z�e�e���qXdS)��NZka1Zka3Zkb2ZkbsZkbegZkcbtZkc1Zkc3ZkcanZktbcZkclrZkcloZkcmdZkcpyZkcrtZkctabZkdch1Zkdl1Zkcud1ZkrmirZkendZkentZkelZkedZkextZkf0Zkf1Zkf10Zkf11Zkf12Zkf13Zkf14Zkf15Zkf16Zkf17Zkf18Zkf19Zkf2Zkf20Zkf21Zkf22Zkf23Zkf24Zkf25Zkf26Zkf27Zkf28Zkf29Zkf3Zkf30Zkf31Zkf32Zkf33Zkf34Zkf35Zkf36Zkf37Zkf38Zkf39Zkf4Zkf40Zkf41Zkf42Zkf43Zkf44Zkf45Zkf46Zkf47Zkf48Zkf49Zkf5Zkf50Zkf51Zkf52Zkf53Zkf54Zkf55Zkf56Zkf57Zkf58Zkf59Zkf6Zkf60Zkf61Zkf62Zkf63Zkf7Zkf8Zkf9ZkfndZkhlpZkhomeZkich1Zkil1Zkcub1ZkllZkmrkZkmsgZkmovZknxtZknpZkopnZkoptZkppZkprvZkprtZkrdoZkrefZkrfrZkrplZkrstZkresZkcuf1ZksavZkBEGZkCANZkCMDZkCPYZkCRTZkDCZkDLZksltZkENDZkEOLZkEXTZkindZkFNDZkHLPZkHOMZkICZkLFTZkMSGZkMOVZkNXTZkOPTZkPRVZkPRTZkriZkRDOZkRPLZkRITZkRESZkSAVZkSPDZkhtsZkUNDZkspdZkundZkcuu1cCs>t|t�rt|�}t�|�}|dkr(dSt�|�r6dSdSdS)NFT)�
isinstance�str�ord�_capability_names�get�_cursesZtigetstr)ZchZcapability_name�r�&/usr/lib64/python3.8/curses/has_key.py�has_key�s


r
�__main__z)Mismatch for key %s, system=%i, Python=%i)�rZKEY_A1ZKEY_A3ZKEY_B2Z
KEY_BACKSPACEZKEY_BEGZKEY_BTABZKEY_C1ZKEY_C3Z
KEY_CANCELZ	KEY_CATABZ	KEY_CLEARZ	KEY_CLOSEZKEY_COMMANDZKEY_COPYZ
KEY_CREATEZKEY_CTABZKEY_DCZKEY_DLZKEY_DOWNZKEY_EICZKEY_ENDZ	KEY_ENTERZKEY_EOLZKEY_EOSZKEY_EXITZKEY_F0ZKEY_F1ZKEY_F10ZKEY_F11ZKEY_F12ZKEY_F13ZKEY_F14ZKEY_F15ZKEY_F16ZKEY_F17ZKEY_F18ZKEY_F19ZKEY_F2ZKEY_F20ZKEY_F21ZKEY_F22ZKEY_F23ZKEY_F24ZKEY_F25ZKEY_F26ZKEY_F27ZKEY_F28ZKEY_F29ZKEY_F3ZKEY_F30ZKEY_F31ZKEY_F32ZKEY_F33ZKEY_F34ZKEY_F35ZKEY_F36ZKEY_F37ZKEY_F38ZKEY_F39ZKEY_F4ZKEY_F40ZKEY_F41ZKEY_F42ZKEY_F43ZKEY_F44ZKEY_F45ZKEY_F46ZKEY_F47ZKEY_F48ZKEY_F49ZKEY_F5ZKEY_F50ZKEY_F51ZKEY_F52ZKEY_F53ZKEY_F54ZKEY_F55ZKEY_F56ZKEY_F57ZKEY_F58ZKEY_F59ZKEY_F6ZKEY_F60ZKEY_F61ZKEY_F62ZKEY_F63ZKEY_F7ZKEY_F8ZKEY_F9ZKEY_FINDZKEY_HELPZKEY_HOMEZKEY_ICZKEY_ILZKEY_LEFTZKEY_LLZKEY_MARKZKEY_MESSAGEZKEY_MOVEZKEY_NEXTZ	KEY_NPAGEZKEY_OPENZKEY_OPTIONSZ	KEY_PPAGEZKEY_PREVIOUSZ	KEY_PRINTZKEY_REDOZ
KEY_REFERENCEZKEY_REFRESHZKEY_REPLACEZKEY_RESTARTZ
KEY_RESUMEZ	KEY_RIGHTZKEY_SAVEZKEY_SBEGZKEY_SCANCELZKEY_SCOMMANDZ	KEY_SCOPYZKEY_SCREATEZKEY_SDCZKEY_SDLZ
KEY_SELECTZKEY_SENDZKEY_SEOLZ	KEY_SEXITZKEY_SFZ	KEY_SFINDZ	KEY_SHELPZ	KEY_SHOMEZKEY_SICZ	KEY_SLEFTZKEY_SMESSAGEZ	KEY_SMOVEZ	KEY_SNEXTZKEY_SOPTIONSZ
KEY_SPREVIOUSZ
KEY_SPRINTZKEY_SRZ	KEY_SREDOZKEY_SREPLACEZ
KEY_SRIGHTZ
KEY_SRSUMEZ	KEY_SSAVEZKEY_SSUSPENDZKEY_STABZ	KEY_SUNDOZKEY_SUSPENDZKEY_UNDOZKEY_UPrr
�__name__Zendwin�L�i�printZinitscr�keys�key�system�python�appendZkeynamerrrr	�<module>sx��


�curses/__pycache__/__init__.cpython-38.opt-1.pyc000064400000004136151153537470015425 0ustar00U

e5d��@shdZddlTddlZddlZdd�Zdd�ZzeWn e	k
rTdd	lmZYnXd
d�Z
de
_dS)
z�curses

The main package for curses support for Python.  Normally used by importing
the package, and perhaps a particular module inside it.

   import curses
   from curses import textpad
   curses.initscr()
   ...

�)�*NcCspddl}ddl}ttj�dd�tj��d�|�	�}|j
��D],\}}|dd�dks^|dkr>t|||�q>|S)NrZTERM�unknown)Zterm�fd�ZACS_)ZLINESZCOLS)
�_curses�cursesZ	setupterm�_os�environ�get�_sys�
__stdout__�fileno�initscr�__dict__�items�setattr)rr�stdscr�key�value�r�'/usr/lib64/python3.8/curses/__init__.pyrs�rcCs@ddl}ddl}|��}t|d�r*|j|_t|d�r<|j|_|S)Nr�COLORS�COLOR_PAIRS)rr�start_color�hasattrrr)rrZretvalrrrr*s

r�)�has_keyc	Os�|r|^}}n<d|kr:|�d�}ddl}|jdtdd�ntdt|���zHt�}t�t
�|�d	�z
t�WnYnX||f|�|�W�Sdt�kr�|�d�t�t	�t
�XdS)
aWrapper function that initializes curses and calls another function,
    restoring normal keyboard/screen behavior on error.
    The callable object 'func' is then passed the main window 'stdscr'
    as its first argument, followed by any other arguments passed to
    wrapper().
    �funcrNz0Passing 'func' as keyword argument is deprecated�)�
stacklevelz7wrapper expected at least 1 positional argument, got %drr)�pop�warnings�warn�DeprecationWarning�	TypeError�len�localsZkeypadZechoZnocbreakZendwinrZnoechoZcbreakr)�args�kwdsrr!rrrr�wrapper?s6

��



r)z(func, /, *args, **kwds))�__doc__r�osr�sysrrrr�	NameErrorr)�__text_signature__rrrr�<module>s
2curses/__pycache__/ascii.cpython-38.pyc000064400000007567151153537470014032 0ustar00U

e5d�	�!@s~dZdZdZdZdZdZdZdZdZd	Z	d
Z
d
ZdZdZ
dZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#d"Z$d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCg!Z%dDdE�Z&dFdG�Z'dHdI�Z(dJdK�Z)dLdM�Z*dNdO�Z+dPdQ�Z,dRdS�Z-dTdU�Z.dVdW�Z/dXdY�Z0dZd[�Z1d\d]�Z2d^d_�Z3d`da�Z4dbdc�Z5ddde�Z6dfdg�Z7dhdi�Z8djdk�Z9dlS)mz3Constants and membership tests for ASCII characters����������	�
���
������������������� ��NUL�SOH�STX�ETX�EOT�ENQ�ACK�BEL�BS�HT�LF�VT�FF�CR�SO�SI�DLE�DC1�DC2�DC3�DC4�NAK�SYN�ETB�CAN�EM�SUB�ESC�FS�GS�RS�US�SPcCs t|�td�krt|�S|SdS)N�)�type�ord��c�rI�$/usr/lib64/python3.8/curses/ascii.py�_ctoi0srKcCst|�pt|�S�N)�isalpha�isdigitrGrIrIrJ�isalnum6�rOcCst|�pt|�SrL)�isupper�islowerrGrIrIrJrM7rPrMcCsdt|�kodkSS)Nrr"�rKrGrIrIrJ�isascii8rPrTcCst|�dkS)N)r
r!rSrGrIrIrJ�isblank9rPrUcCs(dt|�kodknp&t|�dkS)Nrr r"rSrGrIrIrJ�iscntrl:rPrVcCsdt|�kodkSS)N�0�9rSrGrIrIrJrN;rPrNcCsdt|�kodkSS)N�!�~rSrGrIrIrJ�isgraph<rPr[cCsdt|�kodkSS)N�a�zrSrGrIrIrJrR=rPrRcCsdt|�kodkSS)Nr!rZrSrGrIrIrJ�isprint>rPr^cCst|�ot|�SrL)r[rOrGrIrIrJ�ispunct?rPr_cCst|�dkS)N)r
rrr
rr!rSrGrIrIrJ�isspace@rPr`cCsdt|�kodkSS)N�A�ZrSrGrIrIrJrQArPrQcCs@t|�p>dt|�kodknp>dt|�ko:dkSS)Nra�Fr\�f)rNrKrGrIrIrJ�isxdigitBs��recCsdt|�kodkSS)Nrr!rSrGrIrIrJ�isctrlDrPrfcCst|�dkS)Nr"rSrGrIrIrJ�ismetaErPrgcCs0t|�td�kr tt|�d@�St|�d@SdS)NrDr"�rE�chrrKrGrIrIrJ�asciiGsrjcCs0t|�td�kr tt|�d@�St|�d@SdS)NrDr rhrGrIrIrJ�ctrlMsrkcCs0t|�td�kr tt|�dB�St|�dBSdS)NrD�rhrGrIrIrJ�altSsrmcCs\t|�}|dkrd}n2t|d@�r0t|d@�}ndt|d@dBd�}|d@rXd|S|S)Nr"z^?�^r!rl�!)rKr^ri)rH�bitsZreprIrIrJ�unctrlYsrqN):�__doc__r#r$r%r&r'r(r)r*r+ZTABr,r-�NLr.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCZDELZcontrolnamesrKrOrMrTrUrVrNr[rRr^r_r`rQrerfrgrjrkrmrqrIrIrIrJ�<module>s��curses/__pycache__/textpad.cpython-38.pyc000064400000013425151153537470014401 0ustar00U

e5d��@sVdZddlZddlZdd�ZGdd�d�ZedkrRdd	�Ze�e�Ze	d
e
e��dS)z:Simple textbox editing widget with Emacs-like keybindings.�NcCs�|�|d|tj||d�|�||dtj||d�|�||dtj||d�|�|d|tj||d�|�||tj�|�||tj�|�||tj�|�||tj	�dS)z^Draw a rectangle with corners at the provided upper-left
    and lower-right coordinates.
    �N)
Zvline�cursesZ	ACS_VLINEZhlineZ	ACS_HLINE�addchZACS_ULCORNERZACS_URCORNERZACS_LRCORNERZACS_LLCORNER)�win�uly�ulxZlryZlrx�r�&/usr/lib64/python3.8/curses/textpad.py�	rectanglesr
c@sLeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	ddd�Z
dS)�TextboxadEditing widget using the interior of a window object.
     Supports the following Emacs-like key bindings:

    Ctrl-A      Go to left edge of window.
    Ctrl-B      Cursor left, wrapping to previous line if appropriate.
    Ctrl-D      Delete character under cursor.
    Ctrl-E      Go to right edge (stripspaces off) or end of line (stripspaces on).
    Ctrl-F      Cursor right, wrapping to next line when appropriate.
    Ctrl-G      Terminate, returning the window contents.
    Ctrl-H      Delete character backward.
    Ctrl-J      Terminate if the window is 1 line, otherwise insert newline.
    Ctrl-K      If line is blank, delete it, otherwise clear to end of line.
    Ctrl-L      Refresh screen.
    Ctrl-N      Cursor down; move down one line.
    Ctrl-O      Insert a blank line at cursor location.
    Ctrl-P      Cursor up; move up one line.

    Move operations do nothing if the cursor is at an edge where the movement
    is not possible.  The following synonyms are supported where possible:

    KEY_LEFT = Ctrl-B, KEY_RIGHT = Ctrl-F, KEY_UP = Ctrl-P, KEY_DOWN = Ctrl-N
    KEY_BACKSPACE = Ctrl-h
    FcCs.||_||_|��d|_d|_|�d�dS�Nr)r�insert_mode�_update_max_yx�stripspaces�lastcmdZkeypad)�selfrr
rrr	�__init__+szTextbox.__init__cCs&|j��\}}|d|_|d|_dSr)rZgetmaxyx�maxy�maxx)rrrrrr	r3s
zTextbox._update_max_yxcCsX|��|j}tj�|j�||��tjjkr@t|j|d�}qTn
|dkrJqT|d}q|S)zuGo to the location of the first blank on the given line,
        returning the index of the last non-blank character.rr)rrr�asciir�inchZSP�min)r�yZlastrrr	�_end_of_line8s
zTextbox._end_of_linecCs�|��|j��\}}d}||jks.||jkr�|jr>|j��}z|j�|�Wntj	k
rdYnX|jr�tj
�|�szq�|}|j��\}}|dkr||f}q|dk	r�|jj|�dS)N)
rr�getyxrrr
rrr�errorr�isprint�move)r�chr�xZbackyxZoldchrrr	�_insert_printable_charFs$

zTextbox._insert_printable_charcCsV|��|j��\}}||_tj�|�rJ||jks<||jkrF|�	|��n|tjj
krh|j�|d��n�|tjjtj
tjjtjfk�r|dkr�|j�||d�nB|dkr�n8|jr�|j�|d|�|d��n|j�|d|j�|tjjtjfk�rR|j���nL|tjjk�r"|j���n0|tjjk�rb|j�rN|j�||�|��n|j�||j��n�|tjjtjfk�r�||jk�r�|j�||d�n ||jk�r�n|j�|dd��n�|tjjk�r�dS|tjjk�r|jdk�r�dS||jk�rR|j�|dd��nF|tjjk�rZ|dk�r@|�|�dk�r@|j��n|j�||�|j��n�|tjjk�rt|j��n�|tjjtjfk�r�||jk�rR|j�|d|�||�|d�k�rR|j�|d|�|d��nz|tjj k�r�|j�!�n`|tjj"tj#fk�rR|dk�rR|j�|d|�||�|d�k�rR|j�|d|�|d��dS)z!Process a single editing command.rr)$rrrrrrrrrr ZSOHrZSTXZKEY_LEFTZBSZ
KEY_BACKSPACErrZdelchZEOTZENQZACKZ	KEY_RIGHTZBEL�NLZVTZdeletelnZclrtoeolZFF�refreshZSOZKEY_DOWNZSIZinsertlnZDLEZKEY_UP)rrrrrrr	�
do_command_sr
zTextbox.do_commandc
Cs�d}|��t|jd�D]�}|j�|d�|�|�}|dkrF|jrFqt|jd�D]4}|jrj||krjq�|tt	j
�
|j�||���}qT|jdkr|d}q|S)z.Collect and return the contents of the window.�rr�
)r�rangerrrrrr�chrrrr)r�resultr�stoprrrr	�gather�s
 

zTextbox.gatherNcCs<|j��}|r||�}|sq|�|�s(q4|j��q|��S)z2Edit in the widget window and collect the results.)rZgetchr#r"r*)rZvalidaterrrr	�edit�s

zTextbox.edit)F)N)�__name__�
__module__�__qualname__�__doc__rrrr r#r*r+rrrr	rs
Ar�__main__cCsfd\}}d\}}|�|d|d�t�||||�}t||d|d||||�|��t|���S)N)�	�)���zUse Ctrl-G to end editing.r)ZaddstrrZnewwinr
r"rr+)ZstdscrZncolsZnlinesrrrrrr	�test_editbox�s r6zContents of text box:)r/rZcurses.asciir
rr,r6�wrapper�str�print�reprrrrr	�<module>s
,	
curses/__pycache__/ascii.cpython-38.opt-1.pyc000064400000007567151153537470014771 0ustar00U

e5d�	�!@s~dZdZdZdZdZdZdZdZdZd	Z	d
Z
d
ZdZdZ
dZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#d"Z$d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCg!Z%dDdE�Z&dFdG�Z'dHdI�Z(dJdK�Z)dLdM�Z*dNdO�Z+dPdQ�Z,dRdS�Z-dTdU�Z.dVdW�Z/dXdY�Z0dZd[�Z1d\d]�Z2d^d_�Z3d`da�Z4dbdc�Z5ddde�Z6dfdg�Z7dhdi�Z8djdk�Z9dlS)mz3Constants and membership tests for ASCII characters����������	�
���
������������������� ��NUL�SOH�STX�ETX�EOT�ENQ�ACK�BEL�BS�HT�LF�VT�FF�CR�SO�SI�DLE�DC1�DC2�DC3�DC4�NAK�SYN�ETB�CAN�EM�SUB�ESC�FS�GS�RS�US�SPcCs t|�td�krt|�S|SdS)N�)�type�ord��c�rI�$/usr/lib64/python3.8/curses/ascii.py�_ctoi0srKcCst|�pt|�S�N)�isalpha�isdigitrGrIrIrJ�isalnum6�rOcCst|�pt|�SrL)�isupper�islowerrGrIrIrJrM7rPrMcCsdt|�kodkSS)Nrr"�rKrGrIrIrJ�isascii8rPrTcCst|�dkS)N)r
r!rSrGrIrIrJ�isblank9rPrUcCs(dt|�kodknp&t|�dkS)Nrr r"rSrGrIrIrJ�iscntrl:rPrVcCsdt|�kodkSS)N�0�9rSrGrIrIrJrN;rPrNcCsdt|�kodkSS)N�!�~rSrGrIrIrJ�isgraph<rPr[cCsdt|�kodkSS)N�a�zrSrGrIrIrJrR=rPrRcCsdt|�kodkSS)Nr!rZrSrGrIrIrJ�isprint>rPr^cCst|�ot|�SrL)r[rOrGrIrIrJ�ispunct?rPr_cCst|�dkS)N)r
rrr
rr!rSrGrIrIrJ�isspace@rPr`cCsdt|�kodkSS)N�A�ZrSrGrIrIrJrQArPrQcCs@t|�p>dt|�kodknp>dt|�ko:dkSS)Nra�Fr\�f)rNrKrGrIrIrJ�isxdigitBs��recCsdt|�kodkSS)Nrr!rSrGrIrIrJ�isctrlDrPrfcCst|�dkS)Nr"rSrGrIrIrJ�ismetaErPrgcCs0t|�td�kr tt|�d@�St|�d@SdS)NrDr"�rE�chrrKrGrIrIrJ�asciiGsrjcCs0t|�td�kr tt|�d@�St|�d@SdS)NrDr rhrGrIrIrJ�ctrlMsrkcCs0t|�td�kr tt|�dB�St|�dBSdS)NrD�rhrGrIrIrJ�altSsrmcCs\t|�}|dkrd}n2t|d@�r0t|d@�}ndt|d@dBd�}|d@rXd|S|S)Nr"z^?�^r!rl�!)rKr^ri)rH�bitsZreprIrIrJ�unctrlYsrqN):�__doc__r#r$r%r&r'r(r)r*r+ZTABr,r-�NLr.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCZDELZcontrolnamesrKrOrMrTrUrVrNr[rRr^r_r`rQrerfrgrjrkrmrqrIrIrIrJ�<module>s��curses/__pycache__/ascii.cpython-38.opt-2.pyc000064400000007463151153537470014765 0ustar00U

e5d�	�!@szdZdZdZdZdZdZdZdZdZd	Z	d	Z
d
Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBg!Z$dCdD�Z%dEdF�Z&dGdH�Z'dIdJ�Z(dKdL�Z)dMdN�Z*dOdP�Z+dQdR�Z,dSdT�Z-dUdV�Z.dWdX�Z/dYdZ�Z0d[d\�Z1d]d^�Z2d_d`�Z3dadb�Z4dcdd�Z5dedf�Z6dgdh�Z7didj�Z8dkS)l����������	�
���
������������������� ��NUL�SOH�STX�ETX�EOT�ENQ�ACK�BEL�BS�HT�LF�VT�FF�CR�SO�SI�DLE�DC1�DC2�DC3�DC4�NAK�SYN�ETB�CAN�EM�SUB�ESC�FS�GS�RS�US�SPcCs t|�td�krt|�S|SdS)N�)�type�ord��c�rI�$/usr/lib64/python3.8/curses/ascii.py�_ctoi0srKcCst|�pt|�S�N)�isalpha�isdigitrGrIrIrJ�isalnum6�rOcCst|�pt|�SrL)�isupper�islowerrGrIrIrJrM7rPrMcCsdt|�kodkSS)Nrr"�rKrGrIrIrJ�isascii8rPrTcCst|�dkS)N)r
r!rSrGrIrIrJ�isblank9rPrUcCs(dt|�kodknp&t|�dkS)Nrr r"rSrGrIrIrJ�iscntrl:rPrVcCsdt|�kodkSS)N�0�9rSrGrIrIrJrN;rPrNcCsdt|�kodkSS)N�!�~rSrGrIrIrJ�isgraph<rPr[cCsdt|�kodkSS)N�a�zrSrGrIrIrJrR=rPrRcCsdt|�kodkSS)Nr!rZrSrGrIrIrJ�isprint>rPr^cCst|�ot|�SrL)r[rOrGrIrIrJ�ispunct?rPr_cCst|�dkS)N)r
rrr
rr!rSrGrIrIrJ�isspace@rPr`cCsdt|�kodkSS)N�A�ZrSrGrIrIrJrQArPrQcCs@t|�p>dt|�kodknp>dt|�ko:dkSS)Nra�Fr\�f)rNrKrGrIrIrJ�isxdigitBs��recCsdt|�kodkSS)Nrr!rSrGrIrIrJ�isctrlDrPrfcCst|�dkS)Nr"rSrGrIrIrJ�ismetaErPrgcCs0t|�td�kr tt|�d@�St|�d@SdS)NrDr"�rE�chrrKrGrIrIrJ�asciiGsrjcCs0t|�td�kr tt|�d@�St|�d@SdS)NrDr rhrGrIrIrJ�ctrlMsrkcCs0t|�td�kr tt|�dB�St|�dBSdS)NrD�rhrGrIrIrJ�altSsrmcCs\t|�}|dkrd}n2t|d@�r0t|d@�}ndt|d@dBd�}|d@rXd|S|S)Nr"z^?�^r!rl�!)rKr^ri)rH�bitsZreprIrIrJ�unctrlYsrqN)9r#r$r%r&r'r(r)r*r+ZTABr,r-�NLr.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCZDELZcontrolnamesrKrOrMrTrUrVrNr[rRr^r_r`rQrerfrgrjrkrmrqrIrIrIrJ�<module>s��curses/__pycache__/textpad.cpython-38.opt-2.pyc000064400000010373151153537470015340 0ustar00U

e5d��@sRddlZddlZdd�ZGdd�d�ZedkrNdd�Ze�e�Zed	e	e��dS)
�NcCs�|�|d|tj||d�|�||dtj||d�|�||dtj||d�|�|d|tj||d�|�||tj�|�||tj�|�||tj�|�||tj	�dS�N�)
Zvline�cursesZ	ACS_VLINEZhlineZ	ACS_HLINE�addchZACS_ULCORNERZACS_URCORNERZACS_LRCORNERZACS_LLCORNER)�win�uly�ulxZlryZlrx�r	�&/usr/lib64/python3.8/curses/textpad.py�	rectanglesrc@sHeZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zddd�Z	dS)�TextboxFcCs.||_||_|��d|_d|_|�d�dSr)r�insert_mode�_update_max_yx�stripspaces�lastcmdZkeypad)�selfrr
r	r	r
�__init__+szTextbox.__init__cCs&|j��\}}|d|_|d|_dSr)rZgetmaxyx�maxy�maxx)rrrr	r	r
r3s
zTextbox._update_max_yxcCsX|��|j}tj�|j�||��tjjkr@t|j|d�}qTn
|dkrJqT|d}q|S)Nrr)rrr�asciir�inchZSP�min)r�yZlastr	r	r
�_end_of_line8s
zTextbox._end_of_linecCs�|��|j��\}}d}||jks.||jkr�|jr>|j��}z|j�|�Wntj	k
rdYnX|jr�tj
�|�szq�|}|j��\}}|dkr||f}q|dk	r�|jj|�dS�N)
rr�getyxrrr
rrr�errorr�isprint�move)r�chr�xZbackyxZoldchr	r	r
�_insert_printable_charFs$

zTextbox._insert_printable_charcCsV|��|j��\}}||_tj�|�rJ||jks<||jkrF|�	|��n|tjj
krh|j�|d��n�|tjjtj
tjjtjfk�r|dkr�|j�||d�nB|dkr�n8|jr�|j�|d|�|d��n|j�|d|j�|tjjtjfk�rR|j���nL|tjjk�r"|j���n0|tjjk�rb|j�rN|j�||�|��n|j�||j��n�|tjjtjfk�r�||jk�r�|j�||d�n ||jk�r�n|j�|dd��n�|tjjk�r�dS|tjjk�r|jdk�r�dS||jk�rR|j�|dd��nF|tjjk�rZ|dk�r@|�|�dk�r@|j��n|j�||�|j��n�|tjjk�rt|j��n�|tjjtjfk�r�||jk�rR|j�|d|�||�|d�k�rR|j�|d|�|d��nz|tjj k�r�|j�!�n`|tjj"tj#fk�rR|dk�rR|j�|d|�||�|d�k�rR|j�|d|�|d��dS)Nrr)$rrrrrrrrrr!ZSOHrZSTXZKEY_LEFTZBSZ
KEY_BACKSPACErrZdelchZEOTZENQZACKZ	KEY_RIGHTZBEL�NLZVTZdeletelnZclrtoeolZFF�refreshZSOZKEY_DOWNZSIZinsertlnZDLEZKEY_UP)rrrr r	r	r
�
do_command_sr
zTextbox.do_commandc
Cs�d}|��t|jd�D]�}|j�|d�|�|�}|dkrF|jrFqt|jd�D]4}|jrj||krjq�|tt	j
�
|j�||���}qT|jdkr|d}q|S)N�rr�
)r�rangerrrrrr�chrrrr)r�resultr�stopr r	r	r
�gather�s
 

zTextbox.gatherNcCs<|j��}|r||�}|sq|�|�s(q4|j��q|��Sr)rZgetchr$r#r+)rZvalidaterr	r	r
�edit�s

zTextbox.edit)F)N)
�__name__�
__module__�__qualname__rrrr!r$r+r,r	r	r	r
rs
Ar�__main__cCsfd\}}d\}}|�|d|d�t�||||�}t||d|d||||�|��t|���S)N)�	�)���zUse Ctrl-G to end editing.r)ZaddstrrZnewwinrr#rr,)ZstdscrZncolsZnlinesrrrr	r	r
�test_editbox�s r6zContents of text box:)
rZcurses.asciirrr-r6�wrapper�str�print�reprr	r	r	r
�<module>s
,	
curses/__pycache__/__init__.cpython-38.opt-2.pyc000064400000003124151153537470015422 0ustar00U

e5d��@sdddlTddlZddlZdd�Zdd�ZzeWn ek
rPddlmZYnXd	d
�Z	de	_
dS)�)�*NcCspddl}ddl}ttj�dd�tj��d�|�	�}|j
��D],\}}|dd�dks^|dkr>t|||�q>|S)NrZTERM�unknown)Zterm�fd�ZACS_)ZLINESZCOLS)
�_curses�cursesZ	setupterm�_os�environ�get�_sys�
__stdout__�fileno�initscr�__dict__�items�setattr)rr�stdscr�key�value�r�'/usr/lib64/python3.8/curses/__init__.pyrs�rcCs@ddl}ddl}|��}t|d�r*|j|_t|d�r<|j|_|S)Nr�COLORS�COLOR_PAIRS)rr�start_color�hasattrrr)rrZretvalrrrr*s

r�)�has_keyc	Os�|r|^}}n<d|kr:|�d�}ddl}|jdtdd�ntdt|���zHt�}t�t
�|�d�z
t�WnYnX||f|�|�W�Sdt�kr�|�d�t�t	�t
�XdS)	N�funcrz0Passing 'func' as keyword argument is deprecated�)�
stacklevelz7wrapper expected at least 1 positional argument, got %drr)�pop�warnings�warn�DeprecationWarning�	TypeError�len�localsZkeypadZechoZnocbreakZendwinrZnoechoZcbreakr)�args�kwdsrr!rrrr�wrapper?s6

��



r)z(func, /, *args, **kwds))r�osr�sysrrrr�	NameErrorr)�__text_signature__rrrr�<module>
s
2curses/__pycache__/panel.cpython-38.pyc000064400000000341151153537470014020 0ustar00U

e5dW�@sdZddlTdS)z3curses.panel

Module for using panels with curses.
�)�*N)�__doc__Z
_curses_panel�rr�$/usr/lib64/python3.8/curses/panel.py�<module>scurses/__pycache__/panel.cpython-38.opt-1.pyc000064400000000341151153537470014757 0ustar00U

e5dW�@sdZddlTdS)z3curses.panel

Module for using panels with curses.
�)�*N)�__doc__Z
_curses_panel�rr�$/usr/lib64/python3.8/curses/panel.py�<module>scurses/__pycache__/has_key.cpython-38.opt-1.pyc000064400000010715151153537470015311 0ustar00U

e5d�*@sddlZejdejdejdejdejdejdejdejd	ej	d
ej
dejdejd
ej
dejdejdejdejdejdejdejdejdejdejdejdejdejdejdejdejdejdejd ej d!ej!d"ej"d#ej#d$ej$d%ej%d&ej&d'ej'd(ej(d)ej)d*ej*d+ej+d,ej,d-ej-d.ej.d/ej/d0ej0d1ej1d2ej2d3ej3d4ej4d5ej5d6ej6d7ej7d8ej8d9ej9d:ej:d;ej;d<ej<d=ej=d>ej>d?ej?d@ej@dAejAdBejBdCejCdDejDdEejEdFejFdGejGdHejHdIejIdJejJdKejKdLejLdMejMdNejNdOejOdPejPdQejQdRejRdSejSdTejTdUejUdVejVdWejWdXejXdYejYdZejZd[ej[d\ej\d]ej]d^ej^d_ej_d`ej`daejadbejbdcejcddejddeejedfejfdgejgdhejhdiejidjejjdkejkdlejldmejmdnejndoejodpejpdqejqdrejrdsejsdtejtduejudvejvdwejwdxejxdyejydzejzd{ej{d|ej|d}ej}d~ej~dejd�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�ej�d�i�Z�d�d��Z�e�d�k�rzVgZ�e���e����D]<Z�e��e��Z�e�e��Z�e�e�k�r�e���d�e��e��e�e�f��q�W5e���e�D]Z�e�e���qXdS)��NZka1Zka3Zkb2ZkbsZkbegZkcbtZkc1Zkc3ZkcanZktbcZkclrZkcloZkcmdZkcpyZkcrtZkctabZkdch1Zkdl1Zkcud1ZkrmirZkendZkentZkelZkedZkextZkf0Zkf1Zkf10Zkf11Zkf12Zkf13Zkf14Zkf15Zkf16Zkf17Zkf18Zkf19Zkf2Zkf20Zkf21Zkf22Zkf23Zkf24Zkf25Zkf26Zkf27Zkf28Zkf29Zkf3Zkf30Zkf31Zkf32Zkf33Zkf34Zkf35Zkf36Zkf37Zkf38Zkf39Zkf4Zkf40Zkf41Zkf42Zkf43Zkf44Zkf45Zkf46Zkf47Zkf48Zkf49Zkf5Zkf50Zkf51Zkf52Zkf53Zkf54Zkf55Zkf56Zkf57Zkf58Zkf59Zkf6Zkf60Zkf61Zkf62Zkf63Zkf7Zkf8Zkf9ZkfndZkhlpZkhomeZkich1Zkil1Zkcub1ZkllZkmrkZkmsgZkmovZknxtZknpZkopnZkoptZkppZkprvZkprtZkrdoZkrefZkrfrZkrplZkrstZkresZkcuf1ZksavZkBEGZkCANZkCMDZkCPYZkCRTZkDCZkDLZksltZkENDZkEOLZkEXTZkindZkFNDZkHLPZkHOMZkICZkLFTZkMSGZkMOVZkNXTZkOPTZkPRVZkPRTZkriZkRDOZkRPLZkRITZkRESZkSAVZkSPDZkhtsZkUNDZkspdZkundZkcuu1cCs>t|t�rt|�}t�|�}|dkr(dSt�|�r6dSdSdS)NFT)�
isinstance�str�ord�_capability_names�get�_cursesZtigetstr)ZchZcapability_name�r�&/usr/lib64/python3.8/curses/has_key.py�has_key�s


r
�__main__z)Mismatch for key %s, system=%i, Python=%i)�rZKEY_A1ZKEY_A3ZKEY_B2Z
KEY_BACKSPACEZKEY_BEGZKEY_BTABZKEY_C1ZKEY_C3Z
KEY_CANCELZ	KEY_CATABZ	KEY_CLEARZ	KEY_CLOSEZKEY_COMMANDZKEY_COPYZ
KEY_CREATEZKEY_CTABZKEY_DCZKEY_DLZKEY_DOWNZKEY_EICZKEY_ENDZ	KEY_ENTERZKEY_EOLZKEY_EOSZKEY_EXITZKEY_F0ZKEY_F1ZKEY_F10ZKEY_F11ZKEY_F12ZKEY_F13ZKEY_F14ZKEY_F15ZKEY_F16ZKEY_F17ZKEY_F18ZKEY_F19ZKEY_F2ZKEY_F20ZKEY_F21ZKEY_F22ZKEY_F23ZKEY_F24ZKEY_F25ZKEY_F26ZKEY_F27ZKEY_F28ZKEY_F29ZKEY_F3ZKEY_F30ZKEY_F31ZKEY_F32ZKEY_F33ZKEY_F34ZKEY_F35ZKEY_F36ZKEY_F37ZKEY_F38ZKEY_F39ZKEY_F4ZKEY_F40ZKEY_F41ZKEY_F42ZKEY_F43ZKEY_F44ZKEY_F45ZKEY_F46ZKEY_F47ZKEY_F48ZKEY_F49ZKEY_F5ZKEY_F50ZKEY_F51ZKEY_F52ZKEY_F53ZKEY_F54ZKEY_F55ZKEY_F56ZKEY_F57ZKEY_F58ZKEY_F59ZKEY_F6ZKEY_F60ZKEY_F61ZKEY_F62ZKEY_F63ZKEY_F7ZKEY_F8ZKEY_F9ZKEY_FINDZKEY_HELPZKEY_HOMEZKEY_ICZKEY_ILZKEY_LEFTZKEY_LLZKEY_MARKZKEY_MESSAGEZKEY_MOVEZKEY_NEXTZ	KEY_NPAGEZKEY_OPENZKEY_OPTIONSZ	KEY_PPAGEZKEY_PREVIOUSZ	KEY_PRINTZKEY_REDOZ
KEY_REFERENCEZKEY_REFRESHZKEY_REPLACEZKEY_RESTARTZ
KEY_RESUMEZ	KEY_RIGHTZKEY_SAVEZKEY_SBEGZKEY_SCANCELZKEY_SCOMMANDZ	KEY_SCOPYZKEY_SCREATEZKEY_SDCZKEY_SDLZ
KEY_SELECTZKEY_SENDZKEY_SEOLZ	KEY_SEXITZKEY_SFZ	KEY_SFINDZ	KEY_SHELPZ	KEY_SHOMEZKEY_SICZ	KEY_SLEFTZKEY_SMESSAGEZ	KEY_SMOVEZ	KEY_SNEXTZKEY_SOPTIONSZ
KEY_SPREVIOUSZ
KEY_SPRINTZKEY_SRZ	KEY_SREDOZKEY_SREPLACEZ
KEY_SRIGHTZ
KEY_SRSUMEZ	KEY_SSAVEZKEY_SSUSPENDZKEY_STABZ	KEY_SUNDOZKEY_SUSPENDZKEY_UNDOZKEY_UPrr
�__name__Zendwin�L�i�printZinitscr�keys�key�system�python�appendZkeynamerrrr	�<module>sx��


�curses/__pycache__/textpad.cpython-38.opt-1.pyc000064400000013425151153537470015340 0ustar00U

e5d��@sVdZddlZddlZdd�ZGdd�d�ZedkrRdd	�Ze�e�Ze	d
e
e��dS)z:Simple textbox editing widget with Emacs-like keybindings.�NcCs�|�|d|tj||d�|�||dtj||d�|�||dtj||d�|�|d|tj||d�|�||tj�|�||tj�|�||tj�|�||tj	�dS)z^Draw a rectangle with corners at the provided upper-left
    and lower-right coordinates.
    �N)
Zvline�cursesZ	ACS_VLINEZhlineZ	ACS_HLINE�addchZACS_ULCORNERZACS_URCORNERZACS_LRCORNERZACS_LLCORNER)�win�uly�ulxZlryZlrx�r�&/usr/lib64/python3.8/curses/textpad.py�	rectanglesr
c@sLeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	ddd�Z
dS)�TextboxadEditing widget using the interior of a window object.
     Supports the following Emacs-like key bindings:

    Ctrl-A      Go to left edge of window.
    Ctrl-B      Cursor left, wrapping to previous line if appropriate.
    Ctrl-D      Delete character under cursor.
    Ctrl-E      Go to right edge (stripspaces off) or end of line (stripspaces on).
    Ctrl-F      Cursor right, wrapping to next line when appropriate.
    Ctrl-G      Terminate, returning the window contents.
    Ctrl-H      Delete character backward.
    Ctrl-J      Terminate if the window is 1 line, otherwise insert newline.
    Ctrl-K      If line is blank, delete it, otherwise clear to end of line.
    Ctrl-L      Refresh screen.
    Ctrl-N      Cursor down; move down one line.
    Ctrl-O      Insert a blank line at cursor location.
    Ctrl-P      Cursor up; move up one line.

    Move operations do nothing if the cursor is at an edge where the movement
    is not possible.  The following synonyms are supported where possible:

    KEY_LEFT = Ctrl-B, KEY_RIGHT = Ctrl-F, KEY_UP = Ctrl-P, KEY_DOWN = Ctrl-N
    KEY_BACKSPACE = Ctrl-h
    FcCs.||_||_|��d|_d|_|�d�dS�Nr)r�insert_mode�_update_max_yx�stripspaces�lastcmdZkeypad)�selfrr
rrr	�__init__+szTextbox.__init__cCs&|j��\}}|d|_|d|_dSr)rZgetmaxyx�maxy�maxx)rrrrrr	r3s
zTextbox._update_max_yxcCsX|��|j}tj�|j�||��tjjkr@t|j|d�}qTn
|dkrJqT|d}q|S)zuGo to the location of the first blank on the given line,
        returning the index of the last non-blank character.rr)rrr�asciir�inchZSP�min)r�yZlastrrr	�_end_of_line8s
zTextbox._end_of_linecCs�|��|j��\}}d}||jks.||jkr�|jr>|j��}z|j�|�Wntj	k
rdYnX|jr�tj
�|�szq�|}|j��\}}|dkr||f}q|dk	r�|jj|�dS)N)
rr�getyxrrr
rrr�errorr�isprint�move)r�chr�xZbackyxZoldchrrr	�_insert_printable_charFs$

zTextbox._insert_printable_charcCsV|��|j��\}}||_tj�|�rJ||jks<||jkrF|�	|��n|tjj
krh|j�|d��n�|tjjtj
tjjtjfk�r|dkr�|j�||d�nB|dkr�n8|jr�|j�|d|�|d��n|j�|d|j�|tjjtjfk�rR|j���nL|tjjk�r"|j���n0|tjjk�rb|j�rN|j�||�|��n|j�||j��n�|tjjtjfk�r�||jk�r�|j�||d�n ||jk�r�n|j�|dd��n�|tjjk�r�dS|tjjk�r|jdk�r�dS||jk�rR|j�|dd��nF|tjjk�rZ|dk�r@|�|�dk�r@|j��n|j�||�|j��n�|tjjk�rt|j��n�|tjjtjfk�r�||jk�rR|j�|d|�||�|d�k�rR|j�|d|�|d��nz|tjj k�r�|j�!�n`|tjj"tj#fk�rR|dk�rR|j�|d|�||�|d�k�rR|j�|d|�|d��dS)z!Process a single editing command.rr)$rrrrrrrrrr ZSOHrZSTXZKEY_LEFTZBSZ
KEY_BACKSPACErrZdelchZEOTZENQZACKZ	KEY_RIGHTZBEL�NLZVTZdeletelnZclrtoeolZFF�refreshZSOZKEY_DOWNZSIZinsertlnZDLEZKEY_UP)rrrrrrr	�
do_command_sr
zTextbox.do_commandc
Cs�d}|��t|jd�D]�}|j�|d�|�|�}|dkrF|jrFqt|jd�D]4}|jrj||krjq�|tt	j
�
|j�||���}qT|jdkr|d}q|S)z.Collect and return the contents of the window.�rr�
)r�rangerrrrrr�chrrrr)r�resultr�stoprrrr	�gather�s
 

zTextbox.gatherNcCs<|j��}|r||�}|sq|�|�s(q4|j��q|��S)z2Edit in the widget window and collect the results.)rZgetchr#r"r*)rZvalidaterrrr	�edit�s

zTextbox.edit)F)N)�__name__�
__module__�__qualname__�__doc__rrrr r#r*r+rrrr	rs
Ar�__main__cCsfd\}}d\}}|�|d|d�t�||||�}t||d|d||||�|��t|���S)N)�	�)���zUse Ctrl-G to end editing.r)ZaddstrrZnewwinr
r"rr+)ZstdscrZncolsZnlinesrrrrrr	�test_editbox�s r6zContents of text box:)r/rZcurses.asciir
rr,r6�wrapper�str�print�reprrrrr	�<module>s
,	
curses/__pycache__/__init__.cpython-38.pyc000064400000004136151153537470014466 0ustar00U

e5d��@shdZddlTddlZddlZdd�Zdd�ZzeWn e	k
rTdd	lmZYnXd
d�Z
de
_dS)
z�curses

The main package for curses support for Python.  Normally used by importing
the package, and perhaps a particular module inside it.

   import curses
   from curses import textpad
   curses.initscr()
   ...

�)�*NcCspddl}ddl}ttj�dd�tj��d�|�	�}|j
��D],\}}|dd�dks^|dkr>t|||�q>|S)NrZTERM�unknown)Zterm�fd�ZACS_)ZLINESZCOLS)
�_curses�cursesZ	setupterm�_os�environ�get�_sys�
__stdout__�fileno�initscr�__dict__�items�setattr)rr�stdscr�key�value�r�'/usr/lib64/python3.8/curses/__init__.pyrs�rcCs@ddl}ddl}|��}t|d�r*|j|_t|d�r<|j|_|S)Nr�COLORS�COLOR_PAIRS)rr�start_color�hasattrrr)rrZretvalrrrr*s

r�)�has_keyc	Os�|r|^}}n<d|kr:|�d�}ddl}|jdtdd�ntdt|���zHt�}t�t
�|�d	�z
t�WnYnX||f|�|�W�Sdt�kr�|�d�t�t	�t
�XdS)
aWrapper function that initializes curses and calls another function,
    restoring normal keyboard/screen behavior on error.
    The callable object 'func' is then passed the main window 'stdscr'
    as its first argument, followed by any other arguments passed to
    wrapper().
    �funcrNz0Passing 'func' as keyword argument is deprecated�)�
stacklevelz7wrapper expected at least 1 positional argument, got %drr)�pop�warnings�warn�DeprecationWarning�	TypeError�len�localsZkeypadZechoZnocbreakZendwinrZnoechoZcbreakr)�args�kwdsrr!rrrr�wrapper?s6

��



r)z(func, /, *args, **kwds))�__doc__r�osr�sysrrrr�	NameErrorr)�__text_signature__rrrr�<module>s
2curses/panel.py000064400000000127151153537470007534 0ustar00"""curses.panel

Module for using panels with curses.
"""

from _curses_panel import *
curses/textpad.py000064400000016751151153537470010120 0ustar00"""Simple textbox editing widget with Emacs-like keybindings."""

import curses
import curses.ascii

def rectangle(win, uly, ulx, lry, lrx):
    """Draw a rectangle with corners at the provided upper-left
    and lower-right coordinates.
    """
    win.vline(uly+1, ulx, curses.ACS_VLINE, lry - uly - 1)
    win.hline(uly, ulx+1, curses.ACS_HLINE, lrx - ulx - 1)
    win.hline(lry, ulx+1, curses.ACS_HLINE, lrx - ulx - 1)
    win.vline(uly+1, lrx, curses.ACS_VLINE, lry - uly - 1)
    win.addch(uly, ulx, curses.ACS_ULCORNER)
    win.addch(uly, lrx, curses.ACS_URCORNER)
    win.addch(lry, lrx, curses.ACS_LRCORNER)
    win.addch(lry, ulx, curses.ACS_LLCORNER)

class Textbox:
    """Editing widget using the interior of a window object.
     Supports the following Emacs-like key bindings:

    Ctrl-A      Go to left edge of window.
    Ctrl-B      Cursor left, wrapping to previous line if appropriate.
    Ctrl-D      Delete character under cursor.
    Ctrl-E      Go to right edge (stripspaces off) or end of line (stripspaces on).
    Ctrl-F      Cursor right, wrapping to next line when appropriate.
    Ctrl-G      Terminate, returning the window contents.
    Ctrl-H      Delete character backward.
    Ctrl-J      Terminate if the window is 1 line, otherwise insert newline.
    Ctrl-K      If line is blank, delete it, otherwise clear to end of line.
    Ctrl-L      Refresh screen.
    Ctrl-N      Cursor down; move down one line.
    Ctrl-O      Insert a blank line at cursor location.
    Ctrl-P      Cursor up; move up one line.

    Move operations do nothing if the cursor is at an edge where the movement
    is not possible.  The following synonyms are supported where possible:

    KEY_LEFT = Ctrl-B, KEY_RIGHT = Ctrl-F, KEY_UP = Ctrl-P, KEY_DOWN = Ctrl-N
    KEY_BACKSPACE = Ctrl-h
    """
    def __init__(self, win, insert_mode=False):
        self.win = win
        self.insert_mode = insert_mode
        self._update_max_yx()
        self.stripspaces = 1
        self.lastcmd = None
        win.keypad(1)

    def _update_max_yx(self):
        maxy, maxx = self.win.getmaxyx()
        self.maxy = maxy - 1
        self.maxx = maxx - 1

    def _end_of_line(self, y):
        """Go to the location of the first blank on the given line,
        returning the index of the last non-blank character."""
        self._update_max_yx()
        last = self.maxx
        while True:
            if curses.ascii.ascii(self.win.inch(y, last)) != curses.ascii.SP:
                last = min(self.maxx, last+1)
                break
            elif last == 0:
                break
            last = last - 1
        return last

    def _insert_printable_char(self, ch):
        self._update_max_yx()
        (y, x) = self.win.getyx()
        backyx = None
        while y < self.maxy or x < self.maxx:
            if self.insert_mode:
                oldch = self.win.inch()
            # The try-catch ignores the error we trigger from some curses
            # versions by trying to write into the lowest-rightmost spot
            # in the window.
            try:
                self.win.addch(ch)
            except curses.error:
                pass
            if not self.insert_mode or not curses.ascii.isprint(oldch):
                break
            ch = oldch
            (y, x) = self.win.getyx()
            # Remember where to put the cursor back since we are in insert_mode
            if backyx is None:
                backyx = y, x

        if backyx is not None:
            self.win.move(*backyx)

    def do_command(self, ch):
        "Process a single editing command."
        self._update_max_yx()
        (y, x) = self.win.getyx()
        self.lastcmd = ch
        if curses.ascii.isprint(ch):
            if y < self.maxy or x < self.maxx:
                self._insert_printable_char(ch)
        elif ch == curses.ascii.SOH:                           # ^a
            self.win.move(y, 0)
        elif ch in (curses.ascii.STX,curses.KEY_LEFT, curses.ascii.BS,curses.KEY_BACKSPACE):
            if x > 0:
                self.win.move(y, x-1)
            elif y == 0:
                pass
            elif self.stripspaces:
                self.win.move(y-1, self._end_of_line(y-1))
            else:
                self.win.move(y-1, self.maxx)
            if ch in (curses.ascii.BS, curses.KEY_BACKSPACE):
                self.win.delch()
        elif ch == curses.ascii.EOT:                           # ^d
            self.win.delch()
        elif ch == curses.ascii.ENQ:                           # ^e
            if self.stripspaces:
                self.win.move(y, self._end_of_line(y))
            else:
                self.win.move(y, self.maxx)
        elif ch in (curses.ascii.ACK, curses.KEY_RIGHT):       # ^f
            if x < self.maxx:
                self.win.move(y, x+1)
            elif y == self.maxy:
                pass
            else:
                self.win.move(y+1, 0)
        elif ch == curses.ascii.BEL:                           # ^g
            return 0
        elif ch == curses.ascii.NL:                            # ^j
            if self.maxy == 0:
                return 0
            elif y < self.maxy:
                self.win.move(y+1, 0)
        elif ch == curses.ascii.VT:                            # ^k
            if x == 0 and self._end_of_line(y) == 0:
                self.win.deleteln()
            else:
                # first undo the effect of self._end_of_line
                self.win.move(y, x)
                self.win.clrtoeol()
        elif ch == curses.ascii.FF:                            # ^l
            self.win.refresh()
        elif ch in (curses.ascii.SO, curses.KEY_DOWN):         # ^n
            if y < self.maxy:
                self.win.move(y+1, x)
                if x > self._end_of_line(y+1):
                    self.win.move(y+1, self._end_of_line(y+1))
        elif ch == curses.ascii.SI:                            # ^o
            self.win.insertln()
        elif ch in (curses.ascii.DLE, curses.KEY_UP):          # ^p
            if y > 0:
                self.win.move(y-1, x)
                if x > self._end_of_line(y-1):
                    self.win.move(y-1, self._end_of_line(y-1))
        return 1

    def gather(self):
        "Collect and return the contents of the window."
        result = ""
        self._update_max_yx()
        for y in range(self.maxy+1):
            self.win.move(y, 0)
            stop = self._end_of_line(y)
            if stop == 0 and self.stripspaces:
                continue
            for x in range(self.maxx+1):
                if self.stripspaces and x > stop:
                    break
                result = result + chr(curses.ascii.ascii(self.win.inch(y, x)))
            if self.maxy > 0:
                result = result + "\n"
        return result

    def edit(self, validate=None):
        "Edit in the widget window and collect the results."
        while 1:
            ch = self.win.getch()
            if validate:
                ch = validate(ch)
            if not ch:
                continue
            if not self.do_command(ch):
                break
            self.win.refresh()
        return self.gather()

if __name__ == '__main__':
    def test_editbox(stdscr):
        ncols, nlines = 9, 4
        uly, ulx = 15, 20
        stdscr.addstr(uly-2, ulx, "Use Ctrl-G to end editing.")
        win = curses.newwin(nlines, ncols, uly, ulx)
        rectangle(stdscr, uly-1, ulx-1, uly + nlines, ulx + ncols)
        stdscr.refresh()
        return Textbox(win).edit()

    str = curses.wrapper(test_editbox)
    print('Contents of text box:', repr(str))
curses/has_key.py000064400000013002151153537470010054 0ustar00
#
# Emulation of has_key() function for platforms that don't use ncurses
#

import _curses

# Table mapping curses keys to the terminfo capability name

_capability_names = {
    _curses.KEY_A1: 'ka1',
    _curses.KEY_A3: 'ka3',
    _curses.KEY_B2: 'kb2',
    _curses.KEY_BACKSPACE: 'kbs',
    _curses.KEY_BEG: 'kbeg',
    _curses.KEY_BTAB: 'kcbt',
    _curses.KEY_C1: 'kc1',
    _curses.KEY_C3: 'kc3',
    _curses.KEY_CANCEL: 'kcan',
    _curses.KEY_CATAB: 'ktbc',
    _curses.KEY_CLEAR: 'kclr',
    _curses.KEY_CLOSE: 'kclo',
    _curses.KEY_COMMAND: 'kcmd',
    _curses.KEY_COPY: 'kcpy',
    _curses.KEY_CREATE: 'kcrt',
    _curses.KEY_CTAB: 'kctab',
    _curses.KEY_DC: 'kdch1',
    _curses.KEY_DL: 'kdl1',
    _curses.KEY_DOWN: 'kcud1',
    _curses.KEY_EIC: 'krmir',
    _curses.KEY_END: 'kend',
    _curses.KEY_ENTER: 'kent',
    _curses.KEY_EOL: 'kel',
    _curses.KEY_EOS: 'ked',
    _curses.KEY_EXIT: 'kext',
    _curses.KEY_F0: 'kf0',
    _curses.KEY_F1: 'kf1',
    _curses.KEY_F10: 'kf10',
    _curses.KEY_F11: 'kf11',
    _curses.KEY_F12: 'kf12',
    _curses.KEY_F13: 'kf13',
    _curses.KEY_F14: 'kf14',
    _curses.KEY_F15: 'kf15',
    _curses.KEY_F16: 'kf16',
    _curses.KEY_F17: 'kf17',
    _curses.KEY_F18: 'kf18',
    _curses.KEY_F19: 'kf19',
    _curses.KEY_F2: 'kf2',
    _curses.KEY_F20: 'kf20',
    _curses.KEY_F21: 'kf21',
    _curses.KEY_F22: 'kf22',
    _curses.KEY_F23: 'kf23',
    _curses.KEY_F24: 'kf24',
    _curses.KEY_F25: 'kf25',
    _curses.KEY_F26: 'kf26',
    _curses.KEY_F27: 'kf27',
    _curses.KEY_F28: 'kf28',
    _curses.KEY_F29: 'kf29',
    _curses.KEY_F3: 'kf3',
    _curses.KEY_F30: 'kf30',
    _curses.KEY_F31: 'kf31',
    _curses.KEY_F32: 'kf32',
    _curses.KEY_F33: 'kf33',
    _curses.KEY_F34: 'kf34',
    _curses.KEY_F35: 'kf35',
    _curses.KEY_F36: 'kf36',
    _curses.KEY_F37: 'kf37',
    _curses.KEY_F38: 'kf38',
    _curses.KEY_F39: 'kf39',
    _curses.KEY_F4: 'kf4',
    _curses.KEY_F40: 'kf40',
    _curses.KEY_F41: 'kf41',
    _curses.KEY_F42: 'kf42',
    _curses.KEY_F43: 'kf43',
    _curses.KEY_F44: 'kf44',
    _curses.KEY_F45: 'kf45',
    _curses.KEY_F46: 'kf46',
    _curses.KEY_F47: 'kf47',
    _curses.KEY_F48: 'kf48',
    _curses.KEY_F49: 'kf49',
    _curses.KEY_F5: 'kf5',
    _curses.KEY_F50: 'kf50',
    _curses.KEY_F51: 'kf51',
    _curses.KEY_F52: 'kf52',
    _curses.KEY_F53: 'kf53',
    _curses.KEY_F54: 'kf54',
    _curses.KEY_F55: 'kf55',
    _curses.KEY_F56: 'kf56',
    _curses.KEY_F57: 'kf57',
    _curses.KEY_F58: 'kf58',
    _curses.KEY_F59: 'kf59',
    _curses.KEY_F6: 'kf6',
    _curses.KEY_F60: 'kf60',
    _curses.KEY_F61: 'kf61',
    _curses.KEY_F62: 'kf62',
    _curses.KEY_F63: 'kf63',
    _curses.KEY_F7: 'kf7',
    _curses.KEY_F8: 'kf8',
    _curses.KEY_F9: 'kf9',
    _curses.KEY_FIND: 'kfnd',
    _curses.KEY_HELP: 'khlp',
    _curses.KEY_HOME: 'khome',
    _curses.KEY_IC: 'kich1',
    _curses.KEY_IL: 'kil1',
    _curses.KEY_LEFT: 'kcub1',
    _curses.KEY_LL: 'kll',
    _curses.KEY_MARK: 'kmrk',
    _curses.KEY_MESSAGE: 'kmsg',
    _curses.KEY_MOVE: 'kmov',
    _curses.KEY_NEXT: 'knxt',
    _curses.KEY_NPAGE: 'knp',
    _curses.KEY_OPEN: 'kopn',
    _curses.KEY_OPTIONS: 'kopt',
    _curses.KEY_PPAGE: 'kpp',
    _curses.KEY_PREVIOUS: 'kprv',
    _curses.KEY_PRINT: 'kprt',
    _curses.KEY_REDO: 'krdo',
    _curses.KEY_REFERENCE: 'kref',
    _curses.KEY_REFRESH: 'krfr',
    _curses.KEY_REPLACE: 'krpl',
    _curses.KEY_RESTART: 'krst',
    _curses.KEY_RESUME: 'kres',
    _curses.KEY_RIGHT: 'kcuf1',
    _curses.KEY_SAVE: 'ksav',
    _curses.KEY_SBEG: 'kBEG',
    _curses.KEY_SCANCEL: 'kCAN',
    _curses.KEY_SCOMMAND: 'kCMD',
    _curses.KEY_SCOPY: 'kCPY',
    _curses.KEY_SCREATE: 'kCRT',
    _curses.KEY_SDC: 'kDC',
    _curses.KEY_SDL: 'kDL',
    _curses.KEY_SELECT: 'kslt',
    _curses.KEY_SEND: 'kEND',
    _curses.KEY_SEOL: 'kEOL',
    _curses.KEY_SEXIT: 'kEXT',
    _curses.KEY_SF: 'kind',
    _curses.KEY_SFIND: 'kFND',
    _curses.KEY_SHELP: 'kHLP',
    _curses.KEY_SHOME: 'kHOM',
    _curses.KEY_SIC: 'kIC',
    _curses.KEY_SLEFT: 'kLFT',
    _curses.KEY_SMESSAGE: 'kMSG',
    _curses.KEY_SMOVE: 'kMOV',
    _curses.KEY_SNEXT: 'kNXT',
    _curses.KEY_SOPTIONS: 'kOPT',
    _curses.KEY_SPREVIOUS: 'kPRV',
    _curses.KEY_SPRINT: 'kPRT',
    _curses.KEY_SR: 'kri',
    _curses.KEY_SREDO: 'kRDO',
    _curses.KEY_SREPLACE: 'kRPL',
    _curses.KEY_SRIGHT: 'kRIT',
    _curses.KEY_SRSUME: 'kRES',
    _curses.KEY_SSAVE: 'kSAV',
    _curses.KEY_SSUSPEND: 'kSPD',
    _curses.KEY_STAB: 'khts',
    _curses.KEY_SUNDO: 'kUND',
    _curses.KEY_SUSPEND: 'kspd',
    _curses.KEY_UNDO: 'kund',
    _curses.KEY_UP: 'kcuu1'
    }

def has_key(ch):
    if isinstance(ch, str):
        ch = ord(ch)

    # Figure out the correct capability name for the keycode.
    capability_name = _capability_names.get(ch)
    if capability_name is None:
        return False

    #Check the current terminal description for that capability;
    #if present, return true, else return false.
    if _curses.tigetstr( capability_name ):
        return True
    else:
        return False

if __name__ == '__main__':
    # Compare the output of this implementation and the ncurses has_key,
    # on platforms where has_key is already available
    try:
        L = []
        _curses.initscr()
        for key in _capability_names.keys():
            system = _curses.has_key(key)
            python = has_key(key)
            if system != python:
                L.append( 'Mismatch for key %s, system=%i, Python=%i'
                          % (_curses.keyname( key ), system, python) )
    finally:
        _curses.endwin()
        for i in L: print(i)
plistlib.py000064400000076734151153537470006774 0ustar00r"""plistlib.py -- a tool to generate and parse MacOSX .plist files.

The property list (.plist) file format is a simple XML pickle supporting
basic object types, like dictionaries, lists, numbers and strings.
Usually the top level object is a dictionary.

To write out a plist file, use the dump(value, file)
function. 'value' is the top level object, 'file' is
a (writable) file object.

To parse a plist from a file, use the load(file) function,
with a (readable) file object as the only argument. It
returns the top level object (again, usually a dictionary).

To work with plist data in bytes objects, you can use loads()
and dumps().

Values can be strings, integers, floats, booleans, tuples, lists,
dictionaries (but only with string keys), Data, bytes, bytearray, or
datetime.datetime objects.

Generate Plist example:

    pl = dict(
        aString = "Doodah",
        aList = ["A", "B", 12, 32.1, [1, 2, 3]],
        aFloat = 0.1,
        anInt = 728,
        aDict = dict(
            anotherString = "<hello & hi there!>",
            aUnicodeValue = "M\xe4ssig, Ma\xdf",
            aTrueValue = True,
            aFalseValue = False,
        ),
        someData = b"<binary gunk>",
        someMoreData = b"<lots of binary gunk>" * 10,
        aDate = datetime.datetime.fromtimestamp(time.mktime(time.gmtime())),
    )
    with open(fileName, 'wb') as fp:
        dump(pl, fp)

Parse Plist example:

    with open(fileName, 'rb') as fp:
        pl = load(fp)
    print(pl["aKey"])
"""
__all__ = [
    "readPlist", "writePlist", "readPlistFromBytes", "writePlistToBytes",
    "Data", "InvalidFileException", "FMT_XML", "FMT_BINARY",
    "load", "dump", "loads", "dumps", "UID"
]

import binascii
import codecs
import contextlib
import datetime
import enum
from io import BytesIO
import itertools
import os
import re
import struct
from warnings import warn
from xml.parsers.expat import ParserCreate


PlistFormat = enum.Enum('PlistFormat', 'FMT_XML FMT_BINARY', module=__name__)
globals().update(PlistFormat.__members__)


#
#
# Deprecated functionality
#
#


@contextlib.contextmanager
def _maybe_open(pathOrFile, mode):
    if isinstance(pathOrFile, str):
        with open(pathOrFile, mode) as fp:
            yield fp

    else:
        yield pathOrFile


def readPlist(pathOrFile):
    """
    Read a .plist from a path or file. pathOrFile should either
    be a file name, or a readable binary file object.

    This function is deprecated, use load instead.
    """
    warn("The readPlist function is deprecated, use load() instead",
        DeprecationWarning, 2)

    with _maybe_open(pathOrFile, 'rb') as fp:
        return load(fp, fmt=None, use_builtin_types=False)

def writePlist(value, pathOrFile):
    """
    Write 'value' to a .plist file. 'pathOrFile' may either be a
    file name or a (writable) file object.

    This function is deprecated, use dump instead.
    """
    warn("The writePlist function is deprecated, use dump() instead",
        DeprecationWarning, 2)
    with _maybe_open(pathOrFile, 'wb') as fp:
        dump(value, fp, fmt=FMT_XML, sort_keys=True, skipkeys=False)


def readPlistFromBytes(data):
    """
    Read a plist data from a bytes object. Return the root object.

    This function is deprecated, use loads instead.
    """
    warn("The readPlistFromBytes function is deprecated, use loads() instead",
        DeprecationWarning, 2)
    return load(BytesIO(data), fmt=None, use_builtin_types=False)


def writePlistToBytes(value):
    """
    Return 'value' as a plist-formatted bytes object.

    This function is deprecated, use dumps instead.
    """
    warn("The writePlistToBytes function is deprecated, use dumps() instead",
        DeprecationWarning, 2)
    f = BytesIO()
    dump(value, f, fmt=FMT_XML, sort_keys=True, skipkeys=False)
    return f.getvalue()


class Data:
    """
    Wrapper for binary data.

    This class is deprecated, use a bytes object instead.
    """

    def __init__(self, data):
        if not isinstance(data, bytes):
            raise TypeError("data must be as bytes")
        self.data = data

    @classmethod
    def fromBase64(cls, data):
        # base64.decodebytes just calls binascii.a2b_base64;
        # it seems overkill to use both base64 and binascii.
        return cls(_decode_base64(data))

    def asBase64(self, maxlinelength=76):
        return _encode_base64(self.data, maxlinelength)

    def __eq__(self, other):
        if isinstance(other, self.__class__):
            return self.data == other.data
        elif isinstance(other, bytes):
            return self.data == other
        else:
            return NotImplemented

    def __repr__(self):
        return "%s(%s)" % (self.__class__.__name__, repr(self.data))

#
#
# End of deprecated functionality
#
#


class UID:
    def __init__(self, data):
        if not isinstance(data, int):
            raise TypeError("data must be an int")
        if data >= 1 << 64:
            raise ValueError("UIDs cannot be >= 2**64")
        if data < 0:
            raise ValueError("UIDs must be positive")
        self.data = data

    def __index__(self):
        return self.data

    def __repr__(self):
        return "%s(%s)" % (self.__class__.__name__, repr(self.data))

    def __reduce__(self):
        return self.__class__, (self.data,)

    def __eq__(self, other):
        if not isinstance(other, UID):
            return NotImplemented
        return self.data == other.data

    def __hash__(self):
        return hash(self.data)


#
# XML support
#


# XML 'header'
PLISTHEADER = b"""\
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
"""


# Regex to find any control chars, except for \t \n and \r
_controlCharPat = re.compile(
    r"[\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0c\x0e\x0f"
    r"\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f]")

def _encode_base64(s, maxlinelength=76):
    # copied from base64.encodebytes(), with added maxlinelength argument
    maxbinsize = (maxlinelength//4)*3
    pieces = []
    for i in range(0, len(s), maxbinsize):
        chunk = s[i : i + maxbinsize]
        pieces.append(binascii.b2a_base64(chunk))
    return b''.join(pieces)

def _decode_base64(s):
    if isinstance(s, str):
        return binascii.a2b_base64(s.encode("utf-8"))

    else:
        return binascii.a2b_base64(s)

# Contents should conform to a subset of ISO 8601
# (in particular, YYYY '-' MM '-' DD 'T' HH ':' MM ':' SS 'Z'.  Smaller units
# may be omitted with #  a loss of precision)
_dateParser = re.compile(r"(?P<year>\d\d\d\d)(?:-(?P<month>\d\d)(?:-(?P<day>\d\d)(?:T(?P<hour>\d\d)(?::(?P<minute>\d\d)(?::(?P<second>\d\d))?)?)?)?)?Z", re.ASCII)


def _date_from_string(s):
    order = ('year', 'month', 'day', 'hour', 'minute', 'second')
    gd = _dateParser.match(s).groupdict()
    lst = []
    for key in order:
        val = gd[key]
        if val is None:
            break
        lst.append(int(val))
    return datetime.datetime(*lst)


def _date_to_string(d):
    return '%04d-%02d-%02dT%02d:%02d:%02dZ' % (
        d.year, d.month, d.day,
        d.hour, d.minute, d.second
    )

def _escape(text):
    m = _controlCharPat.search(text)
    if m is not None:
        raise ValueError("strings can't contains control characters; "
                         "use bytes instead")
    text = text.replace("\r\n", "\n")       # convert DOS line endings
    text = text.replace("\r", "\n")         # convert Mac line endings
    text = text.replace("&", "&amp;")       # escape '&'
    text = text.replace("<", "&lt;")        # escape '<'
    text = text.replace(">", "&gt;")        # escape '>'
    return text

class _PlistParser:
    def __init__(self, use_builtin_types, dict_type):
        self.stack = []
        self.current_key = None
        self.root = None
        self._use_builtin_types = use_builtin_types
        self._dict_type = dict_type

    def parse(self, fileobj):
        self.parser = ParserCreate()
        self.parser.StartElementHandler = self.handle_begin_element
        self.parser.EndElementHandler = self.handle_end_element
        self.parser.CharacterDataHandler = self.handle_data
        self.parser.EntityDeclHandler = self.handle_entity_decl
        self.parser.ParseFile(fileobj)
        return self.root

    def handle_entity_decl(self, entity_name, is_parameter_entity, value, base, system_id, public_id, notation_name):
        # Reject plist files with entity declarations to avoid XML vulnerabilies in expat.
        # Regular plist files don't contain those declerations, and Apple's plutil tool does not
        # accept them either.
        raise InvalidFileException("XML entity declarations are not supported in plist files")

    def handle_begin_element(self, element, attrs):
        self.data = []
        handler = getattr(self, "begin_" + element, None)
        if handler is not None:
            handler(attrs)

    def handle_end_element(self, element):
        handler = getattr(self, "end_" + element, None)
        if handler is not None:
            handler()

    def handle_data(self, data):
        self.data.append(data)

    def add_object(self, value):
        if self.current_key is not None:
            if not isinstance(self.stack[-1], type({})):
                raise ValueError("unexpected element at line %d" %
                                 self.parser.CurrentLineNumber)
            self.stack[-1][self.current_key] = value
            self.current_key = None
        elif not self.stack:
            # this is the root object
            self.root = value
        else:
            if not isinstance(self.stack[-1], type([])):
                raise ValueError("unexpected element at line %d" %
                                 self.parser.CurrentLineNumber)
            self.stack[-1].append(value)

    def get_data(self):
        data = ''.join(self.data)
        self.data = []
        return data

    # element handlers

    def begin_dict(self, attrs):
        d = self._dict_type()
        self.add_object(d)
        self.stack.append(d)

    def end_dict(self):
        if self.current_key:
            raise ValueError("missing value for key '%s' at line %d" %
                             (self.current_key,self.parser.CurrentLineNumber))
        self.stack.pop()

    def end_key(self):
        if self.current_key or not isinstance(self.stack[-1], type({})):
            raise ValueError("unexpected key at line %d" %
                             self.parser.CurrentLineNumber)
        self.current_key = self.get_data()

    def begin_array(self, attrs):
        a = []
        self.add_object(a)
        self.stack.append(a)

    def end_array(self):
        self.stack.pop()

    def end_true(self):
        self.add_object(True)

    def end_false(self):
        self.add_object(False)

    def end_integer(self):
        raw = self.get_data()
        if raw.startswith('0x') or raw.startswith('0X'):
            self.add_object(int(raw, 16))
        else:
            self.add_object(int(raw))

    def end_real(self):
        self.add_object(float(self.get_data()))

    def end_string(self):
        self.add_object(self.get_data())

    def end_data(self):
        if self._use_builtin_types:
            self.add_object(_decode_base64(self.get_data()))

        else:
            self.add_object(Data.fromBase64(self.get_data()))

    def end_date(self):
        self.add_object(_date_from_string(self.get_data()))


class _DumbXMLWriter:
    def __init__(self, file, indent_level=0, indent="\t"):
        self.file = file
        self.stack = []
        self._indent_level = indent_level
        self.indent = indent

    def begin_element(self, element):
        self.stack.append(element)
        self.writeln("<%s>" % element)
        self._indent_level += 1

    def end_element(self, element):
        assert self._indent_level > 0
        assert self.stack.pop() == element
        self._indent_level -= 1
        self.writeln("</%s>" % element)

    def simple_element(self, element, value=None):
        if value is not None:
            value = _escape(value)
            self.writeln("<%s>%s</%s>" % (element, value, element))

        else:
            self.writeln("<%s/>" % element)

    def writeln(self, line):
        if line:
            # plist has fixed encoding of utf-8

            # XXX: is this test needed?
            if isinstance(line, str):
                line = line.encode('utf-8')
            self.file.write(self._indent_level * self.indent)
            self.file.write(line)
        self.file.write(b'\n')


class _PlistWriter(_DumbXMLWriter):
    def __init__(
            self, file, indent_level=0, indent=b"\t", writeHeader=1,
            sort_keys=True, skipkeys=False):

        if writeHeader:
            file.write(PLISTHEADER)
        _DumbXMLWriter.__init__(self, file, indent_level, indent)
        self._sort_keys = sort_keys
        self._skipkeys = skipkeys

    def write(self, value):
        self.writeln("<plist version=\"1.0\">")
        self.write_value(value)
        self.writeln("</plist>")

    def write_value(self, value):
        if isinstance(value, str):
            self.simple_element("string", value)

        elif value is True:
            self.simple_element("true")

        elif value is False:
            self.simple_element("false")

        elif isinstance(value, int):
            if -1 << 63 <= value < 1 << 64:
                self.simple_element("integer", "%d" % value)
            else:
                raise OverflowError(value)

        elif isinstance(value, float):
            self.simple_element("real", repr(value))

        elif isinstance(value, dict):
            self.write_dict(value)

        elif isinstance(value, Data):
            self.write_data(value)

        elif isinstance(value, (bytes, bytearray)):
            self.write_bytes(value)

        elif isinstance(value, datetime.datetime):
            self.simple_element("date", _date_to_string(value))

        elif isinstance(value, (tuple, list)):
            self.write_array(value)

        else:
            raise TypeError("unsupported type: %s" % type(value))

    def write_data(self, data):
        self.write_bytes(data.data)

    def write_bytes(self, data):
        self.begin_element("data")
        self._indent_level -= 1
        maxlinelength = max(
            16,
            76 - len(self.indent.replace(b"\t", b" " * 8) * self._indent_level))

        for line in _encode_base64(data, maxlinelength).split(b"\n"):
            if line:
                self.writeln(line)
        self._indent_level += 1
        self.end_element("data")

    def write_dict(self, d):
        if d:
            self.begin_element("dict")
            if self._sort_keys:
                items = sorted(d.items())
            else:
                items = d.items()

            for key, value in items:
                if not isinstance(key, str):
                    if self._skipkeys:
                        continue
                    raise TypeError("keys must be strings")
                self.simple_element("key", key)
                self.write_value(value)
            self.end_element("dict")

        else:
            self.simple_element("dict")

    def write_array(self, array):
        if array:
            self.begin_element("array")
            for value in array:
                self.write_value(value)
            self.end_element("array")

        else:
            self.simple_element("array")


def _is_fmt_xml(header):
    prefixes = (b'<?xml', b'<plist')

    for pfx in prefixes:
        if header.startswith(pfx):
            return True

    # Also check for alternative XML encodings, this is slightly
    # overkill because the Apple tools (and plistlib) will not
    # generate files with these encodings.
    for bom, encoding in (
                (codecs.BOM_UTF8, "utf-8"),
                (codecs.BOM_UTF16_BE, "utf-16-be"),
                (codecs.BOM_UTF16_LE, "utf-16-le"),
                # expat does not support utf-32
                #(codecs.BOM_UTF32_BE, "utf-32-be"),
                #(codecs.BOM_UTF32_LE, "utf-32-le"),
            ):
        if not header.startswith(bom):
            continue

        for start in prefixes:
            prefix = bom + start.decode('ascii').encode(encoding)
            if header[:len(prefix)] == prefix:
                return True

    return False

#
# Binary Plist
#


class InvalidFileException (ValueError):
    def __init__(self, message="Invalid file"):
        ValueError.__init__(self, message)

_BINARY_FORMAT = {1: 'B', 2: 'H', 4: 'L', 8: 'Q'}

_undefined = object()

class _BinaryPlistParser:
    """
    Read or write a binary plist file, following the description of the binary
    format.  Raise InvalidFileException in case of error, otherwise return the
    root object.

    see also: http://opensource.apple.com/source/CF/CF-744.18/CFBinaryPList.c
    """
    def __init__(self, use_builtin_types, dict_type):
        self._use_builtin_types = use_builtin_types
        self._dict_type = dict_type

    def parse(self, fp):
        try:
            # The basic file format:
            # HEADER
            # object...
            # refid->offset...
            # TRAILER
            self._fp = fp
            self._fp.seek(-32, os.SEEK_END)
            trailer = self._fp.read(32)
            if len(trailer) != 32:
                raise InvalidFileException()
            (
                offset_size, self._ref_size, num_objects, top_object,
                offset_table_offset
            ) = struct.unpack('>6xBBQQQ', trailer)
            self._fp.seek(offset_table_offset)
            self._object_offsets = self._read_ints(num_objects, offset_size)
            self._objects = [_undefined] * num_objects
            return self._read_object(top_object)

        except (OSError, IndexError, struct.error, OverflowError,
                ValueError):
            raise InvalidFileException()

    def _get_size(self, tokenL):
        """ return the size of the next object."""
        if tokenL == 0xF:
            m = self._fp.read(1)[0] & 0x3
            s = 1 << m
            f = '>' + _BINARY_FORMAT[s]
            return struct.unpack(f, self._fp.read(s))[0]

        return tokenL

    def _read_ints(self, n, size):
        data = self._fp.read(size * n)
        if size in _BINARY_FORMAT:
            return struct.unpack(f'>{n}{_BINARY_FORMAT[size]}', data)
        else:
            if not size or len(data) != size * n:
                raise InvalidFileException()
            return tuple(int.from_bytes(data[i: i + size], 'big')
                         for i in range(0, size * n, size))

    def _read_refs(self, n):
        return self._read_ints(n, self._ref_size)

    def _read_object(self, ref):
        """
        read the object by reference.

        May recursively read sub-objects (content of an array/dict/set)
        """
        result = self._objects[ref]
        if result is not _undefined:
            return result

        offset = self._object_offsets[ref]
        self._fp.seek(offset)
        token = self._fp.read(1)[0]
        tokenH, tokenL = token & 0xF0, token & 0x0F

        if token == 0x00:
            result = None

        elif token == 0x08:
            result = False

        elif token == 0x09:
            result = True

        # The referenced source code also mentions URL (0x0c, 0x0d) and
        # UUID (0x0e), but neither can be generated using the Cocoa libraries.

        elif token == 0x0f:
            result = b''

        elif tokenH == 0x10:  # int
            result = int.from_bytes(self._fp.read(1 << tokenL),
                                    'big', signed=tokenL >= 3)

        elif token == 0x22: # real
            result = struct.unpack('>f', self._fp.read(4))[0]

        elif token == 0x23: # real
            result = struct.unpack('>d', self._fp.read(8))[0]

        elif token == 0x33:  # date
            f = struct.unpack('>d', self._fp.read(8))[0]
            # timestamp 0 of binary plists corresponds to 1/1/2001
            # (year of Mac OS X 10.0), instead of 1/1/1970.
            result = (datetime.datetime(2001, 1, 1) +
                      datetime.timedelta(seconds=f))

        elif tokenH == 0x40:  # data
            s = self._get_size(tokenL)
            result = self._fp.read(s)
            if len(result) != s:
                raise InvalidFileException()
            if not self._use_builtin_types:
                result = Data(result)

        elif tokenH == 0x50:  # ascii string
            s = self._get_size(tokenL)
            data = self._fp.read(s)
            if len(data) != s:
                raise InvalidFileException()
            result = data.decode('ascii')

        elif tokenH == 0x60:  # unicode string
            s = self._get_size(tokenL) * 2
            data = self._fp.read(s)
            if len(data) != s:
                raise InvalidFileException()
            result = data.decode('utf-16be')

        elif tokenH == 0x80:  # UID
            # used by Key-Archiver plist files
            result = UID(int.from_bytes(self._fp.read(1 + tokenL), 'big'))

        elif tokenH == 0xA0:  # array
            s = self._get_size(tokenL)
            obj_refs = self._read_refs(s)
            result = []
            self._objects[ref] = result
            result.extend(self._read_object(x) for x in obj_refs)

        # tokenH == 0xB0 is documented as 'ordset', but is not actually
        # implemented in the Apple reference code.

        # tokenH == 0xC0 is documented as 'set', but sets cannot be used in
        # plists.

        elif tokenH == 0xD0:  # dict
            s = self._get_size(tokenL)
            key_refs = self._read_refs(s)
            obj_refs = self._read_refs(s)
            result = self._dict_type()
            self._objects[ref] = result
            try:
                for k, o in zip(key_refs, obj_refs):
                    result[self._read_object(k)] = self._read_object(o)
            except TypeError:
                raise InvalidFileException()
        else:
            raise InvalidFileException()

        self._objects[ref] = result
        return result

def _count_to_size(count):
    if count < 1 << 8:
        return 1

    elif count < 1 << 16:
        return 2

    elif count < 1 << 32:
        return 4

    else:
        return 8

_scalars = (str, int, float, datetime.datetime, bytes)

class _BinaryPlistWriter (object):
    def __init__(self, fp, sort_keys, skipkeys):
        self._fp = fp
        self._sort_keys = sort_keys
        self._skipkeys = skipkeys

    def write(self, value):

        # Flattened object list:
        self._objlist = []

        # Mappings from object->objectid
        # First dict has (type(object), object) as the key,
        # second dict is used when object is not hashable and
        # has id(object) as the key.
        self._objtable = {}
        self._objidtable = {}

        # Create list of all objects in the plist
        self._flatten(value)

        # Size of object references in serialized containers
        # depends on the number of objects in the plist.
        num_objects = len(self._objlist)
        self._object_offsets = [0]*num_objects
        self._ref_size = _count_to_size(num_objects)

        self._ref_format = _BINARY_FORMAT[self._ref_size]

        # Write file header
        self._fp.write(b'bplist00')

        # Write object list
        for obj in self._objlist:
            self._write_object(obj)

        # Write refnum->object offset table
        top_object = self._getrefnum(value)
        offset_table_offset = self._fp.tell()
        offset_size = _count_to_size(offset_table_offset)
        offset_format = '>' + _BINARY_FORMAT[offset_size] * num_objects
        self._fp.write(struct.pack(offset_format, *self._object_offsets))

        # Write trailer
        sort_version = 0
        trailer = (
            sort_version, offset_size, self._ref_size, num_objects,
            top_object, offset_table_offset
        )
        self._fp.write(struct.pack('>5xBBBQQQ', *trailer))

    def _flatten(self, value):
        # First check if the object is in the object table, not used for
        # containers to ensure that two subcontainers with the same contents
        # will be serialized as distinct values.
        if isinstance(value, _scalars):
            if (type(value), value) in self._objtable:
                return

        elif isinstance(value, Data):
            if (type(value.data), value.data) in self._objtable:
                return

        elif id(value) in self._objidtable:
            return

        # Add to objectreference map
        refnum = len(self._objlist)
        self._objlist.append(value)
        if isinstance(value, _scalars):
            self._objtable[(type(value), value)] = refnum
        elif isinstance(value, Data):
            self._objtable[(type(value.data), value.data)] = refnum
        else:
            self._objidtable[id(value)] = refnum

        # And finally recurse into containers
        if isinstance(value, dict):
            keys = []
            values = []
            items = value.items()
            if self._sort_keys:
                items = sorted(items)

            for k, v in items:
                if not isinstance(k, str):
                    if self._skipkeys:
                        continue
                    raise TypeError("keys must be strings")
                keys.append(k)
                values.append(v)

            for o in itertools.chain(keys, values):
                self._flatten(o)

        elif isinstance(value, (list, tuple)):
            for o in value:
                self._flatten(o)

    def _getrefnum(self, value):
        if isinstance(value, _scalars):
            return self._objtable[(type(value), value)]
        elif isinstance(value, Data):
            return self._objtable[(type(value.data), value.data)]
        else:
            return self._objidtable[id(value)]

    def _write_size(self, token, size):
        if size < 15:
            self._fp.write(struct.pack('>B', token | size))

        elif size < 1 << 8:
            self._fp.write(struct.pack('>BBB', token | 0xF, 0x10, size))

        elif size < 1 << 16:
            self._fp.write(struct.pack('>BBH', token | 0xF, 0x11, size))

        elif size < 1 << 32:
            self._fp.write(struct.pack('>BBL', token | 0xF, 0x12, size))

        else:
            self._fp.write(struct.pack('>BBQ', token | 0xF, 0x13, size))

    def _write_object(self, value):
        ref = self._getrefnum(value)
        self._object_offsets[ref] = self._fp.tell()
        if value is None:
            self._fp.write(b'\x00')

        elif value is False:
            self._fp.write(b'\x08')

        elif value is True:
            self._fp.write(b'\x09')

        elif isinstance(value, int):
            if value < 0:
                try:
                    self._fp.write(struct.pack('>Bq', 0x13, value))
                except struct.error:
                    raise OverflowError(value) from None
            elif value < 1 << 8:
                self._fp.write(struct.pack('>BB', 0x10, value))
            elif value < 1 << 16:
                self._fp.write(struct.pack('>BH', 0x11, value))
            elif value < 1 << 32:
                self._fp.write(struct.pack('>BL', 0x12, value))
            elif value < 1 << 63:
                self._fp.write(struct.pack('>BQ', 0x13, value))
            elif value < 1 << 64:
                self._fp.write(b'\x14' + value.to_bytes(16, 'big', signed=True))
            else:
                raise OverflowError(value)

        elif isinstance(value, float):
            self._fp.write(struct.pack('>Bd', 0x23, value))

        elif isinstance(value, datetime.datetime):
            f = (value - datetime.datetime(2001, 1, 1)).total_seconds()
            self._fp.write(struct.pack('>Bd', 0x33, f))

        elif isinstance(value, Data):
            self._write_size(0x40, len(value.data))
            self._fp.write(value.data)

        elif isinstance(value, (bytes, bytearray)):
            self._write_size(0x40, len(value))
            self._fp.write(value)

        elif isinstance(value, str):
            try:
                t = value.encode('ascii')
                self._write_size(0x50, len(value))
            except UnicodeEncodeError:
                t = value.encode('utf-16be')
                self._write_size(0x60, len(t) // 2)

            self._fp.write(t)

        elif isinstance(value, UID):
            if value.data < 0:
                raise ValueError("UIDs must be positive")
            elif value.data < 1 << 8:
                self._fp.write(struct.pack('>BB', 0x80, value))
            elif value.data < 1 << 16:
                self._fp.write(struct.pack('>BH', 0x81, value))
            elif value.data < 1 << 32:
                self._fp.write(struct.pack('>BL', 0x83, value))
            elif value.data < 1 << 64:
                self._fp.write(struct.pack('>BQ', 0x87, value))
            else:
                raise OverflowError(value)

        elif isinstance(value, (list, tuple)):
            refs = [self._getrefnum(o) for o in value]
            s = len(refs)
            self._write_size(0xA0, s)
            self._fp.write(struct.pack('>' + self._ref_format * s, *refs))

        elif isinstance(value, dict):
            keyRefs, valRefs = [], []

            if self._sort_keys:
                rootItems = sorted(value.items())
            else:
                rootItems = value.items()

            for k, v in rootItems:
                if not isinstance(k, str):
                    if self._skipkeys:
                        continue
                    raise TypeError("keys must be strings")
                keyRefs.append(self._getrefnum(k))
                valRefs.append(self._getrefnum(v))

            s = len(keyRefs)
            self._write_size(0xD0, s)
            self._fp.write(struct.pack('>' + self._ref_format * s, *keyRefs))
            self._fp.write(struct.pack('>' + self._ref_format * s, *valRefs))

        else:
            raise TypeError(value)


def _is_fmt_binary(header):
    return header[:8] == b'bplist00'


#
# Generic bits
#

_FORMATS={
    FMT_XML: dict(
        detect=_is_fmt_xml,
        parser=_PlistParser,
        writer=_PlistWriter,
    ),
    FMT_BINARY: dict(
        detect=_is_fmt_binary,
        parser=_BinaryPlistParser,
        writer=_BinaryPlistWriter,
    )
}


def load(fp, *, fmt=None, use_builtin_types=True, dict_type=dict):
    """Read a .plist file. 'fp' should be a readable and binary file object.
    Return the unpacked root object (which usually is a dictionary).
    """
    if fmt is None:
        header = fp.read(32)
        fp.seek(0)
        for info in _FORMATS.values():
            if info['detect'](header):
                P = info['parser']
                break

        else:
            raise InvalidFileException()

    else:
        P = _FORMATS[fmt]['parser']

    p = P(use_builtin_types=use_builtin_types, dict_type=dict_type)
    return p.parse(fp)


def loads(value, *, fmt=None, use_builtin_types=True, dict_type=dict):
    """Read a .plist file from a bytes object.
    Return the unpacked root object (which usually is a dictionary).
    """
    fp = BytesIO(value)
    return load(
        fp, fmt=fmt, use_builtin_types=use_builtin_types, dict_type=dict_type)


def dump(value, fp, *, fmt=FMT_XML, sort_keys=True, skipkeys=False):
    """Write 'value' to a .plist file. 'fp' should be a writable,
    binary file object.
    """
    if fmt not in _FORMATS:
        raise ValueError("Unsupported format: %r"%(fmt,))

    writer = _FORMATS[fmt]["writer"](fp, sort_keys=sort_keys, skipkeys=skipkeys)
    writer.write(value)


def dumps(value, *, fmt=FMT_XML, skipkeys=False, sort_keys=True):
    """Return a bytes object with the contents for a .plist file.
    """
    fp = BytesIO()
    dump(value, fp, fmt=fmt, skipkeys=skipkeys, sort_keys=sort_keys)
    return fp.getvalue()
zipimport.py000064400000074055151153537470007201 0ustar00"""zipimport provides support for importing Python modules from Zip archives.

This module exports three objects:
- zipimporter: a class; its constructor takes a path to a Zip archive.
- ZipImportError: exception raised by zipimporter objects. It's a
  subclass of ImportError, so it can be caught as ImportError, too.
- _zip_directory_cache: a dict, mapping archive paths to zip directory
  info dicts, as used in zipimporter._files.

It is usually not needed to use the zipimport module explicitly; it is
used by the builtin import mechanism for sys.path items that are paths
to Zip archives.
"""

#from importlib import _bootstrap_external
#from importlib import _bootstrap  # for _verbose_message
import _frozen_importlib_external as _bootstrap_external
from _frozen_importlib_external import _unpack_uint16, _unpack_uint32
import _frozen_importlib as _bootstrap  # for _verbose_message
import _imp  # for check_hash_based_pycs
import _io  # for open
import marshal  # for loads
import sys  # for modules
import time  # for mktime

__all__ = ['ZipImportError', 'zipimporter']


path_sep = _bootstrap_external.path_sep
alt_path_sep = _bootstrap_external.path_separators[1:]


class ZipImportError(ImportError):
    pass

# _read_directory() cache
_zip_directory_cache = {}

_module_type = type(sys)

END_CENTRAL_DIR_SIZE = 22
STRING_END_ARCHIVE = b'PK\x05\x06'
MAX_COMMENT_LEN = (1 << 16) - 1

class zipimporter:
    """zipimporter(archivepath) -> zipimporter object

    Create a new zipimporter instance. 'archivepath' must be a path to
    a zipfile, or to a specific path inside a zipfile. For example, it can be
    '/tmp/myimport.zip', or '/tmp/myimport.zip/mydirectory', if mydirectory is a
    valid directory inside the archive.

    'ZipImportError is raised if 'archivepath' doesn't point to a valid Zip
    archive.

    The 'archive' attribute of zipimporter objects contains the name of the
    zipfile targeted.
    """

    # Split the "subdirectory" from the Zip archive path, lookup a matching
    # entry in sys.path_importer_cache, fetch the file directory from there
    # if found, or else read it from the archive.
    def __init__(self, path):
        if not isinstance(path, str):
            import os
            path = os.fsdecode(path)
        if not path:
            raise ZipImportError('archive path is empty', path=path)
        if alt_path_sep:
            path = path.replace(alt_path_sep, path_sep)

        prefix = []
        while True:
            try:
                st = _bootstrap_external._path_stat(path)
            except (OSError, ValueError):
                # On Windows a ValueError is raised for too long paths.
                # Back up one path element.
                dirname, basename = _bootstrap_external._path_split(path)
                if dirname == path:
                    raise ZipImportError('not a Zip file', path=path)
                path = dirname
                prefix.append(basename)
            else:
                # it exists
                if (st.st_mode & 0o170000) != 0o100000:  # stat.S_ISREG
                    # it's a not file
                    raise ZipImportError('not a Zip file', path=path)
                break

        try:
            files = _zip_directory_cache[path]
        except KeyError:
            files = _read_directory(path)
            _zip_directory_cache[path] = files
        self._files = files
        self.archive = path
        # a prefix directory following the ZIP file path.
        self.prefix = _bootstrap_external._path_join(*prefix[::-1])
        if self.prefix:
            self.prefix += path_sep


    # Check whether we can satisfy the import of the module named by
    # 'fullname', or whether it could be a portion of a namespace
    # package. Return self if we can load it, a string containing the
    # full path if it's a possible namespace portion, None if we
    # can't load it.
    def find_loader(self, fullname, path=None):
        """find_loader(fullname, path=None) -> self, str or None.

        Search for a module specified by 'fullname'. 'fullname' must be the
        fully qualified (dotted) module name. It returns the zipimporter
        instance itself if the module was found, a string containing the
        full path name if it's possibly a portion of a namespace package,
        or None otherwise. The optional 'path' argument is ignored -- it's
        there for compatibility with the importer protocol.
        """
        mi = _get_module_info(self, fullname)
        if mi is not None:
            # This is a module or package.
            return self, []

        # Not a module or regular package. See if this is a directory, and
        # therefore possibly a portion of a namespace package.

        # We're only interested in the last path component of fullname
        # earlier components are recorded in self.prefix.
        modpath = _get_module_path(self, fullname)
        if _is_dir(self, modpath):
            # This is possibly a portion of a namespace
            # package. Return the string representing its path,
            # without a trailing separator.
            return None, [f'{self.archive}{path_sep}{modpath}']

        return None, []


    # Check whether we can satisfy the import of the module named by
    # 'fullname'. Return self if we can, None if we can't.
    def find_module(self, fullname, path=None):
        """find_module(fullname, path=None) -> self or None.

        Search for a module specified by 'fullname'. 'fullname' must be the
        fully qualified (dotted) module name. It returns the zipimporter
        instance itself if the module was found, or None if it wasn't.
        The optional 'path' argument is ignored -- it's there for compatibility
        with the importer protocol.
        """
        return self.find_loader(fullname, path)[0]


    def get_code(self, fullname):
        """get_code(fullname) -> code object.

        Return the code object for the specified module. Raise ZipImportError
        if the module couldn't be found.
        """
        code, ispackage, modpath = _get_module_code(self, fullname)
        return code


    def get_data(self, pathname):
        """get_data(pathname) -> string with file data.

        Return the data associated with 'pathname'. Raise OSError if
        the file wasn't found.
        """
        if alt_path_sep:
            pathname = pathname.replace(alt_path_sep, path_sep)

        key = pathname
        if pathname.startswith(self.archive + path_sep):
            key = pathname[len(self.archive + path_sep):]

        try:
            toc_entry = self._files[key]
        except KeyError:
            raise OSError(0, '', key)
        return _get_data(self.archive, toc_entry)


    # Return a string matching __file__ for the named module
    def get_filename(self, fullname):
        """get_filename(fullname) -> filename string.

        Return the filename for the specified module.
        """
        # Deciding the filename requires working out where the code
        # would come from if the module was actually loaded
        code, ispackage, modpath = _get_module_code(self, fullname)
        return modpath


    def get_source(self, fullname):
        """get_source(fullname) -> source string.

        Return the source code for the specified module. Raise ZipImportError
        if the module couldn't be found, return None if the archive does
        contain the module, but has no source for it.
        """
        mi = _get_module_info(self, fullname)
        if mi is None:
            raise ZipImportError(f"can't find module {fullname!r}", name=fullname)

        path = _get_module_path(self, fullname)
        if mi:
            fullpath = _bootstrap_external._path_join(path, '__init__.py')
        else:
            fullpath = f'{path}.py'

        try:
            toc_entry = self._files[fullpath]
        except KeyError:
            # we have the module, but no source
            return None
        return _get_data(self.archive, toc_entry).decode()


    # Return a bool signifying whether the module is a package or not.
    def is_package(self, fullname):
        """is_package(fullname) -> bool.

        Return True if the module specified by fullname is a package.
        Raise ZipImportError if the module couldn't be found.
        """
        mi = _get_module_info(self, fullname)
        if mi is None:
            raise ZipImportError(f"can't find module {fullname!r}", name=fullname)
        return mi


    # Load and return the module named by 'fullname'.
    def load_module(self, fullname):
        """load_module(fullname) -> module.

        Load the module specified by 'fullname'. 'fullname' must be the
        fully qualified (dotted) module name. It returns the imported
        module, or raises ZipImportError if it wasn't found.
        """
        code, ispackage, modpath = _get_module_code(self, fullname)
        mod = sys.modules.get(fullname)
        if mod is None or not isinstance(mod, _module_type):
            mod = _module_type(fullname)
            sys.modules[fullname] = mod
        mod.__loader__ = self

        try:
            if ispackage:
                # add __path__ to the module *before* the code gets
                # executed
                path = _get_module_path(self, fullname)
                fullpath = _bootstrap_external._path_join(self.archive, path)
                mod.__path__ = [fullpath]

            if not hasattr(mod, '__builtins__'):
                mod.__builtins__ = __builtins__
            _bootstrap_external._fix_up_module(mod.__dict__, fullname, modpath)
            exec(code, mod.__dict__)
        except:
            del sys.modules[fullname]
            raise

        try:
            mod = sys.modules[fullname]
        except KeyError:
            raise ImportError(f'Loaded module {fullname!r} not found in sys.modules')
        _bootstrap._verbose_message('import {} # loaded from Zip {}', fullname, modpath)
        return mod


    def get_resource_reader(self, fullname):
        """Return the ResourceReader for a package in a zip file.

        If 'fullname' is a package within the zip file, return the
        'ResourceReader' object for the package.  Otherwise return None.
        """
        try:
            if not self.is_package(fullname):
                return None
        except ZipImportError:
            return None
        if not _ZipImportResourceReader._registered:
            from importlib.abc import ResourceReader
            ResourceReader.register(_ZipImportResourceReader)
            _ZipImportResourceReader._registered = True
        return _ZipImportResourceReader(self, fullname)


    def __repr__(self):
        return f'<zipimporter object "{self.archive}{path_sep}{self.prefix}">'


# _zip_searchorder defines how we search for a module in the Zip
# archive: we first search for a package __init__, then for
# non-package .pyc, and .py entries. The .pyc entries
# are swapped by initzipimport() if we run in optimized mode. Also,
# '/' is replaced by path_sep there.
_zip_searchorder = (
    (path_sep + '__init__.pyc', True, True),
    (path_sep + '__init__.py', False, True),
    ('.pyc', True, False),
    ('.py', False, False),
)

# Given a module name, return the potential file path in the
# archive (without extension).
def _get_module_path(self, fullname):
    return self.prefix + fullname.rpartition('.')[2]

# Does this path represent a directory?
def _is_dir(self, path):
    # See if this is a "directory". If so, it's eligible to be part
    # of a namespace package. We test by seeing if the name, with an
    # appended path separator, exists.
    dirpath = path + path_sep
    # If dirpath is present in self._files, we have a directory.
    return dirpath in self._files

# Return some information about a module.
def _get_module_info(self, fullname):
    path = _get_module_path(self, fullname)
    for suffix, isbytecode, ispackage in _zip_searchorder:
        fullpath = path + suffix
        if fullpath in self._files:
            return ispackage
    return None


# implementation

# _read_directory(archive) -> files dict (new reference)
#
# Given a path to a Zip archive, build a dict, mapping file names
# (local to the archive, using SEP as a separator) to toc entries.
#
# A toc_entry is a tuple:
#
# (__file__,        # value to use for __file__, available for all files,
#                   # encoded to the filesystem encoding
#  compress,        # compression kind; 0 for uncompressed
#  data_size,       # size of compressed data on disk
#  file_size,       # size of decompressed data
#  file_offset,     # offset of file header from start of archive
#  time,            # mod time of file (in dos format)
#  date,            # mod data of file (in dos format)
#  crc,             # crc checksum of the data
# )
#
# Directories can be recognized by the trailing path_sep in the name,
# data_size and file_offset are 0.
def _read_directory(archive):
    try:
        fp = _io.open_code(archive)
    except OSError:
        raise ZipImportError(f"can't open Zip file: {archive!r}", path=archive)

    with fp:
        try:
            fp.seek(-END_CENTRAL_DIR_SIZE, 2)
            header_position = fp.tell()
            buffer = fp.read(END_CENTRAL_DIR_SIZE)
        except OSError:
            raise ZipImportError(f"can't read Zip file: {archive!r}", path=archive)
        if len(buffer) != END_CENTRAL_DIR_SIZE:
            raise ZipImportError(f"can't read Zip file: {archive!r}", path=archive)
        if buffer[:4] != STRING_END_ARCHIVE:
            # Bad: End of Central Dir signature
            # Check if there's a comment.
            try:
                fp.seek(0, 2)
                file_size = fp.tell()
            except OSError:
                raise ZipImportError(f"can't read Zip file: {archive!r}",
                                     path=archive)
            max_comment_start = max(file_size - MAX_COMMENT_LEN -
                                    END_CENTRAL_DIR_SIZE, 0)
            try:
                fp.seek(max_comment_start)
                data = fp.read()
            except OSError:
                raise ZipImportError(f"can't read Zip file: {archive!r}",
                                     path=archive)
            pos = data.rfind(STRING_END_ARCHIVE)
            if pos < 0:
                raise ZipImportError(f'not a Zip file: {archive!r}',
                                     path=archive)
            buffer = data[pos:pos+END_CENTRAL_DIR_SIZE]
            if len(buffer) != END_CENTRAL_DIR_SIZE:
                raise ZipImportError(f"corrupt Zip file: {archive!r}",
                                     path=archive)
            header_position = file_size - len(data) + pos

        header_size = _unpack_uint32(buffer[12:16])
        header_offset = _unpack_uint32(buffer[16:20])
        if header_position < header_size:
            raise ZipImportError(f'bad central directory size: {archive!r}', path=archive)
        if header_position < header_offset:
            raise ZipImportError(f'bad central directory offset: {archive!r}', path=archive)
        header_position -= header_size
        arc_offset = header_position - header_offset
        if arc_offset < 0:
            raise ZipImportError(f'bad central directory size or offset: {archive!r}', path=archive)

        files = {}
        # Start of Central Directory
        count = 0
        try:
            fp.seek(header_position)
        except OSError:
            raise ZipImportError(f"can't read Zip file: {archive!r}", path=archive)
        while True:
            buffer = fp.read(46)
            if len(buffer) < 4:
                raise EOFError('EOF read where not expected')
            # Start of file header
            if buffer[:4] != b'PK\x01\x02':
                break                                # Bad: Central Dir File Header
            if len(buffer) != 46:
                raise EOFError('EOF read where not expected')
            flags = _unpack_uint16(buffer[8:10])
            compress = _unpack_uint16(buffer[10:12])
            time = _unpack_uint16(buffer[12:14])
            date = _unpack_uint16(buffer[14:16])
            crc = _unpack_uint32(buffer[16:20])
            data_size = _unpack_uint32(buffer[20:24])
            file_size = _unpack_uint32(buffer[24:28])
            name_size = _unpack_uint16(buffer[28:30])
            extra_size = _unpack_uint16(buffer[30:32])
            comment_size = _unpack_uint16(buffer[32:34])
            file_offset = _unpack_uint32(buffer[42:46])
            header_size = name_size + extra_size + comment_size
            if file_offset > header_offset:
                raise ZipImportError(f'bad local header offset: {archive!r}', path=archive)
            file_offset += arc_offset

            try:
                name = fp.read(name_size)
            except OSError:
                raise ZipImportError(f"can't read Zip file: {archive!r}", path=archive)
            if len(name) != name_size:
                raise ZipImportError(f"can't read Zip file: {archive!r}", path=archive)
            # On Windows, calling fseek to skip over the fields we don't use is
            # slower than reading the data because fseek flushes stdio's
            # internal buffers.    See issue #8745.
            try:
                if len(fp.read(header_size - name_size)) != header_size - name_size:
                    raise ZipImportError(f"can't read Zip file: {archive!r}", path=archive)
            except OSError:
                raise ZipImportError(f"can't read Zip file: {archive!r}", path=archive)

            if flags & 0x800:
                # UTF-8 file names extension
                name = name.decode()
            else:
                # Historical ZIP filename encoding
                try:
                    name = name.decode('ascii')
                except UnicodeDecodeError:
                    name = name.decode('latin1').translate(cp437_table)

            name = name.replace('/', path_sep)
            path = _bootstrap_external._path_join(archive, name)
            t = (path, compress, data_size, file_size, file_offset, time, date, crc)
            files[name] = t
            count += 1
    _bootstrap._verbose_message('zipimport: found {} names in {!r}', count, archive)
    return files

# During bootstrap, we may need to load the encodings
# package from a ZIP file. But the cp437 encoding is implemented
# in Python in the encodings package.
#
# Break out of this dependency by using the translation table for
# the cp437 encoding.
cp437_table = (
    # ASCII part, 8 rows x 16 chars
    '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f'
    '\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f'
    ' !"#$%&\'()*+,-./'
    '0123456789:;<=>?'
    '@ABCDEFGHIJKLMNO'
    'PQRSTUVWXYZ[\\]^_'
    '`abcdefghijklmno'
    'pqrstuvwxyz{|}~\x7f'
    # non-ASCII part, 16 rows x 8 chars
    '\xc7\xfc\xe9\xe2\xe4\xe0\xe5\xe7'
    '\xea\xeb\xe8\xef\xee\xec\xc4\xc5'
    '\xc9\xe6\xc6\xf4\xf6\xf2\xfb\xf9'
    '\xff\xd6\xdc\xa2\xa3\xa5\u20a7\u0192'
    '\xe1\xed\xf3\xfa\xf1\xd1\xaa\xba'
    '\xbf\u2310\xac\xbd\xbc\xa1\xab\xbb'
    '\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556'
    '\u2555\u2563\u2551\u2557\u255d\u255c\u255b\u2510'
    '\u2514\u2534\u252c\u251c\u2500\u253c\u255e\u255f'
    '\u255a\u2554\u2569\u2566\u2560\u2550\u256c\u2567'
    '\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256b'
    '\u256a\u2518\u250c\u2588\u2584\u258c\u2590\u2580'
    '\u03b1\xdf\u0393\u03c0\u03a3\u03c3\xb5\u03c4'
    '\u03a6\u0398\u03a9\u03b4\u221e\u03c6\u03b5\u2229'
    '\u2261\xb1\u2265\u2264\u2320\u2321\xf7\u2248'
    '\xb0\u2219\xb7\u221a\u207f\xb2\u25a0\xa0'
)

_importing_zlib = False

# Return the zlib.decompress function object, or NULL if zlib couldn't
# be imported. The function is cached when found, so subsequent calls
# don't import zlib again.
def _get_decompress_func():
    global _importing_zlib
    if _importing_zlib:
        # Someone has a zlib.py[co] in their Zip file
        # let's avoid a stack overflow.
        _bootstrap._verbose_message('zipimport: zlib UNAVAILABLE')
        raise ZipImportError("can't decompress data; zlib not available")

    _importing_zlib = True
    try:
        from zlib import decompress
    except Exception:
        _bootstrap._verbose_message('zipimport: zlib UNAVAILABLE')
        raise ZipImportError("can't decompress data; zlib not available")
    finally:
        _importing_zlib = False

    _bootstrap._verbose_message('zipimport: zlib available')
    return decompress

# Given a path to a Zip file and a toc_entry, return the (uncompressed) data.
def _get_data(archive, toc_entry):
    datapath, compress, data_size, file_size, file_offset, time, date, crc = toc_entry
    if data_size < 0:
        raise ZipImportError('negative data size')

    with _io.open_code(archive) as fp:
        # Check to make sure the local file header is correct
        try:
            fp.seek(file_offset)
        except OSError:
            raise ZipImportError(f"can't read Zip file: {archive!r}", path=archive)
        buffer = fp.read(30)
        if len(buffer) != 30:
            raise EOFError('EOF read where not expected')

        if buffer[:4] != b'PK\x03\x04':
            # Bad: Local File Header
            raise ZipImportError(f'bad local file header: {archive!r}', path=archive)

        name_size = _unpack_uint16(buffer[26:28])
        extra_size = _unpack_uint16(buffer[28:30])
        header_size = 30 + name_size + extra_size
        file_offset += header_size  # Start of file data
        try:
            fp.seek(file_offset)
        except OSError:
            raise ZipImportError(f"can't read Zip file: {archive!r}", path=archive)
        raw_data = fp.read(data_size)
        if len(raw_data) != data_size:
            raise OSError("zipimport: can't read data")

    if compress == 0:
        # data is not compressed
        return raw_data

    # Decompress with zlib
    try:
        decompress = _get_decompress_func()
    except Exception:
        raise ZipImportError("can't decompress data; zlib not available")
    return decompress(raw_data, -15)


# Lenient date/time comparison function. The precision of the mtime
# in the archive is lower than the mtime stored in a .pyc: we
# must allow a difference of at most one second.
def _eq_mtime(t1, t2):
    # dostime only stores even seconds, so be lenient
    return abs(t1 - t2) <= 1


# Given the contents of a .py[co] file, unmarshal the data
# and return the code object. Return None if it the magic word doesn't
# match, or if the recorded .py[co] metadata does not match the source,
# (we do this instead of raising an exception as we fall back
# to .py if available and we don't want to mask other errors).
def _unmarshal_code(self, pathname, fullpath, fullname, data):
    exc_details = {
        'name': fullname,
        'path': fullpath,
    }

    try:
        flags = _bootstrap_external._classify_pyc(data, fullname, exc_details)
    except ImportError:
        return None

    hash_based = flags & 0b1 != 0
    if hash_based:
        check_source = flags & 0b10 != 0
        if (_imp.check_hash_based_pycs != 'never' and
                (check_source or _imp.check_hash_based_pycs == 'always')):
            source_bytes = _get_pyc_source(self, fullpath)
            if source_bytes is not None:
                source_hash = _imp.source_hash(
                    _bootstrap_external._RAW_MAGIC_NUMBER,
                    source_bytes,
                )

                try:
                    _bootstrap_external._validate_hash_pyc(
                        data, source_hash, fullname, exc_details)
                except ImportError:
                    return None
    else:
        source_mtime, source_size = \
            _get_mtime_and_size_of_source(self, fullpath)

        if source_mtime:
            # We don't use _bootstrap_external._validate_timestamp_pyc
            # to allow for a more lenient timestamp check.
            if (not _eq_mtime(_unpack_uint32(data[8:12]), source_mtime) or
                    _unpack_uint32(data[12:16]) != source_size):
                _bootstrap._verbose_message(
                    f'bytecode is stale for {fullname!r}')
                return None

    code = marshal.loads(data[16:])
    if not isinstance(code, _code_type):
        raise TypeError(f'compiled module {pathname!r} is not a code object')
    return code

_code_type = type(_unmarshal_code.__code__)


# Replace any occurrences of '\r\n?' in the input string with '\n'.
# This converts DOS and Mac line endings to Unix line endings.
def _normalize_line_endings(source):
    source = source.replace(b'\r\n', b'\n')
    source = source.replace(b'\r', b'\n')
    return source

# Given a string buffer containing Python source code, compile it
# and return a code object.
def _compile_source(pathname, source):
    source = _normalize_line_endings(source)
    return compile(source, pathname, 'exec', dont_inherit=True)

# Convert the date/time values found in the Zip archive to a value
# that's compatible with the time stamp stored in .pyc files.
def _parse_dostime(d, t):
    return time.mktime((
        (d >> 9) + 1980,    # bits 9..15: year
        (d >> 5) & 0xF,     # bits 5..8: month
        d & 0x1F,           # bits 0..4: day
        t >> 11,            # bits 11..15: hours
        (t >> 5) & 0x3F,    # bits 8..10: minutes
        (t & 0x1F) * 2,     # bits 0..7: seconds / 2
        -1, -1, -1))

# Given a path to a .pyc file in the archive, return the
# modification time of the matching .py file and its size,
# or (0, 0) if no source is available.
def _get_mtime_and_size_of_source(self, path):
    try:
        # strip 'c' or 'o' from *.py[co]
        assert path[-1:] in ('c', 'o')
        path = path[:-1]
        toc_entry = self._files[path]
        # fetch the time stamp of the .py file for comparison
        # with an embedded pyc time stamp
        time = toc_entry[5]
        date = toc_entry[6]
        uncompressed_size = toc_entry[3]
        return _parse_dostime(date, time), uncompressed_size
    except (KeyError, IndexError, TypeError):
        return 0, 0


# Given a path to a .pyc file in the archive, return the
# contents of the matching .py file, or None if no source
# is available.
def _get_pyc_source(self, path):
    # strip 'c' or 'o' from *.py[co]
    assert path[-1:] in ('c', 'o')
    path = path[:-1]

    try:
        toc_entry = self._files[path]
    except KeyError:
        return None
    else:
        return _get_data(self.archive, toc_entry)


# Get the code object associated with the module specified by
# 'fullname'.
def _get_module_code(self, fullname):
    path = _get_module_path(self, fullname)
    for suffix, isbytecode, ispackage in _zip_searchorder:
        fullpath = path + suffix
        _bootstrap._verbose_message('trying {}{}{}', self.archive, path_sep, fullpath, verbosity=2)
        try:
            toc_entry = self._files[fullpath]
        except KeyError:
            pass
        else:
            modpath = toc_entry[0]
            data = _get_data(self.archive, toc_entry)
            if isbytecode:
                code = _unmarshal_code(self, modpath, fullpath, fullname, data)
            else:
                code = _compile_source(modpath, data)
            if code is None:
                # bad magic number or non-matching mtime
                # in byte code, try next
                continue
            modpath = toc_entry[0]
            return code, ispackage, modpath
    else:
        raise ZipImportError(f"can't find module {fullname!r}", name=fullname)


class _ZipImportResourceReader:
    """Private class used to support ZipImport.get_resource_reader().

    This class is allowed to reference all the innards and private parts of
    the zipimporter.
    """
    _registered = False

    def __init__(self, zipimporter, fullname):
        self.zipimporter = zipimporter
        self.fullname = fullname

    def open_resource(self, resource):
        fullname_as_path = self.fullname.replace('.', '/')
        path = f'{fullname_as_path}/{resource}'
        from io import BytesIO
        try:
            return BytesIO(self.zipimporter.get_data(path))
        except OSError:
            raise FileNotFoundError(path)

    def resource_path(self, resource):
        # All resources are in the zip file, so there is no path to the file.
        # Raising FileNotFoundError tells the higher level API to extract the
        # binary data and create a temporary file.
        raise FileNotFoundError

    def is_resource(self, name):
        # Maybe we could do better, but if we can get the data, it's a
        # resource.  Otherwise it isn't.
        fullname_as_path = self.fullname.replace('.', '/')
        path = f'{fullname_as_path}/{name}'
        try:
            self.zipimporter.get_data(path)
        except OSError:
            return False
        return True

    def contents(self):
        # This is a bit convoluted, because fullname will be a module path,
        # but _files is a list of file names relative to the top of the
        # archive's namespace.  We want to compare file paths to find all the
        # names of things inside the module represented by fullname.  So we
        # turn the module path of fullname into a file path relative to the
        # top of the archive, and then we iterate through _files looking for
        # names inside that "directory".
        from pathlib import Path
        fullname_path = Path(self.zipimporter.get_filename(self.fullname))
        relative_path = fullname_path.relative_to(self.zipimporter.archive)
        # Don't forget that fullname names a package, so its path will include
        # __init__.py, which we want to ignore.
        assert relative_path.name == '__init__.py'
        package_path = relative_path.parent
        subdirs_seen = set()
        for filename in self.zipimporter._files:
            try:
                relative = Path(filename).relative_to(package_path)
            except ValueError:
                continue
            # If the path of the file (which is relative to the top of the zip
            # namespace), relative to the package given when the resource
            # reader was created, has a parent, then it's a name in a
            # subdirectory and thus we skip it.
            parent_name = relative.parent.name
            if len(parent_name) == 0:
                yield relative.name
            elif parent_name not in subdirs_seen:
                subdirs_seen.add(parent_name)
                yield parent_name
tokenize.py000064400000062361151153537470006771 0ustar00"""Tokenization help for Python programs.

tokenize(readline) is a generator that breaks a stream of bytes into
Python tokens.  It decodes the bytes according to PEP-0263 for
determining source file encoding.

It accepts a readline-like method which is called repeatedly to get the
next line of input (or b"" for EOF).  It generates 5-tuples with these
members:

    the token type (see token.py)
    the token (a string)
    the starting (row, column) indices of the token (a 2-tuple of ints)
    the ending (row, column) indices of the token (a 2-tuple of ints)
    the original line (string)

It is designed to match the working of the Python tokenizer exactly, except
that it produces COMMENT tokens for comments and gives type OP for all
operators.  Additionally, all token lists start with an ENCODING token
which tells you which encoding was used to decode the bytes stream.
"""

__author__ = 'Ka-Ping Yee <ping@lfw.org>'
__credits__ = ('GvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, '
               'Skip Montanaro, Raymond Hettinger, Trent Nelson, '
               'Michael Foord')
from builtins import open as _builtin_open
from codecs import lookup, BOM_UTF8
import collections
from io import TextIOWrapper
import itertools as _itertools
import re
import sys
from token import *
from token import EXACT_TOKEN_TYPES

cookie_re = re.compile(r'^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)', re.ASCII)
blank_re = re.compile(br'^[ \t\f]*(?:[#\r\n]|$)', re.ASCII)

import token
__all__ = token.__all__ + ["tokenize", "generate_tokens", "detect_encoding",
                           "untokenize", "TokenInfo"]
del token

class TokenInfo(collections.namedtuple('TokenInfo', 'type string start end line')):
    def __repr__(self):
        annotated_type = '%d (%s)' % (self.type, tok_name[self.type])
        return ('TokenInfo(type=%s, string=%r, start=%r, end=%r, line=%r)' %
                self._replace(type=annotated_type))

    @property
    def exact_type(self):
        if self.type == OP and self.string in EXACT_TOKEN_TYPES:
            return EXACT_TOKEN_TYPES[self.string]
        else:
            return self.type

def group(*choices): return '(' + '|'.join(choices) + ')'
def any(*choices): return group(*choices) + '*'
def maybe(*choices): return group(*choices) + '?'

# Note: we use unicode matching for names ("\w") but ascii matching for
# number literals.
Whitespace = r'[ \f\t]*'
Comment = r'#[^\r\n]*'
Ignore = Whitespace + any(r'\\\r?\n' + Whitespace) + maybe(Comment)
Name = r'\w+'

Hexnumber = r'0[xX](?:_?[0-9a-fA-F])+'
Binnumber = r'0[bB](?:_?[01])+'
Octnumber = r'0[oO](?:_?[0-7])+'
Decnumber = r'(?:0(?:_?0)*|[1-9](?:_?[0-9])*)'
Intnumber = group(Hexnumber, Binnumber, Octnumber, Decnumber)
Exponent = r'[eE][-+]?[0-9](?:_?[0-9])*'
Pointfloat = group(r'[0-9](?:_?[0-9])*\.(?:[0-9](?:_?[0-9])*)?',
                   r'\.[0-9](?:_?[0-9])*') + maybe(Exponent)
Expfloat = r'[0-9](?:_?[0-9])*' + Exponent
Floatnumber = group(Pointfloat, Expfloat)
Imagnumber = group(r'[0-9](?:_?[0-9])*[jJ]', Floatnumber + r'[jJ]')
Number = group(Imagnumber, Floatnumber, Intnumber)

# Return the empty string, plus all of the valid string prefixes.
def _all_string_prefixes():
    # The valid string prefixes. Only contain the lower case versions,
    #  and don't contain any permutations (include 'fr', but not
    #  'rf'). The various permutations will be generated.
    _valid_string_prefixes = ['b', 'r', 'u', 'f', 'br', 'fr']
    # if we add binary f-strings, add: ['fb', 'fbr']
    result = {''}
    for prefix in _valid_string_prefixes:
        for t in _itertools.permutations(prefix):
            # create a list with upper and lower versions of each
            #  character
            for u in _itertools.product(*[(c, c.upper()) for c in t]):
                result.add(''.join(u))
    return result

def _compile(expr):
    return re.compile(expr, re.UNICODE)

# Note that since _all_string_prefixes includes the empty string,
#  StringPrefix can be the empty string (making it optional).
StringPrefix = group(*_all_string_prefixes())

# Tail end of ' string.
Single = r"[^'\\]*(?:\\.[^'\\]*)*'"
# Tail end of " string.
Double = r'[^"\\]*(?:\\.[^"\\]*)*"'
# Tail end of ''' string.
Single3 = r"[^'\\]*(?:(?:\\.|'(?!''))[^'\\]*)*'''"
# Tail end of """ string.
Double3 = r'[^"\\]*(?:(?:\\.|"(?!""))[^"\\]*)*"""'
Triple = group(StringPrefix + "'''", StringPrefix + '"""')
# Single-line ' or " string.
String = group(StringPrefix + r"'[^\n'\\]*(?:\\.[^\n'\\]*)*'",
               StringPrefix + r'"[^\n"\\]*(?:\\.[^\n"\\]*)*"')

# Sorting in reverse order puts the long operators before their prefixes.
# Otherwise if = came before ==, == would get recognized as two instances
# of =.
Special = group(*map(re.escape, sorted(EXACT_TOKEN_TYPES, reverse=True)))
Funny = group(r'\r?\n', Special)

PlainToken = group(Number, Funny, String, Name)
Token = Ignore + PlainToken

# First (or only) line of ' or " string.
ContStr = group(StringPrefix + r"'[^\n'\\]*(?:\\.[^\n'\\]*)*" +
                group("'", r'\\\r?\n'),
                StringPrefix + r'"[^\n"\\]*(?:\\.[^\n"\\]*)*' +
                group('"', r'\\\r?\n'))
PseudoExtras = group(r'\\\r?\n|\Z', Comment, Triple)
PseudoToken = Whitespace + group(PseudoExtras, Number, Funny, ContStr, Name)

# For a given string prefix plus quotes, endpats maps it to a regex
#  to match the remainder of that string. _prefix can be empty, for
#  a normal single or triple quoted string (with no prefix).
endpats = {}
for _prefix in _all_string_prefixes():
    endpats[_prefix + "'"] = Single
    endpats[_prefix + '"'] = Double
    endpats[_prefix + "'''"] = Single3
    endpats[_prefix + '"""'] = Double3

# A set of all of the single and triple quoted string prefixes,
#  including the opening quotes.
single_quoted = set()
triple_quoted = set()
for t in _all_string_prefixes():
    for u in (t + '"', t + "'"):
        single_quoted.add(u)
    for u in (t + '"""', t + "'''"):
        triple_quoted.add(u)

tabsize = 8

class TokenError(Exception): pass

class StopTokenizing(Exception): pass


class Untokenizer:

    def __init__(self):
        self.tokens = []
        self.prev_row = 1
        self.prev_col = 0
        self.encoding = None

    def add_whitespace(self, start):
        row, col = start
        if row < self.prev_row or row == self.prev_row and col < self.prev_col:
            raise ValueError("start ({},{}) precedes previous end ({},{})"
                             .format(row, col, self.prev_row, self.prev_col))
        row_offset = row - self.prev_row
        if row_offset:
            self.tokens.append("\\\n" * row_offset)
            self.prev_col = 0
        col_offset = col - self.prev_col
        if col_offset:
            self.tokens.append(" " * col_offset)

    def untokenize(self, iterable):
        it = iter(iterable)
        indents = []
        startline = False
        for t in it:
            if len(t) == 2:
                self.compat(t, it)
                break
            tok_type, token, start, end, line = t
            if tok_type == ENCODING:
                self.encoding = token
                continue
            if tok_type == ENDMARKER:
                break
            if tok_type == INDENT:
                indents.append(token)
                continue
            elif tok_type == DEDENT:
                indents.pop()
                self.prev_row, self.prev_col = end
                continue
            elif tok_type in (NEWLINE, NL):
                startline = True
            elif startline and indents:
                indent = indents[-1]
                if start[1] >= len(indent):
                    self.tokens.append(indent)
                    self.prev_col = len(indent)
                startline = False
            self.add_whitespace(start)
            self.tokens.append(token)
            self.prev_row, self.prev_col = end
            if tok_type in (NEWLINE, NL):
                self.prev_row += 1
                self.prev_col = 0
        return "".join(self.tokens)

    def compat(self, token, iterable):
        indents = []
        toks_append = self.tokens.append
        startline = token[0] in (NEWLINE, NL)
        prevstring = False

        for tok in _itertools.chain([token], iterable):
            toknum, tokval = tok[:2]
            if toknum == ENCODING:
                self.encoding = tokval
                continue

            if toknum in (NAME, NUMBER):
                tokval += ' '

            # Insert a space between two consecutive strings
            if toknum == STRING:
                if prevstring:
                    tokval = ' ' + tokval
                prevstring = True
            else:
                prevstring = False

            if toknum == INDENT:
                indents.append(tokval)
                continue
            elif toknum == DEDENT:
                indents.pop()
                continue
            elif toknum in (NEWLINE, NL):
                startline = True
            elif startline and indents:
                toks_append(indents[-1])
                startline = False
            toks_append(tokval)


def untokenize(iterable):
    """Transform tokens back into Python source code.
    It returns a bytes object, encoded using the ENCODING
    token, which is the first token sequence output by tokenize.

    Each element returned by the iterable must be a token sequence
    with at least two elements, a token number and token value.  If
    only two tokens are passed, the resulting output is poor.

    Round-trip invariant for full input:
        Untokenized source will match input source exactly

    Round-trip invariant for limited input:
        # Output bytes will tokenize back to the input
        t1 = [tok[:2] for tok in tokenize(f.readline)]
        newcode = untokenize(t1)
        readline = BytesIO(newcode).readline
        t2 = [tok[:2] for tok in tokenize(readline)]
        assert t1 == t2
    """
    ut = Untokenizer()
    out = ut.untokenize(iterable)
    if ut.encoding is not None:
        out = out.encode(ut.encoding)
    return out


def _get_normal_name(orig_enc):
    """Imitates get_normal_name in tokenizer.c."""
    # Only care about the first 12 characters.
    enc = orig_enc[:12].lower().replace("_", "-")
    if enc == "utf-8" or enc.startswith("utf-8-"):
        return "utf-8"
    if enc in ("latin-1", "iso-8859-1", "iso-latin-1") or \
       enc.startswith(("latin-1-", "iso-8859-1-", "iso-latin-1-")):
        return "iso-8859-1"
    return orig_enc

def detect_encoding(readline):
    """
    The detect_encoding() function is used to detect the encoding that should
    be used to decode a Python source file.  It requires one argument, readline,
    in the same way as the tokenize() generator.

    It will call readline a maximum of twice, and return the encoding used
    (as a string) and a list of any lines (left as bytes) it has read in.

    It detects the encoding from the presence of a utf-8 bom or an encoding
    cookie as specified in pep-0263.  If both a bom and a cookie are present,
    but disagree, a SyntaxError will be raised.  If the encoding cookie is an
    invalid charset, raise a SyntaxError.  Note that if a utf-8 bom is found,
    'utf-8-sig' is returned.

    If no encoding is specified, then the default of 'utf-8' will be returned.
    """
    try:
        filename = readline.__self__.name
    except AttributeError:
        filename = None
    bom_found = False
    encoding = None
    default = 'utf-8'
    def read_or_stop():
        try:
            return readline()
        except StopIteration:
            return b''

    def find_cookie(line):
        try:
            # Decode as UTF-8. Either the line is an encoding declaration,
            # in which case it should be pure ASCII, or it must be UTF-8
            # per default encoding.
            line_string = line.decode('utf-8')
        except UnicodeDecodeError:
            msg = "invalid or missing encoding declaration"
            if filename is not None:
                msg = '{} for {!r}'.format(msg, filename)
            raise SyntaxError(msg)

        match = cookie_re.match(line_string)
        if not match:
            return None
        encoding = _get_normal_name(match.group(1))
        try:
            codec = lookup(encoding)
        except LookupError:
            # This behaviour mimics the Python interpreter
            if filename is None:
                msg = "unknown encoding: " + encoding
            else:
                msg = "unknown encoding for {!r}: {}".format(filename,
                        encoding)
            raise SyntaxError(msg)

        if bom_found:
            if encoding != 'utf-8':
                # This behaviour mimics the Python interpreter
                if filename is None:
                    msg = 'encoding problem: utf-8'
                else:
                    msg = 'encoding problem for {!r}: utf-8'.format(filename)
                raise SyntaxError(msg)
            encoding += '-sig'
        return encoding

    first = read_or_stop()
    if first.startswith(BOM_UTF8):
        bom_found = True
        first = first[3:]
        default = 'utf-8-sig'
    if not first:
        return default, []

    encoding = find_cookie(first)
    if encoding:
        return encoding, [first]
    if not blank_re.match(first):
        return default, [first]

    second = read_or_stop()
    if not second:
        return default, [first]

    encoding = find_cookie(second)
    if encoding:
        return encoding, [first, second]

    return default, [first, second]


def open(filename):
    """Open a file in read only mode using the encoding detected by
    detect_encoding().
    """
    buffer = _builtin_open(filename, 'rb')
    try:
        encoding, lines = detect_encoding(buffer.readline)
        buffer.seek(0)
        text = TextIOWrapper(buffer, encoding, line_buffering=True)
        text.mode = 'r'
        return text
    except:
        buffer.close()
        raise


def tokenize(readline):
    """
    The tokenize() generator requires one argument, readline, which
    must be a callable object which provides the same interface as the
    readline() method of built-in file objects.  Each call to the function
    should return one line of input as bytes.  Alternatively, readline
    can be a callable function terminating with StopIteration:
        readline = open(myfile, 'rb').__next__  # Example of alternate readline

    The generator produces 5-tuples with these members: the token type; the
    token string; a 2-tuple (srow, scol) of ints specifying the row and
    column where the token begins in the source; a 2-tuple (erow, ecol) of
    ints specifying the row and column where the token ends in the source;
    and the line on which the token was found.  The line passed is the
    physical line.

    The first token sequence will always be an ENCODING token
    which tells you which encoding was used to decode the bytes stream.
    """
    encoding, consumed = detect_encoding(readline)
    empty = _itertools.repeat(b"")
    rl_gen = _itertools.chain(consumed, iter(readline, b""), empty)
    return _tokenize(rl_gen.__next__, encoding)


def _tokenize(readline, encoding):
    lnum = parenlev = continued = 0
    numchars = '0123456789'
    contstr, needcont = '', 0
    contline = None
    indents = [0]

    if encoding is not None:
        if encoding == "utf-8-sig":
            # BOM will already have been stripped.
            encoding = "utf-8"
        yield TokenInfo(ENCODING, encoding, (0, 0), (0, 0), '')
    last_line = b''
    line = b''
    while True:                                # loop over lines in stream
        try:
            # We capture the value of the line variable here because
            # readline uses the empty string '' to signal end of input,
            # hence `line` itself will always be overwritten at the end
            # of this loop.
            last_line = line
            line = readline()
        except StopIteration:
            line = b''

        if encoding is not None:
            line = line.decode(encoding)
        lnum += 1
        pos, max = 0, len(line)

        if contstr:                            # continued string
            if not line:
                raise TokenError("EOF in multi-line string", strstart)
            endmatch = endprog.match(line)
            if endmatch:
                pos = end = endmatch.end(0)
                yield TokenInfo(STRING, contstr + line[:end],
                       strstart, (lnum, end), contline + line)
                contstr, needcont = '', 0
                contline = None
            elif needcont and line[-2:] != '\\\n' and line[-3:] != '\\\r\n':
                yield TokenInfo(ERRORTOKEN, contstr + line,
                           strstart, (lnum, len(line)), contline)
                contstr = ''
                contline = None
                continue
            else:
                contstr = contstr + line
                contline = contline + line
                continue

        elif parenlev == 0 and not continued:  # new statement
            if not line: break
            column = 0
            while pos < max:                   # measure leading whitespace
                if line[pos] == ' ':
                    column += 1
                elif line[pos] == '\t':
                    column = (column//tabsize + 1)*tabsize
                elif line[pos] == '\f':
                    column = 0
                else:
                    break
                pos += 1
            if pos == max:
                break

            if line[pos] in '#\r\n':           # skip comments or blank lines
                if line[pos] == '#':
                    comment_token = line[pos:].rstrip('\r\n')
                    yield TokenInfo(COMMENT, comment_token,
                           (lnum, pos), (lnum, pos + len(comment_token)), line)
                    pos += len(comment_token)

                yield TokenInfo(NL, line[pos:],
                           (lnum, pos), (lnum, len(line)), line)
                continue

            if column > indents[-1]:           # count indents or dedents
                indents.append(column)
                yield TokenInfo(INDENT, line[:pos], (lnum, 0), (lnum, pos), line)
            while column < indents[-1]:
                if column not in indents:
                    raise IndentationError(
                        "unindent does not match any outer indentation level",
                        ("<tokenize>", lnum, pos, line))
                indents = indents[:-1]

                yield TokenInfo(DEDENT, '', (lnum, pos), (lnum, pos), line)

        else:                                  # continued statement
            if not line:
                raise TokenError("EOF in multi-line statement", (lnum, 0))
            continued = 0

        while pos < max:
            pseudomatch = _compile(PseudoToken).match(line, pos)
            if pseudomatch:                                # scan for tokens
                start, end = pseudomatch.span(1)
                spos, epos, pos = (lnum, start), (lnum, end), end
                if start == end:
                    continue
                token, initial = line[start:end], line[start]

                if (initial in numchars or                 # ordinary number
                    (initial == '.' and token != '.' and token != '...')):
                    yield TokenInfo(NUMBER, token, spos, epos, line)
                elif initial in '\r\n':
                    if parenlev > 0:
                        yield TokenInfo(NL, token, spos, epos, line)
                    else:
                        yield TokenInfo(NEWLINE, token, spos, epos, line)

                elif initial == '#':
                    assert not token.endswith("\n")
                    yield TokenInfo(COMMENT, token, spos, epos, line)

                elif token in triple_quoted:
                    endprog = _compile(endpats[token])
                    endmatch = endprog.match(line, pos)
                    if endmatch:                           # all on one line
                        pos = endmatch.end(0)
                        token = line[start:pos]
                        yield TokenInfo(STRING, token, spos, (lnum, pos), line)
                    else:
                        strstart = (lnum, start)           # multiple lines
                        contstr = line[start:]
                        contline = line
                        break

                # Check up to the first 3 chars of the token to see if
                #  they're in the single_quoted set. If so, they start
                #  a string.
                # We're using the first 3, because we're looking for
                #  "rb'" (for example) at the start of the token. If
                #  we switch to longer prefixes, this needs to be
                #  adjusted.
                # Note that initial == token[:1].
                # Also note that single quote checking must come after
                #  triple quote checking (above).
                elif (initial in single_quoted or
                      token[:2] in single_quoted or
                      token[:3] in single_quoted):
                    if token[-1] == '\n':                  # continued string
                        strstart = (lnum, start)
                        # Again, using the first 3 chars of the
                        #  token. This is looking for the matching end
                        #  regex for the correct type of quote
                        #  character. So it's really looking for
                        #  endpats["'"] or endpats['"'], by trying to
                        #  skip string prefix characters, if any.
                        endprog = _compile(endpats.get(initial) or
                                           endpats.get(token[1]) or
                                           endpats.get(token[2]))
                        contstr, needcont = line[start:], 1
                        contline = line
                        break
                    else:                                  # ordinary string
                        yield TokenInfo(STRING, token, spos, epos, line)

                elif initial.isidentifier():               # ordinary name
                    yield TokenInfo(NAME, token, spos, epos, line)
                elif initial == '\\':                      # continued stmt
                    continued = 1
                else:
                    if initial in '([{':
                        parenlev += 1
                    elif initial in ')]}':
                        parenlev -= 1
                    yield TokenInfo(OP, token, spos, epos, line)
            else:
                yield TokenInfo(ERRORTOKEN, line[pos],
                           (lnum, pos), (lnum, pos+1), line)
                pos += 1

    # Add an implicit NEWLINE if the input doesn't end in one
    if last_line and last_line[-1] not in '\r\n':
        yield TokenInfo(NEWLINE, '', (lnum - 1, len(last_line)), (lnum - 1, len(last_line) + 1), '')
    for indent in indents[1:]:                 # pop remaining indent levels
        yield TokenInfo(DEDENT, '', (lnum, 0), (lnum, 0), '')
    yield TokenInfo(ENDMARKER, '', (lnum, 0), (lnum, 0), '')


def generate_tokens(readline):
    """Tokenize a source reading Python code as unicode strings.

    This has the same API as tokenize(), except that it expects the *readline*
    callable to return str objects instead of bytes.
    """
    return _tokenize(readline, None)

def main():
    import argparse

    # Helper error handling routines
    def perror(message):
        sys.stderr.write(message)
        sys.stderr.write('\n')

    def error(message, filename=None, location=None):
        if location:
            args = (filename,) + location + (message,)
            perror("%s:%d:%d: error: %s" % args)
        elif filename:
            perror("%s: error: %s" % (filename, message))
        else:
            perror("error: %s" % message)
        sys.exit(1)

    # Parse the arguments and options
    parser = argparse.ArgumentParser(prog='python -m tokenize')
    parser.add_argument(dest='filename', nargs='?',
                        metavar='filename.py',
                        help='the file to tokenize; defaults to stdin')
    parser.add_argument('-e', '--exact', dest='exact', action='store_true',
                        help='display token names using the exact type')
    args = parser.parse_args()

    try:
        # Tokenize the input
        if args.filename:
            filename = args.filename
            with _builtin_open(filename, 'rb') as f:
                tokens = list(tokenize(f.readline))
        else:
            filename = "<stdin>"
            tokens = _tokenize(sys.stdin.readline, None)

        # Output the tokenization
        for token in tokens:
            token_type = token.type
            if args.exact:
                token_type = token.exact_type
            token_range = "%d,%d-%d,%d:" % (token.start + token.end)
            print("%-20s%-15s%-15r" %
                  (token_range, tok_name[token_type], token.string))
    except IndentationError as err:
        line, column = err.args[1][1:3]
        error(err.args[0], filename, (line, column))
    except TokenError as err:
        line, column = err.args[1]
        error(err.args[0], filename, (line, column))
    except SyntaxError as err:
        error(err, filename)
    except OSError as err:
        error(err)
    except KeyboardInterrupt:
        print("interrupted\n")
    except Exception as err:
        perror("unexpected error: %s" % err)
        raise

if __name__ == "__main__":
    main()
imaplib.py000064400000150546151153537470006561 0ustar00"""IMAP4 client.

Based on RFC 2060.

Public class:           IMAP4
Public variable:        Debug
Public functions:       Internaldate2tuple
                        Int2AP
                        ParseFlags
                        Time2Internaldate
"""

# Author: Piers Lauder <piers@cs.su.oz.au> December 1997.
#
# Authentication code contributed by Donn Cave <donn@u.washington.edu> June 1998.
# String method conversion by ESR, February 2001.
# GET/SETACL contributed by Anthony Baxter <anthony@interlink.com.au> April 2001.
# IMAP4_SSL contributed by Tino Lange <Tino.Lange@isg.de> March 2002.
# GET/SETQUOTA contributed by Andreas Zeidler <az@kreativkombinat.de> June 2002.
# PROXYAUTH contributed by Rick Holbert <holbert.13@osu.edu> November 2002.
# GET/SETANNOTATION contributed by Tomas Lindroos <skitta@abo.fi> June 2005.

__version__ = "2.58"

import binascii, errno, random, re, socket, subprocess, sys, time, calendar
from datetime import datetime, timezone, timedelta
from io import DEFAULT_BUFFER_SIZE

try:
    import ssl
    HAVE_SSL = True
except ImportError:
    HAVE_SSL = False

__all__ = ["IMAP4", "IMAP4_stream", "Internaldate2tuple",
           "Int2AP", "ParseFlags", "Time2Internaldate"]

#       Globals

CRLF = b'\r\n'
Debug = 0
IMAP4_PORT = 143
IMAP4_SSL_PORT = 993
AllowedVersions = ('IMAP4REV1', 'IMAP4')        # Most recent first

# Maximal line length when calling readline(). This is to prevent
# reading arbitrary length lines. RFC 3501 and 2060 (IMAP 4rev1)
# don't specify a line length. RFC 2683 suggests limiting client
# command lines to 1000 octets and that servers should be prepared
# to accept command lines up to 8000 octets, so we used to use 10K here.
# In the modern world (eg: gmail) the response to, for example, a
# search command can be quite large, so we now use 1M.
_MAXLINE = 1000000


#       Commands

Commands = {
        # name            valid states
        'APPEND':       ('AUTH', 'SELECTED'),
        'AUTHENTICATE': ('NONAUTH',),
        'CAPABILITY':   ('NONAUTH', 'AUTH', 'SELECTED', 'LOGOUT'),
        'CHECK':        ('SELECTED',),
        'CLOSE':        ('SELECTED',),
        'COPY':         ('SELECTED',),
        'CREATE':       ('AUTH', 'SELECTED'),
        'DELETE':       ('AUTH', 'SELECTED'),
        'DELETEACL':    ('AUTH', 'SELECTED'),
        'ENABLE':       ('AUTH', ),
        'EXAMINE':      ('AUTH', 'SELECTED'),
        'EXPUNGE':      ('SELECTED',),
        'FETCH':        ('SELECTED',),
        'GETACL':       ('AUTH', 'SELECTED'),
        'GETANNOTATION':('AUTH', 'SELECTED'),
        'GETQUOTA':     ('AUTH', 'SELECTED'),
        'GETQUOTAROOT': ('AUTH', 'SELECTED'),
        'MYRIGHTS':     ('AUTH', 'SELECTED'),
        'LIST':         ('AUTH', 'SELECTED'),
        'LOGIN':        ('NONAUTH',),
        'LOGOUT':       ('NONAUTH', 'AUTH', 'SELECTED', 'LOGOUT'),
        'LSUB':         ('AUTH', 'SELECTED'),
        'MOVE':         ('SELECTED',),
        'NAMESPACE':    ('AUTH', 'SELECTED'),
        'NOOP':         ('NONAUTH', 'AUTH', 'SELECTED', 'LOGOUT'),
        'PARTIAL':      ('SELECTED',),                                  # NB: obsolete
        'PROXYAUTH':    ('AUTH',),
        'RENAME':       ('AUTH', 'SELECTED'),
        'SEARCH':       ('SELECTED',),
        'SELECT':       ('AUTH', 'SELECTED'),
        'SETACL':       ('AUTH', 'SELECTED'),
        'SETANNOTATION':('AUTH', 'SELECTED'),
        'SETQUOTA':     ('AUTH', 'SELECTED'),
        'SORT':         ('SELECTED',),
        'STARTTLS':     ('NONAUTH',),
        'STATUS':       ('AUTH', 'SELECTED'),
        'STORE':        ('SELECTED',),
        'SUBSCRIBE':    ('AUTH', 'SELECTED'),
        'THREAD':       ('SELECTED',),
        'UID':          ('SELECTED',),
        'UNSUBSCRIBE':  ('AUTH', 'SELECTED'),
        }

#       Patterns to match server responses

Continuation = re.compile(br'\+( (?P<data>.*))?')
Flags = re.compile(br'.*FLAGS \((?P<flags>[^\)]*)\)')
InternalDate = re.compile(br'.*INTERNALDATE "'
        br'(?P<day>[ 0123][0-9])-(?P<mon>[A-Z][a-z][a-z])-(?P<year>[0-9][0-9][0-9][0-9])'
        br' (?P<hour>[0-9][0-9]):(?P<min>[0-9][0-9]):(?P<sec>[0-9][0-9])'
        br' (?P<zonen>[-+])(?P<zoneh>[0-9][0-9])(?P<zonem>[0-9][0-9])'
        br'"')
# Literal is no longer used; kept for backward compatibility.
Literal = re.compile(br'.*{(?P<size>\d+)}$', re.ASCII)
MapCRLF = re.compile(br'\r\n|\r|\n')
# We no longer exclude the ']' character from the data portion of the response
# code, even though it violates the RFC.  Popular IMAP servers such as Gmail
# allow flags with ']', and there are programs (including imaplib!) that can
# produce them.  The problem with this is if the 'text' portion of the response
# includes a ']' we'll parse the response wrong (which is the point of the RFC
# restriction).  However, that seems less likely to be a problem in practice
# than being unable to correctly parse flags that include ']' chars, which
# was reported as a real-world problem in issue #21815.
Response_code = re.compile(br'\[(?P<type>[A-Z-]+)( (?P<data>.*))?\]')
Untagged_response = re.compile(br'\* (?P<type>[A-Z-]+)( (?P<data>.*))?')
# Untagged_status is no longer used; kept for backward compatibility
Untagged_status = re.compile(
    br'\* (?P<data>\d+) (?P<type>[A-Z-]+)( (?P<data2>.*))?', re.ASCII)
# We compile these in _mode_xxx.
_Literal = br'.*{(?P<size>\d+)}$'
_Untagged_status = br'\* (?P<data>\d+) (?P<type>[A-Z-]+)( (?P<data2>.*))?'



class IMAP4:

    r"""IMAP4 client class.

    Instantiate with: IMAP4([host[, port]])

            host - host's name (default: localhost);
            port - port number (default: standard IMAP4 port).

    All IMAP4rev1 commands are supported by methods of the same
    name (in lower-case).

    All arguments to commands are converted to strings, except for
    AUTHENTICATE, and the last argument to APPEND which is passed as
    an IMAP4 literal.  If necessary (the string contains any
    non-printing characters or white-space and isn't enclosed with
    either parentheses or double quotes) each string is quoted.
    However, the 'password' argument to the LOGIN command is always
    quoted.  If you want to avoid having an argument string quoted
    (eg: the 'flags' argument to STORE) then enclose the string in
    parentheses (eg: "(\Deleted)").

    Each command returns a tuple: (type, [data, ...]) where 'type'
    is usually 'OK' or 'NO', and 'data' is either the text from the
    tagged response, or untagged results from command. Each 'data'
    is either a string, or a tuple. If a tuple, then the first part
    is the header of the response, and the second part contains
    the data (ie: 'literal' value).

    Errors raise the exception class <instance>.error("<reason>").
    IMAP4 server errors raise <instance>.abort("<reason>"),
    which is a sub-class of 'error'. Mailbox status changes
    from READ-WRITE to READ-ONLY raise the exception class
    <instance>.readonly("<reason>"), which is a sub-class of 'abort'.

    "error" exceptions imply a program error.
    "abort" exceptions imply the connection should be reset, and
            the command re-tried.
    "readonly" exceptions imply the command should be re-tried.

    Note: to use this module, you must read the RFCs pertaining to the
    IMAP4 protocol, as the semantics of the arguments to each IMAP4
    command are left to the invoker, not to mention the results. Also,
    most IMAP servers implement a sub-set of the commands available here.
    """

    class error(Exception): pass    # Logical errors - debug required
    class abort(error): pass        # Service errors - close and retry
    class readonly(abort): pass     # Mailbox status changed to READ-ONLY

    def __init__(self, host='', port=IMAP4_PORT):
        self.debug = Debug
        self.state = 'LOGOUT'
        self.literal = None             # A literal argument to a command
        self.tagged_commands = {}       # Tagged commands awaiting response
        self.untagged_responses = {}    # {typ: [data, ...], ...}
        self.continuation_response = '' # Last continuation response
        self.is_readonly = False        # READ-ONLY desired state
        self.tagnum = 0
        self._tls_established = False
        self._mode_ascii()

        # Open socket to server.

        self.open(host, port)

        try:
            self._connect()
        except Exception:
            try:
                self.shutdown()
            except OSError:
                pass
            raise

    def _mode_ascii(self):
        self.utf8_enabled = False
        self._encoding = 'ascii'
        self.Literal = re.compile(_Literal, re.ASCII)
        self.Untagged_status = re.compile(_Untagged_status, re.ASCII)


    def _mode_utf8(self):
        self.utf8_enabled = True
        self._encoding = 'utf-8'
        self.Literal = re.compile(_Literal)
        self.Untagged_status = re.compile(_Untagged_status)


    def _connect(self):
        # Create unique tag for this session,
        # and compile tagged response matcher.

        self.tagpre = Int2AP(random.randint(4096, 65535))
        self.tagre = re.compile(br'(?P<tag>'
                        + self.tagpre
                        + br'\d+) (?P<type>[A-Z]+) (?P<data>.*)', re.ASCII)

        # Get server welcome message,
        # request and store CAPABILITY response.

        if __debug__:
            self._cmd_log_len = 10
            self._cmd_log_idx = 0
            self._cmd_log = {}           # Last `_cmd_log_len' interactions
            if self.debug >= 1:
                self._mesg('imaplib version %s' % __version__)
                self._mesg('new IMAP4 connection, tag=%s' % self.tagpre)

        self.welcome = self._get_response()
        if 'PREAUTH' in self.untagged_responses:
            self.state = 'AUTH'
        elif 'OK' in self.untagged_responses:
            self.state = 'NONAUTH'
        else:
            raise self.error(self.welcome)

        self._get_capabilities()
        if __debug__:
            if self.debug >= 3:
                self._mesg('CAPABILITIES: %r' % (self.capabilities,))

        for version in AllowedVersions:
            if not version in self.capabilities:
                continue
            self.PROTOCOL_VERSION = version
            return

        raise self.error('server not IMAP4 compliant')


    def __getattr__(self, attr):
        #       Allow UPPERCASE variants of IMAP4 command methods.
        if attr in Commands:
            return getattr(self, attr.lower())
        raise AttributeError("Unknown IMAP4 command: '%s'" % attr)

    def __enter__(self):
        return self

    def __exit__(self, *args):
        if self.state == "LOGOUT":
            return

        try:
            self.logout()
        except OSError:
            pass


    #       Overridable methods


    def _create_socket(self):
        # Default value of IMAP4.host is '', but socket.getaddrinfo()
        # (which is used by socket.create_connection()) expects None
        # as a default value for host.
        host = None if not self.host else self.host
        sys.audit("imaplib.open", self, self.host, self.port)
        return socket.create_connection((host, self.port))

    def open(self, host = '', port = IMAP4_PORT):
        """Setup connection to remote server on "host:port"
            (default: localhost:standard IMAP4 port).
        This connection will be used by the routines:
            read, readline, send, shutdown.
        """
        self.host = host
        self.port = port
        self.sock = self._create_socket()
        self.file = self.sock.makefile('rb')


    def read(self, size):
        """Read 'size' bytes from remote."""
        return self.file.read(size)


    def readline(self):
        """Read line from remote."""
        line = self.file.readline(_MAXLINE + 1)
        if len(line) > _MAXLINE:
            raise self.error("got more than %d bytes" % _MAXLINE)
        return line


    def send(self, data):
        """Send data to remote."""
        sys.audit("imaplib.send", self, data)
        self.sock.sendall(data)


    def shutdown(self):
        """Close I/O established in "open"."""
        self.file.close()
        try:
            self.sock.shutdown(socket.SHUT_RDWR)
        except OSError as exc:
            # The server might already have closed the connection.
            # On Windows, this may result in WSAEINVAL (error 10022):
            # An invalid operation was attempted.
            if (exc.errno != errno.ENOTCONN
               and getattr(exc, 'winerror', 0) != 10022):
                raise
        finally:
            self.sock.close()


    def socket(self):
        """Return socket instance used to connect to IMAP4 server.

        socket = <instance>.socket()
        """
        return self.sock



    #       Utility methods


    def recent(self):
        """Return most recent 'RECENT' responses if any exist,
        else prompt server for an update using the 'NOOP' command.

        (typ, [data]) = <instance>.recent()

        'data' is None if no new messages,
        else list of RECENT responses, most recent last.
        """
        name = 'RECENT'
        typ, dat = self._untagged_response('OK', [None], name)
        if dat[-1]:
            return typ, dat
        typ, dat = self.noop()  # Prod server for response
        return self._untagged_response(typ, dat, name)


    def response(self, code):
        """Return data for response 'code' if received, or None.

        Old value for response 'code' is cleared.

        (code, [data]) = <instance>.response(code)
        """
        return self._untagged_response(code, [None], code.upper())



    #       IMAP4 commands


    def append(self, mailbox, flags, date_time, message):
        """Append message to named mailbox.

        (typ, [data]) = <instance>.append(mailbox, flags, date_time, message)

                All args except `message' can be None.
        """
        name = 'APPEND'
        if not mailbox:
            mailbox = 'INBOX'
        if flags:
            if (flags[0],flags[-1]) != ('(',')'):
                flags = '(%s)' % flags
        else:
            flags = None
        if date_time:
            date_time = Time2Internaldate(date_time)
        else:
            date_time = None
        literal = MapCRLF.sub(CRLF, message)
        if self.utf8_enabled:
            literal = b'UTF8 (' + literal + b')'
        self.literal = literal
        return self._simple_command(name, mailbox, flags, date_time)


    def authenticate(self, mechanism, authobject):
        """Authenticate command - requires response processing.

        'mechanism' specifies which authentication mechanism is to
        be used - it must appear in <instance>.capabilities in the
        form AUTH=<mechanism>.

        'authobject' must be a callable object:

                data = authobject(response)

        It will be called to process server continuation responses; the
        response argument it is passed will be a bytes.  It should return bytes
        data that will be base64 encoded and sent to the server.  It should
        return None if the client abort response '*' should be sent instead.
        """
        mech = mechanism.upper()
        # XXX: shouldn't this code be removed, not commented out?
        #cap = 'AUTH=%s' % mech
        #if not cap in self.capabilities:       # Let the server decide!
        #    raise self.error("Server doesn't allow %s authentication." % mech)
        self.literal = _Authenticator(authobject).process
        typ, dat = self._simple_command('AUTHENTICATE', mech)
        if typ != 'OK':
            raise self.error(dat[-1].decode('utf-8', 'replace'))
        self.state = 'AUTH'
        return typ, dat


    def capability(self):
        """(typ, [data]) = <instance>.capability()
        Fetch capabilities list from server."""

        name = 'CAPABILITY'
        typ, dat = self._simple_command(name)
        return self._untagged_response(typ, dat, name)


    def check(self):
        """Checkpoint mailbox on server.

        (typ, [data]) = <instance>.check()
        """
        return self._simple_command('CHECK')


    def close(self):
        """Close currently selected mailbox.

        Deleted messages are removed from writable mailbox.
        This is the recommended command before 'LOGOUT'.

        (typ, [data]) = <instance>.close()
        """
        try:
            typ, dat = self._simple_command('CLOSE')
        finally:
            self.state = 'AUTH'
        return typ, dat


    def copy(self, message_set, new_mailbox):
        """Copy 'message_set' messages onto end of 'new_mailbox'.

        (typ, [data]) = <instance>.copy(message_set, new_mailbox)
        """
        return self._simple_command('COPY', message_set, new_mailbox)


    def create(self, mailbox):
        """Create new mailbox.

        (typ, [data]) = <instance>.create(mailbox)
        """
        return self._simple_command('CREATE', mailbox)


    def delete(self, mailbox):
        """Delete old mailbox.

        (typ, [data]) = <instance>.delete(mailbox)
        """
        return self._simple_command('DELETE', mailbox)

    def deleteacl(self, mailbox, who):
        """Delete the ACLs (remove any rights) set for who on mailbox.

        (typ, [data]) = <instance>.deleteacl(mailbox, who)
        """
        return self._simple_command('DELETEACL', mailbox, who)

    def enable(self, capability):
        """Send an RFC5161 enable string to the server.

        (typ, [data]) = <intance>.enable(capability)
        """
        if 'ENABLE' not in self.capabilities:
            raise IMAP4.error("Server does not support ENABLE")
        typ, data = self._simple_command('ENABLE', capability)
        if typ == 'OK' and 'UTF8=ACCEPT' in capability.upper():
            self._mode_utf8()
        return typ, data

    def expunge(self):
        """Permanently remove deleted items from selected mailbox.

        Generates 'EXPUNGE' response for each deleted message.

        (typ, [data]) = <instance>.expunge()

        'data' is list of 'EXPUNGE'd message numbers in order received.
        """
        name = 'EXPUNGE'
        typ, dat = self._simple_command(name)
        return self._untagged_response(typ, dat, name)


    def fetch(self, message_set, message_parts):
        """Fetch (parts of) messages.

        (typ, [data, ...]) = <instance>.fetch(message_set, message_parts)

        'message_parts' should be a string of selected parts
        enclosed in parentheses, eg: "(UID BODY[TEXT])".

        'data' are tuples of message part envelope and data.
        """
        name = 'FETCH'
        typ, dat = self._simple_command(name, message_set, message_parts)
        return self._untagged_response(typ, dat, name)


    def getacl(self, mailbox):
        """Get the ACLs for a mailbox.

        (typ, [data]) = <instance>.getacl(mailbox)
        """
        typ, dat = self._simple_command('GETACL', mailbox)
        return self._untagged_response(typ, dat, 'ACL')


    def getannotation(self, mailbox, entry, attribute):
        """(typ, [data]) = <instance>.getannotation(mailbox, entry, attribute)
        Retrieve ANNOTATIONs."""

        typ, dat = self._simple_command('GETANNOTATION', mailbox, entry, attribute)
        return self._untagged_response(typ, dat, 'ANNOTATION')


    def getquota(self, root):
        """Get the quota root's resource usage and limits.

        Part of the IMAP4 QUOTA extension defined in rfc2087.

        (typ, [data]) = <instance>.getquota(root)
        """
        typ, dat = self._simple_command('GETQUOTA', root)
        return self._untagged_response(typ, dat, 'QUOTA')


    def getquotaroot(self, mailbox):
        """Get the list of quota roots for the named mailbox.

        (typ, [[QUOTAROOT responses...], [QUOTA responses]]) = <instance>.getquotaroot(mailbox)
        """
        typ, dat = self._simple_command('GETQUOTAROOT', mailbox)
        typ, quota = self._untagged_response(typ, dat, 'QUOTA')
        typ, quotaroot = self._untagged_response(typ, dat, 'QUOTAROOT')
        return typ, [quotaroot, quota]


    def list(self, directory='""', pattern='*'):
        """List mailbox names in directory matching pattern.

        (typ, [data]) = <instance>.list(directory='""', pattern='*')

        'data' is list of LIST responses.
        """
        name = 'LIST'
        typ, dat = self._simple_command(name, directory, pattern)
        return self._untagged_response(typ, dat, name)


    def login(self, user, password):
        """Identify client using plaintext password.

        (typ, [data]) = <instance>.login(user, password)

        NB: 'password' will be quoted.
        """
        typ, dat = self._simple_command('LOGIN', user, self._quote(password))
        if typ != 'OK':
            raise self.error(dat[-1])
        self.state = 'AUTH'
        return typ, dat


    def login_cram_md5(self, user, password):
        """ Force use of CRAM-MD5 authentication.

        (typ, [data]) = <instance>.login_cram_md5(user, password)
        """
        self.user, self.password = user, password
        return self.authenticate('CRAM-MD5', self._CRAM_MD5_AUTH)


    def _CRAM_MD5_AUTH(self, challenge):
        """ Authobject to use with CRAM-MD5 authentication. """
        import hmac
        pwd = (self.password.encode('utf-8') if isinstance(self.password, str)
                                             else self.password)
        return self.user + " " + hmac.HMAC(pwd, challenge, 'md5').hexdigest()


    def logout(self):
        """Shutdown connection to server.

        (typ, [data]) = <instance>.logout()

        Returns server 'BYE' response.
        """
        self.state = 'LOGOUT'
        typ, dat = self._simple_command('LOGOUT')
        self.shutdown()
        return typ, dat


    def lsub(self, directory='""', pattern='*'):
        """List 'subscribed' mailbox names in directory matching pattern.

        (typ, [data, ...]) = <instance>.lsub(directory='""', pattern='*')

        'data' are tuples of message part envelope and data.
        """
        name = 'LSUB'
        typ, dat = self._simple_command(name, directory, pattern)
        return self._untagged_response(typ, dat, name)

    def myrights(self, mailbox):
        """Show my ACLs for a mailbox (i.e. the rights that I have on mailbox).

        (typ, [data]) = <instance>.myrights(mailbox)
        """
        typ,dat = self._simple_command('MYRIGHTS', mailbox)
        return self._untagged_response(typ, dat, 'MYRIGHTS')

    def namespace(self):
        """ Returns IMAP namespaces ala rfc2342

        (typ, [data, ...]) = <instance>.namespace()
        """
        name = 'NAMESPACE'
        typ, dat = self._simple_command(name)
        return self._untagged_response(typ, dat, name)


    def noop(self):
        """Send NOOP command.

        (typ, [data]) = <instance>.noop()
        """
        if __debug__:
            if self.debug >= 3:
                self._dump_ur(self.untagged_responses)
        return self._simple_command('NOOP')


    def partial(self, message_num, message_part, start, length):
        """Fetch truncated part of a message.

        (typ, [data, ...]) = <instance>.partial(message_num, message_part, start, length)

        'data' is tuple of message part envelope and data.
        """
        name = 'PARTIAL'
        typ, dat = self._simple_command(name, message_num, message_part, start, length)
        return self._untagged_response(typ, dat, 'FETCH')


    def proxyauth(self, user):
        """Assume authentication as "user".

        Allows an authorised administrator to proxy into any user's
        mailbox.

        (typ, [data]) = <instance>.proxyauth(user)
        """

        name = 'PROXYAUTH'
        return self._simple_command('PROXYAUTH', user)


    def rename(self, oldmailbox, newmailbox):
        """Rename old mailbox name to new.

        (typ, [data]) = <instance>.rename(oldmailbox, newmailbox)
        """
        return self._simple_command('RENAME', oldmailbox, newmailbox)


    def search(self, charset, *criteria):
        """Search mailbox for matching messages.

        (typ, [data]) = <instance>.search(charset, criterion, ...)

        'data' is space separated list of matching message numbers.
        If UTF8 is enabled, charset MUST be None.
        """
        name = 'SEARCH'
        if charset:
            if self.utf8_enabled:
                raise IMAP4.error("Non-None charset not valid in UTF8 mode")
            typ, dat = self._simple_command(name, 'CHARSET', charset, *criteria)
        else:
            typ, dat = self._simple_command(name, *criteria)
        return self._untagged_response(typ, dat, name)


    def select(self, mailbox='INBOX', readonly=False):
        """Select a mailbox.

        Flush all untagged responses.

        (typ, [data]) = <instance>.select(mailbox='INBOX', readonly=False)

        'data' is count of messages in mailbox ('EXISTS' response).

        Mandated responses are ('FLAGS', 'EXISTS', 'RECENT', 'UIDVALIDITY'), so
        other responses should be obtained via <instance>.response('FLAGS') etc.
        """
        self.untagged_responses = {}    # Flush old responses.
        self.is_readonly = readonly
        if readonly:
            name = 'EXAMINE'
        else:
            name = 'SELECT'
        typ, dat = self._simple_command(name, mailbox)
        if typ != 'OK':
            self.state = 'AUTH'     # Might have been 'SELECTED'
            return typ, dat
        self.state = 'SELECTED'
        if 'READ-ONLY' in self.untagged_responses \
                and not readonly:
            if __debug__:
                if self.debug >= 1:
                    self._dump_ur(self.untagged_responses)
            raise self.readonly('%s is not writable' % mailbox)
        return typ, self.untagged_responses.get('EXISTS', [None])


    def setacl(self, mailbox, who, what):
        """Set a mailbox acl.

        (typ, [data]) = <instance>.setacl(mailbox, who, what)
        """
        return self._simple_command('SETACL', mailbox, who, what)


    def setannotation(self, *args):
        """(typ, [data]) = <instance>.setannotation(mailbox[, entry, attribute]+)
        Set ANNOTATIONs."""

        typ, dat = self._simple_command('SETANNOTATION', *args)
        return self._untagged_response(typ, dat, 'ANNOTATION')


    def setquota(self, root, limits):
        """Set the quota root's resource limits.

        (typ, [data]) = <instance>.setquota(root, limits)
        """
        typ, dat = self._simple_command('SETQUOTA', root, limits)
        return self._untagged_response(typ, dat, 'QUOTA')


    def sort(self, sort_criteria, charset, *search_criteria):
        """IMAP4rev1 extension SORT command.

        (typ, [data]) = <instance>.sort(sort_criteria, charset, search_criteria, ...)
        """
        name = 'SORT'
        #if not name in self.capabilities:      # Let the server decide!
        #       raise self.error('unimplemented extension command: %s' % name)
        if (sort_criteria[0],sort_criteria[-1]) != ('(',')'):
            sort_criteria = '(%s)' % sort_criteria
        typ, dat = self._simple_command(name, sort_criteria, charset, *search_criteria)
        return self._untagged_response(typ, dat, name)


    def starttls(self, ssl_context=None):
        name = 'STARTTLS'
        if not HAVE_SSL:
            raise self.error('SSL support missing')
        if self._tls_established:
            raise self.abort('TLS session already established')
        if name not in self.capabilities:
            raise self.abort('TLS not supported by server')
        # Generate a default SSL context if none was passed.
        if ssl_context is None:
            ssl_context = ssl._create_stdlib_context()
        typ, dat = self._simple_command(name)
        if typ == 'OK':
            self.sock = ssl_context.wrap_socket(self.sock,
                                                server_hostname=self.host)
            self.file = self.sock.makefile('rb')
            self._tls_established = True
            self._get_capabilities()
        else:
            raise self.error("Couldn't establish TLS session")
        return self._untagged_response(typ, dat, name)


    def status(self, mailbox, names):
        """Request named status conditions for mailbox.

        (typ, [data]) = <instance>.status(mailbox, names)
        """
        name = 'STATUS'
        #if self.PROTOCOL_VERSION == 'IMAP4':   # Let the server decide!
        #    raise self.error('%s unimplemented in IMAP4 (obtain IMAP4rev1 server, or re-code)' % name)
        typ, dat = self._simple_command(name, mailbox, names)
        return self._untagged_response(typ, dat, name)


    def store(self, message_set, command, flags):
        """Alters flag dispositions for messages in mailbox.

        (typ, [data]) = <instance>.store(message_set, command, flags)
        """
        if (flags[0],flags[-1]) != ('(',')'):
            flags = '(%s)' % flags  # Avoid quoting the flags
        typ, dat = self._simple_command('STORE', message_set, command, flags)
        return self._untagged_response(typ, dat, 'FETCH')


    def subscribe(self, mailbox):
        """Subscribe to new mailbox.

        (typ, [data]) = <instance>.subscribe(mailbox)
        """
        return self._simple_command('SUBSCRIBE', mailbox)


    def thread(self, threading_algorithm, charset, *search_criteria):
        """IMAPrev1 extension THREAD command.

        (type, [data]) = <instance>.thread(threading_algorithm, charset, search_criteria, ...)
        """
        name = 'THREAD'
        typ, dat = self._simple_command(name, threading_algorithm, charset, *search_criteria)
        return self._untagged_response(typ, dat, name)


    def uid(self, command, *args):
        """Execute "command arg ..." with messages identified by UID,
                rather than message number.

        (typ, [data]) = <instance>.uid(command, arg1, arg2, ...)

        Returns response appropriate to 'command'.
        """
        command = command.upper()
        if not command in Commands:
            raise self.error("Unknown IMAP4 UID command: %s" % command)
        if self.state not in Commands[command]:
            raise self.error("command %s illegal in state %s, "
                             "only allowed in states %s" %
                             (command, self.state,
                              ', '.join(Commands[command])))
        name = 'UID'
        typ, dat = self._simple_command(name, command, *args)
        if command in ('SEARCH', 'SORT', 'THREAD'):
            name = command
        else:
            name = 'FETCH'
        return self._untagged_response(typ, dat, name)


    def unsubscribe(self, mailbox):
        """Unsubscribe from old mailbox.

        (typ, [data]) = <instance>.unsubscribe(mailbox)
        """
        return self._simple_command('UNSUBSCRIBE', mailbox)


    def xatom(self, name, *args):
        """Allow simple extension commands
                notified by server in CAPABILITY response.

        Assumes command is legal in current state.

        (typ, [data]) = <instance>.xatom(name, arg, ...)

        Returns response appropriate to extension command `name'.
        """
        name = name.upper()
        #if not name in self.capabilities:      # Let the server decide!
        #    raise self.error('unknown extension command: %s' % name)
        if not name in Commands:
            Commands[name] = (self.state,)
        return self._simple_command(name, *args)



    #       Private methods


    def _append_untagged(self, typ, dat):
        if dat is None:
            dat = b''
        ur = self.untagged_responses
        if __debug__:
            if self.debug >= 5:
                self._mesg('untagged_responses[%s] %s += ["%r"]' %
                        (typ, len(ur.get(typ,'')), dat))
        if typ in ur:
            ur[typ].append(dat)
        else:
            ur[typ] = [dat]


    def _check_bye(self):
        bye = self.untagged_responses.get('BYE')
        if bye:
            raise self.abort(bye[-1].decode(self._encoding, 'replace'))


    def _command(self, name, *args):

        if self.state not in Commands[name]:
            self.literal = None
            raise self.error("command %s illegal in state %s, "
                             "only allowed in states %s" %
                             (name, self.state,
                              ', '.join(Commands[name])))

        for typ in ('OK', 'NO', 'BAD'):
            if typ in self.untagged_responses:
                del self.untagged_responses[typ]

        if 'READ-ONLY' in self.untagged_responses \
        and not self.is_readonly:
            raise self.readonly('mailbox status changed to READ-ONLY')

        tag = self._new_tag()
        name = bytes(name, self._encoding)
        data = tag + b' ' + name
        for arg in args:
            if arg is None: continue
            if isinstance(arg, str):
                arg = bytes(arg, self._encoding)
            data = data + b' ' + arg

        literal = self.literal
        if literal is not None:
            self.literal = None
            if type(literal) is type(self._command):
                literator = literal
            else:
                literator = None
                data = data + bytes(' {%s}' % len(literal), self._encoding)

        if __debug__:
            if self.debug >= 4:
                self._mesg('> %r' % data)
            else:
                self._log('> %r' % data)

        try:
            self.send(data + CRLF)
        except OSError as val:
            raise self.abort('socket error: %s' % val)

        if literal is None:
            return tag

        while 1:
            # Wait for continuation response

            while self._get_response():
                if self.tagged_commands[tag]:   # BAD/NO?
                    return tag

            # Send literal

            if literator:
                literal = literator(self.continuation_response)

            if __debug__:
                if self.debug >= 4:
                    self._mesg('write literal size %s' % len(literal))

            try:
                self.send(literal)
                self.send(CRLF)
            except OSError as val:
                raise self.abort('socket error: %s' % val)

            if not literator:
                break

        return tag


    def _command_complete(self, name, tag):
        logout = (name == 'LOGOUT')
        # BYE is expected after LOGOUT
        if not logout:
            self._check_bye()
        try:
            typ, data = self._get_tagged_response(tag, expect_bye=logout)
        except self.abort as val:
            raise self.abort('command: %s => %s' % (name, val))
        except self.error as val:
            raise self.error('command: %s => %s' % (name, val))
        if not logout:
            self._check_bye()
        if typ == 'BAD':
            raise self.error('%s command error: %s %s' % (name, typ, data))
        return typ, data


    def _get_capabilities(self):
        typ, dat = self.capability()
        if dat == [None]:
            raise self.error('no CAPABILITY response from server')
        dat = str(dat[-1], self._encoding)
        dat = dat.upper()
        self.capabilities = tuple(dat.split())


    def _get_response(self):

        # Read response and store.
        #
        # Returns None for continuation responses,
        # otherwise first response line received.

        resp = self._get_line()

        # Command completion response?

        if self._match(self.tagre, resp):
            tag = self.mo.group('tag')
            if not tag in self.tagged_commands:
                raise self.abort('unexpected tagged response: %r' % resp)

            typ = self.mo.group('type')
            typ = str(typ, self._encoding)
            dat = self.mo.group('data')
            self.tagged_commands[tag] = (typ, [dat])
        else:
            dat2 = None

            # '*' (untagged) responses?

            if not self._match(Untagged_response, resp):
                if self._match(self.Untagged_status, resp):
                    dat2 = self.mo.group('data2')

            if self.mo is None:
                # Only other possibility is '+' (continuation) response...

                if self._match(Continuation, resp):
                    self.continuation_response = self.mo.group('data')
                    return None     # NB: indicates continuation

                raise self.abort("unexpected response: %r" % resp)

            typ = self.mo.group('type')
            typ = str(typ, self._encoding)
            dat = self.mo.group('data')
            if dat is None: dat = b''        # Null untagged response
            if dat2: dat = dat + b' ' + dat2

            # Is there a literal to come?

            while self._match(self.Literal, dat):

                # Read literal direct from connection.

                size = int(self.mo.group('size'))
                if __debug__:
                    if self.debug >= 4:
                        self._mesg('read literal size %s' % size)
                data = self.read(size)

                # Store response with literal as tuple

                self._append_untagged(typ, (dat, data))

                # Read trailer - possibly containing another literal

                dat = self._get_line()

            self._append_untagged(typ, dat)

        # Bracketed response information?

        if typ in ('OK', 'NO', 'BAD') and self._match(Response_code, dat):
            typ = self.mo.group('type')
            typ = str(typ, self._encoding)
            self._append_untagged(typ, self.mo.group('data'))

        if __debug__:
            if self.debug >= 1 and typ in ('NO', 'BAD', 'BYE'):
                self._mesg('%s response: %r' % (typ, dat))

        return resp


    def _get_tagged_response(self, tag, expect_bye=False):

        while 1:
            result = self.tagged_commands[tag]
            if result is not None:
                del self.tagged_commands[tag]
                return result

            if expect_bye:
                typ = 'BYE'
                bye = self.untagged_responses.pop(typ, None)
                if bye is not None:
                    # Server replies to the "LOGOUT" command with "BYE"
                    return (typ, bye)

            # If we've seen a BYE at this point, the socket will be
            # closed, so report the BYE now.
            self._check_bye()

            # Some have reported "unexpected response" exceptions.
            # Note that ignoring them here causes loops.
            # Instead, send me details of the unexpected response and
            # I'll update the code in `_get_response()'.

            try:
                self._get_response()
            except self.abort as val:
                if __debug__:
                    if self.debug >= 1:
                        self.print_log()
                raise


    def _get_line(self):

        line = self.readline()
        if not line:
            raise self.abort('socket error: EOF')

        # Protocol mandates all lines terminated by CRLF
        if not line.endswith(b'\r\n'):
            raise self.abort('socket error: unterminated line: %r' % line)

        line = line[:-2]
        if __debug__:
            if self.debug >= 4:
                self._mesg('< %r' % line)
            else:
                self._log('< %r' % line)
        return line


    def _match(self, cre, s):

        # Run compiled regular expression match method on 's'.
        # Save result, return success.

        self.mo = cre.match(s)
        if __debug__:
            if self.mo is not None and self.debug >= 5:
                self._mesg("\tmatched %r => %r" % (cre.pattern, self.mo.groups()))
        return self.mo is not None


    def _new_tag(self):

        tag = self.tagpre + bytes(str(self.tagnum), self._encoding)
        self.tagnum = self.tagnum + 1
        self.tagged_commands[tag] = None
        return tag


    def _quote(self, arg):

        arg = arg.replace('\\', '\\\\')
        arg = arg.replace('"', '\\"')

        return '"' + arg + '"'


    def _simple_command(self, name, *args):

        return self._command_complete(name, self._command(name, *args))


    def _untagged_response(self, typ, dat, name):
        if typ == 'NO':
            return typ, dat
        if not name in self.untagged_responses:
            return typ, [None]
        data = self.untagged_responses.pop(name)
        if __debug__:
            if self.debug >= 5:
                self._mesg('untagged_responses[%s] => %s' % (name, data))
        return typ, data


    if __debug__:

        def _mesg(self, s, secs=None):
            if secs is None:
                secs = time.time()
            tm = time.strftime('%M:%S', time.localtime(secs))
            sys.stderr.write('  %s.%02d %s\n' % (tm, (secs*100)%100, s))
            sys.stderr.flush()

        def _dump_ur(self, dict):
            # Dump untagged responses (in `dict').
            l = dict.items()
            if not l: return
            t = '\n\t\t'
            l = map(lambda x:'%s: "%s"' % (x[0], x[1][0] and '" "'.join(x[1]) or ''), l)
            self._mesg('untagged responses dump:%s%s' % (t, t.join(l)))

        def _log(self, line):
            # Keep log of last `_cmd_log_len' interactions for debugging.
            self._cmd_log[self._cmd_log_idx] = (line, time.time())
            self._cmd_log_idx += 1
            if self._cmd_log_idx >= self._cmd_log_len:
                self._cmd_log_idx = 0

        def print_log(self):
            self._mesg('last %d IMAP4 interactions:' % len(self._cmd_log))
            i, n = self._cmd_log_idx, self._cmd_log_len
            while n:
                try:
                    self._mesg(*self._cmd_log[i])
                except:
                    pass
                i += 1
                if i >= self._cmd_log_len:
                    i = 0
                n -= 1


if HAVE_SSL:

    class IMAP4_SSL(IMAP4):

        """IMAP4 client class over SSL connection

        Instantiate with: IMAP4_SSL([host[, port[, keyfile[, certfile[, ssl_context]]]]])

                host - host's name (default: localhost);
                port - port number (default: standard IMAP4 SSL port);
                keyfile - PEM formatted file that contains your private key (default: None);
                certfile - PEM formatted certificate chain file (default: None);
                ssl_context - a SSLContext object that contains your certificate chain
                              and private key (default: None)
                Note: if ssl_context is provided, then parameters keyfile or
                certfile should not be set otherwise ValueError is raised.

        for more documentation see the docstring of the parent class IMAP4.
        """


        def __init__(self, host='', port=IMAP4_SSL_PORT, keyfile=None,
                     certfile=None, ssl_context=None):
            if ssl_context is not None and keyfile is not None:
                raise ValueError("ssl_context and keyfile arguments are mutually "
                                 "exclusive")
            if ssl_context is not None and certfile is not None:
                raise ValueError("ssl_context and certfile arguments are mutually "
                                 "exclusive")
            if keyfile is not None or certfile is not None:
                import warnings
                warnings.warn("keyfile and certfile are deprecated, use a "
                              "custom ssl_context instead", DeprecationWarning, 2)
            self.keyfile = keyfile
            self.certfile = certfile
            if ssl_context is None:
                ssl_context = ssl._create_stdlib_context(certfile=certfile,
                                                         keyfile=keyfile)
            self.ssl_context = ssl_context
            IMAP4.__init__(self, host, port)

        def _create_socket(self):
            sock = IMAP4._create_socket(self)
            return self.ssl_context.wrap_socket(sock,
                                                server_hostname=self.host)

        def open(self, host='', port=IMAP4_SSL_PORT):
            """Setup connection to remote server on "host:port".
                (default: localhost:standard IMAP4 SSL port).
            This connection will be used by the routines:
                read, readline, send, shutdown.
            """
            IMAP4.open(self, host, port)

    __all__.append("IMAP4_SSL")


class IMAP4_stream(IMAP4):

    """IMAP4 client class over a stream

    Instantiate with: IMAP4_stream(command)

            "command" - a string that can be passed to subprocess.Popen()

    for more documentation see the docstring of the parent class IMAP4.
    """


    def __init__(self, command):
        self.command = command
        IMAP4.__init__(self)


    def open(self, host = None, port = None):
        """Setup a stream connection.
        This connection will be used by the routines:
            read, readline, send, shutdown.
        """
        self.host = None        # For compatibility with parent class
        self.port = None
        self.sock = None
        self.file = None
        self.process = subprocess.Popen(self.command,
            bufsize=DEFAULT_BUFFER_SIZE,
            stdin=subprocess.PIPE, stdout=subprocess.PIPE,
            shell=True, close_fds=True)
        self.writefile = self.process.stdin
        self.readfile = self.process.stdout

    def read(self, size):
        """Read 'size' bytes from remote."""
        return self.readfile.read(size)


    def readline(self):
        """Read line from remote."""
        return self.readfile.readline()


    def send(self, data):
        """Send data to remote."""
        self.writefile.write(data)
        self.writefile.flush()


    def shutdown(self):
        """Close I/O established in "open"."""
        self.readfile.close()
        self.writefile.close()
        self.process.wait()



class _Authenticator:

    """Private class to provide en/decoding
            for base64-based authentication conversation.
    """

    def __init__(self, mechinst):
        self.mech = mechinst    # Callable object to provide/process data

    def process(self, data):
        ret = self.mech(self.decode(data))
        if ret is None:
            return b'*'     # Abort conversation
        return self.encode(ret)

    def encode(self, inp):
        #
        #  Invoke binascii.b2a_base64 iteratively with
        #  short even length buffers, strip the trailing
        #  line feed from the result and append.  "Even"
        #  means a number that factors to both 6 and 8,
        #  so when it gets to the end of the 8-bit input
        #  there's no partial 6-bit output.
        #
        oup = b''
        if isinstance(inp, str):
            inp = inp.encode('utf-8')
        while inp:
            if len(inp) > 48:
                t = inp[:48]
                inp = inp[48:]
            else:
                t = inp
                inp = b''
            e = binascii.b2a_base64(t)
            if e:
                oup = oup + e[:-1]
        return oup

    def decode(self, inp):
        if not inp:
            return b''
        return binascii.a2b_base64(inp)

Months = ' Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' ')
Mon2num = {s.encode():n+1 for n, s in enumerate(Months[1:])}

def Internaldate2tuple(resp):
    """Parse an IMAP4 INTERNALDATE string.

    Return corresponding local time.  The return value is a
    time.struct_time tuple or None if the string has wrong format.
    """

    mo = InternalDate.match(resp)
    if not mo:
        return None

    mon = Mon2num[mo.group('mon')]
    zonen = mo.group('zonen')

    day = int(mo.group('day'))
    year = int(mo.group('year'))
    hour = int(mo.group('hour'))
    min = int(mo.group('min'))
    sec = int(mo.group('sec'))
    zoneh = int(mo.group('zoneh'))
    zonem = int(mo.group('zonem'))

    # INTERNALDATE timezone must be subtracted to get UT

    zone = (zoneh*60 + zonem)*60
    if zonen == b'-':
        zone = -zone

    tt = (year, mon, day, hour, min, sec, -1, -1, -1)
    utc = calendar.timegm(tt) - zone

    return time.localtime(utc)



def Int2AP(num):

    """Convert integer to A-P string representation."""

    val = b''; AP = b'ABCDEFGHIJKLMNOP'
    num = int(abs(num))
    while num:
        num, mod = divmod(num, 16)
        val = AP[mod:mod+1] + val
    return val



def ParseFlags(resp):

    """Convert IMAP4 flags response to python tuple."""

    mo = Flags.match(resp)
    if not mo:
        return ()

    return tuple(mo.group('flags').split())


def Time2Internaldate(date_time):

    """Convert date_time to IMAP4 INTERNALDATE representation.

    Return string in form: '"DD-Mmm-YYYY HH:MM:SS +HHMM"'.  The
    date_time argument can be a number (int or float) representing
    seconds since epoch (as returned by time.time()), a 9-tuple
    representing local time, an instance of time.struct_time (as
    returned by time.localtime()), an aware datetime instance or a
    double-quoted string.  In the last case, it is assumed to already
    be in the correct format.
    """
    if isinstance(date_time, (int, float)):
        dt = datetime.fromtimestamp(date_time,
                                    timezone.utc).astimezone()
    elif isinstance(date_time, tuple):
        try:
            gmtoff = date_time.tm_gmtoff
        except AttributeError:
            if time.daylight:
                dst = date_time[8]
                if dst == -1:
                    dst = time.localtime(time.mktime(date_time))[8]
                gmtoff = -(time.timezone, time.altzone)[dst]
            else:
                gmtoff = -time.timezone
        delta = timedelta(seconds=gmtoff)
        dt = datetime(*date_time[:6], tzinfo=timezone(delta))
    elif isinstance(date_time, datetime):
        if date_time.tzinfo is None:
            raise ValueError("date_time must be aware")
        dt = date_time
    elif isinstance(date_time, str) and (date_time[0],date_time[-1]) == ('"','"'):
        return date_time        # Assume in correct format
    else:
        raise ValueError("date_time not of a known type")
    fmt = '"%d-{}-%Y %H:%M:%S %z"'.format(Months[dt.month])
    return dt.strftime(fmt)



if __name__ == '__main__':

    # To test: invoke either as 'python imaplib.py [IMAP4_server_hostname]'
    # or 'python imaplib.py -s "rsh IMAP4_server_hostname exec /etc/rimapd"'
    # to test the IMAP4_stream class

    import getopt, getpass

    try:
        optlist, args = getopt.getopt(sys.argv[1:], 'd:s:')
    except getopt.error as val:
        optlist, args = (), ()

    stream_command = None
    for opt,val in optlist:
        if opt == '-d':
            Debug = int(val)
        elif opt == '-s':
            stream_command = val
            if not args: args = (stream_command,)

    if not args: args = ('',)

    host = args[0]

    USER = getpass.getuser()
    PASSWD = getpass.getpass("IMAP password for %s on %s: " % (USER, host or "localhost"))

    test_mesg = 'From: %(user)s@localhost%(lf)sSubject: IMAP4 test%(lf)s%(lf)sdata...%(lf)s' % {'user':USER, 'lf':'\n'}
    test_seq1 = (
    ('login', (USER, PASSWD)),
    ('create', ('/tmp/xxx 1',)),
    ('rename', ('/tmp/xxx 1', '/tmp/yyy')),
    ('CREATE', ('/tmp/yyz 2',)),
    ('append', ('/tmp/yyz 2', None, None, test_mesg)),
    ('list', ('/tmp', 'yy*')),
    ('select', ('/tmp/yyz 2',)),
    ('search', (None, 'SUBJECT', 'test')),
    ('fetch', ('1', '(FLAGS INTERNALDATE RFC822)')),
    ('store', ('1', 'FLAGS', r'(\Deleted)')),
    ('namespace', ()),
    ('expunge', ()),
    ('recent', ()),
    ('close', ()),
    )

    test_seq2 = (
    ('select', ()),
    ('response',('UIDVALIDITY',)),
    ('uid', ('SEARCH', 'ALL')),
    ('response', ('EXISTS',)),
    ('append', (None, None, None, test_mesg)),
    ('recent', ()),
    ('logout', ()),
    )

    def run(cmd, args):
        M._mesg('%s %s' % (cmd, args))
        typ, dat = getattr(M, cmd)(*args)
        M._mesg('%s => %s %s' % (cmd, typ, dat))
        if typ == 'NO': raise dat[0]
        return dat

    try:
        if stream_command:
            M = IMAP4_stream(stream_command)
        else:
            M = IMAP4(host)
        if M.state == 'AUTH':
            test_seq1 = test_seq1[1:]   # Login not needed
        M._mesg('PROTOCOL_VERSION = %s' % M.PROTOCOL_VERSION)
        M._mesg('CAPABILITIES = %r' % (M.capabilities,))

        for cmd,args in test_seq1:
            run(cmd, args)

        for ml in run('list', ('/tmp/', 'yy%')):
            mo = re.match(r'.*"([^"]+)"$', ml)
            if mo: path = mo.group(1)
            else: path = ml.split()[-1]
            run('delete', (path,))

        for cmd,args in test_seq2:
            dat = run(cmd, args)

            if (cmd,args) != ('uid', ('SEARCH', 'ALL')):
                continue

            uid = dat[-1].split()
            if not uid: continue
            run('uid', ('FETCH', '%s' % uid[-1],
                    '(FLAGS INTERNALDATE RFC822.SIZE RFC822.HEADER RFC822.TEXT)'))

        print('\nAll tests OK.')

    except:
        print('\nTests failed.')

        if not Debug:
            print('''
If you would like to see debugging output,
try: %s -d5
''' % sys.argv[0])

        raise
opcode.py000064400000013260151153537470006404 0ustar00
"""
opcode module - potentially shared between dis and other modules which
operate on bytecodes (e.g. peephole optimizers).
"""

__all__ = ["cmp_op", "hasconst", "hasname", "hasjrel", "hasjabs",
           "haslocal", "hascompare", "hasfree", "opname", "opmap",
           "HAVE_ARGUMENT", "EXTENDED_ARG", "hasnargs"]

# It's a chicken-and-egg I'm afraid:
# We're imported before _opcode's made.
# With exception unheeded
# (stack_effect is not needed)
# Both our chickens and eggs are allayed.
#     --Larry Hastings, 2013/11/23

try:
    from _opcode import stack_effect
    __all__.append('stack_effect')
except ImportError:
    pass

cmp_op = ('<', '<=', '==', '!=', '>', '>=', 'in', 'not in', 'is',
        'is not', 'exception match', 'BAD')

hasconst = []
hasname = []
hasjrel = []
hasjabs = []
haslocal = []
hascompare = []
hasfree = []
hasnargs = [] # unused

opmap = {}
opname = ['<%r>' % (op,) for op in range(256)]

def def_op(name, op):
    opname[op] = name
    opmap[name] = op

def name_op(name, op):
    def_op(name, op)
    hasname.append(op)

def jrel_op(name, op):
    def_op(name, op)
    hasjrel.append(op)

def jabs_op(name, op):
    def_op(name, op)
    hasjabs.append(op)

# Instruction opcodes for compiled code
# Blank lines correspond to available opcodes

def_op('POP_TOP', 1)
def_op('ROT_TWO', 2)
def_op('ROT_THREE', 3)
def_op('DUP_TOP', 4)
def_op('DUP_TOP_TWO', 5)
def_op('ROT_FOUR', 6)

def_op('NOP', 9)
def_op('UNARY_POSITIVE', 10)
def_op('UNARY_NEGATIVE', 11)
def_op('UNARY_NOT', 12)

def_op('UNARY_INVERT', 15)

def_op('BINARY_MATRIX_MULTIPLY', 16)
def_op('INPLACE_MATRIX_MULTIPLY', 17)

def_op('BINARY_POWER', 19)
def_op('BINARY_MULTIPLY', 20)

def_op('BINARY_MODULO', 22)
def_op('BINARY_ADD', 23)
def_op('BINARY_SUBTRACT', 24)
def_op('BINARY_SUBSCR', 25)
def_op('BINARY_FLOOR_DIVIDE', 26)
def_op('BINARY_TRUE_DIVIDE', 27)
def_op('INPLACE_FLOOR_DIVIDE', 28)
def_op('INPLACE_TRUE_DIVIDE', 29)

def_op('GET_AITER', 50)
def_op('GET_ANEXT', 51)
def_op('BEFORE_ASYNC_WITH', 52)
def_op('BEGIN_FINALLY', 53)
def_op('END_ASYNC_FOR', 54)
def_op('INPLACE_ADD', 55)
def_op('INPLACE_SUBTRACT', 56)
def_op('INPLACE_MULTIPLY', 57)

def_op('INPLACE_MODULO', 59)
def_op('STORE_SUBSCR', 60)
def_op('DELETE_SUBSCR', 61)
def_op('BINARY_LSHIFT', 62)
def_op('BINARY_RSHIFT', 63)
def_op('BINARY_AND', 64)
def_op('BINARY_XOR', 65)
def_op('BINARY_OR', 66)
def_op('INPLACE_POWER', 67)
def_op('GET_ITER', 68)
def_op('GET_YIELD_FROM_ITER', 69)

def_op('PRINT_EXPR', 70)
def_op('LOAD_BUILD_CLASS', 71)
def_op('YIELD_FROM', 72)
def_op('GET_AWAITABLE', 73)

def_op('INPLACE_LSHIFT', 75)
def_op('INPLACE_RSHIFT', 76)
def_op('INPLACE_AND', 77)
def_op('INPLACE_XOR', 78)
def_op('INPLACE_OR', 79)
def_op('WITH_CLEANUP_START', 81)
def_op('WITH_CLEANUP_FINISH', 82)
def_op('RETURN_VALUE', 83)
def_op('IMPORT_STAR', 84)
def_op('SETUP_ANNOTATIONS', 85)
def_op('YIELD_VALUE', 86)
def_op('POP_BLOCK', 87)
def_op('END_FINALLY', 88)
def_op('POP_EXCEPT', 89)

HAVE_ARGUMENT = 90              # Opcodes from here have an argument:

name_op('STORE_NAME', 90)       # Index in name list
name_op('DELETE_NAME', 91)      # ""
def_op('UNPACK_SEQUENCE', 92)   # Number of tuple items
jrel_op('FOR_ITER', 93)
def_op('UNPACK_EX', 94)
name_op('STORE_ATTR', 95)       # Index in name list
name_op('DELETE_ATTR', 96)      # ""
name_op('STORE_GLOBAL', 97)     # ""
name_op('DELETE_GLOBAL', 98)    # ""
def_op('LOAD_CONST', 100)       # Index in const list
hasconst.append(100)
name_op('LOAD_NAME', 101)       # Index in name list
def_op('BUILD_TUPLE', 102)      # Number of tuple items
def_op('BUILD_LIST', 103)       # Number of list items
def_op('BUILD_SET', 104)        # Number of set items
def_op('BUILD_MAP', 105)        # Number of dict entries
name_op('LOAD_ATTR', 106)       # Index in name list
def_op('COMPARE_OP', 107)       # Comparison operator
hascompare.append(107)
name_op('IMPORT_NAME', 108)     # Index in name list
name_op('IMPORT_FROM', 109)     # Index in name list

jrel_op('JUMP_FORWARD', 110)    # Number of bytes to skip
jabs_op('JUMP_IF_FALSE_OR_POP', 111) # Target byte offset from beginning of code
jabs_op('JUMP_IF_TRUE_OR_POP', 112)  # ""
jabs_op('JUMP_ABSOLUTE', 113)        # ""
jabs_op('POP_JUMP_IF_FALSE', 114)    # ""
jabs_op('POP_JUMP_IF_TRUE', 115)     # ""

name_op('LOAD_GLOBAL', 116)     # Index in name list

jrel_op('SETUP_FINALLY', 122)   # Distance to target address

def_op('LOAD_FAST', 124)        # Local variable number
haslocal.append(124)
def_op('STORE_FAST', 125)       # Local variable number
haslocal.append(125)
def_op('DELETE_FAST', 126)      # Local variable number
haslocal.append(126)

def_op('RAISE_VARARGS', 130)    # Number of raise arguments (1, 2, or 3)
def_op('CALL_FUNCTION', 131)    # #args
def_op('MAKE_FUNCTION', 132)    # Flags
def_op('BUILD_SLICE', 133)      # Number of items
def_op('LOAD_CLOSURE', 135)
hasfree.append(135)
def_op('LOAD_DEREF', 136)
hasfree.append(136)
def_op('STORE_DEREF', 137)
hasfree.append(137)
def_op('DELETE_DEREF', 138)
hasfree.append(138)

def_op('CALL_FUNCTION_KW', 141)  # #args + #kwargs
def_op('CALL_FUNCTION_EX', 142)  # Flags

jrel_op('SETUP_WITH', 143)

def_op('LIST_APPEND', 145)
def_op('SET_ADD', 146)
def_op('MAP_ADD', 147)

def_op('LOAD_CLASSDEREF', 148)
hasfree.append(148)

def_op('EXTENDED_ARG', 144)
EXTENDED_ARG = 144

def_op('BUILD_LIST_UNPACK', 149)
def_op('BUILD_MAP_UNPACK', 150)
def_op('BUILD_MAP_UNPACK_WITH_CALL', 151)
def_op('BUILD_TUPLE_UNPACK', 152)
def_op('BUILD_SET_UNPACK', 153)

jrel_op('SETUP_ASYNC_WITH', 154)

def_op('FORMAT_VALUE', 155)
def_op('BUILD_CONST_KEY_MAP', 156)
def_op('BUILD_STRING', 157)
def_op('BUILD_TUPLE_UNPACK_WITH_CALL', 158)

name_op('LOAD_METHOD', 160)
def_op('CALL_METHOD', 161)
jrel_op('CALL_FINALLY', 162)
def_op('POP_FINALLY', 163)

del def_op, name_op, jrel_op, jabs_op
ntpath.py000064400000066126151153537470006442 0ustar00# Module 'ntpath' -- common operations on WinNT/Win95 pathnames
"""Common pathname manipulations, WindowsNT/95 version.

Instead of importing this module directly, import os and refer to this
module as os.path.
"""

# strings representing various path-related bits and pieces
# These are primarily for export; internally, they are hardcoded.
# Should be set before imports for resolving cyclic dependency.
curdir = '.'
pardir = '..'
extsep = '.'
sep = '\\'
pathsep = ';'
altsep = '/'
defpath = '.;C:\\bin'
devnull = 'nul'

import os
import sys
import stat
import genericpath
from genericpath import *

__all__ = ["normcase","isabs","join","splitdrive","split","splitext",
           "basename","dirname","commonprefix","getsize","getmtime",
           "getatime","getctime", "islink","exists","lexists","isdir","isfile",
           "ismount", "expanduser","expandvars","normpath","abspath",
           "curdir","pardir","sep","pathsep","defpath","altsep",
           "extsep","devnull","realpath","supports_unicode_filenames","relpath",
           "samefile", "sameopenfile", "samestat", "commonpath"]

def _get_bothseps(path):
    if isinstance(path, bytes):
        return b'\\/'
    else:
        return '\\/'

# Normalize the case of a pathname and map slashes to backslashes.
# Other normalizations (such as optimizing '../' away) are not done
# (this is done by normpath).

def normcase(s):
    """Normalize case of pathname.

    Makes all characters lowercase and all slashes into backslashes."""
    s = os.fspath(s)
    if isinstance(s, bytes):
        return s.replace(b'/', b'\\').lower()
    else:
        return s.replace('/', '\\').lower()


# Return whether a path is absolute.
# Trivial in Posix, harder on Windows.
# For Windows it is absolute if it starts with a slash or backslash (current
# volume), or if a pathname after the volume-letter-and-colon or UNC-resource
# starts with a slash or backslash.

def isabs(s):
    """Test whether a path is absolute"""
    s = os.fspath(s)
    # Paths beginning with \\?\ are always absolute, but do not
    # necessarily contain a drive.
    if isinstance(s, bytes):
        if s.replace(b'/', b'\\').startswith(b'\\\\?\\'):
            return True
    else:
        if s.replace('/', '\\').startswith('\\\\?\\'):
            return True
    s = splitdrive(s)[1]
    return len(s) > 0 and s[0] in _get_bothseps(s)


# Join two (or more) paths.
def join(path, *paths):
    path = os.fspath(path)
    if isinstance(path, bytes):
        sep = b'\\'
        seps = b'\\/'
        colon = b':'
    else:
        sep = '\\'
        seps = '\\/'
        colon = ':'
    try:
        if not paths:
            path[:0] + sep  #23780: Ensure compatible data type even if p is null.
        result_drive, result_path = splitdrive(path)
        for p in map(os.fspath, paths):
            p_drive, p_path = splitdrive(p)
            if p_path and p_path[0] in seps:
                # Second path is absolute
                if p_drive or not result_drive:
                    result_drive = p_drive
                result_path = p_path
                continue
            elif p_drive and p_drive != result_drive:
                if p_drive.lower() != result_drive.lower():
                    # Different drives => ignore the first path entirely
                    result_drive = p_drive
                    result_path = p_path
                    continue
                # Same drive in different case
                result_drive = p_drive
            # Second path is relative to the first
            if result_path and result_path[-1] not in seps:
                result_path = result_path + sep
            result_path = result_path + p_path
        ## add separator between UNC and non-absolute path
        if (result_path and result_path[0] not in seps and
            result_drive and result_drive[-1:] != colon):
            return result_drive + sep + result_path
        return result_drive + result_path
    except (TypeError, AttributeError, BytesWarning):
        genericpath._check_arg_types('join', path, *paths)
        raise


# Split a path in a drive specification (a drive letter followed by a
# colon) and the path specification.
# It is always true that drivespec + pathspec == p
def splitdrive(p):
    """Split a pathname into drive/UNC sharepoint and relative path specifiers.
    Returns a 2-tuple (drive_or_unc, path); either part may be empty.

    If you assign
        result = splitdrive(p)
    It is always true that:
        result[0] + result[1] == p

    If the path contained a drive letter, drive_or_unc will contain everything
    up to and including the colon.  e.g. splitdrive("c:/dir") returns ("c:", "/dir")

    If the path contained a UNC path, the drive_or_unc will contain the host name
    and share up to but not including the fourth directory separator character.
    e.g. splitdrive("//host/computer/dir") returns ("//host/computer", "/dir")

    Paths cannot contain both a drive letter and a UNC path.

    """
    p = os.fspath(p)
    if len(p) >= 2:
        if isinstance(p, bytes):
            sep = b'\\'
            altsep = b'/'
            colon = b':'
        else:
            sep = '\\'
            altsep = '/'
            colon = ':'
        normp = p.replace(altsep, sep)
        if (normp[0:2] == sep*2) and (normp[2:3] != sep):
            # is a UNC path:
            # vvvvvvvvvvvvvvvvvvvv drive letter or UNC path
            # \\machine\mountpoint\directory\etc\...
            #           directory ^^^^^^^^^^^^^^^
            index = normp.find(sep, 2)
            if index == -1:
                return p[:0], p
            index2 = normp.find(sep, index + 1)
            # a UNC path can't have two slashes in a row
            # (after the initial two)
            if index2 == index + 1:
                return p[:0], p
            if index2 == -1:
                index2 = len(p)
            return p[:index2], p[index2:]
        if normp[1:2] == colon:
            return p[:2], p[2:]
    return p[:0], p


# Split a path in head (everything up to the last '/') and tail (the
# rest).  After the trailing '/' is stripped, the invariant
# join(head, tail) == p holds.
# The resulting head won't end in '/' unless it is the root.

def split(p):
    """Split a pathname.

    Return tuple (head, tail) where tail is everything after the final slash.
    Either part may be empty."""
    p = os.fspath(p)
    seps = _get_bothseps(p)
    d, p = splitdrive(p)
    # set i to index beyond p's last slash
    i = len(p)
    while i and p[i-1] not in seps:
        i -= 1
    head, tail = p[:i], p[i:]  # now tail has no slashes
    # remove trailing slashes from head, unless it's all slashes
    head = head.rstrip(seps) or head
    return d + head, tail


# Split a path in root and extension.
# The extension is everything starting at the last dot in the last
# pathname component; the root is everything before that.
# It is always true that root + ext == p.

def splitext(p):
    p = os.fspath(p)
    if isinstance(p, bytes):
        return genericpath._splitext(p, b'\\', b'/', b'.')
    else:
        return genericpath._splitext(p, '\\', '/', '.')
splitext.__doc__ = genericpath._splitext.__doc__


# Return the tail (basename) part of a path.

def basename(p):
    """Returns the final component of a pathname"""
    return split(p)[1]


# Return the head (dirname) part of a path.

def dirname(p):
    """Returns the directory component of a pathname"""
    return split(p)[0]

# Is a path a symbolic link?
# This will always return false on systems where os.lstat doesn't exist.

def islink(path):
    """Test whether a path is a symbolic link.
    This will always return false for Windows prior to 6.0.
    """
    try:
        st = os.lstat(path)
    except (OSError, ValueError, AttributeError):
        return False
    return stat.S_ISLNK(st.st_mode)

# Being true for dangling symbolic links is also useful.

def lexists(path):
    """Test whether a path exists.  Returns True for broken symbolic links"""
    try:
        st = os.lstat(path)
    except (OSError, ValueError):
        return False
    return True

# Is a path a mount point?
# Any drive letter root (eg c:\)
# Any share UNC (eg \\server\share)
# Any volume mounted on a filesystem folder
#
# No one method detects all three situations. Historically we've lexically
# detected drive letter roots and share UNCs. The canonical approach to
# detecting mounted volumes (querying the reparse tag) fails for the most
# common case: drive letter roots. The alternative which uses GetVolumePathName
# fails if the drive letter is the result of a SUBST.
try:
    from nt import _getvolumepathname
except ImportError:
    _getvolumepathname = None
def ismount(path):
    """Test whether a path is a mount point (a drive root, the root of a
    share, or a mounted volume)"""
    path = os.fspath(path)
    seps = _get_bothseps(path)
    path = abspath(path)
    root, rest = splitdrive(path)
    if root and root[0] in seps:
        return (not rest) or (rest in seps)
    if rest in seps:
        return True

    if _getvolumepathname:
        return path.rstrip(seps) == _getvolumepathname(path).rstrip(seps)
    else:
        return False


# Expand paths beginning with '~' or '~user'.
# '~' means $HOME; '~user' means that user's home directory.
# If the path doesn't begin with '~', or if the user or $HOME is unknown,
# the path is returned unchanged (leaving error reporting to whatever
# function is called with the expanded path as argument).
# See also module 'glob' for expansion of *, ? and [...] in pathnames.
# (A function should also be defined to do full *sh-style environment
# variable expansion.)

def expanduser(path):
    """Expand ~ and ~user constructs.

    If user or $HOME is unknown, do nothing."""
    path = os.fspath(path)
    if isinstance(path, bytes):
        tilde = b'~'
    else:
        tilde = '~'
    if not path.startswith(tilde):
        return path
    i, n = 1, len(path)
    while i < n and path[i] not in _get_bothseps(path):
        i += 1

    if 'USERPROFILE' in os.environ:
        userhome = os.environ['USERPROFILE']
    elif not 'HOMEPATH' in os.environ:
        return path
    else:
        try:
            drive = os.environ['HOMEDRIVE']
        except KeyError:
            drive = ''
        userhome = join(drive, os.environ['HOMEPATH'])

    if isinstance(path, bytes):
        userhome = os.fsencode(userhome)

    if i != 1: #~user
        userhome = join(dirname(userhome), path[1:i])

    return userhome + path[i:]


# Expand paths containing shell variable substitutions.
# The following rules apply:
#       - no expansion within single quotes
#       - '$$' is translated into '$'
#       - '%%' is translated into '%' if '%%' are not seen in %var1%%var2%
#       - ${varname} is accepted.
#       - $varname is accepted.
#       - %varname% is accepted.
#       - varnames can be made out of letters, digits and the characters '_-'
#         (though is not verified in the ${varname} and %varname% cases)
# XXX With COMMAND.COM you can use any characters in a variable name,
# XXX except '^|<>='.

def expandvars(path):
    """Expand shell variables of the forms $var, ${var} and %var%.

    Unknown variables are left unchanged."""
    path = os.fspath(path)
    if isinstance(path, bytes):
        if b'$' not in path and b'%' not in path:
            return path
        import string
        varchars = bytes(string.ascii_letters + string.digits + '_-', 'ascii')
        quote = b'\''
        percent = b'%'
        brace = b'{'
        rbrace = b'}'
        dollar = b'$'
        environ = getattr(os, 'environb', None)
    else:
        if '$' not in path and '%' not in path:
            return path
        import string
        varchars = string.ascii_letters + string.digits + '_-'
        quote = '\''
        percent = '%'
        brace = '{'
        rbrace = '}'
        dollar = '$'
        environ = os.environ
    res = path[:0]
    index = 0
    pathlen = len(path)
    while index < pathlen:
        c = path[index:index+1]
        if c == quote:   # no expansion within single quotes
            path = path[index + 1:]
            pathlen = len(path)
            try:
                index = path.index(c)
                res += c + path[:index + 1]
            except ValueError:
                res += c + path
                index = pathlen - 1
        elif c == percent:  # variable or '%'
            if path[index + 1:index + 2] == percent:
                res += c
                index += 1
            else:
                path = path[index+1:]
                pathlen = len(path)
                try:
                    index = path.index(percent)
                except ValueError:
                    res += percent + path
                    index = pathlen - 1
                else:
                    var = path[:index]
                    try:
                        if environ is None:
                            value = os.fsencode(os.environ[os.fsdecode(var)])
                        else:
                            value = environ[var]
                    except KeyError:
                        value = percent + var + percent
                    res += value
        elif c == dollar:  # variable or '$$'
            if path[index + 1:index + 2] == dollar:
                res += c
                index += 1
            elif path[index + 1:index + 2] == brace:
                path = path[index+2:]
                pathlen = len(path)
                try:
                    index = path.index(rbrace)
                except ValueError:
                    res += dollar + brace + path
                    index = pathlen - 1
                else:
                    var = path[:index]
                    try:
                        if environ is None:
                            value = os.fsencode(os.environ[os.fsdecode(var)])
                        else:
                            value = environ[var]
                    except KeyError:
                        value = dollar + brace + var + rbrace
                    res += value
            else:
                var = path[:0]
                index += 1
                c = path[index:index + 1]
                while c and c in varchars:
                    var += c
                    index += 1
                    c = path[index:index + 1]
                try:
                    if environ is None:
                        value = os.fsencode(os.environ[os.fsdecode(var)])
                    else:
                        value = environ[var]
                except KeyError:
                    value = dollar + var
                res += value
                if c:
                    index -= 1
        else:
            res += c
        index += 1
    return res


# Normalize a path, e.g. A//B, A/./B and A/foo/../B all become A\B.
# Previously, this function also truncated pathnames to 8+3 format,
# but as this module is called "ntpath", that's obviously wrong!

def normpath(path):
    """Normalize path, eliminating double slashes, etc."""
    path = os.fspath(path)
    if isinstance(path, bytes):
        sep = b'\\'
        altsep = b'/'
        curdir = b'.'
        pardir = b'..'
        special_prefixes = (b'\\\\.\\', b'\\\\?\\')
    else:
        sep = '\\'
        altsep = '/'
        curdir = '.'
        pardir = '..'
        special_prefixes = ('\\\\.\\', '\\\\?\\')
    if path.startswith(special_prefixes):
        # in the case of paths with these prefixes:
        # \\.\ -> device names
        # \\?\ -> literal paths
        # do not do any normalization, but return the path
        # unchanged apart from the call to os.fspath()
        return path
    path = path.replace(altsep, sep)
    prefix, path = splitdrive(path)

    # collapse initial backslashes
    if path.startswith(sep):
        prefix += sep
        path = path.lstrip(sep)

    comps = path.split(sep)
    i = 0
    while i < len(comps):
        if not comps[i] or comps[i] == curdir:
            del comps[i]
        elif comps[i] == pardir:
            if i > 0 and comps[i-1] != pardir:
                del comps[i-1:i+1]
                i -= 1
            elif i == 0 and prefix.endswith(sep):
                del comps[i]
            else:
                i += 1
        else:
            i += 1
    # If the path is now empty, substitute '.'
    if not prefix and not comps:
        comps.append(curdir)
    return prefix + sep.join(comps)

def _abspath_fallback(path):
    """Return the absolute version of a path as a fallback function in case
    `nt._getfullpathname` is not available or raises OSError. See bpo-31047 for
    more.

    """

    path = os.fspath(path)
    if not isabs(path):
        if isinstance(path, bytes):
            cwd = os.getcwdb()
        else:
            cwd = os.getcwd()
        path = join(cwd, path)
    return normpath(path)

# Return an absolute path.
try:
    from nt import _getfullpathname

except ImportError: # not running on Windows - mock up something sensible
    abspath = _abspath_fallback

else:  # use native Windows method on Windows
    def abspath(path):
        """Return the absolute version of a path."""
        try:
            return normpath(_getfullpathname(path))
        except (OSError, ValueError):
            return _abspath_fallback(path)

try:
    from nt import _getfinalpathname, readlink as _nt_readlink
except ImportError:
    # realpath is a no-op on systems without _getfinalpathname support.
    realpath = abspath
else:
    def _readlink_deep(path):
        # These error codes indicate that we should stop reading links and
        # return the path we currently have.
        # 1: ERROR_INVALID_FUNCTION
        # 2: ERROR_FILE_NOT_FOUND
        # 3: ERROR_DIRECTORY_NOT_FOUND
        # 5: ERROR_ACCESS_DENIED
        # 21: ERROR_NOT_READY (implies drive with no media)
        # 32: ERROR_SHARING_VIOLATION (probably an NTFS paging file)
        # 50: ERROR_NOT_SUPPORTED (implies no support for reparse points)
        # 67: ERROR_BAD_NET_NAME (implies remote server unavailable)
        # 87: ERROR_INVALID_PARAMETER
        # 4390: ERROR_NOT_A_REPARSE_POINT
        # 4392: ERROR_INVALID_REPARSE_DATA
        # 4393: ERROR_REPARSE_TAG_INVALID
        allowed_winerror = 1, 2, 3, 5, 21, 32, 50, 67, 87, 4390, 4392, 4393

        seen = set()
        while normcase(path) not in seen:
            seen.add(normcase(path))
            try:
                old_path = path
                path = _nt_readlink(path)
                # Links may be relative, so resolve them against their
                # own location
                if not isabs(path):
                    # If it's something other than a symlink, we don't know
                    # what it's actually going to be resolved against, so
                    # just return the old path.
                    if not islink(old_path):
                        path = old_path
                        break
                    path = normpath(join(dirname(old_path), path))
            except OSError as ex:
                if ex.winerror in allowed_winerror:
                    break
                raise
            except ValueError:
                # Stop on reparse points that are not symlinks
                break
        return path

    def _getfinalpathname_nonstrict(path):
        # These error codes indicate that we should stop resolving the path
        # and return the value we currently have.
        # 1: ERROR_INVALID_FUNCTION
        # 2: ERROR_FILE_NOT_FOUND
        # 3: ERROR_DIRECTORY_NOT_FOUND
        # 5: ERROR_ACCESS_DENIED
        # 21: ERROR_NOT_READY (implies drive with no media)
        # 32: ERROR_SHARING_VIOLATION (probably an NTFS paging file)
        # 50: ERROR_NOT_SUPPORTED
        # 67: ERROR_BAD_NET_NAME (implies remote server unavailable)
        # 87: ERROR_INVALID_PARAMETER
        # 123: ERROR_INVALID_NAME
        # 1920: ERROR_CANT_ACCESS_FILE
        # 1921: ERROR_CANT_RESOLVE_FILENAME (implies unfollowable symlink)
        allowed_winerror = 1, 2, 3, 5, 21, 32, 50, 67, 87, 123, 1920, 1921

        # Non-strict algorithm is to find as much of the target directory
        # as we can and join the rest.
        tail = ''
        while path:
            try:
                path = _getfinalpathname(path)
                return join(path, tail) if tail else path
            except OSError as ex:
                if ex.winerror not in allowed_winerror:
                    raise
                try:
                    # The OS could not resolve this path fully, so we attempt
                    # to follow the link ourselves. If we succeed, join the tail
                    # and return.
                    new_path = _readlink_deep(path)
                    if new_path != path:
                        return join(new_path, tail) if tail else new_path
                except OSError:
                    # If we fail to readlink(), let's keep traversing
                    pass
                path, name = split(path)
                # TODO (bpo-38186): Request the real file name from the directory
                # entry using FindFirstFileW. For now, we will return the path
                # as best we have it
                if path and not name:
                    return path + tail
                tail = join(name, tail) if tail else name
        return tail

    def realpath(path):
        path = normpath(path)
        if isinstance(path, bytes):
            prefix = b'\\\\?\\'
            unc_prefix = b'\\\\?\\UNC\\'
            new_unc_prefix = b'\\\\'
            cwd = os.getcwdb()
            # bpo-38081: Special case for realpath(b'nul')
            if normcase(path) == normcase(os.fsencode(devnull)):
                return b'\\\\.\\NUL'
        else:
            prefix = '\\\\?\\'
            unc_prefix = '\\\\?\\UNC\\'
            new_unc_prefix = '\\\\'
            cwd = os.getcwd()
            # bpo-38081: Special case for realpath('nul')
            if normcase(path) == normcase(devnull):
                return '\\\\.\\NUL'
        had_prefix = path.startswith(prefix)
        if not had_prefix and not isabs(path):
            path = join(cwd, path)
        try:
            path = _getfinalpathname(path)
            initial_winerror = 0
        except OSError as ex:
            initial_winerror = ex.winerror
            path = _getfinalpathname_nonstrict(path)
        # The path returned by _getfinalpathname will always start with \\?\ -
        # strip off that prefix unless it was already provided on the original
        # path.
        if not had_prefix and path.startswith(prefix):
            # For UNC paths, the prefix will actually be \\?\UNC\
            # Handle that case as well.
            if path.startswith(unc_prefix):
                spath = new_unc_prefix + path[len(unc_prefix):]
            else:
                spath = path[len(prefix):]
            # Ensure that the non-prefixed path resolves to the same path
            try:
                if _getfinalpathname(spath) == path:
                    path = spath
            except OSError as ex:
                # If the path does not exist and originally did not exist, then
                # strip the prefix anyway.
                if ex.winerror == initial_winerror:
                    path = spath
        return path


# Win9x family and earlier have no Unicode filename support.
supports_unicode_filenames = (hasattr(sys, "getwindowsversion") and
                              sys.getwindowsversion()[3] >= 2)

def relpath(path, start=None):
    """Return a relative version of a path"""
    path = os.fspath(path)
    if isinstance(path, bytes):
        sep = b'\\'
        curdir = b'.'
        pardir = b'..'
    else:
        sep = '\\'
        curdir = '.'
        pardir = '..'

    if start is None:
        start = curdir

    if not path:
        raise ValueError("no path specified")

    start = os.fspath(start)
    try:
        start_abs = abspath(normpath(start))
        path_abs = abspath(normpath(path))
        start_drive, start_rest = splitdrive(start_abs)
        path_drive, path_rest = splitdrive(path_abs)
        if normcase(start_drive) != normcase(path_drive):
            raise ValueError("path is on mount %r, start on mount %r" % (
                path_drive, start_drive))

        start_list = [x for x in start_rest.split(sep) if x]
        path_list = [x for x in path_rest.split(sep) if x]
        # Work out how much of the filepath is shared by start and path.
        i = 0
        for e1, e2 in zip(start_list, path_list):
            if normcase(e1) != normcase(e2):
                break
            i += 1

        rel_list = [pardir] * (len(start_list)-i) + path_list[i:]
        if not rel_list:
            return curdir
        return join(*rel_list)
    except (TypeError, ValueError, AttributeError, BytesWarning, DeprecationWarning):
        genericpath._check_arg_types('relpath', path, start)
        raise


# Return the longest common sub-path of the sequence of paths given as input.
# The function is case-insensitive and 'separator-insensitive', i.e. if the
# only difference between two paths is the use of '\' versus '/' as separator,
# they are deemed to be equal.
#
# However, the returned path will have the standard '\' separator (even if the
# given paths had the alternative '/' separator) and will have the case of the
# first path given in the sequence. Additionally, any trailing separator is
# stripped from the returned path.

def commonpath(paths):
    """Given a sequence of path names, returns the longest common sub-path."""

    if not paths:
        raise ValueError('commonpath() arg is an empty sequence')

    paths = tuple(map(os.fspath, paths))
    if isinstance(paths[0], bytes):
        sep = b'\\'
        altsep = b'/'
        curdir = b'.'
    else:
        sep = '\\'
        altsep = '/'
        curdir = '.'

    try:
        drivesplits = [splitdrive(p.replace(altsep, sep).lower()) for p in paths]
        split_paths = [p.split(sep) for d, p in drivesplits]

        try:
            isabs, = set(p[:1] == sep for d, p in drivesplits)
        except ValueError:
            raise ValueError("Can't mix absolute and relative paths") from None

        # Check that all drive letters or UNC paths match. The check is made only
        # now otherwise type errors for mixing strings and bytes would not be
        # caught.
        if len(set(d for d, p in drivesplits)) != 1:
            raise ValueError("Paths don't have the same drive")

        drive, path = splitdrive(paths[0].replace(altsep, sep))
        common = path.split(sep)
        common = [c for c in common if c and c != curdir]

        split_paths = [[c for c in s if c and c != curdir] for s in split_paths]
        s1 = min(split_paths)
        s2 = max(split_paths)
        for i, c in enumerate(s1):
            if c != s2[i]:
                common = common[:i]
                break
        else:
            common = common[:len(s1)]

        prefix = drive + sep if isabs else drive
        return prefix + sep.join(common)
    except (TypeError, AttributeError):
        genericpath._check_arg_types('commonpath', *paths)
        raise


try:
    # The genericpath.isdir implementation uses os.stat and checks the mode
    # attribute to tell whether or not the path is a directory.
    # This is overkill on Windows - just pass the path to GetFileAttributes
    # and check the attribute from there.
    from nt import _isdir as isdir
except ImportError:
    # Use genericpath.isdir as imported above.
    pass
smtplib.py000075500000127711151153537470006617 0ustar00#! /usr/bin/python3.8

'''SMTP/ESMTP client class.

This should follow RFC 821 (SMTP), RFC 1869 (ESMTP), RFC 2554 (SMTP
Authentication) and RFC 2487 (Secure SMTP over TLS).

Notes:

Please remember, when doing ESMTP, that the names of the SMTP service
extensions are NOT the same thing as the option keywords for the RCPT
and MAIL commands!

Example:

  >>> import smtplib
  >>> s=smtplib.SMTP("localhost")
  >>> print(s.help())
  This is Sendmail version 8.8.4
  Topics:
      HELO    EHLO    MAIL    RCPT    DATA
      RSET    NOOP    QUIT    HELP    VRFY
      EXPN    VERB    ETRN    DSN
  For more info use "HELP <topic>".
  To report bugs in the implementation send email to
      sendmail-bugs@sendmail.org.
  For local information send email to Postmaster at your site.
  End of HELP info
  >>> s.putcmd("vrfy","someone@here")
  >>> s.getreply()
  (250, "Somebody OverHere <somebody@here.my.org>")
  >>> s.quit()
'''

# Author: The Dragon De Monsyne <dragondm@integral.org>
# ESMTP support, test code and doc fixes added by
#     Eric S. Raymond <esr@thyrsus.com>
# Better RFC 821 compliance (MAIL and RCPT, and CRLF in data)
#     by Carey Evans <c.evans@clear.net.nz>, for picky mail servers.
# RFC 2554 (authentication) support by Gerhard Haering <gerhard@bigfoot.de>.
#
# This was modified from the Python 1.5 library HTTP lib.

import socket
import io
import re
import email.utils
import email.message
import email.generator
import base64
import hmac
import copy
import datetime
import sys
from email.base64mime import body_encode as encode_base64

__all__ = ["SMTPException", "SMTPNotSupportedError", "SMTPServerDisconnected", "SMTPResponseException",
           "SMTPSenderRefused", "SMTPRecipientsRefused", "SMTPDataError",
           "SMTPConnectError", "SMTPHeloError", "SMTPAuthenticationError",
           "quoteaddr", "quotedata", "SMTP"]

SMTP_PORT = 25
SMTP_SSL_PORT = 465
CRLF = "\r\n"
bCRLF = b"\r\n"
_MAXLINE = 8192 # more than 8 times larger than RFC 821, 4.5.3
_MAXCHALLENGE = 5  # Maximum number of AUTH challenges sent

OLDSTYLE_AUTH = re.compile(r"auth=(.*)", re.I)

# Exception classes used by this module.
class SMTPException(OSError):
    """Base class for all exceptions raised by this module."""

class SMTPNotSupportedError(SMTPException):
    """The command or option is not supported by the SMTP server.

    This exception is raised when an attempt is made to run a command or a
    command with an option which is not supported by the server.
    """

class SMTPServerDisconnected(SMTPException):
    """Not connected to any SMTP server.

    This exception is raised when the server unexpectedly disconnects,
    or when an attempt is made to use the SMTP instance before
    connecting it to a server.
    """

class SMTPResponseException(SMTPException):
    """Base class for all exceptions that include an SMTP error code.

    These exceptions are generated in some instances when the SMTP
    server returns an error code.  The error code is stored in the
    `smtp_code' attribute of the error, and the `smtp_error' attribute
    is set to the error message.
    """

    def __init__(self, code, msg):
        self.smtp_code = code
        self.smtp_error = msg
        self.args = (code, msg)

class SMTPSenderRefused(SMTPResponseException):
    """Sender address refused.

    In addition to the attributes set by on all SMTPResponseException
    exceptions, this sets `sender' to the string that the SMTP refused.
    """

    def __init__(self, code, msg, sender):
        self.smtp_code = code
        self.smtp_error = msg
        self.sender = sender
        self.args = (code, msg, sender)

class SMTPRecipientsRefused(SMTPException):
    """All recipient addresses refused.

    The errors for each recipient are accessible through the attribute
    'recipients', which is a dictionary of exactly the same sort as
    SMTP.sendmail() returns.
    """

    def __init__(self, recipients):
        self.recipients = recipients
        self.args = (recipients,)


class SMTPDataError(SMTPResponseException):
    """The SMTP server didn't accept the data."""

class SMTPConnectError(SMTPResponseException):
    """Error during connection establishment."""

class SMTPHeloError(SMTPResponseException):
    """The server refused our HELO reply."""

class SMTPAuthenticationError(SMTPResponseException):
    """Authentication error.

    Most probably the server didn't accept the username/password
    combination provided.
    """

def quoteaddr(addrstring):
    """Quote a subset of the email addresses defined by RFC 821.

    Should be able to handle anything email.utils.parseaddr can handle.
    """
    displayname, addr = email.utils.parseaddr(addrstring)
    if (displayname, addr) == ('', ''):
        # parseaddr couldn't parse it, use it as is and hope for the best.
        if addrstring.strip().startswith('<'):
            return addrstring
        return "<%s>" % addrstring
    return "<%s>" % addr

def _addr_only(addrstring):
    displayname, addr = email.utils.parseaddr(addrstring)
    if (displayname, addr) == ('', ''):
        # parseaddr couldn't parse it, so use it as is.
        return addrstring
    return addr

# Legacy method kept for backward compatibility.
def quotedata(data):
    """Quote data for email.

    Double leading '.', and change Unix newline '\\n', or Mac '\\r' into
    Internet CRLF end-of-line.
    """
    return re.sub(r'(?m)^\.', '..',
        re.sub(r'(?:\r\n|\n|\r(?!\n))', CRLF, data))

def _quote_periods(bindata):
    return re.sub(br'(?m)^\.', b'..', bindata)

def _fix_eols(data):
    return  re.sub(r'(?:\r\n|\n|\r(?!\n))', CRLF, data)

try:
    import ssl
except ImportError:
    _have_ssl = False
else:
    _have_ssl = True


class SMTP:
    """This class manages a connection to an SMTP or ESMTP server.
    SMTP Objects:
        SMTP objects have the following attributes:
            helo_resp
                This is the message given by the server in response to the
                most recent HELO command.

            ehlo_resp
                This is the message given by the server in response to the
                most recent EHLO command. This is usually multiline.

            does_esmtp
                This is a True value _after you do an EHLO command_, if the
                server supports ESMTP.

            esmtp_features
                This is a dictionary, which, if the server supports ESMTP,
                will _after you do an EHLO command_, contain the names of the
                SMTP service extensions this server supports, and their
                parameters (if any).

                Note, all extension names are mapped to lower case in the
                dictionary.

        See each method's docstrings for details.  In general, there is a
        method of the same name to perform each SMTP command.  There is also a
        method called 'sendmail' that will do an entire mail transaction.
        """
    debuglevel = 0

    sock = None
    file = None
    helo_resp = None
    ehlo_msg = "ehlo"
    ehlo_resp = None
    does_esmtp = 0
    default_port = SMTP_PORT

    def __init__(self, host='', port=0, local_hostname=None,
                 timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
                 source_address=None):
        """Initialize a new instance.

        If specified, `host` is the name of the remote host to which to
        connect.  If specified, `port` specifies the port to which to connect.
        By default, smtplib.SMTP_PORT is used.  If a host is specified the
        connect method is called, and if it returns anything other than a
        success code an SMTPConnectError is raised.  If specified,
        `local_hostname` is used as the FQDN of the local host in the HELO/EHLO
        command.  Otherwise, the local hostname is found using
        socket.getfqdn(). The `source_address` parameter takes a 2-tuple (host,
        port) for the socket to bind to as its source address before
        connecting. If the host is '' and port is 0, the OS default behavior
        will be used.

        """
        self._host = host
        self.timeout = timeout
        self.esmtp_features = {}
        self.command_encoding = 'ascii'
        self.source_address = source_address
        self._auth_challenge_count = 0

        if host:
            (code, msg) = self.connect(host, port)
            if code != 220:
                self.close()
                raise SMTPConnectError(code, msg)
        if local_hostname is not None:
            self.local_hostname = local_hostname
        else:
            # RFC 2821 says we should use the fqdn in the EHLO/HELO verb, and
            # if that can't be calculated, that we should use a domain literal
            # instead (essentially an encoded IP address like [A.B.C.D]).
            fqdn = socket.getfqdn()
            if '.' in fqdn:
                self.local_hostname = fqdn
            else:
                # We can't find an fqdn hostname, so use a domain literal
                addr = '127.0.0.1'
                try:
                    addr = socket.gethostbyname(socket.gethostname())
                except socket.gaierror:
                    pass
                self.local_hostname = '[%s]' % addr

    def __enter__(self):
        return self

    def __exit__(self, *args):
        try:
            code, message = self.docmd("QUIT")
            if code != 221:
                raise SMTPResponseException(code, message)
        except SMTPServerDisconnected:
            pass
        finally:
            self.close()

    def set_debuglevel(self, debuglevel):
        """Set the debug output level.

        A non-false value results in debug messages for connection and for all
        messages sent to and received from the server.

        """
        self.debuglevel = debuglevel

    def _print_debug(self, *args):
        if self.debuglevel > 1:
            print(datetime.datetime.now().time(), *args, file=sys.stderr)
        else:
            print(*args, file=sys.stderr)

    def _get_socket(self, host, port, timeout):
        # This makes it simpler for SMTP_SSL to use the SMTP connect code
        # and just alter the socket connection bit.
        if self.debuglevel > 0:
            self._print_debug('connect: to', (host, port), self.source_address)
        return socket.create_connection((host, port), timeout,
                                        self.source_address)

    def connect(self, host='localhost', port=0, source_address=None):
        """Connect to a host on a given port.

        If the hostname ends with a colon (`:') followed by a number, and
        there is no port specified, that suffix will be stripped off and the
        number interpreted as the port number to use.

        Note: This method is automatically invoked by __init__, if a host is
        specified during instantiation.

        """

        if source_address:
            self.source_address = source_address

        if not port and (host.find(':') == host.rfind(':')):
            i = host.rfind(':')
            if i >= 0:
                host, port = host[:i], host[i + 1:]
                try:
                    port = int(port)
                except ValueError:
                    raise OSError("nonnumeric port")
        if not port:
            port = self.default_port
        sys.audit("smtplib.connect", self, host, port)
        self.sock = self._get_socket(host, port, self.timeout)
        self.file = None
        (code, msg) = self.getreply()
        if self.debuglevel > 0:
            self._print_debug('connect:', repr(msg))
        return (code, msg)

    def send(self, s):
        """Send `s' to the server."""
        if self.debuglevel > 0:
            self._print_debug('send:', repr(s))
        if self.sock:
            if isinstance(s, str):
                # send is used by the 'data' command, where command_encoding
                # should not be used, but 'data' needs to convert the string to
                # binary itself anyway, so that's not a problem.
                s = s.encode(self.command_encoding)
            sys.audit("smtplib.send", self, s)
            try:
                self.sock.sendall(s)
            except OSError:
                self.close()
                raise SMTPServerDisconnected('Server not connected')
        else:
            raise SMTPServerDisconnected('please run connect() first')

    def putcmd(self, cmd, args=""):
        """Send a command to the server."""
        if args == "":
            s = cmd
        else:
            s = f'{cmd} {args}'
        if '\r' in s or '\n' in s:
            s = s.replace('\n', '\\n').replace('\r', '\\r')
            raise ValueError(
                f'command and arguments contain prohibited newline characters: {s}'
            )
        self.send(f'{s}{CRLF}')

    def getreply(self):
        """Get a reply from the server.

        Returns a tuple consisting of:

          - server response code (e.g. '250', or such, if all goes well)
            Note: returns -1 if it can't read response code.

          - server response string corresponding to response code (multiline
            responses are converted to a single, multiline string).

        Raises SMTPServerDisconnected if end-of-file is reached.
        """
        resp = []
        if self.file is None:
            self.file = self.sock.makefile('rb')
        while 1:
            try:
                line = self.file.readline(_MAXLINE + 1)
            except OSError as e:
                self.close()
                raise SMTPServerDisconnected("Connection unexpectedly closed: "
                                             + str(e))
            if not line:
                self.close()
                raise SMTPServerDisconnected("Connection unexpectedly closed")
            if self.debuglevel > 0:
                self._print_debug('reply:', repr(line))
            if len(line) > _MAXLINE:
                self.close()
                raise SMTPResponseException(500, "Line too long.")
            resp.append(line[4:].strip(b' \t\r\n'))
            code = line[:3]
            # Check that the error code is syntactically correct.
            # Don't attempt to read a continuation line if it is broken.
            try:
                errcode = int(code)
            except ValueError:
                errcode = -1
                break
            # Check if multiline response.
            if line[3:4] != b"-":
                break

        errmsg = b"\n".join(resp)
        if self.debuglevel > 0:
            self._print_debug('reply: retcode (%s); Msg: %a' % (errcode, errmsg))
        return errcode, errmsg

    def docmd(self, cmd, args=""):
        """Send a command, and return its response code."""
        self.putcmd(cmd, args)
        return self.getreply()

    # std smtp commands
    def helo(self, name=''):
        """SMTP 'helo' command.
        Hostname to send for this command defaults to the FQDN of the local
        host.
        """
        self.putcmd("helo", name or self.local_hostname)
        (code, msg) = self.getreply()
        self.helo_resp = msg
        return (code, msg)

    def ehlo(self, name=''):
        """ SMTP 'ehlo' command.
        Hostname to send for this command defaults to the FQDN of the local
        host.
        """
        self.esmtp_features = {}
        self.putcmd(self.ehlo_msg, name or self.local_hostname)
        (code, msg) = self.getreply()
        # According to RFC1869 some (badly written)
        # MTA's will disconnect on an ehlo. Toss an exception if
        # that happens -ddm
        if code == -1 and len(msg) == 0:
            self.close()
            raise SMTPServerDisconnected("Server not connected")
        self.ehlo_resp = msg
        if code != 250:
            return (code, msg)
        self.does_esmtp = 1
        #parse the ehlo response -ddm
        assert isinstance(self.ehlo_resp, bytes), repr(self.ehlo_resp)
        resp = self.ehlo_resp.decode("latin-1").split('\n')
        del resp[0]
        for each in resp:
            # To be able to communicate with as many SMTP servers as possible,
            # we have to take the old-style auth advertisement into account,
            # because:
            # 1) Else our SMTP feature parser gets confused.
            # 2) There are some servers that only advertise the auth methods we
            #    support using the old style.
            auth_match = OLDSTYLE_AUTH.match(each)
            if auth_match:
                # This doesn't remove duplicates, but that's no problem
                self.esmtp_features["auth"] = self.esmtp_features.get("auth", "") \
                        + " " + auth_match.groups(0)[0]
                continue

            # RFC 1869 requires a space between ehlo keyword and parameters.
            # It's actually stricter, in that only spaces are allowed between
            # parameters, but were not going to check for that here.  Note
            # that the space isn't present if there are no parameters.
            m = re.match(r'(?P<feature>[A-Za-z0-9][A-Za-z0-9\-]*) ?', each)
            if m:
                feature = m.group("feature").lower()
                params = m.string[m.end("feature"):].strip()
                if feature == "auth":
                    self.esmtp_features[feature] = self.esmtp_features.get(feature, "") \
                            + " " + params
                else:
                    self.esmtp_features[feature] = params
        return (code, msg)

    def has_extn(self, opt):
        """Does the server support a given SMTP service extension?"""
        return opt.lower() in self.esmtp_features

    def help(self, args=''):
        """SMTP 'help' command.
        Returns help text from server."""
        self.putcmd("help", args)
        return self.getreply()[1]

    def rset(self):
        """SMTP 'rset' command -- resets session."""
        self.command_encoding = 'ascii'
        return self.docmd("rset")

    def _rset(self):
        """Internal 'rset' command which ignores any SMTPServerDisconnected error.

        Used internally in the library, since the server disconnected error
        should appear to the application when the *next* command is issued, if
        we are doing an internal "safety" reset.
        """
        try:
            self.rset()
        except SMTPServerDisconnected:
            pass

    def noop(self):
        """SMTP 'noop' command -- doesn't do anything :>"""
        return self.docmd("noop")

    def mail(self, sender, options=()):
        """SMTP 'mail' command -- begins mail xfer session.

        This method may raise the following exceptions:

         SMTPNotSupportedError  The options parameter includes 'SMTPUTF8'
                                but the SMTPUTF8 extension is not supported by
                                the server.
        """
        optionlist = ''
        if options and self.does_esmtp:
            if any(x.lower()=='smtputf8' for x in options):
                if self.has_extn('smtputf8'):
                    self.command_encoding = 'utf-8'
                else:
                    raise SMTPNotSupportedError(
                        'SMTPUTF8 not supported by server')
            optionlist = ' ' + ' '.join(options)
        self.putcmd("mail", "FROM:%s%s" % (quoteaddr(sender), optionlist))
        return self.getreply()

    def rcpt(self, recip, options=()):
        """SMTP 'rcpt' command -- indicates 1 recipient for this mail."""
        optionlist = ''
        if options and self.does_esmtp:
            optionlist = ' ' + ' '.join(options)
        self.putcmd("rcpt", "TO:%s%s" % (quoteaddr(recip), optionlist))
        return self.getreply()

    def data(self, msg):
        """SMTP 'DATA' command -- sends message data to server.

        Automatically quotes lines beginning with a period per rfc821.
        Raises SMTPDataError if there is an unexpected reply to the
        DATA command; the return value from this method is the final
        response code received when the all data is sent.  If msg
        is a string, lone '\\r' and '\\n' characters are converted to
        '\\r\\n' characters.  If msg is bytes, it is transmitted as is.
        """
        self.putcmd("data")
        (code, repl) = self.getreply()
        if self.debuglevel > 0:
            self._print_debug('data:', (code, repl))
        if code != 354:
            raise SMTPDataError(code, repl)
        else:
            if isinstance(msg, str):
                msg = _fix_eols(msg).encode('ascii')
            q = _quote_periods(msg)
            if q[-2:] != bCRLF:
                q = q + bCRLF
            q = q + b"." + bCRLF
            self.send(q)
            (code, msg) = self.getreply()
            if self.debuglevel > 0:
                self._print_debug('data:', (code, msg))
            return (code, msg)

    def verify(self, address):
        """SMTP 'verify' command -- checks for address validity."""
        self.putcmd("vrfy", _addr_only(address))
        return self.getreply()
    # a.k.a.
    vrfy = verify

    def expn(self, address):
        """SMTP 'expn' command -- expands a mailing list."""
        self.putcmd("expn", _addr_only(address))
        return self.getreply()

    # some useful methods

    def ehlo_or_helo_if_needed(self):
        """Call self.ehlo() and/or self.helo() if needed.

        If there has been no previous EHLO or HELO command this session, this
        method tries ESMTP EHLO first.

        This method may raise the following exceptions:

         SMTPHeloError            The server didn't reply properly to
                                  the helo greeting.
        """
        if self.helo_resp is None and self.ehlo_resp is None:
            if not (200 <= self.ehlo()[0] <= 299):
                (code, resp) = self.helo()
                if not (200 <= code <= 299):
                    raise SMTPHeloError(code, resp)

    def auth(self, mechanism, authobject, *, initial_response_ok=True):
        """Authentication command - requires response processing.

        'mechanism' specifies which authentication mechanism is to
        be used - the valid values are those listed in the 'auth'
        element of 'esmtp_features'.

        'authobject' must be a callable object taking a single argument:

                data = authobject(challenge)

        It will be called to process the server's challenge response; the
        challenge argument it is passed will be a bytes.  It should return
        an ASCII string that will be base64 encoded and sent to the server.

        Keyword arguments:
            - initial_response_ok: Allow sending the RFC 4954 initial-response
              to the AUTH command, if the authentication methods supports it.
        """
        # RFC 4954 allows auth methods to provide an initial response.  Not all
        # methods support it.  By definition, if they return something other
        # than None when challenge is None, then they do.  See issue #15014.
        mechanism = mechanism.upper()
        initial_response = (authobject() if initial_response_ok else None)
        if initial_response is not None:
            response = encode_base64(initial_response.encode('ascii'), eol='')
            (code, resp) = self.docmd("AUTH", mechanism + " " + response)
            self._auth_challenge_count = 1
        else:
            (code, resp) = self.docmd("AUTH", mechanism)
            self._auth_challenge_count = 0
        # If server responds with a challenge, send the response.
        while code == 334:
            self._auth_challenge_count += 1
            challenge = base64.decodebytes(resp)
            response = encode_base64(
                authobject(challenge).encode('ascii'), eol='')
            (code, resp) = self.docmd(response)
            # If server keeps sending challenges, something is wrong.
            if self._auth_challenge_count > _MAXCHALLENGE:
                raise SMTPException(
                    "Server AUTH mechanism infinite loop. Last response: "
                    + repr((code, resp))
                )
        if code in (235, 503):
            return (code, resp)
        raise SMTPAuthenticationError(code, resp)

    def auth_cram_md5(self, challenge=None):
        """ Authobject to use with CRAM-MD5 authentication. Requires self.user
        and self.password to be set."""
        # CRAM-MD5 does not support initial-response.
        if challenge is None:
            return None
        return self.user + " " + hmac.HMAC(
            self.password.encode('ascii'), challenge, 'md5').hexdigest()

    def auth_plain(self, challenge=None):
        """ Authobject to use with PLAIN authentication. Requires self.user and
        self.password to be set."""
        return "\0%s\0%s" % (self.user, self.password)

    def auth_login(self, challenge=None):
        """ Authobject to use with LOGIN authentication. Requires self.user and
        self.password to be set."""
        if challenge is None or self._auth_challenge_count < 2:
            return self.user
        else:
            return self.password

    def login(self, user, password, *, initial_response_ok=True):
        """Log in on an SMTP server that requires authentication.

        The arguments are:
            - user:         The user name to authenticate with.
            - password:     The password for the authentication.

        Keyword arguments:
            - initial_response_ok: Allow sending the RFC 4954 initial-response
              to the AUTH command, if the authentication methods supports it.

        If there has been no previous EHLO or HELO command this session, this
        method tries ESMTP EHLO first.

        This method will return normally if the authentication was successful.

        This method may raise the following exceptions:

         SMTPHeloError            The server didn't reply properly to
                                  the helo greeting.
         SMTPAuthenticationError  The server didn't accept the username/
                                  password combination.
         SMTPNotSupportedError    The AUTH command is not supported by the
                                  server.
         SMTPException            No suitable authentication method was
                                  found.
        """

        self.ehlo_or_helo_if_needed()
        if not self.has_extn("auth"):
            raise SMTPNotSupportedError(
                "SMTP AUTH extension not supported by server.")

        # Authentication methods the server claims to support
        advertised_authlist = self.esmtp_features["auth"].split()

        # Authentication methods we can handle in our preferred order:
        preferred_auths = ['CRAM-MD5', 'PLAIN', 'LOGIN']

        # We try the supported authentications in our preferred order, if
        # the server supports them.
        authlist = [auth for auth in preferred_auths
                    if auth in advertised_authlist]
        if not authlist:
            raise SMTPException("No suitable authentication method found.")

        # Some servers advertise authentication methods they don't really
        # support, so if authentication fails, we continue until we've tried
        # all methods.
        self.user, self.password = user, password
        for authmethod in authlist:
            method_name = 'auth_' + authmethod.lower().replace('-', '_')
            try:
                (code, resp) = self.auth(
                    authmethod, getattr(self, method_name),
                    initial_response_ok=initial_response_ok)
                # 235 == 'Authentication successful'
                # 503 == 'Error: already authenticated'
                if code in (235, 503):
                    return (code, resp)
            except SMTPAuthenticationError as e:
                last_exception = e

        # We could not login successfully.  Return result of last attempt.
        raise last_exception

    def starttls(self, keyfile=None, certfile=None, context=None):
        """Puts the connection to the SMTP server into TLS mode.

        If there has been no previous EHLO or HELO command this session, this
        method tries ESMTP EHLO first.

        If the server supports TLS, this will encrypt the rest of the SMTP
        session. If you provide the keyfile and certfile parameters,
        the identity of the SMTP server and client can be checked. This,
        however, depends on whether the socket module really checks the
        certificates.

        This method may raise the following exceptions:

         SMTPHeloError            The server didn't reply properly to
                                  the helo greeting.
        """
        self.ehlo_or_helo_if_needed()
        if not self.has_extn("starttls"):
            raise SMTPNotSupportedError(
                "STARTTLS extension not supported by server.")
        (resp, reply) = self.docmd("STARTTLS")
        if resp == 220:
            if not _have_ssl:
                raise RuntimeError("No SSL support included in this Python")
            if context is not None and keyfile is not None:
                raise ValueError("context and keyfile arguments are mutually "
                                 "exclusive")
            if context is not None and certfile is not None:
                raise ValueError("context and certfile arguments are mutually "
                                 "exclusive")
            if keyfile is not None or certfile is not None:
                import warnings
                warnings.warn("keyfile and certfile are deprecated, use a "
                              "custom context instead", DeprecationWarning, 2)
            if context is None:
                context = ssl._create_stdlib_context(certfile=certfile,
                                                     keyfile=keyfile)
            self.sock = context.wrap_socket(self.sock,
                                            server_hostname=self._host)
            self.file = None
            # RFC 3207:
            # The client MUST discard any knowledge obtained from
            # the server, such as the list of SMTP service extensions,
            # which was not obtained from the TLS negotiation itself.
            self.helo_resp = None
            self.ehlo_resp = None
            self.esmtp_features = {}
            self.does_esmtp = 0
        else:
            # RFC 3207:
            # 501 Syntax error (no parameters allowed)
            # 454 TLS not available due to temporary reason
            raise SMTPResponseException(resp, reply)
        return (resp, reply)

    def sendmail(self, from_addr, to_addrs, msg, mail_options=(),
                 rcpt_options=()):
        """This command performs an entire mail transaction.

        The arguments are:
            - from_addr    : The address sending this mail.
            - to_addrs     : A list of addresses to send this mail to.  A bare
                             string will be treated as a list with 1 address.
            - msg          : The message to send.
            - mail_options : List of ESMTP options (such as 8bitmime) for the
                             mail command.
            - rcpt_options : List of ESMTP options (such as DSN commands) for
                             all the rcpt commands.

        msg may be a string containing characters in the ASCII range, or a byte
        string.  A string is encoded to bytes using the ascii codec, and lone
        \\r and \\n characters are converted to \\r\\n characters.

        If there has been no previous EHLO or HELO command this session, this
        method tries ESMTP EHLO first.  If the server does ESMTP, message size
        and each of the specified options will be passed to it.  If EHLO
        fails, HELO will be tried and ESMTP options suppressed.

        This method will return normally if the mail is accepted for at least
        one recipient.  It returns a dictionary, with one entry for each
        recipient that was refused.  Each entry contains a tuple of the SMTP
        error code and the accompanying error message sent by the server.

        This method may raise the following exceptions:

         SMTPHeloError          The server didn't reply properly to
                                the helo greeting.
         SMTPRecipientsRefused  The server rejected ALL recipients
                                (no mail was sent).
         SMTPSenderRefused      The server didn't accept the from_addr.
         SMTPDataError          The server replied with an unexpected
                                error code (other than a refusal of
                                a recipient).
         SMTPNotSupportedError  The mail_options parameter includes 'SMTPUTF8'
                                but the SMTPUTF8 extension is not supported by
                                the server.

        Note: the connection will be open even after an exception is raised.

        Example:

         >>> import smtplib
         >>> s=smtplib.SMTP("localhost")
         >>> tolist=["one@one.org","two@two.org","three@three.org","four@four.org"]
         >>> msg = '''\\
         ... From: Me@my.org
         ... Subject: testin'...
         ...
         ... This is a test '''
         >>> s.sendmail("me@my.org",tolist,msg)
         { "three@three.org" : ( 550 ,"User unknown" ) }
         >>> s.quit()

        In the above example, the message was accepted for delivery to three
        of the four addresses, and one was rejected, with the error code
        550.  If all addresses are accepted, then the method will return an
        empty dictionary.

        """
        self.ehlo_or_helo_if_needed()
        esmtp_opts = []
        if isinstance(msg, str):
            msg = _fix_eols(msg).encode('ascii')
        if self.does_esmtp:
            if self.has_extn('size'):
                esmtp_opts.append("size=%d" % len(msg))
            for option in mail_options:
                esmtp_opts.append(option)
        (code, resp) = self.mail(from_addr, esmtp_opts)
        if code != 250:
            if code == 421:
                self.close()
            else:
                self._rset()
            raise SMTPSenderRefused(code, resp, from_addr)
        senderrs = {}
        if isinstance(to_addrs, str):
            to_addrs = [to_addrs]
        for each in to_addrs:
            (code, resp) = self.rcpt(each, rcpt_options)
            if (code != 250) and (code != 251):
                senderrs[each] = (code, resp)
            if code == 421:
                self.close()
                raise SMTPRecipientsRefused(senderrs)
        if len(senderrs) == len(to_addrs):
            # the server refused all our recipients
            self._rset()
            raise SMTPRecipientsRefused(senderrs)
        (code, resp) = self.data(msg)
        if code != 250:
            if code == 421:
                self.close()
            else:
                self._rset()
            raise SMTPDataError(code, resp)
        #if we got here then somebody got our mail
        return senderrs

    def send_message(self, msg, from_addr=None, to_addrs=None,
                     mail_options=(), rcpt_options=()):
        """Converts message to a bytestring and passes it to sendmail.

        The arguments are as for sendmail, except that msg is an
        email.message.Message object.  If from_addr is None or to_addrs is
        None, these arguments are taken from the headers of the Message as
        described in RFC 2822 (a ValueError is raised if there is more than
        one set of 'Resent-' headers).  Regardless of the values of from_addr and
        to_addr, any Bcc field (or Resent-Bcc field, when the Message is a
        resent) of the Message object won't be transmitted.  The Message
        object is then serialized using email.generator.BytesGenerator and
        sendmail is called to transmit the message.  If the sender or any of
        the recipient addresses contain non-ASCII and the server advertises the
        SMTPUTF8 capability, the policy is cloned with utf8 set to True for the
        serialization, and SMTPUTF8 and BODY=8BITMIME are asserted on the send.
        If the server does not support SMTPUTF8, an SMTPNotSupported error is
        raised.  Otherwise the generator is called without modifying the
        policy.

        """
        # 'Resent-Date' is a mandatory field if the Message is resent (RFC 2822
        # Section 3.6.6). In such a case, we use the 'Resent-*' fields.  However,
        # if there is more than one 'Resent-' block there's no way to
        # unambiguously determine which one is the most recent in all cases,
        # so rather than guess we raise a ValueError in that case.
        #
        # TODO implement heuristics to guess the correct Resent-* block with an
        # option allowing the user to enable the heuristics.  (It should be
        # possible to guess correctly almost all of the time.)

        self.ehlo_or_helo_if_needed()
        resent = msg.get_all('Resent-Date')
        if resent is None:
            header_prefix = ''
        elif len(resent) == 1:
            header_prefix = 'Resent-'
        else:
            raise ValueError("message has more than one 'Resent-' header block")
        if from_addr is None:
            # Prefer the sender field per RFC 2822:3.6.2.
            from_addr = (msg[header_prefix + 'Sender']
                           if (header_prefix + 'Sender') in msg
                           else msg[header_prefix + 'From'])
            from_addr = email.utils.getaddresses([from_addr])[0][1]
        if to_addrs is None:
            addr_fields = [f for f in (msg[header_prefix + 'To'],
                                       msg[header_prefix + 'Bcc'],
                                       msg[header_prefix + 'Cc'])
                           if f is not None]
            to_addrs = [a[1] for a in email.utils.getaddresses(addr_fields)]
        # Make a local copy so we can delete the bcc headers.
        msg_copy = copy.copy(msg)
        del msg_copy['Bcc']
        del msg_copy['Resent-Bcc']
        international = False
        try:
            ''.join([from_addr, *to_addrs]).encode('ascii')
        except UnicodeEncodeError:
            if not self.has_extn('smtputf8'):
                raise SMTPNotSupportedError(
                    "One or more source or delivery addresses require"
                    " internationalized email support, but the server"
                    " does not advertise the required SMTPUTF8 capability")
            international = True
        with io.BytesIO() as bytesmsg:
            if international:
                g = email.generator.BytesGenerator(
                    bytesmsg, policy=msg.policy.clone(utf8=True))
                mail_options = (*mail_options, 'SMTPUTF8', 'BODY=8BITMIME')
            else:
                g = email.generator.BytesGenerator(bytesmsg)
            g.flatten(msg_copy, linesep='\r\n')
            flatmsg = bytesmsg.getvalue()
        return self.sendmail(from_addr, to_addrs, flatmsg, mail_options,
                             rcpt_options)

    def close(self):
        """Close the connection to the SMTP server."""
        try:
            file = self.file
            self.file = None
            if file:
                file.close()
        finally:
            sock = self.sock
            self.sock = None
            if sock:
                sock.close()

    def quit(self):
        """Terminate the SMTP session."""
        res = self.docmd("quit")
        # A new EHLO is required after reconnecting with connect()
        self.ehlo_resp = self.helo_resp = None
        self.esmtp_features = {}
        self.does_esmtp = False
        self.close()
        return res

if _have_ssl:

    class SMTP_SSL(SMTP):
        """ This is a subclass derived from SMTP that connects over an SSL
        encrypted socket (to use this class you need a socket module that was
        compiled with SSL support). If host is not specified, '' (the local
        host) is used. If port is omitted, the standard SMTP-over-SSL port
        (465) is used.  local_hostname and source_address have the same meaning
        as they do in the SMTP class.  keyfile and certfile are also optional -
        they can contain a PEM formatted private key and certificate chain file
        for the SSL connection. context also optional, can contain a
        SSLContext, and is an alternative to keyfile and certfile; If it is
        specified both keyfile and certfile must be None.

        """

        default_port = SMTP_SSL_PORT

        def __init__(self, host='', port=0, local_hostname=None,
                     keyfile=None, certfile=None,
                     timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
                     source_address=None, context=None):
            if context is not None and keyfile is not None:
                raise ValueError("context and keyfile arguments are mutually "
                                 "exclusive")
            if context is not None and certfile is not None:
                raise ValueError("context and certfile arguments are mutually "
                                 "exclusive")
            if keyfile is not None or certfile is not None:
                import warnings
                warnings.warn("keyfile and certfile are deprecated, use a "
                              "custom context instead", DeprecationWarning, 2)
            self.keyfile = keyfile
            self.certfile = certfile
            if context is None:
                context = ssl._create_stdlib_context(certfile=certfile,
                                                     keyfile=keyfile)
            self.context = context
            SMTP.__init__(self, host, port, local_hostname, timeout,
                    source_address)

        def _get_socket(self, host, port, timeout):
            if self.debuglevel > 0:
                self._print_debug('connect:', (host, port))
            new_socket = socket.create_connection((host, port), timeout,
                    self.source_address)
            new_socket = self.context.wrap_socket(new_socket,
                                                  server_hostname=self._host)
            return new_socket

    __all__.append("SMTP_SSL")

#
# LMTP extension
#
LMTP_PORT = 2003

class LMTP(SMTP):
    """LMTP - Local Mail Transfer Protocol

    The LMTP protocol, which is very similar to ESMTP, is heavily based
    on the standard SMTP client. It's common to use Unix sockets for
    LMTP, so our connect() method must support that as well as a regular
    host:port server.  local_hostname and source_address have the same
    meaning as they do in the SMTP class.  To specify a Unix socket,
    you must use an absolute path as the host, starting with a '/'.

    Authentication is supported, using the regular SMTP mechanism. When
    using a Unix socket, LMTP generally don't support or require any
    authentication, but your mileage might vary."""

    ehlo_msg = "lhlo"

    def __init__(self, host='', port=LMTP_PORT, local_hostname=None,
            source_address=None):
        """Initialize a new instance."""
        SMTP.__init__(self, host, port, local_hostname=local_hostname,
                      source_address=source_address)

    def connect(self, host='localhost', port=0, source_address=None):
        """Connect to the LMTP daemon, on either a Unix or a TCP socket."""
        if host[0] != '/':
            return SMTP.connect(self, host, port, source_address=source_address)

        # Handle Unix-domain sockets.
        try:
            self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
            self.file = None
            self.sock.connect(host)
        except OSError:
            if self.debuglevel > 0:
                self._print_debug('connect fail:', host)
            if self.sock:
                self.sock.close()
            self.sock = None
            raise
        (code, msg) = self.getreply()
        if self.debuglevel > 0:
            self._print_debug('connect:', msg)
        return (code, msg)


# Test the sendmail method, which tests most of the others.
# Note: This always sends to localhost.
if __name__ == '__main__':
    def prompt(prompt):
        sys.stdout.write(prompt + ": ")
        sys.stdout.flush()
        return sys.stdin.readline().strip()

    fromaddr = prompt("From")
    toaddrs = prompt("To").split(',')
    print("Enter message, end with ^D:")
    msg = ''
    while 1:
        line = sys.stdin.readline()
        if not line:
            break
        msg = msg + line
    print("Message length is %d" % len(msg))

    server = SMTP('localhost')
    server.set_debuglevel(1)
    server.sendmail(fromaddr, toaddrs, msg)
    server.quit()
concurrent/__init__.py000064400000000046151153537470011052 0ustar00# This directory is a Python package.
concurrent/futures/_base.py000064400000054420151153537470012066 0ustar00# Copyright 2009 Brian Quinlan. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

__author__ = 'Brian Quinlan (brian@sweetapp.com)'

import collections
import logging
import threading
import time

FIRST_COMPLETED = 'FIRST_COMPLETED'
FIRST_EXCEPTION = 'FIRST_EXCEPTION'
ALL_COMPLETED = 'ALL_COMPLETED'
_AS_COMPLETED = '_AS_COMPLETED'

# Possible future states (for internal use by the futures package).
PENDING = 'PENDING'
RUNNING = 'RUNNING'
# The future was cancelled by the user...
CANCELLED = 'CANCELLED'
# ...and _Waiter.add_cancelled() was called by a worker.
CANCELLED_AND_NOTIFIED = 'CANCELLED_AND_NOTIFIED'
FINISHED = 'FINISHED'

_FUTURE_STATES = [
    PENDING,
    RUNNING,
    CANCELLED,
    CANCELLED_AND_NOTIFIED,
    FINISHED
]

_STATE_TO_DESCRIPTION_MAP = {
    PENDING: "pending",
    RUNNING: "running",
    CANCELLED: "cancelled",
    CANCELLED_AND_NOTIFIED: "cancelled",
    FINISHED: "finished"
}

# Logger for internal use by the futures package.
LOGGER = logging.getLogger("concurrent.futures")

class Error(Exception):
    """Base class for all future-related exceptions."""
    pass

class CancelledError(Error):
    """The Future was cancelled."""
    pass

class TimeoutError(Error):
    """The operation exceeded the given deadline."""
    pass

class InvalidStateError(Error):
    """The operation is not allowed in this state."""
    pass

class _Waiter(object):
    """Provides the event that wait() and as_completed() block on."""
    def __init__(self):
        self.event = threading.Event()
        self.finished_futures = []

    def add_result(self, future):
        self.finished_futures.append(future)

    def add_exception(self, future):
        self.finished_futures.append(future)

    def add_cancelled(self, future):
        self.finished_futures.append(future)

class _AsCompletedWaiter(_Waiter):
    """Used by as_completed()."""

    def __init__(self):
        super(_AsCompletedWaiter, self).__init__()
        self.lock = threading.Lock()

    def add_result(self, future):
        with self.lock:
            super(_AsCompletedWaiter, self).add_result(future)
            self.event.set()

    def add_exception(self, future):
        with self.lock:
            super(_AsCompletedWaiter, self).add_exception(future)
            self.event.set()

    def add_cancelled(self, future):
        with self.lock:
            super(_AsCompletedWaiter, self).add_cancelled(future)
            self.event.set()

class _FirstCompletedWaiter(_Waiter):
    """Used by wait(return_when=FIRST_COMPLETED)."""

    def add_result(self, future):
        super().add_result(future)
        self.event.set()

    def add_exception(self, future):
        super().add_exception(future)
        self.event.set()

    def add_cancelled(self, future):
        super().add_cancelled(future)
        self.event.set()

class _AllCompletedWaiter(_Waiter):
    """Used by wait(return_when=FIRST_EXCEPTION and ALL_COMPLETED)."""

    def __init__(self, num_pending_calls, stop_on_exception):
        self.num_pending_calls = num_pending_calls
        self.stop_on_exception = stop_on_exception
        self.lock = threading.Lock()
        super().__init__()

    def _decrement_pending_calls(self):
        with self.lock:
            self.num_pending_calls -= 1
            if not self.num_pending_calls:
                self.event.set()

    def add_result(self, future):
        super().add_result(future)
        self._decrement_pending_calls()

    def add_exception(self, future):
        super().add_exception(future)
        if self.stop_on_exception:
            self.event.set()
        else:
            self._decrement_pending_calls()

    def add_cancelled(self, future):
        super().add_cancelled(future)
        self._decrement_pending_calls()

class _AcquireFutures(object):
    """A context manager that does an ordered acquire of Future conditions."""

    def __init__(self, futures):
        self.futures = sorted(futures, key=id)

    def __enter__(self):
        for future in self.futures:
            future._condition.acquire()

    def __exit__(self, *args):
        for future in self.futures:
            future._condition.release()

def _create_and_install_waiters(fs, return_when):
    if return_when == _AS_COMPLETED:
        waiter = _AsCompletedWaiter()
    elif return_when == FIRST_COMPLETED:
        waiter = _FirstCompletedWaiter()
    else:
        pending_count = sum(
                f._state not in [CANCELLED_AND_NOTIFIED, FINISHED] for f in fs)

        if return_when == FIRST_EXCEPTION:
            waiter = _AllCompletedWaiter(pending_count, stop_on_exception=True)
        elif return_when == ALL_COMPLETED:
            waiter = _AllCompletedWaiter(pending_count, stop_on_exception=False)
        else:
            raise ValueError("Invalid return condition: %r" % return_when)

    for f in fs:
        f._waiters.append(waiter)

    return waiter


def _yield_finished_futures(fs, waiter, ref_collect):
    """
    Iterate on the list *fs*, yielding finished futures one by one in
    reverse order.
    Before yielding a future, *waiter* is removed from its waiters
    and the future is removed from each set in the collection of sets
    *ref_collect*.

    The aim of this function is to avoid keeping stale references after
    the future is yielded and before the iterator resumes.
    """
    while fs:
        f = fs[-1]
        for futures_set in ref_collect:
            futures_set.remove(f)
        with f._condition:
            f._waiters.remove(waiter)
        del f
        # Careful not to keep a reference to the popped value
        yield fs.pop()


def as_completed(fs, timeout=None):
    """An iterator over the given futures that yields each as it completes.

    Args:
        fs: The sequence of Futures (possibly created by different Executors) to
            iterate over.
        timeout: The maximum number of seconds to wait. If None, then there
            is no limit on the wait time.

    Returns:
        An iterator that yields the given Futures as they complete (finished or
        cancelled). If any given Futures are duplicated, they will be returned
        once.

    Raises:
        TimeoutError: If the entire result iterator could not be generated
            before the given timeout.
    """
    if timeout is not None:
        end_time = timeout + time.monotonic()

    fs = set(fs)
    total_futures = len(fs)
    with _AcquireFutures(fs):
        finished = set(
                f for f in fs
                if f._state in [CANCELLED_AND_NOTIFIED, FINISHED])
        pending = fs - finished
        waiter = _create_and_install_waiters(fs, _AS_COMPLETED)
    finished = list(finished)
    try:
        yield from _yield_finished_futures(finished, waiter,
                                           ref_collect=(fs,))

        while pending:
            if timeout is None:
                wait_timeout = None
            else:
                wait_timeout = end_time - time.monotonic()
                if wait_timeout < 0:
                    raise TimeoutError(
                            '%d (of %d) futures unfinished' % (
                            len(pending), total_futures))

            waiter.event.wait(wait_timeout)

            with waiter.lock:
                finished = waiter.finished_futures
                waiter.finished_futures = []
                waiter.event.clear()

            # reverse to keep finishing order
            finished.reverse()
            yield from _yield_finished_futures(finished, waiter,
                                               ref_collect=(fs, pending))

    finally:
        # Remove waiter from unfinished futures
        for f in fs:
            with f._condition:
                f._waiters.remove(waiter)

DoneAndNotDoneFutures = collections.namedtuple(
        'DoneAndNotDoneFutures', 'done not_done')
def wait(fs, timeout=None, return_when=ALL_COMPLETED):
    """Wait for the futures in the given sequence to complete.

    Args:
        fs: The sequence of Futures (possibly created by different Executors) to
            wait upon.
        timeout: The maximum number of seconds to wait. If None, then there
            is no limit on the wait time.
        return_when: Indicates when this function should return. The options
            are:

            FIRST_COMPLETED - Return when any future finishes or is
                              cancelled.
            FIRST_EXCEPTION - Return when any future finishes by raising an
                              exception. If no future raises an exception
                              then it is equivalent to ALL_COMPLETED.
            ALL_COMPLETED -   Return when all futures finish or are cancelled.

    Returns:
        A named 2-tuple of sets. The first set, named 'done', contains the
        futures that completed (is finished or cancelled) before the wait
        completed. The second set, named 'not_done', contains uncompleted
        futures.
    """
    with _AcquireFutures(fs):
        done = set(f for f in fs
                   if f._state in [CANCELLED_AND_NOTIFIED, FINISHED])
        not_done = set(fs) - done

        if (return_when == FIRST_COMPLETED) and done:
            return DoneAndNotDoneFutures(done, not_done)
        elif (return_when == FIRST_EXCEPTION) and done:
            if any(f for f in done
                   if not f.cancelled() and f.exception() is not None):
                return DoneAndNotDoneFutures(done, not_done)

        if len(done) == len(fs):
            return DoneAndNotDoneFutures(done, not_done)

        waiter = _create_and_install_waiters(fs, return_when)

    waiter.event.wait(timeout)
    for f in fs:
        with f._condition:
            f._waiters.remove(waiter)

    done.update(waiter.finished_futures)
    return DoneAndNotDoneFutures(done, set(fs) - done)

class Future(object):
    """Represents the result of an asynchronous computation."""

    def __init__(self):
        """Initializes the future. Should not be called by clients."""
        self._condition = threading.Condition()
        self._state = PENDING
        self._result = None
        self._exception = None
        self._waiters = []
        self._done_callbacks = []

    def _invoke_callbacks(self):
        for callback in self._done_callbacks:
            try:
                callback(self)
            except Exception:
                LOGGER.exception('exception calling callback for %r', self)

    def __repr__(self):
        with self._condition:
            if self._state == FINISHED:
                if self._exception:
                    return '<%s at %#x state=%s raised %s>' % (
                        self.__class__.__name__,
                        id(self),
                        _STATE_TO_DESCRIPTION_MAP[self._state],
                        self._exception.__class__.__name__)
                else:
                    return '<%s at %#x state=%s returned %s>' % (
                        self.__class__.__name__,
                        id(self),
                        _STATE_TO_DESCRIPTION_MAP[self._state],
                        self._result.__class__.__name__)
            return '<%s at %#x state=%s>' % (
                    self.__class__.__name__,
                    id(self),
                   _STATE_TO_DESCRIPTION_MAP[self._state])

    def cancel(self):
        """Cancel the future if possible.

        Returns True if the future was cancelled, False otherwise. A future
        cannot be cancelled if it is running or has already completed.
        """
        with self._condition:
            if self._state in [RUNNING, FINISHED]:
                return False

            if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]:
                return True

            self._state = CANCELLED
            self._condition.notify_all()

        self._invoke_callbacks()
        return True

    def cancelled(self):
        """Return True if the future was cancelled."""
        with self._condition:
            return self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]

    def running(self):
        """Return True if the future is currently executing."""
        with self._condition:
            return self._state == RUNNING

    def done(self):
        """Return True of the future was cancelled or finished executing."""
        with self._condition:
            return self._state in [CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED]

    def __get_result(self):
        if self._exception:
            try:
                raise self._exception
            finally:
                # Break a reference cycle with the exception in self._exception
                self = None
        else:
            return self._result

    def add_done_callback(self, fn):
        """Attaches a callable that will be called when the future finishes.

        Args:
            fn: A callable that will be called with this future as its only
                argument when the future completes or is cancelled. The callable
                will always be called by a thread in the same process in which
                it was added. If the future has already completed or been
                cancelled then the callable will be called immediately. These
                callables are called in the order that they were added.
        """
        with self._condition:
            if self._state not in [CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED]:
                self._done_callbacks.append(fn)
                return
        try:
            fn(self)
        except Exception:
            LOGGER.exception('exception calling callback for %r', self)

    def result(self, timeout=None):
        """Return the result of the call that the future represents.

        Args:
            timeout: The number of seconds to wait for the result if the future
                isn't done. If None, then there is no limit on the wait time.

        Returns:
            The result of the call that the future represents.

        Raises:
            CancelledError: If the future was cancelled.
            TimeoutError: If the future didn't finish executing before the given
                timeout.
            Exception: If the call raised then that exception will be raised.
        """
        try:
            with self._condition:
                if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]:
                    raise CancelledError()
                elif self._state == FINISHED:
                    return self.__get_result()

                self._condition.wait(timeout)

                if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]:
                    raise CancelledError()
                elif self._state == FINISHED:
                    return self.__get_result()
                else:
                    raise TimeoutError()
        finally:
            # Break a reference cycle with the exception in self._exception
            self = None

    def exception(self, timeout=None):
        """Return the exception raised by the call that the future represents.

        Args:
            timeout: The number of seconds to wait for the exception if the
                future isn't done. If None, then there is no limit on the wait
                time.

        Returns:
            The exception raised by the call that the future represents or None
            if the call completed without raising.

        Raises:
            CancelledError: If the future was cancelled.
            TimeoutError: If the future didn't finish executing before the given
                timeout.
        """

        with self._condition:
            if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]:
                raise CancelledError()
            elif self._state == FINISHED:
                return self._exception

            self._condition.wait(timeout)

            if self._state in [CANCELLED, CANCELLED_AND_NOTIFIED]:
                raise CancelledError()
            elif self._state == FINISHED:
                return self._exception
            else:
                raise TimeoutError()

    # The following methods should only be used by Executors and in tests.
    def set_running_or_notify_cancel(self):
        """Mark the future as running or process any cancel notifications.

        Should only be used by Executor implementations and unit tests.

        If the future has been cancelled (cancel() was called and returned
        True) then any threads waiting on the future completing (though calls
        to as_completed() or wait()) are notified and False is returned.

        If the future was not cancelled then it is put in the running state
        (future calls to running() will return True) and True is returned.

        This method should be called by Executor implementations before
        executing the work associated with this future. If this method returns
        False then the work should not be executed.

        Returns:
            False if the Future was cancelled, True otherwise.

        Raises:
            RuntimeError: if this method was already called or if set_result()
                or set_exception() was called.
        """
        with self._condition:
            if self._state == CANCELLED:
                self._state = CANCELLED_AND_NOTIFIED
                for waiter in self._waiters:
                    waiter.add_cancelled(self)
                # self._condition.notify_all() is not necessary because
                # self.cancel() triggers a notification.
                return False
            elif self._state == PENDING:
                self._state = RUNNING
                return True
            else:
                LOGGER.critical('Future %s in unexpected state: %s',
                                id(self),
                                self._state)
                raise RuntimeError('Future in unexpected state')

    def set_result(self, result):
        """Sets the return value of work associated with the future.

        Should only be used by Executor implementations and unit tests.
        """
        with self._condition:
            if self._state in {CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED}:
                raise InvalidStateError('{}: {!r}'.format(self._state, self))
            self._result = result
            self._state = FINISHED
            for waiter in self._waiters:
                waiter.add_result(self)
            self._condition.notify_all()
        self._invoke_callbacks()

    def set_exception(self, exception):
        """Sets the result of the future as being the given exception.

        Should only be used by Executor implementations and unit tests.
        """
        with self._condition:
            if self._state in {CANCELLED, CANCELLED_AND_NOTIFIED, FINISHED}:
                raise InvalidStateError('{}: {!r}'.format(self._state, self))
            self._exception = exception
            self._state = FINISHED
            for waiter in self._waiters:
                waiter.add_exception(self)
            self._condition.notify_all()
        self._invoke_callbacks()

class Executor(object):
    """This is an abstract base class for concrete asynchronous executors."""

    def submit(*args, **kwargs):
        """Submits a callable to be executed with the given arguments.

        Schedules the callable to be executed as fn(*args, **kwargs) and returns
        a Future instance representing the execution of the callable.

        Returns:
            A Future representing the given call.
        """
        if len(args) >= 2:
            pass
        elif not args:
            raise TypeError("descriptor 'submit' of 'Executor' object "
                            "needs an argument")
        elif 'fn' in kwargs:
            import warnings
            warnings.warn("Passing 'fn' as keyword argument is deprecated",
                          DeprecationWarning, stacklevel=2)
        else:
            raise TypeError('submit expected at least 1 positional argument, '
                            'got %d' % (len(args)-1))

        raise NotImplementedError()
    submit.__text_signature__ = '($self, fn, /, *args, **kwargs)'

    def map(self, fn, *iterables, timeout=None, chunksize=1):
        """Returns an iterator equivalent to map(fn, iter).

        Args:
            fn: A callable that will take as many arguments as there are
                passed iterables.
            timeout: The maximum number of seconds to wait. If None, then there
                is no limit on the wait time.
            chunksize: The size of the chunks the iterable will be broken into
                before being passed to a child process. This argument is only
                used by ProcessPoolExecutor; it is ignored by
                ThreadPoolExecutor.

        Returns:
            An iterator equivalent to: map(func, *iterables) but the calls may
            be evaluated out-of-order.

        Raises:
            TimeoutError: If the entire result iterator could not be generated
                before the given timeout.
            Exception: If fn(*args) raises for any values.
        """
        if timeout is not None:
            end_time = timeout + time.monotonic()

        fs = [self.submit(fn, *args) for args in zip(*iterables)]

        # Yield must be hidden in closure so that the futures are submitted
        # before the first iterator value is required.
        def result_iterator():
            try:
                # reverse to keep finishing order
                fs.reverse()
                while fs:
                    # Careful not to keep a reference to the popped future
                    if timeout is None:
                        yield fs.pop().result()
                    else:
                        yield fs.pop().result(end_time - time.monotonic())
            finally:
                for future in fs:
                    future.cancel()
        return result_iterator()

    def shutdown(self, wait=True):
        """Clean-up the resources associated with the Executor.

        It is safe to call this method several times. Otherwise, no other
        methods can be called after this one.

        Args:
            wait: If True then shutdown will not return until all running
                futures have finished executing and the resources used by the
                executor have been reclaimed.
        """
        pass

    def __enter__(self):
        return self

    def __exit__(self, exc_type, exc_val, exc_tb):
        self.shutdown(wait=True)
        return False


class BrokenExecutor(RuntimeError):
    """
    Raised when a executor has become non-functional after a severe failure.
    """
concurrent/futures/thread.py000064400000021100151153537470012251 0ustar00# Copyright 2009 Brian Quinlan. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Implements ThreadPoolExecutor."""

__author__ = 'Brian Quinlan (brian@sweetapp.com)'

import atexit
from concurrent.futures import _base
import itertools
import queue
import threading
import weakref
import os

# Workers are created as daemon threads. This is done to allow the interpreter
# to exit when there are still idle threads in a ThreadPoolExecutor's thread
# pool (i.e. shutdown() was not called). However, allowing workers to die with
# the interpreter has two undesirable properties:
#   - The workers would still be running during interpreter shutdown,
#     meaning that they would fail in unpredictable ways.
#   - The workers could be killed while evaluating a work item, which could
#     be bad if the callable being evaluated has external side-effects e.g.
#     writing to a file.
#
# To work around this problem, an exit handler is installed which tells the
# workers to exit when their work queues are empty and then waits until the
# threads finish.

_threads_queues = weakref.WeakKeyDictionary()
_shutdown = False

def _python_exit():
    global _shutdown
    _shutdown = True
    items = list(_threads_queues.items())
    for t, q in items:
        q.put(None)
    for t, q in items:
        t.join()

atexit.register(_python_exit)


class _WorkItem(object):
    def __init__(self, future, fn, args, kwargs):
        self.future = future
        self.fn = fn
        self.args = args
        self.kwargs = kwargs

    def run(self):
        if not self.future.set_running_or_notify_cancel():
            return

        try:
            result = self.fn(*self.args, **self.kwargs)
        except BaseException as exc:
            self.future.set_exception(exc)
            # Break a reference cycle with the exception 'exc'
            self = None
        else:
            self.future.set_result(result)


def _worker(executor_reference, work_queue, initializer, initargs):
    if initializer is not None:
        try:
            initializer(*initargs)
        except BaseException:
            _base.LOGGER.critical('Exception in initializer:', exc_info=True)
            executor = executor_reference()
            if executor is not None:
                executor._initializer_failed()
            return
    try:
        while True:
            work_item = work_queue.get(block=True)
            if work_item is not None:
                work_item.run()
                # Delete references to object. See issue16284
                del work_item

                # attempt to increment idle count
                executor = executor_reference()
                if executor is not None:
                    executor._idle_semaphore.release()
                del executor
                continue

            executor = executor_reference()
            # Exit if:
            #   - The interpreter is shutting down OR
            #   - The executor that owns the worker has been collected OR
            #   - The executor that owns the worker has been shutdown.
            if _shutdown or executor is None or executor._shutdown:
                # Flag the executor as shutting down as early as possible if it
                # is not gc-ed yet.
                if executor is not None:
                    executor._shutdown = True
                # Notice other workers
                work_queue.put(None)
                return
            del executor
    except BaseException:
        _base.LOGGER.critical('Exception in worker', exc_info=True)


class BrokenThreadPool(_base.BrokenExecutor):
    """
    Raised when a worker thread in a ThreadPoolExecutor failed initializing.
    """


class ThreadPoolExecutor(_base.Executor):

    # Used to assign unique thread names when thread_name_prefix is not supplied.
    _counter = itertools.count().__next__

    def __init__(self, max_workers=None, thread_name_prefix='',
                 initializer=None, initargs=()):
        """Initializes a new ThreadPoolExecutor instance.

        Args:
            max_workers: The maximum number of threads that can be used to
                execute the given calls.
            thread_name_prefix: An optional name prefix to give our threads.
            initializer: A callable used to initialize worker threads.
            initargs: A tuple of arguments to pass to the initializer.
        """
        if max_workers is None:
            # ThreadPoolExecutor is often used to:
            # * CPU bound task which releases GIL
            # * I/O bound task (which releases GIL, of course)
            #
            # We use cpu_count + 4 for both types of tasks.
            # But we limit it to 32 to avoid consuming surprisingly large resource
            # on many core machine.
            max_workers = min(32, (os.cpu_count() or 1) + 4)
        if max_workers <= 0:
            raise ValueError("max_workers must be greater than 0")

        if initializer is not None and not callable(initializer):
            raise TypeError("initializer must be a callable")

        self._max_workers = max_workers
        self._work_queue = queue.SimpleQueue()
        self._idle_semaphore = threading.Semaphore(0)
        self._threads = set()
        self._broken = False
        self._shutdown = False
        self._shutdown_lock = threading.Lock()
        self._thread_name_prefix = (thread_name_prefix or
                                    ("ThreadPoolExecutor-%d" % self._counter()))
        self._initializer = initializer
        self._initargs = initargs

    def submit(*args, **kwargs):
        if len(args) >= 2:
            self, fn, *args = args
        elif not args:
            raise TypeError("descriptor 'submit' of 'ThreadPoolExecutor' object "
                            "needs an argument")
        elif 'fn' in kwargs:
            fn = kwargs.pop('fn')
            self, *args = args
            import warnings
            warnings.warn("Passing 'fn' as keyword argument is deprecated",
                          DeprecationWarning, stacklevel=2)
        else:
            raise TypeError('submit expected at least 1 positional argument, '
                            'got %d' % (len(args)-1))

        with self._shutdown_lock:
            if self._broken:
                raise BrokenThreadPool(self._broken)

            if self._shutdown:
                raise RuntimeError('cannot schedule new futures after shutdown')
            if _shutdown:
                raise RuntimeError('cannot schedule new futures after '
                                   'interpreter shutdown')

            f = _base.Future()
            w = _WorkItem(f, fn, args, kwargs)

            self._work_queue.put(w)
            self._adjust_thread_count()
            return f
    submit.__text_signature__ = _base.Executor.submit.__text_signature__
    submit.__doc__ = _base.Executor.submit.__doc__

    def _adjust_thread_count(self):
        # if idle threads are available, don't spin new threads
        if self._idle_semaphore.acquire(timeout=0):
            return

        # When the executor gets lost, the weakref callback will wake up
        # the worker threads.
        def weakref_cb(_, q=self._work_queue):
            q.put(None)

        num_threads = len(self._threads)
        if num_threads < self._max_workers:
            thread_name = '%s_%d' % (self._thread_name_prefix or self,
                                     num_threads)
            t = threading.Thread(name=thread_name, target=_worker,
                                 args=(weakref.ref(self, weakref_cb),
                                       self._work_queue,
                                       self._initializer,
                                       self._initargs))
            t.daemon = True
            t.start()
            self._threads.add(t)
            _threads_queues[t] = self._work_queue

    def _initializer_failed(self):
        with self._shutdown_lock:
            self._broken = ('A thread initializer failed, the thread pool '
                            'is not usable anymore')
            # Drain work queue and mark pending futures failed
            while True:
                try:
                    work_item = self._work_queue.get_nowait()
                except queue.Empty:
                    break
                if work_item is not None:
                    work_item.future.set_exception(BrokenThreadPool(self._broken))

    def shutdown(self, wait=True):
        with self._shutdown_lock:
            self._shutdown = True
            self._work_queue.put(None)
        if wait:
            for t in self._threads:
                t.join()
    shutdown.__doc__ = _base.Executor.shutdown.__doc__
concurrent/futures/process.py000064400000067172151153537470012503 0ustar00# Copyright 2009 Brian Quinlan. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Implements ProcessPoolExecutor.

The following diagram and text describe the data-flow through the system:

|======================= In-process =====================|== Out-of-process ==|

+----------+     +----------+       +--------+     +-----------+    +---------+
|          |  => | Work Ids |       |        |     | Call Q    |    | Process |
|          |     +----------+       |        |     +-----------+    |  Pool   |
|          |     | ...      |       |        |     | ...       |    +---------+
|          |     | 6        |    => |        |  => | 5, call() | => |         |
|          |     | 7        |       |        |     | ...       |    |         |
| Process  |     | ...      |       | Local  |     +-----------+    | Process |
|  Pool    |     +----------+       | Worker |                      |  #1..n  |
| Executor |                        | Thread |                      |         |
|          |     +----------- +     |        |     +-----------+    |         |
|          | <=> | Work Items | <=> |        | <=  | Result Q  | <= |         |
|          |     +------------+     |        |     +-----------+    |         |
|          |     | 6: call()  |     |        |     | ...       |    |         |
|          |     |    future  |     |        |     | 4, result |    |         |
|          |     | ...        |     |        |     | 3, except |    |         |
+----------+     +------------+     +--------+     +-----------+    +---------+

Executor.submit() called:
- creates a uniquely numbered _WorkItem and adds it to the "Work Items" dict
- adds the id of the _WorkItem to the "Work Ids" queue

Local worker thread:
- reads work ids from the "Work Ids" queue and looks up the corresponding
  WorkItem from the "Work Items" dict: if the work item has been cancelled then
  it is simply removed from the dict, otherwise it is repackaged as a
  _CallItem and put in the "Call Q". New _CallItems are put in the "Call Q"
  until "Call Q" is full. NOTE: the size of the "Call Q" is kept small because
  calls placed in the "Call Q" can no longer be cancelled with Future.cancel().
- reads _ResultItems from "Result Q", updates the future stored in the
  "Work Items" dict and deletes the dict entry

Process #1..n:
- reads _CallItems from "Call Q", executes the calls, and puts the resulting
  _ResultItems in "Result Q"
"""

__author__ = 'Brian Quinlan (brian@sweetapp.com)'

import atexit
import os
from concurrent.futures import _base
import queue
from queue import Full
import multiprocessing as mp
import multiprocessing.connection
from multiprocessing.queues import Queue
import threading
import weakref
from functools import partial
import itertools
import sys
import traceback

# Workers are created as daemon threads and processes. This is done to allow the
# interpreter to exit when there are still idle processes in a
# ProcessPoolExecutor's process pool (i.e. shutdown() was not called). However,
# allowing workers to die with the interpreter has two undesirable properties:
#   - The workers would still be running during interpreter shutdown,
#     meaning that they would fail in unpredictable ways.
#   - The workers could be killed while evaluating a work item, which could
#     be bad if the callable being evaluated has external side-effects e.g.
#     writing to a file.
#
# To work around this problem, an exit handler is installed which tells the
# workers to exit when their work queues are empty and then waits until the
# threads/processes finish.

_threads_wakeups = weakref.WeakKeyDictionary()
_global_shutdown = False


class _ThreadWakeup:
    def __init__(self):
        self._reader, self._writer = mp.Pipe(duplex=False)

    def close(self):
        self._writer.close()
        self._reader.close()

    def wakeup(self):
        self._writer.send_bytes(b"")

    def clear(self):
        while self._reader.poll():
            self._reader.recv_bytes()


def _python_exit():
    global _global_shutdown
    _global_shutdown = True
    items = list(_threads_wakeups.items())
    for _, thread_wakeup in items:
        thread_wakeup.wakeup()
    for t, _ in items:
        t.join()

# Controls how many more calls than processes will be queued in the call queue.
# A smaller number will mean that processes spend more time idle waiting for
# work while a larger number will make Future.cancel() succeed less frequently
# (Futures in the call queue cannot be cancelled).
EXTRA_QUEUED_CALLS = 1


# On Windows, WaitForMultipleObjects is used to wait for processes to finish.
# It can wait on, at most, 63 objects. There is an overhead of two objects:
# - the result queue reader
# - the thread wakeup reader
_MAX_WINDOWS_WORKERS = 63 - 2

# Hack to embed stringification of remote traceback in local traceback

class _RemoteTraceback(Exception):
    def __init__(self, tb):
        self.tb = tb
    def __str__(self):
        return self.tb

class _ExceptionWithTraceback:
    def __init__(self, exc, tb):
        tb = traceback.format_exception(type(exc), exc, tb)
        tb = ''.join(tb)
        self.exc = exc
        self.tb = '\n"""\n%s"""' % tb
    def __reduce__(self):
        return _rebuild_exc, (self.exc, self.tb)

def _rebuild_exc(exc, tb):
    exc.__cause__ = _RemoteTraceback(tb)
    return exc

class _WorkItem(object):
    def __init__(self, future, fn, args, kwargs):
        self.future = future
        self.fn = fn
        self.args = args
        self.kwargs = kwargs

class _ResultItem(object):
    def __init__(self, work_id, exception=None, result=None):
        self.work_id = work_id
        self.exception = exception
        self.result = result

class _CallItem(object):
    def __init__(self, work_id, fn, args, kwargs):
        self.work_id = work_id
        self.fn = fn
        self.args = args
        self.kwargs = kwargs


class _SafeQueue(Queue):
    """Safe Queue set exception to the future object linked to a job"""
    def __init__(self, max_size=0, *, ctx, pending_work_items):
        self.pending_work_items = pending_work_items
        super().__init__(max_size, ctx=ctx)

    def _on_queue_feeder_error(self, e, obj):
        if isinstance(obj, _CallItem):
            tb = traceback.format_exception(type(e), e, e.__traceback__)
            e.__cause__ = _RemoteTraceback('\n"""\n{}"""'.format(''.join(tb)))
            work_item = self.pending_work_items.pop(obj.work_id, None)
            # work_item can be None if another process terminated. In this case,
            # the queue_manager_thread fails all work_items with BrokenProcessPool
            if work_item is not None:
                work_item.future.set_exception(e)
        else:
            super()._on_queue_feeder_error(e, obj)


def _get_chunks(*iterables, chunksize):
    """ Iterates over zip()ed iterables in chunks. """
    it = zip(*iterables)
    while True:
        chunk = tuple(itertools.islice(it, chunksize))
        if not chunk:
            return
        yield chunk

def _process_chunk(fn, chunk):
    """ Processes a chunk of an iterable passed to map.

    Runs the function passed to map() on a chunk of the
    iterable passed to map.

    This function is run in a separate process.

    """
    return [fn(*args) for args in chunk]


def _sendback_result(result_queue, work_id, result=None, exception=None):
    """Safely send back the given result or exception"""
    try:
        result_queue.put(_ResultItem(work_id, result=result,
                                     exception=exception))
    except BaseException as e:
        exc = _ExceptionWithTraceback(e, e.__traceback__)
        result_queue.put(_ResultItem(work_id, exception=exc))


def _process_worker(call_queue, result_queue, initializer, initargs):
    """Evaluates calls from call_queue and places the results in result_queue.

    This worker is run in a separate process.

    Args:
        call_queue: A ctx.Queue of _CallItems that will be read and
            evaluated by the worker.
        result_queue: A ctx.Queue of _ResultItems that will written
            to by the worker.
        initializer: A callable initializer, or None
        initargs: A tuple of args for the initializer
    """
    if initializer is not None:
        try:
            initializer(*initargs)
        except BaseException:
            _base.LOGGER.critical('Exception in initializer:', exc_info=True)
            # The parent will notice that the process stopped and
            # mark the pool broken
            return
    while True:
        call_item = call_queue.get(block=True)
        if call_item is None:
            # Wake up queue management thread
            result_queue.put(os.getpid())
            return
        try:
            r = call_item.fn(*call_item.args, **call_item.kwargs)
        except BaseException as e:
            exc = _ExceptionWithTraceback(e, e.__traceback__)
            _sendback_result(result_queue, call_item.work_id, exception=exc)
        else:
            _sendback_result(result_queue, call_item.work_id, result=r)
            del r

        # Liberate the resource as soon as possible, to avoid holding onto
        # open files or shared memory that is not needed anymore
        del call_item


def _add_call_item_to_queue(pending_work_items,
                            work_ids,
                            call_queue):
    """Fills call_queue with _WorkItems from pending_work_items.

    This function never blocks.

    Args:
        pending_work_items: A dict mapping work ids to _WorkItems e.g.
            {5: <_WorkItem...>, 6: <_WorkItem...>, ...}
        work_ids: A queue.Queue of work ids e.g. Queue([5, 6, ...]). Work ids
            are consumed and the corresponding _WorkItems from
            pending_work_items are transformed into _CallItems and put in
            call_queue.
        call_queue: A multiprocessing.Queue that will be filled with _CallItems
            derived from _WorkItems.
    """
    while True:
        if call_queue.full():
            return
        try:
            work_id = work_ids.get(block=False)
        except queue.Empty:
            return
        else:
            work_item = pending_work_items[work_id]

            if work_item.future.set_running_or_notify_cancel():
                call_queue.put(_CallItem(work_id,
                                         work_item.fn,
                                         work_item.args,
                                         work_item.kwargs),
                               block=True)
            else:
                del pending_work_items[work_id]
                continue


def _queue_management_worker(executor_reference,
                             processes,
                             pending_work_items,
                             work_ids_queue,
                             call_queue,
                             result_queue,
                             thread_wakeup):
    """Manages the communication between this process and the worker processes.

    This function is run in a local thread.

    Args:
        executor_reference: A weakref.ref to the ProcessPoolExecutor that owns
            this thread. Used to determine if the ProcessPoolExecutor has been
            garbage collected and that this function can exit.
        process: A list of the ctx.Process instances used as
            workers.
        pending_work_items: A dict mapping work ids to _WorkItems e.g.
            {5: <_WorkItem...>, 6: <_WorkItem...>, ...}
        work_ids_queue: A queue.Queue of work ids e.g. Queue([5, 6, ...]).
        call_queue: A ctx.Queue that will be filled with _CallItems
            derived from _WorkItems for processing by the process workers.
        result_queue: A ctx.SimpleQueue of _ResultItems generated by the
            process workers.
        thread_wakeup: A _ThreadWakeup to allow waking up the
            queue_manager_thread from the main Thread and avoid deadlocks
            caused by permanently locked queues.
    """
    executor = None

    def shutting_down():
        return (_global_shutdown or executor is None
                or executor._shutdown_thread)

    def shutdown_worker():
        # This is an upper bound on the number of children alive.
        n_children_alive = sum(p.is_alive() for p in processes.values())
        n_children_to_stop = n_children_alive
        n_sentinels_sent = 0
        # Send the right number of sentinels, to make sure all children are
        # properly terminated.
        while n_sentinels_sent < n_children_to_stop and n_children_alive > 0:
            for i in range(n_children_to_stop - n_sentinels_sent):
                try:
                    call_queue.put_nowait(None)
                    n_sentinels_sent += 1
                except Full:
                    break
            n_children_alive = sum(p.is_alive() for p in processes.values())

        # Release the queue's resources as soon as possible.
        call_queue.close()
        # If .join() is not called on the created processes then
        # some ctx.Queue methods may deadlock on Mac OS X.
        for p in processes.values():
            p.join()

    result_reader = result_queue._reader
    wakeup_reader = thread_wakeup._reader
    readers = [result_reader, wakeup_reader]

    while True:
        _add_call_item_to_queue(pending_work_items,
                                work_ids_queue,
                                call_queue)

        # Wait for a result to be ready in the result_queue while checking
        # that all worker processes are still running, or for a wake up
        # signal send. The wake up signals come either from new tasks being
        # submitted, from the executor being shutdown/gc-ed, or from the
        # shutdown of the python interpreter.
        worker_sentinels = [p.sentinel for p in processes.values()]
        ready = mp.connection.wait(readers + worker_sentinels)

        cause = None
        is_broken = True
        if result_reader in ready:
            try:
                result_item = result_reader.recv()
                is_broken = False
            except BaseException as e:
                cause = traceback.format_exception(type(e), e, e.__traceback__)

        elif wakeup_reader in ready:
            is_broken = False
            result_item = None
        thread_wakeup.clear()
        if is_broken:
            # Mark the process pool broken so that submits fail right now.
            executor = executor_reference()
            if executor is not None:
                executor._broken = ('A child process terminated '
                                    'abruptly, the process pool is not '
                                    'usable anymore')
                executor._shutdown_thread = True
                executor = None
            bpe = BrokenProcessPool("A process in the process pool was "
                                    "terminated abruptly while the future was "
                                    "running or pending.")
            if cause is not None:
                bpe.__cause__ = _RemoteTraceback(
                    f"\n'''\n{''.join(cause)}'''")
            # All futures in flight must be marked failed
            for work_id, work_item in pending_work_items.items():
                work_item.future.set_exception(bpe)
                # Delete references to object. See issue16284
                del work_item
            pending_work_items.clear()
            # Terminate remaining workers forcibly: the queues or their
            # locks may be in a dirty state and block forever.
            for p in processes.values():
                p.terminate()
            shutdown_worker()
            return
        if isinstance(result_item, int):
            # Clean shutdown of a worker using its PID
            # (avoids marking the executor broken)
            assert shutting_down()
            p = processes.pop(result_item)
            p.join()
            if not processes:
                shutdown_worker()
                return
        elif result_item is not None:
            work_item = pending_work_items.pop(result_item.work_id, None)
            # work_item can be None if another process terminated (see above)
            if work_item is not None:
                if result_item.exception:
                    work_item.future.set_exception(result_item.exception)
                else:
                    work_item.future.set_result(result_item.result)
                # Delete references to object. See issue16284
                del work_item
            # Delete reference to result_item
            del result_item

        # Check whether we should start shutting down.
        executor = executor_reference()
        # No more work items can be added if:
        #   - The interpreter is shutting down OR
        #   - The executor that owns this worker has been collected OR
        #   - The executor that owns this worker has been shutdown.
        if shutting_down():
            try:
                # Flag the executor as shutting down as early as possible if it
                # is not gc-ed yet.
                if executor is not None:
                    executor._shutdown_thread = True
                # Since no new work items can be added, it is safe to shutdown
                # this thread if there are no pending work items.
                if not pending_work_items:
                    shutdown_worker()
                    return
            except Full:
                # This is not a problem: we will eventually be woken up (in
                # result_queue.get()) and be able to send a sentinel again.
                pass
        executor = None


_system_limits_checked = False
_system_limited = None


def _check_system_limits():
    global _system_limits_checked, _system_limited
    if _system_limits_checked:
        if _system_limited:
            raise NotImplementedError(_system_limited)
    _system_limits_checked = True
    try:
        nsems_max = os.sysconf("SC_SEM_NSEMS_MAX")
    except (AttributeError, ValueError):
        # sysconf not available or setting not available
        return
    if nsems_max == -1:
        # indetermined limit, assume that limit is determined
        # by available memory only
        return
    if nsems_max >= 256:
        # minimum number of semaphores available
        # according to POSIX
        return
    _system_limited = ("system provides too few semaphores (%d"
                       " available, 256 necessary)" % nsems_max)
    raise NotImplementedError(_system_limited)


def _chain_from_iterable_of_lists(iterable):
    """
    Specialized implementation of itertools.chain.from_iterable.
    Each item in *iterable* should be a list.  This function is
    careful not to keep references to yielded objects.
    """
    for element in iterable:
        element.reverse()
        while element:
            yield element.pop()


class BrokenProcessPool(_base.BrokenExecutor):
    """
    Raised when a process in a ProcessPoolExecutor terminated abruptly
    while a future was in the running state.
    """


class ProcessPoolExecutor(_base.Executor):
    def __init__(self, max_workers=None, mp_context=None,
                 initializer=None, initargs=()):
        """Initializes a new ProcessPoolExecutor instance.

        Args:
            max_workers: The maximum number of processes that can be used to
                execute the given calls. If None or not given then as many
                worker processes will be created as the machine has processors.
            mp_context: A multiprocessing context to launch the workers. This
                object should provide SimpleQueue, Queue and Process.
            initializer: A callable used to initialize worker processes.
            initargs: A tuple of arguments to pass to the initializer.
        """
        _check_system_limits()

        if max_workers is None:
            self._max_workers = os.cpu_count() or 1
            if sys.platform == 'win32':
                self._max_workers = min(_MAX_WINDOWS_WORKERS,
                                        self._max_workers)
        else:
            if max_workers <= 0:
                raise ValueError("max_workers must be greater than 0")
            elif (sys.platform == 'win32' and
                max_workers > _MAX_WINDOWS_WORKERS):
                raise ValueError(
                    f"max_workers must be <= {_MAX_WINDOWS_WORKERS}")

            self._max_workers = max_workers

        if mp_context is None:
            mp_context = mp.get_context()
        self._mp_context = mp_context

        if initializer is not None and not callable(initializer):
            raise TypeError("initializer must be a callable")
        self._initializer = initializer
        self._initargs = initargs

        # Management thread
        self._queue_management_thread = None

        # Map of pids to processes
        self._processes = {}

        # Shutdown is a two-step process.
        self._shutdown_thread = False
        self._shutdown_lock = threading.Lock()
        self._broken = False
        self._queue_count = 0
        self._pending_work_items = {}

        # Create communication channels for the executor
        # Make the call queue slightly larger than the number of processes to
        # prevent the worker processes from idling. But don't make it too big
        # because futures in the call queue cannot be cancelled.
        queue_size = self._max_workers + EXTRA_QUEUED_CALLS
        self._call_queue = _SafeQueue(
            max_size=queue_size, ctx=self._mp_context,
            pending_work_items=self._pending_work_items)
        # Killed worker processes can produce spurious "broken pipe"
        # tracebacks in the queue's own worker thread. But we detect killed
        # processes anyway, so silence the tracebacks.
        self._call_queue._ignore_epipe = True
        self._result_queue = mp_context.SimpleQueue()
        self._work_ids = queue.Queue()

        # _ThreadWakeup is a communication channel used to interrupt the wait
        # of the main loop of queue_manager_thread from another thread (e.g.
        # when calling executor.submit or executor.shutdown). We do not use the
        # _result_queue to send the wakeup signal to the queue_manager_thread
        # as it could result in a deadlock if a worker process dies with the
        # _result_queue write lock still acquired.
        self._queue_management_thread_wakeup = _ThreadWakeup()

    def _start_queue_management_thread(self):
        if self._queue_management_thread is None:
            # When the executor gets garbarge collected, the weakref callback
            # will wake up the queue management thread so that it can terminate
            # if there is no pending work item.
            def weakref_cb(_,
                           thread_wakeup=self._queue_management_thread_wakeup):
                mp.util.debug('Executor collected: triggering callback for'
                              ' QueueManager wakeup')
                thread_wakeup.wakeup()
            # Start the processes so that their sentinels are known.
            self._adjust_process_count()
            self._queue_management_thread = threading.Thread(
                target=_queue_management_worker,
                args=(weakref.ref(self, weakref_cb),
                      self._processes,
                      self._pending_work_items,
                      self._work_ids,
                      self._call_queue,
                      self._result_queue,
                      self._queue_management_thread_wakeup),
                name="QueueManagerThread")
            self._queue_management_thread.daemon = True
            self._queue_management_thread.start()
            _threads_wakeups[self._queue_management_thread] = \
                self._queue_management_thread_wakeup

    def _adjust_process_count(self):
        for _ in range(len(self._processes), self._max_workers):
            p = self._mp_context.Process(
                target=_process_worker,
                args=(self._call_queue,
                      self._result_queue,
                      self._initializer,
                      self._initargs))
            p.start()
            self._processes[p.pid] = p

    def submit(*args, **kwargs):
        if len(args) >= 2:
            self, fn, *args = args
        elif not args:
            raise TypeError("descriptor 'submit' of 'ProcessPoolExecutor' object "
                            "needs an argument")
        elif 'fn' in kwargs:
            fn = kwargs.pop('fn')
            self, *args = args
            import warnings
            warnings.warn("Passing 'fn' as keyword argument is deprecated",
                          DeprecationWarning, stacklevel=2)
        else:
            raise TypeError('submit expected at least 1 positional argument, '
                            'got %d' % (len(args)-1))

        with self._shutdown_lock:
            if self._broken:
                raise BrokenProcessPool(self._broken)
            if self._shutdown_thread:
                raise RuntimeError('cannot schedule new futures after shutdown')
            if _global_shutdown:
                raise RuntimeError('cannot schedule new futures after '
                                   'interpreter shutdown')

            f = _base.Future()
            w = _WorkItem(f, fn, args, kwargs)

            self._pending_work_items[self._queue_count] = w
            self._work_ids.put(self._queue_count)
            self._queue_count += 1
            # Wake up queue management thread
            self._queue_management_thread_wakeup.wakeup()

            self._start_queue_management_thread()
            return f
    submit.__text_signature__ = _base.Executor.submit.__text_signature__
    submit.__doc__ = _base.Executor.submit.__doc__

    def map(self, fn, *iterables, timeout=None, chunksize=1):
        """Returns an iterator equivalent to map(fn, iter).

        Args:
            fn: A callable that will take as many arguments as there are
                passed iterables.
            timeout: The maximum number of seconds to wait. If None, then there
                is no limit on the wait time.
            chunksize: If greater than one, the iterables will be chopped into
                chunks of size chunksize and submitted to the process pool.
                If set to one, the items in the list will be sent one at a time.

        Returns:
            An iterator equivalent to: map(func, *iterables) but the calls may
            be evaluated out-of-order.

        Raises:
            TimeoutError: If the entire result iterator could not be generated
                before the given timeout.
            Exception: If fn(*args) raises for any values.
        """
        if chunksize < 1:
            raise ValueError("chunksize must be >= 1.")

        results = super().map(partial(_process_chunk, fn),
                              _get_chunks(*iterables, chunksize=chunksize),
                              timeout=timeout)
        return _chain_from_iterable_of_lists(results)

    def shutdown(self, wait=True):
        with self._shutdown_lock:
            self._shutdown_thread = True
        if self._queue_management_thread:
            # Wake up queue management thread
            self._queue_management_thread_wakeup.wakeup()
            if wait:
                self._queue_management_thread.join()
        # To reduce the risk of opening too many files, remove references to
        # objects that use file descriptors.
        self._queue_management_thread = None
        if self._call_queue is not None:
            self._call_queue.close()
            if wait:
                self._call_queue.join_thread()
            self._call_queue = None
        self._result_queue = None
        self._processes = None

        if self._queue_management_thread_wakeup:
            self._queue_management_thread_wakeup.close()
            self._queue_management_thread_wakeup = None

    shutdown.__doc__ = _base.Executor.shutdown.__doc__

atexit.register(_python_exit)
concurrent/futures/__init__.py000064400000003022151153537470012544 0ustar00# Copyright 2009 Brian Quinlan. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Execute computations asynchronously using threads or processes."""

__author__ = 'Brian Quinlan (brian@sweetapp.com)'

from concurrent.futures._base import (FIRST_COMPLETED,
                                      FIRST_EXCEPTION,
                                      ALL_COMPLETED,
                                      CancelledError,
                                      TimeoutError,
                                      InvalidStateError,
                                      BrokenExecutor,
                                      Future,
                                      Executor,
                                      wait,
                                      as_completed)

__all__ = (
    'FIRST_COMPLETED',
    'FIRST_EXCEPTION',
    'ALL_COMPLETED',
    'CancelledError',
    'TimeoutError',
    'BrokenExecutor',
    'Future',
    'Executor',
    'wait',
    'as_completed',
    'ProcessPoolExecutor',
    'ThreadPoolExecutor',
)


def __dir__():
    return __all__ + ('__author__', '__doc__')


def __getattr__(name):
    global ProcessPoolExecutor, ThreadPoolExecutor

    if name == 'ProcessPoolExecutor':
        from .process import ProcessPoolExecutor as pe
        ProcessPoolExecutor = pe
        return pe

    if name == 'ThreadPoolExecutor':
        from .thread import ThreadPoolExecutor as te
        ThreadPoolExecutor = te
        return te

    raise AttributeError(f"module {__name__} has no attribute {name}")
concurrent/futures/__pycache__/process.cpython-38.opt-2.pyc000064400000032505151153537470017721 0ustar00U

e5dzn�@s�dZddlZddlZddlmZddlZddlmZddlZddl	Zddl
mZddlZddl
Z
ddlmZddlZddlZddlZe
��ZdaGdd	�d	�Zd
d�ZdZd
ZGdd�de�ZGdd�d�Zdd�ZGdd�de�ZGdd�de�Z Gdd�de�Z!Gdd�de�Z"dd�Z#dd�Z$d0d d!�Z%d"d#�Z&d$d%�Z'd&d'�Z(da)da*d(d)�Z+d*d+�Z,Gd,d-�d-ej-�Z.Gd.d/�d/ej/�Z0e�1e�dS)1z"Brian Quinlan (brian@sweetapp.com)�N)�_base)�Full)�Queue)�partialFc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�
_ThreadWakeupcCstjdd�\|_|_dS)NF)Zduplex)�mpZPipe�_reader�_writer��self�r�2/usr/lib64/python3.8/concurrent/futures/process.py�__init__Rsz_ThreadWakeup.__init__cCs|j��|j��dS�N)r	�closerr
rrr
rUs
z_ThreadWakeup.closecCs|j�d�dS)N�)r	Z
send_bytesr
rrr
�wakeupYsz_ThreadWakeup.wakeupcCs|j��r|j��qdSr)rZpollZ
recv_bytesr
rrr
�clear\s
z_ThreadWakeup.clearN)�__name__�
__module__�__qualname__rrrrrrrr
rQsrcCs@datt���}|D]\}}|��q|D]\}}|��q*dS�NT)�_global_shutdown�list�_threads_wakeups�itemsr�join)r�_�
thread_wakeup�trrr
�_python_exitas
r ��=c@seZdZdd�Zdd�ZdS)�_RemoteTracebackcCs
||_dSr��tb)rr%rrr
rzsz_RemoteTraceback.__init__cCs|jSrr$r
rrr
�__str__|sz_RemoteTraceback.__str__N)rrrrr&rrrr
r#ysr#c@seZdZdd�Zdd�ZdS)�_ExceptionWithTracebackcCs0t�t|�||�}d�|�}||_d||_dS)N�z

"""
%s""")�	traceback�format_exception�typer�excr%)rr,r%rrr
r�s
z _ExceptionWithTraceback.__init__cCst|j|jffSr)�_rebuild_excr,r%r
rrr
�
__reduce__�sz"_ExceptionWithTraceback.__reduce__N)rrrrr.rrrr
r'sr'cCst|�|_|Sr)r#�	__cause__)r,r%rrr
r-�s
r-c@seZdZdd�ZdS)�	_WorkItemcCs||_||_||_||_dSr)�future�fn�args�kwargs)rr1r2r3r4rrr
r�sz_WorkItem.__init__N�rrrrrrrr
r0�sr0c@seZdZddd�ZdS)�_ResultItemNcCs||_||_||_dSr)�work_id�	exception�result)rr7r8r9rrr
r�sz_ResultItem.__init__)NNr5rrrr
r6�sr6c@seZdZdd�ZdS)�	_CallItemcCs||_||_||_||_dSr)r7r2r3r4)rr7r2r3r4rrr
r�sz_CallItem.__init__Nr5rrrr
r:�sr:cs*eZdZd�fdd�	Z�fdd�Z�ZS)�
_SafeQueuercs||_t�j||d�dS)N)�ctx)�pending_work_items�superr)r�max_sizer<r=��	__class__rr
r�sz_SafeQueue.__init__cslt|t�rZt�t|�||j�}td�d�|���|_	|j
�|jd�}|dk	rh|j
�|�nt��||�dS)Nz

"""
{}"""r()�
isinstancer:r)r*r+�
__traceback__r#�formatrr/r=�popr7r1�
set_exceptionr>�_on_queue_feeder_error)r�e�objr%�	work_itemr@rr
rG�s
z!_SafeQueue._on_queue_feeder_error)r)rrrrrG�
__classcell__rrr@r
r;�sr;cgs,t|�}tt�||��}|s dS|VqdSr)�zip�tuple�	itertools�islice)�	chunksize�	iterables�it�chunkrrr
�_get_chunks�s
rTcs�fdd�|D�S)Ncsg|]}�|��qSrr)�.0r3�r2rr
�
<listcomp>�sz"_process_chunk.<locals>.<listcomp>r)r2rSrrVr
�_process_chunk�s	rXc
Cs^z|�t|||d��Wn@tk
rX}z"t||j�}|�t||d��W5d}~XYnXdS)N)r9r8�r8)�putr6�
BaseExceptionr'rC)�result_queuer7r9r8rHr,rrr
�_sendback_result�s
�r]c
Cs�|dk	r<z||�Wn&tk
r:tjjddd�YdSX|jdd�}|dkrb|�t���dSz|j|j	|j
�}Wn>tk
r�}z t||j�}t
||j|d�W5d}~XYnXt
||j|d�~~q<dS)NzException in initializer:T)�exc_info��blockrY)r9)r[rZLOGGERZcritical�getrZ�os�getpidr2r3r4r'rCr]r7)�
call_queuer\�initializer�initargsZ	call_item�rrHr,rrr
�_process_worker�s$
"rhcCsv|��rdSz|jdd�}Wntjk
r4YdSX||}|j��rh|jt||j|j	|j
�dd�q||=qqdS)NFr_T)Zfullra�queueZEmptyr1Zset_running_or_notify_cancelrZr:r2r3r4)r=Zwork_idsrdr7rJrrr
�_add_call_item_to_queue�s"
��rjc
s>d��fdd�}��fdd�}|j}	|j}
|	|
g}t||��dd����D�}tj�||�}
d}d}|	|
kr�z|	��}d}Wq�tk
r�}zt�	t
|�||j�}W5d}~XYq�Xn|
|
kr�d}d}|��|�rl|���dk	r�d	�_
d�_d�td
�}|dk	�r tdd�|��d
��|_|��D]\}}|j�|�~�q(|�����D]}|���qR|�dSt|t��r���|�}|����s�|�dSnL|dk	�r�|�|jd�}|dk	�r�|j�r�|j�|j�n|j�|j�~~|��|��r4z&�dk	�rd�_|�s|�WdSWntk
�r2YnXd�q2dS)Ncstp�dkp�jSr)r�_shutdown_threadr)�executorrr
�
shutting_down@s�z/_queue_management_worker.<locals>.shutting_downc	s�tdd����D��}|}d}||kr�|dkr�t||�D]6}z��d�|d7}Wq:tk
rnYqrYq:Xq:tdd����D��}q������D]}|��q�dS)Ncss|]}|��VqdSr�Zis_alive�rU�prrr
�	<genexpr>FszD_queue_management_worker.<locals>.shutdown_worker.<locals>.<genexpr>rr!css|]}|��VqdSrrnrorrr
rqRs)�sum�values�rangeZ
put_nowaitrrr)Zn_children_aliveZn_children_to_stopZn_sentinels_sent�irp)rd�	processesrr
�shutdown_workerDs
z1_queue_management_worker.<locals>.shutdown_workercSsg|]
}|j�qSr)�sentinelrorrr
rWisz,_queue_management_worker.<locals>.<listcomp>TFzKA child process terminated abruptly, the process pool is not usable anymorez^A process in the process pool was terminated abruptly while the future was running or pending.z
'''
r(z''')rrjrsrZ
connection�waitZrecvr[r)r*r+rCr�_brokenrk�BrokenProcessPoolr#rr/rr1rFZ	terminaterB�intrEr7r8Z
set_resultr9r)Zexecutor_referencervr=Zwork_ids_queuerdr\rrmrwZ
result_readerZ
wakeup_readerZreadersZworker_sentinelsZready�causeZ	is_brokenZresult_itemrHZbper7rJrpr)rdrlrvr
�_queue_management_worker"s��	(
�




r~c	Csjtrtrtt��dazt�d�}Wnttfk
r<YdSX|dkrJdS|dkrVdSd|att��dS)NT�SC_SEM_NSEMS_MAX����z@system provides too few semaphores (%d available, 256 necessary))�_system_limits_checked�_system_limited�NotImplementedErrorrb�sysconf�AttributeError�
ValueError)Z	nsems_maxrrr
�_check_system_limits�s �r�ccs&|D]}|��|r|��VqqdSr)�reverserE)�iterableZelementrrr
�_chain_from_iterable_of_lists�sr�c@seZdZdS)r{N)rrrrrrr
r{�sr{csteZdZddd�Zdd�Zdd�Zd	d
�Zejjj	e_	ejjj
e_
ddd��fd
d�
Zddd�Zejjj
e_
�Z
S)�ProcessPoolExecutorNrcCst�|dkr6t��pd|_tjdkrntt|j�|_n8|dkrHtd��n tjdkrh|tkrhtdt����||_|dkr~t	�
�}||_|dk	r�t|�s�t
d��||_||_d|_i|_d|_t��|_d|_d|_i|_|jt}t||j|jd�|_d	|j_|��|_t� �|_!t"�|_#dS)
Nr!Zwin32rz"max_workers must be greater than 0zmax_workers must be <= zinitializer must be a callableF)r?r<r=T)$r�rb�	cpu_count�_max_workers�sys�platform�min�_MAX_WINDOWS_WORKERSr�rZget_context�_mp_context�callable�	TypeError�_initializer�	_initargs�_queue_management_thread�
_processesrk�	threadingZLock�_shutdown_lockrz�_queue_count�_pending_work_items�EXTRA_QUEUED_CALLSr;�_call_queueZ
_ignore_epipeZSimpleQueue�
_result_queuerir�	_work_idsr�_queue_management_thread_wakeup)rZmax_workersZ
mp_contextrerfZ
queue_sizerrr
r�sP

�

��

�

zProcessPoolExecutor.__init__c	Csv|jdkrr|jfdd�}|��tjtt�||�|j|j	|j
|j|j|jfdd�|_d|j_
|j��|jt|j<dS)NcSstj�d�|��dS)Nz?Executor collected: triggering callback for QueueManager wakeup)r�util�debugr)rrrrr
�
weakref_cbBszFProcessPoolExecutor._start_queue_management_thread.<locals>.weakref_cbZQueueManagerThread)�targetr3�nameT)r�r��_adjust_process_countr�ZThreadr~�weakref�refr�r�r�r�r�Zdaemon�startr)rr�rrr
�_start_queue_management_thread=s(
�

��

�z2ProcessPoolExecutor._start_queue_management_threadcCsPtt|j�|j�D]8}|jjt|j|j|j	|j
fd�}|��||j|j<qdS)N)r�r3)
rt�lenr�r�r�ZProcessrhr�r�r�r�r��pid)rrrprrr
r�Xs��z)ProcessPoolExecutor._adjust_process_countc
Os
t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��|j��|jr�t|j��|j	r�t
d	��tr�t
d
��t�
�}t||||�}||j|j<|j�|j�|jd7_|j��|��|W5QR�SQRXdS)N�zEdescriptor 'submit' of 'ProcessPoolExecutor' object needs an argumentr2rz.Passing 'fn' as keyword argument is deprecated)�
stacklevelz6submit expected at least 1 positional argument, got %dr!z*cannot schedule new futures after shutdownz6cannot schedule new futures after interpreter shutdown)r�r�rE�warnings�warn�DeprecationWarningr�rzr{rk�RuntimeErrorrrZFuturer0r�r�r�rZr�rr�)r3r4rr2r��f�wrrr
�submitcs<

�
�

zProcessPoolExecutor.submitr!)�timeoutrPcs:|dkrtd��t�jtt|�t|d|i�|d�}t|�S)Nr!zchunksize must be >= 1.rP)r�)r�r>�maprrXrTr�)rr2r�rPrQZresultsr@rr
r��s�zProcessPoolExecutor.mapTc	Cs�|j�d|_W5QRX|jr6|j��|r6|j��d|_|jdk	rd|j��|r^|j��d|_d|_	d|_
|jr�|j��d|_dSr)r�rkr�r�rrr�rZjoin_threadr�r�)rryrrr
�shutdown�s"





zProcessPoolExecutor.shutdown)NNNr)T)rrrrr�r�r�r�Executor�__text_signature__�__doc__r�r�rKrrr@r
r��s�
K$
r�)NN)2�
__author__�atexitrbZconcurrent.futuresrrirZmultiprocessingrZmultiprocessing.connectionZmultiprocessing.queuesrr�r��	functoolsrrNr�r)�WeakKeyDictionaryrrrr r�r��	Exceptionr#r'r-�objectr0r6r:r;rTrXr]rhrjr~r�r�r�r�ZBrokenExecutorr{r�r��registerrrrr
�<module>.sT
		

)&!Pconcurrent/futures/__pycache__/process.cpython-38.opt-1.pyc000064400000047460151153537470017726 0ustar00U

e5dzn�@s�dZdZddlZddlZddlmZddlZddlmZddlZ	ddl
ZddlmZddl
Z
ddlZddlmZddlZddlZddlZe��ZdaGd	d
�d
�Zdd�Zd
ZdZGdd�de�ZGdd�d�Zdd�ZGdd�de�Z Gdd�de�Z!Gdd�de�Z"Gdd�de�Z#dd�Z$dd �Z%d1d!d"�Z&d#d$�Z'd%d&�Z(d'd(�Z)da*da+d)d*�Z,d+d,�Z-Gd-d.�d.ej.�Z/Gd/d0�d0ej0�Z1e�2e�dS)2a-	Implements ProcessPoolExecutor.

The following diagram and text describe the data-flow through the system:

|======================= In-process =====================|== Out-of-process ==|

+----------+     +----------+       +--------+     +-----------+    +---------+
|          |  => | Work Ids |       |        |     | Call Q    |    | Process |
|          |     +----------+       |        |     +-----------+    |  Pool   |
|          |     | ...      |       |        |     | ...       |    +---------+
|          |     | 6        |    => |        |  => | 5, call() | => |         |
|          |     | 7        |       |        |     | ...       |    |         |
| Process  |     | ...      |       | Local  |     +-----------+    | Process |
|  Pool    |     +----------+       | Worker |                      |  #1..n  |
| Executor |                        | Thread |                      |         |
|          |     +----------- +     |        |     +-----------+    |         |
|          | <=> | Work Items | <=> |        | <=  | Result Q  | <= |         |
|          |     +------------+     |        |     +-----------+    |         |
|          |     | 6: call()  |     |        |     | ...       |    |         |
|          |     |    future  |     |        |     | 4, result |    |         |
|          |     | ...        |     |        |     | 3, except |    |         |
+----------+     +------------+     +--------+     +-----------+    +---------+

Executor.submit() called:
- creates a uniquely numbered _WorkItem and adds it to the "Work Items" dict
- adds the id of the _WorkItem to the "Work Ids" queue

Local worker thread:
- reads work ids from the "Work Ids" queue and looks up the corresponding
  WorkItem from the "Work Items" dict: if the work item has been cancelled then
  it is simply removed from the dict, otherwise it is repackaged as a
  _CallItem and put in the "Call Q". New _CallItems are put in the "Call Q"
  until "Call Q" is full. NOTE: the size of the "Call Q" is kept small because
  calls placed in the "Call Q" can no longer be cancelled with Future.cancel().
- reads _ResultItems from "Result Q", updates the future stored in the
  "Work Items" dict and deletes the dict entry

Process #1..n:
- reads _CallItems from "Call Q", executes the calls, and puts the resulting
  _ResultItems in "Result Q"
z"Brian Quinlan (brian@sweetapp.com)�N)�_base)�Full)�Queue)�partialFc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�
_ThreadWakeupcCstjdd�\|_|_dS)NF)Zduplex)�mpZPipe�_reader�_writer��self�r�2/usr/lib64/python3.8/concurrent/futures/process.py�__init__Rsz_ThreadWakeup.__init__cCs|j��|j��dS�N)r	�closerr
rrr
rUs
z_ThreadWakeup.closecCs|j�d�dS)N�)r	Z
send_bytesr
rrr
�wakeupYsz_ThreadWakeup.wakeupcCs|j��r|j��qdSr)rZpollZ
recv_bytesr
rrr
�clear\s
z_ThreadWakeup.clearN)�__name__�
__module__�__qualname__rrrrrrrr
rQsrcCs@datt���}|D]\}}|��q|D]\}}|��q*dS�NT)�_global_shutdown�list�_threads_wakeups�itemsr�join)r�_�
thread_wakeup�trrr
�_python_exitas
r ��=c@seZdZdd�Zdd�ZdS)�_RemoteTracebackcCs
||_dSr��tb)rr%rrr
rzsz_RemoteTraceback.__init__cCs|jSrr$r
rrr
�__str__|sz_RemoteTraceback.__str__N)rrrrr&rrrr
r#ysr#c@seZdZdd�Zdd�ZdS)�_ExceptionWithTracebackcCs0t�t|�||�}d�|�}||_d||_dS)N�z

"""
%s""")�	traceback�format_exception�typer�excr%)rr,r%rrr
r�s
z _ExceptionWithTraceback.__init__cCst|j|jffSr)�_rebuild_excr,r%r
rrr
�
__reduce__�sz"_ExceptionWithTraceback.__reduce__N)rrrrr.rrrr
r'sr'cCst|�|_|Sr)r#�	__cause__)r,r%rrr
r-�s
r-c@seZdZdd�ZdS)�	_WorkItemcCs||_||_||_||_dSr)�future�fn�args�kwargs)rr1r2r3r4rrr
r�sz_WorkItem.__init__N�rrrrrrrr
r0�sr0c@seZdZddd�ZdS)�_ResultItemNcCs||_||_||_dSr)�work_id�	exception�result)rr7r8r9rrr
r�sz_ResultItem.__init__)NNr5rrrr
r6�sr6c@seZdZdd�ZdS)�	_CallItemcCs||_||_||_||_dSr)r7r2r3r4)rr7r2r3r4rrr
r�sz_CallItem.__init__Nr5rrrr
r:�sr:cs.eZdZdZd�fdd�	Z�fdd�Z�ZS)�
_SafeQueuez=Safe Queue set exception to the future object linked to a jobrcs||_t�j||d�dS)N)�ctx)�pending_work_items�superr)r�max_sizer<r=��	__class__rr
r�sz_SafeQueue.__init__cslt|t�rZt�t|�||j�}td�d�|���|_	|j
�|jd�}|dk	rh|j
�|�nt��||�dS)Nz

"""
{}"""r()�
isinstancer:r)r*r+�
__traceback__r#�formatrr/r=�popr7r1�
set_exceptionr>�_on_queue_feeder_error)r�e�objr%�	work_itemr@rr
rG�s
z!_SafeQueue._on_queue_feeder_error)r)rrr�__doc__rrG�
__classcell__rrr@r
r;�sr;cgs,t|�}tt�||��}|s dS|VqdS)z, Iterates over zip()ed iterables in chunks. N)�zip�tuple�	itertools�islice)�	chunksize�	iterables�it�chunkrrr
�_get_chunks�s
rUcs�fdd�|D�S)z� Processes a chunk of an iterable passed to map.

    Runs the function passed to map() on a chunk of the
    iterable passed to map.

    This function is run in a separate process.

    csg|]}�|��qSrr)�.0r3�r2rr
�
<listcomp>�sz"_process_chunk.<locals>.<listcomp>r)r2rTrrWr
�_process_chunk�s	rYc
Cs^z|�t|||d��Wn@tk
rX}z"t||j�}|�t||d��W5d}~XYnXdS)z.Safely send back the given result or exception)r9r8�r8N)�putr6�
BaseExceptionr'rC)�result_queuer7r9r8rHr,rrr
�_sendback_result�s
�r^c
Cs�|dk	r<z||�Wn&tk
r:tjjddd�YdSX|jdd�}|dkrb|�t���dSz|j|j	|j
�}Wn>tk
r�}z t||j�}t
||j|d�W5d}~XYnXt
||j|d�~~q<dS)a�Evaluates calls from call_queue and places the results in result_queue.

    This worker is run in a separate process.

    Args:
        call_queue: A ctx.Queue of _CallItems that will be read and
            evaluated by the worker.
        result_queue: A ctx.Queue of _ResultItems that will written
            to by the worker.
        initializer: A callable initializer, or None
        initargs: A tuple of args for the initializer
    NzException in initializer:T)�exc_info��blockrZ)r9)r\rZLOGGERZcritical�getr[�os�getpidr2r3r4r'rCr^r7)�
call_queuer]�initializer�initargsZ	call_item�rrHr,rrr
�_process_worker�s$
"ricCsv|��rdSz|jdd�}Wntjk
r4YdSX||}|j��rh|jt||j|j	|j
�dd�q||=qqdS)aMFills call_queue with _WorkItems from pending_work_items.

    This function never blocks.

    Args:
        pending_work_items: A dict mapping work ids to _WorkItems e.g.
            {5: <_WorkItem...>, 6: <_WorkItem...>, ...}
        work_ids: A queue.Queue of work ids e.g. Queue([5, 6, ...]). Work ids
            are consumed and the corresponding _WorkItems from
            pending_work_items are transformed into _CallItems and put in
            call_queue.
        call_queue: A multiprocessing.Queue that will be filled with _CallItems
            derived from _WorkItems.
    NFr`T)Zfullrb�queueZEmptyr1Zset_running_or_notify_cancelr[r:r2r3r4)r=Zwork_idsrer7rJrrr
�_add_call_item_to_queue�s"
��rkc
s>d��fdd�}��fdd�}|j}	|j}
|	|
g}t||��dd����D�}tj�||�}
d}d}|	|
kr�z|	��}d	}Wq�tk
r�}zt�	t
|�||j�}W5d}~XYq�Xn|
|
kr�d	}d}|��|�rl|���dk	r�d
�_
d�_d�td�}|dk	�r tdd
�|��d��|_|��D]\}}|j�|�~�q(|�����D]}|���qR|�dSt|t��r���|�}|����s�|�dSnL|dk	�r�|�|jd�}|dk	�r�|j�r�|j�|j�n|j�|j�~~|��|��r4z&�dk	�rd�_|�s|�WdSWntk
�r2YnXd�q2dS)a,Manages the communication between this process and the worker processes.

    This function is run in a local thread.

    Args:
        executor_reference: A weakref.ref to the ProcessPoolExecutor that owns
            this thread. Used to determine if the ProcessPoolExecutor has been
            garbage collected and that this function can exit.
        process: A list of the ctx.Process instances used as
            workers.
        pending_work_items: A dict mapping work ids to _WorkItems e.g.
            {5: <_WorkItem...>, 6: <_WorkItem...>, ...}
        work_ids_queue: A queue.Queue of work ids e.g. Queue([5, 6, ...]).
        call_queue: A ctx.Queue that will be filled with _CallItems
            derived from _WorkItems for processing by the process workers.
        result_queue: A ctx.SimpleQueue of _ResultItems generated by the
            process workers.
        thread_wakeup: A _ThreadWakeup to allow waking up the
            queue_manager_thread from the main Thread and avoid deadlocks
            caused by permanently locked queues.
    Ncstp�dkp�jSr)r�_shutdown_threadr)�executorrr
�
shutting_down@s�z/_queue_management_worker.<locals>.shutting_downc	s�tdd����D��}|}d}||kr�|dkr�t||�D]6}z��d�|d7}Wq:tk
rnYqrYq:Xq:tdd����D��}q������D]}|��q�dS)Ncss|]}|��VqdSr�Zis_alive�rV�prrr
�	<genexpr>FszD_queue_management_worker.<locals>.shutdown_worker.<locals>.<genexpr>rr!css|]}|��VqdSrrorprrr
rrRs)�sum�values�rangeZ
put_nowaitrrr)Zn_children_aliveZn_children_to_stopZn_sentinels_sent�irq)re�	processesrr
�shutdown_workerDs
z1_queue_management_worker.<locals>.shutdown_workercSsg|]
}|j�qSr)�sentinelrprrr
rXisz,_queue_management_worker.<locals>.<listcomp>TFzKA child process terminated abruptly, the process pool is not usable anymorez^A process in the process pool was terminated abruptly while the future was running or pending.z
'''
r(z''')rrkrtrZ
connection�waitZrecvr\r)r*r+rCr�_brokenrl�BrokenProcessPoolr#rr/rr1rFZ	terminaterB�intrEr7r8Z
set_resultr9r)Zexecutor_referencerwr=Zwork_ids_queuerer]rrnrxZ
result_readerZ
wakeup_readerZreadersZworker_sentinelsZready�causeZ	is_brokenZresult_itemrHZbper7rJrqr)rermrwr
�_queue_management_worker"s��	(
�




rc	Csjtrtrtt��dazt�d�}Wnttfk
r<YdSX|dkrJdS|dkrVdSd|att��dS)NT�SC_SEM_NSEMS_MAX����z@system provides too few semaphores (%d available, 256 necessary))�_system_limits_checked�_system_limited�NotImplementedErrorrc�sysconf�AttributeError�
ValueError)Z	nsems_maxrrr
�_check_system_limits�s �r�ccs&|D]}|��|r|��VqqdS)z�
    Specialized implementation of itertools.chain.from_iterable.
    Each item in *iterable* should be a list.  This function is
    careful not to keep references to yielded objects.
    N)�reverserE)�iterableZelementrrr
�_chain_from_iterable_of_lists�sr�c@seZdZdZdS)r|zy
    Raised when a process in a ProcessPoolExecutor terminated abruptly
    while a future was in the running state.
    N)rrrrKrrrr
r|�sr|csteZdZddd�Zdd�Zdd�Zd	d
�Zejjj	e_	ejjj
e_
ddd��fd
d�
Zddd�Zejjj
e_
�Z
S)�ProcessPoolExecutorNrcCst�|dkr6t��pd|_tjdkrntt|j�|_n8|dkrHtd��n tjdkrh|tkrhtdt����||_|dkr~t	�
�}||_|dk	r�t|�s�t
d��||_||_d|_i|_d|_t��|_d|_d|_i|_|jt}t||j|jd	�|_d
|j_|��|_t� �|_!t"�|_#dS)aSInitializes a new ProcessPoolExecutor instance.

        Args:
            max_workers: The maximum number of processes that can be used to
                execute the given calls. If None or not given then as many
                worker processes will be created as the machine has processors.
            mp_context: A multiprocessing context to launch the workers. This
                object should provide SimpleQueue, Queue and Process.
            initializer: A callable used to initialize worker processes.
            initargs: A tuple of arguments to pass to the initializer.
        Nr!Zwin32rz"max_workers must be greater than 0zmax_workers must be <= zinitializer must be a callableF)r?r<r=T)$r�rc�	cpu_count�_max_workers�sys�platform�min�_MAX_WINDOWS_WORKERSr�rZget_context�_mp_context�callable�	TypeError�_initializer�	_initargs�_queue_management_thread�
_processesrl�	threadingZLock�_shutdown_lockr{�_queue_count�_pending_work_items�EXTRA_QUEUED_CALLSr;�_call_queueZ
_ignore_epipeZSimpleQueue�
_result_queuerjr�	_work_idsr�_queue_management_thread_wakeup)rZmax_workersZ
mp_contextrfrgZ
queue_sizerrr
r�sP

�

��

�

zProcessPoolExecutor.__init__c	Csv|jdkrr|jfdd�}|��tjtt�||�|j|j	|j
|j|j|jfdd�|_d|j_
|j��|jt|j<dS)NcSstj�d�|��dS)Nz?Executor collected: triggering callback for QueueManager wakeup)r�util�debugr)rrrrr
�
weakref_cbBszFProcessPoolExecutor._start_queue_management_thread.<locals>.weakref_cbZQueueManagerThread)�targetr3�nameT)r�r��_adjust_process_countr�ZThreadr�weakref�refr�r�r�r�r�Zdaemon�startr)rr�rrr
�_start_queue_management_thread=s(
�

��

�z2ProcessPoolExecutor._start_queue_management_threadcCsPtt|j�|j�D]8}|jjt|j|j|j	|j
fd�}|��||j|j<qdS)N)r�r3)
ru�lenr�r�r�ZProcessrir�r�r�r�r��pid)rrrqrrr
r�Xs��z)ProcessPoolExecutor._adjust_process_countc
Os
t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��|j��|jr�t|j��|j	r�t
d	��tr�t
d
��t�
�}t||||�}||j|j<|j�|j�|jd7_|j��|��|W5QR�SQRXdS)N�zEdescriptor 'submit' of 'ProcessPoolExecutor' object needs an argumentr2rz.Passing 'fn' as keyword argument is deprecated)�
stacklevelz6submit expected at least 1 positional argument, got %dr!z*cannot schedule new futures after shutdownz6cannot schedule new futures after interpreter shutdown)r�r�rE�warnings�warn�DeprecationWarningr�r{r|rl�RuntimeErrorrrZFuturer0r�r�r�r[r�rr�)r3r4rr2r��f�wrrr
�submitcs<

�
�

zProcessPoolExecutor.submitr!)�timeoutrQcs:|dkrtd��t�jtt|�t|d|i�|d�}t|�S)ajReturns an iterator equivalent to map(fn, iter).

        Args:
            fn: A callable that will take as many arguments as there are
                passed iterables.
            timeout: The maximum number of seconds to wait. If None, then there
                is no limit on the wait time.
            chunksize: If greater than one, the iterables will be chopped into
                chunks of size chunksize and submitted to the process pool.
                If set to one, the items in the list will be sent one at a time.

        Returns:
            An iterator equivalent to: map(func, *iterables) but the calls may
            be evaluated out-of-order.

        Raises:
            TimeoutError: If the entire result iterator could not be generated
                before the given timeout.
            Exception: If fn(*args) raises for any values.
        r!zchunksize must be >= 1.rQ)r�)r�r>�maprrYrUr�)rr2r�rQrRZresultsr@rr
r��s�zProcessPoolExecutor.mapTc	Cs�|j�d|_W5QRX|jr6|j��|r6|j��d|_|jdk	rd|j��|r^|j��d|_d|_	d|_
|jr�|j��d|_dSr)r�rlr�r�rrr�rZjoin_threadr�r�)rrzrrr
�shutdown�s"





zProcessPoolExecutor.shutdown)NNNr)T)rrrrr�r�r�r�Executor�__text_signature__rKr�r�rLrrr@r
r��s�
K$
r�)NN)3rK�
__author__�atexitrcZconcurrent.futuresrrjrZmultiprocessingrZmultiprocessing.connectionZmultiprocessing.queuesrr�r��	functoolsrrOr�r)�WeakKeyDictionaryrrrr r�r��	Exceptionr#r'r-�objectr0r6r:r;rUrYr^rirkrr�r�r�r�ZBrokenExecutorr|r�r��registerrrrr
�<module>sV*
		

)&!Pconcurrent/futures/__pycache__/thread.cpython-38.opt-1.pyc000064400000013274151153537470017513 0ustar00U

e5d@"�@s�dZdZddlZddlmZddlZddlZddlZddlZddl	Z	e�
�Zdadd�Z
e�e
�Gdd	�d	e�Zd
d�ZGdd
�d
ej�ZGdd�dej�ZdS)zImplements ThreadPoolExecutor.z"Brian Quinlan (brian@sweetapp.com)�N)�_baseFcCsBdatt���}|D]\}}|�d�q|D]\}}|��q,dS�NT)�	_shutdown�list�_threads_queues�items�put�join)r�t�q�r�1/usr/lib64/python3.8/concurrent/futures/thread.py�_python_exit!src@seZdZdd�Zdd�ZdS)�	_WorkItemcCs||_||_||_||_dS�N)�future�fn�args�kwargs)�selfrrrrrrr
�__init__.sz_WorkItem.__init__c
Csf|j��sdSz|j|j|j�}Wn2tk
rT}z|j�|�d}W5d}~XYnX|j�|�dSr)rZset_running_or_notify_cancelrrr�
BaseException�
set_exceptionZ
set_result)r�result�excrrr
�run4s
z
_WorkItem.runN)�__name__�
__module__�__qualname__rrrrrr
r-srcCs�|dk	rRz||�Wn<tk
rPtjjddd�|�}|dk	rJ|��YdSXzx|jdd�}|dk	r�|��~|�}|dk	r�|j��~qT|�}t	s�|dks�|j	r�|dk	r�d|_	|�
d�WdS~qTWn$tk
r�tjjddd�YnXdS)NzException in initializer:T)�exc_info)�blockzException in worker)rrZLOGGERZcritical�_initializer_failed�getr�_idle_semaphore�releaserr)Zexecutor_referenceZ
work_queue�initializer�initargsZexecutor�	work_itemrrr
�_workerBs8

r(c@seZdZdZdS)�BrokenThreadPoolzR
    Raised when a worker thread in a ThreadPoolExecutor failed initializing.
    N)rrr�__doc__rrrr
r)msr)c@sfeZdZe��jZddd�Zdd�Ze	j
jje_e	j
jje_dd	�Z
d
d�Zdd
d�Ze	j
jje_dS)�ThreadPoolExecutorN�rcCs�|dkrtdt��pdd�}|dkr.td��|dk	rFt|�sFtd��||_t��|_	t
�d�|_t
�|_d|_d|_t
��|_|p�d	|��|_||_||_dS)
a�Initializes a new ThreadPoolExecutor instance.

        Args:
            max_workers: The maximum number of threads that can be used to
                execute the given calls.
            thread_name_prefix: An optional name prefix to give our threads.
            initializer: A callable used to initialize worker threads.
            initargs: A tuple of arguments to pass to the initializer.
        N� ��rz"max_workers must be greater than 0zinitializer must be a callableFzThreadPoolExecutor-%d)�min�os�	cpu_count�
ValueError�callable�	TypeError�_max_workers�queueZSimpleQueue�_work_queue�	threadingZ	Semaphorer#�set�_threads�_brokenrZLock�_shutdown_lock�_counter�_thread_name_prefix�_initializer�	_initargs)rZmax_workersZthread_name_prefixr%r&rrr
rxs$


�zThreadPoolExecutor.__init__c
Os�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��|j�f|jr�t|j��|j	r�t
d	��t	r�t
d
��t��}t
||||�}|j�|�|��|W5QR�SQRXdS)N�zDdescriptor 'submit' of 'ThreadPoolExecutor' object needs an argumentrrz.Passing 'fn' as keyword argument is deprecated)�
stacklevelz6submit expected at least 1 positional argument, got %dr.z*cannot schedule new futures after shutdownz6cannot schedule new futures after interpreter shutdown)�lenr5�pop�warnings�warn�DeprecationWarningr=r<r)r�RuntimeErrorrZFuturerr8r�_adjust_thread_count)rrrrrF�f�wrrr
�submit�s6

�
�
zThreadPoolExecutor.submitcCs�|jjdd�rdS|jfdd�}t|j�}||jkr�d|jp>||f}tj|t	t
�||�|j|j|j
fd�}d|_|��|j�|�|jt|<dS)Nr)ZtimeoutcSs|�d�dSr)r)�_rrrr
�
weakref_cb�sz;ThreadPoolExecutor._adjust_thread_count.<locals>.weakref_cbz%s_%d)�name�targetrT)r#�acquirer8rDr;r6r?r9ZThreadr(�weakref�refr@rAZdaemon�start�addr)rrOZnum_threadsZthread_namer
rrr
rJ�s&


�
��z'ThreadPoolExecutor._adjust_thread_countc	Csb|j�Rd|_z|j��}Wntjk
r6YqTYnX|dk	r|j�t|j��qW5QRXdS)NzBA thread initializer failed, the thread pool is not usable anymore)	r=r<r8Z
get_nowaitr7ZEmptyrrr))rr'rrr
r!�s
z&ThreadPoolExecutor._initializer_failedTc	Cs@|j�d|_|j�d�W5QRX|r<|jD]}|��q.dSr)r=rr8rr;r	)r�waitr
rrr
�shutdown�s
zThreadPoolExecutor.shutdown)Nr,Nr)T)rrr�	itertools�count�__next__r>rrMr�Executor�__text_signature__r*rJr!rXrrrr
r+ss
�
& 
r+)r*�
__author__�atexitZconcurrent.futuresrrYr7r9rSr1�WeakKeyDictionaryrrr�register�objectrr(ZBrokenExecutorr)r\r+rrrr
�<module>s 	
+concurrent/futures/__pycache__/__init__.cpython-38.opt-1.pyc000064400000002126151153537470017775 0ustar00U

e5d�@sTdZdZddlmZmZmZmZmZmZm	Z	m
Z
mZmZm
Z
dZdd�Zdd�Zd	S)
z?Execute computations asynchronously using threads or processes.z"Brian Quinlan (brian@sweetapp.com)�)�FIRST_COMPLETED�FIRST_EXCEPTION�
ALL_COMPLETED�CancelledError�TimeoutError�InvalidStateError�BrokenExecutor�Future�Executor�wait�as_completed)rrrrrrr	r
rr�ProcessPoolExecutor�ThreadPoolExecutorcCstdS)N)�
__author__�__doc__)�__all__�rr�3/usr/lib64/python3.8/concurrent/futures/__init__.py�__dir__$srcCsP|dkrddlm}|a|S|dkr8ddlm}|a|Stdt�d|����dS)Nr
�)r
r)rzmodule z has no attribute )Zprocessr
�threadr�AttributeError�__name__)�nameZpeZterrr�__getattr__(srN)rrZconcurrent.futures._baserrrrrrrr	r
rrrrrrrrr�<module>s
4concurrent/futures/__pycache__/thread.cpython-38.opt-2.pyc000064400000012232151153537470017505 0ustar00U

e5d@"�@s�dZddlZddlmZddlZddlZddlZddlZddlZe�	�Z
dadd�Ze�
e�Gdd�de�Zd	d
�ZGdd�dej�ZGd
d�dej�ZdS)z"Brian Quinlan (brian@sweetapp.com)�N)�_baseFcCsBdatt���}|D]\}}|�d�q|D]\}}|��q,dS�NT)�	_shutdown�list�_threads_queues�items�put�join)r�t�q�r�1/usr/lib64/python3.8/concurrent/futures/thread.py�_python_exit!src@seZdZdd�Zdd�ZdS)�	_WorkItemcCs||_||_||_||_dS�N)�future�fn�args�kwargs)�selfrrrrrrr
�__init__.sz_WorkItem.__init__c
Csf|j��sdSz|j|j|j�}Wn2tk
rT}z|j�|�d}W5d}~XYnX|j�|�dSr)rZset_running_or_notify_cancelrrr�
BaseException�
set_exceptionZ
set_result)r�result�excrrr
�run4s
z
_WorkItem.runN)�__name__�
__module__�__qualname__rrrrrr
r-srcCs�|dk	rRz||�Wn<tk
rPtjjddd�|�}|dk	rJ|��YdSXzx|jdd�}|dk	r�|��~|�}|dk	r�|j��~qT|�}t	s�|dks�|j	r�|dk	r�d|_	|�
d�WdS~qTWn$tk
r�tjjddd�YnXdS)NzException in initializer:T)�exc_info)�blockzException in worker)rrZLOGGERZcritical�_initializer_failed�getr�_idle_semaphore�releaserr)Zexecutor_referenceZ
work_queue�initializer�initargsZexecutor�	work_itemrrr
�_workerBs8

r(c@seZdZdS)�BrokenThreadPoolN)rrrrrrr
r)msr)c@sfeZdZe��jZddd�Zdd�Ze	j
jje_e	j
jje_dd	�Z
d
d�Zdd
d�Ze	j
jje_dS)�ThreadPoolExecutorN�rcCs�|dkrtdt��pdd�}|dkr.td��|dk	rFt|�sFtd��||_t��|_	t
�d�|_t
�|_d|_d|_t
��|_|p�d|��|_||_||_dS)	N� ��rz"max_workers must be greater than 0zinitializer must be a callableFzThreadPoolExecutor-%d)�min�os�	cpu_count�
ValueError�callable�	TypeError�_max_workers�queueZSimpleQueue�_work_queue�	threadingZ	Semaphorer#�set�_threads�_brokenrZLock�_shutdown_lock�_counter�_thread_name_prefix�_initializer�	_initargs)rZmax_workersZthread_name_prefixr%r&rrr
rxs$


�zThreadPoolExecutor.__init__c
Os�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��|j�f|jr�t|j��|j	r�t
d	��t	r�t
d
��t��}t
||||�}|j�|�|��|W5QR�SQRXdS)N�zDdescriptor 'submit' of 'ThreadPoolExecutor' object needs an argumentrrz.Passing 'fn' as keyword argument is deprecated)�
stacklevelz6submit expected at least 1 positional argument, got %dr-z*cannot schedule new futures after shutdownz6cannot schedule new futures after interpreter shutdown)�lenr4�pop�warnings�warn�DeprecationWarningr<r;r)r�RuntimeErrorrZFuturerr7r�_adjust_thread_count)rrrrrE�f�wrrr
�submit�s6

�
�
zThreadPoolExecutor.submitcCs�|jjdd�rdS|jfdd�}t|j�}||jkr�d|jp>||f}tj|t	t
�||�|j|j|j
fd�}d|_|��|j�|�|jt|<dS)Nr)ZtimeoutcSs|�d�dSr)r)�_rrrr
�
weakref_cb�sz;ThreadPoolExecutor._adjust_thread_count.<locals>.weakref_cbz%s_%d)�name�targetrT)r#�acquirer7rCr:r5r>r8ZThreadr(�weakref�refr?r@Zdaemon�start�addr)rrNZnum_threadsZthread_namer
rrr
rI�s&


�
��z'ThreadPoolExecutor._adjust_thread_countc	Csb|j�Rd|_z|j��}Wntjk
r6YqTYnX|dk	r|j�t|j��qW5QRXdS)NzBA thread initializer failed, the thread pool is not usable anymore)	r<r;r7Z
get_nowaitr6ZEmptyrrr))rr'rrr
r!�s
z&ThreadPoolExecutor._initializer_failedTc	Cs@|j�d|_|j�d�W5QRX|r<|jD]}|��q.dSr)r<rr7rr:r	)r�waitr
rrr
�shutdown�s
zThreadPoolExecutor.shutdown)Nr+Nr)T)rrr�	itertools�count�__next__r=rrLr�Executor�__text_signature__�__doc__rIr!rWrrrr
r*ss
�
& 
r*)�
__author__�atexitZconcurrent.futuresrrXr6r8rRr0�WeakKeyDictionaryrrr�register�objectrr(ZBrokenExecutorr)r[r*rrrr
�<module>s	
+concurrent/futures/__pycache__/process.cpython-38.pyc000064400000047516151153537470016771 0ustar00U

e5dzn�@s�dZdZddlZddlZddlmZddlZddlmZddlZ	ddl
ZddlmZddl
Z
ddlZddlmZddlZddlZddlZe��ZdaGd	d
�d
�Zdd�Zd
ZdZGdd�de�ZGdd�d�Zdd�ZGdd�de�Z Gdd�de�Z!Gdd�de�Z"Gdd�de�Z#dd�Z$dd �Z%d1d!d"�Z&d#d$�Z'd%d&�Z(d'd(�Z)da*da+d)d*�Z,d+d,�Z-Gd-d.�d.ej.�Z/Gd/d0�d0ej0�Z1e�2e�dS)2a-	Implements ProcessPoolExecutor.

The following diagram and text describe the data-flow through the system:

|======================= In-process =====================|== Out-of-process ==|

+----------+     +----------+       +--------+     +-----------+    +---------+
|          |  => | Work Ids |       |        |     | Call Q    |    | Process |
|          |     +----------+       |        |     +-----------+    |  Pool   |
|          |     | ...      |       |        |     | ...       |    +---------+
|          |     | 6        |    => |        |  => | 5, call() | => |         |
|          |     | 7        |       |        |     | ...       |    |         |
| Process  |     | ...      |       | Local  |     +-----------+    | Process |
|  Pool    |     +----------+       | Worker |                      |  #1..n  |
| Executor |                        | Thread |                      |         |
|          |     +----------- +     |        |     +-----------+    |         |
|          | <=> | Work Items | <=> |        | <=  | Result Q  | <= |         |
|          |     +------------+     |        |     +-----------+    |         |
|          |     | 6: call()  |     |        |     | ...       |    |         |
|          |     |    future  |     |        |     | 4, result |    |         |
|          |     | ...        |     |        |     | 3, except |    |         |
+----------+     +------------+     +--------+     +-----------+    +---------+

Executor.submit() called:
- creates a uniquely numbered _WorkItem and adds it to the "Work Items" dict
- adds the id of the _WorkItem to the "Work Ids" queue

Local worker thread:
- reads work ids from the "Work Ids" queue and looks up the corresponding
  WorkItem from the "Work Items" dict: if the work item has been cancelled then
  it is simply removed from the dict, otherwise it is repackaged as a
  _CallItem and put in the "Call Q". New _CallItems are put in the "Call Q"
  until "Call Q" is full. NOTE: the size of the "Call Q" is kept small because
  calls placed in the "Call Q" can no longer be cancelled with Future.cancel().
- reads _ResultItems from "Result Q", updates the future stored in the
  "Work Items" dict and deletes the dict entry

Process #1..n:
- reads _CallItems from "Call Q", executes the calls, and puts the resulting
  _ResultItems in "Result Q"
z"Brian Quinlan (brian@sweetapp.com)�N)�_base)�Full)�Queue)�partialFc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�
_ThreadWakeupcCstjdd�\|_|_dS)NF)Zduplex)�mpZPipe�_reader�_writer��self�r�2/usr/lib64/python3.8/concurrent/futures/process.py�__init__Rsz_ThreadWakeup.__init__cCs|j��|j��dS�N)r	�closerr
rrr
rUs
z_ThreadWakeup.closecCs|j�d�dS)N�)r	Z
send_bytesr
rrr
�wakeupYsz_ThreadWakeup.wakeupcCs|j��r|j��qdSr)rZpollZ
recv_bytesr
rrr
�clear\s
z_ThreadWakeup.clearN)�__name__�
__module__�__qualname__rrrrrrrr
rQsrcCs@datt���}|D]\}}|��q|D]\}}|��q*dS�NT)�_global_shutdown�list�_threads_wakeups�itemsr�join)r�_�
thread_wakeup�trrr
�_python_exitas
r ��=c@seZdZdd�Zdd�ZdS)�_RemoteTracebackcCs
||_dSr��tb)rr%rrr
rzsz_RemoteTraceback.__init__cCs|jSrr$r
rrr
�__str__|sz_RemoteTraceback.__str__N)rrrrr&rrrr
r#ysr#c@seZdZdd�Zdd�ZdS)�_ExceptionWithTracebackcCs0t�t|�||�}d�|�}||_d||_dS)N�z

"""
%s""")�	traceback�format_exception�typer�excr%)rr,r%rrr
r�s
z _ExceptionWithTraceback.__init__cCst|j|jffSr)�_rebuild_excr,r%r
rrr
�
__reduce__�sz"_ExceptionWithTraceback.__reduce__N)rrrrr.rrrr
r'sr'cCst|�|_|Sr)r#�	__cause__)r,r%rrr
r-�s
r-c@seZdZdd�ZdS)�	_WorkItemcCs||_||_||_||_dSr)�future�fn�args�kwargs)rr1r2r3r4rrr
r�sz_WorkItem.__init__N�rrrrrrrr
r0�sr0c@seZdZddd�ZdS)�_ResultItemNcCs||_||_||_dSr)�work_id�	exception�result)rr7r8r9rrr
r�sz_ResultItem.__init__)NNr5rrrr
r6�sr6c@seZdZdd�ZdS)�	_CallItemcCs||_||_||_||_dSr)r7r2r3r4)rr7r2r3r4rrr
r�sz_CallItem.__init__Nr5rrrr
r:�sr:cs.eZdZdZd�fdd�	Z�fdd�Z�ZS)�
_SafeQueuez=Safe Queue set exception to the future object linked to a jobrcs||_t�j||d�dS)N)�ctx)�pending_work_items�superr)r�max_sizer<r=��	__class__rr
r�sz_SafeQueue.__init__cslt|t�rZt�t|�||j�}td�d�|���|_	|j
�|jd�}|dk	rh|j
�|�nt��||�dS)Nz

"""
{}"""r()�
isinstancer:r)r*r+�
__traceback__r#�formatrr/r=�popr7r1�
set_exceptionr>�_on_queue_feeder_error)r�e�objr%�	work_itemr@rr
rG�s
z!_SafeQueue._on_queue_feeder_error)r)rrr�__doc__rrG�
__classcell__rrr@r
r;�sr;cgs,t|�}tt�||��}|s dS|VqdS)z, Iterates over zip()ed iterables in chunks. N)�zip�tuple�	itertools�islice)�	chunksize�	iterables�it�chunkrrr
�_get_chunks�s
rUcs�fdd�|D�S)z� Processes a chunk of an iterable passed to map.

    Runs the function passed to map() on a chunk of the
    iterable passed to map.

    This function is run in a separate process.

    csg|]}�|��qSrr)�.0r3�r2rr
�
<listcomp>�sz"_process_chunk.<locals>.<listcomp>r)r2rTrrWr
�_process_chunk�s	rYc
Cs^z|�t|||d��Wn@tk
rX}z"t||j�}|�t||d��W5d}~XYnXdS)z.Safely send back the given result or exception)r9r8�r8N)�putr6�
BaseExceptionr'rC)�result_queuer7r9r8rHr,rrr
�_sendback_result�s
�r^c
Cs�|dk	r<z||�Wn&tk
r:tjjddd�YdSX|jdd�}|dkrb|�t���dSz|j|j	|j
�}Wn>tk
r�}z t||j�}t
||j|d�W5d}~XYnXt
||j|d�~~q<dS)a�Evaluates calls from call_queue and places the results in result_queue.

    This worker is run in a separate process.

    Args:
        call_queue: A ctx.Queue of _CallItems that will be read and
            evaluated by the worker.
        result_queue: A ctx.Queue of _ResultItems that will written
            to by the worker.
        initializer: A callable initializer, or None
        initargs: A tuple of args for the initializer
    NzException in initializer:T)�exc_info��blockrZ)r9)r\rZLOGGERZcritical�getr[�os�getpidr2r3r4r'rCr^r7)�
call_queuer]�initializer�initargsZ	call_item�rrHr,rrr
�_process_worker�s$
"ricCsv|��rdSz|jdd�}Wntjk
r4YdSX||}|j��rh|jt||j|j	|j
�dd�q||=qqdS)aMFills call_queue with _WorkItems from pending_work_items.

    This function never blocks.

    Args:
        pending_work_items: A dict mapping work ids to _WorkItems e.g.
            {5: <_WorkItem...>, 6: <_WorkItem...>, ...}
        work_ids: A queue.Queue of work ids e.g. Queue([5, 6, ...]). Work ids
            are consumed and the corresponding _WorkItems from
            pending_work_items are transformed into _CallItems and put in
            call_queue.
        call_queue: A multiprocessing.Queue that will be filled with _CallItems
            derived from _WorkItems.
    NFr`T)Zfullrb�queueZEmptyr1Zset_running_or_notify_cancelr[r:r2r3r4)r=Zwork_idsrer7rJrrr
�_add_call_item_to_queue�s"
��rkc
sJd��fdd�}��fdd�}|j}	|j}
|	|
g}t||��dd����D�}tj�||�}
d}d}|	|
kr�z|	��}d	}Wq�tk
r�}zt�	t
|�||j�}W5d}~XYq�Xn|
|
kr�d	}d}|��|�rl|���dk	r�d
�_
d�_d�td�}|dk	�r tdd
�|��d��|_|��D]\}}|j�|�~�q(|�����D]}|���qR|�dSt|t��r�|��s�t���|�}|����s�|�dSnL|dk	�r�|�|jd�}|dk	�r�|j�r�|j�|j�n|j�|j�~~|��|��r@z&�dk	�rd�_|�s&|�WdSWntk
�r>YnXd�q2dS)a,Manages the communication between this process and the worker processes.

    This function is run in a local thread.

    Args:
        executor_reference: A weakref.ref to the ProcessPoolExecutor that owns
            this thread. Used to determine if the ProcessPoolExecutor has been
            garbage collected and that this function can exit.
        process: A list of the ctx.Process instances used as
            workers.
        pending_work_items: A dict mapping work ids to _WorkItems e.g.
            {5: <_WorkItem...>, 6: <_WorkItem...>, ...}
        work_ids_queue: A queue.Queue of work ids e.g. Queue([5, 6, ...]).
        call_queue: A ctx.Queue that will be filled with _CallItems
            derived from _WorkItems for processing by the process workers.
        result_queue: A ctx.SimpleQueue of _ResultItems generated by the
            process workers.
        thread_wakeup: A _ThreadWakeup to allow waking up the
            queue_manager_thread from the main Thread and avoid deadlocks
            caused by permanently locked queues.
    Ncstp�dkp�jSr)r�_shutdown_threadr)�executorrr
�
shutting_down@s�z/_queue_management_worker.<locals>.shutting_downc	s�tdd����D��}|}d}||kr�|dkr�t||�D]6}z��d�|d7}Wq:tk
rnYqrYq:Xq:tdd����D��}q������D]}|��q�dS)Ncss|]}|��VqdSr�Zis_alive�rV�prrr
�	<genexpr>FszD_queue_management_worker.<locals>.shutdown_worker.<locals>.<genexpr>rr!css|]}|��VqdSrrorprrr
rrRs)�sum�values�rangeZ
put_nowaitrrr)Zn_children_aliveZn_children_to_stopZn_sentinels_sent�irq)re�	processesrr
�shutdown_workerDs
z1_queue_management_worker.<locals>.shutdown_workercSsg|]
}|j�qSr)�sentinelrprrr
rXisz,_queue_management_worker.<locals>.<listcomp>TFzKA child process terminated abruptly, the process pool is not usable anymorez^A process in the process pool was terminated abruptly while the future was running or pending.z
'''
r(z''') rrkrtrZ
connection�waitZrecvr\r)r*r+rCr�_brokenrl�BrokenProcessPoolr#rr/rr1rFZ	terminaterB�int�AssertionErrorrEr7r8Z
set_resultr9r)Zexecutor_referencerwr=Zwork_ids_queuerer]rrnrxZ
result_readerZ
wakeup_readerZreadersZworker_sentinelsZready�causeZ	is_brokenZresult_itemrHZbper7rJrqr)rermrwr
�_queue_management_worker"s��	(
�




r�c	Csjtrtrtt��dazt�d�}Wnttfk
r<YdSX|dkrJdS|dkrVdSd|att��dS)NT�SC_SEM_NSEMS_MAX����z@system provides too few semaphores (%d available, 256 necessary))�_system_limits_checked�_system_limited�NotImplementedErrorrc�sysconf�AttributeError�
ValueError)Z	nsems_maxrrr
�_check_system_limits�s �r�ccs&|D]}|��|r|��VqqdS)z�
    Specialized implementation of itertools.chain.from_iterable.
    Each item in *iterable* should be a list.  This function is
    careful not to keep references to yielded objects.
    N)�reverserE)�iterableZelementrrr
�_chain_from_iterable_of_lists�sr�c@seZdZdZdS)r|zy
    Raised when a process in a ProcessPoolExecutor terminated abruptly
    while a future was in the running state.
    N)rrrrKrrrr
r|�sr|csteZdZddd�Zdd�Zdd�Zd	d
�Zejjj	e_	ejjj
e_
ddd��fd
d�
Zddd�Zejjj
e_
�Z
S)�ProcessPoolExecutorNrcCst�|dkr6t��pd|_tjdkrntt|j�|_n8|dkrHtd��n tjdkrh|tkrhtdt����||_|dkr~t	�
�}||_|dk	r�t|�s�t
d��||_||_d|_i|_d|_t��|_d|_d|_i|_|jt}t||j|jd	�|_d
|j_|��|_t� �|_!t"�|_#dS)aSInitializes a new ProcessPoolExecutor instance.

        Args:
            max_workers: The maximum number of processes that can be used to
                execute the given calls. If None or not given then as many
                worker processes will be created as the machine has processors.
            mp_context: A multiprocessing context to launch the workers. This
                object should provide SimpleQueue, Queue and Process.
            initializer: A callable used to initialize worker processes.
            initargs: A tuple of arguments to pass to the initializer.
        Nr!Zwin32rz"max_workers must be greater than 0zmax_workers must be <= zinitializer must be a callableF)r?r<r=T)$r�rc�	cpu_count�_max_workers�sys�platform�min�_MAX_WINDOWS_WORKERSr�rZget_context�_mp_context�callable�	TypeError�_initializer�	_initargs�_queue_management_thread�
_processesrl�	threadingZLock�_shutdown_lockr{�_queue_count�_pending_work_items�EXTRA_QUEUED_CALLSr;�_call_queueZ
_ignore_epipeZSimpleQueue�
_result_queuerjr�	_work_idsr�_queue_management_thread_wakeup)rZmax_workersZ
mp_contextrfrgZ
queue_sizerrr
r�sP

�

��

�

zProcessPoolExecutor.__init__c	Csv|jdkrr|jfdd�}|��tjtt�||�|j|j	|j
|j|j|jfdd�|_d|j_
|j��|jt|j<dS)NcSstj�d�|��dS)Nz?Executor collected: triggering callback for QueueManager wakeup)r�util�debugr)rrrrr
�
weakref_cbBszFProcessPoolExecutor._start_queue_management_thread.<locals>.weakref_cbZQueueManagerThread)�targetr3�nameT)r�r��_adjust_process_countr�ZThreadr��weakref�refr�r�r�r�r�Zdaemon�startr)rr�rrr
�_start_queue_management_thread=s(
�

��

�z2ProcessPoolExecutor._start_queue_management_threadcCsPtt|j�|j�D]8}|jjt|j|j|j	|j
fd�}|��||j|j<qdS)N)r�r3)
ru�lenr�r�r�ZProcessrir�r�r�r�r��pid)rrrqrrr
r�Xs��z)ProcessPoolExecutor._adjust_process_countc
Os
t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��|j��|jr�t|j��|j	r�t
d	��tr�t
d
��t�
�}t||||�}||j|j<|j�|j�|jd7_|j��|��|W5QR�SQRXdS)N�zEdescriptor 'submit' of 'ProcessPoolExecutor' object needs an argumentr2rz.Passing 'fn' as keyword argument is deprecated)�
stacklevelz6submit expected at least 1 positional argument, got %dr!z*cannot schedule new futures after shutdownz6cannot schedule new futures after interpreter shutdown)r�r�rE�warnings�warn�DeprecationWarningr�r{r|rl�RuntimeErrorrrZFuturer0r�r�r�r[r�rr�)r3r4rr2r��f�wrrr
�submitcs<

�
�

zProcessPoolExecutor.submitr!)�timeoutrQcs:|dkrtd��t�jtt|�t|d|i�|d�}t|�S)ajReturns an iterator equivalent to map(fn, iter).

        Args:
            fn: A callable that will take as many arguments as there are
                passed iterables.
            timeout: The maximum number of seconds to wait. If None, then there
                is no limit on the wait time.
            chunksize: If greater than one, the iterables will be chopped into
                chunks of size chunksize and submitted to the process pool.
                If set to one, the items in the list will be sent one at a time.

        Returns:
            An iterator equivalent to: map(func, *iterables) but the calls may
            be evaluated out-of-order.

        Raises:
            TimeoutError: If the entire result iterator could not be generated
                before the given timeout.
            Exception: If fn(*args) raises for any values.
        r!zchunksize must be >= 1.rQ)r�)r�r>�maprrYrUr�)rr2r�rQrRZresultsr@rr
r��s�zProcessPoolExecutor.mapTc	Cs�|j�d|_W5QRX|jr6|j��|r6|j��d|_|jdk	rd|j��|r^|j��d|_d|_	d|_
|jr�|j��d|_dSr)r�rlr�r�rrr�rZjoin_threadr�r�)rrzrrr
�shutdown�s"





zProcessPoolExecutor.shutdown)NNNr)T)rrrrr�r�r�r�Executor�__text_signature__rKr�r�rLrrr@r
r��s�
K$
r�)NN)3rK�
__author__�atexitrcZconcurrent.futuresrrjrZmultiprocessingrZmultiprocessing.connectionZmultiprocessing.queuesrr�r��	functoolsrrOr�r)�WeakKeyDictionaryrrrr r�r��	Exceptionr#r'r-�objectr0r6r:r;rUrYr^rirkr�r�r�r�r�ZBrokenExecutorr|r�r��registerrrrr
�<module>sV*
		

)&!Pconcurrent/futures/__pycache__/_base.cpython-38.opt-2.pyc000064400000033521151153537470017313 0ustar00U

e5dY�
@spdZddlZddlZddlZddlZdZdZdZdZdZ	dZ
d	Zd
ZdZ
e	e
eee
gZe	de
d
edede
diZe�d�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd �d e�ZGd!d"�d"e�Zd#d$�Zd%d&�Zd3d'd(�Ze� d)d*�Z!defd+d,�Z"Gd-d.�d.e�Z#Gd/d0�d0e�Z$Gd1d2�d2e%�Z&dS)4z"Brian Quinlan (brian@sweetapp.com)�N�FIRST_COMPLETED�FIRST_EXCEPTION�
ALL_COMPLETED�
_AS_COMPLETED�PENDING�RUNNING�	CANCELLED�CANCELLED_AND_NOTIFIED�FINISHED�pending�running�	cancelled�finishedzconcurrent.futuresc@seZdZdS)�ErrorN��__name__�
__module__�__qualname__�rr�0/usr/lib64/python3.8/concurrent/futures/_base.pyr,src@seZdZdS)�CancelledErrorNrrrrrr0src@seZdZdS)�TimeoutErrorNrrrrrr4src@seZdZdS)�InvalidStateErrorNrrrrrr8src@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�_WaitercCst��|_g|_dS�N)�	threadingZEvent�event�finished_futures��selfrrr�__init__>s
z_Waiter.__init__cCs|j�|�dSr�r�append�r�futurerrr�
add_resultBsz_Waiter.add_resultcCs|j�|�dSrr!r#rrr�
add_exceptionEsz_Waiter.add_exceptioncCs|j�|�dSrr!r#rrr�
add_cancelledHsz_Waiter.add_cancelledN)rrrr r%r&r'rrrrr<srcs@eZdZ�fdd�Z�fdd�Z�fdd�Z�fdd�Z�ZS)	�_AsCompletedWaitercstt|���t��|_dSr)�superr(r r�Lock�lockr��	__class__rrr Nsz_AsCompletedWaiter.__init__c	s0|j� tt|��|�|j��W5QRXdSr)r+r)r(r%r�setr#r,rrr%Rsz_AsCompletedWaiter.add_resultc	s0|j� tt|��|�|j��W5QRXdSr)r+r)r(r&rr.r#r,rrr&Wsz _AsCompletedWaiter.add_exceptionc	s0|j� tt|��|�|j��W5QRXdSr)r+r)r(r'rr.r#r,rrr'\sz _AsCompletedWaiter.add_cancelled)rrrr r%r&r'�
__classcell__rrr,rr(Ksr(cs4eZdZ�fdd�Z�fdd�Z�fdd�Z�ZS)�_FirstCompletedWaitercst��|�|j��dSr)r)r%rr.r#r,rrr%dsz _FirstCompletedWaiter.add_resultcst��|�|j��dSr)r)r&rr.r#r,rrr&hsz#_FirstCompletedWaiter.add_exceptioncst��|�|j��dSr)r)r'rr.r#r,rrr'lsz#_FirstCompletedWaiter.add_cancelled)rrrr%r&r'r/rrr,rr0asr0csHeZdZ�fdd�Zdd�Z�fdd�Z�fdd�Z�fd	d
�Z�ZS)�_AllCompletedWaitercs$||_||_t��|_t���dSr)�num_pending_calls�stop_on_exceptionrr*r+r)r )rr2r3r,rrr ss
z_AllCompletedWaiter.__init__c	Cs4|j�$|jd8_|js&|j��W5QRXdS)N�)r+r2rr.rrrr�_decrement_pending_callsysz,_AllCompletedWaiter._decrement_pending_callscst��|�|��dSr)r)r%r5r#r,rrr%sz_AllCompletedWaiter.add_resultcs*t��|�|jr|j��n|��dSr)r)r&r3rr.r5r#r,rrr&�sz!_AllCompletedWaiter.add_exceptioncst��|�|��dSr)r)r'r5r#r,rrr'�sz!_AllCompletedWaiter.add_cancelled)	rrrr r5r%r&r'r/rrr,rr1ps
r1c@s$eZdZdd�Zdd�Zdd�ZdS)�_AcquireFuturescCst|td�|_dS)N)�key)�sorted�id�futures)rr:rrrr �sz_AcquireFutures.__init__cCs|jD]}|j��qdSr)r:�
_condition�acquirer#rrr�	__enter__�s
z_AcquireFutures.__enter__cGs|jD]}|j��qdSr)r:r;�release)r�argsr$rrr�__exit__�s
z_AcquireFutures.__exit__N)rrrr r=r@rrrrr6�sr6cCs�|tkrt�}nZ|tkr t�}nJtdd�|D��}|tkrHt|dd�}n"|tkr^t|dd�}ntd|��|D]}|j	�
|�qn|S)Ncss|]}|jttfkVqdSr��_stater	r
��.0�frrr�	<genexpr>�sz._create_and_install_waiters.<locals>.<genexpr>T)r3FzInvalid return condition: %r)rr(rr0�sumrr1r�
ValueError�_waitersr")�fs�return_when�waiterZ
pending_countrErrr�_create_and_install_waiters�s�rMc	csP|rL|d}|D]}|�|�q|j�|j�|�W5QRX~|��VqdS)N���)�remover;rI�pop)rJrL�ref_collectrEZfutures_setrrr�_yield_finished_futures�srRc	csB|dk	r|t��}t|�}t|�}t|��*tdd�|D��}||}t|t�}W5QRXt|�}z�t|||fd�EdH|�r|dkr�d}n(|t��}|dkr�tdt|�|f��|j
�|�|j�|j}g|_|j
��W5QRX|��t||||fd�EdHq|W5|D]$}|j�|j	�
|�W5QRX�qXdS)Ncss |]}|jttfkr|VqdSrrArCrrrrF�s�zas_completed.<locals>.<genexpr>)rQrz%d (of %d) futures unfinished)�time�	monotonicr.�lenr6rMr�listr;rIrOrRrr�waitr+r�clear�reverse)	rJ�timeout�end_timeZ
total_futuresrrrLrEZwait_timeoutrrr�as_completed�sL
�����r\�DoneAndNotDoneFuturesz
done not_donec
Cs
t|���tdd�|D��}t|�|}|tkrJ|rJt||�W5QR�S|tkr~|r~tdd�|D��r~t||�W5QR�St|�t|�kr�t||�W5QR�St||�}W5QRX|j�	|�|D]"}|j
�|j�|�W5QRXq�|�
|j�t|t|�|�S)Ncss |]}|jttfkr|VqdSrrArCrrrrF!s�zwait.<locals>.<genexpr>css&|]}|��s|��dk	r|VqdSr)r
�	exceptionrCrrrrF(s�)r6r.rr]r�anyrUrMrrWr;rIrO�updater)rJrZrK�doneZnot_donerLrErrrrWs"
rWc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zddd�Zddd�Z
dd�Zdd�Zdd�ZdS) �FuturecCs,t��|_t|_d|_d|_g|_g|_dSr)	rZ	Conditionr;rrB�_result�
_exceptionrI�_done_callbacksrrrrr <s
zFuture.__init__c	Cs>|jD]2}z||�Wqtk
r6t�d|�YqXqdS�Nz!exception calling callback for %r)re�	Exception�LOGGERr^)r�callbackrrr�_invoke_callbacksEs

zFuture._invoke_callbacksc
Cs�|j��|jtkrx|jrHd|jjt|�t|j|jjjfW5QR�Sd|jjt|�t|j|jjjfW5QR�Sd|jjt|�t|jfW5QR�SQRXdS)Nz<%s at %#x state=%s raised %s>z <%s at %#x state=%s returned %s>z<%s at %#x state=%s>)	r;rBr
rdr-rr9�_STATE_TO_DESCRIPTION_MAPrcrrrr�__repr__Ls(
���zFuture.__repr__c	Csf|j�N|jttfkr$W5QR�dS|jttfkr@W5QR�dSt|_|j��W5QRX|��dS)NFT)r;rBrr
rr	�
notify_allrjrrrr�cancel`sz
Future.cancelc
Cs,|j�|jttfkW5QR�SQRXdSr)r;rBrr	rrrrr
sszFuture.cancelledc
Cs(|j�|jtkW5QR�SQRXdSr)r;rBrrrrrrxszFuture.runningc
Cs.|j�|jtttfkW5QR�SQRXdSr)r;rBrr	r
rrrrra}szFuture.donecCs$|jrz
|j�W5d}Xn|jSdSr)rdrcrrrrZ__get_result�s

zFuture.__get_resultc	Csn|j�0|jtttfkr2|j�|�W5QR�dSW5QRXz||�Wn tk
rht�	d|�YnXdSrf)
r;rBrr	r
rer"rgrhr^)r�fnrrr�add_done_callback�szFuture.add_done_callbackNc
Cs�z�|j��|jttfkr t��n"|jtkrB|��W5QR�W�ZS|j�|�|jttfkrdt��n(|jtkr�|��W5QR�W�St��W5QRXW5d}XdSr)	r;rBrr	rr
�_Future__get_resultrWr�rrZrrr�result�s

z
Future.resultc
Cs�|j�||jttfkrt��n|jtkr:|jW5QR�S|j�|�|jttfkr\t��n"|jtkrx|jW5QR�St��W5QRXdSr)	r;rBrr	rr
rdrWrrrrrrr^�s

zFuture.exceptionc	Cs�|j�t|jtkr<t|_|jD]}|�|�qW5QR�dS|jtkrZt|_W5QR�dSt�	dt
|�|j�td��W5QRXdS)NFTz!Future %s in unexpected state: %szFuture in unexpected state)r;rBrr	rIr'rrrhZcriticalr9�RuntimeError)rrLrrr�set_running_or_notify_cancel�s


�z#Future.set_running_or_notify_cancelc	Csl|j�T|jttthkr*td�|j|���||_t|_|jD]}|�	|�q<|j�
�W5QRX|��dS�Nz{}: {!r})r;rBrr	r
r�formatrcrIr%rmrj)rrsrLrrr�
set_result
s
zFuture.set_resultc	Csl|j�T|jttthkr*td�|j|���||_t|_|jD]}|�	|�q<|j�
�W5QRX|��dSrv)r;rBrr	r
rrwrdrIr&rmrj)rr^rLrrr�
set_exceptions
zFuture.set_exception)N)N)rrrr rjrlrnr
rrarqrprsr^rurxryrrrrrb9s	

#
"(rbc@sDeZdZdd�Zde_ddd�dd�Zdd
d�Zdd
�Zdd�ZdS)�ExecutorcOs\t|�dkrnD|std��n6d|kr>ddl}|jdtdd�ntdt|�d��t��dS)	N�z:descriptor 'submit' of 'Executor' object needs an argumentrorz.Passing 'fn' as keyword argument is deprecated)�
stacklevelz6submit expected at least 1 positional argument, got %dr4)rU�	TypeError�warnings�warn�DeprecationWarning�NotImplementedError)r?�kwargsr~rrr�submit.s	
�
�zExecutor.submitz($self, fn, /, *args, **kwargs)Nr4)rZ�	chunksizecsB�dk	r�t�����fdd�t|�D�����fdd�}|�S)Ncsg|]}�j�f|���qSr)r�)rDr?)rorrr�
<listcomp>`sz Executor.map.<locals>.<listcomp>c	3s\zB����r@�dkr&�����Vq
�����t���Vq
W5�D]}|��qHXdSr)rnrYrPrsrSrT)r$)r[rJrZrr�result_iteratordsz%Executor.map.<locals>.result_iterator)rSrT�zip)rrorZr��	iterablesr�r)r[rorJrrZr�mapGs

zExecutor.mapTcCsdSrr)rrWrrr�shutdownsszExecutor.shutdowncCs|Srrrrrrr=�szExecutor.__enter__cCs|jdd�dS)NT)rWF)r�)r�exc_typeZexc_valZexc_tbrrrr@�szExecutor.__exit__)T)	rrrr��__text_signature__r�r�r=r@rrrrrz+s,

rzc@seZdZdS)�BrokenExecutorNrrrrrr��sr�)N)'�
__author__�collectionsZloggingrrSrrrrrrrr	r
Z_FUTURE_STATESrkZ	getLoggerrhrgrrrr�objectrr(r0r1r6rMrRr\�
namedtupler]rWrbrzrtr�rrrr�<module>sh�	�	

>�1s]concurrent/futures/__pycache__/_base.cpython-38.pyc000064400000052666151153537470016366 0ustar00U

e5dY�
@spdZddlZddlZddlZddlZdZdZdZdZdZ	dZ
d	Zd
ZdZ
e	e
eee
gZe	de
d
edede
diZe�d�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd �d e�ZGd!d"�d"e�Zd#d$�Zd%d&�Zd3d'd(�Ze� d)d*�Z!defd+d,�Z"Gd-d.�d.e�Z#Gd/d0�d0e�Z$Gd1d2�d2e%�Z&dS)4z"Brian Quinlan (brian@sweetapp.com)�N�FIRST_COMPLETED�FIRST_EXCEPTION�
ALL_COMPLETED�
_AS_COMPLETED�PENDING�RUNNING�	CANCELLED�CANCELLED_AND_NOTIFIED�FINISHED�pending�running�	cancelled�finishedzconcurrent.futuresc@seZdZdZdS)�Errorz-Base class for all future-related exceptions.N��__name__�
__module__�__qualname__�__doc__�rr�0/usr/lib64/python3.8/concurrent/futures/_base.pyr,src@seZdZdZdS)�CancelledErrorzThe Future was cancelled.Nrrrrrr0src@seZdZdZdS)�TimeoutErrorz*The operation exceeded the given deadline.Nrrrrrr4src@seZdZdZdS)�InvalidStateErrorz+The operation is not allowed in this state.Nrrrrrr8src@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�_Waiterz;Provides the event that wait() and as_completed() block on.cCst��|_g|_dS�N)�	threadingZEvent�event�finished_futures��selfrrr�__init__>s
z_Waiter.__init__cCs|j�|�dSr�r�append�r �futurerrr�
add_resultBsz_Waiter.add_resultcCs|j�|�dSrr"r$rrr�
add_exceptionEsz_Waiter.add_exceptioncCs|j�|�dSrr"r$rrr�
add_cancelledHsz_Waiter.add_cancelledN)rrrrr!r&r'r(rrrrr<s
rcsDeZdZdZ�fdd�Z�fdd�Z�fdd�Z�fdd	�Z�ZS)
�_AsCompletedWaiterzUsed by as_completed().cstt|���t��|_dSr)�superr)r!r�Lock�lockr��	__class__rrr!Nsz_AsCompletedWaiter.__init__c	s0|j� tt|��|�|j��W5QRXdSr)r,r*r)r&r�setr$r-rrr&Rsz_AsCompletedWaiter.add_resultc	s0|j� tt|��|�|j��W5QRXdSr)r,r*r)r'rr/r$r-rrr'Wsz _AsCompletedWaiter.add_exceptionc	s0|j� tt|��|�|j��W5QRXdSr)r,r*r)r(rr/r$r-rrr(\sz _AsCompletedWaiter.add_cancelled)	rrrrr!r&r'r(�
__classcell__rrr-rr)Ks
r)cs8eZdZdZ�fdd�Z�fdd�Z�fdd�Z�ZS)�_FirstCompletedWaiterz*Used by wait(return_when=FIRST_COMPLETED).cst��|�|j��dSr)r*r&rr/r$r-rrr&dsz _FirstCompletedWaiter.add_resultcst��|�|j��dSr)r*r'rr/r$r-rrr'hsz#_FirstCompletedWaiter.add_exceptioncst��|�|j��dSr)r*r(rr/r$r-rrr(lsz#_FirstCompletedWaiter.add_cancelled)rrrrr&r'r(r0rrr-rr1asr1csLeZdZdZ�fdd�Zdd�Z�fdd�Z�fdd	�Z�fd
d�Z�Z	S)�_AllCompletedWaiterz<Used by wait(return_when=FIRST_EXCEPTION and ALL_COMPLETED).cs$||_||_t��|_t���dSr)�num_pending_calls�stop_on_exceptionrr+r,r*r!)r r3r4r-rrr!ss
z_AllCompletedWaiter.__init__c	Cs4|j�$|jd8_|js&|j��W5QRXdS)N�)r,r3rr/rrrr�_decrement_pending_callsysz,_AllCompletedWaiter._decrement_pending_callscst��|�|��dSr)r*r&r6r$r-rrr&sz_AllCompletedWaiter.add_resultcs*t��|�|jr|j��n|��dSr)r*r'r4rr/r6r$r-rrr'�sz!_AllCompletedWaiter.add_exceptioncst��|�|��dSr)r*r(r6r$r-rrr(�sz!_AllCompletedWaiter.add_cancelled)
rrrrr!r6r&r'r(r0rrr-rr2psr2c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_AcquireFutureszDA context manager that does an ordered acquire of Future conditions.cCst|td�|_dS)N)�key)�sorted�id�futures)r r;rrrr!�sz_AcquireFutures.__init__cCs|jD]}|j��qdSr)r;�
_condition�acquirer$rrr�	__enter__�s
z_AcquireFutures.__enter__cGs|jD]}|j��qdSr)r;r<�release)r �argsr%rrr�__exit__�s
z_AcquireFutures.__exit__N)rrrrr!r>rArrrrr7�sr7cCs�|tkrt�}nZ|tkr t�}nJtdd�|D��}|tkrHt|dd�}n"|tkr^t|dd�}ntd|��|D]}|j	�
|�qn|S)Ncss|]}|jttfkVqdSr��_stater	r
��.0�frrr�	<genexpr>�sz._create_and_install_waiters.<locals>.<genexpr>T)r4FzInvalid return condition: %r)rr)rr1�sumrr2r�
ValueError�_waitersr#)�fs�return_when�waiterZ
pending_countrFrrr�_create_and_install_waiters�s�rNc	csP|rL|d}|D]}|�|�q|j�|j�|�W5QRX~|��VqdS)a~
    Iterate on the list *fs*, yielding finished futures one by one in
    reverse order.
    Before yielding a future, *waiter* is removed from its waiters
    and the future is removed from each set in the collection of sets
    *ref_collect*.

    The aim of this function is to avoid keeping stale references after
    the future is yielded and before the iterator resumes.
    ���N)�remover<rJ�pop)rKrM�ref_collectrFZfutures_setrrr�_yield_finished_futures�srSc	csB|dk	r|t��}t|�}t|�}t|��*tdd�|D��}||}t|t�}W5QRXt|�}z�t|||fd�EdH|�r|dkr�d}n(|t��}|dkr�tdt|�|f��|j
�|�|j�|j}g|_|j
��W5QRX|��t||||fd�EdHq|W5|D]$}|j�|j	�
|�W5QRX�qXdS)anAn iterator over the given futures that yields each as it completes.

    Args:
        fs: The sequence of Futures (possibly created by different Executors) to
            iterate over.
        timeout: The maximum number of seconds to wait. If None, then there
            is no limit on the wait time.

    Returns:
        An iterator that yields the given Futures as they complete (finished or
        cancelled). If any given Futures are duplicated, they will be returned
        once.

    Raises:
        TimeoutError: If the entire result iterator could not be generated
            before the given timeout.
    Ncss |]}|jttfkr|VqdSrrBrDrrrrG�s�zas_completed.<locals>.<genexpr>)rRrz%d (of %d) futures unfinished)�time�	monotonicr/�lenr7rNr�listr<rJrPrSrr�waitr,r�clear�reverse)	rK�timeout�end_timeZ
total_futuresrrrMrFZwait_timeoutrrr�as_completed�sL
�����r]�DoneAndNotDoneFuturesz
done not_donec
Cs
t|���tdd�|D��}t|�|}|tkrJ|rJt||�W5QR�S|tkr~|r~tdd�|D��r~t||�W5QR�St|�t|�kr�t||�W5QR�St||�}W5QRX|j�	|�|D]"}|j
�|j�|�W5QRXq�|�
|j�t|t|�|�S)aWait for the futures in the given sequence to complete.

    Args:
        fs: The sequence of Futures (possibly created by different Executors) to
            wait upon.
        timeout: The maximum number of seconds to wait. If None, then there
            is no limit on the wait time.
        return_when: Indicates when this function should return. The options
            are:

            FIRST_COMPLETED - Return when any future finishes or is
                              cancelled.
            FIRST_EXCEPTION - Return when any future finishes by raising an
                              exception. If no future raises an exception
                              then it is equivalent to ALL_COMPLETED.
            ALL_COMPLETED -   Return when all futures finish or are cancelled.

    Returns:
        A named 2-tuple of sets. The first set, named 'done', contains the
        futures that completed (is finished or cancelled) before the wait
        completed. The second set, named 'not_done', contains uncompleted
        futures.
    css |]}|jttfkr|VqdSrrBrDrrrrG!s�zwait.<locals>.<genexpr>css&|]}|��s|��dk	r|VqdSr)r
�	exceptionrDrrrrG(s�)r7r/rr^r�anyrVrNrrXr<rJrP�updater)rKr[rL�doneZnot_donerMrFrrrrXs"
rXc@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zddd�Z
d dd�Zdd�Zdd�Zdd�ZdS)!�Futurez5Represents the result of an asynchronous computation.cCs,t��|_t|_d|_d|_g|_g|_dS)z8Initializes the future. Should not be called by clients.N)	rZ	Conditionr<rrC�_result�
_exceptionrJ�_done_callbacksrrrrr!<s
zFuture.__init__c	Cs>|jD]2}z||�Wqtk
r6t�d|�YqXqdS)N�!exception calling callback for %r)rf�	Exception�LOGGERr_)r �callbackrrr�_invoke_callbacksEs

zFuture._invoke_callbacksc
Cs�|j��|jtkrx|jrHd|jjt|�t|j|jjjfW5QR�Sd|jjt|�t|j|jjjfW5QR�Sd|jjt|�t|jfW5QR�SQRXdS)Nz<%s at %#x state=%s raised %s>z <%s at %#x state=%s returned %s>z<%s at %#x state=%s>)	r<rCr
rer.rr:�_STATE_TO_DESCRIPTION_MAPrdrrrr�__repr__Ls(
���zFuture.__repr__c	Csf|j�N|jttfkr$W5QR�dS|jttfkr@W5QR�dSt|_|j��W5QRX|��dS)z�Cancel the future if possible.

        Returns True if the future was cancelled, False otherwise. A future
        cannot be cancelled if it is running or has already completed.
        FT)r<rCrr
rr	�
notify_allrkrrrr�cancel`sz
Future.cancelc
Cs,|j�|jttfkW5QR�SQRXdS)z(Return True if the future was cancelled.N)r<rCrr	rrrrr
sszFuture.cancelledc
Cs(|j�|jtkW5QR�SQRXdS)z1Return True if the future is currently executing.N)r<rCrrrrrrxszFuture.runningc
Cs.|j�|jtttfkW5QR�SQRXdS)z>Return True of the future was cancelled or finished executing.N)r<rCrr	r
rrrrrb}szFuture.donecCs$|jrz
|j�W5d}Xn|jSdSr)rerdrrrrZ__get_result�s

zFuture.__get_resultc	Csn|j�0|jtttfkr2|j�|�W5QR�dSW5QRXz||�Wn tk
rht�	d|�YnXdS)a%Attaches a callable that will be called when the future finishes.

        Args:
            fn: A callable that will be called with this future as its only
                argument when the future completes or is cancelled. The callable
                will always be called by a thread in the same process in which
                it was added. If the future has already completed or been
                cancelled then the callable will be called immediately. These
                callables are called in the order that they were added.
        Nrg)
r<rCrr	r
rfr#rhrir_)r �fnrrr�add_done_callback�szFuture.add_done_callbackNc
Cs�z�|j��|jttfkr t��n"|jtkrB|��W5QR�W�ZS|j�|�|jttfkrdt��n(|jtkr�|��W5QR�W�St��W5QRXW5d}XdS)aBReturn the result of the call that the future represents.

        Args:
            timeout: The number of seconds to wait for the result if the future
                isn't done. If None, then there is no limit on the wait time.

        Returns:
            The result of the call that the future represents.

        Raises:
            CancelledError: If the future was cancelled.
            TimeoutError: If the future didn't finish executing before the given
                timeout.
            Exception: If the call raised then that exception will be raised.
        N)	r<rCrr	rr
�_Future__get_resultrXr�r r[rrr�result�s

z
Future.resultc
Cs�|j�||jttfkrt��n|jtkr:|jW5QR�S|j�|�|jttfkr\t��n"|jtkrx|jW5QR�St��W5QRXdS)aUReturn the exception raised by the call that the future represents.

        Args:
            timeout: The number of seconds to wait for the exception if the
                future isn't done. If None, then there is no limit on the wait
                time.

        Returns:
            The exception raised by the call that the future represents or None
            if the call completed without raising.

        Raises:
            CancelledError: If the future was cancelled.
            TimeoutError: If the future didn't finish executing before the given
                timeout.
        N)	r<rCrr	rr
rerXrrsrrrr_�s

zFuture.exceptionc	Cs�|j�t|jtkr<t|_|jD]}|�|�qW5QR�dS|jtkrZt|_W5QR�dSt�	dt
|�|j�td��W5QRXdS)a�Mark the future as running or process any cancel notifications.

        Should only be used by Executor implementations and unit tests.

        If the future has been cancelled (cancel() was called and returned
        True) then any threads waiting on the future completing (though calls
        to as_completed() or wait()) are notified and False is returned.

        If the future was not cancelled then it is put in the running state
        (future calls to running() will return True) and True is returned.

        This method should be called by Executor implementations before
        executing the work associated with this future. If this method returns
        False then the work should not be executed.

        Returns:
            False if the Future was cancelled, True otherwise.

        Raises:
            RuntimeError: if this method was already called or if set_result()
                or set_exception() was called.
        FTz!Future %s in unexpected state: %szFuture in unexpected stateN)r<rCrr	rJr(rrriZcriticalr:�RuntimeError)r rMrrr�set_running_or_notify_cancel�s


�z#Future.set_running_or_notify_cancelc	Csl|j�T|jttthkr*td�|j|���||_t|_|jD]}|�	|�q<|j�
�W5QRX|��dS)z�Sets the return value of work associated with the future.

        Should only be used by Executor implementations and unit tests.
        �{}: {!r}N)r<rCrr	r
r�formatrdrJr&rnrk)r rtrMrrr�
set_result
s
zFuture.set_resultc	Csl|j�T|jttthkr*td�|j|���||_t|_|jD]}|�	|�q<|j�
�W5QRX|��dS)z�Sets the result of the future as being the given exception.

        Should only be used by Executor implementations and unit tests.
        rwN)r<rCrr	r
rrxrerJr'rnrk)r r_rMrrr�
set_exceptions
zFuture.set_exception)N)N)rrrrr!rkrmror
rrbrrrqrtr_rvryrzrrrrrc9s	

#
"(rcc@sHeZdZdZdd�Zde_ddd�dd	�Zddd�Zd
d�Zdd�Z	dS)�ExecutorzCThis is an abstract base class for concrete asynchronous executors.cOs\t|�dkrnD|std��n6d|kr>ddl}|jdtdd�ntdt|�d	��t��dS)
a Submits a callable to be executed with the given arguments.

        Schedules the callable to be executed as fn(*args, **kwargs) and returns
        a Future instance representing the execution of the callable.

        Returns:
            A Future representing the given call.
        �z:descriptor 'submit' of 'Executor' object needs an argumentrprNz.Passing 'fn' as keyword argument is deprecated)�
stacklevelz6submit expected at least 1 positional argument, got %dr5)rV�	TypeError�warnings�warn�DeprecationWarning�NotImplementedError)r@�kwargsrrrr�submit.s	
�
�zExecutor.submitz($self, fn, /, *args, **kwargs)Nr5)r[�	chunksizecsB�dk	r�t�����fdd�t|�D�����fdd�}|�S)a}Returns an iterator equivalent to map(fn, iter).

        Args:
            fn: A callable that will take as many arguments as there are
                passed iterables.
            timeout: The maximum number of seconds to wait. If None, then there
                is no limit on the wait time.
            chunksize: The size of the chunks the iterable will be broken into
                before being passed to a child process. This argument is only
                used by ProcessPoolExecutor; it is ignored by
                ThreadPoolExecutor.

        Returns:
            An iterator equivalent to: map(func, *iterables) but the calls may
            be evaluated out-of-order.

        Raises:
            TimeoutError: If the entire result iterator could not be generated
                before the given timeout.
            Exception: If fn(*args) raises for any values.
        Ncsg|]}�j�f|���qSr)r�)rEr@)rpr rr�
<listcomp>`sz Executor.map.<locals>.<listcomp>c	3s\zB����r@�dkr&�����Vq
�����t���Vq
W5�D]}|��qHXdSr)rorZrQrtrTrU)r%)r\rKr[rr�result_iteratordsz%Executor.map.<locals>.result_iterator)rTrU�zip)r rpr[r��	iterablesr�r)r\rprKr r[r�mapGs

zExecutor.mapTcCsdS)a�Clean-up the resources associated with the Executor.

        It is safe to call this method several times. Otherwise, no other
        methods can be called after this one.

        Args:
            wait: If True then shutdown will not return until all running
                futures have finished executing and the resources used by the
                executor have been reclaimed.
        Nr)r rXrrr�shutdownsszExecutor.shutdowncCs|Srrrrrrr>�szExecutor.__enter__cCs|jdd�dS)NT)rXF)r�)r �exc_typeZexc_valZexc_tbrrrrA�szExecutor.__exit__)T)
rrrrr��__text_signature__r�r�r>rArrrrr{+s,

r{c@seZdZdZdS)�BrokenExecutorzR
    Raised when a executor has become non-functional after a severe failure.
    Nrrrrrr��sr�)N)'�
__author__�collectionsZloggingrrTrrrrrrrr	r
Z_FUTURE_STATESrlZ	getLoggerrirhrrrr�objectrr)r1r2r7rNrSr]�
namedtupler^rXrcr{rur�rrrr�<module>sh�	�	

>�1s]concurrent/futures/__pycache__/thread.cpython-38.pyc000064400000013274151153537470016554 0ustar00U

e5d@"�@s�dZdZddlZddlmZddlZddlZddlZddlZddl	Z	e�
�Zdadd�Z
e�e
�Gdd	�d	e�Zd
d�ZGdd
�d
ej�ZGdd�dej�ZdS)zImplements ThreadPoolExecutor.z"Brian Quinlan (brian@sweetapp.com)�N)�_baseFcCsBdatt���}|D]\}}|�d�q|D]\}}|��q,dS�NT)�	_shutdown�list�_threads_queues�items�put�join)r�t�q�r�1/usr/lib64/python3.8/concurrent/futures/thread.py�_python_exit!src@seZdZdd�Zdd�ZdS)�	_WorkItemcCs||_||_||_||_dS�N)�future�fn�args�kwargs)�selfrrrrrrr
�__init__.sz_WorkItem.__init__c
Csf|j��sdSz|j|j|j�}Wn2tk
rT}z|j�|�d}W5d}~XYnX|j�|�dSr)rZset_running_or_notify_cancelrrr�
BaseException�
set_exceptionZ
set_result)r�result�excrrr
�run4s
z
_WorkItem.runN)�__name__�
__module__�__qualname__rrrrrr
r-srcCs�|dk	rRz||�Wn<tk
rPtjjddd�|�}|dk	rJ|��YdSXzx|jdd�}|dk	r�|��~|�}|dk	r�|j��~qT|�}t	s�|dks�|j	r�|dk	r�d|_	|�
d�WdS~qTWn$tk
r�tjjddd�YnXdS)NzException in initializer:T)�exc_info)�blockzException in worker)rrZLOGGERZcritical�_initializer_failed�getr�_idle_semaphore�releaserr)Zexecutor_referenceZ
work_queue�initializer�initargsZexecutor�	work_itemrrr
�_workerBs8

r(c@seZdZdZdS)�BrokenThreadPoolzR
    Raised when a worker thread in a ThreadPoolExecutor failed initializing.
    N)rrr�__doc__rrrr
r)msr)c@sfeZdZe��jZddd�Zdd�Ze	j
jje_e	j
jje_dd	�Z
d
d�Zdd
d�Ze	j
jje_dS)�ThreadPoolExecutorN�rcCs�|dkrtdt��pdd�}|dkr.td��|dk	rFt|�sFtd��||_t��|_	t
�d�|_t
�|_d|_d|_t
��|_|p�d	|��|_||_||_dS)
a�Initializes a new ThreadPoolExecutor instance.

        Args:
            max_workers: The maximum number of threads that can be used to
                execute the given calls.
            thread_name_prefix: An optional name prefix to give our threads.
            initializer: A callable used to initialize worker threads.
            initargs: A tuple of arguments to pass to the initializer.
        N� ��rz"max_workers must be greater than 0zinitializer must be a callableFzThreadPoolExecutor-%d)�min�os�	cpu_count�
ValueError�callable�	TypeError�_max_workers�queueZSimpleQueue�_work_queue�	threadingZ	Semaphorer#�set�_threads�_brokenrZLock�_shutdown_lock�_counter�_thread_name_prefix�_initializer�	_initargs)rZmax_workersZthread_name_prefixr%r&rrr
rxs$


�zThreadPoolExecutor.__init__c
Os�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��|j�f|jr�t|j��|j	r�t
d	��t	r�t
d
��t��}t
||||�}|j�|�|��|W5QR�SQRXdS)N�zDdescriptor 'submit' of 'ThreadPoolExecutor' object needs an argumentrrz.Passing 'fn' as keyword argument is deprecated)�
stacklevelz6submit expected at least 1 positional argument, got %dr.z*cannot schedule new futures after shutdownz6cannot schedule new futures after interpreter shutdown)�lenr5�pop�warnings�warn�DeprecationWarningr=r<r)r�RuntimeErrorrZFuturerr8r�_adjust_thread_count)rrrrrF�f�wrrr
�submit�s6

�
�
zThreadPoolExecutor.submitcCs�|jjdd�rdS|jfdd�}t|j�}||jkr�d|jp>||f}tj|t	t
�||�|j|j|j
fd�}d|_|��|j�|�|jt|<dS)Nr)ZtimeoutcSs|�d�dSr)r)�_rrrr
�
weakref_cb�sz;ThreadPoolExecutor._adjust_thread_count.<locals>.weakref_cbz%s_%d)�name�targetrT)r#�acquirer8rDr;r6r?r9ZThreadr(�weakref�refr@rAZdaemon�start�addr)rrOZnum_threadsZthread_namer
rrr
rJ�s&


�
��z'ThreadPoolExecutor._adjust_thread_countc	Csb|j�Rd|_z|j��}Wntjk
r6YqTYnX|dk	r|j�t|j��qW5QRXdS)NzBA thread initializer failed, the thread pool is not usable anymore)	r=r<r8Z
get_nowaitr7ZEmptyrrr))rr'rrr
r!�s
z&ThreadPoolExecutor._initializer_failedTc	Cs@|j�d|_|j�d�W5QRX|r<|jD]}|��q.dSr)r=rr8rr;r	)r�waitr
rrr
�shutdown�s
zThreadPoolExecutor.shutdown)Nr,Nr)T)rrr�	itertools�count�__next__r>rrMr�Executor�__text_signature__r*rJr!rXrrrr
r+ss
�
& 
r+)r*�
__author__�atexitZconcurrent.futuresrrYr7r9rSr1�WeakKeyDictionaryrrr�register�objectrr(ZBrokenExecutorr)r\r+rrrr
�<module>s 	
+concurrent/futures/__pycache__/__init__.cpython-38.opt-2.pyc000064400000002012151153537470017770 0ustar00U

e5d�@sPdZddlmZmZmZmZmZmZmZm	Z	m
Z
mZmZdZ
dd�Zdd�ZdS)	z"Brian Quinlan (brian@sweetapp.com)�)�FIRST_COMPLETED�FIRST_EXCEPTION�
ALL_COMPLETED�CancelledError�TimeoutError�InvalidStateError�BrokenExecutor�Future�Executor�wait�as_completed)rrrrrrr	r
rr�ProcessPoolExecutor�ThreadPoolExecutorcCstdS)N)�
__author__�__doc__)�__all__�rr�3/usr/lib64/python3.8/concurrent/futures/__init__.py�__dir__$srcCsP|dkrddlm}|a|S|dkr8ddlm}|a|Stdt�d|����dS)Nr
�)r
r)rzmodule z has no attribute )Zprocessr
�threadr�AttributeError�__name__)�nameZpeZterrr�__getattr__(srN)rZconcurrent.futures._baserrrrrrrr	r
rrrrrrrrr�<module>s4concurrent/futures/__pycache__/_base.cpython-38.opt-1.pyc000064400000052666151153537470017325 0ustar00U

e5dY�
@spdZddlZddlZddlZddlZdZdZdZdZdZ	dZ
d	Zd
ZdZ
e	e
eee
gZe	de
d
edede
diZe�d�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd �d e�ZGd!d"�d"e�Zd#d$�Zd%d&�Zd3d'd(�Ze� d)d*�Z!defd+d,�Z"Gd-d.�d.e�Z#Gd/d0�d0e�Z$Gd1d2�d2e%�Z&dS)4z"Brian Quinlan (brian@sweetapp.com)�N�FIRST_COMPLETED�FIRST_EXCEPTION�
ALL_COMPLETED�
_AS_COMPLETED�PENDING�RUNNING�	CANCELLED�CANCELLED_AND_NOTIFIED�FINISHED�pending�running�	cancelled�finishedzconcurrent.futuresc@seZdZdZdS)�Errorz-Base class for all future-related exceptions.N��__name__�
__module__�__qualname__�__doc__�rr�0/usr/lib64/python3.8/concurrent/futures/_base.pyr,src@seZdZdZdS)�CancelledErrorzThe Future was cancelled.Nrrrrrr0src@seZdZdZdS)�TimeoutErrorz*The operation exceeded the given deadline.Nrrrrrr4src@seZdZdZdS)�InvalidStateErrorz+The operation is not allowed in this state.Nrrrrrr8src@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�_Waiterz;Provides the event that wait() and as_completed() block on.cCst��|_g|_dS�N)�	threadingZEvent�event�finished_futures��selfrrr�__init__>s
z_Waiter.__init__cCs|j�|�dSr�r�append�r �futurerrr�
add_resultBsz_Waiter.add_resultcCs|j�|�dSrr"r$rrr�
add_exceptionEsz_Waiter.add_exceptioncCs|j�|�dSrr"r$rrr�
add_cancelledHsz_Waiter.add_cancelledN)rrrrr!r&r'r(rrrrr<s
rcsDeZdZdZ�fdd�Z�fdd�Z�fdd�Z�fdd	�Z�ZS)
�_AsCompletedWaiterzUsed by as_completed().cstt|���t��|_dSr)�superr)r!r�Lock�lockr��	__class__rrr!Nsz_AsCompletedWaiter.__init__c	s0|j� tt|��|�|j��W5QRXdSr)r,r*r)r&r�setr$r-rrr&Rsz_AsCompletedWaiter.add_resultc	s0|j� tt|��|�|j��W5QRXdSr)r,r*r)r'rr/r$r-rrr'Wsz _AsCompletedWaiter.add_exceptionc	s0|j� tt|��|�|j��W5QRXdSr)r,r*r)r(rr/r$r-rrr(\sz _AsCompletedWaiter.add_cancelled)	rrrrr!r&r'r(�
__classcell__rrr-rr)Ks
r)cs8eZdZdZ�fdd�Z�fdd�Z�fdd�Z�ZS)�_FirstCompletedWaiterz*Used by wait(return_when=FIRST_COMPLETED).cst��|�|j��dSr)r*r&rr/r$r-rrr&dsz _FirstCompletedWaiter.add_resultcst��|�|j��dSr)r*r'rr/r$r-rrr'hsz#_FirstCompletedWaiter.add_exceptioncst��|�|j��dSr)r*r(rr/r$r-rrr(lsz#_FirstCompletedWaiter.add_cancelled)rrrrr&r'r(r0rrr-rr1asr1csLeZdZdZ�fdd�Zdd�Z�fdd�Z�fdd	�Z�fd
d�Z�Z	S)�_AllCompletedWaiterz<Used by wait(return_when=FIRST_EXCEPTION and ALL_COMPLETED).cs$||_||_t��|_t���dSr)�num_pending_calls�stop_on_exceptionrr+r,r*r!)r r3r4r-rrr!ss
z_AllCompletedWaiter.__init__c	Cs4|j�$|jd8_|js&|j��W5QRXdS)N�)r,r3rr/rrrr�_decrement_pending_callsysz,_AllCompletedWaiter._decrement_pending_callscst��|�|��dSr)r*r&r6r$r-rrr&sz_AllCompletedWaiter.add_resultcs*t��|�|jr|j��n|��dSr)r*r'r4rr/r6r$r-rrr'�sz!_AllCompletedWaiter.add_exceptioncst��|�|��dSr)r*r(r6r$r-rrr(�sz!_AllCompletedWaiter.add_cancelled)
rrrrr!r6r&r'r(r0rrr-rr2psr2c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_AcquireFutureszDA context manager that does an ordered acquire of Future conditions.cCst|td�|_dS)N)�key)�sorted�id�futures)r r;rrrr!�sz_AcquireFutures.__init__cCs|jD]}|j��qdSr)r;�
_condition�acquirer$rrr�	__enter__�s
z_AcquireFutures.__enter__cGs|jD]}|j��qdSr)r;r<�release)r �argsr%rrr�__exit__�s
z_AcquireFutures.__exit__N)rrrrr!r>rArrrrr7�sr7cCs�|tkrt�}nZ|tkr t�}nJtdd�|D��}|tkrHt|dd�}n"|tkr^t|dd�}ntd|��|D]}|j	�
|�qn|S)Ncss|]}|jttfkVqdSr��_stater	r
��.0�frrr�	<genexpr>�sz._create_and_install_waiters.<locals>.<genexpr>T)r4FzInvalid return condition: %r)rr)rr1�sumrr2r�
ValueError�_waitersr#)�fs�return_when�waiterZ
pending_countrFrrr�_create_and_install_waiters�s�rNc	csP|rL|d}|D]}|�|�q|j�|j�|�W5QRX~|��VqdS)a~
    Iterate on the list *fs*, yielding finished futures one by one in
    reverse order.
    Before yielding a future, *waiter* is removed from its waiters
    and the future is removed from each set in the collection of sets
    *ref_collect*.

    The aim of this function is to avoid keeping stale references after
    the future is yielded and before the iterator resumes.
    ���N)�remover<rJ�pop)rKrM�ref_collectrFZfutures_setrrr�_yield_finished_futures�srSc	csB|dk	r|t��}t|�}t|�}t|��*tdd�|D��}||}t|t�}W5QRXt|�}z�t|||fd�EdH|�r|dkr�d}n(|t��}|dkr�tdt|�|f��|j
�|�|j�|j}g|_|j
��W5QRX|��t||||fd�EdHq|W5|D]$}|j�|j	�
|�W5QRX�qXdS)anAn iterator over the given futures that yields each as it completes.

    Args:
        fs: The sequence of Futures (possibly created by different Executors) to
            iterate over.
        timeout: The maximum number of seconds to wait. If None, then there
            is no limit on the wait time.

    Returns:
        An iterator that yields the given Futures as they complete (finished or
        cancelled). If any given Futures are duplicated, they will be returned
        once.

    Raises:
        TimeoutError: If the entire result iterator could not be generated
            before the given timeout.
    Ncss |]}|jttfkr|VqdSrrBrDrrrrG�s�zas_completed.<locals>.<genexpr>)rRrz%d (of %d) futures unfinished)�time�	monotonicr/�lenr7rNr�listr<rJrPrSrr�waitr,r�clear�reverse)	rK�timeout�end_timeZ
total_futuresrrrMrFZwait_timeoutrrr�as_completed�sL
�����r]�DoneAndNotDoneFuturesz
done not_donec
Cs
t|���tdd�|D��}t|�|}|tkrJ|rJt||�W5QR�S|tkr~|r~tdd�|D��r~t||�W5QR�St|�t|�kr�t||�W5QR�St||�}W5QRX|j�	|�|D]"}|j
�|j�|�W5QRXq�|�
|j�t|t|�|�S)aWait for the futures in the given sequence to complete.

    Args:
        fs: The sequence of Futures (possibly created by different Executors) to
            wait upon.
        timeout: The maximum number of seconds to wait. If None, then there
            is no limit on the wait time.
        return_when: Indicates when this function should return. The options
            are:

            FIRST_COMPLETED - Return when any future finishes or is
                              cancelled.
            FIRST_EXCEPTION - Return when any future finishes by raising an
                              exception. If no future raises an exception
                              then it is equivalent to ALL_COMPLETED.
            ALL_COMPLETED -   Return when all futures finish or are cancelled.

    Returns:
        A named 2-tuple of sets. The first set, named 'done', contains the
        futures that completed (is finished or cancelled) before the wait
        completed. The second set, named 'not_done', contains uncompleted
        futures.
    css |]}|jttfkr|VqdSrrBrDrrrrG!s�zwait.<locals>.<genexpr>css&|]}|��s|��dk	r|VqdSr)r
�	exceptionrDrrrrG(s�)r7r/rr^r�anyrVrNrrXr<rJrP�updater)rKr[rL�doneZnot_donerMrFrrrrXs"
rXc@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zddd�Z
d dd�Zdd�Zdd�Zdd�ZdS)!�Futurez5Represents the result of an asynchronous computation.cCs,t��|_t|_d|_d|_g|_g|_dS)z8Initializes the future. Should not be called by clients.N)	rZ	Conditionr<rrC�_result�
_exceptionrJ�_done_callbacksrrrrr!<s
zFuture.__init__c	Cs>|jD]2}z||�Wqtk
r6t�d|�YqXqdS)N�!exception calling callback for %r)rf�	Exception�LOGGERr_)r �callbackrrr�_invoke_callbacksEs

zFuture._invoke_callbacksc
Cs�|j��|jtkrx|jrHd|jjt|�t|j|jjjfW5QR�Sd|jjt|�t|j|jjjfW5QR�Sd|jjt|�t|jfW5QR�SQRXdS)Nz<%s at %#x state=%s raised %s>z <%s at %#x state=%s returned %s>z<%s at %#x state=%s>)	r<rCr
rer.rr:�_STATE_TO_DESCRIPTION_MAPrdrrrr�__repr__Ls(
���zFuture.__repr__c	Csf|j�N|jttfkr$W5QR�dS|jttfkr@W5QR�dSt|_|j��W5QRX|��dS)z�Cancel the future if possible.

        Returns True if the future was cancelled, False otherwise. A future
        cannot be cancelled if it is running or has already completed.
        FT)r<rCrr
rr	�
notify_allrkrrrr�cancel`sz
Future.cancelc
Cs,|j�|jttfkW5QR�SQRXdS)z(Return True if the future was cancelled.N)r<rCrr	rrrrr
sszFuture.cancelledc
Cs(|j�|jtkW5QR�SQRXdS)z1Return True if the future is currently executing.N)r<rCrrrrrrxszFuture.runningc
Cs.|j�|jtttfkW5QR�SQRXdS)z>Return True of the future was cancelled or finished executing.N)r<rCrr	r
rrrrrb}szFuture.donecCs$|jrz
|j�W5d}Xn|jSdSr)rerdrrrrZ__get_result�s

zFuture.__get_resultc	Csn|j�0|jtttfkr2|j�|�W5QR�dSW5QRXz||�Wn tk
rht�	d|�YnXdS)a%Attaches a callable that will be called when the future finishes.

        Args:
            fn: A callable that will be called with this future as its only
                argument when the future completes or is cancelled. The callable
                will always be called by a thread in the same process in which
                it was added. If the future has already completed or been
                cancelled then the callable will be called immediately. These
                callables are called in the order that they were added.
        Nrg)
r<rCrr	r
rfr#rhrir_)r �fnrrr�add_done_callback�szFuture.add_done_callbackNc
Cs�z�|j��|jttfkr t��n"|jtkrB|��W5QR�W�ZS|j�|�|jttfkrdt��n(|jtkr�|��W5QR�W�St��W5QRXW5d}XdS)aBReturn the result of the call that the future represents.

        Args:
            timeout: The number of seconds to wait for the result if the future
                isn't done. If None, then there is no limit on the wait time.

        Returns:
            The result of the call that the future represents.

        Raises:
            CancelledError: If the future was cancelled.
            TimeoutError: If the future didn't finish executing before the given
                timeout.
            Exception: If the call raised then that exception will be raised.
        N)	r<rCrr	rr
�_Future__get_resultrXr�r r[rrr�result�s

z
Future.resultc
Cs�|j�||jttfkrt��n|jtkr:|jW5QR�S|j�|�|jttfkr\t��n"|jtkrx|jW5QR�St��W5QRXdS)aUReturn the exception raised by the call that the future represents.

        Args:
            timeout: The number of seconds to wait for the exception if the
                future isn't done. If None, then there is no limit on the wait
                time.

        Returns:
            The exception raised by the call that the future represents or None
            if the call completed without raising.

        Raises:
            CancelledError: If the future was cancelled.
            TimeoutError: If the future didn't finish executing before the given
                timeout.
        N)	r<rCrr	rr
rerXrrsrrrr_�s

zFuture.exceptionc	Cs�|j�t|jtkr<t|_|jD]}|�|�qW5QR�dS|jtkrZt|_W5QR�dSt�	dt
|�|j�td��W5QRXdS)a�Mark the future as running or process any cancel notifications.

        Should only be used by Executor implementations and unit tests.

        If the future has been cancelled (cancel() was called and returned
        True) then any threads waiting on the future completing (though calls
        to as_completed() or wait()) are notified and False is returned.

        If the future was not cancelled then it is put in the running state
        (future calls to running() will return True) and True is returned.

        This method should be called by Executor implementations before
        executing the work associated with this future. If this method returns
        False then the work should not be executed.

        Returns:
            False if the Future was cancelled, True otherwise.

        Raises:
            RuntimeError: if this method was already called or if set_result()
                or set_exception() was called.
        FTz!Future %s in unexpected state: %szFuture in unexpected stateN)r<rCrr	rJr(rrriZcriticalr:�RuntimeError)r rMrrr�set_running_or_notify_cancel�s


�z#Future.set_running_or_notify_cancelc	Csl|j�T|jttthkr*td�|j|���||_t|_|jD]}|�	|�q<|j�
�W5QRX|��dS)z�Sets the return value of work associated with the future.

        Should only be used by Executor implementations and unit tests.
        �{}: {!r}N)r<rCrr	r
r�formatrdrJr&rnrk)r rtrMrrr�
set_result
s
zFuture.set_resultc	Csl|j�T|jttthkr*td�|j|���||_t|_|jD]}|�	|�q<|j�
�W5QRX|��dS)z�Sets the result of the future as being the given exception.

        Should only be used by Executor implementations and unit tests.
        rwN)r<rCrr	r
rrxrerJr'rnrk)r r_rMrrr�
set_exceptions
zFuture.set_exception)N)N)rrrrr!rkrmror
rrbrrrqrtr_rvryrzrrrrrc9s	

#
"(rcc@sHeZdZdZdd�Zde_ddd�dd	�Zddd�Zd
d�Zdd�Z	dS)�ExecutorzCThis is an abstract base class for concrete asynchronous executors.cOs\t|�dkrnD|std��n6d|kr>ddl}|jdtdd�ntdt|�d	��t��dS)
a Submits a callable to be executed with the given arguments.

        Schedules the callable to be executed as fn(*args, **kwargs) and returns
        a Future instance representing the execution of the callable.

        Returns:
            A Future representing the given call.
        �z:descriptor 'submit' of 'Executor' object needs an argumentrprNz.Passing 'fn' as keyword argument is deprecated)�
stacklevelz6submit expected at least 1 positional argument, got %dr5)rV�	TypeError�warnings�warn�DeprecationWarning�NotImplementedError)r@�kwargsrrrr�submit.s	
�
�zExecutor.submitz($self, fn, /, *args, **kwargs)Nr5)r[�	chunksizecsB�dk	r�t�����fdd�t|�D�����fdd�}|�S)a}Returns an iterator equivalent to map(fn, iter).

        Args:
            fn: A callable that will take as many arguments as there are
                passed iterables.
            timeout: The maximum number of seconds to wait. If None, then there
                is no limit on the wait time.
            chunksize: The size of the chunks the iterable will be broken into
                before being passed to a child process. This argument is only
                used by ProcessPoolExecutor; it is ignored by
                ThreadPoolExecutor.

        Returns:
            An iterator equivalent to: map(func, *iterables) but the calls may
            be evaluated out-of-order.

        Raises:
            TimeoutError: If the entire result iterator could not be generated
                before the given timeout.
            Exception: If fn(*args) raises for any values.
        Ncsg|]}�j�f|���qSr)r�)rEr@)rpr rr�
<listcomp>`sz Executor.map.<locals>.<listcomp>c	3s\zB����r@�dkr&�����Vq
�����t���Vq
W5�D]}|��qHXdSr)rorZrQrtrTrU)r%)r\rKr[rr�result_iteratordsz%Executor.map.<locals>.result_iterator)rTrU�zip)r rpr[r��	iterablesr�r)r\rprKr r[r�mapGs

zExecutor.mapTcCsdS)a�Clean-up the resources associated with the Executor.

        It is safe to call this method several times. Otherwise, no other
        methods can be called after this one.

        Args:
            wait: If True then shutdown will not return until all running
                futures have finished executing and the resources used by the
                executor have been reclaimed.
        Nr)r rXrrr�shutdownsszExecutor.shutdowncCs|Srrrrrrr>�szExecutor.__enter__cCs|jdd�dS)NT)rXF)r�)r �exc_typeZexc_valZexc_tbrrrrA�szExecutor.__exit__)T)
rrrrr��__text_signature__r�r�r>rArrrrr{+s,

r{c@seZdZdZdS)�BrokenExecutorzR
    Raised when a executor has become non-functional after a severe failure.
    Nrrrrrr��sr�)N)'�
__author__�collectionsZloggingrrTrrrrrrrr	r
Z_FUTURE_STATESrlZ	getLoggerrirhrrrr�objectrr)r1r2r7rNrSr]�
namedtupler^rXrcr{rur�rrrr�<module>sh�	�	

>�1s]concurrent/futures/__pycache__/__init__.cpython-38.pyc000064400000002126151153537470017036 0ustar00U

e5d�@sTdZdZddlmZmZmZmZmZmZm	Z	m
Z
mZmZm
Z
dZdd�Zdd�Zd	S)
z?Execute computations asynchronously using threads or processes.z"Brian Quinlan (brian@sweetapp.com)�)�FIRST_COMPLETED�FIRST_EXCEPTION�
ALL_COMPLETED�CancelledError�TimeoutError�InvalidStateError�BrokenExecutor�Future�Executor�wait�as_completed)rrrrrrr	r
rr�ProcessPoolExecutor�ThreadPoolExecutorcCstdS)N)�
__author__�__doc__)�__all__�rr�3/usr/lib64/python3.8/concurrent/futures/__init__.py�__dir__$srcCsP|dkrddlm}|a|S|dkr8ddlm}|a|Stdt�d|����dS)Nr
�)r
r)rzmodule z has no attribute )Zprocessr
�threadr�AttributeError�__name__)�nameZpeZterrr�__getattr__(srN)rrZconcurrent.futures._baserrrrrrrr	r
rrrrrrrrr�<module>s
4concurrent/__pycache__/__init__.cpython-38.opt-1.pyc000064400000000206151153537470016275 0ustar00U

e5d&�@sdS)N�rrr�+/usr/lib64/python3.8/concurrent/__init__.py�<module>�concurrent/__pycache__/__init__.cpython-38.opt-2.pyc000064400000000206151153537470016276 0ustar00U

e5d&�@sdS)N�rrr�+/usr/lib64/python3.8/concurrent/__init__.py�<module>�concurrent/__pycache__/__init__.cpython-38.pyc000064400000000206151153537470015336 0ustar00U

e5d&�@sdS)N�rrr�+/usr/lib64/python3.8/concurrent/__init__.py�<module>�webbrowser.py000075500000057023151153537470007324 0ustar00#! /usr/bin/python3.8
"""Interfaces for launching and remotely controlling Web browsers."""
# Maintained by Georg Brandl.

import os
import shlex
import shutil
import sys
import subprocess
import threading

__all__ = ["Error", "open", "open_new", "open_new_tab", "get", "register"]

class Error(Exception):
    pass

_lock = threading.RLock()
_browsers = {}                  # Dictionary of available browser controllers
_tryorder = None                # Preference order of available browsers
_os_preferred_browser = None    # The preferred browser

def register(name, klass, instance=None, *, preferred=False):
    """Register a browser connector."""
    with _lock:
        if _tryorder is None:
            register_standard_browsers()
        _browsers[name.lower()] = [klass, instance]

        # Preferred browsers go to the front of the list.
        # Need to match to the default browser returned by xdg-settings, which
        # may be of the form e.g. "firefox.desktop".
        if preferred or (_os_preferred_browser and name in _os_preferred_browser):
            _tryorder.insert(0, name)
        else:
            _tryorder.append(name)

def get(using=None):
    """Return a browser launcher instance appropriate for the environment."""
    if _tryorder is None:
        with _lock:
            if _tryorder is None:
                register_standard_browsers()
    if using is not None:
        alternatives = [using]
    else:
        alternatives = _tryorder
    for browser in alternatives:
        if '%s' in browser:
            # User gave us a command line, split it into name and args
            browser = shlex.split(browser)
            if browser[-1] == '&':
                return BackgroundBrowser(browser[:-1])
            else:
                return GenericBrowser(browser)
        else:
            # User gave us a browser name or path.
            try:
                command = _browsers[browser.lower()]
            except KeyError:
                command = _synthesize(browser)
            if command[1] is not None:
                return command[1]
            elif command[0] is not None:
                return command[0]()
    raise Error("could not locate runnable browser")

# Please note: the following definition hides a builtin function.
# It is recommended one does "import webbrowser" and uses webbrowser.open(url)
# instead of "from webbrowser import *".

def open(url, new=0, autoraise=True):
    """Display url using the default browser.

    If possible, open url in a location determined by new.
    - 0: the same browser window (the default).
    - 1: a new browser window.
    - 2: a new browser page ("tab").
    If possible, autoraise raises the window (the default) or not.
    """
    if _tryorder is None:
        with _lock:
            if _tryorder is None:
                register_standard_browsers()
    for name in _tryorder:
        browser = get(name)
        if browser.open(url, new, autoraise):
            return True
    return False

def open_new(url):
    """Open url in a new window of the default browser.

    If not possible, then open url in the only browser window.
    """
    return open(url, 1)

def open_new_tab(url):
    """Open url in a new page ("tab") of the default browser.

    If not possible, then the behavior becomes equivalent to open_new().
    """
    return open(url, 2)


def _synthesize(browser, *, preferred=False):
    """Attempt to synthesize a controller based on existing controllers.

    This is useful to create a controller when a user specifies a path to
    an entry in the BROWSER environment variable -- we can copy a general
    controller to operate using a specific installation of the desired
    browser in this way.

    If we can't create a controller in this way, or if there is no
    executable for the requested browser, return [None, None].

    """
    cmd = browser.split()[0]
    if not shutil.which(cmd):
        return [None, None]
    name = os.path.basename(cmd)
    try:
        command = _browsers[name.lower()]
    except KeyError:
        return [None, None]
    # now attempt to clone to fit the new name:
    controller = command[1]
    if controller and name.lower() == controller.basename:
        import copy
        controller = copy.copy(controller)
        controller.name = browser
        controller.basename = os.path.basename(browser)
        register(browser, None, instance=controller, preferred=preferred)
        return [None, controller]
    return [None, None]


# General parent classes

class BaseBrowser(object):
    """Parent class for all browsers. Do not use directly."""

    args = ['%s']

    def __init__(self, name=""):
        self.name = name
        self.basename = name

    def open(self, url, new=0, autoraise=True):
        raise NotImplementedError

    def open_new(self, url):
        return self.open(url, 1)

    def open_new_tab(self, url):
        return self.open(url, 2)


class GenericBrowser(BaseBrowser):
    """Class for all browsers started with a command
       and without remote functionality."""

    def __init__(self, name):
        if isinstance(name, str):
            self.name = name
            self.args = ["%s"]
        else:
            # name should be a list with arguments
            self.name = name[0]
            self.args = name[1:]
        self.basename = os.path.basename(self.name)

    def open(self, url, new=0, autoraise=True):
        sys.audit("webbrowser.open", url)
        cmdline = [self.name] + [arg.replace("%s", url)
                                 for arg in self.args]
        try:
            if sys.platform[:3] == 'win':
                p = subprocess.Popen(cmdline)
            else:
                p = subprocess.Popen(cmdline, close_fds=True)
            return not p.wait()
        except OSError:
            return False


class BackgroundBrowser(GenericBrowser):
    """Class for all browsers which are to be started in the
       background."""

    def open(self, url, new=0, autoraise=True):
        cmdline = [self.name] + [arg.replace("%s", url)
                                 for arg in self.args]
        sys.audit("webbrowser.open", url)
        try:
            if sys.platform[:3] == 'win':
                p = subprocess.Popen(cmdline)
            else:
                p = subprocess.Popen(cmdline, close_fds=True,
                                     start_new_session=True)
            return (p.poll() is None)
        except OSError:
            return False


class UnixBrowser(BaseBrowser):
    """Parent class for all Unix browsers with remote functionality."""

    raise_opts = None
    background = False
    redirect_stdout = True
    # In remote_args, %s will be replaced with the requested URL.  %action will
    # be replaced depending on the value of 'new' passed to open.
    # remote_action is used for new=0 (open).  If newwin is not None, it is
    # used for new=1 (open_new).  If newtab is not None, it is used for
    # new=3 (open_new_tab).  After both substitutions are made, any empty
    # strings in the transformed remote_args list will be removed.
    remote_args = ['%action', '%s']
    remote_action = None
    remote_action_newwin = None
    remote_action_newtab = None

    def _invoke(self, args, remote, autoraise, url=None):
        raise_opt = []
        if remote and self.raise_opts:
            # use autoraise argument only for remote invocation
            autoraise = int(autoraise)
            opt = self.raise_opts[autoraise]
            if opt: raise_opt = [opt]

        cmdline = [self.name] + raise_opt + args

        if remote or self.background:
            inout = subprocess.DEVNULL
        else:
            # for TTY browsers, we need stdin/out
            inout = None
        p = subprocess.Popen(cmdline, close_fds=True, stdin=inout,
                             stdout=(self.redirect_stdout and inout or None),
                             stderr=inout, start_new_session=True)
        if remote:
            # wait at most five seconds. If the subprocess is not finished, the
            # remote invocation has (hopefully) started a new instance.
            try:
                rc = p.wait(5)
                # if remote call failed, open() will try direct invocation
                return not rc
            except subprocess.TimeoutExpired:
                return True
        elif self.background:
            if p.poll() is None:
                return True
            else:
                return False
        else:
            return not p.wait()

    def open(self, url, new=0, autoraise=True):
        sys.audit("webbrowser.open", url)
        if new == 0:
            action = self.remote_action
        elif new == 1:
            action = self.remote_action_newwin
        elif new == 2:
            if self.remote_action_newtab is None:
                action = self.remote_action_newwin
            else:
                action = self.remote_action_newtab
        else:
            raise Error("Bad 'new' parameter to open(); " +
                        "expected 0, 1, or 2, got %s" % new)

        args = [arg.replace("%s", url).replace("%action", action)
                for arg in self.remote_args]
        args = [arg for arg in args if arg]
        success = self._invoke(args, True, autoraise, url)
        if not success:
            # remote invocation failed, try straight way
            args = [arg.replace("%s", url) for arg in self.args]
            return self._invoke(args, False, False)
        else:
            return True


class Mozilla(UnixBrowser):
    """Launcher class for Mozilla browsers."""

    remote_args = ['%action', '%s']
    remote_action = ""
    remote_action_newwin = "-new-window"
    remote_action_newtab = "-new-tab"
    background = True


class Netscape(UnixBrowser):
    """Launcher class for Netscape browser."""

    raise_opts = ["-noraise", "-raise"]
    remote_args = ['-remote', 'openURL(%s%action)']
    remote_action = ""
    remote_action_newwin = ",new-window"
    remote_action_newtab = ",new-tab"
    background = True


class Galeon(UnixBrowser):
    """Launcher class for Galeon/Epiphany browsers."""

    raise_opts = ["-noraise", ""]
    remote_args = ['%action', '%s']
    remote_action = "-n"
    remote_action_newwin = "-w"
    background = True


class Chrome(UnixBrowser):
    "Launcher class for Google Chrome browser."

    remote_args = ['%action', '%s']
    remote_action = ""
    remote_action_newwin = "--new-window"
    remote_action_newtab = ""
    background = True

Chromium = Chrome


class Opera(UnixBrowser):
    "Launcher class for Opera browser."

    remote_args = ['%action', '%s']
    remote_action = ""
    remote_action_newwin = "--new-window"
    remote_action_newtab = ""
    background = True


class Elinks(UnixBrowser):
    "Launcher class for Elinks browsers."

    remote_args = ['-remote', 'openURL(%s%action)']
    remote_action = ""
    remote_action_newwin = ",new-window"
    remote_action_newtab = ",new-tab"
    background = False

    # elinks doesn't like its stdout to be redirected -
    # it uses redirected stdout as a signal to do -dump
    redirect_stdout = False


class Konqueror(BaseBrowser):
    """Controller for the KDE File Manager (kfm, or Konqueror).

    See the output of ``kfmclient --commands``
    for more information on the Konqueror remote-control interface.
    """

    def open(self, url, new=0, autoraise=True):
        sys.audit("webbrowser.open", url)
        # XXX Currently I know no way to prevent KFM from opening a new win.
        if new == 2:
            action = "newTab"
        else:
            action = "openURL"

        devnull = subprocess.DEVNULL

        try:
            p = subprocess.Popen(["kfmclient", action, url],
                                 close_fds=True, stdin=devnull,
                                 stdout=devnull, stderr=devnull)
        except OSError:
            # fall through to next variant
            pass
        else:
            p.wait()
            # kfmclient's return code unfortunately has no meaning as it seems
            return True

        try:
            p = subprocess.Popen(["konqueror", "--silent", url],
                                 close_fds=True, stdin=devnull,
                                 stdout=devnull, stderr=devnull,
                                 start_new_session=True)
        except OSError:
            # fall through to next variant
            pass
        else:
            if p.poll() is None:
                # Should be running now.
                return True

        try:
            p = subprocess.Popen(["kfm", "-d", url],
                                 close_fds=True, stdin=devnull,
                                 stdout=devnull, stderr=devnull,
                                 start_new_session=True)
        except OSError:
            return False
        else:
            return (p.poll() is None)


class Grail(BaseBrowser):
    # There should be a way to maintain a connection to Grail, but the
    # Grail remote control protocol doesn't really allow that at this
    # point.  It probably never will!
    def _find_grail_rc(self):
        import glob
        import pwd
        import socket
        import tempfile
        tempdir = os.path.join(tempfile.gettempdir(),
                               ".grail-unix")
        user = pwd.getpwuid(os.getuid())[0]
        filename = os.path.join(glob.escape(tempdir), glob.escape(user) + "-*")
        maybes = glob.glob(filename)
        if not maybes:
            return None
        s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
        for fn in maybes:
            # need to PING each one until we find one that's live
            try:
                s.connect(fn)
            except OSError:
                # no good; attempt to clean it out, but don't fail:
                try:
                    os.unlink(fn)
                except OSError:
                    pass
            else:
                return s

    def _remote(self, action):
        s = self._find_grail_rc()
        if not s:
            return 0
        s.send(action)
        s.close()
        return 1

    def open(self, url, new=0, autoraise=True):
        sys.audit("webbrowser.open", url)
        if new:
            ok = self._remote("LOADNEW " + url)
        else:
            ok = self._remote("LOAD " + url)
        return ok


#
# Platform support for Unix
#

# These are the right tests because all these Unix browsers require either
# a console terminal or an X display to run.

def register_X_browsers():

    # use xdg-open if around
    if shutil.which("xdg-open"):
        register("xdg-open", None, BackgroundBrowser("xdg-open"))

    # The default GNOME3 browser
    if "GNOME_DESKTOP_SESSION_ID" in os.environ and shutil.which("gvfs-open"):
        register("gvfs-open", None, BackgroundBrowser("gvfs-open"))

    # The default GNOME browser
    if "GNOME_DESKTOP_SESSION_ID" in os.environ and shutil.which("gnome-open"):
        register("gnome-open", None, BackgroundBrowser("gnome-open"))

    # The default KDE browser
    if "KDE_FULL_SESSION" in os.environ and shutil.which("kfmclient"):
        register("kfmclient", Konqueror, Konqueror("kfmclient"))

    if shutil.which("x-www-browser"):
        register("x-www-browser", None, BackgroundBrowser("x-www-browser"))

    # The Mozilla browsers
    for browser in ("firefox", "iceweasel", "iceape", "seamonkey"):
        if shutil.which(browser):
            register(browser, None, Mozilla(browser))

    # The Netscape and old Mozilla browsers
    for browser in ("mozilla-firefox",
                    "mozilla-firebird", "firebird",
                    "mozilla", "netscape"):
        if shutil.which(browser):
            register(browser, None, Netscape(browser))

    # Konqueror/kfm, the KDE browser.
    if shutil.which("kfm"):
        register("kfm", Konqueror, Konqueror("kfm"))
    elif shutil.which("konqueror"):
        register("konqueror", Konqueror, Konqueror("konqueror"))

    # Gnome's Galeon and Epiphany
    for browser in ("galeon", "epiphany"):
        if shutil.which(browser):
            register(browser, None, Galeon(browser))

    # Skipstone, another Gtk/Mozilla based browser
    if shutil.which("skipstone"):
        register("skipstone", None, BackgroundBrowser("skipstone"))

    # Google Chrome/Chromium browsers
    for browser in ("google-chrome", "chrome", "chromium", "chromium-browser"):
        if shutil.which(browser):
            register(browser, None, Chrome(browser))

    # Opera, quite popular
    if shutil.which("opera"):
        register("opera", None, Opera("opera"))

    # Next, Mosaic -- old but still in use.
    if shutil.which("mosaic"):
        register("mosaic", None, BackgroundBrowser("mosaic"))

    # Grail, the Python browser. Does anybody still use it?
    if shutil.which("grail"):
        register("grail", Grail, None)

def register_standard_browsers():
    global _tryorder
    _tryorder = []

    if sys.platform == 'darwin':
        register("MacOSX", None, MacOSXOSAScript('default'))
        register("chrome", None, MacOSXOSAScript('chrome'))
        register("firefox", None, MacOSXOSAScript('firefox'))
        register("safari", None, MacOSXOSAScript('safari'))
        # OS X can use below Unix support (but we prefer using the OS X
        # specific stuff)

    if sys.platform[:3] == "win":
        # First try to use the default Windows browser
        register("windows-default", WindowsDefault)

        # Detect some common Windows browsers, fallback to IE
        iexplore = os.path.join(os.environ.get("PROGRAMFILES", "C:\\Program Files"),
                                "Internet Explorer\\IEXPLORE.EXE")
        for browser in ("firefox", "firebird", "seamonkey", "mozilla",
                        "netscape", "opera", iexplore):
            if shutil.which(browser):
                register(browser, None, BackgroundBrowser(browser))
    else:
        # Prefer X browsers if present
        if os.environ.get("DISPLAY") or os.environ.get("WAYLAND_DISPLAY"):
            try:
                cmd = "xdg-settings get default-web-browser".split()
                raw_result = subprocess.check_output(cmd, stderr=subprocess.DEVNULL)
                result = raw_result.decode().strip()
            except (FileNotFoundError, subprocess.CalledProcessError, PermissionError, NotADirectoryError) :
                pass
            else:
                global _os_preferred_browser
                _os_preferred_browser = result

            register_X_browsers()

        # Also try console browsers
        if os.environ.get("TERM"):
            if shutil.which("www-browser"):
                register("www-browser", None, GenericBrowser("www-browser"))
            # The Links/elinks browsers <http://artax.karlin.mff.cuni.cz/~mikulas/links/>
            if shutil.which("links"):
                register("links", None, GenericBrowser("links"))
            if shutil.which("elinks"):
                register("elinks", None, Elinks("elinks"))
            # The Lynx browser <http://lynx.isc.org/>, <http://lynx.browser.org/>
            if shutil.which("lynx"):
                register("lynx", None, GenericBrowser("lynx"))
            # The w3m browser <http://w3m.sourceforge.net/>
            if shutil.which("w3m"):
                register("w3m", None, GenericBrowser("w3m"))

    # OK, now that we know what the default preference orders for each
    # platform are, allow user to override them with the BROWSER variable.
    if "BROWSER" in os.environ:
        userchoices = os.environ["BROWSER"].split(os.pathsep)
        userchoices.reverse()

        # Treat choices in same way as if passed into get() but do register
        # and prepend to _tryorder
        for cmdline in userchoices:
            if cmdline != '':
                cmd = _synthesize(cmdline, preferred=True)
                if cmd[1] is None:
                    register(cmdline, None, GenericBrowser(cmdline), preferred=True)

    # what to do if _tryorder is now empty?


#
# Platform support for Windows
#

if sys.platform[:3] == "win":
    class WindowsDefault(BaseBrowser):
        def open(self, url, new=0, autoraise=True):
            sys.audit("webbrowser.open", url)
            try:
                os.startfile(url)
            except OSError:
                # [Error 22] No application is associated with the specified
                # file for this operation: '<URL>'
                return False
            else:
                return True

#
# Platform support for MacOS
#

if sys.platform == 'darwin':
    # Adapted from patch submitted to SourceForge by Steven J. Burr
    class MacOSX(BaseBrowser):
        """Launcher class for Aqua browsers on Mac OS X

        Optionally specify a browser name on instantiation.  Note that this
        will not work for Aqua browsers if the user has moved the application
        package after installation.

        If no browser is specified, the default browser, as specified in the
        Internet System Preferences panel, will be used.
        """
        def __init__(self, name):
            self.name = name

        def open(self, url, new=0, autoraise=True):
            sys.audit("webbrowser.open", url)
            assert "'" not in url
            # hack for local urls
            if not ':' in url:
                url = 'file:'+url

            # new must be 0 or 1
            new = int(bool(new))
            if self.name == "default":
                # User called open, open_new or get without a browser parameter
                script = 'open location "%s"' % url.replace('"', '%22') # opens in default browser
            else:
                # User called get and chose a browser
                if self.name == "OmniWeb":
                    toWindow = ""
                else:
                    # Include toWindow parameter of OpenURL command for browsers
                    # that support it.  0 == new window; -1 == existing
                    toWindow = "toWindow %d" % (new - 1)
                cmd = 'OpenURL "%s"' % url.replace('"', '%22')
                script = '''tell application "%s"
                                activate
                                %s %s
                            end tell''' % (self.name, cmd, toWindow)
            # Open pipe to AppleScript through osascript command
            osapipe = os.popen("osascript", "w")
            if osapipe is None:
                return False
            # Write script to osascript's stdin
            osapipe.write(script)
            rc = osapipe.close()
            return not rc

    class MacOSXOSAScript(BaseBrowser):
        def __init__(self, name):
            self._name = name

        def open(self, url, new=0, autoraise=True):
            if self._name == 'default':
                script = 'open location "%s"' % url.replace('"', '%22') # opens in default browser
            else:
                script = '''
                   tell application "%s"
                       activate
                       open location "%s"
                   end
                   '''%(self._name, url.replace('"', '%22'))

            osapipe = os.popen("osascript", "w")
            if osapipe is None:
                return False

            osapipe.write(script)
            rc = osapipe.close()
            return not rc


def main():
    import getopt
    usage = """Usage: %s [-n | -t] url
    -n: open new window
    -t: open new tab""" % sys.argv[0]
    try:
        opts, args = getopt.getopt(sys.argv[1:], 'ntd')
    except getopt.error as msg:
        print(msg, file=sys.stderr)
        print(usage, file=sys.stderr)
        sys.exit(1)
    new_win = 0
    for o, a in opts:
        if o == '-n': new_win = 1
        elif o == '-t': new_win = 2
    if len(args) != 1:
        print(usage, file=sys.stderr)
        sys.exit(1)

    url = args[0]
    open(url, new_win)

    print("\a")

if __name__ == "__main__":
    main()
posixpath.py000064400000036413151153537470007157 0ustar00"""Common operations on Posix pathnames.

Instead of importing this module directly, import os and refer to
this module as os.path.  The "os.path" name is an alias for this
module on Posix systems; on other systems (e.g. Windows),
os.path provides the same operations in a manner specific to that
platform, and is an alias to another module (e.g. ntpath).

Some of this can actually be useful on non-Posix systems too, e.g.
for manipulation of the pathname component of URLs.
"""

# Strings representing various path-related bits and pieces.
# These are primarily for export; internally, they are hardcoded.
# Should be set before imports for resolving cyclic dependency.
curdir = '.'
pardir = '..'
extsep = '.'
sep = '/'
pathsep = ':'
defpath = '/bin:/usr/bin'
altsep = None
devnull = '/dev/null'

import os
import sys
import stat
import genericpath
from genericpath import *

__all__ = ["normcase","isabs","join","splitdrive","split","splitext",
           "basename","dirname","commonprefix","getsize","getmtime",
           "getatime","getctime","islink","exists","lexists","isdir","isfile",
           "ismount", "expanduser","expandvars","normpath","abspath",
           "samefile","sameopenfile","samestat",
           "curdir","pardir","sep","pathsep","defpath","altsep","extsep",
           "devnull","realpath","supports_unicode_filenames","relpath",
           "commonpath"]


def _get_sep(path):
    if isinstance(path, bytes):
        return b'/'
    else:
        return '/'

# Normalize the case of a pathname.  Trivial in Posix, string.lower on Mac.
# On MS-DOS this may also turn slashes into backslashes; however, other
# normalizations (such as optimizing '../' away) are not allowed
# (another function should be defined to do that).

def normcase(s):
    """Normalize case of pathname.  Has no effect under Posix"""
    return os.fspath(s)


# Return whether a path is absolute.
# Trivial in Posix, harder on the Mac or MS-DOS.

def isabs(s):
    """Test whether a path is absolute"""
    s = os.fspath(s)
    sep = _get_sep(s)
    return s.startswith(sep)


# Join pathnames.
# Ignore the previous parts if a part is absolute.
# Insert a '/' unless the first part is empty or already ends in '/'.

def join(a, *p):
    """Join two or more pathname components, inserting '/' as needed.
    If any component is an absolute path, all previous path components
    will be discarded.  An empty last part will result in a path that
    ends with a separator."""
    a = os.fspath(a)
    sep = _get_sep(a)
    path = a
    try:
        if not p:
            path[:0] + sep  #23780: Ensure compatible data type even if p is null.
        for b in map(os.fspath, p):
            if b.startswith(sep):
                path = b
            elif not path or path.endswith(sep):
                path += b
            else:
                path += sep + b
    except (TypeError, AttributeError, BytesWarning):
        genericpath._check_arg_types('join', a, *p)
        raise
    return path


# Split a path in head (everything up to the last '/') and tail (the
# rest).  If the path ends in '/', tail will be empty.  If there is no
# '/' in the path, head  will be empty.
# Trailing '/'es are stripped from head unless it is the root.

def split(p):
    """Split a pathname.  Returns tuple "(head, tail)" where "tail" is
    everything after the final slash.  Either part may be empty."""
    p = os.fspath(p)
    sep = _get_sep(p)
    i = p.rfind(sep) + 1
    head, tail = p[:i], p[i:]
    if head and head != sep*len(head):
        head = head.rstrip(sep)
    return head, tail


# Split a path in root and extension.
# The extension is everything starting at the last dot in the last
# pathname component; the root is everything before that.
# It is always true that root + ext == p.

def splitext(p):
    p = os.fspath(p)
    if isinstance(p, bytes):
        sep = b'/'
        extsep = b'.'
    else:
        sep = '/'
        extsep = '.'
    return genericpath._splitext(p, sep, None, extsep)
splitext.__doc__ = genericpath._splitext.__doc__

# Split a pathname into a drive specification and the rest of the
# path.  Useful on DOS/Windows/NT; on Unix, the drive is always empty.

def splitdrive(p):
    """Split a pathname into drive and path. On Posix, drive is always
    empty."""
    p = os.fspath(p)
    return p[:0], p


# Return the tail (basename) part of a path, same as split(path)[1].

def basename(p):
    """Returns the final component of a pathname"""
    p = os.fspath(p)
    sep = _get_sep(p)
    i = p.rfind(sep) + 1
    return p[i:]


# Return the head (dirname) part of a path, same as split(path)[0].

def dirname(p):
    """Returns the directory component of a pathname"""
    p = os.fspath(p)
    sep = _get_sep(p)
    i = p.rfind(sep) + 1
    head = p[:i]
    if head and head != sep*len(head):
        head = head.rstrip(sep)
    return head


# Is a path a symbolic link?
# This will always return false on systems where os.lstat doesn't exist.

def islink(path):
    """Test whether a path is a symbolic link"""
    try:
        st = os.lstat(path)
    except (OSError, ValueError, AttributeError):
        return False
    return stat.S_ISLNK(st.st_mode)

# Being true for dangling symbolic links is also useful.

def lexists(path):
    """Test whether a path exists.  Returns True for broken symbolic links"""
    try:
        os.lstat(path)
    except (OSError, ValueError):
        return False
    return True


# Is a path a mount point?
# (Does this work for all UNIXes?  Is it even guaranteed to work by Posix?)

def ismount(path):
    """Test whether a path is a mount point"""
    try:
        s1 = os.lstat(path)
    except (OSError, ValueError):
        # It doesn't exist -- so not a mount point. :-)
        return False
    else:
        # A symlink can never be a mount point
        if stat.S_ISLNK(s1.st_mode):
            return False

    if isinstance(path, bytes):
        parent = join(path, b'..')
    else:
        parent = join(path, '..')
    parent = realpath(parent)
    try:
        s2 = os.lstat(parent)
    except (OSError, ValueError):
        return False

    dev1 = s1.st_dev
    dev2 = s2.st_dev
    if dev1 != dev2:
        return True     # path/.. on a different device as path
    ino1 = s1.st_ino
    ino2 = s2.st_ino
    if ino1 == ino2:
        return True     # path/.. is the same i-node as path
    return False


# Expand paths beginning with '~' or '~user'.
# '~' means $HOME; '~user' means that user's home directory.
# If the path doesn't begin with '~', or if the user or $HOME is unknown,
# the path is returned unchanged (leaving error reporting to whatever
# function is called with the expanded path as argument).
# See also module 'glob' for expansion of *, ? and [...] in pathnames.
# (A function should also be defined to do full *sh-style environment
# variable expansion.)

def expanduser(path):
    """Expand ~ and ~user constructions.  If user or $HOME is unknown,
    do nothing."""
    path = os.fspath(path)
    if isinstance(path, bytes):
        tilde = b'~'
    else:
        tilde = '~'
    if not path.startswith(tilde):
        return path
    sep = _get_sep(path)
    i = path.find(sep, 1)
    if i < 0:
        i = len(path)
    if i == 1:
        if 'HOME' not in os.environ:
            import pwd
            try:
                userhome = pwd.getpwuid(os.getuid()).pw_dir
            except KeyError:
                # bpo-10496: if the current user identifier doesn't exist in the
                # password database, return the path unchanged
                return path
        else:
            userhome = os.environ['HOME']
    else:
        import pwd
        name = path[1:i]
        if isinstance(name, bytes):
            name = str(name, 'ASCII')
        try:
            pwent = pwd.getpwnam(name)
        except KeyError:
            # bpo-10496: if the user name from the path doesn't exist in the
            # password database, return the path unchanged
            return path
        userhome = pwent.pw_dir
    if isinstance(path, bytes):
        userhome = os.fsencode(userhome)
        root = b'/'
    else:
        root = '/'
    userhome = userhome.rstrip(root)
    return (userhome + path[i:]) or root


# Expand paths containing shell variable substitutions.
# This expands the forms $variable and ${variable} only.
# Non-existent variables are left unchanged.

_varprog = None
_varprogb = None

def expandvars(path):
    """Expand shell variables of form $var and ${var}.  Unknown variables
    are left unchanged."""
    path = os.fspath(path)
    global _varprog, _varprogb
    if isinstance(path, bytes):
        if b'$' not in path:
            return path
        if not _varprogb:
            import re
            _varprogb = re.compile(br'\$(\w+|\{[^}]*\})', re.ASCII)
        search = _varprogb.search
        start = b'{'
        end = b'}'
        environ = getattr(os, 'environb', None)
    else:
        if '$' not in path:
            return path
        if not _varprog:
            import re
            _varprog = re.compile(r'\$(\w+|\{[^}]*\})', re.ASCII)
        search = _varprog.search
        start = '{'
        end = '}'
        environ = os.environ
    i = 0
    while True:
        m = search(path, i)
        if not m:
            break
        i, j = m.span(0)
        name = m.group(1)
        if name.startswith(start) and name.endswith(end):
            name = name[1:-1]
        try:
            if environ is None:
                value = os.fsencode(os.environ[os.fsdecode(name)])
            else:
                value = environ[name]
        except KeyError:
            i = j
        else:
            tail = path[j:]
            path = path[:i] + value
            i = len(path)
            path += tail
    return path


# Normalize a path, e.g. A//B, A/./B and A/foo/../B all become A/B.
# It should be understood that this may change the meaning of the path
# if it contains symbolic links!

def normpath(path):
    """Normalize path, eliminating double slashes, etc."""
    path = os.fspath(path)
    if isinstance(path, bytes):
        sep = b'/'
        empty = b''
        dot = b'.'
        dotdot = b'..'
    else:
        sep = '/'
        empty = ''
        dot = '.'
        dotdot = '..'
    if path == empty:
        return dot
    initial_slashes = path.startswith(sep)
    # POSIX allows one or two initial slashes, but treats three or more
    # as single slash.
    if (initial_slashes and
        path.startswith(sep*2) and not path.startswith(sep*3)):
        initial_slashes = 2
    comps = path.split(sep)
    new_comps = []
    for comp in comps:
        if comp in (empty, dot):
            continue
        if (comp != dotdot or (not initial_slashes and not new_comps) or
             (new_comps and new_comps[-1] == dotdot)):
            new_comps.append(comp)
        elif new_comps:
            new_comps.pop()
    comps = new_comps
    path = sep.join(comps)
    if initial_slashes:
        path = sep*initial_slashes + path
    return path or dot


def abspath(path):
    """Return an absolute path."""
    path = os.fspath(path)
    if not isabs(path):
        if isinstance(path, bytes):
            cwd = os.getcwdb()
        else:
            cwd = os.getcwd()
        path = join(cwd, path)
    return normpath(path)


# Return a canonical path (i.e. the absolute location of a file on the
# filesystem).

def realpath(filename):
    """Return the canonical path of the specified filename, eliminating any
symbolic links encountered in the path."""
    filename = os.fspath(filename)
    path, ok = _joinrealpath(filename[:0], filename, {})
    return abspath(path)

# Join two paths, normalizing and eliminating any symbolic links
# encountered in the second path.
def _joinrealpath(path, rest, seen):
    if isinstance(path, bytes):
        sep = b'/'
        curdir = b'.'
        pardir = b'..'
    else:
        sep = '/'
        curdir = '.'
        pardir = '..'

    if isabs(rest):
        rest = rest[1:]
        path = sep

    while rest:
        name, _, rest = rest.partition(sep)
        if not name or name == curdir:
            # current dir
            continue
        if name == pardir:
            # parent dir
            if path:
                path, name = split(path)
                if name == pardir:
                    path = join(path, pardir, pardir)
            else:
                path = pardir
            continue
        newpath = join(path, name)
        if not islink(newpath):
            path = newpath
            continue
        # Resolve the symbolic link
        if newpath in seen:
            # Already seen this path
            path = seen[newpath]
            if path is not None:
                # use cached value
                continue
            # The symlink is not resolved, so we must have a symlink loop.
            # Return already resolved part + rest of the path unchanged.
            return join(newpath, rest), False
        seen[newpath] = None # not resolved symlink
        path, ok = _joinrealpath(path, os.readlink(newpath), seen)
        if not ok:
            return join(path, rest), False
        seen[newpath] = path # resolved symlink

    return path, True


supports_unicode_filenames = (sys.platform == 'darwin')

def relpath(path, start=None):
    """Return a relative version of a path"""

    if not path:
        raise ValueError("no path specified")

    path = os.fspath(path)
    if isinstance(path, bytes):
        curdir = b'.'
        sep = b'/'
        pardir = b'..'
    else:
        curdir = '.'
        sep = '/'
        pardir = '..'

    if start is None:
        start = curdir
    else:
        start = os.fspath(start)

    try:
        start_list = [x for x in abspath(start).split(sep) if x]
        path_list = [x for x in abspath(path).split(sep) if x]
        # Work out how much of the filepath is shared by start and path.
        i = len(commonprefix([start_list, path_list]))

        rel_list = [pardir] * (len(start_list)-i) + path_list[i:]
        if not rel_list:
            return curdir
        return join(*rel_list)
    except (TypeError, AttributeError, BytesWarning, DeprecationWarning):
        genericpath._check_arg_types('relpath', path, start)
        raise


# Return the longest common sub-path of the sequence of paths given as input.
# The paths are not normalized before comparing them (this is the
# responsibility of the caller). Any trailing separator is stripped from the
# returned path.

def commonpath(paths):
    """Given a sequence of path names, returns the longest common sub-path."""

    if not paths:
        raise ValueError('commonpath() arg is an empty sequence')

    paths = tuple(map(os.fspath, paths))
    if isinstance(paths[0], bytes):
        sep = b'/'
        curdir = b'.'
    else:
        sep = '/'
        curdir = '.'

    try:
        split_paths = [path.split(sep) for path in paths]

        try:
            isabs, = set(p[:1] == sep for p in paths)
        except ValueError:
            raise ValueError("Can't mix absolute and relative paths") from None

        split_paths = [[c for c in s if c and c != curdir] for s in split_paths]
        s1 = min(split_paths)
        s2 = max(split_paths)
        common = s1
        for i, c in enumerate(s1):
            if c != s2[i]:
                common = s1[:i]
                break

        prefix = sep if isabs else sep[:0]
        return prefix + sep.join(common)
    except (TypeError, AttributeError):
        genericpath._check_arg_types('commonpath', *paths)
        raise
venv/__main__.py000064400000000221151153537470007622 0ustar00import sys
from . import main

rc = 1
try:
    main()
    rc = 0
except Exception as e:
    print('Error: %s' % e, file=sys.stderr)
sys.exit(rc)
venv/__init__.py000064400000051106151153537470007651 0ustar00"""
Virtual environment (venv) package for Python. Based on PEP 405.

Copyright (C) 2011-2014 Vinay Sajip.
Licensed to the PSF under a contributor agreement.
"""
import logging
import os
import shutil
import subprocess
import sys
import sysconfig
import types

logger = logging.getLogger(__name__)


class EnvBuilder:
    """
    This class exists to allow virtual environment creation to be
    customized. The constructor parameters determine the builder's
    behaviour when called upon to create a virtual environment.

    By default, the builder makes the system (global) site-packages dir
    *un*available to the created environment.

    If invoked using the Python -m option, the default is to use copying
    on Windows platforms but symlinks elsewhere. If instantiated some
    other way, the default is to *not* use symlinks.

    :param system_site_packages: If True, the system (global) site-packages
                                 dir is available to created environments.
    :param clear: If True, delete the contents of the environment directory if
                  it already exists, before environment creation.
    :param symlinks: If True, attempt to symlink rather than copy files into
                     virtual environment.
    :param upgrade: If True, upgrade an existing virtual environment.
    :param with_pip: If True, ensure pip is installed in the virtual
                     environment
    :param prompt: Alternative terminal prefix for the environment.
    """

    def __init__(self, system_site_packages=False, clear=False,
                 symlinks=False, upgrade=False, with_pip=False, prompt=None):
        self.system_site_packages = system_site_packages
        self.clear = clear
        self.symlinks = symlinks
        self.upgrade = upgrade
        self.with_pip = with_pip
        self.prompt = prompt

    def create(self, env_dir):
        """
        Create a virtual environment in a directory.

        :param env_dir: The target directory to create an environment in.

        """
        env_dir = os.path.abspath(env_dir)
        context = self.ensure_directories(env_dir)
        # See issue 24875. We need system_site_packages to be False
        # until after pip is installed.
        true_system_site_packages = self.system_site_packages
        self.system_site_packages = False
        self.create_configuration(context)
        self.setup_python(context)
        if self.with_pip:
            self._setup_pip(context)
        if not self.upgrade:
            self.setup_scripts(context)
            self.post_setup(context)
        if true_system_site_packages:
            # We had set it to False before, now
            # restore it and rewrite the configuration
            self.system_site_packages = True
            self.create_configuration(context)

    def clear_directory(self, path):
        for fn in os.listdir(path):
            fn = os.path.join(path, fn)
            if os.path.islink(fn) or os.path.isfile(fn):
                os.remove(fn)
            elif os.path.isdir(fn):
                shutil.rmtree(fn)

    def ensure_directories(self, env_dir):
        """
        Create the directories for the environment.

        Returns a context object which holds paths in the environment,
        for use by subsequent logic.
        """

        def create_if_needed(d):
            if not os.path.exists(d):
                os.makedirs(d)
            elif os.path.islink(d) or os.path.isfile(d):
                raise ValueError('Unable to create directory %r' % d)

        if os.path.exists(env_dir) and self.clear:
            self.clear_directory(env_dir)
        context = types.SimpleNamespace()
        context.env_dir = env_dir
        context.env_name = os.path.split(env_dir)[1]
        prompt = self.prompt if self.prompt is not None else context.env_name
        context.prompt = '(%s) ' % prompt
        create_if_needed(env_dir)
        executable = sys._base_executable
        dirname, exename = os.path.split(os.path.abspath(executable))
        context.executable = executable
        context.python_dir = dirname
        context.python_exe = exename
        if sys.platform == 'win32':
            binname = 'Scripts'
            incpath = 'Include'
            libpath = os.path.join(env_dir, 'Lib', 'site-packages')
        else:
            binname = 'bin'
            incpath = 'include'
            libpath = os.path.join(env_dir, 'lib',
                                   'python%d.%d' % sys.version_info[:2],
                                   'site-packages')
        context.inc_path = path = os.path.join(env_dir, incpath)
        create_if_needed(path)
        create_if_needed(libpath)
        # Issue 21197: create lib64 as a symlink to lib on 64-bit non-OS X POSIX
        if ((sys.maxsize > 2**32) and (os.name == 'posix') and
            (sys.platform != 'darwin')):
            link_path = os.path.join(env_dir, 'lib64')
            if not os.path.exists(link_path):   # Issue #21643
                os.symlink('lib', link_path)
        context.bin_path = binpath = os.path.join(env_dir, binname)
        context.bin_name = binname
        context.env_exe = os.path.join(binpath, exename)
        create_if_needed(binpath)
        return context

    def create_configuration(self, context):
        """
        Create a configuration file indicating where the environment's Python
        was copied from, and whether the system site-packages should be made
        available in the environment.

        :param context: The information for the environment creation request
                        being processed.
        """
        context.cfg_path = path = os.path.join(context.env_dir, 'pyvenv.cfg')
        with open(path, 'w', encoding='utf-8') as f:
            f.write('home = %s\n' % context.python_dir)
            if self.system_site_packages:
                incl = 'true'
            else:
                incl = 'false'
            f.write('include-system-site-packages = %s\n' % incl)
            f.write('version = %d.%d.%d\n' % sys.version_info[:3])
            if self.prompt is not None:
                f.write(f'prompt = {self.prompt!r}\n')

    if os.name != 'nt':
        def symlink_or_copy(self, src, dst, relative_symlinks_ok=False):
            """
            Try symlinking a file, and if that fails, fall back to copying.
            """
            force_copy = not self.symlinks
            if not force_copy:
                try:
                    if not os.path.islink(dst): # can't link to itself!
                        if relative_symlinks_ok:
                            assert os.path.dirname(src) == os.path.dirname(dst)
                            os.symlink(os.path.basename(src), dst)
                        else:
                            os.symlink(src, dst)
                except Exception:   # may need to use a more specific exception
                    logger.warning('Unable to symlink %r to %r', src, dst)
                    force_copy = True
            if force_copy:
                shutil.copyfile(src, dst)
    else:
        def symlink_or_copy(self, src, dst, relative_symlinks_ok=False):
            """
            Try symlinking a file, and if that fails, fall back to copying.
            """
            bad_src = os.path.lexists(src) and not os.path.exists(src)
            if self.symlinks and not bad_src and not os.path.islink(dst):
                try:
                    if relative_symlinks_ok:
                        assert os.path.dirname(src) == os.path.dirname(dst)
                        os.symlink(os.path.basename(src), dst)
                    else:
                        os.symlink(src, dst)
                    return
                except Exception:   # may need to use a more specific exception
                    logger.warning('Unable to symlink %r to %r', src, dst)

            # On Windows, we rewrite symlinks to our base python.exe into
            # copies of venvlauncher.exe
            basename, ext = os.path.splitext(os.path.basename(src))
            srcfn = os.path.join(os.path.dirname(__file__),
                                 "scripts",
                                 "nt",
                                 basename + ext)
            # Builds or venv's from builds need to remap source file
            # locations, as we do not put them into Lib/venv/scripts
            if sysconfig.is_python_build(True) or not os.path.isfile(srcfn):
                if basename.endswith('_d'):
                    ext = '_d' + ext
                    basename = basename[:-2]
                if basename == 'python':
                    basename = 'venvlauncher'
                elif basename == 'pythonw':
                    basename = 'venvwlauncher'
                src = os.path.join(os.path.dirname(src), basename + ext)
            else:
                src = srcfn
            if not os.path.exists(src):
                if not bad_src:
                    logger.warning('Unable to copy %r', src)
                return

            shutil.copyfile(src, dst)

    def setup_python(self, context):
        """
        Set up a Python executable in the environment.

        :param context: The information for the environment creation request
                        being processed.
        """
        binpath = context.bin_path
        path = context.env_exe
        copier = self.symlink_or_copy
        dirname = context.python_dir
        if os.name != 'nt':
            copier(context.executable, path)
            if not os.path.islink(path):
                os.chmod(path, 0o755)
            for suffix in ('python', 'python3'):
                path = os.path.join(binpath, suffix)
                if not os.path.exists(path):
                    # Issue 18807: make copies if
                    # symlinks are not wanted
                    copier(context.env_exe, path, relative_symlinks_ok=True)
                    if not os.path.islink(path):
                        os.chmod(path, 0o755)
        else:
            if self.symlinks:
                # For symlinking, we need a complete copy of the root directory
                # If symlinks fail, you'll get unnecessary copies of files, but
                # we assume that if you've opted into symlinks on Windows then
                # you know what you're doing.
                suffixes = [
                    f for f in os.listdir(dirname) if
                    os.path.normcase(os.path.splitext(f)[1]) in ('.exe', '.dll')
                ]
                if sysconfig.is_python_build(True):
                    suffixes = [
                        f for f in suffixes if
                        os.path.normcase(f).startswith(('python', 'vcruntime'))
                    ]
            else:
                suffixes = ['python.exe', 'python_d.exe', 'pythonw.exe',
                            'pythonw_d.exe']

            for suffix in suffixes:
                src = os.path.join(dirname, suffix)
                if os.path.lexists(src):
                    copier(src, os.path.join(binpath, suffix))

            if sysconfig.is_python_build(True):
                # copy init.tcl
                for root, dirs, files in os.walk(context.python_dir):
                    if 'init.tcl' in files:
                        tcldir = os.path.basename(root)
                        tcldir = os.path.join(context.env_dir, 'Lib', tcldir)
                        if not os.path.exists(tcldir):
                            os.makedirs(tcldir)
                        src = os.path.join(root, 'init.tcl')
                        dst = os.path.join(tcldir, 'init.tcl')
                        shutil.copyfile(src, dst)
                        break

    def _setup_pip(self, context):
        """Installs or upgrades pip in a virtual environment"""
        # We run ensurepip in isolated mode to avoid side effects from
        # environment vars, the current directory and anything else
        # intended for the global Python environment
        cmd = [context.env_exe, '-Im', 'ensurepip', '--upgrade',
                                                    '--default-pip']
        subprocess.check_output(cmd, stderr=subprocess.STDOUT)

    def setup_scripts(self, context):
        """
        Set up scripts into the created environment from a directory.

        This method installs the default scripts into the environment
        being created. You can prevent the default installation by overriding
        this method if you really need to, or if you need to specify
        a different location for the scripts to install. By default, the
        'scripts' directory in the venv package is used as the source of
        scripts to install.
        """
        path = os.path.abspath(os.path.dirname(__file__))
        path = os.path.join(path, 'scripts')
        self.install_scripts(context, path)

    def post_setup(self, context):
        """
        Hook for post-setup modification of the venv. Subclasses may install
        additional packages or scripts here, add activation shell scripts, etc.

        :param context: The information for the environment creation request
                        being processed.
        """
        pass

    def replace_variables(self, text, context):
        """
        Replace variable placeholders in script text with context-specific
        variables.

        Return the text passed in , but with variables replaced.

        :param text: The text in which to replace placeholder variables.
        :param context: The information for the environment creation request
                        being processed.
        """
        text = text.replace('__VENV_DIR__', context.env_dir)
        text = text.replace('__VENV_NAME__', context.env_name)
        text = text.replace('__VENV_PROMPT__', context.prompt)
        text = text.replace('__VENV_BIN_NAME__', context.bin_name)
        text = text.replace('__VENV_PYTHON__', context.env_exe)
        return text

    def install_scripts(self, context, path):
        """
        Install scripts into the created environment from a directory.

        :param context: The information for the environment creation request
                        being processed.
        :param path:    Absolute pathname of a directory containing script.
                        Scripts in the 'common' subdirectory of this directory,
                        and those in the directory named for the platform
                        being run on, are installed in the created environment.
                        Placeholder variables are replaced with environment-
                        specific values.
        """
        binpath = context.bin_path
        plen = len(path)
        for root, dirs, files in os.walk(path):
            if root == path: # at top-level, remove irrelevant dirs
                for d in dirs[:]:
                    if d not in ('common', os.name):
                        dirs.remove(d)
                continue # ignore files in top level
            for f in files:
                if (os.name == 'nt' and f.startswith('python')
                        and f.endswith(('.exe', '.pdb'))):
                    continue
                srcfile = os.path.join(root, f)
                suffix = root[plen:].split(os.sep)[2:]
                if not suffix:
                    dstdir = binpath
                else:
                    dstdir = os.path.join(binpath, *suffix)
                if not os.path.exists(dstdir):
                    os.makedirs(dstdir)
                dstfile = os.path.join(dstdir, f)
                with open(srcfile, 'rb') as f:
                    data = f.read()
                if not srcfile.endswith(('.exe', '.pdb')):
                    try:
                        data = data.decode('utf-8')
                        data = self.replace_variables(data, context)
                        data = data.encode('utf-8')
                    except UnicodeError as e:
                        data = None
                        logger.warning('unable to copy script %r, '
                                       'may be binary: %s', srcfile, e)
                if data is not None:
                    with open(dstfile, 'wb') as f:
                        f.write(data)
                    shutil.copymode(srcfile, dstfile)


def create(env_dir, system_site_packages=False, clear=False,
                    symlinks=False, with_pip=False, prompt=None):
    """Create a virtual environment in a directory."""
    builder = EnvBuilder(system_site_packages=system_site_packages,
                         clear=clear, symlinks=symlinks, with_pip=with_pip,
                         prompt=prompt)
    builder.create(env_dir)

def main(args=None):
    compatible = True
    if sys.version_info < (3, 3):
        compatible = False
    elif not hasattr(sys, 'base_prefix'):
        compatible = False
    if not compatible:
        raise ValueError('This script is only for use with Python >= 3.3')
    else:
        import argparse

        parser = argparse.ArgumentParser(prog=__name__,
                                         description='Creates virtual Python '
                                                     'environments in one or '
                                                     'more target '
                                                     'directories.',
                                         epilog='Once an environment has been '
                                                'created, you may wish to '
                                                'activate it, e.g. by '
                                                'sourcing an activate script '
                                                'in its bin directory.')
        parser.add_argument('dirs', metavar='ENV_DIR', nargs='+',
                            help='A directory to create the environment in.')
        parser.add_argument('--system-site-packages', default=False,
                            action='store_true', dest='system_site',
                            help='Give the virtual environment access to the '
                                 'system site-packages dir.')
        if os.name == 'nt':
            use_symlinks = False
        else:
            use_symlinks = True
        group = parser.add_mutually_exclusive_group()
        group.add_argument('--symlinks', default=use_symlinks,
                           action='store_true', dest='symlinks',
                           help='Try to use symlinks rather than copies, '
                                'when symlinks are not the default for '
                                'the platform.')
        group.add_argument('--copies', default=not use_symlinks,
                           action='store_false', dest='symlinks',
                           help='Try to use copies rather than symlinks, '
                                'even when symlinks are the default for '
                                'the platform.')
        parser.add_argument('--clear', default=False, action='store_true',
                            dest='clear', help='Delete the contents of the '
                                               'environment directory if it '
                                               'already exists, before '
                                               'environment creation.')
        parser.add_argument('--upgrade', default=False, action='store_true',
                            dest='upgrade', help='Upgrade the environment '
                                               'directory to use this version '
                                               'of Python, assuming Python '
                                               'has been upgraded in-place.')
        parser.add_argument('--without-pip', dest='with_pip',
                            default=True, action='store_false',
                            help='Skips installing or upgrading pip in the '
                                 'virtual environment (pip is bootstrapped '
                                 'by default)')
        parser.add_argument('--prompt',
                            help='Provides an alternative prompt prefix for '
                                 'this environment.')
        options = parser.parse_args(args)
        if options.upgrade and options.clear:
            raise ValueError('you cannot supply --upgrade and --clear together.')
        builder = EnvBuilder(system_site_packages=options.system_site,
                             clear=options.clear,
                             symlinks=options.symlinks,
                             upgrade=options.upgrade,
                             with_pip=options.with_pip,
                             prompt=options.prompt)
        for d in options.dirs:
            builder.create(d)

if __name__ == '__main__':
    rc = 1
    try:
        main()
        rc = 0
    except Exception as e:
        print('Error: %s' % e, file=sys.stderr)
    sys.exit(rc)
venv/__pycache__/__init__.cpython-38.opt-1.pyc000064400000034007151153537470015077 0ustar00U

e5dFR�
@s�dZddlZddlZddlZddlZddlZddlZddlZe�e	�Z
Gdd�d�Zddd�Zddd	�Z
e	d
kr�dZze
�dZWn4ek
r�Zzedeejd
�W5dZ[XYnXe�e�dS)z�
Virtual environment (venv) package for Python. Based on PEP 405.

Copyright (C) 2011-2014 Vinay Sajip.
Licensed to the PSF under a contributor agreement.
�Nc@s�eZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Ze	j
dkrLddd�Zn
d dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZdS)!�
EnvBuildera�
    This class exists to allow virtual environment creation to be
    customized. The constructor parameters determine the builder's
    behaviour when called upon to create a virtual environment.

    By default, the builder makes the system (global) site-packages dir
    *un*available to the created environment.

    If invoked using the Python -m option, the default is to use copying
    on Windows platforms but symlinks elsewhere. If instantiated some
    other way, the default is to *not* use symlinks.

    :param system_site_packages: If True, the system (global) site-packages
                                 dir is available to created environments.
    :param clear: If True, delete the contents of the environment directory if
                  it already exists, before environment creation.
    :param symlinks: If True, attempt to symlink rather than copy files into
                     virtual environment.
    :param upgrade: If True, upgrade an existing virtual environment.
    :param with_pip: If True, ensure pip is installed in the virtual
                     environment
    :param prompt: Alternative terminal prefix for the environment.
    FNcCs(||_||_||_||_||_||_dS�N��system_site_packages�clear�symlinks�upgrade�with_pip�prompt)�selfrrrrr	r
�r�%/usr/lib64/python3.8/venv/__init__.py�__init__+szEnvBuilder.__init__cCsxtj�|�}|�|�}|j}d|_|�|�|�|�|jrF|�|�|j	s`|�
|�|�|�|rtd|_|�|�dS)z�
        Create a virtual environment in a directory.

        :param env_dir: The target directory to create an environment in.

        FTN)�os�path�abspath�ensure_directoriesr�create_configuration�setup_pythonr	�
_setup_pipr�
setup_scripts�
post_setup)r�env_dir�contextZtrue_system_site_packagesrrr
�create4s





zEnvBuilder.createcCs\t�|�D]L}tj�||�}tj�|�s4tj�|�r@t�|�q
tj�|�r
t�	|�q
dSr)
r�listdirr�join�islink�isfile�remove�isdir�shutilZrmtree)rr�fnrrr
�clear_directoryNszEnvBuilder.clear_directorycCs�dd�}tj�|�r$|jr$|�|�t��}||_tj�|�d|_	|j
dk	rT|j
n|j	}d||_
||�tj}tj�tj�
|��\}}||_||_||_tjdkr�d}d}	tj�|d	d
�}
n(d}d}	tj�|d
dtjdd�d
�}
tj�||	�|_}||�||
�tjdk�rXtjdk�rXtjdk�rXtj�|d�}tj�|��sXt�d
|�tj�||�|_}
||_tj�|
|�|_||
�|S)z�
        Create the directories for the environment.

        Returns a context object which holds paths in the environment,
        for use by subsequent logic.
        cSs@tj�|�st�|�n$tj�|�s0tj�|�r<td|��dS)NzUnable to create directory %r)rr�exists�makedirsrr�
ValueError)�drrr
�create_if_needed^sz7EnvBuilder.ensure_directories.<locals>.create_if_needed�Nz(%s) Zwin32ZScriptsZInclude�Libz
site-packages�binZinclude�libzpython%d.%d�l�posix�darwin�lib64)rrr$rr#�types�SimpleNamespacer�split�env_namer
�sys�_base_executabler�
executable�
python_dirZ
python_exe�platformr�version_infoZinc_path�maxsize�name�symlink�bin_path�bin_name�env_exe)rrr(rr
r7�dirnameZexenameZbinnameZincpathZlibpathrZ	link_path�binpathrrr
rVsL



��zEnvBuilder.ensure_directoriesc	Cs�tj�|jd�|_}t|ddd��j}|�d|j�|jrBd}nd}|�d|�|�d	t	j
d
d��|jd
k	r�|�d|j�d
��W5QRXd
S)aA
        Create a configuration file indicating where the environment's Python
        was copied from, and whether the system site-packages should be made
        available in the environment.

        :param context: The information for the environment creation request
                        being processed.
        z
pyvenv.cfg�w�utf-8)�encodingz
home = %s
�trueZfalsez"include-system-site-packages = %s
zversion = %d.%d.%d
N�z	prompt = �
)rrrrZcfg_path�open�writer8rr5r:r
)rrr�fZinclrrr
r�s	
zEnvBuilder.create_configuration�ntcCs~|j}|sjz6tj�|�s@|r4t�tj�|�|�nt�||�Wn&tk
rht�d||�d}YnX|rzt	�
||�dS)�Y
            Try symlinking a file, and if that fails, fall back to copying.
            �Unable to symlink %r to %rTN)rrrrr=�basename�	Exception�logger�warningr!�copyfile)r�src�dst�relative_symlinks_okZ
force_copyrrr
�symlink_or_copy�s
zEnvBuilder.symlink_or_copycCs\tj�|�otj�|�}|jr�|s�tj�|�s�z,|rLt�tj�|�|�nt�||�WdStk
r~t	�
d||�YnXtj�tj�|��\}}tj�tj�
t�dd||�}t�d�s�tj�|��s$|�d�r�d|}|dd�}|dkr�d	}n|d
k�rd}tj�tj�
|�||�}n|}tj�|��sL|�sHt	�
d|�dSt�||�dS)
rMNrN�scriptsrLTZ_d����pythonZvenvlauncherZpythonwZ
venvwlauncherzUnable to copy %r)rr�lexistsr$rrr=rOrPrQrR�splitextrrA�__file__�	sysconfig�is_python_buildr�endswithr!rS)rrTrUrVZbad_srcrOZextZsrcfnrrr
rW�s<�

cCs�|j}|j}|j}|j}tjdkr�||j|�tj�|�sFt�	|d�dD]F}tj�
||�}tj�|�sJ||j|dd�tj�|�sJt�	|d�qJ�n|jr�dd�t�
|�D�}t�d�r�dd�|D�}nd	d
ddg}|D]2}tj�
||�}tj�|�r�||tj�
||��q�t�d��r�t�|j�D]z\}	}
}d
|k�r&tj�|	�}tj�
|jd|�}tj�|��spt�|�tj�
|	d
�}tj�
|d
�}
t�||
��q��q&dS)z�
        Set up a Python executable in the environment.

        :param context: The information for the environment creation request
                        being processed.
        rLi�)rZZpython3T)rVcSs,g|]$}tj�tj�|�d�dkr|�qS)r))�.exez.dll)rr�normcaser\��.0rKrrr
�
<listcomp>�s�z+EnvBuilder.setup_python.<locals>.<listcomp>cSs"g|]}tj�|��d�r|�qS))rZZ	vcruntime)rrrb�
startswithrcrrr
res�z
python.exezpython_d.exezpythonw.exez
pythonw_d.exezinit.tclr*N)r>r@rWr8rr<r7rr�chmodrr$rrr^r_r[�walkrOrr%r!rS)rrrBrZcopierrA�suffix�suffixesrT�root�dirs�filesZtcldirrUrrr
r�sP
�
��

zEnvBuilder.setup_pythoncCs$|jddddg}tj|tjd�dS)z1Installs or upgrades pip in a virtual environmentz-ImZ	ensurepip�	--upgradez
--default-pip)�stderrN)r@�
subprocessZcheck_outputZSTDOUT)rr�cmdrrr
rs
�zEnvBuilder._setup_pipcCs2tj�tj�t��}tj�|d�}|�||�dS)a�
        Set up scripts into the created environment from a directory.

        This method installs the default scripts into the environment
        being created. You can prevent the default installation by overriding
        this method if you really need to, or if you need to specify
        a different location for the scripts to install. By default, the
        'scripts' directory in the venv package is used as the source of
        scripts to install.
        rXN)rrrrAr]r�install_scripts)rrrrrr
r#szEnvBuilder.setup_scriptscCsdS)a
        Hook for post-setup modification of the venv. Subclasses may install
        additional packages or scripts here, add activation shell scripts, etc.

        :param context: The information for the environment creation request
                        being processed.
        Nr)rrrrr
r2szEnvBuilder.post_setupcCsJ|�d|j�}|�d|j�}|�d|j�}|�d|j�}|�d|j�}|S)ai
        Replace variable placeholders in script text with context-specific
        variables.

        Return the text passed in , but with variables replaced.

        :param text: The text in which to replace placeholder variables.
        :param context: The information for the environment creation request
                        being processed.
        Z__VENV_DIR__Z
__VENV_NAME__Z__VENV_PROMPT__Z__VENV_BIN_NAME__Z__VENV_PYTHON__)�replacerr4r
r?r@)r�textrrrr
�replace_variables<szEnvBuilder.replace_variablescCs�|j}t|�}t�|�D�]�\}}}||krX|dd�D]}|dtjfkr8|�|�q8q|D�]H}	tjdkr�|	�d�r�|	�d�r�q\tj�	||	�}
||d��
tj�dd�}|s�|}ntjj	|f|��}tj�|�s�t�
|�tj�	||	�}
t|
d��}	|	��}W5QRX|
�d��srz$|�d�}|�||�}|�d�}Wn6tk
�rp}zd}t�d	|
|�W5d}~XYnX|dk	r\t|
d
��}	|	�|�W5QRXt�|
|
�q\qdS)as
        Install scripts into the created environment from a directory.

        :param context: The information for the environment creation request
                        being processed.
        :param path:    Absolute pathname of a directory containing script.
                        Scripts in the 'common' subdirectory of this directory,
                        and those in the directory named for the platform
                        being run on, are installed in the created environment.
                        Placeholder variables are replaced with environment-
                        specific values.
        N�commonrLrZ)raz.pdbr-�rbrDz+unable to copy script %r, may be binary: %s�wb)r>�lenrrhr<rrfr`rrr3�sepr$r%rI�read�decoderu�encode�UnicodeErrorrQrRrJr!Zcopymode)rrrrBZplenrkrlrmr'rKZsrcfileriZdstdirZdstfile�data�errr
rrNsL

�

�zEnvBuilder.install_scripts)FFFFFN)F)F)�__name__�
__module__�__qualname__�__doc__rrr#rrrr<rWrrrrrurrrrrr
rs(�
	4

+<	
rFcCs t|||||d�}|�|�dS)z,Create a virtual environment in a directory.)rrrr	r
N)rr)rrrrr	r
�builderrrr
r�s�rc	Cs^d}tjdkrd}nttd�s"d}|s2td���n(ddl}|jtddd	�}|jd
ddd
d�|jdddddd�tj	dkr�d}nd}|�
�}|jd|dddd�|jd|dddd�|jdddddd�|jddddd d�|jd!d"ddd#d$�|jd%d&d'�|�|�}|j�r"|j
�r"td(��t|j|j
|j|j|j|jd)�}|jD]}|�|��qHdS)*NT)rGrGF�base_prefixz.This script is only for use with Python >= 3.3rzFCreates virtual Python environments in one or more target directories.z|Once an environment has been created, you may wish to activate it, e.g. by sourcing an activate script in its bin directory.)�progZdescriptionZepilogrlZENV_DIR�+z)A directory to create the environment in.)�metavar�nargs�helpz--system-site-packages�
store_true�system_sitezDGive the virtual environment access to the system site-packages dir.)�default�action�destr�rLz
--symlinksrz[Try to use symlinks rather than copies, when symlinks are not the default for the platform.z--copiesZstore_falsez\Try to use copies rather than symlinks, even when symlinks are the default for the platform.z--clearrzcDelete the contents of the environment directory if it already exists, before environment creation.rnrzlUpgrade the environment directory to use this version of Python, assuming Python has been upgraded in-place.z
--without-pipr	z]Skips installing or upgrading pip in the virtual environment (pip is bootstrapped by default))r�r�r�r�z--promptz;Provides an alternative prompt prefix for this environment.)r�z1you cannot supply --upgrade and --clear together.r)r5r:�hasattrr&�argparse�ArgumentParserr��add_argumentrr<Zadd_mutually_exclusive_group�
parse_argsrrrr�rr	r
rlr)	�argsZ
compatibler��parserZuse_symlinks�groupZoptionsr�r'rrr
�main�s|

�

��
�
�
�
���
�
r��__main__r)z	Error: %s)�file)FFFFN)N)r�Zloggingrr!rpr5r^r1Z	getLoggerr�rQrrr�ZrcrPr��printro�exitrrrr
�<module>s2
q�

H$venv/__pycache__/__main__.cpython-38.opt-2.pyc000064400000000513151153537470015054 0ustar00U

e5d��
@sjddlZddlmZdZze�dZWn4ek
rZZzedeejd�W5dZ[XYnXe�e�dS)�N�)�mainz	Error: %s)�file)	�sys�rZrc�	Exception�e�print�stderr�exit�rr�%/usr/lib64/python3.8/venv/__main__.py�<module>s$venv/__pycache__/__main__.cpython-38.opt-1.pyc000064400000000513151153537470015053 0ustar00U

e5d��
@sjddlZddlmZdZze�dZWn4ek
rZZzedeejd�W5dZ[XYnXe�e�dS)�N�)�mainz	Error: %s)�file)	�sys�rZrc�	Exception�e�print�stderr�exit�rr�%/usr/lib64/python3.8/venv/__main__.py�<module>s$venv/__pycache__/__init__.cpython-38.opt-2.pyc000064400000023734151153537470015105 0ustar00U

e5dFR�
@s�ddlZddlZddlZddlZddlZddlZddlZe�e�Z	Gdd�d�Z
d
dd�Zddd�Zed	kr�d
Z
ze�dZ
Wn4ek
r�Zzedeejd�W5dZ[XYnXe�e
�dS)�Nc@s�eZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zej	d
krHddd�Z
n
ddd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS) �
EnvBuilderFNcCs(||_||_||_||_||_||_dS�N��system_site_packages�clear�symlinks�upgrade�with_pip�prompt)�selfrrrrr	r
�r�%/usr/lib64/python3.8/venv/__init__.py�__init__+szEnvBuilder.__init__cCsxtj�|�}|�|�}|j}d|_|�|�|�|�|jrF|�|�|j	s`|�
|�|�|�|rtd|_|�|�dS)NFT)�os�path�abspath�ensure_directoriesr�create_configuration�setup_pythonr	�
_setup_pipr�
setup_scripts�
post_setup)r�env_dir�contextZtrue_system_site_packagesrrr
�create4s





zEnvBuilder.createcCs\t�|�D]L}tj�||�}tj�|�s4tj�|�r@t�|�q
tj�|�r
t�	|�q
dSr)
r�listdirr�join�islink�isfile�remove�isdir�shutilZrmtree)rr�fnrrr
�clear_directoryNszEnvBuilder.clear_directorycCs�dd�}tj�|�r$|jr$|�|�t��}||_tj�|�d|_	|j
dk	rT|j
n|j	}d||_
||�tj}tj�tj�
|��\}}||_||_||_tjdkr�d}d}	tj�|dd	�}
n(d
}d}	tj�|dd
tjdd�d	�}
tj�||	�|_}||�||
�tjdk�rXtjdk�rXtjdk�rXtj�|d�}tj�|��sXt�d|�tj�||�|_}
||_tj�|
|�|_||
�|S)NcSs@tj�|�st�|�n$tj�|�s0tj�|�r<td|��dS)NzUnable to create directory %r)rr�exists�makedirsrr�
ValueError)�drrr
�create_if_needed^sz7EnvBuilder.ensure_directories.<locals>.create_if_needed�z(%s) Zwin32ZScriptsZInclude�Libz
site-packages�binZinclude�libzpython%d.%d�l�posix�darwin�lib64)rrr$rr#�types�SimpleNamespacer�split�env_namer
�sys�_base_executabler�
executable�
python_dirZ
python_exe�platformr�version_infoZinc_path�maxsize�name�symlink�bin_path�bin_name�env_exe)rrr(rr
r7�dirnameZexenameZbinnameZincpathZlibpathrZ	link_path�binpathrrr
rVsL



��zEnvBuilder.ensure_directoriesc	Cs�tj�|jd�|_}t|ddd��j}|�d|j�|jrBd}nd}|�d|�|�d	t	j
dd
��|jdk	r�|�d|j�d��W5QRXdS)
Nz
pyvenv.cfg�w�utf-8)�encodingz
home = %s
�trueZfalsez"include-system-site-packages = %s
zversion = %d.%d.%d
�z	prompt = �
)rrrrZcfg_path�open�writer8rr5r:r
)rrr�fZinclrrr
r�s	
zEnvBuilder.create_configuration�ntcCs~|j}|sjz6tj�|�s@|r4t�tj�|�|�nt�||�Wn&tk
rht�d||�d}YnX|rzt	�
||�dS)N�Unable to symlink %r to %rT)rrrrr=�basename�	Exception�logger�warningr!�copyfile)r�src�dst�relative_symlinks_okZ
force_copyrrr
�symlink_or_copy�s
zEnvBuilder.symlink_or_copycCs\tj�|�otj�|�}|jr�|s�tj�|�s�z,|rLt�tj�|�|�nt�||�WdStk
r~t	�
d||�YnXtj�tj�|��\}}tj�tj�
t�dd||�}t�d�s�tj�|��s$|�d�r�d|}|dd�}|dkr�d}n|d	k�rd
}tj�tj�
|�||�}n|}tj�|��sL|�sHt	�
d|�dSt�||�dS)NrM�scriptsrLTZ_d����pythonZvenvlauncherZpythonwZ
venvwlauncherzUnable to copy %r)rr�lexistsr$rrr=rNrOrPrQ�splitextrrA�__file__�	sysconfig�is_python_buildr�endswithr!rR)rrSrTrUZbad_srcrNZextZsrcfnrrr
rV�s<�

cCs�|j}|j}|j}|j}tjdkr�||j|�tj�|�sFt�	|d�dD]F}tj�
||�}tj�|�sJ||j|dd�tj�|�sJt�	|d�qJ�n|jr�dd�t�
|�D�}t�d�r�dd�|D�}nd	d
ddg}|D]2}tj�
||�}tj�|�r�||tj�
||��q�t�d��r�t�|j�D]z\}	}
}d
|k�r&tj�|	�}tj�
|jd|�}tj�|��spt�|�tj�
|	d
�}tj�
|d
�}
t�||
��q��q&dS)NrLi�)rYZpython3T)rUcSs,g|]$}tj�tj�|�d�dkr|�qS)r))�.exez.dll)rr�normcaser[��.0rKrrr
�
<listcomp>�s�z+EnvBuilder.setup_python.<locals>.<listcomp>cSs"g|]}tj�|��d�r|�qS))rYZ	vcruntime)rrra�
startswithrbrrr
rds�z
python.exezpython_d.exezpythonw.exez
pythonw_d.exezinit.tclr*)r>r@rVr8rr<r7rr�chmodrr$rrr]r^rZ�walkrNrr%r!rR)rrrBrZcopierrA�suffix�suffixesrS�root�dirs�filesZtcldirrTrrr
r�sP
�
��

zEnvBuilder.setup_pythoncCs$|jddddg}tj|tjd�dS)Nz-ImZ	ensurepip�	--upgradez
--default-pip)�stderr)r@�
subprocessZcheck_outputZSTDOUT)rr�cmdrrr
rs
�zEnvBuilder._setup_pipcCs2tj�tj�t��}tj�|d�}|�||�dS)NrW)rrrrAr\r�install_scripts)rrrrrr
r#szEnvBuilder.setup_scriptscCsdSrr)rrrrr
r2szEnvBuilder.post_setupcCsJ|�d|j�}|�d|j�}|�d|j�}|�d|j�}|�d|j�}|S)NZ__VENV_DIR__Z
__VENV_NAME__Z__VENV_PROMPT__Z__VENV_BIN_NAME__Z__VENV_PYTHON__)�replacerr4r
r?r@)r�textrrrr
�replace_variables<szEnvBuilder.replace_variablescCs�|j}t|�}t�|�D�]�\}}}||krX|dd�D]}|dtjfkr8|�|�q8q|D�]H}	tjdkr�|	�d�r�|	�d�r�q\tj�	||	�}
||d��
tj�dd�}|s�|}ntjj	|f|��}tj�|�s�t�
|�tj�	||	�}
t|
d��}	|	��}W5QRX|
�d��srz$|�d�}|�||�}|�d�}Wn6tk
�rp}zd}t�d|
|�W5d}~XYnX|dk	r\t|
d	��}	|	�|�W5QRXt�|
|
�q\qdS)
N�commonrLrY)r`z.pdbr-�rbrDz+unable to copy script %r, may be binary: %s�wb)r>�lenrrgr<rrer_rrr3�sepr$r%rI�read�decodert�encode�UnicodeErrorrPrQrJr!Zcopymode)rrrrBZplenrjrkrlr'rKZsrcfilerhZdstdirZdstfile�data�errr
rqNsL

�

�zEnvBuilder.install_scripts)FFFFFN)F)F)�__name__�
__module__�__qualname__rrr#rrrr<rVrrrrrtrqrrrr
rs&�
	4

+<	
rFcCs t|||||d�}|�|�dS)N)rrrr	r
)rr)rrrrr	r
�builderrrr
r�s�rc	Cs^d}tjdkrd}nttd�s"d}|s2td���n(ddl}|jtddd	�}|jd
ddd
d�|jdddddd�tj	dkr�d}nd}|�
�}|jd|dddd�|jd|dddd�|jdddddd�|jddddd d�|jd!d"ddd#d$�|jd%d&d'�|�|�}|j�r"|j
�r"td(��t|j|j
|j|j|j|jd)�}|jD]}|�|��qHdS)*NT)rGrGF�base_prefixz.This script is only for use with Python >= 3.3rzFCreates virtual Python environments in one or more target directories.z|Once an environment has been created, you may wish to activate it, e.g. by sourcing an activate script in its bin directory.)�progZdescriptionZepilogrkZENV_DIR�+z)A directory to create the environment in.)�metavar�nargs�helpz--system-site-packages�
store_true�system_sitezDGive the virtual environment access to the system site-packages dir.)�default�action�destr�rLz
--symlinksrz[Try to use symlinks rather than copies, when symlinks are not the default for the platform.z--copiesZstore_falsez\Try to use copies rather than symlinks, even when symlinks are the default for the platform.z--clearrzcDelete the contents of the environment directory if it already exists, before environment creation.rmrzlUpgrade the environment directory to use this version of Python, assuming Python has been upgraded in-place.z
--without-pipr	z]Skips installing or upgrading pip in the virtual environment (pip is bootstrapped by default))r�r�r�r�z--promptz;Provides an alternative prompt prefix for this environment.)r�z1you cannot supply --upgrade and --clear together.r)r5r:�hasattrr&�argparse�ArgumentParserr��add_argumentrr<Zadd_mutually_exclusive_group�
parse_argsrrrr�rr	r
rkr)	�argsZ
compatibler��parserZuse_symlinks�groupZoptionsr�r'rrr
�main�s|

�

��
�
�
�
���
�
r��__main__r)z	Error: %s)�file)FFFFN)N)Zloggingrr!ror5r]r1Z	getLoggerr�rPrrr�ZrcrOr�printrn�exitrrrr
�<module>s0
q�

H$venv/__pycache__/__init__.cpython-38.pyc000064400000034141151153537470014137 0ustar00U

e5dFR�
@s�dZddlZddlZddlZddlZddlZddlZddlZe�e	�Z
Gdd�d�Zddd�Zddd	�Z
e	d
kr�dZze
�dZWn4ek
r�Zzedeejd
�W5dZ[XYnXe�e�dS)z�
Virtual environment (venv) package for Python. Based on PEP 405.

Copyright (C) 2011-2014 Vinay Sajip.
Licensed to the PSF under a contributor agreement.
�Nc@s�eZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Ze	j
dkrLddd�Zn
d dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZdS)!�
EnvBuildera�
    This class exists to allow virtual environment creation to be
    customized. The constructor parameters determine the builder's
    behaviour when called upon to create a virtual environment.

    By default, the builder makes the system (global) site-packages dir
    *un*available to the created environment.

    If invoked using the Python -m option, the default is to use copying
    on Windows platforms but symlinks elsewhere. If instantiated some
    other way, the default is to *not* use symlinks.

    :param system_site_packages: If True, the system (global) site-packages
                                 dir is available to created environments.
    :param clear: If True, delete the contents of the environment directory if
                  it already exists, before environment creation.
    :param symlinks: If True, attempt to symlink rather than copy files into
                     virtual environment.
    :param upgrade: If True, upgrade an existing virtual environment.
    :param with_pip: If True, ensure pip is installed in the virtual
                     environment
    :param prompt: Alternative terminal prefix for the environment.
    FNcCs(||_||_||_||_||_||_dS�N��system_site_packages�clear�symlinks�upgrade�with_pip�prompt)�selfrrrrr	r
�r�%/usr/lib64/python3.8/venv/__init__.py�__init__+szEnvBuilder.__init__cCsxtj�|�}|�|�}|j}d|_|�|�|�|�|jrF|�|�|j	s`|�
|�|�|�|rtd|_|�|�dS)z�
        Create a virtual environment in a directory.

        :param env_dir: The target directory to create an environment in.

        FTN)�os�path�abspath�ensure_directoriesr�create_configuration�setup_pythonr	�
_setup_pipr�
setup_scripts�
post_setup)r�env_dir�contextZtrue_system_site_packagesrrr
�create4s





zEnvBuilder.createcCs\t�|�D]L}tj�||�}tj�|�s4tj�|�r@t�|�q
tj�|�r
t�	|�q
dSr)
r�listdirr�join�islink�isfile�remove�isdir�shutilZrmtree)rr�fnrrr
�clear_directoryNszEnvBuilder.clear_directorycCs�dd�}tj�|�r$|jr$|�|�t��}||_tj�|�d|_	|j
dk	rT|j
n|j	}d||_
||�tj}tj�tj�
|��\}}||_||_||_tjdkr�d}d}	tj�|d	d
�}
n(d}d}	tj�|d
dtjdd�d
�}
tj�||	�|_}||�||
�tjdk�rXtjdk�rXtjdk�rXtj�|d�}tj�|��sXt�d
|�tj�||�|_}
||_tj�|
|�|_||
�|S)z�
        Create the directories for the environment.

        Returns a context object which holds paths in the environment,
        for use by subsequent logic.
        cSs@tj�|�st�|�n$tj�|�s0tj�|�r<td|��dS)NzUnable to create directory %r)rr�exists�makedirsrr�
ValueError)�drrr
�create_if_needed^sz7EnvBuilder.ensure_directories.<locals>.create_if_needed�Nz(%s) Zwin32ZScriptsZInclude�Libz
site-packages�binZinclude�libzpython%d.%d�l�posix�darwin�lib64)rrr$rr#�types�SimpleNamespacer�split�env_namer
�sys�_base_executabler�
executable�
python_dirZ
python_exe�platformr�version_infoZinc_path�maxsize�name�symlink�bin_path�bin_name�env_exe)rrr(rr
r7�dirnameZexenameZbinnameZincpathZlibpathrZ	link_path�binpathrrr
rVsL



��zEnvBuilder.ensure_directoriesc	Cs�tj�|jd�|_}t|ddd��j}|�d|j�|jrBd}nd}|�d|�|�d	t	j
d
d��|jd
k	r�|�d|j�d
��W5QRXd
S)aA
        Create a configuration file indicating where the environment's Python
        was copied from, and whether the system site-packages should be made
        available in the environment.

        :param context: The information for the environment creation request
                        being processed.
        z
pyvenv.cfg�w�utf-8)�encodingz
home = %s
�trueZfalsez"include-system-site-packages = %s
zversion = %d.%d.%d
N�z	prompt = �
)rrrrZcfg_path�open�writer8rr5r:r
)rrr�fZinclrrr
r�s	
zEnvBuilder.create_configuration�ntcCs�|j}|s�zRtj�|�s\|rPtj�|�tj�|�ks:t�t�tj�|�|�nt�||�Wn&tk
r�t	�
d||�d}YnX|r�t�||�dS)�Y
            Try symlinking a file, and if that fails, fall back to copying.
            �Unable to symlink %r to %rTN)
rrrrrA�AssertionErrorr=�basename�	Exception�logger�warningr!�copyfile)r�src�dst�relative_symlinks_okZ
force_copyrrr
�symlink_or_copy�s
zEnvBuilder.symlink_or_copycCs|tj�|�otj�|�}|jr�|s�tj�|�s�zH|rhtj�|�tj�|�ksRt�t�tj�	|�|�nt�||�WdSt
k
r�t�d||�YnXtj�
tj�	|��\}}tj�tj�t�dd||�}t�d�s�tj�|��sD|�d��r
d|}|dd�}|dk�rd	}n|d
k�r(d}tj�tj�|�||�}n|}tj�|��sl|�sht�d|�dSt�||�dS)
rMNrN�scriptsrLTZ_d����pythonZvenvlauncherZpythonwZ
venvwlauncherzUnable to copy %r)rr�lexistsr$rrrArOr=rPrQrRrS�splitextr�__file__�	sysconfig�is_python_buildr�endswithr!rT)rrUrVrWZbad_srcrPZextZsrcfnrrr
rX�s>�

cCs�|j}|j}|j}|j}tjdkr�||j|�tj�|�sFt�	|d�dD]F}tj�
||�}tj�|�sJ||j|dd�tj�|�sJt�	|d�qJ�n|jr�dd�t�
|�D�}t�d�r�dd�|D�}nd	d
ddg}|D]2}tj�
||�}tj�|�r�||tj�
||��q�t�d��r�t�|j�D]z\}	}
}d
|k�r&tj�|	�}tj�
|jd|�}tj�|��spt�|�tj�
|	d
�}tj�
|d
�}
t�||
��q��q&dS)z�
        Set up a Python executable in the environment.

        :param context: The information for the environment creation request
                        being processed.
        rLi�)r[Zpython3T)rWcSs,g|]$}tj�tj�|�d�dkr|�qS)r))�.exez.dll)rr�normcaser]��.0rKrrr
�
<listcomp>�s�z+EnvBuilder.setup_python.<locals>.<listcomp>cSs"g|]}tj�|��d�r|�qS))r[Z	vcruntime)rrrc�
startswithrdrrr
rfs�z
python.exezpython_d.exezpythonw.exez
pythonw_d.exezinit.tclr*N)r>r@rXr8rr<r7rr�chmodrr$rrr_r`r\�walkrPrr%r!rT)rrrBrZcopierrA�suffix�suffixesrU�root�dirs�filesZtcldirrVrrr
r�sP
�
��

zEnvBuilder.setup_pythoncCs$|jddddg}tj|tjd�dS)z1Installs or upgrades pip in a virtual environmentz-ImZ	ensurepip�	--upgradez
--default-pip)�stderrN)r@�
subprocessZcheck_outputZSTDOUT)rr�cmdrrr
rs
�zEnvBuilder._setup_pipcCs2tj�tj�t��}tj�|d�}|�||�dS)a�
        Set up scripts into the created environment from a directory.

        This method installs the default scripts into the environment
        being created. You can prevent the default installation by overriding
        this method if you really need to, or if you need to specify
        a different location for the scripts to install. By default, the
        'scripts' directory in the venv package is used as the source of
        scripts to install.
        rYN)rrrrAr^r�install_scripts)rrrrrr
r#szEnvBuilder.setup_scriptscCsdS)a
        Hook for post-setup modification of the venv. Subclasses may install
        additional packages or scripts here, add activation shell scripts, etc.

        :param context: The information for the environment creation request
                        being processed.
        Nr)rrrrr
r2szEnvBuilder.post_setupcCsJ|�d|j�}|�d|j�}|�d|j�}|�d|j�}|�d|j�}|S)ai
        Replace variable placeholders in script text with context-specific
        variables.

        Return the text passed in , but with variables replaced.

        :param text: The text in which to replace placeholder variables.
        :param context: The information for the environment creation request
                        being processed.
        Z__VENV_DIR__Z
__VENV_NAME__Z__VENV_PROMPT__Z__VENV_BIN_NAME__Z__VENV_PYTHON__)�replacerr4r
r?r@)r�textrrrr
�replace_variables<szEnvBuilder.replace_variablescCs�|j}t|�}t�|�D�]�\}}}||krX|dd�D]}|dtjfkr8|�|�q8q|D�]H}	tjdkr�|	�d�r�|	�d�r�q\tj�	||	�}
||d��
tj�dd�}|s�|}ntjj	|f|��}tj�|�s�t�
|�tj�	||	�}
t|
d��}	|	��}W5QRX|
�d��srz$|�d�}|�||�}|�d�}Wn6tk
�rp}zd}t�d	|
|�W5d}~XYnX|dk	r\t|
d
��}	|	�|�W5QRXt�|
|
�q\qdS)as
        Install scripts into the created environment from a directory.

        :param context: The information for the environment creation request
                        being processed.
        :param path:    Absolute pathname of a directory containing script.
                        Scripts in the 'common' subdirectory of this directory,
                        and those in the directory named for the platform
                        being run on, are installed in the created environment.
                        Placeholder variables are replaced with environment-
                        specific values.
        N�commonrLr[)rbz.pdbr-�rbrDz+unable to copy script %r, may be binary: %s�wb)r>�lenrrir<rrgrarrr3�sepr$r%rI�read�decoderv�encode�UnicodeErrorrRrSrJr!Zcopymode)rrrrBZplenrlrmrnr'rKZsrcfilerjZdstdirZdstfile�data�errr
rsNsL

�

�zEnvBuilder.install_scripts)FFFFFN)F)F)�__name__�
__module__�__qualname__�__doc__rrr#rrrr<rXrrrrrvrsrrrr
rs(�
	4

+<	
rFcCs t|||||d�}|�|�dS)z,Create a virtual environment in a directory.)rrrr	r
N)rr)rrrrr	r
�builderrrr
r�s�rc	Cs^d}tjdkrd}nttd�s"d}|s2td���n(ddl}|jtddd	�}|jd
ddd
d�|jdddddd�tj	dkr�d}nd}|�
�}|jd|dddd�|jd|dddd�|jdddddd�|jddddd d�|jd!d"ddd#d$�|jd%d&d'�|�|�}|j�r"|j
�r"td(��t|j|j
|j|j|j|jd)�}|jD]}|�|��qHdS)*NT)rGrGF�base_prefixz.This script is only for use with Python >= 3.3rzFCreates virtual Python environments in one or more target directories.z|Once an environment has been created, you may wish to activate it, e.g. by sourcing an activate script in its bin directory.)�progZdescriptionZepilogrmZENV_DIR�+z)A directory to create the environment in.)�metavar�nargs�helpz--system-site-packages�
store_true�system_sitezDGive the virtual environment access to the system site-packages dir.)�default�action�destr�rLz
--symlinksrz[Try to use symlinks rather than copies, when symlinks are not the default for the platform.z--copiesZstore_falsez\Try to use copies rather than symlinks, even when symlinks are the default for the platform.z--clearrzcDelete the contents of the environment directory if it already exists, before environment creation.rorzlUpgrade the environment directory to use this version of Python, assuming Python has been upgraded in-place.z
--without-pipr	z]Skips installing or upgrading pip in the virtual environment (pip is bootstrapped by default))r�r�r�r�z--promptz;Provides an alternative prompt prefix for this environment.)r�z1you cannot supply --upgrade and --clear together.r)r5r:�hasattrr&�argparse�ArgumentParserr��add_argumentrr<Zadd_mutually_exclusive_group�
parse_argsrrrr�rr	r
rmr)	�argsZ
compatibler��parserZuse_symlinks�groupZoptionsr�r'rrr
�main�s|

�

��
�
�
�
���
�
r��__main__r)z	Error: %s)�file)FFFFN)N)r�Zloggingrr!rqr5r_r1Z	getLoggerr�rRrrr�ZrcrQr��printrp�exitrrrr
�<module>s2
q�

H$venv/__pycache__/__main__.cpython-38.pyc000064400000000513151153537470014114 0ustar00U

e5d��
@sjddlZddlmZdZze�dZWn4ek
rZZzedeejd�W5dZ[XYnXe�e�dS)�N�)�mainz	Error: %s)�file)	�sys�rZrc�	Exception�e�print�stderr�exit�rr�%/usr/lib64/python3.8/venv/__main__.py�<module>s$venv/scripts/common/Activate.ps1000064400000021202151153537470012676 0ustar00<#
.Synopsis
Activate a Python virtual environment for the current PowerShell session.

.Description
Pushes the python executable for a virtual environment to the front of the
$Env:PATH environment variable and sets the prompt to signify that you are
in a Python virtual environment. Makes use of the command line switches as
well as the `pyvenv.cfg` file values present in the virtual environment.

.Parameter VenvDir
Path to the directory that contains the virtual environment to activate. The
default value for this is the parent of the directory that the Activate.ps1
script is located within.

.Parameter Prompt
The prompt prefix to display when this virtual environment is activated. By
default, this prompt is the name of the virtual environment folder (VenvDir)
surrounded by parentheses and followed by a single space (ie. '(.venv) ').

.Example
Activate.ps1
Activates the Python virtual environment that contains the Activate.ps1 script.

.Example
Activate.ps1 -Verbose
Activates the Python virtual environment that contains the Activate.ps1 script,
and shows extra information about the activation as it executes.

.Example
Activate.ps1 -VenvDir C:\Users\MyUser\Common\.venv
Activates the Python virtual environment located in the specified location.

.Example
Activate.ps1 -Prompt "MyPython"
Activates the Python virtual environment that contains the Activate.ps1 script,
and prefixes the current prompt with the specified string (surrounded in
parentheses) while the virtual environment is active.

.Notes
On Windows, it may be required to enable this Activate.ps1 script by setting the
execution policy for the user. You can do this by issuing the following PowerShell
command:

PS C:\> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

For more information on Execution Policies: 
https://go.microsoft.com/fwlink/?LinkID=135170

#>
Param(
    [Parameter(Mandatory = $false)]
    [String]
    $VenvDir,
    [Parameter(Mandatory = $false)]
    [String]
    $Prompt
)

<# Function declarations --------------------------------------------------- #>

<#
.Synopsis
Remove all shell session elements added by the Activate script, including the
addition of the virtual environment's Python executable from the beginning of
the PATH variable.

.Parameter NonDestructive
If present, do not remove this function from the global namespace for the
session.

#>
function global:deactivate ([switch]$NonDestructive) {
    # Revert to original values

    # The prior prompt:
    if (Test-Path -Path Function:_OLD_VIRTUAL_PROMPT) {
        Copy-Item -Path Function:_OLD_VIRTUAL_PROMPT -Destination Function:prompt
        Remove-Item -Path Function:_OLD_VIRTUAL_PROMPT
    }

    # The prior PYTHONHOME:
    if (Test-Path -Path Env:_OLD_VIRTUAL_PYTHONHOME) {
        Copy-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME -Destination Env:PYTHONHOME
        Remove-Item -Path Env:_OLD_VIRTUAL_PYTHONHOME
    }

    # The prior PATH:
    if (Test-Path -Path Env:_OLD_VIRTUAL_PATH) {
        Copy-Item -Path Env:_OLD_VIRTUAL_PATH -Destination Env:PATH
        Remove-Item -Path Env:_OLD_VIRTUAL_PATH
    }

    # Just remove the VIRTUAL_ENV altogether:
    if (Test-Path -Path Env:VIRTUAL_ENV) {
        Remove-Item -Path env:VIRTUAL_ENV
    }

    # Just remove the _PYTHON_VENV_PROMPT_PREFIX altogether:
    if (Get-Variable -Name "_PYTHON_VENV_PROMPT_PREFIX" -ErrorAction SilentlyContinue) {
        Remove-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Scope Global -Force
    }

    # Leave deactivate function in the global namespace if requested:
    if (-not $NonDestructive) {
        Remove-Item -Path function:deactivate
    }
}

<#
.Description
Get-PyVenvConfig parses the values from the pyvenv.cfg file located in the
given folder, and returns them in a map.

For each line in the pyvenv.cfg file, if that line can be parsed into exactly
two strings separated by `=` (with any amount of whitespace surrounding the =)
then it is considered a `key = value` line. The left hand string is the key,
the right hand is the value.

If the value starts with a `'` or a `"` then the first and last character is
stripped from the value before being captured.

.Parameter ConfigDir
Path to the directory that contains the `pyvenv.cfg` file.
#>
function Get-PyVenvConfig(
    [String]
    $ConfigDir
) {
    Write-Verbose "Given ConfigDir=$ConfigDir, obtain values in pyvenv.cfg"

    # Ensure the file exists, and issue a warning if it doesn't (but still allow the function to continue).
    $pyvenvConfigPath = Join-Path -Resolve -Path $ConfigDir -ChildPath 'pyvenv.cfg' -ErrorAction Continue

    # An empty map will be returned if no config file is found.
    $pyvenvConfig = @{ }

    if ($pyvenvConfigPath) {

        Write-Verbose "File exists, parse `key = value` lines"
        $pyvenvConfigContent = Get-Content -Path $pyvenvConfigPath

        $pyvenvConfigContent | ForEach-Object {
            $keyval = $PSItem -split "\s*=\s*", 2
            if ($keyval[0] -and $keyval[1]) {
                $val = $keyval[1]

                # Remove extraneous quotations around a string value.
                if ("'""".Contains($val.Substring(0, 1))) {
                    $val = $val.Substring(1, $val.Length - 2)
                }

                $pyvenvConfig[$keyval[0]] = $val
                Write-Verbose "Adding Key: '$($keyval[0])'='$val'"
            }
        }
    }
    return $pyvenvConfig
}


<# Begin Activate script --------------------------------------------------- #>

# Determine the containing directory of this script
$VenvExecPath = Split-Path -Parent $MyInvocation.MyCommand.Definition
$VenvExecDir = Get-Item -Path $VenvExecPath

Write-Verbose "Activation script is located in path: '$VenvExecPath'"
Write-Verbose "VenvExecDir Fullname: '$($VenvExecDir.FullName)"
Write-Verbose "VenvExecDir Name: '$($VenvExecDir.Name)"

# Set values required in priority: CmdLine, ConfigFile, Default
# First, get the location of the virtual environment, it might not be
# VenvExecDir if specified on the command line.
if ($VenvDir) {
    Write-Verbose "VenvDir given as parameter, using '$VenvDir' to determine values"
}
else {
    Write-Verbose "VenvDir not given as a parameter, using parent directory name as VenvDir."
    $VenvDir = $VenvExecDir.Parent.FullName.TrimEnd("\\/")
    Write-Verbose "VenvDir=$VenvDir"
}

# Next, read the `pyvenv.cfg` file to determine any required value such
# as `prompt`.
$pyvenvCfg = Get-PyVenvConfig -ConfigDir $VenvDir

# Next, set the prompt from the command line, or the config file, or
# just use the name of the virtual environment folder.
if ($Prompt) {
    Write-Verbose "Prompt specified as argument, using '$Prompt'"
}
else {
    Write-Verbose "Prompt not specified as argument to script, checking pyvenv.cfg value"
    if ($pyvenvCfg -and $pyvenvCfg['prompt']) {
        Write-Verbose "  Setting based on value in pyvenv.cfg='$($pyvenvCfg['prompt'])'"
        $Prompt = $pyvenvCfg['prompt'];
    }
    else {
        Write-Verbose "  Setting prompt based on parent's directory's name. (Is the directory name passed to venv module when creating the virutal environment)"
        Write-Verbose "  Got leaf-name of $VenvDir='$(Split-Path -Path $venvDir -Leaf)'"
        $Prompt = Split-Path -Path $venvDir -Leaf
    }
}

Write-Verbose "Prompt = '$Prompt'"
Write-Verbose "VenvDir='$VenvDir'"

# Deactivate any currently active virtual environment, but leave the
# deactivate function in place.
deactivate -nondestructive

# Now set the environment variable VIRTUAL_ENV, used by many tools to determine
# that there is an activated venv.
$env:VIRTUAL_ENV = $VenvDir

if (-not $Env:VIRTUAL_ENV_DISABLE_PROMPT) {

    Write-Verbose "Setting prompt to '$Prompt'"

    # Set the prompt to include the env name
    # Make sure _OLD_VIRTUAL_PROMPT is global
    function global:_OLD_VIRTUAL_PROMPT { "" }
    Copy-Item -Path function:prompt -Destination function:_OLD_VIRTUAL_PROMPT
    New-Variable -Name _PYTHON_VENV_PROMPT_PREFIX -Description "Python virtual environment prompt prefix" -Scope Global -Option ReadOnly -Visibility Public -Value $Prompt

    function global:prompt {
        Write-Host -NoNewline -ForegroundColor Green "($_PYTHON_VENV_PROMPT_PREFIX) "
        _OLD_VIRTUAL_PROMPT
    }
}

# Clear PYTHONHOME
if (Test-Path -Path Env:PYTHONHOME) {
    Copy-Item -Path Env:PYTHONHOME -Destination Env:_OLD_VIRTUAL_PYTHONHOME
    Remove-Item -Path Env:PYTHONHOME
}

# Add the venv to the PATH
Copy-Item -Path Env:PATH -Destination Env:_OLD_VIRTUAL_PATH
$Env:PATH = "$VenvExecDir$([System.IO.Path]::PathSeparator)$Env:PATH"
venv/scripts/common/activate000064400000004231151153537470012237 0ustar00# This file must be used with "source bin/activate" *from bash*
# you cannot run it directly

deactivate () {
    # reset old environment variables
    if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then
        PATH="${_OLD_VIRTUAL_PATH:-}"
        export PATH
        unset _OLD_VIRTUAL_PATH
    fi
    if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then
        PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}"
        export PYTHONHOME
        unset _OLD_VIRTUAL_PYTHONHOME
    fi

    # This should detect bash and zsh, which have a hash command that must
    # be called to get it to forget past commands.  Without forgetting
    # past commands the $PATH changes we made may not be respected
    if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
        hash -r
    fi

    if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
        PS1="${_OLD_VIRTUAL_PS1:-}"
        export PS1
        unset _OLD_VIRTUAL_PS1
    fi

    unset VIRTUAL_ENV
    if [ ! "${1:-}" = "nondestructive" ] ; then
    # Self destruct!
        unset -f deactivate
    fi
}

# unset irrelevant variables
deactivate nondestructive

VIRTUAL_ENV="__VENV_DIR__"
export VIRTUAL_ENV

_OLD_VIRTUAL_PATH="$PATH"
PATH="$VIRTUAL_ENV/__VENV_BIN_NAME__:$PATH"
export PATH

# unset PYTHONHOME if set
# this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
# could use `if (set -u; : $PYTHONHOME) ;` in bash
if [ -n "${PYTHONHOME:-}" ] ; then
    _OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}"
    unset PYTHONHOME
fi

if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
    _OLD_VIRTUAL_PS1="${PS1:-}"
    if [ "x__VENV_PROMPT__" != x ] ; then
	PS1="__VENV_PROMPT__${PS1:-}"
    else
    if [ "`basename \"$VIRTUAL_ENV\"`" = "__" ] ; then
        # special case for Aspen magic directories
        # see https://aspen.io/
        PS1="[`basename \`dirname \"$VIRTUAL_ENV\"\``] $PS1"
    else
        PS1="(`basename \"$VIRTUAL_ENV\"`)$PS1"
    fi
    fi
    export PS1
fi

# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands.  Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
    hash -r
fi
venv/scripts/posix/activate.fish000064400000004545151153537470013051 0ustar00# This file must be used with ". bin/activate.fish" *from fish* (http://fishshell.org)
# you cannot run it directly

function deactivate  -d "Exit virtualenv and return to normal shell environment"
    # reset old environment variables
    if test -n "$_OLD_VIRTUAL_PATH"
        set -gx PATH $_OLD_VIRTUAL_PATH
        set -e _OLD_VIRTUAL_PATH
    end
    if test -n "$_OLD_VIRTUAL_PYTHONHOME"
        set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME
        set -e _OLD_VIRTUAL_PYTHONHOME
    end

    if test -n "$_OLD_FISH_PROMPT_OVERRIDE"
        functions -e fish_prompt
        set -e _OLD_FISH_PROMPT_OVERRIDE
        functions -c _old_fish_prompt fish_prompt
        functions -e _old_fish_prompt
    end

    set -e VIRTUAL_ENV
    if test "$argv[1]" != "nondestructive"
        # Self destruct!
        functions -e deactivate
    end
end

# unset irrelevant variables
deactivate nondestructive

set -gx VIRTUAL_ENV "__VENV_DIR__"

set -gx _OLD_VIRTUAL_PATH $PATH
set -gx PATH "$VIRTUAL_ENV/__VENV_BIN_NAME__" $PATH

# unset PYTHONHOME if set
if set -q PYTHONHOME
    set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME
    set -e PYTHONHOME
end

if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
    # fish uses a function instead of an env var to generate the prompt.

    # save the current fish_prompt function as the function _old_fish_prompt
    functions -c fish_prompt _old_fish_prompt

    # with the original prompt function renamed, we can override with our own.
    function fish_prompt
        # Save the return status of the last command
        set -l old_status $status

        # Prompt override?
        if test -n "__VENV_PROMPT__"
            printf "%s%s" "__VENV_PROMPT__" (set_color normal)
        else
            # ...Otherwise, prepend env
            set -l _checkbase (basename "$VIRTUAL_ENV")
            if test $_checkbase = "__"
                # special case for Aspen magic directories
                # see https://aspen.io/
                printf "%s[%s]%s " (set_color -b blue white) (basename (dirname "$VIRTUAL_ENV")) (set_color normal)
            else
                printf "%s(%s)%s" (set_color -b blue white) (basename "$VIRTUAL_ENV") (set_color normal)
            end
        end

        # Restore the return status of the previous command.
        echo "exit $old_status" | .
        _old_fish_prompt
    end

    set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV"
end
venv/scripts/posix/activate.csh000064400000002347151153537470012673 0ustar00# This file must be used with "source bin/activate.csh" *from csh*.
# You cannot run it directly.
# Created by Davide Di Blasi <davidedb@gmail.com>.
# Ported to Python 3.3 venv by Andrew Svetlov <andrew.svetlov@gmail.com>

alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate'

# Unset irrelevant variables.
deactivate nondestructive

setenv VIRTUAL_ENV "__VENV_DIR__"

set _OLD_VIRTUAL_PATH="$PATH"
setenv PATH "$VIRTUAL_ENV/__VENV_BIN_NAME__:$PATH"


set _OLD_VIRTUAL_PROMPT="$prompt"

if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then
    if ("__VENV_NAME__" != "") then
        set env_name = "__VENV_NAME__"
    else
        if (`basename "VIRTUAL_ENV"` == "__") then
            # special case for Aspen magic directories
            # see https://aspen.io/
            set env_name = `basename \`dirname "$VIRTUAL_ENV"\``
        else
            set env_name = `basename "$VIRTUAL_ENV"`
        endif
    endif
    set prompt = "[$env_name] $prompt"
    unset env_name
endif

alias pydoc python -m pydoc

rehash
configparser.py000064400000152146151153537470007624 0ustar00"""Configuration file parser.

A configuration file consists of sections, lead by a "[section]" header,
and followed by "name: value" entries, with continuations and such in
the style of RFC 822.

Intrinsic defaults can be specified by passing them into the
ConfigParser constructor as a dictionary.

class:

ConfigParser -- responsible for parsing a list of
                    configuration files, and managing the parsed database.

    methods:

    __init__(defaults=None, dict_type=_default_dict, allow_no_value=False,
             delimiters=('=', ':'), comment_prefixes=('#', ';'),
             inline_comment_prefixes=None, strict=True,
             empty_lines_in_values=True, default_section='DEFAULT',
             interpolation=<unset>, converters=<unset>):
        Create the parser. When `defaults' is given, it is initialized into the
        dictionary or intrinsic defaults. The keys must be strings, the values
        must be appropriate for %()s string interpolation.

        When `dict_type' is given, it will be used to create the dictionary
        objects for the list of sections, for the options within a section, and
        for the default values.

        When `delimiters' is given, it will be used as the set of substrings
        that divide keys from values.

        When `comment_prefixes' is given, it will be used as the set of
        substrings that prefix comments in empty lines. Comments can be
        indented.

        When `inline_comment_prefixes' is given, it will be used as the set of
        substrings that prefix comments in non-empty lines.

        When `strict` is True, the parser won't allow for any section or option
        duplicates while reading from a single source (file, string or
        dictionary). Default is True.

        When `empty_lines_in_values' is False (default: True), each empty line
        marks the end of an option. Otherwise, internal empty lines of
        a multiline option are kept as part of the value.

        When `allow_no_value' is True (default: False), options without
        values are accepted; the value presented for these is None.

        When `default_section' is given, the name of the special section is
        named accordingly. By default it is called ``"DEFAULT"`` but this can
        be customized to point to any other valid section name. Its current
        value can be retrieved using the ``parser_instance.default_section``
        attribute and may be modified at runtime.

        When `interpolation` is given, it should be an Interpolation subclass
        instance. It will be used as the handler for option value
        pre-processing when using getters. RawConfigParser objects don't do
        any sort of interpolation, whereas ConfigParser uses an instance of
        BasicInterpolation. The library also provides a ``zc.buildbot``
        inspired ExtendedInterpolation implementation.

        When `converters` is given, it should be a dictionary where each key
        represents the name of a type converter and each value is a callable
        implementing the conversion from string to the desired datatype. Every
        converter gets its corresponding get*() method on the parser object and
        section proxies.

    sections()
        Return all the configuration section names, sans DEFAULT.

    has_section(section)
        Return whether the given section exists.

    has_option(section, option)
        Return whether the given option exists in the given section.

    options(section)
        Return list of configuration options for the named section.

    read(filenames, encoding=None)
        Read and parse the iterable of named configuration files, given by
        name.  A single filename is also allowed.  Non-existing files
        are ignored.  Return list of successfully read files.

    read_file(f, filename=None)
        Read and parse one configuration file, given as a file object.
        The filename defaults to f.name; it is only used in error
        messages (if f has no `name' attribute, the string `<???>' is used).

    read_string(string)
        Read configuration from a given string.

    read_dict(dictionary)
        Read configuration from a dictionary. Keys are section names,
        values are dictionaries with keys and values that should be present
        in the section. If the used dictionary type preserves order, sections
        and their keys will be added in order. Values are automatically
        converted to strings.

    get(section, option, raw=False, vars=None, fallback=_UNSET)
        Return a string value for the named option.  All % interpolations are
        expanded in the return values, based on the defaults passed into the
        constructor and the DEFAULT section.  Additional substitutions may be
        provided using the `vars' argument, which must be a dictionary whose
        contents override any pre-existing defaults. If `option' is a key in
        `vars', the value from `vars' is used.

    getint(section, options, raw=False, vars=None, fallback=_UNSET)
        Like get(), but convert value to an integer.

    getfloat(section, options, raw=False, vars=None, fallback=_UNSET)
        Like get(), but convert value to a float.

    getboolean(section, options, raw=False, vars=None, fallback=_UNSET)
        Like get(), but convert value to a boolean (currently case
        insensitively defined as 0, false, no, off for False, and 1, true,
        yes, on for True).  Returns False or True.

    items(section=_UNSET, raw=False, vars=None)
        If section is given, return a list of tuples with (name, value) for
        each option in the section. Otherwise, return a list of tuples with
        (section_name, section_proxy) for each section, including DEFAULTSECT.

    remove_section(section)
        Remove the given file section and all its options.

    remove_option(section, option)
        Remove the given option from the given section.

    set(section, option, value)
        Set the given option.

    write(fp, space_around_delimiters=True)
        Write the configuration state in .ini format. If
        `space_around_delimiters' is True (the default), delimiters
        between keys and values are surrounded by spaces.
"""

from collections.abc import MutableMapping
from collections import ChainMap as _ChainMap
import functools
import io
import itertools
import os
import re
import sys
import warnings

__all__ = ["NoSectionError", "DuplicateOptionError", "DuplicateSectionError",
           "NoOptionError", "InterpolationError", "InterpolationDepthError",
           "InterpolationMissingOptionError", "InterpolationSyntaxError",
           "ParsingError", "MissingSectionHeaderError",
           "ConfigParser", "SafeConfigParser", "RawConfigParser",
           "Interpolation", "BasicInterpolation",  "ExtendedInterpolation",
           "LegacyInterpolation", "SectionProxy", "ConverterMapping",
           "DEFAULTSECT", "MAX_INTERPOLATION_DEPTH"]

_default_dict = dict
DEFAULTSECT = "DEFAULT"

MAX_INTERPOLATION_DEPTH = 10



# exception classes
class Error(Exception):
    """Base class for ConfigParser exceptions."""

    def __init__(self, msg=''):
        self.message = msg
        Exception.__init__(self, msg)

    def __repr__(self):
        return self.message

    __str__ = __repr__


class NoSectionError(Error):
    """Raised when no section matches a requested option."""

    def __init__(self, section):
        Error.__init__(self, 'No section: %r' % (section,))
        self.section = section
        self.args = (section, )


class DuplicateSectionError(Error):
    """Raised when a section is repeated in an input source.

    Possible repetitions that raise this exception are: multiple creation
    using the API or in strict parsers when a section is found more than once
    in a single input file, string or dictionary.
    """

    def __init__(self, section, source=None, lineno=None):
        msg = [repr(section), " already exists"]
        if source is not None:
            message = ["While reading from ", repr(source)]
            if lineno is not None:
                message.append(" [line {0:2d}]".format(lineno))
            message.append(": section ")
            message.extend(msg)
            msg = message
        else:
            msg.insert(0, "Section ")
        Error.__init__(self, "".join(msg))
        self.section = section
        self.source = source
        self.lineno = lineno
        self.args = (section, source, lineno)


class DuplicateOptionError(Error):
    """Raised by strict parsers when an option is repeated in an input source.

    Current implementation raises this exception only when an option is found
    more than once in a single file, string or dictionary.
    """

    def __init__(self, section, option, source=None, lineno=None):
        msg = [repr(option), " in section ", repr(section),
               " already exists"]
        if source is not None:
            message = ["While reading from ", repr(source)]
            if lineno is not None:
                message.append(" [line {0:2d}]".format(lineno))
            message.append(": option ")
            message.extend(msg)
            msg = message
        else:
            msg.insert(0, "Option ")
        Error.__init__(self, "".join(msg))
        self.section = section
        self.option = option
        self.source = source
        self.lineno = lineno
        self.args = (section, option, source, lineno)


class NoOptionError(Error):
    """A requested option was not found."""

    def __init__(self, option, section):
        Error.__init__(self, "No option %r in section: %r" %
                       (option, section))
        self.option = option
        self.section = section
        self.args = (option, section)


class InterpolationError(Error):
    """Base class for interpolation-related exceptions."""

    def __init__(self, option, section, msg):
        Error.__init__(self, msg)
        self.option = option
        self.section = section
        self.args = (option, section, msg)


class InterpolationMissingOptionError(InterpolationError):
    """A string substitution required a setting which was not available."""

    def __init__(self, option, section, rawval, reference):
        msg = ("Bad value substitution: option {!r} in section {!r} contains "
               "an interpolation key {!r} which is not a valid option name. "
               "Raw value: {!r}".format(option, section, reference, rawval))
        InterpolationError.__init__(self, option, section, msg)
        self.reference = reference
        self.args = (option, section, rawval, reference)


class InterpolationSyntaxError(InterpolationError):
    """Raised when the source text contains invalid syntax.

    Current implementation raises this exception when the source text into
    which substitutions are made does not conform to the required syntax.
    """


class InterpolationDepthError(InterpolationError):
    """Raised when substitutions are nested too deeply."""

    def __init__(self, option, section, rawval):
        msg = ("Recursion limit exceeded in value substitution: option {!r} "
               "in section {!r} contains an interpolation key which "
               "cannot be substituted in {} steps. Raw value: {!r}"
               "".format(option, section, MAX_INTERPOLATION_DEPTH,
                         rawval))
        InterpolationError.__init__(self, option, section, msg)
        self.args = (option, section, rawval)


class ParsingError(Error):
    """Raised when a configuration file does not follow legal syntax."""

    def __init__(self, source=None, filename=None):
        # Exactly one of `source'/`filename' arguments has to be given.
        # `filename' kept for compatibility.
        if filename and source:
            raise ValueError("Cannot specify both `filename' and `source'. "
                             "Use `source'.")
        elif not filename and not source:
            raise ValueError("Required argument `source' not given.")
        elif filename:
            source = filename
        Error.__init__(self, 'Source contains parsing errors: %r' % source)
        self.source = source
        self.errors = []
        self.args = (source, )

    @property
    def filename(self):
        """Deprecated, use `source'."""
        warnings.warn(
            "The 'filename' attribute will be removed in future versions.  "
            "Use 'source' instead.",
            DeprecationWarning, stacklevel=2
        )
        return self.source

    @filename.setter
    def filename(self, value):
        """Deprecated, user `source'."""
        warnings.warn(
            "The 'filename' attribute will be removed in future versions.  "
            "Use 'source' instead.",
            DeprecationWarning, stacklevel=2
        )
        self.source = value

    def append(self, lineno, line):
        self.errors.append((lineno, line))
        self.message += '\n\t[line %2d]: %s' % (lineno, line)


class MissingSectionHeaderError(ParsingError):
    """Raised when a key-value pair is found before any section header."""

    def __init__(self, filename, lineno, line):
        Error.__init__(
            self,
            'File contains no section headers.\nfile: %r, line: %d\n%r' %
            (filename, lineno, line))
        self.source = filename
        self.lineno = lineno
        self.line = line
        self.args = (filename, lineno, line)


# Used in parser getters to indicate the default behaviour when a specific
# option is not found it to raise an exception. Created to enable `None' as
# a valid fallback value.
_UNSET = object()


class Interpolation:
    """Dummy interpolation that passes the value through with no changes."""

    def before_get(self, parser, section, option, value, defaults):
        return value

    def before_set(self, parser, section, option, value):
        return value

    def before_read(self, parser, section, option, value):
        return value

    def before_write(self, parser, section, option, value):
        return value


class BasicInterpolation(Interpolation):
    """Interpolation as implemented in the classic ConfigParser.

    The option values can contain format strings which refer to other values in
    the same section, or values in the special default section.

    For example:

        something: %(dir)s/whatever

    would resolve the "%(dir)s" to the value of dir.  All reference
    expansions are done late, on demand. If a user needs to use a bare % in
    a configuration file, she can escape it by writing %%. Other % usage
    is considered a user error and raises `InterpolationSyntaxError'."""

    _KEYCRE = re.compile(r"%\(([^)]+)\)s")

    def before_get(self, parser, section, option, value, defaults):
        L = []
        self._interpolate_some(parser, option, L, value, section, defaults, 1)
        return ''.join(L)

    def before_set(self, parser, section, option, value):
        tmp_value = value.replace('%%', '') # escaped percent signs
        tmp_value = self._KEYCRE.sub('', tmp_value) # valid syntax
        if '%' in tmp_value:
            raise ValueError("invalid interpolation syntax in %r at "
                             "position %d" % (value, tmp_value.find('%')))
        return value

    def _interpolate_some(self, parser, option, accum, rest, section, map,
                          depth):
        rawval = parser.get(section, option, raw=True, fallback=rest)
        if depth > MAX_INTERPOLATION_DEPTH:
            raise InterpolationDepthError(option, section, rawval)
        while rest:
            p = rest.find("%")
            if p < 0:
                accum.append(rest)
                return
            if p > 0:
                accum.append(rest[:p])
                rest = rest[p:]
            # p is no longer used
            c = rest[1:2]
            if c == "%":
                accum.append("%")
                rest = rest[2:]
            elif c == "(":
                m = self._KEYCRE.match(rest)
                if m is None:
                    raise InterpolationSyntaxError(option, section,
                        "bad interpolation variable reference %r" % rest)
                var = parser.optionxform(m.group(1))
                rest = rest[m.end():]
                try:
                    v = map[var]
                except KeyError:
                    raise InterpolationMissingOptionError(
                        option, section, rawval, var) from None
                if "%" in v:
                    self._interpolate_some(parser, option, accum, v,
                                           section, map, depth + 1)
                else:
                    accum.append(v)
            else:
                raise InterpolationSyntaxError(
                    option, section,
                    "'%%' must be followed by '%%' or '(', "
                    "found: %r" % (rest,))


class ExtendedInterpolation(Interpolation):
    """Advanced variant of interpolation, supports the syntax used by
    `zc.buildout'. Enables interpolation between sections."""

    _KEYCRE = re.compile(r"\$\{([^}]+)\}")

    def before_get(self, parser, section, option, value, defaults):
        L = []
        self._interpolate_some(parser, option, L, value, section, defaults, 1)
        return ''.join(L)

    def before_set(self, parser, section, option, value):
        tmp_value = value.replace('$$', '') # escaped dollar signs
        tmp_value = self._KEYCRE.sub('', tmp_value) # valid syntax
        if '$' in tmp_value:
            raise ValueError("invalid interpolation syntax in %r at "
                             "position %d" % (value, tmp_value.find('$')))
        return value

    def _interpolate_some(self, parser, option, accum, rest, section, map,
                          depth):
        rawval = parser.get(section, option, raw=True, fallback=rest)
        if depth > MAX_INTERPOLATION_DEPTH:
            raise InterpolationDepthError(option, section, rawval)
        while rest:
            p = rest.find("$")
            if p < 0:
                accum.append(rest)
                return
            if p > 0:
                accum.append(rest[:p])
                rest = rest[p:]
            # p is no longer used
            c = rest[1:2]
            if c == "$":
                accum.append("$")
                rest = rest[2:]
            elif c == "{":
                m = self._KEYCRE.match(rest)
                if m is None:
                    raise InterpolationSyntaxError(option, section,
                        "bad interpolation variable reference %r" % rest)
                path = m.group(1).split(':')
                rest = rest[m.end():]
                sect = section
                opt = option
                try:
                    if len(path) == 1:
                        opt = parser.optionxform(path[0])
                        v = map[opt]
                    elif len(path) == 2:
                        sect = path[0]
                        opt = parser.optionxform(path[1])
                        v = parser.get(sect, opt, raw=True)
                    else:
                        raise InterpolationSyntaxError(
                            option, section,
                            "More than one ':' found: %r" % (rest,))
                except (KeyError, NoSectionError, NoOptionError):
                    raise InterpolationMissingOptionError(
                        option, section, rawval, ":".join(path)) from None
                if "$" in v:
                    self._interpolate_some(parser, opt, accum, v, sect,
                                           dict(parser.items(sect, raw=True)),
                                           depth + 1)
                else:
                    accum.append(v)
            else:
                raise InterpolationSyntaxError(
                    option, section,
                    "'$' must be followed by '$' or '{', "
                    "found: %r" % (rest,))


class LegacyInterpolation(Interpolation):
    """Deprecated interpolation used in old versions of ConfigParser.
    Use BasicInterpolation or ExtendedInterpolation instead."""

    _KEYCRE = re.compile(r"%\(([^)]*)\)s|.")

    def before_get(self, parser, section, option, value, vars):
        rawval = value
        depth = MAX_INTERPOLATION_DEPTH
        while depth:                    # Loop through this until it's done
            depth -= 1
            if value and "%(" in value:
                replace = functools.partial(self._interpolation_replace,
                                            parser=parser)
                value = self._KEYCRE.sub(replace, value)
                try:
                    value = value % vars
                except KeyError as e:
                    raise InterpolationMissingOptionError(
                        option, section, rawval, e.args[0]) from None
            else:
                break
        if value and "%(" in value:
            raise InterpolationDepthError(option, section, rawval)
        return value

    def before_set(self, parser, section, option, value):
        return value

    @staticmethod
    def _interpolation_replace(match, parser):
        s = match.group(1)
        if s is None:
            return match.group()
        else:
            return "%%(%s)s" % parser.optionxform(s)


class RawConfigParser(MutableMapping):
    """ConfigParser that does not do interpolation."""

    # Regular expressions for parsing section headers and options
    _SECT_TMPL = r"""
        \[                                 # [
        (?P<header>[^]]+)                  # very permissive!
        \]                                 # ]
        """
    _OPT_TMPL = r"""
        (?P<option>.*?)                    # very permissive!
        \s*(?P<vi>{delim})\s*              # any number of space/tab,
                                           # followed by any of the
                                           # allowed delimiters,
                                           # followed by any space/tab
        (?P<value>.*)$                     # everything up to eol
        """
    _OPT_NV_TMPL = r"""
        (?P<option>.*?)                    # very permissive!
        \s*(?:                             # any number of space/tab,
        (?P<vi>{delim})\s*                 # optionally followed by
                                           # any of the allowed
                                           # delimiters, followed by any
                                           # space/tab
        (?P<value>.*))?$                   # everything up to eol
        """
    # Interpolation algorithm to be used if the user does not specify another
    _DEFAULT_INTERPOLATION = Interpolation()
    # Compiled regular expression for matching sections
    SECTCRE = re.compile(_SECT_TMPL, re.VERBOSE)
    # Compiled regular expression for matching options with typical separators
    OPTCRE = re.compile(_OPT_TMPL.format(delim="=|:"), re.VERBOSE)
    # Compiled regular expression for matching options with optional values
    # delimited using typical separators
    OPTCRE_NV = re.compile(_OPT_NV_TMPL.format(delim="=|:"), re.VERBOSE)
    # Compiled regular expression for matching leading whitespace in a line
    NONSPACECRE = re.compile(r"\S")
    # Possible boolean values in the configuration.
    BOOLEAN_STATES = {'1': True, 'yes': True, 'true': True, 'on': True,
                      '0': False, 'no': False, 'false': False, 'off': False}

    def __init__(self, defaults=None, dict_type=_default_dict,
                 allow_no_value=False, *, delimiters=('=', ':'),
                 comment_prefixes=('#', ';'), inline_comment_prefixes=None,
                 strict=True, empty_lines_in_values=True,
                 default_section=DEFAULTSECT,
                 interpolation=_UNSET, converters=_UNSET):

        self._dict = dict_type
        self._sections = self._dict()
        self._defaults = self._dict()
        self._converters = ConverterMapping(self)
        self._proxies = self._dict()
        self._proxies[default_section] = SectionProxy(self, default_section)
        self._delimiters = tuple(delimiters)
        if delimiters == ('=', ':'):
            self._optcre = self.OPTCRE_NV if allow_no_value else self.OPTCRE
        else:
            d = "|".join(re.escape(d) for d in delimiters)
            if allow_no_value:
                self._optcre = re.compile(self._OPT_NV_TMPL.format(delim=d),
                                          re.VERBOSE)
            else:
                self._optcre = re.compile(self._OPT_TMPL.format(delim=d),
                                          re.VERBOSE)
        self._comment_prefixes = tuple(comment_prefixes or ())
        self._inline_comment_prefixes = tuple(inline_comment_prefixes or ())
        self._strict = strict
        self._allow_no_value = allow_no_value
        self._empty_lines_in_values = empty_lines_in_values
        self.default_section=default_section
        self._interpolation = interpolation
        if self._interpolation is _UNSET:
            self._interpolation = self._DEFAULT_INTERPOLATION
        if self._interpolation is None:
            self._interpolation = Interpolation()
        if converters is not _UNSET:
            self._converters.update(converters)
        if defaults:
            self._read_defaults(defaults)

    def defaults(self):
        return self._defaults

    def sections(self):
        """Return a list of section names, excluding [DEFAULT]"""
        # self._sections will never have [DEFAULT] in it
        return list(self._sections.keys())

    def add_section(self, section):
        """Create a new section in the configuration.

        Raise DuplicateSectionError if a section by the specified name
        already exists. Raise ValueError if name is DEFAULT.
        """
        if section == self.default_section:
            raise ValueError('Invalid section name: %r' % section)

        if section in self._sections:
            raise DuplicateSectionError(section)
        self._sections[section] = self._dict()
        self._proxies[section] = SectionProxy(self, section)

    def has_section(self, section):
        """Indicate whether the named section is present in the configuration.

        The DEFAULT section is not acknowledged.
        """
        return section in self._sections

    def options(self, section):
        """Return a list of option names for the given section name."""
        try:
            opts = self._sections[section].copy()
        except KeyError:
            raise NoSectionError(section) from None
        opts.update(self._defaults)
        return list(opts.keys())

    def read(self, filenames, encoding=None):
        """Read and parse a filename or an iterable of filenames.

        Files that cannot be opened are silently ignored; this is
        designed so that you can specify an iterable of potential
        configuration file locations (e.g. current directory, user's
        home directory, systemwide directory), and all existing
        configuration files in the iterable will be read.  A single
        filename may also be given.

        Return list of successfully read files.
        """
        if isinstance(filenames, (str, bytes, os.PathLike)):
            filenames = [filenames]
        read_ok = []
        for filename in filenames:
            try:
                with open(filename, encoding=encoding) as fp:
                    self._read(fp, filename)
            except OSError:
                continue
            if isinstance(filename, os.PathLike):
                filename = os.fspath(filename)
            read_ok.append(filename)
        return read_ok

    def read_file(self, f, source=None):
        """Like read() but the argument must be a file-like object.

        The `f' argument must be iterable, returning one line at a time.
        Optional second argument is the `source' specifying the name of the
        file being read. If not given, it is taken from f.name. If `f' has no
        `name' attribute, `<???>' is used.
        """
        if source is None:
            try:
                source = f.name
            except AttributeError:
                source = '<???>'
        self._read(f, source)

    def read_string(self, string, source='<string>'):
        """Read configuration from a given string."""
        sfile = io.StringIO(string)
        self.read_file(sfile, source)

    def read_dict(self, dictionary, source='<dict>'):
        """Read configuration from a dictionary.

        Keys are section names, values are dictionaries with keys and values
        that should be present in the section. If the used dictionary type
        preserves order, sections and their keys will be added in order.

        All types held in the dictionary are converted to strings during
        reading, including section names, option names and keys.

        Optional second argument is the `source' specifying the name of the
        dictionary being read.
        """
        elements_added = set()
        for section, keys in dictionary.items():
            section = str(section)
            try:
                self.add_section(section)
            except (DuplicateSectionError, ValueError):
                if self._strict and section in elements_added:
                    raise
            elements_added.add(section)
            for key, value in keys.items():
                key = self.optionxform(str(key))
                if value is not None:
                    value = str(value)
                if self._strict and (section, key) in elements_added:
                    raise DuplicateOptionError(section, key, source)
                elements_added.add((section, key))
                self.set(section, key, value)

    def readfp(self, fp, filename=None):
        """Deprecated, use read_file instead."""
        warnings.warn(
            "This method will be removed in future versions.  "
            "Use 'parser.read_file()' instead.",
            DeprecationWarning, stacklevel=2
        )
        self.read_file(fp, source=filename)

    def get(self, section, option, *, raw=False, vars=None, fallback=_UNSET):
        """Get an option value for a given section.

        If `vars' is provided, it must be a dictionary. The option is looked up
        in `vars' (if provided), `section', and in `DEFAULTSECT' in that order.
        If the key is not found and `fallback' is provided, it is used as
        a fallback value. `None' can be provided as a `fallback' value.

        If interpolation is enabled and the optional argument `raw' is False,
        all interpolations are expanded in the return values.

        Arguments `raw', `vars', and `fallback' are keyword only.

        The section DEFAULT is special.
        """
        try:
            d = self._unify_values(section, vars)
        except NoSectionError:
            if fallback is _UNSET:
                raise
            else:
                return fallback
        option = self.optionxform(option)
        try:
            value = d[option]
        except KeyError:
            if fallback is _UNSET:
                raise NoOptionError(option, section)
            else:
                return fallback

        if raw or value is None:
            return value
        else:
            return self._interpolation.before_get(self, section, option, value,
                                                  d)

    def _get(self, section, conv, option, **kwargs):
        return conv(self.get(section, option, **kwargs))

    def _get_conv(self, section, option, conv, *, raw=False, vars=None,
                  fallback=_UNSET, **kwargs):
        try:
            return self._get(section, conv, option, raw=raw, vars=vars,
                             **kwargs)
        except (NoSectionError, NoOptionError):
            if fallback is _UNSET:
                raise
            return fallback

    # getint, getfloat and getboolean provided directly for backwards compat
    def getint(self, section, option, *, raw=False, vars=None,
               fallback=_UNSET, **kwargs):
        return self._get_conv(section, option, int, raw=raw, vars=vars,
                              fallback=fallback, **kwargs)

    def getfloat(self, section, option, *, raw=False, vars=None,
                 fallback=_UNSET, **kwargs):
        return self._get_conv(section, option, float, raw=raw, vars=vars,
                              fallback=fallback, **kwargs)

    def getboolean(self, section, option, *, raw=False, vars=None,
                   fallback=_UNSET, **kwargs):
        return self._get_conv(section, option, self._convert_to_boolean,
                              raw=raw, vars=vars, fallback=fallback, **kwargs)

    def items(self, section=_UNSET, raw=False, vars=None):
        """Return a list of (name, value) tuples for each option in a section.

        All % interpolations are expanded in the return values, based on the
        defaults passed into the constructor, unless the optional argument
        `raw' is true.  Additional substitutions may be provided using the
        `vars' argument, which must be a dictionary whose contents overrides
        any pre-existing defaults.

        The section DEFAULT is special.
        """
        if section is _UNSET:
            return super().items()
        d = self._defaults.copy()
        try:
            d.update(self._sections[section])
        except KeyError:
            if section != self.default_section:
                raise NoSectionError(section)
        orig_keys = list(d.keys())
        # Update with the entry specific variables
        if vars:
            for key, value in vars.items():
                d[self.optionxform(key)] = value
        value_getter = lambda option: self._interpolation.before_get(self,
            section, option, d[option], d)
        if raw:
            value_getter = lambda option: d[option]
        return [(option, value_getter(option)) for option in orig_keys]

    def popitem(self):
        """Remove a section from the parser and return it as
        a (section_name, section_proxy) tuple. If no section is present, raise
        KeyError.

        The section DEFAULT is never returned because it cannot be removed.
        """
        for key in self.sections():
            value = self[key]
            del self[key]
            return key, value
        raise KeyError

    def optionxform(self, optionstr):
        return optionstr.lower()

    def has_option(self, section, option):
        """Check for the existence of a given option in a given section.
        If the specified `section' is None or an empty string, DEFAULT is
        assumed. If the specified `section' does not exist, returns False."""
        if not section or section == self.default_section:
            option = self.optionxform(option)
            return option in self._defaults
        elif section not in self._sections:
            return False
        else:
            option = self.optionxform(option)
            return (option in self._sections[section]
                    or option in self._defaults)

    def set(self, section, option, value=None):
        """Set an option."""
        if value:
            value = self._interpolation.before_set(self, section, option,
                                                   value)
        if not section or section == self.default_section:
            sectdict = self._defaults
        else:
            try:
                sectdict = self._sections[section]
            except KeyError:
                raise NoSectionError(section) from None
        sectdict[self.optionxform(option)] = value

    def write(self, fp, space_around_delimiters=True):
        """Write an .ini-format representation of the configuration state.

        If `space_around_delimiters' is True (the default), delimiters
        between keys and values are surrounded by spaces.
        """
        if space_around_delimiters:
            d = " {} ".format(self._delimiters[0])
        else:
            d = self._delimiters[0]
        if self._defaults:
            self._write_section(fp, self.default_section,
                                    self._defaults.items(), d)
        for section in self._sections:
            self._write_section(fp, section,
                                self._sections[section].items(), d)

    def _write_section(self, fp, section_name, section_items, delimiter):
        """Write a single section to the specified `fp'."""
        fp.write("[{}]\n".format(section_name))
        for key, value in section_items:
            value = self._interpolation.before_write(self, section_name, key,
                                                     value)
            if value is not None or not self._allow_no_value:
                value = delimiter + str(value).replace('\n', '\n\t')
            else:
                value = ""
            fp.write("{}{}\n".format(key, value))
        fp.write("\n")

    def remove_option(self, section, option):
        """Remove an option."""
        if not section or section == self.default_section:
            sectdict = self._defaults
        else:
            try:
                sectdict = self._sections[section]
            except KeyError:
                raise NoSectionError(section) from None
        option = self.optionxform(option)
        existed = option in sectdict
        if existed:
            del sectdict[option]
        return existed

    def remove_section(self, section):
        """Remove a file section."""
        existed = section in self._sections
        if existed:
            del self._sections[section]
            del self._proxies[section]
        return existed

    def __getitem__(self, key):
        if key != self.default_section and not self.has_section(key):
            raise KeyError(key)
        return self._proxies[key]

    def __setitem__(self, key, value):
        # To conform with the mapping protocol, overwrites existing values in
        # the section.
        if key in self and self[key] is value:
            return
        # XXX this is not atomic if read_dict fails at any point. Then again,
        # no update method in configparser is atomic in this implementation.
        if key == self.default_section:
            self._defaults.clear()
        elif key in self._sections:
            self._sections[key].clear()
        self.read_dict({key: value})

    def __delitem__(self, key):
        if key == self.default_section:
            raise ValueError("Cannot remove the default section.")
        if not self.has_section(key):
            raise KeyError(key)
        self.remove_section(key)

    def __contains__(self, key):
        return key == self.default_section or self.has_section(key)

    def __len__(self):
        return len(self._sections) + 1 # the default section

    def __iter__(self):
        # XXX does it break when underlying container state changed?
        return itertools.chain((self.default_section,), self._sections.keys())

    def _read(self, fp, fpname):
        """Parse a sectioned configuration file.

        Each section in a configuration file contains a header, indicated by
        a name in square brackets (`[]'), plus key/value options, indicated by
        `name' and `value' delimited with a specific substring (`=' or `:' by
        default).

        Values can span multiple lines, as long as they are indented deeper
        than the first line of the value. Depending on the parser's mode, blank
        lines may be treated as parts of multiline values or ignored.

        Configuration files may include comments, prefixed by specific
        characters (`#' and `;' by default). Comments may appear on their own
        in an otherwise empty line or may be entered in lines holding values or
        section names.
        """
        elements_added = set()
        cursect = None                        # None, or a dictionary
        sectname = None
        optname = None
        lineno = 0
        indent_level = 0
        e = None                              # None, or an exception
        for lineno, line in enumerate(fp, start=1):
            comment_start = sys.maxsize
            # strip inline comments
            inline_prefixes = {p: -1 for p in self._inline_comment_prefixes}
            while comment_start == sys.maxsize and inline_prefixes:
                next_prefixes = {}
                for prefix, index in inline_prefixes.items():
                    index = line.find(prefix, index+1)
                    if index == -1:
                        continue
                    next_prefixes[prefix] = index
                    if index == 0 or (index > 0 and line[index-1].isspace()):
                        comment_start = min(comment_start, index)
                inline_prefixes = next_prefixes
            # strip full line comments
            for prefix in self._comment_prefixes:
                if line.strip().startswith(prefix):
                    comment_start = 0
                    break
            if comment_start == sys.maxsize:
                comment_start = None
            value = line[:comment_start].strip()
            if not value:
                if self._empty_lines_in_values:
                    # add empty line to the value, but only if there was no
                    # comment on the line
                    if (comment_start is None and
                        cursect is not None and
                        optname and
                        cursect[optname] is not None):
                        cursect[optname].append('') # newlines added at join
                else:
                    # empty line marks end of value
                    indent_level = sys.maxsize
                continue
            # continuation line?
            first_nonspace = self.NONSPACECRE.search(line)
            cur_indent_level = first_nonspace.start() if first_nonspace else 0
            if (cursect is not None and optname and
                cur_indent_level > indent_level):
                cursect[optname].append(value)
            # a section header or option header?
            else:
                indent_level = cur_indent_level
                # is it a section header?
                mo = self.SECTCRE.match(value)
                if mo:
                    sectname = mo.group('header')
                    if sectname in self._sections:
                        if self._strict and sectname in elements_added:
                            raise DuplicateSectionError(sectname, fpname,
                                                        lineno)
                        cursect = self._sections[sectname]
                        elements_added.add(sectname)
                    elif sectname == self.default_section:
                        cursect = self._defaults
                    else:
                        cursect = self._dict()
                        self._sections[sectname] = cursect
                        self._proxies[sectname] = SectionProxy(self, sectname)
                        elements_added.add(sectname)
                    # So sections can't start with a continuation line
                    optname = None
                # no section header in the file?
                elif cursect is None:
                    raise MissingSectionHeaderError(fpname, lineno, line)
                # an option line?
                else:
                    mo = self._optcre.match(value)
                    if mo:
                        optname, vi, optval = mo.group('option', 'vi', 'value')
                        if not optname:
                            e = self._handle_error(e, fpname, lineno, line)
                        optname = self.optionxform(optname.rstrip())
                        if (self._strict and
                            (sectname, optname) in elements_added):
                            raise DuplicateOptionError(sectname, optname,
                                                       fpname, lineno)
                        elements_added.add((sectname, optname))
                        # This check is fine because the OPTCRE cannot
                        # match if it would set optval to None
                        if optval is not None:
                            optval = optval.strip()
                            cursect[optname] = [optval]
                        else:
                            # valueless option handling
                            cursect[optname] = None
                    else:
                        # a non-fatal parsing error occurred. set up the
                        # exception but keep going. the exception will be
                        # raised at the end of the file and will contain a
                        # list of all bogus lines
                        e = self._handle_error(e, fpname, lineno, line)
        self._join_multiline_values()
        # if any parsing errors occurred, raise an exception
        if e:
            raise e

    def _join_multiline_values(self):
        defaults = self.default_section, self._defaults
        all_sections = itertools.chain((defaults,),
                                       self._sections.items())
        for section, options in all_sections:
            for name, val in options.items():
                if isinstance(val, list):
                    val = '\n'.join(val).rstrip()
                options[name] = self._interpolation.before_read(self,
                                                                section,
                                                                name, val)

    def _read_defaults(self, defaults):
        """Read the defaults passed in the initializer.
        Note: values can be non-string."""
        for key, value in defaults.items():
            self._defaults[self.optionxform(key)] = value

    def _handle_error(self, exc, fpname, lineno, line):
        if not exc:
            exc = ParsingError(fpname)
        exc.append(lineno, repr(line))
        return exc

    def _unify_values(self, section, vars):
        """Create a sequence of lookups with 'vars' taking priority over
        the 'section' which takes priority over the DEFAULTSECT.

        """
        sectiondict = {}
        try:
            sectiondict = self._sections[section]
        except KeyError:
            if section != self.default_section:
                raise NoSectionError(section) from None
        # Update with the entry specific variables
        vardict = {}
        if vars:
            for key, value in vars.items():
                if value is not None:
                    value = str(value)
                vardict[self.optionxform(key)] = value
        return _ChainMap(vardict, sectiondict, self._defaults)

    def _convert_to_boolean(self, value):
        """Return a boolean value translating from other types if necessary.
        """
        if value.lower() not in self.BOOLEAN_STATES:
            raise ValueError('Not a boolean: %s' % value)
        return self.BOOLEAN_STATES[value.lower()]

    def _validate_value_types(self, *, section="", option="", value=""):
        """Raises a TypeError for non-string values.

        The only legal non-string value if we allow valueless
        options is None, so we need to check if the value is a
        string if:
        - we do not allow valueless options, or
        - we allow valueless options but the value is not None

        For compatibility reasons this method is not used in classic set()
        for RawConfigParsers. It is invoked in every case for mapping protocol
        access and in ConfigParser.set().
        """
        if not isinstance(section, str):
            raise TypeError("section names must be strings")
        if not isinstance(option, str):
            raise TypeError("option keys must be strings")
        if not self._allow_no_value or value:
            if not isinstance(value, str):
                raise TypeError("option values must be strings")

    @property
    def converters(self):
        return self._converters


class ConfigParser(RawConfigParser):
    """ConfigParser implementing interpolation."""

    _DEFAULT_INTERPOLATION = BasicInterpolation()

    def set(self, section, option, value=None):
        """Set an option.  Extends RawConfigParser.set by validating type and
        interpolation syntax on the value."""
        self._validate_value_types(option=option, value=value)
        super().set(section, option, value)

    def add_section(self, section):
        """Create a new section in the configuration.  Extends
        RawConfigParser.add_section by validating if the section name is
        a string."""
        self._validate_value_types(section=section)
        super().add_section(section)

    def _read_defaults(self, defaults):
        """Reads the defaults passed in the initializer, implicitly converting
        values to strings like the rest of the API.

        Does not perform interpolation for backwards compatibility.
        """
        try:
            hold_interpolation = self._interpolation
            self._interpolation = Interpolation()
            self.read_dict({self.default_section: defaults})
        finally:
            self._interpolation = hold_interpolation


class SafeConfigParser(ConfigParser):
    """ConfigParser alias for backwards compatibility purposes."""

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        warnings.warn(
            "The SafeConfigParser class has been renamed to ConfigParser "
            "in Python 3.2. This alias will be removed in future versions."
            " Use ConfigParser directly instead.",
            DeprecationWarning, stacklevel=2
        )


class SectionProxy(MutableMapping):
    """A proxy for a single section from a parser."""

    def __init__(self, parser, name):
        """Creates a view on a section of the specified `name` in `parser`."""
        self._parser = parser
        self._name = name
        for conv in parser.converters:
            key = 'get' + conv
            getter = functools.partial(self.get, _impl=getattr(parser, key))
            setattr(self, key, getter)

    def __repr__(self):
        return '<Section: {}>'.format(self._name)

    def __getitem__(self, key):
        if not self._parser.has_option(self._name, key):
            raise KeyError(key)
        return self._parser.get(self._name, key)

    def __setitem__(self, key, value):
        self._parser._validate_value_types(option=key, value=value)
        return self._parser.set(self._name, key, value)

    def __delitem__(self, key):
        if not (self._parser.has_option(self._name, key) and
                self._parser.remove_option(self._name, key)):
            raise KeyError(key)

    def __contains__(self, key):
        return self._parser.has_option(self._name, key)

    def __len__(self):
        return len(self._options())

    def __iter__(self):
        return self._options().__iter__()

    def _options(self):
        if self._name != self._parser.default_section:
            return self._parser.options(self._name)
        else:
            return self._parser.defaults()

    @property
    def parser(self):
        # The parser object of the proxy is read-only.
        return self._parser

    @property
    def name(self):
        # The name of the section on a proxy is read-only.
        return self._name

    def get(self, option, fallback=None, *, raw=False, vars=None,
            _impl=None, **kwargs):
        """Get an option value.

        Unless `fallback` is provided, `None` will be returned if the option
        is not found.

        """
        # If `_impl` is provided, it should be a getter method on the parser
        # object that provides the desired type conversion.
        if not _impl:
            _impl = self._parser.get
        return _impl(self._name, option, raw=raw, vars=vars,
                     fallback=fallback, **kwargs)


class ConverterMapping(MutableMapping):
    """Enables reuse of get*() methods between the parser and section proxies.

    If a parser class implements a getter directly, the value for the given
    key will be ``None``. The presence of the converter name here enables
    section proxies to find and use the implementation on the parser class.
    """

    GETTERCRE = re.compile(r"^get(?P<name>.+)$")

    def __init__(self, parser):
        self._parser = parser
        self._data = {}
        for getter in dir(self._parser):
            m = self.GETTERCRE.match(getter)
            if not m or not callable(getattr(self._parser, getter)):
                continue
            self._data[m.group('name')] = None   # See class docstring.

    def __getitem__(self, key):
        return self._data[key]

    def __setitem__(self, key, value):
        try:
            k = 'get' + key
        except TypeError:
            raise ValueError('Incompatible key: {} (type: {})'
                             ''.format(key, type(key)))
        if k == 'get':
            raise ValueError('Incompatible key: cannot use "" as a name')
        self._data[key] = value
        func = functools.partial(self._parser._get_conv, conv=value)
        func.converter = value
        setattr(self._parser, k, func)
        for proxy in self._parser.values():
            getter = functools.partial(proxy.get, _impl=func)
            setattr(proxy, k, getter)

    def __delitem__(self, key):
        try:
            k = 'get' + (key or None)
        except TypeError:
            raise KeyError(key)
        del self._data[key]
        for inst in itertools.chain((self._parser,), self._parser.values()):
            try:
                delattr(inst, k)
            except AttributeError:
                # don't raise since the entry was present in _data, silently
                # clean up
                continue

    def __iter__(self):
        return iter(self._data)

    def __len__(self):
        return len(self._data)
pstats.py000064400000065321151153537470006456 0ustar00"""Class for printing reports on profiled python code."""

# Written by James Roskind
# Based on prior profile module by Sjoerd Mullender...
#   which was hacked somewhat by: Guido van Rossum

# Copyright Disney Enterprises, Inc.  All Rights Reserved.
# Licensed to PSF under a Contributor Agreement
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied.  See the License for the specific language
# governing permissions and limitations under the License.


import sys
import os
import time
import marshal
import re
from enum import Enum
from functools import cmp_to_key

__all__ = ["Stats", "SortKey"]


class SortKey(str, Enum):
    CALLS = 'calls', 'ncalls'
    CUMULATIVE = 'cumulative', 'cumtime'
    FILENAME = 'filename', 'module'
    LINE = 'line'
    NAME = 'name'
    NFL = 'nfl'
    PCALLS = 'pcalls'
    STDNAME = 'stdname'
    TIME = 'time', 'tottime'

    def __new__(cls, *values):
        value = values[0]
        obj = str.__new__(cls, value)
        obj._value_ = value
        for other_value in values[1:]:
            cls._value2member_map_[other_value] = obj
        obj._all_values = values
        return obj


class Stats:
    """This class is used for creating reports from data generated by the
    Profile class.  It is a "friend" of that class, and imports data either
    by direct access to members of Profile class, or by reading in a dictionary
    that was emitted (via marshal) from the Profile class.

    The big change from the previous Profiler (in terms of raw functionality)
    is that an "add()" method has been provided to combine Stats from
    several distinct profile runs.  Both the constructor and the add()
    method now take arbitrarily many file names as arguments.

    All the print methods now take an argument that indicates how many lines
    to print.  If the arg is a floating point number between 0 and 1.0, then
    it is taken as a decimal percentage of the available lines to be printed
    (e.g., .1 means print 10% of all available lines).  If it is an integer,
    it is taken to mean the number of lines of data that you wish to have
    printed.

    The sort_stats() method now processes some additional options (i.e., in
    addition to the old -1, 0, 1, or 2 that are respectively interpreted as
    'stdname', 'calls', 'time', and 'cumulative').  It takes either an
    arbitrary number of quoted strings or SortKey enum to select the sort
    order.

    For example sort_stats('time', 'name') or sort_stats(SortKey.TIME,
    SortKey.NAME) sorts on the major key of 'internal function time', and on
    the minor key of 'the name of the function'.  Look at the two tables in
    sort_stats() and get_sort_arg_defs(self) for more examples.

    All methods return self, so you can string together commands like:
        Stats('foo', 'goo').strip_dirs().sort_stats('calls').\
                            print_stats(5).print_callers(5)
    """

    def __init__(self, *args, stream=None):
        self.stream = stream or sys.stdout
        if not len(args):
            arg = None
        else:
            arg = args[0]
            args = args[1:]
        self.init(arg)
        self.add(*args)

    def init(self, arg):
        self.all_callees = None  # calc only if needed
        self.files = []
        self.fcn_list = None
        self.total_tt = 0
        self.total_calls = 0
        self.prim_calls = 0
        self.max_name_len = 0
        self.top_level = set()
        self.stats = {}
        self.sort_arg_dict = {}
        self.load_stats(arg)
        try:
            self.get_top_level_stats()
        except Exception:
            print("Invalid timing data %s" %
                  (self.files[-1] if self.files else ''), file=self.stream)
            raise

    def load_stats(self, arg):
        if arg is None:
            self.stats = {}
            return
        elif isinstance(arg, str):
            with open(arg, 'rb') as f:
                self.stats = marshal.load(f)
            try:
                file_stats = os.stat(arg)
                arg = time.ctime(file_stats.st_mtime) + "    " + arg
            except:  # in case this is not unix
                pass
            self.files = [arg]
        elif hasattr(arg, 'create_stats'):
            arg.create_stats()
            self.stats = arg.stats
            arg.stats = {}
        if not self.stats:
            raise TypeError("Cannot create or construct a %r object from %r"
                            % (self.__class__, arg))
        return

    def get_top_level_stats(self):
        for func, (cc, nc, tt, ct, callers) in self.stats.items():
            self.total_calls += nc
            self.prim_calls  += cc
            self.total_tt    += tt
            if ("jprofile", 0, "profiler") in callers:
                self.top_level.add(func)
            if len(func_std_string(func)) > self.max_name_len:
                self.max_name_len = len(func_std_string(func))

    def add(self, *arg_list):
        if not arg_list:
            return self
        for item in reversed(arg_list):
            if type(self) != type(item):
                item = Stats(item)
            self.files += item.files
            self.total_calls += item.total_calls
            self.prim_calls += item.prim_calls
            self.total_tt += item.total_tt
            for func in item.top_level:
                self.top_level.add(func)

            if self.max_name_len < item.max_name_len:
                self.max_name_len = item.max_name_len

            self.fcn_list = None

            for func, stat in item.stats.items():
                if func in self.stats:
                    old_func_stat = self.stats[func]
                else:
                    old_func_stat = (0, 0, 0, 0, {},)
                self.stats[func] = add_func_stats(old_func_stat, stat)
        return self

    def dump_stats(self, filename):
        """Write the profile data to a file we know how to load back."""
        with open(filename, 'wb') as f:
            marshal.dump(self.stats, f)

    # list the tuple indices and directions for sorting,
    # along with some printable description
    sort_arg_dict_default = {
              "calls"     : (((1,-1),              ), "call count"),
              "ncalls"    : (((1,-1),              ), "call count"),
              "cumtime"   : (((3,-1),              ), "cumulative time"),
              "cumulative": (((3,-1),              ), "cumulative time"),
              "filename"  : (((4, 1),              ), "file name"),
              "line"      : (((5, 1),              ), "line number"),
              "module"    : (((4, 1),              ), "file name"),
              "name"      : (((6, 1),              ), "function name"),
              "nfl"       : (((6, 1),(4, 1),(5, 1),), "name/file/line"),
              "pcalls"    : (((0,-1),              ), "primitive call count"),
              "stdname"   : (((7, 1),              ), "standard name"),
              "time"      : (((2,-1),              ), "internal time"),
              "tottime"   : (((2,-1),              ), "internal time"),
              }

    def get_sort_arg_defs(self):
        """Expand all abbreviations that are unique."""
        if not self.sort_arg_dict:
            self.sort_arg_dict = dict = {}
            bad_list = {}
            for word, tup in self.sort_arg_dict_default.items():
                fragment = word
                while fragment:
                    if not fragment:
                        break
                    if fragment in dict:
                        bad_list[fragment] = 0
                        break
                    dict[fragment] = tup
                    fragment = fragment[:-1]
            for word in bad_list:
                del dict[word]
        return self.sort_arg_dict

    def sort_stats(self, *field):
        if not field:
            self.fcn_list = 0
            return self
        if len(field) == 1 and isinstance(field[0], int):
            # Be compatible with old profiler
            field = [ {-1: "stdname",
                       0:  "calls",
                       1:  "time",
                       2:  "cumulative"}[field[0]] ]
        elif len(field) >= 2:
            for arg in field[1:]:
                if type(arg) != type(field[0]):
                    raise TypeError("Can't have mixed argument type")

        sort_arg_defs = self.get_sort_arg_defs()

        sort_tuple = ()
        self.sort_type = ""
        connector = ""
        for word in field:
            if isinstance(word, SortKey):
                word = word.value
            sort_tuple = sort_tuple + sort_arg_defs[word][0]
            self.sort_type += connector + sort_arg_defs[word][1]
            connector = ", "

        stats_list = []
        for func, (cc, nc, tt, ct, callers) in self.stats.items():
            stats_list.append((cc, nc, tt, ct) + func +
                              (func_std_string(func), func))

        stats_list.sort(key=cmp_to_key(TupleComp(sort_tuple).compare))

        self.fcn_list = fcn_list = []
        for tuple in stats_list:
            fcn_list.append(tuple[-1])
        return self

    def reverse_order(self):
        if self.fcn_list:
            self.fcn_list.reverse()
        return self

    def strip_dirs(self):
        oldstats = self.stats
        self.stats = newstats = {}
        max_name_len = 0
        for func, (cc, nc, tt, ct, callers) in oldstats.items():
            newfunc = func_strip_path(func)
            if len(func_std_string(newfunc)) > max_name_len:
                max_name_len = len(func_std_string(newfunc))
            newcallers = {}
            for func2, caller in callers.items():
                newcallers[func_strip_path(func2)] = caller

            if newfunc in newstats:
                newstats[newfunc] = add_func_stats(
                                        newstats[newfunc],
                                        (cc, nc, tt, ct, newcallers))
            else:
                newstats[newfunc] = (cc, nc, tt, ct, newcallers)
        old_top = self.top_level
        self.top_level = new_top = set()
        for func in old_top:
            new_top.add(func_strip_path(func))

        self.max_name_len = max_name_len

        self.fcn_list = None
        self.all_callees = None
        return self

    def calc_callees(self):
        if self.all_callees:
            return
        self.all_callees = all_callees = {}
        for func, (cc, nc, tt, ct, callers) in self.stats.items():
            if not func in all_callees:
                all_callees[func] = {}
            for func2, caller in callers.items():
                if not func2 in all_callees:
                    all_callees[func2] = {}
                all_callees[func2][func]  = caller
        return

    #******************************************************************
    # The following functions support actual printing of reports
    #******************************************************************

    # Optional "amount" is either a line count, or a percentage of lines.

    def eval_print_amount(self, sel, list, msg):
        new_list = list
        if isinstance(sel, str):
            try:
                rex = re.compile(sel)
            except re.error:
                msg += "   <Invalid regular expression %r>\n" % sel
                return new_list, msg
            new_list = []
            for func in list:
                if rex.search(func_std_string(func)):
                    new_list.append(func)
        else:
            count = len(list)
            if isinstance(sel, float) and 0.0 <= sel < 1.0:
                count = int(count * sel + .5)
                new_list = list[:count]
            elif isinstance(sel, int) and 0 <= sel < count:
                count = sel
                new_list = list[:count]
        if len(list) != len(new_list):
            msg += "   List reduced from %r to %r due to restriction <%r>\n" % (
                len(list), len(new_list), sel)

        return new_list, msg

    def get_print_list(self, sel_list):
        width = self.max_name_len
        if self.fcn_list:
            stat_list = self.fcn_list[:]
            msg = "   Ordered by: " + self.sort_type + '\n'
        else:
            stat_list = list(self.stats.keys())
            msg = "   Random listing order was used\n"

        for selection in sel_list:
            stat_list, msg = self.eval_print_amount(selection, stat_list, msg)

        count = len(stat_list)

        if not stat_list:
            return 0, stat_list
        print(msg, file=self.stream)
        if count < len(self.stats):
            width = 0
            for func in stat_list:
                if  len(func_std_string(func)) > width:
                    width = len(func_std_string(func))
        return width+2, stat_list

    def print_stats(self, *amount):
        for filename in self.files:
            print(filename, file=self.stream)
        if self.files:
            print(file=self.stream)
        indent = ' ' * 8
        for func in self.top_level:
            print(indent, func_get_function_name(func), file=self.stream)

        print(indent, self.total_calls, "function calls", end=' ', file=self.stream)
        if self.total_calls != self.prim_calls:
            print("(%d primitive calls)" % self.prim_calls, end=' ', file=self.stream)
        print("in %.3f seconds" % self.total_tt, file=self.stream)
        print(file=self.stream)
        width, list = self.get_print_list(amount)
        if list:
            self.print_title()
            for func in list:
                self.print_line(func)
            print(file=self.stream)
            print(file=self.stream)
        return self

    def print_callees(self, *amount):
        width, list = self.get_print_list(amount)
        if list:
            self.calc_callees()

            self.print_call_heading(width, "called...")
            for func in list:
                if func in self.all_callees:
                    self.print_call_line(width, func, self.all_callees[func])
                else:
                    self.print_call_line(width, func, {})
            print(file=self.stream)
            print(file=self.stream)
        return self

    def print_callers(self, *amount):
        width, list = self.get_print_list(amount)
        if list:
            self.print_call_heading(width, "was called by...")
            for func in list:
                cc, nc, tt, ct, callers = self.stats[func]
                self.print_call_line(width, func, callers, "<-")
            print(file=self.stream)
            print(file=self.stream)
        return self

    def print_call_heading(self, name_size, column_title):
        print("Function ".ljust(name_size) + column_title, file=self.stream)
        # print sub-header only if we have new-style callers
        subheader = False
        for cc, nc, tt, ct, callers in self.stats.values():
            if callers:
                value = next(iter(callers.values()))
                subheader = isinstance(value, tuple)
                break
        if subheader:
            print(" "*name_size + "    ncalls  tottime  cumtime", file=self.stream)

    def print_call_line(self, name_size, source, call_dict, arrow="->"):
        print(func_std_string(source).ljust(name_size) + arrow, end=' ', file=self.stream)
        if not call_dict:
            print(file=self.stream)
            return
        clist = sorted(call_dict.keys())
        indent = ""
        for func in clist:
            name = func_std_string(func)
            value = call_dict[func]
            if isinstance(value, tuple):
                nc, cc, tt, ct = value
                if nc != cc:
                    substats = '%d/%d' % (nc, cc)
                else:
                    substats = '%d' % (nc,)
                substats = '%s %s %s  %s' % (substats.rjust(7+2*len(indent)),
                                             f8(tt), f8(ct), name)
                left_width = name_size + 1
            else:
                substats = '%s(%r) %s' % (name, value, f8(self.stats[func][3]))
                left_width = name_size + 3
            print(indent*left_width + substats, file=self.stream)
            indent = " "

    def print_title(self):
        print('   ncalls  tottime  percall  cumtime  percall', end=' ', file=self.stream)
        print('filename:lineno(function)', file=self.stream)

    def print_line(self, func):  # hack: should print percentages
        cc, nc, tt, ct, callers = self.stats[func]
        c = str(nc)
        if nc != cc:
            c = c + '/' + str(cc)
        print(c.rjust(9), end=' ', file=self.stream)
        print(f8(tt), end=' ', file=self.stream)
        if nc == 0:
            print(' '*8, end=' ', file=self.stream)
        else:
            print(f8(tt/nc), end=' ', file=self.stream)
        print(f8(ct), end=' ', file=self.stream)
        if cc == 0:
            print(' '*8, end=' ', file=self.stream)
        else:
            print(f8(ct/cc), end=' ', file=self.stream)
        print(func_std_string(func), file=self.stream)

class TupleComp:
    """This class provides a generic function for comparing any two tuples.
    Each instance records a list of tuple-indices (from most significant
    to least significant), and sort direction (ascending or decending) for
    each tuple-index.  The compare functions can then be used as the function
    argument to the system sort() function when a list of tuples need to be
    sorted in the instances order."""

    def __init__(self, comp_select_list):
        self.comp_select_list = comp_select_list

    def compare (self, left, right):
        for index, direction in self.comp_select_list:
            l = left[index]
            r = right[index]
            if l < r:
                return -direction
            if l > r:
                return direction
        return 0


#**************************************************************************
# func_name is a triple (file:string, line:int, name:string)

def func_strip_path(func_name):
    filename, line, name = func_name
    return os.path.basename(filename), line, name

def func_get_function_name(func):
    return func[2]

def func_std_string(func_name): # match what old profile produced
    if func_name[:2] == ('~', 0):
        # special case for built-in functions
        name = func_name[2]
        if name.startswith('<') and name.endswith('>'):
            return '{%s}' % name[1:-1]
        else:
            return name
    else:
        return "%s:%d(%s)" % func_name

#**************************************************************************
# The following functions combine statistics for pairs functions.
# The bulk of the processing involves correctly handling "call" lists,
# such as callers and callees.
#**************************************************************************

def add_func_stats(target, source):
    """Add together all the stats for two profile entries."""
    cc, nc, tt, ct, callers = source
    t_cc, t_nc, t_tt, t_ct, t_callers = target
    return (cc+t_cc, nc+t_nc, tt+t_tt, ct+t_ct,
              add_callers(t_callers, callers))

def add_callers(target, source):
    """Combine two caller lists in a single list."""
    new_callers = {}
    for func, caller in target.items():
        new_callers[func] = caller
    for func, caller in source.items():
        if func in new_callers:
            if isinstance(caller, tuple):
                # format used by cProfile
                new_callers[func] = tuple(i + j for i, j in zip(caller, new_callers[func]))
            else:
                # format used by profile
                new_callers[func] += caller
        else:
            new_callers[func] = caller
    return new_callers

def count_calls(callers):
    """Sum the caller statistics to get total number of calls received."""
    nc = 0
    for calls in callers.values():
        nc += calls
    return nc

#**************************************************************************
# The following functions support printing of reports
#**************************************************************************

def f8(x):
    return "%8.3f" % x

#**************************************************************************
# Statistics browser added by ESR, April 2001
#**************************************************************************

if __name__ == '__main__':
    import cmd
    try:
        import readline
    except ImportError:
        pass

    class ProfileBrowser(cmd.Cmd):
        def __init__(self, profile=None):
            cmd.Cmd.__init__(self)
            self.prompt = "% "
            self.stats = None
            self.stream = sys.stdout
            if profile is not None:
                self.do_read(profile)

        def generic(self, fn, line):
            args = line.split()
            processed = []
            for term in args:
                try:
                    processed.append(int(term))
                    continue
                except ValueError:
                    pass
                try:
                    frac = float(term)
                    if frac > 1 or frac < 0:
                        print("Fraction argument must be in [0, 1]", file=self.stream)
                        continue
                    processed.append(frac)
                    continue
                except ValueError:
                    pass
                processed.append(term)
            if self.stats:
                getattr(self.stats, fn)(*processed)
            else:
                print("No statistics object is loaded.", file=self.stream)
            return 0
        def generic_help(self):
            print("Arguments may be:", file=self.stream)
            print("* An integer maximum number of entries to print.", file=self.stream)
            print("* A decimal fractional number between 0 and 1, controlling", file=self.stream)
            print("  what fraction of selected entries to print.", file=self.stream)
            print("* A regular expression; only entries with function names", file=self.stream)
            print("  that match it are printed.", file=self.stream)

        def do_add(self, line):
            if self.stats:
                try:
                    self.stats.add(line)
                except OSError as e:
                    print("Failed to load statistics for %s: %s" % (line, e), file=self.stream)
            else:
                print("No statistics object is loaded.", file=self.stream)
            return 0
        def help_add(self):
            print("Add profile info from given file to current statistics object.", file=self.stream)

        def do_callees(self, line):
            return self.generic('print_callees', line)
        def help_callees(self):
            print("Print callees statistics from the current stat object.", file=self.stream)
            self.generic_help()

        def do_callers(self, line):
            return self.generic('print_callers', line)
        def help_callers(self):
            print("Print callers statistics from the current stat object.", file=self.stream)
            self.generic_help()

        def do_EOF(self, line):
            print("", file=self.stream)
            return 1
        def help_EOF(self):
            print("Leave the profile browser.", file=self.stream)

        def do_quit(self, line):
            return 1
        def help_quit(self):
            print("Leave the profile browser.", file=self.stream)

        def do_read(self, line):
            if line:
                try:
                    self.stats = Stats(line)
                except OSError as err:
                    print(err.args[1], file=self.stream)
                    return
                except Exception as err:
                    print(err.__class__.__name__ + ':', err, file=self.stream)
                    return
                self.prompt = line + "% "
            elif len(self.prompt) > 2:
                line = self.prompt[:-2]
                self.do_read(line)
            else:
                print("No statistics object is current -- cannot reload.", file=self.stream)
            return 0
        def help_read(self):
            print("Read in profile data from a specified file.", file=self.stream)
            print("Without argument, reload the current file.", file=self.stream)

        def do_reverse(self, line):
            if self.stats:
                self.stats.reverse_order()
            else:
                print("No statistics object is loaded.", file=self.stream)
            return 0
        def help_reverse(self):
            print("Reverse the sort order of the profiling report.", file=self.stream)

        def do_sort(self, line):
            if not self.stats:
                print("No statistics object is loaded.", file=self.stream)
                return
            abbrevs = self.stats.get_sort_arg_defs()
            if line and all((x in abbrevs) for x in line.split()):
                self.stats.sort_stats(*line.split())
            else:
                print("Valid sort keys (unique prefixes are accepted):", file=self.stream)
                for (key, value) in Stats.sort_arg_dict_default.items():
                    print("%s -- %s" % (key, value[1]), file=self.stream)
            return 0
        def help_sort(self):
            print("Sort profile data according to specified keys.", file=self.stream)
            print("(Typing `sort' without arguments lists valid keys.)", file=self.stream)
        def complete_sort(self, text, *args):
            return [a for a in Stats.sort_arg_dict_default if a.startswith(text)]

        def do_stats(self, line):
            return self.generic('print_stats', line)
        def help_stats(self):
            print("Print statistics from the current stat object.", file=self.stream)
            self.generic_help()

        def do_strip(self, line):
            if self.stats:
                self.stats.strip_dirs()
            else:
                print("No statistics object is loaded.", file=self.stream)
        def help_strip(self):
            print("Strip leading path information from filenames in the report.", file=self.stream)

        def help_help(self):
            print("Show help for a given command.", file=self.stream)

        def postcmd(self, stop, line):
            if stop:
                return stop
            return None

    if len(sys.argv) > 1:
        initprofile = sys.argv[1]
    else:
        initprofile = None
    try:
        browser = ProfileBrowser(initprofile)
        for profile in sys.argv[2:]:
            browser.do_add(profile)
        print("Welcome to the profile statistics browser.", file=browser.stream)
        browser.cmdloop()
        print("Goodbye.", file=browser.stream)
    except KeyboardInterrupt:
        pass

# That's all, folks.
sre_compile.py000064400000064107151153537470007442 0ustar00#
# Secret Labs' Regular Expression Engine
#
# convert template to internal format
#
# Copyright (c) 1997-2001 by Secret Labs AB.  All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#

"""Internal support module for sre"""

import _sre
import sre_parse
from sre_constants import *

assert _sre.MAGIC == MAGIC, "SRE module mismatch"

_LITERAL_CODES = {LITERAL, NOT_LITERAL}
_REPEATING_CODES = {REPEAT, MIN_REPEAT, MAX_REPEAT}
_SUCCESS_CODES = {SUCCESS, FAILURE}
_ASSERT_CODES = {ASSERT, ASSERT_NOT}
_UNIT_CODES = _LITERAL_CODES | {ANY, IN}

# Sets of lowercase characters which have the same uppercase.
_equivalences = (
    # LATIN SMALL LETTER I, LATIN SMALL LETTER DOTLESS I
    (0x69, 0x131), # iı
    # LATIN SMALL LETTER S, LATIN SMALL LETTER LONG S
    (0x73, 0x17f), # sſ
    # MICRO SIGN, GREEK SMALL LETTER MU
    (0xb5, 0x3bc), # µμ
    # COMBINING GREEK YPOGEGRAMMENI, GREEK SMALL LETTER IOTA, GREEK PROSGEGRAMMENI
    (0x345, 0x3b9, 0x1fbe), # \u0345ιι
    # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS, GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA
    (0x390, 0x1fd3), # ΐΐ
    # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS, GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA
    (0x3b0, 0x1fe3), # ΰΰ
    # GREEK SMALL LETTER BETA, GREEK BETA SYMBOL
    (0x3b2, 0x3d0), # βϐ
    # GREEK SMALL LETTER EPSILON, GREEK LUNATE EPSILON SYMBOL
    (0x3b5, 0x3f5), # εϵ
    # GREEK SMALL LETTER THETA, GREEK THETA SYMBOL
    (0x3b8, 0x3d1), # θϑ
    # GREEK SMALL LETTER KAPPA, GREEK KAPPA SYMBOL
    (0x3ba, 0x3f0), # κϰ
    # GREEK SMALL LETTER PI, GREEK PI SYMBOL
    (0x3c0, 0x3d6), # πϖ
    # GREEK SMALL LETTER RHO, GREEK RHO SYMBOL
    (0x3c1, 0x3f1), # ρϱ
    # GREEK SMALL LETTER FINAL SIGMA, GREEK SMALL LETTER SIGMA
    (0x3c2, 0x3c3), # ςσ
    # GREEK SMALL LETTER PHI, GREEK PHI SYMBOL
    (0x3c6, 0x3d5), # φϕ
    # LATIN SMALL LETTER S WITH DOT ABOVE, LATIN SMALL LETTER LONG S WITH DOT ABOVE
    (0x1e61, 0x1e9b), # ṡẛ
    # LATIN SMALL LIGATURE LONG S T, LATIN SMALL LIGATURE ST
    (0xfb05, 0xfb06), # ſtst
)

# Maps the lowercase code to lowercase codes which have the same uppercase.
_ignorecase_fixes = {i: tuple(j for j in t if i != j)
                     for t in _equivalences for i in t}

def _combine_flags(flags, add_flags, del_flags,
                   TYPE_FLAGS=sre_parse.TYPE_FLAGS):
    if add_flags & TYPE_FLAGS:
        flags &= ~TYPE_FLAGS
    return (flags | add_flags) & ~del_flags

def _compile(code, pattern, flags):
    # internal: compile a (sub)pattern
    emit = code.append
    _len = len
    LITERAL_CODES = _LITERAL_CODES
    REPEATING_CODES = _REPEATING_CODES
    SUCCESS_CODES = _SUCCESS_CODES
    ASSERT_CODES = _ASSERT_CODES
    iscased = None
    tolower = None
    fixes = None
    if flags & SRE_FLAG_IGNORECASE and not flags & SRE_FLAG_LOCALE:
        if flags & SRE_FLAG_UNICODE:
            iscased = _sre.unicode_iscased
            tolower = _sre.unicode_tolower
            fixes = _ignorecase_fixes
        else:
            iscased = _sre.ascii_iscased
            tolower = _sre.ascii_tolower
    for op, av in pattern:
        if op in LITERAL_CODES:
            if not flags & SRE_FLAG_IGNORECASE:
                emit(op)
                emit(av)
            elif flags & SRE_FLAG_LOCALE:
                emit(OP_LOCALE_IGNORE[op])
                emit(av)
            elif not iscased(av):
                emit(op)
                emit(av)
            else:
                lo = tolower(av)
                if not fixes:  # ascii
                    emit(OP_IGNORE[op])
                    emit(lo)
                elif lo not in fixes:
                    emit(OP_UNICODE_IGNORE[op])
                    emit(lo)
                else:
                    emit(IN_UNI_IGNORE)
                    skip = _len(code); emit(0)
                    if op is NOT_LITERAL:
                        emit(NEGATE)
                    for k in (lo,) + fixes[lo]:
                        emit(LITERAL)
                        emit(k)
                    emit(FAILURE)
                    code[skip] = _len(code) - skip
        elif op is IN:
            charset, hascased = _optimize_charset(av, iscased, tolower, fixes)
            if flags & SRE_FLAG_IGNORECASE and flags & SRE_FLAG_LOCALE:
                emit(IN_LOC_IGNORE)
            elif not hascased:
                emit(IN)
            elif not fixes:  # ascii
                emit(IN_IGNORE)
            else:
                emit(IN_UNI_IGNORE)
            skip = _len(code); emit(0)
            _compile_charset(charset, flags, code)
            code[skip] = _len(code) - skip
        elif op is ANY:
            if flags & SRE_FLAG_DOTALL:
                emit(ANY_ALL)
            else:
                emit(ANY)
        elif op in REPEATING_CODES:
            if flags & SRE_FLAG_TEMPLATE:
                raise error("internal: unsupported template operator %r" % (op,))
            if _simple(av[2]):
                if op is MAX_REPEAT:
                    emit(REPEAT_ONE)
                else:
                    emit(MIN_REPEAT_ONE)
                skip = _len(code); emit(0)
                emit(av[0])
                emit(av[1])
                _compile(code, av[2], flags)
                emit(SUCCESS)
                code[skip] = _len(code) - skip
            else:
                emit(REPEAT)
                skip = _len(code); emit(0)
                emit(av[0])
                emit(av[1])
                _compile(code, av[2], flags)
                code[skip] = _len(code) - skip
                if op is MAX_REPEAT:
                    emit(MAX_UNTIL)
                else:
                    emit(MIN_UNTIL)
        elif op is SUBPATTERN:
            group, add_flags, del_flags, p = av
            if group:
                emit(MARK)
                emit((group-1)*2)
            # _compile_info(code, p, _combine_flags(flags, add_flags, del_flags))
            _compile(code, p, _combine_flags(flags, add_flags, del_flags))
            if group:
                emit(MARK)
                emit((group-1)*2+1)
        elif op in SUCCESS_CODES:
            emit(op)
        elif op in ASSERT_CODES:
            emit(op)
            skip = _len(code); emit(0)
            if av[0] >= 0:
                emit(0) # look ahead
            else:
                lo, hi = av[1].getwidth()
                if lo != hi:
                    raise error("look-behind requires fixed-width pattern")
                emit(lo) # look behind
            _compile(code, av[1], flags)
            emit(SUCCESS)
            code[skip] = _len(code) - skip
        elif op is CALL:
            emit(op)
            skip = _len(code); emit(0)
            _compile(code, av, flags)
            emit(SUCCESS)
            code[skip] = _len(code) - skip
        elif op is AT:
            emit(op)
            if flags & SRE_FLAG_MULTILINE:
                av = AT_MULTILINE.get(av, av)
            if flags & SRE_FLAG_LOCALE:
                av = AT_LOCALE.get(av, av)
            elif flags & SRE_FLAG_UNICODE:
                av = AT_UNICODE.get(av, av)
            emit(av)
        elif op is BRANCH:
            emit(op)
            tail = []
            tailappend = tail.append
            for av in av[1]:
                skip = _len(code); emit(0)
                # _compile_info(code, av, flags)
                _compile(code, av, flags)
                emit(JUMP)
                tailappend(_len(code)); emit(0)
                code[skip] = _len(code) - skip
            emit(FAILURE) # end of branch
            for tail in tail:
                code[tail] = _len(code) - tail
        elif op is CATEGORY:
            emit(op)
            if flags & SRE_FLAG_LOCALE:
                av = CH_LOCALE[av]
            elif flags & SRE_FLAG_UNICODE:
                av = CH_UNICODE[av]
            emit(av)
        elif op is GROUPREF:
            if not flags & SRE_FLAG_IGNORECASE:
                emit(op)
            elif flags & SRE_FLAG_LOCALE:
                emit(GROUPREF_LOC_IGNORE)
            elif not fixes:  # ascii
                emit(GROUPREF_IGNORE)
            else:
                emit(GROUPREF_UNI_IGNORE)
            emit(av-1)
        elif op is GROUPREF_EXISTS:
            emit(op)
            emit(av[0]-1)
            skipyes = _len(code); emit(0)
            _compile(code, av[1], flags)
            if av[2]:
                emit(JUMP)
                skipno = _len(code); emit(0)
                code[skipyes] = _len(code) - skipyes + 1
                _compile(code, av[2], flags)
                code[skipno] = _len(code) - skipno
            else:
                code[skipyes] = _len(code) - skipyes + 1
        else:
            raise error("internal: unsupported operand type %r" % (op,))

def _compile_charset(charset, flags, code):
    # compile charset subprogram
    emit = code.append
    for op, av in charset:
        emit(op)
        if op is NEGATE:
            pass
        elif op is LITERAL:
            emit(av)
        elif op is RANGE or op is RANGE_UNI_IGNORE:
            emit(av[0])
            emit(av[1])
        elif op is CHARSET:
            code.extend(av)
        elif op is BIGCHARSET:
            code.extend(av)
        elif op is CATEGORY:
            if flags & SRE_FLAG_LOCALE:
                emit(CH_LOCALE[av])
            elif flags & SRE_FLAG_UNICODE:
                emit(CH_UNICODE[av])
            else:
                emit(av)
        else:
            raise error("internal: unsupported set operator %r" % (op,))
    emit(FAILURE)

def _optimize_charset(charset, iscased=None, fixup=None, fixes=None):
    # internal: optimize character set
    out = []
    tail = []
    charmap = bytearray(256)
    hascased = False
    for op, av in charset:
        while True:
            try:
                if op is LITERAL:
                    if fixup:
                        lo = fixup(av)
                        charmap[lo] = 1
                        if fixes and lo in fixes:
                            for k in fixes[lo]:
                                charmap[k] = 1
                        if not hascased and iscased(av):
                            hascased = True
                    else:
                        charmap[av] = 1
                elif op is RANGE:
                    r = range(av[0], av[1]+1)
                    if fixup:
                        if fixes:
                            for i in map(fixup, r):
                                charmap[i] = 1
                                if i in fixes:
                                    for k in fixes[i]:
                                        charmap[k] = 1
                        else:
                            for i in map(fixup, r):
                                charmap[i] = 1
                        if not hascased:
                            hascased = any(map(iscased, r))
                    else:
                        for i in r:
                            charmap[i] = 1
                elif op is NEGATE:
                    out.append((op, av))
                else:
                    tail.append((op, av))
            except IndexError:
                if len(charmap) == 256:
                    # character set contains non-UCS1 character codes
                    charmap += b'\0' * 0xff00
                    continue
                # Character set contains non-BMP character codes.
                if fixup:
                    hascased = True
                    # There are only two ranges of cased non-BMP characters:
                    # 10400-1044F (Deseret) and 118A0-118DF (Warang Citi),
                    # and for both ranges RANGE_UNI_IGNORE works.
                    if op is RANGE:
                        op = RANGE_UNI_IGNORE
                tail.append((op, av))
            break

    # compress character map
    runs = []
    q = 0
    while True:
        p = charmap.find(1, q)
        if p < 0:
            break
        if len(runs) >= 2:
            runs = None
            break
        q = charmap.find(0, p)
        if q < 0:
            runs.append((p, len(charmap)))
            break
        runs.append((p, q))
    if runs is not None:
        # use literal/range
        for p, q in runs:
            if q - p == 1:
                out.append((LITERAL, p))
            else:
                out.append((RANGE, (p, q - 1)))
        out += tail
        # if the case was changed or new representation is more compact
        if hascased or len(out) < len(charset):
            return out, hascased
        # else original character set is good enough
        return charset, hascased

    # use bitmap
    if len(charmap) == 256:
        data = _mk_bitmap(charmap)
        out.append((CHARSET, data))
        out += tail
        return out, hascased

    # To represent a big charset, first a bitmap of all characters in the
    # set is constructed. Then, this bitmap is sliced into chunks of 256
    # characters, duplicate chunks are eliminated, and each chunk is
    # given a number. In the compiled expression, the charset is
    # represented by a 32-bit word sequence, consisting of one word for
    # the number of different chunks, a sequence of 256 bytes (64 words)
    # of chunk numbers indexed by their original chunk position, and a
    # sequence of 256-bit chunks (8 words each).

    # Compression is normally good: in a typical charset, large ranges of
    # Unicode will be either completely excluded (e.g. if only cyrillic
    # letters are to be matched), or completely included (e.g. if large
    # subranges of Kanji match). These ranges will be represented by
    # chunks of all one-bits or all zero-bits.

    # Matching can be also done efficiently: the more significant byte of
    # the Unicode character is an index into the chunk number, and the
    # less significant byte is a bit index in the chunk (just like the
    # CHARSET matching).

    charmap = bytes(charmap) # should be hashable
    comps = {}
    mapping = bytearray(256)
    block = 0
    data = bytearray()
    for i in range(0, 65536, 256):
        chunk = charmap[i: i + 256]
        if chunk in comps:
            mapping[i // 256] = comps[chunk]
        else:
            mapping[i // 256] = comps[chunk] = block
            block += 1
            data += chunk
    data = _mk_bitmap(data)
    data[0:0] = [block] + _bytes_to_codes(mapping)
    out.append((BIGCHARSET, data))
    out += tail
    return out, hascased

_CODEBITS = _sre.CODESIZE * 8
MAXCODE = (1 << _CODEBITS) - 1
_BITS_TRANS = b'0' + b'1' * 255
def _mk_bitmap(bits, _CODEBITS=_CODEBITS, _int=int):
    s = bits.translate(_BITS_TRANS)[::-1]
    return [_int(s[i - _CODEBITS: i], 2)
            for i in range(len(s), 0, -_CODEBITS)]

def _bytes_to_codes(b):
    # Convert block indices to word array
    a = memoryview(b).cast('I')
    assert a.itemsize == _sre.CODESIZE
    assert len(a) * a.itemsize == len(b)
    return a.tolist()

def _simple(p):
    # check if this subpattern is a "simple" operator
    if len(p) != 1:
        return False
    op, av = p[0]
    if op is SUBPATTERN:
        return av[0] is None and _simple(av[-1])
    return op in _UNIT_CODES

def _generate_overlap_table(prefix):
    """
    Generate an overlap table for the following prefix.
    An overlap table is a table of the same size as the prefix which
    informs about the potential self-overlap for each index in the prefix:
    - if overlap[i] == 0, prefix[i:] can't overlap prefix[0:...]
    - if overlap[i] == k with 0 < k <= i, prefix[i-k+1:i+1] overlaps with
      prefix[0:k]
    """
    table = [0] * len(prefix)
    for i in range(1, len(prefix)):
        idx = table[i - 1]
        while prefix[i] != prefix[idx]:
            if idx == 0:
                table[i] = 0
                break
            idx = table[idx - 1]
        else:
            table[i] = idx + 1
    return table

def _get_iscased(flags):
    if not flags & SRE_FLAG_IGNORECASE:
        return None
    elif flags & SRE_FLAG_UNICODE:
        return _sre.unicode_iscased
    else:
        return _sre.ascii_iscased

def _get_literal_prefix(pattern, flags):
    # look for literal prefix
    prefix = []
    prefixappend = prefix.append
    prefix_skip = None
    iscased = _get_iscased(flags)
    for op, av in pattern.data:
        if op is LITERAL:
            if iscased and iscased(av):
                break
            prefixappend(av)
        elif op is SUBPATTERN:
            group, add_flags, del_flags, p = av
            flags1 = _combine_flags(flags, add_flags, del_flags)
            if flags1 & SRE_FLAG_IGNORECASE and flags1 & SRE_FLAG_LOCALE:
                break
            prefix1, prefix_skip1, got_all = _get_literal_prefix(p, flags1)
            if prefix_skip is None:
                if group is not None:
                    prefix_skip = len(prefix)
                elif prefix_skip1 is not None:
                    prefix_skip = len(prefix) + prefix_skip1
            prefix.extend(prefix1)
            if not got_all:
                break
        else:
            break
    else:
        return prefix, prefix_skip, True
    return prefix, prefix_skip, False

def _get_charset_prefix(pattern, flags):
    while True:
        if not pattern.data:
            return None
        op, av = pattern.data[0]
        if op is not SUBPATTERN:
            break
        group, add_flags, del_flags, pattern = av
        flags = _combine_flags(flags, add_flags, del_flags)
        if flags & SRE_FLAG_IGNORECASE and flags & SRE_FLAG_LOCALE:
            return None

    iscased = _get_iscased(flags)
    if op is LITERAL:
        if iscased and iscased(av):
            return None
        return [(op, av)]
    elif op is BRANCH:
        charset = []
        charsetappend = charset.append
        for p in av[1]:
            if not p:
                return None
            op, av = p[0]
            if op is LITERAL and not (iscased and iscased(av)):
                charsetappend((op, av))
            else:
                return None
        return charset
    elif op is IN:
        charset = av
        if iscased:
            for op, av in charset:
                if op is LITERAL:
                    if iscased(av):
                        return None
                elif op is RANGE:
                    if av[1] > 0xffff:
                        return None
                    if any(map(iscased, range(av[0], av[1]+1))):
                        return None
        return charset
    return None

def _compile_info(code, pattern, flags):
    # internal: compile an info block.  in the current version,
    # this contains min/max pattern width, and an optional literal
    # prefix or a character map
    lo, hi = pattern.getwidth()
    if hi > MAXCODE:
        hi = MAXCODE
    if lo == 0:
        code.extend([INFO, 4, 0, lo, hi])
        return
    # look for a literal prefix
    prefix = []
    prefix_skip = 0
    charset = [] # not used
    if not (flags & SRE_FLAG_IGNORECASE and flags & SRE_FLAG_LOCALE):
        # look for literal prefix
        prefix, prefix_skip, got_all = _get_literal_prefix(pattern, flags)
        # if no prefix, look for charset prefix
        if not prefix:
            charset = _get_charset_prefix(pattern, flags)
##     if prefix:
##         print("*** PREFIX", prefix, prefix_skip)
##     if charset:
##         print("*** CHARSET", charset)
    # add an info block
    emit = code.append
    emit(INFO)
    skip = len(code); emit(0)
    # literal flag
    mask = 0
    if prefix:
        mask = SRE_INFO_PREFIX
        if prefix_skip is None and got_all:
            mask = mask | SRE_INFO_LITERAL
    elif charset:
        mask = mask | SRE_INFO_CHARSET
    emit(mask)
    # pattern length
    if lo < MAXCODE:
        emit(lo)
    else:
        emit(MAXCODE)
        prefix = prefix[:MAXCODE]
    emit(min(hi, MAXCODE))
    # add literal prefix
    if prefix:
        emit(len(prefix)) # length
        if prefix_skip is None:
            prefix_skip =  len(prefix)
        emit(prefix_skip) # skip
        code.extend(prefix)
        # generate overlap table
        code.extend(_generate_overlap_table(prefix))
    elif charset:
        charset, hascased = _optimize_charset(charset)
        assert not hascased
        _compile_charset(charset, flags, code)
    code[skip] = len(code) - skip

def isstring(obj):
    return isinstance(obj, (str, bytes))

def _code(p, flags):

    flags = p.state.flags | flags
    code = []

    # compile info block
    _compile_info(code, p, flags)

    # compile the pattern
    _compile(code, p.data, flags)

    code.append(SUCCESS)

    return code

def _hex_code(code):
    return '[%s]' % ', '.join('%#0*x' % (_sre.CODESIZE*2+2, x) for x in code)

def dis(code):
    import sys

    labels = set()
    level = 0
    offset_width = len(str(len(code) - 1))

    def dis_(start, end):
        def print_(*args, to=None):
            if to is not None:
                labels.add(to)
                args += ('(to %d)' % (to,),)
            print('%*d%s ' % (offset_width, start, ':' if start in labels else '.'),
                  end='  '*(level-1))
            print(*args)

        def print_2(*args):
            print(end=' '*(offset_width + 2*level))
            print(*args)

        nonlocal level
        level += 1
        i = start
        while i < end:
            start = i
            op = code[i]
            i += 1
            op = OPCODES[op]
            if op in (SUCCESS, FAILURE, ANY, ANY_ALL,
                      MAX_UNTIL, MIN_UNTIL, NEGATE):
                print_(op)
            elif op in (LITERAL, NOT_LITERAL,
                        LITERAL_IGNORE, NOT_LITERAL_IGNORE,
                        LITERAL_UNI_IGNORE, NOT_LITERAL_UNI_IGNORE,
                        LITERAL_LOC_IGNORE, NOT_LITERAL_LOC_IGNORE):
                arg = code[i]
                i += 1
                print_(op, '%#02x (%r)' % (arg, chr(arg)))
            elif op is AT:
                arg = code[i]
                i += 1
                arg = str(ATCODES[arg])
                assert arg[:3] == 'AT_'
                print_(op, arg[3:])
            elif op is CATEGORY:
                arg = code[i]
                i += 1
                arg = str(CHCODES[arg])
                assert arg[:9] == 'CATEGORY_'
                print_(op, arg[9:])
            elif op in (IN, IN_IGNORE, IN_UNI_IGNORE, IN_LOC_IGNORE):
                skip = code[i]
                print_(op, skip, to=i+skip)
                dis_(i+1, i+skip)
                i += skip
            elif op in (RANGE, RANGE_UNI_IGNORE):
                lo, hi = code[i: i+2]
                i += 2
                print_(op, '%#02x %#02x (%r-%r)' % (lo, hi, chr(lo), chr(hi)))
            elif op is CHARSET:
                print_(op, _hex_code(code[i: i + 256//_CODEBITS]))
                i += 256//_CODEBITS
            elif op is BIGCHARSET:
                arg = code[i]
                i += 1
                mapping = list(b''.join(x.to_bytes(_sre.CODESIZE, sys.byteorder)
                                        for x in code[i: i + 256//_sre.CODESIZE]))
                print_(op, arg, mapping)
                i += 256//_sre.CODESIZE
                level += 1
                for j in range(arg):
                    print_2(_hex_code(code[i: i + 256//_CODEBITS]))
                    i += 256//_CODEBITS
                level -= 1
            elif op in (MARK, GROUPREF, GROUPREF_IGNORE, GROUPREF_UNI_IGNORE,
                        GROUPREF_LOC_IGNORE):
                arg = code[i]
                i += 1
                print_(op, arg)
            elif op is JUMP:
                skip = code[i]
                print_(op, skip, to=i+skip)
                i += 1
            elif op is BRANCH:
                skip = code[i]
                print_(op, skip, to=i+skip)
                while skip:
                    dis_(i+1, i+skip)
                    i += skip
                    start = i
                    skip = code[i]
                    if skip:
                        print_('branch', skip, to=i+skip)
                    else:
                        print_(FAILURE)
                i += 1
            elif op in (REPEAT, REPEAT_ONE, MIN_REPEAT_ONE):
                skip, min, max = code[i: i+3]
                if max == MAXREPEAT:
                    max = 'MAXREPEAT'
                print_(op, skip, min, max, to=i+skip)
                dis_(i+3, i+skip)
                i += skip
            elif op is GROUPREF_EXISTS:
                arg, skip = code[i: i+2]
                print_(op, arg, skip, to=i+skip)
                i += 2
            elif op in (ASSERT, ASSERT_NOT):
                skip, arg = code[i: i+2]
                print_(op, skip, arg, to=i+skip)
                dis_(i+2, i+skip)
                i += skip
            elif op is INFO:
                skip, flags, min, max = code[i: i+4]
                if max == MAXREPEAT:
                    max = 'MAXREPEAT'
                print_(op, skip, bin(flags), min, max, to=i+skip)
                start = i+4
                if flags & SRE_INFO_PREFIX:
                    prefix_len, prefix_skip = code[i+4: i+6]
                    print_2('  prefix_skip', prefix_skip)
                    start = i + 6
                    prefix = code[start: start+prefix_len]
                    print_2('  prefix',
                            '[%s]' % ', '.join('%#02x' % x for x in prefix),
                            '(%r)' % ''.join(map(chr, prefix)))
                    start += prefix_len
                    print_2('  overlap', code[start: start+prefix_len])
                    start += prefix_len
                if flags & SRE_INFO_CHARSET:
                    level += 1
                    print_2('in')
                    dis_(start, i+skip)
                    level -= 1
                i += skip
            else:
                raise ValueError(op)

        level -= 1

    dis_(0, len(code))


def compile(p, flags=0):
    # internal: convert pattern list to internal format

    if isstring(p):
        pattern = p
        p = sre_parse.parse(p, flags)
    else:
        pattern = None

    code = _code(p, flags)

    if flags & SRE_FLAG_DEBUG:
        print()
        dis(code)

    # map in either direction
    groupindex = p.state.groupdict
    indexgroup = [None] * p.state.groups
    for k, i in groupindex.items():
        indexgroup[i] = k

    return _sre.compile(
        pattern, flags | p.state.flags, code,
        p.state.groups-1,
        groupindex, tuple(indexgroup)
        )
tempfile.py000064400000065621151153537470006750 0ustar00"""Temporary files.

This module provides generic, low- and high-level interfaces for
creating temporary files and directories.  All of the interfaces
provided by this module can be used without fear of race conditions
except for 'mktemp'.  'mktemp' is subject to race conditions and
should not be used; it is provided for backward compatibility only.

The default path names are returned as str.  If you supply bytes as
input, all return values will be in bytes.  Ex:

    >>> tempfile.mkstemp()
    (4, '/tmp/tmptpu9nin8')
    >>> tempfile.mkdtemp(suffix=b'')
    b'/tmp/tmppbi8f0hy'

This module also provides some data items to the user:

  TMP_MAX  - maximum number of names that will be tried before
             giving up.
  tempdir  - If this is set to a string before the first use of
             any routine from this module, it will be considered as
             another candidate location to store temporary files.
"""

__all__ = [
    "NamedTemporaryFile", "TemporaryFile", # high level safe interfaces
    "SpooledTemporaryFile", "TemporaryDirectory",
    "mkstemp", "mkdtemp",                  # low level safe interfaces
    "mktemp",                              # deprecated unsafe interface
    "TMP_MAX", "gettempprefix",            # constants
    "tempdir", "gettempdir",
    "gettempprefixb", "gettempdirb",
   ]


# Imports.

import functools as _functools
import warnings as _warnings
import io as _io
import os as _os
import shutil as _shutil
import errno as _errno
from random import Random as _Random
import sys as _sys
import weakref as _weakref
import _thread
_allocate_lock = _thread.allocate_lock

_text_openflags = _os.O_RDWR | _os.O_CREAT | _os.O_EXCL
if hasattr(_os, 'O_NOFOLLOW'):
    _text_openflags |= _os.O_NOFOLLOW

_bin_openflags = _text_openflags
if hasattr(_os, 'O_BINARY'):
    _bin_openflags |= _os.O_BINARY

if hasattr(_os, 'TMP_MAX'):
    TMP_MAX = _os.TMP_MAX
else:
    TMP_MAX = 10000

# This variable _was_ unused for legacy reasons, see issue 10354.
# But as of 3.5 we actually use it at runtime so changing it would
# have a possibly desirable side effect...  But we do not want to support
# that as an API.  It is undocumented on purpose.  Do not depend on this.
template = "tmp"

# Internal routines.

_once_lock = _allocate_lock()


def _exists(fn):
    try:
        _os.lstat(fn)
    except OSError:
        return False
    else:
        return True


def _infer_return_type(*args):
    """Look at the type of all args and divine their implied return type."""
    return_type = None
    for arg in args:
        if arg is None:
            continue
        if isinstance(arg, bytes):
            if return_type is str:
                raise TypeError("Can't mix bytes and non-bytes in "
                                "path components.")
            return_type = bytes
        else:
            if return_type is bytes:
                raise TypeError("Can't mix bytes and non-bytes in "
                                "path components.")
            return_type = str
    if return_type is None:
        return str  # tempfile APIs return a str by default.
    return return_type


def _sanitize_params(prefix, suffix, dir):
    """Common parameter processing for most APIs in this module."""
    output_type = _infer_return_type(prefix, suffix, dir)
    if suffix is None:
        suffix = output_type()
    if prefix is None:
        if output_type is str:
            prefix = template
        else:
            prefix = _os.fsencode(template)
    if dir is None:
        if output_type is str:
            dir = gettempdir()
        else:
            dir = gettempdirb()
    return prefix, suffix, dir, output_type


class _RandomNameSequence:
    """An instance of _RandomNameSequence generates an endless
    sequence of unpredictable strings which can safely be incorporated
    into file names.  Each string is eight characters long.  Multiple
    threads can safely use the same instance at the same time.

    _RandomNameSequence is an iterator."""

    characters = "abcdefghijklmnopqrstuvwxyz0123456789_"

    @property
    def rng(self):
        cur_pid = _os.getpid()
        if cur_pid != getattr(self, '_rng_pid', None):
            self._rng = _Random()
            self._rng_pid = cur_pid
        return self._rng

    def __iter__(self):
        return self

    def __next__(self):
        c = self.characters
        choose = self.rng.choice
        letters = [choose(c) for dummy in range(8)]
        return ''.join(letters)

def _candidate_tempdir_list():
    """Generate a list of candidate temporary directories which
    _get_default_tempdir will try."""

    dirlist = []

    # First, try the environment.
    for envname in 'TMPDIR', 'TEMP', 'TMP':
        dirname = _os.getenv(envname)
        if dirname: dirlist.append(dirname)

    # Failing that, try OS-specific locations.
    if _os.name == 'nt':
        dirlist.extend([ _os.path.expanduser(r'~\AppData\Local\Temp'),
                         _os.path.expandvars(r'%SYSTEMROOT%\Temp'),
                         r'c:\temp', r'c:\tmp', r'\temp', r'\tmp' ])
    else:
        dirlist.extend([ '/tmp', '/var/tmp', '/usr/tmp' ])

    # As a last resort, the current directory.
    try:
        dirlist.append(_os.getcwd())
    except (AttributeError, OSError):
        dirlist.append(_os.curdir)

    return dirlist

def _get_default_tempdir():
    """Calculate the default directory to use for temporary files.
    This routine should be called exactly once.

    We determine whether or not a candidate temp dir is usable by
    trying to create and write to a file in that directory.  If this
    is successful, the test file is deleted.  To prevent denial of
    service, the name of the test file must be randomized."""

    namer = _RandomNameSequence()
    dirlist = _candidate_tempdir_list()

    for dir in dirlist:
        if dir != _os.curdir:
            dir = _os.path.abspath(dir)
        # Try only a few names per directory.
        for seq in range(100):
            name = next(namer)
            filename = _os.path.join(dir, name)
            try:
                fd = _os.open(filename, _bin_openflags, 0o600)
                try:
                    try:
                        with _io.open(fd, 'wb', closefd=False) as fp:
                            fp.write(b'blat')
                    finally:
                        _os.close(fd)
                finally:
                    _os.unlink(filename)
                return dir
            except FileExistsError:
                pass
            except PermissionError:
                # This exception is thrown when a directory with the chosen name
                # already exists on windows.
                if (_os.name == 'nt' and _os.path.isdir(dir) and
                    _os.access(dir, _os.W_OK)):
                    continue
                break   # no point trying more names in this directory
            except OSError:
                break   # no point trying more names in this directory
    raise FileNotFoundError(_errno.ENOENT,
                            "No usable temporary directory found in %s" %
                            dirlist)

_name_sequence = None

def _get_candidate_names():
    """Common setup sequence for all user-callable interfaces."""

    global _name_sequence
    if _name_sequence is None:
        _once_lock.acquire()
        try:
            if _name_sequence is None:
                _name_sequence = _RandomNameSequence()
        finally:
            _once_lock.release()
    return _name_sequence


def _mkstemp_inner(dir, pre, suf, flags, output_type):
    """Code common to mkstemp, TemporaryFile, and NamedTemporaryFile."""

    names = _get_candidate_names()
    if output_type is bytes:
        names = map(_os.fsencode, names)

    for seq in range(TMP_MAX):
        name = next(names)
        file = _os.path.join(dir, pre + name + suf)
        _sys.audit("tempfile.mkstemp", file)
        try:
            fd = _os.open(file, flags, 0o600)
        except FileExistsError:
            continue    # try again
        except PermissionError:
            # This exception is thrown when a directory with the chosen name
            # already exists on windows.
            if (_os.name == 'nt' and _os.path.isdir(dir) and
                _os.access(dir, _os.W_OK)):
                continue
            else:
                raise
        return (fd, _os.path.abspath(file))

    raise FileExistsError(_errno.EEXIST,
                          "No usable temporary file name found")


# User visible interfaces.

def gettempprefix():
    """The default prefix for temporary directories."""
    return template

def gettempprefixb():
    """The default prefix for temporary directories as bytes."""
    return _os.fsencode(gettempprefix())

tempdir = None

def gettempdir():
    """Accessor for tempfile.tempdir."""
    global tempdir
    if tempdir is None:
        _once_lock.acquire()
        try:
            if tempdir is None:
                tempdir = _get_default_tempdir()
        finally:
            _once_lock.release()
    return tempdir

def gettempdirb():
    """A bytes version of tempfile.gettempdir()."""
    return _os.fsencode(gettempdir())

def mkstemp(suffix=None, prefix=None, dir=None, text=False):
    """User-callable function to create and return a unique temporary
    file.  The return value is a pair (fd, name) where fd is the
    file descriptor returned by os.open, and name is the filename.

    If 'suffix' is not None, the file name will end with that suffix,
    otherwise there will be no suffix.

    If 'prefix' is not None, the file name will begin with that prefix,
    otherwise a default prefix is used.

    If 'dir' is not None, the file will be created in that directory,
    otherwise a default directory is used.

    If 'text' is specified and true, the file is opened in text
    mode.  Else (the default) the file is opened in binary mode.

    If any of 'suffix', 'prefix' and 'dir' are not None, they must be the
    same type.  If they are bytes, the returned name will be bytes; str
    otherwise.

    The file is readable and writable only by the creating user ID.
    If the operating system uses permission bits to indicate whether a
    file is executable, the file is executable by no one. The file
    descriptor is not inherited by children of this process.

    Caller is responsible for deleting the file when done with it.
    """

    prefix, suffix, dir, output_type = _sanitize_params(prefix, suffix, dir)

    if text:
        flags = _text_openflags
    else:
        flags = _bin_openflags

    return _mkstemp_inner(dir, prefix, suffix, flags, output_type)


def mkdtemp(suffix=None, prefix=None, dir=None):
    """User-callable function to create and return a unique temporary
    directory.  The return value is the pathname of the directory.

    Arguments are as for mkstemp, except that the 'text' argument is
    not accepted.

    The directory is readable, writable, and searchable only by the
    creating user.

    Caller is responsible for deleting the directory when done with it.
    """

    prefix, suffix, dir, output_type = _sanitize_params(prefix, suffix, dir)

    names = _get_candidate_names()
    if output_type is bytes:
        names = map(_os.fsencode, names)

    for seq in range(TMP_MAX):
        name = next(names)
        file = _os.path.join(dir, prefix + name + suffix)
        _sys.audit("tempfile.mkdtemp", file)
        try:
            _os.mkdir(file, 0o700)
        except FileExistsError:
            continue    # try again
        except PermissionError:
            # This exception is thrown when a directory with the chosen name
            # already exists on windows.
            if (_os.name == 'nt' and _os.path.isdir(dir) and
                _os.access(dir, _os.W_OK)):
                continue
            else:
                raise
        return file

    raise FileExistsError(_errno.EEXIST,
                          "No usable temporary directory name found")

def mktemp(suffix="", prefix=template, dir=None):
    """User-callable function to return a unique temporary file name.  The
    file is not created.

    Arguments are similar to mkstemp, except that the 'text' argument is
    not accepted, and suffix=None, prefix=None and bytes file names are not
    supported.

    THIS FUNCTION IS UNSAFE AND SHOULD NOT BE USED.  The file name may
    refer to a file that did not exist at some point, but by the time
    you get around to creating it, someone else may have beaten you to
    the punch.
    """

##    from warnings import warn as _warn
##    _warn("mktemp is a potential security risk to your program",
##          RuntimeWarning, stacklevel=2)

    if dir is None:
        dir = gettempdir()

    names = _get_candidate_names()
    for seq in range(TMP_MAX):
        name = next(names)
        file = _os.path.join(dir, prefix + name + suffix)
        if not _exists(file):
            return file

    raise FileExistsError(_errno.EEXIST,
                          "No usable temporary filename found")


class _TemporaryFileCloser:
    """A separate object allowing proper closing of a temporary file's
    underlying file object, without adding a __del__ method to the
    temporary file."""

    file = None  # Set here since __del__ checks it
    close_called = False

    def __init__(self, file, name, delete=True):
        self.file = file
        self.name = name
        self.delete = delete

    # NT provides delete-on-close as a primitive, so we don't need
    # the wrapper to do anything special.  We still use it so that
    # file.name is useful (i.e. not "(fdopen)") with NamedTemporaryFile.
    if _os.name != 'nt':
        # Cache the unlinker so we don't get spurious errors at
        # shutdown when the module-level "os" is None'd out.  Note
        # that this must be referenced as self.unlink, because the
        # name TemporaryFileWrapper may also get None'd out before
        # __del__ is called.

        def close(self, unlink=_os.unlink):
            if not self.close_called and self.file is not None:
                self.close_called = True
                try:
                    self.file.close()
                finally:
                    if self.delete:
                        unlink(self.name)

        # Need to ensure the file is deleted on __del__
        def __del__(self):
            self.close()

    else:
        def close(self):
            if not self.close_called:
                self.close_called = True
                self.file.close()


class _TemporaryFileWrapper:
    """Temporary file wrapper

    This class provides a wrapper around files opened for
    temporary use.  In particular, it seeks to automatically
    remove the file when it is no longer needed.
    """

    def __init__(self, file, name, delete=True):
        self.file = file
        self.name = name
        self.delete = delete
        self._closer = _TemporaryFileCloser(file, name, delete)

    def __getattr__(self, name):
        # Attribute lookups are delegated to the underlying file
        # and cached for non-numeric results
        # (i.e. methods are cached, closed and friends are not)
        file = self.__dict__['file']
        a = getattr(file, name)
        if hasattr(a, '__call__'):
            func = a
            @_functools.wraps(func)
            def func_wrapper(*args, **kwargs):
                return func(*args, **kwargs)
            # Avoid closing the file as long as the wrapper is alive,
            # see issue #18879.
            func_wrapper._closer = self._closer
            a = func_wrapper
        if not isinstance(a, int):
            setattr(self, name, a)
        return a

    # The underlying __enter__ method returns the wrong object
    # (self.file) so override it to return the wrapper
    def __enter__(self):
        self.file.__enter__()
        return self

    # Need to trap __exit__ as well to ensure the file gets
    # deleted when used in a with statement
    def __exit__(self, exc, value, tb):
        result = self.file.__exit__(exc, value, tb)
        self.close()
        return result

    def close(self):
        """
        Close the temporary file, possibly deleting it.
        """
        self._closer.close()

    # iter() doesn't use __getattr__ to find the __iter__ method
    def __iter__(self):
        # Don't return iter(self.file), but yield from it to avoid closing
        # file as long as it's being used as iterator (see issue #23700).  We
        # can't use 'yield from' here because iter(file) returns the file
        # object itself, which has a close method, and thus the file would get
        # closed when the generator is finalized, due to PEP380 semantics.
        for line in self.file:
            yield line


def NamedTemporaryFile(mode='w+b', buffering=-1, encoding=None,
                       newline=None, suffix=None, prefix=None,
                       dir=None, delete=True, *, errors=None):
    """Create and return a temporary file.
    Arguments:
    'prefix', 'suffix', 'dir' -- as for mkstemp.
    'mode' -- the mode argument to io.open (default "w+b").
    'buffering' -- the buffer size argument to io.open (default -1).
    'encoding' -- the encoding argument to io.open (default None)
    'newline' -- the newline argument to io.open (default None)
    'delete' -- whether the file is deleted on close (default True).
    'errors' -- the errors argument to io.open (default None)
    The file is created as mkstemp() would do it.

    Returns an object with a file-like interface; the name of the file
    is accessible as its 'name' attribute.  The file will be automatically
    deleted when it is closed unless the 'delete' argument is set to False.
    """

    prefix, suffix, dir, output_type = _sanitize_params(prefix, suffix, dir)

    flags = _bin_openflags

    # Setting O_TEMPORARY in the flags causes the OS to delete
    # the file when it is closed.  This is only supported by Windows.
    if _os.name == 'nt' and delete:
        flags |= _os.O_TEMPORARY

    (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
    try:
        file = _io.open(fd, mode, buffering=buffering,
                        newline=newline, encoding=encoding, errors=errors)

        return _TemporaryFileWrapper(file, name, delete)
    except BaseException:
        _os.unlink(name)
        _os.close(fd)
        raise

if _os.name != 'posix' or _sys.platform == 'cygwin':
    # On non-POSIX and Cygwin systems, assume that we cannot unlink a file
    # while it is open.
    TemporaryFile = NamedTemporaryFile

else:
    # Is the O_TMPFILE flag available and does it work?
    # The flag is set to False if os.open(dir, os.O_TMPFILE) raises an
    # IsADirectoryError exception
    _O_TMPFILE_WORKS = hasattr(_os, 'O_TMPFILE')

    def TemporaryFile(mode='w+b', buffering=-1, encoding=None,
                      newline=None, suffix=None, prefix=None,
                      dir=None, *, errors=None):
        """Create and return a temporary file.
        Arguments:
        'prefix', 'suffix', 'dir' -- as for mkstemp.
        'mode' -- the mode argument to io.open (default "w+b").
        'buffering' -- the buffer size argument to io.open (default -1).
        'encoding' -- the encoding argument to io.open (default None)
        'newline' -- the newline argument to io.open (default None)
        'errors' -- the errors argument to io.open (default None)
        The file is created as mkstemp() would do it.

        Returns an object with a file-like interface.  The file has no
        name, and will cease to exist when it is closed.
        """
        global _O_TMPFILE_WORKS

        prefix, suffix, dir, output_type = _sanitize_params(prefix, suffix, dir)

        flags = _bin_openflags
        if _O_TMPFILE_WORKS:
            try:
                flags2 = (flags | _os.O_TMPFILE) & ~_os.O_CREAT
                fd = _os.open(dir, flags2, 0o600)
            except IsADirectoryError:
                # Linux kernel older than 3.11 ignores the O_TMPFILE flag:
                # O_TMPFILE is read as O_DIRECTORY. Trying to open a directory
                # with O_RDWR|O_DIRECTORY fails with IsADirectoryError, a
                # directory cannot be open to write. Set flag to False to not
                # try again.
                _O_TMPFILE_WORKS = False
            except OSError:
                # The filesystem of the directory does not support O_TMPFILE.
                # For example, OSError(95, 'Operation not supported').
                #
                # On Linux kernel older than 3.11, trying to open a regular
                # file (or a symbolic link to a regular file) with O_TMPFILE
                # fails with NotADirectoryError, because O_TMPFILE is read as
                # O_DIRECTORY.
                pass
            else:
                try:
                    return _io.open(fd, mode, buffering=buffering,
                                    newline=newline, encoding=encoding,
                                    errors=errors)
                except:
                    _os.close(fd)
                    raise
            # Fallback to _mkstemp_inner().

        (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
        try:
            _os.unlink(name)
            return _io.open(fd, mode, buffering=buffering,
                            newline=newline, encoding=encoding, errors=errors)
        except:
            _os.close(fd)
            raise

class SpooledTemporaryFile:
    """Temporary file wrapper, specialized to switch from BytesIO
    or StringIO to a real file when it exceeds a certain size or
    when a fileno is needed.
    """
    _rolled = False

    def __init__(self, max_size=0, mode='w+b', buffering=-1,
                 encoding=None, newline=None,
                 suffix=None, prefix=None, dir=None, *, errors=None):
        if 'b' in mode:
            self._file = _io.BytesIO()
        else:
            self._file = _io.TextIOWrapper(_io.BytesIO(),
                            encoding=encoding, errors=errors,
                            newline=newline)
        self._max_size = max_size
        self._rolled = False
        self._TemporaryFileArgs = {'mode': mode, 'buffering': buffering,
                                   'suffix': suffix, 'prefix': prefix,
                                   'encoding': encoding, 'newline': newline,
                                   'dir': dir, 'errors': errors}

    def _check(self, file):
        if self._rolled: return
        max_size = self._max_size
        if max_size and file.tell() > max_size:
            self.rollover()

    def rollover(self):
        if self._rolled: return
        file = self._file
        newfile = self._file = TemporaryFile(**self._TemporaryFileArgs)
        del self._TemporaryFileArgs

        pos = file.tell()
        if hasattr(newfile, 'buffer'):
            newfile.buffer.write(file.detach().getvalue())
        else:
            newfile.write(file.getvalue())
        newfile.seek(pos, 0)

        self._rolled = True

    # The method caching trick from NamedTemporaryFile
    # won't work here, because _file may change from a
    # BytesIO/StringIO instance to a real file. So we list
    # all the methods directly.

    # Context management protocol
    def __enter__(self):
        if self._file.closed:
            raise ValueError("Cannot enter context with closed file")
        return self

    def __exit__(self, exc, value, tb):
        self._file.close()

    # file protocol
    def __iter__(self):
        return self._file.__iter__()

    def close(self):
        self._file.close()

    @property
    def closed(self):
        return self._file.closed

    @property
    def encoding(self):
        return self._file.encoding

    @property
    def errors(self):
        return self._file.errors

    def fileno(self):
        self.rollover()
        return self._file.fileno()

    def flush(self):
        self._file.flush()

    def isatty(self):
        return self._file.isatty()

    @property
    def mode(self):
        try:
            return self._file.mode
        except AttributeError:
            return self._TemporaryFileArgs['mode']

    @property
    def name(self):
        try:
            return self._file.name
        except AttributeError:
            return None

    @property
    def newlines(self):
        return self._file.newlines

    def read(self, *args):
        return self._file.read(*args)

    def readline(self, *args):
        return self._file.readline(*args)

    def readlines(self, *args):
        return self._file.readlines(*args)

    def seek(self, *args):
        return self._file.seek(*args)

    @property
    def softspace(self):
        return self._file.softspace

    def tell(self):
        return self._file.tell()

    def truncate(self, size=None):
        if size is None:
            self._file.truncate()
        else:
            if size > self._max_size:
                self.rollover()
            self._file.truncate(size)

    def write(self, s):
        file = self._file
        rv = file.write(s)
        self._check(file)
        return rv

    def writelines(self, iterable):
        file = self._file
        rv = file.writelines(iterable)
        self._check(file)
        return rv


class TemporaryDirectory(object):
    """Create and return a temporary directory.  This has the same
    behavior as mkdtemp but can be used as a context manager.  For
    example:

        with TemporaryDirectory() as tmpdir:
            ...

    Upon exiting the context, the directory and everything contained
    in it are removed.
    """

    def __init__(self, suffix=None, prefix=None, dir=None):
        self.name = mkdtemp(suffix, prefix, dir)
        self._finalizer = _weakref.finalize(
            self, self._cleanup, self.name,
            warn_message="Implicitly cleaning up {!r}".format(self))

    @classmethod
    def _rmtree(cls, name):
        def onerror(func, path, exc_info):
            if issubclass(exc_info[0], PermissionError):
                def resetperms(path):
                    try:
                        _os.chflags(path, 0)
                    except AttributeError:
                        pass
                    _os.chmod(path, 0o700)

                try:
                    if path != name:
                        resetperms(_os.path.dirname(path))
                    resetperms(path)

                    try:
                        _os.unlink(path)
                    # PermissionError is raised on FreeBSD for directories
                    except (IsADirectoryError, PermissionError):
                        cls._rmtree(path)
                except FileNotFoundError:
                    pass
            elif issubclass(exc_info[0], FileNotFoundError):
                pass
            else:
                raise

        _shutil.rmtree(name, onerror=onerror)

    @classmethod
    def _cleanup(cls, name, warn_message):
        cls._rmtree(name)
        _warnings.warn(warn_message, ResourceWarning)

    def __repr__(self):
        return "<{} {!r}>".format(self.__class__.__name__, self.name)

    def __enter__(self):
        return self.name

    def __exit__(self, exc, value, tb):
        self.cleanup()

    def cleanup(self):
        if self._finalizer.detach():
            self._rmtree(self.name)
_pydecimal.py000064400000676472151153537470007265 0ustar00# Copyright (c) 2004 Python Software Foundation.
# All rights reserved.

# Written by Eric Price <eprice at tjhsst.edu>
#    and Facundo Batista <facundo at taniquetil.com.ar>
#    and Raymond Hettinger <python at rcn.com>
#    and Aahz <aahz at pobox.com>
#    and Tim Peters

# This module should be kept in sync with the latest updates of the
# IBM specification as it evolves.  Those updates will be treated
# as bug fixes (deviation from the spec is a compatibility, usability
# bug) and will be backported.  At this point the spec is stabilizing
# and the updates are becoming fewer, smaller, and less significant.

"""
This is an implementation of decimal floating point arithmetic based on
the General Decimal Arithmetic Specification:

    http://speleotrove.com/decimal/decarith.html

and IEEE standard 854-1987:

    http://en.wikipedia.org/wiki/IEEE_854-1987

Decimal floating point has finite precision with arbitrarily large bounds.

The purpose of this module is to support arithmetic using familiar
"schoolhouse" rules and to avoid some of the tricky representation
issues associated with binary floating point.  The package is especially
useful for financial applications or for contexts where users have
expectations that are at odds with binary floating point (for instance,
in binary floating point, 1.00 % 0.1 gives 0.09999999999999995 instead
of 0.0; Decimal('1.00') % Decimal('0.1') returns the expected
Decimal('0.00')).

Here are some examples of using the decimal module:

>>> from decimal import *
>>> setcontext(ExtendedContext)
>>> Decimal(0)
Decimal('0')
>>> Decimal('1')
Decimal('1')
>>> Decimal('-.0123')
Decimal('-0.0123')
>>> Decimal(123456)
Decimal('123456')
>>> Decimal('123.45e12345678')
Decimal('1.2345E+12345680')
>>> Decimal('1.33') + Decimal('1.27')
Decimal('2.60')
>>> Decimal('12.34') + Decimal('3.87') - Decimal('18.41')
Decimal('-2.20')
>>> dig = Decimal(1)
>>> print(dig / Decimal(3))
0.333333333
>>> getcontext().prec = 18
>>> print(dig / Decimal(3))
0.333333333333333333
>>> print(dig.sqrt())
1
>>> print(Decimal(3).sqrt())
1.73205080756887729
>>> print(Decimal(3) ** 123)
4.85192780976896427E+58
>>> inf = Decimal(1) / Decimal(0)
>>> print(inf)
Infinity
>>> neginf = Decimal(-1) / Decimal(0)
>>> print(neginf)
-Infinity
>>> print(neginf + inf)
NaN
>>> print(neginf * inf)
-Infinity
>>> print(dig / 0)
Infinity
>>> getcontext().traps[DivisionByZero] = 1
>>> print(dig / 0)
Traceback (most recent call last):
  ...
  ...
  ...
decimal.DivisionByZero: x / 0
>>> c = Context()
>>> c.traps[InvalidOperation] = 0
>>> print(c.flags[InvalidOperation])
0
>>> c.divide(Decimal(0), Decimal(0))
Decimal('NaN')
>>> c.traps[InvalidOperation] = 1
>>> print(c.flags[InvalidOperation])
1
>>> c.flags[InvalidOperation] = 0
>>> print(c.flags[InvalidOperation])
0
>>> print(c.divide(Decimal(0), Decimal(0)))
Traceback (most recent call last):
  ...
  ...
  ...
decimal.InvalidOperation: 0 / 0
>>> print(c.flags[InvalidOperation])
1
>>> c.flags[InvalidOperation] = 0
>>> c.traps[InvalidOperation] = 0
>>> print(c.divide(Decimal(0), Decimal(0)))
NaN
>>> print(c.flags[InvalidOperation])
1
>>>
"""

__all__ = [
    # Two major classes
    'Decimal', 'Context',

    # Named tuple representation
    'DecimalTuple',

    # Contexts
    'DefaultContext', 'BasicContext', 'ExtendedContext',

    # Exceptions
    'DecimalException', 'Clamped', 'InvalidOperation', 'DivisionByZero',
    'Inexact', 'Rounded', 'Subnormal', 'Overflow', 'Underflow',
    'FloatOperation',

    # Exceptional conditions that trigger InvalidOperation
    'DivisionImpossible', 'InvalidContext', 'ConversionSyntax', 'DivisionUndefined',

    # Constants for use in setting up contexts
    'ROUND_DOWN', 'ROUND_HALF_UP', 'ROUND_HALF_EVEN', 'ROUND_CEILING',
    'ROUND_FLOOR', 'ROUND_UP', 'ROUND_HALF_DOWN', 'ROUND_05UP',

    # Functions for manipulating contexts
    'setcontext', 'getcontext', 'localcontext',

    # Limits for the C version for compatibility
    'MAX_PREC',  'MAX_EMAX', 'MIN_EMIN', 'MIN_ETINY',

    # C version: compile time choice that enables the thread local context (deprecated, now always true)
    'HAVE_THREADS',

    # C version: compile time choice that enables the coroutine local context
    'HAVE_CONTEXTVAR'
]

__xname__ = __name__    # sys.modules lookup (--without-threads)
__name__ = 'decimal'    # For pickling
__version__ = '1.70'    # Highest version of the spec this complies with
                        # See http://speleotrove.com/decimal/
__libmpdec_version__ = "2.4.2" # compatible libmpdec version

import math as _math
import numbers as _numbers
import sys

try:
    from collections import namedtuple as _namedtuple
    DecimalTuple = _namedtuple('DecimalTuple', 'sign digits exponent')
except ImportError:
    DecimalTuple = lambda *args: args

# Rounding
ROUND_DOWN = 'ROUND_DOWN'
ROUND_HALF_UP = 'ROUND_HALF_UP'
ROUND_HALF_EVEN = 'ROUND_HALF_EVEN'
ROUND_CEILING = 'ROUND_CEILING'
ROUND_FLOOR = 'ROUND_FLOOR'
ROUND_UP = 'ROUND_UP'
ROUND_HALF_DOWN = 'ROUND_HALF_DOWN'
ROUND_05UP = 'ROUND_05UP'

# Compatibility with the C version
HAVE_THREADS = True
HAVE_CONTEXTVAR = True
if sys.maxsize == 2**63-1:
    MAX_PREC = 999999999999999999
    MAX_EMAX = 999999999999999999
    MIN_EMIN = -999999999999999999
else:
    MAX_PREC = 425000000
    MAX_EMAX = 425000000
    MIN_EMIN = -425000000

MIN_ETINY = MIN_EMIN - (MAX_PREC-1)

# Errors

class DecimalException(ArithmeticError):
    """Base exception class.

    Used exceptions derive from this.
    If an exception derives from another exception besides this (such as
    Underflow (Inexact, Rounded, Subnormal) that indicates that it is only
    called if the others are present.  This isn't actually used for
    anything, though.

    handle  -- Called when context._raise_error is called and the
               trap_enabler is not set.  First argument is self, second is the
               context.  More arguments can be given, those being after
               the explanation in _raise_error (For example,
               context._raise_error(NewError, '(-x)!', self._sign) would
               call NewError().handle(context, self._sign).)

    To define a new exception, it should be sufficient to have it derive
    from DecimalException.
    """
    def handle(self, context, *args):
        pass


class Clamped(DecimalException):
    """Exponent of a 0 changed to fit bounds.

    This occurs and signals clamped if the exponent of a result has been
    altered in order to fit the constraints of a specific concrete
    representation.  This may occur when the exponent of a zero result would
    be outside the bounds of a representation, or when a large normal
    number would have an encoded exponent that cannot be represented.  In
    this latter case, the exponent is reduced to fit and the corresponding
    number of zero digits are appended to the coefficient ("fold-down").
    """

class InvalidOperation(DecimalException):
    """An invalid operation was performed.

    Various bad things cause this:

    Something creates a signaling NaN
    -INF + INF
    0 * (+-)INF
    (+-)INF / (+-)INF
    x % 0
    (+-)INF % x
    x._rescale( non-integer )
    sqrt(-x) , x > 0
    0 ** 0
    x ** (non-integer)
    x ** (+-)INF
    An operand is invalid

    The result of the operation after these is a quiet positive NaN,
    except when the cause is a signaling NaN, in which case the result is
    also a quiet NaN, but with the original sign, and an optional
    diagnostic information.
    """
    def handle(self, context, *args):
        if args:
            ans = _dec_from_triple(args[0]._sign, args[0]._int, 'n', True)
            return ans._fix_nan(context)
        return _NaN

class ConversionSyntax(InvalidOperation):
    """Trying to convert badly formed string.

    This occurs and signals invalid-operation if a string is being
    converted to a number and it does not conform to the numeric string
    syntax.  The result is [0,qNaN].
    """
    def handle(self, context, *args):
        return _NaN

class DivisionByZero(DecimalException, ZeroDivisionError):
    """Division by 0.

    This occurs and signals division-by-zero if division of a finite number
    by zero was attempted (during a divide-integer or divide operation, or a
    power operation with negative right-hand operand), and the dividend was
    not zero.

    The result of the operation is [sign,inf], where sign is the exclusive
    or of the signs of the operands for divide, or is 1 for an odd power of
    -0, for power.
    """

    def handle(self, context, sign, *args):
        return _SignedInfinity[sign]

class DivisionImpossible(InvalidOperation):
    """Cannot perform the division adequately.

    This occurs and signals invalid-operation if the integer result of a
    divide-integer or remainder operation had too many digits (would be
    longer than precision).  The result is [0,qNaN].
    """

    def handle(self, context, *args):
        return _NaN

class DivisionUndefined(InvalidOperation, ZeroDivisionError):
    """Undefined result of division.

    This occurs and signals invalid-operation if division by zero was
    attempted (during a divide-integer, divide, or remainder operation), and
    the dividend is also zero.  The result is [0,qNaN].
    """

    def handle(self, context, *args):
        return _NaN

class Inexact(DecimalException):
    """Had to round, losing information.

    This occurs and signals inexact whenever the result of an operation is
    not exact (that is, it needed to be rounded and any discarded digits
    were non-zero), or if an overflow or underflow condition occurs.  The
    result in all cases is unchanged.

    The inexact signal may be tested (or trapped) to determine if a given
    operation (or sequence of operations) was inexact.
    """

class InvalidContext(InvalidOperation):
    """Invalid context.  Unknown rounding, for example.

    This occurs and signals invalid-operation if an invalid context was
    detected during an operation.  This can occur if contexts are not checked
    on creation and either the precision exceeds the capability of the
    underlying concrete representation or an unknown or unsupported rounding
    was specified.  These aspects of the context need only be checked when
    the values are required to be used.  The result is [0,qNaN].
    """

    def handle(self, context, *args):
        return _NaN

class Rounded(DecimalException):
    """Number got rounded (not  necessarily changed during rounding).

    This occurs and signals rounded whenever the result of an operation is
    rounded (that is, some zero or non-zero digits were discarded from the
    coefficient), or if an overflow or underflow condition occurs.  The
    result in all cases is unchanged.

    The rounded signal may be tested (or trapped) to determine if a given
    operation (or sequence of operations) caused a loss of precision.
    """

class Subnormal(DecimalException):
    """Exponent < Emin before rounding.

    This occurs and signals subnormal whenever the result of a conversion or
    operation is subnormal (that is, its adjusted exponent is less than
    Emin, before any rounding).  The result in all cases is unchanged.

    The subnormal signal may be tested (or trapped) to determine if a given
    or operation (or sequence of operations) yielded a subnormal result.
    """

class Overflow(Inexact, Rounded):
    """Numerical overflow.

    This occurs and signals overflow if the adjusted exponent of a result
    (from a conversion or from an operation that is not an attempt to divide
    by zero), after rounding, would be greater than the largest value that
    can be handled by the implementation (the value Emax).

    The result depends on the rounding mode:

    For round-half-up and round-half-even (and for round-half-down and
    round-up, if implemented), the result of the operation is [sign,inf],
    where sign is the sign of the intermediate result.  For round-down, the
    result is the largest finite number that can be represented in the
    current precision, with the sign of the intermediate result.  For
    round-ceiling, the result is the same as for round-down if the sign of
    the intermediate result is 1, or is [0,inf] otherwise.  For round-floor,
    the result is the same as for round-down if the sign of the intermediate
    result is 0, or is [1,inf] otherwise.  In all cases, Inexact and Rounded
    will also be raised.
    """

    def handle(self, context, sign, *args):
        if context.rounding in (ROUND_HALF_UP, ROUND_HALF_EVEN,
                                ROUND_HALF_DOWN, ROUND_UP):
            return _SignedInfinity[sign]
        if sign == 0:
            if context.rounding == ROUND_CEILING:
                return _SignedInfinity[sign]
            return _dec_from_triple(sign, '9'*context.prec,
                            context.Emax-context.prec+1)
        if sign == 1:
            if context.rounding == ROUND_FLOOR:
                return _SignedInfinity[sign]
            return _dec_from_triple(sign, '9'*context.prec,
                             context.Emax-context.prec+1)


class Underflow(Inexact, Rounded, Subnormal):
    """Numerical underflow with result rounded to 0.

    This occurs and signals underflow if a result is inexact and the
    adjusted exponent of the result would be smaller (more negative) than
    the smallest value that can be handled by the implementation (the value
    Emin).  That is, the result is both inexact and subnormal.

    The result after an underflow will be a subnormal number rounded, if
    necessary, so that its exponent is not less than Etiny.  This may result
    in 0 with the sign of the intermediate result and an exponent of Etiny.

    In all cases, Inexact, Rounded, and Subnormal will also be raised.
    """

class FloatOperation(DecimalException, TypeError):
    """Enable stricter semantics for mixing floats and Decimals.

    If the signal is not trapped (default), mixing floats and Decimals is
    permitted in the Decimal() constructor, context.create_decimal() and
    all comparison operators. Both conversion and comparisons are exact.
    Any occurrence of a mixed operation is silently recorded by setting
    FloatOperation in the context flags.  Explicit conversions with
    Decimal.from_float() or context.create_decimal_from_float() do not
    set the flag.

    Otherwise (the signal is trapped), only equality comparisons and explicit
    conversions are silent. All other mixed operations raise FloatOperation.
    """

# List of public traps and flags
_signals = [Clamped, DivisionByZero, Inexact, Overflow, Rounded,
            Underflow, InvalidOperation, Subnormal, FloatOperation]

# Map conditions (per the spec) to signals
_condition_map = {ConversionSyntax:InvalidOperation,
                  DivisionImpossible:InvalidOperation,
                  DivisionUndefined:InvalidOperation,
                  InvalidContext:InvalidOperation}

# Valid rounding modes
_rounding_modes = (ROUND_DOWN, ROUND_HALF_UP, ROUND_HALF_EVEN, ROUND_CEILING,
                   ROUND_FLOOR, ROUND_UP, ROUND_HALF_DOWN, ROUND_05UP)

##### Context Functions ##################################################

# The getcontext() and setcontext() function manage access to a thread-local
# current context.

import contextvars

_current_context_var = contextvars.ContextVar('decimal_context')

def getcontext():
    """Returns this thread's context.

    If this thread does not yet have a context, returns
    a new context and sets this thread's context.
    New contexts are copies of DefaultContext.
    """
    try:
        return _current_context_var.get()
    except LookupError:
        context = Context()
        _current_context_var.set(context)
        return context

def setcontext(context):
    """Set this thread's context to context."""
    if context in (DefaultContext, BasicContext, ExtendedContext):
        context = context.copy()
        context.clear_flags()
    _current_context_var.set(context)

del contextvars        # Don't contaminate the namespace

def localcontext(ctx=None):
    """Return a context manager for a copy of the supplied context

    Uses a copy of the current context if no context is specified
    The returned context manager creates a local decimal context
    in a with statement:
        def sin(x):
             with localcontext() as ctx:
                 ctx.prec += 2
                 # Rest of sin calculation algorithm
                 # uses a precision 2 greater than normal
             return +s  # Convert result to normal precision

         def sin(x):
             with localcontext(ExtendedContext):
                 # Rest of sin calculation algorithm
                 # uses the Extended Context from the
                 # General Decimal Arithmetic Specification
             return +s  # Convert result to normal context

    >>> setcontext(DefaultContext)
    >>> print(getcontext().prec)
    28
    >>> with localcontext():
    ...     ctx = getcontext()
    ...     ctx.prec += 2
    ...     print(ctx.prec)
    ...
    30
    >>> with localcontext(ExtendedContext):
    ...     print(getcontext().prec)
    ...
    9
    >>> print(getcontext().prec)
    28
    """
    if ctx is None: ctx = getcontext()
    return _ContextManager(ctx)


##### Decimal class #######################################################

# Do not subclass Decimal from numbers.Real and do not register it as such
# (because Decimals are not interoperable with floats).  See the notes in
# numbers.py for more detail.

class Decimal(object):
    """Floating point class for decimal arithmetic."""

    __slots__ = ('_exp','_int','_sign', '_is_special')
    # Generally, the value of the Decimal instance is given by
    #  (-1)**_sign * _int * 10**_exp
    # Special values are signified by _is_special == True

    # We're immutable, so use __new__ not __init__
    def __new__(cls, value="0", context=None):
        """Create a decimal point instance.

        >>> Decimal('3.14')              # string input
        Decimal('3.14')
        >>> Decimal((0, (3, 1, 4), -2))  # tuple (sign, digit_tuple, exponent)
        Decimal('3.14')
        >>> Decimal(314)                 # int
        Decimal('314')
        >>> Decimal(Decimal(314))        # another decimal instance
        Decimal('314')
        >>> Decimal('  3.14  \\n')        # leading and trailing whitespace okay
        Decimal('3.14')
        """

        # Note that the coefficient, self._int, is actually stored as
        # a string rather than as a tuple of digits.  This speeds up
        # the "digits to integer" and "integer to digits" conversions
        # that are used in almost every arithmetic operation on
        # Decimals.  This is an internal detail: the as_tuple function
        # and the Decimal constructor still deal with tuples of
        # digits.

        self = object.__new__(cls)

        # From a string
        # REs insist on real strings, so we can too.
        if isinstance(value, str):
            m = _parser(value.strip().replace("_", ""))
            if m is None:
                if context is None:
                    context = getcontext()
                return context._raise_error(ConversionSyntax,
                                "Invalid literal for Decimal: %r" % value)

            if m.group('sign') == "-":
                self._sign = 1
            else:
                self._sign = 0
            intpart = m.group('int')
            if intpart is not None:
                # finite number
                fracpart = m.group('frac') or ''
                exp = int(m.group('exp') or '0')
                self._int = str(int(intpart+fracpart))
                self._exp = exp - len(fracpart)
                self._is_special = False
            else:
                diag = m.group('diag')
                if diag is not None:
                    # NaN
                    self._int = str(int(diag or '0')).lstrip('0')
                    if m.group('signal'):
                        self._exp = 'N'
                    else:
                        self._exp = 'n'
                else:
                    # infinity
                    self._int = '0'
                    self._exp = 'F'
                self._is_special = True
            return self

        # From an integer
        if isinstance(value, int):
            if value >= 0:
                self._sign = 0
            else:
                self._sign = 1
            self._exp = 0
            self._int = str(abs(value))
            self._is_special = False
            return self

        # From another decimal
        if isinstance(value, Decimal):
            self._exp  = value._exp
            self._sign = value._sign
            self._int  = value._int
            self._is_special  = value._is_special
            return self

        # From an internal working value
        if isinstance(value, _WorkRep):
            self._sign = value.sign
            self._int = str(value.int)
            self._exp = int(value.exp)
            self._is_special = False
            return self

        # tuple/list conversion (possibly from as_tuple())
        if isinstance(value, (list,tuple)):
            if len(value) != 3:
                raise ValueError('Invalid tuple size in creation of Decimal '
                                 'from list or tuple.  The list or tuple '
                                 'should have exactly three elements.')
            # process sign.  The isinstance test rejects floats
            if not (isinstance(value[0], int) and value[0] in (0,1)):
                raise ValueError("Invalid sign.  The first value in the tuple "
                                 "should be an integer; either 0 for a "
                                 "positive number or 1 for a negative number.")
            self._sign = value[0]
            if value[2] == 'F':
                # infinity: value[1] is ignored
                self._int = '0'
                self._exp = value[2]
                self._is_special = True
            else:
                # process and validate the digits in value[1]
                digits = []
                for digit in value[1]:
                    if isinstance(digit, int) and 0 <= digit <= 9:
                        # skip leading zeros
                        if digits or digit != 0:
                            digits.append(digit)
                    else:
                        raise ValueError("The second value in the tuple must "
                                         "be composed of integers in the range "
                                         "0 through 9.")
                if value[2] in ('n', 'N'):
                    # NaN: digits form the diagnostic
                    self._int = ''.join(map(str, digits))
                    self._exp = value[2]
                    self._is_special = True
                elif isinstance(value[2], int):
                    # finite number: digits give the coefficient
                    self._int = ''.join(map(str, digits or [0]))
                    self._exp = value[2]
                    self._is_special = False
                else:
                    raise ValueError("The third value in the tuple must "
                                     "be an integer, or one of the "
                                     "strings 'F', 'n', 'N'.")
            return self

        if isinstance(value, float):
            if context is None:
                context = getcontext()
            context._raise_error(FloatOperation,
                "strict semantics for mixing floats and Decimals are "
                "enabled")
            value = Decimal.from_float(value)
            self._exp  = value._exp
            self._sign = value._sign
            self._int  = value._int
            self._is_special  = value._is_special
            return self

        raise TypeError("Cannot convert %r to Decimal" % value)

    @classmethod
    def from_float(cls, f):
        """Converts a float to a decimal number, exactly.

        Note that Decimal.from_float(0.1) is not the same as Decimal('0.1').
        Since 0.1 is not exactly representable in binary floating point, the
        value is stored as the nearest representable value which is
        0x1.999999999999ap-4.  The exact equivalent of the value in decimal
        is 0.1000000000000000055511151231257827021181583404541015625.

        >>> Decimal.from_float(0.1)
        Decimal('0.1000000000000000055511151231257827021181583404541015625')
        >>> Decimal.from_float(float('nan'))
        Decimal('NaN')
        >>> Decimal.from_float(float('inf'))
        Decimal('Infinity')
        >>> Decimal.from_float(-float('inf'))
        Decimal('-Infinity')
        >>> Decimal.from_float(-0.0)
        Decimal('-0')

        """
        if isinstance(f, int):                # handle integer inputs
            sign = 0 if f >= 0 else 1
            k = 0
            coeff = str(abs(f))
        elif isinstance(f, float):
            if _math.isinf(f) or _math.isnan(f):
                return cls(repr(f))
            if _math.copysign(1.0, f) == 1.0:
                sign = 0
            else:
                sign = 1
            n, d = abs(f).as_integer_ratio()
            k = d.bit_length() - 1
            coeff = str(n*5**k)
        else:
            raise TypeError("argument must be int or float.")

        result = _dec_from_triple(sign, coeff, -k)
        if cls is Decimal:
            return result
        else:
            return cls(result)

    def _isnan(self):
        """Returns whether the number is not actually one.

        0 if a number
        1 if NaN
        2 if sNaN
        """
        if self._is_special:
            exp = self._exp
            if exp == 'n':
                return 1
            elif exp == 'N':
                return 2
        return 0

    def _isinfinity(self):
        """Returns whether the number is infinite

        0 if finite or not a number
        1 if +INF
        -1 if -INF
        """
        if self._exp == 'F':
            if self._sign:
                return -1
            return 1
        return 0

    def _check_nans(self, other=None, context=None):
        """Returns whether the number is not actually one.

        if self, other are sNaN, signal
        if self, other are NaN return nan
        return 0

        Done before operations.
        """

        self_is_nan = self._isnan()
        if other is None:
            other_is_nan = False
        else:
            other_is_nan = other._isnan()

        if self_is_nan or other_is_nan:
            if context is None:
                context = getcontext()

            if self_is_nan == 2:
                return context._raise_error(InvalidOperation, 'sNaN',
                                        self)
            if other_is_nan == 2:
                return context._raise_error(InvalidOperation, 'sNaN',
                                        other)
            if self_is_nan:
                return self._fix_nan(context)

            return other._fix_nan(context)
        return 0

    def _compare_check_nans(self, other, context):
        """Version of _check_nans used for the signaling comparisons
        compare_signal, __le__, __lt__, __ge__, __gt__.

        Signal InvalidOperation if either self or other is a (quiet
        or signaling) NaN.  Signaling NaNs take precedence over quiet
        NaNs.

        Return 0 if neither operand is a NaN.

        """
        if context is None:
            context = getcontext()

        if self._is_special or other._is_special:
            if self.is_snan():
                return context._raise_error(InvalidOperation,
                                            'comparison involving sNaN',
                                            self)
            elif other.is_snan():
                return context._raise_error(InvalidOperation,
                                            'comparison involving sNaN',
                                            other)
            elif self.is_qnan():
                return context._raise_error(InvalidOperation,
                                            'comparison involving NaN',
                                            self)
            elif other.is_qnan():
                return context._raise_error(InvalidOperation,
                                            'comparison involving NaN',
                                            other)
        return 0

    def __bool__(self):
        """Return True if self is nonzero; otherwise return False.

        NaNs and infinities are considered nonzero.
        """
        return self._is_special or self._int != '0'

    def _cmp(self, other):
        """Compare the two non-NaN decimal instances self and other.

        Returns -1 if self < other, 0 if self == other and 1
        if self > other.  This routine is for internal use only."""

        if self._is_special or other._is_special:
            self_inf = self._isinfinity()
            other_inf = other._isinfinity()
            if self_inf == other_inf:
                return 0
            elif self_inf < other_inf:
                return -1
            else:
                return 1

        # check for zeros;  Decimal('0') == Decimal('-0')
        if not self:
            if not other:
                return 0
            else:
                return -((-1)**other._sign)
        if not other:
            return (-1)**self._sign

        # If different signs, neg one is less
        if other._sign < self._sign:
            return -1
        if self._sign < other._sign:
            return 1

        self_adjusted = self.adjusted()
        other_adjusted = other.adjusted()
        if self_adjusted == other_adjusted:
            self_padded = self._int + '0'*(self._exp - other._exp)
            other_padded = other._int + '0'*(other._exp - self._exp)
            if self_padded == other_padded:
                return 0
            elif self_padded < other_padded:
                return -(-1)**self._sign
            else:
                return (-1)**self._sign
        elif self_adjusted > other_adjusted:
            return (-1)**self._sign
        else: # self_adjusted < other_adjusted
            return -((-1)**self._sign)

    # Note: The Decimal standard doesn't cover rich comparisons for
    # Decimals.  In particular, the specification is silent on the
    # subject of what should happen for a comparison involving a NaN.
    # We take the following approach:
    #
    #   == comparisons involving a quiet NaN always return False
    #   != comparisons involving a quiet NaN always return True
    #   == or != comparisons involving a signaling NaN signal
    #      InvalidOperation, and return False or True as above if the
    #      InvalidOperation is not trapped.
    #   <, >, <= and >= comparisons involving a (quiet or signaling)
    #      NaN signal InvalidOperation, and return False if the
    #      InvalidOperation is not trapped.
    #
    # This behavior is designed to conform as closely as possible to
    # that specified by IEEE 754.

    def __eq__(self, other, context=None):
        self, other = _convert_for_comparison(self, other, equality_op=True)
        if other is NotImplemented:
            return other
        if self._check_nans(other, context):
            return False
        return self._cmp(other) == 0

    def __lt__(self, other, context=None):
        self, other = _convert_for_comparison(self, other)
        if other is NotImplemented:
            return other
        ans = self._compare_check_nans(other, context)
        if ans:
            return False
        return self._cmp(other) < 0

    def __le__(self, other, context=None):
        self, other = _convert_for_comparison(self, other)
        if other is NotImplemented:
            return other
        ans = self._compare_check_nans(other, context)
        if ans:
            return False
        return self._cmp(other) <= 0

    def __gt__(self, other, context=None):
        self, other = _convert_for_comparison(self, other)
        if other is NotImplemented:
            return other
        ans = self._compare_check_nans(other, context)
        if ans:
            return False
        return self._cmp(other) > 0

    def __ge__(self, other, context=None):
        self, other = _convert_for_comparison(self, other)
        if other is NotImplemented:
            return other
        ans = self._compare_check_nans(other, context)
        if ans:
            return False
        return self._cmp(other) >= 0

    def compare(self, other, context=None):
        """Compare self to other.  Return a decimal value:

        a or b is a NaN ==> Decimal('NaN')
        a < b           ==> Decimal('-1')
        a == b          ==> Decimal('0')
        a > b           ==> Decimal('1')
        """
        other = _convert_other(other, raiseit=True)

        # Compare(NaN, NaN) = NaN
        if (self._is_special or other and other._is_special):
            ans = self._check_nans(other, context)
            if ans:
                return ans

        return Decimal(self._cmp(other))

    def __hash__(self):
        """x.__hash__() <==> hash(x)"""

        # In order to make sure that the hash of a Decimal instance
        # agrees with the hash of a numerically equal integer, float
        # or Fraction, we follow the rules for numeric hashes outlined
        # in the documentation.  (See library docs, 'Built-in Types').
        if self._is_special:
            if self.is_snan():
                raise TypeError('Cannot hash a signaling NaN value.')
            elif self.is_nan():
                return _PyHASH_NAN
            else:
                if self._sign:
                    return -_PyHASH_INF
                else:
                    return _PyHASH_INF

        if self._exp >= 0:
            exp_hash = pow(10, self._exp, _PyHASH_MODULUS)
        else:
            exp_hash = pow(_PyHASH_10INV, -self._exp, _PyHASH_MODULUS)
        hash_ = int(self._int) * exp_hash % _PyHASH_MODULUS
        ans = hash_ if self >= 0 else -hash_
        return -2 if ans == -1 else ans

    def as_tuple(self):
        """Represents the number as a triple tuple.

        To show the internals exactly as they are.
        """
        return DecimalTuple(self._sign, tuple(map(int, self._int)), self._exp)

    def as_integer_ratio(self):
        """Express a finite Decimal instance in the form n / d.

        Returns a pair (n, d) of integers.  When called on an infinity
        or NaN, raises OverflowError or ValueError respectively.

        >>> Decimal('3.14').as_integer_ratio()
        (157, 50)
        >>> Decimal('-123e5').as_integer_ratio()
        (-12300000, 1)
        >>> Decimal('0.00').as_integer_ratio()
        (0, 1)

        """
        if self._is_special:
            if self.is_nan():
                raise ValueError("cannot convert NaN to integer ratio")
            else:
                raise OverflowError("cannot convert Infinity to integer ratio")

        if not self:
            return 0, 1

        # Find n, d in lowest terms such that abs(self) == n / d;
        # we'll deal with the sign later.
        n = int(self._int)
        if self._exp >= 0:
            # self is an integer.
            n, d = n * 10**self._exp, 1
        else:
            # Find d2, d5 such that abs(self) = n / (2**d2 * 5**d5).
            d5 = -self._exp
            while d5 > 0 and n % 5 == 0:
                n //= 5
                d5 -= 1

            # (n & -n).bit_length() - 1 counts trailing zeros in binary
            # representation of n (provided n is nonzero).
            d2 = -self._exp
            shift2 = min((n & -n).bit_length() - 1, d2)
            if shift2:
                n >>= shift2
                d2 -= shift2

            d = 5**d5 << d2

        if self._sign:
            n = -n
        return n, d

    def __repr__(self):
        """Represents the number as an instance of Decimal."""
        # Invariant:  eval(repr(d)) == d
        return "Decimal('%s')" % str(self)

    def __str__(self, eng=False, context=None):
        """Return string representation of the number in scientific notation.

        Captures all of the information in the underlying representation.
        """

        sign = ['', '-'][self._sign]
        if self._is_special:
            if self._exp == 'F':
                return sign + 'Infinity'
            elif self._exp == 'n':
                return sign + 'NaN' + self._int
            else: # self._exp == 'N'
                return sign + 'sNaN' + self._int

        # number of digits of self._int to left of decimal point
        leftdigits = self._exp + len(self._int)

        # dotplace is number of digits of self._int to the left of the
        # decimal point in the mantissa of the output string (that is,
        # after adjusting the exponent)
        if self._exp <= 0 and leftdigits > -6:
            # no exponent required
            dotplace = leftdigits
        elif not eng:
            # usual scientific notation: 1 digit on left of the point
            dotplace = 1
        elif self._int == '0':
            # engineering notation, zero
            dotplace = (leftdigits + 1) % 3 - 1
        else:
            # engineering notation, nonzero
            dotplace = (leftdigits - 1) % 3 + 1

        if dotplace <= 0:
            intpart = '0'
            fracpart = '.' + '0'*(-dotplace) + self._int
        elif dotplace >= len(self._int):
            intpart = self._int+'0'*(dotplace-len(self._int))
            fracpart = ''
        else:
            intpart = self._int[:dotplace]
            fracpart = '.' + self._int[dotplace:]
        if leftdigits == dotplace:
            exp = ''
        else:
            if context is None:
                context = getcontext()
            exp = ['e', 'E'][context.capitals] + "%+d" % (leftdigits-dotplace)

        return sign + intpart + fracpart + exp

    def to_eng_string(self, context=None):
        """Convert to a string, using engineering notation if an exponent is needed.

        Engineering notation has an exponent which is a multiple of 3.  This
        can leave up to 3 digits to the left of the decimal place and may
        require the addition of either one or two trailing zeros.
        """
        return self.__str__(eng=True, context=context)

    def __neg__(self, context=None):
        """Returns a copy with the sign switched.

        Rounds, if it has reason.
        """
        if self._is_special:
            ans = self._check_nans(context=context)
            if ans:
                return ans

        if context is None:
            context = getcontext()

        if not self and context.rounding != ROUND_FLOOR:
            # -Decimal('0') is Decimal('0'), not Decimal('-0'), except
            # in ROUND_FLOOR rounding mode.
            ans = self.copy_abs()
        else:
            ans = self.copy_negate()

        return ans._fix(context)

    def __pos__(self, context=None):
        """Returns a copy, unless it is a sNaN.

        Rounds the number (if more than precision digits)
        """
        if self._is_special:
            ans = self._check_nans(context=context)
            if ans:
                return ans

        if context is None:
            context = getcontext()

        if not self and context.rounding != ROUND_FLOOR:
            # + (-0) = 0, except in ROUND_FLOOR rounding mode.
            ans = self.copy_abs()
        else:
            ans = Decimal(self)

        return ans._fix(context)

    def __abs__(self, round=True, context=None):
        """Returns the absolute value of self.

        If the keyword argument 'round' is false, do not round.  The
        expression self.__abs__(round=False) is equivalent to
        self.copy_abs().
        """
        if not round:
            return self.copy_abs()

        if self._is_special:
            ans = self._check_nans(context=context)
            if ans:
                return ans

        if self._sign:
            ans = self.__neg__(context=context)
        else:
            ans = self.__pos__(context=context)

        return ans

    def __add__(self, other, context=None):
        """Returns self + other.

        -INF + INF (or the reverse) cause InvalidOperation errors.
        """
        other = _convert_other(other)
        if other is NotImplemented:
            return other

        if context is None:
            context = getcontext()

        if self._is_special or other._is_special:
            ans = self._check_nans(other, context)
            if ans:
                return ans

            if self._isinfinity():
                # If both INF, same sign => same as both, opposite => error.
                if self._sign != other._sign and other._isinfinity():
                    return context._raise_error(InvalidOperation, '-INF + INF')
                return Decimal(self)
            if other._isinfinity():
                return Decimal(other)  # Can't both be infinity here

        exp = min(self._exp, other._exp)
        negativezero = 0
        if context.rounding == ROUND_FLOOR and self._sign != other._sign:
            # If the answer is 0, the sign should be negative, in this case.
            negativezero = 1

        if not self and not other:
            sign = min(self._sign, other._sign)
            if negativezero:
                sign = 1
            ans = _dec_from_triple(sign, '0', exp)
            ans = ans._fix(context)
            return ans
        if not self:
            exp = max(exp, other._exp - context.prec-1)
            ans = other._rescale(exp, context.rounding)
            ans = ans._fix(context)
            return ans
        if not other:
            exp = max(exp, self._exp - context.prec-1)
            ans = self._rescale(exp, context.rounding)
            ans = ans._fix(context)
            return ans

        op1 = _WorkRep(self)
        op2 = _WorkRep(other)
        op1, op2 = _normalize(op1, op2, context.prec)

        result = _WorkRep()
        if op1.sign != op2.sign:
            # Equal and opposite
            if op1.int == op2.int:
                ans = _dec_from_triple(negativezero, '0', exp)
                ans = ans._fix(context)
                return ans
            if op1.int < op2.int:
                op1, op2 = op2, op1
                # OK, now abs(op1) > abs(op2)
            if op1.sign == 1:
                result.sign = 1
                op1.sign, op2.sign = op2.sign, op1.sign
            else:
                result.sign = 0
                # So we know the sign, and op1 > 0.
        elif op1.sign == 1:
            result.sign = 1
            op1.sign, op2.sign = (0, 0)
        else:
            result.sign = 0
        # Now, op1 > abs(op2) > 0

        if op2.sign == 0:
            result.int = op1.int + op2.int
        else:
            result.int = op1.int - op2.int

        result.exp = op1.exp
        ans = Decimal(result)
        ans = ans._fix(context)
        return ans

    __radd__ = __add__

    def __sub__(self, other, context=None):
        """Return self - other"""
        other = _convert_other(other)
        if other is NotImplemented:
            return other

        if self._is_special or other._is_special:
            ans = self._check_nans(other, context=context)
            if ans:
                return ans

        # self - other is computed as self + other.copy_negate()
        return self.__add__(other.copy_negate(), context=context)

    def __rsub__(self, other, context=None):
        """Return other - self"""
        other = _convert_other(other)
        if other is NotImplemented:
            return other

        return other.__sub__(self, context=context)

    def __mul__(self, other, context=None):
        """Return self * other.

        (+-) INF * 0 (or its reverse) raise InvalidOperation.
        """
        other = _convert_other(other)
        if other is NotImplemented:
            return other

        if context is None:
            context = getcontext()

        resultsign = self._sign ^ other._sign

        if self._is_special or other._is_special:
            ans = self._check_nans(other, context)
            if ans:
                return ans

            if self._isinfinity():
                if not other:
                    return context._raise_error(InvalidOperation, '(+-)INF * 0')
                return _SignedInfinity[resultsign]

            if other._isinfinity():
                if not self:
                    return context._raise_error(InvalidOperation, '0 * (+-)INF')
                return _SignedInfinity[resultsign]

        resultexp = self._exp + other._exp

        # Special case for multiplying by zero
        if not self or not other:
            ans = _dec_from_triple(resultsign, '0', resultexp)
            # Fixing in case the exponent is out of bounds
            ans = ans._fix(context)
            return ans

        # Special case for multiplying by power of 10
        if self._int == '1':
            ans = _dec_from_triple(resultsign, other._int, resultexp)
            ans = ans._fix(context)
            return ans
        if other._int == '1':
            ans = _dec_from_triple(resultsign, self._int, resultexp)
            ans = ans._fix(context)
            return ans

        op1 = _WorkRep(self)
        op2 = _WorkRep(other)

        ans = _dec_from_triple(resultsign, str(op1.int * op2.int), resultexp)
        ans = ans._fix(context)

        return ans
    __rmul__ = __mul__

    def __truediv__(self, other, context=None):
        """Return self / other."""
        other = _convert_other(other)
        if other is NotImplemented:
            return NotImplemented

        if context is None:
            context = getcontext()

        sign = self._sign ^ other._sign

        if self._is_special or other._is_special:
            ans = self._check_nans(other, context)
            if ans:
                return ans

            if self._isinfinity() and other._isinfinity():
                return context._raise_error(InvalidOperation, '(+-)INF/(+-)INF')

            if self._isinfinity():
                return _SignedInfinity[sign]

            if other._isinfinity():
                context._raise_error(Clamped, 'Division by infinity')
                return _dec_from_triple(sign, '0', context.Etiny())

        # Special cases for zeroes
        if not other:
            if not self:
                return context._raise_error(DivisionUndefined, '0 / 0')
            return context._raise_error(DivisionByZero, 'x / 0', sign)

        if not self:
            exp = self._exp - other._exp
            coeff = 0
        else:
            # OK, so neither = 0, INF or NaN
            shift = len(other._int) - len(self._int) + context.prec + 1
            exp = self._exp - other._exp - shift
            op1 = _WorkRep(self)
            op2 = _WorkRep(other)
            if shift >= 0:
                coeff, remainder = divmod(op1.int * 10**shift, op2.int)
            else:
                coeff, remainder = divmod(op1.int, op2.int * 10**-shift)
            if remainder:
                # result is not exact; adjust to ensure correct rounding
                if coeff % 5 == 0:
                    coeff += 1
            else:
                # result is exact; get as close to ideal exponent as possible
                ideal_exp = self._exp - other._exp
                while exp < ideal_exp and coeff % 10 == 0:
                    coeff //= 10
                    exp += 1

        ans = _dec_from_triple(sign, str(coeff), exp)
        return ans._fix(context)

    def _divide(self, other, context):
        """Return (self // other, self % other), to context.prec precision.

        Assumes that neither self nor other is a NaN, that self is not
        infinite and that other is nonzero.
        """
        sign = self._sign ^ other._sign
        if other._isinfinity():
            ideal_exp = self._exp
        else:
            ideal_exp = min(self._exp, other._exp)

        expdiff = self.adjusted() - other.adjusted()
        if not self or other._isinfinity() or expdiff <= -2:
            return (_dec_from_triple(sign, '0', 0),
                    self._rescale(ideal_exp, context.rounding))
        if expdiff <= context.prec:
            op1 = _WorkRep(self)
            op2 = _WorkRep(other)
            if op1.exp >= op2.exp:
                op1.int *= 10**(op1.exp - op2.exp)
            else:
                op2.int *= 10**(op2.exp - op1.exp)
            q, r = divmod(op1.int, op2.int)
            if q < 10**context.prec:
                return (_dec_from_triple(sign, str(q), 0),
                        _dec_from_triple(self._sign, str(r), ideal_exp))

        # Here the quotient is too large to be representable
        ans = context._raise_error(DivisionImpossible,
                                   'quotient too large in //, % or divmod')
        return ans, ans

    def __rtruediv__(self, other, context=None):
        """Swaps self/other and returns __truediv__."""
        other = _convert_other(other)
        if other is NotImplemented:
            return other
        return other.__truediv__(self, context=context)

    def __divmod__(self, other, context=None):
        """
        Return (self // other, self % other)
        """
        other = _convert_other(other)
        if other is NotImplemented:
            return other

        if context is None:
            context = getcontext()

        ans = self._check_nans(other, context)
        if ans:
            return (ans, ans)

        sign = self._sign ^ other._sign
        if self._isinfinity():
            if other._isinfinity():
                ans = context._raise_error(InvalidOperation, 'divmod(INF, INF)')
                return ans, ans
            else:
                return (_SignedInfinity[sign],
                        context._raise_error(InvalidOperation, 'INF % x'))

        if not other:
            if not self:
                ans = context._raise_error(DivisionUndefined, 'divmod(0, 0)')
                return ans, ans
            else:
                return (context._raise_error(DivisionByZero, 'x // 0', sign),
                        context._raise_error(InvalidOperation, 'x % 0'))

        quotient, remainder = self._divide(other, context)
        remainder = remainder._fix(context)
        return quotient, remainder

    def __rdivmod__(self, other, context=None):
        """Swaps self/other and returns __divmod__."""
        other = _convert_other(other)
        if other is NotImplemented:
            return other
        return other.__divmod__(self, context=context)

    def __mod__(self, other, context=None):
        """
        self % other
        """
        other = _convert_other(other)
        if other is NotImplemented:
            return other

        if context is None:
            context = getcontext()

        ans = self._check_nans(other, context)
        if ans:
            return ans

        if self._isinfinity():
            return context._raise_error(InvalidOperation, 'INF % x')
        elif not other:
            if self:
                return context._raise_error(InvalidOperation, 'x % 0')
            else:
                return context._raise_error(DivisionUndefined, '0 % 0')

        remainder = self._divide(other, context)[1]
        remainder = remainder._fix(context)
        return remainder

    def __rmod__(self, other, context=None):
        """Swaps self/other and returns __mod__."""
        other = _convert_other(other)
        if other is NotImplemented:
            return other
        return other.__mod__(self, context=context)

    def remainder_near(self, other, context=None):
        """
        Remainder nearest to 0-  abs(remainder-near) <= other/2
        """
        if context is None:
            context = getcontext()

        other = _convert_other(other, raiseit=True)

        ans = self._check_nans(other, context)
        if ans:
            return ans

        # self == +/-infinity -> InvalidOperation
        if self._isinfinity():
            return context._raise_error(InvalidOperation,
                                        'remainder_near(infinity, x)')

        # other == 0 -> either InvalidOperation or DivisionUndefined
        if not other:
            if self:
                return context._raise_error(InvalidOperation,
                                            'remainder_near(x, 0)')
            else:
                return context._raise_error(DivisionUndefined,
                                            'remainder_near(0, 0)')

        # other = +/-infinity -> remainder = self
        if other._isinfinity():
            ans = Decimal(self)
            return ans._fix(context)

        # self = 0 -> remainder = self, with ideal exponent
        ideal_exponent = min(self._exp, other._exp)
        if not self:
            ans = _dec_from_triple(self._sign, '0', ideal_exponent)
            return ans._fix(context)

        # catch most cases of large or small quotient
        expdiff = self.adjusted() - other.adjusted()
        if expdiff >= context.prec + 1:
            # expdiff >= prec+1 => abs(self/other) > 10**prec
            return context._raise_error(DivisionImpossible)
        if expdiff <= -2:
            # expdiff <= -2 => abs(self/other) < 0.1
            ans = self._rescale(ideal_exponent, context.rounding)
            return ans._fix(context)

        # adjust both arguments to have the same exponent, then divide
        op1 = _WorkRep(self)
        op2 = _WorkRep(other)
        if op1.exp >= op2.exp:
            op1.int *= 10**(op1.exp - op2.exp)
        else:
            op2.int *= 10**(op2.exp - op1.exp)
        q, r = divmod(op1.int, op2.int)
        # remainder is r*10**ideal_exponent; other is +/-op2.int *
        # 10**ideal_exponent.   Apply correction to ensure that
        # abs(remainder) <= abs(other)/2
        if 2*r + (q&1) > op2.int:
            r -= op2.int
            q += 1

        if q >= 10**context.prec:
            return context._raise_error(DivisionImpossible)

        # result has same sign as self unless r is negative
        sign = self._sign
        if r < 0:
            sign = 1-sign
            r = -r

        ans = _dec_from_triple(sign, str(r), ideal_exponent)
        return ans._fix(context)

    def __floordiv__(self, other, context=None):
        """self // other"""
        other = _convert_other(other)
        if other is NotImplemented:
            return other

        if context is None:
            context = getcontext()

        ans = self._check_nans(other, context)
        if ans:
            return ans

        if self._isinfinity():
            if other._isinfinity():
                return context._raise_error(InvalidOperation, 'INF // INF')
            else:
                return _SignedInfinity[self._sign ^ other._sign]

        if not other:
            if self:
                return context._raise_error(DivisionByZero, 'x // 0',
                                            self._sign ^ other._sign)
            else:
                return context._raise_error(DivisionUndefined, '0 // 0')

        return self._divide(other, context)[0]

    def __rfloordiv__(self, other, context=None):
        """Swaps self/other and returns __floordiv__."""
        other = _convert_other(other)
        if other is NotImplemented:
            return other
        return other.__floordiv__(self, context=context)

    def __float__(self):
        """Float representation."""
        if self._isnan():
            if self.is_snan():
                raise ValueError("Cannot convert signaling NaN to float")
            s = "-nan" if self._sign else "nan"
        else:
            s = str(self)
        return float(s)

    def __int__(self):
        """Converts self to an int, truncating if necessary."""
        if self._is_special:
            if self._isnan():
                raise ValueError("Cannot convert NaN to integer")
            elif self._isinfinity():
                raise OverflowError("Cannot convert infinity to integer")
        s = (-1)**self._sign
        if self._exp >= 0:
            return s*int(self._int)*10**self._exp
        else:
            return s*int(self._int[:self._exp] or '0')

    __trunc__ = __int__

    @property
    def real(self):
        return self

    @property
    def imag(self):
        return Decimal(0)

    def conjugate(self):
        return self

    def __complex__(self):
        return complex(float(self))

    def _fix_nan(self, context):
        """Decapitate the payload of a NaN to fit the context"""
        payload = self._int

        # maximum length of payload is precision if clamp=0,
        # precision-1 if clamp=1.
        max_payload_len = context.prec - context.clamp
        if len(payload) > max_payload_len:
            payload = payload[len(payload)-max_payload_len:].lstrip('0')
            return _dec_from_triple(self._sign, payload, self._exp, True)
        return Decimal(self)

    def _fix(self, context):
        """Round if it is necessary to keep self within prec precision.

        Rounds and fixes the exponent.  Does not raise on a sNaN.

        Arguments:
        self - Decimal instance
        context - context used.
        """

        if self._is_special:
            if self._isnan():
                # decapitate payload if necessary
                return self._fix_nan(context)
            else:
                # self is +/-Infinity; return unaltered
                return Decimal(self)

        # if self is zero then exponent should be between Etiny and
        # Emax if clamp==0, and between Etiny and Etop if clamp==1.
        Etiny = context.Etiny()
        Etop = context.Etop()
        if not self:
            exp_max = [context.Emax, Etop][context.clamp]
            new_exp = min(max(self._exp, Etiny), exp_max)
            if new_exp != self._exp:
                context._raise_error(Clamped)
                return _dec_from_triple(self._sign, '0', new_exp)
            else:
                return Decimal(self)

        # exp_min is the smallest allowable exponent of the result,
        # equal to max(self.adjusted()-context.prec+1, Etiny)
        exp_min = len(self._int) + self._exp - context.prec
        if exp_min > Etop:
            # overflow: exp_min > Etop iff self.adjusted() > Emax
            ans = context._raise_error(Overflow, 'above Emax', self._sign)
            context._raise_error(Inexact)
            context._raise_error(Rounded)
            return ans

        self_is_subnormal = exp_min < Etiny
        if self_is_subnormal:
            exp_min = Etiny

        # round if self has too many digits
        if self._exp < exp_min:
            digits = len(self._int) + self._exp - exp_min
            if digits < 0:
                self = _dec_from_triple(self._sign, '1', exp_min-1)
                digits = 0
            rounding_method = self._pick_rounding_function[context.rounding]
            changed = rounding_method(self, digits)
            coeff = self._int[:digits] or '0'
            if changed > 0:
                coeff = str(int(coeff)+1)
                if len(coeff) > context.prec:
                    coeff = coeff[:-1]
                    exp_min += 1

            # check whether the rounding pushed the exponent out of range
            if exp_min > Etop:
                ans = context._raise_error(Overflow, 'above Emax', self._sign)
            else:
                ans = _dec_from_triple(self._sign, coeff, exp_min)

            # raise the appropriate signals, taking care to respect
            # the precedence described in the specification
            if changed and self_is_subnormal:
                context._raise_error(Underflow)
            if self_is_subnormal:
                context._raise_error(Subnormal)
            if changed:
                context._raise_error(Inexact)
            context._raise_error(Rounded)
            if not ans:
                # raise Clamped on underflow to 0
                context._raise_error(Clamped)
            return ans

        if self_is_subnormal:
            context._raise_error(Subnormal)

        # fold down if clamp == 1 and self has too few digits
        if context.clamp == 1 and self._exp > Etop:
            context._raise_error(Clamped)
            self_padded = self._int + '0'*(self._exp - Etop)
            return _dec_from_triple(self._sign, self_padded, Etop)

        # here self was representable to begin with; return unchanged
        return Decimal(self)

    # for each of the rounding functions below:
    #   self is a finite, nonzero Decimal
    #   prec is an integer satisfying 0 <= prec < len(self._int)
    #
    # each function returns either -1, 0, or 1, as follows:
    #   1 indicates that self should be rounded up (away from zero)
    #   0 indicates that self should be truncated, and that all the
    #     digits to be truncated are zeros (so the value is unchanged)
    #  -1 indicates that there are nonzero digits to be truncated

    def _round_down(self, prec):
        """Also known as round-towards-0, truncate."""
        if _all_zeros(self._int, prec):
            return 0
        else:
            return -1

    def _round_up(self, prec):
        """Rounds away from 0."""
        return -self._round_down(prec)

    def _round_half_up(self, prec):
        """Rounds 5 up (away from 0)"""
        if self._int[prec] in '56789':
            return 1
        elif _all_zeros(self._int, prec):
            return 0
        else:
            return -1

    def _round_half_down(self, prec):
        """Round 5 down"""
        if _exact_half(self._int, prec):
            return -1
        else:
            return self._round_half_up(prec)

    def _round_half_even(self, prec):
        """Round 5 to even, rest to nearest."""
        if _exact_half(self._int, prec) and \
                (prec == 0 or self._int[prec-1] in '02468'):
            return -1
        else:
            return self._round_half_up(prec)

    def _round_ceiling(self, prec):
        """Rounds up (not away from 0 if negative.)"""
        if self._sign:
            return self._round_down(prec)
        else:
            return -self._round_down(prec)

    def _round_floor(self, prec):
        """Rounds down (not towards 0 if negative)"""
        if not self._sign:
            return self._round_down(prec)
        else:
            return -self._round_down(prec)

    def _round_05up(self, prec):
        """Round down unless digit prec-1 is 0 or 5."""
        if prec and self._int[prec-1] not in '05':
            return self._round_down(prec)
        else:
            return -self._round_down(prec)

    _pick_rounding_function = dict(
        ROUND_DOWN = _round_down,
        ROUND_UP = _round_up,
        ROUND_HALF_UP = _round_half_up,
        ROUND_HALF_DOWN = _round_half_down,
        ROUND_HALF_EVEN = _round_half_even,
        ROUND_CEILING = _round_ceiling,
        ROUND_FLOOR = _round_floor,
        ROUND_05UP = _round_05up,
    )

    def __round__(self, n=None):
        """Round self to the nearest integer, or to a given precision.

        If only one argument is supplied, round a finite Decimal
        instance self to the nearest integer.  If self is infinite or
        a NaN then a Python exception is raised.  If self is finite
        and lies exactly halfway between two integers then it is
        rounded to the integer with even last digit.

        >>> round(Decimal('123.456'))
        123
        >>> round(Decimal('-456.789'))
        -457
        >>> round(Decimal('-3.0'))
        -3
        >>> round(Decimal('2.5'))
        2
        >>> round(Decimal('3.5'))
        4
        >>> round(Decimal('Inf'))
        Traceback (most recent call last):
          ...
        OverflowError: cannot round an infinity
        >>> round(Decimal('NaN'))
        Traceback (most recent call last):
          ...
        ValueError: cannot round a NaN

        If a second argument n is supplied, self is rounded to n
        decimal places using the rounding mode for the current
        context.

        For an integer n, round(self, -n) is exactly equivalent to
        self.quantize(Decimal('1En')).

        >>> round(Decimal('123.456'), 0)
        Decimal('123')
        >>> round(Decimal('123.456'), 2)
        Decimal('123.46')
        >>> round(Decimal('123.456'), -2)
        Decimal('1E+2')
        >>> round(Decimal('-Infinity'), 37)
        Decimal('NaN')
        >>> round(Decimal('sNaN123'), 0)
        Decimal('NaN123')

        """
        if n is not None:
            # two-argument form: use the equivalent quantize call
            if not isinstance(n, int):
                raise TypeError('Second argument to round should be integral')
            exp = _dec_from_triple(0, '1', -n)
            return self.quantize(exp)

        # one-argument form
        if self._is_special:
            if self.is_nan():
                raise ValueError("cannot round a NaN")
            else:
                raise OverflowError("cannot round an infinity")
        return int(self._rescale(0, ROUND_HALF_EVEN))

    def __floor__(self):
        """Return the floor of self, as an integer.

        For a finite Decimal instance self, return the greatest
        integer n such that n <= self.  If self is infinite or a NaN
        then a Python exception is raised.

        """
        if self._is_special:
            if self.is_nan():
                raise ValueError("cannot round a NaN")
            else:
                raise OverflowError("cannot round an infinity")
        return int(self._rescale(0, ROUND_FLOOR))

    def __ceil__(self):
        """Return the ceiling of self, as an integer.

        For a finite Decimal instance self, return the least integer n
        such that n >= self.  If self is infinite or a NaN then a
        Python exception is raised.

        """
        if self._is_special:
            if self.is_nan():
                raise ValueError("cannot round a NaN")
            else:
                raise OverflowError("cannot round an infinity")
        return int(self._rescale(0, ROUND_CEILING))

    def fma(self, other, third, context=None):
        """Fused multiply-add.

        Returns self*other+third with no rounding of the intermediate
        product self*other.

        self and other are multiplied together, with no rounding of
        the result.  The third operand is then added to the result,
        and a single final rounding is performed.
        """

        other = _convert_other(other, raiseit=True)
        third = _convert_other(third, raiseit=True)

        # compute product; raise InvalidOperation if either operand is
        # a signaling NaN or if the product is zero times infinity.
        if self._is_special or other._is_special:
            if context is None:
                context = getcontext()
            if self._exp == 'N':
                return context._raise_error(InvalidOperation, 'sNaN', self)
            if other._exp == 'N':
                return context._raise_error(InvalidOperation, 'sNaN', other)
            if self._exp == 'n':
                product = self
            elif other._exp == 'n':
                product = other
            elif self._exp == 'F':
                if not other:
                    return context._raise_error(InvalidOperation,
                                                'INF * 0 in fma')
                product = _SignedInfinity[self._sign ^ other._sign]
            elif other._exp == 'F':
                if not self:
                    return context._raise_error(InvalidOperation,
                                                '0 * INF in fma')
                product = _SignedInfinity[self._sign ^ other._sign]
        else:
            product = _dec_from_triple(self._sign ^ other._sign,
                                       str(int(self._int) * int(other._int)),
                                       self._exp + other._exp)

        return product.__add__(third, context)

    def _power_modulo(self, other, modulo, context=None):
        """Three argument version of __pow__"""

        other = _convert_other(other)
        if other is NotImplemented:
            return other
        modulo = _convert_other(modulo)
        if modulo is NotImplemented:
            return modulo

        if context is None:
            context = getcontext()

        # deal with NaNs: if there are any sNaNs then first one wins,
        # (i.e. behaviour for NaNs is identical to that of fma)
        self_is_nan = self._isnan()
        other_is_nan = other._isnan()
        modulo_is_nan = modulo._isnan()
        if self_is_nan or other_is_nan or modulo_is_nan:
            if self_is_nan == 2:
                return context._raise_error(InvalidOperation, 'sNaN',
                                        self)
            if other_is_nan == 2:
                return context._raise_error(InvalidOperation, 'sNaN',
                                        other)
            if modulo_is_nan == 2:
                return context._raise_error(InvalidOperation, 'sNaN',
                                        modulo)
            if self_is_nan:
                return self._fix_nan(context)
            if other_is_nan:
                return other._fix_nan(context)
            return modulo._fix_nan(context)

        # check inputs: we apply same restrictions as Python's pow()
        if not (self._isinteger() and
                other._isinteger() and
                modulo._isinteger()):
            return context._raise_error(InvalidOperation,
                                        'pow() 3rd argument not allowed '
                                        'unless all arguments are integers')
        if other < 0:
            return context._raise_error(InvalidOperation,
                                        'pow() 2nd argument cannot be '
                                        'negative when 3rd argument specified')
        if not modulo:
            return context._raise_error(InvalidOperation,
                                        'pow() 3rd argument cannot be 0')

        # additional restriction for decimal: the modulus must be less
        # than 10**prec in absolute value
        if modulo.adjusted() >= context.prec:
            return context._raise_error(InvalidOperation,
                                        'insufficient precision: pow() 3rd '
                                        'argument must not have more than '
                                        'precision digits')

        # define 0**0 == NaN, for consistency with two-argument pow
        # (even though it hurts!)
        if not other and not self:
            return context._raise_error(InvalidOperation,
                                        'at least one of pow() 1st argument '
                                        'and 2nd argument must be nonzero; '
                                        '0**0 is not defined')

        # compute sign of result
        if other._iseven():
            sign = 0
        else:
            sign = self._sign

        # convert modulo to a Python integer, and self and other to
        # Decimal integers (i.e. force their exponents to be >= 0)
        modulo = abs(int(modulo))
        base = _WorkRep(self.to_integral_value())
        exponent = _WorkRep(other.to_integral_value())

        # compute result using integer pow()
        base = (base.int % modulo * pow(10, base.exp, modulo)) % modulo
        for i in range(exponent.exp):
            base = pow(base, 10, modulo)
        base = pow(base, exponent.int, modulo)

        return _dec_from_triple(sign, str(base), 0)

    def _power_exact(self, other, p):
        """Attempt to compute self**other exactly.

        Given Decimals self and other and an integer p, attempt to
        compute an exact result for the power self**other, with p
        digits of precision.  Return None if self**other is not
        exactly representable in p digits.

        Assumes that elimination of special cases has already been
        performed: self and other must both be nonspecial; self must
        be positive and not numerically equal to 1; other must be
        nonzero.  For efficiency, other._exp should not be too large,
        so that 10**abs(other._exp) is a feasible calculation."""

        # In the comments below, we write x for the value of self and y for the
        # value of other.  Write x = xc*10**xe and abs(y) = yc*10**ye, with xc
        # and yc positive integers not divisible by 10.

        # The main purpose of this method is to identify the *failure*
        # of x**y to be exactly representable with as little effort as
        # possible.  So we look for cheap and easy tests that
        # eliminate the possibility of x**y being exact.  Only if all
        # these tests are passed do we go on to actually compute x**y.

        # Here's the main idea.  Express y as a rational number m/n, with m and
        # n relatively prime and n>0.  Then for x**y to be exactly
        # representable (at *any* precision), xc must be the nth power of a
        # positive integer and xe must be divisible by n.  If y is negative
        # then additionally xc must be a power of either 2 or 5, hence a power
        # of 2**n or 5**n.
        #
        # There's a limit to how small |y| can be: if y=m/n as above
        # then:
        #
        #  (1) if xc != 1 then for the result to be representable we
        #      need xc**(1/n) >= 2, and hence also xc**|y| >= 2.  So
        #      if |y| <= 1/nbits(xc) then xc < 2**nbits(xc) <=
        #      2**(1/|y|), hence xc**|y| < 2 and the result is not
        #      representable.
        #
        #  (2) if xe != 0, |xe|*(1/n) >= 1, so |xe|*|y| >= 1.  Hence if
        #      |y| < 1/|xe| then the result is not representable.
        #
        # Note that since x is not equal to 1, at least one of (1) and
        # (2) must apply.  Now |y| < 1/nbits(xc) iff |yc|*nbits(xc) <
        # 10**-ye iff len(str(|yc|*nbits(xc)) <= -ye.
        #
        # There's also a limit to how large y can be, at least if it's
        # positive: the normalized result will have coefficient xc**y,
        # so if it's representable then xc**y < 10**p, and y <
        # p/log10(xc).  Hence if y*log10(xc) >= p then the result is
        # not exactly representable.

        # if len(str(abs(yc*xe)) <= -ye then abs(yc*xe) < 10**-ye,
        # so |y| < 1/xe and the result is not representable.
        # Similarly, len(str(abs(yc)*xc_bits)) <= -ye implies |y|
        # < 1/nbits(xc).

        x = _WorkRep(self)
        xc, xe = x.int, x.exp
        while xc % 10 == 0:
            xc //= 10
            xe += 1

        y = _WorkRep(other)
        yc, ye = y.int, y.exp
        while yc % 10 == 0:
            yc //= 10
            ye += 1

        # case where xc == 1: result is 10**(xe*y), with xe*y
        # required to be an integer
        if xc == 1:
            xe *= yc
            # result is now 10**(xe * 10**ye);  xe * 10**ye must be integral
            while xe % 10 == 0:
                xe //= 10
                ye += 1
            if ye < 0:
                return None
            exponent = xe * 10**ye
            if y.sign == 1:
                exponent = -exponent
            # if other is a nonnegative integer, use ideal exponent
            if other._isinteger() and other._sign == 0:
                ideal_exponent = self._exp*int(other)
                zeros = min(exponent-ideal_exponent, p-1)
            else:
                zeros = 0
            return _dec_from_triple(0, '1' + '0'*zeros, exponent-zeros)

        # case where y is negative: xc must be either a power
        # of 2 or a power of 5.
        if y.sign == 1:
            last_digit = xc % 10
            if last_digit in (2,4,6,8):
                # quick test for power of 2
                if xc & -xc != xc:
                    return None
                # now xc is a power of 2; e is its exponent
                e = _nbits(xc)-1

                # We now have:
                #
                #   x = 2**e * 10**xe, e > 0, and y < 0.
                #
                # The exact result is:
                #
                #   x**y = 5**(-e*y) * 10**(e*y + xe*y)
                #
                # provided that both e*y and xe*y are integers.  Note that if
                # 5**(-e*y) >= 10**p, then the result can't be expressed
                # exactly with p digits of precision.
                #
                # Using the above, we can guard against large values of ye.
                # 93/65 is an upper bound for log(10)/log(5), so if
                #
                #   ye >= len(str(93*p//65))
                #
                # then
                #
                #   -e*y >= -y >= 10**ye > 93*p/65 > p*log(10)/log(5),
                #
                # so 5**(-e*y) >= 10**p, and the coefficient of the result
                # can't be expressed in p digits.

                # emax >= largest e such that 5**e < 10**p.
                emax = p*93//65
                if ye >= len(str(emax)):
                    return None

                # Find -e*y and -xe*y; both must be integers
                e = _decimal_lshift_exact(e * yc, ye)
                xe = _decimal_lshift_exact(xe * yc, ye)
                if e is None or xe is None:
                    return None

                if e > emax:
                    return None
                xc = 5**e

            elif last_digit == 5:
                # e >= log_5(xc) if xc is a power of 5; we have
                # equality all the way up to xc=5**2658
                e = _nbits(xc)*28//65
                xc, remainder = divmod(5**e, xc)
                if remainder:
                    return None
                while xc % 5 == 0:
                    xc //= 5
                    e -= 1

                # Guard against large values of ye, using the same logic as in
                # the 'xc is a power of 2' branch.  10/3 is an upper bound for
                # log(10)/log(2).
                emax = p*10//3
                if ye >= len(str(emax)):
                    return None

                e = _decimal_lshift_exact(e * yc, ye)
                xe = _decimal_lshift_exact(xe * yc, ye)
                if e is None or xe is None:
                    return None

                if e > emax:
                    return None
                xc = 2**e
            else:
                return None

            if xc >= 10**p:
                return None
            xe = -e-xe
            return _dec_from_triple(0, str(xc), xe)

        # now y is positive; find m and n such that y = m/n
        if ye >= 0:
            m, n = yc*10**ye, 1
        else:
            if xe != 0 and len(str(abs(yc*xe))) <= -ye:
                return None
            xc_bits = _nbits(xc)
            if xc != 1 and len(str(abs(yc)*xc_bits)) <= -ye:
                return None
            m, n = yc, 10**(-ye)
            while m % 2 == n % 2 == 0:
                m //= 2
                n //= 2
            while m % 5 == n % 5 == 0:
                m //= 5
                n //= 5

        # compute nth root of xc*10**xe
        if n > 1:
            # if 1 < xc < 2**n then xc isn't an nth power
            if xc != 1 and xc_bits <= n:
                return None

            xe, rem = divmod(xe, n)
            if rem != 0:
                return None

            # compute nth root of xc using Newton's method
            a = 1 << -(-_nbits(xc)//n) # initial estimate
            while True:
                q, r = divmod(xc, a**(n-1))
                if a <= q:
                    break
                else:
                    a = (a*(n-1) + q)//n
            if not (a == q and r == 0):
                return None
            xc = a

        # now xc*10**xe is the nth root of the original xc*10**xe
        # compute mth power of xc*10**xe

        # if m > p*100//_log10_lb(xc) then m > p/log10(xc), hence xc**m >
        # 10**p and the result is not representable.
        if xc > 1 and m > p*100//_log10_lb(xc):
            return None
        xc = xc**m
        xe *= m
        if xc > 10**p:
            return None

        # by this point the result *is* exactly representable
        # adjust the exponent to get as close as possible to the ideal
        # exponent, if necessary
        str_xc = str(xc)
        if other._isinteger() and other._sign == 0:
            ideal_exponent = self._exp*int(other)
            zeros = min(xe-ideal_exponent, p-len(str_xc))
        else:
            zeros = 0
        return _dec_from_triple(0, str_xc+'0'*zeros, xe-zeros)

    def __pow__(self, other, modulo=None, context=None):
        """Return self ** other [ % modulo].

        With two arguments, compute self**other.

        With three arguments, compute (self**other) % modulo.  For the
        three argument form, the following restrictions on the
        arguments hold:

         - all three arguments must be integral
         - other must be nonnegative
         - either self or other (or both) must be nonzero
         - modulo must be nonzero and must have at most p digits,
           where p is the context precision.

        If any of these restrictions is violated the InvalidOperation
        flag is raised.

        The result of pow(self, other, modulo) is identical to the
        result that would be obtained by computing (self**other) %
        modulo with unbounded precision, but is computed more
        efficiently.  It is always exact.
        """

        if modulo is not None:
            return self._power_modulo(other, modulo, context)

        other = _convert_other(other)
        if other is NotImplemented:
            return other

        if context is None:
            context = getcontext()

        # either argument is a NaN => result is NaN
        ans = self._check_nans(other, context)
        if ans:
            return ans

        # 0**0 = NaN (!), x**0 = 1 for nonzero x (including +/-Infinity)
        if not other:
            if not self:
                return context._raise_error(InvalidOperation, '0 ** 0')
            else:
                return _One

        # result has sign 1 iff self._sign is 1 and other is an odd integer
        result_sign = 0
        if self._sign == 1:
            if other._isinteger():
                if not other._iseven():
                    result_sign = 1
            else:
                # -ve**noninteger = NaN
                # (-0)**noninteger = 0**noninteger
                if self:
                    return context._raise_error(InvalidOperation,
                        'x ** y with x negative and y not an integer')
            # negate self, without doing any unwanted rounding
            self = self.copy_negate()

        # 0**(+ve or Inf)= 0; 0**(-ve or -Inf) = Infinity
        if not self:
            if other._sign == 0:
                return _dec_from_triple(result_sign, '0', 0)
            else:
                return _SignedInfinity[result_sign]

        # Inf**(+ve or Inf) = Inf; Inf**(-ve or -Inf) = 0
        if self._isinfinity():
            if other._sign == 0:
                return _SignedInfinity[result_sign]
            else:
                return _dec_from_triple(result_sign, '0', 0)

        # 1**other = 1, but the choice of exponent and the flags
        # depend on the exponent of self, and on whether other is a
        # positive integer, a negative integer, or neither
        if self == _One:
            if other._isinteger():
                # exp = max(self._exp*max(int(other), 0),
                # 1-context.prec) but evaluating int(other) directly
                # is dangerous until we know other is small (other
                # could be 1e999999999)
                if other._sign == 1:
                    multiplier = 0
                elif other > context.prec:
                    multiplier = context.prec
                else:
                    multiplier = int(other)

                exp = self._exp * multiplier
                if exp < 1-context.prec:
                    exp = 1-context.prec
                    context._raise_error(Rounded)
            else:
                context._raise_error(Inexact)
                context._raise_error(Rounded)
                exp = 1-context.prec

            return _dec_from_triple(result_sign, '1'+'0'*-exp, exp)

        # compute adjusted exponent of self
        self_adj = self.adjusted()

        # self ** infinity is infinity if self > 1, 0 if self < 1
        # self ** -infinity is infinity if self < 1, 0 if self > 1
        if other._isinfinity():
            if (other._sign == 0) == (self_adj < 0):
                return _dec_from_triple(result_sign, '0', 0)
            else:
                return _SignedInfinity[result_sign]

        # from here on, the result always goes through the call
        # to _fix at the end of this function.
        ans = None
        exact = False

        # crude test to catch cases of extreme overflow/underflow.  If
        # log10(self)*other >= 10**bound and bound >= len(str(Emax))
        # then 10**bound >= 10**len(str(Emax)) >= Emax+1 and hence
        # self**other >= 10**(Emax+1), so overflow occurs.  The test
        # for underflow is similar.
        bound = self._log10_exp_bound() + other.adjusted()
        if (self_adj >= 0) == (other._sign == 0):
            # self > 1 and other +ve, or self < 1 and other -ve
            # possibility of overflow
            if bound >= len(str(context.Emax)):
                ans = _dec_from_triple(result_sign, '1', context.Emax+1)
        else:
            # self > 1 and other -ve, or self < 1 and other +ve
            # possibility of underflow to 0
            Etiny = context.Etiny()
            if bound >= len(str(-Etiny)):
                ans = _dec_from_triple(result_sign, '1', Etiny-1)

        # try for an exact result with precision +1
        if ans is None:
            ans = self._power_exact(other, context.prec + 1)
            if ans is not None:
                if result_sign == 1:
                    ans = _dec_from_triple(1, ans._int, ans._exp)
                exact = True

        # usual case: inexact result, x**y computed directly as exp(y*log(x))
        if ans is None:
            p = context.prec
            x = _WorkRep(self)
            xc, xe = x.int, x.exp
            y = _WorkRep(other)
            yc, ye = y.int, y.exp
            if y.sign == 1:
                yc = -yc

            # compute correctly rounded result:  start with precision +3,
            # then increase precision until result is unambiguously roundable
            extra = 3
            while True:
                coeff, exp = _dpower(xc, xe, yc, ye, p+extra)
                if coeff % (5*10**(len(str(coeff))-p-1)):
                    break
                extra += 3

            ans = _dec_from_triple(result_sign, str(coeff), exp)

        # unlike exp, ln and log10, the power function respects the
        # rounding mode; no need to switch to ROUND_HALF_EVEN here

        # There's a difficulty here when 'other' is not an integer and
        # the result is exact.  In this case, the specification
        # requires that the Inexact flag be raised (in spite of
        # exactness), but since the result is exact _fix won't do this
        # for us.  (Correspondingly, the Underflow signal should also
        # be raised for subnormal results.)  We can't directly raise
        # these signals either before or after calling _fix, since
        # that would violate the precedence for signals.  So we wrap
        # the ._fix call in a temporary context, and reraise
        # afterwards.
        if exact and not other._isinteger():
            # pad with zeros up to length context.prec+1 if necessary; this
            # ensures that the Rounded signal will be raised.
            if len(ans._int) <= context.prec:
                expdiff = context.prec + 1 - len(ans._int)
                ans = _dec_from_triple(ans._sign, ans._int+'0'*expdiff,
                                       ans._exp-expdiff)

            # create a copy of the current context, with cleared flags/traps
            newcontext = context.copy()
            newcontext.clear_flags()
            for exception in _signals:
                newcontext.traps[exception] = 0

            # round in the new context
            ans = ans._fix(newcontext)

            # raise Inexact, and if necessary, Underflow
            newcontext._raise_error(Inexact)
            if newcontext.flags[Subnormal]:
                newcontext._raise_error(Underflow)

            # propagate signals to the original context; _fix could
            # have raised any of Overflow, Underflow, Subnormal,
            # Inexact, Rounded, Clamped.  Overflow needs the correct
            # arguments.  Note that the order of the exceptions is
            # important here.
            if newcontext.flags[Overflow]:
                context._raise_error(Overflow, 'above Emax', ans._sign)
            for exception in Underflow, Subnormal, Inexact, Rounded, Clamped:
                if newcontext.flags[exception]:
                    context._raise_error(exception)

        else:
            ans = ans._fix(context)

        return ans

    def __rpow__(self, other, context=None):
        """Swaps self/other and returns __pow__."""
        other = _convert_other(other)
        if other is NotImplemented:
            return other
        return other.__pow__(self, context=context)

    def normalize(self, context=None):
        """Normalize- strip trailing 0s, change anything equal to 0 to 0e0"""

        if context is None:
            context = getcontext()

        if self._is_special:
            ans = self._check_nans(context=context)
            if ans:
                return ans

        dup = self._fix(context)
        if dup._isinfinity():
            return dup

        if not dup:
            return _dec_from_triple(dup._sign, '0', 0)
        exp_max = [context.Emax, context.Etop()][context.clamp]
        end = len(dup._int)
        exp = dup._exp
        while dup._int[end-1] == '0' and exp < exp_max:
            exp += 1
            end -= 1
        return _dec_from_triple(dup._sign, dup._int[:end], exp)

    def quantize(self, exp, rounding=None, context=None):
        """Quantize self so its exponent is the same as that of exp.

        Similar to self._rescale(exp._exp) but with error checking.
        """
        exp = _convert_other(exp, raiseit=True)

        if context is None:
            context = getcontext()
        if rounding is None:
            rounding = context.rounding

        if self._is_special or exp._is_special:
            ans = self._check_nans(exp, context)
            if ans:
                return ans

            if exp._isinfinity() or self._isinfinity():
                if exp._isinfinity() and self._isinfinity():
                    return Decimal(self)  # if both are inf, it is OK
                return context._raise_error(InvalidOperation,
                                        'quantize with one INF')

        # exp._exp should be between Etiny and Emax
        if not (context.Etiny() <= exp._exp <= context.Emax):
            return context._raise_error(InvalidOperation,
                   'target exponent out of bounds in quantize')

        if not self:
            ans = _dec_from_triple(self._sign, '0', exp._exp)
            return ans._fix(context)

        self_adjusted = self.adjusted()
        if self_adjusted > context.Emax:
            return context._raise_error(InvalidOperation,
                                        'exponent of quantize result too large for current context')
        if self_adjusted - exp._exp + 1 > context.prec:
            return context._raise_error(InvalidOperation,
                                        'quantize result has too many digits for current context')

        ans = self._rescale(exp._exp, rounding)
        if ans.adjusted() > context.Emax:
            return context._raise_error(InvalidOperation,
                                        'exponent of quantize result too large for current context')
        if len(ans._int) > context.prec:
            return context._raise_error(InvalidOperation,
                                        'quantize result has too many digits for current context')

        # raise appropriate flags
        if ans and ans.adjusted() < context.Emin:
            context._raise_error(Subnormal)
        if ans._exp > self._exp:
            if ans != self:
                context._raise_error(Inexact)
            context._raise_error(Rounded)

        # call to fix takes care of any necessary folddown, and
        # signals Clamped if necessary
        ans = ans._fix(context)
        return ans

    def same_quantum(self, other, context=None):
        """Return True if self and other have the same exponent; otherwise
        return False.

        If either operand is a special value, the following rules are used:
           * return True if both operands are infinities
           * return True if both operands are NaNs
           * otherwise, return False.
        """
        other = _convert_other(other, raiseit=True)
        if self._is_special or other._is_special:
            return (self.is_nan() and other.is_nan() or
                    self.is_infinite() and other.is_infinite())
        return self._exp == other._exp

    def _rescale(self, exp, rounding):
        """Rescale self so that the exponent is exp, either by padding with zeros
        or by truncating digits, using the given rounding mode.

        Specials are returned without change.  This operation is
        quiet: it raises no flags, and uses no information from the
        context.

        exp = exp to scale to (an integer)
        rounding = rounding mode
        """
        if self._is_special:
            return Decimal(self)
        if not self:
            return _dec_from_triple(self._sign, '0', exp)

        if self._exp >= exp:
            # pad answer with zeros if necessary
            return _dec_from_triple(self._sign,
                                        self._int + '0'*(self._exp - exp), exp)

        # too many digits; round and lose data.  If self.adjusted() <
        # exp-1, replace self by 10**(exp-1) before rounding
        digits = len(self._int) + self._exp - exp
        if digits < 0:
            self = _dec_from_triple(self._sign, '1', exp-1)
            digits = 0
        this_function = self._pick_rounding_function[rounding]
        changed = this_function(self, digits)
        coeff = self._int[:digits] or '0'
        if changed == 1:
            coeff = str(int(coeff)+1)
        return _dec_from_triple(self._sign, coeff, exp)

    def _round(self, places, rounding):
        """Round a nonzero, nonspecial Decimal to a fixed number of
        significant figures, using the given rounding mode.

        Infinities, NaNs and zeros are returned unaltered.

        This operation is quiet: it raises no flags, and uses no
        information from the context.

        """
        if places <= 0:
            raise ValueError("argument should be at least 1 in _round")
        if self._is_special or not self:
            return Decimal(self)
        ans = self._rescale(self.adjusted()+1-places, rounding)
        # it can happen that the rescale alters the adjusted exponent;
        # for example when rounding 99.97 to 3 significant figures.
        # When this happens we end up with an extra 0 at the end of
        # the number; a second rescale fixes this.
        if ans.adjusted() != self.adjusted():
            ans = ans._rescale(ans.adjusted()+1-places, rounding)
        return ans

    def to_integral_exact(self, rounding=None, context=None):
        """Rounds to a nearby integer.

        If no rounding mode is specified, take the rounding mode from
        the context.  This method raises the Rounded and Inexact flags
        when appropriate.

        See also: to_integral_value, which does exactly the same as
        this method except that it doesn't raise Inexact or Rounded.
        """
        if self._is_special:
            ans = self._check_nans(context=context)
            if ans:
                return ans
            return Decimal(self)
        if self._exp >= 0:
            return Decimal(self)
        if not self:
            return _dec_from_triple(self._sign, '0', 0)
        if context is None:
            context = getcontext()
        if rounding is None:
            rounding = context.rounding
        ans = self._rescale(0, rounding)
        if ans != self:
            context._raise_error(Inexact)
        context._raise_error(Rounded)
        return ans

    def to_integral_value(self, rounding=None, context=None):
        """Rounds to the nearest integer, without raising inexact, rounded."""
        if context is None:
            context = getcontext()
        if rounding is None:
            rounding = context.rounding
        if self._is_special:
            ans = self._check_nans(context=context)
            if ans:
                return ans
            return Decimal(self)
        if self._exp >= 0:
            return Decimal(self)
        else:
            return self._rescale(0, rounding)

    # the method name changed, but we provide also the old one, for compatibility
    to_integral = to_integral_value

    def sqrt(self, context=None):
        """Return the square root of self."""
        if context is None:
            context = getcontext()

        if self._is_special:
            ans = self._check_nans(context=context)
            if ans:
                return ans

            if self._isinfinity() and self._sign == 0:
                return Decimal(self)

        if not self:
            # exponent = self._exp // 2.  sqrt(-0) = -0
            ans = _dec_from_triple(self._sign, '0', self._exp // 2)
            return ans._fix(context)

        if self._sign == 1:
            return context._raise_error(InvalidOperation, 'sqrt(-x), x > 0')

        # At this point self represents a positive number.  Let p be
        # the desired precision and express self in the form c*100**e
        # with c a positive real number and e an integer, c and e
        # being chosen so that 100**(p-1) <= c < 100**p.  Then the
        # (exact) square root of self is sqrt(c)*10**e, and 10**(p-1)
        # <= sqrt(c) < 10**p, so the closest representable Decimal at
        # precision p is n*10**e where n = round_half_even(sqrt(c)),
        # the closest integer to sqrt(c) with the even integer chosen
        # in the case of a tie.
        #
        # To ensure correct rounding in all cases, we use the
        # following trick: we compute the square root to an extra
        # place (precision p+1 instead of precision p), rounding down.
        # Then, if the result is inexact and its last digit is 0 or 5,
        # we increase the last digit to 1 or 6 respectively; if it's
        # exact we leave the last digit alone.  Now the final round to
        # p places (or fewer in the case of underflow) will round
        # correctly and raise the appropriate flags.

        # use an extra digit of precision
        prec = context.prec+1

        # write argument in the form c*100**e where e = self._exp//2
        # is the 'ideal' exponent, to be used if the square root is
        # exactly representable.  l is the number of 'digits' of c in
        # base 100, so that 100**(l-1) <= c < 100**l.
        op = _WorkRep(self)
        e = op.exp >> 1
        if op.exp & 1:
            c = op.int * 10
            l = (len(self._int) >> 1) + 1
        else:
            c = op.int
            l = len(self._int)+1 >> 1

        # rescale so that c has exactly prec base 100 'digits'
        shift = prec-l
        if shift >= 0:
            c *= 100**shift
            exact = True
        else:
            c, remainder = divmod(c, 100**-shift)
            exact = not remainder
        e -= shift

        # find n = floor(sqrt(c)) using Newton's method
        n = 10**prec
        while True:
            q = c//n
            if n <= q:
                break
            else:
                n = n + q >> 1
        exact = exact and n*n == c

        if exact:
            # result is exact; rescale to use ideal exponent e
            if shift >= 0:
                # assert n % 10**shift == 0
                n //= 10**shift
            else:
                n *= 10**-shift
            e += shift
        else:
            # result is not exact; fix last digit as described above
            if n % 5 == 0:
                n += 1

        ans = _dec_from_triple(0, str(n), e)

        # round, and fit to current context
        context = context._shallow_copy()
        rounding = context._set_rounding(ROUND_HALF_EVEN)
        ans = ans._fix(context)
        context.rounding = rounding

        return ans

    def max(self, other, context=None):
        """Returns the larger value.

        Like max(self, other) except if one is not a number, returns
        NaN (and signals if one is sNaN).  Also rounds.
        """
        other = _convert_other(other, raiseit=True)

        if context is None:
            context = getcontext()

        if self._is_special or other._is_special:
            # If one operand is a quiet NaN and the other is number, then the
            # number is always returned
            sn = self._isnan()
            on = other._isnan()
            if sn or on:
                if on == 1 and sn == 0:
                    return self._fix(context)
                if sn == 1 and on == 0:
                    return other._fix(context)
                return self._check_nans(other, context)

        c = self._cmp(other)
        if c == 0:
            # If both operands are finite and equal in numerical value
            # then an ordering is applied:
            #
            # If the signs differ then max returns the operand with the
            # positive sign and min returns the operand with the negative sign
            #
            # If the signs are the same then the exponent is used to select
            # the result.  This is exactly the ordering used in compare_total.
            c = self.compare_total(other)

        if c == -1:
            ans = other
        else:
            ans = self

        return ans._fix(context)

    def min(self, other, context=None):
        """Returns the smaller value.

        Like min(self, other) except if one is not a number, returns
        NaN (and signals if one is sNaN).  Also rounds.
        """
        other = _convert_other(other, raiseit=True)

        if context is None:
            context = getcontext()

        if self._is_special or other._is_special:
            # If one operand is a quiet NaN and the other is number, then the
            # number is always returned
            sn = self._isnan()
            on = other._isnan()
            if sn or on:
                if on == 1 and sn == 0:
                    return self._fix(context)
                if sn == 1 and on == 0:
                    return other._fix(context)
                return self._check_nans(other, context)

        c = self._cmp(other)
        if c == 0:
            c = self.compare_total(other)

        if c == -1:
            ans = self
        else:
            ans = other

        return ans._fix(context)

    def _isinteger(self):
        """Returns whether self is an integer"""
        if self._is_special:
            return False
        if self._exp >= 0:
            return True
        rest = self._int[self._exp:]
        return rest == '0'*len(rest)

    def _iseven(self):
        """Returns True if self is even.  Assumes self is an integer."""
        if not self or self._exp > 0:
            return True
        return self._int[-1+self._exp] in '02468'

    def adjusted(self):
        """Return the adjusted exponent of self"""
        try:
            return self._exp + len(self._int) - 1
        # If NaN or Infinity, self._exp is string
        except TypeError:
            return 0

    def canonical(self):
        """Returns the same Decimal object.

        As we do not have different encodings for the same number, the
        received object already is in its canonical form.
        """
        return self

    def compare_signal(self, other, context=None):
        """Compares self to the other operand numerically.

        It's pretty much like compare(), but all NaNs signal, with signaling
        NaNs taking precedence over quiet NaNs.
        """
        other = _convert_other(other, raiseit = True)
        ans = self._compare_check_nans(other, context)
        if ans:
            return ans
        return self.compare(other, context=context)

    def compare_total(self, other, context=None):
        """Compares self to other using the abstract representations.

        This is not like the standard compare, which use their numerical
        value. Note that a total ordering is defined for all possible abstract
        representations.
        """
        other = _convert_other(other, raiseit=True)

        # if one is negative and the other is positive, it's easy
        if self._sign and not other._sign:
            return _NegativeOne
        if not self._sign and other._sign:
            return _One
        sign = self._sign

        # let's handle both NaN types
        self_nan = self._isnan()
        other_nan = other._isnan()
        if self_nan or other_nan:
            if self_nan == other_nan:
                # compare payloads as though they're integers
                self_key = len(self._int), self._int
                other_key = len(other._int), other._int
                if self_key < other_key:
                    if sign:
                        return _One
                    else:
                        return _NegativeOne
                if self_key > other_key:
                    if sign:
                        return _NegativeOne
                    else:
                        return _One
                return _Zero

            if sign:
                if self_nan == 1:
                    return _NegativeOne
                if other_nan == 1:
                    return _One
                if self_nan == 2:
                    return _NegativeOne
                if other_nan == 2:
                    return _One
            else:
                if self_nan == 1:
                    return _One
                if other_nan == 1:
                    return _NegativeOne
                if self_nan == 2:
                    return _One
                if other_nan == 2:
                    return _NegativeOne

        if self < other:
            return _NegativeOne
        if self > other:
            return _One

        if self._exp < other._exp:
            if sign:
                return _One
            else:
                return _NegativeOne
        if self._exp > other._exp:
            if sign:
                return _NegativeOne
            else:
                return _One
        return _Zero


    def compare_total_mag(self, other, context=None):
        """Compares self to other using abstract repr., ignoring sign.

        Like compare_total, but with operand's sign ignored and assumed to be 0.
        """
        other = _convert_other(other, raiseit=True)

        s = self.copy_abs()
        o = other.copy_abs()
        return s.compare_total(o)

    def copy_abs(self):
        """Returns a copy with the sign set to 0. """
        return _dec_from_triple(0, self._int, self._exp, self._is_special)

    def copy_negate(self):
        """Returns a copy with the sign inverted."""
        if self._sign:
            return _dec_from_triple(0, self._int, self._exp, self._is_special)
        else:
            return _dec_from_triple(1, self._int, self._exp, self._is_special)

    def copy_sign(self, other, context=None):
        """Returns self with the sign of other."""
        other = _convert_other(other, raiseit=True)
        return _dec_from_triple(other._sign, self._int,
                                self._exp, self._is_special)

    def exp(self, context=None):
        """Returns e ** self."""

        if context is None:
            context = getcontext()

        # exp(NaN) = NaN
        ans = self._check_nans(context=context)
        if ans:
            return ans

        # exp(-Infinity) = 0
        if self._isinfinity() == -1:
            return _Zero

        # exp(0) = 1
        if not self:
            return _One

        # exp(Infinity) = Infinity
        if self._isinfinity() == 1:
            return Decimal(self)

        # the result is now guaranteed to be inexact (the true
        # mathematical result is transcendental). There's no need to
        # raise Rounded and Inexact here---they'll always be raised as
        # a result of the call to _fix.
        p = context.prec
        adj = self.adjusted()

        # we only need to do any computation for quite a small range
        # of adjusted exponents---for example, -29 <= adj <= 10 for
        # the default context.  For smaller exponent the result is
        # indistinguishable from 1 at the given precision, while for
        # larger exponent the result either overflows or underflows.
        if self._sign == 0 and adj > len(str((context.Emax+1)*3)):
            # overflow
            ans = _dec_from_triple(0, '1', context.Emax+1)
        elif self._sign == 1 and adj > len(str((-context.Etiny()+1)*3)):
            # underflow to 0
            ans = _dec_from_triple(0, '1', context.Etiny()-1)
        elif self._sign == 0 and adj < -p:
            # p+1 digits; final round will raise correct flags
            ans = _dec_from_triple(0, '1' + '0'*(p-1) + '1', -p)
        elif self._sign == 1 and adj < -p-1:
            # p+1 digits; final round will raise correct flags
            ans = _dec_from_triple(0, '9'*(p+1), -p-1)
        # general case
        else:
            op = _WorkRep(self)
            c, e = op.int, op.exp
            if op.sign == 1:
                c = -c

            # compute correctly rounded result: increase precision by
            # 3 digits at a time until we get an unambiguously
            # roundable result
            extra = 3
            while True:
                coeff, exp = _dexp(c, e, p+extra)
                if coeff % (5*10**(len(str(coeff))-p-1)):
                    break
                extra += 3

            ans = _dec_from_triple(0, str(coeff), exp)

        # at this stage, ans should round correctly with *any*
        # rounding mode, not just with ROUND_HALF_EVEN
        context = context._shallow_copy()
        rounding = context._set_rounding(ROUND_HALF_EVEN)
        ans = ans._fix(context)
        context.rounding = rounding

        return ans

    def is_canonical(self):
        """Return True if self is canonical; otherwise return False.

        Currently, the encoding of a Decimal instance is always
        canonical, so this method returns True for any Decimal.
        """
        return True

    def is_finite(self):
        """Return True if self is finite; otherwise return False.

        A Decimal instance is considered finite if it is neither
        infinite nor a NaN.
        """
        return not self._is_special

    def is_infinite(self):
        """Return True if self is infinite; otherwise return False."""
        return self._exp == 'F'

    def is_nan(self):
        """Return True if self is a qNaN or sNaN; otherwise return False."""
        return self._exp in ('n', 'N')

    def is_normal(self, context=None):
        """Return True if self is a normal number; otherwise return False."""
        if self._is_special or not self:
            return False
        if context is None:
            context = getcontext()
        return context.Emin <= self.adjusted()

    def is_qnan(self):
        """Return True if self is a quiet NaN; otherwise return False."""
        return self._exp == 'n'

    def is_signed(self):
        """Return True if self is negative; otherwise return False."""
        return self._sign == 1

    def is_snan(self):
        """Return True if self is a signaling NaN; otherwise return False."""
        return self._exp == 'N'

    def is_subnormal(self, context=None):
        """Return True if self is subnormal; otherwise return False."""
        if self._is_special or not self:
            return False
        if context is None:
            context = getcontext()
        return self.adjusted() < context.Emin

    def is_zero(self):
        """Return True if self is a zero; otherwise return False."""
        return not self._is_special and self._int == '0'

    def _ln_exp_bound(self):
        """Compute a lower bound for the adjusted exponent of self.ln().
        In other words, compute r such that self.ln() >= 10**r.  Assumes
        that self is finite and positive and that self != 1.
        """

        # for 0.1 <= x <= 10 we use the inequalities 1-1/x <= ln(x) <= x-1
        adj = self._exp + len(self._int) - 1
        if adj >= 1:
            # argument >= 10; we use 23/10 = 2.3 as a lower bound for ln(10)
            return len(str(adj*23//10)) - 1
        if adj <= -2:
            # argument <= 0.1
            return len(str((-1-adj)*23//10)) - 1
        op = _WorkRep(self)
        c, e = op.int, op.exp
        if adj == 0:
            # 1 < self < 10
            num = str(c-10**-e)
            den = str(c)
            return len(num) - len(den) - (num < den)
        # adj == -1, 0.1 <= self < 1
        return e + len(str(10**-e - c)) - 1


    def ln(self, context=None):
        """Returns the natural (base e) logarithm of self."""

        if context is None:
            context = getcontext()

        # ln(NaN) = NaN
        ans = self._check_nans(context=context)
        if ans:
            return ans

        # ln(0.0) == -Infinity
        if not self:
            return _NegativeInfinity

        # ln(Infinity) = Infinity
        if self._isinfinity() == 1:
            return _Infinity

        # ln(1.0) == 0.0
        if self == _One:
            return _Zero

        # ln(negative) raises InvalidOperation
        if self._sign == 1:
            return context._raise_error(InvalidOperation,
                                        'ln of a negative value')

        # result is irrational, so necessarily inexact
        op = _WorkRep(self)
        c, e = op.int, op.exp
        p = context.prec

        # correctly rounded result: repeatedly increase precision by 3
        # until we get an unambiguously roundable result
        places = p - self._ln_exp_bound() + 2 # at least p+3 places
        while True:
            coeff = _dlog(c, e, places)
            # assert len(str(abs(coeff)))-p >= 1
            if coeff % (5*10**(len(str(abs(coeff)))-p-1)):
                break
            places += 3
        ans = _dec_from_triple(int(coeff<0), str(abs(coeff)), -places)

        context = context._shallow_copy()
        rounding = context._set_rounding(ROUND_HALF_EVEN)
        ans = ans._fix(context)
        context.rounding = rounding
        return ans

    def _log10_exp_bound(self):
        """Compute a lower bound for the adjusted exponent of self.log10().
        In other words, find r such that self.log10() >= 10**r.
        Assumes that self is finite and positive and that self != 1.
        """

        # For x >= 10 or x < 0.1 we only need a bound on the integer
        # part of log10(self), and this comes directly from the
        # exponent of x.  For 0.1 <= x <= 10 we use the inequalities
        # 1-1/x <= log(x) <= x-1. If x > 1 we have |log10(x)| >
        # (1-1/x)/2.31 > 0.  If x < 1 then |log10(x)| > (1-x)/2.31 > 0

        adj = self._exp + len(self._int) - 1
        if adj >= 1:
            # self >= 10
            return len(str(adj))-1
        if adj <= -2:
            # self < 0.1
            return len(str(-1-adj))-1
        op = _WorkRep(self)
        c, e = op.int, op.exp
        if adj == 0:
            # 1 < self < 10
            num = str(c-10**-e)
            den = str(231*c)
            return len(num) - len(den) - (num < den) + 2
        # adj == -1, 0.1 <= self < 1
        num = str(10**-e-c)
        return len(num) + e - (num < "231") - 1

    def log10(self, context=None):
        """Returns the base 10 logarithm of self."""

        if context is None:
            context = getcontext()

        # log10(NaN) = NaN
        ans = self._check_nans(context=context)
        if ans:
            return ans

        # log10(0.0) == -Infinity
        if not self:
            return _NegativeInfinity

        # log10(Infinity) = Infinity
        if self._isinfinity() == 1:
            return _Infinity

        # log10(negative or -Infinity) raises InvalidOperation
        if self._sign == 1:
            return context._raise_error(InvalidOperation,
                                        'log10 of a negative value')

        # log10(10**n) = n
        if self._int[0] == '1' and self._int[1:] == '0'*(len(self._int) - 1):
            # answer may need rounding
            ans = Decimal(self._exp + len(self._int) - 1)
        else:
            # result is irrational, so necessarily inexact
            op = _WorkRep(self)
            c, e = op.int, op.exp
            p = context.prec

            # correctly rounded result: repeatedly increase precision
            # until result is unambiguously roundable
            places = p-self._log10_exp_bound()+2
            while True:
                coeff = _dlog10(c, e, places)
                # assert len(str(abs(coeff)))-p >= 1
                if coeff % (5*10**(len(str(abs(coeff)))-p-1)):
                    break
                places += 3
            ans = _dec_from_triple(int(coeff<0), str(abs(coeff)), -places)

        context = context._shallow_copy()
        rounding = context._set_rounding(ROUND_HALF_EVEN)
        ans = ans._fix(context)
        context.rounding = rounding
        return ans

    def logb(self, context=None):
        """ Returns the exponent of the magnitude of self's MSD.

        The result is the integer which is the exponent of the magnitude
        of the most significant digit of self (as though it were truncated
        to a single digit while maintaining the value of that digit and
        without limiting the resulting exponent).
        """
        # logb(NaN) = NaN
        ans = self._check_nans(context=context)
        if ans:
            return ans

        if context is None:
            context = getcontext()

        # logb(+/-Inf) = +Inf
        if self._isinfinity():
            return _Infinity

        # logb(0) = -Inf, DivisionByZero
        if not self:
            return context._raise_error(DivisionByZero, 'logb(0)', 1)

        # otherwise, simply return the adjusted exponent of self, as a
        # Decimal.  Note that no attempt is made to fit the result
        # into the current context.
        ans = Decimal(self.adjusted())
        return ans._fix(context)

    def _islogical(self):
        """Return True if self is a logical operand.

        For being logical, it must be a finite number with a sign of 0,
        an exponent of 0, and a coefficient whose digits must all be
        either 0 or 1.
        """
        if self._sign != 0 or self._exp != 0:
            return False
        for dig in self._int:
            if dig not in '01':
                return False
        return True

    def _fill_logical(self, context, opa, opb):
        dif = context.prec - len(opa)
        if dif > 0:
            opa = '0'*dif + opa
        elif dif < 0:
            opa = opa[-context.prec:]
        dif = context.prec - len(opb)
        if dif > 0:
            opb = '0'*dif + opb
        elif dif < 0:
            opb = opb[-context.prec:]
        return opa, opb

    def logical_and(self, other, context=None):
        """Applies an 'and' operation between self and other's digits."""
        if context is None:
            context = getcontext()

        other = _convert_other(other, raiseit=True)

        if not self._islogical() or not other._islogical():
            return context._raise_error(InvalidOperation)

        # fill to context.prec
        (opa, opb) = self._fill_logical(context, self._int, other._int)

        # make the operation, and clean starting zeroes
        result = "".join([str(int(a)&int(b)) for a,b in zip(opa,opb)])
        return _dec_from_triple(0, result.lstrip('0') or '0', 0)

    def logical_invert(self, context=None):
        """Invert all its digits."""
        if context is None:
            context = getcontext()
        return self.logical_xor(_dec_from_triple(0,'1'*context.prec,0),
                                context)

    def logical_or(self, other, context=None):
        """Applies an 'or' operation between self and other's digits."""
        if context is None:
            context = getcontext()

        other = _convert_other(other, raiseit=True)

        if not self._islogical() or not other._islogical():
            return context._raise_error(InvalidOperation)

        # fill to context.prec
        (opa, opb) = self._fill_logical(context, self._int, other._int)

        # make the operation, and clean starting zeroes
        result = "".join([str(int(a)|int(b)) for a,b in zip(opa,opb)])
        return _dec_from_triple(0, result.lstrip('0') or '0', 0)

    def logical_xor(self, other, context=None):
        """Applies an 'xor' operation between self and other's digits."""
        if context is None:
            context = getcontext()

        other = _convert_other(other, raiseit=True)

        if not self._islogical() or not other._islogical():
            return context._raise_error(InvalidOperation)

        # fill to context.prec
        (opa, opb) = self._fill_logical(context, self._int, other._int)

        # make the operation, and clean starting zeroes
        result = "".join([str(int(a)^int(b)) for a,b in zip(opa,opb)])
        return _dec_from_triple(0, result.lstrip('0') or '0', 0)

    def max_mag(self, other, context=None):
        """Compares the values numerically with their sign ignored."""
        other = _convert_other(other, raiseit=True)

        if context is None:
            context = getcontext()

        if self._is_special or other._is_special:
            # If one operand is a quiet NaN and the other is number, then the
            # number is always returned
            sn = self._isnan()
            on = other._isnan()
            if sn or on:
                if on == 1 and sn == 0:
                    return self._fix(context)
                if sn == 1 and on == 0:
                    return other._fix(context)
                return self._check_nans(other, context)

        c = self.copy_abs()._cmp(other.copy_abs())
        if c == 0:
            c = self.compare_total(other)

        if c == -1:
            ans = other
        else:
            ans = self

        return ans._fix(context)

    def min_mag(self, other, context=None):
        """Compares the values numerically with their sign ignored."""
        other = _convert_other(other, raiseit=True)

        if context is None:
            context = getcontext()

        if self._is_special or other._is_special:
            # If one operand is a quiet NaN and the other is number, then the
            # number is always returned
            sn = self._isnan()
            on = other._isnan()
            if sn or on:
                if on == 1 and sn == 0:
                    return self._fix(context)
                if sn == 1 and on == 0:
                    return other._fix(context)
                return self._check_nans(other, context)

        c = self.copy_abs()._cmp(other.copy_abs())
        if c == 0:
            c = self.compare_total(other)

        if c == -1:
            ans = self
        else:
            ans = other

        return ans._fix(context)

    def next_minus(self, context=None):
        """Returns the largest representable number smaller than itself."""
        if context is None:
            context = getcontext()

        ans = self._check_nans(context=context)
        if ans:
            return ans

        if self._isinfinity() == -1:
            return _NegativeInfinity
        if self._isinfinity() == 1:
            return _dec_from_triple(0, '9'*context.prec, context.Etop())

        context = context.copy()
        context._set_rounding(ROUND_FLOOR)
        context._ignore_all_flags()
        new_self = self._fix(context)
        if new_self != self:
            return new_self
        return self.__sub__(_dec_from_triple(0, '1', context.Etiny()-1),
                            context)

    def next_plus(self, context=None):
        """Returns the smallest representable number larger than itself."""
        if context is None:
            context = getcontext()

        ans = self._check_nans(context=context)
        if ans:
            return ans

        if self._isinfinity() == 1:
            return _Infinity
        if self._isinfinity() == -1:
            return _dec_from_triple(1, '9'*context.prec, context.Etop())

        context = context.copy()
        context._set_rounding(ROUND_CEILING)
        context._ignore_all_flags()
        new_self = self._fix(context)
        if new_self != self:
            return new_self
        return self.__add__(_dec_from_triple(0, '1', context.Etiny()-1),
                            context)

    def next_toward(self, other, context=None):
        """Returns the number closest to self, in the direction towards other.

        The result is the closest representable number to self
        (excluding self) that is in the direction towards other,
        unless both have the same value.  If the two operands are
        numerically equal, then the result is a copy of self with the
        sign set to be the same as the sign of other.
        """
        other = _convert_other(other, raiseit=True)

        if context is None:
            context = getcontext()

        ans = self._check_nans(other, context)
        if ans:
            return ans

        comparison = self._cmp(other)
        if comparison == 0:
            return self.copy_sign(other)

        if comparison == -1:
            ans = self.next_plus(context)
        else: # comparison == 1
            ans = self.next_minus(context)

        # decide which flags to raise using value of ans
        if ans._isinfinity():
            context._raise_error(Overflow,
                                 'Infinite result from next_toward',
                                 ans._sign)
            context._raise_error(Inexact)
            context._raise_error(Rounded)
        elif ans.adjusted() < context.Emin:
            context._raise_error(Underflow)
            context._raise_error(Subnormal)
            context._raise_error(Inexact)
            context._raise_error(Rounded)
            # if precision == 1 then we don't raise Clamped for a
            # result 0E-Etiny.
            if not ans:
                context._raise_error(Clamped)

        return ans

    def number_class(self, context=None):
        """Returns an indication of the class of self.

        The class is one of the following strings:
          sNaN
          NaN
          -Infinity
          -Normal
          -Subnormal
          -Zero
          +Zero
          +Subnormal
          +Normal
          +Infinity
        """
        if self.is_snan():
            return "sNaN"
        if self.is_qnan():
            return "NaN"
        inf = self._isinfinity()
        if inf == 1:
            return "+Infinity"
        if inf == -1:
            return "-Infinity"
        if self.is_zero():
            if self._sign:
                return "-Zero"
            else:
                return "+Zero"
        if context is None:
            context = getcontext()
        if self.is_subnormal(context=context):
            if self._sign:
                return "-Subnormal"
            else:
                return "+Subnormal"
        # just a normal, regular, boring number, :)
        if self._sign:
            return "-Normal"
        else:
            return "+Normal"

    def radix(self):
        """Just returns 10, as this is Decimal, :)"""
        return Decimal(10)

    def rotate(self, other, context=None):
        """Returns a rotated copy of self, value-of-other times."""
        if context is None:
            context = getcontext()

        other = _convert_other(other, raiseit=True)

        ans = self._check_nans(other, context)
        if ans:
            return ans

        if other._exp != 0:
            return context._raise_error(InvalidOperation)
        if not (-context.prec <= int(other) <= context.prec):
            return context._raise_error(InvalidOperation)

        if self._isinfinity():
            return Decimal(self)

        # get values, pad if necessary
        torot = int(other)
        rotdig = self._int
        topad = context.prec - len(rotdig)
        if topad > 0:
            rotdig = '0'*topad + rotdig
        elif topad < 0:
            rotdig = rotdig[-topad:]

        # let's rotate!
        rotated = rotdig[torot:] + rotdig[:torot]
        return _dec_from_triple(self._sign,
                                rotated.lstrip('0') or '0', self._exp)

    def scaleb(self, other, context=None):
        """Returns self operand after adding the second value to its exp."""
        if context is None:
            context = getcontext()

        other = _convert_other(other, raiseit=True)

        ans = self._check_nans(other, context)
        if ans:
            return ans

        if other._exp != 0:
            return context._raise_error(InvalidOperation)
        liminf = -2 * (context.Emax + context.prec)
        limsup =  2 * (context.Emax + context.prec)
        if not (liminf <= int(other) <= limsup):
            return context._raise_error(InvalidOperation)

        if self._isinfinity():
            return Decimal(self)

        d = _dec_from_triple(self._sign, self._int, self._exp + int(other))
        d = d._fix(context)
        return d

    def shift(self, other, context=None):
        """Returns a shifted copy of self, value-of-other times."""
        if context is None:
            context = getcontext()

        other = _convert_other(other, raiseit=True)

        ans = self._check_nans(other, context)
        if ans:
            return ans

        if other._exp != 0:
            return context._raise_error(InvalidOperation)
        if not (-context.prec <= int(other) <= context.prec):
            return context._raise_error(InvalidOperation)

        if self._isinfinity():
            return Decimal(self)

        # get values, pad if necessary
        torot = int(other)
        rotdig = self._int
        topad = context.prec - len(rotdig)
        if topad > 0:
            rotdig = '0'*topad + rotdig
        elif topad < 0:
            rotdig = rotdig[-topad:]

        # let's shift!
        if torot < 0:
            shifted = rotdig[:torot]
        else:
            shifted = rotdig + '0'*torot
            shifted = shifted[-context.prec:]

        return _dec_from_triple(self._sign,
                                    shifted.lstrip('0') or '0', self._exp)

    # Support for pickling, copy, and deepcopy
    def __reduce__(self):
        return (self.__class__, (str(self),))

    def __copy__(self):
        if type(self) is Decimal:
            return self     # I'm immutable; therefore I am my own clone
        return self.__class__(str(self))

    def __deepcopy__(self, memo):
        if type(self) is Decimal:
            return self     # My components are also immutable
        return self.__class__(str(self))

    # PEP 3101 support.  the _localeconv keyword argument should be
    # considered private: it's provided for ease of testing only.
    def __format__(self, specifier, context=None, _localeconv=None):
        """Format a Decimal instance according to the given specifier.

        The specifier should be a standard format specifier, with the
        form described in PEP 3101.  Formatting types 'e', 'E', 'f',
        'F', 'g', 'G', 'n' and '%' are supported.  If the formatting
        type is omitted it defaults to 'g' or 'G', depending on the
        value of context.capitals.
        """

        # Note: PEP 3101 says that if the type is not present then
        # there should be at least one digit after the decimal point.
        # We take the liberty of ignoring this requirement for
        # Decimal---it's presumably there to make sure that
        # format(float, '') behaves similarly to str(float).
        if context is None:
            context = getcontext()

        spec = _parse_format_specifier(specifier, _localeconv=_localeconv)

        # special values don't care about the type or precision
        if self._is_special:
            sign = _format_sign(self._sign, spec)
            body = str(self.copy_abs())
            if spec['type'] == '%':
                body += '%'
            return _format_align(sign, body, spec)

        # a type of None defaults to 'g' or 'G', depending on context
        if spec['type'] is None:
            spec['type'] = ['g', 'G'][context.capitals]

        # if type is '%', adjust exponent of self accordingly
        if spec['type'] == '%':
            self = _dec_from_triple(self._sign, self._int, self._exp+2)

        # round if necessary, taking rounding mode from the context
        rounding = context.rounding
        precision = spec['precision']
        if precision is not None:
            if spec['type'] in 'eE':
                self = self._round(precision+1, rounding)
            elif spec['type'] in 'fF%':
                self = self._rescale(-precision, rounding)
            elif spec['type'] in 'gG' and len(self._int) > precision:
                self = self._round(precision, rounding)
        # special case: zeros with a positive exponent can't be
        # represented in fixed point; rescale them to 0e0.
        if not self and self._exp > 0 and spec['type'] in 'fF%':
            self = self._rescale(0, rounding)

        # figure out placement of the decimal point
        leftdigits = self._exp + len(self._int)
        if spec['type'] in 'eE':
            if not self and precision is not None:
                dotplace = 1 - precision
            else:
                dotplace = 1
        elif spec['type'] in 'fF%':
            dotplace = leftdigits
        elif spec['type'] in 'gG':
            if self._exp <= 0 and leftdigits > -6:
                dotplace = leftdigits
            else:
                dotplace = 1

        # find digits before and after decimal point, and get exponent
        if dotplace < 0:
            intpart = '0'
            fracpart = '0'*(-dotplace) + self._int
        elif dotplace > len(self._int):
            intpart = self._int + '0'*(dotplace-len(self._int))
            fracpart = ''
        else:
            intpart = self._int[:dotplace] or '0'
            fracpart = self._int[dotplace:]
        exp = leftdigits-dotplace

        # done with the decimal-specific stuff;  hand over the rest
        # of the formatting to the _format_number function
        return _format_number(self._sign, intpart, fracpart, exp, spec)

def _dec_from_triple(sign, coefficient, exponent, special=False):
    """Create a decimal instance directly, without any validation,
    normalization (e.g. removal of leading zeros) or argument
    conversion.

    This function is for *internal use only*.
    """

    self = object.__new__(Decimal)
    self._sign = sign
    self._int = coefficient
    self._exp = exponent
    self._is_special = special

    return self

# Register Decimal as a kind of Number (an abstract base class).
# However, do not register it as Real (because Decimals are not
# interoperable with floats).
_numbers.Number.register(Decimal)


##### Context class #######################################################

class _ContextManager(object):
    """Context manager class to support localcontext().

      Sets a copy of the supplied context in __enter__() and restores
      the previous decimal context in __exit__()
    """
    def __init__(self, new_context):
        self.new_context = new_context.copy()
    def __enter__(self):
        self.saved_context = getcontext()
        setcontext(self.new_context)
        return self.new_context
    def __exit__(self, t, v, tb):
        setcontext(self.saved_context)

class Context(object):
    """Contains the context for a Decimal instance.

    Contains:
    prec - precision (for use in rounding, division, square roots..)
    rounding - rounding type (how you round)
    traps - If traps[exception] = 1, then the exception is
                    raised when it is caused.  Otherwise, a value is
                    substituted in.
    flags  - When an exception is caused, flags[exception] is set.
             (Whether or not the trap_enabler is set)
             Should be reset by user of Decimal instance.
    Emin -   Minimum exponent
    Emax -   Maximum exponent
    capitals -      If 1, 1*10^1 is printed as 1E+1.
                    If 0, printed as 1e1
    clamp -  If 1, change exponents if too high (Default 0)
    """

    def __init__(self, prec=None, rounding=None, Emin=None, Emax=None,
                       capitals=None, clamp=None, flags=None, traps=None,
                       _ignored_flags=None):
        # Set defaults; for everything except flags and _ignored_flags,
        # inherit from DefaultContext.
        try:
            dc = DefaultContext
        except NameError:
            pass

        self.prec = prec if prec is not None else dc.prec
        self.rounding = rounding if rounding is not None else dc.rounding
        self.Emin = Emin if Emin is not None else dc.Emin
        self.Emax = Emax if Emax is not None else dc.Emax
        self.capitals = capitals if capitals is not None else dc.capitals
        self.clamp = clamp if clamp is not None else dc.clamp

        if _ignored_flags is None:
            self._ignored_flags = []
        else:
            self._ignored_flags = _ignored_flags

        if traps is None:
            self.traps = dc.traps.copy()
        elif not isinstance(traps, dict):
            self.traps = dict((s, int(s in traps)) for s in _signals + traps)
        else:
            self.traps = traps

        if flags is None:
            self.flags = dict.fromkeys(_signals, 0)
        elif not isinstance(flags, dict):
            self.flags = dict((s, int(s in flags)) for s in _signals + flags)
        else:
            self.flags = flags

    def _set_integer_check(self, name, value, vmin, vmax):
        if not isinstance(value, int):
            raise TypeError("%s must be an integer" % name)
        if vmin == '-inf':
            if value > vmax:
                raise ValueError("%s must be in [%s, %d]. got: %s" % (name, vmin, vmax, value))
        elif vmax == 'inf':
            if value < vmin:
                raise ValueError("%s must be in [%d, %s]. got: %s" % (name, vmin, vmax, value))
        else:
            if value < vmin or value > vmax:
                raise ValueError("%s must be in [%d, %d]. got %s" % (name, vmin, vmax, value))
        return object.__setattr__(self, name, value)

    def _set_signal_dict(self, name, d):
        if not isinstance(d, dict):
            raise TypeError("%s must be a signal dict" % d)
        for key in d:
            if not key in _signals:
                raise KeyError("%s is not a valid signal dict" % d)
        for key in _signals:
            if not key in d:
                raise KeyError("%s is not a valid signal dict" % d)
        return object.__setattr__(self, name, d)

    def __setattr__(self, name, value):
        if name == 'prec':
            return self._set_integer_check(name, value, 1, 'inf')
        elif name == 'Emin':
            return self._set_integer_check(name, value, '-inf', 0)
        elif name == 'Emax':
            return self._set_integer_check(name, value, 0, 'inf')
        elif name == 'capitals':
            return self._set_integer_check(name, value, 0, 1)
        elif name == 'clamp':
            return self._set_integer_check(name, value, 0, 1)
        elif name == 'rounding':
            if not value in _rounding_modes:
                # raise TypeError even for strings to have consistency
                # among various implementations.
                raise TypeError("%s: invalid rounding mode" % value)
            return object.__setattr__(self, name, value)
        elif name == 'flags' or name == 'traps':
            return self._set_signal_dict(name, value)
        elif name == '_ignored_flags':
            return object.__setattr__(self, name, value)
        else:
            raise AttributeError(
                "'decimal.Context' object has no attribute '%s'" % name)

    def __delattr__(self, name):
        raise AttributeError("%s cannot be deleted" % name)

    # Support for pickling, copy, and deepcopy
    def __reduce__(self):
        flags = [sig for sig, v in self.flags.items() if v]
        traps = [sig for sig, v in self.traps.items() if v]
        return (self.__class__,
                (self.prec, self.rounding, self.Emin, self.Emax,
                 self.capitals, self.clamp, flags, traps))

    def __repr__(self):
        """Show the current context."""
        s = []
        s.append('Context(prec=%(prec)d, rounding=%(rounding)s, '
                 'Emin=%(Emin)d, Emax=%(Emax)d, capitals=%(capitals)d, '
                 'clamp=%(clamp)d'
                 % vars(self))
        names = [f.__name__ for f, v in self.flags.items() if v]
        s.append('flags=[' + ', '.join(names) + ']')
        names = [t.__name__ for t, v in self.traps.items() if v]
        s.append('traps=[' + ', '.join(names) + ']')
        return ', '.join(s) + ')'

    def clear_flags(self):
        """Reset all flags to zero"""
        for flag in self.flags:
            self.flags[flag] = 0

    def clear_traps(self):
        """Reset all traps to zero"""
        for flag in self.traps:
            self.traps[flag] = 0

    def _shallow_copy(self):
        """Returns a shallow copy from self."""
        nc = Context(self.prec, self.rounding, self.Emin, self.Emax,
                     self.capitals, self.clamp, self.flags, self.traps,
                     self._ignored_flags)
        return nc

    def copy(self):
        """Returns a deep copy from self."""
        nc = Context(self.prec, self.rounding, self.Emin, self.Emax,
                     self.capitals, self.clamp,
                     self.flags.copy(), self.traps.copy(),
                     self._ignored_flags)
        return nc
    __copy__ = copy

    def _raise_error(self, condition, explanation = None, *args):
        """Handles an error

        If the flag is in _ignored_flags, returns the default response.
        Otherwise, it sets the flag, then, if the corresponding
        trap_enabler is set, it reraises the exception.  Otherwise, it returns
        the default value after setting the flag.
        """
        error = _condition_map.get(condition, condition)
        if error in self._ignored_flags:
            # Don't touch the flag
            return error().handle(self, *args)

        self.flags[error] = 1
        if not self.traps[error]:
            # The errors define how to handle themselves.
            return condition().handle(self, *args)

        # Errors should only be risked on copies of the context
        # self._ignored_flags = []
        raise error(explanation)

    def _ignore_all_flags(self):
        """Ignore all flags, if they are raised"""
        return self._ignore_flags(*_signals)

    def _ignore_flags(self, *flags):
        """Ignore the flags, if they are raised"""
        # Do not mutate-- This way, copies of a context leave the original
        # alone.
        self._ignored_flags = (self._ignored_flags + list(flags))
        return list(flags)

    def _regard_flags(self, *flags):
        """Stop ignoring the flags, if they are raised"""
        if flags and isinstance(flags[0], (tuple,list)):
            flags = flags[0]
        for flag in flags:
            self._ignored_flags.remove(flag)

    # We inherit object.__hash__, so we must deny this explicitly
    __hash__ = None

    def Etiny(self):
        """Returns Etiny (= Emin - prec + 1)"""
        return int(self.Emin - self.prec + 1)

    def Etop(self):
        """Returns maximum exponent (= Emax - prec + 1)"""
        return int(self.Emax - self.prec + 1)

    def _set_rounding(self, type):
        """Sets the rounding type.

        Sets the rounding type, and returns the current (previous)
        rounding type.  Often used like:

        context = context.copy()
        # so you don't change the calling context
        # if an error occurs in the middle.
        rounding = context._set_rounding(ROUND_UP)
        val = self.__sub__(other, context=context)
        context._set_rounding(rounding)

        This will make it round up for that operation.
        """
        rounding = self.rounding
        self.rounding = type
        return rounding

    def create_decimal(self, num='0'):
        """Creates a new Decimal instance but using self as context.

        This method implements the to-number operation of the
        IBM Decimal specification."""

        if isinstance(num, str) and (num != num.strip() or '_' in num):
            return self._raise_error(ConversionSyntax,
                                     "trailing or leading whitespace and "
                                     "underscores are not permitted.")

        d = Decimal(num, context=self)
        if d._isnan() and len(d._int) > self.prec - self.clamp:
            return self._raise_error(ConversionSyntax,
                                     "diagnostic info too long in NaN")
        return d._fix(self)

    def create_decimal_from_float(self, f):
        """Creates a new Decimal instance from a float but rounding using self
        as the context.

        >>> context = Context(prec=5, rounding=ROUND_DOWN)
        >>> context.create_decimal_from_float(3.1415926535897932)
        Decimal('3.1415')
        >>> context = Context(prec=5, traps=[Inexact])
        >>> context.create_decimal_from_float(3.1415926535897932)
        Traceback (most recent call last):
            ...
        decimal.Inexact: None

        """
        d = Decimal.from_float(f)       # An exact conversion
        return d._fix(self)             # Apply the context rounding

    # Methods
    def abs(self, a):
        """Returns the absolute value of the operand.

        If the operand is negative, the result is the same as using the minus
        operation on the operand.  Otherwise, the result is the same as using
        the plus operation on the operand.

        >>> ExtendedContext.abs(Decimal('2.1'))
        Decimal('2.1')
        >>> ExtendedContext.abs(Decimal('-100'))
        Decimal('100')
        >>> ExtendedContext.abs(Decimal('101.5'))
        Decimal('101.5')
        >>> ExtendedContext.abs(Decimal('-101.5'))
        Decimal('101.5')
        >>> ExtendedContext.abs(-1)
        Decimal('1')
        """
        a = _convert_other(a, raiseit=True)
        return a.__abs__(context=self)

    def add(self, a, b):
        """Return the sum of the two operands.

        >>> ExtendedContext.add(Decimal('12'), Decimal('7.00'))
        Decimal('19.00')
        >>> ExtendedContext.add(Decimal('1E+2'), Decimal('1.01E+4'))
        Decimal('1.02E+4')
        >>> ExtendedContext.add(1, Decimal(2))
        Decimal('3')
        >>> ExtendedContext.add(Decimal(8), 5)
        Decimal('13')
        >>> ExtendedContext.add(5, 5)
        Decimal('10')
        """
        a = _convert_other(a, raiseit=True)
        r = a.__add__(b, context=self)
        if r is NotImplemented:
            raise TypeError("Unable to convert %s to Decimal" % b)
        else:
            return r

    def _apply(self, a):
        return str(a._fix(self))

    def canonical(self, a):
        """Returns the same Decimal object.

        As we do not have different encodings for the same number, the
        received object already is in its canonical form.

        >>> ExtendedContext.canonical(Decimal('2.50'))
        Decimal('2.50')
        """
        if not isinstance(a, Decimal):
            raise TypeError("canonical requires a Decimal as an argument.")
        return a.canonical()

    def compare(self, a, b):
        """Compares values numerically.

        If the signs of the operands differ, a value representing each operand
        ('-1' if the operand is less than zero, '0' if the operand is zero or
        negative zero, or '1' if the operand is greater than zero) is used in
        place of that operand for the comparison instead of the actual
        operand.

        The comparison is then effected by subtracting the second operand from
        the first and then returning a value according to the result of the
        subtraction: '-1' if the result is less than zero, '0' if the result is
        zero or negative zero, or '1' if the result is greater than zero.

        >>> ExtendedContext.compare(Decimal('2.1'), Decimal('3'))
        Decimal('-1')
        >>> ExtendedContext.compare(Decimal('2.1'), Decimal('2.1'))
        Decimal('0')
        >>> ExtendedContext.compare(Decimal('2.1'), Decimal('2.10'))
        Decimal('0')
        >>> ExtendedContext.compare(Decimal('3'), Decimal('2.1'))
        Decimal('1')
        >>> ExtendedContext.compare(Decimal('2.1'), Decimal('-3'))
        Decimal('1')
        >>> ExtendedContext.compare(Decimal('-3'), Decimal('2.1'))
        Decimal('-1')
        >>> ExtendedContext.compare(1, 2)
        Decimal('-1')
        >>> ExtendedContext.compare(Decimal(1), 2)
        Decimal('-1')
        >>> ExtendedContext.compare(1, Decimal(2))
        Decimal('-1')
        """
        a = _convert_other(a, raiseit=True)
        return a.compare(b, context=self)

    def compare_signal(self, a, b):
        """Compares the values of the two operands numerically.

        It's pretty much like compare(), but all NaNs signal, with signaling
        NaNs taking precedence over quiet NaNs.

        >>> c = ExtendedContext
        >>> c.compare_signal(Decimal('2.1'), Decimal('3'))
        Decimal('-1')
        >>> c.compare_signal(Decimal('2.1'), Decimal('2.1'))
        Decimal('0')
        >>> c.flags[InvalidOperation] = 0
        >>> print(c.flags[InvalidOperation])
        0
        >>> c.compare_signal(Decimal('NaN'), Decimal('2.1'))
        Decimal('NaN')
        >>> print(c.flags[InvalidOperation])
        1
        >>> c.flags[InvalidOperation] = 0
        >>> print(c.flags[InvalidOperation])
        0
        >>> c.compare_signal(Decimal('sNaN'), Decimal('2.1'))
        Decimal('NaN')
        >>> print(c.flags[InvalidOperation])
        1
        >>> c.compare_signal(-1, 2)
        Decimal('-1')
        >>> c.compare_signal(Decimal(-1), 2)
        Decimal('-1')
        >>> c.compare_signal(-1, Decimal(2))
        Decimal('-1')
        """
        a = _convert_other(a, raiseit=True)
        return a.compare_signal(b, context=self)

    def compare_total(self, a, b):
        """Compares two operands using their abstract representation.

        This is not like the standard compare, which use their numerical
        value. Note that a total ordering is defined for all possible abstract
        representations.

        >>> ExtendedContext.compare_total(Decimal('12.73'), Decimal('127.9'))
        Decimal('-1')
        >>> ExtendedContext.compare_total(Decimal('-127'),  Decimal('12'))
        Decimal('-1')
        >>> ExtendedContext.compare_total(Decimal('12.30'), Decimal('12.3'))
        Decimal('-1')
        >>> ExtendedContext.compare_total(Decimal('12.30'), Decimal('12.30'))
        Decimal('0')
        >>> ExtendedContext.compare_total(Decimal('12.3'),  Decimal('12.300'))
        Decimal('1')
        >>> ExtendedContext.compare_total(Decimal('12.3'),  Decimal('NaN'))
        Decimal('-1')
        >>> ExtendedContext.compare_total(1, 2)
        Decimal('-1')
        >>> ExtendedContext.compare_total(Decimal(1), 2)
        Decimal('-1')
        >>> ExtendedContext.compare_total(1, Decimal(2))
        Decimal('-1')
        """
        a = _convert_other(a, raiseit=True)
        return a.compare_total(b)

    def compare_total_mag(self, a, b):
        """Compares two operands using their abstract representation ignoring sign.

        Like compare_total, but with operand's sign ignored and assumed to be 0.
        """
        a = _convert_other(a, raiseit=True)
        return a.compare_total_mag(b)

    def copy_abs(self, a):
        """Returns a copy of the operand with the sign set to 0.

        >>> ExtendedContext.copy_abs(Decimal('2.1'))
        Decimal('2.1')
        >>> ExtendedContext.copy_abs(Decimal('-100'))
        Decimal('100')
        >>> ExtendedContext.copy_abs(-1)
        Decimal('1')
        """
        a = _convert_other(a, raiseit=True)
        return a.copy_abs()

    def copy_decimal(self, a):
        """Returns a copy of the decimal object.

        >>> ExtendedContext.copy_decimal(Decimal('2.1'))
        Decimal('2.1')
        >>> ExtendedContext.copy_decimal(Decimal('-1.00'))
        Decimal('-1.00')
        >>> ExtendedContext.copy_decimal(1)
        Decimal('1')
        """
        a = _convert_other(a, raiseit=True)
        return Decimal(a)

    def copy_negate(self, a):
        """Returns a copy of the operand with the sign inverted.

        >>> ExtendedContext.copy_negate(Decimal('101.5'))
        Decimal('-101.5')
        >>> ExtendedContext.copy_negate(Decimal('-101.5'))
        Decimal('101.5')
        >>> ExtendedContext.copy_negate(1)
        Decimal('-1')
        """
        a = _convert_other(a, raiseit=True)
        return a.copy_negate()

    def copy_sign(self, a, b):
        """Copies the second operand's sign to the first one.

        In detail, it returns a copy of the first operand with the sign
        equal to the sign of the second operand.

        >>> ExtendedContext.copy_sign(Decimal( '1.50'), Decimal('7.33'))
        Decimal('1.50')
        >>> ExtendedContext.copy_sign(Decimal('-1.50'), Decimal('7.33'))
        Decimal('1.50')
        >>> ExtendedContext.copy_sign(Decimal( '1.50'), Decimal('-7.33'))
        Decimal('-1.50')
        >>> ExtendedContext.copy_sign(Decimal('-1.50'), Decimal('-7.33'))
        Decimal('-1.50')
        >>> ExtendedContext.copy_sign(1, -2)
        Decimal('-1')
        >>> ExtendedContext.copy_sign(Decimal(1), -2)
        Decimal('-1')
        >>> ExtendedContext.copy_sign(1, Decimal(-2))
        Decimal('-1')
        """
        a = _convert_other(a, raiseit=True)
        return a.copy_sign(b)

    def divide(self, a, b):
        """Decimal division in a specified context.

        >>> ExtendedContext.divide(Decimal('1'), Decimal('3'))
        Decimal('0.333333333')
        >>> ExtendedContext.divide(Decimal('2'), Decimal('3'))
        Decimal('0.666666667')
        >>> ExtendedContext.divide(Decimal('5'), Decimal('2'))
        Decimal('2.5')
        >>> ExtendedContext.divide(Decimal('1'), Decimal('10'))
        Decimal('0.1')
        >>> ExtendedContext.divide(Decimal('12'), Decimal('12'))
        Decimal('1')
        >>> ExtendedContext.divide(Decimal('8.00'), Decimal('2'))
        Decimal('4.00')
        >>> ExtendedContext.divide(Decimal('2.400'), Decimal('2.0'))
        Decimal('1.20')
        >>> ExtendedContext.divide(Decimal('1000'), Decimal('100'))
        Decimal('10')
        >>> ExtendedContext.divide(Decimal('1000'), Decimal('1'))
        Decimal('1000')
        >>> ExtendedContext.divide(Decimal('2.40E+6'), Decimal('2'))
        Decimal('1.20E+6')
        >>> ExtendedContext.divide(5, 5)
        Decimal('1')
        >>> ExtendedContext.divide(Decimal(5), 5)
        Decimal('1')
        >>> ExtendedContext.divide(5, Decimal(5))
        Decimal('1')
        """
        a = _convert_other(a, raiseit=True)
        r = a.__truediv__(b, context=self)
        if r is NotImplemented:
            raise TypeError("Unable to convert %s to Decimal" % b)
        else:
            return r

    def divide_int(self, a, b):
        """Divides two numbers and returns the integer part of the result.

        >>> ExtendedContext.divide_int(Decimal('2'), Decimal('3'))
        Decimal('0')
        >>> ExtendedContext.divide_int(Decimal('10'), Decimal('3'))
        Decimal('3')
        >>> ExtendedContext.divide_int(Decimal('1'), Decimal('0.3'))
        Decimal('3')
        >>> ExtendedContext.divide_int(10, 3)
        Decimal('3')
        >>> ExtendedContext.divide_int(Decimal(10), 3)
        Decimal('3')
        >>> ExtendedContext.divide_int(10, Decimal(3))
        Decimal('3')
        """
        a = _convert_other(a, raiseit=True)
        r = a.__floordiv__(b, context=self)
        if r is NotImplemented:
            raise TypeError("Unable to convert %s to Decimal" % b)
        else:
            return r

    def divmod(self, a, b):
        """Return (a // b, a % b).

        >>> ExtendedContext.divmod(Decimal(8), Decimal(3))
        (Decimal('2'), Decimal('2'))
        >>> ExtendedContext.divmod(Decimal(8), Decimal(4))
        (Decimal('2'), Decimal('0'))
        >>> ExtendedContext.divmod(8, 4)
        (Decimal('2'), Decimal('0'))
        >>> ExtendedContext.divmod(Decimal(8), 4)
        (Decimal('2'), Decimal('0'))
        >>> ExtendedContext.divmod(8, Decimal(4))
        (Decimal('2'), Decimal('0'))
        """
        a = _convert_other(a, raiseit=True)
        r = a.__divmod__(b, context=self)
        if r is NotImplemented:
            raise TypeError("Unable to convert %s to Decimal" % b)
        else:
            return r

    def exp(self, a):
        """Returns e ** a.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.exp(Decimal('-Infinity'))
        Decimal('0')
        >>> c.exp(Decimal('-1'))
        Decimal('0.367879441')
        >>> c.exp(Decimal('0'))
        Decimal('1')
        >>> c.exp(Decimal('1'))
        Decimal('2.71828183')
        >>> c.exp(Decimal('0.693147181'))
        Decimal('2.00000000')
        >>> c.exp(Decimal('+Infinity'))
        Decimal('Infinity')
        >>> c.exp(10)
        Decimal('22026.4658')
        """
        a =_convert_other(a, raiseit=True)
        return a.exp(context=self)

    def fma(self, a, b, c):
        """Returns a multiplied by b, plus c.

        The first two operands are multiplied together, using multiply,
        the third operand is then added to the result of that
        multiplication, using add, all with only one final rounding.

        >>> ExtendedContext.fma(Decimal('3'), Decimal('5'), Decimal('7'))
        Decimal('22')
        >>> ExtendedContext.fma(Decimal('3'), Decimal('-5'), Decimal('7'))
        Decimal('-8')
        >>> ExtendedContext.fma(Decimal('888565290'), Decimal('1557.96930'), Decimal('-86087.7578'))
        Decimal('1.38435736E+12')
        >>> ExtendedContext.fma(1, 3, 4)
        Decimal('7')
        >>> ExtendedContext.fma(1, Decimal(3), 4)
        Decimal('7')
        >>> ExtendedContext.fma(1, 3, Decimal(4))
        Decimal('7')
        """
        a = _convert_other(a, raiseit=True)
        return a.fma(b, c, context=self)

    def is_canonical(self, a):
        """Return True if the operand is canonical; otherwise return False.

        Currently, the encoding of a Decimal instance is always
        canonical, so this method returns True for any Decimal.

        >>> ExtendedContext.is_canonical(Decimal('2.50'))
        True
        """
        if not isinstance(a, Decimal):
            raise TypeError("is_canonical requires a Decimal as an argument.")
        return a.is_canonical()

    def is_finite(self, a):
        """Return True if the operand is finite; otherwise return False.

        A Decimal instance is considered finite if it is neither
        infinite nor a NaN.

        >>> ExtendedContext.is_finite(Decimal('2.50'))
        True
        >>> ExtendedContext.is_finite(Decimal('-0.3'))
        True
        >>> ExtendedContext.is_finite(Decimal('0'))
        True
        >>> ExtendedContext.is_finite(Decimal('Inf'))
        False
        >>> ExtendedContext.is_finite(Decimal('NaN'))
        False
        >>> ExtendedContext.is_finite(1)
        True
        """
        a = _convert_other(a, raiseit=True)
        return a.is_finite()

    def is_infinite(self, a):
        """Return True if the operand is infinite; otherwise return False.

        >>> ExtendedContext.is_infinite(Decimal('2.50'))
        False
        >>> ExtendedContext.is_infinite(Decimal('-Inf'))
        True
        >>> ExtendedContext.is_infinite(Decimal('NaN'))
        False
        >>> ExtendedContext.is_infinite(1)
        False
        """
        a = _convert_other(a, raiseit=True)
        return a.is_infinite()

    def is_nan(self, a):
        """Return True if the operand is a qNaN or sNaN;
        otherwise return False.

        >>> ExtendedContext.is_nan(Decimal('2.50'))
        False
        >>> ExtendedContext.is_nan(Decimal('NaN'))
        True
        >>> ExtendedContext.is_nan(Decimal('-sNaN'))
        True
        >>> ExtendedContext.is_nan(1)
        False
        """
        a = _convert_other(a, raiseit=True)
        return a.is_nan()

    def is_normal(self, a):
        """Return True if the operand is a normal number;
        otherwise return False.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.is_normal(Decimal('2.50'))
        True
        >>> c.is_normal(Decimal('0.1E-999'))
        False
        >>> c.is_normal(Decimal('0.00'))
        False
        >>> c.is_normal(Decimal('-Inf'))
        False
        >>> c.is_normal(Decimal('NaN'))
        False
        >>> c.is_normal(1)
        True
        """
        a = _convert_other(a, raiseit=True)
        return a.is_normal(context=self)

    def is_qnan(self, a):
        """Return True if the operand is a quiet NaN; otherwise return False.

        >>> ExtendedContext.is_qnan(Decimal('2.50'))
        False
        >>> ExtendedContext.is_qnan(Decimal('NaN'))
        True
        >>> ExtendedContext.is_qnan(Decimal('sNaN'))
        False
        >>> ExtendedContext.is_qnan(1)
        False
        """
        a = _convert_other(a, raiseit=True)
        return a.is_qnan()

    def is_signed(self, a):
        """Return True if the operand is negative; otherwise return False.

        >>> ExtendedContext.is_signed(Decimal('2.50'))
        False
        >>> ExtendedContext.is_signed(Decimal('-12'))
        True
        >>> ExtendedContext.is_signed(Decimal('-0'))
        True
        >>> ExtendedContext.is_signed(8)
        False
        >>> ExtendedContext.is_signed(-8)
        True
        """
        a = _convert_other(a, raiseit=True)
        return a.is_signed()

    def is_snan(self, a):
        """Return True if the operand is a signaling NaN;
        otherwise return False.

        >>> ExtendedContext.is_snan(Decimal('2.50'))
        False
        >>> ExtendedContext.is_snan(Decimal('NaN'))
        False
        >>> ExtendedContext.is_snan(Decimal('sNaN'))
        True
        >>> ExtendedContext.is_snan(1)
        False
        """
        a = _convert_other(a, raiseit=True)
        return a.is_snan()

    def is_subnormal(self, a):
        """Return True if the operand is subnormal; otherwise return False.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.is_subnormal(Decimal('2.50'))
        False
        >>> c.is_subnormal(Decimal('0.1E-999'))
        True
        >>> c.is_subnormal(Decimal('0.00'))
        False
        >>> c.is_subnormal(Decimal('-Inf'))
        False
        >>> c.is_subnormal(Decimal('NaN'))
        False
        >>> c.is_subnormal(1)
        False
        """
        a = _convert_other(a, raiseit=True)
        return a.is_subnormal(context=self)

    def is_zero(self, a):
        """Return True if the operand is a zero; otherwise return False.

        >>> ExtendedContext.is_zero(Decimal('0'))
        True
        >>> ExtendedContext.is_zero(Decimal('2.50'))
        False
        >>> ExtendedContext.is_zero(Decimal('-0E+2'))
        True
        >>> ExtendedContext.is_zero(1)
        False
        >>> ExtendedContext.is_zero(0)
        True
        """
        a = _convert_other(a, raiseit=True)
        return a.is_zero()

    def ln(self, a):
        """Returns the natural (base e) logarithm of the operand.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.ln(Decimal('0'))
        Decimal('-Infinity')
        >>> c.ln(Decimal('1.000'))
        Decimal('0')
        >>> c.ln(Decimal('2.71828183'))
        Decimal('1.00000000')
        >>> c.ln(Decimal('10'))
        Decimal('2.30258509')
        >>> c.ln(Decimal('+Infinity'))
        Decimal('Infinity')
        >>> c.ln(1)
        Decimal('0')
        """
        a = _convert_other(a, raiseit=True)
        return a.ln(context=self)

    def log10(self, a):
        """Returns the base 10 logarithm of the operand.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.log10(Decimal('0'))
        Decimal('-Infinity')
        >>> c.log10(Decimal('0.001'))
        Decimal('-3')
        >>> c.log10(Decimal('1.000'))
        Decimal('0')
        >>> c.log10(Decimal('2'))
        Decimal('0.301029996')
        >>> c.log10(Decimal('10'))
        Decimal('1')
        >>> c.log10(Decimal('70'))
        Decimal('1.84509804')
        >>> c.log10(Decimal('+Infinity'))
        Decimal('Infinity')
        >>> c.log10(0)
        Decimal('-Infinity')
        >>> c.log10(1)
        Decimal('0')
        """
        a = _convert_other(a, raiseit=True)
        return a.log10(context=self)

    def logb(self, a):
        """ Returns the exponent of the magnitude of the operand's MSD.

        The result is the integer which is the exponent of the magnitude
        of the most significant digit of the operand (as though the
        operand were truncated to a single digit while maintaining the
        value of that digit and without limiting the resulting exponent).

        >>> ExtendedContext.logb(Decimal('250'))
        Decimal('2')
        >>> ExtendedContext.logb(Decimal('2.50'))
        Decimal('0')
        >>> ExtendedContext.logb(Decimal('0.03'))
        Decimal('-2')
        >>> ExtendedContext.logb(Decimal('0'))
        Decimal('-Infinity')
        >>> ExtendedContext.logb(1)
        Decimal('0')
        >>> ExtendedContext.logb(10)
        Decimal('1')
        >>> ExtendedContext.logb(100)
        Decimal('2')
        """
        a = _convert_other(a, raiseit=True)
        return a.logb(context=self)

    def logical_and(self, a, b):
        """Applies the logical operation 'and' between each operand's digits.

        The operands must be both logical numbers.

        >>> ExtendedContext.logical_and(Decimal('0'), Decimal('0'))
        Decimal('0')
        >>> ExtendedContext.logical_and(Decimal('0'), Decimal('1'))
        Decimal('0')
        >>> ExtendedContext.logical_and(Decimal('1'), Decimal('0'))
        Decimal('0')
        >>> ExtendedContext.logical_and(Decimal('1'), Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.logical_and(Decimal('1100'), Decimal('1010'))
        Decimal('1000')
        >>> ExtendedContext.logical_and(Decimal('1111'), Decimal('10'))
        Decimal('10')
        >>> ExtendedContext.logical_and(110, 1101)
        Decimal('100')
        >>> ExtendedContext.logical_and(Decimal(110), 1101)
        Decimal('100')
        >>> ExtendedContext.logical_and(110, Decimal(1101))
        Decimal('100')
        """
        a = _convert_other(a, raiseit=True)
        return a.logical_and(b, context=self)

    def logical_invert(self, a):
        """Invert all the digits in the operand.

        The operand must be a logical number.

        >>> ExtendedContext.logical_invert(Decimal('0'))
        Decimal('111111111')
        >>> ExtendedContext.logical_invert(Decimal('1'))
        Decimal('111111110')
        >>> ExtendedContext.logical_invert(Decimal('111111111'))
        Decimal('0')
        >>> ExtendedContext.logical_invert(Decimal('101010101'))
        Decimal('10101010')
        >>> ExtendedContext.logical_invert(1101)
        Decimal('111110010')
        """
        a = _convert_other(a, raiseit=True)
        return a.logical_invert(context=self)

    def logical_or(self, a, b):
        """Applies the logical operation 'or' between each operand's digits.

        The operands must be both logical numbers.

        >>> ExtendedContext.logical_or(Decimal('0'), Decimal('0'))
        Decimal('0')
        >>> ExtendedContext.logical_or(Decimal('0'), Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.logical_or(Decimal('1'), Decimal('0'))
        Decimal('1')
        >>> ExtendedContext.logical_or(Decimal('1'), Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.logical_or(Decimal('1100'), Decimal('1010'))
        Decimal('1110')
        >>> ExtendedContext.logical_or(Decimal('1110'), Decimal('10'))
        Decimal('1110')
        >>> ExtendedContext.logical_or(110, 1101)
        Decimal('1111')
        >>> ExtendedContext.logical_or(Decimal(110), 1101)
        Decimal('1111')
        >>> ExtendedContext.logical_or(110, Decimal(1101))
        Decimal('1111')
        """
        a = _convert_other(a, raiseit=True)
        return a.logical_or(b, context=self)

    def logical_xor(self, a, b):
        """Applies the logical operation 'xor' between each operand's digits.

        The operands must be both logical numbers.

        >>> ExtendedContext.logical_xor(Decimal('0'), Decimal('0'))
        Decimal('0')
        >>> ExtendedContext.logical_xor(Decimal('0'), Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.logical_xor(Decimal('1'), Decimal('0'))
        Decimal('1')
        >>> ExtendedContext.logical_xor(Decimal('1'), Decimal('1'))
        Decimal('0')
        >>> ExtendedContext.logical_xor(Decimal('1100'), Decimal('1010'))
        Decimal('110')
        >>> ExtendedContext.logical_xor(Decimal('1111'), Decimal('10'))
        Decimal('1101')
        >>> ExtendedContext.logical_xor(110, 1101)
        Decimal('1011')
        >>> ExtendedContext.logical_xor(Decimal(110), 1101)
        Decimal('1011')
        >>> ExtendedContext.logical_xor(110, Decimal(1101))
        Decimal('1011')
        """
        a = _convert_other(a, raiseit=True)
        return a.logical_xor(b, context=self)

    def max(self, a, b):
        """max compares two values numerically and returns the maximum.

        If either operand is a NaN then the general rules apply.
        Otherwise, the operands are compared as though by the compare
        operation.  If they are numerically equal then the left-hand operand
        is chosen as the result.  Otherwise the maximum (closer to positive
        infinity) of the two operands is chosen as the result.

        >>> ExtendedContext.max(Decimal('3'), Decimal('2'))
        Decimal('3')
        >>> ExtendedContext.max(Decimal('-10'), Decimal('3'))
        Decimal('3')
        >>> ExtendedContext.max(Decimal('1.0'), Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.max(Decimal('7'), Decimal('NaN'))
        Decimal('7')
        >>> ExtendedContext.max(1, 2)
        Decimal('2')
        >>> ExtendedContext.max(Decimal(1), 2)
        Decimal('2')
        >>> ExtendedContext.max(1, Decimal(2))
        Decimal('2')
        """
        a = _convert_other(a, raiseit=True)
        return a.max(b, context=self)

    def max_mag(self, a, b):
        """Compares the values numerically with their sign ignored.

        >>> ExtendedContext.max_mag(Decimal('7'), Decimal('NaN'))
        Decimal('7')
        >>> ExtendedContext.max_mag(Decimal('7'), Decimal('-10'))
        Decimal('-10')
        >>> ExtendedContext.max_mag(1, -2)
        Decimal('-2')
        >>> ExtendedContext.max_mag(Decimal(1), -2)
        Decimal('-2')
        >>> ExtendedContext.max_mag(1, Decimal(-2))
        Decimal('-2')
        """
        a = _convert_other(a, raiseit=True)
        return a.max_mag(b, context=self)

    def min(self, a, b):
        """min compares two values numerically and returns the minimum.

        If either operand is a NaN then the general rules apply.
        Otherwise, the operands are compared as though by the compare
        operation.  If they are numerically equal then the left-hand operand
        is chosen as the result.  Otherwise the minimum (closer to negative
        infinity) of the two operands is chosen as the result.

        >>> ExtendedContext.min(Decimal('3'), Decimal('2'))
        Decimal('2')
        >>> ExtendedContext.min(Decimal('-10'), Decimal('3'))
        Decimal('-10')
        >>> ExtendedContext.min(Decimal('1.0'), Decimal('1'))
        Decimal('1.0')
        >>> ExtendedContext.min(Decimal('7'), Decimal('NaN'))
        Decimal('7')
        >>> ExtendedContext.min(1, 2)
        Decimal('1')
        >>> ExtendedContext.min(Decimal(1), 2)
        Decimal('1')
        >>> ExtendedContext.min(1, Decimal(29))
        Decimal('1')
        """
        a = _convert_other(a, raiseit=True)
        return a.min(b, context=self)

    def min_mag(self, a, b):
        """Compares the values numerically with their sign ignored.

        >>> ExtendedContext.min_mag(Decimal('3'), Decimal('-2'))
        Decimal('-2')
        >>> ExtendedContext.min_mag(Decimal('-3'), Decimal('NaN'))
        Decimal('-3')
        >>> ExtendedContext.min_mag(1, -2)
        Decimal('1')
        >>> ExtendedContext.min_mag(Decimal(1), -2)
        Decimal('1')
        >>> ExtendedContext.min_mag(1, Decimal(-2))
        Decimal('1')
        """
        a = _convert_other(a, raiseit=True)
        return a.min_mag(b, context=self)

    def minus(self, a):
        """Minus corresponds to unary prefix minus in Python.

        The operation is evaluated using the same rules as subtract; the
        operation minus(a) is calculated as subtract('0', a) where the '0'
        has the same exponent as the operand.

        >>> ExtendedContext.minus(Decimal('1.3'))
        Decimal('-1.3')
        >>> ExtendedContext.minus(Decimal('-1.3'))
        Decimal('1.3')
        >>> ExtendedContext.minus(1)
        Decimal('-1')
        """
        a = _convert_other(a, raiseit=True)
        return a.__neg__(context=self)

    def multiply(self, a, b):
        """multiply multiplies two operands.

        If either operand is a special value then the general rules apply.
        Otherwise, the operands are multiplied together
        ('long multiplication'), resulting in a number which may be as long as
        the sum of the lengths of the two operands.

        >>> ExtendedContext.multiply(Decimal('1.20'), Decimal('3'))
        Decimal('3.60')
        >>> ExtendedContext.multiply(Decimal('7'), Decimal('3'))
        Decimal('21')
        >>> ExtendedContext.multiply(Decimal('0.9'), Decimal('0.8'))
        Decimal('0.72')
        >>> ExtendedContext.multiply(Decimal('0.9'), Decimal('-0'))
        Decimal('-0.0')
        >>> ExtendedContext.multiply(Decimal('654321'), Decimal('654321'))
        Decimal('4.28135971E+11')
        >>> ExtendedContext.multiply(7, 7)
        Decimal('49')
        >>> ExtendedContext.multiply(Decimal(7), 7)
        Decimal('49')
        >>> ExtendedContext.multiply(7, Decimal(7))
        Decimal('49')
        """
        a = _convert_other(a, raiseit=True)
        r = a.__mul__(b, context=self)
        if r is NotImplemented:
            raise TypeError("Unable to convert %s to Decimal" % b)
        else:
            return r

    def next_minus(self, a):
        """Returns the largest representable number smaller than a.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> ExtendedContext.next_minus(Decimal('1'))
        Decimal('0.999999999')
        >>> c.next_minus(Decimal('1E-1007'))
        Decimal('0E-1007')
        >>> ExtendedContext.next_minus(Decimal('-1.00000003'))
        Decimal('-1.00000004')
        >>> c.next_minus(Decimal('Infinity'))
        Decimal('9.99999999E+999')
        >>> c.next_minus(1)
        Decimal('0.999999999')
        """
        a = _convert_other(a, raiseit=True)
        return a.next_minus(context=self)

    def next_plus(self, a):
        """Returns the smallest representable number larger than a.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> ExtendedContext.next_plus(Decimal('1'))
        Decimal('1.00000001')
        >>> c.next_plus(Decimal('-1E-1007'))
        Decimal('-0E-1007')
        >>> ExtendedContext.next_plus(Decimal('-1.00000003'))
        Decimal('-1.00000002')
        >>> c.next_plus(Decimal('-Infinity'))
        Decimal('-9.99999999E+999')
        >>> c.next_plus(1)
        Decimal('1.00000001')
        """
        a = _convert_other(a, raiseit=True)
        return a.next_plus(context=self)

    def next_toward(self, a, b):
        """Returns the number closest to a, in direction towards b.

        The result is the closest representable number from the first
        operand (but not the first operand) that is in the direction
        towards the second operand, unless the operands have the same
        value.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.next_toward(Decimal('1'), Decimal('2'))
        Decimal('1.00000001')
        >>> c.next_toward(Decimal('-1E-1007'), Decimal('1'))
        Decimal('-0E-1007')
        >>> c.next_toward(Decimal('-1.00000003'), Decimal('0'))
        Decimal('-1.00000002')
        >>> c.next_toward(Decimal('1'), Decimal('0'))
        Decimal('0.999999999')
        >>> c.next_toward(Decimal('1E-1007'), Decimal('-100'))
        Decimal('0E-1007')
        >>> c.next_toward(Decimal('-1.00000003'), Decimal('-10'))
        Decimal('-1.00000004')
        >>> c.next_toward(Decimal('0.00'), Decimal('-0.0000'))
        Decimal('-0.00')
        >>> c.next_toward(0, 1)
        Decimal('1E-1007')
        >>> c.next_toward(Decimal(0), 1)
        Decimal('1E-1007')
        >>> c.next_toward(0, Decimal(1))
        Decimal('1E-1007')
        """
        a = _convert_other(a, raiseit=True)
        return a.next_toward(b, context=self)

    def normalize(self, a):
        """normalize reduces an operand to its simplest form.

        Essentially a plus operation with all trailing zeros removed from the
        result.

        >>> ExtendedContext.normalize(Decimal('2.1'))
        Decimal('2.1')
        >>> ExtendedContext.normalize(Decimal('-2.0'))
        Decimal('-2')
        >>> ExtendedContext.normalize(Decimal('1.200'))
        Decimal('1.2')
        >>> ExtendedContext.normalize(Decimal('-120'))
        Decimal('-1.2E+2')
        >>> ExtendedContext.normalize(Decimal('120.00'))
        Decimal('1.2E+2')
        >>> ExtendedContext.normalize(Decimal('0.00'))
        Decimal('0')
        >>> ExtendedContext.normalize(6)
        Decimal('6')
        """
        a = _convert_other(a, raiseit=True)
        return a.normalize(context=self)

    def number_class(self, a):
        """Returns an indication of the class of the operand.

        The class is one of the following strings:
          -sNaN
          -NaN
          -Infinity
          -Normal
          -Subnormal
          -Zero
          +Zero
          +Subnormal
          +Normal
          +Infinity

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.number_class(Decimal('Infinity'))
        '+Infinity'
        >>> c.number_class(Decimal('1E-10'))
        '+Normal'
        >>> c.number_class(Decimal('2.50'))
        '+Normal'
        >>> c.number_class(Decimal('0.1E-999'))
        '+Subnormal'
        >>> c.number_class(Decimal('0'))
        '+Zero'
        >>> c.number_class(Decimal('-0'))
        '-Zero'
        >>> c.number_class(Decimal('-0.1E-999'))
        '-Subnormal'
        >>> c.number_class(Decimal('-1E-10'))
        '-Normal'
        >>> c.number_class(Decimal('-2.50'))
        '-Normal'
        >>> c.number_class(Decimal('-Infinity'))
        '-Infinity'
        >>> c.number_class(Decimal('NaN'))
        'NaN'
        >>> c.number_class(Decimal('-NaN'))
        'NaN'
        >>> c.number_class(Decimal('sNaN'))
        'sNaN'
        >>> c.number_class(123)
        '+Normal'
        """
        a = _convert_other(a, raiseit=True)
        return a.number_class(context=self)

    def plus(self, a):
        """Plus corresponds to unary prefix plus in Python.

        The operation is evaluated using the same rules as add; the
        operation plus(a) is calculated as add('0', a) where the '0'
        has the same exponent as the operand.

        >>> ExtendedContext.plus(Decimal('1.3'))
        Decimal('1.3')
        >>> ExtendedContext.plus(Decimal('-1.3'))
        Decimal('-1.3')
        >>> ExtendedContext.plus(-1)
        Decimal('-1')
        """
        a = _convert_other(a, raiseit=True)
        return a.__pos__(context=self)

    def power(self, a, b, modulo=None):
        """Raises a to the power of b, to modulo if given.

        With two arguments, compute a**b.  If a is negative then b
        must be integral.  The result will be inexact unless b is
        integral and the result is finite and can be expressed exactly
        in 'precision' digits.

        With three arguments, compute (a**b) % modulo.  For the
        three argument form, the following restrictions on the
        arguments hold:

         - all three arguments must be integral
         - b must be nonnegative
         - at least one of a or b must be nonzero
         - modulo must be nonzero and have at most 'precision' digits

        The result of pow(a, b, modulo) is identical to the result
        that would be obtained by computing (a**b) % modulo with
        unbounded precision, but is computed more efficiently.  It is
        always exact.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.power(Decimal('2'), Decimal('3'))
        Decimal('8')
        >>> c.power(Decimal('-2'), Decimal('3'))
        Decimal('-8')
        >>> c.power(Decimal('2'), Decimal('-3'))
        Decimal('0.125')
        >>> c.power(Decimal('1.7'), Decimal('8'))
        Decimal('69.7575744')
        >>> c.power(Decimal('10'), Decimal('0.301029996'))
        Decimal('2.00000000')
        >>> c.power(Decimal('Infinity'), Decimal('-1'))
        Decimal('0')
        >>> c.power(Decimal('Infinity'), Decimal('0'))
        Decimal('1')
        >>> c.power(Decimal('Infinity'), Decimal('1'))
        Decimal('Infinity')
        >>> c.power(Decimal('-Infinity'), Decimal('-1'))
        Decimal('-0')
        >>> c.power(Decimal('-Infinity'), Decimal('0'))
        Decimal('1')
        >>> c.power(Decimal('-Infinity'), Decimal('1'))
        Decimal('-Infinity')
        >>> c.power(Decimal('-Infinity'), Decimal('2'))
        Decimal('Infinity')
        >>> c.power(Decimal('0'), Decimal('0'))
        Decimal('NaN')

        >>> c.power(Decimal('3'), Decimal('7'), Decimal('16'))
        Decimal('11')
        >>> c.power(Decimal('-3'), Decimal('7'), Decimal('16'))
        Decimal('-11')
        >>> c.power(Decimal('-3'), Decimal('8'), Decimal('16'))
        Decimal('1')
        >>> c.power(Decimal('3'), Decimal('7'), Decimal('-16'))
        Decimal('11')
        >>> c.power(Decimal('23E12345'), Decimal('67E189'), Decimal('123456789'))
        Decimal('11729830')
        >>> c.power(Decimal('-0'), Decimal('17'), Decimal('1729'))
        Decimal('-0')
        >>> c.power(Decimal('-23'), Decimal('0'), Decimal('65537'))
        Decimal('1')
        >>> ExtendedContext.power(7, 7)
        Decimal('823543')
        >>> ExtendedContext.power(Decimal(7), 7)
        Decimal('823543')
        >>> ExtendedContext.power(7, Decimal(7), 2)
        Decimal('1')
        """
        a = _convert_other(a, raiseit=True)
        r = a.__pow__(b, modulo, context=self)
        if r is NotImplemented:
            raise TypeError("Unable to convert %s to Decimal" % b)
        else:
            return r

    def quantize(self, a, b):
        """Returns a value equal to 'a' (rounded), having the exponent of 'b'.

        The coefficient of the result is derived from that of the left-hand
        operand.  It may be rounded using the current rounding setting (if the
        exponent is being increased), multiplied by a positive power of ten (if
        the exponent is being decreased), or is unchanged (if the exponent is
        already equal to that of the right-hand operand).

        Unlike other operations, if the length of the coefficient after the
        quantize operation would be greater than precision then an Invalid
        operation condition is raised.  This guarantees that, unless there is
        an error condition, the exponent of the result of a quantize is always
        equal to that of the right-hand operand.

        Also unlike other operations, quantize will never raise Underflow, even
        if the result is subnormal and inexact.

        >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('0.001'))
        Decimal('2.170')
        >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('0.01'))
        Decimal('2.17')
        >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('0.1'))
        Decimal('2.2')
        >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('1e+0'))
        Decimal('2')
        >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('1e+1'))
        Decimal('0E+1')
        >>> ExtendedContext.quantize(Decimal('-Inf'), Decimal('Infinity'))
        Decimal('-Infinity')
        >>> ExtendedContext.quantize(Decimal('2'), Decimal('Infinity'))
        Decimal('NaN')
        >>> ExtendedContext.quantize(Decimal('-0.1'), Decimal('1'))
        Decimal('-0')
        >>> ExtendedContext.quantize(Decimal('-0'), Decimal('1e+5'))
        Decimal('-0E+5')
        >>> ExtendedContext.quantize(Decimal('+35236450.6'), Decimal('1e-2'))
        Decimal('NaN')
        >>> ExtendedContext.quantize(Decimal('-35236450.6'), Decimal('1e-2'))
        Decimal('NaN')
        >>> ExtendedContext.quantize(Decimal('217'), Decimal('1e-1'))
        Decimal('217.0')
        >>> ExtendedContext.quantize(Decimal('217'), Decimal('1e-0'))
        Decimal('217')
        >>> ExtendedContext.quantize(Decimal('217'), Decimal('1e+1'))
        Decimal('2.2E+2')
        >>> ExtendedContext.quantize(Decimal('217'), Decimal('1e+2'))
        Decimal('2E+2')
        >>> ExtendedContext.quantize(1, 2)
        Decimal('1')
        >>> ExtendedContext.quantize(Decimal(1), 2)
        Decimal('1')
        >>> ExtendedContext.quantize(1, Decimal(2))
        Decimal('1')
        """
        a = _convert_other(a, raiseit=True)
        return a.quantize(b, context=self)

    def radix(self):
        """Just returns 10, as this is Decimal, :)

        >>> ExtendedContext.radix()
        Decimal('10')
        """
        return Decimal(10)

    def remainder(self, a, b):
        """Returns the remainder from integer division.

        The result is the residue of the dividend after the operation of
        calculating integer division as described for divide-integer, rounded
        to precision digits if necessary.  The sign of the result, if
        non-zero, is the same as that of the original dividend.

        This operation will fail under the same conditions as integer division
        (that is, if integer division on the same two operands would fail, the
        remainder cannot be calculated).

        >>> ExtendedContext.remainder(Decimal('2.1'), Decimal('3'))
        Decimal('2.1')
        >>> ExtendedContext.remainder(Decimal('10'), Decimal('3'))
        Decimal('1')
        >>> ExtendedContext.remainder(Decimal('-10'), Decimal('3'))
        Decimal('-1')
        >>> ExtendedContext.remainder(Decimal('10.2'), Decimal('1'))
        Decimal('0.2')
        >>> ExtendedContext.remainder(Decimal('10'), Decimal('0.3'))
        Decimal('0.1')
        >>> ExtendedContext.remainder(Decimal('3.6'), Decimal('1.3'))
        Decimal('1.0')
        >>> ExtendedContext.remainder(22, 6)
        Decimal('4')
        >>> ExtendedContext.remainder(Decimal(22), 6)
        Decimal('4')
        >>> ExtendedContext.remainder(22, Decimal(6))
        Decimal('4')
        """
        a = _convert_other(a, raiseit=True)
        r = a.__mod__(b, context=self)
        if r is NotImplemented:
            raise TypeError("Unable to convert %s to Decimal" % b)
        else:
            return r

    def remainder_near(self, a, b):
        """Returns to be "a - b * n", where n is the integer nearest the exact
        value of "x / b" (if two integers are equally near then the even one
        is chosen).  If the result is equal to 0 then its sign will be the
        sign of a.

        This operation will fail under the same conditions as integer division
        (that is, if integer division on the same two operands would fail, the
        remainder cannot be calculated).

        >>> ExtendedContext.remainder_near(Decimal('2.1'), Decimal('3'))
        Decimal('-0.9')
        >>> ExtendedContext.remainder_near(Decimal('10'), Decimal('6'))
        Decimal('-2')
        >>> ExtendedContext.remainder_near(Decimal('10'), Decimal('3'))
        Decimal('1')
        >>> ExtendedContext.remainder_near(Decimal('-10'), Decimal('3'))
        Decimal('-1')
        >>> ExtendedContext.remainder_near(Decimal('10.2'), Decimal('1'))
        Decimal('0.2')
        >>> ExtendedContext.remainder_near(Decimal('10'), Decimal('0.3'))
        Decimal('0.1')
        >>> ExtendedContext.remainder_near(Decimal('3.6'), Decimal('1.3'))
        Decimal('-0.3')
        >>> ExtendedContext.remainder_near(3, 11)
        Decimal('3')
        >>> ExtendedContext.remainder_near(Decimal(3), 11)
        Decimal('3')
        >>> ExtendedContext.remainder_near(3, Decimal(11))
        Decimal('3')
        """
        a = _convert_other(a, raiseit=True)
        return a.remainder_near(b, context=self)

    def rotate(self, a, b):
        """Returns a rotated copy of a, b times.

        The coefficient of the result is a rotated copy of the digits in
        the coefficient of the first operand.  The number of places of
        rotation is taken from the absolute value of the second operand,
        with the rotation being to the left if the second operand is
        positive or to the right otherwise.

        >>> ExtendedContext.rotate(Decimal('34'), Decimal('8'))
        Decimal('400000003')
        >>> ExtendedContext.rotate(Decimal('12'), Decimal('9'))
        Decimal('12')
        >>> ExtendedContext.rotate(Decimal('123456789'), Decimal('-2'))
        Decimal('891234567')
        >>> ExtendedContext.rotate(Decimal('123456789'), Decimal('0'))
        Decimal('123456789')
        >>> ExtendedContext.rotate(Decimal('123456789'), Decimal('+2'))
        Decimal('345678912')
        >>> ExtendedContext.rotate(1333333, 1)
        Decimal('13333330')
        >>> ExtendedContext.rotate(Decimal(1333333), 1)
        Decimal('13333330')
        >>> ExtendedContext.rotate(1333333, Decimal(1))
        Decimal('13333330')
        """
        a = _convert_other(a, raiseit=True)
        return a.rotate(b, context=self)

    def same_quantum(self, a, b):
        """Returns True if the two operands have the same exponent.

        The result is never affected by either the sign or the coefficient of
        either operand.

        >>> ExtendedContext.same_quantum(Decimal('2.17'), Decimal('0.001'))
        False
        >>> ExtendedContext.same_quantum(Decimal('2.17'), Decimal('0.01'))
        True
        >>> ExtendedContext.same_quantum(Decimal('2.17'), Decimal('1'))
        False
        >>> ExtendedContext.same_quantum(Decimal('Inf'), Decimal('-Inf'))
        True
        >>> ExtendedContext.same_quantum(10000, -1)
        True
        >>> ExtendedContext.same_quantum(Decimal(10000), -1)
        True
        >>> ExtendedContext.same_quantum(10000, Decimal(-1))
        True
        """
        a = _convert_other(a, raiseit=True)
        return a.same_quantum(b)

    def scaleb (self, a, b):
        """Returns the first operand after adding the second value its exp.

        >>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('-2'))
        Decimal('0.0750')
        >>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('0'))
        Decimal('7.50')
        >>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('3'))
        Decimal('7.50E+3')
        >>> ExtendedContext.scaleb(1, 4)
        Decimal('1E+4')
        >>> ExtendedContext.scaleb(Decimal(1), 4)
        Decimal('1E+4')
        >>> ExtendedContext.scaleb(1, Decimal(4))
        Decimal('1E+4')
        """
        a = _convert_other(a, raiseit=True)
        return a.scaleb(b, context=self)

    def shift(self, a, b):
        """Returns a shifted copy of a, b times.

        The coefficient of the result is a shifted copy of the digits
        in the coefficient of the first operand.  The number of places
        to shift is taken from the absolute value of the second operand,
        with the shift being to the left if the second operand is
        positive or to the right otherwise.  Digits shifted into the
        coefficient are zeros.

        >>> ExtendedContext.shift(Decimal('34'), Decimal('8'))
        Decimal('400000000')
        >>> ExtendedContext.shift(Decimal('12'), Decimal('9'))
        Decimal('0')
        >>> ExtendedContext.shift(Decimal('123456789'), Decimal('-2'))
        Decimal('1234567')
        >>> ExtendedContext.shift(Decimal('123456789'), Decimal('0'))
        Decimal('123456789')
        >>> ExtendedContext.shift(Decimal('123456789'), Decimal('+2'))
        Decimal('345678900')
        >>> ExtendedContext.shift(88888888, 2)
        Decimal('888888800')
        >>> ExtendedContext.shift(Decimal(88888888), 2)
        Decimal('888888800')
        >>> ExtendedContext.shift(88888888, Decimal(2))
        Decimal('888888800')
        """
        a = _convert_other(a, raiseit=True)
        return a.shift(b, context=self)

    def sqrt(self, a):
        """Square root of a non-negative number to context precision.

        If the result must be inexact, it is rounded using the round-half-even
        algorithm.

        >>> ExtendedContext.sqrt(Decimal('0'))
        Decimal('0')
        >>> ExtendedContext.sqrt(Decimal('-0'))
        Decimal('-0')
        >>> ExtendedContext.sqrt(Decimal('0.39'))
        Decimal('0.624499800')
        >>> ExtendedContext.sqrt(Decimal('100'))
        Decimal('10')
        >>> ExtendedContext.sqrt(Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.sqrt(Decimal('1.0'))
        Decimal('1.0')
        >>> ExtendedContext.sqrt(Decimal('1.00'))
        Decimal('1.0')
        >>> ExtendedContext.sqrt(Decimal('7'))
        Decimal('2.64575131')
        >>> ExtendedContext.sqrt(Decimal('10'))
        Decimal('3.16227766')
        >>> ExtendedContext.sqrt(2)
        Decimal('1.41421356')
        >>> ExtendedContext.prec
        9
        """
        a = _convert_other(a, raiseit=True)
        return a.sqrt(context=self)

    def subtract(self, a, b):
        """Return the difference between the two operands.

        >>> ExtendedContext.subtract(Decimal('1.3'), Decimal('1.07'))
        Decimal('0.23')
        >>> ExtendedContext.subtract(Decimal('1.3'), Decimal('1.30'))
        Decimal('0.00')
        >>> ExtendedContext.subtract(Decimal('1.3'), Decimal('2.07'))
        Decimal('-0.77')
        >>> ExtendedContext.subtract(8, 5)
        Decimal('3')
        >>> ExtendedContext.subtract(Decimal(8), 5)
        Decimal('3')
        >>> ExtendedContext.subtract(8, Decimal(5))
        Decimal('3')
        """
        a = _convert_other(a, raiseit=True)
        r = a.__sub__(b, context=self)
        if r is NotImplemented:
            raise TypeError("Unable to convert %s to Decimal" % b)
        else:
            return r

    def to_eng_string(self, a):
        """Convert to a string, using engineering notation if an exponent is needed.

        Engineering notation has an exponent which is a multiple of 3.  This
        can leave up to 3 digits to the left of the decimal place and may
        require the addition of either one or two trailing zeros.

        The operation is not affected by the context.

        >>> ExtendedContext.to_eng_string(Decimal('123E+1'))
        '1.23E+3'
        >>> ExtendedContext.to_eng_string(Decimal('123E+3'))
        '123E+3'
        >>> ExtendedContext.to_eng_string(Decimal('123E-10'))
        '12.3E-9'
        >>> ExtendedContext.to_eng_string(Decimal('-123E-12'))
        '-123E-12'
        >>> ExtendedContext.to_eng_string(Decimal('7E-7'))
        '700E-9'
        >>> ExtendedContext.to_eng_string(Decimal('7E+1'))
        '70'
        >>> ExtendedContext.to_eng_string(Decimal('0E+1'))
        '0.00E+3'

        """
        a = _convert_other(a, raiseit=True)
        return a.to_eng_string(context=self)

    def to_sci_string(self, a):
        """Converts a number to a string, using scientific notation.

        The operation is not affected by the context.
        """
        a = _convert_other(a, raiseit=True)
        return a.__str__(context=self)

    def to_integral_exact(self, a):
        """Rounds to an integer.

        When the operand has a negative exponent, the result is the same
        as using the quantize() operation using the given operand as the
        left-hand-operand, 1E+0 as the right-hand-operand, and the precision
        of the operand as the precision setting; Inexact and Rounded flags
        are allowed in this operation.  The rounding mode is taken from the
        context.

        >>> ExtendedContext.to_integral_exact(Decimal('2.1'))
        Decimal('2')
        >>> ExtendedContext.to_integral_exact(Decimal('100'))
        Decimal('100')
        >>> ExtendedContext.to_integral_exact(Decimal('100.0'))
        Decimal('100')
        >>> ExtendedContext.to_integral_exact(Decimal('101.5'))
        Decimal('102')
        >>> ExtendedContext.to_integral_exact(Decimal('-101.5'))
        Decimal('-102')
        >>> ExtendedContext.to_integral_exact(Decimal('10E+5'))
        Decimal('1.0E+6')
        >>> ExtendedContext.to_integral_exact(Decimal('7.89E+77'))
        Decimal('7.89E+77')
        >>> ExtendedContext.to_integral_exact(Decimal('-Inf'))
        Decimal('-Infinity')
        """
        a = _convert_other(a, raiseit=True)
        return a.to_integral_exact(context=self)

    def to_integral_value(self, a):
        """Rounds to an integer.

        When the operand has a negative exponent, the result is the same
        as using the quantize() operation using the given operand as the
        left-hand-operand, 1E+0 as the right-hand-operand, and the precision
        of the operand as the precision setting, except that no flags will
        be set.  The rounding mode is taken from the context.

        >>> ExtendedContext.to_integral_value(Decimal('2.1'))
        Decimal('2')
        >>> ExtendedContext.to_integral_value(Decimal('100'))
        Decimal('100')
        >>> ExtendedContext.to_integral_value(Decimal('100.0'))
        Decimal('100')
        >>> ExtendedContext.to_integral_value(Decimal('101.5'))
        Decimal('102')
        >>> ExtendedContext.to_integral_value(Decimal('-101.5'))
        Decimal('-102')
        >>> ExtendedContext.to_integral_value(Decimal('10E+5'))
        Decimal('1.0E+6')
        >>> ExtendedContext.to_integral_value(Decimal('7.89E+77'))
        Decimal('7.89E+77')
        >>> ExtendedContext.to_integral_value(Decimal('-Inf'))
        Decimal('-Infinity')
        """
        a = _convert_other(a, raiseit=True)
        return a.to_integral_value(context=self)

    # the method name changed, but we provide also the old one, for compatibility
    to_integral = to_integral_value

class _WorkRep(object):
    __slots__ = ('sign','int','exp')
    # sign: 0 or 1
    # int:  int
    # exp:  None, int, or string

    def __init__(self, value=None):
        if value is None:
            self.sign = None
            self.int = 0
            self.exp = None
        elif isinstance(value, Decimal):
            self.sign = value._sign
            self.int = int(value._int)
            self.exp = value._exp
        else:
            # assert isinstance(value, tuple)
            self.sign = value[0]
            self.int = value[1]
            self.exp = value[2]

    def __repr__(self):
        return "(%r, %r, %r)" % (self.sign, self.int, self.exp)



def _normalize(op1, op2, prec = 0):
    """Normalizes op1, op2 to have the same exp and length of coefficient.

    Done during addition.
    """
    if op1.exp < op2.exp:
        tmp = op2
        other = op1
    else:
        tmp = op1
        other = op2

    # Let exp = min(tmp.exp - 1, tmp.adjusted() - precision - 1).
    # Then adding 10**exp to tmp has the same effect (after rounding)
    # as adding any positive quantity smaller than 10**exp; similarly
    # for subtraction.  So if other is smaller than 10**exp we replace
    # it with 10**exp.  This avoids tmp.exp - other.exp getting too large.
    tmp_len = len(str(tmp.int))
    other_len = len(str(other.int))
    exp = tmp.exp + min(-1, tmp_len - prec - 2)
    if other_len + other.exp - 1 < exp:
        other.int = 1
        other.exp = exp

    tmp.int *= 10 ** (tmp.exp - other.exp)
    tmp.exp = other.exp
    return op1, op2

##### Integer arithmetic functions used by ln, log10, exp and __pow__ #####

_nbits = int.bit_length

def _decimal_lshift_exact(n, e):
    """ Given integers n and e, return n * 10**e if it's an integer, else None.

    The computation is designed to avoid computing large powers of 10
    unnecessarily.

    >>> _decimal_lshift_exact(3, 4)
    30000
    >>> _decimal_lshift_exact(300, -999999999)  # returns None

    """
    if n == 0:
        return 0
    elif e >= 0:
        return n * 10**e
    else:
        # val_n = largest power of 10 dividing n.
        str_n = str(abs(n))
        val_n = len(str_n) - len(str_n.rstrip('0'))
        return None if val_n < -e else n // 10**-e

def _sqrt_nearest(n, a):
    """Closest integer to the square root of the positive integer n.  a is
    an initial approximation to the square root.  Any positive integer
    will do for a, but the closer a is to the square root of n the
    faster convergence will be.

    """
    if n <= 0 or a <= 0:
        raise ValueError("Both arguments to _sqrt_nearest should be positive.")

    b=0
    while a != b:
        b, a = a, a--n//a>>1
    return a

def _rshift_nearest(x, shift):
    """Given an integer x and a nonnegative integer shift, return closest
    integer to x / 2**shift; use round-to-even in case of a tie.

    """
    b, q = 1 << shift, x >> shift
    return q + (2*(x & (b-1)) + (q&1) > b)

def _div_nearest(a, b):
    """Closest integer to a/b, a and b positive integers; rounds to even
    in the case of a tie.

    """
    q, r = divmod(a, b)
    return q + (2*r + (q&1) > b)

def _ilog(x, M, L = 8):
    """Integer approximation to M*log(x/M), with absolute error boundable
    in terms only of x/M.

    Given positive integers x and M, return an integer approximation to
    M * log(x/M).  For L = 8 and 0.1 <= x/M <= 10 the difference
    between the approximation and the exact result is at most 22.  For
    L = 8 and 1.0 <= x/M <= 10.0 the difference is at most 15.  In
    both cases these are upper bounds on the error; it will usually be
    much smaller."""

    # The basic algorithm is the following: let log1p be the function
    # log1p(x) = log(1+x).  Then log(x/M) = log1p((x-M)/M).  We use
    # the reduction
    #
    #    log1p(y) = 2*log1p(y/(1+sqrt(1+y)))
    #
    # repeatedly until the argument to log1p is small (< 2**-L in
    # absolute value).  For small y we can use the Taylor series
    # expansion
    #
    #    log1p(y) ~ y - y**2/2 + y**3/3 - ... - (-y)**T/T
    #
    # truncating at T such that y**T is small enough.  The whole
    # computation is carried out in a form of fixed-point arithmetic,
    # with a real number z being represented by an integer
    # approximation to z*M.  To avoid loss of precision, the y below
    # is actually an integer approximation to 2**R*y*M, where R is the
    # number of reductions performed so far.

    y = x-M
    # argument reduction; R = number of reductions performed
    R = 0
    while (R <= L and abs(y) << L-R >= M or
           R > L and abs(y) >> R-L >= M):
        y = _div_nearest((M*y) << 1,
                         M + _sqrt_nearest(M*(M+_rshift_nearest(y, R)), M))
        R += 1

    # Taylor series with T terms
    T = -int(-10*len(str(M))//(3*L))
    yshift = _rshift_nearest(y, R)
    w = _div_nearest(M, T)
    for k in range(T-1, 0, -1):
        w = _div_nearest(M, k) - _div_nearest(yshift*w, M)

    return _div_nearest(w*y, M)

def _dlog10(c, e, p):
    """Given integers c, e and p with c > 0, p >= 0, compute an integer
    approximation to 10**p * log10(c*10**e), with an absolute error of
    at most 1.  Assumes that c*10**e is not exactly 1."""

    # increase precision by 2; compensate for this by dividing
    # final result by 100
    p += 2

    # write c*10**e as d*10**f with either:
    #   f >= 0 and 1 <= d <= 10, or
    #   f <= 0 and 0.1 <= d <= 1.
    # Thus for c*10**e close to 1, f = 0
    l = len(str(c))
    f = e+l - (e+l >= 1)

    if p > 0:
        M = 10**p
        k = e+p-f
        if k >= 0:
            c *= 10**k
        else:
            c = _div_nearest(c, 10**-k)

        log_d = _ilog(c, M) # error < 5 + 22 = 27
        log_10 = _log10_digits(p) # error < 1
        log_d = _div_nearest(log_d*M, log_10)
        log_tenpower = f*M # exact
    else:
        log_d = 0  # error < 2.31
        log_tenpower = _div_nearest(f, 10**-p) # error < 0.5

    return _div_nearest(log_tenpower+log_d, 100)

def _dlog(c, e, p):
    """Given integers c, e and p with c > 0, compute an integer
    approximation to 10**p * log(c*10**e), with an absolute error of
    at most 1.  Assumes that c*10**e is not exactly 1."""

    # Increase precision by 2. The precision increase is compensated
    # for at the end with a division by 100.
    p += 2

    # rewrite c*10**e as d*10**f with either f >= 0 and 1 <= d <= 10,
    # or f <= 0 and 0.1 <= d <= 1.  Then we can compute 10**p * log(c*10**e)
    # as 10**p * log(d) + 10**p*f * log(10).
    l = len(str(c))
    f = e+l - (e+l >= 1)

    # compute approximation to 10**p*log(d), with error < 27
    if p > 0:
        k = e+p-f
        if k >= 0:
            c *= 10**k
        else:
            c = _div_nearest(c, 10**-k)  # error of <= 0.5 in c

        # _ilog magnifies existing error in c by a factor of at most 10
        log_d = _ilog(c, 10**p) # error < 5 + 22 = 27
    else:
        # p <= 0: just approximate the whole thing by 0; error < 2.31
        log_d = 0

    # compute approximation to f*10**p*log(10), with error < 11.
    if f:
        extra = len(str(abs(f)))-1
        if p + extra >= 0:
            # error in f * _log10_digits(p+extra) < |f| * 1 = |f|
            # after division, error < |f|/10**extra + 0.5 < 10 + 0.5 < 11
            f_log_ten = _div_nearest(f*_log10_digits(p+extra), 10**extra)
        else:
            f_log_ten = 0
    else:
        f_log_ten = 0

    # error in sum < 11+27 = 38; error after division < 0.38 + 0.5 < 1
    return _div_nearest(f_log_ten + log_d, 100)

class _Log10Memoize(object):
    """Class to compute, store, and allow retrieval of, digits of the
    constant log(10) = 2.302585....  This constant is needed by
    Decimal.ln, Decimal.log10, Decimal.exp and Decimal.__pow__."""
    def __init__(self):
        self.digits = "23025850929940456840179914546843642076011014886"

    def getdigits(self, p):
        """Given an integer p >= 0, return floor(10**p)*log(10).

        For example, self.getdigits(3) returns 2302.
        """
        # digits are stored as a string, for quick conversion to
        # integer in the case that we've already computed enough
        # digits; the stored digits should always be correct
        # (truncated, not rounded to nearest).
        if p < 0:
            raise ValueError("p should be nonnegative")

        if p >= len(self.digits):
            # compute p+3, p+6, p+9, ... digits; continue until at
            # least one of the extra digits is nonzero
            extra = 3
            while True:
                # compute p+extra digits, correct to within 1ulp
                M = 10**(p+extra+2)
                digits = str(_div_nearest(_ilog(10*M, M), 100))
                if digits[-extra:] != '0'*extra:
                    break
                extra += 3
            # keep all reliable digits so far; remove trailing zeros
            # and next nonzero digit
            self.digits = digits.rstrip('0')[:-1]
        return int(self.digits[:p+1])

_log10_digits = _Log10Memoize().getdigits

def _iexp(x, M, L=8):
    """Given integers x and M, M > 0, such that x/M is small in absolute
    value, compute an integer approximation to M*exp(x/M).  For 0 <=
    x/M <= 2.4, the absolute error in the result is bounded by 60 (and
    is usually much smaller)."""

    # Algorithm: to compute exp(z) for a real number z, first divide z
    # by a suitable power R of 2 so that |z/2**R| < 2**-L.  Then
    # compute expm1(z/2**R) = exp(z/2**R) - 1 using the usual Taylor
    # series
    #
    #     expm1(x) = x + x**2/2! + x**3/3! + ...
    #
    # Now use the identity
    #
    #     expm1(2x) = expm1(x)*(expm1(x)+2)
    #
    # R times to compute the sequence expm1(z/2**R),
    # expm1(z/2**(R-1)), ... , exp(z/2), exp(z).

    # Find R such that x/2**R/M <= 2**-L
    R = _nbits((x<<L)//M)

    # Taylor series.  (2**L)**T > M
    T = -int(-10*len(str(M))//(3*L))
    y = _div_nearest(x, T)
    Mshift = M<<R
    for i in range(T-1, 0, -1):
        y = _div_nearest(x*(Mshift + y), Mshift * i)

    # Expansion
    for k in range(R-1, -1, -1):
        Mshift = M<<(k+2)
        y = _div_nearest(y*(y+Mshift), Mshift)

    return M+y

def _dexp(c, e, p):
    """Compute an approximation to exp(c*10**e), with p decimal places of
    precision.

    Returns integers d, f such that:

      10**(p-1) <= d <= 10**p, and
      (d-1)*10**f < exp(c*10**e) < (d+1)*10**f

    In other words, d*10**f is an approximation to exp(c*10**e) with p
    digits of precision, and with an error in d of at most 1.  This is
    almost, but not quite, the same as the error being < 1ulp: when d
    = 10**(p-1) the error could be up to 10 ulp."""

    # we'll call iexp with M = 10**(p+2), giving p+3 digits of precision
    p += 2

    # compute log(10) with extra precision = adjusted exponent of c*10**e
    extra = max(0, e + len(str(c)) - 1)
    q = p + extra

    # compute quotient c*10**e/(log(10)) = c*10**(e+q)/(log(10)*10**q),
    # rounding down
    shift = e+q
    if shift >= 0:
        cshift = c*10**shift
    else:
        cshift = c//10**-shift
    quot, rem = divmod(cshift, _log10_digits(q))

    # reduce remainder back to original precision
    rem = _div_nearest(rem, 10**extra)

    # error in result of _iexp < 120;  error after division < 0.62
    return _div_nearest(_iexp(rem, 10**p), 1000), quot - p + 3

def _dpower(xc, xe, yc, ye, p):
    """Given integers xc, xe, yc and ye representing Decimals x = xc*10**xe and
    y = yc*10**ye, compute x**y.  Returns a pair of integers (c, e) such that:

      10**(p-1) <= c <= 10**p, and
      (c-1)*10**e < x**y < (c+1)*10**e

    in other words, c*10**e is an approximation to x**y with p digits
    of precision, and with an error in c of at most 1.  (This is
    almost, but not quite, the same as the error being < 1ulp: when c
    == 10**(p-1) we can only guarantee error < 10ulp.)

    We assume that: x is positive and not equal to 1, and y is nonzero.
    """

    # Find b such that 10**(b-1) <= |y| <= 10**b
    b = len(str(abs(yc))) + ye

    # log(x) = lxc*10**(-p-b-1), to p+b+1 places after the decimal point
    lxc = _dlog(xc, xe, p+b+1)

    # compute product y*log(x) = yc*lxc*10**(-p-b-1+ye) = pc*10**(-p-1)
    shift = ye-b
    if shift >= 0:
        pc = lxc*yc*10**shift
    else:
        pc = _div_nearest(lxc*yc, 10**-shift)

    if pc == 0:
        # we prefer a result that isn't exactly 1; this makes it
        # easier to compute a correctly rounded result in __pow__
        if ((len(str(xc)) + xe >= 1) == (yc > 0)): # if x**y > 1:
            coeff, exp = 10**(p-1)+1, 1-p
        else:
            coeff, exp = 10**p-1, -p
    else:
        coeff, exp = _dexp(pc, -(p+1), p+1)
        coeff = _div_nearest(coeff, 10)
        exp += 1

    return coeff, exp

def _log10_lb(c, correction = {
        '1': 100, '2': 70, '3': 53, '4': 40, '5': 31,
        '6': 23, '7': 16, '8': 10, '9': 5}):
    """Compute a lower bound for 100*log10(c) for a positive integer c."""
    if c <= 0:
        raise ValueError("The argument to _log10_lb should be nonnegative.")
    str_c = str(c)
    return 100*len(str_c) - correction[str_c[0]]

##### Helper Functions ####################################################

def _convert_other(other, raiseit=False, allow_float=False):
    """Convert other to Decimal.

    Verifies that it's ok to use in an implicit construction.
    If allow_float is true, allow conversion from float;  this
    is used in the comparison methods (__eq__ and friends).

    """
    if isinstance(other, Decimal):
        return other
    if isinstance(other, int):
        return Decimal(other)
    if allow_float and isinstance(other, float):
        return Decimal.from_float(other)

    if raiseit:
        raise TypeError("Unable to convert %s to Decimal" % other)
    return NotImplemented

def _convert_for_comparison(self, other, equality_op=False):
    """Given a Decimal instance self and a Python object other, return
    a pair (s, o) of Decimal instances such that "s op o" is
    equivalent to "self op other" for any of the 6 comparison
    operators "op".

    """
    if isinstance(other, Decimal):
        return self, other

    # Comparison with a Rational instance (also includes integers):
    # self op n/d <=> self*d op n (for n and d integers, d positive).
    # A NaN or infinity can be left unchanged without affecting the
    # comparison result.
    if isinstance(other, _numbers.Rational):
        if not self._is_special:
            self = _dec_from_triple(self._sign,
                                    str(int(self._int) * other.denominator),
                                    self._exp)
        return self, Decimal(other.numerator)

    # Comparisons with float and complex types.  == and != comparisons
    # with complex numbers should succeed, returning either True or False
    # as appropriate.  Other comparisons return NotImplemented.
    if equality_op and isinstance(other, _numbers.Complex) and other.imag == 0:
        other = other.real
    if isinstance(other, float):
        context = getcontext()
        if equality_op:
            context.flags[FloatOperation] = 1
        else:
            context._raise_error(FloatOperation,
                "strict semantics for mixing floats and Decimals are enabled")
        return self, Decimal.from_float(other)
    return NotImplemented, NotImplemented


##### Setup Specific Contexts ############################################

# The default context prototype used by Context()
# Is mutable, so that new contexts can have different default values

DefaultContext = Context(
        prec=28, rounding=ROUND_HALF_EVEN,
        traps=[DivisionByZero, Overflow, InvalidOperation],
        flags=[],
        Emax=999999,
        Emin=-999999,
        capitals=1,
        clamp=0
)

# Pre-made alternate contexts offered by the specification
# Don't change these; the user should be able to select these
# contexts and be able to reproduce results from other implementations
# of the spec.

BasicContext = Context(
        prec=9, rounding=ROUND_HALF_UP,
        traps=[DivisionByZero, Overflow, InvalidOperation, Clamped, Underflow],
        flags=[],
)

ExtendedContext = Context(
        prec=9, rounding=ROUND_HALF_EVEN,
        traps=[],
        flags=[],
)


##### crud for parsing strings #############################################
#
# Regular expression used for parsing numeric strings.  Additional
# comments:
#
# 1. Uncomment the two '\s*' lines to allow leading and/or trailing
# whitespace.  But note that the specification disallows whitespace in
# a numeric string.
#
# 2. For finite numbers (not infinities and NaNs) the body of the
# number between the optional sign and the optional exponent must have
# at least one decimal digit, possibly after the decimal point.  The
# lookahead expression '(?=\d|\.\d)' checks this.

import re
_parser = re.compile(r"""        # A numeric string consists of:
#    \s*
    (?P<sign>[-+])?              # an optional sign, followed by either...
    (
        (?=\d|\.\d)              # ...a number (with at least one digit)
        (?P<int>\d*)             # having a (possibly empty) integer part
        (\.(?P<frac>\d*))?       # followed by an optional fractional part
        (E(?P<exp>[-+]?\d+))?    # followed by an optional exponent, or...
    |
        Inf(inity)?              # ...an infinity, or...
    |
        (?P<signal>s)?           # ...an (optionally signaling)
        NaN                      # NaN
        (?P<diag>\d*)            # with (possibly empty) diagnostic info.
    )
#    \s*
    \Z
""", re.VERBOSE | re.IGNORECASE).match

_all_zeros = re.compile('0*$').match
_exact_half = re.compile('50*$').match

##### PEP3101 support functions ##############################################
# The functions in this section have little to do with the Decimal
# class, and could potentially be reused or adapted for other pure
# Python numeric classes that want to implement __format__
#
# A format specifier for Decimal looks like:
#
#   [[fill]align][sign][#][0][minimumwidth][,][.precision][type]

_parse_format_specifier_regex = re.compile(r"""\A
(?:
   (?P<fill>.)?
   (?P<align>[<>=^])
)?
(?P<sign>[-+ ])?
(?P<alt>\#)?
(?P<zeropad>0)?
(?P<minimumwidth>(?!0)\d+)?
(?P<thousands_sep>,)?
(?:\.(?P<precision>0|(?!0)\d+))?
(?P<type>[eEfFgGn%])?
\Z
""", re.VERBOSE|re.DOTALL)

del re

# The locale module is only needed for the 'n' format specifier.  The
# rest of the PEP 3101 code functions quite happily without it, so we
# don't care too much if locale isn't present.
try:
    import locale as _locale
except ImportError:
    pass

def _parse_format_specifier(format_spec, _localeconv=None):
    """Parse and validate a format specifier.

    Turns a standard numeric format specifier into a dict, with the
    following entries:

      fill: fill character to pad field to minimum width
      align: alignment type, either '<', '>', '=' or '^'
      sign: either '+', '-' or ' '
      minimumwidth: nonnegative integer giving minimum width
      zeropad: boolean, indicating whether to pad with zeros
      thousands_sep: string to use as thousands separator, or ''
      grouping: grouping for thousands separators, in format
        used by localeconv
      decimal_point: string to use for decimal point
      precision: nonnegative integer giving precision, or None
      type: one of the characters 'eEfFgG%', or None

    """
    m = _parse_format_specifier_regex.match(format_spec)
    if m is None:
        raise ValueError("Invalid format specifier: " + format_spec)

    # get the dictionary
    format_dict = m.groupdict()

    # zeropad; defaults for fill and alignment.  If zero padding
    # is requested, the fill and align fields should be absent.
    fill = format_dict['fill']
    align = format_dict['align']
    format_dict['zeropad'] = (format_dict['zeropad'] is not None)
    if format_dict['zeropad']:
        if fill is not None:
            raise ValueError("Fill character conflicts with '0'"
                             " in format specifier: " + format_spec)
        if align is not None:
            raise ValueError("Alignment conflicts with '0' in "
                             "format specifier: " + format_spec)
    format_dict['fill'] = fill or ' '
    # PEP 3101 originally specified that the default alignment should
    # be left;  it was later agreed that right-aligned makes more sense
    # for numeric types.  See http://bugs.python.org/issue6857.
    format_dict['align'] = align or '>'

    # default sign handling: '-' for negative, '' for positive
    if format_dict['sign'] is None:
        format_dict['sign'] = '-'

    # minimumwidth defaults to 0; precision remains None if not given
    format_dict['minimumwidth'] = int(format_dict['minimumwidth'] or '0')
    if format_dict['precision'] is not None:
        format_dict['precision'] = int(format_dict['precision'])

    # if format type is 'g' or 'G' then a precision of 0 makes little
    # sense; convert it to 1.  Same if format type is unspecified.
    if format_dict['precision'] == 0:
        if format_dict['type'] is None or format_dict['type'] in 'gGn':
            format_dict['precision'] = 1

    # determine thousands separator, grouping, and decimal separator, and
    # add appropriate entries to format_dict
    if format_dict['type'] == 'n':
        # apart from separators, 'n' behaves just like 'g'
        format_dict['type'] = 'g'
        if _localeconv is None:
            _localeconv = _locale.localeconv()
        if format_dict['thousands_sep'] is not None:
            raise ValueError("Explicit thousands separator conflicts with "
                             "'n' type in format specifier: " + format_spec)
        format_dict['thousands_sep'] = _localeconv['thousands_sep']
        format_dict['grouping'] = _localeconv['grouping']
        format_dict['decimal_point'] = _localeconv['decimal_point']
    else:
        if format_dict['thousands_sep'] is None:
            format_dict['thousands_sep'] = ''
        format_dict['grouping'] = [3, 0]
        format_dict['decimal_point'] = '.'

    return format_dict

def _format_align(sign, body, spec):
    """Given an unpadded, non-aligned numeric string 'body' and sign
    string 'sign', add padding and alignment conforming to the given
    format specifier dictionary 'spec' (as produced by
    parse_format_specifier).

    """
    # how much extra space do we have to play with?
    minimumwidth = spec['minimumwidth']
    fill = spec['fill']
    padding = fill*(minimumwidth - len(sign) - len(body))

    align = spec['align']
    if align == '<':
        result = sign + body + padding
    elif align == '>':
        result = padding + sign + body
    elif align == '=':
        result = sign + padding + body
    elif align == '^':
        half = len(padding)//2
        result = padding[:half] + sign + body + padding[half:]
    else:
        raise ValueError('Unrecognised alignment field')

    return result

def _group_lengths(grouping):
    """Convert a localeconv-style grouping into a (possibly infinite)
    iterable of integers representing group lengths.

    """
    # The result from localeconv()['grouping'], and the input to this
    # function, should be a list of integers in one of the
    # following three forms:
    #
    #   (1) an empty list, or
    #   (2) nonempty list of positive integers + [0]
    #   (3) list of positive integers + [locale.CHAR_MAX], or

    from itertools import chain, repeat
    if not grouping:
        return []
    elif grouping[-1] == 0 and len(grouping) >= 2:
        return chain(grouping[:-1], repeat(grouping[-2]))
    elif grouping[-1] == _locale.CHAR_MAX:
        return grouping[:-1]
    else:
        raise ValueError('unrecognised format for grouping')

def _insert_thousands_sep(digits, spec, min_width=1):
    """Insert thousands separators into a digit string.

    spec is a dictionary whose keys should include 'thousands_sep' and
    'grouping'; typically it's the result of parsing the format
    specifier using _parse_format_specifier.

    The min_width keyword argument gives the minimum length of the
    result, which will be padded on the left with zeros if necessary.

    If necessary, the zero padding adds an extra '0' on the left to
    avoid a leading thousands separator.  For example, inserting
    commas every three digits in '123456', with min_width=8, gives
    '0,123,456', even though that has length 9.

    """

    sep = spec['thousands_sep']
    grouping = spec['grouping']

    groups = []
    for l in _group_lengths(grouping):
        if l <= 0:
            raise ValueError("group length should be positive")
        # max(..., 1) forces at least 1 digit to the left of a separator
        l = min(max(len(digits), min_width, 1), l)
        groups.append('0'*(l - len(digits)) + digits[-l:])
        digits = digits[:-l]
        min_width -= l
        if not digits and min_width <= 0:
            break
        min_width -= len(sep)
    else:
        l = max(len(digits), min_width, 1)
        groups.append('0'*(l - len(digits)) + digits[-l:])
    return sep.join(reversed(groups))

def _format_sign(is_negative, spec):
    """Determine sign character."""

    if is_negative:
        return '-'
    elif spec['sign'] in ' +':
        return spec['sign']
    else:
        return ''

def _format_number(is_negative, intpart, fracpart, exp, spec):
    """Format a number, given the following data:

    is_negative: true if the number is negative, else false
    intpart: string of digits that must appear before the decimal point
    fracpart: string of digits that must come after the point
    exp: exponent, as an integer
    spec: dictionary resulting from parsing the format specifier

    This function uses the information in spec to:
      insert separators (decimal separator and thousands separators)
      format the sign
      format the exponent
      add trailing '%' for the '%' type
      zero-pad if necessary
      fill and align if necessary
    """

    sign = _format_sign(is_negative, spec)

    if fracpart or spec['alt']:
        fracpart = spec['decimal_point'] + fracpart

    if exp != 0 or spec['type'] in 'eE':
        echar = {'E': 'E', 'e': 'e', 'G': 'E', 'g': 'e'}[spec['type']]
        fracpart += "{0}{1:+}".format(echar, exp)
    if spec['type'] == '%':
        fracpart += '%'

    if spec['zeropad']:
        min_width = spec['minimumwidth'] - len(fracpart) - len(sign)
    else:
        min_width = 0
    intpart = _insert_thousands_sep(intpart, spec, min_width)

    return _format_align(sign, intpart+fracpart, spec)


##### Useful Constants (internal use only) ################################

# Reusable defaults
_Infinity = Decimal('Inf')
_NegativeInfinity = Decimal('-Inf')
_NaN = Decimal('NaN')
_Zero = Decimal(0)
_One = Decimal(1)
_NegativeOne = Decimal(-1)

# _SignedInfinity[sign] is infinity w/ that sign
_SignedInfinity = (_Infinity, _NegativeInfinity)

# Constants related to the hash implementation;  hash(x) is based
# on the reduction of x modulo _PyHASH_MODULUS
_PyHASH_MODULUS = sys.hash_info.modulus
# hash values to use for positive and negative infinities, and nans
_PyHASH_INF = sys.hash_info.inf
_PyHASH_NAN = sys.hash_info.nan

# _PyHASH_10INV is the inverse of 10 modulo the prime _PyHASH_MODULUS
_PyHASH_10INV = pow(10, _PyHASH_MODULUS - 2, _PyHASH_MODULUS)
del sys
asyncore.py000064400000047176151153537470006773 0ustar00# -*- Mode: Python -*-
#   Id: asyncore.py,v 2.51 2000/09/07 22:29:26 rushing Exp
#   Author: Sam Rushing <rushing@nightmare.com>

# ======================================================================
# Copyright 1996 by Sam Rushing
#
#                         All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee is hereby
# granted, provided that the above copyright notice appear in all
# copies and that both that copyright notice and this permission
# notice appear in supporting documentation, and that the name of Sam
# Rushing not be used in advertising or publicity pertaining to
# distribution of the software without specific, written prior
# permission.
#
# SAM RUSHING DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
# NO EVENT SHALL SAM RUSHING BE LIABLE FOR ANY SPECIAL, INDIRECT OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
# OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# ======================================================================

"""Basic infrastructure for asynchronous socket service clients and servers.

There are only two ways to have a program on a single processor do "more
than one thing at a time".  Multi-threaded programming is the simplest and
most popular way to do it, but there is another very different technique,
that lets you have nearly all the advantages of multi-threading, without
actually using multiple threads. it's really only practical if your program
is largely I/O bound. If your program is CPU bound, then pre-emptive
scheduled threads are probably what you really need. Network servers are
rarely CPU-bound, however.

If your operating system supports the select() system call in its I/O
library (and nearly all do), then you can use it to juggle multiple
communication channels at once; doing other work while your I/O is taking
place in the "background."  Although this strategy can seem strange and
complex, especially at first, it is in many ways easier to understand and
control than multi-threaded programming. The module documented here solves
many of the difficult problems for you, making the task of building
sophisticated high-performance network servers and clients a snap.
"""

import select
import socket
import sys
import time
import warnings

import os
from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, EINVAL, \
     ENOTCONN, ESHUTDOWN, EISCONN, EBADF, ECONNABORTED, EPIPE, EAGAIN, \
     errorcode

_DISCONNECTED = frozenset({ECONNRESET, ENOTCONN, ESHUTDOWN, ECONNABORTED, EPIPE,
                           EBADF})

try:
    socket_map
except NameError:
    socket_map = {}

def _strerror(err):
    try:
        return os.strerror(err)
    except (ValueError, OverflowError, NameError):
        if err in errorcode:
            return errorcode[err]
        return "Unknown error %s" %err

class ExitNow(Exception):
    pass

_reraised_exceptions = (ExitNow, KeyboardInterrupt, SystemExit)

def read(obj):
    try:
        obj.handle_read_event()
    except _reraised_exceptions:
        raise
    except:
        obj.handle_error()

def write(obj):
    try:
        obj.handle_write_event()
    except _reraised_exceptions:
        raise
    except:
        obj.handle_error()

def _exception(obj):
    try:
        obj.handle_expt_event()
    except _reraised_exceptions:
        raise
    except:
        obj.handle_error()

def readwrite(obj, flags):
    try:
        if flags & select.POLLIN:
            obj.handle_read_event()
        if flags & select.POLLOUT:
            obj.handle_write_event()
        if flags & select.POLLPRI:
            obj.handle_expt_event()
        if flags & (select.POLLHUP | select.POLLERR | select.POLLNVAL):
            obj.handle_close()
    except OSError as e:
        if e.args[0] not in _DISCONNECTED:
            obj.handle_error()
        else:
            obj.handle_close()
    except _reraised_exceptions:
        raise
    except:
        obj.handle_error()

def poll(timeout=0.0, map=None):
    if map is None:
        map = socket_map
    if map:
        r = []; w = []; e = []
        for fd, obj in list(map.items()):
            is_r = obj.readable()
            is_w = obj.writable()
            if is_r:
                r.append(fd)
            # accepting sockets should not be writable
            if is_w and not obj.accepting:
                w.append(fd)
            if is_r or is_w:
                e.append(fd)
        if [] == r == w == e:
            time.sleep(timeout)
            return

        r, w, e = select.select(r, w, e, timeout)

        for fd in r:
            obj = map.get(fd)
            if obj is None:
                continue
            read(obj)

        for fd in w:
            obj = map.get(fd)
            if obj is None:
                continue
            write(obj)

        for fd in e:
            obj = map.get(fd)
            if obj is None:
                continue
            _exception(obj)

def poll2(timeout=0.0, map=None):
    # Use the poll() support added to the select module in Python 2.0
    if map is None:
        map = socket_map
    if timeout is not None:
        # timeout is in milliseconds
        timeout = int(timeout*1000)
    pollster = select.poll()
    if map:
        for fd, obj in list(map.items()):
            flags = 0
            if obj.readable():
                flags |= select.POLLIN | select.POLLPRI
            # accepting sockets should not be writable
            if obj.writable() and not obj.accepting:
                flags |= select.POLLOUT
            if flags:
                pollster.register(fd, flags)

        r = pollster.poll(timeout)
        for fd, flags in r:
            obj = map.get(fd)
            if obj is None:
                continue
            readwrite(obj, flags)

poll3 = poll2                           # Alias for backward compatibility

def loop(timeout=30.0, use_poll=False, map=None, count=None):
    if map is None:
        map = socket_map

    if use_poll and hasattr(select, 'poll'):
        poll_fun = poll2
    else:
        poll_fun = poll

    if count is None:
        while map:
            poll_fun(timeout, map)

    else:
        while map and count > 0:
            poll_fun(timeout, map)
            count = count - 1

class dispatcher:

    debug = False
    connected = False
    accepting = False
    connecting = False
    closing = False
    addr = None
    ignore_log_types = frozenset({'warning'})

    def __init__(self, sock=None, map=None):
        if map is None:
            self._map = socket_map
        else:
            self._map = map

        self._fileno = None

        if sock:
            # Set to nonblocking just to make sure for cases where we
            # get a socket from a blocking source.
            sock.setblocking(0)
            self.set_socket(sock, map)
            self.connected = True
            # The constructor no longer requires that the socket
            # passed be connected.
            try:
                self.addr = sock.getpeername()
            except OSError as err:
                if err.args[0] in (ENOTCONN, EINVAL):
                    # To handle the case where we got an unconnected
                    # socket.
                    self.connected = False
                else:
                    # The socket is broken in some unknown way, alert
                    # the user and remove it from the map (to prevent
                    # polling of broken sockets).
                    self.del_channel(map)
                    raise
        else:
            self.socket = None

    def __repr__(self):
        status = [self.__class__.__module__+"."+self.__class__.__qualname__]
        if self.accepting and self.addr:
            status.append('listening')
        elif self.connected:
            status.append('connected')
        if self.addr is not None:
            try:
                status.append('%s:%d' % self.addr)
            except TypeError:
                status.append(repr(self.addr))
        return '<%s at %#x>' % (' '.join(status), id(self))

    def add_channel(self, map=None):
        #self.log_info('adding channel %s' % self)
        if map is None:
            map = self._map
        map[self._fileno] = self

    def del_channel(self, map=None):
        fd = self._fileno
        if map is None:
            map = self._map
        if fd in map:
            #self.log_info('closing channel %d:%s' % (fd, self))
            del map[fd]
        self._fileno = None

    def create_socket(self, family=socket.AF_INET, type=socket.SOCK_STREAM):
        self.family_and_type = family, type
        sock = socket.socket(family, type)
        sock.setblocking(0)
        self.set_socket(sock)

    def set_socket(self, sock, map=None):
        self.socket = sock
        self._fileno = sock.fileno()
        self.add_channel(map)

    def set_reuse_addr(self):
        # try to re-use a server port if possible
        try:
            self.socket.setsockopt(
                socket.SOL_SOCKET, socket.SO_REUSEADDR,
                self.socket.getsockopt(socket.SOL_SOCKET,
                                       socket.SO_REUSEADDR) | 1
                )
        except OSError:
            pass

    # ==================================================
    # predicates for select()
    # these are used as filters for the lists of sockets
    # to pass to select().
    # ==================================================

    def readable(self):
        return True

    def writable(self):
        return True

    # ==================================================
    # socket object methods.
    # ==================================================

    def listen(self, num):
        self.accepting = True
        if os.name == 'nt' and num > 5:
            num = 5
        return self.socket.listen(num)

    def bind(self, addr):
        self.addr = addr
        return self.socket.bind(addr)

    def connect(self, address):
        self.connected = False
        self.connecting = True
        err = self.socket.connect_ex(address)
        if err in (EINPROGRESS, EALREADY, EWOULDBLOCK) \
        or err == EINVAL and os.name == 'nt':
            self.addr = address
            return
        if err in (0, EISCONN):
            self.addr = address
            self.handle_connect_event()
        else:
            raise OSError(err, errorcode[err])

    def accept(self):
        # XXX can return either an address pair or None
        try:
            conn, addr = self.socket.accept()
        except TypeError:
            return None
        except OSError as why:
            if why.args[0] in (EWOULDBLOCK, ECONNABORTED, EAGAIN):
                return None
            else:
                raise
        else:
            return conn, addr

    def send(self, data):
        try:
            result = self.socket.send(data)
            return result
        except OSError as why:
            if why.args[0] == EWOULDBLOCK:
                return 0
            elif why.args[0] in _DISCONNECTED:
                self.handle_close()
                return 0
            else:
                raise

    def recv(self, buffer_size):
        try:
            data = self.socket.recv(buffer_size)
            if not data:
                # a closed connection is indicated by signaling
                # a read condition, and having recv() return 0.
                self.handle_close()
                return b''
            else:
                return data
        except OSError as why:
            # winsock sometimes raises ENOTCONN
            if why.args[0] in _DISCONNECTED:
                self.handle_close()
                return b''
            else:
                raise

    def close(self):
        self.connected = False
        self.accepting = False
        self.connecting = False
        self.del_channel()
        if self.socket is not None:
            try:
                self.socket.close()
            except OSError as why:
                if why.args[0] not in (ENOTCONN, EBADF):
                    raise

    # log and log_info may be overridden to provide more sophisticated
    # logging and warning methods. In general, log is for 'hit' logging
    # and 'log_info' is for informational, warning and error logging.

    def log(self, message):
        sys.stderr.write('log: %s\n' % str(message))

    def log_info(self, message, type='info'):
        if type not in self.ignore_log_types:
            print('%s: %s' % (type, message))

    def handle_read_event(self):
        if self.accepting:
            # accepting sockets are never connected, they "spawn" new
            # sockets that are connected
            self.handle_accept()
        elif not self.connected:
            if self.connecting:
                self.handle_connect_event()
            self.handle_read()
        else:
            self.handle_read()

    def handle_connect_event(self):
        err = self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)
        if err != 0:
            raise OSError(err, _strerror(err))
        self.handle_connect()
        self.connected = True
        self.connecting = False

    def handle_write_event(self):
        if self.accepting:
            # Accepting sockets shouldn't get a write event.
            # We will pretend it didn't happen.
            return

        if not self.connected:
            if self.connecting:
                self.handle_connect_event()
        self.handle_write()

    def handle_expt_event(self):
        # handle_expt_event() is called if there might be an error on the
        # socket, or if there is OOB data
        # check for the error condition first
        err = self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)
        if err != 0:
            # we can get here when select.select() says that there is an
            # exceptional condition on the socket
            # since there is an error, we'll go ahead and close the socket
            # like we would in a subclassed handle_read() that received no
            # data
            self.handle_close()
        else:
            self.handle_expt()

    def handle_error(self):
        nil, t, v, tbinfo = compact_traceback()

        # sometimes a user repr method will crash.
        try:
            self_repr = repr(self)
        except:
            self_repr = '<__repr__(self) failed for object at %0x>' % id(self)

        self.log_info(
            'uncaptured python exception, closing channel %s (%s:%s %s)' % (
                self_repr,
                t,
                v,
                tbinfo
                ),
            'error'
            )
        self.handle_close()

    def handle_expt(self):
        self.log_info('unhandled incoming priority event', 'warning')

    def handle_read(self):
        self.log_info('unhandled read event', 'warning')

    def handle_write(self):
        self.log_info('unhandled write event', 'warning')

    def handle_connect(self):
        self.log_info('unhandled connect event', 'warning')

    def handle_accept(self):
        pair = self.accept()
        if pair is not None:
            self.handle_accepted(*pair)

    def handle_accepted(self, sock, addr):
        sock.close()
        self.log_info('unhandled accepted event', 'warning')

    def handle_close(self):
        self.log_info('unhandled close event', 'warning')
        self.close()

# ---------------------------------------------------------------------------
# adds simple buffered output capability, useful for simple clients.
# [for more sophisticated usage use asynchat.async_chat]
# ---------------------------------------------------------------------------

class dispatcher_with_send(dispatcher):

    def __init__(self, sock=None, map=None):
        dispatcher.__init__(self, sock, map)
        self.out_buffer = b''

    def initiate_send(self):
        num_sent = 0
        num_sent = dispatcher.send(self, self.out_buffer[:65536])
        self.out_buffer = self.out_buffer[num_sent:]

    def handle_write(self):
        self.initiate_send()

    def writable(self):
        return (not self.connected) or len(self.out_buffer)

    def send(self, data):
        if self.debug:
            self.log_info('sending %s' % repr(data))
        self.out_buffer = self.out_buffer + data
        self.initiate_send()

# ---------------------------------------------------------------------------
# used for debugging.
# ---------------------------------------------------------------------------

def compact_traceback():
    t, v, tb = sys.exc_info()
    tbinfo = []
    if not tb: # Must have a traceback
        raise AssertionError("traceback does not exist")
    while tb:
        tbinfo.append((
            tb.tb_frame.f_code.co_filename,
            tb.tb_frame.f_code.co_name,
            str(tb.tb_lineno)
            ))
        tb = tb.tb_next

    # just to be safe
    del tb

    file, function, line = tbinfo[-1]
    info = ' '.join(['[%s|%s|%s]' % x for x in tbinfo])
    return (file, function, line), t, v, info

def close_all(map=None, ignore_all=False):
    if map is None:
        map = socket_map
    for x in list(map.values()):
        try:
            x.close()
        except OSError as x:
            if x.args[0] == EBADF:
                pass
            elif not ignore_all:
                raise
        except _reraised_exceptions:
            raise
        except:
            if not ignore_all:
                raise
    map.clear()

# Asynchronous File I/O:
#
# After a little research (reading man pages on various unixen, and
# digging through the linux kernel), I've determined that select()
# isn't meant for doing asynchronous file i/o.
# Heartening, though - reading linux/mm/filemap.c shows that linux
# supports asynchronous read-ahead.  So _MOST_ of the time, the data
# will be sitting in memory for us already when we go to read it.
#
# What other OS's (besides NT) support async file i/o?  [VMS?]
#
# Regardless, this is useful for pipes, and stdin/stdout...

if os.name == 'posix':
    class file_wrapper:
        # Here we override just enough to make a file
        # look like a socket for the purposes of asyncore.
        # The passed fd is automatically os.dup()'d

        def __init__(self, fd):
            self.fd = os.dup(fd)

        def __del__(self):
            if self.fd >= 0:
                warnings.warn("unclosed file %r" % self, ResourceWarning,
                              source=self)
            self.close()

        def recv(self, *args):
            return os.read(self.fd, *args)

        def send(self, *args):
            return os.write(self.fd, *args)

        def getsockopt(self, level, optname, buflen=None):
            if (level == socket.SOL_SOCKET and
                optname == socket.SO_ERROR and
                not buflen):
                return 0
            raise NotImplementedError("Only asyncore specific behaviour "
                                      "implemented.")

        read = recv
        write = send

        def close(self):
            if self.fd < 0:
                return
            fd = self.fd
            self.fd = -1
            os.close(fd)

        def fileno(self):
            return self.fd

    class file_dispatcher(dispatcher):

        def __init__(self, fd, map=None):
            dispatcher.__init__(self, None, map)
            self.connected = True
            try:
                fd = fd.fileno()
            except AttributeError:
                pass
            self.set_file(fd)
            # set it to non-blocking mode
            os.set_blocking(fd, False)

        def set_file(self, fd):
            self.socket = file_wrapper(fd)
            self._fileno = self.socket.fileno()
            self.add_channel()
shelve.py000064400000020517151153537470006424 0ustar00"""Manage shelves of pickled objects.

A "shelf" is a persistent, dictionary-like object.  The difference
with dbm databases is that the values (not the keys!) in a shelf can
be essentially arbitrary Python objects -- anything that the "pickle"
module can handle.  This includes most class instances, recursive data
types, and objects containing lots of shared sub-objects.  The keys
are ordinary strings.

To summarize the interface (key is a string, data is an arbitrary
object):

        import shelve
        d = shelve.open(filename) # open, with (g)dbm filename -- no suffix

        d[key] = data   # store data at key (overwrites old data if
                        # using an existing key)
        data = d[key]   # retrieve a COPY of the data at key (raise
                        # KeyError if no such key) -- NOTE that this
                        # access returns a *copy* of the entry!
        del d[key]      # delete data stored at key (raises KeyError
                        # if no such key)
        flag = key in d # true if the key exists
        list = d.keys() # a list of all existing keys (slow!)

        d.close()       # close it

Dependent on the implementation, closing a persistent dictionary may
or may not be necessary to flush changes to disk.

Normally, d[key] returns a COPY of the entry.  This needs care when
mutable entries are mutated: for example, if d[key] is a list,
        d[key].append(anitem)
does NOT modify the entry d[key] itself, as stored in the persistent
mapping -- it only modifies the copy, which is then immediately
discarded, so that the append has NO effect whatsoever.  To append an
item to d[key] in a way that will affect the persistent mapping, use:
        data = d[key]
        data.append(anitem)
        d[key] = data

To avoid the problem with mutable entries, you may pass the keyword
argument writeback=True in the call to shelve.open.  When you use:
        d = shelve.open(filename, writeback=True)
then d keeps a cache of all entries you access, and writes them all back
to the persistent mapping when you call d.close().  This ensures that
such usage as d[key].append(anitem) works as intended.

However, using keyword argument writeback=True may consume vast amount
of memory for the cache, and it may make d.close() very slow, if you
access many of d's entries after opening it in this way: d has no way to
check which of the entries you access are mutable and/or which ones you
actually mutate, so it must cache, and write back at close, all of the
entries that you access.  You can call d.sync() to write back all the
entries in the cache, and empty the cache (d.sync() also synchronizes
the persistent dictionary on disk, if feasible).
"""

from pickle import Pickler, Unpickler
from io import BytesIO

import collections.abc

__all__ = ["Shelf", "BsdDbShelf", "DbfilenameShelf", "open"]

class _ClosedDict(collections.abc.MutableMapping):
    'Marker for a closed dict.  Access attempts raise a ValueError.'

    def closed(self, *args):
        raise ValueError('invalid operation on closed shelf')
    __iter__ = __len__ = __getitem__ = __setitem__ = __delitem__ = keys = closed

    def __repr__(self):
        return '<Closed Dictionary>'


class Shelf(collections.abc.MutableMapping):
    """Base class for shelf implementations.

    This is initialized with a dictionary-like object.
    See the module's __doc__ string for an overview of the interface.
    """

    def __init__(self, dict, protocol=None, writeback=False,
                 keyencoding="utf-8"):
        self.dict = dict
        if protocol is None:
            protocol = 3
        self._protocol = protocol
        self.writeback = writeback
        self.cache = {}
        self.keyencoding = keyencoding

    def __iter__(self):
        for k in self.dict.keys():
            yield k.decode(self.keyencoding)

    def __len__(self):
        return len(self.dict)

    def __contains__(self, key):
        return key.encode(self.keyencoding) in self.dict

    def get(self, key, default=None):
        if key.encode(self.keyencoding) in self.dict:
            return self[key]
        return default

    def __getitem__(self, key):
        try:
            value = self.cache[key]
        except KeyError:
            f = BytesIO(self.dict[key.encode(self.keyencoding)])
            value = Unpickler(f).load()
            if self.writeback:
                self.cache[key] = value
        return value

    def __setitem__(self, key, value):
        if self.writeback:
            self.cache[key] = value
        f = BytesIO()
        p = Pickler(f, self._protocol)
        p.dump(value)
        self.dict[key.encode(self.keyencoding)] = f.getvalue()

    def __delitem__(self, key):
        del self.dict[key.encode(self.keyencoding)]
        try:
            del self.cache[key]
        except KeyError:
            pass

    def __enter__(self):
        return self

    def __exit__(self, type, value, traceback):
        self.close()

    def close(self):
        if self.dict is None:
            return
        try:
            self.sync()
            try:
                self.dict.close()
            except AttributeError:
                pass
        finally:
            # Catch errors that may happen when close is called from __del__
            # because CPython is in interpreter shutdown.
            try:
                self.dict = _ClosedDict()
            except:
                self.dict = None

    def __del__(self):
        if not hasattr(self, 'writeback'):
            # __init__ didn't succeed, so don't bother closing
            # see http://bugs.python.org/issue1339007 for details
            return
        self.close()

    def sync(self):
        if self.writeback and self.cache:
            self.writeback = False
            for key, entry in self.cache.items():
                self[key] = entry
            self.writeback = True
            self.cache = {}
        if hasattr(self.dict, 'sync'):
            self.dict.sync()


class BsdDbShelf(Shelf):
    """Shelf implementation using the "BSD" db interface.

    This adds methods first(), next(), previous(), last() and
    set_location() that have no counterpart in [g]dbm databases.

    The actual database must be opened using one of the "bsddb"
    modules "open" routines (i.e. bsddb.hashopen, bsddb.btopen or
    bsddb.rnopen) and passed to the constructor.

    See the module's __doc__ string for an overview of the interface.
    """

    def __init__(self, dict, protocol=None, writeback=False,
                 keyencoding="utf-8"):
        Shelf.__init__(self, dict, protocol, writeback, keyencoding)

    def set_location(self, key):
        (key, value) = self.dict.set_location(key)
        f = BytesIO(value)
        return (key.decode(self.keyencoding), Unpickler(f).load())

    def next(self):
        (key, value) = next(self.dict)
        f = BytesIO(value)
        return (key.decode(self.keyencoding), Unpickler(f).load())

    def previous(self):
        (key, value) = self.dict.previous()
        f = BytesIO(value)
        return (key.decode(self.keyencoding), Unpickler(f).load())

    def first(self):
        (key, value) = self.dict.first()
        f = BytesIO(value)
        return (key.decode(self.keyencoding), Unpickler(f).load())

    def last(self):
        (key, value) = self.dict.last()
        f = BytesIO(value)
        return (key.decode(self.keyencoding), Unpickler(f).load())


class DbfilenameShelf(Shelf):
    """Shelf implementation using the "dbm" generic dbm interface.

    This is initialized with the filename for the dbm database.
    See the module's __doc__ string for an overview of the interface.
    """

    def __init__(self, filename, flag='c', protocol=None, writeback=False):
        import dbm
        Shelf.__init__(self, dbm.open(filename, flag), protocol, writeback)


def open(filename, flag='c', protocol=None, writeback=False):
    """Open a persistent dictionary for reading and writing.

    The filename parameter is the base filename for the underlying
    database.  As a side-effect, an extension may be added to the
    filename and more than one file may be created.  The optional flag
    parameter has the same interpretation as the flag parameter of
    dbm.open(). The optional protocol parameter specifies the
    version of the pickle protocol.

    See the module's __doc__ string for an overview of the interface.
    """

    return DbfilenameShelf(filename, flag, protocol, writeback)
nntplib.py000064400000124375151153537470006613 0ustar00"""An NNTP client class based on:
- RFC 977: Network News Transfer Protocol
- RFC 2980: Common NNTP Extensions
- RFC 3977: Network News Transfer Protocol (version 2)

Example:

>>> from nntplib import NNTP
>>> s = NNTP('news')
>>> resp, count, first, last, name = s.group('comp.lang.python')
>>> print('Group', name, 'has', count, 'articles, range', first, 'to', last)
Group comp.lang.python has 51 articles, range 5770 to 5821
>>> resp, subs = s.xhdr('subject', '{0}-{1}'.format(first, last))
>>> resp = s.quit()
>>>

Here 'resp' is the server response line.
Error responses are turned into exceptions.

To post an article from a file:
>>> f = open(filename, 'rb') # file containing article, including header
>>> resp = s.post(f)
>>>

For descriptions of all methods, read the comments in the code below.
Note that all arguments and return values representing article numbers
are strings, not numbers, since they are rarely used for calculations.
"""

# RFC 977 by Brian Kantor and Phil Lapsley.
# xover, xgtitle, xpath, date methods by Kevan Heydon

# Incompatible changes from the 2.x nntplib:
# - all commands are encoded as UTF-8 data (using the "surrogateescape"
#   error handler), except for raw message data (POST, IHAVE)
# - all responses are decoded as UTF-8 data (using the "surrogateescape"
#   error handler), except for raw message data (ARTICLE, HEAD, BODY)
# - the `file` argument to various methods is keyword-only
#
# - NNTP.date() returns a datetime object
# - NNTP.newgroups() and NNTP.newnews() take a datetime (or date) object,
#   rather than a pair of (date, time) strings.
# - NNTP.newgroups() and NNTP.list() return a list of GroupInfo named tuples
# - NNTP.descriptions() returns a dict mapping group names to descriptions
# - NNTP.xover() returns a list of dicts mapping field names (header or metadata)
#   to field values; each dict representing a message overview.
# - NNTP.article(), NNTP.head() and NNTP.body() return a (response, ArticleInfo)
#   tuple.
# - the "internal" methods have been marked private (they now start with
#   an underscore)

# Other changes from the 2.x/3.1 nntplib:
# - automatic querying of capabilities at connect
# - New method NNTP.getcapabilities()
# - New method NNTP.over()
# - New helper function decode_header()
# - NNTP.post() and NNTP.ihave() accept file objects, bytes-like objects and
#   arbitrary iterables yielding lines.
# - An extensive test suite :-)

# TODO:
# - return structured data (GroupInfo etc.) everywhere
# - support HDR

# Imports
import re
import socket
import collections
import datetime
import warnings
import sys

try:
    import ssl
except ImportError:
    _have_ssl = False
else:
    _have_ssl = True

from email.header import decode_header as _email_decode_header
from socket import _GLOBAL_DEFAULT_TIMEOUT

__all__ = ["NNTP",
           "NNTPError", "NNTPReplyError", "NNTPTemporaryError",
           "NNTPPermanentError", "NNTPProtocolError", "NNTPDataError",
           "decode_header",
           ]

# maximal line length when calling readline(). This is to prevent
# reading arbitrary length lines. RFC 3977 limits NNTP line length to
# 512 characters, including CRLF. We have selected 2048 just to be on
# the safe side.
_MAXLINE = 2048


# Exceptions raised when an error or invalid response is received
class NNTPError(Exception):
    """Base class for all nntplib exceptions"""
    def __init__(self, *args):
        Exception.__init__(self, *args)
        try:
            self.response = args[0]
        except IndexError:
            self.response = 'No response given'

class NNTPReplyError(NNTPError):
    """Unexpected [123]xx reply"""
    pass

class NNTPTemporaryError(NNTPError):
    """4xx errors"""
    pass

class NNTPPermanentError(NNTPError):
    """5xx errors"""
    pass

class NNTPProtocolError(NNTPError):
    """Response does not begin with [1-5]"""
    pass

class NNTPDataError(NNTPError):
    """Error in response data"""
    pass


# Standard port used by NNTP servers
NNTP_PORT = 119
NNTP_SSL_PORT = 563

# Response numbers that are followed by additional text (e.g. article)
_LONGRESP = {
    '100',   # HELP
    '101',   # CAPABILITIES
    '211',   # LISTGROUP   (also not multi-line with GROUP)
    '215',   # LIST
    '220',   # ARTICLE
    '221',   # HEAD, XHDR
    '222',   # BODY
    '224',   # OVER, XOVER
    '225',   # HDR
    '230',   # NEWNEWS
    '231',   # NEWGROUPS
    '282',   # XGTITLE
}

# Default decoded value for LIST OVERVIEW.FMT if not supported
_DEFAULT_OVERVIEW_FMT = [
    "subject", "from", "date", "message-id", "references", ":bytes", ":lines"]

# Alternative names allowed in LIST OVERVIEW.FMT response
_OVERVIEW_FMT_ALTERNATIVES = {
    'bytes': ':bytes',
    'lines': ':lines',
}

# Line terminators (we always output CRLF, but accept any of CRLF, CR, LF)
_CRLF = b'\r\n'

GroupInfo = collections.namedtuple('GroupInfo',
                                   ['group', 'last', 'first', 'flag'])

ArticleInfo = collections.namedtuple('ArticleInfo',
                                     ['number', 'message_id', 'lines'])


# Helper function(s)
def decode_header(header_str):
    """Takes a unicode string representing a munged header value
    and decodes it as a (possibly non-ASCII) readable value."""
    parts = []
    for v, enc in _email_decode_header(header_str):
        if isinstance(v, bytes):
            parts.append(v.decode(enc or 'ascii'))
        else:
            parts.append(v)
    return ''.join(parts)

def _parse_overview_fmt(lines):
    """Parse a list of string representing the response to LIST OVERVIEW.FMT
    and return a list of header/metadata names.
    Raises NNTPDataError if the response is not compliant
    (cf. RFC 3977, section 8.4)."""
    fmt = []
    for line in lines:
        if line[0] == ':':
            # Metadata name (e.g. ":bytes")
            name, _, suffix = line[1:].partition(':')
            name = ':' + name
        else:
            # Header name (e.g. "Subject:" or "Xref:full")
            name, _, suffix = line.partition(':')
        name = name.lower()
        name = _OVERVIEW_FMT_ALTERNATIVES.get(name, name)
        # Should we do something with the suffix?
        fmt.append(name)
    defaults = _DEFAULT_OVERVIEW_FMT
    if len(fmt) < len(defaults):
        raise NNTPDataError("LIST OVERVIEW.FMT response too short")
    if fmt[:len(defaults)] != defaults:
        raise NNTPDataError("LIST OVERVIEW.FMT redefines default fields")
    return fmt

def _parse_overview(lines, fmt, data_process_func=None):
    """Parse the response to an OVER or XOVER command according to the
    overview format `fmt`."""
    n_defaults = len(_DEFAULT_OVERVIEW_FMT)
    overview = []
    for line in lines:
        fields = {}
        article_number, *tokens = line.split('\t')
        article_number = int(article_number)
        for i, token in enumerate(tokens):
            if i >= len(fmt):
                # XXX should we raise an error? Some servers might not
                # support LIST OVERVIEW.FMT and still return additional
                # headers.
                continue
            field_name = fmt[i]
            is_metadata = field_name.startswith(':')
            if i >= n_defaults and not is_metadata:
                # Non-default header names are included in full in the response
                # (unless the field is totally empty)
                h = field_name + ": "
                if token and token[:len(h)].lower() != h:
                    raise NNTPDataError("OVER/XOVER response doesn't include "
                                        "names of additional headers")
                token = token[len(h):] if token else None
            fields[fmt[i]] = token
        overview.append((article_number, fields))
    return overview

def _parse_datetime(date_str, time_str=None):
    """Parse a pair of (date, time) strings, and return a datetime object.
    If only the date is given, it is assumed to be date and time
    concatenated together (e.g. response to the DATE command).
    """
    if time_str is None:
        time_str = date_str[-6:]
        date_str = date_str[:-6]
    hours = int(time_str[:2])
    minutes = int(time_str[2:4])
    seconds = int(time_str[4:])
    year = int(date_str[:-4])
    month = int(date_str[-4:-2])
    day = int(date_str[-2:])
    # RFC 3977 doesn't say how to interpret 2-char years.  Assume that
    # there are no dates before 1970 on Usenet.
    if year < 70:
        year += 2000
    elif year < 100:
        year += 1900
    return datetime.datetime(year, month, day, hours, minutes, seconds)

def _unparse_datetime(dt, legacy=False):
    """Format a date or datetime object as a pair of (date, time) strings
    in the format required by the NEWNEWS and NEWGROUPS commands.  If a
    date object is passed, the time is assumed to be midnight (00h00).

    The returned representation depends on the legacy flag:
    * if legacy is False (the default):
      date has the YYYYMMDD format and time the HHMMSS format
    * if legacy is True:
      date has the YYMMDD format and time the HHMMSS format.
    RFC 3977 compliant servers should understand both formats; therefore,
    legacy is only needed when talking to old servers.
    """
    if not isinstance(dt, datetime.datetime):
        time_str = "000000"
    else:
        time_str = "{0.hour:02d}{0.minute:02d}{0.second:02d}".format(dt)
    y = dt.year
    if legacy:
        y = y % 100
        date_str = "{0:02d}{1.month:02d}{1.day:02d}".format(y, dt)
    else:
        date_str = "{0:04d}{1.month:02d}{1.day:02d}".format(y, dt)
    return date_str, time_str


if _have_ssl:

    def _encrypt_on(sock, context, hostname):
        """Wrap a socket in SSL/TLS. Arguments:
        - sock: Socket to wrap
        - context: SSL context to use for the encrypted connection
        Returns:
        - sock: New, encrypted socket.
        """
        # Generate a default SSL context if none was passed.
        if context is None:
            context = ssl._create_stdlib_context()
        return context.wrap_socket(sock, server_hostname=hostname)


# The classes themselves
class _NNTPBase:
    # UTF-8 is the character set for all NNTP commands and responses: they
    # are automatically encoded (when sending) and decoded (and receiving)
    # by this class.
    # However, some multi-line data blocks can contain arbitrary bytes (for
    # example, latin-1 or utf-16 data in the body of a message). Commands
    # taking (POST, IHAVE) or returning (HEAD, BODY, ARTICLE) raw message
    # data will therefore only accept and produce bytes objects.
    # Furthermore, since there could be non-compliant servers out there,
    # we use 'surrogateescape' as the error handler for fault tolerance
    # and easy round-tripping. This could be useful for some applications
    # (e.g. NNTP gateways).

    encoding = 'utf-8'
    errors = 'surrogateescape'

    def __init__(self, file, host,
                 readermode=None, timeout=_GLOBAL_DEFAULT_TIMEOUT):
        """Initialize an instance.  Arguments:
        - file: file-like object (open for read/write in binary mode)
        - host: hostname of the server
        - readermode: if true, send 'mode reader' command after
                      connecting.
        - timeout: timeout (in seconds) used for socket connections

        readermode is sometimes necessary if you are connecting to an
        NNTP server on the local machine and intend to call
        reader-specific commands, such as `group'.  If you get
        unexpected NNTPPermanentErrors, you might need to set
        readermode.
        """
        self.host = host
        self.file = file
        self.debugging = 0
        self.welcome = self._getresp()

        # Inquire about capabilities (RFC 3977).
        self._caps = None
        self.getcapabilities()

        # 'MODE READER' is sometimes necessary to enable 'reader' mode.
        # However, the order in which 'MODE READER' and 'AUTHINFO' need to
        # arrive differs between some NNTP servers. If _setreadermode() fails
        # with an authorization failed error, it will set this to True;
        # the login() routine will interpret that as a request to try again
        # after performing its normal function.
        # Enable only if we're not already in READER mode anyway.
        self.readermode_afterauth = False
        if readermode and 'READER' not in self._caps:
            self._setreadermode()
            if not self.readermode_afterauth:
                # Capabilities might have changed after MODE READER
                self._caps = None
                self.getcapabilities()

        # RFC 4642 2.2.2: Both the client and the server MUST know if there is
        # a TLS session active.  A client MUST NOT attempt to start a TLS
        # session if a TLS session is already active.
        self.tls_on = False

        # Log in and encryption setup order is left to subclasses.
        self.authenticated = False

    def __enter__(self):
        return self

    def __exit__(self, *args):
        is_connected = lambda: hasattr(self, "file")
        if is_connected():
            try:
                self.quit()
            except (OSError, EOFError):
                pass
            finally:
                if is_connected():
                    self._close()

    def getwelcome(self):
        """Get the welcome message from the server
        (this is read and squirreled away by __init__()).
        If the response code is 200, posting is allowed;
        if it 201, posting is not allowed."""

        if self.debugging: print('*welcome*', repr(self.welcome))
        return self.welcome

    def getcapabilities(self):
        """Get the server capabilities, as read by __init__().
        If the CAPABILITIES command is not supported, an empty dict is
        returned."""
        if self._caps is None:
            self.nntp_version = 1
            self.nntp_implementation = None
            try:
                resp, caps = self.capabilities()
            except (NNTPPermanentError, NNTPTemporaryError):
                # Server doesn't support capabilities
                self._caps = {}
            else:
                self._caps = caps
                if 'VERSION' in caps:
                    # The server can advertise several supported versions,
                    # choose the highest.
                    self.nntp_version = max(map(int, caps['VERSION']))
                if 'IMPLEMENTATION' in caps:
                    self.nntp_implementation = ' '.join(caps['IMPLEMENTATION'])
        return self._caps

    def set_debuglevel(self, level):
        """Set the debugging level.  Argument 'level' means:
        0: no debugging output (default)
        1: print commands and responses but not body text etc.
        2: also print raw lines read and sent before stripping CR/LF"""

        self.debugging = level
    debug = set_debuglevel

    def _putline(self, line):
        """Internal: send one line to the server, appending CRLF.
        The `line` must be a bytes-like object."""
        sys.audit("nntplib.putline", self, line)
        line = line + _CRLF
        if self.debugging > 1: print('*put*', repr(line))
        self.file.write(line)
        self.file.flush()

    def _putcmd(self, line):
        """Internal: send one command to the server (through _putline()).
        The `line` must be a unicode string."""
        if self.debugging: print('*cmd*', repr(line))
        line = line.encode(self.encoding, self.errors)
        self._putline(line)

    def _getline(self, strip_crlf=True):
        """Internal: return one line from the server, stripping _CRLF.
        Raise EOFError if the connection is closed.
        Returns a bytes object."""
        line = self.file.readline(_MAXLINE +1)
        if len(line) > _MAXLINE:
            raise NNTPDataError('line too long')
        if self.debugging > 1:
            print('*get*', repr(line))
        if not line: raise EOFError
        if strip_crlf:
            if line[-2:] == _CRLF:
                line = line[:-2]
            elif line[-1:] in _CRLF:
                line = line[:-1]
        return line

    def _getresp(self):
        """Internal: get a response from the server.
        Raise various errors if the response indicates an error.
        Returns a unicode string."""
        resp = self._getline()
        if self.debugging: print('*resp*', repr(resp))
        resp = resp.decode(self.encoding, self.errors)
        c = resp[:1]
        if c == '4':
            raise NNTPTemporaryError(resp)
        if c == '5':
            raise NNTPPermanentError(resp)
        if c not in '123':
            raise NNTPProtocolError(resp)
        return resp

    def _getlongresp(self, file=None):
        """Internal: get a response plus following text from the server.
        Raise various errors if the response indicates an error.

        Returns a (response, lines) tuple where `response` is a unicode
        string and `lines` is a list of bytes objects.
        If `file` is a file-like object, it must be open in binary mode.
        """

        openedFile = None
        try:
            # If a string was passed then open a file with that name
            if isinstance(file, (str, bytes)):
                openedFile = file = open(file, "wb")

            resp = self._getresp()
            if resp[:3] not in _LONGRESP:
                raise NNTPReplyError(resp)

            lines = []
            if file is not None:
                # XXX lines = None instead?
                terminators = (b'.' + _CRLF, b'.\n')
                while 1:
                    line = self._getline(False)
                    if line in terminators:
                        break
                    if line.startswith(b'..'):
                        line = line[1:]
                    file.write(line)
            else:
                terminator = b'.'
                while 1:
                    line = self._getline()
                    if line == terminator:
                        break
                    if line.startswith(b'..'):
                        line = line[1:]
                    lines.append(line)
        finally:
            # If this method created the file, then it must close it
            if openedFile:
                openedFile.close()

        return resp, lines

    def _shortcmd(self, line):
        """Internal: send a command and get the response.
        Same return value as _getresp()."""
        self._putcmd(line)
        return self._getresp()

    def _longcmd(self, line, file=None):
        """Internal: send a command and get the response plus following text.
        Same return value as _getlongresp()."""
        self._putcmd(line)
        return self._getlongresp(file)

    def _longcmdstring(self, line, file=None):
        """Internal: send a command and get the response plus following text.
        Same as _longcmd() and _getlongresp(), except that the returned `lines`
        are unicode strings rather than bytes objects.
        """
        self._putcmd(line)
        resp, list = self._getlongresp(file)
        return resp, [line.decode(self.encoding, self.errors)
                      for line in list]

    def _getoverviewfmt(self):
        """Internal: get the overview format. Queries the server if not
        already done, else returns the cached value."""
        try:
            return self._cachedoverviewfmt
        except AttributeError:
            pass
        try:
            resp, lines = self._longcmdstring("LIST OVERVIEW.FMT")
        except NNTPPermanentError:
            # Not supported by server?
            fmt = _DEFAULT_OVERVIEW_FMT[:]
        else:
            fmt = _parse_overview_fmt(lines)
        self._cachedoverviewfmt = fmt
        return fmt

    def _grouplist(self, lines):
        # Parse lines into "group last first flag"
        return [GroupInfo(*line.split()) for line in lines]

    def capabilities(self):
        """Process a CAPABILITIES command.  Not supported by all servers.
        Return:
        - resp: server response if successful
        - caps: a dictionary mapping capability names to lists of tokens
        (for example {'VERSION': ['2'], 'OVER': [], LIST: ['ACTIVE', 'HEADERS'] })
        """
        caps = {}
        resp, lines = self._longcmdstring("CAPABILITIES")
        for line in lines:
            name, *tokens = line.split()
            caps[name] = tokens
        return resp, caps

    def newgroups(self, date, *, file=None):
        """Process a NEWGROUPS command.  Arguments:
        - date: a date or datetime object
        Return:
        - resp: server response if successful
        - list: list of newsgroup names
        """
        if not isinstance(date, (datetime.date, datetime.date)):
            raise TypeError(
                "the date parameter must be a date or datetime object, "
                "not '{:40}'".format(date.__class__.__name__))
        date_str, time_str = _unparse_datetime(date, self.nntp_version < 2)
        cmd = 'NEWGROUPS {0} {1}'.format(date_str, time_str)
        resp, lines = self._longcmdstring(cmd, file)
        return resp, self._grouplist(lines)

    def newnews(self, group, date, *, file=None):
        """Process a NEWNEWS command.  Arguments:
        - group: group name or '*'
        - date: a date or datetime object
        Return:
        - resp: server response if successful
        - list: list of message ids
        """
        if not isinstance(date, (datetime.date, datetime.date)):
            raise TypeError(
                "the date parameter must be a date or datetime object, "
                "not '{:40}'".format(date.__class__.__name__))
        date_str, time_str = _unparse_datetime(date, self.nntp_version < 2)
        cmd = 'NEWNEWS {0} {1} {2}'.format(group, date_str, time_str)
        return self._longcmdstring(cmd, file)

    def list(self, group_pattern=None, *, file=None):
        """Process a LIST or LIST ACTIVE command. Arguments:
        - group_pattern: a pattern indicating which groups to query
        - file: Filename string or file object to store the result in
        Returns:
        - resp: server response if successful
        - list: list of (group, last, first, flag) (strings)
        """
        if group_pattern is not None:
            command = 'LIST ACTIVE ' + group_pattern
        else:
            command = 'LIST'
        resp, lines = self._longcmdstring(command, file)
        return resp, self._grouplist(lines)

    def _getdescriptions(self, group_pattern, return_all):
        line_pat = re.compile('^(?P<group>[^ \t]+)[ \t]+(.*)$')
        # Try the more std (acc. to RFC2980) LIST NEWSGROUPS first
        resp, lines = self._longcmdstring('LIST NEWSGROUPS ' + group_pattern)
        if not resp.startswith('215'):
            # Now the deprecated XGTITLE.  This either raises an error
            # or succeeds with the same output structure as LIST
            # NEWSGROUPS.
            resp, lines = self._longcmdstring('XGTITLE ' + group_pattern)
        groups = {}
        for raw_line in lines:
            match = line_pat.search(raw_line.strip())
            if match:
                name, desc = match.group(1, 2)
                if not return_all:
                    return desc
                groups[name] = desc
        if return_all:
            return resp, groups
        else:
            # Nothing found
            return ''

    def description(self, group):
        """Get a description for a single group.  If more than one
        group matches ('group' is a pattern), return the first.  If no
        group matches, return an empty string.

        This elides the response code from the server, since it can
        only be '215' or '285' (for xgtitle) anyway.  If the response
        code is needed, use the 'descriptions' method.

        NOTE: This neither checks for a wildcard in 'group' nor does
        it check whether the group actually exists."""
        return self._getdescriptions(group, False)

    def descriptions(self, group_pattern):
        """Get descriptions for a range of groups."""
        return self._getdescriptions(group_pattern, True)

    def group(self, name):
        """Process a GROUP command.  Argument:
        - group: the group name
        Returns:
        - resp: server response if successful
        - count: number of articles
        - first: first article number
        - last: last article number
        - name: the group name
        """
        resp = self._shortcmd('GROUP ' + name)
        if not resp.startswith('211'):
            raise NNTPReplyError(resp)
        words = resp.split()
        count = first = last = 0
        n = len(words)
        if n > 1:
            count = words[1]
            if n > 2:
                first = words[2]
                if n > 3:
                    last = words[3]
                    if n > 4:
                        name = words[4].lower()
        return resp, int(count), int(first), int(last), name

    def help(self, *, file=None):
        """Process a HELP command. Argument:
        - file: Filename string or file object to store the result in
        Returns:
        - resp: server response if successful
        - list: list of strings returned by the server in response to the
                HELP command
        """
        return self._longcmdstring('HELP', file)

    def _statparse(self, resp):
        """Internal: parse the response line of a STAT, NEXT, LAST,
        ARTICLE, HEAD or BODY command."""
        if not resp.startswith('22'):
            raise NNTPReplyError(resp)
        words = resp.split()
        art_num = int(words[1])
        message_id = words[2]
        return resp, art_num, message_id

    def _statcmd(self, line):
        """Internal: process a STAT, NEXT or LAST command."""
        resp = self._shortcmd(line)
        return self._statparse(resp)

    def stat(self, message_spec=None):
        """Process a STAT command.  Argument:
        - message_spec: article number or message id (if not specified,
          the current article is selected)
        Returns:
        - resp: server response if successful
        - art_num: the article number
        - message_id: the message id
        """
        if message_spec:
            return self._statcmd('STAT {0}'.format(message_spec))
        else:
            return self._statcmd('STAT')

    def next(self):
        """Process a NEXT command.  No arguments.  Return as for STAT."""
        return self._statcmd('NEXT')

    def last(self):
        """Process a LAST command.  No arguments.  Return as for STAT."""
        return self._statcmd('LAST')

    def _artcmd(self, line, file=None):
        """Internal: process a HEAD, BODY or ARTICLE command."""
        resp, lines = self._longcmd(line, file)
        resp, art_num, message_id = self._statparse(resp)
        return resp, ArticleInfo(art_num, message_id, lines)

    def head(self, message_spec=None, *, file=None):
        """Process a HEAD command.  Argument:
        - message_spec: article number or message id
        - file: filename string or file object to store the headers in
        Returns:
        - resp: server response if successful
        - ArticleInfo: (article number, message id, list of header lines)
        """
        if message_spec is not None:
            cmd = 'HEAD {0}'.format(message_spec)
        else:
            cmd = 'HEAD'
        return self._artcmd(cmd, file)

    def body(self, message_spec=None, *, file=None):
        """Process a BODY command.  Argument:
        - message_spec: article number or message id
        - file: filename string or file object to store the body in
        Returns:
        - resp: server response if successful
        - ArticleInfo: (article number, message id, list of body lines)
        """
        if message_spec is not None:
            cmd = 'BODY {0}'.format(message_spec)
        else:
            cmd = 'BODY'
        return self._artcmd(cmd, file)

    def article(self, message_spec=None, *, file=None):
        """Process an ARTICLE command.  Argument:
        - message_spec: article number or message id
        - file: filename string or file object to store the article in
        Returns:
        - resp: server response if successful
        - ArticleInfo: (article number, message id, list of article lines)
        """
        if message_spec is not None:
            cmd = 'ARTICLE {0}'.format(message_spec)
        else:
            cmd = 'ARTICLE'
        return self._artcmd(cmd, file)

    def slave(self):
        """Process a SLAVE command.  Returns:
        - resp: server response if successful
        """
        return self._shortcmd('SLAVE')

    def xhdr(self, hdr, str, *, file=None):
        """Process an XHDR command (optional server extension).  Arguments:
        - hdr: the header type (e.g. 'subject')
        - str: an article nr, a message id, or a range nr1-nr2
        - file: Filename string or file object to store the result in
        Returns:
        - resp: server response if successful
        - list: list of (nr, value) strings
        """
        pat = re.compile('^([0-9]+) ?(.*)\n?')
        resp, lines = self._longcmdstring('XHDR {0} {1}'.format(hdr, str), file)
        def remove_number(line):
            m = pat.match(line)
            return m.group(1, 2) if m else line
        return resp, [remove_number(line) for line in lines]

    def xover(self, start, end, *, file=None):
        """Process an XOVER command (optional server extension) Arguments:
        - start: start of range
        - end: end of range
        - file: Filename string or file object to store the result in
        Returns:
        - resp: server response if successful
        - list: list of dicts containing the response fields
        """
        resp, lines = self._longcmdstring('XOVER {0}-{1}'.format(start, end),
                                          file)
        fmt = self._getoverviewfmt()
        return resp, _parse_overview(lines, fmt)

    def over(self, message_spec, *, file=None):
        """Process an OVER command.  If the command isn't supported, fall
        back to XOVER. Arguments:
        - message_spec:
            - either a message id, indicating the article to fetch
              information about
            - or a (start, end) tuple, indicating a range of article numbers;
              if end is None, information up to the newest message will be
              retrieved
            - or None, indicating the current article number must be used
        - file: Filename string or file object to store the result in
        Returns:
        - resp: server response if successful
        - list: list of dicts containing the response fields

        NOTE: the "message id" form isn't supported by XOVER
        """
        cmd = 'OVER' if 'OVER' in self._caps else 'XOVER'
        if isinstance(message_spec, (tuple, list)):
            start, end = message_spec
            cmd += ' {0}-{1}'.format(start, end or '')
        elif message_spec is not None:
            cmd = cmd + ' ' + message_spec
        resp, lines = self._longcmdstring(cmd, file)
        fmt = self._getoverviewfmt()
        return resp, _parse_overview(lines, fmt)

    def xgtitle(self, group, *, file=None):
        """Process an XGTITLE command (optional server extension) Arguments:
        - group: group name wildcard (i.e. news.*)
        Returns:
        - resp: server response if successful
        - list: list of (name,title) strings"""
        warnings.warn("The XGTITLE extension is not actively used, "
                      "use descriptions() instead",
                      DeprecationWarning, 2)
        line_pat = re.compile('^([^ \t]+)[ \t]+(.*)$')
        resp, raw_lines = self._longcmdstring('XGTITLE ' + group, file)
        lines = []
        for raw_line in raw_lines:
            match = line_pat.search(raw_line.strip())
            if match:
                lines.append(match.group(1, 2))
        return resp, lines

    def xpath(self, id):
        """Process an XPATH command (optional server extension) Arguments:
        - id: Message id of article
        Returns:
        resp: server response if successful
        path: directory path to article
        """
        warnings.warn("The XPATH extension is not actively used",
                      DeprecationWarning, 2)

        resp = self._shortcmd('XPATH {0}'.format(id))
        if not resp.startswith('223'):
            raise NNTPReplyError(resp)
        try:
            [resp_num, path] = resp.split()
        except ValueError:
            raise NNTPReplyError(resp) from None
        else:
            return resp, path

    def date(self):
        """Process the DATE command.
        Returns:
        - resp: server response if successful
        - date: datetime object
        """
        resp = self._shortcmd("DATE")
        if not resp.startswith('111'):
            raise NNTPReplyError(resp)
        elem = resp.split()
        if len(elem) != 2:
            raise NNTPDataError(resp)
        date = elem[1]
        if len(date) != 14:
            raise NNTPDataError(resp)
        return resp, _parse_datetime(date, None)

    def _post(self, command, f):
        resp = self._shortcmd(command)
        # Raises a specific exception if posting is not allowed
        if not resp.startswith('3'):
            raise NNTPReplyError(resp)
        if isinstance(f, (bytes, bytearray)):
            f = f.splitlines()
        # We don't use _putline() because:
        # - we don't want additional CRLF if the file or iterable is already
        #   in the right format
        # - we don't want a spurious flush() after each line is written
        for line in f:
            if not line.endswith(_CRLF):
                line = line.rstrip(b"\r\n") + _CRLF
            if line.startswith(b'.'):
                line = b'.' + line
            self.file.write(line)
        self.file.write(b".\r\n")
        self.file.flush()
        return self._getresp()

    def post(self, data):
        """Process a POST command.  Arguments:
        - data: bytes object, iterable or file containing the article
        Returns:
        - resp: server response if successful"""
        return self._post('POST', data)

    def ihave(self, message_id, data):
        """Process an IHAVE command.  Arguments:
        - message_id: message-id of the article
        - data: file containing the article
        Returns:
        - resp: server response if successful
        Note that if the server refuses the article an exception is raised."""
        return self._post('IHAVE {0}'.format(message_id), data)

    def _close(self):
        self.file.close()
        del self.file

    def quit(self):
        """Process a QUIT command and close the socket.  Returns:
        - resp: server response if successful"""
        try:
            resp = self._shortcmd('QUIT')
        finally:
            self._close()
        return resp

    def login(self, user=None, password=None, usenetrc=True):
        if self.authenticated:
            raise ValueError("Already logged in.")
        if not user and not usenetrc:
            raise ValueError(
                "At least one of `user` and `usenetrc` must be specified")
        # If no login/password was specified but netrc was requested,
        # try to get them from ~/.netrc
        # Presume that if .netrc has an entry, NNRP authentication is required.
        try:
            if usenetrc and not user:
                import netrc
                credentials = netrc.netrc()
                auth = credentials.authenticators(self.host)
                if auth:
                    user = auth[0]
                    password = auth[2]
        except OSError:
            pass
        # Perform NNTP authentication if needed.
        if not user:
            return
        resp = self._shortcmd('authinfo user ' + user)
        if resp.startswith('381'):
            if not password:
                raise NNTPReplyError(resp)
            else:
                resp = self._shortcmd('authinfo pass ' + password)
                if not resp.startswith('281'):
                    raise NNTPPermanentError(resp)
        # Capabilities might have changed after login
        self._caps = None
        self.getcapabilities()
        # Attempt to send mode reader if it was requested after login.
        # Only do so if we're not in reader mode already.
        if self.readermode_afterauth and 'READER' not in self._caps:
            self._setreadermode()
            # Capabilities might have changed after MODE READER
            self._caps = None
            self.getcapabilities()

    def _setreadermode(self):
        try:
            self.welcome = self._shortcmd('mode reader')
        except NNTPPermanentError:
            # Error 5xx, probably 'not implemented'
            pass
        except NNTPTemporaryError as e:
            if e.response.startswith('480'):
                # Need authorization before 'mode reader'
                self.readermode_afterauth = True
            else:
                raise

    if _have_ssl:
        def starttls(self, context=None):
            """Process a STARTTLS command. Arguments:
            - context: SSL context to use for the encrypted connection
            """
            # Per RFC 4642, STARTTLS MUST NOT be sent after authentication or if
            # a TLS session already exists.
            if self.tls_on:
                raise ValueError("TLS is already enabled.")
            if self.authenticated:
                raise ValueError("TLS cannot be started after authentication.")
            resp = self._shortcmd('STARTTLS')
            if resp.startswith('382'):
                self.file.close()
                self.sock = _encrypt_on(self.sock, context, self.host)
                self.file = self.sock.makefile("rwb")
                self.tls_on = True
                # Capabilities may change after TLS starts up, so ask for them
                # again.
                self._caps = None
                self.getcapabilities()
            else:
                raise NNTPError("TLS failed to start.")


class NNTP(_NNTPBase):

    def __init__(self, host, port=NNTP_PORT, user=None, password=None,
                 readermode=None, usenetrc=False,
                 timeout=_GLOBAL_DEFAULT_TIMEOUT):
        """Initialize an instance.  Arguments:
        - host: hostname to connect to
        - port: port to connect to (default the standard NNTP port)
        - user: username to authenticate with
        - password: password to use with username
        - readermode: if true, send 'mode reader' command after
                      connecting.
        - usenetrc: allow loading username and password from ~/.netrc file
                    if not specified explicitly
        - timeout: timeout (in seconds) used for socket connections

        readermode is sometimes necessary if you are connecting to an
        NNTP server on the local machine and intend to call
        reader-specific commands, such as `group'.  If you get
        unexpected NNTPPermanentErrors, you might need to set
        readermode.
        """
        self.host = host
        self.port = port
        sys.audit("nntplib.connect", self, host, port)
        self.sock = socket.create_connection((host, port), timeout)
        file = None
        try:
            file = self.sock.makefile("rwb")
            _NNTPBase.__init__(self, file, host,
                               readermode, timeout)
            if user or usenetrc:
                self.login(user, password, usenetrc)
        except:
            if file:
                file.close()
            self.sock.close()
            raise

    def _close(self):
        try:
            _NNTPBase._close(self)
        finally:
            self.sock.close()


if _have_ssl:
    class NNTP_SSL(_NNTPBase):

        def __init__(self, host, port=NNTP_SSL_PORT,
                    user=None, password=None, ssl_context=None,
                    readermode=None, usenetrc=False,
                    timeout=_GLOBAL_DEFAULT_TIMEOUT):
            """This works identically to NNTP.__init__, except for the change
            in default port and the `ssl_context` argument for SSL connections.
            """
            sys.audit("nntplib.connect", self, host, port)
            self.sock = socket.create_connection((host, port), timeout)
            file = None
            try:
                self.sock = _encrypt_on(self.sock, ssl_context, host)
                file = self.sock.makefile("rwb")
                _NNTPBase.__init__(self, file, host,
                                   readermode=readermode, timeout=timeout)
                if user or usenetrc:
                    self.login(user, password, usenetrc)
            except:
                if file:
                    file.close()
                self.sock.close()
                raise

        def _close(self):
            try:
                _NNTPBase._close(self)
            finally:
                self.sock.close()

    __all__.append("NNTP_SSL")


# Test retrieval when run as a script.
if __name__ == '__main__':
    import argparse

    parser = argparse.ArgumentParser(description="""\
        nntplib built-in demo - display the latest articles in a newsgroup""")
    parser.add_argument('-g', '--group', default='gmane.comp.python.general',
                        help='group to fetch messages from (default: %(default)s)')
    parser.add_argument('-s', '--server', default='news.gmane.io',
                        help='NNTP server hostname (default: %(default)s)')
    parser.add_argument('-p', '--port', default=-1, type=int,
                        help='NNTP port number (default: %s / %s)' % (NNTP_PORT, NNTP_SSL_PORT))
    parser.add_argument('-n', '--nb-articles', default=10, type=int,
                        help='number of articles to fetch (default: %(default)s)')
    parser.add_argument('-S', '--ssl', action='store_true', default=False,
                        help='use NNTP over SSL')
    args = parser.parse_args()

    port = args.port
    if not args.ssl:
        if port == -1:
            port = NNTP_PORT
        s = NNTP(host=args.server, port=port)
    else:
        if port == -1:
            port = NNTP_SSL_PORT
        s = NNTP_SSL(host=args.server, port=port)

    caps = s.getcapabilities()
    if 'STARTTLS' in caps:
        s.starttls()
    resp, count, first, last, name = s.group(args.group)
    print('Group', name, 'has', count, 'articles, range', first, 'to', last)

    def cut(s, lim):
        if len(s) > lim:
            s = s[:lim - 4] + "..."
        return s

    first = str(int(last) - args.nb_articles + 1)
    resp, overviews = s.xover(first, last)
    for artnum, over in overviews:
        author = decode_header(over['from']).split('<', 1)[0]
        subject = decode_header(over['subject'])
        lines = int(over[':lines'])
        print("{:7} {:20} {:42} ({})".format(
              artnum, cut(author, 20), cut(subject, 42), lines)
              )

    s.quit()
_dummy_thread.py000064400000013613151153537470007756 0ustar00"""Drop-in replacement for the thread module.

Meant to be used as a brain-dead substitute so that threaded code does
not need to be rewritten for when the thread module is not present.

Suggested usage is::

    try:
        import _thread
    except ImportError:
        import _dummy_thread as _thread

"""
# Exports only things specified by thread documentation;
# skipping obsolete synonyms allocate(), start_new(), exit_thread().
__all__ = ['error', 'start_new_thread', 'exit', 'get_ident', 'allocate_lock',
           'interrupt_main', 'LockType', 'RLock']

# A dummy value
TIMEOUT_MAX = 2**31

# NOTE: this module can be imported early in the extension building process,
# and so top level imports of other modules should be avoided.  Instead, all
# imports are done when needed on a function-by-function basis.  Since threads
# are disabled, the import lock should not be an issue anyway (??).

error = RuntimeError

def start_new_thread(function, args, kwargs={}):
    """Dummy implementation of _thread.start_new_thread().

    Compatibility is maintained by making sure that ``args`` is a
    tuple and ``kwargs`` is a dictionary.  If an exception is raised
    and it is SystemExit (which can be done by _thread.exit()) it is
    caught and nothing is done; all other exceptions are printed out
    by using traceback.print_exc().

    If the executed function calls interrupt_main the KeyboardInterrupt will be
    raised when the function returns.

    """
    if type(args) != type(tuple()):
        raise TypeError("2nd arg must be a tuple")
    if type(kwargs) != type(dict()):
        raise TypeError("3rd arg must be a dict")
    global _main
    _main = False
    try:
        function(*args, **kwargs)
    except SystemExit:
        pass
    except:
        import traceback
        traceback.print_exc()
    _main = True
    global _interrupt
    if _interrupt:
        _interrupt = False
        raise KeyboardInterrupt

def exit():
    """Dummy implementation of _thread.exit()."""
    raise SystemExit

def get_ident():
    """Dummy implementation of _thread.get_ident().

    Since this module should only be used when _threadmodule is not
    available, it is safe to assume that the current process is the
    only thread.  Thus a constant can be safely returned.
    """
    return 1

def allocate_lock():
    """Dummy implementation of _thread.allocate_lock()."""
    return LockType()

def stack_size(size=None):
    """Dummy implementation of _thread.stack_size()."""
    if size is not None:
        raise error("setting thread stack size not supported")
    return 0

def _set_sentinel():
    """Dummy implementation of _thread._set_sentinel()."""
    return LockType()

class LockType(object):
    """Class implementing dummy implementation of _thread.LockType.

    Compatibility is maintained by maintaining self.locked_status
    which is a boolean that stores the state of the lock.  Pickling of
    the lock, though, should not be done since if the _thread module is
    then used with an unpickled ``lock()`` from here problems could
    occur from this class not having atomic methods.

    """

    def __init__(self):
        self.locked_status = False

    def acquire(self, waitflag=None, timeout=-1):
        """Dummy implementation of acquire().

        For blocking calls, self.locked_status is automatically set to
        True and returned appropriately based on value of
        ``waitflag``.  If it is non-blocking, then the value is
        actually checked and not set if it is already acquired.  This
        is all done so that threading.Condition's assert statements
        aren't triggered and throw a little fit.

        """
        if waitflag is None or waitflag:
            self.locked_status = True
            return True
        else:
            if not self.locked_status:
                self.locked_status = True
                return True
            else:
                if timeout > 0:
                    import time
                    time.sleep(timeout)
                return False

    __enter__ = acquire

    def __exit__(self, typ, val, tb):
        self.release()

    def release(self):
        """Release the dummy lock."""
        # XXX Perhaps shouldn't actually bother to test?  Could lead
        #     to problems for complex, threaded code.
        if not self.locked_status:
            raise error
        self.locked_status = False
        return True

    def locked(self):
        return self.locked_status

    def __repr__(self):
        return "<%s %s.%s object at %s>" % (
            "locked" if self.locked_status else "unlocked",
            self.__class__.__module__,
            self.__class__.__qualname__,
            hex(id(self))
        )


class RLock(LockType):
    """Dummy implementation of threading._RLock.

    Re-entrant lock can be aquired multiple times and needs to be released
    just as many times. This dummy implemention does not check wheter the
    current thread actually owns the lock, but does accounting on the call
    counts.
    """
    def __init__(self):
        super().__init__()
        self._levels = 0

    def acquire(self, waitflag=None, timeout=-1):
        """Aquire the lock, can be called multiple times in succession.
        """
        locked = super().acquire(waitflag, timeout)
        if locked:
            self._levels += 1
        return locked

    def release(self):
        """Release needs to be called once for every call to acquire().
        """
        if self._levels == 0:
            raise error
        if self._levels == 1:
            super().release()
        self._levels -= 1

# Used to signal that interrupt_main was called in a "thread"
_interrupt = False
# True when not executing in a "thread"
_main = True

def interrupt_main():
    """Set _interrupt flag to True to have start_new_thread raise
    KeyboardInterrupt upon exiting."""
    if _main:
        raise KeyboardInterrupt
    else:
        global _interrupt
        _interrupt = True
lib-dynload/binascii.cpython-38-x86_64-linux-gnu.so000075500000111000151153537470015670 0ustar00ELF>p@��@8	@�w�w p{p{ p{ �� x|x| x| 888$$�w�w�w  S�td�w�w�w  P�td�m�m�m44Q�tdR�tdp{p{ p{ ��GNU=?R���)(�6]��)%gT+�@ +.B���|CE���qX����4@ K�� t�, ���F"n�	�]���&Z�
��)�L����[MH� :@� A@� __gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libz.so.1libpthread.so.0libc.so.6PyModule_GetStatePyExc_ValueErrorPyErr_NewExceptionPyModule_AddObjectPyObject_GetBufferPyBuffer_IsContiguousPyFloat_TypePyType_IsSubtypePyLong_AsUnsignedLongMaskPyLong_FromUnsignedLongPyBuffer_Release_PyArg_CheckPositionalPyErr_Occurred__stack_chk_failPyExc_TypeErrorPyErr_SetString_PyArg_BadArgumentcrc32_Py_strhex_bytes_with_sep_PyArg_UnpackKeywords_PyLong_AsIntmemchrPyMem_MallocmemsetPyBytes_FromStringAndSizePyMem_FreePyErr_NoMemory_PyBytesWriter_Init_PyBytesWriter_Alloc_PyBytesWriter_Finish_PyBytesWriter_Prepare_PyBytesWriter_Dealloc_Py_BuildValue_SizeT_PyUnicode_ReadyPyErr_Format_PyLong_DigitValue_Py_DeallocPyInit_binasciiPyModuleDef_Init_edata__bss_start_endGLIBC_2.4GLIBC_2.2.5�ii
Rui	\p{ �Zx{ �Z�{ �{ �{ a]�{ f]�{ p]�{ w]�{ a]�{ w]| a]| �]| ~] | a](| �]0| ~]@| \H| �]`| \h| �]� �Z � .](� �R8�  i@� �\H� �?X� �h`� 5]h� `Nx� �h�� [\�� �<��  h�� @]�� 0G�� �g�� S\Ȁ �:؀ �g� H]� L�� �f� \� �,� �d � R](� �*8� �b@� P]H� �IX� @b`� G\h� �8x� b�� �\�� �B�� �a�� �[�� �%�� @a�� \ȁ �)؁ �`� Z]� �U�� �`� &\� .�  _h� �]p� `i��  � �� � Ȃ `| Ђ �\� @| � [\H� �{ P� Z]�� �{ �� &\ȃ  | Ѓ \� | � R]� � 	� � 
� � � � �~ �~ �~ �~ �~ �~ �~ �~ 
�~ �~ �~ �~       ( 0 8 @ H P X `  h !p "x #� $� %� &� '� (� )� *��H��H��h H��t��H����5�g �%�g ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"��������%Ue D���%Me D���%Ee D���%=e D���%5e D���%-e D���%%e D���%e D���%e D���%
e D���%e D���%�d D���%�d D���%�d D���%�d D���%�d D���%�d D���%�d D���%�d D���%�d D���%�d D���%�d D���%�d D���%�d D���%�d D���%�d D���%�d D���%}d D���%ud D���%md D���%ed D���%]d D���%Ud D���%Md D���%Ed D���
@L�Id H�5"B1�I�:�P��������
H�MH�A@H�5L@1�H�=)@����t�|$����H�����|$�:H�
�c H�5�AE1�H�9����I�$H��?E1�H�5�?H�=�?�B����gH�D$���H�t$H��u���R���I���D�<�D$�|���H�����L$�L�
[c H�54AE1�I�9�a�������H�\$H�81�H���@������]�CH���{�����t4H��uT�1��H�iH�|$�1��H���H����I�$H��>E1�H�5?H�=I@�R�����M�D$H�5�b I�xH9���H�$��������I�|$���H�$��������D$�l���H���HH�$�L$�mH�\$H�81�H���T������!�CH�������tRH��ur�1��0H�iH�|$�1��H��H���L�
�a H�5�?E1�I�9����I�$H��=E1�H�5>H�=>�H��������H�����HL�
�a H�5e?1�I�9����
H�=oa H�5H?1�H�?�v�����L���)������O���H���:�2I��������1��L���_E1�������H����L��` H�5�>1�I�8�����yI�H��<H�5=1�H�=)=�^����UI�p�
����I���eH��H��<E1�H�5
=H�==� ����@�f���I����H��H��<E1�H�5�<H�=�<�����H�H�j<E1�H�5r<H�=�<������I���FH�|$�B���H��u9E1��H�=` H�5�=E1�H�?�������H���8�>H�8H�5p<E1�����fH�
�_ H�5�=1�H�9�����!H�MH��;H�5�;1�H�=I<� ����!���H���r"�n 1��u!L��� "H��H�z;H�5�;H�=%<�����w&I��M��xLA�VM�~H�l$p��uZH�p��#H�|$�6���H��tOH�xH�5S;����H��1������%H�|$����H��t!H�xH�5%;�����H�|$���H��u51��%H�|$����H��t�H�xH�5�:�����u���H���r%H�8H�5e;����x���H���������'E1��i'H���y���H����H�xH�5�<E1��M���H�������8'L�CH�'A��&H���4���H��twH�8H�5;E1��
���H������&H�
�] H�S1�E1�H�5Q<H�9H�R���L��������&H�sH�=�] 1�E1�H�VH�?H�5�;����&E1��&A���H&H������h%�V���I���v&I�l$H�(H�������xA�D$ �j(E1��$(I�t$L�1] 1�E1�H�VI�8H�5^;�����'I�\$H�=] 1�E1�H�5|;H�SH�?���H���0�����'H���#���H�,$L�d$�(H�]H�=�\ 1�E1�H�5�:H�SH�?����*H��������G*E1��*H�������`*H�
y\ H�U1�E1�H�5�:H�9H�R�U���L�������)H�uH�*H�|$L�`��,�-M����,�D$�-H��H�|$��,�-H���W�������.E1��X,H�|$ �-����+L�CH�.E1��8,���I���+,H�
�[ H�S1�E1�H�5+:H�9H�R���H�������+H�sH�=�[ 1�E1�H�VH�?H�5�9�g�����+H�
c[ H�U1�E1�H�5�9H�9H�R�?���L������b0H���z����.H���}�������0E1��=0H�]H�=
[ 1�E1�H�5>9H�SH�?����0H�uH�0H���4�������4��4L�UH��4��E1��2L�EL�
�Z 1�E1�H�5�8I�PI�9���2H�uH�=�Z 1�H�VH�?H�5�8�i�L��E1�����U2�d�H���.4�1L�%GZ H�5 8E1�I�<$�L����#2I��H���l����3I���4I���3L������1f.���Uf�H��SH��hdH�%(H�D$X1�)$)D$)D$ )D$0)D$@H���]H��H�}1�H������L�CH������^���H�EH�5�Y H�xH9�������������H�}�����.H�T$H�$��L�B�H������@2)H�5@ED���L�Z�F�N��D1�M���q����@2yL�R�D���B�<F��1�M���J�iA����A��1�E��L�J��<~D1�M���"D�A������D1�D���<~D1�L�R�M����D�A����L�J���D1�D�؉��<~D1�M�����A������1�D��H�j�A��B�<^D1�M�����AA����L�IA��1�E�Љ��<~D1�L�R�H��~|E�A����A��D1�A��M�Z����<F1�M��~VM�AE�IA����A��D1�A���<~1�M��~/H�I��E�X�������D1����<~1�I9�u�f��[�H��H�|$tH�����H�\$XdH3%(H��� H��h[]�f.�H�ֹ�H�=_3���������H�l$H��t�1�H��랉���%�H����H�T$H�$L�Z�H������9H�5CH�j���D��B�Nf5���M���=���A����@2yD��A��B�<^E��L�R�D1�H�������AA����L�Z�A��1�A���<~1�M�����D�IA����A��D1�E�Љ��<nD1�L�R�M���������1�������ff.����ATf�I��USH��H��pdH�%(H�D$h1�H�B�)D$)D$ )D$0)D$@)D$PH����H�l$I�<$1�H����������CH���+�����1�H�����T$ H�t$�����������Y�H�|$I��tH�����H�L$hdH3%(L��u|H��p[]A\ù�H��H�=�1������V���E1�H�|$t�H�l$�I�T$H�5;U H�zH9��-������ �I�|$�g�ǃ��E��������f���ATI��USH��H��H�ĀdH�%(H�D$x1�H�����f�)D$)D$ )D$0)D$@)D$PH����H�����H�����H�l$I�<$1�H���������CH�������v�H����H�t$ H�|$1ҹ���H�|$I��tH���f�H�L$xdH3%(L����H��[]A\�H��PH��L��A�L�X 1�H�t$hVH��jj��H�� I��H�����E1�H�|$t�H�l$�H��I�\$H��t
H���V�M�D$H�5�S I�xH9����������I�|$�r���������H�t$ H�|$H����I������ff.���ATI��USH��H��H�ĀdH�%(H�D$x1�H�����f�)D$)D$ )D$0)D$@)D$PH����H�����H�����H�l$I�<$1�H����������CH���������H����H�t$ H�|$1ҹ�9�H�|$I��tH����H�L$xdH3%(L����H��[]A\�H��PH��L��A�L�/V 1�H�t$hVH��jj��H�� I��H�����E1�H�|$t�H�l$�H��I�T$H���@��H���1�H�t$ H�|$��I����p���AWI��AVAUATUSH��H��dH�%(H��$�1�H���)f�H�j�)D$)D$ )D$0)D$@)D$PH���
H���$�H����L�l$I�?1�L���Z��D$���2�CL�������<�H��� �D$E1�A�H�l$H�\$ �
H��H����H��t	H9���E1�1�1�H����I��������I��������I���������Y�<
�XH�VH9�~<
����H9����|5
����K�,	M9��5�I��H9���H���D5<~��<=��<_uE��u?��u<.�E���+< ��<	��<
��< �„��Y���<
�Q���H�V��M�˹��K�dM9����I�H9��s���L���<�I��H�����L��H��L�=,1��<�E1�1�1��W<
��H�QH9�~<
����O�I�pH9�t�|

t	��K�DE����A�H9���I��H��L�L
A�<~��<=��E��t<_tA<.u����E���< ��<	��< A��<
��A���Q���<
�I���H�QM�X��O�K���K�A�=E�	L��I����A��A�7G�I�p�AD�H9��H���f.�L���H�H��H����L���D�H�|$t
H�|$��H��H��$�dH3%(�TH�Ę[]A\A]A^A_�fDL�YL��L9��;���< @��<
��@��t<
�7E���s<
�_����M�����O�\�K�E�A�� ��A��	��D�\$I�pE�����
1�1�A�9
��H�H���?���f.�H�NH��H9������< A��<
��A��t<
�dE����<
������H���"��T5��� �E1���	�
�L$E1ۅ�A��1�1�K�LM��I)�<
��H�H������<
�����<
���<	�X���< �P���A��<
A��E����H�NH�ʃ�H9�t�|5
t	��K�cM�ӹ������H�V��K�M9��N�I��H9��������DM�X��H�QO�K���K��A�=E�	M��I��A��A��C�4C�@�qI�p�H9��������ff.�<
����<
����<	����< �����@��<
A��D���M<
�EL�YD�T$L��E������<	t< ����E���"L9�~<
����O�I�pL9��#����|

������K�SE����A�L9���������ff.���x�
A��E1�1�1�E��D�\$H���X���1���I��H�����1����D<
�;���H�ND�t$H��E�������<	t< ���E������<
u	H9�����H9������|5
������K�fM9��o�I��H9��:�������fDL�YL�ڃ�O�I�pL9�������	���L�af��)L$I�)L$ I�l$�)L$0)L$@)L$PH��H��L��A�H�D$hL��M 1�L��Pjj��H�� I��H�������1����DI�WH��ug�D$L�5�I I�OA�H���%I�wH�~L9��F�L���,����6�I���A�Ń��������F�f.�H�zL�5�I L9����L�����A�Ņ����I��`��D$������H��A�H���1����S���ff.��
I�6I�p�l���A����D�|5
��������F���ff.�f��|

�������O�I�p�e���D< �j���A�_�d���ff.�@H�yL9����L����A�Ņ����I���A�ă���^�H���b������ff.��L�YL��L9�t�t
@��
�=���A�$I���-���O�K�L��U���f�H�NH��H9�t D�\5A��
�����A�$M�������M�˹����L��I��I��A�=��A��A�7C�<�B@�:K�����|$A�=t�
M�XM�CC�
K�L�O�����D$�I��������H����������LDރ�H�H���j���I������I���������|$��MDك��H�H���:����|$A�=I�<6�G�A�6
M�T6A�H��������ff.�@��AVf�1�AUATUSH��H��H��dH�%(H��$x1�H��)$H��)D$)D$ )D$0)D$@�����w�CH����������L�d$PL���1�L�l$H�$H��������?I9����K�t-L����I��H����M����1��H�z�����I9���:;u^H���H9�}RL�BM9�~=:Lu7L�BM9�~.:Lu(L�BM9�~:LuI��M9�~B:u
I9�u�DM��I)�I��*H��A�I���H�z����y���fA��H��I���D��A�I��)�A�F��L��A�F�I9��8���L��L������I��H�|$tH���{�H��$xdH3%(L��uH�Ā[]A\A]A^�A�I���E1�����f���AWf�1�AVAUATUH��SH��H��dH�%(H��$x1�H��)$H��)D$)D$ )D$0)D$@������H�CH��A����������H�l$PL�t$L�$$H���C��H��������?I9����K�t6H�����I��H����M����O�4H��/E1��5ff.�E��A�M�I�wI��A��?F�,E�oM9�t_I��A��A�$A��I�wA	�A�MD�����?D�8E����I��M9�u�A�D��H��A)�D�����?D�D�F��@��u�H�����I��H�|$tH�����H��$xdH3%(L��uH�Ĉ[]A\A]A^A_�E1�������H���f.���AWAVAUATUSH��H��H��H�|$dH�%(H��$�1�H����f�)D$)D$ )D$0)D$@)D$PH����H�����H�����A�H�l$H�;1�H������A�ƅ����CH��������:�I����H�SH�5�B H�zH9��\��������O�H�{�[��A�ă���X���H�\$pL�|$ L�l$H�����H��������?I9����K�t?E����H���[��H�����M����O�L=1�L�;-�0f�A��A�N�H�pI��A��?G�48D�pM9�t^H��A��E�U��A�NH�pD	�A��A��A��?C�<@�8���I��M9�uǃ��1��u���@=H�p��<E�D�@E�����
H��H������H�|$I��tH���v��H��$�dH3%(L���H�Ĩ[]A\A]A^A_�L�af��)L$I�)L$ )L$0)L$@)L$PH��H��A�1�H�D$hL��C Pjj���H�� H��H�����E1��EA�H�\$pL�|$ L�l$H���_��H��������?I9�jK�t?H���_���H������I��H�|$�%���H�|$���������H�p��0E��==f�PD�H����I���=���H���������������AWAVI��AUATUH��H��SH��dH�%(H��$�1�H���L�af��)$I�)L$)L$ )L$0)L$@H��H��A�1�H�D$XL��B Pjj�n��H�� H��H���sI��H�}1�L���}���Å��X�CL�����������I����H�UH�5I? H�zH9��_��������R��H�}���A�ǃ�����H�l$`H������L�d$L�,$I��-��H�VUUUUUUUI�t$H��H��?H��H��H)�H�4����H���=��E��H�pA��M��u	E����E�L$ D�1�M��~ff.�f���M����E�UD�{D	�A�_�A�É�A��A��?u	E����A�� H�~D���~}��A�_��?u	E������ H���V�I��I��M�����u��
H��H�����H��H�|$tH���,��H��$�dH3%(H����H�Ę[]A\A]A^A_�H���f�)$)D$)D$ )D$0)D$@H��~H��A�H������I������E1��k���D�{����L�v�`A�߃�����L������F`H��I��I��M����������"������L���C��H������H�8H�5����1������`���������AWf�1�AVAUATUH��SH��H�|$H�\$H��H��dH�%(H��$�1�)D$)D$ )D$0)D$@)D$P��������CH�����������L�d$ H�l$`L�t$H���-��M���qH��������?I9�����L��H�����H���k��M���D$|I������A�M�~��������H�pM����E�I�E�I�WA����,I��A���H��D�N�M�E�I�E�OA����#H��L��I����I����I����I��tyI��tOI��t%H��D�N�I��I��E�O�A�����L��L��H��D�N�D�
L�X�L�jA�����L��L��H��D�N�D�
L�x�L�rA�����L��L��H��D�N�D�
L�`�H�JA����bH��L��H��D�N�D�
L�P�L�BA����>L��L��H��D�N�D�
H�x�L�ZA����L��H����f�H��M�fD�N�L��A�L$�L�������I�u�N�E�$L��H��A�����I�uD�V�A�~I�VI�G�M�F@�����I�u@�~�E�NL��I�G�M�^A�����I�uD�N�A�NL��I�G�M�f���tmI�u�N�E�FL��I�G�M�VA���tPI�uD�F�E�NL��I�G�I��A���t2L��I�G�L�nE�M�L��H����L�rE�N�L�x�A�����L�h�I�������D�bL�zH�l$pE����D�v�A���]���A����Hc�H���|��H���B��E�\$�H��D��A��H���H���%���H�����H��H�|$tH���K��H��$�dH3%(H��uJH�Ę[]A\A]A^A_�1�H�='���H���H�l$H��t�1����H�����L��L�������F��fD��AUf�ATUH��SH��dH�%(H��$x1�)$)D$)D$ )D$0)D$@H������H�FH���|I��1�H��L���@�����h���CL���{�����#��H�\$PL�d$L�,$H������I��������M9��o��I�t$H���-��H���<��M���EK�t%1�1�A�L��!DE�]C���~�
����}�x�����d����D�a	�A��~<��A��L�XI��A��D� D�����!�I9�t'L��E�]C���~u����f�I��I9�tD���A��L��E������H��H�����H���w��H��D��H�=1��{��I��H�|$tH���(��H��$xdH3%(L��uGH�Ĉ[]A\A]À~ �A���C �@t4� �z��L�C0L�KL�$H�D$L�L$�x����&��E1��[���H�-_6 H�5pE1�H�}�t���g���ff.�@��AUf�ATUSH��H��hdH�%(H�D$X1�)$)D$)D$ )D$0)D$@H�����H�FI���H��1�L��H������������CH���1��������L�d$H�,$A����L��1�H��?L�H��b��I��H���I��M��~pL��5 �M�UA�
A�<���@���
1��)��DuD�LuA�<C�
@��������H�����L�6A�|5M9�|�H�|$tH���Q��H�\$XdH3%(L���H��h[]A\A]��F ������@��� �e��I�l$0M�d$H�,$H�D$L�d$A����L��1�H��?L�H��Y��I��H���@��M���c���L��4 D�]�UC�<A�@��w	�������H���s��H��tuH�8H�5c�O��I�m����L��E1��������L�
4 H�5E1�I�9������H�����H������H�8H�5�E1���������y�����@��AUf�ATUSH��H��hdH�%(H�D$X1�)$)D$)D$ )D$0)D$@H������H�FH������I��1�H��L���v���������CL�����������L�d$H�,$A���sL��H��?L�H�1�����I��H���y��M���L�&3 �M�uA�<E�3@����A����E1��5ff.�B�DMB�TMA�<E�@����A����I����D�O�	C�|
M9�|�H�|$tH�����H�\$XdH3%(L��uhH��h[]A\A]À~ �����E �@��� ����H�u0L�EH�4$H�D$L�D$L�d$H�,$A��uVL��A�H�I��H���������H�����H���P��H�8H�5����I�m�6��L��E1�����5���H������H�����H�8H�5�E1�����
���L�
|1 H�5�E1�I�9������ff.�f���AWf�I��AVAUATUSH��dH�%(H��$�1�)D$ )D$0)D$@)D$P)D$`H���(��H�FH����H�l$ 1�H��H���	�����W���CH���D�������L�t$0L�l$ I��������M9�����H�\$pI�nH���~��L��H��H��HI�H��H�tm����H��H������M���O�D5H��1�L��M�H�1�1�A�L�$L�'M�h�M�p�ff.�@D�M��I)�E����A��
��A��
��A�� ��A��=��G�$
A���������D�I��D	�A���|��A��L�NH��A��D�&D�����!�L��I9��r�������H���"��I��H�|$(t
H�|$ ����H��$�dH3%(L���>H�Ĩ[]A\A]A^A_ÐD��L�HL��M9��
�����t��4@��~ރ�u�M��~�M��L�HI)Ā=-������D$M��~�E�!D�d$L�$$I)�L�d$L�d$A��C�<"������|$����D�d$E���GH�|$L�`�D$�Z���E�$$D�d$M��I)�L�d$L�d$A��C�<"��f���|$�[���|$��H��H�|$�D$����D� H�l$D�d$A��C�<"�tD�d$E��x�|$���D$H��H�|$����L��H�t$�$� ��H�����D�<$H�8A��tH�5����H��E1��c���/���L�D$H�5�I)�H�VUUUUUUUL��I��?H��1�L)�H�������D$��=�����+����D$��A����H�������~ �V���C �@t-� �m��L�C0L�KL�D$ H�D$(L�L$0�Y�������L�- H�5"E1�I�:�'���s���f���AWf�AVAUATUSH��H��hdH�%(H�D$X1�)$)D$)D$ )D$0)D$@H������H�FH������@I��1�H��L��������}���CL�����������L�$L�\$1�E�:M�bI�k�A�� A��?Mc�L�����I��H���*��H�P 1�E1ۿE��u7������E��H����A��L�BI����D�A!�I��tXL��H��~@A�$<
t7<
t3�� <@�>A����?D�IA	�A���H��I��I��D���@D�IA��A�����L�u�H����A�$�Ѓ�< t
��
t��
utH��M����A�T$I�|$�у῀� t
��
t��
uHH��~zA�T$M�|$�փ�@�� t
��
t��
u#H�I9�tRI��A�G����῀� t�<
t�<
t�H���/��H������H�8H�5I���I�m����L��E1������H�|$tH�����H�\$XdH3%(L����H��h[]A\A]A^A_�H������H���t��H�8H�5����I�m�Z��L��E1��d��뒀~ �3���E �@t,� �c��H�u0L�EH�4$H�D$L�D$�������L�
* H�5&E1�I�9�+���6���fD��AWAVAUATI��USH��H��xdH�%(H�D$h1�H����f�)$)D$)D$ )D$0)D$@H����H������H������H�.H���d��H�E����c��I��1�H��L�����A�������CL������������H����H�\$H�,$H�����I��H���e��1�H��H�����1�H����1��-�I�4H��A��_u	E����D�:H9���H��D�|H�BA��=u�H9����L��
���
�
M�4L�rH����=��I9����σ�߃�A@����D�TE��A���A��AA��vA��0A��	��L�=~( H�BB�T5A���A
A�H9��O���ff.��L������I��H�����L�����H�|$tH���D��H�\$hdH3%(L����H��x[]A\A]A^A_�ff.�D�I�A��	�8���A�=����f���
tkH�BH9��n����|
tWH�BH9��Z����|
tCH�BH9��F����|
t/H�BH9��2����|
tH��H9������|
u��H��H9��F������ff.�L�yf��)$I�)L$)L$ )L$0)L$@H��L��A�H��H�T$XL�Q* R1�jj���H�� I��H����H�(H���
H�M�����I��1�H��L������������CL�����������E1�I������I�\$H�5r& H�{H9��������������I�|$�>���A�Ń���������E1�����A�=L������I������� ��������} ����E �@t'� ���L�U0L�]L�$H�D$L�\$�P���L�-�% H�5�E1�I�}�������s���H�=	* H�* H9�tH��% H��t	�����H�=�) H�5�) H)�H��H��H��?H�H�tH�M% H��t��fD�����=�) u+UH�=2% H��tH�=�  �I����d����m) ]������w������USH��Q��H���h���H��H��$ 1�H�=�H�0�]���H�EH���@���H��H�5�H��������%���1�1�H�=y�%���H�EH������H��H�5fH���ƽ���������Z[]����H�=�& �P�����H��H���binascii.Errorbinascii.Incompletecrc_hqxcontiguous bufferargument 1crc32argument 'data'b2a_hexb2a_qp0123456789ABCDEFargumentrlecode_hqxb2a_hqxb2a_base64Too much data for base64 lineb2a_uuAt most 45 bytes at oncerledecode_hqxOrphaned RLE code at startIllegal charNiOdd-length stringNon-hexadecimal digit foundIncorrect paddingTrailing garbagea2b_uua2b_base64a2b_hqxa2b_hexunhexlifya2b_qpdataquotetabsistextheaderbytes_per_sepnewlinebacktickbinasciiinteger argument expected, got floatstring argument should contain only ASCII charactersargument should be bytes, buffer or ASCII string, not '%.100s'argument should be a contiguous buffer, not '%.100s'String has incomplete number of bytesInvalid base64-encoded string: number of data characters (%zd) cannot be 1 more than a multiple of 4b2a_qp($module, /, data, quotetabs=False, istext=True, header=False)
--

Encode a string using quoted-printable encoding.

On encoding, when istext is set, newlines are not encoded, and white
space at end of lines is.  When istext is not set, \r and \n (CR/LF)
are both encoded.  When quotetabs is set, space and tabs are encoded.a2b_qp($module, /, data, header=False)
--

Decode a string of qp-encoded data.crc32($module, data, crc=0, /)
--

Compute CRC-32 incrementally.crc_hqx($module, data, crc, /)
--

Compute CRC-CCITT incrementally.rledecode_hqx($module, data, /)
--

Decode hexbin RLE-coded string.rlecode_hqx($module, data, /)
--

Binhex RLE-code binary data.unhexlify($module, hexstr, /)
--

Binary data of hexadecimal representation.

hexstr must contain an even number of hex digits (upper or lower case).hexlify($module, /, data, sep=<unrepresentable>, bytes_per_sep=1)
--

Hexadecimal representation of binary data.

  sep
    An optional single character or byte to separate hex bytes.
  bytes_per_sep
    How many bytes between separators.  Positive values count from the
    right, negative values count from the left.

The return value is a bytes object.  This function is also
available as "b2a_hex()".b2a_hex($module, /, data, sep=<unrepresentable>, bytes_per_sep=1)
--

Hexadecimal representation of binary data.

  sep
    An optional single character or byte to separate hex bytes.
  bytes_per_sep
    How many bytes between separators.  Positive values count from the
    right, negative values count from the left.

The return value is a bytes object.  This function is also
available as "hexlify()".

Example:
>>> binascii.b2a_hex(b'\xb9\x01\xef')
b'b901ef'
>>> binascii.hexlify(b'\xb9\x01\xef', ':')
b'b9:01:ef'
>>> binascii.b2a_hex(b'\xb9\x01\xef', b'_', 2)
b'b9_01ef'a2b_hex($module, hexstr, /)
--

Binary data of hexadecimal representation.

hexstr must contain an even number of hex digits (upper or lower case).
This function is also available as "unhexlify()".b2a_hqx($module, data, /)
--

Encode .hqx data.a2b_hqx($module, data, /)
--

Decode .hqx coding.b2a_base64($module, data, /, *, newline=True)
--

Base64-code line of data.a2b_base64($module, data, /)
--

Decode a line of base64 data.b2a_uu($module, data, /, *, backtick=False)
--

Uuencode line of data.a2b_uu($module, data, /)
--

Decode a line of uuencoded data.Conversion between binary data and ASCII}}}}}}}}}}~}}~}}}}}}}}}}}}}}}}}}}	
}}
}}}}}} !"#$}%&'()*+},-./}}}}0123456}789:;<}}=>?}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}�������������������������������������������>���?456789:;<=������	

������ !"#$%&'()*+,-./0123�����ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/!"#$%&'()*+,-012345689@ABCDEFGHIJKLMNPQRSTUVXYZ[`abcdefhijklmpqr!B c0�@�P�`�p�)�J�k���������1s2R"�R�B�r�b9��{�Z��Ӝ����b$C4 �d�t�D�Tj�K�(�	�����ō�S6r&0�v�f�V�F[�z��8����׼��H�X�h�x@a(#8���َ�H�i�
�+��Z�J�z�jqP
3:*���˿���y�X�;���l�|�L�\",<`A������*��h�I��~�n�^�N>2.Qp��������:�Y�x�����ʱ��-�N�o���0� P%@Fpg`������ڳ=���^���"�25BRwbVr�˥����n�O�,�
��4�$��ftGd$TDۧ������_�~��<��&�6��WfvvF4VL�m��/�ș鉊���DXeHx'h���8�(}�\�?����؛����uJTZ7jz�
��*�:.��l�Mͪ����ɍ&|ld\EL�<�,���>�]�|ߛ���ُ��n6~UNt^�.�>��;4% ���P`���x���������8���k���8���xB���3����e���$�����#���d�����w���@������������p~��������	������L��������0 ������,�������8������xP������T ����� �����	�����	zRx�$ȧ��@FJw�?:*3$"D��0$\x��E�A�D �AAzRx� �� ����,�����E�H�D��
AAKzRx����$X���L0\���NF�H�A �G��
 AABAzRx�����$<����D�D����F�D�A �J��
 AABAD�[�E�B�I�zRx�����$G����D�x���pF�D�A �J��
 AABAD�[�E�B�I������
`X�����
F�E�B �B(�A0�A8�J�t
8A0A(B BBBG��^�B�B�I�$zRx��������,"����D�����F�H�B �A(�A0�M��
0A(A BBBA zRx�������(����2Lx<���F�H�B �B(�A0�D8�J�{
8A0A(B BBBA$zRx��������,9���2`p��/F�B�B �B(�A0�A8�M�
8A0A(B BBBAh�X�B�B�I�$zRx��������,˫���`���F�B�E �B(�A0�G8�G�C�X�B�B�I��
8A0A(B BBBA$zRx��������,����dLD���JF�H�B �B(�A0�D8�G��
8A0A(B BBBA������<�l��AF�F�A �D(�G��
(A ABBA zRx������(/���< D��|F�F�A �A(�G�E
(A ABBA zRx������(¬���<�L��SF�F�A �A(�G�T
(A ABBA|����L�X��^F�I�B �B(�A0�A8�G��
8A0A(B BBBB�)����LPT���F�F�B �B(�A0�A8�G�B
8A0A(B BBBA$zRx��������,z����`����iF�B�B �B(�D0�A8�G�
8A0A(B BBBO��Y�D�B�I�$zRx��������,`����|��GNU��Z�Z�{ a]f]p]w]a]w]a]�]~]a]�]~]\�]\�]Ufp��
�[p{ x{ ���o`�
h�~ H��
�	���o���o�
���o�oh
���oTx|  0@P`p�������� 0@P`p�������� 0�Z.]�R i�\�?��h5]`N�h[\�<� h@]0G�gS\�:�gH]L�f\�,��dR]�*��bP]�I@bG\�8b�\�B�a�[�%�@a\�)��`Z]�U��`&\.� _�]`i � � `| �\@| [\�{ Z]�{ &\ | \| R]GA$3a1��[binascii.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debugxH|�7zXZ�ִF!t/���]?�E�h=��ڊ�2N�$V���Iq�y�b)Z�^�^�����^_�lq�LJs�Ö���;��(�$�@�n4u��)\E�l�e�{���}�c���ꀅ?�w�Z�	�I��A�����Z�c���]���#�&����D�gЄ����KY��7�Zƈ-��$	)��ƅ�.�=��fM�Mň	�"��ϡ̷��F�O�FپK�V>�o�#z�fN8�vӀ:�ju�����}!��{ǻ#:%�0�^!���!�}��[��}$�
���3,�UT��E@f>���J�� G�T�þ�(��hϊ���M�b���m�F�7xi�t;���R2B��p�(��L�d�G!x�4��B�;1r[*A!p㞐��N���>'ǽ�J2�󶜏o��	�^�7R��f'Js��Ǘ}��H�~��jA�5[�q�9-A��8��˘`���ڶ(
�Q�%i��l��a�R�����E�J�1��}C=�6Cf�24%��>c\���P�}��Z�Z���ط{�_\#��Յv�=��K�J�ͿI��U*+A�Yn�u6�S��gT~7ۦ�,���B:���i;�t#�O�-�Q�Ņ�
�Oע:��pŵ(�Dŕ��Q;�*P��2#Ky�کq5`>d9	����ĩY�X†q}�d~�s-{E�r+�Ty^g���_�|b>l�{[@�ma��h�$�7�����5V.A��6�h�t�(�ӶZ9j�<�{�b񆹬4��v���'@k��`�k�����A`&.�š2��fg�j�c����$�ۮ�.�Q*�� ȕ�]���9R"��'��_艱Ԗ=C�Tt�|�;�??+��x�R��'�1�� O��%]rj�t���aɼ���G���Y7棦�OS8�P
5��C4��/[*>h̆Įw79!L���=����
��Y^�L+}�V���qQ��ց�s��G��J�5%j�#�Jྫྷ@�]9�1�N`�I�b�$����F��+J�o��_�l83��uyl&R I�]�x��GR�ޔ���V��؛R;p���>ʑ��Q�z�5�{&W��3i$j����8���j�ފ�=���!d���V&��R+,RW9Z޽j�GB��U��jyr��0ќ���\ȝ��x��*��~�!(�`�y����I�+��S�	�(7Zh8��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(��h0h8���oh
h
^E���o�
�
0T�
�
�^B��Hh��c@n@@0wpp0@}�[�[
��[�[  ��m�m4�oo���w�w �p{ p{�x{ x{��{ �{� �x| x|��~ �~p�� �@ �@� @��H�`@�$
d�`Ą���(lib-dynload/_codecs_jp.cpython-38-x86_64-linux-gnu.so000075500001027030151153537470016211 0ustar00ELF>P@�&@8	@JJ �Y�Y#�Y#��� @@$@$888$$�I�I�I  S�td�I�I�I  P�td0C0C0C��Q�tdR�td�Y�Y#�Y#P�P�GNU�����5aaL=��d3�H���D ��|CE���qXK:@`� �? , �F"_��(����O���� $�� $�� $q0��__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6_PyUnicodeWriter_WriteChar_PyUnicodeWriter_PrepareInternalPyUnicode_AsUTF8strcmpPyCapsule_NewPyObject_CallFunctionObjArgs_Py_DeallocPyImport_ImportModuleNoBlockPyObject_GetAttrStringPyExc_TypeErrorPyErr_SetStringPyExc_LookupErrorPyInit__codecs_jpPyModule_Create2__strcpy_chkPyModule_AddObject__stack_chk_fail_edata__bss_start_endGLIBC_2.4GLIBC_2.3.4GLIBC_2.2.5vii
�ti	�ui	��Y# ��Y#��Y#�Y#�Y#ň�Y#@�#�Y#ΈZ#@�#Z#׈Z#@�#(Z#�8Z#@�#@Z#�PZ#@m#XZ#�`Z#@�#pZ#
��Z#@�#�Z#��Z#@]#�Z#+��Z#@�#�Z#8��Z#�A�Z#@}#�Z#F��Z#@
$�Z#@�#�Z#Ĉ[#l�[#�l0[#PnH[#v�`[#�hx[#�t�[#|��[#�j�[#`q�[#���[#0�\#`x \#@�8\#p�P\#`|h\#O��\#p��\#`|�\#\��\#0��\#`x�\#ĈP_#�p_#���_#^��_#���_#��`#$�`#�� `#z�0`#&� d#��0d#:�@d#��Pd#T�`d#��pd#���d#2��d#��d#`��d#��d#|��d# ��d#��d#��e#2�e#� e#f�Po#po#��o#v�o#2�o#�p#�p#d p# 0p#� t#�0t#T@t#	Pt#�	`t#�
pt#B�t#��t#��t#v
�t#0�t#��t#��t#^�t#u#�u#� u#H�#�@�#�@�#A�#A �#@�0�#B�0�#����#����#^���#����#��Д#���#^��#`��#�� �#��`�#��p�#^���#���#����#����#z���#��П#l��#(��#���#���#\� �#�0�#�0�#����#���#����#P���#���#�Ф#���#>��#���#���#r� �#.P�#`���#8��#� �#l��#��#`��#ڣ`�#���#����#��п#8��#���#F�@�#��P�#��`�#l�p�#(���#����#����#\���#���#���#���#L��#��#���#�� �#<�0�#��@�#��P�#p�`�#,�p�#����#����#`���#���#����#���#P��#��#���#���#@� �#��0�#��@�#t�P�#0�`�#��p�#����#d���# ���#����#����#T���#���#����#���#D��#� �#��0�#x�@�#4�P�#��`�#��p�#h���#$���#����#����#X���#���#����#����#H��#��#��P�#��`�#\�p�#���#����#T���#���#p���#�@�#R�P�#�`�#ʏp�#����#B���#����#����#v���#2���#���#����#f��#"��#ޗ �#��0�#V�@�#�P�#Κ`�#��p�#F���#���#����#z���#6���#���#����#j���#&��#��#�� �#Z�0�#�@�#|�P�#8�`�#�p�#����#l���#(���#���#����#\���#���#Ԭ��#���#L��#� �#į0�#��@�#<�P�#��`�#��p�#p���#,���#���#����#`���#���#ط��#����#P��#��#Ⱥ �#��0�#@�@�#��P�#��`�#t�p�#0���#�@�# �P�#T�`�#V�p�#X���#����#����#���#���#���#���#B��#D�#J �#�0�#�`�#�p�#���#8��#<��#>��#	��#�	��#�	�#�	�#�	 �#0�#P�#�`�#�p�#���#�
��#�
��#���#���#��#N�#^P�#`p�#���#���#���#���#���#���#�#�#0�#@�#P�#
p�#��#��#���#��#��#�#8�#: �#<@�#8P�#P`�#���#6��#���#� ��#J!��#l!��#�!�#�!�#�! �#�!0�#8#@�#�$`�#�&p�#�&��#�&��#�&��#F'��#H'��#d'��#~(�#B* �#�+0�#�+@�#�,P�#�,p�#-��#h-��#�-��#�.��#f/��#h/��#j/�#�/�#�/ �#�/0�#�/@�#�/`�#0p�#�0��#�0��#�1��#N2��#�2��#�3��#5�#n5 �#F70�#�8`�#n:��#�:��#�:��#�:��#z;��#�;��#�;�#�; �#�;0�#�=@�#�=P�#\?p�#^?��#`?��#b?��#d?@�#P�#`�#p�#4 �#�0�#�@�#�P�#�`�#�p�#^��#���#�!��#"��#�"��#�#@�#^%P�#2'`�#R'p�#�(��#|*��#0,��#�-��#r/��#�0��#�2��#T3��#N4�#6�#�7 �#$90�#D:@�#F;P�#�;`�#�=p�#�?��#fA��#C��#�D��#F��#�G��#,I��#�I��#4K�#�L�#N �#�N0�#�P@�#�RP�#�T`�#�Vp�#�X��#xZ��#T\��#(^��#
`��#�a��#�c��#�e��#�g�#�i�#tk �#<m0�#8o@�#2qP�#
s`�#�tp�#�v��#�x��#�z��#r|��#j~��#b���#Z���#R���#0��#��#� �#�0�#ҍ@�#��P�#��`�#��p�#����#j���#h���#Z���#T���#8���#,���#���#���#Ҧ�#�� �#��0�#Ы@�#P�P�#D�`�#*�p�# ���#���#���#����#���#Լ�#���#���#���#���#T� �#>�0�#(�@�# �P�#�`�#�p�#���#
���#����#����#\���#��#���#���#���#���#�� �#��0�#���#���#Z� �#�0�#�@�#`�P�#��`�#��p�#����#X�@�#�P�#n�`�#�p�#^���#`���#@�@$� $�0$�@$P$`$p$�$	�$�$
�$��$��$��$��$�$�$� $�0$�@$� P$�"`$�$p$�&�$�(�$�*�$�,�$�.�$�0�$�2�$�4�$�6$�8$�: $�<0$�>@$|@P$xB`$rDp$pF�$lH�$lJ�$fL�$dN�$^P�$ZR�$TT�$TV$NX$LZ $D\0$�]@$_P$a`$cp$e�$
g�$i�$k�$m�$o�$q�$s�$u$@v$�w $�y0$�{@$�}P$�`$ʁp$ʃ�$ƅ�$Ά�$���$n��$n��$j��$f��$d�$d�$X� $R�0$N�0
$��P$�`$Ȥ�$&�@$N�`$T�p$D� $ڨ0$��@$��P$2�`$x�p$��$²�$���$���$���$���$�$H�$��0$L�@$ȻP$�`$�p$,��$.��$��$��$��$l��$
��$��$j�$l�$�� $��0$��@$��P$�`$�p$$��$���$���$���$"��$$��$���$���$��$�� $�0$x�p$.��$��$D��$��$���$���$��$�$� $��@$��P$��`$~�p$r��$`��$���$���$���$���$��$��$*�$��$�� $���$>��$��0$�� $k� $�� $Ĉh $t�� $ $�$�$�$�$�$	�$
X$`$h$p$x$	�$�$�$
�$�$�$�$�$�$�$��H��H���#H��t��H����5"�#�%#�#��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h���������%-�#D���%%�#D���%�#D���%�#D���%
�#D���%�#D���%��#D���%��#D���%��#D���%��#D���%��#D���%��#D���%��#D���%��#D���%��#DL�.H��A�EI�H��I�H�L9���A=���H���H�����������H����L�&=�����A�$I�H��H��A��t���=�w&H��~�H�H���I�H��I�H�I9���D�����A��>�z�������{���=����H��~jA��A��E��M��I��J�T%L�2M��tUD�zD��E9�rG�R	A9�w>E)�G�4ffA���t/H�E��fA��D�8L�.E�uI�H��H��H���{M��I��I�M�/M��trE�wD��E9�rdA�W	A9�wZE)�G�|efA���tJfE��xvD���փ�!������؃�^D�D�x߀�w_��L�.A��>A��A�UH�F�t D�r�b���-�=Ww51�L�.A�����>A�E��L�6D�d@E�f�0�������?럸�H���A�$��3����H��~L�6��@H��A�I�H��H���l��bL�H��A�3I�0H��I�0H�I9��S�4q��wIH���H���H��~�L� H��A�4$I�0H��I�0H�I9���4���vс�����A��A��I��I�I�*H��tvE�bD��E9�rhE�R	E9�w^E)�F�d]fA���tNfE���H����D��L�A�̀H��f���΀A�3L�E�bI�H��x���e����"����������>w(H��~yL���@H��A��H�(@�uI�H��7��<�tD���tP��> ueH����H�0H���~I�H������A�@!�2���H���H��~cL�H��A�\I�H����yH���pH��~DH�(E��A�̀H��fA���E�H�0D�^L�E�bI�H��oH���/H���&H������u}H����H���������4���w'H��~�L�H��A�2I�(H�mI�(H�I9����������> ���������>��������H���*A��A��I��M�I�*H���@E�bD��E9��.A�Z	A9�� E)�B�l]f����
f���)����A��A��!D��A���E��ރ�^�D�^�A���E�T$�H�(A��>A��H��D�UH�F�dD�cI�0H�nI�(H�L9�����������> ��D�����A��>�
���fA��@H�������H�0H��D�M�I�kI�(H�I9����4iA��v��H���L�H��A�\M�I�kI�(H�L9��G����<�uA�E1�@����������A��?���A�\�U����A�~�E����\����~����f��@������y��H������H����������!�u���I�EI���'����H�������xNI�I���H������#A�RE�h�A8�rIE:j	wMA��)�H�A�4C����tBH���O�����y@H����������H��������������I�I�����@����!�A��N��H��������x
H�I���II������$I���������!H��L��4#H��I�I�H��t,E�CE8�w"E8S	rA��D)�Hc�D�JA������H��H�5�$#H�L�M���U�PD8���D8P	��A��)�H�E��A������D��E���D��D9�C�;UwH�}H+} H��1�H��D�D$�L$D�T$�c���D�T$�L$��D�D$�D�ML�]H�U A���$A���+A���EH�r���'���E��H�E � I��L��#M�I�H��tMA�HD8�wME8P	rqA��)�H�D�BA������A��H��D��� �����xeI�H���- ��. ��$ H������ �� �� ��A��H��D���������H����������������A�L�]H�U ����fA�SfE�TS���E�D����A�q@8���A8A	�,��)�H��tE�����(H��� �������I�I���!D�AA8��&8A	�&D��E)�Ic��4W������%��H������xNI�I���Q!E�JA8���%A8B	��%��D)�Hc��4j������%H������b���H������$��#H�������#A�i@8���#A8y	��#D��A)�Ic�A�4K������#��H�����x�I�I��� ��#��#D�HA8���@8x	��@��D)�H�D��A������D��E���D��D9�C�;SwH�{H+{ H��)�H��D�D$D�\$��D�\$D�D$�������D�kH�KL�S A����A����B�,��sI�R��������D��H�C I��I����"��"��"��"��"A����H�������[���I�I���^H������V"B�,H�KL�S �^���fB�,QfF�\Q�k���F�D�a���E1��>%H�
j�#H�5,E1�H�9�`�� %H���3��]%H�_�#H�5�*E1�H�:�5��$����L��1�	��.�M��Lc�G��D9�s	9�tHc��9�tD9�v����9�u�Hc�I�4Ѹ����;>u�FÁ���I����I��������H�t$H��L�L�6L�t$M���QD�v��D9��@�v	9��4D)�L�t$A�Ff����A�f���������f���\$�[���@�ǀ�Ff����K��y��������X�\$��=���������Ƹ����L�H�}��A��>�@H�u�I���FI�8L�I�8H�EL9��W$1���$M����H����$��������\��������~�����M��~�H�}I���I�H�{I�8H�EI9���$���l����J��> �I�������>�NfA��@M���i���H�]I��D�3I�8H�I�8H�EL9��/�yA�ރ�\u��H���$��������O����]R���T���SV�
���Y���[\�	��w^����&v�g��k~�[��������L�u�A��A��Z���H�D$H��L�H�0H��t7�x��9��lD�p	D9��r)��^f���wA������$#H�}I���\I�H�xI�8H�EL9��k"�"���t��> t�������>wf��@�!����\�����~�
���I��~{����������������I���u�������H��L�L�6M�����~��9����F	9��%)�A�^f���������B"H���9"��/"A�\����A�~�����~�����I���
���H���!�!���!���!���!M��I)�I���&L�_���q����B�����L�L$ A�L�D$H�L$�T$�#���L���#�T$L���#f���H�L$L�D$L�L$ ����1������f����7A�L�h�#L�a�#�T$H�L$L�D$L�L$ ����Fߨ���������������F�@��@��tٍF��Ը���������� ��� ��� ��� �� �� �� �|$L�L$ L�D$H�L$�T$t\1�������L���#�T$L���#f���H�L$L�D$L�L$ ������L �D9�����8 ��. H������" B�Y�h����� ��tP�,���waM��~SH�I��@�(I�0H�vI�0H�I9���0!H�+I���EM�0I�vI�0H�I9���,q��wM���H��� ������I�������H���#��H�|$H��H�L�7L�t$M���ED�w@��D9��3�	9��'D)�L�t$A�Ff����A�f����{f����I�����H�+�ȀI��f���΀@�uH�;�GM0H��q����#���O���]R���T���SV�%���Y���[\�!��w^���&v���k~��������A�D��I���hH�+�ǃȀI��f���E�H�3@�~H�+�EM0H��H�D$H��L�H�8H��t-D�p@��D9�r�@	9�wD)�A��wf���������������>��I����H�3��@I����H�@�hI�H��2M��I)�I����L�^���>���?B�<�����L�L$ A�L�D$H�L$�T$���L�p�#�T$L�ev#f���H�L$L�D$L�L$ �
���1������f�����A�L�,�#L�%v#�T$H�L$L�D$L�L$ ����H���6H���-��<�t��^�u A��2"���A��@!�������|$L�L$ L�D$H�L$�T$tR1�������L���#�T$L��u#f���H�L$L�D$L�L$ �4������|1����B�<Y���H������{H���r��h�����ubI���u���te����H��L�H�0H��t[D�p@��D9�ra�x	9�wmD)��nf���ttA��������������������������������fD��AWA��A��AVAUATUH�-C�#SH�t$8H�6�#H�|$@I�I9���A���h�I��A���M���=���H�����H�H���M�(I�EI�H�L9�}xI���
I��t.B�D)=����L�>H��A�I�H��I�H�L9�}:�=����H�H���I�H��I�H�L9���ff.�1�[]A\A]A^A_�B�D1=��N�L�.H��A�EM�0I�FI�H�L9�}�B�D1=���H�>�M� H�z�M�l$M�(H�M9�}�B�D!=����L�>H�z�A�I�H��I�H�L9��a����A��=����H�����H�H�W�H��D�(M�0M�~M�8H�M9��2�������ff.�f���ATUSH�D$ H�\�#H�|$(I�0L9������s�I��A���@�41A�����H�����H�0H��D�I�(H�uI�0H�L9�}oI���I��t+�t)�����L�H��A�3I�0H��I�0H�L9�}4�41A���g�H�0H��D�I�0H��I�0H�L9���1�[]A\�f�B�t���$�L� H��A�4$M�I�sI�0H�L9�}�B�t�����H�8@�7M� I�z�M�\$M�H�M9�}�B�t!�����H�8@�7M� I�z�I�t$I�0H�L9��e����41�����H���N�L� L�W�L��A�4$M�I�sI�0H�L9��:����%���D��AVATUI�(SH�D$(H�|$0L9���L�5��#�����I��A���<�4)A�����H�����H�0H��D�I�H�kI�(H�L9�}mI����I��t,�t���t�L� H��A�4$M�I�kI�(H�L9�}1�4)A���F�H�0H��D�I�H�kI�(H�L9���1�[]A\A^��B�t����H�(H��@�uM� M�\$M�H�M9�}�B�t!�����H�8@�7I�(I�z�H�uI�0H�L9�}��t)�����H�@�3I�8H�oI�z�I�(H�L9��g����4)����H�����L� L�W�L��A�4$M�I�sI�0H�L9��<����'������AVI��AUI��ATUH�-�^#SL��M����M�]L��M�f����OH��t_H��t,A�3@���CH���F����Q�M�]M��I��M�]A�3@���H�������%�M�]I��I��M�]A�3@����H����������M�]I��M�]I�����f.�H���������I�MM�f�M��L�YM�]�q@����H���������I�uI��L�^M�]�v@��x\H���_����j�I�}M�t$�L�_M�]�w@��x2H���5����@�M�]M��I��M�]I��tCA�3@���K���D�F_A��>wA���H���������5M�]I��M�]I���^���1�[]A\A]A^�f.�D�NA��vD�V A��
v[�]A\A]A^�I�����E�[A�K�������A�����@��ߍV�F?F��E�����A�K���]A��B�D !w~D�Y!<!u
A��@����H��H�H�7H��t`D�GE8��Y�D8_	rVE��E)�Mc�B�4V������H�����������I�EI���a��������A��~뀸�����������<�H����������������AWI��AVI��AUATUH�-�[#SL��H��M����I��0@����M�g�M��A����H���=�������I�M��H�AI��q@��xoI���[I��t'H����������I�I��H�BI��r@��x8H�����������I�6I��H�FI��v@���ff.�f�@�����@�����I����D�X@���u
A�����D�n�A��H��H�H�
H�����H��[]A\A]A^A_�ff.�H���8�������M�I��I�@I�A�p@���d���H����������M�M�|$�I�AI�A�q@���7���H�����������M�M�|$�I�BI�A�r@���
���H��������_�I�>M�g�M��H�GI�M��tt�w@���G�������f��rA�ÀA8�rdD:Z	whA��)�Lc�B�4a������H���K�������I�I������1�����ff.�H��1�[]A\A]A^A_ø�������H��������I�����D�HD�@H�$I#A���E��I��I�M�M���9���R���I�����H�q_@��>�����-���1��&����<��&���f���AWAVAUATUSH��H����H��I��L�-�8#L��H��0@����hM�w�M��A���#H��������O�H�M��H�AH��q@����,I����I��t,H����������H�I��H�BH��r@�����H����������H�3I��H�FH��v@������ff.��H���x�������L�I��I�@H�A�p@�����H���K�����~�L�M�~�I�AH�A�q@���w]H���"�����U�L�M�~�I�BH�A�r@���w4H��������,�H�;M�w�M��H�GH�M��tF�w@����M���D�^`A��?wC@���������H����������H�I���P���H��L��[]A\A]A^A_�@�����I�����@��D�`H��H��L�H�9H���RD�NA��vD�V A��
��E�D$�A����8�A���.�@��ߍ~�F?F��E����E�D$�A��]A��B�D0!��A��!D��L�
-V#I��M�M�$M����A�t$D8����E8D$	��E��A)�Ic�A�4J�������H����������H�I��M���.�������ff.���@��	wQA�t$�@��>vE�\$�A��|w;iʼA��E���0���A���/H�������y��N�E�D$�����A��f���D�qE8������D8a	�����A��D)�H�D�GA�����{���D���,������H�����������H�I���!���E1�����D��H����AWL�=��"AVI��AUL�-�T#ATI��UL��SH��H��M��*fDH���H������M�I��M�H���SA�2@��[v�@��\�,@��}v�@��~�@�����V_��>w&���H��������y��(�ff.�@�N��v
�~ @���H�����E�RE�J�A�����A����@���D�F�F?AF��E����E�J�A��]@��A��~�A��]��<]����!I����H��H��H��L�L�M�����yD8���D8Q	��E��A)�Ic�A�4p�����nH���������DI�H��H���~���1�H��[]A\A]A^A_�E�Q!<]�f���<f����I���A��A��;��A��t<}��D��L��H��L�H�H������yD8�����D8Q	����E��A)�Ic��4p��������H���?�����rI�H���H���<.tvA��~A��</tZA��T@��D	�<OA��D���S��<tt,A�r�@��A��<~��A����������ff.�f�A��'u��E��t�������A��!u������H���[]A\A]A^A_�I��H��!#I��I�M�M������A�{D8�����E8S	����A��)�Lc�C�4H��������H���5�����C����q��<bv��7���<_t��=�~��������> H�������������5����H�������������������1���	����H��������t���������������ff.����AWI��AVI��AUATL�%�P#USL��H��H�4$M����I��2@����M�o�L����CH���:��������I�M��H�QI��q@��xlH���H��t'H�����������I�I��H�QI��q@��x5H���������[��I�I��H�QI��q@����f.�@����@����6I�����AH�<$�D�F��x�uY@����C<�A��@����#<�A��E	�@���A��E���C��@������h@��A��@�����A���(��@���u<���@���u<��|A��H��H��M�4M���0H��H��L�D�BA8��@8z	�D��E)�Mc�C�4Z������H��������KI�I���4���1��(ff.�H���x��������I�I��H�QI��q@�������H���M��������I�M�}�H�QI��q@���z���H���"��������I�M�}�H�QI��q@���O���H��������u��I�M�o�M��H�QI�M�����q@���H�������H��L�-#H��L�H�MH����I��L��
#I��M�M�M���-��H��L��"L�H�H���y���H��[]A\A]A^A_�<���������E���������<�������뻐H��1�[]A\A]A^A_��u@8��`���@8}	�V���D��A)�Ic��4Q�����<���H���������+����O��f�@���t.@���tNI�����BH�<$�D�F��x��m�������I������D�ZA�K_��>���������I������D�JD�ZA���A�i�A�C�@��A���A��D��tH�<$���D��L�l�"L��H��I�I�H���K��M��H�
L�"I��L�H�9H������I��L�
.<#M�I�)H���w����_���H������S���1��L���H������@�����H�����������t���^�H���������������<�H���e�������������������ATUSH�F�������H���?��H��H������H�-ܞ#H����H��H�=���������H��H�=x�������H��H�=g�����tCH��H�=[�������L�%��"H�=�H���e����tI��HI�<$�?u��1��L�%(�"1�H�5=L������H��H����1�1�H��H�����H�+I��uH�����L��[]A\�L�%L�"�H�=��n��H��H������H�5�H�����H�mH�ǝ#����H�-��#H�������[��L�%=�"�X���L�%��"�L����>��ff.�@��AWAVAUATUSH��(I�8�D$pH�l$`L�d$h���D$L9���I��L��i#L��y#L�=�Y#������A����f��9���n����\�e����~��M���|��H�EI���I�0H�~I�8H�EL9�}B�\1A�ރ��$����\�����~tlH�uI��D�6I�H�{I�8H�EL9��x���1�H��([]A\A]A^A_���9A�ރ�������\������~tM�������1�����������D��AWL��x#A�;���L��X#AVAUI��ATUSH��(�D$pH�\$`L�d$h���D$I�0I9������I��L����D�,1������M������H�3I��@�.I�(H�uI�0H�L9�}nH���H��t+�l)���f��H�;I��@�/M�0I�vI�0H�L9�}3�,1���<��H�3I��@�.I�(H�uI�0H�L9���D1�H��([]A\A]A^A_�ff.�@�l)����H�3I��@�.M�0I�vI�0H�L9�}�B�l1����L�#A�,$I�(L�`�H�uI�0H�L9�}��l)��wdH�3L�`�@�.I�8H�wI�0H�L9��]����,1��wDM���L��L�3I�D$�I��A�.I�(H�uI�0H�L9��F����!���1������+���&���!�����fDH�=1�#H�*�#H9�tH�V�#H��t	�����H�=�#H�5��#H)�H��H��H��?H�H�tH��#H��t��fD�����=��#u+UH�=��#H��tH�=��"�Y���d������#]������w������AV��H�=��#AUATUSH��dH�%(H��$1��i��I��H���~H�5KH�_�"H��E1�L�d$@H�__map_1ҹL��H�$L���H�H�T$H�}�����1�H�5�H���~��H��L��H���@�����tH��H�3�>u�H��$dH3%(L��uH��[]A\A]A^������H��H���euc_jis_2004_multibytecodec__create_codecshift_jiscp932euc_jpshift_jis_2004no such codec is supported.multibytecodec.__map_*jisx0208jisx0212jisxcommonjisx0213_1_bmpjisx0213_2_bmpjisx0213_bmpjisx0213_1_empjisx0213_2_empjisx0213_empjisx0213_paircp932exteuc_jisx0213shift_jisx0213getcodec_codecs_jpencoding name must be a string.000���0�����0�0�@��>��?��0�0�0�00�N000�0  �\0 \�& %     �	�00;�=�[�]�0	0
000
00000�"����`"��f"g""4"B&@&�2 3 !�������
� ��&&�%�%�%�%�%�%�%�%�%�%�%; 0�!�!�!�!0����������������������""�"�"�"�"*")"����������������'"("��!�!""���������������������� "�"#""a"R"j"k""=""5"+","��������������+!0 o&m&j&  ! ����������%������������������������!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�������������A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�A0B0C0D0E0F0G0H0I0J0K0L0M0N0O0P0Q0R0S0T0U0V0W0X0Y0Z0[0\0]0^0_0`0a0b0c0d0e0f0g0h0i0j0k0l0m0n0o0p0q0r0s0t0u0v0w0x0y0z0{0|0}0~00�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0���������������������������������������������������������������� !"#$%&'()*+,-./������������������������������012345Q6789:;<=>?@ABCDEFGHIJKLMNO%%%%%%%,%$%4%<%%%%%%%#%3%+%;%K% %/%(%7%?%%0%%%8%B%�NUZ?��Ta(c�Y"�u��Pz�`�c%n�ef������h'W�eqb�[�Y{��b}�}��b�|���[�^	c�fHhǕ��Og�N
OMO�OIP�V7Y�YZ	\�`apafi�pOupu�y�}�}À�c��U�z�;S�N�N�W�����xN�X�n8�2z(���/�AQpS�T�T�V�Y_��m�-�b�p�����T�S�[�p��oS\��zN�x��&nVUk�;��Y�Sfm�t��BV�NK��O���S�U0[q_ f�fh8l�l)m[t�vNz4��[�`�풲m�u�vř�`������i�S�QW0XDY�[�^(`�c�c�lo�pqYq�q?s~v�т��`�[��iX�eZl%u�Q.YeY�_�_�b�e*j'k�k�s�V�,��Ğ�\�l{�QK\�aƁvharYN�OxSi`)nOz�NS�NUO=O�OsO�R�S	VY�Z�[�[�y�f�g�gLk�lkp�s�y�y<z�{��ۂ�w��Ӄf���)V���N�����O�\bYr;u偽�����Ŗ�ՙ�NO��VJX�X�^�_*`�`b`�ab�b9eA�ff�hwmppLu�vu}�����������Q�RY�T�[]ha�i�m�x˄W�r�����lm��ن�W�gΆ��R�VT�^�b�d<h8h�krs�xkz��҉k��퐣���i�f[�\}iM�N��c {+jj�h
�_orR�Up`�b;mn�n[��D�N9��Si:j��*h\Q�z��ܑ��[V(�"h�1��|Rł�t~N�O�Q�[
R�R�R�]�U*X�Y�[�[�[r^y^�`aca�a�cbe�gSh�h>kSkWl"o�oEo�tu�vw�z�{!|�}6���f�����̊����Q�������e�ӗ(��8N+T�\�]�sLv<w�\�����T�X�OOqS�UhV�WGY	[�[�\^~^�_�c:g�e�eg�h�h_j0^�kl}luHyc[z}�_�����w�̎���<��N}PQ�Y�[/b�b�d:k�r�uGy�����p��cʃ��	TT�UThXjp�'xug͞tS�[�P��NEN�NO�S8T�[_%`Qe=gBlrl�lxptvz�z{}�|f}�e[r�SE\�]�b�bc nZ�1�ݍ��o�yZ��N�N�N�O�O�PGQ�zqQ�QTS!SS�S�U�X�\7_J_/`P`m`cYeKj�l�r�r�w����N�����W�Z��N�Q-\�fmi@\�fui�sPh�|�P�RGW�]&��e#k=k4t�y�yK{�}��̃�_�9�яёT��]N6P�S:S�r�s�w悯�ƙșҙwQa^��UzzvP�[G���2N�j�Q\H\�c�z�lt�a��z�q���|hp~Qhl��RT����͎�fS��Ay�O�PRDQSU-W�s�WQYb_�_u`vaga�a�c:dleofBhnfu=z�|L}�}K~k�J�͆�c�f��������Ώ蛇Rb�d�o��Ah�P kzlTotzP}@�#�g�N9P&PeP|Q8RcR�UWX�Z�^�a�a�brci)j}r�r.sxoxy}w������Ҏc�u�z�U��x�CQ�S�S{^&_n�n�s�sC}7����P�NNP�S|T�V�Yd[�]�^'_8bEe�gVn�r�|������N����7�ǖg���N�N
OHSIT>T/Z�_�_�`�h�jZt�x����w���^Nɛ�N|O�OPPIQlQ�R�R�R�S�STT�UQW�W}YT[][�[�]�]�]x^�^�^�^_R`La�b�b�c;efCf�fmg!h�h�i_l*mim/n�n2u�vlx?z�|}}^}�}������T���*�R�L�a������ʐu�q�?x����M����ؚ;�[R�R�ST�X�b�oj�_���KQ;RJT�V@zw�`�ҞDs	op�u�_�`���r��dk��N�VdW�XZZh`�aff9h�h�m�u:}n�B��NPO�SUo]�]�]�g�lstxP���߈PW�^+c�P�P�Qg�T^X�Y�[i_Mb�c=hskn}pǑ�rx&xmy�e0}܃��	���dR(WPgj���QBW*�:X�i���T]�W�x��\OJR�T>d(fg�g�zV{"}/�\h��9{S�Q7R�[�b�d�d-g�k��і�v֛Lc����vRf	N�P�Sq\�`�dce_h�q�s#u�{�~����یx���e�f�k�N�N:OO:R�S�S�U�V�X�Y�Y�YP[M\^+^�_`c/e\[�e�e�e�gbk{klEsIy�y�|}+}���󁖉^�i�f����nj܌̖��ok�N<O�OPQW[�[HacBf!k�n�l>r�t�u�x:y�3�ꁔ���Pl�_X�+��z���[�N�S�W1Y�Z�[�`no�uꌟ[��{rP�g��a\J�~��Q\hcf��enq>y}��ʎn�dž��P�R:\Sg|p5rL�ȑ+���[1_�`;N�S�[Kb1g�k�r�s.zk���R���Q�SjT�[�c9j�}��V�ShT�[1\�]�Oa�b2m�y�yB}M~�����F�r���t�/�1�K�l�Ɩ���NOOEQAS�_b�gAlncs&~͑���SY�[�m]y.~�|~X�q�QS���O�\%f�w�z����Q�_�eoi�k�m�ndo�v}�]u�����QR@b�f�fn�^�}r�f�������R�SsY�^�_U`�d��PQ�R SGS�S�TFU1UVhY�Y<Z�[\\\\�^�^�^p_b�b�b�cwcff-fvf~g�hj5j�l�m	nXn<q&qgq�uw]xyey�y�z{�|9}��փ��I�]���<�T�s�a�ތ��f�~������
NNNWN�QpR�W4X�X"[8^�`�dagVgDm�rsucz��r��� �1V�W���b
i�k�qT~w�r��ߘU���;\8O�O�OU Z�[�[�_Na/c�eKf�h�ixm�m3u�uw^y�y3}は�����:�����2�ݑ��N�NRuX�X\u=\N�
�ŏc�m�%{ϊ�b��V�S�9T�W%^�c4l�paw�|�p�B�T�����^tĚ]i]pe�g��ۖncIgiŃ������ozd�[N,p]u/f�Q6R�R�Y�_'`b?eteftf�hhcknrru�v�|V��X�������ˊ���R�Y��ez���-^�`b�ef�g�wMzM|>~
���d��_��xR�b�cBd�b-��z�{���v}�I��NHQCS`S�[\\�]&bGb�dh4h�lEmm�g\oNq}q�ez�{�}J~�z��9���n�Ό��x�w���������MR�U8o6qhQ�yU~���|LVQX�\�c�f�fZi�r�u�uyVy�y�| }D}�4�;�a� ��PuR�S�S	P�U�XOY=r�[d\S�`�`\c�c?c�c�d�e�f�]�i�io�q�N�u�v�z�|�}�}a�I�X�l�����ňp��m������P�X�aӁ5�� ��OtPGRsSo`Ic_g,n����O^\ʌ�e�}RS��vQ�cX[k[
\
dQg\��NY*YplQ�>UX�Y�`Sb�g5�Ui@�ę(�SOX�[��\/^�_ `Ka4b�f�l�n΀�Ԃ�����.���۞ۛ�N�S'Y,{��L����n'pSSDU�[Xb�b�b�l�o"t�8��o��8��Q���S�SFOT���jY1��]�z���h7��rH�=j��9NXSVfW�b�c�eNk�m[n�p�w�z�{�}=�ƀˆ��[��V�X>_�e�f�j�k7uNJ$P�w0W_e`zf`l�uzn��E����{\u�zQ{Ą��y�z6��Z@w-N�N�[�_�b<f�g�lk�w�;�N��Йj&p*s�W���NFQ�Q�U�[^3^�^_5_k_�_�ac�fgnoRr:u:wt�9�x�v���܊��󍚒w����RWc�vg�l�sÌ��s�%m�Xi�i�����u�ZXh�c�iCO,o�g��&��}T�?ipojW�X,[,}*r
T㑴��NNO\PuPCR��HT$X�[^�^�^�^_�`�b:c�c�h@l�x�yz�}G���D����-�ؑ��lXd�due�n�v{i�ѓ�n�T�_�dM��D�xQkX)YU\�^�m�~u���[��pO�k�o0u��NQT5XWX�Y`\�_�e\g!n{v߃����M�%x:x�R�^WtY`PZQ�Q�QRUTXXXWY�[�\�]�`�b-dqgCh�h�h�v�mon�mop�qS_�uwyI{T{R{�|q}0Rc�i����F�����v�-�0�ؕ�P�RTX\�a�dm�w�z��S����\�?S�_�_�myrcw�y�{�k�r��haj�Q�z4iJ\����[I�pxVo\�`fe�lZ�A��QT�f
�HY���QMN�Q���XpzcK�bi��~wuWS`iߎ�]l�N<\_�Sь��y��^�esNeQ�Y?\�N�Y�_���o�yby�[q�+s�qt^�_{c�d�q�|CN�^KN�W�V�`�o
}��3����������]�b�d��wg�l>m6t4xFZu�����O�^�b�cWeog�vLr̀��)�M�
P�W�Z�hsidq�r���X�j����y�w)�/OeRZS�b�g�l}v�{�|6�����f or~�������Q�{rx�{��H{�ja^��Qu`ukQb��nzv���Op�bO{���zVYX䆼�4O$RJS�S�S^,d�eg>lNlHr�r�sTuA~,�酩��{Ƒiq��=cifju�v�xC��*SQS&T�Y�^|_�`Ibyb�b�e�k�l�u�v�x�y�}w���������^�ۘj8|�P>\�_�g�k5t	w�;��gz9S�u�f_��񃘀<_�_buF{<�gh�Y�Z}~v,��Oj_j7lo�thyh�U�y��^�c�u�yׂ(�򒜄�-��Tl_�e\mp��ӌ;�Oe�t
N�N�W+YfZ�[�Q^�^`vbwe�enfnm6r&{P�����\����t��D��O�dfk�a�j��\Si��z�W�OoR�_E^
g�yy�����m_Ub�l�Nir��R;TtV�X�anbqnY�|�|}�e^�NuOuQ@Xc^s^
_�g&N=���[�s|��P�XVv�x%R�w��{OP	YGr�{�}��ԏM��O�R)Z_���O��WUcik+u܈�Bz�R�XUa
b�f�k?|�#P�OSFT1XIY�[�\�\)]�^�bgc>e�eg�l�l�p2x+~ހ������*�J���Ғ���l�ON�N�PVRJW�Y=^�_�_?b�fg�g�h�Q!}���������~�2� T,�S�P\S�X�d4ggrfwFz��R�l�kXL^TY,g��Q�vid�xT����W�Y'f�g�k�T�iU^���g���gR�]h�N�O�S�b+g�lď�Om~��Nba�n+o�sT*gE��]�{�\�[�Jnфz��Y�|l w�R"Y!q_r�w'�a�iZZ�Q
T}Tf�v������Y]r�nMQ�h�}�}b���xd!j��Y_[�ks�v�}���2Q(gٞ�vbg�R�$\;b~|��OU�`}��S_N�QY:r6�Α%_�w�Sy_}��3���V��g��S�	aa�lRv�8�/UQO*Q�R�S�[}^�`�a�c	g�ggn�m6s7s1uPyՈ��J�����Ė��Y�NYON��?���P|^�Y�[�^�c�c�d�fJi�im�n�q(u�z��I�Ʉ��!�
�e�}�
�~a�b2k�ltm���m�����eg��<���ma}=�j�qNuSP]k�oͅ-���)RTe\Ng�ht�t�uψ�̑�x��_�s�zN��ceu�RAm�n	tYukx�|���z���Ona�e\��N�N�P!N�Q�[�e�h�msBv�wz�|o�Ҋ|�ϑu���R�}+P�S�g�m�q3t�*���W���`tAX�m/}^��N6O�O�Q�R�]`�s<yӂ4�����
���b��ftkR�R�pˆ�^K`�a#oIq>|�}o��#�,�BTo��j�pŒ�2��RAZ�^_g|i�ijmobr�r�{�~�K�ΐmQ���y��2�֊-P�Tq�jkČ��`�g�N�N�k���h�i~n�xU�_NN*N1N6N<N?NBNVNXN�N�Nk��N�
_�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N	OZO0O[O]OWOGOvO�O�O�O{OiOpO�OoO�O�OQ�O�O�O�O�O�O�O�O�O�OP(PP*P%PPO�O!P)P,P�O�OPPCPGPgUPPPHPZPVPlPxP�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P	QQQQQQQ!Q:Q7Q<Q;Q?Q@QRQLQTQbQ�ziQjQnQ�Q�Q�V�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�QU��Q�Q�Q�Q�QRRRR'R*R.R3R9RORDRKRLR^RTRjRtRiRsRR}R�R�R�RqR�R�R�����R�R�R�R�R�R�R�R�R�R��R�R�R�R�RSS8u
SSSSS#S/S1S3S8S@SFSESNISMS�Q^SiSnSY{SwS�S�S�S�S�S�S�S�S�S|ٖ�S�f�q�S�S�S�ST=T@T,T-T<T.T6T)TTNT�TuT�T_TqTwTpT�T{T�TvT�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�TUU�T�T�T�T�T9U@UcULU.U\UEUVUWU8U3U]U�U�U�T�U�U{U~U�U�U�U|U�U�U�U�U�U�U�U�U�U�U�UV�UV�U�UV�UNVPV�q4V6V2V8VkVdV/VlVjV�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�VW�VW	WWW
WWWW�UW&W7W8WNW;W@WOWiW�W�WaWW�W�W�W�W�W�W�W�W�W�W�W�W
X�W�WXXXrX!XbXKXpX�kRX=XyX�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�XY
YYY�h%Y,Y-Y2Y8Y>Y�zUYPYNYZYXYbY`YgYlYiYxY�Y�Y^O�O�Y�Y�Y�Y�Y�Y�Y�Y%ZZZZ	ZZ@ZlZIZ5Z6ZbZjZ�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z[[[2[�Z*[6[>[C[E[@[Q[U[Z[[[e[i[p[s[u[x[�ez[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[\\\
\\ \"\(\8\9\A\F\N\S\P\O\q[l\n\bNv\y\�\�\�\�Y�\�\�\�\�\�\�\�\�\�\�\�\�\�]�\]]]\]]]]]"]]]]L]R]N]K]l]s]v]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]^^^^^6^7^D^C^@^N^W^T^_^b^d^G^u^v^z^��^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^_	_]_\____)_-_8_A_H_L_N_/_Q_V_W_Y_a_m_s_w_�_�__�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�`�_!`````)``1```+`&``:`Z`A`j`w`_`J`F`M`c`C`d`B`l`k`Y`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�_�`�`�`�`Maaa�`�`a�`�`a!a�`�`
aaGa>a(a'aJa?a<a,a4a=aBaDasawaXaYaZakataoaeaqa_a]aSaua�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�ay�a�a�a�a�a�a�a�a�a�abb	b
bbbbb!b*b.b0b2b3bAbNb^bcb[b`bhb|b�b�b~b�b�b�b�b�b�b�b�b�b�b�b�b�d�b�b�b�b�b�b�b�bc�b�b'ccc�b�bPc>cMcdOc�c�c�c�cvc�c�c�c�c�ckcic�c�c�c�c�c�c�c�c�cd4ddd&d6ded(ddgdodvdNd*e�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d	��d�d�b�d�d,e�d�d�d�de�deee$e#e+e4e5e7e6e8eKuHeVeUeMeXe^e]erexe�e�e���e�e�e�e�e�e�e�e�e�e�e�e�e�e�erg
ff�esg5f6f4ffOfDfIfAf^f]fdfgfhf_fbfpf�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f?f�f�f�f�f�fggg&g'g8�.g?g6gAg8g7gFg^g`gYgcgdg�gpg�g|gjg�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�jhFh)h@hMh2hNh�h+hYhchwhh�h�h�h�h�h�h�h�j�hth�h�h�hi�h~hi�hi�h"i&i�hi�h�h�h�h6iii�h�h%i�h�h�h(i*ii#i!i�hyiwi\ixikiTi~ini9iti=iYi0iai^i]i�iji�i�i�i�i�i�i�i�i�[�i�i�i�i�i.j�i�i�i�i�i�i�ijj�i
k�i�i�ij�ij�ij�i
jj�j#jjDjjrj6jxjGjbjYjfjHj8j"j�j�j�j�j�j�j�j��j�j�j�j�j�j�j�j�j�j�j�j�jk��jkk1�k8k7k�v9k�GkCkIkPkYkTk[k_kakxkykk�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k��llll$l#l^lUlbljl�l�l�l�l�l~lhlsl�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�lmM�6m+m=m8mm5m3mmmcm�mdmZmymYm�m�m�o�m�mn
n�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m-nnn.nnrn_n>n#nkn+nvnMnnCn:nNn$n�nn8n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�nAooLp�n�n�n?o�n1o�n2o�n>oo�n�ozoxo�o�ooo[o�omo�o|oXo�o�o�ofo�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o	pp�oppp�opptoppp0p>p2pQpcp�p�p�p�p�p�p�p�p�p�p�p�p	q�pqqeqUq�qfqbqLqVqlq�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q
rrr(r-r,r0r2r;r<r?r@rFrKrXrtr~r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rPs
ssss4s/s)s%s>sNsOs؞Wsjshspsxsus{szs�s�s�s�s�s�s�s�s�ttot%t�s2t:tUt?t_tYtAt\titptctjtvt~t�t�t�t�t�t�t�s�t�t�t�t�t�t�t�t�t�tuuuuu
uuuu&u,u<uDuMuJuIu[uFuZuiudugukumuxuvu�u�utu�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�uv�u�u�u�uv
v	vv'v v!v"v$v4v0v;vGvHvFv\vXvavbvhvivjvgvlvpvrvvvxv|v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v/��vwww)w$ww%w&ww7w8wGwZwhwkw[weww~wyw�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�wxx&y x*yEx�xtx�x|x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�xyyyy,y+y@y`yWy_yZyUySyzyy�y�y�yK��y�y�y�y�y�y�y�y�y�y�yz
zzz zz�y1z;z>z7zCzWzIzazbziz��pzyz}z�z�z�z�z�z�z�z�z�z�z�z�z���z�z�z�z�z�z�z�z�z�z�z�z�z�z{{
{{3{{{{5{({6{P{z{{M{{L{E{u{e{t{g{p{q{l{n{�{�{�{�{�{�{�{�{�{]{�{�{�{�{�{�{�{�{�{||�{�{`||||�{�{|
|�{#|'|*||7|+|=|L|C|T|O|@|P|X|_|d|V|e|l|u|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|;��|�|�|�|�|}}}}
}E}K}.}2}?}5}F}s}V}N}r}h}n}O}c}�}�}[}�}}}�}�}�}�}�}�}�}�}=~�}�}�}�}�}�}�}�}�}�}�}�}�}~
~#~!~~1~~	~~"~F~f~;~5~9~C~7~2~:~g~]~V~^~Y~Z~y~j~i~|~{~�~�}}~��~�~�~�~�~�~�~�~�~�~�~�~8:ELMNPQUTX_`higx�����������������q�����������ܘ�������!�(�?�;�J�F�R�X�Z�_�b�h�s�r�p�v�y�}�����������������Q��ۀ�ـ݀Āڀր	����)�#�/�K���F�>�S�Q���q�n�e�f�t�������������������_�������������������Ɂ́сف؁ȁځ߁�����������
�
���)�+�8�3�@�Y�X�]�Z�_�d�b�h�j�k�.�q�w�x�~���������������߂҂���������ނ�܂	�ق5�4��2�1�@�9�P�E�/�+���������������#�������|���s�u����������΃���؃��������
�"� ���8����m�*�<�Z���w�k���n���i�F�,�o�y�5�ʄb�������ل̈́��ڄЄ��Ƅք��!������,������@�c�X�H�A��K�U�������������m�����ꅇ���w�~���Ʌ��υ��ЅՅ݅�܅��
��������"��0�?�M�UNT�_�g�q�����������������ĆƆ��Ɇ#���Ԇކ��߆ۆ���������	�
���
�4�?�7�;�%�)��`�_�x�L�N�t�W�h�n�Y�S�c�j����������ˇ����Ї֖��ć��LJƇ������
��������҇���"�!�1�6�9�'�;�D�B�R�Y�^�b�k���~���u�}���r�����������������������ÈĈԈ؈و݈����������
��C��%�*�+�A�D�;�6�8�L��`�^�f�d�m�j�o�t�w�~�������������������������������ډ܉݉��������%�6�A�[�R�F�H�|�m�l�b���������������������Ċ͊Šڊ���������ފۊ������� �3���&�+�>�(�A�L�O�N�I�V�[�Z�k�_�l�o�t�}�����������������:�A�?�H�L�N�P�U�b�l�x�z���������������|���b��������������Ȍ����ڌ��������
���
��N��͌��g�m�q�s���������ύڍ֍̍ۍˍ��ߍ���	�������B�5�0�4�J�G�I�L�P�H�Y�d�`�*�c�U�v�r�|�����������������������������Ǝ����ŎȎˎێ������
����������&�3�;�9�E�B�>�L�I�F�N�W�\�b�c�d�������������ڏ������������!�
����'�6�5�9���O�P�Q�R��I�>�V�X�^�h�o�v���r���}���������������������Hbې���2�0�J�V�X�c�e�i�s�r�������������������������ɑˑБ֑ߑ�ۑ����������,���^�W�E�I�d�H���?�K�P���������Z�ϒ��������D�.��"��#�:�5�;�\�`�|�n�V�����������֓ד��ؓÓݓГȓ�������6�+�5�!�:�A�R�D�[�`�b�^�j�)�p�u�w�}�Z�|�~����������������������������������ʕ�oÕ͕̕Օԕ֕ܕ���!�(�.�/�B�L�O�K�w�\�^�]�_�f�r�l���������������������������Ζ˖ɖ͖M�ܖ
�Ֆ�����������$�*�0�9�=�>�D�F�H�B�I�\�`�d�f�h��Rk�q�y���|���z���������������������×Ɨȗ˗ܗ�O���z������8�$�!�7�=�F�O�K�k�o�p�q�t�s���������ĘØƘ���	����!���$� �,�.�=�>�B�I�E�P�K�Q�R�L�U�������������ߙۙݙؙљ�����������+�7�E�B�@�C�>�U�M�[�W�_�b�e�d�i�k�j���������ϚњӚԚޚߚ��������������"�#�%�'�(�)�*�.�/�2�D�C�O�M�N�Q�X�t���������������������ʛ��ƛϛћқ���ԛ�:������	������
��.��%�$�!�0�G�2�F�>�Z�`�g�v�x����	�����*�&���#��D���A�?�>�F�H�]�^�d�Q�P�Y�r�������o�z���������ĝ��������Ɲϝٝӝ���������u�y�}���������������������������a�̞ΞϞОԞܞޞݞ������������������v�!�,�>�J�R�T�c�_�`�a�f�g�l�j�w�r�v�������/X�iY�dt�Q�q��������~�����������������������������������������������������������������������������������������������������"!�!�����������������������������������	
����������������������������������������������������������������������RSTUVWXYZ[\^_���&��2��A?��J�R��f�����������������������������������'138B@IK�S�g���������
������" $�����0*.(469=;CGE������PL�TXVZ\`^db����l�pjrnh����t�xvy}{�������	
��������!%�������+/)57:><DHF������QM�UYW[]a_ec����m�qksoi����u��wz~|NNNNNN#N$N(N+N.N/N0N5N@NANDNGNQNZN\NcNhNiNtNuNyNN�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�NOOOOOOOOOOO.O1O`O3O5O7O9O;O>O@OBOHOIOKOLOROTOVOXO_OcOjOlOnOqOwOxOyOzO}O~O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�OPPPP
PPPPPPPPPPP"P'P.P0P2P3P5P@PAPBPEPFPJPLPNPQPRPSPWPYP_P`PbPcPfPgPjPmPpPqP;P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�PQQQQQQ
QQ�PQQQQQQQ#Q'Q(Q,Q-Q/Q1Q3Q4Q5Q8Q9QBQJQOQSQUQWQXQ_QdQfQ~Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�QRRRRRRRR"R(R1R2R5R<RERIRURWRXRZR\R_R`RaRfRnRwRxRyR�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�RSS
SSSSSSSSSS%S'S(S)S+S,S-S0S2S5S<S=S>SBSLSKSYS[SaScSeSlSmSrSyS~S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�STTT!T'T(T*T/T1T4T5TCTDTGTMTOT^TbTdTfTgTiTkTmTnTtTT�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�TUUUU	UU
UUU*U+U2U5U6U;U<U=UAUGUIUJUMUPUQUXUZU[U^U`UaUdUfUU�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�UVV
V
VVVVVVV,V0V3V5V7V9V;V<V=V?V@VAVCVDVFVIVKVMVOVTV^V`VaVbVcVfViVmVoVqVrVuV�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�VWWW
WWWWWWW W"W#W$W%W)W*W,W.W/W3W4W=W>W?WEWFWLWMWRWbWeWgWhWkWmWnWoWpWqWsWtWuWwWyWzW{W|W~W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�WXXX	X�WX
XXXX X&X'X-X2X9X?XIXLXMXOXPXUX_XaXdXgXhXxX|XX�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�XYYYYYYYA�Y!Y#Y$Y(Y/Y0Y3Y5Y6Y?YCYFYRYSYYY[Y]Y^Y_YaYcYkYmYoYrYuYvYyY{Y|Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�YZZZ
ZZZZZ#Z$Z'Z(Z*Z-Z0ZDZEZGZHZLZPZUZ^ZcZeZgZmZwZzZ{Z~Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z[[[[4[[[[![%[-[8[A[K[L[R[V[^[h[n[o[|[}[~[[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[\\\\#\&\)\+\,\.\0\2\5\6\Y\Z\\\b\c\g\h\i\m\p\t\u\z\{\|\}\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\]]
]]+]#]$]&]']1]4]9]=]?]B]C]F]H]U]Q]Y]J]_]`]a]b]d]j]m]p]y]z]~]]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]^^
^^^^^^ ^.^(^2^5^>^K^P^I^Q^V^X^[^\^^^h^j^k^l^m^n^p^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^________!_"_#_$_(_+_,_._0_4_6_;_=_?_@_D_E_G_M_P_T_X_[_`_c_d_g_o_r_t_u_x_z_}_~_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_`
`
```````$`-`3`5`@`G`H`I`L`Q`T`V`W`]`a`g`q`~``�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`aa
aaaaaaaaaaaa"a*a+a0a1a5a6a7a9aAaEaFaIa^a`alaraxa{a|aa�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�abbbbbbb b"b#b'b)b+b9b=bBbCbDbFbLbPbQbRbTbVbZb\bdbmbobsbzb}b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�bcc
cc
ccccc)c*c-c5c6c9c<cAcBcCcDcFcJcKcNcRcScTcXc[cecfclcmcqctcucxc|c}cc�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c	d
dddddd d"d$d%d)d*d/d0d5d=d?dKdOdQdRdSdTdZd[d\d]d_d`dadcdmdsdtd{d}d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�deee	e
eeeeeeeee"e&e)e.e1e:e<e=eCeGeIePeReTe_e`egekeze}e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�efff	f
fffffff!f"f#f$f&f)f*f+f,f.f0f1f3f9f7f@fEfFfJfLfQfNfWfXfYf[f\f`faf�fjfkflf~fsfuffwfxfyf{f�f|f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�fgggggg g"g3g>gEgGgHgLgTgUg]gfglgngtgvg{g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�gRhhhhh(h'h,h-h/h0h1h3h;h?hDhEhJhLhUhWhXh[hkhnhohphqhrhuhyhzh{h|h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�hi	i
iiiiii1i3i5i8i;iBiEiIiNiWi[icidieifihiiilipiqirizi{ii�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�ijjjjjjjj j$j(j0j2j4j7j;j>j?jEjFjIjJjNjPjQjRjUjVj[jdjgjjjqjsj~j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�jkkkk	kkkkkkk$k(k+k,k/k5k6k;k?kFkJkMkRkVkXk]k`kgkkknkpkuk}k~k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�klll	l
llllll&l'l(l,l.l3l5l6l:l;l?lJlKlMlOlRlTlYl[l\lklmloltlvlxlyl{l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�lmm
mmmmmm&m'm(mgl.m/m1m9m<m?mWm^m_mamemgmompm|m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�mnnn"n'n2n6n9n;n<nDnEnHnInKnOnQnRnSnTnWn\n]n^nbncnhnsn{n}n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�noo
oo
ooooo&o)o*o/o0o3o6o;o<o-oOoQoRoSoWoYoZo]o^oaoboholo}o~o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�opppp
pp p#p/p4p7p9p<pCpDpHpIpJpKpTpUp]p^pNpdpeplpnpupvp~p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�pqqqqqqqqq q+q-q/q0q1q8qAqEqFqGqJqKqPqRqWqZq\q^q`qhqyq�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�qrrr	rrrrrr$r+r/r4r8r9rArBrCrErNrOrPrSrUrVrZr\r^r`rcrhrkrnrorqrwrxr{r|rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rsssss
ssssss"s$s's(s,s1s2s5s:s;s=sCsMsPsRsVsXs]s^s_s`sfsgsiskslsnsosqswsys|s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�stttt
tttt$t&t(t)t*t+t,t-t.t/t0t1t9t@tCtDtFtGtKtMtQtRtWt]tbtftgthtktmtntqtrt�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�tuuuu u!u$u'u)u*u/u6u9u=u>u?u@uCuGuHuNuPuRuWu^u_uauouquyuzu{u|u}u~u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�uvvvvvv
vvvvvvvvvvvv#v%v&v)v-v2v3v5v8v9v:v<vJv@vAvCvDvEvIvKvUvYv_vdvevmvnvovqvtv�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�vww
wwwwwwwww"w(w-w.w/w4w5w6w9w=w>wBwEwFwJwMwNwOwRwVwWw\w^w_w`wbwdwgwjwlwpwrwswtwzw}w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�wxx	x
xxxx!x"x#x-x.x0x5x7xCxDxGxHxLxNxRx\x^x`xaxcxdxhxjxnxzx~x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�xy�x�x�x�x�xyyyyyyy y%y'y)y-y1y4y5y;y=y?yDyEyFyJyKyOyQyTyXy[y\ygyiykyryyy{y|y~y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�yzzz	z
zzzzzz!z'z+z-z/z0z4z5z8z9z:zDzEzGzHzLzUzVzYz\z]z_z`zezgzjzmzuzxz~z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z{{{#{'{){*{+{-{.{/{0{1{4{={?{@{A{G{N{U{`{d{f{i{j{m{o{r{s{w{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{|||||	||||||| |%|&|(|,|1|3|4|6|9|:|F|J|U|Q|R|S|Y|Z|[|\|]|^|a|c|g|i|m|n|p|r|y|||}|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|}}}	}}}}}}}}#}&}*}-}1}<}=}>}@}A}G}H}M}Q}S}W}Y}Z}\}]}e}g}j}p}x}z}{}}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}~�}�}�}�}�}�}�}�}�}�}�}~~~~~~~ ~'~(~,~-~/~3~6~?~D~E~G~N~P~R~X~_~a~b~e~k~n~o~s~x~~~�~�~�~�~�~�~�~�~�~�~�~<;=>?CDGORS[\]acdefmq}~�������������������������������������
�
���������� �$�&�,�.�0�4�5�7�9�:�<�>�@�D�`�d�f�m�q�u���������������������Ȁ̀πҀԀՀ׀؀������������������� �$�'�,�0�5�:�<�E�G�J�L�R�W�`�a�g�h�i�m�o�w���������������������������������ˁÁŁʁ΁ρՁׁہ݁ށ�������������������������!�"�(�2�4�:�C�D�E�F�K�N�O�Q�V�\�`�c�g�m�t�{�}����������������������������������������������������������������ƂЂՂڂ������������������
��T�����!�"�,�-�.�0�3�7�:�<�=�B�C�D�G�M�N�Q�U�V�W�p�x�}������������������������������������������ǃɃσЃуԃ݃S������������
�������/�9�E�G�H�J�M�O�Q�R�V�X�Y�Z�\�`�d�e�g�j�p�s�t�v�x�|�}�����������������������������������„DŽȄ̄τӄ܄������2���������������"�#�$�%�'�*�+�/�3�4�6�?�F�O�P�Q�R�S�V�Y�\�]�^�_�`�a�b�d�k�o�y�z�{�}������������������������������������������������…Džʅ˅΅��؅څ߅������������
���������!�'�)�6�8�:�<�=�@�B�F�R�S�V�W�X�Y�]�`�a�b�c�d�i�l�o�u�v�w�z�������������������������������������������Æņц҆Ն׆چ܆���熈�������������������!�#�(�.�/�1�2�9�:�<�=�>�@�C�E�M�X�]�a�d�e�o�q�r�{�������������������������������������������������������ȇɇʇ·Շևهڇ܇߇���������������	�
�������������(�-�.�0�2�5�:�<�A�C�E�H�I�J�K�N�Q�U�V�X�Z�\�_�`�d�i�q�y�{���������������������������ʈˈ͈̈Έш҈ӈۈވ��������
��������� �&�'�(�0�1�2�5�9�:�>�@�B�E�F�I�O�R�W�Z�[�\�a�b�c�k�n�p�s�u�z�{�|�}���������������������������������ԉՉ։׉؉��������������������� �"�$�&�+�,�/�5�7�=�>�@�C�E�G�I�M�N�S�V�W�X�\�]�a�e�g�u�v�w�y�z�{�~������������������������������������������ÊƊȊɊʊъӊԊՊ׊݊ߊ����������������
�-�0�7�<�B�C�D�E�F�H�R�S�T�Y�M�^�c�m�v�x�y�|�~�����������������������8�9�=�>�E�G�I�K�O�Q�S�T�W�X�[�]�Y�c�d�f�h�i�m�s�u�v�{�~�������������������������ŌƌɌˌό֌Ռٌ݌����������������	����e�i�l�n������������������������������������������ōƍǍȍʍ΍эԍՍ׍ٍ���������������� �!�"�#�&�'�1�3�6�7�8�9�=�@�A�K�M�N�O�T�[�\�]�^�a�b�i�l�m�o�p�q�y�z�{�������������������������������������������ÎĎǎώюԎ܎������������������� �!�#�%�'�(�,�-�.�4�5�6�7�:�@�A�C�G�O�Q�R�S�T�U�X�]�^�e�������������������������Əʏˏ͏ЏҏӏՏ������������������(�)�/�*�,�-�3�4�7�?�C�D�L�[�]�b�f�g�l�p�t�y�������������������������������������������̐��ÐĐŐǐȐՐאِؐܐݐߐ�Ґ�������������
��������� �%�"�#�'�)�.�/�1�4�6�7�9�:�<�=�C�G�H�O�S�W�Y�Z�[�a�d�g�m�t�y�z�{�������������������������������������������������������‘Ñőӑԑבّڑޑ����������������������	�
���������#�$�%�&�(�.�/�0�3�5�6�8�9�:�<�>�@�B�C�F�G�J�M�N�O�Q�X�Y�\�]�`�a�e�g�h�i�n�o�p�u�v�w�x�y�{�|�}������������������������������������������������������’ÒŒƒǒȒ˒̒͒ΒВӒՒגْؒܒݒߒ����������������
��������!�$�%�'�)�*�3�4�6�7�G�H�I�P�Q�R�U�W�X�Z�^�d�e�g�i�j�m�o�p�q�s�t�v�z�}����������������������������������������������������ēœƓǓɓʓ˓͓̓ӓٓܓޓߓ������������������	�
�������.�/�1�2�3�4�;�?�=�C�E�H�J�L�U�Y�\�_�a�c�h�k�m�n�o�q�r�����x�y�~�������������������������������������ƕȕɕ˕Еѕҕӕٕڕݕޕߕ�����"�$�%�&�,�1�3�7�8�9�:�<�=�A�R�T�V�W�X�a�n�t�{�|�~��������������������������������������ʖҖ�]ؖږݖޖߖ������	����!�"�#�(�1�3�A�C�J�N�O�U�W�X�Z�[�c�g�j�n�s�v�w�x�{�}������������������������������������������������ėŗǗɗʗ̗͗ΗЗїԗחؗٗݗޗ�ۗ����������
��
������ �#�&�+�.�/�0�2�3�5�%�>�D�G�J�Q�R�S�V�W�Y�Z�b�c�e�f�j�l���������������������˜ŘȘ̘������������������"�&�'�+�1�2�3�4�5�9�:�;�<�@�A�F�G�H�M�N�T�X�Y�[�\�^�_�`�������������������������Ùəәԙٙڙܙޙ��������������������� �"�#�$�'�-�.�3�5�6�8�G�A�D�J�K�L�N�Q�T�V�]���������������������������ÚƚȚΚКҚ՚֚ךۚܚ�����������������������	���
�������� �&�+�-�3�4�5�7�9�:�=�H�K�L�U�V�W�[�^�a�c�e�f�h�j�k�l�m�n�s�u�w�x�y������������������������������������������������������������ǛțΛЛכ؛ݛߛ���������������������������"�#�&�'�(�)�*�1�5�6�7�=�A�C�D�E�I�J�N�O�P�S�T�V�X�[�]�^�_�c�i�j�\�k�h�n�p�r�u�w�{�������������/�0�2�3�4�:�<�E�=�B�C�G�J�S�T�_�c�b�e�i�j�k�p�v�w�{�|�~�������������������������������������������Ýǝɝʝԝ՝֝םڝޝߝ���������
������������z�{�|�������������������������������������������ƞȞ˞՞ߞ��������������	������������"�&�*�+�/�1�2�4�7�9�:�<�=�?�A�C�D�E�F�G�S�U�V�W�X�Z�]�^�h�i�m�n�o�p�q�s�u�z�}�������������������������@!������������������������������������������������������������������7���������������������������������������������������������������������B�q!r!p���C�x!/!m�l���L"��n�4�k!^!����-!��y"��1���k���������D�"�!�$�*�#�)�!�.�2�1�4�3�@�?�B�A���P�R�Q�T�X�S�_!,�c�b�e�d�r�0�N�"�!�$�*�#�)�A�.�2�1�4�3�@�?�B�A�C�P�R�Q�T�X�S�`!L�c�b�e�d�r�P�s�'�'�%�%�(�(�+�+�,�,�/�/�-�-�0�0�"�B�7�7�����6�6�8�8�5�5�:�:�;�;�=�=�<���>�>�$�D�G�G�E�E�����F�F�D�E�&�F�H�H�I�I�G�J�J�L�L�K�K�)�I�(�H�M�M�O�O�N�N�J�+�K�W�W�����V�V�-�M�Y�Y�[�[�Z�Z�\�\�]�]�_�_�^�^�a�a�`�`�/�O�l�l�i�i�f�f�k�k�h�h�j�j�q�q�t�t�s�u�u�w�w�v�v�������������������������������������������������������������������������������������������������������������������������������������������������������������&�&�C�C�U�U�g�g�p�p�m�m�o�o�n�n�������������������������������������������������9�0���������������������������������/�2�6�5���3�8�9�a���b�c�d���g���i�l�v�!&"&#&$&%&&&'&(&)&*&+&,&-&.&/&0&1&��2&3&4&5&6&7&8&e�j�q�r�s�t�{�A&B&C&D&E&F&G&H&I&J&K&L&M&N&O&P&Q&x�R&S&T&U&V&W&X&u�z�w�y�|�''B�C�D�E�F�G�H�I�J�K�L���M�N�!'"'#'$'%'&'(')'*'+','-'.'/'0'1'2'3'4'5'6'7'8'9':';'<'='>'?'@'A'Q'R'S'T'U'V'X'Y'Z'['\']'^'_'`'a'b'c'd'e'f'g'h'i'j'k'l'm'n'o'p'q'��W'r�s�t�u�v�w�x�y�z�{�|���}�~�>!��������=!B!��F!G!����H!I!����w"x"������E!D!������������������s"��l!m!��������������("n!������������������������������������q�����������������������o�����������������r"��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������+","*"-"����������������������������������������������������������������������������������������������������������������������������M"��N"O"��_"P"������`":"����;"������������]!��������������e"����g"g!��\"������������J"K"A"@"i"j"��������������h!h"��������������f"����������������������������������������b"��������������������������b!a"��������e!f!����c"d"��������������������������������������������>"?"����<"="����������������������������������������������������������]"^"!(,("(-(����������������#(����.($(����/(&(����1(%(����0('(<(����7(����2()(>(����9(����4(((����8(=(����3(*(����:(?(����5(+(����;(����@(����������������6(������������������������������������������������������������������������������������������������������������������������������������������������������������������������#"""��������������������������������%"$"����������������'"&"����������������!"~!������{!����}!|!��������������������������������������������������������������~"z!y!������������������������������������������������������������������������������������������������������������������j!��i!������������������������������������������������������������������������������v"����u"��t"!!"!#!7!��9!:!;!R!S!T!U!V!W!X!Y!Z![!)"."L!M!������������A!������������������������������������������������������������������������!$"$#$$$%$&$'$($)$*$+$,$-$.$/$0$1$2$3$4$5$6$7$8$9$:$;$<$=$>$?$@$A$B$C$D$E$F$G$H$I$J$K$L$M$N$O$P$Q$R$S$T$U$V$W$X$Y$Z$[$\$]$^$_$`$a$b$c$d$e$f$g$h$i$j$k$l$m$n$o$p$q$r$s$��������������+!,!5!6!����!%"%#%$%%%&%'%(%)%*%+%,%-%.%/%0%1%2%3%4%5%6%7%8%9%:%;%<%=%>%?%@%A%B%C%D%E%F%G%H%I%J%K%L%M%N%O%P%Q%R%S%T%U%V%W%X%Y%Z%[%\%]%^%_%`%a%b%c%d%e%f%g%h%i%j%k%l%m%n%o%p%q%r%s%t%u%v%��������&!<!3!4!l0zC!�7<"�#���|Kf>0;e><2$�TI?M��"P/1%���n3#P$@BRV5:J��������g>&���>N��'�(���BJ��)���$P*���fC+�,�-�%Pz6����.�&P��]40C��g<'P����(P/�0�)P5G1�W5��2�������7G��cFC83K��3�������Ii*Ph>+P524���5�e6p8iL����&V6���������7�8���������������pM��}F9�:�������;���������%4<�55��,P����-P;N��=MhA/Pv;sF=�2P����>1_8��^8f0>�?�KOJO��3:!0@�3P4P5P4K6P��r8g0rK��|5����}5~5bD<NA�7P����8P����9P����B�M?����������:=N?>PC�<P��=PX5����#:p2��;P:P)JD�������F;E;>B?PUIg@E�F���8!@PBPG�H�I�eBaNJ0����J���������AP>2K�D6L�gCM���N�o7CP������$G��O�P�Q�R�k4S�T���������U�DPK0V�W�`8l4zI2HY5X�����Y�Z�[���\�q2��gPAE��������������������������������]�lGFP^���`�<Ha�bNb�-?c�G;d�w;@2e���f���g�QD����"CJPh�i���j�k�L0cD;=4:$Ml�NBm�?2n�IPo�>MEPGPn:HP$Up�_�����q�����������PPr���s���t�SPQPu���B2��;JKPv�w�x�y�OPs8z�{�H;��|�}�&4~�!�TP��LP"�#�cN$�x;%�MP&�RP'�(�)���UP*�NP+�,�!6��M0-�.�"6A2������������������%U��yKnIt8����/�����/?7N0���1���2�3�4�5�XJ6�7�87%Bd28�9���:�;�S=<�=�>�YP?�^P\P@���WP����/BZP��]P[PA�]J��XPB�.?C�sK_P`P����������������$=mPD���E�PG��6IhP��pJ��62��F�G�lPH�I�J�����K�fPoPL���RAM�D8N�\GO�G`P�nP]EQ�cP��v8R�S�u8aPT�U�V�W�Z<��iPX�oJMCePq7Y�bPjPdPQNkPAOZ���[���\�]���^�f6����p7��v���������_�`�a�pP��b�c�qPuPN0d���e���f�PJtPg�h�i���sPwPj���k�vP��dD����l�m���n�o���r7p�q�����r���xPs�����t�u�E<��&BeDv6��yP��������65����zPw���x�y�|Pz�������{�����5K|�}�~�f7!�"�#���$���1;wH{P%�&���'�(�)�*�+���������������,���E:CM��-�.���~P#Q}PD:��}=��/�0�����1�97��2���$Q3�4�O6��5���!Q"Q��6�/F7�|A8�#6��9�:�MK%Q��;���=N��<�=�&Q>�����?�)Q@�'QA�NAB�C�������(Q*QD���E�Q�����,QF�����+QG�HJ����H�75.Q/QI�/2��J�K�L�-Q��M�N�O�P���R���t<��2Q1Q0QS�VPT�3QU�V�W�X�~=��4Q��Y�������Z�[���%M��\�]���^���_�YL`�a�b���6Qc�d�5Q8Q7Q����9Q:Qt0e�58;7<={C$6h@w8f�n9<QHLFEg�y;��;Qh�=Qi���j�k���^E��u3����l�����>Q��m�~Fn���4A@QAQ,Hx8;OBQ����&6������<J6Bq65E������s7��o���CQ��DQp�q�bF_1����GQ}:r�FQF:s�HQnfIQAKJQ��KQLQi>t�L<������u�����'4v�OQw�MQ=LNQ��ZIPQQQRQ_Ex�����VQTQUQSQc:WQjLdNy���z���{�XQ|�}�����~���(@YQZ=��!�ZQ��|C?N`E��"���#�$�%���&�ER��'�����[Q%tE6(���\Q^K)�����*�h=|B��^QdF����_Q+���`Q.3,�-�.�aQ'6/�LFz1P=����!HbQaE0�1�O?cQ2�,JZ@"4��)4dQ����fQ����:73�4�eQ5�6�sN7���������i=��������8���=HLJ��gQ9�xMhQ������iQ��~E:�;�jQ��<�)@~:t7kQI;o9=�������������fDmQ>���'B��?�o:nQoQ0A��lQ��������qQ@�6KA�B���C�d9D���pQE�F�G���u7^:mGH�����tQrQ������I�{Ij>{Qd3uQsQOA��J�K�L�������wQ��vQM���N�D3��O���`7|Q-NP���Q�xQ������}QzQR�yQS�T�U�V���W�ONX�����y8C2����tNY�Z�[�\���u=XEe9"R#R��]�^�eN����+O%R_�`�a�z8b�c�$Rd�/3��e�&R��VKf�<Dg�&Mh�YJ����i�'R��j���k�Up��l�0Fm�(R*43L��n�o�!>)RgJ-Rp�*@*RP6q�+R+4r�s�t���u�������v�w�.7.Rx�/Ry�z�0R1R[<������{8^L{�hLwF|���qJ2R��3R��}�~�!�5R��7R6R"���#���8R=2LK$�|:9R%�&�YA'�(�">)6��:R��)���*�+�,�[H-�.�/���;R0�<R1�=R��2�����>R$Ih6e03�4�5�?F?R==6�i@��AR@R#>a8CR>H8�7�DR������\H4BnB(6����nF1C9�nG:�NK��FR��j@;���<���=�57����GR����>�?�HR,1u0m4@�(BQ5qM��KR72A���JR����B�*6����LRC�qL����D�E�����������F���������G�H���MR��RNI�|8����J���68NRK�����L�PROR��_?91M�N���^1QRO�RR��P�78Q�R�SRS�T���U�n5��V�����W���2;TR��X�����tK5:Z5'MPA?H}<Y�����Z�[�G=\�h<u<��v=]�@H��^�_�WR`�C1QA}8E8g6a�b�[R!C~B+6$>\RZRD2fB8<K;&1��c�p3f9J;��]R^Rd�I5F3������g9H5_D%11F>L!9yMGE~8��e�������������f�/7��gR��c6JKg���������]Hh�i�fRj�^4aRbRdRk���l�����m�n�eR��[5a?��-JcR_Rc8��`R��$Oo�p���rJq�hDb8p9����r�hRs���]F������������������������t�lR����u���v���w�x�~<y�v<z���{�|���oRmR��#L}�jRsRnR������qRF8?L��~�rR!���"�tR#�vR��$�%���p:BO&�kRiRuR'�pR����(�)�����������*�����+���,�xR��#SzR-�.�~R/�0�!S{R1�2�>S��3�i:13������4�yR5�6�7�%Sv0$S8�%0JI"S��|R��9�wR}RH::�����;�<�������������������&S��������������=�w0/S����'S(S��%>iK>���?�-S,S@�����/E������A�������.S��B�+SC�D�E�F�����41G�6:0?H�I�����J�K�L�)SbE������*SM�"0��������������������������������������N�O�����4S#M��'>P�:S��Q�R���9S0S��S�T�U�CB��1SV�����oB6S&>W���X�Y���3SZ���dL[�\���<7����7S8S]���^�_�5S;S`���a�b���2Sc���d�����������������������������������������ASFS��BSe�=Sf�g�GS1A��h�ISi�"9?S}C����j�k���l�m�n�o�����p�CS<S-4��n4e3DS@S������q�r�����v7JSHSSAJ5,6s�ES��t6��t�������D1����������������u���v���w�NSLSx�'T��y���z�{���|�����}�~�!�QS����"�#���KS$�OS��%�MS����&�L;PS��������'�������������������������(�SS��XS������VSUS)�*�2C��+�E2,�����-�.�/�0�1�2���RS��TS(>313���WS��������������������������^2����4�����bS5�|>^S6�\S7�]S8�_S9���:�;�<���=�>�?�=1@�A���B�����C���D�9AE�YSF�ZS������G�������������z3����H���I�J�K�L�aS��M���o4N�dS`ScSO���P���Q�R���.JS�����UF��8H����������fS������T�U�eSE3V���gSW�X�����jS��������iSY�������Z�[�����\�]�^�hS��9G����kS_�`�a�b���c�d�e�lS����f���g�nS��mSh���������pS��i���sSqSoSrS��j�����tSk�l�m�p�q�uSn�o�vS��wS������xSEQr�|<M;s�t�s2u�x0v���DCw�x�y�z�{�����}���~�yS��$:|�O0^?����!�"���zSG8����q9��|S{S#�$�`J}S����%�!T~S&�"T'�#T��w7��(�`1$T��)�&T��%T��*�+�(T,���ZE-���.�/�0�1�)T50_:2�3���4�=75�6�OC����7�8�����*T+T����-T��9�:�;�.T��d:����<�=�Q6����7K��>�?�,T/TA:#9@�����������������������������3TA���%:B�3CC�D�0TZDE���F�G�H�I�J���K�L�M���N���O�P�Q�R���S�4T��T�b?U���������2T5T��?7V�������������6TW�`���X���Y�Z���[�\�]�^�7T_�$9@39T����a�b�c�:T��d�������;T����8T��������e���������f�����1T����<T����=Tg�h�����dKi���k>j�����?T@T>Tk�BT����������8Gl�m�h0VI~���CTn���o�p���q�������r�����s�������}>t�u�9<v�]Gp4��k:w�x�y�YK��2Fz�{�x7OB��|�}�ATDT!�"���������������DB������ET��#���FT$�%�&�HT����iD��'�(�����.4����)���!ta1sJ*���l>HE������+�f:����NT��,�=J]N��������������-�t2JT.�/���0�1�:AMT��cE2���IEdE9HMD������I:3���4�IT��5�����6�7�v1��6E��������KT��GT����P?����8�OT����9���N=:�;�<���-6��PT��=�>�?�@���A�B���C�D�����hJE���F�}A��������FDG���RTH�I�J�������K���OKL���ST����XT����M�N�/J��������WTQTTTVTP���&:����IJQ���O�YT��ECR���u2��m>S�T���U�[TV�ZTW�h9X�\T^T]TY���`TZ�UTbT��[�\���aT_T������]���N;Q?��TAcT<@m0dG^�������[D��eTdTfTgThTiT����_�`�����QJjTa�b�����F2kT��c�d�e�<M03��IRH=?BlTkLg�������h�4Li�j�nT��gBk�7E@BWIoTpT{1l�m�:<qTn���o�p�P0rT����������sTq�������r�b1��s�q4`FtJ��������wTUAvT@7t�u�[KuT��eEyTv�xTw���x�y�z�{T{�zT|���|1��|T)>~T%C}�}T~�3J!�����"�w=[E#�$���!U%���&�'�%9������"U!G^HQL����������%G(�)�+U*�������+�85��,�EM-���/L��,V��#U��.�������&U/�EB��0�8K������JE1�2�3�4���'U5�������6���eK7�J:8���*>����9���:�;���(U��<�P;=�O;��>�����90H8?�+@Q0��������,U-U��*U@�A�B�������C�D�81/4E�)U��EL1I����F�G���H�I���J���(0K�������y0������Q;L�R0��#0M���������2U����N�O�P�����0UQ�R���������<L��3U��1U��S�/U1?����T�U�.U��V�W�ZJX�����Y���d8Z���������7U8U����������+>������4U,O����[�\�LG]�^�6U����_�������`���������a���������':������b�������9Uc���d�XIe�����:U��5Uf�������������������g�����h�i�����j�;L����������������������k���������l���^Gm�����n�����o�;U2Ip���q�r�s���t���������u���������v���������w�x�y���z�����{���|�}�<U@U=U~���G2?U��!���"���#�;<��>Uy7����$�LU����������EUBU����%���&�������'�dC��AU��(�CU����DU)�������*�������������+�,�������FUGU��-�.�/�������������0�r4��IUHU������������������JU1���3���4���5�������6�n>����7���������MU��\D8�����E1��KU��2���NU��9�����������OU��RU:���PU��QU����������;�<�������R;SU=���&9TU>�z;8B��UUVUZ;'9?�RL������(5I8WUX3��@�XU��9B����A�B�YU#V��ZU��[U����\U��^U��C�D�E�F�_UG���`UH�pBI�'1i<B0J�WA045<K�(9L�M���N�O�fEP�!=14hCjD8095uJ��B<����R5k@<<(MaU��Q�R�����S�T�\5U�K:V�W�23c1,>H2X�bUFMY���Z�����I=[�\�d<cUs4RF)LdU��eU����YI]���^�gU��(4w6fU��_�`�a�b�c�24��2?kU!;d�I2jU��hUlUiU+GM\3?��mU����@Ne�nUf���pUg�~CoU��#@��{;����h�PBw<uIl@��M<qU->rUsUS0:BR?i�tU3F.>��/>��uU����m@j�����0>������k�l�vU��wUm�`L��n���xUo���p�q�F6r���s�"=t�����u�v���yUzU\<,?tFT?xH"GI6{U������o5|U��~6��OF02��S;}U"V!V}6��~U��8E������w�x���y���0B��KEH<z�{�XAzM��|�}�~�����$V!�%VVF"�3;����#�$�'V����(V%�&�'�(�������������������)�*���+���)V����,�t4*V-���+V����������������.���/�0�,21�2�����3���;Ad44�-V(L��������RB5�Y36�7�/V1V_4��8�.V0V��3V������������2V��4V��9���:�������������;���������=���5V������<�����=F.6������������e26V;V����9V>�wJvJ?�@���A���gE������8VT=��7VB���������C�r?������<V��D�j:����BVE���CV=V33>VGVFVEVAV������@V����DVG�H���I�J���xJ��F�����������K�����L���������M�������N���O�����P�Q�����R���S���W�KVHV��JV��rMU�IV����T�������V�����?V����X�Y�Z�[���\���������s?]���LV^���7:_�����MV����NV����`�a�������b�c���d�QVe�PV����OVf���g�hE:V������WV��h�i�j�k�������l���m���SV��n�o���RV��������p�������q�TV��UV��r���t�s�����XVt�u�fN��YVVV����������v�������w���ZV��x�`4[Vz���y���]V\V����^V��{�|���_V��n@#=��}�d=��cA~�)98:*9p5!���`V����9:����J8aV&LCGbV��+9"�#���,4��'CR6$���T;[I����AH%�������cVu4&�������fV'���(�)�!D��*�eVdVgV��kD��+�,���������c?����.�����U;��J@-�SB"5��/�"D��0�hViVo>��������9K1���lV����kVjV}I��sV��4���2�ZK��mV��3�5�����oVkK6�nV7�����8�9���:�pV��(HqV>JrV������;���<�=�>�?�@���A���34?J/GtVuV��,944vV88DM)Mv4xVB�#D��-91>����_H����2>C�����D�x=����������lDyJ9E����.9��\I������yV��E���F�G�YEB:H���I�K8J�mD������K���L���C0n=/9GM��������M�N�O���zV{VQG����P���|VwN-OR�Q���S�~V}VT�U�G3V�W�!W������$W%WX�#WY�@I3>'W&W"W��Z�����(W)W��[�*W������-W+W��,W.W��d1nD/W��z7v26G��0W{F[J\�1W.O��]�^�_�2W@J5W!P1P`�0<uF6W��]5$Dz07W&J09a���PCb�c���oD��d�e�f�g�oL98L8h�8W��i�j�9Wk�?Wl�e<����m�%Dn�/6:W����o�+Ip�FCq�r�;W����s�t���u�<W��06��=Wv�>W��w�@W��vEx���AWBWy�CW��z�4W3W����{�DWA7|�}���'I~���L:7I&DKIEW��!�4>F1"�FW#�$���GW%�rL&���`H'�(�JW}1,@IWHWB7TB��NWLW)�KW'Ne8*���+�y=MWLE>=����,�@FQWPW����-�.�OW��RWf8/���2�����0�SW|I[=1�3�TWyH4�5�6���AF'D������7�0E����UW+5����������4?8�,I��9�:�;���<�w4&G����=�>�?�@�A���VWV;:K;K����~1[WB���iCC�D���XW������E�F�G�w2H�I�J�K�-XZWL�M���0GN���YW��O�WWP�z9��]WQ�����R�����S�cWiWaW��\ET�U�fW]IV�W�`WX�eWgNW;��Y�UB^W����Z�^5hW-@e1bWx2gW��[���16��dW��\���]���������jW����������^�lWvWtW����qW_�`�a�pWxNb�rW����26c�19��d�z=e�f���yWkW����g���oW_Wh�z2sWuWQC��i�(:82mWxWwW36��)Bf3j�������C7��nW������������k�l���zWm�}W!X��n���o�=<p�'XpD{Wq�����r�%Xs�y2t�#X$Xu���~W"X��v�w�g8*M��x�54y�z�Y1&X{�:G-0����������|�}�aH\W,X0XeL~�)X����!�iE.X"�������#���$�p>/XWF%�&�'�(�����)�*���GO��+X+�,�����1X-�{9.�K@/�0�T0*X(X1�ZA��2���|W4;��������������FB=X3�[A8X4�5X6X5�f<9X<X6�7�7X%=8�:X����4X9�|L{L:���;�>X?XU0<�=�>�?�@�3XA�B���C�r6&0D���E�64��;XF���������CXBX��G�H�GX������I�J�����HXK�L�M���N�����FXIXAXEX��O�JX��KXP�Q�@X|;R�DXVB292X5?��������XX��iJ����NXOXPX����WXS�VXT���}K74��TX��E743����QXU���8NSXV0UXV�LXRXYXD7MXW�����X�Y���]MZ�[�\�+M]�^�����\X����`X_���`�~A��yNaXa�b�^X��[Xc�d�ZX_X��e�f���g�h�������0Ji���4Fj�F7k�bX]Xl�cX������{7������12��m�n�kX��o���84��p�q�r�iX����jX):hXfXeXlXdXnXs�t�{2��������u�������������v�w�x�y���z�{�pX��~�oX|���}�����!�"���#�����(D��sX��qXgX|7��rX��vXuXwXtXxX$���%�&�����'�yXzXjJ��|X{X?=��.@f2|2(�}X)�?0������L@~X*�Cl!Ya7+�"Y,�-�����o@.���/�#Y0�����$Y:5%Y��&Y'YWB������M81���aL��2���<Kj=(Y3�4�5���6�p@=nbH��j<7�M:)Y��8�9�:�GB;�'J<���qB��=�,Y>���*Y��-Y����+Y?�������.Y��������@�1JA���70��B�����^I����cHC���/YD�2Y5>;5��0Y7Y6>��������1YDG����E�F�G�H�^M3Y4Y8YjE5Y39^@����FY4H��rB��������������I���J�����dH-Z��������zJ��K���qDL�M���uKN�;Y!2jCO�P�����DY��Q�4C>YEY@YGYCY��BYoGR�<Y}2:Yq5sB6YS�T�9Y49[@U�7>AYRG����r5H3����������������V���g3!?IYNY��JYW�}7X�OY";i9��������Y�Z�&==Y};LY[�\�����X;MYD0]�^�HY_�����`�)D��a�����b���c�s5����������46��������������KY'0d�e�C:��f���6?����������g�h�����i�rD��j�THQY^A��k�l�m�n���o�����*Bp�q�+;RYr�TYPY��s�t�u�aJ��=Dv�����w�\A����������������x�y�{JN<`Y��_Yz�{�x?����|�~7��}�~�YY9>!���hF1G"�#���$�WY��%�]A&�����'�x<\Y(���8>��VY[Y)���SG��*�+�UY��!7,�-�]3����.�]Y+NN:5CZY/�\@0�59d?f1<AXYE51�2�3�����G7��OD^Y����������_A��4�aY��cY5���7BiY6�dY��7�fY��������8�AIsD9�gY:�;�<�,M������HM94=�������>�.0��eY��?�������bY@���A���x4������B�C�g1D�hY��E�F�IMlY����G�H�����;B��sYI���J�mYK���jYqYL�������SY��M���N���O���P�Q�nY��rYR�S���BHkE��T�U�������kYV�oY������H7����W�q:X�����]@����������������Y�����wYZ���[�\�]�^�������&E��_�`�a�b���c�d�e���f�������tY��`K������g���uY������h�i���vY��NL��"@j���k�����������b7��l���m�}Y������������n�o�p�5;zY��yY����q�r�2Gs���t�5Fu���v���w�1E{Yx���y�|Y��oIz�EG#;��q@��PK{�����������I3��%Z~Y|�}�~���JM'Z��!�#Z��$Z��"�#�$�%�`A&���'�(�"Z��?Y)���*�&Z��!Z����������+Z,Z'E.Z+�,�$;)Z��-�.���<5/���/Z0�(Z3Z��2Z1�1Z2�����4Z3���6Zq>4�5Z5�����6�9Z����7�8�9���������:�������;�<���=���7Z>���?�8ZpY@�A�����B�;Z:Z��C�����D�xY<Z0Z��E�Y;��F�����=Z>Z@Z?ZAZ~2G�69H�I�|J/@������J���N8��K�CZL�������FZ��RIM�_5N���O�EZDZTGGZ56������IZHZP�Q���:46;����XFR�������S�I7������t?��JZ��0@(E��_IKZ��T�����U�������V�LZMZ��W���8J]UF@X���LI��X:��eHCHY�����Z���ME[�AN��OZP<\���PZ]�60��^�T6M@_�`I������QZB;GC`�[;7?��a�b�c�����RZ��}J����w1\;��d���UZe�SZVZ9NTZ��f�g���{@WZ��h�2Bi���XZ��j���k�z4l�ZZ��YZ������m�[Z\Z{4����|F6Cl5];aA����\=00����n�]Zo���p�q�������r�"2aZ����s�t�u���79`Zv���+::>w�x�_Z��;>y�@L*:��z�{�W0N@|�}�����������fZ~�!�1@G1"�#�$�%�U=&�fKr:'�(�)�*�<>+�'@,�-��.�eZcZdZ0��/����kC����&[1�jZ~;89hZ2�3����iZ4�8?5��7�gZ��6�/;��������8�9�:��;�<�lZkZpZ=�>�qZ��mZ��"3nZoZUH@�A�B��aIJ7rZ����D�2@E�=>G�H�I�RCJ�L��C�F�K�G6��sZwZ����K2tZvZ��M�N�O�uZ��P�k=Q������HCE0xZR�S�T�U�yZ��V�W��*D��X��qN��������C;��Y�kJ����Z�[��=K\����"[{Z��]�~Z��}Z^�_�zZ`�a�![����^Fb�|Z����c��d�e��������f��#[����l=$[g�KMxG��h�%[����������'[��i�([��j�k��l��)[��J6H199*[��+[q=bAm�?�XR>A=AXBG:����rP��n��o�n7-M��~J��~Ip�,[������q�s:?D-[/O��r��>Ks�+D.[|4t��u������/[0[ZL��$LvK\K%;2[����k<��v�QK��4[7[6[��y4����`5w�3[��5[������x�8[y�z�y?����{��{MI0`:<B��]<|�}�s>����;[����NE~�9[+B:[r>]L<[=[hM!������B[��"�:9#�UG?[lE^ZbZ$�O5%�GG������&�A[��>>DH��'����(�G[��zH��>[��D[C[��)�*�O@+��,��mK-�SN.�/�gK0�L2^;����HOF[u?������E[����@[����������O81�2�3�L[J[4�M2H[N[T[��5�6�7����9�HB:�;�AJ<�V[��=�>�"I������U[pG?K;4?�w@@=����@�SDA�.M��B�Q[P[����C�R[��O[��D�W[��M[����K[��S[I[E�lCF�xLF<t:G�H��8��::����oKA3NDJFI1����������������������������r@J��4@*7��K������L�Y[M��;9|3��������O�N�[[t3a[P�Q��R�S�T�^[U�s@������K3,:��V�J3O:��W�\[e7K7mEX�Y�Z[��F0��Z��[�][_[��M6,7I�<4K5\��]�^�b[��_�y:qK��7;������c[������0I������`����a�b�c�d�e��o[f�32d[��g�h�i�j��u[e[��BNk�l[l�_Gm��n��������t[��g[������40i[��o�<9p��q�k[r�j[��f[q[s�?>t��u�mTh8|Mv�w����h[x�tD#3-:y�`[��p[a3����n[r[z�nE��������������~4{�2\��|�ILw[}4}�~[��~�!�"�@K#�!\#\$�'\y[%�*C��&�'��oE+\|[��(\��(��"\)��*�+�,�-�9?,\.�/�3@����0�1����*\=42�3�4�POv[����&\X05��x[6�7�:L}["?GDs[8�9�%\:����;�<��z?/\q3!8��������1\z[0\��)\{[��-\��.\����������?\=��>�NF?�$\��@�;\��A��=\��XD����B����C������D�LM������E��������vI8\JB��F��>\?AG�5\B\A\��oF@\jFH�I�J�K��L�M�D\7\N�H6:\]=O�P�Q�`G<\K6��4\6\3\R�S�0OZ39\T�U�C\53��������������g:����V�]1����T\W��1OW\X��Y����:?V\������U\Z������[�\�R\]����^��_�F\`��c\E\��X\����a�b��c�P\d��K\H\��I\��Q\��e��"tf��N\=9HDdAL\��G\g��J\����h�i�MMjK������O\Y\������j����k��a\Z\����g\��e\l�m��n�`\o��p������_\��PD��eAq�]\r�s�[\t��b\��������h\uHn\����u��v�i\l\f\w��tC��8Ix�\\��y�d\@>z�OLx\k\{������|�"8#2_3����S\��}��~��!�A>p\"�w\y<r3#��.C$�%��������m\&�'�r\v\(�)�66����*��+�,�-����.�/��L5t\��0������!5��KFs\��1��u\2����3������������4�o\5��������q\����������6�`3IC7��8�|\��9�:��;��<��z\i8��y\=����������!]������>�X[?�@�A�{\��}\~\��B��������,]C�(]��m[D�E�F��']G������&]����#]��H�I�J��j\%]$]����K��M�L����N������O�*]��&OP�Q�R������-]{6S�T�)]+]��������U����V�'H��.]��W������X�Y�Z��������������2]/][�\�]�^�sM0]_�`��a�^\��������b�c�d�3]������4]e������f��51g�6]g7!<��U6h����$2i����j�k����l����_M����m�n�8]7]:]=5o��V6>4p������=]����q�<]��>]r��N2s�7C��?]��t�?4A]��u��v�@]��B]��w��C]x�D]_;5@!:��pIy��bJDOz����{�u;|����P:rN}����E]F]��`;��~�!�G]H]��"�J]I]#�XK����^=l<D;��K]��������������M]#?$�L]����%����N]&�'��(�)�O]������*�+�P]Q],�-�.�R]/�T]S]U]%2JC��V]0�1�&;L3W]2�3�BELT����4�5�#5X]����6��Y]7�lJhK������GFZ]fH��8��{H��9�SL������[]��:��;����<�=������]]\]��>�_]��?��^]������@��A����������B�C��D�E����a]F������G�H�a;I�1LJ�b]c]����$5��K��d]������L������f]e]��M�N�O������P��Q��������R�e?S�T�9IJ1��U�V����EHW�uDA=a5��������������X�Y��Z�FH[�.<��\��]�h]��@4��^�x1_�`�rFg]>9SC��i]��������6�q]��j]a��b��c�AB��b5r]d��e��f�g�h7h��%5p]����n]k]`M��i�j�k�@Dl����YFl]����t]��s]#7m�n�-2o�p�;:m]o]q����r��WKtB����������������wK����|]��s�}]t�O2u������(J}L!^#<B>x]~]h1��76v��u]z]w����t@qG��gHx��y�z�{�|�w]}�!K~�y]��$^!�"^"�{]����#�"KHGc5��%E��$�mC%�%^&�'��(�#^YBv])�K1*�+����,����-�NM0^��.�/��0�/^1������v@��,^2�lM����6F&^����������ED3�4�5�L1?9)^����7�8��9�'=.^��-^(^��+^:��h3;�*^IG<��.N����t>u@����������������������������������=��6^4^��MI��>�?��@��1^3^A�:1B��@92O��=3��bIC�D������aM����$3;?5^����E����������F����:^��G�C>������0M��7^����H�I�2^J�8^K�L�M�^N��sEBF��������������������������N��O����63����U1��P�>^��Q�A^R����CNS��T�dM������U�H^B^?^V��W�TNE^��X�Y��J=G^����L^Z��qEJ^��[��\�D^]�^�8C_��K^`�@^��F^a�M^|0C^��N^b�c�<?��_=d�%Je�.:��;^I^:Ef�g������h�6@��i3Q:D>=^B=��������������L7��<^������R^m=:8��a^i�[^t5OEj�V^_^/021k��92��X^,BO^Q^A9����l������m��b^n�]^o�p��U^��������\^q�r����s�t�+Lu��Z^^^v��w�x�y�z��P8{�E>����9C|�}�~�T^����!�"������/M#����W^����P^rE����S^$����Y^��������%��&�QO><~K��c^������������������.H'��o^;8����(����`=��e^)����/NB9��r^*��n0����p^��+����d^����,�-�j^��.�l^/����OMg^����.E0��i^��1�2�3�q^4�k^GL��5�6�f^7�"<~^8�9�:��j3��h^m^n^��������������lBZB������������������������;�v^<�=�|^����z^��)E����#_w^>��?��@�x^`^y5:I��A��?<��B�w9C��D�E��3O��t^��"_i1fAF��G��H�I��������yG��A4zN����J����K�L�!LRDS��M�N�{^}^O����P��2A����Q�R��!_y^��s^������C4������������������T��U�V�W�i7����X�/_Y�Z�*_x@[�\�c3��]�^��a=��3_��_������`�,_,D)_YD������L_������&_��%_��._a�b��(_'_-_c�!@��$_d�e����f�g�h�0_��i�1_j�k�l��m�B4����n��������o�p�6_��5_7_q�r�s�t��:_������u�v�w�CE��4_��x�y����8_����z������c7yB2_;G��{�9_|�}��~������������������>_<_����?_��!�B_����"�;_j9(G����9^������#�$��tM=_��A_uB%�@_��+_��&�io����'�E_��(�)�I_*�G_������+�,�-��C_��D_��.��H_��F_������NI��/�N_��K_J_��M_TFO_0����1����uCmB��������%@����2�P_��R_��3����4��5����6��Q_��������7�8������9�:�;�<�u^��A����S_����=�>����gF��������?�@��������T_B�C����������P2D��E�tE%3��������F�G��d5������^<R:H����I������J�K����'Of?������j1������V_��L�M�N�O�P�U_��Q����������������R������������S�Y_:C\_W_T�U��[_V����W�Z_@EY0��������������������������uN��X�^_������(1��Y��Z�[�\�]��^�`_����_�__��]_��������`������������������������X_��������������#Ka����b_b�c�d�e�f��a_��g�h����i��������k1��������d_2J��c_��j��k�5L��������G>��������l��m��n�o�p��������3A��q������F>��������r������s�t�u��{Nv�w�j_��y@��x��y����f_k_z��l1{��|��}��~��i_��aGe_h_H>!�QH����l_��Q<��������������������"������z@����#������o_$��%�g_��'7��&����m_����'��PMp_������&t(�)������O=*��+����������q_������r_����,�-�.G.�/����������t_0������u_1�2�3��3G4������uEw_��5�6��y_��UN��v_7�x_m18�s_��9�:��;����[Sz_��������gA8;|_��������{_$?YR������������}_����<�!`��n_~_��=�"`>����������zG?�@�A������#`����$`����B������C����D�%`��E��F��������G������&`��^DH�(`'`��I�)`��*`��J�_<cI��K�L�lL+`,`VA$<-`.`M�N�O��P�/`RJGH����0`WG��Q�R�S��-DT��U�V��1`g2W�m5X�FLY�6LZ�424O[������RK\�*J��]����^�_��`�7@��2`����a�b�CF��c�d�#83`e�T:5`4`��f����6`��g������h�i������7`j����8`��������k��������>5��9`��������:`l������$8m�n�HH��o�<`��p��u>����;`��������q����r�86=`?`��>`s��t����u��@`��Q8��A`����v�w�i6x�@A��}9������y�C`D`B`����z������m<����HF96����������{�|����F`,CE`}�~�5ObG!�"��#�$��%����I`&��'��������(�)����K`H`*�+��TLJ`L`,�DN����-��.�P`��/�0�O`vC-G1��%8N`��2�3��M`4�1M2M����5�6��7�Q`n1������8�v9b;��������������9�R`S`:��;������<�U`=��������>�?�@�A����C=����B�C�W`D�V`E�F��G�H�X`I�M3����Z`��J�Y`K�\`[`L������M�N��O�<8P�Q�(N��L6��&2����R��S����T��U�j6V�W������X��Y�Z�[��\����]�^����a4_�`��a��������hN^`��b��c��d��``e�f��g�a`��Q2����h�i��]`j�9;k�l�AD_`m����n�o����p����q������r�d`��n<s��t��b`u�v��w�>7����IHc`����~`����x�y��z�i`{�|�}��~�=8!�"�#��e5$�f`}M%��0N&������������'����������������(�)������������vB��*�h`+��,�-�.�/�0�1�2�3�4�5�j`VNW6|HJG����6�k`��������m`7�p`��8�9��:�;������<��=������>�?����l`��@��o`j8M1q`A�p?n`\N��B�t`$t��C�D�E�r`u`F��G�H�g`s`I�J�<:����v`��������������w`��K�L��~M��M�N�O��P��x`������Q�R�S�T����������U�V�W��X��y`Y�Z�[�e`\����]�z`^�_�`�a����b�c�D4d�e����f������g��h��%<��i����������������j�k�{`��l����|`m����n�}`������o��p�q�;1��r�s�!a��;I"at��$4#au�$av�w����%ax�'a(a&a��y��SI*a)a��z�{�|����}�,a+a-a~����������.a0a/a����y9!�2a��1a"�#�E4��S?��<E��3a8@$�%��:;&�y14a'�QM(�)�cJ5a����*�DE3MC9=?����+�KC4R,�.Dh26a-�.�/�0����1�7a��<a2�3�:a9aBZ&38a4�Z05�*H6��JH����7��1N=a;a\C&@8�9�+H:�-I��?a,NM7@a��>aVHAa��Ba��;�[0<��v>Ga��DamFCa=�>�?�@�A�B�&5��C�Ja����D�EaFa��IaHa%I����BAAAE�?5F�G�KaH������I�La��J�Ma��������K�OaL�Na����������V1����������WahHQaM�Sa����Ua>?N��VaTa@<O�P�Q�PaRaR�BIS�I>����Ya��T�XaU�V����Za��&</:��W�wE[a��KDX��]aY�Z�[�!N\a\����]��iA����^��_�`�baa�daeaTC��������b�ca��`a��^a_ac�aad�e�f����g�h�hai�faj�ga��k����l�m��n�o����p��q�r�s�t�iakalamau�nav�w�ja��x������y����pa��z�{�oa|����}�~�!�qa"������$�%�EN&�'�(�tarasa)�#�*�b4����������~L����+�JJ��va,����ua����-��waxa��.�/��|ayaza{a��}a0�1�2�~a3�!b��4��"b��#b��/HPE$brG4I��%b5��&b*E6�'3D9'b����(b7�8�)b��);����+b��9�*b����,b-b:�;�<��=�>��?�@�A�B�C�D�E��F����G�iH��.b������/b����is0b1b2b����H��.;��I�3bVG��J�_K��N1K�W1L�M�4bN������6b��O��5bpE��P��9@9]��7bALQ�8b��F4WH9bR�:bS��;b��T��\L��U�V�UL��>D��W��jAX��=bY��b=Z�J>����@b��[�?b>b}H\�G4)8��]������^��_�`��a��b�c�Fbd��Cb??2L��e��BbDbEb��f�Ab������g�h�i��������j�k�l�GbHbm�/D��c4n�o��eC��p����q�r�Ib����s����t�u�v����w������x�y����JbMbz��{�|�}�g?~�DF!�NbSK"�Kb��#�Lb$������%��&�'�(��������Qb)����*�PbOb+������,������������Sb-�.�Rb����Tb����/�0�1������2������Vb3�Ub��4����MJ��5����6��V=FN7�8�Wb9��7F��:�Xb����Yb��]b[b\b;�Zb������<������^b��=������_b������>�?����@��`b��A�ab7Lbb��B�C�D��pLcbE�NCF�jG��k6G��H�;Cdb:6I�J��P@K������L����M�eb=:����N�O����P����fbQ�R����S�gb��&8U:��������������T����ibU�V�W��VEV:N5����������X�Y��Z��$K��KG[��\����WE��������\9������]�^�kb��_�`������a��b������c������������������d�K>e��f�g��h�i������j��k�2NE9��l�'8����#H��mb����������m��ob��n����k8��������nbvD����o��qb73lbp��jH��01q�l:��ROr��pb����t�u�v��s��rbw����KJx�Y@tb��y�z��ub{�|�}�~��sb��������N3!�{b"�zb#��'<������|bwb$�%�&�}bxb'��(��XHvb)�*�yb+�,������"c.������/�0�1����-��2�!caK��3��~b����k0����4�5�$c��7�8����9�:��#c��;�6�L>��������<�%c��������=��CA��>�'c&c������������(c?��@��A�B�C��������D�hbE��F�jb*c)cG������H����I�J��������(<K�iNL�R<M�+c77����N�O�P�@5'5c;Q�R������S�4MT��1cU�0cDA-cV��/cW�X�K=@?.c,c��*G����M>��Y�<IZ��[��W:��������\��������xE��]�2c^�_��`�3cIcX6����=O5A��������4ca�b�R2wD!J��c��d�e�f�g��h����i�j�5c������k��������z56cl�m�8cn����9co�)Gp��:cq������r�;c<cs��Y6S2EF(=d;t��u����v�w�=cx�)=������y��J2CI��z�>c{��kH��|����}�~�EA!�Ac"�BciG#�A??c��aC$�%�@c&����N>'������������(����\0)�)5��*�+������,�Cc-�.�xD/�DcG@����0����-L1��#IEcFcUC2�GN��3�HcGc4����������5������6��7�o<8�9�Jcp0��:�;��Mc<�=�>�KcT2N7LcF9r9��fJNc?�@�TKA�B�Pc����C�Q@O1:2,0��������D�E�Oc��F����G�H��I�J�QcRcw>��K��L��ScM�O3��N����Uc������j7O�f5��P�Vcu6����WcQ�|@R�MFS�`@u:T�U��Xc��V�W��������X�Y�bCkAZ�Zc\cYc[c����������[�"7\����]����������]c&7��^��g5RM_c����_��`�`c����a�.1b�c����cc������v3bcacd�ec^ce�fc)Nf�gcg�hc��h�tTjc��ic������kclci�5Nmc��opO>ncocW=��8Fpc��j�k�(Cl�m�qc��<Crcn����o��%6��?Q]C3<p��q�r�H4sc��"d��vcs�h5��uc$d������tc��P>����t������xcyc��+E����zcu�^3����v��Z?dIw�|cx�y�z�hB{�|�}�~�!��wc"�{c}c����{:������#��$�%�&������&d.I'�&HyE��Z6%d#d(�5H~c^C{E��zE)�v:������������8d����*������+�(d,�*d��-�.��-d/�.d0�+d,d1�2�)d'd��3����!d������������������4��OJU2��5��5d��2d6�7d7�8�6d��sG'L9�;;0d9d4d:�3d/d;�1d<�I4������=��������=C��>�}@��?�@�"HA��>dB�C��$H��D�E�F�G����a@;dH��OHI�?dSJJ�[CK�:d<d����=d��������L��M�N��O�P�Q��@d����D<������FFEdDd��R�AdS����6O��������T�JdU�V�NdKdW�X�Y��Z��[�Gd\�]�^�_��`�Hd��a��b�c�Mdd�e��BdURIdCd����Ld��f��g������Rdh�J4��Od��i�j�Pdk��QdTdl��������m��n�o��p�SdvHq�r����Ud|NmJZd����Wd����s������t��VdR@��Yd[dv�w�x�Xdu�_d��\dy�z�{�|�}�~�]dFd!��"�^d`d��#��$����ad%�&��'��(�FJ��bd������)����*�+�bL����N6)7cd����,�-��4J��h?��0L��.�dd��3N��/�tG��FA4G����M=����0�@01�idgd��ed!42�Q>jd����hd��fdnd��3�mdldkd����4�5��od6�7�8�pd:@9�qd��sd��:�rd��;�<�=�R8����>�8A?����ud@�A�B�|EC�tdD�E��vdF�5JlAG9��wd������G�HN��H��I������yd����zd��{dJ�|d��e;��}dO7����j5*5��!eK�sLH9~dL�M�N�$efL��<G��O�3IP�Q�R�c=#eS�S<I9f;i56J"eT�U��GABKw:V����W������X�g;]DY�'e_NY:Z�(eB?��*e������R>0:��[�\�]�)e^�_�*=>8HA%e+e`�a����&eP7b�.e2ek7c��d����-ee��f�g�6eh�i�J9����mM<03e��j�k5k�0e��l������1e��m�}E/e,e��(3d@��n�(8o�p��8e��q��r�s�t��u�v��w�5e��x�y�z��7e��{��4e����|�}��Q73B9enA~�!�Fe����Be<e����"�#����$�@ez<]0;eCeGeK9VL%�VD=e&�'�Ee(�:e>C��?e=0JL����)�*�+�,�-�>e����[6lH.�/�0�mA��PNo=����ne��1�He2�~@��DeIeKe��yDNe4��Je5�6��TJK47�8�KL9��^0��:�Me��}N;�<����=�>�Le3�o1����lFOe����?�VePeWe��������@�A�Se����B��C������{GD�E�J<UeF�ReXeQe����D=G�H����%KI�J�L=K��Te`eL��\eM�_e��]eae[e��AeS@N��KH��^eO�P�YeQ����!AR7��+=R��S��T��%?6Ade��U�fege����ceeeV��W�X����Y�Zebe��jeieZ��zK[�\�+7����]��������^�he��lekeoe_�qe��`�<;me����a�b�resec��ted�ze;Evee�uewexef�ye��g��h�{e|ei�j�L4��}e��~el�k�m�n�o������p�q�!f��r��������"f#f$fs�%f&ft�u�(f'f����)f����v�w�x��*f+fy��z�{�|�}�.f,f-fa:S7��~�VC��3H!�p=����MG��mH/fmX������"�#�$�%��0f2f��eM1f4f3f��SM&�5f'�~H(�)�*����6f��+�,����9f��-�8f7f����.�/�:f27��0��"AA51����2�>f;f����<f��3��?f��@f=f����4�)1��5�6�'2��7��BfCf��8��Df��bM��9�:����,=��FfEf����������;������<�i?Gf��=��>�Hf��?�If��e4@��A�B�M4��C�Jf����������KfD�]KcME�F�G�TM7O��M9NfT<MfH�I��J�Of)<K�L�M�QBN�PfO�P�L9Q�WLQfRf����SfR�S�T�U�Tf����V��W��Uf������X��Y��Z����*<[�\�mL]��^�_�Wf`�?Ca�Vfb������c��Yf������Xf��������������Zf������;@��[f��\f������9J]fd�oA^f��e��f��_f��������g��~Nbfh�af`f0Di�cf&?��df������ef8Off��j����gfifhf%Hk�yF��>O)H��l��������kf����S>��*I��lfjfm�N4n����T8h;����nHo�p��*8CKq�ofmf��N9��O9i0��h:������r�s�YG����������������_0tf��@C��t������XGu�[Bv����w��x�y�vfz�{�rfufpf��sf&K��|�U8����}0qf��������������}�~�xf!�yf"�#�9F��$��;6%�&��&g=G'�i;(��<6H@FO.LwfT@)��������������������*�+�,��S5zf-��.��/����|f0����1��{f����2����}f3�&C��>G��4������1D5��6��#g������������7�"g8����9�~f:��U?��eI%g;�$gP9SO��<��������������5g=�>������)g*g?�@�A��p<��B�(gC�x9'g����+g����D�2D"J#A��������\B/gE�0g,gG�H�I��-g��.gJ����K�Q9F����6g��2gL��M��fIN�lK(IO��1g��P�4g3g������DK7g��������Q��8g��R�7AS�9g����;g��?gT��<g:g?G=g��>gV��W�22��Eg@gX�U��AgY�Z��Bg��!B��[��\�DgCgFg]��^�_�GgHg`��C?a�i2��IgWN��+<b�c�-=����d�e�f�j;WCg�h��i�j�JgKg11k�Lgl�m�MgNgn��Og��Pg=6*ZQg��e@RgK<o�Sg��0Pp�q��Tg^J\4r�s�$AX=t�qI.=��u�v����������w�UgR9VgLH��dg������x�Xgy�IBuG?8Wg%Az����������Yg����{�|�}�~�zD������!����"�#��$��������%��[gZg]g��&�\g��^g'��`g(�_g��O4)�ag��bgcg��*�1:IN��eg'?��+��p1fggg����,��-�hg.�/�0��1�2����3��4�5�r0��ig6����7�jg��8��9��:�gI;�<��G<��lg=�>��?�@�)320A�B�C�D�kgngNGE�D?F�V2G�'KH����I�]7\6J�mgK�j2L�M����������#4N������������������O�q1rgjN]BP��DI��~gQ�W2|g��zgqgR�ogS�pgT�c<l6wCU��V�QF��W��X��Q1��tgsg��Y�Z��ygugxg��[�\�]�^�PLwgX2}3{g_�`�}ga�b����T7��������������#h,h-h����d�+0e�f�g��h�i�4h��������q0����+hj�k�l�*hm�%h$hn�"h!hcCo�{B'hp��q�r����&h��s�t�u�)h��v��pAU7����w�x�A1(hy�S9>�c�z�{�|�qA����������������������������������������������}����:h��;h��Y2~����.28h!��"�#��$��%�.h&�6h��=h7h����'�5h������(�vg)�*�3h��+�,�/h-�.�/�P41h<h��2h������0�1�>h2�0h|G3�L������iM������9h��������������Oh4�5�6�Gh������{?��7��8�F5��]6��Bh9�:�;��[2<��T>��Eh������Z:=��QEJh��������������?�nJ@�Ah������Z2V8)IKh��?h��A�HhB�C��RhD�ChE��Dh:F��F�Ih����G�Fh(KLh`0H��I��@h��J������K������������Nh��Mh������������kGTh��_h����M��~3������bh����PhN����UhnM��������������O�^hP�Q�UMR����S�*NT��U�V������W�xCX�Y�Z�k3[������\�rIdh!F]�^�10_��]h`�YhrASh[h`ha�,G��b�c�*0d�Xhe�ahxI��f�g������h�\h��Whi����������U>��������/=��j�k�,<l������XL����GI��m�gh��ph��������n��o�p�q����Zh��r��s�w3��t������x>ehu�jhsAv�w�fhx�mhy��_C��nhz�{�VMch83|�ih��}�lh,L��~����oh����hhkh��!��������������������"����#��)K��!O$�%�&�'��sh����(����*�+�zh,��rhC<��-�.����Qh/��������0��1��2�NJ��"Lyhxh��thuh��61��3��4�wh��qh5�6�7�8�UD9����:�;�vh~0��<����)�=�>�"B?������������CJ��@�{h!i��YH����A��~hV>I<#i����>6B�C�D�E�F��$iG�yI}hH�Vh��I�J�K�L�M�N�O�|hP������OO"FsIQ��+i��R��������������1i��S�T�U��V�2iW�%iX����vGY�Z�/i'i[�)i\�]����^�3i(i��_�,i����r1`�eF��-i0ia��b�c��d��&ie�&Af�*i';E?07tLt�yLr=��������g��h�i�j�7i5i��k�l�m�n��NOo��������p��4iq�r��uMs�6i8i��������9i����u��v��<i:i��w�x������#F;iy��z�MH.i����{����������|����}�s=��=iBitA~��Ai!�"��"i��#�$�CiIA����>i@i��%�&��'�(�)�?i����1]"]*�+�Ei,����-����.�Di��������/��0������vM��<bFi����������1��2��3��4�5��Gi6�f�7������8������������HiW8��T5��9�:�Ji]Q;�<�=�>�u5��:N?�s6Ki@�A�B�C�D����Li��E��nCF����G��Mi������H�I�J��zFK�:0������������������������m��c2RiSiL������M��Ni��=;N��O��P��Q��������R��OiBG��S�T�U�PiQi[i��V��UiXiW��X�Y�Z�Ti[�\�]����������^�_�`��a�Vib�WiX<��Yi��AC��V7B3����c�d��\ie��f��?3g�aih��]i`ii����j�:Hk��l��^i����_iHIZHbi����������������}Blin�hio�p�k2fi��*Kgiq�r�dis�eijimit��kiu�v�w�iicix�y������XCz�ti��*L��{�|��}��~��ri����!�si��������"�#��$�%��ni����pi��&�'�qi(�)�*�oi+����,��-������f@��9Oxi.�yi��������!j��*?��{i/�~i������0��viui1��"j2�3�\2��|i��#j������}i4��5�6��zi��3D��wi����7������hG����'j8�9�:�;�<�=�>��?�@�;M����A����B��C��D�E�F��������G�&jH��%jI������J������.jK�L�M�(j��N��0j��O��������fM3j��*jP�Q�+jR����/j��2j1jS�T�U�)j����V��,j��=j����W�X����Y�Z��[����\�6j��]�^�_����������`�a��b��4j��c�5jd����:j;je�*3f�B5����9jg�h��i��$jj����k�l�m��8j<j7jn�>jp�q�r�@j?j��s�o�t�u�v��w�x��BjAjZi������Fjy��������z�{��|�Cj}����~�Dj����Ej!�Gj"������l7#�Ij$�Hj%�0=��&�'�(�)�T9'^*����+�JjQ=��,�-�93.�Kj/�R10�W>Lj1�2�U9Mja03������=I4��Nj��������j?5�Uj����Rj��oC��6��7��SjPj^68�OjVj����������67����^B��\j��������Xj������5BWj9�Zj:�;�<��Qj=�>��[j��]j������?��@�oH����Yj��^j`j����S8Tj��A0����A����B�C�_jD�[:vNajbjuA��������E�F�G�H�I�"N��J�K�L�cj5M����djej��M�dJfjN�@:��#N����������O�kj������������P�Q�R�ljX>jjS��T�gMgj����ij=@~?U�hj��mj��V�#J����oj��njW�X�Y�l3��+Kpj��Z�[��\�]�^��_�|jrj��`��������sja�b�c��tjuj��������d�e�f����g�yj��zjh�i�xj����j��k�vjl�qjwjm�n����o����{j7p��p����q������(2r����s�t�u��~j_6}jv�w�x�"k��!k������$ky��#kz�%k{��1=|�&k}��'k����~�!�"�#�(k>@��WM��)k����$JFG*k$�+k+8��%��,5&����,k'�(�k;AG-k��P3)�*����+�,�.k������-�0kwM��/kF?��1k����2k.��3kQ4/�0�1�2����4k��3�5k��6k7k����������������������������������Q3��4�5�6�7�8��8k��9k:k����������r2��9�(?;k��:��;��<������=��>�<k��?��=k@������A��B�@8��{D>kC�D��E�W7��V?��Ak��$FF�@kG�H�17I�J�?kwB-5����Bk��CkK�Y>L��M�m7N�DkO������,KP�Q�_@��R��v5��uLJAS�EkT����G?pCZ>U�V��W�Fk��X��Y�IkZ�Jk[������\�]��>:BBHk^�[>>I_�`�a����Gkb�c�l;��S1d�NkX7��e�n;f��m;��MOMkLk'A��M5CO:3\>��g�h�i��j�k�l�Kk��m�n�o��Pkp�QkOkq�X8��@M��r�o;'G��s�t�Tku�@@��BCv�w�6Mx�Wk������l8y�?@Sk��Xkm8UkVkz�Rk{����b@IF|�}�/C��]2~����!�"��pH��#�C5��$�4D����[k%�Yk��&�LC'�(�)�A@R4Zk��[?��*�JN+�,�-�@O.����\kgk5D/�fk0�ckkkdk��`k��|D_k������]k1�!Mp;��2�ak��^k3�4�5�ekt=��A8��6��zB7�EKZ1b0��%F8�9�ik����?�:�hk��fF��mk;����bk��lknk��,8jkV9<�U<=�>�okXM��������rk��uk����sk5I@����A����pk������B��`6����C��tk����vkD�E�F�G�H��I�zk����wkN�ykxk����J�K�L��{k��1<M�}k|khI��O�!l������P����Y7��������~k"lQ��#lD5Afy>��$l��R�n8S�T����U�%lV��&lW��>;X�Y��������NZZ�'l[�(l\�2=��)l*l]�^�+l����,l-l��_��`�a�+Cb�c�.l����d�e�0l��/l������f�&Fg�1lh�-Ki�2l��3lj�4lk��l�m�5l��n�o�r�ZFp��q������]>6ls�t��u��v�w�k9.P7lx����������y��z�{��8l?I9l|�Al��}������:l����<l~�!��;l=l"�FK>l?l��#��$�%�@l������Bl&��'�(�-3gD��iIb:W9��)����OI_2NHElS4U@DlIlyCcL��GlHl.5��JlcG_B*�+�qH=EFl��GKl2Ll(OBDEO,�-�q;Kl.�1B/��\l(A0��xF��PI��2�1����3�Ol?;r;4�^>��eG5�-8NlMl��jI��6��A<��7�RE��8�9��:����;��<�=��QlRlX9Pl>�?�@��A�SlTl��Vl#BB�Ulf4��Xl��WlYl��C�[l]l��^lD������E������������������������������������������������������������������������������������������������������������������������������������������������V@F�O<_l��G��R3H�`lI��vAal��blkI����/5��������������J��clK��L�6D����M��[1����N����O�P������Q������dl��������R�S�T����q<����U��v?����V�W����X����Y�-B��Z��[��\�gl]�o��fl��^��el����_�`�a�b��c�mlkl��d�hl��e����f�g�jlh��i�illl��w5��pl��W@��qlj�k��l�Y8��nlolm����)On�p�q�7Dr�)A������������rls��ult����u�v�w��sltlYMx������'Fxly����z��{������������vlwlyl|�}�~�!���"�#���)m����������|l$�%�}l{l&�'�(�)�����*���+�,�zl��}D����!m%m"m~l-�#m.�/�0�$m������1�+m������&m��2�3�4�5�X@(m6�7�*m'm��������8���9�:�;�<�=�-m��3=��,m����>�?�@�.m��������/mA�B�2m1m��0m��C�4m3m��vL����D�6mE�5m7mF�����8mG�H�I�J���:mK�������L�M�9mH?;mN�O�m6<m>m��P�Q�������R�S���?m��T�U�V�W�@m=mX�Am��V<Bm0537��Y�Z�.8��[�����������Cm\���pF����>EDm��������]���Gm��d�^�_�`���������a�4<b�c�FmEmZ7Hme�f�S3��Jm��g�h�\:Im��Rm����i�j�LmNmeJKmk�l�m�Mm��QmOm15n�Pmo�p�q�r�Sms�t�ZGXN��u�v�w�4=������Tmx�y�z�{�"MVm|�Um����YmAM}�~�Xm!�m3Wm\m"�[m����Zm2E]m#�$�%�&�'�(�^m)�����_m*�+�l9��%7`mambm,���������������������������������������������������������������������������������������������������������I?cm-�-<dm.�/�em0�1�2�!R~Q��������fmpegm$C+?@G����3�4�hm5�UJTD~9��6�)C7�8�*1��xKW?9�����:�;�<�^7��=�a6>�?�VJ@�������im����������A�kmB�C�jm`2��D�vFlmwG��3EE�mmR=F���omG�H�BL~mqmrmI�IDJ�`BwAK�(FL�pmU5��M���ymN�vm%n)F`Csm��~DSEtmxm`?O�gGLDP�B@wm.B$Bum)0"O������zmQ�R�T�U�V�aBS�5=J?W�X�|m{mY�o0}m����/I��'nZ�[Fk?[�\�YC��x6��&n7M?1]�WJa2!n"n#n$n;F#Cc0(n��)n#t��^�=B_�*n��s1LA`�/8��ZMa�b�+n,E����c�xAW<,nd�/n��e�e=-n+A*Af�d0��KN1n��rH3n2n0ndcT4g�nmh�5n4ni�j�k�6nl�8M������m�n�o�p�q�������r�s�t�aF��u�.K��7n��Y<��������8nv�9nw�x�y�:nz�!E��������{�}���j0��~�!�"�#�$�Y9��|�:O������-���%�&�'�(�>n)�*�+�47;n��<n,���tI����/�T3��0�1�����2�9M.�?6����������TE3�4�5�?n��6�7�8�9�������:���;�@n��<�=�>�?�An@�A�B�C�E�F�D�G�H�����"EI�J�CnK�Bn��L�M�N�O�P�Q�R���������S�����T�U�SFDn6=`<[GqCV���r<W�l?��EnX�FnY�Z�[���������\�]?Gn]�Hn��^�InoM��7=_�������KnJn`�Z9��s9@;a�b�c���������d�Nne�f�g�f=��Mnh�Ln��iBi�o8j�C@k�l�m�0Hn�����9=��o���p�On��_>��q�r�RnPns�t�u�Qnv�w�x�y�TnSnz�z>��Un{�|�}�~�VnWn!�"�#�PHS:a<Xn��Yn$NE=nLLNZnb6��$�%�[n&�#E'�(�^nx3K?)�\n��]n��`D*�+�UK|6��,�-�.�/�0�1�2�3�����`nan4�5�6�_n7�cn8�9���:�;�<�=�>�?�@�_FC3��A�gnB�C�dnfnD�E�����F�G�bn��������H�I�J�K�L�Oo����en��M�N�O���P�kNQ�R�Z8S�T�U�V�W�onX�Y�Z�4Ejn[�\�mnkn]�pn��^�_�`�qna���������inb�c�vnt1d�e�hn��f�g�-H��lnh�`>i�j�k�������l�m�n�[9������o�p�q�r�s�t�u�v�HKw�d6����F=��<F����x�y�z���{�|���-A}�tn��nnsn~�CL!�8Dunrn����"�#�����$�%�&�'���(�,A��)���*�����+�yn,�xn-�.�/�0�1�2�3�4�5�6�7�8�9���:�;�<�=�wn>�/K?�@�A�B�C���D�E�F�G�H�I�{=J�K�L�zn_J��M�T1N�O�FIrC��������x5P�|nQ�]9����R�S�T�����,;��U�������V�{nm?W���X�Y���n?!o#o��Z�[�\�]�{>^�"o$o_�`�S6a�EIb�c�b<#O��~nx:����?Od�e�&of�g���%o'o����������������}n����h�i�j�iF��UE����k�l�m�WDn�,oo�p�q�CC(o��r�)o������s�t�u�v�w�-7x�+oy�z�{�|�}�08~�����!�*o"�a>#�$�%�&���������'�(�)�y3*�+���,�0o-�?:yA.�JD/���0���1�2�3�4�;35�;�6�.o/oCD��-o������7�8�9���1o:�����������<�7o=�>�?�@�:oA�B�C�D�E���9o-E��F���2o3o6oG���H�8oI�J�@6K�;o5oL�M�4o����������������������������O�P�N�Q�R�S�T�U�?oV���@oW�X�����Y�Z�[�Ao����>o=o\�]�^�b>*F<o��������_�Eo������������������Co����`�a�b�c�d�e�DoBo��xB��Fof�h�g�Go��i�Ioj���k�l�m�������U4HozL��n�����o�ToJop�Moq�Kor�Los�������t�Nou�v�w�x�Poy�z���Qo��Ro��������UoSoVoXo��Wo��|�{�9D}�~�������!�gL��Yo.A"���Zo#�DJ[o+3$�%�&�<1��W4��V4\o��]o��^o_o������'�(�)�`o*�X4U3^96H+�boao,�-�.�co��������\1��/�0���fo1�eodo2�go3�����jo����4�G05�6�ho7�loko����8�9�:�;�nomooo��.F<�=�po>�?�@�A�qoso��B�roC�lID�E���toF�G�H�I�uo��e:��J�vowo��K�IKL�����M�N�O�P�KAQ�R�$0KBS�xo��mI������������{oyo_9��zoB8��T�U�V�W�X���EJ}o!p~o"p��Y�!1X?|=Y4#p������fG��%p��Z�"1��$pDD[�MN+F|o&N��18\�]�[M^�_�`�a�b�c�y64N��(7d�bB!g��&p,3o?��e���V3(pf�)p'pd7g�]:c>h�i�#1����YNj�k�l�+p.nm�*p������n�o�.p,p-pp�/p��0plN1p2pq�I@;H������}?g4����:Mm28=[8��5pr�4ps;6p3p����(;s���:p-j��u�VRv�w?8pw�x�y���%NqF��������+1z�c@6<������{�7J|�@1������mNkM��;p}�EE{<��~�!�<p"�=pL?>p#�nN����9p@pBp��Ap��?p����Cp����Dp$�%�zA&�b2����'�(�)�Ep����8L*�Fp����������Gp+�*O,�������1[Hp������IpJp����-�Np.�Kp��Lp��MpOp/�����0�1���D@����2�wL3�4�E@5�6�Pp��sH��QpSsLL7�Rp��Sp8�TpW39�Vp��Y?:���Wp��;�$7��<�=�>�Xp\p?�Zp@�A�B�[p����s3Yp]p����C�^p��H0��_p`p��������D�E�F�d>G�H�ap��I�J�G5��K�dp����cp��bp����qkL�\JM���N�O�epfpP�Q�R�S�T�U�V�W�X�gpY�Z�hp[�ip\�]�jp^�_�`�a�b�Z4c���d�e�f�j�kpg�h�i�k���l���������������lp#Gm�n�np;2o�qpppp�q�r�$1������A6GJ:D":��`9g=s�\?��t�spv�w�rpBMh4RH\Fx�y�|?NNu�[7��z�{�|�vp��}�up(�~�������!�KK,F"�#�$�%�&�P1'�wptp����QIjMxp)���������*�yp+���,�{pjB[3\3zp��-�.�/�i4280�1�j42�3�?E����`N������4�5�6�7�\8����8�|p9���}p~p!q��#q"q������������������������������������������������������������������������������������������������������wI��$q:�;�<�%q=�&q����>�'q?�@�A�B�����C���D�)q(qE�*q��F�����G���������������������������tHLf����)?��H�25I�J�K�L�+qM�,q��,R;]SH����{0N�;0��O���������t;0K~>P�-q��_L��Q�R�.q\M��B1������A;S�/qn20qT�U�V�1q��W�X�Y�3q4qZ�6q2q[�5q��\�]�[4����^�7q��8q����_�`�a�b�c�����d�e�f�g�9q:q��h�i�;q����=qj�k�l�<q��?qBqm�n�>q@qAq��o�Cq��B6p�q�r�s�t�u�v���������������������������������������������������������������������������������������������������������s<DqEqa9��w�x�y���������Fqz�>3������OGGqHq��{�|�}�ZCkF~�����!�"�Iq#�$�}G��%�LBX1n6��o6&�����������sCNqp6'�(�o2����Mq)�*�Kq+�Lq,�Jq����Xq��������-���.�/�0�OqPq��1�QqRq��2�3���Tq4�Sq��5�6�Y=Uq7�8�9�Wq����������:�;�35Vq<�=�{A38����>���Yq��������?�@�A�B�C���D�MB����Zq��E�F�-F����G�H�I�[qJ���������`q��^qL�]q_qM�\q��K���N�O�P�bqQ���R���S�aqT�dq����C6cq��U�eq����fq��hqgq������iqkqjq������������������������������������������������������������������������������������������������������������������������|9��V�W�lqX�Y�mq��Z�[�\�]�<3^�_�nq��`�a�oqb�c�q?��d�e���������f�pqg�qqh�rqsqi�j�k�b9����l�m�tquqn�vqwqo�p�xqq�r�1Hzqs�&I{qyq��}qt�u�|qv�~q��w�x�!r��y�z�{�|�}�~�!�"�"r��#�$�%�&�'�(�)�*�����+�#r,�$r-�.���%r/�&r'r��(r0�)r*r+r,r1�2�-r.r��5]/r3�4�5�6�7�8�xd459�����!32:1r0r%L����:���;�<�3r4r2r��5r����bK=�>�?�6r��{5@���A���B�C�D�E�F�G�H�I�J�K�%O������L�7rM�N�O�P���������Q�R���9rS�T�U�V�W�X�Y�Z�>0[�\�:r+J8r]�;r<r����^���_�`�=r>r����������a�b�?rc�nK-;d�z:/A��e�f�g�@r����h�i�Cr��j�k�l�m�Arn�������Dro�p�q8Br������q�Err�FrGr��Kr��*;s�t���dB��u�v�LrIrHrJrw�x�_7��y�z�����{�PrOrNr|�30��}�~�!�"���#�$�%�&�Zr��Vr��WrSrYr'�Urb3��(�LO)�XrTrRrQr*�+�,�-�\r.�/���_r0�1�^r]r2�3�4�5�6���II[rs0`r7�br����8�9�:�o3Mr71��;�dr����<�=�>�?�crar-C@�A�����B�C�D�pKE�F�G�ZNH�erI�P�J�K�L�fr����M�����grR�N�O�Q���S�T�U���V�hrW�ir����X�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������;DY�jr��7H��orkr������lr��Z�1KDL��PF[�\�^�pr����qr>Fnrmr��]���*2����_�yr����xr��`�a���u1b�c�d�vr������ur����sr��{3��rr2<)2����e�f�g�h�i���������j�c9k�m�|r{r��zrn�o�wrl�}rp�~r��q���������%s$s��r�s�������&s����-1!s"st�t99Lv�u�#sw�����x�y�z�2K����+s{�'s������|�}���,s~�!�"�������#�$�%�)s��(s&���'�(�\7����)�*�+�,�-�.�-s������������/���.s��������/s0�*s1�2�tr��3�0s��aD4���4s5�5s3s6���7�2s8s8�1s��6s9�:�;�������7s������:s<�=�>�?�9s@�����A�B�C�������D�<sE�F�G�=sH�>sI�IOJ�K�����;skBm:����?sL�N�������O���M�����P�Q�R�S���T�U���V�@sAsW�X�Bs����������������������������������������������������������������������������������������������������������������������������������������������������������������������������Cs����48DsY�Z�[�Es��/<\�Fs]�^�_�`�a�Gs����HsIs��b�c�LsJs<O��Ksd�oNe���f�Msg�[N��������h�Ns~G��i�OsQs��j�Rsk�l�m���n�o�p���Psm9MLcKwV��`]{K��������+2��q�r���s�TsP5UsVsWs��u9��Xst���T`[L��cBYs[sZsu�\s������v�]s��w�^s������x�y�z�_s{�|�}�`s~�asbs!�cs��dsesfs��"�#�$�����gshs%�������$E&�'�(�)�]8*�js+�,�-�.�/�����0�MAks1�����2�����3�4�ls����5�6�7�8���9�:�;�!I<�=�ms>�?�@�A�B�C�D���ns7c����Zlmp����osE�psF�G�H�I�J���K�L�rssstspNqs����usvsM�N�xs��wsO�P�Q�R�S�zsT�U�{sys����V���W�����������������������������6N��X�Y�Z�[�\�|s]�^�������}sTc_�~s`�a�b�c�*!��t!p!s!u!��J!K!v!\!$!��%!?!0#1#2#3#4#5#6#7#8#9#'!(!c!a!d!)!w!A#B#C#D#E#F#G#H#I#J#K#L#M#N#O#P#Q#R#S#T#U#V#W#X#Y#Z#N!��O!0!2!.!a#b#c#d#e#f#g#h#i#j#k#l#m#n#o#p#q#r#s#t#u#v#w#x#y#z#P!C!Q!��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������1!��o!<�^�%"\�& %     �	�00;�=�[�]�0	0
000
00000�
�������`"��f"g""4"B&@&�2 3 !�������
� ��&&�%�%�%�%�%�%�%�%�%�%�%; 0�!�!�!�!0����������������������""�"�"�"�"*")"����������������'"("�`$a$b$c$d$e$f$g$h$i$j$k$l$m$n$o$p$q$r$s$`!a!b!c!d!e!f!g!h!i!��I33"3M33'3363Q3W3
3&3#3+3J3;3�3�3�3�3�3�3�3����������������{3��00!�3!!�2�2�2�2�2122292~3}3|3R"a"+"."""�" ""�"5")"*"�~�H���܄�O�p1f�h���fE_(N�N�NOO9OVO�O�O�O�O�O@P"P�OPFPpPBP�P�P�PJQdQ�Q�Q�QR�R�R�R�RSS$SrS�S�S�S��T�T�T�T�UYWeW�W�W�W�����X�XYSY[Y]YcY�Y�YV[�[/u�[�[\�\�\�\']S]�B]m]�]�]�]!_4_g_�_�_]`�`�`�`�` a�`a7a0a�ab�b�c`d�d�dNeff;f	f.ff$fefWfYf�sf�f�f�f�f�fg)�fg�gRh�ghDh�h�hi��i�i0jkjFjsj~j�j�j�k?l\l�lol�lm�mom�m�m�m�m�m�m9n\n'n<n�n�o�o�opp(p�p�pqq\qFqGq��q�q�r�r$s�ws�s�s�s�s�st�s&t*t)t.tbt�t�tuou�v�v�v�v�v�Fw�R!xNxdxzx0y����y��y�z�z��z�{�H}\}�}�}�}R~G���b��ǃ��H���S�Y���k���� �!�����7�y�����ߊ"���S�����v�#�ώ$�%�g�ސ&��'�ڑבޑ������
�:�@�<�N�Y�Q�9�g���w�x��גْВ'�Ւ�Ӓ%�!���(������p�W���Ɠޓ��1�E�H����)�����3�;�C�M�O�Q�U�W�e�*�+�'�,���N�ٚܚu�r��������p�k�-��ў����p!q!r!s!t!u!v!w!x!y!����p!q!r!s!t!u!v!w!x!y!`!a!b!c!d!e!f!g!h!i!����12!!!5"�~�H���܄�O�p1f�h���fE_(N�N�NOO9OVO�O�O�O�O�O@P"P�OPFPpPBP�P�P�PJQ��dQ�Q�Q�QR�R�R�R�RSS$SrS�S�S�S��T�T�T�T�UYWeW�W�W�W���X�XYSY[Y]YcY�Y�YV[�[/u�[�[\�\�\�\']S]�B]m]�]�]�]!_4_g_�_�_]`�`�`�`�` a�`a7a0a�ab�b�c`d�d�dNeff;f	f.ff$fefWfYf�sf�f�f�f�f�fg)�fg�gRh�ghDh�h�hi��i�i0jkjFjsj~j�j�j�k?l\l�lol�lm�mom�m�m�m�m�m�m9n\n'n<n�n�o�o�opp(p�p�pqq\qFqGq��q�q�r�r$s�ws�s�s�s�s�st�s&t*t)t.tbt�t�tuou�v�v�v�v�v�Fw�R!xNxdxzx0y������y��y�z�z��z�{�H}\}�}�}�}R~G���b��ǃ��H���S�Y�k���� �!�����7�y�����ߊ"���S�����v�#�ώ$�%�g�ސ&��'�ڑבޑ������
�:�@�<�N�Y�Q�9�g���w�x��גْВ'�Ւ�Ӓ%�!���(������p�W���Ɠޓ��1�E�H����)�����3�;�C�M�O�Q�U�W�e�*�+�'�,���N�ٚܚu�r��������p�k�-��ў����������������������������������������������������������������������������������������������������������������������������������������������������T�U�V�W�X�Y�Z�[�\�]������������������������������������������������������������������a���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������e�������������������i�������������`�������c�������������������a�k�����j�d�������l���������������������f���������n���������������������������_�m�����b�������g�����������h�����������������������������������������������������������������������~�������������������������������������r�s�������������������������o�p�q�����u���������������������������������������������������������������������t�������������������L�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������M���������������������������������������������������N�O���P���������������������������������������������������������������������������������������������������������Q�������������������������������������������������������R�����������������������������������������������������������������������������������������������������T�������������S�V���������U�������������������������������������������������������������������������������������������E�����W�������������������������������������������������������������������������������������������������Z�[�����Y���������������������������������������������������������X�^�����\���������������������������������������������������������������������������������]���������������������������������������������������������������������_�������������������������������������������������������������������������������������������������������������������������������������a�����������������������������������������������������`�b�������������������������������������������������c���������������������������������������������������������������������������������������������������������������d���������������������������������������������������������������e�����������������������������������������������������������������������������������������f�g���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������h�����������������i���������������[�������������������������������j���������������������������������������������������k�l�����������m�������������������������������������������������������n���������������������������������������������������������������������������������������������������������������������������������������������������������o���������������������������������������������������������������p�����������������������������������������������������������q�����������������������������������������������������������������������������������r�u���������������������������������t�����������������������v�������������������������������������������������������������������������������������������������������������������������������������������������������������������������w�x�y���������������������z�������������������������������������������������������������������������������������������������������������������������������������������{���������������������������������������������������}�|������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������K����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������G�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������J�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������H�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������F����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������@�A�������������������������������������������������������������������������������������������������������������������������������������������������������������������C�����������������������������������������������������������������������������������������������������������������������������������������D���������������������E���������������H�����F�����������������������G���������������������������������J�I�����������������������������������������������������������K���M�L�����N�����������������������������������������������������������������������������������������������������O���������������������������������������������������������������������������P�����������������������������������������Q�R�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������S�T�����������������������������������������������W�U�V�������������X�Z�\���������������������������������������������������������������������������������������]�����������������������������������������^�����������������������������������������_�`�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������d�����������f�g�����������������������������������������h�����j�k�m�������������������������������������n�������������������������������������������������������������������������������������������������������������������������������������p�������������������������������������������o�����������������������������������������������������������q�r�������������������������������������������������������������������������������������������������������������@�s���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������t�v�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������w�������������������������������������������������������x���������������������������������������������������������������������������������������������������������������������������������������������y�������������������������������������������������������������������������������������������z�{���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������|�����������������������������������������������������������������������������D�}���������~����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������A�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������C���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������I��������������������������������������������������������������������������������������������������������������������������������������������B�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������s�~���������B�Y�a�b�c�e�i�l�u��������������������������������������|���������������������������������������������������������������������������������������������_�������������������������������������������������������������������`�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ʁ������
�~304050;0<0�0�0�����������������"�"�"�"	""##���������������"�"�"%"&"�)�)0000������������������������������b"C"E"H"v"w"�!����������������n&k&l&i&�%�%�%�%�!�!�!�!�!�!�!�!�!4)5)���������������������)�%=0F�E��%" ����������������������������������������������������"5!!�3!'!�����������������������������������������������������0 �)�)K0��M0��O0��Q0��S0���������������������������������������������������������������������������������������������������������������������������������0�0�0�0���0���0���0���0���������������0�����������������0�������0d&`&b&f&a&e&g&c&��������������������������������������������������$�$�$�$�$�$�$�$�$�$&& 0&&&&&h&�%�1�1�1�1�1�1�1�1�1�1���1�1�1�1�1�1�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�������������������������������������������������������������������0�0�0�0�"�"S!T!U!'##$�#Q2R2S2T2U2V2W2X2Y2Z2[2\2]2^2_2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�����������������%�%�%�%< G H I ���>?���������� �����������������������������������������������������������������������������������*jL+kM�A=Z`^dy}{�B>[�a_ez�~|T9CGPXnpbU:
DHQYoqc�$4\l	%5]mq�~��lny�Vs}��{m_r��aKp�'��f��SW�`�SRh�XuY\^Po�d�TQR�e��U�zgZ���pq����������������rsa����? ���������%,9 =)/�$0<4*:;v'w'x'y'z'{'|'}'~''�$�$�$�$�$�$�$�$�$�$p!q!r!s!t!u!v!w!x!y!z!{!�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2������������������Q B `$a$b$c$d$e$f$g$h$i$j$k$l$m$n$o$p$q$r$s$`!a!b!c!d!e!f!g!h!i!j!I33"3M33'3363Q3W3
3&3#3+3J3;3�3�3�3�3�3�3�3k!��������������{300!�3!!�2�2�2�2�2122292~3}3|3������."��������"�"������V'&�O��4(N/N0N�N�N�N�NOO`OHOIOVO_OjOlO~O�O�O�O0��O�OPPPP'P.P@P;PAP�P�P�P�P�P1�QQQQ5QJQ2�UQWQ�4�Q�Q�Q�Q�Q�QR�4RRIRWRaR�R�R3��R�R�R�R4��R�RSSS5�aScS}S�S�S�ST'TMT�TkTtTT�T�T�T�T�T�TU+U5UPU^U�U�U�U6��U�U7�VV;VIVvVfV8�oVqVrV�V�V�V�V�V�V�V
W��!W/W3W4WpWwW|W�W����W�W�W�W�W�W�W�W�W	X�aXdX9�|X�X�X:��X���X�X�X�X�X�XYA�]YmY�Y�Y�Y�Y�Y�YZ#ZgZmZwZ~Z�Z�Z�Z�Z��[%[]RA[V[}[�[�[�[\\#\+\�7b\;�<���z\�\�\�\�\�\�\�\�\�\���7
]']�F]G]S]J]m]�]�]�]�]�]�]TSV�]^^X^^^�^(��^�^____#_4_6_=_@_E_T_X_d_g_}_�_�_�_�_�_�_�_�_�_�_
```3`5`G`=��`�`�`�`�`�`�`a+a0a7a>��a?��a�a@�"b>bCbVbZbob�b�b�b�b
cc9cCcec|c�c�c�cdd"dydQd`dmd�d�d�d�d�d�d�d�d"e)eA�ge�eB�f	fff:f"f$f+f0f1f3f�fHfLf��YfZfafefsfwfxf�fC��f�f�f�f�f";�f�f�fg)�3gfgGgHg{g�g�g�g�g�g�g�g�g�ghRhh,h1h[hrhuhD��h�h�h�h�h�h�h�h�h�h
iIi��5iBiWicidihi�i��i�i�i�;�;�i�i�i�i�ijj��;j>jEjPjVj[jkjsj���j�j�j�j�j�j�j<�kk,k5kFkVk`kekgkwk�k�k�kp��k�k�k�kll3lYl\l�ltlvl�l�l�l�l�l�l�l�l�l�l��mm.m1m9m?mXmemE��m�m�m�m�m�m�m�m�m�m�m�m�mF�4nDn\n^n�n�n�n�n�nooG�*o/o3oQoYo^oaobo~o�o�o�o�o�o�o�o�o�o�o�o�o�opp(pJp]p^pNpdpup�p�p�p�p�p�p�pq+qq q.q0qFqGqQqH�Rq\q`qhq��q�q�q�q�q�q�qrrUrVr?>�r�r�r�r�r��'s(s�Psfs|s�s�s�s�s�s�s�s�s�s�s�s�st
tttJ�&t(t*t+t,t.t/t0tDtFtGtKtWtbtktmt�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�tuu/uouyu�ur?�u�uvvvvvvv-v5vCvKvdvevmvovqv�v�v�v�v�v�v�v�v�v�v�v�v�v�v
ww4w6wFwMwNw\w_wbwzw�w�w�w�w-xCxNxOxQxhxnxK��x���x�x�xy�xy.y1y4yL�M�EyFyN�O�P�\yQ���yyR�S���y�y�y�y�y���y�y�y�yzT�9z]zmzU��z�z���z�z�z�z�z{-{;{G{N{`{m{o{r{�{V��{�{|1|| |3|6|dB��Y|m|y|�|�|�|�|�|�|�|}}}}#}1}A}H}S}\}z}�}�}�}�}�}�}�}�}W�(~~~~Y�G~R~a~�~�~GZ����������[��&�5�7�<�ʀ׀���J�`�g�h�m���ʁρׁ\�SD[D`�t���������������������ƂՂ������b�"�-�:�C�G�Q�U�}���������������ǃσу����
�_�H�_�p�s�������������„��2��#�/�Y�d����z���������˅΅����������)�8�W�[�6�b��El�u������������q������������Eև��
��������ʈΈ�����`����'�0�2�9�@���a�ԉ����"�7�G�N�]�a�u�y���Њߊ�"�b�c�F�T�Y�i���I�h�d�����e�����΍э׍ �#�=�p�{�����DH���-�6�T�����������-�g�����������������ĐŐǐאݐސ��&����"�#�'�/�1�4�=�H�[�����������ב��������8�9�:�<�@�C�O�x���’˒̒Ӓ����!�%�H�I�J�d�e�j�p�������Ɠޓߓ���3�J�c�k�q�r���������������˕Еӕ�IڕޕX����������Җޖh���3�;�M�N�O�Z�n�s���������ɗޗۗ�i�
��+�0�j�R�S�V�W�Y�Z��e�l���Ș�X�����$�-�.�8�J�N�R�����ÚΚ֚���� �L-�^�y�f�r�u�������������Λ�����#�A�O�P�S�c�e�w���C�G�R�c�p�|�����������ם�����|�������������Þў�9�W����������Y[\w^&vk~NNN)N+N.N@NGNHN��QN4��ZNiN�N,4.4�N�N���N�N�N�N�N�N�N�NOOdO7O>OTOXO��wOxOzO}O�O�O�O�O�O�O�O�O�O�O�Oj4�OPPPPP"Ph4BPFPNPSPWPcPfPjPpP�P�P�P�P�P�P�P�P���P�P�P�P�P�P���P���P�P�P�P�4Q��QQ��`Q��sQ�Q�Q�4�Q�Q�Q�4�Q�����Q�QRRR��UR\RlRwR�R�R���R���R�R�R�R�R�R5�R���R
SS$S5S>SBS����gSlSzS�S�S���S�S��]5^5�S�Sc5�S�SUT$T(Tn5CTbTfTlT�T�T�T�T�T�T�T�T�T�T�T���T�T�T�TUU	U<UAU�5GUJU�5`UaUdU��}U�U�U�U�5�U�����U�U�U�U�U�5�U���U(V��VV0V7V�5=V?V@VGV^V`VmV6�V�V�V�V�V�V�V�V�V�V�V�V�V�V��W#W��)W��EWFWLWMW��hWoWsWtWuW{W�����W�W�W�W�W�W���W�����W�W�WJ6�W�W�WXX X'X2X9X��IXLXgX�X�X�X�X�X�X�X�X�X���X�X�X�X�XYYY
YY$Y���6=Y�6FY�6��[Y_Y��uYvY|Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�����6Z
ZZ'Z-ZUZeZzZ�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z[[[4[-[L[R[h[o[|[[�[�[�[�[a7�[b7�[�[l7k7�[�[u7\)\0\��_\c\g\h\i\p\����|\�����\�\�7�����\�\�\�\���\�\���\����]]+]] ]$]&]1]9]B]�7a]j]�7p]���7�]8�]�]�]�]�]�]�]���]�]�]�]�]���]�]/8^68^^@8^.^>^I^\8V^a8k^l^m^n^���^�^�^�^�^�^�^�^���^___��_G_c_r_~_�_�_�_�_�_�8�_�_�_�_�_�_�_�_�_�_9`"`$`9L``�`�`�`���`�`�`�`�`�`�`�`�`aaaaa:ao9AaFa`a|a���a�a�a�a�a�a�a���a�a�a�a��b#b)bFbLbQbRbabdb{bmbsb�b�b�b���bc
cc����2c5c;c<cAcDcNc��Yc����lc�c�c���c�c�c�c�c�c�c�c�c�c	dd%d)d/dZd[d]dsd}d�d�d�d�d�d�d�d�d���d�d�den:eees:e2eDeTekeze�e�e�e�e�e�e�e�e�e�e�e�:�e�e�eff!f*fEfQfNf�:��Wf[fcf����jfkflfmf{f�f�f�f�f;�f�f�f;�f;�f�:ggg��g����LgMgTg]g������tgvg���g��c�h�g�g�g�g�g�g�g�g�g������hh-h��3h;h>hDhEhIhLhUhWhw;khnhzh|h�h�h�hm;�h�h�h�h�h�h�h�h�h������h�h�h�h�h�h�h�h�h�hii�;�;��;i�;Fiiilirizii�i�;�i�i�i�i�i�i�i�i�i�i����0j�����i�i�i�i�;�i�ijjj��2j3j4j?jFjIjzjNjRjdj��~j�j�j�;�j�j�j���j�j�j�j�j�j�j�����j�j�j�j�j��kkkk��k&</kJkXklkukzk�k�k�k���k�k�k�k�k�k�k�k�k�kl
ll5l6l:l��?lMl[lml�l�l�<�l�l�l�l�l�l�<�l�l�l�l�l�l��m
m$m&m'mgl/m<m[m^m`mpm�m�m�m�m�m�m��n�������m�m�m�m4m�m�m�m�m�m�m�m6nn"n'n=2n<nHnInKnLnOnQnSnTnWncn=�n�n�n�n�n�n�n5o�n�n�n
ooo%o6o<o��RoWoZo`oho�o}o�o�o�o�o�o�od=�o�o�o�o�o�o���opp
p#p��9p:p<pCpGpKp�=Tpepiplpnpvp~p�p�p�p�p�p���p�p���p�p�p�p�pqqqqqq�=/q1qPqJqSq^q�=�q�q�q�q�q�q�q�q���q�q�q�qr>I�+r4r8r9r,NBrSrWrcr��nrorxrr�r���r�r�r�r�r`>�rf>h>�r�rssss�>9s,s1s3s=sRs�>ksls��nsosqsws�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�st�st$t1t9tSt@tCtMtRt]tqt�t�t�t���t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t���t�� u$u*uW?��=u>u@uHuNuPuRuluruquzu}u~u�u���uu?�uw?�u�u�u�u�u�u�u�u�u�u�u�u�u�u�uvvvv�?��vvv��%v(v<v3v���?Av��IvUv�?nv�v�v�v�v�v�v�v���v���v�v��ww-w5w9@����Xw`wjw��rw|w}w��X@�w�w�w�w�w�w�w�w�w�w�w�@�w�w�w��xx	x
xx!x,xGxdxjx���x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x��yy0y%y;yJyXy[yAgyry�y�y�y�y�y�y�y�y�y�y�y�y�yHA����OA
zzzzzcA-z8zGzLzVzYz\z_z`zgzjzuzxz�z�z�z�z�z���A�z�z�z�A�z�z�z�z�z����{��={'{*{.{/{1{�A�A{A{�AU{y{d{f{i{s{��B�{�{�{B�{�{�{�{�{�����{�{�{�{�{||||&|E|J|Q|W|^|a|i|n|o|p|�������|���|�|�|���|���|�|���|���|�|���|}	}�B}}����=}>}@}G}�����BY}Z}j}p}�B}���}�}�}�}���}�}�}�}�}�}�}�}�}�}�}C��X�~~~ ~'~,~E~s~u~~~�~�~+C�~�~�~CC<;>CDO�4��R��acdm}~���{Q��������������
�����$�,�0�C�f�q�u�{�������������ŀՀ؀��
������C5����C$�'�,���=�Di�D��D����"D������Áցہ����������������!�"���2�4�<�F�I�E���K�vDO�zDW���\�c���]�^�y��D}��������������������������T���0�<�D�W��D��D�D����������ɃЃԃ݃��������9�J�O�Q�R�Y�Z�\���e�v�x�|���
E܄������E΄τӄ�����������$�%�+�4�O�o�%ECE>�Q�S�^�a�b���{�}����������������Džʅ؅م߅������!�$�'���9�<���@� �S�V�o�w�z���������������!�������ÆцՆ׆�憸E�������!�#�1�:�>�@�C�Q�X�d�e�r�|������������������E������·��߇������������(�.�2�<�FJ�X�_�d�����i���o�����������҈��шӈۈ��AF���7���B�E�I���eFb�������������։؉뉡F�����F����!�5�>�E�M�X���������׊����
��
���-�C�GQ�^�v��������������9���=�����E�G�O�T�W�i�m�s���������dG����֌Ռٌ����	��l���������ƍȍٍ���G�������!�"�'���H6�9�K�T�b�l�m�o�����������������юԎNH�������+�@�J�X�������f�������Ə$�ʏ͏ӏՏ������7���C�D�]�����������H����ÐȐ��ܐߐ���������������7�9�:�F�G�W�Y�a�d�t�y�������������Ñđڑ�������
�����3�B�G�J�N�Q�V�Y�`�a�e�g�h�����|�}��������������������������ƒΒВגْ����������
����'�)�����G�Q�W�Z�k�q�s����������������������Ǔܓ��	������2�4�;�E�����m�o�x�y���������������ȕ����,�3�4���<�A�a������������I�����������I��ؖږݖJ�#�)J6�A�G�U�W�[�j�������������������̗їԗؗٗ���
�����J��#�2�3�%�G�f�������������������˜ǘ˘����������;K�����������1�2�3�:�;�<�@�A�F�M�N�\�_�`�����������Ùəԙٙޙ�����
���� �1�6�D�L�X��K���K���K����ƚКҚ՚�Kܚ���������+�3�=� LK�c�e�k�l�s�v�w�����������������Ǜ�؛ݛ�������������������"�'�)�*���1�6�7�E�\���I�J���T�X�[�]�_�i�j�k�m�n�p�r�u�z�������������L��2��LB�J�_�b���i�k���s�v�w�~�����������������Ýǝɝ֝ڝߝ���M
��
����{�����������������ߞ����wM���/�7�:�=�A�E�F�S�U�X���]���i���m�p�u�2"������������������������������������������������������������������")#)����$)��%)����&)')()��))*)+)����,)-)������.)/)0)1)2)3)4)5)6)7)8)9):);)<)=)>)?)@)A)B)C)D)E)F)G)H)I)J)K)L)M)��N)O)P)Q)R)S)T)U)V)W)X)Y)Z)[)��])^)_)`)a)b)c)d)e)f)g)h)i)j)k)l)��m)n)o)p)q)r)s)t)u)z):*I*!*,*<*K*Y*_*����=*L*@*O*��P*x)})��������>*M*?*N*Z*`*������������[*a*��}*����v){)����������������\*b*������;*J*����$*/*����#*.*A*Q*����B*R*����z*y)~)����C*S*++*+9*H*����D*T*%*0*]*c*'*3*&*2*G*W*(*4*��������w)|)^*d*E*U*F*V*��������������)*5*+*8***7*����������������������������������������)+��������������������������������������������������������������������������������������������$+��������������������o(p(��q(v(w(��x(��y(��z(��{(��|(������������������������������������������������������t(u(������E+3+9+:+%+��?+n*&+.+������1+��2+u*(+y*����6+<+"+B+,+������j*t*k*4+{*e*v*o*��/+������l*A+s*��p*g*����|*q*h*'+������m*-+5+f*��;+x*��r*@+i*��!+~*����#+��������w*������>+=+������������������������������������������������������������������������1*S+������T+������U+V+������������"*X*��-*��6*q+��������������a+b+c+��\+Z+_+}+[+��W+��m+����Y+^+����]+����������������x+y+~+��j+v+w+k+l+������r+g+������o+z+��h+����p+s+������u+��������i+{+|+t+n+����������������������������������������������������������������������R+������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Y&r(s(F+G+P+Q+|#����������������������������@#��������������������������������������������������k(����X+����~,��������l(m(n(��������������},������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������!)]#������_#����b-��������������������d-����������`#��������������������������\#����������������������������������������������������������x'y'z'��������������������5-6-7-8-9-:-;-<-=->-?-W-��������5,6,7,8,9,:,;,<,=,>,?,@,������������������������������������������������q"��'#%#&#(#������������������������������������������������������������������������������������)#������������������������������������������������������������������+#,#*#-#G"������F"������������������[#����������������������x-����������T"U"��������������s-����������������������������������������l"��m"����n"��������������������������������������������������k"��������������������������������������o"p"������������������������B"C"��������D"E"������������������Q"R"S"������������������������������������������������������������������������������y-����������������������������������������������������v'w'H"I"����������������������������������|'������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������B'C'D'E'F'G'H'I'J'K'L'M'N'O'P'��~'}'������������������������������������������������������������������������������������������������������������������������!-"-#-$-%-&-'-(-)-*-+-,---.-/-0-1-2-3-4-����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,��+,,,-,.,/,0,1,2,3,4,Z&[&\&]&^&_&`&a&b&c&m&��������"#!#����������������$###��������������;#������������g(h(i(j(������������������������������������?#h&i&j&k&��������������������g&��������������d&e&������������~-����������������������������������������������������������������������������������������������������������������������������������:&=&;&@&9&>&<&?&l&}"��{"|"��z"{'������������������������������������������������������������������������������������������������������������������������������������}-��������������������������������������������������������������!,",#,$,%,&,',(,),*,.#/#��������������������������������������������������������������������������������������������������������������������������������������������������������������V"W"����������������������������������������������������������������������������������������������������������������:#��������������������������������������������������������������������������������������������������������������������}#~#Z"["X"Y"������`-��a-f&������������������������������������3"4"5"����������6"7"<#����������������������������������������������������������������������������������������������������������������������������������������������������������������������������t$u$v$����������������9"{#����������������������������������������������������������������������������������������������������������������������������������������������������������������������������r's't'u'��������8"n&o&p&q&r&s&t&��v&w&y&z&{&|&}&~&j-k-������������l-����������������������������������������������A(B(C(D(E(F(G(H(I(J(K(L(M(N(O(����������������������������������������������������������������������������������������������������������������������������������������e-f-g-h-i-����������������P(Q(R(S(T(U(V(W(X(Y(Z([(\(](^(��������������������������������[,\,],^,_,`,a,b,c,d,e,f,g,h,i,j,k,l,m,n,��q,������p,����s,r,������������������������o,F-������������������J-������������A-������D-������������������B-L-����K-E-������M-��������������������G-��������O-��������������������������@-N-����C-������H-����������I-����������������������������������������������������������������������_-o-n-m-������������������������������S-T-������������������������P-Q-R-����V-��������������������������������������������������������������������U-������������^#��c-#.������-���������������������������������������������������������������������������2���3�������������������������������������������������������������������������������������������������������������������^���V�������������������������������������������������������������������������������~���������������������������������������������������������������������S.������������+���������h��������/���������������������������������������[.H���������������������������������������������������������������������������������������������������������������������������]�^���������a���������������������g���������������������������������������������������������������������������������������������������������������#���&���������������������������������������������������������/�����������������������������������������8���������������������������������������������������B�J�����������������������������������������������������������������������������������������������������������������������������������������y���������������������������������������������������������������������������������������������������������������������������������������������?���������C�����A�����������������������������������������������������������������������������������������������������������W�#�%�����������������)�(�����������������,�����������������������������������������������_O������������������������������������������������������������������������������������������������������>�����������������������������������������������������������������oO����������V�����������������������Y�����������������\�^���������������������������������������������������������������������������������������������o�������������q�������������������t�������������������������������������������������������y���������{�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������;�F�����J�������������������������������������������������������������������������������������������������������������������������������������������������������������������������`�[���������_�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������q�6�������������������������������������|�.�����������������������2���4�����������Iu����������������������������������������������������������������������������������������������������������������������������������������������������m�������������������e�������������������������������(�)���������,���������������������������������������������4�����������������������������������~u������������������������!v������������������H���������������������������������������������������������������������]�:v��������������������������������������������w�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������;���������������������������B�q�����������������������~�����������������������������������������������������������������������������������������������������������������������������������������@���������������������������������������������������������������������������������������������������������T�������������������������������������������������������������������������p�������������������������������������w�(����������������������������������������������������������������������������������������������������������������fw����������������������������������������������������������������?��������A�B��������������������������������������������������I������������������������������P�4��������������������������������������������������Mx����F�H����������������������������������������������������������������������������������������������������������\��������������������������������������������������g������������������������l�"����������������������������������������������������������-������������������������������������������������������������������������������������������������������������������9�d����������������������������������������������������������������������������������������������������������������������������������t����������w������������������������������������}��������������������������������������������������������������������������������������������������������������������������������������������������������������3������������������7��������������������������������������������������������������������������G������������K������H�S����������W������������������������������������������������������������������������������������������������������������������������������������������������������������������������my��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������+����������������������������6����������;�N������������������������������������������������������������������������������]��������������������������������������������a��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������>���B�H�����������������������������J���������L�����������O�������������������������������������������������������������������������������������������������Yz��������������Zz����������������������������������������������������l�������n���������������������������������������������w�������������������������������������������������������������������5���������������������2�������������������������������������������4�Y���������T�����������������������������������������������m�����������������������������������������������������������n�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Q{����������������������������������������������������O�����������������������������������������������������������������������������������������l���������`{$���������������������������������������������������������������������������������������������������:�����������������������������������������������������������������������C�����������������������������������������������������������������������������������������������������������������������N���������������������������S�k�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������)�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������?�I�������������������������������������������������������������������������������������������K|������������������\�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������'�X}������������������������������������������������������������������������������������������������������������j�������������������������������������p�u�������������������������������������������������������������������������x�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������7�U�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������&���������������(���������������*�������������������������������������������1�>~����������������?���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������*�������������������������-�K�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������`�"�������������������������#�����$�������������������������������������������$.%���&�.�'�%.&.������������������������������(�������������)�*�����������������,�����������������/�����������������������������0�����������������������������������������������������������������������'.������������������������������1�������������������������������������������������������4���5�7�������������8���������9���������������:�������������������<�������������(.������������������;�����������=�������>���������������).��*.?�����+.��������������,.��������������������@�����������������������������������������������������������������B�������������C�������������������../.��������������������D���0.��E�������������1.-.������A�����������2.��3.��������������������G�H���I�����J�4.������K�����L���������5.��������������M���6.����7.����N�����������������������������������������������P�����������������������Q�������������R�������9.��S�������T�����U���������������������������:.����������O���������������������!.W�X�;.<.����������������������=.��Y�����Z���������>.������[���\�������]���������?.������������@.������������������������B.��������A.C._�������`���������������a���������b�������c�����������������������d�����e�������f�����������g�����������������������������������������������i�������������������j�k�D.l�m�����������n�������������h�������������o�������������q�����������������r�s�����������������t�����u���������E.��x���G.������z���������{���������������|���������H.����}�����������������F.v�K.����J.��!�����L.����������������������#�������$�����M.��������������������������������������������N.����������������������������������������O.��������������������Q.��R.����������������&�������������������������������������(���������������t������������)���������������*�������������������������,���������T.����������-�������������������.�����������������������������0�������������U.������������V.��������������������������������������W.������X.����������������������Y.��������3�4�Z.5�������������������������������6�\.��].7�����������������������������������������������������������������������������������������������������^.����������������������9���_.��������:�~/������`.��������������������;���������������������<���������������������>���=�����������������������������a.��������@�����������������������B���C�����������������D���������������������E�F�������������������������b.��G���d.������e.I���������f.��������g.����������������������������������������i.������������K�������j.k.������������l.����L�M���������������������������������m.��������������N���������������������������������O�����������������P�������Q�������������������������������������������������������������o.��p.������T���������U���������������������������V�����q.������������������������������������������r.������������������s.������������W���������������������������t.��X�����Z�����������������[�����������������������������������������_���������`���������������������������������������������������b�c�u.����������������������~O����������e�����v.f�����������������������������������������������������h�������������������w.��������������d�������������������������i�������j���������y.k���������������z.��������������������{.����������������|.��l�����m���������������n�}.����������x.������o�~.��������p�����!/������q�r�����������������s�����t���������u�������v�����"/��������������������������������������������������������������������������x�����y���z���{�����������������������#/|�}���������������~���������$/��������������������������������������������������������%/������������������&/������������!���������"�����������$�����%�����������'/��������������������������(/��'�(�����)�������������������������������������������������+�������)/,�������*/��-�����������+/����.�������������������������������������������������������-/����������������������������������3�������������������4�����5���./����6�0���������������������7���������9�������������;�>�0/����������1/��?�����������������������������������������������<���������������@�������������A�������2/��C���D�E�������������F���3/������������������'t��������������������G���H�����������5/������������I���7/��8/9/������4/����������������������������������K�������L�����������������M�������:/N�����O�;/������������������P�</����=/Q���������R�>/����������������������������������S�������?/@/����T�����������������������������������U�����������������V���������������������������W�X�A/��������������������Z�����������������������C/��[�����������]�����������D/������E/F/��������������������������������_�`�����������a�b�����������������������������������������������������d�������������e�G/����f�g�h���H/������i�I/����������������������������������������������������������m���J/n�o�������������������p�������l�����������������������M/����������������������������N/O/������s�����P/��������������q�������������v�����������Q/��w�������������R/����x���������S/T/��z�����{���|���U/}���������V/����������������������������������������~���!�������������"���������������������#�������������$�������������������������������&�����'�����������������������������������������X/����Y/����(�����������������������������������������[/������������������������\/)�*���+���,�-�������.�����������������/�]/��������������������_/0�������������1�����������������������������������3�������������������4�b/������a/��c/����������d/����������e/��5�������������f/������������������6�7�8�9���������:�g/;�������������<�������������������������������=�������������������������������������������������@�����������������B�����������������������������������������E���i/��F���������������������������j/��������������H�I�����������J�����������������������������k/������������l/������������������������K���������m/������������������L���������������������������M�������������n/��������N���������O���������o/��������������������p/P���������Q�R�����S�������������T�������������������z~X�Y�����������q/������Z�����������������������r/������[�����������\�������������������������������������������������������������������������������]�������������������������������^���s/����������t/������������������u/����_�������v/����������w/������������`���������������������������������a���x/b�c���d���������y/������������������e���f���g���������h���������i���������z/������������������������������������������j���k�������l���������m�����������������o���n���������p�q���������������r�����������������������������s���|/����������������������}/��������������u�������������t�������������������������UO��������������������v�����������w�������VO����������������������������������x�������������y�������������������������z�WO��{���|�����}�����������������������������XO����!�������������������������������������������"���������������������������������������$���������������������������&���������������'���YO��������������������������������������ZO��������*�����������������������+�-�����������������������������[O����������������������\O��������]O����������.���^O��������/�������������������������������������������������������������������������������������{~������1�����`O2�������3�4�5�������������6�������������������dO��9�����������������������<���=���������eO������������������������������fOA���B�gO����C�D�����hO����F���������������G���������iO����������������������������I���jO��������kO��lO������������������������������������������������������������������mOL�������������pO����M�������������������������O�����P�������Q���R�qO������N�����������S���������������T�����������������U�������sOtO����vO����������������uO��������������������������W�����������������X�����wO����Z���������������������������������xO������������]�������������������_���`�����a���b�������������yO������zO����{O����������������c���d���e�������|Og�����������������������������������}O����������h�����������i�j���������������k���(t��m���������n�p�����������������������������������r���)ts�����*t������������u�����������������������������v�������������������������������w���������������������x�������������������������z���+t����������,t������������������������|�}�~�!�����������������|~������������������������������������������������������������������������������������������#���������$���%�������������������������&���������-t'�������������(���������/t������������)�������������*���������������������������������������������������������������0t������,�1t��2t��������3t-�����������.���������������������������/�4t1���������5t��������������������������������6t��7t������������8t����9t��������:t��2�������������������������;t������<t��������������������3�=t����>t��������������������4���������������������?t5���������������������@t����������6�������������������������At����������7���8�����Bt��������������Ct����������Dt��Et9�����������������������:�����<���Ft��=�������������>�?�@�������������������Gt����HtA�������������It��������B�C�������D�����������������E�Jt������������Kt����G�Lt������������������H���I�����������������������������Mt��Nt����������������������������������Ot��������K�����������������������������������������������������������������������������������������������������L���������������������M���������������������N���������������QtRt������������������O���������������Q�R�������������������������S�������������������T�����St����������������TtUt������U���V���Vt��������������������������������W�������X�����Y�����WtZ���[�\�����������]�����Xt��^�������������������������Yt��������Zt������������[t����_�������������a���������b���������������������������������������������������c�������������������������������������������������������d���������������������������������]t��������f�g�������h�i�������������������������j�����k���������l�����������������������`t����_t������������������������������������������������n���������������o���p�������������������������������������������q�s�������������������������btt�����������u�����������������������������������������ct��������dt����v�����������w���������x�y�������et������ft������������z�����{�����������������}���gt������~���������������|�������������������ht��������������������������������������!�������������������������"�����������������������������������������������������������it��������������������������������#�jt��������������������������������������������������������������������������kt%�&�������������lt����'�����(���������������mt��������������������������������������������������+�����,�������nt��-�.���������/���ot0�������������������1���������������������3�����������������������pt������������6�������������������������������qt��������������7�������������������������������:���������8�����������������������������������������������������������������������;���������������������������������������������=�>�������������?�������@���������rt����������A�B�st��������C�����tt��<�D�������������ut������vt������������������E�������wt����F�������G�����������H�������������������������������������������������������������������yt����������������I�J���K�����zt������������������������{t����������L�����������xt������M�������������������N�������������������O�����������������������P���Q�������������������������������������������������������������}t~t��������!u����������"uR�S���|t��#u��������T���U�������������������������W�X�����������������������������������$u������%u������Y�Z���������������������\���������]���^���������������`�������&u������������'u����������������a�����������������������������������b�������������������������������c�������������������������������������)u������d�����������������������������e�������������f�����g�h���������i�������������������������������������*u����������������������������������������j�����k�����l�������������m�����n�������������o���������������������p�����������������������������������������������������������r�������������s�����t�,u������u�������v�-u����������������������.u����������������/u����w�1u��2u����������x�3u��������4u5u��6u������������0u��������������������y�����8u������9u��{�����z�����������~���;u<u!�����������=u��"���>u��������%�&�'�(�����������?u������@uAu����)���������*�������������������������Bu����+���,�������������-�������������Du������������������������/�������0�Eu����1�����������Fu������3�������������Gu��Hu������������������������������������Ju������������������������Ku������5���������������������������Lu7u7�������8�������������������������9�Mu����������;���������������������������������������������������Ou��������������������������������������QuRu������>�?�������������@�����������������A�����������������Pu��������������������������E���F���������Su����������Tu��������������������������������H�Uu��������Vu����Wu����������������������������������������L���M�����������������Xu��������Zu����N���������O�������������������P���������[u��Q���R�����������������������������������������S�������������T���Yu����\u]u����������������������������K���������������X���������_u��Y�������������������������`uZ�������au��\���������������]�����^�����������_�`�������a�����b�����������^u����c���d�������bu������������������������������f�����g�������cu����du��������h���i�����������j���������������������������k�����������l���n�o�p���q�������������fu��gu��������r�s�������������hu��t�������������u���������������z���{�����iu������|�����}�ju����������~�����!���������������������"�#�����ku������$�lu����munu����������%�������v�ou&�������'�����pu������������������������������������������������������������������������������������su����������+�������������tu������-�����qu��������������������������uu����������������������vuwu������xu.�����/�����������0���������������1���������2�yu����������������������������������3�������5���6�������������������������{u7�������������|u����8�������������9�����:���;�������<�����������������������������}u��=���������>�����������������������"vD�����������#v$v������E�F�������G�I�%v&v��������������J�'v��K�������(v��������L�����M�������������������������������������A���O�P�Q�������������*v����+vR�����������,vS�����T���������V���-v��W�������.v��������/v����������������X�������������0v��������������1v������������U�������Z���������[�����������3v��\�����������^�����4v����������������5v6v_���`�������7v����������b�����������������������������������c�����������������d�������������������f�������e���������������g�h�������������8v����9v��������k���������l�m�n�������������������o�q�������r�s�t�����������v�������<v����=v��������������������������>v����x�����������?v��������������������������������@v������y�����������������������Av��z���������������Bv��������Cv��Dv��������{�����������������|���Ev����}�������������~�Fv������������������������������������������������!�������������������������Gv������Hv"���������������������������$�%���������������&�'�(���������Jv������������KvLv����)���������������������*�+�����������,���-�������������������������Mv.���Nv��������/�����0�Ov��������������������������������������������������������������������Pv��1�2�����3�������5�������������������������6���������������������Qv��7�Rv��������������������O���������8�����������Tv��Uv��������������������������9�VvWv����:�������������������<�=�>�Xv������Yv��������������������������Sv����?���������������������������������������@�����[v������������������A�����\v��C�����D�E�����]v����������������F�^vG�H�_v������������������������ZvJ�����av����������K�����bv������������������������������������������L�M�N�����������cvP�dv����e�������ev����Q���fv������������������������������������������������gv����R���S�T�������hv��������������������U�����������������������������V�W�jv��������kv��lvX���Y�����Z���mv������[���������������������������������nva�ov��b���������c�������������������pv����d�qv������f���������g�h�i���������rv������svtv��uv��j�����������������k�����������������������l���������vv]�����������n�����o�������p�������������������r�xv��m���������s�������������yv������t�u�v�w���x�y�z�{���|�������zv��{v��������}���������������������������������������������������������������������������������������������!�������������������������������������"�����|v����������}v����#�������������������$�~v��%�����!w����&�����"w��������������������'���������������������������������)�������������������������*�+�,�-�����#w��������������.�$w��������������������/�������&w��������'w������(w��(�0���������1���������������������������������������)w3�������4�*w5�����+w��6�,w-w����������7���������������������������������������9�.w������������������/w������0w1w����:�����2w��;�8�����������=�3w��������>�4w��������������?���������A�5w����������6w��<���������������7wB�C�8w������������������������������D�����E�������������������F�����������:w��������;w������9w����H�I�������<w=wJ���K�����������������������������������������������L�������>w��������������������������������N�O�P�����������Q�����R���?wS���Bw����������U���������������@wAw����������CwV�����W���X�Y�����������DwZ�������������[���\�����Ew]���������������������������^�_�������������b�������Fw������������Gw����������c���������Hw������`���������������������������f�����������g�h�Iw������Jw������i�������������Kw��������������e�j�k�l�m�n�����o���Lw����������������������������Nw��Ow��������������������Mw����Pwq�Qwr���������������������������������������RwSw����t���������s�TwVwu���������������Ww��v�Xw��������������Yw����������������������������������������������y�������[w��\w��������������������]w������x�������z�������{�|���������������������}�~�����!����������_w������������^w����`w������������#������������$��������%��&����������������������������������������������������������������awbw������������'������������������������cw������������������������������������������*��������������+����,�-��������������/������������������������������0�dwew1��������������������2������������������4�5��������������6����������7������������������������gw8����������������������hw����������������������������������:�;�<�=����������������������iw��jw>������������������@��������������������������������������������������������������������������C����������D�kwE������������������F��������G�H������������������������mwnw������K������L�M��������J����N����������������������������������pw��O������������������������������������qw��������Q�R�T�U�V��������W������rw��������X����Y������Z����������������[�sw����\����]�^�twuw��vw����_�ww��`��xw������������������a�b�c��d��e��������f����yw��g����zw������������{w����|w��������������h�}w������i�~w������������������������������j�l�m��������!x����"x����������������k����������#x$x����������������n�&x��'x��(x)x*x��+x,x-xo������������p����������r��s�.x��/x0x������1x��t������u�q����2x����������v������3x����������������4x��5x������w����������������������������x����y�6x7xz�8x������������=x��|������}�9x~��:x����;x!�"�<x��#�>x��?x@x$�%����������������Ax������&�(�'����Bx����������������CxDx������������������������)�*�Ex������+����������������������-����,������������������/������FxGx������������������������������������������Hx����������������1����2��������3������Ix��������������������������6�7�8������������9��������:�;�<������������������������������������������������=��Jx��?�>����������Kx@��A�B��C������������������E��������Lx������������������������������G������������������������I����������J������������K�L��������M������������NxN����O����������������P�Q�R����Ox����S������T�U��V������������W�Px��QxX����Z�Rx������������[����^�SxTx��Y�Ux��_�`�Vx������������b�}~��c������Wx����������e�Xx������������d������h�Yx����������j�Zx������������������k��������������������������[x\x��������������]xm�^x��_x������������������������������`x��������������������������������������n��������axo�bxcx��q�p������dxr�s�ex��������t����������fx����������������������������gx������v��hx��ix����������jx����������������������������������kx��x����y������lx��������������������mxnx������������������������{�ox|����������������������������������}����������px~�qx������������������������������rx������������sxtx������������������%����ux����vx&�wx��������������'������������)������������xx��*�+��yx��������������������������������������zx����������.������/��0�1������2�{x������������������������������������������������������������������������������������������������������3�4�|x������5�6����7�8����:����;����������<�>�?��@����A��������������������B������������C������������������D�}x������������������������������������������!y������E����������"y#y��$y������������������������������������F����%y��G����&y������������������������������������������������������I����������������J��������������L�M�N������K��������������*y����(y��������������������O����������������������P����Q�R����������S������������������T�U��+y��V��������������������,y��������.y��W�X�Y��Z�-y������������������������������\������������������]�/y����������������_��������������0y��^�1y����2y������������`����������������5y6y������a������������������������b��c�:y��������������������e������������������f����������>y����������������������������������������������������g�h�i�By����j��������k������������l������������Cy����m����Dy����n����������o������p�Ey��Fy��q�r����������Hy��s������������Iy������������������������Jy��KyLy������������x����������y����z��������{��|��������������������������~������������������!�Ny��������������������������"������#����������������$��%��&�Oy��'�(����������)��*��Py��������������+��,����������������-��Ry��������.��������/����������������������������Sy����0��������������1����������Uy����������4�Vy5�6������������������������8�Wy����9����������������������������������������:�;��Xy����������������<��������������Yy?������������������Zy����������������������������������������B��C��[yD�E�F����������������\y��A����J��������]y������������^y������������L������������������_y������N�O��P����`y��ay����byQ��������M��������I������������������������������T�U����������������V��cy��������������������������������X��������Y����������Z��������������[������\����������������_�`�ey��fya����������������������������b��������c�gy��d������������e��f�g��������������������������iy��jy����������h������������������hy��ky����ly����������������������������i������j����������k��������l�oy��������m��n������������o����pyp�q�r��������������qy������������������������������������������ry��������sy����������������������ty����������v����������������������������x�y������uy����z������|����~������!������������vy��#�wy������xy����������������%������&����������������(�)����yyzy*��������������,�{y������������������|y-������}y��������������������������~y����������������������0�1�2�!z����������3�"z��������������������#z����������7�8�$z��������������������������9��������:����������������%z��������<����&z����>�?��'z@������������������A��������C��(z����������)zD��E��������������������F�G��������������H�*z������������������+z������������������,zI�J����������������-z����K������������������L������������M�0z��������������Q�1z������2z��R��������S��T����������U�/z������V����������������������������������������������W�4z��������������������5z����������������������������6z������������������~~��������������X�Y��������������Z������������[�\��7z����8z������^����������_�`�c�b�d������e�f��9z��������������g��j��������������������������l�m�n��������������o����������������������������p�q��������������������������������s�;z��������v�<z��������w������������������������������x��������������������������������=z������z������������������>z{��������������������?z������@z������|�}����������Az��Bz~��!���������������Cz"�����������$���#�������%�����&�����Ez��'���������������������������(���Fz����������)�������*���������Gz��Hz��������Iz������������+���������������������������������������������������������������������,���������������������-�������.�����������/�����������������������������������������������������������0�����1���������������2�����3���������������������������������4�������������������������6���������Jz��������������������7���Kz8���������������Lz����������9�������������������������Mz��<�����������=�;�����������������@���Nz����������A�����������C�����D���������E�����������������?���������������G�������������������������Oz������������������������������������������Pz������������QzRzI�������Sz��������������������������������������K�����M�N�������������������������������������P���������������������������������������������������Q�����������������Tz����������R���S�������������Uz��������Vz������������T�Wz������U�����������������W���������������Y���������������������������������[���\�^�����������������������������������������`���������������a�b�������������������������������d���e���������������f�����������������i�g�����h���k�������m���������������o���������q�������[z����r���������������������������������\z��������v�������x���y�������z�������������{�������^z��������|���������������������������_z��`zaz����}�~�bz��������cz������!���"�����dz����#���$���ezfz������������gz����������������������������hz������������������������%�����������&�����������������������������'�����������izjzkzlz����������(�)�������*�����������������������������,���-���������nz��������������������oz����.�������������������pz��/�������������qz0�����rz������������������sz����+�tz��1���������������������mzJ���������������������������������������������������uz��3�������������vz������������6���������wz��7�8�����xz����9���:�������������������yz��zz������������������������������������������{z|z������������}z��;�����������~z<�!{����=�����������������>�������"{������?���������#{����������������������������@�${��������%{������&{��������A���B�������C���E�������������������������������������������������������������������F�����������������������������({��G���������H���I�J�������������K�L���M�����){����������O���������������������*{����+{����P���Q�������R���������S�������,{����������������������������������V�������������-{��������������W�����������������.{��������/{����������0{������X���1{��2{����������������������Z�[�������\�����������������U���������������������^�����_���������`�a�b�����������������c�����d�e�����������������������������f�����5{��������6{g�h�����������i�������7{����4{��j�������������������o���������������������������������k���p���q�����������8{��������r�����s�t���9{��������������������l���������������������<{v���w���x���y���������z�����������={����>{������{�������������������|���}�����?{��������������������;{����@{������������#���������$���������������������%�����&�A{����B{������������������'�(�����������)���*���������+�������������C{����������������,�����������������E{-�������F{G{��������������������H{.�D{����������J{����������/�����0�����1�����2���K{����������������������������L{4�����5�������7�h/����������������������������������9�����:�M{������N{������������P{������������������R{����;�����������S{��<�����=�������������������������>���?�������@�������A�������������T{������B�C���������������������D�����������������F���G���������U{����������������H���I���������������������������J�������K���L�����������������������M�����N���������������������������������������V{��W{X{P���Q�������Y{����R���S�����T�����������U�����������V���W���X���������������������������Y�����������������Z�������[���\�����]���������������������������^�������������_�����������������������`�a�����������������������Z{b�������������������c���������������������[{\{g���h���������������i�������������������������j�������������f���������]{^{��������������_{����������������m�����o�������������������������p���������������a{����������������r�������t���u�v�������w�x�b{y���������������q�z���{�����c{������d{|���������e{����}�f{��������������������g{����������������~�����������!�������"�������������������#���������������������������%���������������������������&�������������'���������(���������+�����������-���������������������������������������������������������������������������������h{��������������.�������������������i{����������������������������������/�0�1���2�������������������j{������k{����5�3�6���������������7�����������������������������������������8�9�������m{;���������������������������������������������p{q{r{��n{��������������������s{����������������t{��u{��������=���v{������������w{��?�����@�������A�������������������������������������������������D�����������������������������������������������������������E�����������������F�������������G�������x{��������������������H���������������������������������I�������������J���������������������������������������������������������z{��K���L�������������������������{{����������M�����������O���P�����|{������������Q���R�T�}{��U�~{����������������������W�!|������������������������������������X���"|������������Y�������������Z���#|����������[�$|������������������\���������%|������&|��������������������������������������'|������(|��������������������������������������������^���������������������������������������������)|������������]�����������������_�������������`�����������������������������������*|������������a���������������+|����������������������������������������,|��-|����������b�e���������d�����f�����������������������������g�����h���������������������������i�������������������������������������������j�����1|��������������������l�����2|��������3|��������m���������������������4|������������������������n�����������������o���p�������������������q�����������������r�s�������������t�5|u�v�������x���������������{���|���6|����������}���������~�����!���������������������������������7|"�������#�����������$�������������������������������������������������������������'�&�����������(���*�����������������+�������������������������������������������������������������������������������������������������-�,�����.���������������9|����������������������������0�1�����:|������;|����������<|3���������4�������>|����������������?|����������������������������������������������������������������������������������������������������������������������������������������������������������������5�����������������������������������������������6���������������������������������7���������������������������������8�����������������@|��������������������������������������������:���;�����������A|����B|����������C|��<�������������������������������������=���������������������������������@�A�����������>���������������C���D�������������������D|E�F�E|������G�����������������������������J�����K�������F|��������������������������L�����������������M���������������������������N�������������������O�P���Q�G|��������������������H|��������������������������������������������������������R�����������S�������������������������������T���������U���V�W���������X���������J|��������������������������������Z�����[�������������������������������������������������������������������������]�L|_���������������`�����������������������������a�������������M|������������������������b���N|����������������O|������������������c�������������������d�������������������P|������e�������������������������������������������������������������������������������������������������������������������������������������������������������g���R|��������������������������h�S|j���������������������l���������m�������o�����p�����������q���r���������������������s�������T|������U|����������V|����t�������u�����������v�w�����������W|������x�����������������������������������������������������������������X|������������������y�����������������������{�|�������������������������������������������������}�������������������������������������������������������������������������������"�����Z|������#�������$���������[|��\|��]|��^|����������&�_|��������������������������(�����`|����)���������������a|��������*�b|c|��d|+�����������������������������e|��������-�f|g|.�����������������������3�������h|����1���i|��0���������������4�5�2�������6���7���������������������������k|l|m|��8�������9���:�������n|o|������p|��������������q|��r|����s|����;���<�=�����t|����������������>�?�u|����������������������������@���A���v|����������B�����C�������������������������������D���������E�������������������w|��F�����������������G�������������������������������x|������������������H�������y|��I�����z|��J�����K�����������{|������������L�M�������������������������������������||����N�������������������~|!}������������Q�"}R�����#}������������������}|S�����������$}����T�����������%}����������U�V�������������������������������������������������������X���������&}'}(}��)}������*}��Y�+}������Z�����[�������\�,}��]���������^�����_�������������`�a�������b���c�d�������������������������������-}������g�h���i�����������������.}j�������k�������������������l���m�����������n���������������o�������p�������������s�������������������������t�u���/}������v���������0}1}��w���x�����2}������y���z�������������3}��������{���|�������������������������������"���#���$�������4}%���5}����������������&�������}�������'���������������(�)�6}��7}������8}��*���+�����������������������������������������������������������.�9}:};}������������/�����������0�����1�������������������<}=}��������>}2���������?}3���4�����������������������������������������8�����9�������:�����������������������@}����;�����5���A}��������������������������������������������B}������������@���������C}A�����������������������������������������B���D}E}����C���������D�������������������?�������<�����������I���G}F}��������E�����������F�������������G�H�����������������������������������������������������J�H}K�������������L�������������������M���������I}������������������������������������������������J}��������������K}��P���Q���L}M}R�S�������������������������T�����������U�V�N}��������������������������������O}������������P}����Q}��X�R}��������������Y���S}������������T}��������������������[�����U}��������V}����W}������������Y}������Z}%�����������������������������^�������������_�`���������������b���������c���������������������������������������������[}����������������d�����������������������������������������������������������������f���\}������������������������������������������h�����^}������������_}`}������k�����������l�������m�������������n�����o�����������������������������������������a}����������r���s�����t�b}��������������������d}����������e}v�����������������������������w�������������������������������f}����y���������g}����������z�����������{�����������h}i}j}����������|���}�����k}~�����������������������������!�������l}��������m}������������������������������������������������������������������n}$�������%�������&�������'�����������������������o}����(�)���������������p}������*�����q}��������������r}����+���������,�����-�������.�/���t}����s}����0�������������������������������1�����u}2�����������w}����3�4�����������5���6���������������x}��������9���<�����������y}��������z}��:�;���������������������������������������=���������������������|}}}����~}!~��"~#~��������������������%~>�����������&~����������������������������������������������������������������������������������������������������������������������������?���@�����A�������������C�D���'~E�F�����G�����H���������I�(~����J�����������������������������������������K�M���N���O���)~����P�����������Q�R���S�T���������������������������W�X�����Z�[�\�����������������������������������������^�_�`�������������a�b�c�������d�e���������f�������������g�h�������������������*~������i�����j�k���������������������������������������������������������������������������������������������������������������������������+~��������l�����m�������������������������������������n�������o���p�������q�����������r���������������������s���������t���������u�����������������������������������w�����������������x�����y�,~-~������������z�������������{���������|�������}�����������~�������.~����������������/~0~����!���������"���1~����������������������#�����������2~��$���3~������4~����������%�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������'�������������5~)���+���������������6~��7~����-���������������8~��.���/�����0�9~����������2�������3���������4�������5�������������������������������:~;~6���������<~������7�������8���9�������:�����������;�������=~��������������������<���?~����������=�������������������>���������������������������@�������������������������������������@~��������A���B�B~��������C�D�����������C~E���D~F�G���A~��������������������E~����������F~��������G~����������������������������H~��������������H�I~��������I���������J�M�����������N�����������O�����J~����������P�������������K~������������������R���������S���������������L~��T�����U�V�����X�W�������Q�������\�M~��Z�����N~O~������������������������������������������^���_�`�a�����b���������c�P~������d���e�f�������������h���������i�j�������������������Q~������k�������n�o���������R~S~����T~q�������r�����s�l�t���u�������U~��V~������v�w�x���y�z���{���|�����}���W~����~�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������!�����������������������"�$�����������������#�����������&�����������'�(���������X~Y~��������������������������������������,�������������������������������.�Z~������[~����/���������������\~������������������������0�����1�]~����������3���4���������^~����6�����7�8���������_~��9�����������:�����������`~����;�����������������a~����<���������������=���������������������c~����������������?�������@�����d~A���>�b~����B�������C���D�������������������������E�e~����F���������G�H�����I�������g~������������������������J�M���������h~����L�����N���������������i~������O�����P�Q�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������R�j~������T���������U�������������������������������������������V�����k~����������l~������W�������m~����n~��������o~p~��������������Y�����������q~��������������������������r~��������������������������[���������������\�������������]���������������������������������^�_�a�������������������������s~������������b���c�������������������������������������������d���������������e���t~f�����g�������h�������i�j�������������������������k���l���u~m���������o�����������������������q�������s�����t���������u�����������������������������������������������������v~������w~����x~��������������������y~;v��������������������.tNu������������������������O{������������������������������������������������������������������������������������������������������������������Iv����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������$~����������������������]}K/W/rO��y�zuZwow����<y=yAy������:{8�E�.|��n���j|������������������8.I.P.c.h.n.,///6/Z/^/aObOPt\t^tat(u+uCueuivwv%wUw)�%x'y3y4y7y8y9y;y?y@yMyQydy.zP�3z:zDzXzt�u�'{o{y{/|0|8|=|i�Y|c}v}{}>#=#0"��������/"����������1"=��������������������������������������������������������n�������������������������������������������������������������������������������������������������������4�1���������������������������������������������������������������������������������������������������������������5?7����������������c7�������������������������������������������������������������������������������������������<�G�TU����������������������������������������������������������qW�������������������������Y���������������������������������������������������]�j@n�������������������������������������������p���������������������������������������������������������������������vw���������������̓����������������������������������������������������������������������������������������������������������������������������������������������������������+���������������q�����J��	�������������������(����������O��������������:�������������������������������|	�	�����������
��������������������������������������������������������E
�
�������������m��������������d����_����������������������������������������������������������U��{��������t�����������������������������6D�������������������������m���������������������������������)l����G��������������������������B�������������������������������������������������������������������������������V������������-E��xb�������������������������3��������������������������������������������������v�����������{!����������������#���������#���������������������������������������������������������������&����������������������������������������[(���������������(���������)�*��������O+P+��������������F+��,�+������$,���������������������������������������������������������-�����������������������������������������������������������������������������1�1�1������������������������������������������r3���3�3���������3�3�3�����3���3����������������������J4Q4K4������e4�������������������������������������������������������4Z5�5����������������������������������������96G6��86:6��������������������7��������������������7��������������d7���������������7�7����������$8��������=8�:��������������������������������<����������������������������������������=������������������������������������@=���=�=�=~?�����������������������������������������@����������A���������������������������������������A�����A�C��������������������������������)F�����������F���������������������������������������������������H������������������������������������������������������������������������������MJVK��oK��������L����������������������������M������������������������������������������������N������7N��������jN�����N����������������������JP��UP����"Q�Q���Q�Q������R������LR��������������������������������.T���������������������T�������������������������������������U���������������������������������������������������W�W�Y���������������������Z�Z���Z�����������������������������������[��������������������K\d\����������������������������������������.^V^e^��b^�������^���^�^��#_����\_�������������_�_��������`�_��������������`��������``�������������������������`��������������������������������������������������pb���b������������Lc����=������d~f���������f����������������������g�������������������������������h���h��Qi����oi���i������j������������Xj�����������j�����jsl�������������������l����������������������������en�����������������������������������������������o�����������������o�o�o��������������������������������
q����9q�������������������������������������������������������������������������������������������s�s�����������s����t��������Itvv��1v���������������v��������������w��#w������Rw���������������������������������������y�������������������������z���������������������������������������{���{�{�|�������������������}����~�����������������������������������������������������������������������������������������������������������U�����������������������������k�������ȅɅ��������������������׆��������������������������������������������������������������������I�F�������������k������������������������������������������������������������������������������)���������������������q�C�������������������͊�����������݊���������������������������������������������������q������������6�������������2���������������������������������������������������������������������������������ϕ�����������������������������������������������P�������������������������������������������������Ƙr�������������������������������������������������������������۝=��������������������������������I�������������������Ğ��������������۞Ο������/����������������������������������������������������������������������������������"������������7����������������������������������������������������".����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������!�������������������������������������������������+���.�6�F�p�������������������������������������������������������������������������������������������������������������������������������������������y�������������������������������w�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������"�%�'�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������1�2�8�?�����������������������������������������������������������������������������������������������������A�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������J�R�����������������������������������������������������������������S�Y�\�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������TOw�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������*�:�����������������2�������������������������������������������������������������������������������1�=�Y�����������������������������������������������������������������������������������������������������������������������B/����������������������������������������������\�������������������������������������������������������������c�������������^���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������k�������������������������j�������������������������������������������������r�L/����������������������������������������������������t���������������������������u���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������%�2�`/>�G�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������cOU�����������������������������������������������������������������������������������������������������������������������V�{/~�0�7�����������������������������������������������8���������������������������������������������������������;�������������������������������������������:���������������������������������������������������E�������������������@���������?�������������������������������������������H���������������������������������������������������������������������������������J�K�nO[�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������f�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������l�"�S�+���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������0�P�e���������������������������������������������������������������������������������������������������������������������������������������������������������������m�r�$�2�����������������)�*���������������������������������������������������������������������������������������������������������������������������������������������������������������������������5�4�������������9�V�$�������������������������}�:u������������������������������������������������������������������������������������������������#�:�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������B���=�<���D���������G���������I���������C�U�W�����������V���������������������������������������[�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������w�x�������������������������������������������������������������������������������������������������������������������*�����������������������������������������������������������������������������������������������ruB�?�C�������������������������@�Y�������������������������������N���������������������������������������������������������������������)v����������������������������������������������������������������������2va���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������j�����������������������������������������������i�p�������������������������������������������������u�#�4�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������`vI�������������������������u������������������������������������������������������������������������������������������������\���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������`�������������������������������������������������������������������������_�^�2�G�M���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������a�������������������������������������������������������������������������������������������������������������d�"�3����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������9�lwS�{�.����������������������������������������������0�5�D�]������������������������������������������������������������������������������a��������������������������������������������������������������������������������������������������f��������������������������������������������������������������i�u������������������w�z��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������!��������������������������������������������������������������������$��������������������������������������������#�(����������������������������������������������������������������������������������������,�=��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������~x����������������������������������������������������������������������������������������������������������������������������������������������������H�)y����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������[�Gy��������������������������������������������������������������������������������������������������������������u������������������v�Ty������������������������������2�>�=����������������������@�R�]����������������������������������������������^�nys����������������������������������������������������������������������������t��������������������w��u��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������}����������������������������������������{����������������������������"�$��������������������������������������������������������������������������������������������������������������'��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������/��������������������.��������������������������������������������������5�4������������������=����������������������������������������������������������������������������������������������������������������������������������������������B��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������O�i����������������������������������������k�r�y�5���������������������������������������������������������������������������������������������������:�F�V�������������������������X�Z�����������������������������������������������������������]���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������_�c�������������������������������������������������������������������������������������������������������������������j�������������������������������������������������������������������������������������������������������p�������������������������������������������������������������������������������������s�����������������������������������������������������������������������������������������������������������������������������������������������]zD���������������������������������������������������������������������������������������������������������������������������������������������������D�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������N�3{������������������������������������������������������������������������]�u���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������!�"�~�I{3���������������������������������������������������������������������������������������6�e�d���������������������������������������������������������������������k�n�����������������������������������������������������������������������������������������������������������������s�*�)�������������������������������������������������������,���������������������������������������������������������������������������������������������������������������������������������������������������������������������l{����������������������������4�<�����������������������������������������>���������������������������������������������������������������������������������������������B�V�c�w���������������������y�����������������z�%�/�2�9�B�������������������������������������������������������������������������������������������������H�I|��������������������Y���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������^�Q|f�������������������������������������������������������������������������������������������������������������������������������������������������k�z�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������~�!�,���������������������������������������������������������������������/�P�����O�������������������������������������������������������������������W�������������������������������������������������������e�f���������������������������������������������������������������������������������������������������q�r�~���������������������!���������������������������������������������������-�������������������������������������������������������������������������������������������,�������������������������������������������������������������������������������6�������������������������������������������������������������������������������������������������������7�������������������������������>�������������=�N�������������������������������������������������������������������������������������������O�W�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Z�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������\�]���������������������������������������������a���������������������������������������������������������������������������������������������������������������������������������������������������������������������e���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������g�i�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������q�"���������������������������������#�8�B�L���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������V�Y�������������������������������������������������������������������������������������������������������������]�v�,�K�Y�������������������������������������������������������������������������������L�����������������������]���������������������������������������������������������������������������������������������������������������������������������[�������������������������������������������������������������������������������������������������������������������g���������������������������������������������p���������������������������m�%�+�����������������������������������������)���������������������������������������������������������������������������������������������������������������������������������������������������������������������5���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������2�f~X�Z�n�p�����������������������������������������������r���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������v��0K0�0M0�0O0�0Q0�0S0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�1�������TT��YYZZ�����������������������������������������������\)�D+T8+TH+TI+Y0+YL+YM+ZC+ZN+ZO+�7+�J+�K+�`+��f+�d+��e+K0+$�0K0w$M0-$�0M0x$O0/$�0O0y$Q01$�0Q0z$S03$�0S0{$�0+%�0�0w%�0-%�0�0x%�0/%�0�0y%�01%�0�0z%�03%�0�0{%�0;%�0�0|%�0D%�0�0}%�0H%�0�0~%�1u&�0�1x&;��
������ ����P��e��t��������������h��,/��p�������� ��h�%��8�'���`)�� +���0.��P1���05��09���p>��@@���@A��D��|zRx�$�	��FJw�?:*3$"D�
���D\p$���F�K�B �B(�A0�H8��
0A(B BBBD zRx�8������(4��p,��%���F�A�A ��
ABJzRx� ���$@
��4@<'���F�B�A �D(��
 ABBHzRx�(����$���dL��(��	F�E�E �A(�H0��
(A BBBKU
(F BBBA zRx�0�����(���Ld4+��F�E�E �B(�A0�H8�G@
8A0A(B BBBO$
8C0A(B BBBA zRx�@������(q���H��-���F�B�B �B(�A0�A8�D@�
8D0A(B BBBD����Q|41���O�I�E �I(�D0�D8�GP�
8A0A(B BBBA,
8F0A(B BBBA�������CP������ zRx�P������(W��U`�`4��=F�E�E �B(�H0�A8�GP
8A0A(B BBBA{
8C0A(B BBBA�4���,d(9���F�A�A �
ABA����Q����[H�`:��;F�B�B �B(�A0�A8�D`�
8A0A(B BBBH zRx�`������(���H@;���F�V�B �E(�A0�A8�D`�
8A0A(B BBBP�l���@�|=���F�N�B �A(�A0�G��
0A(A BBBAGNU� ���Y#ň@�#Έ@�#׈@�#�@�#�@m#�@�#
�@�#�@]#+�@�#8��A@}#F�@
$@�#Ĉl��lPnv��h�t|��j`q��0�`x@�p�`|O��p�`|\��0�`xĈ�!y��"w^�*u��%~��0l$�"r��$}z�#x&�*u��#`:�2d��"{T�.z��!v��2}2�"y�5s`�D~�!s|�)z �%~�!~��!q2�"v�,pf�%v"~�!~v!~2!}�!~�!~d!~ !~�!~�!~T!~	!~�	!~�
"~B!~�!~�!~v
!}0#~�!~�!}^"}"~�!~�!~H!u�@w{�@w~AxxADf@�""B�B{��Tn��:r^�)`��ll��~~��)n^�]]`�3l��IQ��ff��/}^�!~�+v��+H��9~z�B~��A|l�!~(�!~��!~��!~\�!~�!~�!~��U~�'~��!~P�!~�!~�!}��!~>�!~��!~��!~r�!~.!~`�_�8�@��@�l�@��@�`�@�ڣ@K�/q��a|��B~8�!P��!wF�!w��!~��!~l�!~(�!~��!~��!~\�!~�!~��!~��!~L�!~�!~��!~��!~<�!~��!~��!~p�!~,�!~��!~��!~`�!~�!~��!~��!~P�!~�!~��!~��!~@�!~��!~��!~t�!~0�!~��!~��!~d�!~ �!~��!~��!~T�!~�!~��!~��!~D�!~�!~��!~x�!~4�!~��!~��!~h�!~$�!~��!~��!~X�!~�!~��!~��!~H�!~�!~��!c��!~\�!~�0z��!sT�!v�!Xp�!q�!@R�!~�!~ʏ!~��!~B�!~��!~��!~v�!~2�!~�!~��!~f�!~"�!~ޗ!~��!~V�!~�!~Κ!~��!~F�!~�!~��!~z�!~6�!~�!~��!~j�!~&�!~�!~��!~Z�!~�!S|�!~8�!~�!~��!~l�!~(�!~�!~��!~\�!~�!~Ԭ!~��!~L�!~�!~į!~��!~<�!~��!~��!~p�!~,�!~�!~��!~`�!~�!~ط!~��!~P�!~�!~Ⱥ!~��!~@�!~��!~��!~t�!~0�!~�!& ��T���V�X�+���JJ��	��((�OO���|�B��D�JE��d��__����8mn<��>G�	B�	���	���	VV�	-�34��{{����
���
[��������F�N$^��`���r��J��Z��8G���$=����~~��
���)������MMVo8:<�8JUP"��L6.���� q�J!��l!���!���!Kd�!���!.�8##��$��&p��&LL�&�&~�F'H'��d'Q�~(�B*)��+@e�+���,���,
9-�h-I�-��.Rf/��h/��j/���/���/���/�/���/��0w��0���0U�1k�N2��2F��3�5��n5�F7��82�n:���:���:���:�z;P�;���;rr�;���;��=���=�\?��^?��`?77b?��d?�~��P�4��>?�ps������^��#��!��"n�"�#4�^%�2'�R'1��(�|*�0,��-�r/a��0��2oT3n�N4�6��7�$9�D:W�F;9��;��=��?�fA�C��D�F��G�,I���I�4K;��L�Nw�N��P��R��T��V��X�xZ�T\�(^�
`
��a��c��e��g��i�tk�<m�8o�2q
�
s��t��v��x	��z�r|�j~�b��Z��R��0��������ҍ
�������������j��h��Z��T�
�8��,�������Ҧ�������Ы;�P��D�
�*�� �����������Լ������������9�T�	�>��(�� ��������
�r��x����\����������������������������Z�j�EF�
`�\������������X�_�;n����^�`��@�o����������	��
�������������������� ��"��$��&��(��*��,��.��0��2��4��6��8��:��<��>�|@�xB�rD�pF�lH�lJ�fL�dN�^P�ZR�TT�TV�NX�LZ�D\��]6�_�a�c�e�
g�i�k�m�o�q�s�u�@v7��w��y��{��}���ʁ�ʃ�ƅ�Άw����n��n��j��f��d��d��X��R��N������yȤ�&�`sN�T�1�D��ڨ(�������2�J�x����²��������Y���������V�H����'�L�!�Ȼ]�����,���.�`��NN����l��
�h��0�j���l�?������'�������������$�$������o����"�FF$�!z��0�����������H��R�x�G�.���H�D�S����������S����v������g����~��r��`�1H����������3U��We�'��N�*�r�����kp���>�)���-���UfvN
��Y#�Y#���o`��
�@$h�Lh0E	���o���o(���o�o����o�@$0N@NPN`NpN�N�N�N�N�N�N�N�NOOk���Ĉt� $GA$3a1N)�_codecs_jp.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug4���7zXZ�ִF!t/��;]?�E�h=��ڊ�2N��gZ��K�h�'�I�J@��
�fHƧ���t�Qʫ"��J�*�򶍆f��>����;�JӼ�ubob���`�n[OR�sX��"��/k�K�v:�Ќr���lǓ��!-ݝb~w�V���5B��?�O�~�
G+��x��\��9�}��P$$+7m�O�6O$ȼMW8� �	�Ցo,�Y�2�:y9}�I�8��>Qpp���q����Ȋ��buq���?"�޴I0��gK�s>^�.�>��/ݭ�Gd#5�	�M�>�d���8:?3f�q�*ϸ_рx��<o���}��:%��Ӫ�Y�9Eº��3�2L��2\�8=7,��%���@��d���D�y��߁�Y�8}�๵p+ �1V�bd�H(-T��Q�����\��ҟp+��0"!���7n�ղ/%[��R�|;D�4��'R&,H���a�팴ER�W��'r��ma��s��%'=	���r��:��=���G��]��F:�>e"[��--c��~��-��������;te&���3�+{��~G|��w���};5�9DvxTݧ&�����'�=@�x���7P��9��6q����ѝ�����%��
;�>�6���(�@iԬ�ga��庒D�5P�.�<\OL��K�40���f��
�0r(�!C"V�l%���MO�?H��j4^5��[ l*�Xx�۫��1� G7�K_�$,I�0�B�rˆ@9(�wD�',��32P	�����R�7����Z��M����KV��s��k��5��ą3a*=�6„��i����$��?w�r��'��;w�G�O�fr�v�X�,���pA�K��δ+Vw��
��]�E��\���1�NU�G�l !z�N`�='єCT�iM�����_f�u�sգb�P}�A�:+�m,�DP|N�p*~�l���.q���/�NC?{5���ۂ�2<��$�6�VJ�0�OZ#�x�4ڍ���M!�P����*Yⵏ��T"����s���f�
��7VГ�[��QI�Pʕ~��$�~��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(��X0���8���o��2E���o((@Thh0E^B�L�LhhNNc N Nn O O�wPP8}��
�@�@�� �0C0C��DD���I�I ��Y#�Y��Y#�Y��Y#�Y�� �@$@�@$@�� $ � �� $� �� d� $
� d0!|�%(lib-dynload/_tkinter.cpython-38-x86_64-linux-gnu.so000075500000173600151153537500015736 0ustar00ELF>�R@@�@8	@8�8�  � �  � P� 8�8� 8� 00888$$���  S�td���  P�td�����Q�tdR�td � �  � ��GNU�Hf�䍖>��9��(���Y��B ���w��\⸧��|CE���)���qX��(���2���	4
;$
��&�SU�B ��Me
f��H�����[�V�2		W
`�&�
����;F
� �}#���e
)���, .~NF"�w�n|	A�j���3�rk'	��
{�	'��Pq�"��
��
�u2Q��&����	�|
GB�E��
Yb@	�6C��|7�	�G6ke�Zml	��s��	�7�x�	W	I!	��o�
�����^��� �p� �
�Q�p� __gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libtk8.6.solibtcl8.6.solibX11.so.6libpthread.so.0libc.so.6_Py_NoneStruct_PyErr_BadInternalCall_Py_NotImplementedStructTcl_GetStringstrcmp_Py_TrueStruct_Py_FalseStructPy_FatalErrorPyUnicode_FromFormatPyLong_FromVoidPtrPyFloat_TypePyExc_TypeErrorPyErr_SetStringPyType_IsSubtype_PyLong_AsIntPyErr_OccurredPyExc_ValueErrorPyLong_FromLongselect__stack_chk_failPyEval_SaveThreadPyEval_RestoreThreadPyExc_RuntimeError_PyArg_CheckPositionalPyThreadState_GetTcl_GetCurrentThreadTk_GetNumMainWindowsPyThread_acquire_lockTcl_GetThreadDataTcl_DoOneEventPyThread_release_lockPyErr_CheckSignalsPyErr_RestoreTcl_CreateObjCommandTcl_DeleteCommandTcl_MutexLockTcl_ConditionNotifyTcl_MutexUnlock_Py_DeallocPyMem_Free_PyArg_ParseTuple_SizeTPyBool_FromLongPyExc_OverflowErrorPyUnicode_AsUTF8AndSizePyErr_Format_PyArg_BadArgumentTcl_AddErrorInfostdinfilenoTcl_CreateFileHandlerTcl_DeleteFileHandlerPyErr_Print_PyTuple_ResizePySequence_SizePyTuple_NewPyObject_FreeTcl_DeleteInterpPyOS_InputHookPyErr_FetchTcl_DeleteTimerHandler_PyObject_CallFunction_SizeTPyObject_AsFileDescriptorPyErr_NormalizeExceptionTcl_NewByteArrayObjPyBool_TypePyObject_IsTrueTcl_NewIntObjPyLong_TypePyLong_AsLongAndOverflowTcl_NewLongObj_PyLong_AsByteArrayTcl_NewWideIntObjPyErr_Clear_PyLong_FormatPyUnicode_AsUTF8TclBN_mp_initTclBN_mp_read_radixTclBN_mp_clearPyErr_NoMemoryTcl_NewBignumObjTcl_NewDoubleObjTcl_NewListObjPyMem_MallocTcl_NewStringObj_PyUnicode_Ready_PyUnicode_AsUTF8StringPyObject_StrTclFreeObjPyUnicode_DecodeUTF8PyExc_UnicodeDecodeErrorPyErr_ExceptionMatchesmemchrPyUnicode_FindCharPyUnicode_AsUCS4CopyPyUnicode_FromKindAndDataTcl_SplitListPyUnicode_FromStringTcl_FreeTcl_GetStringFromObjPyObject_CallTcl_SetObjResultTcl_GetObjResultPyErr_SetObjectTcl_EvalTcl_GetStringResultTk_InitTcl_ExprBooleanTcl_ExprDoublePyFloat_FromDoubleTcl_ExprLongTcl_ExprStringTcl_GetBooleanFromObj_PyArg_Parse_SizeTTcl_GetBooleanPyNumber_CheckPyNumber_FloatTcl_GetDoubleFromObjTcl_GetDoubleTcl_UnsetVar2Tcl_SetVar2ExTcl_RecordAndEvalTcl_EvalFileTcl_GetBignumFromObjTclBN_mp_unsigned_bin_sizeTclBN_mp_to_unsigned_bin_n_PyLong_FromByteArrayPyNumber_NegativePyCallable_Check_PyObject_NewTcl_CreateTimerHandlerTcl_ThreadQueueEventTcl_ThreadAlertTcl_ConditionWaitTcl_AttemptAllocTcl_ConditionFinalizeTcl_GetByteArrayFromObjPyBytes_FromStringAndSizeTcl_GetLongFromObjTcl_GetWideIntFromObjPyLong_FromLongLongTcl_ResetResultTcl_ListObjLengthTcl_ListObjIndexTcl_GetVar2ExTcl_ListObjGetElementsPySequence_Tuple_PyObject_MakeTpCall_Py_CheckFunctionResultTkapp_CallDeallocArgsTcl_EvalObjvPyInit__tkinterPyThread_allocate_lockPyModule_Create2PyErr_NewExceptionPyModule_AddObjectPyModule_AddIntConstantPyModule_AddStringConstantPyType_FromSpecPy_GetProgramNamePyUnicode_FromWideCharPyUnicode_EncodeFSDefaultTcl_FindExecutableTcl_AppInitTcl_InitTcl_GetVar2Tk_MainWindowTcl_CreateInterpPyThread_free_lockTcl_GetObjTypeTcl_SetVar2strcpy_Py_ctype_table_Py_ctype_tolowerstrcatPyObject_GenericGetAttr_edata__bss_start_endGLIBC_2.4GLIBC_2.2.5�ii
�ui	� � ��(� P�0� 0�  � �(� �l8� P�H� |�P� �q`� ��� ��� �b�� ���� �a�� �S� ��  � *�(� �R8� ��@� >�H� �Z`� 7�h� k��� S��� Ks�� ���� ƻ�� ��� `��� ���� K��� 0��� ���� �\�� �� ��� �� � <�(� ��@� ��H� ~�`� I�h� c��� ���� H��� V��� -��� ѻ�� ֆ�� е�� ���� S}�� ��� ��� �{� �� � x�(� ?z8� p�@� o�H� �xX� P�`� d�h� �vx� 0��� X��� u�� ��� ���� ���� ��� ���� ��� д�� 6��� ���� ��� �� n�� `� � ��(� �8�  �@� e�H� dX� �`� ػh� �x� ���� '��� �U�� `��� 0��� |X��  ��� w��� �R�� ��� |��� T�� в� ��� #r� ��H� �aX�  � �� Ϻ�� �`�� ���� w��� ^��� ���� ���� 
T�� ���� ���� �T�� � � ��8� � @� ǾX� �� `� ݾx� @� �� ��� �� � Wj� Aq(� �qH� �RX�  � `� h� 	p� x� '�� (�� )�� <�� I�� L�� N�� P�� V�� Y�� `�� m�� r�� s�� ��� ��� �8� ]�� �� �� �� �� �� �� �� 
�� �� �� 
�� �� �� �� �� � � � �  � (� 0� 8� @� H� P� X� `�  h� !p� "x� #�� $�� %�� &�� *�� +�� ,�� -�� .�� /�� 0�� 1�� 2�� 3�� 4�� 5�� 6� 7� 8� 9� : � ;(� =0� >8� ?@� @H� AP� BX� C`� Dh� Ep� Fx� G�� H�� J�� K�� M�� N�� O�� Q�� R�� S�� T�� U�� W�� X�� Z�� [�� \� ^� _� a� b � c(� d0� e8� f@� gH� hP� iX� j`� kh� lp� nx� o�� p�� q�� t�� u�� v�� w�� x�� y�� z�� {�� |�� }�� ~�� �� ��� �� �� �� �� � � �(� �0� �8� �@� �H� �P� �X� �`� �h� �p� �x� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� �� �� �� �� � � �(� �0� �8� �@� �H� �P� �X� ���H��H�y� H��t��H����5Z� �%[� ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&�������h'��q������h(��a������h)��Q������h*��A������h+��1������h,��!������h-��������h.��������h/������h0�������h1��������h2�������h3�������h4�������h5�������h6�������h7��q������h8��a������h9��Q������h:��A������h;��1������h<��!������h=��������h>��������h?������h@�������hA��������hB�������hC�������hD�������hE�������hF�������hG��q������hH��a������hI��Q������hJ��A������hK��1������hL��!������hM��������hN��������hO������hP�������hQ��������hR�������hS�������hT�������hU�������hV�������hW��q������hX��a������hY��Q������hZ��A������h[��1������h\��!������h]��������h^��������h_������h`�������ha��������hb�������hc�������hd�������he�������hf�������hg��q������hh��a������hi��Q������hj��A������hk��1������hl��!������hm��������hn��������ho������hp�������hq��������hr�������hs�������ht�������hu�������hv�������hw��q������hx��a������hy��Q������hz��A������h{��1������h|��!������h}��������h~��������h������h��������h���������h��������h��������h��������h��������h��������h���q������h���a������h���Q������h���A������h���1������h���!������h���������h���������h�������h��������h���������h��������h��������h��������h��������h��������h���q������h���a������h���Q������h���A������h���1�������%�� D���%�� D���%�� D���%}� D���%u� D���%m� D���%e� D���%]� D���%U� D���%M� D���%E� D���%=� D���%5� D���%-� D���%%� D���%� D���%� D���%
� D���%� D���%�� D���%�� D���%� D���%� D���%ݐ D���%Ր D���%͐ D���%Ő D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%}� D���%u� D���%m� D���%e� D���%]� D���%U� D���%M� D���%E� D���%=� D���%5� D���%-� D���%%� D���%� D���%� D���%
� D���%� D���%�� D���%�� D���%� D���%� D���%ݏ D���%Տ D���%͏ D���%ŏ D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%}� D���%u� D���%m� D���%e� D���%]� D���%U� D���%M� D���%E� D���%=� D���%5� D���%-� D���%%� D���%� D���%� D���%
� D���%� D���%�� D���%�� D���%� D���%� D���%ݎ D���%Վ D���%͎ D���%Ŏ D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%}� D���%u� D���%m� D���%e� D���%]� D���%U� D���%M� D���%E� D���%=� D���%5� D���%-� D���%%� D���%� D���%� D���%
� D���%� D���%�� D���%�� D���%� D���%� D���%ݍ D���%Ս D���%͍ D���%ō D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%}� D���%u� D���%m� D���%e� D���%]� D���%U� D���%M� D���%E� D���%=� D���%5� D���%-� D���%%� D���%� D���%� D���%
� D���%� D���%�� D���%�� D���%� D���%� D���%݌ D���%Ռ D���%͌ D���%Ō D���%�� D��H�-� �?� H����H�� �G(H������ ���AUATUSQH��tH��u��H�=�]���1��H��H�˔ H9GuH;FtH�P� H��H9���A��tpH�~���H�{I�����L��H�������wPH�
Z^Jc�H�>��u*���u�"��y���������xH�'� H��.H�� H��"��vH�="]���H�5^Jc<�H�>��Z[]A\A]���H�H�$jH��eH��HE�H�=�e1������H��c�����SH��H�~H�5�� H9�uH�
T� H�5�\H�9���1��T������u�H���P������u*���2���1�H��u.H��� H�5�eH�8���1����x�H�N� �p� H�H��[���S�]� ���t	Hc�[�O�������H��t���1�[���H��8dH�4%(H�t$(1����1�i��H�1�H�D$�~D$Lc�1�L�D$L�D$D$)D$�
���H�D$(dH3%(t���H��8�AUATUH��S�
H��(dH�%(H�D$1�I��}t��L�I���(�i1�1�I��1�1�M��)$��L��������uċm��u�H�)� H�5z[H�8���H�T$dH3%(��t����H��([]A\A]���AWAVAUATI��UH��SH��QH��wH��!�y1ҹH��H�=!d�����u��dI�$H�5�� H�xH9�uH�Q� H�5�ZH�:��1��+������u�I�<$�I���A�ă��u�,���H��t�
E1��J����{I��t+L�k ���I9�tH�=4� H�5�ZH�?���1����C(H�-� �2� �	E�������A9����
� 
� ���{������I�����H�=͐ I��H��t
��s����H�����1�L�(��H��A�����H�=�� H�H��t�d���L������������S����C(1����=B� �C(�]� ��H�� H�5
� �� H�=� ����1�H�� H�ߏ H�̏ �����H�=� I��H��t
�����H����L�0���H��A�����H�=�� H�H��t�w�E���
����=�� �f������H�o� H���Z[]A\A]A^A_���ATUH��SH��H��wH��!�v1ҹH��H�=�a�����u���H�EH�5߆ H�xH9�uH��� H�5 XH�:�P�����6�����u�H�}����Ã��u��H��t�1���I����H�=�� H��H��t
��[����H�=�� ����L� ��H�=y� �����H�=n� H�H��t�E�H�����Hc�[]A\�q���[1�]A\���USH��Q�{ H�wH�t(H�K0H�:L�L��H�S(H�����ȉ
�H�k(���EH�=�� �2�H�{8�Y�H�=�� ��Z�[]���U�SH��H�=�� R���H�=�� �H�(���H�=�� H�H��t�m�H����H�;H��t
H�u����H�{H��t
H�u��H���x��#�H�=D� H��H��t
�����H�=� �Y�H�X[]���SH��H��H�5k_H��dH�%(H�D$1�H�T$�D$�����:���1���t!�D$���uHc{�0��
�CH��� H�H�L$dH3%(t��H��[���SH��H��dH�%(H�D$1�H�GH�����shH�WH�����~L�e� H�5�^I�:���1��L�W H��1�L���H��H��H��H9���H��� H�5�^H�;�h���1����szH����I��1�M����H�4$H�����~L�� H�5p^I�;�"���1��wH��1�L���I��I��I��I9�tL�
6� H�5P^I�9���1��DL���:H;�� uH����H���H�
� H�P1�H�5�TH�9��1�H�L$dH3%(t�B�H��[���AUH��ATUSH��dH�%(H�D$1�H�F���u!H��]H�5�]1�H�=�]����-H��H��H����H��H���H��1�H���H��H��H��H;$tL�:� H�5T]1�I�:�����H�����vL�
�� H�5]1�I�9�����}t+L�e ��I9�tL�C� H�5�S1�I�8���� �I����H�=)� I��H��t
����H�=� �>�H�}H��L�(��H�=� ���H�=߉ H�H��t��L���>�H��� H���H�T$dH3%(H��t��H��[]A\A]���AUATUH�-}� SQH�=<� ���H�P� �~� �L� H�8��1ɾH�=�lj��U��'� I� ����H�=� I��H��t
����H���8�H�
�� �H���H��A����H�=Ո H�H��t��E��u�=� ���L���$�E���f���������=�� tJH�t� H�5e� �k� H�=L� �g�H�L� H�9� H�&� �Q���Z1�[]A\A]�AWAVAUATUSQ���uL�5� H�5�ZI�>�i�1��H�FI��H�����L�fH�wH��A��H�OL�H9�~H�H9�HL�H�w�]�����E1�A��M9���I�v���t
I�~J�,��K�l�L�EI���tD��H��H���9�����uR�uH;-f tGL�KL�SI�qL9�H�EH�CL�H�PH�SI�l��M�H��L9�IL�H�s����y��%I���^�����H��~ H�5ZH�:�P�1�Z[]A\A]A^A_���UH��H��SH��(dH�%(H�D$1����H�D$H��y1��Nu	1����CH����H�$H��t�H��1�H��H�D$H���H�����t�H�t$H���	���u�H�$H�L$dH3%(t�\�H��([]���UH��SQH�H�]H��t
H�u���H�����H�uZH��[]��X[]���AUATUH��SRH�_���I�����H�=� I��H��t
���H�=ą ��H�}L�(���H�=�� ����H�=�� H�H��t�z�L����H���*�H�uH���
�����uH�}} H����H9uH�X[]A\A]�SH�=� H�#� H�5� �� �����H�=� H��H��t
����H�=� �.�H��[���USH��QH�oH�H��t
�8�H�CH��t#H�CH�MuH���E�H�uH���8�H��| H�Z[]���ATU���SH��H�=q� ��H�=e� �L� ��H�=Y� H�H��t�0�L����H�SH�;1���H�5HW��H��u&H�� H�5�� ��� H�=݃ ���
H�uH�������H�=� H��H��t
����H�=�� ��H�[]A\���ATUS�H��t+H�o ���H9�tH��{ H�5�LH�:���1���H��L�%�� �����1�����I�$H��tB;ku7H�CH�;I�$H��t
H�u���H�{H��t
H�u��H���H��L�c���I�����H�=� H��H��t
����H�=ނ ����L� �/�H�=Ȃ ���H�=�� H�H��t��H����H��z H�[]A\���AU�ATUSH��H�=v� H��(dH�%(H�D$1���H�=V� �H�(��H�=J� H�H��t�!�H����L�c0�S H�sH�{�S(I�$H�C0H�8uTL�l$L�d$H��L��L��H����L��L��H���`�H�K8H�$H�s@H�H�|$H�>H�|$H��t
H�u�U�H�=n� ��H�{H� �H�=Y� �t��o�H�=�� H��H��t
��6��H�=j� ��H��H�L$dH3%(t�X�H��([]A\A]�AUATUH��SH��8H�dH�%(H�D$(1����t;H�uH�����~H�y H�5rS1�H�:�N��MH�} ��H���<H;=ax uH�����1���@����H���H;=�x �H�t$H�����|$uH����H����H�t$A��H������uH�|$��H����)�H��L�m�X�H��H���IH�����H��H��uH�M�/�iI��?L�d$E�UL��Mc�L�����H��L���2���t L�����H�MuH���h�����H�MuH���P�L��D�l$��L��H����H�����H�5Sw H9�u�E��H��������u�H�UH������L�mM��u1�1���H���I�����v-L�
3w �L�NRH�55RID�1�I�9�b��aJ�<�E1��m�H��H��u
���?H�u���t
H�}J�<��J�|��}���J��I��M9��H��D���#�H��H�����H���������} yH�uH��u$1�H�=�T���H����H������u��pH�����wQ�E �@tH�}0� uH�}H��H���H��H�5hQ��H��H��t0H�pH�����~'H�uH����H�
v H�5�PH�9�C�1��CH�x �V��'H;�} uH�]�)H���m�H��H��t�H���p���H�MH��uH���<�H�L$(dH3%(H��t��H��8[]A\A]���USH��QH�oH���P��ȉ��H�{H��t
H�u���H�����H�MuZH��[]���X[]�AU1�ATI��UH��SQ�c�H��H���H��t H�8���������L�����H�����I��H��taL��N�l%�F�H��I��H��u&����L�U�UI��M9�t"���tA�T$�L��L9�u���}�u�L�U1���M����I)�H��I��H��OL��H����H��M��tL�����H��tA�S �����7H�kA�1�H�߾��H����I��H���uH�uH����1��H�����H������H�I��uH����L��M��t�I9���G��J�4�A������E�T4A��`#����wyA�|4D���#��A��?wgA�|4��u\E�\4A��P#����wKA�\4���#����?w;A����?A����?A��A��I��A	�A	�A��
A���E	�E��H��I��E�D���D����L����L��H���5��ZH��[]A\A]���H�GH��H�P1�L�L���L��H��H�q����ATUSH�� dH�%(H�D$1�H��uH��r H���H��H�L$H�T$H��1�������t"H��1�H���H��H��H�q��G���H���Hc|$��uH�=�P����H���m��u'H�T$1�H��L�L���L��H��H�q����H���A��H��H��u	�0J�D���H�D$9l$~ Lc�J�<��"���H��u�H�uH����1�H�|$���H�T$dH3%(H��t���H�� []A\�AWAVAUATUH��SH��(dH�%(H�D$1�H�GH�������L�w1�E1�M9�}{N�l�L�����I��H��uH��t
H�uH�����1��H��u>I9�uI�Mu8L������.L��� �H��H��t�1�I9�tH�|�H�H�|�H����N�|�I���H�������s<L�oE1�L�����H��H��t�M9�}|H�MJ�<�����H���Y���J�D�I������s�:�H��H��u�@��s:H�_ 1�H�L$H�T$H�������uH�|$�D���|$~
H�����H���H�EH��H�t$dH34%(H��t�A��H��([]A\A]A^A_�H��dH�%(H�D$1�H�t$�d��Hct$H������H�T$dH3%(t����H�����AWI��AVI��H�=�w AUI���ATA��USAP����H�=�w �H�����H�=�w H�H��t�t��H��A��1����Ic��o�H��H��toA9�~,�EH��H�I�<��/���H��uH�uOH�������EH�D���I�~1�H���(��H�H��uH�����H��tH������H��uH�MuH�����Y[]A\A]A^A_��H��L������H�MuH���o�����H�=�v I��H��t
��q��H�=�v ����L� 1�Z[]A\A]A^A_���ATI��USH�_H��tH��H��K���H��H��t0H��I�D$H��H�=�IH�H1�H�1���H�H��uH������H��[]A\���H�GH��u	H����H����SH�H��t	H�CH��H�����H�CH��u�[�SH����H�����H��tH�=�u H��H���.��H�uH���Q��1�[���AUATUSH��Q�L�ot+H�o ����H9�tH�xm H�5�>H�8����1����U��I���=��H�=^u H��H��t
����H�=8u �s��H�{H�5�HL� �0��H��A�����A��uH��1������H�{�Z��H��H�=�t ��&��H�=�t H�H��t���1�A��t:H��tH�58IH���#����tL�������uH�����1��
H��l H�Z[]A\A]���AUH��ATUSH��dH�%(H�D$1�H�F���u!H�!GH�5G1�H�=�G�����JH��H��H������H��H���0H��1�H���H��H��H��H;$tL��k H�5�F1�I�:�J���H�����vL�
�k H�5tF1�I�9�$�����}t+L�e ����I9�tL��k H�5
=1�I�8������y��I���a��H�=�s I��H��t
��(���H�=\s ���H�}H��L�(�X��L��������u
H���K���H���H�}����H�����H��H�=s ��H��H�=	s H�H��t	������H�T$dH3%(H��t����H��[]A\A]���AUH��ATUSH��(dH�%(H�D$1�H�F���u!H�eEH�5bE1�H�=F�/���KH��H�t$H���*��H��H���/H��1�H���H��H��H��H;T$tL��i H�5�D1�I�:����H�����vL�
&j H�5�D1�I�9�e�����}t+L�e �1��I9�tL��i H�5N;1�I�8�4������I�����H�=�q I��H��t
��i���H�=�q ����H�}H��H�T$L�(���L��������u
H�����H���
Hc|$���H��H�=Uq ����H�=Lq H�H��t	�#����H�T$dH3%(H��t�'��H��([]A\A]���AUH��ATUSH��(dH�%(H�D$1�H�F���u!H��CH�5�C1�H�=[D�r���LH��H�t$H���m��H��H���0H��1�H���H��H��H��H;T$tL�h H�51C1�I�:�����H�����vL�
ih H�5�B1�I�9������}t+L�e �t��I9�tL� h H�5�91�I�8�w������I������H�=p I��H��t
�����H�=�o ���H�}H��H�T$L�(����L����=����u
H������H����D$���H��H�=�o �����H�=�o H�H��t	�e����H�T$dH3%(H��t�i��H��([]A\A]���AUH��ATUSH��(dH�%(H�D$1�H�F���u!H��AH�5�A1�H�=�B����KH��H�t$H�����H��H���/H��1�H���H��H��H��H;T$tL�Yf H�5sA1�I�:����H�����vL�
�f H�5:A1�I�9�������}t+L�e ���I9�tL�bf H�5�71�I�8�����?��I���'��H�=Hn I��H��t
������H�="n �]��H�}H��H�T$L�(�y��L��������u
H������H���
H�|$���H��H�=�m ����H�=�m H�H��t	�����H�T$dH3%(H��t���H��([]A\A]���AUH��ATUSH��dH�%(H�D$1�H�F���u!H�-@H�5*@1�H�=�@����JH��H��H������H��H���0H��1�H���H��H��H��H;$tL��d H�5�?1�I�:�V���H�����vL�
�d H�5�?1�I�9�0�����}t+L�e ���I9�tL��d H�561�I�8�������I���m��H�=�l I��H��t
��4���H�=hl ���H�}H��L�(�T��L���������u
H���W���H���H�}����H����H��H�=l ��T��H�=l H�H��t	������H�T$dH3%(H��t����H��[]A\A]���SH��H��H�� dH�%(H�D$1�H�F���tH�~@��@������H;�k uH�vH�{H�T$�����ux�lH�T$H�5?1��.����1���teH�t$H��t5H��H���I��I��I��I�����vL�
:c H�5�=I�9�{��1��&H�{H�T$�����u
H�������
Hc|$�a��H�L$dH3%(t����H�� [�SH��H��H�dH�%(H�D$1�H�T$�@����u
H�����
Hc|$���H�L$dH3%(t���H��[���UH��SH��H��(H�~H�52b dH�%(H�D$1�H9�uH��������u�H���d����tH������H���H�)j H9CuH�sH�}H�T$�����u|�mH��H�T$H�5�=1����1ۅ�tlH�t$H��t5H��1�H���H��H��H��H�����vL��a H�5P<I�8����-H�}H�T$�����u
H����H����D$����H��H�L$dH3%(H��t�k��H��([]���AUATA��UH��H��H�5=S1�H��(dH�%(H�D$1�H�L$H�T$H�D$�l�����H�|$H��t7H��1��H��H��H��H�����vL��` H�5x;1�I�8�(����H�|$H��tH��1��H��H��H��H�����w����H���r��H�=�h I��H��t
��9���H�=mh ���H�}H�T$D��H�H�t$�?��L��A������A��u
H���P�H���
H�3` H�H�=!h ��W��H�=h H�H��t����H�T$dH3%(H��t���H��([]A\A]���AVAUATUH��H��S��H�� dH�%(H�D$1�H�FH��tH������1�H�L$I��H����H�5\;��������H�<$�0�I��H�����L��I���4��H�=Ug I��H��t
�����H�=/g �j��H�}H�t$1�L�0A��L�����L��H�����H����1�H�L$H�T$I��H�5�:�=�����)H�|$H��t7H��1��H��H��H��H�����vL��^ H�5I91�I�8�����H�|$H��tH��1��H��H��H��H�����w�H�<$�*�I���O��I���7��H�=Xf I��H��t
�����H�=2f �m��H�}A��L��H�T$H�t$L�0���L��H�����H��u
H�����
H��] H�H�=�e ����H�H�=�e H��t����L�
k] H�5|/I�9���1�H�T$dH3%(H��t���H�� []A\A]A^���AUH��ATUSH��dH�%(H�D$1�H�F���u!H�!8H�581�H�=/9�����OH��H��H������H��H���5H��1�H���H��H��H��H;$tL��\ H�5�71�I�:�J���H�����vL�
�\ H�5t71�I�9�$�����}t+L�e ����I9�tL��\ H�5
.1�I�8������y��I���a��H�=�d I��H��t
��(���H�=\d ���H�}H�޺L�(�s��L��������u
H���F�H���H�}����H����H��H�=
d ��C��H�=d H�H��t	������H�T$dH3%(H��t����H��[]A\A]���AUH��ATUSH��dH�%(H�D$1�H�F���u!H�`6H�5]61�H�=u7�*���JH��H��H���'��H��H���0H��1�H���H��H��H��H;$tL��Z H�5�51�I�:����H�����vL�
$[ H�5�51�I�9�c�����}t+L�e �/��I9�tL��Z H�5L,1�I�8�2������I�����H�=�b I��H��t
��g���H�=�b ����H�}H��L�(����L��������u
H����H���H�}���H���9�H��H�=Qb ����H�=Hb H�H��t	�����H�T$dH3%(H��t�#��H��[]A\A]�ATUSH��H��0H�dH�%(H�D$(1�H�l$H��������tH�����H���H�����Hc�H�|$�3��I��H��uH������n��H���~H�T$H��H���i����tH���m��L������@��H���PH�t$1�1�L���Z��L��H�����H��t'�|$u H������H�I��u
H��L�������H��H�����H�L$(dH3%(H��t���H��0[]A\���UH��SH��(H�VdH�%(H�L$1���tH���H;�` H��uH�^��nH��H�T$H�5�41��n����t=H�\$H��t7H��1�H���H��H��H��H�����vL�|X H�53I�8���1��VH�߃�����H��H��t;H��H���3���D�E�Q�A��D�H��H�D$����H�D$H��u����H��u�H����H�L$dH3%(t���H��([]���AUI��ATUSH��QH��uH�H�5�W H�xH9�u!�(H�ֹ�H�=�3�b����u��������tH�=<W H�5�(H�?����1��H�;�>��A�ă��t*H�kH��������u&H�
�V H�5c31�H�9����|���H��t��A�}t(M�m �`��I9�tH�W H�5}(1�H�:�c���AH�=�^ �u��H��H��t-H�EH��H�5�D��H�H�@H�h�H��H�C��ZH��[]A\A]���AVAUATUH��SH��H��H��uH�CH�5^V L�#H�xH9�u!�(H�ֹ�H�=�2�'����u��s�����tL�V H�5r'I�8���1��lH�{���A�ƃ��t�}H�[u�7����H��t��$L�m �I��I9�tH�=�U H�5f'H�?�N��1��L���O���A�Ņ�x�H���`����uH�
uU H�5�1H�9���1���� �%��H��H��t�H��tH�M��tI�$H�\$H��] �~D$L�d$H�UD�mD$EH�-u] �H��I���0��H�=Q] H��H��t
�����H�=+] �f���H��D��D��L� H�����.���H�=] ��=���H�=�\ H�H��t����H���]��H��T H���H��[]A\A]A^�AVI��AUI��ATUH��SH�����H��I�����H�}L��1����H�}�G��H��L��1����H���R���[L��]A\A]A^�����AUH��ATUSH��(dH�%(H�D$1�H�F���u!H��.H�5�.1�H�=\0�����I��H�t$H���ÿ��H��H����H��1�H���H��H��H��H;T$tL�mS H�5�.1�I�:�$���bH�����vL�
�S H�5N.1�I�9����5A�|$��I�\$ ����H9�tvH�D$�@�{��H��H��u
�.����M�D$L�l$H�hH�5
��H�l$H�0I�|$ L��L�@H�
�Z H���@ H�h(L�h8�P���L������|��I������H�=�Z H��H��t
�����H�=�Z ����I�|$H��L�(���H�=�Z ��D$���H�=�Z H�H��t脿��H�������|$�uH�=6Z H�5�.1������
H�oR H�H����H�T$dH3%(H��t�U���H��([]A\A]���AVAUATUH��SH��H��0dH�%(H�D$(1�H��u1H�H�A���uCH��,H�5d.1�H�=M.����H�ֹ�H�=/.�����u��H�t$H���n���I��H����H��1�L���H��H��H��H;T$tH�=Q H�52,1�H�?�����%L�sH�����vH�fQ H�5�+1�H�8����L��������uH�-�P H�5�-H�}�}��1����}u����I��H��u3�ɻ��H���L�m �(���I9�t���H�}(1��4����u��H�l$�~D$L�t$H�EI��}D$��H�] ����H9���H�D$ �@���H��H��u�@���L��蘺���L�UL�\$L�`H��L�d$ L�

���@ L�H�} H�
X L��L�PL�h0L�X(L�`8�X���L���"������I�����H�=X H��H��t
�����H�=�W ����H�}L��L��L�0L����H����覹��H�=�W H��@��D�ƾD�D$�չ��H�=�W H�H��t�m���H������|$tH�=W H�5�+1����L��聹���
H�PO H�H�T$(dH3%(H��t�=���H��0[]A\A]A^�AVA��AUI��ATI��UH��SH��@dH�%(H�D$81��~�H�^ �%���H9��H�D$H�}(�*����u1���P�ſ��H��H��u
�x�����H�l$�~D$H�} H�T$(L�`(H�L$ L�d$L�l$H�5���D�p D$@H�D$0H�D$�~L$H�T$L��H�3H��L$H�L$�~T$H�
�U L�d$K0T$S@�Z���L���$���H�\$0H��uBH�|$(H�t$ �k���H�|$(H�u茾��H�|$ H������y����D��L��H��A��H��H�L$8dH3%(H��t���H��@[]A\A]A^���H��H��H�=9��h�����H��H��H�=��M�����H��H��H�=��2�����H��H��H�=�������H��H��H�=E������H��H��H�=*����AWAVAUATI��USH��(dH�%(H�D$1�H�FH����H��H;G8��H;G0��H;G@u"H�t$L���	���Hct$H���\���H���H;GHu�F ���H����L�oH;GPu#H�T$L���ž����uH�|$臼��H���I�T$H;UPtH;UXuCH�}H�T$L��譵����uH�|$菼��H��H���w�θ��1�H���gL��諵��I�\$H;]P�H;]X�L�u`L9��H;]h��H�T$L��L���K�����tfHc|$E1�L�|$襼��H��H��u�gH�t$H�����H��tHIc�A��H�D�D9t$��L��D��L��L��袷����u�H�uH����H���b��H���H�uH���Ի��1��H;]xu
L�����H���~H�}8u'H�;H�5�'�t�����uH�]8L��H����H���PM��u'H�;H�5�'�H�����uH�]`L��H����H���$H�=�R �4���H��H��tA�$L�`H�@H�L$dH3%(H��t蔹��H��([]A\A]A^A_���AUATA��H����UH��H��H�5'S1�H��(dH�%(H�D$1�H�L$L�D$H�D$膴������H�|$H��t5H��1��H��H��H��H�����vL�J H�5�$I�8�D�����ʷ��H��買��H�=�Q I��H��t
��y����H�=�Q ���H�}H�T$D��H�H�t$�/���L��H������H��u
H������!�}tH��H���c���H���H���5��H��H�=MQ �胳��H�=DQ H�H��t����H�T$dH3%(H��t�#���H��([]A\A]�UH��SVH�詳���}H��t%�H��H������H�ōB��ʉH���}����YH��[]���H��Z[]���AUATI��H��USH��(dH�%(H�D$1�H�FH;�P ��L�nI�|$H�L$H�T$L���9�����uL��L���Y���H���Hc|$��uH�=z&�Ͳ��H�����uL�L$L��I�1����H��������1�H��H��u	�7J�D���9l$��L�D$Lc�L��K�4����H��u�H�uH���p���1��H���t
���H���zH�L$H�t$1�1�H�5o$�f�����tZH�T$H��1�H���H��H��H��H�����v#H�-yG H�5"H�}蹸��H�|$�����H���t��H�|$H���h���H�T$dH3%(H��t�0���H��([]A\A]���AUATUH��SH��H��(dH�%(H�D$1�H�FH;�N uvH�vH�H�L$H�T$蝳�����Hc|$E1�踷��H��H��u
�9J�D�A��D9d$�dL�T$Mc�H��K�4����H��u�H�uH������1��7H�����sH��"��sH���;���H���H��H�L$1�1�H��"H�5#������H�t$I��1�L��H���H��L�H�����v%L�
F H�5� I�9�D���H�|$�
����H�}H�L$H�T$������uH�|$���H������H���pHc|$1�蛶��H��H��u	�DJ�D���H�t$9l$~4Lc�1�L��N��L���L��H��H�q��8��H��u�H�uH�����1�H�|$�!���H�|$�g���H�T$dH3%(H��t�/���H��([]A\A]���ATUSH�_H���H�G�H��H�=�L �#���H�=�L �L� ����H�=�L H�H��t觱��L���/���H�C1�H�P8���t	L�$M��u1�1�H��觳��I���1�1�H��A��1�H��H��諲��I��H�uH�����H�MuH�����M��u&H�1L H�5"L �(L H�=	L �Բ���I�$uL��贴�����H�=L H��H��t
�趶���H�=�K �%���H�[]A\���AUA��ATI��UH��S1�QA9�~H�|���P��ȉ�]���H����L9�tZH��[]A\A]�ĭ��X[]A\A]�AWI��AVAUI��ATUSQH����H�GI��H����u!���I�EH�����L���L�wI��@~TI�����~-H�=2C �H�5;H�FHD�1�H�?�a����J�<��o���H��H��u貭��1��[H��1�L9�}=I�T$���tI�L$H�<��I�|�H;=�B t �k��H�D�H��t�H���L���H��1�A��L��1�H���L��1����ZH��[]A\A]A^A_���AVAUATUH��SH��H��PdH�%(H��$H1�H�~H�D$uH�FH�P���HE�{�L�c �C���I9���H�D$8H�{(�H��������P���H��u
蜬����H�\$H�t$H�|$0�~D$H�l$L�D$(L�L$ H�
�H�l$8H�H��H�
2I D$H�t$�~L$H��H�|$H�{ H�hH@L$L�D$�~T$L�L$H(T$P8�}�H�|$u'H�|$0H�t$(H��tH�T$ �����H�=�H 耮��H��������1���L�d$@H��H�T$8L���[���H��H�����Ʈ��I��议��H�=�H I��H��t
��u����H�=�H ���H�{�t$8H��L�(�茯��L��A������A��H��u����
�e���H�D$H�=aH �藪��H�=XH H�H��t�/����T$8L��H���S���H�l$H��$HdH3%(H��t� ���H��P[]A\A]A^���AV�AUATUSH��H�=�G H�� dH�%(H��$1�����H�=�G �H�(��H�=�G H�H��t芬��H��L�d$�
���H�{H�T$L����H��H��uH�S@H�s8H�{0����H�C(H��3���H�=TG I��H��t
�����H�=.G �i���L�(H����H�S�K �t$H�zH�������H�=�F A���2���H�=�F �L�0����H�=�F H�H��t趫��L���>���A��H�{L�k(u����I�E�	���I�EH�K(H�9uH�S@H�s8H�{0�2����]���H�=~F I��H��t
��$����H�=XF 蓨���T$L��H��L�0�d���H�=�E 腩��H�{H謪��H�=�E �����H��$dH3%(t����H�� []A\A]A^�H�muH��脮��H�+��1��H�+u�H��1��c����mI�,$uL���O���H�+u�H��1��?����IH�+u�H��1��*����4H�muH������H�+u�H��1������H�+u�H��1����
H�+�h���H��1��ح����
H�+�O���H��1�迭����
H�+�6���H��1�覭���
H�+����H��1�荭���
H�+����H��1��t����~
H�+���H��1��[����e
I�,$uL���G���H�+����H��1��3����=
H�+�����H��1������$
H�+�����H��1������
H�+�x���H��1������H�+�_���H��1��Ϭ����H�+�F���H��1�趬���H�+�-���H��1�蝬���H�+����H��1�脬���H��1��u������SH���S�����u��D1ҹH�58H���b���H��tH�5H�������tH��蒤����t�H���F���1�[���AWAVAUATUH��SH��H��HdH�%(H�D$81�H��w
H��!�T1ҹH��H�=������u��rH�H;
; tnH�A���t?H�t$0H��踦��I��H��tDH��1�L���H��H��H��H;T$0��H��u4�wH�mH�5,H�=X�\���E1��E1�H����H�KL�IA���u"H�OH�51E1�H�=�����?H�t$(H������H�D$H��t�I��E1�H��L��D���H��L�H;L$(�=H���qH�KL�QA���u"H��H�5�E1�H�=�蠬����H�t$ H��螥��H�D$H���$���H��L��D���H��H��H;L$ ��H��� L�[I�{H;=k9 ��H�5^9 �٧��A�ƅ���H�{�E����D$��tH��u������H��t����L�{ I�H;=9 ��H�59 肧��A�ą���H�{ ���A�ƃ��tH��u��ƥ��H��t��P���H�S(H�zH;=�8 tOH�5�8 �/���A�ą�u<H�{(蟩��A�ǃ��tH��u�a�w���H��t�����H�s0H�~H;=n8 uH�-E8 H�5�	E1�H�}����YH�5F8 �����u�H�{0�4���A�ă��tH��u�����H��t����H�K8H;
?8 ��H�Y���tTH�t$0H���ף��H��H���_���H��1�H���I��I��I��L;D$0��L�-}7 H�5�I�}�5����$���H�wH�5�E1�H�=_�c����L�
K1�E1�E1�A��D$L�L$�11�E1�A�E1��D$�E1�1�A��1�A��1�M��u3�H�5�1�E1�E1�L�q�D$A�H�t$L�D$H��1�L���I��I��I��I�����vOH�
7 H�5�E1�H�;�K�����L��1�E1�E1�H�L�\$A�E1��D$H�T$H��H�|$1�H���H��H�1H�����w�H�|$H���H��H��H������t���H��tH��H���H��H��H������T���H�=> �̡��H��H��������{���D�s�H�H�CH�5H��踡��H��A��E��D�K�D����{�C(H�C tH�=�= H��t�B���H��= H�=\�;���H�=qH�C0�+���H�=�H�C8����H�=<H�C@����H�=�H�CH���H�=H�CP���H�=/H�CX�ۣ��H�=�H�C`�ˣ��H�=WH�Ch軣��H�=�H�Cp諣��H�{H�5<H�Cx����M��t H�{A�L��H�H�5 �R����|$H�{A�tH�
g1�H�5��,����H�
(1�H�5�����H�|$1�H���H��H���-���I��H����H�t$H��贤��E�UL�5�4 C��tL��4 C�A�UH�{1�A�L��H�5�觥��L������E��uH�{A�H�
�1�H�5��{���E��u	H����E��t�A�H��t�E1�H��H��1��H��I�|
�k���I��H��u讞��H��)����y�E��t�-synf�@cH��t f�@ H�5�L��赡��H��L��誡��H�{A�L��1�H�5��Ϥ��L��觝��H�{�����tH���{��H�I��u6H�����,��H�-e3 I��H�}u�&���L�%����H��: L�eH�T$8dH3%(L��t����H��H[]A\A]A^A_�f.�H�=�: H��: H9�tH��2 H��t	�����H�=Y: H�5R: H)�H��H��H��?H�H�tH�]2 H��t��fD�����=: u+UH�=B2 H��tH�=�* 詟���d�����9 ]������w������ATUS����H�$: H���9��H�=�8 ��H��H����1�1�H�=��F���H��H�����H�H��H�5�H���������H�5�H��H�-^9 �ѝ�����=����H�5�H��赝�����c�H�5H��虝�����7����H�5mH���}������]�H�5_H���a��������H�5OH���E�������� H�5@H���)��������H�����H�5.H����������H�5H��������B�H�H�5
H��衚�����f�H��
H�5�
H��胚�����8�H�=7 ���I��H���b�H��H�5�
H��Hǀ8�v��������H�=�6 L�%�7 軝��H��H�����H��H�5�
H��Hǀ8�2������u�H�=C6 H�-�7 �w���I��H���A�H��H�5�H��Hǀ8��������L�%�7 �ڜ��H��H���^���H��H��t7H��讙��I��H��tH�x �͞��I�,$uL������H�muH���������H���~�H��[]A\���H��H���/builddir/build/BUILD/Python-3.8.17/Modules/_tkinter.cUnreachable C code path reachedinteger argument expected, got floatmain thread is not in main loopCalling Tcl from different apartmentmust be str, bytes or Tcl_Obj, not %.50ssetvar requires 2 to 3 arguments����ȡ����������¡��Ρ��ơ����������ơ��ơ������the string representation of this object, either as str or bytesname of the Tcl typedeletetimerhandler($self, /)
--

loadtk($self, /)
--

interpaddr($self, /)
--

quit($self, /)
--

dooneevent($self, flags=0, /)
--

mainloop($self, threshold=0, /)
--

createtimerhandler($self, milliseconds, func, /)
--

deletefilehandler($self, file, /)
--

createfilehandler($self, file, mask, func, /)
--

deletecommand($self, name, /)
--

createcommand($self, name, func, /)
--

split($self, arg, /)
--

splitlist($self, arg, /)
--

exprboolean($self, s, /)
--

exprdouble($self, s, /)
--

exprlong($self, s, /)
--

exprstring($self, s, /)
--

getboolean($self, arg, /)
--

getdouble($self, arg, /)
--

getint($self, arg, /)
--

adderrorinfo($self, msg, /)
--

record($self, script, /)
--

evalfile($self, fileName, /)
--

eval($self, script, /)
--

willdispatch($self, /)
--

getbusywaitinterval($module, /)
--

Return the current busy-wait interval between successive calls to Tcl_DoOneEvent in a threaded Python interpreter.setbusywaitinterval($module, new_val, /)
--

Set the busy-wait interval in milliseconds between successive calls to Tcl_DoOneEvent in a threaded Python interpreter.

It should be set to a divisor of the maximum time between frames in an animation.create($module, screenName=None, baseName='', className='Tk',
       interactive=False, wantobjects=False, wantTk=True, sync=False,
       use=None, /)
--



  wantTk
    if false, then Tk_Init() doesn't get called
  sync
    if true, then pass -sync to wish
  use
    if not None, then pass -use to wish_flatten($module, item, /)
--

, handler deleted<tktimertoken at %p%s>busywaitinterval must be >= 0mainloopdooneevent|i:wantobjectsbytes object is too longembedded null bytestring is too longembedded null characterstrargumentadderrorinfonesting too deep in _flattenargument must be sequenceOituple is too longlist is too longsurrogateescape<%s object: %R>info exists     tk_versionevalexprbooleanexprdoubleexprlongexprstrings:getbooleans:getdoubles|s:unsetvarO&O:setvarssO:setvarrecordevalfiles:getintcreatetimerhandlerbad argument listcreatefilehandlerdeletecommandcan't delete Tcl commandcreatecommandargument 1command not callablecan't create Tcl commandbooleanStringbignumO&|s:getvarutf-8et:splitet:splitlist_tkinter.TclErrorREADABLEWRITABLEEXCEPTIONWINDOW_EVENTSFILE_EVENTSTIMER_EVENTSIDLE_EVENTSALL_EVENTSDONT_WAIT8.6TK_VERSIONTCL_VERSIONTkappTypeTkttType_tkinter_skip_tk_initTkcreatestr or Noneargument 2argument 3argument 8threadedtcl_platformbytearraywideIntprocbodyexitDISPLAYenvtcl_interactiveargv0-use argvtypenamedeletetimerhandlerwilldispatchcallglobalsetvarglobalgetvarglobalunsetvardeletefilehandlerquitinterpaddrloadtksetbusywaitintervalgetbusywaitinterval_tkinter.Tcl_Obj_tkinter.tktimertoken_tkinter.tkapp_tkinter��;�R����Љ���������������� Γ��4Ĕ��l����������������� �������� l���l���������������*�������83���t�����ޡ���{���$����X~����ܣ���6�������1���,����hG���������ƭ����(���\��������1���$	����P	����d	ٲ���	����	;����	����
����P
r����
/����
����$C���Dl���p���;������,���h����������
���D
^���
����
�����D8��XS��ln���������������K�����D��x�����������4��h[������������N����<zRx�$@}���	FJw�?:*3$"D���	\����p���������4������F�B�A �A(�A0�(A ABB�P���,�h���
�a����E��Б��+E�O
EQ4ۑ��mK@a4L0����B�B�A �D(�IP�(A ABBH������F�B�B �B(�D0�D8�D@�8A0A(B BBB4�����F�A�D �
ABEACB$ڕ��vE�A�D dFA$0(����E�F�K �AAX����|E�Q dA x���jE�G \A8�T����F�E�A �A(�D@�(A ABB8�����[F�B�A �H(�A0@(C ABBH֚��PB�B�B �B(�A0�A8�A@:8A0A(B BBB$`ڛ���E�G�D@�AA0�O���=E�D�A e
DAEAAA4�X����F�B�A �D(�A0�(A ABB���^A�\$(���ZE�A�D MAA(8Z����F�A�H ��AB(d���#F�A�A �AB8�����RF�G�A �A(�NP.(A ABB8�����B�B�A �D(�D`�(A ABB0����RE�A�D z
DAEAAA8<����-B�D�D �D(�A0(D ABBx����)0�����B�A�A �D@ AABH������B�B�B �B(�A0�D8�D`v8A0A(B BBB��ED @`$���NF�E�L �J(�D0�A8�B@�
8A0A(B BBBEN8A0A(B BBB(����bF�D�A �SAB�;����A���,E�f�Q���:A�x8o���(F�B�A �A(�D0(A ABB8<[����F�E�A �A(�D@�(A ABB8x۫���F�E�A �A(�DP�(A ABB8�\����F�E�A �A(�DP�(A ABB8�ޮ���F�E�A �A(�DP�(A ABB8,_����F�E�A �A(�D@�(A ABBh߱���E�J0�A�����YA�G OA(�����)E�D�G@AA8��xF�B�D �N(�FPQ(A ABB@	0���WF�B�B �A(�G0�FP60A(A BBB8T	C����F�E�A �A(�D@�(A ABB8�	ȸ���F�E�A �A(�D@�(A ABB,�	H���B�A�A �GP� AAB(�	&���E�D�D@AA8(

���2F�E�A �A(�D0(D ABB@d
����F�B�B �A(�D0�G@�0A(A BBB8�
����`B�E�E �A(�D0�@(D BBB8�
־��(F�E�A �A(�DP(A ABB@ ���F�B�B �A(�D0�G`�0A(A BBB@d���}B�E�E �D(�D0�Dp\0A(A BBB�����������������������H ����B�B�B �B(�D0�A8�D`p8A0A(B BBB8l;��mF�B�K �N(�FP?(A ABB0�l��OA�D�A x
DAEDAA8�����F�B�G �A(�DP�(A ABB8
���F�B�A �D(�GP�(A ABB(T
���7F�A�A �+ABH�
���QF�E�D �D(�C0e
(D ABBEA(A ABBH�
���'B�E�B �E(�A0�A8�A@8D0A(B BBB@���eF�B�B �A(�D0�J�C0A(A BBB@\���
F�G�B �A(�A0�Q��0A(A BBB(�L���F�A�A ��ABzRx� ���$=��#L��^E�XH���uF�B�B �B(�A0�D8�G�R8A0A(B BBBGNU���P�0� Ufr���>
�� � (� ���o`��
�h� �H0 "(	���o���o�!���o�o� ���o�8�  ?0?@?P?`?p?�?�?�?�?�?�?�?�?@@ @0@@@P@`@p@�@�@�@�@�@�@�@�@AA A0A@APA`ApA�A�A�A�A�A�A�A�ABB B0B@BPB`BpB�B�B�B�B�B�B�B�BCC C0C@CPC`CpC�C�C�C�C�C�C�C�CDD D0D@DPD`DpD�D�D�D�D�D�D�D�DEE E0E@EPE`EpE�E�E�E�E�E�E�E�EFF F0F@FPF`FpF�F�F�F�F�F�F�F�FGG G0G@GPG`GpG�G�G�G�G�G�G�G�GHH H0H@HPH`HpH�H�H�H�H�H�H��lP�|��q���b��4�aB�S@�� *��R��>��Z7�k�S�Ks��ƻ�`���K�0����\�����<�����~�I�c���H�V�-�ѻֆе��S}�����{��x�?zp�o��xP�d��v0�X�u���������д6�������n�`����� �e�d�ػ����'��U�`�0�|X� �w��R�|�Tв��#r��4�a@ � Ϻ�`��w�^������
T�����T��� � Ǿ �� ݾ�@� ����������� 4WjBAqF�q:C�RI � GA$3a1�>��_tkinter.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debugҲz��7zXZ�ִF!t/��w�]?�E�h=��ڊ�2N�I�� �ڔQ��νt"wL�,PgZ�a�h	�PD���hw3��x$���!����(zA\}f0�Mlv
3���7���ӛ�:��J�4���
�����O�-;x�j�U]&Q�����!(i�3Lb�*m���zbZ7]R�l$�QI�
۶1��K�Ի��>Q�U�]�p���L�o���.�~@.�+0���^VVH��v�.�B�A���X4�V�����#v~WV�w�>)����v\���u����-{�_�����Y!��DVT���T�γ�m�m^���j������]��Ob��Ʒ�20��2�K�t���q�h���7��a�$�)�u�R�YK1�t,p�WM3x~pJnk�B��с�v�֯����R��k��<pP���[Ugr�K�fuA+׼�Vq,%�y�����X��ެ�ݥ�K����1P3�r��w ����|U��4����Xr�`pp���ª��۟�*zb��s�e�u1��P0Y�_[�֟�q����pL%X�� *���ל�@@���	�&�L��Z5tvC1��r;z�c�q��A�EGXt ��@�+������*B�eY�.t	�6�c��
�\�^:s��M�M?rGt�B
,�u�$j��73V��.i�be$��Q:�f�ψ�T��_]F��U�e��G�����f���B����r��
�2�1�?3�Ck�R��oH7)~@u?�ʋ�\�_%�s'���s��(��=#ey�1[֘w�(38����'�<�r��@%+�\�];����/K�J���꼮Ķ^gB�'�˂�oͰ�4����o=>`�RN7J�Y���1Y"':��(-���y�{��~�&&it�!�bj����iB��3Y<�a�$]�%u�2�L��o�0���G)��%��!˴l��Ș��٦p��-Ys�Qn[*n�e/�.����X
�	�X"D�;�f9�?���M�n<��•�d$\�f�6�� �����̼f�l2���*����r�t��Q�B� 3�<П���u�w�C�p=��??N:���Y-�
�h �B��v�N���U��Y�J"��2��]?�6�>����gm;=}eIh%�m)�褘գ6Z/ft�J���I�� , q}VQ'��O�n]P�t��]��,�N�{Z#���h2��ў���y<5�|Q
�*DOܙN�j��f���k�K�>������<�]��#��[�_��ZBbN���HW
,5��.�
|�(G����]�#/�64G\��f{P�۠Ҝs�R��l2*_�������9�:K��r��Y�FQXN1f�&�$P�=4C�v���I8�㋻��H}n�À�VP���SL+oN"�rK�/�9|��f��݁�TI*8��.Ls�nk�SA���������Υt�`F̙�2��}�c�V2vg6�Wl��-���Ưd��`?�����fo��VZa�i�
k#�nW!U�È�6NwD[m���U<OҖ�!���Xk,��l�/�&J�C���ҕ���f�G�
B�s�V��y��_�O"H�ۯ���:5I���|�%�P�e�nxxR�y�J!Pbj0�����:��:�2Y�����*�2�Y4J��SC]�K}x/��S��_�V2c�A�EN@x���Vt�%�ē|n�G��赨$�8s�#^�-mk�&�n=�k��9��cc�G�s��
/0�h��6�?J�tJ��Ag,��
�6dn�:��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``<(��(0���8���o� � nE���o�!�!0T " "(^BH0H0�h�>�>c??�	n�H�H�	w�R�R�]}����
�����p ���������h��� � �  ��(� (��0� 0��8� 8�0�h� h���� �p �p� p�����`p�$
��`�� �(lib-dynload/_codecs_cn.cpython-38-x86_64-linux-gnu.so000075500000456770151153537500016212 0ustar00ELF>�/@�V@8	@���� ��!�!�U�U @M@M"@M"888$$������  S�td������  P�td��������Q�tdR�td��!�!�T�TGNU�F�D��<Ɲ�q3Х<���@ "��|CE���qXa9@`�� �@ , �F"s���b0����P"��P"��P"PQ�__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6_PyUnicodeWriter_WriteCharPyUnicode_AsUTF8strcmpPyCapsule_NewPyObject_CallFunctionObjArgs_Py_DeallocPyImport_ImportModuleNoBlockPyObject_GetAttrStringPyExc_LookupErrorPyErr_SetStringPyExc_TypeErrorPyInit__codecs_cnPyModule_Create2__strcpy_chkPyModule_AddObject__stack_chk_fail_edata__bss_start_endGLIBC_2.4GLIBC_2.3.4GLIBC_2.2.5vii
�ti	�ui	��!�P�!�P �! �!@�!"RP�!@"X�!hRh�!@
"p�!oRx�!@="��!xR��!@-"��!@�!��!gR��!"R�!p;�!pL�!)R �!0=8�!�IP�!-Rh�!?��!PF��!R��!A��!A��!�C�!�C�!0P�!�C�!gRP"`�`""�p"���"b��"��"^��"ܻ�"Z��",��"z��"6�"�"�� "j�0"&��
"���"���"���"d��" �
"��
"�� 
"T�P"@�`"��p"<��"���"8��"���"4��"���"0��"���",�"��"(� "��0"$�@"��P" �`"��p"��"���"��"���"��"���"��"���"�"��"� "��0"�@"��P"�`"��""��"N��"P��"���"��"��"D� "�0"��@"��P"L�`"�p"���"���"T��"��"���"���"\��"��"��"��"d� "&�0"��@"��P"l�`".�p"���"���"t��"6��"���"���"|��">��"�"��"�� "F�0"�@"��P"��`"N�p"��"���"���"V��"��"���"���"^��" �"��"�� "f�0"(�@"��P"��`"n�p"0��"���"���"v��"8��"���"���"~��"@�"�"�� "��0"H�@"
�P"��`"��p"P��"��"��"���"X��"��"��"���"`�""�"� "��P"�R`"|Sp"T�"�T�"vU�""V�"�V�"4W�"�W@ "^XP "Y` "�Yp "�Z� "N[� "
\� "�\� "�]� ">^� "�^� "�_� "r`!".a!"�a !"�b0!"bc@!"dP!"�d`!"�ep!"Rf�!"g�!"�g�!"�h�!"Bi�!"�i�!"�j�!"vk�!"2l""�l""�m ""fn0"""o@""�oP""�p`""Vqp""r�""�r�""�s�""Ft�""u�""�u�""pv�"",w�""�w#"�x#"`y #"z0#"�z@#"�{P#"P|`#"}p#"�}�#"�~�#"@�#"��#"���#"t��#"0��#"��#"��$"d�$" � $"܅0$"��@$"T�P$"�`$"̈p$"���$"D��$"��$"���$"x�P-"��@/"�� 0"��00"X�@0"p��0"r��0"���0"���0"���0"x��0"z�1"|�@1"b�P1"d�p1"f��1"���1"���1"���1"��2"��2"��@;",�P;",�`;",�p;",��;",��;",��;",��;",��;",�@="�P="��`="Jp="\�="�@?"pP?"�`?"�p?"f�?"h�?"��?"�@@"(	P@"&`@"pp@"x B"
0B"@B"PB"`B"pB"�B"�B"�B"�B"�B"!�B"#�B"%�B"'C")C"+ C"-0C"/@C"1PC"3`C"5pC"7�C"9�C";�C"=�C"?�C"A�C"C�C"E�C"GD"ID"K D"M0D"O@D"QPD"S`D"UpD"W�D"Y�D"[�D"]�D"_�D"a�D"c�D"e�D"gE"iE"k E"m0E"o@E"qPE"s`E"upE"w�E"y�E"{�E"}�E"�E"��E"��E"��E"�F"�F"� F"�0F"�@F"�PF"�`F"�pF"��F"��F"��F"��F"��F"��F"��F"��F"�G"�G"� G"�0G"��L"T��L"� M"�0M"��P"�RP"�NP"gRhP"�R�P"P"�O"�O"�O"�O"�O"	�O"
XO"`O"hO"pO"xO"	�O"�O"�O"
�O"�O"�O"�O"�O"�O"��H��H��!"H��t��H����5B!"�%C!"��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
���������%] "D���%U "D���%M "D���%E "D���%= "D���%5 "D���%- "D���%% "D���% "D���% "D���%
 "D���% "D���%�"D���%�"DH�(H��@�uI�0H��I�0H�I9���4q��wHH���H���IH��~�L�H��A�3I�0H��I�0H�I9����4���vҁ�����H����A��A��I��I�M�M��t{A�j@��9�rxE�R	D9���)�A�4sf������L��΀H��f���̀A�+L�A�rI�0H��I�0H�L9���
����_�������H���t��j��`�Y�T��L��B��8L�0H��A�6I�0H��I�0H�I9��U�4q��wHH���H����H��~�L�0H��A�6I�0H��I�0H�I9���4���vҁ�����H������ ���� ����������0��A��A��I��M�M�*M����E�r@��D9���E�R	D9���D)�A�tuf�����A��L�(fA��A�΀E�uf��xRL��΀A�rI�0H��H��I�0H�L9��������������H����D��L�0A��fA��E�.L�A�r미������щ��͸���|��r��h��^H�H���M� I��M� H�M9��SB�a�ƒ�wIH���H���
H��~�L�.H��A�EM� I��M� H�M9��B����v�=����H����= ��= ��=���A��A��L�l$�=�0��I��M��M�I�$H�T$�H����E�l$��D9���E�d$	D9���D)�L�l$�A�TUf���t|��L�&f���ȀA�$f��xFL�.�ʀA�UI�H��H��<A����������H���������H�A��fA��D� L�.A�U뻺D���������������H�T$�L�%�!H��L�L�*L�l$�M��t/D�jD��E9�r!�R	A9�wE)�L�l$�C�Tef����5���H����L�%H���A;D$��I��A�$����9�r���D����H��	H���D��1�L�.H��A���0A�U1�L�.���B�1�A�ED���1�A��H�D�j01�D�hD��L�&A����pA�$I�H��	H���
E�l$)�1�H��D�L�.�D$�A���0A�U1�L�.���B�1�A�E�D$��1�A��H�D�j01�D�h�D$�L�.A����A�EI�H�A�<$��	��C
I��A��A��I��M�M�#M����A�k��9���E�{	D9��u)�E�,DfE�����?��I��~xH�E��I��fA���~H�.�E{L�>E�_H�D�kI�H����
L��H��t9A�C~L�U�H��
B�iA���F����?L���
I����H�������I��~�L�.A�E~L�>A�G}L�&I�l$H�.L���H��t�A�D$M�8I��L�I�_M�kI�L�.��~��I9��5B�D9���1
���B�������?L����H���Q���L�&L�U�A�$M�(L�I��M�{M�(L�>��~t^M9����
���
L�H��A�~H��C}H��H�������L�&L�U�E�$M�(L�I��M�{M�(L�>��~��L�����=�������b
I�������L�H��A�~L�.A�E}H���/�����/
I���u���L�D��I��f��A�L�&E�l$I�H���H��~H��~H�
1��A}�H��H���I����D��L���!I��M�M�*M���s�RA�J8��bA:R	�X��)�H�A�tE�����?H��������xII��I�M���C
��;��߀;�	��р;���~H�������y�H�������H��������;����E1��CI������D�_�O@��}��A��A��}����0��	��@��wlD��A��E����Ak�
Ak�
�Di���A�A����wvL�%7�E�L$E9���A�|$E4$A)�H��D�������y}I������@��v2@��E��E����k�
Ek�
D�i��E��9���DƁ���vA��TI������HH���Y�����x�I�I���
I���X���I�I����A��-��H���������
I������� H���������A����zD�{� H��������뱸�����H������H���a���H��"H�5E1�H�:�c��|E1��tH�
"H�5@E1�H�9�=��V���I�0USH�D$H�|$ L9���H��"���+���I��A���?�41A�����H���>�H�0H��D�I�(H�uI�0H�L9�}qI����I��t+�t)���F�L�H��A�2I�0H��I�0H�L9�}6�41������H�0H��@�.I�0H��I�0H�L9���fD1�[]�ff.��t)�����H�(H��@�uM�I�sI�0H�L9�}�B�t�����H�8@�7M�I�z�I�sI�0H�L9�}�B�t���|�H�8@�7M�I�z�I�sI�0H�L9��h����41���N�H����L�A�2I�(L�W�L��H�uI�0H�L9��>����)���f���I�0AVAUATUSH�D$0H�|$8L9���A������D��������L��!�����I��A���I�41A�����H�����H�0H��D�M�0I�vI�0H�L9�}{I���	I��t,B�t1�����L�H��A�2I�0H��I�0H�L9�}?�41A�������H�0H��D�6I�0H��I�0H�L9���ff.�1�[]A\A]A^�DB�t1���=�L�0H��A�6M�(I�uI�0H�L9�}�B�t)����H�8@�7M�(I�z�I�uI�0H�L9�}�B�t)�����H�8@�7M�(I�z�I�uI�0H�L9��h����41�����H���k�L�A�2M�0L�W�L��I�vI�0H�L9��>����)���f���AWA��A�
L�=�!AVA�81AUATU�~SH�t$8��H�|$@M� M9���A�����H�����;B�!A�ă����H�����H�H��D� M�(M�eM� H�M9�}oH����H��t-B�D)�����L�&H��A�$M� I��M� H�M9�}2B�!A�Ń��Z�H�H��D�(M� I��M� H�M9���1�[]A\A]A^A_�B�D)����L�.H��A�EM� I�D$I�H�L9�}�B�D!����H�>�M� H�z�I�D$I�H�L9�}�B�D!��w]H�>�M� H�z�I��M� H�M9��k���B�!��wBH���M�L�&H�W�H��A�$M�(I�EI�H�L9��C����.����b��]��X��S�f.����1��fD��AWAVL�5!�!AUATUSH�t$8L�T$@M�(���f���1���M9��B�)���AM��A�����?�N���M���(���L�A�M� L�I�l$I�[I�(H�I�Z���~���I9���B�D!����I��I����I��tE�?���A�CM�8H�[�L�M�oM�cM�(L�&��~�f�M9�~PB�D9�����I�ڀ?���L�H��A�M� L�I�l$M�{I�(L�>��~��I9���@1�[]A\A]A^A_�B�D)���`�?I��I���A�$M�8L�I�oI�[I�(H�I�Z���~���I9�~�B�D9����?I�����L�H�[�A�M�8L�I�oM�cI�(L�&��~�w�I9��]���B�D9�����?M�U����A�CM� L�I�l$I�[I�(H�I�]���~�,�I9�����B�D!�����I�ڀ?�f�M���@�H�.I�Z��EM�(L�M�}M�cM�8L�&��~���M9���������#��1�M9�����������1��fD���?���1����H���eAWI��AVI��AUATUL��SH��H��I��2@��~��@����;�\�M�g�M��A����H���~������I�M��H�PI��p@��~��@�����;��I���~I��t6H���1������I�I��H�QI��q@��~t:@��xl�;���H�������i�I�6I��H�VI��v@��~��zI���K�@��~��@��{��@��
���@��}�/��H��[]A\A]A^A_�ff.���;�H���o������M�I��I�PI�A�p@��~�s���@��x��;��H���4������M�M�|$�I�QI�A�q@��~�7���@���e����;���H��������b�I�6M�|$�H�VI��v@��~�����@���&����;uVH�������'�I�>M�g�M��H�WI�M��t�w@��~�����@����������H��1�[]A\A]A^A_�1���+��&���AWI��AVAUI��ATUH�-��!SL��H��M�����I�?�7@���[M�e�M��A���H���
����I�I�M��H�xI�?�p@��� I����I��t+H���������I�I��H�zI�?�r@����H���������I�I��H�yI�?�q@�����H���x������M�I��I�xI�?A�p@����H���L������M�M�l$�I�yI�?A�q@��x`H���#����_�M�M�l$�I�zI�?A�r@��x7H�������6�I�7M�e�M��H�~I�?M�����v@���K���I���eD�_E�s�A��	�R�@�����A���u���I@���u
A��D�_A���u���7�V���H��H�L�!M��t_D�AE�K�E8�rQD:I	wKE��E)�Ic�E�4|A����t3D��H���/�����I�I�����H��L��[]A\A]A^A_�@��H�5��!H��H��H�H�H��t:D�`E8�w0D8X	r*A��D)�H��4A����tH������y���@H��L�
5�!I�M�M��t3E�QE8���E8Y	�
�A��D)�H�A�4@����u����A��C���I������7���� ����H���7��������n� H����������T���AWAVAUATUSH��H����H��I��L�-x�!L��H��2@���YM�w�M��A���H���������H�M��H�PH��p@���I����I��t+H�������i�H�I��H�QH��q@����H���X����>�H�3I��H�VH��v@�����H���(�����L�I��I�PH�A�p@����H���������L�M�~�I�QH�A�q@��x_H����������L�M�~�I�RH�A�r@��x7H���������H�;M�w�M��H�WH�M�����w@���M���I����@�����@����{�D�f�A��H��L�L�0M��t`�J�x���@8�rP:H	wKD��A)�Mc�G�NA����t3D��H��������H�I������H��L��[]A\A]A^A_�H��L�m�!I�I�3H��tS�RE�cD8����A:S	w*��D)�H��4F�������H������y����A��I������A��z���D�ZA����_�A���������/�E1��T����7�f���H���PAWAVI��AUI��ATUH�-��!SL��H��I�U�2@����M�~�M��A����H��������?�I�EM��H�PI�U�p@��xlI���|I��t)H��������I�MI��H�QI�U�q@��x3H���������I�uI��H�VI�U�v@��� fDI���jD�^�E��I��I�I�$H���:�BA�t$���@8��k�A:D$	�j���)�Lc�B�4y�����=�H�������K�I�EI������H��1�[]A\A]A^A_�H���������M�EI��I�PI�UA�p@���B���H���������M�MM�w�I�QI�UA�q@������H���l������M�UM�w�I�RI�UA�r@�����H���>������I�}M�~�M��H�WI�UM���9����w@���=��������H��[]A\A]A^A_�H�������1����ATUSH�F����a�H�����H��H���E�H�-�"H����H��H�=�T���tZH��H�=��A�����H��H�=��*�����L�%C�!H�=�H������tI��HI�<$�?u���L�%?�!1�H�5�L�����H��H����1�1�H��H���c��H�+I��uH������L��[]A\�L�%;�!�H�=-�%��H��H���[�H�5%H���Z��H�mH��"��H�-�"H��������%�L�%,�!�X�����f����1��fDH�=a"H�Z"H9�tH�~�!H��t	�����H�=1"H�5*"H)�H��H��H��?H�H�tH�E�!H��t��fD�����=�!u+UH�="�!H��tH�=N�!�Y���d�����!]������w������AV��H�=.�!AUATUSH��dH�%(H��$1��Y��I��H��tzH�5�H��!H��E1�L�d$H�__map_1ҹL��H�$L���H�H�T$H�}�����1�H�5�H�����H��L��H���H�����tH��H�3�>u�H��$dH3%(L��uH��[]A\A]A^��|����H��H���hz_multibytecodec__create_codecgb2312gbkgb18030no such codec is supported.multibytecodec.__map_*gbkextgbcommongb18030extgetcodec_codecs_cnencoding name must be a string.000�0���00 ^� &     000	0
000
0000000���6"'"("""*")""7""�"%" "#�"+"."a"L"H"=""`"n"o"d"e""5"4"B&@&�2 3 !����0 �!&&�%�%�%�%�%�%�%�%�%; �!�!�!�!0�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$t$u$v$w$x$y$z${$|$}$~$$�$�$�$�$�$�$�$�$`$a$b$c$d$e$f$g$h$i$���� 2!2"2#2$2%2&2'2(2)2����`!a!b!c!d!e!f!g!h!i!j!k!��������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]��A0B0C0D0E0F0G0H0I0J0K0L0M0N0O0P0Q0R0S0T0U0V0W0X0Y0Z0[0\0]0^0_0`0a0b0c0d0e0f0g0h0i0j0k0l0m0n0o0p0q0r0s0t0u0v0w0x0y0z0{0|0}0~00�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0���������������������������������������������������������������� !"#$%&'()*+,-./������������������������������012345Q6789:;<=>?@ABCDEFGHIJKLMNO�����+���M���k�����������������������������1111	1
111
1111111111111111111 1!1"1#1$1%1&1'1(1)1%%%%%%%%%	%
%%%
%%%%%%%%%%%%%%%%%%% %!%"%#%$%%%&%'%(%)%*%+%,%-%.%/%0%1%2%3%4%5%6%7%8%9%:%;%<%=%>%?%@%A%B%C%D%E%F%G%H%I%J%K%JU?��W(c�T	U�T�vLv<��w~��x1r����(l�[�O	c�f�\��Hh��f�v�QVe�q����PeY�a�o��LcRb�S'T{kQ�u�]�bˍv��b�]W8�b8r}v�g~vFdpO%��bz�e�s,dsb,���gHrnb�b4O�tJS�R�~��.^�h�i���~�h�x��Q��P$�ނހS�eR�����O!Xq��[�b�b�fy���rog�x�`QSS��̀���
P�rY�`q��TY�,g({)]�~-u�lf���<�;��k�{|_�xք=��k�k�k^�^�u�]e
_�_���X�[�����,�Ab�O�S^S������M�hj_��h�֜�a+R*vl_�e�o�n�[HduQ�Q�gN�y|��p�uv^�s�d�b���lZS�Rd”�{/O^6����$n�ls�Uc\S�Te��W
N^ek?|�`�ds��PgMb"�lw)�Ǒi_܃!���S���k�`�`p͂1��N�lυ�d�|�i�fI��SV{�O�QKmB\m��c�S,�6��g�x=d�[�\�]��b�gz�d�cI���� �N���fs:W\8^�P���S^eEu1U!P���b��g2Vno�]5T�pf�ob�d�c{_�o�ば�\hf�_�lH���l��d�y�WYjbHTXNz�`�oڋb����yT�ucS`lߏ_p�;���O:\d���e�pEQ�Qk�]�[�bl�tu� zay{�N�~�wN�R�Qqj�S���ϖ�nd�Zi@x�P�wd�Y�c�]z=i O9��U2N�u�zb^�^�R9T�pvc$��W%f?i��U�m�~"�3b�~�u(��x̖��Ha�t͋dk:RP�!kj�q��VS�NN�Q�|��|�O��{�zgd]�P�v�|�m�QgX[�[�x�dd�c+c�-d��T{)vSb'YFTyk�P4b&^�k�N7����_.� `=��b9NUS���cƀ�e.lFO�`�mދ9_ˆS_!cZQa�chRccH�P�\wy�[0R;z�`S��v�_�_�vl�op{vI{�w�Q��$XNO�n�Le{�r�m��Z�b�^0W��,{^_����c�n�x�pxQ[��W5uCO8u�^�``Y�m�k�x�SՖ�QR�c
T���̍9r�xv��
��SN�v�S��v��-��[��"NN�Qc��a�Rh�Ok`�Qm\Q�b�ea�F���u��cw�k�r�r��5XywL�\g@����^!n�Y�z�w;��k�eXQQ��[�X(Tr�fe��V���vA��c�TY:Y�W��5g��5�AR�`X���\E��O����%Zv`�S|bO���i`�?Q3�\u�1m�N0��SZO{OON��l�s�^ju�
j�w��A~�Q�p�Sԏ�)��rm��lJW���e��?b2��Y�N���~>e�^�aUޘ��*S�� T���^�l9���Z�)TlR�~_Wq~l�|KY�N�_$a�|0N\�g��\�Θ�u�p"��Q��IY�Q[O&T+Ywe��u[vb�b��E^l&{O�O
gnm�m�y��_+u�b���Oܑ�e/�Q��^P�t�oR��K�
Y�P�N�6ry���[��D��Y�TvVV�9e�i���v�nr^uFg�g�z��v�a�ybec��QR��8���~�\/n`g�{�vؚ����|dP�?zJT�TLkdb=��urRi�[�<h�����*NT�~9hߍ��f�^��W?��h�];e�Rm`���O��lQ�[_�]^l�b!�qQ���R�l߂�r�W�g-�Y��ǃ�T�{0O�ld[�Y��Sʆ��7���Ee~��Vǖ.R�tPR�[c�VN�b*`�hsQ�[�Q‰�{��P�`Lp/�IQ^�ptĉ-WExR_����h�<��xvBh�g�5�=R���n�h��V�g��Ǐ�T��i[wm&l�N�[��c��a���+T�m�[�Q�UU��dMc�e�a�`
qWlIl/Ymg*��X�Vj��kݐ}Y��SimuT�Uw�σ8h�y�TUOT�v����l�mk��d�:�?Vў�u�_�rh`�T�N*ja�R`p��T�py�?�*m�[_�~�U�O4s<T�SPT|TNN�_Zt�Xk��t��r�|Vn'_N�,U�b�N�l7b���TNS>s�n;uRS݋�i�_`�mOW"k�sSh؏bc�`$U�ub�q�m�[{^R�LaĞ�xW�'|�v�Q�`LqCfL^M`�pp%c���_b`Ԇ�V�k�`gaIS�`ff?��yO�pGl����~d�fZZB�Qm�mA�;mOkp��b�`
�'�xy�Q>W�W:gxu=z�y�{��e����o��!��Y�~		T�g�h��M|Ɩ�S%`�urlsS�Z�~$c�Q
��]߄�b�Qc[OmyBR�`Nm�[�[�����e�_E��Y�~�~	V�g9YsO�[�RZ���>�2u��GP<z�N�g~��Z|k�vZW\:{�Nq|Q��p�xY'��h�g�xwx�bac�{�OjR�QP��it���1���.��{�NeP0�QRo�n�n�m�^�P�Y\Fm_l�u��hhVY�� Sq�M�I�iy&q���NʐGm��Z�Vd��w�O��r҉z�4�~RYeu�����S�z�c�c�v�yW�6�*b�R��Thpgwckw�zm�~��YbɅ��LuP�N�u�J\�]K{�eё�N%m_�'}&��N(�ۏs�Kf�yя�pxm=\�RF�bQ�[wvf���N�`�|�|�~�Nf�of��Y��Xle\��_�uV��z�z�Q�p�z�cvz�~�s�ENxp]NR��SQe�e����T1\�u���b�r�uE\y�ʃ@\�T�w>N�lZ��bnc�]wQݍ�/��O�S�`�pgRPcC�Z&P7wwS�~�d+e�b�cP5rɉ�Q���~GW̃���QT�\�O�zZmᐏ��U�TaS�T_�cwi�Qha
R*X�RNW
xw�^wa�|[b�b�N�p��b�p`�wWۂ�g�h�x���y�X�T�S4nKQ;R�[����CU�Ws`QW-TzzP`T[�c�b�Scb�[�g�T�z�w��^�8Y�Wc��WWw{�O�_�[>k!SP{�rFh�w6w�e�Q�N�v�\�zu�NYA��P��'a�ndWfFc�V�bib�^��W�b�U!�J���fU��egV�݄jZh�b�{�pQ�o0��cȉ�a�p�nt�i�r�^ΐgjm^c�Rbr�lO�Yj��p�m�RPN��m�~��x/}!Q�W�d��{|�l�h^i�Q�S�h�rΞ�{�r�yotNg̑��<y��T�Th=N�S�R>x�S)R�P�O�O�u�z�|�l���R�t�T�OT���ޏp��^`�m^[e8���K`�p�~�|�Q�h�|o�$N��ϑ~f�N��dJ��P�u�q�[��fo�N�dc��^�eRˆ�p�Rs3t�g�x�4N��ޜ�m�QA�T�b�s���Ô6O��Qupu��\���S�N�n	t�ikx��YuR$vAm�gmQ��K��T<{�z���W�bG�|iZd�{oK���bS���^�p�cdSO������x2��B��^o�yU_F�.bt�Tݔ�O�ee\a\Q�/l�_�s�n�~�\cj[�nuSqN�ceu�bn�&O�N�l�~�����W;�#��{����=�m���~�Y���sx��l���VT�WpN��VSȏ	��w����n��fba+o)���+��vl�_��+s���k�wƔoS��Q=^��8�HN�s�g�hv�	�dq�l	w�ZA��k�'f�[�Y�Z���N����j�v0�s�h_[/w��a��|���%_s|�yʼn�l��[B^�h w�~�QMQ�R)Zb�ׂ�c�wЅ�y:n�^�Y�mpl�b�vOe�`��f��#��
T}T,�xdyd�!j���xidT��b+g���X؞�l o�[L��_r�g�bar�N�Y�k�X�fU^�RUa(g�vfwgrFz�b�TPT����Z�~lCNvY�HYWS7u���V c�|`���mbT���Q�Z���Y�*P�l<\�b`O?S{���n+��bt^�x�d{c�_Z��?\OcB�}[nUJ�M��m�`�g�r�Q�[�b�l[rmb���~�Sm�Q_tY�R`sY�fP��u*c�a�|���T'k%��kՅUTvP�ljU��,r^`6t�b�cLr�_Cn>meXo�v�x�vTu$R�SSN�^�e*�ր�b�T(R�p��э�lxTڀ�W�T�j�M�iO�l�U�v0x�b�p�om_��h|x�{��gO�gc�xoWx9�yb�b�R5t�kdU>��u�v9S�u�PA\l��{OPGr��ؘo�thy�d�w�b��+��TX�RNjW��
�s^�Q�tċO\aW�l��FZ4xD�돕|VRQb���N��a�郲��W4gWnffm1��fpg:khb�YN�Qo�g�lvQ�hGYgkfu]�P��eHyAy��w��\^NO/TQYxhVlď_}l�l���cp`=murfb��ŔCS��~{�N&�~NԞ����MR\oc�Em4�XL] kIk�g[TT���X7�:_�bGj9�re�`eh�wTN�O�]���d��\�O�zR�N/`�z���O�N�y4t�R���d�y�[�lR�{�"l>PSn�dtf0l�`w����^<twz�yN��tBl�VK��l��:SƆ�f��H\q� n�S6Z�����SW��Cg���lhQ�u�b�r8R�R:�p8vtSJ��inx��و�6q�q�Q�g�t�Xe�V��v�pb�~�`�p�X�N�N�_�N��R�Y�~Tb�N�eb8�Ʉc����q�n�[�~�Q�c�g��9��Qz[�Y��sN]leQ%�o�.�J�^t��m�1_�dm(�n�Ü^X[�	N�SOceQh�U'Nd��kb�Z_tr��m�h�P��x@g9R�l�~�PeU^q[{Rf�s�Igq\ R}qk��U��da����UUlGb.�X$OFUO�Lf
N\�hNc
z�p���R��\�T���~bYJ�dž�
�f�Dd\Qa�m>y��7x3u{T8O���m Z�~^y�l�[vZu��Nan�Xu%urrGS�~w�viR܀#W^1Y�r�en׋8\q�AS�w�b�e�Nߘ���[Ƌ�S�wON\v��Y_:y�XN�g�N�b����R/f�UlV��N�Oʑp�l^C`�[ƉՋ6eKb���[�[�c.U�S&v}Q,��g�h�k�b���S��m�ufNN�p[�q���f�fr�͞ �^\/g�h_g
b�z�X�^pe1oU`7R
�Tdp�)u^h�b��S=r�4lawz.T�wz���Uxg�p�e�d6V`�y�SN{k���[�U�V:O<Or��]~g8�`����[����dX��d�Uςe��O }��|�PQX�n�[ɋ��x����{}������~Ӛ�x�\WzB���_yY[_c{ф�hU)t"}�@bLX�N�[yYTXmscK��΀Ԃ�b�S�l^�*Y`plMWJd*�+v�n[W�j�umo-��fW�k���x�c�S�pdlXX*dX�h��U�|P���m���p�c�m�n�~�Ch��mv���WYyr�~��u���hTR"���c��D�|USO�f�V�`�mCRI\)Y�mkX0uul`�F�cag�:w�4���^�S,T�p@l�^\P�N�^:cG��Phn��wTܔd_�zvhEcR{�~�uwP�b4Y��Q�y�z�V�_��m`\WTTQMn�V�c����*��To\���bXb1�5�@�n�|�-i�Y�b>Uc�Tن<mZ�t��jkYL�/_~n�s}�8N�p�[�x=cZf�v�`�[IZNU�jl�s�N�gQ�_�eg�_�YZ�]�_qS�ݏEh�V/U�`:NMo�~ǂ��YO*O>\�~*g�sTOuÀ�UO�MO-n�	\pakSv)n���e���~;T3z
}��U��tc��m�zb�egS�c�l�]\T��LNal�K\�e���h>T4T�kfk�NBcHS�
O�O^W
b��dfir�R�R�`�f�q�g�Rx�wpf;V8T!�zrzo`^�`��Y�`�q�p�nPl�r�j��-^`N�Z�U�m�|��b�~�w~�#S����f�\�O�rN�SYT�c(�HQ�N���~�T$�T�7��m&_�Z>fi��s.s�Sz�����[w�P��~�v�Sv����{D�XnaN�ey��`�T�Ny��]aj�PTa�'�]x�JR�T�V��m�[�mSf\][!h��xU{HeTi�NGkN���OSc:d���e����Q�hxS���a�l�l"�Q\�����#k���e�_�_�OE�fe�)s�`tQR�Wb_��L���x^Og'`�YDQ�Q��SylĖ�qO�O�=g�U��y���~�Xb�Z�V{��_��ĄW��S�e�^\ud`n}Z�~�~i��U�[�`�e�s	�cv)w�~t���f[tz�@��R�q�_�e�[o��]�k[l����
�ŏ�S�b&�-�@T+N��Yr��]Y��mŖ�T�N��	q�T	��p�m�v%Nx��\�^�����p�lDY�c<wM�os�0X�q�Sx��Uf_0q�[����k.Y/��yhglboO�u�m3�'l�N�u{Q7h>o��p��YvtGd'\e��z#��Y�T�o����0iNV6�7rΑ�Q_Nu��cN�S�fK�Y�mN�X;S�c�O
Oc���7YW��y�N�u�l�[�Y]_i��P�]YN�w�Nz��bf��y\�Ny_Ɓ8����u�NԈa�k�_IN�v�n㋮�
�ы_���~5�k��V�k�4��YT���m�[n�9\_��pS�1jtZp��^(��$�%�g�G�Ώb��vq_��lx f�T�bcOÁ�u�^͖
����T�l�m8l`�R(u}^O�`�_$\1u�����r�l8nI�	g�S�SQOɑ��S|^�m�N�v�i^�a�YO�O>�|�	ann���N1Z�N\�y�[틽�s�W����TG��U�\�_a2k�r����tm�[Ո��k�m�3�
n�QCQ�W���S�c���VXTW?s�n܏т?a(`b��f�~��Í���\�|g�`���N�Sh�AQЏt�]�Uf��U[S8xBg=h�T~p�[}��Q(W�Te�f^�C��l�m��|�Q���g�e�o����jV ��vvp�q#��bR�l<�`�X�a�f`�Nb�U#n-gg���(wh�i�TMN�pȋXd�e�[�z:P�[�w�ky��|�l�v�e��-]U\8�h`Sb�z[n�~j�zp_3o _�c�mVgN^&��N��4v���b-f~b�lu�gqiFQ���Sn��b�T����ُYm�s�ewu'x������O�g�uʋ�/cG�5���#cAw�_�r�N`te�bck?e'^�uѐ�����g/e1T��w���AlKN�~L��v
i�kgb<P�O@Wcbk���S�e�~�_c�c��n^�\6Rzf�yz(��p�u�n�l�z-N�v�_��w��~�y��͑�NO�hT�]2m̋�|t���^�T�v�[<f���s*hۆ1g*s��ۋ��z�pnq�b�w1V;NW��g�R��.���Q{OO�l]y{��b*r�bNxl��dZ��{ih�^ň�Y�d�X�ri%���X�`W��QIc�bSSLh"t�L�DU@w|pJmyQ�TD��Y�n�m\[+}�N}|�nP[�
nW[��h*��[�~;`�~��p�OY�c�y��RS�eVyŋ;��~���~4V��gj
\u�(f�]PO�gZP\OPW�^�NN@QN�^ESN�NN2�l[iV(N�y?NSGN-Y;rnSl�V䀗��k~w�6N�N�\NiN�N��[[lUV�N�S�S�S�S�Se�]�S�S&S.S>S\�fScSRRR-R3R?R@RLR^RaR\R��}R�R�R�R�R�QT�N�N�N�N�N�N�N�NO�N"OdO�N%O'O	O+O^OgO8eZO]O_OWO2O=OvOtO�O�O�O�O~O{O�O|O�O�O�O�O�O�O�O�O�O�O�O�O)PLP�O,PP.P-P�OPP%P(P~PCPUPHPNPlP{P�P�P�P�P�PQ�P�P�P�PQQ�N=lXOeO�O��Flt|nQ�]ɞ���QY�R
S�S�QYUQ�NVQ�Nn����N�҈�y4[���Q�Q�Q�Q�Q�Q�Q�Q��������������‹Ëˋϋ΋ҋӋԋ֋؋ً܋ߋ����������������������������� �!�%�'�*�+�.�/�2�3�5�6�iSzS�"�!�1�*�=�<�B�I�T�_�g�l�r�t���������������������������������ϐŐ��АĐǐӐ��ܐאې����"��#�1�/�9�C�F�
RBY�R�R�R�R�T�R�R�R�S�q�w�^�Q�Q/��S_Zu�]LW�W�W~X�X�X�X)W,W*W3W9W.W/W\W;WBWiW�WkW�W|W{WhWmWvWsW�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�WX
X�W�WXXXDX XeXlX�X�X�X�X����ay�}��������������������������Ȃʂ゘�����˂̂������������Ă΂���	������܂�҂؂���ӂ������Ղ�Q�[�\����<�4�1���^�/�O�G�C�_�@��`�-�:�3�f�e�h��i�l�j�m�n���x���������������|�����}���{���������������؃X��݃��փ�8���ԃ߃�������Ń��&���\�Q�Z�Y�s�����z���x�<�F�i�v�����1�m���̈́Є愽�ӄʄ���������������
u8��9��:�V�;�����Y�H�h�d�^�z��wC�r�{���������y�������������Ӆ��܅��'��)��<��^_<YAY7�UYZYXYS"\%\,\4\Lbjb�b�b�b�b�b�b"c�b9cKcCc�c�cqczc�c�cmc�c�cic�c�c�c�c�c�c�c�c�cRd�c�cEdAddd dd&d!d^d�dmd�dzd�d�d�d�d�d�d�d�d�d	e%e.e_�_u__S�S�S�S�S�STTTKTRTSTTTVTCT!TWTYT#T2T�T�TwTqTdT�T�T�TvTfT�T�T�T�T�T�T�T�T�T�TrT�T�T�T�T�T�T�T�T�T�T�T�T�T�TU�T U�TU�T"U#UUU'U*UgU�U�UIUmUAUUU?UPU<U7UVUuUvUwU3U0U\U�U�U�U�U�U�U�U�U~U�U�U{U�U�U�U�U�U�U�U�UV�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U��VVVV$V#V�UV'V-VXV9VWV,VMVbVYV\VLVTV�VdVqVkV{V|V�V�V�V�V�V�V�V�V�V�V�VW
W	WW^^^^1^;^<^7^D^T^[^^^a^�\z\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\]]']&].]$]]]]X]>]4]=]l][]o]]]k]K]J]i]t]�]�]�]s��]�]s_w_�_�_�_�_�_�_�_�_�_�_�_b�a_�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rs�rs�r�rss!s
ssss"s9s%s,s8s1sPsMsWs`slsos~s�%Y�$YYc�g�h�i�j�k�l�t�w�}����������������������^�^�^�^�^�^�^�^�^�^S��^�^�^�^�^���_�_�_�_`�_`�_�_�_``�_�_�_`5`&```
`)`+`
`?`!`x`y`{`z`B`j`}`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�` a&aa#a�`aa+aJaua�a�a�a�a�a�a�_����������������
���
��������,N?rb5lTl\lJl�l�l�l�l�lhliltlvl�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l9m'mmCmHmmmmm+mMm.m5mmOmRmTm3m�mom�m�m^m�m�m\m`m|mcmn�m�m�mn�m�mn�m�m�mn�mn�m+nnnNnkn�n_n�nSnTn2n%nDn�n�n�n�n-o�n�n�n�n�n�n�n�n�n�n�n�nboFoGo$oo�n/o6oKoto*o	o)o�o�o�oxoro|ozo�o�o�o�o�o�o�o�o�o�o�op#pp9p5pOp^p�[�[�[�[�[�[/u��4d�[�[0��[G����ӏՏ����������&��
��!�5�6�-�/�D�Q�R�P�h�X�b�[��ft�}���������P_W_V_X_;\�TP\Y\q[c\f\�*_)_-_t�<_;�n\�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�YZZ�YZ�Y�Y�YZ	Z2Z4ZZ#ZZ@ZgZJZUZ<ZbZuZ쀪Z�ZwZzZ�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z	[[[2[7[@[\\Z[e[s[Q[S[b[u�w�x�z��}����������������������������������������~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~
�~�~�~�~!"#$%&'*+,-/01235z^u�]>u���s�s�s�s�s�s�s�s�s�s�s�s�s�s�s|�
t�s�s�s�s�st*t[t&t%t(t0t.t,tttAt\tWtUtYtwtmt~t�t�t�t�t�t�t�t�t�t�t�t�t�t���LgSg^gHgig�g�gjgsg�g�gug�g�g�g�gwg|g�g	h�g
h�g�gh�g�g�g�g�gh�g�g�gh�g�g2h3h`hahNhbhDhdh�hhUhfhAhgh@h>hJhIh)h�h�hthwh�hkh�hni�hi i�h$i�hiiWi�hiqi9i`iBi]i�iki�i�ixi4i�i�i�i�i�ificiyi�i�i�i�i�i�i�i�i�i�i�i�i�i�i/j�ijjej�iDj>j�jPj[j5j�jyj=j(jXj|j�j�j�j�j�j7sRs�k�k�k�k�k�k�k�k�k�k�kk�m�q�r�s�u�v�x�w�y�z�|�~���������������������Ύbbbb"b!b%b$b,b��t�t�tuuu4e�e�e�e
ffrgfff�p�ff4f1f6f5f�_fTfAfOfVfafWfwf�f�f�f�f�f�f�f�f�f2�3�6�;�=�@�E�F�H�I�G�M�U�Y�ljʉˉ̉ΉωЉщnr�r]rfror~rr�r�r�r�r�rc2c�c?d�d��k�k�k�k�klll
lllll!l)l$l*l2l5eUekeMrRrVr0rb�R��������
g����������������ۀ€Āـ̀׀g݀����
���g�Z�6��,��2�H�L�S�t�Y�Z�q�`�i�|�}�m�g�MX�Z�������n����́&gʁ������$k7k9kCkFkYkјҘӘ՘٘ژ�k@_�k�eQ��e�e�e�e�e�e�e�e�e�p�p�p�p�p�p�p�p�p�p�pqqq/q1qsq\qhqEqrqJqxqzq�q�q�q�q�q�q�q�q�qr(rlpqfq�q>b=bCbHbIb;y@yFyIy[y\ySyZybyWy`yoygyzy�y�y�y�y�y�_�_<`]`Z`g`A`Y`c`�`a
a]a�a�a�a�ab����l�l�m�w�wx	xxxx�e-xxx9x:x;xx<x%x,x#x)xNxmxVxWx&xPxGxLxjx�x�x�x�x�x�x�x�x�x�x�x�x�x�x�xy�xy$yy4y���������vw
w�vwww"ww-w&w5w8wPwQwGwCwZwhwbweww�w}w�w�w�w�w�w�w�w�w:u@uNuKuHu[uruyu�uXa_H�htqy�~�v�v2�������������������������������������������������������������������ĔȔɔʔ˔͔̔ΔДєҔՔ֔הٔؔ۔ޔߔ���������������������������	�
�
�������������"�*�+�)�,�1�2�4�6�7�8�<�>�?�B�5�D�E�F�I�L�N�O�R�S�T�V�W�X�Y�[�^�_�]�a�b�d�e�f�g�h�i�j�k�l�o�q�r�s�:��w�wɖ�y�y�y�yzG]zzzz9z7zQzϞ��pz�v�v�v�v�v�t�t,u �"�(�)�*�+�,�2�1�6�8�7�9�:�>�A�B�D�F�G�H�I�K�L�N�Q�U�W�Z�[�\�^�c�f�g�h�i�j�k�l�q�m�s��u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�uv�u�u�uvvvvv
v%vvvvv<v"v v@v-v0v?v5vCv>v3vMv^vTv\vVvkvov��zxzyz�z�z�z�z�z�z�z�z�z�zd�i�r�}������ƈ����Ɉ�Έ���������!����
�4�+�6�A�f�{��u倲v�v�w���� �"�%�&�'�)�(�1��5�C�F�M�R�i�q���x�������������������������������M�T�l�n��z�|�{�����������������������Ć��Ά��������Ɇφ�������І�ކ�߆؆ц�����
�
�	�#�;��%�.��>�H�4�1�)�7�?���"�}�~�{�`�p�L�n���S�c�|�d�Y�e�������҇Ƈ������������凬�����ˇӇ��ч��ʇۇ�������
��!�9�<�6BDE��z�z{{{{
{+{{G{8{*{{.{1{ {%{${3{>{{X{Z{E{u{L{]{`{n{{{b{r{q{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{|�{�{||||*|&|8|A|@|������D�!�"�#�-�/�(�+�8�;�3�4�>�D�I�K�O�Z�_�h�~�����؈߈^�������||Ie�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|n��f����������|w}�}�}G~�~����s���������g�m�G�I�J�P�N�O�d�b�a�p�i�o�}�~�r�t�y�����������������������������U�~�����Y�i���������č֍׍ڍލ΍ύۍƍ���������	������,�.�#�/�:�@�9�5�=�1�I�A�B�Q�R�J�p�v�|�o�t�������������x������������e։މډ܉���>�&�S���������*�-�0�>����������������������
�������ΖҖ�w����Ȓ>�j�ʓ��>�k������������#z����������������������������������������������������������������������ĜŜƜǜʜ˜̜͜ΜϜМӜԜ՜ל؜ٜܜݜߜ�|�������������������������X�����������ښ˚̚њE�C�G�I�H�M�Q��
�.�U�T�ߚ�����������#�����;~����������֓����۞ܞݞ�ߞ������"�,�/�9�7�=�>�D�NNNNNNNN N!N#N&N)N.N/N1N3N5N7N<N@NANBNDNFNJNQNUNWNZN[NbNcNdNeNgNhNjNkNlNmNnNoNrNtNuNvNwNxNyNzN{N|N}NN�N�N�N�N�N�N�N�N���N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�NOOOOOOOOOOOOOOOOO!O#O(O)O,O-O.O1O3O5O7O9O;O>O?O@OAOBODOEOGOHOIOJOKOLOROTOVOaObOfOhOjOkOmOnOqOrOuOwOxOyOzO}O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�OPPPPPPPPP	P
P��PPPPPPPPPPP P"P#P$P'P+P/P0P1P2P3P4P5P6P7P8P9P;P=P?P@PAPBPDPEPFPIPJPKPMPPPQPRPSPTPVPWPXPYP[P]P^P_P`PaPbPcPdPfPgPhPiPjPkPmPnPoPpPqPrPsPtPuPxPyPzP|P}P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�PQQQQQQQ��	Q
QQ
QQQQQQQQQQQQQQQQQQ Q"Q#Q$Q%Q&Q'Q(Q)Q*Q+Q,Q-Q.Q/Q0Q1Q2Q3Q4Q5Q6Q7Q8Q9Q:Q;Q<Q=Q>QBQGQJQLQNQOQPQRQSQWQXQYQ[Q]Q^Q_Q`QaQcQdQfQgQiQjQoQrQzQ~QQ�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�QRR	RRRRRRRRRRR!R"R#R%R&R'R*R,R/R1R2R4R5R<R>RDRERFRGRHRIRKRNRORRRSRURWRXR��YRZR[R]R_R`RbRcRdRfRhRkRlRmRnRpRqRsRtRuRvRwRxRyRzR{R|R~R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�RSSSSS	S
SSSSSSSSSSSSS"S$S%S'S(S)S+S,S-S/S0S1S2S3S4S5S6S7S8S<S=S@SBSDSFSKSLSMSPSTSXSYS[S]SeShSjSlSmSrSvSyS{S|S}S~S�S�S�S�S�S�S�S�S���S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�STTTTTTTTTT"T$T%T*T0T3T6T7T:T=T?TATBTDTETGTITLTMTNTOTQTZT]T^T_T`TaTcTeTgTiTjTkTlTmTnToTpTtTyTzT~TT�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�TUUUUUU
UUU
UUUUUUUUUUUUUU!U%U&U��(U)U+U-U2U4U5U6U8U9U:U;U=U@UBUEUGUHUKULUMUNUOUQURUSUTUWUXUYUZU[U]U^U_U`UbUcUhUiUkUoUpUqUrUsUtUyUzU}UU�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�UVVVVVV
VV
VVVVVVVVVVVVV V!V"V%V&V(V)V*V+V.V/V0V3V5V7V8V:V<V=V>V@VAVBVCVDVEVFVGVHVIVJVKVOVPVQVRVSVUVVVZV[V]V^V_V`VaV��cVeVfVgVmVnVoVpVrVsVtVuVwVxVyVzV}V~VV�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�VWWWWWWW
WWWWWWWWWWWWWWWWW W!W"W$W%W&W'W+W1W2W4W5W6W7W8W<W=W?WAWCWDWEWFWHWIWKWRWSWTWUWVWXWYWbWcWeWgWlWnWpWqWrWtWuWxWyWzW}W~WW�W���W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�WXXXXX	X
XXXXXXXXXXXXXXXX"X#X%X&X'X(X)X+X,X-X.X/X1X2X3X4X6X7X8X9X:X;X<X=X>X?X@XAXBXCXEXFXGXHXIXJXKXNXOXPXRXSXUXVXWXYXZX[X\X]X_X`XaXbXcXdXfXgXhXiXjXmXnXoXpXqXrXsXtXuXvXwXxXyXzX{X|X}XX�X�X�X�X�X�X�X�X���X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�XYYYYYY	Y
YYYYYYYYYYYYY Y!Y"Y#Y&Y(Y,Y0Y2Y3Y5Y6Y;Y=Y>Y?Y@YCYEYFYJYLYMYPYRYSYYY[Y\Y]Y^Y_YaYcYdYfYgYhYiYjYkYlYmYnYoYpYqYrYuYwYzY{Y|Y~YY�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y���Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�YZZ
ZZ
ZZZZZZZZZZZZZZ!Z"Z$Z&Z'Z(Z*Z+Z,Z-Z.Z/Z0Z3Z5Z7Z8Z9Z:Z;Z=Z>Z?ZAZBZCZDZEZGZHZKZLZMZNZOZPZQZRZSZTZVZWZXZYZ[Z\Z]Z^Z_Z`ZaZcZdZeZfZhZiZkZlZmZnZoZpZqZrZsZxZyZ{Z|Z}Z~Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z���Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z[[[[[[[[[
[[[
[[[[[[[[[[[[[[[[[ [!["[#[$[%[&['[([)[*[+[,[-[.[/[0[1[3[5[6[8[9[:[;[<[=[>[?[A[B[C[D[E[F[G[H[I[J[K[L[M[N[O[R[V[^[`[a[g[h[k[m[n[o[r[t[v[w[x[y[{[|[~[[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[���[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[\\\\\\\\
\\\\\\\\\\ \!\#\&\(\)\*\+\-\.\/\0\2\3\5\6\7\C\D\F\G\L\M\R\S\T\V\W\X\Z\[\\\]\_\b\d\g\h\i\j\k\l\m\p\r\s\t\u\v\w\x\{\|\}\~\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\]��]]]]	]
]]]
]]]]]]]]]]]]]] ]!]"]#]%](]*]+],]/]0]1]2]3]5]6]7]8]9]:];]<]?]@]A]B]C]D]E]F]H]I]M]N]O]P]Q]R]S]T]U]V]W]Y]Z]\]^]_]`]a]b]c]d]e]f]g]h]j]m]n]p]q]r]s]u]v]w]x]y]z]{]|]}]~]]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]���]�]�]�]�]�]�]�]�]^^^	^
^^
^^^^^^^ ^!^"^#^$^%^(^)^*^+^,^/^0^2^3^4^5^6^9^:^>^?^@^A^C^F^G^H^I^J^K^M^N^O^P^Q^R^S^V^W^X^Y^Z^\^]^_^`^c^d^e^f^g^h^i^j^k^l^m^n^o^p^q^u^w^y^~^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^___	__
___________!_"_#_$_��(_+_,_._0_2_3_4_5_6_7_8_;_=_>_?_A_B_C_D_E_F_G_H_I_J_K_L_M_N_O_Q_T_Y_Z_[_\_^___`_c_e_g_h_k_n_o_r_t_u_v_x_z_}_~__�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_``	```````````"`#`$`,`-`.`0`1`2`3`4`6`7`8`9`:`=`>`@`D`E`F`G`H`I`J`L`N`O`Q`S`T`V`W`X`[`\`^`_```a`e`f`n`q`r`t`u`w`~`�`���`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`aaaaa
aaaaaaaaaaaaaaaa!a"a%a(a)a*a,a-a.a/a0a1a2a3a4a5a6a7a8a9a:a;a<a=a>a@aAaBaCaDaEaFaGaIaKaMaOaPaRaSaTaVaWaXaYaZa[a\a^a_a`aaacadaeafaiajakalamanaoaqarasatavaxayaza{a|a}a~aa�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a���a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�abbbbbbb	bbbbbbb b#b&b'b(b)b+b-b/b0b1b2b5b6b8b9b:b;b<bBbDbEbFbJbObPbUbVbWbYbZb\b]b^b_b`babbbdbebhbqbrbtbubwbxbzb{b}b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b���b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�bccccc
ccc
ccccccccccc&c'c)c,c-c.c0c1c3c4c5c6c7c8c;c<c>c?c@cAcDcGcHcJcQcRcScTcVcWcXcYcZc[c\c]c`cdcecfchcjckclcocpcrcsctcucxcyc|c}c~cc�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�cddddd	d
d
dddddddddddd"d#d$d��%d'd(d)d+d.d/d0d1d2d3d5d6d7d8d9d;d<d>d@dBdCdIdKdLdMdNdOdPdQdSdUdVdWdYdZd[d\d]d_d`dadbdcdddedfdhdjdkdldndodpdqdrdsdtdudvdwd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�deeeeeeee
eee
eeeeeeeeeeeeeeeee e!e��"e#e$e&e'e(e)e*e,e-e0e1e2e3e7e:e<e=e@eAeBeCeDeFeGeJeKeMeNePeReSeTeWeXeZe\e_e`eaedeeegeheiejemeneoeqeseuevexeyeze{e|e}e~ee�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�efffff	ff
fffffffffff!f"f#f$f&f)f*f+f,f.f0f2f3f7f8f9f:f;f=f?f@fBfDfEfFfGfHfIfJfMfNfPfQfXf��Yf[f\f]f^f`fbfcfefgfifjfkflfmfqfrfsfufxfyf{f|f}ff�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�fggggggggggggggggggg g!g"g#g$g%g'g)g.g0g2g3g6g7g8g9g;g<g>g?gAgDgEgGgJgKgMgRgTgUgWgXgYgZg[g]gbgcgdgfgggkglgngqgtgvg��xgygzg{g}g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�ghhhhh
hhhhhhhhhhhh h"h#h$h%h&h'h(h+h,h-h.h/h0h1h4h5h6h:h;h?hGhKhMhOhRhVhWhXhYhZh[h\h]h^h_hjhlhmhnhohphqhrhshuhxhyhzh{h|h}h~hh�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h���h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�hiiiiiii	i
iiiiiiiiiiiiiiii!i"i#i%i&i'i(i)i*i+i,i.i/i1i2i3i5i6i7i8i:i;i<i>i@iAiCiDiEiFiGiHiIiJiKiLiMiNiOiPiQiRiSiUiViXiYi[i\i_iaibidieigihiiijilimioipirisitiuivizi{i}i~ii�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i���i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�ijjjjjjjjj	jjj
jjjjjjjjjjjjjjjj j"j#j$j%j&j'j)j+j,j-j.j0j2j3j4j6j7j8j9j:j;j<j?j@jAjBjCjEjFjHjIjJjKjLjMjNjOjQjRjSjTjUjVjWjZj\j]j^j_j`jbjcjdjfjgjhjijjjkjljmjnjojpjrjsjtjujvjwjxjzj{j}j~jj�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j���j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�jkkkkkkkkk	k
kkk
kkkkkkkkkkkkkkkkkkk%k&k(k)k*k+k,k-k.k/k0k1k3k4k5k6k8k;k<k=k?k@kAkBkDkEkHkJkKkMkNkOkPkQkRkSkTkUkVkWkXkZk[k\k]k^k_k`kakhkikkklkmknkokpkqkrksktkukvkwkxkzk}k~kk�k�k�k���k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�kllllll	l
lllllllll l#l%l+l,l-l1l3l6l7l9l:l;l<l>l?lClDlElHlKlLlMlNlOlQlRlSlVlXlYlZlblclelflglklllmlnlolqlslulwlxlzl{l|ll�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l���l�l�l�l�l�l�l�l�l�l�l�l�l�l�lmmmmmm	m
m
mmmmmmmmmmmm m!m"m#m$m&m(m)m,m-m/m0m4m6m7m8m:m?m@mBmDmImLmPmUmVmWmXm[m]m_mambmdmemgmhmkmlmmmpmqmrmsmumvmymzm{m}m~mm�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�mnnnnnnnn	nnnnnnnnnnnn"n&n'n(n*n,n.n0n1n3n5n��6n7n9n;n<n=n>n?n@nAnBnEnFnGnHnInJnKnLnOnPnQnRnUnWnYnZn\n]n^n`nanbncndnenfngnhninjnlnmnonpnqnrnsntnunvnwnxnynzn{n|n}n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�nooooooo
ooo
ooooooooooooooo!o"o#o%o&o'o(o,o.o0o2o4o5o7o8o9o:o;o<o=o?o@oAoBo��CoDoEoHoIoJoLoNoOoPoQoRoSoToUoVoWoYoZo[o]o_o`oaocodoeogohoiojokolooopoqosouovowoyo{o}o~oo�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�oppppppppp	p
ppp
pppppppppppppppp p!p"p$p%p&p'p(p)p*p��+p,p-p.p/p0p1p2p3p4p6p7p8p:p;p<p=p>p?p@pApBpCpDpEpFpGpHpIpJpKpMpNpPpQpRpSpTpUpVpWpXpYpZp[p\p]p_p`papbpcpdpepfpgphpipjpnpqprpsptpwpypzp{p}p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�pqqqqqqqqqqq
qqqqqqqqqqqq q!q"q#q$q%q'q(q)q*q+q,q-q.q2q3q4q��5q7q8q9q:q;q<q=q>q?q@qAqBqCqDqFqGqHqIqKqMqOqPqQqRqSqTqUqVqWqXqYqZq[q]q_q`qaqbqcqeqiqjqkqlqmqoqpqqqtquqvqwqyq{q|q~qq�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�qrrrrrrrr	r
rrr
rrrrrrrrrrrrrr��rrrr r!r"r#r$r%r&r'r)r+r-r.r/r2r3r4r:r<r>r@rArBrCrDrErFrIrJrKrNrOrPrQrSrTrUrWrXrZr\r^r`rcrdrerhrjrkrlrmrprqrsrtrvrwrxr{r|r}r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r����������� p!q!r!s!t!u!v!w!x!y!5�6�9�:�?�@�=�>�A�B�C�D�����;�<�7�8�1���3�4����  % 5 !	!�!�!�!�!""#"R"f"g"�"P%Q%R%S%T%U%V%W%X%Y%Z%[%\%]%^%_%`%a%b%c%d%e%f%g%h%i%j%k%l%m%n%o%p%q%r%s%�%�%�%�%�%�%�%���%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%	&�"000��������������������������������������������������������������������������Q��DH��a!0"0#0$0%0&0'0(0)0�2�3�3�3�3�3�3�3�3�3�3�30����!!12�� �������0�0�0�0�00�0�0I�J�K�L�M�N�O�P�Q�R�T�U�V�W�Y�Z�[�\�]�^�_�`�a���b�c�d�e�f�h�i�j�k���������������������������0�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rsssssss	sss
ssssssssss s#s$s&s's(s-s/s0s2s3s5s6s:s;s<s=s@sAsBsCsDsEsFsGsHs��IsJsKsLsNsOsQsSsTsUsVsXsYsZs[s\s]s^s_sasbscsdsesfsgshsisjsksnspsqsrssstsusvswsxsyszs{s|s}ss�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s���s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�stttttttt
ttttttttttttttt t!t#t$t't)t+t-t/t1t2t7t8t9t:t;t=t>t?t@tBtCtDtEtFtGtHtItJtKtLtMt��NtOtPtQtRtStTtVtXt]t`tatbtctdtetftgthtitjtktltntotqtrtstttutxtytzt{t|t}tt�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t���t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�tuuuuuuuu	u
uuuuuuuuuuuuu u!u"u#u$u&u'u*u.u4u6u9u<u=u?uAuBuCuDuFuGuIuJuMuPuQuRuSuUuVuWuXu��]u^u_u`uaubucuduguhuiukulumunuoupuqusuuuvuwuzu{u|u}u~u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�uvvvv��v	vv
vvvvvvvvvvvv!v#v'v(v,v.v/v1v2v6v7v9v:v;v=vAvBvDvEvFvGvHvIvJvKvNvOvPvQvRvSvUvWvXvYvZv[v]v_v`vavbvdvevfvgvhvivjvlvmvnvpvqvrvsvtvuvvvwvyvzv|vv�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v���v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�vwwwww
wwwwwwwwwwwwwwwww!w#w$w%w'w*w+w��,w.w0w1w2w3w4w9w;w=w>w?wBwDwEwFwHwIwJwKwLwMwNwOwRwSwTwUwVwWwXwYw\w]w^w_w`wdwgwiwjwmwnwowpwqwrwswtwuwvwwwxwzw{w|w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w���w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�wxxxxxx
xxxxxxxxxx x!x"x$x(x*x+x.x/x1x2x3x5x6x=x?xAxBxCxDxFxHxIxJxKxMxOxQxSxTxXxYxZx��[x\x^x_x`xaxbxcxdxexfxgxhxixoxpxqxrxsxtxuxvxxxyxzx{x}x~xx�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x���x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�xyyyyyyy	y
yyy
yyyyyyyyyyyyyyyyy y!y"y#y%y&y'y(y)y*y+y,y-y.y/y0y1y2y3y5y6y7y8y9y=y?yByCyDyEyGyJyKyLyMyNyOyPyQyRyTyUyXyYyaycy��dyfyiyjykylynypyqyrysytyuyvyyy{y|y}y~yy�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y���y�y�y�y�y�y�y�y�y�y�y�y�y�yzzzzz	z
zzzzzzzzzzzzzzz!z"z$z%z&z'z(z)z*z+z,z-z.z/z0z1z2z4z5z6z8z:z>z@zAzBzCzDzEzGzHzIzJzKzLzMzNzOzPzRzSzTzUzVzXzYzZz[z\z]z^z_z`zazbzczdzezfzgzhz��izjzkzlzmznzozqzrzszuz{z|z}z~z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z���z�z�z�z�z�z�z�z{{{{{	{{
{{{{{{{{{{{{!{"{#{'{){-{/{0{2{4{5{6{7{9{;{={?{@{A{B{C{D{F{H{J{M{N{S{U{W{Y{\{^{_{a{c{d{e{f{g{h{i{j{k{l{m{o{p{s{t{v{x{z{|{}{{�{�{�{�{�{�{�{�{�{�{�{�{�{���{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{||||||||	|
|
|||||||||||��||||| |!|"|#|$|%|(|)|+|,|-|.|/|0|1|2|3|4|5|6|7|9|:|;|<|=|>|B|C|D|E|F|G|H|I|J|K|L|N|O|P|Q|R|S|T|U|V|W|X|Y|Z|[|\|]|^|_|`|a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|u|v|w|x|y|z|~||�|�|�|�|�|�|�|�|���|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|}}}}}}}}}	}}}
}}}}��}}}}}}}}}}}}}}}!}#}$}%}&}(})}*},}-}.}0}1}2}3}4}5}6}7}8}9}:};}<}=}>}?}@}A}B}C}D}E}F}G}H}I}J}K}L}M}N}O}P}Q}R}S}T}U}V}W}X}Y}Z}[}\}]}^}_}`}a}b}c}d}e}f}g}h}i}j}k}l}m}o}p}q}r}s}t}u}v}��x}y}z}{}|}}}~}}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}���}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}~~~~~~~~~	~
~~~
~~~~~~~~~~~~~~~~~~~ ~!~"~#~$~%~&~'~(~)~*~+~,~-~.~/~0~1~2~3~4~5~6~7~8~9~��:~<~=~>~?~@~B~C~D~E~F~H~I~J~K~L~M~N~O~P~Q~R~S~T~U~V~W~X~Y~Z~[~\~]~^~_~`~a~b~c~d~e~f~g~h~i~j~k~l~m~n~o~p~q~r~s~t~u~v~w~x~y~z~{~|~}~~~~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~���~�~�~�~�~�~�~�~
79;<=>?@ACFGHIJKLMNORSVY[\]^`cdefgklmopsuvwxz{|}���������������������������������������������������������������������������������������������	�
����������!�#�$�+�,�-�.�/�0�2�4�9�:�<�>�@�A�D�E�G�H�I�N�O�P�Q�S�U�V�W���Y�[�\�]�^�_�`�a�b�c�d�e�f�g�h�k�l�m�n�o�p�r�s�t�u�v�w�x�y�z�{�|�}�~���������������������������������������������������������ŀǀȀɀʀˀπЀрҀӀԀՀ؀߀���������������������������������� �!�"�#�$�%�&�'�(�)�*�+�-�.�0�3�4�5�7�9�:�;�<�=�?�@�A�B�C�D�E�G�I�M�N�O�R�V�W�X�[�\�]�^�_�a�b�c�d�f�h�j�k�l�o�r�s�u�v�w�x�������������������������������������������������������������������������������������������������āŁǁȁɁˁ́΁ρЁсҁӁԁՁցׁ؁فځہ܁݁ށ߁�������������������������������	�
������������� �$�%�&�'�)�.�2�:�<�=�?���@�A�B�C�E�F�H�J�L�M�N�P�Q�R�S�T�U�V�W�Y�[�\�]�^�`�a�b�c�d�e�f�g�i�j�k�l�m�q�u�v�w�x�{�|���������������������������������������������������������‚ÂłƂɂЂւقڂ݂����������������������������
��
���������� �!�"�#�$�%�&�)�*�.�0�2�7�;�=�>�?�A�B�D�E�H�J�K�L�M�N�S�U�V�W�X�Y�]�b�p�q�r�s�t�u�v�y�z�~������������������������������������������������������������������������������ƒÃăƃȃɃ˃̓΃Ѓу҃ӃՃ׃كڃۃރ��������������������������������	�
������������� �!�"�#�)�*�+�,�-�.�/�0�2�3�4�5�6�7�9�:�;�>�?�@�A�B�C�D�E�G�H�I���J�K�L�M�N�O�P�R�S�T�U�V�X�]�^�_�`�b�d�e�f�g�h�j�n�o�p�r�t�w�y�{�|�}�~����������������������������������������������������������������������������������������������„ÄńƄDŽȄ˄̄΄τ҄ԄՄׄ��؄لڄۄ܄ބ����������������������������������������	�
��
�������������� �"�#�$�%�&�'�(�)�*�-�.�/�0�1�2�3�4�5�6�>�?�@�A�B�D�E�F�G�K�L�M�N�O�P�Q�R�S�T�U���W�X�Z�[�\�]�_�`�a�b�c�e�f�g�i�j�k�l�m�n�o�p�q�s�u�v�w�x�|�}��������������������������������������������������������������������������������������������������������…ÅąŅƅDžȅʅ˅̅ͅ΅х҅��ԅօׅ؅مڅۅ݅ޅ߅�������������������������������������������	�
���
����������������� �!�"�#�$�%�&�(�*�+�,�-�.�/�0�1�2�3�4�5�6�7�9�:�;�=�>�?�@���A�B�C�D�E�F�G�H�I�J�K�L�R�S�U�V�W�X�Y�[�\�]�_�`�a�c�d�e�f�g�h�i�j�m�o�p�r�s�t�u�v�w�x���������������������������������������������������������������������������������†ÆņȆ̆͆҆ӆՆֆ׆چ܆��݆������������������������������������������� �$�&�'�(�*�+�,�-�/�0�2�3�5�6�8�9�:�<�=�@�A�B�C�D�E�F�J�K�M�O�P�Q�R�T�U�V�X�Z�[�\�]�^�_�a�b�f�g�h�i�j�k�l�m�o�q�r�s�u���w�x�y�z������������������������������������������������������������������������������������������������‡ÇćŇLJȇɇ͇̇·χЇԇՇևׇ؇هڇ܇݇އ߇�������������������������������������������	���
��������������� �#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�3�4�5�6�7�8�:�;�=�>�?�A�B�C�F�G�H�I�J�K�N�O�P�Q�R�S�U�V�X�Z�[�\�]�^�_�`�f�g�j�m�o�q�s�t�u�v�x�y�z���{�|�������������������������������������������������������������������������������������������������ÈĈLjȈʈˈ͈̈ψЈшӈֈ׈ڈۈ܈݈ވ����������������������������������	���
������������� �"�#�$�&�'�(�)�,�-�.�/�1�2�3�5�7�8�9�:�;�<�=�>�?�@�B�C�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�`�a�b�c�d�e�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�|���}�~�����������������������������������������������������������������������������������������������������������������������������É͉ӉԉՉ׉؉ىۉ݉߉��������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�?�@�A�B�C�D�E�F�G�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^���_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�z�{�|�}�~��������������������������������������������������������������������������������������������������������������������������������Š��ÊĊŊƊNJȊɊʊˊ̊͊ΊϊЊъҊӊԊՊ֊׊؊يڊۊ܊݊ފߊ�������������������������������������������������	�
���
������������������� �!�"�#���$�%�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�g�h�i�j�k�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~��������������������������������������������������������������������������NjЋ�	��8�9�:�;�<�=�>�?�@�B�C�D�E�H�J�K�M�N�O�P�Q�R�S�T�V�W�X�Y�[�\�]�^�_�`�c�d�e�f�g�h�i�l�m�n�o�p�q�r�t�u�v�w�{�|�}�~��������������������������������������������������������������������������������������������������������������������������ŒÌČŌƌnjȌɌʌˌ̌͌ΌόЌьҌӌԌՌ֌׌،ٌڌی܌݌ތߌ���������������������������������������������������	�
���
���������������� �Q�R�W�_�e�h�i�j�l�n�o�q�r�x�y�z�{�|�}�~����������������������������������������������������������������������������������������������������ōǍȍɍʍ͍ЍҍӍԍՍ؍ٍ܍����������������������������
�������������� �!�$�%�&�'�(�+�-�0�2�3�4�6�7�8�;�<�>���?�C�E�F�L�M�N�O�P�S�T�U�V�W�X�Z�[�\�]�^�_�`�a�b�c�d�e�g�h�j�k�n�q�s�u�w�x�y�z�{�}�~�����������������������������������������������������������������������������������������������������������Ž��ÎĎŎƎǎȎɎʎˎ͎̎ώЎюҎӎԎՎ֎׎؎َڎێ܎ݎގߎ��������������������������������������������������	�
���
������������������� �!�"�#���$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�j�������������������������������������������������������ÏƏ��ɏʏˏ̏͏Ϗҏ֏׏ڏ������������������������������#�$�%�'�(�)�*�+�,�0�1�2�3�4�7�9�:�=�?�@�C�E�F�H�I�J�K�L�N�T�U�V�Y�Z�\�]�^�_�`�a�d�f�g�i�j�k�l�o�p�q�r�s�v�w�x�y�z�{�|�~�����������������������������������������������������������������������ÐƐȐɐː̐͐ҐԐՐ֐ِؐڐސߐ���������������������������������	�
���
������������������� �!�$�%�&�'�(�)�*�+�,�-�.�0�2�3�4�5�6�7�8�:�;�<�=�>�?�@�A�B�D�E�G�H�Q�S�T�U�V�X�Y�[�\�_�`�f�g�h�k�m�s�z�{�|�����������������������������������������������������������������������������������������������‘ÑđőƑȑˑБґӑԑՑ֑בّؑڑۑݑޑߑ��������������������������������������������������	�
���
������������������� �!�"�#�$���%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�u�v�w�x�y�z�{�|�}�~������������������������������������������������������������������������������������������������������������������������������������’ÒĒŒƒǒɒʒ˒̒͒ΒϒВђҒӒԒՒ֒גْؒڒےܒݒޒߒ���������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�?�@�A�B�C�D�E�F�G�H�I���J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~��������������������������������������������������������������������������������������������������������������������������������������“ÓēœƓǓȓɓ˓͓̓ΓϓГѓғӓԓՓדؓٓړۓܓݓޓߓ��������������������������������������������������	�
���
��������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�l�m�n�o���p�q�r�s�t�u�v�w�x�y�z�{�|�}�~������������������ǔϔӔԔڔ��� �'�3�=�C�H�K�U�Z�`�n�t�u�w�x�y�z�{�|�}�~���������������������������������������������������������������������������������������������������������������������������������������•ÕĕŕƕǕȕɕʕ˕͕̕ΕϕЕѕҕӕԕՕ֕וٕؕڕەܕݕޕߕ��������������� �#�$�%�&�'�(�)�+�,�-�/�0�7�8�9�:�>�A�C�J�N�O�Q�R�S�V�W���X�Y�Z�\�]�^�`�c�e�f�k�m�n�o�p�q�s�x�y�z�{�|�}�~������������������������������������������������������������������������������������������–ÖȖʖ˖ЖіӖԖ֖זٖؖږۖܖݖޖߖ�������������������������������
��������������� �!�"�#�$�%�&�'�(�)�+�,�.�/�1�3�4�5�6�7�:�;�<�=�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�T�U�W�X�Z�\�]�_�c�d�f�g�h�j�k�l�m�n�o�p�q���r�u�w�x�y�z�{�}�~����������������������������������������������������������������������������������������������������������—×ėŗƗǗȗɗʗ˗̗͗ΗϗЗїҗӗԗ՗֗חؗٗڗۗܗݗޗߗ���������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M���N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�����������������������������������������������������������������˜ØĘŘƘǘȘɘʘ˘̘͘ϘИԘ֘טۘܘݘ�������������������������������������������������	�
�������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I���J�K�L�M�N�O�P�Q�R�S�V�W�X�Y�Z�[�\�]�^�_�`�a�b�d�f�s�x�y�{�~���������������������������������������������������������������������������������������™ÙęřƙǙșəʙ˙̙͙ΙϙЙљҙәԙՙ֙יؙ��ٙڙۙܙݙޙߙ��������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8���9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�r�������������������������������������������������ÚĚƚǚȚɚʚ͚ΚϚКҚԚ՚֚ךٚښۚܚ��ݚޚ���������������������������������������	�
���
���������������� �!�"�$�%�&�'�(�)�*�+�,�-�.�0�1�3�4�5�6�7�8�9�:�=�>�?�@�F�J�K�L�N�P�R�S�U�V�W�X�Y�Z���[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������������������������������������������������������������������������������������������������������������������›ÛěśƛǛțɛʛ˛̛͛ΛϛЛћқӛԛ՛֛כ؛ٛڛۛܛݛޛߛ��������������������������������������������������	�
���
��������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z���{�}�~�������������������������������������������œȜɜќҜڜۜ�������������������������������������������������	�
���
������������������� �!���"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������������������������������������������������������������������������������������������������������������������ÝĝŝƝǝȝɝʝ˝̝͝ΝϝНѝҝӝԝ՝֝ם؝ٝڝ۝ܝݝޝߝ���������������������������������������������������	�
���
������������������$�'�.�0�4�;�<�@�M�P�R�S�T�V�Y�]�_�`�a�b�e�n�o�r�t�u�v�w�x�y�z�{�|�}�����������������������������������������������������������������������������������������������������������žÞŞƞǞȞʞ˞̞ОҞӞ՞֞מٞڞޞ�������������������������������������	�
���������������!�#�$�%�&�'�(�)�*�+�-�.�0�1�2�3�4�5�6�8�:�<�?�@�A�B�C�E�F�G�H�I�J�K�L�M�N�O�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x���y�z�{�|�}�~���������������������������������������������,�y������
�������� �!�#�$�'�(�)�h!����l!'!��������������c!@!��������������������������������������������������������������������������A!����������������$("(������������((&(:(��,(*(��������0(.(������B!��4(2(��9(!(����������������������������������%(��������������'(������������������������������)(������������������������������������������������������������������-(����������������������������������������������������������1(����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������#(��+(��/(��3(��5(��6(��7(��8(��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������&!��%!@�A���������������������������B�!&"&#&$&%&&&'&(&)&*&+&,&-&.&/&0&1&��2&3&4&5&6&7&8&��������������A&B&C&D&E&F&G&H&I&J&K&L&M&N&O&P&Q&��R&S&T&U&V&W&X&''����������������������������!'"'#'$'%'&'(')'*'+','-'.'/'0'1'2'3'4'5'6'7'8'9':';'<'='>'?'@'A'Q'R'S'T'U'V'X'Y'Z'['\']'^'_'`'a'b'c'd'e'f'g'h'i'j'k'l'm'n'o'p'q'��W'\�����C���*!,!��.!/!����0!1!��������������E�-!������������������k!��d!e!��F�����������y!f!��G�������H�������������������������m!��������������������Y�����������������������������������������������������������������������������������������������������������������������������q"r"s"t"u"v"w"x"y"z"{"|"������������������������������������������������������������������������{!|!z!}!����I�J�K�L�J!������������G!��F!������M���������L!����X!^!N�O!����O���N!��D!E!I!H!R!����S!����������`!_!C!K!����������W!��������������������V!������U!����������P���������������������������Y!T!����\!]!Q�R�������������Z![!����������������������������������������������������������������������������������Q!����������������������M!��������������������������������������������������S�P!Y"Z"["\"]"^"_"`"a"b"��������������������E"F"G"H"I"J"K"L"M"N"O"P"Q"R"S"T"U"V"W"X"1"2"3"4"5"6"7"8"9":";"<"=">"?"@"A"B"C"D"$)%)&)')()))*)+),)-).)/)0)1)2)3)4)5)6)7)8)9):);)<)=)>)?)@)A)B)C)D)E)F)G)H)I)J)K)L)M)N)O)P)Q)R)S)T)U)V)W)X)Y)Z)[)\)])^)_)`)a)b)c)d)e)f)g)h)i)j)k)l)m)n)o)��������T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w���������������������������x�y�z�{�|�}�~�������������������������������������������������v!u!��������������������������������x!w!������������������������������������t!s!������p!����r!q!��������������������������������������������o!n!������������������������������������������������������������������������������������������������������������������b!��a!!!"!#!(!��)!e���4!5!6!7!8!9!:!;!>!?!��~!2!3!<!=!������������������@�A�B�C�D�E�F�G�H�����������������������������������������������!$"$#$$$%$&$'$($)$*$+$,$-$.$/$0$1$2$3$4$5$6$7$8$9$:$;$<$=$>$?$@$A$B$C$D$E$F$G$H$I$J$K$L$M$N$O$P$Q$R$S$T$U$V$W$X$Y$Z$[$\$]$^$_$`$a$b$c$d$e$f$g$h$i$j$k$l$m$n$o$p$q$r$s$��������������a�b�f�g�����!%"%#%$%%%&%'%(%)%*%+%,%-%.%/%0%1%2%3%4%5%6%7%8%9%:%;%<%=%>%?%@%A%B%C%D%E%F%G%H%I%J%K%L%M%N%O%P%Q%R%S%T%U%V%W%X%Y%Z%[%\%]%^%_%`%a%b%c%d%e%f%g%h%i%j%k%l%m%n%o%p%q%r%s%t%u%v%��������$!`�c�d�E(F(G(H(I(J(K(L(M(N(O(P(Q(R(S(T(U(V(W(X(Y(Z([(\(](^(_(`(a(b(c(d(e(f(g(h(i(e"f"g"h"i"j"k"l"m"n"��������������Z�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������I�J�K�������������������������L�M�N�����O���������������������������������������������������������������������P�������������������Q�����R�S�����T�;R!6@�_FA�B�C�rMIU}HOIBO"X;2kSD�$Xs3E�(WRG'X@JF�pG{15RT4+6?K)XG�H�I�*6J�=AOQK�%I-XL�v8>Q\cPVM�N�a7O�.4P�YAQ�<XR�hM$5*NwVS�v@Y>/XT�U�V�KDW�C>X�1X4CeRY�.VZN'Uu:&7V@Z�9FREGG[�T9\�K3RR]�^�?XE>rF2R0OgO_�`�a�b�iJc�d�@Xe�f�g�h�i�j�rBRBk�iHl�m�n�o�p�q�r�s�t�u�,Gv�w�x�y�z�{�|�KA}�hSyU~�BJ~6!XZSw?��FT%;AXeN.>����(X��GQ)P������=XoYvM:?��;=%:`Rz2`:6D��mO)>$MAA������WGqY��tY��������KHiX������ZR2JJHlXjXFXv=MFp3��kXq=i=��THS4����XB��V2PWKJ{KLU68IO������ZYpX*G��nX��z4nATR����mX��GRoXGC������vQ��YVrX��uX~<[<������NH��]7��B7��sF��������������xXAR����iN?<|7%7]P����������ZVESo;a;qX����!I0N+4��sX��KIvXWBwX����1NyX����.2@9Á#Yāi0ŁfAƁlIǁEKȁFK$YɁʁˁ́́h5΁ρ+5ЁсҁӁԁՁ;NM5!WtWSSցeLׁN:؁"Y\Y`S}Xp7wW~XzX!YcDفځ6StX]Yہ{X܁eE݁ށP@߁�pQ[0��Q<&Y�%Y����,Y.Y�+Y9J���)Y6V���^3(Y�}@�LJ�*Y�'Y��0Y����16������)9��@R����@O����BB@�D=lU`2HGk?-YA�/YB�jNn:C�D�E�F�G�VGH�I�J�K�L�M�N�O�P�c1Q�R�S�Y4m64YT�U�V�W�!?X�Y�Z�^YNG~@8Y[�\�]�^�_�WK}7`�5Ya�7Y#1aS9Yb�EPc�6Yd�e�1Yf�2Y)A3Yg�h�s<^P)8i�c>j�=Yk�l�m�n�:Yo�30p�q�r�BYs�t�u�v�w�x�y�z�{�|�}�~���DY61��?Y����95��s>������HLr:PR��CY����h=��+3������EYk>��FY;Y_D��>YAY@Y����������������������.U��5V��cG��������HY������Y<JY������<Y��KY+F����������IY��������vW��#M����������������!=������������LY��‚ÂĂłƂǂȂɂ<E5Mʂ˂̂MY͂΂GY%3~?ςЂт҂58ӂԂ|@Ղւׂ؂x0قڂۂ܂݂ނ߂��������������v4�NY�OY"4PY��_4�����A0��������������QY5I��@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�qOR�S�T�U�V�W�RYX�Y�Z�EA[�\�]�^�_�`�a�b�c�d�e�VY.If�g�h�i�UYTYWYj�k�l�m�[Kn�)=o�p�q�r�s�'Ft�u�v�w�x�y�z�{�|�}�SYXY~�����YY������������eH����������������������������\@����������������������������������������������������������y6#XJT��*TVPd3WU��HOb9��K?��bC������R6����CMnYpY������35��56����ƒÃă$>ŃƃkHǃȃ+HɃʃK0+9yAbY˃<@29̃X9KPx1dF_>d5HW̓xQf<^J΃σ=<fYgXЃуZD҃ӃT8=HԃՃa2YTփ׃؃ك0CڃۃaC"Z_H܃4P݃|>)Eރ߃�Z9�#Z�)T$Z�����{Y,6��k7y1|Ye3v>�v?1Rd@���36~Y}Y��;>���`F�<W!Z�9A��r5hA����u<��U4������������@�A�B�]AC�}DD�E�8<27F�G�o7H�I�J�K�L�M�lYN�>FO�-?K;P�Q�J5R�I[WPS�9M<0v3w;J[/:T�dT65s5VXPHU�V�V7PGWXW�/?X�Y�;[XXZ�[�LP.;\�]�^�>kPAuArTU844_�u3`�a�>Ib�c�d�PEe�f�g�YE{@h�p1i�YXN9j�=5k�l�ZXm�n�FV"K/H2IL4L?o�t9p�[X\Xg6A<jLq�r�s�t�u�v�wOw�]X0Gx�y�P9#=z�{�^L|�JF}�~�������`X��^X����_X������~0��g>��#Jt<��������18����n8��������������������bX��K=��dXcX����������|E��������������eX����fX��������������&A��0Hl0&9S<qN=[SA��������/6zV,EY=>[?[������x@">M@����������������„Ä@[FJĄńƄ*2DŽȄɄBSʄcC˄+Q̄̈́΄τB[ЄU@ф҄ӄC[Ԅ1?Մքׄ؄لڄ<Dۄ܄݄ބZG߄����������D[��������hYWI���49pNHT��������|0R4��YP��������iY��K^kY@�A�B�C�0X/;11D�W3NXE�F�QTG�H�3=o?I�;OJ�K�PXL�M�N�K7O�P�Q�QXR�S�T�U�V�W�X�Y�Z�[�%FxG=R\�]�RXdD^�.J_�'G`�&Xa�}IgN\;k0b�c�d�*;-Pe�01dW?Wf�%5tBODg�h�)2i�72j�e12_<U(?,BUX1Bk�TXTNl�`Zm�@Nn�o�4X.C!S#Np�4<4HQBq�m>6Pr�aZs�t�u�v�dGw�x�'3y�r6|Lz@z�{�w@|�9QaQGX}�~�����������^2����e@��q:����HX��-T����aOIX��JXCO��x3G>��������KX��������������L[��������%H������XO��~HN2����������VSf20<QS+K47������"7����eJ��!H\Jd1pP��QE������E[~5����Z?E9d>mA��6_5_;VP=YUH0#6I?(L3_7JRS��OX6RE:>K>L��7_p54_������uS��T3w8��:_��O:*<u5��,M{Cs:t@BMrO8_EO��@B9_pB������}>��_ALMwRM7A_…D_Åąq7I0V6T7Ņ,:}LT?1KtFƅ(VE_DžbN33ȅɅ|N54ʅGNp:˅aN̅=Qͅ΅@_υЅt4хJ3҅f8;_ӅԅՅօEDׅ<_=_>_;E?_B_1TC_؅:GXNمڅۅ܅݅XDޅJ_߅O_�\V��������I_Z_6N�G:N_H_^E��kIt:|C��W>�F_�M_�XE����&UM:��L>=S@8��dV��G_>9'?����|AK_L_��P_��������@�[_e_A�W_V_IWc_d_ke'RR_B�)?C�[TD�H?T_E�F�G�LOH�I�]_J�JQK�^_'07FS_L�e:M�_6[M~9UTN�O�__lO%0g_Q_FQU_X_Y_\_P�);Q�`_a_R�b_f_h_4SS�T�U�V�W�g86Ej_ZI(ADDX�Y�^?xOZ�[�\�\Un_]�^�_�`�a�b�82c�_:l_d�A[e�dQf�g�h�i�tK=4j�&0k�l�m�n�o�q_FLr_p�q�m_r�s�t�u�v�w�i_x�y�z�{�k_|�o_p_=;}�~�s_����t_��#;��[J(N'`*3��&`������!`��������~_��YM|_��z_��P?DW��LI����x_!0����������}_��������{_"`����������(`��������H7����!F6I2@u_����>E��DXy_vD������������#`$`%`%P����4`dL��1`��&?/`9N+`FI����.@.`m:0:)`������v_��3`����8`������-49`����2OH:��0`��†ÆĆņƆdžzPȆɆʆˆ̆͆ΆφІ,`ц{T҆w_ӆgEԆ-`ՆwSֆ6`7`׆؆نچۆD`aP܆݆ކ<`߆�I`J`���>`*`$IA`�2`�����HJC`�5`�KN�CKM`F`B`�K`�:`?`@`��E`��G`H`�L`�;`����������TKU`��V`R`��������@�A�P`N<B�C�Q`D�B8EXE�F�G�H�I�J�K�L�jPM�N�oBO�P�O`=`Q�R�S�T`S`T�U�W`V�W�X�Y�\`X`Z�[�\�vV03]�lW^�;K_�`�Z`a�{Nb�c�d�Y:e�f�g�h�i�j�k�l�m�n�o�p�a`]`-Rq�r�s�t�u�b`v�w�[`Y`_`x�y�``z�{�|�}�~�^`��d`������wF,XkTf`IJ��������e`��������A8��������g`h`����������������i`c`��������������?:gL������j`������������������������������yO����������������������k`������������‡BHÇćŇƇ@=LJȇɇʇˇ͇̇·χЇч҇ӇRDԇՇևׇ؇هڇۇ܇l`݇އm`߇�tGDK�n`X;6XrRo`EM�Z6������q`�0T��'@Q4��'Np`���r`L9��z9<Ms`��TFt`��2T��&Hv`u`��������������@�A�B�C�D�E�F�G�H�I�w`J�K�AML�M�N�%JO�P�Q�R�ZTW[Y[S�X[g9\[][X5T�U�Z[V�W�X�Y�Z�[[!3_[[�\�x;]�7V^�`[_�`�a�b�y>c�d�;7e�P[.L2?5;xWS?f�g�h�i�j�i?k�l�a<3L^[S0kNX79WBFm�n�$@o�9Lp�g[a[:Fc[q�h[r�wEs�t�u�j[v�w�i[@?x�y�z�f[e[{�|�}�~���94,@"Bb[d[��������MPm[����������]@r[��������������b6��������s[R[89+Tl[��Q?p[��Q[��f5��k[e?������n[��q[������y[������������������!9#0��������������qB����G3o[����x[��RFt[����u[w[v[����~[��rS:2������}[����������ˆÈĈ$\ň{[ƈLjȈɈz[ʈˈ̈|[`Ey;͈Έ#\ψЈ%\шCL҈ӈԈQ6@]Ոֈ׈!\؈"\وڈۈ5G܈݈ވi6߈��'\����&\�)\$1��L5�����0?�����_Q����B6����������������@�A�B�C�D�E�(\F�G�H�I�J�K�L�zKskM�N�O�\KP�Q�~KR�S�T�ALU�V�W�X�Y�{HZ�[�\�]�^�_�*\`�a�b�c�d�nL+\e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�S[v�/\,\w�3>x�{Jy�z�{�-\|�}�~�����������JI9D����������=G.\������vTfP����������������+DU6������������������������������������T[��������Z1������U[����������������������V[������>:������������‰ÉĉʼnƉljȉɉ@Hʉˉ͉̉Ήω?JIHЉ3WщyI҉ӉG?ԉՉx:։׉<R؉ىډۉ܉݉މ߉:b�&4��81�����48�DO����gY&ObM��mY`6�9R��;9���9b7b��s4��lL+Lr7��2XkQ;:��'J����7M����DRd?P<a6��E^@�A�B�C�F^<[D�YQE�F�fFNDn7G�\7H�I�|?`WJ�uFK�L�<1H^1=WLJ^M�I^N�O�P�Q�R�l5S�]IT�U�B0V�W�X�Y�Z�[�\�]�^�_�`�a�b�.E+Ec�LDd�i<}Ke�f�g�C:h�i�j�yegHze}Mk�1W>8hBl�QHm�n�{eo�p�q�r�J6K<s�t�}Q!fu�nCv�w�x�y�$fz�{�|�}�~e%fWM~���A7|e}e#f����]D(f����'f������������CC��^F����*f��������������7D������"f<J��������c=C9&fUP/N����)f0f��&R��*=-f����������/f��Q@����LR������'<������������������������1f��vR������KW��~M��^M&B+f,f?=.f3f����2f������Š6fÊ8fĊŊƊNJoDȊɊʊHDˊ̊j>oI͊Ί7fϊp6ЊъҊdCӊԊՊ֊׊؊يiS4fڊ5fۊ"H܊݊ފߊ�=f���9f�����EF��qM;f����������<f��������i;������������@�>fA�B�C�D�:fE�F�7@G�H�I�J�K�L�M�N�O�$S?ftICfP�Q�DfR�S�T�U�vPV�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�=Ch�i�j�k�l�m�n�DCBfo�p�q�r�s�t�u�v�w�x�y�z�{�|�Af}�~�����������Gf1O��tk����Jf����������Ef����^<)I������������5<����SO����������Hf��If��Nf��Pf������Qf������KfU5��Lf����Of����[D��Ff����������Mf������������������������������������‹ËċŋƋRfNjȋɋʋˋ̋͋΋ϋЋыҋTfSfӋԋՋ֋׋؋ًڋۋ܋݋ދߋ�������������Uf�xY��Vf���������Wf��������������@�A�B�C�D�E�F�G�SW]fH�^fW?PTI�VWf4oKZfCXNW"PJ�OCK�L�_f><B9[f'QM�N�":OBO�+XP�Q�R�kJneS�\fT�u7U�V�W�X�fHY�Z�uD[�\�2e~D]�|K3e,U^�nSXJ20_�NKjM`�a�j:b�c�d�5ee�4ef�ZWY9fV(6pMKR&15Jg�h3sIM?{PRJ6eB;h�i�j�\O,9k�l�m�n�WTo�p�&:gQ|OR<q�7e]Hr�s�t�m?v1^Ku�v�E<w�D<zR\C\?x�y�z�{�;8|�}�~�BC��.:"T������������������^G/Dl2��Q9����;eHA����/U����������<e��>e��������������g4T6BK0Q<5����YJ��b7����dI��+=����>NpW��������!P��YI����{6Xfb<��>3��PI��Yf"3��������L^��HSM^��"R��������N^��������M>����O^������,J|R_3jeaD!>2NrDV>(Fc2��ŒS>ÌČ|GkLl=]NŌƌ:JAFle<PnjȌɌ9Uʌˌ̌me͌ΌόЌtJь@MEBҌoeӌDBpeԌՌ֌׌،ٌڌxeMMی=I܌݌ތߌ���YR(a����lS�jKqF�����,a���'a)a��*a/a��m2�+aZ8-a.a0a:51a����������3a8a����������RQ@�6a5akAA�B�C�7aD�@TE�2aF�:a60G�H�I�J�4aK�y?L�9aM�N�;aO�P�Q�R�S�T�>aU�V�W�X�Y�Z�<a[�\�]�^�_�`�EVa�b�c�d�e�f�g�?Oh�i�=a?aMBj�k6k�xSl�m�MGn�o�e7p�q�r�s�t�u�v�w�x�y�~>z�{�|�}�~���@aAa����Gag3������������iF����������^4��BQ��������Ha����Fa����������Ea��CaBa��@1������8UDa����������Ka����������������LaJa����������������zo����SaRa6G����������������������Ia��NaÍPačōƍǍȍɍʍˍ͍̍΍TaύQaMaЍэOaҍӍԍՍUa֍׍؍ٍڍۍ܍ݍލߍ���Va������������������������Wa������Xa������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�ZaV�W�X�Y�Z�[�\�]�^�_�`�a�b�[ac�d�e�f�g�h�i�!Nj�k�l�m�n�o�p�q�r�s�t�u�v�]gw�(4]Vx�y�2Q23z�{�$9sWIG^>.9|�WN}�~�n2O[��:<QRHKM0����oO����������cYm=����R1PJ<2��'K+7��&J������#O����x`JU{`����z`AE{L��1Ay`cV/2DV[5����������������x4!V����������/Oo0����|`����������!a#3����}`~`1C��������]C��"ay7������������O;��������������#a;D����������$a��Ž%aÎĎ&a14ŎƎǎȎɎʎˎ͎̎ΎώЎюҎӎI8=FjDԎ"2ՎRP֎[gC;WSDS׎c9Ob؎َڎ/WێlGS1܎ݎ24Qbގߎ�rP.BPb�b?&SW5Rbj5�mC}8�.8�SEO7Tb����SbH6yW�����%M�����Xb�Vb|J5?9SUb�����Wb��������������@�A�B�.AH@C�D�E�F�G�H�[bZb*@I�J�NAK�L�M�N�\bO�P�Q�R�S�T�U�V�W�X�Y�Z�]b[�^b\�]�^�_�`�a�b�c�d�H[e�SQ"Mf�g�(=h�i�j�C^%X*?M[lRzF*Ek�l�m�D^n�W1._o�p�q�=Jr�1_s�-9t�}Ru�%8k:v�w�Z3x�y�z�\5EU{�|�}�~�VCRO!;��sere����te��dM��uH��������������/5?G��ve������0l������������������������������fe��i915��<Bhegeie��������MR������jaNP��.M��eQ����J2k1��r1mE����CU0S��\a������]a��[R��93K1������yMwU^a��6>}4��_a\:`a2;IBaa������lP��=M����ba��C5GEca��daÏďŏƏySǏȏɏʏˏ̏ea͏-QΏϏfa"NЏяҏӏԏՏga֏B5׏؏ُڏhaU;ۏ܏ݏޏߏDP`bX1dR��ab��I<LH�cb~l}l/_���bb>V|M&C���Cc��RVgb��hb��GS��lbl?�mbeb�@3������nD����nb����CP��v:ib^73;,LKKdbfbjbkb��@�A�wbB�C�tbuTsbD�E�-EF�zUBE@2G�H�obI�rb/A<KJ�K�!5ybL�M�N�1<qbTP9TubV9vbO�P�Q�SGR�S�T�U�V�pbW�X�Y�Z�[�\W!m\�]�xb^�%m~bQJ_�`�a�b�c�d�e�5Af�P;g�h�V?i�c:j�k�!Kl�m�n�&m#mo�p�"mq�r�s�t�V;'mtPu�v�$m^:w6!c26qL'9w�"O!Gx�y�R?z�{�q6|�zb{b}b|bUD"c}�AS~�����'cDG��������$O����)c7:��������(c��Z;��#c������$c*c��&c��rNFS����<;����CT��zD����(m|P%c��uC��-c/1��2c������B<����,c?5����������������iG0c������*>oM����������s;������hL����/c��1c��'O.c��)N];����������k5e>R2M3��91+cQ2,5_9h6����kO7cL;ÐĐGHJPŐƐǐȐɐ8cn3ʐː̐͐)mΐzSdSϐАѐ*m9cbRҐӐԐՐ֐5cאِؐڐ^SېܐݐސP83cߐ�6c_7�4c"@���:c��������������������8T��������������@�H4A�;cB�E;C�wID�E�eIF�G�H�=DI�J�K�L�M�N�O�+mP�Q�R�S�}BT�U�V�W�[;.?X�Y�Z�[�\�]�^�?N_�`�a�b�<cc�6?d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�o1w�x�wTy�z�{�|�}�>c~���������������-m������������������?c):,m����=c��������������������@c������������6:������.6����������8P��C0.m����������/mA@��Ac����������������������������������3E‘ÑđőƑǑȑɑʑˑ̑͑ΑϑBcБёґӑԑՑ֑בؑ2\ّڑۑܑݑޑ0mߑj8�lN'jgPyJVH7OI3RNd=��^cr;(j=U�]F)j���*j�,j+j�.j-j����X=�/j�>B����A4w4��';����������flel?7yKb1��gl������HIhlil��VJP^E2zT@�A�KFG0r4SHB�C�D�PME�F�8?G�H�I�J�K�L�M�[?N�O�$G4VP�)@Q^(IoQ$Eg063EHQ�R�b0S�T�v7U�V�zEW�X�s6Y�RUP3<<Z�[�\�-3]�^�_�`�q>Q0a�b�c�d�e�f�VRcJ%Wg�6M669?[Uh�'8WEi�j�k�R^Y?UB@Gl�$;(1m�n�jEo�p�{E'Lq�r�s�t�'1u�v�w�V5x�y�z�(D{�S^:Qi3|�rC}�~�w7��tV#5p24DiD-@T^��h0DE`A��U9��\>XMN0��OMV^P>>WU^PU]0����bD����#Bp<��5S9@!E&2qT����(@CJW^|U��09��-H)K��Y^=?��������4F'W0JCD��V3R9��������8V|j40��������f?����tL��������ZM������?VNB��NN"L.PSD25X^uU7<S;����$0��2El4������qU����}j������������Z^&M����lM��������fN\^��1M&@����=W��[^F04:SIsDh>��������62’ÒĒŒƒǒȒɒL@pKʒq<;;75˒̒͒uEΒf^ϒВђc^]>ҒӒ_^ԒՒ֒ג74]=ْؒ`^mDڒےܒݒFOޒ`5ߒ���^6ZJt5e^�FU�a^ML~F�EE���4R�r>�������SB�=L83�S=�X?FMZQk4�d^]^g^��~j����0Bb^����@V'5��t2��h^��r^����@�A�B�m^C�q^D�E�`HF�G�H�aWo^hCaLI�e2J�K�L�>RM�N�O�P�Q�R�S�n^T�k^UNU�'4V�W�X�Y�Z�+?>>[�\�R=]�^�_�`�i^a�.Tb�^^c�j^d�e�f�g�?@h�l^s2i8'Bi�j�A=k�l�m�n�o�u^x^p�q�+2$4r�s�j4&It�u�v�w�x�y�v^QKz�c8{�w^z^|�}�~���y^������BL��a0n4������������:e����������/P����k2��!k��t^����cIs^Z0!Rw1��/L��������������p^��$K������*U����������{^����������������]4��&D������}^��������������������~C!D!_����������“ÓLAē|^o>œ2FƓǓȓɓʓ˓͓̓ΓE3vHϓГ:K~^ѓғ$_ӓԓՓ֓2Wדؓٓړۓ73ܓݓޓߓCA��KG%2i4�+W����lD�"_#_�%_�3:���&_�^@��CI�������Y2fG��'_��\G��������(_"k����@�A�B�SKC�D�E�*_F�)_G�A2H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�JEa�b�c�d�e�f�g�h�+_i�j�k�l�m�n�o�p�\Tq�r�s�t�u�AHv�w�x�y�z�{�|�}�~�������,_����������p>����-_'V��������7j6kUJ��|XD8��%9����E7~U����������J9����'PMt����P5����tC��H>������7k=0����L=��2A��V1(3������R8"I����X6��������8k4>������}J��CG��{U����s7��������������������������”ÔDNĔŔƔ+Us1ǔȔɔ3l_0ʔ5l˔͔̔76ΔOAϔzu1PДєeUҔSNӔԔo=b3Ք+8֔6Uה=mؔO6ٔ9KBPڔ۔ܔݔޔߔ��=7��6l)J���TE�9l8lCB7l����}P:l�;leW��<l���=llF�����������^N��H<����UH)5I><VgT����.QqP8j9j:j5:@�A�B�C�1Ju?D�E�zMF�G�H�I�J�@jK�:0>jL�M�%@N�O�P�;jQ�}2R�wCh;S�T�U�WRtN?jV�W�X�<jY�Z�[�Cj\�GP3S]�^�_�`�:4a�ACrWb�c�d�e�QUf�GJg�Ejh�i�DjGjFjj�k�l�m�n�gVo�TOp�q�Kjr�N;s�t�u�v�w�x�y�z=NIz�{�Lj|�}�9I~OJjNTMjOj~���mM��������Ij��Nj����nN��^;��?3����������UF0>zN������gG��'>Pj����GV������@A������]T��Qj����>O��������Rj��������nJ��������/E50����������Tj������������������Sj_t����������:D����������)1•Õĕŕ_eƕǕȕɕUjʕ˕͕̕ΕϕЕѕҕӕԕՕ֕וٕؕڕەܕݕޕߕ����oJ�VjWjXF��������Xj��Yj������;T��zG7R|8����Bj��\2����|B��xTfLnW������@�A�B�C�BTPSCksED�~7E�F�TkG�H�I�7K^kJ�J@K�L�M�{MN�/3O�ZFP�Q�R�S�T�U�|kV�>DW�4N)D>1}TX�uJY�lVZ�[�SFd6\�]�^�_�z;`�a�`Pb�c�1Id�ST(He�f�K8g�>h<Ih�i�;hj�n@SPD2e4k�<hl�m�HUn�o�p�q�r�E6s�=hxJ\8uLt�u�v�4@w�x�nQ?hBhy�z�<:{�-1\=|�=jCh}�Fh~�Kh��������Lh��IKe0��+<����99����Ah��wM��Jh��������vN��������mU��VADh��6C��{9&VHh������`JfT��@h��EhGh��9Gc7��Ih��]?Rh����Wh��Uh\<O<[h����������������^h��Zhz1��������������������X03DL8bF>HaH������OhThVh��q9XhuW��{D��\h����i2������Qh����m<–ÖB?MhyVĖxAq2ŖƖǖȖɖʖ˖̖_h͖AJYhΖϖЖі$UҖj1;UNhPh06ShӖ]h8@ԖwJՖ(K֖ז\Fu@ٖؖږۖܖihݖޖߖ#P�������rhjV�������`hah���yQK:y8��q8TToh�nhlhp9RLfh&Nr?�80qhph��@W��dh��)M#I��8;[=jh������������@�A�B�C�bhcheh55ghEGkhmh0=.WD�xhE�F�G�H�I�J�K�L�uhM�0MvhN�O�P�Q�R�S�T�U�V�:AW�hhX�7Cp0Y�Z�[�\�]�^�_�`�tha�b�c�whd�e�f�#9g�h�i�j�k�l�m�n�o�p�RIq�r�s�NC`Nf@t�u�v�w�sKx�]L5Py�z�aJ{�sh|�}�~���������������l<��yh������������^C��eF��w9��������t0����XW����,<��oE����������DL����&i��������������������-I��"ib@������C?������~hW9��{h��������$i������NR����������#i��2V5W��'i��7=��—×ėŗƗǗȗɗʗ˗̗|h}h͗Ηϗ!iЗїҗӗԗ՗֗חVMؗٗ,Rڗۗܗ2iݗޗߗ�)i���*4�;4��+i������������������(P����%i����~3����,ic@��*i@�A�9iB�C�8iD�E�F�G�.iH�I�zhJ�K�(iL�M�N�O�P�,?1i:iQ�R�%BS�T�U�/iV�E8W�-iX�\S4i5i7iY�Z�[�Gi\�]�^�_�`�a�F@Eib�c�0id�e�;iq0f�g�h�i�j�k�l�m�n�o�<i%Up�q�>ir�?is�t�u�Aiv�w�qAx�y�6Hz�{�|�=i}�~�������Bi����������������Ci��3i��6i��1;������@i������������w<������DiFi������������������������Ji��������Ni��������������������[2��Hi��������������������.7������˜ØĘŘƘǘȘɘʘKiLi˘̘͘ΘϘИAUј#DҘӘԘ՘֘טXiؘa:٘ژۘܘIiݘ#Sޘߘ�Ti�������WiPi�����Oi��AG��������Ri��������������YiH3��Si@�A�B�C�D�pOE�F�G�MiH�I�J�K�L�M�N�O�P�Q�R�w3S�T�U�V�W�X�Y�ViZ�[�Zi\�]�^�4L_�`�a�-Ob�c�d�e�f�g�h�i�j�Uik�\i[il�m�n�o�p�^iq�r�s�t�u�v�w�x�Qiy�z�{�|�}�~�����]i��_iJC������������������������������������������������������������������������������������������������������������������������������™ÙęřƙǙșəʙ˙̙͙ΙϙЙљҙәԙՙ֙יؙٙڙۙܙݙޙߙ���������������������7GN46;@P#l����7E��������������@�A�B�{SC�D�E�F�$lG�%l[FH�I�J�n?K�L�M�N�&lO�P�'l*PQ�8GR�S�h8T�U�V�W�X�Y�Z�[�\�]�^�_�(l`�a�b�c�d�e�f�g�9V}UK4=2dNgFh�i�aMj�k�l�m�n�o�p�q�r�s�t�u�v�w�u4x�@K_<y�z�{�|�bicijQei}�y4di~�3QbJP2��hi��������figi����3V������iiji����������ki����������������li����������������/l9EN6��sR��������������n5��Y;1l����cR����������cN��8D��?C����>69XH1O1Q1~E��P1��+C����������1U����������������$kA:šÚĚ:LŚƚǚ%kȚ'kɚʚ˚(k͚̚Κ&kϚКњҚӚԚ՚)k+k*k֚ךؚٚښ,kۚOJ5XqCܚ%CxF-kJDݚ.k/k0kU7ޚߚ�z7�1kbG�3k�$:uQ102k4k���*5HBhG�5k�.K_c��@S����[Y��!M-VsG���`Yc;�::bc����������+O������`cGI��9:��@�A�4QacjH/9-=X3[NB�C�@LD�E�F�hcictMG�H�I�J�K�-LL�3<M�jcN�kcO�P�ZPQ�R�S�{FZ7T�U�_GJRVNV�dclcW�rIA3X�Y�gcZ�[�cFec\�]�3mfc^�_�`�a�3Ib�fEc�d�e�59f�;Cg�cc=E$AYBW2h�mc&;-Di�pcZ>j�k�{cucS:l�m�n�o�P7MSp�NVSUA94UXQq�r�s�t�9PvGu�v�w�*H42x�ZCy�z�{�nc|�}�|coc(7wctc~�����:7����"E��vc]E(2|F��`D����"W��a@yc����zc}c)Lsc��>S��C14mqcrc��xc:PCFsT~c����`=����'d����&d������sQ#d��)d������wH��������4O��(d.deB����46������������r=��"d����i:*d����,d����}6^V2d��-d������!d��n;]M"GIE����wA��$d��3G,===%d��GWb2��+dC</d��k;0d(E1d��������cU#?��:d��7d��;d›Û=děśVFƛǛF:K@țɛʛ!84d˛̛͛Λ!TϛЛ#:~=ћқӛ<dԛ՛֛כ؛?MٛڛyDۛܛ{OfIݛޛ?SߛQO��3d�8d9diL�����NL�T@5d0A6dPN�A;S5�sH'=GU,I"8Jd��LdDQ��:R��-:��T:��������Cdm5������MW@d}O?d������\AJL@�A�B�C�gJD�E�F�G�WDH�TLHdI�J�K�GdAdL�Dd-5M�N�YSO�FdP�Q�R�S�yRc4T�4;U�V�nIW�>4X�Y�Z�l;[�MQ\�mL5m]�^�_�`�a�b�c�d�eGe�f�g�h�(Ti�KdUWBdj�%=Edk�l�fSm�IdxIn�o�>dp�q�eSr�s�~GI6t�|T32Wdu�v�w�BNx�Mdy�<Nz�[8{�|�Vd}�J?~�����NS��lC����������������HEXd����������������DMOd��������TdUd��~:��fO����?U������Rd����������������������Pd����Nd������������������������������eM*J������#@��&=Sd����H8����œÜĜgd4TŜƜǜȜɜʜ˜[d̜͜ΜoAϜМidќҜgRӜԜ_d՜`d֜ל*O؜ٜڜۜ]KܜZdQdݜedޜ\Hcdߜ�gDbd�ad���|3hd����a5���LW���fd�,;�RWOLxk�dd��v9���MVYd\dzB^d��KBD@PB��u12L������������@�A�B�C�N5D�E�F�G�odH�I�J�K�L�M�N�O�/FP�Q�R�aFS�T�udU�V�W�X�Y�)BZ�[�\�l@]Qnd]�^�_�`�a�b�c�d�e�f�.Dg�h�i�mdj�k�l�m�vdtd~Bn�]do�pdp�~Jq�DUr�s�qdt�u�v�w�x�y�z�zQ{�|�}�~�������kdld������rd��+N��������������������KE������1G��:B������jd������JA������������6L13������{d��sd������zd��}d��|d��������������N3������:3wd����ydxdlE������������������������=@ÝĝŝƝhTǝȝɝʝ˝"e̝͝ΝϝНѝҝӝԝ՝֝D0ם؝$eٝڝ#e۝ܝݝޝߝ�$<�%e������!e�������~dt1��������������(e��)e&e��������@�A�B�C�D�E�F�G�'e*eH�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�YFi�j�k�l�m�n�o�p�+e-eq�r�s�t�u�v�w�,ex�y�z�{�|�}�~���������������������/e������.e������������������������������������`9����0e����������������������������1e������������������������p;alpC��F5R;��������iAnT��D>��žÞFWĞVTS2>lŞƞǞȞAjɞʞ˞/B64̞͞ΞWQϞОў43Ҟ2H;?@lӞԞKV՞֞?lAlמ؞ٞڞ۞ܞݞޞߞ����Elf>?LZE<>�Fl�~1���Dl(Uc5�Bl6Ac3��Cl8KC@~L����RA�Hl��������������������f:S@��rV@�A�B�LQC�D�E�F�>?G�37UIGlb;H�LL}=HHI�)OJ�K�L�M�N�O�P�iMQ�kER�S�T�i7U�V�W�X�Y�Z�[�\�]�^�_�IQ8:`�a�b�c�d�Ile�f�Jlg�@;Klh�bl:1Y7i�j�k�l�m�n�o�p�q�r�s�9=t�u�v�w�x�y�z�{�LlfQMl|�}�~���;H����������������������������Ql��������Sl��M;��e<��������������������������Ol��7I����������:C��clUUPl����������sV������RlNl��������Tl��Ul����?I������������(O��������Ÿ\PßğşƟ,Qǟȟɟʟ[H˟̟͟VluNΟϟПџҟlJZlӟԟ՟֟ן؟ٟYlڟ۟ܟ>0ݟޟߟ���Wl�Xl���dl���������<H�������������GA����������\l`Q@�A�B�C�D�E�F�G�H�I�[lJ�K�L�M�oTN�]lO�P�Q�R�S�T�F[U�V�W�X�Y�Z�[�\�]�^�^l_�`�a�b�c�d�e�f�g�h�i�j�,1k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�����_l��������������������`l��&W��@E������<k.0������t>88/RV0y5��3X��,K��]c��������������,Ff0������FE9k��������:k������;k����@Q��#E��rj��2D��5DN@������sjAD��oN��������pjtj����|I����#G������XL~N������ujvj,Og@����wj àĠŠƠ?6xjǠyjȠzjɠʠ{jˠ̠͠ΠϠРѠҠӠԠՠ֠qjנؠ٠ڠ۠ܠݠޠߠ���.Hka�87la���ma�4WnaoaLS�������qaq?paR5���71���sara��|:��ta��������79��Q>����@�A�|DB�]:F=C�D�E�F�G�H�uawaI�J�@6AO(JvaxU|Sxa|ayaK�L�zaj@M�~a!bG@N�O�P�Q�{aR�}aS�T�U�V�W�X�%bY�Z�[�TA\�]�^�_�#b`�(b~2"ba�b�c�MCB2'b&bd�e�$b)bf�g�+bh�i�j�IPmV(C,bk�WOl�m�.bn�o�o:p�q�`i-b*br�s�t�u�+;3Tv�w�x�y�z�{�|�}�~���������0b����/b��ai��������1b����������������2b����������������������3b!L��4b����@�A�B�C�D�E�F�G�H�I�J�K�5bL�M�N�O�P�~PQ�R�JBS�qST�uMU�V�`gW�X�agY�Z�[�\�A>]�^�_�`�jBa�b�c�dgd�e�cgf�g�h�i�j�k�fMl�5Cm�n�bg7;VOo�aAigp�q�r�hgs�t�tg#2u�v�w�x�jgy�fgz�{�|�}�~�lgkg:I����dU��eg)7gg��������������ng��������sg��iV��������mg��rg��qg������`0��������ug����������@�A�B�C�D�E�F�G�H�I�J�rGK�E@m@L�M�pApgN�O�P�Q�vgvKR�S�T�U�V�W�X�Y�Z�"h!h[�\�]�^�_�`�AWa�b�zgygc�{gd�wge�~gf�}gg�|gh�i�UAYG}ECEj�k�l�m�n�mGo�p�q�r�#hs�t�u�v�w�x�y�z�{�|�}�~���������������&h��%h��'hw:xg$h��pH*I��������������������������)h����e9����������~Q(h������@�A�B�*hC�-h.hD�'AE�F�G�/hH�I�J�0hK�L�,hM�4hN�O�P�Q�R�S�T�U�V�W�X�+hY�1hZ�[�\�]�^�_�`�a�5h2h3hb�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�7hr�s�t�u�v�w�x�y�z�{�|�}�~���������������������6h������������������O9��,p��-p��0Fj0?H��_M��������������MN1j������@�2jA�?FI4B�C�D�E�F�G�H�3jI�J�K�L�gUM�N�O�P�Q�R�S�T�y]U�4jV�5jW�6jX�Y�Z�[�J80_uI\�pL]�^�zI_�`�a�b�c�{Id�e�CS&Kf�&8.pB1g�8eoLISW<jIh�g5i�PDi5j�.n-;k�l�^gm�/nn�o�p�q�)3r�s�2nt�u�1ng=v�0n7Nw�x�y�z�OE{�|�}�~�tAN[3nsP����������������TBhF������,7��������������4n��k3������{;5n����������\g������6n����.=��@�A�B�bqC�D�E�hJF�IRZpG�[pH�\pFAI�m8N>J�K�^pL�1E]pqQM�`pL0j=N�O�P�Q�R�_R_pS�/4h7fpep#FapbpC4T�U�cpnUV�W�[LR>2<X�Y�Z�hpgpdp!2[�"V8S7>,H\�]�jp^�_�`�a�wQb�LV[:ipc�;6d�e�4Mf�g�&Fh�i�j�!Akpnpk�mppplpl�>;opm�n�o�p�5Lrpq�r�U3s�t�u�v�T1w�x�spy�z�tpvpa4{�qp|�wp}�~�����zp��xp������up��������}p��yp|p~p��!q������AN$q��#q��vA{p]J����q4q11L��&q����'q����,qNU)q����3H������"q��+q(q%q����*q��@�A�B�C�D�E�F�)0-qG�H�I�J�K�L�/qM�1qN�O�P�Q�R�0qS�.qT�U�V�W�"QX�Y�Z�[�\�]�^�2q_�`�a�3qb�c�d�e�f�g�h�i�o9j�k�G5l�W0Y0m�n�o�mTp�D5q�T=J;'pr�s�^8t�u�(pv�w�(0x�)py�z�nM{�|�*p}�~�����������������+p������������������$F����eVdq��eq��������������������sC����[S��@�QVhEA�/SB�fRC�D�An;05UNQ`<P:E�x?F�G8A5LEG�H�"JI�J�K�KCL�M�N�O�P�BnQ�R�S�T�U�V�W�X�?D"6Y�lm$CZ�1V[�\�]�`Oom^�_�NE`�\6a�b�!Jc�d�mme�f�pmqm<Cg�4?h�nmi�j�k�l�m�n�o�p�q�r�s�tmrmt�u�v�w�fU_Cx�smy�z�{�vm|�#U#Q}�~���um��PC����������wmt?l>xm��wL��[Q������EWvU��|m������{m����������������ymzm����������������}m&>��@�A�B�C�/K!n=6D�"n@DE�~mF�G�^=G2H�I�J�K�L�M�N�O�P�Q�R�S�C6T�U�V�%n:X#n&nW�X�Y�iCr3Z�[�\�]�^�_�'n$n9O`�a�(nwBb�c�d�e�f�g�h�i�j�k�l�m�)n*nn�+^o�p�3Fq�FGr�uVI5s�2Kt�u�v�+nw�x�+My�,nz�{�|�}�~�0U��-n��Dv��������������������������G[������������������#4������,Cfq����������8JSR��*V@�roA�X>B�C=soL6+0C�D�E�F�/JG�H�6mI�7mJ�K�L�M�yN/7s?8mkB0IN�O�P�Q�R�S�9mT�U�vF3?V�W�X�<mxEY�PQZ�)W:m;m[�bQ\�?m@m]�Dm^�_�`�Hma�FmNmhUb�Imc�d�Gm>me�f�iEg�h�i�FFj�k�iIRTAmBmCmEml�y@m�!4n�o�p�q�h9r�Pms�t�u�v�Qmw�Jmx�Omy�xNz�{�6KLmMm|�}�~�����uO������������������������RmrA2SKm7H����������������o<��������pE��������������@�A�B�VmC�o5D�E�5B-0iKF�G�.1H�TmI�J�K�kMb5L�UmSmWmM�N�z5O�XmP�YmQ�\mR�L1S�T�U�V�W�X�Y�Z�vEn<Zm<Lj2[�\�]�^�[m_�`�a�b�kDc�d�E4e�f�g�u0h�i�j�_mZ@h4k�l�m�n�MEo�p�q�]mD?r�s�t�^mu�v�w�x�y�z�{�|�}�~���������%D������`m����������am��cm����WA����G;������������8=������bm��������������@�A�B�C�D�E�dmF�G�H�I�J�K�L�M�N�O�fmP�Q�R�S�T�emU�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�gmd�e�f�g�h�>Jjlq@i�gIj�klnFk�l�m�n�llo�mFmlp�q�r�s�t�u�v�w�x�ply�z�fWsl{�|�qlnlol#WqInKtl}�rl~���iO��vl1F��������@<��ul��������������;5v;��wl����������wY{=����;Bxl��������yl��������#8������@�A�B�C�D�E�F�zlG�H�I�J�K�L�M�N�O�P�Q�R�{lS�T�U�V�W�X�Y�Z�[�\�]�|l^�_�`�a�b�mS.Xk@c�]GL:d�cP=Ke�:Mf�g�Q8h�i�|1j�oGk�VVl�m�n�F?kCo�p�uoq�r�XCs�t�u�v�w�x�bWy�z�{�woS3|�XGmQ}�HV~�xo��vo��};F3��������������U=����FR��`;����!O��|o{o����yo��������L3��TI0K����������~o����^0����IV����@�}oA�m3B�C�UvD�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�HNS�T�U�"pV�!pW�>5Z<|;X�e8Y�Z�[�\�]�^�BD_�`�a�b�c�d�e�f�g�h�#pi�j�k�l�m�kKn�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~���������������&p������(Q��?>nG6q7qU?��������)48q;M��TG-U��9q��:q��������OG������$ROV����;qQ=04=>������\4QN��_?=q����@�A�z?<qB�?qC�D�E�>q@qF�G�H�I�J�AqK�L�M�N�O�P�Q�R�S�T�U�~AV�W�X�Y�Z�[�\�]�^�_�`�"Aa�b�c�d�e�f�g�h�i�j�zJk�l�>Um�n�o�p�:>9>BUq�r�"?s�/M5qt�u�v�w�x�y�_=z�K6{�|�}�~�����������qVCs����Ds��M8������FsGs��J0��Es��IsqK������Ks��&P����J1Hs������Os��Q5����Ws��Rs������TsSs{7��?1��NsJsZ5��Ps@�A�QsB�UsC�D�E�F�MsG�c<H�}AI�VsJ�K�L�M�N�O�ZsP�LsQ�H5R�n=\sS�T�$7p?~V2MU�p4V�_2W�XsX�Ys8IY�]sZ�[�^s\�as]�^�_�`�a�b�c�d�e�f�g�_sh�i�csbsj�k�[sl�j?m�o3n�`so�p�)Gq�r<r�s�t�u�ksv�w�x�y�z�{�|�?9}�~�ds������-2~;��cK��������msis������\9ns������esfsjsaBlsoshs}<������dO����ps������gs����������������rs������@�-W*FA�B�C�D�ssE�F�G�H�qsI�(BJ�K�L�M�N�]8usO�P�tsQ�R�S�[4T�U�V�vswsW�X�Y�xsZ�[�\�:@]�^�i@_�`�a�b�c�qEd�e�f�g�{sh�zsi�j�k�l�m�n�o�p�X4q�r�s�~syst�u�|sv�w�x�y�z�{�}s|�}�~�����������!t������������#tI;����"t��������������������������$t������������>2&t%t��@�A�B�C�D�E�F�G�H�I�.<J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�WCaYo�p�q�r�s�t�`@LtQWu�v�w�x�y�z�{�|�}�~���[7��������������Nt#A����IF��V43U������PtOtQtZK����Rt��AT`V��������`7������8A����;ASt,>����������b4����TtUt+>@�A�VtB�C�D�[tE�WtZtF�}:G�XtYtH�I�J�K�L�M�N�b8GL\tO�Z2P�Q�SCR�S�cT7?T�U�V�W�X�Y�Z�]t[�\�]�^�_�`�4Ea�b�c�d�e�f�g�h�iti�j�5Ok�l�m�n�o�p�q�r�s�t�u�v�w�x�INy�z�{�|�}�~�������������������������������XK��wK��������t=������OW������[@��������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�uPw�x�y�z�{�|�}�~�jt������������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�ktM�N�O�P�Q�R�S�ltT�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�������������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~���cw����������17����������mt��������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�kWd�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�nt|�}�~�yf@>zfl:{fKO|f<T6<}f~fM<RH3N!g��?4"g4IY8ID��]WZBW7=VFND7����&E#g_O$g%g&g7AiWpI8O/VUV'gm0(g)g\IoR->*gs0^Ha=+gFH��,gf;x8$Q-ggBx>J=3M.g/gn>eP��gKPLL<0g(<wP1g��xP2g3gB44g5g~I,N`C7gA1q3��8g9g[W@U:gLB:W;g<g=gj<eCB@>g?g)<��@gAg6gP6Bg��CgDg:;^5FB`1Eg5TFg?8HgGgl7��Igx2JgKgLgMgNgOgPg'SuKQgRgSgTgIIUgVgWgXgYgI=Zg>s��W8��1H��������������?s��@sAs��������������������^9xM����hX1:@�^B7nA�#7B�C�D�E�9nF�8nU0G�H�I�J�K�;nVUoWL�M�N�CVO�P�=npJQ�<nR�S�T�U�>nV�W�X�Y�@nZ�[�?n\�]�^�_�`�a�b�c�rQd�<Ge�@Cf�g�h�i�j�a8k�l�m�n�o�gAp�q�Ft_PGtr�[Os�t�:Hu�v�Htw�x�y�z�{�|�}�ItJt~�Kt����������zY~8����qepS��`t��LN������a3��������4q��nR��at����������hObt����LG������������T5d4dt����@�ctetA�B�ftC�D�E�F�gtG�2:?0H�htI�J�K�L�M�N�O�-7mRP�Q�R�+RO@S�<?#k_UHjT�U�V�W�sqx6#KX�Y�MDZ�gq[�hq{8iqD:ETR0\�]�jq^�_�`�kqa�lqb�c�mqnqoqqqpqUEd�e�f�g�h�i�rqj�z6k�tq.RG^JKl�m�\3n�"5o�"9p�q�tDuqr�s�vqt�u�v�DA{A0Vwqw�x�y�z�xq{�*A|�}�~�8F��[>�‚ƒ„…†‡ˆ‰Š‹ŒŽ�yqO4�‘’“”�zq�–—˜™š›œžŸ �@�2m1mA�B�`K^RC�AKXUD�bHE�_@!<F�G�H�I�J�K�AkL�M�$PN�bVO�G6X8@kN8P�?k&3I9+VQ�t7J7R�S�T�g<>7FkU�Gk90O?V�Ek}SW�HkX�Y�IkZ�[�N7\�BkDkvIWVMU2POk8NPk]�(5^�_�`�a�b�31Rk%Lc�d�e�f�g�h�i�VESkj�Qk_ENk$JUk{0k�l�z:m�n�7Xcqo�JkKkLkMkVk@fYkp�h?HRWk\kl8Xkq�:=r�XPs�70t�]k\Du�v�w�x�,Vy�z�{�`4|�}�vB9<~À�Zk[k`TjFTD_k'EuY��12��dk��E=�ÅÆ�bk�ÈÉÊËÌÍÎÏÐÑÒÓ�ck�Õ�,8��QMek�ØÙ�ak��3A�ÜÝÞß�"F��@�A�B�C�D�E�sLF�fkG�0@8RgkH�I�J�/8-8K�hk;GsML�M�N�jkkkO�P�Q�R�S�mkT�U�V�W�HPX�rkY�nkZ�[�\�qkyH]�|Qlk^�_�ik`�a�b�c�98YOeDokpkZLHMr0d�vke�f�g�h�i�ukj�22k�l�m�n�`8o�wkp�q�r�s�t�u�l1v�w�EL$D%Ox�y�z�{�|�yk}�~�"l��rE��zk�㥹ĆćĈĉ�EI�ċČčĎď�_b~k�đĒē�NM!l[17S�ĕ�\R�ėĘ�}k��{k�ěĜĝĞğĠ�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�<3O�P�Q�0jR�S�TWT�+tt3U�V�W�X�Y�AVBVZ�[�\�]�^�_�iUJ>`�'ta�(R(t)tb�*tK>_Sc�d�e�f�g�`IaIh�i�Bsj�fJk�rLl�m�n�o�p�q�6b4Kr�hN[Vs�-t.t/tt�u�v�w�2tx�=:3tc00ty�1t"=U2z�6t7tf602OO4t,4{�5t|�}�8t~ŀŁłŃ�9t�Ņ�'M��:t��;t�ʼnŊ�<t�ŌōŎŏŐőŒ�RK��=t�ŕŖŗ�>t�řŚśŜŝŞş�?t��@�A�B�C�^t<Ah<D�+I^QueE�F�G�H�3\URI�J�4\,05\K�L�Z=M�9\N�O�P�BXQ�7\sSR�VI:\6\S�;\"CT�U�V�W�<\E\=\X�Y�_N%VZ�O\[�M\\�]�R\f=+B^�8\K\N\>\R7E0G\>PA\(;_�<7L\`�a�F\?\[Gb�c�d�?Q@\e�f�J\g�h�P\i�j�-NB\k�C\H\I\T2Q\UKl�7T[\_\&Lf\m�gC\\n�o�A?Y\p�z069e\S\q�D\V\tH`?r�s�t�u�;Iv�w�x�=1y�"Sz�{�Z\|�}�U\~�;F��^\�ƂƃƄƅ�BW/C67QG)Cb\X\k\T\�Ƈ�]\��%>W\��`\�Ƌ�c\d\��x\�Ǝ�a\"]g\�ƐƑƒƓƔƕƖƗƘ�k<D4�ƚ�#Cg2z\��r\��o\��|\n\pRh2��WHcH{\��m\��@�A�w\B�C�u\D�E�#>t\F�]2G�H�I�J�K�s\v<h\D;L�s@M�N�O�P�Q�T<i\j\R�q\v\y\45S�YHg;~\}\+S!]#]%]qR$]&]'])RT�U�V�W�X�Y�Z�I:)][�\�6]1]4]]�^�_�`�a�b�c�0]NFd�e�r@f�g�h�i�/Ij�k�l�l\.]m�n�o�p�7]q�r�p\/]s�8]t�,]u�v�w�x�y�z�{�9]3]-]*D|�}�~ǀ�(]3@+A*]+]��2]q;5](S:]��;]'C�DŽ�R]<]�džLJ�Q]��=9�NJ�U>��z>�Ǎ�J:�ǏǐǑ�J]��E]��?]�Ǖǖ�K2C]��K]$2U]�Ǚǚ�>]�ǜǝ�PFP]�ǟǠ�@�A�T]bAF7B�C�D�E�F�N]O]G�H�I�D]J�K�L�=]M�M]QLN�I]O�P�Q�R�B]HC<F.NL]S�H]T�U�V�W�X�Y�A]Z�[�\�F]\B]�^�_�`�a�b�)S*SS]tOxHc�d�e�f�g�h�i�j�f]k�l�m�n�o�p�G]q�r�s�`]dBt�u�v�w�x�y�z�{�a]|�}�~ȀȁȂȃȄȅȆ�W]�ȈȉȊȋ�xV��Y]X]p8V]�ȎȏȐ�OF��-6�ȓȔȕȖ�b]��y:aTg]�șȚ�P4��Z]��{?c]��_]��]]�Ƞ�@�A�B�C�D�Y5E�F�G�H�[]\]^]I�/=d]J�e]K�L�M�N�O�P�Q�R�u]S�ICT�U�bKV�W�X�Y�r]Z�[�\�]�^�_�`�a�b�c�d�e�f�aXg�h�QFi�t]j�k�l�tUs]p]m�n�l]o�o]p�h]q�r�nPs�t�u�v�XHn]w�x�i]y�z�j]rK{�m]|�}�M1~ɀɁɂɃɄ�6@��;<q]�ɇ�w]��v]k]�ɊɋɌɍ�nE�ɏɐ�{]�ɒɓɔɕɖɗɘəɚɛ�$^�ɝ�#^�ɟɠ�@�A�B�C�D�E�F�G�H�x]I�J�K�L�oCM�{BN�O�P�aUQ�R�5NS�T�U�V�}]W�L2X�Y�Z�[�\�]�^�_�`�hD_Ja�b�c�d�e�f�g�h�i�j�>Gz]|]~]"^*0N1k�l�m�n�o�,^p�q�r�s�&^6=oHt�u�v�w�x�y�z�{�|�}�~�!^�ʁ�%^�ʃʄʅ�)^�ʇʈʉʊ�(^�ʌʍ�'^�ʏʐʑʒʓʔʕʖ�-^��LT�ʙʚʛ�3^*^.^�ʝ�Y@�ʟʠ�@�A�!16^B�1^C�D�E�F�G�H�I�2^J�K�L�M�N�O�P�Q�R�S�T�&Q5^U�V�W�X�Y�Z�[�/^\�]�^�0^_�=P`�a�b�4^mJ9^c�d�e�f�g�h�8^i�7^j�k�l�m�n�o�p�;^q�r�s�t�u�v�w�e=x�y�z�{�|�X2jC}�~�:^��:E�˂˃˄˅ˆ�<^�ˈˉˊˋˌˍ�YL�ˏːˑ�*7�˓˔˕˖˗˘˙˚˛˜˝˞˟ˠ�@�A�eTB�C�D�=^E�F�G�H�I�?^J�K�L�M�N�O�P�Q�R�S�T�"DU�V�W�X�A^Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�>^i�@^j�k�l�m�n�o�p�q�r�s�t�u�v�w�:Ux�y�z�B^{�|�}�~̀́̂̃̄̅̆̇̈̉̊̋�.r";2B0EGB�̍�/r�̏̐̑̒�iP�̔̕�]S�̗̘�=k�̛̜̝̞̟̠̚�f30r@�1rA�B�-JC�D�E�F�G�H�I�g:3r5r4rdK:O2r4JORlBJ�K�L�M�N�O�P�CN8rv07rQ�R�S�T�U�>rV�O2W�X�Y�Z�[�\�AQ:r]�^�_�`�a�<riTb�c�;r6r?r=rd�9re�f�GrDrFrg�h�JrBr@ri�j�k�Erl�m�n�o�p�{Vq�r�s�Art�yG_Iu�HrF905v�w�CrIrPrVrx�y�W;z�{�|�Ur\M}�kV~̀�RrTr�͂̓̈́�r8�͇͈͆�Kr�͊͋�NryB��]ULrMrOrSr�͎͏�Yr<S�͓͑͒�j6��qJ��d7Wr�͗͘�XrZr]r[r�͚�\r�͜͝͞�QQQr��IM��ON)V@�crA�[CB�`rC�D�/@lr^rE�arF�G�H�hrI�J�K�L�brM�N�grO�P�frQ�R�irS�T�U�_rV�W�drjrX�Y�Z�[�\�]�^�,Seru2_�`�rra�+Pb�c�d�e�urf�g�h�H;i�yrj�k�l�m�n�o�prp�q�vrxrzrr�s�t�u�v�w�x�y�srz�qr{�|�}�{:~�{5�΁΂΃�orwrmrnr�΅Ά�kr&s��#s�Ή�"s�΋�tr��ZH�ΎΏΐΑ�{r�ΓΔ�%s�ΖΗΘΙΚΛ�xC�ΝΞΟΠ�@�A�B�}rC�D�'s)s$sE�|rF�G�H�+sI�*sJ�K�L�M�]BN�O�.sP�Q�0sR�S�T�U�V�!sW�X�Y�1s,sZ�[�\�]�^�/s~r-s_�`�a�b�c�d�e�2sf�g�h�i�4sj�k�l�m�(sn�o�p�q�3sr�s�t�5su�v�w�x�y�z�{�|�}�~�7P�ρςσ�8s�υφχ�yY�ωϊϋόύ�9s�Ϗϐϑϒϓϔϕ�7s��dH6s�ϘϙϚ�:s�ϜϝϞϟ�;s@4��@�A�B�C�D�E�F�G�H�I�J�K�L�M�CnN�O�P�Q�R�S�<sT�U�=sV�W�X�*QY�Z�[�,tFP\�]�^�_�`�a�PP\Qb�c�d�e�f�g�NOh�i�V=j�CQk�l�m�n�o�p�q�b:iaBRBq92r�s�m1Cqt�@ID3u�rYv�%Kw�Dqx�y�z�{�TV|�}�~ЀЁ�Eq@tFq��,TGq��@0At�Ѕ�Bt�Ї�|4��[E�ЊЋЌ�;L�ЎЏ�dP�БВГД�`M�ЖЗИЙ�Hq��sY�МНОПР�;1@�.OA�B�C�$8D�E�F�G�H�JqI�J�K�L�KqM�N�O�P�C2QAQ�R�0WIqS�T�LqU�V�W�X�NqY�Z�[�vY\�aR#T]�^�Ct9H_�`�a�b�c�Dtd�e�MqOqc?Pqf�g�Tqh�i�j�k�l�m�n�VqQqo�QIaEp�q�r�cB|9s�t�Squ�Uqv�w�x�S9y�z�{�|�}�~р�[q�туфх�V:��}0Yq�шщъы�XqRqZq�эюяѐ�Wq�ђѓ�lH�ѕії�JM]q�љњћ�=e�ѝў�\q��^q��@�A�B�C�D�E�F�G�H�_qI�J�eOK�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�Ets=d�e�f�g�h�i�`qj�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�aq~Ҁҁ�wN��*R��{q�҅�28�҇҈҉ҊҋҌҍҎҏҐґҒғҔҕҖҗҘҙҚқҜҝҞҟҠ�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�{<[9_�f9YCSJhj@@u>ijjjkj`�ljmjnjojG=a�b�c�{ud�e�f�}ug�~uh�|ui�j�k�l�b=m�!v%4n�o�p�q�"vr�s�t�#vu�v�w�2lx�y�z�{�|�}�~ӀӁӂӃӄ�TQ�ӆӇӈӉӊ�jY�ӌӍӎӏӐӑӒӓӔӕӖӗӘәӚӛӜӝӞӟӠ�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�$v`�a�b�c�d�e�f�g�h�:ni�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~ԀԁԂԃԄԅԆԇԈԉԊԋԌԍԎԏԐԑԒԓԔԕԖԗԘԙ�2U�ԛԜԝԞԟԠ�@�A�B�C�D�E�F�G�~S\LH�I�J�K�L�M�N�O�DJP�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~ՀՁՂՃՄՅՆՇՈՉՊՋՌՍՎՏՐՑՒՓՔՕՖ՗՘ՙ՚՛՜՝՞՟ՠ�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�@ec�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~րց�%v�փքօֆևֈ։֊֋֌֍֎֏֐֑֖֛֚֒֓֔֕֗֘֙֜֝֞֟֠�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�/>`�a�b�c�d�)Fe�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~׀ׁׂ׃ׅׄ׆ׇ׈׉׊׋׌׍׎׏אבגדהוזחט�%ZF<)6<8OH%<&Z'ZVLCH(Z}F��5QiR6QG<��2=d;)Z*ZHQ+ZmPo6[B��OKm7hIC7w>$V,Z-Z@FgW6J��)U_KoU.Z_VJ40Z/Z��kR1Z2Z3ZTJ4Z+J5Z6ZO3oV7Z0;.58Z9Zn9/QhR:ZC8jOo2;Z<Z��k=\NoS=ZsN>ZUSe;?Z5KPK@ZkGnVAZ5EA6BZL7N?CZDZ-KEZw5FZBA;WGZ8L��jR1DHZ}5Q;IZ3PJZKZ=NLZMZNZw2QZOZhQPZUCRZ��SZTZUZ;P%Ry0VZ+GWZw=!CXZYZ}C7LZZ[Z>@WF\Z]Z4G^Z_ZH9@�A�B�C�D�E�F�G�H�m;I�J�K�L�96xtM�ytN�O�cMP�Q�R�S�T�U�V�W�9uX�Y�Z�[�`k\�]�^�_�`�a�sO?;b�c�d�e�f�g�h�@:%Ti�j�k�l�m�n�o�Yap�q�r�s�tu*1r2t�u�v�w�x�y�z�uu{�|�wu}�~؀�Q:vu��2C�؃؄؅؆؇؈�yu�؊؋�xu�؍؎؏ؘؙؚؐؑؒؓؔؕؖؗ؛؜؝؞؟ؠ�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~ـفقكلمنهوىيًٌٍَُِّْٕٖٜٟٓٔٗ٘ٙٚٛٝٞ٠�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�41jU:8O�19F2pTMO\0KUu;JV770L6Fa1:9|Va9!7z<Zj[jyLs9\j{43CQ7X:]jtT^jV<_;_j^A8B_TJW`jajdjbjcj^I38D6ejjJMIM4P�Q�YbbEfj5@R�8Wgj,W|HSXMX^TS�yTDI.SS8`3T�bIvtU�V�W�U:X�wtY�Z�_W[�\�qt08TUO8pF]�^�_�`�a�b�c�d�e�C3f�g�rt,3h�i�j�k�=TwGl�m�n�o�p�ttq�r�sts�t�u�v�w�x�y�z�{�|�KL}�~ڀ�$H�ڂڃڄڅچڇڈډڊڋڌڍ�ut��cW?E@u�ڐ�;u��Cu��Bu��:VAu�ڕږ�>TDu��Lu�ڙښڛ�O0x5��IuJu��\E�ڟڠ�@�EuFuA�B�GuKuC�`>Huz8D�E�F�PuSuG�H�I�g?J�r9<uMuK�L�7BM�N�O�xLP�y<Q�NuOuQue6RuR�UuS�T�U�V�W�X�Y�=uZ�[�\�Tu;S]�l3^�_�$L`�a�b�c�Vud�e�f�g�h�i�j�k�Wua>Xul�m�_L[un�o�p�q�r�H2YWs�Yut�Zu\uu�buv�w�x�`uy�z�{�_u]u|�}�au~ۀ�^udueu��cL�ۃ�?e85cuhu#L�ۅۆۇۈ�fugu�ۊۋیۍێ�>u�ېۑےۓ۔ەۖۗۘۙۚ�D1�ۜ�?u�۞�E5d2��luiu��W6@�muA�juB�C�D�E�F�kuG�H�Z4I�jTJ�K�L�nuM�y3N�O�P�Q�R�S�T�ouquU�V�W�puX�Y�Z�[�\�]�^�ru_�su`�a�b�c�d�e�f�g�h�i�j�k�mI*9l�m�{Gn�o�c6p�q�r�s�t�u�v�ILw�x�y�z�{�|�}�~܀܁܂܃܄܅܆܇܈܉܊�&j�܌܍܎܏ܐܑܒܓܔܕܖܗܘܙܚܛܜܝܞܟܠ�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~݂݄݆݈݀݁݃݅݇݉݊݋݌ݍݎݏݐݑݒݓݔݕݖݗݘݙݚݛݜݝݞݟݠ�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�53~Tl9yPa�mi*WniVBmHd:oipiqiaVrisiuitiviwiaGxiXTyiN=b�zi{iO=|i(8>A}i21T;u9~ic�!j"j#jx7-<d�dJN`/T=O7U$j^U%jAP<9e�G4Y1f�g�h�1@i�j�k�l�f1g1m�h1n�o�p�q�=3hHr�s�t�u�Aev�w�_1x�y�z�IAo4{�|�(GXS}�yF8Q~�}9uB�ށނރބ�-S��KT|=��Be57Ce�ވ�9;bU��x=6T%N,AY3�ދ�vL��FeDeHe��JeGeO5HF��|5Ee��vJ�ޑ�Ie�ޓޔ�TCE1#<�ޖޗ�7W�ޙ�KMMKJJSLLeKefD�ޛ�!Q7QMe��Pe��8MpVOe]5��>M��Qe:6��@�(Md9A�EJQ3YKlTRej7B�C�D�NeE�F�G�H�I�J�Ue~4VeK�L�M�N�O�SeTeP�]RQ�R�_BF1S�bST�U�]6lKV�WeW�X�vSY�Z�[�\�]�i1^�t6ZeXeYe@5_�`�a�ER\eb�c�^ed�e�f�g�h�i�]e2Gj�#Rk�l�[em�n�o�p�bTZUq�r�s�t�u�`eqWv�w�x�y�z�{�|�ae}�\1{Q~�bede�߁߂߃�ce�߅�ee�߇߈߉ߊ�XR��K5��_g��uZ��xZ��vZ��wZ�ߒߓ�zZOPGD�ߕ�n0�ߗߘ�0P��yZ��JS*:"[qG��|Z{Z[I}Z��![^W~ZZA�ߞ�%[�ߠ�tS@�A�'[$[B�([C�D�<=E�F�G�I@#[&[#VH�)[I�J�K�-[L�M�N�.[,[B:O�P�Q�$?+[R�S�T�*[GT?2U�V�/[W�y9X�0[Y�Z�[�\�;3]�^�_�&5`�a�b�c�<61[d�e�f�u6g�2[h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�I1|�}�~��4[����3[5[������������7[��6[��������8[����������9[��@�:[A�B�OSztuGCWdE|t}t{tC�F>D�E�F�G�oPH�I�S7J�K�MT*LL�M�"u!u(:~tVKN�O�P�$uR@Q�j3R�*M%u#u4=(uS�)uM=8Ca?aK*uT�U�V�&u'upDW�X�Y�Z�[�,u\�<4]�mW^�W4+u.u_�`�-u/uQPa�b�c�d�e�f�g�QC)Hh�i�j�k�l�m�0u1un�o�p�q�r�s�2ut�u�3u4u5uv�w�x�y�7u6uz�{�|�}�8u~������������I2��TSMJ��o@XV0R?A��p=�����������*8����������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�x<n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~���������Fv��������������������������@�A�B�C�D�E�GvF�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�Hv_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�Ivt�u�v�w�x�y�z�{�|�}�~���������������������������������Jv��@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�Lvc�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�������������������������������Kv����@�A�B�C�D�E�F�G�iwH�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�MvO�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�Nv{�|�}�~����������������������DnEnFnkU$6HnGnInJn%GKnLn��07v5MnOn��Nn��F8PnQnRn[6.3SVFD51V8SnTn?TUG{>YN39VnUnXnWn%EYnZn.G[n/G\n'2]n^n_n`nanjWbncnX<dnKSzL,2eAen&G-C��fngnhninjnknln��mnnnon���pnqnrntnsn��un-MABvnwnxn!Uyn3Ozn{n��|n}n!o~n"ou8zC#o$oB=?Ry2%o&o'oxR(o}V)oLF��*o+o4A,ozOxK.o-oz3x9/o0obP1o2of7?P3o4o5oqH`L6o7o8o9o:o`U;om4*C<o��=o>o?o��}N@o`B846Wu=@�GOCoAoBoDo'6|<b>LCEoFoA�GoOoHoIoJoBGqoM6KoB�LoMoF6>CNoC�PoQoRorUD�SowDE�ToxDUoVod8w0WoXoYoF�Zo[o\o]oG�^o5>ao_o`oH�bocoMAdoeofogohoiojokoloX@I�mo-AnooopoJ�K�bOL�M�N�O�P�Q�R�S�$3T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�ECEcAIFc\�U1JN34rHGcPOHcd<IcJcFC"UVDk9ENKcvCLc]�'7s8R:McNcDTOc^�PcKQQcRcScTcVQUc{2;@Vc_�+@WcXcYc`�Zc[ca�78bZb�S6c�dZcZd�e�f�g�h�i�j�fZk�l�m�nHn�o�eZ@7tQuRsUW=p�q�r�s�hWhZgZt�"0SMu�iZv�=8J<=B$BB3jZw�*B0D5=x�y�^Oz�{�|�kZBI}�~����]1����lZ��86:T��}3���mZITUOcE��nZ������oZ��pZjAUL]O��������������gS!B��qZ���eK@�rZA�fK~RB�C�D�t8E�F�sZ/06OG�H�OUI�J�K�L�M�N�O�P�Q�R�mKS�T�U�V�W�X�Y�Z�tZ[�\�Dc]�^�%A_�`�?va�b�@vAvQDc�8HcQd�e�[PEQ/<M9f�tog�h�F4:SBv{3i�j�Cvk�l�q5m�n�o�p�q�r�s�t�u�v�Evw�x�y�z�{�|�}�jS'v)Q~����)v����(v���cAW@��"1�����mN��hP+v���vO��*vpU,v9C����t;.v-v����^D���XA������*K��<O���@�A�B�C�D�E�F�G�H�/vI�J�0vK�L�1vM�6BN�O�P�Q�R�T0yES�T�U�V�2vW�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�`G&vj�k�8>l�m�2>n�e5o�p�G7q�??RCfCr�s�LXt�u�v�o8w�x�y�z�{�|�}�~��y=%Q��P0������0w���������1w������,P��00����2w3w��4w����JG������@�A�O>B�C�7wD�E�F�G�H�I�J�6wK�^1L�5wM�N�8wO�9wP�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~���$NMH��+:8h9h:hB>������tR��OTXI�������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������������@�A�B�C�D�E�3R%6jG|qnO3KkPoggMK9Y6}qd0LK~q$T-BlADF1>!rU<F�"r#rG�$rCR5FH�GM%rI�1SE?bLJ�&r'rUQn6(r)r_5*r+rK�|2,r-r'HL�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�g7r�s�)l*l+lt�,lu�v�.F-l.lw�x�y�I73Jz�{�|�}�~���8bOw��������������������������������@�A�B�C�D�PwE�F�M2G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�Qwd�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�����������SwRw��������������;b��"<��<b=b>b?b@bAb97{R$=NJ%1GK��Bb|6DHCb���H=��}1Db��v6EbYD���FbZO]9Gb!@��Hbv2@�IbA�sAJbKbxBLbMbNbWJ8XeYcOB�C�D�E�F�G�H�I�J�K�L�%pM�N�0\O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�mB&TTM1Q[3}GR�52?B`f;JafbfT>cf$WUMef]<dfffgfnBS�>=hffB':ifT�jfR3iQU�V�%?kfoFlfmfW�X�nf-FofY�'Ipfqfrf9esftfbBufvfhVwfZ�xfG9[�\�]�^�_�`�a�;w:wb�c�d�e�>w<w!:f�?wg�@wh�i�j�BwAwDwk�l�Cwm�n�o�p�q�EwFwr�s�t�u�Gwv�hKw�x�y�z�_8{�|�}�~���Tw��Uw�����Vw�����Xw��Zw��Ww����������[w��Yw��������WW����@�\wA�B�C�D�E�F�]wG�H�I�^wJ�K�L�M�N�O�P�Q�R�S�T�_wU�V�W�`wX�Y�Z�[�\�]�^�_�`�a�b�K[c�d�*Xe�f�g�h�i�j�k�l�wem9m�n�o�p�}?j;IwGFHwq�JwLwKwr�s�t�Mwu�:Nv�Nww�x�'Dy�z�{�|�}�~����������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�������������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�������������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~���cS����Ov��3BPv����QvRvSvTv����Vv��+1Wv��XvYvZv��[v\v��������]v^vJO��_v`vavbvcvdvp@evfvgvhviv��jv��kvlv��mvnvovpvqvrvsvtv(>��uvvvwvxv����������zHyvzv{v|v����}v~v!w"w#w$w%w����&w'w(wn1)w*w+w����,w-w[A.w����/w@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�������������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�������������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�������������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�qD/p&<0pyC\�8E;Q]�1p2p3p4p5p<Q^�lQ_�7p6p'T`�RM8p:p9p;p<pa�b�k8=ph:c�>p?pi>@pl6ApBpCpDp5HEpFpd�GptEe�Hpf�g�h�Ipi�Jp=wj�KpLpMpk�Npl�m�n�o�OpW:p�PpQpRpSpTpUpVpXpq�r�%SWps�Ypt�u�v�w�x�y�z�{�|�}�:u9B~���dw��������ewfw����gw������������hw4B������������������jw��kw������������sB��������@�A�B�C�D�E�F�G�H�ptI�J�K�otL�M�iBN�awbwO�P�Q�R�S�F;T�U�V�W�dYX�Y�Z�rJh@$p[�Z:\�]�-G^�_�`�,Da�b�lwmwnwc�pwowd�qwe�f�twg�swh�rwuwi�j�k�l�vwm�n�o�p�q�r�s�t�u�imv�jmkmw�<vx�y�z�{�|�}�~�����������=v��>v&6��>X����D9������;X��1\������������sJ��ww������������������xw����yw����@�A�B�C�D�{wE�zwF�G1G�|w}wH�I�J�K�L�~wM�N�O�P�Q�R�S�T�U�V�W�kF4lX�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�������������]33v����4vdA5v6v7v8v9v:v#H;v������������������������zA(9hm������j9_Y����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������@�A�B�C���D���E�F�������G�������������H�I�J���K�L�����M�N�O�U��������������������������h�i�j�k�l�m�n�o�p�q���r�s�t�u���v�w�x�y�z�{�|�}�~���������������������!#"###g!%#&#'#(#)#*#+#,#-#.#/#0#1#2#3#4#5#6#7#8#9#:#;#<#=#>#?#@#A#B#C#D#E#F#G#H#I#J#K#L#M#N#O#P#Q#R#S#T#U#V#W#X#Y#Z#[#\#]#^#_#`#a#b#c#d#e#f#g#h#i#j#k#l#m#n#o#p#q#r#s#t#u#v#w#x#y#z#{#|#}#+!������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������i!j!V�~#W�$#������������������������������������������������������������������������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~��������������������������f�g�h�i�j�k���������������������������������������������������������������������������������������������������� m�������������������n�o�����������������������p�q���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E���������������������������������������������������������������������������������������������������������������������������������������������������������������������r�s�t�u�v�w�x�y�z�{�|�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������}�~�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������>0�/�/�/�/�/�/�/�/�/�/�/�/������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	�
���
������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3������4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�.���.s4G4�.�.�566�.�.n99&��9�9s:�9+�,�N;n<�<�.1�2�.V@_A�.7C�.�.�.;�C�C�.�C�DaFLFC�#G)G|G�G�.GIzI}I�I�I�I�I�I�I�I�IT�U�L�L�L�LwL�LMMMMMMM�Md�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�������������������������������������������������������������������������������P�����T�������W�����X�]���������������������^�������������������������������k�����n�������q���������s�����t�u�������y���������������������������������������������������������V���������������������������������������������������������������������������������������U�Z�\�����������������������[�`���������������������������������������������������������������������������������������������������������������������������������������������������������������������������_�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������b�e�����������������������������c�d�h�i�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������j�o�p�r�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������x���������w���������������������������������������������������������������������������������������z�{�}�����������������������������������������|���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ªêĪŪƪǪȪɪʪ˪̪ͪΪϪЪѪҪӪԪժ֪תت٪ڪ۪ܪݪުߪ���������������������������������������������������������������������������������������������������������«ëīūƫǫȫɫʫ˫̫ͫΫϫЫѫҫӫԫի֫׫ث٫ګ۫ܫݫޫ߫���������������������������������������������������������������������������������������������������������¬ìĬŬƬǬȬɬʬˬ̬ͬάϬЬѬҬӬԬլ֬׬ج٬ڬ۬ܬݬެ߬���������������������������������������������������������������������������������������������������������­íĭŭƭǭȭɭʭ˭̭ͭέϭЭѭҭӭԭխ֭׭ح٭ڭۭܭݭޭ߭���������������������������������������������������������������������������������������������������������®îĮŮƮǮȮɮʮˮ̮ͮήϮЮѮҮӮԮծ֮׮خٮڮۮܮݮޮ߮���������������������������������������������������������������������������������������������������������¯ïįůƯǯȯɯʯ˯̯ͯίϯЯѯүӯԯկ֯ׯدٯگۯܯݯޯ߯������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�������������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�������������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�������������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�������������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�������������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�������������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�����������������������������������������������������������������������������������������������������������������������������������������٦ڦۦܦݦަߦ�������������������§çħŧƧǧȧɧʧ˧̧ͧΧϧЧ�������������������������������������������������¨èĨ�����������������������������X�[�]�^�_�����������������������������������������������������������������������������������Q�R�S�����������Y���������������a���������f�g���������l�m�����������������v���������������~�����������������������������������������������������������������������$��&��-��2��Q��Y��_��`��d��g��h�im~*�,C�EG�IL�Nj�l����2��3��4��5��6��7��8��9�PUR`�b���� ��!��.�����������%PP3R 4  �  �  � $ �' / �1 1 4 4 6 : 	< � � !~!!�!!�
!!�! !�"!_!�l!o!, z!�!0 �!�!F �!"H 	""� ""� ""� ""� ""� !"""� $"$"� &"&"� ,"-"� /"3"� 8"<"� >"G"� I"K"� M"Q"� S"_"� b"c"� h"m"� p"�"� �"�""!�"�"%!�"�"0!�"#I!#_$�!j$s$�"�$�$�"L%O%V#t%�%Z#�%�%g#�%�%j#�%�%t#�%�%�#�%�%�#�%�%�#�%�%�#�%�%�#�%&�#&&�#
&?&�#A&A&$C&�.$�.�.A,�.�.C,�.�.F,�.�.H,�.�.R,�.�.a,�.�.c,�.�.f,�.�.j,�.�.l,�.�.o,�.�/},�/�/�-00�-00�-0 0�-*0=0�-?0@0�-�0�0�-�0�0�-�0�0�-�01�-*12�-*202�.22�2�.�2�3F/�3�300�3�3<0�3�3>0�3�3`0�3�3i0�3�3k0�3F4m0H4r4�0t4�5	1�5
63266�269�29m9�5o9�9�5�9�9_6�9r:m6t:M;7O;m<�7o<�<�8�<U@j9W@^A�<`A6C�=8C�C�?�C�C2@�C�C6@�C�Da@�DKFYAMF`F�BbF"G�B$G(G�C*G{G�C}G�G�C�GFI
DHIyI�E{I|I�E~I�I�E�I�I�E�I�I�E�I�IF�I�IF�IvL)FxL�L�H�LMIM�M~I�M�MJ����cJl�l�����������������̂��͂�%�҂'�*�ق-�0�݂3�:��<�B��D�S��V�c��e�+��-�x�Փz���!����<�������������������������"�"���%�&���*�/���2�2�ĘE�H�ŘS�S�ɘX�X�ʘg�g�˘l��̘_��a�������;�LA���<B��C��xfD��� F��pI����K���K����L��0�M���9N��cN��x�N��4|P���\R��LT���\T����V���W��W��0�Y����\��D�_���b��(|c���Ld���zRx�$P@���FJw�?:*3$"DA���$\�M���H�A��
ALzRx��� �A��J<��N���I�B�B �A(�A0��
(A BBBF zRx�0�����(nB���D,PP���F�R�H �B(�A0�F8��
0A(B BBBD zRx�8������(�C�����Q��
D��Q���F�B�I �B(�A0�A8�.
0A(B BBBD�3F���T��
0�S��D{H��"xX�S��O�E�E �B(�A0�D8�G@"
8A0A(B BBBM8C0A(B BBBA������C@������ zRx�@������(�G���H�U��PF�E�B �E(�A0�H8�G@)
8D0A(B BBBA�`H��2Hl�X���F�B�B �B(�A0�A8�D@
8D0A(B BBBA�2I��ol�[��`O�B�E �E(�A0�H8�G@8
8C0A(B BBBA�
8A0A(B BBBAI������lI��*,P�\��^F�A�A ��
ABAzRx� ���$�H��Q��]��
@��^���F�N�B �A(�A0�G��
0A(A BBBAGNU��P�P �!"R@"hR@
"oR@="xR@-"@�!gR"Rp;pL)R0=�I-R?PFRAA�C�C0P�CgR`�@�"�@���@�b�@��@�^�@�ܻ@�Z���,�X�z���6����������j���&���������������d��� �����������T�P�@�@���@�<�@���@�8�@���@�4�@���@�0�@���@�,�@���@�(�@���@�$�@���@� �@���@��@���@��@���@��@���@��@���@��@���@��@���@��@���@�������"��N�@�P�@���@���@���@�D�@��@���@���@�L�@��@���@���@�T�@��@���@���@�\�@��@���@���@�d�@�&�@���@���@�l�@�.�@���@���@�t�@�6�@���@���@�|�@�>�@��@���@���@�F�@��@���@���@�N�@��@���@���@�V�@��@���@���@�^�@� �@���@���@�f�@�(�@���@���@�n�@�0�@���@���@�v�@�8�@���@���@�~�@�@�@��@���@���@�H�@�
�@���@���@�P�@��@��@���@�X�@��@��@���@�`�@�"�@��@���@O�R!~|S1|T!~�T!svU!v"V!X�V!q4W!i�W$o^X!~Y!~�Y!~�Z!~N[!~
\!~�\!~�]!~>^!~�^!~�_!~r`!~.a!~�a!~�b!~bc!~d!~�d!~�e!~Rf!~g!~�g!~�h!~Bi!~�i!~�j!~vk!~2l!~�l!~�m!~fn!~"o!~�o!~�p!~Vq!~r!~�r!~�s!~Ft!~u!y�u!~pv!~,w!~�w!~�x!~`y!~z!~�z!~�{!~P|!~}!~�}!~�~!~@!~�!~��!~t�!~0�!~�!~��!~d�!~ �!~܅!~��!~T�!~�!~̈!~��!~D�!~�!~��!~x�!~������������X��p�>>r�Gs���������x�ssz�NN|�n�b�VVd�__f�7�������La��#���G���w����,��,��,��,��,��,��,��,��,�d������JQ�\���Qp;����fh`����B(	�&)p �x��
����������!�#�%�'�)�+�-�/�1�3�5�7�9�;�=�?�A�C�E�G�I�K�M�O�Q�S�U�W�Y�[�]�_�a�c�e�g�i�k�m�o�q�s�u�w�y�{�}��������������������������������������������������T�,��)�0k���Ufv�-
�Q�!�!���o`��
�@O"P�,(h%	���o���o����o�o����o�@M". .0.@.P.`.p.�.�.�.�.�.�.�.�R�NgR�RP"GA$3a1�-�Q_codecs_cn.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debugc��7zXZ�ִF!t/���]?�E�h=��ڊ�2N�`�� �ދ|t��'�'�	��A�A"�@#m���r���	���;%j���of��zY˯��B-�!���z������$�X��?ko1����#''df�������<b�Kf0MԕQ�#�f9K�N�`Y%M��j[c�7��Զ�ς�-�x1��e�3�X�NIKx����M�M�E:�T�YmiE�w�A�/����8""-$V1��6��v�>�}�n�f�L)���V�f@�Tw�ѥx�p���� ��RQ��&�%���bf���g\iV���#&$��c7�A�q�ݘd��)����s�T�V}v�-�3��Ń��o|<����s]�`������Z킶ʉ�"��~�H9s~a���:$%�!�7[�Y�����=�E��Ҫ��g��fޒx,�¿�N;�LB��%d�f.�����d�9X�b1N�9��f�1H˅s�[jv?������| F~mu��i�S>[�ͱwOa+�S������� D�,1��(Q�|oesq��*����Y��Af��o���>\ �y��\�u�i$�F��� g�[�t��ϫ��;e�Q�cL����.��|$
O����=�[���J����<��)����/��$7a�K�9�'����˔�xq�kӮ����䅚�v3��sW$Q%br�㨚g6y��ml��q����c�{��\�k��>�Z�w�}3���%,p�u�<$d뛏&̨��k�O{�_�n������I
oJȬ>���}c:ǐMM�#��@V�����f�]&sJ_�C�«[������5j���U�&/b���tq���?��nz���-���^�Uz�?��ET�aT	g�k��Zx�ʳ
g�X�0ޜςL���t�Ȼ���*���vr�i���������N�Ռ��I1���QN�I���rg�����35��+��5���S�n�Z(̈]���7F��8��мc�U���'�n���ijR�7�=�L�O-�̀*�st�Eg�D�?�����$�2�	����#�4|��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(��@0���8���o��0E���o��@T((h%^B�,�,Ph�-�-c..�n�.�.�w�/�/"}�Q�Q
�RR�� ���������������� ��!���!�� �! � R �@M"@M�@O"@O��P"P� ��P"�P��Pb�P$
�Pd0Q`�U(lib-dynload/_opcode.cpython-38-x86_64-linux-gnu.so000075500000026530151153537500015526 0ustar00ELF>@&@8	@�� �� �  @@ @ 888$$���  S�td���  P�td���,,Q�tdR�td�� � GNU��I�-S;s�Ԡ�?wOS��*�@ ���|�DZCE���qX � �, �F".�r�b����>�! ���! �! __gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6_PyArg_UnpackKeywordsPyFloat_TypePyExc_TypeErrorPyErr_SetStringPyType_IsSubtype_PyLong_AsInt_Py_NoneStructPyErr_OccurredPyExc_ValueErrorPyLong_AsLong_Py_TrueStruct_Py_FalseStructPyCompile_OpcodeStackEffectWithJumpPyLong_FromLong__stack_chk_failPyInit__opcodePyModule_Create2_edata__bss_start_endGLIBC_2.4GLIBC_2.2.5vii
�ui	�� �� �    (( (0   �    @h  
p  �    �    �  �� � � � � � � 	� 
� � X ` h 	p x 
� � � � � � ��H��H�9 H��t��H����5� �%� ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A�������%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D��AWAVI��AUATUH��SH��(dH�%(H�D$1�H��tH�Y�H��~
H��1�H��u31�PH��A�1�L�f L��H�D$Pjj�D���H�� H��H��t*H�UH�5U H�zH9�uL�- H�5fI�:�>���1��<����A�ą�u�H�}����A�Ń��tL�I��L�5% H��L����~���H��t��H�}H��M��H��tL�}A��Y~:L9�uL�
� H�5I�9������(������u.�-���H��t$�1�L9�tH�
e H�5H�9����lM9�t*L;=� t'L;=w t$H�=6 H�5/H�?�W����=A���A�D���D���L���=���uL�� H�5'I�8��������u���H��������Hc������H�T$dH3%(t���H��([]A\A]A^A_��H�=� H�� H9�tH�� H��t	�����H�=� H�5� H)�H��H��H��?H�H�tH�e H��t��fD�����=u u+UH�=J H��tH�=^ �����d����M ]������w��������H�=` �����H��H���integer argument expected, got floatstack_effect: opcode requires oparg but oparg was not specifiedstack_effect: opcode does not permit oparg but oparg was specifiedstack_effect: jump must be False, True or Noneinvalid opcode or opargstack_effectjump_opcodeOpcode support module.stack_effect($module, opcode, oparg=None, /, *, jump=None)
--

Compute the stack effect of the opcode.;,��H����pX����(����zRx�$�����FJw�?:*3$"D0����X\���	F�B�E �B(�A0�D8�D`ph[pBxB�I`�8A0A(B BBB�<���GNU��� ((Ufvp

�� � ���o`��
�@ h	(@	���o���o����o�o����o@ �
�
�
�
�
�
 0@��@
��������    �GA$3a1p
�_opcode.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug�\�U�7zXZ�ִF!t/��?&]?�E�h=��ڊ�2N�ss(ŷ�yL�l�����T� �)�$S���U��F_�w�Kz��`��C��%��S�����yL����EK��ͣ�>���t�^�xI�u�EȨ՘����2{��涒`�W��4	l
�����/�+�Aӛ��Ǧ`��#�6]��>��rns
D�[A}����7�飇�W�|6�n2�M���N�s��~�)nFޢK�H�j��`�	g<�xQ�xSz�i�t�a?7;�<u����Sf�P���h�ƕ_>�g�W���Tf�G�<�'�\�LufT1�Mo�@�T�6��6�?����)#k��o��x�i��w��1����U:{?��ve~�#�ա�`Ce$3��<�R�b���06^�U�ى��&���s~�Rt�^�~�H��۞<!Boky��3w�r|�{!
��|/�<P��K�k%6cNG\�B3s_8I����� q���' �u��[�H�geW�X�m���?F�� �@yCK{��!�*Hз�����щ�di���F�%���&^�櫣�o�T��l�&�N�CC���xoT:����
8/��Jg\UHv���s���ʈ"J�"����G�SS�N9��٪O$�Te3'j>�������>i�<\
�W�6W�1,�����)���V�z��(t�Ӟa��0��N��pL���_s����ܕ���{n{���3q��������ba�[/���T���r��a�t^}�i|&��d��r��;�`A�<�uJ�o���ʙ֪I\-�Ηi�cDUb����z���*Ds��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(��X0���8���o��2E���o��0T((@^Bh	h	hp
p
c�
�
�nPP�w�}��
�� ���,������� �� ��� �� @ �@ @�@ @��    �! !�!`!$
$!`�!h�$(lib-dynload/_bisect.cpython-38-x86_64-linux-gnu.so000075500000037260151153537500015530 0ustar00ELF>�
@p7@8	@�� 8-8- 8- �� P-P- P- 888$$xxx  S�tdxxx  P�td���TTQ�tdR�td8-8- 8- ��GNUE��-Z�Y8E����N��@ A��|CE���qX�����1 � , F"��R����cB�02 �(2 �(2 v�__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6PySequence_SizePySequence_GetItemPyObject_RichCompareBoolPyList_Type_PyObject_CallMethodId_SizeT_Py_NoneStructPyList_Insert_Py_Dealloc_PyArg_ParseTupleAndKeywords_SizeTPyExc_ValueErrorPyErr_SetString__stack_chk_failPyLong_FromSsize_tPyInit__bisectPyModule_Create2_edata__bss_start_endGLIBC_2.4GLIBC_2.2.5vii
�ui	�8- �@- �H- H- 0 f0 0 @ 0 S(0 �80 @@0 yH0 �X0 �`0 &h0 �
x0 ��0 ��0 ��0 0  1 �(1 �01 �81 �`1 �h1 �p1 �x1 ��1 ��1 ��1 ��1 ��1 �2 �2 �2 �2 ��/ �/ �/ �/ �/ �/ �/ h/ p/ x/ �/ 	�/ 
�/ �/ 
�/ �/ �/ �/ �/ ��H��H��# H��t��H����52# �%3# ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1�������%m" D���%e" D���%]" D���%U" D���%M" D���%E" D���%=" D���%5" D���%-" D���%%" D���%" D���%" DH������AH�
" H�5gH�9���1��9H���n����!f���AWH��H��AVAUATUSH��HdH�%(H�D$81�H�D$ H�D$����H���.H��#L�wL� E1�L�t$0L�|$(L������I��H����M9�}TK�,,L��H��H�����H��H����1�L��H������H�+��������I��M9��M����H�|$0L�D$(H�5! H9wtb1�L��H�gH�5�" �Q���H��tTH�(�����H��  H�H�L$8dH3%(��H��H[]A\A]A^A_�@L�e�y���L��L�������y�1��H�߉D$����D$�@���H�D$H�
�" P1�H�T$(RH��L�L$8L�D$@����ZY��t�L�d$ L�l$L�|$(L�t$0M��xI�����������H�
  H�5jH�9���1��2����T���@��AWH��H��AVAUATUSH��HdH�%(H�D$81�H�D$ H�D$����H���UH��JL�wL� L��L�t$0L�|$(����I��H��� �tkM��I��ff.�@K�,L��H��H�����H��H����1�H��L������H�m��������L�cM9�|�M����H�|$0L�D$(H�5 H9w��1�L��H�]H�5�  �G���H��tvH�(����H�� H�H�L$8dH3%(��H��H[]A\A]A^A_�f.�L9�~�I���#���H��D$���D$�A���L��L�������y�1��H�D$H�
� P1�H�T$(RH��L�L$8L�D$@���ZY��t�H�\$ L�d$L�|$(L�t$0H�������I���tL9������I�����L���;���I��H��y�1������7������AWH��H��AVAUATUSH��HdH�%(H�D$81�H�D$ H�D$����H����H���L�wL� E1�L�t$0L�|$(L�����I��H���M9�}R@K�,L��H��H���~���H��H����1�H��L������H�mt^����uDL�cM9�|�M����L�����H�L$8dH3%(��H��H[]A\A]A^A_��L9�~�I���s���H��D$�4����D$�H�D$H�
� P1�H�T$(RH�"L�L$8L�D$@�S���ZY��t>L�d$ L�l$L�|$(L�t$0M��xI����������H�
F H�5�H�9���1��>��������AWH��H��AVAUATUSH��HdH�%(H�D$81�H�D$ H�D$����H��uH���H�D$H�
� P1�H�T$(RH�mL�L$8L�D$@���ZY����L�d$ L�l$L�|$(L�t$0M����I�����M9�}DK�,,L��H��H�����H��H����1�L��H�����H�+tw��xou>I��M9��M��x`L�����H�L$8dH3%(u~H��H[]A\A]A^A_�f.�L�e�L�wL� E1�L�t$0L�|$(L���=���I��H���W���1��H�߉D$�Q����D$�t���H�
� H�5H�9�r���1��r�������fDH�=� H�� H9�tH�� H��t	�����H�=� H�5� H)�H��H��H��?H�H�tH�] H��t��fD�����=} u+UH�=: H��tH�=� �9����d����U ]������w��������H�=� �[�����H��H���OO|nn:insort_leftlo must be non-negativenOOO|nn:insort_rightOO|nn:bisect_rightOO|nn:bisect_left_bisectaxlohiinsertinsort_left(a, x[, lo[, hi]])

Insert item x in list a, and keep it sorted assuming a is sorted.

If x is already in a, insert it to the left of the leftmost x.

Optional args lo (default 0) and hi (default len(a)) bound the
slice of a to be searched.
bisect_left(a, x[, lo[, hi]]) -> index

Return the index where to insert item x in list a, assuming a is sorted.

The return value i is such that all e in a[:i] have e < x, and all e in
a[i:] have e >= x.  So if x already appears in the list, i points just
before the leftmost x already there.

Optional args lo (default 0) and hi (default len(a)) bound the
slice of a to be searched.
insort_right(a, x[, lo[, hi]])

Insert item x in list a, and keep it sorted assuming a is sorted.

If x is already in a, insert it to the right of the rightmost x.

Optional args lo (default 0) and hi (default len(a)) bound the
slice of a to be searched.
bisect_right(a, x[, lo[, hi]]) -> index

Return the index where to insert item x in list a, assuming a is sorted.

The return value i is such that all e in a[:i] have e <= x, and all e in
a[i:] have e > x.  So if x already appears in the list, i points just
beyond the rightmost x already there

Optional args lo (default 0) and hi (default len(a)) bound the
slice of a to be searched.
Bisection algorithms.

This module provides support for maintaining a list in sorted order without
having to sort the list after each insertion. For long lists of items with
expensive comparison operations, this can be an improvement over the more
common approach.
;P	4�l���4�����H�����������tzRx�$���FJw�?:*3$"Dh��\\P��F�H�B �B(�A0�A8�D�
8A0A(B BBBE~�H�W�A�$zRx��������,��
\���F�H�B �B(�A0�A8�D�3
8A0A(B BBBKE�H�W�A��!�*XlP�F�H�B �B(�A0�A8�D��
8A0A(B BBBHo�H�W�A�X���F�H�B �B(�A0�A8�D��H�W�A��
8A0A(B BBBK$����GNU���H- Ufv�
8- @- ���o`��
�P/  �
��	���o���o����o�o����o#P- 0@P`p�������f@S�@y��&�
�����������0 �����������������GA$3a1�_bisect.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug���7zXZ�ִF!t/���X]?�E�h=��ڊ�2N���K� ��F\��ة��!�3;�zA"��<���z�mKl���vgb�p͇F=�=p�!1֝Q�rn��3�����O�7.(NQج�T�2e��� �,�3^�R�u��b����B�[���ǿ��H�v�"�*`�0Ģ?^ͬ�ᮠ*)OKX	z��� �h�y]y��eF���z
�2���X�k��a^����sř�Zļ��<�A��d-��x�5�O��||�Ft5�v�
ſۉ����}z��C��
UB����
{ҕ'�����&�cgj�_N0�c�>=u!�=�ݣ\��
�d�il��[ə��]�Q�QKC��m�cIw��
M�����΂�v"�j5��;-�.Ī���V�M�_��n�7
��/R6b/)%t��̵tB=''d���'��A0��L�.Idv��4�Y�2X����V��hs�6�
�y3Z�m�������BđÚ�,�7'�?\i����p�`U	�o.^�|ps`��Ws��Cű�
O//A[5H����p�(�"7!	��h,�r��|.��1Z�k������UJ�����ys-�
6�l��]��\���QZi�8��<-� ��C��/��(SӔ��9λ�+'5n$(�s��eFW�dg*y	?�u��Jg����#u\��Iy��,Y�wL����y����}W�<5H�@��]�6�D�ٽ��Hg3%���\Μ�L�N��9����P�e���O�`�t�$p���e���>H!c'?��hEv`om�qω������;p�*SdX�_c���^�_�Ѽ)�bZ(�]�(��U���ӽIَ��>ȗ��
�pYs�6�ѱ0C��6�����t:���g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(��(0���8���o��.E���o��0T���^B�
�
 h��c  �n���w�
�
U}
�  � ���T�@@8�xx �8- 8-�@- @-�H- H-�P- P-�P/ P/��0 0( �(2 (2�02`(2$
L2`�2�D6(lib-dynload/_posixshmem.cpython-38-x86_64-linux-gnu.so000075500000026730151153537500016453 0ustar00ELF>p@�&@8	@   �� � ��   888$$  S�td  P�td���44Q�tdR�td�� � ppGNU�yg膨����T!��VL��*��` ��|CE��̞���qX, �� �, F"�:��n_��������*h! `! �p`! __gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1librt.so.1libpthread.so.0libc.so.6_PyArg_UnpackKeywords_PyArg_BadArgumentPyUnicode_AsUTF8_PyUnicode_Ready__errno_locationPyErr_CheckSignalsPyEval_SaveThreadshm_unlinkPyEval_RestoreThreadPyExc_OSErrorPyErr_SetFromErrnoWithFilenameObject_Py_NoneStruct__stack_chk_failPyFloat_TypePyType_IsSubtype_PyLong_AsIntPyErr_OccurredPyExc_TypeErrorPyErr_SetStringshm_openPyLong_FromLongPyInit__posixshmemPyModule_Create2_edata__bss_start_endGLIBC_2.2.5GLIBC_2.4q ui	/�0ii
;ui	/fui	/� `�  � � � �� �� �� �  �  �  @   �(  p8  @�  ��  ��    �  � �  �(! � 0! �� � � � � � � 	� ( 0 8 	@ 
H P X 
` h p x � � � � � � � � ��H��H�� H��t��H����5 �% ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h��������%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%} D���%u D���%m D���%e D���%] D���%U D���%M D��AUATUSH��H��H��dH�%(H�D$1�H��uH��~H��H��u2PH��A�1�L�d H�D$Pjj�5���H�� H��H����H�H�Q���uH��H�5�H�=��[���1��~�y yH�H���6���H��H��u#�UH��������u��G����8u+�����u4�6���H��I���;���L��A������E��x��H�
R H��H�9�'���1��
H�t H�H�T$dH3%(t�4���H��[]A\A]���AWI��AVAUATUSH��H��(dH�%(H�D$1�H��tH�i�H��~
H��1�H��u71�PH��A�1�L�� L��H�D$Pjj���H�� H��H����H�H�Q���u!H�eH�5bH�=v����1��1�y yH�KL�%� L�+H�yL9�u�OH��������u��WL���&�����u5H�{�y���A�ƃ��tL�H��u�^���H��t��#H�sH�~L9�uL� H�5/I�8�W���1��L��������u�H�{�����Ń��u�O���H��t�ѽ�L���;���I��H��t6�^���L���D��I������L�����4�����y$�{����8u(�����t����H���x�������Hc�����H�=G
 L��H�?������H�T$dH3%(t�5���H��([]A\A]A^A_�fDH�=� H�� H9�tH�
 H��t	�����H�=y H�5r H)�H��H��H��?H�H�tH�� H��t��fD�����=5 u+UH�=� H��tH�=^	 �����d����
 ]������w��������H�=� �����H��H���strargument 'path'shm_unlinkshm_openpathflagsmode_posixshmemPOSIX shared memory moduleinteger argument expected, got floatshm_unlink($module, /, path)
--

Remove a shared memory object (similar to unlink()).

Remove a shared memory object name, and, once all processes  have  unmapped
the object, de-allocates and destroys the contents of the associated memory
region.shm_open($module, /, path, flags, mode=511)
--

Open a shared memory object.  Returns a file descriptor (integer).;0L���L����t�����������0zRx�$����@FJw�?:*3$"D���0D\(���7F�B�A �A(�J@fHXPBXB`I@�(A ABBX����F�E�B �B(�A0�A8�G`qh[pBxB�I`�8A0A(B BBB����GNU�` � ����Ufq��
�� � ���o`��
E �x�	���o���o���o�o����o 
 
0
@
P
`
p
�
�
�
�
�
�
�
�
 0���@�p�@����������  � �� �GA$3a1��_posixshmem.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debugM
B>�7zXZ�ִF!t/��oC]?�E�h=��ڊ�2N�$0����
�zh��ξ�2�k��e�D��*��߀�/^o��譐ȫ�'p��7�H0���'SE^�Y6���f7�ȕ%O��&\��8u��vDg-C���W�)d��WEU�N�'g���!��|�M^��z��kJ2�y�+�5��9��3�4I�.����F�]�i�f��}-�w%U�*G�5̥dt1L��@�Ƿ�3�_�=�A��z�
O/a����Lok����u�~G��T��÷G��u/�_��S�܁�H���R�e]J�v;�����\ ��ސ}�gcZ��]sA�xD�):�2>�'t����s�_�/�nq�����/.�+�Q1EK��N�exGR�lx@���_5�pL�'���OzE4.�~7����Y��_���QiBR"�_^��[jS��Ƭ�lr��|ꎄ%���i�vU�C��S�CK�#�p�����A4�FE��_D�`�bj��Cx�V�Q�@(,Pίu5/d�w�Vys�n��VX�����B��n���n��(L�WNb�8�s-��0㥚!�:���"��։�ֹ07�ʇ�S���)�����c>�q��.p�Z,W�ƀPҚ�l�g�z��a�c�h�f����z+�V��Ac�.�Ƶ�����&_1�LꞺ,G(�9�G��]W�����k3q��NDK&�0�	̅g�����;�my��C�Z�̥ϓZKQ���u������il{�6M�(ΧW�V|�.cR�C/}vd2�U��X��[0��H�K �6	����:�?����d���Y�P.Ҵp�E�A#p��
�p܌��.�[�V"���4�'<��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(���0��E8���o��>E���opTxx�^B�h��c

@n@@0wpp}��
��� ���4���� �� ��� ��� �` � � ��   ` �`! `!�h!``!$
�!d�!�l%(lib-dynload/_datetime.cpython-38-x86_64-linux-gnu.so000075500000371230151153537500016051 0ustar00ELF>�O@X�@8	@���� ��!�!�$`% ����!��!888$$������  S�td������  P�td�w�w�wTTQ�tdR�td��!�!GNU�/zU�߇U��l��j7E)�e�@  eh������|CE���qX��W*�����eI ����.�w+<��WJ� ���NP@�, ��1�F"9���*��?f���|l_d8����a���Lt����hu����
5>mI�)�"$���PN,|P�!i��!p��!__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libm.so.6libpthread.so.0libc.so.6_Py_NoneStructPyLong_FromLong_PyObject_CallMethodIdPyExc_NotImplementedErrorPyErr_FormatPyExc_ValueErrorPyExc_OverflowErrorPyErr_SetStringPy_BuildValue_Py_TrueStruct_Py_FalseStructPy_FatalErrorPyUnicode_FromFormatPyObject_MallocPyType_GetFlags_Py_tracemalloc_configPyErr_NoMemory_PyTraceMalloc_NewReferencePyBytes_FromStringAndSizePyArg_ParseTuplePyUnicode_GetLength_PyObject_CallMethodIdObjArgsPyObject_Str__stack_chk_failPyImport_ImportModuleNoBlockPyType_IsSubtypePyExc_TypeError_Py_HashBytes_Py_DeallocPyTuple_Pack_PyTime_localtimePyUnicode_DecodeLocalePyUnicode_FromStringPyNumber_MultiplyPyNumber_AddPyFloat_TypePyFloat_AsDoublemodfPyLong_FromDoublePyLong_AsDoublePyErr_OccurredPyObject_HashPyNumber_TrueDividePyUnicode_SubstringPyObject_CallMethodmemcmp_Py_NotImplementedStructPyArg_ParseTupleAndKeywordsPyObject_CallFunctionPyUnicode_AsUTF8AndSize_PyTime_ObjectToTime_tPyArg_UnpackTuplePyOS_snprintfPyUnicode_AppendAndDelstrcmp_PyObject_LookupAttrId_Py_CheckFunctionResult_PyObject_GetDictPtrPyTuple_New_PyObject_MakeTpCall_PyTime_GetSystemClock_PyTime_AsTimevalTime_t_PyTime_gmtimePyUnicode_AsLatin1String_PyUnicode_ReadyPyExc_UnicodeEncodeErrorPyErr_ExceptionMatchesPyNumber_Divmod_PyLong_AsInt_PyLong_OneroundPyNumber_AndPyObject_IsTruePyNumber_RemainderPyNumber_FloorDividePyTuple_Size_PyLong_DivmodNearPyBytes_AsStringmemcpy_PyBytes_ResizePyUnicode_FromStringAndSize__sprintf_chk_PyTime_ObjectToTimeval_PyUnicode_CopyPyUnicode_WriteCharPyFloat_FromDouble_PyLong_AsTime_t_PyArg_UnpackKeywordsPyInit__datetimePyModule_Create2PyType_ReadyPyDict_SetItemStringPyModule_AddIntConstantPyModule_AddObjectPyCapsule_NewPyObject_GenericGetAttrPyType_GenericNew_edata__bss_start_endGLIBC_2.2.5GLIBC_2.14GLIBC_2.3.4GLIBC_2.4f ui	������ti	�ii
�ui	��!�D��!@D�!�! �!�\@�!�YH�!IWP�!�YX�!�W`�!�[h�!
[p�!�Yx�!pY��!�Y��!�Z��!�Y��!.]��!�Y��!C]��!�[ȹ!�`й!�Yع!a�!�Y�!@a�!�]�!�]�!�]�!�] �!�](�!�]0�!�]@�!�]H�!�]P�!�]X�!�]`�!�]h�!�]p�!�]x�!�]��!�]��!�]��!�]��!�]�!<Z �!�[(�!�[H�!fP�!�Yp�!0f��!�[��!���!hf��!�[�!pr�!�[�!�;�!���!`��!pM �!�K0�!p=8�!`E@�!�>H�!�D�!0��!�� �!�[(�!�mH�!WP�!�mp�!H\x�!pm��!wZ��!�J��! s��!�Y��!����!�f�!�[�!0��!�f �!/[(�!`A8�!g@�!�[H�!�yX�!�g`�!\h�!�Fx�!\��!`Z��!`���!�g��!�W��!`u��!%\��!�\��!�9��!h��!3[��!P���!@h�!�Y�!ps�!�h �!A\(�!m8�!�h@�!L\H�!��X�!i`�!D\h�!0�x�!Hi��!�Z��!K��!�i��!�[��! u��!�[��!P���!��!�V�!0E�!�i �!�V(�!E8�!�i@�!�VH�!�DX�!@j`�!V\h�!p!x�!�j��!�[��!���!�[��!�V��!�?��!�j��!�V��!`���!^\�!�V�!�v�!s\ �!V\(�!%8�!�j@�!�\H�!�rX�!�\��!�\��!m��!�\��!�l��!�\��!�l��!�\�!�l �!](�!�kH�!�\P�!�l��!�Y��!P���! k��!`Z��!����!�g��!�W��!`u��!%\�!�V�!@��!(l �!�V(�! -8�!Pl@�!�VH�!�X�!�\`�!�Zh�!��x�!xl��!�[��!���!�l��!Z��!����!�l��!�[��!@G��!�[�!�\�!�l(�!�\0�!�lP�!�\X�!plx�!�\��!@l��!]��!l��!�\��!0l �!�\(�!�(8�!�u@�!�\H�!��X�!�l`�!wZh�!�x�!0m��!�Z��!�%��!pm��!�W��!�u��!�m��!
Y��!����!�m��!�[��! ���!0n�!]�!P��!hn �!�](�!P�8�!�n@�!�\H�!�JX�!�n`�!\h�!�Fx�!\��!�\��!�9��!h��!{Z��!���!o��!�\��!�:��!0o��!�Y��!���!po�!�V�!�6�!(l �!�V(�!��8�!Pl@�!�VH�!�X�!�\`�!�Zh�!�-x�!�p��!�Z��!���!�p��!Z��! ���!�l��!�[��!�F��!�[�!� �!p
 �!��!(�!��!0�!��!8�! �!@�!@�!P�! qX�!pI`�!�Jh�!�np�!�mx�!���!J��!���!���!�]��!(q��!��!�!�\0�!�Y@�!�YX�!�Zx�!�V��!�\��!�\��!�[��!]��!H\�!{Z�!�\(�! �!0�!�\`�!]h�!�]p�!]��!V\��!�\��!�[��!W��!H\��!�[��!W��!H\��!�\�!�\�!�\�!�\�!] �!�\@�!�\H�!�\P�!�\X�!�\`�!]h�!�\��!%]��!]]��!%]��!wZ��!�]��!a] �!<Z(�!�[0�!�Y8�!�Y@�!�YH�!�YP�!AZh�!m]��!�]��!`Z��!�V��!�V��!^�!@y8�!�EX�!�Gh�!�>��!`t��!0���!��!��!@�!�!�+��!�Y��!]��!�E�!��!�!px(�!�DP�!�sh�!�*��!��!��! �!��!�X�!]��! t(�!�!��!~]�!�x8�!�H@�!�!X�!@�h�!�m��!@v��!���! �!��!�!��!��!�!��!`���!�]��!�x��!@���!���!�m0�!�tH�!��h�!��!x�!��!��!�t��!��8�!�]x�!�z��!�!��!����!�s��! r��!`��!��!�!�!X�!��`�!h�!p�!
x�!
��!��!��!��!'��!(��!+��!-��!.��!2ȿ!Dп!Eؿ!V�!X�!d0�!6��!6p�!6�!6��!6x�!ȼ!м!ؼ!�!�!�!��!	�!�!�!�! �!(�!0�!8�!@�!H�!P�!X�!`�!h�!p�!x�!��!��! ��!!��!"��!#��!$��!%��!&��!(Ƚ!)н!*ؽ!,�!-�!/�!0��!1�!3�!4�!5�!7 �!8(�!90�!:8�!;@�!<H�!=P�!>X�!?`�!@h�!Ap�!Bx�!C��!F��!G��!H��!I��!J��!K��!L��!M��!NȾ!Oо!Pؾ!Q�!R�!S�!T��!U�!W�!Y�!Z�![ �!\(�!]0�!^8�!_@�!`H�!aP�!bX�!c��H��H�!z!H��t��H����5Bw!�%Cw!��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&�������h'��q������h(��a������h)��Q������h*��A������h+��1������h,��!������h-��������h.��������h/������h0�������h1��������h2�������h3�������h4�������h5�������h6�������h7��q������h8��a������h9��Q������h:��A������h;��1������h<��!������h=��������h>��������h?������h@�������hA��������hB�������hC�������hD�������hE�������hF�������hG��q������hH��a������hI��Q������hJ��A������hK��1������hL��!������hM��������hN��������hO������hP�������hQ��������hR��������%
r!D���%r!D���%�q!D���%�q!D���%�q!D���%�q!D���%�q!D���%�q!D���%�q!D���%�q!D���%�q!D���%�q!D���%�q!D���%�q!D���%�q!D���%�q!D���%�q!D���%�q!D���%}q!D���%uq!D���%mq!D���%eq!D���%]q!D���%Uq!D���%Mq!D���%Eq!D���%=q!D���%5q!D���%-q!D���%%q!D���%q!D���%q!D���%
q!D���%q!D���%�p!D���%�p!D���%�p!D���%�p!D���%�p!D���%�p!D���%�p!D���%�p!D���%�p!D���%�p!D���%�p!D���%�p!D���%�p!D���%�p!D���%�p!D���%�p!D���%}p!D���%up!D���%mp!D���%ep!D���%]p!D���%Up!D���%Mp!D���%Ep!D���%=p!D���%5p!D���%-p!D���%%p!D���%p!D���%p!D���%
p!D���%p!D���%�o!D���%�o!D���%�o!D���%�o!D���%�o!D���%�o!D���%�o!D���%�o!D���%�o!D���%�o!D���%�o!D���%�o!D���%�o!D���%�o!D���%�o!D���%�o!D���%}o!DA���A�@��taA�]����D9��G �( @���� A�d��1�A��A����� A����1�A����t �h �}��A�d��1�A���u<1ҹ�����E�A��A���q�����A�$�L��&� A��G���H�=)���A���<��<D�Й���ƅ�y����<�G���A#E���r#H�=�1����Z[]�\���H�
en!H�E�ytH������H���#1��%1��&E1���(H���h����(H��H�D$�V���H�D$�1��1���H��H�T$�1���H�T$��H��H�D$����H�\$H�mtH���)1�H���<H����1���H��H�������H��H�D$����H�D$H��tH��H���)1��)H������,*L��E1��+H��I�Et)E1��K+H�+u�H��E1��~����5+L��E1��+L��E1��c����+L�D$H�L$H�T$���H�T$H�L$��L�D$�6,H�BH�=m!H��1�H�5�H�HH�?1��n�����+1���+H�+t1���+H��1�����+1��g.1��U�1���W1�H�=iAS��^_��1��.������H9StD�CA��A���0/�F/�7/H�mtE1��1H��H�D$�p���H�D$�2H�gl!H��2L��H�D$�I���H�D$��0H���7���1��0Z[]����H�
�k!H�E�ytH���~���H��3���H���6L�D$hL�
)3�0I��0L9���4��5H�D$hL�
�k!H�A�ytH��H�t$����H�t$H���4AS1�ARAQA�ɉ�H�5�APA�Љ�H���W���H�� H���H81�����A�<A��<���A����A����x}E����<�Z<L��H�D$�-���H�D$H����<D�` D�xI��A�-�;A����<E���I<E���<PD��H�mI��W�dH��1�����ZY�;A����<E���<��;H������1<H��1�1�1����H�|$ H��H�/u���H��t2H�T$H�5W{!H�������xL�d$M���iB�CH�mt1��BH���B���1��B�6���H�sH��1�H�=(�Q����cBH�H��tHH�xH�= j!tFH��C1�1�1�L���O�����BH�mu�H��H�D$����H�D$�BH�=�i!H���H��뵸�F���D��FE�m E9n ������EA��wHH�L$PH�5i!H��ztL������I��I����I����IL�
�h!H�5.I�9�����IH�|$PL�#L��0�(M9���H�*J1��^OL���sXL��H�D$���H�D$�W1���ZH�޿1��M����[1��[H��H�D$���H�D$�[H�[H�5�!H�mH�{H9���[�}+{�W[�E[H��H�T$�p���H�t$���)^��^H�5�h!H�>�����^H�-�g!H�5�	H�}���1��P\H�}HH���^H�}2�^��t%��tG��@L�MPtL�M8E�A��A��A���]��t,��@L�uLtL�u4E�&A��A��A����]L�MHI���L�uHI����1���H�޿1������M_1��_1��I_H��H�D$�y���H�D$�2_H���g����Da��H����a�oaH�5ȅ!H����H��H��t3H�H����bH�PH����aH�mu2H���
����e`E1���`H��E1����8`H�������`�;`H�muH������E1��cL������fL�������eH���AfH��H�D$���H�D$�&eH�mu�H���|����TcH��H�D$�j���H�D$�"fL��E1��U�����H�m���H���=����w�I�,$���L��1��#����]�H�������A�H������c��W�L��E1������H���������\�H�m�^�H������(�H�E���umL9��AgH���a"H��H��tOH���Q"H��H��t%H��H����H�+I����fH���i��fH�+�
gH��E1��O��af�f�ifH���8��hH���+��hI�,$��jL��1�����iL��H�������H�{L9���L�������H�{H�5�d!H9��6j�s���)jH�S���tmH���f!I��H���,jH��H���O�H���	jH�XH�H�(uH���p�I�,$u
L���a��i�iH�5 d!��i�i�iH�5
d!��i1��j1�H��L����e�^j���H��H��tNA�t$ �sA�D$$H�C����f�CD�{L9���k�lH�
�c!I��ytH���:�H����k�L����H��H��t$A�|$ �{E�L$$H�C����fD�K�C�El�kH�5�c!H�>�"����nL�%c!H�5�I�<$���1��9mI�EH�n��tC��tiM�EH�@tM�E0E�A��A��A����mL��H�t$�
�H�t$����m�n��t M�]H�@tM�]0A�;��f��A���mM�]H��M�EH띃�D���#q�k�E1��juH�|$uE1��[tI���uM��E1��GuH�\$E1�H�+H�l$H��H�+���zH��L�T$0�a�L�T$0�wL��L�T$0�J�L�T$0�tH���8���tE1���t���E1���sE1���tM���"xH�����]zL��H�t$8H�T$0���H�T$0H�t$8�}uE1�H�|$M��u�t�SyL�\$�2yL��E1����et�as1��,|H�-Ka!H�|$(H�l$�|H�5ua!H�t$�kI�|$H9�u#A�m A+l$ A�]A+\$��?B����݁鶂H�m�:�H���6��-�H�m�"�H������H����L�c��L�G �4�H�m�|�H������o�H�m�d�H������W�H��`!H��A�1��:�L�5�`!I�>�Y����ÌL�-R`!H�5�I�}�
�E1�顊M�U2黍H�
2`!I��ytL��L�L$���L�L$I����I���֊I��0H�o'�0H9����驊��tS��ty��@M�]PtM�]8E�#A��A��A��@���D�M�UHI���#�L��H�4$���H�4$���ӌ����t0��@M�ELtM�E4E�A��A��A��@����M�]HI���M�EHI����H�=7_!��1�H�5��H�?���1���H��1��[��s�M�gD�ɝM�oD駝I�.���L���2�1�鉘L���3�L��H�$��H�$�b�M�gHfA�|$���ÛI���o�I�oX餛M�_X醛I�oH�}(��v	H��(酛鍛H�=��j��E+C�Ξ酞H�r^!H�饠�S�s�{A+|$f���t$H�t$�ʉ|$H�T$H�|$�L$���xH�K�T$�t$�|$�X+�O�1��H�A���{�A�d��1ҾA����o�A����1�A����Z��G����T�L��]!H�w!A�xu,H����|$�{�D�L$H��鰤��K�H��D�L$ H�T$��D�L$ H�T$�D�h E9n ���M�E1�險M��门��H��H���7�I��遨I�.���L���M��z�I��M�uL���7�I�,$���L��E1��!��N�L�����ҫ1���D�_D�G#D�OD�WfA��D�D$D�oE��D�G�_E�|$�A��'��D����A�����D���Ai�m�����D�L�-L��D��Lc��C�|�A��ƃ��/�A���%��q�1��l�1���H�d\!H���I�m�G�L���@�1��سH�=b����I�mt?E1��h�I�,$t@H�D$H�+��H��1���霸���H�k(鼺L��E1�����!�L�����H�D$�H�5-x!�h����/�I�,$uL����M�D$H�=m[!1�1�H�5rI�PH�?���� �H���q�H�|$��L���_��d�M���r��
�H���׻�(���H�
�Z!��1�I��H�5F�H�9��颸L�����/�L���3�L��骽L��颽E1�酾L����H�����鉾L��H�+I��t9I�,$�̽鿽I�,$�~��q�H��t!I�mu�L�����L��H��I�����I�,$A���L���o�H������I�,$��I�m���'�H;WZ!�'��(�RE1�L��k!1�H��H�T$R1�jj��H�� H������c�1���L�-�Y!��H�=���H��1������L��Y!I�8�t�����L�%mY!H�5��E1�I�<$�"��s�H�$H�RY!H��ztL�����I������I�����L�[2��L�[HI������t?��to��@L�kPtL�k8E�uA��A��A��A����H�������2��d���t&��@H�{LtH�{4D�A��A��A��A���N�H�{HH����L�kHI��딺����H9StD�CA��A���������A����1�A���u7C�|!����1�������E�I��H�+uH���h�E1��y�C�<��H���R��W�A�����H���<�� �H���/����x �e�[H�=S�]A\������<������<���x �R��x�X��X�A����<����O�E���^�[D��]1�H�=$�A\������<A��<�ș����A�…�x�������A����<��������@������d��1������A����1�A����n���H��I�t.1����H���!���L������H�����#�L��1�����L��������H��I�u�L��1������L������8�H��I�u�L��1����d�H������L�����a�H�������H���z��|�L���m��'�H���`����L���S��Y�L���F���H���9���L���,��L�L�������H������f.���I�Ѻ�k9��A����A����D)�Diڱ:A�Һ����EiҐD)߉�A����A��D�:�s�mA��E)�Ai���)lj�A����A����D)�iµA�Ӻ����)lj���:������)�i�mF�T)�C����D�E��D�����A��t�W2SL����Hc�A����tA�9�|4��)�[�9�A��uA��u�E1���A�A��D�9�|����)�[�1�D�Z�E�D�A��t/Ic�L�IE��A)�[B�|�9�A��D�A���A��u�A�dD��1�A������D��A��1�A�A���t��ff.�D�W�A���QS��D��Ei�mE��A��A���G���D)�E��AI��L��A)��D��Hc�A�E����~@��t	D�[B�	É�A����Dk�dD9�t
A��D�[B�	��iڐ9�t���ff.����t	H�G H��H��S!��@���tH�G(H��ff.�f�H��S!H��@���#�#����G �W!�"����	�	�Hc���ff.���������������������������G�W�����	�	�Hc���ff.�����s�����c�����S���H���W�w�f����������$I�H���H�ȉ����)�D��A)�D)���Hc���ff.����������������f������ff.����H�
E�H���1�H�5�g!�����1�H�5�g!1����ff.����UH��SH��H��H�GH��uWH���������H9����������1�H�=�e!��f!H��tH�H�XH�@H��[]�fD�����H9�tZD�CA��A��wR1�H�=_e!��f!H��t�H�H�XH��tH�EH�hH��[]���O ��u�H��o!H�돃{ �L�
�P!H��H�5u�1�I�9�+��1��g���@��ATA��U��S���uMD���ɚ;A����5w��1�L��A��0H����H�@�����h�XD�` []A\�ff.�f���?BwH��Qv��E.‰�A���A����D)�DiҀQD)�yJ�ÀQ�l*��p���ff.�f����CD��D�����)�i�@BA)�y
��A��@B����.���L��O!��ɚ;��1�H�5��I�8���1��C���DAUI��ATI��UH��SH���6�?�������L��Hc�E����~A9�|����'wB1�H��[]A\A]�tNA��A9�to�����Í{�����ڹ7wL��L��H���,����H�=CO!H�5!�H�?�����륃�A�4$��~O�}���Y��Lc�G��E�M�}�n�����A�4$A�EA�<$�k��A�$�u�~�}�>����mA�$��}�$���ff.����G�ATUS��='��A��v����
�Յ���A��tIIc�H��;,���1�H���0H��tf��H�@����f�XD�`@�h[]A\�f�A�@��t/D9�W1�H���0H��t�f��H�@����f�X�@@�h�A�d��1�A���u91�A����A��E�A��A���H�
YM!H�5��H�9���1��m���A��|���H�1M!��H�5��1�H�;����1��A���L�M!H�5��I�;����1��$���f���S�WH��1��w�O H�=���Q��H�sH�=��[H��1��;��ff.���H�WH�wH��uH�=U�1�����H�=J�1����f�H��������H�l���Hc�H�>��u H��L!H�H���ff.�����H��L!H�H���ff.����x���f.���~��΅�u��ȅ�y���ff.����w�O1��WH�=��f�����K��ff.����wA�����D�G ��A���A��A��D�2A��E)�Ak�<)�������ų����D���A��D)�E��F�A��D��A��E)�Ak�<)������G��uE��uFH�=b�����x��E��u=��L�l�A�ɉ�L�����H�=*�ME�A��1�L�����H�=�1��r��H��L�
-���L��APH�=��A��ME�A�ɉ��1�L���=��H������UH��SH��H��H�H��H��(����H���"��H�hH��H����������H�wJ!�P�����H�H��H��[]�ff.���S�H��H��
��H�=q�H��1����H�sH�=`�[H��1������SH��H��H�5E�H��dH�%(H�D$1�H��������tEH�<$�u��H��t-H�$1�H�5�]!H��1��i��H�L$dH3%(uH��[�H��������1���� ����SH��H��H�5��H�� dH�%(H�D$1�H�L$H�T$�;�����
��H�=h!H��t4L�D$H�L$E1�H��H�5@]!1�����H�\$dH3%(uEH�� [�H�=l�����H��g!H������L�D$H�L$H��E1�H��H�5�\!1������_��ff.�@��USH��H�I!H9�tH�~H�b!H9�uH�H��H��[]�H��H���q����u�H�UH�=�H!H�5��1�H�JH�?H������1��f�H;=�H!u1��H�GH�5	`!H9�t�SH��H�������t1�[�H�SH�
-H!H�5��1�H�RH�9�����[�ff.�UH��SH��H��H;5H!u>1���0H����H�S H�P�K(H�@����f�H!�@�{"xn�@#H��[]�H��H�T$�@�����H�D$xWH�D$�H��0H���,��H�{ H�t$H�xD�C(H�@����fD�@!�@H�H�p(�{"y��@��@#�L�
AG!H�5��I�9����1��o�������ff.���SH��H��uH������H�CH�C[�f����uH�w��@ff.��H�W(H��t�H�*u�SH��H������H�CH��[H��@��@���tH�W H��tH�*tH�w��@ff.�f�SH��H�����H�CH��[H��@����SH��H�H��tH�CH�/u�L��H�{H��uH�CH��[H��@��f�H�CH�/u������ff.���ATI��H�=��US�y��H���x��H��1�H�5Y!H��1�����H�mH���\��H���K��1�L��1�H��H�5�X!���H�+I��uH�����L��[]A\�@USH��XdH�%(H�D$H1�H�t$�`�����q���t$8L��a!1�1��H�\$@��H��H���G��H���/��H��H�5j����H��H�����H��H���O�H�+����H�mtH�L$HdH3%(uH��X[]��2������ff.�f���ATUH��H�=�SH���U��H�������uH����1�H�=�����H�+����H�������MH��H�������1�H��H�=�����H�+I��uH���F��M���}���M L�����H�{��H�U1�H�=��H�rH���;��H�+H��uH�����H��H��[]A\�H�8��M���t����M ��t�1�H��H�=2�����H�+I��uH�����M������L���s���H�����H�=��-��H�+I������M������H�M1�L��H�=��H�q���I�,$H���V���L���H���I���AVI��AUATUSHc����H������H�5�a!H��H���a��H��H���v��H�+�Ic~���I��H����H��H�����I��H���V��I�,$��L�����H�m��H�52a!L������H��I�EH������H��I�EuxL�����Ic~ �'��H��H������H��H���0��H�+I��uH���O��H�m��[L��]A\A]A^��H�m�t���H������g����Ic~ ���H��H���l��H��H�����I��H�+t��DH������Ic~���I��H���t���H��H�����I��H����������H������O���AUATUH��SH��H��8H�zdH�%(H�D$(1����tVH��H�����I��H���C��H��H�����I�mH��uL���/��H�t$(dH34%(H����H��8[]A\A]�H�5�@!H9�����H��L�D$H�L$���H�L$L�D$f.���vL�d$ L�D$L��H�L$����D$�D$ ���H�T$H�t$H��H���qH�t$H��H��H�T$����H�+L�T$I��L�L$uH���e��L�L$L�T$L�L$L�T$M���L��L��H���
��I�mL�\$H��H�D$uL���!��L�\$H�D$H������L$f.
���H��L�\$����YD$L������D$�D$ ���I��H������H��H�����H�+H�|$H��u
H�����H�|$I�,$uH�|$L�����H�|$�D$�X��A������H���3����c��������L�D$H�L$�D$���H���=���D$H�L$L�D$�Q����#��ff.�@��USH��H��H��u:�O �W1��wH�=�����H��H��tH�����H�CH�muH������H�CH��[]����USQ�d���H������H�5]!H��H���)��H�+H��uH���x��H��Z[]��USH��VD�O�oH�GA��D�W�W��H�p�OA	�D�G�oE	�t&H�=��1��R��H��t�{u"H��t��u'Z[]�E��u+H�=��1��'����H�s H���y���Y��[H��]��H�=q�1�����f.�ATUH�-�=!SH9�tSH��1�H�
�I������H��H9�t/H����H�xH�5�Y!H9�u[�����H9Ht�p����wH��[]A\�H�H����{ ����H�+uH���<��H��<!H�5V�1�H�;1�����������u8H�CH�=�<!L��H�5��H�HH�?1��T��H�+uH������1��z����(��f.����H��tH�(H�5����H�=�<!H�5��������tH� H��<!H�5t����H��<!H�������tH� H�s<!H�5H����H�=`<!H�55�H���y���f���AWAVI��AUA��ATUSH��H��H�~H�5�V!H9�uuA�~�CtJI�~ ����H9{ uIH�sI�~����H��D��[��]A\A]A^A_���ff.���t�H�=�;!H9{ t�L�=�;!�FfD�;����u�H�P;!H�H��[]A\A]A^A_�ff.�f�L�=q;!L9��h���L��H�5:����H��H�������{��H�{ L��H�5��X���I��H������H9���H�}H�hW!H9���H�HH9�uUD�HD9MubD�PD9UuXD�X D9] uNH�sI�~����D������H�m�$��I�,$�����;��H�5�V!H���2�����DL9���M9���A�FE�~D�CA�Ni�D�S�sAk�<Ei�Ek�<�iE����Ei|$�����)�D)�D)��+}A|$D)�u2A�~A�V�K�s����E�v�[����	�	�D	�	�)�D����H�m��I�,$�?����`��A���F��A����H��9!H���L��H�5�L������I��H������H9�tgH�}H��U!H9�tH�5�U!H�T$���H�T$������I�L$H9������A�t$9u�����A�|$9}�����E�D$ D9E �����H�sI�~�����D���������L�-�8!H�5��I�}�S��1�����J�����UH��SH��H��H�H��H��0���H���f��H�hH��H���w�����V��H�78!�P���V��H�H��H��[]�ff.���UH��SH��H;5T8!tH�~H��H�5\Q!H9�uH�EH�H��[]�������u�H�CH�=�7!H���H�5>�H�HH�?1��@��1��ff.����AWAVAUATU��S�_�H��H��7!H9D$X�D$��'����v����+A�ԅ��A��E��E�σ���Hc�H���D;$���A����A��;��A��;���|$P?B�Z�|$`��H�
77!H9L$X��L�T$hL�H����(I��0L9��S����H������H�|$hH�D$H�x����H�t$������H�
}6!D�AE������H�D�T$f��D�~f�nL�=�6!D�V�^D�fD�nD�vD�l$PH�F����A��D�n D�t$PfA��fD�v!L9|$X���\$`�^#H��H��[]A\A]A^A_�H�|$XH�5�M!H�H9��"����������H�D$hH�>����0H��0H9�������t$H�|$h��H��H���(���1��ff.�f�H�l$XH�EH�n(�`���ff.�f�1��ff.���@��t&A9�����L�-5!H�5��I�8����1��������Q���A��A��Ek�dD9�u��DiҐD9�A��A���맾�H�l$XL�%�4!H�5��1�H�]I�<$H�S�_���1����L�
�4!��H�5�1�I�9�>���1����H��4!H�5��H�:�A��1��u���L�k4!H�5��I�;�$��1��X���H�=N4!H�5��H�?���1��;���H�
14!H�5d�H�9����1�����H�4!H�5��H�8����1�����L�%�3!H�5p�I�<$���1�������UH�
�N!L��I!SH��H��H��H��0dH�%(H�D$ 1�H�D$H�D$P1�H�T$RH�$�QH�
yE!L�L$0���H�� 1҅���H�<$H�t$u�~��H�=�3!H�<$H�D$D�VD�FD�N�xA���nA���N�PE	�f��D�FL�$E	�D�N�p��H�nL!H9�����SUASAR�Z���H�� H��H�\$dH3%(H��uH��([]�H�n H�,$�l����G����H��H�
�H!H9�tQL�
L!L9�u%H��E1�E1�1�Pj�5�2!j���H��(�@A�Љ�H�5c���H��1��x���H�������USH��dH�%(H�D$1�H�F����
H��H��H��H���T���H����H�<$
�����0��	���x�WЃ�	��k�
D�@A��0�A��	��Dk�
D�XL�PA��0E�A��	wuAk�
D�M��ti�x-uc�H��0��	wW�p��0��	wKk�
րx-u@D�@A��0A��	w1�P	��0��	w%Ak�
H������H�\$dH3%(uAH��[]�H�1!H��H�5��1�H�;诽��1���H�-1!H�5]�H�}���1���{���ff.���USD�O���QD�_�fA��E��E�B�D��Ai�mD���A�B���)�E��AI���)�Ic����D�(H�-l��t�A��~A��tA�[]A�Ic��L���ff.��D���A��A��Ek�dE9�t��A�[]A�Ic��������iڐA9�t��AWAVAUATUH��H��H��SH��H�5'�H���j�H����H;20!I�����xD�` A�+D�x����I�muL�����A�����D��D��E��A��B�<:��)�k�<A)��[��D��A�ų��A��A��A��F�:A��A��A)�D�:A��E)�Ek�<D)��{��E����E����H���dI��D��WH���H��1�E���N���^_H��D��[]A\A]A^A_�f.�D��D���߹���L��K!�S��I�m����H����D�` D�xI��A�-��f�H��I��D��dAUH�u�1�E1�SWH��蹺��H�� �d���ATI��D��H�6�AU�d1�E1�SWH��苺��H�� �6���H�(�����EE1�� ���A��������UH��H��H��SH�
A!H���]�UdH�%(H�D$x1��EL�D$H�D$����	�1�	�H�����������L�L$M���������M�UA��1��uH�=����H�$H�����}tCH�U H�
�-!H9�t3H�l$H�5��H���?�������H������H��H���Ĺ��H�$H�L$xdH3%(��H�Ĉ[]�f�H�=���M�UA��1��u�c���H�$H���m���1��f�H�=���L���A��A��E������H�=���L���A��A��E����A�H�=��L��L���������H�=��L��L����€�����H�=���
L���A��A��E��tWH�5y�L������tnH�,!H�5l�1�H�;贸��1�����ff.�f�E1�I��L��%!K�|������A��H�=���A��������A���A��A��H�<$H�/�������1��l����'������USH��H��H��H���k �S!dH�%(H��$�1��K"L�L$L�D$�����D$TH�D$	�H���H�D$	�H�
?>!�Z�������H�D$H�������D�K�{H��D�S�KUfA��W�SH�=��A��ARD�KD�D$,1��-���H�D$0H�� H�����{t=H�l$ H�S(H��H�5��H���z�������H���Z���H�|$H�����H�D$H��$�dH3%(��H�Ę[]��H�=���sD�[H���C�KUf���SD�KAS��PD�D$,�B���fDH�=��H���A��A��E������H�=���H���A��A��E����A�H�=��H��L���A��A��E����H�=��H��L����€���tmA�
H�=��H��L���A��A��E����H��H�=��L���������H�-,)!H�5{�1�H�}�µ��1����ff.�A�f.�I��L�%#!K�|���ff.�E1���ff.���A��MbH�=i�A������{���@A��A��H�|$H�/�o����̷��1�����������ATH�5�9!USH��H��0dH�%(H�D$(1�H�T$ 谷�����7���H�l$ H����H�EH�P8��������L�dM�������1�1�1�H��A��H��1�H���޵��H�|$ H��H�/������'���H���ͽ��H�T$H�5�8!H���*����������L�d$M����H��謳��H���ǽ��H�=�'!H�H�/�����H�sH��H�=¿1����H�L$(dH3%(��H��0[]A\�ff.��1��ٶ��H��H���,���H�T$H�5Q8!H��艶�����	���L�d$M���_���I�L$H�q8����@���I�4H���3���1�1�L��1��1�L��H��踴��H�|$H�/uH�D$����H�D$H������H�='!H9��
���H�sH��1�H��H�=������������AVE1�H��AUI��ATI��USH��H���#L�OA����O�W�w��pAQf��AP���p(D�@!D�H D�p"A��A��E	�E	�APD�HD�@�s�H�� H��H��������x��H�x(H��H�5��V�H�mI���wH������M���F���M9��kI�,$�i1�{#L�C@�ŀ{��D�c�K�S�sAPUfA���s(�C!A��D�S D�["��A��D	�D	�PD�KD�C��H�� H��H��������x�H�x(H��H�5L���H�+I����H���>���M�������M9���I�m���H��[]A\A]A^�L�5 %!AQf��AP��AV�h D�P!D�X"��A��D	�D	�UD�HD�@��H�� H��H�������x��H�x(H��H�5�����H�mI��uH��葳��M���׺��M9�t-A�VA9T$�˺��A�L$A9N�A�t$ A9v �����I�.��1�{#L�C@�ŀ{��L�K(�{�K�S�sAPUf��AQD�s ��D�c!�C"A��A��E	�A	�AVD�KD�C��H�� H��H���&����x��H�x(H��H�5����H�+I��uH��該��M�����1�M9�u,I�.�s���L���D$胲���D$�^���L���r����!���E�UE9V�u�E�]E9^u�鰹����H�=Y#!�s���L�
M#!����H�=A#!�r���L���j���ff.����SH��H��H�59�H��dH�%(H�D$1�H�T$耯�����/�D$���
�H���k9A� k9A�s�m�����i��:i��)��a�g���A���Di¬�A��D)���A���DiڵA��D)ى�A���C��A)�A��AЍ�A��D�Ei�mA�|0�<�D)�A����A�����q2H�����Lc�F��A����D9����QH�
�7!D)�H9���H�
;!H9�uBSE1�E1�1�j�5�!!j��H�� H�\$dH3%(��H��[�ff.��A�Љ�1�H�5O�H���h����fD����L�\7!L9��u���H�
I7!�����f�A��u
A���3���E1Ƀ�A��E��!���ff.�����tHc�H�~�D��E)�B�T�@��u�A���Q��A��A��A��Ek�dD9��O�����DiҐD9�u�A������H�p !H�5��H�;�)���1�����f���AWAVAUATUSH��L;� !D�L$�D$���*���A��;��A�Ճ�;���ˁ�?B���|$�nL;T !��M����L�L$PL�%��� M��0M9�������I��H�������H�|$PH�x������g���L��!A�C���j���I��t$E�gA��f��A��L;5�!I�G����A�wA�oE�oE�gfA�_tD�\$I�M�w A�_H��L��[]A\A]A^A_Ð1�H�|$PA��I��M��u�E1���f�D�l$E�o�@I�xH�5�6!H9�������׬����t"H�T$PH�5��L��0I9�u,�(��I�FH�
�!H�5�H�PH�91��A�����t$�g���H�-�!H�5��H�}�>����[���L�5j!H�5��I�>�#����@���L�=O!H�5��I�?�����%���L�4!H�5}�I�8����
������H���O �W!H���w"L�9!L�S!����	��W	��w�ARD�H#�y���H���@ATUSH��@dH�%(H�D$81�H��H���l��H��Ӫ������L$�T$Lc$LcL$��l��kLcT$D�ZD�d$��'����i�m���Q����������F�$!��)�)�Ic�A�H���<�A��~��tO��H�H�@M��L��H��L)�M��L��H��L)�I��H�\$8dH3%(uhH��@[]A\�ff.����A��A��Ak�d9�t
������Di�D9�t��}���L��!��H�5�1�I�8�"���H��������AWA��AVI��AUI��ATM��UH��H��SH��hdH�%(H�D$X1�H�t$ A�Յ��h�\$0�D$4A�;D�\$,�L$(���|$ ;DNL$ L;%\!D��lD�D$$��L;-!��k='��D��D�׉�D�L$D�D$D�\$D�T$�L$���Hct$LcL$H�Lcl$H�@�t$H�<�D�l$I��I��I)�H���wO��L�M��I��M)�O�l����H�����I������D�L$D�D$H)NjL$D�T$D�\$��H��4!H9��#UjATAWD�ډ�D���y�H�� H�\$XdH3%(�$H��h[]A\A]A^A_ÉL$H�
�!D��1�H�5(�D�L$H�9D�D$D�\$D�T$�O������wH��L�����D�T$D�\$H����L$D�D$D�L$��H�����H)��?���I����&�D�L$H��D�D$I։L$L�D�\$D�T$�l���H���tnL9�H�=�3!D�T$D�\$A��H9��L$D�D$A��D�L$u
UV�5W!���ATD��H�5��H��AW1�AQA�ɉ�APE�����H�� �����X���1�������SH��H�� dH�%(H�D$1�����1�H�T$H�t$H��諦���������L��!�L$H��H�T$H�5Y!��H�L$dH3%(uH�� [��٧��f���SD�O���QD�_�fA��E��A�r�����A�������)�A�BA)�D��A��i�m��I�Ic�|��H���Nj4�A��~A��t;�A��$I�[D������A�����)�D��A)�D)�Hc�醧��fDD���A��A��Ek�dE9�t���fD��iڐA9�t����AUATUSH��XdH�%(H�D$H1�H�F����v	I��H��H�t$(L���n���H����H�|$(�D$H���D$�D$H��	H��H9�v��sՁ�u�H�T$L�D$D�H�T$�~D$L�D$A��0D$fI~�)D$0A��	�(E��pG�,���0C�jA���	�
��D�PD�VH�PE�H9���A��:�
D�XL�T$8A��0A��	��E�
�pG�,���0C�kA���	��D��F�FL�@E�D�PL9��wA��:���P��0��	�wD�T$�XG����0F�,JD�l$��	�UC�t�H�P	D�PD�sD�\$H9��A��:�߭��A��.�!I��I)�I���M�����X	H�P
��0��	��I���GD�h
H�PA��0A��	����A�\]I����pH�P��0��	��D��B�^I����D�hH�P
A��0A��	��D��C�\UI�����p
H�P��0��	�]���^I����D�XH�PA��0A��	�6D�,�C�kI���}�pH�P��0��	�D��B�VI���WD�hL�XA��0A��	��K�T�fDI��E�k�A��0A��	����A�\EI9�u�H����I���LE1ɀ:A��H9���H��H)�H����A�@I���pL�\$L�l$ �A1�L�\$�9-H�q�~L$L�l$�ƒ�0D�L��D$�D$ L$�D$$fI~�)L$0��	�E�D�iC��A��0D�PE�A��	��C��D�YE�DEE�L�AL9��UA��:��D�QH�t$8A��0A��	����AD����0G�,ZD�.��	��G�T�D�YB�P�H�qH9���A��:��D�AA��0A��	�VD�\$$�AG�,���0G�hD�T$$��	�4C��D�Y	D�PD�D$$L�A
L9���A��:t
A��.�L)�H��t
H����H�����VL�F��0��	��H���-�NL�F��0��	��D�,�B�iH���D�VL�FA��0A��	����A�BH����D�^L�FA��0A��	�f��A�SH�����NL�F��0��	�AD�,�B�iH����D�VL�F	A��0A��	���A�BH��tdD�^	L�F
A��0A��	��k�
D�H��tAD�V
L�nA��0A��	��L�D>�I��E�U�A��0A��	���<�A�zM9�u�M����kt$ <iL$A���L$$��A��A�8�w���L�%�0!I�$L��,!�T$�t$�|$L9��7H��E1�M���U�K�^_I�,$���ߨ��f�E1�E��A��1�H9��u���A����L�%�!I�$H�
n,!�T$�t$�|$H9���H��E1�M���U���I�$H�{�I�<$AXAYH����H�|$HdH3<%(��H��X[]A\A]�ff.�@iT$kD$ <�T$$��A��E��u\1҅����L�q-!�1��5���I��H��t!1�H���#���I�mI����H���'���1��g���DI�����H�-g!L��H�5�1�H�}���1��5���H��L��A��.u�I��I)�I��tI��u�M���X�XH�P��0��	w�I�������D�@H�PA��0A��	w�k�
D�I������D�XH�PA��0A��	�b���k�
D�I�������D�hH�PA��0A��	�;���k�
D�I�����pH�P��0��	����k�
�I��teD�PH�P	A��0A��	�����k�
D�I��tBD�@	H�P
A��0A��	����k�
D�I��tD�h
L�XA��0A��	�����I�����H����������ff.�@M�������H������i������L��I��H���O���1����i�����1����L��!H�5
�I�8�e���1����L���֝��M�������1��h���P��A��A��AT��H�5�H��1�舞��ZY������靥�����ATUH��H��H�5ڨSH�� dH�%(H�D$1�H�T$������r���H�}�
D�d$�Ҝ��H��H���n���A��P�}uV1�H�޿蛛��H�+�P���H�uH��H�=�1��,���H�L$dH3%(uYH�� []A\��}#t��H"��H�U(H;�
!���H�޿1��4���H�+���H�uH��H�=��1��ś����ޛ��ff.����B���wYUH��SH��H��H�~H�5�!!H9�uIH�[H�
�)!H�mH�{H9�uX�}+{t
H����[]�[����}+{u�} +{ ��H��!H�ÉT$趚���T$���P���H��!H�H��[]�H�5Q)!�T$舚���T$��t��=���ff.���AVAUI��ATUSH��H��H��0dH�%(H�D$(1�H�{��H��H��H�
�!H�D$$H�1�P1�L�L$0L�D$4�`���^_����D�t$$D�d$$�l$�\$ A�V�fA����'���K�������������Hc�H�=w�9,���1�L��A��0H��tH�@����fD�`�X@�hH�L$(dH3%(�^H��0[]A\A]A^�PH�o�H��1�H�L$$QH�
�!L�L$0L�D$4菘��ZY���
D�t$$�l$D�d$ A�F�='��E�L$�A�������A��uff.�A�A����Mc�H���B�4�9���1�L��A��0H���,���fA��H�@����fD�pD�`@�h�
���fDH�kL�EI����t{H�}�����U"���������1���0H������D�u H�@����D�p���A���QD��A���Dk�dE9�����D��1Ҿ�����2��������������} �����H�}�w����U �щЃ��� �������������@H�}J���D�A��A��A��E���2���H���r���H��H���x���1�L��A��0H��tD�k H�@����D�hH�+����H��H�D$螘��H�D$���H�-E	!D��H�5��1�H�}�ؕ��1������E���貗��L�-	!H�5��I�}�˘��1��k���H�
�!H�5k�H�9讘��1��N������ATUH��H��H�5j�SH�� dH�%(H�D$1�H�T$荕�����Q���H�}�D�d$�b���H��H���9���A��M�}uS1�H�޿�+���H�+����H�uH��H�=��1�輖��H�L$dH3%(uVH�� []A\À}t��H ��H�U H;t!�����H�޿1��Ǖ��H�+�����H�uH��H�=1�1��X�����q����AWAVAUATI��USH��H�5�&!�s���H���>H��H�@�����H�SH���~H�{ ���A�Ń����A��?B��H�kH�EH�+�T���H��蛖��H�5&!H�����H��H����H�H����MH�PH����H�m��H���N���H�{ �u���A�ƃ���ן��=Q�NH�kH�EH���M���A�ǃ������ɚ;����5w�PL��1�A��$0I��H����H�@����D�xD�pD�h H�+��H�����H�m��H��L��[]A\A]A^A_�H�{ �Ǖ��A�ƃ���)���=Q��H�kH�EH��蟕��A�ǃ��tg���ɚ;����5w��L��1�A��$0I��H��tH�@����D�xD�pD�h H�+uH������H�m�^���H�������Q���fD軒��H����A������襒��H��uL��!H�5R�I�:�J���H�+uH��輔��E1����E1��H�=�!D��1�E1�ɚ;H�5��H�?����[���L�X!1�H�5ϧA�I�8�ɑ��H�+�A������H�5��L�$!1�I�;袑��H�+u��:���E1�����H�PH�5L���L�
�!H�Q1�H�56�A�I�9�`���H�+�����������AVI��H��H��AUATUSH��hdH�%(H�D$`1�H�D$(H�D$XH�D$PH�D$HH�D$@H�D$8H�D$0H�D$(H�D$ P1�H�T$8RH��H�L$HQH�
�!H�\$XSH�l$hUL�L$xL��$��?���H��0���g���1��ܒ��H��H���T���H�T$@H����H�T$8H����H�T$HL�d$H���H�
r"!M��H��H�=��H��H�+I����H�������H�T$0H����H�T$(H����H�T$PH���(H�
�!!M��H��H�=����I�mH����H�������H�T$ H�����L$f.
<��+�%L��H������H�mI��uH���#���H�L$XdH3%(L���VH��`[]A\A]A^�H�����M���"���L��ff.�H�T$0H���H�T$(H����H�T$PH��tML�d$H�
!!H��H�=0�M������H�+H������H��臑������f�L��H���u������H��H�T$ H�����L$f.
A��-�'L��H������H�+I���
�����H���!������I��L�d$H�
u !M��L��H�=��k���I�mH����H��� �������ff.�@I��L�d$H�
1 !M��L��H�=������I�mH��tzH�������˚���H�5�!L�d$H�=~�M��H�H���߿��H�+�Ú��H�������H�T$8H�������H�T$HH��H���L����X���L���0����>���L���#����y���H��f(��L$�̐���\$f(��\�fT�f.����H,�莏��I��H���G���H��H��藎��I�mH������H�m�
H���`����ԙ��H��H�
�!M��H��H�=���H�+H����H�������H������L�d$H�
�!M��H��H�=A�踾��H�+�Ǚ��H������d����B���H�=[!H�7H��訌��I��H�������H���ԋ��I�m���3����������f���*�f(��XD$�d$�YƷ艏���l$�X��\���������H��詎���-���H��蜎�����L�d$��ff.�f���ATL�%�!UH��SH��H�L9���H�F���uzH9���H������H��H����H�����H��H�������H��H���5���H�+I��u,H������H�muH�����H��� I9�tuL��[]A\ÐH�mt���H��菻��H��H��twH��H���܋��H�+H��uH��諍��H��tVH�5!H���w���H�mI��t��L���3����������H�D� H�I������H�5�!H���	�����t�駘��E1��_����AUATU��SH��H�����H����H��I��1�1�H�5�!����H��H���~H�@����GH�����H���jHc�L��H�t�����I�,$I����L��踌��M���u��L��Hc�H�t��\���H���JH�hH�EH�(��H���x���I�m��L���e���H�5�!H���6���H�mI����H���@���H�+uH���2���H��L��[]A\A]�H������H��Hc�H�t��Ȋ��H����H�hH�EH�(uH�����I�muL���ً��H�5B!H����H�mI��uH��踋��H�+�t����w���L�z� H�P1�H�5=�I�8���H�+�C���I�,$t)E1��B���H�=%� H�5^�H�?�ދ��H�+u�� ���L���K�����I�muL���:���E1��z���f���ATL�%�!UH��SH�GH��L9�����H�~H9���H��詉������H�{H�5� H9��K舉�����>H�K����XH���w���I��H���=H��H���`���H���H�XH�H�(����H���}���I�,$��L���j���H�5�!H���;�H�+H���~H���F���H�5� H9���H��[]A\�H�����I��H����H���ҷ��H��H�����H��L��蛊��I�,$H��uL�����H�+uH���ۉ��ff.�H�5�� H9�tdH��[]A\�ff.��H�5!H����H�+H���F�����H��H���B���H���I�,$uL���n���1��1���H�50� H�H������@��ATI��UH�-�!SH��H��H�H9���H���҇������H�{���tmL���Ŷ��I��H���ĕ��H��H���>���I�,$H����L���؈��H�������H��H����H�+t^H��� H9��H��[]A\�DH;=�� �1�H��L���F���H�O� H9���H��[]A\�ff.�f�H��H�D$�S���H�D$�ff.��H���h������f�I�|$���tjH���ڵ��H��H���ٔ��H��L���S���H�+H��uH����H�������H�5R!H����H�m����H��H�D$�‡��H�D$���H�5�� H9�t�W�����uH�l� H�H�����1�L��H���C������H�5o� �"�����t��;���f�AWAVI��AUATI��UH��SH��L�-Z� L9�A��ucH��0H�+���H9���1���H��H��t.A�L$ �KA�t$$H�C����f�s�CA�|$ ���CH��H��[]A\A]A^A_�H���>�������I��0L������(L9���襅��H��H���}���L�pL���}����������L�=� E�ZE�������H�E�t$ D�sA�T$$H�C����f�SD�{L9��I���H�EH�k �;���� 낀C��C�7���L�-� H�5;�1�I�}膆�������@���ff.����AUATI��USH��H��H��HH�-� dH�%(H�D$81�H�C�D$,�D$(H�P��D$$�D$ H�l$0�D$H����H�l$H�
	!H��1�UH�B�L�l$8AUL�T$0ARL�\$<ASL�L$HL�D$L�F���H�� ���[H��ATD�L$,L�D$@�L$0�T$4�t$8�|$<�u��ZYH�L$8dH3%(�'H��H[]A\A]�@L�kH��t&I�}H����u$�uMH�l$0�@���H�K H�L$0��DI�}u�E�M A��A��w�H�T$0L��L���*����r���DA�} �[���I�}u�A�E ���ƒ��� ������������I�M0�@I�UHH��HD�D�A��A��A��E���W���L��謀��H��H�������H�T$0H��L�����H�+���H��H�D$���H�D$����1������#�����USH��H��H��H��8�kD�CdH�%(H�D$(1�D�K�C��A���S�KD	ʼnD$D	̀{�T$�L$�l$��L�}� D�[H�D$L�T$ D�\$P1�H�T$(RH�؎H�L$ QH�
�!H�l$,UL�L$8L�D$<����H�� �����|$��L�L$ D�D$H�=\�1��L$�T$�t$����H��H��toH�{1�H������H��H��t:�t$@�pH�muH��诂��H�L$(dH3%(H��u3H��8[]�L�S �'���H�mt���H�=4� H�5��H�?���1��贁��@��ATU���QSD�_fA��E��E�Q�E�AD��Ai�mD��E��EI��D���A��A�ĉ�A����)�A)�E�A���$I�D�AD��E���A��D��D)�D�a��)�A)�E)�A��A�T$DO�H�n�E��D�g�H���<���~
A���D�D�$9��$I�D��D)�A����E��D��A��B�<��D)ߍ,�)�)���A����
A��k��A���QD��E�ʽ�$I�A��A��D��B��m��)�A����D�[��D��E���A��D��D)�D��A)�E)�D)�A���kO�D9�N��A�q�[H�=��]1�A\��������xk��3�e���ff.�@�W������W��ff.�D���A��A��Ak�dA9�t��������iA9�t����A�qA�����QA��$I�D��AI�A����D�����3����A���A��D)�D)���D�I��D��D��A��B�,
��)���)�A)�D)�A��D�YAO�A)�D��D��A��D�A����D)��)�)������D������AWAVAUATUSH���H�|$H��H�t$XH�T$H�L$(dH�%(H��$�1�H�D$P�g|��H����L�L$XI���������M�y1�I��L���~��H�D$PH����H��1�E1�E1��m}��M��M��H�D$H��A�M�{���H�L$PH�L$ �Nff.�@H�D$HL�KM9���E�I�wM��D�UH�T$HA�H�Hӄ���I��<%u�A�SM�S��tV��z�[��Z�p��f�H�D$HH�sI9��<A�;M�{f�}L�D$HA�CL�LÄ�tOM���H�D$HM���L�<M9���H��L��L�T$0���L�T$0L�|$HA�L�L�M�z��u�H�|$PH���c|���������H�=���?z��H��H�������H�\$PH�{ �Ez��I��H���f���H�L$E1�H��H��1�H�5r!��}��I�/I���L���h}��H�m����H�|$��M���M���H�|$PH��tH�/u�*}��H��$�dH3%(L����H���[]A\A]A^A_�M��ulL�\$L�
!I�{L9��8H�L$H�=!�y��H�5�!L�T$0�i{��L�T$0���;1�1�L�T$0�}��L�T$0H��I���[H�t$HL��L�T$0�y��L�T$0H��I���4H�T$HH���C���M���Y���H�m�	���H�|$��M�����I�m���L���!|������M�������H�|$L�7!H�L9���L�|$A��wL�L$M�Y(1�H�=)�L�T$8L�\$0�Y{��I��H����H�T$0H;�� L�T$8��H����L�T$`H�L$(H�5݄L��L�T$0�/����������I�/H�T$0H�t$8�b���H�t$0H��1�H���H��I��I��I�p���z��I��H���L�T$0�?I�,$���L���{������M��H��������?L�\$8I9���K�,6H�|$ H��H�l$0�ry���������H�|$P�0y��H�T$HL�\$8H�<H9���H�,M��L�t$0���H�5�!L�T$0�Gy��L�T$0����L�|$H�5N!I�H9������H�|$������L�\$M�{ 1�1�L�T$0�;{��I��H�������L;=P� L�T$0�����M����H�T$(H�D$01�L��H�5� 1�L�T$8�rz��H�t$0H��I����H;� L�T$8��H�P����cH�.��L�e�1�H�
]�L��H�U�H�5C� L�T$0�z��I�/L�T$0I���`M�����I�@�����M������H�5�!L�T$0�x��L�T$0����L�L$H�5!I�yH9���H�5�!L�T$0��w��L�T$0����1�H�=X�L�T$0�x��L�T$0H��I����I�WM�_ M��H�T$H�r���L�L$M�y(�p���H�T$�zu�L�D$H��!I�xH9�������H�T$�z�����L�D$H�U!I�xH9��J����c���H�=�!�9���E1��5���H�|$�����L�\$L�
!I�{L9���H�5!L�T$��v��L�T$����L�|$H�@!I�H9���H�L$L�T$�q �Q!D�A"����	�L�|$`A	�@1�H�
���L���Qx��L�T$L�T$1�H��L���L��H��H�q��-w��L�T$H��I���RI�SL�\$I�� H�T$H����L�T$I�H�T$H��I�����H�|$�Qw������H�L$�y�-���H�|$L�_ �N���I�����L��L�T$8H�D$0�w��L�T$8L�D$0����H�5/!L�T$�u��L�T$�����L�|$`E1��@�H�
�L���Ww��L�T$����H��� H�5�M��H�;�$w��I�.�܅��E1��I���H�|$L�T$�wD�G��A��D	�D�G���H�-<� H�RH�D$I��1�H�5�H�}�s��H�L$H�)u��(���I������yu��H��������?H9D$0��I��H�|$ L��L�t$0�t�����؄��H�|$P�Lt��H�T$HL�\$8L�M9�����I��������?H�l$0L9�wTM��H�H�|$ H���>t���������H�|$P�s��H�T$HL�I9�w
H�l$0M������I��������?L9�v�魃��騃��飃��鞃��馃��I�����H�(I�����������̃��I����������u����p�����UH�
�� H��H��SH��H���H��dH�%(H�D$1�I����r�����6���j����ljH�=~�j�EPD�M1�D�E��s��H�� H��H����H�
�� H�4$H��H�����H�+H��uH���vt��H�L$dH3%(H��uH��[]��s�����UH�
� H��H��SH��H��H��dH�%(H�D$1�I���r����tX1�H�5j� H��1��u��H��H��t=H�4$H��H��H���F�H�+H��uH����s��H�L$dH3%(H��uH��[]�1����s��f���AWH�
� AVAUATI��H��H��UH�OSH��H��� dH�%(H�D$x1�L�L$ L�D$(H�\$ �Yq�����
L�|$ I9���H�|$(H�T$8H�t$0���r�������L�t$0D�L$8H�t$@L��D�L$�p������D�T$P�t$TA�;�|$@;�L$HA�jD�D$DD�T$LD��lDNL$@��k��'�w����QA���A��i�m��A���A���E)�D�A)�A�H�0�Hc�D�|$D�<���~
A���D\$D�T$Ic�Ic�E߉L$Mc�Lc�D�D$O�RD�L$K��H��H��H)�L��H���wL��L�H��L)�L�<����H�����I������D�L$D�D$H)NjL$D�T$�L�5� M9���ATjSD�d$(D�҉�D��AT���H�� H���^H�|$ H9�tH��H��yH�5Z� 1��r��H�\$xdH3%(�vH�Ĉ[]A\A]A^A_�ff.�f�I�H�5� H9��������o�����;L�|$ H�|$(I9������H��� H�T$H�T$8H�t$0��p��������|$8L�t$0H�t$@L�l$�|$L��A�Յ���D�D$P�t$TA�;�|$@;D�T$LA�h�L$HD�D$DD��lDNL$@I9�uL�\$L;z� �����L��� M9��7ATjAW���f�D�����k�dA9��:A������D��H�5Tx1��L$D�L$L�
�� D�D$I�9D�T$�sm�����wH��L�����D�T$�L$H���D�D$D�L$��H�����I��H)��N���I��ff.�D�T$I��H�wM�D�L$L�D�D$�L$���H���tK1�H�
�� L9�D�T$@��I9�D�D$�L$D�L$u*ATD��WD��S�t$(V��脨��H�� H�������1����I��AW�T$H�5�yL��1�RD��AQA�ɉ�APE���o��H�� ��iA9����������Dn��I�GH�
�� H�5rH�PH�91��4l��1��J���ff.�f���AUI��ATI��USH�� H��H�GH9��TH�~H9���A�m +n A�]+^��?B��A�}A+|$A����Qw]E��$�ɚ;A����5w��1�H�=�� �� H��t"�XH��� H�@����D�`�h H9���H��[]A\A]��A�E.‰�A��A��A����D)�DiҀQD)�y	���ÀQA��l���f����C������)�i�@B)�y	����@B��"���H�5�� �7l�����}��H�H� H�H���Z���L�-�� ��ɚ;D��1�H�5\}I�}�j��1��2���H��H����k������|���ff.�@��AVAUATUSL�gI���tL��I��[L��]A\A]A^ÀH���H�I��A�}uTL�5�� L��L��H�5�t����I�mH���+H��t�L9�u0H�{��>l��H�CH�m�v|��H�[�I�} L�5�� ��S�K�s�{D�C����D�[	ʹEk�<	�L��� i�1�D�D��u���I��H����{��H��H���^���I�.I��uL���
l��M����{��L���k��H�CI�m�S���L����k���F����L�O��{��L��� �K�C�S�s�����{	�	��SPAQE1����ZYI��H����������L���k������ff.���H�GH���tÐAUATUSH��H���#�GuuH�I������H�=K� L��H�5s�d���I�,$H����H����H;-� ��H�{�
�j��H�CH�m�EH�CH��[]A\A]�L�G���DH�o(�{�K�S�sAPjf��UD�K ��D�S!D�["A��A��E	�E	�AQD�KD�C誣��H�� I��H�����x�&���I�|$(�#����K�S�sf�����Ά���S �s!�D�CD�c����D�k"D�KAk�<	�L�z� Ai�D	����D��4���I��H����y��H��H������I�mI��uL����i��M����y��L����h��H�CI�,$�����L���i�����H���i�����L���i���n���H�-�� ���H�����ff.�@��ATUH�-�� SH��H�� H�dH�%(H�D$1�H9��^y��I��H����g�����Ky��I�|$H9��=y��H���g�����-y��H�{H�5�� H9���I�|$L�
L� L9����C�KH�|$�sAt$f���t$H�t$�ЉL$�T$H�T$�������H�K�T$�t$�|$莦��H�L$dH3%(�H�� []A\��g������H�{H�5�� H9���A�D$A�L$H�|$A�t$sf���t$H�t$�ЉL$�T$H�T$�T�����xI�L$�T$�t$�|$����g���1��`���H�5G� �f����u/H��� H��@����if����t��p���I�|$L�� L9�u��{D�[H�T$H�t$�kAl$f��D�\$D��H�|$�l$D�T$賈���������w���f�����AWAVI��AUATUSH��H��H��XH�KdH�%(H�D$H1�H�2� �D$0H�Q��D$,�D$(�D$$�D$ H�D$@H���OH��H�
� H��r1�H�|$(WH��H�l$PUL�D$<APL�L$HAQL�T$TARL�\$`ASL�d$lATL�L$xL�D$|�d��H��@����D�d$<�|$ D�D$(�L$,�t$0H�l$@A�D$��|$H;-k� �\$$D�D$D�l$4D�|$8�L$�t$�$='��A�W�����E����A����Mc�L�o�G9,���������;�<A��;���?B������H;-�� �I��0L����(H�-�� L9��T�d��H���<v��L�pL��H�D$�ed��L�L$����u��H�5 � D�VE����u��I�D�4$fA��E�yA��fE�aA��f��H;-?� E�qE�iD�l$I�A����E�iD�d$E�aD�|$E�Y E�yfA�Y!���\$A�Y#H�L$HdH3%(L����H��X[]A\A]A^A_�ff.�H�}H�55� H9��_u���Gc������I��0L������0L9������4$L����I��M�������{f�H�EI�i(�X���f�1���H�M� H�T$@RH��oH�L$(QH�
K� H�D$PP1�L�\$<ASL�d$HATH�|$TWH��L�D$`APL�L$lAQL�L$xL�D$|��a��H��@����D�d$<D�|$,D�l$0�t$ D�T$(H�l$@A�T$�D�|$H;-�� �\$$D�l$D�|$8D�l$4�t$D�T$�$��'�JA�O�����E���9A��uff.�f�A�A��tnIc�L���A��D9���|$���|$;�p�|$;�G��?B���|$�1���H�-�� H�5mH�}�^c��E1����A���QD��A����Dk�dE9�����DiʐE9��j����W���ff.�L�kH���'I�mH����tdI�}
�)���A�m"����������H�T$@L��L������I���X��������za��H�=�� H�5hjH�?�b��E1��+��������A�} �s��I�}
�����A�U �щЃ��� ����r������r����@M�UJ�<r��E�:A��A��A��@��@���e���L���)^��H��H����q��H�T$@H��L���M���H�+I�������H��H�$�da��L�$�z���L�{ L�|$@����L�
�� H�51kI�9�a��E1��N���H�
�� D��H�5;i1�H�9�t^��E1��+���H��� H�5�rH�8�va��E1��
���L�uH�-�� H�5lq1�I�VH�}�-^��E1����H�v� H�5�jH�:�/a��E1�����L�X� H�5�jI�8�a��E1����L�:� H�5�hI�:��`��E1����ff.���ATUS�o�O�W��D�gf����~���'��q���Z�����������t6L���A;���1�H�=�� �� H��tH�@����D�`[]A\�A��A��t/D9�W1�H�=�� ��� H��t�H�@����f�h�@D�`�A�d��1�A���uW1�A����A��E�A��A���H�
)� H�5�gH�9��_��1��u���H�-� H�5�gH�}��_��1��W���A��^���f���USH���tGH��H�-.� H�(H9�t;1�H�5�� 1��m_��H��H��tSH9�t
H�@���tH��H��[]�H�-�� H�EH����H�
�� H�P1�H�5LsH�9�\��H�+�=p��1��ff.���AWAVAUATUSH��XdH�%(H�D$H1�H�F�����H��H��I���^��H����	H��
�A�G �ƒ����j
I�H�t$(L���([��H����0�D$�D$��0�D$��	�8	�H��0��	�(	D�@�<��,yA��0A��	�	D�`D�L�L�XG�HA��0A��	��G�,�C�,lM�����x-��D�pA��0A��	���p��0��	��C���x-D�$V���x��0��	���H	��0��	�D��H�|$(F�AD�L$H��
�Y
D�P
E����H��H��M��H�|$(H�H���ff.�f�H��H9�sD�E�k�A��u�H�t$L�D$H�4$�~$L�$$)D$0D�fI~�A��0A��	��A�	D��G�,ZE�)�p��0��	��G�D�H�HF�FE�D�XH9��3A��:�OD�hL�\$8A��0A��	��E�C�4�E�DuE�D�PA��0A��	�oG�,�L�@G�jE�D�XL9���A��:���H��0��	�8D�\$D�hC�4�A��0D�qD�T$A��	�G��D�XC�LM�L$H�H	H9��tA��:�_m��A��.��H��H)�H���H���~
D�P	H�H
E�j�A��	��H���^D�H
H�HA��0A��	��G�l�G�,iH���!D�XH�HA��0A��	�eG�T�G�,SH����D�HH�H
A��0A��	�;G�l�G�,iH���)D�X
H�HA��0A��	�G�T�G�,SH����D�HH�HA��0A��	��G�l�G�,iH����D�XH�HA��0A��	��G�T�G�,SH����D�HL�XA��0A��	��I�L0�#ff.��I��E�K�A��0A��	�iC�D�E�,AI9�u�H���RH���	1��9@��H9���I��I)�I���&�@L���L�\$L�L$ D�BE1�L�$�:-H�J�~$L�$A��A��0C�t��D$�D$ $�D$$fH~�)L$0A��	��D�G��G�XD�BD�A��0A��	��G��G�PD�H�BD�ZH9���A��:���JL�D$8��0��	�WE�G��F�Q�JE���0��	�9G��D�ZF�IH�JE�H9��LA��:���B��0��	�D�D$$D�RG��A��0F�XD�L$$A��	��C��D�Z	E�BH�B
D�D$$H9���A��:t
A��.��H)�H��t
H����H���Q�QH�A��0��	�~H���6D�IH�AA��0A��	�]��A�QH���\D�QH�AA��0A��	�5D��C�BH���3D�YH�AA��0A��	�D��C�KH����D�QH�AA��0A��	����A�RH����D�AH�A	A��0A��	��D��C�XH��tfD�I	H�A
A��0A��	��D��C�QH��tAD�I
L�YA��0A��	�qH�D9�I��E�K�A��0A��	�S�<�A�yL9�u�H���>��iL$DkD$ <D�L$$��8����R1�L�� ���v��H���1�H��H�$��u��H�4$I��H�.��M����H�=�� D�L$D�D$�L$H9��gSD���jAWAU�T$,�k���H�� I�/���h���1�E��@��E1�H9��5������bL�+� L�=� D�L$D�D$�L$I�L9���SD���jAWAU�T$,��M�'H�� M�L$�M�M����g��I�.�6H�\$HdH3%(�7H��X[]A\A]A^A_�ff.�@DiT$kT$ <A�DT$$A��E��������1�1�L��� ��pu��H����1�H��H�$�Yt��H�4$I��H�.��H��t~H�5,� D�L$D�D$�L$H9���SD���jPAU�T$,����M�/H�� M�E�M�M�������f��DM��ff.�f�L��L�=N� H�5�^1�I�?��Q��I�.��1�����@H���������@H��� L�=�� D�L$D�D$�L$I�H9��NS��D��jAWAU�T$,�R���I�H�� H�k�I�/H���_�����e��fDH��L��A��.�P���H��H)�H��t
H���:���H����D�@H�HE�h�A��	����H������D�XH�HA��0A��	�����G�L�G�,KH�������D�PH�HA��0A��	����G�l�G�,jH���a���D�@H�HA��0A��	�����G�\�G�,XH����D�PH�HA��0A��	�{���G�L�G�,JH��tmD�@H�H	A��0A��	�U���G�l�G�,hH��tGD�X	H�H
A��0A��	�/���G�T�G�,SH��t!D�H
L�XA��0A��	�	���H�L0���H����������H�����H���������i���������d��M�_p�@�qd��A�;��vI�op�@�Sd���}����I�M��H�t$(L���5O��H����0�D$�D$��0�D$��	�U����x��0��	�E���D�H��D�WA��0A��	�+����hG��L�XC�Q��0��	����D�$�B�leM��������x-��D�hA��0A��	����p��0��	����C�|��x-D�$~������P��0��	�����D�@	A��0A��	�����D��H�|$(G�HD�T$H��
�gD�P
E����H���H)�H�|$(H���H��H��H�����E1����1����Ei�����L����P��1��������� ���B�������b���@�Tb��M�o\fA�}���W���M�g\�@�.b��fA�<$���>���L���O��I��H������T�
H���!P���������b��M��A���A���uH��
�
����A�����H�������M��L�.� I�:�M�����N����d���AW��H�5@ZH��AU1�AQA��D��APD�D$,�P��H�� ���M��L�=� E1�I��6���L�5u� H�5�aI�>�P��1����H���O������H����e���L��H�$�`O��H�$����N��f���UH��SH��H��H�~H�5�� H9����E+CtD���Ua��H�
�q��Hc4�H�>�����uPH�� H�H��[]�f.��E+Cth���	a��L��q��Mc�M�>A��ff.����H��� H�H��[]�f.���x���f.���~���f.��E +C ����`��L�RqA��Kc�L�>���I�����T$��L���T$��uH��� H��.������k��������S`��ff.�f���ATUH�-"� SH��H�� H�dH�%(H�D$1�H9��$`��I��H���rL�����`��I�|$H9��`��H���TL������_��H�CH�-�� H9��I�|$H9���H�5c� �L������I�|$H�5�� H9��D�CD�SH�T$H�t$D�[H�|$E+\$fA��D�T$E��D�\$D�L$�an������H�K�T$�t$�|$����H�L$dH3%(��H�� []A\�I�|$H9��O����C�S�sf�����Ai��A�T$A�t$��A�D$��f�����i��L��� 1�1�)�1����l���H��H���K����u�H�1� H��d���1��]����J����t��^���K��ff.�AWAVI��AUATUSH��XD�~�ndH�%(H�D$H1�E�^ A�FD��A�^!D�W��A��E�FA�N���V fA��E�NA�A�F"A	�A��A���|$DE�f�A	�D�D$@A�D�|$<�D$=?B�;��;�(A��������A���)�k�<)��A�A��;������D��D���D�)�k�<A)���A�A���8A����Ic�H��s��E���(D9������'�ZA�~I�~��M�~(D�t$<L�� �\$@D�t$L9��2L�5л M9�A��D�\$�{����:D�D$E�������YHc�H�
�rD9���M9���H��� L�����M���(L9���L�T$ D�L$�>I���|$H���]]��H�t$ �|$ H�=Q� H�D$H�p�I��H�T$D�L$ ���
]��H�
�� �A���:]��H�D�\$fA���ZfD�jD�Z�\$D�b@�j�ZD�J�\$H�B������A���fA��@�j fD�b!M9����B#H�L$HdH3%(H����H��X[]A\A]A^A_��A��;~D�ྉ������k�<A�A)�A������D�ȹ�������D�RA��E)�A�D�|$<���DD�D$<L�4� �\$@D�D$L9��^D�{�A���~D�\$E��~2L�5� �D$E1�M������Hc�H�%q��9T$�3���L�5Y� H�5�PI�>�I��1����ff.�I�H�5� H9�t,L�T$(D�L$ D�\$�G��D�\$D�L$ ��L�T$(��H��� L�v����0L9�����A��D�L$H�=H� ��D�L$H��H�������s���I�L�z(�b���A����*D��D��A����)ڍ4R��A)��������A�����ff.�1��ff.����A��<�_���L�=�� AWD�T$D���H�5�Q1�ARUATD�D$,�IH��H�� H������ff.�f�F�d"���<A��;������f��A���b������QD�����Dk�dE9��:��i��A9��<����*���f���D9����D��D�L$�Rc��D�L$A�A��A��A��ڹ7�H�L$<H�T$@D�L$H�t$D�a��D�l$DD�L$A�~I�~tg�\$<L��� M�~(�\$�\$@L9�����L�5h� A�E�M9�A��D�\$='�����D��L�-� H�5AN1�I�}�yC��1����f�D�t$<L�4� �\$@D�t$L9��^���A�M���'���E�������A��D��D�D$@E����A���{X��Ic�L�nA�4��t$<D����'����H�-�� H�5�MH�}�E��1�����A����E��~�D9��{�����봺��C���A��A������D)�i�@B)މt$y
��@B���t$����A���D$<D�D$@A���X��D�o�D$@D�l$D�I���D�|$D��E���D$@�D$<�)���������D���d��1������W��1ҹ������Ӄ��&���M�gL�-\� H�5
U1�I�T$I�}��A��1�����L�=� H�5�LI�?��D��1����f���AVAUATL�%_� UH��SH�GH��L9�u^H�~H9�tuH�5>� �B����ueH�{H�5j� H9��t�����H��H�����I��H��� I9��e[L��]A\A]A^�f�L��H���eB�����=H�{L9�u�@�}�S������L�%�� M�4$I�VI�$H����M�4$M�����E�U�uf������_��D�K�S�sA��fA��A���_���U!�u D�ED�s����D�U"�{"D�[!�K 	�E)��uD�KEi�D	��m�[��A��A	�D)�L�=� �)�A	�D�D��Dk�<D)�)�D���b��I��H������E1������H�=�� H�K(H9���H��H�5fJ�u��I��H��tŀ{�9H�{(H��H�5AJ�u��I��H����U��H�5M� I9�@��H9�A��D8���I9���D�PE9VuD�XE9^�gU��L��L���2��M�I��H����U��I��M��<I�,$�AD�e�U�ufA��A���@^���K�S�sA��f�����%^���U �u!�}"D�C D�K!����D�cD�]	�D�S"A���u	�A���{�m�[E)�E	�E	�Ai�)�D��)�D)�)�Dk�<ιD�L��� �Xa��I��H���l���M���%���L��H���8��I�,$I��uL����@��I�m�^T��L��M����@�����ff.�H�}(���+���H�
ű �#����M��E1�L���@�����E1�L���@������(?������S��H�9� H�I�����H�.� H�5�UH�8��@��I�.�!T��I�,$������T��M�E1��?���H�=3� ���fD��AWAVAUATUH��SH��hdH�%(H�D$X1���XD�_�G#D�GD�OfA���D$D�WE��D�o�_E�t$�A��'��D����QE��D����A����Ai�mLc�����D�D�)�L�-h)��C�|���~
A���Q�1�H���l��H�L�$@O��L��H��L)�M��L��H��L)�M�$�H�t$ L�H�4$�<������S��D�|$4�|$0LcD$ LcL$$A��lLcT$(D�t$,�A��kA��'��D�����QD����D����Ai�m��A���A���A�A)�)�D�Lc�G�|���~	���.A�E�Ic�L�[O��L��H��L)�M��M��I��M)�O��I�����R��K�$L��H�4$H���l��L)�L)�H�H�D$�<������R���L$4�T$ �|$0LcD$$D��l��k�T$LcL$(D�t$,���'����A���QA��A��A��i�m��������D�D)�Lc�A)�A�C�L���~
A���tA�HcD$D�Lc�K�4[M��M��I��M)�O��L��H��L)�L�4�I�����Q��M9���|$����H�fk��H�4$L������H�L�T$�;������Q��D�\$,�t$4�|$0Lc|$ LcD$$LcL$(D�$D��l��k����'������Q���i�m����A���A���4$A)�)�Hc��E�l���~
A���D�A�Ic�L�vO��M��I��M)�O��M��I��M)�K��H�����P��H+T$H9T$��H�����P��D�u �U!f��f�H���l���m"A��H���H*�A	�A	��A*��^e�X��n9��H�\$XdH3%(��H��h[]A\A]A^A_�ff.�H�T$L)�L�M��I)�L��觎��H����<P��L9���M9��I���D�d$E����L9�IO��/�������QD�����k�dA9���A������ff.�����Q�����Dk�dD9��5A�����ff.��D��A����Dk�dE9��H���l������QD���A��A��Ek�dE9�������f.�L���v����L9�IL��b���@H���QH�	n��H�t$H�4$H��~8�������t$4D�T$0Lc|$ LcD$$A��D��l��k�L$,LcL$(D�$��'�B����Q��i�m����A����A���Hc$A)�)��E�l����h����m���fD��i�9�������l���f.���Di��E9�����w������Di�E9�������������iA9��)�����H�5�� H9w(�pM��H�5�� �,���I��H����M��H���g��I��H���=M��H�5�� H����9��I�/uL��H�$�+9��H�$I�m����L��H�$�9��H�$�	���H�=�� D��H�5A1�H�?�L6��1����L�-�� I�}��H�5�@1��*6��1�����L�-t� H�5�@1�D��I�}�6��H�t$ H��l��H�4$�6�������\$0�|$4LcD$ LcL$$�s��l��kLcT$(D�d$,��'�r�����A��A�����A���i�mA��L�-�`A��D�D�Lc�G�|�I��A�É��A������}�������J7���L���L����AWAVAUATA��UH��SH��H��H�~H�5�� H9�uu�}�C������H�sH�}�
�}7��A���ZL��H�
�ZD��Hc�H�>��ff.�@��u`H�u� H�H��[]A\A]A^A_�f��5����u�H�{H�5,� H9�����5������H�� H��f����H�
� H�H��[]A\A]A^A_�f���x���f.����l�����fDH�}(��uH�5٧ �ff.�@H�=�� H�s(H9�uPH�sH�}�
�n6��A���KK��D��L�%�YMc,�M�>A��������V���������I���DH��H�5:>�i��I��H���4�{�H�{(H��H�5>�Xi��I��H����J��I9�tKI�}L�=l� L9���I�~L9���A�~A9}��E�FE9E��E�N E9M ��H�sH�}�
�5��A�t$���w&��u"L��L��H��H����������J��������D����Y��I�m��I�.�����L��H�D$�N5��H�D$���H�5�� ��3�����J���L�A� M9���M9���H��H�����H����I��L�D�xI�S�E����D�xDx H�H��uH����4��A�D$���w(E��u#L��L��H��H���~������DI��E1���A��D��D����X���%���L��H�D$�4��H�D$����A���h���A�������H�}L�sH�5<@1�L�*� H�WI�NI�8�1��1�����H�H���P����A����H��A��u8H�&� H����H�=� ����1����L���2�����������H�
�� H�5�IH�9�O4��1��X������AWH�
�� AVAUATUH��H��H��SH��?H��(L�-�� dH�%(H�D$1�L�D$L�l$�q1�����zH�\$L9��+�}�qL�}(M9��dL�t$I�M9��2H��H�5;L���`f��I�/I���3H���L9��H�xH�f� H9��)H�������H��H����I�,$H���oH�����xH�-S� ��H�x(H�h(H�EH�/��G��H�|$L9��@H�H�x(H�m�H��1�1�H�5B� H����2��H�+H��uH���Y2��H�L$dH3%(H���SH��([]A\A]A^A_�H�{H�5�� H9��������0���������H�CH�
ܢ H�5�BH�PH�91��O/��1��I�m��G���}�u#D�uD�ef���t$D�}���U�uD�G�A��'�fG���0N��H�L�@O��M��I��M)�K��H��H��H)�M�$�L���b���I��H����v���K�$H��H�$H)�H���?���I��H����S���L9�H�4$���|$L�������(L��L�$����H�������H�<$M)�H)�I9���H�������H���l��H��N\��I��H�����H9D$��H��H�5�8H���c��I�.I���NF��M�������M9������I�|$L�
�� L9���E�������L��H���A�I�,$H��u�L���X0��H���`����{H�-ܿ toH�{(H�k(H�EH�/�6E��H�|$L9���H�H�{(H�m������E��DI�.��E��H�E���ff.��L����/���+����KD�SI��D�KD�C�S�s�sfA��D�[#A��ASU�C D�c!D�{"��A��D	�D	�P�h��I�H�� H��H��I�H��uL���b/��H���j���H�k(�%���H�5�� H����I��H���D��L��� 1�1Ҿ1��^O��I��H����C��L����\��I��H����C��L���\��H����C��H��L��H�$�,��I�mH�4$I��uL����.��H�4$H�.uH���.��I�/uL���.��I�,$uL���.��M���yC��L���+��I�.I��uL���w.��I����D��L����Y��H��H�D$H���;����AC��I)�I�M��I)�L���*���H����A���L9�tM9��(����|$tL9�IO�����L���
���L9�IL�����L���Q�����:-��f.���UH��H�5� SH��H��H�H9�u&H�}H�%� H9�uBH��H��H�ߺ[]�j��E,����u�H�{H�5�� H9�u2YH��H��[�]�>�H�5׺ �,����u�H�'� H�Z[]��+����t���@��AWAVAUATUH��SH��H��H�~H�5M� H9����}��C��H;](��H��H�5�4H���.`��I��H����L�=� L9��r�}��B��H�}(H��H�5�4�_��H��H����B��L9��H��L���ս��I��H����B���H��H���I�I��H���H�+���}�RB��H�}(L��H�5;4�_��H��H����B��L9��=H�xuJ�@ ��uCI�m�>B��L���,��H�+�nB��I�,$uL���+��H��L��[]A\A]A^A_�D�H��L�����I�.H���B��L���+��H���*B��I�m��A��L���+��H�+�B��I�,$I��t��H�
:� E1�L��E1�H�5
BH�9��+��I�,$uL���[+��H�+�jA��M���M��tI�.uL���5+��E1��6�����)�����W�}��A��H9](��H��H�5�2H���:^��I��H��t�L�=� L9����}��@��H�}(H��H�5�2�^��H��H����@��L9��'���H��L�����I��H����@���H��H���Y��I��H������H�+���}�j@��H�}(����H�=� H�5�@M��H�?��*��I�/����E1�E1�L���/*������I�m����L���*������L�Ú H�5L@E1�I�8�y*�����H��� H�5�@L��H�:�[*���l���H����)���V���L�
�� H�5�?E1�I�9�0*�����ff.���UH��SH��H��H�~H�5�� H9�u#�{t2H;k(u,H�uH��H�ߺ[]�-���(����t(�{tH9k(t�H��� H�5�?H�8�)��Z1�[]�H��� H�5>?H�:�)����@��AWAVAUATUH��H��H�5�4SH��dH�%(H�D$x1�H�T$(�t&������H�|$(H�T$8H�t$0��s(�������L�d$0H�t$@L�l$8L���$�������t$T�D$PA�;�|$@;H�a� DNL$@H9� �XD��lD�|$L�L$HD�D$D����k��'�$��Di�mA���QA�����A�Hc���E���)�)�H��PAË4���~
A����B�LcىL$Mc��D�D$Ic�H�D�L$H�<@I��H���wH��L�H��H)�M��L��H��L)�L��L�L$�z��H�����L�\$D�L$D�D$�L$I������H)���L�%�� L9��<Uj�5a� D����D��AU�j`��H�� H�\$xdH3%(�[H�Ĉ[]A\A]A^A_�H�=�� D��1��L$H�5/D�L$H�?D�D$�G$�����wH��L���y���L$D�D$H���D�L$��H�����H)��L���I��f.��L$H��H�wI�L�\$L�D�L$D�D$�hy��H�����H�t$L��� �L$D�L$H9�A��L9�D�D$A��u.UR���ff.�f�D��A���Dk�dE9�t9���-����5(� D��H��1�AUH�5a0AQA�ɉ�APE����&��H�� ���A��D��1�A���t����1�����%��f���AUH��H��ATI��USH��(dH�%(H�\$1�H����H���S<��H���BH���9H����H�-|� L�-M� H���#��1�H�T$H�t$H���!#�����8<���L$H�T$I��L��L���ry��H����H9�tH��H�u-H��1�H�5Χ �	&����H�|$dH3<%(��H��([]A\A]�H�YH�WE1�L�4� 1�H�|$WH��jj�$��H�� H��teH���3���H�H�-�� H9��'���H�{H�5� H9��};���"#����tL�-� ����H�CH�
/� H�5�4H�PH�91��!��1��F���H���d����~#��ff.���ATI��U��SH�~H��H�5�� H9���H�sI�|$���#������:��H�5GHc<�H�>��ff.�@��u H�Ŕ H�[]A\�ff.�����H��� H�[]A\�ff.����x���f.���~��΅�u��ȅ�y���ff.��!����u
H�� H��H�sI�|$��#�����0:��H�
oFHc�H�>��ff.�f���UH��H�
� H��SH��.L�O� H��0dH�%(H�D$ 1�H�D$H�D$P1�L�L$ � ��ZY����H�\$H�l$H�KH��usH���������H9����{������1�H�=�� ��� H����H�H�XH�@H�L$dH3%(��H��([]�f.������H9�tMD�CA��A��wE1�H�=/� �Y� H��tLH�H�XH��tH�EH�h뗃{ u�H�g� H�넃{ �L�
t� H��H�5R11�I�9���1��\����� ��ff.����USH���tGH� H�-�� H9�t>1�H��H�5$� 1���!��H��H��tSH9�t
H�@���tH��H��[]�H�-J� H�EH����H�
�� H�P1�H�5�5H�9�l��H�+� 8��1��ff.���AWAVAUATUSH��H��H��H��D�[ D�c!dH�%(H�D$x1��CD�k"A��A���K�kf��E	�D�CD�KD�SE	��Ѐ{�T$D�L$@�l$<D�D$8D�L$4D�T$0D�\$,�iL�5j� D�{#L�t$hH��D�|$0H�D$0P1�H�T$xRH�Q,H�L$DQH�
M� H�l$PUL�D$\APL�L$hAQL�T$tARL��$�L��$�����H��@�����|$(��H��1��t$p�t$<V�|$HWD�L$TH�=*D�D$X�L$\�T$`�t$d����H�� H��H���UL�`H�[�D$TL��� �D$XM�l$�H�$�D$\�D$`�D$dL�\$pI����H��1�H��L�t$lAVL��$�AWH�D$xP1�H�T$|RH��*H��$�QH�
2� L��$�APL��$�AQL��$�L��$�����H��@���$D�d$H�|$`D�T$\D�\$XD�|$TL�t$pA�D$��|$L;5�� �t$dD�T$D�l$P�\$LD�\$D�|$�D$='�p�S�����E��� ���FHc�L��FE9,��A���A��;��A��;�e��?B�Y����L;5 � �"H�<$L�7V��L�5� H��0�(L9�������I��H���V5��H�<$H�x������5��L�m� E�CE���5��A�_�\$fA���L$fE�gA�_�\$D�d$E�o��D�l$A��A�O��fA��E�gL;5l� I�I�G����E�oA�w fE�O!��t$(A�w#H�muH�����H�t$xdH34%(L����H�Ĉ[]A\A]A^A_�f�L�s(����I�~H�5e� H9�t
�{������L�$H��T���0I��0H9������t$H�<$��I��M����A�_�\$fA��D�T$�|$E�oD�\$��A��fE�gD�D$��fA��E�WL;5_� I�G����A�E�_E�GA�O fE�o!��I�M�w(����1��k���H�� 1�H�T$pRH��'H�L$lQH�
� H��$�P1�L�l$xAUL�t$|AVL��$�AQH��$�WH��L��$�ARL��$�L��$����H��@����D�d$H�\$\D�\$`D�|$XD�D$TL�t$pA�T$��\$L;5w� �t$dD�\$D�l$P�\$LD�|$D�D$�D$��'�.�K�����E������u��A��tdLc�L�kCC��D9����|$���|$;�5�|$;��|$?B�����L�5p� H�5�,I�>�)��E1��w���A���QD��A����Dk�dE9������DiڐE9��t����a���fDH�XI���L�cI��$��tJH�{
�+����s"����������H�T$pH�<$H����B��I��M�������������������{ ��1��H�{
�����S �щЃ��� ���m1�����X1����@L�[J�B1��E�;A��A��A��A��E�������H�����H��H����0��H�T$pH�<$H���7B��H�+I���M���H���R���@���H�p H�t$p���H�� H�5}!H�:����{����o��H�Љ H�5#H�8����[���H�=�� D��H�5!1�H�?�I���;���I�vL�5�� 1�H�VI�>H�5Y)�$������L�%p� H�5�"I�<$�(�����L�
T� H�5�"I�9�
������L�=9� H�5�"I�?��������L�� H�5� I�:�������H�-� H�5|"H�}���E1�������USH���tiH��H�-.� H�(H9�t]H�o"H�5�1��8��H��H9�t/H����H�xH�5L� H9�ue�����H9Ht&�p����w%H��H��[]�H�-Ȉ H�EH����{ ��/��H�+uH�����H�?� H�5�(1�H�;1�����������uCH�CH�=6� H�KH�5�(H�HH�?1����H�+t1��t���H��1��+���e����R/���AWA��AVE��AUE��ATA��U��H�=�%SH���L$�t��H����/���M�H��?H��Ic�D��A���Q�ȉ�A��A��i�m�����)�A)��ɍ}A��H�A�T���A���r@����B�C�4D�T$PD�H�=*"D�A��$I�AR��A��V��A��A��E��1���D)�D��A)�D��D)�QD��AVD�D$,�Y��H�� H��H����.��1�H��H�5M� 1�H���s��H�+I����.��H�muH������H��L��[]A\A]A^A_�D��A���k�d9��.��E�IC�<!B�A��$I�D�T$PD�D�ARE���A��WH�=G!A��A��1���D)4�)�D��)��QD��AVD�D$,���H�� H��H����-��1�H��H�5�� 1�H�����H�+I���4�����-��DC�<�b������H���W�wE1��j�E1�1�f��������H��Ð��ATUS�H��u?�wH���O�W�j�D�KD�Cf�������^_[]A\�ff.��H�(H�-�� H9��/-��H��H�5b�G��H��t�A�����H9�u9H�(tMH���C�K�S�sATf��D�KD�C������ZY[]A\�H�xA�u�E1�x A���H��������AWAVAUATUSH��H�����H�(L�%� L9���H��H�5��F��H��H����L9�����H��H���k��H�mH���V,��H��tc�CD�cD�kD�sf��H�+D�{��D�KuH��D�L$�Q��D�L$PD��D��E��jD�������ZYH��[]A\A]A^A_�1���H�(��+��H�뉐��AUI��ATI��USH�i� H��H�GH9���H�~H9��AA�l$ n A�\$^��?B��E�d$Df��Q��E��$�ɚ;A����5w�*1�H�=�� �&� H��t"�XH�G� H�@����D�`�h H9���H��[]A\A]�H��H���������I�}H9���A�m Al$ A�]A\$��?Bv2f.����C������)�i�@B)�y	����@B�A�}A|$A����Q�&���A�E.‰�A��A��A����D)�DiҀQD)�y7�ÀQF�d"���H�5� �>�����R���H�O� H�H������A����L�-�� ��ɚ;D��1�H�5[!I�}���1������ATUS�o �O��A��A�܁�?B���A��QwBA��ɚ;��A)���A����5wwm1�H�=c� ��� H��tH�@�����XD�`�h []A\Ð�E.�D��E���A��B�"��D)�DiӀQE)�yI��A�ĀQ)����ɚ;����5wv�H�-�� ��ɚ;��1�H�5� H�}��
��1��ff.�)�D���ɚ;A����5w�N���빉�@B����Յ�y	����@B)�A������D��H�����x�P �pL�u� 1��>0��H�����fD��L�GM��tI�L���H;=l� ��ATUSH�GH�x��(���xysH���m���H��ta�-H�(D�` �XuH������ؾ<����ׅ��j(���<����х��c(��@��E��uK��u0[��]1�H�=�A\�w��[]A\�H��+�H�=k����[A����]H�=u1�A\�D��[E��A����]H�=B1�A\�*��f.���H;5� ATUH��StH�~H��H�5�� H9���H�EH��tH�[]A\�H;-A� �H�EH�x��'���P����H���A���H��tĻ-H�(�h D�`uH���b��A�����D��D��E��A��B�"��)�Dk�<E)���'��D��A�ų��A���F�"A��A��A��A��A)�<
��D)�Dk�<D)��'�����uwE����[D��]1�H�=LA\�	�����������H�CH�=�~ H��H�5H�HH�?1����1����[H�=�]A\�.
��H��+�	���[A��D��]H�=�1�A\�
��[D��]1�H�=�A\�
����ATH�
s� USH��H��H��H��H�� dH�%(H�D$1�H�l$H��L�d$I��ATL�L$ ���ZY�����|$�w���'��D�L$E�A�A��3���T$D�Z�A������A���Q��D�L$A��F��i�m����A���A���)�D)��Ѻ�$I��q����A���A���D)ҍ<�)�H�T$)�)�H��AO�E)�E�A�<L���3'���T$�t$H�ً|$�/J��H�\$dH3%(�H�� []A\�f�A��5uni�m��A���Q���L��A���A��A���A��)�E)�D�Ѻ�$I���A���A����D)�D��A)�D)ك��������%��H�=| D��H�5#1�H�;����1��K���f.�L�y| I�8�	����t�H��{ H�5?"1�H�;���1�����H�-�{ H�5H"1�H�}�u��1����L�%�{ ��H�5�1�I�<$�S��1������7
���H�=� H�� H9�tH��{ H��t	�����H�=�� H�5�� H)�H��H��H��?H�H�tH�m{ H��t��fD�����=u� u+UH�=Z{ H��tH�=�t �y���d����M� ]������w������H��u	1�� ���fD��1�H�5Р1��
��ff.����PH��z H��H�5>H�81����1�Z����PH��z H��H�5H�81�����1�Z����PH��z H�kH�5�H�81����1�Z�����W �wL��� 1ɋ�u)��D��H�GH9=�� H�pt)H�OH�WH��uH�=�1��0��H�=}1��"��H�=a1����@��H�G�W�OD�GH�=bf��H�p1�������f�AWA��AVAUA��ATA��USP�_D�w�of����D�������	%��Hc�H��s S��H�<ʾAW�L��s E��D��Hc�H��H�=#I�4�E��1��e��H��[]A\A]A^A_�fD���O�W�w�[���ff.���1�1�1��A������U�
H��H��SH���e��H����
���}H��H��u1�1��4��H�+�G
��H�uH��H��1�[H�=�]���H�U(H;�x t¿1�����@��U�H��H��SH������H���
���}H��H��u1�1����H��H�+��	��H�uH��H�=1�[]�?��H�U H;x t¿1��v��H�����H���8��ATUSH����tRH�GA��1�H�P��3��H�+H��uH�����H����
��1�D��H�=#H������H�mH��uH�����H��[]A\�ff.�H;5�w ATUSH��tRH�GI��1�H�P����H�+H��uH���=��H���\
��1�L��H�=�H���P��H�mH��uH�����H��[]A\�fD��SH�GH���W!D�W"H�p�G ���D�[��D�KD�C	��S�Kf����D	�t2ARP1�WH�=�AS����H�� H����	���s#@��u3�{u [�@����	��PH�=.1�AS���ZY��H�s(H��[���H���o���H��u��	��D��P�t$ j�t$(�D$(P�W>��H��(�f�S1�H��H��H��PdH�%(H�D$H1�H�t$�y����tFH�|$H�t$������u3�T$$�D$ H�ٍ�l�T$�p��B��H�L$HdH3%(u
H��P[�1������D��S�H���H��H�5KH��dH�%(H�D$1�I���������	��H�4$H���4���H�T$dH3%(uH��[����f����������R�D�O#t:L�G(�O �G!L�͏ �W"�w����	�	��W�PAR�;T��H���L��t �ff.�f���H��AQE1��T��H���f���UH��H��H��SH��0�M�]dH�%(H�D$ 1��EL�D$�L$H�
q� f���\$��1��T$H��APL�L$ L�D$$�8��ZY������L$�T$H�=�1��t$�D��H��H���Y��H�}1�H���:g��H�+H��uH������H�L$dH3%(H��uH��([]����f.���ATI��UH��SH�H�� H9���
��I�|$H9���H���H0��H��H����L���40��H��H���
��H��H������I��H����H�@�����I�T$H����H�muH���"��H�+uH�����M��twI�|$ H�5s� ��j��H��H������I�t$H�¿1��^��H�mH������I�,$uL�����H��[]A\�H�5"� �]��������H�nr H���1���H�=er H�P1�H�5�H�?����I�,$�
��E1��4���H�
6r 1�H�5�H�9���I�,$u��E�����ATI��UH��SH�H��� H9��2��I�|$H9���H����.��H��H����L���.��H��H�����H��H���-���H�mI��uH������H�+uH�����M��tJH�5!� L���i��I�,$H��uL�����H��[]A\�H�5�� �3������k���H�Dq H���1���f.���AV��H�=>� AUATUS���H���
��H�=#� H�����������H�=L� �w���������H�=x� �c���������H�=ċ �O���������H�=p� �;���������H�=�� �'���������L�(� 1ɺ1�1�L�%� ����H��H���e��H��H�5DL��������K��H�m�V��L�ٌ 1�1�1��6e����I��H�����H��H�5L���K��������I�m���L��� 1ɺ?B�Q��ɚ;�K��I��H������H��H�5�L�����������I�.������H�
�� �L�%�� �)!��H��H���}��H��H�5gL��������c��H�m�G�����'H�
b� �� ��I��H���1��H��H�5L���_��������I�m����L��� 1�1�1���e��I��H������H��H�5�
L������������I�.����L�-�� V1�E1�AUL�5�n 1�1�1�L�%�� M���*N��_AXH��H������H��H�5u
L��������q��H�m�.��P�?B�;E1�AUM��;���M��ZYI��H���6��H��H�5$
L���d��������I�m����L��� 1ɺ1�1��j��H��H������H��H�5�	L������������H�m�w��L�-"� E1�E1�1�AU���jL�%� AVj�5��H�� H��H������H��H�5q	L��������m��H�m���AUA�;A�;�j���'AVh?B�5��H�� I��H���"��H��H�5	L���P��������I�.����L��� 1ɺ1�1��W��H��H������H��H�5�L���	���������H�m�=��L�O� 1�1�1�1�L�%� ���I��H������1�H�=� �� H��I�H������L�uH�EI�H������H��H�5�L��������?���1Ҿ<��L�Ɉ H�-� H�-�{ ���I��H���
��1�H�=a� ��� I�H��H���6��L�pH�@I�H�����H��H�5�L������������H�m����L�H� 1�1ҾDQ1����I��H������1�H�=� �
� I�H��H���e��L�pH�@I�H���j��H��H�5DL��������<��H�m�8��AUE1�E1�1�j�����5؉ j�i3��H�� H�~� H�������H�5�H���Q����'H�5�H���=���H�� H��H�5LH�Ԁ ����H�� H��H�5�H��� ���H��� H��H�5�H�x� ���H�� H��H�5�H��� ���H�� H��H�5�H��� �g���H��~ H��H�5�H�~~ �I���1�H�5H�=�y �D���H������H��H�5H������������@BH�{� ������H�z� �����QH�Q� ���H�=L� H�M� ����H�=G� ����H�=!� �{��H���r����!�u�����!H�� �a�����!H�҇ �M���H�=͇ H��� �(��H�=�� ���H��tH��[]A\A]A^������H��H���dstutcoffsettznamedate value out of rangeyear %i is out of rangemonth must be in 1..12day is out of range for monthON(O)(OO)%s.utc%s(%R)%s(%R, %R)%04d-%02d-%02d%s(%d, %d, %d)%d day%s, %d:%02d:%02d.%06d%d day%s, %d:%02d:%02d%s %s %2d %02d:%02d:%02d %04d(N)(ON)U:__format__UU:strptime_strptimebad tzinfo state argsurrogateescape, days=%d%U%sseconds=%d%U%smicroseconds=%d%s(%S)0%U, fold=%d)%U, tzinfo=%R)%s(%d, %d, %d, %d, %d, %d)%s(%d, %d, %d, %d, %d)%s(%d, %d, %d, %d)%s(%d, %d)hour must be in 0..23minute must be in 0..59second must be in 0..59fold must be either 0 or 1O!O!|O:combineiiiiiiiOInvalid isoformat string: %R%c%02d%s%02d%c%02d%s%02d%s%02d.%06d%c%02d%s%02d%s%02d%02d:%02d:%02d.%03d|s:isoformatautohoursminutesmillisecondsmicrosecondsUnknown timespec value:|Cs:isoformat(ONN)i:fromordinalordinal must be >= 1i:__reduce_ex__|iii:replace|OOOOOOO:__new__daysweeks|iiiiO$i:replace%%ssU:strftimeiiiiiiiiiO|O:fromtimestampiii|iiiiO$ican't compare %s to %s|O:astimezoneO:utcfromtimestampO!|U:timezone|iiiiiiiO$i:replaceUTCUTC%c%02d:%02d:%02d.%06dUTC%c%02d:%02d:%02dUTC%c%02d:%02diii:fromisocalendarYear is out of range: %dInvalid week: %dresolutionminmaxMINYEARMAXYEARdatetime.datetime_CAPINumber of days.total_seconds__reduce____reduce__() -> (cls, state)yearfromisoformattodayctimeReturn ctime() style string.Formats self with strftime.isoweekdaytoordinalfromutcReturn fixed offset.Return None.__getinitargs__pickle supporthourminutemicrosecondfoldReturn self.tzinfo.dst(self).utcnowtimetzutctimetuple__getstate__weekdatetime.datedatetime.tzinfotimespec%04d-%02d-%02d%c%02d%04d-%02d-%02d%c%02d:%02dsepstruct_timeas_integer_ratiodatetime.datetimedatetime.time_strptime_datetimeMonTueWedThuFriSatSunJanFebMarAprMayJunJulAugSepOctNovDecdatetime.timedeltadatetime.timezonea tzinfo subclass must implement %s()offset must be a timedelta strictly between -timedelta(hours=24) and timedelta(hours=24), not %R.days=%d; must have magnitude <= %dUnreachable C code path reached%s(dt) argument must be a datetime instance or None, not %.200stzinfo argument must be None or of a tzinfo subclass, not type '%s'unsupported type for timedelta %s component: %s%s(%d, %d, %d, %d, %d, %d, %d)offset must be a timedelta strictly between -timedelta(hours=24) and timedelta(hours=24).tzinfo.%s() must return None or timedelta, not '%.200s'can't compare offset-naive and offset-aware timesmicrosecond must be in 0..999999fromisoformat: argument must be str%04d-%02d-%02d%c%02d:%02d:%02d%04d-%02d-%02d%c%02d:%02d:%02d.%03d%04d-%02d-%02d%c%02d:%02d:%02d.%06dFailed to encode latin1 string when unpickling a date object. pickle.load(data, encoding='latin1') is assumed.divmod() returned non-tuple (type %.200s)divmod() returned a tuple of size %zddivmod() returned a value out of rangeunexpected return type from as_integer_ratio(): expected tuple, got '%.200s'as_integer_ratio() must return a 2-tupleFailed to encode latin1 string when unpickling a time object. pickle.load(data, encoding='latin1') is assumed.tzinfo.tzname() must return None or a string, not '%s'tzname.replace() did not return a stringFailed to encode latin1 string when unpickling a datetime object. pickle.load(data, encoding='latin1') is assumed.can't subtract offset-naive and offset-aware datetimescan't compare offset-naive and offset-aware datetimesutcoffset() returned %.200s, expected timedelta or Nonefromutc: argument must be a datetimefromutc: dt.tzinfo is not selffromutc: non-None utcoffset() result requiredfromutc: non-None dst() result requiredfromutc: tz.dst() gave inconsistent results; cannot convertISO calendar component out of rangeInvalid day: %d (range is [1, 7])Number of seconds (>= 0 and less than 1 day).Number of microseconds (>= 0 and less than 1 second).Total seconds in the duration.int -> date corresponding to a proleptic Gregorian ordinal.str -> Construct a date from the output of date.isoformat()int, int, int -> Construct a date from the ISO year, week number and weekday.

This is the inverse of the date.isocalendar() functionCurrent date or datetime:  same as self.__class__.fromtimestamp(time.time()).format -> strftime() style string.Return time tuple, compatible with time.localtime().Return a 3-tuple containing ISO year, week number, and weekday.Return string in ISO 8601 format, YYYY-MM-DD.Return the day of the week represented by the date.
Monday == 1 ... Sunday == 7Return proleptic Gregorian ordinal.  January 1 of year 1 is day 1.Return the day of the week represented by the date.
Monday == 0 ... Sunday == 6Return date with new specified fields.datetime -> string name of time zone.datetime -> timedelta showing offset from UTC, negative values indicating West of UTCdatetime -> DST offset as timedelta positive east of UTC.datetime in UTC -> datetime in local time.If name is specified when timezone is created, returns the name.  Otherwise returns offset as 'UTC(+|-)HH:MM'.Return string in ISO 8601 format, [HH[:MM[:SS[.mmm[uuu]]]]][+HH:MM].

The optional argument timespec specifies the number of additional terms
of the time to include. Valid options are 'auto', 'hours', 'minutes',
'seconds', 'milliseconds' and 'microseconds'.
Return self.tzinfo.utcoffset(self).Return self.tzinfo.tzname(self).Return time with new specified fields.string -> time from time.isoformat() output__reduce_ex__(proto) -> (cls, state)Return a new datetime representing UTC day and time.timestamp[, tz] -> tz's local time from POSIX timestamp.Construct a naive UTC datetime from a POSIX timestamp.string, format -> new datetime parsed from a string (like time.strptime()).date, time -> datetime with same date and time fieldsstring -> datetime from datetime.isoformat() outputReturn date object with same year, month and day.Return time object with same time but with tzinfo=None.Return time object with same time and tzinfo.Return POSIX timestamp as float.Return UTC time tuple, compatible with time.localtime().[sep] -> string in ISO 8601 format, YYYY-MM-DDT[HH[:MM[:SS[.mmm[uuu]]]]][+HH:MM].
sep is used to separate the year from the time, and defaults to 'T'.
The optional argument timespec specifies the number of additional terms
of the time to include. Valid options are 'auto', 'hours', 'minutes',
'seconds', 'milliseconds' and 'microseconds'.
Return datetime with new specified fields.tz -> convert to local time in new timezone tz
Fast implementation of the datetime type.������������������������������<����������������� ���$���p���ӎ��x������������X���������������������������������h���i���ȥ��v���@���P������V��� ���\���(���8�����>������D���Difference between two datetime values.

timedelta(days=0, seconds=0, microseconds=0, milliseconds=0, minutes=0, hours=0, weeks=0)

All arguments are optional and default to 0.
Arguments may be integers or floats, and may be positive or negative.fromtimestamp($type, timestamp, /)
--

Create a date from a POSIX timestamp.

The timestamp is a number, e.g. created via time.time(), that is interpreted
as local time.date(year, month, day) --> date objectAbstract base class for time zone info objects.Fixed offset from UTC implementation of tzinfo.time([hour[, minute[, second[, microsecond[, tzinfo]]]]]) --> a time object

All arguments are optional. tzinfo may be None, or an instance of
a tzinfo subclass. The remaining arguments may be ints.
now($type, /, tz=None)
--

Returns new datetime object representing current time local to tz.

  tz
    Timezone object.

If no tz is specified, uses local timezone.datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]])

The year, month and day arguments are required. tzinfo may be None, or an
instance of a tzinfo subclass. The remaining arguments may be ints.
;Zx����0N��?��.A�t��A`�4Bt�aB�������;T����p����������
����������J��p
Q��X���m��(���h�������,$���r����������������`���E�����������6��0e��l���'������D���O��,���x���@����&��S���!��(�(a����Dp��������`����� ��h O�� �x!�"'�T".�X#U��#��$��h$��$��%J��%k�&z��&
� ''�h'���':�4(���(f�8)���)��t*���+��,���,��d-��-(�$.���.��/��0���0`��0��1��`��H �\P�p`��������������������	 ���$	0���8	����P	����d	����x	����	��	���
���H
 ����
@����
����,���H���\��������������@��������
���0
����
@����
�����
���,���H��d`�������@��|������@@������( 	��d`	���
������0��`��$���8��������H�������PP��t���,���\p����� ��t!����$���0'���p)��`�)��� +����-��TP.���0/���@9��TP:���;���>����?��<�B���PH����I��$�K��t�M���pO�� �P��| S��!pT��H!0W���!�a��"�b��h" c���"h��l#�i���#`k��$pm��|$�o���$pv���%�w���%@x��&�����&Ј��4'����|'�����'����H(���(���L)��)����(*0����*�����*���D+�����+г�� ,@���T,���,����x-�����-����8.�T.����.���$/���`/����/����/���,0����0���4����	����	 ���	P���	���x
�������� �����d���x����`��<���P����`������ ��������0���������@��|0�����X����p���0zRx�$��@FJw�?:*3$"D0��0,\����c
Ch
CbH�U�zRx�� ��� �H��K�V
E[
E�t�������,��
0��"D��
X��
l��
���
���"���
���
���
���UHa�8�
4�
$0�8<� LH�`��t ��(Eb�8��(Eb�P��(Eb4����E�D�G W
AAGF
AAH,���F�D�C �B
ABN$��88��B�E�D �D(�D0w
(A ABBAzRx�0����$���,�<�NI�A�A �h
ABJ�\�5E�f���.���Do
MS
MzRx�4��T�Lh��%|��.����R c����@L����B�E�B �E(�D0�A8�A@nHNPo8A0A(B BBBD��$P��$8<�eE�D�D RDAzRx� �� D��.A
AAE�H�=E�n �l�E�Q U
AA ���E�Q0e
AAzRx�0� ���(0D�nE�A�D g
AAA\��U]�R
Ad(|���A�D�G0D
AAAzRx�0�� 1���\�'E�a�p�Lp�S���Mq�S�,��UE�p
K(H�|F�K�A �fABzRx� ���$h��(�ܿ��|E�M�D0x
FHE0=��(����E�M�D0{
JAEp��((��A�A�Dp�
AAAzRx�p�� ���A0� �F�A�K �D0�
 DABAzRx�0���$���:<�H�B�E�B �A(�A0��
(D BBBI zRx�0�����(x��N8d	����qB�B�A �D(�G`l
(A ABBAzRx�`����$V��x$�	����YE�A�G IAA�	����
$
����?E�A�A uAA�V��(L
H���eB�A�A �]AB��(�
x���jI�A�A �[ABH���<�
�����E�IA C(I0IY
AJK FAJ
E�
���AK FA4,����E�A�D Y
AAAd
CDE,dP����B�A�H �T
ABA$.��'�����0����-�4���7`�`���iF�B�E �E(�A0�A8�GPC
8D0C(B BBBSx
8A0A(B BBBN zRx�P������(}��[$�4���eE�D�D RDAL���.A
AAE(�\���tE�D�D h
AAIH������F�B�B �B(�A0�C8�GPx
8D0A(B BBBD�2��h T
��EDB D(E0IDx
���)E�O�MH_PHXH`U@�HAPBXB`I@Z
AAAzRx�@�� ���/BHDPBXN`Q@ �
����h_IB F(B0I( ���UE�A�D0	
AAA L���{A�L`c
AA pd���gE�[ @
AAzRx� � Y�������	,�|���E�A�r
AW\
ASt���B�B�B �B(�A0�J8�NP�XL`UXAPD
8D0A(B BBBKTXM`MhApLPGXO`KhApLP<����uXN`PXAP(�t���E�J�N��
AACP����E�A�P���J�F�Q�Z�j
AAHT
�I�O�D�P0 ����F�H�A �GP	
 AABMzRx�P���$W�����,	���B�H�E �D(�A0�G@hHFPFX_`S@�HAPHX``S@d
0A(A BBBAIHFPEX\`S@�HAPFXa`S@ zRx�@�����(���/0D ��nE�Q (J0F8B@I X
AM�p��H�H��8F�B�B �B(�A0�A8�DP
8D0A(B BBBB���x�h���SEyB IA��LHu N(����HB L0D ��YB�A�A �D`�
 AABL�xL���B�E�E �E(�D0�G8�D�4�B�B�B�Q�X
8A0A(B BBBA�
�A�F�EB�O�D�G�L� t��wE�G0d
AA(
G��8����E�y
rlX|��	
F�B�A �A(�D���I�F�A�d�I�S�B�a
(A ABBPk�J�T�A� zRx������(���0���F�A�N �D@�
 AABDzRx�@���$=��9@h����M�D�G0t
C�A�EP��L0��d
AAA��-X�����F�B�E �A(�A0�J`_hWpRhA`�
0A(A BBBAAhRpWhA` zRx�`�����(����4T�����E�J�DHFPPHA@d
AAA�9��0��!���F�A�N �D@�
 AABA����9H�l"��/B�B�B �B(�D0�A8�D@^
8D0A(B BBBD zRx�@������(����\l%��cF�K�B �A(�A0�D�^�H�M�M�F�V�3
0A(A BBBA zRx�������(���{,����F�D�D ��
ABA����t,H���F�D�D ��
ABA��-,�h)��8F�H�D ��
ABBL���8�d*��B�B�A �C(�G0
(D ABBA�(��8 $,���F�H�D ��
ABAn
ABM�����@p�-���F�D�H �G0�
 AABFn
 AABN���H�L/��dB�B�E �B(�D0�D8�D@e
8D0A(B BBBA�D���X(\0��F�B�D �A(�JphxN�G�G�SpLxB�`xApX
(A ABBEzRx�p����$O���8��1��lE�A�MPmXH`MhMpSP�
AAA,� 3���F�A�F ��
HDE����L8�5��}
B�B�B �B(�A0�A8�G��
8A0A(B BBBA$zRx��������,��8��?���E�N�N0b8Q@IHEPU0J
AAA\���(@���E�N�N0q
AAA�@�@���F�I�B �B(�J0�H8�G���B�A�O�I�F
8A0A(B BBBN�
�B�B�N��D�D�E�K�U�Q�E�G�L�$zRx��������,���'8�D���F�E�D �A(�K0�
(A ABBH����2Hh�E���F�B�B �A(�A0�Q
(D BBBAP8B@I8A0�w��JH�<G��R�B�A �A(�G0x
(A ABBAb8B@EHbPS0�a��00(�H��F�A�H �G@�
 AABA,	I���p�J���F�B�E �B(�A0�A8�J�Z�V�I�G�G�G�G�G�S��
8A0A(B BBBL��M�M�I�G�F�J�G�S�$zRx��������,����2,D�P��.F�A�A �s
ABAz��!(��Q���E�A�D G
DAAX[����R��>F�B�B �B(�A0�A8�D�/�G�B�B�M�_�G�B�B�P�s
8A0A(B BBBP��G�A�B�P���G�B�B�P�4�N�D�H�N�|�����4��`��CE�D�G0S
AAKC
AAK(��0��a���F�A�H �G@
 AABA�����m`( c���B�B�E �B(�A0�A8�D��
8A0A(B BBBH��U�A�B�N�������<� �j��*F�B�B �H(�D0�]
(D BBBC������L� pn�� F�B�B �B(�A0�D8�D�
8A0A(B BBBL$zRx��������,�����`�!v��(F�B�B �B(�D0�D8�GPx
8A0A(B BBBCS
8A0A(B BBBC�&��=\�!�y���F�I�B �B(�A0�J8�K`Y
8A0A(B BBBD~hPpAx\�L` zRx�`������(���@�"���E�K�G ]
LAEZ
GFE\
AAAH�"`���F�B�B �B(�A0�D8�G@5
8D0A(B BBBF�E���44#�����E�D�G d
IAEl
CAA�l#����NF�B�B �B(�A0�N8�G���B�F�J�I�[
8A0A(B BBBA�
�A�R`�J�I�G�L�H�#��F�H�D �A(�DP�
(A ABBAHXR`EhBpIPzRx�P����$��FAXU`DhBpIP8|$؆��F�D�C �c
ABMP
ABMH���0�$����dE�N�RH_PMHA@�
AAK(%���E�A�D G
DAA�f����@%D����F�B�B �B(�A0�A8�P���K�H�M�M�G�G�G�Y�W�F�E�E�f�_�L�J�F�H�P�Q�J�Y��
8A0A(B BBBC��M�P�I�G�J�I�M�Y�8
����($& ���E�A�D i
DAA� U���'hd&�	B�E�E �E(�D0�J8�DP�XF`hhEpNPB
8D0A(B BBBFrXI`ihEpNP�����[�&����/HQ UL'�����F�A�A �Q(N0W(A A
ABM}(R0W(A A
ABA����	Td'����F�B�B �B(�A0�A8�GP�XK`KXAPD
8A0A(B BBBAxt���8�'�����F�E�D �A(�K0�
(A ABBA,((���F�A�A �c
ABB<(���*dP(4����d�A�A �p
�C�K�EA
ABAK���L ���A
�F�K�EA�I�K�H!����0K
�H�B�EX�(�����M�A�D �g
ABD�
DKE|
HBEO
GKEADK�!F����u
DKE<T)��iF�H�A �T@YHJPKHA@�
 AABCdp���7��)l���,F�N�B �A(�A0�[8G@]8B0r8O@S8A0�8Q@IHBPI0s8S@QHEPI0�8J@UHBPI0�
(A BBBA!���,GNU��D@D�!�\�YIW�Y�W�[
[�YpY�Y�Z�Y.]�YC]�[�`�Ya�Y@a�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]Ufp�HE
|V�!��!���o`p�
���!��=` (	���o���o����o�o���o���!�E�E�E�E�E�E�E�EFF F0F@FPF`FpF�F�F�F�F�F�F�F�FGG G0G@GPG`GpG�G�G�G�G�G�G�G�GHH H0H@HPH`HpH�H�H�H�H�H�H�H�HII I0I@IPI`IpI�I�I�I�I�I�I�I�IJJ J0J@JPJ`JpJ�J�J�J<Z�[�[f�Y 0f�[�hf�[pr�[�;��`�pM�Kp=`E�>�D0����[�mW�mH\pmwZ�J s�Y���f�[0��f/[`Ag�[�y�g\�F\`Z`��g�W`u%\�\�9h3[P�@h�Yps�hA\m�hL\��iD\0�Hi�ZK�i�[ u�[P���V0E�i�VE�i�V�D@jV\p!�j�[��[�V�?�j�V`�^\�V�vs\V\%�j�\�r�\�\m�\�l�\�l�\�l]�k�\�l�YP� k`Z���g�W`u%\�V@�(l�V -Pl�V��\�Z��xl�[��lZ���l�[@G�[�\�l�\�l�\pl�\@l]l�\0l�\�(��u�\���lwZ�0m�Z�%pm�W�u�m
Y���m�[ �0n]P�hn�]P��n�\�J�n\�F\�\�9h{Z�o�\�:0o�Y�po�V�6(l�V��Pl�V��\�Z�-�p�Z��pZ ��l�[�F�[� p
��!��!��! �!@�! qpI�J�n�m�J���](q����������!�\�Y�Y�Z�V�\�\�[]H\{Z�\ �!�\]�]]V\�\�[WH\�[WH\�\�\�\�\]�\�\�\�\�\]�\%]]]%]wZ�]a]<Z�[�Y�Y�Y�YAZm]�]`Z�V�V^ @y�E�G�>`t0���!@�!�+�Y] �E��!px�D�s�*��! �!�] t�!~]0�x�H�!@��m@v� �!�!��!�`��](�x@����m�t����!��!�t���](�z�!���s r`���!�!��GA$3a1HE�V_datetime.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug�$��7zXZ�ִF!t/��3o�]?�E�h=��ڊ�2N�������fkESl2�]H�=�g2�fh7O���6h�A�zw�ǀdW$jfU,�a@(� `�ڦRn.q��m�d,�e�Z�/o�Zw(8�!��X[�+(Mx�9�	��[�S��A���ᴗm��e��߲�v�x.��(��<��� ���×�a�ێ�A����A&����1{u�nc{��en������ҾT�T��`�Þ�Y��x<���l���d�8��D�L�M+
�JM�
�iy)P���we�
��}
f}��*.��W\����H����֩���cB[^Vۍ�^f�d�gVB@E�>��9��G�����?��8t5(t=��ޞ]�j:���!hln:�l�.�vC��CW�X��I�?j��� �">t��_����,�L�B>�Z�D̦�f�$��+Խ1⫃�_����%��n$�*L�zfF>���^�,{��nQ��f��S<���T%���]��?��	�̚��@<�wV}�g�,E���C����
�b��b%\;U���R��u��v��T�(�ܞ�!��)
y|\msM�&c��8�Bwo֩�з��%9xc@�J���X��a|R^₿>��{���3�v�f�`}���:q�2��"R�8/�ȼܝ���+��G���~��r�L���#���ވ�[n��p�|�LX��P�d��(q׭F�6j�
x����%�njx�F#>g��ޠW�p]Z���x�(�Z��i��Tw���k���2�Z��΂F���i����<නu�/%%/w٣<�����'	��*���h�_u?�Ύ�9���☰s����Bmأ���-��[��*ƸתUE#�^��^�u";���Yi�x ۵�~CX%���N7��R�NW����w��/�����gӣ.,���MI<�CG�����p-��wI���=���E��ӟ��n��L,r�n��u�P��+m�|^�,��aj�q�r��)�+�#jU��b�����,���
�'�ꛚL�s%����y�.}9��䶙P��[pH����r��\lv���{��X�N���>�Q�<��,i�|O*K�q��=v�&���THC&�{�~n���su���]����K�5��d�qE!�ohM���0רa`��2��>�`�a�����#����͌αF�<հ�*�k1��>�`qr���\�
11��E�:=�XG�_fq��̟X���AM�_1G�B5��j��˶�z��cpy|����;I�y9f�e-�oFa�r�^���n	���	�-��y������0��eɁ�_�4Dʛ��T�+b#���ReL��Y�Y�ݗaK���r��
�͹%%�����u��̢��(�O���?���UC8@$>Nm�:�B�4;��s�_�BA?�}̍o.O��յ�k��OrBG3����Y$T��u��K�oҕ��:-�/�4L�ĭ
~4��N�u,!A(Bȉ�Z���ٶK`y�d�J�2�̤W9�P����7l��>��d\���}���+��ir�t�G2)T=��4�xR8�l����$�W�]4�K{sKM	���,�oh[�9�{�H�Z�u�����с{'��Cm��\�b�4�	��]����x���k;ֹ,V��_x���������I@��������xMpϬ�F���`b@��&��]�z00�s�K�ME%��N+2a��A��Ӊ��y�������?L�N�r�k�ߤ��=��x�R� ³L�VXs���;�*iG[�sS��;ʢW�A	��e(
�n4�9���}�i�	_���֝��2�x��j�R`'�=�ZT�O��9ת�%Y�2���U���p/e{�����׬eÒ��}�����f;
�o]�2k~�n�u�v����#�_(�HW��!Ё���`���*o�^9�0�
W>�}+����.��:��֛pG��ݦň��	8(θ�(T��1��-j�+�-�М����̃՜����D��ž
:�ɬ<8w���+88��d
?��2j�
a%�2f'�4�����y��E)I���u>�ϲ�X��f,k4��}*/���X]qQ�C���RH����1J�X�\@<�J4Y�f�z���X���E%w��k]ٱ��3å;���׏Q����7��<?{f���F��PN.	Q.���z?��n���=�)���^�^��K\Ǜ�
{J0hIh����������F@F��E�Z���:Vk������
;&��o˚qϏ�֔V��Aw*ޟb���
�r�$����/�s���H�(��h�,��H9��8����C�%6r��Tz�|�St�e��~HӴNG=���qQUo�_�zK��}M�s'����e��)䶶�:3u�9*7&����PEz%�|�;��V�(�c�&]�&^�ƔW(T8�'���.p@lT�)�`ȁ�̝�5�2C�q&w�u��L�-rM+���(��>'���h��<���j`/��F��%�r}[(�6�!j����E��`!ԎW�[�W�bj�d,�wq�y8�@�'�=��i@�P�L�U��=幥�/:Z+�D���I-k�.jr���+"l9�Qwr!�j�!�#^-rV4�` 6���{=4��ٝ��`�&��tZ\ռoOq��z[TI���\����*}qz:��<�o��o�|��>9lN��J���Tާ�B*��y-6�Fw���0"X=:��P����シ����� �2L��c��U�p2?H����t���3PuK���i�W�00TC@HWx�_H#��d	��|��(��>��Pi�w���w+��e#bH�|���x��m�u�`�-���n
Su�,���9��<�����op�{
L���Sg���	�c����f}�����g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(���	0pp�8���o�E���o��pT`` (^B�=�=�hHEHEcpEpE@n�J�J0w�O�O�}|V|V
��V�V@! ��w�wT�88D*����� ��!����!����!�� ���!�����!��@��!�� ���!��� �P�a��$
��`D��0�(lib-dynload/_elementtree.cpython-38-x86_64-linux-gnu.so000075500000252720151153537500016570 0ustar00ELF>�F@�N@8	@�� �(�(!�(!  �)�)!�)!888$$���  S�td���  P�tdP�P�P���Q�tdR�td�(�(!�(!PPGNUB��I⠿�Jx�[Z- "�}�@ }��|CE���qX�)���i�� �� �_V��0��=���s1.o�J��� '���w�, �e�JF"A'Z{?tb�-����b t��� �X�A6�����w�y ~���3>�>-�<��
R��������(�bch�P���T�L	�A!��A!��A!���__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libexpat.so.1libpthread.so.0libc.so.6_Py_NoneStructPyModule_GetStatePyState_FindModule_PyObject_CallMethodIdObjArgs_PyArg_UnpackKeywords__stack_chk_failPyUnicode_FromFormat_Py_DeallocPyList_NewPyObject_FreePyExc_IndexErrorPyErr_SetStringPyType_IsSubtypePyExc_TypeErrorPyErr_FormatPyExc_AttributeErrorPyDict_New_Py_BuildValue_SizeTPyUnicode_FromStringAndSizePyUnicode_JoinPyList_Type_PyObject_GetAttrIdPyNumber_Add_PyObject_SetAttrIdPyList_SetSlicePyObject_GetAttrStringPySequence_FastPyUnicode_AsUTF8strcmpPyExc_ValueError_PyArg_CheckPositionalPyUnicode_FromStringPyDict_GetItemWithErrorPyErr_OccurredPyDict_UpdatePyDict_CopyPyDict_DelItemPyLong_FromSsize_tPyObject_MallocPyErr_NoMemory_PyObject_GC_NewPyObject_GC_TrackPyMem_MallocPyDict_TypePyExc_DeprecationWarningPyErr_WarnExPyObject_RichCompareBoolPyList_AppendPyObject_IsTruePyObject_GC_UnTrackPyMem_FreePyObject_GC_DelPyNumber_AsSsize_tPySlice_TypePySlice_UnpackPySlice_AdjustIndices_PyArg_BadArgument_PyArg_ParseTuple_SizeTstrlenPyBytes_FromStringAndSizePyUnicode_DecodeUTF8PyDict_SetItemmemcpy_PyObject_LookupAttrIdPyObject_CallFunctionObjArgsPyExc_RuntimeWarningPyExc_StopIterationPyErr_SetNonePyMem_ReallocPyUnicode_NewPyDict_KeysPyDict_ItemsPyCallable_CheckPyTuple_PackPy_ReprEnterPy_ReprLeavePyExc_RuntimeError_Py_CheckFunctionResult_PyObject_MakeTpCallPyLong_FromLongPyObject_SetAttrStringPyErr_SetObject__strncat_chkPyBytes_Type_PyBytes_Resize_PyObject_CallFunction_SizeTPyUnicode_TypePyUnicode_AsEncodedStringPyExc_OverflowErrorPyObject_ReallocmemmovePyFloat_TypePyNumber_IndexPyLong_AsSsize_tPyTuple_New_PyArg_ParseTupleAndKeywords_SizeTPyDict_Next_Py_HashSecretPyErr_ExceptionMatchesPyErr_ClearPyUnicode_AsUTF8AndSizePyThreadState_Get_PyTrash_thread_deposit_object_PyTrash_thread_destroy_chainPyObject_ClearWeakRefs_PyUnicode_ReadyPyObject_GetBufferPyBuffer_ReleasePyList_SetItemPyInit__elementtreePyType_ReadyPyModule_Create2PyImport_ImportModulePyCapsule_ImportPyExc_SyntaxErrorPyErr_NewExceptionPyModule_AddObjectPyExc_ImportErrorPyType_GenericAllocPyObject_SelfIterPyObject_GenericGetAttr_edata__bss_start_endGLIBC_2.3.4GLIBC_2.14GLIBC_2.4GLIBC_2.2.5�ti		���	ii
	ui	&	�(!��(!���(!�(!�(!���(!Z�)!��)!c�)!h�0)!��@)!c�H)!h�`)!c�h)!s�p)!h��)!c��)!h��)!{��)!s��)!��)!���)!���)!���)!��0!�g0!�m(0!@�`0!���0!���0!���0!�@1!��H1!�X1!��`1!��h1!��x1!`��1!!��1!���1!0��1!���1!0��1!��1!���1!���1!���1!���1!��1!��2!��2!��2!@� 2!��(2!��82! �@2!H�H2!p�X2!��`2!|�h2!0�x2!���2!���2!p��2!p��2!���2!���2!P��2!���2!��2! ��2!���2!���2!��3!�3!p�3!�� 3!�(3!�{83!��@3!�H3!��X3!p�`3!g�h3! �x3!@��3!��3!P��3!��3!���3!���3!���3!#��3!���3!���3!.��3!���3!��4!;�4!�4!`�@4!�gH4!пP4!��`4!��h4!hp4!P�x4!��4!���4!��4!@n�4!@��4!���4! ��4!���4!x��4!���4!0��4!��4!��@5!�H5! �X5!��`5!3�h5!�x5!`��5!���5!���5!0��5!I��5!���5!��5!Q��5!P��5!��5!��5!а�5!�� 6!H�(6!В86!P�@6!�H6!�~X6!0�`6!M�h6!�x6!��6!���6!��6!���6!A��6!���6!���6! ��6!��(7!��H7!�(!P7!���7!���7!���7!`)!�7!��8!��(8!�@8!��H8!��P8!��X8!��`8!���8!�)!�8!���8!�)!�8!��9!�)!9!��H9!��h9!@)!p9!���9!���9!)!�9!��:!0)!:!��H:!)!P:!���:!���:!���:!�6!�:!`h�:!��;!0�8;!��P;!`��;!���;!i<! 6!<!`0!<!�0!H<!P�X<! h�<!�=!`t�=!��=!�y�>!(��>!0�8?!p�@?!�jh?!@5!�?!Pq�?!�l8@!��P@!��x@!P��@!0!�@!@4!�@!�f�@!PA!@1!A!`4!HA!PuXA!pf0/!8/!@/!H/!
P/!X/!`/!h/!p/!!x/!#�/!*�/!,�/!-�/!/�/!0�/!3�/!4�/!<�/!?�/!P�/!Q�/!W�/!XP<!p�?!pPA!p�<!G�<!h�<!\�=!�@!:,! ,!(,!0,!8,!	@,!H,!P,!
X,!`,!h,!p,!x,!�,!�,!�,!�,!�,!�,!�,!�,!�,!�,! �,!"�,!$�,!%�,!&�,!'�,!(-!)-!+-!.-!/ -!1(-!20-!58-!6@-!7H-!8P-!9X-!;`-!=h-!>p-!@x-!A�-!B�-!C�-!D�-!E�-!F�-!G�-!H�-!I�-!J�-!K�-!L�-!M�-!N�-!O�-!R�-!S.!T.!U.!V.!Y .!Z(.![0.!\8.!]@.!^H.!_P.!`X.!a`.!bh.!cp.!dx.!e�.!f�.!g�.!h�.!i�.!j�.!k�.!l�.!m�.!n�.!o�.!q�.!r�.!s�.!t�.!u�.!v/!w/!x/!y/!z /!{(/!|��H��H�1� H��t��H����5�� �%�� ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&�������h'��q������h(��a������h)��Q������h*��A������h+��1������h,��!������h-��������h.��������h/������h0�������h1��������h2�������h3�������h4�������h5�������h6�������h7��q������h8��a������h9��Q������h:��A������h;��1������h<��!������h=��������h>��������h?������h@�������hA��������hB�������hC�������hD�������hE�������hF�������hG��q������hH��a������hI��Q������hJ��A������hK��1������hL��!������hM��������hN��������hO������hP�������hQ��������hR�������hS�������hT�������hU�������hV�������hW��q������hX��a������hY��Q������hZ��A������h[��1������h\��!������h]��������h^��������h_������h`�������ha��������hb��������%�� D���%�� D���%�� D���%�� D���%}� D���%u� D���%m� D���%e� D���%]� D���%U� D���%M� D���%E� D���%=� D���%5� D���%-� D���%%� D���%� D���%� D���%
� D���%� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%}� D���%u� D���%m� D���%e� D���%]� D���%U� D���%M� D���%E� D���%=� D���%5� D���%-� D���%%� D���%� D���%� D���%
� D���%� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%}� D���%u� D���%m� D���%e� D���%]� D���%U� D���%M� D���%E� D���%=� D���%5� D���%-� D���%%� D���%� D���%� D���%
� D���%� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� DI��L9h�!� H�{H��t	H��Յ�ujH�{ H��t	L��Յ�u\H�C(H��t)H�8H��tL��Յ��O H�C(H�x�Z �9 �4 H�x�) �d H�x� �y � � ��1��'fH��H�e�����?{���1��f����D���f����&fH�wE1�H��~
� {��I�1@I9���F�T A��{��A��}����tA��*A��1w
M����I���f�?{t2�1��ieD�_A��}tYA��*�ti1��MeD�w�`e�Gf��}t3f��*�tQ1��'e�O!��}�ce��*tE1��G���1��1�노À"}u��>e��j����}t1���d�f�}t1���d��1�Z[]A\A]�L��A�ԅ���e��H��Յ���f��e[L��H��]A\��L��Յ���f�efL��Յ���f��eL��Յ���f�eL��Յ��yf�eL��Յ��gf�re1�[]A\�L��Յ��g��L��Յ��g��L��Յ���f��H�^� �rgH�xH��t	L��Յ�u4H�{H��t	L��Յ�u,H�{H��tL��Յ��5�51��)�$�$�H����gH����gH�{H�/u���H�{ H�/u���H�+uH�����1��k#�����h�z�����h�p����hL�E(�]iH�D�H��H���iH���H����#jH�mt1��kH��H�D$�(���H�D$�j1��okH��H�D$�
���H�D$�XkH���:$H��������H�H���������m%H�;H���Z%H�H�/�I%���1��f$I�m�9%L��������K$L��D$����D$��$�}���1��*$L��H�L$�i���H�L$�$L��H�L$�R���H�L$�$H�/�7l�9����-lH�/�Lm�%����BmH�������lL�������lH�CpH�/��j�����jH�/��m�����mH�/�1m�����'m��H��H�=
�������,j1��kH�/�_l����UlHǃ�H�/��j�l����jH�CxH�/�bj�P����XjHǃ�H�/�Sj�1����IjL�%�� H�5�1�I�<$�����)kH�ChH�/��i�����iH�/��i�����iH�=D��2�I�$H�CpL����jH�/��j����j�uLI�/uL�����H�A� H�5�1�H�;1�����jHǃ�H�/��i�_����iL�m �jH�muH���B���H�+u1��lH�mt1��lH��1������lH����mH����m1��m�l�H���!n��1�[��f���#1�H�(�"���8n���Kn1��DnH��H�D$���H�D$�n1��rnH�+t��1��oH�������H�+t1��#H��1��k�����"H�ֹ�H�=)��]�������n1��o��H��H�D$�-���H�D$��n1��ioH����pH����pH��������pE1��oH������pH�H����$I����L�=� 1�E1�M��M����$L�=�� 1�M��H�{PH��tH�CPH�/tRƃ���#���#L�=�� E1�1�M��H�/��#�h����#1�H�/��#�R�����#�#�C����H�CHH�/�W$�*����M$H�/�C$�����9$H�CHH�/tEL�=4� 1�E1�M���#I���"H�{XH��tH�CXH�/t)��ƃ�1��P"L�=�� E1�1�M��M���x�������L���$���$H�
O� H�5H�H�9�(���1��p1�����p1��p1��oH��� H��H�5)�H�=+��:���1��Yq�.��DqH�=�� H�5�H�D$H�?��H�D$�*q��1��qI�L$(L�AL9��>q��pH�|$H�/��&�����M%��1��A%����%���%I�,$t.E1��(I�,$uL����I�mu�L��E1��v���'L���i���'I�,$u�L���U��'L���H��qI�,$��qL���0��qI�,$uL����H�m��qH���	��tqH�����GqH������ZqL������BqI�,$��1��(H��D$��D$�)L������'O�$M9�woL��H����H��H��t[H�CH�CL�c �(H�mt����'�L���b���(H��D$�Q�D$��L���C��y'L���6��(H�muH���"���1���'H���&sH���sL��D$��D$��qL�%"� L���rL������	r1���H�ֹ�H�=ߕ�����Xs��1��tH�D$��H�D$��sH����sH�C H�/��sH�D$�i�H�D$�sH�D$�U�H�D$�sH�{H���{sH�CH�/�isH�D$�"�H�D$�Us1��
tH��1�H�=9�� �H�����tH�D$���H�D$�`t���mtH������uL������uH�+uH����I�m��uL�����uH�+��uH�����vuH���x��
uH�+uH���e�H�m�PuH���R��CuH�+�9uH���;��,u�1��tH�?�|)L9@�r)H�x�g)H�oH�{0H�u�L�����(A�v L�s0L�� A�t. �[(H������_(I�|$HH���Q(H�t$��'H���9(�*(H�m��1��4vH����I�u�vH��� �vI�,$uL���d�H�muH���U�H��� H�5�1�H�:�����uH���0��quH���#���tH�mu�H�����uH�����CuH��1�����uH������e)H�� �>)H�����H�K� )�?����]*���*�#����A*H��H�D$��H�D$�xH���|���xH�
8� H�51�H�9�����wH���Q�����wH�m��yH���6�����w1�I�|$(�����u�yH�m��yH�������wM�mL��� H�5��1�I�UI�8�*����nwH�D$�8�H�t$H���ey���OwI�m�zL�k� H�5ܗI�;�D�1��rzH�ֹ�H�=1������gy1��JzH���]��yL�%� H��1�H�5��I�<$��1���|L�-�� H�5��L�D$I�}���H�D$�|1�H���U(���t|1��|L��H�D$���H�D$�|����?{1��|H�{(H��tH�C(H�L$�H�L$H�K(1��P|H�-d� H�5{�H�}�<�1��2|H�5�� �S}H�+t1���}�g��}H��1��X���}�N��]}I�.tW1��0H���4��L���'��~H��D$���D$�~���~���?~L�������}L��1������~L�
�� H�5ϐL�D$I�9�r�H�D$����H��H�ĐH�5��H�=����1�Z������(H�sH�=C� 1�H�VH�?H�5������(���(H���N��H���A��ـJ�l�鰀H�MH�=�� H�5��1�H�QH�?�b��H�����ɀ��1�� ���闁�D$����D$酁H�/�	�����H�mt1��H��1�����H�T$�1���H��H���Ł��H������H�m�$�H���k�����H��H�=��]����$���[1�]A\�H�{ H��tH�C H�/�0H�{(H���Z+H�C(H�/�H+���H�-�� H�5�H�}�����)PH�~E1�L�{� 1�1�L��H�D$Pjj��H�� H����*H�(H���A+I����*�2+H����*H�E�O'H�{ H��tH�C H�/tHH�{(H��tH�C(H�/to������)H�{ H���z*H�C H�/�h*�������H��H�N�H�5S�H�=`������(�������E1��*����H������ �H�D$��H�D$�E1��-H�����҄L�����ՅL����鲅H��I�~`�kM�I�P������I�H�����L���W�鉅H�m���H���?��{�H�m�p�H���'��c�H�����V�H���
��:�L�����"�H�ֹ�H�=x������t$I�D$(L�+L�sH���Y-�-�?��0-1��)-H��H�D$��H�D$��-H�����.H�D$��H�D$�4/�v��U/H���i��t/H�m� H�5�H�:���w.��tr����H�uH�@tH�u0�>*A���(�H�}���} *����H���"������E1��U�H���t�H�+uH������W��5���t#L�MH�@tL�M0fA�9*A��鸅H�uH�{���L�MH��L�UH阅L�UH鏅WE1�L��� 1�H��H�T$R1�jj�b�H�� H�����f���H���7/1���.H�+uH���C�H�<$H�/t1��p0���2�#�1��Z0��I��H�$H��t�H���I1H��H���7���x;L�$$�11�e��L2����1H��1�����0���w0H�<$H�/�q�����1���/H���21��>2���L3H���}��j3H��� H�5��H�;��1���2H�=�� H�5�H�?��1��+41��$4H���/�H�
h� H�5��H�9���1��3H�8��4H9V��4H�~��4L�`H�0I�t$�1���x�} L�C0C�|  ��41���4H�?�6H9S��5H�{��5L�oH�}0I�u������36�{ L�E0C�|( H�$��5M��L���k��F5L�UH�7RE1�L��� 1�H��H�T$R1�jj�,�H�� H���B71���6H�}�x6�} *�7�i6L�UH�`7��t��t<H�uH�@tH�u0�>*A���G7��tL�MH�@tL�M0fA�9*A���)7L�MH��H�uH��H���������6�v���H�+uH�������^���H���c6���9��L��H�=
��r����w8I��L�3��L�-~� H�=O� �
�H�����H�}0I���8�6I�?H�5���H�+�#8��H��1�����7L�������=8������7����B8H�+��7H��1����7L�k�e������;����:���;���;�~��;�t��;�j���:�`��4:�V��;�L��o;�B��e:A����?L�]I��~�} {taA�E1�H�1@M9�~iB�|= @��{tb@��}taE��t��*@��1w
H����I����I���AI���AH�uH�@D�m!A��}�?A��*u��}"}u���>��?E1��A��A����>{�,A���n@A�E1�I� F�4�A��{�4A��}�7E��t(A��*��>A��/�|>A��.A��-w
M���h>I��I9�|��4?L�%;� �?A��u�A�1�I� D�~A��{tZA��}��E��t(A��/�>A��*�>A��.A��-w
M����=H��H9�|��>L��D$���D$��?E1���f�>{�z����Vf��}tUf��*�f���f�~}�[����=D�VA��}tAA��*������~}������{=A��|����k=E1�����^=A�����N=E1��CI�mA���CL�������CE1��CL�L$����L�L$�kFE1��lCH��H�}uH�����H�+�CH��H��[]A\A]A^A_���H�<$H�5�H�?��I�m�CL���\���CL���������3E��L���H�mu�H���1���M��H���$����B����EH�m��BH���m�������EH�׉D$�����D$�nCL���D$�����D$�cCH��tH�.t0M��tI�/t/H�m����H��������L������CH�������L�������H�mt1��~H�/��}�b����}H��1��S����}L���F����H��� H�5[�H�:�����YfD��H��1���0H��t2H�<� H�@(H�@0H�T$�~D$H�H�P fl�@H���@��AUATI��UH��SH��H��H�H������H��Յ�uYH�{H������L��Յ�uBH�{ H������L��Յ�u+H�C(H��t H�8H������L��Յ�u
H�C(H�x1�H��[]A\A]�ff.�@H�PH�:H������L��Յ�u�H�C(H�x~�H�HH�yH������L��Յ�u�H�C(H�x~�A�H�pJ�<�H������L��Յ��y���H�C(I��L;h�e�����ff.�@��H�W(1�H��tH�B�ff.����H�GH����H��1���0H��t$H�@pf�@@ @0@@@P@`H���f���ATI��UH��S����H�8H��H�����L��Յ�uSH�{H�����L��Յ�u=H�{H�����L��Յ�u'H�{H��t#L��Յ�uH�{ H��t[L��H��]A\��[]A\�H�{ H��u���ff.�@��SH��H�H��tH��� H�C�PHH�{pH��tH�CpH�/u�Q��H�{`H��tH�C`H�/u�5��H�{XH��tH�CXH�/u���H�{PH��tH�CPH�/u���H�{HH��tH�CHH�/u����H�{@H��tH�C@H�/u����H�{0H��unH�{8H����H�{hH��upH�{H��tH�CH�/u���H�{ H��tH�C H�/u�n��H�{(H��tH�C(H�/u�R��1�[�H�C0H�/u��;���z���H�ChH�/u��#���x���H�C8H�/�]�������S���f���SH��H���H���H���H����H���H����H�{xH����H�{pH���cH�{hH���:H�{`H���H�{8H��tH�C8H�/u�x��H�{0H����H�{ H��tH�C H�/u�O��H�{(H��tH�C(H�/u�3��H�{H��tH�CH�/u���H�{XH��tH�CXH�/tZH�{PH��tH�CPH�/u����H�{HH��u H�{H��tH�CH�/u���1�[�H�CHH�/u����������H�C0H�/�"����������H�C`H�/�����l������H�ChH�/������P�����H�CpH�/������4�����H�CxH�/�b�������X���Hǃ�H�/�6�������,���Hǃ�H�/�����������Hǃ�H�/�����������fD��S1���0H���
��H��f�H�@H��� H�C0H�CXH�H�CH�C CH���H�C8H������1�H�C@f��Hǃ�f���K`Kp��H��[�f�H��tOUSH��RH�?H�/t9H�S1�H9kH�C H9�u,XH��[]����H�<�H�/u	����H�SH���������H�������ʐ��H�G(H��x#H��tH9p~H�PH��H��ff.�H��H�
�� H�5�yH�9���1�H���ff.�@��H��t&H�GH�H�wH��H�(t1��RH���%��1�Y��Eff.��H��u�UH��SH��H��H��� H9E����H��H���FH��tH�H�muH��H�D$����H�D$H��[]��AVH�7� AUATUH��SH��H��H9GuZH�H��H��H;=�� u?L�E1�H�51� I9pA��I��M	�L�H�H�/����1�H��[]A\A]A^���H��H��H�L$���I��H����H�;�3FI��H���U��L;-8� H�L$txH��L�����I�,$H�L$I��u
L������H�L$I�m�h��M��tTM��L��H��H�����I�,$�����x4H�;H��t%H�H�/u���1��5���I�mu����1��"���������fDH�0u1��H�G(H�w0H��uH� H�
N� H�W���H�P H�
� H���r���f�UH���@SH��Q�
��H�EH�����H��uH�,� fo|�H�P H�H�@H�P1�Z[]�ATI��UH��H�=P� S����H���5��H�@(H��H��H�EH�hH�-˾ H�@0H�EH�hH�h �	��I9�uH��[]A\�H�5� I9D$uI�|$t�H�{(L���*�������������AWAVAUATUH�nSH��H��HdH�%(H�D$81�H�FH����H�����H����H�HH������H�=�� ���H�����H�HH�����H�{PH�H�KPH���.��ƃ�H�=�� �q��H���Y��H�p H������H�{XH�H�sXH�����ƃ�1�H�L$8dH3%(�H��H[]A\A]A^A_�L�zI�QE1�L�i� 1�H��H�|$WH��jj���H�� H��H������M�����H�{HH������L�=-� 1�E1�M��H�=�� ���H�����L�pM�����H�{PI�L�sPH���|D���M9�u!H�=�� �o��H���W��L�h M������H�{XI�EL�kXH���4@���1����H�VA�H����H��� L�uM����L�5p� L�mM����L�-\� H�}H����H�T$����A�ą��t��I��H�T$��L�=$� 1�H�{HL9�u+H������M9�������L�=�� 1�E1�M��M����H�H�SHH��t����I���v���1�E1�L�=ƻ �I���J���L�=�� 1�E1�M���E1�H�} H�T$� ���Ņ�����L�=�� H�T$�[�������������fD��ATUSH�oH��H�G���H�{H��u-�&��H�{0H��t
H�/�[��H�{(H��uHH��[]A\�N��L�e�L��H��H�H���&��H�*t+M��u:����H�{0H��t�H�/u��
��H�/u�����H��L�����H�{�q���H�T�L�e�H������H�*t�M��t�I��L��H��H�H��������f.���UH��SH��H��H�5;sH��(H�
� dH�%(H�D$1�H�T$L�D$H�D$�7������H�|$H���HH��u~H�D$H�{H�H�CH����H�/���H�{H�-� H��H�EH�kH�/����H�{ H�EH�k H��H�/����1�H�L$dH3%(�$H��([]�H���VCH�D$H����H�t$H�� H9VuH�~��H�{(�������8��H�|$H��t
H�/��H�L$H�{H�H�KH��t
H�/�6��H�{H�-� H��H�EH�kH�/�
��H�{ H�E1�H�k H��H�7L�F�L�M���%����������H�D$H��tAH���9���H��H�����������H�t$H�������U����V���K���H���9������������ff.��AWAVI��H��AUATUH��SH�����H��H��H��I������H���[��I�>H��I������I��H���`�K��H���9H�����}}�cH���O�}}�OH�����}}�;H���f�}}�'H���`�}}�H���S�}}��H���F�}}��H���9�}}��H���,�}}��H��	��}	}��H��
��}
}���
��|}��H��H9�u�I�$L��H�{ H��oL������H�+I��tHM���K��I�>L��L���a�������I�,$tH��L��[]A\A]A^A_�H���L���r����H���h��뮸H9�t�L�{1�L�����I��H�������@ {H��H�x!H��L������S����뿸븸뱸몸룸뜸땸	뎸
����AUI��������ATUSH��H��H�CH����H�{H��H��L�D�M� I�L$(H��t{I�pH9q~qH�AH�,�H��I�pH�EL�KL�S M9�����M�YI��L�L�[H�EH�/H�G�{8����H�s0H;5n� ��H��H��[]A\A]�f��k8H��H�C��t	H���I�,$�G��H�CH���8���H�k(H����L�S H�{H�C(M����H�PD�C8H��H�H�SH�EH�(H�@E���]���H�}I����H��H������H;-�� ��H�EI�,$����H���!�����)�������@H�� H�;���H��H��[]A\A]�H�}���������H�m�G�����E����3��I�|$ ���H���d���I�,$�#�������5��ff.���H�G(H��u1����H�8H;=� t����ff.�H�GH�H8���tH�H��tS1�H����H��1�[H������1�����f���AVAUATUSHc�H��dH�%(H��$�1���~�>&H��t'H��$�dH3%(�NH�Ġ[]A\A]A^�I���k��H��u̍s�H�}Hc�H�l���I��H��t�I�|$ H������I��H�D$H��thI�\$H��� H9S����H�{0H����H�C L�Ȳ L9���I�L�s0I�L��H�(����I�m�9���L���[���,������H��uރ�d�dH�|$0H��HNӹfo�zH�\$󫹀H��H�D$  )D$H�D$(���H�1� I�|$�P(I�|$L�%� H��A�T$0H��H��H���J�W���� ��H��?���L�GL;ܱ �z��L;_� t6�����H������L�HL�S0L��� M�I�M�qH�C0���L����������L��� ����ff.�USH��H��H�h� H�?�P8�����H��u��tH�K� H�H��[]�1��XH��[]�Kf���SH��H�GH��ttH��1�H��H�5,k���H��t,H�KH��� H9Qu!H�(����H�AH������H�H��[�H�{pt�H�(����H�{pH��1�1�[����H�=� H�5,mH�D$H�?���H�D$����SH��H�H��tH�CH�/tPH�{H��tH��H�CH�/t<H�{ H��tH��H�C H�/t(H�{(H��t
H�C(���1�[����������������ff.��UH��SH��H��H�G(H��uH�@���H�C(H������H��� foxH�H H�HH�@H�H��1�H��[]�HhH9h|1���H��1�H��H��	@��H�L�DL��l��I��������H��L9�wcH�xH�� H��H9�t����H��H��tJH�[(1�H�SH�k�H������I��H���'��H�C(L��L�XH�pJ���3��H���������@UH��SH��QH�~H�5� H9������H�����������H�U(H�H�JH�BH��H��H�B1�Z[]�ff.����AVAUATI��USH��H��0L�ndH�%(H�D$(1�H���5H��L�rH�~E1�H�T$L��� 1�L��RL��M�jj����H�� H���M����H�(H���`I���V���H�C H����E1����H�C(H���K��L�-�� H��eH�5�� L��A�U@H�CH������L��� M���M������L�� H��I�rA��H����H�EH�kH�5�gH���X���H�C0H����H�5{gH���<���H�C8H���5H�5�eH��� ���H�C@H����H�5JgH������H�CHH����H�5eH�����H�CPH���H�5MeH������H�CXH���(H�59eH�����H�C`H����H�5�fH�����H�CpH���/H�5�fH���x���H�ChH����L�\� H�{H��A���H�{0�H�{8�L�1� H�bH�{H�5!A�RhH�-� H�{H�5q����U`L��� H�{H�5�A�SPH�{X�H�޽ H�{H�5�`�RXH�{`L�5Ľ H�{�H�5+XA�VxH�{L�5�� H�5>A���H�
�� H�{1�H������1���H�L$(dH3%(�,H��0[]A\A]A^�L�^� I�;�n������N�A�����H�
=� H�9�M������-� ����$���H�� H�:�,������������L�5�� I�>���������޿�����H�=ڪ H�?�������轿������H�5�� H�>�ɼ������蜿����H��� H�8証�������{������L�-w� I�}膼����tj�]������L�%Y� I�<$�h�����tL�?������L�
+� H�{H��XH�5ZA�Qp����M������E1�1����H�C H���������r���1�1�H�=�� ���H��H���i����U��H�{`L�5�� H�{tH�5&VA�VxL�5�� H�{H�5<���H�xH;=�� �e��H�O����%��H�t$�?���I��H���A��H��1�L���H��H��H��H;t$�9�������Y���f���AUATUSH��H���j���H�SH����H9B0�������I�ă�1�c��H�{0�����H�{H����H�CH�/��H�{H����H��H�CH�/��H�{ H����H��H�C H�/��H�k(H����H�}H�C(H�/��H�}��L�EI�8H�/����H�}~jL�EI�xH�/���Ӽ��H�}~LL�EI�xH�/u蹼��H�}~2A�H�}J�<�H�/u虼��I��L;m|�ff.�@H�}L�M L9��6H���w���L�SH��A��@M��u*�Pf�H�}H�u H9��H���G���H�kH���@E��$�A��I��$�E��$�t	E����H��[]A\A]�L�c0M���5��H�{H��tH�CH�/u�λ��H�{H��tH��H�CH�/u讻��H�{ H��tH��H�C H�/u莻��H�k(H������H�}H�C(H�/uff.�@�[���H�}�I�������H��H��[]A\A]�ɹ���D������H�}�>������X[]A\A]�S���H���;�������H�}�3����v���fD��AVAUATI��USH��H��H������H�G(L�.L�vH��tPH�8H�� H9���H������L��L���Y���������H�H��H��H��[]A\A]A^�f.��@�f���H��I�D$(H������H��� H�P fo�mH�PH�H�@����H���k��H�+�h��I�t$(L��H��H�L���Ż�����C��H�H��H��[H��]A\A]A^��ѻ��H�����H�+���I�L$(L��L��H��H��x�����x��H�H����������ff.�@��ATI��UH��SH�� dH�%(H�D$1��ٶ��H����H�]H�E� H9C��H�{0��H�{@��H�CH�{(H�k H�C H�H�C(H����L�C8H�s@M�HH�~�H�{@M��L�SI�H�m�x��H�spH���H�8�/H�D$dH3%(�H�� []A\�H�{(H�s0H����H�{ H�
�� H�W������H����H�}Pt�H�}(L���C�H�D$H��t�H�}PH�t$���H�|$H�/����H���l���H�H�Q�H�H���Y������H�/����L�c8L�[@I�D$I��L�[@J��H�KH�H�m���H�spH�C H��u!H�H�ZH��H�W H�
�� ���2���H�{`H����:������H�C ����������5��f���USH��H�G�uH�����H�H��[]�H��H��H�� H9E����H��H���g(H������H�CH�muH��H�D$�&���H�D$H��ff.���ATH��H�5�\USH��H��� H�� L�
�� dH�%(H�D$1�H�L$H�$H��H�D$P1�L�D$���ZY���s��H�<$H������H����H�-ǡ H�=� L�d$H�EH�,$腴��H��H���&��H�@(H��I�$H�EL�`H�hH�h H�@0�˷��H�<$H�/�M��H�{H��� L�d$H9��KI�D$(H��uj�@����I�D$(H�����foziH�H H�EH�H@H�(H�H�pH��H��H�pH�t$dH34%(H����H�� []A\�f�L�HM�QL;PL�HH�L�PK��I��L�P�M��1�I��I��	��M�H�lRL�����H��������H��H9���H�xH�� H�4�H9�t(���I��H����I�D$(L�HH�h�{����d���H�����H��H������I�D$(L�@H�pJ���V���I���H����)I��H�$H���4H�=B� H�l$踲��H��H���Y��H�@(H��H�EH�hH�-�� H�@0H�EH�hH�h ���I9�ujH�<$H�/��H�{L�ٯ L�d$L9�uvI�D$(H��������@�'���I�D$(H���/��fo
�gL�` H�EL�`H�(H�f���H�=�� I9|$uI�|$t�H�{(L��������l����x��H�5R� �=������v���L�[H�-r� H�5+[1�I�SH�}���H�+�Q������G������D���?�����USH��H�G �uH������H�H��[]�H��H��H��� H9E����H��H���G$H������H�C H�muH��H�D$����H�D$H��ff.���USH��H��H�0ulH�{@��H�CH�{(H�k H�C H�H�C(H��uqH�K8H�s@H�yH�V�H�S@L��L�CI�H�m���H�spH����H�H��[]ÐH�(H�s0H��u^H�{ H�
h� H�W������k���1���H�/����L�K8H�C@M�QH��H�C@M��L�[I�H�m����H�C �|���H�W H�
� �E���������H�{`H���5��x�H�C �V����U��ff.�f���USH��H��xdH�%(H�D$h1�H�GH����H�VH�������H�t$舮��H��H����H�|$������H��� H�{H�5�U���H��1�H�{H�-m� �T$�U8��藮��H��uw��twH�O� H�H�L$hdH3%(��H��x[]�H�l$1�H��虮��������H�T$ H���������H�t$H�{1���H��H�D$貱��H�D$�1��H�{�5�L�E� H�5^XH�D$I�8�1���H�D$�d����ү��f���H�G0H��u$H�G L�
�� L9���H�L��H�w0I��ATUH��SH�PH��H;Z� ���H;ݚ t;��Q���H���=��H�pH�K0H�H�EH�nH�C0H�!� H�[]A\�H��H���u�����y����H�����AUI��ATUH��S��H��dH�%(H�D$1�����H��upHc�H��SH��I��諰��H��H�$H��tOI�mH�T� H9Eu]H�}0H����L�
�� L9M ��H�H�]0I�H�+��I�)��H�D$dH3%(��H��[]A\A]�I�}HH����H���G�H�$I��H�+trM��t�I�,$u��V��H�WH;� ����H;q� tf����H��tGH�pH�M0H�H�H�^H�$H�E0L�
�� I�L�M��M�Z�L�M��u�H���`����M����H�$H�+�+�����H�������x�H�$�蒭�����ff.�f���ATH��I��H��USH��dH�%(H�T$1�H����H������H���R��H���I��H����H�-�� H�EH��������}��H�=� 詫��H��H���^��H�EH��H�h0�@8I�$L�`(�����貮��H�CH������fo�`CH�T$dH3%(H����H��[]A\�H�YH�WE1�L��� 1�H�|$WH��jj��H�� H������H��� ���H�(�����} �!��H�}�+����E ���Ã��� �������������@�C��L�U0A�:*A��E�����H�-ŗ ��������AWH�B�AVAUATI��UH��SH��H��H������L�6H������H�=S� L�n�
���H����H�}0I���H�}HH����H�=�� ����H��H���L�%0� H�@(H��I�I�$L�pL�`L�` H�@0�[���M9��H�}(L�uH����M9���H�}�~��H�}8H�H�]H�u@H;w����L���;������c��H�}I�EH�E@H�H�]H�/�|��H�} H�H�] H�/�\��H�uhH���nH��H��[]A\A]A^A_�ff.�H�}(H�u0H����H�} H�
� H�W�;���������1��H��L���4A���cH�}8H�u@H;w����L���r���������I�H�}H�E@H�H�]H�/����H�} H�H�] H�/�8������H�W H�
U� ������4���1��!���L�%�� M9����,���I��H���M���H�}H1�H��L��1��ͦ��I�mH��uL������H������H�}(L�uH��tH�E(H�/�^��M9������H�}����H�H�]���H�}`H����,���~������H�r� I9UuI�}t�H�{(L���i����y����1�L��L��1��!���H���^����T��@��SH�����H���H���VH���H���gH���H���xH�{xH����H�{pH����H�{hH���H�{`H����H�{8H����H�C8H�/���˨��H�{0H���tH�{ H����H�C H�/���H�{(H����H�C(H�/�/��H�{H����H�CH�/���H�{XH����H�CXH�/��H�{PH��tH�CPH�/����H�{HH����H�{H��tH�CH�/u���H�CH��[H��@��Hǃ�H�/����H���H��tHǃ�H�/���H���H��tHǃ�H�/����H�{xH��tH�CxH�/���H�{pH��tH�CpH�/����H�{hH����H�{`H��tH�C`H�/u�7���H�{8H��tH�C8H�/u����H�{0H����H�{ H��tH�C H�/�f��H�{(H��tH�C(H�/����H�{H��tH�CH�/�b��H�{XH��tH�CXH�/u衦��H�{PH���m���H�CPH�/�[������H�ChH�/��������H�CHH�/�:����O����0���H�C0H�/�*��������SH��賢��H�{H����H�G� H�C�PHH�{pH��tH�CpH�/u���H�{`H��tH�C`H�/u�̥��H�{XH��tH�CXH�/u谥��H�{PH��tH�CPH�/u蔥��H�{HH��tH�CHH�/u�x���H�{@H��tH�C@H�/u�\���H�{0H��uH�{8H����H�{hH����H�{H��tH�CH�/u����H�{ H��tH�C H�/u����H�{(H��tH�C(H�/u���H�SH��[H��@��H�C0H�/�o���轤���e���H�C8H�/�`���衤���V���H�ChH�/�Q���腤���G���H�{pH���x������ff.���AWAVAUATUSH��H��H��H��8dH�%(H�D$(1�H���H���S��H���A��H���8��H�/H����L�gH�=� �à��H��諡��H�UL���A�������D�E H�MA�� �GA��@���A��H�u0A��H����A���	��D�m0A��{��A��{�A��}��A��*��A��/��A��.A��-���H���lD�NA��{��A��}����tA��/toA��*tiA��.A��-��H���+�V��{����}��������*t.��/t)��.��-��I� I���f�H�xM��E1�H��H��H�5I� 1�����I��H�\$(dH3%(L����H��8[]A\A]A^A_�I� M��r�����I� M��r��4����H��t^I� A�F�A��{��A��}����t(A��/�M���A��*�C���A��.A��-w
M���/���I��I9�u�L�5� M9�����E1�H�{(�bH�K(L;y�KH�q�N�,�H��I�EI�}����������M�����L�%�� H�=z� �5���H������L�EM���A������D�M H�MA�� ��A��@�`���H�u0D�E A��A��H��~,A���z����>{t1D�.A��{��A��}�w������H������A��t��ӿ��D�^A��}����A��*u��~}�����I�m������utI������D�M1A��{�Q���1��|���1���H�uH�L�����[���1��T���I�����I�$�����c���1��\���1����1����E1����L�aI�PA�L��� 1�H�D$Pjj���H�� H��t�I��H�(�߾��L�`�o����;���ff.���AWI��AVAUI��ATUSH��H�$����H���"L��I���;���L��H��I���]���H��H����I�}(H���u���H��H���=�Ԝ��H���F���M����A�?}��I���hA�}�kI����A�}�VI���tA�}�AI����A�}�,I����A�}�I����A�}�I����A�}��I����A�}��I��	��A�	}��I��
��A�
}���
�A�<}��H��I9�u�ff.�H�EH�} H�^BL���h���H�mH���^H������I�}(H��H���ҟ��H�}���R���H��H�}��L�$I�9��L�� M�uL�ȗ I�L��M9^��H�=Г 苚��H���s���I�~0H�$�/I�~HH����H�= � 蛛��I��H�������L�=�� H�@(H��H�I�H�XL�xL�x H�@0�ܞ��L9���I�~(M�NH����I9���I�~�����I�~8I�EM�nI�v@H9w�����H��L�$距���������I�~H�EI�F@I�EM�nH�/�����I�~ I�EM�n H�/�����I�vhH����H�+H�,$�m���I�/M���iI�,$�?���H��[]A\A]A^A_�I�~(I�v0H����I�~ H�
i� H�W����������H�+��H�m�
M��u��H�H�m�%���H�������������H��H���]���M�u(H�$H�0H����H�x��L�����L�$H��H��?I��1�M�CL���L��H��H�q��ܜ��H��M���Ҽ��H���ɼ��H��L��H��H�D$�D���H�T$H�*�}���I�/��������#���H�$�^���M�uL�>� M9F�}���M�e@L��M�����L�e� L9�u;�H���������M�e@M������I�*�b������H��H���O���I�}@1�H��H��1�莗��I������I9��x���I�^1�H��芚��H��������@ {L��H�x!L��H�D$����H�t$H�~ H�t$H��>H��講��L�D$H��I�(�@���L���b����3���L��L��L�$�0L�$����I�~8I�v@H;w�ٺ��L��L�$����������L�$I�I�~I�F@I�EM�nH�/�ٺ��I�~ I�EM�n H�/�ߺ��I�vhH����M�����I���Z���H�EH��1��!���H�W H�
�� ����P������������H�
U� H9M�H�}�
I�~(M�NH��tI�F(H�/�����M9����I�~�����I�EM�n�����T�����J�����@�����6�����,���I�~`L���!���z���M������	�����
���L�=�� L9�uJ謚��H���۸��I�~HH��1�H�D$H��1��K���H�T$I��H�*uH��腘��M������黸��1�H��H��1�����I����I�}(H���7���������T����ָ������H�=i� H�b� H9�tH�� H��t	�����H�=9� H�52� H)�H��H��H��?H�H�tH�Ղ H��t��fD�����=�� u+UH�=‚ H��tH�=�{ 艕���d����͔ ]������w����H�GH������U����O L�G�� ����@����H��0����I����������?{t_�1�I� L9�}F�����D�7A��{tLA��}t!��t"A��/tA��*tA��.A��-wM��søH���1���W��}t/��*�t1��1��ܸ1��H�H�V����}�A���ø���AUI��ATI��UH��SAPH�_H��t&H��H��H��HUH�:H��t�L��A�ԅ�t��[���H�}(H���V���H�}0H���?���YL��[L��]A\A]����ATI��UH��SH��H���H���&���H���H���	H���H����H�{xH����H�{pH��t
L��Յ���H�{hH����H�{`H��t
L��Յ���H�{H��t
L��Յ���H�{H��t	L��Յ�urH�{ H��t	L��Յ�u`H�{(H��t	L��Յ�uNH�{0H��uJH�{8H��t	L��Յ�u3H�{XH��t	L��Յ�u!H�{PH��t	L��Յ�uH�{HH���:���1�[]A\��:����G����f����O����n������ATI��UH��SH��H�pH��t
H��Յ���H�{`H��t
L��Յ���H�{XH��t
L��Յ���H�{PH��t
L��Յ���H�{HH��t
L��Յ���H�{@H��t	L��Յ�uvH�{0H��uhH�{8H��uZH�{hH��uLH�{H��t	L��Յ�u5H�{ H��t	L��Յ�uH�{(H�������[L��H��]A\��铘��鎘��鉘��鉘��铘��靘���u����p����k����f����a�����H�GH�������H��f.���ATH��H��UH��SH�� dH�%(H�T$1�H����H�������H�������H��H�������H��L� tOH�XH�=O� �
���H����E1�I��L��H�xH��H�5� 1�蔓��H�T$dH3%(uJH�� []A\�H�,~ �H�YH�RA�L��� H��H�T$R1�jj蹒��H�� H���i��������D�����1�H�=�5鯏��ff.�@��SH��H�(H��t
H�C(�R���H�{H��} H��H�H�CH�/tH�{ H�H�C H��H�/tH�[��$���H�U} ������H�G} ��ff.�f���S趏��H�8H��H��tH�H�/�e���H�{H��tH�CH�/t2H�{H��tH�CH�/u觑��H�{H��u'H�{ H��u1�[�茑����H�C H�/u����H�CH�/u����@���W������ATUSH��L�G(M��tzH��xuI�HH9�~lH��I�xL�$�H��H��tBH�zH�5�� H9�u`I�pH�J�&H�1�L�J�L�M��tH����[]A\�H���Ր����H��I�HH9�~��_���L�%�{ H�58��I�<$�W����H�T$����H�T$���#���L�RL�K{ 1���H�5�7I�RI�;軍���f�PH��{ H�58H�8�����Z�@��H��tQH�WH�H�wH�*�Е��1�Z��f.���H��tH�G H�H�w H��H�(t1���RH�����1�Y�ff.�@��USH��H��H�G(H����H�x���H��H���e���H�S(E1�L;E||H��tH�H;�z ���j���H���.���H�SQH�5�2H�=�5H�K L�
�2I��H��QH�
�2VH�[H�5�2H��SWH�=x2P1���H��0H��[]�L�JL�]O��I�O��I���a���H��1��<���ff.�U1�H��H�=64SH��詏��H�������H��H��H�����H�+�����H��[]Ð��AWH�B�AVAUATUH��SH��H��H�|$H�������H��H�}�6L�eH�T$H�ZH���,H�
:� H9K�6H�5�1�t���H�������H�{`H�C`H���(���H�{hH�������H�{pH�������H�{xH�������H���H�������H���H���M���H���H���J���L;%�x �ؕ��H�5 1L���nj��I��H�������E1�M;g��I�w�����K�l�L�EI���������H���ʎ��I��H���IL�uH�5�0L��M�NL�M������ H�5�0L���̌����uEH�{pH�kpH���F���I���f���I�/��H�%x H���H��H��[]A\A]A^A_�H�5u0L���t�����t~H�5k0L���a�������H�5[0L���J�������H�5L0L���3������L�uM���N���I�/�Q���L�
w L��1�1�H�50I�:藉���]���H�{xH�kxH�������H�|$H�]� H�.&H�57'H��Pp����H�{hH�khH����魒��H���H���H�������H�L$H�-
� H�5�+H�y�UX���I�J�,��:���H���H���H���Œ��H�t$L�Lj H��%H�~H�5�&A�Pp�m���L���l����s���H���H���H���f���L�\$H�|� H�5�"I�{�Rx�*���L�%bv ����L�=�u H�5�2I�?迋���%����ْ���Z���ATI��H�=,.USH���I���H�������H��L��H���҇��H��uL�8���H���}���誌��H�+H��uH��詊��H���r���L��H���Շ�����X���H��H��[]A\�H�P��� t/H�����H��H������H��L�������������H�+t��H�+H�D$uH���2���H�D$H�PH�
�t H�R1�1�H�5S2H�9�[����y���fD��UH��H��H��SH��(dH�%(H�T$1�H����H�������H�������H��H�������H��H�0uKH��t H�E(H��tH�8H;=�t t
苆��H��t+H��H���H�T$dH3%(H��uWH��([]�H�X��Ɔ��H��t��D���H�YH�RA�L�'} H��H�T$R1�jj����H�� H���a����	����l���ff.����SH�GH�O(H�X H��tH��@H�Q H9QuH����ё��H��[�i���H�qH����ff.�@��H��t3UH��SH��QH�(�����H�E(H�H�8H�H�/u�z���1�Z[]�����駑��f.���USH��H��H�(tIH�C(H�-ys H�H9�tH�������H�H��[]�����H���r���H�m�P���H�S(H���1�H�(�س����y��J���ff.�@��UH��H�=!� SQ�څ��H��H��tJH��r �C8H��H�H�C0H�EH�k(�+��������H�CH�����fo;CH��Z[]Ð��USH��H��H����H�{H�+�̈́��H��H��tH��H���j���H�+��H��[]��ߐ��@��H�5r SH���H�5e/H�8轅�����Ґ��H�S(H��t;H�z�#���H�������H�s(E1�L;F}H�NH�xN��I�N��I����[�1�[���f���AVH��H��AUI��ATUSH��0dH�%(H�T$(1�H���>H���Q���H���?���H��H���3���H��L� upH�=O| �
���H����L��H��������L�Pq H�}E1�L��L��H�5{ 1��}���I��H�T$(dH3%(L���H��0[]A\A]A^�L�@H�=�{ L�D$葂��H���y���L��H���.�L�D$L;�p u���u�1��Ն��I��H�������I�}(t�1�I�E(H;h�x���H�H�L��H��H�H�{�����txZH��L�������xKH�+�*���H���H�YH�RA�L��y H��H�T$R1�jj���H�� H����������H�+tI�.���L��E1��ڄ�������0����Ԏ��ff.���ATUSH��H��H��0H�VdH�%(H�D$(1�H�B`H��tTH��tJH��o H�2�X���H��H�����H����H��読��H�L$(dH3%(��H��0[]A\�H;�o �����H�{(�����L�d$H�l$H�L$ L��H�������������H�s(H�L$ L��H�~H���;���I��H��~rH������H���m���H�{(L�L$E1�L�PL�GK��H�LL$ K��I��M9�u��E���H�D$����H�t$H���)���H�C(H������Hp����1�誄�����������AUATI��UH��SH��H�~H�5�~ H9���I�D$(1�H��H�������L�FH��L9�}pH�VL�,�H�<�H9�u5L�II��K�<)L�AI9�`H�/�����H�n H�H��[]A\A]úH���R���������������H��I�t$(�H�Rm H�5�&H�;�C���1��M�T�M��H�������������6���ff.���AVI��AUI��ATI��UH��SH��dH�%(H�D$1����H����I�](L��H�����I��H��tH����H��H���˴��H��H�������M��t{L��H��说��I��H�������I�}hH��uyH��H�5Pu L���������I�,$�U���I�.�����H�m�����H�D$dH3%(��H��[]A\A]A^�L�5�l I��H�-�l H�E�b���E1�H��L��L��1���}��H�$H��t�H�(�{����"���H��k �H�5*H�8����H�<$H�/�M�������C����N���ff.���AWH��H��AVAUI��ATUSH��8dH�%(H�T$(1�H����H�������H�������H��H���w���L�0H���	H�-�k H�=�v �=}��H���%~��L��H���������E1�I�}(�=I�E(L;x�9H�H�L��N�$�I�$I�|$觀����I�,$�������GI���I�|$���H;!k H����H��tH�I�,$���H�L$(dH3%(H���H��8[]A\A]A^A_�L�=�j H�{PI��L��jL��M��H�5�r 1����ZYH���H�hH���y���H�����L�%�j H�=bu L�x�|��H���}��L��H����M9�u��������I�,$uL�����1�1����H���;���H�E�1�����H�E�#���H�YH�WA�L�
r H��H�T$R1�jj�~��H�� H���,���1�����
~��ff.�f���H�G(H�������H�8H;=�i ������J|��f.���AUATUSH��H��H�������H�=^t L�+H�k�{��H���{��L��H�����L�%`i ��u	M9���H���s��L9�t��twH�S H�s�H��ID�H��ID�1��|��M9������H�{I�EL�kH��t
H�/�d���H�{ L9��(���H�EH�k H��t
H�/�����H��[]A\A]�H�UH�=Ph H�5	'1�H�RH�?��z��1���I�EH�
,h H�5�&H�PH�91��z��1��ff.���H�� ���USH��Q�&y����u%H�sH�=[!H���/z��H��H���~��H��Z[]��ߋ��H�CH�
h H�5�&1�H�PH�91��%z����SH���H�� dH�%(H�D$1���z��H�D$H�������H�;H�t$����H�|$H�/�����H�������H�(�l���1�H�\$dH3%(uH�� [��{��ff.�@AVI��AUI��ATU��H�=:r SH��H��dH�%(H�D$1���x��H����y��I��H��uH�.y ��PH��L��L��H��1�H�=3 �x��H�$H����I�<$H������H�<$H��H�/�r���H�������x{��H��H���?���H��H�5�H���z���������H�m���L��L��H�=�1��"}��I��H�������H��H�5�H���z�����n���I�m�V���I�<$H���y��H�+�3���H�D$dH3%(u
H��[]A\A]A^��Hz���H�x ATUSH��H�?�P(H�-�w H�;I��U0H�;H��w H��S L��H��1ɉ��]���[1�]A\�fD��AVAUI��ATUSH�_H���oH��H�5�M�u�y��H��H��������H�5H��1���v��H��H���FH�@H;@e ��H;Ke uUH�{tNI��I�T$H����������1�I�t$ L��讳��I�,$H��uL����y��H�������H�+�t���陊��H�+��H�muH���y��I�}�1�H�5��T���H��H����I�uH�
ms H9NuH�(�݉��H�^H�����H�H��[]A\A]A^�H�{t5H��H�5�H���#u��H�+I��uH���"y��M���
����r���H�+�P����͉��H�=�c H�5� H�?�y���H�m�K���H����x���y����Ɖ����AWAVAUI��ATI��USH��H��8dH�%(H�D$(1�H�FH�P`H���SH;�c ����I�|$(�M���L�t$H�l$ H��H�L$L��H���^v������I�t$(H�L$L��H�~H���w��H��M��tsH�5�L���Fw��H��H��� ���H�|$L�h�<L9��cE1�H��s M9���H�E�����H�uN�<�I�H9���I����H����L�\$M���+H����x��I��H���H�l$ H�L$E1�M�|$(I�WH9l$�xH�t
H9���H�Q�I�GM�EI��H��M)�H�<�H�t�K�<�J�<�I���(v��H�L$H��H���H���]x��H�������I�|$(H�t$ E1�L�PL�L$L�_I��O��M�O��I��L9�u�L9����gE1�M9�}2L�eA��$��{L�EK��L�wH�I��I��Ht$��H�wH)�L�H�wH�m���H����H�(�xH���fv��1�H�\$(dH3%(�&H��8[]A\A]A^A_�H�������H�<a H��H�2�u��H��H����B���H����L��L�����H��HL$ H9���I)_I�m��L����u��1��j���L9�����L��L��H)�������������a���H��H)��:���H�(����H�-=` H��L��1�H�5vH�}��r�����	���H�WL��L�|$H)�L�r�H��M9��y���L�_O��I�O��I����L��L�|$L�_H)�H��M9��H���L�OO��I�O��I����1�I�|$(H�t$ ����1����M�wH)�H��I�4�H)�I�<���s��M�|$(����H���Bs��H�Kp �����I�_H�=p_ 1�H�5'H�SH�?��q��H�m�/���������L�P�H�L$ M��I��L�IL�\$L�L$I�L�T$ ���I�\$(H���<���Hs�3���J�T����N�|��U����s��D��AUI��ATI��USQH���x���I�EH�5�^ H�xH9��J�hr�����6���I�}�wu��H��H����H���#r��H�mH���P���H�����I�mH�50o H�}H9���I�|$(��I�T$(H�JH����H9˾L��HO�豮�������M�L$(M�AI�yI9�~N�T�N��I����H�i^ H�EH�,�I�AH���Z[]A\A]��~p��H�������H���Q����wq�����<���I�MH��n H�5�H�=���t��1��1�I�|$(衞�����2����H���H˾HH��.�����ff.���AWAVAUATUH��SH��XdH�%(H�D$H1�H�4] H9F����H�D$@H��1�H�D$8H�D$0H�D$(H�D$ �r��I��H���B���PL��1�H�T$HRH��H�L$HQH�
�e H�t$HVH��L�L$HL�D$@��r��H�� ���ք��L�D$ H�l$@L�l$8L�|$0L�t$(M���|���H�{I�L�CH��t
H�/�����M����H�=F\ I9A��I��E��M	�H�{M��I��H��I�L�{H�/��M���bH�\ I9E��I����I	�H�{ L��H��H��H�L�k H�/�OI��M	��)H�����L�}A����F���H�{(L�}H�C(H�|$L��H������H�L$�����H��tL�	L�S(L��[ M�
L�E1�H�5)l M9�oH�k(L�}H��M��tH�[(I�H�;L�3H��tH�/u�fp��H���N���H��[ H�I�,$�R���H�t$HdH34%(��H��X[]A\A]A^A_�H�EN��J��H�zH9�uUH�{(H�I��L�OK��Z���L�=$[ �t���L�-[ ���H�[ H��x�����o���o����o�����L�D$H�T$H�L$�#n��H�L$H�T$H�5"k ��L�D$�y���L�RL�BZ H�5�1�I�;I�R�l��H�[(H�|$L�k�C���1�����n�����UH��SQH�G(H�������H�0H�}�M���H��H�������H�MH�xH��H��H��H�H�HH�/�����H�u H��H��H�H�{ H�s H��H�/�[���L�E(M��tFI�pH���������1���L�](H�k(E1�M�KM9�}I�CH�UJ��H�J��I����L�MH��Z[]ÐAWAVAUATI��UH��SH��H��#H������I��H�E(H����H�8L���I��H���ځ��L��L���H���I�.H���܁��I�m����H�������H�}L��H���H���pH�UH�{H���H��H	�H�SH�/�����H�} L��H���zH���3H�M H�{ H���H��H	�H�K H�/�p���H�u(H��t3H�vH��踨������E1�L�5�h H�}(L�GM9�OL�K(M�AH����m��H��H����H��H��L����n��H�m������H��H��[]A\A]A^A_�L�WL��N�<�K�<��I��H��tdH�xL9�uH�C(I��H�PN�:�f���L��H�D$�/k��L�\$��u�I�KH�=cW 1�L�\$H�5H�QH�?��i��H�t$H�.t2L�C(M�hH�+�!���H��1��Zl���I���L�-�W I�E�!�������ff.�@AWAVAUATUSH��H��XdH�%(H�D$H1�H;=@W H�tH�WH�-W H9�u-H��H�H��H�L$HdH3%(��H��X[]A\A]A^A_�H��I��uPH;�V ��H�D$L�|$ L�t$(L�l$L��L��L��H���h����t~H�t$(H9nuH�|$ H9ot�H�=va �1h��H���i��L�@M���o��H�\$H�t$0�L���~D$L�d$D$)D$0耢���2���H�
�f H9�u��������H���}h�������Sj����APH�F��� �!��Y�c�����AUI��ATUH��H�5SH��Q��i��H��H���r��E1�L9c~>H�C����N��H�SJ�,�H�EH��L���Ҧ����x-H�m���I���H�+t1H��U H�ZH��[]A\A]�H�+�*��H�m�u���~��H���j����ff.����UH��SH��QH�~H�5�e H9�u"H��H���H�������~��H�U H�Z[]��Lh����u�H�ie H��H�5�
H�=
�k��1����H�)e H9Gu���H��H��1�1�H�5\ �i��H��H���v~��H�H�J�H�1�H���i~��H��ÐUSH��H��HH�T$dH�%(H�D$81�H�t$�~D$H�t$D$)D$ 賔�����K~��H�{XH�t$H���O~��H�t$ ��J���H��H���~�����H�{t	H;=T u!H�{`uAH�L$8dH3%(H��uOH��H[]�H���������}��H�{(H�EH�k(H��t��}��H���H��t�H�{`H������y��}���g��f.���AVAUI��ATI��UH��SH��0dH�%(H�D$(1��e��H����I�\$H��a H9C��I�|$`��I��1�H�H���L���H��H��J�41�i��H��H��tzL���H��L���L��H��J�41��h��I��H���}��H�l$I�|$`H�t$��~D$H�D$D$)D$�Ϟ��H��tL0tAI�mt0H�muH���Og��H�D$(dH3%(��H��0[]A\A]A^�L���&g����H���g���H�{`�����t�I��E1�H��D��L��H�
�H��H��J�41�h��H��H��t�L��D��H��
L���L��H��J�41��g��I��H���+|��H��H��H���K���H��t	L0�|��I�muL���~f��H�m�$���H���kf������H����R����D����e��ff.���H�B�ATI��UH��SH��H����{��H��H�u~H�U[L��]A\���H�8Q ��ff.���UH��SH��H��(dH�%(H�D$1��;c��H��uH��t3H�{H��_ H9Gt+H�{8u`H�D$dH3%(��H��([]�H�-�
��H�`t�H���H��t�H��P H��`H������x�H�H��H�(u��s|��1�H��H���H��H��H��H�r�H�H	�Uf��H�D$H���n���H�{8H�t$��d���H�|$H�/�,|��H��u��B����Fd��fD��AWAVAUI��ATI��UH��SH��8dH�%(H�D$(1�� b��H����H��M���H����M�uH�w^ I9F��I�}0��I��1�H��H���L���H��H��J�49�|e��H��H����L���H�RL���L��H��J�49�Pe��I��H����{��H�l$I�}0H�t$��~D$H�D$D$)D$�G���I�,$H����{��H�m��{��H��t
H�+��{��H�D$(dH3%(��H��8[]A\A]A^A_�H�-����L�%����I�~`t�I�~xt�I��E1�H��D��L��H�}�H��H��J�49�~d��H��H��t�L��D��H�WL���L��H��J�49�Ud��I��H����z��I�~`t>I�~xt7H��H��1��a��I��H��t(I�vxH���^z��L�I��M��Az��H�N H�I�,$�z��H�m����z���	b��f���ATH��I��H��USH��dH�%(H�T$1�H����H����{��H���m{��H��H���a{��H���cH�(H�`M �H�5�H�8��`�����*{��H�MH���������z��H�=LZ �`��H��H����z��H�EH��H�h0�@8I�$L�`(�Zc�����c��I��H�CH����z��foHI��C��H�L$dH3%(L����H��[]A\�H�YH�APE1�L��V 1�H�|$WH��jj�Fa��H�� H��������Jz���} �0z��H�}�,����E �Ƀ��� ����y�����tz���@�cz��L�U0A�:*A��E����H�-$L ���H�-L ����6`��fDUSH��H��H�t$�]������=���H�{PH����H�t$����H��H���������H�{t	H;=�K u2H�{`u
H��H��[]�H���H��t�H�{`H���~���y��Ɓ��H������������H�{(H�EH�k(H��t�魁��H�l$H�E�f���ATI��USH��H��dH�%(H�D$1��Y]��H��uiI�l$H��Y H9Eup1�H��H��H���H��H��H�q���`��H�$H��t-H��H������H��tH�(uH���_��H�<$H�/u�{_��H�D$dH3%(u]H��[]A\�I�|$Xt�1�H��H�lH���H��H��H�q��i`��H�$H��t�I�|$XH���~���H��t�H�(u��|����i^��f����'������AUH�=�T ATUSQ�[��H��H��tH�ZH��[]A\A]�H�=W ��Z����x�H�=�X �Z����x�H�=+Z �Z����x�H�=U �Z����x���H�=�T �^��H��H��t�H���!\��H�=I���r^��I��H���y���H�5�H���w]��I�EI�,$����I�}�P���H�=��1^��I�EH���7���1�H�=���_��I��H�$[ H������H�8H�5��]��������A�|$��|��A�|$�p��H�I9D$�[��H�
�H 1�H�=�H��H�1�]��H�5H��I�EH��H��GY��H��X H��H�5�H��X �)Y��H�2W H��H�5HH� W �Y��H��S H��H�5~H��S ��X���;�����H��H���Expat %d.%d.%dchild index out of rangeattrib_childrentag{sOsNsNsOsO}tail_seteventsappendevents must be a sequenceinvalid events sequencestartstart-nsend-nscommentpiunknown event '%s'makeelementargumentremovelist.remove(x): x not in listO|O!:Elementstrict_set_factories<Element at %p><Element %R at %p>%s: line %zd, column %zdcode(nn)positionreadsurrogatepassutf-8size does not fit in an intinsertargument 2|$OOOOOtag may not be NULL'_children' is not a listdeepcopy helper not founddict__deepcopy__embedded null characterstr or Noneargument 'encoding'XMLParserstart_nsend_nsdataclosedoctypesetpop from empty stackO!O|O!:SubElementdeepcopyxml.etree.ElementPathpyexpat.expat_CAPIpyexpat.expat_CAPI 1.1ParseErrorTreeBuilderentitytargetversionclearfindtextfindallextenditeritertextiterfindgetiteratorgetchildrenitemskeys__copy____sizeof____getstate____setstate__feed_parse_wholeencodingpathnamespacesdefaultkeyelement_factorycomment_factorypi_factoryinsert_commentsinsert_pisxml.etree.ElementTree.Element_elementtreechild assignment index out of rangeexpected an Element, not "%.200s"can't delete element attributeXMLParser.__init__() wasn't calledevent handling only supported for ElementTree.TreeBuilder targetsattrib must be dict, not %.100sThis method will be removed in future versions.  Use 'list(elem)' or iteration over elem instead.element indices must be integersThe doctype() method of XMLParser is ignored.  Define doctype() method on the TreeBuilder target.Comment factory must be callable, not %.100sPI factory must be callable, not %.100sreentrant call inside %s.__repr__expected sequence, not "%.200s"attempt to assign sequence of size %zd to extended slice of size %zdinteger argument expected, got floatDon't know how to unpickle "%.200R" as an ElementThis method will be removed in future versions.  Use 'tree.iter()' or 'list(tree.iter())' instead.multiple elements on top levelpyexpat version is incompatiblexml.etree.ElementTree.ParseErrorA string identifying what kind of data this element representsA string of text directly after the start tag, or NoneA string of text directly after the end tag, or NoneA dictionary containing the element's attributesxml.etree.ElementTree.XMLParser_elementtree._element_iteratorxml.etree.ElementTree.TreeBuilder__setstate__($self, state, /)
--

__getstate__($self, /)
--

__sizeof__($self, /)
--

__deepcopy__($self, memo, /)
--

__copy__($self, /)
--

makeelement($self, tag, attrib, /)
--

keys($self, /)
--

items($self, /)
--

getchildren($self, /)
--

getiterator($self, /, tag=None)
--

iterfind($self, /, path, namespaces=None)
--

itertext($self, /)
--

iter($self, /, tag=None)
--

remove($self, subelement, /)
--

insert($self, index, subelement, /)
--

extend($self, elements, /)
--

append($self, subelement, /)
--

findall($self, /, path, namespaces=None)
--

findtext($self, /, path, default=None, namespaces=None)
--

find($self, /, path, namespaces=None)
--

set($self, key, value, /)
--

get($self, /, key, default=None)
--

clear($self, /)
--

close($self, /)
--

pi($self, target, text=None, /)
--

comment($self, text, /)
--

end($self, tag, /)
--

start($self, tag, attrs=None, /)
--

data($self, data, /)
--

_setevents($self, events_queue, events_to_report=None, /)
--

_parse_whole($self, file, /)
--

close($self, /)
--

feed($self, data, /)
--

_set_factories($module, comment_factory, pi_factory, /)
--

Change the factories used to create comments and processing instructions.

For internal use only.undefined entity;���A�� H��(PN����N���MP��PgP����P��,Q��`Q���tQ��(	�Q���	�Q��T
�Q���
�Q��\�Q���"R�� @R��\HR����R��p
�T���
(U��$?U��TUU���bU����U��4�U��p�U����U���V��($V���VV��P�W����W����W��l^X����X��0�X���cY���*Z���kZ���rZ��([��\@[���i[��(\����\��|R]���|]��8�]����^����^����_����_��$c`����`����`����`��<@a��|Ka���ea���a��t�a���b��$jc��t�c����c��LEd����d���d��\�e����e�� �f��@ �f��� �f��� .g��(!|g��x!�g���!�h��<"�i��p"j��#Bl��d#�m���#�m��T$ n��@pn��X�o����o���o���p��t�p��P	@r��p	�t���	0u���	�u���
�u��0v��4�v��p�w��� x��hpx���y���|��d}������`����p��������t��<����P���������������������P����P���`����������0������ P���T ����� ��� ����<! ����!�����!��P"����"���"p���#��������� ���t`��������L���������<	����
@���4
��h
�|
���
���,0���pp����`��������
@����
@���
@��8�������`��H���� �����<����������D`������������0p������`������p��L ���������������8P��p�0�P��������0��P�H`���p��#0��#@�$P�$zRx�$�;��@FJw�?:*3$"D�A��0\�g��LH C8th��!F�B�D �D(�G0s
(A ABBPzRx�0����$�G�������H��c�h�� �h��
44����mF�E�D �D(�B0J(D DBB ��H��C
(A ABBA,�����?F�D�D �
ABAzRx� ���$�H��xS
GBB�g��>Hu,\��� F�D�D ��
GBB��H��4C
ABAh,���|�H��8��g���F�D�D �e
GBBA
ABAgH��U@�ԯ���F�G�D �D@�
 AABAQHVPDXB`I@zRx�@���$DH��XL���!lXg���E�<
A��h��JE�?
A��j���E��zRx�� �G��34�Lk��_F�A�D _
D�A�E`��A ��0����sE�Q
AP����E�i
A�[G���p���	0�l����F�A�A �D0`
 CABAzRx�0���$�F���j��Qt\ܰ��AZ0�j��4cKH̰��&JYzRx��F��
�����1eK<����E�A�G0W8a@HHPPAXH`K0D
AAAzRx�0�� F��%$`���?A�M�D0jAA\�E��$P�i��YI�E�G0AAA��E��@�j��JB�I�B �A(�D0�G@O
0A(A BBBA zRx�@�����(hE����j��>H�����F�F�B �B(�A0�D8�GP�
8D0A(B BBBA zRx�P������(�E���0������B�K�A �D0e
 DABA/G��98�l����E�J�D@�
AAA]HVPDXB`I@zRx�@�� �F��T���AE�m
E��F��U$��i��MA�I�D |AAzRx� �� �F��
0�ȴ��FJ�D�D gAAA��E ��hfF��"($	д��qE�A�G0k
AAApHF��$d	���oE�K�A [AA�*F��,�	�h���B�D�K �O
ABAF��(�	���LE�A�G0w
AAA0�E��C$
���wL�b
AC��E��PX
\����F�H�E �A(�A0�D`�
0A(A BBBA�hVpDxB�I` zRx�`�����(hE��2\�
0h��
F�B�B �B(�A0�E8�G��
8A0A(B BBBAH�U�E�B�I�$zRx��������,�D��J,��j���F�A�A �B
ABE�	F��0��`F�A�A �JPl
 AABAzRx�P���$�E��78,ȶ���F�B�D �D(�D@v
(A ABBAzRx�@����$uE��u(�xj��E�D�Q@�
AAA��E��<H�Hl��HB�B�H �B(�A0�D8�D@�
8D0A(B BBBA zRx�@������(bE��V@`
����rF�E�E �D(�D0�D@�
0A(A BBBA�`E��sL�
�m��F�L�A �A(�G@�
(D ABBC�
(D ABBA�oE���hX���3F�H�B �E(�A0�A8�Dp
8A0A(B BBBALxH�UxAp�xV�D�B�Ip zRx�p������(�E��A��&��E����n��%8���%F�B�A �A(�G@�
(A ABBA�NE���(Lȹ��mP�A�D k
AAA��E��G���$n��7[�M� �ع���A�L0m
AAzRx�0� hE��)@���XB�E�E �A(�J0�G@,
0A(A BBBAx	9E���@X�m��F�B�B �A(�A0�J�~
0A(A BBBA zRx�������(hE���(�����JI�A�A �yCB0o��GA�A�G l
AAAEDA<4�����F�B�E �A(�A0�)
(A BBBA zRx�0�����(E���(��n���E�D X
AAY
EEzRx� � rE��*o���E�i
A((|o��A�D�G N
AAA�	<E��)Hh����F�B�B �E(�D0�A8�Gpi
8A0A(B BBBA0E���8�l����F�E�D �A(�A0�
(A ABBAX�E��[`����IF�B�B �B(�A0�D8�D�e�K�M�M�V��
8A0A(B BBBA$zRx��������,XE���$�\���E�D�A �AA8�E��<H����1B�B�B �B(�D0�D8�DPT
8D0A(B BBBA��E��lHT���=B�B�B �B(�A0�A8�G�N
8A0A(B BBBA(�E��%����FRp�E��%d$��m��TA�D�D HAA`�E��=8h���F�E�A �K(�D0j
(D ABBA��E��V(l���iE�D�D o
AAA��E�����OY uzRx� �E��(����A�A�G`�
AAAzRx�`�� AE��P@L���F�B�E �D(�D0�D`
0A(A BBBA�9E��%(�p��BJ�D�D �\
DBEE��,fCBP�(l��GF�B�B �D(�A0�G`ah]pHxB�I`�
0A(A BBBA ��D��dah[pBxB�I`(d��
E�D�G@O
AAAp�E��!`��p���F�B�A �A(�G0�
(A ABBA�
(D ABBE[
(A ABBE\�E��HX��7F�B�B �E(�D0�D8�Dp
8A0A(B BBBA�	?E���X|�r��QF�B�B �D(�A0�G@T
0D(A BBBK~
0A(D BBBA�E��_0��s���F�D�D �D@�
 AABA�E��S@4����F�J�A �D0	
 AABAI8R@EHBPI0 ��E����8U@DHBPI0(�(u��uE�A�D0Y
AAA�,F��<�hu���F�K�A �N@hHFPMHA@

 AABC��E���(0�x��uE�A�D0Y
AAA|ZF��(p�x��#E�A�G o
AAB�)F��4(��y��NE�A�G��
AAAzRx����$�E��I0�z���s�A�D �T
ABAT�����E��N8X<{���F�E�A �D(�F@�
(A ABBA0�E��^@��|���F�J�A �D0�
 AABAH8R@EHBPI0$F���J8U@DHBPI0H�}��F�F�B �B(�D0�D8�G@5
8D0A(B BBBO4wF���l����-E�e
I�G��n������E�N
I\�4����F�B�B �B(�A0�A8�Mp�
8A0A(B BBBALxU�B�B�Ip��F��?H4P����F�E�B �E(�A0�A8�DP8
8A0A(B BBBA(�H��m
8A0A(B BBBE(�����A�A�G0[
DAA��I��10�X��F�D�A �G0�
 AABA 4��	840���F�I�A �A(�A0R
(D ABBA��I��(GNU�����(!��Z���c�h���c�h�c�s�h�c�h�{�s����������Uft�:
���(!�(!���o`��
2	,!H	�08�	���o���o����o�o����o��)!@:P:`:p:�:�:�:�:�:�:�:�:;; ;0;@;P;`;p;�;�;�;�;�;�;�;�;<< <0<@<P<`<p<�<�<�<�<�<�<�<�<== =0=@=P=`=p=�=�=�=�=�=�=�=�=>> >0>@>P>`>p>�>�>�>�>�>�>�>�>?? ?0?@?P?`?p?�?�?�?�?�?�?�?�?@@ @0@@@P@`@�g�m@��� ���������������`�!����0���0��������������������@����� �H�p����|�0�����p��p�����P����� ���������p�����{�����p�g� ��@��P��������#�����.�����;��`��gп����hP�����@n@��� ���x���0����� ���3���`�����0�I����Q�P����а��H�ВP���~0�M���������A����� �������(!������`)!����������������)!���)!���)!����@)!����)!��0)!��)!������(�6!`h��0���x`�D��i 6!`0!�0!P� h�@`t@��y(��0�Dp��j@5!Pq�l��8��P�0!@4!D�fP0@1!`4!PupfGA$3a1:��_elementtree.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug�z��7zXZ�ִF!t/��3�
�]?�E�h=��ڊ�2N�H�n ����4�'�'�	��A�A"�&�C4ӵ�	܆� 
_b �;���tX?�����g7����8`]pypԠ7�TI*�Q�,	?4Ԕ��h������Ԍʿmd3f���X}E���Ho0�a��ޖ�e�}x�hV������Nt�}X-��Vb8��h��Տ�?w�`5<�]���h)F.��5d�JG���,~d]�ߘ�����K!���F��֞7i��uA��z�XCbZN���
�-U�8�g��M�55g�K��W $4�#?��qvQ4?��5v"�~���QT��8}C�s�Ҍ��H�~?�9���6Ŷ�;�v���L8����b�:�Ł݄.�V\�-vP����^ue�v�!�p����d�G��R����Q1��R��3v�$uh��Cs��R\����Vi)�L�5%MQ1b���p�j�F�^�r�=���g���99�z�~NԶ�q�� ©w�&����}��ݻ_�経�?a���]� �ض*�h_���Gn���6uU8RY
O����A�دua"-��s,I.���B�
k�}�AgH�я�Lܣ��?nQ]I!�*֚Qz�L����q̅�E$�B�f�u�5+�/�s�B�e��זl� ���-0`߮!f���&_0V�ᒪ�"=L�@�g^f�.rط]H<�rI1;�~5O��g/y�ýG>�j��Y��/br�D���`B�|+��)б�����M�sr�dz!�1�z�����$�5�7fq
�^/�=��\�1���q��R:��Yj �x�U^����nϕ�c��c��3G:�@$��"�=�#$p�n�(��>�l�A%�P�*s�LY�/LHk�@�Z'�_vxHaG)��0_����k����y�J&ߡAL��8�VG	S"�+���։p�:�}��)���+�i�n��B��U��K����U���g�#3��D�rL4y�d�?p.?�#zN���Wi��|y���7� a��V���)��/6f�~V�~x��9���힛ͺw�h:�B-f��V����$�g.���l�i/�WT���<"�����V�gv����ǖ�>O���t�aO�����7"�Me��57Y�����W���y��ߑ��m���{������+�0�TR��ޱI8�!f{I��p1q/��ה��[M���6䵍���ꊛ�}u��P֭4W�5�-ZdX��fYO,��E�re��!	ܙc��X4A��؇�cs��}�`�i^R#��/�>kh��D
ܟ!�cC��Sa�i�J�"����@=��VU/�܈6R)%A����e�(�Px�A);(��g�+*��y������vGд�PӫyA�h����]��J0;����yP��[y��&��ؚ��!�o���"�E�
;lXL�
hk��aXn��C(��Jka	6�С��=��K|8�,Ռ��떘�X�}��Y�|��w��2���8�:G�oQ�%�hU�k!z���2R�u��	vh4�K�oI�-���xR�v[a��.�}Ԅ�O��`�RK�b�m7��I	h�Q̗[v�����"r�i�mS+��b��mWR���6b�Ի�z�<��6�sE�x��_�����"D2����͙����g�7���cI9���B��cw�g�w�0�L�tl)߇��\��%���0'ċ�YT�kg�1Pf!:Uw4����
]‰�@�[5\%��\"?��uOkh�7�~ܟ[��S�k�I�7:��S�rNoE��퇂���O��:��p����G�ףW� ��U)!��!�������%.�xV���	d};�W�y\V�љ~���j�b>�`�#ƙ�-󔬅'>�^|���Ku�oZ}����F�wSbÃt�u�21��c�c�f0~�+�/
�D��4�8H-��}����q�~Ⴅ���q��"�&8Q�A�k������ը��"nqU~|�����M�p�s��r�t�&� ������
���C����6͹�Y�B�*I��5@�2$g�!Ɉ[yj�R�_�`
3Ha(f8���<_�H���e$\���o���RՄ�yI�8<vt��&"��
#�#�od_��_fc,y�����ML:y�?�4lƛ�
y~��]u�V���?;����iv�#���O{[�͖qc%7��=�
G���#N'��~R��+Q$Js�iG()e�R	ŏ(��]�e(F�o7\��cU��sm�if4�ot�`�~�v	�p�摀���W6��#{���Tg�h��x}d�>�E�U,��a��%�G�h���'�|�	���ge�P������´��r�Q� 0�@�b��'?7Yb�^�p<c�>��N��q���6�}�9���l��
�gO��-Z"?�@���LF.w�n7yR��9��5/�{��_��&L����?Ni�
1,*�^�-p��^	nݏ�r]�%@Xi={���:��u��
�<�|o��l���<}�r7�?~�h5�}����9��kp���^�U���+�ʻ3����lXt�����9��@������D���?��Y�R�
�W7��jʏ�k<.� xm�jX��KS��&��5�|���C
�1��R'��P�@V1-�gO�	 �ѩ��e:�7�VC�@ҧ@6�3Nj��0���y�Vm��H[z�mJ-:0��i�����gRRñ�g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(��0��2	8���o��E���o��PT88�^B�0�0H	h::c0:0:@np@p@0w�F�F�}����
������ �P�P���8�8����� ��(!�(��(!�(��(!�(0 ��)!�)�,!,��0!0� ��A!�A��Aa�A$
�AdHBdM(lib-dynload/_curses.cpython-38-x86_64-linux-gnu.so000075500000364450151153537500015567 0ustar00ELF>�~@��@8	@���� `�`�!`�! " ����!��!  888$$h�h�h�  S�tdh�h�h�  P�td`�`�`�Q�tdR�td`�`�!`�!�	�	GNU��"����}�`�3�Mw���@���ԥ���|CE���qX](t��	�
E	�L����_\�-	 ���	�$u	�T�*
����*& 'k<�
��o�oax�		�q���
�|	����Xhx��/ ������
��U	
�	�
�R, �$��IY
b��F"�	�Z	3x����
��c	�	���H
��	C��qK�9�I�;{-oW���D	z
+	�����e��Z�	 �
v�g
�lR��	�*H��
����3m&�l	���P�7
�����
�	�;	/y�jB��a�Y8���
��]2i��
�+h�!`�!`�!'��!�__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libncursesw.so.6libtinfo.so.6libpthread.so.0libc.so.6PyErr_SetStringPyExc_TypeErrorPyUnicode_AsASCIIString_PyMem_Strdup_Py_DeallocPyErr_NoMemoryPyMem_FreePyUnicode_FromString_Py_NoneStructPyErr_Format_PyArg_ParseTuple_SizeTwmove__stack_chk_failPyBytes_SizePyBytes_AsStringPyUnicode_GetLengthPyUnicode_AsEncodedStringPyLong_TypePyLong_AsLongAndOverflowPyExc_OverflowErrorwtouchlnwtimeoutwsyncupsyncokwsyncdownnl_langinfoPyCursesWindow_TypePyObject_MallocPyObject_InitwattrsetPyFloat_Type_PyArg_CheckPositionalPyType_IsSubtype_PyLong_AsIntPyErr_Occurredwsetscrregscrollokwresizewredrawlntmpfile64PyExc_OSErrorPyErr_SetFromErrnofileno_Py_set_inheritableputwinfseekfread_PyObject_CallMethodId_SizeTfclosenotimeoutnodelaymvwinmvderwinleaveoknewscrkeypadis_wintouchedPyBool_FromLongPyTuple_SizewinnstrPyExc_ValueErrorPyBytes_FromStringwinsdellnimmedokidlokidcok_Py_BuildValue_SizeTPyEval_SaveThreadwgetnstrPyEval_RestoreThreadPyLong_FromLongwerasewenclosePyLong_AsLongpechocharwechocharwcursyncupwclrtoeolwclrtobotclearokwclear_PyLong_ZerowborderwbkgdsetwchgatwbkgdstdscrdelwinPyObject_Freeuse_envPyUnicode_AsWideCharunget_wchPyImport_ImportModuleNoBlockLINES_PyObject_SetAttrIdPyDict_SetItemCOLSungetchunctrl_PyArg_Parse_SizeTputpfwritegetwinfilterwvlinesubpadsubwinwscrlprefreshwrefreshcopywinoverwriteoverlaypnoutrefreshwnoutrefreshis_linetouchedwinschwinchPyLong_FromUnsignedLongwhlinewget_wchPyErr_CheckSignalsPyUnicode_FromOrdinalwgetchkeynamewdelchwattr_onwattr_offuse_default_colorstypeahead_PyArg_ParseStack_SizeTtparm_PyArg_BadArgumentPyUnicode_AsUTF8AndSizetigetstrtigetnumtigetflagtermnametermattrsstart_colorCOLORSPyDict_SetItemStringCOLOR_PAIRS_PyArg_UnpackKeywordsPySys_GetObjectPyObject_AsFileDescriptorsetuptermsavettyresize_termresizetermresettyreset_shell_modereset_prog_modenorawnoqiflushnonlnoechonocbreaknewwinnewpadnapmsPyLong_AsUnsignedLongMaskmousemaskmouseintervalmetalongnamekillcharPyBytes_FromStringAndSizeis_term_resizedisendwinintrflushinitscracs_maphas_keyhas_ilhas_ichas_colorsflushinpflasherasechardoupdatedelay_outputdef_shell_modedef_prog_modecurs_setcan_change_colorbeepbaudratesetccharwadd_wchwaddchPyUnicode_AsWideCharStringPyBytes_AsStringAndSizewaddnwstrwaddnstrwins_nwstrwinsnstrcolor_contentungetmousehalfdelayinit_colorinit_pairpair_contentPyInit__cursesPyType_ReadyPyModule_Create2PyModule_GetDictPyCapsule_NewPyErr_NewExceptionPyStructSequence_InitType2PyStructSequence_NewPyDict_DelItemStringstrlenPyMem_MallocPyModule_AddObjectPyExc_KeyErrorPyErr_ExceptionMatchesPyErr_Clear_edata__bss_start_endGLIBC_2.4GLIBC_2.2.5�ii
0ui	:`�!`h�! p�!p�!��!$��!r#�!��!���!V �!3(�!��8�!@T@�!UH�!U�X�!�R`�!!h�!�x�!`R��!��!����!R��!=��!���!�Q��!�!�!>��!Q�!��!���!d�!~��!`P �!](�!��8�!�M@�!YH�!��X�!`L`�!W!h�!����!N��!���!]!��!����!f!�!ۗ�!o!�!���!�!ƺ�!L �!
(�!ҏ@�!H�!��X�!�J`�!Eh�!��x�!�I��!5��!,���! I��!/��!���!y!��!����!�!��![���!�H�!��!̶�!`G �!�(�!ȷ8�!F@�!�H�!~�X�! E`�!�!h�!����!�!��!k���!f��!f���!�!��!���!���!����! D�!�!�!�� �! (�!��@�!�!H�!�`�!�h�!�x�!@C��!���!5���!�A��!��!d���!��!���!w��!����!�?�!��!���!�= �!�!(�!��@�!�!H�!��X�!�<`�!�!h�!����!���!���!���!q���!���!
���!���!���!��!�� �!�(�!�@�!�H�!��`�!hh�!��x�!�;��!H��!Z���!@9��! ��!���!7��!���!h���!@6��!��!J���!`5�!��!;� �!(�! �8�!�1@�!xH�!ֆ`�!�h�!^�x�! 1��!]��!a���!S��!p���!`0��!�!��!T���!�!��!5��!�!�!B��!/ �!�(�!B�8�!/@�!�!H�!��`�!Eh�!%���!r!��!���!���!����!��!����!.��!��!E��!�!w� �!�(�!d�8�! -`�!�!h�!�p�!x�!�,��!�!��!"��!"��!"��!4"��!:"�!O"�!���!�� �!�(�!p�8�!��@�!X"H�!=�X�!�`�!qh�!i�x�!���!i"��!8���!����!w"��!z���!`���!���!����!���!���!����!��!��!_��! � �!�(�!��8�!��@�!�H�!��X�!`�`�!jh�!��x�!����!�"��!����! ���!�"��!#���!����!�"��!N���!����!���!����! ��!�"�!���!`� �!�(�!�8�!��@�!�H�!��X�!�`�!�"h�!�x�!`���!�"��!���!����!�"��!����!���!�"��!����!����!�"��!����! ��!�"�!���!�� �!�(�!�8�!�@�!�H�!�X�!~`�!�h�!�x�!@|��!�"��!���!�{��!���!m���!�{��!�"��!:���! {��!���!@���!`z�!�"�!��!z �!�"(�!��8�!�y@�!�"H�!��X�!�x`�!�h�!'�x�! x��!���!����!�v��!���!����!@u��!�"��!a���!�t��!���!H���!@t�!}�!)��! s �!e(�!U�8�!r@�!oH�!�X�!�q`�!hh�!��x�! q��!c��!����!`p��!�"��!����!�o��!]��!����! o��!#��!����!`n�!#�!r��!�m �!�(�!��8�!m@�!�"H�!��X�!�k`�!_h�!��x�!�j��!M��!^���! j��!<��!%���!�i��!4��!����!`i��!)��!����!@h�!�!���!@f �!(�!a�8�!f@�!�H�!�X�!`e`�!�h�!'�x�! d��!#��!%���!�b��!+#��!���!b��!5#��!����!�a��!���!���!�`�!��!���!�_ �!d(�!��8�!�^@�!?H�!��X�!�]`�!)h�!�x�!�\��!>#��!���!�[��!���!����!`[��!E#��!s���! [��!���!���!�Z�!W#�!}��!�X �!_#(�!��8�!X`�!u#h�!�Wp�!��!��!�#��!�!�!��!�!�H�!�#h�!���!z��!$��!�#��!I���!�!��!`�!X�!`�!h�!p�!x�!��!'��!;��!?��!M��!^��!f��!i��!���!�ȿ!�п!�ؿ!��!��!��!���!�и!ظ!�!�!�!��!�!�!	�!
�! �!(�!
0�!8�!@�!H�!P�!X�!`�!h�!p�!x�!��!��!��!��!��! ��!!��!"��!#��!$ȹ!%й!&ع!(�!)�!*�!+��!,�!-�!.�!/�!0 �!1(�!20�!38�!4@�!5H�!6P�!7X�!8`�!9h�!:p�!<x�!=��!>��!@��!A��!B��!C��!D��!E��!F��!GȺ!Hк!Iغ!J�!K�!L�!N��!O�!P�!Q�!R�!S �!T(�!U0�!V8�!W@�!XH�!YP�!ZX�![`�!\h�!]p�!_x�!`��!a��!b��!c��!d��!e��!g��!h��!i��!jȻ!kл!lػ!m�!n�!o�!p��!q�!r�!s�!t�!u �!v(�!w0�!x8�!y@�!zH�!{P�!|X�!}`�!~h�!p�!�x�!���!���!���!���!���!���!���!���!���!�ȼ!�м!�ؼ!��!��!��!���!��!��!��!��!� �!�(�!�0�!�8�!�@�!�H�!�P�!�X�!�`�!�h�!�p�!�x�!���!���!���!���!���!���!���!���!���!�Ƚ!�н!�ؽ!��!��!��!���!��!��!��!��!� �!�(�!�0�!�8�!�@�!�H�!�P�!�X�!�`�!�h�!�p�!�x�!���!���!���!���!���!���!���!���!���!�Ⱦ!�о!�ؾ!��!��!��!���!��!��!��!��!� �!�(�!�0�!�8�!�@�!�H�!�P�!���H��H�)[!H��t��H����5JT!�%KT!��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&�������h'��q������h(��a������h)��Q������h*��A������h+��1������h,��!������h-��������h.��������h/������h0�������h1��������h2�������h3�������h4�������h5�������h6�������h7��q������h8��a������h9��Q������h:��A������h;��1������h<��!������h=��������h>��������h?������h@�������hA��������hB�������hC�������hD�������hE�������hF�������hG��q������hH��a������hI��Q������hJ��A������hK��1������hL��!������hM��������hN��������hO������hP�������hQ��������hR�������hS�������hT�������hU�������hV�������hW��q������hX��a������hY��Q������hZ��A������h[��1������h\��!������h]��������h^��������h_������h`�������ha��������hb�������hc�������hd�������he�������hf�������hg��q������hh��a������hi��Q������hj��A������hk��1������hl��!������hm��������hn��������ho������hp�������hq��������hr�������hs�������ht�������hu�������hv�������hw��q������hx��a������hy��Q������hz��A������h{��1������h|��!������h}��������h~��������h������h��������h���������h��������h��������h��������h��������h��������h���q������h���a������h���Q������h���A������h���1������h���!������h���������h���������h�������h��������h���������h��������h��������h��������h��������h��������h���q������h���a������h���Q������h���A������h���1������h���!������h���������h���������h�������h��������h���������h��������h��������h��������h��������h��������h���q������h���a������h���Q������h���A������h���1������h���!������h���������h���������h�������h�������h�������h������h������h������h������h������h���q���h���a���h���Q���h���A���h���1���h���!���h������h������h�������h�������h�������h������h������h������h������h������h���q���h���a���h���Q���h���A���h���1���h���!���h������h������h�������h��������%5G!D���%-G!D���%%G!D���%G!D���%G!D���%
G!D���%G!D���%�F!D���%�F!D���%�F!D���%�F!D���%�F!D���%�F!D���%�F!D���%�F!D���%�F!D���%�F!D���%�F!D���%�F!D���%�F!D���%�F!D���%�F!D���%�F!D���%}F!D���%uF!D���%mF!D���%eF!D���%]F!D���%UF!D���%MF!D���%EF!D���%=F!D���%5F!D���%-F!D���%%F!D���%F!D���%F!D���%
F!D���%F!D���%�E!D���%�E!D���%�E!D���%�E!D���%�E!D���%�E!D���%�E!D���%�E!D���%�E!D���%�E!D���%�E!D���%�E!D���%�E!D���%�E!D���%�E!D���%�E!D���%}E!D���%uE!D���%mE!D���%eE!D���%]E!D���%UE!D���%ME!D���%EE!D���%=E!D���%5E!D���%-E!D���%%E!D���%E!D���%E!D���%
E!D���%E!D���%�D!D���%�D!D���%�D!D���%�D!D���%�D!D���%�D!D���%�D!D���%�D!D���%�D!D���%�D!D���%�D!D���%�D!D���%�D!D���%�D!D���%�D!D���%�D!D���%}D!D���%uD!D���%mD!D���%eD!D���%]D!D���%UD!D���%MD!D���%ED!D���%=D!D���%5D!D���%-D!D���%%D!D���%D!D���%D!D���%
D!D���%D!D���%�C!D���%�C!D���%�C!D���%�C!D���%�C!D���%�C!D���%�C!D���%�C!D���%�C!D���%�C!D���%�C!D���%�C!D���%�C!D���%�C!D���%�C!D���%�C!D���%}C!D���%uC!D���%mC!D���%eC!D���%]C!D���%UC!D���%MC!D���%EC!D���%=C!D���%5C!D���%-C!D���%%C!D���%C!D���%C!D���%
C!D���%C!D���%�B!D���%�B!D���%�B!D���%�B!D���%�B!D���%�B!D���%�B!D���%�B!D���%�B!D���%�B!D���%�B!D���%�B!D���%�B!D���%�B!D���%�B!D���%�B!D���%}B!D���%uB!D���%mB!D���%eB!D���%]B!D���%UB!D���%MB!D���%EB!D���%=B!D���%5B!D���%-B!D���%%B!D���%B!D���%B!D���%
B!D���%B!D���%�A!D���%�A!D���%�A!D���%�A!D���%�A!D���%�A!D���%�A!D���%�A!D���%�A!D���%�A!D���%�A!D���%�A!D���%�A!D���%�A!D���%�A!D���%�A!D���%}A!D���%uA!D���%mA!D���%eA!D���%]A!D���%UA!D���%MA!D���%EA!D���%=A!D���%5A!D���%-A!D���%%A!D���%A!D���%A!D���%
A!D���%A!D���%�@!D���%�@!D���%�@!D���%�@!D���%�@!D���%�@!D���%�@!D���%�@!D���%�@!D���%�@!D����Y!��tPH�=�Y!H�5–�=���1�Z������Y!��tPH�=yY!H�5������1�Z�����VY!��tPH�=QY!H�5�����1�Z����ATUSH��uH�
\@!H�5��H�9�������uH�F���uH�4@!H�5u�H�:������MH��H�����H��H��t7H�{ �y���H�I��uH���Y���M��u
����H�}���L�e1�[]A\���H��Y��StH��?!H��0H��H�=vX!H��uH�5R�
����H��1�H�5ӕ1����H��[���SH��H��H�5ǕH��dH�%(H�D$1�H�T$H�����1���tH�{�t$�$��H�5�����a���H�\$dH3%(t����H��[�AUI��ATI��USH��H��dH�%(H�D$1�H�F���tH����H��uH������(�,H�S�����H������H��tH�SH�5����C ���ƒ��� ��u��tL�CH�@t
L�C0�L�CHA�(�8��u��tH�{H�@t
H�{0�H�{H�/���tH�sH�@t
H�s0�H�sH�.H�����H�5�V!M��tI�uH��1����H��1�H����H��H�u�o H�u�@���H���uD�UH;	>!uH�t$H���2����|$H��t"�3H�RH�5[�L�
�=!1�I�9���1��+A��A�,$L9�u��L��=!H�5ؓI�;����1�H�L$dH3%(t�V���H��[]A\A]���RH���H��t�W��1�����H�5����X�P�����RH���H��t�W��1�1���H�5p���X�!�����SH��H��H�� dH�%(H�D$1�H�F�D$H��tH��t"�HH�L$H�T$1�H�5(����1Ʌ�uD�>H�L$H�T$1�L�D$H�5������u�H�Z<!H�5;�H�:����1��E�T$�t$H�{��u���H�5�����^�����L$���H�5�����E�����H�\$dH3%(t���H�� [���SH��H��H�5t�H��dH�%(H�D$1�H�T$���1���tH�{�t$�*�H��;!H�H�L$dH3%(t���H��[���PH���H��;!H�Z���SH��H��H�5��H��dH�%(H�D$1�H�T$����1���t"1�H�{�|$@����H�5͑���H���H�L$dH3%(t���H��[���PH��(�H�!;!H�Z�ATI��UH��SH��u���H��H��t�8uH�-k�H�;!H�{ ��H��H����H��H��t)L�`H�����H�CH��uH�uH��������1�H��[]A\���PH���h���H��:!H�Z���PH�1��L���H�e:!H�Z���AUI��ATUSH��APH��uH�H�-:!H�xH9�u$�eH�ֹ�H�=������u��H���	��u7H�;�]���A�ă��tH�SH�zH9�u��A�H��t��aH������tH�
9!H�5��H�9����=H�{�
����Ã��t#I�}D�������YH�5�[��]A\A]�z������H��t�Z1�[]A\A]���SH��H��H�5��H��dH�%(H�D$1�H�T$�O���1���t"1�H�{�|$@�����H�5��������H�L$dH3%(t��H��[���SH��H��H�5~�H��dH�%(H�D$1�H�T$H�������1���tH�{�t$�$�?�H�5O������H�\$dH3%(t�L�H��[���AUI��ATUSH��APH��uH�H�-<8!H�xH9�u$�eH�ֹ�H�=����u��H���/��u7H�;��A�ă��tH�SH�zH9�u��g�H��t��aH�����tH�
�7!H�5��H�9�����=H�{�3���t#I�}D�����YH�5e�[��]A\A]�����H��t�Z1�[]A\A]���RH���H��t�W��1���H�5(���X�_�����AVAUATUSH��H�$H��H�$H��dH�%(H��$ 1�H��I����H��uH��6!H�8�.���H���H��H���+�1�1�������y1��H�{H����H�5��������H��H��t�1�1�H��I����H�� �L���_�I��H��~3H�uH����M��L��H�F�L��H�5CK!1��L�H��H��u�H�����H��$ dH3%(H��t��H�� []A\A]A^���SH��H��H�5~�H��dH�%(H�D$1�H�T$����1���t"1�H�{�|$@�����H�5��������H�L$dH3%(t��H��[���SH��H��H�5	�H��dH�%(H�D$1�H�T$����1���t"1�H�{�|$@����H�5?����Y���H�L$dH3%(t�
�H��[���SH��H��H�5K�H��dH�%(H�D$1�H�T$H���$���1���tH�{�t$�$��H�5Ӌ�����H�\$dH3%(t��H��[���SH��H��H�5׊H��dH�%(H�D$1�H�T$H������1���tH�{�t$�$��H�5e����q�H�\$dH3%(t�%�H��[���SH��H��H�5��H��dH�%(H�D$1�H�T$�?���1���t"1�H�{�|$@�����H�5������H�L$dH3%(t��H��[���ATUSH��H��uH�H�-�3!H�xH9�u!�bH�ֹ�H�=���{���u��YH������u7H�;���A�ă��tH�SH�zH9�u����H��t��"H���f���tH�=3!H�5,�H�?�|�1��H�{���Ã��t �=�K!t#H�=�K!H�5��I�1��T�p�H��t��H�-�2!H�}H��t*D��!��u����1���H�}��D����H��2!H���[]A\���SH��H��H�5	�H��dH�%(H�D$1�H�T$����1���t"1�H�{�|$@�����H�5e����Y�H�L$dH3%(t�
�H��[���PH���Z���P���UH��SH��H��H��(dH�%(H��$1��R�H��t%H�����2H��tZH�����1�H�T$H�5̈H����������T$���������H�{H�t$O��a���1�H�L$H�T$H��H�5������txH�{�T$�t$����u
�D$�H�{H�t$�����1�H�L$H�T$H��L�D$H�5:��&���t�|$yH��0!H�5�H�:�%�1��cH�{�T$�t$����t���H�{H�t$�|$�NT$���H�
k0!H�5��H�9���1�����@���H�|$��H��$dH3%(t�6�H��([]���SH��H��H�5��H��dH�%(H�D$1�H�T$�L���1���tH�{�t$�7�H�5R�����H�L$dH3%(t���H��[���PH�����H�5"�Z�������PH�����H�5
�Z������SH��H��H�5	�H��dH�%(H�D$1�H�T$����1���t1�H�{�|$@���`�H�i/!H�H�L$dH3%(t��H��[���SH��H��H�5��H��dH�%(H�D$1�H�T$�+���1���t"1�H�{�|$@�����H�5H������H�L$dH3%(t��H��[���SH��H��H�5#�H��dH�%(H�D$1�H�T$����1���t1�H�{�|$@���j�H��.!H�H�L$dH3%(t�+�H��[���H�G����H��t�p8�P4H�=��1������H�G����H��t�p�P���H�=p�1�����H�G����H��t�p�P
H�=H�1��{���H�G����H��t�0�PH�=!�1��T����==F!u5H�H-!H�H��t���y��u
�1�Q�1�1�H�=�1���PH�=F!H�5A���1�Z���ATUH��H��SH��H�� dH�%(H��$1���H��tJ3H���c��H�}H�t$��I���n�L�������SH��tEH�����$1�H�T$H�5߃H����������|$����I����1�H�L$H�T$H��H�5������t���H�}�T$�t$I������Ã����H�}H�t$�������1�H�L$H�T$H��L�D$H�5[��G���t�|$yH��+!H�5%�H�8�F�1��y�m�H�}�T$�t$I���)���Ã��t"��H�}H�t$�|$�NT$�2���L�����H�w+!H�5ؐH�:���1����u�D$H�|$��H��$dH3%(t�A�H�� []A\���H�G1�H��t�x�����SH��H�~H�5#+!H9�uH��*!H�5�H�8�`��i�)���u�H���}��Ã��t�=�C!t!H�=�C!H�5̀�*��3�S�H��t��'�=uC!tH�=dC!H�5�����	��[�5�1�[���PH��S�H�5
�Z������AUI��ATUSH��APH��uH�H�-Z*!H�xH9�u$�eH�ֹ�H�=ȁ�.���u��H���M���u7H�;��A�ă��tH�SH�zH9�u���H��t��[H������tH�
�)!H�5܎H�9�,��7H�{�Q��Ã��tI�}��D���\��Y[��]A\A]�=��(�H��t�Z1�[]A\A]���UH��SH��APH�~H�5x)!H9�uH�L)!H�5e�H�8���@�~���u�H���"��H��H���tH�}���>�YH�5À[��]�D����H��t�Z1�[]���AUATI��UH��SH��H��dH�%(H�D$1�H�B�H��w
H��L�+!�w��H��H�=c�����u��*H�SH�5�(!H�zH9�uH�
�(!H�5��H�9���1������u�H�{�P��H��H���u����H��t��1���L��H�T$L���&���1���t>�t$I�|$	�H��t�Gt�B�H�5����;���]��H�5����&�H�L$dH3%(t���H��[]A\A]���PH��Q�H��'!H�Z���PH����H��'!H�Z���PH��
��H��'!H�Z���SH��H��H�5~H��dH�%(H�D$1�H�T$�����1���t"1�H�{�|$@�����H�5�~���^�H�L$dH3%(t��H��[���PH���H�7'!H�Z���USH��H��(H�NdH�%(H�D$1�H��&!H�H�T$H�T$H��tPH��u0��H��H�L$H�T$1�H�5^~����1�������L�s&!H�5��I�8���1��w1�H�l$H�t$�$�D$��u/�4$�L$E1�H�{Pj��A��jj�
�H�5c&!H�� H��)H��H������u1��H�T$H��H�������u���H�\$dH3%(H��t���H��([]���AWI��AVAUATI��UH��SH��XdH�%(H�D$H1�H��wH��1�|��H�t$1ҹH��H�=M}���1�L�D$��u��2I�0H��t[M�PH��tfM�HH��tnI�HH��tsM�x H��tvM�p(H��tvM�h01�H��toI�X8�i1�E1�E1�E1�1�E1�E1�1��R1�E1�E1�E1�1�E1�E1��=1�E1�E1�E1�1�E1��+1�E1�E1�E1�1��1�E1�E1�E1��1�E1�E1��1�E1�H�D$ H�D$(H�D$0H�D$8H��uM��u8�^H�T$ L��H�L$L�L$L�T$�Z�L�T$L�L$��H�L$u�1��H�T$$L��L��H�L$L�L$�&�L�L$H�L$��t�M��tH�T$(L��L��H�L$��H�L$��t�H��tH�T$,H��L�������t�M��tH�T$0L��L��������x���M��tH�T$4L��L�������[���M��tH�T$8L��L�������>���H��tH�T$<H��L���p����!���P�D$DI�|$P�T$HR�t$LVD�L$PD�D$L�L$H�T$D�t$@�'��H�=�#!H�� H�H�\$HdH3%(H��t�!��H��X[]A\A]A^A_���AUATI��UH��SH��H��dH�%(H�D$1�H�B�H��w
H��L�+!�t��H��H�=�z������u��*H�SH�5�"!H�zH9�uH�
�"!H�5��H�9���1��]������u�H�{�h��H��H���u�
��H��t��1���L��H�T$L���>�1���t�t$I�|$	���H�5p"!H�H�L$dH3%(H��t���H��[]A\A]���AUATI��H��USH��H��(dH�%(H�D$1��D$�����f��H��t<
H��t�H��tQH��tq�1�H�T$H�5�yH��������u$�1�H�L$H�T$H��H�5ay������tx�\$1��w1�H�L$H�T$H��L�D$H�5?y�����u+�J1�H�L$H�T$H��L�L$L�D$H�5%y�r����t!�\$��H�=!!H�5��H�?�m��1����I�|$0�A����t�T$�t$�H�����t9I�|$���H��t��T$��H��t�O�L$�t$E1�D����Z����I�|$�t$���@��H�5�x����H�L$dH3%(t�]��H��([]A\A]���AUATI��UH��SH��H��dH�%(H�D$1�H�B�H��w
H��L�+!�t��H��H�=�������u��*H�SH�5 !H�zH9�uH�
�!H�5�H�9�>��1��c�����u�H�{���H��H���u�J��H��t��1���L��H�T$L���~���1���t�t$I�|$	����H�5c������H�L$dH3%(t�R��H��[]A\A]���H�!SH��H�H;8t���H�{H��t���H��[�����SH��H�~H�5!H9�uH��!H�5�H�8�U��1��A�����u�H���p�����t1���@�����H��!H���K��H��t�1���[���SH�� dH�%(H�D$1��=B7!tH�==7!H�5|t����1���H�FH��t>H�t$�H�����H��t!L�
,!H�SH�5�1�I�9�O����|$�yH;E!uPH�t$H���n���|$tL�8!H�5vI�8�Q���YHcЉ�H9�t:H�=!H�5׃1�H�?�����5H�
�!H�P1�H�5߃H�9����1���f��H�5�u������1�H�L$dH3%(t�o��H�� [�ATH�=]�US�Y��H��t'H��H�r!Hc8����H��H��uH�uH�����E1��H��H�52!H����������H�52!H�=�5!H�����A�ą���H�MuH���<��H�%!Hc:�}��H��H��u
H�u��H��H�5�1!H���i����t!H�uH�����H�M�a���H�������_H�5]1!H�=&5!H�������t$H�uH�����H�M�&���H��E1�����!H�MuH�����H�A�uH�����D��[]A\���Q�����1���t
H�D!H�Z���H��dH�%(H�D$1��=�4!tH�=�4!H�5�q�;��1��+H�T$1������1���t�|$���H�5�s������H�L$dH3%(t���H�����H��dH�%(H�D$1��='4!tH�="4!H�5aq���1��%H�T$1��/����1���t�|$����H�����H�L$dH3%(t���H�������H��H��H�57sdH�%(H�D$1�H���m����1���tH�<$���H�5	s�����H�L$dH3%(t���H������=]3!ATUStH�=T3!H�5�p1������/H���!��H��H��uH�52![]A\H�>���H�����1�1����C������H��1�H�5�.!1��H��H��H��t|H�@���u0H�=!H�P1�H�5_�H�?�'��H�uNH��1��H���L�cH�{ H��L�����H�I9�t#H��H�uH�����H�
|!H�9���1��NH��H�uH������1�1�H�����H���l��H��H��uH�=52!H�5�������
1�H���y��H��H�����H��[]A\���P���H�q!H�Z���AWAVAUATUH��H��SH��8dH�%(H�D$(1�H�F�D$�D$H�D$H��tCH��t�H��tSH��t{�1�H�L$H�T$ H�5�p��������1�H�L$H�T$ L�D$H�5�p������u~�u1�H�L$H�T$L�L$L�D$ H�5�p�����tOA��QH�L$H�T$P1�H�5�pH�\$ SL�L$L�D$0�t��ZY��u��H�

!H�5�~H�9�v��1��E1���H�t$ H�T$H��H�\$D�d$D�t$D�l$������1���tXE��t3H�}D��D���&����u H�=s0!H�nH�5�m1�����1�� �t$H�}D��	����H�5�o�����H�\$(dH3%(t�]��H��8[]A\A]A^A_���SH��H��H��0dH�%(H�D$(1�H�F�D$$�D$ H��tH��t �F1�H�L$H�T$H�5\o�E����uD�>1�H�L$ H�T$$L�L$L�D$H�52o�����u�H��!H�5y}H�:�!��1��`H�{D�D$�L$�T$ �t$$H��t
�Gt�8������H��uH�==/!H�5��H�D$����H�D$�H�sH���u����H�\$(dH3%(t�8��H��0[���SH��H��dH�%(H�D$1�H�F�D$H��t^H��u?��H��H�T$1�H�5Wn�6����1���tSH�{�t$����H�58n������6H�
�!H�5�|H�9���1��H�����H�5n������H�L$dH3%(t�v��H��[���AWAVAUATUSH��H��8dH�%(H�D$(1�H�F�D$$�D$ �D$�D$�D$�D$H��tmH��uJ��H��H�t$H�T$$1�H�L$ VH�5amH�l$UL�L$(L�D$,�'��^_��1������L��!H�5�{I�:���1���1�H�{H�����G����uH�=I-!H�5�{����1��D�L$�l$D�|$D�t$D�l$ D�d$$D�L$����H�{E��D��H�$D��D��PUD�L$���ZYH�<$���*��H�5�l���C���I��tL��!H�5�{I�8�`��1��+���H�{I���;��L��A������H�5MlD�����H�L$(dH3%(t���H��8[]A\A]A^A_���SH��H��H��0dH�%(H�D$(1�H�F�D$�D$�D$�D$�D$�D$H��tH��t$�oH��!H�L$ H�5�k1��r��1Ʌ�ui�cH�T$H�L$ 1�RH�f!H�t$VH�5�kL�D$ APL�L$,AQL�L$8L�D$<�,��H�� ���u�H�=�!H�5ozH�?�'��1��bL�T$ H�{I�r��t:PjD�\$AS�\$$SD�L$0D�D$4�L$8�T$<�|��H�� H�5k�������S��H�5�j�������H�\$(dH3%(t�<��H��0[���SH��H��H��0dH�%(H�D$(1�H�F�D$�D$�D$�D$�D$�D$H��tH��t$�oH�.!H�L$ H�5wj1����1Ʌ�ui�cH�T$H�L$ 1�RH��!H�t$VH�5RjL�D$ APL�L$,AQL�L$8L�D$<����H�� ���u�H�=W!H�5@yH�?���1��bL�T$ H�{I�r��t:PjD�\$AS�\$$SD�L$0D�D$4�L$8�T$<���H�� H�5�i���:����L��H�5�i���%����H�\$(dH3%(t����H��0[���AWAVAUATUSH��H��8dH�%(H�D$(1�H�F�D$$�D$ �D$�D$�D$�D$H��tmH��uJ��H��H�t$H�T$$1�H�L$ VH�5iH�l$UL�L$(L�D$,���^_��1������L�!H�53xI�:�{��1���1�H�{H�����G����uH�=�(!H�51x�D��1��D�L$�l$D�|$D�t$D�l$ D�d$$D�L$�F��H�{E��D��H�$D��D��PUD�L$����ZYH�<$�����H�5Vh������I��tL�V!H�5�wI�8���1��+����H�{I������L��A���?��H�5hD���W��H�L$(dH3%(t���H��8[]A\A]A^A_���UH��SH��APH�~H�5�!H9�uH�
�!H�5�sH�9�8���e�����u�H���U�����tH�}H��u�,�>��H��t��6�G��9���x�����Y[��]����H�h!H�5)wH�:����Z1�[]���AVAUATUH��H��SH��0dH�%(H�D$(1�H�F�D$�D$H�D$H��t=
H��t�H��tIH��tl�1�H�T$ H�5�f�2�������1�H�L$H�T$ H�5�f�
����um�g1�H�L$H�T$L�D$ H�5�f�����tFA��E1�H�L$H�T$L�L$L�D$ H�5yf�����u��H�
W
!H�5PvH�9���1��{E1���H�t$ H�T$H��H�\$D�l$D�d$�D$�
����1���tCH�}E��u
�t$	��@����D��D���c������t�t$H�}	�����H�5�e�����H�\$(dH3%(t���H��0[]A\A]A^���SH��H��dH�%(H�D$1�H�F�$�D$H��t`H��u'��H��H�T$H��1�H�5pe�����1���u�CH�
?!H�5huH�9���1��)H�{�$�t$蔿���������tH�{�r�������H�L$dH3%(t���H��[���AWAVAUATUH��H��SH��8dH�%(H�D$(1�H�F�D$�D$H�D$H��tCH��t�H��tSH��t{�1�H�L$H�T$ H�5�d迿�������1�H�L$H�T$ L�D$H�5rd蕿����u~�u1�H�L$H�T$L�L$L�D$ H�5=d�m�����tOA��QH�L$H�T$P1�H�5#dH�\$ SL�L$L�D$0�8���ZY��u��H�
�
!H�5*tH�9�:��1��E1���H�t$ H�T$H��H�\$D�d$D�t$D�l$�����1���tXE��t3H�}D��D�������u H�=7#!H��`H�5�`1����1�� �t$H�}D��	��$��H�5]c���m��H�\$(dH3%(t�!��H��8[]A\A]A^A_���AVAUATUH��SH�� dH�%(H�D$1�H�F�D$�D$H��tUH��u1��H��H�L$H�T$1�H�5�bE1���������� H��	!H�5sE1�H�:����1�D�t$D�l$�����H�}I��uH�t$������"D��D��輼���Ã��tH�}H�t$������L���=������u!���E1���u3H�=�!!H�5Kb�y����|$��u
���I������I��H�L$dH3%(L��t����H�� []A\A]A^���AVAUATUH��SH��dH�%(H�D$1�H�F�$�D$H��tDH��u$H��H��H�T$1�H�5�a�赼����u�H�P!H�5rH�:���1��[1�D�4$D�l$������H�}I��tD��D��菻���Ã��tH�}�����L���������t
Hc�����葾��H��t��H�L$dH3%(t����H��[]A\A]A^���AVAUATUH��SH�� dH�%(H�D$1�H�F�D$�D$H��tIH��u&H��H�L$H�T$1�H�5�`�趻����u!�H�Q!H�5BqH�:���1��1�D�t$D�l$�ҿ����H�}I��tD��D��茺���Ã��tH�}�����L���������u.�X��蓽��H��u�H�=�!H�5`H�D$�F��H�D$�.�߁�������Y��H��uH��]H���5�����H�L$dH3%(t���H�� []A\A]A^���SH��H�~H�5�!H9�uH�X!H�5qkH�:����z芿����u�H�������Ã��t�=�!t!H�=�!H�5.\����D贼��H��t��8��yH��!H�5T_H�8�c��������H��uH��\H��[�5���1�[���SH��H��H�� dH�%(H�D$1�H�F�D$�D$H��tH��t �F1�H�L$H�T$H�5�^�ȹ����uD�>1�H�L$H�T$L�L$L�D$H�5�^蠹����u�H�;!H�5\oH�:���1��HH�{D�D$�L$�T$�t$�F���H��H��uH�=�!H�5���k���1�H�����H����H�T$dH3%(H��t�п��H�� [���SH��H��dH�%(H�D$1�H�F�$�D$H��tGH��u'��H��H�T$H��1�H�5�]�ø����1���u5�_H�
Z!H�5�nH�9����1��EH�����H�5�]���o���,H�{�$�t$薷�����t	H�{�غ��H�5�]���A��H�L$dH3%(t���H��[���UH��SH��APH�~H�5�!H9�uH��!H�5�hH�8�+����B����u�H��蘹��H��H���tH�}��1����YH�5][��]�������H��t�Z1�[]���UH��SH��APH�~H�5p!H9�uH�D!H�5]hH�8����B�v�����u�H������H��H���tH�}��1��T���YH�5�\[��]�:��螹��H��t�Z1�[]���Q�=�!tH�=�!H�5�X�B���1��J�=�!tH�=�!H�5�X�"���1��*�i�����tH��!H��H�=Z!H�5m���1�Z���SH��H�~H�5�!H9�uH�[!H�5tgH�8�Ŀ���X荻����u�H������Ã��t�=�!t!H�=�!H�51X莿���"跸��H��t����虵��H�5�[[���1��1�[�����SH��H��H��@dH�%(H�D$81�H�L$0�D$,�D$(�D$$�D$ �D$�D$�D$�D$�D$PH�D$P1�H�T$ RH�[H�\$,S1�L�D$8APL�L$DAQL�T$PARL�\$\ASL�L$hL�D$l�ݳ��H��@�����=�!tH�=�!H�52e腾���b�L$Q�t$V�|$$W�D$0PD�L$<1�D�D$@�L$D�T$H�t$LH�|$P蝻��H�� H��H��uH�=�!H�5xZ�.����H������H��H�T$8dH3%(H��t虻��H��@[���H��H��dH�%(H�D$1�H�F���u"H�,^H�5(ZH�=*Z�Q���E1��H��H�����I��H����H��1�L���H��H��H��H;4$tL�
�� H�5�YI�9�r���E1��N�=�!tH�=�!H�5�c�Q���E1��-L���$���H�P�H���vL�!I��H������I����H�L$dH3%(L��t藺��H�����H��H��dH�%(H�D$1�H�F���uH�+]H�5'YH�=JY�P���1��~H��H����H��H��tkH��1�H���H��H��H��H;4$tL�� H�5�XI�8�y���1��7�=�!tH�=�!H�5c�Y���1��H���M���Hc�腺��H����H�L$dH3%(H��t趹��H�����H��H��dH�%(H�D$1�H�F���uH�J\H�5FXH�=rX�o���1��~H��H������H��H��tkH��1�H���H��H��H��H;4$tL�� H�5
XI�8蘻��1��7�=�!tH�=�!H�5%b�x���1��H���ܴ��Hc�褹��H����H�L$dH3%(H��t�ո��H�����V�=�!u�
���YH������H�=u!H�5�S����1�Z���V�=U!u
�*���Y���2���H�=C!H�5�S�ߺ��1�Z����=$!StH�=!H�5]S躺��1����޶������H��� ��!Hc8�͸��H��H����H�=�!H��H�5W�[���H���xDH��H�uH���D���H�E� Hc:腸��H��H��t`H�=v!H��H�5�V����H���yH��H�u;H������1��1H��H�uH�����H�� H��H�=A!H�5�V�ݹ��1�[���ATE1�UH��H��SH��0dH�%(H�D$(1�H��tL�aI�H��uH��xH��H��u/PH��E1�L��!1�H�D$Pjj�D���H�� H��H����M����H�]H����H;� tzH�S���tHH��H�t$�k���H��H��tPH��1�H���H��H��H��H;t$t?H�y� H�5gUH�;���H��H��UH�5�UH�=�U�c���E1��1�I��tWL�EH�5a� I�xH9�uL�
1� H�5J`I�9蚸��E1����]�����u�H�}谷�����uT覱��H��t�1�H�=tU�A���H��t	H;%� uH�=�!H�5JU�@���E1��{��H������E1҃��tg�=p!uJH�T$��H���O�����u7D�\$H�57eE��tA��H�5�TL�%IeID�H�=6!�ٷ��E1��L��� �!I�H�L$(dH3%(L��t�8���H��0[]A\���V�=�!u�,���H�5�TY���D���H�=�!H�5
P�j���1�Z���ATUSH��H��uH�H�-� H�xH9�u$�hH�ֹ�H�=IT�dz����u���H�������u:H�;�:���A�ă��tH�SH�zH9�u�����H��t��H��謲����tH�
Y� H�5r^1�H�9����yH�{����Ã��t �=�!t#H�=�!H�55O1�萶���I蹯��H��t��7��D��訳��H�5�S���1���H��H��t�����uH�MuH���;���1���H��[]A\���ATUSH��H��uH�H�-� H�xH9�u$�hH�ֹ�H�=,S螲����u���H��轱����u:H�;����A�ă��tH�SH�zH9�u����H��t��H��胱����tH�
0� H�5I]1�H�9藵���yH�{輴���Ã��t �=�!t#H�=�!H�5N1��g����I萮��H��t��7��D�����H�5qR������H��H��t�[����uH�MuH������1���H��[]A\���V�=\!u�ѯ��H�5.RY��鹷��H�=C!H�5�M�ߴ��1�Z���V�=#!u���H�5�QY��逷��H�=
!H�5IM覴��1�Z���V�=�!u迬��H�5�QY���G���H�=�!H�5M�m���1�Z���V�=�!u�Ʊ��H�5�QY������H�=�!H�5�L�4���1�Z���UH��SH��WH��wH��!�p1ҹH��H�=dQ蠰����u��H�EH�5�� H�xH9�uH�d� H�5}[H�:�ͳ���i薯����u�H�}����Ń��u�ݬ��H��t�D��=�!tH�=�!H�5(L腳���!��t�Z�������YH�5�P[��]�)���Z1�[]���Q�=�!tH�=�!H�5�K�;���1���r���H��� H�Z���UH��SH��QH��wH���o1ҹH��H�=�X薯����u��*H�EH�5�� H�xH9�uH�]� H�5vZH�:�Ʋ��1��h荮����u�H�}����Ń��u�ԫ��H��t�׽�=�
!tH�=�
!H�5K�|���1����t菧���訫��H�1� H���Z[]���V�=�
!u����H�5�OY�����H�=�
!H�5�J�!���1�Z���V�=e
!u���H�5kOY���´��H�=L
!H�5�J���1�Z���V�=,
!u�a���H�59OY��鉴��H�=
!H�5RJ诱��1�Z���UH��SH��WH��wH��!�p1ҹH��H�=�N������u��H�EH�5� H�xH9�uH��� H�5�XH�:�H����i������u�H�}�d����Ń��u�X���H��t�D��=i!tH�=d!H�5�I�����!��t赱���辪��YH�5KN[��]餳��Z1�[]���SH��H�� dH�%(H�D$1�H�F�D$�D$H��tH��t �F1�H�L$H�T$H�5N�a�����uD�^1�H�L$H�T$L�L$L�D$H�5�M�9�����u�6H��� H�5�]1�H�:�;����c�=�!tH�=�!H�5�H����1��C�L$�T$�t$�|$�ԥ��H��H��uH�=M!H�5�����1�H��葷��H����H�T$dH3%(H��t�N���H�� [���ATUSH��H��uH�H�-E� H�xH9�u$�hH�ֹ�H�=M������u���H���8�����u:H�;茮��A�ă��tH�SH�zH9�u��p���H��t��H�������tH�
�� H�5�VH�9�����lH�{�9������t�=O
!t!H�=J
!H�5�G����>����H��t��2��D�����H��uH�=
!H�5��趮���[1�]H��A\�Z���[1�]A\���SH��H�~H�54� H9�uH�� H�5!VH�8�q����Z�:�����u�H��莭���Ã��t�=�	!t!H�=�	!H�5�F�;����$�d���H��t�����v���H�=FH[��1��u���1�[���H��H��dH�%(H�D$1�H�F���uH�mKH�56JH�=cK�_���1��LH��蓮���=	!tH�=	!H�5JF觭��1��$H�t$���W����T$H�=%K��1������H�T$dH3%(t���H�����SH��H�~H�5�� H9�uH��� H�5�TH�8�7����X������u�H���T����Ã��t�=j!t!H�=e!H�5�E�����"�*���H��t�����L���H�5�J[��餯��1�[���SH��H�~H�5n� H9�uH�B� H�5[TH�:諬���h�t�����u�H���ȫ���Ã��t�=�!t!H�=�!H�5E�u����2螥��H��t��&H��� 1���@��H�8谬��H�5�I[������1�[���V�=�!u�j���YH������H�=r!H�5�D����1�Z���H��dH�%(H�D$1��}���H�|$��D$�ک��H�T$dH3%(t�U���H�����ATUSH��H��uH�H�-M� H�xH9�u$�eH�ֹ�H�=7I�!�����u��H���@�����u7H�;蔪��A�ă��tH�SH�zH9�u��x���H��t��tH���	�����tH�
�� H�5�RH�9�����PH�{�D����Ã��t�=Z!t!H�=U!H�5�C���"����H��t��D���艦��[]��A\齡��[1�]A\���V�=!u����Y��隡��H�=�!H�5:C藪��1�Z���SH��H�~H�5(� H9�uH��� H�5RH�8�e����`�.�����u�H��肩���Ã��t�=�!t!H�=�!H�5�B�/����*�X���H��t��1���@��1�����H�5�G[���ʬ��1�[����=H!ATUStL�%W� I�<$�Τ��I�<$[1�]A\郱���j���H��H��uH�=!H�5Ծ诩���
H��� ��!��!����ħ��I��H��t(H�=�!H��H�56G�V�����uI�$uL���D������艧��I��H��t(H�=z!H��H�5G������uI�$uL���	�������N���I��H��t(H�=?!H��H�5�F�����uI�$uL���Χ���������I��H��t(H�=!H��H�5�F襝����uI�$uL��蓧������ئ��I��H��t(H�=�!H��H�5~F�j�����uI�$uL���X������蝦��I��H��t(H�=�!H��H�5LF�/�����uI�$uL����������b���I��H��t(H�=S!H��H�5F����uI�$uL���������'���I��H��t(H�=!H��H�5�E蹜����uI�$uL��触��������I��H��t(H�=�!H��H�5�E�~�����uI�$uL���l������豥��I��H��t(H�=�!H��H�5�E�C�����uI�$uL���1�������v���I��H��t(H�=g!H��H�5TE������uI�$uL���������;���I��H��t(H�=,!H��H�5"E�͛����uI�$uL��軥���������I��H��t(H�=�!H��H�5�D蒛����uI�$uL��耥������Ť��I��H��t(H�=�!H��H�5�D�W�����uI�$uL���E������芤��I��H��t(H�={!H��H�5�D������uI�$uL���
�������O���I��H��t(H�=@!H��H�5\D�����uI�$uL���Ϥ���������I��H��t(H�=!H��H�5,D覚����uI�$uL��蔤������٣��I��H��t(H�=�!H��H�5�C�k�����uI�$uL���Y������螣��I��H��t(H�=�!H��H�5�C�0�����uI�$uL����������c���I��H��t(H�=T!H��H�5�C�����uI�$uL���������(���I��H��t(H�=!H��H�5mC躙����uI�$uL��訣��������I��H��t(H�=� H��H�5=C������uI�$uL���m������貢��I��H��t(H�=�� H��H�5
C�D�����uI�$uL���2�������w���I��H��t(H�=h� H��H�5�B�	�����uI�$uL���������<���I��H��t(H�=-� H��H�5�B�Θ����uI�$uL��輢���������I��H��t(H�=� H��H�5|B蓘����uI�$uL��聢������ơ��I��H��t(H�=�� H��H�5JB�X�����uI�$uL���F������苡��I��H��t(H�=|� H��H�5B������uI�$uL����������P���I��H��t(H�=A� H��H�5�A�����uI�$uL���С���������I��H��t(H�=� H��H�5�A觗����uI�$uL��蕡������ڠ��H��H��t'H�=� H��H�5�A�l�����u
H�uH���[���H�L� ���虠��I��H��t(H�=�� H��H�5JA�+�����uI�$uL����������^���I��H��t(H�=O� H��H�5A����uI�$uL���ޠ������#���I��H��t(H�=� H��H�5�@赖����uI�$uL��裠��������I��H��t(H�=� H��H�5�@�z�����uI�$uL���h������譟��I��H��t(H�=�� H��H�5�@�?�����uI�$uL���-�������r���I��H��t(H�=c� H��H�5P@������uI�$uL��������7���I��H��t(H�=(� H��H�5@�ɕ����uI�$uL��跟��������I��H��t(H�=� H��H�5�?莕����uI�$uL���|���������I��H��t(H�=�� H��H�5�?�S�����uI�$uL���A������膞��I��H��t(H�=w� H��H�5�?������uI�$uL����������K���I��H��t(H�=<� H��H�5T?�ݔ����uI�$uL���˞���������H��H��t'H�=� H��H�5$?袔����u
H�uH��葞��H�R� Hc8�ҝ��I��H��t(H�=� H��H�5�>�d�����uI�$uL���R���H�;� Hc:蓝��H��H��t'H�=�� H��H�5�>�%�����u
H�uH������H��1����H�HH��H�
T� H��[]A\���SH��H�~H�5�� H9�uH�m� H�5�FH�8�֞���R蟚����u�H�����Ã��t�=	� t!H�=� H�5C7蠞����ɗ��H��t��������[Hc��r���1�[���V�=� u�ۙ��Y���R���H�=�� H�5�6�O���1�Z���V�=�� u���Y������H�=�� H�5�6����1�Z���V�=`� u腛��Y�����H�=M� H�5�6���1�Z���H��(dH�%(H�D$1��=� tH�=� H�5T6豝��1��GH���5�����uH�=� H�5=莝��1��$�4$D�L$H�==1�D�D$�L$�T$�ƞ��H�T$dH3%(t���H��(���Q�=�� tH�=�� H�5�5�+���1��袜��H��� H�Z���V�=^� u�Ù��H�5�<Y��黟��H�=E� H�5�5���1�Z���H��dH�%(H�D$1��=� tH�=
� H�5L5詜��1�����H�|$��D$荚��H�T$dH3%(t����H�����V�=�� u�p���H�5.BY������H�=�� H�5�4�>���1�Z���UH��SH��WH��wH��!�p1ҹH��H�=y9誘����u��H�EH�5�� H�xH9�uH�n� H�5�CH�:�כ���i蠗����u�H�}���Ń��u���H��t�D��=�� tH�=� H�524菛���!��t�$�����]���YH�5�8[��]�3���Z1�[]���V�=�� u��H�5�:Y������H�=�� H�5�3�1���1�Z���SH��H�~H�5�� H9�uH��� H�5�BH�8����X�Ȗ����u�H�������Ã��t�=2� t!H�=-� H�5l3�ɚ���"��H��t�����ė��H�5a:[���l���1�[���V�=� u�N���H�5H:Y���F���H�=� H�53�l���1�Z���V�=�� u�Տ��H�5:Y���
���H�=�� H�5�2�3���1�Z���SH��H�~H�5�� H9�uH��� H�5�AH�8�����d�ʕ����u�H�������Ã��t�=4� t!H�=/� H�5n2�˙���.��H��t��"���ƙ��Hc����u
H�5�9[�h���[�ۗ��1�[���UH��SH��WH��wH��!�p1ҹH��H�=�6������u��H�EH�5�� H�xH9�uH��� H�5�@H�:�4����i�����u�H�}�P����Ń��u�D���H��t�D��=U� tH�=P� H�5�1����!��t�����j���YH�5C6[��]鐛��Z1�[]���V�=� u萕��Y��闏��H�=�� H�571蔘��1�Z���V�=�� u�ݑ��H�5]8Y���5���H�=�� H�5�0�[���1�Z���V�=�� u�Ԓ��YHc��{���H�=�� H�5�0�(���1�Z���AWAVAUATUH��H��SH��xdH�%(H�D$h1�H�F�D$ �D$H�D$(H��t=
H��t�H��tLH��ts�1�H�T$0H�5�7艎�������1�H�L$(H�T$0H�5�7�d�����uz�~1�H�L$H�T$ L�D$0H�5W7�>������YA��K1�H�L$H�T$ L�L$(L�D$0H�5/7������u��&H��� H�5�DH�8�
���1���E1�L�t$0�T$ H�\$(D�|$I�N�T$H�����scL�d$@�L��L������H��tI�VH�5�=�D�\$@E1�L����H�t$8���D$<D�\$8�ʑ��E��H�}������sL���*���H��u
L���
�����bI�~H;=� u1H�t$$L���>����|$$tAL�� H�5�0I�8�!���1���H�WH�5O=H�-�� 1�H�}轎��1��A��A��L9�tL��� H�5�.1�I�:蓎��1��H�}E��u9�_�t$D��L�-�5讋�����tWH�}L��蝔���IL��L�-}5茔���8�t$D��L�-t5�w������t D��H�}	��D������L�-Q5	��2���L���������H�\$hdH3%(t迒��H��x[]A\A]A^A_�USH��H��dH�%(H�D$1�H�GH�����s1�H�������H�EH��uP�L��s*H�1�H�>H��膊�����y/H�u(H��蠓��1��H�=-� H�P1�H�5�4H�?�P���1�H�L$dH3%(��t����H��[]���AWAVAUATUSH��H��H��XdH�%(H�D$H1�H�F�D$$�D$ H�D$(H��tGH��t��H��tfH������1�H�L$H�T$0H�5 4�ˊ�������1�H�L$H�T$0L�D$(H�54衊�������E1��1�H�L$ H�T$$L�L$L�D$0H�5�3�j�����t\1�A��^H�L$ H�T$$P1�H�t$0VH�5�3L�L$,L�D$@�3���ZY��t#�A��"H�=�� H�5"AH�?�*���1��T1�E1���H�T$(�L$$H�t$8H�D$8H�|$0D�d$H�D$@H�$H�T$@D�|$ �L$���A��1�E����E1��tH�{H��tD�o�4$D�D$�Z���D�D$H�{A��uRE��t*�t$D��芈��A�ƃ��t&H�{H�t$@D������A���H�t$@D�����A��H�|$@L�%u2�ˈ���_L�L$8M�Q E��t-�t$D��L�$�+���A�ƃ��t#H�{H�4$D���#���A���D��L������A��H�|$8L�%'2H�u�ڐ����tH�{D��芒��L��D��薔��H�\$HdH3%(t�J���H��X[]A\A]A^A_���AWAVAUATUH��H��SH��HdH�%(H�D$81�H�F�D$�D$H�D$H��t=
H��t�H��tXH��t}�1�H�T$ H�5�1���������1�H�L$H�T$ H�5n1�������A�1��1�H�L$H�T$L�D$ H�5/1蹇����tSE1��U1�H�L$H�T$L�L$L�D$ H�5
1艇����t#A���"H�=� H�5�>H�?肐��1��;E1�1���H�T$�L$H�t$(H�D$(H�|$ D�t$H�D$0H�T$H�T$0�L$����A��1�E����E1�E��tH�}H��tD�o�t$蹐��H�}A��uN��t(�t$D������Ã��t$H�}H�t$0���g������H�t$0���V�����H�|$0L�50�3����VH�t$(L�~ ��t&�t$D��蘅���Ã��t H�}��L��蒍�����
��L��胍����H�|$(L�5�/H�u�K���E��tH�}D�����L��������H�L$8dH3%(t軌��H��H[]A\A]A^A_���AWAVAUATUSH��H��H��XdH�%(H�D$H1�H�F�D$$�D$ H�D$(H��tGH��t��H��tfH������1�H�L$H�T$0H�5/�w��������1�H�L$H�T$0L�D$(H�5�.�M��������E1��1�H�L$ H�T$$L�L$L�D$0H�5�.������t\1�A��^H�L$ H�T$$P1�H�t$0VH�5�.L�L$,L�D$@�߄��ZY��t#�A��"H�=m� H�56<H�?�֍��1��T1�E1���H�T$(�L$$H�t$8H�D$8H�|$0D�d$H�D$@H�$H�T$@D�|$ �L$�e���A��1�E����E1��tH�{H��tD�o�4$D�D$����D�D$H�{A��uRE��t*�t$D���6���A�ƃ��t&H�{H�t$@D���
���A���H�t$@D�����A��H�|$@L�%d-�w����_L�L$8M�Q E��t-�t$D��L�$�ׂ��A�ƃ��t#H�{H�4$D������A���D��L���o���A��H�|$8L�%-H�u膋����tH�{D���6���L��D���B���H�\$HdH3%(t���H��X[]A\A]A^A_���AWAVAUATUH��H��SH��HdH�%(H�D$81�H�F�D$�D$H�D$H��t=
H��t�H��tXH��t}�1�H�T$ H�5x,輂�������1�H�L$H�T$ H�5^,藂������A�1��1�H�L$H�T$L�D$ H�5,�e�����tSE1��U1�H�L$H�T$L�L$L�D$ H�5�+�5�����t#A���"H�=�� H�5�9H�?�.���1��;E1�1���H�T$�L$H�t$(H�D$(H�|$ D�t$H�D$0H�T$H�T$0�L$���A��1�E����E1�E��tH�}H��tD�o�t$�e���H�}A��uN��t(�t$D��蛀���Ã��t$H�}H�t$0���s������H�t$0���b�����H�|$0L�5�*�߀���VH�t$(L�~ ��t&�t$D���D����Ã��t H�}��L��������
��L���߅����H�|$(L�5�*H�u���E��tH�}D��覊��L����賌��H�L$8dH3%(t�g���H��H[]A\A]A^A_���SH��H��H�~H�5Y� dH�%(H�D$1�H9�uH�=� H�561H�?膉��1��(�J�����u�H�����H��H���u��茂��H��1�H��tO�H=���}H�� H�5�7H�:�/���1���H=�~H��� H�58H�8�
���1���=P� tH�=K� H�5�!���1���=9� tH�=(� H�5I!�Ĉ��1��iH�L$H�T$��H�t$�J�����u2H�5�� H�=�� ;|H�5�7興��1��-H�5))�x���1���L$�T$H�=,)1��t$跉��H�L$dH3%(t�҅��H��[���AVAUATUSH��H�� dH�%(H�D$1�H��uH�H�-�� H�xH9�u'�(H�ֹ�H�=�(肄����u��kH��衃������H�;�A���I��H���u���H��tO�;H=���}H�
r� H�5S6H�9苇��1��sH=�~H�M� H�5^6H�:�f���1��NH�sH�~H9�tH��������usH�{�m���A�ƃ��tH�{H�H9�u�S�Q���H��t��H���߂����u8H�{�2���A�Ń��tL�CI�xH9�u�����H��t��qH��观����tL�T� H�5m.I�:轆��1��H�{�݅���Ń��t.H�K L�IA���u*H�$H�5`'H�=N'�
����
���H��t�1��YH���2����=�� tH�=�� H�5��F���1��1H��fD�$$D�t$D�l$�l$�D$��z��H�5�&���܈����H�T$dH3%(t范��H�� []A\A]A^���SH��H�~H�5�� H9�uH�
X� H�5q-H�9����臁����u�H���+~��H���u"��~��H��uqH�l� H�5�4H�:腅���YH��x�H=�~H�G� H�5�4H�8�`����4�=�� tH�=�� H�5��B������艀��H�5&[����1�[���AVAUATUSH��H��uH�H�-�� H�xH9�u'�H�ֹ�H�=�%老����u���H��蟀������H�;�?}��I��H���u��}��H��t�H=����H=��(H�SH�zH9���H���F�������H�{��|��I��H���u�}��H��t�`H=�����H=���H�KH�yH9�tNH��������uBH�{�|��I��H���u�5}��H��t�H=���|iH=���H�sH�~H9�uL�
[� H�5t+I�9�ă����H�������u�H�{�*|��H��H���u��|��H��tH�H=���}L�[� H�5<2I�8�t����H=�~H�=8� H�5I2H�?�Q����b�=�� tH�=�� H�5��3����D�=�� tH�=y� H�5������&D��D���D���s}��[H�5�#]��A\A]A^鴅��[1�]A\A]A^���AUATUSH��WH��uH�H�-l� H�xH9�u'�H�ֹ�H�=�#�=����u��H���\~������H�;�z��I��H���u�{��H��t�UH=�����H=���H�SH�zH9�tJH���~����u>H�{�z��I��H���u�L{��H��t�H=���|eH=�}H�KH�yH9�uL�
v� H�5�)I�9�߁����H���}����u�H�{�Ez��H��H���u��z��H��tE�H=���}L�v� H�5W0I�8菁���~H=�~H�=V� H�5g0H�?�o����^�=�� tH�=�� H�5��Q����@�=�� tH�=�� H�5��3����"D��D����$|��YH�5"[��]A\A]�փ��Z1�[]A\A]���SH��H��H�~H�5�� dH�%(H�D$1�H9�uH�=Z� H�5s(H�?�À��1���|����u�H���+y��H��H���u����y��H��1�H��tO��H=���}H�S� H�54/H�:�l���1���H=�~H�.� H�5?/H�8�G���1���=�� tH�=�� H�5��$���1���=y� tH�=h� H�5�����1��_H�T$H�t$���oy����u2H�5�� H�=5� ;|H�5�/����1��(H�5� ���1���T$�t$H�=�1�����H�L$dH3%(t�}��H��[���SH��H�~H�5� H9�uH�
� H�5'H�9�X����{����u�H����w��H��H���u�dx��H��tE�H=���}H�� H�5�-H�:����mH=�~H�� H�5�-H�8��~���M�=7� tH�=2� H�5q��~���/�=%� tH�=� H�55�~�����[�������|��1�[�I�.��E1��L���o}���uH���b}���1I��L���R}��L9��y���u����L���2}���
L���%}����L���}���L���}���CH���|���H����|���L����|���xL����|���5L����|����L���|���H���|���jH���|���&L���|����
L���|���
L���||���]
L���o|���
H���b|����H���U|���L���H|���NL���;|���L���.|����L���!|���H���|���@H���|���
L���{���
L����{���v
L����{���3
L����{����	H����{���	H���{���g	L���{���$	L���{����L���{���L���{���]H���x{���H���k{����L���^{���L���Q{���OL���D{���L���7{����H���*{���H���{���@L���{���L���{���L���z���wL����z���3H����z����H����z���L����z���hL���z���%L���z����L���z���H���z���]H���z���L���tz����H�5� H�>�t��������z���L���Fz���EL���9z���L���,z���I�.�����L���z���:I�.�����L��E1��y��� L����y���f���AWAVAUATUSH��H�=ǽ ��p�����;���H��� H��|��H�
}|����H�I|��H�="� H�#� H�� H�
� H�� �z��H�D$H�����H���v��H��H������1�H�5vH�=�� H��� �st��H�5dH��I��H���o��I�,$����1�1�H�=G��w��H�5�H��H��H�W� ��n��H�=���u��H�5k H��I��H����n��L��H�5H���n��I�m�k���H�=l� uH�5� H�=D� �v�����4H�=0� �;w��I��H�����w��I�F�r��I��H���@�����w��I�F �}r��H���
�����3�zw��I�F(�ar��H�������L��H�5�H���n��I�.�����H�=�� H�5GH��� H��� �Cw�����\���H���w��I��H��t$H�=� H��H�5R�m����u
I�/����1���v��H��H��t$H�=�� H��H�5��qm����u
H�+���������v��H��H��t%H�=�� H��H�5��;m����uH�m�����1��uv��I��H��t%H�=f� H��H�5}�m����uI�,$�U�����>v��I��H��t%H�=/� H��H�5O��l����uI�m������v��I��H��t$H�=�� H��H�5#�l����u
I�.�������u��I��H��t$H�=�� H��H�5��cl����u
I�/�������u��H��H��t$H�=�� H��H�5��-l����u
H�+�H�����eu��H��H��t%H�=V� H��H�5��k����uH�m����� �.u��I��H��t%H�=� H��H�5n�k����uI�,$������@�t��I��H��t%H�=�� H��H�5>�k����uI�m�|������t��I��H��t$H�=�� H��H�5�Rk����u
I�.�9�����t��I��H��t$H�={� H��H�5��k����u
I�/��������Tt��H��H��t$H�=E� H��H�5���j����u
H�+��������t��H��H��t%H�=� H��H�5��j����uH�m�o������s��I��H��t%H�=�� H��H�5`�yj����uI�,$�+�����s��I��H��t%H�=�� H��H�56�Bj����uI�m�����ys��I��H��t$H�=j� H��H�5�j����u
I�.�������Cs��I��H��t$H�=4� H��H�5���i����u
I�/�a���� �
s��H��H��t$H�=�� H��H�5��i����u
H�+�����@��r��H��H��t%H�=�� H��H�5x�ii����uH�m�������r��I��H��t%H�=�� H��H�5L�2i����uI�,$�����1��lr��I��H��t%H�=]� H��H�5!�h����uI�m�U�����5r��I��H��t$H�=&� H��H�5���h����u
I�.������q��I��H��t$H�=�� H��H�5��h����u
I�/�������q��H��H��t$H�=�� H��H�5��[h����u
H�+�������q��H��H��t%H�=�� H��H�5w�%h����uH�m�H�����\q��I��H��t%H�=M� H��H�5K��g����uI�,$������%q��I��H��t%H�=� H��H�5"�g����uI�m��������p��I��H��t$H�=�� H��H�5��g����u
I�.�}�����p��I��H��t$H�=�� H��H�5��Jg����u
I�/�:�����p��H��H��t$H�=s� H��H�5��g����u
H�+����Lp��H��H��t%H�==� H��H�5���f����uH�m����p��I��H��t%H�=� H��H�5Z�f����uI�,$�o���o��I��H��t%H�=�� H��H�5:�pf����uI�m�+�@�o��I��H��t$H�=�� H��H�5�9f����u
I�.��� �qo��I��H��t$H�=b� H��H�5��f����u
I�/�����;o��H��H��t$H�=,� H��H�5���e����u
H�+�b��o��H��H��t%H�=�� H��H�5��e����uH�m����n��I��H��t%H�=�� H��H�5��`e����uI�,$����n��I��H��t%H�=�� H��H�5i�)e����uI�m����`n��I��H��t$H�=Q� H��H�5B��d����u
I�.�S��*n��I��H��t$H�=� H��H�5�d����u
I�/�� ��m��H��H��t$H�=�� H��H�5��d����u
H�+���@�m��H��H��t%H�=�� H��H�5��Pd����uH�m����m��I��H��t%H�=x� H��H�5��d����uI�,$�E���Pm��I��H��t%H�=A� H��H�5���c����uI�m���m��I��H��t$H�=
� H��H�5k�c����u
I�.�����l��I��H��t$H�=�� H��H�5E�uc����u
I�/�{��l��H��H��t$H�=�� H��H�5&�?c����u
H�+�8��wl��H��H��t%H�=h� H��H�5�	c����uH�m�����@l��I��H��t%H�=1� H��H�5���b����uI�,$�����	l��I��H��t%H�=�� H��H�5��b����uI�m�l�������k��I��H��t$H�=�� H��H�5��db����u
I�.�)���k��I��H��t$H�=�� H��H�5a�.b����u
I�/����L�-XL�%]�Lff.�H���Hk��I��H��t H�=9� H��H����a����u
I�/�s�H��H����\���m��H��H��t�H��L���A��A��E��tƹH��L���A��A��E���x���H��� f��H�x�m��I��H����D�E����E�Z�A����D��SH�@L�C���i�r�@���|�E�HH��I�xE���DE�y�A���vD�D�_H��L�WE���E�C�A���oD�A�RH��I�r�����J؀��h�D�NH��H�~E����E�y�A���bD�D�_H��L�WE����E�C�A���[D�A�RH��I�J�����r�@���T��yH��L�I@��tfD��A���R@�8E�YH��M�QE��tCE�C�A���OD�A�RH��I�J��t!�r�@���TH���H�����u��H���i��I��H���W�H�=�� H��L���_�����=�I�/�+�L9������L��H���a��H����������h��H��H��t%H�=�� H��H�5��;_����uH�m������rh��I��H��t%H�=c� H��H�5h�_����uI�m�~�H�� L�d$H�5�H�L���^��H��L��[]A\A]A^A_�@�SL�C���P�J؀������@E�HI�xE������E�y�A�������D�_L�WE�������E�C�A�������A�RI�r��������J؀������D�NH�~E���q���E�y�A�������D�_L�WE���Q���E�C�A�������A�RI�J���2����r�@��������yL�I@������D��A�������E�YM�QE����E�C�A�������A�RI�J�������r�@��������H�������������ff.��L�����������f.�@H�=�� H��� H9�tH�Ϊ H��t	�����H�=y� H�5r� H)�H��H��H��?H�H�tH��� H��t��fD�����=5� u+UH�=z� H��tH�=.� �b���d����
� ]������w�����H��H���must call start_color() firstmust call initscr() firstencoding may not be deleted%s() returned ERRii;y,xwmovebyte doesn't fit in chtypeuntouchwiniii:touchlinei;delayi;True(1) or False(0)syncokutf-8wsetscrregscrollokii;lines,columnswresizeredrawlnredrawwinputwiny#notimeoutnodelaymvwinmvderwinleaveoksetsyxkeypadi;n'n' must be nonnegativeiii;y,x,ni;nlineswinsdellnwdeletelnwinsertlnidlokii(ii)weraseencloseattrsetechocharclearokOO:boxborderbkgdsetl;attril;n,attriil;int,int,attriiil;int,int,n,attrchgatint doesn't fit in longunget_wchungetchy:putpiiOi:vlineiiOil:vlineiiii:subwini:scrolliiiiii:refreshprefreshO!:overwriteO!iiiiii:overwritecopywinO!:overlayO!iiiiii:overlayiiiiii:noutrefreshpnoutrefreshwnoutrefreshiiO:inschiiOl:inschii:inchiiOi:hlineiiOil:hlineii:get_wchno inputii:getchii:getkeyinvalid key numberiiii:derwinii:delchmvwdelchattronattrofftypeaheady|iiiiiiiii:tparmtparm() returned NULLargumenttigetstrembedded null charactertigetnumtigetflagCOLORSCOLOR_PAIRSstart_color() returned ERRsetupterm: unknown errorstr or Noneargument 'term'setuptermlost sys.stdoutsavettyresize_termresizetermresettyreset_shell_modereset_prog_modenorawnonlnoechonocbreakiiii:newwinnewpadintmousemask(kk)mouseintervalmetais_term_resizedintrflushACS_ULCORNERACS_LLCORNERACS_URCORNERACS_LRCORNERACS_LTEEACS_RTEEACS_BTEEACS_TTEEACS_HLINEACS_VLINEACS_PLUSACS_S1ACS_S9ACS_DIAMONDACS_CKBOARDACS_DEGREEACS_PLMINUSACS_BULLETACS_LARROWACS_RARROWACS_DARROWACS_UARROWACS_BOARDACS_LANTERNACS_BLOCKACS_BSSBACS_SSBBACS_BBSSACS_SBBSACS_SBSSACS_SSSBACS_SSBSACS_BSSSACS_BSBSACS_SBSBACS_SSSSACS_S3ACS_S7ACS_LEQUALACS_GEQUALACS_PIACS_NEQUALACS_STERLINGLINESCOLSgetmouse() returned ERR(hiiik)flashdoupdatedelay_outputdef_shell_modedef_prog_modecurs_setbeepadd_wchiiO:addchiiOl:addchexpect bytes or str, got %saddnwstriiOi:addnstriiOil:addnstraddwstriiO:addstriiOl:addstrinsn_wstriiOi:insnstriiOil:insnstrinswstriiO:insstriiOl:insstrcolor_content() returned ERR(iii)ungetmouseargument 5halfdelayinit_colorinit_pairpair_content() returned ERR_curses._C_API_curses.error__version____new__OKA_ATTRIBUTESA_NORMALA_STANDOUTA_UNDERLINEA_REVERSEA_BLINKA_DIMA_BOLDA_ALTCHARSETA_INVISA_PROTECTA_CHARTEXTA_COLORA_HORIZONTALA_LEFTA_LOWA_RIGHTA_TOPA_VERTICALA_ITALICCOLOR_BLACKCOLOR_REDCOLOR_GREENCOLOR_YELLOWCOLOR_BLUECOLOR_MAGENTACOLOR_CYANCOLOR_WHITEBUTTON1_PRESSEDBUTTON1_RELEASEDBUTTON1_CLICKEDBUTTON1_DOUBLE_CLICKEDBUTTON1_TRIPLE_CLICKEDBUTTON2_PRESSEDBUTTON2_RELEASEDBUTTON2_CLICKEDBUTTON2_DOUBLE_CLICKEDBUTTON2_TRIPLE_CLICKEDBUTTON3_PRESSEDBUTTON3_RELEASEDBUTTON3_CLICKEDBUTTON3_DOUBLE_CLICKEDBUTTON3_TRIPLE_CLICKEDBUTTON4_PRESSEDBUTTON4_RELEASEDBUTTON4_CLICKEDBUTTON4_DOUBLE_CLICKEDBUTTON4_TRIPLE_CLICKEDBUTTON_SHIFTBUTTON_CTRLBUTTON_ALTALL_MOUSE_EVENTSREPORT_MOUSE_POSITIONUNKNOWN KEYKEY_F(KEY_MINKEY_MAXclearclrtobotclrtoeolcursyncupgetbegyxgetbkgdgetmaxyxgetparyxgetyxidcokimmedokinstris_linetouchedis_wintouchedstandendstandoutsubpadsyncdownencodingmajorMajor release numberminorMinor release numberpatchPatch release numberbaudratecan_change_colorcolor_contentcolor_pairerasecharfilterflushinpgetsyxgetwinhas_colorshas_ichas_ilhas_keyinitscrisendwinkeynamekillcharlongnamenapmsnoqiflushpair_contentpair_numberstart_colortermattrstermnameunctrlupdate_lines_colsuse_envuse_default_colorsfdcurses.ncurses_version_cursesread_curses.windowmust call (at least) setupterm() firstsetting encoding to a non-stringexpect bytes or str of length 1, or int, got a str of length %ziexpect bytes or str of length 1, or int, got %s_curses.window.touchline requires 2 to 3 argumentsinteger argument expected, got floatinstr requires 0 or 3 argumentsgetstr requires 0 to 3 arguments_curses.window.box requires 0 to 2 argumentschgat requires 1 to 4 argumentsexpect str of length 1 or int, got a str of length %zicharacter doesn't fit in wchar_texpect str of length 1 or int, got %sf.read() returned %.100s instead of bytes_curses.window.vline requires 2 to 5 arguments_curses.window.subwin requires 2 to 4 arguments_curses.window.scroll requires 0 to 1 arguments_curses.window.refresh requires 0 to 6 argumentsrefresh() for a pad requires 6 argumentsrefresh() takes no arguments (6 given)_curses.window.overwrite requires 1 to 7 arguments_curses.window.overlay requires 1 to 7 arguments_curses.window.noutrefresh requires 0 to 6 argumentsnoutrefresh() called for a pad requires 6 argumentsnoutrefresh() takes no arguments (6 given)is_linetouched: line number outside of boundaries_curses.window.insch requires 1 to 4 arguments_curses.window.inch requires 0 to 2 arguments_curses.window.hline requires 2 to 5 arguments_curses.window.get_wch requires 0 to 2 arguments_curses.window.getch requires 0 to 2 arguments_curses.window.getkey requires 0 to 2 arguments_curses.window.derwin requires 2 to 4 arguments_curses.window.delch requires 0 to 2 argumentsuse_default_colors() returned ERRsetupterm: could not find terminalsetupterm: could not find terminfo database_curses.newwin requires 2 to 4 arguments_curses.window.addch requires 1 to 4 arguments_curses.window.addnstr requires 2 to 5 arguments_curses.window.addstr requires 1 to 4 arguments_curses.window.insnstr requires 2 to 5 arguments_curses.window.insstr requires 1 to 4 argumentssigned short integer is less than minimumsigned short integer is greater than maximumArgument 1 was out of range. Check value of COLORS.unsigned byte integer is less than minimumunsigned byte integer is greater than maximumArgument 1 was out of range. (0..COLOR_PAIRS-1)the typecode character used to create the arrayvline([y, x,] ch, n, [attr=_curses.A_NORMAL])
Display a vertical line.

  y
    Starting Y-coordinate.
  x
    Starting X-coordinate.
  ch
    Character to draw.
  n
    Line length.
  attr
    Attributes for the character.touchline(start, count, [changed=True])
Pretend count lines have been changed, starting with line start.

If changed is supplied, it specifies whether the affected lines are marked
as having been changed (changed=True) or unchanged (changed=False).subwin([nlines=0, ncols=0,] begin_y, begin_x)
Create a sub-window (screen-relative coordinates).

  nlines
    Height.
  ncols
    Width.
  begin_y
    Top side y-coordinate.
  begin_x
    Left side x-coordinate.

By default, the sub-window will extend from the specified position to the
lower right corner of the window.setscrreg($self, top, bottom, /)
--

Define a software scrolling region.

  top
    First line number.
  bottom
    Last line number.

All scrolling actions will take place in this region.scroll([lines=1])
Scroll the screen or scrolling region.

  lines
    Number of lines to scroll.

Scroll upward if the argument is positive and downward if it is negative.refresh([pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol])
Update the display immediately.

Synchronize actual screen with previous drawing/deleting methods.
The 6 optional arguments can only be specified when the window is a pad
created with newpad().  The additional parameters are needed to indicate
what part of the pad and screen are involved.  pminrow and pmincol specify
the upper left-hand corner of the rectangle to be displayed in the pad.
sminrow, smincol, smaxrow, and smaxcol specify the edges of the rectangle to
be displayed on the screen.  The lower right-hand corner of the rectangle to
be displayed in the pad is calculated from the screen coordinates, since the
rectangles must be the same size.  Both rectangles must be entirely contained
within their respective structures.  Negative values of pminrow, pmincol,
sminrow, or smincol are treated as if they were zero.redrawln($self, beg, num, /)
--

Mark the specified lines corrupted.

  beg
    Starting line number.
  num
    The number of lines.

They should be completely redrawn on the next refresh() call.putwin($self, file, /)
--

Write all data associated with the window into the provided file object.

This information can be later retrieved using the getwin() function.overwrite(destwin, [sminrow, smincol, dminrow, dmincol, dmaxrow,
          dmaxcol])
Overwrite the window on top of destwin.

The windows need not be the same size, in which case only the overlapping
region is copied.  This copy is destructive, which means that the current
background character overwrites the old contents of destwin.

To get fine-grained control over the copied region, the second form of
overwrite() can be used. sminrow and smincol are the upper-left coordinates
of the source window, the other variables mark a rectangle in the destination
window.overlay(destwin, [sminrow, smincol, dminrow, dmincol, dmaxrow, dmaxcol])
Overlay the window on top of destwin.

The windows need not be the same size, only the overlapping region is copied.
This copy is non-destructive, which means that the current background
character does not overwrite the old contents of destwin.

To get fine-grained control over the copied region, the second form of
overlay() can be used.  sminrow and smincol are the upper-left coordinates
of the source window, and the other variables mark a rectangle in the
destination window.noutrefresh([pminrow, pmincol, sminrow, smincol, smaxrow, smaxcol])
Mark for refresh but wait.

This function updates the data structure representing the desired state of the
window, but does not force an update of the physical screen.  To accomplish
that, call doupdate().is_linetouched($self, line, /)
--

Return True if the specified line was modified, otherwise return False.

  line
    Line number.

Raise a curses.error exception if line is not valid for the given window.insstr([y, x,] str, [attr])
Insert the string before the current or specified position.

  y
    Y-coordinate.
  x
    X-coordinate.
  str
    String to insert.
  attr
    Attributes for characters.

Insert a character string (as many characters as will fit on the line)
before the character under the cursor.  All characters to the right of
the cursor are shifted right, with the rightmost characters on the line
being lost.  The cursor position does not change (after moving to y, x,
if specified).insnstr([y, x,] str, n, [attr])
Insert at most n characters of the string.

  y
    Y-coordinate.
  x
    X-coordinate.
  str
    String to insert.
  n
    Maximal number of characters.
  attr
    Attributes for characters.

Insert a character string (as many characters as will fit on the line)
before the character under the cursor, up to n characters.  If n is zero
or negative, the entire string is inserted.  All characters to the right
of the cursor are shifted right, with the rightmost characters on the line
being lost.  The cursor position does not change (after moving to y, x, if
specified).insch([y, x,] ch, [attr=_curses.A_NORMAL])
Insert a character before the current or specified position.

  y
    Y-coordinate.
  x
    X-coordinate.
  ch
    Character to insert.
  attr
    Attributes for the character.

All characters to the right of the cursor are shifted one position right, with
the rightmost characters on the line being lost.inch([y, x])
Return the character at the given position in the window.

  y
    Y-coordinate.
  x
    X-coordinate.

The bottom 8 bits are the character proper, and upper bits are the attributes.hline([y, x,] ch, n, [attr=_curses.A_NORMAL])
Display a horizontal line.

  y
    Starting Y-coordinate.
  x
    Starting X-coordinate.
  ch
    Character to draw.
  n
    Line length.
  attr
    Attributes for the characters.get_wch([y, x])
Get a wide character from terminal keyboard.

  y
    Y-coordinate.
  x
    X-coordinate.

Return a character for most keys, or an integer for function keys,
keypad keys, and other special keys.getkey([y, x])
Get a character (string) from terminal keyboard.

  y
    Y-coordinate.
  x
    X-coordinate.

Returning a string instead of an integer, as getch() does.  Function keys,
keypad keys and other special keys return a multibyte string containing the
key name.  In no-delay mode, an exception is raised if there is no input.getch([y, x])
Get a character code from terminal keyboard.

  y
    Y-coordinate.
  x
    X-coordinate.

The integer returned does not have to be in ASCII range: function keys,
keypad keys and so on return numbers higher than 256.  In no-delay mode, -1
is returned if there is no input, else getch() waits until a key is pressed.getbkgd($self, /)
--

Return the window's current background character/attribute pair.enclose($self, y, x, /)
--

Return True if the screen-relative coordinates are enclosed by the window.

  y
    Y-coordinate.
  x
    X-coordinate.echochar($self, ch, attr=_curses.A_NORMAL, /)
--

Add character ch with attribute attr, and refresh.

  ch
    Character to add.
  attr
    Attributes for the character.derwin([nlines=0, ncols=0,] begin_y, begin_x)
Create a sub-window (window-relative coordinates).

  nlines
    Height.
  ncols
    Width.
  begin_y
    Top side y-coordinate.
  begin_x
    Left side x-coordinate.

derwin() is the same as calling subwin(), except that begin_y and begin_x
are relative to the origin of the window, rather than relative to the entire
screen.delch([y, x])
Delete any character at (y, x).

  y
    Y-coordinate.
  x
    X-coordinate.box([verch=0, horch=0])
Draw a border around the edges of the window.

  verch
    Left and right side.
  horch
    Top and bottom side.

Similar to border(), but both ls and rs are verch and both ts and bs are
horch.  The default corner characters are always used by this function.border($self, ls=_curses.ACS_VLINE, rs=_curses.ACS_VLINE,
       ts=_curses.ACS_HLINE, bs=_curses.ACS_HLINE,
       tl=_curses.ACS_ULCORNER, tr=_curses.ACS_URCORNER,
       bl=_curses.ACS_LLCORNER, br=_curses.ACS_LRCORNER, /)
--

Draw a border around the edges of the window.

  ls
    Left side.
  rs
    Right side.
  ts
    Top side.
  bs
    Bottom side.
  tl
    Upper-left corner.
  tr
    Upper-right corner.
  bl
    Bottom-left corner.
  br
    Bottom-right corner.

Each parameter specifies the character to use for a specific part of the
border.  The characters can be specified as integers or as one-character
strings.  A 0 value for any parameter will cause the default character to be
used for that parameter.bkgdset($self, ch, attr=_curses.A_NORMAL, /)
--

Set the window's background.

  ch
    Background character.
  attr
    Background attributes.bkgd($self, ch, attr=_curses.A_NORMAL, /)
--

Set the background property of the window.

  ch
    Background character.
  attr
    Background attributes.attrset($self, attr, /)
--

Set the "background" set of attributes.attron($self, attr, /)
--

Add attribute attr from the "background" set.attroff($self, attr, /)
--

Remove attribute attr from the "background" set.addstr([y, x,] str, [attr])
Paint the string.

  y
    Y-coordinate.
  x
    X-coordinate.
  str
    String to add.
  attr
    Attributes for characters.

Paint the string str at (y, x) with attributes attr,
overwriting anything previously on the display.
By default, the character position and attributes are the
current settings for the window object.addnstr([y, x,] str, n, [attr])
Paint at most n characters of the string.

  y
    Y-coordinate.
  x
    X-coordinate.
  str
    String to add.
  n
    Maximal number of characters.
  attr
    Attributes for characters.

Paint at most n characters of the string str at (y, x) with
attributes attr, overwriting anything previously on the display.
By default, the character position and attributes are the
current settings for the window object.addch([y, x,] ch, [attr=_curses.A_NORMAL])
Paint the character.

  y
    Y-coordinate.
  x
    X-coordinate.
  ch
    Character to add.
  attr
    Attributes for the character.

Paint character ch at (y, x) with attributes attr,
overwriting any character previously painted at that location.
By default, the character position and attributes are the
current settings for the window object.curses.ncurses_version

Ncurses version information as a named tuple.use_default_colors($module, /)
--

Allow use of default values for colors on terminals supporting this feature.

Use this to support transparency in your application.  The default color
is assigned to the color number -1.use_env($module, flag, /)
--

Use environment variables LINES and COLUMNS.

If used, this function should be called before initscr() or newterm() are
called.

When flag is False, the values of lines and columns specified in the terminfo
database will be used, even if environment variables LINES and COLUMNS (used
by default) are set, or if curses is running in a window (in which case
default behavior would be to use the window size if LINES and COLUMNS are
not set).unget_wch($module, ch, /)
--

Push ch so the next get_wch() will return it.update_lines_cols($module, /)
--

ungetch($module, ch, /)
--

Push ch so the next getch() will return it.unctrl($module, ch, /)
--

Return a string which is a printable representation of the character ch.

Control characters are displayed as a caret followed by the character,
for example as ^C.  Printing characters are left as they are.typeahead($module, fd, /)
--

Specify that the file descriptor fd be used for typeahead checking.

  fd
    File descriptor.

If fd is -1, then no typeahead checking is done.tparm($module, str, i1=0, i2=0, i3=0, i4=0, i5=0, i6=0, i7=0, i8=0,
      i9=0, /)
--

Instantiate the specified byte string with the supplied parameters.

  str
    Parameterized byte string obtained from the terminfo database.tigetstr($module, capname, /)
--

Return the value of the string capability.

  capname
    The terminfo capability name.

None is returned if capname is not a string capability, or is canceled or
absent from the terminal description.tigetnum($module, capname, /)
--

Return the value of the numeric capability.

  capname
    The terminfo capability name.

The value -2 is returned if capname is not a numeric capability, or -1 if
it is canceled or absent from the terminal description.tigetflag($module, capname, /)
--

Return the value of the Boolean capability.

  capname
    The terminfo capability name.

The value -1 is returned if capname is not a Boolean capability, or 0 if
it is canceled or absent from the terminal description.termname($module, /)
--

Return the value of the environment variable TERM, truncated to 14 characters.termattrs($module, /)
--

Return a logical OR of all video attributes supported by the terminal.start_color($module, /)
--

Initializes eight basic colors and global variables COLORS and COLOR_PAIRS.

Must be called if the programmer wants to use colors, and before any other
color manipulation routine is called.  It is good practice to call this
routine right after initscr().

It also restores the colors on the terminal to the values they had when the
terminal was just turned on.setupterm($module, /, term=None, fd=-1)
--

Initialize the terminal.

  term
    Terminal name.
    If omitted, the value of the TERM environment variable will be used.
  fd
    File descriptor to which any initialization sequences will be sent.
    If not supplied, the file descriptor for sys.stdout will be used.setsyx($module, y, x, /)
--

Set the virtual screen cursor.

  y
    Y-coordinate.
  x
    X-coordinate.

If y and x are both -1, then leaveok is set.savetty($module, /)
--

Save terminal mode.resize_term($module, nlines, ncols, /)
--

Backend function used by resizeterm(), performing most of the work.

  nlines
    Height.
  ncols
    Width.

When resizing the windows, resize_term() blank-fills the areas that are
extended.  The calling application should fill in these areas with appropriate
data.  The resize_term() function attempts to resize all windows.  However,
due to the calling convention of pads, it is not possible to resize these
without additional interaction with the application.resizeterm($module, nlines, ncols, /)
--

Resize the standard and current windows to the specified dimensions.

  nlines
    Height.
  ncols
    Width.

Adjusts other bookkeeping data used by the curses library that record the
window dimensions (in particular the SIGWINCH handler).resetty($module, /)
--

Restore terminal mode.reset_shell_mode($module, /)
--

Restore the terminal to "shell" mode, as previously saved by def_shell_mode().reset_prog_mode($module, /)
--

Restore the terminal to "program" mode, as previously saved by def_prog_mode().raw($module, flag=True, /)
--

Enter raw mode.

  flag
    If false, the effect is the same as calling noraw().

In raw mode, normal line buffering and processing of interrupt, quit,
suspend, and flow control keys are turned off; characters are presented to
curses input functions one by one.qiflush($module, flag=True, /)
--

Enable queue flushing.

  flag
    If false, the effect is the same as calling noqiflush().

If queue flushing is enabled, all output in the display driver queue
will be flushed when the INTR, QUIT and SUSP characters are read.putp($module, string, /)
--

Emit the value of a specified terminfo capability for the current terminal.

Note that the output of putp() always goes to standard output.pair_number($module, attr, /)
--

Return the number of the color-pair set by the specified attribute value.

color_pair() is the counterpart to this function.pair_content($module, pair_number, /)
--

Return a tuple (fg, bg) containing the colors for the requested color pair.

  pair_number
    The number of the color pair (1 - (COLOR_PAIRS-1)).noraw($module, /)
--

Leave raw mode.

Return to normal "cooked" mode with line buffering.noqiflush($module, /)
--

Disable queue flushing.

When queue flushing is disabled, normal flush of input and output queues
associated with the INTR, QUIT and SUSP characters will not be done.nonl($module, /)
--

Leave newline mode.

Disable translation of return into newline on input, and disable low-level
translation of newline into newline/return on output.noecho($module, /)
--

Leave echo mode.

Echoing of input characters is turned off.nocbreak($module, /)
--

Leave cbreak mode.

Return to normal "cooked" mode with line buffering.nl($module, flag=True, /)
--

Enter newline mode.

  flag
    If false, the effect is the same as calling nonl().

This mode translates the return key into newline on input, and translates
newline into return and line-feed on output.  Newline mode is initially on.newwin(nlines, ncols, [begin_y=0, begin_x=0])
Return a new window.

  nlines
    Height.
  ncols
    Width.
  begin_y
    Top side y-coordinate.
  begin_x
    Left side x-coordinate.

By default, the window will extend from the specified position to the lower
right corner of the screen.newpad($module, nlines, ncols, /)
--

Create and return a pointer to a new pad data structure.

  nlines
    Height.
  ncols
    Width.napms($module, ms, /)
--

Sleep for specified time.

  ms
    Duration in milliseconds.mousemask($module, newmask, /)
--

Set the mouse events to be reported, and return a tuple (availmask, oldmask).

Return a tuple (availmask, oldmask).  availmask indicates which of the
specified mouse events can be reported; on complete failure it returns 0.
oldmask is the previous value of the given window's mouse event mask.
If this function is never called, no mouse events are ever reported.mouseinterval($module, interval, /)
--

Set and retrieve the maximum time between press and release in a click.

  interval
    Time in milliseconds.

Set the maximum time that can elapse between press and release events in
order for them to be recognized as a click, and return the previous interval
value.meta($module, yes, /)
--

Enable/disable meta keys.

If yes is True, allow 8-bit characters to be input.  If yes is False,
allow only 7-bit characters.longname($module, /)
--

Return the terminfo long name field describing the current terminal.

The maximum length of a verbose description is 128 characters.  It is defined
only after the call to initscr().killchar($module, /)
--

Return the user's current line kill character.keyname($module, key, /)
--

Return the name of specified key.

  key
    Key number.is_term_resized($module, nlines, ncols, /)
--

Return True if resize_term() would modify the window structure, False otherwise.

  nlines
    Height.
  ncols
    Width.isendwin($module, /)
--

Return True if endwin() has been called.intrflush($module, flag, /)
--

initscr($module, /)
--

Initialize the library.

Return a WindowObject which represents the whole screen.init_pair($module, pair_number, fg, bg, /)
--

Change the definition of a color-pair.

  pair_number
    The number of the color-pair to be changed (1 - (COLOR_PAIRS-1)).
  fg
    Foreground color number (-1 - (COLORS-1)).
  bg
    Background color number (-1 - (COLORS-1)).

If the color-pair was previously initialized, the screen is refreshed and
all occurrences of that color-pair are changed to the new definition.init_color($module, color_number, r, g, b, /)
--

Change the definition of a color.

  color_number
    The number of the color to be changed (0 - (COLORS-1)).
  r
    Red component (0 - 1000).
  g
    Green component (0 - 1000).
  b
    Blue component (0 - 1000).

When init_color() is used, all occurrences of that color on the screen
immediately change to the new definition.  This function is a no-op on
most terminals; it is active only if can_change_color() returns true.halfdelay($module, tenths, /)
--

Enter half-delay mode.

  tenths
    Maximal blocking delay in tenths of seconds (1 - 255).

Use nocbreak() to leave half-delay mode.has_key($module, key, /)
--

Return True if the current terminal type recognizes a key with that value.

  key
    Key number.has_il($module, /)
--

Return True if the terminal has insert- and delete-line capabilities.has_ic($module, /)
--

Return True if the terminal has insert- and delete-character capabilities.has_colors($module, /)
--

Return True if the terminal can display colors; otherwise, return False.getwin($module, file, /)
--

Read window related data stored in the file by an earlier putwin() call.

The routine then creates and initializes a new window using that data,
returning the new window object.getsyx($module, /)
--

Return the current coordinates of the virtual screen cursor.

Return a (y, x) tuple.  If leaveok is currently true, return (-1, -1).ungetmouse($module, id, x, y, z, bstate, /)
--

Push a KEY_MOUSE event onto the input queue.

The following getmouse() will return the given state data.getmouse($module, /)
--

Retrieve the queued mouse event.

After getch() returns KEY_MOUSE to signal a mouse event, this function
returns a 5-tuple (id, x, y, z, bstate).flushinp($module, /)
--

Flush all input buffers.

This throws away any typeahead that has been typed by the user and has not
yet been processed by the program.flash($module, /)
--

Flash the screen.

That is, change it to reverse-video and then change it back in a short interval.filter($module, /)
--

erasechar($module, /)
--

Return the user's current erase character.endwin($module, /)
--

De-initialize the library, and return terminal to normal status.echo($module, flag=True, /)
--

Enter echo mode.

  flag
    If false, the effect is the same as calling noecho().

In echo mode, each character input is echoed to the screen as it is entered.doupdate($module, /)
--

Update the physical screen to match the virtual screen.delay_output($module, ms, /)
--

Insert a pause in output.

  ms
    Duration in milliseconds.def_shell_mode($module, /)
--

Save the current terminal mode as the "shell" mode.

The "shell" mode is the mode when the running program is not using curses.

Subsequent calls to reset_shell_mode() will restore this mode.def_prog_mode($module, /)
--

Save the current terminal mode as the "program" mode.

The "program" mode is the mode when the running program is using curses.

Subsequent calls to reset_prog_mode() will restore this mode.curs_set($module, visibility, /)
--

Set the cursor state.

  visibility
    0 for invisible, 1 for normal visible, or 2 for very visible.

If the terminal supports the visibility requested, the previous cursor
state is returned; otherwise, an exception is raised.  On many terminals,
the "visible" mode is an underline cursor and the "very visible" mode is
a block cursor.color_pair($module, pair_number, /)
--

Return the attribute value for displaying text in the specified color.

  pair_number
    The number of the color pair.

This attribute value can be combined with A_STANDOUT, A_REVERSE, and the
other A_* attributes.  pair_number() is the counterpart to this function.color_content($module, color_number, /)
--

Return the red, green, and blue (RGB) components of the specified color.

  color_number
    The number of the color (0 - (COLORS-1)).

A 3-tuple is returned, containing the R, G, B values for the given color,
which will be between 0 (no component) and 1000 (maximum amount of component).cbreak($module, flag=True, /)
--

Enter cbreak mode.

  flag
    If false, the effect is the same as calling nocbreak().

In cbreak mode (sometimes called "rare" mode) normal tty line buffering is
turned off and characters are available to be read one by one.  However,
unlike raw mode, special characters (interrupt, quit, suspend, and flow
control) retain their effects on the tty driver and calling program.
Calling first raw() then cbreak() leaves the terminal in cbreak mode.can_change_color($module, /)
--

Return True if the programmer can change the colors displayed by the terminal.beep($module, /)
--

Emit a short attention sound.baudrate($module, /)
--

Return the output speed of the terminal in bits per second.2.2curses function returned NULLcurses function returned ERR;���80��`@�xh��������Z��g���!�<��x�F�A�������:� T�8��d��|���v��� ���l����?���������)���	����0	���P	����p	�����	)����	@����	���
r��� 
����8
����P
%���p
�����
����
1����
]����
�����
���������L��`������������3��a��T{��l��������$���>���^��

��l
&���
����
�
����4���P���t���1�������%���������8��P���������������P����a���4��4���h� ���@!���#��$l$��hh%����&���_'��f(��,A)��L�)���=*����*���:+����,��<�-��T.��l`/����/����/����0���3�� :3��@c4��l�5����5����5���76���p6��D7��Lz7��dJ8����8����8����8����9�� �:��D<��|�<���;=����=���c>����>���>��,�?��d
@����@����K���"L���UL���L��<�L��\TM��t�M����M���-N���fN���:O��sO��8�O��X8P��xqP���	Q����Q���R��IR��4|R��T�U���0V����X��$�[��pI^����`��db��<�d���ze����g����i��<k��`l����o���zRx�$��� 
FJw�?:*3$"D���
\��(PVt��(PV���(PV(����F�A�A ��AB�f�
�_�FC�B��tE�Q \A8 ���B�E�D �A(�G@�(A ABB\e�2Eht�/Ee����E�J0�A�q�jE�Q RA���ET���uE�Q ]A�ET(��B�D�D �sABHi�EY`p�EVHxt��F�E�A �A(�E0�
(H CBBEK(C ABB��uE�Q ]A�n�tE�Q \AH���F�E�A �A(�E0�
(H CBBEK(C ABBPg�-EcHh|�7F�B�B �A(�A0�G� L�@I�@0A(A BBB�g�uE�Q ]A���uE�Q ]A��tE�Q \Ae�tE�Q \A4��uE�Q ]A(T�.F�A�A �"AB��uE�Q ]A�e�EJ(�d��E�D�M��AA���nE�Q VAJ� ETR�"EV4\�qE�Q YAT��uE�Q ]At�qE�Q YA�S�&�e�,�}�(���'���ZCV0���F�A�G �J�� AAB0����D�����E��
ECd'���EQH|,����F�E�A �A(�E0�
(A DBBEK(C ABB0����|E�D�E N
HCEKCA8����.F�B�D �D(�G@(A ABB8���ETP���ETh	���ET����uE�Q ]A�`���ET4�b��� E�A�G@�HBPGXB`P@JAA\�J����F�E�B �B(�D0�D8�D�A�J�E�E�f�_8A0A(B BBB4P����F�B�D �D(�G@�(A ABB8�z����F�B�G �A(�GP�(A ABB4�����F�B�D �D(�G@�(A ABB����4L�c	��uE�o 4	:��5E�D0*A(X	K��LB�H�A �=AB�	k��EX�	q��}H t�	���wH n�	5��gL Z4�	���bM�A�A �t
ABHAB
���EPT4
����F�B�B �B(�A0�G8�Dp�xO�PxAp�8A0A(B BBB �
2��E�J@A�
*���E�G �A`�
����F�B�B �B(�A0�A8�GphxM�PxAp�xA�KxAp}8A0A(B BBB<4;	��gE�J@�HMPNXG`S@wHBPGXE`[@@A<tb
��gE�J@�HMPNXG`S@wHBPGXE`[@@A`�����F�B�B �B(�A0�A8�GphxM�PxAp�xA�KxAp}8A0A(B BBB0����E�D�E m
ADEWCA@Le
���F�B�B �A(�G0�D`�0A(A BBB�����E�G �AT�l���F�B�B �B(�A0�G8�Dp�xO�PxAp�8A0A(B BBB@
���NF�B�B �A(�D0�DP20A(A BBB<L
����F�B�B �A(�D0�D@�0A(A BBB@�
���IF�B�B �A(�D0�DP-0A(A BBB�
����E��
EC�
K��E�J0�A2���E�G �A00���~E�D�E P
HCEKCA0d7��~E�D�E P
HCEKCA����qEk�����E�|
GCL�F��cI�JP^XF`HhMpIxG�G�G�SPkXE`EhEpfPDA Y��H �8B���H �P���H �h���3EO
HV����2EO
GV����L��<����:F�D�G �DPrXU`BhBpIP� AAB���9EV
GV($���)F�A�A �AB(P���)F�A�A �AB|���9EV
GV� ��9EV
GV� ��9EV
GV�7 ��9EV
GV0�P ���E�D�D �
HCEACA0� ��6Ep$H!���E�D�D �AAp�!��9EV
GV��!��9EV
GV��!��9EV
GV0�"���E�D�D �
HCEACA �"��E�G0A4(�#��F�A�A ��
CEEACB`}$���E�|
IC��$���H ��%���E�|
GC��%���E��
GC�g&��3EO
HV�z&��JH A4�&���F�A�A ��
AEEACBHn'��3EO
HVh�'���E��
GC4��'���
M�A�A �W
CBE�
AB��2���E�u
HC�3��3EO
HV13��3EO
HV D3��3EO
HV@W3���H0�X�3��6Epp�3��9EV
GV�4��jH a�a4��9EV
GV0�z4���E�D�D �
HCEACA�5��9EV
GV35���E�|
GC<�5��9EV
GV\�5��9EV
GV$|�5���E��
EA
EC0�A6���E�D�D �
HCEACA��6��3EO
HV��6��9EV
GV
7��3EO
HVH8 7��F�B�B �B(�A0�G8�D��8A0A(B BBB$��9���A�A�G0�AAX�`:���F�B�B �B(�A0�A8�J���H�W�A��8A0A(B BBBH�<���F�B�B �B(�A0�G8�D�l8A0A(B BBBXT?���F�B�B �B(�A0�A8�J���H�W�A��8A0A(B BBBH�uA���F�B�B �B(�A0�G8�D�l8A0A(B BBB ��C���E�G ~A@  E��MF�B�B �A(�A0�GP10A(A BBBd)G���E��
GCL��G��DF�B�B �A(�A0�
(H DBBEA(C BBBH��I���F�B�A �A(�D0�
(H CBBEA(C ABB  WK��E�G qAD�L���E��
NCHd(Q���F�B�B �B(�A0�A8�DP�
8D0A(B BBBE zRx�P������(M���GNU�` p�!$r#Ufw��Hd
l`�!h�!���o`��
F��!��P�%�*	���o���o�%���o�o�#���o���!�d�d�d�d�d�d�d�dee e0e@ePe`epe�e�e�e�e�e�e�e�eff f0f@fPf`fpf�f�f�f�f�f�f�f�fgg g0g@gPg`gpg�g�g�g�g�g�g�g�ghh h0h@hPh`hph�h�h�h�h�h�h�h�hii i0i@iPi`ipi�i�i�i�i�i�i�i�ijj j0j@jPj`jpj�j�j�j�j�j�j�j�jkk k0k@kPk`kpk�k�k�k�k�k�k�k�kll l0l@lPl`lpl�l�l�l�l�l�l�l�lmm m0m@mPm`mpm�m�m�m�m�m�m�m�mnn n0n@nPn`npn�n�n�n�n�n�n�n�noo o0o@oPo`opo�o�o�o�o�o�o�o�opp p0p@pPp`ppp�p�p�p�p�p�p�p�pqq q0q@qPq`qpq�q���V3��@TUU��R!�`R��R=��Q�!>��Q���d~��`P]����MY��`LW!��N�]!��f!ۗo!��ƺL
ҏ���JE����I5,�� I/�y!���![��H�̶`G�ȷF�~� E�!���!k�ff��!���� D�!�� ���!���@C�5��Ad��w���?����=�!���!���<�!�����q��
������������h���;HZ�@9 �7�h�@6J��`5�;� ��1xֆ�^� 1]a�Sp��`0�!T��!5��!B�/�B�/�!��E%�r!������.E�w��d� -�!��,�!"""4":"O"�����p���X"=��qi���i"8���w"z�`����������_� ���������`�j������"�� ��"#����"N������ ��"��`�����������"�`��"����"����"�����"�� ��"����������~���@|�"��{�m��{�":� {�@��`z�"�z�"���y�"���x�'� x����v���@u�"a��t�H��@t})� seU��ro��qh�� qc��`p�"���o]�� o#��`n#r��m���m�"����k_����jM^� j<%��i4��`i)���@h���@fa�f���`e�'�� d#%��b+#�b5#���a���`����_d���^?����])��\>#��[���`[E#s� [���ZW#}��X_#��Xu#�W��!�#���������!��!��#�z$�# I��!`�!GA$3a1HdiGA$3a1ly_curses.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug��N�7zXZ�ִF!t/��)�	w]?�E�h=��ڊ�2N�I��� ��̕���'�'�	��A�A"��6׽���V�A�{̃,O��ݲ	o˘8X����^����T��v�+��
�1��E���!���A�,/�͚����VZ9
[�cPbI�u�,m!f��7����'��--W���+�� �aGXT��)`��v���ֻC�䑤O�	���-� ���� U����,p�	�2��(x���k��i��8�u������:~��I�t����Sm�.Su~6�N��e�s1�:f)��ϟ7�hQRj�p'b��[�e��
�!��{+��P�`v�"����vl���Z�U��R�	۬�~���i"V&�&`��b�(�?	���θN���`��q�����w0�2��
e�~:I�K�cܲ׉0y�X&�>6�y����1�P��L%j��&ЛT��2�2��ÖF�,	�j�q���SL�h��c-�6�a�^��K��)�:�/XD�Kk��p¡���/�މ�����Dd��$�7l\���zt�:N�\Wf+�额�ό��1�*�V�{h܉,4v_+T
�rB�t�򒘱�2~��\�/\WQe�W.��z��P��&*�嬨&9��(��&K��k'�R�us�u�[:��|LfQJ��{�1#�T!�x���췀������P�����F�Њh})��$B�a�q[�� ��N������������%���-"����K�;>��f m�^1ď����$��+-7�L΃�[�Y�u���;�ڢ��}�_m��5��Ł��m+��У���N�t"���g��,V�
�K���Ee�������[>1\
��\�]�a�G�_�����G�]��� $����:D��3:�v��S��y���N���έz�v���z�?�o�U�9�ш����z�zIsg�
�W��ޓ?�2e���,T�I��B!���"�%e���s�e���P��
+��p�װ�����C��Μ��l�A���5Y����].m-�V�_I�Z�����s�ȝ��w��?�+���Rz�ɬ�q�[�Ķ%����g^�R]Φ�������q�re��\	�=���[���e;�0`q �!�ᠰ��s��{+U�O��_�0f�m޺bSR�o�X�z��ʥ�'>g��W�\�ks�.��1�E���0�d��iz _|h����JA	D�M�T��s�N�rF��f+]V"��Z��i{e_>1���7������8�8����ZAUո�����1F�}j��19� �@q�b;�p�3{[�[�@@���=��q��(��zɲ��2�qߛ}�*J���bp���ewi��2�1�V��ᄔ��F��y�	��6?������󷣰��lo�G�B����vֳ�e��B�(��z�[>ov��{�}���F�l�'M��f��T��䅮�<�e~lK��0K�v�>�	?�e��U*,��]�^lθ9�=ndS�ԧy����7�r(�oH�] 5җmp�2c�+�2�;c.�[���r�k�
S�#ø�ڈf�d
�4��B��ob�ĨK��o�2�['��0���m�����:��{�L��(tB��w��Y̯���6��^L�ra�W�f��d��Ǯ���a�1�gS&"��4�Tg�IB�o;�@��2"혧!��6t�2�/^��s�����V���v�կ������͒7
��{hp�ٺ���� G��
m�+�M�;%�j���i�l(U�j�%�H�o1���j���~<�y*���ߤ�=�:B��XQݧ��0��gR��2/Ũi��Ȋr�	�OM7��om��wDG�����E!Q�v�ϫ�օ��G{鮥�c-V
^��	etp�������t�����K?�3���T:y9�ܐD�$��Hݻ��E���+���{μ��'�Q���O,�����O�'!Eڎ�̅�������� ���	�=[�,�>	O��&a!���3�ѵ�y��<�rμH2�6���؈@����zOXF�e�p�
�|�U+�<=z��%�m��وJ>F���p��:vR��qΨU�
�����[nY�p��N�W�4C��u�u�J��̣$3��D�	9޴�1�
!���:S�+>!�{���HU�u��镗�BT��f�AQ�Lh8p�l\�?N� ��tJNk�rߜ�]�T�XN�󀋹�ݻ��1�G���ZY�3g�:�;��qA<�ll˸��K�i����2�_�4��
�D�c_�Ƭy��@6yƄ�~��Hr�{���J"��"���Lǒ^TxJ�mH� 
n~�Œ���?)�c��vR�DD8��Ij�vdͪA�PS��seqk��J�5%��'W����}�OQ��S�#Pg��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``8(���0��F8���o�#�#�E���o�%�%0T�%�%�*^B�P�P�hHdHdcpdpd 
n�q�q
w�~�~ɖ}ll
����| �`�`��������h�h� �`�!`��h�!h��p�!p�(���!�� ���!��H��!�` �`�!`� �h�a`�H
��`��	��(lib-dynload/_csv.cpython-38-x86_64-linux-gnu.so000075500000103710151153537500015044 0ustar00ELF>�"@��@8	@`c`c pkpk pk P� �k�k �k 888$$@c@c@c  S�td@c@c@c  P�td[[[TTQ�tdR�tdpkpk pk ��GNU]��j��_�=�u�͇��>�@ >A��|BE��-�L��qX�����WZ e7F(����*Q�,� $`
, �E�F"���aB�r��wD�u�����������|z i�y ��@�p�y __gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6PyModule_GetState_Py_DeallocPyLong_FromLongPyState_FindModulePyArg_UnpackTuplePyLong_TypePyExc_TypeErrorPyErr_FormatPyLong_AsLongPyErr_Occurred__stack_chk_failPyDict_GetItemWithErrorPyDict_DelItemPyExc_KeyErrorPyErr_ExceptionMatches_Py_NoneStruct_PyObject_FastCallDictPyErr_SetString_PyUnicode_ReadyPyDict_SetItemPyDict_Keys_PyObject_GC_New_PyObject_LookupAttrIdPyCallable_CheckPyObject_GC_TrackPyUnicode_FindCharPyErr_NoMemoryPyObject_GC_UnTrackPyMem_FreePyObject_GC_DelPyUnicode_FromKindAndDataPyNumber_FloatPyList_AppendPyUnicode_GetLengthPyUnicode_FromOrdinalPyMem_ReallocPyList_NewPyIter_NextPyObject_GetIterPyObject_StrPyNumber_CheckPyObject_CallFunctionObjArgsPyArg_ParseTupleAndKeywordsPyType_IsSubtypePyObject_GetAttrStringPyErr_ClearPyObject_IsTruePyUnicode_DecodeASCII_PyLong_AsIntPyInit__csvPyType_ReadyPyModule_Create2PyModule_AddStringConstantPyDict_NewPyModule_AddObjectPyModule_AddIntConstantPyErr_NewExceptionPyObject_SelfIter_edata__bss_start_endGLIBC_2.4GLIBC_2.2.5vii
�ui	�pk pCxk 0C�k �k �k -E�k ;E�k EE�k VEp �D(p mDPp �D�p cD�p �-�p yD�p �-�p �D�p �"q �D q �-@q �DHq �$�q �C�q lE r uE(r �48r �I@r ~EHr �7Xr I�r �C�r �E�r �>�r �Xs �Es Q(s @W s �E(s .(8s �V@s �EHs 'Xs `V`s �Ehs \&xs V�s �E�s S&�s �U�s �C�s �$�s �T�s �C�s cD�s mD�s yDt �Dt �Dt �Dt �D t �D8t �Ext �E�t �+u @Ju H# u �#Hu  r Pu �r v �E0v _$�v @H�v p �v �p 8w P8�w �E�w �J�w �r �w �?�w `@x �C8x �EPx �+�x �H�x �"�x $y �2y �y y �q �o 	�o �o �o �o �o  �o (�o +�x n n n  n (n 0n 8n @n 
Hn Pn Xn 
`n hn pn xn �n �n �n �n �n �n �n �n �n �n �n  �n !�n "�n #�n $�n %o &o 'o )o * o ,(o -0o .8o /@o 0Ho 1Po 2Xo 3`o 4ho 5po 6xo 7�o 8�o 9�o :�o ;�o <�o =��H��H��S H��t��H����5�Q �%�Q ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&�������h'��q������h(��a������h)��Q������h*��A������h+��1������h,��!������h-��������h.��������h/������h0�������h1��������h2�������h3�������h4��������%mN D���%eN D���%]N D���%UN D���%MN D���%EN D���%=N D���%5N D���%-N D���%%N D���%N D���%N D���%
N D���%N D���%�M D���%�M D���%�M D���%�M D���%�M D���%�M D���%�M D���%�M D���%�M D���%�M D���%�M D���%�M D���%�M D���%�M D���%�M D���%�M D���%}M D���%uM D���%mM D���%eM D���%]M D���%UM D���%MM D���%EM D���%=M D���%5M D���%-M D���%%M D���%M D���%M D���%
M D���%M D���%�L D���%�L D���%�L D���%�L D���%�L D���%�L D���%�L D��H�G(H��tH����ATI��UH��SH�H��H��uI�|$H��u
�H��Ӆ�t��!H��Ӆ�uI�|$ 1�H��tH��H��[]A\��[]A\���ATI��UH��SH�H��H��uI�|$1�H��tH��H��[]A\��H��Ӆ�t�[]A\�H��E1��]���H�xtH���N���L��H�xYH��[]A\A]��ZD��[]A\A]���SH��H�H��tH�CH�u�-���H�{H��tH�CH�u����1�[���SH��H�H��tH�CH�u���H�{H��tH�CH�u����H�{ H��tH�C H�u���1�[���SH��H�(H��t
H�u���H�CH��[H��@��H���}���H���U���H�hH�����H���[������Hc�9�����ATH�=�R USH��H��dH�%(H�D$1�H�$�V���H�����1�I��H�hH�5�H��1�������1�����H�$H����H��J H9CtH�
jJ H�5\1�H�9�Q���1��mH�=6R ���H���y���H��I������H�=R I�D$���H���U���H�x�u&�9���H��tH�=�Q ���H���0���H�h1��H���0���H�L$dH3%(t����H��[]A\�SH��H�=�Q �R���H�����H��H�x�^���H��H��u1���H��u*H�=uQ � ���H�����H�5�H�81��g����H�H��[���H�����SH�=8Q H�����H���x���H��H�x�����y<H�1I 1�H�8�7�����t1H�=�P ���H���?���H�5H�81�����
H�I H�H��[�H��H��H�|$H��tH�t$�H�=O ����1�1�H�=�N �t���H�����UH���H�5�SH�ӺH��(dH�%(H�D$1�L�L$L�D$H�D$�F�����t(H�|$H�G���uH�
AH H�5\H�9���1��� yH�|$H���3���H��H��u
��������u���H�=�O H�l$���H���"���H��H��H�x���H���yH��H�u�H������1��H��H�uH������H��G H�H�L$dH3%(t���H��([]���PH�=fO ����H�����H�xZ�����AUH�=L I��ATUH��SH��(dH�%(H�D$1�H�D$���H�����@8W�H��L��L�`@L�L$�@(L�D$�H�5�H�@ 1�������t7H�|$L��H�5DK �/�����xH�{H��u%H��F H�5�H�8�\���H�uH�������x�����u��E1��3H�|$H�����I��H�CH��uH�u�H������H��I���J���H�L$dH3%(L��t�2���H��([]A\A]�AWM��I��AVE��AUATI��USH��(�8H�o�t$H�_0H�L$~'E��t�UH�O ���H��������H9���H��E��tA�:t�uI�|$ �4�H��H��������E��E1�M��D��E��M���Mc�L;l$�	�|$uG�,/��|$uG�,o�G�,�D9mu�}uI�vD9m t�D9mt�H�}(�t$1�D��A�L�T$H�O�;���L�T$�t$H��������H��y��vD9mu �}t#��t
I�F D�,��	H9���H��A��G�} ��u+H�=�L H���k���H������H�5H�81�����n��t	I�V �<��H9�tSH��t
M�F E�,��H9�t=H��A�����A�:t5��tD�UM�~ E��H��� H��H�H��H��w	��H��H��(H��[]A\A]A^A_���SH����H�{H��t
H�u�p���H�{H��t
H�u�]���H�{ H��t�/�H��[�6���SH���I�H�{H��t
H�u�&���H�{H��t
H�u����H�{ H��t
H�u����H�{0H��t���H��[���ATUH��SH�W@H�w0����H��t[�}HH��H�E@t'�EHH�����H�I��uH�����M��t&L��H�} H���W���H���yH��H�uH���p������H�ʽH�uH���V�����[]A\�H��u�1��H;C ���ATI��UH��SH�BH����u'L��B H�H1�H��H�5)I�;����H���9���H��~ L��B L��H�51�I�:�i���nuj�C ���ƒ��� ��u��tL�KH�@t
L�K0�L�KHA�9�9��u��tL�CH�@t
L�C0�L�CHA�8���tH�sH�@t
H�s0�H�sH�>�}1�[]A\�1�������t���H�B H����� ��t��H��A H�������t��H��A H��AUATA�USQH9}OH�й�I��H��H��������H�H��H�pH��H��H9�v
��E1��H�;H����H��t�H�I�mZD��[]A\A]�AVAUATUH��SH��H���T$H��tG�~ y�S A��A��A���� u�H������u�1��~��@H�CHt
H�C0�H�CHL�kH���E1�A��L�t$E1�L��H��M��D��H�����H��x�H�u(H�} H�������t�A�M��L��H��D��H���R����E8H�E0�H��[]A\A]A^�ATA��USH��H�o@H�=;H ���H���~�H;h|EH�=!H ���H���d�H�=
H H�X��H���L�H��H�5�H�81�����gH�C8H9C@uGH�,H���H��������HD�H9�v
�%���4H�{0H�4��_�H��t�H�C0H�k8H�{@H�s01�L�GL�C@D�$�[]A\�1��(H�O��ATH��UH��S�G(��Hc4�H�>����G��
t��
u�E(1��[�G(��
wA�$I����9Yu�yt�E(1��&9Y u�E(1���� u
�y��9YuH���M��������y�^�EH�R��
t��
u ��H���D��������E(1����� �
����i��
wA�$I����9Y �V���9Yu#H��������_�E(1��T9Yt-��H���������=���	9Y u��G(1��"�yt̀yu�E(1���G(1����u�
��yt9Yu��H���Y������������D�aA9��N�����
w.�$H��s#H�����������t��](1���yu��H��������_����pH�=;E �Y���H���{���D��H�5wH�81��%����A��
t��
t��u�G(1��(H�=�D ��H���3�H�5�H�81������[]A\����AWAVAUATUH��SQH�_ 1���H�E H��t
H�uH����H�} ��H�E@�E(�EHH�}�|�H��H��uu��H��H���HH�}@u
�}(�7H�U�zt(H�=1D ���H���t�H�5�H�8����YH���������H�] H�E �8H�@���u:H�=�C H�h��H����H��H�50H�81����H�����{ xH���z������C H�EPA��A��A��� tL�kH�@t
L�k0�L�kHL�{E1��H�������xNI��M9�tlA��uQC�t%��u�H�uH����H�=)C ���H���l�H�5�H�81���1��PH�u�H��1��h��?A��uC�te�C�t��H�uH���D�1�H���S�����x��}(�G������ZH��[]A\A]A^A_���AWAVAUATI��USH��QL�H���7�H��H��uJH�
�: H�9����txM�d$H�=`B I�\$��H����H��H�5�H�81��J��7H�C0�C8�sL����I�$I��uL���{�M����H�MuH���d�1���E�oA��uDI�T$���tTD��L��H�����I�$A��uL���&�E��t�H����I��H��u��RA��uL��E1�����A���E1��L;%�9 �P���D��1��D��L��H���>���I�A��u�L�����H�MuH�����z�H��H���:����C8��H�SH�J(L�qI���uZ����H�{0u�A�u*H�=�@ ��H���>�H�5�H�81��������1��H�߉C8�����u�����H�S0H�s(H�{ L������������H�sL�F(A�@ ��@����� t$@M�PHt
M�P0�M�PHE1�M9�H�S0H�s ~(��uG�
���uG�J�G��L�I��D����L�H�S0�{�I��H���+���H�{1�H��1���I�MH��uL���n�ZH��[]A\A]A^A_���AUI��H��ATUSQ��H��H��u21��rL��L������I�$H��uL���!�H��tH�uH����H����I��H��u��H�Mu�H������"H�MuH�������H��u�H��7 H�ZH��[]A\A]���USH��H��H��H��`dH�%(H�D$P1�H�D$H�D$HH�D$@H�D$8H�D$0H�D$(H�D$ H�D$H�D$H�D$P1�H�T$RH�H�L$(QH�
�: H�l$8UL�D$HAPL�L$XAQL�T$hARL�L$xL��$����H��@����H�|$@H����H�w���t��H�D$@H��u�H�H�|$@H�5�< H�H9�u
H�|$8uN������u��AH�|$0u9H�|$(u1H�|$ u)H�|$u!H�|$uH�|$uH�<$u
H�l$@�H��1���0H�|$@H��H��uH��t
H�u�-�1��L�\$8H�@(M��tI�H�D$0H��tH�H�T$(H��tH�H�L$ H��tH�H�l$H��tH�EL�D$M��tI�L�L$M��tI�L�$M��tI�H����M��uH�5�	��H�D$8H�|$0uH�|$@H�5�	��H�D$0H�|$(uH�|$@H�5�	���H�D$(H�|$ uH�|$@H�5�	���H�D$ H�|$uH�|$@H�5�	��H�D$H�|$uH�|$@H�5�	��H�D$H�|$uH�|$@H�5�	�h�H�D$H�<$uH�|$@H�5v	�K�H�$���H�T$8H�s�,H�=	�Y����H�|$0H��u�C��������CH�T$(1�H�s H�=������H�l$ H��u1ҾH�=���H�C(�fH;-4 u
H�C(�SH�}H��H�5�������} yH�{(H�EH�k(H��u�H���[���u��H�u���H�T$H�s�"H�=F�o����H�|$H��u	�C�SH�5l3 H9wt&H�H�5NL�)3 1�1�I�;��������t�k��*�H��t��H�|$H��u�C��k���xr�CH�<$H��u�C��P���xW�C�SH��. ;t*H��H�hH��u�H�
�2 H�5�1�H�9����{uH�=|2 H�5U
H�?�%�1��kL��2 L9D$uH�|$u	�C�%��t �{uL�
82 H�5A
1�I�9����'H�k(H��uL�2 H�5XI�:���H�H��H�uH���I�H�|$@H��t
H�u�5�H�|$8H��t
H�u�!�H�|$0H��t
H�u�
�H�|$(H��t
H�u��H�|$ H��t
H�u���H�|$H��t
H�u���H�|$H��t
H�u��H�|$H��t
H�u��H�<$H��t
H�u��H�L$HdH3%(H��t��H��X[]���AUH�=z9 I��ATI��USH��(dH�%(H�D$1�H�D$�n�H����H�@ W�1�H��H�@0H�@8H�@P@��H��H�C H��t1�L�L$L�D$L��H�C@��H�5�C(�CH�M���uH�uH����1��IH�|$���H��H�CH��tH�|$L���H�H��H�CH��uH�u�H���l��H��H����H�L$dH3%(H��t���H��([]A\A]�1���D��AUATI��UH��SH��H�����H�8���H�����L��H�8��A�����H�����H�x���H����L��H�xH��H��[]A\A]��ff.���USH��H���~�H�(H��tH���n�H�H�m���H���T�H�hH��tH���C�H�@H�m���H��1�[]����UH�=$5 SQ���������H�=.7 ����������H�=Z3 ������������H�=�6 �,�H��H�������H��H�5�H������������H�����H��H�@���H���a�H��H�E�u��H�x�N���H���b��H��H�@H��R��H�5�H��H�P����������1�H�5kH�������������H�5\H�����������H�5IH������������H�5=H������������H��3 H�5�H��H��3 �H���������H�����1�1�H�=�H���e��H��H�E�y��H�8�S���H���g��H��H�H��X��H�5�H��H�����H��Z[]�f.�DH�=�6 H��6 H9�tH��, H��t	�����H�=�6 H�5�6 H)�H��H��H��?H�H�tH��, H��t��fD�����=�6 u+UH�=�, H��tH�=.( �����d����]6 ]������w������������H��H���field_size_limitlimit must be an integerunknown dialectdialect name must be a string'%c' expected after '%c'unexpected end of dataline contains NULiterable expected, not %.200s|OOOOOOOOOdelimiterdoublequoteescapecharlineterminatorquotecharquotingskipinitialspacestrict
"%s" must be a string"%s" must be an integerbad "quoting" valuelineterminator must be set1.0__version__QUOTE_MINIMALQUOTE_ALLQUOTE_NONNUMERICQUOTE_NONE_csv.Errorline_numwriterowwriterowslist_dialectsunregister_dialectget_dialect_csv.readerwrite_csv.writer_csv.Dialect_csvargument 1 must have a "write" methodneed to escape, but no escapechar set"%s" must be string, not %.200s"%s" must be a 1-character stringfield larger than field limit (%ld)new-line character seen in unquoted field - do you need to open the file in universal-newline mode?iterator should return strings, not %.200s (did you open the file in text mode?)single empty field record must be quoted"delimiter" must be a 1-character stringquotechar must be set if quoting enabledV�}���<���������4�CSV dialect

The Dialect type records CSV parsing and generation options.
CSV reader

Reader objects are responsible for reading and parsing tabular data
in CSV format.
writerows(iterable of iterables)

Construct and write a series of iterables to a csv file.  Non-string
elements will be converted to string.writerow(iterable)

Construct and write a CSV record from an iterable of fields.  Non-string
elements will be converted to string.CSV writer

Writer objects are responsible for generating tabular data
in CSV format from sequence input.
CSV parsing and writing.

This module provides classes that assist in the reading and writing
of Comma Separated Value (CSV) files, and implements the interface
described by PEP 305.  Although many CSV files are simple to parse,
the format is not formally defined by a stable specification and
is subtle enough that parsing lines of a CSV file with something
like line.split(",") is bound to fail.  The module supports three
basic APIs: reading, writing, and registration of dialects.


DIALECT REGISTRATION:

Readers and writers support a dialect argument, which is a convenient
handle on a group of settings.  When the dialect argument is a string,
it identifies one of the dialects previously registered with the module.
If it is a class or instance, the attributes of the argument are used as
the settings for the reader or writer:

    class excel:
        delimiter = ','
        quotechar = '"'
        escapechar = None
        doublequote = True
        skipinitialspace = False
        lineterminator = '\r\n'
        quoting = QUOTE_MINIMAL

SETTINGS:

    * quotechar - specifies a one-character string to use as the
        quoting character.  It defaults to '"'.
    * delimiter - specifies a one-character string to use as the
        field separator.  It defaults to ','.
    * skipinitialspace - specifies how to interpret whitespace which
        immediately follows a delimiter.  It defaults to False, which
        means that whitespace immediately following a delimiter is part
        of the following field.
    * lineterminator -  specifies the character sequence which should
        terminate rows.
    * quoting - controls when quotes should be generated by the writer.
        It can take on any of the following module constants:

        csv.QUOTE_MINIMAL means only when required, for example, when a
            field contains either the quotechar or the delimiter
        csv.QUOTE_ALL means that quotes are always placed around fields.
        csv.QUOTE_NONNUMERIC means that quotes are always placed around
            fields which do not parse as integers or floating point
            numbers.
        csv.QUOTE_NONE means that quotes are never placed around fields.
    * escapechar - specifies a one-character string used to escape
        the delimiter when quoting is set to QUOTE_NONE.
    * doublequote - controls the handling of quotes inside fields.  When
        True, two consecutive quotes are interpreted as one during read,
        and when writing, each quote character embedded in the data is
        written as two quotes
Sets an upper limit on parsed fields.
    csv.field_size_limit([limit])

Returns old limit. If limit is not given, no new limit is set and
the old limit is returnedReturn the dialect instance associated with name.
    dialect = csv.get_dialect(name)Delete the name/dialect mapping associated with a string name.
    csv.unregister_dialect(name)Create a mapping from a string name to a dialect class.
    dialect = csv.register_dialect(name[, dialect[, **fmtparams]])Return a list of all know dialect names.
    names = csv.list_dialects()    csv_writer = csv.writer(fileobj [, dialect='excel']
                            [optional keyword args])
    for row in sequence:
        csv_writer.writerow(row)

    [or]

    csv_writer = csv.writer(fileobj [, dialect='excel']
                            [optional keyword args])
    csv_writer.writerows(rows)

The "fileobj" argument can be any object that supports the file API.
    csv_reader = reader(iterable [, dialect='excel']
                        [optional keyword args])
    for row in csv_reader:
        process(row)

The "iterable" argument can be any object that returns a line
of input for each iteration, such as a file object or a list.  The
optional "dialect" parameter is discussed below.  The function
also accepts optional keyword arguments which override settings
provided by the dialect.

The returned object is an iterator.  Each iteration returns a row
of the CSV file (which can span multiple input lines).
;P)$���l������������<���|�����������S�����T���|��������G���P��������("��PE��h}���t��������(���T���������������s���D��8��d�����������,D��d�������0T����t�hzRx�$����`FJw�?:*3$"D���P\ ��4p��WF�D�D �
ABBAAB4�<��@F�D�D �_
ABBJAB4���rF�B�D �D(�G0P(D ABBzRx�0����0$���8b
(D ABBBA(D ABBl���BE�|���]E�W�W��,E�^$�<�iE�A�G WCAzRx� �� #��/�	,*��
0@#��'F�H�A �G0 AABt��eA�c�_��	�T��wE�q����>D y$����E�P�L@�AA���#EY8���8F�L�A �D(�DP(A ABBHT����B�H�E �B(�D0�A8�D`�8D0A(B BBB�|��JE�@����]E�S(�����B�A�D ��AB,Y��_�D�D ��ABA���4*��H1��\8��4p?��lB�B�G �A(�A0U(D ABB<�s���B�B�B �A(�D0�G@�0A(A BBB(����B�D�A ��AB,����R�H�D ��ABA���HD/��!F�B�B �B(�A0�D8�A@8D0A(B BBBH����F�B�B �B(�D0�A8�D@�8D0A(B BBB4�q���F�H�A �A(�A0�(D ABBH���IE�A�Mxg�H�M�M�G�G�G�VpAA8`���;F�L�D �A(�DP(A ABB(�����E�H�A �AA����GNU�pC0C�k -E;EEEVEUfv
�Cpk xk ���o`��
��m �		���o���o�
���o�o`
���oW�k @P`p�������� 0@P`p�������� 0@P`p�������� 0@P`p��DmD�DcD�-yD�-�D�"�D�-�D�$�ClEPuE�4�I~E�7I�C�E�>�X�EQ(@W�E.(�V�E'`V�E\&V�ES&�U�C�$�T�CcDmDyD�D�D�D�D�D�E�E@�+D@JH#�# r �r �E0_$@Hp �p P8�E�J�r �?`@�C�EX�+D�H�"$�2�y �q GA$3a1�C_csv.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debugp�\9�7zXZ�ִF!t/���]?�E�h=��ڊ�2N��������}q�`7�GFy�#�D�$�]���
��7NT��I-~O�(}�+R���9�Obpr�ȶ�/#H������&���f��'��p_��b'db5��a5�A��
��gh�?#�Q�c��Ӹ)|[
c?�"�i�q�ɿ&i���$��H��g}��.��H�E9������Q��׊�/ �^^���w�v}H�u�v^腂�6&Vu\����$�s@�f`�����J#�
dq��=��9�&հ� ,�^�0���$�;PeWQ}�H)s�[��f�&b��YwNo?�o{�T��ܵLuF�Yކ��.���3p�O�y͝�[�
|֫"�@�-����1�'��8�$�T��B�x��f���U���[9�.�#AXy�dǬ����
{����5��pV�e�̐���o�����D��E���j-�|x�ߪ;H�vv:���Eƃ�r5���B"R��o���JT��Ll;�#�8�+��/�iD�d�E\]I
��&��%��H�}�t ���^#�H�L6mq�wX=�vWpB����
�x@;y�(���3�!���r_ϴ'�AR*ד=�<Q�S����=�S�rb>���쨛��2H��2°zY��I��,0!�kiO�0�3�����Q,�՚
����%Qw֢�sw�N�����zH�w�{A��$�{
o�/A�n?8�4oLS(2��N~�SbӠb>i�qCB��,"rJ����A�
��}��{4~bC�z^F}�#2��*���1,��O�@�Ъu%�?qb輮o��DR�b�RS�0<_[i�2���2iRe/�lo�t=��������F\^:��W�
��_��~���
�*_�e��<�$b�	��Dy����ț�8=�ZU2��pzi�a,J���`dܘ�,�}!��v Z�%��,���O1���~��5Z��:���`�97^2�(�`	I�'�sC���P�p����%TB���C�X��8`�2�0�����5&�NK�<��a�mÃ���Rtm�{D�i�LR��ľ-O�o�ra|;��(y��Yr����&J�tE�SHO=lB�ȗ�)w0�w��wc��YN'y���#ˉU�G��o�Wh�RHyxA�~„�Z̺u��<����-�XP��k�<]d�\O GD$E�@�n����%^�"|�{�����癧��_�q��#��V3��:"��ۨP��	�(�#�L��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(��00���8���o`
`
�E���o�
�
0T	^B�hc00`n��Pw�"�"� }�C�C
��C�Ck �[[T�`\`\��@c@c �pk pk�xk xk��k �kp ��k �k��m �m�p p�	 ��y �y@ �z`�y$
�y\@z\(lib-dynload/_heapq.cpython-38-x86_64-linux-gnu.so000075500000067240151153537500015356 0ustar00ELF>�@`g@8	@�Y�Y @]@] @] HP X]X] X] 888$$�Y�Y�Y  S�td�Y�Y�Y  P�tdPTPTPT��Q�tdR�td@]@] @] ��GNU+CY�w��2'=�5�
|m�@ ���|CE���qX��la �� , F"����;��L��a t�a {�a -�6H__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6PyObject_RichCompareBool_Py_DeallocPyExc_IndexErrorPyErr_SetStringPyExc_RuntimeErrorPyList_SetSlicePyExc_TypeErrorPyList_Append_Py_NoneStruct_PyArg_CheckPositionalPyInit__heapqPyModule_Create2PyUnicode_DecodeUTF8PyModule_AddObject_edata__bss_start_endGLIBC_2.2.5vui	�@] �5H] �5P] P] ` p7` @` �< ` �7(` � 8` �;@` �7H` 0&X`  ;`` �7h` �!x` `9�` �7�`  5�` 9�` �7�` 6�` �8�` �7�` �6�` �8�` y7�` ��`  8Ha �7Pa �<`a ` �_ �_ �_ �_ �_ �_ �_ 	�_ p_ x_ �_ �_ 
�_ �_ 
�_ �_ �_ �_ ��H��H��T H��t��H����5*T �%+T ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q�������%�S D���%}S D���%uS D���%mS D���%eS D���%]S D���%US D���%MS D���%ES D���%=S DL���D$L�L$���L�L$�D$�-
L��D$L�L$���L�L$�D$�
L���D$�f���I�,$�D$����V
I;muQ������H�-�R H�5>*H�}�U����'
H�߉D$����I�/�D$t.���	
I;m��L�-�R H�5�*I�}������	L���D$�����D$�L�{R H�5�)I�8����	L���D$���H�m�D$t7����	��I�UH�M9e�T	H�5R H�5*H�:����h	H��D$�U����D$�L��D$�C����D$��������ZL��Q H�5B)E1�I�8�D����L(I�,$tE1��=(L��E1�����-(L���D$����D$�	L��D$�����D$�
L��D$L�$���L�$�D$�p
H�+H�sH�U���t9H���}�������
L�mI�M�I9�!L�-)Q H�5z(I�}����
�q
H�}L�4�J�47H���>
�L��D$L�T$�(���L�T$�D$�R
H�ֹ�H�=O(�����t.L�;H�kI�����LL�vP H�5�'I�8���H�D$��L���D$L�T$���L�T$�D$��L���D$���H�m�D$ty���(
��M�_H�M9g��H�=(P H�5(H�?����L���D$�H���I�,$�D$uL��D$�1����D$����M9ouk���J�bH��D$�����D$�r���L�-�O H�5�&I�}�����L���D$����I�,$�D$�����cM9o��L�=mO H�5V'I�?�����>I�t8M�_M�H�EM�gI�+L�D$M��TH�&O H�5w&H�8����H�O H�5\&H�:�t���H�D$�i
L��D$�*����D$�[���M��I�L�L$�C
�>	���6
��
H�|$H�߉D$���H�|$�D$�L���D$�����D$�
H�{N H�5�%H�:�����L�-`N H�5�%I�}�����H�߉D$����D$��
H�+tV1��H�ֹ�H�=�%�8�����t�L�#H�kI�L$���u0L�
�M H�5T%1�I�9�W����O��H��1������<I�|$�gI�t$1�H�H��H�H���
���H�+���IL���D$L�D$����L�D$�D$�{L�+H�{I�m�����I�}�-M�]M�H�I�mI�;L�D$H��~I��I�L�L$�[�zH�M H�5i$H�8����L�%�L H�5N$I�<$�e�����L���D$�$����D$��L���D$�����D$�E�\H�=�L H�5$H�?�����$L���D$�����D$�L���D$�����D$�uI�,$uL�����H�D$�L���D$L�D$���L�D$�D$�L�-1L H�5�#I�}����L��L�L$�$�T����$L�L$��L��L�\$ �$�7����$L�\$ ��H��L�L$�$�����$L�L$�@H�߉$�����$�xL��$����$��H�
�K H�5�"H�9����1��H�߉D$<����D$<�*D��AWAVAUATUSH��(L�gH�t$I9�����L��I��H�H�D$H9��H�WI��K�?H�YH��H�,�L9��-L�4�H��1�I�L��H�E�[���I�.�����H�m�������%��I�UH�M;e�����H�<�J��I��L�:H�(I�I�+H�H9\$�r���I�mH9������L�$:H9\$}YL�s�L��I�N�<�J�<�1�H�|$I�L��I�$���I�/����I�,$�6�������I;m�{�����u1�H��([]A\A]A^A_�ff.�M�MJ��I�4I��L�L�;L�>L�L9t$}�I��1�L��I�K��N�$�H�H��I��!���H�+����I�/��������I;m������d���I�EH�L$N� H�M�L�9M�:L�L9t$�=���I�~�1�L��H�L�$�H�|$H��I�$L��I����I�,$L�L$����I�/�������xgI;m�^���������I�EN�4�H�M�>H�3L�;I�6M��L9L$|����H�<�N��I��H�4:M�L�L�M�H;\$�����������������AWAVAUATUSH��H��H���H�.H�vH�E�����H�������L�mI�M�I9�� ���H�}L�4�J�47H���H�Y�L�>1�H�L�$�I�L��L��L�$I�$L���o�I�,$��I�/�J������bL9m����� L�ML��O�K�1I�L� M�#H�H����H��1�L��H�M�<�I�$L�4�I�L�����I�/�NI�,$��������L9m�����L�UH�4$K�2L�H�9L�&L�!H�>H��tL�C�1�L��I�O�4�N�<�I�$L�$I�L���r�I�.L�$��I�,$�s�����xeL9m����t'L�UI��M�L�#M�M�'L�L��M��u��H��F H�H��[]A\A]A^A_�H�wF H�5�H�:��1���H�ֹ�H�=����t�����L���D$��D$L�$�M���H�-JF H�53H�}��1��L���D$�j�D$���L��D$�U�I�/�D$�W�����f���AWAVAUATUSH��H��(H������L�>H�FI�W����$���I������M�_I�H�M�gI�H�L$M���i���L��H�H�t$�E1�O�T-I�ZI��I�,�M9��$O�4�1�H��I�L��H�E��I�.���H�m�o��������M�_H�M9g���H��O��I��M�I�
M�I�M�
H;\$�q���M�oL9��M�wH�k�H�M�$M�4�L��1�L�\$I�L��L��I�$��I�.��I�,$������M9o������uH�D$H��([]A\A]A^A_�f�I�H��H�H��H�0L�#L� H�3H��t�H��1�L��H�L�4�H��I�L��I�$��I�.�x�I�,$��������M9o�����g���I�OL�D$H�I�H�M� L�#I�H���C���L�M�1�L��I�N�4�J��L�L$I�L��I�$��I�.L�T$��I�,$����xiM9o������I�OH�,�H�L�eL�L�#L�]L��M��u����H��O�,�I�4I�EH�>H�I�}I��H;\$������ ���H�|$H�7H�t$H��H�7�r����8�H�D$�]����(������AWAVAUATUSH��(L�wI9��7�M��I��I��L�WI�I��L9���K�?H�XH��L��K�4H�.L9��I��H�E1�H��L�D$H�H��H�L$��H�mH�T$L�D$tOH�*ts������M�UH�M;u�}L��O�<�K�I�H�H�I�I9���I���X���H��D$H�T$L�D$�'�H�T$L�D$�D$H�*uH�׉D$L�D$���D$L�D$�����M�UH�M9u��L��K�4H�.ff.�O��I�9H�>I�)L9��e���I�mH9����M�I9�}dL�{�M�31�I�O��I�N��L��L�D$I�L��L�T$��L�\$I�+��I�.�h���iI;m����u1�H��([]A\A]A^A_�M�MJ�4�L�I��H�>H�H�H�9M9�}�I��1�H��I�K��H�N�4�H�H��H�D$���H�T$H�*�*H�+�#����I;m�����k���I�EL�\$N�0I�M�I�I�M�M9��F���M�O�1�H��I�N�4�H�J�4�H�t$I�L��L�L$�e�I�.H�|$��H�+�.��xRI;mus�����I�EL�D$N�<�I�I�I�I�I�I��I9��{������H�-�? H�5�H�}�������L�߉D$���I�.�D$�m������L�%h? H�5QI�<$����H�׉D$��H�+�D$�������H�|$L���D$�f�H�+H�|$�D$�U��"���ff.���ATUSH��H��H�����L�&H�nI�D$������I�|$tjI�T$H��H�1�H�H���
�H�+tU���g��uH�EH��H��H��[]A\�I�|$t?I�|$1�H�H�EH�/L�������t���H�EH���H�߉D$���D$�L�1> H�5�1�I�8���fD��AWAVAUATUSH��H��(H����L�.H�VI�E�����I�}��M�]I�H�I�mI�H�L$H�����H��H�H�t$��E1�O�$I�ZI��H��I�L�0I9��O�<�I�1�L��I�L�����I�.��I�/���xU��M�]H�I9mu/H��O��I�4M�H�>L�I�9H;\$��I���l���H�
= H�5�H�9�p�H�t$H�H�T$H��H���H����H�D$��H�D$H��([]A\A]A^A_�L���D$���I�/�D$�b��x���M�]H�I9m�u���H��I�L�0ff.��O�$�I�$H�M�4$H;\$�8���M�eL9���H�k�M�U1�H�L�<�M�4
L�|$M�<�I�L��I�L���t�I�/�jI�.���������M9e�m������M�]H��I�I��H�0L�3L�0H�3H�����H��1�L��H�M�<�I�H��I�L����I�/��I�.������y���M9e���������M�UH�|$L�L�H�L�7L�3H�H���r���L�M�1�L��I�O�<�I�J��L�L$I�L���v�I�/L�D$tFI�.�f��������M9eur������M�UI�,�L�L�uL�L�3L�]L��M��u���L���D$L�D$���I�.L�D$�D$u���L���D$���I�.�D$�������L�-z: H�5cI�}����e���L�
6: H�5�I�9��H�D$�p���L���D$�u��D$���H�=: H�5nH�?��H�D$�7���H�ֹ�H�=�����t��j�L���D$��I�.�D$�K��������f���AWAVAUATUSH��(H�F����iH�^H��H���}H�V1�H�s�H��L�d�H��I�$�n������H���L�UL�mI�
M�"H�L$M����L��E1�H�H�t$��O�$I�XI��L��K�<L�7M9��O�<�I�1�L��I�L���O�I�.��I�/����xU��L�UH�L;mu/L��K��K�L�"H�1L�!H�2H9\$��I���l���L��8 H�5zI�;���L�L$I�	H�L$H��I�	���L����H�D$H�D$H��([]A\A]A^A_�L���D$�w�I�/�D$uL���D$�a��D$��x���L�UH�L;m�m���L��K�<L�7fDO��I�H�M�1H9\$�8���L�mL9��SL�c�O�<1�I�O�4�I�N��L��L�D$I�L����I�.��I�/����������L9m��������L�UN��K�<I��L�L�;L�?L�M�����I��1�L��I�O�4�I�J��I�L���{�I�.�%I�/�v����}���L9m�G�������H�EH�t$H�H�H�L�>L�;H�M���r���I�T$�L��H�L�4�I�H��H�T$1�I�L����I�.L�D$��I�/�#��������L9m��������H�EN�$�H�M�<$L�L�;M�$M��M���z������L�d$����H�6 H�5�
H�;��H�D$���H�6 H�5R
H�:�j�H�D$���L���D$� �I�/�D$�����<�L���D$��I�/�D$�-�����H�-�5 H�5�
H�}������L���D$����D$L�D$����3�AWAVAUATUSH��HH�GH�t$����/H�_I��H��H�H�t$0H���	�-H�T$0I��I��������H����H����H��tcH��tDH��t$H���fL��L��L�l$A�Յ���I��L��L��L�t$A�օ���I��L��L��H�\$�Ӆ��xI��L��L��H�D$�Ѕ��_I��L��L��H�l$�Յ��FI��L��L��L�l$A�Յ��,I��I�����L�t$L��L��A�օ��I�t$�L��A�օ���I�t$�L��A�օ���I�t$�L��A�օ���I�t$�L��A�օ���I�t$�L��A�օ���I�t$�L��A�օ���I�t$�L��A�օ���I��I����\���H��3 H�H��H[]A\A]A^A_�L��H�l$�Յ�uMI�����H��D$<���H�+�D$<�����x&H�|$I;}��H�-13 H�5H�}���1��L��2 H�5r
I�8�w��1��u���H�~1�H���H��u�H��H��L�G�L�O�L�D$(L�L$L9��/H��M��H�\$ L�l$L���L9T$�M�^M9����L��I�VL��H�I9���H�4$M��I��L�l$M��K�6H�XH��H��L�
I�(I9��L�<�H�E1�H��I�L�����H�m��I�/�����������I�T$H�M;l$����H��N�4�L�
M�I�3M�I�6H9$��I���a���DL��M��I���A����H�l$L�D$L9D$ ���M��L�l$0M��I��L�l$L9l$(����L�
��L9L$�M�~M9����M��I�VM��I�M9���O�I�[I��H��L�
I�(M9���J�<�H�E1�L�T$H�H��H�<$H���d��H�mH�4$L�T$��H�.�����������I�VH�M;~�����H��J�4�H�<
L�L�L�L�I9��I���R���H��D$<����I�/�D$<�����Z�����I�T$H�M;l$�-���H��L�
I�(fDN��I�9I�8I�)H9$�\���I�l$L�l$M��H9��|�H�I9��W���L�{�L�!I�J��I�$1�L��J��H�H��H�D$H�$�B��H�$H�*�{I�,$���������I;n���������M�FN��O�I�4�I�;H�I�H�>M9�����I��1�H��I�O��H�N�$�I�L��L�$���H�$H�)��H�+�u�������I;n��������h���I�FL�L$J� I�L�I�H�M�M9��C���H�l$L��M��I��M�g�1�H��I�J�,�H�N��L�$H�EH���(��H�m�X���H�+�)��������H�t$I;u�d���������I�EL�$N�<�I�I�I�I�I�M9������M���s���L��L��L�d$A�ԅ��1���f�A����H�l$L�l$L9l$(��������ff.�I��]���H��L�T$ �D$H�4$�C��H�4$�D$L�T$ H�.uH��L�T$�$� ��L�T$�$���������I�VH�M;~�����H��L�
I�(ff.�f�J��L�M�H�(I9����I�nH9����H�I9��!���L�c�L�9I�N��I�1�L��J��L�d$I�L��H�L$ L�$���H�$L�L$H�*�I�/�������I;n�����������I�FL�\$ H�4�I�I�;H�I�H�>M9������I��1�H��I�N��H�N�<�L�L$I�L��L�$���L�$$L�L$I�,$�yH�+������d���I9n�C������#���I�VH�D$ J�:H�L�L�8L�9L�M9������M�a�L�$L��I�J��I�N��1�L�L$H�H���}��H�+L�$��I�/����������I;n������������I�VH�|$M��H�N��H�7M�:L�?I�2M9��u����n���ff.�I��(���L��L��L�|$A�ׅ�����1�����L���D$<����D$<��H�ω$���H�+�$�������H�׉$���I�,$�$�w������H��L�\$ �$�k��L�\$ �$����L��$�S��L�L$�$�o���H��L�L$�$�6��I�/�$L�L$��������ff.�@��H��H�5���M���f.�H�=A, H�:, H9�tH�v* H��t	�����H�=, H�5
, H)�H��H��H��?H�H�tH�=* H��t��fD�����=�+ u+UH�=* H��tH�=~' �)���d�����+ ]������w������ATUSH�F�������H�nH��H��tPH�V1�H�u�H��L�d�H��I�$���������H��tH�K1�H��H�)L�!I�������u#L��[]A\�H�=l) H�5�E1�H�?������H�m����H��E1���������H��H�5�����ff.�f���S��H�=?* �Z��H��H��t%1ҾoH�=�
�o��H�5�H��H������H��[���H��H���index out of rangeheap argument must be a listheappush_heapreplace_maxheappushpopheapreplace__about__heappopheapify_heappop_max_heapify_max_heapqlist changed size during iteration_heapreplace_max($module, heap, item, /)
--

Maxheap variant of heapreplace._heapify_max($module, heap, /)
--

Maxheap variant of heapify._heappop_max($module, heap, /)
--

Maxheap variant of heappop.heapify($module, heap, /)
--

Transform list into a heap, in-place, in O(len(heap)) time.heapreplace($module, heap, item, /)
--

Pop and return the current smallest value, and add the new item.

This is more efficient than heappop() followed by heappush(), and can be
more appropriate when using a fixed-size heap.  Note that the value
returned may be larger than item!  That constrains reasonable uses of
this routine unless written as part of a conditional replacement:

    if item > heap[0]:
        item = heapreplace(heap, item)heappop($module, heap, /)
--

Pop the smallest item off the heap, maintaining the heap invariant.heappushpop($module, heap, item, /)
--

Push item on the heap, then pop and return the smallest item from the heap.

The combined action runs more efficiently than heappush() followed by
a separate call to heappop().heappush($module, heap, item, /)
--

Push item onto heap, maintaining the heap invariant.Heap queue algorithm (a.k.a. priority queue).

Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0.  For the sake of comparison,
non-existing elements are considered to be infinite.  The interesting
property of a heap is that a[0] is always its smallest element.

Usage:

heap = []            # creates an empty heap
heappush(heap, item) # pushes a new item on the heap
item = heappop(heap) # pops the smallest item from the heap
item = heap[0]       # smallest item on the heap without popping it
heapify(x)           # transforms list into a heap, in-place, in linear time
item = heapreplace(heap, item) # pops and returns smallest item, and adds
                               # new item; the heap size is unchanged

Our API differs from textbook heap algorithms as follows:

- We use 0-based indexing.  This makes the relationship between the
  index for a node and the indexes for its children slightly less
  obvious, but is more suitable since Python uses 0-based indexing.

- Our heappop() method returns the smallest item, not the largest.

These two make it possible to view the heap as a regular Python list
without surprises: heap[0] is the smallest item, and heap.sort()
maintains the heap invariant!
Heap queues

[explanation by François Pinard]

Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0.  For the sake of comparison,
non-existing elements are considered to be infinite.  The interesting
property of a heap is that a[0] is always its smallest element.

The strange invariant above is meant to be an efficient memory
representation for a tournament.  The numbers below are `k', not a[k]:

                                   0

                  1                                 2

          3               4                5               6

      7       8       9       10      11      12      13      14

    15 16   17 18   19 20   21 22   23 24   25 26   27 28   29 30


In the tree above, each cell `k' is topping `2*k+1' and `2*k+2'.  In
a usual binary tournament we see in sports, each cell is the winner
over the two cells it tops, and we can trace the winner down the tree
to see all opponents s/he had.  However, in many computer applications
of such tournaments, we do not need to trace the history of a winner.
To be more memory efficient, when a winner is promoted, we try to
replace it by something else at a lower level, and the rule becomes
that a cell and the two cells it tops contain three different items,
but the top cell "wins" over the two topped cells.

If this heap invariant is protected at all time, index 0 is clearly
the overall winner.  The simplest algorithmic way to remove it and
find the "next" winner is to move some loser (let's say cell 30 in the
diagram above) into the 0 position, and then percolate this new 0 down
the tree, exchanging values, until the invariant is re-established.
This is clearly logarithmic on the total number of items in the tree.
By iterating over all items, you get an O(n ln n) sort.

A nice feature of this sort is that you can efficiently insert new
items while the sort is going on, provided that the inserted items are
not "better" than the last 0'th element you extracted.  This is
especially useful in simulation contexts, where the tree holds all
incoming events, and the "win" condition means the smallest scheduled
time.  When an event schedule other events for execution, they are
scheduled into the future, so they can easily go into the heap.  So, a
heap is a good structure for implementing schedulers (this is what I
used for my MIDI sequencer :-).

Various structures for implementing schedulers have been extensively
studied, and heaps are good for this, as they are reasonably speedy,
the speed is almost constant, and the worst case is not much different
than the average case.  However, there are other representations which
are more efficient overall, yet the worst cases might be terrible.

Heaps are also very useful in big disk sorts.  You most probably all
know that a big sort implies producing "runs" (which are pre-sorted
sequences, which size is usually related to the amount of CPU memory),
followed by a merging passes for these runs, which merging is often
very cleverly organised[1].  It is very important that the initial
sort produces the longest runs possible.  Tournaments are a good way
to that.  If, using all the memory available to hold a tournament, you
replace and percolate items that happen to fit the current run, you'll
produce runs which are twice the size of the memory for random input,
and much better for input fuzzily ordered.

Moreover, if you output the 0'th item on disk and get an input which
may not fit in the current tournament (because the value "wins" over
the last output value), it cannot fit in the heap, so the size of the
heap decreases.  The freed memory could be cleverly reused immediately
for progressively building a second heap, which grows at exactly the
same rate the first heap is melting.  When the first heap completely
vanishes, you switch heaps and start a new run.  Clever and quite
effective!

In a word, heaps are useful memory structures to know.  I use them in
a few applications, and I think it is good to keep a `heap' module
around. :-)

--------------------
[1] The disk balancing algorithms which are current, nowadays, are
more annoying than clever, and this is a consequence of the seeking
capabilities of the disks.  On devices which cannot seek, like big
tape drives, the story was quite different, and one had to be very
clever to ensure (far in advance) that each tape movement will be the
most effective possible (that is, will best participate at
"progressing" the merge).  Some tapes were even able to read
backwards, and this was also used to avoid the rewinding time.
Believe me, real good tape sorts were quite spectacular to watch!
From all times, sorting has always been a Great Art! :-)
;��������0����������x�������8b�������߾��`|����0��� ��������������L�������0��t�����`���(zRx�$�����FJw�?:*3$"D�����H\����F�B�B �B(�A0�A8�D`5
8A0A(B BBBO zRx�`������(�����,���F�A�A �i
ABAzRx� ���$����=HD���F�B�B �B(�A0�A8�GP�
8A0A(B BBBA zRx�P������(p����H��� F�B�B �B(�A0�A8�G`g
8A0A(B BBBJpǷ��;H(����F�B�B �B(�A0�A8�D`�
8A0A(B BBBA������0�L���F�A�A �G0b
 DABAzRx�0���$�����H����^F�B�B �B(�A0�A8�G`C
8A0A(B BBBA������HP���MF�B�B �B(�A0�A8�D``
8A0A(B BBBA�w����L�����
B�B�B �B(�A0�A8�D��
8A0A(B BBBA$zRx��������,�����<X��P���dP��HE�BGNU��5�5P] Ufv
7@] H] ���o`��
�X_ � 
��	���o���op���o�o@���oX] @P`p������p7@��<�7� ��;�70& ;�7�!�`9�7 59�76�8�7�6�8y7�� 8�7�<��������` GA$3a1%7_heapq.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug:�p�7zXZ�ִF!t/��w�]?�E�h=��ڊ�2N���a �ړ�"νt"wL�,PgZ�a�*���|�j����S�|���
wh!��/��_��Oaп����|�Rk���|֤������c����3�0�Ew�⺎��o���f�F���4&�[p��4��R���(�����tL�<��4��#S�-G$]��[q����
�Ƣ�����Hª��}�Q`ɮ_	0�6����~�,L��F+w�e�k�(�G`�l�Ϸ����/��ӑʅ��G�{�Z	XOF�8��}/K��ܒo��; �w�&]u���ou�ȶ���.>A��s�&��b;Ή�D�|��yG�I�?Gѯ���3�h��"%Ԑ���>'�NS�*3�C�'�a8	�����=�������ZM�G %�	�����?~��
�x�~�蜽0Z�j��N��%w�i��l_+�֘;�P i��M����q�rz��%+�!�5���3K�atV�o�G31x��S�J��
���k�L���,"=�`���;j�ih5�/��W)$4�ƛ�� �$�u][��+���sϺYl=��gé�;�l'P�f"�V��˖^]_D�r�s9�Z���u�7#|$,��3�8l�/L1�YO@F�Z�\2�I�k��<��a�O�kigJ�'
�[����P1O56ev�G�\�F*��x�K�2�P�>�k��<�$��⳯�3DX'��;M:�O%��pԁ���[Ï������k�m"�>�]�9��;d2{��#z�W<�#�hb��e�	R����7￵�f�1ȴ�Y�;
'�F� ��J@��O�)�d8*3P�������p�~IL����'�������ݜ�7��j{�=� �Ԡ��be�33N�
��Xr[p	'V��{���Yt锻�,�
��O�� E� ͹��+�X��'1�>��1c�%�q6=����o����"�U��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(��0���8���o@@,E���opp T���^B 
 
�hc00�n���w���*}77
�@7@7 �PTPT��UU���Y�Y �@] @]�H] H]�P] P]�X] X]�X_ X_��` `� ��a �a��a`�a$
�a`b(4f(lib-dynload/mmap.cpython-38-x86_64-linux-gnu.so000075500000071560151153537500015053 0ustar00ELF>p @0l@8	@NN �[�[ �[ �	�	 \\ \ 888$$�M�M�M  S�td�M�M�M  P�tdPGPGPGQ�tdR�td�[�[ �[ GNUG��&��~$��{�T�wc@�@$@C��T��|CE���qX!E>����o *z�w`����� ���@, F"@����������*f��Q6��21���k��SS���8�R�e ?�e F�e __gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6PyExc_ValueErrorPyErr_SetString_PyArg_ParseTupleAndKeywords_SizeTPyExc_OverflowErrorPyErr_FormatPySys_AuditPyEval_SaveThread_Py_fstat_noraisePyEval_RestoreThread_Py_dup_Py_Deallocmmap64PyExc_OSErrorPyErr_SetFromErrno__stack_chk_failPyBool_FromLong_PyObject_CallMethodId_SizeT_PyArg_ParseTuple_SizeT_Py_NoneStructPyExc_TypeErrorPyBuffer_ReleasePyLong_FromSsize_tPyLong_FromSize_tPyLong_FromLongPyDict_SetItemString_Py_fstatPyExc_IndexErrorPyBytes_FromStringAndSize_Py_convert_optional_to_ssize_tmemchrPyBytes_FromStringmemmovemadvisemsyncPyExc_BufferErrorclosemunmapPyBuffer_FillInfoPyNumber_AsSsize_tPyErr_OccurredPySlice_TypePySlice_UnpackPySlice_AdjustIndicesPyObject_GetBufferPyMem_MallocPyErr_NoMemoryPyMem_FreePyBytes_SizePyBytes_AsStringPyObject_ClearWeakRefsftruncate64mremapPyInit_mmapPyType_ReadyPyModule_Create2PyModule_GetDictsysconfPyObject_GenericGetAttrPyType_GenericAllocPyObject_Free_edata__bss_start_endGLIBC_2.2.5GLIBC_2.4f ui	Wvii
cui	W�[ �8�[ p8�[ �[ ` d?` ?$`` k?h` �/�` �<�` o)�` �<�` a)�` M=�` �.�` �<�` +-a �<a , a �<(a �*@a q?Ha z)`a {?ha �+�a �=�a V6�a /<�a i$�a �=�a �)�a �?�a ~'b �<b c& b Z<(b �%@b �?Hb � `b �?hb U$�b 0�b p �b x �b 73�b o0�b x �b Z*c 5hc �?�c k?�c �?�c �?�c �?�c �?d �?d �?8d �?Pd �5�d �b �d �b �d �b �d Ce `` e ` Xe � �_ �_ �_ 	�_ �_ �_ �_ �_ �_ �_ +�_ ,�_ 0�_ 9�d "Pe =`e 5^  ^ (^ 0^ 8^ @^ H^ 
P^ X^ `^ 
h^ p^ x^ �^ �^ �^ �^ �^ �^ �^ �^ �^ �^ �^  �^ !�^ #�^ $�^ %�^ &_ '_ (_ )_ * _ -(_ .0_ /8_ 1@_ 2H_ 3P_ 4X_ 6`_ 7h_ 8p_ :x_ ;�_ <�_ >�_ ?��H��H�YE H��t��H����5�C �%�C ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&�������h'��q������h(��a������h)��Q������h*��A������h+��1������h,��!������h-��������h.��������h/�������%�@ D���%�@ D���%�@ D���%�@ D���%}@ D���%u@ D���%m@ D���%e@ D���%]@ D���%U@ D���%M@ D���%E@ D���%=@ D���%5@ D���%-@ D���%%@ D���%@ D���%@ D���%
@ D���%@ D���%�? D���%�? D���%�? D���%�? D���%�? D���%�? D���%�? D���%�? D���%�? D���%�? D���%�? D���%�? D���%�? D���%�? D���%�? D���%�? D���%}? D���%u? D���%m? D���%e? D���%]? D���%U? D���%M? D���%E? D���%=? D���%5? D���%-? D���%%? D���O0���H�uPH�? H�5NH�8�v���H��Z�H�G���SH�_H��uH��> H�5H�8�G����H�H��H��[���ATUSH��H��H��H��dH�%(H��$�1�H�D$�$H�D$�D$�D$P1�H�T$RH��H�L$QH�
�B H�l$ UL�L$8L�D$,����H�� ���TH�L$H��yH�s> H�5TE1�H�;����L�L$M��yH�K> H�5TE1�H�:�a����d�4$��t@�|$u�|$t	H�5P�J��t^��t��H�5ku5�D$�D�D$�:�D$�ǃ���t,�A��E��A��D�$�L�}= 1�I�;�#���I����D�$�T$1�H�5�H�=��������^�|$����f����|$H�t$ I������L����+����|$�������D�L$8A���A�����L�\$H�t$PM��uUH��uH�=�< H�5>E1�H�?�2����5H�L$H9�|H��< H�5uE1�H�8�
����
H)�H�t$�0H�T$H9�H)�I9�~H�r< H�5cE1�H�;������1�H���0I��H��t`L�D$L�T$H�@�|$H�@ L�@H�@8�@0L�P(���u
�x4�L$ �!�/���A�D$4��uI�$uL���(���E1��[L�L$D�D$1��L$�T$H�t$���I�D$H��u+I�$I�D$uL�����L�
�; E1�I�9�2�����,$A�l$@H��$�dH3%(L��t�=���H��[]A\���H�@��@�������1�H�5N? 1��W�����UH��SH��(H�_dH�%(H�D$1��D$H��uL�
; H�5;I�9�c����H��H�L$H�T$1�H�5c1��!��������D$��t��t��u-H�\$�@H�] �H�]H��������H�L$H)�H�H9�}�5L��: H�51�I�8����3H9]|H��xH�] H��: H��H�=N: H�5�1�H�?���H�t$dH34%(H��t���H��([]���UH��SH��H�_dH�%(H�D$1�H��uL��9 H�5*I�8�R����H��H�T$1�1�H�5�������te�}@t+H�] H;]}=H�u@�|$H�KH�M @�<H��9 H��4H��9 H�5�1�H�81��&����H�m9 H�5+1�H�:����H�L$dH3%(H��t����H��[]���ATUSH��H��`H�odH�%(H�D$X1�H��uL�9 H�5GI�:�o����I��H��1�1�L��H�5��1��������{@tH�{ H�SH9�~&�1H��8 H�5�1�H�81��Z���L���2����]H�L$H)�H9�}"L��1�����L�
�8 H�5aI�9����.H�kH�4$H�H���L��L�D$LC ���H�|$���H��H�T$XdH3%(H��t���H��`[]A\���H�t	H� ���PH�8 H�5?H�8�g���1�Z�H��[]A\�'���AUATUH��SH��xH�OH�_dH�%(H�D$h1�H�G H�$H�D$H��uH�
�7 H�5�H�9�
����3��H��A��I��H��H�5tHD�L�d$H�L$1�L��1��������A��H�\$H�|$E�H�t$ A��A��H��y	H]H�\$L�D$M��yH�D$�L�UM9�~L�T$L�$M��yL]L�$H�$H��y
H�$�
H�EH9�~H�$L�UL�D$M�L$L��E��tL��H)�Mc�L9�r?L�,3M9�r61�H9�}D�D8u H����uL������H��H+}���H���L��L�����H���u���H��H�L$hdH3%(H��t����H��x[]A\A]�����J�����1��?�����VH�WH��uL�6 H�5JI�8�r����4H�G H;G|H�=�5 H�5�H�?�P����H�HH�O �<Y����1�Z���SH��H�_dH�%(H��$�1�H��uH��5 H�5�H�8�����4H��1��{�����t
H�|$0�}���H��H��$�dH3%(H��t����H�Ġ[���APH�GH��uH�
05 H�5iH�9����2H��xH9wH�E5 H�5,H�:�n����H�<0Y����1�Z���USH��H��H�odH�%(H�D$1�H��������H�$H��uL��4 H�5�I�8�����`H��4 H��H��1�H�5�1�����t?H�{ H�S1�H9�}H��H)�H�4$H��xH9�~H�$H�4$H{�8�H�<$H{ H��H�L$dH3%(H��t��H��[]���AUATUSVH�oH��uH�4 H�5<H�:�d��_H�G H�_I��H9�}&L�lH�ھ
H�H)�L�����H��tH�X�YH�=�[]A\A]��L)�L��H����I\$ H��ZH��[]A\A]���UH��SH��(H�_dH�%(H�D$1�H��uL�[3 H�5�I�8���H��H�L$H�T$I��H�5w1�1��w�����}@tH�L$H��y�aH�3 H�51�H�81����]H�t$H��x;H�$H��x2H�]H��H)�H9�#H)�H9�H�}H�H��H�H��2 H��H��2 H�5�1�H�:��H�L$dH3%(H��t�L�H��([]���UH��SH��(H�_dH�%(H�D$1�H�D$H��uL�?2 H�5xI�:���H�EH��H�L$1�H�T$L�D$H�D$H�5W1��P����H�|$H��x	H�]H9�|L�
�1 H�541�I�9�=��H�T$H��yL��1 H�5)1�I�8���oH��������H)�H9�~H�=�1 H�51�H�?����CH�H9�}H)�H�\$�T$H�t$H}���tH�5C1 1�H�>����
H�x1 H�H�L$dH3%(H��t���H��([]���UH��SH��(H�_dH�%(H�D$1�H�GH�D$H�D$H��uL��0 H�5
I�8�8��H��H�L$H�T$1�H�5V1�����tsH�t$H��xH�|$H��xH�UH)�H9�~H�={0 H�5'1�H�?����9�M@���t%H}�����uH�=0 H�;1�����
H�r0 H�H�L$dH3%(H��t���H��([]���AUATUSQ�0~H�0 H�5qH�8�Y�1��RD�g4H�o�G4����H��H�G��I��E��xD����H��tH�sH�����L����H��/ H�Z[]A\A]���SA��H�WH��H��uH�p/ H�5�H�8������'�{@H�KH��H��A��E���������x�C01҉�[���AUATUSH��H��dH�%(H�D$x1�H�uL��. H�58I�;�`����\�@tH�NI��H��H�Q`H��u%�!H��. H�5�H�81��b����H����L�%�. I�4$��H��H���u�>�H����Hky�H��x�H9kI�<$H�5}������H�S. H�:M��uH�5������M�EM�H`M��t
I��uH�5��t����pH��L���q�H���u,��H���NL��- H�5�I�:�7����3H=�w�H�[�+1��H;
�- ��L�d$H�l$H�L$L��H��������H�{H�L$H��L���&�H��M��uL�-g- H�5pI�}�����L�d$ 1�L��L���
�����H9l$0t#H�O- H�5`H�8�x�L�������oH��tE1�H�|$H�|$uL�[H�t$ H��I�L���� H9�}L�D$ L�SE�0H��E�:H|$��L���9�1��H��, H�5d
H�;����H�L$xdH3%(t�G�H�Ĉ[]A\A]���AUATUH��SH��(H�_dH�%(H�D$1�H��uL�8, H�5qI�;���mH�FH��H�P`H��tuH��tkL�-;, I�u�z�I��H���u��1�H���*Ley �H��y��I�}H�5�1��0��L9e~�L�UC�<"��H����H;�+ ��L�l$I��H�L$1�L��L���x�����H�}H�L$L��L����H��H��1�H�=�	�6�H���H�|$uH�<$H��H}��H���jH�����I��H��u
�|�H���PH�4$1�L�EE�0E�L=H��Ht$H9�u�H��L�����L��H������H�
�* H�5�1�H�9�'�H�T$dH3%(H��t�o�H��([]A\A]���ATUSH�uL�~* H�5�I�:������I��H��x	H��H9wL�
�* H�5nI�9�����H��H��uL�9* H�5�I�8�����lH�B���uH�=9* H�5�H�?�b����DH���%�H��u؃{@tH�����H�s�1�B�&�H��) H�5�
1�H�:�\���[]A\���USH��Q����{4H��x�v�H�{H��t	H�s��H���|�H�{8tH����H�CH��H��@Z[]����UH��SH��H�_dH�%(H�D$1�H��uL�
) H�5VI�9�~��H��H��H�51��E�1ۅ����}0~L��( H�5�I�8�?���E@����tH��( H�5�1�H�81��W��H�4$H��xH��������H�U(H)�H9�}H�=|( H�5�1�H�?����[�}4���tH�����tH�uH�}1��H�$�
�H���uH�5(( 1�H�>����H�$H�EH�]H�Q( H�H�L$dH3%(H��t���H��[]�1���ATI��UH��H��S���H��tH��H��L��H����H�+���[]A\�f�H�=�- H��- H9�tH��' H��t	�����H�=�- H�5�- H)�H��H��H��?H�H�tH�m' H��t��fD�����=E- u+UH�=J' H��tH�=f# ���d����- ]������w������UH�=T+ SQ�����������H�=Y* ��H��H�������H�����H��H�������H��& H�5�H��H��K�H��* H�5nH���5��H�5�H���q����H�5|H���]����H�5rH���I����H�5iH���5����H�5`H���!����H�5XH���
����H�5RH������ H�5MH������ H�5BH��������G�H�57H��Hc������+�H�5$H��Hc����1�H�5&H������H�5!H���t����H�5H���`����H�5H���L���1�H�5
H���;����H�5H���'����H�5�H�������H�5�H������H�5�H������	H�5�H�������
H�5�H�������H�5�H������dH�5�H������H�5�H������
H�5�H���s����H�5�H���_����H�5�H���K����H�5�H���7����H�5�H���#����H�5�H������H��Z[]���H��H���mmap closed or invalidin|iiilinilmmap.__new__cannot mmap an empty filen|i:seekunknown seek typeseek out of rangeb:write_bytewrite byte out of rangey*:writedata out of rangey*|nn:rfindy*|nn:findread byte out of rangemmap index out of range|O&:readnnn:movei|nn:madvisemadvise start out of boundsmadvise length invalidmadvise length too large|nn:flushflush values out of rangemmap indices must be integermmap indices must be integersn:resizenew size out of rangeerrorPROT_EXECPROT_READPROT_WRITEMAP_SHAREDMAP_PRIVATEMAP_DENYWRITEMAP_EXECUTABLEMAP_ANONMAP_ANONYMOUSPAGESIZEALLOCATIONGRANULARITYACCESS_DEFAULTACCESS_READACCESS_WRITEACCESS_COPYMADV_NORMALMADV_RANDOMMADV_SEQUENTIALMADV_WILLNEEDMADV_DONTNEEDMADV_REMOVEMADV_DONTFORKMADV_DOFORKMADV_HWPOISONMADV_MERGEABLEMADV_UNMERGEABLEMADV_HUGEPAGEMADV_NOHUGEPAGEMADV_DONTDUMPMADV_DODUMPMADV_FREEclosedcloseread_bytereadlinetell__enter____exit__mmap.mmapfilenolengthflagsprotaccessoffsetmemory mapped length must be positivememory mapped offset must be positivemmap can't specify both access and flags, prot.mmap invalid access parameter.mmap offset is greater than file sizemmap length is greater than file sizemmap can't modify a readonly memory map.source, destination, or count out of rangecannot close exported pointers existmmap doesn't support item deletionmmap item value must be an intmmap item value must be in range(0, 256)mmap object doesn't support slice deletionmmap slice assignment is wrong sizemmap object doesn't support item deletionmmap assignment must be length-1 bytes()mmap can't resize with extant buffers exported.mmap can't resize a readonly or copy-on-write memory map.Windows: mmap(fileno, length[, tagname[, access[, offset]]])

Maps length bytes from the file specified by the file handle fileno,
and returns a mmap object.  If length is larger than the current size
of the file, the file is extended to contain length bytes.  If length
is 0, the maximum length of the map is the current size of the file,
except that if the file is empty Windows raises an exception (you cannot
create an empty mapping on Windows).

Unix: mmap(fileno, length[, flags[, prot[, access[, offset]]]])

Maps length bytes from the file specified by the file descriptor fileno,
and returns a mmap object.  If length is 0, the maximum length of the map
will be the current size of the file when mmap is called.
flags specifies the nature of the mapping. MAP_PRIVATE creates a
private copy-on-write mapping, so changes to the contents of the mmap
object will be private to this process, and MAP_SHARED creates a mapping
that's shared with all other processes mapping the same areas of the file.
The default value is MAP_SHARED.

To map anonymous memory, pass -1 as the fileno (both versions).;"��8 ��` ��x(���U��������������02��\���.��]�i�8�t��*�����
��g�2�(��t���:��@����,�H����������a�p��p�@zRx�$���FJw�?:*3$"D���\���p���-L[����1E�kD����iF�A�A �P�y�H�M�M�S�� AAB�������(���E�D�D@	AA$@����E�D�D0�AA0h���F�A�A �G� AAB�n��/UY(���7B�D�G �fABzRx� ���$9��DAB8)���B�B�A �D(�D��(A ABBX���l�������^EP
EC �����E�G�tA�"��]FI
JC$�_���E�A�G0�AAH��F�B�A �A(�A0X
(H ABBEW(D ABB(XL�E�D�D@AA(�3�_E�D�D@OAA$�f�E�D�D@�AA4�D��F�B�A �A(�A0s(A ABB��ZE�T8,���F�B�A �A(�J��(A ABB8h[��F�B�A �D(�DP�(A ABB(����F�A�A ��AB$���ZE�A�D LAA(���[E�D�D0KAA($(��E�H�A �AAzRx� �� ��GNU��8p8�[ Ufv@
�;�[ �[ ���o`��
m^ ��@�	���o���o�
���o�of
���o@\ p�������� 0@P`p�������� 0@P`p�������� 0@P`d??$k?�/�<o)�<a)M=�.�<+-�<,�<�*q?z){?�+�=V6/<i$�=�)�?~'�<c&Z<�%�?� �?U$0p x 73o0x Z*5�?��������k?�?�?�?�?�?�?�?H�5�b �b �b C8`` ` � GA$3a1@�;mmap.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug
����7zXZ�ִF!t/���]?�E�h=��ڊ�2N�$fǘ��a3��m�O���q�51��ƙ���v;J����R�t���W��2##��-���0�T���n�L	C4c�bM������γ~�e��lH�gOO��V�7��մ�d���Z��h�	N�H��3�Gz2��'J��ړX�/���?��ɹ��1 _����m�.yvܲ��O����wq��orC�	���5���޼��6#��n^���EJ�
1)�D��g<:��0d�$��!��lWp�J<�zLh�2\�=�m���������������/�M˄[�rYԟ�bU5߅�'�t!�zv{N�$�kHB
�)�!xT�-��&wƢE�$y����R�Ԧ�b�:]a�V��`�f��}��VR
�n����6cI+���/.r�9�����V�Z���6�3�>mxG������lX��\�i��Y�a5p��췝�z�'����l�H��6�� ��(=n?�{��m-M�y1��<R�8������#�?�|	C��=u�F�������A�d,�gy>#��9�28��	F�`�@A����Y'��jp�����_�=x`%�m�͈�p�}2��*r����>T�j"����|�t/��A�NJ�J�.�
�x�#]x�ɍ��fAf��~8�+4�w
��t�Y�I7��+L|yRy[/����7F�0U2��f�h�;�1@a��p�g~/���cC=)Ϲ-���{ү߃Գ��'_���+� ֒@�h�]U�����tc�Һ8,���u��o 5�����?W/aF�����([H�1	d���7~vuJt"Dh��zC72�3��і@��F'm�>^o�/��޲u��^>�?®�*Y���z����vɷ�Ff��a�����4ew����l�>8CA*<��ȉT׬�r<��l���S��	��HB;~NCa
�„����l�4�#��.��5���r|����k$.�8&Waҧ>cx�:Z <c���M,j����V�f*�X���]��xvq��.�WoX�{0�B���i��Ė084�T�
����G��8��4�#
5�<><�c����Tٽ~'x��X�O��'d����y N�e�	�&�h=��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(��`0��m8���of
f
�E���o�
�
PT@@�^B���h@@c``nppwp p H}�;�;
��;�;n �PGPG�pHpH���M�M ��[ �[��[ �[��[ �[�\ \�^ ^�` `� ��e �e��e`�e$
�e\@f�k(lib-dynload/_blake2.cpython-38-x86_64-linux-gnu.so000075500000262360151153537500015420 0ustar00ELF>�!@�]@8	@�A�A KK!K!�� 0L0L!0L!888$$�A�A�A  S�td�A�A�A  P�tdP6P6P6��Q�tdR�tdKK!K!��GNUx���=ekS�'�b��"��83�	P((�%"@368:;=?BC�8�Z�೥<l��qX�+�2}wS��|%���E��'�D�[CE����Դ��a7o+�К~G�~G��[�� Z�!�:b&S ���1, �F"�D}���[��o���`,���M����`T!�D���>@Q!��V!��)5��IW!������-z�6)�t��M�V!��0�l��|*,���';c-���1�__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libssl.so.1.1libpthread.so.0libc.so.6__stack_chk_failPyLong_FromLongPyUnicode_FromStringPyThread_acquire_lockPyThread_release_lockPyEval_SaveThreadPyEval_RestoreThread__explicit_bzero_chkPyObject_FreePyThread_free_lock__memmove_chkmemset__memcpy_chkPyBytes_FromStringAndSize_Py_strhexPyInit__blake2PyExc_ImportErrorFIPS_modePyModule_Create2PyBlake2_BLAKE2bTypePyType_TypePyType_ReadyPyModule_AddObjectPyDict_SetItemStringPyModule_AddIntConstantPyBlake2_BLAKE2sTypePyErr_Format_Py_DeallocPyBlake2_blake2b_init_paramPyBlake2_blake2b_initPyBlake2_blake2b_updatememcpy_PyArg_UnpackKeywordsPyFloat_TypePyType_IsSubtype_PyLong_AsIntPyExc_ValueErrorPyBuffer_ReleasePyObject_IsTruePyObject_GetBufferPyBuffer_IsContiguous_PyLong_UnsignedLongLong_Converter_PyLong_UnsignedLong_ConverterPyExc_TypeErrorPyErr_SetStringPyErr_OccurredPyExc_OverflowError_PyArg_BadArgumentPyExc_BufferError_Py_NoneStructPyThread_allocate_lockPyBlake2_blake2b_init_keyPyBlake2_blake2b_finalmemmovePyBlake2_blake2bPyBlake2_blake2s_init_paramPyBlake2_blake2s_initPyBlake2_blake2s_updatePyBlake2_blake2s_init_keyPyBlake2_blake2s_finalPyBlake2_blake2s_edata__bss_start_endOPENSSL_1_1_0GLIBC_2.14GLIBC_2.4GLIBC_2.25GLIBC_2.3.4GLIBC_2.2.5U m����&ii
1���;ti	Fui	RK!�)K!�) K! K!@K!.HK!Q.PK!�.XK!�.`K!�.hK!�.pK!�.xK!�.�K!�.�K!�.�K!�.�K!�.�K!�.�K!.�K!Q.�K!�.�K!�.�K!�.�K!�.�K!�.�K!�.L!�.L!�.L!�.L!�. L!�.P!A.P! e(P!F.0P!ePP!Q.XP!e�P!].�P!0e�P!2�P!e.�P!0��P!�1�P!b.�P!�q�P!`1Q!l.Q!�Q!1XQ!s.pQ!�e�Q!@2(R!�P!8R!P!xR!��R!@K!�R!{. S!A.(S!0JHS!F.PS! JpS!Q.xS!J�S!].�S!@J�S!`4�S!e.�S!pq�S! 4T!b.T! �T!�3 T!l.(T!@�8T!`3xT!�.�T!�JU!�4HU!�S!XU! S!�U!`�V!�K!V!�.hV!	.pV!�5�V!�V!�O!�O!�O!�O!�O!�O!�O!�O!�O!�O! �O!3�O!#�O!$�O!5XN!`N!hN!pN!xN!�N!	�N!
�N!�N!
�N!�N!�N!�N!�N!�N!�N!�N!�N!�N!�N!�N!O!O!O!!O!" O!%(O!&0O!'8O!(@O!)HO!*PO!+XO!,`O!-hO!.pO!/xO!0�O!1�O!2��H��H��2!H��t��H����5R1!�%S1!��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&��������%�.!D���%�.!D���%�.!D���%�.!D���%�.!D���%�.!D���%�.!D���%�.!D���%�.!D���%�.!D���%�.!D���%�.!D���%}.!D���%u.!D���%m.!D���%e.!D���%].!D���%U.!D���%M.!D���%E.!D���%=.!D���%5.!D���%-.!D���%%.!D���%.!D���%.!D���%
.!D���%.!D���%�-!D���%�-!D���%�-!D���%�-!D���%�-!D���%�-!D���%�-!D���%�-!D���%�-!D���%�-!D���%�-!D1�L�������tL����(L���>����(�t���H����I�����L���H���L����I(1�L�������tL����CL������<C� ���H����I���\���L����L�����BL��$��`I���L�d$�L�l$0H��I��$�����H�����I�t$P�,L���H�A�\$H�\$D�^D�fD�_D��$�D�L9�u!��$�H�T$pL�D$x=��:I�CL��$���H1������u!�H���H����H�����H������L�l$ H�s0��L����sD��$�H�t$L9���H���L��$�H��t����sL���)�����QM�}0��1�H�D$H����)�L�����L��L���['�l$$D�L$(D�T$ D�\$,��A��D��D���A��E��E�����E��E��H���L$��@��L	����D�t$H��A���$D��H	�E��A��D��H����E��D�D$4H	�A������H��E��H��D��L	�L	�E��E��H��H���t$0�|$<L	�D�,$H��A��H	���D��E��H	�H����H��L	�A��H��L	�A��D�T$8L	�H�$D��A��H����E��A��L	�E����A��H��E��H��A��A��H	�D��H	�E��H����H����H	�L	���D�L$8H��H�D$��E��L	����@��H����A��@��H��L	�A��E��H��L	�E��D�D$8L	�fDo,$L��$�H��D)�$H	���L$8H��H��H	���H	� H��H�$H�T$H��$H	�L��H��L	�H��L	�H��H	�H��L	�H�D$fDo4$D)�$���H����x�����$�@��L�aL1�L�������tpL�\$L�l$0�,L��I�sPA�[�H�H�\$D�vD�&fD�w��$�D�'H9�u[��$���DU�OL��$��CZL������?Z�����H��H�D$H�������H������e���M���L��$��YDŽ$������nL��$p�n�u���H����H�����H���I����?ZH��H��1�1�H�5������H������OH�mt1��H�mu�H�������H��1�����qH�������H�mu�H��1�����NH�mu�H������:H�mu�H��1��o����$H���b����PH�m�q���H���J����H���=�����H�m�L���H��1��#�����H�m�2���H�������H�������H�m�
���H��1�����H�m��H�������H������wH�m����H��1�����ZH�m�����H������BH�������H�m�����H��1��f����H�m�u���H���N����H���A����H�m�P���H���)�����H�m�8���H��1���������H��XH�V�dH�%(H�D$H1���H��?wC@�4$H��I���H�~1�W��D$�L��)D$ H�D$H�D$	)D$0��}H�L$HdH3%(t�=���H��X�I�L$H�E1�H�5
H�=����T�RL��E1�L�,!1�1�H��$�VH��jj�*���H�� I��H���"�H���\H�D$I���c�L��H��1�E1�H�5�������L�Q%!H�5�E1�I�8�����ŝE1�齝L�
+%!H�5�E1�I�9��韝L�
%!H�5vE1�I�:����遝L�
�$!H�5�I�9���饡L��$!H�5=E1�I�;����H�L��$!H�5�I�:����H������d�L�%�$!H�5�I�<$E1��X�����I�L$ H��E1�H�5�H�=��q����ߜI�L$H�fE1�H�5}H�=w�J���鸜I���H�H�5_H��1���1��L�%$!H�5 I�<$����H��$�����1��1���H��#!H�5�H�;���1��b�H��$���H��#!H�5dH�:�l���1��8���USH���dH�%(H��$�1�H�F�H��?v���I��H�I�H��?w�H��I����t�@�4$H��H���H�~W�D�L$�H��)D$ H�D$H�D$
)D$0��z��x�H�\$@1�� L��H��L��󫹀H���"��H��H���2{����H����1�H��$�dH3%(t���H���[]���AVAUATUH��SH��pdH�%(H��$h1�H����M������uI��H��u���mI��M��H��uM��u�H�]�H��?w�I��@w�M��H��t4L��H��H�������x�L��L��H���nz��x�H��L��H���<��H��H���u�����y��H��$hdH3%(t��H��p[]A\A]A^���H��8H�V�dH�%(H�D$(1���H��w;@�4$H���D$f�D$�D$H�D$H�D$H�D$�Q�H�L$(dH3%(t��H��8�L�
8!!H�5�E1�I�9����H�-!!H�5�E1�H�}����r�L�� !H�5dE1�I�:���T�L�=� !H�5FI�?E1����6�I�OH��E1�H�5�H�=}�����L�� !H�5E1�I�8�_����RL��E1�L��#!1�1�H��H��$�Sjj���H�� I��H���:�H����H�D$H���+�L�: !H�5KI�:���H������I�OH�!�E1�H�58�H�=����X�L��H�?�1�E1�H�5��E��8�E1��0�L��!H�5�I�;����I�O H���E1�H�5�H�=\������H���_�H��H�5��L��1����1���L�a!H�5rI�:��H�|$x�0�1��1��H�#!H�5H�;���1��H��$����H��!H�5��H�8���1��s���USH��xdH�%(H�D$h1�H�F�H��v���I��H�I�H��w�I��H��t�@�4$H��H��D�T$f�D$�D$H�D$H�D$H�D$�\���x�H�\$ 1��L��H��L���@H�����@H��H���t��@�@H���"�1�H�T$hdH3%(t�K�H��x[]���AVAUATUH��SH��dH�%(H��$�1�H����M������uI��H��u���mI��M��H��uM��u�H�]�H��w�I�� w�M��H��t4L��H��H�������x�L��L��H��趽��x�H��L��H����H��H�������y��H��$�dH3%(t�y�H��[]A\A]A^�f�I�т�RQAWAVAUATUSH��H���oH�NPdH�%(H��$x1��oV�o^ �of0H�F@H�L$8L�N`L�&)�$��on@�ovP)�$�o~`H�~)�$H�V L�~0H�D$0)�$ L�L$@I�l>+�h�)�$0)�$@)�$P�Do�DoK�DoS �Do[0H�|$D)$L�4$L�C@D)$H�,$�oFpD)$L�$D)D$pM�D)$H�$M�L�$$L�d$xD)�$�M1�H��$�L�$�M1�H�T$ I�ɼ�g�	jI�I�� )�$`H��$`D)�$�I�H�{HM�M1�H�t$hH�sPD)�$�L1�I��L�$L1�M�I�;�ʄ��g�H�� M1�I�I��L1�M�H��M1�I�M��I��H�k�A��كL1�I��H��L�l$PM��I�L1�H�H�H�H1�H�$H��$�L�l$(L��$�L�\$`H1�H�+���r�n<H�� I�H�M�M�kXH1�I�y!~��[H��M1�L�$(H�M1�H1�I��6_:�O�I�� H��M�H�L1�H1�H��H�I�M1�I��M�L1�H��H�T$HH�T$0I�H�T$8I�M1�L�$8I�H�T$HI�� I�L�M1�L�$HH1�I�� H��M�I�L1�M1�H��I��I�L�l$XL�L�l$@M1�I��H1�L�M�L�l$hH�H�L1�H1�H�L�l$HH�� I�L1�H��M�L�l$PH�$XH�Lt$HM�H1�L1�L�$hH��H�� I�I�L1�M1�H��I��M�L1�H��I�M1�I��M�M1�Lt$8I�� M�M1�I��M�M1�I��Ld$ H�$8I�H�M�L1�H1�Ld$0M1�H�� H�� H�$hI�H�I��L1�H1�L�l$PL�l$XH��H��I�H�L1�H1�H��H��I�H�L1�H1�H�H�L�$XL�$�I�I�M1�L|$(I�� M�L1�H��I�M1�I��M�M1�Lt$@I�� L1�L�H��H1�H��I�M1�I��L�l$XL$$L�I�H1�L�l$PM1�H�I�� M�H�$HL�$H�L1�M�Ld$H1�H��H�$(L1�H�� I�H�� L�$I�M1�I�L1�I��M1�H��M�I��H�L1�H1�H�H��I�L1�H��M�L�$HLd$@L1�I�H��L1�L$$I�H�� M1�I�I��L1�M�H��M1�Lt$0I�I�� L1�M�H��M1�I�I��M�M1�I��M�M1�I��L1�H�$Lt$8L�l$PL�l$XH�H�L�$hH1�Hl$I�I�H�� M1�H�L�$XI�� H1�M�H��L1�H�H��H1�I�H��M1�H�I��H1�M�H�L1�H��M1�L�$Lt$HI�I�� H�$(M1�L�Ld$(H�I�� H1�H1�H��M�H�� L1�I�I�H��M1�L1�I�I��M1�L�L�l$XL�l$PI��H1�M�H�L1�H�H��L�$8H�$�M�H�L�$(L1�L|$ H1�H�� H��I�I�M1�L1�I��H��M�L1�H��I�M1�I��M�M1�L�$8I�� M�M1�I��M�M1�I��L�$M�I�M1�L1�L�$�I��H�� L�l$PH�$XI�H�L1�L�l$XH1�H��Hl$@H�� I�H�L1�H1�H��H��I�H�L1�H1�H�H��H�H1�H�L�$HLt$I�I�L�$M1�L|$HI�I�� M1�M�I�� L1�H��I�M1�I��M�M1�Lt$(I�� L1�L�H��H1�H��I�M1�I��L�L�l$XL�l$PH1�H�M�Hl$ Ld$8H�L1�L�$hH1�M�H��H,$H�� I�L1�L|$0I�M1�H�� L1�I�I��H��M�M1�H�L1�I��H1�H�H��I�L1�H��M�L�$8L�$L1�I�H��L1�L�$(I�H�� M1�I�I��L1�M�H��M1�L4$I�I�� L1�M�H��M1�I�I��M�M1�I��M�M1�I��L1�Hl$L|$8L�l$PL�l$XH�I�H1�Hl$ H�Lt$HM1�H�� L�$hI�I�� H�M�H1�L1�H��H��H�I�H1�M1�H��I��H�M�H1�L1�H�H��M1�L�$HHl$(I�I�� L�$�H�M1�L�Ld$@H1�I�� H1�H�� M�H��I�L1�I�L1�H��M1�I�I��M1�L�L�l$XI��H1�M�H�L1�H�H��Hl$0L�$L�l$PH�Lt$H1�M�H��L1�L�$XI�H�� L1�I�H��M1�I��M�L1�H��I�M1�I��M�M1�Lt$@I�� M�M1�I��M�M1�I��Ld$(H,$I�H�M�L1�H1�Ld$8M1�H�� H�� H�$HI�H�I��L1�H1�L�l$PL�l$XH��H��I�H�L1�H1�H��H��I�H�L1�H1�H�H�L|$0Lt$ I�I�L�$(M1�L�$I�I�� M1�M�I�� L1�H��I�M1�I��M�M1�L�$XI�� L1�L�H��H1�H��I�M1�I��L�L�l$XL�l$PH1�H�M�H�$hL�$�H�L1�M�L�$H1�H��Hl$HL1�H�� I�H�� L�$8I�M1�I�L1�I��M1�H��M�I��H�L1�H1�H�H��I�L1�H��M�Lt$@L�$�L1�I�H��L1�L�$hI�H�� M1�I�I��L1�M�H��M1�L�$I�I�� L1�M�H��M1�I�I��M�M1�I��M�M1�I��L1�Hl$HL|$ L�l$PL�l$XH�I�H1�H�$XH�M1�H�� L|$8L4$I�� H�I�M�H1�L1�H��H��H�I�H1�M1�H��I��H�M�H1�L1�H�H��M1�Ld$(L�$(I�I�� H�$8M1�L�L�$H�I�� H1�H1�H��M�H�� L1�I�I�H��M1�L1�I�I��M1�L�L�l$XL�l$PI��H1�M�H�L1�H�H��L|$0Hl$M�H�L�$XL1�L�$HH1�H�� H��I�I�M1�L1�I��H��M�L1�H��I�M1�I��M�M1�L�$HI�� M�M1�I��M�M1�I��L�$(Hl$@I�H�M�L1�H1�Ld$HM1�H�� H�� H�$�I�H�I��L1�H1�L�l$PL�l$XH��H��I�H�L1�H1�H��H��I�H�L1�H1�H�H�L�$L�$I�I�L�$hM1�L�$8I�I�� M1�M�I�� L1�H��I�M1�I��M�M1�L4$I�� L1�L�H��H1�H��I�M1�I��L�L�l$XL�l$PH1�H�M�Hl$0L|$H�L1�M�Ld$ H1�H��Hl$(L1�H�� I�H�� L|$8I�M1�I�L1�I��M1�H��M�I��H�L1�H1�H�H��I�L1�H��M�Lt$(L1�H��I�M1�I��M�M1�L�$hLd$HI�I�� M�L1�L�$8M1�H�� I�I��M�L1�M1�H��I��I�M�L1�M1�H��I��I�L1�L�l$PH�$HL�l$XL<$H�H�I�H1�H�$Lt$@M1�H�� L|$0I�I�� H�M�H1�L1�H��H��H�I�H1�M1�H��I��H�M�H1�L1�H�H��M1�L�$XLt$I�I�� H�$�M1�L�L�$(H�I�� H1�H1�H��M�H�� L1�I�I�H��M1�L1�I�I��M1�L�L�l$XL�l$PI��H1�M�H�L1�H�H��L|$8Hl$ M�H�Lt$8L1�L�$H1�H�� H��I�I�M1�L1�I��H��M�L1�H��I�M1�I��M�M1�Lt$I�� M�M1�I��M�M1�I��Ld$0H�$(I�H�M�L1�H1�Ld$ Hl$(H�� H�� M1�I�H�I��L1�H1�L�l$PL�l$XH��H��I�H�L1�H1�H��H��I�H�L1�H1�H�H�L�$�L�$hI�I�M1�L�$I�� M�L1�H��I�M1�I��M�M1�L�$HI�� L1�L�H��H1�H��I�M1�I��L�l$XL�$8L�I�H1�L�l$PM1�H�I�� M�H�$L�$XH�L1�M�Ld$HH1�H��Hl$@L1�H�� I�H�� L<$I�M1�I�L1�I��M1�H��M�I��H�L1�H1�H�H��I�L1�H��M�L4$Ld$L1�I�H��L1�L�$I�H�� M1�I�I��L1�M�H��M1�L�$�I�I�� L1�M�H��M1�I�I��M�M1�I��M�M1�I��L1�Hl$ L|$(L�l$PL�l$XH�I�H1�H�$H�Lt$0M1�H�� L�$(I�I�� H�M�H1�L1�H��H��H�I�H1�M1�H��I��H�M�H1�L1�H�H��M1�Ld$8Hl$@I�I�� L�$8H�M1�L�L�$HH1�I�� H1�H�� M�H��I�L1�I�L1�H��M1�I�I��M1�L�L�l$XL�l$PI��H1�M�H�L1�H�H��L|$HH�$XM�H�Lt$HL1�L�$hH1�H�� H��I�I�M1�L1�I��H��M�L1�H��I�M1�I��M�M1�Lt$8I�� M�M1�I��M�M1�I��Ld$ M�I�M1�L1�Ld$0I��H�� L�l$8H�$8I�H�L1�L�l$XH1�H��H�$hH�� I�H�L1�H1�H��H��I�H�L1�H1�H�H��H�H1�H�L�$XL$$I�L�$�I�M1�L|$(I�M1�I�� I�� M�L1�H��I�M1�I��M�M1�Lt$@I�� L1�L�H��H1�H��I�L�t$pM1�I��L�L��$�L��$HH��$�H1�H�L$8H��M�Ld$I�L1�I�H��$�H��L1�L�$(I�H�� L�d$xM1�I�fDod$pI��L1�M�H��L��$�L��$�I1�I�,H��$H1�I��H��$�L�H��L��$�H�I�H��$�H1�L��$�I1�H�$I��I��I�� L��$�M�L1�I��I��J�4I��H��$�M1�I��L��$�M�L��$�M1�fD�$�I��L��$�H�|$`fDo�$�fo�$��og0�Do/�Do�oW fD�$�fE��)$$f�$�fo�$�D'f�$�fE�f��f��DwO _0H��$xdH3%(uH�Ĉ1�[]A\A]A^A_�����fD���������������f���H�=�������AT1�USH�GH��H���0H��H��tQHǀ�L���M���c��H�}H�s��H�}PH�sP�,�H���D�NfD�OM���G��H��[]A\�D��SH�����H���@H������H�{P�fH��������H���H��uH��[�I��f�����Hǃ���ff.�AWAVAUATUSH����^ �dH�%(H��$�1���n�o�oV�\$�_�o^ �of0�w )�$���o/D��$�)�$���ow)�$���$�1�D�)l$P��RQ�T$H��)�$�D��g�	j)t$`D1����1��A��t$4D1�A��A��D�D$DD�t$dD�\$TD��$��w$D�D$XE�E�D1�D�$�A��w(A��h�A��A��$��g�A1�A��G�3D�\$hE1�D�T$D��E��ډ\$<A1։T$D���A��1�A��t$lA��ك�$�A��A��r�n<A1�A��F�$�W,E1�D�d$D��$�E��A��D�D�T$@D��$�A1�A��D�\$$D�\$\A�E�D1�EӁ���[��D��:�O�D1��A�D1�D�\$D�\$��D�A�D�D1�1��$������t$(�A1�A��D�1ʉL$��ӉT$0�T$A1މ\$ ��$�D��D�t$4�4�T$$���L$,�A1��$�A��E�D1‰���A1��t$�t$D���AЉT$4�T$HD1�D�D$$��D��t$<�L$8�L$(A�D1�D�$���A�D1���E�4D�D$D�$�D1�D�t$D�t$��A��t$(�t$@D1����L$<�L$DA�D1�D�$���A�D1��A�D1�D�D$D�D$��D�$�A��t$@�t$4D1��A�D1�A��A�D1���A�D1�D�D$��A��t$4�t$(D1�D�|$���L$D�L$D�D
�L$,A�D1��A�D1��E�E�<D1�D�|$(A��A��D�D$HEƋt$8D1�D�|$@D�t$,D�t$D�$���A��L$�L$ E1�D�$�A��D�1�A��t$0A��E�E1�D�t$A��D�D�|$8D�|$A1�D�$�E��D�D$<A��E�D�t$ D�t$$D1�E��A�E1�A��E�D1�D�|$��A�E1�A��D�D$0D�D$E�DD$D1�A��D�<1�L$D1���A�D1�D�D$��A��t$<�t$(D1�D�|$��D�0�t$4�L$@�L$ A�D1�E��A�D1��E�<D1�D�|$ ��A��t$(D1�D�t$$���L$4D�D$�L$0D�$��t$HD�|$A�D1��A�E�D1���E�4D�D$D�$�D1�D�t$D�t$,��A��t$0�t$8D1����L$H�L$DA�D1�D�$���A�D1��A�D1�D�D$D�D$��D�$�A��t$8�t$(D1��A�D1�E��A�D1���A�D1�D�D$��A��t$D�t$0D1�D�|$(D�|$ ���L$L�L$@F�:A�D1�A�A��A��E�D1��A�E1�D�D$ E��A��E�D�D$0D1�D�t$,D�t$��D�$��L$�t$4D�D$8�L$A�E1�E�E��A��D�1�A��A��E�E1�D�t$E��D�|$A��D�D�t$4D�t$$A1�D��D�D$H��D�$��t$8�t$<E�D1�D�$���A�E1�A��E�D1�D�|$��A�E1�A��D�D$$D�D$A�DD$D1�D�$���D�<1�L$D1���A�D1�D�D$D�D$ ��D�$�A��t$<�t$DD1�D�|$D�|$8��E��L$@�L$D1��A�E1�E�A��E�D1�D�D$E�
��A��t$8E1�D�t$ E��A��D�t$DD�t$$�t$0D�|$(E�L$LD1�E��A�E1�A��E�D1�D�D$D�D$��D�$�A��t$0�t$4A�E1�A��D1�A�D�t$HD�t$,��A�D1��A�D1�D�D$D�D$��A��t$4G��t$8D1��A�D1�D�$���A�D1���A�D1�D�D$$D�D$��D�$�A��t$8�t$0D1�D�|$(E����L$L�L$@A�D1�E��A�D1��E�D1�D�D$D�D$4A��A��E�D�|$0D�|$DD1�D�t$,D�t$D�$���E��L$�L$E1�A�A��D�A1�D����E�46E1�D�t$D�|$A��D�$�D�t$ D�D�D$4D�D$H1��Eljt$@�t$<D1�D�$���A�E1�A��E�D1�D�|$��A�E1�A��D�D$<D�D$$E�DD$D1�E��D�<1�L$D1���A�D1�D�D$A��t$8A��E�D�D$DD�D$D1�D�$�D�|$���L$H�L$@A�D1�A��A�D1��E�<D1�D�|$D�|$(A��t$A��E�D�D$$D�D5�t$0D1�D�t$ ���L$8�L$<A�D1�A���E�<7D1���E�4D1�D�t$��A��t$0D1����L$<D�D$�L$L�t$4D�$�D�t$,A�D1�E��A�D1��A�D1�D�D$D�D$��D�$�A��t$4�t$$D1��A�D1�A���A�D1���A�D1�D�D$$D�D$��D�$�A��t$@�t$0D1�D�|$(E����L$L�L$HA�D1���A�D1��E�E�D1�D�D$D�D$4��A��t$0�t$8D1�D�t$,D�t$��G�t5�L$�L$A�E1�A�E��D�D$A��D�1��A�E1�D�t$E��F�<D�D$<A��D�E�D�t$41���t$8�t$DD�t$ D1�D�$���A�E1�A��E�D1�D�|$��A�E1�A��D�D$<D�D$$D�$�DD$D1�E��D�<1�L$D1���A�D1�D�D$A��t$@A��E�D�D$DD�D$D1�D�$�D�|$���L$H�L$8A�D1�A��A�D1��E�<D1�D�|$D�|$(��A��t$$�t$0D1�D�t$ D�t$���L$8�L$<G�4D�t$,A�D1��A�D1���E�A�D1�D�D$D�D$��D�$�A��t$0�t$4D1����L$<�L$LA�D1�D�$���A�D1��A�D1�D�D$D�D$��A��t$4E�t$$D1��A�D1�A��A�D1���A�D1�D�D$$A��t$0A��E�D�D$@D1�D�|$(���L$L�L$E��L$HA�D1�A��A�D1��E�<D�D$4D1�D�|$D�|$8��A��t$0�t$D1�D�t$,D�t$��F�40�L$E�E1�D�$�A��B�A1�D��D�|$��E�46G�<;E1�D�t$D�t$ A��D�D�D$4D�D$<1��Eljt$8�t$DD1���A�E1�A��D�$�E�D1�D�|$��A�E1�A��D�D$<D�D$$A�DD$D1�D�$���D�<1�L$D1���A�D1�D�D$A��A��E�D�D$DD�D$D1�D�|$D�|$@��EЉL$H�L$8A�E1�D�$�A��E�D1��A�E1�D�D$D�D$D��D�|$(��A��t$$D�$�D1�D�t$ D�t$<�t$0��E�L$8D1�D�$���A�E1�A��E�D1�D�D$D�D$��A��t$0G��t$4E1�D��D�t$,���L$<�L$LA�D1�D�$���A�D1��A�D1�D�D$D�D$��A�AЉt$4�t$$D1��A�D1�D�$���A�D1���A�D1�D�D$$A��t$0A��E�D�D$@D1�D�|$(���L$L�L$E�	�L$HA�D1�D�$���A�D1��E�<D�D$4D1�D�|$D�|$8��A��t$0�t$D1�D�t$,D�t$D�$���E��L$E1�D�$�A��B��t$DA1�A��E�E1�D�t$D�t$A��D�D�D$4D�D$<A1�A��D�|$8F�|5D�t$ E�D1�A��A�E1�A��E�D1�D�|$��A�E1�A��D�D$<D�D$$A�DD$D1�E��D�<1�L$D1���A�D1�D�D$A��t$A��E�D�D$DE�4�t$@D1�D�|$���L$H�L$8A�D1�D�$���A�D1��E�<D�D$<D1�D�|$D�|$(��A��t$$�t$0D1�D�t$ D�t$D�$���EƉL$8D1�E��A�E1�A��E�D1�D�t$D�t$��A��t$0�t$4E1�D��G�3D�t$,���L$<�L$LA�D1�D�$���A�D1��A�D1�D�D$D�D$��D�$�A��t$4�t$$D1��A�D1�D�$���A�D1���A�D1�D�D$$A��A��E�D�D$@D1�D�|$(�t$0���L$L�L$E�
�L$HA�D1�D�$���A�D1��E�<D�D$4D1�D�|$D�|$8��A��t$0�t$D1�D�t$,D�t$��F�42�L$E�E1�E�A��B��t$DA1�A��E�E1�D�t$D�t$ A��D�D�D$4D�D$<A1�A��D�|$8D�|$D�$�E�D1�D�$���A�E1�A��E�D1�D�|$��A�E1�A��D�D$<D�D$$D�$�DD$D1��D�<1�L$D1���A�A�D1�D�D$A��A��E�D�D$DD1�D�|$���L$HD�D$�L$8D�$�D�|$@A�E1�A�A��E�D1��A�E1�D�D$D��D�|$(��A��t$$�t$0D1�D�t$ D�t$���L$8�L$<G�3D�t$A�D1�E��A�D1���A�D1�D�D$G�D5D�t$,��A��t$0�t$4D1����L$<�L$LA�D1�A��A�D1��A�D1�D�D$D�D$��A�E�t$4�t$$D1��A�D1�D�$���A�D1���A�D1�D�D$$A��t$0A��E�D�D$@D�D$D1�D�$�D�|$(��E�ljL$L�L$HA�D1���D�$�A�D1��E�D�|$8D1�D�D$D�D$4��A��t$0�t$D1�D�t$,D�t$D�$���E��L$E1�D�$�A��B��t$DA1�A��E�E1�D�t$D�t$A��D�D�D$4D�D$<A1�A��D�|$8F�<0D�t$ E�D1�E��A�E1�A��E�D1�D�|$��A�E1�A��D�D$<D�D$$A�DD$D1�E��D�<1�L$D1���A�D1�D�D$A��t$@A��E�D�D$$D�D$D1�D�$�D�|$���L$D�L$8A�D1�E��A�D1��E�<D1�D�|$��A��t$8D�D$D1�t$0D�|$(D�t$ ��EȉL$@�L$<A�D1�A��A�D1���E�4D�D$D1�D�t$D�t$,��A�A��t$(�t$4D1����L$0�L$LA�D1�D�$���A�D1��A�D1�D�D$D�D$��A��t$,B�4D�D$8D1���A1�D�D��D�D$D��A�D1���D�,�t$(D1�DL$��A�D1����L$4�L$E��L$@E�D1�A��A�E1�A��C�,1��A��t$�t$E1�D�t$D�t$A��E��G�2D�T$,A�E1�E�A��F�4�t$$D1��E�$E1�A��G�D1����L$�L$0D�t$ A�D1��A�D1�D�$�D�$����$�A�D1�D�L$E���E�A�D1�D�$�D1����A�L$D��D1�A�͋L$A��E��1�D�L$PA1��$�A����E�A�D��$�D�L$D1�D�D$xE1�A��A�ˋL$A��D�D$dD��$�D݉l$T1�E�D�d$A��D�$�E1�A$�A�A��D�t$|E1�G�<'A��D1�D�t$hD�t$�΋L$4��A�A�0E1�A��T$XD1�A����G�,��$�D�D1�T$p1������T$lA�)�D$\D1����$�D�D$t1���D$`foD$P�o?�DoOfDo�$�f�D$pfD�D$`f��fE�DGH��$�dH3<%(uH���1�[]A\A]A^A_���f�����������@��f���H�=P�鐺����AT1�USH�GH��H���0H��H��tEHǀ�L���M���Ǽ���oCH�}0H�s0��E�oK M �M�������H��[]A\Ð��SH�����H��� H����H�{0��H������޺��H���H��uH��[�i���f����Hǃ���ff.�AWAVAUATUSH��8H�|$H���dH�%(H��$(1�H����
H�\$L�l$0�,L��H�sP�[�H�H�\$�V�f�WD��$��L9��������$�H�T$pL�D$x=���H��E1�I�m`L��H��H��H�T$pA��M�L�D$x���D��$��H��I���A�T$���$�蘺����$�H��Ht$pH����H�4$�~$D��LT$x��$�L�$$)L$p� 
�1�HDŽ$�����)�H��9���H��L���.��L�D$0H�|$8H�t$@H�L$HM��L��L��M��I��0H��8M��M��E��H��I��I��L	�H��(H��I��@��H��H�T$PI�� H	�I��H��E��E��I��I��L	�E��I��H��L�,$I��I��8I��0L	�I��D�$I��(I��L��H��I����A��I�� M	�L	�E��E��I����E��I��I	�I��H��L	�I��M	�I��H��I��(L�$I��I��I��H��@��M	���I��H��I��I��0E��E��H��8M	�E��I��I��H��I�� I	�L	�H��I��H��I��E��H��I	�L	�H��I��H����I��H��I	�H��I��(H��@��I��0E��L�l$I��E��@��I�� fo$E��L	�I��)�$�H��H	�H��I��8I��I��H��@��M	�I	�����I��I����H��M	�I	�I��0I��I��I��H��H��8M	�I	�L�L$XI��H�t$XL�<$I��I��M	�L�D$XI�� I��H��(I��I	�H�|$XH��I��I��(D��A��I	�H�\$XH�� E��I��I��0@��@��I	�H��E��A��L�d$E��H����L�l$XL	�E��D�d$XH��fo$L�t$`I��8L	�I��H��)�$�M	�H	�H�L$XI��I��I������M	�I��E��I��I	���I	�M��I��I��I	�M	�L�|$`I��I��I	�I	�I��I��I��I	�I	�I��L�$M	�E��L�l$fo$$)�$L�\$`H�D$`L�l$`H�T$`I�� L�T$hH��(L�L$hI��0A��H��8��L�\$hH��A��I��0H	�E��I��(L�D$hI��8H��E��H�|$hI��H	�I�� H�t$hM	�H��E��H�D$`I��H	�H��H�L$hM	�H��@����I��L	�H����M	�H��@��D�|$`I��L	�D�T$hI	�H��I��H	�I	�H��I��L	�I	�H�$I��M	�L�\$fo,$)�$L��$�H�T$�@H��$�L�����H�L$H���H���FL�\$L��A�s���H��$(dH3%(�8H��8[]A\A]A^A_�ff.���H�I��H�$�~$L�$��$�$)D$p��M�e`1��HDŽ$�����)�L���L��L������L�L$8L�T$0L�D$@H�|$HL��M��M��M��H��I��0L��M��H�$L��E��I��(H��(E��I�� M��H�D$(L��E��H��H��8@��I��L��H��I�� H�t$PH�L$XL	�E��L�|$ M��H��I��0H�T$`L	�H��H����L	�D�d$ H��H	�I��L��E����L��I��H��8M	�I��I��A��D�|$(I��I	��,$L	�I��M��H��I��(M	�I��L	�E��L�$M��H��I��I��I��I��L��E��M	�M��I�� I��I�� E��I	���L��E��I��H��8I	�H��H��I��H��I	�L����I��H��M	�@��I��L�t$M��fo4$I��(I��0L�$I��E��E��I��0)�$�L	�E��E��H��L	�I��H��L	�D�$$H��H	�I��L��E��I��I��8��H��I��M	�@��M	�I��I��I��I	���H��I��M	�H��8I��I��M	�I��I�� M	�I��L�$I��I��I��0E��I��M	�I��E��I��I��E��I��(I	�H��I��0I��H��E��E��I	�H����I��H��(I	�H��@��L�l$I��H��fo<$I�� H��@��L	�I��E��)�$�H��I��8H	�I��M	�H��L	�I��I��M	�I��A��I��I��M	�L��I��I��H	�H��@��M	�I����H��I��I��I��I	�I	���I��I����E��I	�I	�H��H��I��I����I	�I	�H�� H��L�$$I��H�t$h@��L�t$fDo$I��(I��0A��L�t$hH��8��H��E��H����D)�$L�D$hL	�I��L�T$hH��E��@��L�d$hL�L$hH	�I�� I��0H��E��I��8E��I��(H	�I��E��H��H�\$hM	�H	�D�T$hI��H����M	�L	�I��H��M	�H	�I��H��M	�I��I	�I��H	�I	�H�$I��M	�L�d$fDo$D)�$���ff.�1�虰�����
����Q���ff.��������HDŽ$���������耯���������AWAVAUATUSH��H��8H���dH�%(H��$(1�H���m����oC0�oK@�oSP�o[`�ocp�o��)D$ �o�����)L$0�o�����)T$@�Do���s)\$P�Do��)d$`�Do��)l$p)�$�)�$�D)�$�D)�$�D)�$���$�f��$�H�t$@8�������$�@L�l$ vRD�T$@M�u0L��L��A��@A��?D�T$@A��E��Dd$D�u��D��$�I�upL����A�W���$�豮����$���D$@�T$D��$��D$@�����I�m0��1��D$H����)�H��p���H��L������l$$D�L$(D�T$ D�\$,��A��D��E���A��E��E�����E��D��H���$��@��L	���A��D�D$4H��A��E���t$0H	�D�d$A��E��H����E��D��H	�A������H��H��E��D��L	�L	�E��E��H��H��D�<$A��L	�D�l$�|$<H��H	���D��E��H	�H����H��L	�A��H��L	�A��D�T$8H�$D��L	�E���H��E��A����L	�A��H��A��H��A��H	�D��H	�H����E��H��H	�L	�E����H��H�D$��A��L	����D�L$8H����E�ۉ�L	�H��@��@��H��L	�A��D�D$8L	�A��E��fDo$H��E��L��$�D)�$H	���L$8H��H��H	���H	� H��H�$H�T$H��$H	�L��H��L	�H��L	�H��H	�H��L	�H�D$fDo$$D)�$苪��H���H���!����sL���O���H��$(dH3%(uH��8[]A\A]A^A_��E���DAWAVAUATUSH��8L���H�|$dH�%(H��$(1�M���C���L�l$0H��H�wP�,L��D�K�H�L�L$�D�F�fD�GD8�$��j�����$����H�l$pM�e`L��L��H��H��H�l$p��D��L\$x�,�����$��L��V�I�����$�������$�L�t$xH��HL$pI��I��H�$�~$L�4$��$�$)L$p�7
�1�HDŽ$�����)�L�諨��L��L��蠻��L�L$8L�T$0L�D$@H�|$HL��M��M��M��H�� I��0L��M��H�D$ L��E��I��(H��8E��I�� M��H��E��H��L��L	�@��I��H�t$PH��I��E��H�L$XL	�L�<$M��H��H��I��(��H�T$`L	�L�|$(M��D�d$ H��I��0H	�I��L��E����L��I��H��8M	�I��I��A��D�|$(I��I	��,$L	�I��M��H��I��(M	�I��L	�E��L�$M��H��I��I��I��I��L��E��M	�M��I�� I��I�� E��I	���L��E��I��H��8I	�H��H��I��H��I	�L����I��H��M	�@��I��L�t$M��fo$I��(I��0L�$I��E��E��I��0)�$�L	�E��E��H��L	�I��H��L	�D�$$H��H	�I��L��E��I��I��8��H��I��M	�@��M	�I��I��I��I	���H��I��M	�H��8I��I��M	�I��I�� M	�I��L�$I��I��I��0E��I��M	�I��E��I��I��E��I��(I	�H��I��0I��H��E��E��I	�H����I��H��(I	�H��@��L�l$I��H��fo$I�� H��@��L	�I��E��)�$�H��I��8H	�I��M	�H��L	�I��I��M	�I��A��I��I��M	�L��I��I��H	�H��@��M	�I����H��I��I��I��I	�I	���I��I����E��I	�I	�H��H��I��I����I	�I	�H�� H��L�$$I��H�t$h@��L�t$fo$$I��(I��0A��L�t$hH��8��H��E��H����)�$L�D$hL	�I��L�T$hH��E��@��L�d$hL�L$hH	�I�� I��0H��E��I��8E��I��(H	�I��E��H��H�\$hM	�H	�D�T$hI��H����M	�L	�L��$�I��H��M	�H	�I��H��M	�I��I	�H��$�I��H	�H�T$I	�H�$L���@I��M	�L�d$fo,$)�$�k���H�L$L���M�������qL���*���H��$(dH3%(�SH��8[]A\A]A^A_Ë�$�L�T$xI��LL$pI��I��L�$�~$L�$��$�$)D$p��M�}`1��HDŽ$�����D)�L��`���L��L���U���L�L$8L�T$0L�D$@H�|$HL��M��M��M��H��I��0L��M��H�$L��E��I��(H��(E��I�� M��H�D$(L��E��H��H��8@��I��L��H��I�� H�t$PH�L$XL	�E��L�|$ M��H��I��0H�T$`L	�H��H����L	�D�d$ H��H	�I��L��E����L��I��H��8M	�I��I��A��D�|$(I��I	��,$L	�I��M��H��I��(M	�I��L	�E��L�$M��H��I��I��I��I��L��E��M	�M��I�� I��I�� E��I	���L��E��I��H��8I	�H��H��I��H��I	�L����I��H��M	�@��I��L�t$M��fo4$I��(I��0L�$I��E��E��I��0)�$�L	�E��E��H��L	�I��H��L	�D�$$H��H	�I��L��E��I��I��8��H��I��M	�@��M	�I��I��I��I	���H��I��M	�H��8I��I��M	�I��I�� M	�I��L�$I��I��I��0E��I��M	�I��E��I��I��E��I��(I	�H��I��0I��H��E��E��I	�H����I��H��(I	�H��@��L�l$I��H��fo<$I�� H��@��L	�I��E��)�$�H��I��8H	�I��M	�H��L	�I��I��M	�I��A��I��I��M	�L��I��I��H	�H��@��M	�I����H��I��I��I��I	�I	���I��I����E��I	�I	�H��H��I��I����I	�I	�H�� H��L�$$I��H�t$h@��L�t$fDo$I��(I��0A��L�t$hH��8��H��E��H����D)�$L�D$hL	�I��L�T$hH��E��@��L�d$hL�L$hH	�I�� I��0H��E��I��8E��I��(H	�I��E��H��H�\$hM	�H	�D�T$hI��H����M	�L	�L��$�I��H��M	�H	�I��H��M	�I��I	�H��$�I��H	�H�T$I	�H�$L���@I��M	�L�d$fDo$D)�$����H�L$L���M�������H�D$L���p�֟�����HDŽ$���������۟��ff.��������AWAVAUATUSH��H���H���dH�%(H��$�1�H����%����oK0�oS@�o[P�oc`�okp��)�$��o�����)�$��o���{)�$��o����$`�Do��)�$��Do���Do��)�$�)�$)�$)�$ D)�$0D)�$@D)�$Pf��$dH�|$H9��������$�D��$���@���@L��$�E1Ƀ�?M�l$0��$�L��A��L��E�D��$����D��$`I�t$pL�﹆A�R���$`�ٞ����$`A��D�$���$���$eD��$�������I�|1�DŽ$�����)�苜����$�D��$�D��$���$�AЋ�$fDo�$�E�D��$�fDo�$�D�t$D1�D)\$0DD$4fo�$���RQD)|$pD�\$t��$��D�T$x)�$���$�D��g�	j�l$fDo�$�D1�A�D\$8fDo�$���D$fDo�$A�D)d$@D1�D)l$P��D)t$`A�D1���T$��$�D1�D\$<��h�������g�1��A�D1��D���$�D�L$ D1�D�|$A����$�E�D�|$|��$�D1�DT$DA����$�A��كA��A�E��r�n<D1��A�E1�E��D�L$HA��E�E�D�l$$D�|$D1�DL$LD1���[E���D�|$��A�D��:�O�D1��A�D1��A�D1��D1�A��D1���D\$XDD$TA�A�D1�D\$\D1����A�A�l$(D1�D1�����A�D1��A�l5D�l$1�l$,�l$$E��D�l$ A�D1�DT$d��A�D1��A�D1��A�DL$hDD$hE�D1�D\$D1�DL$l����A�E1�A��E�D1��A�E1�A��E�D1�DD$X��A�E1�A��E�D1��A�E1�A��A�DT$TDL$dA�D1�D\$A�D1��DT$l��A�A�D1�D1����A�A�D1�D1����A�A�l$ �l$(D1�D�l$D�l$,D1��D1����A�D1�DL$HDD$4��A�D\$A�A�D1�D1�D\$8����A�D1�DD$��D1�A�A�D1��D1�����A�A�D1��A�l$$D1���D1�DT$\DL$D��A�E�A�l5D1�D�l$DT$L�l$(1�l$ ��A��D1�D1�DL$<����A�A�E1�D1�A����E�A�D1�D1����A�E1�A��DD$\D\$E�A�DT$DD1�D1�DD$D\$����A�A�A�D1�E1�D1��A����E�A�D1�D1����A�A�E1�D1�D�l$D�l$(A����A�DT$8D1�DL$lDD$X��A�A�A�D1��A�l$ �l$$D1�D1�DL$d����A�D1��A�D1��A�D1�DD$h��D1�A��D1���A�D\$<DT$LA�A�D1�D1�D\$HD1������A�l$$A�A�D1�D1�D1������A�D1��A�l5�l$(DT$41�A���l$ D�l$D1��A�D1��DL$TDD$LE�D\$<D1�DL$A���D1�A�E1�A��E�D1��A�E1�A��E�D1�DD$T��A�E1�A��E�D1��A�E1�A����DT$dD\$4A�A�DL$\D1�D1�DT$A�����A�A�D1�D1����A�A�D1�D�l$D1�D�l$(����A�l$ �l$$D1�D1����A�D1��DL$hDD$8A�A�D\$DD1�A��D1�D\$XA�D1��DD$H��D1�A�A�D1��D1�����A�A�D1�D1����A�l$$A�l5D�l$D1��l$(��1�DL$l�l$ E�DT$DD$T��D1�A�DL$��D1�DT$A��E1�A�A��D1�E���D1�A��D1�A��E1�A�A��D1�E���D1�D\$DDD$A���D1�A�D\$LDT$8��E1�A�A�A��D1�D1�E�����D1�A�A���D1�D1�A��E1�A�A��D1�D�l$D�l$(����DT$DL$XA�A�DD$hD1�A����l$ A�l$$D1�D1�DL$l����A�D1��A�D1��A�D1�DD$4��D1�A��D1���A�D1��D\$\DT$HA�A�A�l$$D1�D1�D\$DT$����D1�DL$<A�A��D1�D1����A�A�D1�D1����A�l5A�D�l$�l$(1�D1�l$ ����E�DD$8D1�DL$dD\$H��A�A�D1�E1��A��E�D1��A�E1�A�A��E�D1�DD$��A�E1�A��E�D1��A�E1�A��D1�DT$D\$XA��DL$D1�DT$\A�A���D1�A��D1�A��D1�D�l$D�l$(A��D1��A�l$ �l$$D1�D1�DL$<����A�D1��A�D1�DD$D\$LA�A��A�D1�D1�D\$D����D1�DD$dA�A��D1�D1����A�A�D1�D1�����l$$A�A�l5D�l$D1�1�l$(�l$ ����DT$lDL$4E�A�DD$D1�D1�DL$TDT$h����A�A�E1�D1�A����E�A�D1�D1����A�A�E1�D1�A����E�D1��A�D\$4DT$hA�E1�A�DD$DD1�A��D\$lD1��E���DT$dA�D1�A�D1��D1��A��A�E1�D1�A����A�D1�D�l$D�l$(��A�DL$DD$D1�A�A���A�l$ �l$$D1�D1�DL$X����A�D1��A�D1��A�D1�DD$L��D1�A��D1���A�D1��A�l$$D1�D\$HDT$TA�A��D1�D\$<D1����A�A�D1�D1����A�D1��A�l5�l$(DT$81�A�DL$�l$ ��D1�E�D�l$��D1�A�D1����DL$\DD$dA�D\$LE1�A�A��D1�E���D1��A�E1�A�A��D1�E���D1�DD$\��A�E1�A��E�D1��A�E1�A��D\$hDT$A�A�DL$<D1�DT$4D1�A�����A�A�D1�D�l$D1�D�l$(����A�D1��A�l$ �l$$D1�D1�DL$T����A�D1��A�D1��A�DD$DD\$lA�A�D1�DT$D1�D1�DD$D\$����A�A��D1�D1�A����A�A�D1�D1����A�l$$A�l5D�l$D1�1�l$(�l$ ����D1�DL$8E���DT$HDD$HD1�DL$XA��D1�A��E1�A�A��D1�E���D1�A��D1�A��E1�A��E�D1��A�E1�A��D\$hDD$lA�E�D1�D\$TDT$\D1��A��A�D1�DT$<A�D1��E1��A�A��A�D1�D1����A�A�D1�D1�D�l$D�l$(����DL$DD$�l$ A�l$$A�A�D1�D1�DL$����A�D1��A�D1��A�D1�DD$8��D1�A��D1���A�D1��A�l$$D1���D\$dDT$4A�A�DL$XD1�D1�D\$LDT$����E�A�A�D1�D1����A�A�D1�D1����A�l5D�l$Aԉl$(1�l$ D1����D1��A�E1�DL$DDD$XA��D\$E�A�D1�D1�D\$����A�E1�A�A��D1�E���D1�DD$8A���A�E1�A��E�D1��A�E1�D�d$A��D1�DT$LDL$4A�A�D�|$ D�|$(D1�DT$H����A�A�D1�D1����A�D1�A��l$$A��D1�DL$DE�fo�$�fDo�$���D1�A��D1���A�D1��A�D1���DD$lD\$TA�A�D1�D1�DD$\D\$h����A�A�D1�D1�����A�A�D�D$pD1�D�D$<D1����D�\$tD�\$dE�A�A$�A�D��$��t$A1�D��$�D1�A1�A��A����E�DD$�D��$�D�|$ 1�$�E���D��$�A�<E1�D\$A��1��|$x��E剔$�E1��$�1�D������A���$��L$|D1�f�T$p����$�D鉌$�1�f�$�����$�fI~�)�$�fD�$�fD�$�H�T$L��$pH��$�H��$�� L��L��$�D)�$�L��$�H��$�fD֌$�L��$��ۊ��H���H���[�sL���ϋ��H��$�dH3%(�BH���[]A\A]A^A_�fD�L��$�A����$e��$�D��$��^�����I�|01�DŽ$�����)����D��$�D��$�D��$���$�fo�$�E�fo�$�EЋ�$�fo�$�D�T$)|$pD�\$tD1�D�T$x)�$���$���RQ��$�)\$0��DD$4��$�A�D\$8D��g�	jD��$D1�E1�A�D\$<��h�A��D��$fo�$���E�A�D�t$����g�D1�fo�$fo�$1��D�L$��A�)d$@A�E1�)l$PD1�A��)t$`��D�l$D�|D�|$ D1��D$��$����l$|D�|$D1�DT$DA����$�E�D�|$A��كA�A���E��r�n<D1��A�E1�E��D�L$HA��A鋬$�E�D�l$$D1�D1�DL$L������[��D��:�O�D1��A�D1��A�D1��D1�A��D1���D\$XDD$TA�A�D1�D\$\D1����A�A�l$(D1�D1�����A�D1��A�l5D�l$1�l$,�l$$E��D�l$ A�D1�DT$d��A�D1��A�D1��A�DL$hDD$hE�D1�D\$D1�DL$l����A�E1�A��E�D1��A�E1�A��E�D1�DD$X��A�E1�A��E�D1��A�E1�A��A�DT$TDL$dA�D1�D\$A�D1��DT$l��A�A�D1�D1����A�A�D1�D1����A�A�l$ �l$(D1�D�l$D�l$,D1��D1����A�D1�DL$HDD$4��A�D\$A�A�D1�D1�D\$8����A�D1�DD$��D1�A�A�D1��D1�����A�A�D1��A�l$$D1���D1�DT$\DL$D��A�E�A�l5D1�D�l$DT$L�l$(1�l$ ��A��D1�D1�DL$<����A�A�E1�D1�A����E�A�D1�D1����A�E1�A��DD$\D\$E�A�DT$DD1�D1�DD$D\$����A�A�A�D1�E1�D1��A����E�A�D1�D1����A�A�E1�D1�D�l$D�l$(A����A�DT$8D1�DL$lDD$X��A�A�A�D1��A�l$ �l$$D1�D1�DL$d����A�D1��A�D1��A�D1�DD$h��D1�A��D1���A�D\$<DT$LA�A�D1�D1�D\$HD1������A�l$$A�A�D1�D1�D1������A�D1��A�l5�l$(DT$41�A���l$ D�l$D1��A�D1��DL$TDD$LE�D\$<D1�DL$A���D1�A�E1�A��E�D1��A�E1�A��E�D1�DD$T��A�E1�A��E�D1��A�E1�A����DT$dD\$4A�A�DL$\D1�D1�DT$A�����A�A�D1�D1����A�A�D1�D�l$D1�D�l$(����A�l$ �l$$D1�D1����A�D1��DL$hDD$8A�A�D\$DD1�A��D1�D\$XA�D1��DD$H��D1�A�A�D1��D1�����A�A�D1�D1����A�l$$A�l5D�l$D1��l$(��1�DL$l�l$ E�DT$DD$T��D1�A�DL$��D1�DT$A��E1�A�A��D1�E���D1�A��D1�A��E1�A�A��D1�E���D1�D\$DDD$A���D1�A�D\$LDT$8��E1�A�A�A��D1�D1�E�����D1�A�A���D1�D1�A��E1�A�A��D1�D�l$D�l$(����DT$DL$XA�A�DD$hD1�A����l$ A�l$$D1�D1�DL$l����A�D1��A�D1��A�D1�DD$4��D1�A��D1���A�D1��D\$\DT$HA�A�A�l$$D1�D1�D\$DT$����D1�DL$<A�A��D1�D1����A�A�D1�D1����A�l5A�D�l$�l$(1�D1�l$ ����E�DD$8D1�DL$dD\$H��A�A�D1�E1��A��E�D1��A�E1�A�A��E�D1�DD$��A�E1�A��E�D1��A�E1�A��D1�DT$D\$XA��DL$D1�DT$\A�A���D1�A��D1�A��D1�D�l$D�l$(A��D1��A�l$ �l$$D1�D1�DL$<����A�D1��A�D1�DD$D\$LA�A��A�D1�D1�D\$D����D1�DD$dA�A��D1�D1����A�A�D1�D1�����l$$A�A�l5D�l$D1�1�l$(�l$ ����DT$lDL$4E�A�DD$D1�D1�DL$TDT$h����A�A�E1�D1�A����E�A�D1�D1����A�A�E1�D1�A����E�D1��A�D\$4DT$hA�E1�A�DD$DD1�A��D\$lD1��E���DT$dA�D1�A�D1��D1��A��A�E1�D1�A����A�D1�D�l$D�l$(��A�DL$DD$D1�A�A���A�l$ �l$$D1�D1�DL$X����A�D1��A�D1��A�D1�DD$L��D1�A��D1���A�D1��A�l$$D1�D\$HDT$TA�A��D1�D\$<D1����A�A�D1�D1����A�D1��A�l5�l$(DT$81�A�DL$�l$ ��D1�E�D�l$��D1�A�D1����DL$\DD$dA�D\$LE1�A�A��D1�E���D1��A�E1�A�A��D1�E���D1�DD$\��A�E1�A��E�D1��A�E1�A��D\$hDT$A�A�DL$<D1�DT$4D1�A�����A�A�D1�D�l$D1�D�l$(����A�D1��A�l$ �l$$D1�D1�DL$T����A�D1��A�D1��A�DD$DD\$lA�A�D1�DT$D1�D1�DD$D\$����A�A��D1�D1�A����A�A�D1�D1����A�l$$A�l5D�l$D1�1�l$(�l$ ����D1�DL$8E���DT$HDD$HD1�DL$XA��D1�A��E1�A�A��D1�E���D1�A��D1�A��E1�A��E�D1��A�E1�A��D\$hDD$lA�E�D1�D\$TDT$\D1��A��A�D1�DT$<A�D1��E1��A�A��A�D1�D1����A�A�D1�D1�D�l$D�l$(����DL$DD$�l$ A�l$$A�A�D1�D1�DL$����A�D1��A�D1��A�D1�DD$8��D1�A��D1���A�D1��A�l$$D1���D\$dDT$4A�A�DL$XD1�D1�D\$LDT$����E�A�A�D1�D1����A�A�D1�D1����A�l5D�l$Aԉl$(1�l$ D1����D1��A�E1�DL$DDD$XA��D\$E�A�D1�D1�D\$����A�E1�A�A��D1�E���D1�DD$8A���A�E1�A��E�D1��A�E1�D�d$A��D1�DT$LDL$4A�A�D�|$ D�|$(D1�DT$H����A�A�D1�D1����A�D1�A��l$$A��D1�DL$DE�fDo�$���D1�A��D1���A�D1��A�D1���DD$lD\$TA�A�D1�D1�DD$\D\$h����A�A�D1�D1�����A�A�D�D$pD1�D�D$<D1����D�\$tD�\$dE�A�A$�A�D��$��t$A1�D��$�D1�A1�A��A����E�DD$D��$��D�|$ 1�D��$�E�����$�A�<E1�D\$A��1��|$x��E剔$�E1��$�1�D������A���$��L$|D1�fD�D$p����$�D鉌$�1�fD�$�����$�fM~�fDo�$�D)�$�fD�$��X�f.�1��iz�����������ff.���x�����ay�����HLJ^H��H�foB�H��H��fo
C�foK�H)�foP�1���f���H�JR Z0L��L1�H��H��u��61�@��d�@��AWI��AVAUATUSH��H�t$hH�T$HdH�<%(H��$�1�H����A��`�M�g`I���H��$ H��$�)�H��$���H�D$`H9D$H��L�d$PL�|$XL�t$PH�T$`E1�H�t$hL��x��H�l$XH�т�RQH�}@�`�\$tH���H�l>+�h�H��H�E@A��LeHL�eH�Ao�Aof�Aov )$�AoN0L�$)�$�)$$�Aof@H�4$)4$H�$)$L�$)$$fo<$)�$�f�|$(�Ao~P)�$�)<$fDo$)�$�)�$�fD�L$0)�$��Ao^`�Aovp�oM�om L�t$PI�ɼ�g�	j)$fDo$�o}0)�$�o]L��$�)4$fDo,$)$L�$)$L�$),$L�<$A)MM�A)]M�A)m L1�L�$�)<$H�$H1�A)}0I�;�ʄ��g�H�� L�$I�L��$HI�fD�\$8M1�)�$fD֬$�I��M�L1�H��I�M1�I��L�|$xL��$(H�\$H�T$(M�H�t$I�H�uPM1�L�$�I1�H��$XI�� M�M1�I��M�M1�I��M�L�d$@I�k�A��كM1�I�I�L��I�H�\$ L1�M�H�T$0L��$8L1�I�+���r�n<L�$�H�� I�I�I�H�]XL1�H�y!~��[H��L1�L�$�I�H1�L1�H��6_:�O�H�� H��H�I�H1�L1�H��H�I�L1�H��H�L1�H1�H��H�� L�$�I�M1�I��M�L1�H��I�H��$�I�L�|$8H�H�T$@M1�H1�M�H�$�I�H�� I�L��$�H�L1�L�$H1�H�� L�|$@H��I�H�L1�H1�H��H��H�H1�H�I�M�L�|$xLT$@L1�M�H��L1�L�$I�H�� L1�I�H��M1�I��M�L1�H��I�M1�I��M�L1�LT$0H�� I�M1�I��M�L1�H��I�M1�H\$L�$�L�I�I��L�$H1�L1�H\$(L�|$xH�� H�� L�$I�I�I�L��$�M1�L1�I��H��L�I�H1�L1�H��H��I�I�M1�L1�I�H�M1�L\$ I�� L�$�H$L�M�H�H1�H1�H��H�� I�M1�I��L�M1�LT$8I�� H1�H�M�H1�H��M1�I��M�M1�I��M�L��$�L�|$xM1�I�H��L�$�L�$�I�M�H\$L1�L1�L�$�H�H�� H�� H1�L�$�I�I�H��L1�M1�H�H��I��H1�I�M�H�L1�L1�H��I�L1�H��H��L�$�H\$8I�L�M1�H1�H$I��H�� M�I�L1�M1�LT$(H�� I��I�L�M1�H1�I��H��M�I�L1�M1�H��I�I�M1�I��L�$�LT$0L�|$xL�$I�M�L��$�I�L1�LL$H�� M1�I�L�$I�� L1�L�H��H1�I�H��L1�I�H��M1�I�I��L1�L�M1�H�H1�I�� H��M�H�$�LT$@H�M1�L�$�H1�I�I��H\$ H�� M�L1�L�$�H�M1�H�� H1�I��I�H��M�L1�L��$�H�M1�L�|$xH��H1�I�H��H�H1�H�I�L�$�M�L1�L1�L\$L�$�H��H�� I�I�L1�M1�H��I��M�L1�H��I�M1�I��M�L1�L�$�H�� I�M1�I��M�L1�H��I�M1�H�$�L�$L�I�I��L�$�H1�L1�LL$8L�|$xH�� H�� I�H�$�I�I�L��$�M1�L1�I��H��L�I�H1�L1�H��H��I�I�M1�L1�I�H�M1�L\$@I�� LT$H�$�L�M�H�H1�H1�H��H�� I�M1�I��L�M1�LT$ I�� H1�H�M�H1�H��M1�I��M�M1�I��M�L��$�L�|$xM1�I�H��LL$L�$I�M�H\$0L1�L1�L$H�H�� H�� H1�L\$(I�I�H��L1�M1�H�H��I��H1�I�M�H�L1�L1�H��I�L1�H��H��L�$�H�$�I�L�M1�H1�H�$�I��H�� M�I�L1�M1�L$H�� I��I�L�M1�H1�I��H��M�I�L1�M1�H��I�I�M1�I��LL$L\$0L�|$xI�I�LT$@L��$�L1�LL$M�H�� M1�I�L�$I�� L1�L�H��H1�I�H��L1�I�H��M1�I�I��L1�L�M1�H�H1�I�� H��M�L�$�M1�I��M�M1�I��L��$�LL$ M�H�$�I�L�|$xM1�H�L1�LL$(I�H1�H\$8H�� H�� I�H�L1�H1�H��H��H�H1�H��H�H1�H�I�L�$�LT$M�L1�L1�L�$H��H�� I�I�L1�M1�H��I��M�L1�H��I�M1�I��M�L1�LT$8H�� I�M1�I��M�L1�H��I�M1�H\$ L$L�I�I��L\$(H1�L1�H\$0L�|$xH�� H�� I�L�$�I�I�L��$�M1�L1�I��H��L�I�H1�L1�H��H��I�I�M1�L1�I�H�M1�LT$I�� L�$�M�H�$�L�H�H1�H1�H��H�� I�M1�I��L�M1�L�$I�� H1�H�M�H1�H��M1�I��M�M1�I��M�L��$�L�|$xM1�I�H��L�$L�$�I�M�H�$�L1�L1�LL$@H�H�� H�� H1�L�$�I�I�H��L1�M1�H�H��I��H1�I�M�H�L1�L1�H��I�L1�H��H��LT$8H�$�I�L�M1�H1�H�$I��H�� M�I�L1�M1�L�$�H�� I��I�L�M1�H1�I��H��M�I�L1�M1�H��I�I�M1�I��L�|$xLL$@L��$�L\$I�I�L1�L�$L$M1�H�� L\$0M�I�� I�L�L1�H1�H��H��I�I�L1�M1�H��I��I�L�M1�L1�I�� H1�H�H��M�H\$ L�$�H�M1�I�L�$�H1�I��H�$�L1�H�� M�H�� LL$H�M1�I�H1�I��L1�H��M�L��$�H��H�L�|$xM1�H1�I�H��H�H1�H�I�L\$(L�$M�L1�L1�L�$�H��H�� I�I�L1�M1�H��I��M�L1�H��I�M1�I��M�L1�L�$�H�� I�M1�I��M�L1�H��I�M1�H�$�LL$8L�I�I��L�$�H1�L1�H\$@L�|$xH�� H�� I�L�$�I�I�L��$�M1�L1�I��H��L�I�H1�L1�H��H��I�I�M1�L1�I�H�M1�L�$�I�� L�$�H�$L�M�H�H1�H1�H��H�� I�M1�I��L�M1�L$I�� H1�H�M�H1�H��M1�I��M�M1�I��M�L��$�M1�I�H��LL$(H\$I�H�L1�LL$ L\$H1�L�|$xH�� H��I�H�M�L1�H1�H��L1�L\$0H�H�� I�I�L1�M1�H��I��I�M�L1�L1�H��H��LT$ H\$@I�L�M1�H1�H�$�I��H�� M�I�L1�M1�L�$H�� I��I�L�M1�H1�I��H��M�I�L1�M1�H��I�I�M1�I��L�$�L$L�|$xI�I�LT$8L��$�L1�M�L�$�H�� M1�I�L\$(I�� L1�L�H��H1�I�H��L1�I�H��M1�I�I��L1�L�M1�H�H1�I�� H��M�H�$LT$H�M1�L�$�H1�I�I��H�$�H�� M�L1�LL$H�M1�H�� H1�I��I�H��M�L1�L��$�H�L�|$xM1�H��H1�I�H��H�H1�H�I�L\$0LT$0M�L1�L1�L�$�H��H�� I�I�L1�M1�H��I��M�L1�H��I�M1�I��M�L1�LT$H�� I�M1�I��M�L1�H��I�M1�H\$(L�$�L�I�I��L�$�H1�L1�H\$LL$ H�� H�� L�|$xI�I�I�L��$�M1�L1�I��H��L�I�H1�L1�H��H��I�I�M1�L1�I�H�M1�L�$�I�� L�$H�$�L�M�H�H1�H1�H��H�� I�M1�I��L�M1�L�$�I�� H1�H�M�H1�H��M1�I��M�M1�I��M�L��$�L�|$xM1�I�H��L�$�L�$I�M�H\$@L1�L1�LL$8H�H�� H�� H1�L$I�I�H��L1�M1�H�H��I��H1�I�M�H�L1�L1�H��I�L1�H��H��L$H\$I�L�M1�H1�H�$�I��H�� M�I�L1�M1�L�$�H�� I��I�L�M1�H1�I��H��M�I�L1�M1�H��I�I�M1�I��LL$L\$ L�|$xI�I�LT$(L��$�L1�M�L�$�H�� M1�I�L�$�I�� L1�L�H��H1�I�H��L1�I�H��M1�I�I��L1�L�M1�H�H1�I�� H��M�H\$0LL$8H�M1�I�L�$�H1�I��H�$�L1�H�� M�H�� L�$H�M1�I�H1�I��L1�H��M�L��$�H��H�M1�L�|$xH1�I�H��H�H1�H�I�L\$@LT$@M�L1�L1�L�$H��H�� I�I�L1�M1�H��I��M�L1�H��I�M1�I��M�L1�LT$0H�� I�M1�I��M�L1�H��I�M1�H\$L�$�L�I�I��L�$H1�L1�H\$(L�|$0H�� H�� I�L�$I�I�L��$�M1�L1�I��H��L�I�H1�L1�H��H��I�I�M1�L1�I�H�M1�L\$ I�� L�$�H$L�M�H�H1�H1�H��H�� I�M1�I��L�M1�LT$8I�� H1�H�M�H1�H��M1�I��M�M1�L��$ I��M�L��$�L�|$0L��$pM1�I��H��L�$�L�$�I�M�H\$L��$HL1�L1�H�L�$�H�� H�� H1�L�$�I�I�H��H��$(L1�M1�HŻH��M��H��$�I�I��H��$xH1�L1�K�H��L��$0H��H1�H��$PI�H��H��$�L��$`I1�I��I�H��$�M1�L��$XH��$8I��L��$hL�L$XL��$@H�L$P�Aoq �Eo	�EoY�Eoq0fDo�$ fDo�$0fD�$`fD�$pfDo�$�L��$�fD�$@fE�fE��fDo�$PfD�$�EfD��EQfE��Ea Ei0�Ao�Aohi�Aox y �AoP0Q0�Ao`@a@�AopPqP�AoH`D�l$tH�t$`H)t$HA�}�I`L�d$H�AoXp)�Ht$h��Yp)$A��`H�l$`L9����I��M��H�\$HH�t$hL�H���`��A�`1�H��$�dH3<%(uH�ĸ[]A\A]A^A_��_�����AWAVAUI��ATL�fUSH��H�^H�|$dH�%(H��$x1�H����f�H��L�rL��)�$�E1�1�H��)�$�L�1� I�)�$)�$)�$()�$�)�$�)�$�)�$�)�$�)D$H)D$X)D$h)D$x)�$�H�D$@H�D$8H��$�Ujj��^��H�� I��H����H���M����	L�HM���)H�xH����H�xH����
L�h M���X
L�P(�@L�T$M���Q�D$M�\$0�M����I�|$8H���I�|$@H����
M�D$HM����I�xH�5�� H9��8g���]���D$ ���'g��I�|$H�-^��A�ǃ����I����L�t$0L�
C� D�l$8L�t$M�!L�t$8L�L$(�]���D$$����f��H�D$1�H���0I��H����f��f��D�S�Hǀ�PP P0P@A��?��
H��$��ڈX��	H�|$H��D�\$A�����
�]�D�X�����
@�h�����I9��9H�|$D�hH�xA�����
H��$�D�x �@!�SM�t$P1�I�|$XIDŽ$�H��L��E�|$H)���f���H�A��$�AƄ$��Ao\$�Aod$ f�Gqf�%Oq�Aol$0�Aot$@f�-Iqf�5QqA\$PAd$`Al$pA�$�E���}H�|$�H��$xdH3%(L���H�Ĉ[]A\A]A^A_ú1�H��$�H�D$8H�D$0H���H��$�H���H�|$@H���H���md��H����I��f�M�$L�D$I����
M�L$�@L�l$M���I�|$L�l$H���nI�|$L�l$H����I�|$ L�l$H���'M�T$(�D$M������L�l$L�T$ff.��I�zH�5�� H9��pd���Z��A�Dž��`d��I�|$(�"[���D$�����I���8�D$$��D$ L�t$0H�
"� L�t$L�!L�t$8H�L$(�Z������c��H�D$1�H���0I��H����c��f�{�Hǀ�xx x0x@��?��
H��$��ڈX��H�|$H���|$���
D�T$�]�E�T$����s
A�����A�l$M9��H�L$E�t$I�L$A�����
�|$ @E�|$ �m
H��$��l$ A�l$!�)E�|$M�t$P1�I�|$XIDŽ$�H��L��H)���f���H�A��$��EoD$�EoL$ fD� n�EoT$0fD�
 n�Eo\$@fD� n�T$$ED$PfD�nEL$`ET$pE�$�A��$�E���KM����H��$���H��$���H�|$H�����H�|$@�9Y�����@I�{H�5M� H9���a���7X��A�Dž���a��I�|$0��X���Ń���O
I���'���H�ކ L�l$0D�|$8L�t$8L�l$L� H�D$(�EX���D$$���Ia��L�d$1�L��A��$0I��H���ia��f�ɍS�Hǀ�HH H0H@��?��H��$��ڈX��H�|$H��\$������}��X����%�����@�hI9���1�D�xH��$�L�hf�p �����L�l$L��$�M������I��@��E��E�t$���f�E1�I�T$P�D$ H����I�|$X�D$$H���mI�|$`��U�����'L�l$�O���L�l$M�]A�����M���M���p`��I�8�f`��H��$01�L��H����U��������$T�s`��H��$@H�����H��$0L���s��H���V�����E1�I�yH�5� H9��`���U��A�Dž���_��I�|$�V���Ã���DI���]�D$$��D$ �D$�X���H��$��V������E1�@H��$�1�H���U��A�Dž����CH���:U�����Z^��I��t�L�l$�P���f�L�l$H��$�1��H��$�H��H��$��H���H���IT��H��L�����Y������H����T���\���H�zH�5� H9��,_����T���D$$���_��I�|$P�cU���D$ ����|L�l$I���Q�������f�E1��D$$E1���@�D$ �D$����L�l$�T���L�|$(�@H�5�c1�I�?�S��I�,$��L��E1��T������D$ L�l$H�D$PH���T���H����M�L$@L�T$@H�������H���%���E�E������A�L�fA�L�����f�L��@E1�H�l$@1�H���6S��A�Dž���CH���^S������]��I�������L�l$���H��$��ET����E1�@H��$�1�H����R��A�Dž����CH���R������]��I���L���L�l$�#����t$$L�l$�t$ H��$�H���$���H���MI�t$0L��$�H������|H����E�D�����A�\�f�\������^R��H��$@H��$0L��I������L���+R���S���I�:I�\$HH��I�|$@M�D�M�D�I)�L�M)�I��I��I���}���I�q�I��H����H�L9��^���H����H��tgH��tUH��tCH��t1H��tH��t
M�Z�L�[I�<
H�<H��M�
L�H��I�4
H�4H��I�
H�H��M�
L�H��I�<
H�<H��L9�����M�
L�I�t
H�tI�D
H�DM�\
L�\I�|
 H�| M�D
(L�D(I�t
0H�t0I�D
8H�D8H��@L9�r��w���I�	M�T$8I��I�L$0I�|�H�|�L)�H�I)�H��H��H���6���L�F�I��I��A��I�H9�����M����I��tgI��tUI��tCI��t1I��tI��t
M�Y�M�ZI�I�H��I�<I�<H��M�M�H��I�I�H��M�M�H��I�I�H��H9������I�<I�<M�DM�DI�DI�DM�\M�\I�L I�L I�|(I�|(M�D0M�D0I�D8I�D8H��@H9�r��/���H�t$0��N����tiI����L�l$�D$$E1��D$ �t���H�t$8�O����t4I��t����L�5�~ H�5S_I�>�[P���H����O��H�������E1����D$ D�|$$L�l$�d����D$ E1�L�l$�.����_N���D$$��x�I��L�l$����r���L�l$�0�H�D$(H�5=^H�8��O������H�l$(�@H�5]1�H�}�TN�����H�\$(�@H�5F^1�H�;�4N�����H�|$(H�5�]H�?�{O���h���H�T$(H�5�]H�:�bO���O���L�D$(�H�5<]1�I�8��M���/�����M��H��������H�
�} H�5�[H�9�O������E�D�E�T�D�T��j��M��H���v������A�2A�1A�\�A�\��N�L�\$(�H�5�\1�I�;�WM������]M��H���\���L�l$�D$$I���w������3M��H���2���I�����L�l$�D$$�D$ �@��M��L�l$����0W��f���AWAVAUATI��USH��H��dH�%(H��$1�H�#| H�(�M������W��H�S����KH���H���.X��H�9�$X��H��$�1�H��H��$��L�������W����$���W��I��$���H��$�H����sH��$�H�t$`H�|$hH���A��$�A�M��$�A)�E��L�D$XL9D$`��M��$0M�T$PL�|$HL��$�L��$�L��$�L��$�L�d$PL�t$HH�T$XI�т�RQH�t$hL��M��H�l$P1�H���D���H���E�H��H�����H��D�d$tH����Ao�Aof�Aov )$�AoN0H�<$)�$)$$�Aof@H�4$)4$L�$$)$H�$)$$fo<$)�$f�|$(�Ao~P)�$ )<$fDo$)�$0)�$@fD�L$0)�$PH��$��Ao^`�AovpL��$�L�t$HI�ɼ�g�	j)�$`)�$p�o	)$fDo$A)M�oY)4$fDo,$A)]�oi )$L�$)$L�$),$L�$A)m �oy0M�fD�\$8I�)<$H�$L1�L�$A)}0I�;�ʄ��g�L1�H�<$I�H�l>+�h�fD֬$�H�� I�M1�I��M�L1�H��I�M1�M��I��L�\$xL��$�L��$�L��$�H�t$H�\$ M�L�d$I�H���L1�L�$H1�H��$�H�� I�M1�I��M�L1�H��I�H�T$@H�k�A��كM1�I�M�I�I�+���r�n<I�H���L1�H�y!~��[H1�L�$(H�T$(L1�H�� L�$8H1�I�I�H�T$0H�� L1�M�H��6_:�O�H�H��H1�I�H��L1�I�H��L1�I�H��L1�H�L1�H�H1�H��H�� L�$HI�M1�I��M�L1�H��I�H��$�I�L�|$8H�H�T$@M1�H1�M�H�$XI�H�� I�L��$�H�L1�L�$hH1�H�� L�|$@H��I�H�L1�H1�H��H��H�H1�H�I�M�L�|$xLT$@L1�M�H��L1�L�$xI�H�� L1�I�H��M1�I��M�L1�H��I�M1�I��M�L1�LT$0H�� I�M1�I��M�L1�H��I�M1�H\$L�$HL�I�I��H1�L1�H\$(L�|$xH�� H�� L�$xL�$hI�I�L��$�I�M1�L1�I��H��L�I�H1�L1�H��H��I�I�M1�L1�I�H�M1�L\$ I�� L�$H$L�M�H�H1�H1�H��H�� I�M1�I��L�M1�LT$8I�� H1�H�M�H1�H��M1�I��M�M1�I��M�L��$�L�|$xM1�I�H��L�$XL�$(I�M�H\$L1�L1�L�$8H�H�� H�� H1�L�$I�I�H��L1�M1�H�H��I��H1�I�M�H�L1�L1�H��I�L1�H��H��L�$XH\$8I�L�M1�H1�H$I��H�� M�I�L1�M1�LT$(H�� I��I�L�M1�H1�I��H��M�I�L1�M1�H��I�I�M1�I��L�$(LT$0L�|$xL�$xI�M�L��$�I�L1�LL$H�� M1�I�L�$hI�� L1�L�H��H1�I�H��L1�I�H��M1�I�I��L1�L�M1�H�H1�I�� H��M�H�$LT$@H�M1�L�$8H1�I�I��H\$ H�� M�L1�L�$H�M1�H�� H1�I��I�H��M�L1�L��$�H�M1�L�|$xH��H1�I�H��H�H1�H�I�L�$HM�L1�L1�L\$L�$8H��H�� I�I�L1�M1�H��I��M�L1�H��I�M1�I��M�L1�L�$HH�� I�M1�I��M�L1�H��I�M1�H�$L�$hL�I�I��L�$XH1�L1�LL$8L�|$xH�� H�� I�H�$I�I�L��$�M1�L1�I��H��L�I�H1�L1�H��H��I�I�M1�L1�I�H�M1�L\$@I�� LT$H�$(L�M�H�H1�H1�H��H�� I�M1�I��L�M1�LT$ I�� H1�H�M�H1�H��M1�I��M�M1�I��M�L��$�L�|$xM1�I�H��LL$L�$xI�M�H\$0L1�L1�L$H�H�� H�� H1�L\$(I�I�H��L1�M1�H�H��I��H1�I�M�H�L1�L1�H��I�L1�H��H��L�$HH�$(I�L�M1�H1�H�$8I��H�� M�I�L1�M1�L$H�� I��I�L�M1�H1�I��H��M�I�L1�M1�H��I�I�M1�I��LL$L\$0L�|$xI�I�LT$@L��$�L1�LL$M�H�� M1�I�L�$xI�� L1�L�H��H1�I�H��L1�I�H��M1�I�I��L1�L�M1�H�H1�I�� H��M�L�$H�$XH�M1�LL$ H1�I�I��H\$8H�� M�L1�LL$(H�M1�H�� H1�I��I�H��M�L1�L��$�H�L�|$xM1�H��H1�I�H��H�H1�H�I�L�$LT$M�L1�L1�L�$hH��H�� I�I�L1�M1�H��I��M�L1�H��I�M1�I��M�L1�LT$8H�� I�M1�I��M�L1�H��I�M1�H\$ L$L�I�I��L\$(H1�L1�H\$0L�|$xH�� H�� I�L�$XI�I�L��$�M1�L1�I��H��L�I�H1�L1�H��H��I�I�M1�L1�I�H�M1�LT$I�� L�$M�H�$8L�H�H1�H1�H��H�� I�M1�I��L�M1�L�$hI�� H1�H�M�H1�H��M1�I��M�M1�I��M�L��$�L�|$xM1�I�H��L�$xL�$I�M�H�$(L1�L1�LL$@H�H�� H�� H1�L�$HI�I�H��L1�M1�H�H��I��H1�I�M�H�L1�L1�H��I�L1�H��H��LT$8I�M1�I��M�L1�L�$(H�� I�M1�I��M�L1�H��I�M1�I��L�|$xH�$L�L��$�H1�H�$xH�� I�M1�I��L�H1�H��I�M1�I�LL$@L\$I�I�L$L1�M1�L\$0M�H�� I�� L�$hI�L�L1�H1�H��H��I�I�L1�M1�H��I��L�I�M1�H1�L1�I�� H�H��M�H\$ H�M1�L�$HL�$8H1�I�I��H�$H�� M�L1�LL$H�M1�H�� H1�I��I�H��M�L1�L��$�H�L�|$xM1�H��H1�I�H��H�H1�H�I�L\$(L�$hM�L1�L1�L�$XH��H�� I�I�L1�M1�H��I��M�L1�H��I�M1�I��M�L1�L�$XH�� I�M1�I��M�L1�H��I�M1�H�$8LL$8L�I�I��L�$H1�L1�H\$@L�|$xH�� H�� I�L�$I�I�L��$�M1�L1�I��H��L�I�H1�L1�H��H��I�I�M1�L1�I�H�M1�L�$HI�� L�$(H�$xL�M�H�H1�H1�H��H�� I�M1�I��L�M1�L$I�� H1�H�M�H1�H��M1�I��M�M1�I��M�L��$�M1�I�H��H\$LL$(I�L�|$xL\$H�L1�LL$ H1�H�� M�H��I�L1�L\$0H�L1�H�� H1�H��I�H�I�M1�L1�I��H��M�I�L1�L1�H��H��LT$ H\$@I�L�M1�H1�H�$HI��H�� M�I�L1�M1�L�$xH�� I��I�L�M1�H1�I��H��M�I�L1�M1�H��I�I�M1�I��L�$XL$L�|$xI�I�LT$8L��$�L1�M�L�$H�� M1�I�L\$(I�� L1�L�H��H1�I�H��L1�I�H��M1�I�I��L1�L�M1�H�H1�I�� H��M�H�$hLT$H�M1�L�$H1�I�I��H�$8H�� M�L1�LL$H�M1�H�� H1�I��I�H��M�L1�L��$�H�L�|$xM1�H��H1�I�H��H�H1�H�I�L\$0LT$0M�L1�L1�L�$(H��H�� I�I�L1�M1�H��I��M�L1�H��I�M1�I��M�L1�LT$H�� I�M1�I��M�L1�H��I�M1�H\$(L�$8L�I�I��H1�L1�H\$LL$ H�� H�� L�|$xL�$I�I�L��$�I�M1�L1�I��H��L�I�H1�L1�H��H��I�I�M1�L1�I�H�M1�L�$(I�� L�$xH�$HL�M�H�H1�H1�H��H�� I�M1�I��L�M1�L�$XI�� H1�H�M�H1�H��M1�I��M�M1�I��M�L��$�L�|$xM1�I�H��L�$L�$hI�M�H\$@L1�L1�LL$8H�H�� H�� H1�L$I�I�H��L1�M1�H�H��I��H1�I�M�H�L1�L1�H��I�L1�H��H��L$H\$I�L�M1�H1�H�$I��H�� M�I�L1�M1�L�$H�� I��I�L�M1�H1�I��H��M�I�L1�M1�H��I�I�M1�I��LL$L\$ L�|$xI�I�LT$(L��$�L1�M�L�$(H�� M1�I�L�$8I�� L1�L�H��H1�I�H��L1�I�H��M1�I�I��L1�L�M1�H�H1�I�� H��M�H\$0LL$8H�M1�I�L�$HH1�I��H�$XL1�H�� M�H�� L�$hH�M1�I�H1�I��L1�H��M�L��$�H��H�M1�L�|$xH1�I�H��H�H1�H�I�L\$@M�L1�L1�L�$xLT$@H��H�� I�I�L1�M1�H��I��M�L1�H��I�M1�I��M�L1�LT$0H�� I�M1�I��M�L1�H��I�M1�H\$L�$HL�I�I��L�$hH1�L1�H\$(L�|$0H�� H�� I�L�$xI�I�L��$�M1�L1�I��H��L�I�H1�L1�H��H��I�I�M1�L1�I�H�M1�L\$ I�� L�$H$L�M�H�H1�H1�H��H�� I�M1�I��L�M1�LT$8I�� H1�H�M�H1�H��M1�I��M�M1�L��$�I��M�L��$�L�|$0L��$�M1�I��H��L�$XL�$(I�M�H\$L��$�L1�L1�L�$8H�H�� H�� H1�L�$I�I�H��H��$�L1�M1�H�H��$�H��M��H��$�H1�I��I�H��L1�M�L��$�H��L1�H��$�I�H��$�L��$�I1�I��H��I�L��$�M1�L��$�L�L$PI��L�t$HH��$��EoIP�EoY`L��$��Aoqp�Eo��L��$�fDo�$�fDo�$�fD�$�fD�$�fDo�$�H��$�fD�$�fE�fE��fDo�$�fD�$�EAPfD��EQ`fE��EapE���oA�oiAn�oy A~ �oQ0AV0�oa@Af@�oqP�|$tL�D$XLD$hAvP�ǀ�oI`L)D$`AN`�oYpA^p)$A���tAA�A)�D��H�t$XH;t$`�m�L�|$HM��L�l$`H�t$hL�L���}4��E�$�H��$��X4��H��b H�H��$dH3<%(uvH��[]A\A]A^A_��2��I��$�H���c>����2��I��$��H���(4��H��$�I�|$PH��$��N���I��$��q2��H���2���_����3���>��f.���AUATUSH��hdH�%(H�D$X1���dH9��]I��H��L�o`H�Ӂ�`�vEH�W@H��H��H�W@����HwHL���7D��A��$`I��$��W�L��A��$`�d2��A��$`M�T$HI��ML$@I��I��L�L$�~D$A��$eL�T$D$AD$@��I�D$P�����L�1�D)��0��L��L��E1��C��H�t$I��K��I��I��H��H��H��I��I��I��A�C�H��H��H��A�S�I�� I��(A�K�I��0H��8A�{�E�C�E�K�E�S�A�C�I��u�H��H���R2��1�H�\$XdH3%(uH��h[]A\A]Ã���I�D$X�����4����]1��ff.�f���fo�FH��1�E1�fo
�FH� ���JF��F1�I��I��u��61�@������AWAVAUATUH��SH��H�t$HH�T$(dH�<%(H��$�1�H��������H�M0H�UpH��$�H�L$0)�H�T$`��H�t$hH�D$@H9D$(��H�l$8ff.�@L�t$0H�T$@H�t$HL��1��L�l$81�H�l$hL�t$0E�E A���E�P@�A��?A�����AU$E�U A�U$�Ao^0�Ao�Aof�|$P�Ao~ )�$�)$D�$)$$�$)<$fo4$)$fo,$f~t$ f~l$\�Aom)T$p),$D�$)m)�$�)�$��Ao}A�M(�\$)<$�<$)}D��$���$�A�D�$��$�E�D�D��$�E1�DL$tA��RQA��E��g�	jD1��A�E1�A��E�D�T$$D��$�D1�A����$�A��D�|$TD�|$xA�A�A�],A�D1ًD$ D1�D|$|��h�������g�A1�A��E�D1����A1�A����كA�A�D�$���E��D$$D1�D��r�n<D�$�D�$�����[D1�����D��:�O�A�D1�D1����A�A�D1�D1�����A�D1��D1�A��E1�A��D�$�D�$�E�D1��Aމ\$XD��D�|$\�E1�1�E��$�A��A�D�|$$A�D1�D�$�D1����A��D1�1��A��A�D1�D1����A�D�$�D�|$TD�$�D1�\$E���D1�D�$����A1�A��E�D1���A1�A��E�D1�D�$���A�E1�A��E�D1��A�E1�A��D�D�$�D�$�A�1�\$ D�|$TD1��D�|$XA��D�$�A�A1�E1�A��D1�A����D�E�A�1�D1�����A�A1�D1�A����D1�DL$t$��D�$�E��A�1�\$xE1��A��E�E1�DL$$A��D1�A�E�D1��E1��A���E�E1�A��E�D�|$XD�|$TE1�A��1�D�$�D�$�A�E���D1�D1�DT$|A����D�$�D1�A���D1�A1��A��A�E�D1�D1����A��D1�A1��A��D�$�\$$E�D�D�$�D1�1�DL$ $����A�A��D1�E1�A1�A��A��E�D�D1�1����A��E1�A1�A��A��D�|$T��D�|$XD�$�A�D\$xA�D1�E1�D�$���D�$�A��A�E�E�D1�D1����A�A�D1�E1��A��E�E1�A��D1�E���E1�A��D�$�\$|�D�$�E�1�A��$�E1��D1�D\$tA��A��E�D�|$XD1�A�D�|$TE1��D1�A�����1�A��D1�A��D1��A�D�$�\$|E�D�$�D1�D1�DT$�����A1�A��E�D1���A1�A��E�D1�D�$���A�E1�A��E�D1��A�E1�A��D�D�$�D�$�A�1�\$tD�|$TD1��D\$$D�|$X���A�A�A1�E1�A��D1�A����D�E�A�1�D1�����A�A1�D1�A����D1�D�$�DL$x��E��$�A��E1�1��$�A����E�E1�D�$�A��D1�A�E�D1��E1��A���E�E1�A��E�D�|$XD�|$TE1�A��1�D\$D�$�A�E���D1�D1�D$DT$ ����A�A��D1�D1�A1����A��A�E�D1�D1����A��D1�A1��A��D�$�E�D1�D$��A�E1�A��E�D1��A�E1�A��D�|$T�$�D�D\$xD�|$X1��$�A���D1��A1�A��D�1���A1�A����D�$�D\$A�A�D�$�E1�D1�D�$�E�A����E�A�D1�D1����A�A�E1�D1�A����E�E1�A��D1�E���E1�A��DL$t�$��D�$�E�1�A�\$$E1��D1�D\$ A��A��E�D�|$XD1�A�D�|$TE1��D1�A�����1�A��D1�A��D1��A�DT$|DL$xE�D1��$�D1�D�$������A1�A��E�D1���A1�A��E�D1�DL$$��A�E1�A��E�D1��A�E1�A��D�D$DT$ A�1��$�A�D1��D�$�D�|$T���D�|$XA�A1�D1�A��E1��D�A��A�1�E�D1�����A�A1�D1�A����D1�DT$|DL$��E��$�A��E1�1��$�A����E�E1�D�$�A��D1�A�E�D1��E1��A���E�E1�A��E�D�|$XE1�A��1�D�$�D�|$TDT$tA��E�D1�D�$�A�D1��D�$�D1�A���D1�A1��A��A�E�D1�D1����A��D1�A1��A��DL$$\$tE�D�D�$�D1�1�D�$�A������$�D1�A��E1�A1�A��A��E�D�D1�1����A��E1�A1�A��A��D�|$T��D�|$XDT$A�D�$�A�D1�D$E1�D�$���E�A��A�E�D1�D1����A�A�D1�E1��A��E�E1�A��D1�E���E1�A��D�$��$��D�$�E�1�A�\$|E1��D1�D\$xA��A��E�D�|$XD1�A�D�|$TE1��D1�A�����1�A��D1�A��D1��A�DT$ D�$�E�D1��$�D1�D�$������A1�A��E�D1���A1�A��E�D1�D�$���A�E1�A��E�D1��A�E1�A��D�D\$$A�1��$�D�|$TD1��D\$tDT$|���D�|$XA�A�A1�D1�A��E1��D�A��A�1�E�D1�����A�A1�D1�A����D1�D�$�D�$���E��$�A��E1�1�\$A����E�E1�D$A��D1�A�E�D1��E1��A���E�E1�A��E�D�|$XD�|$TE1�A��1�D\$ DT$xA�E���D1�D1�D�$�A����D�$�D1�A���D1�A1��A��A�E�D1�D1����A��D1�A1��A��D�$��$�E�D�D�$�D1�1�D�$�A������$�D1�A��E1�A1�A��A��E�D�D1�1����A��E1�A1�A��A��D�|$T��D�|$XD$A�D\$|A�D1�DL$$E1�DT$ ��E�A��A�E�D1�D1����A�A�D1�E1��A��E�E1�A��D1�E���E1�A��DL$x�$��D\$tE�1�A��$�E1��D1�D\$A��A��E�D�|$XD1�A�E1�D�|$T��D1�A�����1�A��D1�A��D1��A�D�$�E�D1�D1�D�$�\$ ����D�$��A1�A��E�D1���A1�A��E�D1�DL$x��A�E1�A��E�D1��A�E1�A��D�D�$�DT$tA�1�\$D�|$TD1��D�|$XA��D�$�A�A1�E1�A��D1�A����D�E�A�1�D1�����A�A1�D1�A����D1�D�$�D�$���E��$�A��E1�1��$�A����E�E1�D�$�A��D1�A�E�D1��E1��A���E���$�E1�D��$�A��E�D��$�D�|$TD��$�E1�A��1�D\$|��A�D�$���D��$�D1�E�D\$$A��D1�D$D��$�A��A1���$�D1��A����A1�D��$�A�D1�D��$���Aԉ�$�D����D��$�A1�E�A��D1�D��$���D��$�L�d$8͉�$�L�D$`1�|$PL�\$@��$����Eo$$�Eot$��$�H�l$0��fDo�$�L\$H)�fD�$�L)\$(A��fDo�$�H�L$(L�t$@fD�$�fE��E$fE��El$�Ao0u�AoHM�AoX ] �Aoh0m0),$A��$�I9��[�L��I��H�t$HH|$0L���s��D��1�H��$�dH3<%(uH��[]A\A]A^A_�L�d$(��y��f���AWL�~AVI��AUATUSH��HH�nH�|$dH�%(H��$81�H���zf�H��H�ZL��)�$�E1�1�L��N )�$�H�)�$)�$)�$()�$�)�$�)�$�)�$�)�$�)D$H)D$X)D$h)D$x)�$�H�D$@H�D$8H��$�VH��jj���H�� I��H���H���H����	L�HM���'H�xH����H�xH���_
L�p M����
L�P(� L�T$M���1�D$M�_0A�M���fI�8H���4I�@H���\M�GHM���_I�xH�5�J H9���)������D$ ����)��I�H���A�Ń����H���D�|$8H�'J H�D$8D�t$0D�|$$H�\$0H�D$L�:H�T$(����D$ ���*��H�L$1�H���0I��H���!*��f�ҍu�Hǀ�PP ���H��$�A��@�h��
H�|$H��
�l$����E�L$�A�oA����u
D�`A�����L9d$�8I�������D�T$$D�PL9��7D�pI��H��(I�� �XD�pA�����
H��$�D�h�@�9I�_0I�81�E�oH��H��ILJ�H)�������H�E���AƇ��Ao_�Aog f�H/f�%P/A_0Ag@E����H�|$��H��$8dH3%(L����H��H[]A\A]A^A_ú1�H��$�H�D$8H�D$0H���H��$�H���H�|$@H���H����'��H����H��f�M�L�D$H���M�O� L�t$M���I�L�t$H���mI�H����	I� H����	M�W(�D$M�����L�t$L�T$ff.��I�zH�5�G H9��E&�����A�Ņ��5&��I�(�#���D$�����	H���Y
�D$$A��D$ L�'G H�t$8H�\$0H�t$M�;L�\$(������+'��H�D$1�H���0I��H���/'��f��M�Hǀ�hh ���!H��$�A��@�h��H�|$H��|$���T$E�L$�A�WA�����E�gA�����L9d$�C	H�������D�T$E�WH9��B	I��A�_H��(I�� A�_E�_A������|$  E�o��H��$�D�l$ E�o�%A�wI�_0I�81�ILJ�H��H��H)�������H�E����Aow�Ao f�5I,f�=Q,D�D$$Aw0A@E���@����M����H��$��YH��$���H�|$H����H�|$@�T�����ff.�@I�{H�5]E H9��$���G��A�Ņ��$��I�0����A�ă����H���W���H��D H�D$8D�t$0H�\$0D�l$8L�:H�D$H�T$(�P���D$$����$��H�L$1�H���0I��H����$��f�ɍu�Hǀ�HH ����H��$�A��@�h��H�|$H���l$�����E�L$�@�hA����<D�`A�����L9d$��I�������D�hL9��I��D�pH��(E1�I�� �XH��$�D�XfD�p����L�t$H��$�H������H�� ����A�G���L�t$I�V�����L���M����#��I�9��#��H��$01�L��H���$��������$T�4#��H��$@H�����H��$0H����H���0�����ff.�E1�I�WP�D$ H���tI�XH���+�D$$I�`�������L�t$���E1�I�yH�5�B H9���!������A�Ņ���!��I��h���Ń����H�����D$$A��D$ �D$�:���E1�� L��$�1�L�����A�Ņ��B�CL���.�����x!��H��t�L�t$�Q���fDH��$�������L�t$L��$�fE�@H��$�H��$�L��D)�$�D)�$D)�$D)�$ ���L��H�ߺ@���@�@L���������H�zH�5�A H9��� ������D$$���� ��I�P�&���D$ �����L�t$H�������=���DE1��D$$E1� A��D$ �D$����L�t$�!���L�l$(� H�5�!1�I�}�l��I�/�L��E1��w���J����D$$������H��$@H��$0H��I����L���m���`���H��$��������E1�� L��$�1�L�����A�Ņ��X�CL���D�����F ��H�������L�t$�p���L��� E1�L�d$@1�L������A�Ņ��
�CL��������a ��H���a���L�t$�/���H��? H�5� H�;������L�t$H��$�H���GH����I� H��$�L�t$����L�t$H�L$PH���H����I�(H�t$@L�t$����H�t$8�[����tNH�����L�t$�D$$E1��D$ ���H�t$0�6����tH��t������H���l���E1��y���L�d$(H�55I�<$��������D$$�����D$$�;����D$ D�l$$���D$ E1�����L�t$(� H�5:1�I�>������H�T$(H�5�H�:�W�����L�t$���L�t$���H�D$(H�5�H�8�*���Y���H�L$(� H�5�1�H�9����9���L�t$���L�t$���H�l$(�H�5�1�H�}�u������L�L$(�H�5�1�I�9�U������
���D$$�������H��L�t$�z�������6��H���D�������#��H���4����|������H���n���H�����L�t$�D$$�D$ ������
��H���<���L�t$�D$$H�����������L�r= H�5�I�8�����"���H�=W= H�5�H�?��������L�t$�0��4��L�t$������D��AWAVAUATUH��SH��H��hdH�%(H��$X1�H��< L� ��������H�S�����H���H���H��H�9�>��H��$�1�H��H�t$x�����������$�����H�����H��$�H�����H��$�H�t$@H�|$HH���w���A��L�M`L�L$(A)�E��L�D$8L9D$@�.L���L�]0H�l$0L��$L�T$`L�\$hL�t$pf�L�|$(H�T$8H�t$HL��
��H�t$01�H�|$hL�|$(�^P����C@D�L�l$p��?�����VT�FP�VT�Ao �Ao_0�Ao�l$P�Aog)�$�)$D�$$)$$�$)<$fo4$)$fo,$)�$)�$�)�$�f~l$\�o/f~t$ ),$D�$A)m�oD��$��L$)<$�<$D�$$A�A)}D��$I��E�D��$A�]\D1�D�$�5RQ��D��g�	jD1��A�D1��AĉD$$�D$ D1�A����$(A��D�D$TD��$$A�AˋNX��$,E�E�D��$D1�D1�D�$���h�������g�A1�A��E�D1����A1�A����كA�A�D�$���E��D$$D1�D��r�n<D�$�D�$�����[D1�����D��:�O�A�D1�D1����A�A�D1�D1�����A�D1��D1�A��E1�A��D�$�D�$�E�D1��Aމ\$XD��D�|$\�E1�1�E��$�A��A�D�|$$A�D1�D�$D1����A��D1�1��A��A�D1�D1����A�D�$D�|$TD�$D1�\$E���D1�D�$���A1�A��E�D1���A1�A��E�D1�D�$���A�E1�A��E�D1��A�E1�A��D�D�$�D�$A�1�\$ D�|$TD1��D�|$XA��D�$A�A1�E1�A��D1�A����D�E�A�1�D1�����A�A1�D1�A����D1�D�$�$��D�$��A�E�1��$�E1��A��E�E1�DL$$A��D1�A�E�D1��E1��A���E�E1�A��E�D�|$XD�|$TE1�A��1�D�$�D�$�A�E���D1�D1�D�$�A����D�$�D1�A���D1�A1��A��A�E�D1�D1����A��D1�A1��A��D�$�\$$E�D�D�$�D1�1�DL$ $����A�A��D1�E1�A1�A��A��E�D�D1�1����A��E1�A1�A��A��D�|$T��D�|$XD�$A�D�$�A�D1�E1�D�$��D�$�A��A�E�E�D1�D1����A�A�D1�E1��A��E�E1�A��D1�E���E1�A��D�$�$��D�$�E�1�A��$�E1��D1�D�$�A��A��E�D�|$XD1�A�D�|$TE1��D1�A�����1�A��D1�A��D1��A�D�$�D�$�E�D1��$�D1�DT$�����A1�A��E�D1���A1�A��E�D1�D�$���A�E1�A��E�D1��A�E1�A��D�D�$D�$�A�1��$�A�D1��D\$$D�|$T���D�|$XA�A1�D1�A��E1��D�A��A�1�E�D1�����A�A1�D1�A����D1�D�$D�$���E��$�A��E1�1��$�A����E�E1�D�$�A��D1�A�E�D1��E1��A���E�E1�A��E�D�|$XD�|$TE1�A��1�D\$D�$A�E���D1�D1�D$DT$ ����A�A��D1�D1�A1����A��A�E�D1�D1����A��D1�A1��A��D�$�E�D1�D$��A�E1�A��E�D1��A�E1�A��D�|$T�$�D�D�$�D�|$X1��$�A���D1��A1�A��D�1���A1�A����D�$�D\$A�A�D�$E1�D1�D�$E�A����E�A�D1�D1����A�A�E1�D1�A����E�E1�A��D1�E���E1�A��D�$��$��D�$�E�1�A�\$$E1��D1�D\$ A��A��E�D�|$XD1�A�D�|$TE1��D1�A�����1�A��D1�A��D1��A�D�$�D�$�E�D1��$�D1�D�$�����A1�A��E�D1���A1�A��E�D1�DL$$��A�E1�A��E�D1��A�E1�A��D�D$DT$ A�1��$�A�D1��D�$�D�|$T���D�|$XA�A1�D1�A��E1��D�A��A�1�E�D1�����A�A1�D1�A����D1�D�$�DL$��E��$�A��E1�1��$�A����E�E1�D�$A��D1�A�E�D1��E1��A���E�E1�A��E�D�|$XE1�A��1�D�$D�|$TD�$�A��E�D1�D�$A�D1��D�$�D1�A���D1�A1��A��A�E�D1�D1����A��D1�A1��A��DL$$�$�E�D�D�$D1�1�D�$�A������$D1�A��E1�A1�A��A��E�D�D1�1����A��E1�A1�A��A��D�|$T��D�|$XDT$A�D�$A�D1�D$E1�D�$���E�A��A�E�D1�D1����A�A�D1�E1��A��E�E1�A��D1�E���E1�A��D�$��$��D�$�E�1�A��$�E1��D1�D�$�A��A��E�D�|$XD1�A�D�|$TE1��D1�A�����1�A��D1�A��D1��A�DT$ D�$E�D1��$�D1�D�$������A1�A��E�D1���A1�A��E�D1�D�$���A�E1�A��E�D1��A�E1�A��D�D\$$A�1��$D�|$TD1��D�$�D�$����D�|$XA�A�A1�D1�A��E1��D�A��A�1�E�D1�����A�A1�D1�A����D1�D�$�D�$���E��$A��E1�1�\$A����E�E1�D$A��D1�A�E�D1��E1��A���E�E1�A��E�D�|$XD�|$TE1�A��1�D\$ D�$�A�E���D1�D1�D�$�A����D�$�D1�A���D1�A1��A��A�E�D1�D1����A��D1�A1��A��D�$��$E�D�D�$�D1�1�D�$A������$�D1�A��E1�A1�A��A��E�D�D1�1����A��E1�A1�A��A��D�|$T��D�|$XD$A�DL$$A�D1�D�$�E�E1�DT$ ��A��A�E�D1�D1����A�A�D1�E1��A��E�E1�A��D1�E���E1�A��D�$��$�D�$�E�1�A��$�E1��D1�D\$A��A��E�D�|$XD1�A�E1�D�|$T��D1�A�����1�A��D1�A��D1��A�D�$�E�D1�D1�D�$�\$ ����D�$��A1�A��E�D1���A1�A��E�D1�D�$���A�E1�A��E�D1��A�E1�A��D�D�$�D�$�A�1�\$D�|$TD1��D�|$XA��D�$�A�A1�E1�A��D1�A����D�E�A�1�D1�����A�A1�D1�A����D1�D�$�D�$��E��$�A��E1�1��$A����E�E1�D�$�A��D1�A�E�D1��E1��A���E���$E1�D��$D�$A��E�D��$LD�|$TD��$8E1�A��1�D�$�D�$A�E���D��$$D1�D1�D\$$E����Aʼn�$@A��D��$<A1�D1�A1�A����D��$(A�D1�D��$��Aԉ�$DD����D��$0A1�A�A��D1�D��$,��D��$L�d$0͉�$HL�D$`1�L�\$8�|$P��$4��H�l$(�Eod$0�Eot$@��$ ��fDo�$0L\$HfD�$L)\$@fDo�$ fD�$@fE��fE��E\$0El$@�Ao0u�AoHM�AoX ] �Aoh0m0),$A��$�t=A��A)�D��H�L$8H;L$@���L��L�t$@H�t$HH|$(L�����D��H�|$x�s���H��( H�H��$XdH3%(urH��h[]A\A]A^A_����H���H���)	���	���H����I���E���H��$�H�}0H��$��L��H������L������f����.�������f���AVAUATUSH��0dH�%(H�D$(1����H9�����@I��H��I��L�o0v=�W L���@��?�W ����_$�"��A��$�L��V�I�t$pA��$����A��$�A��ED$ A�T$$A��$�E�D$ t	A�D$,����A�D$(������1�)�L���L��L���"��H��E1�H��C��I��H���LjB��b�����@�z��B�I��u�L��H������1�H�t$(dH34%(uH��0[]A\A]A^Ã������DH�=�- H��- H9�tH��& H��t	�����H�=a- H�5Z- H)�H��H��H��?H�H�tH�U& H��t��fD�����=5- u+UH�=:& H��tH�=~! ����d����
- ]������w������AUATUSQH��% H��6������:�����H�=B, �m���H��H���P���L�-�% L�%�% M�eL���w������.���I�EL��H�5�H���(����M�����H��H�������H��H�5�L���	����������H�+�/�����}���H��H���@���H��H�5�L����������H�+�4����@�C���H��H������H��H�5kL����������H�+�|����@�	���H��H���N���H��H�5FL���[������H�+�����H�5�H�����H�5�H����@H�5�H����H��@H�5���H�j$ L�cH����������H�H��H�5�H����L���G���H��H���M���H��H�5IL���������H�+������
���H��H������H��H�5!L���_�������H�+������ ���H��H���c���H��H�5�L���%���3���H�+����� ��H��H�����H��H�5�L�����������H�+������H�5�H��H���R�H�5�H���>� H�5�H���*� H�5�H����ZH��[]A\A]���H��H���BLAKE2B_SALT_SIZEBLAKE2B_PERSON_SIZEBLAKE2B_MAX_KEY_SIZEBLAKE2B_MAX_DIGEST_SIZEBLAKE2S_SALT_SIZEBLAKE2S_PERSON_SIZEBLAKE2S_MAX_KEY_SIZEBLAKE2S_MAX_DIGEST_SIZEcontiguous bufferargument 'key'argument 'salt'argument 'person'_blake2leaf_size is too largenode_offset is too largenameblock_sizedigest_sizecopyhexdigestupdate_blake2.blake2skeysaltpersonfanoutleaf_sizenode_offsetnode_depthinner_sizelast_nodeusedforsecurity_blake2.blake2b%s is not available in FIPS modeinteger argument expected, got floatdigest_size must be between 1 and %d bytesmaximum salt length is %d bytesmaximum person length is %d bytesfanout must be between 0 and 255depth must be between 1 and 255node_depth must be between 0 and 255inner_size must be between 0 and is %dmaximum key length is %d bytesUnicode-objects must be encoded before hashingobject supporting the buffer API requiredBuffer must be single dimensionupdate($self, data, /)
--

Update this hash object's state with the provided bytes-like object.hexdigest($self, /)
--

Return the digest value as a string of hexadecimal digits.digest($self, /)
--

Return the digest value as a bytes object.copy($self, /)
--

Return a copy of the hash object.blake2s(data=b'', /, *, digest_size=_blake2.blake2s.MAX_DIGEST_SIZE,
        key=b'', salt=b'', person=b'', fanout=1, depth=1, leaf_size=0,
        node_offset=0, node_depth=0, inner_size=0, last_node=False,
        usedforsecurity=True)
--

Return a new BLAKE2s hash object.update($self, data, /)
--

Update this hash object's state with the provided bytes-like object.hexdigest($self, /)
--

Return the digest value as a string of hexadecimal digits.digest($self, /)
--

Return the digest value as a bytes object.copy($self, /)
--

Return a copy of the hash object.blake2b(data=b'', /, *, digest_size=_blake2.blake2b.MAX_DIGEST_SIZE,
        key=b'', salt=b'', person=b'', fanout=1, depth=1, leaf_size=0,
        node_offset=0, node_depth=0, inner_size=0, last_node=False,
        usedforsecurity=True)
--

Return a new BLAKE2b hash object._blake2b provides BLAKE2b for hashlib
ɼ�g�	j;�ʄ��g�+���r�n<�6_:�O�т�RQl>+�h�k�A��كy!~��[g�	j��g�r�n<:�O�RQ�h��ك��[;�0��� ��������8�P�����T�����d��h�3��� ���4�������������	���
u����
\���@�������8���L���`���tp��������.��@�.��T�.��h�.��|P/����/��� ;��d0;��x`?���J��h�J��|@q��x�q�������������`P��������	0��`	���
���
��zRx�$���FJw�?:*3$"DH�pL\P���zL�B�B �B(�A0�A8�J�J
8C0A(B BBBA����
�|���x��(�t��{F�C�A �mABzRx� ���$��TH���bE�}
NLd����B�B�B �B(�A0�A8�G��
8C0A(B BBBA�h+��
�d+���`+��(�\+��oF�C�A �aAB4�T0�+��bE�}
NLL�+��`B�B�B �B(�A0�A8�G�
8A0A(B BBBL$zRx��������,�����6��	L��6��+F�B�B �B(�A0�A8�J�
8A0A(B BBBA$zRx��������,��LxT:��eB�B�B �B(�A0�A8�G�
8A0A(B BBBA0����`E��	L�\E��_&F�B�B �B(�A0�A8�J�
8A0A(B BBBG$zRx��������,��C8|p�5F�B�A �A(�A0 (D ABBzRx�0����$p�
��j��|R��H`yLk��IF�E�B �B(�A0�A8�G�!
8A0A(B BBBA`h����F�B�B �E(�E0�A8�G�m���B�B�I��
8A0A(B BBBA$zRx��������$,���h�Z�E�B�I�L@����F�B�B �B(�D0�A8�J�
8A0A(B BBBA$zRx��������,��(����E�A�G��AA<�8����F�B�A �A(�D�v
(A ABBA@��F�B�B �A(�D0�G��0A(A BBBXd���Ml��zH@qL������F�B�B �B(�A0�D8�G�X
8A0A(B BBBA`����KF�F�E �B(�A0�A8�G�m���E�B�I��
8A0A(B BBBA$zRx��������$,%����]�B�B�I�L�d���F�B�B �B(�A0�D8�J�g
8A0A(B BBBA$zRx��������,M��(	���E�A�D��AA@@	��;F�B�B �A(�A0�D`
0A(A BBBA@�	D��F�B�B �A(�D0�G��0A(A BBBGNU��)�) K!.Q.�.�.�.�.�.�.�.�.�.�.�..Q.�.�.�.�.�.�.�.�.�.�.�.Uft��
-K!K!���o`�	
^@N!� �0		���o���op���o�o����oT0L! 0@P`p�������� 0@P`p�������� 0@P`A. eF.eQ.e].0e2e.0��1b.�q`1l.�1s.��e@2�P!P!�@K!{.A.0JF. JQ.J].@J`4e.pq 4b. ��3l.@�`3�.��J�4�S! S!`��K!�.	.�5���������V!GA$3a1�-_blake2.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug�B(L�7zXZ�ִF!t/���]?�E�h=��ڊ�2N������!�_��L�xe+F�c���|�#ي6n�x�ni��M���ĉ��:�<؄!�X�r�\���у˔��������E�7��^=J
�Q�o�������z���(�����I���Hf�wZuP
N��DTW29���!�ԅ�;M t�
p��>�qL-�t�j���A��cx�d�����y3��ɕM���+牦��78�Z�T��~��k���
6�p����r��ȗg5���:l^��a.�'�v[
��?���A}�{�2�M�����n���iB���+�X))�Y�ս���ѓ��[T��9����g��.�,O��x-�_P�ґE�/��l��s������(�Ƀ�ɚ��cFA���0.��(7�b����Ŏ41����Qͅ[�>�ɗ�G�8����z[c�L�D� >�G+zdO�\H�C�� (�z���Ӱ�hΟ��gbx����32�~*�-�V�!�h��M8A[�OӋ!n��e�ۨ�s��i@�֫үv�m�Q""�x�*U�
����D���k��78{�T��!�1zz6��=��#����GW�EjЗ3
|��K�gu:�&)j�vrؐy��Xm䂓��^�		�4$b���Uh
��O�8��*�?���I�/	���
-�/MaZ}�kȌ^I[���y���0լ6
�A�8�w��=Ӳ��/Y��g�f�����id�y݊�WOH8��mzxW�
�%,�/��ɫI�����}7Y	����\�
`'�c��A*,�5��D�;pa��.}��S�\���s��aA�#I�0������lj���X�=�^�W��9�$�n)^�(��.s�
�]M�4�$��<t�&J�S~�k��O�J�7q�ɢ)�q��OA��1�>�9�0�d��ǕX)$����b_��lܡǝ�E�Ù#a���4vaۓ�1���,4���e��Ml��o�U�2eY������3�銧��'R�o��^q��@�#?�[��c
Fh��Ѓ��xT�\�9��ac��|#y��xw����S� Uά����*-��8G9:W6���ٌg��$q��e�Jv�G$���U�#����o��k�����p��UV@�rX���n}:?{ˮ��,����ߘ[�8[`B�-[Ǎ��x	�!{"�+hآ{2�2�0�/d�L$����Ir��IS�S��<�ub�^X�_�$kU��zKst5�[F��꣛�y ��͑FL�2b1aS1���:�8w�n�XxU�~�c��'6n4`l���x���
�/1e^^��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``�(x0�	�	^8���o���E���opp�T��0	^B  �h��c���npppw�!�!%}--
� - -0	 �P6P6���7�7�	��A�A �K!K�K!K� K! K �0L!0L�@N!@N��P!P� ��V!�V@ �Wa�V$
�V`,WX�\(lib-dynload/_curses_panel.cpython-38-x86_64-linux-gnu.so000075500000050150151153537500016733 0ustar00ELF>�@(I@8	@�1�1 << < � 0<0< 0< 00888$$�1�1�1  S�td�1�1�1  P�td�,�,�,��Q�tdR�td<< < ��GNU����2Y��8Jƿ�
n1�@ �13��|CE���Ϯ(�qX9v�� $���V�� �G�, ��F"	�����`(zj��1���9�fR�%�?_ C LC ��#/SC __gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpanelw.so.6libncursesw.so.6libtinfo.so.6libpthread.so.0libc.so.6PyModule_GetState_Py_NoneStructPyState_FindModulePyErr_Formattop_panelshow_panelPyFloat_Type_PyArg_CheckPositionalPyType_IsSubtype_PyLong_AsIntPyErr_OccurredPyExc_TypeErrorPyErr_SetStringmove_panelhide_panelbottom_panel_Py_Deallocset_panel_userptrdel_panelPyMem_FreePyExc_RuntimeErrorPyObject_Freepanel_hidden_Py_TrueStruct_Py_FalseStructpanel_belowpanel_aboveupdate_panels_PyArg_BadArgumentreplace_panelnew_panelPyObject_MallocPyObject_InitPyMem_MallocPyErr_NoMemoryPyInit__curses_panelPyModule_Create2PyModule_GetDictPyType_FromSpecPyCapsule_ImportPyErr_NewExceptionPyDict_SetItemStringPyUnicode_FromStringPyModule_AddObject_edata__bss_start_endGLIBC_2.2.5�ui	d< �# < `#(< (< @ �%@ 8@ �* @ �%(@ t8@ �*@@ 0%H@ tX@ @*`@ �%h@ Jx@ �)�@ +%�@ W�@ `)�@ %�@ f�@ )�@ a%�@ $ �@ �(�@ �%�@ ��@ @(A %A LA �' A %(A 28A �'@A A%HA XA `'`A �%hA �xA '�A u�A @ �A �%�A ��A �,B �%B !B  , B �%(B �8B �+@B &HB �XB +�B &�B �A �B &&�B �A �B p"�B �"C �#�? �? �? �? �? �? �? �? �? �? #x> �> �> �> �> �> �> �> 	�> 
�> �> 
�> �> �> �> �> �> ? ? ? ?  ? (? 0?  8? !@? "H? $P? %X? &`? 'h? (p? )x? *�? +�? ,�? -�? .�? /�? 0��H��H��) H��t��H����5r( �%s( ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&��������%�% D���%�% D���%�% D���%�% D���%�% D���%�% D���%�% D���%�% D���%�% D���%�% D���%�% D���%�% D���%�% D���%�% D���%�% D���%�% D���%}% D���%u% D���%m% D���%e% D���%]% D���%U% D���%M% D���%E% D���%=% D���%5% D���%-% D���%%% D���%% D���%% D���%
% D���%% D���%�$ D���%�$ D���%�$ D���%�$ D���%�$ D���%�$ D���%�$ D��H�GH��[1�]A\��tH��$ H��SH�=�' H�����H���F���H��H�5�	H�81���1�[���PH�����H�5�	Z�����PH��F���H�5�	Z�����AUI��ATUSH��APH��uH�H�-H$ H�xH9�u$�eH�ֹ�H�=t	�T�����u��H��������u7H�;���A�ă��tH�SH�zH9�u��[���H��t��aH��������tH�
�# H�52
H�9�r����=H�{�G����Ã��t#I�}D����r���YH�5�[��]A\A]������H��t�Z1�[]A\A]���PH�����H�5�Z��������PH����H�5�Z���b���H������E��H�g& ATI��USH��P��tZH�I�|$�i���I�|$H��H������A�ă��uH�uH���T����H��tH�MuH���?���[D��H�5+]A\����[1�]A\���UH��S1�QH��% �P��t9H�}��H��H��u%H�=S% ���H������H�5�H�8�����H�H��Z[]���AUATUSH��QL�gH����H��tH�{H��1��M���H�MuH�����H�{���H�{H��tbH�u�s���H�-D% H;]uH�UH��H�0% �����6H;t$H��H�}H��u�H��! H�5RH�8�j����
L�o���L�mH���#���I�$uZL��[]A\A]���X[]A\A]���QH������tH��! H��
H�q! H�Z���SH�����H��$ H��uH�c! H��0H�H;Bt!H�[H��u�H�=! H�5�H�8����H�H��H��[���H�6$ S1�P��tO1����H�&$ H��uH��  H��0H�H;Bt!H�[H��u�H�
�  H�5eH�9�U����H�H��H��[���SH��j���H��# H��uH��  H��0H�H;Bt!H�[H��u�H�y  H�52H�8����H�H��H��[���H�r# S1�P��tO1�����H�b# H��uH�6  H��0H�H;Bt!H�[H��u�H�
  H�5�H�9����H�H��H��[���QH�# �P��1���t����H�� H�Z���H��" ATUH��SH��H�~H�0H9�t4�����u+H�
�" H�=1�H�1H��H�VH�5��\����H�{H��" L�#I;|$t!H�[H��u�H�R H�53H�:�����ZH�u������u'H�=�! 1��6���H�����H�5�H�8����&I�|$H�EI�l$H�u�E���H�� H���H��[]A\���H��! ATI��USH�~H�0H9�t4�����u+H�5�! L��1�H�>H�5
H�WH�=-�r�����I�|$�S���H�=,! H��H��u!����H������H�5@H�8�����^���H�����H�=�  H�h�F���H�����H�PH�z �!���H��H������H��H��u1��WH�X����H��H��u!����H�MH�Eu���H���%���� H�
�  H�(H��H��  H�HL�eI�$H��[]A\�H�+t1��H������]H��1������yf���ATI��UH��SH������H�8�\���H������[L��H�8H��]A\��f���UH��SH�����H�H��tH�����H�H�+�����H��1�[]�@H�=  H�
  H9�tH�� H��t	�����H�=� H�5� H)�H��H��H��?H�H�tH�} H��t��fD�����=� u+UH�=b H��tH�=� ����d����u ]������w������������AT��H�=� US���H���i���H��H������H�=� I�����H��H���=���Hǀ8H���E����H�=iH�h���H�� ����H������H������1�1�H�=GH�����H��H�E���H�5:L��H���H�=D�F�H�5"L��H��H�����H��H�5L�����H�m�����H����H��H�@H���H�5EH��H�P��H��[]A\���H��H���%s() returned ERRtopshowmovemove_panelhidebottomset_panel_userptrno userptr setargumentreplacereplace_panel() returned ERRnew_panel_curses._C_API_curses_panel.errorversion__version__abovebelowhiddenset_userptrwindowbottom_paneltop_panelupdate_panels_curses_panel.panel_curses_panelinteger argument expected, got floatremove_lop: can't find Panel Objectpanel_below: can't find Panel Objectpanel_above: can't find Panel Objectreplace_panel: can't find Panel Objectwindow($self, /)
--

Return the window object associated with the panel.userptr($self, /)
--

Return the user pointer for the panel.top($self, /)
--

Push panel to the top of the stack.show($self, /)
--

Display the panel (which might have been hidden).set_userptr($self, obj, /)
--

Set the panel's user pointer to obj.replace($self, win, /)
--

Change the window associated with the panel to the window win.move($self, y, x, /)
--

Move the panel to the screen coordinates (y, x).hide($self, /)
--

Hide the panel.

This does not delete the object, it just makes the window on screen invisible.hidden($self, /)
--

Return True if the panel is hidden (not visible), False otherwise.bottom($self, /)
--

Push the panel to the bottom of the stack.below($self, /)
--

Return the panel below the current panel.above($self, /)
--

Return the panel above the current panel.update_panels($module, /)
--

Updates the virtual screen after changes in the panel stack.

This does not call curses.doupdate(), so you'll have to do this yourself.top_panel($module, /)
--

Return the top panel in the panel stack.new_panel($module, win, /)
--

Return a panel object, associating it with the given window win.bottom_panel($module, /)
--

Return the bottom panel in the panel stack.2.1curses function returned NULL;����(��@�����B��\��v�g�T��l������+�(��PZ������H�����$4�<!�hU��������T��������������zRx�$���FJw�?:*3$"DP�p\��(p$�7F�D�D �[JBzRx� ���$T�ACB�?�?P�n�b�EQd�EQH$f��F�E�A �A(�E0�
(H CBBEK(C ABBp�EQ��EQ$�4�<E�D�D jCAzRx� �� ��
���	4��}M�D�A �R
KBEACB$D��ZE�D�C KAAHl-��F�B�A �A(�D0�
(D ABBEA(A ABB���*Ed���[E�U��iL�\T�[E�U$��iL�\@��(Eb(X���M�A�D ��AB(���4M�D�A �AB(�4�/F�M�A �ABD��)GNU��#`#(< Ufu����
�$<  < ���o`��
p`> � ��	���o���op���o�o���o<0<  0@P`p�������� 0@P`p�������� 0@P`�%8�*�%t�*0%t@*�%J�)+%W`)%f�)a%$ �(�%�@(%L�'%2�'A%`'�%�'4u@@ �%��,�%! ,�%��+&�+& �A &&�A p"�"�#GA$3a1��$_curses_panel.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug��7zXZ�ִF!t/���+]?�E�h=��ڊ�2N���;�� �S�'�'�	��A�A"���?F/������r/|9Z��1��(�)V�넫��8M�����#��q0%%��U&nS�X���3hD��~���H��a<��	��FG�;E��1
�FiX%�e���r�����-u}�Kl�[@�U��ZUj�����nq���^9m�yAϙ�X��'�[�k��ť��)�O�y#J(���S�e�SA�`�A:Q�įaK��� ۝]
&�3���G�'4��ץ�(��~j�7��s�?��SOж���I��(cT��e��U5��}q�/�ȟW|�zƃ��ݢ��DB_�z���N)U7��o`�T{:�M�ה�S����+dv�x��I��sH�~!���Q)/SD?@������`�N���6dߨ��PA��׎�^UEtZ@k��W��Z$�6�,&:��9��?��@�E^��i���јyC�:��߳��(0y� �n��H��B6�����B;FE܀��_NO�>�R&o�M;H+��ආKS��.�Ͻ|?b�<m�ܣ�6�8�XU�`�FE��	�J�N|L�]>U]�bȔ���n,,KCH�Ceʼnߣ&���ӛk�/%�9x�FF���xe�1��b��T�Y
p��;m���2��3�C�r����"��Q!���}��T�if<Q;��7N�C�a�]K���/�6[0�	e|0��/>Ozz.�W�+��va6��ͨު��M0t1���*�Ҫd����ҴA��]�
5t�᪳�ܤ��y�Ēz&w�؞MJ!� �Kv�G�
S�z��<�͵�T,4a�(�Z~*)`N)���!�$�5��SMWEb��A��\?�"9K�]A��a�2OW7�A��u��t�T��c�b�F��e�����E�=p����&����'�7P�F�`���Y3��C�#��w)+R��
��0k��sk!���/�e�AU��LI�L>����,Q,`6E�܎XF���F�{Hf�rO�l��TT�v�n�����|\�QG{O�}!�/WG�򵿟��3�_"U͌^=�y��%��|��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(���0��p8���ojE���opp T���^B  �h��c���npppw��
}�$�$
�%%� ��,�,���-�-���1�1 �< <� <  <�(< (<�0< 0<0�`> `>��@ @ �C C� C`C$
,Cd�Cl�G(lib-dynload/unicodedata.cpython-38-x86_64-linux-gnu.so000075500004126330151153537500016401 0ustar00ELF>`(@��@8	@�� ЈЈ0Ј0�� `�`�0`�0888$$������  S�td������  P�td�y�y�y,,Q�tdR�tdЈЈ0Ј000GNU��A���ǜ��'E�iڥ)�l.�b !
.25D:�
`��ú�|CE��@i!���A#�qXC��fue�Z� S����hu �K, �F"w<�=)���������I����#���0��0��Ȟ0���04�08�������0*�j�__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6_PyUnicode_Database_RecordsstrncmpPyMem_MallocPyMem_ReallocPyMem_FreePyErr_NoMemoryPyUnicode_FromKindAndData__stack_chk_fail_Py_Dealloc_PyArg_BadArgument_PyUnicode_Ready_PyUnicode_EastAsianWidthNamesPyUnicode_FromString__memcpy_chkPyOS_snprintfPyUnicode_FromStringAndSizePyLong_FromLong_PyArg_CheckPositionalPyExc_ValueErrorPyErr_SetString_PyUnicode_ToNumericPyFloat_FromDouble_PyUnicode_ToDecimalDigit_PyUnicode_ToDigit_Py_TrueStruct_PyUnicode_EqualToASCIIIdPyUnicode_Compare_Py_FalseStruct_PyUnicode_CategoryNames_PyUnicode_BidirectionalNames__sprintf_chkstrcpy_Py_ctype_toupper_PyArg_Parse_SizeTPyUnicode_FromOrdinalPyExc_KeyErrorPyErr_FormatPyInit_unicodedataPyType_TypePyModule_Create2PyModule_AddStringConstantPyModule_AddObject_PyObject_NewPyCapsule_NewPyObject_FreePyObject_GenericGetAttr_edata__bss_start_endGLIBC_2.4GLIBC_2.3.4GLIBC_2.2.5vii
�ti	�ui	�Ј0Ph؈0h�0�0�0�R�0pV �0m(�0�m0�0�m8�0�m@�0�mH�0�mP�0nX�0n`�0nh�0np�0"nx�0+n��06n��0>n��0Hn��0Qn��0Yn��0oȉ0'oЉ0m؉0o�00o�0o�0�n��0	o�0o�0wo�0o�0o �0o(�0Io0�0�n8�0�n@�01oH�0oP�04oX�0o`�0oh�0$op�0 ox�0wo��0#o��0Jo��0�n��0ao��0&o��0)o��0,o��0/o��03oȊ0mЊ06o؊09o�0Co�0<o�0?o��0Bo�0^o�0Eo�0�m�0Ho �0Lo(�0Oo0�0Qo8�0To@�0�nH�0WoP�04oX�0Mo`�0Zoh�0$op�0Uox�0]o��0`o��0co��0ao��0�n��0,oȋ0fo�0Co��0�m�0Oo(�0�n@�0MoX�0Uo�0}m@�0�lH�01X�0�x`�0�lh�0~2x�0�w��0Tl��0�/��0�v��0�l��0�N��0v��0�lȘ0�Pؘ0@u�0Jl�0G.��0�t�0Al�0-�0�s �0l(�0w)8�0@s@�0.lH�0�*X�0�r`�0gmh�0�;x�0�q��0,m��0 j��0�p��0�l��0�3��0 p��0lmș0�Xؙ0�o(�0�m0�0�y@�0@�0x�0�m��0�m��0�mؚ0�m�0bn�0en�0hn�0kn �0nn(�0qn0�0tn8�0wn@�0znH�0}nP�0�nX�0�n`�0�nh�0�np�0�nx�0�n��0�n��0bn��0�n��0�n��0�n��0�n��0�n��0�n��0�nț0�nЛ0�n؛0�n�0�n�0�n�0�n�0m�0�n�0�n�0�n �0�n(�0�n0�0�n8�0�n@�0�nH�0�nP�0�nX�0�n`�0�nh�0�np�0�nx�0�n��0$o��0ao��0�n��0�n��0�n��0�n��0�n��0�n�0�n�0Uo�0o��0o�0'o�0�n8�0io�0@�0�0�0��0��0��02��0��0��0.��0��0ȏ0Џ0؏0�03�0/�0(P�0$��0x�0��0��0��0��0��0��0	��0
��0��0
Ȏ0Ў0؎0�0�0�0��0�0�0�0�0 �0(�0 0�0!8�0"@�0#H�0%P�0&X�0'`�0)h�0*p�0+x�0,��0-��H��H��k0H��t��H����5Rj0�%Sj0��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!���������%-h0D���%%h0D���%h0D���%h0D���%
h0D���%h0D���%�g0D���%�g0D���%�g0D���%�g0D���%�g0D���%�g0D���%�g0D���%�g0D���%�g0D���%�g0D���%�g0D���%�g0D���%�g0D���%�g0D���%�g0D���%�g0D���%}g0D���%ug0D���%mg0D���%eg0D���%]g0D���%Ug0D���%Mg0D���%Eg0D���%=g0D���%5g0D���%-g0D���%%g0DH��ø�CøWMø�zøjø3_�H�oH�@�����t����@��@��@��u@F�t
��@H�o0��?F�t��A�����@1��@AWMc�H��`0I��AVI��AUI��ATN�$�U1�SH��������L$I�4$H��1�H���H��H�Y�A9}Hc�L���\�����uA�A�m��I��9l$u�A�?�uA�H��[]A\A]A^A_���USH��APH�F���u"H��H�gBH�5tBH�=vB����
�~ H��y	H�{t��H���e�����t����C ���ƒ��� ��u��tL�CH�@t
L�C0�L�CHA�8�8��u��tH�{H�@t
H�{0�H�{H�?���tH�sH�@t
H�s0�H�sH�>1Ɂ���w+A��L�2n��A����H�"iG�JA��A�B�XHk�Hfe0�ZH��t(H�5�r0H9uu�U�xt@�h@���t@���1�H�=�d0H�<�Y[]����Z1�[]���AWAVAUATUSH��H��(dH�%(H��$1�H�F���u$H��H��@H�5AH�=A�7���1���~ H��y	H�{t����H������1���t���C ���ƒ��� ��u��tL�CH�@t
L�C0�L�CHE� �:��u��tH�{H�@t
H�{0�H�{HD�'���tH�sH�@t
H�s0�H�sHD�&H��t*L�
aq0L9MuD��U�xuH�=9A����E1�A����w.D��L��=A����L�5z�
H�E�A��E�Mc�G�,nIc�L�=��I��1�A�,�H��\0L�t$��@��D���H�4�L$L��H���L��H��J�!�H���a���D�D$E�A)�E��~NH��t�D H���M��1�Lc�H)�L��L�L$C��H��?�)���H�|$1�L���H��H�\��H��L���8���H��$dH3<%(t���H��([]A\A]A^A_���USH��APH�F���u"H��H��>H�5�>H�=?������~ H��y	H�{t��H��������t����C ���ƒ��� ��u��tL�CH�@t
L�C0�L�CHA�8�8��u��tH�{H�@t
H�{0�H�{H�?���tH�sH�@t
H�s0�H�sH�>1Ɂ���w+A��L��j��A����H��eG�JA��A�B�XHk�H�a0�ZH��t(H�5o0H9uu�U�xt@�h@���t@���1�YHc�[]����Z1�[]���USH��APH�F���u"H��H��=H�5�=H�=�=������~ H��y	H�{t��H�������t����C ���ƒ��� ��u��tL�CH�@t
L�C0�L�CHA�8�8��u��tH�{H�@t
H�{0�H�{H�?���tH�sH�@t
H�s0�H�sH�>1Ɂ���w+A��L�bi��A����H�RdG�JA��A�B�XHk�H�`0�ZH��tH�5�m0H9uu�U��xD�YHc�[]�F���Z1�[]���H�B�AVI��AUI��ATI��USH��wI�H�Q���u!�?��L��H�=�<�����u��:�y yI�H�yt1�H���F�����t��H�	<H�5^<H�=O<�F���1����A �ƉÃ��� @��u��tL�IH�@t
L�I0�L�IHA�)�:@��u��tL�AH�@t
L�A0�L�AHA�(���tH�yH�@t
H�y0�H�yH�/1�I��~I�^M��tHH�
�l0I9Mu;��A�U�xuH��u?L��^0H�5�;I�;�2����9D�PA���t�A*�����w���f.�Hz	t��H��
[]A\A]A^����H��[]A\A]A^���H�B�AVI��AUI��ATI��USH��wI�H�Q���u!�?��L��H�=;;������u��:�y yI�H�yt1�H�������t��H��:H�5�:H�=�:���1����A �ƉÃ��� @��u��tL�IH�@t
L�I0�L�IHA�)�:@��u��tL�AH�@t
L�A0�L�AHA�(���tH�yH�@t
H�y0�H�yH�/1�I��~I�^M��t@H�
k0I9Mu3��A�U�xuH��u3L�T]0H�5D:I�:����-�x@���u������Hc�H��x��H��
[]A\A]A^�N���H��[]A\A]A^���H�B�ATI��UH��SH��wI�$H�Q���u!�@��H��H�=�9���u��;�y y
I�$H�yt1�H���M�����t��H�9H�5e9H�=�9�M���1���A �ƉÃ��� @��u��tL�IH�@t
L�I0�L�IHA�9�:@��u��tL�AH�@t
L�A0�L�AHA�8���tH�yH�@t
H�y0�H�yH�?1�H��~I�\$��Hc�H��y"H��uH�
�[0H�5�8H�9�I��H��	[]A\�	�H��[]A\���AVI��AUATUSH��H��u,H�H�A���u;H��8H�5g8H�=�8�O��1H�ֹ�H�=�8�D��u���y xH�����u1��}H�KL�+H�Q���u!H�Q8H�5N8H�=58���1��H�y yH�[�{ x�H�����u��H�����t�H�{uH�&[0H��H�5f0L���O��u`H�5�e0L���<�A�ą�uTH�5�e0L��1��$��uJH�5ye0L�����u2H�
yZ0H�5�7H�9���1��1�A���A�E1���D��H��L���3��uTE��H�5TL����H��HD�H���I��H�������H��H�����I�A��uL���8�E��u
H�,Z0���t�H�Z0H���[]A\A]A^�1��H�vH�H��H�t$�R�H�t$��u\H�~u8�F �‰����� ����������t:H�~H�@tH�~0�?��H��H��5H�5�5H�=�6�
�H��1�[]�H�~H��H�n0�[H�nH�RE1��H��H�t$��H�t$����H�~���F �‰����� ���X��u��tL�FH�@tL�F0A�8�SL�FH���thH�nH�@tH�n0�}�����.E1��O����1���1��H�vH�H��H��4H�5�4H�=�5�!�H��1�[]�H�nH랍�������������L$���t$�P�x���t$�L$�D���A����mD����A����YH���L�be0L9W�n똃��4A��H�
5H��1��H�����D��A�L��A���ƉЙ��A��D���A�Ճ���Hc�H�{�CI��Lk�fomA1�H�qQ0N�<L���U�L��L��Mc�I��Mk����N�dL��H��I�|	��,�L��L��Ic�H��Lk����J�\+H��H�|�H����L��H��I�����H��A�D��+H���F��E�$��A����D�s�A���vD�S�E1�1�M9��G�\
��E�{�A��	��B�D�I����L�t$$I�mE1��$H��H�T$ �L���D$ �����D$�����D$�����~�HcL$$H�T$L��A�H͹H���[�Hc|$$H�T$L��A��H�H���8�LcD$$�T$ �$I����D�L$A�����D�T$A�����M)�I9���k��D�Dk�G��*�E�$�L�=¬�C�4�A�4$��������v\��������QvN������֦v@D��Y��A��4v0���H�����v"D���G��A���v��P1����?��A�$��A�s�@����B�D��m�����1���/Hk�H�
�@�Hc1H�t1���/H��T0H�572H�:���1��/UE1��SH��H��dH�%(H��$1�H��H�����u"H��uH�;T0H�52H�8���H��H����H��H��$dH3%(H��t��H��[]���H�B�ATI��UH��SH��H��wI�$H�Q���u$�F��H��H�=�1����u����y y
I�$H�yt2�H���2���t��H��/H�5G0H�=K1�/���A �Ɖƒ��� @��u��tL�IH�@t
L�I0�L�IHA�1�:@��u��tL�AH�@t
L�A0�L�AHA�0���tH�yH�@t
H�y0�H�yH�71�H��~I�T$[H��]A\�d���[1�]A\�L9��
&����E�T�A��`��A��u@��@����Ek�H�x���LE�T�C����k����I9�~A�\�D��X�A��w��H�x�L�QA��H���%L�T$L�$�WE1��"I�˸WMMc�L��B�D�@E���2"L9���A�tUf��`vf��u@���H����5�S0H��S0���,%E��L�I�\$L�����Lc�A9�JH�P����$���)E�\U��)H�sD;T$�N'H��Q0�2��tv9��S'�%H�T$ H��H9D�u��P'A�|�������$1��%E�TUG����Ak����I9�����A�\}��X�f������������&L����I�˸�z����M����A�I���L�N��A�������B����I���A��aB�D����� M�uB�|M�z�� L���)����M�|$�1�A��L��H���N��u.I��9#L��H�^-E1�H�5X-H�=.����#H��$�dH3%(��H��L��H��1�[]A\A]A^A_�W
H�5�Z0H���h���u}H�5�Z0H���U�����1�A��L��H�������H��$�dH3%(�te��H�ֹ�H�=X-�G�����E1��O"1�1�A�L��H���B��u	I��-"H��$�dH3%(u�1�H��L��H��[]A\A]A^A_�4��H�
O0H�5(,E1�H�9�W���!I���!H�������i���I�$�VH��H��+E1�H�5�+H�=�,�o��!I�OH�I�˸�C�b����3_�X���M��H�����I�˸3_�@���H��I���G��b��E!I�˸j����M�gHL�d$��n!�8�E1��!H���������,H������I�/��E1��� B�<�������#1��
$M�oH�c����B�\�A��t]A��t}F��B��F�D�I��x����B�!�Ӄ���E�[A��A�C�4AHk�A�T=��tJ8�vF��u�B�\!B�<!B�!B�|!�L��E1����7 B�\aB�4afB�afB�ta�{�����t(��t`F�$�E1�A����vIk�M�gE�D5�O#F�$D��A����A�C��D�E�Y�̃�tB��1������C����%���F�$Q�B�a����f��������p���H������H�5�����H�=j��H��H��ff.�������(�w��h��,���t�t%1�����_����������1����I��։�H��tH��Y0H9Gu��A��L���$D��AWAVAUI��ATUSH��H���T$<dH�%(H��$�1�H�FH��H�D$ H�H�D$H��
�.H��������H9l$�
L�D$J�<���H�D$H�����C ����A��A��D�L$8� ��L�[HL�\$0�@��H�T$1�E1�L��L;|$ ��I���|$8�d�|$8�H�|$0B�t��t$@L�5uX0�D$L�|$(I��D�L$H�$A�Y�Lc�F�l�@H����E��T��A���+��M����M9w��D��A�W ����A����wTM9wu
D��A�W�xtAD��H�
J$E���A��H�59�
�L�%n���D�D�FG��L��E��A��uDL�L$H�$E�,�H��H������L��L�|$(����A����v��ˋ\$H�$B�D�@��E��t�|$<t�E�ʼn�B�L���Hcʃ�H�A�4��t�@A��u�D�H�$�D��A�A�LH�L$�H�4$L��A��D��L�]����A�����ЙA��H�V�aB�D���tH��B�|H���+����\$�[���L������H�D$
L�T$H��
H�|$H�$J�4��#�H��tH�D$�>���L�t$0C�t�����H�|$H�$�������H�4$H��$�dH3%(H���%H�Ĩ[]A\A]A^A_�L�l$0C�t=����L�t$H��L���}�L��H�$�Q��H�4$H��t��F A��A��A��A��� �	L�NH�@����������E�)D��H�QA����L�L�j��B�*A�KLk�H�-HH0A�L�-�KL�=�PF�D%L9v������t[��uFC�q�ڃ���A�W��D�C�D]Lk�B�D%����A8����uE��uRI��A���C������v�1���C�1�E�)A�����2���1��S���E�)�"���L�N0����L�NH���I�N��������E�D�A����A����E��E��E�\�H��x6�������A��E1�����Ik��T��t8�r��������C��E1ہ�����Mk�B�D%�����z��L�c0L�d$0�O���L�SHL�T$0�A����i��1����H��������H9�'H�w
H�t$���E�D	A�	E�	A�\	�-���H�L$ H�L$���E�DIE�$IfE�IfE�dI����A�	A�Ѓ�A��G�GA��A�G�d]����A�I��C�1�ȃ���E�GA��A�G�\E����C�q��f.���AWAVAUATUSH���dH�%(H��$�1����H���H���@ ���A��A��� �bL�uH�@�MH��������H�]H9���H�<�����I��H����E1�1�L��E1�H9���E1�H�|$0Ic�E9��(A���A����A�4F���H�x���pE1�H�bF0�E�AA�A9�shA��D��L��A�	��t9�v�A�4�H��H����x��H�muH�����1�H��$�dH3%(H���H���[]A\A]A^A_�A��E�II��A)�I��G�
H�L$(A���t�I�<��D$$L���7H�T$L�D$H�l$H9�uH�T$H�L$H�l$H��H������A���aA���@A�N��L�
�L�����H�-�GE�qA��A�B�lEHk�1�H5�C0�|$$�v��A��L�
�C0O��A�8����9���E�HA�A9�s
�����3��E�@)�Dƒ����Ak�>L�
�l��Ճ���Lc�C�<A��Hc�A�<���tWL�T$(A�uMc�E1ɉt$ A�:J�L�0�A��E��J�,��U��tq9�rmD�UA�D9�w�D�U)�A�A���tPD�l$ ���������t$$H������������9t$$}�����A�����������1�����A����H�T$H�L$H�l$D�l$ �f���H9������A����E��L��E����A���`���k�H�HD�k����H9�~ G�TE��X�A��wE��Y�D�H�HA�4�H�����A�4����A�4H�x����I��J9D������A��Mc�J�L�0H�L�0H�H���E�~L�?E����fA�������k�H�HB����k����H9��w���G�LE��X�fA���_���E��A���H���H9�u
L��������H�muH��H�T$�M��H�T$L������H����L�u0���L�uH���@��USH��H�F����[��F H�������H�~�A��‰����� �����������C��@�	��~HH�-dIL�]DH��@0��A����A��D�DuA��E�G�BK�[H�B�)H��tXL��M0L9CuKH�CH�p�H9��QH�= L����47��D�L�
��E�1I��C�L�����L��?0I�<�H��[]���f.������L�N0H��H�@IE��>��L��H������H�CE�rA��A�F�ZH�-�?0K�@L�DMA�(H��t�L�
�L0L9K�t���H�CH���H9�u~�����i���L�?����E�2A��A�H�=��B�H��H���H��H������������������H�nH�@����}�����$��������f���USH��H�F����'��F H�����r�H�~�
��‰����� ���������������@����~HH�-DGL�=BH��>0��A����A��D�DuA��E�G�BK�[H�B�iH��tbL��K0L9CuUH�CH�O�H9��7H�=�L�؊�47��D�L�
g�A�1H��LЀx�,�������L�>0I�<�H��[]���ff.�@����H�~0H��H�@HE��>��L�
^F������H�OAE�qA��A�F�RH�-�=0K�[L�\MA�kH���{���L��J0L9C�j���H�CH�d�H9�uP�����u���L�
����E�1A��A�H�=q�B�H��H���HЀx�����*�����ff.��������qAWH��AVAUATUSH��H��E���y�H���D��T��A���+�:D����A������D�����A���Q�x�D����A��֦�d�D��Y��A��4�P����H��=��?����G������-���P1����?����L������E�hA��A�H�5�
B�,����*1�L��JL��SL�
L�Lc�D�]C�(A��A���xMc�A��C�D�]D��\9���H�Hc�D�gE�4��+ M�E�>E����D9���Ic�I�n�wD�<A�F����9���Lc�I�nD�oB�;A�F���sD9��fD��H��Mc�H��A�uB�3�B����9��=Hc�H�jE�e�3�B���/D9��Mc�H�jE�}B�3�B���GD9���A�uMc�H�jB�+�B��x89����WHc�H��DH��9���H������E��y�9�����Lc�~B�#�}�txD���q���H�E�4�M�E�>E��x@��~nD�;A�FI�n������tU�CA�FI�n��xY��t@H��A�����E1�D9�~*A��Ic�A�|$D�<3A�>�u��H��[]A\A]A^A_�1���D���M���D���E�����;���H��F0H9W��D��T��A���+�����D���	�������1�������AWAVAUI��H�5}ATI��USHcںH��8H�<$L��D�D$dH�%(H�D$(1��������s��H�5FL��������������H�590A�E�,��tU�S�I�MI�|ff.�L�DmD�	I��I)�B�,L�I��A�����I��H��L1Ձ��H9�u‰l$��L�=�D��G�4�L��E���H�<$��L��D������tn�|$uE����A�����E���A����d�E�4$�H�\$(dH3%(��H��8[]A\A]A^A_ÐH��H9��#����\���D�t$D����A1�A�����B�D5��A�<�H�ͅ�tU���|$H�<$��L�����tD�|$D�l$uA�����v"E���A����f�E�,$��G���1��@���E�A����v�A��-�y���H�<$��L��� ���t�A�� �������D��AWAVAUATI��UH��SH��dH�%(H��$�1�H����I�$H�C����q�{ ���M�|$I�W�����A� ���I���
H�5�A0H����������H�5OA0H��������(�H����
H�5�C0H9u��
I�H�|$H��
�{
H�H�<$I��������L9,$���L�4$J�<��v��H��H���}�A�G � �]�I�_0I�WH�@HD�H�\$H�|$����L�<$E1�E1Ƀ��D$I���|$H�t$���|$��B�\N��\$@A�M��E�`�I���.��T�����+�1�H�����H�5�B0H9u���H�E H�=��H9�������M��8��h�����t���������H�EL�	�L9�����H�=�������H�(�D�7H�=|�A��A�F�I��B�|t4L�]A�<3���H�5L�
H���D�~B��L�����I��B��I��E���GA�D$�E��M��H�E�`��\�@I������H�$
H�$H��I��
H�L$ H�4�D�D$0L�L$(���H�L$ H��I���]���T��L�L$(D�D$0���+�)�H�����H�53A0H9u�i�H�E H�=.�H9��q
����������_��f������D�����3H9u�l�H�EL���L9��Y
��H�8������L����<H�
����A�:H��H�L�ـx�����A��H����A����B�<���k�����h��j���t��]�������_�������������Y�A�zD�h�Ic�F�/Mc�F��D�\�@E���|D�X�Mc�A�XF�Mc�F��F�T�@E���XD�h�Hc�E�PF�/Mc�F��D�\�@E���4D�h�Mc�E�XB�/Hcۋ�B�\�@E���D�h�Mc�E�PB�/Hcۋ�B�\�@E����D�h�Mc�E�XB�/Hcۋ�B�\�@E����D�h�Mc�E�PB�/Hcۋ�B�\�@E����D�h�Mc�E�XB�/Hcۋ�B�\�@E����D�h�Mc�E�PB�/Hcۋ�B�\�@E���bD�h�Mc�E�X	B�/Hcۋ�B�\�@E���?D�h�Mc�E�P
B�/Hcۋ�B�\�@E���D�h�Mc�E�XB�/Hcۋ�B�\�@E����D�h�Mc�E�PB�/Hcۋ�B�\�@E����D�h�Mc�E�X
B�/Hcۋ�B�\�@E����D�h�Mc�E�PB�/Hcۋ�B�\�@E����D�h�Mc�E�XA�\=Hcۋ�B�\�@E��tpD�h�Mc�E�PA�\=Hcۋ�B�\�@E��tPD�h�Mc�E�XA�\=Hcۋ�B�\�@E��t0D�h�Mc�A��D�Hc�D��F�T�@E��tD�Mc�Hc���B�T�@A�E�������L9L$�_����L��H��H�$����H�<$I�����M����A�G A�Ɖ�A��A��A��� ���M�o0I�OH�@IE̓�������D�E��L�S8A��A��H�D3G�`A��E�F�[M�gI����Ic�L�-{/0A�L�
3H�vL�8E�DU���	�����B�QH�ރ�H��0H��7A�s���A�AH�4[A�Du��@��A8���@�u	E����I��A��M9��A�G ������� �̓�@�����M�o0M�wH�@MD�I��������M9��S�J�<��
��I��H���:�D��.0�
�/01�D�\$M���	H�T$@1�L�|$E1�H�T$ 1�I��A��H�\$@L��I��E����H�P��� ���ZE�\U�E���A�������5/0H�x/0��t7A9�r2B�<>A9�vDE1��
�A�z�A9�v5E�QM��N��A�2��tA9�s�L�IE��M��L9�}LL��H���d���I��E��A)�A�rA�D�L$(A���t�I��H�\$8D�L9���L�QH��L9�����L�|$L��L9��zL�����H��$�dH3%(L����H��[]A\A]A^A_�E1�����B�\��\$@���E�\��5y.0H�r.0���-���D9��$���F�>E9����L�M.0�)����D�����D�D$0H���D$H�$����������A�|]A��L�A5A��A��A��H�/0C�4Z��D��rL�y,0�t$L�RG�TZ����L�
|,0A�1����9���D�\$E�3A9��o�5Y,0����9����F,0�9����5:,0����9��yD�&,0A�A9��M�5,0���W9��OD�
,0A�A9����+0���-��9��#D��+0D�9�����rL�
�+0M��H��A�1����9���E�YA�A9�r�)�A�Q��փ����DkL$(>H��TD�A���A��Ic�D�zH�=^+B�4�Lc�F��E����L�T$8HcT$0A��E�
D�H�\�@E��tbD��E9�rZE�E9��e1��wL��H��A�2��t;A9�r6A�R�A9�w�E�ZA)�C�<�|$(��tD�D$0H�sH��L9�����H�$��E��t�H�sD�T$��H9��G��E1�A��H��Ic�L�\�@N�\�@���B�<������A�C���A�YHk�A�D5A8�@�D���@�u	E����A��I��M9���������I�/uL������H��L������L��I���]����`���L�
�)0�a���A�|����L�
�)0�J���L�
�)0�>���L�
�)0�2���L�
�)0�&���E��������L��*0���I��L�\$8��D�D$0L�L$(H�t$ ��H�t$ L�L$(��D�D$0L�\$8��������I��D�D$(��L�L$ L�\$0��H�L$0D�D$(L�L$ ���D�A�����4����Z��B�\�����E�\��E���A����������I��������L�L$M9����M�Y
L�$�g�I��1������L������%�I��	���������������>�����M�b����f.�DH�=70H�70H9�tH��'0H��t	�����H�=�60H�5�60H)�H��H��H��?H�H�tH��'0H��t��fD�����=�60u+UH�=�'0H��tH�=� 0����d����}60]������w����AVAUATUS�˅�t���t��G �A��A��A��� ��H�oH�@�)����H�w1�E1���E1�L�-�*L�%�/L9�~wI��A�����A����F�tM�E��A��A��G�DA��G�40C�|uLk�L�5�&0G�DE��tE8�rLk�C�|���^�����uE��뉸[]A\A]A^��_���ATA�Lc�USH��H��dH�%(H��$1�H��H���V���t[E��~LL�V&0��$A�9�u^L�SA�|$�L�ML��@A�2A�I��I��E�0A9�u.I9�u�1�B�<$��H��$dH3%(uH��[]A\�1����o���ff.�@��UH��H��H�5�SH��(dH�%(H�D$1�H�L$H�T$�J������b��H�T$H�\$H���y��H�L$A�H��H�������t1�|$����=��'���Ǽ��H�\$dH3%(u&H��([]�H�=�$0H��H�5p1�H�?����1���蜼��ff.����S��H�=�.0H��H��$0H�20�ȼ��H��H����H�KH�5KH���&���H��H��10H�5*H��10���H�=�10�\���H��tDH����H�5i��H��H�t$�~D$H�
H�5H�T$H��H�HD$@蓺��1�H�5�H�=C0�^���H��tH��H�5�H���g���H��H��[���H��H���a unicode characterargumenteast_asian_widthdecomposition%04Xmirroredcombiningnumericargument 1not a numeric characternot a decimalnot a digitis_normalizedstrargument 2invalid normalization formcategorybidirectionalCJK UNIFIED IDEOGRAPH-%XHANGUL SYLLABLE CJK UNIFIED IDEOGRAPH-s#:lookupname too longundefined character name '%s'no such namenormalize12.1.0unidata_version3.2.0ucd_3_2_0unicodedata.ucnhash_CAPIunicodedataNFKDNFDNFKCNFC<noBreak><compat><super><fraction><sub><font><circle><wide><vertical><square><isolated><final><initial><medial><small><narrow>CnLuLlLtMnMcMeNdNlNoZsZlZpCcCfCsCoLmLoPcPdPsPePiPfPoSmScSkSoLRELRORALRLERLOPDFENESETANCSNSMBNWSONLRIRLIFSIPDIWNaGGYAYAEGSDDNJYEONHYEBBWALGSSWAELMOELBYOLSJJLTWEOLPKWELHWIYUEUBSYINGunicodedata.UCDnormalize($self, form, unistr, /)
--

Return the normal form 'form' for the Unicode string unistr.

Valid values for form are 'NFC', 'NFKC', 'NFD', and 'NFKD'.is_normalized($self, form, unistr, /)
--

Return whether the Unicode string unistr is in the normal form 'form'.

Valid values for form are 'NFC', 'NFKC', 'NFD', and 'NFKD'.lookup($self, name, /)
--

Look up character by name.

If a character with the given name is found, return the
corresponding character.  If not found, KeyError is raised.name($self, chr, default=<unrepresentable>, /)
--

Returns the name assigned to the character chr as a string.

If no name is defined, default is returned, or, if not given,
ValueError is raised.decomposition($self, chr, /)
--

Returns the character decomposition mapping assigned to the character chr as string.

An empty string is returned in case no such mapping is defined.east_asian_width($self, chr, /)
--

Returns the east asian width assigned to the character chr as string.mirrored($self, chr, /)
--

Returns the mirrored property assigned to the character chr as integer.

Returns 1 if the character has been identified as a "mirrored"
character in bidirectional text, 0 otherwise.combining($self, chr, /)
--

Returns the canonical combining class assigned to the character chr as integer.

Returns 0 if no combining class is defined.bidirectional($self, chr, /)
--

Returns the bidirectional class assigned to the character chr as string.

If no such value is defined, an empty string is returned.category($self, chr, /)
--

Returns the general category assigned to the character chr as string.numeric($self, chr, default=<unrepresentable>, /)
--

Converts a Unicode character into its equivalent numeric value.

Returns the numeric value assigned to the character chr as float.
If no such value is defined, default is returned, or, if not given,
ValueError is raised.digit($self, chr, default=<unrepresentable>, /)
--

Converts a Unicode character into its equivalent digit value.

Returns the digit value assigned to the character chr as integer.
If no such value is defined, default is returned, or, if not given,
ValueError is raised.decimal($self, chr, default=<unrepresentable>, /)
--

Converts a Unicode character into its equivalent decimal value.

Returns the decimal value assigned to the character chr as integer.
If no such value is defined, default is returned, or, if not given,
ValueError is raised.This module provides access to the Unicode Character Database which
defines character properties for all Unicode characters. The data in
this database is based on the UnicodeData.txt file version
12.1.0 which is publicly available from ftp://ftp.unicode.org/.

The module uses the same names and symbols as defined by the
UnicodeData File Format 12.1.0.#�� *�� 0�� 1�� 2�� 3�� 4�� 5�� 6�� 7�� 8�� 9�� E)e)�)�)�)�)����*+in`gO)o)�)�)�)�)S)s)jkii././JjLlMmRrrsrsjkjk�TT��YYZZ&'&H&I&�&�&�&�&�F��	�	�	��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������

 �
�

 �
�
�

 �����������������������������������������������������������������������������������K0�0M0�0O0�0Q0�0S0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�1�0����n"`"o"����&�����
�
�������(�  �"$"&$(*���(*,0���
�.,40�2649=6;<:>@B�C�DGFEJH����LN.��P����TVTXXZV^Z\``b^jdlbpn���hjl��np���rrvt|~��t�������v�2�x��y�{}������'�����	
�
�������)�!!�#%#'%)+����)+-���	�/-5�1�375:>7<=;?AC�D�EHGFKI����MO/��Q�
���UWUYY[W_[]aac_k�emcqo���ikm��oq���sswu}��u��������w�3�����z�|~�����������������.����L,N*�������������	����/����M-O+�������������PRQSdefgxyz{��������������������������01�����	�����()������89��HI������Y��hi���p�����r�t� !��v����01�x�@A��z����PQ�|�`a�����������������
�����������SP�Q���]�9�\��^�����Wvw����"#%$&���)	1	4	�	�	KHL����H�����J
L
K
�
�
�
�
&
;=@AC89\]hi����������������
�
�������"$&�#%'�������*,.�+-/�������246357:<>;=?BDCEJLKMRTVSUW[]_bdf�ceg�������jln�kmo��������������������!�!�!�!�!�!"	""$"&"A"D"G"I"m"b"p"q"t"u"x"y"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�0L0N0P0R0T0V0X0Z0\0^0`0b0e0g0i0p0q0s0t0v0w0y0z0|0}0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0���./KL�����	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������������������������������������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�����������������				







 ��������������������������������������������������������������������������������O	����������
  
   * + , - . / _ ` f g h i !H$I$z+|+����������	�
���
�����������"�"VnWnvnwn���	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�����������������������������������������������������������������������������������������������������������������!����Q�3 /�%��2O1|�]�����
������"��8&�#���
��"L
C���A�B�T�+��@��Rj&��@i�"/"�>�->
�"�9H
-I��"�T���rk0K.m����Q@o��5�SJ�-a���n"�)�j) �c�����
	����*I0�"��
H,���U+X����R"�L#U�t'�
ͫ��2
���~'� ������,� �
-�,p
kAk�
��T ��
��.,��
g����X%]��D�D��k�W"��
� ���	)�*�D���j$)�`
��R7�A,�.w�R���v���r��� +���Q��w�Nx��<��Ue�%$��Y'����\�JJ�i���'�$&�i_�$)a�Wp {��J�O�y����u�,��+����U��Q/�
�)���������'X"&khjK	=,	�2�H�A	��� `''�A�?	S�=G	|2,�1Jn�0����,��
���\2m�M���ML�#6���k��h�i�k2�Hh�2���:393n�.����;�EJ2�!F�h����.�M1"'%�hk=q���)�]��l%�����92�.���"g 8x�kiw�
�D����� ��s%�P'�8*\�(��0���!�!�k��?�F��#�2���+��jP"�����#��%����
<��#��*�������z�}��o�0q�1k�2m�3w�v�y�x�-r�./n��"Q�B��i�2D�����(�)�P��	-�r��1������.��!�f�U2{�R2����A�$P2q���N�p�%	��+�9-�M�Z-h,
�s���3�	 {��T0V0R0��P0Q0��-�_���Y0��y? �0��r�9���_��B��w����*"��M�r�.������z�q���
׈j2��e2��&j#�h��$���#���T��'�
�s��#@!S"#U26 ��.#
Q�;����	�38��M��#)h6�/yf� ���+ ���5�3�����o-����"'�����$�1�!��,F+V#��PA
�<	q.9x��)��*J
)F
?
}i���~��1O�1���B��0�]#��#3!U1��������1mkn$��%�.�1��������B�3#�! �A#�I�n�21j�*���
1(@#1"�����<��G
)*<+����d	�'��-��"Y�Q"'�>��#'5%��01������?��E������� ���"�)���$K(11�]���G(#1	k+�E*�,x���
11	��6
�6�%qho�{x�Y
�G�.��jC����2����$%2g�����	F�v#i"�F���
.��&f�&�i��!!:�*�	���`C$��ƫ���'��.��
8!���0����-E 0���#�M��T�8�.��&��5�j*4-5��%H«��wk/�22�3�$���!��_�g�8����8����0��� @\$74B�"�Z��8��.��`��	�0c���#�%��i

�s�'�������r%���$t��#$�}]�	�&^�:*��M�1,fi-�).�/x��0�1�1�1�*��1�$^!*�+��<�(�*1R�&����&<���
e	^�1���1��������G&��`�)���0��	~)�4 
\ ����'�DUk7��^}������+�%51W�W���&[��a��_������2�8 �N��%�4%@��.��$���'w)�' ���$�3%)����0����h�2�<���-2�M������N����W��>1
���	r*�j^1h�$9�+Td���*2��/�8 #k�@���1]�p�}0i
�����M��#�	���)	-��O2�+��3��������^0��S�Z0 V0
�X0\0=)�0r+���\#�
�:/�0�i%��
��0�!�
�0B�*�0 0�[��	�
��? 
��.1�S é_�C�
/9��0\�����*,�I7�;���lo�g?�k�$/���&G��	Q#���#�����T�����tO� �!��Х;�d+!S��������M����
��)�"�&>���!�����#����Pk�ؤ��$L!a0�$j!`�h0��1�� ��f0�k�_0(kl�Bj�p�"
Y0���1: �1�)�����[0����]0�^��1H�2U0��2wY�y1I�����0I�17#�0�0�0G;
�"�

�&�h�'�0�ߤ5#��t ��3��0��
�n+#U
	�0k,�B�(�0�/�1/�1�1��.��� �k%ߥlo��Z�w���%f��G�0�0�0� �0{�� ���Ov��0���$Uj�n�ֈT,�#���و��Ոt
%���,�����0`k�0!���#�0��~0_ w0�=#���-�[�"���,�!���,>�#������1�����2F�"���S0\[5*O0�iK0c�EM0�Q0�)��c�Z����h����#K&*��#��"����"�$)�[
���"q��h����!R
�g�%$�h� n
�-���k`}0i0�w0�/4�#q0��ݫ*��t0�$Lz0��7��.����W#��j����%��&h{#uE)�/k0��N2�il0yii�5&?m0A���j0U*
�)��#�c�b)�`aS�8�H�7�0 K�l&G�<�C I�1�+�&I�:�L,��ϥ�$b0e0���֢M {I�@��������g0K`0�7 y{�e�4'��'���-
�zh��'�	������%�����#�1v0�/(�:���y��������s0�	y0�!'	|0�M�!r�83�	*�A�(��.p0e18,:\����2oE��A�+1 n*������ A�^�ر{i�'u0%�3�	2r0\�$x0�{0��2��'+F�o0���%�^'��FR0�����T0B�N0�*�1��3*9i��/�LФ
"�!F��&�� �	��/ h
v���#����ajk��a����Ehc7MF)i���TM1��'��&�E-ڤ�1
�ը�+��*��F&*�������1�Z������
Zw��g7m�8��4!��� l��Q�.3)#
,�H��e�!|��~%�`�}�)�=�!?�@�9�:�;�<�5�6�7�]�1�2��$7C-I�c0E���n�B�C��V-�U (+9����L�[��������VoFC��!*֤h��m���g���e�d����g3�+d%�C�i�����G�=�8��0��-�&�(���-�H����p������'���:�٤�0<�< )�g��h�062�
v��� 9#�02-����]��ok_��m���,p��9-
�)8-^"f�>�(��"�$
��^-��������p����#���,/�	�P��
�&>2�Q�L�g	פ�h�a0������*���!�- *ZIhJ��0�K���0�0�#T�a#-�0�!���0V�/��m����D-�j���1	�no�2�eB���*�
��	�t�F<p�o�c�/��
����CG%�"H�M�+x��0�Q���e&mR��,��0��j����0�!�^�	Z���f���+��3S�H1�"���E�M	!�j/.p��3�)�����"[x!&���tD��e-�0V�
����W��J-�
3�(�^�;>�#��4��0�!��e+�i�]�]�	T�#R 1�o
��)�ew��iiiP�0�0��Q,�����y�����0r"'�03$�0�0����_�e��+`����&�V'c)g�%�f�J��+$QC�m�
)l{%�B$�>t$-E$�-�) R���07����/"5"��"�(^��7��� ��p�b�\��O'N��
�2"����
��>��h�0�B�0�+��03S���?(_(�
�0�0l�|���0�i0[-��+������������0����U-��� b2�0k��0�!����2�����2B�}	�! 
=��N�0�
�0�0�0���0�"�0a�GY�.~���0_-�29��2%3��0^��2%�0�0��)�1"�0�0�"�� �0O��0-(�(�"�2<
��"�D�2����R��"�'$6jѩ��(2/�0K3�4��02�	�2�!,4*a�2�0�2+0("��);
�0�=�7�-�0�0h�.��
++�!�i���0�+5�0�0��0Sz��Ѩ�3��2��(!-��S#z�*�.k�0j(	�0W|���05
r1�&����;�1�C'�1�1�&�/C��0C�(��B���24�o	�3
&�3�0�u��&�%��Jv!������0�2�2���&�1�1�2n2~�2�2�2�0�0.	�2�1�2�R�0�0�#��X���� ʩ	���'�!�0���0�	2	{�C�����.�2�2�2�2�#!�����2��2.�2�20	��2�2,�	�2j�(0�2�21&�O�2m$���-�-$G ,�2�@ �2w��&T��2('=o��]
�#�2�
<�
�2�2`�2<�2Kb�2�2�2�2	
�3�-v> �2�$R�3X	�2�0�2Sh� �2�"��2G�%�@"�2�s	&h��.>�*	��+�%�%�:
(���2jNi����)��������^	��f ��?�Բ޲��� �2�&�
�2ѲG��F���2��qp��!:�&��&{���Z�������n.M�j�Dz²������r���	��v����d��������.�0,������H���	LW0��<)�	d0	.&	���=�0�0�0�+�0�]��	�0�0�0���0e�
�� �0�/�0�0�"F��L�E��J�B�K�03�0�0I��0>�D��� Ey
EEK�)�D�D|9��D	!Eg,�0:�X�D9	#�0�0�0�0�3	���$�
��j�ƥ0������*� �V���h
j�	�2/��j�D.32���@a1�D(��D�D�� kt"B#)���!V�Du'�����������WEE%V��c2D#ޤ#�D��D�/B�	b��g&u"X�L���&)*���!�?�(�>.���3P��2��m��v#��"�$�%��	$C�~���263��"_�a�M�$��vͣ��Σ)��
�+�У|����;�����z��n/���2��}��3�"����u		<��:�?�+��)�*,	��&D��v�~2�i�������Z=f�P#���[7�8��!��D����3	�h�����o�3Z1�3��/r�0��'-?����$3m��,�	�2�2�6�(�2��@���b��2Z��qo�cc V##E
�2�E20E,��+E
!
����3�3�/%�3�'.��'�a���$�:����U6E�è
^�����',w%ECE
W!������&�..��a����+[1gor��D`1�D�Q1�(."��D
b1�V1�'��X�E$��ID^<o����$ӣ��`�'����������e'��������gNn0���?o��'h�%ѣ��r�)k��f��ԥ#��$�&��,���X1�Ij��_14
�^1�����j�(P�g�(��Y*�F�(��;�c��i�hB�h��#�)_
#!�'�L��&�#�e� �M�'���3������!�/i��g��)�B�$f�0~/��0,��n���3�O/W�0��:�֫�#���"j�%���{(���2��)��2�����h�]/���1�������"��X-d_��D���+��'��e�}�:�<�"�A������"����i�1�% L�,����h`��+�sA!�k�@d��m�[#z�/1@�����L4�)��$�('�"&!%$c
�0/.-1	,+*)"�j ��x�����#�F+���|��#���~�M��;��>�1��h6%]v	�54%+22�/��ۣ���$�#�ݣ5�N �ڣ��M��*<���������_2@�����	�"c�!����0��%�30,$'[/���.��q�Mh����:�����,�"h�A%�{�-
����!���-��������+W%�ԣk ٣գO2�ף
*ˣ� ���T�0�*�10���yh��������n�y7�'}��	2�/*_#�������0��.�1�������%M�3!	00	�)�zu�D���1/����ߦ!�0\/
7��0�	9�	������3h�)�1_��1y��1��
�1���1�0�$`����a3�,_��*��=#��
	����!9�0d$����<'3�K�9(\��	shV+���	�'�1��`+�%d���
/����#���fj,	2	n�(	)	*	+	'	[�n/	0	�2R��0P0)��%��1"	�&	o"9	���1	���*Y�~��!�!ۦ��7D��Ϧ������/ܦ�
������ͦ~�8�����/+�c/Hĩ� ��1��	�1Xi&�1Z?".��1��0E��= q"p�+���C�5	��1���	�1Z�)U�������SzoW/3+'*�J������o/4o�*�J��!�M� ��D#�-a��a"�q`�̦������
	P�~�����ݦDB�U��
D��K�����1(�K��	���	?%$	>�K�	��&�&ڦ�&���!$B��[	�&��9�7���6��~ >��	8	B���r	k	7�:�T�,�=�
	��Z3I/	��[���3�AM�W���L�e�����M�������	&�3!������"k�Y�	�
A��
���E�ʫ#��\�� lC"���$9�	�	Q' �ǣɣƣj��	���K��� �	�0����/�3�-Q�Q
���������O&�j�N�jh%k�$���R����.i�	���=�*��w@�0��i��z2Rix�(/
�B� o���X�o 0>��"�ܱL$;%9!�����Ա���s&iֱ9�+j(��hz$c��.,����
�3DZ��N�����D�0%�%?%�C�-�M\�"�R2t�4,,����%V���	R��P�k/�	
� �.>,1o���{���(����_e�;��	F��h23��
#* ��|��)�������.O�k��!�����M����I!�����"V$��LΨPic�\�ޣ~0v �!���k|���i���/��("��d3�����v��)?,��#3	3qئ;%�/h&�23W�r#����+�i����"J�"g��+��k�^����"������
���/��Q! ��=v�(��$��J�3"$�����
'0�|͢�
��di$���o�P��	��\k�)���������x�X����z���A0 k����6Rj��%�
kg 8\����%¨T�j�%�2gi 3�i������%��h`���,���	�;��O���*NFEh#w�B&�0D{ f#C^���p�B ��|���*?>=@:e#-<L2���	& i�"~#
R#�8�6���M�/����54������� �"]	�*
�.o8�f�&C��(*�":�'�Kf"�����%��(���������5U!�t���*2��+�"�.��%��~��+ԩ+;$SC)k�	k�-��b#{�hn�t�s���%��e�Z�����������
�"�
&��B"�8)���%++/�M�{C����!�v��2�9
m*�
	��xK�`�w"�2��|�s�~�m �,�����0�����������G�D�>����z/A%��d!|�[��`#�ڡ��M&�%r&�����y'��E�����M&f�x�
���%F����,3�W���"�����~F%�$� n�|+��!��&��0/+-�321�&�����k�,�!y�U'�|3�������!�����n���a���"��q+?#
����&%1*)('����Y#$�������I�����,Y#"3�,�����,����h"!/x�c�P�!k�m	��L������m������_�)��DL32�)��v�#��#4�	4i�u#4��t�_�s�z��
F4m������h��M��"`0��b�¦�&M����	`,2����+�/
�����!���"}%���'�hIM�q���c#_ܣ��֣��X��3������&�44 ������4	�%Vi��2����G���b\	)32��bK����0��3�3��3X�*�S�
��k��i+�X*�
���+��<.�#�.�
]o�#2����	��j
��
�g�F3F�"�$ ,^��'5$!#�'���$;ij�"l$�;��/x�h��?�1%L�-4�)���������������T#�2�-�2��2��<�;�*��2u�2�(�-�'�
?��>�!�/�X�8)V�£ba�
���r���Zis�h�u�m�!y�U�)�����N���>���2�2,���b"q����1����.���%W�J�dhX
Xi���V��X2*]����S�a�{*e�m�"HEB���}�N��#���"����-��n�l����}�$*�3��-11�����Ag�w"�S�5�3N�4�"A.�1j�j'j��w� �����&�-"�p�k1� -�"�h`!�.�!#4��#V��"0l �"T�U�R�S�P�Q�52�_��������!0G�D������t%��>�?�<�=��
u)���H�{
�y"h���������������"������(2��]*���g�5" o�+ 
�O���`��F���̥�*�����'�F,��)��!�)u$��I��������N�n+	���#z���]��� 5����4��I����|�("P��"�i�&���
,�[�PE�*��g#
��41�	i�$�)2�2FEm�IE�,u��V6�����i��'C��
�����)�����"m|�K������,,%��i,��a��(r#B1��5�]h��i�i����!}�P%�2U�S2�*!)��z#��)�M�%|	���f��D�z��h!^�ik�`��/W���"�
�R�#J�
�$x� O2C&C�O��-L�E�1�,i��	O�D�����!����y�Q#'�/�!i%g
Q�	���+��z,�7	y��$	�-���P{���3�}���(`������$tak�-���.iu&z�+y�3��~���)�-�1qw�o�h��)��$��$��7 �3x�
"E
��hWg��QĠ�$�{$�*����,%'z�A��0�(.�1"���p$�zU�!�V-I%���
h$��8/���]��$����!�6��v(�
�/Z��_���
;�"�!���^��,��[((�-�"�M�;(���\Tk#���6+�2�22;�$�j��u���cT3V�D���%|/B�+�(�36M�}0��w�O�r���&����� J�9Zsi����>�6 !�u���=~5i�O���?�M�3�	6�d<� �}�L�u������o	�%]�
���u�n�:����l��R�!�#�<#�0L�% ��,xD�H2�$/M3/���o1f/kc��fkd�e�[�!:�{D�|D$}�
k���3�%,�� � � � � � c
� � e
� L�Vz\�� � � |,bR+)8��$����N#�&�[�L�.�!D����$Ch�D�D�Dr�q���2���[|�k���x�-4:��z`'pDg1B_���!����$�"�o�-�C3D30�B3���#>3��'�4�5�3�ĥ�S�2��1�4
��Q3R3{� ���$}j�'�%@24�	�t)���i�����)��[h����M3N3�3K3�%I3�*�&X3Y3U3V3I(@�(^3|�\3]3�"[3^)�!
�6�!�*�+�,U�	#"C+���!
��;����3/3_3`3u�U�E5��EV�3B �En�7�[2/Y2X2%)�
]2\2��	��G�?$)>${���	2 ���	>uo�0n1k�	":h�"���-*�#4������k��(F���<hդi�e,v��0��
��13���3}�y�C�B�A����� :�JV2,�F��������"
FF�iZ�Y�X�W�V�U�~�S�R�Q�P���;,M�L�K��I�H�G��E��MV��[}��	[�}�^�� �1�1�E��
�0w#�-#��	�"� ^#f�7#
�������=P/�!<"���������������
''_�&�����<�&�3�E~W+\+�E�E�'�	�E$��M�E�>��&�E�E�	� o��)n&��F%�F�!���F��Fr��,������	�*��	�%�*�{,����
�3�"T*-%��`��%e���i�mg��2�E��
0�E��,(�i��"�!�E|����+,��������X������������U	�I#����'
�[�	��f��!��@
�������$�04�.
�v����2� �iU��Z�������!����~�(�
�����������������������s#�������������*��+��'�z��a�^,�9+�
>��������ek�7��$i��l���!2%�"�j&���g����*r�x
j/(#0m�h�h�ݤ�4x����	t�+x����(�	 �kj%�X+KD9)�E $p'�o�	�0'�n2/u(J��l!�%T%�j�%�i1�)4~�&�#$4W��	�	Q����M*�������H��J����S,$�����%0R�		.f����()�&����D�	��*���i0���
Q��*�&p��
��'�/����S�&Y��	#$4bh4�P;B�H�����������h�!�	�.�i�� �u�s{���$��4
�[����\���.��Ra}�<���t٥����\e����ŠA�����h��6�2-��[!^���E��	
v�Z�u���_�� C�>�����
[�;N�;��������(F((�&((��� ���J(*(�(�((����k:�+�
.�0�
�2��/J��),/���T('��	$=��#<�:�	v<�sV�A��E�2(R(���L�9�FH�������������(k)�Y���)��4'�v�5%���	.�
T����i�k�Q���
9�6��4����%�$�+�T/���X#�������O!��]��=/���23�b6_���!����|�����Z��֡[��Z��"+3�#�b,̡)�$���%5�С^ɡ�F/n���2���=�8i��df)y�7h�MM\�N�9�^����!�#�i(�'��3Z�V
_ڠ3I1֠LK��Ϡf	�%��ܡy$s��.�E,/��M�#�u1S�H1�P!*�(�7������`�1��#;�4�.�v��+2�G�K�@�*�s��R"\�>���/���$�{�	0�~����	��������"�r1F�	�n���l�T4�
.�m#�����jo�k�
 �������,w��F#K����t2����
����¢���� 1̢Ƣ�i�
�&�	�3D6�����!�A'�,p�]��0��v%��+���
�%Eh5��.j!�2�������[+	���������=.P��{�=u���~�C�D���A�:�=�2?�!.��	�<";��� "��1_k�����]:	,����,D�3���"&I/���������'���	��,��t�R��/�^�����K��+V���/c*#�i$��.83;363734353�33 �!<3=3"�2"YI#	S#	(� C"��:Ǡ+����2�QE�I�D�C�%}32������%2�u*©��p�~��.,�nz����14�?3H�<�G?�V;��H��>�c�����.��2&���
:�"2�������+���2b��.�^)g�'f��
�Qr��h���!�3����!�
#:'0;��974�/y/N��~�����r64ti��������3�3��3צJj'w��3�3�0q-�s�h����4�+�l(�(Y"�j"�u�/^�p�k�����l���"�oY��3�<(�'�(�3��`��,�1%��#g��K�� &!
~k�h���!��+�t!��pC��i�&.��h��(>��1c��i�P���f]��[�Z�}W�b$"R��0�M�P�#��i$� �x(Z3$^j�u�!C��*�	�&S�"#�y&��(Rw'��!$���5�����Aj�)����'$h�k�l�i��!��+>�p�����{	�A-�&�/�1���5-���"/�\$"�K����S*(��{~3)K��J�%@2�y
_�g������i�)�Ln�i:���# ah��' 'C!���k
m��&q'4�
�'*�h������T���rK����� Z'R���5D���Ǧ
��+� �)��G�m#�+!���T#ư����i���:<���ҥ��D-v�!6�*"�ȩ�2'�����������#�
2�$�=����lC:��!%���z�a�T��ϩ*�������*���������!���n��� Q��h�N��#ksh
���ke*�ED����
$��Asx �'@�s\*����i&�.��4������1w�v��1u�B2c!a`H*fed��x�	/�������)��3T�h�
��!Eo�
;+#�"�)�#.�"
@�����*f$rP �i	��۫Ne����%n�d2c2�+�	k�	p�*����b ءN���+
k�U�0��nj�"��	Z$�'�'�i�	2��"�	w
F��	�,��"�"0P,"�e����?���Ak�*�2G'��%7��"���i#��%8W$��|tr/� ����$�'Bk�@�h�	k;)�#.*֨�$x���Q"���$�i!���	=��3�L8 �%��z�M�*��-�$O�����(%$�+��#B�7\nGn��-�����"�J2������En�Cnm
;��.R �
y����U��bb�^<��-z��-�""x��*�)�	�r��$I>�"4�߫�|�'�0��H"�J3��.'�-L0�-@�-�%)D�W�"z��/��x�,gY*e�}�\S�"+'?���V��m��"j��k�yU��c��$q	�MP�x+>q��j��������3��Q��	M,I�Y�%�-�N�'���a^9b_o]U#�#�j���^�����5�	�C
F� ��	����.%�7'L��)P������
*���g����6��."���j��L)��]�w�+d���v�/'�3%�!��u���o�4�ְ����.�l�� ���j�$�-�$��[!�h���)Z!��s���j�3%��j���e�����j+
+�-\��`�N����"������h;7"���	X�}nK-���[Ev�c+��3 	#����r������'< ��n2�3��H#t#�
���!��h�J�����0����3�+�2�	o/C���L��n�g�?I	��n63;�
��1�60u
�/������$���RV0Ѱ10
 Ӱ�u2�����1�2,,��&���"�h�����������Y�7%#��������������B��L��M���9�qw2o	/ck�1c��%�j�.0�
7� ��
���240�?3i�������#�!p#��3���(A*B
����-�z�@��i5%#F�'������������+�*������N�	�������2*j?����������k!�����k���)����������y��l��C���k�j���f��d�^i�h�g��[b�R`���1�������QT����������]�+h����#�u�t�s�r�y�Ow�v�q�p��5K������P��XR��!9�E+\�~�}�{�W���z�)�D���]���/��\�[�Z�_�^�]���Y��88$M�L�K�J�W#N�H���)h"" D�C�B�A��G�F�E��@�e0b0{�����E�&��"��*%������n0N&m0����&���P�����+q3�)S�@Q�d<=U�;�'sDi��k�!.�Zh"An������b+��s'��������s0t0q0r0g"sk��'�����u0��i�#v�{�����d���������� �����������2���#��i�����������e#��)�-���.<�(��r�� ehP�|2����hf�4��2������������"�%��E��
�i� )��*/���
�A�k�\��*�+����:�i9���I�.��%
��d�t����%�/�8��-V�-��+���&���2u��e�
33%"]�kD�����?&�k�ҨEeh�� �!�
9v��!��E`OmDu����3���2��g���
�jR$��������3h�O)��P�):�Is���:���!���s���+���n�o ��'�R�P����~��)�.�@�2O�3�N�!*$_�.�W'%c̩��!i$X,�	��n��u
M���-�i�(�71�����*kJMLG:�IHC�2EDg��
�,RWVY
SRUTOm)�$���i
%J�ui����+	�!���Q%6!� ���&�%�$�#�/�2�h�� �,6W��)��*�/�.�y,�g�)�(�'��'��"�!����
2��]!
����
��E��	�:�|�Pʣ=�<��+9�z�C�#�=�1�0����'�/3�v��hV�̣
0�������
����:%�h������&"��������BT��-A���,
����/k#x*k�s�u�t�����7+p�p�q�O @��!�f�s���
�Q�U��(j{2��%�*-o
�� [���"
���/h
�$͊��l��Z��z1]�d�^�V�l�o��^#�����/��)g�/�� -��(\��!���i��l�M������&�i��?��l��'���i?���.Fd�>�=���A�@�7TfD2����a��g�H�r���<�;�:�e>�6���(d(8��!'&���]���g._!R��04�3���(`5�0�d�D���1��!���&*e <��(.���,�t(�(��
��+*��jV���2	�p����� �2T�2��UC�������0P��1�)��	'�����$�����"���11��j���S�&6������������*������}��������N/�
��%�'?����.��%�c�����LC0A0{!ţ����ã�1�'���8�",((�(L(�i��j~$2��4' �V��n\���O9%��S��D��%���I��M���k�T(4(
-
� JD���'�(/��H)����p��&��Iej��-�D%�	&��2G�H �+)�����!��Y��U��*`W�Y���C���#d��G��)�h�,��d t>�j��$�)�E���	��3f+���2(���>�!.���a�����%
�����hh��2�=h�9/*QEw���F�����i}��[$?�����"TH'W�?���i%iJ#�s�['�)8k����8�F�s�jG�� &0[,=�����>�v��!�+8"�����
c��W��*>
H!Z3KEnB�<
��b���o���	�����G3�
�I)�!Ҥ�#�"oo&|�������<&��F��������-���3.������!�	��'���)�++K��]6�L�����������M�����(�%����,��ik
d�D�x��1!j�3�ڥ�����L-�,�B��
�]�@���
��{��������.8h����i���o�wCd��)8���0U&եD]%Es������=�l,�������.�����Z��@�+���[3���3�
"�s=$�"����="L!������v�8{���b��3"�@3��q$%H%-1
�����
���Y�"��-�;k�n���"Y�����^l�,#ʥ��n�O��2�(��-{������'N�O��"��
�9!#�����O�/�)����D������n�i�
�%�~^1�i
ө����K"I)%�X��#�����2H>��3�(}(��O�j�#�)�.�,4
 ��"H$L��+��s��"��V)Q�������h>X���*}�����#;�d-}�
Li�&2#��/���/@���������	����Z���C
�$����������b
@�����g+���˦B$�/?)%��.:�;-l�h��i�	V�%����)b3���#�<2�j�p(� x������F�-��P���hj	mi�����!ǩ�)G��8W�������7��[��(q�3i	w�"u�{_�^�]�\��-�$�&��[�Z��-�-U�T�S��-Y�X�Y��-�3�R�Q�P��+���*@�=��)t��������3��� ���1[A�d�c�W
i�h�������!a�`����I�))�����@�!�Am�l�k��"K�o���j��	��O�
����m H���!��������}�|�Dnz��~���`"<�t�~��q�x��$v��*������������������������q�c�av���!���"[����
L�="#�*�����������j�����14!�����-������(�U%$�&#�Knik�ϲβo-�2,����)�p)�S����ӱN��#^�W�c$�*	���Z(�a|���߲��ݲf1(&%�ܲ۲ڲײֲ��	H�ٲزͲ̲˲ʲ!g#�Tk�C2��$+IJò�"0.A���#B.���9�J�(��� 
J��,���Ҳ#��;R��"ñ��3 vF��
å
J���N��O����#��Z|(
��ץ5�ͱc�,��E($��#�������;�����(d�L�٦f��*��6�P��9���^��`���qi��0�Y
�"��6
ѥy#z�.[k��,\��k�|���W��� �'�%{�4���8(��(X(Ʃ#�*h(��(c��B�G v
���zU����^�uh��k"� M�+�"����H=+�E�W'����"�����B�2.yW�ih���s��-��"�J��
\"�z����������.�S	a ����a��%�k�`j�i!s�$%��� �������)���3��k"�!C���-���0��!h���i�
��������B������_�����] �i���#s.'!�j��jo/�o��-,�f(,i+@�A}o'�!"����	���%��
��j���GGi����#�M��~��	�~*�K��X��}�Gq�������C��##Qk&_��&/��K�,�u!�0��� ��&ш�"��"8#8�b��,vhH�p
�1��$
����
��§,�d�O-R-G-6-=-M-N-m3-@-�1-�"{L
?*c-F��`-a-�b-T-�\-���i'�
h�+��8�D--_��rXo��X��!���
b�p���1&�@9�&ӥ������ "2��3�	����	)��@��'w���W��3���
d;"���U�("F�o!����-�!(��p 4n,�*4�ޥ�0�
�����k+%Q��!+�hi%��#!2|2j'A�	��G�kW�1*\�o����$��$���iCG�+2)P-�
] ��2��Z���W-�+�(+����O!��=�4 j��e���X0-��)�P��������|�[�<�5) "�E%�إ�����@��"��y $����7
�����Z��g�4�Ҧ���n3���1w�j����M$�$yۥ��o!�F-�C�������7���-k&&��/�!�'���[�Q-
k�riU/U���%h�|��^���3����	+~��������h"��2����,ɥ���1�Y�����*l��i�@f�� ����/ R�X�*�jE�R��*E�(!(�A(ݥ�$m��"�)��&����L��+�z�+���U����4x�v��w�y�l���K33�i)�"�+R�U��+>+��� S�*%���i`� �0��1��3��3�0��y�0����������$��x
K*�&#�!��h�(���&+�,���Q��29����������U��
D"���&�"	��jc(�'�*��"t�F������"�; ��H&��(<��:2���F#���Q$��#�5[���
T%�	E��1�*X*�)���#d�����!�f'x+��!�*����3�;��%v"��f��(nD�T��
����E�����.��q!d�%�h��gk�!��r�� ����~	΢	�4�����M�~�
��Z�
�)2
$-��
8�� {�>����$*/�2���m�������o����;���� �������<�X��m�ة�i���o%��������ui/�'#����-��+�"'�!��G�i/��9FSk��$m	���O#����� %�
N�������".E;���d��^%�o�"�!g%B'�1�"�����#�
�;!�1J����!�:�;�6�&8�9�2�3�4�5�/�
/!���--��-"��1�iɰM�1n�Ͱߩ/"��&
��CFW�.�A",�+�)��'�&��/ ���%���r"�$@F��k'�������n���ch��)+8��"!���.��8%�2�k3�z1����n�/ɠ%&�*ʠ-�M�q�̠�� ��?������������8�7�6�5�9�\�g*��$���#��5������E���M�""J�!� F�E�D���I�H��+�"C�B�A��"��'��"�hD!����'�V���*���+8�`�$4�0��_�$  "�*��M��iY!�����Ƞ��Ơ��à��
�����
�C�R��	3��v

#7h�� �"�h�	2i��!���#9T3#�	���	��*�]�
�������y}*T�u�Y^��&$h�� ثO�@�u��c��,,��h����`��h� ���~1y��@D&X��3!���/m&1FW�1 A�&�5'��1�1��5��1�1�1?�ի$+F&_�22G%�1�1�1���WH�.7�&��)/���=i�1�1�1�1�i�22p�2�)��h�22
2	2<�22����2�322222������
��K)ZYXW#��w!$�&�~"VUO*gf��#=�j�'h�#��%
����222����y�2ur�22�'��*���r��p�nmtsrql�yxwv}|{zB3��9��k�[�~&���*�$��!84�!�����iN�>i� g��&� 3����#��>12p��-��
�|�2�2�%_��I*���W�3Y�X�^�=��$d#��\b��&�W����"���#���W,� �u���)<-$���	�
����.��	Y�}��z�I������K��J	��&%���,�����F	!�	o�����.��E'Vh��!!�
���&���ū"��B)��7#3Q�L����MU0��0�-�"�P�B�+c>�A]3��.�2��,z�Po�!1��c�"����Т��-3	a$�%	Ѣ02^!	&"i1��!&S%�!�������#	�
X��@��)0{+���h����hm�RV%�= Jl��d�ܢ[����7*Ƥ�!B2�e��A����j�����
<������%3�*�"���;����2)�)��K����r���������$g7�-�I3|#!"��%�<
�
)%%"�|hr�$�6�5 V�h��$T���U'�$5�2=����4�Q�#%���%
@܈��z����<��$o٢d����!k��آz �����l3���5��
�!�M$���������3��5H
��9K��i1q'/0����!�B��h@hC��.�$����%2�h+�h6�6������&���	Z�
17N[�ߢ�y��v�0�s�qf!�nm�*k\�hg�edob�Y������������:�j�o��'�M�J�>�8�����T�;�\���!����,%
��>��,�Z�XJ�x	(��� T�8��2�������E�������E�����"^�*"��?
��Z�]���!��K �zA
4jE"���8�x�t1G�r�E��h�q���9� �P)%<����$*�"*�2�[�"�^�X~�9+����� .o��3���M���q2B�;D	5�x/��
�a)�aAR&��w�}'� 2��t�u� �5!e�)"�$4
c��+b�L�b���z��.�%82�Ħl#���f�p��)c�h���������
�
�
=��;�|"����������� 7
�b*����\�Lj��:Ȉ�!n!����#q
������d'� 
�G
�.�#��i�#q�(���	R�U�#���"Q�T��"������gjV�������-"d#����-Sk�-�y%}c	���-f���%)F�g���!�1���@&�,F�#'���
?��U�s������������� ).%�� �Wf#�nM.D�B���;����	4���S�>�!hРFs��
"u�}���x��� l�����.�	�
. �*��!�m!���*���k�</�%B?!��v#�"2"2�� �+`/�m4���
�h(��C���$,57�� &�)>5@��q2�Aw&�S� �"P+'��6#����!�"�
!��/!0�*�1�	&@$�!>����6�`���(�����������.]�`�.\-�_[t�$�0�,K�
Z!��-�����'q��	�7&Ц'����Yht"�,�!` '.��	H�e�b�#a���+c&��2�d��h��A�*J���
3?FtoC*��#M2;�� �@��!���w�����i8�!m�>A���#Z���H<$%Q��H���� I�G�5�E�@�93F�>"#f�2���~&]�R��$�J`3��0�o
a�`J+��!F��i=�L&���]"G0x��4	_.�o-�T�O������(��#������+��}����~�����������l_J"���>!@�<��:DU31i^�6����3
A'��+"�q�f2�K/��*����D$�.��u�����
=��h1'�]�$&d��3S�
9/���*�j�i��	�b��l��#e2%���.��������!bi|#���
p���tD����Y�#/`��������������h73�F����9��T��d��=g!�1���z�
t��r9���������x��x!^0��@ ��"B"6h��	J$��R�	����� Cmk$i("*�������������������	5�����������(h��l��������
��D��
D
;'D�c�Y�$DaW&�]��`�#��űıS!±ɱ�DZƱw�a��<K
XjFj�.����α�̱˱�(��ϱ�
V�ʱd���i$�� %���%e�
���p�s��"��!rqJ!ݱ�۱ڱ߱ޱ�&�ٱ���ұѱ�+�ձ���б!���[��!f���;���O�+��������k����)��"
���m�^$_h�(�"F �3:(o'3q�K��s��3 >%e��='�'g�j\o�qoNhoYo<���?���ao;�b����To�-$+��++�������������5�����!t�%;����D.y��"5%���EV"O���"L��%�(.(N(�(	��;����n��l�k�?"A�QGF-3���#a�)[�_��+]���\�[�]$W���%!?�z��1�DR%dD���1EU2>��c�,^e$��(��a ?�R"�(ajk�+�;��%�]2�w#��6(V('��E���1�
h@
�&2+#��={)8.��:�` U#�����w!�%i�[ ��������������)��~�s�ih�t�l�:G�n��X&�!�-��� T+�&��'�����`�#=�1�����������12�1�1���$�$�$�$�$�$�$�$�$�$�$�$�$�$	�$���������"�$�$�$�$�$�$�$�$�$r���h �1cG
�1�1��9�������5/>�0d %0��� ��^
000	0 0
000�e�_0H 0000�1�E�(v!o(Oe ��!����P,Un����K������*'`����^�dz��1|���1s
r���f{0�3)�(�c 0!000000�)ª"0W2,��*0+0(0)0�&O#0`%�,0��_i�+j3i�90��vO ��g2f���(�)0�1�R��4��.�0\
44�h70�M40504$20-0/0?n�vu|�j(�(4��������!-���!��`I$O�S- D�L�,�j��f-�%D~(D�0�%��+��0-�g��t�s��j 9
�*%�i�o��0�,@�#%�'�0Wo�0�0���0<%6�]���A���' -��0�0'k�
I ����2��6"�Po�}Z�	B�X��U�]
A)� Q������F:(�,g
��D��	+h�|�0}n.	V�z!�����I�����������������������v��,��������$&o��
���	s�'���6o��U�V�S�T�R���d�_�+k��s[���T�U�[���'o\i��iww�y�x����}�+���y�[�}�31�\�
y�D�D���B
R�����iG"�'f�	��!#o^�������]�
�oj����R!r��[L2V��m�)����$�p�E���S�h �a,�i��)�4�$4`&���Y�;�AN�4J4A

4N�:o��c��h� �6iY2����TD>3!�%�	XD0xB0C0!���E�
�)|����h�	#�@0%�?0<0=03;0�J/�I0J0�E0F0kM0N0K0L0��
\�+�����Z�c`�g���#�������
 �4+ "�	� �#>i���<��

o>fj�IP�X�$�f
���$����*i�u�������~� �]
H���
�3�0��Q(1(�(����,2!��(a(�1�/�&���r�|�)�(+{���$��-����h�
Z�0�
0������������������!����#�
Z@�RI-=:4�
].������������g-���.�����������-���n�2�}�|�{�y��w�
>h��	p�u�t�s�r�������i��q�Sp�uq�W�Z���
,X�8�0{.4��,4$�\&�����Si�
����;v�#�1��
��O�������2��Y0�Ci����
.����#��)<X#������H�����wf���*�%yxw��h�!E�!4�
�+4+�2�
4�0�08���0�04D�0�0�0�0����'��������t�0Q��������+B#p${+4'�'�&��ph�nvolmjU#(4�&4'4�%4"4#4ef� d�(w(_`}�w=&�0ha��F��(��
L ���+yp3Y�/��#�.�SS���I�����Rg
kZ[XYV�
���(*!~`��]hM�K��i����

3�QR���)��>
�"8oH
y�|'�d�0/�
T|�+%z��3y��"�M��&!�#RY��,D�XC{V�!UJFHFG��1�%8��8xQ)0�=>S<,��	%�
�+��)a�����T
���g%�(_�(���������$&���0A��n�)
@��L�~!.F.jT C�0�De�
�i-F��0o*�����������������'%�K�%0��
"���!�(�z(��������G�����cJF�!�����)�
7iW3�4��j " �(�!���
��s
� y�
�	P��/�#�i�	Y&� ���	�	�
s���-#��Q����
#���3����C%��!�-k��.���%���������������,��E��	&�)B�����f&k�p#_%%,"U%�,q*���������"����F��3�3���3�3�3�3Y�3���O��3�E���?�0�#(�"�(C(��b��������������&�����3������'FN��&�"�%F&F�	�/��"F���������������((�����#�%�S��&�& %�((
(�%(G$��[��MA�>�ѫ�	��2�e	�$ �T3�-��9&���q���`(�M�!WfnWFFFFF� �F���U�ޡ�)��3�*��:�l�F'FF�-80
F�&�-FZ�� 7���v"�*F�&V
@">�
$#��.�i�0+�(
�b�r�g�'�!��,��Z N�R,VF#-#
2����i�/��ħ�$a&2�+Fd6G��IB�Q�1���2
,#���kiH����E�E�E �E
0���E�E��2����$
pnr�:�U�"�k�E�E�E�E0���E�'
2�YU�x\-���z&o�c30�"� �H3�#J3����v)�EV�E�E� �'�]E6�� C_E
�*��1t�����ES�E�E�E�E�Ec,/�E�E�"+8��1#h�11��1paF�FFF�1�1>�j����<�f�����"D��(�	�hJo2&��7���Z�iS3�E�E�D��4~�}������ot*��-	�����q�}d�5�6�FF�E�E�EL���  qrwxuv��yz���"%�EJ����E�E�E�E�E�E�E�E��/)�E��E8�E�E�.�E��E�
�E8�c&U��-�%���$+�6���1h�����M�wN����p��������������B^3���:"
Ѥ7�%�f���n����'"�8�;��5�REpkSEX�G$�Oi>#*
�+�	5[9���2.d����6/
p��1be�f���H����)�"��iB���9�h�"(�
 �
m�8
I�,kO��~��	'`�N*g��m2�/�d�� �	�}�X?kn#;,M�	�z
��'���j=��)}��1�k�,�D*g�=Vk�1E�����-"��k��IL�"��[�Z
�#�7�-����-8�6�9�53)~
�M;��j2=����"��c0��5�����*���2���H$���'�����C1���6����E�����^����������7�Q
���111'11�1(1*11111
1�E
1z�E���E�E���E����	
aI	16,
11�#11E	�$�$�$�$%��$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$9�$�$�$�$�$9:	�%�6&T-i
�&�p5�6���i�>V��)a@�,8����	�h����-tE"�)$B+��Z�$�
��42�@�n��u��n�&�-�E��rD�v';B�22����3�*2�1
c!��wDyD2W���i���'��E��?��-�F1�K!YG���E������G��$����O"~E���W��)��|�xE3i�'sE�* ��2���6_��h�$^Y�D&�3W��o2��g
9��3�3j��3k�x�d,dQ�����3�3��c�%b�� ���3�3�"������	#�Mz�sne�#U�V&��
3�k���&0*� �i��2��q&�"����"X�!�U��
�������*r(�(����n�(p�����`�B	#��,w�a���0�V	hS�@�#���4�<�*����9$w���j%�Q��ߡp$��U��+��E%�P��	Q��(S�u���T(�I�����.���?#����D��	_^�.�����!����#�IO	���8
?!�L	��H	MF�G�H�>	J�K���nzn�!��7C����!Ui}���3��H��
��{�V���2�hoO��!K�
��+0�M���J�/�AD��!?E���������%���>����}ԨM���+�
�N���UujDD"������(3��"�����B���6��T�������p%R�b��%��1k�M����
��
*��h��b��h���kI��h�{x
%�)	%7��+Q�9��!�#�Bk@��-|
G�iL�s+I�]�1�,�����.Q��J����������MN�1���j8�@	o
!� �)n6 5k�R��"�k�\��	��,5�s�"/0s
��C.�#�!�k����Ȣ'*C�2�{�0[ :�.|�,�
V�:����`�(3����"30�
��(~�,�T�h�}3�iq��N"���G�>/k���_redcq�k�.��i$�l&&Ej��o
�i�i�S O��	["�,�(��J��K��� !E�c�V�C,��"h�a�m/2�����v�Ft�y�r��˥�v�Y@'V"
W�x3�-~�C���j!n���(.r�n��cj��b����|�"z"m$����3�*��{[�2�y3i"����i���j+(#Y�*�.G�i�!����������h�,��="�q�+�"�np/#�2�$�Xe�������R�!�Db�^�
��1A>&##�q
$����1P3�)�"�**'�'�M�s;�f�q�+W*&0�/�2$ ���"����2l+sK�J&��������,9d����
��"��25"&����uH�I&q��O�����L��M)��%�Q��.�
��'
(H"�a"sL7�}�s33D3�h��3ĉ�"��̫v3�3R3%�%�j�L3� 1 �<'!�$�#��-%�
�'�)��oܪ�o,�/�����oS�!=�!�!������u���H���#�'����i��2tv,�c����Do������2b�:����M������3�oRk� ç��
��W����+_�'�h����������`����8jT����?�j��]"`�3.D"a�d�c�4�e��	g�+�@)��j�I�l�o�n����c1/"��0�3�#�3�3W1�3H+�3���\1&#�#"��hG1u�Uk����Q�P��2R�T�W�Y�X��	o1B�A�D�C�F���H�I�
4o�3�3�3�3�328���"�i$�d�;�*=�?��U��i�,s,�S3.!eD A Ldk;�5��J�1��{�2�5�4����9�Zo� ��Z
����,���3�Oop��t��{3D1�2X�2o�,�����&$=[��h�-�����#���P���w�~"�v�Z��a�{��+#����%y���J%����!?���:�]�^�>�<�;�G)��ް߰V+�*��*/�.�-�,�\'(�'�
"�!� ��&�%�$�#�����E�E�E�R��E�

���
����
�	��N/ ��)�9�37�6��$1�0�m5�4�3�2�o)0����
*������d0�ġ�1�1�����1�1�1�1Z0�18_0�&3lơkY��)���&���E�E��E'��E�E��,��E�;�	y�E�E����E�Eo�E�E���:���	�E<�!�E�E�E�E-)�EW39���E,� 2.��� |��#�
�}
T
��p��2�%^b&���U
43����j�j1��	�q��)�A$���g���0��'#Q�+T���!���2T����*�J�O���9�E����P
�r����l���W����
�����W��E����|&��,Xk[-�V�
DCLAUGFE��`EaEbE���r!������������!,�.�����s*����n�3&�
�$��"�O�gd�1�):������dE�fEj0o-������P	a��$��"A+Z1m�l��43KD�1�
�&����XEYEZE�
TEUEVEWE������������1E'�(�����S��~�}�|�{��_��z��nu�t��r�y�x�w�v�C�b��A"0j�	h>�f�e�d�c��(h�g�=vi"a�`�c%<���d/ �q �E�E`#D�C�B�A�H�G�?E���~nY@��3�����&p����"M�L�$#�w�EO�N�h`�g�+/9�E�3��E$yEzEE E\wE�%\���x'�E�E_�^���Y�X�����,S�R�Ш9W�V�U�T�pE.lEmE*gE�iEjE���,�������$��rE��`!�7�+�9��U"(�"��1�	����,�{��,2V��l�,��/�����"����Z�Q���H�*#���
�����
��w�@��4K�F��}$,����W�����E����l!�����$�a�`"Ht����h��	��$԰���C�@�*3� +A�F&%X��s�!#�"�:�:'�����"� e]����#9��>z��EE��:��=6%8i��BE@{��������5D���\��������p*���������������
7D3��4�1���������7�0�-�8�Vi!�������p�����!��A#�C�?���&����<�z&���l���3kd��(@ i������7��"	!�Zh
�'��+������ 8�+0)w21:h��wbj�H!9.�	����1�+��0��N�q��Y/3.��".	d$�*�	~��O	�@b�_����4/�+Y�wh���U�V�S��/Q��,["��P��M!� L1�- ���t��&� ����/U �i��G�5���h�����	�	��!1���FY/�PRSNU��BD�	JKLM�
"AC������]������������#��1���	�S�*j������h�S
$�����Ao.&R�h����|U!��h�!�%50� ��(i6���U'{����)��|�M*�b/U9%��h��y�����=!����i�*����h/�M(�!�	r��u�Z#�s��	��!�3����D���3�/��������3��d��2������������@��'&$!�"*�r2%�E�#A_� � �* ��x2�������������������������	�������	������f3d�d38t��"����K���	������u��G�,R���O�R�3G�,�2�e/������Q�F#j�
���:%����j2ðȰİ�80°E!���he�#���	���������p���m�gdb�fpahQ��;��x&5(]^�q��r��������2'����t�� �D���G#���a!4��#�t
�T ��!����li����,����������E1�&��q$V3
�"V��:�\�e�K��,����������X���h��������J������)�3��c"���I�	1	31�9��#�$�W,����
��n( ���kR*��a�_8%e|�-/J������
�	��¥�������6	����3+���Q�t�������������������$������?��m�i'l��ߣ�, ��C#�o�c�*i�������<��� �@������m����:q���s�Du�t�5v������G��	�)|�{�K�ǥ� ���0�Y3�	W���i�$f� �
Y�!�$v�W&�+� ��	^��#�0����`�|�/j�\Lh���!2�d����	�1�~2h6)a��,n�������$�;��$���
���.hDk^e���nf� ��u2_0�,�B},A3
?><:a8765e310�	.,1��:.x��E�� �	9{�-�[����"w t ���$���� �M���Q�
��s �
���ll�'7�4��������/�)0g���	���,����	�	��	v$'=������mT'�c���	����� L�m��	�.���N��C�E�D�G�h#I�H�K�J�O�M��	O�BQ���2V�U��(!!5�:�9�=(](�(=�@�?�V��*2U5�/��F�"հ' :�A����2��	�3
�m(�(��9�| ���0,�s�-�Q+��MP���N3�k�9�:���8����,�()k6
�/�F�0�3�2��4� �#�"�$��
D�����.��:����)����	�AT�&���'�:3wb�U������6s�������5!�{��
��,���ܠ��E/��-��n�i�m�������e�M��%� K��#�c�$�����a��2��2�� �2��G&�!
�
����2x"���2��I��p�����C�����%	����2������������&����2�*�e�^'h��E����)�f�'&%$	 �(00'�U�
!�������#|��%x��)�2�2�2�3a��.�2��
�/�O3��%�")��2�2Ҋ���i��� �����!'�o��������������%��/�N��M�/�X�
H�"
O�I��+,�
:)�n�@*8��"	�+�k�!*T!w�%�����5�����d�e��D	�#�\:�q�4�������A��V/�!+����������I!��G!��� %�?��	V���4.�a+F!*�����u�/c!���g��'���	��*Q����3��*�|�j
�p)�j%��+g&����
���9l�/W�o�/1��"m���'�do�$/FnI$+1�2�$����!�3kH��� G���!4��� ~ �-�%�-�,.0��?�#�.� V�M�g��E��2��w]�
�2k���%2��1B�1�h�!1UŦ��S��1�?�$�;�&����
�)10$=�$#3��$d*�0�2����ln���2��Q$�!iզ�10e�����������-1�7.��	����:�o���"3-������h�E1������1��r�n�[�����t�ji��?�G1H1&%j�
b�����E��(��o��#�105�;2����$��[�#����gu
p�5�o��'�"%c�&0,$0cQ�O0*��O�N��&�k��54�����P!�#���L.{��#�#���#5h �z%��*���i#D�_);i��$Q�$�+U$hw�:!�"s�d�ަT"M00�F"Lj���\%T�����/k1�S�}����k���'o5v�ij�,_/H�j�P2`�EY�h��DR��)�U)���Z/�
H���G�R���%�$l
/�2���"��|r�S�wn \\�#������%i��%���G������'���!P�������&_$)$7"�&�.2���.�۪6��\a��+���������(]&�-&�'�$�%��m�Ti�h���+Z2�&G<��h����[�&�
�P&�i1%u%�<�hvnJh�)i����s"��
#�&+��34�q������	ݰZ��8%�#s���&k$���-�b"�A�V -1�)l�/����$�=�%#o�&��&��
i��?�/������F
����EoI�g$���*��\
��,�$e�S!/$$0��%�
Gh2���+ҡ�K�E�}Z��"��� ���&�Ek1/2��{8<�c�%����¤�K���j j�Ex#o�q��=MM1���.	*���l"�*3�>l'�,�.T�J����w�3� ���>����J���X .�#�"�� ��_����q��y���js$�(G/-9op"+�.��J�E���X2w�*�Y+G-� �/��H����!���*��! g�Ho_?�@���B��${�*���" �=��7�G&�&�)�6!��2�+%�f"���G��>0l���1�'�%�.5��d	��8���$"��!�
~��.�iX �
Q&���������+�0��"���%�?�7�h���
��*Whq)���*�6���/��C��������h;�BFY��EF>F?F��AF<F=F)� p-���H�FF�j>�8�6�;��-! }1��h���!����P�5�2�|r�"��$w1��	�%�!4����/7F8Fw :F�4F5F6F|		]0D�\0	�D?2�	�LD	ND�EDFDGDHDBDCDDD�$�$�$�$�$�$�$�$A�$�$�$�$�$�$�+		J)�x�>D?D�.AD:D;D<Df�8D*.�$�$�$�$�$�$�$�$��$�$9�-�G+��0��.���3�W����-���h�hL%b���,i�)�V�y3���=
])�+��;2� 9282722,Y D��Q�t#�"o\�=2���0D2D�)6D+D-D.D����*D�$_n	��+��	E2աC2A2?2١oסK2[ԡG2'D�#D",�&DD�!D"Dh���%e�0��f�e�6��iDjD%�nDeDfDgDhD��#��"���m"�H;��5�K O�P��
R�S��0d�s�@�B�"�R�>*�i?�&?1TF���?�� �
'��H���WDXDT�;�& &�)�^D_D`DaDZD[DP�&mYD}@��3�"�1�SD�UDVDODPD<RD�
����
��L�+�'������q,�0&�n_���36"�����2������i�7	�R�.�"��)<� y)����������&�����S_���������r������� ��4�2�� ����^�6����a�2h1��#$�{��#r$0'����x��h��g�DDD�
DDDD�&�9,�V����Y��p��g0-W�h��x�!y�p" ��z�0�~�� a	DD�"�$�%k��!m�~'o�(�,�
)�
� o�o�,�_�*��2*�!�d�1�	��D?3E3DF31�i��[)JP��2Q��S��#�X�W�j
Y�!W��k�Z[�'[\�E�D�G�F�8	H�	DDDDDaDDN�M�E����'��Fo,�]j����C�>\i%@�C��$z"�j��$'��'SjN2M2��!��t��65�;*L2K,2��50Zu ����M" �����*q 1D�3&1�3
F$�1=!<1���1,1u"	��44����������F�����2�29�2��$��}2����l
��2�2P�`�������d��1I�!7��B!���/��
 1��
����c&���
�
��,	�#�2�2��2�2�2��2�2�2���1�2$|]�o��\Wߪ�"�1MjQj^�$"1�1t��:0T��SB�A1�\��*��F'�#*�4#��"�3�10���DPjk�o�o��3q%S�G���$��R�/ˡ:�=�<��$>��}�͡�$n��T5�	����Couy�������)���ë����!0�I�2�1�4�^Z5�[]9�-����G �׉։ى�Dhډ݉��k���,�Q3G"����/�� f�~ia�hX�%Yj�S��މG�F�Z��"1�L�I!��q+.��e�ȉ;�4&m+�$��(�������ԉӉs�]�����cRo�8+�̉ˉΉ͉Љω҉щ����¡������$tnc�$14[��������������#�.��4	�*���ɉʼn��ljƉ*A&�"'����e�����������������h�^n���!j���[�	������,�����>)������D#r��&���}!����������D�d����!u�����������o"�ͥ�+��f�� 5�2i���\���_2`2W2^2T2&'k�S2h�j��+������������P- �&���������Dj����|!�,e����uk�Mh1� O3P3
&k2l2i2��g2h2|f2�
m20y2t2v2�!s2o2q28t!M4z2{2�>M���C)CVjWF�����z!C�i��6������p!�!,3����x�*!2�/���!.��E,h�$5�6�#�$�?���Z ��+�,�)�{'��v�%��f�r!!�s! �#��J� ��MA���&�"%t��  �)
�v�(�-�$��� ���$n!h������h���=5	����l)��a�R�D�(3Q6k�62!F/���"�
u N�>2�
<2Q��
�
��
k!�
A�����6��!7��/a�|iK�q��o���v��$�$/7��&���|$5(�;��1���"a��"D�5�b�T$#11�36�I�D2�"]�����jH2~/���š�1��:$ѡ5��"&�*$�/%x���4�H/v00,#	"�'{0/���&y��2�i?	�a�%81E�G,�c�������]h
-X
|��2��G��������X���X����e�$5+�$�${/�R#(���z�^�*ي�ۊފ݊$)�z��/��$�%��	�,����y�����n����ߊ�n
48��"
A��%.�n*ȡMrʡY!̊ˊǡ�n%��,��M�(Ԋ׊�	؊����+P3�v��$� ъЊӊ�$$������xS&Ċ_!Q%�	h����+F8'�����F�ƊŊȊNJ�!U�0�0�,"��0z	
/yS/a��01�u�#����0����0��w
]!���#�L'��5�m��!���!��(��/���{������E$RV1��WX[M�w���	��z�D��J8Mk(H��iU"�4i�-���-��-b)�-�*H�~+;	_' �CG�HI���m�w�2!�"��-���0$�/,�$�	��
���d2�*����p��������d��1���3,t���A�]'r�r
�+��nl�
���
u���)�3��3��"w����D	�#?1_X1<-�${#@1��%��!V!m�����_3���� �3����;�(�%���L�%�1#4�3�6%�,ګ3T1K1�`1Ma1T��6��]-�O7������`(�(k�p�����#2�%.���"�)�h""K$�Y����
I#.����C*��2y"
Hh^k�& �$����:�L� �I�H�K�J�E�D�G�F�A�@�C�B�0���/�(A/�����[�T	�i<�?�>�9��i:�y��7�6�_�"�����	��i���������n����(3�����������;��)��x��B(�(�"
(("(cX�c��&T�/��a���=k !������������'N� �t�T�(��/o�����b���*��N'�!�"�Z������������t$��������������������b1<�mh�J�z�n�H,$(D(�(%((|
���(�������s10(P(d)Y���v1r'���(((H(�(eG��O�Jhoi#0�B�V�,R�UP. &p���)��*W1h'����"���
Q��0]�\��3c�)1�,��i��~#�$��)4��	o������0�'��������(1!	(���������	%!E{1@��N�#A"((���	7�x�w���!o��	��r�E��v`�h�
�iu�
v1�
�"�)�[�sY��_���]����^���+��>0���
�k��g�f�/����#�6 � ����%�!,�F."u��b��"a�/�D�`yn)8���_nnmn�
J{n�(�D��G�Q�h�*��x���b�.�(��h���,Z+Q����������%������6���"^�~��
�������p�i���
� �������#c�%o#o#�	�R�X�E.�*�h��)h!G*b�:"9����)�
�1�U�90�KOT�Wj�h���M�����FG� �1��C�	�xh��-�-������	�`,?��i
�BjL������`
�n���P*����p���#��	�"	��`$�������1������%}Ej��2!w,4���,@�3(S(�(��%֦�h�����%���h� ���{1�'P��l�����(�,���f���0�H�32d"�t�&�a$�
�P#�J�0���7�B��	[��e11��m3�4�����6�8�1���48��B�D/A�it��@+@��)C�a
����]+�T{�!�h�(�!���DE��?ש)12���%�i�i5�Ρd��$�T��{�Ӳвӡ����fh��7�h��6�l�	�W#)�;�T����89�H�%��D$lh��+���:��.�+�� ��j�
.��D��$��D�2�'��6������xͩղ�'C�\7��7.��+�w=61�"�4	�2>v��&�7�p�������'���&�m�!:#�l�Ų�i�����hkh�)5h��-��i��i����"�7�X/t��0�-����X���������(��,!����g���
�.�#_�Hj��	�+'�����!�+z'v�:��%7��h+�,h�-e!���$.1X���K1�'���"����*��.'��0�������3���{T"�>�q���=�����w�MA����=�@4��0�%?�#oAe%��EE%�M!EEE�MEE��N����!�"��K+O(�(�EEEޠ�DE�ߠ(/(�E�EE
E�.d�
EE	E�i/�W
�����4h�7(W(�(�D�D�D�D�D�D�D�D/��,��g)L�,P1��?��-6�/hg(�(u�ioi
&��(�o�(�"y��=3/2+�����D�.�1*����_�(K����BE��DE��?E�AER1<E=E�&"��0#�0E��%�Z�,E-E/E'E(E)E*EG,�i&EP7E8E�:E3E4E5E�"1E2E���
���'k�#Fޫ E!E"E#E��E��2!�u�zM���]x�$E0a'U��Z���*h�o�k f"o.�\i'9#����$N���0�P�?�7��Y)j�?�)���/)���.�>����.��O#0�"�
��"oۉo���!q~��W���/������.-.�o�f���!��/3?�����2(#%#0@'�(4�D�D�D�!�D��D�D����������1�������.{�y�6y(�(���&���)n3o3b3l3��v3r3u3�q3|33w3k�"���(�3�3�3��3�3�3'
3�����f��/o���d�:2���%��j`2�(�
��f�!	�X!�3���3�&�3�3�3O�3�3�3��O�3�3�3�3�3�3�3� ���Y%�O���!�+���2|#�G�����$$,"�6*�CQ72~,WiyV��iV ��1�$���1@����#��20��=* 
���9�<�n�3��2ȣF2I2�&���O�������C��"	F�$�E���E9������hO$.�K�ϣ[*����k%ң��ibS���Sie"�:�
 ��� ɉ˩�����,"�m��.�%N�C��$��������������������������rhf
����> ���*��1����!��gh�S���d���,�%cba��+h�����������!'"� #$J���V�wvutzyxonmlsrqpgfedkjih��� �� � ��1�1w��3E�������a/� J1�//�/��;&M�&�&�&�&��ZdK�*+*��� ����Ѡ�"��Ҡ�j�dK�Ԡ�0m��������������3�)1�����������?���������M	��u�w�v�y�h*{�����!P'��q#0�b'7-%i�OE��JELEMENE�'GE����n!�i�������k
%��
���!g��!i�h�j�����D,0r�q�t�s��� ����}#o$*!W?�l�k�n�m�p�o�\��4]�J*_� ,P��|����0,�0�*�0�(Z�Y����0C	�0m�b	}/(c�b�e�d�d��#���'���B���!����i��.�bj�?�7R)����$����E��#�0�#�t�,�[�\h�a��;!P�(��)��'�N1���3�M-h���׫7Y��������/�!%�
�=�r ���j� ���-��-�-����h��(k�����������%*�
9��+
��ä+�-�+��[0�'{���\EP��-K�N�B�#"����
+�=�4��.L#��xo��A��k��	��,�
)����������*������&����Y��������ˆ��ĈÈƈňP�6+(K(�(���g'Y��$$F���k0��h0�$i0Ϋ��nf0����B��/�'p0-�'/��o0���l0��(('(b�(kkd1���$ǰPŰ�,٠�"۠ؠݠ!��i3g!%
"�"����$ �	1!�0� �-���'1*��1z1�-�-��\�-��������������������R�X��S'�������<3�����&���������������2����
1�1	1�<1f+�R2��111:�'�1�|15o0�"1111B��)h���9���D�D��D�D�D�D��B���*�D�D�D�D�D�D�1�D�s)��2���2a�	ՠ�R�?1��s!u�0z%1&1�$4!1"1�D+1�D�D41&�
21.1/1,1-1��-%371w�y�x�{�@!}�$i�h���)3l��3���
-1'"	0�*�
�c�e�d�g�f������e���+m��Eo�r�q��P�/#�=1>18191F ��'m��+Fn���F F���1Z��qk -o���'��X��Z�!$-3��1`������\�_�&i�a�1�1�1%�1�1���1�g���a@3������&��(���y���d�
�	��'�):Q�
�
���������x���#@kp&�"F�*X6��)#����1�"/�8E��e3�
�2����
C�4!�f�3�d�%+�A�TR'P ?�����b
0+͠@,�0Π�0��0(�0�0]�!�&�0�!����4�����"/��� �����!��!E�h�2�#j�$�nh�i ��������7e!�h��g�'��U�0k3j�y+I#jH�7l�������k����Q��!���\\)���$�|j<����0���m1F��.-�^._+�g�w	��ѦN.4|�*.��1v2����)���j��j�5�7�T��iM�9h#��H�"i
(,�jq"�",o��j��j�VL`�-�i!�704 4�.�!��Q {
��D
4�h� ��4B%4��G�+u�/�,j'���+o.�^!s�E��
�c�\!��O1���#��9T1>�������:3=8��Gos�!�-/��+'����,&W�"���������������U���������h����������[�%��������-�i#'"��F����'�T'����������a3`�M*b�+�t�!!q�p�ۡ�	�i!kjml�~�}���z�!�!v���� ���j���-v�����6����U(*�
���`	��($�<�}"�E�E*�/9���� 	�k$(-(M(�����h��]�s#�	�:��6���z��/�.Q� L603,�8`%���(�#$z#�(�
�4�(� K�^��=1����5 =�����2e(X��0�s� �`��Eh���E~4�olBADCFEHGJILKNMPORQTSVUXWZY�l��2Y,/��E	��*��"��+��<O�	�0�gR�ɫ��Q������o��0/�'2-�)(+���0��
��	 �t�6
��0�.���,N)k9 4���'Y�Du��sҩf�\
�f%l��T$;.��-"
����go�o d��'*)��/6#v� A+<����
��5���!"�M	%Df�����!�&�9��3oo�U*�	##2�%.�%A��Dsp�����1J%17N ��~0_N�5����*�I �V������	��{��p���,���������"S,�V,��:�;Di*#��1%�7A�s�Qb�:c'��Xq#.���%��) ��b%�,�
z��w�3|f�d��rot v ��'�~�D
f�-�F0X�/�������J0�0H0<#D0�!����B0�D�D�D6	�D�D�D�D�D�-+��Dϡ�D�D�D��=�=D�D	�A�J�����0A�@$�Dpo�D�D�D�D�D�D��#f��D�$�3�X����$�u��m
��k#����-]����6s"n#D�S$�#��Q�-I,��M��'�D!��"!�D�D�+vDzD�~DoD�sD�����!0#ΰϰ̰��Hn?�D�DB!A!\D�D�Dʰ˰�D�D�-.)�&�D%�D��D� �D���,��.})�G����-�D�D���D�D��D�D�D"#����f ����b�����)� eE�-���/[*"-J 
�Ss�T�	�-�*o���i��D�D�D�D�+r�D�6.�D��4#�$$�$&A��	h���-�,
�7		��$���=�����K%N\�N'����*���a#��: �*p����z�7�#!Ki�1s1��	��*�.R	�#�#��"!V�Ab�G��	X$
�<��#��%ީGh�	
"}{��x"A��*j�1E��
���J����xvk�
40p�c���.�3����������������o�#��&�@��!G�991h���D�S}2z*���nu��!������!�o��<��ip���,�
M�9
[�H�H���|�1DL �j%- �//]���o��Fij�K�!����<����k�����hi�.������+���7a��K$�U�/�^���v���  �U��� �$��$��%	��$!�

!�������$�3G����M"^261�hh1J,������N#?'���@�&_#Hio�w�+�����"#��3"��a�#�8���'L��ia	X"�$VhV2@�!���!'� ���)�o�p��#$1������1����!1 	�)2����%��w!�2�����o������'���q
ӨK�.r��#�5�'���q�n����5 ��	.I'����	� So��3%�&nv�}����`h@�J.�2
��{w�U�u�I2����f�����Tj-j���$?"b�4,������
'�$	��
j���i111V�'�&3j� z3 �Nt�2j:����B���������	���	�*4������Dh#	<iA�$@jE�%���Bܤ��{!S��3�/��������j�,
+���X���
H&���'���$~�tZ2��&z�:��P)�D�!�M����
xEj�.�(X'	���+$j$�3�hr�^ ����J��Q�� )"~�ab�P�=�T��C1��5.e
�,�������Ȧ���^i�Y���&��!8�a�>����%�P�O�R�Q�T��V�U�X�W����Y���[�Z�]�\�Q^�a�`�b���r$w�j��������E�G��I�H�K�J�M�L���36��E����W<.4I���*2o�@..'��%�i�U�����$�|��I"������������f�*+������������������,�D�t=��Z�q����!�!�!/#t�I���*���q�)�,�+�.��h0�/�`$(1��3�2���7�6��8�:�
�O��B/#�#N���^Y SP��� �Z%�$�( z�s����32���+�!�+�&��1���"o����h	�������M���#��$����#�����������n����/��u/ 3�1�/�����_��	����
�
���5#�L����Y�� �Y������h
���j�\,3����s2m��'�2���*.���	�������Y-�k (@(�(#R((([�
2�
���3Z"��Z%'��(�"�&�C.*��'$�4�$�E�#&�1����#�M��f��1����k�F$�E��E��
�3��1�S�1�1�1�1)h�}k���1�1�1��o�o�o�o�oh$�o�1
�t/���b`�y	��t�H���ר�-
��1�!���1i&�!�� ��1��1C�1�1�
�1�1���1�1{�4�
|��~�����/��	C ���� �
�+
��!{E���|�(#|Ej���"q�t��v�%kx��z�#*����1�1�1�1���"tR����2*k�i�'4����!�#"�)���c0jXn_n�	HnRnBn��UnG�AnTn@n[ni��NnkYn�JnInP�[��|���
3�g���i�h�k�hm��1o�n�D�p��-e��T2����S�U�T�c�V�Y�X�th�1Y\�MnPnQn^��1`�_����1�Foe�֥--
���>�Y���'�
I�L�K�4)M�P�O�R����j�
\r,!���+,+�} �W�������#�*�����Z)&*W*S�y�=�z��r�p,|�L+z�1�1<,� �L�z����,j�-?�A�@�C�)r�D�G�F�3�2�4���I0G0��l�/�1���&�� +��.-�,�/�.���0����6�5�8�:��@;��2��2�E0��������&����h�����2�/������1����������1$���0?
�0�M�0��08\�'3����1!�S��fnE:�YoE���'�
F�'$�1�)�1�1hE�1�����p)�1�1[�$p2����2�
7�#_���)��*�3[�3��n��3�3�	�$�3e�+���2p�X��e�3P�7,������������~���1Cj�����[T�B&V�WNh�/�3
�3J$��3�3�3�����<�j0�3�3�3�3�3�3����&?-��%�2��2��'����*�����3�$��(/���Z��'f�!�
&���*�./}��*���2��)����	M
]�![�!Y�W���$��&�� � a!��������1�%�33
,d|)ph� �5��
v��`iI�ȲY]8#I1y����
v�[o,0�������ɲ3�0"2#��ܥm�����f��,���5l�`���D��2PƧNn R�39'� $�Q�{�z����'���(�!*��'�
�~��l)-T"O���k$���),h3�Mk��
���!� {�D���F�A�@�%B���<�8">��8�;�3o�/%%�����i��s0P�U��1=O�N���K�J��~l��
M����� �G$W�+�e�������f����]��1�[����F��0&
�0+��%��"M>#��1���*�,�!fM+���0ko�+l*p����o`�+��b!���1�3�2�&n	��`k 4�X�l���	�2m��ɦ���	���#��w+�3
=�2^k~o0'd"/.������x�>1��G�)u�������0!-�)nk�������d����������{���%ڢ��_� ����K�����S"�249pY1F2��8�6G��2�o�&f�Y`>�F��)�)�0l"b�!�9����N	�B��'������QoZ��<�%���3�����2�`)��/�Y��d�, ��$�l��ܫl=�9*�+���K2�3<�?�� ��'�
qr���o�\�]�\�$yI����
7!C�7�A�E�Z ).�����1���h�.��0�%��@�ho%"��6I����C�w*��o-Q�/X`���'�d��j��2H�2��^�2!�2�iy��2$A��!��@���fo����Mq��LJ:IW"E��'�S�r3��J')�i����`���Bh�3`��#��3H�*�3��3�3�3�3)o4-�z3.��3���+���Z,wo+�%�5��3�3��2�
���e�b�c�N��a���J)������أ����}T����6]1�3@%�K �/<�#�ױ�E.�p��t�y�:�3,
�3�2ۤ4#"�/=������/1B�%�3-+�$k������$Ĩ'�p�w��3%.��3�
C#�b%�$�'�&��2��*�����Wo�'i��S�{ou� )'�V
is�q��D�r�-qt��3���������V�Uo�
K#����
so0o���������I�� [+H�w3�3@��#)��*,�l��3���"��+<='�31+�3��5�,��,��3�����q�$8����36�5��(J!����=��$���K3�(Z"�-]�O� v3� �3�=	�4f��c�9�Ӡu3���2��1��3�3;���3�3�3.�-��M�=2�3AjHS�j�3�3�1t��0�.���3���?��(�=�!h��y v�u ���3�3mQ P�G��3��3�3�3z��rC�3�����~B��3�%Ojv�t��!^ `�-��3 � ��3�3!"�P$���B�&���)�����G+����*��@��b�ˠ�+�,Y��3��/��-���$��3�3���T���2�
�
�����D
���&I�!-�;�*u-�),`o(Lg����
���j!����������!r���(����3���C�M#'b���D�e�S�����n���s�C���������C_\�j�o5�57��
(�� ��������e��� ��tj�+\ R'��v�����)���	��	����$+"���n'i*i]�*�4D���iC���p1�-�Ũ���,'��~3!�$�3�3-,�!�3"�,��3n���n"$2���3(�n�3�/�f#��/j`���&���y!1hD���+&m�3v�
����*�'���*�"� A$�
�e$w��(���3�3���W0S0�(R���b(��3
�>�������A'�'
7jP�{s3��3)h]9"�2t)j�h�D\"q�e�+2�,xw���Y����������(� &V�x��%$�
"�.��Y���[2�`���hp~(��#L�:&:��!�s�jiP�$"hP��s/@#J��!�#"�����]�&) ��(����������:4�6)�"�uL�r�k�-%�,���0w%�=������	�,D�16� #�^h\�m
���n���0�9k�?Ux�Z��1��3��w��!m$3�+)i��..&�-�l�ȱr�o�)�t���q�&,=�y���;E�h#,�h5j]k����,�8�0���!���%��B,������i�
�&�������1O���c����O.�)����k3������,`X�!�s��" �h3����id&�$b��vEuE��#B� �/�}��	�KtEF"��Ldj��A1w�G�9��#u��/���-�%��r�"N�1�5��N%
����0������%;#B�������s#��>�
���#GI����yG!��d�f3+�$b�Y��f��!����
�	���U,�,��!�����
������M�Oh�����������������������2%<%�j$�����������.���>�v�˫�"u�2����E�����|%U ��m���������S1c�'�$,)"��ڈ���
����� _"6�l�
$%/V*�i`�M'��)����1��*�ۈވ݈������Јψ@�(��L���.���4�zi�2ʈɈ̈ˈΈ͈�Y"��ӈ҈3
�I؈�٩^�)!�j3$�cE�5I�hM���AZ*��JFL�&� 	��o&/q�����A���+s����P��!��!�$#D��;��4����. 3�*��3�33
3�333c"��!33{�,�333�	���
�&��t)3;o;K��{��	Bo��Mx� �#4o$  3	'F�'3(3%3&3#3$3!3_	�h"���e'
0313,3.3*3��h<+s$.$�#Q^/��������o%#
�1$$���+Vi�
{���}&P#���:1 	�/5,��,�*�/
�����&��/=�n��(�	�*�$����X���D _�,����3Y���h�DZj%��]�!�c��|�����������)=��.!
��)�")<0�!O%������% �����^+�]�1?�'�/�
����c3���&�1��1i3h3g3"����i&Y�S�%�0��S}�H���X3��%4���	�.�x��!�!��Yh�"h31��Lm3H�#�"~�v*m!.+8=��
���%���&��"H&(����:
JN����W�I����/=��$j���3Y��&�����i�����*I��0=�%�(.~�}��$�,ax�x$����v��b�
�dn,w�
$a*�u�O"t�y}�f
���1$����-&�KN"��Be�ceK
�ADk�n�%?�aq����$G�
�|!w�H0@/��������f���11?�����	"��A3������*o�
_�P���`������h��l����/�\	6���� ���9�cE��^Ewi [�-V!���1� 	��"1��D'�[���7�M�ut3'�^��$�2��#>'�% �ު�2���I�K�������.Ĥ�����o(0�!oi)g h
i!3���d��h�%���"$kS�p��"]�iE������t�&$��n�h�+k���@l)�?���+���% �/����k����k
�����0
~3��C)8�X�N�=�h��`��*j�5�V�F��/�9M�8A7K���J�x#+I,�v:;P��.��P��(�i���ť�!x�����o���R���{3z3�$�m������+�$'_�{r����.���.���
�!��3^��
ģ7a��ũM��w0H��� ��X~�|0z0�x0y0M������}�q�'��H.~���v��Yk�96�9��v���~
,�+N!v��f>k�)�$w�0�0�qE�3�0�����0�0W���0{��0�#�0�0�0�0�� ��1x�r�y�-�A��^(��>(?0�E=�;� ��E����� �i�0M
����+i�$M%�������$��������(v&n(���0C%�0�0��0�0�0�0��� *0��O
�5
��$��'c2#�@%�O�=b!��(��#:'1��+����kE2���������$
 ���*��	
	
ax�
39���i�/%%���������*�B		��=��% �����M��â�@Nj�%��k��r�A�%�c�S)p!3��M �<�	 � ���-���P��� $�"o�r@2F�9J1�-DFT�# ���8�j�;F3F��بq��G��r���U����F�+��v� ���M%�����s�ǫ���*=%�d��@i��4"%����2�3k�"+[�������
�&A�b��-f7�1��,{ c##�]#٫��c����6��������1!+3R��+m�33���I� �30F
�MD=D���)9D��*Fp3��'@���)D�m,�#��1��G#

��1� �.a#4�7$"�`3��31��
5P��`�H���13��G����.F�*_�(�t��Qo����/51\����m���� ���Zx�k 	��ME�'"�*ʢ�MϢ<�ˢ�1**���3�i2��-���Q�Ңݢ�0�0�R��k�!2!�]�/"�����_����S� 3	v/��0�0�	�0�0$�!%,�0�0�0�&�0���0�0��0Rh
�0�0�0G.1)�*+��E���h'<! �����i&P��/3^�����o��0�0�0�0
�0�$��Ǣ#��Ģ�ɢ�,�j,<��Z�8Z��X��.���!�!c�!g�f$B;��Ţ���F!G*h���-	&�ҫ����
0Ұ�а��� �$"".���P�hY�����Φ�3e���#����#h�i�j�k��Nf�g�`�a�b��ݡ�^�_�S�-!_�s(�()!0]P�$	�!7!ESn��#T!b�"���(EY��0[��&U�V�W�H3R�S�K!N!IE!F�A!c�
L�Qi�$��%�����H�$3��S� &������%�2�2s�g�e��T�-�e�|�'f��$�Sg�6�@1<��!�%$1���W!�1�����!J���^X)�!�7b2-�,"��"o�Y�&~h���!b��8�7*"M<kb��� "#��">"]�$�C�ʦ�L"Q2l
Ci���	:i?i-�����Jf*""#��3t
�;��7�h$��.`���%!!!�3!?�Io}7o,!!1!0!9�0
�!���O�a�'0���������3a%�"�ŧ�o��������V 
-Hi�&Mo�]�������"O�W����H�S��"o:0T���#!�"�;
2,���eb���S"7���6���3�h�*���"&#��v�#"��2##����7%S���2[Wn&��Kh��6���(�V)��",U!���9�8��$/�.�-�,�+��)�(�7�6�5�4�3�2�1�����e�Y���\�&��$�
"�!�Z���Zn�
�*���2�'!�1�/>�������)�"?�lD�)g��a2<�	��h�cD�
�,
t�-0�&>�� _�ݪ�S'#��
;0"�&�4��"r�w/:����>�,/DfH��,��A�
�D�G��'T���v
�)D���/���9"}D��/i�.��
�A��rro�uD�qD����#$D������
����bD��]Dr2�
�t�*��
�'��S��!9� �a���{$i
!��2������D�p����=��
�bj�L�z�!���2$.
#��
�-��g��5�2�$VX�B*�DL�G2�
��^�����t� q�; �Dj����eib����3��m.�h�D�p	�{�
 �D�C!�D�DQ!Vn�   w��"�1��JI 7���&��(Qh�������� �$46!�z���+�V��2n$�D��4���!�	�

���4�eQD���������%o���%�Q2��r 3#$�|���-���z �
�U���!�X�@j"�� V���-�%��a1�0�3�o+%�$��&&�)�+�*���8*Re�->��
� ,�����+0��2H�X!���2�2DD0D����.#!B�q!|o�u��>J"�;�
�D�� N,l�
o�o".��)��� �0���`�^w�f���lgm�n�o���pc0%h�di��ej�kdS�0��E.!��%Wk|"�;��q���+�<}"z`�i"}���l�"{�{"��+J �o�2�#o37��iGUl#b
�2[
�	X�����t���"��! ��$�+�W	Fnoh�
j�b0�1����tA��
	���l��&�_�=4-'�&F,�|��,�(�>!
�iI��)�/���&����	��!i�)J��x��"�9jVm"*��/�\b/h�� f�d�}#)b$C/Kl@���.�9����$���cAt&^Xa��+���4�w��3��ڰԫ$�X;":1��i21PU��C�6���2��,�3"�z+'Kj�i+*�YA0#�iE*"$����j��%�"���*�;&5
��K#��j�"0����1� ��y#������D:Z�`��T�R�
b�i],h�D�^&N�GL�J�{&�Q�c#O�P�ע��"��'�~�,��Ee|��#�բ)&ԢQ��-8�(
R.#����8��s����
#�����T�V+��Yij ����*^o)���
���*
�$�kaFA "��/f�c�O&7�+��*�/$���o�+M!�h��ieobo(��
�,H���G�$�
bc��*C
��D����
3�K�&�Uh�
���Z�@o�11"xi�J���t,��1�V�$�����������y!�,2��������$����3�3�3����3�31w��3�3.
�3� �,�o���y�(�5�z2
%��������(&����������'����)�����* ��
��'���o�*�
 �����#�*t���*߈Th��.�2���W����
��-��I#O"+H��1./
/#����im' Ԉk��N�F�P��)�(!0>o.�%w$22���|+�/)�"'�P
�3���8
5m�l������0
�S$�����|*Bi�N6/@5�
���n�"��

.��;3����;����F�>�+�I�+%8�?�I+�%��0��*d!!�(�b c +��i$
M�Y	��A.������!��}���	]��T$��F�����߉�,��^o�������"��������!�)�(�Ϩ\#�� $T)�����"�l1�/6�
�.)
�
i@���2�
�����R,/؉
i#3Չ܉2�N�E$��	�	y�"3��P����t�������3�b��=O��5�E#�1	���������/*1:+���).��
�=�/�������A3=�
��Oj#����#ʉ���B3���!����R�p�����"�����������2���W�����8!��w���V���:#[j����!�jx�*��ڊ�܊����0���
<�i�Gj���Ai.&����
!!{�v���h�y�!F���!
M/)2v�!&2���^
��B���$2#2"2!2 2�
�_������Ii�T�3�yo�,]i��.Wi�[h)x#9
���!�x��
���+��}h
��-'~�2����?���lk5�
���7�6��b8�%�(�Z�$�,
�&�M�a�-#��(��&�����3�<��	Z	
U�2$1���.X�9 ���6$&
�!�����ci��y���-3��'2�	��<�?+�$U<1;1_'�.��Ji�����"%B���b����;��n)q$Ek$�"]��D+m_�F Xs��MW�@�t���~")נi�f���j$tsrqp�Z/.i�ȫ�[i�\B#~�uL������������
�"�����1I�On��+K'�'&���@�G�"�&|�{�~�`��r�q�t�*v�
<�w�r)&�-p�	2������7�]-Q;1�d+�
���P�#���"s�j`�L��U����C�#b��9
��l�jI
��%�!�M��2�$�(���,�#*2C�����`�1202/2.2-2,2+2g$��8�%��!�|�.�-��r�
����52����
�!�"��'���d*���h��3��a$O�1�.g8�"(42hR!mNg�2
�����z�'-V���.
��
�M�Mo�������)��3�3�����)~�������������Hb�F�B�K�2�+k*Ki(�(��Ť�%��Kn�&����]n`��[&�/���Y(�(#���}+S�f!�g��d��V3�R}�=%��&9y�1�;�7)�)���h�&
���!B�8��
l�3�s�"j�
x2�n
�,�]�>���mP"��m$�	,
��h
��$����t�"�B%����z��)K$���������&
��m�
����@���+b������0i���V3�	W�Hj����.�����)0#��/���-��
H'+�8��+
35
�1��1����.)����!��aiP���b�{I"T��"Q	k"i+�R/����ha�����O+��xi��%B�����m�j�thn�)�� ��"�!�(�rW�����t�� ���c3�+ �?/Z#/
e���kpi '���><qg/p�j3�XPh���v����'�����x��'��g���"�������$��!X��?�����W DW)P���j#+$I�~����!6'�x%��������2��h�c%�2���(
�u��
� ��6��436O�0'.�"�!h%
@"���q� ����{h�+�)('���h�#c��9*
u\�C�"! �0��3A����}B�]�L/d��P�B��ʊɊ�j�Ί����^������C$�'�Q��0
Պ`��2�2֊E�"
�)�'	�������T&l0�j&������{_ ϊ�S�W�����!���(?2*l	2%Ob�Ê8
�)>��!$�k���&i�Y��:������	��V�iY�$
��� ��%�yv+�wg

� ���E����
g"��x ~��.�->%��i+z������ zӢ� �"����7������?�٨��`����-`�
��$��e�D3[���->����0a�3| B���'
���)i���*0h�M1#g!���I��3�3/&J������4�ji(D���
.��^
�
��~��}����������D1������< l�S1�Q1R1�P1L1N1QVU1.Ll2�"�EU�P[3���$l�R������"(/Xh���;/AF#�T����� E@]1_1[1\1?Z1V1B���*��?>�0
��2��.��	!)��Q�n(Q���~�*}�-������c!�����6�#W1��0�"�O2��5�����Q*��,�$���M�	)��F�
c�

��+���/���|5zs�x�1M�1	&��"�����(��թ��y�} �!O,v(�(�H���1P,�1o�"m�k��rT$�$��Fh�s��W�!#����;#������
*��k�c$a�Q�;��!�g���֩���I'��)�Y�#<!�F�h���H #
��}����o|�E�&
L��!�l�ilh,k����(25<�;�D�'�%,������d
N���������!�!57���
Щ0�:k��,x3�2 Y%� K���N��,E=�!<��0�:���	�,*���	0�ɩ���=#k}�hU���)B��M��Ip�e)�- $���-��+� M"�#H�jNJ��$�N���d�á�����
%	��������S��*aW5�S�Y[%��Y��c1NIL
��R+�D)S3,
!�#�-�q��yM%��(��u�
a�m1j1l1�$&)��*��I��$��*�q-�[#0������.�#��"d18����{"z�t1p1q1n1o1���$�)�x1y1�e�!�0]10_��1D��H%�o�������Y��� ��{�$)y�z�w�x���-.�&}1~1��|1��/6�<?/|���2�������i�!��a0������_Y�K�/71;���1j���$r"�k���l���%�y,��ϫ#�	7�U��Z���/���,c
*��.�/��X-�3��Ԧ�kZ&z��y���.����h����P;�1�N�|�E�����Q��AQ��S%Ck:,PkXp�)�/�K�.@S�a�}`cr��� ��u#h	��+�9:�ȥ�K"@�p��\�*�i��M�`�����2l�y*�b��/j�fx�i��,s���
����2yR��Tf,��O�.!qc�n���r�.�uv#�:��t�3&�p�K�xg�s��73h!q�u�I�"����F��&t	�������$b��������������J�i��C���'������9�������m��h/%���nfj�%��.��%����!�+�=h�}�� �>�k3���0��	*Q�
e3|�#��R��2�O�/��[��P�Z�!2�\jm�L���@��qn�0O�	�&�bnrn���/*Da>	9��!�un`�|n��2�rB=0� ����]��,��3f�.�?�-��-'��������v����4"ޢ	��h5�����g�E3���ug���������W�,�'��F�
�,/����[��$_*^�8\	*\�����i7��Ah�װۢ4%�ܰG۰ذٰ�X@��EC3^*b!�I��%.�$Q��]#&����;0|�2��oiӫ���	g6tks��Mi�*�1%19��1��c�����"���������j����������l$���>2��d�}�_�b����3��h��� R��
�	@�*>����?�J+��p1z�9��7��+��+/���7e"7/k��',C���f�f�(��g
���'4��U���;�<*��0��D�$�����p�p��c3�n�(!�m�0-!�!\(t3�(
�&��G�����S��#�#!�CR�"V6^"R�hx��q(�(u�� 2��!���)E�&���F�j����.N�Q�-��?�_&a���!M���#�����!^��b#)!Qu`*�f�����
�3����,���+o
���8�&����V�BU/@�A�,)C�g#�0a2��!�X�Z��Ԥb�c���3�fD�1��ia��$e�`���be���w��o:!��	�~yxiD��a��+z��}u!�	"���1_��1r
�.�
X��o�l��#����
J#|2�G�k��1����l
�#�����J��i��w��U�g����	e���7k�� q/� �
�?h?+�n �2E
u1�%�/�/�(�i��"��\��;o��h�!���i�2�i��u����s�r�hn."cnxnnen��j`n}ngnz)
an'.�W ��o�_��R��$onjnin�kn2lnq<1pn�B����"�\!�,3j��l!���jF����j���
���Zh�
2��g���d8�!3s"	����/��c��o0E&N+�(����
��
��\����(��������L@?��(%�$���/7c(�R�T1x,E���J����&�"x1�3G����*��F�N�I�h�1� �4k��� �0����-�o'T��#%�,�*�!���D� l��2�����DM����M���%���EO
�/����1�gEK")O���O;h�D���&P D�z����&�(�#N�	;�R��Q���C������G3�sT�����eq�o���q��Ck��(���"�W��m% rB�-�0�����"���DC~�^������	jc�#	���s%H�l �3/!u�C����"+	#q�pi�0���+���5���M.b�/6����o�	�96j�-p+��~�������$���
H.-���� ��%�����Dn�$ v�.:
�X8���"�n��h�A,%��b-���d��Ʋ��	?O���
�
�#����	}!9��Ʀ��">*"�~�V�|�7�=Ӧi�k�"��y�5��i{�!�Y$���Mt������g�f�i�"���aE2"$o�R��$T�l�N��j"��	V�A�U��L��Z����EH�s�	^�4!���B��	���L &X�����y�Ei��B
NO�`��1/+����#�"������<��*���
�0���.��	Y*��#%��#�E�I.�0��������.}���	�������<���J�:�p	��) 4�r
�0�D�I�X���tN
]����h-o�����%�y#*�u�N����)f�N$��'b��
j"C�c���y2��"�����
�L�B��*�h��.$���3�
�1w�~!co��&���h=+�/����	�B-q����>-��'�i�H-!���
W��s9����p2	�	�'���U%T�F*�v����q1��"��6��4?.8��$���#������3�Q��	#��L"���"��p
�Y��+�)�j��g1�0f1?&e1��5���2�2���2�������2�2�2��2�2��-�2���2�)��	�
��	��\3���2
$
*��������h��	���"�"����1���'�"q������ �������"����w1S+�
���]�'��Q�_n����2L*���
�+�M#�����"���"R�z��,L{�v�u�x��.r�q�t�s�n�m�Eo���)����,������~�}�������K�9�*+3�:#�!4�1,1�K
2�l�j5�5 z�i
��:GX�E#�����0���l/|1��F�8���=�,3���,�i"6�Ӥ6�Z������� �[�%�g���Y1����$6�T�/��g�C#<��,�!u,!#\9E���!%�;���]��&��Z��#�:-H#��
������������!��v�moz1�����'�d#��,� x)�!
L������������&��J���_"��������E���	�,J1F1n�?�C1}�B14�A1Q�@
��b������p�y�z���r�@E#i��>E�
#��!����,.����L�a
����2����|�'@u�.%�:���#��������1����
�b!w��2��2�2�2�2�2�2J ��4')z
��}
�h�����"�O�P�N�S�
Q��,W�X�V�*�)FBT���J�\�*M���K��2�2�2�2��2�2�2�
d�a����2��S1/��;/������K�^'N�����A2� LETTE�SIG�WIT�SMAL�SYLLABL�CAPITA�HIEROGLYP�LATI�ARABI�CUNEIFOR�Y�CJ�MATHEMATICA�EGYPTIA�COMPATIBILIT�SYMBO�DIGI�VOWE�TANGU�FORM�CANADIA�SYLLABIC�SIGNWRITIN�TIME�BAMU�AN�BOL�ANATOLIA�HANGU�LINEA�NUMBE�GREE�LIGATUR�MUSICA�ETHIOPI�FO�COMBININ�CYRILLI�ITALI�TAMI�NUSH�RADICA�SANS-SERI�CIRCLE�SQUAR�FINA�TA�LEF�ARROW�DOUBL�RIGH�VA�SIGN�HENTAIGAN�ABOVE�BLAC�WHIT�BELOW�ARRO�VARIATIO�A�BRAILL�PATTER�U�BYZANTIN�I�ISOLATE�KATAKAN�O�MODIFIE��MYANMA�DO�O�MARK�KANGX�KIKAKU�MEND�TIBETA�VERTICA�INITIA�HEAV�HMON�MEE�COPTI�KHME�ABOV�RIGHTWARD�CARRIE�YE�GEORGIA�CHEROKE�MONGOLIA�ON�PLU�TW�ONE�DEVANAGAR�TWO�SQUARE�PHASE-�SYMBOL�STROKE�LEFTWARD�CONSONAN�MIA�VOCALI�BO�MIDDL�TIL�DUPLOYA�THRE�JONGSEON�MAR�PARENTHESIZE�THA�GOND�HOOK�HEBRE�U�GLAGOLITI�LO�OVE�SIYA�DRAWING�HIG�MALAYALA�INDE�PAHAW�THREE�DOW�FOUR�CHOSEON�HALFWIDT�HAND-FIS�MEROITI�BALINES�HA�IDEOGRAPHI�SCRIP�FIVE�IDEOGRA�PHASE-�TO�ALCHEMICA�ALE�TON�SINHAL�BAR�KA�NUMERI�HAL�BRAHM�HUNGARIA�PA�THUM�TURNE�YA�BAR�MA�SIX�HA�RA�THOUSAND�EIGHT�LA�NORT�FULLWIDT�LIGH�NA�SEVEN�BRACKET�EQUA�LON�NINE�SA�TA�DOMIN�ACUTE�FRAKTU�HIRAGAN�TA�CHARACTE�FRACTIO�OPE�PHASE-�TELUG�ZZYX�ZZYT�ZZYRX�ZZYR�ZZYP�ZZYA�ZZY�ZZUX�ZZURX�ZZUR�ZZUP�ZZU�ZZSYA�ZZSA�ZZOX�ZZOP�ZZO�ZZIX�ZZIT�ZZIP�ZZIEX�ZZIET�ZZIEP�ZZIE�ZZI�ZZEX�ZZEP�ZZEE�ZZE�ZZAX�ZZAT�ZZAP�ZZAA�ZZA�ZYGOS�ZWSP�ZWNJ�ZWNBSP�ZWJ�ZW�ZWARAKAY�ZWA�ZUT�ZUOX�ZUOP�ZUO�ZUM�ZUBUR�ZU5�ZU�Z�ZSHA�ZRA�ZQAPH�ZOT�ZOO�ZOMBIE�ZOA�ZLAM�ZLA�ZL�ZJE�ZIZ2�ZIQAA�ZIPPER-MOUT�ZINOR�ZILDE�ZIGZA�ZIG�ZID�ZIB�ZI�ZI3�Z�ZHYX�ZHYT�ZHYRX�ZHYR�ZHYP�ZHY�ZHWE�ZHWA�ZHUX�ZHUT�ZHURX�ZHUR�ZHUP�ZHUOX�ZHUOP�ZHUO�ZHU�ZHOX�ZHOT�ZHOP�ZHOO�ZHOI�ZHO�ZHIVETE�ZHIL�ZHI�ZHEX�ZHET�ZHEP�ZHEE�ZHE�ZH�ZHAYIN�ZHAX�ZHAT�ZHAR�ZHAP�ZHAIN�ZHAA�ZHA�ZH�ZEUS�ZETA�ZERO�ZER�ZEN�ZEMLYA�ZEMLJA�ZEBR�ZE2�Z�ZAYN�ZAYIN-YODH�ZAYIN�ZAYI�ZAVIYANI�ZATA�ZARQA�ZARL�ZAQE�ZANABAZA�ZAMX�ZAL�ZA�ZAIN�ZAI�ZAI�ZAH�ZA�ZAG�ZAEF�ZA7�Z�Z016H�Z016G�Z016F�Z016E�Z016D�Z016C�Z016B�Z016A�Z016�Z015I�Z015H�Z015G�Z015F�Z015E�Z015D�Z015C�Z015B�Z015A�Z015�Z014�Z013�Z012�Z011�Z010�Z009�Z008�Z007�Z006�Z005A�Z005�Z004A�Z004�Z003B�Z003A�Z003�Z002D�Z002C�Z002B�Z002A�Z002�Z001�Z��YYX�YYT�YYRX�YYR�YYP�YYE�YYAA�YYA�YY�YWOO�YWO�YWII�YWI�YWE�YWAA�YWA�YV�YUX�YUWOQ�YUUKALEAPINTU�YUU�YUT�YUS�YU�YURX�YUR�YUQ�YU�YUP�YUOX�YUOT�YUOP�YUOM�YUO�YUN�YUM�YUJ�YUI�YUEQ�YUE�YUDH�YUD�YUAN�YUAEN�YU-YEO�YU-YE�YU-U�YU-O�YU-I�YU-EO�YU-E�YU-AE�YU-A�YU-4�YU-3�YU-2�YU-1�YU�Y�YRY�YPSILI�YPORROI�YPOKRISIS�YPOKRISI�YPOGEGRAMMENI�YOY�YOX�YOWD�YOUTHFULNESS�YOUTHFU�YO�YOT�YORI�YOQ�YO�YOP�YOO�YOMO�YOGH�YOD�YO�YOA�YO-YO�YO-YEO�YO-YAE�YO-YA�YO-O�YO-I�YO-EO�YO-AE�YO-A�YO-6�YO-5�YO-4�YO-3�YO-2�YO-1�Y�YIZET�YIX�YIWN�YIT�YIP�YING�YII�YIH�YI�YIEX�YIET�YIEP�YIEE�YIE�YIDDIS�YI-U�YI�YHE�YFESIS�YFESI�YFE�YEY�YEW�YEUX�YEURAE�YEUQ�YEUM�YEUAET�YEUAE�YETIV�YESTU�YESIEUNG-SSANGKIYEOK�YESIEUNG-SIOS�YESIEUNG-PANSIOS�YESIEUNG-MIEUM�YESIEUNG-KIYEOK�YESIEUNG-KHIEUKH�YESIEUNG-HIEUH�YESIEUNG�YERU�YER�YERI�YERA�YER�YEORINHIEUH�YEO-YA�YEO-U�YEO-O�YENISE�YENAP�YEN�YE�YELLOW�YELLO�YEIN�YEH�YEEG�YEE�YEA�YEA�YAZZ�YAZH�YAZ�YAYD�YAYANNA�YAY�YAWNIN�YAWN�YAW�YAV�YAU�YATT�YATI�YATH�YAT�YASS�YASH�YAS�YARR�YARN�YAR�YA�YAQ�YAP�YANSAYA�YANG�YAN�YAN�YAMOK�YAMAKKAN�YAM�YAL�YAKHH�YAKH�YAKASH�YAK�YAJURVEDI�YAJ�YAI�YAHH�YAH�YAGN�YAGHH�YAGH�YAG�YAF�YAF�YAEMMAE�YADH�YADDH�YADD�YAD�YACH�YABH�YAB�YAARU�YAAI�YAADO�YA-YO�YA-U�YA-O�YA-5�YA-4�YA-3�YA-2�YA-1�Y008�Y007�Y006�Y005�Y004�Y003�Y002�Y001A�Y001�Y-CRE�XYX�XYU�XYT�XYRX�XYR�XYP�XYOOJ�XYOO�XYO�XYI�XYEE�XYEE�XYE�XYAA�XYA�XY�XWI�XWEE�XWE�XWAA�XWA�XW�X�XVE�XVA�XUOX�XUO�XU�XSHAAYATHIYA�XOX�XOT�XOR�XOPH�XOP�XOA�XO�XIX�XIT�XIRO�XIP�XIEX�XIET�XIEP�XIE�XIANGQ�XIAB�XI�XG�XEYN�XESTE�XEH�XEE�XE�XAUS�XAU�XAPH�XAN�XAA�XA�X008A�X008�X007�X006A�X006�X005�X004B�X004A�X004�X003�X002�X001�X-�WZ�WYNN�WYN�WVI�WVE�WVA�WV�WUP�WUOX�WUOP�WUO�WUNJ�WUN�WULU�WUL�WUI�WUE�WUAET�WUAEN�WU�WR�WRONG�WRIS�WRINKLES�WRINKLE�WRINKLED�WRESTLERS�WRENCH�WREAT�WRAPPE�WRAP�WOX�WOW�WORSHIP�WORRIE�WORL�WORKER�WORK�WOR�WORDSPACE�WOR�WOP�WOON�WOOL�WOODS-CRE�WOOD�WON�WO�WOMEN�WOME�WOMAN�WOMAN�WOMA�WOLOSO�WOL�WOE�WOA�WO-7�WO-6�WO-5�WO-4�WO-3�WO-2�WO-1�WITHOU�WITHIN�WITHI�WIRE�WINTER�WINKIN�WINK�WINJA�WINGS�WINE�WIN�WINDU�WINDOW�WIND�WIN�WIN�WILTE�WIGNYAN�WIGGL�WIGGLES�WIDTH�WIDENIN�WIDE-HEADE�WID�WIANGWAAK�WIANG�WI-5�WI-4�WI-3�WI-2�WI-1�WHOL�WHITE-FEATHERE�WHITE�WHEELE�WHEELCHAIR�WHEELCHAI�WHEEL�WHEE�WHEAT�WHALE�WH�WG�WEX�WEUX�WE�WESTER�WEST-CRE�WEST�WES�WEP�WEO�WEN�WELL�WEIGH�WEIERSTRAS�WEI�WEEN�WEDGE-TAILE�WEDGE�WEDDING�WEB�WEAR�WEAPON�WE-4�WE-3�WE-2�WE-1�WC�WB�WAY�WA�WAXIN�WAX�WAW-AYIN-RESH�WAW�WA�WAV�WAVIN�WAVES�WAVE�WAV�WAU�WATTO�WATERMELON�WATER�WATE�WATCH�WAT�WASTING�WASTEBASKET�WASSALLAM�WASLA�WASL�WASALLAM�WASALLA�WARNIN�WARAN�WAQFA�WAP�WANIN�WANGKUOQ�WANDERER�WANCH�WAN�WALLPLAN�WALL�WAL�WALK�WAL�WAITING�WAIST�WAI�WAFFLE�WAEN�WAE�WADDA�WAAVU�WA-5�WA-4�WA-3�WA-2�WA-1�W025�W024A�W024�W023�W022�W021�W020�W019�W018A�W018�W017A�W017�W016�W015�W014A�W014�W013�W012�W011�W010A�W010�W009A�W009�W008�W007�W006�W005�W004�W003A�W003�W002�W001�VZMET�VYX�VYT�VYRX�VYR�VYP�VY�VWJ�VWA�VW�VUX�VUU�VUT�VURX�VUR�VUP�VULGA�VULCANUS�VUEQ�VTS�VT�VS99�VS98�VS97�VS96�VS95�VS94�VS93�VS92�VS91�VS90�VS9�VS89�VS88�VS87�VS86�VS85�VS84�VS83�VS82�VS81�VS80�VS8�VS79�VS78�VS77�VS76�VS75�VS74�VS73�VS72�VS71�VS70�VS7�VS69�VS68�VS67�VS66�VS65�VS64�VS63�VS62�VS61�VS60�VS6�VS59�VS58�VS57�VS56�VS55�VS54�VS53�VS52�VS51�VS50�VS5�VS49�VS48�VS47�VS46�VS45�VS44�VS43�VS42�VS41�VS40�VS4�VS39�VS38�VS37�VS36�VS35�VS34�VS33�VS32�VS31�VS30�VS3�VS29�VS28�VS27�VS26�VS256�VS255�VS254�VS253�VS252�VS251�VS250�VS25�VS249�VS248�VS247�VS246�VS245�VS244�VS243�VS242�VS241�VS240�VS24�VS239�VS238�VS237�VS236�VS235�VS234�VS233�VS232�VS231�VS230�VS23�VS229�VS228�VS227�VS226�VS225�VS224�VS223�VS222�VS221�VS220�VS22�VS219�VS218�VS217�VS216�VS215�VS214�VS213�VS212�VS211�VS210�VS21�VS209�VS208�VS207�VS206�VS205�VS204�VS203�VS202�VS201�VS200�VS20�VS2�VS199�VS198�VS197�VS196�VS195�VS194�VS193�VS192�VS191�VS190�VS19�VS189�VS188�VS187�VS186�VS185�VS184�VS183�VS182�VS181�VS180�VS18�VS179�VS178�VS177�VS176�VS175�VS174�VS173�VS172�VS171�VS170�VS17�VS169�VS168�VS167�VS166�VS165�VS164�VS163�VS162�VS161�VS160�VS16�VS159�VS158�VS157�VS156�VS155�VS154�VS153�VS152�VS151�VS150�VS15�VS149�VS148�VS147�VS146�VS145�VS144�VS143�VS142�VS141�VS140�VS14�VS139�VS138�VS137�VS136�VS135�VS134�VS133�VS132�VS131�VS130�VS13�VS129�VS128�VS127�VS126�VS125�VS124�VS123�VS122�VS121�VS120�VS12�VS119�VS118�VS117�VS116�VS115�VS114�VS113�VS112�VS111�VS110�VS11�VS109�VS108�VS107�VS106�VS105�VS104�VS103�VS102�VS101�VS100�VS10�VS1�VS�VRACHY�VOX�VOWEL-CARRIE�VOW�VOU�VOT�VO�VOP�VOOI�VOO�VOMITING�VOM�VOLUM�VOLTAG�VOLLEYBALL�VOLCANO�VOLAPU�VOI�VOICING�VOICELES�VOICE�VOD�VOCALIZATIO�VOCA�VO�VIYO�VIX�VITRIOL-2�VITRIOL�VITAE-2�VITAE�VIT�VISIGOTHI�VISARGAYA�VISARGA�VISARG�VIRIAM�VIRGO�VIRGA�VIRAMA�VIP�VIOLIN�VINEGAR-3�VINEGAR-2�VINEGAR�VINEGA�VINE�VIN�VIN�VILLAGE�VII�VIGINTILE�VIEX�VIEWIN�VIEWDAT�VIET�VIE�VIEP�VIE�VIDJ-2�VIDJ�VIDEOCASSETTE�VIDE�VIDA�VICTOR�VIBRATIO�VHA�VFA�VEYZ�VEX�VEW�VE�VEUX�VEUM�VEUAEPEN�VEUAE�VESTA�VEST�VESSE�VER�VERTICALLY�VERTICALL�VERTICAL-06-06�VERTICAL-06-05�VERTICAL-06-04�VERTICAL-06-03�VERTICAL-06-02�VERTICAL-06-01�VERTICAL-06-00�VERTICAL-05-06�VERTICAL-05-05�VERTICAL-05-04�VERTICAL-05-03�VERTICAL-05-02�VERTICAL-05-01�VERTICAL-05-00�VERTICAL-04-06�VERTICAL-04-05�VERTICAL-04-04�VERTICAL-04-03�VERTICAL-04-02�VERTICAL-04-01�VERTICAL-04-00�VERTICAL-03-06�VERTICAL-03-05�VERTICAL-03-04�VERTICAL-03-03�VERTICAL-03-02�VERTICAL-03-01�VERTICAL-03-00�VERTICAL-02-06�VERTICAL-02-05�VERTICAL-02-04�VERTICAL-02-03�VERTICAL-02-02�VERTICAL-02-01�VERTICAL-02-00�VERTICAL-01-06�VERTICAL-01-05�VERTICAL-01-04�VERTICAL-01-03�VERTICAL-01-02�VERTICAL-01-01�VERTICAL-01-00�VERTICAL-00-06�VERTICAL-00-05�VERTICAL-00-04�VERTICAL-00-03�VERTICAL-00-02�VERTICAL-00-01�VERTICAL-00-00�VERTICAL�VERSICLE�VERS�VERGE�VERDIGRIS�VER�VEP�VEND�VELI�VEIL�VEHICLE�VEH�VE�VEE�VE�VEDE�VECTO�VAYANNA�VAX�VAV�VA�VAU�VATHY�VAT�VASTNES�VASIS�VARY�VARIKA�VARIANT�VARIAN�VARIA�VARI�VAREIA�VAREI�VARAAKAN�VAPOURS�VAP�VANE�VAMPIRE�VAMAGOMUKHA�VAMAGOMUKH�VALLEY�VAKAIYARAA�VAJ�VAI�VAH�VA�VAAVU�VAA�V040A�V040�V039�V038�V037A�V037�V036�V035�V034�V033A�V033�V032�V031A�V031�V030A�V030�V029A�V029�V028A�V028�V027�V026�V025�V024�V023A�V023�V022�V021�V020L�V020K�V020J�V020I�V020H�V020G�V020F�V020E�V020D�V020C�V020B�V020A�V020�V019�V018�V017�V016�V015�V014�V013�V012B�V012A�V012�V011C�V011B�V011A�V011�V010�V009�V008�V007B�V007A�V007�V006�V005�V004�V003�V002A�V002�V001I�V001H�V001G�V001F�V001E�V001D�V001C�V001B�V001A�V001�UZU�UZHAKKU�UZ3�UZ�UYANNA�UY�UWU�UUYANNA�UUUU�UUU3�UUU2�UUE�UTUKI�USSU3�USSU�USHX�USHUMX�USHENNA�USH2�USH�US�USE�USE-2�USE-1�USE�US�URU�URUS�URUDA�URUD�URU�UR�URN�URINE�URI3�URI�URANUS�URA�UR4�UR2�UR�UPWARDS�UPWARD�UPWARD�UPWAR�UPTURN�UPSILON�UPSILO�UPSIDE-DOW�UPRIGH�UPPER�UPPE�UPADHMANIYA�UP-POINTIN�UON�UOG�UNN�UNMARRIE�UNKNOWN�UNK�UNIVERSA�UNITY�UNITE�UNIT�UNI�UNION�UNIO�UNIFORM�UNIFIE�UNICOR�UNEVE�UND�UNDERTIE�UNDERLIN�UNDERDOT�UNDERBAR�UNDER�UNDE�UNCI�UNCERTAINT�UNBLENDE�UNASPIRATED�UNAP�UNAMUSE�UNA�U�UMUM�UMU�UMBRELLA�UMBRELL�UMBIN�UKU�UKRAINIA�UKARA�UKAR�UK�UILLEANN�UIGHU�UHD�UGARITI�UEY�UEN�UEI�UEE�UEA�UDUG�UDATTA�UDATT�UDAAT�UD�U�UC�UBUFILI�UBHAYAT�UBADAMA�UB�UATH�UANG�UA�U�U042�U041�U040�U039�U038�U037�U036�U035�U034�U033�U032A�U032�U031�U030�U029A�U029�U028�U027�U026�U025�U024�U023A�U023�U022�U021�U020�U019�U018�U017�U016�U015�U014�U013�U012�U011�U010�U009�U008�U007�U006B�U006A�U006�U005�U004�U003�U002�U001�U-SHAPE�U-I-I�U-EO-EU�U-BRJGU�U-5�TZU�TZOA�TZO�TZI�TZI�TZEE�TZE�TZAA�TZA�TZ�TY�TYPE-�TYPE-6�TYPE-�TYPE-5�TYPE-�TYPE-4�TYPE-�TYPE-3�TYPE-�TYPE-�TYPE-1-2�TYPE-�TYP�TYO�TYI�TYE�TYAY�TYA�TXWV�TXW�TXHEE�TXA�TWOO�TWO-WA�TWO-THIRTY�TWO-LIN�TWO-HEADE�TWO-E�TWO-CIRCL�TWISTING�TWISTE�TWII�TWI�TWENTY-TWO�TWENTY-TW�TWENTY-THREE�TWENTY-SIX�TWENTY-SEVEN�TWENTY-ONE�TWENTY-NINE�TWENTY-FOUR�TWENTY-FIVE�TWENTY-FIV�TWENTY-EIGHT�TWENTY-EIGHT�TWENTY�TWENT�TWENTIETHS�TWENTIETH�TWELVE-THIRTY�TWELVE�TWELV�TWELFTHS�TWELFTH�TWE�TWAA�TWA�TVRIDO�TVIMADU�TUXEDO�TUX�TUUMU�TUU�TUTTY�TUTEYASAT�TUT�TURX�TURU�TURTLE�TURO2�TURNSTILE�TUR�TURKIS�TURKI�TURKEY�TURBAN�TUR�TUPNI�TUP�TUOX�TUOT�TUOP�TUO�TUNNY�TUMETES�TUMBLE�TUMAE�TUM�TU�TULIP�TUKWENTIS�TUK�TUGRI�TUG2�TUG�TUBE�TUB�TUARE�TUAEP�TUAE�TU-TO�TU-4�TU-3�TU-2�TU-1�T�TTUU�TTUDDAG�TTUDDAAG�TTU�TTTHA�TTTA�TTSU�TTSO�TTSI�TTSEE�TTSE�TTSA�TTOO�TTII�TTI�TTHWE�TTHU�TTHOO�TTHO�TTHI�TTHEE�TTHE�TTHAA�TTH�TTEHEH�TTEHE�TTEH�TTE�TTEE�TTAYANNA�TTAU�TTAI�TTAA�TT2�TSWE�TSWB�TSWA�TSV�TSSE�TSSA�TSO�TSIU�TSHUGS�TSHOOK�TSHOO�TSHOOJ�TSHES�TSHEG�TSHE�TSHEEJ�TSHE�TSHA�TSHA�TSERE�TSEEB�TSADI�TSAD�TSAB�TSAADIY�TSAA�TS�T�TRYBLIO�TRUTH�TRUNK�TRUNCATE�TRUMPET�TRUMP-9�TRUMP-8�TRUMP-7�TRUMP-6�TRUMP-5�TRUMP-4�TRUMP-3�TRUMP-21�TRUMP-20�TRUMP-2�TRUMP-19�TRUMP-18�TRUMP-17�TRUMP-16�TRUMP-15�TRUMP-14�TRUMP-13�TRUMP-12�TRUMP-11�TRUMP-10�TRUMP-1�TRUE�TRU�TRUCK�TROPICA�TROPHY�TROMIKOSYNAGMA�TROMIKOPSIFISTON�TROMIKOPARAKALESMA�TROMIKON�TROMIKO�TROMIKOLYGISMA�TROLLEYBUS�TROLLEY�TROKUTAST�TROEZENIA�TRIUMPH�TRITO�TRITIMORION�TRISIMOU�TRISEME�TRIPOD�TRIPLI�TRIPLE�TRIPL�TRIO�TRILLIONS�TRIISAP�TRIGRAMMO�TRIGRA�TRIGORGON�TRIFONIAS�TRIFOLIAT�TRIDENT�TRIDEN�TRICOLON�TRIANGULA�TRIANGLE-ROUN�TRIANGLE-HEADE�TRIANGLE�TRIANGL�TRIA�TRI�TRESILLO�TREND�TREN�TREMOLO-3�TREMOLO-2�TREMOLO-1�TREE�TRE�TREDECILE�TREADING�TRAY�TRAVEL-WALLPLAN�TRAVEL-FLOORPLAN�TRAPEZIUM�TRANSVERSA�TRANSPOSITIO�TRANSPLUTO�TRANSMI�TRANSMISSION�TRANSMISSIO�TRAMWAY�TRAM�TRA�TRAIN�TRAI�TRAILIN�TRAFFIC�TRAFFI�TRADITIONA�TRAD�TRACTOR�TRACKBALL�TRACK�TRA�TR�TOX�TOWER�TOWARD�TOV�TOURNOI�TOUCHTON�TOUCHIN�TOUCHE�TOUC�TOTA�TOT�TOS�TORTOIS�TORSO-WALLPLAN�TORSO-FLOORPLAN�TORSO�TORNADO�TORCULUS�TORCULU�TORCH�TOQ�TOPBAR�TOP-LIGHTE�TOP�TO�TOOTH�TOON�TOOLBOX�TONOS�TONGUE�TONGU�TONG�TONE-V�TONE-S�TONE-M�TONE-J�TONE-G�TONE-D�TONE-B�TONE-8�TONE-7�TONE-6�TONE-5�TONE-4�TONE-3�TONE-2�TONE-1�TONE�TONA�TOMPI�TOMATO�TOLONG�TOKY�TOILET�TOGETHER�TOD�TOANDAKHIAT�TOA�TO-RA�TO-6�TO-5�TO-4�TO-3�TO-2�TO-1�TN�TLV�TLU�TLO�TLI�TLHYA�TLHWE�TLHU�TLHOO�TLHO�TLHI�TLHEE�TLHE�TLHA�TLEE�TLA�TJE�TIX�TIWR�TIWN�TIWA�TITUAEP�TITLO�TITL�TIT�TIT�TIRYAK�TIRT�TIRONIA�TIRHUT�TIRE�TIR�TI�TIPPI�TIPEHA�TIP�TI�TINY�TIN�TINNE�TINCTURE�TINAGMA�TIMES�TIME�TIME�TILTING�TILTIN�TILT�TILES�TILDE�TILD�TIL�TI�TIKEUT-THIEUTH�TIKEUT-SIOS-KIYEOK�TIKEUT-SIOS�TIKEUT-RIEUL�TIKEUT-PIEUP�TIKEUT-MIEUM�TIKEUT-KIYEOK�TIKEUT-CIEUC�TIKEUT-CHIEUCH�TIKEUT�TIKEU�TIGHTLY-CLOSE�TIGH�TIGER�TIGE�TIFINAG�TIEX�TIEP�TI�TICKETS�TICKET�TICK�TIC�TIARA�TI2�TI-7�TI-6�TI-5�TI-4�TI-3�TI-2�TI-1�THZ�THYOO�THWOO�THWO�THWII�THWI�THWEE�THWAA�THWA�THUR�THURISA�THUNG�THUNDERSTORM�THUNDER�THUNDE�THUMB�THUMB�THROWIN�THROUGH�THROUG�THREE-THIRTY�THREE-QUARTE�THREE-PER-E�THREE-LIN�THREE-LEGGE�THREE-HUNDRED-AND-TWENTIETH�THREE-E�THREE-DO�THREE-�THREE-CIRCL�THREAD�THOUSANDS�THOUSAND�THOUSAN�THOUGH�THOU�THORN�THOR�THONG�THOM�THOJ�THOA�TH�THIUTH�THITA�THIRTY-SECOND�THIRTY-SECON�THIRTY-ONE�THIRTY-FIV�THIRT�THIRTEEN�THIRTEE�THIRDS�THIRD�THIRD-STAG�THIRD�THIR�THINKIN�THING�THII�THIGH�THIEUT�THIC�THIAB�THEY�THETHE�THETH�THETA�THET�THESPIA�THESEOS�THESEO�THE�THERMOMETER�THERMODYNAMIC�THEREFORE�THER�THE�THEMATISMO�THEMA�THEM�THEH�THE�THEA�TH�THAW�THANTHAKHAT�THANNA�THAN�THA�THAMEDH�THAL�THA�THAJ�THA�THAHAN�THAAN�THAALU�TH-CRE�TEXT�TEX�TEX�TEVIR�TEUTEUX�TEUTEUWEN�TEUT�TEUN�TEUAEQ�TEUAEN�TEU�TETRASIMOU�TETRASEME�TETRAPLI�TETRAGRA�TETRAFONIAS�TETH�TET�TETARTO�TETARTIMORION�TET�TE�TES�TESSERA�TESSER�TESSARO�TES�TERMINATOR�TERMINA�TEP�TENUTO�TENU�TEN�TENTH�TENT�TENSE�TENS�TENS�TEN�TENNI�TENG�TEN-THIRTY�TEN�TE�TEMPU�TEMPLE�TELU�TELOU�TELLE�TELISH�TELEVISION�TELESCOPE�TELEPHONE�TELEPHON�TELEIA�TELEGRAP�TEK�TEIWS�TEGEH�TEETH�TEET�TEENS�TEEEE�TE�TEDUNG�TEDD�TEAR�TEARDROP-SPOKE�TEARDROP-SHANKE�TEARDROP-BARBE�TEAR-OF�TEACU�TE-U�TE-9�TE-8�TE-7�TE-6�TE-5�TE-4�TE-3�TE-2�TE-1�TCHEHEH�TCHEHE�TCHEH�TCHE�TCHE�T�TAY�TAXI�TAX�TAWELLEME�TAWA�TAW�TA�TAVIYANI�TAV�TA�TAURUS�TAUM�TA�TATWEEL�TATWEE�TATTOOE�TAT�TASSI�TAS�TARUNG�TARTAR-2�TARTAR�TARGET�TAQ�TAPER�TAP�TAP�TAO�TANNE�TANGERINE�TANGENT�TANGEN�TAN�TANABAT�TANA�TAN�TAMING�TAMA�TAM�TALL�TALL�TAL�TALING�TALIN�TALENTS�TALEN�TAKR�TAKHALLUS�TAKEOU�TAKE�TAK4�TAK�TAK�TAISYOU�TAILLES�TAIL�TAI�TAHALA�TAH�TA�TAGBANW�TAGALO�TAG�TAE�TACO�TACK�TAC�TABULATION�TABULATIO�TABS�TABLE�TABL�TAB�TA�TAASHAE�TAAQ�TAAM�TAALUJ�TAAI�TAAF�TA2�TA-ROL�TA-4�TA-3�TA-2�TA-1�T036�T035�T034�T033A�T033�T032A�T032�T031�T030�T029�T028�T027�T026�T025�T024�T023�T022�T021�T020�T019�T018�T017�T016A�T016�T015�T014�T013�T012�T011A�T011�T010�T009A�T009�T008A�T008�T007A�T007�T006�T005�T004�T003A�T003�T002�T001�T-SHIRT�T-REX�SZZ�SZWG�SZWA�SZU�SZO�SZI�SZEE�SZE�SZAA�SZA�SZ�SYX�SYT�SYSTE�SYRX�SYRMATIKI�SYRMA�SYRINGE�SYRIA�SYR�SYP�SYOUWA�SYNEVMA�SYNDESMO�SYNCHRONOU�SYNAGOGUE�SYNAGM�SYNAFI�SYN�SYMMETRY�SYMMETRI�SYMBOLS�SYMBOL�SYMBOL-9�SYMBOL-8�SYMBOL-7�SYMBOL-6�SYMBOL-54�SYMBOL-53�SYMBOL-52�SYMBOL-51�SYMBOL-50�SYMBOL-5�SYMBOL-49�SYMBOL-48�SYMBOL-47�SYMBOL-45�SYMBOL-43�SYMBOL-42�SYMBOL-40�SYMBOL-4�SYMBOL-39�SYMBOL-38�SYMBOL-37�SYMBOL-36�SYMBOL-32�SYMBOL-30�SYMBOL-3�SYMBOL-29�SYMBOL-27�SYMBOL-26�SYMBOL-25�SYMBOL-24�SYMBOL-23�SYMBOL-22�SYMBOL-21�SYMBOL-20�SYMBOL-2�SYMBOL-19�SYMBOL-18�SYMBOL-17�SYMBOL-16�SYMBOL-15�SYMBOL-14�SYMBOL-13�SYMBOL-12�SYMBOL-11�SYMBOL-10�SYMBOL-1�SYLOT�SYI�SY�SWZ�SWUN�SWORDS�SWORD�SWOO�SWO�SWIR�SWIMSUIT�SWIMMING�SWIMMER�SWII�SWI�SWG�SWEET�SWEE�SWEAT�SWEA�SWAS�SWAPPING�SWAN�SWAA�SW�SVAST�SVARITA�SVARIT�SUX�SUU�SUTR�SUT�SUSPENSIO�SUSHI�SURYA�SURX�SURROUND�SURROUN�SURFER�SURFAC�SURE�SURANG�SUR9�SUR�SU�SUPRALINEA�SUPERVISE�SUPERVILLAIN�SUPERSET�SUPERSE�SUPERSCRIP�SUPERIMPOSE�SUPERHERO�SUPERFIXE�SUPE�SUP�SUOX�SUOP�SUO�SUNSE�SUNRISE�SUNRIS�SUNGLASSES�SUNG�SUNFLOWER�SUNDANES�SUN�SU�SUMMER�SUMMATION�SUMMATIO�SUMASH�SUM�SULFUR�SUKUN�SUKU�SUKU�SUK�SUITABLE�SUI�SUHUR�SUE�SUD2�SUD�SUCKIN�SUCKED�SUC�SUCCEEDS�SUCCEED�SUCCEED�SUCCEE�SUBUNIT�SUBSTITUTIO�SUBSTITUTE�SUBSTITUT�SUBSET�SUBSE�SUBSCRIP�SUBPUNCTIS�SUBLINEA�SUBLIMATION�SUBLIMATE-3�SUBLIMATE-2�SUBLIMATE�SUBLIMAT�SUBJOINER�SUBJOINE�SUBJECT�SUBITO�SUBGROUP�SUBGROU�SUB�SUAM�SUAET�SUAEN�SUAE�SUAB�SUA�SU-8�SU-7�SU-6�SU-5�SU-4�SU-3�SU-2�SU-1�S�STX�STWA�STUPA�STUFFE�STUDY�STUDI�STUCK-OU�STS�STRON�STROKES�STROKE�STROKE-9�STROKE-8�STROKE-7�STROKE-6�STROKE-5�STROKE-4�STROKE-3�STROKE-2�STROKE-11�STROKE-10�STROKE-1�STROK�STRIPE�STRING�STRIN�STRIKETHROUGH�STRIK�STRIDE�STRICTL�STRETCHE�STRETCH�STRES�STRENGTH�STREAMER�STRAWBERRY�STRAW�STRATUM-2�STRATUM�STRATU�STRATIA�STRAINER�STRAIGHTNESS�STRAIGHT�STRAIGH�STRAIF�STRAGGISMATA�STOVE�STORE�STOPWATCH�STOPPING�STOPPAGE�STOP�STO�STONE�STOCK�STOC�STIRRU�STIMME�STIL�STIL�STIGMA�STICKIN�STIC�STETHOSCOPE�STEREO�STEP�STENOGRAPHI�STEM�STEAM�STEAMIN�STEAM�STEA�STAVROU�STAVROS�STAVRO�STAUROS�STATU�STATION�STATERS�STATE�STARTIN�START�STAR�STARS�STARRE�STARK�STAR�STA�STANDSTILL�STANDIN�STANDAR�STAND�STAN�STAMPE�STALLION�STAFF�STAF�STADIUM�STACKE�STACCATO�STACCATISSIMO�ST2�SSYX�SSYT�SSYRX�SSYR�SSYP�SSY�SSUX�SSUU�SSUT�SSUP�SSOX�SSOT�SSOP�SSOO�SSO�SSIX�SSIT�SSIP�SSII�SSIEX�SSIEP�SSIE�SSHIN�SSHE�SSEX�SSEP�SSEE�SSAX�SSAU�SSAT�SSAP�SSANGYESIEUNG�SSANGYEORINHIEUH�SSANGTIKEUT-PIEUP�SSANGTIKEUT�SSANGTHIEUTH�SSANGSIOS-TIKEUT�SSANGSIOS-PIEUP�SSANGSIOS-KIYEOK�SSANGSIOS�SSANGRIEUL-KHIEUKH�SSANGRIEUL�SSANGPIEUP�SSANGNIEUN�SSANGMIEUM�SSANGIEUNG�SSANGHIEUH�SSANGCIEUC-HIEUH�SSANGCIEUC�SSANGARAEA�SSAI�SSAA�SS3�SS2�SR�SQUIS�SQUIRRE�SQUIGGL�SQUID�SQUEEZED�SQUEEZ�SQUA�SQUARES�SQUARED�SQUARE�SPY�SPWA�SPUNG�SPROUT�SPRINGS�SPRING�SPRECHGESAN�SPREAD�SPREA�SPOUTIN�SPOT�SPORT�SPOON�SPOO�SPONGE�SPLITTIN�SPLIT�SPLI�SPLAYED�SPLASHIN�SPIRITU�SPIRIT�SPIRI�SPIRANT�SPIRAL�SPIRA�SPINE�SPIDER�SPIDER�SPIDE�SPICE�SPHERICA�SPESMIL�SPEN�SPEEDBOAT�SPEECH�SPEEC�SPECIAL�SPEAR�SPEAKIN�SPEAKER�SPEAKE�SPEAK-NO-EVI�SPATHI�SPARKLIN�SPARKLES�SPARKLER�SPARKLE�SPAGHETTI�SPADES�SPAD�SPACIN�SPAC�SPA�SOYOMB�SOY�SOWIL�SOW�SOUTHER�SOUTH-SLAVE�SOUT�SOURCE�SOUND�SOUN�SOUNAP�SOU�SOS�SOR�SOQ�SOO�SONJAM�SONG�SON�SOMPEN�SOM�SOLIDUS�SOLIDU�SOLI�SOLDIER�SOH�SOGDIA�SOFTWARE-FUNCTIO�SOFTNESS�SOFTBALL�SOF�SO�SOCKS�SOCIETY�SOCCE�SOAP�SOA�SO-7�SO-6�SO-5�SO-4�SO-3�SO-2�SO-1�S�SNOWMAN�SNOWMA�SNOWFLAKE�SNOWBOARDER�SNOW�SNO�SNOUT�SNOU�SNEEZIN�SNA�SNAKE�SNAK�SNAIL�SN�SMOKIN�SMIRKIN�SMILIN�SMILE�SMIL�SMEAR�SMAS�SMALLE�SMALL�SLUR�SLOWLY�SLOW�SLO�SLOVO�SLOTH�SLO�SLOPIN�SLOPE�SLOA�SLING�SLIGHTL�SLIDING�SLIDER�SLICE�SLIC�SLEUT�SLEEP�SLEEPIN�SLEE�SLED�SLAVONI�SLAVE�SLASH�SLAS�SLANTE�SKWA�SKW�SKUNK�SKULL�SKUL�SKLIRO�SKIN�SKIER�SK�SKEWE�SKATEBOARD�SKATE�SK�SJE�SIZ�SIXTY-FOURTHS�SIXTY-FOURTH�SIXTY-FOURT�SIXTY�SIXT�SIXTHS�SIXTH�SIXTH�SIXTEENTHS�SIXTEENTH-2�SIXTEENTH-1�SIXTEENTH�SIXTEENT�SIXTEEN�SIXTEE�SIX-THIRTY�SIX-STRIN�SIX-PER-E�SIX-LIN�SI�SITE�SISA�SIRINGU�SIOS-THIEUTH�SIOS-SSANGSIOS�SIOS-RIEUL�SIOS-PIEUP-KIYEOK�SIOS-PHIEUPH�SIOS-PANSIOS�SIOS-NIEUN�SIOS-MIEUM�SIOS-KHIEUKH�SIOS-KAPYEOUNPIEUP�SIOS-IEUNG�SIOS-HIEUH�SIOS-CIEUC�SIOS-CHIEUCH�SIO�SINUSOI�SINOLOGICA�SINNYIIYHE�SINKING�SINGLE-SHIFT-3�SINGLE-SHIFT-2�SINGLE-LIN�SINGLE�SINGL�SINGAAT�SIN�SINDH�SI�SIMULTANEOUS�SIMULTANEOU�SIMPLIFIE�SIMILAR�SIMILA�SIMANSI�SIMALUNGU�SIMA�SILVER�SILK�SILIQU�SILHOUETTE�SILHOUETT�SILA3�SIKI�SIK2�SIK�SIGNS�SIGMA�SIGM�SIGE�SIG4�SIG�SIG�SIEE�SIDEWAY�SIDE�SID�SIDDHI�SIDDHAM�SIDDHA�SICKNESS�SICKLE�SIB�SIA�SI-6�SI-5�SI-4�SI-3�SI-2�SI-1�S�SHYX�SHYT�SHYRX�SHYR�SHYP�SHYE�SHYA�SHY�SHWOY�SHWOO�SHWO�SHWII�SHWI�SHWE�SHW�SHWAA�SHWA�SHV�SHUX�SHUU�SHUTTLECOCK�SHUT�SHURX�SHUR�SHUP�SHUOX�SHUOP�SHUO�SHUM�SHUL�SHUFFL�SHUEQ�SHUENSHUET�SHUBUR�SHUANGXI�SHU2�SHU�SHU�SHTAPIC�SHTA�SHRUG�SHRINE�SHRIMP�SHRII�SHRI�SHOY�SHOX�SHOWER�SHOULDERE�SHOULDE�SHOU�SHOT�SHORTS�SHORT�SHORTHAN�SHORTENER�SHORTCAKE�SHORT-TWIG-YR�SHORT-TWIG-TY�SHORT-TWIG-SO�SHORT-TWIG-OS�SHORT-TWIG-NAU�SHORT-TWIG-MAD�SHORT-TWIG-HAGAL�SHORT-TWIG-BJARKA�SHORT-TWIG-A�SHORT�SHOR�SHOQ�SHO�SHOPPIN�SHOP�SHOOTIN�SHOOT�SHOOI�SHOO�SHOG�SHO�SHOES�SHOE�SHO�SHOCKE�SHOA�SHO�SHIYYAALAA�SHITA�SHIT�SHIR�SHIRAE�SHIR�SHI�SHIQ�SHINT�SHINIG�SHIND�SHI�SHIMA�SHIM�SHIM�SHI�SHIIN�SHII�SHIF�SHIELD�SHID�SHI�SHHA�SHH�SHEX�SHEVA�SHEUX�SHEUOQ�SHEUAEQTU�SHEUAEQ�SHEUAE�SHET�SHE�SHESHLAM�SHESHIG�SHESHI�SHESH2�SHESH�SHES�SHEQE�SHEP�SHEN�SHELL�SHEL�SHELF�SHEI�SHEG9�SHEEP�SHEENU�SHEEN�SHEE�SHEE�SHE-GOAT�SH�SHCHOOI�SHCHA�SHAY�SHAX�SHAVIYANI�SHAVIA�SHAVE�SHAU�SHAT�SHARU�SHAR�SHARP�SHAR�SHARK�SHARAD�SHARA�SHAR2�SHAR�SHAPING�SHAPES�SHAP�SHAP�SHANG�SHAN�SHA�SHAMROCK�SHALSHELET�SHALLO�SHAKTI�SHAKING�SHAKIN�SHAKER�SHAK�SHAI�SHAFT�SHAF�SHADOWE�SHADE�SHADE�SHADDA�SHADD�SHAD�SHA�SHAB6�SHAA�SHA6�SHA�SHA3�SHA�SGR�SGO�SGC�SGA�SGA�SG�SEYK�SEXTUL�SEXTILE�SEXTAN�SEVERANCE�SEVENTY�SEVENT�SEVENTH�SEVENTEEN�SEVENTEE�SEVEN-THIRTY�SEVE�SEUX�SEUNYAM�SEUAEQ�SETFON�SESTERTIU�SESQUIQUADRATE�SESAM�SERVIC�SERIOU�SERIFS�SERIF�SERIF�SEQUENTIAL�SEQUENC�SEPTUPL�SEPTEMBER�SEPARATOR�SEPARATO�SEPARATE�SENTO�SENTI�SENTAGON�SEMUNCI�SEMKATH�SEMK�SEMIVOWE�SEMISOF�SEMISEXTILE�SEMIMINIM�SEMIDIREC�SEMICOLON�SEMICOLO�SEMICIRCULA�SEMICIRCL�SEMIBREVI�SEMI-VOICE�SELFIE�SELF�SELENA�SELECTOR-99�SELECTOR-98�SELECTOR-97�SELECTOR-96�SELECTOR-95�SELECTOR-94�SELECTOR-93�SELECTOR-92�SELECTOR-91�SELECTOR-90�SELECTOR-9�SELECTOR-89�SELECTOR-88�SELECTOR-87�SELECTOR-86�SELECTOR-85�SELECTOR-84�SELECTOR-83�SELECTOR-82�SELECTOR-81�SELECTOR-80�SELECTOR-8�SELECTOR-79�SELECTOR-78�SELECTOR-77�SELECTOR-76�SELECTOR-75�SELECTOR-74�SELECTOR-73�SELECTOR-72�SELECTOR-71�SELECTOR-70�SELECTOR-7�SELECTOR-69�SELECTOR-68�SELECTOR-67�SELECTOR-66�SELECTOR-65�SELECTOR-64�SELECTOR-63�SELECTOR-62�SELECTOR-61�SELECTOR-60�SELECTOR-6�SELECTOR-59�SELECTOR-58�SELECTOR-57�SELECTOR-56�SELECTOR-55�SELECTOR-54�SELECTOR-53�SELECTOR-52�SELECTOR-51�SELECTOR-50�SELECTOR-5�SELECTOR-49�SELECTOR-48�SELECTOR-47�SELECTOR-46�SELECTOR-45�SELECTOR-44�SELECTOR-43�SELECTOR-42�SELECTOR-41�SELECTOR-40�SELECTOR-4�SELECTOR-39�SELECTOR-38�SELECTOR-37�SELECTOR-36�SELECTOR-35�SELECTOR-34�SELECTOR-33�SELECTOR-32�SELECTOR-31�SELECTOR-30�SELECTOR-3�SELECTOR-29�SELECTOR-28�SELECTOR-27�SELECTOR-26�SELECTOR-256�SELECTOR-255�SELECTOR-254�SELECTOR-253�SELECTOR-252�SELECTOR-251�SELECTOR-250�SELECTOR-25�SELECTOR-249�SELECTOR-248�SELECTOR-247�SELECTOR-246�SELECTOR-245�SELECTOR-244�SELECTOR-243�SELECTOR-242�SELECTOR-241�SELECTOR-240�SELECTOR-24�SELECTOR-239�SELECTOR-238�SELECTOR-237�SELECTOR-236�SELECTOR-235�SELECTOR-234�SELECTOR-233�SELECTOR-232�SELECTOR-231�SELECTOR-230�SELECTOR-23�SELECTOR-229�SELECTOR-228�SELECTOR-227�SELECTOR-226�SELECTOR-225�SELECTOR-224�SELECTOR-223�SELECTOR-222�SELECTOR-221�SELECTOR-220�SELECTOR-22�SELECTOR-219�SELECTOR-218�SELECTOR-217�SELECTOR-216�SELECTOR-215�SELECTOR-214�SELECTOR-213�SELECTOR-212�SELECTOR-211�SELECTOR-210�SELECTOR-21�SELECTOR-209�SELECTOR-208�SELECTOR-207�SELECTOR-206�SELECTOR-205�SELECTOR-204�SELECTOR-203�SELECTOR-202�SELECTOR-201�SELECTOR-200�SELECTOR-20�SELECTOR-2�SELECTOR-199�SELECTOR-198�SELECTOR-197�SELECTOR-196�SELECTOR-195�SELECTOR-194�SELECTOR-193�SELECTOR-192�SELECTOR-191�SELECTOR-190�SELECTOR-19�SELECTOR-189�SELECTOR-188�SELECTOR-187�SELECTOR-186�SELECTOR-185�SELECTOR-184�SELECTOR-183�SELECTOR-182�SELECTOR-181�SELECTOR-180�SELECTOR-18�SELECTOR-179�SELECTOR-178�SELECTOR-177�SELECTOR-176�SELECTOR-175�SELECTOR-174�SELECTOR-173�SELECTOR-172�SELECTOR-171�SELECTOR-170�SELECTOR-17�SELECTOR-169�SELECTOR-168�SELECTOR-167�SELECTOR-166�SELECTOR-165�SELECTOR-164�SELECTOR-163�SELECTOR-162�SELECTOR-161�SELECTOR-160�SELECTOR-16�SELECTOR-159�SELECTOR-158�SELECTOR-157�SELECTOR-156�SELECTOR-155�SELECTOR-154�SELECTOR-153�SELECTOR-152�SELECTOR-151�SELECTOR-150�SELECTOR-15�SELECTOR-149�SELECTOR-148�SELECTOR-147�SELECTOR-146�SELECTOR-145�SELECTOR-144�SELECTOR-143�SELECTOR-142�SELECTOR-141�SELECTOR-140�SELECTOR-14�SELECTOR-139�SELECTOR-138�SELECTOR-137�SELECTOR-136�SELECTOR-135�SELECTOR-134�SELECTOR-133�SELECTOR-132�SELECTOR-131�SELECTOR-130�SELECTOR-13�SELECTOR-129�SELECTOR-128�SELECTOR-127�SELECTOR-126�SELECTOR-125�SELECTOR-124�SELECTOR-123�SELECTOR-122�SELECTOR-121�SELECTOR-120�SELECTOR-12�SELECTOR-119�SELECTOR-118�SELECTOR-117�SELECTOR-116�SELECTOR-115�SELECTOR-114�SELECTOR-113�SELECTOR-112�SELECTOR-111�SELECTOR-110�SELECTOR-11�SELECTOR-109�SELECTOR-108�SELECTOR-107�SELECTOR-106�SELECTOR-105�SELECTOR-104�SELECTOR-103�SELECTOR-102�SELECTOR-101�SELECTOR-100�SELECTOR-10�SELECTOR-1�SELECTOR�SELECTO�SELECTE�SEISMA�SEISM�SEH�SEGOL�SEGNO�SEGMENT�SEEV�SEENU�SEEN�SEE�SEEDLING�SEE-NO-EVI�SEDNA�SECTOR�SECTION�SECTIO�SECRET�SECANT�SEBATBEI�SEAT�SEAL�SEAGUL�SE-5�SE-4�SE-3�SDON�SD�SCWA�SCRUPLE�SCROLL�SCRIPT�SCREEN�SCREE�SCREAMIN�SCORPIUS�SCORPION�SCORE�SCOOTER�SCISSORS�SCI�SCHWA�SCHW�SCHROEDER�SCHOOL�SCHOO�SCHOLAR�SCHEM�SCEPTE�SCARF�SCANDICUS�SCANDICU�SCA�SCALES�SBU�SBRU�SAYIS�SAYANNA�SAY�SAXOPHONE�SAXIMATA�SAWAN�SAW�SAVOURIN�SAUROPOD�SAURASHTR�SAUIL�SAUCER�SATURN�SATKAANKUU�SATKAAN�SATELLITE�SATELLIT�SATCHEL�SATANGA�SASH�SASAK�SARI�SAR�SAR�SAQ�SAPA�SANYOOG�SANYAK�SANTIIMU�SANSKRI�SANNYA�SANGA2�SANDWICH�SANDH�SANDAL�SANAH�SAN�SAMYO�SAMVAT�SAMPI�SAMPHAO�SAMKA�SAMEKH�SAMEK�SAMBA�SAMARITA�SAM�SALTIRE�SALTILLO�SALT-2�SALT�SAL�SALLALLAHO�SALL�SALA�SALAD�SALA�SAL-AMMONIAC�SAL�SAKTA�SAKOT�SAKIN�SAKH�SAKEUAE�SAK�SAJDAH�SAILBOAT�SAIL�SAIKURU�SAH�SAGITTARIUS�SAGA�SAG�SA�SAFHA�SAFET�SADHE�SADH�SADE�SAD�SA�SACRIFICIA�SAAI�SAADHU�SA-I�SA-8�SA-7�SA-6�SA-5�SA-4�SA-3�SA-2�SA-1�S046�S045�S044�S043�S042�S041�S040�S039�S038�S037�S036�S035A�S035�S034�S033�S032�S031�S030�S029�S028�S027�S026B�S026A�S026�S025�S024�S023�S022�S021�S020�S019�S018�S017A�S017�S016�S015�S014B�S014A�S014�S013�S012�S011�S010�S009�S008�S007�S006A�S006�S005�S004�S003�S002A�S002�S001�S-W�S-SHAPE�RYY�RYX�RYT�RYRX�RYR�RYP�RWOO�RWO�RWII�RWI�RWEE�RWE�RWAHA�RWAA�RWA�RUX�RUUBURU�RUU�RUT�RUSSIA�RUSI�RURX�RUR�RUPII�RUPE�RUP�RUOX�RUOP�RUO�RUNOUT�RUNNIN�RUNNER�RUNI�RUN�RUM�RUMA�RUM�RU�RULER�RULE-DELAYED�RULE�RULAI�RUKKAKHA�RUIS�RUGB�RUDIMENT�RUBL�RU�RUA�RU-6�RU-5�RU-4�RU-3�RU-2�RU-1�RTHAN�RTE�RTAGS�RTAG�RRYX�RRYT�RRYRX�RRYR�RRYP�RRUX�RRUU�RRUT�RRURX�RRUR�RRUP�RRUOX�RRUO�RRU�RRRA�RROX�RROT�RROP�RROO�RRO�RRII�RRI�RREX�RRET�RREP�RREH�RRE�RREE�RRE�RRAX�RRAU�RRAI�RRAA�ROWBOAT�ROUNDE�ROUND-TIPPE�ROTUNDA�ROTATIONS�ROTATION-WALLPLAN�ROTATION-FLOORPLAN�ROTATION�ROTATIO�ROTATE�ROSH�ROSETTE�ROSE�ROOT�ROOSTER�ROOM�ROOK�ROO�ROOF�ROMANIA�ROMA�ROM�ROLLIN�ROLLE�ROLLED-U�ROL�ROHINGY�ROG�RO�ROCKET�ROC�ROC�ROBO�ROBAT�ROASTE�ROAR�ROA�RO-6�RO-5�RO-4�RO-3�RO-2�RO-1�RNYIN�RNOON�RNOO�RNA�RMT�RLO�RLM�RLI�RLE�RJE�RJE�RJ�RIVER�RITUAL�RITTORU�RITSI�RISIN�RISH�RIRA�RIPPL�RIP�RING�RINGIN�RINGE�RINFORZANDO�RI�RIMGBA�RIM�RIKRIK�RIGVEDI�RIGHTWARDS�RIGHTHAN�RIGHT-TO-LEF�RIGHT-SID�RIGHT-SHADOWE�RIGHT-SHADE�RIGHT-POINTIN�RIGHT-LIGHTE�RIGHT-HANDE�RIGHT-HAN�RIGHT-FACIN�RIGHT�RIFLE�RIEUL-YESIEUNG�RIEUL-YEORINHIEUH-HIEUH�RIEUL-YEORINHIEUH�RIEUL-TIKEUT-HIEUH�RIEUL-TIKEUT�RIEUL-THIEUTH�RIEUL-SSANGTIKEUT�RIEUL-SSANGSIOS�RIEUL-SSANGPIEUP�RIEUL-SSANGKIYEOK�RIEUL-SIOS�RIEUL-PIEUP-TIKEUT�RIEUL-PIEUP-SIOS�RIEUL-PIEUP-PHIEUPH�RIEUL-PIEUP-HIEUH�RIEUL-PIEUP�RIEUL-PHIEUPH�RIEUL-PANSIOS�RIEUL-NIEUN�RIEUL-MIEUM-SIOS�RIEUL-MIEUM-KIYEOK�RIEUL-MIEUM-HIEUH�RIEUL-MIEUM�RIEUL-KIYEOK-SIOS�RIEUL-KIYEOK-HIEUH�RIEUL-KIYEOK�RIEUL-KAPYEOUNPIEUP�RIEUL-HIEUH�RIEUL-CIEUC�RIEU�RIEL�RIEE�RICKSHAW�RICEM�RICE�RIC�RIBBON�RIBBO�RIA�RI-7�RI-6�RI-5�RI-4�RI-3�RI-2�RI-1�RHOTI�RHO�RH�RHINOCEROS�RHA�RH�RGYINGS�RGYAN�RGY�REVOLVIN�REVOLUTION�REVMA�REVIA�REVERSED-SCHWA�REVERSED�REVERSE�REVERS�REUX�REU�RETURN�RETUR�RETROFLE�RETREAT�RETORT�RESUPINUS�RESTROOM�RESTRICTE�REST�RESPONSE�RESOURCE�RESOLUTION�RESISTANCE�RESIDENCE�RESH-AYIN-DALETH�RESH-AYIN�RES�RERENGGAN�REREKAN�REPRESENT�REPLACEMEN�REPHA�REPH�REPETITIO�REPEATE�REPEAT�REPEA�REPAYA�REPA�REP�RENTOGEN�REN�RE�REMU�REMINDE�REMEDY�RELIGION�RELIEVE�RELEASE�RELAXED�RELATIONA�RELATION�RELAA�REJAN�REIWA�REI�REI�REGULUS-4�REGULUS-3�REGULUS-2�REGULUS�REGULU�REGISTERE�REGIONA�REGIA-2�REGIA�REFORME�REFERENC�REDUPLICATION�RECYCLIN�RECYCLE�RECTILINEA�RECTANGULA�RECTANGLE�RECTANGL�RECREATIONA�RECORDIN�RECORDER�RECORD�RECOR�RECITATIV�RECEPTIV�RECEIVER�RECEIVE�RECEIPT�REALGAR-2�REALGAR�REAHMUK�REACH�RE-4�RE-3�RE-2�RE-1�RD�RDE�RBAS�RAZOR�RAYS�RAY�RAYANNA�RATIO�RATHA�RATH�RATA�RAT�RASWADI�RASOU�RASHA�RAQ�RAPISMA�RANG�RANA�RAN�RAM�RAMBAT�RAKHANG�RAKAARAANSAYA�RAISIN�RAISED�RAISE�RAINBOW�RAILWAY�RAILWA�RAIL�RAID�RAIDA�RAHMATULLA�RAH�RAFE�RAEM�RADIOACTIV�RADIO�RADI�RAD�RAD�RA�RACQUE�RACING�RACIN�RACCOON�RABBIT�RABBI�RAB�RAAI�RA3�RA2�RA-KARA�RA-4�RA-3�RA-2�RA-1�R029�R028�R027�R026�R025�R024�R023�R022�R021�R020�R019�R018�R017�R016A�R016�R015�R014�R013�R012�R011�R010A�R010�R009�R008�R007�R006�R005�R004�R003B�R003A�R003�R002A�R002�R001�R-CRE�QYX�QYU�QYT�QYRX�QYR�QYP�QYO�QYI�QYEE�QYE�QYAA�QYA�QY�QWI�QWEE�QWE�QWAA�QWA�QUX�QUV�QUUV�QUU�QUT�QUSHSHAYA�QURX�QUR�QUP�QUOX�QUOT�QUOTATIO�QUOT�QUOP�QUO�QUK�QUINTILE�QUINTESSENCE�QUINDICESIM�QUINCUNX�QUINARIU�QUIL�QUILL�QUIC�QUI�QUF�QUESTIONE�QUESTION�QUESTIO�QUEEN�QUEE�QUE�QUBUTS�QUATERNIO�QUARTERS�QUARTER�QUARTER�QUANTIT�QUADRUPL�QUADRANT�QUADRAN�QUADCOLON�QUAD�QUA�QUA�QU�Q�QOX�QOT�QOPH�QOPA�QOP�QOO�QO�QOF�QO�QOA�QO�QN�QIX�QITSA�QIT�QIP�QII�QIF�QIEX�QIET�QIEP�QIE�QI�QHWI�QHWEE�QHWE�QHWAA�QHWA�QHU�QHOPH�QHO�QHI�QHEE�QHE�QHAU�QHAA�QHA�QGA�QETANA�QEE�QE�QAY�QAU�QATAN�QARNE�QAR�QAQ�QAPH�QAMATS�QAMAT�QAL�QAIRTHRA�QAI�QAF�QA�QADMA�QAAI�QAAFU�QAAF�Q007�Q006�Q005�Q004�Q003�Q002�Q001�PZ�PYX�PYT�PYRX�PYR�PYP�PWOY�PWOO�PWO�PW�PWII�PWI�PWEE�PWE�PWAA�PW�PV�PUZZL�PUX�PUUT�PUU�PUTREFACTION�PUT�PU�PUSHPIN�PUSHPIKA�PUSHIN�PURX�PURSE�PURPL�PURNAMA�PURITY�PURIFY�PUR�PUQ�PUP�PUOX�PUOP�PUO�PUNGAAM�PUNG�PUNCTU�PUNCTUATION�PUNCTUATIO�PUMP�PUM�PUFFED�PUE�PUCK�PUBLI�PU�PUAQ�PUAE�PUACHU�PU2�PU1�PU�PTHAH�PTE�PSIL�PSIFISTOSYNAGMA�PSIFISTOPARAKALESMA�PSIFISTO�PSIFISTOLYGISMA�PSI�PSALTE�PS�PROVE�PROTOVARY�PROTO�PROTECTE�PROSGEGRAMMENI�PROSERPINA�PROPORTIONA�PROPORTION�PROPERT�PROPELLE�PROOF�PROLONGE�PROLATION�PROJECTOR�PROJECTIVE�PROJECTION�PROHIBITE�PROGRESS�PROGRA�PROFOUND�PRODUCT�PRODUC�PROBIN�PRIVATE�PRIVAT�PRIVAC�PRISHTHAMATR�PRINTS�PRINTER�PRINTE�PRINT�PRIN�PRINCESS�PRINCE�PRIME�PRIM�PREVIOU�PRETZEL�PRESSE�PRESET�PRESENTATIO�PRESCRIPTIO�PREPONDERANCE�PRENKHA�PREGNAN�PREFIXE�PREFAC�PRECIPITATE�PRECEDIN�PRECEDES�PRECEDE�PRECEDE�PRECEDE�PRECED�PRAYE�PRAM-PII�PRAM-PI�PRAM-MUOY�PRAM-MUO�PRAM-BUON�PRAM-BUO�PRAM-BEI�PRAM-BE�PRAM�PRA�PR�PPV�PPM�PPA�POY�POX�POWER�POWER�POWE�POWDERE�POWDER�POUN�POULTR�POUCH�POTATO�POTABL�PO�POSTPOSITIO�POSTBOX�POSTA�POST�POS�POSSESSION�POSSESSIO�POSITIONS�POSITION�POSEIDON�PORTABL�PORRECTUS�PORRECTU�POPPIN�POPPER�POPCORN�POP�PO�POODLE�POO�PONDO�PO�POMMEE�POMME�POLO�POLISH�POLIC�POL�POLE�POL�POKRYTIE�POKOJI�POINT�POINTO�POINTER�POINTE�POINT�POIN�POETR�POETI�PODATUS�POCKE�POA�PO�P�PNEUMATA�PLUT�PLUTA�PLUS-MINU�PLUS�PLURAL�PLUME�PLUM�PLUK�PLUG�PLU�PLOW�PLOPHU�PLHAU�PLETHRON�PLEADIN�PLD�PLAYIN�PLATE�PLASTICS�PLANET�PLANE�PLANC�PLAK�PLAGIO�PLACEHOLDER�PLACEHOLDE�PLAC�PLA�PIZZICATO�PIZZA�PIX�PIWR�PITCHFORK�PITCHFOR�PIT�PISTOL�PISELEH�PISCES�PIRIG�PIRI�PIRIEEN�PIRACY�PIR2�PIPING�PIPAEMGBIEE�PIPAEMBA�PIP�PINWHEE�PINEAPPLE�PIN�PINCHIN�PINARBORAS�PILL�PIL�PILCRO�PIKURU�PIKO�PIG�PI�PIEX�PIEUP-THIEUTH�PIEUP-SSANGSIOS�PIEUP-SIOS-TIKEUT�PIEUP-SIOS-THIEUTH�PIEUP-SIOS-PIEUP�PIEUP-SIOS-KIYEOK�PIEUP-SIOS-CIEUC�PIEUP-RIEUL-PHIEUPH�PIEUP-RIEUL�PIEUP-NIEUN�PIEUP-MIEUM�PIEUP-KHIEUKH�PIEUP-CIEUC�PIEUP-CHIEUCH�PIEU�PIET�PIEP�PIEET�PIEEQ�PIECE�PIE�PICTURE�PICKET�PICK�PIASUTORU�PIASM�PIANO�P�PHWA�PHUTHAO�PHU�PHUNG�PHRASE�PHONES�PHOLUS�PHOENICIA�PHOA�PHO�PH�PHNAE�PHINTHU�PHILOSOPHER�PHILIPPIN�PHIEUPH-THIEUTH�PHIEUPH-SIOS�PHIEUPH-PIEUP�PHIEUPH-HIEUH�PHIEUP�PHI�PH�PHEE�PHE�PHASE-�PHASE-�PHASE-�PHARYNGEA�PHAR�PHAN�PHAM�PHAISTO�PHAGS-P�PHAB�PHAARKAA�PHAA�PG�PF�PEUX�PEUTAE�PEUT�PETR�PETASTOKOUFISMA�PETASTI�PETASMA�PETALLE�PESO�PES�PESH2�PESH�PESET�PE�PERTH�PERSPECTIVE�PERSONA�PERSON�PERSO�PERSIA�PERSEVERIN�PERPENDICULAR�PERPENDICULA�PERNI�PERMITTE�PERMI�PERMANEN�PERISPOMENI�PERISPOMEN�PERFORMIN�PERFECTU�PERFECTA�PERFECT�PERCUSSIVE�PERCEN�PEPPER�PEPET�PEPE�PEORT�PEOPLE�PENTATHLON�PENTASEME�PENTAGRAM�PENTAGON�PENSU�PENSIV�PENN�PENNANT�PENIHI�PENGUIN�PENGKAL�PENETRATION�PENCIL�PELASTON�PELASTO�PEITH�PEHEH�PEHE�PEH�PE�PEEZI�PEESHI�PEEP�PEEM�PEEI�PEE�PEDESTRIANS�PEDESTRIAN�PEDESTAL�PEDESTA�PEDA�PEANUTS�PEAK�PEACOCK�PEACH�PEACE�PEAC�PDI�PDF�PD�PC�PAZER�PAYEROK�PAYANNA�PAY�PAX�PAWN�PAW�PA�PAVIYANI�PAUS�PAU�PA�PATTERN�PATHAMASAT�PATHAKKU�PAT�PATAK�PATAH�PAT�PASUQ�PASSPOR�PASSIVE-PULL-UP-OUTPU�PASSIVE-PULL-DOWN-OUTPU�PASSIMBANG�PASSENGE�PASSE�PASHTA�PASHAE�PASEQ�PASANGA�PARUM�PART�PARTNERSHI�PARTIALLY-RECYCLE�PARTIA�PARTHIA�PAR�PARROT�PARK�PARICHON�PARESTIGMENO�PAREREN�PARENTHESIS�PARENTHESI�PARENTHESE�PARAPHRAS�PARALLELOGRAM�PARALLEL�PARALLE�PARAKLITIKI�PARAKLITIK�PARAKALESM�PARAGRAPHU�PARAGRAPHOS�PARAGRAPH�PARAGRAP�PARACHUTE�PARA�PAR�PAPYRUS�PAPERCLIPS�PAPERCLIP�PAPER�PAPE�PAP�PA�PA�PANYUKU�PANYIKU�PANYECEK�PANYANGGA�PANYAKRA�PANTI�PANSIOS-PIEUP�PANSIOS-KAPYEOUNPIEUP�PANONGONAN�PANOLONG�PANGWISAD�PANGRANGKEP�PANGOLAT�PANGLONG�PANGLAYAR�PANGKON�PANGKAT�PANGHULU�PANG�PANEULEUNG�PAND�PANCAKES�PANAM�PANAELAENG�PAN�PA�PAMUNGKAH�PAMUDPOD�PAMSHAE�PAMPHYLIA�PAMINGKAL�PAMEPET�PAMENENG�PAMADA�PAMAAEH�PALUTA�PALOCHKA�PALMYREN�PALM�PALM�PAL�PALLAWA�PALLAS�PAL�PALETTE�PALAUN�PALATALIZE�PALATALIZATION�PALATA�PAKPA�PAIYANNOI�PAIRTHRA�PAIRE�PAINTBRUSH�PAI�PAHLAV�PAH�PAGODA�PAGES�PAGER�PAG�PADM�PADDL�PADDIN�PAD�PAD�PACKING�PACKAGE�PAATU�PAASENTO�PAARAM�PAARAE�PAAM�PAAI�PAA-PILLA�PAA�P2�P011�P010�P009�P008�P007�P006�P005�P004�P003A�P003�P002�P001A�P001�OYSTER�OYRANISM�OYANNA�OXIA�OXI�OXEIA�OXEI�OWL�OVERRIDE�OVERLON�OVERLINE�OVERLAY�OVERLA�OVERLAPPIN�OVERLAP�OVERLAID�OVERHEATE�OVERBAR�OVAL�OVA�OUTLINE�OUTLINE�OUTE�OUTBO�OUNKI�OUNCE�OUNC�OTU�OTTOMA�OTTER�OTTAV�OTT�OTHER�OTHE�OTHALA�OTHAL�OSMANY�OSC�OSAG�ORTHOGONA�ORTHODO�ORNAT�ORNAMENTS�ORNAMENT�ORNAMEN�ORKHO�ORIY�ORIGINA�ORIGIN�ORE-2�ORDINA�ORDE�ORCHID�ORANGUTAN�ORANG�OPTIO�OPTICA�OPPRESSION�OPPOSITION�OPPOSIN�OPPOSE�OPHIUCHUS�OPERATOR�OPERATO�OPERATIN�OPENIN�OPEN-P�OPEN-OUTLINE�OPEN-O�OPEN-�OPEN-HEADE�OPEN-CIRCUIT-OUTPU�OPEN�OOZE�OOYANNA�OOU�OOMU�OOH�OOE�OOBOOFILI�ONU�ONSU�ONN�ONKAR�ONION�ONESELF�ONE-WA�ONE-THIRTY�ONE-PIEC�ONE-LIN�ONE-HUNDRED-AND-SIXTIETH�ONCOMIN�ONAP�ON-OF�OMISSIO�OMICRON�OMICRO�OMEGA�OMEG�OMALON�OLIVE�OLIGO�OLD�OKT�OKARA�OKAR�OJIBWA�OJEON�OIN�OIL�OI�OHM�OH�OGRE�OGONEK�OGONE�OGHA�OFFICER�OFFICE�OFFIC�OFF�OEY�OER�OEK�OEE�ODEN�ODD�OD�OCTOPUS�OCTOBER�OCTE�OCTAGONA�OCTAGON�OC�OCLOCK�OCCLUSION�OBSTRUCTION�OBSERVE�OBOL�OBO�OBOFILI�OBLIQU�OBJEC�OBELUS�OBELOS�OB�OAY�OAK�OABOAFILI�O�O051�O050B�O050A�O050�O049�O048�O047�O046�O045�O044�O043�O042�O041�O040�O039�O038�O037�O036D�O036C�O036B�O036A�O036�O035�O034�O033A�O033�O032�O031�O030A�O030�O029A�O029�O028�O027�O026�O025A�O025�O024A�O024�O023�O022�O021�O020A�O020�O019A�O019�O018�O017�O016�O015�O014�O013�O012�O011�O010C�O010B�O010A�O010�O009�O008�O007�O006F�O006E�O006D�O006C�O006B�O006A�O006�O005A�O005�O004�O003�O002�O001A�O001�O-YE�O-O-I�O-E�NZYX�NZYT�NZYRX�NZYR�NZYP�NZY�NZUX�NZURX�NZUR�NZUQ�NZUP�NZUOX�NZUO�NZU�NZU�NZOX�NZOP�NZIX�NZIT�NZIP�NZIEX�NZIEP�NZIE�NZI�NZEX�NZEUM�NZE�NZAX�NZAT�NZAQ�NZAP�NZA�NZ�NYWA�NYUX�NYUU�NYUT�NYUP�NYUOX�NYUOP�NYUO�NYUN�NYUE�NYU�NYOX�NYOT�NYOP�NYOO�NYON�NYOA�NYO�NYJA�NYIX�NYIT�NYI�NYI�NYI�NYIP�NYIN-DO�NYIN�NYII�NYIEX�NYIET�NYIEP�NYIE�NYIAKEN�NYI�NY�NYHA�NYET�NYE�NYEN�NYEH�NYE�NYEE�NYE�NY�NYCA�NYAU�NYAJ�NYAI�NYAH�NYAEMAE�NYAA�NWOO�NWO�NWII�NWI�NWE�NWAA�NWA�NW�NV�NUX�NUUN�NUU�NUTILLU�NUT�NU�NURX�NUR�NUP�NUOX�NUOP�NUO�NUNUZ�NUNU�NUNG�NUNAVU�NUNAVI�NUN�NU�NUMER�NUMERATO�NUMERA�NUMBERS�NUMBER�NUM�NULL�NUL�NUL�NUKTA�NUKT�NUENG�NUE�NUBIA�NUAE�NU11�NU1�NU022A�NU022�NU021�NU020�NU019�NU018A�NU018�NU017�NU016�NU015�NU014�NU013�NU012�NU011A�NU011�NU010A�NU010�NU009�NU008�NU007�NU006�NU005�NU004�NU003�NU002�NU001�NU-3�NU-2�NU-1�NTXIV�NTXA�NTUU�NTUM�NTUJ�NT�NTSAU�NTSA�NTOQPEN�NTOG�NTO�NTIE�NTHAU�NTEUNGBA�NTEUM�NTEN�NTEE�NTAP�NTA�NTAA�NTA�NSUO�NSUN�NSUM�NSOM�NSIEET�NSIEEP�NSIEE�NSHUT�NSHU�NSHUOP�NSHUE�NSHIEE�NSHEE�NSHAQ�NSHA�NSEUAEN�NSEN�NSA�NRYX�NRYT�NRYRX�NRYR�NRYP�NRY�NRUX�NRUT�NRURX�NRUR�NRUP�NRUA�NRU�NROX�NROP�NRO�NREX�NRET�NRE�NREP�NRE�NRAX�NRAT�NRAP�NRA�NQIG�NQA�NPLA�NPA�NOY�NOX�NOWC�NOVILE�NOVEMBER�NOTTO�NOTES�NOTEHEAD�NOTEHEA�NOTEBOOK�NOTEBOO�NOTE�NOT�NOTCHE�NOTCH�NOTATIO�NOT�NO�NOSE�NOS�NORTHWES�NORTHER�NORTHEAST-POINTIN�NORMA�NORDI�NO�NOP�NOONU�NOO�NONFORKING�NON-POTABL�NON-JOINER�NON-BREAKIN�NON�NOMISM�NOMINA�NOKHUK�NODE�NOA�NO-BREA�NO-5�NO-4�NO-3�NO-2�NO-1�NNUU�NNU�NNOO�NNO�NNNUU�NNNU�NNNOO�NNNO�NNNII�NNNI�NNNEE�NNNE�NNNAU�NNNAI�NNNAA�NNNA�NNN�NNHA�NNGOO�NNGO�NNGII�NNGI�NNGAA�NNGA�NNG�NNBSP�NM�NLAU�NL020�NL019�NL018�NL017A�NL017�NL016�NL015�NL014�NL013�NL012�NL011�NL010�NL009�NL008�NL007�NL006�NL005A�NL005�NL004�NL003�NL002�NL001�NL�NKOM�NK�NKINDI�NKAU�NKAARAE�NKA�NJYX�NJYT�NJYRX�NJYR�NJYP�NJY�NJUX�NJURX�NJUR�NJUQA�NJUP�NJUOX�NJUO�NJUEQ�NJUAE�NJU�NJOX�NJOT�NJOP�NJOO�NJO�NJIX�NJIT�NJIP�NJIEX�NJIET�NJIEP�NJIEE�NJIE�NJI�NJ�NJEUX�NJEUT�NJEUAENA�NJEUAEM�NJEEEE�NJEE�NJE�NJE�NJAQ�NJAP�NJAEMLI�NJAEM�NJAA�NIX�NITRE�NISAG�NIRUGU�NIP�NINTH�NINETY�NINET�NINETEEN�NINETEE�NINE-THIRTY�NIN�NINDA2�NINDA�NIN9�NIN�NIM�NI�NIKOLSBUR�NIKHAHIT�NIKAHIT�NIKA�NIHSHVASA�NIGIDAMIN�NIGIDAESH�NIGHT�NIGH�NIGGAHITA�NIEX�NIEUN-TIKEUT�NIEUN-THIEUTH�NIEUN-SIOS�NIEUN-RIEUL�NIEUN-PIEUP�NIEUN-PANSIOS�NIEUN-KIYEOK�NIEUN-HIEUH�NIEUN-CIEUC�NIEUN-CHIEUCH�NIEU�NIEP�NIE�NIB�NIA�NI2�NI-TE�NI-7�NI-6�NI-5�NI-4�NI-3�NI-2�NI-1�NHUE�NHJA�NH�NGYE�NGVE�NGUU�NGUOX�NGUOT�NGUO�NGUAN�NGUAET�NGUAE�NGOX�NGOU�NGO�NGOT�NGOQ�NGOP�NGON�NGOM�NGOEH�NGOE�NG�NGKYEE�NGKWAEN�NGKUP�NGKUN�NGKUM�NGKUENZEUM�NGKU�NGKIND�NGKIEE�NGKEUX�NGKEURI�NGKEUAEQ�NGKEUAEM�NGKAQ�NGKAP�NGKAAMI�NGKA�NGIEX�NGIEP�NGIE�NGHA�NGGWAEN�NGGURAE�NGGUP�NGGUOQ�NGGUO�NGGUON�NGGUOM�NGGUM�NGGUEET�NGGUAESHA�NGGUAE�NGGUA�NGGU�NGGOO�NGGO�NGGI�NGGEUX�NGGEUAET�NGGEUAE�NGGE�NGGEN�NGGEET�NGGEEEE�NGGEE�NGGE�NGGAP�NGGAAMAE�NGGAAM�NGGAA�NGG�NGEX�NGEUREUT�NGEP�NGEN�NGEE�NGEADAL�NGAX�NGAU�NGAT�NGA�NGAQ�NGAP�NGANGU�NGAN�NGAI�NGAH�NGAAI�NG�NF�NEX�NEX�NEWSPAPER�NEWLINE�NEWLIN�NEW�NEW�NE�NEUTRAL�NEUTRA�NEUTER�NETWORKE�NE�NESTE�NESSUS�NER�NEQUDAA�NEPTUNE�NEPTUN�NEP�NEO�NE�NENOE�NENANO�NEN�NEL�NEITHE�NEGATIV�NEGATIO�NEGATE�NECKTIE�NECK�NEBENSTIMME�NE-KO�NDUX�NDUT�NDURX�NDUR�NDUP�NDUN�ND�NDOX�NDOT�NDOP�NDOO�NDON�NDOMBU�NDOL�NDIX�NDIT�NDIQ�NDIP�NDIEX�NDIE�NDIDA�NDIAQ�NDEX�NDEUX�NDEUT�NDEUAEREE�NDEP�NDEE�NDE�NDAX�NDAT�NDAP�NDAM�NDAANGGEUAET�NDAA�NDA�NCHAU�NCA�NBYX�NBYT�NBYRX�NBYR�NBYP�NBY�NBUX�NBUT�NBURX�NBUR�NBUP�NBU�NBOX�NBOT�NBOP�NBO�NBIX�NBIT�NBIP�NBIEX�NBIEP�NBIE�NBI�NBH�NBAX�NBAT�NBAP�NBA�NAZA�NAYANNA�NAY�NAXIA�NAX�NAUTHS�NAUSEATE�NAUDI�NATURA�NATIONA�NASKAP�NASHI�NASALIZATION�NASALIZATIO�NASA�NARRO�NAR�NAQ�NAO�NANSANAQ�NANGMONTHO�NANDINAGAR�NAND�NANA�NAME�NAM�NAM2�NAK�NAIR�NAI�NAGR�NAGAR�NAGA�NAG�NAG�NA�NAE�NABLA�NABATAEA�NAASIKYAYA�NAAKSIKYAYA�NAAI�NA�NA4�NA2�NA-9�NA-8�NA-7�NA-6�NA-5�NA-4�NA-3�NA-2�NA-1�N042�N041�N040�N039�N038�N037A�N037�N036�N035A�N035�N034A�N034�N033A�N033�N032�N031�N030�N029�N028�N027�N026�N025A�N025�N024�N023�N022�N021�N020�N019�N018B�N018A�N018�N017�N016�N015�N014�N013�N012�N011�N010�N009�N008�N007�N006�N005�N004�N003�N002�N001�N-MU-MO-2�N-MU-MO-1�N-CRE�N-AR�MYX�MYT�MYSLITE�MYP�MYA�MY�MY�MWOO�MWO�MWII�MWI�MWEE�MWE�MWAA�MWA�MW�M�MVS�MVOP�MVI�MVEUAENGAM�MV�M�MUX�MUUVUZHAKKU�MUUSIKATOAN�MUURDHAJ�MUU�MUTHALIYA�MUT�MUSIC�MUSI�MUSHROOM�MUSH3�MUSH�MUSH�MUS�MUS�MURX�MURGU2�MURE�MURDA�MURD�MUR�MUQDAM�MUP�MUOX�MUOT�MUOP�MUOMAE�MUO�MUNSUB�MUNAH�MUN�MULTISET�MULTISE�MULTIPLICATION�MULTIPLICATIO�MULTIPLE�MULTIPL�MULTIOCULA�MULTIMAP�MULT�MULTAN�MUKPHRENG�MUKKURUNI�MUIN�MUGS�MUG�MU�MUEN�MUE�MUCH�MUC�MUCAAD�MUAS�MUAN�MUAE�MU-GAAHLA�MU-4�MU-3�MU-2�MU-1�M�MTAVRUL�MS�MR�M�MPA�MOYAI�MOX�MOVI�MOVE�MOVEMENT-WALLPLAN�MOVEMENT-HING�MOVEMENT-FLOORPLAN�MOVEMENT-DIAGONA�MOVEMENT�MOVEMEN�MOVE�MOVE�MOUTH�MOUSE�MOUS�MOUNTAINS�MOUNTAIN�MOUNTAI�MOUN�MOUND�MOUN�MOTORWAY�MOTORIZE�MOTORCYCLE�MOTO�MOTHER�MOTHE�MOT�MOSQUITO�MOSQUE�MORTUUM�MORTAR�MORPHOLOGICA�MORNING�MOP�MOOSE-CRE�MOON�MOO�MOOMPUQ�MOOMEUT�MOOD�MOO�MOO�MONTIEEN�MONTH�MONT�MONSTER�MONOSTABL�MONOSPAC�MONORAIL�MONOGRAP�MONOGRAMMO�MONOGRA�MONOFONIAS�MONOCULA�MONOCLE�MONKEY�MONKE�MONI�MONGKEUAEQ�MONEY-MOUT�MONE�MON�MO�MOL�MOHAMMA�MODUL�MODIFIER-9�MODIFIER-8�MODIFIER-7�MODIFIER-6�MODIFIER-5�MODIFIER-4�MODIFIER-3�MODIFIER-2�MODIFIER-16�MODIFIER-15�MODIFIER-14�MODIFIER-13�MODIFIER-12�MODIFIER-11�MODIFIER-10�MODIFIER�MOD�MODESTY�MODER�MODEM�MODELS�MODEL�MODE�MOBIL�MOA�MO-6�MO-5�MO-4�MO-3�M�MNYA�MNAS�MMSP�MM�M�MLA�ML�MKPARA�MIX�MIT�MISRA�MIRIBAARU�MIRI�MIRED�MIP�MINY�MINUS-OR-PLU�MINUS�MINISTER�MINIMIZE�MINIMA�MINIDISC�MINIBUS�MIME�MIM�MILLIONS�MILLION�MILLET�MILL�MIL�MILK�MILK�MILITAR�MIL�MIKURON�MIKRO�MIKRI�MIIN�MIIM�MII�MI�MIEX�MIEUM-TIKEUT�MIEUM-SSANGSIOS�MIEUM-SSANGNIEUN�MIEUM-RIEUL�MIEUM-PIEUP-SIOS�MIEUM-PIEUP�MIEUM-PANSIOS�MIEUM-NIEUN�MIEUM-CIEUC�MIEUM-CHIEUCH�MIEU�MIEP�MIEE�MIE�MIDLIN�MIDDLE-WELS�MIDDLE�MID-LEVE�MI�MICROSCOPE�MICROPHONE�MICROBE�MICR�MIC�MI-7�MI-6�MI-5�MI-4�MI-3�MI-2�MI-1�MHZ�MHA�MH�MGUX�MGUT�MGURX�MGUR�MGUP�MGUOX�MGUOP�MGUO�MGU�MGOX�MGOT�MGOP�MGO�MG�MGIEX�MGIE�MGEX�MGEP�MGE�MGBU�MGBOO�MGBOFUM�MGBO�MGBI�MGBEUN�MGBEN�MGBEE�MGBE�MGBASAQ�MGBASA�MGAX�MGAT�MGAP�MGA�MG�MFON�MFO�MFO�MFIYAQ�MFIEE�MFEUT�MFEUQ�MFEUAE�MFAA�MEZZO�MEX�MEU�MEUQ�MEUNJOMNDEUQ�MEUN�METRO�METRICA�METRIA�METRETE�METOBELUS�METEK�METEG�METAL�MET�MESSENIA�MESSAGE�MESSAG�MESO�MESI�MESH�MERPERSON�MERKHA�MERKH�MERIDIANS�MERI�MERGE�MERCURY�MERCUR�MENORA�MENOE�MENDUT�MEN�MEMO�MEMBERSHIP�MEMBER�MEMBE�MEM-QOPH�MEM�ME�MELODI�MELIK�MEIZI�MEGATON�MEGAPHONE�MEGALI�MEETORU�MEETE�MEET�MEEMU�MEEM�MEE�MEEEE�MEDIUM�MEDIU�MEDIEVA�MEDICINE�MEDICA�MEDIA�MEDEFAIDRI�MEDAL�MECHANICA�MEAT�MEA�MEASURE�MEASURE�MEASUR�ME-MA�ME-2�ME-1�MDU�M�MCH�MCHA�M�MBUU�MBUOQ�MBUO�MBUE�MBUAEM�MBUAE�MBOO�MBO�MBIT�MBI�MBIRIEEN�MBI�MBEUX�MBEURI�MBEUM�MBERAE�MBEN�MBEEKEET�MBEE�MBE�MBAQ�MBANYI�MBAARAE�MBAAKET�MBAA�MBA�MB�MB4�MB3�MB2�MAYE�MAYANNA�MAYA�MAY�MAXIMIZE�MAXIMA�MAX�MAU�MATTOCK�MATRIX�MATERIALS�MAT�MAS�MASSING�MASSAGE�MASOR�MASK�MASHFAAT�MASH2�MASCULIN�MASARA�MARY�MARWAR�MARUKU�MARTYRI�MARTIA�MARRYIN�MARRIAG�MARRATAN�MARK�MARKER�MARK-4�MARK-3�MARK-2�MARK-1�MARE�MARCHE�MARCH�MARCATO-STACCATO�MARCATO�MARCASITE�MARBUTA�MARBUT�MAR�MAQAF�MAQ�MAPL�MAPIQ�MA�MAO�MANUA�MANTELPIEC�MANSYON�MANSUAE�MANNA�MANNA�MANICHAEA�MANGO�MANGALAM�MANDARIN�MANDAILIN�MANDAI�MANCH�MANA�MANACLES�MALTES�MALEERI�MALE�MAL�MALAKO�MAKSURA�MAKSUR�MAKASA�MAIZE�MAIYAMOK�MAITAIKHU�MAIRU�MAIMUAN�MAIMALAI�MAILBO�MAIKURO�MAIDEN�MAI�MAHJON�MAHHA�MAHAPRANA�MAHAPAKH�MAHAJAN�MAHAAPRAAN�MAH�MAGNIFYIN�MAGNET�MAGE�MAESI�MAENYI�MAENJET�MAEMVEUX�MAEMKPEN�MAEMGBIEE�MAEMBGBIEE�MAEMBA�MAEM�MAELEE�MAEKEUP�MADYA�MADU�MADDAH�MADDA�MADDA�MADD�MACRON-GRAVE�MACRON-BREVE�MACRON-ACUTE�MACRON�MACRO�MACHINE�MAAYYAA�MAAI�MAA�MA2�MA-7�MA-6�MA-5�MA-4�MA-3�MA-2�MA-1�M19�M19�M19�M19�M19�M19�M19�M19�M18�M18�M18�M18�M18�M18�M18�M18�M18�M18�M17�M17�M17�M17�M17�M17�M17�M17�M17�M17�M16�M16�M16�M16�M16�M16�M16�M16�M16�M16�M15�M15�M15�M15�M15�M15�M15�M15�M15�M15�M14�M14�M14�M14�M14�M14�M14�M14�M14�M14�M13�M13�M13�M13�M13�M13�M13�M13�M13�M13�M12�M12�M12�M12�M12�M12�M12�M12�M12�M12�M11�M11�M11�M11�M11�M11�M11�M11�M11�M11�M10�M10�M10�M10�M10�M10�M10�M10�M10�M10�M09�M09�M09�M09�M09�M09�M09�M09�M09�M09�M08�M08�M08�M08�M08�M08�M08�M08�M08�M08�M07�M07�M07�M07�M07�M07�M07�M07�M07�M07�M06�M06�M06�M06�M06�M06�M06�M06�M06�M06�M05�M05�M05�M05�M05�M05�M05�M05�M05�M05�M04�M04�M04�M04�M04�M044�M04�M043�M04�M042�M04�M041�M04�M040A�M040�M04�M039�M03�M038�M03�M037�M03�M036�M03�M035�M03�M034�M03�M033B�M033A�M033�M03�M032�M03�M031A�M031�M03�M030�M03�M029�M02�M028A�M028�M02�M027�M02�M026�M02�M025�M02�M024A�M024�M02�M023�M02�M022A�M022�M02�M021�M02�M020�M02�M019�M01�M018�M01�M017A�M017�M01�M016A�M016�M01�M015A�M015�M01�M014�M01�M013�M01�M012H�M012G�M012F�M012E�M012D�M012C�M012B�M012A�M012�M01�M011�M01�M010A�M010�M01�M009�M00�M008�M00�M007�M00�M006�M00�M005�M00�M004�M00�M003A�M003�M00�M002�M00�M001B�M001A�M001�M00�L�LYY�LYX�LYT�LYRX�LYR�LYP�LYIT�LYIN�LYDIA�LYCIA�LX�LWOO�LWO�LWII�LWI�LWE�LWAA�LWA�LUX�LUU�LUT�LURX�LUP�LUOX�LUOT�LUOP�LUO�LUNGSI�LUNAT�LU�LUL�LUIS�LUHUR�LUH�LU�LUGGAGE�LUGAL�LUGA�LUE�LU�LUB�LUAEP�LU3�LU2�LU�LRO�LRM�LRI�LRE�LOZENGE�LOZENG�LOX�LOWERE�LOWE�LOW-REVERSED-�LOW-MI�LOW-FALLIN�LOW-�LOV�LOURE�LOUDSPEAKER�LOUDL�LOTUS�LOTU�LOTIO�LOT�LOSSLESS�LORRY�LORRAINE�LOQ�LOP�LOOT�LOOPE�LOOP�LOO�LOON�LOO�LOO�LONSUM�LONGA�LONG�LONG-LEGGE�LONG-BRANCH-YR�LONG-BRANCH-SO�LONG-BRANCH-OS�LONG-BRANCH-MAD�LONG-BRANCH-HAGAL�LONG-BRANCH-A�LOMMAE�LOM�LO�LOLLIPOP�LOLL�LOG�LOGOTYP�LOGOGRA�LOG�LODESTONE�LOCOMOTIVE�LOCKING-SHIF�LOC�LOCATIVE�LOCATION-WALLPLAN�LOCATION-FLOORPLAN�LOCATION�LOCATIO�LOBSTER�LOA�LN�LLUU�LLOO�LLLUU�LLLU�LLLOO�LLLO�LLLII�LLLI�LLLEE�LLLE�LLLAU�LLLAI�LLLAA�LLLA�LLL�LLHA�LLAMA�LJUDIJE�LJE�LJ�LIZARD�LIX�LIWN�LIVR�LITTLE�LITTL�LITTE�LITR�LIT�LIS�LIS�LIR�LIQUI�LIQ�LIPSTICK�LIP�LI�LINKIN�LINKE�LIN�LINGSA�LINES�LINE�LINE-9�LINE-7�LINE-3�LINE-1�LIMMU4�LIMMU2�LIMMU�LIMM�LIMITE�LIMITATION�LIMIT�LIME�LIMB�LIMB�LIM�LILY�LILITH�LIL�LIGHTNING�LIGHTNIN�LIGHTHOUSE�LIGHT�LIGATIN�LIFTER�LIFE�LIEX�LIET�LIEP�LIEE�LIE�LID�LICKIN�LIBRA�LIBERTY�LIABILIT�LHII�LHAVIYANI�LHA�LHAA�LH�LEZH�LEX�LEVITATING�LEUM�LEUAEP�LEUAEM�LEU�LE�LETTERS�LETTER�LE�LESSE�LESS-THAN�LESS-THA�LESH�LEPCH�LEP�LEOPARD�LEO�LENTICULA�LENIS�LENI�LENGTHENER�LENGTH-7�LENGTH-6�LENGTH-5�LENGTH-4�LENGTH-3�LENGTH-2�LENGTH-1�LENGT�LENGA�LENG�LEMON�LEMOI�LELET�LELE�LE�LEIMMA�LEIMM�LEI�LEGS�LEGION�LEGETO�LEG�LE�LEFTWARDS�LEFT-TO-RIGH�LEFT-STE�LEFT-SID�LEFT-SHADE�LEFT-POINTIN�LEFT-LIGHTE�LEFT-HANDE�LEFT-HAN�LEFT-FACIN�LEFT�LEERAEWA�LEEK�LEEEE�LEDGER�LEATHER�LEAF�LEAF�LEA�LEADER�LEA�LDAN�LD2�LC�LC�LAZ�LAYANNA�LAX�LAW�LA�LAULA�LAUKA�LAUJ�LAUGHING�LATINAT�LATIK�LATERA�LAT�LAS�LARYNGEA�LAR�LARGEST�LARGE�LARGE�LARG�LAQ�LAPAQ�LA�LANTERN�LANGUAG�LANES�LAN�LAN�LAMP�LAMEDH�LAMED�LAME�LAME�LAM�LAMDA�LAMD�LAMBD�LAMADH�LAL�LA�LAKKHANGYAO�LAKHAN�LAKH�LAK�LAK-749�LAK-724�LAK-668�LAK-648�LAK-64�LAK-636�LAK-617�LAK-61�LAK-608�LAK-550�LAK-495�LAK-493�LAK-492�LAK-490�LAK-483�LAK-470�LAK-457�LAK-450�LAK-449�LAK-44�LAK-441�LAK-390�LAK-384�LAK-383�LAK-348�LAK-347�LAK-343�LAK-266�LAK-265�LAK-238�LAK-228�LAK-225�LAK-220�LAK-219�LAK-210�LAK-142�LAK-130�LAK-092�LAK-081�LAK-08�LAK-080�LAK-07�LAK-062�LAK-051�LAK-050�LAK-030�LAK-025�LAK-021�LAK-020�LAK-003�LAJANYALAN�LAIN�LA�LAHSHU�LAH�LAGUS�LAG�LAGAR�LAGA�LAGAB�LAGA�LAEV�LAE�LAD�LACROSS�LACK�LACA�LABOURING�LABOR�LABIALIZATIO�LABIA�LABEL�LABAT�LA�LAANAE�LAAN�LAAMU�LAAM�LAAI�L6�L4�L3�L2�L006A�L002A�L-TYP�L-SHAPE�KYURII�KYU�KYO�KYLISMA�KYI�KYE�KYATHO�KYAA�KYA�KXWI�KXWEE�KXWE�KXWAA�KXWA�KXU�KXO�KXI�KXEE�KXE�KXAA�KXA�KWV�KWU318�KWOO�KWO�KWM�KWII�KWI�KWEE�KWE�KWB�KWAY�KWAET�KWAA�KVA�KV�KUZHI�KUX�KUV�KUUH�KUT�KUSMA�KUSHU2�KUSHU�KURX�KURUZEIRO�KURT�KUROONE�KUR�KU�KUQ�KUOX�KUOP�KUO�KUOM�KUO�KUNG�KUNDDALIYA�KUL�KU�KUG�KUET�KUB�KUAV�KUAB�KUA�KU7�KU4�KU�KU3�KU�KU-7�KU-6�KU-5�KU-4�KU-3�KU-2�KU-1�KT�KSSUU�KSSU�KSSOO�KSSO�KSSII�KSSI�KSSEE�KSSE�KSSAU�KSSAI�KSSAA�KSSA�KSS�KSI�KRONOS�KREMASTI�KRATIMOYPORROON�KRATIMOKOUFISMA�KRATIMATA�KRATIM�KPU�KPOQ�KPOO�KPO�KPI�KPEUX�KPEE�KPE�KPARAQ�KPAN�KPAH�KPA�KP�KOX�KOVUU�KOV�KOTO�KORUNA�KORONIS�KOREA�KORANI�KOQNDON�KOPPA�KOP�KOOV�KOOPO�KOOMUUT�KOOB�KOO�KONTEVMA�KONTEVM�KOM�KOMBUVA�KOMBUV�KOMB�KOKO�KOKE�KOK�KO�KOINI�KOI�KO�KOH�KOGHOM�KOET�KOB�KOALA�KOA�KO-KI�KO-3�KO-2�KO-1�KNUCKLES�KNUCKLE�KNOBS�KNIGHT-ROOK�KNIGHT-QUEEN�KNIGHT-BISHOP�KNIGHT�KNIGH�KNIFE�KNIF�KNEELIN�KM�K�KLITON�KLASMA�KLASM�KLA�KL�KKO�KKI�KKEE�KKE�KKA�KK�KJE�KIYEOK-TIKEUT�KIYEOK-SIOS-KIYEOK�KIYEOK-RIEUL�KIYEOK-PIEUP�KIYEOK-NIEUN�KIYEOK-KHIEUKH�KIYEOK-CHIEUCH�KIYEO�KIX�KIWIFRUIT�KIW�KIV�KITE�KIT�KISSIN�KISS�KIS�KISIM5�KISIM�KISH�KISAL�KIROWATTO�KIROMEETORU�KIROGURAMU�KIRO�KIRGHI�KIQ�KIP�KI�KINSHIP�KINN�KINDERGARTEN�KIMONO�KILLER�KIIZH�KII�KIH�KIEX�KIEVA�KIEP�KIEEM�KIE�KID�KI�KICK�KIB�KIAV�KIAB�KI-8�KI-7�KI-6�KI-5�KI-4�KI-3�KI-2�KI-1�KHZ�KHWAI�KHUEN-LU�KHUE�KHUDAWAD�KHUDAM�KHUAT�KHOU�KHO�KHONNA�KHON�KHOMUT�KHOJK�KHO�KH�KHM�KHIT�KHINYA�KHIEUK�KHI�KH�KHHO�KHHA�KHETH�KHEI�KHEE�KHE�KHAV�KHAROSHTH�KHAR�KHAPH�KHAN�KHAND�KHAMT�KHAKASSIA�KHAI�KHAH�KHA�KHAB�KHAA�KG�KEYCAP�KEYCA�KEYBOARD�KEYBOAR�KEX�KEV�KEUYEUX�KEUSHEUAEP�KEUSEUX�KEUPUQ�KEUO�KEUM�KEUKEUTNDA�KEUKAQ�KEUAETMEUN�KEUAERI�KETT�KESH2�KERET�KEOW�KENTIMATA�KENTIMAT�KENTIM�KENAT�KEN�KE�KEMPUL�KEMPU�KEMPLI�KEMPL�KEMPHRENG�KEMBANG�KELVI�KEHEH�KEHE�KEH�KEFULA�KEEV�KEESU�KEEPIN�KEENG�KEEB�KEB�KEAAE�KCAL�KB�KAZAK�KAYANNA�KAYA�KAX�KAWV�KAWI�KAWB�KAVYKA�KAVYK�KAV�KAUV�KAUNA�KAU�KAUB�KATO�KATHISTI�KATHAK�KATAVASMA�KATAV�KATAKANA-HIRAGAN�KASRATAN�KASRATA�KASRA�KASR�KASKAL�KASKA�KASHMIR�KARSHANA�KARORII�KARORAN�KAROR�KAR�KARE�KARATTO�KARAN�KAPYEOUNSSANGPIEUP�KAPYEOUNRIEUL�KAPYEOUNPHIEUPH�KAPYEOUNMIEUM�KAPPA�KAPP�KAPO�KAPH�KAPAL�KAPA�KA�KANTAJ�KANNAD�KANGAROO�KANG�KAN�KANAKO�KAM4�KAM2�KAM�KAKO�KAKABAT�KAK�KA�KAIV�KAITH�KAIRI�KAIB�KAI�KA�KAFA�KAF�KA�KAD5�KAD�KAD4�KAD3�KAD�KAD2�KAD�KAB�KAB�KAAV�KAAI�KAAFU�KAAF�KAACU�KAABA�KAAB�KA2�KA�KA-KE�KA-9�KA-8�KA-7�KA-6�KA-5�KA-4�KA-3�KA-2�KA-11�KA-10�KA-1�K008�K007�K006�K005�K004�K003�K002�K001�JWA�JUU�JUT�JUSTIFICATION�JUPITER�JUOT�JUOP�JUNO�JUNGSEON�JUNE�JULY�JUGGLING�JUEUI�JUDUL�JUDGE�JUDEO-SPANIS�JOYSTICK�JOYOU�JOY�JOVE�JO�JONG�JON�JOKER�JOINTS�JOINED�JOIN�JOA�JNYA�JJYX�JJYT�JJYP�JJY�JJUX�JJUT�JJURX�JJUR�JJUP�JJUOX�JJUOP�JJUO�JJU�JJOX�JJOT�JJOP�JJO�JJIX�JJIT�JJIP�JJIEX�JJIET�JJIEP�JJIE�JJI�JJEE�JJE�JJA�JIL�JIIM�JII�JIHVAMULIYA�JIGSA�JIA�JHOX�JHO�JHEH�JHAYIN�JHAN�JHAM�JHAA�JHA�JEU�JERUSALEM�JERA�JERA�JER�JEH�JE�JEGOGAN�JEEM�JEE�JEANS�JAYN�JAYIN�JAYANNA�JAW�JAVIYANI�JAVANES�JAU�JAR�JAPANES�JAPAN�JANUARY�JALLAJALALOUHOU�JAI�JAI�JAH�JADE�JACKS�JACK-O-LANTERN�JAC�J-SIMPLIFIE�IZHITSA�IZHITS�IZHE�IZAKAY�IYEK�IYANNA�IUJA�IT�ITERATIO�ITEM�ISSHAR�ISOSCELE�ISON�ISO�ISOLATE�ISLAND�ISEN-ISEN�ISAKI�IS-PILLA�IRUYANNA�IRUUYANNA�IRON-COPPE�IRON�IRB�IOTIFIE�IOTATE�IOTA�IOT�IOR�IONG�IODHADH�INVISIBL�INVERTED�INVERTE�INVERTEBRATE�INVERS�INTRODUCER�INTI�INTERSYLLABI�INTERSECTION�INTERSECTIO�INTERSECTIN�INTERROBANG�INTERROBAN�INTERPOLATIO�INTERLOCKE�INTERLINEA�INTERLACE�INTERIO�INTERES�INTERCALATE�INTEGRATION�INTEGRATIO�INTEGRAL�INTEGRA�INSULA�INSTRUMENTA�INSIDE�INSID�INSERTIO�INSER�INSECT�INSCRIPTIONA�INPU�INNOCENCE�INNN�INNER�INNE�INN�ININGU�INHIBI�INHEREN�INHALE�INGWAZ�INFORMATIO�INFLUENCE�INFINITY�INFINIT�INDUSTRIA�INDIREC�INDICTIO�INDICATOR�INDICATO�INDI�INDIA�INDEX�INDEPENDEN�INCREMENT�INCREASE�INCREASE�INCREAS�INCOMPLET�INCOMIN�INCLUDIN�INCH�INBO�INAP�IN-ALAF�IMPERIA�IMPERFECTU�IMPERFECTA�IMPERFECT�IMN�IMISEO�IMIN3�IMIN�IMI�IMIFTHORON�IMIFTHORA�IMIFONON�IMIDIARGON�IMAG�ILUYANNA�ILUY�ILUUYANNA�ILUT�ILIMMU4�ILIMMU3�ILIMMU�ILIMM�IL2�IKARA�IKAR�IJ�IIYANNA�IGI�IG�IGGWS�IFIN�IEUNG-TIKEUT�IEUNG-THIEUTH�IEUNG-RIEUL�IEUNG-PIEUP�IEUNG-PHIEUPH�IEUNG-CIEUC�IEUNG-CHIEUCH�IEUN�IDLE�IDIM�IDI�IDEOGRAPH-FAD9�IDEOGRAPH-FAD8�IDEOGRAPH-FAD7�IDEOGRAPH-FAD6�IDEOGRAPH-FAD5�IDEOGRAPH-FAD4�IDEOGRAPH-FAD3�IDEOGRAPH-FAD2�IDEOGRAPH-FAD1�IDEOGRAPH-FAD0�IDEOGRAPH-FACF�IDEOGRAPH-FACE�IDEOGRAPH-FACD�IDEOGRAPH-FACC�IDEOGRAPH-FACB�IDEOGRAPH-FACA�IDEOGRAPH-FAC9�IDEOGRAPH-FAC8�IDEOGRAPH-FAC7�IDEOGRAPH-FAC6�IDEOGRAPH-FAC5�IDEOGRAPH-FAC4�IDEOGRAPH-FAC3�IDEOGRAPH-FAC2�IDEOGRAPH-FAC1�IDEOGRAPH-FAC0�IDEOGRAPH-FABF�IDEOGRAPH-FABE�IDEOGRAPH-FABD�IDEOGRAPH-FABC�IDEOGRAPH-FABB�IDEOGRAPH-FABA�IDEOGRAPH-FAB9�IDEOGRAPH-FAB8�IDEOGRAPH-FAB7�IDEOGRAPH-FAB6�IDEOGRAPH-FAB5�IDEOGRAPH-FAB4�IDEOGRAPH-FAB3�IDEOGRAPH-FAB2�IDEOGRAPH-FAB1�IDEOGRAPH-FAB0�IDEOGRAPH-FAAF�IDEOGRAPH-FAAE�IDEOGRAPH-FAAD�IDEOGRAPH-FAAC�IDEOGRAPH-FAAB�IDEOGRAPH-FAAA�IDEOGRAPH-FAA9�IDEOGRAPH-FAA8�IDEOGRAPH-FAA7�IDEOGRAPH-FAA6�IDEOGRAPH-FAA5�IDEOGRAPH-FAA4�IDEOGRAPH-FAA3�IDEOGRAPH-FAA2�IDEOGRAPH-FAA1�IDEOGRAPH-FAA0�IDEOGRAPH-FA9F�IDEOGRAPH-FA9E�IDEOGRAPH-FA9D�IDEOGRAPH-FA9C�IDEOGRAPH-FA9B�IDEOGRAPH-FA9A�IDEOGRAPH-FA99�IDEOGRAPH-FA98�IDEOGRAPH-FA97�IDEOGRAPH-FA96�IDEOGRAPH-FA95�IDEOGRAPH-FA94�IDEOGRAPH-FA93�IDEOGRAPH-FA92�IDEOGRAPH-FA91�IDEOGRAPH-FA90�IDEOGRAPH-FA8F�IDEOGRAPH-FA8E�IDEOGRAPH-FA8D�IDEOGRAPH-FA8C�IDEOGRAPH-FA8B�IDEOGRAPH-FA8A�IDEOGRAPH-FA89�IDEOGRAPH-FA88�IDEOGRAPH-FA87�IDEOGRAPH-FA86�IDEOGRAPH-FA85�IDEOGRAPH-FA84�IDEOGRAPH-FA83�IDEOGRAPH-FA82�IDEOGRAPH-FA81�IDEOGRAPH-FA80�IDEOGRAPH-FA7F�IDEOGRAPH-FA7E�IDEOGRAPH-FA7D�IDEOGRAPH-FA7C�IDEOGRAPH-FA7B�IDEOGRAPH-FA7A�IDEOGRAPH-FA79�IDEOGRAPH-FA78�IDEOGRAPH-FA77�IDEOGRAPH-FA76�IDEOGRAPH-FA75�IDEOGRAPH-FA74�IDEOGRAPH-FA73�IDEOGRAPH-FA72�IDEOGRAPH-FA71�IDEOGRAPH-FA70�IDEOGRAPH-FA6D�IDEOGRAPH-FA6C�IDEOGRAPH-FA6B�IDEOGRAPH-FA6A�IDEOGRAPH-FA69�IDEOGRAPH-FA68�IDEOGRAPH-FA67�IDEOGRAPH-FA66�IDEOGRAPH-FA65�IDEOGRAPH-FA64�IDEOGRAPH-FA63�IDEOGRAPH-FA62�IDEOGRAPH-FA61�IDEOGRAPH-FA60�IDEOGRAPH-FA5F�IDEOGRAPH-FA5E�IDEOGRAPH-FA5D�IDEOGRAPH-FA5C�IDEOGRAPH-FA5B�IDEOGRAPH-FA5A�IDEOGRAPH-FA59�IDEOGRAPH-FA58�IDEOGRAPH-FA57�IDEOGRAPH-FA56�IDEOGRAPH-FA55�IDEOGRAPH-FA54�IDEOGRAPH-FA53�IDEOGRAPH-FA52�IDEOGRAPH-FA51�IDEOGRAPH-FA50�IDEOGRAPH-FA4F�IDEOGRAPH-FA4E�IDEOGRAPH-FA4D�IDEOGRAPH-FA4C�IDEOGRAPH-FA4B�IDEOGRAPH-FA4A�IDEOGRAPH-FA49�IDEOGRAPH-FA48�IDEOGRAPH-FA47�IDEOGRAPH-FA46�IDEOGRAPH-FA45�IDEOGRAPH-FA44�IDEOGRAPH-FA43�IDEOGRAPH-FA42�IDEOGRAPH-FA41�IDEOGRAPH-FA40�IDEOGRAPH-FA3F�IDEOGRAPH-FA3E�IDEOGRAPH-FA3D�IDEOGRAPH-FA3C�IDEOGRAPH-FA3B�IDEOGRAPH-FA3A�IDEOGRAPH-FA39�IDEOGRAPH-FA38�IDEOGRAPH-FA37�IDEOGRAPH-FA36�IDEOGRAPH-FA35�IDEOGRAPH-FA34�IDEOGRAPH-FA33�IDEOGRAPH-FA32�IDEOGRAPH-FA31�IDEOGRAPH-FA30�IDEOGRAPH-FA2F�IDEOGRAPH-FA2E�IDEOGRAPH-FA2D�IDEOGRAPH-FA2C�IDEOGRAPH-FA2B�IDEOGRAPH-FA2A�IDEOGRAPH-FA29�IDEOGRAPH-FA28�IDEOGRAPH-FA27�IDEOGRAPH-FA26�IDEOGRAPH-FA25�IDEOGRAPH-FA24�IDEOGRAPH-FA23�IDEOGRAPH-FA22�IDEOGRAPH-FA21�IDEOGRAPH-FA20�IDEOGRAPH-FA1F�IDEOGRAPH-FA1E�IDEOGRAPH-FA1D�IDEOGRAPH-FA1C�IDEOGRAPH-FA1B�IDEOGRAPH-FA1A�IDEOGRAPH-FA19�IDEOGRAPH-FA18�IDEOGRAPH-FA17�IDEOGRAPH-FA16�IDEOGRAPH-FA15�IDEOGRAPH-FA14�IDEOGRAPH-FA13�IDEOGRAPH-FA12�IDEOGRAPH-FA11�IDEOGRAPH-FA10�IDEOGRAPH-FA0F�IDEOGRAPH-FA0E�IDEOGRAPH-FA0D�IDEOGRAPH-FA0C�IDEOGRAPH-FA0B�IDEOGRAPH-FA0A�IDEOGRAPH-FA09�IDEOGRAPH-FA08�IDEOGRAPH-FA07�IDEOGRAPH-FA06�IDEOGRAPH-FA05�IDEOGRAPH-FA04�IDEOGRAPH-FA03�IDEOGRAPH-FA02�IDEOGRAPH-FA01�IDEOGRAPH-FA00�IDEOGRAPH-F9FF�IDEOGRAPH-F9FE�IDEOGRAPH-F9FD�IDEOGRAPH-F9FC�IDEOGRAPH-F9FB�IDEOGRAPH-F9FA�IDEOGRAPH-F9F9�IDEOGRAPH-F9F8�IDEOGRAPH-F9F7�IDEOGRAPH-F9F6�IDEOGRAPH-F9F5�IDEOGRAPH-F9F4�IDEOGRAPH-F9F3�IDEOGRAPH-F9F2�IDEOGRAPH-F9F1�IDEOGRAPH-F9F0�IDEOGRAPH-F9EF�IDEOGRAPH-F9EE�IDEOGRAPH-F9ED�IDEOGRAPH-F9EC�IDEOGRAPH-F9EB�IDEOGRAPH-F9EA�IDEOGRAPH-F9E9�IDEOGRAPH-F9E8�IDEOGRAPH-F9E7�IDEOGRAPH-F9E6�IDEOGRAPH-F9E5�IDEOGRAPH-F9E4�IDEOGRAPH-F9E3�IDEOGRAPH-F9E2�IDEOGRAPH-F9E1�IDEOGRAPH-F9E0�IDEOGRAPH-F9DF�IDEOGRAPH-F9DE�IDEOGRAPH-F9DD�IDEOGRAPH-F9DC�IDEOGRAPH-F9DB�IDEOGRAPH-F9DA�IDEOGRAPH-F9D9�IDEOGRAPH-F9D8�IDEOGRAPH-F9D7�IDEOGRAPH-F9D6�IDEOGRAPH-F9D5�IDEOGRAPH-F9D4�IDEOGRAPH-F9D3�IDEOGRAPH-F9D2�IDEOGRAPH-F9D1�IDEOGRAPH-F9D0�IDEOGRAPH-F9CF�IDEOGRAPH-F9CE�IDEOGRAPH-F9CD�IDEOGRAPH-F9CC�IDEOGRAPH-F9CB�IDEOGRAPH-F9CA�IDEOGRAPH-F9C9�IDEOGRAPH-F9C8�IDEOGRAPH-F9C7�IDEOGRAPH-F9C6�IDEOGRAPH-F9C5�IDEOGRAPH-F9C4�IDEOGRAPH-F9C3�IDEOGRAPH-F9C2�IDEOGRAPH-F9C1�IDEOGRAPH-F9C0�IDEOGRAPH-F9BF�IDEOGRAPH-F9BE�IDEOGRAPH-F9BD�IDEOGRAPH-F9BC�IDEOGRAPH-F9BB�IDEOGRAPH-F9BA�IDEOGRAPH-F9B9�IDEOGRAPH-F9B8�IDEOGRAPH-F9B7�IDEOGRAPH-F9B6�IDEOGRAPH-F9B5�IDEOGRAPH-F9B4�IDEOGRAPH-F9B3�IDEOGRAPH-F9B2�IDEOGRAPH-F9B1�IDEOGRAPH-F9B0�IDEOGRAPH-F9AF�IDEOGRAPH-F9AE�IDEOGRAPH-F9AD�IDEOGRAPH-F9AC�IDEOGRAPH-F9AB�IDEOGRAPH-F9AA�IDEOGRAPH-F9A9�IDEOGRAPH-F9A8�IDEOGRAPH-F9A7�IDEOGRAPH-F9A6�IDEOGRAPH-F9A5�IDEOGRAPH-F9A4�IDEOGRAPH-F9A3�IDEOGRAPH-F9A2�IDEOGRAPH-F9A1�IDEOGRAPH-F9A0�IDEOGRAPH-F99F�IDEOGRAPH-F99E�IDEOGRAPH-F99D�IDEOGRAPH-F99C�IDEOGRAPH-F99B�IDEOGRAPH-F99A�IDEOGRAPH-F999�IDEOGRAPH-F998�IDEOGRAPH-F997�IDEOGRAPH-F996�IDEOGRAPH-F995�IDEOGRAPH-F994�IDEOGRAPH-F993�IDEOGRAPH-F992�IDEOGRAPH-F991�IDEOGRAPH-F990�IDEOGRAPH-F98F�IDEOGRAPH-F98E�IDEOGRAPH-F98D�IDEOGRAPH-F98C�IDEOGRAPH-F98B�IDEOGRAPH-F98A�IDEOGRAPH-F989�IDEOGRAPH-F988�IDEOGRAPH-F987�IDEOGRAPH-F986�IDEOGRAPH-F985�IDEOGRAPH-F984�IDEOGRAPH-F983�IDEOGRAPH-F982�IDEOGRAPH-F981�IDEOGRAPH-F980�IDEOGRAPH-F97F�IDEOGRAPH-F97E�IDEOGRAPH-F97D�IDEOGRAPH-F97C�IDEOGRAPH-F97B�IDEOGRAPH-F97A�IDEOGRAPH-F979�IDEOGRAPH-F978�IDEOGRAPH-F977�IDEOGRAPH-F976�IDEOGRAPH-F975�IDEOGRAPH-F974�IDEOGRAPH-F973�IDEOGRAPH-F972�IDEOGRAPH-F971�IDEOGRAPH-F970�IDEOGRAPH-F96F�IDEOGRAPH-F96E�IDEOGRAPH-F96D�IDEOGRAPH-F96C�IDEOGRAPH-F96B�IDEOGRAPH-F96A�IDEOGRAPH-F969�IDEOGRAPH-F968�IDEOGRAPH-F967�IDEOGRAPH-F966�IDEOGRAPH-F965�IDEOGRAPH-F964�IDEOGRAPH-F963�IDEOGRAPH-F962�IDEOGRAPH-F961�IDEOGRAPH-F960�IDEOGRAPH-F95F�IDEOGRAPH-F95E�IDEOGRAPH-F95D�IDEOGRAPH-F95C�IDEOGRAPH-F95B�IDEOGRAPH-F95A�IDEOGRAPH-F959�IDEOGRAPH-F958�IDEOGRAPH-F957�IDEOGRAPH-F956�IDEOGRAPH-F955�IDEOGRAPH-F954�IDEOGRAPH-F953�IDEOGRAPH-F952�IDEOGRAPH-F951�IDEOGRAPH-F950�IDEOGRAPH-F94F�IDEOGRAPH-F94E�IDEOGRAPH-F94D�IDEOGRAPH-F94C�IDEOGRAPH-F94B�IDEOGRAPH-F94A�IDEOGRAPH-F949�IDEOGRAPH-F948�IDEOGRAPH-F947�IDEOGRAPH-F946�IDEOGRAPH-F945�IDEOGRAPH-F944�IDEOGRAPH-F943�IDEOGRAPH-F942�IDEOGRAPH-F941�IDEOGRAPH-F940�IDEOGRAPH-F93F�IDEOGRAPH-F93E�IDEOGRAPH-F93D�IDEOGRAPH-F93C�IDEOGRAPH-F93B�IDEOGRAPH-F93A�IDEOGRAPH-F939�IDEOGRAPH-F938�IDEOGRAPH-F937�IDEOGRAPH-F936�IDEOGRAPH-F935�IDEOGRAPH-F934�IDEOGRAPH-F933�IDEOGRAPH-F932�IDEOGRAPH-F931�IDEOGRAPH-F930�IDEOGRAPH-F92F�IDEOGRAPH-F92E�IDEOGRAPH-F92D�IDEOGRAPH-F92C�IDEOGRAPH-F92B�IDEOGRAPH-F92A�IDEOGRAPH-F929�IDEOGRAPH-F928�IDEOGRAPH-F927�IDEOGRAPH-F926�IDEOGRAPH-F925�IDEOGRAPH-F924�IDEOGRAPH-F923�IDEOGRAPH-F922�IDEOGRAPH-F921�IDEOGRAPH-F920�IDEOGRAPH-F91F�IDEOGRAPH-F91E�IDEOGRAPH-F91D�IDEOGRAPH-F91C�IDEOGRAPH-F91B�IDEOGRAPH-F91A�IDEOGRAPH-F919�IDEOGRAPH-F918�IDEOGRAPH-F917�IDEOGRAPH-F916�IDEOGRAPH-F915�IDEOGRAPH-F914�IDEOGRAPH-F913�IDEOGRAPH-F912�IDEOGRAPH-F911�IDEOGRAPH-F910�IDEOGRAPH-F90F�IDEOGRAPH-F90E�IDEOGRAPH-F90D�IDEOGRAPH-F90C�IDEOGRAPH-F90B�IDEOGRAPH-F90A�IDEOGRAPH-F909�IDEOGRAPH-F908�IDEOGRAPH-F907�IDEOGRAPH-F906�IDEOGRAPH-F905�IDEOGRAPH-F904�IDEOGRAPH-F903�IDEOGRAPH-F902�IDEOGRAPH-F901�IDEOGRAPH-F900�IDEOGRAPH-914D�IDEOGRAPH-904A�IDEOGRAPH-8D70�IDEOGRAPH-8CA9�IDEOGRAPH-89E3�IDEOGRAPH-7D42�IDEOGRAPH-7A7A�IDEOGRAPH-7981�IDEOGRAPH-76D7�IDEOGRAPH-7533�IDEOGRAPH-751F�IDEOGRAPH-7121�IDEOGRAPH-70B9�IDEOGRAPH-6F14�IDEOGRAPH-6E80�IDEOGRAPH-672C�IDEOGRAPH-6709�IDEOGRAPH-6708�IDEOGRAPH-6620�IDEOGRAPH-65B0�IDEOGRAPH-6599�IDEOGRAPH-6557�IDEOGRAPH-6355�IDEOGRAPH-6307�IDEOGRAPH-6295�IDEOGRAPH-6253�IDEOGRAPH-624B�IDEOGRAPH-5F8C�IDEOGRAPH-5DE6�IDEOGRAPH-5B89�IDEOGRAPH-5B57�IDEOGRAPH-5929�IDEOGRAPH-591A�IDEOGRAPH-58F0�IDEOGRAPH-55B6�IDEOGRAPH-5439�IDEOGRAPH-5408�IDEOGRAPH-53F3�IDEOGRAPH-53CC�IDEOGRAPH-52DD�IDEOGRAPH-5272�IDEOGRAPH-524D�IDEOGRAPH-521D�IDEOGRAPH-518D�IDEOGRAPH-4EA4�IDEOGRAPH-4E8C�IDEOGRAPH-4E2D�IDEOGRAPH-4E09�IDEOGRAPH-4E00�IDEOGRAPH-2FA1D�IDEOGRAPH-2FA1C�IDEOGRAPH-2FA1B�IDEOGRAPH-2FA1A�IDEOGRAPH-2FA19�IDEOGRAPH-2FA18�IDEOGRAPH-2FA17�IDEOGRAPH-2FA16�IDEOGRAPH-2FA15�IDEOGRAPH-2FA14�IDEOGRAPH-2FA13�IDEOGRAPH-2FA12�IDEOGRAPH-2FA11�IDEOGRAPH-2FA10�IDEOGRAPH-2FA0F�IDEOGRAPH-2FA0E�IDEOGRAPH-2FA0D�IDEOGRAPH-2FA0C�IDEOGRAPH-2FA0B�IDEOGRAPH-2FA0A�IDEOGRAPH-2FA09�IDEOGRAPH-2FA08�IDEOGRAPH-2FA07�IDEOGRAPH-2FA06�IDEOGRAPH-2FA05�IDEOGRAPH-2FA04�IDEOGRAPH-2FA03�IDEOGRAPH-2FA02�IDEOGRAPH-2FA01�IDEOGRAPH-2FA00�IDEOGRAPH-2F9FF�IDEOGRAPH-2F9FE�IDEOGRAPH-2F9FD�IDEOGRAPH-2F9FC�IDEOGRAPH-2F9FB�IDEOGRAPH-2F9FA�IDEOGRAPH-2F9F9�IDEOGRAPH-2F9F8�IDEOGRAPH-2F9F7�IDEOGRAPH-2F9F6�IDEOGRAPH-2F9F5�IDEOGRAPH-2F9F4�IDEOGRAPH-2F9F3�IDEOGRAPH-2F9F2�IDEOGRAPH-2F9F1�IDEOGRAPH-2F9F0�IDEOGRAPH-2F9EF�IDEOGRAPH-2F9EE�IDEOGRAPH-2F9ED�IDEOGRAPH-2F9EC�IDEOGRAPH-2F9EB�IDEOGRAPH-2F9EA�IDEOGRAPH-2F9E9�IDEOGRAPH-2F9E8�IDEOGRAPH-2F9E7�IDEOGRAPH-2F9E6�IDEOGRAPH-2F9E5�IDEOGRAPH-2F9E4�IDEOGRAPH-2F9E3�IDEOGRAPH-2F9E2�IDEOGRAPH-2F9E1�IDEOGRAPH-2F9E0�IDEOGRAPH-2F9DF�IDEOGRAPH-2F9DE�IDEOGRAPH-2F9DD�IDEOGRAPH-2F9DC�IDEOGRAPH-2F9DB�IDEOGRAPH-2F9DA�IDEOGRAPH-2F9D9�IDEOGRAPH-2F9D8�IDEOGRAPH-2F9D7�IDEOGRAPH-2F9D6�IDEOGRAPH-2F9D5�IDEOGRAPH-2F9D4�IDEOGRAPH-2F9D3�IDEOGRAPH-2F9D2�IDEOGRAPH-2F9D1�IDEOGRAPH-2F9D0�IDEOGRAPH-2F9CF�IDEOGRAPH-2F9CE�IDEOGRAPH-2F9CD�IDEOGRAPH-2F9CC�IDEOGRAPH-2F9CB�IDEOGRAPH-2F9CA�IDEOGRAPH-2F9C9�IDEOGRAPH-2F9C8�IDEOGRAPH-2F9C7�IDEOGRAPH-2F9C6�IDEOGRAPH-2F9C5�IDEOGRAPH-2F9C4�IDEOGRAPH-2F9C3�IDEOGRAPH-2F9C2�IDEOGRAPH-2F9C1�IDEOGRAPH-2F9C0�IDEOGRAPH-2F9BF�IDEOGRAPH-2F9BE�IDEOGRAPH-2F9BD�IDEOGRAPH-2F9BC�IDEOGRAPH-2F9BB�IDEOGRAPH-2F9BA�IDEOGRAPH-2F9B9�IDEOGRAPH-2F9B8�IDEOGRAPH-2F9B7�IDEOGRAPH-2F9B6�IDEOGRAPH-2F9B5�IDEOGRAPH-2F9B4�IDEOGRAPH-2F9B3�IDEOGRAPH-2F9B2�IDEOGRAPH-2F9B1�IDEOGRAPH-2F9B0�IDEOGRAPH-2F9AF�IDEOGRAPH-2F9AE�IDEOGRAPH-2F9AD�IDEOGRAPH-2F9AC�IDEOGRAPH-2F9AB�IDEOGRAPH-2F9AA�IDEOGRAPH-2F9A9�IDEOGRAPH-2F9A8�IDEOGRAPH-2F9A7�IDEOGRAPH-2F9A6�IDEOGRAPH-2F9A5�IDEOGRAPH-2F9A4�IDEOGRAPH-2F9A3�IDEOGRAPH-2F9A2�IDEOGRAPH-2F9A1�IDEOGRAPH-2F9A0�IDEOGRAPH-2F99F�IDEOGRAPH-2F99E�IDEOGRAPH-2F99D�IDEOGRAPH-2F99C�IDEOGRAPH-2F99B�IDEOGRAPH-2F99A�IDEOGRAPH-2F999�IDEOGRAPH-2F998�IDEOGRAPH-2F997�IDEOGRAPH-2F996�IDEOGRAPH-2F995�IDEOGRAPH-2F994�IDEOGRAPH-2F993�IDEOGRAPH-2F992�IDEOGRAPH-2F991�IDEOGRAPH-2F990�IDEOGRAPH-2F98F�IDEOGRAPH-2F98E�IDEOGRAPH-2F98D�IDEOGRAPH-2F98C�IDEOGRAPH-2F98B�IDEOGRAPH-2F98A�IDEOGRAPH-2F989�IDEOGRAPH-2F988�IDEOGRAPH-2F987�IDEOGRAPH-2F986�IDEOGRAPH-2F985�IDEOGRAPH-2F984�IDEOGRAPH-2F983�IDEOGRAPH-2F982�IDEOGRAPH-2F981�IDEOGRAPH-2F980�IDEOGRAPH-2F97F�IDEOGRAPH-2F97E�IDEOGRAPH-2F97D�IDEOGRAPH-2F97C�IDEOGRAPH-2F97B�IDEOGRAPH-2F97A�IDEOGRAPH-2F979�IDEOGRAPH-2F978�IDEOGRAPH-2F977�IDEOGRAPH-2F976�IDEOGRAPH-2F975�IDEOGRAPH-2F974�IDEOGRAPH-2F973�IDEOGRAPH-2F972�IDEOGRAPH-2F971�IDEOGRAPH-2F970�IDEOGRAPH-2F96F�IDEOGRAPH-2F96E�IDEOGRAPH-2F96D�IDEOGRAPH-2F96C�IDEOGRAPH-2F96B�IDEOGRAPH-2F96A�IDEOGRAPH-2F969�IDEOGRAPH-2F968�IDEOGRAPH-2F967�IDEOGRAPH-2F966�IDEOGRAPH-2F965�IDEOGRAPH-2F964�IDEOGRAPH-2F963�IDEOGRAPH-2F962�IDEOGRAPH-2F961�IDEOGRAPH-2F960�IDEOGRAPH-2F95F�IDEOGRAPH-2F95E�IDEOGRAPH-2F95D�IDEOGRAPH-2F95C�IDEOGRAPH-2F95B�IDEOGRAPH-2F95A�IDEOGRAPH-2F959�IDEOGRAPH-2F958�IDEOGRAPH-2F957�IDEOGRAPH-2F956�IDEOGRAPH-2F955�IDEOGRAPH-2F954�IDEOGRAPH-2F953�IDEOGRAPH-2F952�IDEOGRAPH-2F951�IDEOGRAPH-2F950�IDEOGRAPH-2F94F�IDEOGRAPH-2F94E�IDEOGRAPH-2F94D�IDEOGRAPH-2F94C�IDEOGRAPH-2F94B�IDEOGRAPH-2F94A�IDEOGRAPH-2F949�IDEOGRAPH-2F948�IDEOGRAPH-2F947�IDEOGRAPH-2F946�IDEOGRAPH-2F945�IDEOGRAPH-2F944�IDEOGRAPH-2F943�IDEOGRAPH-2F942�IDEOGRAPH-2F941�IDEOGRAPH-2F940�IDEOGRAPH-2F93F�IDEOGRAPH-2F93E�IDEOGRAPH-2F93D�IDEOGRAPH-2F93C�IDEOGRAPH-2F93B�IDEOGRAPH-2F93A�IDEOGRAPH-2F939�IDEOGRAPH-2F938�IDEOGRAPH-2F937�IDEOGRAPH-2F936�IDEOGRAPH-2F935�IDEOGRAPH-2F934�IDEOGRAPH-2F933�IDEOGRAPH-2F932�IDEOGRAPH-2F931�IDEOGRAPH-2F930�IDEOGRAPH-2F92F�IDEOGRAPH-2F92E�IDEOGRAPH-2F92D�IDEOGRAPH-2F92C�IDEOGRAPH-2F92B�IDEOGRAPH-2F92A�IDEOGRAPH-2F929�IDEOGRAPH-2F928�IDEOGRAPH-2F927�IDEOGRAPH-2F926�IDEOGRAPH-2F925�IDEOGRAPH-2F924�IDEOGRAPH-2F923�IDEOGRAPH-2F922�IDEOGRAPH-2F921�IDEOGRAPH-2F920�IDEOGRAPH-2F91F�IDEOGRAPH-2F91E�IDEOGRAPH-2F91D�IDEOGRAPH-2F91C�IDEOGRAPH-2F91B�IDEOGRAPH-2F91A�IDEOGRAPH-2F919�IDEOGRAPH-2F918�IDEOGRAPH-2F917�IDEOGRAPH-2F916�IDEOGRAPH-2F915�IDEOGRAPH-2F914�IDEOGRAPH-2F913�IDEOGRAPH-2F912�IDEOGRAPH-2F911�IDEOGRAPH-2F910�IDEOGRAPH-2F90F�IDEOGRAPH-2F90E�IDEOGRAPH-2F90D�IDEOGRAPH-2F90C�IDEOGRAPH-2F90B�IDEOGRAPH-2F90A�IDEOGRAPH-2F909�IDEOGRAPH-2F908�IDEOGRAPH-2F907�IDEOGRAPH-2F906�IDEOGRAPH-2F905�IDEOGRAPH-2F904�IDEOGRAPH-2F903�IDEOGRAPH-2F902�IDEOGRAPH-2F901�IDEOGRAPH-2F900�IDEOGRAPH-2F8FF�IDEOGRAPH-2F8FE�IDEOGRAPH-2F8FD�IDEOGRAPH-2F8FC�IDEOGRAPH-2F8FB�IDEOGRAPH-2F8FA�IDEOGRAPH-2F8F9�IDEOGRAPH-2F8F8�IDEOGRAPH-2F8F7�IDEOGRAPH-2F8F6�IDEOGRAPH-2F8F5�IDEOGRAPH-2F8F4�IDEOGRAPH-2F8F3�IDEOGRAPH-2F8F2�IDEOGRAPH-2F8F1�IDEOGRAPH-2F8F0�IDEOGRAPH-2F8EF�IDEOGRAPH-2F8EE�IDEOGRAPH-2F8ED�IDEOGRAPH-2F8EC�IDEOGRAPH-2F8EB�IDEOGRAPH-2F8EA�IDEOGRAPH-2F8E9�IDEOGRAPH-2F8E8�IDEOGRAPH-2F8E7�IDEOGRAPH-2F8E6�IDEOGRAPH-2F8E5�IDEOGRAPH-2F8E4�IDEOGRAPH-2F8E3�IDEOGRAPH-2F8E2�IDEOGRAPH-2F8E1�IDEOGRAPH-2F8E0�IDEOGRAPH-2F8DF�IDEOGRAPH-2F8DE�IDEOGRAPH-2F8DD�IDEOGRAPH-2F8DC�IDEOGRAPH-2F8DB�IDEOGRAPH-2F8DA�IDEOGRAPH-2F8D9�IDEOGRAPH-2F8D8�IDEOGRAPH-2F8D7�IDEOGRAPH-2F8D6�IDEOGRAPH-2F8D5�IDEOGRAPH-2F8D4�IDEOGRAPH-2F8D3�IDEOGRAPH-2F8D2�IDEOGRAPH-2F8D1�IDEOGRAPH-2F8D0�IDEOGRAPH-2F8CF�IDEOGRAPH-2F8CE�IDEOGRAPH-2F8CD�IDEOGRAPH-2F8CC�IDEOGRAPH-2F8CB�IDEOGRAPH-2F8CA�IDEOGRAPH-2F8C9�IDEOGRAPH-2F8C8�IDEOGRAPH-2F8C7�IDEOGRAPH-2F8C6�IDEOGRAPH-2F8C5�IDEOGRAPH-2F8C4�IDEOGRAPH-2F8C3�IDEOGRAPH-2F8C2�IDEOGRAPH-2F8C1�IDEOGRAPH-2F8C0�IDEOGRAPH-2F8BF�IDEOGRAPH-2F8BE�IDEOGRAPH-2F8BD�IDEOGRAPH-2F8BC�IDEOGRAPH-2F8BB�IDEOGRAPH-2F8BA�IDEOGRAPH-2F8B9�IDEOGRAPH-2F8B8�IDEOGRAPH-2F8B7�IDEOGRAPH-2F8B6�IDEOGRAPH-2F8B5�IDEOGRAPH-2F8B4�IDEOGRAPH-2F8B3�IDEOGRAPH-2F8B2�IDEOGRAPH-2F8B1�IDEOGRAPH-2F8B0�IDEOGRAPH-2F8AF�IDEOGRAPH-2F8AE�IDEOGRAPH-2F8AD�IDEOGRAPH-2F8AC�IDEOGRAPH-2F8AB�IDEOGRAPH-2F8AA�IDEOGRAPH-2F8A9�IDEOGRAPH-2F8A8�IDEOGRAPH-2F8A7�IDEOGRAPH-2F8A6�IDEOGRAPH-2F8A5�IDEOGRAPH-2F8A4�IDEOGRAPH-2F8A3�IDEOGRAPH-2F8A2�IDEOGRAPH-2F8A1�IDEOGRAPH-2F8A0�IDEOGRAPH-2F89F�IDEOGRAPH-2F89E�IDEOGRAPH-2F89D�IDEOGRAPH-2F89C�IDEOGRAPH-2F89B�IDEOGRAPH-2F89A�IDEOGRAPH-2F899�IDEOGRAPH-2F898�IDEOGRAPH-2F897�IDEOGRAPH-2F896�IDEOGRAPH-2F895�IDEOGRAPH-2F894�IDEOGRAPH-2F893�IDEOGRAPH-2F892�IDEOGRAPH-2F891�IDEOGRAPH-2F890�IDEOGRAPH-2F88F�IDEOGRAPH-2F88E�IDEOGRAPH-2F88D�IDEOGRAPH-2F88C�IDEOGRAPH-2F88B�IDEOGRAPH-2F88A�IDEOGRAPH-2F889�IDEOGRAPH-2F888�IDEOGRAPH-2F887�IDEOGRAPH-2F886�IDEOGRAPH-2F885�IDEOGRAPH-2F884�IDEOGRAPH-2F883�IDEOGRAPH-2F882�IDEOGRAPH-2F881�IDEOGRAPH-2F880�IDEOGRAPH-2F87F�IDEOGRAPH-2F87E�IDEOGRAPH-2F87D�IDEOGRAPH-2F87C�IDEOGRAPH-2F87B�IDEOGRAPH-2F87A�IDEOGRAPH-2F879�IDEOGRAPH-2F878�IDEOGRAPH-2F877�IDEOGRAPH-2F876�IDEOGRAPH-2F875�IDEOGRAPH-2F874�IDEOGRAPH-2F873�IDEOGRAPH-2F872�IDEOGRAPH-2F871�IDEOGRAPH-2F870�IDEOGRAPH-2F86F�IDEOGRAPH-2F86E�IDEOGRAPH-2F86D�IDEOGRAPH-2F86C�IDEOGRAPH-2F86B�IDEOGRAPH-2F86A�IDEOGRAPH-2F869�IDEOGRAPH-2F868�IDEOGRAPH-2F867�IDEOGRAPH-2F866�IDEOGRAPH-2F865�IDEOGRAPH-2F864�IDEOGRAPH-2F863�IDEOGRAPH-2F862�IDEOGRAPH-2F861�IDEOGRAPH-2F860�IDEOGRAPH-2F85F�IDEOGRAPH-2F85E�IDEOGRAPH-2F85D�IDEOGRAPH-2F85C�IDEOGRAPH-2F85B�IDEOGRAPH-2F85A�IDEOGRAPH-2F859�IDEOGRAPH-2F858�IDEOGRAPH-2F857�IDEOGRAPH-2F856�IDEOGRAPH-2F855�IDEOGRAPH-2F854�IDEOGRAPH-2F853�IDEOGRAPH-2F852�IDEOGRAPH-2F851�IDEOGRAPH-2F850�IDEOGRAPH-2F84F�IDEOGRAPH-2F84E�IDEOGRAPH-2F84D�IDEOGRAPH-2F84C�IDEOGRAPH-2F84B�IDEOGRAPH-2F84A�IDEOGRAPH-2F849�IDEOGRAPH-2F848�IDEOGRAPH-2F847�IDEOGRAPH-2F846�IDEOGRAPH-2F845�IDEOGRAPH-2F844�IDEOGRAPH-2F843�IDEOGRAPH-2F842�IDEOGRAPH-2F841�IDEOGRAPH-2F840�IDEOGRAPH-2F83F�IDEOGRAPH-2F83E�IDEOGRAPH-2F83D�IDEOGRAPH-2F83C�IDEOGRAPH-2F83B�IDEOGRAPH-2F83A�IDEOGRAPH-2F839�IDEOGRAPH-2F838�IDEOGRAPH-2F837�IDEOGRAPH-2F836�IDEOGRAPH-2F835�IDEOGRAPH-2F834�IDEOGRAPH-2F833�IDEOGRAPH-2F832�IDEOGRAPH-2F831�IDEOGRAPH-2F830�IDEOGRAPH-2F82F�IDEOGRAPH-2F82E�IDEOGRAPH-2F82D�IDEOGRAPH-2F82C�IDEOGRAPH-2F82B�IDEOGRAPH-2F82A�IDEOGRAPH-2F829�IDEOGRAPH-2F828�IDEOGRAPH-2F827�IDEOGRAPH-2F826�IDEOGRAPH-2F825�IDEOGRAPH-2F824�IDEOGRAPH-2F823�IDEOGRAPH-2F822�IDEOGRAPH-2F821�IDEOGRAPH-2F820�IDEOGRAPH-2F81F�IDEOGRAPH-2F81E�IDEOGRAPH-2F81D�IDEOGRAPH-2F81C�IDEOGRAPH-2F81B�IDEOGRAPH-2F81A�IDEOGRAPH-2F819�IDEOGRAPH-2F818�IDEOGRAPH-2F817�IDEOGRAPH-2F816�IDEOGRAPH-2F815�IDEOGRAPH-2F814�IDEOGRAPH-2F813�IDEOGRAPH-2F812�IDEOGRAPH-2F811�IDEOGRAPH-2F810�IDEOGRAPH-2F80F�IDEOGRAPH-2F80E�IDEOGRAPH-2F80D�IDEOGRAPH-2F80C�IDEOGRAPH-2F80B�IDEOGRAPH-2F80A�IDEOGRAPH-2F809�IDEOGRAPH-2F808�IDEOGRAPH-2F807�IDEOGRAPH-2F806�IDEOGRAPH-2F805�IDEOGRAPH-2F804�IDEOGRAPH-2F803�IDEOGRAPH-2F802�IDEOGRAPH-2F801�IDEOGRAPH-2F800�IDEOGRAP�IDENTIFICATION�IDENTICA�ICON�ICHOU�ICHOS�ICHIMATOS�ICHADIN�ICELANDIC-YR�IBIFILI�IAUDA�I015�I014�I013�I012�I011A�I011�I010A�I010�I009A�I009�I008�I007�I006�I005A�I005�I004�I003�I002�I001�I-YU�I-YO�I-YEO�I-YE�I-YAE�I-YA-O�I-YA�I-O-I�I-O�I-EU�I-BEAM�I-ARAEA�I-A�HZZZG�HZZZ�HZZP�HZZ�HZWG�HZW�HZT�HZG�HYSTERESI�HYPODIASTOLE�HYPHENATIO�HYPHEN-MINUS�HYPHEN�HYPHE�HYGIEIA�HYGIEA�HXWG�HXUOX�HXUOT�HXUOP�HXUO�HXOX�HXOT�HXOP�HXO�HXIX�HXIT�HXIP�HXIEX�HXIET�HXIEP�HXIE�HXI�HXEX�HXEP�HXE�HXAX�HXAT�HXAP�HXA�HWU�HWAIR�HWAH�HUVA�HUSHE�HUSH�HURAN�HUOT�HUNDREDS�HUNDRED�HUNDRED�HUNDRE�HUN�HUM�HUMAN�HUMA�HUL2�HUIITO�HUGGIN�HUB2�HUB�HUB�HUARADDO�HUAN�HU-3�HU-2�HU-1�HTS�HTJ�HRYVNI�HPWG�HPA�HP�HOUS�HOURGLASS�HOURGLAS�HOUR�HOU�HOTEL�HOTA�HOSPITAL�HORSE�HORS�HORR�HORNS�HORIZONTALL�HORIZONTAL-06-06�HORIZONTAL-06-05�HORIZONTAL-06-04�HORIZONTAL-06-03�HORIZONTAL-06-02�HORIZONTAL-06-01�HORIZONTAL-06-00�HORIZONTAL-05-06�HORIZONTAL-05-05�HORIZONTAL-05-04�HORIZONTAL-05-03�HORIZONTAL-05-02�HORIZONTAL-05-01�HORIZONTAL-05-00�HORIZONTAL-04-06�HORIZONTAL-04-05�HORIZONTAL-04-04�HORIZONTAL-04-03�HORIZONTAL-04-02�HORIZONTAL-04-01�HORIZONTAL-04-00�HORIZONTAL-03-06�HORIZONTAL-03-05�HORIZONTAL-03-04�HORIZONTAL-03-03�HORIZONTAL-03-02�HORIZONTAL-03-01�HORIZONTAL-03-00�HORIZONTAL-02-06�HORIZONTAL-02-05�HORIZONTAL-02-04�HORIZONTAL-02-03�HORIZONTAL-02-02�HORIZONTAL-02-01�HORIZONTAL-02-00�HORIZONTAL-01-06�HORIZONTAL-01-05�HORIZONTAL-01-04�HORIZONTAL-01-03�HORIZONTAL-01-02�HORIZONTAL-01-01�HORIZONTAL-01-00�HORIZONTAL-00-06�HORIZONTAL-00-05�HORIZONTAL-00-04�HORIZONTAL-00-03�HORIZONTAL-00-02�HORIZONTAL-00-01�HORIZONTAL-00-00�HORIZONTAL�HORIZONTA�HORI�HOR�HOOU�HOORU�HOOP�HOON�HOOKED�HOOKE�HONEYBEE�HONE�HOMOTHETIC�HOMOTHETI�HOLO�HOLLO�HOLE�HOLDIN�HOLAM�HOLA�HOKA�HOCKE�HOCHO�HO-8�HO-7�HO-6�HO-5�HO-4�HO-3�HO-2�HO-1�HNUT�HNUOX�HNUO�HNUB�HNOX�HNOT�HNOP�HNIX�HNIT�HNIP�HNIEX�HNIET�HNIEP�HNIE�HNI�HNEX�HNEP�HNE�HNAX�HNAU�HNAT�HNAP�HNA�HMYX�HMYRX�HMYR�HMYP�HMY�HMUX�HMUT�HMURX�HMUR�HMUP�HMUOX�HMUOP�HMUO�HMU�HMOX�HMOT�HMOP�HMO�HMIX�HMIT�HMIP�HMIEX�HMIEP�HMIE�HMI�HME�HMAX�HMAT�HMAP�HMA�HLYX�HLYT�HLYRX�HLYR�HLYP�HLY�HLUX�HLUT�HLURX�HLUR�HLUP�HLUOX�HLUOP�HLUO�HLU�HLOX�HLOP�HLO�HLIX�HLIT�HLIP�HLIEX�HLIEP�HLIE�HLI�HLEX�HLEP�HLE�HLAX�HLAU�HLAT�HLAP�HLA�HL�HK�HIZB�HIYO�HITTIN�HISTORI�HIRIQ�HIPPOPOTAMUS�HINGED�HINGE�HINGE�HIND�HIKIN�HIGH-SPEE�HIGH-REVERSED-�HIGH-LO�HIGH-HEELE�HIEX�HIEUH-SIOS�HIEUH-RIEUL�HIEUH-PIEUP�HIEUH-NIEUN�HIEUH-MIEUM�HIEU�HIEROGLYPHI�HIE�HIDIN�HIDET�HIDE�HIBISCUS�HI-RES�HI-7�HI-6�HI-5�HI-4�HI-3�HI-2�HI-1�HHWA�HHU�HHI�HHEE�HHE�HHAA�HG�HEYT�HEXIFOR�HEXAGRA�HEXAGON�HERUTU�HERU�HERMITIA�HERMIONIA�HERMES�HERE�HERB�HERAEU�HENG�HEN�HEMP�HELMET�HELME�HEL�HELLSCHREIBE�HELIX�HELICOPTER�HEKUTAARU�HEISEI�HEIGHT�HEEI�HEDGEHOG�HEAVY�HEAVENL�HEAVEN�HEAVE�HEARTS�HEART-SHAPE�HEART�HEAR�HEARIN�HEAR-NO-EVI�HEADSTROKE�HEADSTON�HEADSCARF�HEADPHONE�HEADING�HEAD-BANDAGE�HE-7�HE-6�HE-5�HE-4�HE-3�HE-2�HE-1�HDR�HC�HBASA-ESAS�HBAS�HAYANNA�HAWJ�HAVE�HAUPTSTIMME�HA�HATRA�HATHI�HATE�HATCHIN�HATA�HASE�HASANTA�HARPOON�HARPOO�HARMONIC�HARKLEA�HARDNESS�HAR�HARBAHAY�HAPP�HANUNO�HANIF�HANGZHO�HANDSHAKE�HANDS�HAND�HANDLES�HANDLE�HANDBALL�HANDBAG�HAND-OVAL�HAND-OVA�HAND-HOOK�HAND-HOO�HAND-HINGE�HAND-HING�HAND-FLAT�HAND-FLA�HAND-FIST�HAND-CURLICUE�HAND-CURLICU�HAND-CUP�HAND-CU�HAND-CLAW�HAND-CLA�HAND-CIRCLE�HAND-CIRCL�HAND-ANGLE�HAND-ANGL�HAND�HAN-AKAT�HAMZA�HAMZ�HAMSTE�HAMMER�HAMME�HAMBURGER�HALQA�HALO�HALF-CIRCL�HALF-2�HALF-1�HALF�HALBERD�HALANTA�HAITU�HAI�HAIRCUT�HAGLA�HAGL�HAFUKHA�HAFUKH�HAEG�HADES�HAARU�HAAM�HA�HA-HA�HA-9�HA-8�HA-7�HA-6�HA-5�HA-4�HA-3�HA-2�HA-11�HA-10�HA-1�H008�H007�H006A�H006�H005�H004�H003�H002�H001�H-TYP�GYU�GYON�GYO�GYI�GYF�GYEE�GYAS�GYAA�GYA�GY�GWU�GWI�GWEE�GWE�GWAA�GWA�GVANG�GV�GURUSH�GURUN�GURMUKH�GURAMUTON�GUR7�GUNU�GUN�GUNJAL�GU�GUL�GUJARAT�GUITAR�GUID�GU�GUEI�GUEH�GUE�GUD�GU�GUARDSMAN�GUARDEDNESS�GUARDE�GUARD�GUARAN�GU�GU�GTE�GSUM�GSU�GR�GROWIN�GROUND�GRONTHISMATA�GRINNIN�GRIMACIN�GREGORIA�GREEN�GREE�GREATNESS�GREATER-THAN�GREATER-THA�GREATE�GREA�GRAVEYAR�GRAVE-MACRON�GRAVE-ACUTE-GRAVE�GRAV�GRATER�GRASS�GRAS�GRAS�GRAPHEM�GRAPES�GRANTH�GRAMM�GRAIN�GRADUATIO�GRADUAL�GRACE�GRAC�GPA�GORTHMIKO�GORT�GORILLA�GORGOTERI�GORGOSYNTHETON�GORGO�GORGI�GORA�GOO�GONG�GOLFER�GOLD�GOK�GOIN�GOGGLES�GOBLIN�GOAL�GOA�GOA�GNYIS�GNAVIYANI�GLOWIN�GLOVES�GLOVE�GLOTTA�GLOB�GLISSAND�GLEIC�GLAGOLI�GLA�GJE�GIX�GIT�GISH�GIS�GISAL�GIRUDAA�GIRL�GIRL�GIRAFF�GIR3�GIR�GIR2�GIR�GIP�GINII�GIMEL�GIME�GIM�GIGA�GIG�GIF�GIET�GIDIM�GIBBOU�GIBA�GI4�GI�GHZ�GHWA�GHUNNA�GHUNN�GHU�GHOU�GHOST�GHO�GHIMEL�GHI�GHHA�GHEYS�GHEUX�GHEUN�GHEUGHEUAEM�GHEUGHEN�GHEUAERAE�GHEUAEGHEUAE�GHET�GHEE�GHE�GH�GHAYN�GHARAE�GHAP�GHAN�GHAMMA�GHAMAL�GHAINU�GHAIN�GHAI�GHAD�GHAAMAE�GHAA�GGWI�GGWEE�GGWE�GGWAA�GGWA�GGUX�GGUT�GGURX�GGUR�GGUOX�GGUOT�GGUOP�GGUO�GGOX�GGOT�GGOP�GGIX�GGIT�GGIEX�GGIEP�GGIE�GGEX�GGET�GGEP�GGAX�GGAT�GET�GESTURE�GESHU�GESHTIN�GESHTI�GESH2�GERSHAYIM�GERMA�GERESH�GERES�GEOMETRICALL�GEOMETRI�GENTL�GENITIVE�GENIK�GENIE�GENERI�GENERAL�GEMINI�GEMINATIO�GEMINAT�GE�GEEM�GEDOLA�GEDE�GEB�GEB�GEAR�GEA�GE22�GDAN�GCIG�GCA�GBON�GBIE�GBEUX�GBET�GBAYI�GBAKURUNEN�GB�GAYANUKITTA�GAYANNA�GAY�GAUNTLET�GATHERING�GATHERIN�GATE�GASHAN�GARSHUNI�GARON�GARMENT�GARLIC�GARDEN�GAR3�GAPPE�GA�GANMA�GANGIA�GAND�GAN2�GAN�GAMMA�GAMLA�GAML�GAME�GAM�GAMAN�GAMAL�GAMA�GAL�GAG�GAF�GA�GAETTA-PILLA�GADOL�GAD�GA�GABA�GAB�GAAFU�GA�G054�G053�G052�G051�G050�G049�G048�G047�G046�G045A�G045�G044�G043A�G043�G042�G041�G040�G039�G038�G037A�G037�G036A�G036�G035�G034�G033�G032�G031�G030�G029�G028�G027�G026A�G026�G025�G024�G023�G022�G021�G020A�G020�G019�G018�G017�G016�G015�G014�G013�G012�G011A�G011�G010�G009�G008�G007B�G007A�G007�G006A�G006�G005�G004�G003�G002�G001�FYX�FYT�FYP�FYA�FWI�FWEE�FWE�FWAA�FWA�FVS3�FVS2�FVS1�FUX�FUT�FUSE�FUS�FURX�FUP�FUNERA�FUNCTIONA�FUNCTION�FULLNESS�FUL�FUJI�FUET�FUE�FUE�FUA�FTHOR�FSI�FROWNING�FROWNIN�FROWN�FROW�FRONT-TILTE�FRONT-FACIN�FRON�FRO�FROG�FRO�FRITU�FRIES�FRIE�FRICATIVE�FRETBOARD�FRENC�FREEZIN�FREE�FRE�FRANK�FRAN�FRAMES�FRAME�FRAM�FRAGRANT�FRAGMENT�FOX�FO�FOURTEEN�FOURTEE�FOUR-THIRTY�FOUR-STRIN�FOUR-PER-E�FOUR-LIN�FOU�FOUNTAIN�FOUNTAI�FOSTERING�FORWARD�FORWAR�FORTY-FIV�FORTY�FORT�FORTUN�FORTIETH�FORTE�FORM�FORMEE�FORME�FORMATTING�FORMA�FORKE�FOREHEA�FORCES�FORCE�FOP�FOOTSTOOL�FOOTPRINTS�FOOTNOT�FOOTBALL�FOOT�FOOL�FOOD�FOO�FON�FONGMAN�FOM�FOLLY�FOLLOWING�FOLDER�FOLDE�FOGGY�FOG�F�FM�FLYIN�FLY�FLUTTERING�FLUTTERIN�FLUTE�FLUSHE�FLOWIN�FLOWERS�FLOWE�FLOURISH�FLORETTE�FLORA�FLOPP�FLOOR�FLOO�FLIP�FLIGHT�FLIC�FLEXUS�FLEXE�FLEX�FLEURON�FLEUR-DE-LIS�FLATTENE�FLATNESS�FLATBREAD�FLASH�FLAMINGO�FLAME�FLAGS�FLAG-5�FLAG-4�FLAG-3�FLAG-2�FLAG-1�FLAG�FLA�FLA�FL�FIXED-FOR�FIX�FIVE-THIRTY�FIVE-LIN�FITZPATRIC�FITA�FIT�FISTE�FISHIN�FISHHOOK�FISHHOO�FISHEYE�FISH�FIS�FIRS�FIRI�FIREWORKS�FIREWOR�FIRECRACKER�FIRE�FIR�FIP�FINIT�FINGERS�FINGER�FINGERNAILS�FINGERE�FINGER-POS�FINGER�FINGE�FINANCIAL�FINAL�FIL�FILLER-2�FILLER-1�FILLER�FILLE�FILL�FIL�FIL�FII�FIGURE-3�FIGURE-2�FIGURE-1�FIGUR�FIGHT�FIFTY�FIFT�FIFTHS�FIFTH�FIFTEEN�FIFTEE�FIELD�FIEL�FHTOR�FFL�FFI�FEUX�FEUFEUAET�FETH�FESTIVAL�FERRY�FERRI�FERMATA�FERMAT�FEO�FEN�FENCER�FENCE�FEMININ�FEMALE�FEMAL�FELLOWSHIP�FEI�FEH�FEH�FE�FEENG�FEEM�FEED�FEE�FEE�FEBRUARY�FEATHER�FEATHE�FEARN�FEARFU�FEAR�FAYANNA�FAY�FAX�FA�FATIGUE�FATHER�FATHE�FATHATAN�FATHATA�FATHA�FATH�FAT�FAST�FARS�FAR�FAQ�FAP�FANG�FANEROSI�FAN�FAMILY�FAM�FALLE�FALAFEL�FAJ�FAIRY�FAILURE�FAIHU�FAIB�FAHRENHEIT�FACTORY�FACTO�FACSIMIL�FACINGS�FACE-6�FACE-5�FACE-4�FACE-3�FACE-2�FACE-1�FAAMAE�FAAI�FAAFU�F053�F052�F051C�F051B�F051A�F051�F050�F049�F048�F047A�F047�F046A�F046�F045A�F045�F044�F043�F042�F041�F040�F039�F038A�F038�F037A�F037�F036�F035�F034�F033�F032�F031A�F031�F030�F029�F028�F027�F026�F025�F024�F023�F022�F021A�F021�F020�F019�F018�F017�F016�F015�F014�F013A�F013�F012�F011�F010�F009�F008�F007�F006�F005�F004�F003�F002�F001A�F001�EZS�EZ�EZEN�EZE�EZ�EYYY�EYES�EYE�EYELASHE�EYEGLASSES�EYEGAZE-WALLPLAN�EYEGAZE-FLOORPLAN�EYEBROW�EYEBRO�EY�EYBEYFILI�EYANNA�EXTREMEL�EXTRATERRESTRIA�EXTRA-LO�EXTRA-HIG�EXTR�EXTINGUISHER�EXTENSION�EXTENDED�EXTENDE�EXPRESSIONLES�EXPONEN�EXPLODIN�EXO�EX�EXISTS�EXIST�EXHAUSTION�EXHALE�EXCLAMATION�EXCLAMATIO�EXCITEMENT�EXCHANGE�EXCESS�EXCELLENT�EWE�EVER�EVERGREE�EVENING�EUROPEA�EUROPE-AFRICA�EURO-CURRENC�EUR�EULE�EU-U�EU-O�EU-EU�EU-EO�EU-E�EU-A�ETX�ETNAHTA�ETHE�ETERO�ETERNITY�ETERNIT�ETB�ESZ�ESUKUUDO�ESTIMATES�ESTIMATE�ESHE3�ESH21�ESH16�ESCAPE�ESC�ESA�ES-TE�ES-3�ES-2�ES-1�ERROR-BARRE�ERR�ERI�ERIN2�ERIN�ERG�ERAS�EQUIVALEN�EQUILATERA�EQUIHOPPER�EQUIHOPPE�EQUID�EQUIANGULA�EQUALS�EQUAL�EQUAL�EPSILON�EPSILO�EPOCH�EPIGRAPHI�EPIDAUREA�EPENTHETI�EPEGERMA�EPAC�EOT�EOM�EOLHX�EOL�EOH�ENY�ENVELOPE�ENVELOP�ENUMERATIO�ENTRY-2�ENTRY-1�ENTRY�ENTR�ENTHUSIASM�ENTERPRISE�ENTERIN�ENTER�ENTE�ENT-SHAPE�ENQUIRY�ENQ�ENO�ENNI�ENN�ENLARGEMENT�ENGINE�ENDOFONON�ENDIN�ENDEP�ENDEAVOUR�ENCOUNTERS�ENCLOSURES�ENCLOSURE�ENCLOSIN�ENC�ENARXI�ENARMONIO�EMPT�EMPHATI�EMPHASI�EMOJ�EMBROIDERY�EMBLEM�EMBELLISHMENT�EMBEDDING�ELYMAI�ELY�ELT�ELLIPTI�ELLIPSIS�ELLIPSE�ELIFI�ELEVEN-THIRTY�ELEVEN�ELEVE�ELEVATU�ELEPHANT�ELEMEN�ELECTRICA�ELECTRI�ELBASA�ELAMITE�ELAMIT�ELAFRON�EKSTREPTON�EKS�EKFONITIKON�EKARA�EKAM�EJEC�EIS�EIGHTY�EIGHT�EIGHTIETHS�EIGHTIETH�EIGHTHS�EIGHTH�EIGHTH�EIGHTEEN�EIGHTEE�EIGHT-THIRTY�EIE�EHWA�EHTSA�EHTA�EHPA�EHKA�EHCHA�EGYPTOLOGICA�EGY�EGIR�EGG�EEYANNA�EEKAA�EEH�EEBEEFILI�EDITORIA�EDIN�EDD�ECS�EBEFILI�EASTER�EAST�EAS�EARTHL�EARTH�EART�EARS�EARL�EAMHANCHOLL�EAGLE�EADHADH�EABHADH�E�E038�E037�E036�E034A�E034�E033�E032�E031�E030�E029�E028A�E028�E027�E026�E025�E024�E023�E022�E021�E020A�E020�E019�E018�E017A�E017�E016A�E016�E015�E014�E013�E012�E011�E010�E009A�E009�E008A�E008�E007�E006�E005�E004�E003�E002�E001�E-MAI�DZZHE�DZZE�DZZA�DZYI�DZYAY�DZWE�DZU�DZO�DZJE�DZITA�DZI�DZHOI�DZHE�DZHA�DZELO�DZEE�DZE�DZAY�DZAA�DZA�DZ�D�DYO�DY�DYNAMI�DYEH�DYE�DYAN�DWO�DWE�DWA�DVISVARA�DVD�DV�DUTIES�DUSK�DUSHENNA�DURATION�DUR2�DUPONDIU�DUOX�DUO�DUN4�DUN3�DUN�DUMPLING�DUM�DU�DUH�DUGUD�DU�DUCK�DUB2�DUB�DU�DRY�DR�DRUMSTICKS�DRUM�DRU�DROPS�DROPLET�DROP-SHADOWE�DRO�DROOLIN�DROMEDAR�DRIVE�DRIV�DRINK�DRI�DRESS�DREAM�DRAUGHT�DRAM�DRA�DRAGON�DRAGO�DRAFTIN�DRACHMAS�DRACHMA�DRACHM�DOWNWARDS�DOWNWARD�DOWNWAR�DOWNSCALIN�DOWN-POINTIN�DOWN�DOVE�DOV�DOUGHNUT�DOUBT�DOUBLE�DOUBLE-STRUC�DOUBLE-LINE�DOUBLE-LIN�DOUBLE-ENDE�DOUBLE�DOTTED-P�DOTTED-N�DOTTED-L�DOTTED�DOTTE�DOTS-8�DOTS-78�DOTS-7�DOTS-68�DOTS-678�DOTS-67�DOTS-6�DOTS-58�DOTS-578�DOTS-57�DOTS-568�DOTS-5678�DOTS-567�DOTS-56�DOTS-5�DOTS-48�DOTS-478�DOTS-47�DOTS-468�DOTS-4678�DOTS-467�DOTS-46�DOTS-458�DOTS-4578�DOTS-457�DOTS-4568�DOTS-45678�DOTS-4567�DOTS-456�DOTS-45�DOTS-4�DOTS-38�DOTS-378�DOTS-37�DOTS-368�DOTS-3678�DOTS-367�DOTS-36�DOTS-358�DOTS-3578�DOTS-357�DOTS-3568�DOTS-35678�DOTS-3567�DOTS-356�DOTS-35�DOTS-348�DOTS-3478�DOTS-347�DOTS-3468�DOTS-34678�DOTS-3467�DOTS-346�DOTS-3458�DOTS-34578�DOTS-3457�DOTS-34568�DOTS-345678�DOTS-34567�DOTS-3456�DOTS-345�DOTS-34�DOTS-3�DOTS-28�DOTS-278�DOTS-27�DOTS-268�DOTS-2678�DOTS-267�DOTS-26�DOTS-258�DOTS-2578�DOTS-257�DOTS-2568�DOTS-25678�DOTS-2567�DOTS-256�DOTS-25�DOTS-248�DOTS-2478�DOTS-247�DOTS-2468�DOTS-24678�DOTS-2467�DOTS-246�DOTS-2458�DOTS-24578�DOTS-2457�DOTS-24568�DOTS-245678�DOTS-24567�DOTS-2456�DOTS-245�DOTS-24�DOTS-238�DOTS-2378�DOTS-237�DOTS-2368�DOTS-23678�DOTS-2367�DOTS-236�DOTS-2358�DOTS-23578�DOTS-2357�DOTS-23568�DOTS-235678�DOTS-23567�DOTS-2356�DOTS-235�DOTS-2348�DOTS-23478�DOTS-2347�DOTS-23468�DOTS-234678�DOTS-23467�DOTS-2346�DOTS-23458�DOTS-234578�DOTS-23457�DOTS-234568�DOTS-2345678�DOTS-234567�DOTS-23456�DOTS-2345�DOTS-234�DOTS-23�DOTS-2�DOTS-18�DOTS-178�DOTS-17�DOTS-168�DOTS-1678�DOTS-167�DOTS-16�DOTS-158�DOTS-1578�DOTS-157�DOTS-1568�DOTS-15678�DOTS-1567�DOTS-156�DOTS-15�DOTS-148�DOTS-1478�DOTS-147�DOTS-1468�DOTS-14678�DOTS-1467�DOTS-146�DOTS-1458�DOTS-14578�DOTS-1457�DOTS-14568�DOTS-145678�DOTS-14567�DOTS-1456�DOTS-145�DOTS-14�DOTS-138�DOTS-1378�DOTS-137�DOTS-1368�DOTS-13678�DOTS-1367�DOTS-136�DOTS-1358�DOTS-13578�DOTS-1357�DOTS-13568�DOTS-135678�DOTS-13567�DOTS-1356�DOTS-135�DOTS-1348�DOTS-13478�DOTS-1347�DOTS-13468�DOTS-134678�DOTS-13467�DOTS-1346�DOTS-13458�DOTS-134578�DOTS-13457�DOTS-134568�DOTS-1345678�DOTS-134567�DOTS-13456�DOTS-1345�DOTS-134�DOTS-13�DOTS-128�DOTS-1278�DOTS-127�DOTS-1268�DOTS-12678�DOTS-1267�DOTS-126�DOTS-1258�DOTS-12578�DOTS-1257�DOTS-12568�DOTS-125678�DOTS-12567�DOTS-1256�DOTS-125�DOTS-1248�DOTS-12478�DOTS-1247�DOTS-12468�DOTS-124678�DOTS-12467�DOTS-1246�DOTS-12458�DOTS-124578�DOTS-12457�DOTS-124568�DOTS-1245678�DOTS-124567�DOTS-12456�DOTS-1245�DOTS-124�DOTS-1238�DOTS-12378�DOTS-1237�DOTS-12368�DOTS-123678�DOTS-12367�DOTS-1236�DOTS-12358�DOTS-123578�DOTS-12357�DOTS-123568�DOTS-1235678�DOTS-123567�DOTS-12356�DOTS-1235�DOTS-12348�DOTS-123478�DOTS-12347�DOTS-123468�DOTS-1234678�DOTS-123467�DOTS-12346�DOTS-123458�DOTS-1234578�DOTS-123457�DOTS-1234568�DOTS-12345678�DOTS-1234567�DOTS-123456�DOTS-12345�DOTS-1234�DOTS-123�DOTS-12�DOTS-1�DOTS�DOT�DOTLES�DORU�DOROM�DOOR�DOONG�DONG�DOMAI�DOLPHIN�DOLLS�DOLLA�DOLIUM�DOKMAI�DOIT�DOIN�DOI�DOGR�DOG�DO�DOE�DODEKATA�DOCUMENT�DOCUMEN�DOBRO�DOACHASHMEE�DOACHASHME�DOA�DO-O�DN�DM�D�DLU�DLO�DLI�DLHYA�DLHA�DLEE�DLA�DL�DKAR�DKA�DJERVI�DJERV�DJE�DJA�DIZZ�DIY�DIVORC�DIVISION�DIVISIO�DIVIN�DIVINATION�DIVIDES�DIVIDERS�DIVIDER�DIVIDE�DIVIDE�DIVID�DIVERGENCE�DITT�DISTORTION�DISTINGUISH�DISTILL�DISSOLVE-2�DISSOLVE�DISPUTE�DISPERSION�DISK�DISIMOU�DISH�DISCONTINUOU�DIS�DISAPPOINTE�DISABLE�DIRG�DIRECTL�DIRECTIONA�DIRECTIO�DIPTE�DIPPER�DIPLOUN�DIPLI�DIPL�DINGBA�DI�DIMMING�DIMINUTION-3�DIMINUTION-2�DIMINUTION-1�DIMINISHMENT�DIMIDI�DIMENSIONA�DIMENSIO�DIM2�DIM�DIL�DIGRAPH�DIGRAP�DIGRAMMO�DIGRAMM�DIGRA�DIGORGON�DIGORGO�DIGITS�DIGAMMA�DIG�DIFTOGGO�DIFONIAS�DIFFICULT�DIFFICULTIES�DIFFERENTIAL�DIFFERENC�DIFAT�DIESIS�DIESI�DIESE�DIEP�DI�DIB�DIATONO�DIATONIK�DIASTOL�DIAMONDS�DIAMOND�DIAMON�DIAMETE�DIALYTIKA�DIALYTIK�DIALECT-�DIAGONAL�DIAERESIZE�DIAERESIS-RING�DIAERESIS�DIAERESI�DHOU�DHOO�DHO�DHII�DHHU�DHHOO�DHHO�DHHI�DHHEE�DHHE�DHHA�DHEE�DHARMA�DHAMEDH�DHALETH�DHALATH�DHAL�DHADHE�DHAALU�DHAA�DHA�DEZ�DEYTERO�DEYTERO�DEXIA�DEVIC�DEVELOPMENT�DEUNG�DESKTO�DES�DESIGN�DESI�DESERT�DESER�DESERE�DESCRIPTIO�DESCENDIN�DESCENDER�DERET-HIDET�DERET�DERELIC�DEPTH�DEPARTURE�DEPARTMEN�DEPARTIN�DENTISTR�DENTA�DENOMINATOR�DENOMINATO�DENNEN�DENG�DEN�DENARIU�DELTA�DELT�DELT�DELPHI�DELIVER�DELIVERANCE�DELIMITER�DELIMITE�DELICIOU�DELETIO�DELETE�DELET�DEKA�DEK�DEI�DEHI�DEGREES�DEGRE�DEFINITION�DEFECTIVENES�DEER�DEEPLY�DEEL�DECRESCENDO�DECREASE�DECREAS�DECORATIV�DECORATION�DECISIVENESS�DECIMA�DECIDUOU�DECEMBER�DECAYED�DEBI�DEATH�DEA�DEAD�DDWA�DDUX�DDUT�DDURX�DDUR�DDUP�DDUOX�DDUOP�DDUO�DDU�DDOX�DDOT�DDOP�DDOA�DDIX�DDIT�DDIP�DDIEX�DDIEP�DDIE�DDI�DDHU�DDHO�DDHEE�DDHE�DDHAA�DDHA�DDEX�DDEP�DDEE�DDE�DDDHA�DDDA�DDAYANNA�DDAX�DDAT�DDAP�DDAL�DDA�DDAHAL�DDAHA�DDAA�DCS�DCHE�DC4�DC3�DC2�DC1�D�DAY-NIGHT�DA�DAWB�DAVIYANI�DAVID�DAT�DASIA�DASI�DASHE�DASH�DAS�DASEIA�DART�DARKENING�DARKENIN�DAR�DARGA�DARA4�DARA3�DAR�DAP-PRA�DAP-PI�DAP-MUO�DAP-BUO�DAP-BE�DA�DANTAYALAN�DANTAJ�DANGO�DANG�DAN�DANDA�DANCING�DANCER�DAMP�DAM�DAMMATAN�DAMMATA�DAMMA�DAMM�DAMARU�DALETH-RESH�DALET�DALE�DALDA�DALATH�DALAT�DALAT�DAIR�DAING�DAI�DAHYAAUSH-2�DAHYAAUSH�DAGS�DAGGER�DAGGE�DAGESH�DAGES�DAGBASINNA�DAGA�DAGALGA�DAG3�DA�DAENG�DAE�DAD�DA�DAASU�DAALI�DAADHU�D067H�D067G�D067F�D067E�D067D�D067C�D067B�D067A�D067�D066�D065�D064�D063�D062�D061�D060�D059�D058�D057�D056�D055�D054A�D054�D053�D052A�D052�D051�D050I�D050H�D050G�D050F�D050E�D050D�D050C�D050B�D050A�D050�D049�D048A�D048�D047�D046A�D046�D045�D044�D043�D042�D041�D040�D039�D038�D037�D036�D035�D034A�D034�D033�D032�D031A�D031�D030�D029�D028�D027A�D027�D026�D025�D024�D023�D022�D021�D020�D019�D018�D017�D016�D015�D014�D013�D012�D011�D010�D009�D008A�D008�D007�D006�D005�D004�D003�D002�D001�CYX�CYT�CYRX�CYRENAI�CYR�CYPRIO�CYPERUS�CYP�CYLINDRICITY�CYCLONE�CYAY�CYAW�CYA�CWOO�CWO�CWII�CWI�CWEORTH�CWE�CWAA�CUX�CUU�CU�CUSTOMS�CUSTOME�CUSTARD�CUSP�CURX�CURVIN�CURVED�CURVE�CURVE�CURV�CURSIV�CURR�CURRENT�CURREN�CURL�CURLIN�CURL�CUR�CUPPED�CUPPE�CUPIDO�CUPCAKE�CUOX�CUOP�CUO�CU�CULTIVATIO�CUCUMBER�CUBED�CUBE�CUB�CUATRILLO�CUATRILL�CUA�CSI�CRYSTA�CRYPTOGRAMMI�CRYIN�CRUZEIR�CRUCIFOR�CRUCIBLE-5�CRUCIBLE-4�CRUCIBLE-3�CRUCIBLE-2�CRUCIBLE�CROWN�CROSSING�CROSSIN�CROSSHATC�CROSSED-TAIL�CROSSED�CROSSE�CROSSBONES�CROSS�CROS�CROP�CROIX�CROISSANT�CROCU�CROCODILE�CRICKET�CRICKE�CRESCENTS�CRESCENT�CRESCEN�CREDI�CREATIV�CREAM�CRAYON�CRAB�CR�COX�COWBO�COW�CO�COVERIN�COVER�COUPL�COUNTIN�COUNTERSINK�COUNTERBORE�COUNCI�COUC�COT�CORRESPOND�CORRECT�CORPSE�CORPORATION�CORONIS�CORNIS�CORNERS�CORNER�CORNE�CORK�COPYRIGHT�COPYRIGH�COPYLEF�COPY�COPRODUCT�COPPER-2�COPPER�COP�COOL�COOKING�COOKIE�COOKE�COO�CONVERGIN�CONVENIENC�CONTROL�CONTRO�CONTRARIETY�CONTRACTION�CONTOURE�CONTOU�CONTINUIN�CONTINUATIO�CONTENTION�CONTEMPLATION�CONTAIN�CONTAININ�CONTAI�CONTACT�CONSTRUCTION�CONSTRUCTIO�CONSTANT�CONSTAN�CONSTANCY�CONSECUTIV�CONJUNCTION�CONJUGAT�CONJOININ�CONJOINED�CONJOINE�CONICA�CONGRUEN�CONGRATULATION�CONFUSE�CONFOUNDE�CONFLICT�CONFETT�CONCAVE-SIDE�CONCAVE-POINTE�COMPUTERS�COMPUTER�COMPRESSION�COMPRESSE�COMPOSITION�COMPOSITIO�COMPONENT-755�COMPONENT-754�COMPONENT-753�COMPONENT-752�COMPONENT-751�COMPONENT-750�COMPONENT-749�COMPONENT-748�COMPONENT-747�COMPONENT-746�COMPONENT-745�COMPONENT-744�COMPONENT-743�COMPONENT-742�COMPONENT-741�COMPONENT-740�COMPONENT-739�COMPONENT-738�COMPONENT-737�COMPONENT-736�COMPONENT-735�COMPONENT-734�COMPONENT-733�COMPONENT-732�COMPONENT-731�COMPONENT-730�COMPONENT-729�COMPONENT-728�COMPONENT-727�COMPONENT-726�COMPONENT-725�COMPONENT-724�COMPONENT-723�COMPONENT-722�COMPONENT-721�COMPONENT-720�COMPONENT-719�COMPONENT-718�COMPONENT-717�COMPONENT-716�COMPONENT-715�COMPONENT-714�COMPONENT-713�COMPONENT-712�COMPONENT-711�COMPONENT-710�COMPONENT-709�COMPONENT-708�COMPONENT-707�COMPONENT-706�COMPONENT-705�COMPONENT-704�COMPONENT-703�COMPONENT-702�COMPONENT-701�COMPONENT-700�COMPONENT-699�COMPONENT-698�COMPONENT-697�COMPONENT-696�COMPONENT-695�COMPONENT-694�COMPONENT-693�COMPONENT-692�COMPONENT-691�COMPONENT-690�COMPONENT-689�COMPONENT-688�COMPONENT-687�COMPONENT-686�COMPONENT-685�COMPONENT-684�COMPONENT-683�COMPONENT-682�COMPONENT-681�COMPONENT-680�COMPONENT-679�COMPONENT-678�COMPONENT-677�COMPONENT-676�COMPONENT-675�COMPONENT-674�COMPONENT-673�COMPONENT-672�COMPONENT-671�COMPONENT-670�COMPONENT-669�COMPONENT-668�COMPONENT-667�COMPONENT-666�COMPONENT-665�COMPONENT-664�COMPONENT-663�COMPONENT-662�COMPONENT-661�COMPONENT-660�COMPONENT-659�COMPONENT-658�COMPONENT-657�COMPONENT-656�COMPONENT-655�COMPONENT-654�COMPONENT-653�COMPONENT-652�COMPONENT-651�COMPONENT-650�COMPONENT-649�COMPONENT-648�COMPONENT-647�COMPONENT-646�COMPONENT-645�COMPONENT-644�COMPONENT-643�COMPONENT-642�COMPONENT-641�COMPONENT-640�COMPONENT-639�COMPONENT-638�COMPONENT-637�COMPONENT-636�COMPONENT-635�COMPONENT-634�COMPONENT-633�COMPONENT-632�COMPONENT-631�COMPONENT-630�COMPONENT-629�COMPONENT-628�COMPONENT-627�COMPONENT-626�COMPONENT-625�COMPONENT-624�COMPONENT-623�COMPONENT-622�COMPONENT-621�COMPONENT-620�COMPONENT-619�COMPONENT-618�COMPONENT-617�COMPONENT-616�COMPONENT-615�COMPONENT-614�COMPONENT-613�COMPONENT-612�COMPONENT-611�COMPONENT-610�COMPONENT-609�COMPONENT-608�COMPONENT-607�COMPONENT-606�COMPONENT-605�COMPONENT-604�COMPONENT-603�COMPONENT-602�COMPONENT-601�COMPONENT-600�COMPONENT-599�COMPONENT-598�COMPONENT-597�COMPONENT-596�COMPONENT-595�COMPONENT-594�COMPONENT-593�COMPONENT-592�COMPONENT-591�COMPONENT-590�COMPONENT-589�COMPONENT-588�COMPONENT-587�COMPONENT-586�COMPONENT-585�COMPONENT-584�COMPONENT-583�COMPONENT-582�COMPONENT-581�COMPONENT-580�COMPONENT-579�COMPONENT-578�COMPONENT-577�COMPONENT-576�COMPONENT-575�COMPONENT-574�COMPONENT-573�COMPONENT-572�COMPONENT-571�COMPONENT-570�COMPONENT-569�COMPONENT-568�COMPONENT-567�COMPONENT-566�COMPONENT-565�COMPONENT-564�COMPONENT-563�COMPONENT-562�COMPONENT-561�COMPONENT-560�COMPONENT-559�COMPONENT-558�COMPONENT-557�COMPONENT-556�COMPONENT-555�COMPONENT-554�COMPONENT-553�COMPONENT-552�COMPONENT-551�COMPONENT-550�COMPONENT-549�COMPONENT-548�COMPONENT-547�COMPONENT-546�COMPONENT-545�COMPONENT-544�COMPONENT-543�COMPONENT-542�COMPONENT-541�COMPONENT-540�COMPONENT-539�COMPONENT-538�COMPONENT-537�COMPONENT-536�COMPONENT-535�COMPONENT-534�COMPONENT-533�COMPONENT-532�COMPONENT-531�COMPONENT-530�COMPONENT-529�COMPONENT-528�COMPONENT-527�COMPONENT-526�COMPONENT-525�COMPONENT-524�COMPONENT-523�COMPONENT-522�COMPONENT-521�COMPONENT-520�COMPONENT-519�COMPONENT-518�COMPONENT-517�COMPONENT-516�COMPONENT-515�COMPONENT-514�COMPONENT-513�COMPONENT-512�COMPONENT-511�COMPONENT-510�COMPONENT-509�COMPONENT-508�COMPONENT-507�COMPONENT-506�COMPONENT-505�COMPONENT-504�COMPONENT-503�COMPONENT-502�COMPONENT-501�COMPONENT-500�COMPONENT-499�COMPONENT-498�COMPONENT-497�COMPONENT-496�COMPONENT-495�COMPONENT-494�COMPONENT-493�COMPONENT-492�COMPONENT-491�COMPONENT-490�COMPONENT-489�COMPONENT-488�COMPONENT-487�COMPONENT-486�COMPONENT-485�COMPONENT-484�COMPONENT-483�COMPONENT-482�COMPONENT-481�COMPONENT-480�COMPONENT-479�COMPONENT-478�COMPONENT-477�COMPONENT-476�COMPONENT-475�COMPONENT-474�COMPONENT-473�COMPONENT-472�COMPONENT-471�COMPONENT-470�COMPONENT-469�COMPONENT-468�COMPONENT-467�COMPONENT-466�COMPONENT-465�COMPONENT-464�COMPONENT-463�COMPONENT-462�COMPONENT-461�COMPONENT-460�COMPONENT-459�COMPONENT-458�COMPONENT-457�COMPONENT-456�COMPONENT-455�COMPONENT-454�COMPONENT-453�COMPONENT-452�COMPONENT-451�COMPONENT-450�COMPONENT-449�COMPONENT-448�COMPONENT-447�COMPONENT-446�COMPONENT-445�COMPONENT-444�COMPONENT-443�COMPONENT-442�COMPONENT-441�COMPONENT-440�COMPONENT-439�COMPONENT-438�COMPONENT-437�COMPONENT-436�COMPONENT-435�COMPONENT-434�COMPONENT-433�COMPONENT-432�COMPONENT-431�COMPONENT-430�COMPONENT-429�COMPONENT-428�COMPONENT-427�COMPONENT-426�COMPONENT-425�COMPONENT-424�COMPONENT-423�COMPONENT-422�COMPONENT-421�COMPONENT-420�COMPONENT-419�COMPONENT-418�COMPONENT-417�COMPONENT-416�COMPONENT-415�COMPONENT-414�COMPONENT-413�COMPONENT-412�COMPONENT-411�COMPONENT-410�COMPONENT-409�COMPONENT-408�COMPONENT-407�COMPONENT-406�COMPONENT-405�COMPONENT-404�COMPONENT-403�COMPONENT-402�COMPONENT-401�COMPONENT-400�COMPONENT-399�COMPONENT-398�COMPONENT-397�COMPONENT-396�COMPONENT-395�COMPONENT-394�COMPONENT-393�COMPONENT-392�COMPONENT-391�COMPONENT-390�COMPONENT-389�COMPONENT-388�COMPONENT-387�COMPONENT-386�COMPONENT-385�COMPONENT-384�COMPONENT-383�COMPONENT-382�COMPONENT-381�COMPONENT-380�COMPONENT-379�COMPONENT-378�COMPONENT-377�COMPONENT-376�COMPONENT-375�COMPONENT-374�COMPONENT-373�COMPONENT-372�COMPONENT-371�COMPONENT-370�COMPONENT-369�COMPONENT-368�COMPONENT-367�COMPONENT-366�COMPONENT-365�COMPONENT-364�COMPONENT-363�COMPONENT-362�COMPONENT-361�COMPONENT-360�COMPONENT-359�COMPONENT-358�COMPONENT-357�COMPONENT-356�COMPONENT-355�COMPONENT-354�COMPONENT-353�COMPONENT-352�COMPONENT-351�COMPONENT-350�COMPONENT-349�COMPONENT-348�COMPONENT-347�COMPONENT-346�COMPONENT-345�COMPONENT-344�COMPONENT-343�COMPONENT-342�COMPONENT-341�COMPONENT-340�COMPONENT-339�COMPONENT-338�COMPONENT-337�COMPONENT-336�COMPONENT-335�COMPONENT-334�COMPONENT-333�COMPONENT-332�COMPONENT-331�COMPONENT-330�COMPONENT-329�COMPONENT-328�COMPONENT-327�COMPONENT-326�COMPONENT-325�COMPONENT-324�COMPONENT-323�COMPONENT-322�COMPONENT-321�COMPONENT-320�COMPONENT-319�COMPONENT-318�COMPONENT-317�COMPONENT-316�COMPONENT-315�COMPONENT-314�COMPONENT-313�COMPONENT-312�COMPONENT-311�COMPONENT-310�COMPONENT-309�COMPONENT-308�COMPONENT-307�COMPONENT-306�COMPONENT-305�COMPONENT-304�COMPONENT-303�COMPONENT-302�COMPONENT-301�COMPONENT-300�COMPONENT-299�COMPONENT-298�COMPONENT-297�COMPONENT-296�COMPONENT-295�COMPONENT-294�COMPONENT-293�COMPONENT-292�COMPONENT-291�COMPONENT-290�COMPONENT-289�COMPONENT-288�COMPONENT-287�COMPONENT-286�COMPONENT-285�COMPONENT-284�COMPONENT-283�COMPONENT-282�COMPONENT-281�COMPONENT-280�COMPONENT-279�COMPONENT-278�COMPONENT-277�COMPONENT-276�COMPONENT-275�COMPONENT-274�COMPONENT-273�COMPONENT-272�COMPONENT-271�COMPONENT-270�COMPONENT-269�COMPONENT-268�COMPONENT-267�COMPONENT-266�COMPONENT-265�COMPONENT-264�COMPONENT-263�COMPONENT-262�COMPONENT-261�COMPONENT-260�COMPONENT-259�COMPONENT-258�COMPONENT-257�COMPONENT-256�COMPONENT-255�COMPONENT-254�COMPONENT-253�COMPONENT-252�COMPONENT-251�COMPONENT-250�COMPONENT-249�COMPONENT-248�COMPONENT-247�COMPONENT-246�COMPONENT-245�COMPONENT-244�COMPONENT-243�COMPONENT-242�COMPONENT-241�COMPONENT-240�COMPONENT-239�COMPONENT-238�COMPONENT-237�COMPONENT-236�COMPONENT-235�COMPONENT-234�COMPONENT-233�COMPONENT-232�COMPONENT-231�COMPONENT-230�COMPONENT-229�COMPONENT-228�COMPONENT-227�COMPONENT-226�COMPONENT-225�COMPONENT-224�COMPONENT-223�COMPONENT-222�COMPONENT-221�COMPONENT-220�COMPONENT-219�COMPONENT-218�COMPONENT-217�COMPONENT-216�COMPONENT-215�COMPONENT-214�COMPONENT-213�COMPONENT-212�COMPONENT-211�COMPONENT-210�COMPONENT-209�COMPONENT-208�COMPONENT-207�COMPONENT-206�COMPONENT-205�COMPONENT-204�COMPONENT-203�COMPONENT-202�COMPONENT-201�COMPONENT-200�COMPONENT-199�COMPONENT-198�COMPONENT-197�COMPONENT-196�COMPONENT-195�COMPONENT-194�COMPONENT-193�COMPONENT-192�COMPONENT-191�COMPONENT-190�COMPONENT-189�COMPONENT-188�COMPONENT-187�COMPONENT-186�COMPONENT-185�COMPONENT-184�COMPONENT-183�COMPONENT-182�COMPONENT-181�COMPONENT-180�COMPONENT-179�COMPONENT-178�COMPONENT-177�COMPONENT-176�COMPONENT-175�COMPONENT-174�COMPONENT-173�COMPONENT-172�COMPONENT-171�COMPONENT-170�COMPONENT-169�COMPONENT-168�COMPONENT-167�COMPONENT-166�COMPONENT-165�COMPONENT-164�COMPONENT-163�COMPONENT-162�COMPONENT-161�COMPONENT-160�COMPONENT-159�COMPONENT-158�COMPONENT-157�COMPONENT-156�COMPONENT-155�COMPONENT-154�COMPONENT-153�COMPONENT-152�COMPONENT-151�COMPONENT-150�COMPONENT-149�COMPONENT-148�COMPONENT-147�COMPONENT-146�COMPONENT-145�COMPONENT-144�COMPONENT-143�COMPONENT-142�COMPONENT-141�COMPONENT-140�COMPONENT-139�COMPONENT-138�COMPONENT-137�COMPONENT-136�COMPONENT-135�COMPONENT-134�COMPONENT-133�COMPONENT-132�COMPONENT-131�COMPONENT-130�COMPONENT-129�COMPONENT-128�COMPONENT-127�COMPONENT-126�COMPONENT-125�COMPONENT-124�COMPONENT-123�COMPONENT-122�COMPONENT-121�COMPONENT-120�COMPONENT-119�COMPONENT-118�COMPONENT-117�COMPONENT-116�COMPONENT-115�COMPONENT-114�COMPONENT-113�COMPONENT-112�COMPONENT-111�COMPONENT-110�COMPONENT-109�COMPONENT-108�COMPONENT-107�COMPONENT-106�COMPONENT-105�COMPONENT-104�COMPONENT-103�COMPONENT-102�COMPONENT-101�COMPONENT-100�COMPONENT-099�COMPONENT-098�COMPONENT-097�COMPONENT-096�COMPONENT-095�COMPONENT-094�COMPONENT-093�COMPONENT-092�COMPONENT-091�COMPONENT-090�COMPONENT-089�COMPONENT-088�COMPONENT-087�COMPONENT-086�COMPONENT-085�COMPONENT-084�COMPONENT-083�COMPONENT-082�COMPONENT-081�COMPONENT-080�COMPONENT-079�COMPONENT-078�COMPONENT-077�COMPONENT-076�COMPONENT-075�COMPONENT-074�COMPONENT-073�COMPONENT-072�COMPONENT-071�COMPONENT-070�COMPONENT-069�COMPONENT-068�COMPONENT-067�COMPONENT-066�COMPONENT-065�COMPONENT-064�COMPONENT-063�COMPONENT-062�COMPONENT-061�COMPONENT-060�COMPONENT-059�COMPONENT-058�COMPONENT-057�COMPONENT-056�COMPONENT-055�COMPONENT-054�COMPONENT-053�COMPONENT-052�COMPONENT-051�COMPONENT-050�COMPONENT-049�COMPONENT-048�COMPONENT-047�COMPONENT-046�COMPONENT-045�COMPONENT-044�COMPONENT-043�COMPONENT-042�COMPONENT-041�COMPONENT-040�COMPONENT-039�COMPONENT-038�COMPONENT-037�COMPONENT-036�COMPONENT-035�COMPONENT-034�COMPONENT-033�COMPONENT-032�COMPONENT-031�COMPONENT-030�COMPONENT-029�COMPONENT-028�COMPONENT-027�COMPONENT-026�COMPONENT-025�COMPONENT-024�COMPONENT-023�COMPONENT-022�COMPONENT-021�COMPONENT-020�COMPONENT-019�COMPONENT-018�COMPONENT-017�COMPONENT-016�COMPONENT-015�COMPONENT-014�COMPONENT-013�COMPONENT-012�COMPONENT-011�COMPONENT-010�COMPONENT-009�COMPONENT-008�COMPONENT-007�COMPONENT-006�COMPONENT-005�COMPONENT-004�COMPONENT-003�COMPONENT-002�COMPONENT-001�COMPONEN�COMPLIANCE�COMPLETION�COMPLETED�COMPLEMENT�COMPASS�COMPARE�COMMO�COMMERCIA�COMMAND�COMMA�COMM�COMET�COMBINED�COMBINATION�COMB�COLUMN�COLOR�COLLISIO�COLL�COL�COFFIN�COENG�COEN�CODA�COCONUT�COCKTAI�COAT�COASTER�COA�CM�C�CLUSTER-INITIA�CLUSTER-FINA�CLUSTE�CLUBS�CLUB-SPOKE�CLUB�CLU�CLOW�CLOVER�CLOUD�CLOU�CLOTHES�CLOTH�CLOSET�CLOSENESS�CLOSED�CLOS�CLOCKWIS�CLOC�CLIVIS�CLIPBOARD�CLINKIN�CLINGIN�CLIMBING�CLIMACUS�CLIFF�CLICK�CLEF-2�CLEF-1�CLEF�CLE�CLEAVER�CLEA�CLASSICA�CLAPPIN�CLAPPE�CLAN�CLA�CLAMSHEL�CLAIM�CL�CIX�CIVILIAN�CITYSCAPE�CITYSCAP�CIT�CITATIO�CIT�CIRCU�CIRCUMFLEX�CIRCUMFLE�CIRCULATIO�CIRCLING�CIRCLIN�CIRCLES�CIRCLE�CIRCLED�CIP�CINNABAR�CINEMA�CI�CI�CII�CIEX�CIEUC-SSANGPIEUP�CIEUC-PIEUP�CIEUC-IEUNG�CIEU�CIET�CIEP�CIE�CHYX�CHYT�CHYRX�CHYR�CHYP�CHWV�CHUX�CHURX�CHURCH�CHUR�CHUP�CHUOX�CHUOT�CHUOP�CHUO�CHULA�CHU�CHRYSANTHEMUM�CHRONOU�CHRONON�CHROM�CHRO�CHRIVI�CHRISTMAS�CHRISTMA�CHOY�CHOX�CHOT�CHOREVM�CHOPSTICKS�CHOP�CHOKE�CHOE�CHOCOLAT�CHOA�CHITUEUMSSANGSIOS�CHITUEUMSSANGCIEUC�CHITUEUMSIOS�CHITUEUMCIEUC�CHITUEUMCHIEUCH�CHIRON�CHIRET�CHIPMUNK�CHINOO�CHING�CHINES�CHIN�CHIME�CHILL�CHILDRE�CHILD�CHIL�CHIK�CHIEUCH-KHIEUKH�CHIEUCH-HIEUH�CHIEUC�CHICKEN�CHICK�CHI�CH�CHHA�CHEX�CHEVRO�CHET�CHESTNUT�CHEST�CHES�CHERY�CHERR�CHERRIES�CHEQUERE�CHEP�CHEINAP�CHEIKHEI�CHEIKHAN�CHEES�CHEERIN�CHEEM�CHEEK�CHEEK�CHEE�CHECKE�CHECK�CHEC�CH�CHAX�CHAVIYANI�CHATTAWA�CHAT�CHART�CHAR�CHARIOT�CHARIO�CHARACTERS�CHARACTER-1B2FB�CHARACTER-1B2FA�CHARACTER-1B2F9�CHARACTER-1B2F8�CHARACTER-1B2F7�CHARACTER-1B2F6�CHARACTER-1B2F5�CHARACTER-1B2F4�CHARACTER-1B2F3�CHARACTER-1B2F2�CHARACTER-1B2F1�CHARACTER-1B2F0�CHARACTER-1B2EF�CHARACTER-1B2EE�CHARACTER-1B2ED�CHARACTER-1B2EC�CHARACTER-1B2EB�CHARACTER-1B2EA�CHARACTER-1B2E9�CHARACTER-1B2E8�CHARACTER-1B2E7�CHARACTER-1B2E6�CHARACTER-1B2E5�CHARACTER-1B2E4�CHARACTER-1B2E3�CHARACTER-1B2E2�CHARACTER-1B2E1�CHARACTER-1B2E0�CHARACTER-1B2DF�CHARACTER-1B2DE�CHARACTER-1B2DD�CHARACTER-1B2DC�CHARACTER-1B2DB�CHARACTER-1B2DA�CHARACTER-1B2D9�CHARACTER-1B2D8�CHARACTER-1B2D7�CHARACTER-1B2D6�CHARACTER-1B2D5�CHARACTER-1B2D4�CHARACTER-1B2D3�CHARACTER-1B2D2�CHARACTER-1B2D1�CHARACTER-1B2D0�CHARACTER-1B2CF�CHARACTER-1B2CE�CHARACTER-1B2CD�CHARACTER-1B2CC�CHARACTER-1B2CB�CHARACTER-1B2CA�CHARACTER-1B2C9�CHARACTER-1B2C8�CHARACTER-1B2C7�CHARACTER-1B2C6�CHARACTER-1B2C5�CHARACTER-1B2C4�CHARACTER-1B2C3�CHARACTER-1B2C2�CHARACTER-1B2C1�CHARACTER-1B2C0�CHARACTER-1B2BF�CHARACTER-1B2BE�CHARACTER-1B2BD�CHARACTER-1B2BC�CHARACTER-1B2BB�CHARACTER-1B2BA�CHARACTER-1B2B9�CHARACTER-1B2B8�CHARACTER-1B2B7�CHARACTER-1B2B6�CHARACTER-1B2B5�CHARACTER-1B2B4�CHARACTER-1B2B3�CHARACTER-1B2B2�CHARACTER-1B2B1�CHARACTER-1B2B0�CHARACTER-1B2AF�CHARACTER-1B2AE�CHARACTER-1B2AD�CHARACTER-1B2AC�CHARACTER-1B2AB�CHARACTER-1B2AA�CHARACTER-1B2A9�CHARACTER-1B2A8�CHARACTER-1B2A7�CHARACTER-1B2A6�CHARACTER-1B2A5�CHARACTER-1B2A4�CHARACTER-1B2A3�CHARACTER-1B2A2�CHARACTER-1B2A1�CHARACTER-1B2A0�CHARACTER-1B29F�CHARACTER-1B29E�CHARACTER-1B29D�CHARACTER-1B29C�CHARACTER-1B29B�CHARACTER-1B29A�CHARACTER-1B299�CHARACTER-1B298�CHARACTER-1B297�CHARACTER-1B296�CHARACTER-1B295�CHARACTER-1B294�CHARACTER-1B293�CHARACTER-1B292�CHARACTER-1B291�CHARACTER-1B290�CHARACTER-1B28F�CHARACTER-1B28E�CHARACTER-1B28D�CHARACTER-1B28C�CHARACTER-1B28B�CHARACTER-1B28A�CHARACTER-1B289�CHARACTER-1B288�CHARACTER-1B287�CHARACTER-1B286�CHARACTER-1B285�CHARACTER-1B284�CHARACTER-1B283�CHARACTER-1B282�CHARACTER-1B281�CHARACTER-1B280�CHARACTER-1B27F�CHARACTER-1B27E�CHARACTER-1B27D�CHARACTER-1B27C�CHARACTER-1B27B�CHARACTER-1B27A�CHARACTER-1B279�CHARACTER-1B278�CHARACTER-1B277�CHARACTER-1B276�CHARACTER-1B275�CHARACTER-1B274�CHARACTER-1B273�CHARACTER-1B272�CHARACTER-1B271�CHARACTER-1B270�CHARACTER-1B26F�CHARACTER-1B26E�CHARACTER-1B26D�CHARACTER-1B26C�CHARACTER-1B26B�CHARACTER-1B26A�CHARACTER-1B269�CHARACTER-1B268�CHARACTER-1B267�CHARACTER-1B266�CHARACTER-1B265�CHARACTER-1B264�CHARACTER-1B263�CHARACTER-1B262�CHARACTER-1B261�CHARACTER-1B260�CHARACTER-1B25F�CHARACTER-1B25E�CHARACTER-1B25D�CHARACTER-1B25C�CHARACTER-1B25B�CHARACTER-1B25A�CHARACTER-1B259�CHARACTER-1B258�CHARACTER-1B257�CHARACTER-1B256�CHARACTER-1B255�CHARACTER-1B254�CHARACTER-1B253�CHARACTER-1B252�CHARACTER-1B251�CHARACTER-1B250�CHARACTER-1B24F�CHARACTER-1B24E�CHARACTER-1B24D�CHARACTER-1B24C�CHARACTER-1B24B�CHARACTER-1B24A�CHARACTER-1B249�CHARACTER-1B248�CHARACTER-1B247�CHARACTER-1B246�CHARACTER-1B245�CHARACTER-1B244�CHARACTER-1B243�CHARACTER-1B242�CHARACTER-1B241�CHARACTER-1B240�CHARACTER-1B23F�CHARACTER-1B23E�CHARACTER-1B23D�CHARACTER-1B23C�CHARACTER-1B23B�CHARACTER-1B23A�CHARACTER-1B239�CHARACTER-1B238�CHARACTER-1B237�CHARACTER-1B236�CHARACTER-1B235�CHARACTER-1B234�CHARACTER-1B233�CHARACTER-1B232�CHARACTER-1B231�CHARACTER-1B230�CHARACTER-1B22F�CHARACTER-1B22E�CHARACTER-1B22D�CHARACTER-1B22C�CHARACTER-1B22B�CHARACTER-1B22A�CHARACTER-1B229�CHARACTER-1B228�CHARACTER-1B227�CHARACTER-1B226�CHARACTER-1B225�CHARACTER-1B224�CHARACTER-1B223�CHARACTER-1B222�CHARACTER-1B221�CHARACTER-1B220�CHARACTER-1B21F�CHARACTER-1B21E�CHARACTER-1B21D�CHARACTER-1B21C�CHARACTER-1B21B�CHARACTER-1B21A�CHARACTER-1B219�CHARACTER-1B218�CHARACTER-1B217�CHARACTER-1B216�CHARACTER-1B215�CHARACTER-1B214�CHARACTER-1B213�CHARACTER-1B212�CHARACTER-1B211�CHARACTER-1B210�CHARACTER-1B20F�CHARACTER-1B20E�CHARACTER-1B20D�CHARACTER-1B20C�CHARACTER-1B20B�CHARACTER-1B20A�CHARACTER-1B209�CHARACTER-1B208�CHARACTER-1B207�CHARACTER-1B206�CHARACTER-1B205�CHARACTER-1B204�CHARACTER-1B203�CHARACTER-1B202�CHARACTER-1B201�CHARACTER-1B200�CHARACTER-1B1FF�CHARACTER-1B1FE�CHARACTER-1B1FD�CHARACTER-1B1FC�CHARACTER-1B1FB�CHARACTER-1B1FA�CHARACTER-1B1F9�CHARACTER-1B1F8�CHARACTER-1B1F7�CHARACTER-1B1F6�CHARACTER-1B1F5�CHARACTER-1B1F4�CHARACTER-1B1F3�CHARACTER-1B1F2�CHARACTER-1B1F1�CHARACTER-1B1F0�CHARACTER-1B1EF�CHARACTER-1B1EE�CHARACTER-1B1ED�CHARACTER-1B1EC�CHARACTER-1B1EB�CHARACTER-1B1EA�CHARACTER-1B1E9�CHARACTER-1B1E8�CHARACTER-1B1E7�CHARACTER-1B1E6�CHARACTER-1B1E5�CHARACTER-1B1E4�CHARACTER-1B1E3�CHARACTER-1B1E2�CHARACTER-1B1E1�CHARACTER-1B1E0�CHARACTER-1B1DF�CHARACTER-1B1DE�CHARACTER-1B1DD�CHARACTER-1B1DC�CHARACTER-1B1DB�CHARACTER-1B1DA�CHARACTER-1B1D9�CHARACTER-1B1D8�CHARACTER-1B1D7�CHARACTER-1B1D6�CHARACTER-1B1D5�CHARACTER-1B1D4�CHARACTER-1B1D3�CHARACTER-1B1D2�CHARACTER-1B1D1�CHARACTER-1B1D0�CHARACTER-1B1CF�CHARACTER-1B1CE�CHARACTER-1B1CD�CHARACTER-1B1CC�CHARACTER-1B1CB�CHARACTER-1B1CA�CHARACTER-1B1C9�CHARACTER-1B1C8�CHARACTER-1B1C7�CHARACTER-1B1C6�CHARACTER-1B1C5�CHARACTER-1B1C4�CHARACTER-1B1C3�CHARACTER-1B1C2�CHARACTER-1B1C1�CHARACTER-1B1C0�CHARACTER-1B1BF�CHARACTER-1B1BE�CHARACTER-1B1BD�CHARACTER-1B1BC�CHARACTER-1B1BB�CHARACTER-1B1BA�CHARACTER-1B1B9�CHARACTER-1B1B8�CHARACTER-1B1B7�CHARACTER-1B1B6�CHARACTER-1B1B5�CHARACTER-1B1B4�CHARACTER-1B1B3�CHARACTER-1B1B2�CHARACTER-1B1B1�CHARACTER-1B1B0�CHARACTER-1B1AF�CHARACTER-1B1AE�CHARACTER-1B1AD�CHARACTER-1B1AC�CHARACTER-1B1AB�CHARACTER-1B1AA�CHARACTER-1B1A9�CHARACTER-1B1A8�CHARACTER-1B1A7�CHARACTER-1B1A6�CHARACTER-1B1A5�CHARACTER-1B1A4�CHARACTER-1B1A3�CHARACTER-1B1A2�CHARACTER-1B1A1�CHARACTER-1B1A0�CHARACTER-1B19F�CHARACTER-1B19E�CHARACTER-1B19D�CHARACTER-1B19C�CHARACTER-1B19B�CHARACTER-1B19A�CHARACTER-1B199�CHARACTER-1B198�CHARACTER-1B197�CHARACTER-1B196�CHARACTER-1B195�CHARACTER-1B194�CHARACTER-1B193�CHARACTER-1B192�CHARACTER-1B191�CHARACTER-1B190�CHARACTER-1B18F�CHARACTER-1B18E�CHARACTER-1B18D�CHARACTER-1B18C�CHARACTER-1B18B�CHARACTER-1B18A�CHARACTER-1B189�CHARACTER-1B188�CHARACTER-1B187�CHARACTER-1B186�CHARACTER-1B185�CHARACTER-1B184�CHARACTER-1B183�CHARACTER-1B182�CHARACTER-1B181�CHARACTER-1B180�CHARACTER-1B17F�CHARACTER-1B17E�CHARACTER-1B17D�CHARACTER-1B17C�CHARACTER-1B17B�CHARACTER-1B17A�CHARACTER-1B179�CHARACTER-1B178�CHARACTER-1B177�CHARACTER-1B176�CHARACTER-1B175�CHARACTER-1B174�CHARACTER-1B173�CHARACTER-1B172�CHARACTER-1B171�CHARACTER-1B170�CHARACTER�CHAR�CHAPTER�CHAP�CHANG�CHAN�CHAMKO�CHAMILON�CHAMILI�CHA�CHAKM�CHAINS�CHADA�CHA�CHAA�CGJ�CEX�CEVITU�CERES�CEREMONY�CEREK�CER-WA�CEP�CEONGCHIEUMSSANGSIOS�CEONGCHIEUMSSANGCIEUC�CEONGCHIEUMSIOS�CEONGCHIEUMCIEUC�CEONGCHIEUMCHIEUCH�CENTURIA�CENTRELIN�CENTRED�CENTRE�CENTRE�CENTR�CENTRALIZATIO�CEN�CELTI�CELSIUS�CELEBRATION�CEIRT�CEILING�CEILIN�CEEV�CEEB�CEE�CEDILLA�CEDILL�CED�CECEK�CECAK�CECA�CEALC�CCU�CCO�CCI�CCHU�CCHO�CCHI�CCHHU�CCHHO�CCHHI�CCHHEE�CCHHE�CCHHAA�CCHHA�CCHEE�CCHE�CCHAA�CCHA�CCH�CCEE�CCE�CCAA�CCA�CAYN�CAYANNA�CAX�CAVE�CAUTIO�CAULDRON�CAUDA�CAUCASIA�CAU�CATAWA�CAT�CA�CASTLE�CASKE�CARYSTIA�CARTWHEEL�CARTRIDGE�CART�CAR�CARROT�CARRIAG�CARPENTR�CAR�CAROUSE�CARON�CARO�CARI�CARIA�CARET�CARE�CAR�CARDS�CARD�CAR�CAR�CA�CAPU�CAPTIVE�CAPRICORN�CAPPE�CAPO�CAPITULUM�CAPITAL�CANTILLATIO�CANOE�CANNON�CANNE�CAN�CANE�CANDY�CANDRABINDU�CANDRABIND�CANDRA�CANDR�CANDLE�CANCER�CANCELLATIO�CANCEL�CANCE�CAN�CAMPING�CAMNU�CAMERA�CAMER�CAMEL�CALYA�CALY�CALX�CALL�CAL�CALENDAR�CALENDA�CALCULATOR�CALC�CAKRA�CAK�CAI�CAH�CAESURA�CADUCEUS�CAD�CACTUS�CABLEWAY�CABINET�CABBAGE-TREE�CAANG�CAAI�C�C024�C023�C022�C021�C020�C019�C018�C017�C016�C015�C014�C013�C012�C011�C010A�C010�C009�C008�C007�C006�C005�C004�C003�C002C�C002B�C002A�C002�C001�C-SIMPLIFIE�C-39�C-18�BZUN�BZH�BYT�BYELORUSSIAN-UKRAINIA�BXG�BWI�BWEE�BWE�BWA�BUUMISH�BUTTON�BUTTO�BUTTERFLY�BUTTER�BU�BUST�BUS�BUSSYERU�BUSINES�BU�BUR�BURRITO�BUR2�BU�BUOX�BUOP�BUNN�BUNG�BUMP�BULUG�BULU�BULLSEYE�BULL�BULLHORN�BULLHOR�BULLET�BULLE�BULL�BULB�BUKY�BUILDINGS�BUILDING�BUILDIN�BUHI�BUGINES�BUG�BUFFALO�BUD�BUCKLE�BUBBLES�BUBBLE�BSTAR�BSKU�BSKA�BSDU�BRUS�BROW�BROOM�BRONZE�BROKE�BROCCOLI�BROA�BRISTLE�BRIGHTNES�BRIEFS�BRIEFCASE�BRIDG�BRID�BRICK�BRI�BREVIS�BREVE-MACRON�BREV�BREAT�BREAST-FEEDING�BREAKTHROUGH�BRD�BRANCHIN�BRANCHES�BRANCH�BRANC�BRAKCET�BRAIN�BRACKETE�BRACKE�BRACE�BQ�BPH�BOY�BOY�BOXIN�BOWTIE�BOWTI�BOWLING�BOWL�BOW�BOWIN�BO�BOUQUET�BOUQUE�BOUNDAR�BOTTOM-SHADE�BOTTOM-LIGHTE�BOTTOM�BOTTO�BOTTLE�BOTTL�BOT�BORUTO�BORAX-3�BORAX-2�BORAX�BOPOMOF�BOOTS�BOOT�BOOMERANG�BOOKS�BOOKMARK�BOOKMAR�BONE�BOMB�BOM�BOLT�BOL�BOHAIRI�BODY�BOD�BOAR�BOA�BLUE�BLU�BLOWIN�BLOWFISH�BLO�BLOSSOM�BLOOD�BLON�BLOCK�BLIN�BLANK�BLAN�BLAD�BLACKLETTE�BLACKFOO�BLACK-LETTE�BLACK-FEATHERE�BLACK�BKA�BITTER�BITIN�BIT�BITCOI�BISMUT�BISMILLA�BISHO�BISECTIN�BISAH�BIRU�BIRTHDA�BIRGA�BIRG�BIRD�BIOHAZAR�BINOVILE�BINOCULA�BINDIN�BINDI�BINAR�BILLIONS�BILLIARDS�BILLE�BILABIA�BIKINI�BIG�BI�BIET�BIDENTA�BIDAKUO�BICYCLIST�BICYCLES�BICYCLE�BICEPS�BIBLE-CRE�BIB�B�BHU�BHOO�BHO�BHI�BHETH�BHEE�BHE�BHATTIPROL�BHAM�BHAIKSUK�BHAA�BHA�BEYYAL�BEX�BEVERAGE�BEVERAG�BETWEEN�BETWEE�BETH�BETA�BET�BE�BESID�BERKANA�BERBE�BEP�BEOR�BENZEN�BENT�BENT�BEN�BENGAL�BENDE�BEND�BEN�BE�BELT�BEL�BELO�BELLHO�BELL�BEL�BELGTHO�BEITH�BEHIN�BEHEH�BEHE�BEH�BE�BEGINNING�BEGINNER�BEGI�BEFOR�BEETLE�BEETA�BEE�BEEHIVE�BEEH�BEE�BECAUSE�BEAVE�BEATIN�BEAT�BEARDE�BEAR�BEA�BEAN�BEAME�BEADS�BEAC�BCAD�BCA�BBYX�BBYT�BBYP�BBY�BBUX�BBUT�BBURX�BBUR�BBUP�BBUOX�BBUOP�BBUO�BBU�BBOX�BBOT�BBOP�BBO�BBIX�BBIP�BBIEX�BBIET�BBIEP�BBIE�BBI�BBEX�BBEP�BBEE�BBE�BBAX�BBAT�BBAP�BBAA�BBA�BAYANNA�BAU�BATTERY�BATHTUB�BATHAMASAT�BATH�BAT�BATA�BASSA�BASS�BASKETBAL�BASHKI�BASH�BASELIN�BASEBALL�BASE�BAS�BARS�BAR�BARRIER�BARREKH�BARREE�BARRE�BARLINE�BARLEY�BARIYOOSAN�BARBE�BARA2�BA�BANTOC�BANKNOT�BANK�BAN�BANJO�BAND�BANANA�BAN2�BAN�BAMBOOS�BAMBOO�BALUDA�BALLPOIN�BALLOT�BALLO�BALLOON-SPOKE�BALLOON�BALLE�BALD�BALAG�BAL�BA�BAIRKAN�BAIMAI�BAHT�BAHIRGOMUKHA�BAHAR2�BAHAR�BAH�BAGUETT�BAGS�BAGGAG�BAGEL�BAGA�BAG3�BA�BADMINTO�BADGER�BADGE�BAD�BA�BACTRIA�BACON�BACKWARD�BACKSPACE�BACKSLASH�BACKSLAS�BACKSLANTE�BACKHAN�BACK-TILTE�BACK�BAC�BABY�BAB�BAARERU�BA-2�B305�B25�B24�B24�B24�B24�B24�B23�B23�B23�B22�B22�B19�B17�B17�B169�B168�B167�B166�B165�B164�B16�B16�B161�B160�B15�B158�B157�B15�B155�B154�B153�B152�B15�B150�B146�B14�B142�B14�B14�B13�B13�B132�B13�B13�B12�B12�B12�B12�B12�B12�B12�B109�B109�B108�B108�B107�B107�B106�B106�B105�B105�B10�B10�B10�B10�B09�B09�B089�B08�B086�B08�B083�B082�B08�B08�B079�B07�B07�B07�B07�B07�B07�B07�B07�B07�B06�B06�B06�B06�B06�B064�B063�B06�B06�B06�B05�B05�B05�B056�B05�B05�B05�B05�B05�B05�B049�B04�B047�B04�B04�B04�B04�B04�B04�B04�B03�B03�B03�B03�B034�B03�B03�B03�B03�B02�B02�B02�B02�B02�B02�B02�B022�B02�B02�B019�B018�B01�B01�B01�B01�B01�B01�B01�B01�B009�B00�B008�B00�B007�B00�B006�B00�B005A�B005�B00�B004�B00�B003�B00�B002�B00�B001�B00�AZU�AYB�AYAH�AXE�AWE�AWA�AVOCADO�AVESTA�AVERAG�AVAKRAHASANYA�AVAGRAHA�AUYANNA�AUTUMN�AUTOMOBILE�AUTOMATE�AUT�AUSTRA�AURIPIGMENT�AURAMAZDAAHA�AURAMAZDAA-2�AURAMAZDAA�AUNN�AUGUST�AUGMENTATIO�AUE�AUBERGINE�ATTI�ATTHACAN�ATTENTION�ATTA�ATTACHE�ATO�ATNA�ATMAAU�ATIYA�ATIU�ATIKRAMA�ATHLETI�ATHARVAVEDI�ATHAPASCA�ATH-THALATHA�ASZ�ASYUR�ASYMPTOTICALL�ASTRONOMICA�ASTROLOGICA�ASTRAEA�ASTONISHE�ASTERISM�ASTERISK�ASTERISK�ASTERIS�ASTERISCUS�ASSYRIA�ASSERTION�ASPIRATION�ASPIRATE�ASPER�ASIA-AUSTRALIA�ASHGAB�ASHES�ASH9�ASH3�ASH�ASCENT�ASCENDIN�ASAL2�AS-SAJDA�ARUHUA�ART�ARTIS�ARTICULATE�ARTAB�ARTA�ARSEOS�ARSEO�ARSENIC�ARROWS�ARROW�ARROWHEADS�ARROWHEAD�ARROWHEA�ARROW-TAIL�ARRIVING�ARRIVE�ARRAY�ARPEGGIAT�AROUSIN�AROUR�AROUND-PROFILE�AROUN�ARMY�ARMOUR�ARMENIA�ARM�AR�ARLAU�ARKTIK�ARKAB�ARKAANU�ARISTERA�ARISTER�ARIES�ARGOTERI�ARGOSYNTHETON�ARGI�AREPA�AREA�ARDHAVISARGA�ARDHACANDRA�ARCHAION�ARCHAIO�ARCHAI�ARC�ARC�AR�ARAMAI�ARAEAE�ARAEA-U�ARAEA-I�ARAEA-EO�ARAEA-E�ARAEA-A�ARAD�ARA�ARABIC-INDI�ARABIA�AR-RUB�AR-RAHMA�AR-RAHEEM�AQUARIUS�AQUAFORTIS�AQU�APU�APRIL�APPROXIMATEL�APPROXIMATE�APPROACHE�APPROACH�APPLICATION�APPLICATIO�APOTHES�APOTHEMA�APOSTROPHE�APOSTROFOS�APOSTROFO�APOSTROFO�APOLLON�APODEXIA�APODERM�APLOUN�APL�AP�APIN�APES�APC�APART�APAATO�AOU�AOR�ANUSVARAYA�ANUSVARA�ANUSVAR�ANUDATTA�ANUDATT�ANTIRESTRICTION�ANTIMONY-2�ANTIMONY�ANTIMON�ANTIMONIATE�ANTIKENOMA�ANTIKENOKYLISMA�ANTIFONIA�ANTICLOCKWISE-ROTATE�ANTICLOCKWISE�ANTICLOCKWIS�ANTENNA�ANTENN�ANTARGOMUKHA�ANSU�ANSHE�ANPEA�AN�ANNUIT�ANNOTATIO�ANNAAU�ANKH�ANJI�ANIMAL�ANHU�ANGULAR�ANGUISHE�ANGSTRO�ANGR�ANGLICAN�ANGLED�ANGLE�ANGKHANKHU�ANGKA�ANGE�ANGEL�ANGED�ANDAP�ANCORA�ANCHOR�ANATRICHISMA�ANAP�AN-NISF�AMULET�AMPS�AMPHORA�AMPERSAND�AMPERSAN�AMOUN�AMERICAS�AMERICA�AMBULANCE�AMB�AMB�AMAR�AMA�AMALGAMATIO�AMALGAM�ALVEOLA�ALUM�ALTERNATIV�ALTERNATIO�ALTERNATING�ALTERNATIN�ALTERNATE�ALTERNAT�ALTA�ALPHA�ALPH�ALPAPRANA�ALPAPRAAN�ALPA�ALMOS�ALLO�ALLIANCE�ALL�ALLA�ALKALI-2�ALKALI�ALIGNE�ALIFU�ALIF�ALI�ALIEN�ALIE�ALGI�ALFA�ALEU�ALERT�ALEPH�ALEMBIC�ALEF�ALBANIA�ALAYHE�ALAYH�ALAR�ALAPH�AL-LAKUNA�AKTIESELSKAB�AKSA�AKHMIMI�AKBA�AKARA�AKAR�AIYANNA�AIVILI�AIVA�AITO�AIRPLANE�AIRPLAN�AIN�AINN�AILM�AIKARA�AIHVUS�AHSDA�AHSA�AHO�AHAN�AHAGGA�AHAD�AGUNG�AGOG�AGGRAVATION�AGGRAVATE�AGAINS�AGAIN�AFTE�AFSAAQ�AFRICA�AFOREMENTIONED�AFGHAN�AFFRICATIO�AFFI�AEYANNA�AEY�AESCULAPIUS�AESC�AES�AERIA�AER�AELA-PILLA�AEL�AEK�AEGEA�AEG�AEEYANNA�AEE�AEDA-PILLA�AED�AEB�ADVANTAGE�ADVANCE�ADULT�ADMISSIO�ADMETOS�ADLA�ADHESIV�ADEG�ADE�ADDRESSE�ADDRES�ADDAK�ADA�ACUTE-MACRON�ACUTE-GRAVE-ACUTE�ACUT�ACTUALL�ACTIVAT�ACROPHONI�ACKNOWLEDGE�ACCUMULATION�ACCOUN�ACCOMMODATION�ACCEPT�ACCENT-STACCATO�ACCENT�ACCEN�ACADEM�ABYSMA�ABUNDANCE�ABKHASIA�ABBREVIATIO�ABAFILI�ABACUS�AB�AB191�AB188�AB180�AB171�AB164�AB131B�AB131A�AB123�AB122�AB120�AB118�AB087�AB086�AB085�AB082�AB081�AB080�AB079�AB078�AB077�AB076�AB074�AB073�AB070�AB069�AB067�AB066�AB065�AB061�AB060�AB059�AB058�AB057�AB056�AB055�AB054�AB053�AB051�AB050�AB049�AB048�AB047�AB046�AB045�AB044�AB041�AB040�AB039�AB038�AB037�AB034�AB031�AB030�AB029�AB028�AB027�AB026�AB024�AB023M�AB023�AB022M�AB022F�AB022�AB021M�AB021F�AB021�AB020�AB017�AB016�AB013�AB011�AB010�AB009�AB008�AB007�AB006�AB005�AB004�AB003�AB002�AB001�AAZHAAKKU�AAYIN�AAYANNA�AAY�AAW�AAO�AAJ�AABAAFILI�AA032�AA031�AA030�AA029�AA028�AA027�AA026�AA025�AA024�AA023�AA022�AA021�AA020�AA019�AA018�AA017�AA016�AA015�AA014�AA013�AA012�AA011�AA010�AA009�AA008�AA007B�AA007A�AA007�AA006�AA005�AA004�AA003�AA002�AA001�A807�A806�A805�A804�A803�A802�A801�A800�A73�A72�A71�A71�A71�A71�A71�A71�A71�A709-�A709-�A709-�A709-�A70�A70�A70�A70�A70�A70�A70�A70�A70�A664�A663�A662�A661�A660�A659�A658�A657�A656�A655�A654�A653�A652�A651�A649�A648�A646�A645�A644�A643�A642�A640�A638�A637�A634�A629�A628�A627�A626�A624�A623�A622�A621�A620�A619�A618�A617�A616�A615�A614�A613�A612�A611�A610�A609�A608�A606�A604�A603�A602�A601�A600�A598�A596�A595�A594�A592�A591�A589�A588�A587�A586�A585�A584�A583�A582�A581�A580�A579�A578�A577�A576�A575�A574�A573�A572�A571�A570�A569�A568�A566�A565�A564�A563�A559�A557�A556�A555�A554�A553�A552�A551�A550�A549�A548�A547�A545�A542�A541�A540�A539�A538�A537�A536�A535�A534�A532�A531�A530�A529�A528�A527�A526�A525�A524�A523�A522�A521�A520�A519�A518�A517�A516�A515�A514�A513�A512�A511�A510�A509�A508�A507�A506�A505�A504�A503�A502�A501�A497�A496�A495�A494�A493�A492�A491�A490�A489�A488�A487�A486�A485�A484�A483�A482�A481�A480�A479�A478�A477�A476�A475�A474�A473�A472�A471�A470�A469�A468�A467�A466�A465�A464�A463�A462�A461�A460�A459�A458�A457A�A457�A456�A455�A454�A453�A452�A451�A450A�A450�A449�A448�A447�A446�A445�A444�A443�A442�A441�A440�A439�A438�A437�A436�A435�A434�A433�A432�A431�A430�A429�A428�A427�A426�A425�A424�A423�A422�A421�A420�A419�A418-VAS�A418�A417-VAS�A417�A416-VAS�A416�A415-VAS�A415�A414-VAS�A414�A413-VAS�A413�A412-VAS�A412�A411-VAS�A411�A410�A410-VAS�A41�A409-VAS�A409�A408-VAS�A408�A407-VAS�A407�A406-VAS�A406�A405-VAS�A405�A404-VAS�A404�A403-VAS�A403�A402-VAS�A402�A401-VAS�A401�A400-VAS�A400�A399�A398�A397�A396�A395�A394�A39�A392�A391�A390�A389�A388�A387�A386A�A386�A385�A384�A383A�A38�A382�A381A�A381�A380�A379�A378�A377�A376�A375�A374�A373�A372�A371A�A371�A370�A369�A368A�A368�A367�A366�A365�A364A�A364�A363�A362�A361�A360�A359A�A359�A358�A357�A356�A355�A354�A353�A352�A351�A350�A349�A348�A347�A346�A345�A344�A343�A342�A341�A340�A339�A338�A337�A336C�A336B�A336A�A336�A335�A334�A333�A332C�A332B�A332A�A332�A331�A330�A329A�A329�A328�A327�A326�A325�A324�A323�A322�A321�A320�A319�A318�A317�A316�A315�A314�A313C�A313B�A313A�A313�A312�A311�A310�A309C�A309B�A309A�A309�A308�A307�A306�A305�A304�A303�A302�A301�A300�A299A�A299�A298�A297�A296�A295�A294A�A294�A293�A292�A291�A290�A289A�A289�A288�A287�A286�A285�A284�A283�A282�A281�A280�A279�A278�A277�A276�A275�A274�A273�A272�A271�A270�A269�A268�A267A�A267�A266�A265�A264�A263�A262�A261�A260�A259�A258�A257�A256�A255�A254�A253�A252�A251�A250�A249�A248�A247�A246�A245�A244�A243�A242�A241�A240�A239�A238�A237�A236�A235�A234�A233�A232�A231�A230�A229�A228�A227A�A227�A226�A225�A224�A223�A222�A221�A220�A219�A218�A217�A216A�A216�A215A�A215�A214�A213�A212�A211�A210�A209A�A209�A208�A207A�A207�A206�A205�A204�A203�A202B�A202A�A202�A201�A200�A199�A198�A197�A196�A195�A194�A193�A192�A191�A190�A189�A188�A187�A186�A185�A184�A183�A182�A181�A180�A179�A178�A177�A176�A175�A174�A173�A172�A171�A170�A169�A168�A167�A166�A165�A164�A163�A162�A161�A160�A159�A158�A157�A156�A155�A154�A153�A152�A151�A150�A149�A148�A147�A146�A145�A144�A143�A142�A141�A140�A139�A138�A137�A136�A135A�A135�A134�A133�A132�A131C�A131�A130�A129�A128�A127�A126�A125A�A125�A124�A123�A122�A121�A120B�A120�A119�A118�A117�A116�A115A�A115�A114�A113�A112�A111�A110B�A110A�A110�A109�A108�A107C�A107B�A107A�A107�A106�A105B�A105A�A105�A104C�A104B�A104A�A104�A103�A102A�A102�A101A�A101�A100A�A100-102�A100�A099�A098A�A098�A097A�A097�A096�A095�A094�A093�A092�A091�A090�A089�A088�A087�A086�A085�A084�A083�A082�A081�A080�A079�A078�A077�A076�A075�A074�A073�A072�A071�A070�A069�A068�A067�A066C�A066B�A066A�A066�A065�A064�A063�A062�A061�A060�A059�A058�A057�A056�A055�A054�A053�A052�A051�A050�A049�A048�A047�A046B�A046A�A046�A045A�A045�A044�A043A�A043�A042A�A042�A041A�A041�A040A�A040�A039A�A039�A038�A037�A036�A035�A034�A033�A032A�A028B�A026A�A017A�A014A�A010A�A006B�A006A�A005A�A-WO�A-EU�-U�-PHRU�-KHYU�-KHYIL�-DZU�-CHA�-CHAL�
",17@BEQYflqv|���������������������
"(-04:@EHMW]bgmr{}����[�������������������
&.7:>AEOSZahox���������	�������������#,5=EHSY^fmpz~������f�����������������@��")14=EIPV[`fkpuy~�������������������������W\aglv'z+��/49=AGK�NP�UY�_�cgn�rw{~��������������������������������!&+04<AEJOTY]`glqv{�������������������������������#�(�,.4:@FLRX^ciou{������������������������
$(,059<AEJNRW[^bhvz~���������������������������							$	'	)	h-	4	<	F	O	]	a	e	j	w		�	�	�	�	�	�	�	�	��	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	
�






c� 
$
(
+
0
5
:
?
C
J
O
R
V
]
c
g
k
o
t
{
�
�
�
�
�
�
�
�
�
�
�
#(-1=DJ�PW]adkqvz��-�������������������������	
 $(.3:>HLPUY^dimqu�	}���������1����������������

we





"
&
,
1
5
9
>
C
G
L
P
S
W
\
`
e
i
l
n
r
v
{

�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
	
 &+06<AFKP��SV[_cgknrw|������������������������ *.27<F=KORX]cinuy}�������P?�����������������F
'!)48BHMRW\Kafu{�����������������������X
"'.38=�BEHLOUYgknrx~������������������� $-26;?GMQX]agSmrw|�(������������������������	#(8q-37;@DHKOSVZ^bgkou~j��������������������������
#(,16;@EJOTY^bglqv{��������������������������	$*06<BGMSY_ekqw}����������������������
"(.4:@FKQW]ciou{����������������������
$*06<BHNSY_ekqw}����������������������"(.4:@FLRW]ciou{����������������������	!(,9=AEHLQU^bhoz�������������������&*1;EMTY]aimw|������������`����������
",;JYhw���������
+:IXgv���������*9HWfu���������"(26:?DIQUX\C_dZjrvz}�������������������#&,s
06;@EKPUZ_ejouz�����������������������        % * / 4 : @ E K Q W \ a f k q w | � � � � � � � � � � � � � � � \|� � � � � � � � � !	!!!w!!!#!(!/!7!<!@!C!G!M!S!W!�<Z!^!c!i!n!r!u!y!!�!�!�!�!�!�!'�!�!�!�!�!�!�!�!�!�!�!�!�!�05"":"""!"%"."4":"?"C"I"N"V"]"d"j"n"w"�"�"�"�"�"�"�"�"�"�"�"��"�"�"�"�"�">����"�"##
###�###+#/#3#7#;#�?#D#K#Q#W#Z#\#_#g#o#w#z##��#!�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#$	$$$$$"$'$,$1$6$;$@$E$J$O$U$[$`$e$j$o$t$���y$�$�$�$		�$			 	�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$%%%%%%#%'%,%0%5%9%?%C%H%O%Z%b%l%r%|%�%�%�%�%�%�%�%�%�%�%�%�%�%	&&#&*&0&;&E&S&Z&`&i&q&u&z&~&�&�&�&�&�&�&�&�&�&�&�&�&�&�!�&�&�&�&�&�&&�&''	'''''%','2'6'9'?'I'M'S'X'\'a'e'k'q'v'|'�'�'�'s�'�'�'�'�'�'�'�'�'�'�'�'�'�'��'�'�'�'�'�'�'�'(
(�'(((!(&(*(�/(8(=(B(G#N#G(�K(P(U(Z(�'^(c(h(�'l(�'q(x((�(�(�(�(�(�(�(�(�(�(�'�'�(�(�(�(�(�'�(�(�(�(�(�(�())))&).)6)>)G)P)X)a)j)s)|)�)�)�)�)�)�)�)�)�)�)�)�)�)�)***+*6*>*H*R*Z*`*l*u*}*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*+++&+.+3+7+@+F+K+U+_+i+n+r+|+�+�+�+�+�+�+�+�+�+�+�+,,
,,,,%,,,7,<,D,N,T,X,[,_,e,l,p,x,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,-----�'-$-+-1-6-=-D-K-R-Y-`-g-n-u-|-�-�-�-�-�-�-�)�-�-�-�-�-�-�-�-�-�-�-�-�-�-..m#
.
.....#.)...4.9.>.D.I.N.�&S.W.[._.d.i.n.v.|.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.��.�..�.�.�.�.�.//r//// ///B/N/[/h/u/�/�/�/�/�'�/�/�/�/�/�/�/s"�/�/�/�/�/�/�/0000000�F*$0(0.04090?0D0�'J0P0U0Z0b0h0u0}0�0�0�'�0�0�0�0�0�0�0�0�0�0111#1*141=1E1L1Q1W1�'\1b1g1l1�'q1t1{1�1�1�1�1S%�1�1�1�1�1�1�1�1�1�1��1�1'/222�'22#2)2/242<2D2K2O2[2i2s2x2|2�2�2�2�2(�2(�2�2�2�2�2�2�2�2�2�2�2�2�2�2(�'�2��2�233333#3(3/363:3E3O3X3a3m3r3v3~3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�344444"4'4-434:4E4O4Y4b4i4r4v4(("('(|4�4�4�4�4+(�4�4�4�4�4�4�4�4�4�4�4�4�4�455555e5#5*50555:50(<5@5E5I5S5X5\5_5h5l5o5v59({5~5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5666666 6%6)60666>6D6I6S6Z6_6d6h6l6t6
|6�6>(�6�6�6�6�6�6�6��6�6�6�6�6�6�6�6�6�6�6�6�6�6�67C(77777!7�&7+70757;7@7F7K7P7U7Z7_7d7i7n7s7x7}7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�788
88�p88!8&8*8.82878;8@8D8G8K8O8U8Z8d8j8r8x8|8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8999"9,969?9I9S9]9g9q9{9�9�9�9�9�9�9�9�9�9�9�9�9�9:::#:-:6:@:J:T:^:h:r:|:�:�:�:�:�:��:�:�:�:�:�:�:�:�:�:�:�:�:�:�:;;;L(;;;$;V();,;2;:;[(A;E;I;N;R;\;b;h;m;v;~;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;<<<<<<<'<.<9<><H<Q<U<X<_<i<r<y<}<�<�<�<�<�<�:�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<	=== =)=4===I=U=a=k=t=~=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�= !�=�=�=�=>
>>>>#>)>1>8>A>J>S>\>e>n>w>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>????&?-?5?>?K?T?\?c?p?v?|?�?�?�?�?�?�?�?�?�?�?�&�?�?�?�?�?�?�?�?@Q8@
@@@ @(@0@7@?@E@M@U@[@c@i@n@t@{@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@��@�@�@A
AAAAA"A!'A,A1A6A;A?ADAIANASAYA_A�5dAjAoAtAyA_(~A�A�A�A�A�A�A�A�A�A�A�ABB+B6BABLB�
WBbBmB~B�B�B�Bd(�B�Bt	�B�B�B�B�B�B�B�B�B�B�B�B�B�BCCCC"C)C/C7C<CBCHCMC�4TC]CcChCpCyC�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�CDDD"D)D2D;DDDLDVD]DbD$iDnDrDyD(A}D�D�D�D�D�D�D�D�D�D-A�D�D�D2A�D7A�D�D�D�D�D�D�D�D�DEEE E)E2E6E9E?EGEMEREVE[E`EeEjEoEtEryE{E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�EFF
FFFF"F(F.F2F9F?FDFJFRFZFaFgFlFrFxF�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F	GG"G(G-G4G:G@GKGWGcGmGvG~G�G�G�G�G�G�GEA�G�GJA�A�G�G�G�G�A�GHHH6/*H7HJHUH`HkH�
xH|H�H�H�H�H�H�H�H�H�H�H�H�H�H�HIIII'I1I6I=IBIIITI^IdIiInIOArIxI~I�I�I�I�ITAZA�I`A�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�'�I�I�IJ	JJJJJ!J'J-J2J8J=JBJFJLJQJUJZJ_JkJpJvJ{J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�JKK
KKK$K)K0K6K?KIKSKaKoK}K�K�K�K�K�K�K�K�K�K�K�K�KLLLLLL"L'L+L2L7L;LFLLLQLVL]LbLfL�kLqLxLeA~L�L�L�L�L�L�L�L�L�L�L^;�L�L�L�L�L�L�L�L�L�L�L�LM
MMMM#M)M.M3M9M>MDMIMOMUM\MbMgMlM�(uMxM�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�MN	N
NN!N(N/N7N>NENJNONUNZNbNhNnNuN{N�N�N�N�N�N�N�NQ8!��N�N�N�N�N�N�N�N�N�NpA�N�N�N�N�N�NOOOO&O-O�;�;4O>OMOSOZOaOhOnOtOO�O�O�O�O�OuA�O�O�O�O�O�O�O�O�O�OPPP#P/P9PCPNPUPZPaPmPyP�P�P�P�P�P�P�P�P�P�P�PQQ Q,Q8QDQPQ\QgQsQQ�Q�Q�Q�Q�Q�Q�Q�Q�Q�QRRR&R2R>RJRVRbRmRyR�R�R�R�R�R�R�R�R�R�R�RSS S,S8SDSPS\ShSsSS�S�S�S�S�S�S�S�S�S�STTT&T3T@TMTZTgTtT�T�T�T�T�T�T�T�T�T�TUUU(U5UBUOU\UiUvU�U�U�U�U�U�U�U�U�U�UVVV+V7VDVQV^VkVxV�V�V�V�V�V�V�V�V�V�VWW W-W:WGWSW^WkWxW�W�W�W�W�W�W�W�W�W�WXX X-X:XGXTXaXnXzX�X�X�X�X�X�X�X�X�X�XYY"Y/Y<YIYVYcYpY}Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�YZZ$Z1Z>ZKZXZeZrZZ�Z�Z�Z�Z�Z�Z�Z�Z�Z[
[['[4[@[M[Z[g[t[�[�[�[�[�[�[�[�[�[�[\\\)\6\C\P\\\i\v\�\�\�\�\�\�\�\�\�\�\�\]]]]]%]+]3]8]>]C]G]P]�'[]a]h]p]w]�1�1~]�]�]�]�]�]�]�]H!N!T!�]�]�]�]�]�]�]�]�]�]�]�]�]^^^^^)^0^6^>^D^K^Q^[^d^h^o^s^x^~^�^�^�^A�^�^�^�^�^�^�^�A�^�^�^�^�^�^_�&
____!_%_)_�*._6_=_F_N_U_\_e_k_�r_x_|_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_`+"```!`&`.`2`9`B`G`�BO`S`_`d`h`k`q`w`}`�`�`�`�`�`�`�(�`�`�`�`�`�`�`�`�`�(�`�`�`�`�`�`�`�`�`�`a	aaaaa#a(a-a2a7a<aBaHaMaRaWa\aaafakapaua{a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a��a�a�abb	bd;*	
bbbbb$b(b.b3b7b;bCbGbKbRbWb\b`bfbkbobtbyb}b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�)�b�b�b�b�b�b�bcc
c!cccc�$c)c.c4c9c
?>cCcHcMcScXc]ccchclcqcvc{c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�cmc�rc�c�c�c	+�c�c�cdd"d*dwc1d6d>d|cCdHdPdUdZd^d�ccdkdpdtd{d�d�d�d�d�d�d�d�d�d�d�d�d�d�&�d�d�d�d�d�d���d�d�d�d�d�dee
eeeeee&e.e4e:e?eDeJeNeSeZe�>�>`eleoeveze�J�e�e�e�e�e�e�e�e�e�e�e�efff&f>fPfcfpf~f�f�f�f�f�f�f�fgg$g2g@gLg]gpg�g�g�g�gB�g�g�gU/�g�g�g�gh
hhhh h$h)h.h3h8h=hBh�	GhMhQhTh_hchfhnhth8xh�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�hi
iii!i,i7iAiRib\i`ijiri|i�i�i�i�i�i�i�i�i�i�c�i�i�i�i�i�i�i�i�i�ijjjj%j+j/j�c�c3j=jGjQjYj`jjjrjzj�j�j�j�BW�j�j�j�j�j�j�j�j�j�j�jkkk k(k0k:kBkJkPkUkZk_k�dkgkkkpkvk{kk�+�c�c�k�k�k�k�k�k�k�k�k�k��k�k�k�k�k,�k�k�k�k�kl,,lll l%l�c+l6l:l?lw
DlOlUlZl^lblelllslyl�l�l�l�l�l�l�l�l�l�l�l��l�l�l�l�l�l�l�l�l�l�l�l�l�lmmmmmm m&m+m0m5m:m?mDmImOmUmZm`memjmpmtmxm|m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�mnn	n
nn#n/n8nAnFnLnQnUnYncnlntnznn�n�n�n�n�n�0�n�n�n�n�n�n�n�n�n�n�n�n�n�n�nooooooooo#o'o+o/o3o8o=oBoFoIoNoToYo_odohonorovo{oo�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o���opp
ppppf�p!p%p)p.p2p�B6p;p@pDpGpLpPpUpYp�B^papdpjpnpspwp�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�pqqqqq#q(q.q1q6q;qBqFqJqMqSq�!.	Wq\qlq�)�q�q�q�q�q�q�q�q�q�q�q�q�q�q�qrrr!r+r6rArKrTr[rdrlrsrzr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rtisss%s-s5s<sHsQsZsbsjsrsyss�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�st0Ctttt t8C't*t6t>tDtItMtXtbtlt�+ut~t�t�t�t�t�t�t�tCC�t�t�t*�t�t�t�t�t�t�t�t�t�t�tuu�!uu"u(u-u3u9uAuGuKuNuPu�s�+Yu^udunusuzu�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u(�u�u�u�u�uvvvvv#v(v2v;v?vFvNvUv[v`vhvovtv{v�v�v�v;�v�v�v�v�p�v�v�v�v�vbb�s�v�v�v�f�v�vww(w9wKw�f\wpw�f|w�w�G�wg�w�wb/�w�w�w�w�w�w�w�w�w�w�w�wx�-x
xxxx�u$x+xS4]42x9xCxHxLxOxUx]xixsx�x�x�x�G�x�x�x�x�x�x�x�x�x�x�x�x�x�xyyy�i�
yyyy&y+y0y@yHyPy)Xy]yaygylyryuy{y�y�y�y�y�y�y�y�y�y�y�y�y�y�yzzz"z-z�!4z;zAzFzLzSz^zhzrz{z�z�z�z�z�z�z�z�z�F�z�z�z�z�z�z�z�z�z�z�z�z{{{{({0{�C5{={B{J{P{V{L4%[{_{c{f{i{o{w{{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{||(|.|5|<|B|J|P|U|`|r|y|�|�|�|�|�|�|�|�|�|�|�|�|�|�|}�)}}'}3}=}F}P}U}Y}a}l}v}|}�}�}�}�}�}�}�}�}�}�}�}�
�}�}�}�}~~~'~/~7~@~E~P~U~^~d~o~s~v~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~(/5?HNY]dhou�?{���������������i���������	�����n�$�+�4�^	;�@�D�J���O�7S�\�d�m�u�|�������������m,����ÀȀC�΀Ԁڀ>߀����������`���F"�,�4�:�D�M�U�[�`�h�o�o2u�|���������e����������Áʁԁ݁������	���!�4��9�>�F�3J�O�S�W�doa�e�j�n�t��z�������������Ƃ˂4yтق�����,0����tv�ej
�����(� �&�*�.�-1�5�E8�=�D�J�	"O�W�^�d�`dh�l�p�t�z)Lx�}���������������������ʃ҃׃ۃ���������	�o��� �&�+�0�5�:�?�D�I�N�S�X�]�b�g�l�r�x�~�������������������������ÄȄ̈́ӄ؄ބ����������
����!�&�+�0�6�<�B�G�L�Q�V�\�b�h�n�t�z���������������	���	�	F���	�	���	�	�	������Åȅͅхօ܅������������
����#�(�,�1�7�;�@�E�J�O�S�V�[�`�e�j�o�u�{�����������������������������ÆdžˆІ؆݆���������
���� �$�)�-�0�5�!O:�?�D�I�Q�Q_�'V�[�_�d�h�l�q�u�x�{����������������������������‡ɇЇԇׇ݇��������	�
����"�(�-�2�6�=�C�I�O�U�\�b�h�n�t�z�����������������������ĈʈЈֈۈ��3�����������
����#�)�2�8�=�B�G�K�P�T�Y�^�c�h�o�v�|������J�����������������*��‰lj͉҉׉ۉ�����������������#�(�-�2�6�;�?�D�H�L�P��EU�\�e�k�q�z�������������������������ʊҊ��������d�d�����"�.�2�9�@�G�L�P�X�]�b�g�l�P_q�v�z��������������������������Ƌ����ʋϋՋڋ�������.��������X���������!�'�-�3�9�?�E�K�Q�W�]�c�j�p�v�|���������������������������ŌɌΌԌٌߌ����������	�����!�&�,�2�8�>�C�G�J�P�V�_�g�n�s�w�{����D�������
����;"������D"������ƍύ׍���������������$�.�8�B�H�M�W�\�i�w�������������͎FBێ�����������
������y�#�ˋ(�+�0�5�:�@�F�-I&-K�Q�X��G^�c�h�l�q�v�Ћ{�������֋����������������ďˏҏُ��������ۋ�����"�*�2�8�?�E�L�S�Y�a�k�r�x�}���������������������ŐʐАِ��}���������n8����"�'�,�3�8�=�B��	_H�
�K�N�R�V�`�h�o�s�w�z��������u��������������đȑ̑ϑՑܑ���������
���w-~-�-�-�-�-B�!�&�+�1�6�;��@�C�H�M�R�W�\�c�heh�m�r�w�|���������������������������ƒ˒Вݒ��c{L����������
�����#�(�,�1�6�;�?�D�I�N�T�Z�_�c�g�l�q�v�z���������������K����������Ǔԓ����Y���ב�����} �%�)�`~�d.�2�7���t_;�@�F�K�O�S�V�Z�`�i�t�����������������������������U��”ǔ̔є֔ܔ�������������� �%�*�0�5�:�?�D�I�N�S�Y�_�d�i�n�s�x�}�������������������������Õ͕ӕK	ؕܕ�����@��������
������#�(�,�7�:�<�@�L�X�a�e�o�s�y�~�������������������������Ɩ�s�sʖϖԖٖ�����"������#�,�4�?�H�M�T�^��h�m�r�v�y�~������������������������&����ɗ̗ϗї՗ۗߗ����	��-�6�>�C�H��N�T�Y�c�l�t�y��������������������ǘϘ֘��������
�����(�.�3�;�E�N�W�`�k�s�~�������������������ÙǙϙՙ�������"�-�9�E�Q�]�i�u�����������������������ÚȚ͚��ȕ�	ҚԚٚޚ����������+�������"�/�iu5�>�G�PN�W�4�_�d�h�q�y���������������������������ěɛ֛�Rg���� �.�cgvg:�F��
T�Y�^�c�g�n�z���������������������ÜȜ͜Ҝ��לۜߜ����������
���� �$�'�-�2�7�<�@�E�K�S��vX�]�d�j�p�u�}�qe��������������������������ǝ̝ҝ
�֝ڝߝ����������$�*�.�7�?�F�K�P��.U�_�f�l�v�{�����T��������Z��������ŞΞҞ�՞ܞ�������	�����#��t)�0�6�>�G�N�T�_��je�o�t�x�����������z*f������������������ş̟_�ҟן۟�������������"�'�.�6�>�C��_G�J�N�R��0�V�[�c�h�l�u�|���������p=��������������ɠt<Ϡؠߠ������	����&�-�4�;�B�G�N�T�e�m�w�������������D�������������_ǡ͡ӡݡ���������ek�!�)�.�2�9�A�H�O�U�^�h�n�v���������b������������̢Тڢ�������
��"�)�.�5�y=�C�H�O�U�[�`�m�z�����������������������ţʣϣuԣأܣ������������������ �$�(�,�0�4�8�<�@�D�H�L�P�T�X�\�`�d�h�l�p�t�x�|�����������������������������������ĤȤ̤ФԤؤܤ������������������ �$�(�,�0�4�8�<�@�D�H�L�P�T�X�\�`�d�h�l�p�t�x�|�����������������������������������ĥȥ̥Хԥإܥ������������������ �$�(�,�0�4�8�=�A�F�J�O�S�X�\�b�g�k�p�t�y�}�����������������������������ŦʦΦӦצܦ�����������
�����"�(�-�1�6�:�?�C�H�L�Q�U�[�`�d�j�o�s�y�~�������������������������ħɧͧҧ֧ܧ�����������	�����!�&�*�/�3�9�?�D�?H�J�N�R�V�[�_�c�h�#*m�s��y�|�������������.������;��F����������èʨ�uШӨרܨ�����������
������8�� �$�(�0�7�;�B<B�G�U�\�g�il�p�v�������������������������©ȩͩѩ֩کީ�����
��(�8�J��-X�_�c�f�o�t�x����H����������������ͪ�����=+.��e����<+
���� �&�+�1�6�<�B�H�M�!�'�Q�,�2�7�V�=�C��"�\�d�h�k�r�v�{�����������_C���t����������g}��;'���(«ɫϫӫ+6ګ������h�|"�����!�,�2�7�<�A�E�J�Q�"�U�_�h�s�y�������������������������1	Zq.*./.5.Ǭ:.?.E.̬֬ڬJ.߬AM����������	�
����-�"�(�2��;�@�F�J�R�V�`�f�k�v������������������ƭ̭ҭحݭ������������"�+�4�?�L�X�c�l�w�|�����O.�����������u����������L��ĮǮ!~ˮq�Ӯ׮ۮޮ���������
�~��~��"�*�0�6�;�?���E�H�P�X�)^�b�f�k�r�x�}��������������������������E��ɯѯٯ�����������'�/�7�?�G�O�W�^�f�n�v�~�����������������ưΰְް����������$�,�4�<�D�L�W��b\�_�f�j�p�t�z����������������������Ʊ̱ұر۱����BL��������R�X��^�k�q�w�	�}������$�(�,�4���8�<�C�H�L�Q�W�\�b�g�k�o�s�x�|������������������������������F�FòDzʲвԲز�^ݲ������a��������� �%�)�.�2�7��<B�F�I�M�R�V�[�`�d�h�l�o�s�v�{������������ �<����������������óȳγԳڳ߳�������!��}(�,�1�6�:�>��D�I�M�T�Y�^�b�e�i�o�7ys�`x����������������������´˴*Ӵ״ߴ�����������	�
����#�'�-�2�7��v��<�E�M�S�_�l�z������������������������ ����µǵ˵ϵҵֵ��g������g-��
<�B�F�P�T�X�]�a�h�m�q�x�~���������������������ɶ�H�ζ�F۶����������
�����!�&�+�0�5�:�?�D�I�N�!�FS�W�]�f�k�t�{�d������������������������
����ŷȷͷҷطݷ�������������� �%�)�.��3�6�=�C�L��&��T�X�\�ԏd�o�w�8�~������������(`�����->��~��ø͸ָݸ������������"�'�+�2�7�=�D�J�õO�S�W>`>i>r>{>�>l�>Y�^�a�g�o�#t�x�}���������������������������˹ѹ3~�����������$�,�2�6�;�C�p���I�\�<Hj�z�����������������������ºǺ˺�Һ׺ܺ�z�����������
��|~����"�&�+�0�4�9�=�A�E��^�^J�O�U�Z�`�f�yk�o�r�x�}�������������������;_kI��������ŻʻϻԻ�D����������ƌٻʌݻ��όՌ��������
����&�,�2�8���E�N�T��X��]�
��`�e�i�o�w=v��=}����������������������������ļɼͼҼ׼ܼ����������
�����"��� �$�0�'�-�3�?�6�u:�?�C�H�O�T�Y�^�b�f�p�u�z�~���������o���������������ĽȽ̽Խڽ���������	������6�(�0�7�<�C�H��(�
j.O�n(T�W�`��e�n�l�u�z�~���;eG
��^0����C	M	������ľ�
�ɾ��hL�;վܾ�����k���.�������$�/�4�A�N�Z�f�r�}�������������ƿҿݿ���������$�1�6�@�E�K�P�ЫT���[�b�j�q�
x�����������������������������'�,�1�6�d/>�F�Q�\��Jf�j�q�w�|������������L�L������������>������G%
��	���`?��!��
�
/�;�G��
�
�
�
U�a�o�����/t�y�~�������������������	��'�6�E�T�c�r���������������������&�5�D�S�b�q���������������������%�4�C�R�a�p��������������������$�3�B�Q�`�o�~�������������������#�2�A�P�_�n�}�������������������"�1�@�O�^�m�|�������������������!�0�?�N�]�l�{������������������� �/�>�M�\�k�z��������������������.�=�L�[�j�y��������������������-�<�K�Z�i�x���������������������,�;�J�Y�h�w�������������������
��+�:�I�X�g�v���������������������*�9�H�W�f�u���������������������)�8�G�V�e�t�������������������
��(�7�F�U�d�s�������������������	��'�6�E�T�c�r���������������������&�5�D�S�b�q���������������������%�4�C�R�a�p��������������������$�3�B�Q�`�o�~�������������������#�2�A�P�_�n�}�������������������"�1�@�O�^�m�|�������������������!�0�?�N�]�l�{������������������� �/�>�M�\�k�z��������������������.�=�L�[�j�y��������������������-�<�K�Z�i�x���������������������,�;�J�Y�h�w�������������������
��+�:�I�X�g�v���������������������*�9�H�W�f�u���������������������)�8�G�V�e�t�������������������
��(�7�F�U�d�s�������������������	��)�9�I�Y�i�y�����������������	��)�9�I�Y�i�y�����������������	��)�9�I�Y�i�y�����������������	��)�9�I�Y�i�y�����������������	��)�9�I�Y�i�y�����������������	��)�9�I�Y�i�y�����������������	��)�9�I�Y�i�y�����������������	��)�9�I�Y�i�y�����������������	��)�9�I�Y�i�y�����������������	��)�9�I�Y�i�y�����������������	��)�9�I�Y�i�y�����������������	��)�9�I�Y�i�y�����������������	��)�9�I�Y�i�y�����������������	��)�9�I�Y�i�y�����������������	��)�9�I�Y�i�y�����������������	��)�9�I�Y�i�y�����������������	��)�9�I�Y�i�y�����������������	��)�9�I�Y�i�y�����������������	��)�9�I�Y�i�y�����������������	��)�9�I�Y�i�y�����������������	��)�9�I�Y�i�y��������������	��)�9�I�Y�i�y��������������	��)�9�I�Y�i�y��������������	��)�9�I�Y�i�y��������������	��)�9�I�Y�i�y��������������	��)�9�I�Y�i�y��������������	��)�9�I�Y�i�y��������������	��)�9�I�Y�i�y��������������	��)�9�I�Y�i�y��������������	��)�9�I�Y�i�y��������������	��)�9�I�Y�i�y��������������	)9IYiy��������	)9IYiy��������	)9IYiy���������B
%-�CiF",:��BC{�HMRW\bgmrx}���������������K
���$����NSX]A���
%0#0;HOU].diou{��������������������50@0E0����RJ�[J���	c0!(,06;C�@GNSW[dinsx|�J������Jm���������������R1X1���.?Par��������->O`q��������
,=N_p��������			+	6	@	E	"I	N	T	Y	^	e	�('k	t	�|y	�	c1�	�	�	�	�	�	�	,#L�	�	m1�	�	�	�	�	�	�	�	1�	�	�	�	�	





"
(
.
3
7
<
A
E
J
O
T
Y
]
b
h
m
r
v
{
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
2��
�
�

!&+17<@EJNSX]cinrw|��������������]|�������1��	2$0<HTYeiouz��������B�H��ɷ�����L�����F$2*2K����



P
$
/M(
-
4
:
>
K
Q
\
f
m
EM((��t
Uy
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
.�
u�~�mM$)Z^.25@EhMRW�Mcflrwm���������r�w�_����M����� )3<GQ[dn|���������;K��2�����I&-49A�2�2IOS��KN!�[afnu�6z����������������]�����������

,�oh %),049=BFL���OV\d��n�4�;�A��G�sx|U�����������������L������$T�������=�"+16@MY`en{g������L����mzb������_��m����
"(w�-ы16=BFKSpMZ_c��gmJw~�����1<��������������������

���#)059�L<@ELRV[�aelpu{����������������������	
#(-283�=CIOy�TY^��chmsy��~����Ɛ��ː��}����5����������/�������i",47��<CHLPUY^chA�F�lT�qY�v|e�k�q���re�����������������Ir�̐fi#)/49=CI3�N����9�>�RVZ]jptw|����X_�
U'�����������������������
#(-38=BGLQW\afkpuz����������������������p��������<")3E<EINSW[�oo_eeOirz��������������������G!*2>IT]ajr|������������<��-v7v�����
#(-150O=AGQX^d��hjmsw�����A<������+���������!V`+1:@FMT[binrvy���&����i�����������")5=HOU_eir{�������������������8����@#)18<@GMU\bmquy|����������<l�������������!*.5`�9?GKQY_dow}�f������1��;���ȝ�����������        % * / 4 9 ? D J O T Y ^ c h n s x } � � � � � � � � � � � � � � � � � � � � � � � � � !!!!!&!�!"!'!+!.!�
3!8!<!E!P!a!s!{!��!�!�!�!�!�!�!�!�!�!�!�!�!�!"""""""-"4"@"K"V"_"f"�p"l
t"y"�"�f"5]�"�"�"�"�"�"�"�"�"�"�"�$CE�"�"�"A&�"�"�"�"�12��####s	Yy"#(#Mhy.#c�34#;#;?#C#I#N#S#���X#d#h#l#r#w#�|{#�3.�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#$
$�i�$$$$!$EK�$�%$)$2$:$E$M$U$[$`$k$v$~$�$�$�*�$�$�$�$�$�$�$k~�D�$�$�$�$;H+�$�$�$�$%%%�G%"%*%)
2%7%B%I%W%@�a%h%l%p%x%�%�%@M�%�%�%�%�%�%�%�%�%�%�%�%�t�%�%&
&&s4�&�(&r!&(&.&9&C&K&R&&Y&b&j&�w&�{&�&�&�&�&�&w�&�&�&�&|%|�&�&�&�&�&�&�&��&�C�CS��&�;�&�&�&�i�&''''�C�'''-'5'��='?'D'I'N'T'Y'^'c'h'm'r'x'}'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'(	((((("(�$�$/49>((.(3(8(=(C(H(L(P(U([(_(e(j(o(u(z(~(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�("��('��(�(,��(�(2��(7��(�(�4�())<�)).�)) )@#&))).)3)7)�A�:)>)A)L)Q)U)[)c)p)t)|)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)D��)�)�)�)
***!*%*.*4*;*H*T*_*k*r*{*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*+
+++%+-+6+@+I+Q+Z+d+m+w+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+,,,%,-,6,@,I,S,^,h,q,{,�,�,�,�,�,�,�,�,�,�,�,�,�,-	---$---7-B-L-U-]-f-p-y-�-�-�-�-�-�-�-�-�-�-�-�-�-...#...8.A.K.V.`.k.w.�.�.�.�.�.�.�.�.�.�.�.�.///'/2/</E/M/T/\/e/m/v/�/�/�/�/�/�/�/�/�/�/�/�/�/�/000!0+060@0K0W0b0l0u0}0�0�0�0�0�0�0�0�0�0�0�0�01111*141?1K1V1`1k1w1�1�1�1�1�1�1�1�1�1�1�1�1�1222&202;2G2R2\2e2o2z2�2�2�2�2�2�2�2�2�2�2�23333*343?3K3V3`3k3w3�3�3�3�3�3�3�3�3�3�3�3444'434@4N4[4g4r4|4�4�4�4�4�4�"�4�4N��4�4S��4�]zt�4�4�4�4�4�4�4�4�4�4�4�455555%515<5@5�l"E5H5K5M5Q5U5Y5_5d5�ti5m5p5u5y5�5�5�5��5�5i��5�5�5�5�5�5�5�5�5�5�5�5�5n��5666'60686C6H6P6F
U6R�b6f6r6z66�6�6
P�6�6�6�6�6x��6)�6�6�6�6�6�67777!7z��%7)71787A7I7O7X7`7g7o7s7|7�7�7�7�7�7}��7�7�7�7���7�7�7�7�7���7�78	888$8-8%�68A8P8Z8�(�`c8h8m8q8�Iv8{8�8�8�8�8�8�8y`�8�8�8�8�8�8�8�8�8��8�8�8�8���8�89
9999$9+91989C9M9W9c9i9q9w9�9�9���9�9�9�9�9�9�9�9�9�9�9�9�9�9�9:::!:(:��hk.:3:7:;:@:H:N:Y:f:k:r:��w:�:�:�:�:�:�:�:�:�:�:�:�:�:��:�:�:�:;;
;;;;;$;);.;`3;8;=;B;H;N;S;W;\;�Ia;g;l;r;w;|;�;�;�;�;�;�;�;�;�;�;�;�;�;cxN��;�;�;�;�;�;R��;�;�;�;���;�;�;<�’<<<<<"<)<.<8<A<E<K<Q<W<[<c<j<r<z<ǒ�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<̒�<Ki�<�<�<=
==n_2{==!=%=1=�;�;5`;=@=G=M=T=Z=e=j=r=�'w=z=�=�=�=�=�=�=��d��<�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=>>
>>>>>%>*>/>5>;>A>G>M>S>Y>_>e>j>o>u>z>>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>??
?????#?(?-?2?7?<?A?F?K?P?U?[?`?e?j?o?t?y?~?���?�?�?�?�?�?�?�?�?�?�?�?�?lv�?�?�?�?�?�?�?�]�?�?W�?@@@@@"@)@0@6@<@A@H@M@U@�"\@a@sh@m@q@x@~@�@��4�@�@�@�@�@�@�@�@�@�@�@�@]��@�@�@�@�@�@AAA(A3A<ABAKASA]AjArAyA�A�A�A�A�A�A�A�A�A�A�A�Ay:�A�A�A�A��A�ABBBBBB B&B.B:BFBMBRBVBaBiBpB|B�B�B�B�B�B�B�B�B�B�B�B�B���B�B�B�B�B�BCCCC%C1C=CFCX6MCWCcCnC|C�C�C�C�C�C�C�C�C�C�C�C�C�CDDDD-D5D?DHDPD]DlDvDD�D�D�D�D�D�D�D�D�DEEE*E8EFETEbEpE~E�E�E�E�E�E�E�E�E�E
FF&F4FBFPF^FlFzF�F�F�F�F�F�F�F�F�FGG"G0G>GLGZGhGvG�G�G�G�G�G�G�G�G�GHHH,H:HHHVHdHrH�H�H�H�H�H�H�H�H�H�HII(I6IDIRI`InI|I�I�I�I�I�I�I�I�I�IJJ$J2J@JNJ\JjJxJ�J�J�J�J�J�J�J�J�JKK K.K<KJKXKfKtK�K�K�K�K�K�K�K�K�KLLL*L8LFLTLbLpL~L�L�L�L�L�L�L�L�L�L
MM&M4MBMPM^MlMzM�M�M�M�M�M�M�M�M�MNN"N0N>NLNZNhNvN�N�N�N�N�N�N�N�N�NOOO,O:OHOVOdOrO�O�O�O�O�O�O�O�O�O�OPP(P6PDPRP`PnP|P�P�P�P�P�P�P�P�P�PQQ$Q2Q@QNQ\QjQxQ�Q�Q�Q�Q�Q�Q�Q�Q�QRR R.R<RJRXRfRtR�R�R�R�R�R�R�R�R�RSSS*S8SFSTSbSpS~S�S�S�S�S�S�S�S�S�S
TT&T4TBTPT^TlTzT�T�T�T�T�T�T�T�T�TUU"U0U>ULUZUhUvU�U�U�U�U�U�U�U�U�UVVV,V:VHVVVdVrV�V�V�V�V�V�V�V�V�V�VWW(W6WDWRW`WnW|W�W�W�W�W�W�W�W�W�WXX$X2X@XNX\XjXxX�X�X�X�X�X�X�X�X�XYY Y.Y<YJYXYfYtY�Y�Y�Y�Y�Y�Y�Y�Y�YZZZ*Z8ZFZTZbZpZ~Z�Z�Z�Z�Z�Z�Z�Z�Z�Z
[[&[4[B[P[^[l[z[�[�[�[�[�[�[�[�[�[\\"\0\>\L\Z\h\v\�\�\�\�\�\�\�\�\�\]]],]:]H]V]d]r]�]�]�]�]�]�]�]�]�]�]^^(^6^D^R^`^n^|^�^�^�^�^�^�^�^�^�^__$_2_@_N_\_j_x_�_�_�_�_�_�_�_�_�_`` `.`<`J`X`f`t`�`�`�`�`�`�`�`�`�`aaa*a8aFaTabapa~a�a�a�a�a�a�a�a�a�a
bb&b4bBbPb^blbzb�b�b�b�b�b�b�b�b�bcc"c0c>cLcZchcvc�c�c�c�c�c�c�c�c�cddd,d:dHdVdddrd�d�d�d�d�d�d�d�d�d�dee(e6eDeRe`ene|e�e�e�e�e�e�e�e�e�eff$f2f@fNf\fjfxf�f�f�f�f�f�f�f�f�fgg g.g<gJgXgfgtg�g�g�g�g�g�g�g�g�ghhh*h8hFhThbhph~h�h�h�h�h�h�h�h�h�h
ii&i4iBiPi^ilizi�i�i�i�i�i�i�i�i�ijj"j0j>jLjZjhjvj�j�j�j�j�j�j�j�j�jkkk,k:kHkVkdkrk�k�k�k�k�k�k�k�k�k�kll(l6lDlRl`lnl|l�l�l�l�l�l�l�l�l�lmm$m2m@mNm\mjmxm�m�m�m�m�m�m�m�m�m�m
nnn*n2n:n@nJnRnXn��]ncnlnxn}n�n�*P�n�n�n�n�n�n�n�n�n�n�n�n�6�n�n�n�n�n�no
oooo"o(o-o5o�$%;oBoLo�/SoXo��aofomowoo�o�o�o�o�o�o�o�o�o�o��o�o�o�o�o�o�o�o�op	pp�?p p(p,p2p=pGp'PRp[pcpkprp�v%zp~p�p�p�p�z�p�p�p�p�p�/�p�p�p�p^�p�p�p�p�p$�p^�p�pq
qqqq q&q+q1q5qCqKqSqYq^qeqoqxq}q�q�q�q�q�q�q�q�q�	�q�q�q�q�qrrrr&r,r3r8r>rDrLrRrWr\rlr�/zr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rJ��r�r�r+5�rsssss"s)s/s654s7s<s�FsOsTsZs_sgsnsys�s�s�s�s�s�s�s�s	tt)t9tItYtityt�t�t�t�t�t�t�t�t	uu)u9uIuYuiuyu�u�u�u�u�u�u�u�u	vv)v9vIvYvivyv�v�v�v�v�v�v�v�v	ww)w9wIwYwiwyw�w�w�w�w�w�w�w�w	xx)x9xIxYxixyx�x�x�x�x�x�x�x�x	yy)y9yIyYyiyyy�y�y�y�y�y�y�y�y	zz)z9zIzYzizyz�z�z�z�z�z�z�z�z	{{){9{I{Y{i{y{�{�{�{�{�{�{�{�{	||)|9|I|Y|i|y|�|�|�|�|�|�|�|�|	}})}9}I}Y}i}y}�}�}�}�}�}�}�}�}	~~)~9~I~Y~i~y~�~�~�~�~�~�~�~�~	)9IYiy��������	��)�9�I�Y�i�y���������ɀـ���	��)�9�I�Y�i�y���������Ɂف���	��)�9�I�Y�i�y���������ɂق���	��)�9�I�Y�i�y���������Ƀك���	��)�9�I�Y�i�y���������Ʉل���	��)�9�I�Y�i�y���������Ʌم���	��)�9�I�Y�i�y���������Ɇن���	��)�9�I�Y�i�y���������ɇه���	��)�9�I�Y�i�y���������Ɉو���	��)�9�I�Y�i�y���������ɉى���	��)�9�I�Y�i�y���������Ɋي���	��)�9�I�Y�i�y���������ɋً���	��)�9�C�H�P�X"U�[�`�g�p�x�|�����������MC����������������Ìnj܌���&�/�9�A�H�O�U�0zc�g�m�u�����������������������Íȍ'B�΍ҍ֍ڍߍ������������ �&�+�/�4�8�=�Q�A�F�N�R�W�^�g�m�v�z���������������������Žʎӎ׎ߎ���������
������'�1�7�<�F�9�N�Z�`�g�m�q�v�|�����������������Ǐe^ˏӏُ������������!�&�NK,�0�4�8�@�I�M�T�]�e�r�x�9�2�}����������������������������ŐːАՐڐߐ���������
��� �P6%�*��.�������2���bH�L�P�U�Y��]�e�l�r�|������������2*���>b������C��$������s�s����ƑˑБ֑ۑ���������� �)�1�6�>�B�J�N�U�]�`�:�d�j�o�t��6Sy�~�������������������ǒ͒Ғؒܒ=P�t������
�S�%��$�-�4�:�B�H�Q�X���^�a�e�i�m�-s�z���������l������������̓ӓٓ��2�������7����$�*�3���G�;�@�E�I�N�R�Z�_��C�Fc�h�<�wDl�q�u�|��������������"��������”˔ה�\���K@��������l��s���'�-�2�:�@�E�J�J�S�\���e�l�r�x�������������O���U�j������ƕϕוޕ�`�����������
����'�,��0�7�;�D�L�T�[�`�e�}i�l�r�z���������������������f���������Ŗ̖іՖαݖ�s�s������������ �&�*�2�7�l��@;�C�I�P�U�\�a�e�j��p�v�^'{���������������������������—Ɨ˗З՗ٗ�lޗ�����������
���� �%�P�)�h�1�5�=�E�P�U�Y��d�6^�d�i��s�z��������������������^#��ǘΘ٘ߘ�r��������|�����&�#�*�1�:�A�G�U�]�uo�c�h�n�r�u�}���������������������ƙ˙Ιיޙ����������*�2�=�B�F�K�O�?�W��_H�\��}�}�}�}�}a�~~$~4~�~�~e��~�~i�m�q�u���y��}�������ĀԀ���$�������āԁ����$�4�����ĂԂ����$�4���4�������$�4�����ċ������$�4�������������������Ěɚ͚Қךۚ�����������
������#�'�+�/�3�7�;�?�D�I�N�S�X�]�b�g�l�q�u�y�}�������������������������������›ƛʛΛқ֛ڛޛ�����������������!�%�)�.�2�7�;�?�C�G�K�O�S�W�[�_�c�h�l�p�t�x�|���������������������������������Üǜ˜МԜٜݜ������������������"���Fib{s&��*�$/��3�7��;�C�J�Q�_��{h�p�w���������������ǝ̝ӝߝ��|5�����
�����"�(�-�6�>�J�T��;a�e�k�y���������������ƞўٞ�����������ʠ#��;'�.��&7�=�� �F��
M�Q�W�b�h�m�t�z�����������������ȟΟ؟������������#�)�1�:�B�H�Q���_�d�j��Bo�|���������������������ɠҠڠ�B�����������!�,��0�4�:�G�S�]�f�r��v}���������������ɡѡS3ءܡߡ����������5�
���'�/�?�J�S�[�g�r�����������Ģˢ�آݢ�~�����#�	����"�+�3�8�A�H� +)+N�Y�_�d�j�
p��v�}��������W����������ţˣԣܣ�������!���#�.�:�E�O�X��_]�c�h�r�|����~�������_��.������������Ĥʤ�~ϤԤ5٤ޤ����������R�9�� !�.�3�;�@�F�;3K�S�Z�_�d�m����u�y�}~�������.������Q������������ȥeҥ٥ ߥ������� ��
$�0�5�9�?�j~�C�N�R�V�\�`�i�m�x�|�	i���������������(��������ȦϦզ�-C٦������
��P,�;#�0�7�E�L�\�c�i�`v8p�w�����O�������������������Ƨͧԧڧ���������
����"�(�.�4�:�@�F�L�R�X�^�d�j�p�v�|�����������������������ĨʨШ֨ܨ��������
���!�'�.�5�;�A�G�M�S�Y�_�e�k�q�w�}���������(��������������s��^�6>�����ǩͩө٩ߩ��������	����!�'�-�3�9�?�E�K�Q�W�]�d�k�q�w�}����������������������������ŪɪͪѪժ٪ݪ����������	�
�����"�'�,�1�6�;�@�E�J�O�T�Y�^�c�h�m�r�w�|���������������������������«ǫ̫ѫ֫۫�����������
����!�&�+�0�5�:�?�D�I�N�S�X�]�b�g�l�q�v�{�����������������������������ƬˬЬլڬ߬�������������� �%�*�/�4�9�>�C�H�M�R�W�\�a�f�k�p�u�z����������������������������ŭʭϭԭ٭ޭ���������������$�)�.�3�8�=�B�G�L�Q�V�[�`�e�j�o�t�y�~���������������������������ƮˮЮծڮ߮�������������� �%�*�/�4�9�>�C�H�M�R�W�\�a�f�o�t�}�������������������ïȯѯ֯ۯ��������
��� �)�.�7�<�E�J�S�X�a�f�o�t�y�~���������������������������İɰϰӰذް�������������� �%�+�0�5�:�?�E�J�O�T�Y�^�d�i�n�s�x�}���������������������������ñȱͱұױݱ���������	�����$�)�.�3�8�=�B�G�L�Q�V�[�`�e�j�o�t�z���������������������������ŲʲϲԲٲaI޲����������
����"�'�,�1�6�;�@�E�J�O�T�Y�^�c�h�m�r�w�|���������������������������óȳͳҳ׳ܳ�����������	�����"�'�,�1�6�;�@�E�J�O�T�Y�^�d�i�n�s�x�}���������������������������Ŵʴдմڴ����������
��7���#�(�-�2�7�<�A�F�K�P�U�Z�_�d�i�n�s�x�}���������������������������õȵ͵ҵ׵ܵ�����������	�����"�'�,�1�6�;�@�E�J�O�T�Z�_�d�i�n�t�y�~���������������������������ƶ˶жֶ۶����������
����!�&�,�2�7�=�C�I�N�S�Y�^�d�i�o�x�}���������������������������ŷʷϷԷٷ޷���������������$�)�.�4�:�@�E�J�O�T�Y�^�c�h�m�r�w�|���������������������������Ÿ˸иָ۸��������������ȩΩԩک ���&��������
����,�"�(�.�2�4�:�@�F�8�L�R�X�l�>�D�r�J�x�~�������P���U����Z�]�c�i�p�u�z�
	͔�ZN�>N7�
7�-7�o�2Ռ5Ռ��b7������ͱ�Odf���������iތ7�7�^7�ON�?�p����E�1��D���P�݈�7H�ӧ��P��B������ĔÞ2/��Zͱ5/���~�K�e�?�p����E�1��D���P�݈�7H�ӧ��P��B������ĔÞ2��S�K5���T�,͔��ZN�'7�?7�7�<7�!�Ѕ7��i7��C�D޳4�[�>N�7ͺ�ҕ7�r��7�|7�_f�_��
��E7Գ7p�2�_d�
�C�D�4�[�>N�ٿa�W�ٿa���ٿs�U��ON'�d'�'��'�T'�'�9�����2��d���������d��������y�8�T��d�������T���v7�jv�dv�v��v�ĕ�ʢ�
�P'�d'�'��'�T'�'�9�����2��d���������d��������y�8�T��d�������T���67�jv�dv�v��v�ĕ�ʢĕ�'�r'�r'�/'�/'֗'֗����������������L9��L9���j���j���j���j��j��j��r��r��/��/�L9�L9�֗�֗��j��j��������/��/�L9�L9��2��2�������j�j��T��T��r��r��/��/�֗�֗�L9�D!�v!�v���������Q�2�Q�2���d��d��d�2�d�2�d�j�d�j�dp��dp��dj�dj�8��8��8�2�8�2�8�j�8�j�8�%��������r��r��/��/�4��4�!֤!֤� �� �� �2� �2� �j� �j�Q��Q��Q���Q���Q�2�Q�2�Q�j�Q�j���2���2���j���j��j��jv�Tv�Tv�rv�rv�/v�/v�9v�9v4�v4�v֗v֗��������ĕ��ĕ��ĕ�ß�ß�ßL9ßL9ß�jß�j��PJjJzJ��J�������H��z��z������z������������YEУ�E�2z�2z�z�^�,��j�Qz�Qz�d��j�݈�82z�8�5ެ�p�T��f��f֒֒�z�z���f�f��Y�������z��z��z���_zv�fv�f���zĕzĕzßjßj�4�5�X�5�X�5ˇcj��������j�����������|���_����j��ß�j��j�)�d���)إ�8��إ'�j'�j��j��j��j��jv�jv�jv��rv��rv��v��v��jv��jv��dv��d�E'��r'��r'LZ�r'LZ�r���r���r�j�j��j��j�Q�j�Q�j�֗�֗�֘�r�֘�r�5�j�5�j���j���Þ������)���8�d�8�d'�Z�'�Z���������������'4�d'4�d'��/'��/�4�d�4�d���/���/�4�d�4�d���/���/�4�d�4�d���/���/� 4�d� 4�d� ��/� ��/v4�dv4�dv��/v��/�Q�<�Q�<���<���<������j��j�8�5ެ����'�'ßzßz'L9'L9��2��2���r���r��U�r��U�r�L9�L9�LZ�r�LZ�rĕ�rĕ�r�d��8��������3�n�b�n'j��j��j�d����j�Q�?ˇß�?ˇ������Jjv�����j�j��j��jӨ�ˇӨ�ˇ� j� jĕjĕj�?�����Jz�H�����ˇ��z�YEУФz�E�Y�E�Y��z���Y�E���j�z����^���f���z�dz�j�D�dp�T�d���d�_z�}�݈�݉�ެ݉z�82z�8�_z�7�JH֤���|����� �ެ�� z� �ެ� ˇ� �l�Y� �l����Qz������z�[�Y���������_zv����z�������ĔĔß�_zß��4�5���������������������p��E�z����9��P�Өz���j�Y���j��n��n��o��s�n��n�K�o���n��n݊�n���,���,���l���mˇI�I�zI��I�I��I�� zI��I��IĔI�I4�I��I�I�Y�I5��I2��I���I�Y���I2��I5��I|��I���I���jIS�KI�rI�
�I�e�I~S�KI~�rI~�e�I~�
�Iɱ�I�ɱ�I�#5��I�#2��I|˓I�˓Ib7I�7�/L9�9֗�T4�
�I�IzI�>�I�^I�I�PI��I�Y���I�J��I���I�A��I~��I�I��I�
�ʘNI�`�ʘNI��I�DI4�I~���I~|��I~2��I~5��I~�Ip�e�Ip4�e�Ip4�
�I~�TI���I���I�ނ�I��~�I��~�I�I��I~23&�e�&�
�&��&�T&�r&�&�/&L9&�&�9&�9&4�
�&�j&S�L9&4S�L9&4�e�&��&��/&��9&�9&�Y�9&�Z�&�e�<&�
�<&2˔<&5˔<&2�[9&�f&2��<&|˔<&�˔<&b<&�<&���<&�_�<&L<&�<&�<&�<&�2&֗&S�L<&�(<&�4��<&�k<&��<&�0<&��0<&�U<&�s<&~�K&4~�K&�U�&ζ���&����&ζͲ�&�Ͳ�&5��<&��(<&/<&Ѝ<&��9&S�T&4�&�e�N&�
�N& �&& ��& ��& ��&�(9&�<&4S�L<&2�[<&��U9&�9&����9&25=<&�=<&�k�|&5��9&2��9&�&��<&2��<&5��<&5��|��<&5��9&LZ�&��<&4�<&�9&4�0<&4�/&4�r&4�s<&4�T&4��/&4[=<&?&E&D&H&B&��&��&�&݈&�&��&��&�� �X �X ���� ���� ׎7 ��׎7 ���v ���v �� �Yݭ�Wi �ݭ�Wi �Y�ݭ�Wi �ON �� � �� ��� �J�# �� �� �� �{� �� �}� ��� �� �� �^ �� � �N �~ �� � � � ڑ ׺ �� �z �� �J �V �Y � � �K �� �| �� �� ��� �� �� �� ��� �� �� �^ �� � �N �~ �� � � � ڑ ׺ �� �z �� �J 0�V �V �Y � � �K �� �| �� �� �{� �� �}� � i ��i ��i ��i ��
�i ���i �i ��i � i ���� ���� �� �� �v �v �� �� �� ��X�X�X�X�X�X�X�X�X�YX�YX��X��X��X�� �i �Ki ݭ�Wi �� ��i ݭ�i �Yݭ�i �� �� ݭ�Wi �� �� �K��i �Yݭ�Wi �ݭ�Wi �Y�ݭ�Wi(��d(�(�.(�(�T�(�(��D(�(�(�((؝(�e(�&(��d(ζB(�(?(�	(�v(��(�(�(�A(�X(D(ζD(�(�(��(��(H(�\(�(�(�D(B(�/(�(�k(�g(�2(�(�7(�/(ͺ7(E(��(�(?(�	(�v(��(�(�(�A(�X(D(ζD(�(�(��(��(H(�\(�(�(�D(B(�/(�(�k(�g(�2(�(�7(�/(ͺ7(E(��(�(��d(�(�.(�(�T�(�(��D(�(�(�((؝(�e(�&(��d(ζB(�(�|(�|(�T(�T(�E(�E(�/ö(�/ö(��/ö(��/ö(��ö(��ö(���ö(���ö(��(��(��(��(�g(�g(��(��(��4�e�(��4�e�(�W(�W(ѻ�|(ѻ�|(�}�6(�}�6(�1(�1(��(��(ʞ7&(�6&(��&(�?�w&(���w&(�g&(�:ʞ7&(�7(ζ�ˇ(ζ�ˇ(�e7(�e7(��o(��o(���(���(��j(��j(��pz(��pz(�B��(�B��(�Y��(�Y��(�F��(�F��(�FSj(�FSj(�Fj(�Fj(�>�(�>�(����(����(!����(!����(�]pz(�]pz(��(��(���(���(�E��(�E��(��B(��B(��vj(��vj(���(���(!�E�k(!�E�k(�h��(�h��(�hSj(�hSj(��(��(��g(��g(��h��(��h��(��(�B�/(�B�/(�Fz(�Fz(�ˇ(�ˇ(��z(��z(��ˇ(��ˇ(�g(�g(��ˇ(��ˇ(��('�/('�/('�('�(!'�(!'�(��/(��/(У(У(Ф�(Ф�(�B�(�B�(�Y�(�Y�(��(��(��r(��r(��(��(��(��(�JH(�JH(�J��(�J��(��(��(v�r(v�r(v�(v�(v4�(v4�(�h�(�h�(����(����(�0�(�0�(����z(����z(�z(�z(�j(�j(��(��(��.(��.(��(��(��(��(��((��((�؝(�؝(��(��(��0(��0(�Y�X(�Y�X(�z(�z(�z(�z(�M(�M(�v(�v(ӟ(ӟ(�m(�m(���(���(�pz(�pz(��pz(��pz(�]��(�]��(����(����(��2z(��2z(�(�(�-(�-(���(�����w����������<���s���(��������A���7���,��������������������]��ۤ���������2���������H��������w���'���3��Ҏ�������Ԛ����֕����I2��������N���ZN�����ON��N����w���w����������<���s���(��������A���7���,��������������������]��ۤ���������2���������H��������w���'���3��Ҏ�������Ԛ����֕����!�=���j������������|7޷���|7����7{��w{��x{��{��dӎ{��d�q{��B{��V{��b{��|{��%{���{��{���f{��{�ӏ՜{���){��b{�����{��p{��V{�ۙ{�ۚ��{��H{�Ӛ{��Ӊ{��2����{�փ{��j{���{��{u��{�o��{�o��x{�o��s{�o�ӓ{�o�!{�o�h{�o�x{�o�s{�oӓ{�o�{�o��$�z{�o�S{�o�y�I�*{�oێ{���'{�o��{���~{�o���{�o�B�{��ͻ�u{u�!�{u���{��׋��{�oӔӎ{��{��{�{�e{�{�z{�\{�Y{�{��{0�#{�#{��{0۫{۫{0׊{׊{��{�u{0�\{�\{0�l{�l{�j{�m{��{�U{��ɴ{!�4�z{!��{��{!�4��{���{���	7	��	�#�	�	��	u9�	�%��	���	ҿ�	�.�7�	�.�ʟ7��7	�	�;�Z	�q�f7	�	��Ņ	����	��	���R	�~	�ˋ	�!���@	��j	��	�_	��	�i	N	ɥL��N	�ON	���@	��	��n9	���9	�v��9	���<	]��9	��	��	�*�#	�)	��	�	��	�	�k	��	Ҏ	�j	�}	�	�	�	ˋ	�m	��	��	�c�9	�s�<	��]���	��]c�9	��]s�9	�[	�	Ә	�#	�	۹	�	�q	�u	��E	�@	��	�]	��	��	�_	��	�(	�w	�l9	��9	��<	̏��	��_	u� ��	��	��9	���9	L<	�Y�_	��c�	�w��<�	�O�	d�	f�	��	��	��	��	��	��	�	�-7	���Z	ʞ�Z	�e�m�	��	�Ә	�_��	�ņ	��w��9	��w��<	���	����	����u	v��9	����@	�F	�D	��	�*�	�*s�Z��	�H	�'	��	���9	�c�S9	�_	�	�s�9	�H	�F	�$	�l�	�lL<	�lL��ˋ	�r	�&	�	�ls�Z��	�l��9	ѭ	ҏ��	ҏ�	ҏL<	ҏ��<	ҏL��L9	ҏc�9	�	ҏ��9	�~L��L9	�~s�<	�~s��s�9	�	c�<	�	s�9	ˌs�9	��s�9	��	�Lڢ<	�L<	�o	�s�<	�F	әL9	әs�9	�	�?�#	�$�	�$L9	�I	�$s�<	�n	�o�	�	�oc�<	�?	�os�9	���	�L9	�s�9	�s�<	� L<	� ��	��	� �	� s�9	�r�	�IL9	�r]9	�r�	�r���9	�*�$�	�v�	�C֤	֤	B	��	�C��	�vc�9	�v	���@	]ˇ	]��	�vL9	E	]s�<	]�H	]�I��9	����	��	�!�	���E	�!ә���E	�WT	����	��	�s�	��}	��M�y	�Mф��	�ѹ�O	��Ң�O	���M�	�WF	~�}	��m	�u	�@	��@	��	ԕM�	��%~��	��%���	ѹ����$	~۹	�l���	ҏ����O�	�O�O�	d�O�	f�O�	��O�	��O�	��O�	��O�	��O�	��O�	�	�L<	�L<	��L<	�A�o	�A�Fۤ	�r�������Mՙ���Z������̑�������Z���̑���������޸��������Z��޸��̑������{���ָ���ی������N�������_���������d���e�M���h����i�������u���j���W�������M��������������������׊���b��0�b��E���\���Y�\�����Ӓ����������R������������������9����<��������9���<������Һ9��Һ<����������S���9���<�������9���<���`�������8���~��cS�9��cS�<��s�9��s�<��ֶ�L9��ֶ�L<���X��G��Ͷ�H��Ͷ���Ͷ�	��s��h<	��L��s�9	��s��k�<	��s��k���c�9	��c��L9	�����<	����	�c�9	�s��k�<	�lc��2��ˋ	�l���<	ҏj	�~��9	��c�9	��s��k��9	��c��29	�c�<	�s��k�<	�L9	�s�9	�s��k�<	WL9	WL<	� c�<	� ˋ	� ��	��	ҏc��29	ҏ��9	�~c��29	�	ˌ<	�	ˌc�	�~	ˌc�	ҏ	ˌc�	�	ˌ9	��O�	c9	��O�	s9	��]�O�	c9	��]�O�	s9	��]�O�	�<	�v�O�	c9	�v�O�	s9	]�I�O�	c9	]�I�O�	s9	��O�	�<	�~�O�	�9	�~���	�$c�9��������������������w���2������ǖ��۸��������������O���w������|���9���_���T��ā���j�������j���M���O����������q�������������������������Ӝ��ş�� ���������5���k���e���?���E��ֵ��ֽ���w�����r�O�rd�rf�r��r��r��r��r��r��r��r?�r�6�rD�rE�rB�r�f�rH�r�z�r�7�r���r��r��r���r��r��r��rѵ�r��r�A�r���r��r��r���r��r�m�r��r��rŦ�r��r�n��r�y���r�y��r�y��r&ζ���r&ζ~��r&ζ���r&�����r&����r&�~��r&����r&��N�r&4L9�r����r~���r�g���r�@�r��r�ZN�r�4�r�S�r�7�r�t7�����������c���j�����������R�������9��õ���3���K�����׊���?���V������o���L��������ˡ��u�V��u�U��uְ��u�x��I�õ��u�õ���E��E�����������������?���?��?��Iζ?��ζ?���B��B��ID���D��D��H���w��u�]�����]���������`����1�������������N����ۮ�p����������p�����p��������������ͻ�
����M�:���:�u�:���:��:���:��:�r�:���:���:���:���:���:�{�:�j�:���:�V�:�.�:���:��:��:���:���:��:�+�:���:��N�:�N�:�$N�:������G���������m����N����V����D�������������%��������P	����<	����9	�c�9	ˌc�9	�L��s�9	әL<	�4�	Ws�9	]c����9	]c��L9	ҏ��	�vL�&	���@	~��	�ls�<	�	s�<	�o�j	���u	�k���9	��s�<	�$L<	��W9	�IW9	�*�*9	ҏ� 9	]c��� 9	���	��Ә	���	~�u	��	�	��	���	�Ә	�� ��	~� ��	��	��	��	��	��	�i	��	��	��	�t	��	Ō	��#�	��	�G��M�y	��`<	���	��_	���	���	��]	���	�aL9	�c�9	���9	�aL<	�c�<	���<	���	��]	���	��u	���	��L9	��L<	2��9	5��9	2��<	5��<	45��9	45��Z�	5��Z�	�`�	u�`� ��e���e��e�3e�eζ?e?e��eDe�xeBe�en�en�e��EeζEeEe��e��HeζHeHe��e�e�e�{e��e�Ge��e�e��e�e�me�Ne�Be�)e�e�Ve�e��e�e�e�e�De�e�e��e��e�e�e�eѵe�e�%e�eǘe�2e�Pe�e�e֤e�deוe��e��eDe�xeBe�en�enѶe��EeζEeEe��e��HeζHeHe��e�e�Ee�e�e���ee���5e�e�e�
�e���Ee�ce��eӟe�e��e�se�e�Me��eçenѶen�&en�en�&e�Xe4�Xe�Oedefe�e�e�e�e�e�e�e�7e�͓�e��?e֤e�de�e�ce��e��)e�JeU�e�
e�e���e�e�-��P�������3�����?������D���x��B�����n���n���E�����H������������{������G���������������m���N���B���)������V�����������������������������������������2���P��������ו����������D���x��B�����n���nѶ��E�����H�������������ޞN��ѵ���M��ç��nѶ��n�&��n���n�&���O��d��f������������������������p��������lN���l7���׍d���׍f���׍����׍����׍aލ�����������������ZN���s�3��7����N�*����*���*��*?�*���*D�*�x�*B�*��*�6�*���*�f�*���*��*��*�{�*���*�G�*���*��*���*��*�m�*�N�*�B�*�)�*��*�V�*��*���*��*��*��*��*��*���*���*��*��*��*��*�%�*ǘ�*�2�*��*��*ו�*���*D�*�x�*B�*��*�6�*���*�f�*���*��*�g�*��*���*�s�*ѵ�*���*�O�*d�*f�*��*��*��*��*��*��*��*�A�*��*��*��*��k�*�h�*�7�:���:�3�:��:?�:���:D�:�x�:B�:��:n��:n��:��E�:E�:���:��H�:H�:���:��:��:�{�:���:�G�:���:��:���:��:�m�:�N�:�B�:�)�:��:�V�:��:���:��:��:��:��:��:���:���:��:��:��:��:�%�:ǘ�:�2�:�P�:��:��:ו�:���:���:D�:�x�:B�:��:n��:nѶ�:��E�:E�:���:��H�:H�:���:��:��:nѶ�:n�&�:n��:n�&�:�O�:d�:f�:��:��:��:��:��:��:��:�7�:�l7�:�J�:�w�:�(�:�k�:ʙז9�:�ז9�:��ז9�>���>�3�>��>?�>���>D�>�x�>B�>��>n��>n��>E�>���>H�>���>��>��>�{�>���>�G�>���>��>���>��>�m�>�N�>�B�>�)�>��>�V�>��>���>��>��>��>��>��>���>���>��>��>��>��>�%�>ǘ�>�2�>�P�>��>��>ו�>���>���>D�>�x�>B�>��>n��>nѶ�>E�>���>H�>���>��>��ޞN�>��ޞN�>ѵ�>�M�>ç�>nѶ�>n�&�>n��>n�&�>�O�>d�>f�>��>��>��>��>��>��>��>���>Ŧ�>�a�W�>�a���>�s�U�>�a��>�a��>�s�*�3*�*?*��*D*�x*B*�*E*�6*��*H*�f*��*�*�G*��*��*�m*�N*�V*�*�*�D*�*�*�*�*ѵ*�*�%*�*ǘ*�2*�P*�*�*��*D*�x*B*�*E*�6*��*H*�f*��*�*�*��ޞN*�O*d*f*�*�*�*�*�*�*�*�*a�9*a�*�67*��7*�C7*�7*�J7*��Z7*�l7*7��&��9�������3�����&�49��?������D���x��B�����n���n���E���6������H���f�������������{�������G�����������������m���N���B���)������V�����������������������������������������ѵ������%�����ǘ���2���P����������������D���x��B�����n���nѶ��E���6������H���f���������ޞN���ޞN���q�����Ѣ��nѶ��n�&��n���n�&���O��d��f������������������������d�¿�P$֨�9M��¿a$֨�9M��¿c$֨�9M��¿s$֨�9M��¿a$�g�9M��¿c$�g�9M��¿s$�g�9M�����͓�������3����d�?����D��x�B���n��n��E��6����H��f���������{�����G������������m��N��B��)����V����������������������������ѵ����%�ǘ��2��P�����ו�������D��x�B���n��nѶ�E��6����H��f������ޞN���ޞN����nѶ�n�&�n��n�&��O�d�f������������������"�&�49�����3���?����D��x�B���n��n��E��6��ȃH��f��������{����G�������փᴃ�m��N��B��)����V������ﰃ���D���������Ń������ѵ����%���ǘ��2��P������/�S�P������������D��x�B���n��nѶ�E��6��ȃH��f������L�t�՜��@݈��@Ĕ��@����ޞN��a�s��a���s���a�탿a���s�샿a딃���x�nѶ�n�&�n��n�&��O�d�f�����������������a�9�a���a�W��a�ჿs�U��a���a���s���;N��@�W��@�7��@Ѷ��@���@�&��@�P��2����x��y��������w��������i��k��F��1�������_�������֙�X�֙���D��X�D��
�����D����S��X�S����ę�X�ę˟��˟�������ę���J��X�J���� ��X� ��T�™��� ����L��X�L����4��X�4��T�™���4����d��X�d����/��X�/����u�/��J�Ҿ��T�Ι�x�˟г��Tг��Tг�虙�T�Ι뿙��������w�����w�����w���p����w�����������w�����C��C��2�O��2d��2f��2���2���2���2���2���2���2���w�p��w�C���ߥ�������v����v�m���v�h���v�r���v���������2���2�<��2���������2�.��������
����r��ʪ����ʪ����ʪ�����3�e���������j��ʪʈ��ʪ����ʪʥ���3׺��u�n���vԖ���������4����������4����������������i����х��ь����D��ݿ���#Ŝ�����������h����̣�����#�����侱�a�����)��������?���R�����������{����D�����x�����c�����a����B�������������o����E���������H������L������M������I���J���R����Rʩ���Rɷ���R�l������ػ���c���*���O��d��f�����������������������\���s������v�l���v�u���������������������u��������I�����m�����N�����B�����)����������V��������ʪ�l��ʪ�u��������2���t���u�����l���4�u�����u���4�l���������������D��������"�����2�����P�����l�����l�����%��H�����u�����?���R��������{��D���x��Ĕ��è��B�����������R����d����d�I��E���!��H���z�����������R����Rʩ���R�z���R�[��N�������O��d��f��������������������������2��������w����w�IR�Ru�N��`�w?Ru�N��`�����Ru�N��`���N�c�RuT��`�ѦRu����`�9�Ru�o��`���+�Ru��`�c�+�Ruб�*Ru���_Ru�����_Ru��bRu���c�Ru�*Ru�N�*Ru�c�*Ru�N�c�*Ru��Y�a�*Ru�Q�p�*Ru�o��ё�е��Ru�N�bR��ѐR��xѐR���5�3��ѐR�����R��Д�]Rҹ�+�2Rҹ�+�Rҹ�+�ORҹ���2Rҹ���Rҹ�+ҹ��R�ORdRfR�R�R�R�R�R�R�R�dR�fR��R��R��R��R��R��R��R��ORu�ѐRu�>���Z�
Ru�o��ё���)��Ru�>���6ѐRu�h�_Ru�r��Ru�=ё�Ru�=ё�Ru�b��Ru�b��R�[�aR�&�aR�R�R�{R��R�GR��R�R��R�mR�NR�BR�)R�R�VR�R��R�R�R�R�R�R��R��R�R�qR�gR�R�RŦR�JR�sR��R�R�R�R�2R�PR�R�R?R��R�a�R�$RѵR��RDR�xRBR�Rn�RnѶRn�Rn�&RER�6RHR�fR��̭�H��R��
R�YDR�Y�xR�Z���R����Ru��Ru��R��ѐR�`ѐR���r��R���R�R���OR�R���OR����R̘���r��R̘���R̘����R̘�R̘�R̘�{R̘��R̘�GR̘��R̘�R̘��R̘�mR̘�NR̘�BR̘�)R̘�R̘�VR̘�R̘��R̘�R̘�R̘�R̘�R̘�R̘��R̘��R̘�R̘�qR̘�gR̘�R̘�R̘ŦR̘�JR̘�sR̘��R̘�R̘�R̘�R̘�2R̘�PR̘�R̘�R̘?R̘��R̘�aŦR̘�a�R̘�a�R߼э�R߼э���)��R�~U�R�~��R�~���:R�~а��R��RҸ��R���1RҸ��Q�oR��R��R���N��R���P��R�����Rҹ��ҹ�*Rҹ���ORu����`�PRu����`�PRu�N�bRuT�6����`�ѦRu��6����`�9���E7޷�E7��E�޷�E�Ru����ѐRu����ѐK�K�K�{K��K�GK��K�K��K�K�mK�4K�NK�BK�)K�K�VK�K��K�K�K�K�K�K��K��K�K�K�K�KŦK�K�K�%K?K�?KDK�xKBK�KEK��EKHK��K�x��K��KDK�xKBK�KEK��K���xK��HK�9K�3KL<K�K�K��Kl�¤Kl�©Kl��ŦKl�ŽK�`�K�OKdKfK�K�K�K�K�K�K�K�/ЄKЄK�K�K��K�K�2K�PKn�KnѶKn�Kn�&Kn�KnѶKn�Kn�&K���GK���K��-K��(Kl���°Kl���¦Kl���¬K�8��2K�8��tK�u�8��K�u�8�����K�Vӳ���K�Vӳ�ӹK�Vӳ��tK�Vӳ��cK�Vӳ��
K�Vӳ��	K�Vӳ��K�Vӳ��K�Vӳ��K�Cӳ��VK�Cӳ�ïK�Cӳ���K�,�DK��֤K��BK���6K��K��K��{K���K��sK��mK��K��K��K���K���K���K��Kl���ŦK���K�EK��9K�0ĔK��	K��K��K��K��[�	K��[�K��[���K�w����K�w���K��OK�dK�fK��K��K��K��K��K��K��K��
K��K��?K����K�dK��Y^�j^�]^�]^�^��^�^�R^�r^�V^�^��^�>^��^�w^՝^�F^��^��^�e^�H^�^�^��^Ӑ^��^�>^��^�^�^�^��^�^��^�^�:^�m^�^�^�^��^�j^�]^�]^�^��^�^�R^�r^�V^�^��^�>^��^�w^՝^�F^��^��^�e^�H^�^�^��^Ӑ^��^�>^��^�^�^�^��^�^��^�^�:^�m^�^�^�^�^�^��]^��^՚�ZI^��^��^�7^�I7��0��H�����a��=��6��8�����E��4��B������L��G��z�ʿ�����7�����F��������^��*��D��4����1���������Ի������Ծ���Խ����������Լ���������-��+��#��&��,��(��'��%��0��2��3��.��$��)��1��5��3�����ծ��������������I����������.����6��4������E��F��7���������J��4��'�����������[���f��f?�f���f��f�v�f��fE�f�8�f�E�fH�fŦ�fŝ�f֤�f��fB�f�[�f�m�f�F�f���f�t�f��fD�f���f���fĄ�fĂ�f��f��f��f�7�f�6�f��f��f��f��f��f��f��f��f��f��fȬ�fȫ�fȩ�fȥ�fȦ�f���f���f���f���f���f���f���f�n�f�p�f��f���f���f���f���f���f���f��f��f��f��f�M�f���fă�f�5�f��f�
t�0t�Ht�)t��t��t��t�at�6t�1t�.t�'t�"t�t�(t�4t�8t��t��t�4t�Bt�t�t�Gt�ztʿt��t�7t�*t�(t��t��t��t��t��t�^t�[t�/t�*t�t�t�Dt�,t�+t�$t�&t�3t�t�)t�2t�t�4t�/t�1t�.t�,t�2t�7t�5t�t��t��t��t�t�-t�#t�&t�(tծt�t�t�It�t�.t�(t�)t��t�t�5t�3t�6t�4t�4t�,t�+t�/t�-t�.t�F#�#�K#�G#�#�v#�#�#�#�#ݿ#�m#�R#޼#��#�#ݟ#�P#�J#�L#�O#�M#�N#�K#�I#�#ڑ#�N#�w#ۼ#��#�#�H#��#��#��#��#��#��#��#��#�#ь#�H#��#қ#ҷ#��#�b#�#̬#�p#�
#Ё#Г#��#�C#�2#Η#��#�-#�#�#��#΂#ӟ#�a#�y#Ӟ#ӊ#Ӌ#�m#�l#�2#�.#�1#�/#�0#Ӈ#�#ӂ#ӆ#Ӄ#ӄ#Ӂ#�~#�z#�}#�{#�|#��#�#��#��#��#�	#�t#��#ǘ#��#�"#Ǘ#�q#�v#�#��#�#�(#�z#ˢ#�0#�D#�#�#��#�)#�#��#�1#�9#�#�#��#ı#��#��#��#��#Ĺ#ĸ#Ī#Ħ#ĩ#ħ#Ĩ#�#׺#��#��#�k#�v#�2#�v#�m#�B#�Y#�l#�a#�b#�I#�8#�?#�B#�D#��#��6#�E#�H#�Ŧ#�#߻#�e#�7#��#��#�#�#߈#߁#߇#߂#߃#�z#�t#�v#�y#�w#�x#�u#�s#�o#�r#�p#�q#Ŧ#��#�F#Š#�b#�m#�"#�#�?#�B#�D#���#��6#�E#�H#�s#�#�!#�q#�U#�X#�#��#�J#�3#�<#�I#�@#�A#�9#�*#�#��#�#ā#�B#�E#�#��#�#��#�#�#��#�#�#�#�)#�#�#�(#�#�#�#�#��#�n#�#��#�#�#�#�X#�{#�L#�#�x#�(#�0#�#�#�"#�#�!#�#� #�
#�#�#�	#�#�#�#��#��#ʎ#��#��#��#��#ʩ#ʅ#�#�#�K#�#�c#�g#�1#�#�#��#�#�#�#�#��#��#�q#�V#�\#�p#�j#�k#�Z#�T#Ⱥ#Ȳ#ȶ#ȹ#ȷ#ȸ#ȴ#ȳ#��#��#�#��#�#�#�3#��#�#��#��#��#�O#�\#�u#ӹ#�X#�=#��#&�$ޞN#&ޞN#&�$N#ЅN#�#����#�#�i#�#� �#�ON#՚�Z#d#f#�#�#�#�#�#�#�#�#��#ʱ#�#�#�
#�A#�#خ#�9#��#Њ�H#�D#�E#�F#Њ��#��#��#��#Њ��#��#��#��#Њӹ#ӵ#Ӷ#ӷ#�u�#�u��#�u�#�uζ�#�u�~#�u�#�u�9#�u�<#�u��#�uߘ_?_E_D_H_B_��_�{_�_�0_�_�_�L_�$_�_�_�G_�_�K_�,_�_��_�m_�_ݿ_ݠ_�_��_�N_�_ڑ_�_��_��_�v_��_�2_׺_�x_�`_�R_�K_�A_�6_�4_�_�P_Г_�p_��_̬_�H_�_�_�_�D_�_�z_�_��_�_�(_�/_�._�#_�"_�!_� _�q_�k_�\_�Z_�V_�U_Ŧ_�m_�F_�"_��_��_�_�E_�_�_��_ð_�O_�E_�_�_��_ð_�O�E��D�xH�fē�f\�6\D?���m�W�m�F�W�F�6�W�6�"�W�"��W����Ŧ�WŦŠ�WŠ��Š��ē�����0�0�d0�U��0���05��0�04�04ζS̷0p�0ζ�j0�}0�˓���V�w�j�\����Զ�u�[ē�[\�v\�G���ӷ�Wӷӵ�WӵӴ�WӴӲ�WӲӱ�Wӱӹ�WӹӸ�WӸēӸ��W�\��Dˠ�z�c��ē�\��\��ˢ���W�����W�����W��f�Wf���W����W����W���������I�9�7�N���1�e�P���ē����7߃�W߃߁�W߁߀�W߀�~�W�~�}�W�}߈�W߈߇�W߇��߇�P߉͞�͞�Q͞�͞�!�9������uē�u������W���W���W���W���W���W���W������в�����v�N�(���ē����w�F�W�F�D�W�D�C�W�C�B�W�B�A�W�A�H�W�H�G�W�G���G݈�W݈�R��݈в݈�v����ؾ�2�!ē�!����t�W�t�v�W�v�u�W�u���u�7\�I�����Q�m�[���ē����Rݝ�Wݝݜ�Wݜݛ�Wݛݚ�Wݚݙ�Wݙݟ�Wݟݞ�Wݞ��W��ŸГ��p�T��ͫēͫ��
�>�W�>�8�W�8�7�W�7�2�W�2�1�W�1�C�W�C�B�W�B���B�P���P�D���Pڼ�������N���`��̯�����Ж�������ξ�2�-��W��~�W�~�}�W�}�|�W�|�{�W�{΂�W΂΁�W΁�4�E������ē���āí�Wíì�Wìë�Wëê�Wêé�Wéï�Wïî�Wî��îĔ��Ĕ�WĔв�ҷ�ҷ�W�����H�	�����W�����W��a�W�a��W��������3�(�������W���1���5�����5��ʽ�5ʽʩʤ����ʄ�Wʄ���@�>�=�B�C��������׉�׉�G׉�+׉�׉�׉�׉�׉�׈��ӛ�y�s�m�hӟӞӧ�+�)�(�,�Wҷ�W�H�W���W��E�����G�F�I�Oв�в��в��в�2�
���
���
ʩ�
���
���t�s�r�q�z�y�{����������ʽ��ʩ��ʤ���������������p��E��D��H��?���m���F���"��Ŧ���v�������2����������e������в�в�Gв�в�\��\��\��\��\��\��\ь\��\ҷ\қ\�H\�\��\�"\�m\�b\�F\Ŧ\�$\�%\�(\�'\�&\�+\ʎ\ʩ\��\��\��\��\�-\�7\�I\�H\�9\�N\��\�u\�\\�O\��\�\�\�L\�\�0\�(\�\�{\�n\�u\�\�\�|\�\�\� \�#\�"\�!\�$\�%\׺\�2\�v\�k\��\�\ڑ\�\��\ۼ\�N\�\��\�\�E\�B\�\�\�nв�n\�\�\�\�в�\��\�\�\�\�\�\�\ݿ\�\��\޼\�m\�\�!\�"\�'\�&\�#\�(\�p\�r\�v\�u\�t\�z\�&\�(\�+\�*\�)\�,\�!\�"\�.\�-\�#\�/\�\�\�X\�U\�!\�s\Þ\TÞ\�\�\�\�\�\�\̬\��\Г\Ё\�p\�\Η\��\�\�\��\�2\�4\�V\�Z\�k\�j\�\\�q\�\�1\�g\�c\�K\�\�0\�1\�4\�3\�2\�5�L7����ӗ�C�L�K�J�I�N�M�
ʂ�
ʁ�
ʀ�
��
�~�
ʅ�
ʄ�
0������͕֙N֙��֙ݱ֙�֙�֙ج֙�o֙�m֙�G֙�֙�,֙ڀ֙�{֙�9֙��֙�֙��֙�j֙�֙�P֙�֙�Q֙�H֙�X֙�~֙�N֙�E֙�N֙�Y�N�t����1�t���t��B�t���tĔ�t���tʇʆʢ�t�y�t�F?�t�6H�t�?�t���t��H�tίH�tH�t֤�t�w�t����Ҍ��t���t�(�t���P�t��t���t�+���t�S�t�������t����t����t����tβ��t���c���7�tΰ�7�t��t����D�tE�t����t��t���tδ?�t����t��2��t����t͛�P�t�X���P�tή�P�t���tÞ�t�4�@ȼ���tέ���t���t�����p�tγ�p�t��t�V�t�"�)E�t�3�?݈�t��݈�tα݈�t���;���t��t�;�t�<�t�{����t�/�xH�t�L�t�	�t��t���t�8�t�
�t���tά�t���tӧ�t���t�>���t�x���t�>���t��i�t�i�t��i�t�P�t�4�t�f�t�_�5�t�_��t�_�(�t�_��t�_��ˎ?ˎDˎBˎ�ˎ�{ˎ�Gˎ�ˎ�ˎ�ˎ�ˎ��ˎ�ˎ�ˎ�ˎŦˎ�ˎ�ˎDˎBˎ��?�D�B����{��G��������������������Ŧ�����D�B������>����4��
?�
D�
B�
��
�{�
�G�
��
�
��
��
���
��
��
��
��
Ŧ�
��
��
D�
Bˍ?ˍDˍBˍ�ˍ�{ˍ�Gˍ�ˍ�ˍ�ˍ�ˍ��ˍ�ˍ�ˍ�ˍŦˍ�ˍDˍBY�Y�Y�Y�uY�Y��Y�Y�Y�1Y�IY�Y�BY�Y�=Y�8Y�Y��Y�YʩY�2Y��Y�Y�uY��Y�Y�Y��Y�Y�Y�2Y�'Y�Y�Y�YӟY�IӑY�IӞY�I�yY�I�sY�I�aY�I�BY�I�6Y�I�5Y�I�YY�I�RY�IݗY�I݋Y�IӋY�IӗY�I�i��dY�I�i��fY�IӍY�9�Y�9��Y��YDY�xYĔYèYBY�Y�rY֤Y�Y�YEY��Y��Y�fY��YؼYұYóY�SYɨY�RY��Y�Y�Y��Y����Y�Y�Y�4Y�Y�MY��ԷߏYޥ�Y��Y��ڊY��Y��8Y��Y��Y�OYdYfY�Y�Y�Y�Y�Y�Y�Yޥ��ͮYޥ���hYޥ��ԶYޥ����Yޥ����Yޥ���1Yޥ���+Yޥ���)Yޥ���/Yޥ���-`��`�`�`����`�`��`�ͺ�`�h�Q�`�;�`�;����`ت`�>�sd`�>�sf`�>�s�`�Z`�O`d`f`�`�`�`�`�`�`�`?`E`D`H`B`֤`�c`�6`�`�a`��`�`ӟ`�{`�`�`�`�2`�`�`�`��`�`�`Ŧ`��`�`�`�q`�s`�`�`�z`�<`�K`��7`�E`�D`�H`�B`�֤`��c`��a`���`��`�ӟ`��{`��`��`��`��`���`��q`��`�Ŧ`��`��x`��`��`���`��`�hE`�hD`�h��`�h�c`�hB`�h�a`�h�`�h�{`�h�`�h�`�h�2`�h�`�h�`�h��`�h��`�h�x`�h�`�h�q`�h�s`�h��`�h�`�h�J`�;D`�;�`�;�`�;��`�;�J`�c�`���g�4d`���g�d`���g�a`���g�m`���g��m`���g�``���gs�``���g?`���gD`���g�`���g�G`���g��`���g�N`���g�B`���g�)`���g�V`���g�`���g�`���g�`���g�`���g�P`���g�J`���g�s`���g��`����g�`����g�J`�;���g��`�;���g�G`�;���g��`�;���g�`�;���g�N`�;���g�`�;���g�`�;���g�`�;���g�P`�;���g�`�;���g�J`�;���g�s`���g�B`���g��`�;���g��`���g�|`�;���g�z��z�z�p�7�eӰ�M��߅������͙дΠ��z���Kҿ�s֍�s�r֍�r�q֍�q�p֍�p�^�]�\�[�Z�b֍�֍��֍�P֍��֍݈֍�7֍�P֍�4�C���V��0�0�����_�W���W�Rʃʅ�:�<�A�%�'в�вξв�\�\���(\�x\�"в�Z\�X���ҟ���Ґ\���P�U��އ�U��U��U�{�U���U�G�U���U��U���U��U�a�U��U���U��U��U��U��U��U���U���U��U��U��U��UŦ�U�2�U�P�U��U��U��U���U?�UD�UB�U�6�U���U�f�U���UE�UH�U̘��U̘��U̘Ŧ�U��U�G�U�3�U��U��U��U��U��U��U�}�U��U��U���U�ZN�U�ON�U�O�Ud�Uf�U��U��U��U��U��U��U�1���1����1���G1���q1���1���1���1����1���1���1���1���1����1��ǘ1���1��ӟ1���1���g1���1��?1��D1���61���(1��B1���f1��H1���c1��E1����1����1���	1���1���1���1����S1ݹ�ӟ�S1ݹ~ӟ�S1ݹ���S1ݹ����S1ݹ��G�S1ݹ~��S1ݹ~���S1ݹ~�G�S1ݹ��q�S1ݹ���S1ݹ���S1ݹ~�q�S1ݹ~��S1ݹ~��S1ݹ���S1ݹ����S1ݹ���S1ݹ~��S1ݹ~���S1ݹ~��S1ݹ���S1ݹ���S1ݹ���S1ݹ~��S1ݹ~��S1ݹ~��S1ݹ����S1ݹ�ǘ�S1ݹ���S1ݹ~���S1ݹ~ǘ�S1ݹ~��S1ݹ���S1ݹ���S1ݹ����S1ݹ~��S1ݹ~��S1ݹ~���S1ݹ�ߊ�S1ݹ�Į�S1ݹ~ߊ�S1ݹ~Į�S1ݹ�̣�S1ݹ~̣�S1ݹΪ�S1ݹ���S1ݹ�x�S1ݹB�S1ݹ��S1ݹE�S1ݹ���S1ݹH�S1ݹ־�S1ݹ�c�S1ݹ�z�S1ݹ�z�S1ݹ���S1ݹ��S1ݹֻ�S1ݹ�^�S1ݹ���S1ݹ0���S1ݹ0�I�S1ݹ0�7�S1ݹ0݈�S1ݹ0�P�S1ݹ0���S1ݹ0�p�S1ݹ���S1ݹ���S1ݹ�O�S1ݹd�S1ݹf�S1ݹ��S1ݹ��S1ݹ��S1ݹ��S1ݹ��S1ݹ��S1ݹ��S1ݹxd�S1ݹ�A�S1ݹ�@Y�oY�i�YԷ�Y���Y���Y�2�Y�,�Y�*�Y�0�Y�.�Y�R�Y�N�Y�M�Y�P�Y�O�Y�L�Y�Y�i��YԷ��Y����Y����Y�2��Y�,��Y�*��Y�0��Y�.��Y�R��Y�N��Y�M��Y�P��Y�O��Y�L�����{��G����������ڗ��������������m��d�������ǘ���?���D�B�E�H��������MЄ1x��1x��1x��z1x~�1x~�z1x~�1x�G1x���1x��1x~��1x~�1x~�1x�m1x��1x���1x�1x~��1x��1x��1x���1x~�1x~��1x�1x��1x��1x��1x���1x~�1x~��1x~�1x�1x~�1x��1x�1xс1x�1xݸ1xŦ1x��21x��P1x��1x��1x�%1x?1x~�1xD1x�x1xB1x�1x�61x�f1x�A1x�`�1xl�©1xl�¬1xl�S�o�61x�R��61xl0�G1xl~�1xl����I~�1xl�1xl��1xl�1x��1x?1x�R��1x��1x�x��1xD1x�x1x�c1x��1xB1x�1xH1xֿ<1x�1xE1x��1x�f1x��1xx��1xֿ91x�R�
1x�
1x�	1x�j�1x�j�1x�j�1x��1x�R��1x�i�1x&�,�1x��O1x�d1x�f1x��1x��1x��1x��1x��1x��1x��1xx�O1xxd1xxf1xx�1xx�1xx�1xx�1xx�1xx�1xx�1x�@1x�?1xи1x�1x�U1x�1x�Y����1x�R�b1x�01x�/1x��1x�1x�1x��&����&�&�?&��3&ɥ�&��<&�8�L<&�u<&4�u<&��&��<&̶�&��<&Վ9&4Վ9&Վ<&Վ���R�;��R����5��V����������2��t��u�2��U��V�2���z���{�2��Sޟ��Sޠ�2����ō։�֊�2����F�U��{��|遍�G�������E��֍��ḍ�m�˩�ٍ˩�d�U���d�����d�U���э��˩�Q����j��������������ཌྷ��������Ŧ������΍�����p��2��Q��R�ʍ�y��z�l���z���{�2��Sޟ��Sޠ�2��y��z�z��z�2��z�{�2��0��1�2�����$�ɍ�p�ɍȵ�ɍ�0�ɍ�w�ɍ�i�ɍ���ɍ�O�d�f���������������ի��ȍ�0��l���l�Q��lՋ��Ǎ"��"�э"�"�V�"�W�V�"�^�"�"﹍"�n�"�W�*�"&�+�"&�ۍ"&ญ"&ຍ"&Ἅ"&�Ἅ"&�Ἅ"&�܍"&配"���Í"���~�"�����"���˃�"޶�չ�"޶��Ӎ"޶��ԑ�"޶��ԁ�"޶�ԫ�nը�nյ�nձ�n?�nD�nB�n���nH�nE�n�t�n��nӟ�n�{�n�G�n���n���n�s�n�m�n��n��n��n��n���nǘ�n���n��n��n��n��nŦ�n��n���n��nl���nlժ�nlէ�nո�nզ�nվ�nհ�n���nպ�n���n��nl���nl�Ŧ�n��n�+�n�O�nd�nf�n��n��n��n��n��n��n��n���n�\�nބ�n���n0�P�n0݈�7?�7�I?�7��7�I��7�9��7���7���7��7�I��7��7�9��7Ŧ�7�IŦ�7��Ŧ�7�{�7�I�{�7��7�7��7�I��7��7�I��7͝��7���7��7�I��7�9��7��7�I��7�G�7��7�I��7�m�7���7ٟ�7��7D�7B�7��7E�7��E�7�6�7D�7�D�7H�7�H�7B�7v$�I��7l�I�7l��7ճ�7կ�7���ۍ�7��ԯ�7���k�7��ճޏ�ޏ�ޏ�ޏ�{ޏ�ޏ�Gޏ��ޏ�ޏ��ޏ�mޏ�ޏ��ޏ�ޏ�ޏ�ޏԖޏ�ޏ��ޏ�_ޏ��ޏ��ޏ�ޏ�ޏ�qޏ�gޏ�ޏ�ޏ�ޏ�ޏ�ޏ�ޏǘޏ�ޏ�2ޏŦޏ?ޏ̘�ޏ̘�ޏ��ޏDޏHޏ�fޏBޏ�ޏEޏl�Pޏl݈ޏl�ޏl�7ޏl�ޏl�ޏl��ޏl�Qޏl�
ޏ��ޏוޏ��ˤޏ���]�}ˤޏ��ޏ���_�ޏ���^ޏ�Oޏdޏfޏ�ޏ�ޏ�ޏ�ޏ�ޏ�ޏ�ޏ�Nޏ�Bޏ�)և�D�Oև�Ddև�Dfև�D�և�D�և�D�և�D�և�D�և�D�և�D�և�D�և�D��և�D��և�D�aև�D��և�D�Rև�D��և�D��և�D��և�D�{և�D�mև�D�և�D�yև�D�և�D�և�Dݿև�D�jև�D�hև�D�*և�D��և�D��և�D�և�D�9և�D��և�D�և�D�և�D�,և�Dֺև�D�և�D֕և�Dڒ�+և�D�v�,և�Dڌ�,և�D҉և�D�և�D��և�D��ڈև�D��4ڈ(ѹ�v(���(��H(�>�(�x�D(ʖ�D(�x�7(�x�T(�C�W^ړ�j^ړ�]^ړ�]^ړ�^ړ��^ړ�^ړ�R^ړ�r^ړ�V^ړ�^ړ��^ړ�>^ړ��^ړ�w^ړ՝^ړ�F^ړ��^ړ��^ړ�e^ړ�H^ړ�^ړ�^ړ��^ړӐ^ړ��^ړ�>^ړ��^ړ�^ړ�^ړ�^ړ��^ړ�^ړ��^ړ�^ړ�:^ړ�m^ړ�^ړ�^ړ�^ړ�^ړ�^ړ��]^ړ��^ړ��^ړ�7^ړ�I7�n����O�n���մ�n������n������n���ޅ���n����F���n�������n��������s����s���s���sؿ�s�j�=�F�s��j���I�F�s��j�I�F�s��j���I�F�s���<�s��j���I�GХ�s�4�F�s�ɥ�F�s���5�s�L<�s�c�<�s�s�<�s��
���I�F�s����I�F�s��F�s��e�s�Y��e�s��5�s�Y��5�s��fˇ�s��6ˇ�s�4�D�s�4�p�s�4ǎ�s�4Ǐˇ�s�:�s�S��3�s��3�sю��3�s�4�l��s���s����s���9�s��s�"�s���s��9�s�4�9�s4�4�D?������J�p�����yE��E�D���P�dj݈�Y�7H�H�`H�`�H�`�j�֤�'��H�U�H��Y�����B�`B�`�B�`�݈����Þ�4�����w�� �^ � �� �J ��(�I?I��I�pI�J�pI��IEI�YEI�I�IDI��I�PI�I݈I�7I�Y�7IHI�'I�I�I��IBI��I?I�?I��I���I�pI��IEIУI�EI��EI�I�DI�PI݈I��IHI�HI��HI�U�HI�I��IBI�`BI�݈I��I��I��I �^I��I �I�K̏D̏�̏B̏�� ̏�� ̏�^ ̏�J ̏� ̏�K�cJp�T��p�T�2p�T݉p�T�8p�T�p�T� p�T� �mp�T�Qp�T��p�Tßp�T��I(���'������j�j�jvj�jJ��z����z�2��z���z�Q��z�d��z݉��z�8��z���z� ��z�Q��z���z����z����zß��z'�_z���_z���ˇ��_z���_z�Y���_zФ�_z��_z���_z��_zv�_z�5�_zI���I��I���I�yI�Y�EI�1I���jI��I��I�jI�IDI�jI���9I�d�_zI�d��zI�I݉zI�݉�ެI�82zI�8�_zI�7I�JHI�I�QzI�I����zIv�I�IBI��zI���IÞIß�_zIß�I�4I��&��e�&�
�&��<&�MN&�q&�b&�o&�&�c&�	&� <&�.&�p&4��9&֘9&�<&�<&�9&�9&�O�'9&��&�1&��&��2&�'��&�y&�&�&�P&�&�&݈&�7&�7&�&� Ѽ&�P&��P&Þ&��&�p&��&У&�1&�d4p�T&���&j&�&�&v��&j&��&'�&��&v�&|˔9&��Z�&��Z޸&LZ޸&�>��(<&��N&4��0<&����<&2��9&5�����<'�<'�<JL9JL9JL<JL<J�L<J�L<���3����3���L9��L9��L<��L<���L<���L<���2���2����<����<��s�d��s�d��s���s����<���<��U<��U<��3�/��3�/�2L9�2L9��r��r�L9�L9�L<�L<������2��2��0<��0<��U<��U<�������Q��Q��QL<�QL<�Q�L<�Q�L<�dL<�dL<�dL���r�dL���r�d�L<�d�L<�d��<�d��<݉�݉�݉L9݉L9݉L<݉L<�8L9�8L9�8L<�8L<�8�L<�8�L<�8��<�8��<��U���U���U���U���s�d��s�d��s���s������L9�L9� L9� L9� L<� L<� L���r� L���r� �L<� �L<�QL9�QL9�QL<�QL<�Q�
L9�Q�
L9�Q�kL9�Q�kL9�QL��L9�QL��L9��L9��L9��L<��L<���L<���L<����<����<v�<v�<v�U<v�U<v��<v��<v�U�v�U�v�s�v�s����T���T��L<��L<���d���d��������������L9��L9��L<��L<��L9��L9������ĕL9ĕL9ß��ß��ßL<ßL<ß�L<ß�L<��L<������9ĕ�9'5����QL9��Q�j��Q�j�
�P��'L<'L<'�9'�9'���'���'���d'���d'���9'���9'���T'���T'��L<'��L<'�0�'�0�'�0�d'�0�d'�0�9'�0�9'�0�T'�0�T'�0L<'�0L<�L<�L<��9��9��T��T������������d����d����9����9����T����T���L<���L<��9��9�L<�L<�L<�L<��9��9������������d����d����9����9����T����T���L<���L<��g���g���g�d��g�d��g�9��g�9��g�T��g�T��gL<��gL<vL<vL<v�9v�9v�g�v�g�v�g�dv�g�dv�g�9v�g�9v�g�Tv�g�Tv�gL<v�gL<ĕ�dĕ�dĕL<ĕL<ĕ�9ĕ�9ĕ�Tĕ�T�>�&�>�&�>���>��ĕ��ĕ�� ���� ���> ����Dž ���?Dž �����	 ���?�	 �����& ���?�& ���� ���> ����Dž ���?Dž �����	 ���?�	 �����& ���?�& ��� ��> ���Dž ��?Dž ����	 ��?�	 ��� ��> ���Dž ��?Dž ����	 ��?�	 ��� ��> ���Dž ��?Dž ����	 ��?�	 ����& ��?�& ��� ��> ���Dž ��?Dž ����	 ��?�	 ����& ��?�& ��� ��> ���Dž ��?Dž ����	 ��?�	 ����& ��?�& ��� ��> ���Dž ��?Dž ����	 ��?�	 ����& ��?�& �{�� �{�> �{��Dž �{�?Dž �{���	 �{�?�	 �{�� �{�> �{��Dž �{�?Dž �{���	 �{�?�	 ��� ��> ���Dž ��?Dž ����	 ��?�	 ����& ��?�& ��> ��?Dž ��?�	 ��?�& �}�� �}�> �}��Dž �}�?Dž �}���	 �}�?�	 �}���& �}�?�& �}�� �}�> �}��Dž �}�?Dž �}���	 �}�?�	 �}���& �}�?�& ��Dž ���	 �Dž ��	 �Dž ��	 �Dž ��	 �{Dž �{�	 �Dž ��	 �}Dž �}�	 ������ ���?�� ����dž�� ���?dž�� �����
�� ���?�
�� �����'�� ���?�'�� ����� ���?� ����dž� ���?dž� �����
� ���?�
� �����'� ���?�'� ����� ��?�� ���dž�� ��?dž�� ����
�� ��?�
�� ����'�� ��?�'�� ���� ��?� ���dž� ��?dž� ����
� ��?�
� ����'� ��?�'� �}���� �}�?�� �}��dž�� �}�?dž�� �}���
�� �}�?�
�� �}���'�� �}�?�'�� �}��� �}�?� �}��dž� �}�?dž� �}���
� �}�?�
� �}���'� �}�?�'� ���� ���r ��dž�� ���� ���
�� ���& ���'�� ���� ���r ��Dž ���	 ��� �� � �� �& ��& �dž�� ��� ��
�� ��& ��'�� �Dž ��	 �Dž ��	 �� ��Dž ���	 ���& ��� ��r ��Dž ���	 ��& ���& ��� ��r �Dž ��	 �?Dž �?�	 �?�& ��� ��r ��Dž ���	 �K�� �K�> ��& ���& ��� ��r �Dž ��	 �K�> �Dž ��	 Dž �}dž�� �}�� �}�
�� �}�& �}�'�� �{Dž �{�	 �}Dž �}�	 �}� �	 �>���^���^��͔��͔ʔ͔�͔�͔�͔��͔ʼ͔��͔�P�;͔�P�;�$�P�;�|ޯN�
N��%���A���A���A盚4S�K4~�K2�>�>N5�>�>N�>���>N�>�-�>N24�>N54�>N4���>N4�-�>N�v4�v�ɱ�aL��cL������n�L�Z՚�Zޯ���
���X�T�ޯ��
����,͔�.�7�.�ʟ7�4�ɥ��Y��Y4��Yɥ��n�>޳�[�>N�>��[�>NҚN4�ZN���;��k�o�+�n������2/�>�I5/�>�I4�ON�O�ZN�Z�ON�<��YԳ7:k�:[�~���Y�i���$c�����1��7�.�A��;�?��NsL���Z��L���eL��cL���LN��=ɰS��۾
͔�	�|����L��Z��}ޯ���
���q̶���X�T���8��@���@�8	���	������(��_�O�_D�_��_��_��_��_��_��_b7�_��_�7�_2Ռ�_5Ռ�_�7̏�Ȍd̏f̏�̏�̏�̏�̏�̏�̏�̏b7̏�̏�7̏2Ռ̏5Ռ̏?̏ȄH̏��̏У̏�̏�P̏�݈̏̏�7̏�̏�P̏���k7�7�.7���7�77�7��7�7�l7�7�S��7�7�l7�F7�7��7��:7�7�G7��7�Q7�47�-��7̀7�7�G�l7��77�u7�<7у7��7��7&2�9&5�9&�S�L�&ζS�L�&�A=9&��=9&2=9&5=9&��&����&�A��&s�9&��9&���&���^&���&���&25=9&��К&���&����kɴ&�ZͲ�&4S���&�Ki&ɥ�=&�>�(9&k=�&�4Ͳ�&[����&k����&2=<&5=<&��9�֟����̙������*�%�Li�p֟���G�m�З���ݑ꾑�������Ԑ�Ԑ�c�ܑD��D�����dJ�Pi���7׌7͢Ҧ�h�������ӧ���������ˀ�f�QN�"7��u7�e��Þ�&7֔7�֔7��Þ� ��7�U7��p�����i�E�E��1��1�݈�H�i��i�i�fi�=͠��ӧ��7�������^���^�������6�r�-꾣-��Y-��-Ĕ��)����)����)E��)D��)����K��o�.7����1$��͠�ٿa�C�ٿaح�ٿa��ٿaʸ�ٿcʵ�ٿa��ٿc��ٿs��ٿ���ٿa��ٿ�e��ٿa��ٿs��ٿ�e��ٿ�G��׍d��׎d��׎f��׎���׎���׎���׎���׎���׎���׎���׎���׎���׎����׎���׎a�9��׎�e�9��׎a���׎d��׎f��׎���׎���׎���׎���׎���׎���׎���׎���׎���׎����׎���׎a�9��׎�e�9��׎a���׎aʟ������׎�e���׎����׎�Ya�9�Y����׎�����׎��K��׎뒪��׎a�:��ٿ�Pʵ�f��k3�3[3��3253|�3��Y3��E3͟�E3͟�Y3k=j[=jk�{3[�{3kc�3�c�3[c�3��c�3k=ˇ[=ˇk=���=��[=����=��|�=�Bk=z[=zk=��[=��25�{325=j���3�=�Dޮ�=�D���=�Dޮ��=�D�[=�f����=�fޮ�A���l3�����l3��Y=���k=��P[=���A��3���3k���k�����������ޮ[���[�������������ޮ[=k3�=kM��3k=[3k�������[��������k�[�[�k�k4=j254=j[4=jk43�43[43��432543|�43��Y43��E43͟�E43͟�Y43kɥ3[ɥ3k�W3[�W3�=4j��=4jk�@3��@3[�@3���@3k=��[=��k;3�;3[;3��;3�;=���;=�x�R�;=�x�S盚�;=�x�SS��;43�;4=�x�R[;=��Ŕ��Y=��e͟�E=��e|�;35=���=kM�3s[��k=Sj[=Sj25=Sjk=4Sj[=4Sj25=4Sjk�Z3[�Z325�Z3$���Մ�|���U�����V���L�K���֟��k�֟�֟��ۨ����ۨ��ۨ��M��6��6�l�6�r�7�7L�}�6��M����R��R��R/���%��������?5�Z�Z��Z��Z�9���=Ւ��Ւ���d��H��3�%4�%ɥ�%�}�%�T�%���%���%���}�%�A�}�%������L��]����U�R�Y�T����P�@�z����T��T��������������������g������������������I��ɥ�T����쥕�쥕�}�����S�������I���f֟�fM�I���������W������^��쪕���մ�����������M����������쥕ތ�I���^�I��ތ���^��ތ������^�����ڇދڇ�]���쥕�ދ��]�gތ����g�^���ތ�I쥕�^�I쥕�gތ�쥕�g�^�쥕ތ�I�]�^�Iދ�gތ��]�g�^�ދ�#̅�$�I��̆�I���$�I쥕̆�I쥕���&��̇̎֟�^֟�'̎֟�'�^֟̎M�I���^M�I���g'̎M����g'�^M���̎M����^M����s�t�u�t�3/�f֟/�?֟/�fM�I��/�?M�I��/�}/�.�}.�.�L.�6�.L�R.��R.���R.�.�Ag�}g�g�LgL�R5˓2˓�˓|˓����Ɏ�ɥS�P5�4S�P45������Ɏ����j4S�P45��$�@҈̆�@҈�̜֟���̛�̜M�I�����̜�I���?֟�f֟�z�\���"ĵ���5�[��5ɴ�6��d�6��H�6��6�3��RL�R��R�6�L�G2����h�5����h�2�h�5�h��Y�U����H���d4̍4�]4�4�3ԛ�Ւ�ތ��^��0ڇދ�0ڇ�]ތ���I�]�^���Iދ���Iދ���I�]���I�#���I̅���'�I���̈�I��/�fM�I���/�?M�I��/�fM�I���/�?M�I���ތ���쥕�^���쥕�$���쥕̆���쥕��̜֟�����̛��̜M�I�������̜�I�S��=��|5��5���M��j�MS�P����M�j�MS�P����M�j�ML9�M��M��M�>�Mc�̷���j�S�P����M�j�S�P����M�j����ß��{ۧ�7�3�W|�ه�����w�K2�-5�-2�E5�E�U5�?�U2�?��5�?��2�?�Y�7/����zЃ�"ҧ�O�D��^ԕM�!7��7Ł�Y��2�e��5�e�U2�e�U5�e���%�U��%����|���c�D�K���������W'Ҥ�F�޳�[���[�����޸����������q�h�@��g���Z�Y�(����(���U�^�(���_�(���_�=�(���_�(���_�t�(���_�(�����(����t�(�����(������(���_��(���_���(���_ދ�(���_�]�(��knj�(��[nj�(���_k3�(���_[3�(����(���˔�>�(������(���_��n�(���_��(���˔�t�(���nj�(���_�3�(��|˔��(������(���_|�n�(���_��(��|˔�t�(����nj�(���_��3�(���=�>�(�����>�(����>�(���u�>�(����>�(��|���t�(���=�^�(�����(���_�(��|˔�(�����(����(���u�(����(�������(��2����(���U�(���^�(���(�����T�(����(�����T�(���j�>�(���_��(���_�N�(����o�T�(��|�o�T�(����(���J�(���|�(�����>�(����>�(����>�(���}�>�(������fN5�[���3Σ��F��iS�Lp��+i�~�<i�M�<i��i�i;/�%S�K��i�~�i�ii.�P�.ɵ��!��3�:i��i�i�[�i�[�bi�xi�wi�V��fͷi�(���^���[�i����L���Лi��Лi2Ս�!z2Ս�M2Ս��z5Ս�!z5Ս�M5Ս��z2/�>�!�e2/�>�M2/�>���e5/�>�!�e5/�>�M5/�>���e2��>�!z2��>p��2��>��z��>�M5��>�!z5��>p��5��>��z�&�M��L�M�!2�I��5��>Є�!5�I��2��>Є�s���s�T��/��U/��U/�>��/�,�T2So�K5So�K�Ю�J�Ю�I�Ю�H�Ю�G���S������S�U����S����������|�����Sɴ�����ɴ���|�ɴ���S�z������z���|��z��������|����S��޸���S�U޸/�%�^i�iS�L�Mۉ�/ۉ�εۉζ��ۉ�cΧۉcΨ��ۉcΨ�}ۉɡۉ�ۉ�5�I�U����Ռ�UՌ�����U���������U����;��������P�������Qi:�4ɴ:޳4ɴ:�#4ɴ:��4ɴ:�4ɵS�:޳4ɵS�:�ɵ4S��������M���Z�<��:۾޳ɴ:۾�ɴ:۾�#ɴ:۾��ɴ4S�:/$��:�$Ҩ�;i�;�vi�;�xi�;��iֲ�Di$ג$�M�$�M��$��M��$��M��$��$�$��$��$�˕$�L�$S˕$��$�f�]$���"$���V$�<�B�$��yd$��yf$��y�$��y�$�h�$���$��M��~$��$��M۽$̋$�$��Z$�T�Z$ҩ�Z$�2�Z$͔$���i��F$�O$���f$̌�f֮z֮�֮�֮��֮��֮�N�k֮�:�U�֮�qM�e֮�A֮��א֮4��.d.f.�.�.�.�.�.�.�.�.�.��.ʳ.�.�.�.�D.�.ذ.��wdwfw�w�w�w�w�w�w�w�w�w��wʳw�w�w�w�Dw�wذw��a����c����s����������e����������G���������س��������������������ʴ��������������������E���������ر����������w?w�pw��w��wEw�1w�w�wDw��w�Pw�w݈w�7wHw�wӧw�w�Pw��wBw��w��w��wĔwÞ.?.�p.��.��.E.�1.�.�.D.��.�P.�.݈.�7.H.�.ӧ.�.�P.��.B.��.��.��.Ĕ.Þ.?.�p.��.��.E.�1.�.�.D.��.�P.�.݈.�7.H.�.ӧ.�.�P.��.B.��.��.��.Ĕ.Þ.�O�h.��h.���h.ʳ�h.��h.��h.��h.�D�h.��h.ذ�h.��4.d4.f4.�4.�4.�4.�4.�4.�4.�4.��h.�Oo���o�U�o���do�U�do��ɥ�B�o�Uɥ�B�o��ɥ�B�do�Uɥ�B�do���Z�B�o�U�Z�B�o���Z�B�do�U�Z�B�do����o���5�xo��U5�_o�U��o���޸o���2�xo��U2�_o�U�޸o��|�o�|�5�xo�|U5�_o�U|�o��|޸o�|�2�xo�|U2�_o�U|޸o��S�o�S�5�xo�|U5��_o��U5|�_o�SU5�_o���5|�xo�|�5��xo�US�o��S޸o�S�2�xo�|U2��_o��U2|�_o�SU2�_o���2|�xo�|�2��xo�US޸o����o�2U5��_o�5U2��_o�����xo��U��_o�5�2��xo�2�5��xo�U��o��|�o�2U5|�_o�5U2|�_o�|���xo�|U��_o�5�2|�xo�2�5|�xo�U|�o��S�o�2U5S�_o�5U2S�_o�S���xo�|U���_o��U|��_o�SU��_o�2|U5��_o�5|U2��_o�2�U5|�_o�5�U2|�_o���|��xo�|����xo�5�2S�xo�2�5S�xo�US�o��4�B�o�U4�B�o��4�B�do�U4�B�do�4�o�4�do���>5�o��45�=o�4��o���>2�o��42�=o�4�޸o�|�>5�o�|45�=o�4|�o�|�>2�o�|42�=o�4|޸o�S�>5�o�S45�=o�4S�o�S�>2�o�S42�=o�4S޸o���>��o��4��=o�4��o�|�>��o�|4��=o�4|�o�S�>��o�S4��=o�4S�o������o�����޸o����|޸o����|�o����!5���޸o����!2����o����=o��޸o���$o���o����o�U޸o�U�$o�U�o�U��o��2U�o��|U��o�U2��o�U|����!��~��a��~��a�X�~��s��~�˝�~���e��~��s�V�~���G��~��~2�G��~2s�V�~2�e��~2��~2s��~2a�X�~2a��~5��~��'۾�'�G�'�!a��~5a��~�\��޸�\����\�!޸�\�!2��2����\�!2����\�!2�!5��޸�\�!2�!5����\�!��\�!5��޸�\�!5��2���:�^;�^;/ѹ�d;/�:�^/��/S�/�7�8�/�!2���5�/�!5���2�/��8�:�^;�^:ң;ң:Sң;Sң:Ր;Ր:�#ɴ;�#ɴ:�#ɴ;�#ɴ:�ɴ;�ɴ:�ɴ;�ɴ:��l;��l:��ɴ;��ɴ:��ɴ;��ɴ:޳ɴ;޳ɴ:޳ɴ;޳ɴ:޳�l;޳�l:�;�;��:��n��;����S�:��2����5�����˝����!�����!5�\��������!2�\��2�:�5�:����;��!��;��˝�;��!2�\���!5�\����5�\����2�\���!���˝�:��5ɴ:��2ɴ:�!2ɴ:�!5ɴ;�/2���/5���/�!2��/��5��;/S���K;�#ɵ��#ɵ2����#ɵ5������;/�!2�[;/��2�[;/��5�[;/�!5�[;��!2�[;���2�[;���5�[;��!5�[�!2ɴ�!5ɴ��2ɴ;۾�^:۾�^;۾�^:۾�^��5ɴ:�pҼ���L���:�;��\ʉ�o���*���*��N:�!;�!�c�F�co�e�co�����M�����`��;ο��:ο����Y���B��:2�k�H:5�k�H;2�k�H;|�k�H;5�k�H;��k�H��<�V7��7��7���O�8�=�L�J�>M���>M���G��i������g�[i�
�_ɪ$�zɪ$�ɪ$�vɪ$ʊɪ$�2ɪ$�ɪ$کɪ$�H�NM�;����;����:����;�pҼ�q�Xڽ���Xڽ۞�7�H�C7�_���^�y���W�#��ޒ��jН��x�Ԡ;�S�I;�S�P;�S��;�S��;�S�;�S�g:�S�I:�S�P:�S��:�S��:�S�:�S�g:͒�|;��|;��|:��|;͒�|:��|:��|;��|�`�c�X�
��
�������Y�S7�Y��7�Y�
7�Y���=�E���=�.ҟiҟ$��Ԍҟ$��Ԍҟ$��Ԍҟ$��Ԍҟ$�Ԍҟ$ȿԌҟ$ȽԌҟ$� �:�.ҟiҠբiՃբi�%բ7�Li������������������;�L�;�c�:�;L�:�c;���$�_��$��r$�_�_�r$ފ��r$ފ�_�r$�_�;�]:�]����f�;�/�M��Я���>�-�M�^��i�N�;�s�F�v�s�F�v޸Ŋ7���7���7���C7���C7�C�7�C��7�C���C�7S�C��7��C��7۾;�۾:�۾;��i�4i�+Ղi�����V����e�-�8:ھ�Y�=�f�F�O;�g�Ag�;���>;���I:���>:���I���%���p������:��ʋ���٣;ο�ԣ:ο��;��W�^�7���Q�t�Q��u���h;�=.�7���3����o2�q��:��2�q��;��2�q��:2��۝;2��۝����7U;��ɴ2����g������W;��W:�^:ɐ�d2���d2���$�U���c�9�6���6޵��6��6:�>�x����Μ��^� ��.�%�E�.��,$�^ک�M�x�U��^�W���/��d������g���Ui��ai������x:�^;�^�p:��:�С�!��С:С���С;С;U�fN�"�7�h��������j����� �������5�@�@�!5�@;��:��fNU�fN�v��U�v��c��U�c��� �=U �=��%�=U��%�=�=�%;�=��=�@�=�M�:��5����d��U��d����:��m�;��m�͍���;�.;���%:�:�%;��:�U�:�Ԫ��%;�U����%����n����m:���mԪ���m:���mҡ:�U��mҡ:����m:���m���5����%�5��U�5����:;�A:�A;�A���:�A.��%��m�U�5Ԫ�����eɭ��U�O��͏U͏�d����5���U��5����>N�%;��hg�>N��5��;�^�!5��;�^��5�%;�^�!5�%;�^:�Ou�;;�Ou�;;�Zu�;:��;��U�Zui�S�۾S�US�U�>���>u�;U�>��>u�;U4���>u�;U4��>u�;U~�>��>u�;U~4��>u�;�
��՚�;U�Zu�;U��Zu�;U:�~��U:���B�~���B��۾2Ս�;۾5Ս�;۾�O2Ս�;۾�O5Ս�;۾޳�[�>�;۾��[�>�;U޳�[�>u�;U��[�>u�;U޳�[�>�;U��[�>�;�2����>�;�5����>�;۾2��>�;۾5��>�;�]�h.d�]�h.f�]�h.��]�h.��]�h.��]�h.��]�h.��]�h.��]�h.��]�h.��].-d�].-f�].-��].-��].-��].-��].-��].-��].-��].-��]�h.-d�]�h.-f�]�h.-��]�h.-��]�h.-��]�h.-��]�h.-��]�h.-��]�h.-��]�h.-�U�=[3Ub7U�7U�67U͟�E3U[3U��E3���o[3UѺ[3ɳ[3Uɳ[3�@ɳ[3U�@ɳ[3:[3ʚ��[��ʚ�S[��:[��U:�
��[3U:�
�[3�[:[3U�:[3�;[3޲;[3���%;[3���%;[3U���;[3U�!�;[3����;[3�����!�;[3.U;[3�H[3��͟�E3��[3����E3U��͟�E3U��[3U����E3�7[3U�6[3�c[3U�c[3�W[34���s�g�Z;ɵ�;ɴ� �̍��]2�O�{��5�O�{���IL�)�ZͲ�"̍�^�"ͱS�P�j
��5
���g��dg��H;��#���M�U���5�f��!2�f�2� �5� ���� ���|˓��˓254�25˓2�z�5˓�2˓|˔�9���<����|;��;��k�o;��[�o;/k�o;/[�o
2;/�
5;/�
2�[�
5�[�
24�[�
54�[�
2;����
5;����
2�OՌ
5�OՌ��Z3���Z3�A�U�3���U�35=.�}�k3�[3�253�k43�[43�2543�k=�뚵[=�뚵k4=�뚵[4=�뚵[�W3@A��@A�@A�y@A�@A�9@A�@A�x@A�@A�@A�@A�X@A��@A�8@A�@A�w@A�@A�	@A�@A�H@A��@A�(@A�@A�g@A��@A�@A�@A�W@A��@A�7@A�@A�v@A�@A�@A�@A�@@A�@A� @A�@A�_@A��@A�@A�@A�O@A��@A�/@A�@A�n@A��@A�@A�@A�G@A��@A�'@A�@A�f@A��@A�@A�@A�V@A��@A�6@A�@A�u@A��@A�@A�|@A�<@A�@A�@A�@A�[@A��@A�@A�@A�K@A��@A�+@A�@A�j@A��@A�@A�@A�C@A��@A�#@A�@A�b@A��@A�@A�@A�R@A��@A�2@A�@A�q@A��@A�@A�@A�?@A�@A�@A�@A�^@A��@A�@A�@A�N@A��@A�.@A�@A�m@A��@A�@A�@A�F@A��@A�&@A�@A�e@A��@A�@A�@A�U@A��@A�5@A�@A�t@A��@A�@A�z@A�:@A�@A�@A�@A�Y@A��@A�
@A�@A�I@A��@A�)@A�@A�h@A��@A�@A�@A�A@A�@A�!@A�@A�`@A��@A�@A�@A�P@A��@A�0@A�@A�o@A��@A�@A�}@A�=@A�@A�@A�@A�\@A��@A�
@A�@A�L@A��@A�,@A�@A�k@A��@A�@A�@A�D@A��@A�$@A�@A�c@A��@A�@A�@A�S@A��@A�3@A�@A�r@A��@A�@A�{@A�;@A�@A�@A�@A�Z@A��@A�@A�@A�J@A��@A�*@A�@A�i@A��@A�@A�@A�B@A�@A�"@A�@A�a@A��@A�@A�@A�Q@A��@A�1@A�@A�p@A��@A�@A�~@A�>@A�@A�@A�@A�]@A��@A�@A�@A�M@A��@A�-@A�@A�l@A��@A�@A�@A�E@A��@A�%@A�@A�d@A��@A�@A�@A�T@A��@A�4@A�@A�s@A��[��=Sj[��=4Sjk4=Sj[4=Sj254=Sj[��=��k4=��[4=����=�j�=�j�ɥ3��ɥ3k4�B3[4�B3kɥ�B3[ɥ�B3[��ɥ�B3[=����=����=��[=ˈSj[=ˈ4Sj[��=ˇ[��=ˈSj[��=ˈ4Sjk��[��k4��[4��k=�:�[=�:�k=��P�:�[=��P�:�Y͟�E3��E͟�Y3��Y=z��E=z͟�E=z͟�Y=z��Y=��E3��E=͟�E3͟�E=͟�Y3͟�Y=��Y3���7�������7��͟�E=�7��E3��E=�7͟�E3����7��E3���7͟�E3��E=�7��Y3��Y=�7��E3�{=�k�S�=�k[����=�k[�����=�k�����ޮ=�k�����������3ޱ���A3��A3�U���A3����=���A=�}��5�k��3��2�k�A3�A���3�����3[=Zζk3k=Zζ[3ζ[=Zk3[=b<k=b<[=ʑ��25=ʑ����=���2�|5���2��5�|�|�5��2�|�2��5�2�|5�|�|�5��5�2��5���|�2��2�k��|��[��|�����5������5��k�����[��������2������2��k��|��[��|�����5������5��k�����[��������2������2��k��|Zk�������2������[��|Z[��������2�������k��|Z[���$k���Z[����[��|Zk���$[���Zk����k��|Z��Ak������A[��|Z��A[������A���2�����������2������54=ѹ��Z[3�U�SZ[3k=Z�U�R[=Z�U�R[=Z����ތZk3k=ʑދ�^Z[3̎Z[3k=ʑ̍�^Zk32�pˇ5�pˇ|�pˇ��pˇɥS�P��ß��iß����2;��5;��2;Ռ5;Ռß�2�f�ß�5�f�ß�2���ß�5���2/�>�>5/�>�>2/�>�p�W���e5/�>�p�W�U�e2/�>�p�W�U�e5/�>�p�W���e2�[�>�5�[�>�2��ތ�5���^�42���^�45��ތ�2:����5:������S��K��[�U޸5�[DŽ�^��5�[�[�Q�)�
�Z��[�U޸��[�U�$��Z�Y�Z�[�>�Y�[�>ֶ�[�U�$ֶ�[�U����[������W=�k|���[������W=�k|޸��[������W=�k����[������W=�k�޸��[������W=�k5�$��[������W=�k2�$��[������W=�k5����[������W=�k2���Y���L���M����M�9���M5=9���M2=9�盚.S�.Ց.�Zͱ.� ��<���P���<��S���`��.�?�67|=ʑ�.;�.�.ދ.�]�������c�̸����g���g����g��g�g�^c�~�\ɵL9ɵ�>�Q�Wɴɵ�T���T5ɵZ2ɴ2ɵ��S�S�P��5ɴ�H2����H5���:�G2���5���;�Y:�Y2�8�5�8�24�8�54�8��O�?�l�?�@�jS����z/�|��L��ΐ���Ց��Ւ�U9���Ց������ɵ2�����ɵ5���:��3:��;��3:��3�;�^�:�^�;��:��;��:��{�ZͲ�RͲ��ZͲ�j��ͱ���Zͱ4�}ɥ�}޳�
�[���
�[��E�
�6.L�R�6.b�R�6.�R�6�4�S��6�4�S�}�6/��R�6/�4�Rc��Rc��I�R�6�R��c�u�s�%�Z�&�R�yՆ�%�&4j�&�������A�#�L�$Ң�q���e�L�$�k�q���e�L�$��Q���e�&��'�o�R�T�&�R�&k=z�&7�&��&�3�&��&�>���2ɵ�Rß�Щ�ß�ЩԦß�Щ�b�9b��9b�U9bL<b�U<b̏fb:ɴ��9�L<�������b�W2��b�W5���u�I�>��vL9�v�>�h��U������v�W2���v�W5��.�v���v�W4�.�67b�Wɴ��Wɴ�v�Wɴ� ��� �ß�҇�y�I�l���4�7�4������d�4��H�4Z��Z�3�4Z�PZ��Z�PZ�3�4���~�3����~����4�S����S4/�4/�3���4�T����L9��IL94��d4��Hc���dc���H�����H����d��I���d�p����Ip�����A��I��A�4���>�4�>�r�>��I4���I4�>ß���7ß���7�L<�L9ɥ�P4Sjɥ�PɥSj�U�SL9�U�S���G��F�L9������������I���Zb7bZ�7�Z�U�R4��c���Us���U�c�Zc�<���9ތ��)�^��)ތ�Ou9�^�Ou9ތ�I����^�I���ތ�I���L�)�^�I���L�)ތ�I���L9�^�I���L9ތ�I���LZ��^�I���LZ޸ތ�I��^�I�ތ�<����^�<���ތ���^��ތZ��Z�]�^Z��ZދތZ�G�I��^Z�G�I�ތZ�GZ�]�^Z�GZދތZ�^Z����^ZތZ���ތZ��Z�^Z���^Z��ZތZ������Iދ����I�]����IތL�)����I�^L�)����Iދ����I�]������Iދ������I�]�G�Iދ�G�I�]�GZތZ�7�GZ�^Z�74�Zދ4�Z�]4�Zތ�>�^�ދ�^��ދތ�����^����ތ����Z���^����Z���������������I�������I�����9�$Z�<�7̆Z�<�7�$Z�<���̆Z�<����$Z�7̆Z�7�$Z���̆Z����$Z����̆Z�����$Z�����̆Z�����4�#4̅̎��^�̎b<�^b<̎�v<�^�v<̎M�I��L9�^M�I��L9̎MZ�7�^MZ�7̎MZ�U�R�^MZ�U�R̎MZ�����^MZ����̎MZ����^MZ���/2�o�R/5�o�R��̍���]��̎�I�����^�I��̎Z�]�^Z̍̎Z̍�^Z�]�^��̍�^���~���B̍�M�U��Ԝ�1�������"ζ2˓ζ�˓ζ|˓�!�PS�Pɥ5�4S�P2�S�P42�4S�P42���B��2۩M4�dζ�˔�ζ|˔�>ζ|˔Zζ�˓4�˓4|˓4���7�Y4���7���>�Y�i�S�L�9S�L�<�˔�<Ւ�jՒ�U�RɥS�P��҈ɥS�P�jɥ��Rɥ�Zދɥ�Z�]���ތ�I������^�I��ɥͲ��҈��ɥS�P�R4Ͳ�R;S��6;S���E;3��Y;3͟�E;3͟�Y;325;3k:3�:3��:3��E:3��Y:3͟�E:3͟�Y:325:3|�:3[=�D��[=�D�k=�D��k=�D�/��/�U���/�!5��/��2���2����5��������U�����^:���^;���^:�0�^;�0�^:�7;�7;�U:�U�:�U:���:۾�;۾�:۾��;۾��:�:��;��:��;��:S�;S�2=�sk��2=.�}�k�W3k��=Sjk��=4Sjk��=��k��ɥ�B3k=���k=ˈSjk=ˈ4Sjk��=ˇk��=ˈSjk��=ˈ4Sjk=ʑ���{=�k�S޸�Zk3�Z�U�SZk3k=Z�Z����[=ʑ�][=ʑ�]k�Z3[�Z3�Z�U�SZ[3[=Z�Z�����U�SZk3k=Z����k=Z�Z�U�R[=Z�Z�U�R��ɳ�3ζ��3ζ��͟3;۾�:�;�:��7;��7U���U���)U���)U�U.����=���͟=�ˇ��=�ˇ��͟=�ˇ��=�k���ѭ�Dζ��=�k���ѭ�Dkɳ3�ɳ3[ɳ3��ɳ325ɳ3|�ɳ3��Yɳ3��Eɳ3͟�Eɳ3͟�Yɳ3kɳ�@3�ɳ�@3[ɳ�@3��ɳ�@3��ɳ��3�Aɳ��3kɳ=���ɳ=��[ɳ=����ɳ=����Yɳ=����Eɳ=��͟�Eɳ=��͟�Yɳ=��kɳ=4�j�ɳ=4�j[ɳ=4�j��ɳ=4�j�˛�S˛�kɳ=[ɳ3�ɳ=kM��ɳ3[ɳ=kɳ3��ɳ=kM�ɳ3kɳ����ɳ���[ɳ�����ɳ���k:.;3�:.;3[:.;3��:.;3�Aɳ5ȧ3�Aɳ�Uȧ3�Aɳ2ȧ3�Aɳ��ȧ3�^޸�^��P޸�P���f���@[:3ʚ��k��ʚ����ʚ��[��ʚ޴����:k��:���:[��:������ɳ=��Dޮ��ɳ=��D��ɳ=��Dޮ�ɳ=��D�kɳ=��D�[ɳ=��D�kɳ=��D��[ɳ=��D��:�
��k3:�
��[3:�
�k3:�
�[3:�
k�3:�
[�3:�
k��3:�
[��3�?=�޸�?=���?=|޸�?=|��?=2�$�?=5�$�?=2���?=5���;=��P盚|���W'Ҥ�F�;�\�;:�\�:�\�co���.��.��:/�":�"�:�7�:֭:֭:۾�#ɵ�":۾��ɵ�":۾޳ɵ�":۾�ɵ�"�_�f��:�U�:���m:��¯��m:�;��m���;��m�/�O�D�B7�TN�z�f�z���z���z��������
���[;ھ�q:��x�=ɏ�ھ������M��"�����P2�:�5�:��2����5���k��=ɵ�����=ɵ��[��=ɵ������=ɵ����d��fЂ�g����g����g���C�g�����g���`�g�����@<�0i�\i��i�{i�Y5�Z�j�ki}�q}�	}�t}�}�}�&}�:}�}�T}��}T��}D}�,}�}�'}�;}��}�h}�h}�}��}�}�S}��}�[}�(}�\}Κ}�\}�$}�2}�/}�1}�R}�{�}��}ö}÷ˇ}�}�ö}��ö}���ö}�g}��}Ι}ɛ?}���;}�q}�	}�t}�}�}�&}�:}�}�T}��}T��}D}�,}�}�'}�;}��}�h}�h}�}��}�}�S}��}�[}�(}�\}Κ}�\}�$}�2}�/}�1}�R}�{�}��}ö}÷ˇ}�}�ö}��ö}���ö}�g}��}Ι}ɛ?}���;�d4��d4��dp�T�j� ˇ'j���j�������Q���Q��ß��ß����݉z�?�����5z��z��z�������˅����� ˇ�~��)�Ȅ��I���Q�?ˇß�?ˇX��X��X�X�X�^X�^X�gX�gX� X� XͤXͤX�`X�`X�X�X��X��X��X��X�X�X��X��X�NX�NX��X��X��X��XHXHX��X��X��X��X�JX�JX�YX�YX�rX�rX�X�X�|X�|X��X��X�`X�`X��X��X%X��X%X��X�,� X�,� X��X��X���X���X�,��X�,��X%X�`X%X�`X��X��X�;�X�;�X%X�X%X�X%X�X%X�X���X���X��X��X%X�X%X�X%X�X%X�X�c�X�c�X%X�pX%X�pX%X�X%X�X%X�YX%X�YX%X�/X%X�/X%X��X%X��X%י��X%י��X%י�X%י�X%י�YX%י�YX%י�|X%י�|X�X�O��X����X�X�Z��X�}��X���JX�,�X�,�X�,�YX�,�YX&��9X&�t��X&�tޔX�m�X�m�X%י����X%י�V�ONX%י�B�ONX%י�f�;X�a��X����Xڹ�;^�j^�]^�]^�^��^�^�R^�r^�V^�^��^�>^��^�w^՝^�F^��^��^�e^�H^�^�^��^Ӑ^��^�>^��^�^�^�^��^�^��^�^�:^�m^�^�^�^���h��h�}�h�|�h�r�h�p�h���k�h�k�h�z�h�w�h�y�h�x�h��h�t�h�i�h� �i�h�f�h�n�h���n�h� �n�h�m�hā�h�g�h� �g�h�\�h� �\�h��h�G�h���G�h� �G�h�e�h�d�h�a�h� �o�h� �_�h�]�h���h�Z�h�X�h�q�h� �q�h�v�q�h�W�h�U�h�V�h�T�h�S�h�{�h�Q�h�O�h�N�h�K�h�H�h�P�H�h�F�h�E�h��hI�HN�h�[N�hl�|#�#��#��#�#��#�s#�#�#�+#�H#�־#�
#�#�
#�#ʨ#�0#��#�t#��#��#��#��#�P#�"#�/#�O#�4#�5#�'#�P#�;#�=#�O#�M#�N#�<#��#��#��#��#��#��#��#�K#�>#�@#�J#�H#�I#�?#�,#�"#�(#�+#�)#�*#�'#�n#�f#�i#�m#�j#�k#�g#Ĥ#ė#ğ#ģ#ġ#Ģ#Ğ#�#�#�#�#�#�#�&(�	&(�v&(��&(�&(�A&(�X&(�&(�&(��&(��&(H&(�\&(�&(�&(�D&(�&(�k&(�g&(�2&(�&(�g&(�&(?&(�&(�-&(���W&(�T&(��&(�?&(�/ö&(��ö&(���ö5�[̊�5�[�̊�2̊�5̊�2�̊�5�̊��������������2�dz5�dz���^2���y�5���y��7�b՘�՘�Y�՘��ֹ��e��e���Z4ֶ�����9���U�92~Տ�5~Տ��UL9�UL<2S�P�I5S�P�I��2����5���U2���U5��2�`v�5�`v�24Ռ54Ռc�aL��aLc���g�L���eLN�Y�ONS�T��n�	�[p���������i�w2�F�w5�F��v��Ѕ7���Aʘ�A������S���8S�K�{4��Y�4���>N�B2�4�MN�~���~����9~��~���4���ͱɥ�vۿ�՗N���N�c�f�;,�w,��,Јd,Јf,Ј�,�,�F,˘,�d,�f,�8,Ќ,d,f,��d,��f,��,��,��,ʜ,��d,��f,�d,�f,��,��,�-,�o,ڽ,�,ڲ,��,ŀd,ŀf,�v,�id,�if,�E�ɿ�v,�S,�,��,�lM��,�C,�vd,�vf,�_,�L,���L,�Yd,�Yf,�Y�,�Y�,ۖ,�,��,�a,օ,�d,�f,��,ڸ,�hd,�hf,�h�,�f,��,�Yd,�Yf,��Ё,�E�f,�f,��̓,����,�%,��c,�EŖ,ŗd,ŗf,��,���,�d,�f,����,���J,ڭd,ڭf,��,�v,���k޾,���,���2,���7,�Bd,�Bf,�B�,���A,�,���b,�h,��,���o,���,����,�E�O,�E�=,����,���f,���f,����,����,����,����,�,���,���O,dO,�KO,�O,�O,ЇO,zO,fO,�hO,�>O,ީO,��O,�O,��FO,�VO,��O,˘O,��FO,�O,�:O,�O,�kO,5��FO,�;��O,�O,�8O,ЌO,��O,�O,��O,ڤO,��O,�HO,ШO,�O,���O,�eO,��O,�O,�BO,��O,�RO,��O,��O,�`O,�bO,کO,�O,�O,�nO,�	O,��O,ζʜO,���O,���O,c�O,μO,�MO,��O,�$O,��O,�~O,��O,�O,��O,�9O,��O,ЙO,�XO,�{O,�^O,�O,�oO,дO,ڽO,ɾO,�DO,��O,�O,�hO,��O,�O,��O,��O,�O,�O,�vO,��O,��O,4��O,�ɿ�vO,��O,��O,�SO,�O,�O,��O,ۭO,�SO,�:O,�bO,�O,�O,�lM��O,�fO,��O,�IO,�O,�KO,�CO,͆O,3O,��O,�uO,��O,�qO,�UO,�O,�_O,�<O,�LO,��O,�XO,�O,�O,օO,�dO,ԄO,�LO,�O,��O,�O,�pO,��O,ڸO,�O,�PO,�pO,��O,�O,�gO,�fO,�-O,�|O,ŗ��O,��O,�XO,ЁO,�fO,̓O,ǐO,�O,ԸO,�}O,��O,ҝO,�uO,�%O,�nO,�cO,��O,ںO,ŖO,��O,�.O,�CO,�O,�O,��O,�JO,ڬO,�O,ζˆ��O,��O,�vO,�O,��O,޾O,�k޾O,޺O,͡O,�O,�2O,�7O,�AO,�O,�O,�bO,�hO,�wO,��O,�O,�
�.O,�WO,��O,�oO,��O,��O,��O,�OO,�fO,�=O,�O,��O,��O,��O,ɢO,��O,��O,�O,�fO,��O,��O,�O,�:��2����Z�<��2�p���Z�p<�����Q���R��9���R��<���R��޸���R���!޸���R���!����R����޸����͔�������@N���A�i���N���N��O2�[�5�[�24�[�54�[�2�f�5�f�2;�f�5;�f�2:ޓ�5:ޓ��HN�
N2����5����2;ޓ�5;ޓ�2;����5;����2;/�5;/��{�A�Y4��>N4��>N~4��>N�Hu���׎d�׎f�׎��׎��׎��׎��׎��׎��׎��ހ�N���N��ʘN��˘N�>L�N4L�N�w�AS��xNS��x��͢NS��xu�!��S��x��͢u�!��S��xu����.�HN��$�L��[i�׎��׎���׎ʱS���N�NՆ�N�>�D���͔�?�?�D�D�B�B�E�E�H�H����{��e��߻��L��Ѽ�0���鐼���s��p��!�̬���Г��X��ȼ������z��(��(��ɼ�D���������߼׺��v��2���������G�����ܼ�K�����蓼�	��\���t��u����N�ڑ��ϼ�������ټ�ټ�������H�ь�ҷ���Ŧ�Ŧ��F��m��"��7��ܼ����&����͢N&���n͢N����͢N���n͢N���N�����N��o����4�G?G?GDGDGBGBGEGEGHGHG�G�{G�eG�G߻G�LG��G�0G�G�G�G�sG�pG�!G̬G�GГG�XG��G�G�G�G�zG�G�(G�(G��G�DG�G�G�G�G��G׺G�vG�2G�G��G�G�GG��G��G�KG�G��G�G�	G�\G�G�tG�uG�G�NGڑG��G�G�G�G��G��G�G�G�G�HGьGҷG��GŦGŦG�FG�mG�"G�7G��G�G��GǘG�"G�vG�Gp����͢NG��NG����NG�o��^�p�^��^݈�^�1�^��^��^�7�^��^�^�P�^��^��^ӧ�^��^�K�^��^�4�^��^Þ�^��^�P�^?�^H�^E�^�(�^��^�!�^���^�'�^�j�^��^�a�^��^�^D�^B�^��^��^�I�^�^�y�^�L9�^�W�0�H�)�������a�=�6�1�.�'�"��(�4�8���E���4�B���L�G�zʿ���7?����v�E�8�EHŦŝ֤�B�[�m�F���t�D��F�������/��$�)��1�.�2���Ի�Ծ��Լ���-�+�#�(�2ծ�I�.�(�)��J�4�������������L�@N��L�ZN��LaN��LcN��LsN��L�N��L��N��LpN��L�UN��L�qN��LЈN��LʹN��L�N��L�{N��L�IN��L�?N�^��^�!�^�^�L�^�6�^��^�f�^�j�^��^�N�^�4�^�*�^�g�^�3�^���^���^�{�^��^�m�^�1�^0��^0��^0�P�^0��^��^�{�^���������R����������D���������T����������������R���������7������P�����͗����������Q�������-������:���`��ө����������9�����������ӧG߻G�pG̬G�G׺G�G�GG�KG�G�GڑG�G�HGьGҷG��w�0w��w�aw�6w�8w��w�4w�w�w�Gw�zwʿw��w�7w�1?w��?w�b?w�7?w�9?w��?w�5?w�?w�?w�H?w�{?w�?w�?w�8?w�Bw��֎w�龱�Kw�dw�fw濆w濈w濒w濧w濲w濫w濶w��w�ڽw��vw��w��w�ۏw��Hw��ow���w��w�ͽw���w�ͅw��w��w��Gw��qw��w�̲w��[w���w��gw��w��w��ew��pw�Ҳ.��N.��K.�Ц.���.��x:�^.���x:�^.ʲ�x:�^.��x:�^.��x:�^.��x:�^.�B�x:�^.��x:�^Ղ7.��d.��f.��.��.��.��.��.��.��.ʱ.ʲd.ʲf.ʲ�.ʲ�.ʲ�.�0.��.�a.�6.�8.��.�4.�.�.�G.�z.ʿ.��.�7.�1?.��?.�b?.�7?.�9?.��?.�5?.�?.�?.�H?.�{?.�?.�?.�8?.��.���j.�B���i.�d.�f.濆.濈.濒.濧.濲.濫.濶.��.�ڽ.��v.��.��.�ۏ.��H.��o.���.��.�ͽ.���.�ͅ.��.��.��G.�І.��B.��.��{.��^.��.��.���.��e.��k.��_.��0.�$.���.�޸.��.��.�҃.�̲.��[.���.��g.��.���.ʲ�.ʲ�.ʲ�.ʲ�.�.�d.�f.��.��.��.��.��.��.��.둏�$$�̏�$$뷏�$$���$$���$$���$$�g��$$�h��$$����$$�Y��$$֪��$$���$$�/�Q/�/�h�Q�l7.G?.GD.GB.GE.GH.G�.G�e.G߻.G��.G�.G�.G�p.G̬.GГ.G��.G�.G�z.G�(.G�D.G�.G�.G��.G׺.G�v.G�2.G�.G�G.G�K.G�.G�.G�.G�N.Gڑ.G��.G�.G�.G��.G�.G�.G�H.Gь.Gҷ.G��.GŦ.G�F.G�m.G�"/���ҋ/�-/��/�H/�}/�6/�/�'/�/�3/�i/�b/�/�/��/�N/�X/�/�/�e/�/�B/�A/�@/�?/�,/�+/ߖ/ߙ/��/��/��/�/��/�!/�_/�^/�/�/�/�
/��/�/��/��/��/��/��/Դ/Ե/��/�F/�A/��/�1/�m/�/�</�Z/�8/�J/��/�j/�Z/�/�\/�/�/�O/�K/�T/�/�0/�#/�
/�	/۴/۱/۵/Ā/�~/��/�/�/�k/�d/Ҁ/�}/�}��$$�\�O��$$�\d��$$�\f��$$�\���$$�\���$$�\���$$�\���$$�\���$$�\���$$�\���$$�\���$$�\��$$�\���$$�\ʳ��$$�\���$$�\땏�$$�\���$$�\�D��$$�\���$$�\ذ��$$�\���$$�\���$$�\�ޏ�$$�\���$$�\��/�S/�/��/�/�/�a/�/� �]/� �#/��/����n/�����/���˄/���۰/�a/��m/�/ڒ?/�/�/��/�/�B/��/��/�	/�K/ڒ�1/ڒ�/�w/�/�/�g/�P/��/�|/ڒ�/�/�)/�/�5/�X/ڒ݈/�/�/�/��]/��]/݉�]/��]/��#/��#/݉�#/��#/݉�P/݉�Q�]/�/��/ڗ/�v/��/���P/���Q�]/��/��/ڒ�P/ڔ/ӻ/�x/ڒ��/�O/ߋ/�P۴/Ӻ/�w/ڒ��/�I/߉/�J۴/�Q֓/݉֓/�{/�A/�Q/�:/���/�/�2/�/�/�T/�V/�%/��|/߽/�
/�	/�/ݘ/���/�"/��/�/�x/�5/�3/�T/�H/�o/��݈/'݈��$$�6d��$$�6f��$$�6���$$�6���$$�6���$$�6���$$�6���$$�6���$$�6���$$�6���$$�6��$$�6���$$�6ʳ��$$�6���$$�6땏�$$�6���$$�6�D��$$�6���$$�6ذ��$$�6���$$�6���$$�6�ޏ�$$�6���$$�6���$$�6���$$�6���$$�6���$$�6���$$�6���$$�6ʱ��$$�6ʯ/�i�T$���K�z�T$��ҫ�H�T$�z������T$���-�T$Ř�T$��T$����T$���T$�s�T$��T$�Z�T$�	�T$��T$�`�K�T$���T$���T$�.�T$��x����T$��T$��T$��ʐ�T$�t�T$�o�,�T$�]�T$�0�T$�`�s�T$ڥ�d�T$�`��T$����T$�����v�T$�>�T$��T$�`�T$�`�:�T$��T$�FM���_�T$�����T$�N�T$ֱ�T$���T$���T$�M�T$�3�T$��۷�T$�I��T$����T$�M�T$���]�T$�T�T$��W�T$���ʊ�T$������ک�T$��T$����P�T$��T$��Ő�T$����2�T$���p��T$�H�T$�R�T$�3�u�T$��T$����T$�������D��������|?�.�%�)�&�1�
H�]�_E�������������������8�0���Q�������Y�F�t�_���	�������������������������ԝԙ��ԩԺ�����t�f�գ�������D�8�u�W�ӽ��������ӫӪӯӮӬӭ���$��!� �#�"�*�)�-�+��������%�(�&�������
���ٶٵٻٷٸٺٹپٽ�ٿٲٱٴٳ٫٪ٯٮ٬٭٥٤٩٨٦٧����������������������������������������������������������N��*�<�:����+�k�j�n�lڴڙ�ڻۂ���W�Qڑ�g�`�e�:�9�?�<�h�b��x���������3� ���������������������"������~�yǘNj��������&�j�������������������������A�3��\����=�7��Q�������������������9�1�z�C�i�k�j�^�O��i��������������D�
���(�
��
�
�������"�!�)�#�������	���������ىوًٌٍِٟٙ٘ٚفـهقّٕٗ�y�x�~�|�z�{������������������������������������������بئ��ث�����������ׂׄ׃���2��M�v�`�}�y׺ׁ�׀����
������������
�	����������������3�+�m�=�d�c�g�e�������ݩݨݫݪ��������~��ސݣݡݿݧݥݦݍ݌ݗݐݎݏ���������K�F�{�V�1�0�3�2�y�w�����0��&�%�L�/�'�.�7�2�e�E�R�V�T������ߞߣߠ������������ߑߍ߻ߝߕߚ���������
����������������������������a�b�t�s�v�u�X�Z�Y�]�\�_�^�c�e�d�T�S�[�W�U�V���������!� �#�"��
�������������=�;�G�@�������������4�:�6��1�:�����3�2�5�4�_�V���V��bł�sŦō��������"�
�S�m�Z���!�����a�^�s�e��������L�X�Q�����������������������������
�	�\�T���}����]�Q��p��9����)�������������������������������������������������������������������������)�(�.�*�+�-�,�3�2�6�5�"�#�&�'�/�1��%�!�����������p�"�\�_�]��з����e�g�f͚ͥ��ͩ�?Г�]�L�I̬�d�P�X�����,�������)�(�/�*�,�.�-�8�6�P�9�$�#�'�%�2�5�3� ��"�!�������E�D�J�G�0�2�1�5�4�9�6�>�=�A�?�,�+�3�/�-�.�$�#�(�'�%�&�m�i�������)�(�1�,�P�N�g�X������
�����ѱѵџѠѤѣѧѥѫѪѰѬћљѡўќѝєѓјїѕі����������������������������������������	��2�΋΍ΌΦΡ��κ�������·΄ΗΊΈΉ�s�r�y�v�t�u�������n�p�o��ѷ�����Rҷ�|�f�cь�m�i�j�T�S�Y�W�U�V���������b�a�d�c�t�r��v�[�Y�n�`�]�^�S�R�W�V�T�U�q�o�y�r�v�u�x�w�?�<�A�@�d�c�m�g�7�3�a�;�9�:�#�!�-�&�$�%�������������������������؍،ؔ؎ؐ؏ؓؑ؂؃؈؇؋؉�}؆؁�~��x�w�|�{�y�z�L�K�Y�P�U�T�W�V�=�?�>�D�C�I�E�;�9�B�<Ļĺ��ĽĿľ��įİĴijĹķĘĖĥěęĚ�	���
����þý�ÿ�������õñ��üøùáàèäâã,�d,�m,�7,�P,��,�/,�,�,�N,�,ݏ,�,ڻ,�,�,�,�^,�{,�,��,�,��,�,�E,�(,�],�,�,ӫ,��,�	,��,�y,�j,�s,�,�!,�,�y,�,�",��,Ή,�g,�,�,�,�,�	,�,κ,�g,��,ٺ,���4���4��4��4��4��4���4�{�4��4��4���4���4��4��4�q�4�g�4��4��4��4��4�J�4�s�4�G�4��4���4�P�4���4Ŧ�4�2�4��4���4?�4���4E�4�t�4D�4H�4B�4�c�4�\�4֤�4��>�z�4���u�4��>��4��>�t�4��>��4��>��4����4������6�66�26�v6�b6�a6�O6��6��6��6��6�n6�=6�6�q6�06��6�6�6޼6қ6��6ٖ6Ё6�6�U6�@6�16�6؛6�B6��6�,6�(6ۼ6�k6�a6D6�V6�G6�)6�F6�46��6��6��6��6��6�k6�96�6�"6�z6��6�6�6�m6�H6�6ِ6�p6��6�!6�<6�6�6ؔ6�6�e6�$6�6�N6��6�Y6?6�j6�B6�6��6Ŧ6Œ6�6��6��6��6��6��6�r6�A6��6ǘ6�6��6�6�6�6�6�6ٟ6�6�26�s6�J6��6��6ؤ6�6�6�6�26�{6�6�6�m6�f6�a6�6�6�6�[6��6�g6��6��6�g6�56�(6��6�6ʤ6�6�6��6��6�6ك6ͫ6ξ6�6�76�u6�w6؊6��6��6�"6�6��6�!6�F6B6�H6�K6�;6��6��6��6��6�6��6��6�f6�46��6��6�(6ʎ6�6�6ݿ6ь6��6�~6̬6Η6�6�36�)6�n6؆6��6߻6�!6�L6ڑ6׺6�B6H6�w6�6�6�6�"6�6�u6��6�t6��6��6�i6�76�66�36�6�6ʩ6�6�6�6��6�6ه6��6��6�6�96�6�6؋6�6�6�#6�6�6�26�I6E6��6�76�6�e6�m6�\6�\6��6�	6��6��6��6�o6�>6�<6�6�v6�D6��6�6�6��6ҷ6�6ٗ6Г6�6�X6�A6�96�6؝6�E6��6�-6�)6�06�"6��6�v6�b6�I6ޖ6�6����6�ON6ن��6ن�6نͫ6�6��6�H6ؾ6�W6��6ˢ6�V6�6ߤ6�6�6�x6�O6d6f6�6�6�6�6�6�6�6ن�6ن�(�S(�S(�(�(�Y�(�Y�(�(�(�-(�-(���W(���W(�#�|(�#�|(�U�3(�U�3(�0���3(�0���3(��T(��T(�Y��(�Y��(�?(�?(���/ö(���/ö(��ö(��ö(����/ö(����/ö(�(�(�Y�k(�Y�k(ͺ�(ͺ�(ͺ�(ͺ�(ͺ��(ͺ��(��H(��H(��H(��H(4��H(4��H(�yH&(��&(��7&(�:�7&(ʟ�7���&(�T�&(D&(�&(B&(�7&(�/&(ͺ7&(�|&(��&(�c(��(�c(�(�(�(�(�)(�)(�I(�I(�(�(�Epz(�Epz(��(��(�R(�R(�W(�W(�J(�J(�((�((�(�(4H(4H(�;H(�;HI(�7I(ͺ7&(�/&(�E?�B߻�6қˑH�YD���	�9޻ۻˢٝآ݈�Jڑ���p���H�j�ך׺؅��Ηú�����
؛�������O�ьݿ�N���[�����2�G�������,Ŧ��m��������~ۤ��z�e�������׽�������&u��&u�ء�������i�ONI�=��
ԫI�=��`ԫI�=��
�I�=��`�I�=��
�aI�=��`�aI�=��
ьI�=��`ьI�J��I���I�A��I~��I�I��I�J�ް��I��ް��I�A�ް��I~�ް��I�I�ް��I�Jް��I�ް��I�Aް��I~ް��I�Iް��ILS�IL�IL盚I��5�f�ZI��|3I�ׇ3I���ZNI����ZNI~��ZNI����I��~��*���*���*���*���c�cȻȻɸɸ�&�&�'��'��1�P�����1�1����������盚��盚�z�z�Y����Y����Qj�Qj�Q�j�Q�j�Q���j�Q���j�!��!��d�j�d�j�����������������f�f���ʑ�����ʑ����@��@��Vˇ��VˇӨ��ʑ��Ө��ʑ��Ө�jӨ�j� Ѽ� Ѽ�yѼ�yѼ���j���j�����Þ�Þʣjʣjʣ��ʑ��ʣ��ʑ���k�k������I��ݮ�rב�x�x��O�'���'���'�1�'�1�'���'���'������'��'��'�P�'�P�'���'��I~��I�Iζ�7�������d�_����7��8���8������������z���zJ�@J�@�2j�2j������֤��֤���c���c�ֶj�ֶj�Qֶj�Qֶj�8ֶj�8ֶj� ֶj� ֶj�Qֶj�Qֶj�z�Y�E���d��Dӧ��P������9�K�����|�|vjvj�?�?�D�D�B�B�W���W������z�Qzß��z��`DI�jI!֤�݈��Y�1��Y���݈�������݈�)��?�)��D�)����)��B�)��E�)��H�)����)����)���u�)����)�����)���3�)����)���1�)����)����)���7�)���=�)����)����)����)��ʩ�)����)����)���2�)���u�)�����)���t�)�����)����)�����)����)��ѧ�)�����)����)��?�)��D�)��B�)��E�)���f�)���p��)���p��)���p��)���p���F�a�W��F�a���F�s�U��F�a���F�a���F�s���F�XN��FԔN��F�lN��F�YN������{��G����������m��������������������q��g���Ŧ��J��s�?��������2�����?�D�B�E�H�ӟ��������
��6�̘Ŧ�̘���N��B��)��V��������2���������̘���b������>�N�4�N�u�*�u4�*м�3м�м?м��мDм�xмBм�мn�мnѶмn�мn�&мEм�6м��мHм�fм��м�м�м�{м��м�Gм��м�м��м�м�mм�Nм�Bм�)м�м�Vм�м��м�м�м�м�м�м��м��м�м�м�м�мǘм�2м�Pм�м�м�%мl��м��мDм�xмBм�мn�мnѶмn�мn�&мEм�6м��мHм�fм��м�м��м�Xм4�Xм�Oмdмfм�м�м�м�м�м�м�&e�O&ed&ef&e�&e�&e�&e�&e�&e�&e�&e?&eB&e�&e�&e�&e�&e�"&e��e͓��e���e4���e��fe���e����e��e�W�e�ne�e�de���e�ze�z���n�O���nd���nf���n����n����n����n����n����n����n����n����n����n�{���n�G���n����n�2���n�s���n�m���n����n�O���n����n����n����n����n����n�����n����n����n����nŦ���n�����n����nǘ���n�����n?���n֤���nD���n�f���n�c���nE���nB���n�6���nH���n�ԅ���n������n���ԅ���n����n�xҊ�Ҋ�{Ҋ�GҊ�Ҋ�Ҋ�Ҋ�Ҋ��Ҋ�Ҋ��Ҋ��Ҋ�mҊ�Ҋ�Ҋ�Ҋ�ҊŦҊ�Ҋ��Ҋ�2ҊٟҊ�JҊ?ҊDҊBҊEҊ��ҊHҊ��Ҋ�tҊ�RҊl�IҊl�7Ҋl�Ҋl�Ҋ�ҊЅN��]��\��Z��_��1��!������.��'�� ��3��"��5��2��4��+��.�Կ��������@������K��>�����2��;��թ���6�������7��?�������D���x��B�������Hޣ���Hޤ����E������H������F�����F�c���{���|�c���G���������c�������n�c�����U���m���N���O�U���)���*�U����c�����˩�c�������U�����������c���������c�������������������Ŧ����c����U���������7����a�����������ۯ���y���zۣ���y���R�b���0��l���l�>��l����ն��2�o��5�o����c�����i����ݲ�����0����շ�����C����ݬ�������������ԟ�ǣ��ԟ��ղ���O��d��f��������������������������;�������K���K��K��K��VK���K�йKI�ҜK1�5�mK1�5��K1�5�{K1�5��K1�5��K1�5�K1�5�)K1�5�K1�5�VK1�5�OK1�5dK1�5fK1�5�K1�5�K1�5�K1�5�K1�5�K1�5�K1�5�K1�5�%K1�5�K1�5�K1�5��K1�5��	?�	D�	B�	E�	��	H�	��	�	�{�	��	��	�G�	��	�M�	��	�	��	��	��	��	��	�	�	ט�	��	�)�	��	�6�	��	���	��	څ�	��	�-�	��	��	��	ǘ�	�P�	��	��	���	D�	�x�	�!�	B�	֤�	H�	��	���	�c�	l��	l��	l��	lŦ�	0�P�	0�	0�I�	l0�I�	0��	0��	0�7�	0��	0Ĕ�	0��	0��	0�S�	l0݈�	l0��	�O�	d�	f�	��	��	��	��	��	��	��	���x�	���X�	��4�X�	��ɥ�XK��{K��K�K���K��K��mK��NK��BK��)K��K��K�K�K�K��PK���KI�ҜK���K��sK�K��ֻK���nK���K���YK��dK��fK���Kե��K1�5�	K1�5�K΀��K΀���21�~�1���1�~�u1���u1�~�~1���~1�~�1���1�~�1���1�~�1���1�~�11���11�~��1����1�~�I1���I1�~�1���1�~�1���1�~ʩ1��ʩ1�~�21���21�~�t1���t1�~�u1���u1�~��1����1�~�31���31�~�1���1�~�1���1�~��1����1�~�1���1�~�1���1�~�1���1�~H1��H1��R�
1���1�D1��c1�B1�E1�H1��R�x1���1��b1��r1���1��z1��j1��{1���R�1���Rח1���Rʩ1���Rͭ1��1�ח1���1����1���۶�E۶�H۶��۶��m۶��N۶��B۶��)۶��۶��V۶��2۶��P۶��x۶��۶���۶���۶��|۶��\۶����l۶��P۶��uN۶��	�uN۶��۶��#�;#�>#�A#�?#�@#�=#�#�#�#�#�#�#�#�#�#�#�#�#�G#�A#�C#�F#�D#�E#�B#�-#�#�$#�,#�'#�(#��J��'�W��E�JE��@ޕ�1���9�d����P�d4p�T�dp�݉�9�8�9���9��H���j��j�֤�֥j�֥�j���X���Yj��� 5ެ� �%�4�� �94� �9���� ��@�vζ5ެv�Pζ5ެ�Z��Zv2z�K�L~5��L~2�U��~5����2ެ���2ޭ~5����2ޭ�Uĕζ5ެI�0��/I�cI�d����PI�dp�TIv2z��T�E�֤�)��� �|��o�_z�s�o�_z_?_E_D_H_B_��_�{_�_�0_�_�_�L_�$_�_�_�G_�_�K_�,_�_��_�m_�_ݿ_ݠ_�_��_�N_�_ڑ_�_��_��_�v_��_�2_׺_�x_�`_�R_�K_�A_�6_�4_�_�P_Г_�p_��_̬_�H_�_�_�_�D_�_�z_�_��_�_�(_�/_�._�#_�"_�!_� _�q_�k_�\_�Z_�V_�U_Ŧ_�m_�F_�"_��_��_�۶��۶���۶��6۶��۶��۶��۶��C۶��V۶��o۶���۶�ʡ۶�Ś۶��_۶��@۶��H۶�D۶��۶���۶��۶��۶���۶���۶��۶��m۶���۶��۶���۶����۶��7��۶����۶�����۶����۶��W��۶�����۶����۶��u۶��T۶��h۶��:۶�ͣ۶��E۶��Z۶�ׇ۶��[۶�ݯ��۶����۶��O۶�d۶�f۶��۶��۶��۶��۶��۶��۶���f��f��f��f��f��fȤ�fȨ�f���f���f�s�f�q�f�r�f�o�f���f���f���f���f���f���f���f���f��f�t��t��t�=t�<t�\t�Zt�Yt�_t�`t�Xt�!t�0t�Ct�-t�#t�%t�t�t�t�3t�-t�Gt�0t�6tԻt��t��t�EtԾt��t��t�,t�/t�At�?t�*t�2t�3t�$t�1tլtխt�*t�-t�t�t�Lt��t���o�n�m�l�k�j�i�h�g�f�e�d�c�b�a�`�_�^�]�\�[�Z�Y�X�W�V�U�T�S�R�Q�P�O�N�M�L�K�J�I�H�G�F�E�D�C�B�A�@�?�>�=�<�;�:�9�8�7�6�5�4�3�2�1�0�/�.�-�,�+�*�)�(�'�&�%�$�#�"�!� �������������������
���
�	����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������~�}�|�{�z�y�x�w�v�u�t�s�r�q�p�o�n�m�l�k�j�i�h�g�f�e�d�c�b�a�`�_�^�]�\�[�Z�Y�X�W�V�U�T�S�R�Q�P�O�N�M�L�K�J�I�H�G�F�E�D�C�B�A�@�?�>�=�<�;�:�9�8�7�6�5�4�3�2�1�0�/�.�-�,�+�*�)�(�'�&�%�$�#�"�!� �������������������
���
�	��������������������������������������������������������������������������������������������������������������������������������������������������������������������!�!�!�`!�!�!��Q��!���!ۥ���!ۥ�<��!ۥ�7��!�(���!ۥ��{���!{�o�mǂ{!������s{�~�u{�>��{�>�e{�>�{�>�#{�>��{�>0۫{�>�m{�>�U{�~b7{�����{���B�{���y���{���y�B�{��s{�ӓ{��*{���x{��x{�f�x{��*{�{�x{�]�x{��x{���x{0�$�x{�$�x{���x{۬�x{׋�x{���x{0�]�x{�]�x{�m�x{�k�x{�n�x{���x{�V�x{�{�{����{�$��{�]��{!���	�ŇF	�Ň0	��F	��0	��T	����	�IF	�I0	�IT	�I��	��F	��0	��T	����	�EF	�E0	�ET	�E��	�(F	�(0	�(T	�(��	�GF	�G0	�GT	�G��	�pF	�p0	�pT	�p��	�GF	�G0	�GT	�G��	�F	�0	�T	���	�`F	�`0	�`T	�`��	�IF	�I0	�IT	�I��	�GF	�G0	�GT	�G��	�'F	�'0	�sF	�s0	�F	�0	�%F	�%0	�F	�0	ѮF	Ѯ0	�F	�0	�T	���	�oF	�o0	�oT	�o��	�@F	�@0	�@T	�@��	�F	�0	�T	���	� ��F	� ��0	��F	��0	��T	����	�r]ZF	�r]Z0	�r�F	�r�0	�r�T	�r���	�r�F	�r�0	�r�T	�r���	]�IF	]�I0	]�I��ZF	]�I��Z0	L9	L<	c�9	c�<	s�9	s�<	s��k��9	s��k��<	��9	��<	4S�P<	c��29	c��2<	�	ˌ9	ˌ<	�JF	�J0	�JT	�J��	vF	v0	֥F	֥0	��F	��0	v��ZF	�wF	�w0	�C֥F	�C֥0	�C��F	�C��0	�F	�0	�T	���	�Y���C��FT	�Y���C��F��	!]��Z�F	!]��Z�0	!]��Z��F	!]��Z��0	!]��Z�vF	!]��Z�v0	!]��ZvF	!]��Zv0	!]��Z֥F	!]��Z֥0	!]��Z��F	!]��Z��0	!]��Z�F	!]��Z�0	!]��Z�T	!�Y�C]��Z��FF	!�Y�C]��Z��F0	!�Y�C]��Z��FT	��]F	��]0	��]T	��]��	!]��Z�F	!]��Z�F	!]��ZWF	!]��Z��FF	!]��Z]F	!���F	!���F	!���F	!��WF	!����FF	!��]F	!�*�F	!�*�F	!�*�F	!�*WF	!�*��FF	!�*]F	!���F	!��WF	!����FF	!��]F	!��F	!�WF	!��F	!�WF	!��F	!��F	!�WF	!�~�F	!�~�F	!�~�F	!�~WF	!�	�F	!�	WF	!��F	!��F	!��F	!�WF	!ˌ�F	!ˌWF	!�nWF	!���F	!��WF	!���F	!��WF	!��F	!��F	!��F	!�WF	!���FF	!�]F	!ә�F	!әWF	!ә��FF	!ә]F	!�$�F	!�$�F	!�$�F	!�$�F	!�$�F	!�$WF	!�$��FF	!�$]F	!��F	!��F	!��F	!�WF	!���FF	!�]F	!W�F	!W�F	!W�F	!WWF	!W��FF	!W]F	!� �F	!� �F	!� �F	!� WF	!� ��FF	!� ]F	!�r�F	!�rWF	!�r��FF	!�r]F	!]�F	!]�F	!]�F	!]WF	!]��FF	!]]F	!���_�F	!ҏ�_�F	!��F�_�F	!�)�^F	!�)��F	!�)��F	!�)�`F	!�)��F	!�)�_�F	!]��Zҏ0	!]��Z�k0	!]��ZW0	!]��Z� 0	!]��Z��F0	!]��Z]0	!��ҏ0	!���k0	!��W0	!��� 0	!����F0	!��]0	!�*ҏ0	!�*�k0	!�*W0	!�*� 0	!�*��F0	!�*]0	!��ҏ0	!���k0	!��W0	!��� 0	!����F0	!��]0	!���F0	!�]0	!ә��F0	!ә]0	!�$�0	!�$�0	!�$W0	!�$��F0	!�$]0	!�W0	!���F0	!�]0	!W�0	!WW0	!� ҏ0	!� �k0	!� W0	!� � 0	!� ��F0	!� ]0	!��F�_�0	!]ҏ0	!]�k0	!]W0	!]� 0	!]��F0	!]]0	!]��Z�T	!]��Z�T	!]��Z�T	!]��ZWT	!]��Z�rT	!���T	!���T	!���T	!��WT	!���rT	!�*�T	!�*�T	!�*�T	!�*WT	!�*�rT	!��WT	!��T	!�WT	!��T	!�WT	!��T	!�WT	!�~�T	!�~�T	!�~�T	!�~WT	!�	�T	!�	�T	!�	WT	!��T	!��T	!��T	!�WT	!ˌ�T	!�nWT	!���T	!��WT	!���T	!��WT	!��T	!��T	!��T	!�WT	!ә�T	!әWT	!�$�T	!�$�T	!�$�T	!�$�T	!�$WT	!��T	!��T	!��T	!�WT	!��rT	!W�T	!W�T	!W�T	!WWT	!� �T	!� �T	!� �T	!� WT	!� �rT	!�r�T	!�rWT	!�r�_�T	!]�T	!]�T	!]�T	!]WT	!]�rT	!]��ZW��	!]��Z�r��	!��W��	!���r��	!�*W��	!�*�r��	!��W��	!���r��	!�~W��	!�~�r��	!�W��	!��r��	!�$���	!�$W��	!�W��	!� W��	!� �r��	!]W��	!]�r��	!�)����	!�)�`��	!�)����	!ˌ��FF	!ˌ]F	!����FF	!��]F	!����FF	!��]F	!�~��FF	!�~]F	!���FF	!�]F	!���FF	!�]F	!���FF	!�]F	!���FF	!�]F	!�	��FF	!�	]F	!���FF	!�]F	!��F	!��F	!��F	!�WF	!�ҏF	!�~ҏF	!�	ҏF	!�ҏF	!ˌ��F0	!ˌ]0	!����F0	!��]0	!����F0	!��]0	!�~��F0	!�~]0	!���F0	!�]0	!���F0	!�]0	!���F0	!�]0	!���F0	!�]0	!�	��F0	!�	]0	!���F0	!�]0	!��0	!��0	!��0	!�W0	!�ҏ0	!�~ҏ0	!�	ҏ0	!�ҏ0	!��T	!��T	!��T	!�WT	!�~�rT	!��rT	!ˌWT	!�~���	!�~���	!�~���	!����	!����	!����	!ˌW��	!�nW��	!���0	!���F�92Ռ�95Ռ	!�*�WT	!�*��0	!�*��T	!�*�WT	!�*�WT	!�*W�T	!�*W�T	!�*W�T	!�W�0	!�W�T	!�W]0	!�W��F0	!�~��T	!�~��T	!�~���F0	!�~W�0	!�~W�T	!�~W�T	!�~WW0	!�~WWT	!�	��0	!�	��T	!�	WW0	!��W0	!��WT	!��]0	!�W�0	!�W�T	!�WW0	!�WWT	!����F0	!��W0	!��WT	!ˌW�0	!ˌW�T	!ˌWWT	!ˌW]0	!���W0	!��WW0	!��WWT	!��W��F0	!��WW0	!��W]0	!��W��F0	!��W0	!��WT	!әW�0	!әWW0	!��W0	!��]0	!����F0	!���T	!���0	!��W0	!��WT	!�W�0	!�W�T	!W��T	!W�WT	!W�]0	!W��T	!W�WT	!W��T	!W�WT	!W��T	!�rW�T	!�rWWT	!� �WT	!� ���F0	!� �W0	!� �WT	!� ���F0	!� W]0	!� W��F0	!]WW0	!]WWT	!���]0	!�*�]0	!�*���F0	!�*�]0	!�*���F0	!�*W]0	!�*W��F0	!�W]0	!����F0	!�W��F0	!�~���F0	!�	�]0	!��]0	!��]0	!��]0	!�W]0	!]�]0	!]�]0	!]W]0	!WW]0	!әW]0	!� �]0	!әW�T	!��WT	!��W]0	!�$W]0	!� ��T	!W�]0	!��WT	!�$WW0	!��W0	!� ��0	!��]0	!��]0	!W�]0	!�W]0	!���]0	!�$WWT	!���WT	!�	WWT	!�~�]0	!� �]0	!���������F	!ӕ�������F	!��F	!��F	!��F	!��F	!��F	!��F	!ʼnF	!��F	!��ň	!���@7	!����
>�q>�>Ͼ>ϳ>Ϩ>ϝ>ϒ>χ>�|>�p>�e>�Z>�O>�D>�9>�.��$S���$S����$S�������$S���$S�i��$S�ZN��$S�ON��$S2;ޓ���$S5;ޓ�;��$S��&!2��&!5��&4�U2��&4�U5��&�s2��&�s5��&��r&!2�<&!5�<&�U2�<&�U5�<&�s2�<&�s5�<&��s<&(�72��&(�75����$ScL����$S���A��$S���A��$S~�K��$S�w~�K��$S2Ռ��$S5Ռ��$S2����$S5����$S2������$S5������$S2:ޓ���$S5:ޓ���$S24�[���$S54�[���$S2�[���$S5�[���$S2�f���$S5�f���$S2;�f���$S5;�f��P�;�P���$S2/���$S5/��@��!��w�4�w��@~�K�!~�K�w~�K��������i��ON�ZN���A2Ռ5Ռ2��5��2����5����7�o��b7�ތ7�^7�7�Zͱ�
7�-7�	��F	�\��9	�^F	ˈ�	��F	��F	����	�`F	�`��	��F	����	�)F	�)��	�xF	�x��	��F	��nZF	��nZ0	���ZF	���Z0	�v��ZF	�v��Z0	����F	����0	]��ZF	]��Z0	]��ZT	]��Z��	�F	�0	��F	��0	��T	����	�*�$F	�*�$0	�*F	�*0	�*T	�*��	��F	��0	��T	����	�F	�0	�T	���	�F	�0	�T	���	�F	�0	�T	���	�lF	�l0	��F	��0	ҏF	ҏ0	�kF	�k0	�~F	�~0	�~T	�~��	�F	�0	�T	���	�	F	�	0	�	T	�	��	�F	�0	�T	���	ˌF	ˌ0	ˌT	ˌ��	�nF	�n0	�nT	�n��	��F	��0	��T	����	��F	��0	��T	����	�F	�0	�T	���	әF	ә0	әT	ә��	�$F	�$0	�$T	�$��	�F	�0	�T	���	WF	W0	WT	W��	� F	� 0	� T	� ��	�rF	�r0	�rT	�r��	�vF	�v0	��FF	��F0	]F	]0	]T	]��	!���nZF	!���nZ0	!����ZF	!����Z0	!�����F	!�����0	!��F	!��0�P�;�,͔��ZN��>N�7��
7��-7��o���2Ռ�5Ռ����b7��������ͱ��O�d�f�����������������i�ތ7��7��^7��ON���?��p��Ϯ��E��1�꾮��D��ٮ�P���݈��7�H���ӧ����P��خB����Ǯ�ޮĔ�Þ�2/���Zͱ�5/�����~�K��e��?��p��Ϯ��E��1�꾮��D��ٮ�P���݈��7�H���ӧ����P��خB����Ǯ�ޮĔ�Þ�2���S�K�5����T�2;Ռ�5;Ռ������2�f��5�f����Gp�G�"�G?�GD�GB�GE�GH�G��G�يG��G�(����͢N�G?�GD�GB�GE�GH�G��G�e�G߻�G�ъG��G��G�p�G̬�GГ�G�ȊG��G�z�G�(�G�D�G��G��G�ߊG׺�G�v�G�2�G��G�G�G�K�G蓊G�G��G�N�Gڑ�G�ϊG��G��G�يG��G��G�H�Gь�Gҷ�G��GŦ�G�7�G��͢N�G�n͢N�놊�0��H��)��Њ�Ί�͊�a��=��6��1��.��'��"����(��4��8��Ί�E��Ê�4��B�⏊���L��G��z�ʿ����7�?�������v��E��8��E�H�Ŧ�ŝ�֤���B��[��m��F��ي�t���D��'7��?7��7��r��!���<7��7����d�k3��3�[3���3�:�^�;���L�f��L�Z��L�ַ�r���r��J�`?J�AEJ�JDJ�*HJ�\BJ�o�J�:�J�b�J�X�J�4��J�.��J�9�J�C�J�&�nJ��J�;��J�$�eJ�!�J�߻J��J�Y��J��NJ�W�J�OڑJ�d�J�N�vJ�H��J�3�2J�0׺J�k�J��\J�@��J�[�uJ�5��J�VӟJ�ӋJ�Q�yJ�F�mJ�+�J�KҷJ�2�HJ�m��J�LьJ�G�J�^ГJ�>�pJ�Z��J�-̬J�,�J�i�DJ�B�zJ�g�J�"�(J�1ŦJ��mJ�?�FJ�=�"J�U�sJ��XJ�R�J�M��J�<�AJ���J� �J��J�7�vJ�I��J�)��J��J�E�J�#��J�%ˣJ���J�fJ�TJ�SJ�PJ�DJ�8J�6J�/J�(J�'J�J�J�J�J�J��
�>J���J����J��
�J��	�J���J���aJ����J���J���J��͜J���rJ���SJ���J����OJ����LJ���ցJ����~J�����J����J����J���֐J����.J���J�����J���ۜJ��� J����J���J����J���J���J����fJ���J���J���J����J���J���J�����J���J���J����OJ����J���J���J���J���J���J���J���J���J���J�����J���J���ɾJ���J���J���J���J���J���J���J���J���J���J���J����gJ����!J����3J���͆J���3J���J����0J���J���J����J�pJ����pJ����q�J����MJ���J���J����WJ���J���J���J���J���J����DJ���J���J���J���J���J��/��J��/��J��/��J��/��J��/��J��/��J��/��J��/��J��/��J��/��J��/��J��/��J��/��J��/��J��/��J��/��J��/��J��/��J��/��J��/��J��/��J��/��J��/��J��/��J��/��J��/��J��/��J��/��J��/�����	�[�K���	�[��fN��d��f�����������������������������ʱ��������
���A�����خ��a�9��c�9��s�9����9���e�9����9���G�9����9��س�9��a���c���s��������e��������G�������س����������ʲ�������뒪�������B�������د����^�C�1���^�q̉���^Ј̉���^ʹ̉���^�̉�������q̉���8���q̉����Ј̉����ʹ̉ �
��a�W �
��a�� �
��a�� �
��� �
��� �
���e�9 �
���e� �
��뒪 �
���e�{ �
����{ �
����{ �
��a�:�{ �
���e�:�{ �
��aʟ�{ �
���eʟ�{ �
���e� �
���� �
���� �
��a�:� �
���e�:� �
��aʟ� �
���ʟ� �
���ʟ� �
���� �
�aaԇ �
��d �
�]d �
�f �
��f �
��c�� �
�c�� �
ɜ� �
ɜ� �
ɜ��� �
�]� �
ۑ� �
��� �
��ʱ �
ɜ� �
ɜ�� �
�]� �
��� �
��a�9 �
��s�9 �
��e�9 �
ɜ�e�9 �
���e�9 �
�`�e�9 �
���e�9 �
��a� �
���e� �
���e� �
���� a�7 a��� cʶ7 s�V7 �C7 �|7 ��7 ִ7 cֳ7 sֳ7 �ֳ7 �eֳ7 ۋ7 �l�C7 �17 �$7 ��7 ��7 ��7 �n7 �t�C7 �P7 a�X7 �67 �C7�'7���>7���A7���a7���<7���f�<7���M7����7���G7���N7���7���7�� 7 �Z�J��O�Q��O����O�]���O�w��O�B��O���O�g��O�G��O�q��O3��O�M��O����O���O�=��O���Oй��O�h��O�b��O�gԎ��O���O���O����O���O����O����O�f��O�=��O�ެ��O�\��O����O�O��O����O���O����Oԏɾ��O���O՞��O����O�X��O�����O�:��O�f��O����O�{��O�w�Y��O&ֶjݕ?ݕEݕ�pݕ��ݕ�ݕ��ݕDݕ��ݕÞݕ��ݕ��ݕ�Pݕӧݕ�ݕ݈ݕ�7ݕ�ݕ�WݕBݕ�ݕ�%ݕ�ݕ�Pݕ��ݕ�Qݕ�jݕ��ݕ�ݕ��m?�m��m��m��m��m��m��m���mӧ�m�p�m݈�mH�m�m��m�4�m�3�m�P�m��mB�m�W�m��m�7�m�P�m��m�S�mD�mE�m��m�P�m�G�m١�m��m�m�}�m��m��m�I�m�x�m��m�Q�m��mѶ�m��m��m��m��m��m�S�m��X�ʞNX�dX�fX��X��X��X��X��X��X��X��X���X�ʱX��X��X��
X��AX��X�خX�a�9X�c�9X�s�9X���9X��e�9X���9X��G�9X���9X�س�9%)?%)�	%)��%)�%)E%)�v%)�X%)�%)��%)D%)�%)�%)��%)��%)�%)H%)�\%)�%)߻%)�%)�%)�D%)B%)�
%)�%)�%)�/%)�%)�g%)�x%)�%)�%)׎d%)׎�%)׎�%)׎�%)�E%)��k%)͝�k�x���x�m�x��x�u�x���xӖ�x���x���xʫ�x��xߒ�x�:�x�4�x���x��x��x���xخ�x���xн�x�&�x�,�x���x�|�x�)�x�0�xس�9%�$�j%�$��%�$�k%�$�%�$E%�$�8%�$�%�$�`%�$�%�$D%�$�%�$ި%�$ۢ%�$�c%�$��%�$�N%�$ҍ%�$�T%�$ˉ%�$B%�$�T%�$ν%�$�%�$��%�$�/%�$H%�$�f%�$�/%�$�%�$�[%�$�i%�$�3%�$�1%�$�T%�$�%�$��%�$�%�$��&%�$�j&%�$�&%�$�`&%�$�c&%�$�T�]���]���]�_�]��]���]��]�"�]�N�]�^�]��]���]�#�]���]��]۫�]��]׊�]��]���]���]���]��]�f�]���]���]���]��]D�]B�]�"�]�	�;%�?%�D%�B%��%�߻%��{%��L%���%���%���%��%��%��(%��%��%���%���%��%���%���%��%�׺%��%��N%�ڑ%��%�ǘ%��"%��%�ь%��%��%��s%��2%��P%��%���%���%���%�IJ%��q%��p%��x%���%��	�;%�d%�f%��%���%��9��D��E��?������H���f�ζD�ζE�ζ?�ζ���ζH�ζ�f��z�������B����O�����0�����c�������E��/��q��y�������U����@��������������֒��b��D��E��?������H���f�ζD�ζE�ζ?�ζ���ζH�ζ�f��z�������B����O�����0�����c�������E��/��q��y�������U����@��������������֒��b��L�����Y���ʾ�����U����D��6�������m�������������l������������-��������w����"�������׊��A��������$�ּ��^�֐��}�����H����������L������2���2���2��2���2���2��2���2��2��2���2��2�R�2�{�2���2ӝ�2�3�2�N�2�&�2�z�2�u�2��2��2?�2E�2D�2H�2B�2���2�6�2�f�2�O�2d�2f�2��2��2��2��2��2��2��4?�4���4���4���4�@�4��4�'�4E�4��4��4��4D�4��4�&�4�n�4��4��4��4H�4֏�4��4�%�4��4�2�4��4�$�4�q�4�#�4�g�4��4B�4Ŧ�4��4���4�s�4�J�4?�4���4���4���4�@�4��4�'�4E�4��4��4��4D�4��4�&�4�n�4��4��4��4H�4֏�4��4�%�4��4�2�4��4�$�4�q�4�#�4�g�4��4B�4Ŧ�4��4���4�s�4�J�?��	��9��g���ٗ����!�E����0�����D���������� �����v���؝�H��\�Ӌ�ҷ�Ѱ�Г����D����B��v����Ĕ��X��A��������Y�����Y����Y���Y���=�Y���@�Y���c�Y���:�Y���;�Y���`�Y����Y����Y���J�Y����Y���2�Y����Y���
�Y����Y���Y���t�Y���Y���Y��ݑ�Y���R�Y��ӌ�Y���0�Y���'�Y���K�Y����Y���(�Y��Ӑ�Y����Y���Y���!�Y����Y���w�Y����Y����Y���Y���m�Y���A�Y����Y����Y���;�Y���%�Y���2�Y��Π�Y����Y����Y���R�Y���I�Y��Ԛ�Y���4�Y����N'�t'�s'�r'�q'�p'�o'�n'�m'�l'�k'�j'�i'�h'�g'�f'�e'�d'�c'�b'�a'�`'�_'�^'�]'�\'�['�Z'�~'�Y'�X'�W'�V'�U'�T'�S'�R'�Q'�P'�O'�N'�M'�L'�K'�J'�I'�H'�G'�F'�E'�D'�C'�B'�A'�@'�?'�>'�='�<'�;'�:'�9'�8'�7'�6'�5'�4'�3'�2'�1'�0'�/'�''�.'�-'�'�,'�+'�*'�)'��'�('�''�&'�%'�$'�?'�>'�='�<'�;'�:'�9'�8'�6'�5'�4'�3'�2'�1'�/'�.'�-'�,'�+'�*'�)'�('�''�&'�%'�$'�#'�"'�!'� '�'�'�'�'�'�'�'�'�'�'�'�
'�'�'�
'�	'�'�'�'�'�'�'�'�'�'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'�P'�O'�N'�M'�L'�K'�I'�H'�G'�F'�E'�D'�B'�A'�='�<'�:'�9'�8'�7'�6'�5'�4'�3'�2'�1'�0'�/'�.'�-'�,'�+'�*'�)'�('�''�&'�%'�$'�#'�"'�!'� '�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�
'�'�'�
'�	'�'�'�'�'�'�'�'�'�'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��'��?'��p'����'��E'���1'���'����'���P'���'���W'���V'���U'���T'����'����'��Ĕ'���|'���'���.'���+'���9'���'��'��'��'��'��'��'��'����?��E��D��H��B�����������������e�����߻����������m�����ݿ����������N�����ڑ������v�������2��׺������\�������u���������ҷ���H������ь�����Г���p������̬������D���z������(��Ŧ���m���F���"�����������s����X�����X�����X����X���d�X����X���u�X���\�X���W�X����X�����X����X�����X��۫�X��׊�X�����X���u�X���\�X����X���e�X���m�X�����X���R�X��Ѕ7�X��d�X��f�X����X����X�����X��a�9�X��a��X������������������d������u���\���W����������������۫��0׊��׊�������u���\������e���m�������R��޳�M����M��d��f������������������0��������0������������d��0�������u���\���W�����0��������0������0��������0۫��۫��0׊��׊�������u���\������e���m��0���������R��d��f���������/�������������a�9����������c����u��Z��W�����������۫�׊�����s��\����e�����R�d��������a�9�����������`����������|���l���Y����������#�����۫��׊���c�������\������j�����������Y��d���������a�9��f������	�Zݔ?ݔ�pݔ�ݔ��ݔEݔ��ݔDݔĔݔ�Pݔ�ݔ݈ݔ�7ݔHݔ�ݔ�Sݔ��ݔBݔ�1ݔӧݔ�Pݔ�Qݔ�jݔ��ݔݗݔ�Wݔ��ݔɱN��9?��9E��9D��9H��9���9Ŧ��9����9����9���9���9���9���9�v��9�t��9���9���9���9��9�P��9���9���9Г��9���9ӟ��9���9˧��9�D��9�B��9���9��9���9���
?��
E��
D��
H��
���
Ŧ��
����
���
���
���
�v��
���
���
��
�P��
���
�����
��
���
ӟ��
���
�D��
���
��
�����
�a���
����
��]��
d��
f��
���
���
���
���
���
���
���
���
���
ʱ��
���
둌�
�
��
�A��
a�9��
c�9��
s�9��
��9��
�e�9��
��9��
�G�9��
��9��
س�9��
a���
c���
s���
����
�e���
����
�G���
����
س���
����
�몌�
ʲ���
����
뒪��
����
�B���
����
د���
a�:���
c�:���
s�:���
��:���
�e�:���
��:���
�G�:���
��:���
س�:���
�a���
�c���
�s���
�����
��e���
�����
��G���
�����
�س���
�����?�D�B�n��E�H�ޞN�4�<��3��������{�������������m��N��B��)����V������������������������������ǘ��2��P����s����$��.��/��#��P9��X�L<���d�f����������a�9�a��a������������������H�����7���������X���4�X����E%͟�
�%͟�
��%͟�
�W%͟�
۫%͟�
�e%͟�
�u%͟�
��%͟�
�m%͟�
��%͟�
�R%͟�
��%͟�
�%͟�
׊%͟�
�%͟�
�%͟�
��%͟�
�%͟�
��%͟�
�s%͟�
�%͟�
�%͟�
�d%͟�
��%͟�
�%͟�
�Z%͟�
�%͟�
��%͟�
��%͟�
��%͟�
d%͟�
�%͟�
��D%��
�q%��
�%��
��%��
۹%��
Ә%��
�u%��
�%��
Ҏ%��
��%��
�)%��
�%��
�#%��
�%��
�%��
�%��
�%��
�%��
��%��
��%��
�%��
�'%��
�k%��
��%��
ˋ%��
�j%��
��%��
�@%��
��%��
�m%��
d%��
�%��
���5���5���5���5��5���5�d�5��5�u�5�h�5�\�5�C�5���5��5�W�5��5���5��5���5��5���5��5���5۫�5׊�5���5�u�5�x�5�\�5��5��5�e�5Ķ�5Ӏ�5�m�5���5�0�5�R�5�u9�5�u<�5d�5��5��5���5a�9�5����5���M�5��4L�'��5��L�'��5����5��c��5���L��?�������1���~���j������������E���6��H���f��D���x��B�����������Ģ��ĭ���0���������9�����D����������I���\�����	�������:�������v���b���Q�������å���E���v��ҷ�����Г���X������A���w���1�����N�Fc�aL��c�aL����c�aL����aLc�����c�a�����a�c����.Յ���.Յ���.Յ��.Յ�d�.Յ��.Յ�u�.Յ�\�.Յ�W�.Յ��.Յ���.Յ��.Յ���.Յ۫�.Յ׊�.Յ���.Յ�u�.Յ�\�.Յ��.Յ�e�.Յ�m�.Յ���.Յ�R�.Յd�.Յf�.Յ��.Յ��.Յ��.Յ���.Յa�9�.Յa��.�����.�����.����.���d�.����.���t�.���\�.���W�.����.�����.����.�����.��۪�.��׊�.�����.���\�.����.�����.���R�.��d�.��f�.����.����.����.�����.��a�9�.��a�����������������������d����������t�����\�����W���������������������۪����׊�����������\����������������R����ЅN���ޣЅN�������=�����������d����f�������������������������a�9%��=?%��9?%��9��%��=D%��9D%��9E%��=H%��=֤%��9֤%��=�u%��9�u%��=��%��9��%��=��%��9��%��=��%��9��%��=�%��9�%��=��%��=�8%��9�8%��=�z%��9�z%��=��%��9��%��=��%��9��%��=֢%��9֢%��=��%��9��%��=��%��=�%��=��%��=�j%��=��%��9��%��=��%��9��%��=��%��9��%��=�%��9�%��9�a%��=��%��9��%��=�%��=�]%��=��%��=�>%��9�>%��=�%��9�%��=�%��9�%��=�J%��9�J%��=�%��9�%��=��%��=��%��=��%��=��%��9��%��=�%��9�%��=��%��9��%��=��%��9��%��=�1%��=�?%�?%���%��@%��v%��>%���%��;%��:%��d%�E%���E%��6%��/%��.%��+%��(%�D%��x%��%��%���%��-%��%���%���%���%��%�H%��f%�غ֤%�т֤%�֣%��%���%��%�ζ�%��%��%��%���%��u%��<%�B%��%�غ�c%�т�c%��h%��8%��3%���7%��%�?%���%��@%��v%��>%���%��;%��:%��d%�E%���E%��6%��/%��.%��+%��(%�D%��x%��%��%���%��-%��%���%���%���%��%�H%��f%�غ֤%�т֤%�֣%��%���%��%�ζ�%��%��%��%���%��u%��<%�B%��%�غ�c%�т�c%��h%��8%��3%���7%��%�d%��%��%��%�a�9%�a����?�����������������N�������������������������������)�������ѵ����s��������2��������{���������������Ŧ����HŦ��������H�����G����m���ǘ���?���D���B���E���H���u����u��q�������ˊ����q����_����O���d���f�����������������������������vd�vf�v��v��v��v��v��v��v��v��v���vʱ�v��v��v�
�v�A�v��vخ�va�9�vc�9�vs�9�v��9�v�e�9�v��9�v�G�9�v��9�vس�9�v�a���v�a�W�v�aʸ�v�cʵ%Ͷ��%Ͷ0��%Ͷ��%Ͷ0��%Ͷ�%Ͷ�%Ͷ0�%Ͷ�u%Ͷ�\%Ͷ�W%Ͷ��%Ͷ�%Ͷ��%Ͷ۫%Ͷ׊%Ͷ0׊%Ͷ0׋Sˇ%Ͷ��%Ͷ�u%Ͷ���u%Ͷ�\%Ͷ�%Ͷ0�%Ͷ0�Sˇ%Ͷ�k%Ͷ��%Ͷ�R%Ͷ0�R%Ͷ0�SSˇ%Ͷd%Ͷf%Ͷ�%Ͷ�%Ͷ�%Ͷ�%Ͷ��%Ͷʱ%Ͷa�9%Ͷ�a��%Ͷ!�tͶ��Ͷ��Ͷ�Ͷ�Ͷ�uͶ�\Ͷ�WͶ��Ͷ�Ͷ��Ͷ۫Ͷ׊Ͷ��Ͷ�uͶ�\Ͷ�Ͷ�lͶ��Ͷ�RͶ�ͶގͶ�I��Ͷ&L<Ͷ&c�<Ͷ&L9Ͷ&c�9Ͷ&�9Ͷ&�<Ͷ&�9Ͷ&�<Ͷ&��<Ͷ&�n<Ͷ&��<ͶdͶ�Ͷ��Ͷa�9Ͷ��cS�DͶ��cS�E�Ͷ����Ͷ��c��Ͷ�֝����������������d������u���\���W����������������۫��׊�������u���\������e���m�������R��!�[�����3���ᥞ�"�?����D��x�B���n��nѶ�n��n�&�E��ȞH��������{����G�������֞ᴞ�m��N��B��)����V������ﰞ����������Ş��������ǘ��2��P������%�%*��%*ѵ�%*�D���������D��x�B���n��nѶ�n��n�&�E��ȞH�������X�4�X������4����K����H�����՞d�f�������������������ʱ���둞�
��A���خ�a�9�a���O�d�f����������������|�����3���?����D��x�B���E����H���������{�����G������������m��N��B��)������M��V������������������������������ǘ��2��P��������D��x�B���E����H������ו��7���7�7�ЅN�4ЅN��X�4�X�9ͧͯ�ͧͯˋͧͯ�sͧͯ��ͧͯ�tͧͯ�lͧͯ�Yͧͯ�Dͧͯ�9ͧͯ��ͧͯǔͧͯ��ͧͯ�nͧͯ��ͧͯ��ͧͯ�!ͧͯ��ͧͯ�jͧͯ��ͧͯ�4ͧͯ�yͧͯ�\ͧͯ֕ͧͯ�(ͧͯ�hͧͯ�Oͧͯdͧͯfͧͯ�ͧͯ�ͧͯ�ͧͯ�ͧͯ�ͧͯ�ͧͯ��
���
�3�
��
���
D�
B�
E�
�7�
�
�x�
��
�F�
���
��
��
�
�l�
�M�
�A�
�(�
��
�U�
ˢ�
��
�
�
��
��
��
���
��
�w�
æ�
ā�
��
�R�
�
�
�
�
?�
D�
�x�
B�
��
E�
��
H�
���
֒�
�N�
��N�
��
�u�
�O�
d�
f�
��
��
��
��
��
��
��
ЅN�
�X�
4�X�
�ON�
�y�
���
�!�W?�WD�WB�WE�WH�W��W��W�{�W���W���W��W���W��W�m�W�N�W�B�W�)�W��W�V�W��W���W��W��W��W��W��W���W���W��W��W��Wǘ�W��W��Wѵ�Wו�W�7�WЅN�W!Ο�����3���?����D��x�B���n��nѶ�n��n�&�E����H���������{�����G������������m��N��B��)����V�������������������������������%�ǘ��2��P��������D��x�B���n��nѶ�n��n�&�E����H������������"����X�4�X��7��Z���N�ו�IN��KζN��KN��O�d�f����������������
��d����7�Ѕ��Ѕ����d���f��������������������������������������ʱ�������둙���
����A�������خ���a�9���a��t?�t���tD�tB�tE�t���tH�t���t��t��t�{�t�
�t���t�G�t���t��t���t��t�m�t�N�t�B�t�)�t��t�V�t��t���t��t��t��t��t��t��t���t�-�t���t��t��t��t��tǘ�t��t��t�%�t���tD�t�x�tB�tE�t���tH�t���t�3�t��tו�t�(�t�X�t4�X�t�	�Z�tЅN�t4ЅN�t�7�t�w�|?�|D�|B�|E�|��|��|�{�|���|���|��|���|��|�m�|�N�|�B�|�)�|��|��|�V�|��|���|��|��|��|��|��|���|���|��|��|��|��|ǘ�|��|��|ѵ�|�M�|ЅN�k?�k���kD�k�x�kB�k��kE�k���kH�k���k��k��k�{�k�
�k���k�G�k���k��k���k��k��k�m�k�N�k�B�k�)�k��kѵ�k��k�V�k��k���k��k��k��k��k��k���k�-�k���k��k��k��k��kǘ�k�2�k��k��k�3�k���kD�k�x�kB�k��kE�k���kH�k���kו�k��k�O�kd�kf�k��k��k��k��k��k��k��m&�49�m���m�3�m��m?�m���mD�m�x�mB�m��mn��mn��m�6�m���m�f�m���m��m��m�{�m���m�G�m���m��m���m��m�m�m�N�m�B�m�)�m��m�V�m��m���m��m��m��m��m��m���m���m��m��m��m��m�%�mǘ�m�2�m�P�m��m�&��<�mו�m���m���mD�m�x�mB�m��mn��mnѶ�m�6�m���m�f�m���m��m��m��ޞN�m�{�m�s�3�m�s4�3�mnѶ�mn�&�mn��mn�&&�m�O&�md&�mf&�m�&�m�&�m�&�m�&�m?&�m�&�m�&�m�"&�m��Q?�Q���QD�Q�x�QB�Q��Qn��QnѶ�Qn��Qn�&�QE�Q���QH�Q���Q��Q��Q�{�Q���Q�G�Q��Q���Q��Q���Q��Q�m�Q�[�Q�N�Q�B�Q�)�Q��Q�V�Q��Q���Q��Q��Q��Q���Q��Q��Q���Q���Q��Q�Q�Q��Q��Q�M�Q��Q�z�QŦ�Q�2�Q�P�Q��Q��Q���QD�Q�x�QB�Q��Qn��QnѶ�Qn��Qn�&�QE�Q���QH�Q���Q��Q���Q�3�Q��Qו�Q���Q0�3�Q��Q�c�Q�X�Q4�X�Q��Q�W��Q�7�Q�O�Qd�Qf�Q��Q��Q��Q��Q��Q��Q��QԔN�Q�+7�Q��N�Q�s�3�=�P�=?�=���=D�=�x�=B�=��=n��=nѶ�=n��=n�&�=E�=���=H�=���=��=��=�{�=���=�G�=���=��=���=��=�m�=�N�=�B�=�)�=��=�V�=��=���=��=��=��=��=��=���=���=��=��=��=��=ǘ�=�2�=�P�=��=��=���=D�=�x�=B�=��=n��=nѶ�=n��=n�&�=E�=ζE�=���=H�=ζH�=���=���=�3�=��=��=ו�=���=�#�=�7�=��=�O�=d�=f�=��=��=��=��=��=��=��e?�e���eD�e�x�eB�e��en��enѶ�en��en�&�eE�e���eH�e���e��e��e�{�e���e�G�e���e��e���e��e�m�e�N�e�B�e�)�e��e�V�e��e���e��e��e��e��e��e���e���e��e��e��e��eǘ�e�2�e�P�e��e��e���eD�e�x�eB�e��en��enѶ�eE�e���eH�e���e���e�3�e��e��eו�e�d�e�X�e4�X�e�[��e�[��e�u��e�u��e�u��e��M��N�eЅuɯȧ�:�eЅuɯ��F�eЅuҽ��F�eЅuҽ�4�F�eЅuҽ�ɥ�F�eЅu4��eЅu4�Ҽ�eЅu4�F�eЅuɥ�F�eЅu�Z�F�eЅu�X�F�eЅu�Ҽ�eЅu�c���eЅu�����eʛ��D�e���D�e����x�e��B�e��B�e�����?������D���x��B�����n���nѶ��n���n�&��E������H�������������{�������G�����������������m���N���B���)������V��������������������������������������������ǘ���2���P���������%������D���x��B�����n���nѶ��n���n�&��E������H�������3�������������X��4�X��7���-���O��d��f���������������������`���;`���`4���;`ɥ���;`��4�;`����;`���4�;`���`���4�;`�3��`�3���;`�3��4�;`��3��4�;�}?�}���}D�}�x�}B�}��}E�}���}H�}���}��}��}�{�}���}�G�}���}��}���}��}�m�}�N�}�B�}�)�}��}�V�}��}���}��}��}��}��}��}���}���}��}��}��}��}ǘ�}�2�}��}��}ѵ�}�3�}��}���}D�}�x�}B�}��}E�}���}H�}���}��}ו�}����}�O�}d�}f�}��}��}��}��}��}��}���������G���������������������������������������������m�����?�������{�����{����������������l�¬��l�©��l���`���?������D���x��B�����E�����H������{���N���O��d��f�����������������������������Є��Є���}���"�?����D��x�B���E����H���������{�����G������������m��N��B��)����V������������������������������ǘ��2��P�����ѵ����D��x�B���n��nѶ�E����H�����3�����ו��7ŋ���Fŋ��?ŋ���Fŋ����ŋ���ŋ���ŋ���xŋ���ŋ��Eŋ��Hŋ���aŋ���{ŋ���ŋ���ŋ����ŋ���jŋ����ŋ��֧ŋ���Iŋ��ׇŋ���ŋ����ŋ���{ŋ���ŋ����ŋ���ŋ���ŋ���dŋ���ŋ���ŋ���Tŋ���ŋ���Fŋ��?ŋ���Fŋ����ŋ���ŋ���ŋ���xŋ���ŋ��Eŋ��Hŋ���aŋ���{ŋ���ŋ���ŋ����ŋ���jŋ����ŋ��֧ŋ���Iŋ��ׇŋ���ŋ����ŋ���{ŋ���ŋ����ŋ���ŋ���ŋ���dŋ���ŋ���ŋ���Tŋ���ŋ���Oŋ��dŋ��fŋ���ŋ���ŋ���ŋ���ŋ���ŋ���ŋ���ŋ���ŋ����ŋ��ʱŋ���ŋ���ŋ���
ŋ���Aŋ���ŋ��خŋ�����?������D���x��B�����n���nѶ��E������H�������������{�������G�����������������m���N���B���)������V��������������������������������������������ǘ���2���P���������%��ѵ������D���x��B�����n���nѶ��E������H�������3�������������d������E�f/?�f/D�f/�c�f/B�f/E�f/֤�f/H�f/���f/���f/�YD�f/ޞN�f/��f/��f/�{�f/���f/�G�f/���f/��f/���f/�m�f/�N�f/�B�f/�)�f/��f/�V�f/��f/���f/��f/��f/��f/��f/��f/���f/���f/��f/�q�f/�g�f/��f/��f/�J�f/�s�f/���f/��f/��f/��f/ǘ�f/�2�f/�P�f/��f/��f/���f/0lN�f/��f/���f/���;�f/���;�f/�3�f/��f/���f/���f/���f/���f/�ǘ�f/T�N�f/���N�f/u�b�f/u�*�f/u4�*�f/u��b�f/T���N�f/�����N�f/̗͘?͘D͘�c͘B͘E͘H֤͘͘��͘��͘n�͘n�͘ޞN͘�͘�͘�{͘��͘�G͘��͘�͘��͘�͘�m͘�N͘�B͘�)͘�͘�V͘�͘��͘�͘�͘�͘�͘�͘��͘��͘�͘�q͘�g͘�͘�J͘�s͘��͘�͘�͘�͘ǘ͘�2͘�P͘�͘�͘��͘�͘�"͘��͘��͘��2͘��͘0l�͘0l�P͘0l�I͘0l��͘0l�7͘0l�p͘0l݈͘0l�͘0l�͘0l�4͘0l�P͘0l��͘�3͘�͘�$N̗͘͘u�b͘u�*͘u4�*͘u�{͘�uھ�pɥ�V͘�uھ�p�V͘�uھ�o͘�	�͘�	��m����m����m����m����m����m���s�m��ǘ�m���G�m����m���{�m����m����m�����m�����m����m�����m����m����m����m�����m����m��?�m��E�m��D�m��H�m��B�m���r�m�����m��0��m��0�P�m��0���m��0݈�m��0�7�m��0��m��0���m��0�I�m��0Ĕ�m�������m�����m��������m�������m������m���������m���ט���m������m���ט���m���ט��m���@��m�����ǃ�m���@����m���@���m���Θ���m������m������m���Θ���m���Θ��m�������?������D���x��B�����n���nѶ��n���E�����H������������{������G���������������m���N���B���)������V����������������������������������������ǘ���2���P������������D���x��B�����n���nѶ��n���E�����H�����������3�������������X��4�X���	�Z���W���W���O��d��f�����������������������d��f�����������������������������ʱ��������
���A�����خ���8�2N��N�u�*������{��G����������m��������������������q��g���Ŧ��J��s�����������2�����?�̘��̘��̘�{�̘�G�̘���̘��̘���̘�m�̘��̘���̘��̘��̘��̘��̘���̘��̘�q�̘�g�̘��̘Ŧ�̘�J�̘�s�̘��̘��̘��̘�2�̘��̘��̘?����D�B�E�H��3����y?�y���yD�y�x�yB�y��yE�y���yH�y���y��y��y�{�y���y�G�y���y��y���y��y�m�y�N�y�B�y�)�y��y�V�y��y���y��y��y��y��y��y���y���y��y��y��y��yǘ�y�2�y�P�y��y��y�%�y���y��y���y���yD�y�x�yB�y��yn��yE�y���yH�y���y�3�y��yו�y���y���y��y�s�y��y�O�yd�yf�y��y��y��y��y��y��y��6y?�6y���6yD�6y�x�6yB�6y��6y�6�6y���6y�f�6y���6y��6yǘ�6y���6y���6y��6y��6y��6y��6y���6y��6y�{�6y���6y��6y��6y��6y���6y��6y�N�6y�B�6y�%�6y���6y��6y�)�6y��6y�G�6y��6y��6y��6y��6y��6y���6yD�6y�x�6yB�6y��6y�6�6y���6y�f�6y���6y�3�6y��6y��6y��6y�O�6yd�6yf�6y��6y��6y��6y��6y��6y��6y��G��G�{�G�G�G��G���G��G��G��G��G���G���G�m�G��G��G��Gǘ�G��G?�G�]�GD�GB�GE�GH�G�y�G��MЄ*�aʗ*�a�s*�a�*�a�*�a�*�aʭ*�s�*�s�
*�a��*�a�*�a�*�a�*�a�*�s��*�s�*�a�*�a�W*�a��*�a��*�s�U*������O*�f*�*�w*��*�R*ߗ*�p*�~*�4*ս*�]*lj*��*ߌ*�l*�U�!7*���!7*��7*���7*���J7*��7*�7*֨7*́7*��7*�W�L7*���7*�V*Ǒ*����M��
?
'?
'�
'�\�
'�
'�z
'�=�4
'�]
'�
��
�u
�v��
�v��4
�v�i
�v�\�
�v�
�v�{�4
�v�`
�v�>
�v��
�vvbvbB
�v�4
�"
�#�j
�#�\�
�#��b��
�#�0
�#ˁ
�
��
���
����b�
��
����
���i
���
���
���(
���e
���
���
��
��
�w
�x�
�j
�k�j
�ks�L
�kb���O�kb��
�kb���]
�G
�)
�
�ߚ
��
��
��
����
���,�
��������գ
������
�������7������
��
��
��
�
�y
�q
�k
�l�k
�j
�
�O
��
��?
���S
���{�4
�
���u
���H
��7�
��
���
��
��
�
�~
��<'b�
��<�w
��<�j
��<��
��<�{
��<�|b�
��<�
��<�
��<�A
��<�
��<�
��<�bݿ
��<�
��<�
��<ݿ
��<�b�
��<ݮ
��<�v
��<դbգ
��<�p
��<ˁ
��<�tb�
��<�
�b
�K
�J
�I
�
�
�k
�l�
�i
�_
�`��v�5�K
�K
��
����
���4
����
��
���
��
��
��
�
�
�
��4
��5�4
�
�
E
�գ
��׋׊
�S
�T'b�b�
�T�S
�T�N
�T��
�T�
�TB
�8
�,
�
��
���[
���\�
����
���7��
���O��
���]
�
�
�
�6
�7?
�7'b�
�7'b��
�7�j
�7�
�7��4
�7��5�4
�7�
�7��4
�7�{�4
�7��
�7���]
�7߲
�7�
�7��
�7�m
�7ݿ
�7�s
�7�h
�{
�|�4
�y
�z'b�b�
�z'b�
�z'b�z
�z�#�
b˚
�z�j
�z��
�z��b�i
�z�
�z�Pb�
�z��
�z��b�
�z�
�z�
�z�l�
�z��
�z�
�z�b�
�z��
�z���\�
�z�\�
�z�S
�z�
�z�
�z�b?
�z�b̬
�z�b�b�
�z��
�z��b�
�z�Hb�m
�z�C
�z�{�4
�z��b�Lb��
�z�
�z��
�z�W
�z�Xb�
�z߳b�j
�z�
�z��b��
�z�N
�z׊
�z׋׊
�z�
�z��
�z��
�z�
�z�b�

�z��
�z�u
�zˁ
�zB
�z�h
�z�ib��
�z�y
�t
�u�7�t
�r
�s�s�T�S
�i
�j�s�s�T�S
�h
�f
�]
�[
�\�
�\�[
�\�7�[
�S
�R
�L
�
�ߚ
�
�E
�B
��7�
�
��
��7�
�
�
��4
�
�'b�z
��\�
��z
��b�z
��
�
�
��7�
��
�ˁ
��
�L
�M�7�L
�J
�K�
�K��{�4
�K׊
�K��b�
�K�4
�A
�B'bߚ
�Bߚ
�B�Bݶ
�9
�7
�8�
�.
�-
�)
�(
�
��
��4
��
�G
�H��
�H��
�H�
�H�K
�H�r
�H�L
�H׊
�H�
�HB
�K
�C
�D�j
�D��
�D��
�D�5
�D�h
�?
D
�?
��
�
���
���]
�}
�z
�{�
�{�H
�{�{�����i�h
�{�4
�r
�s�\�
�q
�g
�hˁ
�h�7�g
�h�O�g
�h�]
�`
�V
�
��
�
�F?
�F�
�F�b߲
�F��
�F�
�F�j
�F�
�F��
�F�
�F�
�F�{
�F�i
�F�\�
�F�S
�F�Tb�1b?
�F�
�F�
�F�b��
�F��7�
�F�L
�F�-
�F�z
�F�g
�F�
�F�e
�F�W
�F�m
�Fݿ
�F��
�F��b��
�F��b�
�F��b�D
�F�N
�F�Obׅ
�F�v
�F׊
�F��
�Fь
�F�
�F��
�F�2
�F�
�F��
�FΗ
�F�[
�F�~
�F�e
�FB
�F�s
�F�h
�F�K�
�F�
�F�!
�8
�9�7�8
�-
�*
�(
�'
�%
�&�%
�
��{�4
�
��
��7�
�
�
��
���?v�?B
�����?v�?B
�
�e
�f�
�fB
�f�h
�W
�L
�>
�=
�;
�<�;
߻
߼�H��߼�H��
߲
߰
߱DŽ
߯
ߧ
ߨ�4
ߦ
ߚ
ߛ�Oߚ
ߓ
�|
�
�>
�??
�?'b�b�
�?'b�S
�?'b�
�?��
�?�j
�?����
�?�
�?��
�?�K
�?��
�?�{
�?�S
�?�A
�?�Bb�A
�?�
�?��
�?�H׊
�?�{�4
�?�g
�?�hb�
�?�hbݿ
�?�e
�?�L
�?߲
�?ߧ
�?ߨb�Hb?
�?�>
�?�5
�?ݿ
�?ݰ
�?��
�?��b��
�?�]
�?�v
�?�b�u
�?��b�b�
�?��b��
�?Ε
�?ΖbΕ
�?�u
�?ˏ
�?ˁ
�?�Eb'b̭b�
�?B
�?vb?
�?vbvbB
�?�tb��
�?�h
�?�
�?�]
�<
�=�
�=�b�u
�=�4
�=�5�=�5�
�8
�
��
�
�ߚ
�ߛbь
�m
�Z
�N
�5
ݿ
��
ݽ
ݾ��
ݾ�
ݾ�
ݾ��
ݾ�\�
ݾ�H�
ݾ�g
ݾ�*
ݾ�(
ݾ�)b��
ݾ�e
ݾ�Sb��
ݾ�>
ݾ��b��
ݾ�v
ݾ׺
ݾ�qb��
ݾ�Sb�
ݾ�
ݾ�
ݾ�7ݽ
ݾ�Oݽ
ݾ�]
ݾ��
ݼ
ݶ
ݷݶ
ݷ�Oݶ
ݷ��
ݳ
ݰ
ݮ
ݯݮ
ݯݯ�T�S
�
܀ˁ
܀�4
�x
�Y
�%
�
�
��
ۗ
�N
�
ڑ
ڒڑ
ڂ
ڃ�4
�o
�a
�]
�^?
�^ߚ
�^�s
�^�]
�^�^'b�
�^�7�]
�[
�\?
�\'b�
�\�
�\�4
�
�
��
���
���
���O��
��
���|
��
��
�v
�w?
�w�h
�w��
��
��E
��
ظ
ع�\�
ع�Tb�\�
ش
ص�j
ص��
ص��b��
ص�A
ص��b�\�
ص�v
ص׊
ص�
ص�b'�j
ص�b��
ص�b��b��
ص�tb��
ص�
ة
׺
כ
׊
׋�=�S
׋�=�
׋�=��
׋�=��׋�=��
׋�=�
׋�
׋׊
׋�7׊
׋�7׋�=�<
ׅ
׆�#��
׆�#��
׆�#��
׆�#�A
׆�#�{�4
׆�#�(
׆�#�
׆�#�v
׆�#�P
׆�#�s
׆�<��
׆�<��B
�
��
տ
գ
�
��
��?
���u
����
���
��E
��D
����
��B
���s
���7��
ԡ
Ԣ�
Ԣ�h
Ԣ�s
Ԣ�Oԡ
�
��
�H
ь
�
��|
�
�?
���
���
��
��
�ߚ
�ݮ
��N
�׊
���
���
�˚
��s
��n
��O
��
��
��
��4
��
���?��
��
��
�2
�0
�1?
�1�
�1�
�1�v
�1Ε
�1�

�1B
�1vb?
�.
�,
�
�
��K
���s�s�T�S
��˛˛�T�S
�
��
��
��
��
��
��?
���g
��
��?
���k
����
���_
���S
���z
���{�4
��ߓ
��ݰ
��ڂ
����
��
��
���
�������
��
Η
Θ�Η
Ε
Γ
�p
�q�4
�[
�Y
�Z�ZΕ
�R
�P
̬
̭̬
́
̀
�~
�u
�t
�X
�W
�
˩��
˩�G
˩�N
˩�4
˚
˛˛�����L�K
˛�]
ˏ
���
��A
��
�Η
��
��h
ˁ
�e
�D
�E�4
�z
�{�
�V
�?
�@ˁ
�@�?
�@�@�s�s�T�S
�(
�
�
�
�

���t�s
B
v�A
vvB
vv�����T�S
vv�Y�X
vvv�Yv�X
�s
�n
�h
�iߓ
�i�
�i�N
�ivbvbB
�ivbvbv�4
�i�4
�i��
�i���
�d
�O
�P�>
�P��b�
�P�0
�PB
�N
�J
�K��
�K�
�H
�I�4
�
��7�
���
�
�'b�
�'b�
���
��
�׊
��s
��tb��
��tb��
�
�
�
�

�?
���
��
��
��{
��i
��\�
��S
��L
��
��z
��g
���
��e
�ݮ
��
��
��
��Y
��(
�vb�A
��h
��
�
�	B
�
�?
�߻
�ߚ
�ˁ
�
�
�
�
��
����
��
�s
�t�
�tgߚ
�o
�g
�W
�!
�"�!
� 
�
��,�
�
�
�
�
�?
�
�
�	�
�v׊
�#?
�xߩ
��<�tb�
�}
�LbΗ
���
�7�A
�7�
�z�kb�b?
�z��
�/
�
�0
�F�G
�F��
�F�
�F�A
�F�H��
�Fݮ
�F�
�FΏ
�F�(
�F�
�?�
ݾ���
ݾ�b�
ݾΗ
ۖ
�\�s
�
ط
ض
ص�k
ص�
ל��د��
���
ԥ
��{�4
�r
�P��
vB
�c��
�s��
����
��e��
����
��G��
����
�س��
�s�K
���K
��e�K
���K
��G�K
���K
�س�K
��B
��eB
��B
��GB
��B
�سB
�a�
�c�
�s�
���
��e�
���
��G�
���
�س�
�a�
�c�
�s�
���
��e�
�c�
�s�
�s�DŽ
���
��e�
���
��G�
���
�س�
�a�

�c�

�s�

�s�DŽ
���

��e�

���jb�K
���jb�
�a��
�c��
�s��
�s��DŽ
����
��e��
�sD��
�sD��
��D��O
��D��M
��D��P?
��D��P�p
��D���
��GD��_
��GD��a?
��GD��a�p
��D��
��D��
�سDŽ��o
�سDŽ��n
�سDŽ��m
�سDŽ��p?
�c���
�s���
�����
��e���
�����
�a�[
�c�[
�s�[
���[
���\DŽ
��e�[
��e�\DŽ
��
��
�a�
�c�
�aʹ�K
�cʶ�K
��e��K
�aʹDŽ�?
�cʶDŽ�?
�a���
�a�X��
�%��a�
�%��a�W
�a�X�.
�a��.
��aʸ
��cʵ
���
���
��vDŽ
��evDŽ
��vDŽ
��GvDŽ
��vDŽ
�سvDŽ
��%���	�;
��S�
����
���ɰ
����]
�v׋�
�vΕ
��
���L�
�r�"
�r��
�r�s
���
�ˁ
�ߚ
�l�z
�lvvB
�j�h
���G
����
�����޸
���_
���
���
���{
���
����4
���
���
���G
���{�4
����
��ߚ
��ߓ
��ߔb��
���2
���
���ߚ
��ݴb�
���
��ۗ
���N
����
����
���
���q�4
�Tߚ
�Tգ
���
��7�
�7����
�7���G
�7���{�4
�7���
�7���
�7����
�7��ۗ
�7��̬
�7̬
�z�q
�z�l�4
�z���{�4
�z����
�z�
�z�{
�z�Tb�
�z�Tb�v
�z�b?
�zߔb��
�z�
�z�ߚ
�zݳ
�z�]
�z�v
�z�wb�S
�z�wb�
�z��
�z�
�u��د��
�B
���7�
�K�{�4
�Bb�ˁ
��
�4
�H���H��
�F�
�F�
�FvvB
�F�
�?��
�3
�1
�0
�/
�.
�-
�,
�+�+�4
�*
�)�(
�'
�&
�%
�$
�#
�"
�!
� 
�
�
�
�
�
�
�
�
�
�
�
��L
��z
�դbݼ
�դbդbݼ
��tb��
�
�
�
�
�
�
�
�
�
�

�
�	��
�	�
�	��5�4
�	߲
�	�
�	�e
�	�D
�	�s
�	�h
�	�
�
�
���
��{
��z
��{�4
���
�դbդbݼ
���b�e
��h
��
�
�
ݾ�5��
ݾ�K
ݾ��
ݾգ
ݾդbդbݼ
ݾˁ
�Ob�r
�^�^�{
�^�^�
ص�l�4
ص�
ص�9
ص�G
ص�
ص�.
ص�
صդbգ
صB
صvbB
ص�
��5�
���
����޸
�ˁ
�/�
��
�b�C
�b��
�b��
Ζb����
Ζb�T�j
�qˁ
˂b�
��\�
�s�K
��
��h
��J
��
�ݼ
�r
��b��
�s�L�������������������������������������������������������������������}�|�{�z�y�x�w�v�u�t�s�r�p�o�n�l�k�j�i�h�g�f�e�b�a�`�_�^�]�\�[�Z�Y�X�W�V�U�T�S�R�Q�P�O�K�J�I�H�n�l�j�h�f�e�c�a�_�]��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������~�}�|�{�z�y�x�w�v�u�t�s�r�q�p�o�n�m�l�k�j�i�h�g�f�e�d�c�b�a�`�_�^�]�\�[�Z�Y�X�W�V�U�0�/�.�-�,�+�*�)�(�'�&�%�$�#�"�!� �������������������
���
�	����������������������������������������������������������������������������������������������~�
���
�	�������������������������������������������O�N�M�L�K�J�I�H�a�`�_�^�]�\�[�Z�Y�X݆݄݂݅݀��}�{�y�w�u�s�q�p�n�l�k�j�i�h�g�f�e�d�b�`�^�]�[�Z�X�W�U�S�Q�O�M�L�J�H�G�E�C�A�?�>�<�:�8�7�5�3�2�1�/�-�+�)�'�%�#�"� ����2�1�0�/�.�-�,�+�*�)�(�'�&�%�$�#�"�!� �������������������
���
�	��������o�n�m�l�k�j�i�h�g�f�e�d�c�b�a�`�_�^�]�\�[�Z׶׵״׳ײױװׯ׮׭׬׫תשרקצץפףעסנןמם�
�	�����������������������������������������������������������������������������������������������������������������������������������������ӦӥӤӣӢӡӠ������������������
���
�	�������������M�L�K�J�I�H�G�F�E�D�C�B�A�@�?�>�=�<�;�:�9�8�7�6�5�4�3�2�1�0�/�.�-�,�+�*�)�(�'�&�%�$�#�"�!� ��������������������������������������������������˿˾˽˼˻˺˹˸˷˶˵˴˳˲˱˰˯ˮ˭ˬ˫˪ȣȢȡȠȟȞȝȜțȚșȘȗȖȕȔȓȒȑȐȏȎȍȌȋȊȉȈȇȆȅȄȃȂȁȀ��~�}�|�{�z�y�x�w�v�u��������������������������������������������������������������������������ǿǾǽǼǻǺǹǸǷǶǵǴdzDzDZǰǯǮǭǬǫǪǩǨǧǦǥǤǣǢǡǠǟǞǝǜǛǚǙ������������ſžŽżŻźŹŸŷŶŵŴųŲűŰůŮŭŬūŪũŨŧ������������������������ĒđĐďĎčČċĊÝÜÛÚÙØ×ÖÕÔÓÒÑÐÏÎÍÌËÊÉÈÇÆÅÄÃÂÁÀ��~�}�|�{�z�y�x�w�v�u��������������������������������������������������������������������S�|��|�,������,���U��,�������,���U����?���z���z������������������������������������������������������������}�|�{�z�x�w�v�u�t�s�r�q�p�n�m�l�j�h�g�f�e�d�c�b�a�`�_�^�]�\�[�Z�Y�X�W�V�U�T�S�R�Q�P�O�N�M�L�K�J�I�H�G�F�E�D�C�B�A�@�?�>�=�<�;�:�9�8�7�6�5�4�3�2�1�0�/�.�-�,�+�*�)�(�&�%�$�#�"�!� �������������������
���
�	����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������~�}�|�{�z�y�x�w�v�u�t�s�r�q�p�o�n�m�l�k�j�i�h�g�f�e�d�c�b�a�`�_�^�]�\�[�Z�Y�X�W�V�U�T�S�R�Q�P�O�N�M�L�K�J�I�H�G�F�E�D�C�B�@�?�>�=�<�;�:�9�8�7�6�3�2�1�0�,�+�*�)�(�'�&�%�$�#�"�!� ������������������
���
�	�������������������������������������������������������������������������������������I�H�����������������������ϫ�������������������������������������N�����N��������������������������������������������������������������������������������������~�}�|�{�z�y�x�w�v�u�t�s�r�q�p�o�n�m�l�k�j�i�h�g�f�e�d�c�b�a�`�_�^�]�\�[�Z�Y�X�W�V�U�T�S�R�Q�P�O�N�M�L�K�J�I�H�G�F�E�D�C�B�A�@�?�>�=�<�;�:�9�8�7�6�5�4�3���x��8�+��^�yԧ��^�yԨ���x�Β��8�x��7�x�����ؔ��^��ؕԧ��^��ؕԨ��c��)�d��A��`��1��N��I�������s��J������މߑ���ۀ��g��}����������&��$ۃ�vû������������ ��q�ۆ�ڿ��"���޹�٠޹����a�ؽ�����!�ݻ�ͬ�����^���ٜ�ߟ���Ύ�����r�������ͨ��,���������θ������M�������u��,��)��]�ؠ�����\���ͥ��������e��Y�������q�ݿ��e�����������)�b��^��M�(���������f��U�� �������K��s޹�����g�������أ����ԝ��)�����؞�����y��������Z�����������M�Հ��*���L��(��������˞�ۅ��������{����������k����ۄ�*����������܀ؘ�܀؀�ވ��0�������D�����d��6����ŏ��)�ٔ����������?��O�ۇ��������ԣ�م��������������m��0�����������!�����7��H�َ�˜�؄��8���̟���g��)����܀��������������p������������ٓ�����������+����ь�آ����5�����ؚ����!��]����ݿ�ߑ�ؠ��������������ߡ�u����ٛ�܀���ā�ٚ�Α��K�����d����������������ò�ؖ��;�ڋ�������������?�����9�԰��A������ō�ؔ��x�ؒ��f�ؗ�����/��g������������������؟������u�ߢ�����}�ْ��A�ۃ��J��;�ؙ��������(��������ٖ��h�ނ�ل�����l�Ӿ��j��z�ݮ�������߆��\���ͥ�ò�������/��	��������ԩ����A�ވ��0��|�����գ�ÿ�ٛ����̡�ߦ��%�����ۇ�ߜ��������_��.�ށ������؄����߻��օ�ˑ�����Y��	�޻�ۻ�݈��J�ڑ��������j�׺�Η�����O����η�����L�����چ��z�׽���������hٚh�h��h��h��h��h��hͰh��h��h�}h��h�uh�h��h��hЁh�&h��h�hߠh��h��h�h�eh�h�h��h�hؖh�Mh�
h�h�rh��h�
hءh�+h��h�+hيhː��h�Lh��hٞ͸h��gh�h��h�"h�$h�uh�h�h̠h�h�,h�Th�Ph��h˝h��h�5h��h�mh��h�4h�qh�;h�hߪh�]h�Z��h�	h�~hُh��h��hރh��h�:h�h�h�hh�
h��h��h׾h�h�"h�'h�Z��h� h�Yh�;h��h��hڋh��h��Dh�Mh��h�hߑh��h��h�#h�h���3h��h�,h؛h?h��hHhDh��h���~hˢh�fhٞ�@�Wh��h�h��h��h���5h���Vhúh��h�h�
h؜�h��h��h�h�qhݿh�Nh�[h��h��h�Gh��hηh��҂h�h��h��h�hۤh�h�(h�h�eh��h�h��h�����B�߻��6�қ�ˑ��Y����	��9�ۻ�ˢ�ٝ�آ�݈��J�����p��H��j���ך�׺�؅����Η�������
��������O�ь�����[������2��������,�Ŧ��m����������~������������������ڕ�ڕ�ڕ�ڕ�ڕ��ڕ�ڕ?ڕ�ڕ�ڕ�ڕ�oڕ�ڕ��ڕֆڕ�eڕطڕ�ڕ�fڕHڕ��ڕ��ڕ��ڕ�RڕŦڕEڕ�ڕ��ڕ�ڕ��ڕ�Hڕ�%ڕ�Oڕdڕfڕ�ڕ�ڕ�ڕ�ڕ�ڕ�ڕ�ڕ�Xڕ4�X�;Ǖ��;Ǖ��;ǕГ�;Ǖ��;Ǖ��;Ǖ��;Ǖ�l�;Ǖ�;Ǖ��;Ǖ�;Ǖ�*�;ǕŦ�;Ǖ��;Ǖ�4�;Ǖ��;Ǖ�9�;Ǖ��;Ǖ��;Ǖ���;Ǖ��;Ǖ�?�;Ǖ��;ǕŞ�;Ǖ?�;ǕH�;Ǖ�f�;ǕB�;Ǖ�6�;ǕE�;ǕD�;Ǖ&���;Ǖ&~��;Ǖ&�A��;Ǖ&����;Ǖ&�.��;Ǖ����V�DžV�ÅV�Z�V�5�V��V��V߫�Vߎ�V�ɅV�V��V��V��V��V�܅V�څV߭�V߬�V��V��V�\�V�[�V�-�V�߅V߄�V�{�V�6�V�.�Vl�|�Vl��Vl�ׅVl螅Vl�Y�Vl��Vl�t�VlӅ�Vl�P�Vl��Vl��Vl�k�Vl٢�Vl�օVlԆ�Vl�DžVl�ʅVl���Vl�̅Vl�Z�Vu���Vu��ȅVu�அVu��Vu�̞�Vu�笅Vu��X�V��ʦ�V���f�0�V�`�V���…V��볅VĠ׻�VĠ�J�VĠ�ޅVĠ�܅V���{�Vۺ̢�V����V���d�V�˅V��Y�ׅV�O�Vd�Vf�V��V��V��V��V��V��V��V��V�7�V�ʝ�V��V�:��V����Vɧ�V��ݺ�Vĝ�V��Vʷ��V����V�ƅV��V�ÅV׿�V���V��/�Vۺ�i�V�Y�V�څV�_�V���ݤ���ąV��(�`�V��υV����V����8�V����V���d�V���A�V���6�V���ՅV��Ĝ�V����V��蛅V��ډ�V��ʧ�V���n�V����V���V���ۅV��ǒ�V���؅V���k�V���S�V����V������݈���P��������������Þ�����������������1��D���P��?������E���p������B���������ӧ���T���o����������֤���7�����H������Ĕ��݈���P��������������Þ�����������������1��D���P��?������E���p������B���������ӧ���T���o����������֤���7�����H������Ĕ���O��d��f���������������������������������ʳ������������D�����ذ��a����c����s������������������Z֕m�m��m�mԖm�m�Qm���m��mǘm�$m�m�m�Nm�m�Nm�)m�m��m�Vm���m�Vm�Hm�mݖm�zm�om�,m�%m�$m�$m�m�{m�mӟmӈm�Gm�m���Gm�m��m��m��m�Xm�m�mm�[m�gm�m�gm�mҙ�gm�2m�Pm�Jm�m�qm�m�qm�m�sm�m��m��m����m��m��mŦm��m�Pm�+m�*m�m�Dm�kmяmlI�m��m��mҙ��mҙ��m?m��m��m�jm�amHm�fm�"m��mEm��m��m֠mDm��m��m��m�m�m�xm��m�<mBm�rm�qm�pm�m�`m�8mĔm�m��m��m�mѹ�m�mѹ�m��m�!m��m�'m�7m�Im�(m��m֚m֡m��m�}m�Rm�
m�Zm��m����m�9m�<m�	m�m�m�m�m�m�mҙ�
mҙ�	mҙ�mҙ�mҙ�mҙ���N+��N%�=�N%�=��N�����������������������~�}�|�{�z�y�x�w�v�u�t�s�r�q�p�o�n�m�l�k�j�i�h�g�f�e�d�c�b�a�`�_�^�]�\�[�Z�Y�X�W�V�U�T�S�R�Q�P�O�N�M�L�K�J�I�H�G�F�E�D�C�B�A�@�?�>�=�<�;�:�9�8�7�6�5�4�3�2�1�0�/�.�-�,�+�*�)�(�'�&�%�$�#�"�!� �������������������
���
�	����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������~�}�|�{�z�y�x�w�v�u�t�s�r�q�p�o�n�m�l�k�j�i�h�g�f�e�d�c�b�a�`�_�^�]�\�[�Z�Y�X�W�V�U�T�S�R�Q�P�O�N�M�L�K�J�I�H�G�F�E�D�C�B�A�@�?�>�=�<�;�:�9�8�7�6�5�4�3�2�1�0�/�.�-�,�+�*�)�(�'�&�%�$�#�"�!� �������������������
���
�	����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������~�}�|�{�z�y�x�w�v�u�t�s�r�q�p�o�n�m�l�k�j�i�h�g�f�e�d�c�b�a�`�_�^�]�\�[�Z�Y�X�W�V�U�T�S�R�Q�P�O�N�M�L�K�J�I�H�G�F�E�D�C�B�A�@�?�>�=�<�;�:�9�8�7�6�5�4�3�2�1�0�/�.�-�,�+�*�)�(�'�&�%�$�#�"�!� �������������������
���
�	����������������������������������������������������������������������������������������������������������������������������������������������������������G��E����E8��8��8��8��8�8�8�8�8ȱ8Ȱ8ȯ8Ȯ8ȭ8�8�8�8�8�8�8�8�8�E8�B8�A8�@8�?8�>8�=8�<8�;8�D8�C8�:8�d8�c8�b8�a8�`8�_8�^8�]8ߺ8߹8߸8߷8߶8ߵ8ߴ8��8��8��8��8��8��8�
8�	8�8�8�8�8�8�8�8�8�8�8�o8�n8�m8�l8�k8�j8̫8̪8̩8̨8̧8̦8̥8̤8В8Б8А8Џ8Ў8��8��8��8��8��8��8�8˨8˧8˦8˥8�y8�x8�w8�v8�u8�t8�s8�'8�&8�%8�$8�#8�C8�B8�A8�@8�?8�>8�=8�<8�;8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8��8��8��8��8��8��8��8��8׹8׸8׷8�u8�t8�s8�r8�q8�p8�o8�18�08�/8�.8�-8�8�8�8�8�8�8�8�8�8�8�8�F8�E8�D8�C8�B8�A8�@8�J8�I8�H8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�~8�}8�|8�{8�z8�y8�M8�L8�K8�J8�I8�H8�G8ڐ8ڏ8ڎ8ڍ8��8��8��8�8�8�8�8�8�8ĉ8Ĉ8ć8Ć8ą8Ă8��8��8��8��8�8�8�8�8�8�8�8�8�8�8�G8�F8�E8�D8�C8�B8�A8ы8ъ8щ8ш8ч8ц8Ҷ8ҵ8Ҵ8ҳ8��8��8��8��8��8��8ť8Ť8ţ8Ţ8š8�E8�D8�C8�B8�A8�l8�k8�j8�i8�!8� 8�8�8�8�8�8�48�3��F��m��"G�FG�mG�"G�7+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+�+�~+�}+�|+�{+�z+�y+�x+�w+�v+�u+�t+�s+�r+�q+�p+�o+�n+�m+�l+�k+�j+�i+�h+�g+�f+�e+�d+�c+�b+�a+�`+�_+�^+�]+�\+�[+�Z+�Y+�X+�W+�V+�U+�T+�S+�R+�Q+�P+�O+�N+�M+�L+�K+�J+�I+�H+�G+�F+�E+�D+�C+�B+�A+�@+�?+�>+�=+�<+�;+�:+�9+�8+�7+�6+�5+�4+�3+�2+�1+�0+�/+�.+�-+�,+�++�*+�)+�(+�'+�&+�%+�$+�#+�"+�!+� +�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�
+�+�+�
+�	+�+�+�+�+�+�+�+�+�+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+��+�+�~+�}+�|+�{+�z+�y+�x+�w+�v+�u+�t+�sr�r��r�r��r�1r�Pr�r�pr��r��r�r�r��7r���Pr�2�7r�Q݈r� �Pr��r���r�r�%r����r�r�{r�Nr݈r�7r��r�Pr݉�7r�8݈r��݈r�Q��r݉�r�8�r���r����*9r�Q�r�QL<r݉�Pr�8�Pr���Pr�Q�Pr݉�8�Pr�8݉�Pr��݉�Pr�Q���Pr���Q�r���7r���8�Pr�Q��r�Q�ِr�Q�r�Q��r���Pr��� �Pr��r�Qr�Ȑr�Q�7r�Q݈r�Q� �Pr�� �Pr�Q�Pr�Q�Q�r?r���r־rHr�/rDrEr�rζDr�Zr�6r���(r��Dr���6r�Dr�ErBr�trīrv�7r�Br��Br�\r��Br�cr�r�'rŦr�"r�Fr�`r�r��Br��Hr��Dr��?r�"�jr�"�{r����r��jr���wrn݈r��2�Љr���A�Љr��5�Љr��~SЉr���ASЉr��SЉr��Љr��ޯЉr���mr��ˇr���zr���zr���nzr��r���e�r���dr���dr���r���r���Kr���zr���dr��~�r��~�e�r��~�dr��~��dr��~�r��~�r��~�Kr��~�zr��~�dr��~3r��=r��rr4Nr��;����Ω��Ω���Ω����Ω�|��C"��C"�CC"�&C"��C"��ZC"Lj�C"Lj�ZC"��C"��C"ՓC"��C"���ZC"��C"�*�C"�T�C"�#C"�C"�C"� �ZC"��C"ʬC"ւ��C"���C"��C"�C"�}C"��C"��C"��C"жC"ՉC"��#C"���C"LJ��C"�$��C"�C"�C"�UC"���C"�JC"�gC"�uC"��C"��ې�C"���C"��C"ޢC"�C"ɶC"�C"��C"�*�T�aC"��C"�cC"ɗ��C"��ɖC"�CC"��C"��C"�*��C"��C"Ֆ��C"Ք��C"��C"��C"�C"��C"ɗ��C"��C"�VC"���aC"ւ�aC"��aC"�C"��C"�C"��C"�D�aC"��b�IC"��b�IC"��C"� �aC"�!���aC"��C"��C"�C"�C"�$��C"Lj�aC"���aC"���aC"�~C"�<C"ݓC"Ք�aC"Ֆ�aC"�zՕC"�hC"�=C"ɗ�aC"�	C"���aC"��C"�*�aC"�C"�v�aC"ļ�C"ɔC"��C"ɘC"ɕC"��C"ɓC"��C"�~C"��C"�z��C"��aC"���C"���SC"��%C"��� �C"��C"��C"���C"��IC"�C"��IC"�[��C"���C"���C"���aC"�$�aC"�&C"�ZC"ɣC"�C"��C"ާ�� C"ާ�!C"ާɦ�!C"ާ��!C"ާ�^� C"��b�IC"�Պ��C"�Պ�C"�sC"�tՊ����C"�tՊ��IC"�tՊ�C"ɫC"��C"�eC"�C"���d��C"���C"���C"��ۊC"��ەC"���C"���}C"���d�C"�����C"�������C"����C"������C"�ɞ��C"�ɬC"����C"��ޫ��C"�ޫ��C"�Ԓ��C"����C"�!���C"���C"����C"���yC"�ǁ��C"�����C"�Ԓ���C"�z�8�%C"�z�8�YC"��� ����C"�dC"�bC"�����C"��C"�����C"������C"����C"�����C"�����C"����C"�������C"�����IC"���D�"�yC"���D�"��C"���"ǀC"����"�C"���dC"�#��C"�#�C"�#͋C"�����C"����>C"�ɟC"�ɟC"��C"�'��C"�����C"��p�`�C"�ɩֈ�C"��'��C"�����C"��p�`�C"�ɩֈ�C"��C"��C"�'�%C"�'۳C"��ZC"���C"�H��C"�H���JC"�H��ɠC"�H���C"�H��C"�H���JC"�H��ɠC"�H���C"�q�C"�x�'C"��C"��C"����C"���{C"���C"����C"���C"����C"��b۔C"��b۔C"��b��C"��b��C"���C"��b��"�>�K"4�K"0�K"�Z0�K"�@�K"ζ�K"2�x7"5�x7"�x�"�l�y"�z"�y"�"�v�"�v�"�v�"�"�<"�1N"��"�?"�"�r�"���"ʕ�"��"�d�"��"���"���"���"����+��"����+�:"����"�2��"�2���+��"�2���+�:"����"����"�x���e"4�"4�R"�S�$"�S��"���$"����"�
�$"�
��"�X��"�X��R"��N"��N"�+��"�+�:"�E��"�E�:"�{�e"�G�e"��e"�X�e"��e"��e"ʮ�e"��e"a�:���e"���	"b�	"����	"/�
�I"/�
��"ɵ�
|�I"ɵ�
|��"ɵ�
2�I"ɵ�
2��"ɵ�
5�I"ɵ�
5��"ɵ�
��I"ɵ�
���"ɵ�
|5�I"ɵ�
|5��"ھ�
�I"ھ�
��"ɲ�
��I"ɲ�
���"Ս�	"���	"�
��"ד�	"��
�I"��
��"�/"�G�
"��
"�X�
"��
"��
"ʮ�
"��
"a�:���
"&��"&�e��"&ɽ"&ɼ"&ɻ"�}ɽ"�}ɼ"�}ɻ"&���"&�\"&�["&�Z"&�Y"&�X"��"��"���k"���k"����"����"����"����"&�"&�"&�"&�"&�!"&� "&�"&��"���$"����"&�
"&�"&�G"&��"&��"&4�"&ɥ�"�"̚"Þ"��"ہ"�"�I"��"�u��"�u��3�"��"�"��"��"��$"�<��"�<�"�<̿"�<̾"�<̽"�<̼"�<̻"�<̺"�<̹"�<��"�<�"�"�n"��M��"���"&��M"&|�M"&�"&��ԗ"�TN"�T|N"��TN"��$"���"�|"�["�\��"�"��"�,"�m�I"�m��"�"���"�g�I"�g��"���I"���"���+�e"���[�e"�-�e"�m�e"��e"�g�e"��)� ��*"��)� ��Z"��)� ��+�d"��Y� ��*"��Y� ��Z"��Y� ��[�d"��Y� ��[�c"��Y� ��[�b"�@"�Y����"�Y�2��"/�p"�"�r"��"Ь"��"��"�R"�S�J"Э�J"���b"�̐"�S����"�S��M��"�S0�
"�SҪN"�S�G�
"�S��
"�S�X�����"�S�X����$"�S������"�S�����$"�S�S7 ���( ��� ��� ��� ��� ��� ��� ��� ��� ���' ���& ���% ���$ ���# ���" ���! ���  ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� �(��( �(�� �(�� �(�� �(�� �(�� �(��& �(��% �(��$ �(��# �(��  �(�� �(�� �(�� �(�� �(�� �(�� �(�� �(�� �(�� �(�� �(�� �(�� �(�� �(��
 �(�� �(��
 �(��	 �(�� �(�� �(�� �(�� �(�� �(�� �(�� �(�� �(��& "ɡ& "�& "�5 "ަ�׎�O�׎d�׎f�׎��׎��׎��׎��׎��׎��׎��׎��׎��׎���׎ʳ�׎��׎��׎��׎�D�׎��׎ذ��$�H�r$�y�H�r$�>�H�r$�G�z�r$�G�=�r$�H�$�$�$����$��$�F�$�����$�z�$���$�N�$�7�"�$���I�B�$�?�$���$�M�$�?�$Ҳ�$��$���$Ř�$�.�$���$҅�$�i�$�F�$�q�$��$���$��$��$���$�h�$���$ު�$���$�G�$�H�$���$���$���$�j�$���I���$�f�$��۷�$���$���$�\�$���$�n�$��$�H�$��IŃ�$��$���$�{�$�/�$�e�$��ڤ�$�D�$�I�V�$��$��$���$���$Ł�$�9�$�2�$���$�E�$�a�$�W�$�@�$���$��$��$���$���$���$��$�x���g�$�{�$�F�$�
�X���2d�X���2f�X���2��X���2��X���2��X���2��X���2��X���2��X���2��X���d�X���f�X�����X�����X�����X�����X�����X�����X������vud��vuf��vu���vu���vu��vud�vu�
?
�p
��
��
E
�1
�
�
D
��
�P
�
݈
�7
H
�
ӧ
�
�P
��
B
��
��
��
Ĕ
Þ
?
�p
��
��
E
�1
�
�
D
��
�P
�
݈
�7
H
�
ӧ
�
�P
��
B
��
��
��
Ĕ
Þ
)?
)�p
)��
)��
)E
)�1
)�
)�
)D
)��
)�P
)�
)݈
)�7
)H
)�
)ӧ
)�
)�P
)��
)B
)��
)��
)��
)Ĕ
)Þ
)?
)�p
)��
)��
)E
)�1
)�
)D
)��
)�P
)�
)݈
)�7
)H
)�
)ӧ
)�
)�P
)��
)B
)��
)��
)��
)Ĕ
)Þ
)?
)�p
)��
)��
)E
)�1
)�
)�
)D
)��
)�P
)�
)݈
)�7
)H
)�
)ӧ
)�
)�P
)��
)B
)��
)��
)��
)Ĕ
)Þ
)?
)�p
)��
)��
)E
)�1
)�
)�
)D
)��
)�P
)�
)݈
)�7
)H
)�
)ӧ
)�
)�P
)��
)B
)��
)��
)��
)Ĕ
)Þ
�?
���
���
��
���
��P
��7
�H
��
�ӧ
��P
���
�B
���
���
���
�Ĕ
�Þ
�?
��p
���
���
��1
��
�D
���
��P
��
�݈
��7
��
�ӧ
��
��P
���
�B
���
���
���
�Ĕ
�Þ
�?
��p
���
���
�E
��1
��
��
�D
���
��P
��
�݈
��7
�H
��
�ӧ
��
��P
���
�B
���
���
���
�Ĕ
�Þ
�?
��p
���
���
�E
��1
��
��
�D
���
��P
��
�݈
��7
�H
��
�ӧ
��
��P
���
�B
���
���
���
�Ĕ
�Þ
�?
��p
���
�E
��1
��
���
��P
��
�݈
��7
�H
��
�ӧ
��P
���
�B
���
���
���
�Ĕ
�?
��p
���
���
�E
��1
��
��
�D
���
��P
��
�݈
��7
�H
��
�ӧ
��
��P
���
�B
���
���
���
�Ĕ
�Þ
��?
���p
����
��E
���1
���
��D
����
���P
���
��݈
��H
���P
����
��B
����
����
����
��Ĕ
��?
���p
����
����
��E
���1
���
���
��D
����
���P
���
��݈
���7
��H
���
��ӧ
���
���P
����
��B
����
����
����
��Ĕ
��Þ
�?
��p
���
���
�E
��1
��
��
�D
���
��P
��
�݈
��7
�H
��
�ӧ
��
��P
���
�B
���
���
���
�Ĕ
�Þ
�?
��p
���
���
�E
��1
��
��
�D
���
��P
��
�݈
��7
�H
��
�ӧ
��
��P
���
�B
���
���
���
�Ĕ
�Þ
-?
-�p
-��
-��
-E
-�1
-�
-�
-D
-��
-�P
-�
-݈
-�7
-H
-�
-ӧ
-�
-�P
-��
-B
-��
-��
-��
-Ĕ
-Þ
-?
-�p
-��
-��
-E
-�1
-�
-�
-D
-��
-�P
-�
-݈
-�7
-H
-�
-ӧ
-�
-�P
-��
-B
-��
-��
-��
-Ĕ
-Þ
-?
-�p
-��
-��
-E
-�1
-�
-�
-D
-��
-�P
-�
-݈
-�7
-H
-�
-ӧ
-�
-�P
-��
-B
-��
-��
-��
-Ĕ
-Þ
-?
-�p
-��
-��
-E
-�1
-�
-�
-D
-��
-�P
-�
-݈
-�7
-H
-�
-ӧ
-�
-�P
-��
-B
-��
-��
-��
-Ĕ
-Þ
-)?
-)�p
-)��
-)��
-)E
-)�1
-)�
-)�
-)D
-)��
-)�P
-)�
-)݈
-)�7
-)H
-)�
-)ӧ
-)�
-)�P
-)��
-)B
-)��
-)��
-)��
-)Ĕ
-)Þ
-)?
-)�p
-)��
-)��
-)E
-)�1
-)�
-)�
-)D
-)��
-)�P
-)�
-)݈
-)�7
-)H
-)�
-)ӧ
-)�
-)�P
-)��
-)B
-)��
-)��
-)��
-)Ĕ
-)Þ
-)?
-)�p
-)��
-)��
-)E
-)�1
-)�
-)�
-)D
-)��
-)�P
-)�
-)݈
-)�7
-)H
-)�
-)ӧ
-)�
-)�P
-)��
-)B
-)��
-)��
-)��
-)Ĕ
-)Þ
-)?
-)�p
-)��
-)��
-)E
-)�1
-)�
-)�
-)D
-)��
-)�P
-)�
-)݈
-)�7
-)H
-)�
-)ӧ
-)�
-)�P
-)��
-)B
-)��
-)��
-)��
-)Ĕ
-)Þ
��?
���p
����
����
��E
���1
���
���
��D
����
���P
���
��݈
���7
��H
���
��ӧ
���
���P
����
��B
����
����
����
��Ĕ
��Þ
��?
���p
����
����
��E
���1
���
���
��D
����
���P
���
��݈
���7
��H
���
��ӧ
���
���P
����
��B
����
����
����
��Ĕ
��Þ
)�D
)���
��
��
�^
��
�
�N
�~
��
�
�
�
ڑ
׺
��
�z
��
�J
��i
�V
�Y
�
�
�K
��
�|
��
��
��
�^
��
�
�N
�~
��
�
�
�
ڑ
׺
��
�z
��
�J
0�V
�V
�Y
�
�
�K
��
�|
Մ�|
�i
��i
�i
�i
�Ki
��i
)��
)��
)�^
)��
)�
)�N
)�~
)��
)�
)�
)�
)ڑ
)׺
)��
)�z
)��
)�J
)��i
)�V
)�Y
)�
)�
)�K
)��
)�|
)��
)��
)��
)�^
)��
)�
)�N
)�~
)��
)�
)�
)�
)ڑ
)׺
)��
)�z
)��
)�J
)0�V
)�V
)�Y
)�
)�
)�K
)��
)�|
)Մ�|
)�i
)��i
)�i
)�i
)�Ki
)��i
)��
)��
)�^
)��
)�
)�N
)�~
)��
)�
)�
)�
)ڑ
)׺
)��
)�z
)��
)�J
)��i
)�V
)�Y
)�
)�
)�K
)��
)�|
)��
)��
)��
)�^
)��
)�
)�N
)�~
)��
)�
)�
)�
)ڑ
)׺
)��
)�z
)��
)�J
)0�V
)�V
)�Y
)�
)�
)�K
)��
)�|
)Մ�|
)�i
)��i
)�i
)�i
)�Ki
)��i
-��
-��
-�^
-��
-�
-�N
-�~
-��
-�
-�
-�
-ڑ
-׺
-��
-�z
-��
-�J
-��i
-�V
-�Y
-�
-�
-�K
-��
-�|
-��
-��
-��
-�^
-��
-�
-�N
-�~
-��
-�
-�
-�
-ڑ
-׺
-��
-�z
-��
-�J
-0�V
-�V
-�Y
-�
-�
-�K
-��
-�|
-Մ�|
-�i
-��i
-�i
-�i
-�Ki
-��i
-)��
-)��
-)�^
-)��
-)�
-)�N
-)�~
-)��
-)�
-)�
-)�
-)ڑ
-)׺
-)��
-)�z
-)��
-)�J
-)��i
-)�V
-)�Y
-)�
-)�
-)�K
-)��
-)�|
-)��
-)��
-)��
-)�^
-)��
-)�
-)�N
-)�~
-)��
-)�
-)�
-)�
-)ڑ
-)׺
-)��
-)�z
-)��
-)�J
-)0�V
-)�V
-)�Y
-)�
-)�
-)�K
-)��
-)�|
-)Մ�|
-)�i
-)��i
-)�i
-)�i
-)�Ki
-)��i
�v
�v
�O
d
f
�
�
�
�
�
�
�
���O
��d
��f
���
���
���
���
���
���
���
-�O
-d
-f
-�
-�
-�
-�
-�
-�
-�
-�O
-d
-f
-�
-�
-�
-�
-�
-�
-�
���O
��d
��f
���
���
���
���
���
���
�����H���H���H��H���H���H�����΄�����@��������������%���&���΄�'���?�΄�?��p����p���
��p�%��|p�%���&p�$��p���p����p�p����p����p��%��p�:�΄p�:�p���H�����?��pʍ�΄pʍ��p�ڢ����p�ڢ����p�����p�&�g��a��|p�&��a��|p�&�����&p|��a��p|�g����p����p����p����p��%���̄p����p��a��p��b���p��b���p�礄�$����p�$��p��&��a��p�;��a��p����p�����p����$����p�$�p�.��$�p�.��%����Y�#p�$����Y�Wp�$���.p�$��p���%��p��Y�"��p��X�p��Y�#��$�p��Y�#��:�p��Y��$����p�%����z����{������{�%����{�����{��p����{����{������{����e�{�f���t�e�{�f���e�{�g������t�e�{�g������e�{�g�����t�e�{�g�����e�{�g�����e�{�f���e�{�g�\���e�{�g�\��e�{�f���e�{�g�%���e�{�g�&��a���e�{�g�&�3ʍ������������s�Ţ�a���t��a�Ţ���Ţ����q���a���q�$���q�%��a���q�%��b�����q�.���̢�a���3ʍ�̢�������\������a�ʢ�a���3ʍ���3ʍ�����ʢ����\�����迢�a��3ʍ迢����\��������������a�â�a���3ʍ���3ʍ�â�b���H�â��p�����p��΄p��Äp��Єp����.��p�����p���Äp����/����/������/���	��/��-���/�$���@�/�$���/�$��/�$���/�$��/�����/����/��ʍ��/ʍ���/ʍ��/�ʍ���/�ʍ���/�����"���/���ʍ��/�H���/�H���/�H���/�H��p�.�΄p�.�Äp�.����Єp�.��p�>�.�΄p�>�.������������?����p���=���$��������.����.���.����.���?��p���p���
���H��ʍ��ʍ����.�΄��.�Ȅ��/�w���/�"���/�V���/�?�ʄ��.�Ä��.�Є��/�"�Є��.�p�����?�p�$��p�$�p����p|��a�pʍ�p��.�p�.�p��.��p��.��p��/�w��p��.��p��.��p��/�"��p��/�V��p��.��p��/����p��/���p��/��a�p��/��"�p��/��V�p��/��Ä�%����a�Ä��a����b������b������b�������b�������b�X������b��'�����������������z����������)�̄����)������?�����ʄʍ�ʄ��\�Ä��\�Ä����Äʍ�Ä����Є��"�Є��V�Єʍ�ʍ���s���b����b����b��������̄�?����p�������.���@c�z��c�z���@s�z���@��z������
����s���=���w����i�=�i�w�i�����=���w�����=��w���ф�=ф�wф���T��T���Z���=�Z�=�Z���w�Z�w�Z�V�I���=�I�=�I���w�I�w�I�V�Z�I��ڝ|���ڝ|���ڝ|�Vڝ��Vڝ|�����ڝ|�����ڝ�b��bСڜ��ڞ��ڜ�>����ڜ�>��۽ڜ�>����ڜ�>����ڜ�>��Lڜ4��ڜ4��Lڜ4��ڜ4����Lڜ�=ڜɥ��ڠڜɥ��Lڜɥ��ڜɥ����Lڜ����ڜ��۽ڜ����ڜ�f��ڜ�f۽ڜ�f��ڜ�f�ڜ�f��ڜ�f۽ڜ�f��ڜo��ڜo۽ڜo��ڜ���ڜ�۽ڜ���ڜ�W��ڜ�W۽ڜ�W����Ѿ�=��Ѿ���Ѿ����ѿ�=��ѿ���ѿ���������y�=����y�����yɤڟ�~��ڟ�~۽ڟ�~��ڟ�~��ڟ����ڟ��۽ڟ����ڟ����ڟ��~��ڟ��~۽ڟ��~��ڟ��~��ڟ������ڟ����۽ڟ������ڟ������ڞ�>����ڞ�>��۽ڞ�>����ڞ�>����ڞ�>��Lڞ4��ڞ4��Lڞ4��ڞ4����Lڞ�=ڞɥ��ڠڞɥ��Lڞɥ��ڠڞɥ����Lڞ��ڞ�f��ڞ�f۽ڞ�f��ڞ�eڞo��ڞo۽ڞo��ڞ���ڞ�۽ڞ���ڞ�W��ڞ�W۽ڞ�W����ѿ�=��ѿ���ѿ����Ѿ�=��Ѿ���Ѿ�����ڜ��X��ڜ��X۽ڜ��X��ڜ��X��ڜ�����ڜ���۽ڜ�����ڜ�����ڜ�ʓ���ڜ�ʓ�۽ڜ�<��ڜ�<۽ڜ�<��ڜ����ڜ��۽ڜ����ڜ���ڜ�{�4��ڜ�{�4۽ڜ�{�4��ڜ�{�ɥ��ڜ�{�ɥ۽ڜ�{�ɥ��ڜ�����ڜ�
�>��ڜ�
�>۽Ѿ�=Ѿ�Ѿ��ڜ�ڜ����Ŕڜ�<���Ŕڜ�����Ŕڜ�{���ŔѾ�>���ŔѾ4���ŔѾ�����Ŕڜ���Rڜ�<��Rڜ����Rڜ�{��RѾ�>��RѾ4��RѾ����Rڜ�{��q��ڜ�{��q۽ڜ�{��q��ڞ���.��ڞ���.��ڞ�<��.�ڞ�<��.���ڞ�<��.ɤڞ�<��.��ɤڞ����.�=ڞ����.���=ڞ����.�ڞ����.���ڞ�{��.��ڞ�{��.��ѿ�>��-ѿ4��-ѿ����-ڞ���F��ڞ���F��ڞ�<��F�ڞ�<��F���ڞ�<��Fɥɤڞ�<��Fɥ��ɤڞ����F�=ڞ����F���=ڞ����F�ڞ����F���ڞ�{��F��ڞ�{��F��ѿ�>��Eѿ4��Eѿ����Eڞ���ڞ�۽ڞ���ڞ���ڞ��ڞ�<��ڞ����ڞ�{��ڞ�{��ڞ�{��ѿ�=ѿ�ѿ��ڞ�Ցڜ����=ڜ���۾�=ڜ����ڜ���۾�ڞ����ŕ�=ڞ����ŕ۾�=ڞ����ŕ���=ڞ����ŕ�ڞ����ŕ۾�ڞ����ŕ���ڜ�����=ڜ�����ڞ���ŕ�=ڞ���ŕ�ڜ���=ڜ���ڞ���ŕ�=ڞ���ŕ������������������҆��C��D����c�.�N��s����ڜ���ڜ�Q�ڞ���ڜ��ڞ��ڡ����U�O���O���U�O�|�I�����U�O�|�I��O�A���$�A���T�A�������A�U�����A��T���A|�T���A�U�$��T�����<�\�<�Y�<���D��=�D��w�<��\�<�>�\�<����<�<ڠ�D�+�=�$�=���=�8�?���?����?����@���@����@����?�	�@�	�?���a���a�T�ã��a�0��a�?��a���J��T������9���x�"��̂�V���zѽ��̄ѽ�1�:�1�Xڥ���Tڥ���ڥ���ڥ��ڥ���ڥ���\ڥ��ڥ���ڥ���\ڥ��ڥ��ڥ��ڥ��ڥ���ڥ���Mڥ�ңڥ�Ҥ�ڥ�Ҥ�Mڥ�9ڥ�:�ڥ�:�ڥ�ڥ��ڥ�̃�<���>��� �>�!��ڥ�dڥ��=ڥ������#����i�;��D���;��D���*ڤ��*ڥ҆�ڛ��b��%���"��%�*ڤ�,�-ڠ�-�x��-�x�ڠ�-�x�;�-�x�<ڠ�-���;ڜ��ڞ���m���[Τ�$�zΤ�$�MœΤ�$ڣ�DΤ�$ڣΤ�P��ř���������
�������!�o�P���$�{�W��Wޝ�Wޜ�Wޛ�Wޚ�Wޙ�Wޘ�Wޗ��͔�͔��o��:������m�����V�u������i�Ռ������������������������������������������������������������&}�q&}�	&}�t&}�&}�&}�&&}�:&}�T&}��&}T��&}D&}�,&}�&}�'&}�;&}��&}�h&}�h&}�&}��&}�&}�S&}��&}�[&}Κ&}�\&}�$&}�2&}�/&}�1&}�R&}��&}ö&}�&}�ö&}��ö&}���ö&}�g�X��V��X��V�q�X��V���X��V��X��V��X��V��X��V���X��V�v�X��V���X��V��X��V��X��V�s�X��V٣�X��V���X��V��X��V��X��V�m�X��V��X��Vǘ�X��V׼�X��V���X��V���X��V��X��Vӟ�X��V��X��V��X��V��X��VĤ�X��V��X��V�(�X��V��X��V���X��V��X��VԖ�X��V�{�X��Vѵ�X��V?�X��V���X��VD�X��VB�X��VH�X��V�f�X��VE�X��V�6�X��V���X��V��X��V��X��V��X��V��X��V��X��V��X��V��X��V$��X��V$ʻ�X��V$��X��V$�Q�X��V$��X��VĬī�X��Vޖ�X��V�O�X��Vd�X��Vf�X��V��X��V��X��V��X��V��X��V��X��V��X��V��X��V��h�X��V.��ő��ő?ő��ő��ő�ő�{ő�ő�ő�ő�ő�ő�ő��ő��ő�ő�2ő��ő�sőŦőǘő�őHő��ő�ő�ő�ő�őEőDő�GőBő�ő�qő��ő�mő�ő�aő�<ő�wő��ő��ő�mő�_ő�ő��
ő��ő��ő��ő�Oődőfő�ő�ő�ő�ő�ő�ő�ő��7QP݇�eQP݃�QP݁߻QP���QP����QP���QP��QPܓ߮QP�~�FQP�|ŦQP�z��QP���bQP���mQP���QP��"QP܄��QPܷ�`QP�	��QP���QPܻ��QP�x�QP�v�>QP�t�qQP�ۤQP����QPܬڊQP܉ڄQP�r��QP�o��QP�m�QPܰ��QP��	QP��gQPܼ�tQP�cDQP�a?QP�_BQPܣ�6QP��EQPܡ�fQPܳHQPܽ�!QP���VQPܿ�VQP܃�jQPܔ��QP�T�pQP�R�QP�P̬QPܤЁQP��ГQPܾͫQP���QP܂�iQP�F�mQP�D�QP�BݿQP��޼QP���QP���QPܭ�QP�ص��QP�\�QP�Y�QP�V��QP����QPܒ�QPܑ�QP�N�zQP�K�QP�I�(QP���0QP��DQP���QP��QP�@�QP�=��QP�;�nQPܩ�QP���QPܦ�wQP��QPܗ��QP�9�QP�6�QP�4��QP���BQP��EQPܹ��QP���QP�0�QP�.��QP�,��QP��QP��QP��(QP���3QP܁��QP����QP�*طQP�(��QP�&׊QP���eQPܝ�&QPܖ�GQP�!�QP܌�KQP�$�vQP���QP��QPܺ�QP���uQP���QP��)QP����QP���;QP��eQP܅�QP��GQP���$QP��2QP���!QP���,QPܴ�-QPܪ�"QP���#QPܧ�1QP��� QP���-QP�ܵ�"QP܏��#QPܫ�QP���{QPܞ�LQP܈�(QPܠ�>QPܟ�HQP܎�7QP�
�QPܕ��QP���QP��QP���QP��OQP��\QP���[QP��uQPܵ��QP���QP����QP���QP܊��QP���QPܚ��QPܘ��QP܋��QPܥ���QP�ݵ��QPܸ���QP����QP����QP���QP���QP����QP����QPܨ��QP���9QP��AQPܲ�4QP���=QP���>QP��5QP��7QPܛ�QP��ِQP��ٟQP���~QP܇ٖQP��ٗQP�كQP�هQPܮؤQP܆؆QPܱ؛QP�؊QPܐ�"QP܍ǘQPܯ��QPܙ�qQP���vQPܶ��QP��QPܢ�RQP��fQPܜ�@QP���^QP�
�GQPdQPfQP�QP�QP�QP�QP�QP�QP�QP&�.QP&�QP&�7QP&ʝQP&�ʝQP&�:ʝQP&���������P���'�������8���\���������E����D��H��������u��׊���#�����B�����K�����ӝ���{���m���(����ǘ�����>���h������2��������P���'�������8���\���������E����D��H��������u��׊���#�����B�����K�����ӝ���{���m���(����ǘ�����>���h������2����ޖ��ޖ���$N�����l���%l��ו����N���O��d��f�����������������������T�ZN��T�ON�F�d�F�f�F���F���F���F���F���F���F���F���F����F�ʱ�F���F���F��
�F��A�F���F�خ�F�a�9�F�c�9�F�s�9�F���9�F��e�9�F���9�F��G�9�F���9�F�س�9�F�a��F�c��F�s��F����F��e��F����F��G��F����F�س��F����F����F�ʲ��F����F�뒪�F����F��B��F����F�د��F���F���F��N�F���F���F��d�F��f�F����F����F����F����F����F����F����F�ԓ�F��a�W�F��a���F��s�U�F��lN�F���d�F���f�F������F����N�)�d�)�f�)���)���)���)���)���)���)���)���)����)�ʱ�)���)���)��
�)��A�)���)�خ�)�a�9�)�c�9�)�s�9�)���9�)��e�9�)���9�)��G�9�)���9�)�س�9�)�a��)�c��)�s��)����)��e��)����)��G��)����)�س��)����)����)�ʲ��)����)�뒪�)����)��B��)����)�د��)���)���f�)�����)�����)�����)�����)�����)�����)�����)�����)�����9�)�����9�)���c��)������)��a���)��a�	
��	
��	
�	
�k	
�u	
�j	
��	
ˋ	
�@	
�#	
�	
۹	
�	
�}	
��	
�	
�	
Ә	
Ҏ	
�	
�)	
��	
�	
��	
�	
�m	
��	
��	
��	
��	
�Ә	
T��	
T�	
T�q	
T��	
T�@	
T�#	
T�	
T۹	
T�	
T�}	
T��	
T�	
T�	
TӘ	
T�	
T�)	
T��	
T�	
T�	
T��	
ˆ�	
ˆ��	
ˆ�@	
ˆ�	
ˆ�	
ˆ�}	
ˆ��	
ˆ�	
ˆӘ	
ˆ�	
ˆ�	
ˆ�	
ˆ��	
ˆ��	
ˆ�Ә	
���	
���	
���q	
����	
��ˋ	
���@	
���#	
��۹	
���	
���}	
���	
���	
���	
��Ә	
���	
���)	
����	
���	
���	
���m	
����	
����	
����	
��	
���	
���	
���k	
���q	
���u	
���j	
����	
��ˋ	
���@	
���	
��۹	
���	
���}	
���	
���	
���	
��Ә	
��Ҏ	
���	
���)	
����	
���	
����	
���	
���m	
����	
���	
���	
���k	
���u	
���j	
����	
��ˋ	
���@	
���	
��۹	
���	
���}	
���	
���	
���	
��Ә	
��Ҏ	
���	
���)	
����	
���	
����	
���	
���m	
����	
�SW��[	
�S��k�Sq�E�2�Sq͟�2�Sq�Y�2�Sq��2�SqҞ���Sq�[���Sq;���SqaM�r�SqcM�r�SqsM�r�Sq�M�r�Sq�eM�r�Sq�M�r�Sq�GM�r�Sq�M�r�SqسM�r�SqaM�^�SqcM�^�SqsM�^�Sq�M�^�Sq�eM�^�Sq�M�^�Sq�GM�^�Sq�M�^�SqسM�^�SqaM��SqcM��SqsM��Sq�M��Sq�eM��Sq�M��Sq�GM��Sq�M��SqسM��SqԀ�Sq�E�Sq�_�Sq��Sq�d�Sq�q�Sq���Sq�)�Sq�z�Sq���q���q癹q瘹q痹q疹q畹q甹q瓹q璹q瑹q琹q珹q玹q獹q猹q狹q犹q特q爹q燹q熹q煹q焹q烹q点q灹q瀹q��q�~�q�}�q�|�q�{�q�z�q�y�q�x�q�w�q�v�q�u�q�t�q�s�q�r�q�q�q�p�q�o�q�n�q�m�q�l�q�k�q�j�q�i�qS���q�c�q�b�q�a�q�`�q�_�q�^�q�]�q�\�q�[�q�Z�q�Y�q�X�q�W�q�V�q�U�q�T�q�S�q�R�q�Q�q�P�q�O�q�N�q�M�q�L�q�K�q�J�q�I�q�H�q�G�q�F�q�E�q�D�q�C�q�B�q�A�q�@�q�?�q�>�q�=�q�<�q�;�q�:�q�9�q�8�q�7�q�6�q�5�q�4�q�3Ԋ�s��Ԋ�s�M͑Ԋ�scM͑Ԋ�ssM͑Ԋ�s�M͑Ԋ�s�eM͑Ԋ�s�M͑Ԋ�s�GM͑Ԋ�s�M͑Ԋ�sسM͑Ԋ�s�M͑Ԋ�s��M͑Ԋ�s�M͑Ԋ�s�QM͑Ԋ�s�JM͑Ԋ�s�M�|Ԋ�scM�|Ԋ�ssM�|Ԋ�s�M�|Ԋ�s�eM�|Ԋ�s�M�|Ԋ�s�GM�|Ԋ�s�M�|Ԋ�sسM�|Ԋ�s�M�|Ԋ�s��M�|Ԋ�s�M�|Ԋ�s�QM�|Ԋ�s�JM�|Ԋ�sҞ�zԊ�s�M�Ԋ�scM�Ԋ�ssM�Ԋ�s�M�Ԋ�s�eM�Ԋ�s�M�Ԋ�s�GM�Ԋ�s�M�Ԋ�sسM�Ԋ�s�M�Ԋ�s��M�Ԋ�s�M�Ԋ�s�QM�Ԋ�s�JM�Ԋ�s:�zԊ�s�M�Ԋ�scM�Ԋ�ssM�Ԋ�s�M�Ԋ�s�eM�Ԋ�s�M�Ԋ�s�GM�Ԋ�s�M�Ԋ�sسM�Ԋ�s�M�Ԋ�s��M�Ԋ�s�M�Ԋ�s�QM�Ԋ�s�JM�Ԋ�s;�zԊ�s�&Ԋ�sɍԊ�sɂԊ�s�Ԋ�s�~Ԋ�s�}Ԋ�s�|Ԋ�s�{Ԋ�s�zԊ�s�yԊ�sɌԊ�sɋԊ�sɊԊ�sɉԊ�sɈԊ�sɇԊ�sɆԊ�sɅԊ�sɄԊ�sɃԊ�sɁԊ�sɀ�P�����P�a�c�s����e����G���س��].-�O�]�h.-�Ow?w�pw��w��wEw�1w�w�wDw��w�Pw�w݈w�7wHw�wӧw�w�Pw��wBw��w��w��wĔwÞ����=�P.)��.)�.�:.���jig?g�pg��g��gEg�1g�g�gDg��g�Pg�g݈g�7gHg�gӧg�g�Pg��gBg��g��g��gĔgÞg�,g�OgЕg�Sg�4g�n�h.?�h.�p�h.���h.���h.E�h.�1�h.��h.��h.D�h.���h.�P�h.��h.݈�h.�7�h.H�h.��h.ӧ�h.��h.�P�h.���h.B�h.���h.���h.���h.Ĕ�h.Þ����7����7��ږ7�hg?�hg�p�hg���hg���hgE�hg�1�hg��hg��hgD�hg���hg�P�hg��hg݈�hg�7�hgH�hg��hgӧ�hg��hg�P�hg���hgB�hg���hg���hg���hgĔ�hgÞ�;�hg��hg���hg��hg��hg�u�hg�n/�0g��g�qg�g��g�Rg�Ig֋gͦg|�ZNg��gs��gЈКgc�Pg��Pg��Pg�e�odg�G�odg���ofg��ga�:���g��g�g�g�?g��g΃g�[g�Җ�E?Җ�E�pҖ�E��Җ�E��Җ�EEҖ�E�1Җ�E�Җ�E�Җ�EDҖ�E��Җ�E�PҖ�E�Җ�E݈Җ�E�7Җ�EHҖ�E�Җ�EӧҖ�E�Җ�E�PҖ�E��Җ�EBҖ�E��Җ�E��Җ�E��Җ�EĔҖ�EÞ/��gG�gG�g�6�g�6�g�6�gG�g�6�g�6�g�6�tg�6�g�6�g�6�g�6�{g�6�g�6�g�6�g�6�g�6�g�6�g�6�ug�6�zg�6�sg�6�g�6�g�6�}g�6�g�6�g�6�g�6�g�6�qg�6�g�6�g�6�g�6�g�6�rg�6�g�6�wg�6�vg�6�g�6�~g�6�g�6�g�6�yg�6�g�6�g�6�p����=�6�����=�6�����=�6�����=�6�����=�6�|����=�6�����=�6�x����=�6�����=�6�.��.�ѹ$��ѹ$ݿѹ$Υѹ$��ѹ$Δѹ$�����1���L����jڨ�i����h�
��(����ŀ�z����p�I��j�I�r�I���ۛ�Sھi�r�Hھi�q�Xھi�r�ھi��ھiŎ�ھi���XھiŎ�Hھi�Hڽ�Sھ���q�Xھ�����Xھ����ھ���p����λ���:��;�o;�p��;�p����;�p�����������������\�����2�3�x���`�˒��Q��dɾ�ɾ��ɾ���`�/��U�{���>�m�{�MM�H�MM�<�`����)������9�W�2�Z����lۭ�~�lޡ�ZԬҞ��[��U�Y�V������MԘ���x�h�@ެ�=�N�=�g�t�<��<��J͐�5�������;�B�U֦�N��Ν�p���3�ͺ���L������L���s�/��������DΫ��F�EM�'�r���9�%���W��/���ɑ���ڂ���ځ���V��ԋ�W�T�g�V�>��������&ɾ��%�s�t͎�eՁ�U�g�pɾ�;�Wԭ�����	�h���3�?ھ��Ч���r�}��D�x��޸�PM�=�!��ҁ�>"���̳�Cހ���y����"����"�����m�i�b��M����k�f�o�Cښ��������������n��q�(����a�V����t���b�I�?Ԋ�q"�
�x"�е�;"��x�	"П�r��������g���a�<�W�]���s�S�j��ɒ�c��s�$р�$�6�^�a���ڰ��t�E�9�g�������g�������˙����g��yک����L���X�
�����X���������Ո��X��X�Q֝����J֜�i�J֜�a�T����t�]���]�w��Ц������������^�i�^;�;:�;�x;�]�x:�]��:���J�|��Ά�N3�n��I�f����I�f����I�f����I�f���I�fȾ��ڦ�
ŀ��S�fޑ��\���C�P�����b��������I�Ը�r�֩�y���E��B���oɑ�o�y��J���J���J���=��Z��������ڧ���T���g������]�������h�P�c���������Թ���������������ջ��Թ��i��:�;�C�L�ڤ�;|�k���H;��k���H;2�k���H;5�k���H�i��7�x��7֌��7ʌ|7ʌ�7���7��7�5���>�l������M���������A�2������/�������`�"���W�N���W�N�D��>����?���cۥ��c����c֛����J�)�m��}���?�I���-�?�	ք�>ք��������֖�������_�H�������\��=���C�Z�:���b�����N�e��Ա�:N��އ��&���9�O�W�~�e���~�!�~c�|͌�~�S�~�3�w�~�[�~�>�~���~��>�S�|�����'L�)����^i�i��i�i�s�=i���BiԲM�[�K���1ḯ�eʠ�e;�>�:�ii��z��\U�
7�J�r�S�<7�S�
7�S�l7�S�?7���-�o�ɺ�<7Ћ��'��C�I�L�N���/���/��������$���8���s�H�o�ɹ�o��ɹ�P�n����ѻ��ՠ���zɱ�z�e˗޽�����V��f��f�[�f�w�f�G�f�c��~Иۦ�"Ҭ�����t��B����_۲�!���S�����i�P������=9���N���]���N���]��N���]��N���]�G�H�f�N��������[=��޸�!������֞�3����C�D�����T����������Q���(���[����[k�����[k���.a���������A������~�%i��%i͉��j͈͉a͢�z͉s͢�y�2�Ԃ޳�Z���Z���5�A�������������j�d�Bi���k=9��k=9�x�Zu25=9ͪ[=9���=9�3a�@�i���/$ކ�/$ކ�/$׏�/$��/$ކ�v�������~�k�Ԟ�B� �+�g��m�p���$��ɯ��:/��;/����Ҟ���w����G���w��G��w��#Ҟɴ��Ҟɴ�#Ҟɴ��Ҟɴ��5�%;��!5�%;�.�>�_�>�`��<�>�_�2�ls��5�ls�$��;�=U�=�)�=րi��M�Z�5ڶ��ۡس�8�KM�	����a֯����c֯����s֯�����֯�����e֯�����֯�����G֯�����֯����س֯�����֯�����֯������֯�����p����������ʒ����������c����������F���������ز����������������5͈5͉a͢�z5͉s͢�y��͢�y���f���/��:��<�3Ԥ��?�W���}����I�_�G�k�|�}�f�o�?�Y2���"Ҭ�"ҭ��5���"Ҭ;���!:���!�"�x��M��������M��������\�6���B����A՟:����2�@��2�a�A��2�	�A��2����2�M2��ѣ֌��7�����{�r�Y�����{�r�Yʌ|7�Yʌ�7�Y� ���Y��p��N����Ն��p��z;��k2���H�`;2�k�H�`;5�k�H�`:2�k�H�`:5�k�H:2�k���H:5�k���H�`;|�k�H�`;��k�H�`:|�k�H�`:��k�H:|�k���H:��k���H:�~���ڦs�W��
�s��:���C�I;���C�Iͺ��C�I�h�b�(�a��ڦc��ڦs��ڦ��%����IК��������L�O������������������R��k��:�/�/��/�s��:�s�F�����
�����������
����������������������ń�y����y������1�����52�l������N�)�	i���)�	i�%����N��.����n�w��;͇��W�Nsҽ9sҽ<sҽ޸sҽ�2̈́�5̈́�c̈́�s̈́�2ʠ�5ʠ�2�^�5�^����]���]��co�b�c���co���c���co��ޯ�fN�co�e��+ګ������M�k�OM��ژ�W���W�����;���4M�q�����ڤ�����ڥ���;�����ڥ��<�����ڥ�d�;�����������e�*���������;��к���'҄�������}�;�����k�����U���P���F������<�9���������8����ʏ'�9�8�����;�8�����;��̴���̴��*�C��̴��d�;�P�����V���>���-���������Mɝ�P��҄�������ڤ�T������g�������>���X�����-�����ڤ�/�����ڥ��<��М�W�����;�������1�����%ڤ����	�W�]�����;�]���4M�q��]���ڤ��]���}�;�]�������8�]�����;�>�]���-�]���g�]����������������������;���3����֌���L��Ѐ�����͊������a�����X��W�+�����>����0踭�Y�k�͟�Y�k���E�k�͟�E�k����Y�k��͟�Y�k����E�k��͟�E�k���Y�k��͟�Y�k����E�k��͟�E�k��U��Y�k��U͟�Y�k��U��E�k��U͟�E�k����Y�k�͟�Y�k���E�k�͟�E�k�U��Y�k�U͟�Y�k�U��E�k�U͟�E�k���H/�;��H/�<�W:�^ͳ�H/�;ͳ�H/�<�W:�^k�����[�����ّ!��;U�!��;!���;U!���;U�p�;�?�p�;-U4���>u�;-U4��>u�;-U~4��>u�;U��;-��;U-��;�0Uͱ�0U�Zͱ�d�q�Z�d�q���l����t�,���,������ۈ��������t���t��ə������t�w���c�t�t�c�t�N�t�N���t��ҥ�n��ɐ��������ڪ���M��ڪ��������Ѹ͂����_S���_�7�c�d�S�_ɱ�^�x�I��3��7��i�3��i���0�W��ԕi���0i�Cŀi�#ŀi���3����ڪ���Q�3�P�A�6۠i�i�c��i�ŀ��΢�5�3�v�x��v��2ݵɵѹ�d�7.�=͠�Ci�i�\����ι�u���ԕM�֬7ιɚ̰���(������֑��ڮ����ڱ�p�#�!���#���#�����������������t�w�����z��РڱР���6о����:�$�D�$���$�v�$�H�$��$��$�Ҙ�$�җ�$���$���$��$��$�
�$�v�$���v�$:�v�$۟̕�$۟̔�$۟̓�$�$��$ا�$��$��$����$����$釖$�K�$��B�$��A�$�BM�$ҔM�$�o�B�$��B�$̖M�n�$�BM�n�$�BM�m�$�o�;�$��M�o�;�$̖M��M�n�$�h�$�K�B�$���B�$�:�B�$̖M�9�$��M�9�$̖M��M�9�$�
M�9�$ҔM�9�$ҔM�8�$ғ�$Ғ�$ґ�$Ґ�$���$���$�"�$��$�Ֆ$Ұ�$ү�$���$���B�$�c�$�b�$�J�T�$�]�$�\�$�[�$�}�$֐�$�u�$�I�$�7�$�s�$�=�$���$��$�vڷ�$ЪM�s�$���$ɮ�$�ɮ�$��$Ϳ�$�
�$�c�$���$�E���$�*�$�<�*�$�z�$���c�Ԗ$���c�Ӗ$̒�$�!�$�D�$�F�$�E�$�˖$��$�4�$�3�$�2�$�1�$�0�$���$�6M��$�6MNJ�$�a�$�[�$�–$�5�$�Ŗ$��ݖ$��%:޳��5ɴ:�#��5ɴ:���5ɴ:����5ɴ:���۾;�;�U;��0U;��GU;�;��:�ѻ�d:�F�^:���^�;�^۾;�^;�^U;�^�0U;�^�GU;�^;/�:�0�^;/�:۾�^/�d:�F�:�0�:۾�;��:�0�;��:۾���d:�F��:�0��:۾��;���:��ʼ �=� �=۾ �= �=�0 �=�0U �=�GU �=ʼ����۾����U���0U���GU���e�n��۾�e�n���e�n��U�e�n���0U�e�n���GU�e�n�����n��۾��n����n��U��n���0U��n���GU��n�����n��۾��n����n��U��n���0U��n���s�m:�۾s�m:�s�m:�۾s�mԪ����m:�۾��m:���m:�۾��mԪ��Z���mԪ���e�m:�U�e�m:�۾��m:�U��m:���mԪ�۾��m:�U��m:��0U��m:�U��mԪ�����m:�U���m:�U���mԪ�.ɴ�h.ɴ.�^�h.�^���G����>����[�����������Ҟ�^��w�^���G�^���>�^���[�^�����^���^k=ɵ���=ɵ��[=ɵ����=ɵ��k=۾ɵ���=۾ɵ��[=۾ɵ����=۾ɵ��k=��ɵ���=��ɵ��[=��ɵ����=��ɵ��k=���=��[=����=��k=���=��[=����=��Uk=��U�=��U[=��U��=��Uk=����U�=����U[=����U��=����kɳ=���#�ɳ=���#[ɳ=���#��ɳ=���#kɳ=۾�#�ɳ=۾�#[ɳ=۾�#��ɳ=۾�#kɳ=�#�ɳ=�#[ɳ=�#��ɳ=�#kɳ=U�#�ɳ=U�#[ɳ=U�#��ɳ=U�#kɳ=�0U�#�ɳ=�0U�#[ɳ=�0U�#��ɳ=�0U�#k�~3��~3[�~3���~3kg3�g3[g3��g3k�3��3[�3���3kU�3�U�3[U�3��U�3kU3�U3[U3��U3k-3�-3[-3��-3��Y-3��E-3͟�E-3͟�Y-325-3|�-3�=k��3�=���3�=[��3�=�篥3�=��Y��3�=��E��3�=͟�E��3�=͟�Y��3�=k�3�=��3�=[�3�=��3�=��Y�3�=��E�3�=͟�E�3�=͟�Y�3�=k۾�3�=�۾�3�=[۾�3�=��۾�3�=��Y۾�3�=��E۾�3�=͟�E۾�3�=͟�Y۾�3�=kU�3�=�U�3�=[U�3�=��U�3�=��YU�3�=��EU�3�=͟�EU�3�=͟�YU�3�=k�0U�3�=��0U�3�=[�0U�3�=���0U�3�=��Y�0U�3�=��E�0U�3�=͟�E�0U�3�=͟�Y�0U�3kɵ���ɵ��[ɵ����ɵ��k;=�'ɵ���;=�'ɵ��[;=�'ɵ����;=�'ɵ��k=�ˇ�=�ˇ[=�ˇ��=�ˇU=�$�;dU=�$�;cʵU=�$�;a��U=�$�;aʸk�R;3[�U�&;3k���&;3[���&;3k޲;3[�;3k�;3[޲;3k���%;3[���%;3k���%;3[���%;3;=�$�;d;=�$�;cʵ.�>���.�>�c�.�>�2����2��s�2��c�2���2������z�����z�������������;�~��~Ԯ��������������\��ʺ����������B��M���e���������M��޷�j��j����p�{�:�������7���R�����������x���F������ݒ������������a�B���W����;�W��a��a�C����U���;�R����Uڤ�������<���Uڤ���ڥ�������R����2��|��o��?�W�ڳ�%Λ���a�i����4�ŀ�a��7�	�5�>����������k��X��qԕ��Јԕ��ʹԕ��E�����5����C���g͹�6�N�A���"���B�e�t�5�[����M�'̱�Q�-�M� �V�3ռ���s��F�+�K�k����"����M������'޿�Z�6ھ���w�������<s�|�L����Ձ�gՁ����9�<�wڤ���������Ԉ�;���L���*�a�S���O�?��О��7���O��8���������|�*�LΝ�X����V���wл���D��"�X�"Շ���ڵ�D�}�A���*�F��U��<�������Ҟ�����������i���;��hެ�%���a�\��.�M��گ�K�.�K�����ެ�^�d���� ��F�P�l��ś��������$�
�����������Bք��������W��������W���N�\��Ǎۘ���	�<�G�~���}Ы��ͼҞ����u�Ӽ�����
�K�4�k�!�w�L��*�[ݵ��V�lMʜ�hM�Y�԰�3���=��Mա�PMͿ�mҮ��l�U�S�I�U�S�P�U�S���U�S���U�S��U�S�g;�S����
��:�S����
���U�S����
��;�S�J��د��;�S�Q��د��;�S����د��;�S����د��;�S���د��;�S�h��د��:�S�J��د��:�S�Q��د��:�S����د��:�S����د��:�S���د��:�S�h��د���U�S�J��د���U�S�Q��د���U�S����د���U�S����د���U�S���د���U�S�h��د��;�S���a�:ʰ��:�S���a�:ʰ���U�S���a�:ʰ��;�S��I;�S��P;�S���;�S���;�S��;�S��g:�S��I:�S��P:�S���:�S���:�S��:�S��g�U�S��I�U�S��P�U�S����U�S����U�S���U�S��g;�S���c�:����:�S���c�:�����U�S���c�:����;�S�J��c�:�B��;�S�Q��c�:�B��;�S����c�:�B��;�S����c�:�B��;�S���c�:�B��;�S�h��c�:�B��:�S�J��c�:�B��:�S�Q��c�:�B��:�S����c�:�B��:�S����c�:�B��:�S���c�:�B��:�S�h��c�:�B���U�S�J��c�:�B���U�S�Q��c�:�B���U�S����c�:�B���U�S����c�:�B���U�S���c�:�B���U�S�h��c�:�B��;�S���s�:���:�S���s�:����U�S���s�:���;�S�:�S��U�S�;�S���د��:�S���د���U�S���د��;�S�;�S�;�S�:�S�:�S�:�S���Ҟ�!��Ҟ�8��Ҟ���Ҟ�b��Ҟ�p��Ҟ����Ҟʹ��:�!��:�8��:���:�b��:�p��:����:ʹ�f��q�4�&Χ��M�|���X�����6՛�ԍ�һ�{�2��V�����������������������������������������������������������������~�}�|�{�z�y�x�w�v�u�t�s�r�q�p�o�n�m�l�k�j�i�h�g�f�e�d�c�b�a�`�_�^�]�\�[�Z�Y�X�W�V�U�T�S�R�Q�P�O�N�M�L�K�J�I�H�G�F�E�D�C�B�A�@�?�>�=�<�;�:�9�8�7�6�5�4�3�2�1�0�/�.�-�,�+�*�)�(�'�&�%�$�#�"�!� �������������������
���
�	����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������~�}�|�{�z�y�x�w�v�u�t�s�r�q�p�o�n�m�l�k�j�i�h�g�f�e�d�c�b�a�`�_�^�]�\�[�Z�Y�X�W�V�U�T�S�R�Q�P�O�N�M�L�K�J�I�H�G�F�E�D�C�B�A�@�?�>�=�<�;�:�9�8�7�6�5�4�3�2�1�0�/�.�-�,�+�*�)�(�'�&�%�$�#�"�!� �������������������
���
�	�������������������������������������������������������������������������������������������������������������������������������������������������������������ˏ�͔��ZN��>N�7��
7��-7��o���2Ռ�5Ռ����b7��������ͱ��O�d�f�����������������i�ތ7��7��^7��ON���?��p��ϸ��E��1�꾸��D��ٸ�P���݈��7�H���ӧ����P��ظB����Ǹ�޸Ĕ�Þ�2/���Zͱ�5/�����~�K��e��?��p��ϸ��E��1�꾸��D��ٸ�P���݈��7�H���ӧ����P��ظB����Ǹ�޸Ĕ�Þ�2���S�K�5����T��ˏ>�#>�>�
>�>�>��>��>��>��>��>�>�>Ͽ>Ͻ>ϼ>ϻ>Ϻ>Ϲ>ϸ>Ϸ>϶>ϵ>ϴ>ϲ>ϱ>ϰ>ϯ>Ϯ>ϭ>Ϭ>ϫ>Ϫ>ϩ>ϧ>Ϧ>ϥ>Ϥ>ϣ>Ϣ>ϡ>Ϡ>ϟ>Ϟ>Ϝ>ϛ>Ϛ>ϙ>Ϙ>ϗ>ϖ>ϕ>ϔ>ϓ>ϑ>ϐ>Ϗ>ώ>ύ>ό>ϋ>ϊ>ω>ψ>φ>υ>τ>σ>ς>ρ>π>�>�~>�}>�{>�z>�y>�x>�w>�v>�u>�t>�s>�r>�o>�n>�m>�l>�k>�j>�i>�h>�g>�f>�d>�c>�b>�a>�`>�_>�^>�]>�\>�[>�Y>�X>�W>�V>�U>�T>�S>�R>�Q>�P>�N>�M>�L>�K>�J>�I>�H>�G>�F>�E>�C>�B>�A>�@>�?>�>>�=>�<>�;>�:>�8>�7>�6>�5>�4>�3>�2>�1>�0>�/>�->�,>�+>�*>�)>�(>�'>�&>�%>�$>�">�!>� >�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�
>�	>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��>��גה�M�͵�M��̮��M���v��M��������������˕�˕�P˚�L��S�K��M�K�|�p��L˕S˕�����f�]�P���"�d�����V��O�p�<�B��'��yd�1��yf�0��y��/��y��.�h���������M��~�}������M۽�̝̋���=�[���Z���=�[��T�Z�Q�=�[fҩ�Zђ�=�[d�2�Z�͗��������֫��4�#�_�B�3�4�_ټ�H�J�L�K�f�M�t���P��M�t��쒾˖�L�˖�L�M�˖�\�˖�\�N�L˖�LS˖�L��Մ�L�Մ�L��ԉՄ�L��Մ�L�$ԃ�Z�L��Z�H�H�>��f�;�R�>�ۆ�:�Q��y���,�	�d�	����	�f�	����M���̵�����LۓŘ�I�M�E���M��͖��M�E����M����M��ͦ�>�j���7�>��Т�y�W��*�����T����3�
ے�x���+ٰ�y��������̑��޸�����4�+���4��������Ru�����`�Pt�+t�'t�:t�,�������K���������������_�����R��$�������^�_����F�x�i�F�Bikɳ=4Sj[ɳ=4Sj��N���o�+� ��
�����������ƼƱƦƛ��$S5;ޓ����DN�j��
ל�
לל����������I������I8�C"����"ǀƐƅ�z�n�c�X�M�B�7�/�.�-�,�*�)�(�'�&�%�$�#�"�!������������������
���	���������������������������������������������������������������������������������������������������������������ƿƾƽƻƺƹƸƷƶƵƴƳƲưƯƮƭƬƫƪƩƨƧƥƤƣƢơƠƟƞƝƜƚƙƘƗƖƕƔƓƒƑƏƎƍƌƋƊƉƈƇƆƄƃƂƁƀ��~�}�|�{�y�x�w�v�u�t�s�r�q�p�m�l�k�j�i�h�g�f�e�d�b�a�`�_�^�]�\�[�Z�Y�W�V�U�T�S�R�Q�P�O�N�L�K�J�I�H�G�F�E�D�C�A�@�?�>�=�<�;�:�9�8�6�5�4�3�2�1�0�7����O�d�f��������������'�s�d'�s�d�S�L<�S�L<�S�L���d�S�L���d�S�L����S�L�������r����r����j����j��s�d��s�d�LZ��J�U9�S�L<�S�L<�S�L���d�S�L���d�S�L����S�L����QS�L<�QS�L<v�s�dv�s�d'֘�'֘�'֘�T'֘�T�֘��֘��֘�T�֘�T�LZ��LZ��LZ�T�LZ�T�LZ�d�LZ�T�֘��֘LZ��֘�T�֘LZ�T���T��LZ�T�d�T�d�T݉�T݉�T� �T� �Tv֘�v֘�v֘�Tv֘�Tv�s�v�s�v�s�Tv�s�T���d���d�������d����Ф�dФ��Ф�d�Ф�	�W]��Z��	�W]��Z�u	�W]��Z��E	�W]��Z֤	�W]��ZB	�W]��Z��	�W]��ZE	�W]��Z��	�W� ���y*l�P*l�I*l��*l�o*l�Q*l�W*l��*l�7*l�*l݈*lĔ*l�*l�*l��*l�*l�&*lѶ*l�E*l��*l�4*l�S*l�P*l�*l��*�7*�e*�P*߻*ߐ*��*��*�*�*��*��*�F*�*�*��*��*�:*�8*�C*�*�*�<*��*�*�*�)*�*�9*�1*��*�*�u*�Z*�l*�Y*�S*�B*�:*�b*�a*�i*�I*�F*�e*�M*�9*�8*�-*�**�I*�H*�L*�7*�6*�K*�U*�G*�F*�6*�5*�Q*�P*�T*�8*�7*�S*ˢ*�z*�c*�(*�*�D*�0*ˉ*�*�*�Y*��*��*ؾ*׺*�{*�v*�k*��*�2*�!*��*��*��*Զ*��*ӿ*�\*�O*��*�u*�[*�l*�w*�N*�(*ڑ*�U*��*ۼ*�Q*�*��*�*ā*�*�*��*ô*�E*�B*�l*�*��*�P*��*�H*�	*ь*�e*ҷ*қ*��*��*��*�*�R*�m*�[*ݿ*ݢ*��*޼*�6*�*��*��*Ǘ*�"*�*��*��*�v*�q*Ǔ*�*��*�|*�*�*�*�*�*�*�*�*�*�*�*�$*�*�*�*�*� *�*�#*�*�
*�!*Ѵ*ѩ*Ѩ*ѡ*њ*Ѱ*ѯ*ѳ*ѧ*Ѧ*Ѳ*�C*�>*�=*�:*�9*�@*�?*�B*�<*�;*�A*��*�*�*�n*�Z*�*�*��*�*�w*��*�-*��*��*Η*΅*�*�*�"*��*ξ*�*�O*�/*�+*�"*�*�5*�4*�N*�'*�&*�7*�
*�p*�T*̬*�J*Г*Ё*�*��*ͫ*п*�*�G*�+*�K*�.*�*�v*��*�*�*�*��*��*��*��*߿*߾*��*��*��*�*�*��*Ξ�l�^�l�ԙl�y^ȪYl�Yl��Yl��Yl��uYl��Yl�Yl�Yl��Yl�1Yl��IYl��Yl��BYl��Yl��=Yl�Yl�Yl���Yl�Yl�ʩYl��2Yl�Yl��Yl��uYl���Yl��Yl��Yl���Yl��Yl��Yl��2Yl��PYl�Yl�Yl�Y�ӟY�I��aY�I��YY�I��RY�I�ӋY�Y������G������������:����G���GG���G����G���:G���G���9G���(G���G���I�J�I�}��I�I�J�}��	!#'),.02468:<>@BEHKNRV[`einsx|�����������������������������$(-26;@DINSX]adhjnsvy|�����������������������������	&-5=ELT\aipv}������������������� '/7<DKQX_fiov|������������������$,4<DLT\dlt|����������������
 %*2:BJOV]emu}�����������������
"*2:BIPX`hpx������������������$,3:BJRZ`flsz�������������������� *29@EJQX\afks|�������������������		
			!	.	6	;	E	J	O	Y	^	e	l	t	|	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�		


#
*
1
9
A
I
Q
X
_
i
s
{
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
&/9CLU_iqy���������������	#(-4;BIQYcmw�����������������



&
,
1
7
>
E
L
S
^
h
o
v
}
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
#*/4=ENSYcjr{�����������������!(.4:@IQV^dltz������������������!-29>BGOV[`dinrx~����������������������"(-16;DJOUZ`hptx}�����������������������#),16:@FLRW\adjotx}��������������������������	
#)-16<AGKRW\aflosx}������������������������#)07:CLW[`chpu}���������������������
#(08@HPXchmrw|�����������������������	'159=CJNSW\`einsx}������������������������
 %*/6;AFKPUZ_gmrv{��������������������������	
 %*/48>BGLQUZ_dimrv{������������������������")09BIPYbglqv{����������������������$,4<DKRZbjrz������������������"*2:BIPX`hpuz�����������������
$+17?GLQYaiqy�����������������%-5=EOY`gnu|������������������$).39?GOW_gow��������������������$*06<BHNTY_ekqw}����������������������  
    % + 1 7 = C I O U [ a f l r x ~ � � � � � � � � � � � � � � � � � � � � � � !	!!!!!!(!-!4!9!>!C!J!O!T![!d!i!n!s!x!~!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!"
"""""!"%")"-"1"5"9">"B"F"K"O"T"X"\"`"e"i"n"r"v"z"~"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"#######(#,#0#4#7#:#A#E#K#O#V#]#e#l#s#w#{#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#$$$$$$$$!$$$'$*$-$0$3$6$9$=$A$E$J$O$U$X$_$h$m$r$y$$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$%%%%%%%%)%-%1%8%A%E%I%Q%U%Y%]%d%k%w%{%%�%�%�%�%�%�%�%�%�%�%�%�%�%�%&	&&&$&*&3&:&>&G&K&R&[&_&e&l&s&w&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&'''' '$'''+'1':'>'D'J'Q'X'['c'h'q'v'z'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'((((#(,(5(<(B(H(N(T(Z(`(f(l(r(y(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�())))))#)()1)6);)@)E)J)Q)V)])b)g)l)q)v)|)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)*	***** *'*.*4*:*A*H*L*P*W*^*e*p*}*�*�*�*�*�*�*�*�*�*�*�*+++&+3+:+C+P+V+\+e+m+u+{+�+�+�+�+�+�+�+�+�+�+�+,, ,,,9,F,R,_,h,q,v,{,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,-------$-)-.-2-6-:->-B-F-J-N-R-V-Z-_-d-h-l-p-t-x-|-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-.....!.'./.7.@.H.O.V.^.d.j.p.v.}.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.///////'/./4/9/A/H/N/U/[/`/g/n/t/y/~/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/00
00000#0(0-02070<0A0F0K0P0U0Z0_0d0i0n0s0x0}0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�01
11&1-151;1@1I1R1Z1`1j1s1z1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�12
2222&2+20252:2?2D2I2N2T2Y2^2d2i2m2q2u2z2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�233
333333"3&3*3.32363:3>3B3F3J3N3R3V3Y3]3a3e3h3l3o3s3w3{3~3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�344
4444!4&4+42474<4@4D4H4L4P4T4X4\4a4f4k4q4t4x4|44�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�455
5555 5$5)5-52575<5A5F5K5P5U5Z5_5d5i5n5s5w5|5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�566
6666$6)6/656;6B6G6K6O6S6W6[6_6c6g6k6t6~6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�67777777#7(7-72777<7A7F7K7P7U7Z7_7c7h7m7r7v7z77�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�78888888!8%8)8-8185898=8A8E8K8P8U8Z8_8d8h8m8q8v8z88�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�89999999#9'9+90959:9?9C9G9L9Q9W9\9b9g9m9s9z9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9:::::$:):.:2:7:;:@:D:I:N:S:W:\:`:e:i:n:s:x:}:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:;;
;;;; ;%;+;1;8;=;C;H;N;S;Z;a;f;k;p;v;|;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;<<
<<<<<<!<%<)<-<0<3<7<:<=<@<C<G<J<N<R<V<Z<^<a<d<i<m<r<v<{<<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<==
=====#=(=-=2=6=;=@=D=I=N=R=W=\=a=f=k=p=u=z==�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=>>>>>>&>+>1>7><>B>H>M>R>Y>^>c>h>n>t>z>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>?	?????$?(?-?1?6?:???D?I?M?R?W?[?`?e?i?n?s?x?}?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?@@
@@@@@%@*@0@6@=@B@H@N@S@Y@_@d@i@p@u@{@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@AA	A
AAAAA!A%A)A-A1A5A9A=AAADAHALAPASAWAZA^AbAfAiAlAoAsAvAzA~A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�ABB
BBBB!B&B+B1B6B;B@BFBJBMBPBSBVBYB\B_BbBeBiBnBrBwB|B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�BCC
CCCC%C+C1C7C=CCCICQCWC]CcCiCoCuC{C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�CD
DDDD&D+D0D7D>DGDRD[D`DfDkDpDuDzDD�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�DEEEEE$E+E2E9E@EGENEUE\EcEjEqExEE�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�EFFFFF#F*F/F6F<FCFIFRF[F`FeFjFqFxFF�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�FGGGG G'G.G5G:G>GEGLGSGXG]GbGiGpGwG~G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�GH	HHHH%H,H1H7H<HBHHHMHTH[HbHiHnHrHwH{HH�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�HIIII'I-I5I9I?IEIMIWI_IlIrIzI�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�IJJ
JJJJJ'J5J?JEJKJSJ[JcJkJqJwJzJ~J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�JKK	KKKKKK"K&K+K/K4K9K?KDKJKNKSKWK\KfKlKrKyK�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�KLLLLL L&L,L2L7L=LCLILNLSLYL_LeLjLpLvL|L�L�L�L�L�L�L�L�L�L�L�L�L�L�L�L�L�L�L�L�LM
MMMM$M.M3M9MCMMMWMaMiMuM�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�MNN	N
NNNNNN"N&N*N.N1N4N7N:N>NANDNHNKNPNSNWNZN^NaNfNiNmNtNyN}N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�NOO
OOOOOO#O'O,O1O7O<OBOHONOTOZObOjOrOzO�O�O�O�O�O�O�O�O�O�O�O�O�OPPP P&P-P2P8P>PDPJPPPVP[PaPgPmPsPxP�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�PQ	QQQQQ%Q,Q1Q7Q<QAQFQKQPQUQZQ_QdQiQnQsQxQ}Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�QRRRRRRRR#R'R+R/R3R7R;R?RCRGRKRORSRWR[R_RcRgRkRoRsRwR{RR�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�RSSSSSSSS S$S(S,S0S4S8S<S@SDSHSLSPSTSXS\S`SdShSlSpStSxS|S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�STTTTTTTT T$T(T,T0T4T8T<T@TDTITMTRTVT[T`TdTiTnTrTwT|T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�TUUUUUUU$U)U.U3U8U=UBUGULUQUVU[U`UeUjUoUtUyU~U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�UVV
VVVVVV"V&V*V.V2V6V:V>VBVFVJVNVRVVVZV^VbVfVjVnVrVvVzV~V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�VWW	W
WWWWW!W%W(W,W0W4W8W<W@WDWHWLWPWTWXW\W`WdWgWkWoWsWwW{WW�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�WXX	X
XXXXX!X%X)X-X1X5X9X=XAXEXIXMXQXUXYX]XaXeXiXmXqXuXyX}X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�XYYYYYYYY"Y&Y*Y.Y2Y6Y:Y>YBYFYJYNYRYVY[Y`YeYkYqYvY{Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�YZZ	ZZZZZ$Z)Z-Z1Z5Z9Z=ZAZEZIZMZQZUZYZ]ZaZeZiZlZpZtZxZ|Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z[[[[[[[[ [$[([,[0[4[8[<[@[D[H[L[P[T[X[\[`[d[h[l[p[t[x[|[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[�[\\\\\\\\#\'\0\6\;\?\B\G\J\M\P\U\Y\^\a\d\g\j\m\p\s\v\y\}\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\]]]]] ]&],]/]2]5]8];]?]C]F]J]N]R]V]Z]]]a]e]i]m]q]t]x]|]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]^^^^^^^^ ^$^(^,^0^4^8^<^@^D^H^L^P^T^X^\^_^c^g^k^o^s^w^|^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^__
____ _&_*_/_7_?_F_K_P_Y___g_l_r_v_z_~_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_````````#`)`.`3`6`:`>`D`H`N`R`X`[```d`j`n`t`x`~`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`a	a
aaaa#a)a-a1a5a9a=aAaGaKaOaSaYa]acagamaqawa{a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�abb
bbbb b$b*b0b4b8b<b@bDbHbNbQbUbYb_bcbibmbsbyb}b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�bcc
cccccc#c'c-c1c7c;cAcEcKcOcUcYc_cccicocscyc}c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�cd	dddddd#d'd+d1d4d8d<dBdFdLdPdVdZd`dddjdndtdxd~d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�deeeeeee#e)e-e3e7e;e?eCeGeMeQeUeYe]eaeeeiemeqeue{e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�eff	f
fffff%f+f1f7f=fCfIfOfSfWf[f_fcfgfkfqfwf}f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�fgg
gggg!g&g+g0g5g:g?gDgIgMgRgWg\gagfgkgpgugzgg�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�ghh
hhhhh#h(h-h2h7h<hAhFhKhPhUhZh_hchhhmhrhwh|h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�hiiiiii i%i*i/i4i9i>iCiHiMiRiWi\iaifikipiuizii�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�ijjjjjjj$j)j.j3j8j=jBjGjLjQjVj[j`jfjjjnjrjvjzj~j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�jkk
kkkk!k&k+k0k5k:k?kDkIkPk[k`khkmkrkwk�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�kllll l%l/l3l:l?lFlLlSl\lcljlslzll�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�lmm
mmmmm#m(m-m2m7m=mCmImNmSmXm]mbmgmpmym�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�mnn
nnnnn n$n(n,n1n5n9n>nCnHnNnSnWn[n_ncnhnmnqnvnzn~n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�noooooooo o$o(o,o0o4o7o;o>oBoFoJoNoRoVoZo^obofojonorouoxo{oo�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�opp
ppppp"p&p+p/p4p9p>pCpGpKpOpSpWp[p_pcpgpkpqpupyp}p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�pqqqq!q$q'q,q/q4q;qCqHqOqRqYq`qgqkqoqrquqxq{q~q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�qrrrrrrr#r)r/r5r;r@rFrLrQrVr\rbrhrnrsryr~r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rss
ssss#s(s.s4s<sEsNsVs^shspsys�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�sttt#t-t7tAtKtTt^thtrt|t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�tuu
uuuuu"u(u,u2u6u:u>uBuFuJuPuVu\ubuhunutuzu�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�uv	vvvvv"v'v,v1v6v;v@vDvIvNvSvWv[v`vevjvnvrvvvzvv�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�vw	wwwww"w'w,w1w5w9w=wAwEwIwMwQwUwZw`wfwlwqwvw{w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�wxx
xxx"x+x3x<xExMxVx_xhxpxxx�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�xyyy!y)y1y:yCyKyTy]yfyoyxy�y�y�y�y�y�y�y�y�y�y�y�y�y�y�yzzz!z*z3z<zEzNzWz`zizqzyz�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z{{{{{{${*{0{6{:{@{F{L{R{X{^{d{j{p{v{|{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{||||||!|&|,|2|7|=|C|H|N|T|Z|_|e|j|o|u|z|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|}}
}}}}}!}&}+}0}6}=}D}N}W}^}d}o}t}z}}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}~	~~~~%~,~3~:~A~G~M~S~Y~_~e~k~q~w~}~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~&.27;@FLPTX\bflpv|�������������������������
�
���� �#�&�)�,�0�6�<�?�B�F�K�P�W�\�c�j�s�z���������������������€Ȁ΀Ԁڀހ����������������������#�(�/�4�9�>�C�J�P�V�\�b�h�q�z�������������������ʁҁׁ܁�������������
����!�&�*�/�3�7�<�A�F�J�N�R�V�[�_�d�h�n�t�z�������������������������Ƃʂ΂҂ւڂނ����������	�
����#�(�/�3�9�=�C�H�O�V�[�b�g�l�p�v�z���������������������������ăɃ̓уփۃ������������"�+�2�9�@�D�I�N�S�X�]�b�g�l�q�u�z������������������������������ńɄ̈́҄ׄۄ��������������!�'�,�2�8�=�C�I�O�T�Y�_�i�o�w�}�����������������������������…ȅ΅ԅڅ���������
���"�)�0�7�>�E�L�S�Z�a�h�o�v�}�������������������ƈӆۆ����������� �'�/�6�=�D�K�R�Y�`�g�n�u�|�������������������‡ɇЇׇއ����������$�+�2�9�@�G�N�U�\�d�k�r�z�����������������ʈψԈوވ��������&�-�2�9�@�K�T�[�b�k�r�{�������������������ɉ҉׉މ��������
���!�'�-�3�8�>�C�I�O�W�]�e�j�p�v�}���������������������Êˊӊيߊ��������	�����$�)�0�5�9�?�D�I�M�R�W�[�`�e�l�p�u�z�~���������������������������Ëȋ͋ҋ׋ۋ����������
����"�(�-�3�9�?�F�M�T�[�b�i�n�v����������������ʌӌٌތ�������
���"�+�4�=�F�O�X�a�j�s�|���������������ƍҍۍ�������
����&�+�4�:�@�G�L�Q�Y�a�j�s�x��������������������Ŏʎώ֎܎��������
�������!�$�+�.�1�6�:�>�B�F�J�S�Y�_�e�m�u�{�����������������������ȏΏԏڏ�������
���%�-�5�:�@�F�K�S�W�^�e�j�s�{�����������������ÐːӐې���������"�-�7�A�J�S�\�e�p�{�����������������Ñˑӑۑ������	���!�)�1�:�C�K�S�_�k�t�}�����������������Œ͒Ւݒ�����
���'�1�;�D�M�T�[�c�k�s�{���������������œ͓Փ�����
��!�)�1�9�B�K�T�]�e�m�u�}���������������Ô˔Ӕ۔������	���!�)�1�9�A�I�Q�Y�a�i�q�z���������������•˕ҕוޕ���������&�1�;�E�O�Y�b�k�u��������������Ŗ͖֖ߖ�������%�1�<�G�R�]�f�o�w����������������×Ηٗ�����
���'�2�=�G�Q�[�e�l�s�{���������������ɘӘݘ���������!�)�0�7�>�E�M�U�]�e�p�{�������������™ؙ͙�����	���*�5�=�E�P�[�f�q�y�������������Ú˚Ӛޚ����
���%�0�;�F�Q�\�g�o�w���������������ɛԛߛ��������&�1�9�A�L�W�b�m�x���������������ǜҜݜ�������$�/�:�E�P�X�`�h�p�x�������������������˝֝�����*�5�@�N�\�j�x�����������ƞԞ����	��"�0�>�L�Z�h�s�~���������ğҟݟ����� �.�<�D�L�W�_�j�r�}��������������������� ʠՠݠ���������"�*�2�=�H�P�[�c�k�s�{�����������������áˡ֡ޡ�������
�
�� �+�3�>�F�N�V�^�f�i�l�p�t�x�|���������������������������������¢Ţɢ͢Ӣ٢������������������ �$�(�.�2�6�<�A�H�J�M�Q�U�Z�`�b�k�t�w�{�}��������������������������������ģȣ̣ӣأܣ�������������
������#�'�+�1�7�=�C�J�Q�V�[�_�e�h�k�n�q�t�w�{������������������������������������ƤˤѤפݤ��������
���"�%�(�+�0�3�6�9�<�?�B�G�J�M�P�S�V�[�^�a�d�g�j�o�r�u�z������������������������������ƥͥҥإݥ���������
����#�(�/�7�?�C�G�K�O�W�\�`�e�i�m�q�s�w�{������������������������������ĦǦ˦ϦӦզئۦߦ������������������� �#�%�(�+�.�2�7�:�?�D�I�N�T�Y�]�b�g�m�s�x�}���������������������������çɧЧ֧ݧ���������
�����#�(�.�4�:�@�G�O�U�[�a�g�m�s�y��������������������ʨѨب������	������� �#�&�*�.�3�8�<�@�D�H�M�S�X�^�c�h�m�s�x�~�����������������������ũ̩ԩ۩�������	��� �'�.�6�>�C�K�P�U�[�`�f�m�t�y��������������������������������ƪ̪Ъժ٪ު������������!�*�1�9�B�F�L�T�X�]�b�h�n�t�{������������������������������ƫͫҫ֫ګޫ��������������	������� �#�(�,�0�2�4�6�9�=�A�E�I�M�S�Y�[�]�_�a�d�f�j�l�p�t�z�~�������������������������ŬȬͬѬ׬۬����������������"�&�)�.�3�9�?�D�I�Q�Y�]�a�c�h�l�p�x�����������������������ƭ̭ӭڭ���������
���&�.�0�4�8�=�B�J�R�U�X�[�^�a�f�j�o�t�w�z�}���������������������������������ŮˮѮ׮߮�����������
�����!�%�)�-�0�4�8�:�C�L�Q�V�\�b�h�k�n�q�t�v�{���������������������ɯӯݯ�����
���'�3�>�N�Q�W�]�c�k�z�����������������аհ۰�����������������
�����!�#�%�'�+�/�3�9�=�?�A�F�K�P�U�Z�_�a�c�m�q�y���������������������������������ıͱֱ߱��������%�.�7�?�G�P�Y�b�l�u��������������²˲ղ޲��������(�1�:�D�M�V�_�h�r�|���������������óֳ̳���������� �%�.�3�6�=�@�E�J�M�P�X�[�`�c�k�p�x�{�~���������������������������´ǴʹӴش޴������
���"�(�0�8�@�D�J�X�f�j�n�r�v���������������������µ͵ص������	���$�.�8�;�>�A�F�J�P�W�^�f�m�q�u�y�}������������������������������ƶ̶Ҷ۶�������������"�(�+�0�5�:�?�C�J�Q�X�_�c�g�k�o�u�{���������������������·ȷѷշܷ�����������
�����#�'�-�3�9�A�H�L�T�Y�\�_�b�e�h�k�n�q�t�x�|���������������������������������������øǸ˸ϸӸ׸۸߸�����������#�*�1�8�?�F�M�T�[�b�i�p�u�{�������������������������Ź˹ѹֹܹ���������
����!�'�-�3�8�>�D�I�O�U�Z�`�f�k�q�w�|�����������������������ºȺͺӺٺ޺�������������#�)�/�3�9�?�E�K�Q�W�]�c�i�o�s�w�{��������������������������Ļͻֻ߻�����	����'�/�6�=�E�M�T�[�c�k�r�y�����������������ü̼ռݼ���������!�*�3�:�A�J�S�\�e�n�w�~���������������ǽѽ۽��������"�*�2�7�<�E�M�T�]�e�l�u�}�����������������ž̾־߾�����
���#�,�5�>�L�Z�a�f�k�p�u�z��������������������ÿȿп׿߿���������
�����#�)�/�5�;�I�S�a�o�u����������������������������������������"�'�,�1�7�=�B�G�M�S�X�]�`�c�l�n�p�s�w�}������������������������������	����!�$�*�0�:�D�L�T�]�f�j�r�z����������������������������������������������������������������!�&�+�-�7�=�C�I�O�U�[�`�c�f�i�k�m�q�u�z������������������������������������������������������������������������	��
����� �%�*�/�4�9�>�C�H�M�R�W�\�a�f�k�p�u�y�}�������������������������������������������	�
�����$�+�3�;�@�E�L�S�Z�a�d�g�l�n�r�w�y�{�}��������������������������������������������������������	���������$�)�.�3�9�?�A�D�K�Q�W�^�b�f�h�j�n�t�y�{��������������������������������������������������!�#�)�+�-�2�4�8�=�?�D�I�M�T�^�c�i�l�r�u�z��������������������������������������������������������������
����!�'�-�2�8�<�A�D�I�O�V�^�e�n�x���������������������������������������������������%�-�2�5�9�<�G�Q�[�d�o�y�������������������������������������(�/�6�=�D�K�R�Y�`�g�o�u�{���������������������������������������	�
����!�&�*�/�5�<�?�F�M�Q�Z�c�h�n�s�x���������������������������������������������������'�-�4�9�<�A�F�K�S�W�^�f�n�s�x�~�������������������������������������������������&�,�/�2�6�:�>�C�I�O�V�]�b�f�j�n�r�v�z�~�������������������������������������������������������������������
������"�&�*�.�2�6�:�>�B�F�J�N�R�V�Z�^�b�f�j�n�r�v�z�~�������������������������������������������������������������������
������"�&�*�.�2�6�:�>�B�F�J�N�R�V�Z�^�b�f�j�n�r�v�z�~�������������������������������������������������������������������
������"�&�*�.�2�6�:�>�B�F�J�N�R�V�Z�^�b�f�j�n�r�v�z�~�������������������������������������������������������������������
������"�&�*�.�2�6�:�>�B�F�J�N�R�V�Z�^�b�i�q�w�}����������������������������������������
�����"�)�4�?�H�Q�W�]�d�k�t�~���������������������������� �'�.�5�?�I�Q�Y�`�g�n�u�|����������������������������������
�� �*�3�<�F�P�Y�b�l�v����������������������'�8�@�F�M�T�[�b�g�m�r�w�}������������������������������������������'�/�5�;�B�I�P�W�[�`�h�p�x����������������������������(�;�N�T�[�d�l�t�z�}�����������������������������������������������"�)�0�3�9�?�B�E�J�O�U�[�_�d�k�o�u�y�}����������������������������������������������������#�)�/�8�A�H�O�U�\�a�f�k�q�w�|������������������������������������������!�'�-�4�:�B�J�R�Z�b�h�n�w�{���������������������������������������������&�-�1�5�A�G�N�S�X�_�f�l�r�|��������������������������������������� �'�-�3�;�@�G�N�[�c�j�q�x���������������������������	���$�-�5�=�G�Q�_�m�v���������������������������������
��'�+�/�7�?�F�N�V�_�h�n�t�{����������������������������������������� �&�,�0�4�<�D�I�N�S�X�^�l�s�z�~������������������������������������������� �)�2�8�>�D�N�X�`�i�n�q�v�{����������������������������������������������
����#�)�/�2�5�8�;�@�E�J�O�T�Y�]�a�e�j�o�s�w�}����������������������������������������"�+�2�9�B�K�R�X�_�d�h�l�q�v�{������������������������������������������"�*�2�9�A�H�P�Y�b�l�v�����������������������������������
���'�+�/�3�7�A�D�M�W�`�j�p�w�}��������������������������������$�*�0�6�<�B�H�T�^�c�j�o�v�y�}���������������������������������������������
������� �'�)�+�-�/�1�3�5�7�<�A�H�O�X�b�k�u�z����������������������������������������������������	�����"�'�,�1�6�;�@�E�J�O�T�Y�^�c�h�m�r�x�}����������������������������������������������������$�)�.�3�8�=�B�G�L�Q�V�[�`�e�j�o�u�z��������������������������������������	���!�)�.�5�:�@�H�O�V�^�d�j�q�y��������������������������������������������������� �%�*�/�4�9�>�C�H�L�P�U�Z�_�d�i�n�s�x�}������������������������������������������������$�+�2�9�@�G�N�U�\�c�j�p�v�|�����������������������������������������"�(�.�5�<�C�J�O�U�[�b�i�q�z�����������������������������������������������������
����!�&�+�0�5�:�?�D�I�N�S�X�]�b�f�k�p�u�z����������������������������������������������������#�(�-�2�7�<�C�J�O�T�Y�^�c�h�m�r�w�|�������������������������������������������������������������
������"�&�*�.�2�6�:�>�B�F�J�N�R�V�Z�^�b�f�j�n�r�v�z�~�����������������������������������������������������������������
���� �%�*�/�3�8�=�B�G�L�Q�U�Z�_�f�k�p�v�}���������������������������������������������������
�����#�(�-�4�;�@�E�J�O�T�Y�]�a�i�q�w�{�����������������������������������������������������������
�
���� �%�*�/�3�7�;�@�E�I�M�Q�U�Z�_�d�i�m�q�v�{����������������������������������������������������������	�
�����"�'�+�/�4�9�>�B�F�K�P�V�\�`�f�l�p�v�|����������������������������������������������������	����!�'�-�3�9�?�C�I�O�R�V�Z�^�b�e�h�l�p�t�x�{�����������������������������������������������������������������������%�+�0�5�9�=�A�E�I�M�Q�U�Y�]�a�e�i�m�q�u�y�}���������������������������������������������������������#�'�+�/�3�7�;�?�C�G�K�O�S�W�[�_�c�g�k�o�s�w�{������������������������������������������������������	�
����!�%�)�-�3�7�;�?�C�G�K�O�S�W�[�_�c�g�m�q�u�y�}����������������������������������������������'�3�9�<�?�D�G�N�R�V�Z�^�b�g�l�p�t�y�~������������������������������������������
�����$�(�.�9�C�R�\�`�j�p�v�|�������������������������������������������������������������� �$�(�+�/�2�6�:�>�B�E�I�L�P�T�X�\�`�d�h�l�p�t�x�|�������������������������������������������������	������!�%�(�,�/�3�6�9�=�A�E�I�M�Q�U�Y�]�`�d�h�l�p�t�x�|���������������������������������������������������������������$�(�+�/�3�7�;�@�D�H�L�P�T�X�\�a�e�i�m�q�u�|�����������������������������������������������
����!�&�+�0�4�8�=�B�G�L�Q�X�]�a�e�i�m�q�u�y�}�������������������������������������������������������������� �#�&�*�.�2�6�:�>�B�F�J�N�R�V�Z�^�b�f�j�n�r�v�z�~�����������������������������������������������������$�*�/�4�9�>�C�H�M�R�W�\�a�f�k�p�u�z����������������������������������������
#(-27<AFKPUZ_dinsx|����������������������������� %*/49?FJNRVZ^bfjoty~������������������������� )2;DMPUZ_dinsx}�����������������������������	$).26:>BFJNRW\afkpuz�������������������������$).27<AFKPUZ_cjqx����������������������������	"&*.259=AEHLPSW[_cgkosz}�������������������������������������������

"%(+.147:=@CFILORUX[^adgjmpsvy|���������������	$-6?HQZ]`cehknsx{������������������������������������
!&,469<?BHPSV[^adilotwz�����������������������������������					!	)	1	9	A	J	S	\	e	n	w	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	




'
.
3
8
?
F
L
Q
V
[
`
g
l
q
v
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�

")05<AHQ\ajov����������������������������	
!%)-159=AEIMQUY]aeimquy}��������������������������������







 
$
(
,
0
4
8
<
@
D
H
L
P
T
X
\
`
d
h
l
p
t
x
|
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
 $(,048<@DHLPTX\`dhlptx|���������������������������������#'+/37;?CGKOSW[_cgkosw{��������������������������������#'+/36:>BFJNRUY]aeimquy}��������������������������������	
!%)-159=AEIMQUY]aeimquy}�������������������������������� $(,048<@DHLPTX\`dhlptx|���������������������������������#'+/37;?CGKOSW[_cgkosw{��������������������������������
"&*.26:>BFJNRVZ^bfjnrvz~��������������������������������
"&*.26:>BFJNRVZ^bfjnquy}��������������������������������	
!%)-159=AEIMQUY]aeimquy}��������������������������������	
!%)-159=AEIMQUY]aeimquy}���������������������������������#'+/37;?CGKOSW[_cgkosw{��������������������������������#'+/37;?CGKOSW[_cgkosw{��������������������������������#'+/37;?CGKOSW[_cgkosw{��������������������������������
"&*.26:>BFJNRVZ^bfjnrvz~��������������������������������
"&*.26:>BFJNRVZ^bfjnrvz~��������������������������������
"&*.26:>BFJNRVZ^bfjnrvz~��������������������������������
"&*.26:>BFJNRVZ^bfjnrvz~�����������������������������#(-26;?DHMQUY^chpx����������������������������  	 
     ! % ) - 1 5 8 < @ D H L P T X \ ` d h l p t x | � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � !!	!!!!!!!"!&!)!-!1!5!9!=!A!D!G!K!O!S!V!Y!]!a!e!i!m!q!u!y!}!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!"""""""" "$"(","0"4"8"<"@"D"H"L"P"T"X"\"`"d"h"l"p"t"x"|"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"##
######!#%#)#-#1#5#9#=#A#E#I#M#Q#U#Y#]#a#e#i#m#q#u#y#}#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#$$
$$$$$$!$$$'$*$-$0$3$6$9$>$D$I$N$S$X$_$f$k$p$u$z$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$%%%% %'%.%5%<%C%J%Q%X%^%d%j%p%w%~%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%&&
&&&&$&)&.&3&8&=&B&G&L&Q&V&[&`&f&l&r&x&}&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&'''''''''#'''+'/'3'7';'?'C'G'K'O'S'W'['_'c'g'j'n'r'v'z'~'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'((( (((/(7(>(F(P(Y(c(l(v(~(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�()
)))))#)()-)5)=)C)I)N)S)X)])b)g)l)q)z)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)	****!*-*9*A*I*S*]*i*u*~*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*+++++++$+)+.+3+8+>+C+H+O+V+]+d+k+s+{+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+,	,,, ,',.,5,<,C,J,Q,X,a,j,s,|,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,--
----%-+-1-7->-E-N-U-^-e-l-r-y-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-....!.(...5.<.C.J.Q.X._.f.m.t.{.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�./
/////$/)/./3/8/=/A/F/K/O/S/X/]/a/f/k/p/u/z//�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/00000#0(0.03080<0A0E0J0N0S0X0^0c0i0m0r0w0{0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�011	11111 1%1+11161<1A1G1M1T1Z1a1f1l1r1w1}1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�122
2222"2'2-2126292<2@2E2I2N2U2[2a2g2m2s2y22�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�233333"3)3/363<3C3J3P3V3]3c3j3q3z3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�34
4444"4(4-43474<4@4D4H4L4P4T4X4\4`4d4h4l4p4t4x4|4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4555555#5(5/545;5B5G5L5S5X5_5f5j5q5v5}5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�56
6666#6(6-63696?6E6K6Q6W6]6e6k6r6v6{66�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�67	7777$7*70767<7B7H7N7T7[7b7i7p7w7{77�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�78	888888#8(8-81858;8@8F8L8Q8W8\8b8h8n8s8x8}8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�899
999"9(9.949:9@9F9L9R9X9^9c9h9m9s9y9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9:::: :':.:5:<:C:J:Q:X:_:f:m:s:y:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:;;;;!;';-;4;:;?;E;J;O;T;[;a;g;m;s;y;;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;<<<<"<*<2<:<@<H<N<V<_<g<m<q<u<y<}<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<=====*=4===E=M=U=[=c=j=q=y=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=>>>">,>;>H>S>[>`>l>u>|>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>??
?????"?'?,?0?5?:???D?H?M?R?W?\?a?f?k?p?u?z??�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?@	@@@@@"@'@,@1@6@:@A@H@O@V@\@b@i@p@w@~@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@AAA!A*A3A<ADALATA\AdAlAtA|A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�ABBBBBBB$B)B.B3B8B=BBBFBJBNBRBVBZB^BbBfBjBnBrBvBzB~B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�BCC
CCCCCC"C&C*C.C2C6C:C>CBCFCJCNCRCVCZC^CbCfCjCnCrCvCzC~C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�CDD
DDDDDD"D&D*D.D2D6D:D>DBDFDJDNDRDVDZD^DbDfDjDnDrDvDzD~D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�DEE
EEEEEE"E&E*E.E2E6E:E>EBEFEJENEREVEZE^EbEfEjEnErEvEzE~E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�EFF
FFFFFF"F&F*F.F2F6F:F>FBFFFJFNFRFVFZF^FbFfFjFnFrFvFzF~F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�FGG
GGGGGG"G&G*G.G2G6G:G>GBGFGJGNGRGVGZG^GbGfGjGnGrGvGzG~G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�GHH
HHHHHH"H&H*H.H2H6H:H>HBHFHJHNHRHVHZH^HbHfHjHnHrHvHzH~H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�HII
IIIIII"I&I*I.I2I6I:I>IBIFIJINIRIVIZI^IbIfIjInIrIvIzI~I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�IJJ
JJJJJJ"J&J*J.J2J6J:J>JBJFJJJNJRJVJZJ^JbJfJkJpJuJzJJ�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�JK	KKK'K3K9K?KEKLKSKZKaKhKoKvK}K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�KL	LLLL"L(L.L4L;LALGLMLTLZL`LfLmLsLyLL�L�L�L�L�L�L�L�L�L�L�L�L�L�L�L�L�L�L�L�LM	MMMM"M(M.M5M;MAMGMMMSMYM_MeMkMqMwM}M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�MN
NNN$N,N4N=NENMNUN^NeNlNwN�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�NO	OOOO O&O/O5O;OCOKOSO[OaOgOmOtO�O�O�O�O�O�O�O�O�O�O�OPPP'P3P?PPPaPrPyP�P�P�P�P�P�P�P�P�P�P�P�P�P�PQQQQ)Q1Q:QBQLQTQ\QdQlQsQ|Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�QR	RRR#R+R4R<RFRNRVR^RhRpRxR�R�R�R�R�R�R�R�R�R�R�R�R�R�R�RSSSS S(S1S9SCSKSTS\SfSnSvS}S�S�S�S�S�S�S�S�S�S�S�S�S�S�S
TT!T.T9TBTKTST\TfTnTwT�T�T�T�T�T�T�T�T�T�T�T�T�T�T�TU
UUU'U/U9UAUHUOUXUaUiUrU|U�U�U�U�U�U�U�U�U�U�U�U�U�UV	VVV#V,V4V=VEVNVVV^VfVnVuV~V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�VW
WWW&W/W7W?WGWPWXWaWjWrW{W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�WX	XXXX'X3X@XIXSX\XfXoXyX�X�X�X�X�X�X�X�X�X�X�X�X�X�XYYY!Y+Y3Y=YEYOYWY`YgYqYyY�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�YZZZ#Z+Z5Z=ZGZOZXZ_ZiZqZ{Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z[[[![)[3[<[F[P[Y[c[l[u[}[�[�[�[�[�[�[�[�[�[�[�[�[�[\
\\#\0\:\D\O\Y\c\m\w\�\�\�\�\�\�\�\�\�\�\�\�\]
]]])]3]?]I]S]_]j]u]]�]�]�]�]�]�]�]�]�]�]�]�]^^^&^0^;^F^P^Z^f^q^|^�^�^�^�^�^�^�^�^�^�^�^___$_1_;_E_O_Z_d_m_w_�_�_�_�_�_�_�_�_�_�_�_�_�_```#`-`7`A`L`V`a`l`{`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`a	aaa%a-a6a?aJaVa`aeajaqaxa~a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�ab
bb#b/b:bEbPb[bebobyb�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�bcccccccc"c&c*c.c3c7c;c@cEcLcQcVc[c`cfckcqcvc|c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c	ddddd%d,d4d<dBdHdNdUd[dadgdndtdzd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�de
eeee#e)e0e6e<eBeIeOeUe[ebehenete{e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�ef
ffff f&f,f2f8f?fEfKfQfXf^fdfkfrfwf|f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�f�fgg
g
gggggg"g%g(g+g.g1g4g7g:g=g@gCgGgKgOgSgXg]gcgigogtgzg�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�ghh
hhhh$h*h0h6h;hAhGhLhRhXh]hchihnhthzhh�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h�hiiiiiii"i&i+i0i5i:i>iCiHiMiRiVi[i`ieiiimiriwi|i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�ijjjjjj j%j*j/j4j9j>jCjHjMjRjWj\jajfjkjpjujzjj�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�jkk
kkkkkk#k)k/k5k;k?kEkKkQkWk]kdkkkrkyk�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�klllll$l+l2l9l@lFlMlTl[lblhlolvl}l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�lmmmmm#m*m1m7m<mAmFmKmPmUmZm_mdmimnmsmxm}m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�mn
nnn n%n-n5n<nCnHnOnTnYn`nenjnonwn|n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�noo
oooo%o,o3o9o>oEoJoOoXo_ohoootoyo�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�oppppp#p*p1p8p?pFpMpTp[pbpipppwp~p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�pqqqq q'q,q1q6q<qBqHqNqTqZq`qfqlqrqxq~q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�qr
rrr#r,r5r?rJrTr_rhrqrzr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rs
sss"s,s3s:sBsJsSs\sesnsws~s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�sttttttt#t*t/t4t9t>tCtHtMtStZtctltstzt�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�tuuuuu%u,u3u:uAuHuQuXu_ufumuvu}u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�uv	v
vvvv!v&v+v0v4v9v>vBvGvKvPvUvZv_vdvhvmvrvwv|v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�vww
wwwww$w)w.w3w8w=wBwGwLwQwWw]wcwiwowuw{w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�wx	xxxxx!x&x+x0x5x9x>xCxHxMxRxWx\xaxfxkxpxvx|x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�xyyyyyy$y*y0y5y;yAyGyMyRyXy^ydyjypyvy|y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�yzzzzz#z(z-z2z7z<zAzFzKzPzUzZz_zdziznzszxz}z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z{{
{{{{${){/{4{:{@{E{K{Q{V{\{a{f{l{r{x{}{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{||||"|(|.|4|:|@|F|L|R|X|^|d|j|p|v|||�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|}
}}}"}(}.}4}:}@}F}L}R}X}^}d}j}p}v}|}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}~~
~~~~~#~(~-~2~7~<~A~F~K~P~U~Z~_~d~i~n~s~x~}~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~!%)-16;@EIMQUY]aeintz�����������������������������"�(�.�4�9�?�E�K�Q�W�]�b�h�m�s�x�}�������������������������ĀʀЀր܀����������
����!�&�*�/�4�9�>�B�G�L�Q�V�[�`�d�i�m�r�w�|�����������������������������ȁρց݁����������#�*�1�8�?�F�M�T�[�b�i�p�w�~�������������������Ă˂҂ق��������
����&�-�4�9�>�C�H�M�R�W�\�a�f�k�p�u�z����������������������������Ńʃσԃكރ���������������$�)�.�3�8�=�B�G�L�Q�V�[�`�e�j�o�t�y�~���������������������������ĄɄ΄ӄ؄݄����������
�����#�(�-�2�7�<�A�F�K�P�U�Z�_�d�i�n�s�x�}���������������������������Åȅׅ҅ͅ܅�����������	�����"�'�,�1�6�;�@�E�J�O�T�Y�^�c�h�m�r�w�|���������������������������†dž̆цֆۆ�����������
����!�&�+�0�5�:�?�D�I�N�S�X�]�b�g�l�q�v�{�����������������������������ƇˇЇՇڇ߇�������������� �%�*�/�4�9�>�C�H�M�R�W�\�a�f�k�p�u�z����������������������������ňʈψԈوވ���������������$�)�.�3�8�=�B�G�M�T�[�a�h�o�v�}�������������������‰ɉЉ׉މ����������
������$�(�-�2�7�<�@�E�J�O�T�X�]�b�g�l�p�u�z����������������������������ŠNJ̊ЊՊڊފ������������� �'�.�5�<�C�J�Q�X�_�f�m�t�{���������������������ŋ̋ԋۋ���������������$�*�/�4�9�>�C�H�M�R�W�]�c�g�k�o�s�w�|���������������������������ƌˌь֌܌�������������� �%�)�-�1�5�;�?�D�I�O�T�Y�^�c�h�m�r�w�|�����������������������������ōʍЍՍڍߍ�������������� �%�*�/�4�9�>�B�G�L�R�V�Z�`�d�i�n�s�w�|�����������������������������Žǎ̎ю֎ێ�������������� �&�,�1�7�<�B�H�M�S�Y�^�d�i�o�u�{���������������������������Ə̏я֏܏���������
����$�+�2�7�<�A�F�K�P�U�Z�_�e�k�q�w�}�������������������ƐΐԐڐ��������
����&�-�4�;�B�I�Q�Y�a�j�s�|�����������������đ̑ԑܑ��������������"�'�,�1�6�;�@�E�J�O�T�Y�]�b�g�l�p�t�y�~�����������������������������ÒɒΒӒגےߒ�������������"�(�.�5�;�C�K�S�[�c�k�s�{�����������������Ó˓ӓۓ���������#�*�2�:�A�H�O�V�]�d�k�r�y���������������������Ɣ͔Ԕ۔������������#�(�-�2�7�<�A�F�K�P�U�Z�_�d�i�n�s�x�}���������������������������Õȕ͕ҕؕޕ������������"�*�.�3�8�=�B�G�L�Q�U�Z�^�c�g�l�p�u�z����������������������������ŖʖϖԖٖޖ���������������$�)�.�3�8�B�K�U�_�j�u�|�������������������—ɗЗחޗ����������!�'�.�5�=�D�K�R�Y�`�g�n�u�|�������������������˜ɘϘ՘ۘ�����������!�(�/�6�=�D�K�R�Y�`�g�n�u�|�������������������Ǚϙ֙ݙ������	���!�)�1�9�A�I�Q�Y�a�i�q�y�������������������ɚњٚ������	���!�)�1�9�A�I�Q�Y�a�i�q�y�������������������ɛћٛ������	����"�(�.�4�:�@�F�K�R�X�^�d�j�p�u�{�����������������������Ĝ̜Ҝ؜ޜ��������
����#�+�1�7�=�D�J�O�U�[�a�g�m�s�y������������������������Ɲ̝ҝ؝ޝ������������%�+�1�7�=�C�I�N�T�\�d�j�p�v�}�������������������������ǞΞԞ۞��������
����$�*�0�7�@�F�N�U�\�c�i�o�u�{���������������������Ɵ̟ҟ؟ޟ������������
�����"�'�,�1�6�;�A�G�M�T�[�b�i�p�w�}��������������������� ȠΠԠڠ�������
����%�0�6�<�B�I�T�Y�^�c�h�m�s�y��������������������������šʡϡԡ١ޡ������������� �&�,�2�9�?�E�I�N�S�Y�a�l�u��������������������������ŢʢϢԢ٢ޢ�����������������!�%�)�.�2�7�:�>�A�E�H�L�P�T�X�\�`�d�h�l�p�t�x�|���������������������������������������ãɣϣգڣ����������	�
�����!�%�*�0�5�;�@�C�F�I�L�O�R�U�X�[�_�c�g�k�o�s�w�{������������������������������������äǤ̤Фդ٤ޤ�����������	�����"�'�,�1�6�;�?�D�I�N�R�V�[�`�e�i�m�q�u�z��������������������������åȥͥҥ֥ۥ������������ �'�.�5�<�C�J�Q�X�_�f�m�t�{���������������������æɦϦզۦ�����������
�����#�(�-�2�7�<�A�F�K�P�U�Z�_�d�i�n�s�x�}���������������������������Ƨ̧ҧ֧ۧߧ�����������������$�*�0�4�8�<�@�D�H�M�R�W�\�a�f�k�p�u�z������������������������������ĨȨ̨Ѩ֨ۨ�����������
�����%�)�.�2�7�;�@�E�J�O�T�Y�^�c�h�m�r�w�|�������������������������������ũʩϩөשݩ��������
����#�(�-�2�7�;�?�D�I�M�R�W�\�d�i�n�r�v�z�~�����������������������������ĪɪΪӪتݪ���������
��� �$�)�-�1�5�:�>�C�G�L�Q�V�[�`�e�j�o�t�y�~�����������������������������ƫʫΫҫ֫۫߫���������	�����#�(�,�1�7�<�B�G�L�P�T�X�\�`�e�j�o�t�y�~�����������������������������ƬˬЬԬجܬ�����������	����� �$�)�-�2�7�<�A�F�K�P�U�Z�_�d�i�n�s�x�}�����������������������������­ƭ˭Эԭحݭ���������	�����"�&�*�.�2�6�:�>�B�I�N�S�X�\�a�e�j�n�s�x�}���������������������������®Ǯ̮Ѯ֮ۮ߮����������	�
�����$�)�-�1�5�:�?�E�J�P�U�[�a�h�n�t�z�����������������������ïȯͯүׯܯ������������
����!�&�,�0�5�9�>�B�G�L�Q�V�[�`�e�j�o�t�y�~�����������������������������ŰʰΰҰװ۰�����������
��� �&�-�2�8�=�C�H�M�R�W�\�a�g�k�o�s�x�|�������������������������������Ʊʱαӱױܱ������������
���� �%�*�/�4�9�>�C�H�M�R�W�[�`�e�j�n�r�w�|�����������������������������IJʲѲײ޲������������� �$�)�-�2�6�:�>�B�F�J�N�R�V�Z�_�c�h�l�q�v�|�����������������������������ųʳϳԳٳ޳������������
�����"�'�,�0�4�:�?�E�J�P�V�]�b�h�m�s�x�}�������������������������̴ٴ������)�3�=�H�T�a�i�q�z���������������������������ĵɵ͵ҵֵ۵�����������
���� �%�*�/�3�7�<�A�F�J�N�R�V�[�`�e�i�m�r�x�}�����������������������öȶͶҶֶ۶�������������
���� �(�/�7�@�E�N�S�[�d�n�r�w�{�����������������������������·Ƿ̷ѷַ۷�����������
������$�)�-�1�6�;�@�F�K�Q�V�\�a�g�l�r�w�|�������������������������������¸ȸ̸Ѹָڸ߸����������������"�'�.�5�<�E�J�P�U�[�`�f�k�q�v�|�������������������������������ŹʹϹӹعܹ�����������
�����#�(�-�2�7�<�A�F�J�O�T�Y�]�a�f�k�p�t�x�|���������������������������źʺкպۺ�����������"�*�2�9�@�H�P�X�`�h�p�x�������������������Ȼлػ�����������&�.�5�<�D�L�T�\�d�l�t�|�����������������ļ̼Լܼ������������#�)�0�7�>�E�L�S�Z�a�h�n�r�w�{�����������������������������ýȽͽҽ׽ܽ����������������"�&�*�/�4�9�=�A�F�K�Q�V�\�a�g�m�t�y��������������������������ƾ̾Ӿپ���������
����%�+�1�7�=�C�I�N�T�Z�`�e�j�p�v�|�������������������������ƿ̿ѿֿܿ����������!�(�0�7�?�E�K�R�Y�b�l�q�u�z������������������������������������������������"�'�+�0�5�:�?�D�I�M�Q�U�Z�_�d�h�l�q�v�{������������������������������������	���,�7�=�C�K�S�[�c�l�u�~�����������������������������������(�1�;�E�O�Y�c�l�v����������������������������)�4�>�H�T�_�k�o�t�x�}�������������������������������������������������������	�
���� �$�(�,�1�6�;�?�C�I�N�T�Y�_�e�l�r�w�}�����������������������������������������������������������	�����"�'�,�1�6�=�B�G�K�P�U�Z�_�d�i�n�r�w�|����������������������������������������������������	����#�)�0�7�=�D�K�R�Y�`�g�m�s�y��������������������������������������������������
����"�(�.�4�:�@�F�K�Q�W�]�b�g�m�s�y�~��������������������������������������������	����!�&�+�0�6�;�@�E�J�O�T�Y�^�c�h�n�s�y�~�������������������������������������������������� �&�,�1�7�<�A�F�M�S�Z�`�g�n�u�|������������������������������������������������������������ �%�*�/�4�8�?�D�I�N�S�X�]�b�g�l�q�v�{����������������������������������������������������������������%�)�-�5�8�=�C�K�P�V�^�d�j�n�r�y������������������������������������������$�*�1�8�?�F�J�N�R�Y�]�d�k�y������������������������������������������	�����!�*�.�7�@�H�L�S�W�[�_�c�n�w��������������������������������#�,�8�A�E�I�M�Q�U�Y�]�d�h�l�w�{�����������������������������������������������
�����#�*�3�:�B�J�P�T�X�\�`�f�o�{���������������������������������������"�.�5�<�F�M�V�]�f�m�t�~���������������������������������$�+�2�<�F�L�V�]�d�n�t�{���������������������������������������
����!�%�)�0�4�:�@�H�L�S�[�_�c�i�m�v������������������������������������������� �$�(�,�0�3�9�?�C�G�N�U�\�c�j�q�x������������������������������������������������%�-�3�7�;�?�C�F�L�S�]�d�k�r�x�������������������������������������� �*�4�>�E�O�V�]�d�k�q�x�������������������������������������������������#�'�4�D�H�L�S�Y�`�d�h�l�p�t�{������������������������������������������	����%�,�3�:�D�J�Q�[�d�k�t�~�����������������������������������#�*�8�>�F�P�Z�a�h�n�r�y������������������������������������������
����)�0�:�A�K�R�Y�c�m�t�z���������������������������������������������������
�����#�'�-�4�;�B�M�U�Y�_�h�o�u�x�|��������������������������������������������
���$�+�6�@�M�W�^�b�f�j�n�w������������������������������	���$�-�7�:�>�B�F�J�N�T�[�b�i�o�u�|������������������������������������������������� �'�.�5�<�C�J�P�T�]�a�e�i�m�s�z���������������������������������������������� �'�.�7�>�E�L�S�W�[�a�m�q�u�~�������������������������������������������������������$�*�0�4�8�<�B�F�L�P�T�[�b�s�w�{������������������������������������������)�0�6�:�>�E�K�O�U�Y�a�g�k�s�{������������������������������������������
���"�)�/�6�=�D�M�T�[�_�e�i�o�v�}�������������������������������������������������������
�� �$�+�2�9�@�L�S�W�[�_�f�m�t�{����������������������������������������
�����%�,�3�:�A�H�O�U�\�c�j�q�x����������������������������������������������"�)�0�7�>�D�J�P�Y�`�g�r�}�������������������������������#�.�9�D�O�[�c�k�t�}��������������������������������������!�)�0�8�@�G�N�W�`�i�r�{����������������������������������
����*�1�8�?�F�M�V�]�c�j�s�z�������������������������������������� �(�1�:�C�L�S�Z�c�o�y�����������������������������������$�,�9�@�F�N�U�_�c�g�k�o�s�w�{����������������������������������������������������
������"�&�*�.�2�6�=�D�O�V�\�c�j�q�x����������������������������������������&�/�6�=�D�K�R�Y�c�i�q�x������������������������������������	����(�,�0�4�8�<�@�D�H�L�P�T�X�\�`�d�h�l�p�t�x�|������������������������������������������������������������������������� �$�(�,�0�4�8�<�@�D�H�L�P�T�X�\�`�d�h�l�p�t�x�|������������������������������������������������������������������������� �$�(�,�0�4�8�<�@�D�H�L�P�T�X�\�`�d�h�l�p�t�x�|������������������������������������������������������������������������� �$�(�,�0�4�8�<�@�D�H�L�P�T�X�\�`�d�h�l�p�t�x�|������������������������������������������������������������������������� �$�(�,�0�4�8�<�@�D�H�L�P�T�X�\�`�d�h�l�p�t�x�|������������������������������������������������������������������������� �$�(�,�0�4�8�<�@�D�H�L�P�T�X�\�`�d�h�l�p�t�x�|������������������������������������������������������������������������� �$�(�,�0�4�8�<�@�D�H�L�P�T�X�\�`�d�h�l�p�t�x�|������������������������������������������������������������������������� �$�(�,�0�4�8�<�@�D�H�L�P�T�X�\�`�d�h�l�p�t�x�|������������������������������������������������������������������������� �$�(�,�0�4�8�<�@�D�H�L�P�T�X�\�`�d�h�l�p�t�x�|������������������������������������������������������������ �$�(�,�0�4�8�<�@�D�H�L�P�T�X�\�`�d�h�l�p�t�x�|������������������������������������������������������������ �$�(�,�0�4�8�<�@�D�H�L�P�T�X�\�`�d�h�l�p�t�x�|������������������������������������������������������������ �$�(�,�0�4�8�<�@�D�H�L�P�T�X�\�`�d�h�l�p�t�x�|������������������������������������������������������������ �$�(�,�0�4�8�<�@�D�H�L�P�T�X�\�`�d�h�l�p�t�x�|������������������������������������������������������������ �$�(�,�0�4�8�<�@�D�H�L�P�T�X�\�`�d�h�l�p�t�x�|������������������������������������������������������������ �$�(�,�0�4�8�<�@�D�H�L�P�T�X�\�`�d�h�l�p�t�x�|������������������������������������������������������������ �$�(�,�0�4�8�<�@�D�H�L�P�T�X�\�`�d�h�l�p�t�x�|������������������������������������������������������������ �$�(�,�0�4�8�<�@�D�H�L�P�T�X�\�`�d�h�l�p�t�x�|�������������������������������������������������
���#�)�-�1�5�9�=�A�E�I�M�Q�U�Y�]�a�e�i�m�q�u�y�}�������������������������������������������������������	�
�����!�%�)�-�1�5�9�=�A�E�I�M�Q�U�Y�]�a�e�i�m�q�u�y�}�����������������������������������������������������	
!%)-159=AEIMQUY]aeimquy}��������������������������������	
!%)-159=AEIMQUY]aeimquy}��������������������������������	
!%)-159=AEIMQUY]aeimquy}��������������������������������	
!%)-159=AEIMQUY]aeimquy}��������������������������������	
!%)-159=AEIMQUY]aeimquy}�������������������������������#(,048<@DHLPTX\`dhqz~��������������������������������
"&*.26:>BFJNRVZ^bfjnrvz~��������������������������������
"&*.26:>BFJNRV^fpz������������������
 &,2:BKQY_ekqw��������������������		
			%	+	1	7	=	C	I	O	U	[	a	g	m	s	y		�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	
	



%
+
3
;
C
I
O
U
[
a
g
o
w
}
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
 %*/49>CHQX]bgnsx}������������������������ %*/49>EJOTY^chmrw|������������������������






!
&
+
0
5
:
?
D
I
N
S
X
]
b
g
l
q
v
{
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
	"',16;@EJOTY^chmrw|�������������������������
#(-27<AFKRW\bglqv{�������������������������� %*/49@EJQX]bglqv{��������������������������	"',16=BGLQV[`fkpuz�����������������������"',16;@EJOVZ_dinrw|�����������������������
"(.39?EKQW]ciou{������������������������	"&+/49>CHLQVZ_dinrvz~���������������������
%,29?ELRY_emu~�����������������������$).38=BGLQV[`ejoty~������������������$)-159=AEIMRW^cjqv}�������������������
&-4;BIPW^elsz����������������������
%+05;AGMSY_ekqw}�����������������������#(-27<AFKPU\cjnty��������������������������������	
"&*.26:>CHNRVZ^bfknrvz~����������������������������$).37<AFKPUZ_dinuz����������������������������
 $*0369<?BEHKNQTWZ]`cfilorux{~������������������������������������������� #&),/258;>ADGJMPSVY\_behknqtwz}�������������������������������������������

"%(+.147:=@CFILORUX[^adgjmpsvy|������������������������������������������   	        ! $ ' * - 0 3 6 9 < ? B E H K N Q T W Z ] ` c f i l o r u x { ~ � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � !!!!!!!!!! !#!&!)!,!/!2!5!8!;!>!A!D!G!J!M!P!S!V!Y!\!_!b!e!h!k!n!q!t!w!z!}!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!"""
"
"""""""""%"("+"."1"4"7":"="@"C"F"I"L"O"R"U"X"["^"a"d"g"j"m"p"s"v"y"|""�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"###	########!#$#'#*#-#0#3#6#9#<#?#B#E#H#K#N#Q#T#W#Z#]#`#c#f#i#l#o#r#u#x#{#~#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#$$$$$$$$$$ $#$&$)$,$/$2$5$8$;$>$A$D$G$J$M$P$S$V$Y$\$_$b$e$h$k$n$q$t$w$z$}$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$%%%
%
%%%%%%%"%%%(%+%.%1%4%7%:%=%@%C%F%I%L%O%R%U%X%[%^%a%d%g%j%m%p%s%v%y%|%%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%&&&	&&&&& &$&(&,&0&4&8&<&@&D&H&L&P&T&X&\&`&d&h&l&p&t&x&|&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&'''''''' '$'(','0'4'8'<'@'D'H'L'P'T'X'\'`'d'h'l'p't'x'|'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'(((((((( ($(((,(0(4(8(<(@(D(H(L(P(T(X(\(`(d(h(l(p(t(x(|(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�()))))))) )$)(),)0)4)8)<)@)D)H)L)P)T)X)\)`)d)h)l)p)t)x)|)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)******** *$*(*,*0*4*8*<*@*D*H*L*P*T*X*\*`*d*h*l*p*t*x*|*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*++++++++++ +#+&+)+,+/+2+5+8+;+>+A+D+G+J+M+P+S+V+Y+\+_+b+e+h+k+n+q+t+w+z+}+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+,,,
,
,,,,,,,",%,(,+,.,1,4,7,:,=,@,C,F,I,L,O,R,U,X,[,^,a,d,g,j,m,p,s,v,y,|,,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,---	--------!-$-'-*---0-3-6-9-<-?-B-E-H-K-N-Q-T-W-Z-]-`-c-f-i-l-o-r-u-x-{-~-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-.......... .#.&.).,./.2.5.8.;.>.A.D.G.J.M.P.S.V.Y.\._.b.e.h.k.n.q.t.w.z.}.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.///
/
///////"/%/(/+/./1/4/7/:/=/@/C/F/I/L/O/S/W/[/_/c/g/j/n/r/v/z/}/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/0000!0'0-050=0E0M0V0\0d0j0q0w0~0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�011	1
11111#1(1,1014181<1@1D1H1M1R1W1\1b1h1n1t1z11�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�12	2222 2'2-242:2@2F2L2R2W2]2c2f2o2v2~2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2333333"3)30373<3A3H3O3V3]3b3g3l3s3x3}3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�344
444 4%4*41484?4D4I4N4S4Z4c4l4q4x4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�45
5555 5%5*5/54595>5E5L5S5Z5a5j5o5t5{5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�56	666"6-666;6@6E6J6S6Z6a6h6o6v6}6�6�6�6�6�6�6�6�6�6�6�6�6�6�67777(717:7E7J7O7Z7b7k7t7}7�7�7�7�7�7�7�7�7�7�7�7�7�78888!8,878B8M8X8c8n8y8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�8�89999 9'9.979@9I9R9Y9b9h9m9r9y99�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9�9:::: :&:,:6:@:F:L:T:Y:^:d:j:p:v:|:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:�:;
;;;(;1;:;C;L;U;_;i;q;y;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;�;<
<<<<"<'<,<1<6<<<B<H<N<T<Z<`<f<k<p<u<z<<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<======$=*=0=6=<=B=H=N=R=V=]=c=i=o=t={=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=�=>	>>!>/>;>G>U>c>q>u>}>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>�>???#?*?1?8???F?M?T?[?b?i?p?w?~?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?@
@@@@&@-@4@;@B@I@P@W@^@e@l@s@z@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@�@AA
AAAAA#A(A-A2A7A=ACAIAOAUA[AaAgAmAsAxAA�A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�A�AB	BBBBB"B'B,B1B6B<BABFBKBPBUBZB_BdBiBrBwB�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�B�BCC
CCCCC#C(C-C2C7C@CECJCOCWC_CgCoCwCC�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�C�CDD	DDDDD!D&D*D/D4D8D=DBDFDKDPDTDYD^DbDgDlDqDvD{DD�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�D�DE	E
EEEE E%E*E.E3E8E<EAEFEJEOETEXE]EbEgElEqEuEzEE�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�E�EF	FFFF F&F+F1F7F<FBFHFMFSFYF^FdFjFpFvF|F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�F�FGGGGGG$G)G.G3G7G<GAGFGKGOGTGYG^GcGhGlGqGvG{G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�G�GH	HHHH H&H+H1H7H<HBHHHMHSHYH_HeHkHpHvH|H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�H�HII	IIIII!I&I*I/I4I8I=IBIGILIPIUIZI_IdIhImIrIwI{I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�I�IJJJJJJ"J(J.J3J9J?JEJKJPJVJ\JbJgJmJsJyJ~J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�J�JKKKKKK$K*K0K5K;KAKFKLKRKWK]KcKiKoKuKzK�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�K�KL
LLLLL!L&L+L0L4L9L>LBLGLLLPLULZL^LcLhLlLqLvL{L�L�L�L�L�L�L�L�L�L�L�L�L�L�L�L�L�L�L�L�L�L�L�L�L�L�L�LMMMMMM"M(M.M3M9M?MDMJMPMUM[MaMfMlMrMwM}M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�M�MNNNNNN$N*N/N5N;NANFNLNRNXN]NcNiNnNtNzNN�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�N�NO	OOOO O%O+O1O6O<OBOHONOTOZOaOhOoOuO|O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�OP	PPPP$P+P2P9P?PFPMPSPZPaPgPnPuP{P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�PQQ
QQQQ$Q)Q/Q5Q;QAQGQLQRQXQ^QcQiQoQuQzQ�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�QRRRRRR R%R*R/R4R9R>RDRIRNRSRXR]RbRgRkRpRuRzRR�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�RSS
SSSS!S&S+S0S5S:S?SDSISNSSSXS]SbShSmSrSwS|S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�STT
TTTT"T'T,T1T7T=TCTITOTUT[TaTgTmTsTyTT�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�TU	UUUU!U'U-U3U:U@UFULURUXU^UdUkUqUwU}U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�UVVVVV V&V+V1V7V=VCVIVOVUV[VaVgVmVsVyVV�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�V�VW	WWWW%W,W3W:WAWHWOWVW]WdWlWsWzW�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�WXXXX"X)X0X7X>XEXLXSX[XbXiXpXwX~X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�X�XYYYYYYYY$Y)Y.Y3Y8Y=YBYGYMYRYWY\YaYfYkYpYuYzY~Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�YZZZZ$Z+Z3Z;ZAZHZQZZZaZlZvZ�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z[[[$[,[4[?[J[R[[[d[k[v[�[�[�[�[�[�[�[�[�[�[�[�[�[�[\\$\0\9\D\O\X\c\q\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\]]]]!]'],]/]2]5];]B]H]M]T]W]\]c]i]q]x]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]�]^^^^"^(^/^6^>^I^S^Y^`^g^n^t^{^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^�^_____'_1_;_E_M_U___g_l_q_v_|_�_�_�_�_�_�_�_�_�_�_�_�_�_�_�_```"`(`.`5`>`G`P`Y`c`l`u`~`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`a
aaa#a+a2a:aCaMaPaTaYa^acahamarawa|a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�a�abbbb%b,b3b<bEbNbWb`bfbnbtb~b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�bc
ccc"c)c0c7c>cEcLcScXcacjcsczc�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c�cddd d&d.d4d>dCdLdUd^didndud|d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�deee e)e2e;eFeQeXe_efemete{e�e�e�e�e�e�e�e�e�e�e�e�e�e�e�efff(f2f=fFfOfXfafjfrf{f�f�f�f�f�f�f�f�f�f�f�f	gg!g,g5g=gFgQg\ghgug�g�g�g�g�g�g�g�g�g�g�g�gh	hhhh%h,h3h:h?hDhIhPhZhehohzh�h�h�h�h�h�h�h�h�hiii!i.i5i<iAiFiKiPiUi\ieijimiriyi�i�i�i�i�i�i�i�i�i�i�i�i�i�i�ijjjjjj"j)j/j6j<jCjHjMjRjWj\jcjjjojvj}j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�jk	kkkk#k*k0k6k<kBkJkRkXk`khkmktk{k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�k�kllllll(l/l4l9l<l?lBlIlPlYlblklrlyl~l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�lmmmmmm m%m*m/m4m9m>mCmHmMmRmWm\mamfmkmpmumzmm�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�mn
nnnn&n.n6n=nDnKnSn[ncnjnqnyn�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�no
ooo%o-o5o<oDoKoRoYoaohopoxoo�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�opppp!p(p/p8p@pEpIpNpSpXp]papfpjpnprpvp{p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�p�pqq
qqqq!q&q*q.q2q6q:q>qBqFqJqOqVq\qcqjqqqxqq�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�qrrrr r'r.r5r<rBrHrNrUr[rbrhrorvr}r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rsssss$s+s1s8s?sFsMsSsZsashsosvs}s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�st	tttt%t+t2t9t@tGtNtUt\tctjtqtxtt�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�t�tuuuuu#u)u0u7u>uEuLuSuZuauhuouvu}u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�u�uvvvv v'v.v5v<vCvJvQvXv_vfvmvtv{v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�v�vw
wwww"w(w.w3w8w>wCwHwNwTwZw`wfwkwpwvw|w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�w�wxx
xxxx%x+x0x5x;xAxFxLxRxXx^xdxjxpxvx|x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�x�xy	yyyyy%y+y1y7y=yCyIyPyWy^yfynyvy~y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�y�yz	zzzz!z'z.z5z<zCzJzQzXz_zfzkzrzyz�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z{{{{{%{-{5{={E{M{S{Y{_{f{m{t{{{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{|
||!|)|2|9|@|D|H|L|P|T|X|\|`|d|h|l|p|t|x|||�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|�|}}
}}}}}#}(}.}4}:}@}F}L}R}X}^}d}j}p}v}~}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}~~~~ ~&~,~2~8~>~D~J~P~V~\~b~h~n~t~z~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~�~
"(.4:@FLV^elsy����������������������%�,�4�<�D�L�T�\�a�f�k�p�u�z��������������������������������ĀȀ̀ЀԀ؀܀������������������ �$�(�,�0�4�8�<�@�D�H�L�P�T�X�]�a�e�i�m�q�u�y�}�����������������������������������ŁɁ́сՁف݁�������������	�
�����!�'�0�8�@�I�R�[�d�m�v����������������ł΂ׂ������
���'�0�8�@�I�R�[�d�m�v����������������Ã̃Ճރ��������&�-�3�9�?�E�K�Q�W�]�c�i�o�u�{�������������������������ńɄ΄ӄ؄݄�������������%�*�0�6�;�A�G�L�R�X�]�c�i�n�t�z�������������������������ąɅυՅۅ��������������$�*�0�6�<�B�E�H�K�N�Q�T�[�c�k�s�z�������������������džφ׆ކ�������
���"�'�,�3�;�C�K�R�Z�b�j�q�y�������������������Ƈ͇Շ݇��������������"�%�(�+�.�1�7�:�>�C�G�L�Q�W�]�c�h�p�v�y�|������������������������ɈЈ؈�����������%�,�4�<�D�L�T�X�\�_�e�k�q�u�{�����������������������ÉɉωՉۉ�������������#�)�/�5�;�A�G�M�S�Y�_�e�p�{�������������Ȋ͊Ҋ؊ފ�������������
�����!�#�'�-�3�9�>�C�J�Q�X�]�d�k�r�v�}�����������������������Ëȋ͋ҋ׋ًߋ������������������	������!�%�-�/�1�3�5�7�9�;�=�?�A�E�I�K�M�O�Q�S�X�^�b�f�j�n�s�w�y�{��������������������������������������ŒČɌό֌ڌތ������������
������!�%�)�-�1�5�9�=�C�G�K�V�[�_�c�i�m�q�u�|�����������������������������������ƍʍ̍Ѝҍ؍ۍ�������������������� �$�&�*�,�0�4�;�=�F�O�X�^�`�e�i�m�o�u�y�{������������������������������������ŽƎɎ̎ю֎؎ێݎ���������
���������!�#�%�'�)�+�-�/�1�3�5�7�9�;�=�?�A�C�G�I�K�M�Q�S�W�Y�[�_�c�i�k�m�o�q�u�y�{����������������������������������ÏŏǏɏˏ͏Ϗяُ����������
��������!�#�%�)�+�-�/�3�7�;�?�C�E�K�Q�S�U�W�Y�[�d�k�r�v�}�����������������������������������ǐɐː͐ѐՐאېݐߐ����������������
������#�'�+�4�9�<�>�A�D�I�K�N�S�W�Z�^�b�e�j�n�r�v�z�������������������������������đʑ̑Бԑۑ��������������������� �"�$�(�*�.�2�8�<�@�D�F�I�M�T�]�f�n�v�x�|�~�������������������������������ĒΒݒ���������
����!�'�.�5�7�9�<�>�D�F�I�M�S�Y�d�j�q�y�}�������������������������������œ˓ϓӓדݓ������������#�(�0�4�=�F�L�P�T�X�[�`�b�d�f�m�r�y�������������������ǔϔՔ۔�������������#�,�.�5�9�;�=�A�G�K�M�W�]�a�c�g�i�m�t�{���������������������������ǕΕӕؕݕ�������	��"�+�3�;�C�K�S�[�c�k�s�{�������������������������ĖɖΖӖՖږޖ���������
������$�(�,�2�8�:�>�B�F�J�N�P�R�T�V�\�b�f�h�j�l�u�y�������������������������������ėɗΗӗؗݗ��������������#�'�,�1�3�7�@�H�P�]�j�w�~�����������������������Řɘ͘ј՘ܘ�����
�����!�%�-�5�=�A�E�I�M�Q�U�[�a�e�p�x�|�������������������șәٙߙ�������������'�3�7�>�E�L�T�[�c�k�t�|���������������ʚ՚ܚ���������(�/�;�>�B�E�I�O�V�\�c�h�n�y���������������������������ě͛ϛћԛ֛؛ܛޛ��������������
�������"�&�(�*�,�2�7�:�B�J�L�Q�T�Y�d�k�p�u�w�{�}�������������������������������������������Ĝɜ͜ќ՜לܜߜ��������������
������ �&�*�.�0�4�6�8�<�>�B�G�L�Q�V�[�`�g�n�u�|�������������������������Ɲ˝ҝٝޝ����������'�.�8�C�H�O�V�]�e�m�x�������������������������žǞ̞Ӟ؞ݞ�������������� �'�/�4�9�@�E�J�O�V�[�b�g�n�s�|���������������������������ƟΟ֟۟������������!�'�+�/�5�;�D�H�M�S�W�\�`�d�j�p�z�����������������������ʠϠӠؠܠ�������������	����&�/�8�?�G�N�U�^�g�n�v�}�����������������á͡ء������
���%�-�5�>�A�F�I�N�T�Z�`�f�l�r�x�~�������������������ˢԢޢ��������&�-�5�<�D�L�U�]�f�p�{���������������ɣңܣ��������� �*�5�?�J�N�S�W�\�_�c�f�j�n�s�w�|�������������������������������ĤȤ̤Ҥ٤ߤ�������
����%�,�4�<�C�K�R�Z�c�l�v�������������������ĥͥեޥ�����
����'�1�:�D�K�S�Z�b�i�r�{�����������������������ǦΦզަ�����������&�/�:�=�A�E�I�M�R�V�Z�_�c�g�m�s�z�~�������������������������ȧѧާ������� �"�$�*�.�0�6�8�:�>�@�D�F�J�N�S�W�[�]�a�c�i�o�u�y������������������������������������������¨ƨȨͨҨԨ֨بڨߨ������������"�)�+�/�1�5�9�;�?�A�C�G�I�K�M�O�Q�U�W�Y�[�]�_�a�c�g�k�m�o�q�s�u�w�y�{�}������������������������������������������©ĩƩʩѩթ٩ݩ�����������������	�
������#�+�/�7�9�;�=�?�A�C�E�G�K�O�Q�S�U�W�]�_�e�i�m�r�t�v�z�|�~�����������������������������������ƪ̪Ҫݪ����
�� �+�6�A�L�W�b�m�x�������������Ϋܫ�������	����!�'�-�3�:�A�H�O�V�]�k�y�����������άܬ�����"�0�?�N�]�l�{�������������ŭЭۭ�������������#�)�/�4�9�>�C�H�M�R�V�Z�\�^�c�g�i�k�m�o�s�u�w�y�}����������������������������������îǮˮϮӮ׮ۮ߮�������������������#�'�+�/�3�7�;�?�C�G�K�O�S�W�[�_�c�g�k�o�s�w�{����������������������������������ïǯ˯ϯӯׯۯ߯�������������������#�'�+�/�3�7�;�?�C�G�K�O�S�W�[�_�c�g�k�o�s�w�{����������������������������������ðǰ˰ϰӰװ۰߰�������������������#�'�+�/�3�7�;�?�C�G�K�O�S�W�[�_�c�g�k�o�s�w�{����������������������������������ñDZ˱ϱӱױ۱߱�������������������#�'�+�/�3�7�;�?�C�G�K�O�S�W�[�_�c�g�k�o�s�w�{����������������������������������òDz˲ϲӲײ۲߲�������������������#�'�+�/�3�7�;�?�C�G�K�O�S�W�[�_�c�g�k�o�s�w�{����������������������������������ódz˳ϳӳ׳۳߳�������������������#�'�+�/�3�7�;�?�C�G�K�O�S�W�[�_�c�g�k�o�s�w�{����������������������������������ôǴ˴ϴӴ״۴ߴ�������������������#�'�+�/�3�7�;�?�C�G�K�O�S�W�[�_�c�g�k�o�s�w�{����������������������������������õǵ˵ϵӵ׵۵ߵ�������������������#�'�+�/�3�7�;�?�C�G�K�O�S�W�[�_�c�g�k�o�s�w�{����������������������������������öǶ˶϶Ӷ׶۶߶�������������	�
������"�%�(�+�0�3�7�:�=�@�C�F�I�L�O�R�U�X�\�`�d�h�m�r�x�~�����������������������·ȷηӷٷ߷��������������"�(�.�4�9�?�E�K�P�V�\�a�g�m�r�x�~�������������������������øǸʸ͸иӸָٸܸ߸����������������	��������!�$�'�*�-�0�3�6�9�<�?�B�E�H�K�N�Q�T�W�Z�]�`�c�f�i�l�o�r�u�x�{�~���������������������������������������������ùƹɹ̹Ϲҹչع۹޹������������������������� �#�&�)�,�/�2�5�8�;�>�A�D�G�J�M�P�S�V�Y�\�_�b�e�h�k�n�q�t�w�z�}���������������������������������������������ºźȺ˺κѺԺ׺ںݺ������������������
�
�������"�%�(�+�.�1�4�7�:�=�@�C�F�I�L�O�R�U�X�[�^�a�d�g�j�m�p�s�v�y�|������������������������������������������������ûŻǻʻλлһֻڻ߻������������������
�����!�#�(�*�/�1�5�7�;�=�D�F�H�J�O�Q�S�U�W�Y�^�b�d�i�m�o�t�x�z����������������������������������������¼ļɼϼѼ׼޼�����������	�������#�%�'�-�/�4�8�:�?�C�E�K�M�Q�S�W�Y�`�g�i�p�w�y�~�������������������������������������½Ľƽнսܽ���������	��
����������!�#�%�'�)�+�-�/�1�3�9�@�E�M�U�Z�\�^�`�b�d�f�h�j�l�n�p�r�t�v�x�z�����������������������Ǿɾ˾;ϾѾӾվ׾پ۾ݾ߾��������������������������	��
����������!�#�%�'�)�+�-�/�1�3�5�7�9�;�=�?�A�C�E�G�I�K�M�O�Q�S�U�W�Y�[�]�_�a�c�e�g�i�k�m�o�q�s�u�w�y�{�}��������������������������������������������������������������������ÿſǿɿ˿ͿϿѿӿտ׿ٿۿݿ߿��������������������������	��
����������!�#�%�'�)�+�-�/�1�3�5�7�9�;�=�?�A�C�E�G�I�K�M�O�Q�S�U�W�Y�[�]�_�a�c�e�g�i�k�m�o�q�s�u�w�y�{�}�������������������������������������������������������������������)�6�A�L�W�b�m�x���������������������	���'�1�<�G�Q�[�f�q�|������������������������������ �)�2�<�F�N�V�]�f�n�v�}������������������������������������� �#�&�*�.�2�6�:�>�B�F�J�N�R�V�Z�^�b�f�j�n�r�v�z�~�������������������������������������������������������������������
������"�&�*�.�2�6�:�>�B�F�J�N�R�V�Z�^�b�f�j�n�r�v�z�}�������������������������������������������������������������������	�
�����!�%�)�-�1�5�9�=�A�E�I�M�Q�U�Y�]�a�e�i�m�q�u�y�}�������������������������������������������������������������������	�
�����!�%�)�-�1�5�9�=�A�E�I�M�Q�U�Y�]�a�e�i�m�q�u�y�}�������������������������������������������������������������������	�
�����!�%�)�-�1�5�9�=�A�E�I�M�Q�U�Y�]�a�e�i�m�q�u�y�~�����������������������������������������
���"�)�0�7�>�E�L�S�Z�a�g�m�s�z������������������������������������������	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhihhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhjklmnopqrstuvwxyz{|}~��hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh�hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh������������������h������h���h�����������h�h���������h��h����h��h���hh����h�h������������hhhhhhhhhhhhhhhhhhhhh���������hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh�����hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh��������hhhh����hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh������hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh������hhhhhhhhhhhhhhhhhh��hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh�������h��	
hhhhhhhhhhh
hhhhhhhhhhhhhhhhhhhhh !"#$%&'()*+hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh,-./0hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh1h23hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh456789:;hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh  a 23 � '1o1D 41D 23D 4AAAAAA
C'EEEEIIIINOOOOOUUUUYaaaaaa
c'eeeeiiiinooooouuuuyyAaAaA(a(CcCcCcCcDdEeEeEeE(e(EeGgGgGgG'g'HhIiIiIiI(i(IIJijJjK'k'LlL'l'LlL�l�NnN'n'Nn�nOoOoOoRrR'r'RrSsSsS's'SsT't'TtUuUuUuU
u
UuU(u(WwYyYZzZzZzsOoUuD}D~d~LJLjljNJNjnjAaIiOoUu����������&'��GgKkO(o(����jDZDzdzGgNn������AaAaEeEeIiIiOoOoRrRrUuUuS&s&T&t&HhAaE'e'����Oo./Yyhfjry{�wy   
 (  clsx�� E; �����������������������������������#8553V:8Ctu6005��6788>��-M#C#C#C'G+Ke�'S'THT'UJT'tHt�tJt�T�T�T(	<	0	<	3	<		<		<		<		<	!	<	"	<	+	<	/	<	�	�	�	�	�	�	�	�	�	�	2
<
8
<

<

<

<
+
<
GVG>GW!<"<��������FV����������F
>
G
>
F
W
�
�
�
�
�
�
�
�
M2������B�L�Q�V�[�@�qrqt��������q�������������%.�55	55
55:5<5>5?5B5A�BDE�GHIJKLMNO"PRTUWaPQbdeY[\gkmKoTptuov%�����iruv�����=RcU�\f_aehij{�m��qprstux�������z����A%a%BbB#b#B1b1��DdD#d#D1d1D'd'D-d-E-e-E0e0()FfGgHhH#h#HhH'h'H.h.I0i0��KkK#k#K1k1L#l#67L1l1L-l-MmMmM#m#NnN#n#N1n1N-n-����LMLMPpPpRrR#r#Z[R1r1SsS#s#Z[`abcTtT#t#T1t1T-t-U$u$U0u0U-u-hijkVvV#v#WwWwWwWwW#w#XxXxYyZzZ#z#Z1z1h1tw
y
a�A#a#A	a	�����	�	����		��E#e#E	e	Ee�����	�	����I	i	I#i#O#o#O	o	�����	�	���������	�	���#�#U#u#U	u	�����	�	���#�#YyY#y#Y	y	Yy��BB��		B	B������ ! ! B!B��()()(B)B��01010B1B��89898B9B��@A@A��HIHI��PQPQPBQB�YYYB��`a`a`BaB��hihihBiB��������������EEEEEEEEE	E
EEE
EEE E!E"E#E$E%E&E'E(E)E*E+E,E-E.E/E`EaEbEcEdEeEfEgEhEiEjEkElEmEnEoE��pE�E�E�B�E�����E �  B�BtE�E�E�B�E�����E���B�����B�B�������B�������B�B�������`|E�E�E�B�E�����E�              3...... 2 2 2 2 2 5 5 5 5 5 !! ???!!?2 2 2 2  0i456789+"=()n0123456789+"=()aeoxYhklmnpstRsa/ca/sC�Cc/oc/u��FgHHHh'IILlNNoPQRRRSMTELTMZ�ZK�BCeEFMo����iFAX����"Ddeij1D 71D 91D 101D 32D 31D 52D 53D 54D 51D 65D 61D 83D 85D 87D 81D IIIIIIIVVVIVIIVIIIIXXXIXIILCDMiiiiiiivvviviiviiiixxxixiilcdm0D 3�!8�!8�!8�!8�!8�!8"8"8"8#"8%"8+"+"+"+"+"."."."."."<"8C"8E"8H"8=8a"8M"8<8>8d"8e"8r"8s"8v"8w"8z"8{"8�"8�"8�"8�"8�"8�"8�"8�"8|"8}"8�"8�"8�"8�"8�"8�"80	01234567891011121314151617181920(1)(2)(3)(4)(5)(6)(7)(8)(9)(10)(11)(12)(13)(14)(15)(16)(17)(18)(19)(20)1.2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)(m)(n)(o)(p)(q)(r)(s)(t)(u)(v)(w)(x)(y)(z)ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0+"+"+"+"::======�*8jVa-�k��N(N6N?NYN�N�N�N�N?QeQkQ�Q�Q�Q�Q�QR�R�RSS8SAS\SiS�S�S�S�S�VW�XY
YY'YsYP[�[�[\"\8\n\q\�]�]�]�]r^z^^�^�^__P_a_s_�_b6bKb/e4e�e�e�e�e�e�e�fg(g kbkyk�k�k�k�kll4lkp*r6r;r?rGrYr[r�r�s�s�t�tuu(u0u�u�uvv}v�v�v�v�w�w�w:y�y�ytz�z�zs|�|6Q�����3������������n�r�x�M�k�@�L�c�~���҉�7�F�U�x���d�p�����ʎ��������I�Ƒ̑ёw���������Q�^�b�i�˗�����ۘߘ��������ؚߚ%�/�2�<�Z��u������Þ͞ў������ �;�J�R������� 0ASDSESK0�0M0�0O0�0Q0�0S0�0U0�0W0�0Y0�0[0�0]0�0_0�0a0�0d0�0f0�0h0�0o0�0o0�0r0�0r0�0u0�0u0�0x0�0x0�0{0�0{0�0F0�0 �0 �0�0�0	�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0	�0�0���������!	

abcdefghijklmnopqrstu`��������� "#')+,-./26@GL��WXY��������N�N	N�V
N-NN2uYNNN)Y0W�N()()()()()()(	)()()()()()()()(a)(a)(a)(a)(a)(a)(	a)(a)(a)(a)(a)(a)(a)(a)(n)(ie�)(in)(N)(�N)(	N)(�V)(�N)(mQ)(N)(kQ)(]N)(AS)(g)(kp)(4l)((g)(ё)(W)(�e)(*h)(	g)(>y)(
T)(yr)(��)(]y)(�R)(�N)(|T)(f[)(�v)(O)(nj)(TS)(my)(O)(�)(�)OU|^�e�{
PTE212223242526272829303132333435	aaaaaa	aaaaaaaaa�intnN�N	N�V�NmQNkQ]NASgkp4l(gёW�e*h	g>y
Tyr��]y�R�y7usYi�*QpS�l�O�Qck
N-NN�]�S;S�[f[�vOnjTSY3637383940414243444546474849501g2g3g4g5g6g7g8g9g10g11g12g
Hg
erg
eV
LTD�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0
�N�T
�0�0�0�0
�0�0�0�0
�0�0�0�0
�0�0�0
�0�0�0�0
�0�0�0
�0�0�0
�0�0�0�0�0
�0�0�0�0
�0�0�0
�0�0�0
�0�0�0
�0�0�0�0
�0�0�0�0
�0�0�0
�0�0�0
�0�0
�0�0�0
�0�0�0�0
�0�0�0�0
�0�0
�0�0�0�0�0
�0�0�0�0�0�0
�0�0�0�0�0
�0�0�0
�0�0�0�0�0
�0�0�0�0�0
�0�0�0�0
�0�0�0
�0�0�0
�0�0�0
�0�0�0�0
�0�0�0�0�0
�0�0�0�0
�0�0�0
�0�0�0
�0�0�0
�0�0
�0�0
�0�0
�0�0
�0�0�0
�0�0�0
�0�0�0�0�0
�0�0�0
�0�0�0�0
�0�0�0�0�0
�0�0�0
�0�0
�0�0
�0�0�0�0�0
�0�0�0�0
�0�0�0�0�0
�0�0�0
�0�0�0�0�0
�0�0
�0�0�0
�0�0�0
�0�0�0
�0�0�0
�0�0�0
�0�0�0�0
�0�0�0
�0�0
�0�0�0
�0�0�0
�0�0�0
�0�0�0�0
�0�0�0
�0�0�0
�0�0�0
�0�0�0�0�0
�0�0�0�0
�0�0
�0�0�0�0�0
�0�0
�0�0�0�0
�0�0�0�0
�0�0�0
�0�0�0
�0�0�0
�0�0�0�0
�0�0
�0�0�0
�0�0�0�0
�0�0
�0�0�0�0�0
�0�0�00�p1�p2�p3�p4�p5�p6�p7�p8�p9�p10�p11�p12�p13�p14�p15�p16�p17�p18�p19�p20�p21�p22�p23�p24�p
hPa
da
AU
bar
oV
pc
dm
dm�
dm�
IU
s^b
-f�T
'Yck
f�l
*h_O>y
pA
nA
�A
mA
kA
KB
MB
GB
cal
kcal
pF
nF
�F
�g
mg
kg
Hz
kHz
MHz
GHz
THz
�!
m!
d!
k!
fm
nm
�m
mm
cm
km
mm�
cm�
m�
km�
mm�
cm�
m�
km�
m"s
m"s�
Pa
kPa
MPa
GPa
rad
rad"s
rad"s�
ps
ns
�s
ms
pV
nV
�V
mV
kV
MV
pW
nW
�W
mW
kW
MW
k�
M�
a.m.
Bq
cc
cd
C"kg
Co.
dB
Gy
ha
HP
in
KK
KM
kt
lm
ln
log
lx
mb
mil
mol
PH
p.m.
PPM
PR
sr
Sv
Wb
V"m
A"m1�e2�e3�e4�e5�e6�e7�e8�e9�e10�e11�e12�e13�e14�e15�e16�e17�e18�e19�e20�e21�e22�e23�e24�e25�e26�e27�e28�e29�e30�e31�e
galJLo�&S'�7�kR�H��fʎȌ�n2N�S����QYё�UHY�aiv�?�������jm�p�s=�j���NuSkr-��P]�oͅd��b؁��^gjm�rΐ�O�Q�R�d�jr�v��\��2�o����xy�}Ƀ��֊�X_`|~�br�xŒ���Xb\j�mo/}7~K��R���Q�Qz�}�u����bj��9N�[`�spuS�x�O�_
N�lxe"}�S^XwI����k���l�b��ceu�NiQ�Q�h�|o�Ҋϑ�RBTsY�^�e�o*y��j���Ξ�R�fwkb�t^�ab�d#oIq�t�y�}o�&��#�J�R�R�T�pˆ���^�_{c�k>|us�N�V�[�]`�sit�F�4���H���O�y�����`�N�P�[?\�ej�qBv��|����f.��R{g�gAm�n	tYukx}^�mQ.bx�+P]�m*��_Dah�s��)RTe\fNg�h�lt�uyψ�̑�?S�nT�q�t����W����g�m��z {�|�r�pX��N6�:RR�^�b�|�[m�f;�L�M����^@Q�UZXtf�Q*s�v<y^yey�yV��|����8������(���ސ���O�PMQ�R�RQS�UVhV@X�Xd\n\�`ha�a�aOe�e�f�hwmn"onq+r"t�x>yIyHyPyVy]y�y�y@z�z�{�}	~A~r��y�y�W�����9�ӌ���8����;�u`�B�&N�QhQ�OEQ�Q�R�R�UUU�U�UZX�XDYTYbZ([�^�^i_�_�`Naa�a`a�a4b�cdRdVetfggVgyk�kAm�n�n"opnq�w5r�r*sqtu;uvv�v�v�vJw@w�x�z�{{|[}�}>�R��y�A���������ˊ����9����8�r���v�|��V�ۗ���;����J(D(�3�;@9@IR�\�~C���fffiflffiffltsttvtetk~vtm�������������+����I��I������������������������������������������������������������qq{{
{{~~
~~��
��zz
zz
yy
yy��
����
����
����
����
����
����������������
����
����
����
������
������
����
��������
��������w��������
��
II&'&'&�&�&H&H&�&�&�&�&�&�&�&�
&�&I&I
&I��
��&,&-&E&I&J(,(-(.(E(I(J*,*-*.*E*I*J+,+E+I+J,-,E-,-E.,.-.E3,3-3.3E5-5E6,6-6.6E7-7E8E9,9E:,:EA,A-A.AEAIAJB-BEBIBJC'C,C-C.CDCECICJD,D-D.DEDIDJE,E-E.EEEIEJF,F-F.FEFIFJG,GEGIGJJ,J-J.JEJIJJ0p1pIp LQ MQ NQ OQ PQ Qp&1&2&E&F&I&J(1(2(E(F(I(J*1*2*E*F*I*J+1+2+E+F+I+JAIAJBIBJC'CDCECICJDEDIDJE'EEF1F2FEFFFIFJIpJ1J2JEJFJIJJ
&,
&-
&.
&E
&G
(,
(-
(.
(E
(G
*,
*-
*.
*E
*G
+E
,-
,E
-,
-E
.,
.E
3,
3-
3.
3E
5-
5.
5E
6,
6-
6.
6E
7-
8E
9,
9E
:,
:E
A,
A-
A.
AE
B-
BE
C,
C-
C.
CD
CE
D,
D-
D.
DE
DG
E,
E-
E.
EE
F,
F-
F.
FE
FG
G,
GE
Gp
J,
J-
J.
JE
JG&E&G(E(G*E*G+E+G3E3G4E4GCDCEDEFEFGJEJG@NQ@OQ@PQ7I7J9I9J:I:J3I3J4I4J-I-J,I,J.I.J5I5J6I6J4,4-4.4E413151617I7J9I9J:I:J3I3J4I4J-I-J,I,J.I.J5I5J6I6J4,4-4.4E41315161
4,
4-
4.
4E
3G
4G
7E3,3-3.4,4-4.7E8E'K'K
*,E*-,
*-,
*-E
*.E
*E,
*E-
*E.,E-
,E--EJ-EI
3-,
3,-3,I3E-
3E-
3E,3EE
3EE5--
5--5EE4-E
4-E4,J4E.
4E.4EE
4EE6-I6.E
6.E7E-
7E-
7EE7EJ9,E9EE
9EE9EI:EE:EJ:EIA.E
A.EBE-BEED-ED-JD-I
D,,D,,D.E
D.EDE-
DE-
E-,
E-EE-J
E,-
E,E
E.,
E.E
E,.
GE,
GEE
F-EF-IF,E
F,EF,IFEJFEIJEE
JEE(.J*,J*,I*.J*.I*EJ*EI,EJ,-I,EI3.I5-J4-J6-JD,JDEJJ-JJ,JJEJEEJBEJF-J
BE-
D-E9EJCEJ
F,-E.J
D,ECEED,EF,-,-J-,JE,JAEJ(-J
CEE
9,E
5EE3.JF,J5D�BD�'DDG'C(1E-E/5D9E13HD9DJGH3DE5DI5DI 'DDG 9DJG H3DE,D ,D'DG1�'D	,	0	0	:	;	!	?	0	0	& 	% 	 	 	_	_	(	)	{	}	0	0	0	0	
0	0	0		0	0	
0	0	0	[	]> > > > ___,0.;:?! (){}00#&*+-<>=\$%@ K@K L M N@N O@O P@P Q@Q R@R!""##$$%%&&
&&''((
(())**
**++
++,,
,,--
--..
..//00112233
3344
4455
5566
6677
7788
8899
99::
::AA
AABB
BBCC
CCDD
DDEE
EEFF
FFGG
GGHHIIJJ
JJD"D"D#D#D%D%D'D'!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~�)�)00
00�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0d1112131415161718191:1;1<1=1>1?1@1A1B1C1D1E1F1G1H1I1J1K1L1M1N1O1P1Q1R1S1T1U1V1W1X1Y1Z1[1\1]1^1_1`1a1b1c1������� %�!�!�!�!�%�%������1'2'G>GW����������W�e�X�e�_�n�_�o�_�p�_�q�_�r���e���e���n���n���o���o�ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefgijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzACDGJKNOPQSTUVWXYZabcdfhijklmnpqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABDEFGJKLMNOPQSTUVWXYabcdefghijklmnopqrstuvwxyzABDEFGIJKLMOSTUVWXYabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz17�������������������������"�������������������������"�������������������������������"�������������������������"�������������������������������"�������������������������"�������������������������������"�������������������������"�������������������������������"�������������������������"��������01234567890123456789012345678901234567890123456789'(,/H2-7JCDEF39A5B14*+.068:n��o(,G-JCDEF39A5B4*+.6:,-JDF395B4.6:�o(,G-7JCEF39A5B4*+.68:n�'(,/GH2-7JDEF39A5B14*+.068:(,/H2-7JDEF39A5B14*+.068:0.0,1,2,3,4,5,6,7,8,9,(A)(B)(C)(D)(E)(F)(G)(H)(I)(J)(K)(L)(M)(N)(O)(P)(Q)(R)(S)(T)(U)(V)(W)(X)(Y)(Z)0S0CRCDWZ
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
HV
MV
SD
SS
PPV
WCMCMDMR
DJ
{0K0
�0�0
�0
Kb
W[
�S
�0
�N
Y
�
)Y
�N
 f
!q
�e
MR
�_
�Q
�e
R
B}
u
��
�X
9T
o
�b
Uc
N
	N
J�
�]
-N
�S
c
p�
Sb
�y
zz
T
�n
	g
g
3u
rR
�U
M�0,g00	N00�N00�[00�p00Sb00�v00�R00We0�_�S=N8NAN"`O�O�OPzP�P�P�P�4:MQTQdQwQ�4gQ�QK�Q�Q�N�Q�Qߑ�QR�4;RFRrRwR5�R�R�R�RSSSISQSZSsS}SSSS,
pp�S�Sc�S�ST�T8THThT�T�TUSUcU�U�U�U�U�U�UWVWQVtVR�X�W�W
X�W2X1X�X��X�XYY"YbY���YZ'Z�YfZ�6�6[>[>[��[�[�[�[�[\S_"\�7`\n\�\�\�C]�n]k]|]�]�]/8�](^=^i^b8�!|8�^�^�^�^���^1#1#�"_"_�8�2�ab_k_�8�_�_�_�_�`:99�`�&�`HaLaNaLaza�a�a�a�a�a�a�abb]b�b�bPc+=c�bhc�c�c�+"d�c�c.:id~d�dwdl:Oele
0�e�fIf;�f;�:�Q�Qg�f���Cgg!g^gSg�3I;�g�gRh�hm4�hhi�;Bi�i�i�j�6�j<!k�8TkN<rk�k�k�k�:�:Nl�<�l�lglm>mwmAmimxm�m=4m/nnn3=�n�n�>�mno^?�?�o9ppp�=Jp}pwp�p%EqcB�q�C(r5rPrF�r�r5GHzs�s�>�s�>�>Gt\tqt�t�t?$u6L>u�Lpu�!v�O�ODP�?@�v�P�PQ3QwwwJw9@�wF@�@TNx�x�x�@&VVy�V�V�y�y/A@zJzOz|Y�Z�Z�zB�[�{�{'B�\�|�B�|�|}�_c}C�}~E~4C(bGbYC�bz>c����d#e`��ep�_3�C���D>��Z�g�g�3�3����kD�������R�������<k��c���#����W�S�ʃ̃܃6lkm�l+E����sd�,o]EaE�o�pkEP�\�g�i�������y�(�k����E���E`�c�gv׈ވ5F���4�xfy�F�F�����U��|�����w�/ˍ����Ԏ8�҅�����.��8�גؒ|���������I��w��IÖ�]#�E��nJvJ�
��J����)����3K)���™���K0��@����L�Lg�Π�L������VM�������;��
#'*-0369<?BEHKNQTWZ]`cfilorux{~������������������������������������������� #&),/258;>ADGJMPSVY\_behknqtwz}�������������������������������������������

!$'*-0369<?BEHKNQTWZ]`cfilorux{~������������������������������������������� #&),/258;>ADGJMPRTVXZ\^`behknqtvxz|~������������������������������������������������	!$'*-0369<?BEHKNQTWZ]`cfilorux{~������������������������������������������� #&),/258;>ACFILORUX[^adgjmpsvy|����������������������������������������������������������
 "$&(*,.02468:<>@BDFHJLNPRTVXZ\^`bdfilorux{~������������������������������������������� #&),/258;>ADGJMPSVY\_behknqtwz}�������������������������������������������

"%(+.147:=@CFILORUX[^adgjmpsvy|������������������������������������������												!	$	'	*	-	0	3	6	9	<	?	B	E	H	K	N	Q	T	W	Z	]	`	c	f	i	l	o	r	u	x	{	~	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	









 
#
&
)
,
/
2
5
8
;
>
A
D
G
J
M
P
S
V
Y
\
_
b
e
h
k
n
q
t
w
y
|
~
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
	!$'*-0369<?BEGJMORUX[^adgjloqtwz}�������������������������������������������������
#&),/279;=?ACEGIKMOQSUWY[]_acegikmoqsuwy{}�������������������������������������������������������



	








"
&
*
.
2
6
:
>
B
F
J
N
Q
S
V
Z
]
_
b
f
k
n
p
s
w
y
{
}

�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�


"%(+.147:=@CEGIKMOQSUWY\_behknqtwz~������������������������������� $(,048<@DHLPTX\`dhlptx|�����������������������������������������������������������	
!#%')+-/13579;=?ACEGIKMOQSUWY[]_acegikmoqsuwy{}����������������������������������������������������������������	
!#%')+-/13579;=?ACEGIKMOQSUWY[]_acegikmoqsuwy{}�����������������������������������������������������	!$'*-0369<?BEHKNQTWZ]`cfilorux{}����������������������������������������������������������������	
!#%')+-/13579;=?ACEGIKMOQSW[_cgkosw{��������������������������	
!%)-159=AEIMQUY]aeimquwy{}����������������������������������������������
 "$&(*,.02468:<>@BDFHJLNPRTVXZ\^`bdgjmpsvy|��������������������������������������������������
 "$',16:?CGMRVZ^chlpsw|����������������������������
"%)-159>BEIMQVZ^bhmpvy~����������������������������������"&),/25:=@CFILORV[^adgjmptx|������������������������������������	 #&).258;>ADGJMPTWZ^bejnqtwz~������������������������������������	
!#%')+-/13579;=?ACEGIKMOQSUWY[]_acegikmoqsuwy{}����������������������������������������������������������������	
!#%')+-/13579;=?ACEGIKMOQSUWY[]_acegikmoqsuwy{}����������������������������������������������������������������	
!#%')+-/13579;=?ACEGIKMOQSUWY[]_acegikmoqsuwy{}����������������������������������������������������������������	
!#%')+-/13579;=?ACEGIKMOQSUWY[]_acegikmoqsuwy{}���������������������������������������������������

"%(+.147:=@CFHJLNPRTVXZ\^`bdfhjlnprtvxz|~����������������������������������������������������������������
 "$&(*,.02468;>ADGJMPSVY\_behknprtvy|������������������������������������������   	        ! $ ' * - 0 3 6 9 < ? B E H K N Q T W Z ] ` c f i l o r u x { ~ � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � !!!!!!!!!! !#!&!)!,!/!2!5!8!;!>!A!D!G!J!M!P!S!V!Y!\!_!b!e!h!k!n!q!t!w!z!}!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!�!"""
"
"""""""""%"("+"."1"4"7":"="@"C"F"I"L"O"R"V"Z"^"a"d"g"j"m"p"s"v"y"|""�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"�"###	########!#$#'#*#-#0#3#6#9#=#A#E#I#M#Q#U#Y#]#a#e#i#m#q#u#y#}#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#�#$$	$
$$$$$!$%$)$-$1$5$9$=$A$E$I$M$Q$U$Y$]$a$e$i$m$q$u$y$}$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$%%	%
%%%%%#%(%-%2%7%<%@%S%\%a%c%e%g%i%k%m%o%q%s%u%w%y%{%}%%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%&&&	&&&&&&&&&&&!&#&%&'&)&+&-&/&1&3&5&7&9&;&=&?&A&C&E&G&I&K&M&O&Q&S&U&W&Y&[&]&_&a&c&e&g&i&k&m&o&q&s&u&w&y&{&}&&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&�&'''''''''''''!'#'%''')'+'-'/'1'3'5'7'9';'='?'A'C'E'G'I'K'M'O'Q'S'U'W'Y'[']'_'a'c'e'g'i'k'm'o'q's'u'w'y'{'}''�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'�'((((	((
((((((((((!(#(%('()(+(-(/(1(3(5(7(9(;(=(?(A(C(E(G(I(K(M(O(Q(S(U(W(Y([(](_(a(c(e(g(i(k(m(o(q(s(u(w(y({(}((�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�(�()))	)))))))) )")$)&)()*),).)0)2)4)6)8):)<)>)@)B)D)F)H)J)L)N)P)R)T)V)X)Z)\)^)`)b)d)f)h)j)l)n)p)r)t)v)x)z)|)~)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)�)*****
*********** *"*$*&*(***,*.*0*2*4*6*8*:*<*>*@*B*D*F*H*J*L*N*P*R*T*V*X*Z*\*^*`*b*d*f*h*j*l*n*p*r*t*v*x*z*|*~*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*�*+++++
+++++++++++ +"+$+&+(+*+,+.+0+2+4+6+8+:+<+>+@+B+D+F+H+J+L+N+P+R+T+V+X+Z+\+^+`+b+d+f+h+j+l+n+p+r+t+v+x+z+|+~+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+�+,,,,,
,,,,,,,,,,, ,",$,&,(,*,,,.,0,2,4,6,8,:,<,>,@,B,D,F,H,J,L,N,P,R,T,V,X,Z,\,^,`,b,d,f,h,j,l,n,p,r,t,v,x,z,|,~,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,�,-----
----------- -"-$-&-(-*-,-.-0-2-4-6-8-:-<->-@-B-D-F-H-J-L-N-P-R-T-V-X-Z-\-^-`-b-d-f-h-j-l-n-p-r-t-v-x-z-|-~-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-�-.....
........... .".$.&.(.*.,...0.2.4.6.8.:.<.>.@.B.D.F.H.J.L.N.P.R.T.V.X.Z.\.^.`.b.d.f.h.j.l.n.p.r.t.v.x.z.|.~.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�./////
/////////// /"/$/&/(/*/,/./0/2/4/6/8/:/</>/@/B/D/F/H/J/L/N/P/R/T/V/X/Z/\/^/`/b/d/f/h/j/l/n/p/r/t/v/x/z/|/~/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/�/00000
00000000000 0"0$0&0(0*0,0.00020406080:0<0>0@0B0D0F0H0J0L0N0P0R0T0V0X0Z0\0^0`0b0d0f0h0j0l0n0p0r0t0v0x0z0|0~0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�011111
11111111111 1"1$1&1(1*1,1.10121416181:1<1>1@1B1D1F1H1J1L1N1P1R1T1V1X1Z1\1^1`1b1d1f1h1j1l1n1p1r1t1v1x1z1|1~1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1222	22222222!2%2)2-2125292=2A2E2I2M2Q2U2Y2]2a2e2i2m2q2u2y2}2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�2�233333
33333333333 3"3$3&3(3*3,3.30323436383:3<3>3@3B3D3F3H3J3N3R3V3Z3^3b3f3j3n3p3r3t3v3x3z3|3~3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�344444
44444444444 4"4$4&4(4*4,4.40424446484:4<4>4@4B4D4F4H4J4L4N4P4R4T4V4X4Z4\4^4`4b4d4f4h4j4l4n4p4r4t4v4x4z4|4~4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�4�455555
55555555555 5"5$5&5(5*5,5.50525456585:5<5>5@5B5D5F5H5J5L5N5P5R5T5V5X5Z5\5^5`5b5d5f5h5j5l5n5p5r5t5v5x5z5|5~5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�566666
66666666666 6"6$6&6(6*6,6.60626466686:6<6>6@6B6D6F6H6J6L6N6P6R6T6V6X6Z6\6^6`6b6d6f6h6j6l6n6p6r6t6v6x6z6|6~6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�6�677777
77777777777 7"7$7&7(7*7,7.70727476787:7<7>7@7B7D7F7H7J7L7N7P7R7T7V7X7Z7\7^7`7b7d7f7h7j7l7n7p7r7t7v7x7z7|7~7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7�7	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcde







	

����		��	�


�������P����P��P�PP���P������
����


 
!"�P�P#�	$
P	�P
	P
T[P		P�gkvz�������P
	�������
��
�
������
		�
����������	���



�
���	��
�������
P�
�	��		����������
����
�
���������
�
�
�	���������������						����	��	

	
	
 !""#"$%%%&&&&&&'&&&&&&&&&'&&&&&&('&&&&&')**++++)+***+**++)+**+++()**+*+)+&*&+&+&+&+&+&+&+,)&*&+&+&+&*&+&+&+&+&+')&+&*&+&+&)-.&+&+)&+&+&+-.')&*&+&*.')&*&+&+')&+&+&+&+&+&+&+&+&+')&+&*&+&+&+&+&+&+&&+&+&+#/,,/,/,,/,,,//,,,,/,,/,,,///,,/,&+,/,/,,/,//,/,&+,,,/,/,,//0,///000012#12#12#&*&*&*&*&*&*&*&*/&+&+&+,/&+&+&+&+&++12#&+,,&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+,/&+,/,/,/&+&+&+&+&+&+&+//////,,/,,//,/,,,,/,/,/,/,//)///////////////)//////////////////////////////////////////////////0///////////////////////////3333333334455555556676484888484495666666:6733333666666646566666666666666666;;;;;<;;;;;;;<<;<;<;;=>>>>=?>>>>>@@AAAABB>>>>AA>AA>>CCCCD>>>><<<EE;EEF<>>><<<>>G<<<>>>><=>><HIIHIIH<<<<<<<<<<<<<,/,/J6,/3///K,:L&K&&&&&&+''''''''''''''''''''''''&&+++++)))))))))))))))))/)))))))+++++,##1MM##/,/,/,/,/,/,/,/,/,/,/,/,/###/1#N,/1,//,,,&O,&,,,&,,,,&&&,'''''''''O'''''''''''''''''''''')))))))))*))))))))))))))))))))))+*/+///+////+++/,/,/,/,/,/,/,/,/,/,/,/&+,/,/,/,/,/PQQQQQRR,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,&+,/,/,/,/,/,//&+&+,/&+,/&+&+&+,/&+&+&+,/&+&+&+&+&+&+,/&+,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,5SSSSSS///////////////////////////////////////#/STUVQQQQVQQQWVQQQQQQVVVVVVQQVQQWXQYZ[\]^_`abbcdefghijhQVhakkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkhhllllllNNmnnopqQQQQQQQQrstquqqvvwwwwwvvvvvvvvvvvvvvvvvvvvvvvvvxvvvvvvvvvvyz{rst|}~~VQQQQQVQQV����������n��qvv�vvvv����vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvwvwvvvvvvvvvvvvvvvvwqvQQQQQQQlQQQQVQxxQQVQQVvv����������vvv��vqqqqqqqqqqqqqquv�vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvQVQQVQQVVVQVVQVQQQVQVQVQVQQvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv�����������v����������kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkQQQQQQQVQ������V��kkkkkkkkkkkkkkkkkkkkkkQQQQ�QQQQQQQQQ�QQQ�QQQQQhhhhhhhhhhhhhhhkkkkkkkkkkkkkkkkkkkkkkkkkVVVhvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvVQQQQQQQQQQQQQQlVQQVQQVQQQVVVyz{QQQVQQVVQQQQQ����0000000000000000000000000000000000000�0000000�00�00000���0������������������0QVQQ�����������00��SS����������S5000000000000000���00000000000000000000000000000000000000000000�0������������0����00������������00UU������PU0SQ���00000000000000000000000000000000000000�0�00���������������0�������������000�S���000000000000000000000000000000000000000000000000�0��������������000������������SU0���������0000000000000000000000000000000000000000000000�0����������������000������������P0�������000000000000�00000000000000000000000������������0��������������U�����000000000000000000000000000000000000000000000000000����������������00000������������S�������P0���S0000000000000000000000000000000000000000000000000�0����������������000������������00����0000000000000000000000000000000000000000000000000000��0��������������0P000��������000���������������������P000000��00000000000000000000000000000000000000000000000000000000000����������������������������S000000000000000000000000000000000000000000000000�0��������U0000005��������S����������SS0000000000000000000000000000000000000000000�0����������0000005������������������000PPPSSSSSSSS�SSSSSSPSPPPVVPPPPPP��������������������PVPVP�������000�00000000�0000�0000�0000�000000000000�000�����������������QQ�SQQ00000�����������������������������������������������PPPPPPPPVPPPPPPPPSSSSSPPPPSS00000000000000000000000000000000000000�0000��������������������0����������SSSSSS000000����0000���0���00�������000����0000000000000�����������V0���������������PP,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,///////////////////////////////////////////S3///������������������������������������������������������������������������������������������������0���������������������00000000000000000000000000000000000000000000000000���������������������������000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000QQQSSSSSSSSS��������������������0000000000000000,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,//////T0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000PS00000000000000000�00000000000000000000000000��000000000000000000000000000000000000000000000000000000000000000000000000000SSS���0000000000000000000000000���000000000000000000���SS000000000000000000��0000000000000000��0000000000000000000000000000000000000000000000000000��������������������������������SSS5SSSU0Q��������������������������T������������������0000000000000000000000000000000000050000000000000000000000000000000000000000000000000000000000��0000000000000000000000000000000000X000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000���������������������WQV������������000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000�����������00000000000000000000000QV���SS00000000000000000000000000000000000000000000000000000�������������������������������QQQQQQQQV��������������������SSSSSSS5SSSSSSQQQQQVVVVVVQQVR�����0�0�0�0�0�000�000000000000000000000000000000000�����������������0000000����������SSSSSSSPPPPPPPPPPQVQQQQQQQPPPPPPPPP���000000000000000000000000000000�������������00����������00000000000000000000000000000000000000000000��������������SSSS000000000000000000000000000000000000��������������������SSSSS����������000����������000000000000000000000000000000555555SS/////////,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,SSSSSSSSQQQS�VVVVVQQVVVVQ��������0000V000000Q00�QQ0////////////////////////////////////////////333533333333333533333333333333333353333333333333333333333333333/////////////3//////////////////////////////////3333333333333333333333333333333333333QQVQQQQQQQVQQ��V�QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ�XXVQ�VQV&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+++++#�//,/&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+&+,/,/,/++++++++&&&&&&&&++++++&&&&&&++++++++&&&&&&&&++++++++&&&&&&&&++++++&&&&&&++++++++&&&&++++++++&&&&&&&&+�+�+�+�+�+�+�++++++++��������++++++++��������++++++++��������+++++++&&&��:�::L+++++&�&��LLL+++�++&&&�LLL+++�++++&&&�&L��+++++&�&���:������������������T������������������������n������$����������������������N�����������������������������3"������������""""����������3333333333333UUUUUUUU��UUUUUUUUUUUUUUUUUUUUUQQ��QQQQ���QQRRRRQRRR��QVQ��VVVVQ��1���1�#111##111.1�N11111���1�1��11�#11,1#����#�##11�NNNN1####N/P���%%������%%%%������������������������������������,/����%(((((��NNN����((NNNNNNNNNNNN(����NN(������N(N���N��NNN����(����(�(�((((���������((((N�N������������������NNNNN����NNNNNNNNN��(�N��������N��������������������������������NN����NN(NN�(NNNNNNNN��N(�������������������NNNNN��NNNNNNNNN�����NN��NNNN������������������������NN��������������������������PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPNPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN������%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%""""""""""""""""""""����������������������������������������������������������������������������������������������������((NNNNN��N��������������(�����P������������������������������������������������������������������������NN����N��N���NNNNN����NNNNN���NNN����	
	
	
	
��NNNNNNNNNNNNNNNNPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN��	
������������������NN������N��������������NNNNNNNN�NNNNNNN������NNN�NNNN�����N��NN�����NNNN�N���NN��NNNNNNNNNN������NN��NNNNNNNNNNNN�������������������N����NN�N�NN�N����NNNNN��NNNNNN���NNNNNNNNNNNNNNNNNNNNNNNN��NNNNNNNNNNN��NNNN����N��NN����NN�������������������������������������������NN��������N����������������������������������������NNNNN�N�NNN�����NNNNN���NNNN�NNN�����N�NN��NNNNNNNNNNNNNNNNNNNNNNNNNNN���,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,///////////////////////////////////////////////,/,,,//,/,/,/,,,,/,//,//////33,,,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,//,/,/QQQ,/�������////////////////////////////////////////000000000000000000000000000000000000000000000000000000003S�0000000000000000000000000000000000000000000000000000000000000000000000000000000QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ��$$���$�$���������T��T�$��$�������������4����������TT����T��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������	�	�	�	�	�	�	�	�	�	�	�	��	�	�	������		�		�		�		�		����������������������	��

�
�����������	�	�	�	�	�	�	�	�	�	�	�	��	�	�	������		�		�		�		�		����������������������	��				���
�������������������������������������������





























































































����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000000000000000000000000000000000000555555SS0000000000005���0000000000000000����������00,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/0QRRR�QQQQQQQQQQ�4,/,/,/,/,/,/,/,/,/,/,/,/,/,/33QQ0000000000000000000000000000000000000000000000000000000000000000000000����������QQSSSSSS6666666666666666666666644444444466,/,/,/,/,/,/,///,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/,/3////////,/,/,,/,/,/,/,/4,/,/0,/,///,/,/,/,/,/,/,/,/,/,/,,,,,/,,,,,/,/,/,/,/,/,/,,,033/0000000�000�0000�00000000000000000000000�����������PPU�0000000000000000000000000000000000000000000000000000������00000000000000000000000000000000000000000000000000������������������SS����������QQQQQQQQQQQQQQQQQQ000000SSS0S00�����������0000000000000000000000000000�����VVVSS00000000000000000000000�������������S���������������������������������00000000000000000000000000000000000000000000000��������������SSSSSSSSSSSSS5����������SS00000�5000000000����������0000000000000000000000000000000000000000000000��������������000�00000000������������SSSS00000000000000005000000PPP0���00000000000000000000000000000000000000000000000000Q0QQV00QQ00000QQ0Q0005SS00000000000�����SS055��00000000000000000000000000000000///////////////////////////////////////////3333////////////////////////////////////////////////////////////////////////////////////////00000000000000000000000000000000000��������S������������																																																																																																																																																																				000000000000000000000000000000000000000000000000000000000000000000000000������������############���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������GGGGGGGGGGGGGGGGQQQQQQQVVVVVVVQQ  !!��!!!""" #$#$#$%&'(()*%���v�����������������������������������������������������������������������������������������������������������������������������������������++,-,++./+0121133333333331+454++66666666666666666666666666.+/78799999999999999999999999999.5/5./:;<::==========>=============================================>>====================================================--57?--@AAAA@@BBB0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000S�S���������������������������������������������PPPPPPPPPCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC������PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPV000000000000000000000000000000000000000000000000000000000000000000000000000000VDDDDDDDDDDDDDDDDDDDDDDDDDDD00000000000000000000000000000000����00000000000000000000�00000000�00000000000000000000000000000000000000QQQQQ000000000000000000000000000000S00000000000000000000000000000000000000000000S�����,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,////////////////////////////////////////000000000000000000000000000000000000000000000000000000000000000000000000000000����������,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,////////////////////////////////////00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000S0000000000000000000000000000000000000000000000000000000000000000000000000000000000000kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkhEEEEEEEEkkkkkkkkkkkkkkkkkkkkkkkFFEEEEEEEkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkEEEEEEEEEkkkkkkkkkkkkkkkkkkkkkEEEEEkkkkkkkkkkkkkkkkkkkkkkEEEEEE�kkkkkkkkkkkkkkkkkkkkkkkkkkhkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkEEkkEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEk������V�QkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkQ�V�EEEEEEEEEhhhhhhhhhkkkkkkkkkkkkkkkkkkkkkkkkkkkkkEEhkkkkkkkkkkkkkkkkkkkkkkkkkkkkkEEEkkkkkkkkFkkkkkkkkkkkkkkkkkkkkkkkkkkkkQVEEEEEhhhhhhhkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk�������kkkkkkkkkkkkkkkkkkkkkkEEEEEEEEkkkkkkkkkkkkkkkkkkkEEEEEEEEkkkkkkkkkkkkkkkkkkhhhhEEEEEEEkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHEEEEEEvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvQQQQ����������IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIkkkkkkkkkkkkkkkkkkkkkkkkkkkkkEEEEEEEEEEkvvvvvvvvvvvvvvvvvvvvvvVVQQQVQVVVVJJJJqqqqqkkkkkkkkkkkkkkkkkkkkkkk���00000000000000000000000000000000000000000000000000000���������������SSSSSSS����������������������������������00000000000000000000000�0�00000000000000�0000�����������SS�SSSS�0000000000000000000000000����������QQQ000000000000000000000000000000000000������������������������SSSS0��00000000000000000000000000000000000�SS0���000000000000000000000000000000000000000000000000��������������0000SSSS����S����������0S0SSS��������������������0000000000000000000000000000000000000000000������������SSSSSS�0000000000000000000000000000000000000S00000000000000000000000000000000000000000000000��������������������������0000000000000000000000000000000000000000000000��0������������0�00000��QQQQQQQQQQQQ00000000000000000000000000000000000000000000000000000������������������0000SSSSS����������SSQ0000000000000000000000000000000000000000000000000��������������������00S0����������00000000000000000000000000000000000000000000000����������������SSSSSSSSSSSSSSSSSSSSSSS0000��000000000000000000000000000000000000000000000000�����������������SSS0�����������������������0000000000000000000000000000000000000000000�������������0����������000000000000000000000000000���������������������������SSSP00000000000000000000000000000000000000000000���������������S,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,////////////////////////////////�������������������000000000000000000000000000000000000000000000000��������������0S0�0����������0000000000000000000000000000000000000000�������0����SSSSSSSS�0�����������0000000000000000000000000000000000000000000000����������������SSS0SSSSS0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000���������������K0SSSSS�����������������������������SS000000000000000000000000000000������������������������������������00000000000000000000000000000000000000000000000����������������0�����������0000000000000000000000000000000000000000������������0����������0000000000000000000����SS���������������������UUUUS00000000000000000000000000���������������������������������������������������������������������������������������������������������������SSSSS0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000���������000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000����������SS000000000000000000000000000000�����S000000000000000000000000000000000000000000000000QQQQQQQSSSSSPPPP5555SP�����������������0000000000000000000000000000000000000000,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,////////////////////////////////�����������������������SSSS000000000000000000000000000000000000000000000000000000000000000000000000000�0�����������������������������������������������������������5555555555555���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000P��S����PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPLLLLLLLMM���PPPNMMMMM��������VVVVVVVVPPQQQQQVVPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPQQQQPPPPPPPPPPPPPLLLLLLPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPQQQ���������������������������������������������11111111111111111111111111##########################11111111111111111111111111#########################11111111111111111111111111##########################111111111111111111#######################11111111111111111111111111##########################111111111111111111111##########################1111111111111111111##########################11111111111111111111111111##########################11111111111111111111111111##########################11111111111111111111111111##########################11111111111111111111111111##########################11111111111111111111111111##########################11111111111111111111111111############################1111111111111111111111111O#########################�######1111111111111111111111111O#########################�######1111111111111111111111111O#########################�######1111111111111111111111111O#########################�######1111111111111111111111111O#########################�######1#PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP�������������������������������������������������������PPPP��������������������������������������������������PPPPPPPP�PPPPPPPPPPPPPP�PPSSSSS��������������������QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ000000000000000000000000000000000000000000000QQQQQQQ5555555����������0P00000000000000000000000000000000000000000000QQQQ����������UkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkEEEEEEEEEVVVVVVVGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHQQQQQQ������������hhJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ�JJJoJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ�JJJJJJJJJJJJJJJ���������������������������������������������������������������������������������������������������������������������������������������������NN��"""""""""""��������������������������������Q��������������������������������RRRRRRRRRRRRRRRRRRRRRRRRRR���RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR�RRRRRRRRRRRRRRRRRRPPPPPPPPPPPPPPPPPPPPPPPPPP�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������SSSSS���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG	

 !"#$%&'()))*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNNOPQRSTUVWXYZ[\]^_`abcdeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeefeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeegheeeeeeeei))jklmnopqrstuvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvwxxxxxxxxxxxxxxxxyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyzz{|}~������������������))��������������������������������������������������)))))))��)����������������������))))))))��������������������������������))))��������������������������������������������������������������������))))������������eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee�eeeee���������������������������������������������������������������������������ee�ee�����������������������������������������������������������N���������������NNNN����������������������������������������������������������������������������eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee�eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee�e�eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee�eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee�������������������������zzzz��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy���������
��������������������������������������������������������?�����@�����@�����@�������������������������������������������	���������
�������������������������������������	�������������������������	����������������������7y�AC�����@��x�D��������																															












																																					
																																																																																																																	
																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																						  												!!																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																											"#$																%&'()*+%&'()*+																																	,									-								....//01																																																	22222222222222222222222222222222222222222	//			////////////																																																																																																																																																														$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$3																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																							445																																																																																																																																								67																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																	01																									5																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																				8																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																								99999																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																		

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcde33fg3hijklmnopqrstuvwxyz{|}~�������33���������������������������������������3333333��3�33333333�3333�3333����Y���33333333333333333333333333333333333333333333333g33333�33�33������������33333����3������������3333333�����������bW�������33333333333333333333333333333333�3�33333333333333333333333333333333333333333333�333333333333333333333333333333333333333333333333333333333��3��HANGUL SYLLABLE ;,$P��H���p�������Ʈ�<-��d���L��B���������@E���������������~��
��L��K�������� ��p�����P���0�����T�� �������� �������`��`0���zRx�$��0FJw�?:*3$"D�� \���Bp�������P�ܬ�<�����B�B�B �A(�A0��
(A BBBA zRx�0�����(���g$h��+D8���B�O�E �E(�E0�C8�DPX8A0A(B BBBL�<��6F�B�B �E(�A0�A8�J�
8A0A(B BBBAL�,��F�B�B �B(�A0�A8�G�E
8A0A(B BBBA4 c��ME�A�E 5
AAEACAHXx��>F�B�B �B(�A0�A8�J�8A0A(B BBB4�j��EE�A�E *
DAEACA4�w��9E�A�E 
DAEACALx��J�E�E �D(�A0�T
(A BBBED(A BBBLd���yJ�E�E �D(�A0�H
(A BBBED(A BBB4�ֳ�AJ�D�D �
ABEDAB8�ߴ�F�E�B �A(�A0��(A BBB((���E�A�D0
AAOzRx�0�� ]���
CAA(�L��E�A�D0
AATl�����
CAAd���R�E�B �B(�A0�A8�GP�
8A0A(B BBBAZ������CP������ zRx�P������(��0|���B�O�A �J��
 AABAH����KF�B�B �L(�D0�A8�Lp=
8A0A(B BBBB zRx�p������(����(4����E�N�D@�
AAAzRx�@�� P��K(����A�I�J�qAA4���J�D�D ��
DBEACBL�����F�B�B �B(�D0�D8�G��	
8A0A(B BBBA$zRx��������@,N��)�
8I0A(B BBBE�
8G0A(B BBBE�L���E�P �DGNU�Phh�0�RpVm�m�m�m�m�mnnnn"n+n6n>nHnQnYno'omo0oo�n	oowooooIo�n�n1oo4ooo$o owo#oJo�nao&o)o,o/o3om6o9oCo<o?oBo^oEo�mHoLoOoQoTo�nWo4oMoZo$oUo]o`ocoao�n,ofoCo�mOo�nMoUoUfv�#
�kЈ0؈0���o`��
`�00� hX	���o���o(���o�o����o�`�0 $0$@$P$`$p$�$�$�$�$�$�$�$�$%% %0%@%P%`%p%�%�%�%�%�%�%�%�%&& &0&
#-08BES<	!�	"�	#>$V%�'�(V)�*�+>
-W
.�
/�
0�
1.253�04�6'7>8W9�:�;�<�=<ARar,�5�6�7�;�<�=�@�A�B�C�G�H�I�L�MNPLRZT`VhX\�]�_�a�b&d.h�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|���������#�'�+�-�0�3�5�:�>�C�G�K�M�V�t�����'�H�J�������(	�0	�3	��	�G�����F�������F
��
��
�%���	��
��:�<�>�B�6�Z�b��������� �8�@�H�P�Y�`�t|������!�!�!�!�!�!"""#"%" <"!C""E"#H"$M"%a"&d"'r")v"+z"-�"1�"3�"5�"7�"8�":�";F0?K0@M0AO0BQ0CS0DU0EW0FY0G[0H]0I_0Ja0Kd0Lf0Mh0No0Or0Pu0Qx0R{0S�0T�0U�0V�0W�0X�0Y�0Z�0[�0\�0]�0^�0_�0`�0a�0b�0c�0d�0e�0f�0g�0h�0i�0j�0n�o�p�q1rGt�u�v}m�l1��x�l~2��wTl�/��v�l�Nv�l�P@uJlG.�tAl-�slw)@s.l�*�rgm�;��q,m j�p�l�3� plm�X��o�m�y��������@�0�m�m�m�mbnenhnknnnqntnwnzn}n�n�n�n�n�n�n�nbn�n�n�n�n�n�n�n�n�n�n�n�n�nm�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n$oao�n�n�n�n�n�n�nUooo'o�nio(@�0�0GA$3a1�#�kunicodedata.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug h�7zXZ�ִF!t/��G�]?�E�h=��ڊ�2N��v��N�½�{����"����	GŲ�d��!>V��I���}K��|WO����]kK
��샭�ȶR�'�!k֐����q�&�㸴�G�R�򁴸Mp��**�.��~R9���O�Ee�`�;t��]��k�cc9�P5�a2������V�u�������YN���5QA:Q�X�#r�6pO)F{q�6��FԈa�u�9r��2� \�WIh�F5�a�}�o�R�z��rZ�?4���.C��
k�%�6%W#�L�=J���w_�)hῗ� ���u�� z1���аI��g��ZQ���b��9���<j�VN˲�q)���D�����q��?um?Q�����e
�.7��j$��XZ��/�2��!��-���Ip��w�Z���{�oWq��5]`w�\�D)��~LV�5�}��&|�E�Nt��k�t�3m�ͬ
A�q�D�$Z'e�	Ti�ɼo��^�?
�cV�-T	d���]�C� /��l���'47LC���@\�]tu��
/�N�4�3��"^�*������|BA�2��q���>���㥃r�W���r�.�U���5��G&M.�UX�w۞j�'�Q�~Ox�k���YO���7=Ɩ�QyT�sht7M��'���Y��
1Ƶ�r��c�>��:�3�ۡ����-LwgQ��)�s����������O��I��-�[��1ڋ��81�S��"���V�K>ښ�e�X�\���
�8��$D'��~�y���0p�Nz��b�\�DY*np,bD�O��I�Ύ�Z��`3=Ö�"i�*@'�|!G�ޛ�4Q��~+�����4���6)v�ӑ�{\K�y*}��
��#Ø5k���L?�FB
���S����h�ߑY0Q*�Èq|+1�b�F�w��Qb,�C���:��$e[�7��ʇ�G��&�����ǔH�ȏF$32�ȁh�Sr�
Ƅ`p�����ѝ�S�iW*w���kYG���&�ٵO]�qZH��+ä�9Y��>��,�ښB[B�F:�����viN����Lz)�+�H@(�q�M�����#��WIK7�C@L�>�>�L���
�u����!� �9R��z�#s���w>I��6�=2sM�����}#N�!�H�ge���I�ܲ>͑�_�˵��y�Y�����y��ܜJ�+�Q.1�Qݗ��T�{)C��.xB�x��"�
���֟��
�(�:_��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``D(��0��8���o��lE���o((@ThhX^B� � 0h�#�#c$$0n@&@& w`(`(�C}�k�k
�ll�
 ��y�y,��z�z������ �Ј0Ј�؈0؈��0�� �`�0`��`�0`����0�� ���0���Ȟp��$
�dH�(p�(lib-dynload/_contextvars.cpython-38-x86_64-linux-gnu.so000075500000016370151153537510016637 0ustar00ELF>`@�@8	@�� p
p
 p
 8@ �
�
 �
 888$$���  S�td���  P�td�
�
�
44Q�tdR�tdp
p
 p
 ��GNU�n|��#�nQ�����[J$��P ��|CE���qX!�}�� � �, F"��"� � � ��	�__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6PyContext_CopyCurrentPyInit__contextvarsPyModule_Create2PyContext_TypePyModule_AddObjectPyContextVar_TypePyContextToken_Type_Py_Dealloc_edata__bss_start_endGLIBC_2.2.5vui	'p
 �	x
 P	�
 �
  i
 ` �
h v
p �
�  � � � � � � � � � � � 	� 
��H��H�1 H��t��H����5� �%� ��h�������h��������h�������h�������h��������%� D���%} D���%u D���%m D���%e D�����H�muH������H�+tO1��H�muH�����H�+u�H��1�����H�muH�����H�+u�H��1��x����iH��1��i����Z@H�=� H�� H9�tH�� H��t	�����H�=� H�5� H)�H��H��H��?H�H�tH�� H��t��fD�����=M u+UH�=� H��tH�= ����d����% ]������w������U��H�=� SQ���H�������H�- H�5�H��H��H�EH���.���������H�- H�5`H��H�EH�������������H�-� H�5EH��H�EH��������O���H��Z[]���H��H���ContextContextVarTokencopy_context_contextvarscopy_context($module, /)
--

Context Variables;0��LL���t��������������zRx�$����`FJw�?:*3$"D���P\���	$p4����E�M�A �AAzRx� �� ����sGNU��	P	�
 Ufv�
@
p
 x
 ���o`�
3� x��	���o���op���o�oL���o	�
 ����i
`�
v
�
�������� GA$3a1�M
_contextvars.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debugt;>�7zXZ�ִF!t/��]?�E�h=��ڊ�2N����T�f2�]�ܹE�2��B^k�S8Kڇ��
\�tL�O=���
�T��9LlĴ���^��J��<-��g�kSE?q�0�v�R��JL�9��!mټ,\�mt���ܠ��׺�7DX����=���%c��N"���O1�k������TY����H(D����̺�25%{�X!���`�&E��ع�?\�,
^�͟����a��Sg;˓n3 ���]]
��9Xd��4�֫���O+/���J�k���*� ��{�a(0���8b��.���>���ӟm�(JOo��1�p���&� �jGwcZ��u�
�G�*���x	���z�u��c/�>��]B�<���է�0Hju�S�^�����"G���%��~ۣ+S �n��K͑r�8��+�>M�q������B�`���`�TN�B��h����Q,p2(�-r�-��x����f�*z3I��-^�^��q��zu�*�5��A�CXE�[��� F5o�jh��jА��v`'^�����dO�K:�V�A��}����b��9��3��F\P^RQd���l�tܴf
�g��8d`= G�	{�L��`���,_���:�~�Y���2�6�c1E�:���Q�+�q��T��+ϩc�V=)\���𦅐G+��~��?ո!�P7�U�'G4}���Vjr��}�+~�I���X���A-�� dT����ύ�ؚXR��䶩#@��#�Pԓ�!�b�EB��0�5ڸ����w���g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(���038���oLL E���opp T���^Bxh��c��`nPw``�}@
@

�P
P
r��
�
4��
�
���� �p
 p
�x
 x
��
 �
��
 �
�� �x� � �� ���`�$
�d0`�(lib-dynload/ossaudiodev.cpython-38-x86_64-linux-gnu.so000075500000103520151153537510016437 0ustar00ELF>�"@�@8	@�Z�Z �j�j �j �� hlhl hl 888$$�Z�Z�Z  S�td�Z�Z�Z  P�td�S�S�SddQ�tdR�td�j�j �j ppGNU�]o��ǰЙ����E8�W �0�@ 02��|CE��F�4��qX��A�� [����� ��, F"#����>����nR���b���-�.bpO:py '`y ��7O.`y __gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6close_Py_NoneStruct_PyArg_ParseTuple_SizeTgetenv_Py_open_PyObject_New__stack_chk_failstrcmpPyErr_SetStringfcntl64ioctlPyExc_OSErrorPyErr_SetFromErrnoWithFilenamePyErr_SetFromErrnoPyExc_ValueErrorPyLong_FromLong__strncat_chk_Py_BuildValue_SizeT_PyObject_CallMethodId_SizeT_Py_DeallocPyObject_FreePyUnicode_FromStringPy_FatalErrorPyBool_FromLongPyErr_FormatPyEval_SaveThreadPyEval_RestoreThread_Py_writePyBuffer_Release__errno_location__fdelt_chkselectPyErr_ClearPyBytes_FromStringAndSize_Py_read_PyBytes_ResizePyInit_ossaudiodevPyType_ReadyPyModule_Create2PyErr_NewExceptionPyModule_AddObjectPyList_NewPyModule_AddIntConstantPyType_Type_edata__bss_start_endGLIBC_2.15GLIBC_2.3.4GLIBC_2.4GLIBC_2.28GLIBC_2.2.5v`���?ti	Jii
V���`ui	kfui	k�j �7�j `7�j �j �j �P�j �P�j �P�j �P�j �P�j �P�j �P�j �Pk �Pk �Pk �Pk �P k �P(k �P0k �P8k �P@k QHk 
QPk QXk Q`k Qhk Qpk $Qxk *Q�k 0Q�k 8Q�k >Q�k DQ�k JQ�k PQ�k VQ�k \Q�k bQ�k hQ�k nQ�k tQ�k zQl �Ql �Ql �Ql �Q l �Q(l �Q0l �Q8l �Q@l �QHl �QPl �QXl �Q`l �Qp �Gp �5 p �G(p +0@p �GHp #4`p 1Php ~.�p 7P�p �%�p >P�p %�p �G�p M)�p GP�p �%q |Gq ) q vG(q �(@q �GHq �/`q �Ghq �/�q �G�q �/�q �G�q �,�q OP�q M3�q WP�q s2r aPr �1 r jP(r u+@r qPHr �/`r wPhr �"�r �P�r ,�r 1P�r �"�r 7P�r o%s wPs �" s �P(s ,@s SGHs �'`s \Ghs z'�s PG�s C'�s �G�s �*�s �G�s �)�s EG�s 't kGt �(@t �P�t �P�t �,�t �P�t �, u +G(u e#@u �PHu �"�u �P�u  u �u 1P8v �QPv g,w p w @t w �t �w �Q�w I,�x �r �o �o �o �o �o �o �o (v �w �n �n �n �n �n �n 	�n 
�n �n �n 
�n �n �n �n �n �n o o o o  o (o 0o 8o @o  Ho !Po "Xo #`o $ho %po &xo '�o (�o )�o *�o +�o ,�o -�o .�o /��H��H�yR H��t��H����5�P �%�P ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&�������h'��q�������%uN D���%mN D���%eN D���%]N D���%UN D���%MN D���%EN D���%=N D���%5N D���%-N D���%%N D���%N D���%N D���%
N D���%N D���%�M D���%�M D���%�M D���%�M D���%�M D���%�M D���%�M D���%�M D���%�M D���%�M D���%�M D���%�M D���%�M D���%�M D���%�M D���%�M D���%}M D���%uM D���%mM D���%eM D���%]M D���%UM D���%MM D���%EM D���%=M D��H��H����SH�����x�q����C����H�CM H�[���UH��H�5O$SH��dH�%(H�D$1�H��H�$�z�����u1��XH�<$uH�=$�?���H��uH�$H�$H�<$�����Ń��t�H�=�T �^���H��H��u	��������hH�L$dH3%(H��t����H��[]���ATH��H�5�#USH�� dH�%(H�D$1�H�L$H�T$H�D$H�D$������H�|$uH�D$H�D$H�D$H�\$H�5�,H�����A�ą�tLH�5@#H�������t3H�5,#H��A��n�����t H�=KU H�5�-1�������A�H�|$uH�=�"���H��uH��"H�D$D��H�|$���R����Ń��tF1҉Ǿ1������t1�H�T$�P��������u���i���H�=K H�t$H�?���1��;H�=ZQ ����H��H��u	���6����H�T$�L$�hW�D�`H�P�H0@ H�L$dH3%(H��t�N���H�� []A\���V���x"1�1��P�����u*H��J H�:Y���H�xJ H�5�,H�8���1��
H��J H�Z���Hc��x� ���PH�@J H�5�,H�8�i���1�Z���Hc��x��PH�J H�5},H�8�=���1�Z���H���dH�%(H�D$1���x$H�T$�P��+�����u+H��I H�:�8����$H��I H�5 ,H�8���1��
Hc|$�r���H�L$dH3%(t����H���AUW�I��H��AT�I�̹ U��SH��HdH�%(H�D$81�H�|$)D$ H�\$H�D$:H�D$�D$���H��L��H��1������1���t,H��L����S�����uH��H H�8�`����
Hc|$���H�L$8dH3%(t�_���H��H[]A\A]������x��M�H�" � ���PH��H H�5+H�8���1�Z������x��M�H�����PH�aH H�5�*H�8���1�Z������x��M�H�����PH�*H H�5�*H�8�S���1�Z������x��M�H���{���PH��G H�5\*H�8����1�Z�AUI��H�ֺATI�̹U��SH��HdH�%(H�D$81�H�|$ H�\$H�D$i:H�D$�H�|$�!����H��L��H��1�������1���t,H��L��������uH�5LG H�>�����
Hc|$����H�\$8dH3%(t����H��H[]A\A]������x��M�H���$���PH��F H�5e)H�8�%���1�Z������x�P�H�����PH��F H�5.)H�8���1�Z������x�P�H�O���PH��F H�5�(H�8���1�Z������x�P�H�!����PH�WF H�5�(H�8���1�Z���SH��H�� dH�%(H�D$1��x+H��H�T$H�L$L�D$H�5������1���u"�H��E H�5Y(H�8����1���t$��vH�=jO H�5S(���1��x�L$��x�|$��d��dvH�==O H�5N(����1��K����M�H�T$1�	ω|$�{������uH�5\E H�>������\$H�=1���������H�L$dH3%(t����H�� [���SH��H��dH�%(H�D$1��xH��H�T$H�5������1���u�yH��D H�5I'H�8�	���1��_�t$��vH�=]N H�5F'���1��?�{��M�1�H������uH�5�D H�>�����$H�=I1���������H�L$dH3%(t��H��[���H��(dH�%(H�D$1��G��x4�H�T$���1�����Hc��o��u-H�
D H�9�|���1��4H��C H�5b&H�:�"���1���L$�T$H�=�1��t$�d���H�L$dH3%(t�O���H��(���Q1�1�H�5�I ���H��tH�uH�����H��C H�Z���SH������t��H��[�i�����SH������t��H��[�K������G��t!��t��u$H�=0$���H�=����H�=x���PH�=�%�E�������@��@������SH��H��0dH�%(H�D$(1���D$x0H��H�T$$H�L$ L�L$L�D$H�5}�3��1���u"�)H��B H�5�$H�8��1���L$$�{1�H�T$�P��L$������|$t&�L$�T$$9�tH�=�K H�5,%1��
���t$ �{1�H�T$�t$�P��\��tJ�|$t#�L$�T$ 9�tH�=�K H�5%1����q�|$1�H�T$�P��|$�{���uL��A I�8���@�|$�L$t�T$9�tH�=+K H�5�$1��e���T$�t$H�=]1���H�\$(dH3%(t���H��0[����x3USH��P�}�{H���r�H���J�H�CA �C����H�Z[]�H�.A H��ATW�I�̹ UH��H�ֺS��H��0dH�%(H�D$(1�H��)D$H�$:H�D$�<�H��H��1��?��1���t?���1҉�L��H��1����H������uH�l@ H�8����
H��@ H�H�L$(dH3%(t���H��0[]A\������x�PH�"�$���PH�@ H�5�"H�8�G�1�Z������x�PH�����PH��? H�5P"H�8��1�Z������x�PH�����PH��? H�5"H�8���1�Z���ATUSH��H��`dH�%(H�D$X1��xI��H��H�5rL������u�H�V? H�5�!H�8��1��.�{H�T$H�4$�j�L��H����H���t�Hk(H�����H�L$XdH3%(t��H��`[]A\�ATI��P�UH��SH��H���?dH�%(H�D$1�H�T$�D$����xj�D$��tC�������~_��~*��t%�S��@t�� t �=�t=t������0�E��E�;L��P�1���1҅�y	������H�L$dH3%(��t���H��[]A\���SH��0dH�%(H�D$(1���D$�D$xH��H�T$H�t$H������y�@H��= H�5= H�8��1��Q�|$t�|$t�{1�H�T$�P�����yH�5�= H�>��1���D$�L$�L$���Hc��H�H�L$(dH3%(t���H��0[���SH��0dH�%(H�D$(1���D$�D$xH��H�T$H�t$H�������y�@H�= H�5lH�8�,�1��Z�|$t�|$t�{1�H�T$�P��&���yH�5�< H�>�3�1��!�L$�L$�D$�D$+D$���Hc��n�H�L$(dH3%(t��H��0[���SH��0dH�%(H�D$(1���D$�D$xH��H�T$H�t$H��?�����y�@H�)< H�5�H�8�R�1��V�|$t�|$t�{1�H�T$�P��L���yH�5�; H�>�Y�1���D$�D$�L$�L$���Hc���H�L$(dH3%(t�C�H��0[���AWAVAUATUSH��H��dH�%(H��$�1��x$H�l$H��H�5uH������1���u"�HH�I; H�5�H�8�r�1��+�{�v%L�#; H�5�I�8�L�H���d�1��L�t$`1��L����H�Hc{���@A�L�l$I���CL�d$ �����I��N	L�`M������D�SE1�1�1�I��L��A�z�!�L���D$��D�\$A��uH�����H�=l: H�?����bI����������{L��IN���H���u ����8u
�R��t���H����1��!HC(I)�I��Y���H���j�H�3: H�H��$�dH3%(t��H��[]A\A]A^A_���SH��H�� dH�%(H�D$1��xH��H�T$H�5��@���u�H��9 H�5H�8���1��VH�t$1��D�H�D$H��t�{H�T$H�p �i�H���uH�|$H�u��D�1��HC H�|$H����H�D$H�L$dH3%(t��H�� [�H��tH�muH����M��tI�,$t1��L��1�����H�mu���H�=iB H�bB H9�tH��8 H��t	�����H�=9B H�52B H)�H��H��H��?H�H�tH��8 H��t��fD�����=�A u+UH�=r8 H��tH�=3 �Y��d�����A ]������w������AWH�=c> AVAUATUSH���b��������H�=�? �N��������H�=�= ��H��H������1�1�H�=��Y�H�JA H��t,H�H��H�5�H�����H�(A H�5�H���������H�����I��H���?���H���6���E1�L�53 L�-42 @K�<>���H���E���H�MK�|=J�9���H���*���I�T$K�|>J�:I�GH�$��H���H�uK�|=J�D>��H�����I�|$M�GL�D$J�D?K�|>�f�H������L�MK�|=K�D9�J�H�������M�T$K�|>M�_L�\$K�D:�$�H�������H�MK�|=J�D9��H���f���I�T$K�|> J�D:I�G H�D$���H���@���H�uK�|= J�D> ���H���$���M�|$H�|$I�?L�<$I�� I��������H��H�5H���������L��H�5H������������1�H�5H���s������H�5�
H���V����~����H�5�
H���9����a����H�5�
H�������D����H�5�
H�������'����H�5�
H��������
���� H�5�
H�����������@H�5�
H������������H�5t
H������������H�5c
H���n���������H�5R
H���Q����y����H�5?
H���4����\����H�5+
H�������?����H�5�H�������"����H�5�H�����������1�H�5�H�����������H�5�H�����������H�5�H������������H�5�H���l���������H�5�H���O����w����H�5�H���2����Z����H�5�H�������=����H�5�H������� ����H�5�H������������	H�5�H����������
H�5�H�����������H�5{H������������H�5qH���g���������
H�5fH���J����r����H�5[H���-����U����H�5PH�������8����H�5EH������������H�5:H�������������H�52H����������H�5*H�����������H�5"H������������H�5H���b���������H�5H���E����m����H�5H���(����P����H�5�H�������3����C�H�5�H������������C��H�5�H�������������C�H�5�H�����������	C��H�5�H������������C�H�5�H���z���������CH�5�H���]���������C�H�5�H���@����h����C��H�5�H���#����K����C@H�5�H�������.����C@H�5�H������������AP�H�5�H����������P�H�5~H�����������P�H�5uH������������P�H�5nH���u���������@P�H�5dH���X���������P�H�5aH���;����c����P�H�5WH�������F����
P�H�5MH�������)����P�H�5EH�������������P�H�5=H������������P�H�53H������������CP�H�5+H�������������P�H�5"H���p����������P�H�5H���S�����{����P�H�5H���6�����^����PH�5
H��������A����PH�5H��������$����P@H�5�
H�������������PH�5�
H�����������P�H�5�
H����������PH�5�
H����������P�H�5�
H���k�������
P�H�5�
H���N�����v�BP@H�5�
H���1�����Y�PH�5�
H��������<�P@H�5�
H���������P�H�5�
H����������P�H�5�
H����������	P�H�5�
H����������PH�5�
H����������Q@H�5z
H���f�������Q(@H�5r
H���I�����q�Qt�H�5j
H���,�����T�m!�H�5^
H��������7�m�H�5T
H����������m�H�5K
H�����������Q�H�5B
H����������Q�H�59
H����������Q�H�52
H���~�������Q�H�5,
H���a�������Q�H�5"
H���D�����l�
Q�H�5
H���'�����O�Q@H�5
H���
�����2�QH�5
H����������Q@H�5�	H�����������QH�5�	H����������	Q@H�5�	H����������QH�5�	H���y�������Q@H�5�	H���\�������
Q@H�5�	H���?�����g�Q��H�5�	H���"�����J�Q��H�5�	H��������-�Q��H�5�	H����������Q�H�5�	H�����������Q�H�5�	H����������TH�5�	H����������T@H�5�	H���t�������T@H�5�	H���W������T�H�5{	H���:�����b�TH�5p	H��������E�TH�5d	H��������(�T�H�5W	H����������T�H�5K	H�����������H��H��[]A\A]A^A_���������H��H���|sMIXERDEV/dev/mixers|s:openrwAUDIODEV/dev/dspget_recsrcreccontrolsstereocontrolsset_recsrcspeedchannelssetfmti(ii):set(ii)i:getiiiiii|i:setparameters(iii)postresetsyncy*:writey*:writealln:readossaudiodev.OSSAudioErrorerrorcontrol_labelscontrol_namesAFMT_QUERYAFMT_MU_LAWAFMT_A_LAWAFMT_IMA_ADPCMAFMT_U8AFMT_S16_LEAFMT_S16_BEAFMT_S8AFMT_U16_LEAFMT_U16_BEAFMT_MPEGAFMT_AC3AFMT_S16_NESOUND_MIXER_NRDEVICESSOUND_MIXER_VOLUMESOUND_MIXER_BASSSOUND_MIXER_TREBLESOUND_MIXER_SYNTHSOUND_MIXER_PCMSOUND_MIXER_SPEAKERSOUND_MIXER_LINESOUND_MIXER_MICSOUND_MIXER_CDSOUND_MIXER_IMIXSOUND_MIXER_ALTPCMSOUND_MIXER_RECLEVSOUND_MIXER_IGAINSOUND_MIXER_OGAINSOUND_MIXER_LINE1SOUND_MIXER_LINE2SOUND_MIXER_LINE3SOUND_MIXER_DIGITAL1SOUND_MIXER_DIGITAL2SOUND_MIXER_DIGITAL3SOUND_MIXER_PHONEINSOUND_MIXER_PHONEOUTSOUND_MIXER_VIDEOSOUND_MIXER_RADIOSOUND_MIXER_MONITORSNDCTL_COPR_HALTSNDCTL_COPR_LOADSNDCTL_COPR_RCODESNDCTL_COPR_RCVMSGSNDCTL_COPR_RDATASNDCTL_COPR_RESETSNDCTL_COPR_RUNSNDCTL_COPR_SENDMSGSNDCTL_COPR_WCODESNDCTL_COPR_WDATASNDCTL_DSP_BIND_CHANNELSNDCTL_DSP_CHANNELSSNDCTL_DSP_GETBLKSIZESNDCTL_DSP_GETCAPSSNDCTL_DSP_GETCHANNELMASKSNDCTL_DSP_GETFMTSSNDCTL_DSP_GETIPTRSNDCTL_DSP_GETISPACESNDCTL_DSP_GETODELAYSNDCTL_DSP_GETOPTRSNDCTL_DSP_GETOSPACESNDCTL_DSP_GETSPDIFSNDCTL_DSP_GETTRIGGERSNDCTL_DSP_MAPINBUFSNDCTL_DSP_MAPOUTBUFSNDCTL_DSP_NONBLOCKSNDCTL_DSP_POSTSNDCTL_DSP_PROFILESNDCTL_DSP_RESETSNDCTL_DSP_SAMPLESIZESNDCTL_DSP_SETDUPLEXSNDCTL_DSP_SETFMTSNDCTL_DSP_SETFRAGMENTSNDCTL_DSP_SETSPDIFSNDCTL_DSP_SETSYNCROSNDCTL_DSP_SETTRIGGERSNDCTL_DSP_SPEEDSNDCTL_DSP_STEREOSNDCTL_DSP_SUBDIVIDESNDCTL_DSP_SYNCSNDCTL_FM_4OP_ENABLESNDCTL_FM_LOAD_INSTRSNDCTL_MIDI_INFOSNDCTL_MIDI_MPUCMDSNDCTL_MIDI_MPUMODESNDCTL_MIDI_PRETIMESNDCTL_SEQ_CTRLRATESNDCTL_SEQ_GETINCOUNTSNDCTL_SEQ_GETOUTCOUNTSNDCTL_SEQ_GETTIMESNDCTL_SEQ_NRMIDISSNDCTL_SEQ_NRSYNTHSSNDCTL_SEQ_OUTOFBANDSNDCTL_SEQ_PANICSNDCTL_SEQ_PERCMODESNDCTL_SEQ_RESETSNDCTL_SEQ_RESETSAMPLESSNDCTL_SEQ_SYNCSNDCTL_SEQ_TESTMIDISNDCTL_SEQ_THRESHOLDSNDCTL_SYNTH_CONTROLSNDCTL_SYNTH_IDSNDCTL_SYNTH_INFOSNDCTL_SYNTH_MEMAVLSNDCTL_SYNTH_REMOVESAMPLESNDCTL_TMR_CONTINUESNDCTL_TMR_METRONOMESNDCTL_TMR_SELECTSNDCTL_TMR_SOURCESNDCTL_TMR_STARTSNDCTL_TMR_STOPSNDCTL_TMR_TEMPOSNDCTL_TMR_TIMEBASEclosefilenononblockgetfmtsbufsizeobufcountobuffreegetptrflush__enter____exit__nameclosedmodeopenmixerossaudiodevvolbasstreblesynthpcmspeakerlinemiccdmixpcm2recigainogainline1line2line3dig1dig2dig3phinphoutvideoradiomonitorVol  Bass TreblSynthPcm  Spkr Line Mic  CD   Mix  Pcm2 Rec  IGainOGainLine1Line2Line3Digital1Digital2Digital3PhoneInPhoneOutVideoRadioMonitorossaudiodev.oss_audio_deviceossaudiodev.oss_mixer_devicemode must be 'r', 'w', or 'rw'Operation on closed OSS device.Invalid mixer channel specified.Volumes must be between 0 and 100.Unreachable C code path reachedunable to set requested format (wanted %d, got %d)unable to set requested channels (wanted %d, got %d)unable to set requested rate (wanted %d, got %d)file descriptor out of range for select;d+����h��������������������L���l���/�������t�����������4P��L���G���~�����������	�����(~��@���X���t����3���H�������.�����8%��P\��h����9���
���������$��DR��� ��zRx�$P���FJw�?:*3$"D����\ ��p��'E�a$�"���E�K�D0�AA0�����F�K�A �D@� AAB�/��TEd
Eec��,RY w��,RY8����H x4P����B�K�N �C(�Dp�(A ABB����7]Y����7]Y����7]Y����7]Y4�����B�M�I �C(�Dp�(A ABB ���7]Y8���7]YP���7]Yh���7]Y ���E�G0A�����E�G �A�����H0��6��3Em�Q��E�TS��E�T,U��Fz@��� T����E�G@�A(x��HK�A�D jAAA��,����B�L�L �FP� AAB����7]Y����7]Y���7]Y0���F�A�A �G�� AAB,P}���B�I�D �G0� AAB����E�D@�A�����E�D@�A�����E�D@�AH�?���F�B�B �B(�A0�A8�J��8A0A(B BBB,����E�G0�AHL`��OF�I�B �B(�A0�A8�DP
8D0A(B BBBA zRx�P������(���?GNU��7`7�j �P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�PQ
QQQQQ$Q*Q0Q8Q>QDQJQPQVQ\QbQhQnQtQzQ�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�Q�QUfvH
G�j �j ���o`x�
whn ����
	���o���oX���o�o�
���o�hl �������� 0@P`p�������� 0@P`p���������G�5�G+0�G#41P~.7P�%>P%�GM)GP�%|G)vG�(�G�/�G�/�G�/�G�,OPM3WPs2aP�1jPu+qP�/wP�"�P,1P�"7Po%wP�"�P,SG�'\Gz'PGC'�G�*�G�)EG'kG�(�P�P�,�P�,+Ge#�P�"�P�������� u 1P�Q8g,p @t �t �QI,�r GA$3a1H
Gossaudiodev.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug��D�7zXZ�ִF!t/���]?�E�h=��ڊ�2N��͑� ��Z���_���X턗�Z��nq|���\�C�7W<%�,^I��GTo�mVR�5��K���g��Z�]p�&���=���87T|���3sR��!P�|1ńp}���
3,�x�'�.I�����z�1��֧2�/m;�X%��R�.�Kex�)��9�~�
Kz(Fe�!�+�.Pf�RB&�X�W�B�����H����D��۔H/���dgb�"�|O2D��ADR���>&�5&��`�S��@���E��{��?�$���n����%�2כ�/`����7�RK+x���s����ʗ_5t�UH��h36����8|1����#��%�r<��� �崔ly��[��-�E�̵�הb��1���	
�j���'�t��)�f:30��|�� �Tߔ��E�~�\��7#�L.|�ro�k@���9�&G%�I�†��8>�WR7�U���#��0�x�r��W�K		�Hi�b���2GW_O�^���do�u,��l����T	k�t�ՙ���ʿ
�zS�
1Y���f�l��c^<ZR�~���Bu_�Q�i��i�%�_���_�p\B�:mA΂�j��'?v��ƿ��_�/
�%J��iF(��8�?t�����+�p|��0W��d.�rCI����>	'I�rÙ��k8���޴t�5{�S��4wE��[ƌ�P�d,��۹>{��M��q��~T�=�;�\�\e�t+V06��]��I�An�8B��L����7������~�Y��W�.�&�NKmJ(�\aֈf��*)m��8���0b�;��3�{�ȝ��~�f�c/�*!�U��	>��ij 
��>ׁ�'�ܕ̣���Ş�����-�&TTY�,��(�ؖ:��($1:^�vݟ�!��U��r���t��m.��%��9eF&a�>����6��q��7���[�L���!R��R.�Taނ����$�������}J;h:eCC{��(�R�vą�{�Z���}��� ����?t��r����)7�q�'+˳�2�
�/I
�i
���
s)�p��g�|��R���O��ZS:�:�nD�_߰�w���x��8�h �[�N�Xʹ�%�)`GN��'����@�?��E��{_�'�6��t^�v;�lW��	�(��߱�g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(���0xxw8���o�
�
hE���oXX�T���
^B���hHHcpp�n  �w�"�"$}GG
�2GG���S�Sd�UU���Z�Z ��j �j��j �j��j �j� �hl hl�hn hn��p p`	 �`y `y�py``y$
�yd�y��~(lib-dynload/_multibytecodec.cpython-38-x86_64-linux-gnu.so000075500000156520151153537510017275 0ustar00ELF>�1@�@8	@���� ���� �� �� �� � 888$$������  S�td������  P�td������44Q�tdR�td���� �� ��GNU0�F>?Z'#_(g�qM���[�@ !H[]^��|CE���qX�o�N�����xF �����9�@%�{�c� aM���, �F"|"%���PsG���t!�������H-��#��p������8��[Q�bF9��m]�3&(�  �  � ���
__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6_Py_NoneStructPyUnicode_FromString_Py_Dealloc__stack_chk_failPyUnicode_AsUTF8PyCodec_LookupErrorPyTuple_NewPyObject_CallObjectPyErr_NoMemory_PyBytes_ResizePyExc_UnicodeErrorPyErr_SetStringPyBytes_FromStringAndSize_PyUnicode_ReadyPyExc_RuntimeErrorPyUnicode_FromOrdinalPyExc_UnicodeEncodeError_PyObject_CallFunction_SizeTPyCodec_StrictErrorsPyUnicodeEncodeError_SetStartPyUnicodeEncodeError_SetEndPyUnicodeEncodeError_SetReasonPyExc_TypeErrorPyLong_AsSsize_tPyErr_OccurredPyErr_ClearPyExc_IndexErrorPyErr_FormatPyObject_FreePyBytes_Size_PyObject_CallMethodIdObjArgsPySequence_CheckPySequence_GetItemPyObject_StrPySequence_SizePyUnicode_AppendPyUnicode_SubstringPyObject_GC_UnTrack_PyLong_FromByteArrayPyUnicode_AsUTF8AndSize__memcpy_chk_Py_BuildValue_SizeT_PyUnicodeWriter_WriteCharPyUnicodeDecodeError_CreatePyUnicodeDecodeError_SetStartPyUnicodeDecodeError_SetEndPyUnicodeDecodeError_SetReason_PyUnicodeWriter_WriteStr_PyUnicodeWriter_Init_PyObject_CallMethod_SizeT_PyUnicodeWriter_Finish_PyUnicodeWriter_DeallocmemcpyPyUnicode_New_PyArg_CheckPositionalPyUnicode_SplitlinesPyLong_Type_PyArg_ParseTuple_SizeT_PyLong_AsByteArrayPyBytes_AsString_PyArg_BadArgumentPyUnicode_DecodeUTF8PyCapsule_IsValidPyCapsule_GetPointer_PyObject_NewPyExc_ValueErrorPyExc_AttributeErrorstrcmpPyObject_GetBufferPyBuffer_IsContiguousPyBuffer_ReleasePyFloat_TypePyType_IsSubtype_PyLong_AsInt_PyArg_UnpackKeywordsPyMem_MallocPyMem_Free_PyArg_ParseTupleAndKeywords_SizeTPyObject_GetAttrStringstrlenPyLong_FromSsize_tPyInit__multibytecodecPyType_ReadyPyModule_Create2PyModule_AddObjectPy_FatalErrorPyObject_GenericGetAttr_edata__bss_start_endGLIBC_2.14GLIBC_2.4GLIBC_2.2.5GLIBC_2.3.4v���+ii
6ui	@ti	L�� ���� P��� �� �� V��� /��� V�Ⱥ /�� V�� \�� V�� \�� ��  ��  � � a�(� �w8� ��`� �h� �~x�  ��� ��� �e�� ��� Ԑ�� �n�� З�� �� �2� ��� a�� Pp� �� � �(� Pf8� ��@� ԐH� `lX� p�`� �h� �1x� P��� �� ��� p�� �� � ��(� �@8� `�@� ��H� �?X�  �`� �h� `ax� ��� /��� �2�� =B�� "�� �`� 6�h� P�x� 0��� <��� 8;�� ��� ��� �:�� Й�� G��� �o�� `�H� b�`� �� �� �� �� a��� �� �� � � /�0� �8� /�h� � p� a��� � �� ��� 6�� r�0� �d�� a2�� `� �� � �� �� (� 0p8�  }�� ���� �dX� 2�� � �� �� �� �� ��  p�� @vX� ��p� Pe�� �1(� � 8� �� h� @px� �r�� ��� �e�� �1�� `� �� �� � �a� �t�� ֒�� :h� � �� �� 	�� �� �� ��  �� !ȿ "п #ؿ ,� 4� 8� =�� H�� )0� )�� )p� )� )0� 8� @� H� P� X� `� h� 
p� x� �� 
�� �� �� �� �� �� �� �� Ƚ н ؽ � � � �� � "� $� %� & � '(� (0� *8� +@� -H� .P� /X� 0`� 1h� 2p� 3x� 5�� 6�� 7�� 9�� :�� ;�� <�� >�� ?�� @Ⱦ Aо Bؾ C� D� E� F�� G� I� J� K� L � M(� N0� O8� P@� QH� RP� SX� T`� Uh� Vp� Wx� X�� Y�� Z��H��H��� H��t��H����5� �%� ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&�������h'��q������h(��a������h)��Q������h*��A������h+��1������h,��!������h-��������h.��������h/������h0�������h1��������h2�������h3�������h4�������h5�������h6�������h7��q������h8��a������h9��Q������h:��A������h;��1������h<��!������h=��������h>��������h?������h@�������hA��������hB�������hC�������hD�������hE�������hF�������hG��q������hH��a������hI��Q������hJ��A������hK��1�������%U� D���%M� D���%E� D���%=� D���%5� D���%-� D���%%� D���%� D���%� D���%
� D���%� D���%�� D���%�� D���%� D���%� D���%ݏ D���%Տ D���%͏ D���%ŏ D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%}� D���%u� D���%m� D���%e� D���%]� D���%U� D���%M� D���%E� D���%=� D���%5� D���%-� D���%%� D���%� D���%� D���%
� D���%� D���%�� D���%�� D���%� D���%� D���%ݎ D���%Վ D���%͎ D���%Ŏ D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%}� D���%u� D���%m� D���%e� D���%]� D���%U� D���%M� D���%E� D���%=� D���%5� D���%-� D���%%� D���%� D���%� D���%
� D���%� D���%�� D��SH�WH��H�B@H��uH�<� H�C0H��H�rH���H��t�1�[�1��/��H� H��H�O�H��v
H��tH���1����H� H��H�O�H��v
H��tH���1����ATI��UH��SH� H��H�G�H��vH��uI�|$81�H��tH��H��[]A\��H��Ӆ�t�[]A\���ATI��UH��SH� H��H�G�H��vH��uI�|$01�H��tH��H��[]A\��H��Ӆ�t�[]A\���H�G H��tH��tH��uH�=]�H�=�\�H�=�\���H����SH��H�� H�OdH�%(H�D$1�H�A(H��uH�{(H��u,�<H�T$H�qH��H�T$H�T$��H��1�H��t��H�C(H�u���H��� H�H�t$dH34%(t�
���H�� [�ATI��US���H��t/H�����H��H��t����H��H��uH�uH���4���E1��1L�`H��H��I�$�<���H�MI��uH������H�uH�����L��[]A\�USH��QH�G0H�oH�HH�P H)�H��H�H9�~H��H��I��������I)�I9�}
�T������*H�H�{0�s������tH�s01�L�N L�LNH�kL�K Z[]�H�O0H)�H��H�<
H��I��������I)�L9�~PH�� H�52[H�:������Z�H�|(H���HP01������H�|$HH��tH�/t/H�|$PH��tH�/t&1��9.M��tH�t$(I�4$�.�.���������1��.H�L$I��H��L��L���b���,.�H��H�T$���H�T$��x�H�rH���B.�I.L�RHL�T$�}.H�/�.�r����.H���uRA����H�L$H��L��L��I����������-�
���L�JHL�L$�$.H�|$HH�����������H�L$I��H��L��L���������H�|$8L�L$0L9L$(��,L�CL�D$RL�[I�w��AUL�T$PI)�L��ARASL�D$8H�L$(A�WI��H�� H���x,H����.���H�L$H��L��L���#���Q���H�|$8L�L$0L9L$(|��=,�8,AWAVI��AUL�-MYATI��UH��SL��H��(H�4$dH�%(H�D$1�M��rI���tGI���t%I���H��� uAH�8H�59YA������\L��H��E1�����A��A���@H�ZL�-�X�H�8H�5
YA���H����I�����?����I��H�����@ A��A��A��� tM�gH�@t
M�g0�M�gHH�D$H�T$H�T$H�uM�NWL��M�F M+FjD��APAQA�L�D$(H�|$ �UH�� H���uH��L���!�����u��aI�uL��H�$���H�$H��tHI�n I+nH��~M�VI�rI�vA�?�)�L��������u��M�FI�T$�N�<H��wI^E1��I�~(H��uOH�=�� P1�M��AUI�H�5�WH�UH�?�2���I�F(ZYH����I�v(I��uJH��A������L�������I�~(L��������wI�~(L���x�����t��bL�����I��H���NH�H���t0H�xu)H�XH�sH����tM�D$ M�HA���uL�5g� H�5�Y1�I�>�6�������s-H�4$H��H�L$H��A�A��K(H��H��u�H�H�kH��~1M�V M+VI9�|I�~H�s H���In�H��L���A�����u��qI�|$ ����I��H��y�J�H��uMnxM9n}"�4���L�݅ L��1�H�5!YI�;�	��'M�nI�$uL������H�A�u2H�������(I�$uL�����H��uA���H�u�H�������H�L$dH3%(D��t����H��([]A\A]A^A_����x�����USQH�W(H����H��H�wH�1�L�C A��'H�{(H��H��tH�C(H�u����H��u1��RH���Y�H��~-H�{0H��H�5� 1��_���H��H��uH�Mu�H������H�MuH�����H��� H�H��Z[]���AWAVAUATI��H��USH��HH�t$dH�%(H�D$81�����D$��tH�D$0I�T$H�D$ H�T$(�nL�
� H�5�TI�;���1���H�|$H�����I��H��tUH�HI��1��uH����I��H��u:A��I�uL����A��t�D$H�|$Hc\$���H9�|���1��^H�pH����u%H�=o� H�5WH�?�@�I�u�L�����I�\$(H��tRH�H�|$ L��H�\$0�a�L�|$0M��uH���=�KI�|$(H��tI�D$(H�u�L�L�|$0�I�A� y;I�|$H�L$ E1�L��H�D$0M�GH�t$(L�D$M�D$ ��$I��H��u9�L�����y��I�|$(I�\$(H���FH��=����3H��t
H�uH����H�t$0H9t$I�uIL�����?L�L$I)�I��~L�?� H�5fRI�:���.H�T$L���	�I�D$(H��u��H��toH�MuiH���J��_I�MuL���:�H����H�MuH���#�H��t
H�uH����M���X������.�H������H�� H��qI�|$01�1�L��H�5Ƈ �A�I�MH��uL����A��H�������H�MA������H�������1�H���Z�������H���_�������H�L$8dH3%(t���H��H[]A\A]A^A_�H�/u�I�H�{0H��tH�/u�5�H�sH��[L��@A��H�/u��H�{8H��tH�/u��H�sH��[L��@A��H�/u���H�sH��[L��@A��H�/u���H�{(H��uH�sH��[L��@A��H�C(H�/u�����H�t$��H����&H�l$H��@H�|$H��H��@�l$L�d$�M�H�SH�u	1�L��H�T,����|&H�
� H�5�PH�9��1��_&H�muH����Z1�[]���ATI��UH��SH��H��wH���]1ҹH��H�=P����u��=I�<$H;=� t4H�G���t
��H���u*�H�R H�5IPH�:�#�1��J��H��u�H��H��H�5>PH���(I��H��tԾH���Z�I�$H��uL���I���H��[]A\���ATI��UH��SH��H��wH���[1ҹH��H�=�O�9���u��cI�<$H;=�~ t2H�G���t
���H���u(�H��~ H�5|OH�:�V��$���H��uH��[H��H��]H�5sOA\��'[1�]A\�L�J~ H�5OI�;��1���+H��H�GOH�5FOH�=HO�����H�E(H�/tC���t$H�E(H�3~ H�|4H�H�}�-L��} H�5�NI�8��1��-H�D$��H�D$�1��-H��H��NH�5�NH�=�N�g�1��e-H�i} H�5�NH�:�J�1���-��ATUSH��uH�=�} H�5�NH�?� �����H�F���uH�
$} H�5�NH�9�����I��H����H��H��u���H�5MH�������tBH�5MH�������t/H�5�LH������tH���z�H��H��u릻I�|$ H��tH�W�H��v
H�u���I�\$ 1�[]A\�L�yH�|$ �1��I�PH��H��A�L�� 1�H��$�VH��jj�q�H�� H��H��tKL�d$ H�81�L�����A�ƅ�u2�CL�������$I���P-�x.�c�H���=-E1���.I���n���I��I�U I�}H��H��L�$�"���H��$�L�\$pL�$I9��d.L�E L�$I�EH��L�T$H��L)�L�$H�|$H�p�P0L�T$L�HI�������DH��$�L�\$p�.I��������M)�M9���K�L�D$H��L�T$H�T$��H����I�U0I�u(H����L��H��H��I}0H�$�|�L�$H�L$I�E0�~$H�$�I�L�T$fl�I9�H��$�)L$p��M�}I�}L�$H��H�|$L�D$I�wL�\$A�W0L�$L�|$H�xH������
������H�/�`-���V-�-�H��$�H��tH�/tH�} E1��N��--M����,�\���I�U I�}H��H���!��uYH��$�L�\$pL�T$L9��R����,H�MH�fKE1�H�5nKH�=xK���,L��L���q�����,M���T���L9��K���L�����>���L�
ty H�5�ME1�I�9�B��q,I�U I�}H��L�$H������R L�4$��uL�\$pH��$��B+L�����,I�}(L��L����L�$$M�e0�e���H�+t1��,H���:���,H��1��+���,L��x H�5�JI�:��H�+uH����H�mu�H��1�����,L���d�H�C H��t�L�c�,H�+t1��/.H�����".H��1����.L�Rx H�5)JI�:�#�H�+uH����H�mu�H��1��t���-L�����H�C H��t�L�c�*.L�����H�C H��uH�+uH���6�H�mt21��T/L�c�/H�����>/H�+u�H��1����)/H��1�����/H�
�w H�5nIH�9�h��H��$��-4L�
�G1H����%��H�����L��$�L�
�GL+�$�I��uc���H���,�����H��$�H��$�L�H��$�H9��3M�L$H)�I��H��L��I�qA�Q0I��H���b����2H��$�H��$�H��$�H)�I�H���I�D$H��$�M��H�8H)���H��$�H���0H��$�I����H���)�H��$�H��t
H�/��H�} E1��v��1H�=rv H�5�FH�?��H�T$H��H��v�I�mu�L���]��I�m�2L���H��1H�/��1�4���1H�����2�I�����2L����I��H��t�H�P����H�x��H�pL�FA�����L�P M�ZA�����H��������I� ��I��H��y1H�D$(��L�L$(H����H��$�H+�$�I���H��$�L�H;�$���H��$�I�/uL���;�H��$�H��$�H9��/�0�/I�,$tE1��o0���]���L��E1�����U0H��L�L$(�r����_���H��$�L��������G���H�t$(H��$����������(���H�\$H��H���$������H�MH��EE1�H�5�EH�=�E����/H�8H�t$01�H�t$������/L���,L��L�L$��L�L$H��I������H�|$H�D$��-L�x�I��vH�(uH����1�1��Q�I��H��������+�I��H��t4L�x1��H�H��t;I�E � /I�m�����L��E1����/I�/�����L������.I�m�l���L��E1��r���.H�T$@L�L$0A�H�T$�,H��H�/EH�54EE1�H�=�D����.L�%�r H�5�DI�<$��E1��u.L�iH�|$0�1��I��.I���.L�5�r H�5gFL�|$I�>�b�L�|$I�/�H���L�����;���L�|$L�L$���L�%�r H�T$1�H�5�EI�<$��L�|$�L�����H�C H���b0H�+uH���_�H�mt)1��^0H���I��Q0H�+u�H��1��4��<0H��1��%��-0H�=�q H�5�CH�?���E1�M�}HL�|$ I��������?M9���4���H�|$hH��t
H�/�mH�|$pH��tH�/u��H�{(H�k(H��t
H�/��H�|$tL�d$I�$H�L$H��I�$�'I�m�6E1��C2E1�I�}HH�|$ �`���E1������H���`0��L�aI�WA�H��1�L��v H��$�Pjj��H�� H��H��t�E1�I��L�(�0�
2H�
�p H�5EE1�H�9�q��1L������H�D$H���Q���H�x�����H�k(H����L�l$I�E�4I���Q���E1����H�D$L�������{I�}L�S L�KL�cE�] L�L$H�|$L�T$0E���sE����/L���B����o���M�EM����1A����2�z3L�
�o H�5`CI�9��L�T$M�L�\$I��M��i���L��E1������0H�EH�t$H�|$@H�l$@��L�l$@M����3H�\$L�L�D$I��L�t:H�m����H���~��M����������L���h���3�^�����1�H�|$�M��H��t�H�mu����L��E1��0���0H�t$L)�H����L�
�n H�5�>I�9���I�/uL�����L�D$M��tI�H�T$H��I�t�H��u��P���L�D$E���0A��}�������	������L�l$@�2H�l$L�mL�l$I��L�m�X/H���z���K/I��H�L$0H�t$L��L�������q���L�T$XH�L$`L��I�D$(I�t$L)�H�|$��I��H��u��.H���uEA����H�L$0H�t$L��L��I�������������H�t$X�B1E1�H����01H�L$0H�t$I��L��L���e�������H�t$XL�L$PL;L$H�1M�GH��L�D$8I�t$RI�GAVH�T$pH)�RPL�D$XH�L$@�T$LH�|$8A�T$H�� I��H��u9�0H���T����0�0H�T$L��L������H�C(H����0�%���H��������H�L$0H�t$L��L����������H�|$XL�L$PL;L$H�Q���H���=0H�|$hH�����������H�|$hL�t$HH��tH�/u���L�|$p�(0H�/�j2H�$���H�$�X2A�L�����E���t2H�|$P�h2M���_2A�H�{8L��H��<1�H�5=���I��M���hI�����-M�oH�C0M���D$H����I�w Ll$XH�4$�~$J�.H�L$ fl�)L$M��~<H9�s7H�CL�cL�E L��H��L��H�p�P0L�HI�������rH�t$H�L$ D�d$I��?E��E��H9���I�/��������I��I��������I)�M9��I�t1����I��H��toH�S0H�x H�s(���H�{0I�WI�w H��w��I�/uL�����H�C0M�l$M�����A��g���L�5�j H�WH�5�>1�I�>���I�/uL������H�|$(H��tH�/tj��H�} ���1��r0L������0A�H�S H�{H�����H���A��u�H�t$H�T$ H9����H�������������x����P��������g���I��H�S H�{H��H�������H���H�L$ H�t$H9��j���L�U L�$L�[H)�H��L�$L��I�sA�S0H�PH������.���H�S H�{H��H��������H�L$ H�t$H9�r��	���1ҹH��H�=g:������u1��W/H��~
I�}H;=xi uA���H��u�H�l$I��H�} �r��H�D$(H�{81�H�5:1����I�����H�w���t4���I��H���t�H��t>H�l$H�} ���H�D$(M��x����H��h H�5�9H�;�v��1��.1�1��6���.L����������f��A�~ I�vL�t$0L$XA�n H�D$8@��H�t$@��@�� ��I�NHH�L$I��������?L9��)H��1�H����H�D$`H����L�@ H�@L�L$@L�D$HI�L�D$PL9L$8��0L�t$0H�|$hI�w��M�VH�|$M�FQjPARH�L$(A�WI��H�� H����0H�t$M��H��L��L��L�L$ �s������H�|$ L�D$HH����m0I�vL�l$ M��M��H�t$(I��L�L$@L;L$8�CI�uRM�^��jH�\$`L)�SASL�D$HH�L$(H�|$8A�UH��H�� H���LL��M��M��L�l$ �/����H�|$XH��tH�/u�'��H�|$`H��tH�/u���H�|$v
H�+��M��tI�,$��1��6/H�|$XH��uIH�|$��M��������H��H����L�pL���(��H����H�C ��.H�/u���L�t$`M��u��j���H���t���o�����L��1��a���.E1�I��L�0umI�v�����M��E1�A�~ �fM�nM����H�D$�L�}I�G H����.�.H�+� ���H����������H��H�KH;
�e �]H�Y����TH�t$0H������I��H��t3H��1�L���H��H��H;L$0�?���L�(e H�5O7I�8�	��1��-L�yI��y.L���^��I��H���b���L�HM��I��A�������L��d H�5t9I�:���I�.�*���L��1�����X-H�+����H��1�����?-I�.�����L��1������&-@��@uHM�^HL�\$�H���H�t$I��H��L��L���P�����k���I�G(�-H�|$XH���^����y���I�V0H�T$����I���-E1�����H�L6H�5Q61�H�=k6�����,L��M��M��L�l$ ��,I�,$�d���L���&���W���L���)�����!���M�n���H�t$I��L��L��L���������L�D$HH����<���L��M��M��L�l$ �,L�������������M�������I�,$�����L��1������+H�=^3�L���A��A��E���R���H�5C3L�������uH�D$��:���L��M������H�53L�������H�D$���
���L�����H��H��u!M������I�,$�	���L�������9+H�P�H�T$��������H�L$0�.E1�H��L�$����L�$���`L�cL�] H�}�{ L�uH�|$L�\$M���u.H��L�$���L�$����L�S�T.H���d��I��H��tTH�P����]L�m(M����I�EH�|$0H��L�l$0���H�\$0H��H����-I�,$tMI�mtZ1��S-L��L�$���L�$�/E1�H�}(L�u(H��tH�/u����M��t+I�,$u$E1�L�����M��tI�muL�����H��t�H�+u�H�����1���,E1�L��L�$L)�H��~cH�-*a H�5Q1H�}����L�$I�.��M��M��M��tI�,$t�M��u��I�m�}.L���(���p.H������Z.L��L��H�����L�$H��H�E(�1.�E1�L�$���L�$H�|$XH��tH�/u
L�$����L�$H�|$`H��t
H�/�M��M�����I��H�|$XH��u���M��E1�H�KHH�L$�,L��L�$M���w��L�$M������L��E1�H�/�y-L�$�R��L�$�g-E1�H�L$H�t$L��L��L�D$ I������L�D$ ���7���H�t$HL�L$@L;L$8��,I�GH��I��L��H�D$(I��H�sRI�jL�\$`M)�ASWL�D$HH�L$0�T$ H�|$(�SH�� I��H�@H�����u'L�D$ L��H�t$H�,L�$M�����L�4$���H�L$H�t$L��H�������u%L�T$HL�L$@L;L$8�l���L�D$ L��L���,,L�D$ L���\���M��E1�L�{HL�|$�f+L��H�$�!��H�$�,H������X,H������{,E1��,E1��	���H�=�^ H�5@2H�?�h��I�,$����L������1��*H�E1�I��L���m*H�=3�@��E1��1.���SH�WH��H�B@H��uH�l^ H�C0H�[�fDH�rH���H���)����ff.���1��f�AWI��AVI��AUE��ATI��USH��hL�D$dH�%(H�D$X1��B ���>��H�rH������f�H�T$ @��D$HH�D$(��H�t$0� �����@�$��H��������?H�R0H�T$H9��i��H�t61��K��H�D$PH���U��H�xH�X L�L$0H�\$8H�H�\$@L9L$(}5H�\$ H��I�w��L�CAUWL��APL�CH�L$(A�WH�� H������I�(�|L�L$PH�t$8I�Q H)�I9q����H�|$P�����������M���~H�L$(H�|$HI�$H���M��H�D$PH�L$XdH3%(�GH��h[]A\A]A^A_�fDA���z���H�\$ H�kH�L$@I�wH��L��H+L$8A�W(H���P������H�|$HH������H�D$P�1�A�����B f��H�T$ L$H��H�t$0H�D$(@����� �����@�~��L�Z0L�\$H��������?H9�����H��1�H����H�D$PH������H�xH�p L�L$0H�t$8H�H�t$@L9L$(�����H�\$ QI�w��H�KAUL�CWL��QH�L$(A�WH�� H���X����
��1��3��������f���SH�����H�{ H������H�G�H������H�{0H������H�/�������H�SH��[H��@��ff.���SH�����H�{ H������H�G�H������H�{8H������H�/�������H�SH��[H��@��ff.���SH���C��H�{ H������H�G�H������H�SH��[H��@�����SH�����H�{ H���|��H�G�H���c��H�{(H���|��H�SH��[H��@��f.���ATUSH��H��0H�(dH�%(H�D$(1�H���J��H�CH�|$1ɺ�	�D$H�D$���H�T$(dH3%(u	H��0[]A\��2��f���USH��H��(H��H�w�F��H���m��1�H�{��H�����H���=��H��H��1�H��[H�=�)]����f�AUL�-5)ATI��UH��SH��H��H��~,I��uPH�{ ����������H+1�H��[]A\A]�H����]�OH�����H�nL�-�(H+.�I�t$�H�H��v�H�sL�CH)�H�M����H�SH�?M��I��H)��1��H�CH��tzH�sI����L�����H��H��t\H�H���t.H�xu'H�pH�~���tL�H M�QA�����H��W H�5�+H�:���H�m��������H��tH��W H�5>(H�:�z�������1�����H��L���`����u�H�{H��������u�H�{L�������� ����H����������H���u��H�oW H�5�'H�8������p���H���h�����`���H�{ �'�����6���H�} �&��I��H��x<H�CL�H;Cw9H�H�]1�L�k�L�mM������H��D$����D$�����-��H��t%�#��L��V L��1�H�5*I�8������L�[L+[M�y���@AWAVAUATUSH��xH�4$dH�%(H�D$h1�H����L�l$I��H��I�} ���H�D$(H����I�~8H�4$1�1�����H��H���[H�C�����H�KI�v0H��A��H����H�s L�{M�U L|$XH�t$�~D$L�fl�H�t$ )D$M��~AH�t$H�L$ H9��9I�FH)�M��I�~L�T$L��H�p�P0L�@I��������H��?H�t$H�L$ A���H9�wUA��H�+uH�����E����I�} ���H��t{H�|$(H����H�T$hdH3%(u}H��x[]A\A]A^A_�I�V I�~H�����L�������u%H�t$H�L$ A��H9�s�H��L��������n���H�+uH�����H�|$(H��tH�/tlI�} ���1��s����b��H�/�d���H�$���H�$�R���H�|$P�*���M���!����I�~8H�4$H��1�H�*%����H��� ����v���L�
T H�P1�H�5 (I�9�x���N���H��������H)�H9�YH�1����I��H���&���I�V0H�x I�v(�j��I�~0H�SH�s H��V��H�+uH�����I�F0L������������1�1��5���l���I�V I�~H��L���}���L�T$����������H��?A������|���f���UH��H��SH��(dH�%(H�D$1�H�F�������H�
HS 1�H��L�D$H�5?'���������H�|$E1�H�t$�����������H�<$�]���H��H����}��H���]��H�<$�}���H���a��H�]0H�U(H��sV���vH��t�8@�}(����H�D$H�EH��R H�H�|$dH3<%(�oH��([]�f�L�L�]0I��L�M(L�T�L�T�L)�H�H)�H��H��r�H�s�H�A�H��H����I�I9��y���H��tyH��t^H��tLH��t:H��t(H��tH����N�O�I��N�O�I��J�K�I��J�4K�4I��J�K�I��J�<K�<I��I9������N�O�N�TO�TJ�\K�\J�tK�tJ�T K�T J�|(K�|(N�L0O�L0N�T8O�T8I��@I9�r������M(�t��t����H�xA�I�{�.���D�D�fD�D��i������ff.����UH��H��SH��8dH�%(H�D$(1�H�F�������H�\$E1���H��蕾���������t$@������H�{H�s ���H������H�}(H���+���T$H�E(H�pP H�LH�H�MH�L$(dH3%(uH��8[]��߿��ff.�@��SH��H�5"!H��������Q��H��H�5!�r���H��H�@H��uH�=�\ �ڽ��H��tH�X[�H�{�Ѕ�t��&���!��ff.���1��f���1��f���1��f���AWAVAUI��ATUH��SH��H��H��dH�%(H��$�1�H������f�)D$ )D$0)D$@)D$P)D$`H�����H�����H�����L�d$ H�}1�L��臽��A�ƅ������CL��追��������H���-H�l$pH�\$ L�|$0L�U L��L�$�޽��M�U0L�$HDŽ$�M���%��H�$�~$J�;H��$�fl�L�$�)T$pH9��I�EI�}L�$L��H�|$H��H�p�P0L�$H�pH������5��L�\$pH��$�I��E����I9��0��H�} �T���I��H���.��L9�����H��$�H���X��H�|$(tL�����H��$�dH3%(L����H��[]A\A]A^A_�f�L�EH�5�M I�xH9�����裼��������H�}貽��A�ƃ��������I���I��I��E���;����L9�����H�} 莺��I��H��t:L9�����H��$�H������H�|$(�B���H�|$ �&����3���謼���-�����AUH�
3R ATUH��H��H��SH�gH��dH�%(H�D$1�I��H�$軽�����z��1�H��0H��H���c��H��H�5���H��H���B��H�Y H9E�Z��L�eL�,$H�C0L�cM��uGH�C I�D$8H����H�m��H�L$dH3%(H����H��[]A\A]�@�H�=�L��H���A��A��E��t_H�=�L��H���A��A��E��uMH�C I�D$8H���|���ff.�f�I�t$H�{�Ѕ��\�������H�C �H�5mL���7���������H�C ������)��ff.���AUH�
�P ATUH��H��H��SH��H��dH�%(H�D$1�I��H�$�������G��1�H��0H��H���0��H��H�5R�=���H��H�����H�jW H9E�'��L�eL�,$H�C(L�cM��uGH�C I�D$ H����H�m��H�L$dH3%(H����H��[]A\A]�@�H�=4L��H���A��A��E��t_H�=L��H���A��A��E��uMH�C I�D$ H���|���ff.�f�I�t$H�{�Ѕ��\����e���H�C �H�5�L��臹�����`��H�C ��P������ff.���AUH�
�N ATUH��H��H��SH�LH��(dH�%(H�D$1�L�L$L�D$H�D$�S������,��1�H��0H��H�����H��H�5�腸��H��H�����H��U H9E�*��L�eH�T$L�l$L�cH�S8H�H�C0M��u?H�C I�D$8H��ueH�m��H�L$dH3%(H����H��([]A\A]�H�5{L���S�����t9H�5oL���@�����u0H�C I�D$8H��t�I�t$H�{�Ѕ�t��"��H�C ��H�53L�����������H�C ��Ʒ��������AWAVAUATI��UH��SH��H��H��dH�%(H��$�1�H������f�)D$0)D$@)D$P)D$`)D$pH����H������H������H�}H�t$01�H�t$�������H�|$�C�N���������H����H�}H;=iG ����L�GA������H��$�H���Y���I��H���&��H��蕵��H;�$�����H�=��L��L�T$@�L�L$0L�T$A��A��E����H�5�L��L�L$A�茶��L�L$����H�|$����L�l$H��$��/H�D$@L�L$0H�D$H����H�D$A�H��$�H�} L�L$ 臵��M�D$H�\$HDŽ$��~L$ L�L$ H��$�fl�I�)�$�M�p8H��$�M���L�T$I��L�T$ I9���L��$�H�] L��H�|$ ���M�\$H)�I��H��L��I�sA�S0I��H���H��I���������H���^�������H��$�H��$�L�H��$�H9�r�H�} 譲��I��H������H��$�H�����H�l$H��H�������蓵��I��H�����L�`H�|$詵��H���f��H�|$8I�E t
H�|$�
���H��$�dH3%(L����H��[]A\A]A^A_�I��H��H��H��A�H��$�L�lI 1�VH��jj蝴��H�� H��H���8��E1�H�|$8t�L�D$0L�D$�o���H�} 誱��I��H����H��$�H�����H�D$H��H�������萴��I��H�����L�`H�|$覴��H���c��I�E �z���I�pH��$�A�օ�����L��$�H��$����H�������H���ubH��$�I��L+�$�I��u���H���\�������H��$�H��$�L�H��$�H9���������ff.�H�����H�
GC H�5�H�9�������ff.�H���u����A��[���H�5L��A��Ų��L�L$���9�������莲���������6���Y���,������`��ff.���ATH�
H UH��H��H��SH��H�� dH�%(H�D$1�L�L$L�D$H�D$�u������%��1�H��0H��H�����H��H�5�觱��H��H�����H��N H9E���H�UH�L$L�d$H�SH�K0H�H�C(M��uOH�C H�sH�F H��u'H�m��H�L$dH3%(H��u}H�� []A\�H�vH�{�Ѕ�t��W��H�5�L���e�����tH�5�L���R�����uH�C �H�C �|���H�5^L���(���������H�C �X���������f���AWAVAUATUH��H��SH��H��dH�%(H��$�1�H������H���t��H���j��H���a��L�mE1�H����I�u�������H�k(H����I�EA�} �2��M�}H�C L�cH�D$L�d$L�cL�|$H�D$0E����M�EM����f�L�l$@D$hA�E H�D$H��L�D$P��A��A��D�t$,� ������@����H��������?M�}0L�|$ I9��5��K�t1��ү��H�D$pH��� ��L�@H�p L�L$PH�t$XJ�<H�|$`L9L$H�>L�|$@H��I�t$I�M0M�WjD��APM�GARH�|$8A�T$H�� H������H�t$XL�|$pM�_ L)�I;w����H�|$p�O����������H�|$hL�t$HH������L�|$pM������H����L;t$���I�m����H�|$��H��$�dH3%(L���xH�Ĩ[]A\A]A^A_�ff.�H�UH�5�> H�zH9������ӭ��������H�}���A�ƃ�������Z���L�D$H�|$A��)f��L�l$@L$hA�E H�D$H��L�D$P�����T$,� ������@�V��I��������?I�u0H�t$ M9��V��K�t1���H�D$pH���A��L�XH�p L�L$PH�t$XJ�H�L$`L9L$H�XL�|$@H��I�t$M�GAVASAPM�GH�L$@�T$LH�|$8A�T$H�� H������I�D$(H�t$XH������A������H�L$`L�t$@H�|$M�~H)�L��I�t$��H����������f��L�l$@T$hA�E H�D$HH�D$P������T$,� �����@�'��I�u0E1�H�t$ K�t1��׬��H�D$pH���%��L�XH�p H�t$XN�L�L$`L�L$PL;L$H~@L�|$@H��I�t$I�OAVM�GASQH�L$@�T$LH�|$8A�T$H�� H������H�t$XI�D$(H����������1�1�E1��H���I��M������H��t�H�m�	��L;t$�/��I�m��H�|$�������ff.�H�EL��H�|$@H�l$@���L�l$@M���z��H�D$H�{(H��tH�C(H�/�:��A�} yRI�UH�s H�KH�L$L�cH�T$H�t$0E���.���L�D$����ff.�E1����#��������	�����@��AWAVAUI��ATUH��SH��H��xdH�%(H�D$h1�H������H�������m���H������H�l$L�u L���3���H�{81�1�H�D$(H�5��v���I��H���+��H�x�������L�hH�C0M���D$H���V��I�w Ll$XH�4$�~$J�.H�L$ fl�)D$M������H9���H�CL�cH��M��L��L��H�p�P0H�PH������*��H�L$ H9L$����I�/����L���|���H���t��H�|$(H��uYH�L$hdH3%(uDH��x[]A\A]A^A_�f.�I�/�u��H�} �-���H���%��H�|$(H��t��8���p����.��ff.���AWAVAUATI��UH��H��H��SH��dH�%(H��$�1�H���!��H����H�����H������L�7H������I�F�������A�~ �-��L�}M�nI�G H����H�D$A�V �f�I�vL�t$0D$XA�n H�D$8@��H�t$@���� �k����@���I��������?M�v0L�t$L9�����H�t61�耨��H�D$`H�����L�H H�@L�L$HI�L�L$PL�L$@L9L$8�DL�t$0H�|$hH����H�|$ M�VI�wM�FjPARH�L$(A�WI��H�� H���a��I�G(H���!L�t$`H�t$HM�V L)�I;v�=��H�|$`����������H�|$XH���o��L�t$`M������H�|$����M��������(���H��H������L�pL���@���H������H�C H��$�dH3%(H����H�Ę[]A\A]A^A_��H�D$�I�wH�|$h�Ѕ��M��L�}A�V ���(����x��I�G(H�������H�T$hL�t$0H�T$ff.�f�I�nH�L$PI�wH��H+L$HH�|$��H��������1��fDI��H��A�L��; 1�H�L$xQL��jj踦��H�� H��H�������W���>���ff.���AWAVAUATUH��SH��H��xdH�%(H�D$h1�H�F�������L�o(M�����F H����{��L�fH�w L�GL�D$L�wH�t$M������f�H�\$0��D$XA��L�d$@H�D$8A��D�$� �����@�Q��I��������?L�S0L�T$M9�����K�t$1�胥��I��H�D$`H���	��H�xH�p L�L$@H�t$HL�<>L�|$PL9L$8�CL�|$0H��I�vH�K0I�WjM�GWH�}R�T$ A�VH�pH�� H��������L�t$`H�t$HI�F H)�I;v�5��I�0�������+��L�D$XL�|$8M������L�t$`M�����M9��k��H�+����H�}01�1�L��H�5�: �F���I�.����H������H�(����H��4 H�H�L$hdH3%(�YH��x[]A\A]A^A_�I�EH�|$0L�l$0�W���H�L$0H��H���W��E1�H�}(H��tH�E(H�/�j��M��H��M��{ ��H�M L�ML�cL�L$L�uH�L$M��M����f��H�\$0L$X�S H�D$8��L�T$@���ƃ��4$�� ������@�<��L�K0L�L$I��������?M9���1�K�tL�D$ �c���L�D$ H��H�D$`����L�PH�p L�L$@H�t$HJ�<H�|$PL;L$8~LL�|$0H��I�vM�GjARAPM�G�T$ H�L$0H�|$(A�VL�D$@H�PH�� H���������H�t$HL�|$`M�O L)�I;wtH�|$`L�$�ҡ��L�$�����H�|$XL�|$8H����L�t$`M��� ��M��u\M9��=��H�+��M���x��H�}01�1�L��H�5�8 ����I�.t_H������H�(�x��H�t2 H�����I�(u��g��E1�1�1�L�$E1�����L�$I���l���E1������̡���k������
���C������,��f.�@H�=9@ H�2@ H9�tH��1 H��t	�����H�=	@ H�5@ H)�H��H��H��?H�H�tH�}1 H��t��fD�����=�? u+UH�=b1 H��tH�=, ����d�����? ]������w������ATH�S7 H�
�8 UH�=�= SH�< H��@dH�%(H�D$81�H�a: H�\$�~D$H�D$H�D$0D$H�L$�~L$H�T$)D$L$)L$ ������'����H�=�4 ���I��H���
��H�l$H��轝��������H�H�sH��L��H���^���H�]H��u�蠞��H������H�L$8dH3%(L��u	H��@[]A\��֟����H��H���strictignorereplacepending buffer overflowillegal multibyte sequenceincomplete multibyte sequenceinternal codec errorunknown runtime errorsOnnsarg must be a sequence objectpending buffer too largeNNireadlinesarg 1 must be an integerreadreadlinetupleargumentsetstateintmultibytecodec.__map_*argument type invalidcannot delete attributeerrors must be a stringcontiguous bufferargument 'input'decode|s:IncrementalDecodercodec is unexpected type|s:IncrementalEncoderO|s:StreamReaderembedded null characterstr or Noneargument 'errors'O|s:StreamWriterencodegetstateresetstreamhow to treat errorswritewritelines__create_codecinputfinal_multibytecodecMultibyteStreamWriterMultibyteStreamReaderMultibyteIncrementalDecoderMultibyteIncrementalEncoderMultibyteCodecencoding error handler must return (str, int) tupleposition %zd from error handler out of boundscouldn't convert the object to str.decoding error handler must return (str, int) tuplestream function returned a non-bytes object (%.100s)SO!;setstate(): illegal state argumentinteger argument expected, got floatcouldn't convert the object to unicode.can't initialize the _multibytecodec moduledecode($self, /, input, errors=None)
--

Decodes 'input'.

'errors' may be given to set a different error handling scheme. Default is
'strict' meaning that encoding errors raise a UnicodeDecodeError. Other possible
values are 'ignore' and 'replace' as well as any other name registered with
codecs.register_error that is able to handle UnicodeDecodeErrors."encode($self, /, input, errors=None)
--

Return an encoded string version of `input'.

'errors' may be given to set a different error handling scheme. Default is
'strict' meaning that encoding errors raise a UnicodeEncodeError. Other possible
values are 'ignore', 'replace' and 'xmlcharrefreplace' as well as any other name
registered with codecs.register_error that can handle UnicodeEncodeErrors.reset($self, /)
--

setstate($self, state, /)
--

getstate($self, /)
--

encode($self, /, input, final=False)
--

reset($self, /)
--

setstate($self, state, /)
--

getstate($self, /)
--

decode($self, /, input, final=False)
--

reset($self, /)
--

readlines($self, sizehintobj=None, /)
--

readline($self, sizeobj=None, /)
--

read($self, sizeobj=None, /)
--

reset($self, /)
--

writelines($self, lines, /)
--

write($self, strobj, /)
--

__create_codec($module, arg, /)
--

;4Ex���PH���x����D����K���m��� ����4ٗ��l#����_������r�����,:����	�������t������������E���Hv���x�����Τ��I���l^���+���@Ϧ������	����P	����d	����D
����
������������(���`���X
������������t��������(���8��D���h��,���\���X������((����������xX���(��0	����	����	����	����	X��l
���
���,8�����<�����
�� ����zRx�$ ����FJw�?:*3$"Dȏ���\p���<E�vx$��EE�d
GzRx�� X����(���7���"�E���"4S���JF�D�D �i
ABBJAB48e���JF�D�D �i
ABBJABpw���<������E�G0�A(����~B�D�A �sAB$�f���uA�A�D lAA�����SgZt����B�E�E �E(�D0�A8�D���L�A�E�Q�
8A0A(B BBBG��L�E�D�M�$zRx��������$,N����V�L�M�B�U�d������B�B�E �I(�D0�D8�G`�hMpExB�W`�hGp[hA`�8A0A(B BBB@{���	$Tp����E�A�A �AAH|����dF�B�B �B(�G0�A8�D�A8A0A(B BBB���UE�GT�1g�4��UE�G�����1g(d��9E�k�����SXt��FE�x���;\
J0����nF�A�A �GPU
 AABAzRx�P���$����{$����^E�A�K wIHzRx� �� ՝��PCA8T���|B�I�D �D(�G@j
(A ABBAL����'B�B�B �B(�A0�A8�D�b
8A0A(B BBBA(�B����F�D�D ��AB4���F�D�D �z
GIEACB(DX��tE�G�D@�
AAJzRx�@�� ���<(�|���E�G�DP�
AAAzRx�P�� �������eE�K
A�@���(0I����F�A�A ��AB\��p�������L�����F�B�B �E(�A0�D8�M��
8A0A(B BBBC$zRx��������$,[���rV�^�E�B�I�88����F�I�A �J(�K@�
(A ABBEzRx�@����$I���}8�$���F�I�A �J(�K@�
(A ABBEtv���}8����F�I�A �J(�KP�
(A ABBAzRx�P����$����`h	���UF�B�B �B(�D0�D8�M�&
8A0A(B BBBAG�^�E�B�I�$zRx��������,b���T0
T��wF�H�J �K@�
 AABAzRx�@���$N���z�p
l���F�B�B �B(�A0�G8�J�]�O�E�F�N��
8A0A(B BBBO��K�B�B�[���K�F�A�W�$zRx��������8,���[��[�B�B�I���F�I�A�\�L`L���F�B�B �E(�A0�D8�G�@
8A0A(B BBBK$zRx��������,�����t�p��"F�B�B �B(�D0�J8�G�0�U�A�B�P��
8A0A(B BBBH��U�E�B�I�$zRx��������8,ϭ�����B�A�B�P�l�H�I�B�Z�t�����F�B�B �B(�A0�D8�G��N�E�E�P��
8A0A(B BBBA&�J�B�B�c�$����2��F�J�A�Z�0h
t�
F�O�H �K`�
 AABAzRx�`���$��GNU���P��� V�/�V�/�V�\�V�\�Ufv�'
���� �� ���o`��
X�  � ��	���o���o����o�o����ov� ( (0(@(P(`(p(�(�(�(�(�(�(�(�()) )0)@)P)`)p)�)�)�)�)�)�)�)�)** *0*@*P*`*p*�*�*�*�*�*�*�*�*++ +0+@+P+`+p+�+�+�+�+�+�+�+�+,, ,0,@,P,`,p,�,�,�,�,�,� �� �a��w�����~� ���e�Ԑ�nЗ��2��a�Pp����Pf��Ԑ`lp���1P��8��p�������@�`����?� ��`a�/��2=B"��06�P�0�<�8;���:ЙG��o`�b����������� �� a��� �/��/�� a�� �6�r�8�dDa2`� � �� 0p }��@�dD2� �� ��  p@v��8PeD�1� �� @p�r��0�eD�1`� �� �a�t֒:� GA$3a1�'��_multibytecodec.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug�ܢl�7zXZ�ִF!t/���]?�E�h=��ڊ�2N��WU� ��*o��+�,�Ů؋<�t�Iƒ%������k�Y+�s^�==~�t:�C沼T�A(��eQ=��J�Io��־�C�Z���eL2͉��{��*��l�p���~�_���l�Y��0Y�i)B��>ϓ����s^}y�yb˞FVƛ�t��m��h�r��]+oj�TrE�$i�#�Rl��� ���\�/��ީ�_
��5��ȴ�&�G\�|D￱�Oq袐mf'L��r�`4PmT��
R�l
T�~�]Z�D#ۍ��QA��v,�\��d�K
�t�
�5�a�#��9�Nq`�%�����G��z�pݕ��"@�$%��6ۖ���\|����*8��[3g�nMʡ��,�hj��x;�V�7Z6g�9�'Z_W}�I&H�AF�%�N�!��%�[ւ=Q��S�C�=#�y��I�C`���=V�d�]���4��RF��q�B�H��kfb�§�&��ƭ���c^��	����U�	��i�OD�.����_�qT�z��s�J���ABfRq{�L��x�%VۡKQ�*¶f��<��*ln1Ǒ[@�7�#IXҥ�
�vO+%;�ٳ����?�M��8 ��EZ-����M�x�~�ʇ�>��55���
��E�9p_`
}����W�҇�6x�h~[�
�E$(,�	�˜ԓTB�d@	�������J�LF�݈�cx�`DOY�喓�ח�L��+vz��@)h"�FZC�ц�7�UZ���R��
�iF�,�2�7�In
��F��ݙݰ�
�`�%t�c���F��Ξ���<b)����Ru�%R�5Gu��ʰ�c.cx��_�A����*�kd)o7U�WFN�)o!6�@\�"��y���0�����ϧ���V �Tk��DU��ܝ���k�eD#��Xk�\Y��aʐ���>z�LȯV���%��[�!��1�Ppo�%�i��U$��aO�.�EI�۹�8���q��6r�d0�JÓ�à
I�i2KDszW���n�v&�P!d�N(+��\cs��W�t��|2Z�@��v�HȘ�o2�Yi�`��퉕Z�����aN�)6���z�&`c��h'�*�	�&���4���3ݽ^�,g���a/�u�s�oV�򜡾}zOӡ�±���VtWSwB'��$2�k���s�,*{�t���n��h�S��㴟1�\ef#j��>ղ�}x-?�4V��K��}��D�i�**�R�2W[XgϞH^��;4ؖe�%�j�?E�?��K��x��m�@"�qɰ�F�&�K��U�oB���t/�,���5O���Kr�a��t�&r'���4$��zC�܎1/�9:>���w�Y��+ c�'*:�c�f�8�(%���o)�\��7"��3��r��H��F��]�d�z�G��һڕ��ߧy\�rξAcd��
�������#�ܐ�&��z�:͉&[����Bk�_|�Vp�ީkc�J�~��v/&`��h���:���	��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(���0��X8���o���E���o��PT���^B� �  h�'�'c((�n�,�,�w�1�1^}����
������
 �����4������
����� ��� ����� ����� ����� ��� ���� �  � �  ��(�` �$
D�h��8��(lib-dynload/termios.cpython-38-x86_64-linux-gnu.so000075500000066240151153537510015603 0ustar00ELF>�)@`e@8	@�D�D �L�L �L HX �L�L �L 888$$�D�D�D  S�td�D�D�D  P�td�B�B�B\\Q�tdR�td�L�L �L ``GNU"q-�(n-� �8���
�&�B &()��|CE���qXE�JK�7 p��F^c �T�, �F"�}�!-����8���'�����_ v�_ }�_ p0�__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6PyArg_ParseTupletcflowPyErr_SetFromErrno_Py_NoneStruct__stack_chk_failPyObject_AsFileDescriptortcflushtcdraintcsendbreakPyExc_TypeErrorPyErr_SetStringPyList_SizetcgetattrPyList_GetItemPyLong_AsLongPyErr_OccurredPyErr_FormatPyBytes_SizePyBytes_AsStringcfsetispeedcfsetospeedtcsetattrcfgetispeedcfgetospeedPyList_NewPyBytes_FromStringAndSizePyList_SetItemPyLong_FromLong_Py_DeallocPyInit_termiosPyModule_Create2PyErr_NewExceptionPyModule_AddObjectPyModule_AddIntConstant_edata__bss_start_endGLIBC_2.2.5GLIBC_2.4f ui	�vii
�ui	��L �1�L p1�L �L P $2P 7.P �> P 2(P �+8P =@P 2HP (+XP @<`P �1hP �*xP �;�P �1�P .*�P �:�P �1�P �)�P �9�P 14�P <2Q @2Q D2 Q I20Q N2@Q S2PQ X2`Q ]2pQ b2�Q h2�Q n2�Q t2�Q z2�Q �2�Q �2�Q �2�Q �2R �2R �2 R �20R �2@R �2PR �2`R �2pR �2�R �2�R �2�R �2�R �2�R 3�R 
3�R 3�R 3S '3S 13 S :30S C3@S M3PS T3`S Z3pS a3�S g3�S n3�S u3�S |3�S �3�S �3�S �3�S �3T �3T �3 T �30T �3@T �3PT �3`T �3pT �3�T �3�T �3�T �3�T �3�T �3�T �3�T �3�T �3U �3U 4 U 40U 4@U 4PU 4`U 4pU #4�U '4�U +4�U /4�U 44�U 94�U >4�U C4�U I4V M4V Q4 V U40V Y4@V ]4PV a4`V g4pV n4�V t4�V {4�V �4�V �4�V �4�V �4�V �4�V �4W �4W �4 W �40W �4@W �4PW �4`W �4pW �4�W �4�W �4�W �4�W �4�W �4�W �4�W �4�W 5X 5X 5 X 50X 5@X %5PX +5`X 05pX 65�X ;5�X A5�X H5�X O5�X U5�X [5�X `5�X i5Y r5Y z5 Y �50Y �2@Y �5PY �5`Y �5pY �5�Y �5�Y �5�Y �5�Y �5�Y �5�Y �5�Y �5�Y �5Z �5Z �5 Z �50Z �5@Z �5PZ �5`Z �5pZ �5�Z 6�Z 6�Z 6�Z !6�Z .6�Z <6�Z @6�Z E6[ M6[ S6 [ Z60[ b6@[ h6P[ o6`[ v6p[ }6�[ �6�[ �6�[ �6�[ �6�[ �6�[ �6�[ �6�[ �6\ �6\ �6 \ �60\ �6@\ �6P\ �6`\ 7p\ 
7�\ 7�\ %7�\ -7�\ 77�\ @7�\ I7�\ R7�\ ]7] f7] p7 ] y70] �7@] �7P] �7`] �7p] �7�] �7�] �7�] �7�] �7�] �7�] �7�] �7�] �7^ 8^ 8 ^ !80^ 48@^ C8P^ Q8`^ ^8p^ h8�^ v8�^ �8�^ �8�^ �8�^ �8�^ �8�^ �8�^ �8_ �8_ �8 _ �80_ 9@_ 9P_ 9�_ (9�_ �@�_ P �O �O �O �O �O �O �N �N �N �N �N �N O 	O 
O O 
 O (O 0O 8O @O HO PO XO `O hO pO xO �O �O �O �O �O  �O !�O "�O #�O $�O %��H��H�a* H��t��H����5:) �%;) ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h�������%5' D���%-' D���%%' D���%' D���%' D���%
' D���%' D���%�& D���%�& D���%�& D���%�& D���%�& D���%�& D���%�& D���%�& D���%�& D���%�& D���%�& D���%�& D���%�& D���%�& D���%�& D���%�& D���%}& D���%u& D���%m& D���%e& D���%]& D���%U& D���%M& D���%E& D���%=& D��H��H��H�ndH�%(H�D$1�H�L$I��H�5�Z�����1���t(�4$�|$�����uH�=6 ����
H�& H�H�T$dH3%(t����H�����SH������1҅�x����[���H��H��H����dH�%(H�D$1�H�L$I��H�5������1���t(�4$�|$������uH�=m5 ����
H�g% H�H�T$dH3%(t�7���H�����H��H��H�P���dH�%(H�D$1�H�L$H�5�?�����1���t%�|$�^�����uH�=�4 �~����
H��$ H�H�t$dH34%(t���H�����H��H��H����dH�%(H�D$1�H�L$I��H�5�������1���t(�4$�|$�^�����uH�=s4 ����
H�m$ H�H�T$dH3%(t�=���H�����AWH��H�X���H�5SAVAUATUSH��xdH�%(H�D$h1�H�L$L�L$L�D$�1�����t(H�|$H�G���uL��# H�5
I�:�5���1����y���H��u�L�d$ �|$L���r�������H�|$1��^���H�����H�|$��D$ �C���H���{���H�|$��D$$�(���H���`���H�|$��D$(�
���H���E���H�|$��D$,��H���*���H�|$�H�$����H������H�|$�H�D$���I���3���H��H������I�U���u"L�
�" � H�571�I�9������L���`���H�� u�1�M�t$H��L���X���H�HI����tH���P���H��uL������D�E�.�3I�w���tL���U���A�.�H�=0" H�5�H�?����WH��H�� u��4$L���3�����t$�t$L�������t�t$�|$L�������uH�=�1 ����H���
H��! H�H�T$hdH3%(H��t���H��x[]A\A]A^A_���AWH��H����H�5�AVAUATUSH��hdH�%(H�D$X1�H�L$�������L�d$�|$L���#�����uH�=X1 ���I���L�����L��A������� A�����H��H���k1�L�|$A�D�L���D$�"���H���7H��H��H��H���X���H�� u�D$uF�|$'����H���H��H�¾�(����|$&����H����H�¾H�����������I��H�����|$���1�L��H�������|$����L��H������|$�w����L��H������|$�^����L��H�����D���F����L��H���v���D���.����L��H���^����)���H��tI�$uL�������H��L���4����H�MuH����E1�H�L$XdH3%(L��t���H��h[]A\A]A^A_�f.���U��H�=�. SQ���H��H��thH�=X/ u1�1�H�=��F���H�?/ H�8/ H�5wH��H�����H�5  H��t!H�  f�H�SH��H������H�3H��u�H��Z[]ÐH�=�. H��. H9�tH�� H��t	�����H�=�. H�5�. H)�H��H��H��?H�H�tH�� H��t��fD�����=m. u+UH�=j H��tH�= �����d����E. ]������w�����H��H���O&i:tcflowO&i:tcflushO&:tcdrainO&i:tcsendbreakO&iO:tcsetattrO&:tcgetattrtermios.errorB50B75B110B134B150B200B300B600B1200B1800B2400B4800B9600B19200B38400B57600B115200B230400B460800B500000B576000B921600B1000000B1152000B1500000B2000000B2500000B3000000B3500000B4000000CBAUDEXTCSANOWTCSADRAINTCSAFLUSHTCIFLUSHTCOFLUSHTCIOFLUSHTCOOFFTCOONTCIOFFTCIONIGNBRKBRKINTIGNPARPARMRKINPCKISTRIPINLCRIGNCRICRNLIUCLCIXONIXANYIXOFFIMAXBELOPOSTOLCUCONLCROCRNLONOCRONLRETOFILLOFDELNLDLYCRDLYTABDLYBSDLYVTDLYFFDLYNL0NL1CR0CR1CR2CR3TAB0TAB1TAB2TAB3XTABSBS0BS1VT0VT1FF0FF1CSIZECSTOPBCREADPARENBPARODDHUPCLCLOCALCIBAUDCRTSCTSCS5CS6CS7CS8ISIGICANONXCASEECHOECHOEECHOKECHONLECHOCTLECHOPRTECHOKEFLUSHONOFLSHTOSTOPPENDINIEXTENVINTRVQUITVERASEVKILLVEOFVTIMEVMINVSWTCVSWTCHVSTARTVSTOPVSUSPVEOLVREPRINTVDISCARDVWERASEVLNEXTVEOL2CBAUDCDSUSPCEOFCEOLCEOTCERASECFLUSHCINTRCKILLCLNEXTCQUITCRPRNTCSTARTCSTOPCSUSPCWERASEEXTAEXTBFIOASYNCFIOCLEXFIONBIOFIONCLEXFIONREADIOCSIZE_MASKIOCSIZE_SHIFTNCCNCCSN_MOUSEN_PPPN_SLIPN_STRIPN_TTYTCFLSHTCGETATCGETSTCSBRKTCSBRKPTCSETATCSETAFTCSETAWTCSETSTCSETSFTCSETSWTCXONCTIOCCONSTIOCEXCLTIOCGETDTIOCGICOUNTTIOCGLCKTRMIOSTIOCGPGRPTIOCGSERIALTIOCGSOFTCARTIOCGWINSZTIOCINQTIOCLINUXTIOCMBICTIOCMBISTIOCMGETTIOCMIWAITTIOCMSETTIOCM_CARTIOCM_CDTIOCM_CTSTIOCM_DSRTIOCM_DTRTIOCM_LETIOCM_RITIOCM_RNGTIOCM_RTSTIOCM_SRTIOCM_STTIOCNOTTYTIOCNXCLTIOCOUTQTIOCPKTTIOCPKT_DATATIOCPKT_DOSTOPTIOCPKT_FLUSHREADTIOCPKT_FLUSHWRITETIOCPKT_NOSTOPTIOCPKT_STARTTIOCPKT_STOPTIOCSCTTYTIOCSERCONFIGTIOCSERGETLSRTIOCSERGETMULTITIOCSERGSTRUCTTIOCSERGWILDTIOCSERSETMULTITIOCSERSWILDTIOCSER_TEMTTIOCSETDTIOCSLCKTRMIOSTIOCSPGRPTIOCSSERIALTIOCSSOFTCARTIOCSTITIOCSWINSZtermiostcsetattr, arg 3: must be 7 element listtcsetattr: attributes[6] must be %d element listtcsetattr: elements of attributes must be characters or integerstcflow(fd, action) -> None

Suspend or resume input or output on file descriptor fd.
The action argument can be termios.TCOOFF to suspend output,
termios.TCOON to restart output, termios.TCIOFF to suspend input,
or termios.TCION to restart input.tcflush(fd, queue) -> None

Discard queued data on file descriptor fd.
The queue selector specifies which queue: termios.TCIFLUSH for the input
queue, termios.TCOFLUSH for the output queue, or termios.TCIOFLUSH for
both queues. tcdrain(fd) -> None

Wait until all output written to file descriptor fd has been transmitted.tcsendbreak(fd, duration) -> None

Send a break on file descriptor fd.
A zero duration sends a break for 0.25-0.5 seconds; a nonzero duration
has a system dependent meaning.tcsetattr(fd, when, attributes) -> None

Set the tty attributes for file descriptor fd.
The attributes to be set are taken from the attributes argument, which
is a list like the one returned by tcgetattr(). The when argument
determines when the attributes are changed: termios.TCSANOW to
change immediately, termios.TCSADRAIN to change after transmitting all
queued output, or termios.TCSAFLUSH to change after transmitting all
queued output and discarding all queued input. tcgetattr(fd) -> list_of_attrs

Get the tty attributes for file descriptor fd, as follows:
[iflag, oflag, cflag, lflag, ispeed, ospeed, cc] where cc is a list
of the tty special characters (each a string of length 1, except the items
with indices VMIN and VTIME, which are integers when these fields are
defined).  The interpretation of the flags and the speeds as well as the
indexing in the cc array must be done using the symbolic constants defined
in this module.This module provides an interface to the Posix calls for tty I/O control.
For a complete description of these calls, see the Posix or Unix manual
pages. It is only available for those Unix versions that support Posix
termios style tty I/O control.

All functions in this module take a file descriptor fd as their first
argument. This can be an integer file descriptor, such as returned by
sys.stdin.fileno(), or a file object, such as sys.stdin itself.;\
��x����������&��� �4������zRx�$x�FJw�?:*3$"D`�\H��H wt��E�X����H w��zH q�|��H wH����F�S�B �B(�A0�A8�D�a8A0A(B BBBH$'�/F�S�B �B(�A0�A8�D�8A0A(B BBB$p��E�M�A yAAGNU��1p1�L Ufv`%
�1�L �L ���o`��
��N `"�	�	���o���o�	���o�o,	���o�L �%�%�%�%�%�%�%&& &0&@&P&`&p&�&�&�&�&�&�&�&�&'' '0'@'P'`'p'�'$27.�>2�+=2(+@<�1�*�;�1.*�:�1�)�914<2@2D2I2N2S2X2]2b2	h2
n2t2z2
�2�2�2�2�2�2�2�2�2�2�2	�2
�2�2�2
�23
333'313:3C3M3T3Z3a3g3n3u3|3�3�3 �3@�3��3�3�3�3�3�3 �3�3�3�3�3�3 �3@�3��3�3�34 4@4�444#4'4+4/44494>4C4I4M4 Q4U4@Y4]4�a40g4@n4�t4{4�4�4�4�4��4�4�4 �40�4�4�4�4�4�4 �4@�4�4�4�4�4��45@5�555%5+50565;5A5H5O5	U5
[5`5i5
r5z5�5�2�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5�5RT�5QT6!T6PT6T!6�?.6<6@6 E6M6S6Z6b6h6To6Tv6T}6	T�6%T�6T�6T�6T�6T�6T�6T�6
T�6T�6T�6$T�6]T�6VT�6T7T
7T7T%7T-7T77T@7TI7TR7\T]7Tf7@p7@y7 �7�7�7�7��7��7�7�7�7"T�7
T�7T�7 T�78 8!848C8Q8^8Th8STv8YT�8ZT�8XT�8TT�8[T�8UT�8�8#T�8WT�8T�8T9T9T9T(9�@��������P GA$3a1`%�1GA$3a1�1�1termios.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug!6)�7zXZ�ִF!t/��'a]?�E�h=��ڊ�2N��?�> ��b�t�q�`7�GFy�#�D�$ą�vg7����|�~&���Y9WI��A:�_��F[��9]lC7�Ǵ����53[����IMnO��<�)1����a���*ASִY;_�y@@C����Tr^�.���9�!^N�����
|-K%ו~��Af	���)-�hzbFu�����4�.�����Sz��%�!Vw۷Õ�:D�Ȟ;1hF�,؇^�G��4�%c+�޴{�GA��`3�ib�ʲ:r����#��fk���T�x�
W�H'[>+J�p�����+�Ϳ���O�tݦ9����|@��_$�&�㴟O��s�����q��[k��'PxB�C�����G��^I.2�ߓ"P�e�ݺ���ۿsc��x�(aе�����^�5=񾊖Z$���_5�A�Ψ��
7<�p0���{b܆�fP����ܝ�RD>�fQ������X{��t�l�����z[��.�|N�9-V����d8+�=�"��\n�mA��M����F�{�����ھ�3�@%�"�`s�8��K��$b�$h���0���(���O�Z�)r���̢���gG[LjrV���+˜�E\��HUlm�i�w�B)��B��0C��@�L��@�����'B���,P	��O�$9�Y��А����u�a\�T<��op�Wu�f�����>�/�33�܋�I6R�V��E�5���ܐ���3l���p ���i�	��|�O���1���B'5�藍���]�LJ�r�
�P*S��E�@0,�D��)�R��c�dIv�Xz�l85���`����z.��TX��<�l�򕸧m�ؙp�(3���*�~{��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(���0���8���o,	,	TE���o�	�	PT�	�	�^B`"`"h`%`%c�%�%n�'�'w�)�))}�1�1
��1�1� ��B�B\��B�B���D�D ��L �L��L �L��L �L��L �L��N �NH�P P� ��_ �_��_`�_H
0``�`�4d(lib-dynload/select.cpython-38-x86_64-linux-gnu.so000075500000102640151153537510015373 0ustar00ELF>�%@`~@8	@papa kk k �� �k�k �k 888$$PaPaPa  S�tdPaPaPa  P�tdhYhYhY$$Q�tdR�tdkk k ��GNU�5����n�rE���Y�G�@ GIJ��|CE���qX���<��O j<��(��h".k�� ��, ���F"��V��<�X����+l]���*}�Z�qL����AJ�@�v��w ��w ��w c�A�__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6_Py_TrueStruct_Py_FalseStructPyExc_ValueErrorPyErr_SetString_Py_Dealloc_PyObject_CallMethodId_PyArg_CheckPositionalPyEval_SaveThreadepoll_ctlPyEval_RestoreThread__errno_locationPyExc_OSErrorPyErr_SetFromErrno_Py_NoneStruct__stack_chk_fail_PyArg_UnpackKeywordsPyObject_AsFileDescriptorPyFloat_TypePyExc_TypeErrorPyType_IsSubtypePyLong_AsUnsignedLongMaskPyErr_OccurredPyLong_FromLongPyMem_ReallocPyDict_NextPyLong_AsLongpollPyList_NewPyTuple_NewPyExc_RuntimeError_PyTime_FromMillisecondsObject_PyTime_AsMillisecondsPyErr_ExceptionMatchesPyExc_OverflowError_PyTime_GetMonotonicClockPyErr_NoMemoryPyErr_CheckSignals_PyLong_UnsignedShort_ConverterPyDict_GetItemWithErrorPyDict_SetItemPyMem_FreePyObject_Free_PyObject_NewPyDict_NewPySequence_Fast__fdelt_chkPyList_SetItemepoll_create1_PyLong_AsInt_PyTime_FromSecondsObjectPyErr_FormatPyMem_Mallocepoll_waitPy_BuildValueclosePyDict_DelItem_PyTime_AsTimeval_PyTime_AsTimeval_noraisePyTuple_PackPyInit_selectPyModule_Create2PyModule_AddObjectPyModule_AddIntConstantPyType_ReadyPyType_TypePyObject_GenericGetAttr_edata__bss_start_endGLIBC_2.15GLIBC_2.4GLIBC_2.3.2GLIBC_2.9GLIBC_2.2.5v`����ii
ri	ii
ui	!fui	!k PEk E k  k 0k +G8k <GPk SHXk [Hpk 9H�k 9H�k eH�k 9H�k eHp #Hp �%p �F`p ,Hhp �?xp �L�p G�p �,�p �K�p *H�p `A�p `K�p �H�p  <�p �Jq 5Hq 2q �S q <H(q �78q `S@q BHHq *Xq  S`q Ghq �'xq @R�q ,H�q �(�q �P�q *H�q U'�q  P�q �H�q 64�q �N�q IH�q �%�q PNr �Fr  &r N@r bGHr �;Xr �T`r �Hhr Axr @T�r bG�r �X�r @r (s Pk 0s �Hhs 0k ps vH�s |H�s �@�t `p Hu �k Pu ,H�u �k �u G�u pk �u *Hv <H8v oHPv 8�v �Hw q w p Xw �2�o �o �o �o �o �o �o �o �o �o !�o (�o *�o 1�o 2�v '�m �m �m �m �m �m 	n 
n n 
n  n (n 0n 8n @n Hn Pn Xn `n hn pn xn �n �n  �n "�n #�n $�n %�n &�n )�n +�n ,�n -�n .�n /�n 0�n 3�n 4o 5o 6o 7o 8 o 9(o :0o ;8o <@o =Ho >Po ?Xo @`o Aho Bpo Cxo D�o E�o F��H��H�9Q H��t��H����5:O �%;O ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&�������h'��q������h(��a������h)��Q������h*��A������h+��1������h,��!������h-��������h.��������h/������h0�������h1��������h2�������h3�������h4�������h5�������h6�������h7��q�������%�K D���%�K D���%�K D���%�K D���%�K D���%�K D���%�K D���%}K D���%uK D���%mK D���%eK D���%]K D���%UK D���%MK D���%EK D���%=K D���%5K D���%-K D���%%K D���%K D���%K D���%
K D���%K D���%�J D���%�J D���%�J D���%�J D���%�J D���%�J D���%�J D���%�J D���%�J D���%�J D���%�J D���%�J D���%�J D���%�J D���%�J D���%�J D���%}J D���%uJ D���%mJ D���%eJ D���%]J D���%UJ D���%MJ D���%EJ D���%=J D���%5J D���%-J D���%%J D���%J D���%J D���%
J D���%J D���%�I D���yH�7J H��H�$J H�����yPH��I H�5�H�8����1�Z�H��H��UH��S1�R�|x*H�|H��tH�DH�u���H��H��@u��E����X[]���SH��H��wH��1�H�5�O 1�[����H�ֹH�=� 1������u���1�[�AVAUATUSH�� dH�%(H�D$1���yH�
I H�5�H�:�V���1������A����L�d$t+�L$�T$�����L���I��D�����L��������5�����L���I���������3����8	u�1�L���n�����yH�sH H�8����1��
H��H H�H�T$dH3%(t���H�� []A\A]A^���SH��H��H��H��dH�%(H�T$1�H��uH��~H��H��u/WA�L�&N H��H�T$R1�jj���H�� H��u1��"H�8�������t�{1ɉ¾�����H�\$dH3%(t�N���H��[���ATI��USH��H��H�� dH�%(H�D$1�H��uH��~H��H��u.PH��A�1�L�:M H�D$Pjj�;���H�� H��H��t9H�;�7����Ń��t*H�SH�5EG H�zH9�uH�
G H�5H�9�V���1��;�=�����u�H�{�p���H�Ã��tA�|$�ى������n���H��t��H�T$dH3%(t�R���H�� []A\���AVAUI��ATUH��SH��H�� dH�%(H�D$1�H��tL�a�H��~H��E1�H��u4E1�PH��A�1�L��K H��H�D$Pjj�*���H�� H��H��tBH�;�&���A�ƃ��t2L�H��tRH�SH�5+F H�zH9�uH�
F H�5�H�9�<���1��@�#�����u�H�{�V������u�k���H��t�ؽA�}��D���p�����H�T$dH3%(t�3���H�� []A\A]A^���Hc��x�E���PH�eE H�5FH�8���1�Z�I�/uL���L���I�,$tvE1��1ҹH��H�=������VH����H��H�uH;5WE H�$H�\$u9A�~(��L�5&E H�5=E1�I�>�$����,L��E1������H�|$�������xaH�|$��]����������H�H��H9�w}H�|$H�$��H��H�����HH��i���H��H�$H�\$�S���L�%LD I�<$���������I�<$H�5XE1��p����xA�~���L�\D H�5FE1�I�8�B����J���HD$H�$�f���M�n E1�����&��E1���h�����u~H�|$�����A�I�~ D��IcvH�����H�߉��_���A�?t�A�F(��yGL�%VC I�<$E1�����I�/�����L���C������4$��A�F(�����Hc����I��H�����������b���H�<$H)�H�|$x����H���@A�F(1��a���I��H���"�{�����AUATI��UH��SH��dH�%(H�D$1�H��uH�}����Ã��u&�H�ֹ�H�=�������u�1���H�}H�t$�����t�Hc�fD�l$����H��H��t�I�|$H������H��H��u&���H��u-����H��A H�8����A������H��H��uH�M�{���H�������NI�|$H��H�����H�MA��uH�����H�uH�����E���:���A�D$H��A H���H�L$dH3%(H��t����H��[]A\A]ù�L��H�=��������H�}�=�Ã����I��~H�}H�t$�N����Hc�D�l$����H��H��twA������H��H��t`I�|$H��H�����H�+t8H�muH��D$�����D$��x5��A�D$H��@ H��H�߉D$����D$�H�+t1��H���z���1��H�{H��tH�/u�_���H��[�f���H�+uH���H���1��AWI��1��AVH��I��AUATI��USH��H���H�H�5fL���v�H���H��E1�A��L9{��H�S���t
H�sJ�,��J�l�H����H�EH��������=�vL��? H�5I�8����A9�Hc��D$DL��M����L$A�I��M	�I��uL�T? H�5�I�;���:I�,$I��I��A�L$�A�D$�A�D$�����1���H�uH����A�E�H�MuH����H�uH�����H��[]A\A]A^A_�AWI��AVI��AUE1�ATE1�U�@SH��Ic�H��L��{x.Hc{�|�A�I���C�����I��O#�I��A��A����Ic�1�E1��
�H��H��u�l��A��Ic�H��M�,7A�}xWIc}�|$��@A�H�NjD$�����I��M��t�I�UI�EHc�H���u��y�H�uH����1�H��H��[]A\A]A^A_�U��1�SQ��0H��H��tK���u���H�����H��C����h�{yH�uH����H��= 1�H�8�0�H��Z[]���UH��SH��APH�~H�5�= H9�uH�l= H�5eH�8���/���u�H���b���t
Y��H��[]�>������H��t�Z1�[]���AVI��AUATE1�USH�� dH�%(H�D$1�H�FH��tL�bI�H�^H��uH��v2QH��E1�L��@ H��H�L$Q1�jj��H�� H��H����M����H�L�-�< H��tAH�zL9�tHL�����u<H�;����u��H�����I��u���H�sH�~L9�uL�
?< H�58I�9�x�1��L���Y��u�H�{�,���u��H��t[�@���t��H�=�; H�5fH�?�,�1��L�����tL��; H�5WI�8��1��+��~�����L���������t̅���I���C�����H�L$dH3%(t��H�� []A\A]A^���AWI��AVAUATU1�SH��H��H��HdH�%(H�D$81�H��tH�iH�H��uH��xH��H��u+PH��E1�L��> 1�H�D$(Pjj���H�� H��H��tEH��tlL�+M��tH��u	�iL�-&; H�SH�5�: H�zH9�uH�
�: H�5�H�9��1��`�����u�H�{���Ń��u�'�H��t�ԃ�L�-�: ���I��A�L�d$yH�=R: H�531�H�?���L;-�: ��H�|$�L���5���y3��H�-: 1�H�}������H�}H�5(�C��H�|$����������H�H9�vH�
: H�51�H�9���kH��LI�E1�H�|$x�I�HD$I���E1����t%��&L�t9 ��1�1�H�57I�8������Lc�Ik���H��H��u"������A����H�|$yC�"�H�$��D���H���A�H�D$��H�<$A�����L�\$A�;t��!��L��H)�H�|$x'���I���E��yH��8 H�8�O�1��[Ic��3�H��H��t�I��E1�L�=0E9�~9A�vA�L��1�I�����H��uH�Mu�H��1��_��
H�UJ��I����H��H�����H�L$8dH3%(H��t���H��H[]A\A]A^A_�ATUS�/1ۅ�x(���������I���}���y���L�������[]A\���USH��Q�d�H�{H������E��yH��7 H�8�R�1��
H��7 H�Z[]���SH��H��q���H�CH��[H��@��H�+t*1��	��H���e�H��7 �EH��q	H���F�1��b	AWAVAUATUSL��$@��H��H�$L9�u�H��dH�%(H��$�1�H;
K7 H��I��I��tH�|$8�H�������y)H��6 H�;�[���tH�;H�5�
��1��H�\$@H�|$8�H���z���t�H�|$@yH�6 H�5%1�H�8����M1�L��$�H��L��$PDŽ$������L��L��DŽ$�A����DŽ$���������Ņ��LH��$�AH��$�L��H�$H�$H�t$���A�Dž��H��$�H�t$PL���������D9�AL�9�M�E1�l$(H��t
�l�HD$8I��H��$�H�|$@H�L$H�l$PH�|$ ��H�D$��H�T$I��H����|$(L��I����H�|$�D$,�;�A�?D�D$,ub��A�Dž�ujH��t����L��H)�H�|$8y+A�L��D��L���H�L��H�|$��H�L��H���H��/H�t$ ����V���E��yL��4 I�:�z�1��L��L��1����H�4$H�|$I������H��H��$�I�����H���:�H��uH��L��L���r�H��M��tI�MuL���l�M��tI�$uL���Y�H��tH�MuH���F�L���z�H��$�A�m�H��$��`�H��$�dH3%(H��t��H���[]A\A]A^A_���H�B�UH��SH��AQH��wH�;H�sH�SH��~-H�K�.��H��H�=v����u���Z1�[]�H�
�3 AX[]�R���1��}f.���AWAVI��AUATUH��SH��H��HdH�%(H�D$81�H����H�����H�6H�����H;5�3 H�\$�g��W(���.��GH�$����M�NM�n M�QE�VE����Ic�L��H����I�F H�����L�l$0L�d$(I�~H�D$ H�l$ L��L��H���������H�|$(���M�^ H�|$0A����M�~ I�~L��L��H��fA�G������H�|$(��I�V H�|$0�B��I�N I�~L��H��f�AL���n���tzH�|$(A��j�I�v H�|$0�F�Y�I�~ f�GI�~L��L��H���/���t;H�|$(�1�M�V H�|$0C�:��M�^ fC�D;I���ff.�@A�FA�F(��A��I��� �I�~ ���IcvI����L����N�A�?���A�F(�����Hc����I��H����������$1�Lc$I�F N�,�L�D$fB�|(����C�I��H�����M�N L�T$Kc<���H�����M�^ I�GC�|+��H���k�I�T$I�G �$L�<�H��9��t���H�L$8dH3%(L����H��H[]A\A]A^A_�ff.�f�A�F(�����$�qHc�L�,�fB�|(����{�I��H�����I�F Jc<(���H�����M�F I�GC�|(���H�����M�L$I�G �$M�<�H��9�������8����v�fD��AUI��H�R�ATI��UH��SH��(dH�%(H�D$1��f�D$H���*�H�>��������I���^�H�}H�t$�������Hc��l$�!�H��H��������
�H��H�����I�|$H��H�����H�+�v�H�m�:����{�A�D$H�D/ H�H�L$dH3%(uH��([]A\A]��p���SH��H� H���H��V�H�{H���J�H�/�@���H��[�����SH�=�2 ��H���.��@H��H�@ �@(�8�H�CH�����H��[�fD��UH��H��SH���+���������Hc����H��H�������H�}H���R�����{���H�+�~���H�8. �EH�H��[]�fD��S��H�=�0 ���H��� ���H��H��- H�5iH��H�H���H�ߺH�5Q���H�=v1 ���������H�5?H������H�5<H�����H�5H�����H�5H�����H�5H���u�� H�5�H���a��@H�5"H���M���H�5H���9��H�5H���%��H�5
H�����H�5H������ H��H�5�����H��, H�=�2 H��2 ����������H��2 H�5H��H��2 ����H�5H������H�5H������H�5�H���m���H�5�H���Y���H�5�H���E��� H�5�H���1����H�5�H������@H�5�H���	���H�5�H������@H�5�H��������H�5�H�������H�5�H������H�5�H������H�5�H������H�5�H���}��H��[��H�=3 H�3 H9�tH��* H��t	�����H�=�2 H�5�2 H)�H��H��H��?H�H�tH��* H��t��fD�����=�2 u+UH�=�* H��tH�=�% �9���d����}2 ]������w�����H��H���I/O operation on closed epoll objectinteger argument expected, got floattimeout must be an integer or Nonearguments 1-3 must be sequencesfiledescriptor out of range in select()too many file descriptors in select()maxevents must be greater than 0, got %dtimeout must be a float or NoneTrue if the epoll handler is closed__exit__timeout is too largeconcurrent poll() invocationmodifynegative sizehintinvalid flagsiItimeout must be non-negativeselecterrorPIPE_BUFPOLLNVALEPOLLINEPOLLOUTEPOLLPRIEPOLLERREPOLLHUPEPOLLRDHUPEPOLLETEPOLLONESHOTEPOLLEXCLUSIVEEPOLLRDNORMEPOLLRDBANDEPOLLWRNORMEPOLLWRBANDEPOLLMSGEPOLL_CLOEXECclosedunregisterfromfdclosefileno__enter__timeoutmaxeventseventmaskselect.epollselect.pollepoll(sizehint=-1, flags=0)
--

Returns an epolling object.

  sizehint
    The expected number of events to be registered.  It must be positive,
    or -1 to use the default.  It is only used on older systems where
    epoll_create1() is not available; otherwise it has no effect (though its
    value is still checked).
  flags
    Deprecated and completely ignored.  However, when supplied, its value
    must be 0 or select.EPOLL_CLOEXEC, otherwise OSError is raised.poll($self, timeout=None, /)
--

Polls the set of registered file descriptors.

Returns a list containing any descriptors that have events or errors to
report, as a list of (fd, event) 2-tuples.unregister($self, fd, /)
--

Remove a file descriptor being tracked by the polling object.modify($self, fd, eventmask, /)
--

Modify an already registered file descriptor.

  fd
    either an integer, or an object with a fileno() method returning
    an int
  eventmask
    a bitmask describing the type of events to check forregister($self, fd,
         eventmask=select.POLLIN | select.POLLPRI | select.POLLOUT, /)
--

Register a file descriptor with the polling object.

  fd
    either an integer, or an object with a fileno() method returning an int
  eventmask
    an optional bitmask describing the type of events to check for__exit__($self, exc_type=None, exc_value=None, exc_tb=None, /)
--

__enter__($self, /)
--

poll($self, /, timeout=None, maxevents=-1)
--

Wait for events on the epoll file descriptor.

  timeout
    the maximum time to wait in seconds (as float);
    a timeout of None or -1 makes poll wait indefinitely
  maxevents
    the maximum number of events returned; -1 means no limit

Returns a list containing any descriptors that have events to report,
as a list of (fd, events) 2-tuples.unregister($self, /, fd)
--

Remove a registered file descriptor from the epoll object.

  fd
    the target file descriptor of the operationregister($self, /, fd,
         eventmask=select.EPOLLIN | select.EPOLLPRI | select.EPOLLOUT)
--

Registers a new fd or raises an OSError if the fd is already registered.

  fd
    the target file descriptor of the operation
  eventmask
    a bit set composed of the various EPOLL constants

The epoll interface supports all file descriptors that support poll.modify($self, /, fd, eventmask)
--

Modify event mask for a registered file descriptor.

  fd
    the target file descriptor of the operation
  eventmask
    a bit set composed of the various EPOLL constantsfileno($self, /)
--

Return the epoll control file descriptor.close($self, /)
--

Close the epoll control file descriptor.

Further operations on the epoll object will raise an exception.fromfd($type, fd, /)
--

Create an epoll object from a given control fd.poll($module, /)
--

Returns a polling object.

This object supports registering and unregistering file descriptors, and then
polling them for I/O events.select($module, rlist, wlist, xlist, timeout=None, /)
--

Wait until one or more file descriptors are ready for some kind of I/O.

The first three arguments are iterables of file descriptors to be waited for:
rlist -- wait until ready for reading
wlist -- wait until ready for writing
xlist -- wait for an "exceptional condition"
If only one kind of condition is required, pass [] for the other lists.

A file descriptor is either a socket or file object, or a small integer
gotten from a fileno() method call on one of those.

The optional 4th argument specifies a timeout in seconds; it may be
a floating point number to specify fractions of seconds.  If it is absent
or None, the call will never time out.

The return value is a tuple of three lists corresponding to the first three
arguments; each contains the subset of the corresponding file descriptors
that are ready.

*** IMPORTANT NOTICE ***
On Windows, only sockets are supported; on Unix, all file
descriptors can be used.This module supports asynchronous I/O on multiple file descriptors.

*** IMPORTANT NOTICE ***
On Windows, only sockets are supported; on Unix, all file descriptors.;$#��@���h(���H���t��������������4���d������������x������0���|��������T��H��T���|��������`U�������������(A�|�����h��h�D������h��zRx�$����FJw�?:*3$"D8���\��� p���,KY$����DA�D�C yAA����DE�X
Ea<����B�B�B �A(�A0�DP�0A(A BBB,����E�M f(V0D8B@I DA<@$���F�D�A �J@gHXPBXB`I@� AABL����#F�B�E �A(�D0�GPrX[`BhBpIP�0A(A BBB����,RYL�����F�B�E �B(�A0�D8�G��
8A0A(B BBBN$zRx��������,R���8t���YF�B�D �D(�D@>(A ABB8���F�I�D �D(�DP�
(A ABBAzRx�P����$���� �?E�uzRx�� A��Xl�JE�DP.��H�/��]B�L�H �B(�D0�A8�DP18A0A(B BBBD�@���B�E�E �E(�D0�F8�DP�8D0A(B BBB$0���gA�E�A ]AA0X+��kE�D�E A
FAEKCAL�b���F�E�B �D(�A0�DPpXV`DhBpIP@0A(A BBB\����LF�E�B �B(�A0�C8�J�r�U�B�B�I��8A0A(B BBB(<���;B�A�A �sAB$h���CE�A�D vAA����"E�T$� �jE�G�D WAAzRx� �� ���?P���HB�B�B �B(�A0�A8�H��Q
GЄ8A0A(B BBB0X���fI�D�E 
CAAIAA����E��p���GNU�PEE k +G<GSH[H9H9HeH9HeHUfvX
\Ek k ���o`�	�
-�m @�0		���o���oh���o�o����oS�k ������� 0@P`p��������    0 @ P ` p � � � � � � � � !! !0!@!P!`!p!�!�!�!�!�!�!�!�!"#H�%�F,H�?��LG�,��K*H`A`K�H <��J5H2�S<H�7`SBH* SG�'�@R,H�(��P*HU'� P�H64��NIH�%PN�F &�NbG�;��T�HA@TbG�X��������@r Pk �H0k vH|H0�@`p �k ,H�k Gpk *H<HoH8�Hq p �2GA$3a1XYEGA$3a1\EiEselect.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug��yP�7zXZ�ִF!t/��w�]?�E�h=��ڊ�2N��4R~ �ړ列νt"wL�,PgZ�a�*����*P��n�MO�)����n�����n�U����I,eC��"�q��V����8�>�p�E�VD�lup�����^��4`N����hh�qNH���Yxj�����X��F�<Ɋ/9 ���htd�A��X�P�3K(Ǝ�2d���Ɖ�Uo��J77�=�5�X�w�>*��h�K��!2��d*�/:,H��t]���
�E���8hC�jc2�!F�[�0iN���<�-n�Lѽ��y_�$$�K1z:�������,V)�r�	f�����^�����I��`����f�a.�3p�(�;Y�k����r/O�u�{C�
"���q@��a����	o�����vE�l�yR�|l@6���������p07F��U���Y)k����fL:yN=���0d�԰���v���~�#N�8�P���Ag���G��4ܧ�z�	:�]�P��)��O�	v6x�{�5Z�}�����ݖ>���0��T1�6�9�]�A�:Aʝ�P+-��*T䦻���(�{WGd���`ڟ���
XO�l��]�3Q�|<Q��So,���r��f�����Q�Y�z��p��Y���ѳ��z���:l��ۅs���x?%�< �����7���y��߲����L��m�����qT3���'4��G2T�bŴ�
6[=�L	&(��$Ӆ�L�@�t�R��3���Xϭ���M�D���R�VKV�S�S��Q��pc�a��Nvg+q�<�"C*/�w�=�q�p��lۋ��eݮ9�ldA���(G`����,5Cr�L��?����Cqpm�LMp�`	b�m �[�g�g0<u������r�ʟ�ĥOJ��Ė�U�Mn���t����l�����A�6�:1���x�5x��3_���g�sK]�����U5����zt܌�N�2�_��ۨ	m��}s}!B�*�R|و�8���(էQ�[��70R��IOBO2~�>��E���O-�9}���8��^5�-c�v�'�ߥ�4��RԊd�/ȉF�1�-�J��Am�K�|��_q��
�r��m=Nw}~[h�~��Xq�y=x���	�&�S�±�g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(��0�	�	-8���o���E���ohh�T��0	^B@hXXc���n""�w�%�%�}\E\E
��E�E� �hYhY$��Z�Z��PaPa �k k�k k� k  k���k �k��m �mH�p p� ��w �w��w`�wH
x`hx�8}(lib-dynload/_ctypes.cpython-38-x86_64-linux-gnu.so000075500000417240151153537510015567 0ustar00ELF>�~@`@8	@���� 0�0�!0�!X@�@ H�H�!H�!  888$$������  S�td������  P�tdȑȑȑ��Q�tdR�td0�0�!0�!��GNU"��x��s�3�$c��S4���%�	��@(�")�$@t�@CN�PVY08�@@�Zh!��������������������������������
�̌�P�6����ͥ:�]���$Q0?�N�5?3��#���Z(k��9��D��s���IU��p-G��J[�,EC9�$��MP^�
�U
pvA�=w��p�B]�Z(�,^��L�!�ö�#vS�O0�r�/��<:Z�o-lo9W��e�B�qX%z-��|�H8f9��̔y"lm�aZ(]��#CE�솎S���W�)�h	.�	h�����@{	�R`�	0� ��?Du�	����
���
r�][��#�
( �x���%!�0
�, ��F"�y
D	T�
l
��C��1��
����z��&Y
�pF����
��
�Y
��
��
O�C
�@"
��
�;�
������
%r[�2Fs��
buV�L#T������/�W	�[���MO�2P��
B3���%puC*��fD
$dϻ�!�	@�!����8�
���Ѳ<!
�"W�7��@�!�g��! �!����!�����	�!��@�!����B����"�����`�!�R �!��@8=9 �!�Ͻ+�w�u�8.m

����!w��!H@�!�	�!��	�!�@��!����!
<)��)	��!�0
8�:^`�!�I��5	e����!���"6`�!��"�@?��	`�!�� �!c�!�W`�!o��!��"����
�<j�
�8:__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libffi.so.6libdl.so.2libpthread.so.0libc.so.6_Py_NoneStruct_Py_DeallocPyDict_DelItem_PyErr_WriteUnraisableMsgPyMem_FreePyExc_TypeErrorPyErr_SetStringPyErr_FormatPyExc_ValueErrorPyDict_NewPyUnicode_AsWideCharPyUnicode_FromWideCharPyBytes_FromStringAndSizePySys_AuditPyExc_AttributeErrorPyObject_GetBufferPyBuffer_Release__stack_chk_failPyDict_Type_PyArg_ParseTuple_SizeTmemmovePyObject_GetAttrStringPyDict_UpdatePyDescr_NewGetSetPyDict_SetItemStringPyUnicode_AsUTF8memcmpPyUnicode_FromFormatPyCallable_CheckPySequence_TuplePyTuple_New_PyObject_LookupAttrIdPyErr_OccurredPySequence_SetItemwcslenPyObject_GC_UnTrackffi_closure_freePyObject_GC_DelPySys_GetObject__vsnprintf_chkPyFile_WriteStringPyErr_PrintPyLong_AsVoidPtrPyCData_TypePyType_IsSubtypePyLong_FromVoidPtrPyCapsule_GetPointer_PyUnicode_IsPrintablePyFloat_FromDoublePyObject_Free_ctypes_ptrtype_cachePyDict_GetItemWithErrorPyUnicode_TypestrlenPyMem_Malloc__sprintf_chkPyCPointer_TypePyObject_CallFunctionPyDict_SetItemPyErr_NoMemoryPyObject_CallFunctionObjArgsPyArg_ParseTupledlsymdlerrorPyExc_OSErrordlclosedlopenPyUnicode_FSConverterPyTuple_Type_PyObject_CallMethodIdObjArgs_PyObject_GetAttrIdPyObject_Call_PyDict_SizeOfPyLong_FromSsize_tPyLong_FromLongPyByteArray_TypePyLong_AsLongPyLong_AsUnsignedLongMaskPyFloat_TypePyBool_FromLongPyObject_IsTruePyLong_AsUnsignedLongLongMaskPyUnicode_AsWideCharStringPyCapsule_NewPyBytes_AsStringPyLong_FromUnsignedLongLongPyLong_FromLongLongPyLong_FromUnsignedLong_PyFloat_Unpack4PyFloat_AsDouble_PyFloat_Pack4_PyFloat_Unpack8_PyFloat_Pack8_PyObject_MakeTpCall_Py_CheckFunctionResultPySequence_FastPyObject_GetAttrPyCField_TypePyObject_SetAttrPyCStgDict_TypePyType_TypePyCArg_Typeffi_type_pointerffi_type_sint32PyLong_AsUnsignedLongPyErr_ClearPyExc_OverflowErrorPyUnicode_FromStringAndSizePyArg_UnpackTuplememsetPyDict_SetItemProxyPyWeakref_NewProxyPyDict_GetItemProxy_PyWeakref_CallableProxyType_PyWeakref_ProxyType_ctypes_alloc_format_stringstrcpystrcat_ctypes_alloc_format_string_with_shape_ctypes_simple_instancePyCSimpleType_TypePyCArrayType_from_ctypePyTuple_PackPyCArray_TypePyCArrayType_Type_PyObject_CallFunction_SizeTPyInit__ctypesPyEval_InitThreadsPyModule_Create2PyModule_AddObjectPyType_ReadyPyCThunk_TypePyCStructType_TypePyCPointerType_TypePyCFuncPtrType_TypePyCFuncPtr_TypePyType_GenericNewPyModule_AddStringConstantPyErr_NewExceptionPyExc_ArgError_ctypes_get_errobjPyThreadState_GetDictPyExc_RuntimeErrorPyUnicode_InternFromStringPyCapsule_IsValidPyCArgObject_new_PyObject_NewPyNumber_AsSsize_t_ctypes_extend_errorPyUnicode_FromFormatVPyErr_FetchPyErr_NormalizeExceptionPyObject_StrPyUnicode_AppendAndDelPyUnicode_FromStringPyErr_SetObjectPyCStgDict_clonePyType_stgdict_ctypes_get_ffi_type_ctypes_alloc_callbackPySequence_Size_PyObject_GC_NewVarPyObject_GC_Trackffi_closure_allocPySequence_GetItemffi_type_voidffi_prep_cifffi_prep_closure_locPyObject_IsInstancestrchr_PyDict_SetItemId_PyDict_GetItemIdWithError_PyObject_SetAttrIdPyCData_FromBaseObjPyCData_AtAddressPyMemoryView_FromObjectPyBuffer_IsContiguousPyCData_getPyDict_NextPyObject_stgdictPyMem_ReallocPy_BuildValuePyObject_IsSubclass_Py_BuildValue_SizeTPyObject_CallObjectPyCData_setPyExc_IndexErrorPySlice_TypePySlice_UnpackPySlice_AdjustIndices_ctypes_get_fielddescPyGILState_Ensure__errno_locationPyExc_RuntimeWarningPyErr_WarnExPyGILState_ReleasememcpyPyThreadState_Get_Py_CheckRecursionLimit_Py_CheckRecursiveCall_PyLong_SignPyLong_AsSsize_tPyErr_ExceptionMatchesPyUnicode_NewPyList_New_ctypes_callprocffi_prep_cif_varffi_call_PyTraceback_AddPyEval_SaveThreadPyEval_RestoreThread_PyObject_CallMethodId_SizeT_PyLong_ZeroPyTuple_GetItemPyUnicode_AsUTF8AndSizePyDescr_NewClassMethodPyUnicode_ConcatPyObject_SetAttrStringPyCField_FromDescPyCStructUnionType_update_stgdict_PyLong_AsIntPyTuple_Size_PyUnicode_EqualToASCIIStringPyObject_GenericSetAttrffi_type_uint8ffi_type_sint8ffi_type_uint16ffi_type_sint16ffi_type_uint32ffi_type_uint64ffi_type_sint64ffi_type_floatffi_type_doubleffi_type_longdouble_ctypes_module_methods_edata__bss_start_endGLIBC_2.2.5GLIBC_2.14GLIBC_2.4GLIBC_2.3.4} ui		r ui		����ii
 ti	*ui		0�! a8�!�`@�!@�!��!����!~���!����!ـ��!q���!̆8�!�P�!S�x�!����!����!���!)��!��!0�!d�8�!��X�!���!���!���!�(�!P{H�! �x�!/���!+H�!��!��!�&�!7� �!C�@�!H���!M���!r���!^���!���!����!�%��![���!%��!?��! �!c�(�!>�8�!�{@�!ɃH�!��X�!�{`�!�h�!@cx�!�{��!���!ӏ��!o���!����!���!����!����!����!@���!����!�0��!���!h��!���!@� �!{~(�!��8�!�@�!��H�!
`�!��h�!m��!���!����!Ç��!"���!͇��!.��!ׇ8�!�P�!�%x�!3��! �!��!���!���!�0�!����!���!���!<���!���!����!����!_���!���!`���!����!����!��!C��!s��!�� �!(�(�!r�8�! �@�!3�H�!���!(���!����! ���!���!����!����!_���!���!`���!����!����!��!C��!s��!��@�!(�H�!2�X�! �`�!�h�!��x�!����!_���!���!`���!����!����!���!C���!s���!���!�`�!<���!E���!U���! |��!c���!P|�!l��!�~ �!��(�!@�@�!�H�!~���!����!�~��!_���!�|��!����!*���!j��!����!����!����!pa��!ˆh�!�~@�!�~H�!��P�!��`�!�~x�!P���!C���!|���!1��!0<��!݈ �!l�(�!���!*���!���!����!L���!�|��!4��!H��!��(�!����!��!� �!��!0�!�8�!�~@�!0%��!����!08�!���!��!��!%���!�~��!0%H�!��X�!0��!:�(�!�!X�!�$p�!�|x�!�)��!�/��!@�!��!��x�!L���!�!��!i$�!�|�!�) �!�/H�!@�!��!�k�!Z(�!Z�H�!j�`�!|�h�!
�p�!�x�!u���!����!c���!ʂ��!|���!|���!=���!��!u�H�!Zh�!���!(���!���!(���!-���!(���!p=��!Z�!��0�!��!T��!�|��!Z��!Z���!l��!��(�!��H�!��h�!����!(���!����!ׇ��!ׇ�!Ɖ0�!�5X�!B�`�! �!��!�N��!��!��!ى��!�'��!�2��!��!8�!�8��!��!�!P�!}��!@�!��!��X�!����!�!�!8}��!�)�!�/(�!@�!x�!�T��!�H�!�!��!`}��!�)��!�/�!��!�!`Q��!ׇ��!ׇ�!-� �!`�!(�!�!0�!��!`�!��!p�!>�x�!�~��!0%��!��!�!3���!��x�!Q��!`�!�!@�!�!��!�!>��!�~ �!0%��!+���!0�!_�0�!p*x�!���!��!��!>���!�~��!0%�!�!�!`�!��!n���!���!`�!@�!��!P�!>�X�!�~`�!0%��! �!��!��!�! .�!0X�!����!�!�!�}("��!x"�X�"ׇ"��0"��"*��"��"��"��"˛"U�8"ݗ@"�h"�dp"@'�"ܣ�"ʣ�"��"ȗ�"���"���"i��"���"r�"#�"ڨ"�("1�0"��@"��H"v�X"/`"I�p"G�x"��"�4�"{��"��"M��"p1�"��"���"���"2�"pd"b�"�"�� "ӡ0"�8"��H"�P"v�`"I�h"F�x"d�"��"�'�"���"��"�"C�"�8"(�@"Œh"��p"f��"s��"Z��"0'�"`'H"b�P"`���!���!��!��!	��!��"��"��"�"�H"��"���!���!���!��!��!���!!��!���!#�!&�!��!/�!2 �!9(�!�0�!@8�!B@�!�H�!DP�!FX�!M`�!Ph�!Tp�!�x�!`��!d��!���!q��!���!w��!���!���!���!���!���!���!���!���!�h"���!���!��"�H"�"��"�x"��"��"�"�x"�8"��"��"�("��"�X"�`"���!��!��!��!��!��!��!	��!
��!��!
��!��!��!��!��!��!�!�!�!�! �!(�!0�!8�!@�!H�!P�!X�! `�!"h�!$p�!%x�!'��!(��!)��!*��!+��!,��!-��!.��!0��!1��!3��!4��!5��!6��!7��!8��!:�!;�!<�!=�!> �!?(�!A0�!C8�!D@�!EH�!GP�!HX�!I`�!Jh�!Kp�!Lx�!N��!O��!Q��!R��!S��!U��!V��!W��!X��!Y��!Z��![��!\��!]��!^��!_��!a�!b�!c�!e�!f �!g(�!h0�!i8�!j@�!kH�!lP�!mX�!n`�!oh�!pp�!qx�!r��!s��!t��!u��!v��!x��!y��!z��!{��!|��!}��!~��!��!���!���!���!��!��!��!��!� �!�(�!�0�!�8�!�@�!�H�!�P�!�X�!�`�!�h�!�p�!�x�!���!���!���!���!���!���!���!���!���!���!���!���!���!���!���!���!��!��!��!��!� �!�(�!�0�!�8�!�@�!�H�!�P�!�X�!�`�!�h�!�p�!�x�!���!���!���!���H��H��d!H��t��H����5Z_!�%[_!��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&�������h'��q������h(��a������h)��Q������h*��A������h+��1������h,��!������h-��������h.��������h/������h0�������h1��������h2�������h3�������h4�������h5�������h6�������h7��q������h8��a������h9��Q������h:��A������h;��1������h<��!������h=��������h>��������h?������h@�������hA��������hB�������hC�������hD�������hE�������hF�������hG��q������hH��a������hI��Q������hJ��A������hK��1������hL��!������hM��������hN��������hO������hP�������hQ��������hR�������hS�������hT�������hU�������hV�������hW��q������hX��a������hY��Q������hZ��A������h[��1������h\��!������h]��������h^��������h_������h`�������ha��������hb�������hc�������hd�������he�������hf�������hg��q������hh��a������hi��Q������hj��A������hk��1������hl��!������hm��������hn��������ho������hp�������hq��������hr�������hs�������ht�������hu�������hv�������hw��q������hx��a������hy��Q������hz��A������h{��1������h|��!������h}��������h~��������h������h��������h���������h��������h��������h��������h��������h��������h���q������h���a������h���Q������h���A������h���1������h���!������h���������h���������h�������h��������h���������h��������h��������h��������h��������h��������h���q������h���a������h���Q������h���A������h���1������h���!������h���������h���������h�������h��������h���������h���������%%U!D���%U!D���%U!D���%
U!D���%U!D���%�T!D���%�T!D���%�T!D���%�T!D���%�T!D���%�T!D���%�T!D���%�T!D���%�T!D���%�T!D���%�T!D���%�T!D���%�T!D���%�T!D���%�T!D���%�T!D���%}T!D���%uT!D���%mT!D���%eT!D���%]T!D���%UT!D���%MT!D���%ET!D���%=T!D���%5T!D���%-T!D���%%T!D���%T!D���%T!D���%
T!D���%T!D���%�S!D���%�S!D���%�S!D���%�S!D���%�S!D���%�S!D���%�S!D���%�S!D���%�S!D���%�S!D���%�S!D���%�S!D���%�S!D���%�S!D���%�S!D���%�S!D���%}S!D���%uS!D���%mS!D���%eS!D���%]S!D���%US!D���%MS!D���%ES!D���%=S!D���%5S!D���%-S!D���%%S!D���%S!D���%S!D���%
S!D���%S!D���%�R!D���%�R!D���%�R!D���%�R!D���%�R!D���%�R!D���%�R!D���%�R!D���%�R!D���%�R!D���%�R!D���%�R!D���%�R!D���%�R!D���%�R!D���%�R!D���%}R!D���%uR!D���%mR!D���%eR!D���%]R!D���%UR!D���%MR!D���%ER!D���%=R!D���%5R!D���%-R!D���%%R!D���%R!D���%R!D���%
R!D���%R!D���%�Q!D���%�Q!D���%�Q!D���%�Q!D���%�Q!D���%�Q!D���%�Q!D���%�Q!D���%�Q!D���%�Q!D���%�Q!D���%�Q!D���%�Q!D���%�Q!D���%�Q!D���%�Q!D���%}Q!D���%uQ!D���%mQ!D���%eQ!D���%]Q!D���%UQ!D���%MQ!D���%EQ!D���%=Q!D���%5Q!D���%-Q!D���%%Q!D���%Q!D���%Q!D���%
Q!D���%Q!D���%�P!D���%�P!D���%�P!D���%�P!D���%�P!D���%�P!D���%�P!D���%�P!D���%�P!D���%�P!D���%�P!D���%�P!D���%�P!D���%�P!D���%�P!D���%�P!D���%}P!D���%uP!D���%mP!D���%eP!D���%]P!D���%UP!D���%MP!D���%EP!D���%=P!D���%5P!D���%-P!D���%%P!D���%P!D���%P!D��ATI��UH��SH�@H��H��uI�|$ 1�H��tH��H��[]A\��H��Ӆ�t�[]A\���H��H����H���H��uH��P!H����H�GH�8�������H�G0���H�GH�8�������SH��H�H��t
H�u��H�{H��t
H�u����H�CH��[H��@����H�wH��tfSH��H�H��tM�M�����u1�H�=���K���H�{H��tH�CH�u���H�{H��tH�CH�u�e���H��O!H�[�H��O!H����SH��H��]���H�CH��[H��@����PH��N!H�5��H�8�!���H��Z���USQH��uL��N!H�5����I�;����H�FH��u!L��N!H�PH�5��1���I�:�b����`H��H�H�nH9o(}"L�
IN!H�5I������I�9���H�u0�&H�v H�H���H9j(~	L�BA�(H��uH���P�����Z[]�USH��QH�k H��tH����H�{@u'H�{0t�s���H��H�C@HD��H��N!H�H�C@H��Z[]���ATUSH��uL�
�M!H�5����I�9����H�FH�����u$L��M!H�PH�5��1���I�8�W����H�I��1�1�H������H��xnI�T$(H��H��H9�vH�= M!H�5%�H��H�?�m����/I�t$H�����H��H��xI�T$(H��H9�vI�L$��H�MuH������H��?��[]A\���H�G(�H�OH�H��1�H9�~�<�uH���X�H������H�GH�W(1�H9�~�<0uH������H������H�w(H������UH����H��S1���H�=b�APH�5V��U�����x%Hc�uH��1�H���H��H�q�YH��[]���Z1�[]���USH��hdH�%(H�D$X1�H��uL��L!H�5	�I�8�1������\H��1�H��H��H���y����xBH�L$H�4$H9M(}#H��K!H�5��H�8���H���U������H�}�H���B���1�H�L$XdH3%(��t���H��h[]���UH��H��H�5��SH��(H�\K!dH�%(H�D$1�H��L�L$L�D$���txH�E(H;D$}H�D$H�}H�T$H�t$�K���H�51�H������H��H��t>H�P��� u5H�uH�=�J!1�H�JH�?H�VH�5P���H�uH�����1��)H�4$H���f�H���uH��������t�H�LK!H�H�L$dH3%(t���H��([]�AUATI��UH��SQL��H�}tTH��L������H��H��t&H�uH��L������H�yH��H�uH���I������H��H�uH���4���H��(�1�Z[]A\A]�H�� �H�>�]�H��I!H�5��H�:�
���1��@���H�W(H�H�5�������H�GH��H�=�H�p1�����UH��SH��QH��t*H���g�����uH�dI!H�5]�H�8������"H�H���H���H��t
H�u�h���1�Z[]�A�I�/twH�m��L�D$�Q�L�L$H�������A���A��H�/�������1����E1��H�������H�/��������L��L�D$����L�D$�r���H��L�D$���L�D$�f���H�rH!H�5��H�;������y�I�|$pH��tI�D$pH�/t{I�|$xH���P�I�D$xH�/�=��T���1��3�L�]��M�c�L�eM����H��D$�)����D$��L��G!I�QH�5&�1�I�:���������{�����AUATUSQH�F���uH��G!H�5�H�:�������-L�fI��H��1�L9�}H�T�H��L���Q������tH����1�Z[]A\A]���UH��H��1�SHc�H�=��H�56�APH���4�����xH���uH�����H��YH��H��[]��Z1�[]���ATI��UH��SH�PH��H��uI�|$XH��u
�H��Ӆ�t��!H��Ӆ�uI�|$`1�H��tH��H��[]A\��[]A\���SH��H�PH��tH�CPH�u��H�{XH��tH�CXH�u��H�{`H��tH�C`H�u��1�[���SH����H�{PH��t
H�u�g�H�{XH��t
H�u�T�H�{`H��t
H�u�A�H�{H��t��H��[��ATI��USH���H��$8H��$@H��$HL��$PL��$X��t@)�$`)�$p)�$�)�$�)�$�)�$�)�$�)�$�dH�%(H��$(1�H�=��H�l$ ���L�L$M��H��H��$0H�ù�H��$H�T$��D$�D$0H�D$��H��tH;�E!tH��H������H��$(dH3%(t���H���[]A\���H��H����H�SH��uH�����H��H�[���SH����H��H�[�������SH����H��H�[�������SH��H�~H�5LE!H9�t!�����uH�?D!H�5��H�8�x��&1�H��H�5��H�=�����x
H�{[��1�[���QH�5���+�H��t	H��Z�=�X�@��x&S��@���z���u1����\��1���'��!�[�1����ATUS�w@��b����H��O@��L�� @��H��@��I��@��B�6�t@��Q��@��Z�@��P��@��htQ!@��d����@��f���ZG �n@��ltC@��it6��@��qt@@��z����W ��S H�=��[1�]A\�d��S ��H�S H�=���H�S H�=����G ��E1�H��H�����sH��H�=w�1���H�MI��utH�����j� ����s��t�S H�=T��n����S H�=Y��^���H�S H�=b��!���M���H��H�=a��s��uH�=f�[1�]A\��L��[]A\��7�H��[�>�H�H���ÙH����H��H����I��1�H��L���H��H�y��H��H����I��H��H�
�L��1����H�
=A!1�H��H�5��H�y���H��H�����H��t9H���h�H��H��tI�}H��H�����uH�muH���m�H�+tG1���H�+���H���N���X[]A\A]���H��@!H�5y�1�H�:�5��H��1���鲘H�mu�H��1���霘��H��@!ATI��USH�vH�8���H��H��t[L��H��]1�1�A\�����H��u3I�t$1��\�H��H��t1�H��L��1��U�H�H��uH����H��[]A\���H��H��H�����dH�%(H�D$1�H��H�5���,���u1��$H�$1�H�5��H�=������x�H�$H�H�T$dH3%(t���H�����SH��H�=���H�5v�H��H�� dH�%(H�D$1�H�L$L�D$����u1��W1�H��H�5��H�=?��z���x�H�t$H�|$�g�H��H��u��H��H�?!H�8���H���>�H��H�T$dH3%(H��t�3�H�� [���H��H��H�����dH�%(H�D$1�H��H�5����1҅�t2H�<$����t�$�H��H��>!H�8��1��
H�w?!H�H�L$dH3%(H��t��H������H��tVH�>>!H��H�:���x�H�/�Z����P�H�t$H������tH�D$H�T$H�X ���1��9�H�����ATH��H�5%�USH�� H�
�>!dH�%(H�D$1�H�T$L�D$����tyH�|$1�H�5�I!1�H�����H��H��tYH�5�I!H���/�H��H��t5H�t$1�H���8�H�MI��uH�����M��tI�$uL�����H�uH����1�H�L$dH3%(H��t�k�H�� []A\Ã��y���SH����H���H��H��u	H��H��1��H��H��H��2�Lc��H�{XJ�<�t	L�K@J�|�[����H��01�����H�(H��H��tH���1����H�G(H��tH�G(H�u
RH�����1�Y�1����SH������H�CH��[H��@����H�����H�����L�GH�G(H�WA��I��H�ptH�=��1���H�=��1�����SH�H��tH�����H��[H����H��<!H�[���H��1�H��H9�}�<�u��H��������n���QH�5�����H��t	H��Z��X���ATUSH�F���u H�
�;!H�PH�5��1�1�H�9�Z��cH��I��H��1�1�H�����H��x(H��H�P�H��H9�}H�=';!H�5�1�H�?��1��H��L��H��H9�HO���H��t�H�H��[]A\���USH��dH�%(H�D$1�H�F���u L��:!H�P1�H�5*�I�8��1��kH�H��H��H��H���=�H�H��t*H��H�uH�����H�=�:!H�5�H�?��1�� �$H�ɉUH�uH����H�;!H�H�L$dH3%(t�V�H��[]���H�H��tH��H��1��H��H��H�q���H��:!H����1�H9�}�<uH���e�H��������R���H�?H��t����H��:!H����QH�F���u L��9!H�P1�H�5��I�8�x�1��_H�� I��H��1�H���I��I��M�Q�L��I9�}L���'I9�~"L�?9!H��H�5u�L��1�I�;�(�1��L��H��9!�H�Z���H�?H��H��H�t�@�����)�)�H��H������H��H�?H��t�@�����)�)�H��H������?H��H���t� �����)�)����Hc��g���H��?H��t� �����)�)����Hc��:���fD�H��fA��H��t���A�����)�)���D��A�A������H���?H��t������)�)�������������fD�H��fA��H��t���A�����)�)���D��A�I������H���?H��t������)�)������H���[���H���?H��t������)�)���@���@���(���H���?H��t������)�)���@���H�������Z������/�\$��D$������UH��SH��QH�~���tH�~u<@�v H��7!@�uH��H;=�6!u%H�{u.H�C(�H�~7!�UH��_H;=�6!tH�5�6!����u�H�K���tH���(��H=�w�EH�67!H��H�=b6!H�5��1�H�?�9��1�Z[]�Q���H��uH�!6!H�5u�H�8�r�1�Z���H�H���1���H�6!H�5��H�8�?�1��k�ATI��H�546!UH��SH�H9�uH��5!H�5���H�8���.�.��Å�u�H���p�H��H���tI�,$�����H��t���[]A\���UH��H��SH��H��dH�%(H�D$1�H���k�����1���xUH��H�uL�$H��t0�ɸH��H����H�L�D�M��M!�I��I��I��I!�M��M	�H��5!L��H�H�UH�H�\$dH3%(t��H��[]���UH��SH��H��H��dH�%(H�D$1�H��������1���xDL�$H��D�H��D��t#�ɿA����͍t?���D!������D!�	�ȉH�65!H�H�\$dH3%(t�n�H��[]���UH��H��SH��H��dH�%(H�D$1�H���4�����1���xIH�<$H��f�UH����t&��ɾ����D�D6�D�����!���D!���	І�f�EH��4!H�H�\$dH3%(t����H��[]���UH��SH��H��H��dH�%(H�D$1�H�������1���xKH�4$H��f�;H��A��t*�ɸD������D�D�E��E!�A��A��A��A!�E	�H�4!fD�H�H�\$dH3%(t�<��H��[]���UH��SH��H��H��dH�%(H�D$1�H��������1���x@H�4$H��H����t%�ɸD�����͍|���A!���A���"D	�H�w3!�H�H�\$dH3%(t���H��[]����?�
����H�?�����SH��H���}����1����t��H�3!u�H���H�[���SH��H���I����1����t��H��2!u
f�H��f���H�[�ATI��H�5M2!UH��SH�H9�uH��1!H�55���H�8���.�G���Å�u�H������H��H���tI�,$����H��t���[]A\���UH��H��SH��H��dH�%(H�D$1�H���k�����1���xUH��H�uL�$H��t0�ɸH��H����H�L�D�M��M!�I��I��I��I!�M��M	�H��1!L��H�H�UH�H�\$dH3%(t���H��[]���UH��H��SH��H��dH�%(H�D$1�H��������1���xFH��H�}H�$H��t'�ɾH����L�D6�M��L!�I��H��I��I!�L	�H�EH�M1!H�H�\$dH3%(t���H��[]�ATI��H�5�0!UH��SH�H9�uH�E0!H�5����H�8�{���.����Å�u�H���F��H��H���tI�,$��R��H��t���[]A\���UH��H��SH��H��dH�%(H�D$1�H���k�����1���xUH��H�uL�$H��t0�ɸH��H����H�L�D�M��M!�I��I��I��I!�M��M	�H�I0!L��H�H�UH�H�\$dH3%(t�w��H��[]���UH��H��SH��H��dH�%(H�D$1�H��������1���xIH��H�}H�4$H��t*�ɸH����L�D�M��I!�I��I��I��I!�L��L	�H��/!H�uH�H�\$dH3%(t����H��[]���ATI��USH��H��H�-o/!dH�%(H�D$1�H9�uH�H��H�FH�����sH��H�����I�$H�E�g��r H�
P.!H�PH�5��1�1�H�9�!���AH��H�����H��H��t.H�W�H�5)�H������H��uH��1��W���I�$H��H�L$dH3%(H��t���H��[]A\�H�
�-!H�PH�5��1�1�H�9���銆H�H��z���H�?H��H��H�t�@�����)�)�H��H�������H��H�?H��t�@�����)�)�H��H�������H�?H��H��H�t�@�����)�)�H��H������H��H�?H��t�@�����)�)�H��H�������H�?H��H��H�t�@�����)�)�H��H�������ƾ@Љ�)�H���)�H���7����?H��H���t� �����)�)����������H��?H��t� �����)�)������k����P1��?��Z�)����SH��H��H������Z�.
���L$ztfn\$H��,!f~H���5��H��t�1�H��[�1����SH��H��H�� �=��f.���$�$zt�|$H�n,!(L$H���<$�����,$H��t���1�H�� [���SH��H��H�������Z�.0�zt1�H���Z�������t��D$����D$H��t�1��
H��+!H�H��[���P1��z��Z�����SH��H��H���p��f.��zt1�H��������t��D$����D$H��t�1��
H��+!H�H��[�H�H����S1�H��1�1��H��1�[H������AWAVI��AUI��ATUSH��XH�t$H�5��H�|$dH�%(H�D$H1�H�D$H�8�!��H���H��H�5��H������H�I��uH���V��M����H�T$0H�L$81�H�t$@H�T$H�L$ H�t$(�lL�T$H�t$@I�:�	��I��H����H�=�)!H9x���x@��H�HH�P H�p(H�|$L�L�����I�$��uL��������tHH��I;_�.M�GA���tCM�OI�<�L�D$H�L$ 1�H�5��H�T$(�b�����O���I�uL���m��A���I�|��H�=)!H�5��H�?�W��I�$u���
�H��H��uI�$u�L���$���M�\$I�T$ I�L$(L�XI�D$L�H�U L�H�M(H�EH��tH�AD$0E0I�$uL������H�t$@H�|$H��������u$I�uL�����H�M�>���H������1���H�M����H���������I�?E1�H�o�I�/H��uL���m��H�L$HdH3%(D��t�5��H��X[]A\A]A^A_�H��A�ԅ�����݁H��A�ԅ�����
�[H��L��]A\��H��A�ԅ��w�黁H��A�ԅ��d��C�H��[]�ATI��H�5�'!UH��SH�H9�uH��'!H�5����H�8�����.�����Å�u�H���/��H��H���tI�,$����H��t���[]A\���UH��H��SH��H��dH�%(H�D$1�H���k�����1���xUH��H�uL�$H��t0�ɸH��H����H�L�D�M��M!�I��I��I��I!�M��M	�H��'!L��H�H�UH�H�\$dH3%(t���H��[]���UH��SH��H��H��dH�%(H�D$1�H��������1���xDL�$H��D�H��D��t#�ɿA����͍t?���D!������D!�	�ȉH��&!H�H�\$dH3%(t�-��H��[]���UH��H��SH��H��dH�%(H�D$1�H���4�����1���xIH�<$H��f�UH����t&��ɾ����D�D6�D�����!���D!���	І�f�EH�]&!H�H�\$dH3%(t���H��[]���UH��SH��H��H��dH�%(H�D$1�H�������1���xKH�4$H��f�;H��A��t*�ɸD������D�D�E��E!�A��A��A��A!�E	�H��%!fD�H�H�\$dH3%(t���H��[]���UH��SH��H��H��dH�%(H�D$1�H��������1���x@H�4$H��H����t%�ɸD�����͍|���A!���A���"D	�H�6%!�H�H�\$dH3%(t�l��H��[]�ATI��UH��SH��H��dH�%(H�D$1�H�GH�BH��H��t3H�
�$!H9Ju&�RxH���EH�p1�H�3@ H�C)C�H;�#!uH�UH�H�EH�kM 1�)K�cH;-{$!uH�z#!H�C1�H��AH�����s_L��$!H��L������C��uj���H��t`���H������ʼnC��uJ���H��t@L�%$!H�5��I�<$�y������s%L��"!H��L��L��H�CH�EH�k1����sJL�
�"!1�H��L��?��H�CH��t(H����H�5m�H�����H�CH��u�H�{������ZH��H��H�5�,!�������xAH�<$H��tH��L���7���H�<$��H�u"����L�k"!D��H�5��1�I�8�?��H�L$dH3%(��t�X��H��[]A\�H�C H�/��}�X����}�N��H���H����Hǃ�H�/�e~����[~����UL��D$����D$��H�߉D$�����D$髀M��I)�I��v,D�C8L��H�
X�1�H�������H�[ H�I��5�L�W!!H�5�I�;���I�,$tS���lH�����1��]L��L�E M��u�H�}@H����H�}0u,H�=�!!H�H�}@�tH���lL���6������8H���!����H�����1�驀H�%h��闀L�� !H�5	�I�;���1��#��ރ��������D�D?�E��D!�A����A��D!�A��A	���1�������d��F��H�CH��t"�CH�U0H��1����H�}0H�{(�ށ���H�+t1��́H��1��O��齁�����t
H�{([�7��H�
�!H�5��H�9�1��1�[�H�%p1�鿂L�
�!H�5�I�9���1�颂�����H����H�|6�I��H!�I��H��I��L!�H	�H��锂1��	�L�
w!H�5��I�9���1��������H� !H����H�|6�I��L!�I��H��I��L!�H	�H�UH�鮂H�C H�/�k��D���a�Hǃ�H�/u�)��H�{`H��u\H�{@H���P���Hǃ�H�/u���H���H��tHǃ�H�/u����H�{xH���^�醂H�C`H�/u���������*�����0�A���M���L�D�L�VL�^(�F$L�N0M��tHc�H��f��H�FHN8�҃H�FE1�H�K�<�I��H�FI9�}���1���L�
�!H�5@�I�9�,��1�������H��!���ˍ|6�A��D!�A����A��D!�	��UH�龃���H�CH��t"�CH�U0H��1��I��H�}0H�{(�;��7��H�+t1��)�H��1������H�C H�/���t�����j����Hǃ�H�/�/��K���%�Hǃ�H�/���,���Hǃ�H�/u���H�{`H��uH�{@H���<��?�����髄H�C`H�/u���������AUI��ATI��H�=�<!UH��SQ臲H��uA���RI�EH��H��H��L�hI�$L�`���H�H��uH���~��H��t�L��H��L�����H�MA��uH���Z��ZD��[]A\A]���Q�E��H��t+H�PH;5!t	H;�!uH�@H�8~	H;�!u1�Z����1����AWA��I��AVA��AUA��ATA��UH��SIc�H��HH�L$dH�%(H�D$81�H��uH���H��H��1��H��H�|��W��H��H��u
�*����H��tH��H�����E��H�t$H����H��I�����L���[H��E�t$�L�l$1�H�5
��%��M��H�
��A9�H�
��� �L��1��:��H��L��H������A9���H�T$8dH3%(H��t����H��H[]A\A]A^A_���AUI��ATI��USH��dH�%(H��$1�H�=<S!tL�����H��H��u�@����H�S!H��u��*H��L��1�����H�MH��uH���\��H����H�=�R!H�����H��H��tH�H������6��H��u$I�D$����u$H�=�!H�5��H�?�
��H����H��M�D$M��H��H�
���1�����H���AT1�RH�
�!H��M��H�=�!L���H�5���F���H��XZH��t�H�=R!H��H�����H���u"H��H�uH���c��H�MuH���U��1��H��H�uH���A��H��$dH3%(H��t���H��[]A\A]���H��yH��!H��H�5N�H�81��������1�鰳��AUI��ATUSQ�%��H��uH�!!H�5��1�H�:�����H�=3Q!I��tH�5'Q!L��藿��H��H��u�OH�=�����H�Q!H��u��)H�5��H�������uH��!H�5ʸH�8�Z��1��H��r�I���H��u�����H��H��t�H�H����H�5r�H�����H��H��u
H�������:H�5tP!H��L�������uH�u�H��1������H�5*�H�����I�EZH��[]A\A]���U1�H�=��1�SH��dH�%(H�D$1��T����x,H�����H��H��tH�$Hc8����H�H��uH���T��H�L$dH3%(H��t���H��[]���SH��H��H�=Z�H�5e�H�� dH�%(H�D$1�������1���xMH�T$H�5��H���Ǿ����u1��1H�|$���H��t�H�t$�L$��H�uH�����Hc��>��H�t$dH34%(t�y��H�� [���SH����H�5��H�� dH�%(H�D$1�L�L$L�D$H�D$�λ����tkH�|$H��t1��9���H��H���u�;���H��t�E1�H�D$H�5�!H�xH9�t2�H�����u)H�t$L��!1�H�~H�5��H�WI�8菽��1��-�6H��t#H�L$H�]!�@PHYH�PH�H�H0H�X H�L$dH3%(t�y���H�� [���SH����~H��t!�@PH�!H�KH�PH�H�X0H�1H�p [�������SH���~H��t�@PH��!H�KH�PH�H H�H�X0[���AUATUH��H��SH��H�T$PH�L$XL�D$`L�L$h��t=)D$p)�$�)�$�)�$�)�$�)�$�)�$�)�$�dH�%(H�D$81�H�T$@H�t$ �D$ H��$ �D$$0H�D$(H�T$0���H�$H����L�l$L�d$H�\$L��L��H���o���L��L��H������H�|$I���d���H��t+H��L���Ļ��H�=���x���L��H��譻��H�<$u�A�o���H�|$�%���H��u�[���H�=2��?���H��L���t���H�4$H��tH��蓼��H�|$H��t
H�u���H�|$H��t
H�u���H�|$H��t
H�u���H�<$H��t
H�u�t���H�D$8dH3%(t�?���H��[]A\A]���ATUH��SH��H�`H��tH�C`H�u�(���H���H��tHǃ�H�u����H���H��tHǃ�H�u���H���H��tHǃ�H�u�ſ��H���H��tHǃ�H�u褿��H�{X軸��H���诸��H���Hǃ�蘸��H�{0H�u0Hǃ�H�CX�$�H�C`H��tH�H���H��tH�L���M��tI�L���M��tI�L���M��tI�H���H��t;1�H���H��H�����H���H��u
�n������H���H���G���H���t3Hc��H���]���H���H��t�Hc��H���H��H���1�H�}Xt+L�]@N�$�L������H�CXH��t�H��H�uXL��1��[]A\���H��tQ��zH��tH��H�H��!�H��!Z���AWA��AVI��H��AUATUH��SH��H������H�=!H��I��込��H����W�I��H�@(�@�I�|$(E1�M�UH�D$1��AD$PA�D$HI�D$`I�D$hI�D$pM9�}K�D�xI����L��舿��I�t$ �0�)���I�D$H��u
����DE�|$HE1�M9�}3L��H���ݹ��H��H��� H������K�D�xH�u����I����K�D�xH�H;�!I�\$`uI�D$hH�5�!I�t$p�?H���|yH��t	H�PhH��uH��!H�5��H�;�Ƚ���H��HI�T$hI�D$pH���L���H�|$M�D$xD��H���������tL��!��H�5��1�I�8�����RI�|$M�D$ L��H��$H�t$�U�����tH�-�!��H�5A�1�H�}�ֶ���H�EI�l$PI�M�t$X�I�$uL������E1�H��L��[]A\A]A^A_���ATUH��SH��H��H��H��dH�%(H�D$1��q����������uGH�M!H9CuXH��L�c0�;xH��t.M��t)H�p`L���5����������uI�L$H�I�H��yM��u�H�
��H�UH�5���MH��H�5@!H���m�����xHH�4$H��tH���:���H�<$H��H�u-�����&H�SH�5j�H�JH�UH��
!1�H�;衵��1�H�L$dH3%(H��t跹��H��[]A\���AUI��ATUH��SH��QH�zH�5o
!H9����������H�{H�5!H9�t}����utH���wH��uH�S����t7H�S�5H�x`H��t�H�G���t��%���H�=���0�f���H��u%�H�RH�
�!H�5��1�1�H�9�����H���ԢH��H����H�}H�5�
!H9�uH��薾��H��u�������u�L�CM�(�H�=J
!H9}@tH�u@H��tH��H�u蜹�����H�E@H��u��MH�s@H��t�H�=T!H9~u�H���>���I��H��t'H�{@H��H���w���I�$��uL���G������r���H�uH���2���1�ZH��[]A\A]�I�,$���L������1�邧H�/�m�����c�貺������H��!H�5��H�:������C����;�H���HLJ�H���H��tHDž�H�/t"H����H�+���H���z���1����n�������V�uH��t
H�x`tY�PqH�!H�52�H�8�J���1�Z�H�+��E1��
v�qI���v�"���H����H�s������H��H��t|L�%m!L9euo���1�H���0I��H��tJH�]@H�@8H�@ H�X0L�E0H�@@L��I���b�<���I�GH��u>����I�/t]E1��YuL�=1
!H�5��I�?E1��g����;uH���J����.uA�GH�U0H��1�迯��I�L�E0M�G(L�/�uL��E1�������tH��H�T$`H�5E�1��5������u���H�|$`裸�����H���ssH���aH���H���Q���H���H�|$`�}���I��H������H���oI��H����H�\$`H�x1�L��M�D$ H�H�XhL�``L�H��I�$�4h���4tI�/����L��E1��6����tL���)����uL�=�!H�5��I�?����H�|$@H�/�������E1���sH�|$@H�/������޵��E1��sH�D$P�t���H��H�a	!H�8���H�|$@H�/�v���蝵���sH�
Y!H�5#�H�9蒶��H�|$@H�/�G����n����RsL�
*!H�5K�E1�I�9�`����4sI��tH�|$@H�/�����.���E1��s�!���H�T$H�tH�|$@H�/����������rL�
�!H�5(�I�9���H�|$@H�/u�ش��I�/�����L��E1��ô���rL�!H�5h�E1�I�:赵���rH�|$@H�/�e���茴��E1��mrI�,$����L���q����UrI�D$E1�H�D$I;F��H�L$`H�T$XH�t$4H�L$H�T$ H�t$(L9l$��K�|�L�D$1�H�5��H�L$ H�T$(�J��������T$4O�D��Ѓ�����H����H��H���+uH���I�xH�5�!L�D$H9�t+�����u"L�L$H�5�!I�yH9�t
�ذ������I���P���L�-0!H�5Q�I�}耴�����L�5,!H�5
�I�>�e��������rL�%!H�5M�I�<$�D������H�xP�@H�x��H�-�!H�5��1�H�}貭���{���H�|$�oH��tH�x`L�WA���u<L�\$I�S����tIH�t$H�NH��!I�UH�5�1�H�;�U��������{���H�='��0輰��H�����H�J���ATUSH��pdH�%(H�D$h1�H�D$��nH��H��uL�
!H�5ԶI�8�C�����H�l$I��1�H��H�L$H��H�5���M�������L�D$M��y%H��!H�5��1�H�:��H���[����H�T$ H�K0H��L)�H9�~'H�k!L�H�5٨1�H�;1��U���H�������`H��H�T$1�H�5Q�H�=N��N�����yH��1����3L���fjI��H��tH�t$H�K0Ht$H�x�H��L��迲���1�H�T$hdH3%(H��t����H��p[]A\���USQ�mH��H��uH�=�!H�5��H�?�����H��H��t
H�F����uH�
�!H�5��1�H�9�α���cH���TmH��uH�p!H�5��1�H�:觱���<H�{`H�H�s`H��t
H�u�{���H��H��H�5�$!1�������t
H��!H�H��Z[]�H�+uH���D���H�m��1��՟H��H��������������A��$�馟H�+u�H��1���鑟�����H�+u�H��1��ϯ���m�H�+u�H��1�躯���X�H��1�諯���I�H��H�5� !H��脭�����/�H�+�I���H��1��x�����H�+�0���H��1��_����H�+����H��1��F�������1��֝��AVAUI��ATUS��kH��uL��!H�5��1�I�:�����I��I��H��1������0H��H����H�E@H�U0H�C0H�S(M��tL�c�CI�L�s L�k8�kH�}0H��wL�KP�CL�K�7�<���H��H�CH��u����H�u3H���n����)H�M01�H���C�H�M0H�{L��H�K(�L�k8�1�H��[]A\A]A^���ATH��I��1�UH�5�H��H�=(�S�߯����1���xUH���jH��H��uH��!H�5��H�8��1��+���1���0H��tH�K@H�s0L�`H�H0H�p([]A\���ATUH��SH��H�5��H��H�� dH�%(H�D$1�H�L$H�T$貦������1�H��H�5��H�=г�"�������H�|$H�5ij�٫��H��H��tlH�@���u'H�=� H�5N�H�?����H�uDH��1�����xH���ե��H�I��uH�������H��tH�
�� H�5E�H�9�խ��1��<H�t$L��脭��H��H��u�Ǩ��H�P� H��H�:襭���H��H���S���H��H�L$dH3%(H��t�M���H�� []A\���USAPH�F���uH�� H�5k�H�:�I����&H��H������H���4���H��uYH��H��[]����Z1�[]���ATUSH�� dH�%(H�D$1�H�D$�hH��H��uH�
�� H�5d�H�9�Ӭ���AI��1�H�L$H��H�T$H�5�������H�|$�>���H��H����xXH�x8tH�5٢H�2� �6�C������uH�5�H�� �L�D$M��yH�� H�5߱H�:�:����/H�SHH�M0H��L)�H9�~-H�-�� L�H�5,�1�H�}詥��H�uuH��1�����kH��H�S81�H�5��H�=��蜬����x�H�t$L��Hs8���H��H��uH�u+H��袪���#H��H��H���q\��uH�MuH������1�H�T$dH3%(H��t�E���H�� []A\���H��tH��L��L���AWAVI��AUI��ATM��UL��SH��V��fI��H��tIH�xptBH�H�5w� H9�uH��+!H9�u"�	�3�����u�I�GpL��ZH��[]A\A]A^A_��XH��L��L��H��[]A\A]A^A_�����USH��ASH��uH��ZH��H�~H�5Y� H9�t#�Ϧ����uH�L� H�5Ȱ1�H�8胪���$H�K H�s0H��H�{(L�CL�KLMAZ[]��H��Z[]�AWAVAUI��ATUH��SH��8H��H�|$ H��H�L$�eH��t H�L$H�|$ L�����H��H���u��1�H���eH�5�!H��H�D$�6���H�D$H��tI��1��|�У��H����1�H���H���I��H����K�L�H�|$H�L$(��H�T$(H�|$ L��蔧��I��D$(uL���c���I�uL���V���I�ă|$(�t8H��H�D$H�P@H9���M9e��H�|$H�����I��H���b���H���tI�u�L��H������aH�|$H�����H��t"H�=�� 1�L��H�56�H�?�~���I�u��Ң��H���3���I�uL��謧��I�u�L��蟧���H�H��8H��[]A\A]A^A_���AVAUATUSH�� dH�%(H�D$1�H�F���uH�=� H�5e�H�?�U������H�~H��H��I��t6H�wH��H������H���tiH9C~H�
� H�5��H�9�������H1�M��tAH�$L�t$L�l$H��L��L��H��L���*�����tH�T$H�t$H���ԥ�����u�H�L$dH3%(t�z���H�� []A\A]A^���WH��� cH��u
�VfH��t
H�x8Y�g���H�(� H�5�H�8�a���1�Z���SH��H�5�1�H�� dH�%(H�D$1�H�L$H�T$������L�D$L����eH��H��uH��� H�5��H�:�����H�P0H�t$H9�~H�
|� H�5��1�1�H�9�i����A�xuL�V� H�5W�1�1�I�8�C����H��wI�p(�xI�xI��PL9�uEH������H��H��t?H�L$1�H���H��H�t$H�V(H�v�T���L�T$L�\$I�ZM�Z(�&����H��u
豞��H���H�T$H�BH�D$H�B(H��� H�H�L$dH3%(H��t�ȣ��H�� [���ATH��US�raH��H��u%�dH��H��uH�
~� H�5��H�9跥���yHc��E1��&���H��H��tbHc��L9�~H���J�<��r���J�D�I�����s���H��tH�Mu,H���P����"���H���H��1�[H�=-�]A\霢��[1�]A\���H�GxH��tH��Q��cH���H��uH��� H�Z���H���H��tH��Q�cH���H��uH�Y� H�Z���AUATUH��SQH�(H��vK�W���I��H��u1��H�uH�M(H���1�H�=b(!��)!H��H��u
L��茜���UL�`I���H�EL�eI���_H��H��uI�Mu�L���;����$�@VH���
cL�c H��HH�CH�E(L�k0H�C8ZH��[]A\A]���USH��VH�oH�5]� H�}H9�uH�e$!H9�t�"������u�H���bH�s(H�{H�@pY[]��H�H��Z[]���H;53� ATUSuH�H���)H��I���'_H��H��uH�=@� H�5
�H�?�y����H�p`H�������������H�}uwH�5� H�EH9�t&�r�����uH�
�� H�5�1�H�9�&�����l^H��H��uH�M��H������@PH�z� H�UH�k0H�CH�S �gH�5A� H9�uH���aH�s`H�x`�����y&�>�����u�H�}H�5m� H9�t��˞����u��t	H�EH���[H��L��]A\�}�1�H��[]A\���H�GH��H�
�"!H9�tH�pH�=A�1�鄛��ATE1�USH���aH�w(H��PpH��H��t*H�SH�=�H�rH��1��I���H�MI��uH�����L��[]A\���USH��AR�`���tH�m� H�5��H�8辡���DH�5���@���H��H��t0H�s(H�{�˟��H�SH��H�5,!I��AYH�=��[1�]阢��Z1�[]�AWH��AVAUM��ATM��USH��ARH��u=I��H��H�yH�5�� H9����f�������H���\H��t H�@hH��tAXL��H��L��[]A\A]A^A_��L�CA���teH��H��踝��I��H��u#L�!� H�U1�1�H�5ߧI�;����1�M��M��H��H��L���5���I�H���iL��胟���\L�5� L9�u)H�}H�5'� H9�uI�$I��0荜����u�L�KH�UH�5e�I�I�H��H���֝���������H��� tCH�sL��L���H�}H9�tH���5���H��裣��H����H�X@H����H��H�}H9�uH�{H�5�� H9�u�H�������u��^�����tUH���u^H��H���*[H�P`H9Q`u8H�sH��I�4$�&���H��tGH�p@H��t>YH�ڿ[1�]A\A]A^A_鈚��H�[H�MH�5i�H�SL��� 1�I�:�Ԙ��1�ZH��[]A\A]A^A_���AWM��AVI��AUI��ATI��UL��SH��H��H�H�5�� L�L$PH9�t.L�L$����L�L$��uH��� H�5�H�8������8M��L��L��L��H���6���H��tH��H��H��H��[]A\A]A^A_�WO��H��[]A\A]A^A_���ATI��UH��SH��H�~H�5	� H9�t$������uH�
�� H�5x�H�9�5������GH�CHEM��uH��� H�5��H�:�
������H�s(H�S8QH��L�KL�C PL������^_[]A\���ATUSH��uL�
�� H�5!�I�9������H��L�FH�5[� H��I9�tX�n\L��I���Ù����uDI�t$`H���"������t-��u.I�t$`H�K1�H�=� H�VH�IH�5��H�?�����IH�EH�S�H��H�H��H��M��t�H���Ǡ��H��t�H�P@H��t�H�H��[1�]A\��M[]A\���S1�H���H��H�56�H��dH�%(H�D$1�I��H�$�0����ƒ���tH�4$1�H��t
1�H�����H�L$dH3%(t�]���H��[���AQH�GL�M��tH���=[1�H�x`L��AX��H��� H�5��H�:�G���1�Z���SH�GL�M��t8H��I���ZL�X`H��L���WL�@0L��H��H�qpH��[I�L����H�=�� H�5F�H�?���1�[���ASH��xAI��I��H9w0~5�ZH��H�@0I��L��H�wpH�H�@H�`L��L��I��MJAZ�(�H�
�� H�5�H�9�~���1�Z���SH��uL�!� H�5��I�8�Z������fH�GI��L�M��uH��� H�5��H�:�0������<I��H����YH�p`H��H���VL�H0H�QhPH��L��I��I�L��AR����ZY[���APH��uL�
�� H�5T�I�9�̚�����hI��I��I���YH��M��x	H�x@L9�L��� H�5�I�8蒚�����.H�@0H�H��H�VhH�v`QL��L��H��IJI��QL���>���^_Z���AWAVAUATUSH��8dH�%(H�D$(1�H��uH��� H�5��H�8� ������wH�FI��I��H��H�P`H��tTH��tJL�� I�2�ٖ��H��H���u�ۓ��I�É�M���,Il$0�H��x�L��H��L�������
H;G� ��H�l$H�\$H�L$ H��H���W�������I�|$0H�L$ H��H������H�|$ I��yH�|$H9|$|�tH�t$H9t$~
L�D$L�D$L���!���I��I9�tL�
�� H�5ÐI�9�������mL�t$1�L9�}DH��L��臔��H��H��tKH��L��L����H�uH�߉D$����D$��t$Lt$ H���1��H�
k� H�5(�H�9褘����H�L$(dH3%(t�\���H��8[]A\A]A^A_�1��X��AWI��AVAUATUSH��XH�QPH�YhH�t$0L�aXdH�%(H�D$H1��AHH�IpH�T$H�\$H�L$ �D$(葔��H�|$�D$,����H�D$H��yH�=��1�����WH�|$1��j���H��H��u)H�=��1�蚣���0H�D�I�MuL��謖��H��H9\$t|H�|$H���5���I��H��tH���%SI��H��u�H��H�=N�1��=�����H�xp��rR���I�v0I�<�A�VpH���v���H��H�=�����D$(t6H�|$@�-��I��H���l�D$(t荔��L�l$@�0E�}A�uD�8�E1�H��L��軓��H��H��uL��H�=���t����D$(t�H���L�l$@�8E�}A�}D�8M��t
I�uL��蔕��L�D$ L;�� t~H����1�H��H�|$0H�D$��H��tNH;�� uH�uVH���Q����LH�=���UL�L$L;Ht5L�!� �H�5��I�:�͒����uL��H�=g�躐���H��tfH�uaH������WH�zH�5�� H9���H�T$8����H�T$8����H�
uH��輔��I�MuL��讔��H��H�=��1��s���H�MuH��菔���|$,趍��H�D$HdH3%(tt�Q���L�2� H�5D�I�;�k���H��H�=I�1�� ���I�Mu�L���<����L���}H��H���2���H��H�=���I�4�I�N0H�z�H�T��H���H��X[]A\A]A^A_���ATUSH��H��dH�%(H�D$1�H;5]� �(H�F���tcH�=H��TI���PH��H��u1��YH�5(� �@ZH�x 1�H�pH��A�T$H��H�E0H���)H�Mu�H���\����H��H��H��������t�����H�{H�5	� H9�uH���SH��u&�M�X�����u�H�{H�5�� H9�t��?�����u��)H�x`H��t �OH��tH�=��L�`h�6SL;`t1H�i� H9Su)H�{0�RH��tH�=R�L�`h�SL;`uH��\H��H�5�!H��踒�������H�$H��tH��H���y���H�<$H��H�u"�[����H�
� H�5Y�H�9�S����H��H�L$dH3%(H��t����H��[]A\���ATUSH��H��dH�%(H�D$1�H;5�� �CH�FH�����s1H�=��4RI���,NH��H���PH�5Q� �@PH�p�l��s1H�=���QI���MH��H���H�
� �@zH�H�5��sdH�=���QI���MH��H����H��� �EZH�EH��H�} 1�A�T$H��H�E0H����H�M��H�������H��H��H��谏���������uEH�{H�5�� H9�t5������u,H�{H�5G� H9�t������uH�{H;=V� u�{PuHH��8H;=�� u7�LH����@PL�� L�[L�PI�H�H�X0H��H�P �H�5�� 蚍����u�H���.PI��H��t|H�{H�5�� H9�uI�|$`H��u
�`�e�����u��UH�O���tH���@�0@��Zt@��zu4�YLH����H�=�� �@ZH�xH�H�X0H�[L�H��L�@ �\H��H�5�!H�������xDH�$H��tH��H�����H�<$H��H�u&菏���L�
N� H�5��I�9臐���H���1�H�L$dH3%(H��t�6���H��[]A\���AVAUATI��UH��H��SH��H��dH�%(H�D$1��̍���������tH�EH���[L���KH��H��uL��� H�5~�I�;����0H�x`诐��H��I���$OI���KH��H����A�H�{ H��CI�UH�S1�A�UH�C0H������H�uH���v���H��H�5!H��蔎����xEH�$H����變��H�-�� �p �~�x ;}~"H�=��͎����tH�<$H�u����1��oH�4$L�����H���c���D�UD�@ E�H�D�H A���~A��2�A��G�RE9�}	�2����@$H�<$H�u����H�
� H�5��H�9踎��H�L$dH3%(H��t�p���H��[]A\A]A^���AUATUSH��(dH�%(H�D$1�H��� ��8H���RH�T$H�5�� H��H��H�D$�_������H�|$H��uL��� H�5�I�:������H�W���u%H�u���L�
�� H�5�I�9�������H�|$��u%H�u踌��H�a� H�5�H�:貍���~�h���H�|$I��H�u膌��I���u7苇��H��t-L�-� I�}�f������?I�}H�5���^����*H�T$H�5]� H���e������H�|$uH��� H�5��H�8������H�=�� 1��܉��H��H����H�|$�HI��H��uL��� H�5ŒI�8�،���H���1��EGH���H���yA��$��y���Hc�H���8���H���H��u
�����F���L�(��~��H�xHc�I��$�H���Z���M�D$0M��t/H��������H�I��L9�}H�=�� H�5;�H�?�&�����M�L$8A��$�t
���M��L�k@L�T$H��L�-u� L�~��L�K8L�S`H��I�MAEL�C0L�[xH�KXCHH�D$�0�����tpH��H��H�u脊��H�=@�I�\$p��JH;XuH�5� H�������u_�9H�=��M�d$p�JL;`uFH�5z� H��蕒����u3�
H�uH������H�|$H��t
H�u����H�MuH�����1�H�L$dH3%(H��t�È��H��([]A\A]���AWAVI��AUATUSSH�FH��H�P`H��tKH��tAH��� H��H�2蚇��H��H���tA[H��L��[]A\A]A^A_�G�腄��H��t���H;� ��H�{ L�=�� L�-�� L9�t>I�u�>���H��H���u�@���H��t'�H��uI�}H�5C�E1�������H�{M�EL9�uE1�H��y6H�5��L��E1�����TL���І��I��H���u�҃��H���2H�{M�ML9�uH�5�L��E1�誉���L��荆��I��H���tH��~1�M9�F�聃��H��t���H��y1�M9�|)H��~L��H��L�H�H��H�X�M)�I�GH�H��H�XL���
HH�x`�DH�=ݑL�xpI���nHL;xu{M�F1�H�=ېM�8H��~
H��uK�<'H��AZ[]A\A]A^A_����H���}���I��H����M�E1�A�$I�C�I��L9�u�L��H���݆��L��I��貀���	H�=*�M�mp��GL;h��I�~L�/H��AY1�[1�]A\A]A^A_����H��uAXK�|�H��[]A\A]A^A_飀��I��������L9�~Y[]A\A]A^A_餀��H�<�跈��I��H��t�E1�C�L�I�C��I��L9�u�L��H���M���L��I�������LH��E1��e���I��H��t6I9�}4L��L��I��w�I�uJ��I����H�
^� H�5o�H�9藇��E1�ZL��[]A\A]A^A_���AVAUATI��H��USH�� dH�%(H�D$1�H�FH�P`H��tRH��tHH�-a� H�u�(���I��H���u�*���1�H���HMl$0�H��x�L��L���(�H���)H;�� �H�l$H��H�L$H��H��諁������H�L$I�|$0H��H���n���L��H���EH�x`�:BH�=V�L�hpI����EL;h��M�l$H��1�H�=J�襄��H���H�|$uL,$H��L��膄��H���wH�����I��H��u
�~��H���ZH�$1�A�LA�6H��HT$H9�u�L��H���:���L��H���~���#H�=��I�^p�:EH;X��I�\$H��1�1��}���H����H�|$uH�$H��H�<��
~��H����H��������H9�~�~��1��H�<�����I��H��t�L�$L�L$E1�F��M�G��I��L9�u�L��H���}��L��H���P}���gH���ƅ��H��H��tUL�4$E1�I9�}KL��L���7�H��uH�u4H��1����*H�sLt$J��I����H�
�� H�5/�H�9�ل��1�H�L$dH3%(H��t菂��H�� []A\A]A^�1��rEL�%\� H�QH�5Iv1�I�<$�.~��H�E0H�m��E1��FH��H��L���������t���I�|$H�5� H9����n�������L���BH��t-H�x`H��t$�?H��tH�=ŒH�hh�VCH;h��H��� I9T$��H��H�5P� L��������U���L�$$M����L��H���CH�<$I��H�/�<E蒂���2EH��E1�肂���"EI�$�EI�|$H�5�� H9�uL���:BH���8����r�������������N���I�|$0�BH���M���H�=�H�hh�wBH;h�3���I�$�DI�$�DH�
�� H�5��H�9���DH��zD1��C1��C���H�M� 1�L��I���{��I�GH���3H�X���H�5�H���}��I�GH���GI�L��P����z��H�� L��H�5ΊE1�H�81��$����L�t}H��� 1�L��I��J{��I�GH����H�ڏ��H�5t�H���|��I�GH���PM�EI���NL�5�� L��M�7����A�G����M�EI���dNH��8���H�5�� L���ۀ����xfH�}�H��tBL��L������H�}�A��H�/u聀��I�muL���r���A���FL��P�����L�� D��H�5Ks1�I�;��z��I�mu�A���H��8���H�5� L���N�����x�H�}�H����L��L���}���H�}�A��H�/u������y����z��H��t#�L���L���Dz��A�G��t/M�EI���aMM�EI���TM1��hPI��x���[����z��H��u4M�EI���(ML�F� D��H�5tr1�L��P���I�:�z�����L�
�� H�5ăI�9�X�������H�%M��H��X���L��1�1���x��I��H��t$I�.��NL���	����NL���~���N��H�5��H�=���o|����E1�H��x���L�E��{��1�L�E�H��x���H�E��MH�}�H�}�L�E�軸��I��H���kNL�E�H�}���LH��� H�5�E1�H�:����2NH�}��Sz��M���MI�.��LL���H~����LI�.��LL���1~����LH�E�E1�L�U�L��p���H��P���A�L��x�����l����E��|��D�]�L��L��x����H��`���H�E�H��P���A�	H��p���D��{��H�U�L�U�D�A�2�2��l���E��3LL��� H�55�E1�I�:�~���MM���I�NpI����L1��fM1��&NH�
)� �FI�M���MIc?��|��I���MH�
� L��I��n��A�G����B�,x��H����B�~}��L���vw��A�G����B�x��H����BL�5|� H�5Q�L��P���I�>��}���a���I�uI�2H���kI�cF1��jML��L��1�1��g��I���HL��y������K�KH��H�� 1�E1�H�5hwH�;�w���KH1��KL1��DLH�
� ��DH�K���~II�UpI�R�BII�EPI�B�II�}0I�z��HH�
�� �DH�
�� �DH�E�H��~P��?H�
�� A�H��H�9LCI��M��I���L)�I���I��L9���H��H��$�����CH�
U� A�H��H�9LC9I��M��I���L)�I���H��H9�t&H��H��$���H�
� ��CE1����L�����I��H��L�|$M��M��I���I���I���L)�H��H9���H��H��$���L���u>I��H��L�|$M��L��I���I���H���L)�H��H9�t+H��H��$���H)�H�L��H)�H�L��\�����uqM��L�T$I��I���I���I���M)�L9�teH��H��$���A��u?M��L�T$I��I���I���I���M)�L9�t?H��H��$���H)�H�L4��L)�J�L��A��u%L�L$I����CA��uL�L$I����XFL)�J�L���L)�J�L�����H��(L��� H��H���dH�%(H�D$1�H�L$L�L$H�5H��Tt����u1��?H�L$H�T$1�H�5-�H�=)��{����x�H�t$H�|$E1�E1�1ɺ�M<H�T$dH3%(t�w��H��(���H��(L�L� H��H�@���dH�%(H�D$1�H�L$L�L$H�5���s����u1��<H�L$H�T$1�H�5��H�=���}z����x�H�t$H�|$E1�E1�1�1��;H�T$dH3%(t�[w��H��(�H��H�$�jx��H�$�"LH���Yx��D�t$E1�A����E1�E1�A�H��� D�|$��J�D5H��|$��E��A��K�D�D;d$tI��E�I��u�H�ML��L�Q�L�UM����KH��L�,$��w��H�$�KD���Mx��I��H���j���H�mtm1��dKD�<$t�J�|51�1�H���lw��H��t�|$�g���H�m�2KH��H�$�ew��H�$�KM��M��M����]KM��$��]KH���5w��1���JH�m��JH��H�$�w��H�$��JH�|$0L�\$(L�L$L�$H�T$ H�t$�|w��L�$H�L$H��H�D$L�L$L�T$ L�\$(�����D$ 1��D$�$�D$L�D$8L�L$@H�\$hL�|$HM��L�t$PI��L�l$XM��L�d$`I��L9d$0��K�\�L�CH�{L�D$(��w��L�T$(A��I���#H�K A��A��H�L$(I���H�[(A���H�DŽJc�H�>��E1�H��H��1�H��L���o��H����H9�u~H�(�L���JI��$��J�D$�D$A9��TJH�m��L�=c� A��A��H��}H�
f~H�5�qHE�I�?D��1��p��1��(II�mt H�m�IH��H�$�Iu��H�$�IL��H�$�4u��H�$��H�m��L��� A��A��D��H�=k}H�
�}HE�I�;H�5�p1��o��1��HH��4$��t���4$�3���H����t��L���IL��L�D$8L�L$@L�|$HL�t$PL�d$`H�\$hL�l$XH�MH��t`H�nHcT$ H�H�l$H9���HH�=� �T$ H�5pH�81��o��H�l$H�]H�$H��H�]�����H���=t��1��G1��H��4$�'t���4$���H�D$(����wH�=ӂHc4�H�>��L�-�� D��H�5lo1�I�}�n���|���H���L�L$H�K�\�I���F���1�A�D��D$A��D	T$LcT$ L;U|PM��tH�|$(uSH��tnH�H�|$J�\��H����H�D$H�J�\�A�D��D$A��D	$�J�\��D$ H��H�t$(L���,m��H��tI�D$ H��H��L�%�� H�T$(I�<$H��tH�5%n1��m�����H�5�|1��m���~�����m��H���D����k���L�D� I����K�|�H�|$(�M/H��H��tXL�X`H�T$(I�s���u_H�zH�5l� H9�t	�o����tgH�|$(�<[H������L�D$K�D���1����L�5�� H�5@|1�I�>��l������L�=�� H�RH�5fm1�I�?��l�����H�{`��Z�H�=�z�s� �N2H�
�� �5`� H�H@��u.H�%I�/uL���q��I�.uL���q��E1��H@��P�I�YG���H��{L���~���I���H���rH�L�=*v�I��j��Idž��H�%�H�/�=IH�D$�7q��H�D$H�P�%IH�=�� H�5�wH�?�#r���O����l��H����G�<���L�=�u�I�I�mt[I�/tvH�$��k��L�4$H��u5L�-�� I�VH�5�a1�I�}�^k���H�m� H�5mH�;�q��H�mt1���LL��H�$�|p��H�$�H��1��lp���LL��H�$�[p��H�$�u����]k��H����L�1��Q����Fk��H��u�H�
�� H�5clH�9�+q���L���p��L�$$�~$L�,$I�$$����K�=h� u!H�=�x�U� �00H�5�� H�p�=>� @��uoH�%H�p� H�5�`H�8�p�����L�

� �_II�/���L���vo�������h��H�+Hǃ�����H���Oo���K@��P��HL�
�� �I��@�����6���H�muH���o��H�+�x���H��1��n���@KH�+�_���H����n���)KL��� H�5ciI�8��o��H�|$0H��t
H�/��H�+��1��
NL�ωD$�n���D$��MH�+u�H��1��n����MH��t!1�L���Ml��I��H��u$I�,$uL���Vn��H�+u�H��1��Fn���MH�EL�E L�M(L�T$�oA]HH�P�xH�0I�E@I�}8L��I�u0I��$I�UXM�EhM�MpI�M�U`�xh�����$I��$M��$H�/u��m��M�\$A�����M��$M��t
M9u�L��H�5�wH���l��H��H�5�wH���vl��H��H�5�wL���dl��L��H�5ywL���Rl��I���H��t41�H��H���H��H����n��I��H�����>H��H�xL���l��I���I�,$uL���l���h��H���QLH�+�6���H��1���l���8LH��1���l���)L�l������I�,$uL���l��I�m�K���L���l���>���E1����f��1��o���H�+����H��1��ll����KH�
(� H�5iH�9�am�����H�+uH���>l��I�/�����L��1��*l���K�e��ILJ�H�+uH���l��H�|$0H�/u�k��I�/�@���L��1���k���BKL�5� H�P�H�5�h1�I�>�of�����H�c� H�5�hH�:�l������L�H� H�T$H�5�u1�I�:�2f�������AWAVAUI��ATUL��S��H��HH�|$H�='� H�t$ 1�L��$�L�L$�i��H��t8H�|$I����'I��H��u+H�=� H�5iuH�?�l��I�uL���k��E1��>��tUH�@0I�uH��H��t0H9ƋU|�<�$Hc�H9�}@H9���$Lc�I9�~*�E�$I�E��E�$I�EL�T$M�N0H�5b� I�zL�L$H9�uH�|$�'H��u�	�g����u�E1�E1��H�x`H��t���&H������H�ppH�=�sH�D$0H�t$(�v*H�T$(H;PH�D$0u H�=_rH�D$(�U*H�xH�HH�D$(�1�1�L�@pH�|$8H�=vrH�L$0L�D$(�#*L�L$(L�\$0L;HL�T$8uH�=t�*L�PL�XH�T$H�t$ L�T$(�~D$(L�\$(I�w D$(AG0H��<$I�W(�^�<$���<$u5�ڋE����$�tI�uHc�Hc�Lc�H)�H�L)���H�I�G�]��$�I�n8tLc�$�L9�IO�H��t I�$H�H��H��tL�T$I��I)�M2M4$��u	H�\$I�_L�l$L�\$M]I�$I�OL�I�$L��$�I�,$��I�EA�M�$I�v0H�L$H�L�L$I��I)�L�I�4$I�EH�9M�F0H�I��H�<$H)lj�I�����$�M�M�v0N��M�UD�mtH�Lc�Ic�L)�H)�L��D�H�I�GD�M�$$L+d$M�g�]�HA�ދMA����$�tM�mHc�Ic�Lc�I)�L�L)��A�H�I�G�M�$$L+d$M�g�]H��HL��[]A\A]A^A_���AWAVAUATU1�SH���H�|$H�t$(�T$HdH�%(H��$�1�HDŽ$�H���yH��$�H�5m� H���ug������H��$��D$PH��tH��D$Pu�g��H�|$H��H�5� �2g������H��$�1�H��tH��u��f��H�|$H��H�5�� �f����xUH��$�H��tx��f��H��$��D$@H�u�f���|$@A�y[�a��H��uL�=.� H�5dI�?�g�����H�5(� H�>�Xa����u�H�=� H�?�Ea����u����D$@E1�H�|$(�*c��H�D$H��u+L�5� I�>�a����t�I�>H�5�c�g���l$�H�D$H�P�����p���H�L$H��H���[���L�5K� L9s�J���������t$\tH�
H� H�5�o��H�9�f���
H���H��t�^��Hǃ�H�{XH��t�^��H�|$E1�L��M�HA����t.M��M��t"M9t$uE��$�A��D	���E1�|$Hu
���L�\$M���D$ZM�{�����|$Z��I�l$0H��$�H��$�I�l$8H��$�H��u�I�|$@f�CR
H��������L�H9���H���9f��H��H�CXH��u
�^�����I�L$@1�H��L�H���I�L$@H��~H��I�t$XH�{X�M�t$@L�t$ �zI��������HDŽ$�HDŽ$�HDŽ$�f�CR
M9�v
H�CX�u���I��L���e��I��H�CXH���Y���1�L��L����H�D$ �|$HA��A��E �D�T$[tH�5n1��)H����H�5Gh1��H���H��������L�l$ L��$�L��$�H�D$8H��$�L�\$hL�l$0I��L�l$`H�D$L�|$pH�T$xL��$�L�d$L9d$��H�t$H�|$(HDŽ$�HDŽ$��_��DŽ$�I��H��t$L�D$hH�L$pH��1�H�T$xH�5/m�]����u$H�l� H�5}`H�8�c��M��������H��$�H�~H�5\� H9�u
�D$\�	�_����u�L��$�M�zA����tM��M��tL�5�� M9t$tI�MuL���b��H�T$�\L�CXL�\$I�D$HH�T$`O��I�A��$�t
���A��$�L���	��A��$���a��H�������fA�L$Rf��v3L�Z� 1�H��$�H�5�_H�UI�:�%\��I�M��������H�੠u5�@t�H�=kM�|$p�!L;xt�H�=�iM�t$p�!L;pt�Hc�$���~I�t$0H��H9�~0H��� H�5z_H�;�b��I�M�y����\DŽ$��|$[�eM��$�H��$�H�teM��LD��b��I��H���
L��$�I��1�L��L���L��H��L���H��H��H)��b��H�����L��$�H��I��uIUuL���J`����Y������M���H��1�H�
�j�Ga��I��$�L���H��tA��$�L��L�����H����L��L���|H���L���X��L���X��H����6D�d$PH��$�ATD�\$HASL��$�APL��$�AQ��$�H�t$8H��$�L��$�L��$���H�� I����|$H��$�H��$�u�D�T$PHDŽ$�H��$�HDŽ$�HDŽ$�ARD�d$HATL��$�ASL��$�APH�t$8L��$�L��$��m�L��$�H�� L9L$8LML$8I��L�L$8H��$�H9�HL�M��t&H��$�H�|$L����]����u$I�uL���^��I�M����L���^������I�MuL���l^��I�uL���_^��H�D$�<����|$[L��$�t4L���H�5AcL���L��H����AW��H���u����|$Hu
H�t$8H��$�L��$�f�kPH�k8J�D�H�H��H��H�l$H�k@H��$�H�CHH�C0H���&�|$\�L��$�E1�E1�1�H��$�H��$�L�L$H�|$8H�L$@H;l$�'H�|$(H���Z��DŽ$�I��H�����L�D$H�L$8H��1�H�T$@H�5�g�X����u-L�-� H�5[I�}�)^��I������L���]�����L��$�I�x����tgI��H��t[L�
c� L9JuNH�5�� H9�tH�T$H�Y��H�T$H��uI���KH�B`H�H����tH��H��t
H�5� H9wtI�uL���z\��H���L�R@I��O�|I�uL���Y\��H������L�\$ H�t$Mk�M�t3O�>L�T$K�<���]��H��H�������N�4�K��H�D$8M��~H�|$8H�L$1��H�|$ t�|$ZtI�t$XH��H�L$`�L��$�E1�E1�H�D$H��$�L��$�L�|$@I��H�T$ L�L$H�kM��M����L�� M9X��H�5g� H9��L�D$P�X��L�D$P����L�T$0I��HN�D�H�uH���D[��H�D$0I��L;d$�|H�|$(L����W��DŽ$�H��H����L�D$ H�L$@H��1�H�T$HH�5me��U����tOL��$�I�z�����)���H�uH����Z��H����S��L��L�-y� H�5�X1�I�}�OU���+�L�[� H�5lXI�;�[��H�uH���wZ��H���S����I�@`H�p����t�H��H���y���H�=ʭ H9z�h���I�@@L�RHO��L��HkL$H�D$H��HL��D�ZL�L$0J�<(HL$8J�L�L�fD�Yf�A

L�AL��I��I)�M��~	I��H����H���HH�N�l(H�I���d���L�d$0I�XL��J�D��R��I�oX����Ձ�tH�=(� H�5!X��H�?�~Z�����H�|$H�5:� ���H��$��wY�������H��$�H���KH�5�W�W��H��$�I��H�u�
Y��1�M�����I;_�M�gA��$�t
M�_M�4��M�t�H�|$L���S��I��H��uI��M�L�����X����L�u� L9@t?H�
@� 1�L��H�5�WH�9�4S��I�uL���wX��I�$���L����bX���}�@@H�HH�p(H�P H�|$耀��M�$���u-L��A��H��I�$uL���#X��I����L��D���X���*I�A�I�$H��uL���W��H�����I�uL����W��H��$�dH3%(��t�V��H���[]A\A]A^A_���H�� ATI��UH��SH�������t=H��u1��4H�U���t�H�5�[H���T����t�H��L��[�]A\��[]A\���ATI��UH��SH���\R�����t5H�C���u1��$H�5Y[H���GT����t�[L��H��1�]A\�Y�[]A\�f.���SH��H�@H��u(�{t
H�{H�CPH9�u*H�{ H�CH��u 1�[�H�C@H�/u��V�����O����H�C H�/u��V����fD��SH��H�0H���4g��H�/�%g��H��[�hV�����AUATUSH��H��L�-� I�}�/P��H����f���1Q��H����g��H�CH;E� ��f��������g��H�{�QQ��H�x�W��I��H����g��L�CH��1�H�
�XH��������V��1�I��L��H�
$� L��XH�5�XH�y��V��L��H���N��H���g��H�I�}H��H���W�������f��H�+tH��H��[]A\A]��f��ff.����H�
� SH����(����j��Hǃ�1�ǃ�Hǃ�[�ff.�@��H�7H��H�Ð��H�H�D$��D$��O��f���H�H���Rq��H��ff.���UH��SH��H��H;5� ��y��H�FH�����tH���hP��H�EH�H��H��[]���=y��H���2Q��H�˧ H�EH��ѐ��ATI��UH��SH��H�hH����H���H���"H���H����~��H���H����~��H�{xH���uH�{pH����H���H����~��H�{`H����~��H�{@H����H�{ H���q~��1�[]A\�f.�H��A�ԅ�u�H���H����H���H���H���H���H�{xH����H�{pH��t
H��A�ԅ�u�H���H����H�{`H���^����~��@H��A�ԅ��T����^���ff.�f�H��A�ԅ��C���H���H���|}��H���H����}��H�{xH��uIH�{pH���l���H���H���Y}��H�{`H���~}��H�{@H���r���H�{ H�������@}��H��A�ԅ���������}���|���*}��ff.���UH��SH��H��H�G����t"H��H��tH�
�� H9Nu	H�~`H��u!H�=J� H��H���H��H��[]��DH��H�T$�Յ���|��H�T$�����SH��H�@H��u?�S��tmH�{H�KPH9�u[H�{ H�CH������H�sH��[L��@A��@H�C@H�/u��MQ���{tH�{H�CPH9�tf.��KJ��H�{ H�CH��������@��SH��H�`H��uH���H����H���H����H���H����H���H�������H�����I��H�����I��H�{X�I��H�o� H��[H�P0��ff.�f�H�C`H�/����H���H��u2H���H��uVH���H��uzH���H���{������DHǃ�H�/u�P��H���H��t$ff.�Hǃ�H�/u��O��H���H��t#ff.�Hǃ�H�/�����H���H������m���fDAWAVAUATI��USH��H��(H�o dH�%(H��$1�H����H�@H������H�{0uaH�ޢ H�=� H�H�C@H�JH�H9x��L�c@H�H�������1�H��$dH34%(��H��([]A\A]A^A_�H��H�t$�7Q��H��H�E@H���?���H�t$L�
�� L9OtH�7L�e@1�H�n�H�/H��u��%���H��L�t$A��1�H�
S�L��A���O��Lc�M�L��L)�H�{ ����L���O��H��H������H�}@L��H���eP��H�+�@��I�,$��������M��fDH;�� uQH�*����1�Z��c�����S1�H���H��H�5wRH��dH�%(H�D$1�I��H�$�CF��������H�4$H��tLH�CH��H������H�
� H9H����H�P0H�{�PhH���v��H;� u0H�(�J��1�H�\$dH3%(u#H��[�ff.�H��1�H��������L��ff.����ATI��USH��H�~H�5� H9����H���6J������~��H���vN��H��H���t'��H��A�$H����~��H�S� A�$H�[]A\��G��H����~��H��A�$A��H����~��H�� E�$H�����SH�GH������t4H��H��t(H�� H9QuH�y`H��tH�A`H�/��~��H�5�� H��[H�������USH��H�W������H��H��tvH�
z� H9Mui���1���0H��H���n~��H�u@H�@8H�@ H�p0H�}0H�@@H���~��L�@P�@L�@H�x(H��H��[]�L�
D� H�5P1�I�9�{L����f���H�~����t"H��H��tH�РH9Pu	H�x0�-L��SH��H�5� H9���}����}��@��H�GH��H����}��H�5y� H9r��}��H�BpH�
����L�GH9�uI�8H�|$��D$��E��H�w(L������ATI��UH��SH�~H�5�� H9���}��H����G�����r}��H���L��H��H���t%H��I�$H���m}��H�� I�,$H�[]A\��SE��H���'}��H��I�$H���:}��H��� I�,$H������ATI��UH��SH�~H�5� H9��8}��H���&G�����(}��L���fK��I��H���t-H��H�UH���#}��H�E� L�eH�[]A\���D��H����|������SH��H�hH����H���H���H���H���M}��H���H���_}��H�{xH����H�{pH����H���H����|��H�{`H���P}��H�{@H��uH�S��tgH�{H�KPH9���H�{ H�CH����1�[�H�ChH�/�M����}��H�C@H�/u��H���{t
H�{H�CPH9�uhH�{ H�CH��t��,|��H�CpH�/�D����pH���:���H�CxH�/�����TH������Hǃ�H�/�����|���PA�����{��f���H�GL��M��tH�
�� �I9HLE�H��tpL�OL�W(H�~L�H�I���L�V�F H���*|��A���M���H�~(L�V�V$L�N0M���5|��Hc�H���>|��H�FHf�F81����ATI��UH��SH�~H�5� H9��,|��H���D�����|��L����H��I��H���t$H�؋UH���|��H��� D�eH�[]A\��$B��H����{����f�USH��H�W������H��H��tvH�
^� H9Mui���1���0H��H���|��H�u@H�@8H�@ H�p0H�}0H�@@H����{��L�@P�@L�@H�x(H��H��[]�L�
(� H�5�J1�I�9�_G����ff.�f���SH��H�hH����H���H����H���H����{��H���H����{��H�{xH����H�{pH����H���H����{��H�{`H����{��H�{@H�����S���H�{H�KPH9�� H�{ H�CH����z��H�sH��[L��@A��H�ChH�/��z��H���H��tHǃ�H�/�K{��H���H����z��H���H����z��H�{xH��tH�CxH�/u�E��H�{pH��tH�CpH�/u��D��H���H����z��H�{`H����z��H�{@H������H�C@H�/������D���{t
H�{H�CPH9�uH�{ H�CH���������y���=����@��USH��QH��tVH��H��1�H��H���H��H��H��tAH��H���H��H�|
���E��H���{��H��H���C��I��H��L����@��H��H��Z[]�H���E��I��H��tA�����z��f���SH��H�H;=5� uH�D� H9�[�����H�5� ��@����u�[���H��H�=1� �=��H��tH�@f��@H�@0@ H���fD��H�G����tH��H��tH�Ė H9Pu�1��f���AWH��AVAUATUSH��H��xH�PdH�4%(H�t$h1�H���׊��~H�HH�q�����H���ϋ��H�xH�o���������;��I��H�������L�[A�����2���H��H���"���L�5� L9u�������1�H���0I��H�����H�@8H�@ H�@@H�E@I�G0H�M0H��H�������I�WPA�GI�WI�O(M�oPH�t$hdH34%(L����H��x[]A\A]A^A_�H��H�L$PH�T$@1�H�D$PH�52F�
;���������L�
N� L9L$P�݋��H�|$@�@��H�D$@H���o���H��H�L$81�L�D$HH��&H�5�6�:��������H�L$8H�T$H1�H�5�GH�=�G�"C���������H�|$HH�5�G��?��I��H������L�PA�������H����9��I�/I���Պ���<��I��H���ъ��H�t$8L���A��H��H������H��L�d$P�o���H���.���L���M��tM��upH�����H��H���_���L�D$PM���H���H�{L���H�/H�T$HH�|$@H�H�/�G���1�H���C���$���H�I��H�[h�3����%?��M�\$A����Ƌ���Œ��ff.�f���H�GH��H��tH�
�� �H9HHE�����SH������H��tH�P0H��PhH��t)H��H��1�[��H��� H�5RAH�8�@����[Ã�[����=� SH��t6�� �������8�H��� tf�H��0�0@����@8�u�[�H�=�G��� ���H�� H�P�fD��AUATUH��SH�����H�x`��@��H��I���f���I���^���H��H��t*A�$H�{ �CI�UH�uH�SH�U(H�EH�k0�@��H��H��[]A\A]�ff.���ATI��USH��dH�%(H�D$1�H;5� �����H�F��������5�� ����=�� @�������@��z��H��� @H��0D�E���Z���A��zu�H�= �-8��H��H��� f��EzL��� H�[�E H�CH�} H�E0L�]H9���I�L$H�����tAL���9��H�E I�$L�e0H�L$dH3%(H����H��[]A\�H�
� �\������޹��L��I���^:��H�=�� H�E H�H�}0L���H�=�E��� ���L�� D�
�� L�@E�������A��z����H��� �����;��L��1�I���H�E0H��u��{���遹��ff.����UH��AWAVAUATSH��H��`���H�u���l���H��x���L��X���dH�%(H�]�1�H�^H������H��H��M��H��H�BH��H���H)�H9�tH��H��$�H9�u�%��[L�l$1�I���L����4��H��x���H���-���H�rH�u�H���rH�E�H��x���M��L��P���H��8�����p���E1�L��H���M��L�m�L;e�@��O�l�I��@��p����_H��x���1�1�J�|�L���g5��I��H���3���L�HI�GI��H����H�� H9G��L�WxH�3���I9���
H�`�1=��D��� H��E�����
�� ���~���D�D8���L�5�� ff.�I��0A�>@���L���D8�u�H�=�� H��@����4��I��H�������f���@H�x ` H�@H�@0H��@���L��@����A�RM�vI�uI�U(M�rI�EM�j0�x<��L��@���M�7�Aok M�_A)oI�m�#���I�� L9��v���L��H���L��P���L��M�������M�|$A�����ؾ��I��$H������H��� H9G�����H�HA�LC_HH��H�OHI��L��I���L)�H���I��L9�tH��H��$�L9�u����I��H��L�|$L��M��I���H���I���H)�I��L9���H��H��$���ff.��M�MI�GI��H���$H�Ō H9W�L�WxL�����M9��6H�`�:��D�5�� H��E���j
�
|� �������D�D8���L�5`� I��0A�>@���{���D8�u�H�=c� H��@�����2��H���hf��@H�x I�� L��@���@ H�@H�@0E�H��@���D�XM�vI�uI�U(L�pI�EL�h0�F:��L��@���M�w��Ao] M�o�A)_�L9��R�������ff.�L;
�� ��M�EI�� M�G�I�EM�o��AoU A)W�L9��	������DL;
y� �.M�UM�I�EM�o�EoM E)OI�m�I����g����L��M���U
M�L$A�����z���I��$H������L�� L9Q��	H��HH�9A�LC9H��I��M��I���L)�I���I��L9�tH��H��$�L9�u�A��t	L)�J�L�I��I��L�|$L��L��I���H���H���I)�L��H9�tH��H��$�H9�u��t	H)�H�L4�M��I��I���L�T$M)�I���I���L9�tH��H��$�L9�u�A��t	L)�J�L�L�L$I���H����@H�u�L�U�L�U����X9��PI�ȉ�پL��L�U���/�����������l���H�}�L�E���J�����������������H��`���L��L���)3����0��H����M���r���L�5K� M9��V���I�|$�����>M��$M���-L�
� M9N�I�NpH���Ÿ��H�5҈ H9��̸��L�ڶ M9�$�����L�%��L9���M�'M�������D�=�� I�$E���z�=�� @���ȵ��@��O��L�z� f.�I��0A����[��Ou�I9H��I�,$�µ��H��X�������H����I�}H���2H�/�(�4��H��~}I�}(H��tH�/u�y4��H��tcI�}HH��tH�/u�_4��H��tII�}hH��tH�/u�E4��H��t/A�L��H��I�|5H��tH�/u�4��I��L9�u�@H�M�dH3%(L���hH�e�[A\A]A^A_]�H)�H�L����H)�H�L��!���A����L��I��I���L�T$M)�H���I���L9�tH��H��$�L9�u��t	H)�H�L<�L�L$I���M�EfA�x

M������I�EI�H�������M�] fA�{

M�Y����I�U0I�RH������M�u@fA�~

M�q���M�EPM�BH�������I�u`f�~

I�q�����M�]pM�ZH�������I���A�L�G�fA�x

O���z���K�<�I��H�� L9�u��U���L;-.� �0I�����������6���H�
� L��I��i.��I�GM�EM�oM�EM������
���ff.�L;-Ʌ �I���������O���L��� L��M��.��I�GI�EM�o���L)�J�L4��"���M�ȉھL��L�U��^.�����!���H�}�L�E���l��������E1���l������3H�E���l����H��`����M�L��L����.���u��������M�����l,��H���'M�������L�5ӄ M9��޳��I�|$������M��$M����H��� I9F��I�~p��H�5\� H9��V���L�
d� M9�$�VI�NpL�%��L9��M�'M���/���I�$D�=*� E�������H�=>9H�M��� ���L�H� H�M�L�X�X���H�������Q���H9
� uI�,$�I���H��X���t	M����H�����������E1���L�-�� I�GM�/���H�
�� H�=�� H��@���H��0����)��L��@���H��0���H��I����f��A�FI�~ AN I�FI�F0A�A�FL�NI�U(I�uM�NI�EM�n0L��@����v1��H��@���I�?�Aov M�wA)w����H�5�� M�EI�GI�7I�����H�
µ H�=ہ H��@���H��0����8)��L��@���H��0���H��I����f�A�FI�~ A~ I�FI�F0E�E�NL�VI�U(I�uM�VI�EM�n0L��@����0��H��@���I�?�EoF M�wE)GM�EI���<���H�=67H��@����� ���L�=� H��@���L�@�� �����D�A8��g���H�
Ǵ �9���H�=�6H��@������ ��D��� L�5ށ H��@���E��L�p�����D�E8����H�
n� ���L��A��I��H����H�x�O���H�
�� �l���L��A��I��H���o���H�x���I�v0L����I�NpI������m,��M���O����=����ϰ���ʰ���.����K���鍮���!���A�L��H�5"/1��~.��I������L��P����ҫ���Q���D��AWI��AVAUATUH��SH��H��xH�GL��M���H��� I9T$��L���M�������L�opM�������L���M����H�wxM��$�H���ڶ��H�OH���L���L�9H����A��$�H�EL�]M�U�׃�E��D�މ<$�����E9��/���L��H��L���o�M��uH�m�tH��x[]A\A]A^A_�H��t�I���D$�$�D$����ff.��L���M��� E1�L�kpM�������L���M��uM��$�H�sxH�����L�{L���H���M�?H����H�E�D$�$�D$A��$�M��tM�]H�EE�܉�������A9��+���L��H��L���k�H��uFH��u!H�m�����H��x[]A\A]A^A_��D�D$E��t�H�(�����馲���M��t�I�����H���F���H�FH�D$0H���4����³���r����P���fD��AWAVAUI��ATI��UH���SH��H���+��H���޸��H�~ 1�I��H���[(��I��H�������H�@0�� ���U����Ұ ���s�����P��H�=�� f.�H��0D�E����A��Pu�L�OL��| L��H��g��H�5ݚ E�QI�CI�VxA����AoM�V8I�F@I�FXAFH�&"��H�������H�P���������L��M���I9_�
I�~`H�I�F`H���2�����������H��H������H9Y����L���M���ӷ��H���H�������L���$��H�x��*��H��H��������&H�xL���(��I���H�\| L��H��L��8I��H���"���H��L���b#����������I��M��H�/u�(��H��L��[]A\A]A^A_�H�5/� L�({ L�+f���~M�HM�VxH�5V� A����AoI�~8L��I�F@M�NXANH� ��H���2���H�P��������L��M����I9[��I�~`H�I�F`H��uw���������H��H�������H9Y�����L���M��tnH���H��u]L���#��H�x�d)��H��H���A����&H�xL���'��I�������=���H�
Iz H�5o.H�9�(��鮵��鑵���ɵ���c���ff.���AWAVI��AUI��1�ATI��USH��(H�=�z dH�%(H�D$1��$��H������H��H�qd���H�Cx�(��H��H���y���H�-Cz L��L��L���X{}H��������8H��H���SH��H���2!������y���H��H��H�/������|&����� ��������
� ���������P��L�
Ϭ ff.�@I��0E�E����A��Pu�M�Qf�H��L�=�x H�5P� E�ZM�gH�C@�AoH�C0L�[8L�cXChKH�=��H�������L�hA��������H���J'��H�5Ӛ H�߀�������I��H���H����$��I��H���ӵ��L�pL���&��I��H�����M���I�H�T$H�5�� H�$�x%���������H�D$I�EI����I� H�$H�5~� �I%�����ݵ��H�L$I�M I����I�(H�$H�5O� �%���������H�t$I�u(I���I�0H�$H�5 � ��$�����ij��H�|$I�}0I��tT�L�
�� I�|�H�T$L��H�$�$��L�
ۙ H�T$���L�T$M�T�H��I9�u�ff.�I�/�-���L�$$�~$L�,$I�$$��H�5"� H���z��I��H�������H;�w t'L�@A����tyL��M��tmL�=lw M9{u`I�$H���H�5�� L��L�����#����x_H�L$dH3%(H��u"H��([]A\A]A^A_����H���_�������^"��L���6%����u����鯳���ϳ���t����a���龲��@��AWAVAUI��ATI��USH��HH�T$dH�%(H�D$81�H�|v ��8H���`���H�T$0H�5�� H��H���&#�����A���H�|$0H�������H�W����h���H�t$(���H�D$H����H�|$(���0H�=!8A���� ��H��������5
� ���eD��� E���Ҷ��H�-� E8����H��0D�ME����E8�u�L�5�u 1�L��� ��I��H���a���L�]H�uH�}L�D$�Ao@HI�CA�SI�I�G@I�GXI�W8I�O0I�whI�pA�D�J�A��-wL��0E��Kc�L�>�����T$�b#��H�������D�L$�<L��L�f��@D�HL�\$0I���H��M�WxM�_`����������H��L��H�/�O�H!��H�
�� H9���H�D$���O��+wtH�=�0��Lc�I�>A��A���H�=�� H��H�|$H��� ��H���S���L�D$H��H��H�D$I�0���L�L$I�)��������0���L;-t uH�} ��H�L$8dH3%(H����H��H[]A\A]A^A_úQ��T$�"���t$H�����<H�=�@�p�@L�D$0I�xH��L��I���M�G`�������JH��L��H�/u���L�
w� L9��:���L�T$E�A��OA��+�#���H�0A��Hc�H�>��ff.�H�}(�	���L�l$0M�T$I�|$L�l$L�T$� ��I��H���%���H�5� H����H�|$���H�������I�|$I�E~lM�\$ I�I�|$M�] ~WI�L$(H�I�|$I�M(~BI�T$0H�I�|$I�U0~-�I�|�H�I�|�H��I;D$|�ff.�@L�%9r H�T$L��H�=2r A��$8I�mI����L�����M���M���1�L���y��I��H���(���H�uL�] H��H�m(H�L$�oHHL�FD�NL�I��$L�XhL�@XL�H8H�@@L�P0H�hpH�H�H`��������p���I��$M��$H�/�M������M�l$A�����e���M��$M���N���M9u�J���L��H�5�'H������H��H�5�'H�����H��H�5�'L�����L��H�5�'L�����I���H���t���H������H�x�$��I��H���ܰ���>H�xH������M���I�,$�D����R��H��������G����q����?����I���A���H�=�� ����A���H�=M� ���A����(���H�=�&����H�e� H������H���I���L�55p 1�L�����I��H����H�-(� H�=� L�� L�L$�oUAWHH�U�MH�uI�hH�-ܢ I�WXI�O8I�G@I�w0M�GpA�D�R�A��-�r���H�
'-E��Jc�H�>��H�=�$��� �g��H�=�o D�x� H�xE���L���H�l$D�u�k�������V���騯���|������������f�H�=� H�
� H9�tH��n H��t	�����H�=� H�5ڦ H)�H��H��H��?H�H�tH�en H��t��fD�����=�� u+UH�=Rn H��tH�=>f ����d����u� ]������w������SH�GH������#��H����#�����H��H�����[�@��AWAVAUATI��USH��(dH�%(H�D$1�H����$��H;5n H����$��H�����H��H����$��L�hL������I��H����$��M����L�t$H�}H�5�� L���U�����$��H�D$I�GI����H�} L��H�5\� �'������#��H�T$I�W I����H�}(L��H�5.� ������_#��H�L$I�O(I��teH�}0L��H�5� �������t#��H�t$I�w0I��t;A�J�|�L��L�D$H�5Ύ ���L�D$��~jH�|$K�|�I��M9�u�H�m�B#��I�|$pM�|$pH��uBI�|$xH�I�\$xH���#��1�H�L$dH3%(uH��([]A\A]A^A_������"���"��ff.����SH��H�5�H�� dH�%(H�D$1�H�L$H�T$�D$������0-���L$H�T$H;l ��,��H�D$1�1�H�5�H�=5�7������,���t$H�����H�|$H��H����,��H���r,��H�����H��H�L$dH3%(H��uH�� [�������ATH��UH��SH��k H9���4��H�V�����4��H���i��I������H���|4��L�eH��H�[]A\����H��H�?H����=��������SH��H��H�����f.-{H��j f�H�H��[�u��D$�`��H���/>���D$��ff.�@H�GH�P8����1?��1�1�1������AWAVAUATUSQ�����H�=� �k��H����P��H���*��H�{i H�H����P��H��H�5�H������H�5�H���F��H�7� H����P��H�=/i �J������P��H�=�i �6�����P��H�=�i H�8i H��������]P��L�=�i H�-�i L��I���������8P��H�=�� H�-�� �������P��L�5�h L��I���������O��L�-�h L��I���������O��L�%1i L��I��$�y������O��H�="i H���^������O��H�-Oi H���G������O��H�=x� L�=y� H�-j� �%�����nO��H��H�S� H�5G"H�D� �o
��H�
؂ H�=� H�-�� H�
� ��
�����'O��H��H�l H�5�!H�] �(
��L�=ig M�wL��I���
������N��I�H��L��H�5�"����L�5�h M�nL��I���f
������N��I�H��L��H�5�"���H�=� L�%� H�-� �.
�����wN��H�5�"H��H�Օ H�͕ �x��L�-�g H�5�g I�uL��I���������0N��I�EH��L��H�5�!�8��H�=�f ������N��L�mf H�=Ɔ L��� �������M��H�=�� �������M����D��H�5�H��H��������(��H�5�H��H���������H�5�H��H����������H�5�H��H���~��H��H�5�H���8��H�=�f ���H�5�H��H���J��H�=�e ����H�5�H��H���,��H�=I�����H�5�H��H�����H�=	X�����H�5}H��H����
��H�=,�����H�5jH��H����
��1��+��H�5bH��H���
������H�5QH��H���
��1�1�H�=G�m��L�
�e I�H��tH�H��H�5,H���h
��ZH��[]A\A]A^A_�f���ATUH��SH��dH�%(H�D$1�H���4Y��H;5�e H��tH�����H����X��H��H�5Q� H���������X��H�$H���L���H���H�H���H����X��M���fX��1�H�L$dH3%(u	H��[]A\��K��ff.�H��d ATA��US��8H���
a��H��H�5U� H���	��H�����/��H���La��H�=�d ����H��H���a��E���a��H��H���v������`��H��H��H�/u����H�5{1��F��H���H���3a��H��l��H�5�� H��H�Ux����H����`�����H���r`��H���	��I��H���+`��H��[]A\�D��������H��H���on calling _ctypes.DictRemoverbytes expected instead of %s instanceunicode string expected instead of %s instance%.200s.__dict__ must be a dictionary, not %.200sfunction name must be string, bytes object or integerthe errcheck attribute must be callable_argtypes_ must be a sequence of typesitem %zd in _argtypes_ has no from_param method<Field type=%s, ofs=%zd:%zd, bits=%zd><Field type=%s, ofs=%zd, size=%zd>string too long (%zd, maximum length %zd)one character unicode string expectedbytes too long (%zd, maximum length %zd)one character bytes, bytearray or integer expectedcannot be converted to pointerunicode string or integer address expected instead of %s instancebytes or integer address expected instead of %s instanceDon't know how to convert parameter %dctypes object structure too deepArray length must be >= 0, not %zdctypes.error_object is an invalid capsulebyref() argument must be a ctypes instance, not '%s'invalid result type for callback functionffi_prep_closure failed with %dexpected %s instance instead of pointer to %sexpected %s instance instead of %scast() argument 2 must be a pointer type, not %srestype must be a type, a callable, or NoneCannot create instance: has no _type_O&O;illegal func_spec argumentthe _handle attribute of the second argument must be an integercould not convert the _handle attribute to a pointerparamflags must be a tuple or Noneparamflags must have the same length as argtypesparamflags must be a sequence of (int [,string [,value]]) tuples'out' parameter %d must be a pointer type, not %sparamflag value %d not supportedargument must be callable or integer function addresscannot construct instance of this class: no argtypesBuffer size too small (%zd instead of at least %zd bytes)underlying buffer is not writableunderlying buffer is not C contiguousMemory cannot be resized because this object doesn't own itctypes objects containing pointers cannot be pickledincompatible types, %s instance instead of %s instancePointer does not support item deletionArray does not support item deletionCan only assign sequence of same sizeGetting argument converter %zd
unexpected result of create argument %zd:
on calling ctypes callback functionon converting result of ctypes callback functionmemory leak in callback function.while processing _as_parameter_class must define a '_length_' attributeThe '_length_' attribute must be an integerThe '_length_' attribute must not be negativeThe '_length_' attribute is too largeclass must define a '_type_' attributeslice start is required for step < 0Pointer indices must be integertoo many arguments (%zi), maximum is %irequired argument '%S' missing%s 'out' parameter must be passed as default valueparamflag %u not yet implementedcall takes exactly %d arguments (%zd given)this function takes at least %d argument%s (%d given)this function takes %d argument%s (%d given)class must define _flags_ which must be an integer_restype_ must be a type, a callable, or Noneclass must define a '_type_' string attributeclass must define a '_type_' attribute which must be a string of length 1class must define a '_type_' attribute which must be
a single character string containing one of '%s'._pack_ must be a non-negative integer'_fields_' must be a sequence of pairs'_fields_' must be a sequence of (name, C type) pairssecond item in _fields_ tuple (index %zd) must be a C typebit fields not allowed for type %snumber of bits invalid for bit fieldStructure or union cannot contain itself_anonymous_ must be a sequence'%U' is specified in _anonymous_ but not in _fields__use_broken_old_ctypes_structure_semantics_Return buffer interface informationResize the memory buffer of a ctypes instancedlopen(name, flag={RTLD_GLOBAL|RTLD_LOCAL}) open a shared librarywhether the object owns the memory or notinternal objects tree (NEVER CHANGE THIS OBJECT!)a function to check for errorsthe object this pointer points to (read-write)metatype for the CData Objectsdeletes a key from a dictionarymetatype for the Array Objectsmetatype for C function pointersmetatype for the Pointer Objectsmetatype for the PyCSimpleType Objectsunhashable typecan't delete attributebyte string too longnictypes.string_atcannot delete attributeO!s#__dict__<%s object at %p>args not a tuple?ctypes.wstring_atstderrinvalid type(O)ctypes.addressof_ctypes pymem<cparam '%c' (%d)><cparam '%c' (%ld)><cparam '%c' (%lld)><cparam '%c' (%R)><cparam '%c' ('%c')><cparam '%c' ('\x%02x')><cparam '%c' (%p)><cparam '%c' at %p><cparam 0x%02x at %p>LP_%ss(O){}_type_s(O){sO}must be a ctypes typeO&:PyObj_FromPtrctypes.PyObj_FromPtrO&s:dlsymctypes.dlsym/handleO&:dlclosedlopen() errorO|i:dlopenctypes.dlopenOO!_ctypes/cfield.c pymemexpected bytes, %s foundPyObject is NULLint expected instead of float_fields__fields_ must be a sequenceOO|Ounexpected typeint too long to convert:%x__init__abstract classthis type has no sizeB(%zd,%zd)Expected a type object%.200s_Array_%ld_length_s(O){s:n,s:O}_pointer_type_cache_unpickleFUNCFLAG_CDECLFUNCFLAG_USE_ERRNOFUNCFLAG_USE_LASTERRORFUNCFLAG_PYTHONAPI1.1.0__version___memmove_addr_memset_addr_string_at_addr_cast_addr_wstring_at_addrRTLD_LOCALRTLD_GLOBALctypes.ArgumentErrorcannot get thread statectypes.error_objectctypes.get_errnoctypes.set_errnobyref???ffi_prep_cif failed with %dsPzUZXOOsctypes.dlsym_handlei|ZOPzZy*|n:from_buffer_copyoffset cannot be negativennnctypes.cdata/buffer_type_ must be a type_type_ must have storage infoctypes.cdataOs:in_dllinteger expectedO|n:from_buffernot a ctype instanceduplicate values for field %Rtoo many initializersno alignment infoOn:resizeexcepted ctypes instanceminimum size is %zdnot a ctypes type or objectsiNexpected CData instance%s(%R)O(O(NN))(%s) expected %s instance, got %sexpected %s instead of %sPOINTERNULL pointer accessinvalid indexindices must be integeruBUG: PySequence_LengthPyTuple_New()create argument %zd:
cannot build parameterParsing argument %zd
wrong typePzarray too largeslice step cannot be zeroslice stop is requiredindices must be integersargument %zd: ffi_prep_cif_var failedffi_prep_cif failed_ctypes/callproc.cGetResultO&O!nOctypes.call_functionnot enough argumentsNULL stgdict unexpected&_be__ctype_be____ctype_le___type_ '%s' not supportedhas no _stginfo_U_fields_ is finalT{UO|i%s:%s:offsetoffset in bytes of this fieldsize in bytes of this field_ctypes.CFieldStructure/Union member__sizeof___pack__swappedbytes_StgDict_anonymous__objthe wrapped objectpointerbuffer_infodlclose a libraryfind symbol in shared libraryalignmentsizeofcall_cdeclfunctionPy_INCREFPy_DECREF_as_parameter_CArgObject__setstate____new___ctypes.CThunkObjectfrom_addressfrom_paramset_type_b_base_the base object_b_needsfree__objects__ctypes_from_outparam____reduce__errcheckrestypespecify the result typeargtypesspecify the argument typescurrent valuecontents_ctypes.UnionUnion base class_ctypes.StructureStructure base class_ctypes.UnionType_ctypes.PyCStructType_ctypes_abstract_string valueraw_ctypes.DictRemover_check_retval__restype__argtypes__flags__ctypes.PyCFuncPtrFunction Pointer_ctypes.PyCArrayType_ctypes.PyCFuncPtrType_ctypes.PyCPointerType_ctypes._PointerXXX to be provided_ctypes.Array_ctypes._CData_ctypes._SimpleCData_ctypes.PyCSimpleType_ctypes.StructParam_Type�}���}���}���}��O}��p}���~���~��x~��x}��7}��i~�����\��\��\��\��\��\��\��\��\�����\��\�����\��\��\��\��\��\��\��\��\��\��\��\��\��\��\��\��\��\��\��\��\��\��\��\��\��\��\��\�����\��\�����|��e�����������������������|�����N��������������������������������������������������������������������������|��������������������U���������������������������������������������������������������������������������������������������D��D��D��D��D��D��D��D��D�����D��D�����D��D��D��D��D��D��D��D��D��D��D��D��D��D��D��D��D��D��D��D��D��D��D��D��D��D��D��D�����D��D�����addressof(C instance) -> integer
Return the address of the C instance internal bufferbyref(C instance[, offset=0]) -> byref-object
Return a pointer lookalike to a C instance, only usable
as function argumentsizeof(C type) -> integer
sizeof(C instance) -> integer
Return the size in bytes of a C instancealignment(C type) -> integer
alignment(C instance) -> integer
Return the alignment requirements of a C instanceC.in_dll(dll, name) -> C instance
access a C instance in a dllC.from_buffer_copy(object, offset=0) -> C instance
create a C instance from a readable bufferC.from_buffer(object, offset=0) -> C instance
create a C instance from a writeable bufferC.from_address(integer) -> C instance
access a C instance at the specified addressConvert a Python object into a function call parameter.Create and manipulate C compatible data types in Python.cbBhHiIlLdfuzZqQPXOv?g���;�H��������	��@	�T	�h	1�|	:��	M��	���	
��	,�
M�,
�T
W�|
E�
u�
���
���
���D��l4��b��z�����c�����������0
t���h
����
.����
Z����
f����
�������� ����<���\=���|k��������*���h]��������R������������T����h��������:���I���a�� ���8���T���h���|����*���L���Z���{�����$���L��`8��tF���b�������%���R���������������,[��@���T���h���|����������������l0�������>�������i	��$
��L�
��t�
����
����
���������%��(���P$
��|�
���`���K��D~��X���l�������8���h�����������������$@���G�������������n��$���@���j��$q��@���l����������D�����4�������H��@/���<���]�����0���p���;���E�����T�����������|��4���h� ��|	!���E!���Q!�� z"��x @$��� i$��H!p$��\!�%���!#&���!�&���!�'��"�'��4"(��H"2(��d"*���",���"2,��#j.��L#�/���#31��$�1��$$"2���$�7���$>9��%:��X%;��l%";���%#<���%�<���%�=��0&M>��d&�?���&�@��'A��8'�B���'�C���'D���'vE��(3F��T(bF��l(�F���(NG���(�G���(�H��()xI��T)�I���)EL��*�L��d*�M���*kN���*�N��+%O��<+�O��\+�O��|+{P���+Q���+�R��0,�R��D,eV���,;X���,[��0-�\��t-�`���-�c��t.�f���.�h��X/�p��l/Eq���/�q��0Tx���0iy���0w{��t1�~���1�����1����L2����2h����	ؓ����������h���x��������������(����(��������hH���������8���TX����8����؝��8���D�����H���������H���$Ƞ��h8����آ���X������H���x���X �����!�����"(���D$8����'h����*����,(����,�����.x���/(����/����0���0���0h������@x��H�� �������D(��H��� 8���#���,%���%zRx�$x��@
FJw�?:*3$"D���0
4\��@F�D�D �_
ABBJAB������������	������?E�q��~N�dA�0����jE�s
AL
�"E�Th�!E[$���E�A�A �AA$���IA�A�D @AA(����F�A�A ��AB���0��&$��08��VE�I�M k
DAEACA(l���E�A�D��AA$�j�E�N�D@�AA4�G�yB�B�D �D(�A0e(A ABB����<E�vzRx�� P�.Dj�Xn�$lw�_E�D�D OAAH�`���F�B�B �B(�D0�A8�D`�
8A0A(B BBBA zRx�`������(>�m4��hF�B�A �A(�A0V(A ABB0P��RE�I�S ^
GAEACA4���WF�D�D �
ABBAAB��]E�W�E�]E�S0���,B�D�A �G� AAB(~�<v�H�TXw�E�Otv�E�O�u�cE�U
EC���!EU
EA���.F�dA�@����F�A�A ��
CBE�
CBEDAB0�(E�^<�I8`�F�B�A �A(�G0�
(D ABBAzRx�0���� $��3�
(A ABBE4���~M�D�A �U
GFEAAB�wH n0n��E�X0�AP��H } h\����E�N0�
AAzRx�0� 5�i,����F�K�A �D@� AAB�x���AL�t���\E�R8N�LI�`T���t9�*[K�K�E�P�M�
�F�
�?�:�e�-E�T
HK	r�"	��,	z�!EU
EA(L	{��F�A�A ��AB$x	���E�A�D0�AA�	��1�	���	���	���	��E�
9�0
U�-0
n�/D
��-X
��>l
��1�
��>�
�2�
1�3�
P�3�
o�
�
���
T�$U�E�D�D �AA4��%AcL����`��(t ���XF�D�D �FABzRx� ���$��4(���jB�K�D �UAB$��E�G�G0�AA$(b�E�D�J0}AA$P��E�G�G0�AA$x=�E�D�J0�AA$���E�D�J0yAA��������
����4E�n
���8E�r((
;���jB�K�D �UAB$T
y����E�G�G0�AA$|
�����E�G�G0AA(�
b���jB�K�D �UAB$�
�����E�G�G0�AA$�
����E�G�G0�AA, �����F�D�A �G0� AAB(P�~��oE�D�G t
DAAzRx� �� ����3����0�:���-�S���0�o���-�����0��$����8����.L����*`���EHx���QE�J @A �|���QE�J b
AAzRx� � ���������ZE�J0IA��aE�J PA,"���EHD���ZE�J IAd��� xB���'N�Q�H�M���}B�B�E �E(�A0�A8�D�^8A0A(B BBB,��|���F�D�D ��
ABKtN���Xg
GBB(0D~��yE�D�G0D
DAGzRx�0�� >���DAA(�)���jB�K�D �UAB$�g����E�G�G0�AA$����E�D�J0}AA$N����E�G�G0�AA$8�����E�D�J0�AA$`0����E�D�J0yAA0�����B�D�D �G0 AAB�8}���E�}
N�]�����}��jE�x
S�E���CH �~��zB�B�B �B(�D0�A8�J��
8A0A(B BBBA$zRx��������,��������JMzRx�����
 �����E�X �
AOXx���!,$`����F�D�A �[
ABA�U���Vh����]E�Ot{���
(����E�A�D �
DAALE���Q�l���Lt��j���-N
�EY����Y g���
,4�����F�D�D �V
ABA�	-���V,x����F�D�D �V
ABI
?���b�X���gE��
A�m������������b,���wF�D�D �U
ABA�
#��](\H����A�A�D �
DAA@��Q�Ȅ���E��
J�]���4�����F�E�K �D(�A0c(D ABBM��<Ev( ����E�A�D _
AAA�E��H`=��)F�H�F �F(�D0�D8�G��8A0A(B BBB����=E�_
GQH�����F�E�D �A(�G��C�k�A�r(A ABBt��)H,h����F�B�B �B(�A0�A8�A@�8D0A(B BBB zRx�@������(��8���:F�E�A �A(�A0"(D ABB$�
��yE�L�D0aAA[���E�X0�A4Є��:HqL���E�X0�Al���5E�o��������2E�l8�����F�B�A �G(�G��(A ABB(�_��F�A�D ��AB $���.4	��+JPHHHT*	��8F�E�H �B(�A0�D8�GP	8D0A(B BBB0��� F�A�D �M0 AAB8����F�E�A �D(�D0�(D ABB0t����F�A�D �D0�
 AABAzRx�0���$
���x�
��6ER
EYL�܂��F�E�B �B(�A0�A8�G�
8A0A(B BBBA$zRx��������,^
���0$��aF�A�A �D�P AAB$X2���E�A�A �AA(�ij��I�D�A ��AB������������8����F�B�E �A(�A0��(A BBB($K���F�I�R �cAB0P���IF�A�D �Q@( AAB0����YE�A�B ~
GAEACA0�����F�A�A �D@� AABh�\���V�B�E �E(�D0�D8�D@G
8D�0A�(B� B�B�B�BA8M�0A�(B� B�B�B�0X���vE�A�E ]
AAEDAAH�����B�B�B �E(�A0�D8�Dp�8D0A(B BBB<�D���F�B�B �A(�A0�DP�0A(A BBBl���),���@E\
EY L��kE�P0TA4pR���F�D�A ��
HBEACB����/R\����2U\4����F�B�A �D(�A0�(D ABB0 ���\E�A�D D
AABGAA4D ���MM�A�A �&
GBEFAB(| ����o�D�A �IAB0�  ��~E�A�E ]
HCEACAx� f ��OB�E�B �E(�D0�A8�E@D
8J0A(B BBBB�
8I0C(B BBBEg8D0A(B BBB\X!9"���F�E�E �E(�D0�D8�GP`
8J0A(B BBBEG8A0A(B BBB4�!�"���F�D�D �h(L0I(A AAB4�!�"���F�A�A ��
CBEAAB("�#��vE�X WA$H"l��PE�f
EZ
ADp"�#��DF_
EY�"�#��cE�y
KY�"$$��fFA
EY$�"j$���E�mR FAA �"�$���FlR IAAH#;%���F�B�B �B(�A0�A8�Dp�8A0A(B BBBh#�~��jL�z
At �&��H�#�&��sF�E�B �B(�A0�A8�D�S8A0A(B BBB0�#�)���F�A�A �G0� AAB4$\~��rF�B�A �D(�D0W(D ABB0P$7+���F�A�A �G0� AAB@�$�-���F�B�B �D(�G0�G@�0A(A BBB8�$Y/���F�B�A �A(�DP�(A ABB�%�2��cF�B�E �B(�A0�A8�A@w
8G0A(B BBBE�
8A0A(B BBBEp
8C0C(B BBBEH
8I0A(B BBBEP
8A0A(B BBBE�8D0A(B BBB@�%g5���F�B�B �G(�A0�DP�0A(A BBB0&�|���F�D�A �D0
 AABA�7���,T&p~���E�C
P������
A$zRx�������,19���&1A���H0��&�A���H0�d�&����jF�E�B �B(�A0�D8�G��
8A0A(B BBBA�
8A0A(B BBBHt�A��rHl'x���bF�B�B �E(�D0�I8�GP�
8D0A(B BBBA zRx�P������(�G��H�'d����F�B�E �G(�D0�A8�D`�
8A0A(B BBBA`$yH��LP(����F�B�B �E(�D0�A8�D��
8A0A(B BBBA$zRx��������,�I��dH�(KM���F�B�B �E(�A0�D8�F��8D0A(B BBBt()�P���F�B�B �B(�A0�C8�G���G�J�J�m�Q�G�J�J�f�8A0A(B BBB4�)M`��eM�D�D �~
FBEAAB4�)z`��UF�D�D �r
IBEAABGNU� a�`@�!Ufr}��i
�k0�!8�!���o`� 
6h�!H�Z�.,	���o���o.���o�o,���o�H�! j0j@jPj`jpj�j�j�j�j�j�j�j�jkk k0k@kPk`kpk�k�k�k�k�k�k�k�kll l0l@lPl`lpl�l�l�l�l�l�l�l�lmm m0m@mPm`mpm�m�m�m�m�m�m�m�mnn n0n@nPn`npn�n�n�n�n�n�n�n�noo o0o@oPo`opo�o�o�o�o�o�o�o�opp p0p@pPp`ppp�p�p�p�p�p�p�p�pqq q0q@qPq`qpq�q�q�q�q�q�q�q�qrr r0r@rPr`rpr�r�r�r�r�r�r�r�rss s0s@sPs`sps�s�s�s�s�s�s�s�stt t0t@t	
��~���ـq�̆�HS���@���)���!d��������P{ �/��+��!�&7�C�0H�M�r�^�����%[�%�?�c�>��{Ƀ���{�@c�{�ӏo����������@����0��h���@�{~�����
��m���Ç"�͇.�ׇ�@�%3� �!�������@��<������_��`������C�s���(�r� �3��(��� ������_��`������C�s���(�2� ������_��`������C�s����<� E�U� |c�@P|l��~��@��~����~_��|��*�j������paˆ�~�~�����~P�C�|�10<݈l��*����L��|4H������`��!��~0%��0�`��!%��~0%��0:��!�$D�|�)�/@�!��L��!i$D�|�)�/@�!�kZZ�j�|�
��u���c�ʂ|�|�=��u�Z�(��(�-�(�p=Z�� T�|ZZ�l���������(���ׇׇƉ��5B� �!�N��!ى�'�2��!�8��!}@�!�����!D8}�)�/@�!�T��!D`}�)�/��!`Qׇׇ-�``�!�!��!��!>��~0%��!3���Q�``�!@�!��!>��~0%+�0_�`p*���!>��~0%�!`�!n�`��`�!��!>��~0% �!��! .0���!�}��!�Xׇ���s*��b���B˛U�cݗ�d�d@'ܣʣg�ȗf����i���hr�#�ڨ�H1�����v�i/I�G��I�4{��M�lp1�����L2pdb��q��ӡ���Q�v�I�F�Pd�z�'��u��UC��Z(�Œv��f�?s�Z�O0'`'b�`���������GA$3a1�i�k_ctypes.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug)�
+�7zXZ�ִF!t/��<�
�]?�E�h=��ڊ�2N���� ��HB�k�L�xe+F�c����hG+e�OZ��z�W׃�"TؘP��rД��C_����V�U[�l|��*�;�p��"h�g�?�l�jB�oq�z��p�K"��������0���)���f�p���V���c�����/{��jo��;O��f!��q�����:�-�Dv%�f{Nv����fmA"'&	�+�aٙ��BW�%�w�-uq�q�*�H���)"^N�
pU���41UF�ձ�"����كym�Nd���9�pT�`��ߧ�����K�xSګ���;�&"]AE�,���ҳ@!��Ӕ�db�J�+�%�:�j������#�jpgq4~1� ~�ӷ J\˙���y���"����4
3D�`{���m:�	�[��eD4�m;��U����L��:���z�
L���n�R%��~[+��k�����u@��pw&�)���=\��[� �B�������p�v.����1Óg�8�ZE3R�!�����z��Z���hݓ81,A��e�wg[!��\�&�[[B�ي��dd��(�1/7�$���±D@o�=Yu�>�IW�1��&���S������H�E���E� �z�f���(�:N�������8�xg��M1��K�L#T,������
��~��S��,��#���0� &X���3��ɨ�&UJL'mӮ.u��|-Y#���[��)D�i��X�9�^ہZ	�oG��	����q�/�j�F��2g��
�VDj��Pz/�n+�����('�7'A����{XO��z!~���ˬ��u*�y��V�Nh����]8���)�qԖR����$ׁ��vY����@�Y@�Y37
)v�Tr�I�*��;��R򢩢�&��|wi�عa1��K,nܕ��R�J%��kG�#U�K���{>�vx�Ǩ�C��AL�-�@����chP��葕�}�U��o���S�t�E Ӎ?�X,�н����yX���J���B�s�H\o>��^��`B�_�P�`�K�n�ݾ��g�C+�q�����}�a|4n�I�QJ4��Mm(����z�^�k��Z"�ˏ������w�J��I�>���H�U��'P������L�<\?o��9?�7�P��|o��b����?+�G�ޣ	�P��R�_�D�6\�k-����w$�'�W��H.Ri�P�Gl$�
�SY;v�"����Z���͢���]�B��U��_o̲k=�Xi���t���W�y��A�P.��Ŧ��z�,]㱿vc9 R����p����:�6��?�Ւ|�?����v��{S�O)�6�O%@#9�dA�KL1J�n��y]���EƮ۴�2�%� �;?g��5��b���N��O|y��L}7���tP#��G�q��.7Zn�N�ia�e�"�-^�L�tW�.}+R �E^��1�(��s�U�5m�.F�sl`�5�_� ��,H���]�Uot�t�a�G����������}�0��:O�g��#�k�M�'����=��	���F��"�a%��w�wzQ"?�Tke95��Rm"��&�k(t��'���#���m�h(�N����;1W���5��kOq}<�ԣ�b��sz�]�P�弝��E���Ŗ�D��OB��w�Lxu���^
k�F����+�i��|=�>�'�M��x�#/���ʔ�v9��c�,��ř���?1~�f��5f����pK�WQk�S��M������=���#�gE?U��[��w�g�6���[3�E�46�?1R���/���t�s�����n1/�Lp�K�P|��Ū��L�����CC|Z��2X?�!�zZ��v7RP��Auɞ`F+���8d��K	L|�����=�#�7�����"�)��|H6�
V>��Z"�k�9�uC�����n+���<Cs�ʢ����(<�j;6�����;��#o:�E�zL��,�AL�Q��'7Ȯ�k3�9�lE焣�{�o��GSJ�=ZB�
j�z2���Q/����������1*�O�875n��1�����J"#F�2D*bğ:h����Zk'XF%����4���˺��^�4oN�^�
w�
�-��XI��f	�*�3}�+V�QqQe���-:B3��uI}
'.��Y�(�Y(�3��A;o�L'+_���,����0k >�n�ڏ�]�(��58&�	Y����Wdk���037���Hջ��Z��������E�x>MKh1N�1A
|o(��b�?t�4�%B%4�Ghd�����Kc�"m��m֥��h�+Vp-&��bK��]�%�¦�����_��|KtU̸߭!8�h래*�Q\B�we6�XbA�[������,TI��<;U���dA1�^�O��64!�]��K-֙������������ѧ�D��1�?-+�����h�����!�6�
�ꞩN�R��c�� �o�"h�f+ۿƫ�1
�<&"�:�qe;}�,P���Yk
��i.��m��tW#��8`DY!'�y6��>�$A��IY��̃��7~Y��Z��b���fl3�p�������X�(��*8�d���i���F�.8�����eaʱ;f;����@�J�]���}��N�i�@����Z���2	N'k�[��u������BUJξ��q�5Bg�_nAd�06Vp<G\��h��4s��;�ɋ��,�ȅс6�7�n`�R�T|�u�L�U��)S�x��J�ݭ��a���3A��z�ց���
�ĕBO9�|��C?�дޓb�%[����I���~��~�k*Ġ6��X@{��["ƃ�!�ei��x�PR����.�$eu�g@�qW�����?���.1�s�C���/Z :��W4;G6Rb��ϑ^^zD)�)�Ӹ����W�+	�:�5��:���Bm7˝M2�IyqƐ�JիGW�O�w��n��B���w>7�.�I�?ta��;�h��_F! [�\9�|����
)�i��8k�G?���q�n|�8!yZ��iܶ#Ӆ�9����
�3����X����DW�I�!v�.�kz`�,U��v�����v�_���ZS��6�]��Kb���`��d�y!�_��I��Vz��SP䷂G�<���~y[WQ�Z�g9ړo���5�碑����������oR�=�jt �Մ�����}����բ+�)���s ?�����?�=���Nf[a:���ʫ5�J��`�'���1�L��Ҭ�J����[�b�� ��3CT��;��K�[Ҵ+�E+7'�����d�ıxڔ�Nٞ>�X�U(ʺ�s��p����[�xqR��y�5@\�Z�h+ ��I�e}�ut�{h/�M�h�y�'�
�BǣN<9��7�xY�>�ﲮ�K�Gn�9��Edp�7���\N*3�0�#�CY%굁�?ږ�?��Xo{/T�2>�iB��y�����g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``�(  �0��68���o,,�E���o..�T�.�.,^B�Z�ZHh�i�icjj@
nPtPt0
w�~�~^�}�k�k
�ll�% �ȑȑ��x�x�*����� �0�!0��8�!8��@�!@��H�!H� �h�!h����!��7 ��"�@��b�$
�`(4(lib-dynload/syslog.cpython-38-x86_64-linux-gnu.so000075500000027010151153537510015431 0ustar00ELF>�@�&@8	@�� �� � ��   888$$���  S�td���  P�tdTTQ�tdR�td�� � GNUx��*�/ʠ�zW�V�F�@ ��|CE���qX�z�	J B�� �Y�, �F"�l������%���1
�! ��! ��! �0�__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6PyArg_ParseTuplePyLong_FromLong__stack_chk_fail_Py_NoneStructPySys_Auditsetlogmaskcloselog_Py_DeallocPyArg_ParseTupleAndKeywordsPySys_GetObjectPyList_SizePyErr_ClearPyUnicode_AsUTF8openlogPyList_GetItemPyUnicode_FindCharPyUnicode_SubstringPyTuple_NewPyEval_SaveThread__syslog_chkPyEval_RestoreThreadPyInit_syslogPyModule_Create2PyModule_AddIntConstant_edata__bss_start_endGLIBC_2.4GLIBC_2.2.5vii
ui	�  � �    ]  j   <(  @  �H  3`  *h  ��  �  #�  ��  �! � !   `! �h! �p! �� � � � 
�   ( 0 8 @ H P 	X 
` h 
p x � � � � � � � � � � � ��H��H� H��t��H����5: �%; ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h��������%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%} D���%u D���%m D���%e D���%] D���%U D���%M D���%E D���%= D���%5 D���%- D���%% D���% D���% D��H��H��H�5#dH�%(H�D$1�H�������1���t�$��H���Hc��G���H�L$dH3%(t�"���H�����H��H��H�5�dH�%(H�D$1�H���S�����1���tH�$���Hc����H�L$dH3%(t����H�����SH��H�5zH��H��dH�%(H�D$1�H������u1��8H��uH�4 1�H��H�5OH�=L������xԋ<$���Hc��`���H�L$dH3%(t�;���H��[���Q1�H�=1������1���x@�=a t-���H�=K H��tH�H�8 u�	����2 H�� H�Z���ATH��H�
� H��UH��SH��(dH�%(H�D$ 1�H�D$H�D$H�D$H�D$P1�L�L$ L�D$����ZY��u1��<H�,$H��tH�E�/H�=v�\���H��H��tH������H������]���H�,$H�=j H��t
H�u�3���H�,$H�-P H��tH���k���H��H��t�L�D$H�L$1�H��H�5�H�=��1������[����T$�t$H�����H�j
 �� H��{H���p���H��1����H�PH�����R���L�`M���E���A��1�L��/H������H����%���H���tL��H��H�����H���	���H�H�����H�L$dH3%(t����H�� []A\���ATI��USH��H�5"H��H�� dH�%(H�D$1�H�l$H�T$�D$H���'�����tH�|$�)���H��H��u&�����1�H��H��H�5������u�1���T$H��1�H�5�H�=�������xـ=�
 u;1����H��H��t,1�H��L���p���H��t
H�uH���T���H�uH���G������|$H��H�mI�ľ1����L�����H�� H�H�L$dH3%(t����H�� []A\�DH�=	
 H�
 H9�tH�V H��t	�����H�=� H�5� H)�H��H��H��?H�H�tH� H��t��fD�����=� u+UH�=�
 H��tH�=� �����d����m ]������w������S��H�=� �:���H��H����1�H�5AH���-����H�57H�������H�5-H�������H�5"H�����H�5H�������H�5H�������H�5H������H�5�H������H�5�H������H�5�H���y����H�5�H���e����H�5�H���Q����H�5�H���=���� H�5�H���)���1�H�5�H�������H�5�H�������H�5�H�����H�5�H������� H�5�H�������0H�5�H�������H�5wH�������H�5nH�������H�5eH���x�����H�5\H���d�����H�5SH���P�����H�5JH���<�����H�5AH���(�����H�58H�������(H�5/H�������HH�5&H������@H�5H�������8H�5H�������PH�5H�����H��[���H��H���l:LOG_UPTOl:LOG_MASKl;mask for priority(O)syslog.setlogmasksyslog.closelog|Ull:openlogsllsyslog.openlogargviU;[priority,] message stringissyslog.syslog%sLOG_EMERGLOG_ALERTLOG_CRITLOG_ERRLOG_WARNINGLOG_NOTICELOG_INFOLOG_DEBUGLOG_PIDLOG_CONSLOG_NDELAYLOG_ODELAYLOG_NOWAITLOG_PERRORLOG_KERNLOG_USERLOG_MAILLOG_DAEMONLOG_AUTHLOG_LPRLOG_LOCAL0LOG_LOCAL1LOG_LOCAL2LOG_LOCAL3LOG_LOCAL4LOG_LOCAL5LOG_LOCAL6LOG_LOCAL7LOG_SYSLOGLOG_CRONLOG_UUCPLOG_NEWSLOG_AUTHPRIVidentlogoptionfacility;P	��lL����������~��������f���/���P,����zRx�$X�FJw�?:*3$"D��p\���cH ZtS���_H V������E�Q qA����_EY8�J����F�N�H �DHqPRHA@` AAB0���8F�D�A �Q@ AAB4�����E��GNU� � Ufv�
�� � ���o`��
% (�
0X	���o���o���o�o����o ��

 
0
@
P
`
p
�
�
�
�
�
�
�
�
 0@]j<�3*�#�����������  ���GA$3a1��syslog.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug�1�7zXZ�ִF!t/���Y]?�E�h=��ڊ�2N�!� �.;8��'dB�s�}:Rx��Ó�����#�T� �I�n��՗6�<V#�ΦLi����:�OD}����~4
W
gl;�7S��KQ�1U�;q�h����� ��A�=v�;���2�2�F��/dݣ�V�iw��(�^GCP����
�L��X�V�O���`�p�[�������G���_��&q6�:Mx�.�I1��j,�5
����Y�
��HP��c�d��+�9���V5�﫧R�k���J8P�+�~�s�;>0D͞�q�e�o�G)���R��� ��!�M-+s���?ڝf��,��޳���SI<������}��O�bd>��(0���t�R{�����4���gN�YN��y�~��I�P���y�V�/����fzj�ifeܢ?"D3O��(��Ԓ����`�.�IFZm+L���ʚ�$�2A^���aH���l�,)�$5�ĘS�E�O	�w�S�0@+��ZqQ�QN�!f��3��q����z�GqK2�ݯ��#���n�kN���X�k3~df	�{�@�'EfkG�Ҁ��C��n�r�ͪ�.�Ź�^�?u�r��	�aa�B�'6”��8YcP3�N��r;��U�����`*(��0,'�ݔ{��\��(�6��İ�-{�s�zІPt0��}=�?d�k7ܞS�`��.�z�3�q� B��j����S��;��
��
�N����c��ŏ����ɿ'�A�{��s.}�K��Ѷ�p���*�&@:��9q������w�%yp�Ҩ�^���䧶�N��y�k@f<j+,�SM�<�y�-�;[X��&�ˢ�������g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(��0��%8���o��@E���o0T00X^B�
�
(h��c���nPPpw��%}��
�2���T�XXP��� �� ��� �� � � ��   � ��! �!��!`�!$
�!`"��%(lib-dynload/_codecs_iso2022.cpython-38-x86_64-linux-gnu.so000075500000067310151153537510016677 0ustar00ELF>�@�g@8	@`F`F �U�U �U �
�  ] ]  ] 888$$@F@F@F  S�td@F@F@F  P�td>>>��Q�tdR�td�U�U �U P
P
GNU�j��^u�[<�Ϣ��a��` `SB��|CE���qX�U 8r , *F"����#��������;Ha ��` ��` __gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6__stack_chk_failPyImport_ImportModulePyObject_GetAttrStringPyCapsule_IsValidPyCapsule_GetPointerPyExc_ValueErrorPyErr_SetString_Py_DeallocPyUnicode_AsUTF8strcmpPyCapsule_NewPyObject_CallFunctionObjArgsPyImport_ImportModuleNoBlockPyExc_TypeErrorPyExc_LookupError_PyUnicodeWriter_WriteChar_PyUnicodeWriter_PrepareInternalPyInit__codecs_iso2022PyModule_Create2_edata__bss_start_endGLIBC_2.4GLIBC_2.2.5vii
ui	�U @9�U 9�U �U �U `;�U ��U  (V �20V w8V �PV R$XV �$hV �2pV wxV ��V �2�V w�V ��V �9�V 4 �V | �V R$�V �$W �2W wW �HW �2PW wXW �hW �9pW 4 xW | �W `;�W ��W  �W P9�W %�W K%�W R$�W �$�W �2�W w�W �X �%X �%0X �%8X �%hX 0:pX �"xX �.�X �2�X w�X ��X 0:�X �"�X �.�X 0:�X �#�X �.Y 0:Y � Y 1.(Y �20Y w8Y �HY 0:PY � XY .hY 0:pY K"xY o.�Y �2�Y w�Y ��Y �9�Y 4 �Y | �Y R$�Y �$Z �$Z �$(Z �20Z w8Z �hZ �Y xZ Y �Z `X �Z @W �Z �V �Z  V �Z �U �Z n=�Z �Z �Z /�Z  0[ 0[ 2[ �4[ �1 [ 2([ y=0[ �Z 8[ /@[  0H[ 0P[ 2X[ �4`[ �1h[ 2p[ �=x[ �Z �[ /�[  0�[ 0�[ 2�[ �4�[ �1�[ 2�[ �=�[ �Z �[ /�[  0�[ 0�[ 2�[ �4�[ �1�[ 2\ ?=\ �Z \ /\  0 \ 0(\ 20\ �48\ �1@\ 2H\ �=P\ pZ X\ /`\  0h\ 0p\ 2x\ �4�\ �1�\ 2�\ �=�\ `Z �\ /�\  0�\ 0�\ 2�\ �4�\ �1�\ 2�\ <` �=` @3` <h` �=�` ` �_ �_ �_ �_ �_ �_ 	�_ 
8_ @_ H_ P_ 	X_ `_ h_ 
p_ x_ �_ �_ �_ �_ �_ �_ �_ ��H��H��F H��t��H����5BF �%CF ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h�������%=E D���%5E D���%-E D���%%E D���%E D���%E D���%
E D���%E D���%�D D���%�D D���%�D D���%�D D���%�D D���%�D D���%�D D���%�D D����������������������������������D$<����A�<$BuYA�D$tH���mL�H��A�A�d$�H�H���OH�;�t$<H��@�7M�I�rI�0H�L9����H���H�;H���L�A�B(H��@BA�$BH��v���M�U�T$H�L$ L�d$M��L�l$M��H�\$(L�Ӏ;t[H�D$@L��L���SH�����f���tFf���uH�� ��I��M��M��T$H�L$ L�d$A�L�l$H�\$(A�2@��ui���L��I+$H��~@H�D$@L��L���Sf���t�I��M��M��T$H�L$ L�d$L�l$H�\$(L�\$@렃|$�(H�T$@�A�z@��t@���H������KA�D$t!H����H�3H���A�d$�H�A�2A�zA84$tP@����@�����H����H�3H���H�;�G$H�3�F(A�2H�;��@�wA�:A�<$H�A�z�'H���ML���H��f��A�:H�3�FH�I�0L�I�0L9����H���H�3�H�;�G(A�2H�;H����@�wA�:A�<$H��H������>A:t$tDA�ztgH����H�3H���H�;�G$H�3�F)A�2H�;��@�wA�:A�|$H�A�D$� ���H��~}H�3H���A�L$H�����H��~^H�3H���H�;�G)A�2H�;��@�wA�:A�|$H��H��~+L�H��A�H����H��~H�3�H�;�G$���H���\�q�\���������H��H
QB L�M��t(�W�q@8�r:Q	w)�Hc�A�@=��u�������������wE���H��H
�A H�1H��t-�yD��A9�r D�I	E9�wA)�fB�Ff���tf��y��������!u�@�<�t@H��H�A ���L�M��t(�O�r@8�r:J	w)�Hc�A�@=��u�������������wS��<�tF���H��H
0A H�1H��t3�yD��A9�r&D�I	E9�wA)�fB�Ff���tf��y	��ø@!�������H��H
�@ L�M��t(�W�q@8�r:Q	w)�Hc�A�@=��u�������������wM���H��H
�@ H�1H��t5�yD��A9�r(D�I	E9�wA)�fF�FE�����fA���wD��f%�������.u�!���ulÀ�/u�~���u[À�Ou@�w���@��T�.@��~u<À�tu�'���u+À�~u�G�H������wÀ�!u�@�<���L�
�? H��I�M�M��t)�GE�QD8�rA:A	wD)�H�A�@=����L�t? I�I�3H��t"�GA�K8�rA:C	w)�H��F=��uyL�
8? I�M�M��t+�GE�QD8�rA:A	wD)�H�A�@=��t
�H�> ���L�M��t(��r@8�r@:z	w)�Hc�A��=��u�������H�5�> H��H�L�M��t!�G�V8�r:F	w)�H�A�@=��uBH
h> ���L�	M��t.�D�QD8�r @:y	wD)�Lc�C�Y����t��
������!u�@�<���H�5B> H��H�L�M��t%�G�N8�r:F	w)�H�A�@=����L�
�= I�M�M��t%�GE�YD8�rA:A	wD)�H�A�B=��uwH�5�= H�L�M��t'�G�N8�r:F	w)�H�A�@=��t
�Ho= ���L�
M��t*�D�RD8�r@:z	wD)�Hc�A��=��u�������H�5!= H��H�L�M��t!�G�V8�r:F	w)�H�A�@=��uBH
�< ���L�	M��t.�D�QD8�r @:y	wD)�Lc�C�Y����t��
������[v����\t#��}w��ø> ��~t������E�������w��\t��~�����E�ø\���t��> ������~D���������€�J_��>w	�����������������>w����������H��H
�; L�M��t(�W�q@8�r:Q	w)�Hc�A�@=��u�������������wE���H��H
d; H�1H��t-�yD��A9�r D�I	E9�wA)�fB�Ff���tf��y��������������H��~?H�H���1�H��g��?Bu�H��~H�
1��H�2�F(L�A�@BH��B�H���H�=�9 H�5H�?��H�mt���H���F���H���6�H�M1�H�q�H�uH���qH����1��b���F���j���r�������6E1��
H�
19 H�5RE1�H�9���
H������
H�&9 H�5�E1�H�:����l
A�F�'I�T$H��E�K�A���QH�L$�tL9�}
A��&�|I��H���NL9�|�H������DH������8E�VA��B�8H�t$H���{D8�rH�L$�QL9����Q��=������=����A��D��A��D��E9�AC�;SwhH�{H+{ H��~ZD�SH�CL�[ A����A����F�$��sM�K��������F��H�C H�L$�QII)����H��D�D$��D�D$��y�H������6H������*H����H���FH���p���H�������E�NA��A��A��F��A��B�;�@���D@��H�������k���I�I���L�\$M�KE8tI�� �L�L$�p���A��$uBD�g�oA�̀@��(t@��)u.�D$L�L$M�AA����!A8���I�� ���5�0�w@�������H���P���`�������D�WE�Z�A�����A���wA���;�(��`���H��r�A���vzA����A��A���w��L���A�w���I��sT���H����������Q���H������
��}
��s
A��H��������������A��!tA��"t*A��/t>��>
� H���l���|������� H���R���b�������� H���8���H���������B�|'@�x���I�T$�n���H�t$�t%�u}�$���B��A�����C����D�gA��$tEA��(tA��)tGL�\$A�tCE��tC�D$A��B����H�D$I)�H���E�$I��A�̀����>�D$���2�-�(�#H�������L�t$A�F���H���4�������������H�������i������F�$H�CL�[ �1���fF�$XfB�lX�>���F�D�4�������E1ɹ.	��Lc�F��D9�s	9�t Hc��
D9�tD9�vA��A�	�A9�u�Hc�H�ʸ����;:u�B�H�H��tSI��H��H����H����������ve����������u
H�������H��Hl4 L�M���zD�XD��E9��h�P	A9��[E)�fC�B�H��������@�Ɓ��O��	ց�]R@��	���TA��D	Ɓ�SVA��D	΁��YA��D	ց�[\A��D	ށ�w^��	Ɓ�&v��@�����k~���;����������H�5�3 ��H��H�I��H�>H��t&D�FD��E9�rD�^	E9�wE)�fB�Wf���uvH��3 L�H�H��t`D�H��D9�rS�p	9�wKD)�f�Jf��yC�=�wH�3 �?���f���u"H�A�;1�H��2 ����f���u��[Ã���������������������f���F����UH�.��SH������H��tH��t
�f���t���H�;�����E�[]���������Pf��v
f��yf%�����1��������������f���F����UH�.1�SH���[���H��tH��t
�f���t���H�;�����E�[]���1��(����Pf��v
f��yf%�����USQH�_�;��H�CH��t
�Ѕ�����{ ��H�k(H��t
�Յ�����{@��H�CHH��t
�Ѕ�����{`tzH�khH��t
�Յ��f����t^H���H��t
�Ѕ��O����t?H���H��t
�Յ��8����H���tH�]H��t�Ӆ�uH�� �}u�1�Z[]���@���BB�Gf�1��ff.�f���AWAVAUI��ATUSH��XI�0dH�%(H�D$H1���$�H��$�H��$����D$L9���I��L�|$@L�t$<@������tL��B�t�t$<���&A�<$B� A�D$��H�H��@�0M�I�sI�0H�I9�~R�41�t$<����A�<$B��A�D$��H�����L�H��A�2M�I�CI�H�I9��g���1�H�|$HdH3<%(uuH��X[]A\A]A^A_�fD������41�t$<���h�A�<$B�,�A�D$���H���<�L�H��A�2M�I�sI�0H�I9������y�������������	������ff.�f����BB�Gf�1��GB�f����B1��g��f����G���?B���1��fDAUI��ATI��USH��H���8�H�����H��H��H�����H��H�����H�5�	H���F����{�H�5o	H���O�M��tH�PI�UM��tH�@I�$H�+�}�H�m���1�H��[]A\A]���Q�=�- t��- 1�Z�1�H�3. H�5V	H�=`	�(������`�1�H�
. H�5]	H�=<	������t��;�ff.���ATUSH�F����7�H���o�H��H����H�-<- H����H��H�=�	�������H��H�=�	������H��H�=�	����tCH��H�=�	������L�%$( H�=\	H���u���tI��HI�<$�?u���L�%h' 1�H�5�L����H��H����1�1�H��H�����H�+I��uH���+�L��[]A\�L�%�& �H�=���H��H����H�5�H�����H�mH�', ��H�-, H���������L�%}& �X���L�%' �L������ff.�@��AWAVAUATUSH��(H�t$H���E1�I��I��I��L�d$L��A�FI�?���/���L$��A���{@����(@����@���{@���.@�������E�A��B�@��H���/������I�I��H�xI�?�hA�F����@��
�p@����@������h�E�A��B��@��H�������<�I�M�e�M��H�zI�?M����A�F�j���@���"��@����@����@���4@�������E�A��B�@��H���5������I�/M�l$�H�}I�?A�F�m��@���������@���F@����I���`�D�GA��.�F�5A��H��$L������H�������'�A�NI��I����f�@��
������
H��A�F�r������I�I���ff.�f�@��
����@�H��([]A\A]A^A_�@��H��� ������I�/H�}I�?I��tJA�F�m��e����@��H��������k��@I�I��@����M������H��(1�[]A\A]A^A_�L�D$A��r�����H��I��A�FI�?��H�l$�E����A��N�����I���/��6�H�t$��(�����H��I��A�FI�?�v���A�f��l�����������@H�=( H�
( H9�tH�&' H��t	�����H�=�' H�5�' H)�H��H��H��?H�H�tH��& H��t��fD�����=�' u+UH�=�& H��tH�=� ���d����u' ]������w������Q�=l' uD1�H�i' H�5�H�=���������1�H�
M' H�5�H�=������u�' 1�Z���ff.���Q�=�& t��& 1�Z�1�H�C' H�5fH�=p�8������h�1�H�
' H�5^H�=L������t��C�ff.���Q�=�& t�t& 1�Z���������1�H��& H�5#H�=���������1�H�
�& H�5H�=���������1�H�
V& H�5H�=��s��������1�H�"& H�5�H�=��O��������1�H�
& H�5�H�=c�+������k�1�H�
�% H�5�H�=?�������G�H�
�% H��% H�5�H�=��������������Q�=L% uD1�H��% H�5�H�=���������1�H�
�% H�5�H�=}�����u��$ 1�Z���ff.�����H�=`$ �����H��H���multibytecodec.__map_*map data must be a Capsule.__map_gbcommon_codecs_cn__map_gb2312__map_jisxcommon_codecs_jp__map_jisx0212__map_jisx0208__map_jisx0213_bmp__map_jisx0213_1_bmp__map_jisx0213_2_bmp__map_jisx0213_emp__map_jisx0213_1_emp__map_jisx0213_2_emp__map_jisx0213_pair__map_cp949_codecs_kr__map_ksx1001iso2022_jp_2004_multibytecodec__create_codeciso2022_kriso2022_jpiso2022_jp_1iso2022_jp_2no such codec is supported.iso2022_jp_3iso2022_jp_extgetcodec_codecs_iso2022encoding name must be a string.;�6����������`����<�Pg�d��x$��l�����;��������B�{���,��@��T;�h��|��������$P�lX��`��h��p�,x����0��D�X���!�_������������t�����(� ����0���@�����@���8����� ����P�������zRx�$���FJw�?:*3$"D���(\���E�A�A �
AAAzRx� �� x��8�t�L����F�B�B �E(�A0�A8�D�

8A0A(B BBBG$zRx��������,���X��l������H����W����X�?��e����H����_���pk�� ��4���H6�9\[�=p�� ������H���W��
���T����I4L��B�E�D �A(�G0�(A ABBzRx�0����$��c|���eEZ
AzRx����(���eEV
AL����eEV
A|��$8���/EV
A�d�T8���eEZ
A�<�,����F�A�A �
ABAzRx� ���$��Qd��F�B�B �B(�A0�A8�D`�
8A0A(B BBBAr
8C0A(B BBBA zRx�`������(����o�V$����J�^���|A��w�" ���>E�I�nA���%�� $��;E�F�nAH��"\����GNU�@99�U �`;� ��2w�JR$�$��2w���2w���94 | JR$�$��2w���2w���94 | �`;� �P9%K%JR$�$��2w�A�%�%F�%�%�0:�"�.��2w��0:�"�.�0:�#�.�0:� 1.��2w��0:� .�0:K"o.��2w���94 | JR$�$I�$�$��2w��Y Y `X @W �V  V �U n=�Z / 002�4�12y=�Z / 002�4�12�=�Z / 002�4�12�=�Z / 002�4�12?=�Z / 002�4�12�=pZ / 002�4�12�=`Z / 002�4�12<Ufv�
�;�U �U ���o` �
& _ �@��	���o���o����o�oF���o� ] � 0@P`p��������=@3<�=` GA$3a1��;_codecs_iso2022.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debugJ�Z �7zXZ�ִF!t/����]?�E�h=��ڊ�2N�	L9���h��%��L�xe+F�c���}r��-O����.���X��ha�5��ؐ*�S]�&���h#�X<��e�(�d8�t`%�G8�K����b8�4VΞg�fvɸ��F�s^9A�۞^<3�R�D��U��Z�^�F� �"�=���
�����/f�E���q?���2�{Vg3����Û����쯫��S ��d.�09���{ܦJX$��W>�B��P\��Z+�|��,6M��6>U*ߍ�\+���{�A4��q�}��Q�spV�
�{"�8���ſ$��v��R{�S�����#���.��1��*Crُp�(@a?���X�;r����/�x���.[���96 [l<�A�"�H.���>����J`�>�`��o+Q��s�i���R��;�#vb�թ���kL()��+5�~�}�okh��3z��G�s��$��j��!-`�%N�룦.ƛq+o��7��6}v����%�`=+���%w;ukr��%K��
�4�0jF�3I���V.�K����؅�@�Vs|�|�u����&�x[U��$8��ǖ�v�D�fp����c\!��6g�`�i����[��"��M#l�!����H^�T��~����bi����{�
�� �2�?@�6h
�/�m��E'k	��&�E$mֈDw�k��]�<v�Cs����khql1�DK�o���F"�Rc�����H^��$]��s�PE�v����yh�6žK:���=t�
�w`=Lޛa��ɐF6��ru����e*����B�J�7�өEy�*�I<�\����j��o.E�{9��I������e�.@�˱�<��,Kx�Ӟv��"��}'O�����M�A�꧎��a�˵��)�G�{�<�9�D��|3:�U�9`�ؐ��B���0�C���R�N���G��-��5Iˣa�sSy6��<x�6>>
nsW�:�%N����T�]]g�i�\���
Q�a�.̜&���7��O�<�.Cb�`'�I�����Ւ�E�5^g,gzB��3�\�ׅx��DhCdd��r߱	e�|�x��k��}�]��	��vArb~�f�;n)qi��[�6|��V����&w~���'�uv	l�CYVZ���|�76,8sW!��Sti�o��R��h�=�(0*�e��\W(a���Yu�l�20\�c�2Y"�	0�E�f�:]Z�����
�-�ptY��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(���0  &8���oFF6E���o��0T���^B@@�h��c��n��w��� }�;�;
�2�;�;�>>���?�?p�@F@F ��U �U��U �U��U �U` � ]  ]� _  _��` `� ��` �`��Ha`�`$
�`h4a,`f(lib-dynload/cmath.cpython-38-x86_64-linux-gnu.so000075500000211030151153537510015202 0ustar00ELF> @�
@8	@@�@� �� � � * h�h� h� 888$$ � � �  S�td � � �  P�td��������Q�tdR�td�� � ��GNUaa����KyD�l���H�h,�@ �,/0f8���|CE���qX���H-���	��� b��!�� q�, 	�F"�+��M�<���P�@^����
P�&{0&!h�!o�!^`�#__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libm.so.6libpthread.so.0libc.so.6PyComplex_AsCComplexPyErr_OccurredPyBool_FromLongPyExc_OverflowErrorPyErr_SetStringPyExc_ValueError_PyArg_UnpackKeywordsPyFloat_Type_Py_c_diff_Py_c_absPyFloat_AsDouble__stack_chk_fail__errno_locationPyErr_SetFromErrnoPyFloat_FromDoubleatan2Py_BuildValuesincoshPyComplex_FromCComplexsincostanhtan_Py_c_neghypotsqrtlog_PyArg_CheckPositionalldexp_Py_c_quotasinhPyInit_cmathPyModule_Create2PyModule_AddObject_Py_dg_infinity_Py_dg_stdnan_Py_log1p_edata__bss_start_endGLIBC_2.2.5GLIBC_2.4p ui	��0ii
�ui	�fui	�� @�� � �  � @� 9�H� ;�P� =�X� E�!��!P}!�� !��(!�8! �@!��H!`�X!��`!��h!��x!���!���!�b�!@��!���!i�!���!���!@R�!���!���!�,�!`�!�!�<! � !�(!�!8!`�@!
�H!@!X!��`!�h!p x!���!��!� �! ��!���!�n�!`��!"��!�]�! ��!(��!�(�!��!.�!�*! � !��(!�W8!��@!��H!@BX!��`!��h!p7x!@��!4��!�x�!��!���!�G�!���!���!P2�!��(!M�0!��@!!�!@� �!��� �� 	� � � � � �� �� �� �� �� �� �� � 
� � � 
� � �� � � � �  � (� 0� 8� @� H� P� X�  `� !h� "p� #x� $�� %�� &�� '�� (�� )�� *�� +��H��H�a� H��t��H����5
� �%� ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$��������%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%}� D���%u� D���%m� D���%e� D���%]� D���%U� D���%M� D���%E� D���%=� D���%5� D���%-� D���%%� D���%� D���%� D���%
� D���%� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D1�H���1�H���1�H���PH�{� H�5m�H�8�4���1�Z�H����
I���M
f��D$�$fA/��d$�t$ �h
�|$(�I���S
H�{H9o�E
�U�D$�$f���d$�t$ �D��f/T$(�
�
1��5
f���D$�$fA/��d$�t$ v���	H��� H�:����{H��(�O1�H��(�H�� 1�[��"H��@[�`�"H��@[�P�"H��@[�@�"H��@[�0H�ֹ�H�=2��w�����ttH�}H�0� H9_uh�O�o?�\$�$�h����DD$�~59�H���-���fA(��D$fT�f.���?f.�vfE���T;�L<�>fE.�z�D��fE��fE(��f<�fE���D>H��H[]�\H��8[]�QL�R� I�;�R����OT��H��H�=D������t6I�<$���f�L$�$�����~L$H��H��uH���sQ�
T�S��S�
��fD(��d$�DY��YL$fA(��Dd$�����Dl$fE��DD$�D~=���AX�fD.��Q���^�^�
��\$8�Dd$0�Y��l$@�YL$�DD$(f(��d$ ����\$ �Dl$(�Dd$0�~5���X��\$8�D��L$@f.��DQ��2`�Aj�
���\$8�Dt$ �Y��l$�Y��DL$0�DD$(f(��t$�����d$�\$8�l$�Dt$ �X��Dl$(�d$0�D~%��D\�f.��DQ���k��u�
��DL$@�l$8�DY��d$0�YL$�Dl$ �DD$(fA(��DT$�s����\$�l$8�Dl$ �Dd$(�X��d$0�~5W��=��DL$@f.��DQ��{w鶁�
t��d$0�Dd$(�Y��D\$�AY��DT$8�DL$ f(��l$����\$�d$0�D\$�Dl$ �X��Dd$(�~=ſ�D<��L$8f.��Q��)�鬌��H��H�������$�L$� ���H��������~o��$fT�f.޿w,�L$1�fT�f.
ȿ@��H���{���ff.��H���b���f���H��H������L$�$���H�������L$1�f.$@��H������ff.�f���H��H���0����$�L$�P���H�������~���$��
�fT�f.�r�L$1�fT�f.�@��H�����fDH��H�-� H�5޲H�8���1�H���ff.�@��ATUH��SH��H��pdH�%(H�D$h1�H���7L�aH��H��H��A�L�Z� I�H�T$HR1�jj�&���H�� H��H����H�8�.����D$�$�N���H����H�{�����D$�L$ �+���H����I����H�{H����H�-,� H9o�z�DGI����f���D$�$fA/��t$�d$ �f.�A�A��EE�E��tf.�A��ED�E�����D~
�f(��c�fAT�f.���fD(�fET�fD.������fD(�fET�fD.���fDT�fD.��p���fD(�f(�f(��t$ fD��DD$(D)$$�d$�K��������L$�D$�D$ ����t$(�Y�f/D$��H�D$(�$�L$�t$�z����d$�|$�Y�f/����\$(1�f/�@���+���H�t$hdH34%(��H��p[]A\�ff.�H�{H�
}� H9O�]�G�$f���d$�t$ �D��D$(�D$f/\$(�Qf.ο@��E�@��t+f.�A��AD�@��tf.���v��F�����D~%'�fD(��D5��fET�fE.��fD(�fET�fE.�����f(�fAT�fA.���fDT�fE.�������DD$0fD(�fD�D)$f(�f(��t$�d$ �����L$�D$�D$ ����t$0�Y�f/D$�?����*���f.�H�{H9o�8f���D_�$fA/��D$�d$�D\$(�t$ �����H��� H�5Y�H�8�y���H���;���1��	���@1����%��������
k�fD(�f.��L$0���������D$(�M��DD$(H��u�� ���fE���D$�$�d$�t$ �Dl$(�D��f.�A���AE܄�tf.���DD�E�������D~5>�fD(��-��fET�fD.��1���f(�fAT�f.����fD(�fET�fD.��	���fDT�fD.�����DD$0fD(�fD�D)$����H����H����H����H�;���D$�$�9�H�������H�{���D$�L$ ��H���r���H������H�{H�������I������9�f.ٸ�D$(��������H������1��/����D
���DL$0�DD$8���f.D$0�DD$8�D$(���t�����PH��A�1�L�6� 1�H��H�D$HPjj��H�� H��H����1�����7�fDQ����!uH�=$� H�5�H�?���1�Z�"�d�H�
1� H�5�H�9�������H��(H�����D$�L$��H���7��1��\$�d$�f.����~�f(��
a�fT�fT�f.�wcf.K���wf��f.���Eф����D~Ƕ�t$fAT�fV5Ķf.54�zjuh�D$H��(fAT���@f.�wjf(�fT~�fVf�H��(���ff.�f��ضH��(��ff.�@�D$fAT�fVm�H��(��@�D~
�fAT�fV�f.��zPuNf(�fAT�fV
��ff.�f(�f(�H�D$��H�D$�0���g�����f.��D$fAT�fV͵�@������SH��H�� ����D$�L$���H���m��`��T$�\$H���f.����~�f(��
��fT�fT�f.�wof.%w���wf��f.���E„��<�D~�f(�fAT�fV5�f.5b�����f(�fAT��|$�Mff.�f�f.���fD(�fDT��fDV��DT$�fD�D=���D|$f(�f(���������L$H�� �H�=֨[�-�ff.�f�fD(�fET�fDV
]��DL$�@�D~�fD(�fET�fDV%�fD.%s�zYuWfD(�fET�fDV-��Dl$�X����f(�f(��\$�T$�g��T$�\$�D$� ���fD(�fET�fDV5���Dt$����H�� [������SH��H��@���D$�$��H�����1��L$�$�~��H���5s��fT�fT�f.���f.����$�L$ ���D$(�$���d$ f/%S��$�U�D$�=��l$(�Y��D$�l$ �r��$�DD$ �Y��D~-Y�fE(�fET�fD.%Ʋ�p�fDT�fD.-���^�H��@fA(�[���f.
����f.����<$f��f.�z���D$f/��3�$H�|$8H�t$0�\$ ����~%ѱ�DT$0�D\$8�~�fDT��\$ fDT�fDV�fDV�f.��fA(�fA�)<$���$�L$H��@[����d$�*f.�z)fT%W�fV%_�f.%ϱ����#�-��f.���D$fE.��SfA(�fT5�fV5�f.5~�����H��H��� H��H�f.0��D�DXfA(�fA�)$�,�����l$f.��*H�=!� �!H�5
�H�?���H��@1�[�ff.��f.�������Dt$fD.5ưfE(�fDT=H�fDV=O��9�3fD.=���t�n�����@�$f.
s�fD(�fDT
��fDV
����fD.
_��1�+����$�\$(����D~-���D~%�fD(��$fET�fEV��Dt$ �.��DT$ �D~n��D~=���\$(fAT�fAV�fDW����ff.�1�����f�1�H�H�5� H��H��D�DX�l���ff.�f�fD.=�zeuc����f�fD.
_�zUuS��ff.����f���p���fD��h���fD��P���fD��H���fA(�fA�)$�����L$fD(�fDT
O�fDV
V��A\�f(��L$ ����D\$(�DY��D$ �DY���D\$����$�DD$�Y��Y
���l�����f���SH��H��@���$�L$�?�H���x���$�~���\$H���
��fT�f.�fT���f.��Af/�����$�)��D$�D$�8��D$�$����|$�DL$��5��H��@fD(�[�EY�f(��^�fA(��AY��EY��X��DX��Y��E^��A^��DY��AY��A��f.���f.����l$fE�fA.�z���$fA/���D$H�|$8H�t$0�$���DT$8�D
��D$$����EX��DYT$0fDTG�fD.�fE(�fE�D),$�}�$�L$H��@[����$$�*f.�z)fT%��fV%�f.%p������#f.��t$��f.���fT5��fV5��f.5-�����H��H��H�
�� H�f.��D�DPfA(�fA�)$�7���f.���H�=�� �!H�5ǟH�?��H��@1�[�fDf.������D,$fD.-��fE(�fDT5	�fDV5���fD.5s���������Df.58�fD(�fDT��fDV������fD.$�������{f��D$�\$���$�D$���D$�D
Ȫ�Dd$�EX��DY����fDT.�fE(�����@1��B���f�1�H��q���fDfD.������@fD.5_�����������f�fA(�fA�)$$�p���ff.�f��D$�D$�T$(fDTu�fDV|��DT$ ���D$�D$���$�D$(�Yܩ����Dd$�DY%ϩ��DY$$f(��D$ H��@[�AY��r�f�����fD�����fD�����fD����fD��SH��H��@���D$�$��H�������L$�$�~^�H���5Ө�fT�fT�f.���f.����$�L$(�q��D$ �$����d$(f/%���$�D�D$����l$ �Y��D$�l$ ���$�DD$ �Y��D~-��fE(�fET�fD.%&����fDT�fD.-��M�H��@fA(�[���f.
���f.����<$f��f.�z���D\$fD/��1�$H�|$8H�t$0�\$ �G��~%/��DT$0�D$8�~j�fDT��\$ fT�fDV�fV�f.Z�fA(�f�)<$���$�L$H��@[�B�f��d$�*f.�z)fT%��fV%��f.%/������#�-�f.���D$fE.��CfA(�fT5f�fV5n�f.5ަ����H��H�� H��H�f.���D�@fA(�f�)$�,����l$f.��H�=�� �!H�5m�H�?�4�H��@1�[�ff.��f.�������Dt$fD.5&�fE(�fDT=��fDV=���)�#fD.=��d�^�����@�$f.
ӥfD(�fDT
U�fDV
\�����fD.
���!�����$�\$(�@���D~-��D~%N�fAT�fAV�fAW��D$ �$����DT$ �D~5Ϥ�D~=��\$(fAT�fAV�����1�����f�1�H�H�5d� H��H��D�@�|���ff.�fD.=�zeuc�����f�fD.
ϤzUuS��ff.����f�����fD��h���fD��`���fD��H���fA(�f�)$����L$fD(�fDT
��fDV
ǣ�A\�f(��L$(����D\$ �DY��D$(�DY ��D\$����$�DD$�Y��Y
���}����z��f.���SH��H��@����D$�$���H�����!���\$�$�~�H���5c��fT�fT�f.���f.����$����D$�$�w���l$f/-I��$f(����U��f(��D$�Y��Y$�D~
i�fD(�fET�fD.֢�fDT�fD.
¢���H��@[���ff.��f.����f.����D$$fE��fE.�z���DL$fE/��N�$H�|$8H�t$0�\$�L$ �����~%֡�DD$0�D$8�\$�D~-
�fDT��Dd$ fT�fEV�fAV�fD.%��fE(�fD�D)4$���$�L$H��@[����ff.�f��Dl$�*fE.�z,fDT-D�fDV-K�fD.-�������#�D5x�fD.��
�D<$�fE.�z,fDT=�fDV=��fD.=h������H�H�5�� H��H�f.
��D�AfA(�f�)$�����-�f.���H�=� �!H�5�H�?���H��@1�[�f.�������DT$fD.��fA(�fT9�fVA���f.������������$f.c�f(�fT=�fV=�����f.=S��������D�$�L$(�\$ �����~��fD(��$fDT��DT$�'���DD$�D~g��\$ �Dd$(fAT����1��z���f�1�����f�f.=������C���f�f.�����������f�f.H����D|$fD/=B��E���fA(�f�)$�8���f.��\0��S���%3�f(��D$�Y��Y$�Y��Y����ff.�H�!� �"H�5̒H�8������ff.�@��g���fD�����fD����fD��7���fA(�f�)$�r���@��SH��H��@�/���$�L$�O��H��������L$�~���=��~��H���f(�fT��,$f.�fW�fT���f.����$�L$(�d$ ����D$�$����t$(f/5͝�DD$ �$�D~
(�fA(�������DT$�DY��D$�DT$����Y$�L$�D~-ƜfD(��D~5؜fET�fD.%*�����fDT�fD.-����H��@fAW�[���ff.�f.
���f.����$f��f.�z��f/L$�'�$H�|$8H�t$0�l$�M���~5��Dt$0�~
v��D$8fDT��D|$fDV�fT�fV�fDW�fD.=Y�f(�fA�)4$���$�L$H��@[�A����t$�*f.�z%fT�fV%Ûf.%3������#�%�f.���D$�fE.�z(fDT�fDVx�fD.������H�H�
� H��H�f.-���B�D2fDW�f(�fA�)$�-����d$f.��?H�=�� �!H�5p�H�?�7��H��@1�[�ff.�@f.�������D|$fT�fD.="�fV%�����f.%��0�*�����D$fD.
�fE(�fDT�fDVn�����fD.њ���������$�l$ �P���~-h�fD(��~�fDT��$fDV��D\$����Dt$�D~-��D~%'��D|$ fAT�fAV�����1��k���f�1�����f�f.% �zVuT���f.�fD.��zEuC�����f�����fD����fD����fD�����fAT�fV)��D\�fA(��DD$ �����D\$�DY��D$ �DY���D\$�l���Y$�L$�Ya�����fA�)$�����������SH��H��@�����$�L$���H��������\$�,$�~N��~%f�H����D
��f(�fT�fW�fT�fD.�fD(���fD.��If/���������D$ �$����$�D$����DT$ �D$$��
c�fE(��EY�f(��^�fA(��EY��EY��DX��AX��AY��A^��A^��Y��Y��D~=��H��@[fAW������fA.���fD.����$f��f.�z��f/T$�	�$H�|$8H�t$0�l$�?���Dd$8�D~=��D-���D$�D5g��EX��DYd$0fET�fA.�fA(�fA�)$�]�$�L$H��@[�8����t$�*f.�z%fT�fV��f.#������#fD.����<$�f.�z%fT�fV=s�f.=��u�o�H�H�
p� H��H�fA.��D`�D(fDW�fA(�fA�)$$�3���fE.���H�=�� �!H�5r�H�?�9��H��@1�[ÐfD.������\$f.7�fT�fV˕��f./������������D$fD.�fE(�fDT�fDV~�����fD.����}�����$�l$ �����D$�$�P���l$�D~
��D-���D5_��X��Y��D$ fAT�fD(����f�1����f�1��?���f�fD.?������W����f. ���������f�fA(�fA�)$���ff.�f�fT�fVd��\$(�D$ �$�����D$�$�^���$�D$(�Y�������Dt$�DY5����DY4$�L$ �AY��Q���f.���L���fD��|���fD��,���fD��\���fDSf(�f(�H��0�~%k��-��L$ fT�fT�f.��f.��f�f/��C�L$�$�t$�=�����D$H���DL$fD/��Z�L$f/��J�D��fE.��FfA(�fE(�fE���%���A\��EY��AY�fD(��DY��EX��A^�fA.�fD(���fA(��Dd$�L$�DL$(�DD$ ����Dt$ �D=���L$�$�D$(�EX��Y���Dd$�AY��A\�����f(��$fW
,��Y��Y
ܒH��0[�fDf(�H�<$�c��H�<$�Z���H��0[�P���>����DY
���EX��D4$�AY�fA(��z�����
x�fA(��DD$�D$�Y��AY��h���T$�$��YG��~5w�fW�fT�fV
W�H��0[�^�fW��^�f(�Ð�\$�L$�4$�:���|$��D$��DT$f.��p�z)fT=�fV=�f.=~������fA.���fD.A�fE(�fDTÐfDVʐ����fD.-�z�t��H��H�5U� H)�H��fo$)$$�$�L$H��0[�@�L$�$�P���,$f.-����DT$fD(�fDT(�fDV/�����fD.��z�t�ff.��fE.Ҹ�P���fDT׏fDVޏfD.M��u}��#���������Dq�fD/��Zf��fD.������D(��!fA(�f\$ )$���ff.�1��d���f�1����f�fD.��z��*����� ���fD.��z��j�����`���f(��DL$�L$�z���
���$�D$����]���4$�^�f(��k���~-���L$f(��i�fW�fW��<$�?���Y7��|$��D~b��D$fD(�fET�fDU�fEV��DD$ ����fE(�fE��fE��%͎�EY�fD(��EX��E^�fE.�{	f���U���f���
�����D��SH��H��@�/���$�L$�O��H��������L$�~���=��~��H���f(�fT��$$f.�fW��t$fT���f.����$�L$(����D$ �$����l$(f/-͍�D~4��$�$�D$����DL$ �DY��D$�DL$�����$�Y��D~=Ό�Dl$fE(�fET�fD.54����fDT�fD.= ���H��@fA(�[���Df.
����f.����<$f��f.�z��f/l$�W�$H�|$8H�t$0�d$�]���~=E��Dl$0�\$8�~-��fDT��d$fT�fDV�fV�f.%p�fE(�fD�D)$���$�L$H��@[�V��fD�DD$�*fE.�z/�DL$fDT�fDV
ȋfD.
7��	��#�
��f.��,�D$fE.�z?fA(�fT�fV5~�f.5�zuH��H��H�
C� H��D(�X�)����H��H�%� H��H�f.%���D(�XfA(�f�)$$����f��DL$fE.���H�=o� �!H�5[H�?�"��H��@1�[�f.�f.�����f(��t$f.5�fT�fV�����f.��.�(�����ff.��D$fD.��fE(�fDT�fDV%N�����fD.%������H�����@�$�d$ �0���D~=���D~5>�fAT�fAV��D$�$����~̉�~��Dl$�d$ fT�fV�fW����fD1����f�f.�zVuT�����f.�fD.%�zEuCH�����f.�����fDH�����������fDH�����fA(�f�)$�
����L$fD(�fET�fDV���A\�f(��L$�h���Dd$ �DY��D$�DY%U��Dd$����$�Y��Y
8��������fD��UH��SH��hH������H�>H�� H9_�E�OH�~H9_�<�W�L$�$�=���DD$�~5��D$H���-}��fE(�fDT�fE(�fA.�fDT��8fD.�fE���CfA.�fE���(fE.�z�fE/��`H�t$PfA(�H�|$X)t$0�DD$�Dd$ �l$H�DL$@����d$ ��DD$�~r��|$P�~
��fD.��D$XfT�fV�fT�fV�fW���fW�f(�E�f�)4$H�$H�T$���NfE.��DL$@f(t$0�l$H�0fDT�fD.�� �E!H�-j� H�5\{H�}�"�����H��h1�[]�DfA.�fE���`fA.���fE.��z6�D�fE(�fDT-��fDV-��fE.������fA.���fE.ɿz1fE(�fDT5>�fDV5E�fD.5���f�`�L��L�
�� A�I)�I��M�fE.�I�I�PA��EE�E��tfE.�zfDT�fD.����H�$�$H�$�$H��h[]�#���fE.�fA(�fT��fV������f.
�������	���ff.��fA(�)t$ �l$@�DD$�D$�n����~-���D~
-�fAT�fV�fH~��$�ſ���Dd$�D~��D~L��D$fE.�fAT�f(t$ �l$@fAV�fH~������ff.�1����f�1�fA.��K���fE.�fE(�fDT=��fDV=������fD.=��������A���ff.��fE.�����fL~��EY�fL~��[���ff.����f.��f(��CH�}H9_���W�L$���ff.�fD.=_����������f.@����|��?���f���3���fD��k���fDH�|$XH�t$PfA(��D$�v����D,$�|$P�AY��DYl$XfD(�fE�D)4$H�$H�T$�a���������fD�����$�ܼ��f.|��$f(������������$�L$�_����$�\$H���S������������$�6����$H�������������SH��H�� �߻���D$�$���H�����q����\$�$$�~>�H������fT�fT�f.���f.����
�f/��/f/��%�-�f/��3f(��T$�\$�D$踼��f/��DT$�t$r�=قf/�sS�~����L$�D$�$�h�����D
y�f(��D$H�� �A^�[�A^����ff.�fD/��D$���D%ށ�EY�fE(��E\��EX��EY�fA(��AX�f.����0����L$�D$�$�ʹ�����f(��D$�Y��H�� �^�[�^��H����f/��Kf��f/��Hf/��>�L$f(��_���H� � �!H�5uH�8�Ӻ��H�� 1�[�ff.��DD$�*fE.�z,fDTT�fDV[�fD.ʀ�L�F�#f.����D$fD.��fE(�fDT
�fDV��;�5fD.t��P�J�H�H�5�� �D%��H��H���IH�� [�A^��A^�f(�f(�����ff.���t$f.5�f(�fT=vfV=~����f.=������f��D$�fE.��O���fDT
!fDV
(fD.
��	������f��
��D$�Y��Y$褹��菹���D5��DX��L$�$�Dt$�j����%��l$�f(�H�� �^�[�^�f(����ff.��f(¿5�\$�\����5�D$�D$�F����L$�������fD(��D\50�b���������D5�~�DY��F����1�����f�1����f�f.=`~z�����������fD.?~z������������V�������fD(��D\$�����T$�$�\$�r���D��UH��H��SH��H蛶���$�L$軶��H�����-����L$�~%�|�w}�~}H���f(��,$fD(�fT�fDW�f.�fT���f.���fE�fA/��'�=�}f/��uf/-e}�gf.
}���D-}fD(��D$�DY$}�EX�fE(��EY�fE(��EY��EX��E^�fE.��fA(��L$0�DL$(�Dd$ �Dl$8�9����D\$0�L$8�Dd$ �D$�$�A\��Y�|�DL$(�AY��A\�觴���L$�D~-�{��Y
�|fAW��Y}|H��H[]fAW�����ff.�f��$fA(���H���������~%|{�f(�fW�f�)4$��!����"�q����$�L$H��H[]鲵��f��
�{fA(��D\$�Y��Y$����L$�<$��Y
�{�D~=�zfAW�fAT�fV=�z�^�fAW�f(��^�fAW�f�)$�o�����!�����{f/�v<�D4$fE.��;�5�!H�� H�5oH�:�ɴ��H��H1�[]��,$fE���D{�D-�zfD(��DY�fE(��EX��E^�fE.���������D\��$�D\$�Y�z�EY�fA(�����f�f.ɹ*z(fDT�fDV�yfD.fz���#f.����D$fD.$zfA(�fT�fV�y����f.z�����ff.�H�H�=6� H��H��D�DvfDW�fE�D)4$���f.
�yfDT�fDV:y����fD.�y�p�j�@�$�f.�z�fT�fV�xf.dyz*u(��^���ff.�1����f�1��9���f�f. y���������f�fD.�x������a�����DQ�fD.��D|$���
y�$�l$ ����f���d$ f.��Q����D$�d$ �^��IJ���L$ �D$�~�wfW���x蟰���<$�Y�x��D~�w�T$fAT�fDU�fDV�fD�D)$�G�������������������w����d$(�L$ �����d$(�L$ �<���f(��l$ ����l$ ��ff.���UH��H��SH��8�k����D$�$苰��H���m����T$�$$�~�vH���?w�f(�fT�fT�f.���f.��Yf��f/���5[wf/��9f/��/�DwfA.���fE(��D$�Dw�D\��DY�fA(��AY�fA(��AY��X��D^�fD.���fA(��T$(�t$ �DL$�(����Dl$(�
�v�Dt$�D$�D|$ �AX��$�Y�v�AY��A\�蔮���f(��D$fW
�u�Y|v�Y
lvH��8[]������$f(���H�����������!����"�����H��8[]�֯��fD�
vf(��T$�Y��Y$�����|$�,$��Y=�u�~
ufW�fT�fV-�t�^�fW��^�f(�f�)$�$�L$H��8[]�Q�����_����=�uf/��M����D$fD.��7�1�!H�,� H�5iH�:���H��81�[]�ff.���E����AX�fA(��D\$�Yu�AY�f(��\������DD$�DYu�f(�fW
-tfA(��o���f.ҹ*z)fT
tfVtf.�t���#f.����D$fD.CtfA(�fT5�sfV5�s��f.52t���H��f.�H��H�5U� �,f(�fd)$$�v���ff.�f�f.�sf(�fTLsfVTs�~u|f.�s���z��D$fE.�zCfA(�fT=sfV=sf.=~s�`����Z���H���Q����1����f�H���7����f.@sz�t����f.5 s����H�����DQ�f.��DT$���
:s�$�d$�"���fE���Dd$fD.��DQ����D$�Dd$�A^��߬���L$�D~=r�D$��rfAW�踪���$�Y�r��~-�q�~�q�|$fT�fW�fT�f(�fV�f�)$�������H������H�������Dd$ �Dl$�����Dd$ �Dl$�6���f(��d$����d$���f���ATH�B�I��UH��SH��0H���s���H�>�x����$f�L$蘪��H��H����H���~L$���,$�$�l$����T$�$fT�pI���5)q�fT�pf.���f.��W��qf/���f/����%{qf/���$�D$�\$�T$�-���f/Uq�DL$�|$r�DMqfD/�������D$�L$�$�ר��A�$f(�H��u&�D$H��0[]A\�c����D5
q�Dt$H���L$�"����$�L$�B���H���K�D$�Dd$fDT�o�L$�D-�ofDT%kofE.���fE.��p�D5TpfE/���fE/����D=EpfE/��r�L$ �$�L$�Dd$(�D\$���f/p�T$�d$ �l$(r�
pf/����d$ 襩���$�D$�D$菧��A�$�T$f(��L$ �D$�\���E�$�D$E�������A��!��A��"�����H�-6� H�5�bH�}辨��H��01�[]A\�I�\$�Z���fDfD/��D$���D�n�EY�fE(��E\��EX��EY��EX�fD.
nfA(��4�����Y�n����f��t$�*f.�z)fT5�mfV5�mf.5On���#�%nf.����D$fD.nfE(�fDT
�mfDV
�m����fD.
�m�)�#H���@�T$f.�mf(�fT6mfV>m����f.�m�����f��<$f.��af(�fT5�lfV5�lf.5]mzuH��H��H��� H��D�I�DT$H�����������
Xm�D$�Y��Y$�T����?����-gm�X��l$�A����f/�����fE��fA/�vjf(ÿ5�T$�6����5�D$�D$� ����L$����Ц���\m�D$�L$�$貤��A�$f(��3����fA/�w��L$�$艤��A�$!f(�H�������H�5� H�5'`H�8����+���f�H�������L$�$�
-l�Y��YL$�.��������d$�D
:l�DX��$�D$�d$ �DL$���A�$�L$ �T$f(��D$�T����D$$A�$fD.%^kfE(�fDT-�jfDV-�j�'�!fD.-Jk�Q��F��D|$�fE.�z,fDT=�jfDV=�jfD.=
k�����L��L�
R� I)�I�I��M��A�AX�5���Df/��t$����j�Y�fD(��D\��X��AY��X�f.ujf(��.�d$�����d$�D
�j�DY����������Y�j�D$����1���f��<$A�$�f.�z-f(�fT-|ifV-�if.-�i������D5�ifE.�������T$f.�if(�fT5-ifV55i����f.5�iz����������f.�fD.
oi����H������f�fE/������fE��fE/���fA(Ŀ5�D\$ �L$(虡���5�D$�D$ 胡���L$�H����3����d$(fD(��D\
gi����f.�f.�hzu��:���H���d�����'��������H���G���fE/��T����L$�D$�$賠��A�$!�if(��L$����1��r�����������1��J���fD(��DT$�k���fD.-)hz���������f.5
hz�������������f(��4$�#�����SH��H�� 菠���$�L$诠��H����!����$�~-�f�L$H���cg�fT�f.�f(�fT���f.����4$f�۸f.���EЄ�tf.���D������
�gf/����
�gf(��d$�Y��YL$f(��|$�B����DL$fE���DD$�D~=6f�AX�fD.��Q���X��D$fE/�f(��X��D^����DL$�fET�fDT
fH�� [fEV�fA(��a����f/������f/����5�d$�̞���5�D$�D$趞��f(��D$�w����XD$f���T$f.��Q������f(��T$�u����DD$fE��D~=@e�$f(��X�fA/��D^��#����|$fT=2efAT��fV�f(�H�� fA(�[速��H�� 1�[��fE���f��D$�fE.�z,fDT�dfDV�dfD.Ke�\��Qf.����Dl$fD.-efE(�fDT5�dfDV5�d����fD.5�d���ff.�L��L�
� I)�I�I��M��E�AH�����D$fD.�dfE(�fDTdfDVdzbu`fD.ydz�t��Dd$�fE.��y���fDT%�cfDV%�cfD.%6dz��Q���1��J���fD.dz�t���fD.5dz����������1���������f/��j�������DD$�l$�ϝ���l$fE��D~=�b�DD$f(��X�����\$蜝���T$�\$�b���ff.���UH��SH��X�����D$�L$�=���H���$诜���~5�b�D$�|$H����D�bfT�fD(��|$HfD.�fDT���fE.��?�
?cf/���fD/����D�b�D\D$fW=*bfA(��|$fT�fD.����DL$f�ۺfD.�@��E�fD.���E„�t	@�����-�bf/��G�
�b�\$8�Dd$0�Y��l$@�YL$�DD$(f(��d$ �_����T$ �\$8�Dl$(�Dd$0�X��~5Ia�D�a�L$@f.��DQ��
�EX�fE(�fD/�fA(��EX��A^�fD(�����a�XT$fDT���|$fT=�`f(�fDV�fT��D|$fD.��<f.Ӿ��E΄�t	@����f/����
�a�DT$(fD(��\$8�DY��Dd$0�YL$�T$ fA(��DT$�C����\$�Dd$8�|$ �Dt$(�X��Dl$0�~5&`fD.��DQ����EX�fA(�fA/��DD$fDT`�AX��D^���fDT�fA(�fA(�fEV��D|$(�Dl$�Dt$ 蓘���D\$�L$ �D$�D$(�YD$�DY��A\�腘���f(��D$H��X[]�X����fD�L$fT
r_fDT��fDV��DT$fD(���_�XT$f(�fT�fD.���f.Ӻ@��E�@��t�D\$fD.���DЄ���
�_�9���f��fDT�fA(�fA(�fEV��Dl$(�D|$�Dt$ �|����l$ �Yl$�D$�D$(�YD$�\����DH��X1�[]���Dl$�*fE.�z,fDT-d^fDV-k^fD.-�^�����#fE.��f�DT$fD.�^fA(�fT^fV!^����f.�^����A�I�L�q� I��M��A"�AJH��X[]f(��0����L$fA(��p����l$fE��fD(�fD/����
M^f(��DD$�Y��YL$�C����.����~
f]�\$�X�^�d$fW�f(�fT�fU�fV��H��Xf(�[]陗��f��L$f.
�]f(�fT5]fV5]z��f.5v]�����ff.�f��Dt$A�fE.�����fDT5�\fDV5�\fD.5%]zuA����ff.�E1�����1��(���f�f.5�\������r���f�f.�\����A��6����fE�����fD�
�\�D$�Y��YL$f(�迖��誖���X]�~
�[�D\$�d$�D~%�[fDT�fDT�fEV�fAW��m���ff.�f.���Y�D~%�[fT[fAV�f.�[�a��V�t$f(�f.�fTK[fAV�fD(��~�xf.�[�`��UH�<�A��L�
�� H)�L�H��L��Dw��Dt$Hf(�fA(��\$ �DT$葓���|$�D|$HfD(��DX��DY��D$ �YD$�DT$�A\��x����d$f(��K���f�����fDA��z���DA��j���D��v���fDfE.���~%=ZfDT$ZfDV�fD.�Z������DL$f���D$fT�YfD.�fV�fD(�����f.RZ��A���L��E��L�V� I)�M�I��M��Ai�E�l$�-���fA/��|���f/���f(Ŀ5�\$8�Dd$(�l$@�DD$0�F����5�D$ �D$(�0���f(��D$ ���XD$ 趓����������Dd$(�Dl$0fD(��~5�X�DHY�\$8�L$@���fA/�����f/����5�Dd$ �\$8�DT$0�T$(螑���5�D$�D$ 舑��f(��D$�I����XD$��������d����Dl$ �|$(fD(��Dt$0�~5#X�Dd$8�����D~%>X�����1�������~% X����1����fD/��7����>���A��1���fD.hXzA�����A���������fD.-<Xz����������fD/��$���鑕���Dd$8�Dl$0�Dt$(�D|$ �|$�����Dd$8�~57W�Dl$0�Dt$(�D|$ �|$�����L$@�\$8�Dd$0�DT$(�Dl$ 豑���L$@�\$8�D\W�~5�V�Dd$0�DT$(�Dl$ ���f.���UH��SH��H�����$�L$�.���H���E蠐���l$�$�D~%lVH���fD(�f(�fW=rV�D�VfET�fAT�fE.��|$��fD.����
#WfD/��Pf/��F�D�V�DX$fA(�fAT�fD.��f�ۺf.�@��E�fD.���E„�t	@����D
�VfD/��s�
�V�\$8�Dt$ �Y��l$�Y��DL$0�DD$(f(��t$�R����T$�\$8�l$�Dt$ �X��Dl$(�d$0�D~%/U�D�Uf.��DQ��B
�EX�fE(�fA(�f(��EX�fD/�fT
U�A^�f(�����U�\$fAT��fV��|$f(�fAT�fD.��f.Ӿ��E΄�t	@����f/���
�U�DT$0fD(��\$8�DY��Dt$ �YL$�T$(fA(��DT$�4����D\$�Dd$8�\$ �D|$(�AX��Dl$0�~-TfD.��DQ����EX�fA(�fE/��L$fT
T�AX��^��fT��D\$�fV��Dl$ �EY�f(��\$(�AY��Dt$�A\�蘌���L$�l$ �Dl$(�DYl$�D$�Y��A\��$�E�����L$fW
qSH��H[]�֍��fDfET��fDV��DT$fD(���S�\$f(�fAT�fD.��mf.�@��E�@��tf.���DЄ��<�%�S�>���ff.�@fAT��DD$�fV��Dl$ �DY�f(��l$(�AY��\$�A\������T$�DL$ �DT$�d$(�D$�AY��DY��A\�f(������H��H1�[]��f.�*z/�L$fT
7RfV
?Rf.
�R����#fD.����D<$fD.=lRfA(�fT�QfV�Q����f.[R����A�L�L�� H��L��D�CfDW
�QH��H[]fA(����ff.�f�f.-�Q�Dl$fDT-hQfDV-oQz�GfD.-�Q�����ff.�f��D4$A�fE.��X���fDT5QfDV5QfD.5�Q����A��&�����D$��QfD/9QfA(��Y��YD$�t�Dt$�x����c����X�Q�~%sP�l$fT-�P�Dd$fT�fV�fW%nP�$fA(��d$�����DL$�H��HfA(�[]鬊��ff.��E1��g����1�����f�fD.-�P�������f.pP��A�������l$fE���|���fE���D$�|$�DL$ �DT$(�AY��AY��\��n����L$ �t$(�T$�YT$�D$�Y��$�\������DL$fDW
NO���f��l$�Dt$�������|$�XKP�~%�N�Dd$fD(�fDT�NfT�fAV��������fDA�����DA�����D����f.�����D~5�NfT�NfAV�f.O������D$f.�fTeNfAV�fD(�����f.�N�����H�<�A��L�
Ԋ H)�L�H��L��_�D�\$�G���fE.���~�MfDT�MfDV�fD.`N�����f(�fT�MfV�f��f.�fD(�����f.N��A���L��E��L�"� I)�M�I��M��Aq�E�t$����fE/��̋��f/���f(ƿ5�\$8�l$(�Dt$�DL$0�DD$ �����5�D$�D$���f(��D$趇���XD$�{�������х���Dt$�Dl$ fD(��l$(�d$0�D~%�L�\$8�D�L�c���fA/����f/����5�\$8�Dt$ �DT$0�T$(�\����5�D$�D$ �F���f(��D$�����XD$�̆������"����\$ �D|$(fD(��Dl$0�~-�K�Dd$8����1��w���1�� �����~�K�����D~5�K��K���fD/��7�������A��#���fD.&LzA�����A�������E���fD.=�Kz��/�����%���fD/������Ӊ���Dd$8�Dl$0�Dt$(�D|$ �\$�ą���Dd$8�~-�J�Dl$0�Dt$(�D|$ �\$�����\$8�d$0�l$(�DT$ �Dl$�Dt$�i����\$8�DK�D~%�J�d$0�l$(�DT$ �Dl$�Dt$�T���ff.���UH��SH��X较���D$�L$�݃��H���D�O����d$�~5!J�D$H���=�J�fD(��d$HfDT�fT�fA.��f.��q�
�JfD/���f/����DcJ�DXD$f(�fW-�IfE(��l$fDT�fA.���f��f.�@��E�fD.���E„�t	@�����D
pJfE/��		�
�J�DL$@�l$8�DY��d$0�YL$�Dl$ �DD$(fA(��DT$����T$�l$8�Dl$ �Dd$(�X��d$0�~5�H�=TI�DL$@f.��DQ��@
�EX�fE(�fD/�fA(��L$�EX�fT
�H�A^�fD(����'I�\T$fDT��fDV��D|$f(�fT�f.���f.վ��E΄�t	@���wfD/��9�
iI�D\$8fD(��Dl$(�DY��d$ �Y��l$@�T$0fA(��D\$�҂���\$�Dd$@�|$ �D|$(�X��Dt$0�Dl$8�~5�GfD.��Q����X�f(�fE/�f(��X�fT-�G�D^��fDT��D\$�fDV��Dl$(�DY�fA(��D|$0�AY��d$ �A\��3����L$ �Dd$(�t$0�Yt$�D$�AY��\��D$�����f(��D$H��X[]�u���DfDT��fDV��D\$fD(��dG�\T$f(�fT�f.��>f.պ@��E�@��tf.���DЄ����D
�G�;���ff.�@fT��DD$�fV��Dl$(�EY�f(��d$0�AY��D|$ �A\�����L$ �T$(�DL$0�DYL$�D$�Y��A\�����H��X1�[]��f.�*z)fT%�EfV%�Ef.%eF�����#f.����L$f.
$FfD(�fDT�EfDV�E����fD.F����A�L�L��x H��L���KH��X[]f(����ff.�f��DL$��E�d$fD/
�E�Dl$fA(��Y��Y�����������|$�X F�~-�DfD(�fDT-�DfT�fAV�f(��D$f(��D$�t$�r}���T$f(��H��Xf(�[]���f.%�DfD(�fDT5zDfDV5�Dz��fD.5�D�����ff.�@�D|$A�fE.������fDT=DfDV=&DfD.=�Dz+u)A����ff.�1�����f�E1��b����fD.5OD������q����fD./D����A�����fE�����f.�����~=~CfTfCfV�f.�C�����f(�f.�fT9CfV�fD(�����f.�C�����H�<�A��L�
� H)�L�H��L��g�/�d$H�D$H�Dt$�D\$(�l$ �AY��DY��A\��{���L$ �DD$(�DT$H�DYT$�D$�AY��D$�A\��9{���T$f(�����f.��+}���}���|$�D~GB�XoC�D~%BfAW�f(�fAT�fAT�fV�f(��D$fAW��D���ff.�����fDA��o���DA��_���D����fE.��2�~-�AfDT�AfDV�fD.$B�����D$fT}AfV�f��f.�fD(��
�f.�A��A���L��E��L��} I)�M�I��M��EQ�E�DT$�,���fE/������f/����5�d$8�Dl$ �l$@�D\$0�T$(��y���5�D$�D$ �y��f(��D$�|{���XD$�A{������y���D|$ �Dt$(f(��Dl$0�|$8�~5P@�Dd$@���fE/��q��fD/��>fA(¿5�DL$@�l$8�d$0�Dl$ �DD$(�y���5�D$�D$ �y��f(��D$��z���XD$�z�������x���Dl$ �Dd$(fD(��d$0�~5�?�=@�l$8�DL$@����1��Y�����~=�?�G���1������~-�?���fD/��q�������A�����fD.�?zA������A�����%���fD.-�?z����������fD/�������~���Dd$@�|$8�Dl$0�d$(�Dt$ �D|$�sy���Dd$@�~5�>�|$8�Dl$0�d$(�Dt$ �D|$�����DL$@�l$8�d$0�D\$(�Dd$ �Dl$�y���DL$@�l$8�=�>�~54>�d$0�D\$(�Dd$ �Dl$�V���@��UH��SH��X�nw���D$�L$�w��H����w���~=�=�D$�D\$H����D8>fT�fE(��D\$@fD.�fDT���fE.����
�>f/��{fD/��p�DL$�D\
>fA(�fT�fD.��f��fD.�@��E�fD.���Eф�t	@����D.>fD/��>�
K>�d$0�Dd$(�Y��D\$�AY��DT$8�DL$ f(��l$�w���T$�d$0�D\$�Dl$ �X��Dd$(�~=�<�D=�L$8f.��Q���	�X�fD(�fD/�fA(��DX��A^�fD(���fA(�fDT���<�X\$�D~-V<�f(�fAT�fT�fDV�fD.��D|$��f.ܾ��EƄ�t	@���`f/��g�
&=�Dd$0�D\$�Y�D)l$@�AY��d$8�t$(�\$ �D$�v���|$�Dd$8�Dt$�l$ �X��DT$(�D|$0fD(\$@fD.��DQ���EX�fA(�fA/�fA(��AX�fAT��D^����EY�fEU��fDV��DL$fA(��YD$�AX��t���L$�D$�D$��s���f(��D$H��X�X�[]�au���fA(�fT�fT
�:�fV��t$f(��K;�X\$f(�fT�fD.��df.ܹ@��E�@��tfD.���Dʄ����
r;�D~-q:�\���ff.���EY�fEU��fDV��D|$fA(��YD$�AX��s���L$�D$�D$��r���f(��D$H��X�X�[]�it��f�H��X1�[]���l$�*f.�z)fT-�9fV-�9f.-?:�����#fE.��;fD.:fA(�fT%�9fV%�9����f.%�9����A�L�L��o H��L��D3�KH��X[]fA(��s��ff.���
�9�D$�D\$�Y��AY���s���s���L$�D=:�DX��D$�D|$�q���Dt$f(��H��XfA(�[]�!s����DT$fD.9fE(�fDT
�8fDV
�8z��fD.
9����fE.�A������fDTF8fDVM8fD.�8zuA�����DE1�����1��c���f�fD.
8������@f.%`8�b�\A��j�����D\$f����fE��AY��DD$f(��t$@�Yt$�X��fp���L$�D$�D$�/p���Dt$f(��X����ff.������D~-=7f.����D~%47fAT�fAV�f.�7�����fA(�fD.�fAT�fAV�fD(��2�,f.\7���	H��A��L�
as H)�L�H��L��x�D�|$@���ff.�@A�����DA�����D����fE.��9�D~B6�~%J6fET�fDV�fD.
�6����fA(�fAT�fV�f��fD.�fD(���f.n6��A���L��E��L�rr I)�M�I��M��AQ�A1�T$����fA/������f/����5�D\$0�Dd$D)l$@�d$8�t$(�\$ �Zn���5�D$�D$�Dn��f(��D$�p���XD$��o������ n���D|$�l$ fD(��DT$(�Dt$0�Dd$8fD(\$@�q���fE/���t��f/��Hf(ſ5�d$0�D\$(�Dd$�DT$8�DL$ �m���5�D$�D$�m��f(��D$�So���XD$�o������nm���Dd$�Dl$ f(��D\$(�~=-4�D�4�d$0�L$8���1��+����D~%34�����1������~%4�D~�3���A�����fD.
k4zA�����A����fD/��5����������fD.-/4z����������fD/�������,s��D)\$@�Dd$8�Dt$0�D|$(�DT$ �DL$�l$��m��fD(\$@�Dd$8�Dt$0�D|$(�DT$ �DL$�l$����L$8�d$0�D\$(�Dd$ �t$�Dl$�m���L$8�d$0�D63�~=�2�D\$(�Dd$ �t$�Dl$����f.�@H�=)V H�"V H9�tH�R H��t	�����H�=�U H�5�U H)�H��H��H��?H�H�tH��Q H��t��fD�����=�U u+UH�=�Q H��tH�=�M �k���d�����U ]������w������S��H�=�T �
l��H��H����%��2�!k��H�5I&H��H���?j���/2�k��H�5�&H��H��� j����2��j��H�5&H��H���j��1���k����j��H�56&H��H����i��1��k��f(�f��k��H�5�%H��H���i��1��vk���j��H�5�%H��H���i��1��Xk��f(�f��[k��H�5�%H��H���yi���
Q1�D5 2�p1�-2�%�1�
�j �D�1�D%�1�&j �D%j �D%j �j �Dj �j �Dj �%j �Dj �%j �D%j �%j � j �- j � j �D5j �D5j �D5j �D5j �D5j �D5j �D5j �D5j �-j �%j �1�
j �
j �-j �j �D5j �D5j �-j H�j �-j �j �D5
j �D5	j �-	j �%	j �-	j �
	j �-	j �	j �D5j �D5j �-j H�j �-j �j �D5j �D5j �-j �%j �-j �
j �-j �j �D
	0�D5�i �D5�i �D5�i �D5�i �D5�i �D5�i �D5�i �D5�i �-�i �%�i �
�i �
�i �D
�i ��i H��i ��i H��i ��i H��i �%�i H��i �%�i �D
�i �%�i �
�i ��i �
�i ��i �
�i �
�i �
�i �
�i �5/�D�.�D-�.�
�i �
�i �
�i �
�i �
�i �%�i �
�i �
�i ��c �D-�c ��c �D�c ��c �D�c ��c �D�c ��c �D�c ��c �D%�c ��c �
�c ��c �5�c �D5�c �D5�c �D5�c �D5�c �D5�c �D5�c �D5�c �D5�c ��c �-�c �
�c �
�c ��c �5�c �D5�c �D5�c H��c �5�c H��c �-�c �D5�c �D5�c ��c �-�c �
�c �
�c ��c �5�c �D5�c �D5c H�|c �5|c H�yc �-yc �D5xc �D5wc �wc �-wc �
wc �D�,�
nc �nc �5nc �D5mc �D5lc �D5kc �D5jc �D5ic �D5hc �D5gc �D5fc �fc �-fc �
fc �
fc �fc �Dec �ec �ec �ec �ec �ec H�bc �bc H�_c �_c �D
^c �^c �
^c �^c �
^c �
^c �
^c �
^c �
^c �
^c �
^c �
^c �
^c �^c �
^c �
^c �
^c �%.] �D-] �%-] �-] �%-] �-] �%-] H�*] �%*] H�'] �%'] �D
&] �%&] �
&] �%&] �5&] �D5%] �D5$] �D5#] �D5"] �D5!] �D5 ] �D5] �D5] �%] �-] �
] �
] �%] �5] �D5] �D5] �] �] �] H�] �D5] �D5] �%] �-] �
] �
] �] �5] �D5] �D5] H�] �] H�] H�] �D5] �D5
] �
] �-
] �
] �
] �
] �5
] �D5	] �D5] �D5] �D5] �D5] �D5] �D5] �D5] �] �-] �
] �
] �] �D] �] �] �] �] �] H��\ ��\ H��\ ��\ �D
�\ ��\ �
�\ ��\ �
�\ �
�\ �
�\ �
�\ ��\ �
�\ H��\ �
�\ �
�\ ��\ �
�\ �
�\ �
�\ �gM �5gM �gM �5gM �gM �5gM �gM �-gM �gM �-gM �gM �-gM �gM �
gM �gM �5gM �D5fM �D5eM �D5dM �D5cM �D5bM �D5aM �D5`M �D5_M �_M �-_M �
_M �
_M �_M �5_M �D5^M �D5]M �]M �]M �]M H�ZM �D5YM �D5XM �XM �-XM �XM �
XM H�UM �5UM �D5TM �D5SM H�PM �PM H�MM H�JM �D5IM �D5HM H�EM �-EM H�BM �
BM H�?M �5?M �D5>M �D5=M �D5<M �D5;M �D5:M �D59M �D58M �D57M H�4M �-4M �
4M �
4M H�1M �51M H�.M �5.M H�+M �5+M H�(M �-(M H�%M �-%M H�"M �-"M H�M �
M H�M �5M �
M �
M �
M �
M �
M �
M �
M �
M H�M �-M �
M �
M �)f �
)f �D5(f �D5'f �'f H�$f �$f �$f �D5#f �D5"f �"f �
"f �"f �
"f �
"f �
"f �D5!f �D5 f �D5f �D5f �D5f �D5f �D5f �D5f �=�"�
f �
f �
f �
f �
f H�f �D5f �D5
f �=
f H�
f �=
f �
f �D5	f �D5f �
f H�f �
f H�f �
f H��e �D5�e �D5�e �=�e ��e �=�e H��e �D5�e �D5�e �
�e H��e �
�e H��e �
�e �
�e �D5�e �D5�e �D5�e �D5�e �D5�e �D5�e �D5�e �D5�e �
�e �
�e �
�e �
�e ��e �
�e �D5�e �D5�e ��e ��e ��e H��e �D5�e �D5�e ��e �
�e ��e �
�e �
�e �
�e �
�e �
�e �
�e H��e �
�e H��e �
�e �
�e �
�e �
�e �
�e �
�e H��L H��L �D5�L �D5�L H��L ��L H��L H��L �D5�L �D5�L H��L H��L H��L H��L �
�L �
�L �D5�L �D5�L �D5�L �D5�L �D5�L �D5�L �D5�L �D5�L �
�L �
�L �
�L �
�L �
�L �
�L �D5�L �D5�L �=�L ��L �=�L H��L �D5�L �D5�L �
�L �
�L �
�L �
�L �
�L �
�L �D5�L �D5�L �=�L ��L �=�L H��L �D5�L �D5�L �
�L �
�L �
�L �
�L �
�L �
�L �D5�L �D5�L �D5�L �D5�L �D5�L �D5�L �D5�L �D5�L �
�L �
�L �
�L �
�L ��L �
�L �D5�L �D5�L ��L ��L ��L H��L �D5�L �D5�L ��L �
�L ��L �
�L �
�L �
�L �
�L �
�L �
�L ��L �
�L H��L �
�L �
�L �
�L �
�L �
�L �
�L �vF �D-uF �uF �DtF �tF �DsF �sF �DrF �rF �DqF �qF �D%pF �pF �
pF �pF �5pF �D5oF �D5nF �D5mF �D5lF �D5kF �D5jF �D5iF �D5hF �hF �-hF �
hF �
hF �hF �5hF �D5gF �D5fF �%fF �DeF �%eF �DdF �D5cF �D5bF �bF �-bF �
bF �
bF �bF �5bF �D5aF �D5`F �%`F �`F �%`F H�]F �D5\F �D5[F �[F �-[F �
[F �
[F �[F �5[F �D5ZF �D5YF �D5XF �D5WF �D5VF �D5UF �D5TF �D5SF �SF �-SF �
SF �
SF �SF �DRF �RF �RF �RF �RF �RF H�OF �OF H�LF �LF �D
KF �KF �
KF �KF �
KF �
KF �
KF �
KF �
KF �
KF �
KF �
KF �
KF �KF �
KF �
KF �
KF �Y �
Y �D5Y �D5Y �%Y �Y �%Y H�Y �D5Y �D5Y �Y �
Y �Y �
Y �
Y �
Y �D5Y �D5Y �D5Y �D5Y �D5Y �D5Y �D5
Y �D5Y �
Y �
Y �
Y �
Y H�	Y �
	Y �D5Y �D5Y �Y �Y �Y H�Y �D5Y �D5Y H��X �
�X H��X �
�X H��X �
�X �D5�X �D5�X H��X ��X H��X H��X �D5�X �D5�X H��X �
�X H��X �
�X �
�X �
�X �D5�X �D5�X �D5�X �D5�X �D5�X �D5�X �D5�X �D5�X �
�X �
�X �
�X �
�X ��X �
�X �D5�X �D5�X ��X ��X ��X H��X �D5�X �D5�X ��X �
�X ��X �
�X �
�X �
�X �
�X �
�X �
�X ��X �
�X H��X �
�X �
�X �
�X �
�X �
�X �
�X ��R �%�R H��R �%�R H��R �%�R H��R ��R H��R ��R ��R ��R �
�R ��R ��R �%�R �D5�R �D5�R �D5�R �D5�R �D5�R �D5�R �D5�R �D5�R ��R ��R �
�R �
�R ��R �%�R �D5�R �D5�R H��R ��R H��R H��R �D5�R �D5�R ��R ��R �
�R �
�R ��R �%�R �D5�R �D5�R H�~R �~R H�{R H�xR �D5wR �D5vR �vR �vR �
vR �
vR �vR �%vR �D5uR �D5tR �D5sR �D5rR �D5qR �D5pR �D5oR �D5nR �nR �nR �
nR �
nR �nR �%nR �nR �nR �nR �nR �nR H�kR �kR H�hR �hR �hR �hR �
hR �hR �%hR �
hR �
hR �
hR �
hR �
hR �
hR �
hR �D=G�
_R �_R �_R �
_R �
_R �D=�B H��B �D5�B �D5�B �D=�B ��B �D=�B H��B �D5�B �D5�B �D=�B H��B �D=�B H��B �
�B �
�B �D5�B �D5�B �D5�B �D5�B �D5�B �D5�B �D5�B �D5�B �
�B �
�B �
�B �
�B �
�B �
�B �D5�B �D5�B ��B ��B ��B H��B �D5�B �D5�B �
�B �
�B �
�B �
�B �
�B �
�B �D5�B �D5�B H��B ��B H��B H��B �D5�B �D5�B �
�B �
�B �
�B �
�B �
�B �
�B �D5�B �D5�B �D5�B �D5�B �D5�B �D5�B �D5�B �D5�B �
�B �
�B �
�B �
�B �=�B H��B �D5�B �D5�B �=�B ��B �=�B H��B �D5�B �D5�B �=�B H��B �=�B H��B �
�B �
�B �
�B �
�B �
�B ��B �
�B H��B �
�B �
�B �
�B �
�B �
�B �
�B ��2 �
�2 �D5�2 �D5�2 �%�2 H��2 �%�2 ��2 �D5�2 �D5�2 ��2 �
�2 ��2 �
�2 �
�2 �
�2 �D5�2 �D5�2 �D5�2 �D5�2 �D5�2 �D5�2 �D5�2 �D5�2 �
�2 �
�2 �
�2 �
�2 H��2 H��2 �D5�2 �D5�2 ��2 H��2 ��2 ��2 �D5�2 �D5�2 H��2 H��2 H��2 H��2 H��2 H��2 �D5�2 �D5�2 H��2 ��2 H��2 H��2 �D5�2 �D5�2 H��2 H��2 H��2 H��2 �
�2 �
�2 �D5�2 �D5�2 �D5�2 �D5�2 �D5�2 �D5�2 �D5�2 �D5�2 �
�2 �
�2 �
�2 �
�2 ��2 �
�2 �D5�2 �D5�2 ��2 ��2 ��2 H��2 �D5�2 �D5�2 ��2 �
�2 ��2 �
�2 �
�2 �
�2 �
�2 �
�2 �
�2 H��2 �
�2 H��2 �
�2 �
�2 �
�2 �
�2 �
�2 �
�2 H��[�f.���f.4{��D��ff.�f�u����H��H���math range errormath domain errorddrectlogpitauinfjnanjacosacoshasinasinhatanatanhexpiscloseisfiniteisinfisnanlog10phasepolarsqrtabrel_tolabs_tolcmathtolerances must be non-negativetanh($module, z, /)
--

Return the hyperbolic tangent of z.tan($module, z, /)
--

Return the tangent of z.sqrt($module, z, /)
--

Return the square root of z.sinh($module, z, /)
--

Return the hyperbolic sine of z.sin($module, z, /)
--

Return the sine of z.rect($module, r, phi, /)
--

Convert from polar coordinates to rectangular coordinates.polar($module, z, /)
--

Convert a complex from rectangular coordinates to polar coordinates.

r is the distance from 0 and phi the phase angle.phase($module, z, /)
--

Return argument, also known as the phase angle, of a complex.log10($module, z, /)
--

Return the base-10 logarithm of z.log($module, z, base=<unrepresentable>, /)
--

log(z[, base]) -> the logarithm of z to the given base.

If the base not specified, returns the natural logarithm (base e) of z.isnan($module, z, /)
--

Checks if the real or imaginary part of z not a number (NaN).isinf($module, z, /)
--

Checks if the real or imaginary part of z is infinite.isfinite($module, z, /)
--

Return True if both the real and imaginary parts of z are finite, else False.isclose($module, /, a, b, *, rel_tol=1e-09, abs_tol=0.0)
--

Determine whether two complex numbers are close in value.

  rel_tol
    maximum difference for being considered "close", relative to the
    magnitude of the input values
  abs_tol
    maximum difference for being considered "close", regardless of the
    magnitude of the input values

Return True if a is close in value to b, and False otherwise.

For the values to be considered close, the difference between them must be
smaller than at least one of the tolerances.

-inf, inf and NaN behave similarly to the IEEE 754 Standard. That is, NaN is
not close to anything, even itself. inf and -inf are only close to themselves.exp($module, z, /)
--

Return the exponential value e**z.cosh($module, z, /)
--

Return the hyperbolic cosine of z.cos($module, z, /)
--

Return the cosine of z.atanh($module, z, /)
--

Return the inverse hyperbolic tangent of z.atan($module, z, /)
--

Return the arc tangent of z.asinh($module, z, /)
--

Return the inverse hyperbolic sine of z.asin($module, z, /)
--

Return the arc sine of z.acosh($module, z, /)
--

Return the inverse hyperbolic cosine of z.acos($module, z, /)
--

Return the arc cosine of z.This module provides access to mathematical functions for complex
numbers.�������-DT�!�?��?-DT�!�?�!3|�@-DT�!	@����������&�.>���?Ҽz�+#�@iW�
�@�@��������_�?�? @U���k@��������9��B.�?���Q��?�7'{O^B@�G�z��?����������?�9��B.�?-DT�!	@-DT�!@�!3|�@-DT�!�?|)b,�g���-DT�!�?�!3|��-DT�!	�-DT�!��-DT�!�;�3�4���7���`9��8g9��dn9���u9����9��TT:���h:���x:��\�:����:��\�:����:����:��(�;����;��|�;��	<��L	t<���	�<��<
�=���
>���>��0?��L�?��x�?��� @����F��hG����H��K��t�P����U��$ [��t�`����e����j��4�p��x�u����{��<����@��� ���� ���	����`	�����	�P
@����
���,��HzRx�$�2��`FJw�?:*3$"D 5��P\�<��~H X
PIzRx�  7��F��<��CH vH�6��F�=��jH ]t�6��FD=��!D\�6��AY\0D=���F�A�D �G�a�\�D�B�I��
 AABO��]�B�B�I�zRx�����$46����PC��HAe
AzRx��6��,XC���H0�
N^
RL
TW
IzRx�0h6��D
EF(p�D��)E�G05
MR�AzRx�0� 6��DC4��F��wE�GP
FL�
AE�
CMzRx�P� �5��JA@<�K��E�GP�
FC�
AM�
CG#
AL4��P��fE�GP
FL�
AG�
CM�,5��JA4��U��\E�GP�
AQ�
AR�
CD4�Z��?E�GP>
FP�
AF�
CP<�4��JA4X�_��
E�GP
AK�
AM�
CB@��d���A�L@{
AGZ
AE�
AR�
AE8�j��ZE�GP4
FJ�
AK
CK�3��JA8(o���E�D�D��
CAF
AAHzRx����$�3���L��t��;E�G0	
FU�
EQQ
CL�
Ac
EYD�|y��%E�G�D`�
AAWW
AAG�
CAAzRx�`�� �3��DAAPh,���E�G�DPx
AAFs
AAKx
AAFO
CAMzRx�P�� 3��DAAD������	F�H�D �DP>
 AABE�
 CABDzRx�P���$�2��q4p���eE�G0C
AP�
FED
CI�2��dP�(���E�D�DpB
AAO�
CAH�
AAI�
EANzRx�p�� �2���T@����EE�D�D`V
AAK
CAH�
AAW8
FAQl�2���P�����LE�D�Dpg
AAJ�
CAH�
AAV�
EAH��2���\	�����E�D�Dp'
EAF�
EAND
CAH�
AAVc
FAFh�2����	\���&E�&�	P�#GNU�@�� � 9�;�=�E�Ufp�P
��� � ���o`0�
�x� x��
@	���o���o(
���o�o�	���oQh� �������� 0@P`p�������� 0@P`p�������P}����� ���`������������b@���i����@R�����,`���< ���!�`�
�@!���p ����  ����n�`�"��] �(��(��.��* ����W�����@B����p7@�4��x����G����P2��M�����������!@� �GA$3a1P��cmath.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug�o@�7zXZ�ִF!t/��g)]?�E�h=��ڊ�2N�.�t��5����Y��ot���"��Q�w���L�O�����iU�|GW薽�I�䇁;�2�������!�����כ�kS�~��"�م��?�g�
��G�m��*��Ѻ�7߈|Kj�7f��d�beB�F�]Z��T>Ť��X��p�?�{12���;*2b,)O�8�mZ��̤�B{�*y�5���D�}��g�{
]�������읟j9%�lƥ�@���Q���lI��Ǭai䷆0��q�S)�O�E%�Fw�+�t<�<�m��\���
��/'��7t�w��l��'u��賓�D�ҹ��94 ޝ}8��Q�
�tO�%b"��۲J����s�2�6��X�:��bI�E��<%)4��o2�P`�՝��H��[�u��qu�������D� ƪC��4�E�4�?e�����c��j�<��[�OW2�����5K�h����_�Xy�������,hhr ����
r#��}*5}};(uY|�����&I0�(I��H�^vru����d�9>f{���F�l��o��ysvz)�|���*���<M7
��{�&���D�������D�7� >�rtc�@7}��YۛmxT�Z��Yu�����N�mH��c��0hS��O�&q=�\��ޒ2X
v(L��`�tPMZ�H�"�z�-~�y2/K�.�od�50���`dy���V#wM�������ҧ/"�0@�K�$ ��
_�T�5K�r;��B���4p�o����k+�)?p��͆i�<3DT�/������
���k9��:�,�5�#�k�Yh��
?���x	�mz41�!�~g����I����c�R��F���s�2F+���Q�t�m�{*�L�wmڲ����w[�K ҕ)���!e��T�E�k#����F�M�4������_�O�V��a����lH=��<眲�Ą���+G_ǭC�]�c��MN�gq�5��4*r6%�4���y���5h�]�7bV�<CJ�t�� �{>7�/j�Թ`��t�}L��Ũ��7�b�����}3miS��|蕖��_��E��Pn�"���(Y��;=�h�_�PN�}��TGK'ltGr�ˉ!�`�m�%G6����I�b�u��	@p��gN-�x�~1�
��d��߷:�ieڜ:x	�(�����v�BE���_d�ٺV�I�هئ�I���;�X|n��t��I�\կ��;���q6H-}�����U���%�Kp,�xp�G>�W�CT3��=��U���
�AO�
�.FA���g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``8(���000�8���o�	�	bE���o(
(
pT�
�
@^B��xhPPcpp`n��Pw  c�}����
����� 
 �������h�h��	� � � �� ��� �� �  �H �h� h��x� x�x�!� ��!�p" �0&a�$
�\@l�	(lib-dynload/array.cpython-38-x86_64-linux-gnu.so000075500000215220151153537510015231 0ustar00ELF>p;@P@8	@0�0� �� � p� ���� �� 888$$���  S�td���  P�td������TTQ�tdR�td�� � 00GNU��6Hw��)Ħ
=(=8�5wj�@ 	jlm��|CE���qX�8�{UrOb��`�04� :\��%�c A������� �+������`, �F"�-<����sk�Na�I=o���~#?K�����/xLV���������Z�<�|t����+��P	!�@	!�@	!Mг__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6_PyArg_Parse_SizeT__stack_chk_failPyFloat_FromDoublePyExc_BufferErrorPyErr_SetString_Py_NoneStructPyExc_RuntimeErrorPyExc_IndexErrorPyExc_OverflowErrorPyExc_TypeErrorPyLong_FromUnsignedLongLongPyLong_FromLongLongPyLong_FromUnsignedLongPyLong_FromLongPyUnicode_FromOrdinalPyLong_AsSsize_tPyErr_Occurred__memcpy_chkmemcpyPyLong_FromSsize_tPyExc_DeprecationWarningPyErr_WarnExPyBytes_FromStringAndSizePyErr_NoMemoryPyMem_FreePyObject_ClearWeakRefs_Py_DeallocPyType_ReadyPyType_TypePyModule_AddObjectPyUnicode_DecodeASCIIPyObject_GC_UnTrackPyObject_GC_Del_PyObject_CallMethodIdObjArgsPyTuple_NewPyLong_FromVoidPtrPyObject_RichCompareBool_Py_TrueStruct_Py_FalseStructPyType_IsSubtypePyObject_RichCompare_Py_NotImplementedStructPyMem_Malloc_PyErr_BadInternalCallPyErr_BadArgumentPyErr_Format_PyEval_GetBuiltinId_Py_BuildValue_SizeTPyFloat_Type_PyLong_FromNbIndexOrNbIntPyLong_AsUnsignedLongLongPyLong_AsUnsignedLongPyMem_ReallocPyExc_ValueErrorPyObject_GetBufferPyBuffer_IsContiguousPyBuffer_ReleasePyUnicode_AsUTF8AndSizePyBuffer_FillInfo_PyArg_BadArgumentPyUnicode_FromWideChar_PyObject_GC_NewPyObject_GC_TrackPyList_NewPyNumber_AsSsize_tPySlice_TypePySlice_UnpackPySlice_AdjustIndicesPyObject_GetIterPyIter_NextmemmovePyLong_AsLong_PyObject_LookupAttrIdPyImport_ImportModule_PyObject_GetAttrId_PyType_NamePyUnicode_FromFormatPyNumber_Index_PyObject_CallMethodId_SizeT_PyArg_CheckPositionalPyExc_EOFErrorPyList_Sizememset_PyArg_ParseTuple_SizeTPySys_AuditPyByteArray_TypePySequence_GetItem_PyArg_NoKeywordsPyUnicode_AsUnicode_PyLong_AsInt_PyLong_FromByteArrayPyUnicode_DecodeUTF16PyUnicode_DecodeUTF32_PyFloat_Unpack8_PyFloat_Unpack4_PyUnicode_ReadyPyInit_arrayPyModuleDef_InitPyObject_GenericGetAttrPyObject_SelfIterPyType_GenericAllocPyObject_Free_edata__bss_start_endGLIBC_2.14GLIBC_2.4GLIBC_2.3.4GLIBC_2.2.5v����ii
�ti	�ui	�� P�� �� � � �X� �V� pI �  �8� pX@� SH� @JP� "�h� �Xp� Vx�  K�� $��� PX�� �R�� �K�� &�� 0X� @U� �L� (��� X� R� �f� *�(� �W0� p`8� �M@� ,�X� �W`� �Qh� @Np� .��� �W�� �_�� O�� 0��� �W�� 0Q�  h� 2�� `W� _�� 0g� 4�� �S � �P0� 6�H� pSP� @P`� 
�!D�!��!��(!M�0!�W@!Ⱦ�!V��!���! ��!]��!@��!��!i��!`��!`��!r��!��! �!y�!�c!�� !{�(!��8!��@!��H!�oX!@�`!g�h!�x!���!���!0��!���!,��!���!���!]��!@}�!���!��!��!��!��!�d!@� !�(!P�8!��@!��H!��X!`�`!��h!�xx!��!���!��!���!���!���!@��!���!0��!���!¶�! ��!��!ɶ!��!�� !Ҷ(!�h8!`�@!ڶH!��X! �`!�h!��x!��!P�!0i�!p�!P�!���!��!U�!��!�Y!0�!@b!�S!P !�(!�^8! �@!��H!�XX!���! ��!	��! ��!`�!��!� !�!(!�!X!�x!��!��!��!	�!8�0!�Y�! P�!PY�! !�!���!Y�!|!�!!�!@!!P!��h!`Zx!c�!�!�!!�!@�H� P� 
X� `� h� p� x� �� '�� *�� +�� ,�� -�� .�� 0�� 2�� :� =� I� J� M�!60!6�!	�!a�!S�� �� � � � � � � 
�� � � � �  � (� 0� 8� @� H� P� X� `� h� p�  x� !�� "�� #�� $�� %�� &�� (�� )�� ,�� /� 1� 3� 4� 5� 7� 8�� 9� ;� <� >� ? � @(� A0� B8� C@� DH� EP� FX� G`� Hh� Kp� Lx� N�� O�� P�� Q�� R�� T�� U�� V�� W�� X� Y� Z� [� \� ]� ^�� _� `� b� c� d � e(� f0� g8� h@� i��H��H�I� H��t��H����5�� �%�� ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&�������h'��q������h(��a������h)��Q������h*��A������h+��1������h,��!������h-��������h.��������h/������h0�������h1��������h2�������h3�������h4�������h5�������h6�������h7��q������h8��a������h9��Q������h:��A������h;��1������h<��!������h=��������h>��������h?������h@�������hA��������hB�������hC�������hD�������hE�������hF�������hG��q������hH��a������hI��Q������hJ��A������hK��1������hL��!������hM��������hN��������hO������hP�������hQ���������%]� D���%U� D���%M� D���%E� D���%=� D���%5� D���%-� D���%%� D���%� D���%� D���%
� D���%� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%}� D���%u� D���%m� D���%e� D���%]� D���%U� D���%M� D���%E� D���%=� D���%5� D���%-� D���%%� D���%� D���%� D���%
� D���%� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%}� D���%u� D���%m� D���%e� D���%]� D���%U� D���%M� D���%E� D���%=� D���%5� D���%-� D���%%� D���%� D���%� D���%
� D���%� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D�{���H��uH�O� H�CH��m1��f1�[�[�}���H��tH�mt&���UqH�-�� u�H�=�� �C������7qH���3������'q���qH�������}q1�� rH�+t$1��rH�+u�H��H�D$���H�D$�erH��H�D$����H�D$�Nr����M��tI�.uL�����M��tI�/uL�����1��H�@H�+uH�����X[]A\A]����FH�=1|1������![]A\�d����/���H��u(�M����"H�m��"H���)���1��f"H�m��"H���������L"���H��u(�M���#H�m�#H������1���"H�m�#H���������"���H��t)I�m��#L��������D#L�����1��5#L�
J� H�5�{I�9����I�m�v#L���`������#H�-� H�5�{H�}�����J#H�H9s ��#H�NH9���#1�H����#�#H�
B� H�5�{H�9���1��Zr1��r$H��H��vH�5�vH�=�v� ���1��sH���q���L�� H�5�{I�;�;���1��sH��H�D$�G���H�D$�{sH���5�������]sH��� H�5�{H�:���1�ZþLH�=z1�����$H��1�[]A\A]A^A_�I�mtE1��O'L��E1������?'�$�������H���*1��*H�
Q� H�5�{1�H�9�x����*1��{*H������I�mt1���0.H�{L9C �G.M�VM9��:.H����.�,.L��������-������01���s����1E1��4���J1�M2M�t$I�T$(L9�t4H�s(H9��8I9�H�D$Lcn��M��A��D	�H����0�(4�6H�|$H�/t`1���9����H�|$I��H��uSH�/u����1��9H��H�D$����H�|$H�D$H�/�~9H�D$���H�D$�j9���1��^9I�T$P��E��WH�5�� H�=�t1����H�|$(L�'I�l$�H�/Y^H���"9H�D$�V���H�D$�9�'���H���6���I���H8H�=�� H�5�zH�?���1���8L�������:I�.�$<L��1�����;L���������=L�����H�)� H�5�xH�;�R���1���=L��H�D$�^���H�D$�=H��H��sH�5�sH�=�s����1��=��L��E1��q����"?�G���H��uhL�
�� H�5�sE1�I�9�����>H���<����W>L��� H�5�sI�8���H�+��>H��E1������>����E1��>��>L�F� H�5�yE1�I�:�l����>L��� H�5zI�:�Q���L��H���1��?H�@H�muH�������H��H��u01���A��H��H����A���|�H��H��t�H����AI�~(L��I�vLcM�~H�}I��I����@��A�FH�=�u1��m����ZAH9�H�HN�H����A�|$8��BH����I�l$(H)�Lc]I��L��H��J�4���I�D$H��H)�A�|$8~	H9���BI�|$I;l$ �gBH�]H9��ZBH���QBI�l$1��%B1��B1��B1��B1��	B1��BL���V����5CH�
�� H�5CxE1�H�9�����`CH���_C�BH�UH����CH���QC��I�,$��NL��E1����H�T$E1��cJH�������hHH�������NI�D$I�,$uL�������I��H��thL�L$H�5(� I�yH9���N�f���}H�FL���q����N�7�H�|$�W ��`��`t
L�@I���hLL�I���[L�NH�t$�M�8�I��H��tM���s����H��ML�L$�3NL�D$�ML�D$�M�FH�=�sE1��+����qGL�L$D�T$�MH��H����L9��:F�?GH�
6� H�5�uH�9�'����tMH�{L;k ��NH�uI9���NH����N��N�uH�=%s����6OH��� H�5BvH�:���1��OH��H�D$�&�H�D$�OH�l$0�n_H�D$0�N_H�l$0�Z_H�-/� H�5xH�}1��u��UL������t^I�/t1��YL�����YH�ֹ�H�=�o�����2]H�MH�]H�q����g�y yH�y�V�A �ljƒ��� @����@��to����L�AH�@tL�A0E�8H�MH�5�� H�yH9��Z����MH�}�;�A�ă����\��OH�������\H�M�h�����tL�IH�@tL�I0E�9�L�IH��L�AH냄����@��H��0D�9�i���H�@H�muH������H��H��t8L�D$0H�5� I�xH9��b]�@����V�MRL���K��2]��\H���9��?S�?�H��H��t M��u��NV�FH�=�p�\��\�\�T$,�PH�m��\H������\L��H�����L9���Q��RL�� H�5�s1�I�;�?���RL�L$0�w[L�5)� H�5�rI�>���g\��H�m�%\H���m��\�3�L�\$0E�C A��`A��`t*I�[@H����X�M�H�m��[H���*���[I�[H����XH�mH�5,m1�H�=�l�L��RH��H�C���H�IH�:���I�,$�tZL�������QI�,$�\ZL��1�����QH�D$0�+[f���H������8���H�����O�F8���H��t|�O�F8�usH��tj�O�F8�uaH��tX�O�F8�uOH��tF�O�F8�u=H��t4�O�F8�u+A��f�B�B�8�uI��L9�u�1��8�����D6��f���H������8���H�����O�F8���H�����O�F8�uH��tv�O�F8�umH��td�O�F8�u[H��tR�O�F8�uIH��t@�O�F8�u7H��t.�O�F8�u%A��B�B�8�uI��L9�u�1��8�����ff.���H��~|��9�uwH��tn�O�F9�ugH��t^�O�F9�uWH��tN�O�F9�uGH��t>�O�F9�u7H��t.�O�F9�u'A���B��B��9�uI��L9�u�1��9�����D6��ff.���H������f9���H�����O�Ff9���H��t{�O�Ff9�uqH��th�O�Ff9�u^H��tU�O�Ff9�uKH��tB�O
�F
f9�u8H��t/�O�Ff9�u%A��f�B�GB�Ff9�uI��L9�u�1��f9�����D6�����H������f9���H�����O�Ff9���H�����O�Ff9���H���|�O�Ff9�urH��ti�O�Ff9�u_H��tV�O
�F
f9�uLH��tC�O�Ff9�u9H��t0�O�Ff9�u&A��B�GB�Ff9�uI��L9�u�1��f9�����ff.����H������9���H�����O�F9���H��t~�O�F9�uwH��tn�O�F9�ugH��t^�O�F9�uWH��tN�O�F9�uGH��t>�O�F9�u7H��t.�O�F9�u'A���B��B��9�uI��L9�u�1��9�������H����H�H�H9���H����H�OH�FH9���H��tyH�OH�FH9�uoH��tfH�OH�FH9�u\H��tSH�O H�F H9�uIH��t@H�O(H�F(H9�u6H��t-H�O0H�F0H9�u#A��f�J��J��H9�uI��L9�u�1��H9�����D6��f���H����H�H�H9���H����H�OH�FH9���H����H�OH�FH9���H��t~H�OH�FH9�utH��tkH�O H�F H9�uaH��tXH�O(H�F(H9�uNH��tEH�O0H�F0H9�u;H��t2H�O8H�F8H9�u(A���J��J��H9�uI��L9�u�1��H9�����ff.���H�G�����o8����H�H��H��u1��H������UH��H��SH��H�5�cH��dH�%(H�D$1�H���N���t5H��x'H�E�$��1�H�L$dH3%(uH��[]�1�����������UH��H��SH��H�5UcH��dH�%(H�D$1�H�T$�����t6H��x(H�E�D$��1�H�L$dH3%(uH��[]�1���������ff.�f���UH��H��SH��H�5�bH��dH�%(H�D$1�H���^���t3H��x%H�EH�$H��1�H�L$dH3%(uH��[]�1���������f���UH��H��SH��H�5�bH��dH�%(H�D$1�H�������t.H��x%H�EH�$H��1�H�L$dH3%(uH��[]�1��������f���UH��H��SH��H�5JbH��dH�%(H�D$1�H�T$�|���t-H��x$H�E�T$��1�H�L$dH3%(uH��[]�1�������!����UH��H��SH��H�5�aH��dH�%(H�D$1�H�T$����t/H��x&H�E�T$f�X1�H�L$dH3%(uH��[]�1��������ff.�@��UH��H��SH��H�5�aH��dH�%(H�D$1�H�T$����t/1�H��xH�U�L$�H�L$dH3%(uH��[]��9�����@��H�G���>�ff.���H�Gf��Z���f.���H��H���H�GH�~H�H�H����H�O(L�GI�HcAL�N L��L�D$�~D$H�D$H�F@D$F��uCA��H�F0A��A��t@��H�F8H�F(H�FHu@�G81�H���fD��L�O��L�N0��u�L�V��H�F(L�V8H�FHt�H�Q H�V(�9uu�H�
$`H�N(�H�
�`L�WI�H�H�O(HcAL�^ L��L�T$�!���H�=�� H�5_bH�?�����\������H��x
H9w~H�G(�`PH��� H�5�_H�:�s�1�Z�ff.�@��UH��H��SH��H�5_H��dH�%(H�D$1�H�T$�L���t>�D$��xV=��4H��x!H�Uf�Z1�H�L$dH3%(uH��[]�1����������H�
� H�5bH�9������H�=�� H�5�aH�?�����ff.�@��UH��H��SH��H�5�aH��(dH�%(H�D$1�H�L$H�T$����t=H�|$u:H��x'H�D$H�M�1���H�t$dH34%(uH��([]�1����&�����H�=� H�5�aH�?�����fD��UH��H��SH��H�5�]H��dH�%(H�D$1�H�T$�����tA�D$f���|Vf��5H��x"H�U�1�H�L$dH3%(u
H��[]�f�1���������H�
�� H�5LaH�9�l����H�=�� H�5	aH�?�Q����ff.����H�GH�<��O��ff.�@��H�GH�<��_�ff.�@��H�GH�<����ff.�@��H�G�<�������H�G(Hcx���ff.�@��H�GH�<����ff.�@��H�GHc<���ff.�@��H�G�<p��ff.�@��H�GH�<p�n�ff.���H�G�<0�O�ff.�@��H�GH�<0�.�ff.���H�G�<������SH��H������H������H�����H�SH9BHNBH�CH�զ H�[�ff.�@��SH�0H��uH�{H��t���H�CH��[H��@������ff.���H��H�H��t.H�pH;w}H�NH�P H�H���H�@H�/t1��P�y�1�Z�D��SH�����H�{H��u	H��[�Q��H�/u��F���@��AUI��ATI��U1�SH��f.�I9l$~]I�D$(H��L��PH��H���3��L��H���_�H�+tH����t�H��[]A\A]�H�߉D$H�������D$��t���1������AWAVAUL�-/� ATA��UH��SH��H��H�GL9��#H�~H9��2L�uH�VL9��PL�U(L;V(uiM�BM��t`H�vH�}A�Ѕ��aL�uH�SA�����H�5dJc�H�>��f.�H��� H�H��[]A\A]A^A_�fDM����H����E1��f�I9���L�U(L��H��A�RL�{(L��H��I��A�WI��M�����H������H��L������H�H�D$H����I�.��L���a��I�/��L���O��H�|$���L�uI��H�SM9��^���A�����H�=%cJc�H�>��L��I��A�T$����eA��t6f�H��� L�I��L�H��[]A\A]A^A_�L9����Å�u�H�T� L���L9�@��@����L9�A��A����L9�������I�/uL�����H�|$����L�uI��H�SM9�������0���L��H���3�����H�{L9�tH�5˪ �������H�}L�sL9�����L��L�U(L;S(����M�JM������I9�H�sH�}IN�A�х�u
L�uH�S���A���4��L��aOc�M�>A������������������@��@������L��I���u���A��tjA��tWD��L��L���%��I�.uL��H�D$�b��H�D$I�/�N���L��H�D$�F��H�D$�7���H��� H��'���H�͡ H��H��� H��f�AUATUSH��H������LcbI��H��H��������H�I��H9��Z��1���0H��H��tBL�h(H�h H�@0H�hH��tBL��H��H������}��H�CH������C8H��H��[]A\A]�ff.�H�@�@8H��H��[]A\A]���SH��H�=�� �<��H�SH��tH�KH��H�=V1�[�M��H��H�=�U1�[�;��ff.���AUI��H��ATI��UH��SH��H�B���tM���H��H���tM��x6I�UJ��1�H��[]A\A]����H��uH1�M��xI�uJ����T��1����PH��H��t H���G��H��H���t�M��y��#��������D��AUI��H��ATI��UH��SH��H�B���tM�d��H��H���tM��x6I�UJ��1�H��[]A\A]�����H��uH1�M��xI�uJ�������1����gOH��H��t H�����H��H���t�M��y����������D��AUATI��H��USH��H��H�B���t3���H����������H9�w[H��xRI�L$��1�H��[]A\A]���NI��H��tJH���t��H��H���tM�����H9�wMH��x	M�D$A��I�mt31��H�=ɞ H�52XH�?����������H��u��������<���F��ff.�@ATUH��S�G8H�����H�H;s !H�VH9S}H��tH�s1�[]A\��H��twI��1�L�K(I��H�{@��IcAI�L��M�I��H��pkH��xf�q��H��t\H�C1�H�kL�c �H9w����H�=�� H�5tWH�?������x������H�C1�H�CH�C �T����������G�����AVAUATUSH�OH��H��~}H�G(H��A�LI�Hch������H��������H��H�H��H9�fH��H��PI��H��H�������tVL�sA�M��M9�}I�H��L��I��L���@��I����H�H��[]A\A]A^�H��H�I��H9�}�[]A\A]A^�!��1���ff.�f���UH��H�5�� SH��H�H9�uCH�=̢ �G��H��H��t%H�EH��H�hH�@H�E(H�PH�S ���H��H��[]��{�����2��뮐��AWAVAUATUSH��H���I��I��1�E1�L�-���Wff.�@I�WH�<*���H��H�������L��H�����H�+tO��������H��I;o}[I�G(H�XL9�t�H��L����H��H�������L��H���G��H�+u�H�߉D$�����L$��-�n��H��I9o�H��L��[]A\A]A^A_����I����E1���D��AVAUATUSH��H�~iI��I��L�-��1�f.�I�D$(H�XL9�urI�T$H�<*����H��H��tA�L��H�����H�+����}u!H��I;l$|�H�
1� H�5�UH�9�z��H��1�[]A\A]A^�ff.�H��L���H��H��tֺL��H��� ��H�+t:��u�H��I9l$�E����H��H��[]A\A]A^���ff.��H�߉D$�d���D$�ff.�AUATUH��SH��H��
��H�����1�H�}I��L�%��~Dff.�H�E(H�@L9�uCH�MH�<���H������I�uH��H��H;]|�H��L��[]A\A]�ff.��H��H���H���w��I�UH��H��H9]�H��L��[]A\A]�ff.�@��H��~|��9�uwH��tn�O�F9�ugH��t^�O�F9�uWH��tN�O�F9�uGH��t>�O�F9�u7H��t.�O�F9�u'A���B��B��9�uI��L9�u�1��9�����D6��ff.���H����H�H�H9���H����H�OH�FH9���H����H�OH�FH9���H��t~H�OH�FH9�utH��tkH�O H�F H9�uaH��tXH�O(H�F(H9�uNH��tEH�O0H�F0H9�u;H��t2H�O8H�F8H9�u(A���J��J��H9�uI��L9�u�1��H9�����ff.���H����H�H�H9���H����H�OH�FH9���H��tyH�OH�FH9�uoH��tfH�OH�FH9�u\H��tSH�O H�F H9�uIH��t@H�O(H�F(H9�u6H��t-H�O0H�F0H9�u#A��f�J��J��H9�uI��L9�u�1��H9�����D6��f���H�G(H�wHcHH��������H�H��H9�����H��H����ff.���AWAVAUATUSH��H��H��8H�VdH�%(H�D$(1�H�B`H��t{H��tqL�%*� I�4$���H��H����7L�KH���FL9��_H�k(H��UH��H�L$(dH3%(H���6H��8[]A\A]A^A_�ff.�H;�� �#��H�s(L�l$H�l$H�L$ L��LcfH���Q�������H�{H�L$ L��H���E��I��H��mH��������H�[(H�LcCI��H������1�H�=D� �n� H��H���A���H�X(H�@ H�@0H�@H�@�@8����f�H�|$ H�S(H��H�=� ���A�H��H���b��L�t$H�xL��L��I��Hs�)��Lt$ I�������H�}L��L��I��HsL����Lt$ I�������H�}O�<$L��L��I��HsL�����Lt$ I���c���M�H�|$H�}L��L��I��HsL�M����H�|$Lt$ H��I9��"�����k�H��H������L��H�sH�xI��L�d$L��R�����H�D$�#��H���3��L�KH�t$L�xI9�~L�k(H��A�UH��������I�<$H�5�H1��������AWAVAUATUSH��H��H��8dH�%(H�D$(1����H������I��H�D$'L�%��H�D$L�==HL�����H��H����H�K(L�sH�AL9���H�T$1�L��H����������s8M�F����H�{L;C ��M�NL;K��H����H�{(L�CH�GL9��4H�T$1�L��H���������M��� H�{D�T$'F�7H�m�8���H������L���(��H��H���0���ff.��I�m�>���H�������H�L$(dH3%(�IH��8[]A\A]A^A_�f�M���
M��1�H�C(I��H�{��Hc@M�H��I�I��H���H����L�\$L�D$�L��H����L�D$H�t$H�CL�CH�s L�K(I�AL9�����ff.��H��L��H��Ѕ�uZH�m�&���H��������f�H��H�����H��Ѕ��<���� L9C����H��� H�5�JH�;���H�m�������L���_��������H�CH�CH�C �;��������>���ff.��AUATUH��SH��H��H�~H�5�� H9���H�U(H;S(��L�cL�mH��������H��L)�I9��A��HczH�K�t%H��H9��*��H�������t,M��~iL�C(H�u(IcPHc~H�sI��I��H}���1�Z[]A\A]��P�����l���YH��H��[]A\A]�f���L�
�� H�5KI�9�������1�����Q������t
H�ڏ H�Z�1�Z���AWAVAUI��ATI��USH��H��8dH�%(H�D$(1�H�FH�P`H���DH;�� ��L�t$H�l$ L��H�L$L��H��������*��H�{H�L$H��L������H��M���"I�|$H�5� H9��VM�t$I�T$(L9���H;S(�,M��Lcj��I9�H�D$A��D	�H���>H�T$ H9T$�������K8����H����M���^H�|$ H����H�D$I��H����H��H�SL�H9���I��I)�L��H�{H9k ��L�eL9���H����H�k1�H�L$(dH3%(��H��8[]A\A]A^A_�ff.�@L�c(H�D$Mcl$H����H�T$ H9T$|
E1�E1�����f��E1�E1�H�T$������H����H����L�t$ I�t$L��L��I��H{����Lt$H����I�t$L��L��I��H{L����Lt$H��tsI�t$L��O�|-L��I��H{L����Lt$H��tHM�I�t$L��L��H�D$I��H{L�M��]��H�D$Lt$H��H9�u�f.�1����f�L�e�L�GL��H��L�D$H�D$I�L�d$ H���-���H�SN� H�{L9��H��L)�M��I��I�t$M��I��H�L����H�T$H��I�H���FH�SH��HD$ H9���I�Ջ{8I)�L������I9�����H�� H�5�EH�;���������DL9����zM������L��H�|$ I�t$I��I��H{�*��1����L��H)�H�{H��H)�I��I��H�H��,��H�S�S���H����H�T$ H9T$�������������{8�������<���ff.�@�:���E1�E1��ff.�f�H�������L�5� L��I�6���I��H�����H����H;C��L�K(M����M�iL�X��M9���1�H�T$ H�5G?L����������L�[H�t$ 1�K�4��k���ff.�f�H�P�����H���I��E1�L�S(I��H��A��IcBI�J��I�I��H���/H���&����H���H�C1�H�kL�{ ���f�H�sN�4"H��L9�wH�V�L)�I�t$M�|$�H�{I��M��I��H�L��c��H�T$H��I�H���h���A�H�CJ�"H��H9�rH�P�L)�M��H�{I��I�t$M)�I��I��M��H�L����H�T$H��I�I9������H�L$ H�t$H�SH�{L�H)�I��I��I��H�H����H�sH��L�H)������&������f�L��L��H��A������E1�M��H�=� M��MH�MI�L��L�T$�*�H��H������M9�}$M�\$(H�T$H�xIcsH��I��It$���H��L��H�����H�m�Z���H��D$�����D$�E���H�sH��L�H)������E��H�l$ H�SH�t$L�[H)�L�L)�I��I��I��L�I�<+����4����`���H������L�CM�x	M9�����I�>H�5�C���������L�|$ I��Mci�L�|$�H�D$�������������������I�\$H�=V� H�5GC1�H�SH�?艿�����O����l���H�
-� H�5~BH�9�V�����,����y���H�C1�H�CH�C ����H�ˆ H��L��1�H�5CH�;�������������������������ff.�f���AVAUI��ATI��USH��0dH�%(H�D$(1�H�G(H�=V� �(���zH�V�������H��芾��I��H�������H�T$H�5�� L���������H�|$��L�
~� ��BL�L$I���3w%L��ED��Kc�L�>��A�I����L���0�H��H���a��I�t$L�D$H����1�H�=�;���H�+�p��H�|$H�/�H�L$(dH3%(��H��0[]A\A]A^�ff.�f���B��3w�H�=	F��Lc�I�>A��I���^���A�I�L$(I�t$H��������H�LciI��H9�����I��I�|$�L���H�|$I��H������H��I�T$E���WH�5�� H�=�:1����H�|$(H�7L�V�L�AXAYM���������fDI�������A�
�[���A�A��E�I��������?���E1���H��`A�H��?CH�\$ H9T$ �a����f���A�A��E�I���O�����E1����D$ K�|$ KA������$���A�����E1�����H�=@:蝾��I��H���y��H�5:� H��肼��I�.H��� �I��H�=�� t;I�M���t)L���һ��I��H����H�������軽���j���������������AVAUATUH��SH�E(H�D�(H����A��u��譾��I��H����1�H�}L�%C��~7�H�U(H�BL9�usH�uH�<�e���H������I�~H��H��H9]�H�}��A��L��H�=�8H��1����I�.H��uL���X���[H��]A\A]A^�ff.��H��H���H���$��I�NH��H��H;]�Y����H�}�~���[A��]H��A\H�=38A]1�A^�q���H���95I��H���S���1��f���AWf�I��1�AVAUATUSH��H��H��xdH�%(H�D$h1�L�d$)D$L��)D$ )D$0)D$@)D$P詺�������CL����������I�G(H�|$(HcX�h��H�D$ H�H��I��H����H���4H��������I�oH��H)�I9����H�M�,.H��I9����A�w8��~	L9��I�M;o lM�EL9�}cH��t^H��M�oH�t$I��H�H��赼��L���]���H�f� H�H�|$����H�L$hdH3%(�H��x[]A\A]A^A_�M����M��E1�I��H��A��M�N��M�L��H��H����H����L�L$�X���H����H�L$I�GM�oI�O H��H��H�t$I��H�<(���L��蝻��H��� H�H�|$�@������H�=:� H�5#:H�?�K���L���c���1���L���W���L�=� H�5�:I�?�!���1��1���D���I�G1�I�GI�G �W������k����f���AUATI��USH��H��H����H�CH�5� L�+H�xH9��(�������H�{�!���H��H�������H��荸��H�+H�������H�����I�T$(HcJH���b���H��������H�H��H9������H��H��4L��1�H�5Մ H���}���H��H��tjH�p����=���L��H��L�h���H�+I��uH���T���M��t4L9�u4H��L��[]A\A]�H�ֹ�H�=4�c��������E1���H�=W~ H�50;H�?萹��I�,$u��t���������f.���AWAVAUATUSH��H�F����/H��H��I������I��H���~L�m�U8N�4(��~	M9���H�}L;u vI�^I9�}mH��thL�u1��ff.�L�uH��I�L)�L�L�u(H��H��A�V����M9g�W���H��I9�u�H��} H�H��[]A\A]A^A_�M����L��1�L�M(H��I��@��IcAL�L��L�H��H����H������H��tH�EL�uH�] �<���H�
} H�5�6H�9�%���1��t���L��| H�5
3I�;����1��W���L��H�����1��E�������H�EH�EH�E �����H���1��������AWAVI��AUA�ATUSH��H�_H��LI�H���UH��������H��H�H��L9���I��L�(H�������H��McgH�I��H9��O���1�H�=G� �q� H��H������L�x(H�X H�@0H�XH���4H��I��H���ɾ���S���H��H�EH�������M�F(L���E8I�vMcxM�~I��I����L���2���I9�}oI��H�uM)�M9�J�<>MO�L��M��
���I9�}JI��H�uM)�M9�J�<6MO�L��M����I9�}%I��H�uM)�M9�J�<&MO�L��M��ö��I9�|�H��H��[]A\A]A^A_�H��������L�g(H�IcL$H��H������1�H�=� �<� H��H�����L�`(H�@ H�@0H�@H�E�E8��6H��舱���u���X[]A\A]A^A_�3���ATH��I��US�H�GHI�H�����H9�HN�H��H9��z���H9�H�OHN�H��H)��U����w8��xH���Z���H�(H)�H��H��HcH��H��H��H�H��γ��I�D$E�L$8I��I)�L�E��~	H9���I�|$I;l$ 5L�UL9�},H��t'I�l$1�[]A\�H�=�y H�5�3H�?�Ѵ������H��tRH��M�D$(H��H����Ic@H���H�4�H�H��H��phH��xc�-���H��tYI�D$1�I�l$I�\$ �蠰��1�I�D$I�D$I�D$ �b���L�%'y H�53I�<$�7������C���誰�����6���f���ATI��UH��SH��H���H����I�$H�5�x H�xH9������/����������I�<$�^���I��H����H���ʱ��I�,$H�������H�������H�UH��tH��xBH9�}BH�E(H��H��PI��H��tCH�SH��H�������u5L��[]A\�H�UH��H��t8H�y�H�=Bx H�5_.H�?�3���E1���I�,$u���L��E1�舲���L�x H�5.E1�I�8�����F���H��u��7���1ҹH��H�=�-膱����t��
���ff.�f���AVAUATUSH��H���I��I��L�-���1��J@I�T$H�<*豱��H��H�����L��H���E���H�+����lufH��I;l$}EI�D$(H�XL9�t�H��L���H��H��t=�L��H�����H�+tV��'u!H��I9l$�H�
�v H�5�3H�9���1��H�UH��L���,�����u�H�w H�H��[]A\A]A^�H�߉D$�$����D$�ff.���H��xH9w~H��t#H�G(�`PH�}v H�52H�:�n�����Z�H�V�����AWAVAUATUH��SH��H��(dH�%(H�D$1�H�D$H��tH�#~ H9��v1�H�L$H�T$H��H�5?,�O������A	H�L$H���^�T$1�H�5!,H�=,�0������	L�D$�T$M��M����I�xH�����u�����	H�5�} H9����ή�������L�L$M���I�y���uH�5$u H9����T$��b�N��B����u�|��h�c��H����i����I����l��E1�L�=�n I��0E�'E���fA9�u�L�L$M����I�yL���A����M�iM���-���H��������IcoH�H��I9��ӹ��1�I��H���0I��H����L�x(L�h H�@0L�hM����H�������H��藯��I�D$H�����L�L$H�5-| A�D$8I�yH9����b������y1�I��H�|$H��I�����M�A��H��H����I9\$�����I�D$(H��H��L��P���H�m�\���H��L9���M��uM�H�|$H��胬��H��H�����I9\$�?���I�D$(H��H��L��P����H�m����H��H�|$H���7���H��H�������I9\$��M�|$(H��H��L��A�W���hH�m�����H��L9��^���M���vH�L$dH3%(L���RH��([]A\A]A^A_�ff.�@L�=�k f�E1������H�@�@8L�T$M��t�I�zH�5Lr H9��\辫���������H�t$H�~H�����7���H�59z H9�t
�������)���M��� ���L�\$I�|$M�C(I�sIcPI���o������f.�E1�I�yL���A����M�iM���I���L�=!j A�M��1�H��L���0I��H����L�x(L�h H�@0L�hM���(���H�@�@8����ff.��L�=�i ���H�5My H9��菪�����Ѷ��L�L$L���Z���I��H���hH�D$�T$���b����B�@��u���h�?��H�G��i����I����l����L�=qj ����ff.��L�=ii ��H��H�=�&�ը������1�H�L$H�T$H��H�5�&�§������H�L$H�����T$1�H�5�&H�=�&裫������L�D$�T$M��M������I�xH�����utF����H�5x H9���E������Z���L�D$M���I�xH���@��uhH�5�o H9�t\�������0���L�L$D�T$I�yD��H������bA��u�-������!���E1�L�=+h ���fD�T$E1��D���L�=mh ���L�=�h ���L�=�h L�L$�Q���L�=�h �o���L�=�h �c���L�=lg A����H�5�v H9����:������E���E1�H��������McGH�I��L9���������ff.�H�����H��H�������H�|$H�(�����D�O A��`A��`�\L�@I��M���j���I�|$L�����H�������L��I�D$L��H��H��H��I�\$裩��I�L$I�L$ �&���L�L$M���)���1�H���0I��H���IH�5Xf E1�I�D$ I�t$(I�D$0I�D$I�D$A�D$8�-���L�=Gf L�L$����L�=�f L�L$����L�=�f L�L$���H�
�m �#���L��L������I�6����H��I�6�f���L���ç���Y���L�=�f L�L$�c���I�y(D��D�E9������A��b�/���E1�����L��L����H��tdH�(�����酱���L�=�e L�L$����I�P(�:u���T$H�5*L�5�l 1�I�>�Ƥ��E1����H�m�=���I�,$u�L��E1��������臦��H�5�)�H�l H�5*E1�H�;�e����k���M�iM���t����ϱ��H��I�6�8���I�,$u�L��袦���w���I�yH�5�k ���L�I������q���ff.�AWAVAUATUSH��H�oH�����H�G(I��H��I��H������P���(�K8L�m����H�{L;k HH�UH9S}>H��t9L�kM����H�S(L9�|��H�BH��L��H��H��[]A\A]A^A_��M��trM��E1�L�S(I��H�{A��IcBM�N��M�I��H����H����轢��H��H����H�CL�kL�{ M��xgH�S(I9��k����l�������H�C1�H�CH�C ��L;k�����H�=�j H�5�$H�?譥����Z[]A\A]A^A_Ã���I�A�MH��LcjH��L��L)�L��I��I��I�H�4L�����H�S(�����ա�������ATI��UH��SH��H��uyH�EH�5j H�xH9����k������3���H�}蚥��H��H��thH���
���H�+�-���H���tPH�UH��L��������u9H�j H���H��[]A\�H�ֹ�H�=
 �V������f���1������H��u�H���饯��D��AWAVAUATUH��SH��HdH�%(H�D$81�H������H�NH�H�A���������A �������H�y�z����ljƒ��� @���(�����������@�w���H�VH�5�h D�y0H�zH9�������,������}���H�}�k���A�ă����L�SH�mA������H�5�p H��������Z
A��btLA��BtFA��ut@A��ht:A��Ht4A��it.A��It(L�-b A��ltI��0E�]E����E9�u�@A���`L�uA�����A�w�@��3�}H�=W)@��Hc�H�>��A�A��E�E9��RD���ӡ��I��H������}���I��H���d���L�$$�~$H��H�L$0H�,$H�T$,H�5�H�E$@1�H�D$0�Ӟ������H�L$0H���O�T$,1�H�5�H�=�财�����lH�l$0�T$,H��teH�}L�����ut4A���XH�5o H9����\������X���H�l$0H��tH�}���uH�5�f H9��'�T$,E1�A�у�b���B�r��u����h����H�wA��i�A��I�2L�;` A��ltI��0A����D9�u�H�D$0H���wH�xL���A���-L�`M�������H��������McxL�$H�I��I9��Y���1�H���0H��H���&L�$L�` H�@0L�X(L�`M���tL��I��H�������� ���H�EH�������L�D$0H�5�m �E8I�xH9��������71�H��H�|$0H��L��H�4$H���g���I��H���eH9]�1���H�E(L��H��H��P����
I�/�έ��H��L9���H�<$uTff.�H�|$0H������I��H���~���H9]�ͭ��H�E(L��H��H��P���7
I�/�j���H��H�|$0H��躝��I��H���5���H9]�����H�E(L��H��H��P����	I�/�!���H��L9��e���M����I�muL���ݞ��H�L$8dH3%(H����	H��H[]A\A]A^A_�E1��D�������D9���D������I��H���"�辞��I��H�������L�$$�~$H��H�L$0H�,$H�T$,H�5H�E$H1�H�D$0��������H�L$0H�����T$,1�H�5�H�=��������H�l$0�T$,H�������H�}L�����u�m���A����L�5Sk L9��	L��蒜���������H�D$0H���O���H�x���uH�5�b H9��YD�L$,A��b�=A��B�dA��u�zA��h�yA��H��E1��*���1��������L��>�I��?CL�D$0L9L$0�d���Ic�H�
=H�u1�I��I��H��L�L�	I��H�D$H���ڨ��E�T$�A�����q�A�bL��Z �t$�D$�ff.�f�I��0A�����E�k(E��t�McsM9�u�D�D$E;C,u�D�����D$0K�|$0K�������D����������1���1��������H�D$0H����1�H���0H��H����H�=�Y H�E H�}(H�E0H�EH�EE1��E8L�L$0M������I�yH�5a H9���舚���������L�L$0I�yH������[����H�5i H9�t
�G������j���M���a���L�T$0H�}I�R(I�rHcRI���8����>���E1�H�xL���A����L�`M�����L��X A�L�$�h���L�l$L�$L��贛��I��H���rM��~OH�<$L�m E1�1ҋL$�|$H��H�<$��L���˘��H��H�������H�<$I�L$I�J��I��L9t$u�D�����I��H��������覚��H��H�������L�<$�~$1�H��L�$$H��I�$$P�c�H�mH��uH���!���H��I�,$�6�����L�������%���L�X E1��!���L��X H�D$0����L�+X ��L�RX ��L��X H�D$0���L��W H�D$0����L�WX �H�D$0L��W ���L�}W A���H�5	g H9���L�$�G���L�$�������E1�H��������McxH�I��L9��>�������L��W H�D$0�K�������������H�D$0H�xH�����������|$,uuE1����G���H�5pf H9��貗���������H�D$0H���}���I��H���aH�D$0�T$,�Y���L�HW H�D$0���L���V���I��H���8���H�|$0H�(�����w ��`@��`�fH�_@H��H���S���H�}H���l���H�������I��H�EH��L��I��H��L�e����H�EH�E ����L��Oc�M�>A��1�A��H�} ��H�D�d	�H�L$0D�d$0���H��I��H���<�������E1�A��H�} A��H�L$0H��G�T	�D�T$0���H��I��H����������H��1�A��A�@��H�I���<$H��I���'���I��H����H�u E1�H�t$M9������H�l$�4$J�|������ϔ��H��H���.���I�L$J��I����H��E1�A��A�A��H�I��D�$H��I��謗��I��H��tnL�] E1�L�\$M9��;���L�D$�4$K�<��n����Y���H��H�������I�|$J��I����H�
G\ ��I�RH�5�H��[ H�81�����1�����:���A��H����1��i���L�
w[ H�5�1�I�9辖���L���L��H���N��H���/H�(�����ţ��H��L�����I�>����H��I�>�����L���ڕ�����I�VH�5��N���H��Z H�51�H�;�=�������L��Z H�S1�1�H�
:c H�5#I�:�#������L�`M�������O���H��I�>����H�muH���P���I�m����1��Y����ɔ��H�-�Z H�5�1�H�}�����I�/�����H�mu�H�������I�xH�5XZ �F���H�_H�����H�mu�H���ה���H�Z H�5�H�;�O����j���H�x(�;T$,����[�H�u(�>u�-�L�5�Y �T$,H�5]1�I�>�����&����x����H�=�c H��c H9�tH��Y H��t	�����H�=ic H�5bc H)�H��H��H��?H�H�tH��Y H��t��fD�����=%c u+UH�=rY H��tH�=�Q �����d�����b ]������w������H�G(�P��������uL�OH�WM��I���TI���>M��fo�4H��E1�I��f��o8�oPfDo�fDo��Do@ �op0fDo�fDo��o�o@fq�fq��o` �oh0fAq�fq�f��fg�f��I��f��f��fg�H��@fDg�fg�fD��fE��fq�fD��fAq�fD��fEg�fAg�fq�fEg�fq�fDo�fAh�fg�fE`�fo�fDo�fEo�fAh�fE`�f`�fh�fE`�fEh�@�Dx�Dh�x�M9������L��H���H��I)�I9���2�JM��f��f��I��f�
f�r��D�Z�BfA��f��f�BfD�ZI����D�B�z
fA��f��f�zfD�B
I�����r�Jf��f��f�Jf�rI���}D�JD�ZfA��fA��fD�ZfD�JI���U�BD�Bf��fA��fD�Bf�BI���0�z�rf��f��f�rf�zI���D�J�JfA��f��f�JfD�JI����D�Z �B"fA��f��f�B fD�Z"I����D�B$�z&fA��f��f�z$fD�B&I��	���r(D�J*f��fA��fD�J(f�r*I��
t~D�Z,�J.fA��f��f�J,fD�Z.I��t]�B0D�B2f��fA��fD�B0f�B2I��t<�z4�r6f��f��f�r4f�z6I��
tD�R8D�J:fA��fA��fD�J8fD�R:H��U H�Ã�ubL�_H�W�KA�sA�I��A�C�A�{�E�C�E�S�A�s�E�K�A�s�A�{�E�S�E�K�A�s�E�C�A�C�A�K�H��y�뒃�t�PL�YU H�5
I�;�*���1�Z�L�GH��A�A�pI��A�p�A�H�H��y��H���ff.����H�G(�8�Ў����AVAUATUSH��H�WdH�%(H��$1�H�G(Lc`H��~bH�Z�H�oI��H�H9�sNM��I��I��ff.��H��L��L���=���H��H��L���Ϗ��L�H��L��L��L�軏��H9�r�H�oT H�H��$dH3%(uH��[]A\A]A^�������H�G(H�WHcHH�O HJ H���ߎ��ff.�@��H��S SH���H�5�H�8�-����������H�S(H�sH��������HcJH�H��H9������H��H�{[铍����USH��H�=p[ H��(dH�%(H�D$1��7������^���H�pS H�A[ H��H�5yH�/[ H��Y �Ӊ�����2���H�[ H�5+	H��H�[ 證��H�VK ������H��0�:u�H�|$
H�
9K �bH��H��H��0@�n��)@��u�H)�1�裉��H�5�H��H��H���N���1��������H�L$dH3%(��uH��([]��v���fD��AWAVAUATUSH��H�G(H�OH�4$�HcXH��H����H�H��H����H��I��E1�M��M9���M��H�}M�pI��M��L�I��L9��;���Ii���H����I��H���7���H�<$1�H��H�5�W 1�蔌��I�/uL��H�D$�!���H�D$H�������H�8M��L�W�L�M���i����׍��H��Q H�H��[]A\A]A^A_�ff.���UH���SH�����H�������H�}H���4���H�������H�CH�}����H�������H�C H��H��[]����ATUH��SH�~H��H�5�X H9���H�U(H;S(t�/���E1�L��[]A\�H�KH�uH��������H)�H9������H�H�=�X ���I��H��t�H�uH��~H�U(H�xHcRH��H�u�݋��L�CM��~�L�K(H�}(H�sIcQHcH�}I|$I��譋���l���胉�����M���L�SL��O 1�E1�H�5�	I�RI�;�����7���SH�5�O H��H�H9�t�7�����u	H��[骈��H��O H�5dH�8�Ċ��1�[���AUATUH��H��H�5SH��(dH�%(H�D$1�H�L$H�T$覉����tsH�E(H�\$�8u�ύ��H��~2L�eH��L�l$J�4#������tBH�UL��J�<�H��詊��H�bO H���H�L$dH3%(uH��([]A\A]�1�������fD��AV�AUATI��USH��H�ĀH�VdH�%(H�D$x1�H�l$ H�����51�H��H���M��������CH��蘇��������L��N �H�5�I�8�������I�t$(H�|$8Hc^�����H�D$0H�H��I��H��uxH��~^H��������M�l$I��M)�M9�����H�K�4.H��H9���L��蹯������L��I�|$H�t$ I��L�H���S���H�����H�N H�� H�����L�gM H�5PI�:谈��1�H�|$(�n���H�L$xdH3%(uLH��[]A\A]A^�H�t$H���X���H��t�H�L$E1�H��H��A�H����������H���j���1���A����VH�G(�8u�'���H�wH�Y鄄��@����f.���AVAUI��ATU1�SH�GH��H�W(H�=�T H��HI�HH�H9�HN�I��I)�L���-���I��H��t%H9�~ I�U(H�xHcrL��H��H��Iu����[L��]A\A]A^�@���w������闲�����UH��SH��QH�~H�5XT H9�uH��H��蘻�����0���H�H��Z[]�������u�H�EH�
�K H�5�1�H�PH�91����������QH��H�w����1҅�uH�L H�H��Z�f���H�=Q �І����H��H���d;array item must be floatf;array item must be floatL;array item must be integerl;array item must be integeri;array item must be integerh;array item must be integerb;array item must be integerwarray index out of rangeArrayTypetypecodesN(())N(O)nu#:fromunicodecontiguous bufferargumentfromstringO(CO)OO(OCiN)O%s('%c')%s('%c', %R)frombytesfromfilenegative countread() didn't return bytesarg must be listpoppop from empty arraypop index out of rangeC|O:arrayCOarray.__new__array.arrayinsert_array_reconstructora unicode characterargument 2stricttypecodeitemsizeappendbuffer_infobyteswap__copy____deepcopy__extendfromlistindex__reduce_ex__removereversetofiletolisttostringtobytestounicode__sizeof____reduce____setstate__readiterwrite__dict__bBuhHiIlLqQfarrayiteratorarray_buffer_getbuf: view==NULL argument is obsoletedon't know how to byteswap this array typeunsigned short is less than minimumunsigned short is greater than maximumu#;array item must be unicode characterarray item must be unicode charactersigned char is less than minimumsigned char is greater than maximumtostring() is deprecated. Use tobytes() instead./builddir/build/BUILD/Python-3.8.17/Modules/arraymodule.ccan only append array (not "%.200s") to arrayunsigned int is greater than maximumcannot resize an array that is exporting buffersfromunicode() may only be called on unicode type arraysfromstring() is deprecated. Use frombytes() instead.a bytes-like object is requiredbytes length not a multiple of item sizetounicode() may only be called on unicode type arraysarray.index(x): x not in arrayarray indices must be integerscan only extend with array of same kindcan only extend array with array (not "%.200s")array assignment index out of rangecan only assign array (not "%.200s") to array sliceattempt to assign array of size %zd to extended slice of size %zd__reduce_ex__ argument should be an integerinteger argument expected, got floatread() didn't return enough byteslist changed size during iterationarray.remove(x): x not in arraycannot use a str to initialize an array with typecode '%c'cannot use a unicode array to initialize an array with typecode '%c'bad typecode (must be b, B, u, h, H, i, I, l, L, q, Q, f or d)first argument must be a type object, not %.200s%.200s is not a subtype of %.200sthird argument must be a valid machine format code.fourth argument should be bytes, not %.200sstring length not a multiple of item sizesecond argument must be a valid type codethe typecode character used to create the arraythe size, in bytes, of one array itemf���Y������M���@���s���N���A������5���(���[���"���7�������*��� ���'���@���@���@���@���@�����������@���@���x���@���@���@���@���x���@���@���@���@���@���@���@���@���@���@���@���@���@���@���@���@������@�������@�������@���ڻ������@���@���غ��@���@���@���@���غ��@���@���@���0���W���p���p���p���p���p���&���ٺ��p���p�������p���p���p���p�������p���p���p���p���p���p���p���p���p���p���p���p���p���p���p���p���L���p���޺��p���+���p���
�������p���p������p���p���p���p������p���p���p���`��������������������������q����������q����������������������������������������������������y�����������������������������T�T�����a�a�����__sizeof__($self, /)
--

Size of the array in memory, in bytes.tounicode($self, /)
--

Extends this array with data from the unicode string ustr.

Convert the array to a unicode string.  The array must be a unicode type array;
otherwise a ValueError is raised.  Use array.tobytes().decode() to obtain a
unicode string from an array of some other type.tobytes($self, /)
--

Convert the array to an array of machine values and return the bytes representation.tostring($self, /)
--

Convert the array to an array of machine values and return the bytes representation.

This method is deprecated. Use tobytes instead.tolist($self, /)
--

Convert array to an ordinary list with the same items.tofile($self, f, /)
--

Write all items (as machine values) to the file object f.reverse($self, /)
--

Reverse the order of the items in the array.remove($self, v, /)
--

Remove the first occurrence of v in the array.__reduce_ex__($self, value, /)
--

Return state information for pickling.pop($self, i=-1, /)
--

Return the i-th element and delete it from the array.

i defaults to -1.insert($self, i, v, /)
--

Insert a new item v into the array before position i.index($self, v, /)
--

Return index of first occurrence of v in the array.fromunicode($self, ustr, /)
--

Extends this array with data from the unicode string ustr.

The array must be a unicode type array; otherwise a ValueError is raised.
Use array.frombytes(ustr.encode(...)) to append Unicode data to an array of
some other type.frombytes($self, buffer, /)
--

Appends items from the string, interpreting it as an array of machine values, as if it had been read from a file using the fromfile() method).fromstring($self, buffer, /)
--

Appends items from the string, interpreting it as an array of machine values, as if it had been read from a file using the fromfile() method).

This method is deprecated. Use frombytes instead.fromlist($self, list, /)
--

Append items to array from list.fromfile($self, f, n, /)
--

Read n objects from the file object f and append them to the end of the array.extend($self, bb, /)
--

Append items to the end of the array.__deepcopy__($self, unused, /)
--

Return a copy of the array.count($self, v, /)
--

Return number of occurrences of v in the array.__copy__($self, /)
--

Return a copy of the array.byteswap($self, /)
--

Byteswap all items of the array.

If the items in the array are not 1, 2, 4, or 8 bytes in size, RuntimeError is
raised.buffer_info($self, /)
--

Return a tuple (address, length) giving the current memory address and the length in items of the buffer used to hold array's contents.

The length should be multiplied by the itemsize attribute to calculate
the buffer length in bytes.append($self, v, /)
--

Append new value v to the end of the array.array(typecode [, initializer]) -> array

Return a new array whose items are restricted by typecode, and
initialized from the optional initializer value, which must be a list,
string or iterable over elements of the appropriate type.

Arrays represent basic values and behave very much like lists, except
the type of objects stored in them is constrained. The type is specified
at object creation time by using a type code, which is a single character.
The following type codes are defined:

    Type code   C Type             Minimum size in bytes
    'b'         signed integer     1
    'B'         unsigned integer   1
    'u'         Unicode character  2 (see note)
    'h'         signed integer     2
    'H'         unsigned integer   2
    'i'         signed integer     2
    'I'         unsigned integer   2
    'l'         signed integer     4
    'L'         unsigned integer   4
    'q'         signed integer     8 (see note)
    'Q'         unsigned integer   8 (see note)
    'f'         floating point     4
    'd'         floating point     8

NOTE: The 'u' typecode corresponds to Python's unicode character. On
narrow builds this is 2-bytes on wide builds this is 4-bytes.

NOTE: The 'q' and 'Q' type codes are only available if the platform
C compiler used to build Python supports 'long long', or, on Windows,
'__int64'.

Methods:

append() -- append a new item to the end of the array
buffer_info() -- return information giving the current memory info
byteswap() -- byteswap all the items of the array
count() -- return number of occurrences of an object
extend() -- extend array by appending multiple elements from an iterable
fromfile() -- read items from a file object
fromlist() -- append items from the list
frombytes() -- append items from the string
index() -- return index of first occurrence of an object
insert() -- insert a new item into the array at a provided position
pop() -- remove and return item (default last)
remove() -- remove first occurrence of an object
reverse() -- reverse the order of the items in the array
tofile() -- write all items to a file object
tolist() -- return the array converted to an ordinary list
tobytes() -- return the array converted to a string

Attributes:

typecode -- the typecode character used to create the array
itemsize -- the length in bytes of one array item
__setstate__($self, state, /)
--

Set state information for unpickling.__reduce__($self, /)
--

Return state information for pickling._array_reconstructor($module, arraytype, typecode, mformat_code, items,
                     /)
--

Internal. Used for pickling support.This module defines an object type which can efficiently represent
an array of basic values: characters, integers, floating point
numbers.  Arrays are sequence types and behave very much like lists,
except that the type of objects stored in them is constrained.
���������?C;T��U��p�Z����_���`���	`��
M`���
k`���`��|�`����`��xa���$a���
pa���
�a�� <b��`gb����b��X�b����b��c���/c��<@c��_c���dc���c��h�c����c��,d���ed��me����e���e��d�f����f��``g���h���ih����i��@(j���\j��L�m����n����o���(p����p���q���r��(xs��<ht��Pxt��d�t��x�t���u����u���v��xv��<�v��hhw����w����w���x���hy�� �y��8hz��d{����{����{���|���(|���8|��X|�� x|��4�|��H�|��\�|��p�|���}���(}���x}���	�}���	~��,
8~�� �~���h���(���
x���D
(����
؄���
����4�����x���D�������d(��������4����H����\X���p���������X���|H����h���@(����h���8�����(���(����xH����X���t���H����h���@����X��������T�����������(��	���P	(��d	����	���H
����
�����$
H��t��l�������0����x������ ������8��`zRx�$Q��0FJw�?:*3$"DV�� \ i���p�i�����j����4k�����k�����l����xm����4n����o��	o��	$o��(8o��pE�G�N0E
AAA(dXo��sE�G�N0H
AAA(��o��nE�G�N0C
AAA(��o��nE�G�N0C
AAA(�4p��oE�G�N0D
AAA(xp��qE�G�N0F
AAA(@�p��lE�G�N0E
AAAlq���q���(q��IH �
G����DY�@r��1WY(�hr���E�G�N0P
AAA(�r���E�G�N@T
AAA(<ps���E�G�N0Q
AACht��|t���t���(t���$t���0t���<t���Ht��Tt��`t��0lt��Dx��Xdt��l`t��AE�{zRx�� �V��)@����F�B�B �A(�A0�G��
0A(A BBBA����!���]L�L�yV��
C
AAH�s��5E�`
Id�s��KBH(|���
E�A�N@�
AAAzRx�@�� �U��B��s��,E�U
ED�H��F�B�B �B(�A0�A8�DP�8A0A(B BBB zRx�P������(�U��$t���YE�I�D0DAAzRx�0�� WU��A8�s���F�E�D �C(�D@M
(A ABBAzRx�@����$(U��d<0s���F�B�B �I(�D0�D8�GP�
8A0A(B BBBG
8A0A(B BBBAl�T��-H�Tv���B�B�A �A(�D0�
(D ABBLS(D ABBzRx�0���� $aT��:W
(A ABBE(Hd���F�A�D �m
ABAzRx� ���$+T��	AAB�v��EE�i
EM����@A�`
EY8�,v���F�H�D �D(�D0n
(A ABBA,�S��L8@	�v���F�H�D �D(�D0n
(A ABBA|�S��L8�	�v���F�B�G �A(�G0y
(A ABBA��S���(�	|w���B�A�D �n
ABH��S��+8 
����F�B�A �N(�DP�
(A ABBAzRx�P����$�S��L�
�w���F�B�B �A(�A0��
(A BBBAN
(A BBBE zRx�0�����($S��D����F�G�B �D(�A0�G�W
0A(A BBBA zRx�������(�R��r����AVzRx��R��Y����(�,w��oE�K�D F
DAAzRx� �� �R��8LP��|F�B�E �A(�C0�`(D BBB����	H��v��F�B�B �B(�A0�A8�DP�
8D0A(B BBBL$��Q��D8C0A(B BBBX
�w��"F�B�B �A(�A0�D@�
0C(A BBBLD
0D(A BBBQHl
`x���B�B�A �D(�D0m
(D ABBMg(D ABB�,Q���
`��	�
�x����
Hy���$z����z��50�P��HD�z���F�B�B �B(�A0�A8�Jp�
8A0A(B BBBL zRx�p������(TP��8H�d}���B�B�B �B(�A0�A8�Jp_
8A0A(B BBBC�,P��PL(����B�B�A �D(�G0�
(A ABBAN
(G ABBExP��
�`��� EV
AC(����iE�D�D l
AAA��O��H� ����F�B�B �E(�D0�A8�Gp{
8A0A(B BBBP�lO��ePL����9F�B�E �D(�A0�D`
0A(A BBBNyhKpfhB` zRx�`�����(EO��}hFpfhA`L�(���7F�B�B �A(�D0��
(D BBBMs
(E EIDEX�O��LH���wF�K�B �B(�A0�A8�J�1
8A0A(B BBBA$zRx��������,jO��r8�����fF�B�D �A(�G0�
(D ABBA
�O���H$����F�B�B �B(�A0�A8�D@�
8A0A(B BBBA zRx�@������(�O��(`�D���
F�B�E �H(�A0�A8�D@[
8D0A(B BBBAz8A0A(B BBB�aO���, ܑ���B�G�A ��
ABA�
�O���,d(���SF�D�D ��
ABA$*P��O@�D���F�B�B �A(�A0�D@�
0A(A BBBA� ���@\ZHH���U
F�B�B �B(�A0�D8�G`n
8A0A(B BBBP zRx�`������(�O��}`�$����B�B�B �B(�A0�A8�D@x
8J0A(B BBBB�
8A0A(B BBBA��P��B0\����F�D�D �D0z
 AABAzRx�0���$xP��4hD���'EaL�����F�B�B �B(�A0�D8�D�
8A0A(B BBBA$zRx��������,P��s�GNU�P��� b�X�VpI �BpXS@J"�u�XV K$�hPX�R�K&�H0X@U�L(�iXR�f*�I�Wp`�M,�l�W�Q@N.�L�W�_O0�q�W0Q h2�Q`W_0g4�f�S�P6�dpS@P
�Ufv�0
�� � ���o`��
��� �H)8	���o���o����o�o����o��� 01@1P1`1p1�1�1�1�1�1�1�1�122 202@2P2`2p2�2�2�2�2�2�2�2�233 303@3P3`3p3�3�3�3�3�3�3�3�344 404@4P4`4p4�4�4�4�4�4�4�4�455 505@5P5`5p5�5�5�5�5�5�5�5�566 606@6D�����M��WȾV��� �]�@��i�`�`�r�� �y��c��{��������o@�g�������0���,�����]�@}���������d@��P���������`����x����������@���0���¶ ���ɶ����Ҷ�h`�ڶ�� �����P0ipP���U��Y0�@b�SP��^ ����X�� �	� ��`�����!�!����	�8�(�Y@ PPY !��@Y|�!�!!��`Z0c�!!@�GA$3a1�0�array.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debugEf�x�7zXZ�ִF!t/��$w#]?�E�h=��ڊ�2N�$�ژ����nim�&M4�������S�NA�/�#��� �"�'��j1�k��������el�H)��F��Ou��7�M��t0��>�)h;��@��Y?s�[71��.
�~[��?�9�|r ��§�0��}������T66�0��2J*�o��r'�jh(,��VI�&�~�x%�����fʸ;�ev`��#u7�EI�.��������=�ոb�=��~;O�w�!��C����@��4��i_��������J�9�_���~)��|�S���>������ �>���I��l���P�4���**�ڕJ4���F"
";sd��[�q.k��nߓ3��]'��[���e�:Gqᦄ�yެwc�a=+���h�ϧ�V5:�i�L,J��u��X�\��,��t���/�j�T%!V|$FI�-;����N�����j&�#�&R�0Z��n�7yUT�IJ��7�J��G���!X�|�uj�[�*�v��9�G>59�/`���E�B7�f�{�m�GL9Z��<�^dZE)�HY�1p�s[��t*�)G�KB�k����ºt��-�ˁ�x�������&��y\۔�qo����IjA����C[i" �F�Y�8e&E�E��x�����p`�3�����ҟ^�2�����2���Rp�(RڮNt��O���p6�1r$���г6����HZ��h�o�1��i�=�����ٌ_/���)�-��q�^9�RPh��t=�
i-���c�!Ӹ��ޠ�@Xzu�LO�f�ml�~	���,����/��fh�
� �]`�L@c���l��l�
�/��o�;�}@p�Q����t�y��y?g#C����%{w��~���p�J��޲y�.���=7q=l�Nj�ZT������,�%�߈�\	3�ry�mQ��wy#���3[�<��ñZ���t�Z��ҝ�Y
�C��dE��U��y��.�_�#�0�{@�?$���b��
ԕ����1�x
t���[���}����u2n��n�Ť�P�[�UY<��F������>�b�+�8����*�p�c��>O}z��6�3�7y(�������$L�ax�&���Ot��m�u3�CCSG���
�q���e%��
�aeu�J���mCtf}��c/��s�3D���A��b*���<��G>�14m�5<�޶C:��n+�&���φE�[jg�"۔F"LR��bS��N ��M��}[����DxlU�e/�R�W�J}X����^���$}�+B��|�Z�+�޺@��+��ؼ�^��A�0�㎛_,հ�FxA!�pj��[FU���xɺ"�`a���|U������W?�bQ��(�XiO�"ib@�WNOٵ�Ì�#6-����(���cwB�F������:	ˎ�rX�5�rw�gj��K�W=
�k�)\_��l����9� ��Ni�M�B��ʹ�w۰0�M .B�|9
~_�Vd���qZ���|�g`��Ө���~2W�_i�P�\�!uq8�~{d��eЀHzP��g.��\WI�5o��Q���U�����>+�jqS<�
H��FHh��d)��lu��#��T��F����l(۩n{L��F�����P����SgХU�������{vH��rYJ>-T�mrw��Y&i ��3��Ҝ�W!�U�Th[Ԝ��Ћ���إ�=h���A
a�*_�g3���p3Vԍ���(�Еx揠j��J^�Z,���Y�dc���
�!v��vqY�cF�j����; U�j��O��؀#JAQ�Wm�j��T:6{ˆGnF.'�o���K���!���1IL� �V4?���N��c��Co�ٕ�&��o1�
��nB�?���1Z˻���A}�k;��a
��,q�6c�惚S,��z�j�L$�:6F��	�5B@֙���q��s0��
�:b��V
�6��}��U����	H��$�Օ%�ɣ)���&��������$+��H�ru��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(��P
0���8���o���E���o��PT8^BH)H)�h�0�0c 1 10nP6P6 wp;p;px}��
����' �����T����� ��� �� ��� ��� �� ��� ����� ��H�!@	 �@	!@	�P	a@	$
d	\�	d$(lib-dynload/_multiprocessing.cpython-38-x86_64-linux-gnu.so000075500000051000151153537510017473 0ustar00ELF>p@�J@8	@X,X, @<@< @< �� X<X< X< 888$$8,8,8,  S�td8,8,8,  P�td0)0)0)��Q�tdR�td@<@< @< ��GNUdI�!���O�B>F:�c�1-�1�@ A��135��|CE���n!�qX�ܚ�虷&S6!E��X� �H���� �, F"q�\.N�3��� ���i��}m���T�I�E uE �Y a|E @B ���$6�#r__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6_Py_NoneStructPyLong_FromLong_PyArg_ParseTuple_SizeTPyMem_MallocPyErr_NoMemorystrcpysem_openPyMem_FreePyExc_OSErrorPyErr_SetFromErrno_PyObject_New__stack_chk_failPyThread_get_thread_identPyBool_FromLongPyExc_AssertionErrorPyErr_SetStringsem_getvaluePyExc_ValueErrorsem_post_PyArg_ParseTupleAndKeywords_SizeT_Py_TrueStructPyFloat_AsDoublePyErr_Occurredgettimeofdaysem_trywait__errno_locationPyErr_CheckSignalsPyEval_SaveThreadsem_waitsem_timedwaitPyEval_RestoreThread_Py_FalseStructsem_closePyObject_Free_PyMp_SetErrorPyExc_RuntimeErrorPyErr_Format_PyMp_sem_unlinkPyInit__multiprocessingPyModule_Create2_PyMp_SemLockTypePyType_ReadyPyDict_SetItemStringPyModule_AddObjectPyDict_New_Py_BuildValue_SizeT_Py_Dealloc_edata__bss_start_endGLIBC_2.4GLIBC_2.2.5v0ii
�ui	�fui	�@< �$H< �$P< P< @ �& @ |&(@ \&H@ |&P@ �&p@ |&x@ �&�@ |&�@ �&�@ ��@ �&A �&A �A �& A �&(A �8A �&@A 'HA �XA '`A 5'hA �xA 0(�A <'�A ��A p(�A E'�A �"�A �(�A P'�A E"�A �(�A Y'�A ��A |&B b'B pB �(XB n'pB 1 �B �'(C �@ 0C @ xC � �C �'�C �'D \&D J'D �&D �& D �'hD �'�D �D �D �'�D |&�? �? �? �? 	�? �? �? �? 5�? �? �? �? !�D 7p> x> �> �> �> �> 
�> �> �> 
�> �> �> �> �> �> �> �> �> ? ? ? ?  ?  (? "0? #8? $@? %H? &P? 'X? (`? )h? *p? +x? ,�? -�? .�? /�? 0��H��H�)) H��t��H����5�' �%�' ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%��������%U% D���%M% D���%E% D���%=% D���%5% D���%-% D���%%% D���%% D���%% D���%
% D���%% D���%�$ D���%�$ D���%�$ D���%�$ D���%�$ D���%�$ D���%�$ D���%�$ D���%�$ D���%�$ D���%�$ D���%�$ D���%�$ D���%�$ D���%�$ D���%�$ D���%}$ D���%u$ D���%m$ D���%e$ D���%]$ D���%U$ D���%M$ D���%E$ D���%=$ D���%5$ D���%-$ D��H�}$ �G H����Hc ������AVAUATUH��H��H�5}
SH�� dH�%(H�D$1�H�T$H�L$I��L�L$�����1�����H�\$H��t0H��H���H��H���/���H��H��u����}H�t$H�����H�|$H��t,1�1��P���H�D$H��uH������H�W# H�8�����:H��D�$$D�l$L�t$�W���H��tL�pD�h(�@ H�@D�`$H�X0H�t$dH34%(t����H�� []A\A]A^���� ~SH���^���H9C[����Hc����1�Hc������SH��H��dH�%(H�D$1��(uG� H�=�" H�5�
H�?���1�����H9Cu؋K ��~FH��" �ɉK H��`H�H�t$�����x0�D$9C$H�>" H�5�
H�:���1��+H�{�
�����yH�5" H�>����
H�V" �K H�H�T$dH3%(t���H��[���AWW�H�

& AVAUATUH��H��H��SH�BH��XL�%" dH�%(H�D$H1�L�L$L�D$�D$L�d$)D$0�����uE1����}(u$�} ~����H9EuL�-�! �E I�E�H�|$L9�������D$�e���I��H��u��T$W�f/�vf(�1�H�|$ �T$����\$��yL�
�  I�9�_����D�H,˾ʚ;HiT$(��H*�HL$ �\��Y1
�X1
�H,�H�H�H��H�H�T$8H�D$0H�}������?����ً8��I�Ń��� �t�F�����tӿ���A�}������uc�|$t\L�t$0����L9d$H�}I��u	������
L�������L���~���A�}�����t��y��u������t�����y8A�}��t��nu
L�-  I�E�4���L���L�� I�8�2���I����E �%���L�-� H�EI�EH�L$HdH3%(L��t�N���H��X[]A\A]A^A_���SH��H�H��t���H�{0����H��[�w�����Q�����t��
�����tD�*�����t���uH��u
H� H�8���������H�
K H�5�1�H�9����1�Z���AVAUATUSH��H��H��H��(dH�%(H�D$ 1�H�D$P1�H�T$ RH�QH�L$ QH�
�" L�L$$L�D$,���H�� ��t�|$vL�~ H�5I�8����1����<$u<H�|$1�H���H��H������H��H��u
�5���H���H�t$H��� ����1�L$H�|$��1������I��H��tW�<$u;H��D�l$D�t$����H��H��t/L�`D�p(�@ H�@D�h$H�h0�9H�|$�_�����y�L������H���K�������H��H���#�����1��9���H�T$dH3%(H��t�8���H�� []A\A]A^���H��H�dH�%(H�D$1�H�t$�����y��1�����1��|$@�����H�T$dH3%(t����H�����H��H�dH�%(H�D$1�H�t$�%�����y��1������|$y�D$Hc|$���H�T$dH3%(t�g���H�����H��H��H�5tdH�%(H�D$1�H���(���1҅�t%H�<$�	�����y��1�����1��
H�� H�H�L$dH3%(H��t���H���H�+uH���2���I�,$to1��rL�������KH�+uH���	���I�,$u�L��1�����AH�+u�H��1�����,L�������H�+u�H��1�����
L��1�����f.�H�=�  H��  H9�tH�� H��t	�����H�=�  H�5�  H)�H��H��H��?H�H�tH�M H��t��fD�����=e  u+UH�=* H��tH�=� �9����d����=  ]������w������AT��H�=N US���H�������H�� H��H���,���y���H��������H���b���H��H��H�5���H��H�5,H��������H��H���)����H�=�1����I��H���d���H��H�5�H���������I�,$�2����H�=�1��}���I��H�������H��H�5�H���?�������I�,$�����H��H�5�H���
�������H��[]A\���H��H���kiiz|iOunknown error number %diiisiunrecognized kindSEM_VALUE_MAXHAVE_SEM_OPENHAVE_SEM_TIMEDWAITflagshandlemaxvaluenameacquireacquire the semaphore/lockreleaserelease the semaphore/lock__enter__enter the semaphore/lock__exit__exit the semaphore/lock_count_is_mine_get_value_is_zero_rebuild_after_fork_multiprocessing.SemLockSemaphore/Mutex typeblocktimeoutsem_unlink_multiprocessingattempt to release recursive lock not owned by threadsemaphore or lock released too many timesnum of `acquire()`s minus num of `release()`s for this processwhether the lock is owned by this threadget the value of the semaphorereturns whether semaphore has value zerorezero the net acquisition count after fork()e��A�?;�p�����@��V�c��P��l������)�����������\u���t����P���������zRx�$��pFJw�?:*3$"D�`\P�pR�
<�K�F�B�B �A(�N0�DP�0A(A BBB�'�0K�M��;��E�G �AH��nF�L�B �B(�A0�J8�K�78A0A(B BBBL!���(E�^h-���aE[L�v����F�B�B �A(�A0�MXV`HhMpZP$0A(A BBB�����`H W�����iH `J���rH i(���6F�M�A �ABzRx� ���$X����GNU��$�$P< Ufv�
&@< H< ���o`��
�X> ��H�	���o���o����o�o����o:X< ����� 0@P`p�������� 0@P`p���������&|&\&(|&�&$|&�&0|&�&��&�&��&�&��&'�'5'�0(<'�p(E'�"�(P'E"�(Y'�|&b'p�(n'81 �'�@ @ � �'�'\&J'�&�&�'�'���������D �'|&GA$3a1�%&_multiprocessing.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug�÷:�7zXZ�ִF!t/��7�]?�E�h=��ڊ�2N�$V����t�1T.8�+�.z��,>�=C0�}�ӹ�ee#�A�E���q�d�F42Zx�zk
k
�fpQ8��ml��-MX��#9+�jv錣���m�D
E�]���������S���ǤG�k,ƯYRQ�ܛ~%����|�4f�����.U-�گp^S+0��N߸�c��ΚR�����D�(��:h9�@�ϴ���q��
n�Ԩ~%$��Fj
p�~1[-	$��*c�N�ϊ����NT�O�v�+�g;���]���^�z7��)�j1Qj��:�ER���~�^ht�	{n�-9�D젘vޯA�=p�Ij
>ƅ
r\~Nsv���O.��s!�fu>�ܚ������8��&9Dj� X�M2�}�5ʻ�3�,��G�{G�������6���k(P�+����:O	Dt���\a#�l�UAi˴�Ā�L:HsKA���7|��94��,+�}pO�m2��a�Q�'@�h ��U�`��q��y�eYC<D��J}{�e=��	�#E?X���HN8@,l���d��OS��[9�·w��0�6���uCJ�tFM�8�=t�[�u+b�s'��W1�C��b�+�E��Z�]|�m��Z^@��
-{^rB�tӳ��wBȟ��Q鮂s�r�A���CO.?[Z��2��=��Z���>�]W}�c�@�g�`UB��O��D�Rχ�\��z�V�+�uQ����;[�>A?��_��ePI�E\�����R�~�_�ȘQ���+��5��i7md>��f\��m�zo6ԙ�E�D�Y��	�s|�ʹ�I�_K=7S��6�tԷ��n�^�s���&6��"��ƨ�U�N��Tq�����_��䆃aDD_�g*��'��V���',��`҄�m�
;P��w
I;�7w�&jY��ϩ��wX!U���D�!�#>,E���� b����g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``@(��@0���8���o��pE���o��PTHH�^B���h��c��pn`wpp�
}&&
�(&(&�0)0)���)�)x�8,8, �@< @<�H< H<�P< P<�X< X<�X> X>��@ @ �E E�E`E$
$Eh�E�I(lib-dynload/_decimal.cpython-38-x86_64-linux-gnu.so000075500001142410151153537510015651 0ustar00ELF>�j@Ƚ@8	@ll �x�x$�x$�*�+ zz$z$888$$�k�k�k  S�td�k�k�k  P�td�����Q�tdR�td�x�x$�x$ppGNUa�Ru�R�0�t�`{�OP}�@ ��}���|CE���qX�G~�U�Y?���l������ (�t�4a����8�3���r� ����h}�, �?�F"����k�	�U'[��P"��`��#�[G����~��|�+
hOA��MD�,���@�.q�m
�K���:��dh�$Q`�$X`�$��o	__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libm.so.6libpthread.so.0libc.so.6PyTuple_Type_Py_NoneStructPyObject_CallObjectPyExc_KeyErrorPyErr_SetString_PyObject_NewPyUnicode_FromFormat__stack_chk_failPyLong_FromLongPyList_AsTuplePyUnicode_NewmemcpyPyObject_Free_Py_DeallocPyLong_AsSsize_tPyExc_ValueErrorPyErr_OccurredPyTuple_SizePyLong_AsLongPyMem_Mallocsnprintf__snprintf_chkPyUnicode_CompareWithASCIIString__strcat_chkPyMem_FreePyExc_RuntimeErrorPyErr_NoMemoryPyObject_GenericGetAttrPyContextVar_SetPyType_IsSubtypePyExc_TypeErrorPyContextVar_GetPyArg_ParseTupleAndKeywordsPyDict_New_Py_FalseStructPyDict_SetItem_Py_TrueStructPyList_NewPyList_AppendPyErr_SetObjectPyObject_IsTruePyDict_SizePyDict_GetItemWithError_Py_NotImplementedStructPyErr_ClearPyUnicode_ComparembstowcsPyUnicode_FromWideCharPyUnicode_AsUTF8StringstrcmpPyErr_FormatPyLong_FromSsize_tmemsetstderr__fprintf_chkfputcabortPyUnicode_FromString__memcpy_chkPyObject_GenericSetAttrPyExc_AttributeError_Py_ascii_whitespace_PyUnicode_IsWhitespace_PyUnicode_ToDecimalDigit_PyUnicode_ReadyPy_BuildValuePyList_SizePyList_GetItem__ctype_b_loc__errno_locationstrtollPyArg_ParseTuplePyFloat_FromStringPyFloat_AsDoublePyComplex_FromDoublesPyUnicode_AsUTF8AndSizePyUnicode_DecodeUTF8memmove__ctype_tolower_locPyDict_GetItemStringlocaleconvPyLong_FromUnsignedLongPyTuple_NewPyObject_CallFunctionObjArgs_PyLong_NewPyExc_OverflowError_PyLong_GCDPyTuple_PackceilPyFloat_TypePyBool_FromLongPyComplex_TypePyObject_IsInstancePyObject_GetAttrStringPyComplex_AsCComplexPyFloat_FromDoublePyInit__decimalPyMem_ReallocPyLong_TypePyBaseObject_TypePyType_ReadyPyDict_SetItemStringPyImport_ImportModulePyObject_CallMethodPyType_TypePyObject_CallFunctionPyModule_Create2PyModule_AddObjectPyExc_ArithmeticErrorPyErr_NewExceptionPyExc_ZeroDivisionErrorPyContextVar_NewPyUnicode_InternFromStringPyModule_AddStringConstantPyModule_AddIntConstantfreerealloccallocmallocPyObject_HashNotImplementedPyType_GenericNew_edata__bss_start_endGLIBC_2.2.5GLIBC_2.14GLIBC_2.4GLIBC_2.3GLIBC_2.3.4p ui	if ui	i����uii
�ii
�ti	�ui	i�x$���x$p��x$�x$�x$��(y$�$hy$��$�y$�$�y$���y$���y$���y$†�y$Ά�y$܆�y$��y$��z$�X�$����$�j��$�$�$���$�(�$��$h�$����$K��$`�Ȃ$@�$��$f���$`2؃$ �$ �$��$�w�$�0�$��H�$p�h�$@�$x�$��$��$��8�$	�P�$@�x�$���$P���$�"Ѕ$��$@�$�$ �$H�$�BX�$����$�Ȇ$`��$���$0$�$�� �$�(�$P�0�$�#H�$�P�$`�X�$�#p�$"�x�$p���$����$'���$����$p���$0�ȇ$��Ї$��$9��$����$0#@�$?�H�$��`�$I�h�$����$R���$P�Ȉ$W�Ј$�� �$��(�$@�0�$�t8�$Y@�$�TH�$p�P�$��X�$@�`�$��h�$�F��$01��$p�$�W�$`m@�$\�H�$�cX�$��`�$`�h�$�nx�$���$c���$�k��$@���$i���$`���$`���$t�Ȋ$�؊$���$~��$��$��$���$�$@� �$��(�$�C8�$��@�$��H�$X�$��`�$��h�$�_x�$����$����$�A��$����$Ň��$@@��$`���$�ȋ$�>؋$���$ԇ�$=��$ ��$#��$`;�$�� �$܇(�$�98�$��@�$�H�$@8X�$��`�$�h�$�x�$����$����$^��$���$���$�`��$ ���$�Ȍ$�،$`��$��$���$��$#��$��$`� �$/�(�$��8�$�@�$6�H�$��X�$��`�$>�h�$��x�$ ���$F���$0���$����$P���$�I��$���$X�ȍ$��؍$��$b��$���$ ��$o��$`��$�� �$�(�$��8�$�@�$x�H�$0�X�$��`�$��h�$ �x�$���$����$0���$ ���$����$����$`���$��Ȏ$p؎$ ��$���$����$���$���$���$@� �$��(�$G8�$��@�$̈H�$�6X�$��`�$ڈh�$ 5x�$����$���$�3��$����$����$02��$`���$�ȏ$�0؏$��$��$�.��$`��$��$`-�$� �$&�(�$�+8�$��@�$-�H�$ *X�$��`�$4�h�$�(x�$����$O���$���$����$:���$�I��$ ���$J�Ȑ$�1ؐ$��$C��$@��$L��$@� �$Y�(�$�@�$d�H�$ H`�$o�h�$�L��$y���$�L��$����$PL��$��ȑ$�0�$���$pH�$���$��@�$��H�$�'X�$@�`�$\�h�$�bx�$���$`���$�m��$����$c���$0k��$`���$n�Ȓ$�&ؒ$���$i��$&��$���$t��$@%�$ � �$~�(�$�#8�$��@�$y�H�$�$X�$@�`�$��h�$PEx�$����$����$F��$`���$����$PE��$ ���$��ȓ$]ؓ$���$���$���$���$���$���$@� �$Ň(�$P�8�$��@�$��H�$ lX�$��`�$��h�$0Lx�$@���$É��$@V��$����$���$�"��$����$ԇȔ$`!ؔ$ ��$#��$0 ��$���$܇�$�$`� �$ʉ(�$p|8�$ �@�$�H�$�X�$��`�$�h�$�x�$`���$Ӊ��$O��$����$����$0V��$���$݉ȕ$��ؕ$���$��$`���$ ��$��$�p�$�� �$�(�$P�8�$ �@�$�H�$p�X�$`�`�$��h�$p�x�$ ���$���$@��$����$���$��$`���$#�Ȗ$�ؖ$��$/��$��$���$X��$0�$@� �$6�(�$�8�$��@�$F�H�$�X�$��`�$>�h�$px�$ ���$b���$���$����$P���$���$`���$��ȗ$`�$��$����$ ��$���$��$�� �$��(�$@8�$��@�$��H�$�X�$ �`�$��h�$�x�$����$����$��$����$����$p��$ ���$�Ș$�ؘ$���$���$�H��$`��$̈�$���$� �$ڈ(�$ �8�$��@�$�H�$ X�$@�`�$�h�$��x�$���$���$���$����$���$���$����$&�ș$�ؙ$ ��$���$��$���$-��$`�$`� �$4�(�$0
8�$�@�$�H�$ �X�$��`�$%�h�$��x�$����$C���$@���$d���$�2��$�Ț$@�ؚ$ ��$1��$���$`��$@��$ m�$��@�$Z�H�$0�X�$ �`�$e�h�$��x�$����$p���$@���$����$}�Л$���$���$��H�$8�P�$`�`�$@�$��$����$l���$����$l�М$��؜$l��$����$l��$���$l�0�$��8�$l�P�$��X�$l�p�$��x�$l���$����$����$l���$��ȝ$l��$���$l��$���$l� �$��(�$l�@�$��H�$l�`�$��h�$l���$����$l���$����$l���$��Ȟ$l��$���$l��$\��$'��$l� �$
�(�$2�0�$Ɗ@�$�H�$'�P�$"�X�$�`�$0�h�$9�p�$�x�$+���$'���$l���$'���$l�П$��؟$l��$l��$l��$l� �$l�0�$l�@�$l�P�$l�`�$l�p�$l���$Պ��$͊��$���$���$�Ƞ$���$"��$��$<��$4�@�$b�P�$l�`�$l�p�$l���$l���$���$Պ��$����$Պ��$Պȡ$ՊС$�ء$Պ�$Պ�$Պ�$~���$���$��$��$�� �$Պ(�$͊@�$~�H�$v�`�$��h�$����$����$����$����$����$�Ȣ$Nj�$��$ً�$��$� �$�(�$�� $
($0$8$@$H$P$X$!`$*h$-p$/x$4�$7�$:�$;�$<�$@�$B�$H�$K�$V�$X�$Y�$_�$m�$n�$x �$3(�$t0�$b8�$��$RЀ$Ep�$E�$Ex�$��$d`�$d0|$8|$@|$H|$P|$X|$`|$h|$	p|$x|$�|$
�|$�|$�|$�|$�|$�|$�|$�|$�|$�|$�|$�|$�|$ �|$"�|$#}$$}$%}$&}$' }$((}$)0}$+8}$,@}$.H}$0P}$1X}$2`}$5h}$6p}$8x}$9�}$:�}$=�}$>�}$?�}$A�}$C�}$D�}$E�}$F�}$G�}$I�}$J�}$L�}$M�}$N�}$O~$P~$Q~$S~$T ~$U(~$W0~$Z8~$[@~$\H~$]P~$^X~$``~$ah~$cp~$dx~$e�~$f�~$g�~$h�~$i�~$j�~$k�~$l�~$o�~$p�~$q�~$r�~$s�~$u�~$v�~$w�~$x$y$z${$|��H��H�Q $H��t��H����5*$�%+$��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&�������h'��q������h(��a������h)��Q������h*��A������h+��1������h,��!������h-��������h.��������h/������h0�������h1��������h2�������h3�������h4�������h5�������h6�������h7��q������h8��a������h9��Q������h:��A������h;��1������h<��!������h=��������h>��������h?������h@�������hA��������hB�������hC�������hD�������hE�������hF�������hG��q������hH��a������hI��Q������hJ��A������hK��1������hL��!������hM��������hN��������hO������hP�������hQ��������hR�������hS�������hT�������hU�������hV�������hW��q������hX��a������hY��Q������hZ��A������h[��1������h\��!������h]���������%E$D���%=$D���%5$D���%-$D���%%$D���%$D���%$D���%
$D���%$D���%�$D���%�$D���%�$D���%�$D���%�$D���%�$D���%�$D���%�$D���%�$D���%�$D���%�$D���%�$D���%�$D���%�$D���%�$D���%�$D���%}$D���%u$D���%m$D���%e$D���%]$D���%U$D���%M$D���%E$D���%=$D���%5$D���%-$D���%%$D���%$D���%$D���%
$D���%$D���%�$D���%�$D���%�$D���%�$D���%�$D���%�$D���%�$D���%�$D���%�$D���%�$D���%�$D���%�$D���%�$D���%�$D���%�$D���%�$D���%}$D���%u$D���%m$D���%e$D���%]$D���%U$D���%M$D���%E$D���%=$D���%5$D���%-$D���%%$D���%$D���%$D���%
$D���%$D���%�$D���%�$D���%�$D���%�$D���%�$D���%�$D���%�$D���%�$D���%�$D���%�$D���%�$D���%�$D���%�$D���%�$D���%�$D���%�$D���%}$D���%u$D���%m$D���%e$D���%]$D�����H��1�H�5GdH�%(H��$�1�H�
2H�&7$H�8t)L�OI��L�@E�D�PL�DPLE�H�� L�H����PH�=G1��t$H��$��t$P��$��t$X��$��t$`��$��t$h��$��t$p��$��t$xH��$�L��$�L�D$xH�T$pH��$���H��pH��$�dH3%(t����H�Ĩ�H�{H�Z{H�{H�Q{�u����YH�{HH��tH�/u�\���H�KH��[H��@��H�+t$1��;|H�+H�CHu�H��1��&����|H��1������|����H�‰�H����|��|H�����}\���H���e\�z\���H����[��[H� $H�5iH�:�A����2\�W���H�+��[H������|[H�+t1��\H��1��y����\1��g}H��H�D$�`���H�D$�}H9�6$�I}H9�6$�<}H9�6$�/}H��C}H�������h\H�������\1���}H������3]I�,$I�D$��]L��H�D$����H�D$�y]H�mt1��'^H�$�]H��1�����^H�
�$H�5�
H�9������~�4�����~L���w�����~I�,$��~L���_����~��N^H�1$�^H��$�^1��^1��o_H��$H�5�
1�H�8����R_H�f$H��H�5,H�81��r���1��_J��I��L9��Є@������„H�|I�H�H��L9�tH��c�H�M�QI��I9�t	M�Q�F�I�AI����H����#NJH�TI�H�H�{�H��tH�:�ƇH�
I�hL�M�H��t	M�H魇I�HI����M������7�H9�tDH��#NJH9�A��A��A��0I��D�L��L)�L�GH����H�L$��?�I�����.H��H���1��H�C(H���$1��j�1�駞E1�I��L9�t3J�4�H��t�A�
Ik�H��1�I��H���ʞI���ڞ1�點1�鴞�uL�OH�(J�|�tH)�H��I9�}�	@��I��#NJ1�L9���H�I��I)�L��H���TH9�H�H��H��
��H��I�<�uKH��H���u���H�H�D$�H�����H�H���Ǣ1��7�I�<�uH��H���u��!�1�뻸��I�V�I;�t�����M�v�H�|$�L�t$����1�邦SH��$A�l1�H�
�H���H�;��H�;�1�H��i�H�3�
����7�SH��$A�S1�H�
�H�j�H�;�,�H�;�1�H����H�3�
������I��Ƥ~�I9���Ѓ��H����#NJH9���Ѓ��H���rN	H9�wH�����H9���Ѓ�
ø�H���h���H�$�@`H�$�7`1��H���K���H�$�SaH�$�JaH�ؾ1�H��L��&H��H��1�I�4����1��H���H���H��èH��H��HD��H�$�cH������H�$�c1��H��H�t$8L��L��H�T$�����H�t$(H�$H�d$H�t$ H��H�L$H��H��H�4�H;$tM����M���X�1��<�M��I�ݻ��Ȭ����dH�
�$H�5t
H�9����1��neL��$H�5W
I�8���1��Qe�EH���eH�5�$H9w !���f��H�C��K�D	e錮H�(H�L$��D$�.e�|$H�C(uH�d$H�C ��L�c(�H;k ����f�H�C1�C�����A�M铮H�=�$H�5
H�?������~fH�=�$H�5
H�?�������f[]A\�����H����H���)��(����H������g���H���ï騯1�齰1�鶰�f����������W���C�<�H���L�A�~��A�<��t�A���#D��L�D$@�4$���4$L�D$�������,D��L�D$@�4$�A���L�D$�������0I���4$A�D$��?�@��u�U���~w%A�,$I��H��L9�tpA�,���_t���A�<�鱲��v\��L�D$@�4$�x�L�D$�4$��@��@������L�D$@�4$��L�D$���*���0I���4$A�D$���$�H�=
$�8@���M�����?�E1���A�>飱A�<��g�L�
$A�;�����1���E1��ѰA�$ I������A�$ I���8��3f�L�k(1�H�C���C��@�3A�$�H�+t��1��5fH�������H�+t��1��fH�������H9�HM�I9�t8�E tI9���fH��H���;��H��H���~����gI�M�fH�L$�~D$H�D$H��D$E��fL�SH�	$L�K M�ZI9�LL�M9�t
� tM9�.K��H�C�-�H��H��L������tL�SL�C(��H��H��L��薳��[� u
H�5�$H9w Bf�C��� t`H9����H�T$H���X�鄵I�|��Y�H���F�H�(H�L$��D$�a�|$H�C(u�H�
<$H�K �H�T$H���Q��-�I9���K�	E1�H��J��I��L9�w�H�T$H�t$H��I��H�L$0M��H��L�T$(�Q�H�|$(L�\$0H�/H�|$H��L��L�\$(E1��{H�T$H�t$(L�\$H��J��I��L9�w�H��H�T$H��M��M��L�\$��H�|$H��J�'H�|$ H��X[]A\A]A^A_�zL�L-E1�I��M9�vJ��I����H�T$H�t$H��I��H�L$0J��M��L�T$(肷L�\$0H�|$(�,���I�mt^1�齺L��H�D$�(�I�.H�D$���L��H�D$��H�D$銺I�.uL�����I�mu�L�����1��f�L�����1��W�H�T$H��H���w�鴺L�\$(L�L$XE1�L��K�t�I��L��K�t�L�ދL$$M��H�I�I9�u�L�\$XE1�L�D$`I��I�sJ�L��H9�tL�L�H��H��L�F�L�	H���L�D$`L\$hL9�u�E1�I��M��M�H�}L��I��H��L�EK�L�I�J�L�H��L�H)�H)�����H�I9�u�L�\$XM��1�M�I�|$L��L��H��H��M�$H)�O�D�I�H)��O�D���M��H�H9�u��g�����4���H�|$A���_$���A���L�L$L�$I��M��H�L$HH��L��L��M���uL�L$L�$�N�H�-�$A�\1�H�
�H���H�}�`�H�}�1�H���I�H�u�
�����A���+�L�
F$H�5�I�9�g�����H�
($H�5�H�9�I�����M��H��H��胦��L��1�H)�tI��1��0���!����������H�T$H������H�_H�W(H�|�t+�~$wA�N$H�5yLc4�I�>A��A�� E�U�	��~(H�GumL���(�A�M������u�1�蘤A�M@����u@L��L��H���`H�}H��H+}I�|$���7����U��H��H+H�G놺��7��H�t$L�L$H�T$D�$�m���uzA�H���(�A�L�-�H��I)�K�d�H��I�D6�I��1�I�t�H�A��A��L���A�H�����H��L�5�K�$�H��H�������L��L�d$H�|$P�D$ 0H��H�|$HL�D$H�D$@I�<$H�t$t@H9���L���L��L�D$0H�H��H��L��H��I����L�d$8L�d$ �H��L��L�d$ ���$H�,$�~$L�,$A��A��A��0$D�L$ )D$0H�D$0�1�L��L�l$8L�t$HH�D$(H��J�4�I�L6�H��H��t=����L��L�d$ L����輓L����D�t$ �A����A	�D�t$ 뉽��H�����������H��?H9�u��uH��������������H������D$M��M��H�T$H���I�څ���I�_���D$M��M��H�T$H����I����I�_L�E H��H9�$H��HM5�$L9�t�E tEL9�rL�](I�t�L�&�MH�]���A	�D�uL�.��H�T$H���c�H�}(�E�}�H�T$H��虢��u��D$P��t:����H�|$P�i$�t�H�T$H������L���D$E1���H�|$x�7$�D$P�H�T$�H��辡�H�T$H����H�}(�E���H��H�L$�H���D$�X�|$H�C(uL���#L�S D���H�����3�H�T$H���i��H�T$H��觡�y�I����]xEcI9���փ��d_I����#NJI9���փ��K_I�����I9���փ�
�2_�E t@H9���^H�$H�����5H�t$A�J��1�I��H��wPA��u�I���bH�$H�������`^H��([]A\A]A^A_�$ t(L9���bH�$H��腩�b�bH���RbH�$H��趠�kb�E tmH9���dL��H��L�D$�B�L�D$����dH��([]A\A]A^A_�I����]xEcI9�E�A��A����dI����#NJI9�E�A��A���dL��H��L�D$�.�L�D$�$ tGL9��`gL��H��迨�PgL�t$�O��L��1�H��H��w6��u�N��I����fL��H���џ�gH����fA��1d�gH�t$�N��L��1�I��H������u�N��I����k$ ��H9��lL��L�����lH����]xEcH9���Ѓ��KiI����#NJI9���Ѓ��2iA�$ t5H9���hL��L��L�D$辧L�D$����hH��([]A\A]A^A_�L��L��L�D$��L�D$��L��L���О�sk�<jH����nA�$ tQH9��(nH��L��H�L$�M�H�L$���nH��[]A\A]A^À� t0H9���nH��L�����nH��L��H�L$�U�H�L$�H��L���C��nH���V��FoM���~���E1����V�A�� E�u�
�@���uH�|$8��#�|$H��������@���sH�D$H����#H�D$�[H�D$H�|$8���#�D$H�D$uH�D$H����#H�D$H���^H���UH��SL��H��dH�%(H�D$1�L�D$�D$�e��D$	�AtH�ھH���ȜH�D$dH3%(t���H��[]�H�MH�u(H�|��@�H�mt1���uH���
��uH��1����uH�KH�s(H�|����kH�mt1��GvH������uH��1����+vL��L��H��訥�IwH�����xL��L��H��舥��yH���{��{{L��H��H��[]A\A]A^�`�H���n|1��|H���H��h}H�+t1��~H�+u�H��1��&��~H��1����~M��E tAL9��H�T$H��胤�6�H�E��H��?H�ML9�w4H���
H�T$H��蛛����H�T$�H�������G1��H�L$��D$��Q�|$H��H�C(uH��#H�C ��������H���A���~M�����I9���L;l$��t�M)�L��M�D�H)�L9��I
��L)��L)�I��H�t�I)�H9��N�L)�M��H�>I)�L9���L)�M��H�I)�L9����L)�I��L��L)�M9��P�1��
1��TL��L��H���I������I�t$I�|$(�L��L��H������L��H��H��������L��H��H��螢��pL���A�M ��L��H�߾[]A\A]A^�I�H��$����#�ҁH��$����#��$�鯁H�|$ �p�#�сH�|$x�`�#�D$P韁H�|$P�K�#闁H�|$H�;�#�D$ 鏁L��L����@�AXL��[L��]L��A\A]A^A_�2�A�E t1L9�EM�}(L��I��I�E�}�I�EH;E/I�]�L��L���Ϙ���PI�U�L��L���f����I�H����E�����t[H��L��]�A\A]A^��L�¾L�����I9���"�3.H���
"�-L;l$�3)��*H����"�-1�D��H���a��u%1��#I9��X%�C)L;l$�1 � -I��L�(g�]L��E1�����/H�+�W7H�������J7H�������=7E1��[/H���#H�5��E1�H�8�>���=/L�5�#H�5��I�>�#���6�9����6H�T$,�L�����T$,��.H9=�#H��M�V8HM5�#L9�tXA�F tYI��L9���1H�|$H�T$,L��蹟H�|$��tKM�^@I���b1L�l$,L9��)2L��L��苟�2I���<1H�|$H�T$,L��輖H�|$�M��L�t$�'.H�T$,�L���&��.K��I��M9�vQ@����3�3I�_M9�|*H9:�#H��M�~8HM5+�#L9�t$A�F t"I��L9�>K��I����.�b3I����H�T$,L��L�D$��L�D$��t"I��M�^@��H�T$,L��L�D$蟞L�D$��M��L�t$�Z-H�m���H��1�����髁H�|$H�/u����H�|$H�/�ȁ���邁H�m��H��1����阂H�|$H�/u���H�|$H�/����z���o�H�m�ЃH��1��`��酃H�|$H�/u�K��H�|$H�/����7���\�H�m���H��1�����r�H�|$H�/u���H�|$H�/��������I�H�m���H��1������_�H�|$H�/u����H�|$H�/�|�����6�H�m�g6H��1�����6H�|$H�/u���H�|$H�/�96�n����5H�|$H�/u�Y��H�|$H�/�B��E����H�+�.�H��1��,���H�|$H�/tH�<$H�/�?7�	���7�����H�|$H�/tH�|$H�/�/8�����7������1��F�H�|$H�/�������H�+��H��1�����نH�|$H�/������逇H�+���H��1��l���g�H�|$H�/�=��S����H�+�)�H��1��:���H�|$H�/�+��!����H�+��H��1������H�D$���H�D$�T�1��M�H�1�#H��C�H�!�#H��ӋH��#H��C�H���#H�鳌H�m�98H��1������7H�|$H�/u�~��H�|$H�/�8�j���7H�|$H�/tH�|$H�/�9�F����8�<����H�m�ՎH��1��%��銎H�|$H�/u���H�|$H�/�������a�H�m�H��1������w�H�|$H�/u����H�|$H�/�������N�H�m���H��1�����d�H�|$H�/u���H�|$H�/����v���;�H�m���H��1��\���Q�H�|$H�/u�G��H�|$H�/�n��3���(�H�m���H��1�����>�H�|$H�/u���H�|$H�/�[�������H�m�9H��1������8H�|$H�/u���H�|$H�/��8����8H�|$H�/tH�|$H�/�:����9�����H�|$H�/tH�|$H�/�";�^����:�T����H�|$H�/�]��>���9�H�+�I�H��1��%��� �H�|$H�/������ǒH�+�גH��1�����鮒H�|$H�/�y������U�H�+�e�H��1�����<�H�|$H�/�������H�+��H��1�����ʓH�|$H�/����v���q�H�+���H��1��]���X�L��L��L��L��L�D$��J����A�D$L�D$��H�|$ H�/�B�����H�+�.�H��1����������1��U�H������H�L$閕������H�|$H�/u���H�|$H�/�C�����������t
H�L$�P�H�}�#H�5^�1�H�8������r��1��t��f���H�H�|$H�/u�Q��H�|$H�/�t��=���A�H���0��H�L$邖�����t
H�L$�o�H���#H�5��1�H�8��������1�铘H������H�L$�ԗ�����U�H�|$H�/u���H�|$H�/�������N������t
H�L$鎗H�{�#H�5\�1�H�8�
�����P����t,H�L$�H�|$H�/u�R��H�|$H�/tW1�鉙H�)�#H�5
�1�H�8����l�����@�H�|$H�/u��	��1��K�H�����H�L$錘�����/�����1�鮚H������H�L$�������u�H�|$H�/u���H�|$H�/�������i��p����t
H�L$鮙H�k�#H�5L�1�H�8����9��`��1��͛H���Q��H�L$���B��锛H�|$H�/u�-��H�|$H�/�›���鈛������t
H�L$�͚H���#H�5��1�H�8�y���X������tcH�L$�5�L��H�D$����L�D$ H�D$鈜H���#H��n�H�|$(H�/������1��u�H�����H�L$�ܛH�a�#H�5B�H�8����1��F��6����tH�L$��H���@��H�L$��H��#H�5�1�H�8���錝H�+���H��1�����s�����H�H�|$H�/u����H�|$H�/�s������@�����1��4������t+H�L$��H�|$H�/u���H�<$H�/tW1��ߞH�v�#H�5W�1�H�8����ž�k��驞H�|$H�/u��V��1�類H���G��H�L$闝�8��酞�����t,H�L$ �4�H�|$H�/u���H�|$H�/tW1�魟H���#H�5��1�H�8�v��鐟�����{�H�|$H�/u�����1��o�H�����H�L$ �ž����S�H�����H�L$��H�mt1�鬠H��1��z��靠�P����tH�L$�ޟ�]���_�H�A�#H�5"�1�H�8�����c�H�|$H�/u�+��H�|$H�/u�����>�H�|$H�/u����1��'����1�霡H������H�L$�ݠ�����^�H�|$H�/u����H�|$H�/�������W������t
H�L$闠H���#H�5e�1�H�8����'��y��1�黢H���j��H�L$��[���}�H�|$H�/u�F��H�|$H�/����2���v������t
H�L$鶡H��#H�5��1�H�8����F����1��ڣH������H�L$������霣H�|$H�/u����H�|$H�/�ȣ���镣�����t
H�L$�բH���#H�5c�1�H�8����e��w��1���H�|$H�/u�`��H�|$H�/����L���ˤH���?��H�L$���0��钤�����t
H�L$��H��#H�5��1�H�8��������1���������H������H�L$�O�H�|$H�/u����H�|$H�/������ӥ�����t
H�L$��H���#H�5a�1�H�8���飥�u��1��]��i���1�H�|$H�/u�T��H�|$H�/�`��@���*�H���3��H�L$�I������t
H�L$�6�H���#H�5��1�H�8�����H�mt1��1�����1H��1������1H������1�H�t$H��H���x%����11�H�t$H��L���^%����1H�=��#�IH��H��t8H�D$H�t$H�}H�KL�D$H�PH�v�N�H�|$H�/�;1�11H�|$H�/u�:��H�|$H�/�9����&��1���0����i2H���
��1�H�t$H��H���$���e21�H�t$H��L���$���2H�=�#�HH��H��u'H�|$H�/u���H�|$H�/u���1��1H�D$H�t$H�}H�KL�D$H�PH�v�j�H�|$H�/�k1�1H���^����2L�l$L��L��L��L��L�D$��?��t)�t$H���M���k2H�mt1��]21��V2A�D$L�D$�2H��1�����72I9���6�?L;,$�R6�b?I9��5�G:I9���7��9H���7�u?1��J=�$H�|$@�f�#�$�4=I9��gC�LLL;,$��B�LI9���A��FI9��3D�UFH����C�1L1��J�$H�|$H��#�$�IH�t$H�|$H��I)���XI���M�_NH�t$ H�|$H��H)���XI��QM�NM�H)�L�L�L$H�,$��M�NH�t$ H�|$H��H)��XH���L��MH�t$H�|$H��H)$�^XL�H����L�ML9��$P�PI)�I��X�[H�D$I)�H��M���X�ZH�D$H)�H��M���
V�ZH�D$H)�H��M����V�YH�t$I)�H��L�T$��WH�|$L�D$ L�L$(H��%W�D[H�D$H)�H���MVH�D$H)�H���UH9l$�fS�XSH9��sY�ZM����Y��ZH���'Z��ZL�[�k_� u7L��H��L�D$�I�L�D$���,^L�[H�C(J��H�C�]H9�~�L��H��L�D$轉L�D$��L��#H�5��1�I�8����z�H�D$��H�����H�D$��H�|$H�/��������i�H�+�y�H��1�����P�H��#H�5=�H�:�5��1��~`L�l$L�d$ ��`H�����L�l$�`H�|$H�/�ڤ�i��鶤H�+�ƤH��1��P��靤I�,$uL���<��H�m��cH��1��'���\bH�
{�#H�5��H�9���1��?bL������
bH������L�t$�cL�t$�cL��1������b1��h�����I�$H����eA� H�@�3��g�K��1���rH�{H�rH�{H�rH���z��H�D$鍤���1��ĤH�D$�w�1��sH�{H�EtH�{H�<t����1��sH���-����s1��.�H��H�D$���H�D$��H���t1��tH��1�[�H������1҃{PH�u��H�����cH�,$H��u�p��1��uH��H�=��1�����H��H��l�#��t�B��1�鳥�6��1�E1��Ey�L$DH��;�#��$���t%����H��$���#�x�����=yH��$����#��$��ÁL$D�	D$D�fo�fDŽ$�g>fl�Ƅ$�-�$�f֔$�D�E����u�4�E�P>A��wk�A�����A�����D��$�D�{E8���E8���D��$�A�H��$�D9���B�I���y�@��?��B���A���t1A���wA�A�����A�����뇁L$DH�|$���#����A�����A������Y���A���t(A���v�A���tEA���w,�A�����A������+����A�����A���������A���t#Ƅ$��y�A�����A���������A�����A���������Ic�Ƅ��HtL��$�H��L��L���Ƅ$�>fDŽ$� �Ҁ�L$DH�|$��#����H���1��1�H�L$XH��H�T$PH�5���������yH�|$PH�G����ԁH�t$H����H��H����xL�d$HM����r�D$�r1�E1��-�1��v�L$D�>���1��vE1���E1�E1�1��E1�E1�1���E1���E1�E1�E1�1��ԣ����1���L���T���L���G�������E1�1�韣1�阣L���$���ܣH��$����#�D$`����X�H��H�|$`L��H��H�|$�H����L�����#�L$,E1�I����D$,�a������t6�tAE1��?�L�D$`L�D$H�|$�Y�#雇L���K�#���u�H�{(�:�#��H��,�#�E1�I��M9�t3N��M��t�
Mk�L��1�H��H���a�L���5�E1��Q�E1��I�H�C(H����#譽��E1�閄H�L$L���L��L�D$�D$+�F0�|$+I�����I�O�L�D$J�<�L��I��#NJH���O�T��t��鉄1��=�H��H�D$���H�D$��H��1�[�H��H�D$�f���H�D$連H��1�[�H��H�D$�G���H�D$顣H��H�D$�0���H�D$�Q�1��Z�H��������I��I���	�L��I��H�+A����E1���L��I����L��H��M�#H�+I�������L��軿���X�H��访���X�L��衿��鋉I��E1�鞊H�+uH��胿���.���E1���E1���L���f�����E1�里E1���E1���H��uH�+A��։E1�E1��O�����I��H������H��L��1���q���H�+I����I�m���L�������AWH�3�L�=AAVI��AUI��ATI��Hc�UL��H�-�FSH��8H�ЉL$H�s�H���6OH�$M��t5I�L$�L��u+I��H�-�3H�5�[L�=w&H�=\HF�LF��T$L��L��A�ׅ�u1���T$L��L��A�ׅ�t�M�D$�E1�L�D$ L9|$ vQK�T�O�\�K�4�K�|�H�T$H��L�\$��LH�t$H�|$H��H�D$(�LH�L$(K�D�K�L�I��먋T$L��L��Յ��o���M�L$�1�L�L$H9l$vwM�T�I�|�H��H�4$M�|�L�T$M�t��NLH�4$L��H��I���<LH�4$L��H��I���*LH�4$H�|$H��I���LM�d�M�|�M�t�I�D�H��낸H��8[]A\A]A^A_ÿH��H9�v�H�� H9��BH���͢A�I��I9����K�鲢A����?L��H�����I��"I�M9��tL��H)�L9���鰣H�L$J��I��L9�u�H�|$�H��H��������?H��2�#L��E1�&�#H�|$��#鰥H���)H��H��t�N�<�L��H��L���`���1�H��H��L���4�����tdL��L��H���>���H��L)�N�t=L�t$E1��Y���L����#H�|$���#H�D$�>�L����#�0�H�D$�"�H��o�#�8���I��#NJ1�H�D$L9�@��I��H)�餤H���V��M��L��H����E1�I��H9�A��L��L)��ģH�����L��z���L��L��H��E1��[���M9�tH�D$J��I����H�|$ �H��H������H��t���#�~����#�o���AWM��AVM��AUATI��USH��hH�|$H�t$dH�%(H�D$X1��H��I9�wkI���wH��L��L���~���H�|$L�D$PL��L��L��詟H����K�>H��H�|$H���H���#��I�hH�T$I��H�l$ H��H��I)�L�I9���M9�v}K�4	1�H��I�D�H��H9�w�I�L�M��M��L��L��L������t?L�D$K�7L��I�<�CL�L$ 1�I���@I�L�M��M��L��L��L�������u�1���K�61�H��H9�v�I�D�H����I�D�H��I9�w�H�t$K�L�I��M��L��L���`�����t�H�|$I�/L���,C��H��H�t$H��L���L��L��L�T$HI�D�I)��BM�LL��H��L��I��L�EL���I��L��L�D$@K�DL�|$L�L$(L�T$8H�t$0�BL�|$H�D$8L��L�D$@H�T$(M�<I�LM��L����������O�6L�T$HL�\$01�I��I9�vI�D�H����K�L�L�L$M��L��L��L���Y����������H�t$I�<L�H��H�t$L���BH�T$L��L���&DH�\$ E1�H��L�sK�D�I��M9�w�H�t$K�L�I��I��L��L��������2���H�|$H��L���AH��L��L����C�H�t$XdH34%(t���H��h[]A\A]A^A_�L��L���`)H��H�D$8�%I��H��tu�L��H����(H����H����$H�D$(H����H�L$(H�$M��M��H�t$ L���.�����uL��E1����#H�|$(���#�͎L�����#H�T$�H���4o�/�H�T$H���BxL�{(L�[�ɇH�$H�t$ M��M��1�L���}�ڍH�$H�t$ 1�M��M��L����������L���-�#�L���"�#�w���H��H���n�P�AWW�AVA�AUA�ATUH��SH��H��H�NL�NH�~ L�V(H�T$L��$pH�V(zAL��$hdH�%(H��$x1��H�T$0H��$pH�L$1҈D$/H��$�L��$�H��$�L��$�Ƅ$�0�$��$�H��$��D$p0L$x�$�L��$�HDŽ$hH�D$L�d$(�@�D$@�I��(�@L�\$hT$H\$XƄ$�PI��L��$�H��tI��N�<�I��H�=��O�d:�t%I��~ �L��L)�H�$�I��K�D:�1�J�4�I�I���ɚ;wtI��'w)I��cwI��
E�A���(I���E�A���I��?BwI����E�A���A�	I������I�����E�A����I��?z�ZM9�w]I���vHM9�wH���TL9�E�A��A���H���rN	A�I9���H�����L9�E�A��A��
�gI���c����
M9�wAI����o�#M9�wI��Ƥ~�M9�E�A��A���0I����]xEcM9�E�A��A���H����#NJL9�E�A��A��A��E)�Mc�N�$�H�=�#H�{ HM5�#H9�t"� tH9�~H��H����t�H��H���lI��]xEcL�C(1�H��H��#NJI����XLI�H��L�I��I9�H��I��I�@H��H��I��I�H�C���#�I�xM�I��L�c�+cH��$0�n@H��$�a@L�t$(%U>DŽ$$(-S>L��$I��$8E1�DŽ$TH�D$H��)�$H��~<A�H��$p�`L��$H��$�L�T$L��$�L�d$pH�|$ E��y^����4D�L$/���H�SH+T$0H+T$A��H�SA	�D��L�xMc�A�NL��N�,�H�I��I�EI��!�{���A����H�L$I��H��H��L���[�M�EH��$�M�I��L��$0I9�}>H�t$ L)�H��L����I��L��L��L��$0H��$0H��H�D$8I��L�\$x�H��$0I��L��H��H�t$8H�t$ L��A��I���~H�t$8H��L����H�L$I��H��H�T$@L��諉H�L$I��L��L��H���2�������$��uH��$����#��$�uH��$��p�#�D$p�uH��$��[�#�D$puH�|$p�I�#H�t$H��H���9�H��$xdH3%(t�ѯ��H�Ĉ[]A\A]A^A_�AWI��AVI��AUATM��USH���D�*H�ZdH�%(H��$�1�H�BH�r H�D$XH�j(L�AA��H�\$hH�D$`�A��@L�IL�Q H�t$pL�Y(��H�l$x��@L�D$0L�L$8L�T$@L�\$HD�l$P�D$ H�D$(H9�tH��H9�u8H�=@�#H�L$H�T$�SH�T$H�L$H��H��uA�$L����I9�tL��I9�u5H�=��#H�L$H�T$�dSH�T$H�L$H��H��u
A�$�L��$�H�L$L��H�T$�<H�T$H�L$I���c����
H�zH��H+qH��H��$�L9�L9�~
A�$�XH�t$ I�ML��H��H�t$�k���L�L$PL��H��L��M�EH��L�L$��{M�EL��H��H����AL�T$`L��H��H�t$M�EH��I�d����
I��L��$�H����XLI�L��$�H��$��{H�t$H��L��M�EH���g��I�U�D$H�T$�Eu�t��$���A	<$�t�L$u]L�-[�#A�1�H�
��H�`��I�}���I�}�1�H������I�u�
�R���A�$�H��H�=[�#��{��u7L�D$H�T$L��H��H�����L�D$L��H��H��#H�����2���H�t$H���~{��t7L�D$H�T$L��H��H���_��L�D$L��H��H� �#H���h����L9�t1L��H��L����n��th�E�u
H�}(���#�Eu	H��}�#L9�t/L��H��L���n��t2��u
H�{(�W�#�u	H��I�#D��$�A��E	<$�nH��t$L9�t�E�u
H�}(��#�Eu	H���#H��t"L9�t��u
H�{(���#�u	H����#�1�L���c�1�L���cH��$�dH3%(t�^���H���[]A\A]A^A_�H�|$0���#�r�H�T$H���?mH�L$ L�\$(�3�L�|$A���H�T$H��L�t$�mL�t$釈H�|$X�;�#�D$0韈K�|�����3�L�|$A�鰊L�D$L��L��H��H����������E���L�kH�ML�C(L�\$ �j�H�T$H��L�\$ ��cL�\$ ��H�T$H��H��L�\$(L�T$ �ZlH�L$ L�\$(���)�M�V�݆H�T$H��H��L�\$(L�T$ �ucH�L$ L�\$(��D�T$E��t6L��H��L���qlD�d$��u#H��H��L��[]A\A]A^A_�b�d���H��L��L��D�d$���t$H��1�[L��]1�A\A]A^A_�"��
����ؖH�|$ H�/u���H�|$H�/u���H�mt.1��U�H�|$ H�/u�ʩ��H�|$H�/u�躩��1��.�H��諩��1���H��蜩���,�H��H�D$芩��H�D$�L��H�D$�s���H�D$�ٕH��H�D$�\���H�D$�z�H�|$ H�/u�B���H�|$H�/u�2���H�+�i�H��� ���1��A�H��H�D$����H�D$� �H�|$ H�/u��H�|$H�/�$��ި��1����H�|$(���#�$u	L�����#L��L��L���z�魊蠨���8�H�|$H�/u苨��H�|$H�/t1��ݗH�mu�H��1��h����Ǘ�^���齗H���Q�����H�m�M�H��1��7����H�|$H�/u�"���H�|$H�/�������ϋ�$���L���˾#�Ɍ��鹘H�|$H�/u�ܧ��H�|$H�/t1��^�H�mu�H��1�蹧���H�诧���>�H��袧��钗H�m�n�H��1�舧����H�|$H�/u�s���H�|$H�/�@��_��������A���P�D$�o���zL�\$I��A�H�T$L��H���i�;����@�;A�U(H��I�u�	j�ՏH��$����#�L��L�\$L�T$H�4L�L$H�T$H�5�#L��L�L$@�h�D$(H�D$
H�l$0H�l$HH�\$8L��L�d$@L�D$H��H��H��H���3L�D$H��H��H�T$H��苊H�l$�l$(���D$t�L�D$H��H��L��L����~L�D$H��L��H�T$L���F�닺1�H���]��$�ؑH�L$�	����H�T$H���K^��$鮑L�L$I��A�	���A��������D$I��LD��z�����$�M��I��L��$�H��$�I��L��H��$�L��$�H��$�H�l$0H�\$8H�|$(L��H�L$�󥈔$H�T$(H��L��$L�D$H��$ L��$(L��$0H��$8韏H��$��Ż#��$���H��$���#��$��ϐH��$���#鬐H��$8�|�#��$鈐H��$��a�#��$�鞐H��$��F�#�{�H�|$�6�#郐H��(�#�G�I����]xEcM9���׃��d�H����#NJL9���׃��K�H���vHI9���H���rN	I9���I�����M9���׃�
��H�|$8���#�D$鹖H�|$@���#霖�؟��L��H���\�m�L��H���\�]�L9����D$�ɕH�|$h�A�#�D$@�>�I���TM9���׃��x���n�L�|$@H��L��L���1e�����L��H���[������1���H������H�L$�2���鳘H�|$H�/u�ܢ��H�|$H�/���Ȣ��駘螡����t
H�L$��H���#H�5z�1�H�8�(����w�H�m���H��1��~����C�H�|$H�/u�i���H�|$H�/�`��U�����A�����1�H����Y�	�L��$�L���#��H�L$H�T$HH��H���������H�T$�H���]Z鞔L�����#騔��$<H�T$H�߁��0Z�q�H��$�}�#��$��f�L��H���Z�����$<H�T$H�߁���Y����$<H�T$H�߁��Y�H��$���#��$��$�L��$�L���#�H��$��ڷ#��$��ۓHkt$@�L��菜H��A��E��D�L$4�;�H�$M��I��H��L��H���z��H�+�	�H��1�詠����H�|$H�/��萠���ǔH��胠���L�1��G�1��@�1��9�1��2�H�T$�H���X��H�\$`L�D$L��H��H��$�f��H���D$`0fo�+H��$�L��T$h\$x����Eu}�D$`L�T$�uoH��$�L�D$xE1�J�|�A�Ĩ�uL�T$���#�D$`L�T$�uL�T$H��|�#L�T$H�]H�}(H�U �E�%�H�|$0�W�#�D��1�H���#W�D$`��uH��$��,�#�D$`���H���#�q�I9���H9�����&�H�T$H��L�T$�WL�T$�ϗH�T$�H���lW�'�H�T$H��L�T$�u`�MH�}(L�T$�ӖH�T$H��L�T$�W�MH�}(L�T$鯖H�|$H�/tH�|$H�/�y�萞���F�膞����1�霣1��=�H���n���鈣L���a���鸣H�+t,1��n�H�muH���@���I�,$u�L��1��/����I�H��1�� ����:�H�T$H�4$�=	H�4$H�T$H��I��t\L�t$L��H��M���Yk�D$uM��L��L��H��H��辶A�E��uI�}(���#A�E�u'L��y�#�D$�*�H��H���V��D$��H�|$ H�/����n���1��_��b����זH�L$�i�H�|$ H�/u�C���H�|$H�/u�3���H�|$H�/�P������������ەH������H�L$��H�m�(�H��1����馥H�|$H�/u�Ԝ��H�|$H�/tH�|$H�/��赜���r�諜����H�|$(�n�#�$饧H��\�#�fo_(�$1)\$`�2�H�muH���b���I�,$tD1�鰨1��T�L���E���邪H�+u�H��1��0���釨1�逨H�������s�L��1��
����d�賘��逭詘��H���R�A�FuxA��A��t?艘��H���2��H��?H9�u@��u<��A�ȉL$E��t�H��������鯭L���#H�5Y�H��I�:������E��u�Ь邭H���������s�H�|$H�/tH�|$H�/����D����b��:�����H�|$0���#��H�|$��#���t$1ɺL����A�����D�\$D�\$邲L�d$0H�$H��L����\��uA�1�L���rR�q�H�|$X���#�D$0�~�H��$��j�#�D$`�Q�fo(&fo&L��$�L��$(L��L��$H�l$,�$��$�D$,HDŽ$(Ƅ$����'H�$H�5T�#L���\H��$�H�T$�D$0u%L�D$HH�t$XJ�|�uA���D$A����L���L��tNH�T$H��I��L��L���1gH��H��L��胪H�$D�L$,D		A��u�I�M�W(I�|��uA��u�H�|$I��H��H��H����fH�|$H��H���3�H�T$I��L��L��L���z�D$`D$0��-����t$,H�$L�����QA�����H�|$x��#�D$P�L���ϯ#��H��$����#��$��I�L$1�1�L��H��I+$�֢L�\$A�Ap�նH�T$�L���Q龶I��?B�I�����I�����M�I����I��?z�ZM9�wLH���vHI9�vzI���rN	M9���H�����L9�M�I��I���òH���#��M9�wH��Ƥ~�L9�M�I��I��锲I����#NJM9�M�I��I���x�I���TM9�M�I��I��
�\�A�
�Q�1ɺ1�L��象�n�I���M�I���(�I����M�I����A��
�H��L����O雺H�|$��#�[�L�l$@A�uI�NI�v(H�|���I��M)�M9����M@��1�L���N�<�H��$����#��$���L�l$@H��L���̮H�\$@A�uI�vI�~(H�|��t
M�fI9���H�T$PH��L��H���q�H��L��L���S��ùH��$��@�#�D$p鸺fo5~"L��$�L��$�L��A0HDŽ$��FM�MH��L��L�D$H�|$L��L�L$@��L�D$H��L��H�|$L����A��umM�WI�W(J�|�te��$�$������Q�M�VL�L$PO�\:�M9�����z���H��H��L��L��L)�I)��xMfH�\$@���M���%�M����H��$(�:�#��$�j�L��$�#锹H��$���#��$��q�H�|$���#�Q�H�|$p��#�Y�H�|$H�/�O������+�H�+�;�H��1������H���ڔ��骏L���L���5M�*�L��$�L���p"I�NH�CDŽ$�H��H9�}2E1�H��$��H��Mc�E�HH�N�$�H��I�$H9�}PE����L��$��D$P��uH�|$x��#�D$P�uH�|$P��#L��L��L��H��$���邺H�L$ L��H�l$PH�L$L��$�E��x�L�A�6L��L��L��H��H�D$M�D�D$I��L��$��ȫA�6M��L��H�t$H��H���aL��L��H���p�M��L��H��H���#H���x�M��L��H��L��L���d�H�D$H��A�����D�D$A���U���H�D$�����L�����C���$��M@�����u
H�<$�ީ#�D$`��uH��$��ǩ#�D$`�uH�|$`���#�D$0��t��=�H�\$0H����#�*�H�|$X���#�D$0�ӿH�
Q�L��L)�H�$�I��K�D"�1�J���I��]�H��$��?�#��$��F���H�5�#L��$�I9w hH�5�����L��H�L$D�NA�L�I�GI�G�����BI�DH�\$H�D$H����f��:�H��L���ZJ���H�L$�L��H��Ƅ$��8��$�H�L$I�G(uH�=f�#I� A��T���L���h�#��H�|$(�X�#�$�΍�H��L����D$T钍�1�L���I�!�I����#NJI9���Ѓ��n��	�d�H��$���#��$�鮐H�<$�٧#駐H��$��Ƨ#��$�霐L����#閐H�|$���#�V�H��$���#��$��3��M@L��L��H��?�EH�`�H�<��э�}�H��L��L��I���H�T$0H��L��H�t$ �5�� �H�|$x��#�D$P��H�|$P��#�L�d$PH��L��L���R��tM���:�H��L���lH�ǏH�|$H�/�r�����N�H�+�^�H��1��ʏ���5�H��轏���͒�1�L���YG�H�|$`�i�#�H��$��V�#�D$`��H��C�#��H�l$`L��L��H���[Q����I��H�\$0�Z�H��$��#��$��!�H�\$0H�KM��H��L��L���ѵH�T$@L��L��H�t$0��L��H��L��辟��H�|$���#��H��$����#��$���H�|$���#�A�M@H�޺L��H��?�BF鏿H��$��O�#��$��L��L����F�_�H�|$(�"�#�$u	L���#D�T$LA��DUA��@D�U��H��H���F��A�,$��Dk�A��D��E����H�|$�D���E����AoUM�M(��H�|$ �Ao]H�t$��PI�\$T$(I\$\$8H��L�L$H�D$ ��I��������L9���H�T$H�|$���E�d�E1���H�|$1�1�D���_��F�E1�I��I9�t?J��H��t�Mk����H�|$�1�H��Ngm��!���L�T$E	��E1��O�H�L$0A�$H�HL$(H����H��?8����H�}�9<H�H9�������贌����H�|$ H�/u蟌��H�|$H�/u菌��H�|$H��tH�/u�z���E1���H���j���1�H�t$ H��L�������E�1�H�t$H��L���������H;-��#����x�������H�|$H�/u�
���H�|$H�/u���H�l$�/�H�|$H�/u���H�|$H�/u�Ћ��H�|$H���z�H�/�p�賋��1����L��褋�����I�/�1��D���������A������u	L���2�#H�mu�H��1��Q�����I�G(L����#�������H�muH�������Ň��1����H�L$+�H���D$+�g��|$+I�G(uL�
��#M�O E���H�{(���#��C���H����#�=���I�(�~�#A��6����`���I��H�����M7�����L��肊�����H�C(H��<�#�>���H�{(�-�#�&���L���P�����H��#H�5-�H�;�Ŋ��I�/tBH�l$L�eL�d$I��L�e���H������1��!�L��H�D$���L�\$�
�L������L���ۉ����H�/u�ˉ��A�E��t'�u�L����#�H�.uH��襉���P����l���I�}(�a�#A�E��H��H�D$�}���H�T$H��H�=��#�Y�I��H���#H9�t;M���}�1�1�L��H������I�,$H���b�L���,����U�H���M�L���E�H�\$���H������H�\$���I�muL�����1��,�H�mu�H���ֈ����1��I�_M9�|4H9u�#H��I�|$8HM5e�#H9�tiA�D$ ��I��H9���K��I����1���H�T$<L��L�D$�GAL�D$���I�/uL���O���E1����E1����I��몾L���
���L��L��H�=H�#�D$<��I��H��t�I�t$H�xH�T$<��t$<L����	������$�H�T$<L���@����I��M�T$@�%���H�T$<�L���@��H9����L���I�s�L959�#L��M�\$8HM5)�#L9�t#A�D$ t#M��L9��e�H�T$<L����H�M���N�H�T$<L���@��t
M��M�T$@�0�M��L�d$ �
��p�M��L�d$ ��H�T$<L���H�(���H�|$H�/����ކ���ًH�+��H��1��ņ���H��踆���X�H�-<�#A�71�H�
ݟH�A��H�}�Ȃ��H�}�1�H���豂��H�u�
�3����'�HcUL��L��诃�����sH���E1�H�+�21�1�H�=~�#H��tH�/H�j�#��M��tI�,$��H��t
H�+��H��tH�m�H�=�#H��tH�/H��#�kH�=m�#H��tH�/H�Y�#�TH�=D�#H��tH�/H�0�#�=H�=�#H��tH�/H���#�&H�=��#H��tH�/H��#�H�=ѿ#H��tH�/H���#��M��tI�m�	E1��L�H��1�1������H������5�H���ل����1�E1����1�1�E1����H��趄��锎H��詄���|�L��蜄���e�E1��b���H��臄���ٍ�}����l���L���p����o���H���c����q���H���V����t����L�������B�������8�������.��������$�������������H���
����nj1�E1�����L��E1����;�L�����閌H���ك���`�I�/uL���ƃ��H�+uH��踃��E1�E1��|���I�/uL��蟃��E1�E1�1��e���H��芃��鬋E1�E1��?���E1�E1��4���1�1�E1�E1��3�����H�G1�Ð��H���#H�=N�#H�����D��H���#�G,H��f���S1�H��H�=Ϟ#���H��t�SPH�xH�s���@0�PP[��H���#H��H9�u7���H��t(H�HHfo
�@0f�H�@����H�H@@ H0H���1���0H��u���f.���HcP�C���ATI��UH���SH��蹂��H��H��t#�@ � ������@�����H�{0H��L���^���H��[]A\�fD��SH��H�@H�������H�/��������H�{HH�������H�/�y����Ё��H�CH��[H��@��ff.�@��H�u�#SH9����~��H��H���E���H�=�#1��l���H�C@H���1���H�=��#1��Q���H�CHH���	���L���#M�����Ao@H�S@H�s,C�AoH K �AoP0L�C(S0L�BH�p�CPH�CXH��[�1���0H��H�������H�=s�#1�����H�C@H�������H�=X�#1����H�CHH���i���H�5]�#H��t7H�{H����L�K@L�S(L�[,M�QL�X�CPH�CX�n���H�{H�5�����ff.�f���UH��H��SQ��~��H��H������H��w	�]P1�Z[]�H��#H�5ܐH�8蜀���������UH��SH��H��H�F���t&H�5��H����|����t@H�5��H����|����tH��H��H��[]�L~��ff.��H�EHH�H��[]ÐH�E@H�H��[]Ð��SH��H��H�~H�59�#H9���H;	�#tWH;��#tNH;�#tEH�H�=ҹ#H���2}��H�+�����H�������H�(ufH�����H���#H�H��[�H��1����H��H���v����@,H�=t�#H����|��H�+�]���H���M���H�(uH���~��H�$�#H���}�����C���H���#H�5��H�8���1��v���ff.��H��H�=��#1�dH�%(H�D$1�H��������7���H�$H��tH�L$dH3%(uH����}������f��G(	w,�€���u1��!��AUH�=��#ATUS��Q�W���H�?�2����_�0L�oM���1���~��I��H���H�=մ#���ٴ#�oH�=۴#���ߴ#�9H�=�#����#�H�=�#tp��#��H�=�#tZ���#��H�=��#tD��#�.H�=�#t.H�-��#�H�� H�}t�]t�H�uL���|����y��s���H�=͵#tH�-ĵ#�]��H�� H�}u�L��L���z��I�,$�+���Z�[]A\A]�H�� ���H�5U�#L���%|�����J�������H�5�#L���	|�����������H�5ݳ#L����{��������΀��H�5��#L����{���������鲀��H�5e�#H���{�����z���門��H�uL���{�����)����}���H�5г#L���{����������a�����USH��H����H�=��#H���xH;5��#��H�=��#�]H95��#�H�=��#�BH;5��#��H�=��#�'H;5��#��H�=��#�H;5��#��H�=��#��H;5��#��H�=��#��H;5��#H���#tH�� H�8��H;pu�fD�X���uCH���w����x7H�U�
��u^	�1��H��[]ÐH�ٳ#����z�#���t�����ff.�f�H�i�#��H�y�#����1�!ˉ�fDH���#�d���@H���#�T���H�T$���H�T$���H�=�#H�5R�H�?�z�����K���AUATUSH��H�G����H�5��#H��H9��H;=��#�H;=��#�H;=��#�
H;=��#�H;=��#��H;=��#��H9=��#���"u���Ņ���H�59�#H�߽�u������H�5%�#H�߽��t����ttH�5�#H�߽��t����t\H�5�#H�߽�t����tDA�L�-dz#K�t�H��D���t����t#I��I��u�H�Ž#H�5���H�:�Py��H����[]A\A]�1��������ڽ�ӽ�̽�Ž�ff.�USM���EI����#NJE1�H�HA��L9��gM���^H�1�I����L�^H�BL�H�I9���I����#NJL9��qH�G1�I����H�nL�ZI�I�L9���H����#NJI9��zL�_E1�I����H�^H�jH�L�H9��0I����#NJL9��H�oE1�I��tQH����#NJ�H�v��8uL��L��M�M�I9���M9���L��H��E1�I9�u��I9���1���u[]Ð1�L��H9�v�I��N��I�PN��H9�s�L��I��L��I9�s�N��N��I��L9�t���H�v��8uH�H�I��v$����I�A�L��H��I9��<���I9���ro��j���I�v��8uL�H�GI��t׻�~���H�v��8uH�H�oI��t�A�����I�v��8uM�L�_I��t�A��u���H��#NJJ��H��H9�@���#{��J��I��L��I��A�������H���H��ATE1�E1�I����#NJUI�v��8uS����H��t@H���mJ��J��H�L�L9�H����H9�A��L�D	��D��HD�J��I��J��J��H�L�L9�H��A��H9���L�A	�E��E��HD�J��I��L9����J��J��H�L�L9�H��A��H9���L�A	�E��E��HD�J��I��J��J��H�L�L9�H��A��H9�I�Z��L�A	�E��E��HD�J��H��H��H�L�L9�H��A��H9�A��L�E	�E��E��HD�I�jH��H��H��H�L�L9�A��H9�H����L�A	�E��E��HD�I��H��L9�����E��u;[]A\�L�H�L�L9�I����L9�A�@��L�	��D��ID�H��]���H��#NJH��L�M�I��I9�tM�[]A\��y���ff.�H���I��#NJH��U1�S1��toH��t1H���L��L��H)�H+�1�N�I9�IB�@��H��H��H��H��H)�H+�1�N�H9�LC�@��L��H��H9����L��L��H)�H+�1�J�I9�HB�@��E1�H��H��L��M��I)�L+�M9�K�LB�A��L��L�HJ�,�I��M)�N+�E1�K�L9�L��HB�A��1�J��L�HJ��H��L)�J+�H9�N�LC�@��H��N��H9��V���H9�r*[]�H�1�H��H+H9�N�IB�@��H������H��L�I�H�p�H��tI�0[]���w����fo��H��XLI�H�H�H�G)H�G�KH�W H�O(�f���H��sr����H��cr����H� �Sr����HcW4H���#H��H�����Hc8�#r����UH��H��SH���;p��H��H���t H���c����
H�H9�wH�] 1�H��[]��o��H��t����H�
�#H�5��H�9��q������f�I��H��H��I�� ��H��1�H��H)�@��I��"svH��H��H��H��"H�H��H��I��H��H)��H��"H��I��I��H)��%H��"H��BM����I9����ff.�@H��H��H��H��(H�H��I��H��I��H)�rH��(H���M��I��L)���I��(L�s�I���ff.�H��H��H��H�� H)�H��H�� H�H��H��H�� H)���H�� H�rXH���F���L)��H��(I��H�H���z����I���j���I��"H��L�H�����H�������H���H��"I��H�rI9��Pu���I���,���H���o���I����f.�AUA�ATI��UH��SH��H��t2fD��tL��L��H�����I��H��H��L�����H��H��u�[L��]A\A]�f.�H�GI������L�
����AWAVAUATUSIc�L�>��L�GI��H��fDI9���I���������H��I��H��D�J0H�,�E�
H�H)�H9��i��0�G@�7[L��]A\A]A^A_ÐI�@M�XM�`M�xH�D$�M�pM�hL�\$�I�XM�HL�d$�I�PI�@L�|$�L�t$�M�x	M�p
L�l$�M�`M�hH�\$�I�h
I�XL�L$�M�XM�PH�T$�H�D$�H9���H�IGw�IH��H��H��H���B0�H�d����
H��H)�L9���H�S�;\H��H��H��H��]xEcH���z0H��A�8H)�H;L$���H�Wx�/e�9H��H��H��o�#H��3�z0H��A�xH)�H;L$��	H�����u@H��H��H��H��Ƥ~�H���z0H��A�xH)�L9���I��͕P�MBH��I��I�@z�ZH��*�z0I��A�xH)�H;L$��H���ЄK8H��I��rN	H��H��)�z0I��A�xH)�H;L$���
H�3"�[3/#H��I����H��H��%�z0I��A�xH)�H;L$���H���$���H��I��vHH��H��$�z0I��A�xH)�H;L$��#H�������H��I��TH��H��!�z0I��A�xH��H)�H��H;L$���H�SZ��/�DH��H��	H��H��Hi�ʚ;D�J0E�HH)�H��L9���
I���a�w̫H��I��H��Li���r0A�p	L)�H��L9��.	I��Bz�Ք��H��I��H��Hi򀖘D�z0E�x
H)�H��L9���	I��4�ׂ�CH��I��H��Li�@BD�J0E�HL)�H��L9���	I�Cx�q�Z|
H��H��I��H��Hi�D�z0E�xH)�H��H9���
H�KY�8��m4H��H��H��Li�'D�j0E�h
L)�H��H9���H��S㥛� H��H��H��H��Li��D�r0E�pL)�H��L9���I��(\��(H��H��I��H��H�4�D�z0H�,�E�xH��H)�H��L9��>I���������H��I��H��L��D�j0M�E�hL)�H��H;L$�����0A�@A�xL�D$����DL�GI��I��H��f�I9��7I��(\��(H��H��I��H��L�,�D�b0K�\�E�#H��H)���L�oL�gI��I��H�oH�_L�_L�WL�G	H��I9���I���a�w̫H��I��H��D�J0E�Li��L)�I9���H��Bz�Ք��H��H��H��Li����D�J0E�L)�I9���I��4�ׂ�CH��I��H��Li�@BD�J0E�ML)�I9���I�Cx�q�Z|
H��H��I��H��Liʠ�D�r0E�4$L)�H9��_I�KY�8��m4H��I��H��Li�'D�b0D�eL)�H9���I��S㥛� H��H��I��H��Hi��D�J0D�H)��v���fDL�WL�GH��I��H���ff.��H9��o	��0�GL��@�7�f�L�_L�WH��H��L�GH���9���DH�D$�H�oL�WL�oH�_H�l$�L�wL�T$�L�L�l$�L�g
L�o	H�\$�H�oH�_L�t$�L�_
L�wL�WL�GH�|$�H��H9L$���
H��L�L$�H�����u@H��H��H���B0A�H��Ƥ~�H��H)�H9L$��0H��L�L$�H��͕P�MBH��H��*�B0A�H�@z�ZH��H)�H9L$���I���ЄK8H��I��L�L$�H��)�B0A�H��rN	H��H)�H9L$���I�3"�[3/#H��I��L�L$�H��%�B0A�H����H��H)�H9L$���H��L�L$�H���$���H��H��$�B0A�H��vHH��H)�H9L$��hH��L�L$�H�������H��H��!�B0A�H��TH��H)�H9L$���I�SZ��/�DH��H��	I��L�L$�H���B0Hi�ʚ;A�H)��t���ff.�L�gL�_H�|$�L�L�GL�d$�L�\$�L�wL�oL�|$�L�g	L�L�D$�H�o
H�_L�_L�W
H�D$�L�GH���3���DH�oH�_I��I��L�_L�WL�GH���?���ff.�f�L�wL�oH�|$�I��L�gH�oH�_L�_L�WL�G
H��	��ff.�@L�gH�oI��I��H�_L�_L�WL�GH�����f�H�_L�_I��H��L�WL�GH�������L�gL�H�|$�L�d$�L�wL�oL�gH�oH�D$�H�_L�_	L�W
L�GH������L�L�wH�|$�L�oL�gH�D$�H�oH�_L�_L�W	L�GH��
���H�_L�wH�|$�H�\$�L�L�oL�t$�L�gL�wH�oH�_	H�D$�L�_
L�WL�G
H���$���H�oL�WH�|$�L�oH�l$�L�L�T$�L�wL�gL�l$�H�o	L�oH�_
L�_H�D$�L�WL�GH��
���L�OL�GH�D$�L�L$�L�oH�_L�D$�L�wL�gL�_L�L�l$�H�\$�L�o
H�oL�t$�H�_
L�w	L�d$�L�WL�gL�\$�L�_L�|$�L�H9��Yi��I��o�#H��1�L�L$�I��L�D$�L�L$�0H��H�T$��H�D$�H�|$�H�T$�H�D$��`���H�WL�OH�D$�H�T$�H�_L�wL�L$�L�gL�_L�H�oH�\$�L�WL�t$�L�oL�d$�L�w
L�gL�\$�H�_L�_L�|$�L�	H�l$�H�o
L�T$�L�WH9���h��I��]xEcH��1�I��0H�ֈH�|$��
���L�D$�H�|$�A�.M��M��I��H��L��M��I��L��I������L�D$�f.�L���.I����L�D$�H�|$��A�.I��L��I���6�L�D$�H�|$��.L��M��I��L��I���4���L�D$�H�|$�ff.�A�.M��I��L��I�����L�D$�H�|$�A�E.M��I��H��L��M��I��L��I���H���L�D$�H�|$�A�$.I��H��L��M��I��L��I���M���L�D$�H�D$�H�T$�H�|$�L�|$�M��L�D$�M��M��I��H�D$�H��L��M��H�T$�L�T$�A�.L�G���L�D$�H�|$�A�.M��M��M��I��H��L��M��I��L��I���A���H�D$�H�T$�L�L$�H�|$�L�|$�M��H�D$�M��M��I��H�T$�H��L��M��L�L$�L�T$�L�D$�A�.L�G�R���L�D$�H�|$��E.H��L��M��I��L��I�����L�D$�H�|$�H�T$�L�|$�M��M��M��I��H��L���.M��I��L��I������L�D$�H�|$�H�T$�L�L$�L�|$�M��M��M��I��H���.L��M��I��L�L$�L��I���]���L�D$�H�|$�H�T$�L�L$�H�D$�L�|$�M��M���.M��I��H��L�L$�L��M��I��H�D$�L��I������H�T$�L�L$�H�L$�H�D$�H�T$�H�T$�L�L$�L�|$�M��M��M��H�D$�I��H��L��H�T$�M��I��L�����H�T$�L�L$�H�L$�H�D$�H�T$�H�T$�L�L$�L�L$�H�D$�L�L$�I��L�|$�M��M��M��H�T$�I��H��L��M��I��L�������.H��I�����L�D$�H�|$�H�T$�L�L$�H�D$��.H�T$�L�L$�L�|$�M��M��M��H�D$�I��H��L��H�T$�M��I��L��I������H�L$���.H��1�M�HH�d����
L�L$�M�HH��L�L$�L�|$�M�HI�xM��M��M��I��H��L��M��M�PL�L$���0H��I�PA�H�D$�H�T$�I�PH�D$�I�@H�D$�I�@M�@H�T$�H�D$�L�D$��7���L�L$�H�D$�A�.H�T$�L�D$�L�L$�L�L$�H�|$�L�D$�H�D$�L�D$�H�D$�H�T$�H�T$�L�|$�M��M��M��I��H��L��M��L�T$�L�L$�I��H�D$�L�D$�H�T$�L�L$����H�D$�H�T$�L�L$�L�D$�H�D$�H�|$�H�T$�L�L$�L�L$�H�D$�H�T$�A�.L�L$�H�D$�H�D$�H�T$�H�T$�L�L$�L�L$�H�D$�L�|$�M��M��M��H�T$�I��H��L��L�L$�M��I��L��I������L�L$�H�D$�H�T$�H�|$�L�L$�L�L$�L�D$��.H�T$�H�|$�H�T$�H�D$�H�D$�L�|$�M��M��M��I��H��L��M��L�T$�L�L$�I��L�D$�H�D$�H�T$�L�L$�����fDL�G1�HH��H�O��HGI)�L�GH��tH��H���tL��<@�<H��H���u��ff.�f�U��0SH��H9=qr#HM=ir#H��H��H����a��H���r#H��H����a���H��H��H��H����a���Xr#H�C(H����a���f�H�CH�k CH��H��[]�f���H��SH��H���va��H��H��r#H��H��tH��1�H����V��H��H��[�H�W(H�GH�|���H���la��H�2H���(a��I���������H��1�I��H��L��M�L9�tH�GH�H��H��?�fDE1�I���������H��I�JI��H��H��I��I��H��L��M�M9�u�H��(\��(H��H��H��I�JH��H��H��I��H��L��M�L9��~���A�
H��1�H��I��1�H��I��H���[�������I��H��	��H���	H���v=H��uWI�IGw�IH��I�d����
H��I��H��H�I��I)�L���H��u$I��o�#H��1�I��H�H�ÐH���6`��I��Ƥ~�L��1�I��H�H��ff.�f�H���+H���w:H��uHH���������H��H��H��H�H�<�H�I)�L��ff.�@H����H���JL�H�ÐH���v4H��
tQH���7I�@z�ZH��1�I��H�H��ff.�H���	A���H��1�I��I��H�H�ù�s�HH��1�H��
H��H�H��DH�S�;\H��H��H��H��H�H��]xEcH��I)�L��H��A�d1�I��H�H��H����vH��u3H��A��1�I��H�H��H�������L��1�H��H�H��H��	u�H��A�ʚ;1�I��H�H��A�QJ�H��1�I��I��H�H��H��A�'1�I��H�H��A���L��1�I��
I��H�H��H��A��1�I��H�H��H�й���1�H��H�H��H��A�@B1�I��H�H��fDATI��USH��H�� dH�%(H�D$1�H�D$H�D$������H�T��H���ɚ;��H��'��H��c�*H��	�0H�t$H�|$����H����H�D$H����H����H�L$dH3%(��H�� []A\�H����]��H��H����]�����f�H��?z�ZH9���H���c����
H9��H����o�#H9�w_I��Ƥ~�I9�H�H��H��H�t$H�|$���H��~H�|$��\��H�D$H��t
H���B���1�H�|$��H��/���I����]xEcI9�H�H��H���H���H�H���1��I���vHL9��\\��I���rN	�
L9��`���H�����H9�H�H��H���D���H��?BwH����H�H���(����H���������7\��H����#NJH9�H�H��H������tT��@AWI��L�Q�AVI��H�_Cy
�5��AUATUH��SH��HdH�%(H�D$81�L��H��H��H��H�4�H�<L�{M)��rM�n�J�T�H�|$ L�l$A�H�t$(L� �M)�O�$�L�A�H�|$L��L�D$�S���H�D$ H����[��H�|$�uFL�d$(I�,�L9���H��H�����1�H�|$8dH3<%(�H��H[]A\A]A^A_�H�t$L�t$0M��H�|$L��L��L�T$H�T�H�|$����L�L$(L�T$M��LL$ M9
��H�l$L�\$I��H�L$0I��H�L$(u�L�d$(I�,�L9�tL9�rn��W���H��1�H����G���I�<�L�$�u�H��1�H����(���K�|'�u�H��H�������I�<�t��L�I���t�J�L�J9�t
s������I�����zR��f.�H��H9��rZ�������q���xL�W(H�WL�N(L�^I�|�K�L��/H���5H�GH�OL�FH�vH�L�H��H9���I9���I��1�I����K�4�K��N��H9�ucH��teK�t�K�L�H9�uN1�H��tNK�t�K�L�H9�u7H��H���t5K�t�K�L�H9�uH��H�����I�4�I��H9�t�H9����H���H��L)�H��5I)�L��L��L��H������H��H��1�H9���H���D���I��H��L��L��L���������1��H��A��A���노�{�����A��A���l������d���ff.��I�Ѓ���H�Qt��Hc�H�>��I��w�t�H�6H����1�I�����1�I�����M��tI����M��t=��Ѓ��1�M�����H�>A�
1�H�I��M��t��A�ƒ�A��E	�A���1��ff.�@H��H��?H1�H)�H���ɚ;vZH��?z�ZH9���H���c����
H9���X��I����o�#L9��}X��I����]xEcI9���Ѓ��ff.��H��'w'H��cw1�H��	�����@1�H��������H��?Bw
H�������ø	H����v)�I���vHL9��X��H���TH9���Ѓ��H���������fDH�GH�W(L�D�I���ɚ;w:I��'��I��c�#I��	��H��L��N�THL�W��H��?z�ZI9���H���vHI9���I���rN	�M9�wRI�����M9�A��A��H���7ff.�I��?B���	I����w1�I����@��H��H��L��J�@H�H�Gþ��H���TI9�����H��
��H���c����
I9�wyI����o�#M9�wNH��Ƥ~�I9�A��A��H����1�I���@��H���v���1�I����@��H���`���I����]xEcM9�����H���D���I����#NJM9�H�H��H���(���ff.��H�O(H�GH�|��tH�GH���zV����V��H����1��USH��H��x��>dH�%(H�D$h1��щ�����8�ugH��������uk@��uaH��H���f�����t0������D�SA��H�t$hdH34%(�
H��x[]�H�UH9St��|����D��D)��Ã��@��t�щ���@��A�ȃ�A��A9���L�KL�UM����M������H�u ��H�C��@H�K L�C(��@�T$0H�UH�m(H�t$ H��@�<$H�|$0H�T$H�D$@L�L$HH�L$PL�D$XL�T$H�l$(H�D$H�D$8�[������D��)����1�M����E1�M��A��D)������K��f.�Hc�H�fyH�
yI��L��H�<�1�M�P�L��I��uI)�L��L���u��L��H���j��f.�AWAVAUATUSL��$��H��H�$L9�u�H��H�|$H��H��I��H�T$(H�R�H�t$`dH�%(H��$�1��ɸH�T$ HD�H��H��H�D$��H����T��I��M����H��H��H��$�H�\$XH��H�H�|$pH��$��H�L$0A�H�t$hH�l$xDM��M��L�%�xA��?I��K�,�O��L�L$@H�l$HI#)H���pH�|$0�dL�l$XL�\$L�4$L�d$xI��K��L�l$pH�\$8H�D$0H��H�\$PH9���S��H)�H�t$8H�<���H��H�|$L��H��H���WG��L�D$(H�$H�d$H�t$ L��L�L$H��I��K�4�H;$�M��M��L�\$��H��L��N�,L���G��H��L��L���'K��H��H��L�D$(H����?L�L$H�
ywH��I	�H�D$H��H�t$ L��H��I��K�4�H;$tM��M��M���DM��M��H�|$H��H�L���J��L�T$@H�\$HH�D$8�H�|$PI	H9|$0����L�4$L�d$hI��Ld$XL9t$`�D���L����_#�H��$�dH3%(u H�Ę[]A\A]A^A_�M��M��M���i����nH��ff.�SH��H��dH�%(H�D$1�H�G(� t)fo7�CH�H�D$dH3%(uBH��[�H�5G_#H9w ~�H�L$�H���D$���|$H�C(u�H�_#H�S ���G��DATA��U��SH��H��dH�%(H�D$1��� t2���	�H�Gf�	�G�H�D$dH3%(u5H��[]A\�H�5�^#H9w $���D	�f��H�C��K	�@�+��FG��H�(H�L$��D$���|$H�C(uH�T^#H�C ��ATA��UH��SH��H��dH�%(H�D$1��� �`Q�����f�H�G��G�	2H�D$dH3%(u	H��[]A\��F��ff.��AUH��I�պATUH��SH��H��H��L�g(H���VQ��H��L���]#H���=Q��H�k H�C(�H��[]A\A]����ATUSH��tRH�FI��H��H�����oQ��H�5mgH���C����tRH�5NgH���C����t0H��H��L��[]A\�AD��H��\#H�5c[H�:��F��[��]A\�[H��L��]A\锷[H��L��]A\�5�D��UH��H��SQ�D��H��H����P���������H�H9�w��w	�]81�Z[]�H�=�[#H�5[H�?�[F������fD��SH��H���`D��H�����P��H���c����
H9�wH�C1�[�H�X[#H�5�ZH�8�	F����[�@��SH��H���D��H����`P��H���c����
H�H�H9�wH�C1�[�H�[#H�5�ZH�8�E����[���H��H�=�}#�vH;5�}#�
H�=�}#�[H;5�}#�H�=�}#�@H;5�}#�H�=�}#�%H;5�}#��H�=�}#�
H;5�}#��H�=�}#��H;5~#��H�=�}#��H;5	~#H��}#tH�� H�8��H;pu�@�@���VO��H�W�uH�kZ#H�H���f.�H�YZ#H�H���H�)}#����|#��t��N��ff.�H��|#��H��|#�t���@H��|#�d���@H�	}#�T���H�|$�:�H�|$�AWAVAUATA��U��SH��H���G ����A��A��A��� ���@��L�oL�w0I�}�RD��I��H����O��E����M����I�U�A�����|0����H�
�Y#�<9�`�{0���+�<9���L��M���L���L��D�;D��A��_u	@����E�g�A��~�gH��L�e@�}L9�u�A�$H��L��[]A\A]A^A_�1�L9�}���A���%L�M��M����L�sHL�kI�}�]C��I��H����N��E����N��M��~�I�U�A���C�|.����
H�5�X#L��M���>���HI��A���FA�>���'L�dX#A�;1ۅ��S���I���+���A����A�~M��A����JH�
#X#�9��������I�����A���A�<����H��W#�:������H��L9�u����A����D��L�D$@�4$�?��L�D$�4$��A��E���!D��L�D$@�4$��A���4$L�D$���D��0H���E�H��L9��	���I���6���I�������M��I��L�$�#?��L�$����A���	M��A�>���H����L��I��M��C�<.H��A�����L�
�V#A�9���_���M�������I�]�A���dC�|.����{L��V#A�:���(���I���A����L��A�<V���L�D$L��H�$�h>��L�D$H�$M�������@�����mL���C A��A��A��� t?�@�`���L�s0�[���H������L�j�A������A����J��C�<nH������L�sH�$���L�$��=��L�$����A���<K��A�<^���L�$�=��L�$���M��A���K��E�<^E��A��_u@��uE�W�A��~�eJ��E�$I��H��L9�u��j���A���3J��A�~�C����E H�����A���J��A�<^���L�$�4=��L�$�W���L�$�"=��L�$����A��
���H�!U#�8A���u���ff.�f�AUH��ATI�ԺUSH��H��H��L�o(H���K��H��H��$U#H�C(H����J��H�K L��H��H���X?���#�H�k H��[]A\A]ÐH9���UH��SH��H��H�~H�C H9=�T#�H��HM5�T#H9�uI�U����	ʈ�oEH�{H�{(CH�uH��H�u(��>���H��[]�f��� t!H9�~�H�������t�H�}�또��H���2�����I��#NJS1�H��L�WL�G(�I9�v"H��tI��1�H�JL9�@��tI��H����H����J��H��[�j�1���fDUSH��dH�%(H�D$1�H�~Hc�H��H)�H;w|H�D$dH3%(��H��[]�H����J��H��L�_(H�H��I��H��H��tH��H�5)l1�M�L�I�J�4�I�H����J��H9-S#H��H�{ HM5S#H9��\J��H�kH����H�kL�S(I�|��[����*J���;��DD�D�E��E	�A��u1��f�UH��SH��H��H��A��uKA��u<A��HE�L��H��H������H�߃�����U(H�u���H���[]�A���A�H���@M���rI��#NJAWE1�AVN�4�AUI�v��8uATI�J�*m��<�UH��SD1�E1�H�������4H�H�eHH��L�I��I����I��I��?L��I�H��L!�H�L��I��H���M�I��L��I��I�H��M�I�L��M!�O�L)�A�L�H������I�H��H��I��I�H��M�L�I��L!�I�I)�N��I��L��J��H�eJ�H��H�I��I����H��H��?H��L�H��L!�H�L��H��H���I�H��H��I��I�H��M�L�I��L!�I�I)�N��I��L��L9�teJ��H�eJ�H��H�I��I����H��H��?H��L�H��L!�H�L��H��H�����H�������H��ff.�f�H��H��H��I9��;���[]A\A]A^A_�H��I��H��?H��L�H��L!�H�L��H��H������H������H��I��H��?I��L�I��M!�I�L��H��I��'���H�������H��I��H��?H��L�H��L!�H�L��H��H��;����%���fDAWAVAUATUL��SH��XI��wH��XH��M��[]A\A]A^A_� ���M�`H��M��H�T$L�d$I��H��N�,�H�|$ L)�J�.N�4/H�D$M9���F��L��H��L�L$(N�|+H�t$H�9��H�t$H��H��J���>��H�t$L��L��M�D$L�D$@�T9��L��H�D$(L��H�L$H��H�DN�)H�T$8H��L��L)�L�T$0H�T$(���L�D$@L��L��H�t$8L�|-M��I��H�L3H������L��H��1��`3��J�;I��H��L�|$(H�T$0H�t$M��L����K�<.H��H���}���H��H��L�����H�l$H��1�H��L�,�L���3��H�T$M��M��H�t$HJ�+H���U���H�|$ H��H���%���H��XH��H��L��[]A\A]A^A_�)��f���S�GH����t �t.H�SH��[H��@��ff.�H�@��M#�C�u�H�{�tM#��f���AVAUATUH��SH��D�g,1��7��H���=F��H�=Ao#I��t:H�5o#�
H�� H�;t$D�ct�H�sL����5������E��H�� H�;u�1�D�e(�77��I��H���'F��H�=�n#t?H��n#��H�� H�;t$D�ct�H�sL���5������E��H�� H�;u܋}8D�EPAVH�2F#HcU4H�uAUWL�MH�=wPAPH��1�H�UL�E ��4��I�MH�� H�q�I�uH���IE��I�.t
H��[]A\A]A^��ME��fDAWAVAUATUSL��$��H��H�$L9�u�H��H�t$dH�%(H��$x1�H����BE��H��H���H�\$H�|$0L�BH��H�|$8�x�H�hA���H�l$hL�rL�j�L�<�L�L$p�|$$I�OL��H�D$H��$pH��L�D$PH��L�L$XH�L$HH�t$@L�d$0L�D$L�d$(L�D$H�L$8H��E1�I��N��M�Ã�t[H��t+H���yK�l�L��L��I��M�K�l��L$$I��H�K�l�I��L��L��M�K�l�I��L$$�H�I9���L�D$`M��D�L$$DK�l�L��L��M�I��K�l�D��I�H���H�L��H��K�|�M�K�|�L��I��H�L��H��K�|�M�K�|�L��I��H�L��H��K�|�M�K�|�L��I��H�I9�u�L�D$`H��t`H�l$PH�׹A�fDH�4�H��L��DL�L�!H��H��L�f�L�	H�H9�w�I��I�4.I�|-H��I9�tH���H�l$H9l$�TE1�H���t>H�I�xA�H�,H��I�J�t�L��H)�K�t�H��M�H)�����H�I9�toL�eI�xL��H��H��I��M� H)�N�L�H�H)��O�L���M��H�I�xL��H��H��L�eH)�H)��M� N�L���H�O�L�M��H�I9�u�HT$H�l$@L�D$Hl$(L9D$�����HT$L�d$HL�L$@L�\$Ld$0LL$8L9\$�n���H��$xdH3%(u<H�Ĉ[]A\A]A^A_�K�l�H��L��O�8L�A�J�l��L$$�H��]����%1����A��H9����A��A����E���&ATUSL�_(L�OL�V(L�fK�|�K�L�������H������8���L�FH�OH�oH�vH�L�H9���I9���L��1�H����M�$�I��L��I9�uo1�I��t{O�d�K�T�L9�uXI��tfO�d�K�T�I9�uCI��I���tMO�d�K�T�I9�u*I��I�����O�$�K��I9�t�ff.�@����L9�D�X��AF�[]A\����H��H��[��H9�]A\�?D�@��AN��ff.�H��H��L)�H��2I)�L��L��L��L�����D�MA�A��A��C�J���L��I��L��L��L�������u����������[����1�H���I�����k����<����1��-���f���A���A�[����1��D����A)�D�����A��A��E��uAk����Ã�k���ÉЃ�D)�ÐH����I��#NJAWH��AVAUE1�ATI�v��8uUH��SH�J�*m��<�H�&I��I��L��H)���M��H��I��?M��M�I��M!�M�I��I�L�H��I��H��I��L�A��M�E��L�I�M��M!�I�M)�N��I���s�H��J�$�I�I��M����M��H��I��?M��I�I��M!�M�I��I�L�H��I��H��I��I�A��M�E��L�I�M��M!�M�M)�M�oN��H��J�$�L�I��I��I����M��H��I��?M��M�I��M!�M�I��I�L�H��I��H��I��I�A��M�E��M�}L�I�M��M!�M�M)�N��M��L9�����[L�4�]A\A]A^A_�f.�H��M�B���ff.�@AWAVAUATUSH��hH�|$ H�t$8dH�%(H��$X1�M9���>��I��I��L��M��J��H��$PM��L)�I�T�H�H�H�D$H��#NJH�$H�rH�T$1�H��H�|$H�D$0I��?��I��?�"H�l$PH�l$@H�L$0H�|$L��L���p���H�L$0L��L��H���]���H����(L�\$ H��L�$M�wL�T$L�t$HI�v��8uI�I�L�$M�$H��#NJL�L$(O��I�J�*m��<�H�L$(1�H��IH�1H��H��H��H��H�t$H��I��IA�H��L��H��H����#NJH��M�I9��TH�|$L��H�d=�H��H��I��H��?I��H�I��I!�I�L��H��L�H�H��H��H��H��I�H��L�H�H��H)�H9�����L��E1�H�eH��H��L��L)Ш��H��L��H��?I��H�I��I!�I�H��I�H�H��H��H��H��H�H��L�H�I��H!�I)�K�<�H��H)�H)�H9��6K���|�L��H�d�L�H��H����H��I��H��?I��H�I��I!�I�L��H��I�H�H��I��H��H��H�I��H��L�H�H��H!�L)�I��H��H)�H)�H9���I��I�zL��H�d�L�H��H���)I��H��L��H��?I��H�I��I!�I�H��I�H�H��H��H��H��H�H��L�H�I��H!�I)�K�<�H��H)�H)�H9�r@K��I�zM9�����H�4$L�M����;��I��I��I�K�I��L;\$ tH�$���L)�I��I�zK��M9�t�L��L��H�d�H��H��eI���/���H!�I�M9A�����HL$I�s�H����#NJI����D��I9�w	M���+I������H�|$8��M��I����:��H�\$N�,�J�<�uTI���|J�|+�uBI���jJ�|+�u0I��I����TJ�|+�uI��I����>L�t$K�<�t�E1�A��E��H��$PH9|$�H;l$@��H��$XdH3%(D����H��h[]A\A]A^A_�I��#NJI��1�I���t'H�t$L�L$8H��I��J�H��H�t$0K��I����E1��q���H�����H9�wpH�T$H��H�d�I��H��H��H��?H��L�H��H!�H�L��H��H�L�O�0H��H��H��H��H�H��I�L��H)�I9�r�p���I!�L�I9y��`���M��1�I��H����#NJLD$@��M��I9�����H������H����#NJI9�wpH�L$L��H�d
�H��H��I��H��?H��H�H��H!�H�L��H��H�H�J�46H��H��H��H��I�H��H�H��H)�I9�r�����H!�L�I9q������I����#NJ1�I��LT$@��M9��V����m���H���=#�,���I�x�蠎H�D$H���������8���H&��H�|$��=#���A�����I���_�L�D$PH��L�D$@H����7�����@��AWAVAUATUH��H��H��SH��hH��<#dH�%(H�D$X1�H�D$H�\$PH�\$HH�\$@H�\$8H�\$0H�\$(H�\$ H�\$P1�H�T$(RH��@H�L$8QH�
�[#L�D$HAPL�L$XAQL�T$hARL�L$xL��$���#��H��0����H�|$PH9��Z�n$��H����H���c����
H�p�H9���L�d$HH�EI9��0M�t$A����H�5A`#I9��	L;%9`#��L;%4`#��L;%/`#��L;%*`#��L;%%`#��L;% `#��L;%`#��L��� ��A����H�5�_#L��� �����cH�5�_#L��� �����WH�5�_#L���m �����AH�5�_#L���V �����4A�L�=a_#K�4�L��E���2 ����t>I��I��u�H�]:#H�5�6H�;��$�����fDA�f.�H�|$@D�m4H9����"��H�����I���c����
J� L9���H�|$8H�E H9����"��H�����L9���H�|$0H�EH9����w"��H�����H����H�|$(�EPH9��	�M"��H����lA�������I�I9��_���VL�l$�E8I9���I�E����zL���"��H�D$H���wE1�E1�L�%�[#L��L������I�<$�YH9�[#��H�=�[#�>H9�[#��H�=�[#�#H9\#��H�=�[#�H;\#��H�=\#��H;
\#��H�=\#��H9\#��H�=\#��H9\#L��[#tI�� I�;��I;Cu�f�A�C���:A	�I��L;|$����A����A����(4��L�l$ D�u(I9���I�U�����L��� ��I��H���\E1�1�H��L�����I�<$��H;�Z#�6H�=�Z#�nH;�Z#�;H�=�Z#�SH;�Z#�PH�=�Z#�8H;�Z#�UH�=�Z#�H;�Z#�JH�=�Z#�H9�Z#�OH�=�Z#��H;�Z#L��Z#t!I�� I�8��I;@u�ff.�f�A�@����H��A	�L9������A�����A�����2��D�},1�H�L$XdH3%(��H��h[]A\A]A^A_�ff.�L�IY#��L�9Y#����@L�IY#�d���@L�9Y#��@L�IY#���@L�9Y#�4���@L�IY#����@L�9Y#����@L�IY#����@L�9Y#���@L�IY#���@L�9Y#�t����E(L�l$ I9��nI�}����yL���f��I��H��~L�%WX#����E,1�����A��)���L�d$HI9�����H�|$@H9�t*���H����I���c����
N�,M9���H�E H�|$8H9�t&����H�����I���c����
L9���H�EH�|$0H9�t���H�����H�����EPH�|$(H9�t.�r��H�����A�������I�I9�����w�E8L�l$I9��)�������fDA��5���A��*���A�����E1�����A�����A�����1�������H��u)H���������H��uL��3#H�5G3I�:������N������H��u�H��3#H�5�.H�8�o�����&���L��H���܎�����������jy���n�����h��H��u�L�l3#H�53I�;���������H�-N3#H�5�0H�}���������!��H���Q���H�=!3#H�5�2H�?�����������x���I�������L��H��A��t���AO��X������@L�V(L�FK�|���H����AWAVI�6��P^Cy
AUATI��UH��SH��H��H�vH�H��H��I��H��?I��I)�O��O�NL9���M�nL�} L9-@3#L��HM553#L9��w
�E ��.��L9��l
H��L�l$H�}(H�_Cy
�5��H��H��H��I�P�H��H�4�L�qL)�I����L��KM�þI��L)�M�<�H��	��H����H���]H���#H����H���������L��H��L��H��L��M�L)�I��I��	��I������M��L��H��vH��H���HD�1��7��A�$�}�����	�@�}M�L$I\$L�mL�MH�]H��[]A\A]A^A_��H���FH������H��
�|H����H��͕P�MBL��I�@z�ZH��H��*L��M)�M��f.�H����I�������N�<�M��O��H��	�H���~H����H����H���@H���������L��H��H��H��H�I)�f�M��I��I��L�I�WI��������M���ff.�H������H���vH��	�LH�SZ��/�DL��H��	H��H��Li�ʚ;M)�M������f�H����H���LH����H�����u@L��I��Ƥ~�H��H��H��L��M)�M�����ff.��H����H��4�ׂ�CL��H��H��Li�@BM)�M�����H����H���$���L��I��vHH��H��$L��M)�M���I���f�H������L�|$J��I��M��I����F����$����H��(\��(L��H��H��H��L��K��M��H��I)�I��c����f.�H����H����FH��
��H���H��͕P�MBL��H��H�@z�ZH��*H��I)�����H��(\��(L��H��H��H��H��H��H��I)����@H����H���H����H�����u@L��H��H��H��Ƥ~�H��H��I)��d���@H�KY�8��m4L��H��H��Li�'M)�M������f.�H��S㥛� L��H��H��H��Li��M)�M�����fDH�������L��I��TH��
H��!L��M)�M���^���ff.�H����v;H����H��	�`H�SZ��/�DL��H��	H��H��Hi�ʚ;I)��y���H���/H��4�ׂ�CL��H��H��Hi�@BI)��L���ff.��H���a�w̫L��H��H��Li��M)�M�����f.�H��Bz�Ք��L��H��H��Liʀ��M)�M���z���f.�H����H���$���L��H��H��vHH��$H��I)����ff.��L95�,#L��L�m HM5�,#L9�t�E �-(��L9���H��L�t$H�}(I�_Cy
�5��I��H��M��H��I�P�H��L�<�N�yL)�I��tXL�5AEM��M�u��i���@H�IGw�IL��I�d����
H��H��H��L��M)�M������ff.�@H��������M��L�4
L�Z�N��I��������K�4�L�J�I�J�4�I����k���K��H��I�J��H����R���L�<�M��M��H��H���u��7���ff.�@H�Cx�q�Z|
L��H��H��H��Liʠ�M)�M������H���ЄK8L��I��rN	H��H��)L��M)�M�����H�3"�[3/#L��I����H��H��%L��M)�M���c���H�Wx�/e�9L��I��o�#H��H��3L��M)�M���3���H�S�;\L��I��]xEcH��H��H��L��M)�M����������H�KY�8��m4L��H��H��Hi�'I)��B���H��S㥛� L��H��H��H��Hi��I)�����ff.�H�������L��H��H��TH��!H��I)����fDH���a�w̫L��H��H��Hi��I)����H��Bz�Ք��L��H��H��Hi€��I)����H�IGw�IL��H��H��H�d����
H��H��I)��l���H���ЄK8L��H��H��rN	H��)H��I)��B���f�H�Cx�q�Z|
L��H��H��H��Hi �I)�����H�3"�[3/#I��H����H��%H��I)���H�Wx�/e�9I��H��o�#H��3H��I)�����H�S�;\L��H��H��H��]xEcH��H��I)����M���#���M��H��H���w���������M�D$M�T$(���AWH��I��AVAUI��H�_Cy
�5��H��ATUSH��L��I��I�H�,ZI)���H�,�I��	�I���(I����I����I����I���������H��H��I��H��L�<�I��M�L)�1�H���	M�cM9��SA�L��L�5�@J��M)�H��O�<�L�4�M��I��	��I���I����I����I���I���������H��I��H��H��I��H�H)�I��L�K�L�I��M9��\I��M)�M���lN��H����H����H��[]A\A]A^A_��I���v��I���6I��	��I�SZ��/�DH��I���a�w̫H��	I��H��Li�ʚ;I��L)�H��I��H��H��Li��L)�fDH�������M�cM9������M����E1�N��H���B���1�H��@��H�H��[]A\A]A^A_�fDI���6H��4�ׂ�CH��I�Cx�q�Z|
H��H��Li�@BI��L)�H��H��I��H��H��Li�L)��[���ff.�M��J��I��	�1���I����I���;vII��
�oI����I��͕P�MBH��I��H�@z�ZH��*H��I��H)��#����I����I���$���H��I��H��vHH��$H��I��H)����f�I���FI����vjI��
�I����H��͕P�MBH��I�@z�ZI���ЄK8I��rN	H��H��*L��I��L)�H��I��H��H��)L��L)��!����I���FI���$���H��H��vHI�������I��TI��H��$H��I��H)�H��I��H��H��!L��L)�����H������H�IGw�IH�l�I�d����
H��H��H��H��H��L��L)���M)�tJN�<�M�L�I��t:J�L�H�OI��t+J�t�H�wI��tA�K��J��I��M9�u�DH���W���H���M���H��[]A\A]A^A_�ff.�@I����vDI��tnI��	��I�SZ��/�DH��H��	I��H��Hi�ʚ;I��H)����f.�I����I��4�ׂ�CH��I��H��Hi�@BI��H)����I���a�w̫H��I��H��Hi��I��H)����f.�I�������H��I��H��TH��!H��I��H)��^���I���a�w̫H��H��Bz�Ք��I��H��Li��I��L)�H��H��H��H��Li󀖘L)�����f�I�������H��H��TI�SZ��/�DI��H��!H��I��H)�H��H��	I��H��H��Li�ʚ;L)��~���ff.�I�Cx�q�Z|
H��I�KY�8��m4H��I��H��Hiڠ�I��H)�H��I��H��H��Li�'L)��%���DI��Bz�Ք��H��I��H��Hi€��I��H)��5���f.�I��Bz�Ք��H��H��4�ׂ�CI��H��Li‖�I��L)�H��H��H��H��Li�@BL)����f�I����I����I����H�����u@I��I��I��H��Ƥ~�H��H��I��H)�����I���vI����I����I�����u@H��I��Ƥ~�H��͕P�MBI�@z�ZH��I��H��L��I��L)�H��H��H��H��*L��L)�����f�I��(\��(H��H��I��H��H��I��H��H������@I��(\��(H��I���������H��I��H��H��I��L�<�I��L)�H��I��H��H��L�4�M�L)�������f.�I�KY�8��m4H��I��H��Hi�'I��H)��U���f.�I��S㥛� H��H��I��H��Hi��I��H)��!���fDI�KY�8��m4H��I��S㥛� I��H��Hi�'I��H)�H��H��I��H��H��Li��L)����DI��S㥛� H��I��(\��(H��I��H��Hi��I��H)�H��H��I��H��H��L�$�O�4�I��L)������fDM������J�l�H��u-I�K�H�������J�l�H��uH��H��������H�<�t����fDH�IGw�II��I��I��H�d����
H��I��H�����f�I���ЄK8H��I��H��rN	H��)H��I��H)����I���ЄK8H��I��rN	I�3"�[3/#I����I��H��)L��I��L)�H��I��H��H��%L��L)��+���ff.�I�Cx�q�Z|
H��H��I��H��Hi �I��H)��1���fDH�3"�[3/#H��H����H��%H��I��H)�����fDI�3"�[3/#H��I����H���$���I��vHI��H��%L��I��L)�H��H��H��H��$L��L)��k���ff.�I�IGw�IH��H�d����
I�S�;\I��]xEcH��I��H��H��I��H)�H��H��I��H��H��L��L)�����H�Wx�/e�9H��H��o�#H��3H��I��H)�����fDH�S�;\H��I��]xEcI�Wx�/e�9I��o�#H��H��H��L��I��L)�H��I��H��H��3L��L)��w����I�Wx�/e�9H��H��o�#I�����u@I��Ƥ~�I��H��3H��I��H)�H��H��I��H��H��L��L)������H�S�;\H��H��H��H��]xEcH��H��I��H)���M��I���S���J�,�N�$�H���"��M�s�I����0���J�l&�H��uI��I�������J�<�t��������fDATUH��SH��H��H�(H�udH�%(H�D$1�H�|����H����H9]��H��H��H���=�H�MH�6��P^Cy
I��H)�H��H��H�MH��H��?H)�H�<�H��L�zL9�tH��H9�#H��L�M HM5s#L9�t�E t)L9��@��H�]H�|$dH3<%(L��u2H��[]A\�H�T$H���Z�����A��A���;���H��I��耺�������E1��@AWAVAUI��ATI��UH��SQL�wH�_H�FL�H��H9������~(uH�UH9�gX[]A\A]A^A_�H�H��I��I)�M9�~�L�L��H��H)������t�E�UM)�M|$M�|$M�d$(E��A��K�|��E�]t�H9]~����I�L$I�t$(H��H+UH�|�H����A�M I9��g���H��L��L)��
���I�\$�M$L��Hc�I�t$(I��������tL��L������A�}����A�EE������M�D$M�L$(��@PA�}K�|�������L���"���A�M���I9�����I�T$L������A�M�����AWI��AVAUATUSH��xD�dH�%(H�D$h1�A���8��L�oL�w(H��J�4�I�T6�H�
H��tPH�oL�gN�L%I�����M������H�_Cy
�5��H��H��H��L��N�RL)�t1I������M��uDH�|$hdH3<%(H��u,H��x[]A\A]A^A_ýI������L�cM��~������m�������UH��SH��Q�����������U��H�������uZ[]�H���f.�AWf�AVA��AUI��ATI��UH��SH��fo
�H�R�L$H��$�fo��L�D$foҋL�L$dH�%(H��$�1�H�L$HH�NH��$��D$P0D$XL$hH�D$xHDŽ$��D$ �T$(\$8H9��A��I�]I�}(H�|��vM�]M�8L�R�M9���	I��H�vM�M�L�D1�M9���L�T$PH)�L��L��L��L�T$�����%��H�\$hM�D$I�T$L�\$L9�H�U��H9#H��L�m HM5#L9��e�E ����L9�����E�<$H��H�}(L��I�T$(H�t$xA��E8��\�D$M��M��L9��5I��I���(N��N��N9�����H���L�E1�L��H+A��M����I��#NJL�A�H�H����L�vM��M)�L+jM9�A��E��v
I��#NJM�L�oH����H�^I��M)�L+rL9�A��E��s
I��#NJM�L�wH��trL�FM��M)�L+ZM9�A��A��v
I��#NJM�L�_H��t@A�I��#NJN��M��I)�N+�M9�A��M�M9�MG�A��N��I��I9�u�H9���A��E��������I�_L�<����H��~J�<?��H9*#H��H�U HM5#�EH9�t� ���H9��i��H�]�D$�j���L�
D$�EL�/M����I���ɚ;��I��?z�ZM9���H���vHI9���H���rN	A�I9���I�����M9�A��A��L�Z�g�M���8���I��H���h���}L�U(H�]���A	�D�uM�l�I���ɚ;�`���I��'��I��c�=I��	��H���D$PH�4�H�LsH�M��������.ff.�f�H��$�dH3%(��H�Ĩ[]A\A]A^A_��L��H�XI����#NJM��M�i�MD�A��L�,�H9��H��H9�� ���fDL��H�XL��H9�����L��H��L��H9���L�4�L�4�H��H9�������ff.�@A�f.�H���D$PL�,�J�kL�H�]��������������H���TI9�A��E��M�\$
�@H�H���i���H��A��E���L����-���ff.�f�E�$$A��D�d$���ff.�f�I��?B��A�	I�����@���1�I����@��L�_�*���f.�I���c����
M9��
I����o�#M9��JI��Ƥ~�M9�A��E��M�[����ff.��E1�I���A��M�X���H��tCN�\�N�L�M9��_M9�v+ff.��D$I��L��H��H��L��M��f�H������f��D$H�^I��M�EH�UI9��cH9A#H��L�U HM52#L9�t�E �%��L9��hI��E�$M�EH��H�}(I�U(A��I�w(L��E8��9���L�����ff.�@E1�I����A��M�Z���f�I����]xEcM9�A��A��L�_���f�I��M��M���D$�k���f.�E�������L��M��M�s�MD���H��L�4�H9�����������L��M��M�i�MD�A��L�,�H��H9������E���������ff.�f�H����#NJL9�H�H��L�X���@H�^H�v(H�|���L��M�D$L�Q�L�;M9�����D$I��L��M�I�EM�H�\�I9���H)�L�|$PH��H�L$L���������^��I�UH�\$h����H�s�H��L�y�H��t/H�|���H���
����D$M��M�݃D$L����������M��H��I���D$���L�L$��EA�y$�(L�/����L��M��I����D$M��A�	I�AL�|$(I�Y(���ɐH�|�@�ƈL$ H��L��D��L��L�l$ L��$����H��L�y�H���H���H�|��<���H��L�<����H���&���H�|�������L�s�I�������N�\�N�L�M9������I��I��������N��N��M9��a���������M��H��I���%���I��L��H��M��L���D$E1��*���M���D$�l������EL�/�����V�����DAUA��ATI��UH��SH��H��D�dH�%(H�D$1�H�G(A�� ��H�=i#H9{ �u��H�KA���1�H��#NJI����#NJA	�H9�H����D�H�PH��H)�H�0L9��j��H�CH�1�H=�ɚ;��H='��H��c��H��	�*H�mH�kf�H�D$dH3%(��H��[]A\A]ÐA���L�cE1�H��H����#NJE	�I��#NJL9�D�A��L�`M��L)�H�H9�����1�H�sH�H=�ɚ;�V���I��?z�ZL9���I���vHL9���I���rN	A�L9�wUI�����L9�A��E��M�]�:f.�H=?B��A�	H=��wH=������L�^fDI�L�[���@A����I���TL9�����L�_
���I���c����
L9���I����o�#L9�w^H��Ƥ~�H9�@��@��L�X�H=�A��E��M�Z�i���f�H=����D��M�X�J���f.�I����]xEcL9�����L�_�$���@I����#NJI9�M�I��M�[������ff.�@USH��H��dH�%(H�D$1�H�~	H�H9G8�3@��uH�kL�S(I�|���H�D$dH3%(��H��[]ùH�L�_(H��I��H��H��tH��H�5+"1�M�L�I�J�4�I�H��,H9-	#H��H�{ HM5	#H9�uH�kH��譢���a���I�|�u�H��� �M	��H9�~��1	��H�K��1�H�������G����|�ff.��AWAVA�ֺAUI��ATI��UL��SH��H��H������1�H�����s���t$I��H���#I��H���W��Ic�H�5�D��L��H�,΋t$�m���H�l$�~D$H�D$I��E�4$D$AD$M���2��I�H�� I!�H!��uf�H��H��I��H��H��"L�H��I��I��H)���H��"H�sI��M��I��L)���I��"L���M����H9���H��I9���I�T�H��I��H����I��E1�I)�A��M���c���I��I��I��I��H��(L�I��H��M��I��L)���L��H��(H���L��H��L)���I��(L���H���]���H)�H��I9��c���H��L��[]A\A]A^A_�ff.�I��I�� H)�I��H�� H�I��L��H�� L)�rDI�� L�rRH��u�H9������H)��I��(I��L�H���U���ff.�I���A���I�� H��L�s�f.�H���H���8���H���"���I��"I��L�rH9��
������I���>���I����ff.����WAWAVAUI��ATUH��SH��H��L�wH�wH�SM�d6�I9���K(L���u!H�{I9��L9�8H��[]A\A]A^A_�H��I��M)�M9��\H�{I9���I9�}�@L)�H��I���2�L}�{$I��w1D�K$H�5�Nc�I�>A��ff.�@H��wJ�oA�]�؀�A�EM���f�����@A�]H��[]A\A]A^A_�1�H��@�Dž�t��H�uL�](H��u3I�d����
L��H��M�d�H��H�E���ff.�@I��#NJM�I��M9�A���M�I��#NJH�UH��M�|�M9�t�M�I���ɚ;wHI��'��I��c�I��	�7L�J�O��O�\QL�]L;�������I��?z�ZM9���H���vHI9���I���rN	A�M9�w%H�����I9�@��D��M�@ff.��H�r�H��L�<VM�L�}L9;�p���H���W�H�ML��H��H��H��H�L$�~D$E�?��6���f.�H���c����
I9���H����o�#I9��RI��Ƥ~�M9�A��E��M�C�\���ff.��A��E���H�����E����A�]����H�����E�����1�H��@������H�M(�t�����L�e(A�
1�I�$I��M���TH�������H��u�����I��?BvwA�	I���������I����A��E��M�C���ff.��I�������L�G�j���f.�H���TI9�A��E��M�A
�B���f�I������D��M�D$�(���I����]xEcM9�@��D��M�G�
���I����#NJM9�H�H��L�@����t�V(H�6�ϭ���L�EL�M(H��L)�K�|��I���'A�M I9����H��H��L)��!��{$L�eI��Lc�w)�s$L��
Ic�L�>��I����L��H�����A�M�Ȁ�A�EE��tL�EL�M(��@PA�MK�|��t+�E�:���H�uL��]����{(H�WtL�BL+L�GH���	���A�M��L�H�O(J�|��t̃{$�����{$L�%f
Ic�L�>��ƺH����R���A�M@�y����G���H�U(��/���A�M�C���I9�����H�}H��脠��A�M�>���M�L��H��I)�L���F�����"���M)�E�uH�uL�](L}E��A��I�|�E�U�����L;c���������Z��H��蛠���D���H�}(A�
1�H�I��M����H���o���H���p����`���E1�I��A��E���W����G���I�H���cE���ZM�SI��M9���t2M�S���A�M���1�H��@���/���A�M�"���I�CH�������M�SI��M9�A����M�S�W���E1�I��A���N����EM��t�����������EM��t���|������E1�M��A�������u�1�H���X�������L��H��H���u[H�CH��H+H�E����I�CH��vMH��#NJ�E��t9M��I��I9�A��t	M�����I��H��H9������E��u��w���H�u����ff.�f�AVI��AUM��ATI��UH��SH��u,�
��u$M����M���>�[L��]L��L��A\A]A^���M��L��H��H��L��褪����t	[]A\A]A^��MM��H��H��L��[]��A\A]A^�'V�UH��SL��H��dH�%(H�D$1�L�D$�D$�B����D$	�AtH�ھH��襞��H�D$dH3%(uH��[]���f�AVI��AUM��ATI��UH��SH��u.�
��u&��M��M����<�[L��]L��L��A\A]A^���M��L��H��H��L��袩����t	[]A\A]A^��MM��H��H��L��[]��A\A]��A^�#UUf�SH��fo
�pH�WdH�%(H��$x1�HWH�D$p�D$0H�Z�D$L$(H�D$8H����H�����H�I��fo{pH��XLI�H�H�l$hH�l$H��"H�L$PH�L$@H�t$`H��H��)T$@H�D$X�K����|$@�������H�D$ HD$@��������������H��u?H��H��$xdH34%(u.H�Ĉ[]�H���ԓ����H���H���œ����H���H������AUI��ATI��UH��SH��H���u[H�VH�F(H�|�t-L��H��H��������t�3H��L��L��H��[]A\A]��A�}$t�L��H��H���ӥ����tπ#����UX��u�Eu��z���X[]A\A]�ff.�AUI��ATI��UH��SH��H���uUH�VH�F(H�|�t&L��H��H���g���H��L��L��H��[]A\A]��A�}$t�L��H��H���:�����tπe����W��tX[]A\A]�u�����DAWAVI��AUATUH��SH��8H�T$H�L$dH�%(H�D$(1��H�GH�G������+��1Ҁ�-�sA�>@��n�@��N��@��s��@��S��@��i�g@��I�]���E1�E1�E1�f���E����e����.���`�D��L�C�DH��A�vI�FM���{��I�Ƅ�u�M����M��� �K�H�t$ I�|$�
�H���������A�|$����H�T$ �:����L��H�EL)�M����I���c����
L9��DL�uH��H��Ngm�I9��}	H��I9��W	I�_Cy
�5��H��I��H��L��I��M�J�4BH)��%L�RL�] L9�"L��HM5�"L9�����H�}(L�UA��I��I�GI�I�M9��-E�?A��0Mc�M�1H����H�HL9����O�<���0H�N�xM�A����H�AL9����	��0O��Hc�N�4RM�1A����H�HL9����O�<���0H�N�xM�A���8H�QL9����O�4���0H�J�pH��I�	A��t?A�M�}H�BL9���L��A����0Hc�H��J�FI�	D9�u��M���OH���O���H�T$H�t$��H�D$(dH3%(�^H��8[]A\A]A^A_�ff.�f�M���|�����0���M���k���@M���'A�^I�FM��SՁ��C���A�^I�F�5���ff.���I�����^�v���f�H���(���H�E��"��H��������H9�t
H��H9���L��ff.��H��L)�M���*���I��I���c����
M)�M9�M�D$�H��M9��\I��������H�uM�L9������L)�H�u����fDD��C�DPuT@��.����E�^C�DX��I��E1�M	���A�^I�FM��� ���f��^I��1��n������M�����A�N��nt	��N�����E�~A��ft
A��F�{���A�~�?��H��胕�����A�N��n����N�~@��it�@��I�4����DA�N��a�K��A�B@��st�@��Su��L����� �������L�\$L)�I�Mck(H�D$L)�H9���E1�I�6��P^Cy
H��H��I��H��?I��I)�O�$�O�fL)�H��H��I��M����L95��"L��L�] HM5��"L9���L�uA��H�}(M�f�H��~8N��I�GI�M9�uI��H��E�A��0Mc�M�1A���������M��L��N��M�MI�@��E1�M��I)�A����H�p�O�4���0H�N�pH��M�P�����I����I��t$�O��H�v��0H�N�XH��M�P������O�<�H����0H�N�xH��M�P���ui�E�K��H�pA��0Mc�M�WM�P���to�HO�4�H�p��0Lc�O�tM�X���tPH�p�@K����0Lc�H��M�WM�P���t.H�pL9���O��I����0Hc�N�$QM�`����q���I��I9��m���H�����ff.��H�H�@K�4���0H�L�pH��M�A���n����&���I�EA�M�k����L��A��L����0H�J�PI�	A9������L�����H�H�@K�4���0H�L�pH��M�A���`�������L�QH��L���Y���A�v@��i�gA�^��n�KA�N��i�/A�~@��t�E�fA��y�<A�~�m���H�T$�H��讒���i���A�F<at<A�q���A�v@��nt
@��N�\�����H��賑��A�~�(���M�~A���0���������H��Dz�T���E�gI�wL��B�Db�?���E�GI�wL��B�DB�'���E�OI�wL��B�DJ����H��D�L��B�DRu�����Mk�
L�ȃ�0Lc�M�M�P�������L�����A�v@��nt
@��N�������H���Ґ��E�fE���D���M�~A��0���!��E�L��H�M��B�DCtOE�OI�wM��B�DKt;E�WI�wM��B�DSt'E�_I�wM��B�D[tH��D�.M��B�Dku�E���D���E���#������I��E�'A��0�n�����M��I������I���j�������@��T��������I���������N���������@��I���������A��Y��������H��H�]���H�M������ff.�@AVAUI��ATUH��H���"SH��PdH�%(H�L$H1��D$H9������H��H�����L�HH�@0f��L�`L�H@L�t$L��L��fo%�bX L��fo-�bH�@����H�I��XLI�I�H�T$8H�T$`0)l$L�T$ H�D$(�KL�\$0��t$��A�
��H��t$��X������H�L$HdH3%(H����H��P[]A\A]A^�1���0H��H����H�HH�@0L�`f�H�H@�L�t$fo
�aH��!@ H�T$L��H�@����fo�aH��XLI�A�H0I�� H�t$ L��H�|$0L��)T$H�D$(�KL�D$8��D$�Au*%�������H�+�n�H��1���������q��L��L���Q����D$��?�fDAUI��ATI��UH��SH��H��H�(dH�%(H�D$1��� uH�5P�"H9s ���1�M��xP���H�C	ȈH�GL�/H��H�C�ͅ��L��H���"�H�D$dH3%(u'H��[]A\A]úH��?I9����I�ݹ����fDAWI��H�dAVI��AUATUSH�T$�HcL�,��dH�I��N��I��H�L!�L!�H�L$�1�H�\$��,f�H��H�|$���I��E1�H��I)�A��H�|$���H��I��H��H��"L�H��H��H��H)�H��H��"H�H��I��H��H��I)�H��H��H��"L�A��H�D$��~D$�E��I���
I9���
H��H��H��H��H)�H��H��"H�H��H��I��I��H)�I��H��"H�I��L��H��L)���
I��"L�H�\$���
H����
I9���
H�\$�D$�H��I��AB�I9��M�M��1�H�t$�M�L�L��I�zL�H�T�H�t� @��H��L)�H��HD�I9����I��L��L)�M9�wFI��1�M���M��M)�H��MD�M9���L��M�D�H)�L9��Q���L��I���f�L��ff.�H��I��H��H��(L�H��H��H��H)�H��H��(H�H��H��I��I��H)�M��I��H��(H�A��H�\$��~D$�A��L���I9���H��H��H��H��H)�H��H��(H�H��H��H��H)�H��H��(H�H��I��H��H��I)�H��H��(L�A��H�\$�E��I�u	I9��d���L)��W���ff.�f�H��H�� H)�H��H�� H�H��I��H��H�� I)�H��H�� L�A��H�\$��~D$�A��H���I9���H��H��H��H�� H)�H��H��H�� H�H��H��I��I�� H)�I��H�� H�A��H�\$�E��M��<���L)����f�L�d$�L�t$�A�M��L��L��I�σ�L)��I��H��L)�I�Ã���H��tnH��t5H��vM��I�\$M�M�D$I��M��L��H�΃�I��L)�I1�I9�vO�,�M�<�I�EI��M�}H��L��L��H�΃�H��H)�I1�I9�vO��M��M�M��M�H��L��L��H�΃�H��H)�I1�I9���I��f�M9�vK��K�4�H�(K�,�H�0I��L��I�̓�H��L��H)�I1�M9�vK��O��H�:K�<�L�
M�}L��I�σ�H��L��H)�I1�M9�vO��K��M�O��I�M�ML��I�Ƀ�H��L��H)�I1�M9�vK��K�4�H�(K�,�H�0I��L��I�̓�H��L��H)�I1�M9��3���[]A\A]A^A_��I���0���H�D$�L�d$�L�t$�H�l$�M��O�$?1�I��N�4�L�d$�H��N�d�K�;L�t$�L�d$�L�L�T��FDH��M�L���L)�I9���L��H��H)�L9�vL�M��I�<�HD$�H9D$�v_H�T�I�<�E1�L��I��I��I�A��L��L)�M��ID�I9����I��H�t�I)�H9��w���H��L��z���I9�w��}��I���&���L�d$�L�t$�I��H�T$�I��O�L&L�d$�L�bL�L$�H�|$�H�t$�L��1�H�I�44J�<�L�E1�L�J��I��M�A��L��L)�M��ID�I9��?�M��H�I)�L9�vM�I��E1�M�A��L��L)�M��ID�I9����M��H�>I)�L9�vM�L��H��H�|$��^I��E1�H��I)�A��H�|$��2H��I��H��H��"L�H��H��H��H)���H��"H�sH��H��H��H)���H��"H��1H����I9���L��E1�H��I��I��H9�A��H)�M���lH��"H�I��M��I��L)���I��"L�sI��M��I��L)��hI��"L�I����M���;L9��2J�<�Hl$�L�J��L�H;l$��^���H�\$�I��H\$�L;d$��/���H�d$�M������ff.�H��I��H��H��(L�H��I��I��H)���H��(H�sI��L��H��L)���I��(L���H����I9���L��E1�H��I��I��I��H9�A��I)�M����H��(I�I��L��H��M)��
I��(M�sH��I��I��I)���H��(L�I����I9�v
M�������M)�J�<�Hl$�L�N�4�L�H9l$��)�������f.�I��H��I�� H)�I��H�� H�I��L��H�� L)��iI�� L���I9���H����L��H��I��I��I�� H)�I��I�� I�I��M��I�� M)��UI�� M���M���=���M9��7����/���ff.�@I�����I��(H��L�sH��I9�vH��tff.��L)�L��E1�H��I��I��I��H9�A��I)�M���p����I���`����L)��#����H�������I���A����L)�H�\$��~D$��C���L)�H�\$��~D$��Z���H��(I��I�sI��M�������;���H�����H�����H��"H��H���H���Q�L)��X���H������I�����I���3���I��"I��I�r^M9��
�����I���W���L)�H�D$��~D$�����I��"H��L�H�\$�rH�����L)l$��_���H���o���H����I���ff.���AVAUATUSH�F����H��H�5�#I��H9��9H;~#�H;y#�H;t#��H;o#��H;j#��H;e#��H;`#��H������Ņ���H�5#H����������H�5#H����������H�5�#H�������toH�5�#H�������tqA�L�5�#K�4�H��D�������t,I��I��u�H���"H�5��H�:�<������f�A�l$41�[]A\A]A^ý�����۽��1��н�ɽ��f�AWAVI��AUATI��USH��H��(H�~(H�vdH�%(H�D$1�H�|����I��H����I�L$H9���H)�H�6��P^Cy
H��H��H�KH��H��?H)�L��H��N�BL9���H��H9-��"I��LMx�"I9���L�[ M9���H��H��H�{(L���ȴ���;H�kA�4$I�ǃ���	�@�3M�d$L�cH�|$dH3<%(L���6H��([]A\A]A^A_�ff.�@A��A���o��I�� ��H�S(fo�QCH�E�$�+A�����D	�@�+M�L$L�K�x���H9��"I��LM��"I9���L�[ M9�tf�� �m�M9��;�H��H��H�{(L���̳��I���H�kE�$���A��D	؈I�D$H�C���H�5!�"H�C(H9s <fo
�PKH���L��L��H��E1��6�����A��I��������H�L$�H���D$�|4�|$H�C(u�L���"L�S �H��H��H�{(L��L�T$�
���L�k H�L$I��I9������ ���I9�������ff.�@AWI��AVM��AUI��ATI��UH��SH���6H�Z@�������H9Y��H�EH�	H��H)�H9��~I�T$I�|$(H�|���M�D$I�t$L��H)�H�H9��LH��xaL��L��L���������dI�]I]H��H;]�L�EI��L+EL9��H��L��H��L��[]A\A]A^A_���@H��L��L��L��L)��<���I��H������}$I�]�D�M$L�B�Oc�M�>A��ff.�H��wZ��I�EM�����@L�T�L9U�iL�]I��L+]M9��TA	6�F���H����A�E��f�I�UH���3H��#NJM�M(M�I��I9�A����M�H����E����I��#NJM�YI��M9����KM�YH��vs��toH��#NJI�AH��H9����AI�AH��vG��tCI��#NJ�M��I��M9�A���AM��H��#NJI9����L���r��I�EH�}H9��=I�]M���oL�d�L;e�!H�MH��H)�I9��
A�@���ff.�1�H�5o�"H��M�M H9�HM�L9��m��t�f.���H��1�L��������I�E�"���H���	A�E�^���I�E�@����1�H�������@���I�E���1�H������I�E(�
1�H�H��M����H���	���H��u����I��H��H9������E����������A�$t
A��~�YL��[L��]�A\A]A^A_�y��M��H��L��L��L��苄����t�X[]A\A]A^A_þ�?���M�}(A������n���1�H��������I�E�����I�AH��v�������I�UH���r���I�AH��v����������AWHc�H�d�AVAUATI��UH��SH��H��H��(L�,�I�u�L���|P��I��H�����L�}�L����D��H��H���B���u�L��G�1�I�H�� M!�L!�ff.�L��H�L�L��I��H����I��1�I��I)���M����I��H��I��H��"L�I��M��I��L)��A
I��"L�sI��M��I��L)���I��"L�H�T$��
M����L;l$��H��H��I��1�I��H9���H)�H����H��"H�L��H��I��I��H)���H��"H�sI��M��I��L)��NI��"L�H���M
M����L9����~L$H�T$L$�H��L9�����D��H��H��A�Ѕ�����H������E1�H�� H��"L!�L!�ff.�@L��L�{L�KL�SH�#H���UI��E1�H��I)�A��H���H��I��H��H��"L�H��I��I��H)��H��"H�sI��L��H��L)��I��"L�H�L$�BH���L;l$��L��E1�I��H��H��H9�A��H)�M���_	H��"H�H��I��I��H)���H��"H�sI��M��I��L)���I��"L���M����I9���L��E1�I��I��I��H9�A��H)�M����H��"M��H�I��M��I��L)���
I��"I�sI��L��H��M)���
I��"M�L�\$�eH����
L;l$��
L��E1�I��I��I��I��H9�A��I)�M���>H��"L�I��M��I��L)���I��"I���M��I��M)���I��"M�L�|$��
M����M9��|�~\$H�L$I��H�� �~d$\$L�|$[�d$c�L9�������H��([]A\A]A^A_�DI��H��L��H��H��(L�H��I��I��H)�� 	H��(H�sI��M��I��L)���I��(L�H�T$��M����L;l$��H��H��I��1�I��H9���H)�H����H��(L��H�H��H��H��H)���H��(H�sH��H��H��H)���H��(H�H����H����I9����~D$H�L$D$�H��I9������7���ff.�@I��I�� H)�I��H�� H�I��M��I�� L)���I�� I�L�T$��M����L;l$��H��H��I��I�� H)�I��H�� H�I��L��H�� L)���I�� L�H����H����I9����~L$H�D$�b���H��I��H��H��(L�H��H��H��H)���H��(H�sH��I��I��H)���H��(H�H�D$��M����L;l$��L��E1�I��I��H��I��H9�A��H)�M����H��(H�I��L��H��L)���I��(I�L����I��I��H)���H��(H���M����I9���L��E1�I��I��I��I��H9�A��I)�M����H��(I�I��M��I��M)���I��(M�sI��L��H��M)���I��(M�L�\$��H���vL;l$�kL��E1�I��I��I��H9�A��H)�M����H��(H�I��M��I��L)��]I��(I��gM��I��M)��kI��(M�L�L$�kM���vM9��m�~T$H�L$�~t$T$L�L$t$I��sH�� I9���������fDH��H�� H)�H��H�� H�I��I��M��I�� L)��>I�� I�L�\$�BM���L;l$�L��I��I��I�� H)�I��H�� H�M��I��M��I�� L)��I�� I�L���I9���M����L��I��I��I��I�� I)�M��I��H�� L�I��H��M��I�� L)�I��I�� I���L�d$D��M��HM9��?L��I��I��I��I�� I)�M��I��H�� L�I��I��M��I�� M)�L��H��I�� M���L�d$D��I��H��M9���H�����~l$H�L$�~t$l$t$+�V���H��(H��H�H��sH��I9�v
H������@L)������I������I��(I��L�H�T$sI��M��uL;l$w
DL)l$H��E1�H��I��I��H9�A��H)�M���v����I���e����L)l$�5���fDI�������H���U���I��(H��L��!���fDH��I��I��H)�����H��(I��H�sI��I9�vM��tL)�L��E1�I��I��I��I��H9�A��I)�M�������I������I��(I��L�I�������I��M��I��M)������I��(I��M�L�L$sI��L;l$v	M���=���L)l$�3���I��"I��L�I���2����I��M��I��M)��&���I��"I��M�L�|$��M�������ff.�I������I���"����H�����H��(I��H�H�T$sI��M��uL;l$wL)l$L��E1�I��I��H��I��H9�A��H)�M���Z���f.�I���G����I���8����M)�L�d$�*���M)�L�d$���L)��N����L)l$���I�� I��L�H�T$�����I�����I�� I��L�H�������I�����L)l$���H��H�5PH�
�'D��HF�H�=ZPH��H��HF�H�L$H��Ѕ��b��L�D$M�����D��H��A�Ѕ��>��H������@�H�����I������H���k���H���T���I������I��"I��L�H����M�������;���I���j�I��"I��L�H�T$��M������L)l$��I����H���_���I���9���I������I��"H��M�L�\$��L;l$�M��L)l$�6���H�����I�����I��"H��L�H�L$rBL;l$����L)l$��I���4�I��"I��L�rM������L)��R�I����H���I�����I��� ���I�����H���[���f.�AWAVI��AUATUSH��xH�VdH�%(H�\$h1��D$,�������fo.<H��I��H��XLI�H�H�=��"H�\$@H�)D$0H�D$H�KH�L$PH�t$XH9��H���e���I��M���	fo�;f��M�GHM�gA�G0AO AW0I�]I�G����M�G@H���E�D$�yH�����l$E�mA�
I�G0��0M�oHA�oI���ɚ;w&I��'��I��c�E1�I��	A��I��M�G(H�T$,H�t$0L���q����T$,��A��A�n(A��A��E	f,��D�d$,��D����H�\$hdH3%(L����H��x[]A\A]A^A_�I��?B��A�	I�����o���E1�I����A��I���X���I� I�mL9��0��f���H*��YG;f/G;���I���������L,�M�JM9�����L9
n�"L��HM5c�"H��~!H�T$,L��L�$�$p�������M�G@L�$H���L�t$M���T�H�$I��H��#NJI�H�,$H�$M��H�����M�^@I�3M���I�@H��H��H��H��I�I���&I�KO���@L��H)�H��H��H����tlH��t@H��tH��H�!H��8H��H��H�Q�H��H��H�!H��H��H��H�Q�H��H��H�!H���H��H��H�Q�H��I9���H��L��M��ff.�H��H�!H���H��L�AH��H�H��L��I� H���H��H��I�H��H��H�!H���H��H��H�H��I�HI�`H�rgI�HH��H��I�PI9�u�M��I��H��H��u-H�4$A�L�I��H����#NJH9���I��d���I�M9��I��K��I��I���M��I��H��H��H��H�Q�H��I9��{����M��L�t$I�������E�oI�w@I�G M�G0A���D
l$E�oJ�|�H���ɚ;��H��'��H��c�hE1�H��	A��I��I�P�L��H��H�BI�L9��"M�G8HM5��"M�W(L9��0L�l$,L��H�t$0L��蝼���T$,��A�,����4���E1�I���A��I�����H���D$�z���E1�I����A��I�����H��?z�ZH9�wJH���vHH9���H���rN	A�H9��&���I�����L9�@��D��I������H���c����
H9���I����o�#L9���H��Ƥ~�H9�@��D��I������I�GHL��I�G0�0[������E1�H���A��I�����H��?BvcA�	H�����t���E1�H����A��I���]���H����]xEcH9���D��I���@���I����#NJI9�M�I��I���$���E1�H����A��I���
���H�v��8uA�H�I�I���o��K��H�zH9�@���;��K�<�H9�������H��f.�I���TL9�A��E��I��
���A�� ����L�l$,L��L���xb���������D!�L�T�"������I�;����A�k�zM�kM����1��c���H��H����H�=o�"�q�-s�"�IH�=u�"�W�-y�"��H�={�"�=�-�"��H�=��"�#�-��"��H�=��"�	�-��"��H�=��"���-��"uVH�=��"��L�%��"�I�� I�<$��A�l$t�I�t$H��������y��y��1�H���0I�����H�5:�"H�������y��N��H�5��"H���ҧ�����1����2��H�5��"H��趧�����I������H�5��"H��蚧�����������I�� �i���H�5%�"H���u��������������H�=��"L�5��"tA�nuJI�� I�>u�H��L���ܥ��H�+����I�/�������H�5��"H���������Y����t��I�vH�������y��_���~��ff.�f�AWAVAUL�-c�"ATUSH��H�BL9�u"H�A�H�H��D��[]A\A]A^A_�H��A��L��H��I��H���ɥ��A�ą�ueH�S���tL��H��L��E1�����H��H�EA���E��t!H�=��"H�RH�5ؼ1�H�?�����|���H�
r�"H�H�M�h���H�]A�H��U���f.���USH��H��H�5+�H��8dH�%(H�D$(1�H�L$H�T$ �D$�ң������H�T$ H�t$H�ٿ��������H�T$H�t$H�ٿ�������H�=�"�#��H��H���2��H�D$H�t$H�}H�KL�D$H�PH�v�`H�|$H�/t9H�|$H�/t5�t$H���n'��������H�\$(dH3%(H��u-H��8[]��W�����P�����H�|$H�/u	�>���1���1��豤�����SH��H��H�5��H��dH�%(H��$�1�H�L$H�T$襢�����H�T$H�t$H�ٿ�������H�T$H��H�ٿ�y�������H�=ھ"��!��H��H���r��H�D$H�$�oH0H�p@�o@ �PL$8�oY0�oQ H�t$H�y��H�t$PL�A@��@D$(��T$X��@\$h@�|$PH�|$ L�D$x�T$ �V��1�H�{�����1ɉ��#���H�|$H�/tDH�<$H�/t3H��H��$�dH3%(u+H�Đ[�H�|$H�/u�ϣ��1����ƣ����迣����8������SH��H��H�5|�H��0dH�%(H�D$(1�H�L$H�T$ �+�������H�T$ H�t$H�ٿ��������H�T$H�t$H�ٿ�����tuH�=b�"�] ��H��H���$��H�T$H�D$H�zH�p�jU��1�H�{�����1ɉ�����H�|$H�/t?H�|$H�/t-H�L$(dH3%(H��u(H��0[�H�|$H�/u财��1���諢����褢�������ff.�f���USH��H��H�5[�H��8dH�%(H�D$(1�H�L$H�T$ �D$��������H�T$ H�t$H�ٿ������H�T$H�t$H�ٿ��������H�=5�"�0��H��H���f��H�D$H�t$H�}H�KL�D$H�PH�v���H�|$H�/t5H�|$H�/tO�t$H���#����ucH�\$(dH3%(H��uKH��8[]�苡��H�|$H�/t�t$H���d#����t������f�����1��H�|$H�/u��P���1���Ǡ�����f���USH��H��H�5�H��8dH�%(H�D$(1�H�L$H�T$ �D$貞������H�T$ H�t$H�ٿ�������H�T$H�t$H�ٿ�������H�=�"����H��H���?��H�D$H�t$H�}H�KL�D$H�PH�v����H�|$H�/tOH�|$H�/t=�t$H���N"����uH�\$(dH3%(H��u7H��8[]�H�muH���1���1����(�����!����H�|$H�/t�1��苟��ff.���USH��H��H�5˺H��8dH�%(H�D$(1�H�L$H�T$ �D$�r�������H�T$ H�t$H�ٿ�c�������H�T$H�t$H�ٿ�D�������H�=��"���H��H������H�D$H�t$H�}H�KL�D$H�PH�v�@+H�|$H�/t9H�|$H�/t5�t$H���!�����+��H�\$(dH3%(H��u-H��8[]���������H�|$H�/u	�ޞ��1���1���Q������AVAUATUSH��H��H�5��H��0dH�%(H�D$(1�H�L$H�T$ �D$�<������H�T$ H�t$H�ٿ�-�������H�T$H�t$H�ٿ��������H�=o�"�j��H��H������H�T$H�D$L�eL�rL�h�@um�BugL��L���al��1�L�����1ɉ����H�|$H�/tnH�|$H�/tj�t$H�������u@H�\$(dH3%(H��u]H��0[]A\A]A^�H�KL�D$L��L��L���~a����u��y���H�muH���v���1���m�����f����H�|$H�/t�1���М����USH��H��H�5�H��8dH�%(H�D$(1�H�L$H�T$ �D$�š������H�T$ H�t$H�ٿ�������H�T$H�t$H�ٿ�������H�=��"����H��H���7��H�D$H�t$H�}H�KL�D$H�PH�v耵��H�|$H�/tOH�|$H�/t=�t$H���^����uH�\$(dH3%(H��u7H��8[]�H�muH���A���1����8�����1����H�|$H�/t�1��蛛��ff.���ATI��UH��SH�� dH�%(H�D$1��D$�q��H������H�(H������1�H�t$H��H���y����1�H�t$H��L���_����H�=��"���H��H���5��H�|$H�T$H�KL�D$H�wH�RH�x�K���H�|$H�/t7H�|$H�/tg�t$H���)����ujH�T$dH3%(H��uRH�� []A\�����H�|$H�/t+�t$H��������t����H�|$H�/����H�l$��ٚ����H�l$��K�������fD��ATI��UH��SH�� dH�%(H�D$1��D$�!��H������H�(H���f��1�H�t$H��H���)����1�H�t$H��L�������H�=p�"�k��H��H���j��H�|$H�T$H�KL�D$H�wH�RH�x���H�|$H�/t7H�|$H�/t3�t$H��������u@H�T$dH3%(H��uKH�� []A\��ę����轙����H�|$H�/����H�l$�H�m����H��1�萙���H�l$�����f���AW1�AVAUATI��USH��8H�=��"dH�%(H�D$(1�H�T$ �D$������� ��H�\$ H����H�+����H�=I�"�D��H��H������L�@A�D$L�{M�t$�����L�l$���L��L��L��L���/����t$H���������H�L$(dH3%(H����H��8[]A\A]A^A_��p�H��H���e��H�(���H�=��"���H��H���C��L�@A�D$L�{M�t$L�l$�������Z���f.�L��L��L��L���߳���t$H��������P�������聗������ff.����AW�AVAUATUSH��L��Ic�H��H��hH��T$TH�‰�)�H�t$XH���t$PH��H�|$ H��H�T$H�D$�v�������T$TH�|$��荥��H�D$@H������H�T$ H�<�H�|$HH9�sB��A�L�l$ H�l$@L�t$L�|$HI��ff.�f�L��H��L��M����M9�r�H�T$H�t$H�|$ �����$LcD$TL�R���H��D��O�,���J��H�|$H�D$(��L�\$H�\$ H�D$I�I�M!�I��H��M!�I��H�\$8L�\$0ff.��H�\$(L�d$��ff.��L��H���%%��H��H��H��M����H��1�H��H)�@��M���KH��H��H��H��"H�H��I��I��H)���H��"H�H����M��I��L)��/
I��"L���
M���NI9��EI���|A���R���H��H��M���`���H��H�� H)�H��H�� H�H��I��H��H�� I)�H��H�� L���D��H��I��H��I9�vH��t�L)�I��H��u�ff.�L��H��H���$��H�|$I���#�L$PL�d$H�|$ L�T$8I��J�<�Ld$0O���DI��I��I��H��"H�I��M��I��L)��3	I��"I�sI��L��H��M)��	I��"M�L�$$��	H���	L;,$�	H��E1�H��H��H��H9�A��H)�M���EH��"H�H��H��H��H)���H��"H���I��I��H)���H��"H��1	M����I9���H��E1�I��H��H��H9�A��H)�M����H��"H�H��I��I��H)��yH��"H���L��H��L)��gI��"L���H���gI9��^H��E1�I��H��H��H9�A��H)�M���AH��"I��H�I��L��H��L)��%I��"L�sH��I��I��H)��H��"H��4M���0L9��'�~$H�4$H��$G�L9���H��H�wH�'M����H��E1�I��H)�A��M������I��I��I��H��(H�I��M��I��L)���I��(L�sI��L��H��L)���I��(L�H�$�aH���OL;,$�EH��1�H��H��H��H9�@��H)�H���H��(H�H��I��I��H)���H��(H���M��I��L)���I��(L���M����I9���H��E1�I��H��H��H9�A��H)�M����H��(H�H��H��H��H)���H��(H��I��I��H)���H��(H��vM���I9��H��E1�I��H��H��H9�A��H)�M���/H��(H�H��H��H��H)��XH��(H��gI��I��H)��H��(H��M��uI9����ff.��L)������H��H��H��H��(H�H��I��I��H)�rEH��(H��H�rQM��I��L)���I��(L������I��I9�vM�������f�L)����H��(I��H�H��s��I���I��H��I��I��"L�H���L���I���C����I��I��I�� I)�I��H�� I�L��H��H��H�� I)��:H�� L�H�$�@H����L;,$��H��H��H��H�� H)�H��H�� H�I��I��L��H�� L)���I�� I�L����H����I9���H��I��I��H��I�� H)�I��H�� H�I��L��H�� L)���I�� I�L����H���.I9��%H��I��I��H��I�� H)�I��H�� H�I��L��H�� L)��\I�� I�L���cI9������H���������H��(H��H�H��������H�����H��(H��H�H������H�����H��(I��H�H���h���I���\���H��"H��H�H���&���H������H��"I��H�H�������I���t����H������H������H�������H�D$H�|$H9|$�j���L�D$L9D$t*H�|$@���"�T$TH�|$���қ��H�D$@H���	���L$XA�L�L$HI��L9L$ s0H�\$@L�l$L�t$HL�d$ fDL��H��L��M��_���M9�r�H�|$@�/�"�H��h[]A\A]A^A_�ff.�H���n����H������H�������L)������L)��o����L),$�
���I�� H��H��L��8���H���,���H�� H��I�L�$����f�H�����M��H��I�� L������H�����M��H��I�� L��,���H��� ����L)����I��(I��L�sI��I9�vM���M���f�L)��<����L),$���H�����I�����H��(I��H�sI��I9������M���������H���K���I���:���I��(I��L��*����!���I��"I��L���M����������I������I��"H��M�L�$$r~H�������L),$���H��"I��H�rnM���b���L)��>���I��"H��L�rVI9��}���L)����H������H��"I��H�H��r M���E�������I���X���H���y���I����I���H���I���6����1���D��AWA��AVAUATUSH��H��H��I��H��hI��H�|$ H��D)�D��T$XH��H���D�l$4H��H�|$H�T$D�ʉD$\�z���H�D$HH������H�l$ H�|�H�|$PH9�s>D��L�l$ L�d$HL�t$L�|$PH��f�L��L��L��I����M9�r�LcD$XL�^��H��D��O�,���=��H�|$H�D$(��H�\$L�L$ H�D$I�I�M!�H��I��M!�H��L�L$@H�\$8fDH�\$(L�d$��ff.��L��H���5��H��H��H��M����H��1�H��H)�@��M���KH��H��H��H��"H�H��I��I��H)���H��"H�H����M��I��L)��_
I��"L��$M���NI9��EI���|A���R���H��H��M���`���H��H�� H)�H��H�� H�H��I��H��H�� I)�H��H�� L���D��H��I��H��I9�vH��t�L)�I��H��u�ff.�L��H��H�����H�|$I���#�L$4L�d$H�|$ L�\$@I��J�<�Ld$8O���DI��I��I��H��"H�I��L��H��L)��c	I��"I�sH��I��I��I)��O	H��"I�L�$$��	M���O	L;,$�E	H��E1�H��H��H��H9�A��H)�M���EH��"H�H��H��H��H)���H��"H���I��I��H)���H��"H��a	M����I9���H��E1�I��H��H��H9�A��H)�M����H��"H�H��I��I��H)��yH��"H���L��H��L)���I��"L���H����I9���H��E1�I��H��H��H9�A��H)�M���AH��"I��H�I��L��H��L)��UI��"L�sH��I��I��H)��AH��"H��dM���0L9��'�~$H�4$H��$G�L9���H��H�wH�'M����H��E1�I��H)�A��M������I��I��I��H��(H�I��M��I��L)���I��(L�sI��L��H��L)���I��(L�H�$��H���L;,$�uH��1�H��H��H��H9�@��H)�H���CH��(H�H��I��I��H)���H��(H���M��I��L)���I��(L���M����I9���H��E1�I��H��H��H9�A��H)�M����H��(H�H��H��H��H)���H��(H��I��I��H)���H��(H���M���KI9��BH��E1�I��I��H��I��H9�A��H)�M���\H��(H�I��H��L��H��L)��RI��(I�L���^H��H��H)��9H��(H��9H��uI9�����L)������H��H��H��H��(H�H��I��I��H)�rEH��(H��H�rQM��I��L)��I��(L������I��I9�vM�������f�L)����H��(I��H�H��s��I���I��H��I��I��"L�H���L���I���C����I��I��I�� I)�I��H�� I�L��H��H��H�� I)��jH�� L�H�$�pH���'L;,$�H��H��H��H�� H)�H��H�� H�I��I��L��H�� L)���I�� I�L����H����I9���H��I��I��H��I�� H)�I��H�� H�I��L��H�� L)��I�� I�L���H���^I9��UH��I��I��H��I�� H)�I��H�� H�I��L��H�� L)���I�� I�L����I9������H���������M��H��I��(L�������H�����H��(H��H�H������H�����H��(I��H�H���h���I���\���H��"H��H�H���&���H������H��"I��H�H�������I���t����H������H������H�������H�D$H�|$H9|$�j���H�T$H�t$H�|$ �����$L�l$L9l$t*H�|$H���"�T$X�L���Ǝ��H�D$HH���a���L�L$PL9L$ sB�L$\A�H�\$ L�d$HH�l$L�t$PI��f.�H��L��H��L��O���L9�r�H�|$H��"H�T$H�t$H�|$ ����A��A��H��h[]A\A]A^A_�f�H���>����H������I������L)�����L)��?����L),$����I�� H��H��L�����H�����H�� H��I�L�$�����f�H�����M��H��I�� L��p���H���d���M��H��I�� L������H�����L)����I��(I��L�sI��I9�vM������f�L)������L),$���H���f���I���Q���H��(H��H�sH��I9�����H����������H������I���
���I��(I��L��������I��"I��L���M���
������H�����H��"I��I�L�$$r~M���ӳ��L),$���H��"I��H�rnM�������L)�����I��"H��L�rVI9������L)��j���H�����H��"I��H�H��r M����������I���(���I���y���I����I���H���I���6����u���D��AWH��AVI��AUATUH�-��SH��H�|$8��H�t$H��Hc�H�|$p�T$T1�H�\�dH�%(H��$�1ɹH����H�D$0��L�D$0M��N��M�L�L$hM��M�M9��|L�l$8L�\$xL��$�L��L�\$H��L�d$ L�H��I�|�H�|$(�@H9�����H�t$ H�|$H�����H��H9������H�t$ H�|$H���q��I���L9��e���H�t$H�|$H���M��I���L9�wI)�L�$M�&I��I��I�o�I��M�U�L;t$(��I�M�e1�H��H�T$L�@��H��H)�H��HD�H9��4���M�L�L�D$H�,$rGH;$�Y���H�t$H�|$H���
��L�H�������H)�����I)��0����H)$�f.�H)����I)��,���H�|$H�T$T��I�I�I!��h/��L�\$0H�|$8I!�H�D$@I�C�H��L�|$H��L�\$(H�D$XH�D$ H�|$`L�t$H�t$ H�|$@H������H��H��H��I����	��H�|$0I���H�L$(H�t$X�L�D$`H�T$8H�M��L�<�L�$ff.�H��I�I�'H�|$��I��E1�I��I)�A��H�|$��I��I��I��H��"L�I��I��M��I��M)�I��I��"M�I��M��I��M)��QI��"M�M���dL9�L�T$��M����L��H��I�����H��H��L��I������L��H��L��H������H�|$M�w�I��I��L9<$����L�d$0Ld$(H�|$ �:H�D$ ���DI��I��I��H��(L�I��I��L��H��M)�H��I��(M�H��H��H��I)��HH��(I�M���HH��uI9�L�D$�&���I)��L��H��I�����H��H��L��H�D$���L��H��L��H������M�w�L�t$I��M�w�L9<$�3�������ff.�H��I��H�� I)�I��I��H�� I�I��L��H�� M)�H��I�� M���M��D��I�u	L9��T���I)�M���I���H�l$8H�\$HL�d$hD�l$TL�t$0L�|�I9�vD��L��H���x���t
L���H��$�dH3<%(u[H�Ę[]A\A]A^A_�H��(H��I�M��sH��L9������H����������I��"I��M�M��rM���t�������gw��I������AWH��L�<�AVAUA��ATUH��SH���T$l1�H�|$HdH�%(H��$�1ɹH�t$PH��L�$�H�D$ I��L�d$8I9�vD��L��H�������L���Hc\$lH�5��H�|$PH�,މھ�-+��A�A�L�T$HI�� I��"LT$8H�D$XI!�I!�L�T$`L�D$L�L$(L�T$@H�D$0H�t$0H�|$XH�����H��H��H��I�����H�|$PH�D$�KH�\$@A�E1��I��I��H��I��H��"L�I��M��I��L)���I��"I���M��I��M)���I��"M�L�|$��	M����L9���H�t$L��H�����H�t$L��H��I������L�|$I��D$I��H��C�L9t$ ��H�;H��L�����H�D$L���~D$H�cH�|$��I��1�I)���H�|$(����I��I��H��I��H��(L�I��L��H��L)��4I��(I�sH��H��H��I)���H��(I�L�|$��H������H)l$@L�|$L��H��L���
��L��H��L��I�����I���
���@I��I��I�� I)�L��H��H�� I�H��L��H��H�� H)�H��H�� H�@��H�D$D��I�uH9�w�H)�H�D$�u���I��"I��L�I���8����I��M��I��M)��3���I��"I��M�L�|$��M�����������L�t$8Lt$@H�|$0t<H�D$0�a����H��$�dH3<%(�fH�Ę[]A\A]A^A_ËT$lH�|$p���L�t$8H�\$`I�H9\$Hs�L�|$HL�l$`L��$�H�t$xM��I��L�D$L�D$M�H�t$I��O�T�L�L$(L�T$0�%ff.��H��H��H��H��"H�H��H��H��H)���H��"H�sH��H��H��H)��rH��"H�H����H����H9���L�H���H9���H�D$H��M���I��1�H��I)���M���mH��H��H��H��"I�H��H��H��I)���H��"L�sH��I��I��H)���H��"H�H���M����H9���H��pH9���H�D$H��M����I��1�I)���M���`H��H��H��H��H��"I�H��H��H��I)��H��"L�sH��H��H��H)���H��"H�H���WH9��H���I��`L�L$(L�D$ L9��ب��H�t$H��L�T$���H�|$L�D$ L�L$(H��$H9�wH)�I�>I��I��I��I�]�M�g�L;t$0�?���M�I�M1�I�>M��I���M��I)�H��MD�L9������I��L9������H�D$H��M����H��1�H��H)�@��M�������H��H��H��H��(H�H��I��I��H)���H��(H�sI��L��H��L)��&I��(L�H���&H���/H9��&L�H�������H)�H9��~����i���ff.�H��H��H��H��(I�H��H��H��I)��H��(I�sH��H��H��I)��kH��(I�L���kH���tL9��kI�L�������H)�H9��������ff.�f�H��H��H��H��H��(I�H��H��H��I)���H��(I�sH��H��H��I)���H��(I�L����H����L9���M������I)����fDI��H��I�� H)�L��H��H�� H�H��H��H��H�� H)�H��H�� E1�H�A��H��I��H��H9���H����I��.���I)��&���@H��I��H�� I)�H��H��H�� L�H��I��I�� H)�I��H�� H���H����H��I��H9���M����H�H�����������I��H��I�� H)�L��H��H�� H�H��H��H�� H)�H��H��H�� E1�H�A��H��I�uJH9�vEL�H����������@I)�����H��H)�����DH��H)��\���DH��H)��H��(H��L�sH��H9�v	H������H)����H��(H��L�H��sH��H��u	H9�����H)����I��(H��I�L��sH��H��u	H9��@���H)��8���H)�����H��(H��I�L�|$sH��H������H;l$�����
���H�����H������H���e���I���8���H��"H��H�rsH���{����.���H������H��"I��H�rZH9��e����4���H������H��"H��H�rH9��O����:���H���M����Ql��H����I���<���H����֣��I����ۣ��ff.��AUI��ATUH��SH��H��D�A���H�RH����H9���L�mL�c L9-�"�L��HM5�"L9�uG���A��H�SH�{(D	؈L�EL�kH�u(L�CH�]H��H��[]A\A]�Hm���� ��L9�~�L��H���x-����t-D�]�H�UL�m�H�������E����H��[]A\A]�ff.��H�uH�E(H�|���H��A��H��L��H��L�D$����H��H���t�H�CA��t�A�}$L�D$�A�M$H�-�Hc<�H�>���H���&L�[M���H��#NJH�K(H�1L�NI9�A���lL�	I����E����H��#NJH�AL�hI9�@����L�iI��vm@��thH��#NJL�IM�QI9����hL�QI��v@��t<H��#NJA�J�4�H��H9�A����J�4�H��#NJH9��ġ��H��L�D$���L�D$f�E���p���A��ڀ�A�H���\�����@A��N���Du�L�K(A��0�������E1�H��A��E��t����H��t���	������E1�H��A����J��I��M9��D���E���"����6���H��D��H��1�[��]1�A\A]�s��H��L��L��H��L�D$���H�t$�������H��H��H��H��[]A\A]�=+��L��H���"���E���H�AI��v0�������L�[L��"I�sH�{ L9�IL�H9�������q���L�[��H�AI��v@������L�[�A����L�[�L�[(A�
1�I�I��H���s���H���t���H�������e���H�I��v"E�������L�[�Y���E1�H��A���{���L�[�@�����AUH�
��"ATUH��H��H��SH�-�H��hH��~"dH�%(H�D$X1�L�L$L�D$�D$H�\$H�\$��e�����L�l$I9���L�d$ H�=i�"1�L���h��������H�D$ H���&H�D$H�(�����o@H�|$)D$ �oH )L$0�oP0)T$@L9�t�u�������������D$DH�=��"��H��H��t}H�s�H�UL��L�D$����t$H�|$����u{H�T$XdH3%(H��u}H��h[]A\A]�I�}H�5ǂ"H9�t'��e�����G���H��|"H�5�xH�8�_g��1��L�d$ I�u�L���H�|$H9��0����E���H�+u�H��1��f���p����f���f�H�D$H��t�H�(���L�l$�ff.���AVH�
�"AUATI��H��H��UH�;�SH��hH�-�|"dH�%(H�D$`1�H�D$�D$H�l$ H�l$P1�L�L$(L�D$��c��ZY����L�t$I9��|L�l$ H�=m�"1�L���f���������H�\$ H���?H�\$H�+������oKH�|$)L$ �oS )T$0�o[0)\$@L9��IM�D$L�5�"M9���H�l$I�$H�}L9��~H�E�Db��H��H�����L�HH�@0f�H�UL�H@I�t$H�xL��fo%p�@ L�D$H�@����`0�V���I�,$���H�muH����d���t$H�|$�����H�L$XdH3%(H����H��`[]A\A]A^�f�H�5�~"L���qc�����	M�T$A�����L��H��H�=�~"�d���I��H����H�\$H�l$H�}L9�uuH�EH�=i~"�4a��H��H����H�SH�C0f��H�{fo5p�H�S@I�t$L��k H�UL�D$H�C����s0�F���I�,$���ќ��fDH�5�}"�b�����w���H�E�����H��H��H�=�}"虲��H��H���M����L�qy"I�RH�5�y1�I�;��`��1����I�~H�5*"L�l$ H9���I�v�L��L���H�|$H9�t�,���x���������D$DH�\$M�D$L�5:}"M9��a���I�$���L�-�x"H�P1�H�5yI�}�Z`��I�,$��1������Cb��H�+�M���H��1��b������a���������H��x"H�5gt1�H�:�c�����H�\$�u����Q�H��H�D$H����H�(�^���L�t$��������AWAVI��AUATI��U��SH��H��(�����H�~H�F���T$L�,�
@���I����H���M����L9�IL�H��H��H��H��H���������x"I��H�����M���,@��@��@�ŀ��M����H�{H�s(H�t��L��L9s�H���ɚ;�xH��'�;H��c��1�H��	�ƒ�1��.�L�[I���tL��H+sH�����\$���M9���� �w�L)�M�<$H��([]A\A]A^A_�f�@����M����L9�A�IL�H��H��I��H��H���ٙ���|w"I��H���Ǚ������ff.�@A�-I�L�CL�K(K�t��L9s���N�7L�T$H���ɚ;��H��'�H��c��1�H��	�ƒ�J�7��H�{H��H���>M9�u�\$������+����L����� ��E@�8L)�yL���-L)�H�x�HH���ɚ;�H��'��H��c��1�H��	�ƒ�1���� ������%H���}���ff.�@1�H����ƒ�����ff.��1�H����ƒ�����ff.�����tH�~��A�I��H��H���5�����u"I��H���#����3@���w@��@����@�ŀ�9	@���y����NaNH��L�kM�������L�s(K�t�H���ɚ;��H��'�HH��c�nH��
҃�1�H���Y�L�kI���P���H�s(1ɺH��J�4�I���0�I����+�����@M��H��L)�H���H��H��H��H���:�����t"I��H���(�����D���H�x�-M����c���ff.�L�K(H�L$H�|$L���H��L�D$I�4���L�T$I�������H�L$L�[(�H��I�t�H�L$�e�H�T$L�B�I����T���H�{(H�L$�L�D$J�4�H���3�L�D$I��I����"�����ff.�H��?B�C�	H���������1�H�����ƒ����ff.�f�L��M��0.L�_I��f�M��~ �0L��L��L�T$�aX��H�t$I��I�H�{H�K(H�t��H���ɚ;�iH��'�H��c��1�H��	�ƒ�1�L���O�L�SI���C���L�[(1ɺH��L�T$K�4��%�L�T$I��I���������H��?B�C�	H��������H�����҃�����H��?z�ZH9�wqH���vHH9���I���TI9��҃��p���DI��?z�ZL9�wqI���vHL9���H���TH9��҃��M���DI���c����
L9��I����o�#L9��UI��Ƥ~�1�L9��ƒ����H���c����
H9���H����o�#H9��DI��Ƥ~�1�L9��ƒ�����1�H����ƒ��s���ff.��1�H�����ƒ����H�{(1ɺL�\$J�4�H����L�\$I��I���u�L��H+KH���s���I��H���@�0L��H+SI��M)�L9��R�����ff.����q���H�Infinity�@H��H�x��!���ff.��H��?B���	H�����f���H�����҃��U���1�H����ƒ��A���ff.��1�H�����ƒ��w���ff.��I��?z�ZL9��I���vHL9���H���TH9��҃������A�-H�@�3���H��?B���	H��������H�����҃�����H�FH������I��?z�ZL9��H���vHH9���I���TI9��҃��{���H���rN	H9���I�����I9��҃�
�s���I���rN	L9���H�����H9��҃�
�d���I���c����
L9���I����o�#L9���I��Ƥ~�I9��҃����H����҃����L�KL�S(K�|���I�E�A�H�I��H����I�M������L9�IL�����H���c����
H9��H����o�#H9��QH��Ƥ~�H9��҃��P����sNaNH�����H����҃��-���I���rN	L9��H�����H9��҃�
����I���rN	L9��,H�����H9��҃�
����H��?B���	H���������H�����҃����H���҃��������M������I��?z�ZL9�w6H���vHH9���I���TI9��҃��=�����~���I���c����
L9���I����o�#L9��mH��Ƥ~�H9��҃��������H��A�H�I��H����L�r��/���H����҃��������I���rN	L9���I�����I9��҃�
���H����]xEcH9��҃���A�+I�M���S������I����]xEcI9��҃����H���_���I�A� ��A�+H�@�3���H���q���I����]xEcI9��҃����H����]xEcH9��҃���������I����#NJI9��҃����H����#NJH9��҃����H����]xEcH9��҃����I����#NJI9��҃��n���I����#NJI9��҃��_���H����#NJH9��҃�����ff.�@��ATH��H��USH���H�� dH�%(H�D$1�H�t$���������CPH�L$1�H�|$��H�q��ƒ����H�|$H��H�/tqH���x����H��L�d$�vT��H��H��t#�@ � �g����@�V���H�{0H��L���U��H�|$��j"H�L$dH3%(H��uOH�� []A\�1����S��H�������H��L�d$�T��H��H��t��@ � ���@���H�{0���R��f���AT1�UH��SH��H�=�"dH�%(H�D$1�I��L����S�����ˌ��H�$H����H�+�ٌ���KP1�H�uL��ɹ�ƒ���H��H��������H��L�$$�CS��H��H�����@ H�� �n����@�]���H�{0L����S��H�<$�ji"H�L$dH3%(H��u	H��[]A\��Q���T�H��H��t�H�(�-���1҃{PH�u���L�����H��H��������H��L�$$�R��H��H��t#�@ H�� �Nj���@�����H�{0L���=S��H�<$��h"�T���ff.���USH���G�u4�i���H��H��taH���N��H�+H�������H���Q��H��H��[]èu;�uQH�=�l�N��H��H���x���H���RN��H�mH��uH���`Q��H���H�$g"H�5-h1�H�:��Q����H�=Al��M��H�����UH��SH��dH�%(H�D$1����H��H��tRH�(�	����@P1�H�uH�����ƒ���H�,$H������H�=�kH��1��N��H��H���g"H�L$dH3%(H��uH��[]��P��D��AWAVAUI��ATUSH��H��(dH�%(H��$1��D$DH�D$X����H���9H�(H�������1�H�L$XH�T$PH��H�5�k��M�����	H�|$PH�W�����H�t$H�#M��H��H����L�d$HM�����;�D$�T�uPfom�H�=�jH��$�H�|$�~T$��)�$������fo�A�G>Ƅ$�-fD��$�fl��$�f֔$�D�E����E���x���D��$��Ƅ$��;tH�D�E�Q�A���hA��^�^fDŽ$� D�E�s�A����E1�A��^��H��$�D�?A�Gը���A�� ��A��0��I����L��H�I��B�Dy�>L��$�E�#A��,��
A��.�[A��у�ߍq�@������%����N��	A�;�(�|$��L�d$XM���MH��$�H��1�H���H��H��H��H���&
H�D$�	
L��$�H��1�L���I��I��I��I���!
H�D$�
fo=V�f�H��M�MH��$Ƅ$�0��$�H���c����
�$��$�H��$�H9�$���I�D��E1�B�Dy���$�@�� �@��+�'A�E��
�D$`<e�O
�n<f��<g��A��H��$�H����	�H��$�L�|$`D��L��L�L$ I���H�D$�D~D$fEl�D)D$`H�������L�]L�D$ A�;��H�UH������$��������H�l$xH����H��1�H���I��I��I���|$L�D$H��
H�t$H1�H���:M��I��M���AH�|$�H�|$���|$�{
H��t	H���b"H��$dH3%(L���QH��([]A\A]A^A_�M�cL��$�E�M��D��$��T���<%�L��$�A�� H�T$DL��L��D�T$�
������
H��$�D�T$M��H��$�A��H��x>H���c����
H9���
L��H��L�D$`H��L��$�D�T$L���x�D�T$M��A�uI�QI�I(H�|��}�D$`�%�������Յ��L�gL��$��7@��$�D�A��0����L��E����L�gƄ$�zL��$�D�H�|$D��$�Ƅ$��H��L�T$H�I��E�ZB�DZ����A��0t<�I��H��$��
L���I���K��H��$�A���"t	�������H��_"H�5UeH�:�J���|$��	E1�����H�t$hH9��`����}�D$C1�H��H)�L�T$`@�|$(H�}�H�T$H�|$xI��H�L$CI��M�n�I��H�T$ J�t����|$CI��H�D$x����D�\$(L�D$L�L$`A��z�A��<��E�{�A���_L�|$E1�A��=��M��L��L��L�D$8M��L�L$(K�<L�\$0�5H��L�T$8L��1�L�D$0L�L$(L9���1�I9���H��L���A��I���I�#d����
H�T$xH�T$L9������L�l$E�ME�Q�A����H�D$ A�� ��A�}M�6M�UH��A�D~twA�uM�UH��A�DvtcE�EM�UL��C�DFtOE�MM�UL��C�DNt;A�MM�UH��A�DNt'A�}M�UH��A�D~tI��A�2H��A�Dvu�M��M)�L�t$(��.�3M��L+\$L)�I��H�E �8�D���L�E(A�8�6���E1�M��M��L��L��H�D$xUAVH�L$8H�t$0L�T$HL�\$@�c�Y^�H�L$`H�y�N�H�D$xH���/���L�D$0L�L$8UL��AVH�L$8L��H�t$0��XZH�|$�!^"���L�L$�2G��A�L�C��L�L$����L��L�~M�L��$�D�VC�DS�����RF��H��$��
L���I���G��E�$H��$�A��"�����A�������L��$��2���H��$��y]"��$�����H��$��^]"�
���I�y�x���L��$�L��H��1�L�D$`L��D�T$��M��D�T$�I����|@�<H���7���L�t$M�L�\$I��M��
���L���F������L�d$M�,$L�l$I��M�,$����L����E������M�\$A��� ��H�5!aL���E��H�D$H��t"H����F��H�D$H�������H�� H��$�H�|$XH�5�`�NE��H�D$H��t%H���F��I��H���ǂ��L�` H�D$L��$�H�|$XH�5�`�E��I��H��t#H���nF��I��H���u���L�@ I��L��$�H��$��v����@���H�-�Z"H�5s`E1�H�}1��E�����I�,$�����L����D�����H��$��?�����M�K�GA�gL��$�A�;NAELj�$��iD��H��$��o(L�P�$�L��$��ԫ���A���L��$�����M�1�M�L9�t!E1�M9�u	H��M���B�tC�4I�����D~L$ L�l$`H�l$ L�t$xDL$fD�L$`I�D)L$`C�.�g���L�d$�����H���ŧH�D$H������H�� H��$�����A�����L��蔧I��H�������L�P H�D$L��$�����H�
�^H�=�^H�|$�~d$L�
�^I�sH�L$L��$�H��$�d$�$�A�{.����I����I���c����
L9��p���<f����<g�CH����I9U(�	���D�T$L��$�L��L�D$`H��L�����M��D�T$����A������I��M��L+L$L)�I�����H�PA�H��$����$����$�zH��$���~���<%�����A�� �|���L�|$E1�A�>D�W�A��t
@�� �����I��I����L�{A�L��$�D�#D��$��.�A�ʀ���H�L$L�iH�L$ �[���H�D$�H�L$H�H��H)�I��I�����E1����M�E0M�m@K�|���D�T$H�����I���A��uA�I��E�9E��u��G���H���=���x���fDŽ$���,�I�|$�B��I��H���|��H��L��H��L���B��C�'�D$A�_�o�� ���A��@���H�

W"H�50\H�9�A������H)���H�
�V"H�5�WH�9�vA�������D$��L$D�D$E�6{��L��V"H�5�W1�E1�I�:�6A���j�Ƅ$�1��Z��
@���<����}���}��ff.�AWAVAUATUSH��dH�%(H��$�1�H�G�D$,H�D$�G���A�A��H�-�V"�0L��H��H��H�����I����V"H��H����~���H��H��H��I��H����~����V"H�C(H����~��f��H�T$H��C�Aog0�AoWH�L$0H�k �Ao_ �H�C)d$PD�l$TL�l$,M��)T$0)\$@�����t$,L���N���f�Ʌ���fo-��H��$��D$`0�D$,L$hl$xH��$���\}��H�{(L�CJ�|��M����}��L�M����}��I���������L��E1�I��H��L�<�M�M9���H�kI���|��I���O�	�	HkL9���|��f��H*��^5�f/5���|���=�f/��E�H,�H��H�����|��A�H��I��H��H���x|���,U"I��H���f|�����H�sL�C(I�|���H�SH���|��H�|$`L��H��H�|$� �����|��L�l$+L�|$xL��$�I��#NJL�l$M�l$L9���|��I�O�K�<�O�T��H�����I�4�1�A�@I��HH��I��H�H�q�H���tuI�4�H��I��HH��I��H�H�q�H���tTI�4�H��I��HH��I��H�H�q�H���t3H��A�@I��I�H��I��I��H��H���u�ff.��I�:I����H����I����{���D$`����z����E{��L���;��I��H���A{��H�xJ��L����=��L���xS"M��~G�t�E���%M�o��t�uL�SL�c(K�|�tI��M�o�����H��$�dH3%(L���H�Ĩ[]A\A]A^A_��\��H,�H��?���ff.�f�I�:�����M���(����1�I���������L��L�VI��H��H��H��I��H��H�<�H�H9����I��(\��(I��L��I��L�VI��I��L��I��H��L��M�M9������L��I��I��I��I����ff.�f�H�{(�&R"�����H��R"����ff.�f�A����9��I��H���TE�.L��D�hE1��Q"A�O��A���\�����L��H��H��H���y����Q"I��H����x�����x��L�SL�[(�K�|��u���H�SH����x��H�|$`L��H��H�|$�����������x��fDM��M������C�t�M�M��������M����C�T�M�]�����M�����H���(���L�$�O�T �H���M����I����#x���D$`����w����Kx��I����)x��L���8��I��H���Gx��H�xJ��L���:��L���~P"M������C�|�I�m�����I��� ���M��tI��C�|�taM������E1������t/L�-1O"H�5�TE1�I�}��9�����A��>����8��L�=�O"H�5�PI�?E1��9�����M���}���I�}�A�|��m���I����M��u1I��O�T �I������M������I��O�T��I���������I������6w���:w��D��SH��1�H�� H�=3s"dH�%(H�D$1�H�T$�A9������w��H�D$H��t0H�(��w���H��H�����H�L$dH3%(uH�� [���H��t�H�(u��w���7��D��SH��1�H�� H�=�r"dH�%(H�D$1�H�T$�8������w��H�D$H��t5H�(��w���H��H���U���H�L$dH3%(uH�� [��*7��腗H��t�H�(�Yw���@��AVAUATUSH�� dH�%(H�D$1��G�D$��5L�gH�=�q"1�H�T$�8������w��H�l$H����H�m�nw��H�=MQ"�4��H��H����w��H�xH�@0f��L��foU�H�x@H�T$H�xH�@����P X0�������:w���C��L�C0L�K@K�|����L�k H��H��H�C �!���H�+H����H���|6��H����v��M��I��?L��L1�L)���6��I��H����v���
�(6��I��H���Sv��H��L"L��H���p"I�,$H����v��I�.�hv��H���lv��H��H��M����$5��I��H����u��H��H��Tp"H�mI����u��H����5��L��H��2p"H�+I���}H���5��I�,$��M���8v��M���/v��1�L��L�����3��I�mI���v��I�.��H�L$dH3%(L����H�� []A\A]A^�f.�I�,$� M����u��M����u��L��L���1��q3��I��I�m�NI�.u��%u����Zo"H�mI����u��H����4��M���wu����4��I��H����t��H��L��1���3��H�+I����I�m��u��I�.�����t���G�H��H����t��H�(��t��H�=zN"�E1��H��H����H�SH�C0f�H�{fo
��H�S@L��H�T$H�C����C K0�������I�C��H�K0H�s@H�|���f.�E1�H�C H��H���E�H�+H��uH���3��H���%t��M��I��?L��L1�L)��4��I��H����s���
�P3��I��H���]s��H��I"L��H���m"I�,$H����s��I�.�(����s��@L�k �Z����u+H��I"H�5�JE1�H�8�3�����L���2������H��H"H�5�JE1�H�:�o3���|���H����2��M��tI�m��s��M�������V����/2���s���/s���s����r��ff.�AWAVAUATI��UH��SH��H��XL�D$dH�%(H��$H1�������L�jL�vK�|5H��H�|$8M9��~I����H�T$H�t$H��@�	H�T$L�L$H�r(H�4$I�q(I����H�L�4$I��#NJI�J�*m��<�I�&I��H��?I��I��I��L��I��I�M!�M�I��I�L�I��I��L��I��L�I�v��8uH��M�L�I��L!�M)�H�L�$M��L�D$HH�D$@H�FI�"I��I��nM��L��I��?M��I�I��M!�M�I��L��rI��#NJM�I��L��I��L�I�v��8uH��M�L�I��L!�M)�L�L�t$PL�T$HI����H�L�,$I�J�*m��<�I�eL�I��I��I��H��?I��H��L��I��L�M!�M�H��I�L�I��I��L��I��L�H��M�L�I��L!�H�M)�L�|$XH�D$HH�FH�4$H�fI��I��M��M��L��I��?M��I�I��M!�M�I��L��:I��#NJI�tI�v��8uH��H��I��I�H��M�L�C I�M��M!�I)�H�5�F"M�L�\$XH9�L�l$PHL�I9����� �NL9���L�{(H����H�L$@I�H�L$8H��vfH�|$HI�H��vWL�l$PM�oH��vHL�L$XM�OH��v9L�T$`A�H�D$@M�W H��vJ��K��H�L$8I��L9�w�f��L�C �mA2,$����L�d$H�|$	�@�+M�\$L_L�[I��H���\f�L9�L�[IL�L9���O�|�I���ɚ;�I��'�=I��c��I��	��I��K��I�DSH�C�H��$HdH3%(�~H��X[]A\A]A^A_��H��I��I�p(H�O(I��#NJL�{(H�H�v��8uH�!I��I��I��I��?M��I�I��M!�I�H�J�*m��<�I��I�L�H��I��H��I��I�H��L�H�H�5�D"I��L!�L�M)�I�H�L$8M�W�mA2,$D�#I�˃�A���D	�@�+M�@LGL�CL�C H�������H�<�I�|?������L�i�A�I���~���I�|?�M���o���L�Y�I���a���I�|?��U���I��I���G���K�|�t��:���f.�H�T$H��H�������x���H�L$8H�5�C"L�{(H���F������f.��� �#L9��v��O�|�I���ɚ;��H��?z�ZI9��YI���vHM9���I���rN	A�M9���H�����I9�A��E��I���ff.�@H����H��L�T$@��r
��1���L���H�I����H��H�4$L��L��M����H�L$8H��H�5�B"L�C H9�HM�L9�� ���L�{(H���4�������A�f.�I��O�4�O�sM�L�[�����H���TI9�A��E��I��
��DI��?B��A�	I����w�E1�I����A��I���I���c����
M9��mH����o�#I9���H��Ƥ~�I9�A��E��I���L���ff.��E1�I���A��I���)���L��I��L��H��?I��L�I��M!�M�H��I������H������I����L��H�t$M��H�T$I���t���ff.�E1�I����A��I�����f�H����]xEcI9�@��D��I�����I��M�sI��I��#NJM��H�J�*m��<�I��?M��M�I��M!�M�I��I�����ff.�@H������H��I���{���DI����#NJM9�M�I��I����H�T$H����L�{(L�[���L�<$L��L��I��H���H�L$8H���v���L�T$@�E���H�T$H��H���A��L���L�D$H��L��H���9��������A�$��0D�UA��uL�eL�E(K�|��AD1кH�߉ƃ����k����v(��I����褖I��H���r��L�\$H�D$I�KL�@L�h(I�s(H��t<L��L���-���u
H�{(�n?"H�L$8�#H�5G?"�L�{(H�K I���S���H�L��L��L���+����H�T$H�t$H�J(L�N(H�$L�L$ H����A�I�� L9���p��H�4$H�|$ L��L��L�D$8�e
I��M���\����.q���uI�t$I�L$(H�|�t3E�H�߉ƃ�����D���H�T$�H���2��-���L��L��貙H��H�D$8�e�I��H����p���L���<�H����p��H���;�H����p��H�$H�t$ L��M��M��H��H�D$(��H�|$(�>"���AUATI��UL��SH��H��dH�%(H�D$1�L�l$�D$M���x�L��L��H����7���D$	E�A��p��H�D$dH3%(uH��[]A\A]��H&���AWf�AVI��AUATI��UH��SH��H��x�2M�VL�L$fo
���@21H�JM��H�RM�\$(����dH�%(H��$h1�L9��D$00H�D$`D$8LN�L$HI�|�H�D$X@�|$@�t$��M�l$I�M)�M+n��M��M;(�oL9��I�vI��I)�I��I9��6L9���L9-�<"L��H�{ HM5<"H9���� ��z��H9���M�VL9��H�5P<"H�U I9�H��IM�H9����E ��z��H9���z��I���nI�F(I�L$I�|$(L�M(L�C(L�H����H�1�I��I�I�I���9L9�H�{ IL�H9���� L�\$(H�L$ ��H9��=y��L�kH���]��D�L�l$(H�CA���D
\$D�M�UL9S�"y��L�t$ I���GL95d;"L��H�] HM5U;"H9����E ��H9���x��L�uH������D�E�D$0L�}A���D
D$D�E����x�����H��$hdH3%(�H��x[]A\A]A^A_ÐI9��:����M�VL9��sL9�:"L��H�} HM
�:"H9�t�E �/y��H9���x��L��I���#I�t$I�|$(M�f(L�M(L�C(M�$H���"H�1�I��I�I�I����L9-=:"L��H�{ HM5.:"H9��X���L�kH��L�\$(H�L$ ����D�3L�d$(H�CA���D
t$D�3I�$H9S��w��L�t$ I����L95�9"L��H�} HM5�9"H9�t�E ��H9��]w��L�uH���S���uL�}���@
t$@�u�D$0���Lw����p�����v��DL9������L9�������y���f�M9T$��������L9��ZL��L��H���i������t$1�1�H���`,������ff.�L�kH��L�\$(H�L$ ���D�L�\$(H�CL�t$ A���D
D$D�M�+L9k�����Vv��fDK�|�M���U���I��I���G���J�4�I�|0��3���M�i�I���%���I�|0�����I��I������K�|�t����H�ιL�f�1�I�����I��#NJH��I��J�H��I��K��L�f�H��I��J�H��I��K��L�f�I���t@H��I��J�H��H��I��K��H���t!H��I��H�H��I��I��H��H���u�f�I��R���H��L�D$(L)�H���7L�T$0H�L$L��L��L�T$ ���L�d$ L�\$(��tH�L$HI�vL�iI)����H�L$�	1�H�ߺ�0���1�H���!�����L�M(K�|��?���I��I���1�����t��L��L��H���;���t�L�}�t$1�1�H���2*������H��H�L$L��H��L)�������p���L�}���M��L�T$(L�\$ I����t��I�N(I�T$(H�u(H�{(M�D$�Q���ht��L�C(H�L$(L�\$ ����M��I���L��L�D$0L��H)�H�L$L��L�D$ �}��L�L$ L�\$(������I�D$I��L+t$HM�nI9�t'L9-6"L��H�{ M��HM5�5"H9��u�������M��L9��E����
������H�T$H������L�\$(H�L$ ���H�T$H��L�t$����L�t$��H�T$H��L�\$ �^�L�\$ ��������-�����r���AWf�I��AVAUI��ATM��UH��SH��H��Hfo
�D�6dH�%(H��$81�H�D$0D22�$0H�D$(�A��
D$L$�uvH�RH�K(H�|���I��M��H��M��H��L���Z����$���<u����Eu��L��L��L����.��H��$8dH3%(��H��H[]A\A]A^A_�����u�D�A���EtUE��u;A���L���R���H�vH�}(H�|��tKA���L���/��A�$�L��L�������k���E����t��A��1�1�L���Z'���M���L�¾L������8������ff.���USH��H��H�5�7H��8dH�%(H�D$(1�H�L$H�T$ �D$�������H�T$ H�t$H�ٿ�u������H�T$H�t$H�ٿ�du������H�=�6"���H��H���Rt��H�D$H�t$H�}H�KL�D$H�PH�v���H�|$H�/t5H�|$H�/tO�t$H���.�����ucH�\$(dH3%(H��uKH��8[]����H�|$H�/t�t$H������t��s�������1��H�|$H�/u�����1���W���s��f�AWf�AVI��AUM��ATI��UH��SH��H��Hfo
4�dH�%(H��$81�H�D$0�$0D$L$H�D$(�u~�uyH�RH�K(H�|���I��M��H��M��H��H��L�����$������)s��L��L��L����+��H��$8dH3%(��H��H[]A\A]A^A_�M��L��H��H��L��������u��Et4L��L���8���H�vH�}(H�|��u�L�¾L��������r��L��H��L�����L��L��L���O+���[���H�|$(�?1"�$�8����\r������ff.���USH��H��H�55H��8dH�%(H�D$(1�H�L$H�T$ �D$��������H�T$ H�t$H�ٿ�r������H�T$H�t$H�ٿ�r������H�=�3"��H��H���1r��H�D$H�t$H�}H�KL�D$H�PH�v���H�|$H�/t5H�|$H�/tO�t$H���^�����ucH�\$(dH3%(H��uKH��8[]��K��H�|$H�/t�t$H���$�����t��q���&����1��H�|$H�/u����1������eq��f�AWf��AVI��AUM��ATI��UH��SH��H���	fod�fol�L�L$fo?�H��$�L��$�L��$�L��$�dH�%(H��$�	1�H��$��D$P�H��$8Ƅ$0�$�$(Ƅ$�0�$��$�H��$Ƅ$�0�$��$�L��$�Ƅ$�0�$��$�L��$�HDŽ$�T$X\$h��D�>L�T$x�D$	�D	���op��H��������VH��豼�����FL��衼�����6I�L$I�t$(H�|�� M�\$M\$M;]�A����L�mH�}(J�|�u_M�~M�v(K�|����H�5j'"L���B��1�H�߅���1�1��/!��H��$�	dH3%(��H���	[]A\A]A^A_�E1�D$��M�VI�F(J�|���L��$@L��脤��L��M�EL��H��$�1�H�|$���$\����p��L�D$L��L��L��$��$��L��$�DŽ$\L��踩��L�D$L��L��H��$���$�HDŽ$H�T$H������H�T$L��L��H��$�L��HDŽ$�H�l$ H�l$I������H�T$H��H��H�5	&"����H�T$I��L��H��H�����I��L��H��L��L���j�H�T$I��L��L��L��������$�$��$���bo��1�L��$pL��$�H;l$ �xn����$�7o��H�T$H�5o%"H���7����$��o��H��$�H��$H�|���D�|$L�|$H�l$Pff.�L�������t*M��L��L��H��H����H�T$M��L��H��H�����M��L��L��L��L���f�H�T$M��L��L��L�����M��L��H��L��L��������$��;L��$�L��$K�|��b���D�|$��$���$������n����D	������]o�����Ao����$����o����ro����$����Go����mo����$�����n����������l��H������L�EL�M(��A��K�|��E�������M�~M�V(K�|��t(L��H�5�#"���1�D��H�߅���1��x���D���H�T$�H������-���1�1�D��H���M����������m���m��f���USH��H��H�5�-H��8dH�%(H�D$(1�H�L$H�T$ �D$�������H�T$ H�t$H�ٿ�k������H�T$H�t$H�ٿ�dk������H�=�,"���H��H���p��H�D$H�t$H�}H�KL�D$H�PH�v�@H�|$H�/t9H�|$H�/t5�t$H���.�������o��H�\$(dH3%(H��u-H��8[]����������H�|$H�/u	���1���1���q���AWf��AVI��AUATUSH��H��xL�NfoY�H�T$ fo\�H��$`H��$`H�L$fo�L��$XI�dH�%(H��$h1�H��$`�D$`�H��$Ƅ$�0�$��$Ƅ$�0�$��$�H��$�Ƅ$�0�$��$�H��$�HDŽ$XT$h\$xL��$�L�L$(���nH�NH�V(��H�|�����8H��$ L��$�H���o���H�t$ H�T$L��L�.L��M�e�������n��HDŽ$�A�F�tM�vM��I��I�M)�L�T$@�[o��L�l$K�L��L��L���A���:n��L�\$(M)�L��L��H�5T "H��L�t$HM�L�\$8����n���D$4H�L$\H�T$`H�$L��$�L�uH�L$L��$�M��I��H��L��L��L�����
�$���Gn��L��H�������~`L�D$H��L��H��H���D$\�r(���D$\	�$<�A��m�����m��H�$M��I��H��L��H�����n���fD�t$4��t5M��H��H��H��L�������$��<m��L��L���k������H���������L�S(M�L��H��L��H��L��M�L)��������L�t$8��$�L�s����l�����l����$�����m����km����$����8m����Ol��L�d$ H�T$H��H���Aol$�Ao$�Ao|$ )�$ )�$@),$)�$0DŽ$D���H��$hdH3%(��H��x[]A\A]A^A_�H�L$�L��L��������k��I�~H�I)�L�wL�l$@�lH�D$@H�L$L��L��H��H������k���D$4M)�H�L$L��H��L�t$HH�5�"Lt$(L�t$8�v���o����jk��H�t$@H���?k��H������H�L$(H�K��$����k����Jk����$����
l�����k����$�����k�����j��H�T$H��H�t$ ��H��$ H��DŽ$D������L�l$8I��M�L�l$(�e���H�L$(��1�H�����H�T$H�t$ H���d���f���H�T$�H�������O���H�������?����j�������\k��f���UH��H��H��S�H��(dH�%(H�D$1�H�t$�D$��d����thH�=;&"�6���H��H���Vk��H�D$H�{H�L$H�UH�p���H�|$H�/t.�t$H��踍����u=H�L$dH3%(H��u%H��([]�1�������t$H��腍����t���j�������j��f�AWf�M��AVAUI��ATI��UH��SH��D�1fo
��|$,L�L$dH�%(H��$�1�H��$��D$00H�D$X�D$8�D$+D	�L$H��DH�AI�}(H�rH�J(H�|�H�\��
H�JI+MH����M�MEL+BM�PL)�H�L$ M���[L�\$0L��L��L��L��L�T$L�\$������k��I�E�L�d$L�T$H)�H\$HI9��*k��H9!"H��H�U HM5
!"H9���E� �k��H9���M�MI����
I�t$H�}(L�^�I�����M�m(I�L$(1�I��#NJN��I�uI��J��I��H��I��J�I�����I��#NJH��N��I��J���I��H��I��J�I���tNI��#NJH��I��J�H��H��J��I��I��I���t"H��I��J�H��H��J��I��I���u�I��L�,����H�U �EH��~J�</��H9�"H�މ�HM5�"H9��
� �/j��H9��j��D2t$+���H�]A��D	�EN�4/I���ɚ;��I��'��I��c�KI��	��H�C�H��L�\PL�]M�����I���������L�7L��I��L��H��H��H�H)���H���|H�|$ �D$0H�}����	���h��H�T$L��H�����H��$�dH3%(��	H�Ĩ[]A\A]A^A_�DD2t$+���H�]A��D	�MN�4/I���ɚ;����I��?z�ZM9��H���vHI9���H���rN	�I9���I�����M9�@��D��I�M�ff.�f�E1�L�,����H���)����/���H�T$H��L�T$����L�T$����	�M�MI����M�L$H�}(M�Y�I��������E1�H�U �E�ff.�I��?B�3�	I����wI����A��A��H�Hf�L�C�O�4�O�pI�L�MM������M�����D$,��H���f��L�'M���+I���������L��I��I��I��O�,�M�M9��L��I��H��H��H�I9��I��(\��(L��H��I��I��I��L��I��H��H��H�I9���H��S㥛� L��H��H��H��H��H��I��H��L�4�M�L9���I�KY�8��m4L��I��H��H��H��I��H��L��M�L9���I�Cx�q�Z|
L��H��I��H��H��H��I��H��L��M�L9��yH��4�ׂ�CL��H���������H��I��I��L��H��H��L�,�M�M9��HH��Bz�Ք��L��H��I��I��L��H��H��L��M�M9��!H���a�w̫L��H��I��I��L��H��H��H�<�H�I9���I�SZ��/�DL��H��	I��I��I��L��H��H��H��H�I9���L��
I�������I��I��I��!L��H��H��L�$�M�M9�u6H���������L��H��H��I��I��L��H��H��L��M�M9�t�DI9�H��IN�H�����L�T$ �D$0I�L�U�����������fd�����&���fDH���TI9�A��E��I�N
����f�I���c����
M9���I����o�#M9��
I��Ƥ~�M9�A��E��I�I���ff.��I���@��D��I�M����H����b��H�wA�H���tI���������H��K�|�I��M�D}L��H��L��H��M�L9�����H��I�XI��H��L��M�L9������H��I�XI��(\��(H��I��H��H��I��I��H��H�<�H�I9��x���H��I�XH��S㥛� H��H��H��H��I��I��H��L��M�M9��?���H��I�XI�KY�8��m4I��H��H��I��I��H��H�<�H�I9��
���H��I�XH�Cx�q�Z|
H��H��H��H��I��I��H��L��M�M9�����H��I�XI��4�ׂ�CI��H��H��I��I��H��H�<�H�I9������H��I�XH��Bz�Ք��H��H��H��I��I��H��L��M�M9��g���H��I�XI���a�w̫I��H��H��I��I��H��H�<�H�I9��2���H��I�X	H�SZ��/�DH��	H��H��H��I��I��H��L��M�M9������H�������H��H��I�X
I��I��!L��I��H��H�4�H�I9���������ff.�@I��L�7L�d$ L�e�D$0���R��}����$a��fDI������D��I�K����f�H����]xEcI9�A��A��H�I���f�L�[�J�4�L�n�I��tH�|7���L�����������1���������H����#NJL9�H�H��H�J�O����������������������������������	���H���L_��H�wA�H���o���I��I9��%_��J�4�H���U�����H��L�n�H���M���H�|7��A���H��L�,����H���+���H�|�������L�T$I����^��I�M(I�T$(1�H�}(M�D$������`��Lc�H�}(H�U �EL�T$����t$+1�H��D1�������H�T$L��H��������H�����M��L��L��L��H��������{���A�$A�u��&@����H�T$�H������H�����H�|$X�6"�D$0�����L�L$0I��H�L$L��L��L��L�T$L�L$�1�H�T$L�T$�����I��H+\$HI\$I9�����H9�"H��H�U HM5�"H9�������H���-�H���l]���t$+H��D1����f���H�l$�M�z���1�H��ƃ��D����a���H)�H�^I9��>^��H9��r����0^��M�_1�1�H���I�K��I+�e��L�|$A������4^���/^��ff.�f���USH��H��H�5�H��8dH�%(H�D$(1�H�L$H�T$ �D$�������H�T$ H�t$H�ٿ�U������H�T$H�t$H�ٿ�tU������H�=�"��y��H��H����]��H�D$H�T$�H�uL�L$L�CH�HH�R���H�|$H�/tOH�|$H�/t=�t$H���9~����uH�\$(dH3%(H��u7H��8[]�H�muH������1�������������H�|$H�/t�1���v���fD��AUATI��1�UH��SH��(H�=k6"dH�%(H�D$1�H�T$�D$�q������%]��L�l$M����I�m�']��H�EH��"H9���I�|$H�EH9���I�$�_���H��H���]��H�xH�@0f��H�Ufo��H�x@H�pM�EP I�L$L�L$�H�@����X0��H�m��I�,$���t$L����|������\��H�L$dH3%(H����H��([]A\A]��ZI��H���X\��H�(�;\��H�EH��"H9��wH�5�"H���a������`H�U����?H��L��H�=�"�VI��H��H���@I�|$H9���I�$H�=`"�+���H��H���H�sH�C0f�H�Ufo
g�H�s@I�L$H�sC L�L$M�E�H�C����K0�W�H�mtzI�,$ti�t$L���{���������T[��H�5�"������`���I�L$���tJL��L��H�=�"�|H��I��H���9�����Z��ff.�L���X����H���N����y�������H�%"H�H�m�M����Z��H�
"H��8���H�E�����Z���Z��DAVAUATM��UL��SH��H�� dH�%(H�D$1��D$H9���Z��L�l$I��L��M���'���D$��u8L��M��L��H��H������T$	UH�D$dH3%(uH�� []A\A]A^�	E�����ff.����USH��H��H�5*H��HdH�%(H�D$81�H�L$(H�T$0�D$L�D$ �������JH�T$0H�t$H�ٿ�P�����+H�T$(H�t$H�ٿ�P�����H�T$ H�t$H�ٿ�P������H�=�"��t��H��H����Z��H�D$H�T$H�}L�L$H�t$L�CH�HH�RH�v�s���H�|$H�/tHH�|$H�/tMH�|$H�/tR�t$H���6y������H�\$8dH3%(H����H��H[]�����H�|$H�/u����H�|$H�/u����t$H����x����t���Y��H�|$H�/u����H�|$H�/t1������1��H�|$H�/u����1��i����"����Y��ff.�f�AVf�I��H�AUI��H��XLI�ATI��UL��SH�H��pfo
ہfo��dH�%(H��$h1�H�D$`�$0D$L$H�D$()T$0H�L$@H�D$H�KH�\$PH�t$XH����H��H�T$`H�D$hH��H�D$�@���H�t$0H�����I��L��H��L��L�����H��L��L���q���$����X�����H��$hdH3%(��H��p[]A\A]A^ÿH��?H9���X��H���$1H�D$hH�T$`H�D$H��H��蛥��H�t$0H������I��L��H��L��L���z��H��L��L�������$���GX����[����NX���^��DX��f���AWAVAUATI��1�UH��SH��8H�=G/"dH�%(H�D$(1�H�T$ �D$�M������ZX��L�l$ M����I�m�X��H�EH��"H9���I�|$H�EH9���I�$�;�H��H����W��L�@H�@0L�pf��L�@@L�L$M�}L��P I�T$H�uM��foWH�@����L��L�L$X0�N���H�T$L��L�����H�m��I�,$���t$L���u�����dW��H�L$(dH3%(H����H��8[]A\A]A^A_�ff.�H�5�
"H���A����H�U����_H��L��H�=k
"�6B��H��H����I�|$H9���I�$H�=@
"��H��H���_H�sH�C0f�M�}H�s@H�|$L�sL��I��C I�T$H�ufo
'~H�C����H�|$L��K0����H�T$L��L���n��H�m�}I�,$tl�t$L���pt���������3V��H�5�"�D���@���I�L$���tJL��L��H�=q"�<A��I��H��������U��ff.�L�����H�����v�����H��"H�H�m�J�����U��H��"H��5����QI��H���mU��H�(�qU��H�EH��"H9��:���H�E�v����*U���;U��fD��AWAVAUATUSH��H�_dH�%(H��$�1�H���t.H��H��$�dH3%(�_H��[]A\A]A^A_�f�I��fo�|H��������fo
}H��$�A�FH��$�H��������fo�|H��$�I�n�D$ �H��$�L$(D$8H�T$HH��$��D$P�L$XD$hH�t$xHDŽ$�
Ƅ$���$��$�H��$��D$H�l$��>fo�{H�="I��XLI�I�I�L��$�)�$�HDŽ$��KL��$�L��$��9���I��H����S��H�=�"�!���I��H����S��D� M�^ H�H(A���M����D� H��H�l$L��$�H�@L�H�AH�@�	���H��L���^��H�L$ L��L��H��$�I��M��H�L$�k��H��I�vL���\������vS��H��XLI�I�Gfo-J{A�'�H��$�)�$�I��L��L��L��L��肼��H��L��L������H�T$I��L��L��L�����H��L�����L$A�����R��A�7E�NH�ʼn�A����H����R��@����E��u7����R��A�EH���tS�tDM��tA���tV�tbI�^����DH��H��H���thE���tR��A�E��tH��u�L��"�I�}(H��"A�E�I�(��"A��L����"�H��H��E��uH����U���H������I���H���I��H�@H��H�l$H��M��II���A	�D� L��$�H�1H�AH�@����H��L���c���H�L$ L��L��H�t$PI��M��H�L$�s��H��I�vL���d������~Q��fo%dyI�GH��XLI�A�'�)�$�H��$������u%�u��Dk�A��Mc�Ii�/����1����L��"H�5�I�;�z��g����`���AVAUATUSH��H��H�5�H��0dH�%(H�D$(1�H�L$H�T$ �D$�L�����H�T$ H�t$H�ٿ�=E������H�T$H�t$H�ٿ�E������H�="�zi��H��H����P��L�`H�L$H�D$L�kL�t$L��H�PH�qM��L��聹��L��L��L������H�|$H�/tUH�|$H�/tC�t$H����m����u H�\$(dH3%(H��u=H��0[]A\A]A^�H�muH����1���������H�|$H�/t�1�����AWI��f��AVM��AUATUH��SH��HI�XI�xfo�vE�P,�L$H��$0L�$L�ZLZMI�I�SdH�%(H��$81�H��$0�D$`0L$hD$xH��$��D$00L$8D$HH�L$XH��$�H��$�D��$�H��$�HDŽ$�L��$�DŽ$��E��L�l$`L��L��L�l$聬������O��H��$�H��H�s��I���$��kO��DŽ$��t$�t$H���O��H�$L��L���(������O��H�-�I��H�L�l�H��$�I��tqL��L��L��I��H���]���H��H��L�����M��t$H�T$L��L��I��H���4���H��H��L�����A�u I�OI�(H�|�u�D��$�A��u
�D��$�H�$D	A���
D$A����D$`����N����.N���D$0����N����	N��H��L��L������H��$8dH3%(�H��H[]A\A]A^A_�H�D$`I��M��H��H��$�H�ƿH�D$I��H��!L��$��O��A�$���M��H�sH�����I���$���M��D�L$DŽ$�D�L$H���mM��H�$H�t$L���t������L����bM���t$�L��H��Ngm��\��D$`����M����M���D$0���mM�����L��H�$L��L�����������f�AWf��AVI��AUATUSH��8H�~(L�FH�L$focsH��$ H��$fo[sfo3sdH�%(H��$(1�H��$ �D$P0Ƅ$�0�$��$�L$XD$hHDŽ$�D$ �T$(\$8J�|�H��$�H�L$xH�\$H��I��H�VL�NH��A��EH��L�LI�L�T$H����M�$��L�} L�L$�~d$H�T$L��$��PL��$�H��$�I��L��$�H��$L��H��d$Ƅ$��HDŽ$	L��$�HDŽ$�HDŽ$�HDŽ$��$�L��$�L��$��$�说������H�T$M�$$�
H�I���c����
H��XLI�H��$L��N�L"H�T$I�L��$�I��	H��$�LN�H��HDŽ$��KL��$L��$��������L��$�I�nH�H+l$I�nI9���L��I���ɚ;�M��I��'��L��I��c��M��E1�I��	A��Inf�f��I)��I*�H���������I*��Y�qA��\�q�^����H,�H��LM�H9��TL��H�l$P1ɺ1�H��I����L�T$ L��$�L�T$���I��'�SI��c��I��	��H��H��H�DHf�H�L$L�KI��L��L���H�D$0���L��M��H��H��H��DŽ$��б����$������D$P��M��I��1�H��H�c�!H����H��L��H������$�	�$�I����L�\$HM�#H�D$8M�D�I���ɚ;����H��?z�ZI9���H���vHI9��H���rN	A�I9�wH�����I9�A��E��I��f�H��L��J�@L�����ff.��I��?B��A�	I����w�E1�I����A��I���H���c����
I9���I����o�#M9���I��Ƥ~�M9�A��E��I���l���ff.��E1�I���A��I���I���f�A��5���DH���TI9�A��E��I��
����f�E1�I����A��I�����f�H����]xEcI9�A��E��I������f�H����#NJL9�M�I��I�����@��$�H�T$	:A�&���$����$I����I���D$P����H�����I��H�t$D��$�A��DA��@D�H��$(dH3%(��H��8[]A\A]A^A_�M��H��H���!H��H��菥����uM��1�H���!H��H���$Q��$�	�$�I���g���ff.��L�L$L�%DŽ$�K�4�H�t$H����I��H�T$H��L���'�������L�T$L��I��H�M�$�I�������L��L��L��M��H���\���L��H��L����L�d$t"H��L��L��M��H���3���L��H��L����A��k���M�FI�N(J�|��u���$�@���Q����|���1ɺ1�L����������G���1�L������H�\$�@�h���1ɺ1�L���G�L�T$A�
@�F�������AWI��AVI��AUI��ATUH��SH��H	dH�%(H��$8	1���YH�VH�F(H�|��2�Ao]�Aoe�Aom A�M,)\$@)l$`)d$P�D$d����H��fo&kf��L��$0L��$0L��$0L��$0Ƅ$0�$�$L��$(Ƅ$�0�$��$�L��$�Ƅ$�0�$��$�L��$��D$p0L$x�$�L��$�H9��]L�d$pH��L���ߠ�����lG��M�}�D$hI��L�|$ M��H�\$@H�D$<M��M��H��$H��$�M��H�D$(H�{H�L$L��$�H�t$H�|$L�L$ H�L$(H��L��L���D$<L�L$@�W����T$<	UM�WM�_��$��M�L+\$@��@��G��H��$�fo?jL��$�L��HDŽ$��p���I�ML��L��L�D$H�|$H�L$@H������L�D$H��L��H�|$L�����A���]I�wI�(H�|������$�
�$��H�t$H�|$������E�m(M��M�D�l$hL�l$@A��2I�NI�v(H�|��}G��M9���M�VL�L$PO�|:�M9���E��H��H��L�������$����G�����E����$�����E�����G����$�����G����sG���D$p���EF�����H��$8	dH3%(��H��H	[]A\A]A^A_�I�U�D$hH��H�T$ �����T�MH�D$ ���M��E�](M�~L�l$@D�\$h�uI�NI�v(H�|��hF��M9���M�VL�L$PK�|:�I9��/H��H��L�������$������D����$�����D�����F����$����tF����^F���D$p���0E�������}F��1ɺ1��������P������A��lD��1�1�1�L���y����L��H��L��L��L)�L�l$�K���M�VL�D$I�VL�L$PM�M)�I�D�M�VI9�������C��H�t$H�|$�m����������M��A�����t����E��M������jE���C��ff.�f�AWI�׹f�AVI��AUATUSH��H��fo
5ffo�fH��$�fo
fdH�%(H��$�1�H�T$H��H��$�H)�H�5��!�D$P0HH�L��D$XL$hH�D$xHDŽ$�
�D$ �T$(\$8����H����DE��fo%�e�H��XLI�I+vH�I�vI�)�$�H��$�HDŽ$��KH��$�L��$�H�����D��H��$�H��w7t,A�@H��$�dH3%(u/H��[]A\A]A^A_�I�V(�tL��L���
���A�@�����ff.�@AWf��I��AVAUATUL��SH��H��8	fo�dH�T$H��$ H��$�H�L$ H��$ dH�%(H��$(	1�H��$ �D$`0H��$�L��Ƅ$�0�$��$�H��$�L$hD$x�D$00L$8D$HH�L$XH�<$膚������F��L��$�L��$�H�_Cy
�5��L��$�L��N�$�H��O�t"�H��L��N�BM)���I����I���sE��I��	��I��c��A�L�kI�N�H�[I�G(�� ��E��L�8����L��H�L$E�HA�L��$�L�I�GI�G�����%���L�\$M�LL�L$I�����A�I��H�\$0L��$�L��$�L���5e��L���-e��L�T$DŽ$M�
I��H�|$L�L$��H�|$�H�|$L�wL��H��?L�H�H��$ I���~H��H��H��?H�H�H��$(H���cL�RM��I��?M�I�L��$0I���KI��M��I��?M�I�L��$8I���XI��A�L��H�I��H��$@I���7H�pH��H�I��H��$HH����A��A��H�HMc�A�zH��H��?H�H�J��� H���E����ff.��L�4$H�t$H��H��L���8���H�T$I��L��L��H���b��I��L��L��H��L�������$��M@���JC�����B���D$`����B�����B���D$0����B����OH��$(	dH3%(�3H��8	[]A\A]A^A_�M�v�I���H�D$��A��L��$L�D$`A�L�T$N��� L�D$ ff.�f���M�L��L��A�H��H��O�\	L��$����H��$�A�7H��$�H9�pH�4$I��L��H��H���+���H��L��H���}�I��L��H��H���!H����I��L��H��L��L���q�A���U���I��L9t$�V����A����H)�H�|$ H�4$H��H�T$(����H�t$ I��L��H�T$(H��HT$hH��藡��H��L��H�����I��L��H��H�9�!H�����I��L��H��L��L�����A�������I��L;t$�������ff.�f�A�H�l$H�t$M)�L��$�L��L��$��Ta��L���La��H�L$DŽ$H�9H��H�|$H�������H�\$0����Mk�
Mk�
�D���A�����L�4$H�5j�!H�\$0L��荡��M�MM��L���H�G�!H�߉D$�k����$���A���D$H�T$8��y	H��H�T$8L�D$ L�L$L�T$@I�I+	M�\�H�qI9��x?��H��I�L�H�T$8H���S?��H)L$H�D$�N���E1��K���A��@���A��5���A��*���A�L��H�5
1�J�t��I���+��������t?���AWI��AVI��AUI��ATI��USH��8	dH�%(H��$(	1����fH�NH�V(H�|��~��aH�5�!L���:�������I�~I~H��H����H��H��"�����H�I9G��B���Ao�Aog�Aoo E�_,)\$0)l$P)d$@�D$TE���CB��fo5�\f��H��$ H��$ H��$ H��$ Ƅ$�0�$��$H��$Ƅ$�0�$��$�H��$�Ƅ$�0�$��$�H��$��D$`0T$ht$xH��$�M9��TA��I�?�D$XH�\$0H��H�|$L��$�L��$�L��L�t$(H�KL�D$H��$�L�L$H�L$ L�T$M��H��L��L�sL�T$0����H��$�H��fo=g\M�\$M\$L+\$0��$��L��$�8HDŽ$�脀��I�H�|$M��H��L��H�T$0H�����H�|$M��H��H��L�����A�$��I�|$I�t$(H�|���s��$�
�$����H�t$H�|$�������M�L$I�L$E�(L�D$@L�H��D�|$XI9���L��H��L���+���$����@�����@����$����Z@����B@����$�����@�����?���D$`���r?�����H��$(	dH3%(�kH��8	[]A\A]A^A_�H�<�<~����H�I;G�@��H�\$0A�,�L��H����D$T�r?��fo Zf��H��$ L��$ L��$ L��$ Ƅ$�0�$��$H��$Ƅ$�0�$��$�L��$�Ƅ$�0�$��$�L��$��D$`0L$hD$xL��$�M9��~>��I�7�D$XH��H�t$�*���1�1�1�L�����������t]A�MH�D$H�L$ H�t$(�)����*B�������A���=��L��L������u����������a���H�t$H�|$谛����u�M�L$M�\$E�W(L�D$@M�I��D�T$XM9�pL��H��L��������$�������D>����$����>����>����$����M>����V=���D$`���1=���������=��A�$uI�T$M�t$(I�|��s���I�xH+|$0L9��a���A�M@�T�������,=����<��ff.�f�AWf�M��AVI��H��L��AUI��ATUL��SH��H��xfo
�WdH�%(H��$h1�I��H�D$`�$0L��D$L$H�D$(�������=��I�~I9}H���c����
H��XLI�IM}E�L�l$0L�|$LH�H�T$8L��H��H�L$@L��H�t$PL��H�|$0H��D�D$\H�D$H�K�D$X�9���M��L��L��H��H���՘��L��L��H���'��H��L��H��H���&��$����<�����<��D�L$LA��DMA��@D�MH��$hdH3%(uH��x[]A\A]A^A_��m��ff.�f�AWAVAUI��ATI��UH��SH��hD�H�|$L�D$dH�%(H�D$X1�A����D�E��A����H�z(H�rH�|����H��~0H�H���!=��H���������H��H��H��H��H�H9��gE1�1�E1�I�|$��D�˃��^E���M�uM�](K�|��A���D��E1����yH�|��A���H�5�!L���D$ ��v�����@A�]�AoEH�|$ �AoMM�](��H�t$D$(��PL$8�\$ I�\$L�\$HI\$��H��I��������L9���;��H�t$(A�<$H�Ht$0H����H��?@8���H�}�x��H�H9��[L�L$E���jH�|$I��D��L��L�����H�D$XdH3%(��H��h[]A\A]A^A_ÐE1�H���������H��M�zH��H��H��I��H��H��H��H�I9���M|$�j���E1�E1�1��D�˃���E1�A�E��uI�uI�}(H�|���bA����D��A���]A����E���X���I�T$I�L$(H�|��B����H�|$1ɺD����������I��(\��(H��H��I��M�zH��H��H��H��H��L��M�L9�����H��I��H��H��H����@L�t$L�E,H��L��L��L���6���A��uH�5��!L���ߕ�����+A���?:��H�T$H�|$H���)���P���@L�]L+]I�{L�\$�v��H�L$H�H9�����H�\$D���H���%��H�T$H��H���������E��uI�|$(I�t$H�|��tPA������H�|$1�1���������L��D�D$��x��D�D$�����(���E��tD��A���O���H�T$H�|$��~���|���L���xk�����AA�$�E���I�UL�|$ H��L��H�|$M��H�����D�D$ A���(9��H�|$L���G��H�}I��H��H9��L�d$H�L$L��H�5/�!L����������E�$I��M�t$D�L$A���D	�A�$����H��Ngm����L�D$H�|$H��L��L��薉��A�Dž������E�$E�M1�E��E��A��A������I�|$(I�t$H�|������H����7��H�E1�H���[�
H��1�M��H��H��������R���A�E��H7��L�uH�l$I���M@������H�|$��|�����E1�H�5�!L���>�������6��L�|$L�eH�5��!L�l$I�T$�L��L��豧��A�A�M)�D$���	�M�WA�A�M@���E��uI�|$(I�t$H�|���L���A���q6��H�|$1�1�D���a���H���L�l$L�eA�H�5f�!H�L$I�T$�L��M)��!���M�}A�E���E1�A����H�t$I��������6��ff.�f���AUI��ATI��UH��SH��8dH�%(H�D$(1��D$H�D$�3E��H��� 7��H�(H���7��1�H�t$ H��L���;�����h1�H�t$H��L���!�����H;-��!��H�=u�!�p@��I��H����6��H�T$H�t$ H�KI�|$H�D$H��H��H����L�D$�!���H�|$ H�/��H�|$H�/u�����t$H����D������H�L$(dH3%(L����H��8[]A\A]�1�H�t$H��H���Z�����F���H�|$ H�/�_6��H�|$H�/u�s��L�d$�H��I��L�L$H���X���H�|$H�/�H����D���>���H�|$ H�/�w5��L�d$�X���I�,$��5��L��E1�����=���L�d$ �3�����������r���f���UH�
��!SH��H��H��H���H��PH�-@�!dH�%(H�D$@1�H�D$(�D$H�l$(H�D$P1�L�L$8L�D$@�{���ZY���9H�T$0H�t$H�ٿ�*�����H�T$(H�t$H�ٿ������H�T$ H9���H�=^�!�Y>��H��H���-5��H�T$H�t$H�KH�xL�T$H��H��M��uuL�D$����H�|$H�/��H�|$H�/���t$H���B����ujH�\$8dH3%(H����H��H[]�H�t$H�ٿ�Q�����T����j4��I��I��L�L$L���p���H�|$H�/�r����\����h���H�muH���H���1���?����i����5����P���H�|$H�/t�1��]���虿��f�AWAVAUATUH��SH��H��xH�~H�T$dH�%(H�D$h1��D$,�����H;=��!��H���پ��f.!L�H�KLf(ȸfT
rKfV
�Kf.���D�f.��D$D���fT�Kf.L��H����!I��H����3��1�H����!I�mI���L���"���M����3��M�gI� 1��i�!I��H���^3��H��襽��I�mI���;3��H����84��H�T$H�H�L��H��H�L$��
��I�/H���L��课��H���3��A�A�0L�%K�!L��I��H��H���X3���c�!H��H���F3���I��H��H����3���=�!H�C(H����3��f��L�c L��L�%��!I���H��[H�CH����3�����!I��H����2���I��H��H����2�����!I�G(H����2��A�f�1ɺI�GL�l$0fo%+IH��XLI�H�M�g I�L�d$,AGH�t$@1�H�|$PH��)d$0L�D$XH�D$H�K�x��L��L��H���*��E�A�� �OH�5��!I�G(I9w �)2��M�N�A���M���TE�I�GH�@L�I�GL���pm��L��L������H��H��M��L��L����t$,H�|$��>�����=1��L�]M��L��H��L��L��L�\$����H�|$L��L���n�����tw���A���������t$,H�|$�]>�����1���]A�M)���
\$L�} �]H�L$hdH3%(H���H��x[]A\A]A^A_�@H�{(���!���|���H����!A����s���I�(���!A���e���L�����!�W���A�A��I��?L9\$���1�E�H��#NJL)�I�GH9�H����H�PH��H)�H�8H����#NJH9�M�I��I��M�W�[�������������D$H����/��H����!H��H����/��1�H����!H�mI��uH������M���z/��M�gI� 1��_�!I��H���T/��H��蛹��I�mI���1/��I����.0��H�T$I�N�L��H��H�L$�	��I�/H��uL��詺��H���/��A�A�0L�%E�!L��I��H��H���R/���]�!H��H���@/���I��H��H����/���7�!H�C(H����/��f�L�c L��L�%��!I���H��{H�CH����/�����!I��H����.���I��H��H����.�����!I�G(H����.��A��fE�1�M�g H��!fDo
(EH��XLI�A�EG�L�d$,I�� H�t$@L�l$01�I�GH�|$PH��D)L$0L�D$XH�D$H�K�p��L��L��H���"��E�A�� uKH�5��!I�G(I9w �%.��A���H�|$�Q���L�L$E�A�I�GH�@L����I�G(��H�5 �!�˷������H�����f.CE���-mEf(�A�fT5�DfV5�Df.�A��ED�f.�D�\$E��z@fT�Df.0E�0���H���5��H��H������H�}�D���p������H���x5��H��H����H�}�1���o������袷��H�����H������L�5��!H�5��1�I�>芸������"������f.���AWAVAUI��1�ATU��SH��H��H�=R�!dH�%(H�D$x1�L�t$@L���]�������-��L�d$@M���$I�,$��-��I�}H���!H9��8H�I�!I�EI9�ttH�E�uI�uH�{D
sA����蓅��H�+�I�m��=�������wiH�5�Lc�I�>A��ff.��1���@���c���H�t$xdH34%(��H�Ĉ[]A\A]A^A_�ff.�f����A��A��Hc������ff.���@��@������@��@���υ�����������>I��H���0H�(�e,��I�}H�m�!H9��Q@H�5Y�!�������9I�}����L��L��H�=.�!���I��M����H���!I9������I��L�CH�E�uE
wI�uL��A��u`����1�I�/��I�mt6=���tg�����L���Ic�L�>������������1�L��D$�b����D$�L��f�I�߸����A��u��|���1�A��t��L���7����t1��8���D�m�A��w��DH�I�!H�����H�5!�!H9�u1D�]�A���:A�L$,L��L��H�=��!��I������薳����u�I�}H�5��!H9���y������	H�5��!L�������X�����H�5Q�L���ų��I��H���7���L��H��H�=|�!�G��I�/H�D$��)��H�|$�
����C�5H�5	�L���D$<�k���I��H����)��L��H��H�="�!����I�/I����)��M��L�\$��)��H�{�H�t$H��I���*��H�=��!H�t$��0��H�|$H��I����)��H�|$L���IA��H�D$L��L��M�EI�EM�OL�T$<H�PL��H�D$(L�D$M��L�T$ L�L$趀��H�T$ H�|$L�����L�t$H�L$(L�D$M�w H�)uH��L�D$����L�D$A�E���;���|$<��H���!H9D$��L�l$L9���������H�
�!H�����H���!H�����L���4���������1�����M������L�����f.�>��f.
�>�����ݯ��I��H���6(��A�L$,L��H��H�=[�!��I�/I���#���L����������I��1�L���D$����D$�G����m���L�l$���I�E���L�D$L����!L�D$����L�D$I�}(���!A�EL�D$���L�-��!I�E����&����L$�D$�;����D$�L$H���['������'��ff.����ATUH��SH��H����2��H��t`H�(H����'��H��H�=M�!��H�A�!H��H9�t7H��t01�H��H��1�赭��H�+H����'��H�����H��H��[]A\�1�H����ff.�f���AUH�
3�!I��H��ATH��H���USH��hH�-�!dH�%(H�D$X1�L�L$L�D$H�D$H�l$�W������2H�\$H9��H�=��!1�H�T$ ������J'��H�\$ H����H�\$H�+�'��H�l$H���-H�}L�%0�!L9��7L���Ϯ�����'H�}H����uE���H��H��L�����H��H�L$XdH3%(H����H��h[]A\A]����H���k��I��H���EL��H��L�����L��H���ɫ����H�{H�5�!H9��#����������&��H��!H�5��1�H�8觯���Y���f����H;=.�!���H����0������H��H��L�����H������ff.�f��D$ M9�uL9mu
H�E���L����+��I��H����%��H�uH�xH�T$ �}p���t$ H���a0�����n%��L�����H�5��!�5������U���H�UH�
2�!H�5s�1�H�RH�9譫��1��m���H�5�!H��H�-�H�6��	H��H��t�H���M
H�mI��tjM���x���1��*����^���L���D$�*��H��H����$��H�t$ H���u;��H�}H�L$H��1������t$H���/���������$��H��聭����Z
H��H�D$H���<���H�(�F����M$��f.���AWAVAUATI��H��H�5��USH��XdH�%(H�D$H1�H�T$@H�D$@辪�����eL�t$@M���1I�~H��!H9���H��輫������I�~H������1�1�L���2i��H��H���H���D$<��)��I��H���PH�xH��H�L$<I�T$�d���t$<L���X.�����H���Ȩ��H�\$HdH3%(L���H��X[]A\A]A^A_�f������*H;=C�!���L����-����u[L��L��H���D$<���I��H����#��I�t$H�xH�T$<藼���t$<L���-�����[���I�/�Z#��L��衫��E1��A���I�|$�D$<H�|$H���(��I��H���$#��I�nL�hH���7���D$H����E�^I�o@L��L�]A�wI�G0���@
t$I�G A�w�[��H�T$<I�t$�ٻ���t$<L����,����������=���H�5�!H���L��H�6�I��H���*���H���I�mH���xH������H�=��!�D$<��'��I��H���E"��H�xH��H�L$<I�T$�f���t$<L���Z,��������I�/�"��L��E1��M������I�/uL���:���H��E1�蟦������A�F�8Mcl$8I�D$L)�I9F(�!�L����+�����R���H�=�!�'��I��H�������H�x�1��{a���n���A�I�^I��5L9���!��f��H*��Y�5f/�5��!��I���������L,�I��M9���!��L9%�!L��M�W8HM5�!L9���M�W@D�\��H�E�L�t$(H�D$�H��#NJM�L�d$ M��I��M�2M���;�@L��H��H��H��I�I���I�JO���@I��L��H)�H��H��H����tpH��t@H��tH��H�!L��=H��H��H�Q�I��H��H�!L�� H��H��H�Q�I��H��H�!L��H��H��H�Q�I��L9��~@H��H�!L���H��L�qI��H�H��L��I�&L���H��H��I�H��H��H�!H���H��H��H�H��I�NI�fH���I�NH��I��I�VL9�u�L��H����H�t$(H�\$H����#NJ�|�I:A��H9���A	�E��E����I�:A�M9�v	M����M������H�l$L�L$I���O���L��M��L�d$ H����R���A�GI�O0L��L�t$<I�G ���
D$A�G�W��H�5�!I�W8I9w0IMw0H9��MH�t$L��L���շ�����M�wM9��k��K��M���
���L��L���AI���|���H���D$�p���H�=�!�D$<��#��I��H���X��1�H�xH�L$<I�T$�����t$<L���v(�����&������H�5��!�M������
I�VH�
J�!1�E1�H�5��H�RH�9�£�����L���5����{���諥��H�X@L��H��`�H�@0H�@ �tV�����H�v��8uH��H���K�4�E1�H��H9�A���U��K�4�I���,���A�G ���L���^�����A�G �,��L9��G���H�T$<L��L�D$�g��L�D$���(����o���H��H��H��H�Q�I��I9��v����r������H�=Y�!H�R�!H9�tH�F�!H��t	�����H�=)�!H�5"�!H)�H��H��H��?H�H�tH��!H��t��fD�����=��!u+UH�=�!H��tH�=�!����d������!]������w�������	�fD��H��!�G(H��f���H��H��@PH�H�!H�5ѳH�8�ɤ����Z�f�H�GH����tH�H��ét�:���PH��H��莤��1�Z�f.���SH��H�H��tH�/tH�{H��t
H�/�L���H��[�ͣ��踣����fDAWAVAUATUSH��H��(dH�%(H�D$1�躣��H����H�{H�G����n趠��H��������H���UH�k(��D$��H�M��-�T$H�����P���H��E1����H�D$H����H�5˸!H�{ H�x�H�6���H��H����H������L�pH��L�����I��H���
���H��H�L$L��1�H���耞��H�L9��Υ��M�4E1�H��uI�BJ�|�L�OA�����踟��H����q���H��	��E��u��0I��A�F�I��I9�|�A��|$u)A�EL�L$I�~1�L��H����觢��H�+�H�T$dH3%(L����H��([]A\A]A^A_�H�5��H�������tXH�5ǼH���՞��A�Ņ���H�5M�H��軞��A�Ņ��HH�|$�H�5`�����H�D$�j���H�|$�H�58�A���H�D$�@����|$�����A�0I�����H�=�!H�5�H�?褡��E1������Ǟ��H��u����H�
ƶ!H�5�E1�H�9�t������H���נ������H�|$�H�5���\���H�D$���H�w�!H�5��E1�H�8�%������L�Y�!H�5
�I�;�
���H�+�v���L��E1��՜���c���L�)�!H�5ڱI�:�ڠ����L��!H�5��E1�I�8迠���-���襟��DSH�=��!1����H���~����@,H�=��!H��H�����H���V���H�(uH���؟��H��[���QH�w1��@ ��H��tH�(�����H�"�!H�Z�@��SH�wH��1��
 ��H��tH�(�e���H�CH�[�@��SH�~H��H�5��!H9�u	H�H��[��*�����u�H�/�!H�5\�1�H�8辟����ff.����� �����AUI��ATI��USH��(H�-m�!dH�%(H�D$1�H�l$�k ��H����H�(H�������1�L�D$L��L��H�
��!H�m�蕜������H�D$H9�uZH�\$H�=�!肛��I��H��ttH�|$1��^��I�D$H���h���I�\$L��H�H�L$dH3%(uBH��([]A\A]�H�xH�5��!H9�t�������u�H�	�!H�5�H�:蚞��1��1���}���ff.�f���ATUSH�GD� �<���H���
���H��H���!�)D�c�����H���!H�sH��������ա��H�� H�;u�H��[]A\�ATUSH�G��� ��H������H��	uP1�L�%4�!I�<$t[I�t$H���@���H��t H�������������uAl$I�� �����H���á��H��!H�5l���H�:蒝����[]A\�H�
�!H�5���H�9�p�����ff.����B�USQ���m���H�NH;
B�!u0L�GL�NE�E9A�Ã���A8��K���H�ز!H�Z[]��� t/H��H����������u$H�U9@�ƃ�@��@8�u�����H�)�!�Ā������q���H��!��UH���SH��dH�%(H�D$1�H��H���W���H���à��H�߾耘��H��H�������H�����H�+H��uH��軛��H�L$dH3%(H��uH��[]�����ff.��UH��SQH��t3H��H�3H���i���H��������tH�� ��C�M���H�CZ[]��@���ff.�f�AWI��I��AVAUE1�ATI��UH��SH��H��I�rL�t$XA��H��1�L�|$PI�~ �I�:L�|$�~D$L)�fl�I�zA)H��H��H��H��tH�I��xC�49B�4?��M��tL��H��1�L���L��H��H�Q��>��M�N(I�RE1�I�E�E��@��A��@��@��TI9��KI�
L�I�RI)�I�rH�H)�H�L$�~L$L�D$I�RL$A)
E���H��tyH��H��xpK�H�H�p�D�9H��D�:tV�|�L�@�I��@�|�tB�t�H�x�H��@�t�t.D�D�H�p�D�D�H���t�<1@�<2H��H���u��M��uFA�~zuI�RM�M�|M9���H����M�jM��t	M�C�DH��[]A\A]A^A_�H��t!I��~D����<I��I�v H��L���=��A�9tA�ytI��I�I�R���L�����H���`���I��H�I���P���B�0��I�	M)�A�H)�H���P���M�JfoU$I�ZfA�M�a�A)M�bH���C����mB�l��#���f�L�G(I��A���tI����y���I�yH��H���H��H��H��w�I�y H���H��H�H��@��@����ff.�f�H��H��H��H���]����%�!�L�GH�GL�H��H9����������H�G H��H+GH���h������H�GH��H+GH���H�����u)H�WH�G(H�|�tH�OHOH��H9N@��@���1��ff.�@��UH�
t�!SH��H��H��H�&�H��H�-Э!dH�%(H�D$1�I��H�,$�,�����toH�$H9�tjH�xH�5�!H9�u3H�pH�{�R�����ugH�O�!H�H�L$dH3%(uYH��[]��Ǖ���������H�Ȭ!H�5��H�:�Y���1����P��H�$H��t�H�(�=���H�$�H��!H������D��1���H�WH�G(H�|�tH�OHOH��H9N@��@���1��ff.���UH�
T�!SH��H��H��H���H��H�-��!dH�%(H�D$1�I��H�,$�����toH�$H9�tjH�xH�5ı!H9�u3H�pH�{�R�����tgH�'�!H�H�L$dH3%(uYH��[]�藔�����m���H���!H�5y�H�:�)���1���� ��H�$H��t�H�(�*���H�$�H���!H�����D��H�WH��H�z �@�uH�H8H�<�龕��ff.���SH�=T�!�O��H��H��t(H�@@H�{H�
�c�H�C0H�C �_E��H��[�f.����f.�UH��SQH���8��H��H��t;H�x(H�EH�u(H������U������	ш�oECH�uH�sH��Z[]�����l����ƒ��uC������;���L�WL�_(K�|�tfH�GHGH�=��H��H;FH�ٮHM�Ä����������H�OL�G(I�|�t3L�OLOH���I��L;NH�5��HM��H�Y��H�G��H�l��ff.���UH�
��!H��H��SH��H�V�H��H��!dH�%(H�D$1�I��H�$�\�������H�$H9�t<H�xH�5 �!H9�uJH�}H�p����H���Ə��H�L$dH3%(uLH��[]����H�$H��t3H�(�,���H�$��ܑ��������H�ݨ!H�5��H�:�n���1���U���D���u�uH�FH9G������u1���u������t��UHc�H��SH���H�,��cF��H�H��H�CH���"��H�C[]Ð��H���!H�úH��H��H���b�����%�!�AWI��AVI��A�xAUE1�ATL�%Q�!U��S1�H��f�[H�|$L�<$�EM��H��1�Ic�L����L���f������l���D9��c���Hc�A)�I�H��H��t!�����!�t驺t�E��u�A��L9<$tI��fA�]I�G+D$H��[]A\A]A^A_�f.���ATUSH��H���w,dH�%(H��$1�H��$�H�������x���I��s(L�������x������{8HcS4H�Z�!H�K H�sH��D�KPP1�ATL�CUWH�= �����H�� H��$dH3%(uH��[]A\�����ff.�UH��H��SH��APH��H���g���H��F�!H���U���Z[]Ð�6@��t��@8�t�u@�����G������G��L�¾�H��f����GtH�_�!H��H�K�!H��ff.���1��GuH�G(HG H��H���P������GtH��!H��H���!H��ff.���SH�=ĩ!���H��H��t(H�@@H�{H��c�H�C0H�C ��?��H��[�f.����GtH���!H��H���!H��ff.���H��H��@��H��H��@��H��H��@SH�x�!H��H9FtH���G�ƒ����t[�H�N�����P����S(1�[�ff.�@SH�(�!H��H9FtH����ƒ����t[�H�N���������S,1�[�ff.�@H9�vCSH�_H��H��H������H��H��H��H��H���H���H��H�H��H9��:���[�1��DH��QH��H9��%���H�H�������H��H��H��H�G�H��H�������H9�ZHB��f.����GtH��!H��H�ۣ!H��ff.����GtH���!H��H���!H��ff.����GtH���!H��H�{�!H��ff.���UH��H�=A�!SH��dH�%(H�D$1��D$�
��H��H��t%H�T$H�uH�x��N����t�c��D$�����H�L$dH3%(H��uH��[]��#�����UH��H�=��!SH��dH�%(H�D$1��D$�	��H��H��t%H�T$H�uH�x�UN����t�s�D$�U���H�L$dH3%(H��uH��[]�裋��AUI��ATUH��H��SH��H��L�E H��H�H��H�5��!I��H��H������H��H9�HM�L9��
���H�]H�C�H�MM��~L�g�L�M(O��I��M��H�C�I����#NJH��yH��[]A\A]�H�}(L�,�H����ff.�D�A��tBA��UH��H��SA��H��PD	�GM���H�߃�����U(H�u�=N��Z�[]�1�ÐAUH��ATUH��SH��QH���d���I��H��H9�u�U���Z[]A\A]ùI��H��H��H���0���H9�tNH��H��H������H9�����H��I���KU��K�<�H���?U��H��H��L����>����@��@���1�H���>����t�H��L��I���U��K�<�H���T����\���ff.�AWAVAUATUH��SH��(�H�L$L�$���I���	Ѓ������H�~H����M�l$M����H�NI9L$�H�5��!H�} H9sHMsH9��F���L�C(M�t$(L���I���������L�D$I�D$N�<�L�T$K�<�H��K��I9���L�|$H���ɚ;�>H��'��H��c�DH��
���D�v�A�E1�I���������I��L�=˸��O�E��I��M9�tYH��H��I��H��H��H�4�H�H)�H��I��H��I��H��H��H�H)�I����H����I��u�E��I��M9�u�H�}(L�D$I��I��N�A����A�dH��1�A�
I��1�I��L��I��H���*A������H��1�H��1�I��L��I��H����A���~A�'H��1�I��1�I��L��I��H����A���QA���H��1�I��1�H��L��I��H����A���$A�@BH��1�I��1�I��H��I��H���wA����A����H��1Ҿ
I��1�I��L��H��H���EA��
��A��H��1�I��1�I��L��H��H���A����A�ʚ;H��1�I��1�I��L��H��H����A���kI��TH��1�I��1�I��L��H��H����A��
�:I��vHH��1�I��1�I��L��H��H����A��	�	�QJ�H��1�H��H���
1�I��L��H��H���TA����I��rN	H��1�I��1�I��L��H��H���#A����I�@z�ZH��1�I��1�I��L��H��H����A��tvI��Ƥ~�H��1�I��1�I��L��H��H����A��A��tEI��o�#H��1�I��1�H��L��H��H����H���1�H��H����A��A��u�H�[A�
I9��O����EH�E�����MI�t$H���kH957�!L�e H�uHM5'�!L9��X���H����5��H�t$H��([]A\A]A^A_�F���H�$H��(H��[]A\A]A^A_�=��I��?z�ZL9��,I���c����
L9��X���H����o�#H9��,���I��Ƥ~�I9���փ����L��I����H��?B���	H�����f���H���������U���H�5C�E1�H��I��H��H��L��M�L)�I��H��I��H��H��H�H)�H��H��I������H������I��tLH��L9�u�H�}(I��N�?���H��L9�u���H�|�����������H���������H����������I���vHL9�wI���TI9���փ��{���H���rN	�H9��c�������AWAVAUATUH��SH��(����I���	Ѓ������H�~H����M�eM����I��H�NI9M��H�5�!H�} H9sHMsH9��T���L�S(M�M(L�5ƲL�T$L�L$A�
I�}H�D$N��H�T$L�\$H��J�4�J��I9���H���ɚ;�+H��'��H��c�tH��
E�A��E�m�A�1�I���������I��L�5.�H�\$�"ff.�@K<�E��I��M9�tYH��H��I��H��H��H��H�H)�H��I��H��I��H��H��H�H)�I���fH���\I	�u�E��I��M9�u�H�\$A����H��A�
1�A�dI��H��H��1�I��H��H���A�Mc�L�l�E)�O��I���������M�O�4�M��M)�I��A���EI��I��I�q�H��H�H�4�H�H)�H��H��H����I���I��t/H��I�1I��I��H�H��L�,�M�L)�H��H��H���hH��I�1I��I��H�H��L��M�L)�H��H��H�����4H��I��I��I��O�\�M�L)�H���L��I�II��L�H��H��H�4�H�I)�L��I����H��I�qI��I�H��H��L�,�M�L)�H����H��I�yI�� I��L�H��H��H�H)�H��H����I�1H�M9��K���H�M(L�L$I��J�<	�
H�sI9�����EH�E�Ã��]H���aH95��!L�e H�uHM5��!L9������H���B0��H��(L��[]A\A]A^A_鼌��H��(H��L�¾[]A\A]A^A_�8��I��?z�ZL9��I���c����
L9������I����o�#L9��ϗ��H��Ƥ~�H9�E�A��A�����L��I�����H���E�A�����H��?B��A�	H�����d���H�����E�A���Q���E1�E1�H��1�I��H��H��1�H��I��H��H������H���	���H	�tK�<�I��I�I��u�H�u(H�L$I��L����H�|������霗��H���vHH9�wI���TI9�E�A��A�����H���rN	H9��g���I�����I9�E�A��A��
���H����E�A���t���ff.�AWAVAUATI��USH��(�H�L$��EH���	Ѓ�����/H�~H���!L�kM���H�NH9K��H�5a�!I�|$ H9uHMuH9��D���L�M(L�s(L�˭H���������L�L$H�CN��L�|$L�T$K�<�H��O��I9���H���ɚ;�#H��'�hH��c��H��
���D�p�A�1�H���������I��L�=��L��H��H��H��H��L��M�L)�I��I��H��H��H��H��H�I)�L��I��I���
H���I9�uE��I��M9�tH���K4�E��I��M9�u�A�����
H��1�A�dH��H��H��1�I��H��H����A�Ic�L�5�I���������E)�M��I�K��I��M)�I��A���&I��I��I�y�H��H�H�<�H�H)�H��H��H��wCI����I����H��I�9I��I��H�H��L�4�M�L)�H��H��H���RH��(L��L�¾[]A\A]A^A_�3��H��I��I��I��O�<�M�L)�H��w�L��I�II��L�H��H��H�<�H�I)�L��I��w�H��I�yI��I�H��H��L�4�M�L)�H���s���H��I�qI�� I��L�H��L�<�H��M�L)�H���F���I�9H�L9��T���I�L$(L�L$I��A�
J�4	H�uI9����I�D$A�$�Ã��A�$H����I�t$H95F�!I�l$ HM59�!H9��ד��L����*��H�t$H��([]A\A]A^A_�X���H��I�9I��I��H�H��L�<�M�L)�H��H��H���9����z���H��H���i���H��?z�ZH9��lI���c����
L9������H����o�#H9��`���H��Ƥ~�H9���Ѓ����H��?B���	H���������H���������{���H�
@�E1�L��H)Ȩu�ZH��H��H��L��H��L��M�L)�I��H��H��H��H��H�I)�L��I��I�������H�������I9�uZH��I9�taH��H��L��H��L��M�L)�I��H��H��H��H��H�I)�L��I��I���?���H���5���I9��U���L9H��I9��9���I�|$(H�L$I��L�<�;���H�|��	���H�����I���vHL9�vCI���rN	L9�w*H�����H9���Ѓ�
�G���H�������6�����,���I���TI9���Ѓ�����H�����������ff.�AVAUATI��USH����FH�nI��H���6H�H9FI��HMF�H� H�H��H��H��H9t�!H��HM5i�!H��H9��ȑ��L��I���������H9�}zI9m��M�E(I�<�L�&�1�@H��I��H��L��M�L)�H��H��H����H��u'I3I��M9�u�M�\$(I�4�H���ff.��I��M9�u���A�$I�l$(I�D$�Ѓ��A�$H��]I�\$H9��!HM��!H��I�\$ H9��+���L���6'��H��L��[]A\A]A^鲃��H��L��H�ʾ[]A\A]A^�/��H�|�u�飐��1�����f���UH�
��!H��H��SH��H�&�H��(H�Ќ!dH�%(H�D$1�L�D$�D$H�\$�!t������H�D$H9�toH�xH�5�!H9���H�=4�!�/�H��H��toH�t$H�xH�L$H�VH�u�����t$H�|$�����u4H�L$dH3%(H��uZH��([]��;���H�D$H��tH�(u��8���H�+uH���u��1���_t�����l���H�`�!H�5A�1�H�:��u�����t���AVM��AUI��ATI��UH��SH��H��dH�%(H�D$1��D$������H�{�����H��H�t$�
t��H��D$��I�EH9���H��H9����E��H��yHL��H��L���6����tL��L��藁��H��L��H���)p��H�D$dH3%(ujH��[]A\A]A^�H��L��L��H���[W��L��L���P�����M��L��H��H��L���*8����u��&���L��L���,���L��H��L���6����s��f.�AUM��ATI��UH��SH��AQ�u2�u-H��H���7B��1�L���Ɖ����1���}��Z��[]A\A]�M��H��H��L���7����t�A�M�����ҐAWI��AVI��AUI��ATM��UH��SH��dH�%(H�D$1��D$������I���A���H�t$L���Wq��I�IVH�H9����D$��A�E��A�L��L��H���k���Lc�L��M}H��Ngm�I9�LO���4��L��H��H���ob1%}�I9�LL�L��L�}�t���H�D$dH3%(uNH��[]A\A]A^A_�M��L��L��L��H���a6����u�����L��H����*���L��L��H���H4����q���AVI��AUM��ATI��UH��S�H��������uSM��L��H��H��L����5������H��H���O@����t<��y(L��H��L����3��[L��]L��L��A\A]A^铂���u�L��H��L���3�����u�����9�u#H�KH9M@��Dk�D��G�L�A�BA���)���t��R���[]A\A]A^�@AVI��AUM��ATI��UH��S�H����u\����M��L��H��H��L���5������H��H�������t=��x)L��H��L���2��[L��]L��L��A\A]A^鳁����u�L��H��L����2�����u�����9�u#H�KH9M@��Dk�D��G�L�A�BA���)��[]A\A]A^è�O����y���AVI��AUM��ATI��UH��S�H��������uSM��L��H��H��L���24������H��H���>����t<��x(L��H��L���2��[L��]L��L��A\A]A^�Ӏ���u�L��H��L����1�����u�����9�u6H�KH9M@��Dk�D��G�L�A�BA����t��V���[]A\A]A^�)��v����AVI��AUM��ATI��UH��S�H��������uSM��L��H��H��L���R3������H��H���_����t<��x(L��H��L���91��[L��]L��L��A\A]A^�����u�L��H��L���1�����u�����9�t)��H�KH9M@��Dk�D��G�L�A�BA���[]A\A]A^���J����y�����ATI��USH��dH�%(H�D$1��D$�$�H���o���H�(H���i���H�=��!��H��H���J���I�t$H�xH�L$H�S�����t$H���3������H�T$dH3%(H��u	H��[]A\��m��f.���ATI��USH��dH�%(H�D$1��D$�t�H������H�(H�������H�=��!���H��H���݉��I�t$H�xH�L$H�S����t$H�����������H�T$dH3%(H��u	H��[]A\���l��f.�AVAUI��ATI��UH��SH��H��pdH�%(H�D$h1�H�BH�H�|$`H�D$`H���$�H)�H�|$(H�L$H�D$H�D$H�D$ ���H�sL�C(H�T$0H��A�L��H�D$@I�� H�t$8L��L�D$XH�D$HL�L$P�.����tKH�\$0H��L�sH��L���^}���D$L��u H��M��H��L��H���D$L�W����D$L%�A	EH�D$hdH3%(uSH��p[]A\A]A^�L��H��H������u�A�$�j����e�L��H��H�������Eu�L�SI��L+L�U��rk��f���UH�
��!H��H��SH��H���H��(H�@�!dH�%(H�D$1�L�D$�D$H�\$�i������H�D$H9�toH�xH�5T�!H9���H�=��!��H��H��toH�t$H�xH�L$H�VH�u����t$H�|$�.���u4H�L$dH3%(H��uZH��([]���H�D$H��tH�(u��c���H�+uH���j��1����i�����l���H�Ѐ!H�5�|1�H�:�_k����Hj���AVAUI��ATI��UH��SH��H��pdH�%(H�D$h1�H�BH�H�|$`H�D$`H���$�H)�H�|$(H�L$H�D$H�D$H�D$ ���H�sL�C(H�T$0H��A�L��H�D$@I��!H�t$8L��L�D$XH�D$HL�L$P�	,����tKH�\$0H��L�sH��L���z���D$L��u H��M��H��L��H���D$L跂���D$L%�A	EH�D$hdH3%(u^H��p[]A\A]A^�L��H��H�������u�A�$����e�L��H��H���N���E�u������EL�SI��L+L�U���h���AVI��AUI��ATM��UH��SH���-����u<L��L���u7����tnL��H��L��H��x(������u|H�CHCH��H9E[]A\A]A^�������A�4$���@p��A�$u�H�{L�C(I�|��uˁ�ApA�4$�A�.L��L��H�߃��*����t�D�A��A	�D��A�$@���UH�
D�!H��H��SH��H��H��(H��~!dH�%(H�D$1�L�D$�D$H�\$�f������H�D$H9�toH�xH�5ԃ!H9���H�=$�!��H��H��toH�t$H�xH�L$H�VH�u�����t$H�|$����u4H�L$dH3%(H��uZH��([]��+�H�D$H��tH�(u�����H�+uH���xg��1���Of�����l���H�P}!H�51y1�H�:��g�����f���AVAUI��ATI��UH��SD�6H��A����H���)������L��L��H����w���upH�S(H�K1�H�|�tgH9������H��H���s���Hk��
1�H��H��uH����A�|$(I�D$tH��I+$H+CH��H9�HN�H���/b��Hk[]A\A]A^�D��H��1�[��]1�A\A]A^�xp�������������f���UH�
4�!H��H��SH��H���H��(H��|!dH�%(H�D$1�L�D$�D$H�\$��c������H�D$H9�toH�xH�5��!H9���H�=�!��H��H��toH�t$H�xH�L$H�VH�u�l����t$H�|$����u4H�L$dH3%(H��uZH��([]���H�D$H��tH�(u�����H�+uH���Xe��1���/d�����l���H�0{!H�5w1�H�:�e����d���AVAUATI��H�=@!UH��SH��dH�%(H�D$1��D$��H�������L�hL�t$H��I�t$L��L����&���t$H�������{���H�uL��L���ru���t$H�������K���H�L$dH3%(H��u
H��[]A\A]A^���c��f�SH��H���uQH�~H�F(H�|��tL�FLFH��H��L��[H���W�����H��H�L$���H�L$�	H��[������u�H��H�ߺ1�[���D��UH�
�!H��H��SH��H��H��(H�0z!dH�%(H�D$1�L�D$�D$H�\$�a������H�D$H9�toH�xH�5D!H9���H�=�}!��H��H��toH�t$H�xH�L$H�VH�u�����t$H�|$����u4H�L$dH3%(H��uZH��([]���H�D$H��tH�(u�魀��H�+uH����b��1���a�����l���H��x!H�5�t1�H�:�Oc����8b�����ATI��UH���SH���p��H������H��H��H��L���k���H��By!�[]A\����ATI��UH����SH���Wp��H���Ā��H��H��H��L������H���x!�[]A\�f.���H�~H�51|!H9�uH�Ex!H��Q��`����uH��w!H�5�{H�8�`b��1�Z�H�x!H�Z�ff.�@�������L�VL�N(K�|���AVAUM��ATI��UH��SH�NH��H��H)�xbI�d����
H�~H�L9��f���L��H���LD����t0H�k�u'H�sL�[(I�|�tL�SLSI��M;T$����[]A\A]A^�H��H)�L��衙��I��H���t�H�kA�L$$H�s(H��H�������u-A�E�€���@M��E�A�E�z�����H��1҃��j��L��H���T#����f�AWf��AVI��AUI��ATM��UH��SH��H���fo�dH�%(H��$�1�H��$�H��$��D$H��$�Ƅ$�0�$��$�H��$��D$P0L$XD$hH�T$x�D$ 0L$(D$8H�L$H��b�E�XH�}�j�E�`H�t$H����^��I��D$�EI�uH9��8H��H��H9��)��2H����I��I)�L�L$H;s�$H�l$PL��L��H��H���]B������~��L��H��L�|$ �El��H�T$L��H��L���җ��H����~���L$ M��M��L��H��L�����l^����$����6~����~���D$P���L~����Y~���D$ ���\~����~��H��$�dH3%(��H���[]A\A]A^A_�I��I�I��L�D$����M��L��H��H��L���j"����u����L��L�������L��H��L���Q ���H��$�L��H��H���9 ������}��L��H��H���#k������]��f�AVAUI��ATUL��SH�^H^H)�H���>~�����I��H�F(H�VH�|�t}H������ڂ7I��H���+�$�)H�H9��~��L��H��L����M9u	[]A\A]A^�H���+�$�)H�SI������ڂ7H�L9���}��[I��L��]L��A\L��A]A^���[H��L��]A\A]A^�B��f���SH��H��H�5xH��@dH�%(H�D$81�H�L$(H�T$0�Z������H�T$0H�t$ H�ٿ謵������H�T$(H�t$H�ٿ荵����tUL�L$ L�D$I�yI�p������u-H��r!H�I�)tQI�(t7H�L$8dH3%(uTH��@[�H��r!H���H�|$ H�/u�d\��1���L��H�D$�S\��H�D$�L��H�D$�?\��L�D$H�D$��[��ff.���USH��H��H�5�vH��8dH�%(H�D$(1�H�L$H�T$ �D$�Y������H�T$ H�t$H�ٿ胴������H�T$H�t$H�ٿ�d�������H�=�u!���H��H����~��H�D$H�t$H�}H�KL�D$H�PH�v��H�|$H�/t9H�|$H�/t5�t$H���.�����;~��H�\$(dH3%(H��u-H��8[]��[����[����H�|$H�/u	�Z��1���1���qZ�����USH��H��H�5�uH��8dH�%(H�D$(1�H�L$H�T$ �D$�bX������H�T$ H�t$H�ٿ�S�������H�T$H�t$H�ٿ�4�������H�=�t!���H��H����}��H�D$H�t$H�}H�KL�D$H�PH�v��H�|$H�/t9H�|$H�/t5�t$H��������N}��H�\$(dH3%(H��u-H��8[]���Y�����Y����H�|$H�/u	��Y��1���1���AY�����USH��H��H�5�tH��8dH�%(H�D$(1�H�L$H�T$ �D$�2W������H�T$ H�t$H�ٿ�#�������H�T$H�t$H�ٿ��������H�=es!�`��H��H����|��H�D$H�t$H�}H�KL�D$H�PH�v�`���H�|$H�/t9H�|$H�/t5�t$H���������a|��H�\$(dH3%(H��u-H��8[]��X����X����H�|$H�/u	�X��1���1���X�����USH��H��H�5[sH��8dH�%(H�D$(1�H�L$H�T$ �D$�V������H�T$ H�t$H�ٿ������H�T$H�t$H�ٿ�԰������H�=5r!�0��H��H����{��H�D$H�t$H�}H�KL�D$H�PH�v���H�|$H�/t9H�|$H�/t5�t$H��������t{��H�\$(dH3%(H��u-H��8[]��W����W����H�|$H�/u	�nW��1���1����V�����USH��H��H�5+rH��8dH�%(H�D$(1�H�L$H�T$ �D$��T������H�T$ H�t$H�ٿ�ï������H�T$H�t$H�ٿ褯������H�=q!���H��H����z��H�D$H�t$H�}H�KL�D$H�PH�v���H�|$H�/t9H�|$H�/t5�t$H���n������z��H�\$(dH3%(H��u-H��8[]��WV����PV����H�|$H�/u	�>V��1���1���U�����ATUH��H��H�5�pSH��0dH�%(H�D$(1�H�L$H�T$ �D$�S������H�T$ H�t$H��葮������H�T$H�t$H���r�������H�=�o!����H��H���)z��H�D$H�L$H�T$H�{D�`H�qA���m����t
�S��D	�SH�|$H�/t;H�|$H�/t7�t$H���*������y��H�L$(dH3%(H��u/H��0[]A\��U����
U����1���H�|$H�/u���T��1���kT��ff.���UH��H��SH���H��(dH�%(H�D$1�H�t$�n�������y��H�l$H�sH�}�$���H�mtH���Q��H�L$dH3%(uH��([]�H��H�D$�aT��H�D$����S��D��UH��H��H��S�H��(dH�%(H�D$1�H�t$�D$�֬����tlH�=;n!�6��H��H���/y��H�D$H�{H�L$H�UH�p����H�|$H�/t2�t$H��������y��H�L$dH3%(H��uH��([]�1����S�����S��fD��UH��H��H��S�H��(dH�%(H�D$1�H�t$�D$������tlH�={m!�v��H��H����x��H�D$H�{H�L$H�UH�p��H�|$H�/t2�t$H���������x��H�L$dH3%(H��uH��([]�1�����R�����VR��fD��UH��H��H��S�H��(dH�%(H�D$1�H�t$�D$�V�����twH�=�l!���H��H���x��H�D$H�T$H�{H�p�c����t�sH�|$H�/t.�t$H���4������w��H�L$dH3%(H��uH��([]��R����1����Q��f���H��H��H��dH�%(H�D$1�H��襪����tH�$H�|$dH3<%(u	H���1����?Q��ff.�@��UH��H��H��S�H��(dH�%(H�D$1�H�t$�D$�6�����twH�=�k!���H��H���%w��H�D$H�T$H�{H�p�C����t�c�H�|$H�/t.�t$H��������w��H�L$dH3%(H��uH��([]��P����1����rP��f���SH��H��H���H�� dH�%(H�D$1�H�t$��������v��H�|$H����H�|$H�/��v��H�L$dH3%(uH�� [��P����H��(H��H��dH�%(H�D$1�H�t$������tNH�|$�GuH�W0H�G@H�|�t&H�uf!H�H�/t&H�t$dH34%(u'H��(�H�Wf!H���1���H�D$��O��H�D$���gO�����H��(H��H��dH�%(H�D$1�H�t$�s�����t5H�|$�G��u��H��e!H�H�/tH�t$dH34%(uH��(�1���H�D$�lO��H�D$����N����H��(H��H��dH�%(H�D$1�H�t$����t>H�|$�Gt&H�me!H�H�/t&H�t$dH34%(u'H��(�H�?e!H���1���H�D$��N��H�D$���WN�����H��(H��H��dH�%(H�D$1�H�t$�c�����t1H�|$�Gu*H��d!H�H�/t&H�t$dH34%(u'H��(�1���H��d!H���H�D$�SN��H�D$����M�����H��(H��H��dH�%(H�D$1�H�t$�Ӧ����t5H�|$�G�(t��H�Ad!H�H�/tH�t$dH34%(uH��(�1���H�D$��M��H�D$���@M����H��(H��H��dH�%(H�D$1�H�t$�S�����t5H�|$�G��s��H��c!H�H�/tH�t$dH34%(uH��(�1���H�D$�LM��H�D$���L����H��(H��H��dH�%(H�D$1�H�t$�ӥ����t5H�|$�G�Hs��H�Ic!H�H�/tH�t$dH34%(uH��(�1���H�D$��L��H�D$���@L����SH��H��H���H�� dH�%(H�D$1�H�t$�O�����t=L�D$H�sI�x�����u+H��b!H�I�(t'H�L$dH3%(u+H�� [�1���H��b!H���L��H�D$�0L��H�D$���K��@��SH��H��H���H�� dH�%(H�D$1�H�t$诤����tJL�D$H�sI�x������t'H�b!H�I�(t'H�L$dH3%(u+H�� [�H��a!H���1���L��H�D$�K��H�D$���K��@��USH��H��H�5KfH��8dH�%(H�D$(1�H�L$H�T$ �D$��H������H�T$ H�t$H�ٿ�������H�T$H�t$H�ٿ�ģ������H�=%e!� ��H��H����q��H�D$H�t$H�}H�KL�D$H�PH�v��H�|$H�/t9H�|$H�/t5�t$H��������\q��H�\$(dH3%(H��u-H��8[]��wJ����pJ����H�|$H�/u	�^J��1���1����I�����USH��H��H�5eH��8dH�%(H�D$(1�H�L$H�T$ �D$��G������H�T$ H�t$H�ٿ賢������H�T$H�t$H�ٿ蔢������H�=�c!����H��H����p��H�D$H�t$H�}H�KL�D$H�PH�v����H�|$H�/t9H�|$H�/t5�t$H���^�����op��H�\$(dH3%(H��u-H��8[]��GI����@I����H�|$H�/u	�.I��1���1���H�����USH��H��H�5�cH��8dH�%(H�D$(1�H�L$H�T$ �D$�F������H�T$ H�t$H�ٿ胡������H�T$H�t$H�ٿ�d�������H�=�b!���H��H����o��H�D$H�t$H�}H�KL�D$H�PH�v����H�|$H�/t9H�|$H�/t5�t$H���.������o��H�\$(dH3%(H��u-H��8[]��H����H����H�|$H�/u	�G��1���1���qG�����USH��H��H�5�bH��8dH�%(H�D$(1�H�L$H�T$ �D$�bE������H�T$ H�t$H�ٿ�S�������H�T$H�t$H�ٿ�4�������H�=�a!���H��H����n��H�D$H�t$H�}H�KL�D$H�PH�v����H�|$H�/t9H�|$H�/t5�t$H���������n��H�\$(dH3%(H��u-H��8[]���F�����F����H�|$H�/u	��F��1���1���AF�����USH��H��H�5�aH��8dH�%(H�D$(1�H�L$H�T$ �D$�2D������H�T$ H�t$H�ٿ�#�������H�T$H�t$H�ٿ��������H�=e`!�`��H��H���n��H�D$H�t$H�}H�KL�D$H�PH�v���H�|$H�/t9H�|$H�/t5�t$H����������m��H�\$(dH3%(H��u-H��8[]��E����E����H�|$H�/u	�E��1���1���E�����UH��H��H��S�H��(dH�%(H�D$1�H�t$�D$������tlH�={_!�v��H��H����m��H�D$H�{H�L$H�UH�p����H�|$H�/t2�t$H���������m��H�L$dH3%(H��uH��([]�1�����D�����VD��fD��UH��H��H��S�H��(dH�%(H�D$1�H�t$�D$�V�����tlH�=�^!���H��H���Zm��H�D$H�{H�L$H�UH�p�`��H�|$H�/t2�t$H���8�����9m��H�L$dH3%(H��uH��([]�1����D�����C��fD��UH��H��H��S�H��(dH�%(H�D$1�H�t$�D$薜����tlH�=�]!���H��H����l��H�D$H�{H�L$H�UH�p����H�|$H�/t2�t$H���x������l��H�L$dH3%(H��uH��([]�1����]C������B��fD��UH��H��H��S�H��(dH�%(H�D$1�H�t$�D$�֛����tlH�=;]!�6���H��H���>l��H�D$H�{H�L$H�UH�p���H�|$H�/t2�t$H��������l��H�L$dH3%(H��uH��([]�1����B�����B��fD��UH��H��H��S�H��(dH�%(H�D$1�H�t$�D$������tlH�={\!�v���H��H����k��H�D$H�{H�L$H�UH�p��]��H�|$H�/t2�t$H���������k��H�L$dH3%(H��uH��([]�1�����A�����VA��fD��AWH��H��AVAUATUH���SH��8dH�%(H�D$(1�H�t$ �D$�N�������H�=�[!誾��H��H���Dk��L�d$ L�pL�EL�l$A�D$M�|$���j���uRL��L��L��L���]��H�|$ H�/tI�t$H���
�����k��H�L$(dH3%(H��u-H��8[]A\A]A^A_�L��L��L��L���\�����@���1���P@����UH�
Tv!H��H��SH��H�u\H��8H� W!dH�%(H�D$(1�L�L$L�D$ �D$H�\$�l>�����H�L$H9�����H�D$H����H�(�]j��H�L$H�t$H��������H�L$H�T$ H�t$��ј������H�=2Z!�-���H��H���!j��H�T$H�t$L�D$H�|$H�JH�VH�wH�x�x��H�|$H�/��i��H�|$H�/u�?���t$H�|$�����uH�T$(dH3%(H��uFH��8[]�H�muH���n?��1���H�yH�5/[!H9������i��H�|$H�/�Ji��1���>��f���UH�
�t!H��H��SH��H��ZH��8H��U!dH�%(H�D$(1�L�L$L�D$ �D$H�\$��<�����H�L$H9����Q���H�D$H����H�(�qi��H�L$H�t$H���R�������H�L$H�T$ H�t$��1�������H�=�X!荻��H��H����h��H�T$H�t$L�D$H�|$H�JH�VH�wH�x���H�|$H�/��h��H�|$H�/u�	>���t$H�|$�����uH�T$(dH3%(H��uFH��8[]�H�muH����=��1���H�yH�5�Y!H9������h��H�|$H�/�+h��1���=��f���UH�
�r!H��H��SH��H�5YH��8H��S!dH�%(H�D$(1�L�L$L�D$ �D$H�\$�,;�����H�L$H9���豾��H�D$H����H�(�h��H�L$H�t$H��貕������H�L$H�T$ H�t$�葕������H�=�V!���H��H����g��H�T$H�t$L�D$H�|$H�JH�VH�wH�x����H�|$H�/��g��H�|$H�/u�i<���t$H�|$�K�����uH�T$(dH3%(H��uFH��8[]�H�muH���.<��1���H�yH�5�W!H9������lg��H�|$H�/�g��1���y;��f���UH�
q!H��H��SH��H��WH��8H�@R!dH�%(H�D$(1�L�L$L�D$ �D$H�\$�9�����Mg��H�L$H9�������H�D$H���,g��H�(�gg��H�L$H�t$H���������g��H�L$H�T$ H�t$������g��H�=RU!�M���H��H����f��H�T$H�t$L�D$H�|$H�JH�VH�wH�x�ؼ��H�|$H�/��f��H�|$H�/u��:���t$H�|$諼����u3H�T$(dH3%(H��u7H��8[]�H�yH�5bV!H9��%����f��H�m�2f��H��1��o:�����9�����UH�
do!H��H��SH��H�VH��8H��P!dH�%(H�D$(1�L�L$L�D$ �D$H�\$�7�����H�L$H9���聻��H�D$H����H�(��e��H�L$H�t$H��肒������H�L$H�T$ H�t$��a�������H�=�S!轶��H��H����e��H�T$H�t$L�D$H�|$H�JH�VH�wH�x踵��H�|$H�/��e��H�|$H�/t,�t$H�|$� �����u!H�T$(dH3%(H��uMH��8[]��
9����H�muH���8��1���H�yH�5�T!H9������Je��H�|$H�/��d��1���G8�����UH�
�m!H��H��SH��H�eTH��8H�O!dH�%(H�D$(1�L�L$L�D$ �D$H�\$�\6�����H�L$H9������H�D$H����H�(��d��H�L$H�t$H���������H�L$H�T$ H�t$��������H�="R!����H��H����d��H�T$H�t$L�D$H�|$H�JH�VH�wH�x�x���H�|$H�/�bd��H�|$H�/t,�t$H�|$耹����u!H�T$(dH3%(H��uMH��8[]��m7����H�muH���\7��1���H�yH�5S!H9������+d��H�|$H�/��c��1���6�����UH�
�k!H��H��SH��H��RH��HH�pM!dH�%(H�D$81�L�L$L�D$0H�\$��4������H�L$H9����I���H�D$H����H�(�d��H�L$H�t$(H���J�������H�L$H�T$0H�t$ ��)�������c��L�L$(L�D$ I�yI�p�z�������c��H��L!H�I�)�\c��I�(uL��H�D$�6��H�D$H�L$8dH3%(u$H��H[]�H�yH�5�Q!H9��N����c��1����\5��ff.����UH�
tj!H��H��SH��H�uQH��8H� L!dH�%(H�D$(1�L�L$L�D$ �D$H�\$�l3�����H�L$H9��
��H�D$H����H�(�c��H�L$H�t$H��������H�L$H�T$ H�t$��э������H�=2O!�-���H��H����b��H�T$H�L$H�x�jH�qH�T$��������t
�s��	�@�sH�|$H�/��b��H�|$H�/tC�t$H�|$腶�����tb��H��H�\$(dH3%(u:H��8[]�H�|$H�/��b��1����[4���H�yH�5P!H9�������a���3��ff.���UH�
�h!H��H��SH��H��OH��H�}J!dH�%(H��$�1�L�L$L�D$H�\$��1�����Bb��H�L$H9��:�S���H�D$H���!b��H�(�\b��H�L$H�t$H���T�������a��H�L$H�T$H���5������b��H�=�M!葰��H��H����a��H�t$H�$�oN0H�~@�oF �VH�t$PL$8�oY0�oQ H�|$HD�A��H�|$ L�I@��@D$(A��T$XA��@\$hL�L$x�T$ D�D$P�C�1�H�}�����1ɉ���<��H�|$H�/�Ma��H�<$H�/u�2��H��$�dH3%(H��u#H�Ę[]�H�yH�5SN!H9������`����1����UH�
�f!H��H��SH��H�NH��8H��H!dH�%(H�D$(1�L�L$ L�D$H�\$ �0�����a��H�L$ H9���虳��H�D$ H����`��H�(�1a��H�L$ H�t$H��蚊������`��H�L$ H�T$H�t$��y�������`��H�=�K!�ծ��H��H���y`��H�T$H�L$H�rH�y���1�H�}�����1ɉ��{;��H�|$H�/�{`��H�|$H�/t3H�L$(dH3%(H��u'H��8[]�H�yH�5�L!H9��7�����_���1�����0��f���UH�
e!H��H��SH��H��LH��8H�`G!dH�%(H�D$(1�L�L$L�D$ �D$H�\$�.�����)`��H�L$H9����1���H�D$H���`��H�(��_��H�L$H�t$H���2�������_��H�L$H�T$ H�t$��������3`��H�=rJ!�m���H��H����_��H�T$H�t$L�D$H�|$H�JH�VH�wH�x����H�|$H�/��_��H�|$H�/tI�t$H�|$�����F_��H�\$(dH3%(H��u'H��8[]�H�yH�5�K!H9��&����0_���/����/��f���UH�
dc!H��H��SH��H�5KH��8H��E!dH�%(H�D$(1�L�L$L�D$ �D$H�\$�,-�����H�L$H9���豰��H�D$H����H�(�_��H�L$H�t$H��貇������H�L$H�T$ H�t$�葇������H�=�H!���H��H����^��H�T$H�t$L�D$H�|$H�JH�VH�wH�x���H�|$H�/��^��H�|$H�/u�i.���t$H�|$�K�����uH�T$(dH3%(H��uFH��8[]�H�muH���..��1���H�yH�5�I!H9������c^��H�|$H�/�^��1���y-��f���UH�
�a!H��H��SH��H��IH��8H�@D!dH�%(H�D$(1�L�L$L�D$ �D$H�\$�+�����H�L$H9�������H�D$H����H�(��]��H�L$H�t$H����������H�L$H�T$ H�t$�������H�=RG!�M���H��H����]��H�T$H�t$L�D$H�|$H�JH�VH�wH�x�h���H�|$H�/�y]��H�|$H�/u��,���t$H�|$諮����uH�T$(dH3%(H��uFH��8[]�H�muH���,��1���H�yH�5OH!H9������D]��H�|$H�/��\��1����+��f���UH�
�_!H��H��SH��H��GH��8H��B!dH�%(H�D$(1�L�L$L�D$ �D$H�\$��)�����H�L$H9����q���H�D$H����H�(��\��H�L$H�t$H���r�������H�L$H�T$ H�t$��Q�������H�=�E!譨��H��H����\��H�T$H�t$L�D$H�|$H�JH�VH�wH�x���H�|$H�/�Z\��H�|$H�/u�)+���t$H�|$������uH�T$(dH3%(H��uFH��8[]�H�muH����*��1���H�yH�5�F!H9������%\��H�|$H�/��[��1���9*��f���UH�
$^!H��H��SH��H�UFH��8H�A!dH�%(H�D$(1�L�L$L�D$ �D$H�\$�L(�����H�L$H9����ѫ��H�D$H����H�(��[��H�L$H�t$H���҂������H�L$H�T$ H�t$�豂������H�=D!�
���H��H���a[��H�T$H�t$L�D$H�|$H�JH�VH�wH�x�h���H�|$H�/�d[��H�|$H�/tX�t$H�|$�p�����uH�T$(dH3%(H��uMH��8[]�H�muH���S)��1���H�yH�5E!H9������[���1)���H�|$H�/��Z��1���(�����UH�
d\!H��H��SH��H��DH��8H�`?!dH�%(H�D$(1�L�L$L�D$ �D$H�\$�&�����H�L$H9����1���H�D$H����H�(��Z��H�L$H�t$H���2�������H�L$H�T$ H�t$���������H�=rB!�m���H��H���^Z��H�T$H�t$L�D$H�|$H�JH�VH�wH�x����H�|$H�/�
Z��H�|$H�/u��'���t$H�|$�˩����uH�T$(dH3%(H��uFH��8[]�H�muH���'��1���H�yH�5oC!H9�������Y��H�|$H�/��Y��1���&��f���AUH�
�Z!ATUH��H��H��SH�CH��8H��=!dH�%(H�D$(1�L�L$L�D$ �D$H�\$�%�����+H�L$H9��!荨��H�D$H���
H�(��Y��H�L$H�t$H���������H�L$H�T$ H�t$��m�����H�=�@!�ɣ��H��H���)Y��H�L$H�T$H�hL�iL�b�B���A��L��L����1�H�����1ɉ��R0��H�|$H�/��X��H�|$H�/u�#&���t$H�|$������uH�L$(dH3%(H��uuH��8[]A\A]�H�+uH����%��1���H�yH�5�A!H9�����X��H�t$L�D$L��H��H�NL�������b����<���H�|$H�/�X��1��x����%��@��ATH�
�[!UH��H��H��SH�_@H��`H��;!dH�%(H�D$X1�L�L$L�D$�D$H�\$H�\$�#�����H�D$H9���蚦��H�D$H����H�(��\��H�D$L�d$ H�p�L���H�|$H9�u]H�=�>!��H��H����1�H�pH�UL��L�D$�����t$H�|$胦����uoH�L$XdH3%(H��uqH��`[]A\��n�����xX���;\���D$D�H�xH�5 @!H9��Z����"#�����1\��H�#:!H�561�H�:�$���H�+uH���$��1��|����#��fD��UH��H��H��S�H��(dH�%(H�D$1�H�t$�D$�|����tqH�=�=!���H��H����[��H�D$�H�MH�sL�D$H�P���H�|$H�/t2�t$H���c�������[��H�L$dH3%(H��uH��([]�1����H#�����"�����UH��H��H��S�H��(dH�%(H�D$1�H�t$�D$��{����tnH�=+=!�&���H��H���m[��H�D$1�H�MH�sL�D$H�P�-���H�|$H�/t2�t$H��覤�����J[��H�L$dH3%(H��uH��([]�1����"�����"��@���G��[��H�G@H�W0H�|��������f.���UH�
tZ!SH��H��H��H��=H��(H�-�8!dH�%(H�D$1�L�D$H�l$�������H�D$H9���H�xH�5�=!H9�u]1҃xPH�s���H�|$��脿��H���K[��H�|$H���N���H�|$H��p8!H�L$dH3%(H��uUH��([]��a �����[��H�b7!H�5C31�H�:��!������H�D$H��tH�(��Z��H�D$�Y���1��� ����UH��SH�����H����Z��H�uH��H��1�H�=<�= ��H�+��Z��H��[]�ff.����SH������H����Z��H��H������H�+uH���D$� ���D$f.�{H��f��[���u��D$�?��H���{Z���D$��ff.���SH��H��H���H��0dH�%(H�D$(1�H�t$ ��x����tl1�H�D$ �{PH�|$�¹��H�p�ǽ��H�|$ H�/tAH���\Z��H�|$H��膝��H�|$H���6!H�L$(dH3%(H��uH��0[�1���H�D$���H�D$��%��D���GuH�W0H�G@H�|�tH��5!H��H��5!H��ff.���AWAVAUATUSH��H��H��(dH�%(H�D$1��b���H����\���{H�Ń��j��I��H����\���E�����x�H��<H�=�9HD��q��I��M���H\��H�}��1�E1�� ��H��H���4\��H�=eY!H��E1�L��L��1�I���W��H���E�����"M��t	L���B5!M��tI�m�\��M��t
I�.��[��M��tI�,$�\��H�t$dH34%(H���H��([]A\A]A^A_Àe�H�|$�H��H�E�躻��L�|$M����[��1�L��H���H��H�y�H�|$�0��I��H����[��E1�L;L$}0G�L�$A��0Ic����H��H������L�$K�D�I����L������H�{ ���I�����H�}(�74!�E����H��%4!����H�=$7����I��H����Z��1�H�=�81�E1��e��H��H���e����rZ�����ff.�@��SH��H������H���k\��H�(�i\��H��H�ߺH��[�W�����SH��H���?���H���J\��H�(�H\��H��H�ߺH��[������AUATI��UH��SH��XdH�%(H�D$H1��D$H�D$�֝��H���2H�(H���\��1�H�T$H�5�7H���������H�|$H����H�WH�D$@�D$�fo��fo
f�H�D$8H�D$@D$L$(������l��I��H�����H�=�5!�Ә��H��H�����H��?I9���I��I�t$H�}L�l$H�KH�T$L�D$�V���t$H���E�����u7H�L$HdH3%(H����H��X[]A\A]úH��L�����H����H�muH�����1������H��u�H�=&5!�!���H��H���`���1��H�=�0!H�5k21�H�?�Y���s���I���������3����0��AWH��AVH��AUATUSH��8L�D$H9��%_��H�
H��H�T$I��I��I��H��H�Hc�H���r]���H�� H9��8]��A�I��I9�tM��I��M�I9���L��H�����H���ۇ��I��H���Y^��H���LJ��H�D$H���5^��H��豇��H�D$ H����]��H��L��L��H�����H�|$H��L�����H��H�l$ L��H������M9��_]��1�H��L���Y�����.]��H�|$�H���nY�����]���H��H���VY�����	H�t$H�>H�|$(H����H�D$1�1�E1��L�D$L�L$ H�����O�|�O��O��I9��1\��I9���]��L��L)�M9��>H�����L�\$H�H���������蝧��L�D$H�����H��I��"I����L�bM9��7]��L��L��L��I����I��H)�L9��	H�@PTL���7���H��H�����H��I��I��I��H�����H��I�H��H��L����\��M�M��H�T$M�L�L��I��H��H�H��@��M9�I����#NJD��L�H�L9��P\��I��I��H��H��I��K�T�H��I��L9t$(�"H�D$���DH�����L�\$���ff.��H����H9��2I��H����L��H��L��H)�I9���H����H�@PT����I��H�����I��H��I��H�����I��H��H���[��M�H�T$L�I�H��M��H��1�H�H����#NJ��L9�H�H�H9��=[��H�D$I��#NJI��H��L��I��K�T�H��I��L9t$(�q���H�|$�f-!H�|$ �[-!L�l$H�D$H��8[]A\A]A^A_�f�I����L�����K��(�����Y���Z����Z��fDAWI��AVM��AUI��ATI��UL��SH��H��D�
�D3	A�����H�QH�I(H�|�t;I��H��L��L���'�H��L��L���&��H��H��L��[L��]A\A]A^A_�&��I�|$M�D$(I�|����A��L���F���1�L���7���MH��[]A\A]A^A_�I��L��H��L��D�L$�K��D�T$��u?D�A��A�$��j��E��tj�1�L�������1�L�������M�H��H��L��L��[]A\A]A^A_����1�L������1�L������M�O���A��L���n���ff.����ATI��UH��SH��0dH�%(H�D$(1��D$����H����j��H�(H����j��1�H�t$ H��H���m�����1�H�t$H��L���l������H�=`.!�[���H��H���Ej��H�=H.!�C���I��H����i��H�D$H�T$ H�}I�t$L�L$L�CH�HH�R���H�|$ H�/��H�|$H�/u����t$H��裕����uC1�L��H�=_/H������I�,$�j��H�m��i��H�L$(dH3%(uVH��0[]A\�I�,$uL���]��H�m�qi��H���J��1��H�D$ �H�|$ H�/�i��H�D$��$���P������f.���ATI��H��H�5�-USH��@dH�%(H�D$81�H�L$(H�T$0�D$������	H�T$0H�t$ L���qk������H�T$(H�t$L���Rk������H�=�,!讏��H��H���pi��H�=�,!薏��H��H���i��H�D$H�T$ H�{H�uL�L$M�D$H�HH�R��H�|$ H�/u�!��H�|$H�/u����t$L�������uF1�H��H�=�-H���-��H�m��h��H�+�oh��H�\$8dH3%(uBH��@[]A\�1���H�muH�����H�+u�H�����1���H�|$ H�/u����1��������ATI��UH��SH�� dH�%(H�D$1��D$���H����h��H�(H����h��H��H�t$H��1���i��H�l$����1�H�t$H��L����i������H�=++!�&���H��H���Oh��H�D$H�t$H�}H�KL�D$H�PH�v��H�|$H�/tBH�|$H�/t0�t$H��蔒�����#h��H�T$dH3%(H��u-H�� []A\��{�����t���H�|$H�/��g��H�l$��������ATI��UH��SH�� dH�%(H�D$1��D$豑��H���Gh��H�(H���ah��H��H�t$H��1��h��H�l$����1�H�t$H��L���h������H�=�)!���H��H����g��H�D$H�t$H�}H�KL�D$H�PH�v���H�|$H�/tBH�|$H�/t0�t$H���d�������g��H�T$dH3%(H��u-H�� []A\��K�����D���H�|$H�/�=g��H�l$�����AWf��I��AVI��AUI��ATM��USH��H��fo��dH�%(H��$�1�H��$�H��$��D$@0L$HD$XH�D$h�D$0L$D$(H�T$8���A���I�OI�w(H�|��tL9��5k��H�l$M��M��L��L��H��H�����D$���H�{L�C(I�|����L�KA�LKM)�MWMWI����H�L$(H�t$8L�\�I���ɚ;�I��'��I��c��I��
���Lc�H�|=�D$J��H��I9��5H�|$ H�|$H���ѿ��L�D$pL�lj$�Q���A�E���A����D8����у�H��M�HL��H�������$�����i��H��H���R�����xiu�<$ua�D$@����i����Ti���D$���2i�����h��L��L��H������H��$�dH3%(��H�ĸ[]A\A]A^A_Ã|$�8L��H��H������M��L��L��L��H�������u�A�u+A���h��L��L��H�����L��L��H���F���s���L��H�������^���I�������u���I��?Bv#�	I�����Z���I���������I���I��������8���M�VM�^(K�|�u�L�¾�a��������r���H��?z�ZI9���g��H���c����
I9���g��I����o�#M9��Xg��I��Ƥ~�M9���׃����L�D$M9E�������g��I����#NJH��H����g���D$�����
��@��UH�
d?!H��H��SH��H��&H��8H��!!dH�%(H�D$(1�L�L$L�D$ �D$H�\$�������H�L$H9����q���H�D$H����H�(��g��H�L$H�t$H���rc������H�L$H�T$ H�t$��Qc������H�=�$!譇��H��H����g��H�T$H�t$L�D$H�|$H�JH�VH�wH�x�(���H�|$H�/�Cg��H�|$H�/t,�t$H�|$������u!H�T$(dH3%(H��uMH��8[]��	����H�muH����	��1���H�yH�5�%!H9������g��H�|$H�/��f��1���7	�����UH�
�@!H��H��SH��H�V%H��(H� !dH�%(H�D$1�L�D$�D$H�\$�Q������H�D$H9�u|�ڊ��H�D$H����H�(��h��H�=[#!�V���H��H����H�t$H�xH�L$H�VH�u�����t$H�|$�����uMH�L$dH3%(H��uLH��([]�H�xH�5�$!H9�t������u�H��!H�5�1�H�:�2	���H�+uH�����1���	��f���UH�
�<!H��H��SH��H�$$H��PH��!dH�%(H�D$@1�H�D$�D$H�\$P1�L�L$8L�D$@���ZY���FH�L$H9��<藉��H�D$H���%H�(��j��H�L$H�t$ H���`������H�L$H�T$0H�t$��w`�����-j��H�L$H�T$(H�t$��V`������H�=�!!貄��H��H���#j��H�t$H�|$ L�L$H�L$L�D$H�VH�wH�IH�xM�@�D��H�|$ H�/�j��H�|$H�/t@H�|$H�/u����t$H�|$�����u%H�\$8dH3%(H����H��H[]������H�muH������1���H�yH�5�"!H9�����������Ri��H��!H�5y1�H�:�'���H�|$ H�/�i��H�|$H�/�i��1��h�������ff.���UH��H��H��S�H��(dH�%(H�D$1�H�t$�D$��^����tlH�=K !�F���H��H����p��H�D$H�{H�L$H�UH�p��%��H�|$H�/t2�t$H���ȇ������p��H�L$dH3%(H��uH��([]�1���������&��fD��UH�
4<!H��H��SH��H�F!H��(H��!dH�%(H�D$1�L�D$�D$H�\$�A������H�D$H9�toH�xH�5!!H9���H�=T!�O���H��H��toH�t$H�xH�L$H�VH�u��$���t$H�|$�ކ����u4H�L$dH3%(H��uZH��([]��[���H�D$H��tH�(u���o��H�+uH�����1��������l���H��!H�5a1�H�:��������AWf�AVA��AUI��ATM��UH��H��SH��xfo
ԏdH�%(H��$h1�H�\$0H�D$`�$0H��D$I��L$H�D$(�ɑ��I�UH�KH��H��H�T$0H���*��H�t$0L��L���
)��A���Tr��M��I��L��H��H��1��=����$���r����r��H��$hdH3%(uH��x[]A\A]A^A_����ff.�@AWI��AVI��AUI��H��ATUH�͹SH��(	dH�%(H��$	1�H�\$ H���A�u�D$D@���I�}(I�MH�T�H���|@���H���ɚ;�$H��'�eH��c�3H��
�����L�p2H�I;���I�UIUL�b�L��M��yH��H��������H�I;F��q��A�~,��q��fo�f��L��$H��$L��$L��$Ƅ$�0�$��$�L��$Ƅ$�0�$��$�H��$�Ƅ$�0�$��$�L��$��D$P0L$XD$hL�T$xM9���q��M�H��$�H�{�D$HH��$�H�L$L��$�I��H�4$L�\$H�|$H�T$H��L��1�I��H�T$ L������H��$�L��fo��M�GMGL+D$ ��$��L��$�HDŽ$�裱��M�L�D$H��H�|$L��L��L�L$ ���L�D$H��L��H�<$L������A�u=M�WM�_(K�|�t-��$��$���zH�4$H�|$�!�����sE�v(H�T$0H��L��H�t$ D�t$H�{h��H��H��L���]����$����G���o����$����7o����Jo����$����Io����\o���D$P����o�����o��H��$	dH3%(��H��(	[]A\A]A^A_�H��H����M�uMuL��H���2L��@��1���	��H��H��L������H��?z�ZH9�wfH���vHH9���I���rN	L9��I�����I9���Ѓ�
���H��?Bv]H�����*n��H�����������I���c����
L9���m��I����o�#L9���I��Ƥ~�I9���Ѓ��H���H��������7���H��L��L���s���������A�E�{m��H��L���@������I���TI9���Ѓ������L)����H����������������L���#����>���I����]xEcI9���Ѓ������~����MH�D$�������fm���m��ff.����UH��H��H��S�H��(dH�%(H�D$1�H�t$�D$�V����tlH�=!�{��H��H����m��H�D$H�{H�L$H�UH�p�?���H�|$H�/t2�t$H���������m��H�L$dH3%(H��uH��([]�1����m��������fD��UH�
4!H��H��SH��H�H��(H��!dH�%(H�D$1�L�D$�D$H�\$��������H�D$H9�toH�xH�5�!H9���H�=!�z��H��H��toH�t$H�xH�L$H�VH�u�L����t$H�|$�~����u4H�L$dH3%(H��uZH��([]��~��H�D$H��tH�(u��l��H�+uH���h���1���?������l���H�@!H�5!1�H�:�����������UH��H��H�=N!SH��dH�%(H�D$1��D$��;��H���s��H�uH�xH��H�T$����t$H����}����uH�L$dH3%(H��uH��[]�H�+��r��H��1����������f���UH��H��H��S�H��(dH�%(H�D$1�H�t$�D$�T����tlH�={!�vx��H��H���Ht��H�D$H�{H�L$H�UH�p��(��H�|$H�/t2�t$H���|�����'t��H�L$dH3%(H��uH��([]�1����������V���fD��UH�
t1!H��H��SH��H�vH��(H� !dH�%(H�D$1�L�D$�D$H�\$�q�������H�D$H9�toH�xH�54!H9���H�=�!�w��H��H��toH�t$H�xH�L$H�VH�u��'���t$H�|$�|����u4H�L$dH3%(H��uZH��([]��{��H�D$H��tH�(u��&s��H�+uH������1��������l���H��!H�5�1�H�:�?�����(������AWAVAUATUSQH�*!H�
C���H�t!H�M!H�
N!�=�3!H�H!H�1!H�"!��r��H��!�o3!L�%�!L�Y!I�t$`M�Z`H�~L���L�N(M�k@H�5H�=3!I���L�i3!L�
r3!L�-S3!�N]��H�?3!H���_u��I��$�H�5��*]��H�3!H���;u��L�5�!H�=�!L�5�!L�5^!L�5!L�5p!����u��H�=<!�w����t��H�=H!�c����t��H�=�!�O����t��H�=��H��H����t��H�=P!H��H�5$�����t��H�=�!H��H�5����^t��H�+�Gt��H�=����I��H���Rt��H�5�H������H��H����s��H��H�
�!1�H��H�5��w�H����s��H�(��s��H�5�L������H��1!H����s��I�/�]s��H�+�,s��H�=|�U���I��H����s��H��L�m1�H�
yH�H�5}���I��H��1!H����p��H�=��t�H��H����r��H��1!H��H�5�H���[���up��H�+�r��H�="���H��H����r��H�5H�����H��H����q��H�=�!I��1�H�
S
!H��H�5�����I��H��0!H���p��I�,$��q��H�+�wq��H�m�_q����H�=�(!�\���I��H����r��H�)!H�5)H��H�!�r���q��H��!H�5�L��H��!�L����p��H�e0!H�5	L��H��*����p��H�
�!1�H�=4H�1�
���I��H��/!H���6o��H�H��H�5L�������p���	���I��H�E0!H����n��H�-�-!A��������@�wH�5K/!�1��_�H��H���p��H��1�H���b�I��H��H����n��H�+��o��H��H��L��H��+����o��H��L��/!Ic�A��H�� H�I�t�A���tL����t5�=������L���L�%�
!I�$H�5�.!�1���H���<���L�%
!��L�
-!L�5a+!L�
R+!M�&M����A�~H�5�,!���1��P�H��H���o��I�~1�H���V�I��I�FH����m��H�+��n��I�VI�6L��H��)�����n��I�� �H�
-!H�E-!�1�H�5-!���H���v���H�#-!H�5�,!�1���H���T���H�y	!�1�H���H���E���1�H�=�!��H��H��-!H���-n��H�H��H�5�L���{�����l��1�H�=����H��H�c-!H����m��L�=	!H�5�L��I�L���5����ll��I�L��H�5�L�������Nl��1�H�=F!�a�H��H�-!H����m��A�H�H��L��I��"I����fo�~H�� L�p H�5.H�@(�KL�P0H�h8�@P@������k��1�H�=�
!���H��H��,!H���
m��A�H�H��L��I��!fo
~L�p H�5�H�@(L�X0H�h8�@PH�'����^k��L�=�#!I�H��t1I���H��H����l��I�7H��L��������k��I����H�-�+!L�eM����j��1�L�=�!M�4/L���v�H��H��+!H�(H���;l��H�H��L��L��������j��H��H��@u�H�H�5L���5�����j��H��
H�5�
L������xZL��[]A\A]A^A_��nj����H��H���valid values for signals are:
  [InvalidOperation, FloatOperation, DivisionByZero,
   Overflow, Underflow, Subnormal, Inexact, Rounded,
   Clamped]{<class '%s'>:%s, <class '%s'>:%s, <class '%s'>:%s, <class '%s'>:%s, <class '%s'>:%s, <class '%s'>:%s, <class '%s'>:%s, <class '%s'>:%s, <class '%s'>:%s}valid values for capitals are 0 or 1argument must be a sequence of length 3sign must be an integer with the value 0 or 1string argument in the third position must be 'F', 'n' or 'N'coefficient must be a tuple of digitsinternal error in dec_sequence_as_stroptional argument must be a contextinternal error in flags_as_exceptionargument must be a signal dictvalid values for rounding are:
  [ROUND_CEILING, ROUND_FLOOR, ROUND_UP, ROUND_DOWN,
   ROUND_HALF_UP, ROUND_HALF_DOWN, ROUND_HALF_EVEN,
   ROUND_05UP]invalid decimal point or unsupported combination of LC_CTYPE and LC_NUMERICinternal error: could not find method %svalid range for Emin is [MIN_EMIN, 0]/builddir/build/BUILD/Python-3.8.17/Modules/_decimal/libmpdec/typearith.hmul_size_t(): overflow: check the contextadd_size_t(): overflow: check the contextinternal error in context_reprContext(prec=%zd, rounding=%s, Emin=%zd, Emax=%zd, capitals=%d, clamp=%d, flags=%s, traps=%s)internal error in context_settraps_dictinternal error in context_setstatus_dictcontext attributes cannot be deletedvalid values for clamp are 0 or 1valid range for Emax is [0, MAX_EMAX]valid range for prec is [1, MAX_PREC]sub_size_t(): overflow: check the contextinternal error in context_settraps_listinternal error in context_setstatus_listconversion from %s to Decimal is not supportedinternal error in PyDec_ToIntegralExactinternal error in PyDec_ToIntegralValueinternal error in dec_mpd_qquantizecannot convert signaling NaN to floatoptional argument must be a dictformat specification exceeds internal limits of _decimalcannot convert Infinity to integeroptional arg must be an integercannot convert NaN to integer ratiocannot convert Infinity to integer ratio/builddir/build/BUILD/Python-3.8.17/Modules/_decimal/libmpdec/mpdecimal.clibmpdec: internal error in _mpd_base_ndivmod: please reportCannot hash a signaling NaN valuedec_hash: internal error: please reportexact conversion for comparison failedargument must be a tuple or list/builddir/build/BUILD/Python-3.8.17/Modules/_decimal/libmpdec/context.cmpd_setminalloc: ignoring request to set MPD_MINALLOC a second time
TrueFalseFInfsNaNexponent must be an integer%s%liargument must be a contextargument must be a Decimalsignal keys cannot be deletedinvalid signal dict%s:%d: error: +Infinity+Zero+Normal-Subnormal-Infinity-Zero-Normal+Subnormal%s, O(nsnniiOO)|OOOOOOOOargument must be an integerO|OOO(O)-nanDecimal('%s')format arg must be str.,invalid format stringdecimal_pointthousands_sepgroupinginvalid override dict(i)cannot convert NaN to integer%s:%d: warning: (OO)OO|Oargument must be int or floatnumeratordenominatoras_integer_ratiobit_length__module__numbersNumberregisterRationalcollectionssign digits exponentDecimalTuple(ss)namedtuplecollections.abcMutableMappingSignalDicts(OO){}decimal.DecimalExceptionDefaultContextdecimal_contextHAVE_CONTEXTVARHAVE_THREADSBasicContextExtendedContext1.70__version__2.4.2__libmpdec_version__ROUND_UPROUND_DOWNROUND_CEILINGROUND_FLOORROUND_HALF_UPROUND_HALF_DOWNROUND_HALF_EVENROUND_05UPROUND_TRUNCcopyprecEmaxEminroundingcapitalsclamp__enter____exit__realimagexplnlog10next_minusnext_plusnormalizeto_integralto_integral_exactto_integral_valuesqrtcomparecompare_signalmax_magmin_magnext_towardquantizeremainder_nearfmais_canonicalis_finiteis_infiniteis_nanis_qnanis_snanis_signedis_zerois_normalis_subnormaladjustedconjugateradixcopy_abscopy_negatelogblogical_invertnumber_classto_eng_stringcompare_totalcompare_total_magcopy_signsame_quantumlogical_andlogical_orlogical_xorrotatescalebshiftas_tuple__copy____deepcopy____format____reduce____round____ceil____floor____trunc____complex____sizeof__adddividedivide_intdivmodmultiplyremaindersubtractpowerEtinyEtop_applycopy_decimalto_sci_stringclear_flagsclear_trapscreate_decimalcreate_decimal_from_floatgetcontextsetcontextlocalcontextMAX_PRECMAX_EMAXMIN_EMINMIN_ETINYdecimal.SignalDictMixinotherthirdmodulodecimal.InvalidOperationdecimal.ConversionSyntaxdecimal.DivisionImpossibledecimal.DivisionUndefineddecimal.InvalidContextdecimal.ContextManagerctxdecimal.Decimaldecimal.FloatOperationdecimal.DivisionByZerodecimal.Overflowdecimal.Underflowdecimal.Subnormaldecimal.Inexactdecimal.Roundeddecimal.Clampeddecimal.Context�n���n��`n��0s���t��u��@x���w��x���s���w���x��`x���x�� y��@w��0u��ry��/z���n��
����:�����������؋����������������������s�D���s��>�8����0���r��������S����������������������������)r���q��Bp��=r��Pr���s���p��Vs��D%��t%��%���%��d%���%��,%��\%��\&��h%��L%��r%������$�`���%~5���	w�.Y�K=�S�e@aB(����e ��f�5D~/B�.B�0gh,�=����g�8�E�%�k��:��Z��>q�(��ZT��n�!s���Ӡx�&��RwZsj_2��� �p�h`:~A���Pl�
o�V��yK+[����hiG��w�p
m^C��,�?̇v0,�^y�(Ft=���JL8�G[P)*��CE�h��:!yk�0ׄv�\B6`
'���2%�k€�"�a�D��2��^�.�-.x
�r��16H��6��a6��l�Ri83��-�f:\oG���(�?r�/�ف�-�A��B%f���¿�z=�#�z���?Z��<�N�#?�Y'b��*���Y,�.���c
nV�~��ϓ�hOeL��۟Wt�\���i����H�h-�ku!o8%���Ţ��@+�0�]qk�^�"��o�?g����V���j�Ϸ�9��0��KL/.��6��S��h��S/�E�l�
'1:DMV_hqz����������������%,4;BIPX_fmtz��������������������
$*05;AFLQW\bgmrw}��������������������������"&+/48=AEJNRV[_cglptx|����������������������������������	
"%),036:=ADGKNQUX[^behkorux{�������������������������������������������	"$'*,/247:<?ADGILNQTVY[^`cehjmortwy|~��������������������������������������������������������	!#%')+-/13579;=?ACEGI���������������������������}{ywusrpnljhfdca_][ZXVTRPOMKIGFDB@>=;976420/-+)(&$"!	����������������������������������������������������������������������������������}|zywvtsrpomljihfecb`_^\[YXVUTRQPNMKJHGFDCB@?><;98754210.-,*)(&%$"! 
	����������������������������������������������������������������������������������������������������������~|{zyxwvtsrqponmljihgfedcba_^]\[ZYXWVTSRQPONMLKJIHFEDCBA@?>=<;:986543210/.-,+*)('&%$#"!

	�����������
 @� @� @� @� @� @� @� @�
d�'��@B����ʚ;�T�vH����rN	@z�Z�Ƥ~��o�#�]xEcd����
�#NJDecimal(value="0", context=None)
--

Construct a new Decimal object. 'value' can be an integer, string, tuple,
or another Decimal object. If no value is given, return Decimal('0'). The
context does not affect the conversion and is only passed to determine if
the InvalidOperation trap is active.

Context(prec=None, rounding=None, Emin=None, Emax=None, capitals=None, clamp=None, flags=None, traps=None)
--

The context affects almost all operations and controls rounding,
Over/Underflow, raising of exceptions and much more.  A new context
can be constructed as follows:

    >>> c = Context(prec=28, Emin=-425000000, Emax=425000000,
    ...             rounding=ROUND_HALF_EVEN, capitals=1, clamp=1,
    ...             traps=[InvalidOperation, DivisionByZero, Overflow],
    ...             flags=[])
    >>>


as_integer_ratio($self, /)
--

Decimal.as_integer_ratio() -> (int, int)

Return a pair of integers, whose ratio is exactly equal to the original
Decimal and with a positive denominator. The ratio is in lowest terms.
Raise OverflowError on infinities and a ValueError on NaNs.

as_tuple($self, /)
--

Return a tuple representation of the number.

from_float($type, f, /)
--

Class method that converts a float to a decimal number, exactly.
Since 0.1 is not exactly representable in binary floating point,
Decimal.from_float(0.1) is not the same as Decimal('0.1').

    >>> Decimal.from_float(0.1)
    Decimal('0.1000000000000000055511151231257827021181583404541015625')
    >>> Decimal.from_float(float('nan'))
    Decimal('NaN')
    >>> Decimal.from_float(float('inf'))
    Decimal('Infinity')
    >>> Decimal.from_float(float('-inf'))
    Decimal('-Infinity')


shift($self, /, other, context=None)
--

Return the result of shifting the digits of the first operand by an amount
specified by the second operand.  The second operand must be an integer in
the range -precision through precision. The absolute value of the second
operand gives the number of places to shift. If the second operand is
positive, then the shift is to the left; otherwise the shift is to the
right. Digits shifted into the coefficient are zeros. The sign and exponent
of the first operand are unchanged.

scaleb($self, /, other, context=None)
--

Return the first operand with the exponent adjusted the second.  Equivalently,
return the first operand multiplied by 10**other. The second operand must be
an integer.

rotate($self, /, other, context=None)
--

Return the result of rotating the digits of the first operand by an amount
specified by the second operand.  The second operand must be an integer in
the range -precision through precision. The absolute value of the second
operand gives the number of places to rotate. If the second operand is
positive then rotation is to the left; otherwise rotation is to the right.
The coefficient of the first operand is padded on the left with zeros to
length precision if necessary. The sign and exponent of the first operand are
unchanged.

logical_xor($self, /, other, context=None)
--

Return the digit-wise 'exclusive or' of the two (logical) operands.

logical_or($self, /, other, context=None)
--

Return the digit-wise 'or' of the two (logical) operands.

logical_and($self, /, other, context=None)
--

Return the digit-wise 'and' of the two (logical) operands.

same_quantum($self, /, other, context=None)
--

Test whether self and other have the same exponent or whether both are NaN.

This operation is unaffected by context and is quiet: no flags are changed
and no rounding is performed. As an exception, the C version may raise
InvalidOperation if the second operand cannot be converted exactly.

copy_sign($self, /, other, context=None)
--

Return a copy of the first operand with the sign set to be the same as the
sign of the second operand. For example:

    >>> Decimal('2.3').copy_sign(Decimal('-1.5'))
    Decimal('-2.3')

This operation is unaffected by context and is quiet: no flags are changed
and no rounding is performed. As an exception, the C version may raise
InvalidOperation if the second operand cannot be converted exactly.

compare_total_mag($self, /, other, context=None)
--

Compare two operands using their abstract representation rather than their
value as in compare_total(), but ignoring the sign of each operand.

x.compare_total_mag(y) is equivalent to x.copy_abs().compare_total(y.copy_abs()).

This operation is unaffected by context and is quiet: no flags are changed
and no rounding is performed. As an exception, the C version may raise
InvalidOperation if the second operand cannot be converted exactly.

compare_total($self, /, other, context=None)
--

Compare two operands using their abstract representation rather than
their numerical value.  Similar to the compare() method, but the result
gives a total ordering on Decimal instances.  Two Decimal instances with
the same numeric value but different representations compare unequal
in this ordering:

    >>> Decimal('12.0').compare_total(Decimal('12'))
    Decimal('-1')

Quiet and signaling NaNs are also included in the total ordering. The result
of this function is Decimal('0') if both operands have the same representation,
Decimal('-1') if the first operand is lower in the total order than the second,
and Decimal('1') if the first operand is higher in the total order than the
second operand. See the specification for details of the total order.

This operation is unaffected by context and is quiet: no flags are changed
and no rounding is performed. As an exception, the C version may raise
InvalidOperation if the second operand cannot be converted exactly.

to_eng_string($self, /, context=None)
--

Convert to an engineering-type string.  Engineering notation has an exponent
which is a multiple of 3, so there are up to 3 digits left of the decimal
place. For example, Decimal('123E+1') is converted to Decimal('1.23E+3').

The value of context.capitals determines whether the exponent sign is lower
or upper case. Otherwise, the context does not affect the operation.

number_class($self, /, context=None)
--

Return a string describing the class of the operand.  The returned value
is one of the following ten strings:

    * '-Infinity', indicating that the operand is negative infinity.
    * '-Normal', indicating that the operand is a negative normal number.
    * '-Subnormal', indicating that the operand is negative and subnormal.
    * '-Zero', indicating that the operand is a negative zero.
    * '+Zero', indicating that the operand is a positive zero.
    * '+Subnormal', indicating that the operand is positive and subnormal.
    * '+Normal', indicating that the operand is a positive normal number.
    * '+Infinity', indicating that the operand is positive infinity.
    * 'NaN', indicating that the operand is a quiet NaN (Not a Number).
    * 'sNaN', indicating that the operand is a signaling NaN.


logical_invert($self, /, context=None)
--

Return the digit-wise inversion of the (logical) operand.

logb($self, /, context=None)
--

For a non-zero number, return the adjusted exponent of the operand as a
Decimal instance.  If the operand is a zero, then Decimal('-Infinity') is
returned and the DivisionByZero condition is raised. If the operand is
an infinity then Decimal('Infinity') is returned.

copy_negate($self, /)
--

Return the negation of the argument.  This operation is unaffected by context
and is quiet: no flags are changed and no rounding is performed.

copy_abs($self, /)
--

Return the absolute value of the argument.  This operation is unaffected by
context and is quiet: no flags are changed and no rounding is performed.

radix($self, /)
--

Return Decimal(10), the radix (base) in which the Decimal class does
all its arithmetic. Included for compatibility with the specification.

conjugate($self, /)
--

Return self.

canonical($self, /)
--

Return the canonical encoding of the argument.  Currently, the encoding
of a Decimal instance is always canonical, so this operation returns its
argument unchanged.

adjusted($self, /)
--

Return the adjusted exponent of the number.  Defined as exp + digits - 1.

is_subnormal($self, /, context=None)
--

Return True if the argument is subnormal, and False otherwise. A number is
subnormal if it is non-zero, finite, and has an adjusted exponent less
than Emin.

is_normal($self, /, context=None)
--

Return True if the argument is a normal finite non-zero number with an
adjusted exponent greater than or equal to Emin. Return False if the
argument is zero, subnormal, infinite or a NaN.

is_zero($self, /)
--

Return True if the argument is a (positive or negative) zero and False
otherwise.

is_signed($self, /)
--

Return True if the argument has a negative sign and False otherwise.
Note that both zeros and NaNs can carry signs.

is_snan($self, /)
--

Return True if the argument is a signaling NaN and False otherwise.

is_qnan($self, /)
--

Return True if the argument is a quiet NaN, and False otherwise.

is_nan($self, /)
--

Return True if the argument is a (quiet or signaling) NaN and False
otherwise.

is_infinite($self, /)
--

Return True if the argument is either positive or negative infinity and
False otherwise.

is_finite($self, /)
--

Return True if the argument is a finite number, and False if the argument
is infinite or a NaN.

is_canonical($self, /)
--

Return True if the argument is canonical and False otherwise.  Currently,
a Decimal instance is always canonical, so this operation always returns
True.

fma($self, /, other, third, context=None)
--

Fused multiply-add.  Return self*other+third with no rounding of the
intermediate product self*other.

    >>> Decimal(2).fma(3, 5)
    Decimal('11')


remainder_near($self, /, other, context=None)
--

Return the remainder from dividing self by other.  This differs from
self % other in that the sign of the remainder is chosen so as to minimize
its absolute value. More precisely, the return value is self - n * other
where n is the integer nearest to the exact value of self / other, and
if two integers are equally near then the even one is chosen.

If the result is zero then its sign will be the sign of self.

quantize($self, /, exp, rounding=None, context=None)
--

Return a value equal to the first operand after rounding and having the
exponent of the second operand.

    >>> Decimal('1.41421356').quantize(Decimal('1.000'))
    Decimal('1.414')

Unlike other operations, if the length of the coefficient after the quantize
operation would be greater than precision, then an InvalidOperation is signaled.
This guarantees that, unless there is an error condition, the quantized exponent
is always equal to that of the right-hand operand.

Also unlike other operations, quantize never signals Underflow, even if the
result is subnormal and inexact.

If the exponent of the second operand is larger than that of the first, then
rounding may be necessary. In this case, the rounding mode is determined by the
rounding argument if given, else by the given context argument; if neither
argument is given, the rounding mode of the current thread's context is used.

next_toward($self, /, other, context=None)
--

If the two operands are unequal, return the number closest to the first
operand in the direction of the second operand.  If both operands are
numerically equal, return a copy of the first operand with the sign set
to be the same as the sign of the second operand.

min_mag($self, /, other, context=None)
--

Similar to the min() method, but the comparison is done using the absolute
values of the operands.

min($self, /, other, context=None)
--

Minimum of self and other. If one operand is a quiet NaN and the other is
numeric, the numeric operand is returned.

max_mag($self, /, other, context=None)
--

Similar to the max() method, but the comparison is done using the absolute
values of the operands.

max($self, /, other, context=None)
--

Maximum of self and other.  If one operand is a quiet NaN and the other is
numeric, the numeric operand is returned.

compare_signal($self, /, other, context=None)
--

Identical to compare, except that all NaNs signal.

compare($self, /, other, context=None)
--

Compare self to other.  Return a decimal value:

    a or b is a NaN ==> Decimal('NaN')
    a < b           ==> Decimal('-1')
    a == b          ==> Decimal('0')
    a > b           ==> Decimal('1')

sqrt($self, /, context=None)
--

Return the square root of the argument to full precision. The result is
correctly rounded using the ROUND_HALF_EVEN rounding mode.

to_integral_value($self, /, rounding=None, context=None)
--

Round to the nearest integer without signaling Inexact or Rounded.  The
rounding mode is determined by the rounding parameter if given, else by
the given context. If neither parameter is given, then the rounding mode
of the current default context is used.

to_integral_exact($self, /, rounding=None, context=None)
--

Round to the nearest integer, signaling Inexact or Rounded as appropriate if
rounding occurs.  The rounding mode is determined by the rounding parameter
if given, else by the given context. If neither parameter is given, then the
rounding mode of the current default context is used.

to_integral($self, /, rounding=None, context=None)
--

Identical to the to_integral_value() method.  The to_integral() name has been
kept for compatibility with older versions.

normalize($self, /, context=None)
--

Normalize the number by stripping the rightmost trailing zeros and
converting any result equal to Decimal('0') to Decimal('0e0').  Used
for producing canonical values for members of an equivalence class.
For example, Decimal('32.100') and Decimal('0.321000e+2') both normalize
to the equivalent value Decimal('32.1').

next_plus($self, /, context=None)
--

Return the smallest number representable in the given context (or in the
current default context if no context is given) that is larger than the
given operand.

next_minus($self, /, context=None)
--

Return the largest number representable in the given context (or in the
current default context if no context is given) that is smaller than the
given operand.

log10($self, /, context=None)
--

Return the base ten logarithm of the operand. The function always uses the
ROUND_HALF_EVEN mode and the result is correctly rounded.

ln($self, /, context=None)
--

Return the natural (base e) logarithm of the operand. The function always
uses the ROUND_HALF_EVEN mode and the result is correctly rounded.

exp($self, /, context=None)
--

Return the value of the (natural) exponential function e**x at the given
number.  The function always uses the ROUND_HALF_EVEN mode and the result
is correctly rounded.

create_decimal_from_float($self, f, /)
--

Create a new Decimal instance from float f.  Unlike the Decimal.from_float()
class method, this function observes the context limits.

create_decimal($self, num="0", /)
--

Create a new Decimal instance from num, using self as the context. Unlike the
Decimal constructor, this function observes the context limits.

copy($self, /)
--

Return a duplicate of the context with all flags cleared.

clear_traps($self, /)
--

Set all traps to False.

clear_flags($self, /)
--

Reset all flags to False.

shift($self, x, y, /)
--

Return a copy of x, shifted by y places.

scaleb($self, x, y, /)
--

Return the first operand after adding the second value to its exp.

same_quantum($self, x, y, /)
--

Return True if the two operands have the same exponent.

rotate($self, x, y, /)
--

Return a copy of x, rotated by y places.

logical_xor($self, x, y, /)
--

Digit-wise xor of x and y.

logical_or($self, x, y, /)
--

Digit-wise or of x and y.

logical_and($self, x, y, /)
--

Digit-wise and of x and y.

copy_sign($self, x, y, /)
--

Copy the sign from y to x.

compare_total_mag($self, x, y, /)
--

Compare x and y using their abstract representation, ignoring sign.

compare_total($self, x, y, /)
--

Compare x and y using their abstract representation.

to_eng_string($self, x, /)
--

Convert a number to a string, using engineering notation.

to_sci_string($self, x, /)
--

Convert a number to a string using scientific notation.

number_class($self, x, /)
--

Return an indication of the class of x.

logical_invert($self, x, /)
--

Invert all digits of x.

logb($self, x, /)
--

Return the exponent of the magnitude of the operand's MSD.

copy_negate($self, x, /)
--

Return a copy of x with the sign inverted.

copy_decimal($self, x, /)
--

Return a copy of Decimal x.

copy_abs($self, x, /)
--

Return a copy of x with the sign set to 0.

canonical($self, x, /)
--

Return a new instance of x.

is_zero($self, x, /)
--

Return True if x is a zero, False otherwise.

is_subnormal($self, x, /)
--

Return True if x is subnormal, False otherwise.

is_snan($self, x, /)
--

Return True if x is a signaling NaN, False otherwise.

is_signed($self, x, /)
--

Return True if x is negative, False otherwise.

is_qnan($self, x, /)
--

Return True if x is a quiet NaN, False otherwise.

is_normal($self, x, /)
--

Return True if x is a normal number, False otherwise.

is_nan($self, x, /)
--

Return True if x is a qNaN or sNaN, False otherwise.

is_infinite($self, x, /)
--

Return True if x is infinite, False otherwise.

is_finite($self, x, /)
--

Return True if x is finite, False otherwise.

is_canonical($self, x, /)
--

Return True if x is canonical, False otherwise.

radix($self, /)
--

Return 10.

Etop($self, /)
--

Return a value equal to Emax - prec + 1.  This is the maximum exponent
if the _clamp field of the context is set to 1 (IEEE clamp mode).  Etop()
must not be negative.

Etiny($self, /)
--

Return a value equal to Emin - prec + 1, which is the minimum exponent value
for subnormal results.  When underflow occurs, the exponent is set to Etiny.

fma($self, x, y, z, /)
--

Return x multiplied by y, plus z.

power($self, /, a, b, modulo=None)
--

Compute a**b. If 'a' is negative, then 'b' must be integral. The result
will be inexact unless 'a' is integral and the result is finite and can
be expressed exactly in 'precision' digits.  In the Python version the
result is always correctly rounded, in the C version the result is almost
always correctly rounded.

If modulo is given, compute (a**b) % modulo. The following restrictions
hold:

    * all three arguments must be integral
    * 'b' must be nonnegative
    * at least one of 'a' or 'b' must be nonzero
    * modulo must be nonzero and less than 10**prec in absolute value


subtract($self, x, y, /)
--

Return the difference between x and y.

remainder_near($self, x, y, /)
--

Return x - y * n, where n is the integer nearest the exact value of x / y
(if the result is 0 then its sign will be the sign of x).

remainder($self, x, y, /)
--

Return the remainder from integer division.  The sign of the result,
if non-zero, is the same as that of the original dividend.

quantize($self, x, y, /)
--

Return a value equal to x (rounded), having the exponent of y.

next_toward($self, x, y, /)
--

Return the number closest to x, in the direction towards y.

multiply($self, x, y, /)
--

Return the product of x and y.

min_mag($self, x, y, /)
--

Compare the values numerically with their sign ignored.

min($self, x, y, /)
--

Compare the values numerically and return the minimum.

max_mag($self, x, y, /)
--

Compare the values numerically with their sign ignored.

max($self, x, y, /)
--

Compare the values numerically and return the maximum.

divmod($self, x, y, /)
--

Return quotient and remainder of the division x / y.

divide_int($self, x, y, /)
--

Return x divided by y, truncated to an integer.

divide($self, x, y, /)
--

Return x divided by y.

compare_signal($self, x, y, /)
--

Compare x and y numerically.  All NaNs signal.

compare($self, x, y, /)
--

Compare x and y numerically.

add($self, x, y, /)
--

Return the sum of x and y.

sqrt($self, x, /)
--

Square root of a non-negative number to context precision.

to_integral_value($self, x, /)
--

Round to an integer.

to_integral_exact($self, x, /)
--

Round to an integer. Signal if the result is rounded or inexact.

to_integral($self, x, /)
--

Identical to to_integral_value(x).

plus($self, x, /)
--

Plus corresponds to the unary prefix plus operator in Python, but applies
the context to the result.

normalize($self, x, /)
--

Reduce x to its simplest form. Alias for reduce(x).

next_plus($self, x, /)
--

Return the smallest representable number larger than x.

next_minus($self, x, /)
--

Return the largest representable number smaller than x.

minus($self, x, /)
--

Minus corresponds to the unary prefix minus operator in Python, but applies
the context to the result.

log10($self, x, /)
--

Return the base 10 logarithm of x.

ln($self, x, /)
--

Return the natural (base e) logarithm of x.

exp($self, x, /)
--

Return e ** x.

abs($self, x, /)
--

Return the absolute value of x.

localcontext($module, /, ctx=None)
--

Return a context manager that will set the default context to a copy of ctx
on entry to the with-statement and restore the previous default context when
exiting the with-statement. If no context is specified, a copy of the current
default context is used.

setcontext($module, context, /)
--

Set a new default context.

getcontext($module, /)
--

Get the current default context.

C decimal arithmetic module?B��������c����
��c����
@��������cd����
���XLI�cd����
cd����
�d����
d����
�?�������	?B�9$�|k�?�䌄_wC�_���"@�C�CKvl�?���x��?�?�������;�R�h����n����t����t����u����u����u�� �u��T6v���Nv��4�v����v���"w��</w��l<w���Cw��T{w����w���w��t�w���x��L;x���]x����x��<�x���y��P"y��8wy���zy���y��@�y��h�y���z���(z�� �z����z����z���1{�� �{��x �{��� �{��� �{��4!|���!7|��0"d|��p"~|���"�|���#�|��$�|���$8}���$D}���%�}�� &�}���&~���&~��X''~���'?~���'R~��(e~��@(s~��p(}~���(�~���(����)?����)[���<*w����*݀���*F���$+܁��|,���<-y����-���� .����X/[���0����|0����1��L1��1Æ��X2�����2ň��$3���t3b����3����,4w����4u���P5b����5��H6����(7
����7"���X9����l9��� ;%���h;O����;h���<�����<�����<����,=ŏ���=ҏ��4>�����>����>6���`?�����?����,@�����@����@Ǒ��<AΑ��|AՑ��<BB����Bo���PC�����C����pDœ���DE���DEM���F����PFӖ���F����FY���G����PGߗ���G!���HK���dHv����H}����H����$I��dI����IE���J`���xJp����J����K����@K�����K��L���HLQ����L�����Lך��M���HM]����M����N˛��DN�����N(����NZ���O����DO�����O��OP���$Pѝ��dPR����PӞ���Pb���$Q��dQd����Q��R����dR����R�����RI���$Sʣ��dSK����S̤���SM���$TΥ���TO����T)���$U���UV����U����LV����V٩��<W�����W"���,X[���lX�����X˫��$Y�����Y{����Y����8Z�����ZƬ���Z��[ ���D[>����[M����[U���\����8\�����\����X])����]�����]Ͳ��(^��d^����^)���_6����_l����_0���D`w���X`ݻ��a����la����a	���a|���b���$c6���c���dq���d����d���e?��peR���e����e����f���g4��Pg����g���h���\h����h���(i���hi����i-��j���\jJ���j���k���xk@��l���Xl���l+��pm����m4��<nf��|ns��o����o���o���pQ��p��q��dq���q:�,r��|r.��r��(s���s���s1�Htt��t{��tV�(u��hu���u����4�\8�x���,��X8���4��hH�H����8����x���H��������X����x���P���H���X���h���x������������<���dH���(��Lx�����$H��TH������X��4X ���"��( �"��d �#��\!x%���!�%���!8'���"�'��#h*���$�*���$�+��0%(,���%�,��'(-��t'�-���'�-���'(.��(�/���(�4��L)H5���)�5���*X6���*87��8+�7���+x:���+X<���,�<���,�=��P-�A��4.D���.�E���.�L��l/HV��0xa���0�n��1�o��`1xq���1hr��l2�r���2X}��83H����3X����6���<78���8Ȍ��|88����8ȍ��9����:����|;8����>h���t?x����?8����@h����A���A����dC8����DH���D��XE���$G���G���$H����K���KH��\Mx���M���N8���T����T���8UX���Ux��U����`Vh����V���PW�
���X���8Y���Y���LZ����Zh!��X["���[�"��`\�2��l]�:���](;���^�;��0_�@���`L��0a�L��b�T��d(V���dxW��$e�X���eHZ��f(`��dgXa���g�f��0h�g���hv��<iXw��|iHz���i�z��pj�|���jx~��,k�����kh���lȇ��llH����l(����mx����n���o���q��xqh����qh���@rX����r8����rh���<s�����s���t����t��� ���H���p������@X�������(���x�����P����(���8���X��h���Dx���(�����`��`�������(��|H��< h��P ���� ���� ���� ���!���H!��p!h���!x���!���"���D"x��"���"���"��"(��#�� $���$���%(��%X��%x��%��4&��P&(�d&8�x&H��&X��&���&��T(H��(��)��$)��8)(��)��*(�P*��d+(��-��3��X48����48���|5���6����\6H����6�����7���9����9���4:����:���4;8���;���$<X���<����<
��@=�
���=���=���X>(���>���@@h��t@���A���PA8���A���PB����B8��D���E(���EX��$F���dF����F����F��dGh��xH����H����Hx ��8I8!��xI�!���IX"���I�"��(Jh#��DJ�#���Jx$���J%���J�%���J&��$K�&��TK('��xK�'��L�(��\L(*���LX+���L�,��M�-��XNx.���N8/���N�/��O�0��XOx1���Ox2���O4��8P�5��xPX7���P�8���P�:��8Q(<��xQx=���Q?��R�@��xR8B���R�C���RXE��8S�F��xS�H���S8J���S�K��8T�M���WHO��@XP���X�P���Y�P���ZR��[hR���[�R��\�S��L\�S��]HV��^�V��D^�V���^�X���_]���b�^��dc8`���c�a���d�b���e(d���f�g��$g�i��ph�j��$j�l��n�m��Pn�n���o�o��p(u���p�u���pw��\t�w���txx��<u�y��|uzRx�$(V���FJw�?:*3$"D�[���\�a��p��������
�����x��������p�������9E�sP���A\���VK{
AT8�`���K�Z�M�G�D�G�D�G�D�G�D�G�D�G�D�k�_����
��6gN(����JB�D�I �wABzRx� ���$a������:E�i
EzRx�� �`��
h,��QE�CP�`��%\�\��SL��
A��`��9(����IE�G�A ^
AAAzRx� �� ~`��H(̹���B�B�B �B(�A0�A8�G`�
8A0A(B BBBA zRx�`������(`��j<����E�D�G w
GAQL
AABLAA�����MA�K�`�� ��E�G r
AAzRx� � �_��Npd���,EfzRx��_��
�P���,E�f��_��
�P���DE�[
A4��WD F
AzRx� d_��H<���	8\8���F�E�D �A(�DP�
(A ABBAzRx�P����$�^��8(���`F�A�A �TAB�^��)8���=\�I�A �A(�C0=
(F ABBAzRx�0����$�^��J(|X���E�A�D0
AAB,�l����B�A�A ��
ABA�r^��
(����H�A�A C
AAA$<^��8,x���B�B�A �A(�D0:
(C ABBA(h����A�I�D0n
AAAzRx�0�� �]��$(�P���CA�D�A u
AAA��]��"$0�yA�A�K
ABzRx��� q]��#@\X�N�Q�K ��
ABAX
ABAE����<]��K0� ��W�C�&
AA
AAE���?]��I�h�>	��
$	��
8	��
L	��`	��
(t	��gE�G�D k
AAA�	����	�\��0�	|�VB�H�D �D(�{ DBBx�	���[�B�B �B(�A0�A8�_
0D(B BBBB0������`8������X	������O8������ zRx�8������(�[��U�
���CH�
�����B�H�B �E(�D0�D8�DP�
8A0A(B BBBA�S$@���8�[��$L�����A�K�D xDA�b[������=H�tp	J[�������)[��F������G[��)�����H[�� 00D���<B�D�A �G@�
 AABAzRx�@���$[���H�����B�I�O �B(�A0�D8�D��
8A0A(B BBBA$zRx��������,�Z��/$ 
����D
D[
ET
L��Z��\
�Z��SA�t
[��SA��
�����
����
����
L����
[��T�
�1( ����E�H�T0p
AAA�[��D�5X�Z��(l���E�H�T0p
AAA�Z�������"�T��������FE�@�Լ�����-SZ��($,����YA�D�A PAA(T����A�A�G�r
AAA��������Y��-(�L����E�N�N0m
AAAD�Y�����=����F ���?A�K�qA4 ���H���\~Y��Tpt���B�B�B �B(�A0�A8�H��Q
GЁ�
8A0A(B BBBA$zRx�Ё������,�X��uD�����B�E�L �E(�H0�C8�FP�8A0A(B BBB zRx�P������(�X��D�н���F�A�A �J�e�D�E�A�P�Z
 AABAzRx�����$nX��:$���/A�G�E _AA4lX�� <����A�G @
AA0`����B�D�C �G0D
 AABA0����dB�D�D �G0I
 AABAzRx�0���$�W��a�H���>t���"$���� 8����"4L8��XB�M�A �D(�J0s(A ABB@
}W��=�l���FE�@�����"�������������������AA�f
AX�W��8̽��AA�f
AX$W��Llx���F�A�A �O
ABEW
DBAA
GBEAGB��V��	AAB(����ZE�G�A o
AAAV�����LE�k
AZcV��L���PE�o
AZ8BV�� ����H �
KO
A�V�������KF�AA���U��
�����FD}|�U��
H��B�B�B �B(�D0�C8�GP�
8D0A(B BBBA�U���t����"�����"�����"4����oB�E�I �A(�J0M(A ABB��V��/4�����J�D�G _
AAJ`��F ��(4P���}E�K�D0a
AAA�;V��(t����}E�K�D0a
AAAV��8���B�E�A �G(�D@}
(A ABBAzRx�@����$�U��f$0��ZK�F
E�U��ih(\X���A�A�D0~
AAA�V���(�����a�D�J @
FAA(�l���OO�G�K cFAA��\�0���U�E�F �L(�K0�D8��
0A(B BBBAk������A8������`T����B�B�B �B(�A0�D8�D�J
8G0A(B BBBE�8J0A(B BBB$zRx��������(,XU��)�
8A0A(B BBBE���NE�W
TP(���:F�B�B �A(�D0�D@�HQPAXM`[@[
0A(A BBBA zRx�@�����(�U��tT�����B�B�B �B(�A0�A8�H��Q
G��W
8A0A(B BBBA$zRx���������,�U��'8H<����B�E�A �D(�D0_
(A ABBA@xV��
L�l��_i�A�A �

ABHL
FB\����C ���R���X�|���U�E�B �E(�K0�D8�h0E(B BBBK������H8������LD����B�B�B �B(�A0�A8�G�	�
8A0A(B BBBA$zRx��	������,JU���h�T��|	F�B�B �B(�A0�J8�D�E�H�M�N�G�G�V�@
8A0A(B BBBO$zRx��������,SU��<dx,&��0_�B�L �B(�D0�D8�GP
8A0A(B BBBI ������HP�������U��p��0��j
B�H�B �R(�A0�A8�O
0A(B BBBH�
0A(B BBBG�
0A(B BBBP��T��70|�=��B�A�D �G0�
 AABA��T��H��>��xB�B�B �E(�D0�D8�A@l
8A0A(B BBBA zRx�@������(T���HH�?���B�E�B �B(�A0�A8�D��
8A0A(B BBBA$zRx��������,cT���(��?��6A�D�D e
AAA�U��=L �?���
B�F�E �E(�D0�D8�G�}
8A0A(B BBBH$zRx��������,�U��Q8� J���B�E�D �D(�G@�
(A ABBB��V��L(� �L��A�A�G0U
AAA��V��$`,!8����B�B�B �B(�A0�D8�D`�
8A0A(B BBBEH
8I0A(B BBBE( RV����
8A0A(B BBBA`�!H����B�B�B �B(�A0�D8�D`�
8D0A(B BBBED
8L0A(B BBBE(��V���p
8A0A(B BBBAdL"H����B�B�B �B(�D0�A8�D`Y
8L0A(B BBBE%
8A0A(B BBBE(DW����
8A0A(B BBBAX�"����B�B�B �D(�A0�D@?
0D(A BBBED
0L(A BBBE$��W���z
0A(A BBBA(d#���(E�N�N@�
AAAzRx�@�� �W��
@�#���FB�E�E �D(�D0�G@�
0A(A BBBA8$���oB�E�D �D(�E0n
(C ABBAH@$tJ���B�B�J �E(�D0�D8�GP�
8D0A(B BBBOD�V��|�$�L��M�B�B �E(�A0�D8�GPz
8A0A(B BBBA�
8A0A(B BBBAW������PP�������IV��H4%���OB�E�E �E(�D0�D8�DP�
8A0A(B BBBA\�%T���B�E�E �D(�D0�_
(D HBBEY
(A BBBAQ(A EBB(�%DT��gA�D�G0S
AAA\&�T���B�E�E �D(�D0�a
(D HBBEY
(A BBBAQ(A DBE,l&�T��=A�E�G�
AAAzRx����$�T���$�&1U��gA�D�G0XAAL�&l���B�E�E �D(�D0�T
(D HBBEW(A BBBLH'����B�E�E �D(�D0�T
(D HBBEN
(A BBBAL�'����B�E�E �D(�D0�T
(D HBBES
(A BBBAL�'���B�E�E �D(�D0�T
(D HBBEM
(A BBBAH8(,T���B�E�D �D(�G0n
(J ABBEs(A ABB@"�S��0�(L���F�D�A �D0�
 AABA�S��*H�($T���B�E�D �D(�G0g
(J ABBEi
(A ABBA�"S��0@)T���F�D�A �D0�
 AABA�PS��*D�)���nB�B�E �D(�D0�G�
0A(A BBBA zRx�������(�R��(*���(E�N�N@�
AAA��R��
DH*���yB�B�E �D(�D0�G�
0A(A BBBA�~R��<�*����B�E�E �D(�D0�I
(A BBBA(�*P��(E�N�N@�
AAA�R��
L$+@���B�B�E �D(�D0��
(A BBBAI
(D DBBE zRx�0����� (�Q��&J
(A BBBE(�+���(E�N�N@�
AAA\lQ��
@�+����B�B�B �K(�D0�D@�
0A(A BBBA�!Q��1HT,@Q��!B�B�E �B(�A0�D8�DpD
8A0A(B BBBN zRx�p������(�P��{@�,�[��
B�B�E �A(�K0�D��
0A(A BBBA zRx�������(�P��8T-�]���B�E�D �D(�G@|
(A ABBA��P��G0�-���{A�G a
GIc
AAMK(�-���(E�N�N@�
AAAx
WP��
D.|]��%B�L�E �B(�A0�A8�w
0A(B BBBI�#P���(t.���HF�D�I �qAB�,�P��(�.���FF�D�G �qAB�,JP��<�.�h��~F�B�B �A(�A0�<
(A BBBA4/`��Qab
ALHT/�i���B�B�E �B(�D0�A8�G`�
8A0A(B BBBP0,�O��mP�/@��a�B�E �D(�D0�i
(A BBBAQ�����O0�����00�O��-H0�����Y�(A� B�B�B�L<0����B�F�E �E(�D0�D8�J��
8A0A(B BBBA$zRx��������,O���|�0<k���B�E�E �E(�D0�D8�D@�
8J0A(B BBBI�
8D0D(G BBBEY
8A0A(B BBBA(<O���B
8D0D(E BBBE\t1 ���B�B�E �A(�D0�h
(A BBBAe
(G EEBEA(G BBB d O��-A
(G GBBEH�1�n��B�L�B �B(�D0�D8�J`L
8A0A(B BBBF�.�N���LX2L}���	B�B�E �B(�A0�A8�D��
8A0A(B BBBA�N��H�2�����B�B�B �I(�A0�A8�D@Z
8D0A(B BBBD 3\��E�QP�
AA(,3X��/E�A�QP�
AAAzRx�P�� 5P��C(�3,��/E�A�QP�
AAA`8P��C(�3��/E�A�QP�
AAA�;P��C(4��/E�A�QP�
AAA�>P��C(H4���/E�A�QP�
AAA AP��C(�4����/E�A�QP�
AAA`DP��C0�4���EF�A�N �DP�
 AABAzRx�P���$P��B$05D���xE�T�6
AAzRx��� 	P��* �5l���E�Q@�
AAzRx�@� �O��+(�5����E�G�L@W
AAA|�O��(68���E�J�I@�
AAA��O��2(\6����E�J�I@�
AAA��O��2(�68���E�J�I@�
AAA<uO��2�6���QH 
A(�6����E�J�I@�
AAA�KO��2 87|��pE�R0R
AAzRx�0� )O���7����H0i
A�7���H0]
AzRx�0�N���7T���H0Y
A8����H0Y
A(8<���H0]
A��N��X8����H0]
A�hN���8����H0]
A�HN�� �8,���E�R0Y
AA �8����E�R0Y
AA(9���NE�A�QP�
AAA��M��C(@9$���5E�A�QP�
AAA�M��+(�9���/E�A�QP�
AAAX�M��C(�9���/E�A�QP�
AAA��M��C(:���/E�A�QP�
AAA��M��C(@:t��/E�A�QP�
AAA�M��C(�:d��/E�A�QP�
AAAX�M��C(�:��/E�A�QP�
AAA��M��C@;Ԇ���F�B�B �A(�A0�Q`
0A(A BBBA zRx�`�����(�M��+(|;؇��5E�A�QP�
AAATM��+(�;X���E�J�I@�
AAA\jM��2(�;����E�J�I@�
AAA�\M��2(<<X��E�J�I@�
AAA�NM��2(|<���E�J�I@�
AAA@M��2(�<X��E�J�I@�
AAA\2M��2H�<��F�H�B �B(�A0�I8�Dp�
8A0A(B BBBA�M��`(\=x��E�N�NP/
AAA4
$M���(�=���E�N�NP/
AAAt
eM���(�=8��E�N�NP/
AAA�
�M���(>���E�N�NP/
AAA�
�M���(\>���E�N�NP*
AAA46N���(�>H��E�N�NP*
AAAtwN���(�>��DE�N�N`�
AAAzRx�`�� �N���(8?���E�N�NP9
AAA�N���,x?���E�N�Q�{
AAAzRx����$O���(�?X�^E�N�NP
AAA�iO���(@x�wE�N�NP.
AAA��O���(\@��E�N�NP/
AAA4
P���(�@�E�N�NP/
AAAt
^P���(�@x�E�N�NP/
AAA�
�P���(A��E�N�NP*
AAA�
�P���(\A8����E�N�NP/
AAA4!Q���8�A�����F�I�A �J(�K`Q
(A ABBAzRx�`����$2Q���0B����JF�D�D �D@�
 AABA�5kQ���0TB����>F�D�D �D@�
 AABA(6�Q���H�B�����F�D�B �B(�D0�A8�Dp�
8A0A(B BBBALVR��tL�B����
F�G�B �B(�A0�A8�Q�v

8A0A(B BBBL&fR��dL`Ct���
F�E�B �B(�A0�A8�U�}

8A0A(B BBBCx&fR��dL�C0����F�E�E �B(�A0�H8�G�N
8A0A(B BBBA$zRx��������,>R���LPDt���4F�I�B �E(�A0�D8�G��
8A0A(B BBBA��R���p�DP���MB�E�A �D(�G@r
(I ABBMM
(A ABBM
(I DDBEg
(J ABBE<-�R��a0<E��zF�H�J �K��
 AABAzRx�����$�R��9(�E����E�J�I@�
AAAD"�R��2<�Ep����F�I�A �J(�K�"
(A ABBA zRx������(�R��>(\F����E�J�I@�
AAA�"�R��2P�F����F�I�B �J(�H0�D�o�R�A�L
0A(A BBBC zRx�������(ER��~(G����&<G�R��HPG����
B�B�E �B(�D0�C8�G`C
8A0A(B BBBJ,DBR��&0�Gd��'F�G�A �L@�
 AABA�; R��(�G\���E�H�T@�
AAA�$�Q��(08H��rF�C�D �D0�
 AABA�5�Q��2$�H�DE�D�D0tAAA�Q��(�H���E�A�D v
DAA�E�Q�� �H���rE�D A
EE�D�Q��DC(8I<���E�D�D0�
AAA�AMQ��\ xI����E�R@�
AA�qQ���IT���2l�IP��F�B�B �E(�A0�A8�J��
8A0A(B BBBA�B�Z�A�l�E�S�A�$zRx��������,�P���HpJ���QF�B�B �B(�A0�A8�K`
8A0A(B BBBALGFS���L�Jd���B�B�B �B(�A0�A8�G�!
8A0A(B BBBD�*eS��� 4K����E�I0a
AA�T��lK8���9E�G \LPG�T��D
CA�K<���9E�G \L�G�T��D
CA �K����E�I0a
AA�_T��<L����F�B�D �D(�D�6
(A ABBA zRx������(T��
@�L����F�B�B �A(�A0�DP=
0A(A BBBK zRx�P�����(�S��6HM�T���B�P�E �E(�G0�K8�Dp�8A0A(B BBBH\M����jB�E�E �B(�A0�A8�Dp
8A0A(B BBBC!�U��GH�MX��fB�E�E �B(�D0�A8�D�D8A0A(B BBBLN�MB�B�B �B(�D0�D8�J�
8A0A(B BBBH$zRx��������,�Z��8�N��xB�B�D �D(�G@Y
(A ABBA�6�[��H�N�[���B�E�H �H(�A0�D8�J��8A0A(B BBBH0O5a��sB�E�E �B(�D0�A8�G�N8A0A(B BBBL|Oh�	B�F�E �B(�D0�D8�J�s
8A0A(B BBBB$zRx��������,�d��C|P\����B�E�E �E(�D0�D8�GPK
8G0D(B BBBEA
8A0A(B BBBAc
8J0A(B BBBE<@?�e��wf
8L0A(B BBBEa8C0D(D BBB0�P,����F�D�D �DP-
 AABA�e���0Q�����F�N�A �D`3
 AABAzRx�`���$�e���HxQ|�B�I�B �E(�D0�D8�J��
8A0A(B BBBA$zRx��������,�e��20R$���)F�D�D �D@�
 AABA�E�e��Y(HR<�NE�A�QP�
AAA �e��CH�RL�uB�F�E �E(�D0�D8�J��
8A0A(B BBBA�e��0�Rl���)F�D�D �D@�
 AABA�F�e��Y(0S$�NE�A�QP�
AAA �e��CLpS4��B�F�E �E(�D0�D8�J��
8A0A(B BBBA$zRx��������,be���L�S�����B�I�E �E(�D0�A8�J�	
8A0A(B BBBA$zRx��	������,�g��M(�T����E�N�NP*
AAA`!�h���(�T����/E�A�QP�
AAA�!i��CLU�����B�F�E �B(�A0�A8�J��
8A0A(B BBBA$zRx��������,�h���(�U�����E�J�I@�
AAA42'j��2(�U ��'E�N�N@�
AAAt2j��
LV���CB�I�B �E(�D0�D8�G�	O
8A0A(B BBBF$zRx��	������,�i���(�V���:E�A�QP�
AAAx#)k��+8�V�
���F�B�F �D(�DP
(A ABBA�Qk��i@0Wt���B�B�B �D(�D0�GPl
0A(A BBBA�
k���4�W���E�N�NhjpRhA`5
AAA�bk���(�Wp���E�A�Q`&
AAA��k��U@X���B�S�O �D(�D0�Q��
0A(A BBBA zRx�������(k��8H�XD��:F�B�B �B(�F0�D8�Dp-
8A0A(B BBBO@,Wk��iH�X$���F�B�B �B(�A0�A8�G�~
8A0A(B BBBC$zRx��������,8k���@xYL��XF�B�B �A(�A0�Q`�
0A(A BBBA|�k��+L�YT��wB�I�E �B(�A0�D8�G�M
8A0A(B BBBA$zRx��������,$k��L\ZH���B�F�E �B(�A0�A8�G�
&
8A0A(B BBBA$zRx��
������,�l���L�Z�%��CB�E�E �E(�A0�D8�G�f
8A0A(B BBBA$zRx��������,�m��W(t[����E�J�I@�
AAA8�o��2(�[P���(E�N�N@�
AAAT8�o��
L�[�)���B�N�E �B(�A0�A8�J�
1
8A0A(B BBBA$zRx��
������,co���L�\�*���B�I�B �B(�A0�D8�J��
8A0A(B BBBA$zRx��������,Yp���H](����B�F�E �E(�D0�G8�G��
8A0A(B BBBA�
�q��<Ll]���DB�E�E �H(�A0�I8�G�9
8A0A(B BBBA$zRx��������,[q��n(�]����E�J�I@�
AAA�:�r��2(8^��(E�N�N@�
AAA�:{r��
Lx^�/���B�E�E �E(�D0�A8�G�C
8A0A(B BBBA�$r��[L�^h5��sB�I�K �E(�A0�D8�J�9
8A0A(B BBBAds��OL@_�6���B�B�B �E(�D0�D8�D��
8A0A(B BBBBXBs��U8�_ =���F�E�D �D(�D`
(A ABBAt���0�_�>���E�H�ThspRhA`�
AAA$!bt��nL<`X@��&B�B�B �B(�A0�D8�G��
8A0A(B BBBE�@lt��TH�`$H���F�B�B �G(�A0�C8�J��
8A0A(B BBBN$zRx��������,8u���0(a,N���F�A�D �G0b
 DABA�N�u��s8patN��fF�O�K �A(�D��
(A ABBH��u��C(�a����E�N�D0b
AAA\Z�u��HbTQ���F�B�B �B(�N0�A8�D��
8A0A(B BBBC�H�u���(`b����E�J�I@�
AAA?&w��2(�b4��(E�N�N@�
AAA@?w��
H�b$��	F�B�B �B(�A0�A8�A@�
8D0A(B BBBA D�v��SGNU���p��x$�A��������@@����$���$��$������†Ά܆����Ufp��^
�x�x$�x$���o`��
�|$�V�=	���o���oX���o�oP���oez$__ _0_@_P_`_p_�_�_�_�_�_�_�_�_`` `0`@`P```p`�`�`�`�`�`�`�`�`aa a0a@aPa`apa�a�a�a�a�a�a�a�abb b0b@bPb`bpb�b�b�b�b�b�b�b�bcc c0c@cPc`cpc�c�c�c�c�c�c�c�cdd d0d@dPd`dpd�d�d�d�d�d�d���j�$D�����$��K� `�@�$f�h`2  �$�w���p�@�$��$��	�`@��P��"�@�$ �$�B���`���0$���P��#�`��#"�p���'���p�0����9���0#?���I���R�P�W�����@��tY�Tp���@����F01p�W`m\��c��`��n�c��k@�i�`�`�t����~����@����C���������_�����A��Ň@@`���>��ԇ= �#�`;��܇�9���@8��������^���` ���`����#��`�/����6�����>��� �F�0���P��I�X����b�� �o�`�������x�0����� ����0� �����`���p �����������@���G��̈�6��ڈ 5����3����02`���0���.`��`-�&��+��-� *��4��(��O����:��I �J��1�C�@�L�@�Y��d� Ho��Ly��L��PL���0��pH�������'@�\��b�`��m��c�0k`�n��&��i�&��t�@% �~��#��y��$@���PE����F`���PE ���]�����������@�ŇP����� l����0L@�É@V����"��ԇ`! �#�0 ��܇`�ʉp| �������`�ӉO����0V�݉�����`� ���p���P� ��p�`���p� ��@���`�#���/���X�0@�6����F����>�p �b����P��`���`��� ��������@����� ������������p ��������H`�̈���ڈ ���� @�������������&�� �����-�``�4�0
�� ���%�����C�@�d��2�@� �1��`�@� m��Z�0� �e�����p�@���}���c����
����c����
���XLI�8���>�8�`���������@�$��l���l���l���l���l���l���l���l�����l���l���l���l���l���l���l���l���l���l���l�\�'�l�
�2�Ɗ�'�"��0�9��+�'�l�'�l���l�l�l�l�l�l�l�l�l�l�Պ͊�����"��<�4��b�l�l�l�l��Պ��ՊՊՊ�ՊՊՊ~�������Պ͊�~�v�������������@�Nj �ً@�����GA$3a1�^�x_decimal.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug��ݰ�7zXZ�ִF!t/��p�x]?�E�h=��ڊ�2N��. ��s�������N>�J�q��8��([�w8�o
�� �Y��
�"���������̶����Vu��p�&���&
-ڼ~p��xn�ֽ|����g����9I��t��3�
b
h6	
�)��Z�C��4��ݝPW�c�.�07_�����F��IaT�<�����t�ZO���/e·�)U~��ҝu��4>�N@�e�4��}�[[Y�牍se�$l=�^�'_�}�~oOS�U�Q��@��X>��$/�(�]m�Bo_V��9�F�&���qu?c۬(*���^t^�ٕ���9,��t�}��~��k�6{tn,���HF�5z��'�'�����@v<��K��م���Ǫa��[5�s��G�SEGz�<^J�;�a�4���,b��Z�mu�s�ᝧY�KEܳz�\���W1؎�Nup*�$���x�'���7��;�8��7�zz���Z���*�z/V#��/�bk���Jg�y�܋�[��Y뗿o9�a�f�I� ����M�.N �c��+���������<X���m}>�����2�:H��լ���GF��dn)湥�1�茵�� #��Ȗ}����5�|!���*a>t��љ-��"�\�8E f$D?	�*9�'�yF9F�,_c|���0��,��f�s�}���3k��߲�ˤa��΀�<J�D�: @�O�K�y��z$�{��hZz
��u��!��կ���;�H�-�i3u;H����;��j�z_�g��{�
!�W�(k�C�\�Ƣ�����FyԳ(����zۣ�|��"�u��8�I���g��B'�Ks��.E6��� �����6BAZ����MJ�R��gIL�a��]�pSr2�C�#�g��ł��C�.�77�~�
��jQ<zU�n9^�q���#�19�mV>6ʅ�@aE��{0-qp)^<
"U����(�w�+ߠ���8�`#�	6
�+:��P=���x�,~W�q<�o��._n�_6�V+�9�]��U]��yY�qQw�x��Ҷ��:��.Qc�߲��mN��n��A[��'t��0P۾�pͪ���S��j�8Qg�@'W����&�l��_񗲨y�A��~���]_��r���n3M�&~��&o/�<Gx�F�>,En��I��P��H�(�W>�f�Kf/j��@K���Qn�=2�&�FҡE��[>Q��@%NI�w���Ƚc�G��=����9�DE��Q>z��r����k�H�ŭO�݌��`|V�+��2��S�ʎ
�&�g�#�m;��d�@���6s_�dJH��8��!R�P��������б"9���ka��Ď�ҝ���E	�[�%��q�[6dAN�}�ߪ�2��FY\�#	� ���U&�z��6}����J��[	o�%�$4,�dIi��~2�B%�B��G&{��g�Ӵ?X��cXK��q5����=�}�9ϋ����3N��V�VN�
�[�Ҡ\��⹲/�];/�zm�0��ڬ��/,�wcߌx��J�Żʂ���rʰyBB�TF�.�֪S��2�
�z;���=Lcqh.�A
�;��UN&}x�,_�#���ͪ,Д��V�w��Zx�I�i{��dz�1r8}�MeĎ��
]��e�P�W��W�EG���c��c�b�Bƶ~�
Sb؊(�G ]�9�[b�%�xùh�*�4?(�7PCd�ZV�;h�N�rw�a)���v@�aL�F"Z��z.~{�
,�e,�^g԰��y���
M�k�Q��+��F�����,���L��\v�aS�e���ځ���1�\m0��ͩE6Q}�Z�e�\��H��뤥��-<8F(_�d<��5�*9����|P�:�^�,c�<�\�+�
Z�6B�k��O�N�|��
!��"�TƂ�pbNͧ[I/�^E�췇$4V[��h7��6��Ewl��nԉ�B�.��S�g��V|���� g�g��
�ђ��KP����笎��`
�`j��6b&^�f��c����d�.㎻�P���'얠g�R@�#��'���P<+(�p	��a��o�k�:מ:�ܝg�����hu��h��a̟$�6�jm9����bB}�̷��@tG��L��>>M�h�l[�wk{7��$\�pqŹ.t*�D�n�d�����>l.(��l!�ԁ*"��?�������vU]|^���ڱ��x�*En�wk� �5GVW�m�3>5�[��y�P�L�)�Ɛ���ڪu��K̵�A�@`����@)b!�DِhG��S��6��Ba��R�_�Ʊ~X
7�8�態����p
�b �j
k�g0Ig� �Y��TH��%�W��e���F҆-�c�-	��-�Y����ڛ2v^HK�I����:j��pš�r��,���~�G�J�O�SL4�D����m���ꡱoԅ�����[�aeV�
��YZ�]6hU*�+˄��?Y�׹"���*����4�t�Э4)FՏ�9�3��'�b<�&�8(쏀��`���ȳ$J<���W�����6��C�\�g[Q"�2��%H��\e�D�gw�&��R(,�~גG�-{%5U>�Ǝ DH�]dD� Ӳȷ3�,Swcr��Jr���Đ�n�C��#-�M��A[��&&*��K��K�|ho��#����%�K3���=���=zw�zs��U�S�
�z�-����ע��h�y���")�%�:�
�Ś1�V����}��ok�7�DF�*18�aG�z�'��A����hk�U��n`�P�L?P���,֖7R��#ɢX#�R���
r��~�=��0��iz��E����Shحѥ���b�Qu����>�q��n_���gأ����̾!��V��N��<!�>���
V�S4��/�@���O5W�����fj��g�ޤ��B���"�(�]�3|y�iazf":���m���<�Pje�hl�
x]S�8rW��x�6C_�W���,��	�]#ҾԶ�Do�;<����H� ;}�F��˿�b�I���|�~6ckga���P3��R\Z���G�!Q�rlp�M����գ�)��*�eۅ//�a�[e���q����H6���13,}�и!��"^u�7���+��x�i��)<�5�� �k�||�&Y��ҽ3'�'��Vy�W�]���y���#�=�b��ݐ�@�@p��>{��D���(����=��w�����;�`7'��(�Y����z�F_r����U��un@���M>�{��2�Wxe-����'�8݉k��ZZ��#p�D,��h2H������D�L�9w���mF��]1���<�`� �:$S��UŜ�[��Q�����$�B�%��NB-�8�MWR��/[�F�&��j
Y~9;ǫ��ñ����/
IҒ8�Ū�$��G�=W�ze�%��a������dE��&I�j�m�t��M�;)%��I�W�q (+�����l._1�
c}
�~~頧��!�;h��,ߨ#|Ay0��u��Y���`�
ʡ�����9�uT�������\�E�,b=���W��ȑ�d�P��E�À;�j���Q޷v�=I���)�{T�aA4��Q=4����(nK_�j$��2���{g3�n+��yf2�'X�"0��w��F�%Ï�|����z�ނSQ�D��c�D*�P�V�������<T�q�����#nZ&��q3<���i�jM�8���T����k����w8�Sa����K����pZR1{K�r֜Ԧ�PuKc�	�{
<U3�5Z��Shy���W�;o��W�yk[~ݬ�n� �<�Jk!r����GF�}�|2%P����{BP��b��\�.8B��/s��Zw����d|9x�|4;�f�����Jٌ���8��F��!Ӽ���™�H�'����"�X�y ɝ[�%�N���4hp�ɫ-~0~�7��kɲ���#Yb X���b��>�OJ$uwJ�a��X	>d��"�,�S�E�u��g0ᗑt���)�;��	�lք�E-�?.gb�]��-�>zøҸ%��A)pCܸY�|1u�A����􊶖�U�"�F�j��C[�I/��	�
����I�u-UO�����m�8Ә���VY�y�Q��s�]E��J�{!�J��@nނ�&wQ��n����'t3�	��p��q������"�^RU�.`N�*�m	�@��`����[iȤ�O�6�')`��4�4I?�����6RV��������f⊝�][�'j���~;�+D�Yf�2ƃۺ�Q�����7{���"K�R�(���d�?fh��oH��Z��I�o���
8>���"^rt\�l���A��绫7fe@�^+	���Zz�!����Y�A.J�^�ŷTG2[�y����Q֝ݷ�Vt2�i�w��9�p��y&,�P���Lhfs���-�G����R����~~�M]�e��[�;��,�T�P���lx0����?�!�<�n�1��S��-�ש�\�8K�R�-��7��U��R��NY�z߱�o8�R���2/�0��ˋx�dm����(��/�G+�|��K/�4ƦZӴs+���gɍS���kTr�MD�Ƨ�l@!�F�� �&~#�fξ�-\@[%��l!��.Ƌ�V;������U��D��C���xz?ך+���^A�B�9�]�����;��0�+�I[�^�>�^D�
c����}hH�����Ӄ��C��+�I�4�r8E�VI��E�b�`��Q�[\��'�/�%��Pb{�֘#����#W��J�s�Z0<|Y#JkKΧ�`-8��l.12��-))��G��鋃HF�'̀q;ؘ�ղ���a;�Nh�$���3�5�w�)������h�J��U�h	;��;k���(M��<!b�
��GcKyg���a{y�I���N�nTE�H�m��s�5�?�ol�P0�Ĉ}�N~��{9D2��H�S2N��Vp���ҙ���$k{9�#e���uD�����_�e:P��px8�7H5\�\�#t]������*�����hT�}.-C���6l����R	;9�O�i���0�t6r�m�!�'r�N���^�o56w�lj1�v���p!���%�����P�4]/[,�,����hC�9�ݻ���g��a���<u����1Sy�<1ΰ5�S� "������:6�𜥞�?�E��<���Os٬~"���j��Q�+5E�mA�#M�Z�z��ߟ��oH/\����K%SR�:�]|I���1��1Yx�Ə����"�X��m��� [���~�2Yxp"����/�Rv֕�v6[\���o�aWUy�}���o9�E)J�j5s.en�Z�~���-wP"���EtuQ?��w����P˩�
*��بQ-��0����:�PB��-��
����ǭ��Q|g��n�^6���\��9�X�D|��&;���o\��~�k�֌���y"�v�t.��[��s�aw�HXm�*1�w��-�)R��˺�o�V��Р���ʐ�i{
fQ�[|�yP��ƑL��^�)8�ŽY:Y_����(kܫA��B�.ҹQ�0����\R2��úc
,�.ZB7M�Ck�E�{i��_�!���
�H]�v���(�\@���3�,d�sj��L�
f"��g�����4Q/y�(��~�zPei��
�鍽�д:��
���W�䮽|S��	�[��ɛ�뼌�V]39p��O��F��D@:7m=���p.�_t�[s����k�T J[�v2��:p���F:��
��-N��7��1��C��7�J��!W�D�bd89.Z�|l-/�������gyN���ݮ�t�is�~fu�;.�B��kz��W��R�/��YH����zܘt����ڑ6B7P�ӵ��we�|X
�} �1uV�	>l�3�e��¼3���Z�k&�n����#�!ٝ舠�Ôm�K�=���fNԡq�f��^��G�Ȏ�>$���uۣrZ�Ql�	��q�si�C��B�2��0�.#!�F9��̄숐gn�I�*�/﬉t��N��m�&�l��Tn�W[;ʏ-��1��ό���g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(��0���8���oPPE���oXX�T��=^BVV�h�^�^c�^�^�n�d�d�w�j�j�
}�x�x
��x�x(} �������@c��k�k ��x$�x��x$�x��x$�xh �z$z�|$|���$�`# �`�$`� �h�d`�$
��`����(lib-dynload/spwd.cpython-38-x86_64-linux-gnu.so000075500000037030151153537510015071 0ustar00ELF>@�6@8	@XX �,�, �, �� �,�, �, 888$$888  S�td888  P�td���DDQ�tdR�td�,�, �,   GNU�����R~]��FﲥD�@ �!~X��|CE���qXs�[�0 � �, F"��|��������J����t<�3 )�1 0�1 __gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6PyStructSequence_NewPyUnicode_DecodeFSDefault_Py_NoneStructPyLong_FromLongPyErr_Occurred_Py_DeallocPyList_NewsetspentgetspentPyList_Appendendspent_PyArg_BadArgumentPyUnicode_EncodeFSDefault_PyUnicode_ReadyPyBytes_AsStringAndSizegetspnam__errno_locationPyExc_OSErrorPyErr_SetFromErrnoPyExc_KeyErrorPyErr_SetString__stack_chk_failPyInit_spwdPyModule_Create2PyStructSequence_InitType2PyModule_AddObject_edata__bss_start_endGLIBC_2.2.5GLIBC_2.4f ui	Avii
Mui	A�, ��, P�, �, 0 q0 y0 �0 � 0 �(0 �00 �80 �@0 �H0 �P0 �X0 p`0 h0 �p0 x0 ��0 �0 "�0 +�0 2�0 I�0 �0 M�0 ��0 �0 P�0 1�0 @ 1 Y(1 @01 0 h1 ep1 ��1 �0 �/ �/ �/ 	�/ 
�/ �/ 
�/ / /  / (/ 0/ 8/ @/ H/ 
P/ X/ `/ h/ p/ x/ �/ �/ �/ �/ �/ �/ �/ �/ �/ ��H��H��  H��t��H����5� �%� ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h��������%e D���%] D���%U D���%M D���%E D���%= D���%5 D���%- D���%% D���% D���% D���%
 D���% D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� DUH��H�=� SQ�>���H����H�}H��H��t���H�C�H�� H�H�CH�}H��t�r���H�C �H�� H�H�S H�}����H�}H�C(���H�} H�C0���H�}(H�C8����H�}0H�C@����H�}8H�CH����H�}@H�CP���H�}H�CXH��t���H�C`�H�
 H�H�K`H�}H��t����H�Ch�H�5� H�H�sh���H��tH�uH���x���1�H��Z[]���U1�SQ���H��H��tq�����?���H��t]H�����H��H��t$H��H�������H�Et'H��H�EuH������H�uH���	����T���1��H��H�Eu�H�������8���H��Z[]���UH��SH��dH�%(H�D$1�H�F���u$H��H�MH�5J1�H�=J�����~ yH��1�����H��H��u���H��1������u��p1�H��H��1��s�����tOH�<$�V���H��H��u3�����8tH�
U H�9�u����#H�T H�5�H�:�-����H���s���H��H�MuH����H�L$dH3%(H��t���H��[]�1��6f.�f�H�=� H�� H9�tH�� H��t	�����H�=� H�5� H)�H��H��H��?H�H�tH�� H��t��fD�����=e u+UH�=� H��tH�=~ ����d����= ]������w������S��H�=� ���H�������= H��uH�5N H�=' �R�����x-H� H�5nH��H� ����� H��[������H��H���strargumentgetspnamgetspnam(): name not foundsp_namplogin namesp_pwdpencrypted passwordsp_lstchgdate of last changesp_minmin #days between changessp_maxmax #days between changessp_warnsp_inactsp_expiresp_flagreservedsp_namlogin name; deprecatedsp_pwdgetspallspwd.struct_spwd#days before pw expires to warn user about it#days after pw expires until account is disabled#days since 1970-01-01 when account expiresencrypted password; deprecatedspwd.struct_spwd: Results from getsp*() routines.

This object may be accessed either as a 9-tuple of
  (sp_namp,sp_pwdp,sp_lstchg,sp_min,sp_max,sp_warn,sp_inact,sp_expire,sp_flag)
or via the object attributes as named in the above tuple.getspall($module, /)
--

Return a list of all available shadow password database entries, in arbitrary order.

See `help(spwd)` for more on shadow password database entries.getspnam($module, arg, /)
--

Return the shadow password database entry for the given user name.

See `help(spwd)` for more on shadow password database entries.This module provides access to the Unix shadow password database.
It is available on various Unix versions.

Shadow password database entries are reported as 9-tuples of type struct_spwd,
containing the following items from the password database (see `<shadow.h>'):
sp_namp, sp_pwdp, sp_lstchg, sp_min, sp_max, sp_warn, sp_inact, sp_expire, sp_flag.
The sp_namp and sp_pwdp are strings, the rest are integers.
An exception is raised if the entry asked for cannot be found.
You have to be root to be able to use this module.;@T�\��D����e���������T���zRx�$��FJw�?:*3$"DH�p(\��!A�K�A AA$������E�C�A �AA$�����E�D�D0�AA�����tE�i
AzRx�� ����GNU��P�, Ufv
�, �, ���o`��
W�. (�� 	���o���oh���o�o ���o%�, 0@P`p�������� 0@P`p��qy���������p��"+2IM�P1@Y@0 	e����������0 GA$3a1!spwd.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug�
.F�7zXZ�ִF!t/���C]?�E�h=��ڊ�2N��(���" ����y\N��Yכ�W�jn�!b%�|�ڮxo���9�a� ѭ��nX�i��w9.�h��,1p6�`�]�����6�mU�3=�`�&��0�g�q}��Fg���U�&�yf�Z�[_�$֧�M�'���1
Q��҄�U}�2�C��Zm	r�[c�e�#4T��K G=�'{?�NT����~���~;���!|D,�;<��*��h�h���}8�b�r��1�A�Kh۩�Bn�^�S��_ȼ��6{��ƛ����I��b����k������
�2
?c��~�|D�ݰ}�+#c��J�D�c�U���UV�I�C�+�s����z\~/~;1@3u�ΰ]�c�Rf�'��6���W�9ʄ����
p�u�r�]�ĉW@K�o���#O��I6�Z���^QՈø�Q��+M�x��߭)�&�F�O�CIsK7����V� N~��Ľ�'.�0F<2V(�����㴃���򉉇�NS)F.�iH�jRL�ħ����l=7��U1
&m���u&�}����%��.ˬ���H%�!P/s���$�\���_�����}��z�Zm��'|̶wt=_�aHqB��
��᳢}�&���V�h΂��p���T\���+Z>���Œ^��H^�T���fJ�y�Cߜ#	}{�v���N�a�[��1���}@k�(�$L��ZO�rT|��6�U�i�*3է��������S{���B���&C�3:!:�[ʡ���������j}~g\���
���bDõ�5�q^���oqȳ�3P� ξ�۞��� �xk0��N�\3��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(��00��W8���o  DE���ohhPT�� ^B��(hc  �n��pw}
�@@� ���D�(�88 ��, �,��, �,��, �,��, �,��. �.�0 0� ��1 �1� ��3`�1$
�1\(2��5(lib-dynload/_sha3.cpython-38-x86_64-linux-gnu.so000075500000325770151153537510015124 0ustar00ELF>�"@��@8	@�~�~ 0�0�!0�!�� h�h�!h�!888$$p~p~p~  S�tdp~p~p~  P�tdqqq��Q�tdR�td0�0�!0�!��GNU�Eħ��ܢ|X
�BC�B-�#�(��@@Z&���"-.1378;<=>@BDEGJ��Kn�.`��E�*"�#�qX��1���:l��|���rp�ni���ѓ/�5bCE��kYi���[�Px�mr Y���̏C��a[У�ȣm���B�0����3��k�f���? sJ��(��  ��, F"^L�Y������.�x��2�6�p�:D\���`g��#3�2U��!�%��e�I��!�V�o�#`Y�g
]`X5�a���!���9�i#3+@�h�/$D�0�<��Uw���qR@d4a�9 �4�[�%�$�P]d��9VX�s$�__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libssl.so.1.1libpthread.so.0libc.so.6PyBytes_FromStringAndSize__stack_chk_failPyLong_FromLongPyObject_FreePyThread_free_lockPyExc_ValueErrorFIPS_mode_PyObject_NewPyErr_FormatPyThread_release_lockPyThread_acquire_lockPyEval_SaveThreadPyEval_RestoreThreadPyUnicode_FromString_PyErr_BadInternalCall_PySHA3_KeccakWidth1600_SpongeInitialize_PySHA3_Keccak_HashInitialize_PySHA3_KeccakP1600_Initialize_PySHA3_KeccakP1600_AddBytesInLane__memcpy_chk_PySHA3_KeccakP1600_AddLanes_PySHA3_KeccakP1600_AddBytes_PySHA3_KeccakP1600_OverwriteBytesInLane_PySHA3_KeccakP1600_OverwriteLanes_PySHA3_KeccakP1600_OverwriteBytes_PySHA3_KeccakP1600_OverwriteWithZeroes_PySHA3_KeccakP1600_Permute_24rounds_PySHA3_KeccakWidth1600_SpongeAbsorbLastFewBits_PySHA3_KeccakP1600_Permute_12rounds_PySHA3_KeccakP1600_ExtractBytesInLanememcpy_PySHA3_KeccakP1600_ExtractLanes_PySHA3_KeccakP1600_ExtractBytesPyExc_RuntimeErrorPyErr_SetString_PyLong_UnsignedLong_ConverterPyMem_MallocPyMem_FreePyErr_NoMemory_Py_strhex_PySHA3_KeccakWidth1600_SpongeSqueeze_PySHA3_Keccak_HashSqueeze_PySHA3_Keccak_HashFinal_PySHA3_KeccakP1600_ExtractAndAddBytesInLane_PySHA3_KeccakP1600_ExtractAndAddLanes_PySHA3_KeccakP1600_ExtractAndAddBytes_PySHA3_KeccakF1600_FastLoop_Absorb_PySHA3_KeccakWidth1600_SpongeAbsorbPyObject_GetBufferPyBuffer_Release_Py_NoneStructPyThread_allocate_lockPyExc_BufferErrorPyExc_TypeError_PySHA3_Keccak_HashUpdate_PyArg_UnpackKeywordsPyObject_IsTrue_Py_Dealloc_PySHA3_KeccakWidth1600_SpongePyInit__sha3PyExc_ImportErrorPyModule_Create2PyType_TypePyType_ReadyPyModule_AddObjectPyModule_AddIntConstantPyModule_AddStringConstant_edata__bss_start_endOPENSSL_1_1_0GLIBC_2.14GLIBC_2.4GLIBC_2.2.5GLIBC_2.3.4U m����ii
ui	#ti	/0�!pg8�!0g@�!@�!P�!�iX�!Ej�!�i�!`_�! p �!�i(�!�8�!�l@�!�iH�!�X�!`l`�!jh�!p[x�!o��!j��!_Ȑ!jА!�_�!j��!�^�!#j �!�^@�!2jH�!�^h�!=jp�!P^��!�iȑ!`_ؑ! p�!�i�!���!�o�!�i�!���!`o �!j(�!p[8�!o��!�i�!P�!�!�j8�!UjP�! _Г!�p�!��!�!��!X�!p]ؔ!ej�! _p�!`p��!��!��!��!��!p]x�!uj��! _�!�nH�!�!X�!��!��!p]�!�j0�! _��!n�!�!��!��!8�!p]��!�jЙ! _P�!�m��!�!��!��!ؚ!p]X�!�jp�! _�!m(�!�!8�!��!x�!p]��!��!��!��!��!ȏ!Џ!؏!�!�!�!��!��!��!��!��!��!	��!
Ȏ!Ў!
؎!�!�!�!��!�!�!�!�! �!(�!0�!8�! @�!!H�!"P�!#X�!$`�!%h�!&p�!'x�!(��!)��!*��!+��!,��H��H�Iq!H��t��H����5�o!�%�o!��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!���������%�m!D���%�m!D���%�m!D���%�m!D���%�m!D���%�m!D���%�m!D���%�m!D���%�m!D���%�m!D���%�m!D���%}m!D���%um!D���%mm!D���%em!D���%]m!D���%Um!D���%Mm!D���%Em!D���%=m!D���%5m!D���%-m!D���%%m!D���%m!D���%m!D���%
m!D���%m!D���%�l!D���%�l!D���%�l!D���%�l!D���%�l!D���%�l!D���%�l!DH�W@��vH�W`��vH�����vH����H��FL��1�1�H�5�G�`����<�f����<1��������<���H����I���y���L���a����]<��H�=�G����1�Z����E��t$AQE��A��I���=��uE���E���Z����H��H���21��fv�H�r@BH�r`H���H������A��H��A�Q�B����vA��tE�Q�A��tA��u�E1�E9�sB�F�I���B���É�H�D��H�H������1�A��9�v6D�H�H��A��vA��tE�P�A��tA��u	H��H���H��H�������AWAVI��AUATI��US��AR��u3A��A��D������ڃ�AY��A��1�[H�]D��A\A]A^A_�
���A�׉�A�A������t(D��L��D��L��)�9�HF�A��A��)�I�����1���X[]A\A]A^A_�����E1�I����D��D9�v1E�J�A��v��tD�A�A��t��uN���J��I����A��A��t3��B�D��H���v��t�z��t����u��H����H���ý��9���ۉ�T$��?�T$�ɉ��ۉ��AWAVAUATUSH��`L�G H�WH�_L�_(H�|$�L�o8L�@L�D$�H�OHH�wPH�T$�L�GXL�gpH�\$�L�H�GL�\$�L�l$�L�_0L�|$�L�hH�L$�H�t$�L�D$�L�G`L�d$�H���L�wxL���L�l$�H�T$�H�L$�H���H���L�t$�L�d$�L���M1�L1�H�L$H�L$�L���L���H�t$�H1�H���L�4$L�d$L���L1�H�|$�H�\$L1�H�t$H3|$�L3l$�L1�H3|$�H3|$H1�L3l$�H��L3l$H��H��H3T$�M��H3T$�H�H3$H�t$�I��H3t$�H3t$�H1�H��H3t$�I1�H��L��L1�H1�I1�H��H1�M1�I1�M1�I��I��I1񿋀�M��I��H1�L��M	�H��H��H1�M1�L	�H��I1�L1�L�t$ M��I!�H�\$(M1�M��M!�L�\$I1�I	�H�T$�L�t$0M1�L�T$@L�L$�M1�L�T$�H1�I��L�D$8M1�H��M��I��I1�I��I��I��L��L��H!�L	�H1�L1�M	�I	�H�\$�H�\$�I1�L!�H�T$@L1�H�|$�I1�H�|$�L1�H�D$HM1�H��H1�H�$I��L�L$�H1�I��L�D$H��L1�M	�M��H��I1�I1�I��H!�I��L�t$�I	�H1�L�T$�M!�L�T$�H�<$H1�M��H�|$�I1�I��H�\$�M1�I!�L�\$�H1�L�\$�M1�H��M1�I��H1�M1�I��H��
I��L��L�L$�I��L�L$H!�M	�H1�M1�H�D$�I1�L3l$�L�t$�I��M��I��I��H3t$�H3L$�H��	M	�L3d$�H��I1�H��L	�I��L1�L!�L�D$�H�D$�L3D$�H3D$�I1�H1�H3D$�L3D$�H��M��H3D$ L3D$(H��I��H3l$L�L$0H�|$�H!�H��H��L�t$�L1�I!�L	�H1�L1�H1�I1�L3L$�H��M1�I1�H�|$�H�|$�M1�M��I!�M��I	�I1�L��I��M1�L�d$8L3d$L1�M1�L3d$�H��I1�M1�H1�H��L��H�L1�L�L$ H��I1�L1�H1�M1�H��M1�I1�L��I��I��I��H1�M	�H��L1�I���M1�H��M1�M��L�d$�I!�M��M1�I��M��M	�I	�L�l$�I1�M1�L!�L�\$HH1�H�l$�L�|$�I��H�|$L�L$8I1�I��L�d$�L�d$�I��L1�H��I1�L��I1�I��H	�I��I��L1�L1�M!�M	�H�|$�H��M1�I1�L��M!�L�l$�I1�L�l$�H	�L�\$�H�L$(L�L$8L1�L�L$�M1�L�|$I��I1�H1�H�l$ I1�I��L��H�l$�I��H�M��L	�M!�H1�I��L!�M1�H1�H�|$�H�|$�L�\$�M��I	�H�L$(I��H�L$@L1�I!�H�\$�M1�L�|$�H1�M1�I��H��H��L1�I1�H��L�L$�M��H1�I��I��I��H3T$I��H��
H3$L3D$0M	�I!�I��H��	I1�H��I	�I1�L!�H��L3T$�H	�H1�H��I��I1�H��I��L3|$�L1�H3t$�L�L$�H!�I��H��H��L1�M1�H�L$�L3|$�L��H��H�L$�H3L$�L	�H!�L1�L�t$�H3L$�H1�H��H3L$�L�d$�L��I1�H�T$�L��L!�H	�I1�L3d$H1�L1�L�T$�L3T$ M1�I1�L3T$�L3d$�M��I1�H�T$�H�T$I�H3T$8H3T$(M��L��H��H3T$�H1�I�H1�I1�I1�I1�H��L1�H�L�d$�M1�I��H�L$�I��H1�M1�M1�I��M1�L1�I��L1�L1�H��H��H����H��I��L	�L1�H1�L��H!�H�t$�L��L1�M��I!�H��I1�L	�I	�H�|$�L�d$0L�d$8H1�M1�H�L$�H1�L�\$M1�H��H�t$�I��L1�I��H�$H��M��H��L1�I	�H��I	�H��I1�L!�L!�H��H1�H�D$L1�L�d$�H�|$HH�|$�M1�L	�L1�L�l$�M1�H1�H��H1�I��L�T$�H��M1�H��H�t$�I��I��H	�H�\$8M!�L1�L�\$@H��I1�H�L$�L��I!�L�T$�M��H	�I1�I��H�L$�I1�H�t$�I!�H�l$�H�\$�I��I1�H�|$L�l$L�l$�L�d$�L1�H��L1�L1�H1�H��H��L1�H3T$ H��H��I��L3D$�H��
H��H��	L3L$�H	�I!�I��L3t$(H1�I1�I��L3l$�H�D$�H��L3l$�H	�L�\$�H!�I��L3|$�I	�H1�L��I��I1�I��L��I��H1�I��M1�L��M!�H!�L	�M��I1�H�\$8H1�I	�M1�M1�H�|$�H��H�|$�L1�H3|$�H��H3|$�H3$I1�I!�H3\$�L�L$L1�I1�L3L$@H3|$�L1�L�d$�I1�H�t$�L3L$�M��L3L$�H�t$HH��I��L��H��H��L1�H��H3t$0H3t$H3t$�H1�H���I1�I1�H�T$�H��H1�M1�H�\$�H�H1�L1�I��H1�H��L1�H��I1�I��I��I1�M	�I1�I1�H��L�L$�M��L!�I��L1�I��H!�I	�M	�L1�L�|$I1�I1�H�D$HH�|$�L�L$�L�L$�I1�H1�I��L�T$�M1�H��H�\$I��I��M1�H��I��L��L	�M1�M��L!�L1�I��I��H1�H�T$�H��M	�H�|$H�|$�M1�M��I!�H�\$8M1�M	�L�t$�H1�L�|$HL1�L�|$�L1�H��I1�M1�H��I1�L�T$ I��I��I��L�L$(I��M��L��I��M	�M	�M!�H!�M1�L1�H1�M1�I!�L�T$�H�\$�L�\$�H��M1�L�\$�H�|$�M1�L1�H�|$0H1�I��L�t$8H��
M1�M��L�L$�I��H1�I��I!�H��M	�H�D$�I1�I1�M1�I��L�D$�L3,$L�t$�M��L�D$I��I��L3D$�H�D$�M	�H3D$�L3D$�I1�H��L	�H3D$�L1�L!�H3D$�L3D$�I1�H1�H3t$@L3d$�H��	I��H3l$�I��H3L$H��H��M��H��I!�L�L$�H��H�|$�H!�H��L1�I1�L3L$ L�t$�L	�M1�H1�L1�M1�M��H��I!�I	�I1�I1�L��M1�L�d$�L3d$(M��M1�L3d$�L1�H1�H�|$�M1�H�|$I��L��H��I1�H1�H��H��I1�H1�H�L1�H��L�L$�M1�L1�I��I��L��M1�M	�I1�H1�I��M1�H��I���M1�M��L�d$�M��I!�I��M1�M��M	�I	�L�,$I1�L!�M1�L�L$HH1�L�\$�L�|$H�|$H�|$�I1�M1�I��L�d$�L�d$�H1�L��H��I��L1�I1�H��I��M��L	�I��M!�H1�L1�I��M1�H�l$�H�l$ M	�L�l$�H��M1�I��L!�L�L$�H1�L�|$�I	�L�|$�I1�H�L$�L1�H�|$@I��H��I1�M1�M��H1�I��H��I��H�L	�M��I!�M!�H1�L�\$0M1�I��I1�H�|$�I	�H�|$�L�\$�L�d$�M1�H!�I1�L�|$�I��H1�L1�M1�L�L$�H��I��M��L�L$�H�L$ H��M��H�L$I��I��L3|$�I1�L3D$�M	�I��
H1�H3D$8I��H��L!�M1�H��H1�H��H	�L�t$�H�\$�L��L!�L1�L	�I1�M��H�L$�H1�H�|$(H�L$�I��I1�L3|$�H1�H��H��	L3T$�H3t$�I��H��H��H3L$�M��L	�H��H3L$�I!�H3L$�H!�H1�L1�I	�L�$H��M1�L�T$L3T$0I1�I1�M1�L3L$�L3T$�L!�L1�M1�H�T$�H1�M1�H�T$L3L$�H3T$@M��H3T$ H1�H3T$�L�d$�I�M��H1�M��L��I1�I��H��I1�H�I��H�L$�I1�H��M1�M1�L�d$�L1�L1�I��I1�L1�H��M1�I��I���H��H��L	�L1�L1�M��I!�H�t$�L��M1�M��I!�H��I1�I	�L	�H�|$�M1�L�d$(L�\$H1�L�d$@L�L$�I1�L�l$M1�I��H�t$�I��L1�L1�L1�H��L��H��M��H	�I��H��H��L1�M!�I��H!�I1�I	�L1�L�d$�L�\$HL�\$�I1�I	�H�|$�H�t$M1�I1�M1�H�t$�I��H�L$�I��H1�L�L$8L1�H��L��L1�L�l$@H	�H��H��L��L1�H��H!�H�D$�H��L1�L�L$�H��H�\$�H!�H1�H	�M!�H�|$�H1�I1�M1�H�l$H��I��L�d$�L1�H�t$�H�t$�M��L1�L�d$�H��I��H��H1�I��L3<$H��M1�I��I��
I	�M1�M!�L��L�d$0I1�L�\$�L	�I��L�l$�H1�L�l$�I!�L3l$H	�L3l$�I1�I��	H1�I1�M1�L3t$ L3D$�M��I��I��I��L3T$�I��L��I��H�l$�L��L	�L��L!�M!�L1�L	�M1�I1�H��L1�H�|$�H�L$I1�H�T$�H�T$8M!�H3|$�H3L$@M1�M��H3|$�H1�H3T$�L1�H3T$�H�l$�L1�L1�H3|$�H3L$�H3L$�H�t$HH��I��L�T$�L1�H3t$(H3t$�H3t$�H�H��I1�H��I��H1�H�|$I1�L1�H��H��M1�H1�H1�H�H��L1�I1�I��H��I��I1�I��H	�I��M	�L1�I1�L!�H��
�L1�L�D$�H�T$�L��L!�H�|$H1�L��L�T$�L	�L�|$H�$L1�L�\$HI1�H�D$I��M1�I1�H1�I��I��M1�L��L��H��L��L	�H��I��H1�M1�H	�L	�M��I��L1�L1�M!�I!�H�T$ H�T$M1�M1�H�\$8L�t$�L�|$HL1�L�|$�L�T$�H�|$�L1�I1�H�D$0H��I1�I��I1�I��I��I��L��M	�L��L�D$M��M1�L!�L	�I!�I1�H1�H�\$�M1�I��H�|$�H�|$(L1�L�T$�L�T$�H1�I��L�\$�L�\$�H1�M!�M1�H��
L�t$8M1�I��L�L$�H��M1�M��I��I��H�D$�I!�I1�M	�H3D$�I1�I��M1�L�t$�M��H3D$�I��H3D$�L�D$�M	�L�D$L3D$�I1�H��L3D$�L3D$�L!�L�t$�I1�L3d$�H3t$@L	�I��H3l$�H��	L1�H3L$�H��H��M��H��I!�L�$H��H�|$�H1�H!�H��L1�L3l$�L	�I��I1�L3L$ I��H1�M1�L1�H��M1�M��H1�I1�I	�H�|$�M��H�|$M1�L�d$L3d$0M1�L3d$�M1�I!�L��I��I1�H��L��H1�L1�H��I1�I1�H1�H��L1�H��L�L$�M1�H�I��I1�L��L1�I��M1�I��I�
��M	�H1�M1�H��M1�M��L�d$�M��I!�I��M1�M��M	�I	�L�l$�I1�L!�M1�L�\$H1�L�d$�L1�L1�L�|$�H��I1�H��H�|$H�|$HI��I��H�l$�L�L$�I��H1�H1�H��M1�H��I��I��I	�M	�M��M1�M��M1�I!�I	�L�d$�I!�L�d$�I1�H�l$ I1�L�|$H�L$�L�|$�I1�I1�L1�I��L�\$@H�|$H��H1�I1�L�l$�I��I��M��L�L$(H�M	�I1�M!�I��H!�I1�L�\$�M��H1�L�l$�I��L�l$�I	�I!�H�L$ H�\$�H1�H�L$�M1�H��M1�I��I1�L1�I��H1�H��L��I��H��
I��M1�L�|$�H!�M!�I��I��H1�I	�I1�I��H�\$0M1�H�l$�M	�H�l$�L	�H3l$�I1�L1�L1�H3l$�L3$L3T$�H1�H3t$�I��I��H��	H3D$8H�|$�I��H��H��M��H��I!�L�d$�H��M��H!�H�L$�H��H3L$�L1�I	�L�l$�M1�L	�L�T$�L3T$(I1�M1�L3l$L3T$�M1�H1�M1�L3l$�L1�H3L$�H��H3L$�L�d$�L!�M��M��H1�H1�H1�I��I1�H�M��H�T$�I��H�L$�H�T$H��I�H3T$@H3T$ H��H3T$�I1�L1�M1�H1�H��L�d$�M1�H1�H��H��L1�I��L1�I1�H��I�����I1�L	�I��L1�L1�M��H�l$�I!�L��M1�H��M��L	�I	�L�,$H1�M1�I!�H�L$�I1�H�\$�L1�M1�L�d$0L�d$@H1�H1�H��H��H1�H�l$�M1�H��H��I��I��I��L�\$I��L!�M��I��M	�L1�I	�I	�I!�I1�I1�M1�I1�H�\$L�L$�H�l$�H�D$�L�l$8L1�L�\$@H��L1�L�d$HL�d$�H��H�L�|$�H��L�l$�I1�I��M1�I��H��L	�M��H1�M��M!�H!�H�L$�H�L$�I��I1�H	�H1�H�\$�I!�L1�H�|$�I1�H�l$H��L�L$�M1�H1�H1�I��I��
L1�H��H��I��M1�H�D$H��I	�H��M��M1�L!�I��I	�I��L�|$�L�|$�I1�L3|$�I!�L3|$�H1�M1�L1�H	�H3t$�H3T$(H1�H��L3D$�H��L3T$�H�D$�H��	L3t$ I��L��I��I��H��H��L!�M��I��H�l$�L1�M!�I	�H�l$8I��I1�L�L$�I1�M	�H�|$�I��H3|$�I1�H3|$�L1�H3,$H3l$�L1�L�D$�M1�H3|$�H1�L�t$�L�L$L3L$@I��H�t$�I1�L3L$�L1�I��H!�L�L$HI1�H��I1�L��I��H��M1�H�I1�H�t$�L3L$0H��L3L$L3L$�I1�M1�L1�L1�I�M1�H��I1�H�l$�I��H��L1�I��H����H1�L	�H��H1�H1�H��H�|$�L��L!�H��H	�H1�L1�I��L1�M	�H�T$�H!�H�T$�I1�H�L$HL1�H��L�T$L�\$�H1�M1�L1�I��H��H�|$�H��I��M1�I��H��I��M	�H��H	�I1�L��H�l$L1�H	�L!�L�\$ H�t$�H��H�l$8L1�L�\$�L�d$�H1�I!�L1�H�L$�I1�H�T$(H��M1�M1�L1�I��I��H��L1�I1�L	�L��H��I��L1�L�T$HI!�L	�M��M1�H�|$I!�H��H1�L�d$8I1�L1�H��L�d$�H�\$�H�\$0H��L�T$�I1�L!�H�L$�H�L$�L1�I1�I��L�l$�H��H�l$�L1�M��H�T$�H3T$�H��
M1�L1�I��I!�H��H��I1�L	�L�T$�L1�M��L1�I��H3T$�H�|$�H�|$H3|$�I	�L3D$H3D$�I1�H��L3L$@L	�I��H!�H1�I��	L3t$�M��H��I��H�\$�H1�H��L��L3<$L�T$�I	�L!�L�T$�H��I��L1�L!�M1�L1�H3|$�I��H3|$�I1�M��L3T$ L1�H1�I1�M1�L3T$�M	�H�L$�H3L$(I��I1�L�d$�L��M!�L1�H3L$�H�L�$I��H1�H��M1�M1�H�\$�L�t$H��M��L1�L1�H��I�I��L��H1�I1�I1�H��L�L$�L1�L1�I��M1�H��I1�M��I1�I��I��I	ӿ�I��I��M1�L��M	�I1�M1�L!�L�\$�M!�H1�L��L�T$M1�L	�H�L$L�L$�L1�L1�L�l$HL�|$�H��I1�L�t$@L�t$�I��M1�I��I1�I��I��I��I1�L��M��L��I��H�T$0M	�H	�H�T$ L!�M1�M!�L1�M	�I1�L�t$�H�l$�L1�L�|$�L�|$�L1�M1�I1�H��L�L$�H�|$�I1�I��L�T$HI��I��L1�I1�H��M	�I��M��H��M1�I!�L�\$�H��M1�M��H�L$PL!�L�|$XL�|$�M	�L1�L�t$�H�L$�I!�I1�I1�H�l$L�l$�I1�I��L�,$L1�I��
I1�H��L1�L��M��L�\$�H��I1�L!�I	�I��I��H1�M1�I��L�L$�I��H�$H�T$�H3T$�H3T$�H�|$�H��H3T$M	�L�T$ L	�M1�L!�L1�L�\$L�\$8H1�L�|$�H3t$(H��M1�H��	H3D$�L3D$�I��I1�I��H��I��L��I��H��H��L	�M��L!�I!�L1�L�l$M��L1�M1�L�d$�H��L3d$�I	�L3$$H1�L3d$�M1�L�T$0H�t$(I1�L3l$HL3l$�L3l$M1�L3T$PM!�M1�H�|$@L3T$ L1�H3|$�H3|$XI1�I��H1�L��I�M��H��H1�I��M��I1�L1�H��L�d$�L1�L1�L�t$�L�l$�M1�I�H1�M1�L�d$�I1�I1�L�T$0I��I��L1�L�d$�H��L�l$�H��M	�L3l$�I1�I1�M1�I��H�D$�L��I��I��L�T$�L1�L�l$�L�d$�L1�I1�L�d$�L�\$�H��H��L�\$L�T$HH�l$�M1�H�\$�H�l$�I1�I��I1�I1�H�\$I��I��I��H1�L�\$�L�\$ H1�H��
L�T$�L�T$@H��I1�H3T$I��M1�H��L�\$�L�\$�I��L�T$�M��I����M1�I��I��H3|$PI1�L3$H�D$�L3L$XH��	I��H3t$(I��L�8M��H��I��I	�L3|$�L�xL�|$�I!�M1�L�pL�t$�Lt$�L1�H�HH�D$�H�L$�H#L$�L�|$�H1�L�t$�L��L!�H3L$�I�G H�D$�M	�L3t$�I�O0H��M�w(L�t$�L	�L#t$�L3t$�I1�H�D$�HD$�M�wXM�o8L�l$�I��Ll$�H3D$�M1�L�l$�I�GPL��M�g@L�d$�I��L#d$�L#l$�L3d$�L3l$�H!�I	�M�o`I��H�L$�M1�I��HL$�H3L$�M�gHM	�H��L1�I�OhL�d$�L��I���H�l$�L\$�L#d$�M���L!�M1�I��L3d$�I��H1�H3D$�M�gpM���M��M!�H��M	�I1�I�GxI1�I���I��M���M���M��I!�M1�L���I��H!�I	�H1�M1�H���L���H��`[]A\A]A^A_�D9�$,��B��H��A�I�� �D��$4L��$,A��E��L�t$D��$(A��E����hH��$@H�t$�thL�%E!H�5D I�<$���1��jhI��HՅ�u_�މ�L�����t$ H�t$(H��H�L$�����L�D$�|$ �iI�T$����h��hH��D�\$�5D�\$����A��M���D�t$A��L�d$ ��A��L�|$@E��I���L�l$HM�Յ���H�|$(L��D��)�9�HG�A��A��)�I��c1��ˉ��|$L��L�D$ ����|$L�D$ �RhD��L9�v)H�|$(��\$4DŽ$,)�A��L����M��H�l$(H���fL��D��1�H��I��CdM��I)�L9�v�H�L$H�L)�H��H9��WgL�l$8��f�b��I����H���N��H���6��H�|$`I�u�8�I���H���f�iD��L��D�t$L�d$ L�|$@L�l$H�iD��L��H�T$D�$����$L�D$����H�O�I��H�T�`����o����o�dnL��MŅ���A��H�\$H��A���l$�щ�L�l$M��D�d$DE�܅����L��D��L��)�9�HG�A��A��)�I��Gb1���D9�$,��B�D�H��A�I�� ��D��$4��$(L��$,A����E���L�4$E���0j�|j��L��L�L$�L$����|$H�t$A��A��D�O�I�6H��L�D�`A����n����n�	k����I���iH��D�$�TD�$�F���H�|$H�L$L�l$D�d$DI��$,L9,$�jL��H�\$ L�|$(��kH9\$0��L����l$DŽ$,D)��I݉�A��L��L��A����T$L��L�D$�����L�L$�L$�j�!jL9l$ ��H�|$D��D)��A��DŽ$,M��A��H�t$L����A��H��D�\$H�$�����H�$D�\$��k�lL�5�@!H�5rE1�I�>�-��L������hH�l$ L�d$L���L��L���1�I���`L��H)�H9�wI����L�d$(M)�M9��kL��L�|$�PhI��I�E���=���E��M��A��L�4$A���l$D��A��L�d$0��E��L�l$8M�ͅ����H�|$L��D��)�9�HG�A��A��)�I��_1��˾H���_H����g�ZjH�l$0L��I���1I)�L��D��1�L��I��`L9�wKL�����L��H����I���8��L��� ��H�|$`H�u�8�H���H����f��kL�l$8I)�L;,$��gL��H�\$ L�|$(�iD��L�T$8L�4$L�d$0�t$M��$,M9���iL��L�|$��f1��������H�l$PI�v�8H���I���H����D��$D��$(A��E������$ ��D��$A��F0D
E��xVB�D�H����D��$$D��$A�I�� A��A��L��$D��D�d$E���mL��$0��lD;�$u�H��D�T$�D�T$�����I����H�����H����������_������L�%�=!H�5�I�<$�C��1��|l�\$H9���H�|$L�$�!1�L�$DŽ$��l����M��L�$$��L�|$0��A��L�t$8��A��M�΅�t{�H�|$L��D��)�9�HG�A��A��)�I���\1���D��L��L�$���L�$�lM��A��L�|$L���L��D��1�L��I��f]I��I)�L9�wL����M��D��L�$$L�|$0L�t$8�lL�M��H)�I��I9���kL�t$ L�L$(�WkH9l$ ��L��D��D�L$�D)�D�L$ADž���I�މ�L��D�L$���H��H�t$L��L$�����L�\$D�D$D�L$�]mI�T$���Om�<mH��I���t�A��L�d$��A��L�t$E��L�d$E��L�|$0A��H�l$8�݅�t/�H�T$D��L��)�9�HG�A��A��)��s[H\$1���D��E��L�d$H�T$8L�t$L�|$0I�A��M9��$l��kD��L��D�L$D�D$L�\$�>��D�L$L�D$�߃�A�q�K�K�D�M�ȃ�D�L$��mA����m�l��hZM���xk�kH�\$ E��L���L��L��D��1�I��g[H��H)�H9�wH����E��L�t$(I)�M9��jk�'k����u	H����j��Z[]��m��H����I���Y��L���A��H�����mH�^:!H�5�1�H�:�����nL�A:!H�51�I�8������m�F��H����m��H��dH�%(H�D$1���L�Ǎ~���v��tD�^�A��t��uI��L�$1�A9�vA�4D�4D2D�H����H�D$dH3%(t���H�����1�9�vL��L3�L��H����v7H�R��t.H�R��v%H�R@��vH�R`��vH�����vH������AWI��AVI��AUATI��UD��SAS��u9A��A��D���y�����A��E1���A��I�H�D��AZ[]A\A]A^A_����A�̓�A��A�ȅ�t2�L��L��D��D)�L��9�HF�A��A��)�I�I����E1���X[]A\A]A^A_ËT$��wI����H�T$HH�L�RH1D$�L1T$��|$��nH�zH1|$��ynL�D$HM3���hnH�D$H�t$L�H�xH�XL�pL1T$�H1|$�H1\$�L1t$���w���.nH�H H1L$�� nL�D$HM�H M�X(L1L$�L1\$��|$��mI�h0H1l$���m����mH�\$HL�3L1t$���mL�T$HI�z`I�ZhH1|$ H1\$�|$��mM�rpL1t$��mL�T$HD�t$M���I���M3��L1$M3��H1l$A��wA���gmI���H1T$�VmH�L$HH���H���H1D$H1t$(�|$�.mH���H1|$0�mH�D$HL3��H���L3��H14$H���H���H1|$H���H1T$L���H1\$(L���L1D$0L1\$8�|$��lL3���lL�D$HM�H@M�XHL1L$�L1\$��|$
��lI�hPH1l$��|l��L�ӋL$(L��1�L��M��
L����I��M)�M9�v�L,$L�|$M��I)���AVI��AUI��ATI��I��UL��H��SH��dH�%(H�D$1��m���u?���D��C�.������	�f���tH�t$�H��\$�4�f�����H�|$dH3<%(t���H��[]A\A]A^�H�=i5!H�5bH�?���H�����1��1��H�����H�
M5!H�5NH�9����1��H�T$�IL��4!H�5�I�8���1��\L�
�4!H�5�I�9���1��?����H��L��1�1�H�5��d���QE1�L��7!1�H��H��H��$�R1�jj���H�� H����1��M�ƋL$8L��1�H��M���H���
M��M)�M9�v�L$$L�|$M��M)��i��H�=J����H�+��
�
H��
H�5H��1�����
L�
4!H�5I�9����q
L��3!H�5�I�:���H�|$ ����L
H��3!H�5�H�8�c���1
H����I���H�|$`1��Q������AW�AVAUATUSH���dH�%(H��$�1����@�]I�ҍW�A����?�H@���9E��E���-A��H�\$H��H��A���21�H���fv�M��H�t$PD$E��H�t$pH��$�H��$�A��u)L9�rSD��H��L��H���L�T$�
gL�T$H)�I�L9�r*L��D��1�H��L�T$L)��H���:L�T$M��щ�1�L��H����D0<+E�E�E��yD9�uH��D�D$�D�D$H��B����L9�$ v%L��D��1�H����RH��M���L)�$ �ы�$ 1�L��H���R1���H��$�dH3%(t���H���[]A\A]A^A_�H��H��1�1�H�5��P���YH�+t1��LH��1�����=f.�D��H���dH�%(H�D$1����H�|$�D$�D$�y��H�T$dH3%(uH����O��ff.�@������Q������@+��Hc��9��f�����������ff.����������Hc����fD��H���H��u���ff.�SH��H������H��[���ff.���ATH�;0!UH��SH�_L� ������p��H�����H��H��t:Hǀ�H���H���n��H�{H�u�8�H���H���E��H��[]A\����H�GH�Q;!H9���H�
�9!H9���H�5�7!H9�t\H�=E6!H9�t@L��4!L9�t$L�
�2!H��L9����H�=
H�����H�=
���@H�=
���@H�=
�t���@H�=!
�d���@H�=
�T���@���I����@uP�F�=?wF���u?H��fv��2�A@1�I�P@I�P`I���I���A���Iǀ�ø�f���ATUSH��dH�%(H�D$1�E��t<��I��H�։�A��tE�D��H��H�$���H�$�ލ�H��I1�H�D$dH3%(uH��[]A\����H��H1����R���f�������A��1�9�s"D9�sa9�w	��H��H1���A��D�@N��N1�D�P��N��N1�N��N1�L��L1ǍA9���D�Y��D9�r�����L��L1�L��L1�A�C9�scD���z����H�H1H�NH1OL�FL1GL�NL1OL�V L1W L�^(L1_(H�F0H1G0�H�N8H1O8��w\�HD�X����E��E�SA��J��J1�N��N1�D9������D��D�X��H�D�HN��N1�L��L1�D9�����D����L�F@L1G@L�NHL1OHL�VPL1WPL�^XL1_XH�F`H1G`�H�NhH1OhL�FpL1GpL�NxL1Ox���V����D�P��H�D�H�N��N1�D�X�L��L1�N��N1�D�H�D�P�J��J1ߍH�N��N1�N��N1�D�P�D�XL��L1�N��N1�D9����D���A��D�AN��N1�D�YN��N1�D�AN��N1�D�Y��N��N1�D9��$���D�ٍA�D�I�L��D�Y�L1�D�Q�N��N1�D�AJ��J1�N��N1�D9����D������AWAVI��AUI��ATU��SH��(dH�%(H�D$1���ukA��A��D���#������L��t,������H�|$�H�D$蓼��L�T$O1�H�D$dH3%(��H��([]A\A]A^A_�A�׃�L�D$A��A���LL��L�ǹL��L�L$H�D$�2���L�L$I��H�T$D��)�A��B��M�E1�H��I1����u����D)�9�G�A�ك�u�A�EH�D$��>H�|$�>����|���ff.����AWH��AVAUATUSH��XL�H�wL�o H�_(L�g8H�oH�GL�_0H�W@L�yXL�QhH�HL�qPL�I`H�T$�H�|$�H�QpH�yxL�|$�L�T$�L���L���H�T$�H�|$�L�|$�L�T$�H���H���L���L�t$H�|$�H��L���H�T$�L1�H���L�|$�L1�I��H3|$�L���H�t$ M1�H�l$(H�t$�L1�H�T$�L1�H3l$�H�L$�L1�H1�H3|$�H���H�L$�L�d$@I��L3t$�I��L3t$�H�\$8H1�H�t$�L3t$�I1�L1�H3L$�L�l$0H��H��L1�H�H3t$�M��H3t$�I1�H��H1�I��H1�L��I1�H��H1�L1�M1�M1�I��I��I1�H1�I��M��H��H1�M	�H��L��M��H1�I��H��L��I��L!�H�|$�L��L	�I	�H!�L1�H1�L1�H�l$�M��H�<$H�|$M1�M��L�D$�L�\$�M1�L�L$L1�H�\$HM1�H��I1�H��L��M��I��H��I��I��M��I!�M��I	�L��I��I1�L�L$@L1�I	�L�|$�I1�H��L!�H�T$�L	�L1�L�D$ L�\$�H1�H�|$�M1�H��I��M1�H�D$PH1�H1�H�D$�L�T$I1�H��H�l$M��L��H��H��L1�I��I��H��H�D$�M	�L��H��I1�L!�L�T$�L1�I��L!�H�|$�I	�L��H1�M1�H��H�l$@H1�H!�I��H�l$�H�\$�L1�L�\$�L�D$0L�\$8L�T$�I1�L�L$�M1�I��I��L1�H3D$�L1�H��
M��H��L3L$�I!�I1�M1�I��L�|$0L1�I��H3D$�I	�M1�L�|$�M1�I��L3L$�I��M	�I1�L��M	�L�|$�H3L$�M��L!�L3l$�H��M1�H1�L3t$(H3t$�I��L1�I��H��	L�$H��I��L3d$�M	�H��I��I1�M��H��M!�I��H!�M1�L1�L�D$(L�D$I1�L1�M��M1�M��I!�I��M	�M1�I1�L3D$�M1�L�T$L3T$L1�M1�L3T$�I1�L��H��I1�H1�H��I1�M��H�T$�H1�I��H�M1�L1�H1�L�T$�H��L1�L1�I1�H��I��M1�H��I	�I��L1�M1�H��I��L�d$�I��I��I	�I1�L!�L�d$�I��L1�M!�H�T$�I1�L��L�T$L	�L�t$PL�d$�H1�L�d$�M1�H�|$�H�|$�I1�I��I��I1�L1�L��I��H��H	�H��L1�L!�I1�L1�H�\$�I��L1�H��H�T$�H��H��H��L	�H��H1�L��M!�H	�I1�H�L$�H�T$�L1�L�d$�L�T$H�|$�H�|$H1�M1�H��I��L1�H��H��L��I��I��L!�I	�M	�H1�I1�H!�L�t$�M��H1�M1�I��H�\$�L�T$�I��I!�H�T$ H�T$HM1�L�d$�H�l$�L�|$H1�M1�H��I��L1�M1�I1�H��I��L3D$M��H��L��I��
H3D$@H��I��	L3\$0M!�H	�L��I��L3$L1�M��H��H3t$(H�L$�H	�H��I��I1�I��L1�L�l$�H��L3l$�H!�L	�I!�M��H1�I1�M1�L3l$�H1�H�\$�H�l$�H3\$�I!�L�|$8L1�I��L1�L�d$�H1�H3l$�M	�H�T$�L1�M1�H��M!�I1�L��I��H3\$�H	�M1�L�|$@L�|$�H��L3|$�I1�H�l$�L1�H3l$M��H3l$ I1�L3|$H�T$HL1�L��H3l$�I��M��H1�L1�I�I��H��I1�H��I1�H����H��I1�L1�I��L�d$�I1�H�T$�M1�H1�I��M1�H��M1�L1�I��L1�L1�H��H��H��L	�L1�H1�H��H�t$�L��L!�H��L1�M��I!�H	�M	�H�\$�H�\$�H1�H�T$�I1�H�L$M1�H1�H�t$�L1�L1�H��L�d$H��H��L�4$H��I��I��M1�I!�H��I	�I��I1�H��I1�L�d$�I��H�t$�I	�L�D$�M��L�d$�L1�I1�H��H!�H��H1�H	�H�D$L�t$H1�H�|$�M1�H�\$0H1�H�T$(I��H��L1�I��L	�L��I��H��H��M��L	�I!�H1�L!�M1�L�d$�L1�H�L$�L�D$�I��H1�H�L$HH��I��M1�H�\$�M!�H��L�T$�H�t$H�D$�H�D$�M1�I��M1�H1�L1�I��L1�H��H��
H��L��H��H��I��H��L	�I!�H	�H1�M1�H1�L�t$�L�t$�L3t$�L3t$�H�|$�L��I	�H!�L3|$ L3\$8I1�I1�I��L3l$�L�d$�L�d$�I1�I��I��L3L$@I��H�\$�I1�L��I��L��L��H��	H��H��L!�L	�L	�H3\$�H1�H��H�$H3L$(H��L1�I��I!�H�l$8I1�L��L1�L!�M1�L��L�l$0I1�H�l$L1�H�t$@I1�H�t$L3d$�I1�L1�H3l$�H3l$�M��L1�H3\$�L1�L��M��I��H3t$H1�I��H3\$�H3t$�I��H�I1�I1�I1�H��H�\$�H��H�M1�H1�L1�L1�L�\$�I��L1�H����I1�H1�I��M1�H��I��M��M	�I1�I1�L��H��L�L$�L	�I��L��H!�M1�L1�I��L!�L�\$�H�l$�H��H�\$0I	�H1�H�<$M1�M1�H1�I��L�L$�H��H1�M��L�D$�I��H��H��M1�M	�L1�I��I1�I!�H��L�T$�M��M��I��I1�I	�L�D$�L�L$M1�I��H!�H�l$0M	�L�$I��L�D$�I1�H��H�l$�M1�L�T$HL1�M1�L�T$�H1�I��M1�L�\$ H��I1�L��I�H��L��M��L�T$@H	�H��I��I	�L1�I!�H�|$�H��M1�L1�H��L�\$�L�\$�H!�H1�M!�H��H�l$�I1�H��M1�H�D$�H�\$�L1�H�\$�L1�L�D$PI��H��
I1�L�D$L1�M��I��H��I!�H3D$�I��I1�I	�L3t$�I��M1�I��M1�L�|$L�L$@L1�L�L$�L3L$�H3D$�M1�I��L3L$�I��M	�I1�L��M	�M1�L!�L�|$�H1�L1�H3t$(H3L$H��L3l$�H��	M��I��I��L3d$8H��M	�I��M��H��I1�M!�H!�H��I��L1�M��L1�M1�L�\$(L�\$�M	�L�$I!�M1�L�T$�I1�L3T$ M1�H1�M1�M��L1�M1�I1�L3D$�L3T$�I��L��I1�I1�H��M��H1�H��I��I1�H�T$�H�M1�L1�L�T$�L1�H1�L1�H��I1�H��H��M1�I��I��I	�M1�I��L�d$�I��I��I	�I1�L!�L�d$�I��L1�M!�H�T$�I1�L��L�T$�L	�L�d$�L�d$�H1�L�t$M1�H�|$�H�|$HM1�I��H1�H��I��I1�L1�I��L��H��H��L!�L	�I1�L1�I��H1�L1�H��H�T$�H��H��H�\$�H��L	�H��L1�M��I!�H�<$I1�I	�H�L$�H�T$�M1�L�t$�L1�L�T$H1�L�d$M1�H��H��H��M��H��I��H��I��L	�L��I	�H1�L!�H�\$�L��H1�H��H�|$�H!�L1�M1�H!�L�T$0H1�I��L�d$�M1�L�<$I��I1�H�T$H�T$�M1�I��H�l$�I��L3D$ H1�M��H3D$PH�|$�H��
L1�H3|$�I��	H��I��I!�L3L$�H��I	�M1�I��H��M1�H��L�|$8L	�L1�H3|$�H1�H�L$�L��M	�L�d$�L!�M1�L�l$�H1�L3\$@L3l$�L�T$�I��H3t$(M1�I��H��M	�M��L��H!�M1�H�l$�I��I!�I��H1�M!�L1�L�|$@H1�M��H3l$�I	�M1�I1�H1�M1�H�T$�I��I1�H3T$H�l$�H��H3l$H3l$L1�M��H3l$�L3l$�I�L�|$HH3$L1�M1�H1�I1�I��M1�I��H��H��M��H��A��I1�H�T$�H1�L1�H1�L�d$�H1�M1�H��L1�H��H��M1�I��H��H	�L1�L1�I��H�t$�M!�H��I1�H��L��I!�H	�L	�L�l$�M1�H1�H1�H�t$�H�\$�H�L$L�l$�H�T$�L�d$ L1�I1�H��I��H��L1�M1�H��H1�I��I��H��I��I	�M1�M!�H��M1�I��I1�H��L�D$�L�d$�I��H�4$M	�L��L�d$�H1�H1�L��I!�H��I1�I1�I��H	�L�l$0L�l$�L��L1�H��H�D$�H�L$M1�H��H�T$(M��L1�H	�I��H�I��H�L$HM!�H��I1�I1�L�t$�L�t$�L�D$�M��I��M!�I1�L	�H!�H�\$�I1�H�T$�L1�L�T$�L��L1�H�$H1�H��H1�H��
M1�H�t$�H�t$�H��I��I��H��H3l$L3t$�L1�I��L3t$�H3|$�H��I	�H��H��I1�H!�L�l$�I��L1�I��	H�D$�H��L��I	�H	�H!�I1�H1�H1�L�T$�L��I1�L3|$L3L$8H��I��I��L3\$@H��M��I��L!�L�T$�M	�H1�L3T$�L3T$�L��L�d$I1�L3T$�L1�H��H��M1�L!�H��L	�I1�H�l$8L��H��L!�L1�I1�H�|$0I1�H�l$�I��H�L$�H3L$(L�L$@L1�M��L1�I��H�t$ H3l$�I1�L1�M1�L�L$�H1�H34$H�|$�M1�H3t$�I��I��I1�H��L��I��H1�H�l$�H�M1�I1�I��L1�L1�M1�L��H1�H��I��L1�I�����I��H��I1�M	�I��I1�M1�I��L�T$�M��M!�I��M1�I��I	�M	�L�L$�I1�H!�H�|$�I1�L�T$�I��H�l$�M1�H1�L�\$0L�D$�H��M1�L1�L1�I��I1�H��L�T$0M��M��H��L1�I��I��I��H��I	�L��I!�I1�H	�H��M1�H1�L	�L!�L�D$�L1�H1�H�T$�L��L�\$H1�H�|$HH�l$H�l$�L�|$H�D$�L�T$�L1�L�\$�H1�M1�H��I��I��I1�H��I��L��I��L	�M��H1�M!�L!�H	�H1�H�|$�L��M1�H�l$PH1�H��H�l$�H!�H�\$�L�D$�M1�L�D$ L1�I��L1�H��
L1�M��I1�I1�H��I��I!�I��I	�H�D$�I��M1�H3D$�M1�L�T$�L�|$�L�T$@L1�L�|$�L3|$�L�L$ L�L$�I1�H3D$�I��M1�I��L3L$�I��M	�I1�L��L!�L�|$H1�H3$M	�L3l$�M1�H��H3t$(H��I��L�D$@L1�I��M	�H��	L3d$8L3t$�I��M��H��M��I1�M!�H��I��M��H!�L1�L�D$�I��L1�M1�L�T$(L�T$I1�H1�M��M1�I1�M1�M��M	�M1�L�l$�L3l$M1�L3l$�L�D$�I1�I!�L��I��M1�H��M��H1�L1�I��I1�M1�I1�H��I��L1�L1�L�T$�H�H��H1�L1�M��M1�H��I1�I	�M1�M��I�	��M1�I��L�l$�I��I��M��I	�M��M1�M!�L�l$�I��M!�M��L�l$�I1�L��L	�L�t$�L�t$�H1�M1�L1�L�d$�H�|$�H�|$HI1�M1�H��I��L�D$�M��H1�I��I��I1�H��M��I��I��H��M!�M	�L1�L	�I1�M1�M��L1�I!�L�T$�L�T$�I1�H�|$�L�l$�I	�L�$$L�d$I1�M1�M��L�T$@H1�H��I��M1�H��H�\$�I��M��I1�L�t$�L��M��L��L�t$�L	�I��H1�L!�I1�H�L$�L��L1�H��I1�H!�L1�I��L!�L�d$�I	�H1�H�l$M1�L�D$�M1�H�|$M��I��M��L1�I��I1�M��H��L�T$�L�T$0I��
I��M!�L��I1�H	�I��L1�M1�I1�L�|$�I��I��H�\$8L3t$�M	�L��L�|$�L1�L�D$(H�\$�L��M	�L!�M1�H1�L3L$�H3D$PI1�H��L3\$ I��H��I��H��H3T$I��L	�H��	L�T$L�T$�H��I��L��M��H1�M!�I��L3T$�I��I!�L��L1�I��L	�I1�L3|$�L1�L�l$@L�l$�I1�I1�L�t$�L3t$�M1�M1�L3T$�M1�L3T$�L3t$�L�|$I!�M1�I1�H�T$�M1�H3$I1�L��L��L3|$H��H��I��M1�L1�I��H1�L��L�T$�I�H1�M1�I��L1�I1�M1�L�l$�H��I��L1�I1�H��M��M1�I��I	�M1�A���L�t$�I��I��I	�M1�L�t$�I��M!�I1�L��L	�L�t$�H1�M!�H�\$�H1�M1�H�L$H�$H��L�l$ L�T$�H1�L1�H��H1�H��M1�M1�I��M��I��I��I��I��M��I	�L��M	�M1�H!�I1�I��L1�L�$L!�L�T$�L�l$�L�L$�H1�I	�L�L$M1�H�\$0I1�H�\$�I1�H�L$�L��I��I1�H��L�t$(H1�M��L��L�L$�H��I��H��I��H	�I��L!�H1�L!�M	�I1�H�D$�L��L1�L1�H��H�\$H�\$8M1�L!�I��L�d$�M1�H1�H�L$�H�|$�H1�I��L��H��
I1�L1�I��L�t$�H��I��I��L	�I��I��H1�M	�M��M1�H��H�|$�I!�L��M1�L!�L�t$�L�t$�I1�L3t$�L3t$�I��M1�M	�L�l$�H3l$H��L3D$�M1�H1�M1�H3T$@I��H��I��	L�d$�L	�I��M��I��L1�L��I��H��L!�L�\$�I!�L3\$�H��L3\$�I1�H1�I1�M1�L3\$�H�t$@H�$H�t$ H�L$8H1�H3T$�H1�H��L	�H1�I1�H�L$H3L$(L1�L1�H3L$�L!�L�l$0L1�I��H��H�I��I1�M1�I��L1�M��I1�L��L�\$�H3t$I��H3t$�H1�L1�M1�I1�H�\$�H��I��H1�H��H1�L��L1�I1�H��H	�I��H1ڀ�H�T$�H��H��L	�L1�H�T$�L��H!�H1�I!�M1�L1�H�T$�I��H��H��H	�H�\$H��L1�M��H1�H�D$�H�D$0I1�H��H�|$�L�L$H1�H��L1�H��H��H	�I��H��I1�L!�L�\$�I��H��I1�H��L�\$�I��M	�L��L�\$�H1�H��H!�H	�H�T$�L��L�L$�L1�I��I1�H�l$�I1�H�|$L�T$0L1�L�$I��L1�L��L��M1�H��I��I1�M1�I1�I��L��I��L!�L	�I��I��L��H1�H��M1�H�D$�L!�L�L$�H1�H��L!�L	�L1�I1�H1�I��L�\$�H�l$HL�\$�H�l$�L�L$ M1�H�\$8I��L1�I1�H��
L��L1�I��H!�H��I��I��I	�H�D$�H3D$�M1�M1�L�T$ L1�L�T$�H3D$�L3T$�L�|$�M1�I��H3L$L3l$�H��I��H3t$(I��M	�H��	L3d$@L3T$�I1�L��M	�I��M1�L!�I��L3t$�M	�H1�H��L�L$8I1�H��L1�L�L$�I��H!�I��L�|$(M1�L�D$@M��L1�M!�H1�H��M��L1�L�D$�I1�M1�L�D$�I1�M1�M��M	�I!�L��I��M1�L�l$�L3l$M1�M1�L3l$�H��L1�I1�H1�I1�H��M��I1�L1�H�I��L�L$�I��L1�M1�M��I1�H1�L1�M1�M��A�	��H��H��I	�I��M1�M1�L�l$�I��I��M��I	�M��I��M1�M!�M!�L1�I1�L��M1�L�l$�L	�L�t$�H��H1�L�D$�H�|$�L�L$�H�|$�L�l$�H�\$0I1�L1�I1�I��H��H1�I��H��I��M!�I��I	�M��I��M1�I��I1�L�d$�M��L�D$8M	�I1�L��I!�H�\$�H	�L�d$�L�d$�I1�L1�H1�L�$H�|$�H�|$�I1�I��I��L1�H��I��I1�L1�M��M��H��H��I��L��L	�L�D$�L!�L1�H1�H�L$�M1�H�L$H�\$�L��I��H��H1�H!�H��L1�M��I!�I1�I	�H�l$(L�t$(L�d$L�d$�M1�I��L1�L�L$�I1�L�l$�M��M��I��
H��I1�M1�M!�L��I��M��I1�H	�L�|$�I��L1�I��I1�L3t$�M	�H3T$L3T$�H��	M��H3D$HI��M1�I��L3\$ H3t$@L�L$�I��L	�I��L1�H�T$�H��M!�H�L$H3T$�I1�I��H�L$�I��H��I!�L��M1�I��H1�H��H3L$�L	�L1�I��H��M1�H!�M��M��L�t$�H1�I��L��M1�L�l$@I1�L�l$�L3t$�H	�I1�I��H�T$�M1�I1�H�l$�M!�H3l$�M��H3$L�D$HL1�I��H3l$�M��I1�L1�H�I1�H3T$I��H3T$M��H��H��H�L$(L1�H��I��L1�A�
�I1�I1�L1�H��L1�H��L�l$�L1�H��H��I1�I1�I��M1�H	�I��L1�L1�L1�L1�H�t$�H��H��H��H��I��M	�L��M��M!�H1�I1�L��I!�H�L$�L	�H�t$�M1�L1�L�$L1�L�t$H�\$ L�t$�I1�L�l$(L��I��I1�I��H��L��I��I��H!�M	�H1�M��H�t$�H��M1�H��L�l$�I��H�t$�I	�L��L�l$�L1�L1�M��I!�I	�I1�M1�H�$I1�L�t$8I��L�L$0L�D$�M��H�\$I�I��M1�I1�L��I��M��I��H1�M	�H�t$�L	�H��L��H�\$�H��L1�M!�L1�H�D$�M1�H!�H��L1�L�L$H��L�L$�H��L!�L�d$�H��H�L$�H�L$HL1�M1�H��
L1�I��I1�H1�I��H�|$�L1�I��I!�I��I��L��I��M1�M	�H��L�t$�I1�L�t$�L3t$�L3t$�L	�H1�H3l$L3T$�M1�H�|$�L��I	�I��L!�M1�L�l$�L3|$@H��I��L�d$�I1�I1�H��L��L�$$I��	L!�L	�L3\$�L��L1�I��I1�H��H��H�|$�H3|$�H!�H1�H�T$H3|$�L1�I1�H�t$@L��L1�H3T$�H1�H�L$ H3|$�I��H1�H3L$0L	�M!�L1�I��L1�M1�I��M��H�t$HH1�L�\$8I1�H3L$�H�t$(I��I��H�M1�I1�H��H�|$�L1�H3t$H3t$�H�L1�I1�L1�H��L1�H1�H��H�T$�I1�H��I1�I��I��L1�I��I	�A����I1�M1�L1�I��M1�H��L�T$�I��I��M��M	�M��M��I1�M!�H!�I1�L1�L�T$�I��L�\$�I��H�|$�M	�L��L�T$8L1�L1�L�L$ L�\$ H��I1�H�D$�H��I��I1�L!�M��I��L1�I	�H�T$�H��M1�H��L�|$�L�|$�H��L��L�$L	�H1�L��M!�I1�H	�H�l$�H�D$�L1�L�L$8L1�L�L$�L1�M1�I1�L1�I��I��I1�H�|$H��M��I��M��M	�H��M!�H��I1�L!�M1�L�\$�H1�H	�L��L�D$�H�l$PH1�H�l$�I1�M1�H��L�D$(I��I��H!�L1�H�\$�H��
L1�L�|$�L��L�L$�L�T$HH!�I1�L1�I��I��I��H��I1�H�D$�I��M1�H3D$�I	�M1�L�L$(L1�L�L$�L3L$�H3L$L�<$M1�I��H3t$0H��I��L3l$�H��	L3t$I��M	�L3d$@I��I1�L��M	�H3D$�M1�L!�L3L$�I��L�D$HL1�I��H1�M	�H��L�|$0H��M��H��M��H!�I1�L1�I��H1�M1�L�T$@M!�L�T$�L1�M��L�D$�I��I1�L3T$�I1�M1�M��I!�M	�L��M1�M1�L�l$�L3l$H��M1�L3l$�H1�L1�I1�I1�I1�H��I��M��L1�H�I��L�T$�L1�H1�M1�M��M��H��I���L1�M1�H��I1�L1�I��I	�H��M1�M1�L�l$�I��I��M��I	�M��I��M!�M1�M!�I1�L��M1�L�T$�L	�L�t$�L�t$8H1�H�\$�L�D$�I1�H�|$�I1�I��L�l$�L�,$L1�I��H��M��I1�H��I	�I��M1�L!�L�d$�L1�H�|$�H��H��I��H�|$�M	�M��L�d$�I1�L��M!�H	�L�D$�L�D$�L1�I1�H�L$�L1�L�T$L�T$HI1�L1�H1�I��H�$M1�I��H��I1�H��H��I��L��L��H��I��I��M	�H!�M��M1�H1�L�t$�I��I��H�\$�I!�M1�M��I!�H�L$ I	�I1�H�l$0L1�L�d$�L�l$M��L1�I1�H1�H��H��I1�M��H��I��
H��I��H�|$�M!�H��H�|$�I1�L	�H3T$H3D$PL1�L�T$�M��H��H�\$�H��L	�L3\$(L1�L!�I��I	�I��	I��M1�H�L$ M��H�L$�I��L3L$�H3t$@H�T$�M	�I��H3T$�H��M1�I!�H3|$�I��H1�L��M1�L1�I��H3|$�H!�H3L$�L�l$�L1�L1�H1�H1�L�D$@I1�L�D$�L3l$�L��M1�H	�H�l$�H3,$M1�M!�H��M��I��H�T$�H3T$M1�M��H3T$H3T$ L1�H3l$�I��L�D$HI��I1�M��H�I1�I1�I��H��L��H�L$�L1�I�H��I1�H��L1�H1�L1�L1�L�l$�H��I1�I��H����I��H��M1�I1�L	�I��I1�M1�I��L1�H1�I��H1�L��H��H�t$�L��L!�H��L1�L	�H�\$�H1�H�t$�L��I!�H�L$M1�L	�L�D$�L�l$(L�l$�H1�I��H��M1�I1�H��M1�I��L�t$L��I��H��I	�I��L��M!�L1�I1�H�t$�H��H��L�t$�I��H�t$ M	�M��I1�L��H	�L�l$L1�I!�L�T$�H1�I1�H�D$�H��M1�I1�L�D$8L�D$�I��I��H1�H�L$0H��L��M1�H!�H��I�L	�I��L��L1�I1�L	�I!�H�\$�M��H�\$�L�\$�I��H1�H�L$�I��M1�L1�H�D$HM!�L1�L�d$�L�l$ M1�L�T$�I��H��I��H��
I1�H��I1�H1�M��H�t$�I��I��L�t$�H�\$�H��L��I!�H3l$M1�H��H��L3L$�L�D$�H	�I��I��H1�M	�H3|$�L3t$�M1�H�t$�L��M	�L�,$H!�I1�L3t$�H��L3|$@M1�I1�I1�H��H3\$�H3\$�I��	L	�I��L�d$�L��L1�L�d$H��H��H��I��H!�H�T$H1�H1�H3\$�I1�L��L!�L	�M1�L!�H1�H�T$�H��H�L$H3L$0L1�I1�H�|$8L1�I��H3T$�L�L$�M1�H�t$@H1�L1�I1�H�t$(M��M1�I��I��H1�H3t$ H3t$�I��I1�L��H��I1�H�H1�H��H�T$�I1�H��H�\$�L1�L1�I���L1�H��M1�I1�I��H��I��I1�L	�I��L1�M1�H��H1�I��L1�H�|$�L��H��I��M	�L��M��M!�H1�M1�H�|$�H�|$�L�L$�I��H!�M	�L1�M��L�L$H��M1�I��H�\$8L�\$�I1�M1�H1�I��L�T$8I��H��I��L!�L��L1�H	�H�\$�I��H��M1�H��L�|$�I��L��L�T$@M	�I1�L��M!�L�\$H	�L�<$L1�L1�M��L�L$�M1�I��I1�H�l$�H��L�D$HL1�L�D$�I1�I��L1�L��H�|$I1�H��L	�L��M��H1�L�D$(I��H�\$�H��L!�L!�H1�H	�I1�L1�L�\$�H�l$PH1�H�|$�H�l$�L��I��M1�H��I1�H�\$�I��H!�L1�I��L1�H��
M��L�|$�I!�L1�H�D$�H3D$�M1�H��L�|$�I1�L�L$(L1�I��L3|$�I	�I��H3t$0H3L$ H��	M1�L3l$�H��L�L$�L�L$�I��L3t$�L3d$I��M1�I��H3D$�I��L3L$�I��M	�I1�L��M	�L!�M1�L�|$ H1�H��L�D$@L1�H��I��H��H!�M	�M��M��L1�I1�M!�H1�M��L1�L�D$�I��M1�L�T$0L�$I1�M��M1�I��L�D$�I1�M1�M��I!�M	�M1�L��M1�L�l$�L3l$L1�M1�L3l$�I1�H��I1�L1�H��L�T$�M��H1�H�I��L1�M1�M1�I1�M��H1�I��L1�H��I1�H��M��I��L1�I	�H��I���M1�M1�L�l$�I��I��M��I	�M��I��M1�M!�M!�M1�I1�L��L�T$�L�D$�L�D$HL	�L�t$�L�t$�H1�I1�I1�L�l$�L�l$�I��I��M1�H�|$�H��I��L��I1�H��L	�I��M��L1�M!�H�\$�H��M1�H�<$L	�L�d$�L1�I��H�\$�L1�H��M1�M��M!�I1�L�d$�I	�L�d$�L�T$L�T$@M1�H1�I1�L�t$�I��I1�I��L��I��I��L��M��H�H��M��M	�I!�I1�H��M1�H��L�D$�L�d$�I��L!�H!�I	�H1�L�t$�L1�L1�L�d$�H�L$H�L$8H�l$ I��I1�M1�I��H�|$�I��H1�L�,$M��H��M��I��
L1�H��I1�M!�H3T$I1�M��I��M��I��L�T$�I��I��L	�M	�M!�I	�L1�I��M1�H3D$PI��	L3L$�H��I1�M��L3\$(H�L$ H��H�L$�I��I��M1�H3|$�I��I!�I��H3t$0H�T$�M1�L1�H3T$�H��H3|$�L�l$�H1�H3L$�L	�L��L1�H!�L1�H��H1�L��M!�H1�H�l$@H�l$�H	�L�l$�I��I1�H�T$�H1�H3l$�M1�H3T$H1�L�t$HH3T$I��I1�H�l$�H3l$�I��L1�M��H3,$H3T$ I��I��L1�I1�M1�H�I1�L��H��H�L$�H��H��L1�L�l$�H1�L1�L1�I1�H��H1�M1�I��H��H��I1�M1�I��H	�H1�I��L1�H��I���L1�M��H�t$�H��M!�H��I1�L	�L�t$�L�t$�H1�H�t$�L��I!�H�L$�L	�M1�I1�H��L1�L�l$(I��L1�L�T$H��H�\$H��I1�L��I��H��I��I��M��M	�M1�M!�M1�I1�L�L$�I��L�l$�I��H�t$ M	�L��L�l$�H1�L1�M��I!�I1�I	�M1�H�L$M1�L�t$8L�$M��L�t$�I�L�T$0I��I1�I��I1�L��I��H��L��H��H	�L!�L1�L1�H�D$�L��H��H�\$�L!�H1�L��M!�L	�M1�I1�M��I��L�$L�d$�L�T$�H�t$�L�L$ L�L$�I1�H�L$HM1�I��I��I1�L1�H1�I��H��I��M��M��I��
L3|$@L��I��M!�L��I��I	�M1�M	�H3l$M1�L�l$�I1�H3|$�L�d$�M��H��L	�I1�L3\$�L�t$�L1�I��	I��H!�L�t$�M��L3t$�H��H��I��L3t$�I1�L�T$�I!�I1�L�D$�M��I1�L3T$�L	�M!�H��H�T$L1�I��L1�M	�I��L!�H��H�t$�H1�M1�H��L�$L�l$8L1�I1�H�L$H1�H�L$H3t$�H3L$0I1�H��H��L3T$�L1�H1�M1�L3T$�L1�I��I1�H�t$(I��L��M1�L1�M��H3t$ H3t$�I��H�I1�H��I1�H1�I��H�T$�L1�L��H��I1�L1�L1�L�\$�L1�I��H1�L1�H��M1�H��I��M��I	�I1�I��
�L�T$�I��I��M	�M1�I!�L�T$�M��I1�I!�I1�H��H	�H�|$�L�T$�L1�L�T$H�D$�H�D$8L1�H��I1�L�\$8H1�I��H��H��M1�I��I��I	�L��I��L1�I!�H�T$�H��I1�H��L�L$�L�L$H	�H1�L��I!�M1�H	�I��H�T$�L��H1�L��L�T$�L�\$�H1�H�,$H�|$L��I1�H�\$@H1�M1�H1�I��H��H��L��H	�H��H��H��H!�L1�I��H��H�D$�H�D$�H��M1�L!�L�T$�H1�L��M!�L�L$(L	�M1�H1�L�\$HL1�L�\$�H��H�\$�I1�H3D$�H�,$H�l$�M1�I��I��L1�I1�H��L1�M��I��H��
I!�I��M1�I	�M1�L�T$(L1�L�T$�H3D$�L3T$�L�|$�M1�I��L3t$�H3t$0H��	I��L3T$�I��M	�I1�L��M	�M1�L!�H1�L1�H3L$ L3l$�H��I��L�L$PH��I��L3d$H��L�|$ M	�I��H!�H��M��M��L1�I1�M!�H1�M��L1�L�L$�L�D$�I��L�\$0M1�L�\$�I1�M1�M��I1�I��M1�M��I!�M	�L��M1�M1�L�l$�L3l$H��M1�L3,$H1�L1�I1�I1�M��I��M1�I1�H��I��L1�L1�L�L$�H�H��H1�L1�M��M1�H��I1�I	�M1�M��I�
��M1�I��L�l$�I��I��M��I	�M��I��M1�M!�M!�M1�I1�L��L�l$�L�D$�L�D$@L	�H1�L�l$�L�L$�L�t$�I1�H�|$�H�|$�M��M1�I1�I��I��H1�L��I��H��L	�L1�L1�H��L1�H��H�\$�L��H!�I��H��M1�H��L�d$�I��I	�M��M1�M��M!�I	�I1�L�D$�I1�L�L$L�l$�L�d$�H�|$�H�$I1�L1�H1�M��I��I��H�|$PI��I��I��L��M��H1�H	�M	�H��M1�M!�L�L$�M��I!�L��L�L$8L1�H�L$�H��H1�H�\$�H��H��H!�H�<$H�|$�L1�I1�H�l$ M��L�t$L�t$�I1�L1�L1�I��I1�H3|$�H��I1�H��L3T$�I��I��
I��H3T$I��I��M��M!�M	�I	�M1�H3D$HM1�I1�L3\$(H��	L�d$�M��I	�I��M!�M1�I��L1�H��H3|$�I1�M��H3t$0L�L$�I��H��H��L�t$�I��L	�L3t$�I!�L�|$8I!�M1�L�|$�L1�L��H1�L�l$�H	�M1�I1�L3|$�L1�H��I1�I!�L3t$�H1�M1�I1�H�l$@L�\$�L3\$�H�\$HL��M1�L�|$�L3|$I1�L��L3|$L3|$�I��H��M1�I��L3$I��M1�M1�L1�I��L��H��L��I��I�����L1�L�\$�H1�M1�H1�L�l$�M1�H1�H��I1�I��I��M1�H��L��H	�L1�L1�H�t$�H��H��I��L��H!�M	�H1�L��M!�M1�I1�L�\$�H�t$�H	�H�t$H�\$�L1�L�t$�M1�H�L$L1�H1�L�l$ H��H��I��I1�H1�I��I��M��H��I��M!�I	�M	�M1�I1�M1�I1�H!�L�t$�I��H1�I��I��L�l$(L�l$�M	�L�$H�\$0L��I1�L�d$�L�d$�L1�M1�L�\$�M��H�L$H�L$�I��I1�L��H1�I��H��L��L�D$�H��H��H��H	�L!�H1�L1�H�D$�H��H�\$�L��L	�H��L!�H1�I1�L!�I1�L1�L�L$�L�t$�I1�I��
H�4$I��I��M1�L�\$�I1�L�l$HI��I��H�L$�L��L��M1�L	�L�\$�L!�I��L3\$�L1�L1�H3|$�L3|$�L1�H�t$�L��H3l$H1�I��	H��H��L	�H��M��L1�I��H�t$�L��M	�M��L!�M1�I��L�l$�I1�L3T$8H3T$@I!�I��H��L�d$�I1�L��M	�I��L3l$�H!�M1�L3l$�H1�H�t$I��M1�L1�L�D$8I��L!�H1�H3t$�H3t$�I	�I��H�t$H3t$(M1�I��H1�H�|$0L�D$@M1�I1�I��L3l$�M1�L�D$ H1�L3d$�M��I��L��I1�L3$L3D$�M1�I��H��M1�I��H1�L��L�l$�I�L1�L�d$�H1�M1�H��M1�M1�H1�I��M1�H��I����I��L��H	�L1�L1�I��I��H�|$�M	�L��M��L1�I!�M!�I1�I1�H�|$�L��L�|$�H	�M��L�|$0L�d$H��H�|$�L�l$0I1�L1�M1�H�\$�I��I��L1�H1�H��L��H��L1�H��H��H��M1�H	�I��H��I��L1�I!�H	�H�T$�H�T$�M1�H1�L�t$�L��L�t$�M!�L1�L�|$H�|$H	�H��I1�I1�H1�H��I1�H�D$�I��I��L��H��L�d$HL1�L!�M��L1�I	�L1�H�H�\$H�T$�L��L��L�l$�H1�H��L�d$@L!�H�\$�H��L!�L1�L	�L�L$�H1�I1�M1�H�\$ H�|$�I��M1�H�D$PH1�I��
H1�H1�L��H��H��L!�I��M��H1�L�t$�L�t$�I	�L3t$�H�D$ M1�M1�I1�H�D$�H3D$�L�|$�L1�I��I��I��H3D$�L3t$�M	�M1�I��L	�M!�L1�L1�I��H�\$H3L$�H1�H��H34$L3D$(H��L�|$(H��L3\$�M��L3T$8I��I��I��	L�L$�M	�I��L��M1�H��I��H!�M1�L�D$8H1�M��M��I1�M!�I1�H��L!�L	�M1�L3L$L1�L1�L�\$�L3\$I1�I1�L3\$�L��M��I1�L1�H1�H�t$@I�L��I��M��H��I1�H��A��I��I1�H��H�l$�M1�I��L1�H1�L1�M1�H��L�t$�I��H1�L1�I��M1�H��L��H��H	�H��H��L1�H��L1�H	�H�l$�H��L1�M!�H!�H�D$�H1�L��L�t$�H	�H�l$�H�l$HH1�L��I1�H1�H�L$�I��L1�H��H�T$�M1�L1�L1�I��H�|$�H�|$�I��H��H��H��L1�I	�H��M��M1�L�T$�I��I!�M��M��I��I1�L��H	�H��H�D$H1�L��I!�M1�L	�L1�L�d$L�t$�L�t$�H1�H��H�|$�M1�H��H�T$�I1�I��H�L$�M��L1�L��I��H��H��L	�H��L��H1�H�l$�L��L!�L�\$H1�H!�L1�I��H!�H�D$�I	�H�L$�H�L$(H1�M��H�\$�L1�L�T$@M1�L1�H��H�|$M��L�t$0H��L1�H��
I1�H��I��M1�I��H!�I��I��I��L�$$I��L1�M	�I	�H�l$(H�|$�I1�L��I	�I1�L�\$�H�D$H1�L�\$PL��L!�L3D$�L1�L�T$ I��L1�H1�H3T$�H1�M1�I��M1�H��	H�t$8I��L��H��M��L	�L1�H��L�l$�I��H��L��L!�I1�H!�I	�L1�M��I1�L�t$�M1�I��L3l$�L!�L3l$�L1�L�L$L�L$�H��L3l$�L�D$�H1�M1�L3L$�L3L$�I1�M1�L�L$�L3L$�L3D$�M1�L3$L��H�|$I1�M��L1�I�I��I�L1�H1�M��I�H1�H��I1�M1�H��L�T$L1�L1�L�t$�L1�I1�L�l$�H��H1�I��I1�H�D$�I1�I��L��M1�L�T$�L�l$�H��L	�I��L1�L�l$�L�T$�I1�M1�I��L�l$�M��I��L�l$�L�l$�M1�I��I1�L1�L1�I��H��L�\$�L�\$�H��H�\$�H�\$�I1�H�l$ M��L�\$�L1�L3L$I��H��H�\$�I��L�T$L�$I1�H��I��H�l$�H�l$(H1�I1�L�\$�L�\$�H��I��H3T$�H1�H3t$L�$M��M1�L3D$�I��I1�H3|$�H��
I����I��H��H��	I��H��I1�H�D$�L�8M��I��I	�L3|$�L�xL�|$�H�D$�I!�M1�L�|$�M�wL�t$�I	�H#D$�L1�L�t$�I�OH��H�D$�H1�L��I�G L�|$�L��L	�L1�H�A(L��L!�L1�H�A0H�D$�H��L	�I1�L��M!�L�t$�L�i8L�l$�L	�M1�L�,$I1�L�yHL�|$L�a@M��L��M	�M1�L�aPL�d$ L!�L1�H�AXL��H��H#D$�L1�L�l$�H�A`L��M!�M��L	�M1�I��I!�L1�L�d$�I��L�ypH��H�AhH��M1�H	�L�qxL1�M	�M	�L1�H���H���L��L!�M1�I��L���H1�M��I��H��I!�M!�H���L��M1�I1�L���L	�I��H!�I	�H1�H1�L���H��M1�H���H���L���H��X[]A\A]A^A_�ff.�f���USH�������@���6v��������Pv�����H����@04@���v����H�����H�� H���H����[]����H��I�эV�dH�%(H�D$1���H�<ǃ�v>��t9D�V�A��t/��t*��H�<$D��L��H�4�r��H�D$dH3%(u
H���H������q��ff.�@��SH���H����H���hr����vH�P��t	H�P��w[É�H��[�dr��@��AWAVAUI��ATUH��S��H��dH�%(H�D$1�����A��A��H��H��A��A��L����q����vH�U��vH�U��GvD��H����q��D��A�W���L�I�L�����A����A�w��tzA��ttH�$H���H���H�D$dH3%(uQH��[]A\A]A^A_�A�׉�A�A������t�E��H��D��L��A)�A9�LG�A��E��D)�L��1���1����hp��H���AWAVAUI��ATUSH��8H���dH�%(H��$(1�H�����AoE�AoM �AoU0�Ao]@�AoeP�Aom`)D$`�Aoup)L$p�Ao���Eo���Eo��)�$��Eo���Eo��)�$��Eo��)�$��Eo��)�$�)�$�)�$�D)�$�D)�$�D)�$D)�$D)�$ D)�$0H����D��$(��$8A�����	�����$0�������D��$,H�\$`A��B0���u���B��H��育��D��$4D��$(H�H��$,A��A��E��L�L$E��uKL��$@L�T$A���H�|$���n��H��$(dH3%(��H��8[]A\A]A^A_ÐL��$@L�l$8H�L$X1�L�d$H�\$(D�|$4I��L�l$��$,I)�D9�����D��)���L9������\$4)�A��L��s�����A��H�t$(L���A��H��D�D$ H�D$�n����L�D$�|$ vI�T$��vI�T$��G������ى�D�_�M��H�D�`A�������wD�W�A���i���`H�D$X���������tp��t\��tI��t5��t!��tA�4A�4��ƒ�A�<A�<A�Ã�G�G�A����C�4C�4�ƒ�A�<A�<A�Ã�G�G�A����C�4C�49�sk��D�XD�HA�<G�C�4A�<�PG�D�XA�<G�C�4D�HA�<�PC�4G�D�XA�<��G�C�4A�<G�9�r�M��$,H9l$����L�l$8���ff.���k�����fD1��	m���������I������H��L��L��H�D$X�M��$,H;l$�����L�l$8�H�����k�����������AWAVAUATUH��H��SH��XdH�%(H��$H1�H�t$P�k������H�\$PH������H����2l��I��H�������H���H����oE�oM �oU0�o]@�oeP�om`)D$`�oup)L$p�o���Do���Do��)�$��Do���Do��)�$��Do��)�$��Do��)�$�)�$�)�$�D)�$�D)�$�D)�$D)�$D)�$ D)�$0H���:D��$(��$8A���������D��$0E�������D��$,H�l$`A��B0T
�������B�D�H���í��D��$4��$(H�H��$,A����E���L�$E��uQ��A��H����L��H����i��L��I����h��H��$HdH3%(L����H��X[]A\A]A^A_É�H�\$ E1�E1�H�|$0H<$H�|$8L�|$(I��D�d$A��H�$��$,L)�D9����D��)�A��I9��n����l$D)��I݅��h�����A��L��L����A��H��D�L$H�D$��i����L�L$�L$vI�V��v
I�V��G�Ք��A��D�Y�K���A��L�D�`A���������A��������L�D$XL�\$XE�������A��tiA��tUA��tAA��t-A��tA���hA�Ƀ�G�F�
�ȃ�A�4@�4�σ�E�;D�:�ȃ�E�D��΃�A�<3@�<2A�Ƀ�C�B�
D9�si�΍y�AE�3E�;D�2A�4D�:�yD�IE�;@�4�qC�D�:A�<3B�
D�I�A��@�<2G�A�4F�
@�4D9�r�I��$,L9,$� ���L��H�\$ L�|$(D��$(A����$0�����驕��L�=&� H�5�E1�I�?��g������E��H�l$M��E1�L�T$ I�L�T$(L�|$I��D��D��$,M��M)�D9��������D)݉�L9��̔��D��D)�A��M�E���Ɣ�����H�t$���H��H�<$L���L$�g����H�$D�\$vI�V��v
I�V��G�}�����A�s�M�E�ك�J�T�`���dA���ZE�K�A���LA���BH�T$XL�\$X�����t{��td��tQ��t>��t+��t���4�ƒ�A�A�A����C�4C�4
�ƒ�E�E�����E�E�
�ƃ�A�3A�2����E�E�
9�siA���PC�4A�C�4
D�H�pA�G��HA�3G�
E�A�2�p�PE�3E�
D�H��A�E�2C�4A�C�4
9�r�M��$,M9��.���L��L�|$�d�����d�����1��f���������H�������H�����I���^�����E1��9���A�;�@�:���E��E������d��f.�AWAVI��AUATUSH��(H���dH�%(H��$1�H���Ǔ���Eo���AoFH�l$P�Eo���AoN �AoV0�Ao^@D)�$�AofP�Aon`D)�$ �Aovp)D$P�Ao���Eo��)L$`�Eo���Eo��D��$)T$p��$()�$��Eo��)�$�A��)�$�)�$�)�$�D)�$�D)�$�D)�$�D)�$�������$ ���ٓ����$A��0T���t���B�D�H������D��$$��$H�H��$L��$0A����D��t$E��u;A���L���� c��H��$dH3%(�#H��([]A\A]A^A_�H�D$HD�l$E1�I��H��$0H�D$L�t$ I��H�l$H�\$(L�͋�$L)�9t$�����\$)�A��I9�r
�\$D)�A��M����#�����H�t$A��L���L�$A��H���>c����L�$vI�T$��vI�T$��G�9�����A�U�M�,E���N�\�P��vHA��tBA�E��t9A��t3L�\$H��L��H�t$�M��$M9��2���L�t$ L�L$(���I������a������������AWI��AVAUATI��UH��SH��XD���dH�%(H�D$H1����A�����z���H��u%1�H�|$HdH3<%(�H��X[]A\A]A^A_�D��E��E1�I��H�T$ L�H�T$(A���L��L)�D9������D��)ˉ�H9�����D��D)��I��������A��L��D�L$��A��H��H�|$L��D�D$�a����L�\$D�D$D�L$vI�T$��vI�T$��G�S�����A�H�K�E�ƒ�K�D����?A���5E�X�A���'A���H�D$@L�T$@���������tk��tX��tE��t2��t��tE��D��ƃ�E�2D�2����E�
D�
�ƃ�E�2D�2����E�
D�
�ƃ�E�2D�2����E�
D�
9�sf�ƍHE�2E�
D�2�pD�
�HE�2E�
D�2�pD�
�HE�2E�
D�2�pD�
�HE�2��E�
D�2D�
9�r�I�A��M9���������H�������a_�����UH��SH��AP���������������H��YH��[]���G������AUATUSH��H��H��dH�%(H��$�1�H�t$��^������H�l$H�������H����v_��I��H������H���H����L�d$H�s�8L���H��u|1�L���(������(���H��L��L������������H��L���O^��H��L���D]��H��$�dH3%(H��u[H��[]A\A]�L�
�� H�5إ1�I�9�^����H���]���w���1�H����^�����U���H����A�����1����]��ff.���AWAVAUATUSH��H�GH�_H�oL�G H�T$HL�O(H�H��$�L�W0L�_8H�D$�L�g@L�oHH�T$�L�wPH�\$�H�l$�L�D$�L�L$�L�T$�L�\$�L�d$�L�l$��t$H��$�L�t$�L�XL���H�W`H�GhH�_pL�|$�H�oxL���L�l$0L���L���H�T$ L���L���H�D$�L���L���H�\$�L����<�H�l$�L�$L�L$L�T$L�\$(L�t$8H�|$pH9�����H�L$@H��H�t$xf��|$����T$���(I�������H�|$HA��H�GH�H�_L�wH�w L�G(L�O0L�_8H1T$�H1D$�H1\$�L1t$�H1t$�L1D$�L1L$�L1\$�A�����A��	�c���A��t	H�O@H1L$�L�\$ L�T$�H�|$0L3T$�H�t$�M1�H�D$�L3$H�\$�L1�L�L$�L�t$�H1�L3L$�L�T$8I��L3L$�H3D$�I1�I�M1�L3t$�L1�L3t$�M1�L3t$H3D$(M1�H�T$�I��H3T$�L��H3T$�H3T$L1�H�L1�I��I�H1�L��I��I1�H��L1�H1�L1�I��I1�I��L��L��I1�L	�H1�I��L��I��I��H��M1�I1�I��I��L	�L�T$�M��L1�M!�H�t$�H�t$0L��L�T$�L1�I��L!�H1�M	�L1�I1�L�l$�I��M1�L�d$�H��L�\$PI��L��L��M1�H��I1�H�|$ I��I��M��L	�I!�I��M1�M1�L�t$�I��I��L�|$�I	�L��L1�M��M!�I	�H�|$�H�l$I1�I1�L��H�\$�L�l$`L�d$0L�d$�H1�L1�H�t$L�\$XH1�I1�L�\$�H��M��I��L1�I��I��I��M1�H��M��I��M	�H�t$�M!�H��M��M1�I1�I	�I!�H�\$�L�T$�M��M1�L�t$�I��I1�H1�L�|$�I!�H��L1�L�\$M1�M��L�d$�H�l$8I��M1�L�l$�L�,$I��M1�L1�H1�I��
I1�M��H��I��M��M!�H3L$�M	�I1�H��L3L$�M1�L1�L�$I��H3D$�H3T$�L�|$�L�\$�L�|$�H��	H��L3|$�L3D$(M1�M��H3t$�L3\$�I��I	�M1�I��L	�M��L�|$�I��I!�H��I1�M1�I��H��L1�I��L	�I��H1�M!�I!�L	�H��L1�I1�H!�I1�H�\$H�\$ I1�L1�H�l$PM��H3l$0H1�H3\$�L1�H1�L1�H3\$�L1�I��H��H3l$�I��H��I1�L1�H��H1�H��H1�I��H1�H�|$�H�l$�I�M1�L1�H1�M1�I1�H��I��H1�L1�I��I��H��M	�H��I1�I��L�D$(M��I��M	�I1�H!�L�D$�M��H1�I!�H�|$�H�|$PM1�L�D$�I��H�l$�H1�I	�H��M��L�D$`L1�M1�L�l$�H��I1�L�T$�I��I��I1�L��I��H	�H1�M!�I1�M1�H�D$�H��M1�I��H��L�T$�I��I��M	�L��H1�H��L!�L�D$�H1�H	�H�L$�H�D$�H�D$�I1�L1�H�|$�L1�I��H�l$�H�l$�H��H1�M��H��I��M!�L1�H��M	�I1�H��I1�H��H!�L�l$�M��L	�I��I1�H�D$XM!�I��M1�L�D$�H1�L�|$�I��H��H��M1�I1�L�t$�I1�I��
L�|$�I��L!�M1�H1�I��H�|$�H�L$�L��M��H3\$0L	�H3t$I��H��	L1�H1�L�T$8I��H��H	�H��H��L3$$H3T$H��L3\$ L1�I��M	�I��L!�H!�I��H��M1�I��L1�I1�L1�L3T$�H�D$�H�D$�H3D$�H�|$PH��H3D$�L	�H�|$(L�|$(I��L��I1�L!�H1�M��M��H1�H�T$�I��M	�H3T$�I!�M1�L�D$0L�D$�M1�L1�H3T$�M1�M��I1�L3D$�I��H�T$�M1�I1�H3T$�H3T$�M1�H3T$�I�M��L1�L��H1�I��I1�H��M1�H��H1�L1�H�M1�I��I��H�D$�I��M1�M1�H1�L1�H����H��H1�M1�H��H��I��I��M	�M1�I1�H��L!�L�t$XM��L1�I��M��I!�I	�M	�M1�H�|$�I1�I1�L�D$L�t$�L�t$�L�,$H�L$�L�D$�H�|$PI1�L1�I��M1�I��H1�I��L��H��H��M��I	�H��L1�M1�H!�H��L�\$�I��L1�I��H�D$�H�D$�I	�M��L1�I1�L��M!�L�l$�H	�I1�H�t$�L�D$�H1�H�|$�I��I1�I��L1�I��H�L$H1�H��L��H�t$�I��H��L�t$ L�t$�I��L��L	�H!�L1�L1�H�L$�H�|$�H��H��H!�L1�M��M!�L�D$(I	�I1�L1�L�l$�L�l$8H��H�D$�H�D$�L1�H��L1�M1�I1�I��H��I1�H3\$0L��I��
H��L3T$�H��I��L!�L3t$�I��H1�L3t$�I��M	�H�l$�L��L��L	�I��H	�L1�L�l$�H1�L1�M!�H�L$�I��I1�I1�H�T$�I��M1�I��	H�D$(H�D$�I��L1�L��L�|$�H��H��H!�M1�H��I��I��M1�L	�H3D$�M��L1�M!�H�\$�H3D$�L1�H��M��L1�I1�H1�M	�H3\$�H�L$8H3\$�M1�M!�H�$H3L$H1�M1�L1�H�t$ L�L$0M��L�L$XL1�I��H3L$�I��I��L1�H�L1�H3t$I��H3t$�H3t$(I1�I1�I1�H��L1�L1�H�H1�H��H��H�D$�I1�H��L1�M��I��I����L1�I1�M1�H��I��L��I��I	�M1�M1�M��I!�L�T$�I��I1�L��I��H	�M	�L�L$�L�L$ L1�L�\$�I1�L!�I1�L�T$�I��H�$M1�I��H�|$�I1�L��H1�M��L�T$PH��H��L1�I	�H��I1�L�D$�I��I!�L��I��I��L1�M��H�\$�H�\$�M��I	�I1�H��L!�H1�H1�H	�L��L�T$�H1�H�l$�H�D$XH1�M1�H�|$ H��I��L�$L�\$(L1�L��H��L�L$0H��I1�H	�L�|$�I��H1�M1�H�|$�L��I��L!�H��L1�L!�H�D$�H�D$�H1�H��L!�L	�I1�L1�L�L$H�\$�I��H1�H�l$(H�l$�L�\$�L�\$�I1�L1�L1�I��H3D$�I1�H��
M1�H��L3|$�I��I��L3t$�H3t$M��I��I!�M1�L1�L�T$0I��H3D$�I	�M1�L�T$�L�T$�M1�I��L3T$�I��M	�I1�L��M	�L�|$�M��L!�M1�H1�L1�H��	H3L$�H��H��L3l$�L3d$8H��I��I��I��H��M	�M��H!�I1�M!�L1�I��L1�L�D$�H1�M1�L�L$M��I!�M	�I1�L3$M1�M1�L�L$�L3L$ I1�M1�L3D$�L3L$�M��I1�L��L1�I��H��M��I1�H1�I��H��H�M1�I1�L1�L�L$�H�T$�L1�L1�I1�H��H1�M1�H��H��I��I��I	�M1�I��L�d$8I��I��I	�I1�L!�L�d$�I��L1�M!�H�T$�H�T$XI1�L�d$�M��L�L$�H1�M	�H��L��M1�L�d$�I��H1�I��H�|$�H�|$�L1�H��I1�M	�L1�I1�I��I1�L1�L�t$�H��M��I��M!�H��L��I��I��H1�M	�H�\$�H�\$PM1�I��H!�H�T$�H1�I	�H�$L�t$�H�|$�H�|$�M1�H1�L1�L�L$�I��H��L1�I��H��I��I	�H��M��M��L!�M1�I	�H1�L�t$�M��M1�I��H�T$�I��H�T$�I!�L�<$I1�I!�L1�H1�M��L�d$�H��M1�I1�H�l$�H��H��I1�I��L�|$H�|$�I��
L1�H3|$�H��L!�H1�I��H�L$�I��L��H	�M��I��H	�H1�L1�M	�M!�H1�H�\$�H3|$�M1�L3T$�L3D$ I1�M��I��	H3D$(I��I��L3\$0H��L��H�\$�I��H3t$H�T$8H��I��H�t$�H3t$�H!�H1�L1�I��M��H1�H�l$8M!�H1�H��L1�M��L	�M	�M!�L�d$0L1�M1�M1�L�|$�H��L3|$�H1�H�l$PH�l$�M1�I��L3<$H1�H3l$�I�M1�L1�L1�M��H��H�l$�H3l$�H3l$H3l$�I��L1�I1�I��I��I1�H��L1�I��H�\$�H��I1�H1�M1�I��L1�I��M1ĺ�H��I1�M1�I��H��I��L	�L1�H1�H�t$XL��H��H��L��L	�L!�H1�H�T$�H��L1�M��I!�H�\$�M1�M	�L�T$�H�T$�L�d$L�d$�H1�M1�H��L�t$�M1�I��I��M1�L1�H1�I��H��M��L��H��M	�H!�I1�L!�I	�L1�H1�L�L$�I1�H�t$�H��H��H��H	�L1�H�T$�L�$H�D$�L�d$�H�\$(H�\$�I1�L�t$ M��L1�H�T$8M1�I��H1�H��H��L1�I��L��H��H��H!�M��I��H1�M	�H�\$�L��I��I��L1�I!�H�L$�H�L$�M1�I	�I!�H�t$�I1�L1�H�T$�L1�L�$$L�d$0L1�I1�I��H��L1�H��I1�I��I��H�D$�I��
L��H��L�d$�H��M!�L��H3|$�H��I1�H	�I1�H��H1�L�t$�L3|$L�t$�I��	L	�H��L1�L3t$�L3t$�H�D$0H�\$�H��H	�I1�L!�L1�M��H�D$XH1�I��L3D$�I��I��L��L3l$PM!�L	�I��I1�M��L1�M!�H�T$�H�T$�H��H3T$�H3T$�H��I1�H�L$8H��L!�H�l$�L	�L1�L�l$(I1�H�t$H�L$�M1�H3L$ I1�L�L$�L1�H1�L1�L1�H3l$�L1�H3l$�M��H1�L1�I1�H34$H3t$�I��I��L��I��I1�H��H1�H�l$�I1�H�I1�H��H1�L1�M1�H��H��H��L1�I��L1�I��H��H1�H�����M	�H��I1�I1�L�L$�M��I��L��I��H	�I!�H1�H!�H�D$�L��I��H1�I	�L1�H�|$�M��L�L$�H�D$�I1�H�\$(H�D$0H�l$0I1�L�T$�I��H1�L1�M1�H��H��L1�M1�I��H��H��I��H	�I!�I��L1�I1�H�T$�L��H��L�T$�H	�H1�L��I!�H�\$�H�T$H��H�l$�M1�L	�L�|$�L1�L�L$PL1�L�L$�H1�L1�H��I1�H�|$(H��I��I1�H��L	�M��L��I��H1�H�|$�L��M!�H��I1�I1�L!�L�|$�I��H1�H��H!�L	�L1�I1�H1�M��I��L�L$�H�\$XL�\$�H�l$�L�L$M1�H�\$�H�D$�I��L1�I1�H3D$�H��
M��I��L1�I!�H��L�T$�L3T$�M1�L1�L�|$`I��H3D$�I	�M1�M1�L�|$�I��L3T$�I��M	�I1�L��L!�L�|$�H1�M	�H3$L3l$�H��M��H3t$ I��M1�I��H��	L3t$�M	�L3d$8I��H��I1�I��M��H��I��M	�H!�L�L$�M1�L�D$ M��L3L$(M!�M1�L1�H��L1�L�D$�M1�I!�L3L$�H1�L1�M��I1�L3D$I1�I1�L3D$�M1�I��L1�L��M��H��I1�H��I1�H�T$�H1�I��M1�H�L1�H1�L1�L1�L�L$�H��H��I1�I��M1�H�|$�H��I	�I��H�	��M1�I1�H�|$�L�d$�I��I��I	�I1�L!�L�d$�I��L1�M!�I1�L��L	�L�d$�H1�H�|$�L�L$�L�t$PL�d$�H�T$�H�T$�M1�L1�I1�I1�I��I1�L1�I��L1�H��H��L��I��I��H	�H��H��H��L1�L!�H�|$�H��L1�H��H�\$�L	�H1�L��M!�M��H	�H�|$�H�|$I1�L1�L�$L�L$�I��H�T$�H�T$�L1�M1�H1�I��H��H��M��H��H��H��H��L	�H1�M!�H!�H	�I1�H1�I1�I!�L�L$�L�L$�I��M1�H�\$H�\$�M1�M1�H�l$�H�T$0L�|$I��H1�H�L$�I��I��H1�L1�M��I��
H��H�|$�L3T$�H��M!�L��H��I1�H	�H��H3|$�L�d$�I��L1�L	�M!�L	�H1�L1�L1�H3|$�I1�I��H3D$XH3t$ I��M��H��L3\$`H��I��I��I��L3D$(H��I��	L	�H�T$�M	�L1�L��H�\$�H3\$�H��H�l$�H��L�|$8H1�H�t$PL��H!�L!�L1�M1�M!�H1�M1�H3\$�H3\$�H1�H3l$�H1�I��L1�L1�L�|$�L3|$�H��M1�L3|$H�l$�I��M1�H3,$H3l$I��M��I��H3l$�I1�H��L1�L1�I��H�\$�I�I1�I1�H��M1�L1�H1�H�t$�I��H��I1�M1�I��I��L1�I��M	�I1�A��L�L$�M��I��M	�I1�L�L$�M��M!�M1�I��M	�L�L$�M1�H!�L1�H1�L�t$�L�4$L1�H��L�T$�H�\$ H��L1�M1�H�\$�H��I��M1�I��M��H1�M	�H��M��M��I1�I!�L�d$�M��I��M1�I��L�d$�M��L�L$I	�L��I1�L�d$�L1�I��L!�H1�I	�H�D$�H�4$I1�H�\$0L��M1�L�T$(H1�H�t$�I��H��H��L�L$�L1�H��H��H	�I1�M1�I��L1�I��I��H�L$�H��I��H!�I!�I��L��I!�I1�I1�H	�H�T$�I1�L�d$L�d$8H1�H�L$�L1�H��L�t$�I1�H��H�t$�L��I��L1�L�t$�L3t$�L��H��
L3t$�H��H��H!�L	�L	�H1�H1�L1�H�t$8H�\$�H��L	�I1�L!�L�$L1�L1�L�d$�L3|$H�T$�H�T$�M1�H��I��L3D$�I1�H3|$�I��H1�L��I��	L	�L3l$PH��M��L1�I��L��H��H��L!�L	�L3L$�I1�L3L$�H�t$PI��H�t$�H3t$(I1�M!�H1�I1�L��L�L$�L1�I1�H3T$�L1�I1�L1�H�t$0H3T$�L!�I��L��I��L1�M��H�H1�I��H3t$ H3t$H3t$�I1�H��I1�I1�H��H��M1�H1�H�l$�L1�L�L$�I��H1�H1�H��L1�M1�H��H��H��L	�L1ʀ�H�T$�L��H��H	�H1�H�T$�H��H!�L1�H�T$�L��H	�I!�H�l$�L1�I1�H�|$0H��I��L1�L�L$�L�L$�M1�H��H1�I��I1�H��H��I1�L�T$�H!�H��I��H1�H	�H�T$�L��L1�H��H�\$�H��H�T$�H	�I��H�\$�I1�L��I!�L	�L�T$�L�$M1�H1�L�|$�H1�L1�H�l$H�l$�M1�I��M1�L�L$0H1�L��I��H��I��H��H�\$�H��L	�M1�I1�I��L1�L1�I��H�D$�L��H��H!�H��L1�H�|$�H��H��L!�L1�M��M!�M	�M1�L�\$�L1�L�L$ L�|$XL1�H��M1�H�l$�H�l$�I��I1�L��I��L1�H��
H!�I��H�D$�H3D$�M1�L�T$`L1�I��H3D$�I	�M��L�T$�L3T$�M1�M1�L�<$I��H3L$I��H��L3l$8H3t$(I��M	�H��	L3T$�I1�L��M	�L3d$PL�|$�M��L!�I��M1�I��H1�H��M	�L3t$�H��L1�I1�I��H!�L�L$�I��M��L1�H��M1�L�D$(M��M	�M!�H1�L1�L�D$�I1�L3D$�I1�L3D$�M1�I!�M1�L3L$M��L��I��L1�M1�L3L$�I1�I1�H��I1�H��H�T$�M��H1�I��L1�H�M1�H1�H��L1�H��L�L$�L1�H��I��H�t$�I1�M1�I	��	��I��M1�I1�H��L�d$8I��I��I	�I1�L!�L!�L1�H1�L��L�d$�L�L$0L	�L�d$�L1�H�t$�H1�H�t$�I1�H�T$�H�|$�H�<$M1�I��H�T$�I��M��H��H1�L��M	�H��L1�H��H!�I1�L1�L�t$�H�\$�H��H��I��I	�L��L1�I��L!�H1�H�$I	�H�\$�H�L$�H�T$ I1�H�T$�L1�L�d$I��L1�H��H1�H��H��H��I1�I��L1�I��I	�H��H��M��I1�H!�H	�I��H1�L!�I1�I!�H�l$�H�T$�I��I1�H�\$�H�T$�H1�L1�M1�L�|$�H�|$�I��H�l$�L1�H1�H��I��
L�L$�H1�L1�H��I��M��H��H��L!�H�t$0I��H1�I	�H�t$�I��I1�H�L$�M	�L1�L�L$�H3|$�L��I��L1�H	�L3D$L3\$`L1�I��	H3D$XM!�I��H�T$�H��M��H�T$�H3T$(M��I1�H��H��I��L3T$�I!�I!�L	�I��L1�L1�H�L$8I��H1�H34$H��H�\$�L1�H3\$�H�l$8M1�L1�H3\$�L�d$(M��I	�H1�H1�L�|$�L1�M1�L3|$M!�I1�M1�I��L3|$�H��M1�I��H�l$�H��M��I��H3l$ H1�H��L1�H3l$�I��H�\$�H3l$�I�L1�I1�M1�I��H1�I1�H�Ź
�H��H1�I��M1�H��I1�M1�I��L	�I��L1�H1�L��H�t$PL��H��L	�L!�H1�L1�M��I!�H1�M	�M1�L�T$�H�L$�M1�L�L$ H�L$�H�t$�M1�L�t$�H��H�\$�M1�I��H1�L�d$�I��H��H1�L��H��L	�I��L��H!�I1�L1�L�t$�H�t$�H��H��I��H�t$�I	�M1�I��L!�L�d$�L�$$H1�I	�H�D$�H�\$ I1�I1�H�\$�L�T$H1�M��I��H�H1�L1�H��I��M��M1�I��I	�I��H��M��M��L!�I1�I��I1�L1�I��M!�H�L$�H�L$�I1�H��L!�L�L$�L	�L1�L�L$�L1�I1�H�$H��I��M1�H��L�d$�L�l$0I��H�t$(L�t$�I1�L3t$�L3t$�I��
H1�L!�H��L1�H��H�D$�L��H��H	�H1�I1�L	�H3l$L3|$�L1�I��I��H3|$�H�\$�L��I��	I	�L!�L3D$�M1�H��H1�L��I��H3T$8H��M��H��L�L$(L!�M	�L�L$�L��I��L3L$�H�l$�H!�I1�L3L$�M1�I1�M1�L�\$0L�\$PI��L1�H��H3l$�H3l$�L1�M1�M1�H	�L!�H�t$�I1�H��H1�H�T$ H�L$�M��H3L$I��L�d$8I��H1�H1�I��H1�H34$H3t$(L1�I1�H3L$�H��M1�H1�H��H�l$�I�H��L1�H1�I1�L1�L��H1�H��M1�L1�H��I��I��H��A����M	�I1�M1�L1�I��M1�I��H��L�L$�M��I!�I��M1�I	�I1�H!�L�L$�I��H1�I	�L�\$�H�|$ M��L�\$�H�l$PI1�H�\$�H1�H��I1�L�T$�L1�H��I��I��I��L	�M��L1�I!�H�T$�L��I1�H��L�T$�L�T$�H��H��H�l$�H	�M1�L1�M��I!�M	�H�\$H�\$�I1�L��L�\$0L1�L�|$(L�L$ H1�I��L1�H1�H��H��I1�M1�H��I��I��H�D$XH	�I��H��I1�L1�L!�I��H�|$�L��H��H�D$�H��H1�L!�H�\$�H�\$�L1�M��I!�H�l$�M1�M	�L�\$�L1�M1�L�L$�L1�L1�M1�H��
I��L�T$(I��I1�H��L�|$�M��I��I��I!�M1�H3D$�I	�M1�L1�L�T$0L�T$�L3T$�H3D$�L�|$�M1�I��L3T$�I��M	�I1�L��M	�L�|$�L3t$�M��L!�H3$L3l$�M1�H1�H��I��H3t$L1�I��H��	L3d$8H��I��M	�H��I��I1�H��M��I��H!�M1�L�D$8M��L1�M!�H1�M��L1�L�D$�M	�I!�M1�M1�L�L$�L3L$ I1�L3D$L1�M1�I1�L3L$�L3D$�I��I1�I1�H��L��H��I1�M��H�T$�H1�I��L1�H�L$�H�M1�H1�H��L1�H��L�L$�L1�H��I1�I��H���M1�I��I	�M1�I1�H��L�d$�I��L!�I��H1�L��I	�L	�H�L$�H�L$�I1�L!�H1�L�L$�L1�L�t$XH�|$�L1�H�|$�H�T$�M1�H��I1�H�T$�I��L�d$�I��L1�H��H1�L��H��H	�I��L1�I!�H�\$�L��I��I��L1�I	�H�\$�I1�L��M!�H	�I1�H�L$L�d$�H1�H�T$�L�$H�|$�H�|$�H1�L1�I1�L1�H��L1�H��I��H��I��H��M1�I	�I��H��H��I1�M!�H!�H	�I1�H1�L�t$�M��L�L$�L�L$�I1�I��H�\$H�\$�I!�I��H�T$PM1�H�l$�I1�I��H1�L�|$I��I��H1�L1�L��I��
H��H�|$�H��L!�M��H1�H��I	�L3D$ M1�H�L$�H��H��L	�L�L$(L	�H3t$8L1�I��	L3\$0L1�I1�H�\$�H��L!�I��H�\$�I��I��M��H�D$�L��H3D$�L3T$�H1�L	�L��I��I��L!�H3|$�H1�M!�L1�H�l$�M1�L1�H3\$�H3|$�H��I1�L1�L��H1�H�t$PL1�L	�H3l$�H�t$�L1�M!�L1�M1�H��H�T$�H1�H�l$�H3l$�I��H1�I��H3l$H�T$�I��H3$H1�H3T$H3T$�I1�I��I��H��L1�I�I1�H1�H��H�\$�L1�H1�H�t$�L1�I1�H1�H��L1�I��H��I1�L�t$�M1�M��I��I��I1�I��M	�I��I����I1�M1�L�t$�L�T$�M��I��I	�I1�H!�L�T$�I��L1�M!�H�\$(H�\$�M1�I��M	�L�D$�L�T$�H1�I1�H�$H��M1�L�t$ I��H1�M��H��M!�H��I1�L	�L�T$�M��H1�I��H�t$�M��M	�L��L1�I��M	�H�4$H�t$�M1�H!�L�d$�M1�L1�L�D$0L�D$H1�H�\$8H�\$�M1�H1�I��I1�I��H1�I��M��H��L��I��M	�I��I��I��H�t$�I	�M!�M1�I1�I!�H1�L�L$�M��M1�M1�I��L�T$�L�T$�H��M!�L�d$L�d$�I1�L��M1�I��H��I��M1�H��H�L$�I��
M��I��H�L$�H1�H��M!�L!�I1�L	�H��H1�L�|$�H3l$M��L1�L3\$�H��I	�H��I��M1�H�t$�H��M��H3T$�L�t$�L	�H��	L	�L3t$�L��L3t$�H1�I��H3|$�M1�H��I��H��L3l$PI1�I!�H�t$PH�4$I��I1�L�D$�L3D$�L3D$�L1�H��M1�L3D$�L!�L1�H3t$�H1�H�\$H1�H�L$ H3L$0H1�H1�H��H��H!�L	�L1�M��I��H�t$8I��M1�H1�H3t$(H3t$L1�H3t$�H3L$�L�d$XI��I1�H��H��I��I��H1�H�\$�H��M1�I1�I�H�T$�L1�L��M1�I���H��L1�L1�I��I��H1�H1�L1�H��M	�H��M1�H��I1�I��M1�I��I!�L�T$�M��M1�I��L�D$�I��I	�H!�I	�I1�H1�M��L�T$�L�T$ H��I1�L�L$�H�D$8I1�H�|$�M��I��H�\$ H1�I��I��H��L1�M	�H��H��H	�I��I1�L1�M!�L�T$�L�T$�H�T$�L��I1�H	�L�L$�I!�L�L$�H��H��M1�M1�I��L1�M��L�$I1�I1�H�|$�I��M1�L��L�L$�L1�L�|$8M��H��I��I1�H��M��L��I��H	�H��L��L!�H��L1�L1�L!�H�l$�H�l$�H1�L��M!�H�D$�L	�M1�L�\$�L1�I1�H�\$H��
L1�I��M1�I��L�T$`L�D$�L�D$(I��L��L�T$XI1�I��L1�H!�I1�H��I��H�D$�I��M1�I	�H3D$�H3t$0L1�L�|$(M��L�L$�M1�L3L$�H��	H3D$�M1�L�|$�I��L3L$�I��L3t$�M	�I��I1�L��M	�M1�L!�H1�L�D$H��H3L$H��L3l$�H��L1�I��L3d$PH!�I��I��L1�M	�L�\$�M��M��L�|$0H��I1�M!�H1�I��L1�L�D$�M1�L�T$PL�T$�I1�M1�M��I1�I��M1�M��I!�M	�M1�L��M1�L�l$�L3l$�L1�M1�L3l$�I1�H��I1�H��H1�M��L1�L�T$�H�I��I1�L1�M1�M1�I��I1�L1�M��M��H1�H��H��L1�I���I��I	�H��M1�M1�L�l$�I��I��M��I	�M��I��M!�M1�M!�I1�L��L�T$8M1�L	�L�D$�L�D$�H1�H�\$�I1�L�l$�I��L�l$�I1�L�t$�L1�M��I��H�|$�H��I1�I	�I��I��M1�M!�L�d$�I��L��I��L1�M	�H�|$�H�|$�L1�I1�L��M!�L�T$L�d$�L�d$�I1�H	�H�L$�L1�L1�I1�I1�I��H�$I��I��H1�I��L�D$H�L��H��M��L!�H��M	�L1�H	�I1�L!�H�\$�L��I1�H1�H��I��L�t$�H!�L�T$�L�t$�L1�H�L$L�d$�H�L$ H�l$0I1�M1�I��
H�|$�H1�I��M��H��L1�I1�H3T$�H��M��M��H��	M!�I��I��I	�I1�I��M1�H3D$`L�|$�M��H��L3L$�M	�L3\$(I��H3t$PI��M��H��H3|$�M1�L1�H3|$�M��M��I��L	�I��I��L1�M!�M��I!�H�L$�H�L$�I1�M1�H3L$�H3L$�H��H3L$�L�t$8I��L1�I!�L	�I	�L1�L�l$�H1�M1�H��I!�L�|$XI1�L3l$�H1�I1�I1�I��H�l$PM1�L�t$�L34$I��M1�L��L�|$�L3|$L3|$L3|$�H��M1�L3t$�H1�H�M1�M1�I��H��M1�L��L�l$�H�L$�H��L1�I���H1�M1�H1�M1�H��H1�I��I1�H��H��I��I1�H	�I��H1�L1�H��L1�M��H�t$�H��M!�H��I1�L	�L�t$�L�t$�H1�H�t$�L��I!�H�L$L	�M1�L�L$�M1�H��H1�I��L�l$ L1�M1�H�\$�H��I��H��I��M	�M��M1�L�l$�M��M!�M1�L��I��I��I��H1�M	�H�t$�H�t$�L��L�l$�L1�M��I!�H�\$�I	�I1�I1�H1�M1�L�D$�H1�L�t$0I��L�L$(M��I��M1�I��H�L$H�t$�I��M��I��L��I��L��L	�L	�L��L1�L!�M!�H�D$�L��I1�M1�H��M��L�l$�L1�L!�L�d$�L�T$8I��M1�L1�H�L$�H�L$XI1�I��L�D$�I��H1�I1�M��I��I��L1�L�t$�I��
L��H��L�t$�M!�H��L��L3t$�M1�H	�L	�L3t$�L�L$�M��M	�L1�I1�L1�H�t$�I!�L�d$�L�,$I1�M1�H3l$H3|$�I��H��M1�L3\$�H��I��	H3T$PI��L�T$�M��I��H��L3T$�I��I��H�t$0I!�I1�L3T$�L	�H��L��M1�L3T$�L1�L!�I��H1�H�T$H�L$�I��M1�L�D$8I��H1�M	�H3T$�L!�H3T$�M1�L�\$�L3\$(H1�M1�L1�M��I��I��M1�H1�H3t$ L1�H3t$�H3t$�I��I1�I��H��M1�H�H1�H�T$�I1�I��I1�L1�L��L1�L1�I��H��L1�L�\$�L1�H��H1�H��M1�H��I��M��I	�I1�I��
�L�T$�I��I��M	�M1�I!�L�T$�M��I1�I!�I1�H��L�T$�L�T$0H	�H�|$�L1�L�L$�I1�H�D$�I��L1�I1�H��L��I��H	�H��M1�L1�H!�I��H�T$�H��L1�H��H�D$�H	�H1�L��M!�H	�H�$L��H1�L��H�|$H1�H�l$�L�T$�L�L$H1�H�\$PH1�L�\$0L�\$�I1�H��M1�H��L��I��M1�H��H��L��I��H!�H	�L1�L1�H�|$�H��H��H�D$�H�D$�L!�H1�L��M!�L�L$ M1�L	�H1�L1�L�\$XL�\$�I��H�l$�I1�H�\$�M1�I��H3D$�I��I��L1�L1�L�T$�H��
M��H��L�T$�I!�L3T$�I1�L3t$�I��M1�H3t$(I��L1�L�|$`I��H��	I	�H3L$�H3D$�M1�M1�L�|$�I��L3T$�I��M	�I1�L��M	�M1�L!�L�|$ H1�L1�H��L3l$�I��I��L3d$8H��M	�L�L$I��H��M��M��H!�H��I1�M!�L1�M��L1�H1�I��M1�L�L$(L�L$�M��I1�L3$L�D$�I��I1�L3D$M1�M��I!�M	�M1�L��M1�L1�H��M1�L3D$�H1�I1�I1�M��I��M1�H��H�L1�L1�L�L$�L1�L�D$�H��H1�M1�I1�H��I1�M��I�
��I��I��M��I	�M1�M1�L�l$�I��I��M��I��M!�I	�I1�L��M1�M!�L	�L�L$PM1�L�d$�H1�H�\$�L�l$�H�|$�H�|$�I1�M1�I��H1�I��L�t$�H1�H��M��L�D$�H��L1�M	�M��H��M��I!�L1�I��M1�I1�H��I��L�D$�L�D$I	�L�t$�M1�I��L!�I1�I	�H1�I��H�L$�I1�H�<$H�\$�L�d$�L�d$�H1�L1�H�L�l$�I1�H��I��I��L��M	�L!�I1�I��L�L$�H�\$�I1�L�L$0L�t$�M��I��I!�M1�I��H!�I	�H1�H�l$ M1�L�d$�I1�L1�L1�H��I1�H�L$H��I1�M��I��I��
H��I��I��I��M!�H��L�$M1�L	�M��L1�L�|$�H�|$�I	�H3T$H3D$XH�L$�L��H��	H��L3\$`I1�I��L3T$�L!�I	�H3|$�H��H3t$(I��H��M1�I��L1�H1�H3|$�H��L	�I��M��H�T$�I��I1�I!�I!�H�l$�I��L1�L�l$�M1�L1�L�|$PM��H1�I	�H3T$�H3l$�I!�L1�M1�H�\$H��I1�L1�L�\$�H3,$L3\$�H1�I1�L�L$ L1�L�L$�H3\$ H��L3L$�M��L3L$�L1�L3L$�H��H��L�D$0M1�I��H1�I�����M1�H��I�H1�H��L1�L�L$�L1�I1�L�l$�H��I��H1�M1�H��I1�I��I1�I��L��L	�L1�L1�H�\$�L��H��H	�L1�H�\$�H��L!�I��M1�M��M!�M	�M1�L�D$�I1�L�t$L�l$(H�\$�H�L$�L�L$�L�D$0H1�H1�I1�H��H��I��M1�H1�H��I��M��I��I��M!�M	�I1�I��I1�I1�I��M	�L�t$�L�t$�M1�I��H!�L�T$�I	�H1�I1�L�l$�M1�L�l$�L�$H�\$8H�D$ L��L�L$0M1�H��I1�I��H1�M��H��H��I��L	�L�l$�L1�I��M��H�L$�I��L��M	�H!�M!�L1�L�t$�H1�M1�I!�H�\$�M1�L�d$�L�D$�I1�I1�I��L1�H��I1�I��I1�H�D$�I��H��
L�$M��L��M��I��L3t$�I!�H��H3l$I1�M1�L	�H��H3|$�L�|$�H1�I��H3T$�H��M	�L��H3t$�M1�L!�M	�H��	M1�H��M1�L1�H�L$ H��H��L3\$PH	�I��I��L�D$�H��M��L��I��H1�L!�I��L�D$�I��H��I!�L3D$�H1�L3D$�L	�I��H�L$�M1�L�T$PI��M1�H��I1�H�t$8L1�H3L$�M��L�T$H1�L3T$0H!�H�\$I1�H��L1�L�l$XH1�M1�M��H1�I��H3t$(I��H34$H3t$�L3T$�M1�I1�L3D$�I��L��H��M1�H��L��H1�H�\$�I1�L�D$�M1�H�H1�H����L1�L1�I��M1�H��H��H1�I��H��M	�M1�I1�H��H!�L�T$�M��L1�I��H�T$�L��I	�I!�H	�I1�H�\$I��L�T$�I1�H�D$8H1�L�L$�M��H��I1�H�|$�H1�H��L�L$8L1�M1�L1�I��H��I��M1�H��H��I	�I��L!�M��I��H��I1�H��L�D$�I1�I��L�T$�L��M	�M��L�D$�I1�H��H!�H	�H1�L�T$�H�l$�L1�H�\$L�T$�I1�H�|$�L�|$�H1�L1�L��H��M1�H��I1�I��I��I��H��I	�M��L��L!�M1�H��H1�L!�H�D$�H�D$�H1�I!�H�l$ M	�M1�H�\$L�\$�M1�L1�L�D$(L1�I��H��
M1�L1�L�L$ I��H��I��L�|$�I1�I	�M��L�T$`I��M1�I!�L1�M1�L�T$XL�L$�L�L$�L1�L�|$XL�|$�L3|$�I1�M1�I��I��H3D$�I��L3L$�M	�I1�L��M	�L!�M1�L�|$�H1�L1�H3$L3l$�H��I��H3t$0M��I��H��	L3d$PH��M	�I��H��L3t$�I1�H��I��I��H!�M��M1�L�D$�M��M	�M!�M1�L1�L�T$�L1�L�D$�L3T$�I!�M1�M1�M��L3T$�I1�L3D$�I1�H1�I1�L3D$�L1�I��L��I1�H��L�l$PH��I1�M��A��H1�H�L1�I��L1�L�T$�H�T$�M1�H��I1�H1�L1�M1�I��H��H��I��I	�M1�M1�L�d$�I��I��M��I��I	�M!�I1�L!�L�l$�M��L1�I1�L��H�T$�H�T$�L	�L�T$ L�l$I��H�|$L1�I1�H��L�d$�L�d$�H1�M1�I��H��L1�I1�I1�L��H��I��I��M	�I��L1�L!�I1�H��I��H��L�4$H��I1�I��L�l$�M	�M1�I��H!�I	�H1�H�L$�L�t$M��L�t$�H�T$�M1�L1�L�l$(L�l$�H��I1�H��I��M1�M��L��H��H	�I��H��M1�L!�L�d$�I��L��H��I1�H!�I	�I!�H�L$PI1�M1�L�T$�H1�L�t$0L�t$�I��L1�H�\$8M1�L�|$�H��I��I1�H�l$�L�d$PI��
H1�M��H��M!�L1�L��I1�H��L�|$8L�|$�H	�I��L1�I��M1�I	�M��I��L	�M1�H1�I1�L3d$�I!�H�\$ L3L$�I1�L�T$`I��I��H�$L3D$�H�\$�I��	I1�H�D$XL�l$XI��H1�M��H3L$�L1�M��H��I��H��M!�H3L$8H3L$�I	�H��M1�M1�H!�L1�I��I1�L��M!�M1�L�\$`L�\$H	�L1�L�L$�L3L$�M1�L3\$I1�M1�M��I��I1�H�D$�H3D$(M��L1�L�\$hL�\$0H3D$�L1�M1�L3\$ I�I1�H�H��M��H��H��H�L$�I1�L1�I�L�d$�H1�L1�M1�H1�I��H��M1�H��M1�H��M1�H1�H	�M��H��I����L1�I��L1�H�D$�H��H��I��M	�L��M��I!�H1�I1�L��I!�H�L$�H	�I1�H�\$�L�|$�L1�L�l$�H�D$�L1�H1�L1�I1�M1�H��H�|$�M1�M��H��H��L�d$�I��H��I��I��L	�L��I��H1�H!�H!�M	�H�D$�L��H1�L1�H��H�|$�I1�H��H�\$�H�\$H	�L�l$�L�l$ I��H1�H�T$�M1�L�|$�H��I1�H��L1�L�d$�M��M1�I��H��L�l$XI��I��M	�L��L��I1�H��L!�I1�L�T$�I��L!�H1�M	�L1�H!�H�|$PM��L�$H�D$ I��M1�H�D$hL1�L1�L��L�t$�M1�I��H��I��L1�H�L$�H�\$�L��I��
I1�H��L��H��I��L!�H	�M��H�T$�L1�L1�M��M	�I!�L��L�t$(M	�M1�L�l$H1�M1�M1�L�\$8H�|$xI��I1�I��	H�L$�I��H3l$0L3D$`M1�I��M��H��M��I��M��H��I��M!�I!�L	�H�$I1�L��L1�M1�L	�H��H�T$M!�L1�L�D$M1�H�t$(L�T$0H�l$8H|$HH�L$pH)L$@H�D$@H9��ʷ���~D$��~L$��~T$��~\$�D$��~d$�L�|$�L$��D~D$��~l$�L�d$�T$��~t$ �~|$�\$�d$��D~L$�l$�D$H��$�t$�|$�DL$KS [0c@kPs`{pD��D���D~T$�D~\$0L���H��$�DT$(D\$8H+D$@D��D��H�İ[]A\A]A^A_��H�D$HH�H�hH1\$�L�@H1l$�L�P L1D$�L�X(L1T$�L�p0H�H8L1t$�L�HL1\$�L1L$�H�t$�H1L$�H�|$�H�T$�H�\$�L�D$�L�\$�L�T$�L�L$�H�HPH1L$�H�H`H1L$ H�HpH1L$�L$H�h@L�pHH1l$�L1t$�L�pXH�l$�L1t$�L�phL1t$�L�pxL1t$����hI������H������H���j���L3��L1�L1�H��H3T$ M��H3|$�L1�H3$H�D$�L1�M��H3T$0H3|$(I��L��H3t$�H1�H3t$�H3D$�H1�M��H3t$H3T$�H��L1�H3T$H3D$8H��I��I�L1�I��I�H1�I1�H�M1�H��H1�H1�L1�M1�H��M1�L��L�|$ I1�I��H��I��H1�M1�I1�I��I��L��M��H	�I��H1�I��L��M��L	�M!�I��H1�L�\$�M��H�t$`L��M1�H	�H!�H�L$�L�\$PL1�I��H�t$0I��H��H�\$�H1�H��M1�H1�H��L1�I��H��L�T$XH��I��L!�L��$�I	�I��H��M��H��I1�I1�L�d$ I��M	�L�\$�M��M1�I��H!�H�\$�H1�I	�L�\$�M��M1�I1�H�D$0H�D$�L�T$�L�T$�H1�L1�H��I1�H��H�D$H�t$M��I��H�L�t$�I��L1�H1�I��H��M	�H��M��I��I	�I1�M!�H!�L�|$�M��I��L1�I1�L�d$�H�\$�I��H1�I!�H�t$�H��L1�I1�M1�I1�H��L�,$I��M1�I��
H�L$L��H3t$�I1�L!�H�D$�H�D$8H1�I��L�|$�L3|$ H1�H�L$L��H1�L	�H��H3l$�H3T$�H��L1�H3|$�H��	I1�H�L$�L��H��H��H3t$�L3|$`H	�L1�I��H�L$�H��L	�L�d$�H!�H1�I��M1�I1�I1�H�L$PI��L3D$(I��M��I��M!�I	�L��I1�I1�H!�H!�L1�I��I1�L1�M1�L�L$�M��L1�I	�H3L$�L��I1�L1�L�L$�L3L$XL1�I1�H3L$�L3L$�H��M1�I��L1�I��I�L��L1�L�\$�I1�H�H��I1�L1�L�L$ M1�I1�I��I1�H1�M1�I��M1�L��H��I��I��L	�L1�H5��H�D$ L��H��L	�L1�M!�H��$�H��I1�L!�L�L$hL1�I��H�T$XM	�H��$�H�D$0M1�L�l$�H1�L�$L�T$�H1�H��M1�H��I1�I��I��M��M��I	�I1�M!�H1�I1�L�\$8H��I1�H!�L�L$�M��I��L1�I��H�D$�L��M��M	�M��M��I	�M1�H��M��L�L$�L�\$�M1�L�l$�L�L$`M1�L�T$0I1�M1�I��I��I�L!�L	�M��L1�M	�M!�H�T$�H��H1�M1�H��L�\$�L�\$�H��H�\$�H�D$�L!�M1�I1�L1�L�t$�L�d$�H��$�L�T$�H1�H��I��L1�M1�H��
I��H1�L3T$�I��M��H��L3|$PM!�I��I��I1�I	�L�L$�M��I1�I	�L�l$�I��M��I!�M1�I	�M1�I1�M1�L�d$�I��L3�$�L�\$�H3L$�H�l$L�L$H��	L3D$�H1�H��I��L�d$ I1�I��H��H�l$�I��I��L��L!�L��M��L1�H3l$8L	�L!�H��I1�L��H�D$�H1�L	�I!�H3l$�I��L1�M1�L1�H��$�I��H1�M1�L�\$PL�\$0L1�L3$H3\$�L��H1�I1�L3\$�H�M1�H1�H�\$�H3\$hH3\$�H3\$�I��M��I��L1�I��H1�H��I1�M1�H1�H��L1�L��I��H��H1�I1�M1�L�\$�H��I��I����M1�M1�M1�I��I��L	�H1�L1�M��M!�H�l$�H��I1�L��H��H	�L!�L	�L�d$ L1�L1�L1�L�D$�H�D$H�D$�H�l$(L�,$M1�H�l$�H1�I��H�T$�I1�I��I��L1�I��H��I��M��H1�L��H��M	�H��H��L!�M1�H	�L1�L�d$M!�L1�M��H�T$�M1�M	�H�D$�I1�L�$H�D$�L�L$�H�l$�L�D$�H1�H��$�I��M1�L1�H�D$�I��L1�I��I��M��H��I�M	�H��M1�I��L�l$�I��M!�I��M1�M!�I!�I1�L�d$�M1�I��L�L$�L�L$�M	�L�D$8L1�L�\$�H��H�T$hH��L1�H�l$�H��M1�L1�I1�M��I��I��H1�I��
I��H�D$�H3L$�L��L��H��L3|$PL!�H��H��L1�H1�H	�I��L3L$(H�|$�L��L1�L3L$�L	�I��H��L3�$�I!�L1�I	�I��M1�L�\$0I1�I1�L�D$�M��I��H�t$�I1�H�l$�H�l$�L��I��	I��M��I��I!�I	�H3t$H!�M1�H1�L��M1�I��L	�L1�M!�M1�L�|$hL�|$�H1�H3l$�H1�M1�M1�L3|$ L3|$�H�4$L�T$�I1�H�L$0H3t$�H�T$M��L1�M1�I�H1�H3t$�L1�M��H��H3T$�I��H3T$�H��I1�I1�H����I1�H�\$�H��L1�M1�H1�H��H�l$�I��L1�L1�I1�H��M��L1�I��I	�I1�I1�I��I1�L��L�|$�M��L!�I��L1�M��M	�I	�H�L$�I1�H!�H�l$�M1�L�|$�I��H�\$�M1�L�\$�L1�L�l$�L��H1�I��H��I1�I��H�L$`I��H��L1�M��H��I��M	�M1�H��M!�I1�I��H��M1�I!�L�d$�H	�I1�L�l$�M��L1�I��L�\$XL��I	�H�\$�H�l$�H1�I1�H�l$�H�L$(L�|$�L�|$�H1�H��L1�L1�H��I1�I��H�I��I	�M��I	�M!�I1�I1�L�\$�I��L1�I��H��M!�H�\$�M1�H!�L�d$H��L1�I1�H1�H�|$8H�|$I��L�t$�L�l$�L�|$PL1�H�L$�H�\$0M1�M1�H��L3L$ I��
I��L1�H1�H��L��M��I��H!�M	�L1�I1�L	�H1�H�l$(H�l$�H3l$�H3L$�L�|$�L1�M��H3l$�I��I	�M1�I��H1�M!�H1�L�|$�M1�H3$L3T$�I��H3t$�H��	I��H��L3D$hM��I��I��I	�I��M��M��I!�I1�M!�L!�M1�L1�L��M��L�d$�H��M	�I1�L1�M1�H1�I1�H�|$ L3d$�H�|$�H��L1�H3|$�M1�L3d$�H��L1�H3|$�L�|$M��L1�I��H1�L�T$�I��I1�H�I�H1�H�|$�H�L1�L1�I1�I1�I1�L1�I1�I��I��H��M��M��I��I	�I��M1�M	�I��I1�L!�L�d$�M��L1�M!�L�L$�M��H�|$M1�M��M	�L�L$0M1�L�\$�L�d$�L�D$XL�l$PL�T$�I1�I1�I1�I��I��I��M1�H1�M��H��M��H1�I��M	�H��I1�L��M1�I��L!�L�\$�L1�M!�H�|$�H��I1�H��L�D$�L�D$�I��H��H�t$�M	�L	�M1�M��H1�I��M1�I��H�|$�H��M1�L�T$�M��H1�L�,$I��I��H��I��I��M!�H	�M1�M!�I��M��M1�M	�I1�H�|$�L1�L�L$�L�L$�L!�H��L1�H1�L�t$�M1�H�\$�H�\$`H��I��
L�T$H�t$�I1�H1�L��I��H3L$8H��I1�H!�H3D$�I��H1�H��	M��H�t$�M��L��I��L	�I!�H��M	�H1�M1�H	�I��L1�H3l$�L�\$`I��L3\$�M1�H��I��I1�H�|$�L3\$�H�|$�H3T$(I!�L3|$ H3|$�M��H��H3|$�L�T$�I1�I��I��L�L$�I	�H�\$0L1�I1�H!�L�d$8L1�M��I��I!�M1�L�t$XL�4$L1�M��L3t$�I1�H1�H3\$�I	�H�l$�L1�L1�H3l$H3l$�L1�H3l$�M��I1�L1�L3t$�H��I��M1�I1�H�H1�M��H��I��H��M1�I��H�|$�H1�M1�M1�M��A��I��H1�M1�I1�H��L��M1�I��H	�I��L1�L1�H�l$PL��H��I��L��M	�L!�I1�L�T$(I��M1�M��M	�I!�L�T$ M1�M1�L�D$�L�|$�L�L$L�L$�I1�M1�L�l$�I��I��H1�M1�H��L1�I��H��H��L��L!�I��L	�L1�I��M!�L1�I1�I	�H�|$�H�|$�M1�L�D$�I��L�D$�M	�L1�H�l$�H�L$�M1�M��L�L$�H��L��I1�H��L�T$�H��I1�L�l$�H1�I��I��L�T$�H�M!�L��L�D$8I1�M1�H	�L�|$�I��I��H1�I��H�t$�L��M!�M1�H	�H!�M1�H1�H��H�l$`H�t$�I��H�|$I��L1�H1�L1�I��H1�H��
L1�H��L�l$�I��I��M��H��I��I!�I	�H�L$�M1�I1�L��L	�L�L$�L�L$�H��H1�L3L$(L3L$�L�l$8H	�M1�I��L3\$0H1�M!�L�$I��H�l$�M1�H�T$�H�t$�I1�I��H�t$�H�L$�I��	L3t$�L3d$�I��H3T$�I��L��H1�L��H3D$XH��L	�H��L!�H3t$�L1�H��L1�L1�H��L	�H�L$PM!�I1�H�T$0H��L1�L!�L�d$�H1�L1�I1�H�T$�H1�M��I1�H1�L1�H3T$ H3T$�M��H�t$�L1�I��H1�H3t$H3t$�H3t$�I��I�I1�H��I1�H��H1�I��H��H��I1�M1�L1�L�d$�L1�M1�H1�I��H�����I��M1�H��I��M��M	�I1�I1�L�\$�M��I��L��I��L	�M!�L1�H�L$�L��L�\$�L1�I��I	�L!�H�L$H�L$8M1�L�l$�L�|$�I��H�l$�I1�H1�L�|$`H��M1�I1�L1�I��I��M1�L1�H��L��I��L	�I��H��H1�M!�H�D$�L��M1�I!�H��M1�L�d$�L�d$�H	�L�l$XL1�M��M1�H�D$�L��L�l$�I	�H�l$(I1�I��L1�I1�L�$M��L�l$�L1�I��H��I1�M��I��M	�M��L��I1�I��L!�H1�I!�L1�I!�H��M1�I��I1�H�|$�I	�L1�L�d$PL�d$M1�L�t$�L1�H�L$�I��H�L$�H��I1�L�l$�L�l$�M1�I��I��
L1�L�|$�M1�L��I��H!�M��L1�M	�H�l$(H1�H�l$�I1�H3l$�H3L$�L�|$�L1�M��H3l$�I��I	�M1�I��M!�L�|$�M1�L3T$�H3t$�L	�I��H3T$�H��H1�L3D$0M��H��	I��I��I	�I��L3L$ M��M��I��I��M!�I1�I!�H1�L1�L��M��L�d$H��M	�M1�M1�H1�I1�H�|$ L3d$�H�<$L�|$L1�H3|$�M1�L3d$�L1�H3|$�M��L�T$�L1�L!�I��I��I1�H�I1�I�H1�H��H�|$�L1�L1�H��I1�I1�L1�H1�H�I��H��I1�L1�M��I1�I��I�	��I	�I��M1�M1�M��L�L$�M��M!�I��M	�I1�L!�L�L$�M��L�d$�M1�M��M	�L�T$�L�L$8M1�L1�L�D$XI1�M1�I��L�l$�H1�M��I1�H�|$0H��I��I��I1�L�\$�L��M��I��H1�L!�M	�H��I1�L1�M1�M!�I��H�|$�H��I1�H��L�\$�I��M	�M��I��M1�I��L�T$�H�t$�M	�H�|$�M1�L�L$�L�D$�H1�L�d$�M��L�T$H1�H��M1�H��I�I��H	�I��H�|$�M1�M!�M	�I1�L�l$�I��I1�L!�I��L1�L�L$�I��M!�L�t$�L1�L�d$`M1�M1�H1�H��I1�I��
I1�H�t$�I��I��H�\$�L��M��L��H��L�\$�I��L	�H!�L�\$�M	�H1�L3\$�L	�M1�L1�L1�I1�L�D$�M��L3\$�M!�H�|$�H�|$�M1�H3l$H3T$(H�\$XH3L$PH��H3$I��H��L3|$ I��H��	I��I	�H3|$�I��I1�M��H1�I��I!�I��H�\$8H��M1�I!�L�d$PL1�M��H1�H3\$�H3|$�I	�L1�H3\$�L�t$�L1�L3t$�I1�H!�I1�L3t$�L1�H�l$�M1�I1�H��H3l$0H�M��I��H3l$�H1�H��H3l$�M��M1�I��H�|$�L1�M1�I��M1�L�L$�I1�I��H1�M1�H��H��M1�H1�L��I��H	�I1�L1�I��@���H�l$�L��H��L	�H1�H�l$(L��L!�L1�M��M	�H�l$ M1�I!�L�D$�L1�M1�L�|$�H��H1�L�L$L�L$�M1�H��I��I1�H��H��M1�I��H	�L�l$�I��M1�L��L1�L	�H�l$�L1�H�|$H��L!�I��M	�I��H�|$�M1�I1�M!�I1�L�$L�L$�L1�L�D$�L�D$�H��I1�H�L$�H��M1�I��L��M��H1�I��H�H��M��I��H	�H1�I!�H1�H��I1�H!�H�t$�H�t$�L�|$�M��I��L1�M!�H��I1�L��H	�H��H�l$�I1�L1�L�T$0H1�M��H�L$�H��
M1�I��I��I��L�D$�H�|$�I!�L�l$�M1�L1�L�L$�L�L$(H��H��M1�I��H	�L3L$�I��H1�I	�I1�I1�H�l$�L�l$�I��M!�I1�L	�L�T$�L3d$XI��L3t$�H1�I��I��I1�L��H3D$PI��	L	�H��L3\$8L1�L��I��H��H��H��H�t$�L	�I1�H�T$0H��L!�L!�H�4$H3t$�L1�I1�H�T$�L1�L�d$�L1�H3l$H1�H3l$�L1�H3T$ H3T$�H1�L1�H3l$�I1�M!�H�t$�L1�M��I��I��M��I�H1�H3t$H3t$�I��H3t$�M1�I1�I1�H��M1�H1�H��I��H�l$�H��M��I1�L1�L�d$�L1�I��H1�M1�H��I��M	�I1�A��L�\$�M��I��M	�M1�L�\$�I��M!�M1�I��M1�L1�L�\$�I��I	�L!�M1�I��H��L�|$�L�d$�I1�I��L�\$�H�l$�L�l$hM1�I��I1�H1�I��L��H��M!�L	�M1�I!�H1�M1�L�|$�H�D$�L��H��L�\$`H	�L1�M��I	�H�D$�H�l$�L��I1�H�L$�L1�L�l$�L�d$�L�d$(L1�H1�H��M1�I��I��I��I1�L1�I��M��I	�H��M��M��L��H1�I��L!�M1�H��I!�H1�L!�L�|$XM1�I��H1�H�|$M	�L�d$H�L$�H1�M1�L�t$�L1�H�L$�I��H��I1�H�l$PL�l$�L�l$�M1�L1�I��
I��M1�L��I��H!�M��L1�M	�H1�H�l$(H3L$�I1�H�l$�H3l$�L	�L1�L�|$�M��H3$I��H3l$�L3L$ H��	I	�H3t$�I��M1�H��I��H1�L�|$�L3T$�M!�H1�I��L3D$0M1�I��M��I��I��I��I	�I!�M��M��M1�I1�M!�L1�L��L�d$�L1�M��H��I1�L3d$�H1�H�|$ M1�L3d$�M	�H�|$�M1�H3|$�L!�L�T$�L1�H3|$�L�|$M��L1�I��I1�H��I��I1�H�L1�I�H1�H�|$�H��L1�H1�H�I1�I1�L1�I1�L1�I��H��A�	��I1�I��M��I��I	�M1�M1�M��L�L$M��I��M	�I1�M!�L!�H1�L�L$�M��L�d$XL1�M1�M��L�D$`H�|$0M	�L�T$�L�L$8I1�I��M1�I1�L�l$�H��M1�I��L�\$�M��I1�I��M��I��I��I��M	�L��M	�M1�L!�M1�L�$L1�M!�L�T$�H�|$�H��I1�H�t$�L	�L�D$�I��H�|$�H1�M1�L�L$�H��H1�L�d$�M1�I�H��H1�I1�I��I��H��H	�I��I��M��M1�M	�M!�I1�L�l$�L!�I��L1�L1�L�\$�I��H��M!�H�\$�M1�H�t$�L�L$�H�|$�L�d$hM1�L�t$�L�T$I��
H1�I1�L�\$�H��L��I��I1�H!�I��I1�L3\$�L1�M��I��H�\$�L��I��L	�H��H�\$8H1�I1�L3\$�M	�H3T$(M1�H3L$PH��L	�L�D$�M��H��L1�M!�H3D$�L3|$ I��H��	I��I	�M1�I1�I��M��H3l$�I��I!�H�t$I��H�t$H��M1�I!�H�|$�L1�H�|$�I1�H3<$L�d$XM��H1�H3|$�H3\$�I	�I��H1�L1�L�t$�H3\$�L1�L1�L3t$�H!�I1�L3t$�I1�H��M1�H�H�l$�M��M��I��H1�H3l$0M1�H3l$�I��H3l$�H�|$�L1�M1�I��I��I1�I��H��H1�M1�I��H1�H��L��M1�M1�H	�I1ؾ
�I��L1�I��H1�L��L1�L!�H�l$PL��H��L1�M��H��M	�I!�L	�H�t$ M1�L�|$�M1�L�D$�H1�L�L$L�L$�H��M1�H�l$(M1�H�l$I��I��I1�H��L��I��H1�L�l$�L	�H��L1�H	�H�|$H��L1�L!�I��H�t$�I��M	�M1�M!�I1�H�l$�I1�H�L$�L�L$�L�|$�L�D$�L1�L�D$�H1�H�H��I1�M1�I��M1�H1�I��L��M��H��I��H��M��H	�I!�H1�I1�H!�H�t$�H�4$L�|$�M��I��L1�M!�H��I1�L��H	�H��H�l$�I1�H�|$0L1�H1�M��H�L$�H��
L1�I��I��I��L�D$�L�D$�I��I!�L�l$�M1�M1�L�L$�L�L$(I��L��M1�M��H	�I��H1�L3L$�L	�I	�H1�H�L$0I1�I1�L�l$�I��H�t$�M!�L3d$�L�T$�I��L3t$�M1�I��L��H3D$XI��I1�L	�H��L3\$8I��	I��H�L$PH��L1�L��H�l$�H3l$H��H��H3l$�H�t$�I1�H�T$8H��L!�L!�L1�L�D$�I1�H�T$�H1�H1�L1�H3T$ H3T$�L1�L3D$�M!�L	�L1�L1�M1�L�d$�M��I1�H1�H3t$I��H3t$�H3t$�M1�I1�H��I��M��I��H1�H��I�H��M1�I1�I1�L1�L�d$�M1�H��I��H1�L1�I��M1�M��H������I��M	�M1�I1�I��I1�H��L�\$�M��L!�I��L1�I��M	�I	�L!�H�$M1�L�d$�M1�I��L�\$�L�\$�I1�H�l$�M1�H�L$0L�|$�I��I1�I��H1�L��L1�H��L	�H��H1�I��H�D$�L��M!�H��M1�I!�H	�M1�L�|$�L1�M��I	�H�D$�L��I1�L1�L�d$�L�d$(H�L$�H�l$�L�l$`M1�L�l$�L�\$XL1�H1�L1�H��H1�H��I��I1�I��I��I��M��I	�L��H��M��M��L!�I��H1�L!�M1�I!�H1�H�L$�H�L$�M1�I��H�|$H1�M	�L�d$H�l$PM1�L�t$�L1�L�|$�I��H��I1�M1�L�l$�L�l$�I��I��
M1�L��I��H!�L1�L1�M��L3T$�M	�H1�H�l$0H�l$�I1�H3l$�I��L	�L1�L�|$�M��H3t$�I��H��H3T$�L3L$ H��	I	�L3D$8I��M1�I��I��H1�L�|$�M��M!�H3L$�I	�M1�I��H3l$�M��I��M��H1�I1�I!�I��L��M1�L�$$H��L1�H1�M!�H�|$(H�|$�L1�M��L!�I1�M	�L3d$�I1�M1�M1�L3d$�H3|$�L1�H3|$�L�|$M��L1�I��I��L1�H��I1�H�L�T$�H��H1�I�H�|$�H1�I1�H�I1�L1�L1�M1�I��H��I1�I���L��I��I1�H1�I��H	�H��L1�L1�M��H�T$ L��M!�H��L	�H1�L!�H�T$�L��L1�L1�H�|$H�T$8L��L�D$XL	�L�T$�I��I1�M1�M1�L�l$�I��L�\$�L�\$�I��I1�M��M1�I��M	�I��M1�L��L�d$�L!�L1�M!�H�T$�H��H��I��H��M	�L	�L�l$�L��I��L1�M1�I1�L�\$�I1�H1�H�|$�H�|$�H��M1�L��M1�H��I��H1�L�D$�I��I��L�d$�M��H��I!�M	�H��I1�H	�L!�L�T$L�D$�I��L1�L�d$`H��I��L1�I1�H�\$�H��M!�H�|$�L1�L�t$�I1�I1�H�\$�I��L1�I��H�\$�I1�H��H�t$�I��L�\$�L1�L��H��
H��H!�L1�H	�L3\$�L3L$0I��H3L$PI��L��I1�L	�H3D$�H��L1�M1�L�l$H��H�|$�H�|$�M��L	�H3|$�H�T$XM!�H1�H1�L��H��	L3|$(H	�M1�I��I��I��H�t$�H3,$I��H�t$ I1�H��I!�L��L��I1�L3\$�H1�H��L!�L�t$8L1�I1�H1�H�T$�I1�L3t$�H�\$PL��M1�H	�I��H!�L1�L�t$�L3t$�I1�M��I1�H��H�\$�M1�L3d$�H�H3\$M1�H1�H3\$�L��M��H3\$�H��I��L1�M1�I��H�|$�H1�I��M1�H��I��H1�M1�H1�H��H��M��H����H1�I1�M1�I	�I��I1�I��L1�I1�L��H��L!�L�d$�M��L1�I��M��M	�I	�H!�H�t$(I1�M1�L1�H�|$�L�d$0H�T$ H1�L�D$�L�D$�H��L�d$�H�t$M1�I1�I��H1�I��H��L��L	�I��H��I1�L!�L�|$I��H��H��M1�I��H��H	�I	�M1�I��H�T$�I1�I!�H�t$�H�|$�I1�L1�L�$$I1�H1�L�D$�L�D$�H1�H��H��L�l$�I1�H��M1�H��I��H	�M��L�D$0I��H1�H�L$�L��M��H��I!�L!�I1�H!�H1�L��L1�L�l$�H	�H�T$�H�T$�I1�H�t$�L�l$�L�|$�H�|$H1�I��H1�H��M1�L�d$�H��
L1�I��I��H��M��I��I!�I��M1�I1�M��H3l$XL3t$�L�T$�M��M	�H��I	�I1�L��I��I1�H	�H!�L3D$�L1�L3\$8H3\$�H��H3D$PL�|$�L	�I1�H�T$�L�L$�M1�I��H��	L3L$L�d$�I��I��H��M1�I��I��H��I1�M!�H��L��M1�H��M1�L3d$�I1�H!�L	�H�t$hI1�H1�H�T$�H�4$H3t$�I��L!�H��H1�H3T$(H3T$�L1�L1�L��H1�L1�H3|$�H�\$�H��H��H��L�L$8M��H1�H��I��H�l$�I��L1�H1�L�d$�H3\$ I�H3\$�M1�H3\$�H1�I1�H��H1�M1�H��L1�H��I1�H1�I1�I��I��H��M1�I��I	�I��H���M1�I1�H��H��L�\$�L	�I��H��I1�L!�L�\$I��H�\$�I1�H��L�\$�L�\$�L	�H1�L1�L�l$�I!�H��M1�I1�L��H�L$�I��I1�L�d$`L��I��L!�H	�H1�L1�H�l$�H�D$�L��H��H��L	�H��L1�L!�M��M1�L1�L�t$�M	�H�L$�H�\$XL1�L�d$�M1�I1�L�\$�H��H�\$0I��H�l$�M1�I��M��I��H1�L��H1�H��L	�I��I��I��I1�M��L�T$�M��M!�H�L$�I��L��L�\$M!�L1�I!�M1�M��M1�M1�I	�L1�L�d$PL�d$ M1�I��L�l$�H�l$�I��I1�H�l$8H�\$�L�t$�L�t$�I��I1�I��
M1�H3L$�H1�M��I��H3\$�H3$H��M!�H��	L3L$�M1�I��H3t$�L3D$(L�|$8H��L1�M��M	�H3|$hI��H3L$�M1�M	�H��L1�L�|$�M��H3\$I��I	�M1�I��M!�L�|$�M��M��M1�I��I1�I��I��L1�H��I��I!�I	�M!�L	�I1�L1�L�\$�L1�I��L!�L�L$�L3L$�L1�L�d$0L�d$�M1�H1�I1�L3L$�L1�I1�M1�H1�H�l$(H���M1�I��L��I��M1�L3\$�H��M��I1�H�H1�I�L1�L�\$�I1�H�L1�L�L$�M1�M1�I1�H1�I1�I��I��H1�H��L��I��L	�H��L1�H1�H��H�|$�L��L!�H��L1�I��L	�M	�H�l$ H�l$�L1�M!�L�\$�M1�I1�H�T$XL�l$�L1�M1�H��H�|$�I��H1�I1�L�L$H��I��L��I��I	�H!�L�T$�M1�H1�L!�I1�H�|$�H��H1�I��H��L�L$�M1�I��H�T$�H�T$�I��M	�L��M��L�L$�H1�I1�H��H�t$H��I1�L	�L�T$�I��L1�L1�M��I	�H��H�,$M��M��H	�H�l$`I1�M!�L�l$�M��M��I1�I��I1�H�|$�H!�M!�L1�L�t$�H1�M1�L�\$�L1�H��H��L�L$(I��H�T$�M1�L�|$�I��
I1�I1�L�T$`I��I��M��L3T$�L��L��I!�L	�H��I1�H1�L	�H	�L1�L1�I1�L3T$�H�t$�L��H�|$�H3\$�H!�H3D$�L3d$8H��L1�H��	H3L$PL��H��H��I��H��L3D$0L�L$�I��L3L$�I��I!�L�|$XM1�I��I1�L��L3L$�I	�H!�M��L�|$ M1�I1�H1�H�|$�H!�I1�M��L3|$�M��M1�I	�I��L1�M��M1�I��I1�H�,$H3l$�H��L1�H3l$�M1�L�|$8H1�L�|$�L��L3|$H�L3|$�I��L3|$�L1�M1�I�L�t$PI�H��M1�L1�M��I��L�L$�I1�I1�M1�H�|$�I��I1�M1�L1�I��M��H1�I��M	�H��L1�H1�H��I1�H��H���I1�L��L�D$�M��H!�I��L1�M��I	�I	�L!�H�l$(M1�L1�I1�H�t$�L�D$0L�D$�H��H�|$H�|$�L1�H��I1�H��L�l$�I��I��L1�I��M��H��I��I	�M1�H	�L	�M!�L1�H1�L�L$�I1�H�l$�L�D$�L!�H�|$�H�|$�H1�H�T$�M1�L�L$�H�t$�L1�I��L��I��M1�H1�L��I��H��L��H1�H��L	�H��H�|$�H1�I��H�L$�H��M!�H1�H��M1�I!�H!�L�\$�L�\$�L1�I��L�l$�I	�L��L1�H1�L�D$0I��H�T$�H�T$I��H�l$8L�L$�L�L$`L1�H��H��M1�L1�I1�I��M1�L3<$I��
M��H��H3D$PM��I��I��	L3t$�I!�I	�H3\$XI��L��M��M1�H��M	�L�l$�I��I��I1�H	�I��H1�H1�L��I!�L3T$ H��I��H�t$�M1�L3D$�L!�H�t$�H��M��L1�M1�H�D$�H3D$�I!�L	�I��M1�H1�L1�H�D$�M��H��H1�H�|$�M	�H3t$�H1�H�T$8I1�H3D$(H�\$�I1�H3\$�H3D$�M!�L1�H�T$�L1�M1�L1�M��H3\$�H��I�L1�I��H3T$I��H3T$�H3T$�H��I1�H��H1�M1�H1�H��L1�L�T$�H1�H�\$�H��I1�H��M1�I��I1�H1�I��I1�M1�H��I��H	�L1�H5
�H�D$�H��H��L	�H1�L!�H�D$�L��L!�H1�L��L	�L�T$�H�D$ L��L1�I��H�\$�H�L$�H�L$�M1�I1�L1�I��L�l$hH��H1�H��I��I��H!�I	�H1�L!�L1�M1�L1�H�D$�L��L�|$M��L	�H��I��H�L$`L1�L�l$�M	�I1�H�\$�I1�L�|$�I��H��H�L$�M1�I��L1�L�d$0H1�H��M��L�<$H��I1�I��H	�I��M!�I��H��I1�L	�L!�M1�L�T$�M��I��I1�I��I1�I��I!�L�l$�M1�L�d$PL1�L�d$H�\$�L�t$�L�|$XI1�I1�L�l$�I��H3T$�I��I1�L1�H��	I��
H��M1�L3D$(I��L��I��H!�H��L1�H�l$�H�l$H�L$�L1�M��M	�H1�H�l$�H3l$�I1�L	�H3L$�L1�L�|$�M��H3l$�I��M	�M1�M��L�|$�I��M!�H�\$ M1�M1�I��L1�H3t$�L3L$�I��I��H��H3|$8I��M��H��I!�I	�M1�I1�L!�L1�I��H1�L1�L�\$8I��H1�M!�L1�L�\$�H1�I1�H��L	�M1�L3\$�I��M��H�
��M1�L�$L3L$�I�M1�L3L$�L�d$(I��M1�I��I1�L��I1�H��H1�H�L1�L�L$�I1�H�L1�I��L�\$�H1�M1�L��H��I1�I��M1�I��L	�L1�H1�H��H�|$�L��L!�H��L1�I��L	�M	�H�\$0L1�M!�M1�I1�H�|$�L�T$�L�L$L�L$�L�l$�H�T$`H�|$XM1�I1�H1�L��I��L1�H��H��H��H1�I1�H��I��I��I��I��I	�I!�M1�I��M1�I1�L!�I	�H1�L�\$�I��I1�H��H�t$�H�T$�L	�L�l$�L�L$�H1�H1�L�T$�M��I1�H�|$�H�|$�H��M��I��L1�M��H��M!�H�|$�I	�H��I1�L��M��H!�L�T$`H1�I	�H�\$hH�T$�L��M1�L�\$H��I��L!�L�|$�L1�L1�L�t$�L�L$(L1�H1�M1�H�t$�I1�I1�H��
H3$I��I��H3L$PI��M��H��	L��L3T$�I��H��H	�H3l$ I��M	�H��L3d$�I1�H��L1�M!�L�l$�M��I	�H��I!�I1�H��M1�I��I1�M1�L3T$�L3D$8H!�L�\$�I��H��L��I��L�\$�H	�L3\$�M��L�|$XI��L��M1�L�|$0I1�L!�H1�L3\$�I��H1�I	�I1�M1�L�t$8L�t$�M1�L3t$�H�\$PI1�H!�L3|$�H�|$�L��I1�I1�L1�H3\$�L��L1�I��L�|$�L3|$M1�L3|$�H��L3|$�H��M1�M��H�H�����L1�L1�I��M1�M��L�\$�I��L1�I1�I��H�|$�H��I1�M1�M1�I��I��H1�M1�I��M	�I��I1�I1�L�L$�I��I��L��M��L	�M!�L1�H�\$(L��L�L$�H1�L��H	�L!�I1�H�\$ L1�L�D$�L1�H�|$H�|$�M1�H�T$�L1�I��H��I��L1�H1�H��L��H��L	�I��I��H��M!�H��I1�H��H��L�,$M��H	�M1�I!�H�|$�I��I1�H�T$�H	�I1�L�D$�L1�L1�L�\$�L�\$�H1�H��L�L$�H�\$�H��M1�H�\$PH��M��M1�I��I��H1�L��H��L��H	�I��L!�H1�I	�H1�H�L$�L��H��L�l$�H!�H�T$�H�T$L1�M1�H!�L�D$`H1�I��M1�H�t$�H�|$�H�|$�I1�L1�L�L$�I��I��
H1�L1�L�L$(H��M��H��H��L3T$0L3|$�M1�I��H��I!�I��L	�L3L$�L3t$�M	�H1�H	�I1�M1�I��L1�I1�L�l$�I��	M��I��I!�M��L�\$hI1�H3l$XH3D$8I��H��I��H�<$M!�H��I��I��H�t$�L	�L1�L�\$�L��L1�L	�M!�H�t$�H��I1�H3t$�L3\$ I1�H�D$`L��L3\$�H!�H1�M1�L1�I1�L�T$�L��M��M1�H1�H�T$8H�T$M1�H3|$�H3t$�L1�L1�M��L1�H3T$�H3|$�I��H3T$�H��I1�H��I��L�|$�I�I1�H��H��H��I1�L1�M1�H1�H�l$�H��H1�H��I1�I1�H����I��L1�I��H��H	�L1�H1�L��H�|$�H��L!�H��H1�L��L	�L	�H�D$H1�L!�L1�I��H�L$�H�L$�M1�H�|$�H�|$�M��L�l$�H1�L�\$XI1�I��H��L1�L1�H��M1�H��M1�I��H��I��I��H!�L��I	�H1�H��M1�L!�H�l$�H��L1�H	�L�|$�I��H�l$�H�L$0L1�I1�L��H��L	�L�l$�H1�L�|$�H1�H��H�\$(I1�H�|$�H�|$�I��M��L1�M��I��L1�H��M!�H��M��L��I��I	�I��I1�H1�M!�H!�I	�H�L$�L1�M1�L�t$�L�d$H1�H�|$PH�<$L1�M1�I1�L�l$�H��I��
L1�I��L�|$(H��L��M1�H�l$�H!�I��H�l$8L1�H�\$�H�\$�H1�H�L$�H��L1�M��M	�H1�H3L$�H�\$�I1�H3\$�L	�L�|$�L1�M��H3\$�I��I	�M1�I��M!�L�|$�M1�H1�L3T$hH3t$�L��H��H3T$�I��H��H��	L3D$`H1�I��I��I��L3L$ I	�I��I��M��M��I!�I1�I!�L!�M1�M��L1�L�d$�L1�I��L1�L�T$ L�T$I1�L3T$�M1�M1�M��I1�M	�I��M��I1�H�|$�H3|$�L1�H3|$�L�T$L1�L1�I�I1�H��H�H��L1�I��H1�I��H�D$�I1�I1�H���M1�I��H1�L1�H�|$�H��M��I1�I��L1�I	�I��I1�I1�L��L�d$�M��L!�I��L1�M��M	�I	�H�T$8I1�H!�M1�L�l$�L1�L�d$�L�d$0H�$H�D$(M1�I��H�|$�I1�H1�L1�I��L�\$�H1�H��L1�H��M1�H��H��H��I��I��I��M	�I!�M1�M1�M!�L�D$�I��I1�I��L�\$�M��I	�L��I��H1�M	�H�D$�H�D$�L��L�\$�H�t$�L�d$�H1�L1�H�|$H�T$0I1�I��L1�H��I��I��H��H��M��M	�I1�L�l$�I��M!�M1�L!�I!�L1�L1�M��L�l$`H��I	�H�t$�L1�L�d$�H��L1�H�l$�L��M1�L�\$�I��
L1�L�t$�H��H�l$(H�l$XM1�L��I1�H!�H3\$I��H1�H��M��H��I��H1�I	�H�T$L��M1�L	�M��I��H1�H	�I!�H1�I1�L3\$�M1�L3T$�L3|$ H�t$�I��L3L$�I��	I��M��I��H3L$PL��M��L��H��M��L!�L�L$8H��I	�H!�H1�M1�H�|$�I1�L3L$�I��H3|$�I1�M1�L�|$PH3|$L��H3|$�L�d$XH1�L1�L�d$0L3d$�H1�I��L��H	�L!�L�T$�L1�L1�M��M��I1�L3d$�H�t$M1�H�t$�H34$M��H3t$(I�H3t$�I�I1�H1�I��M1�I��M1�I1�I�L1�I��H��M1�L�d$�H��L1�H��L1�L	�M1�H��I1�I����L1�I��L1�I��M!�H�D$�H��I1�H��H��L	�L	�M!�L�|$�L1�L1�I1�L�l$�L1�L�T$�L1�H�D$�H��H�D$�H��M1�I��I��I1�L�d$�L1�I��I��I��H��M!�I	�H�|$�L��H��I1�M1�H	�L	�L!�L�|$�H1�H1�L�|$�H�T$�H�|$�H�|$�L1�L1�H�D$�H�D$�I1�L1�L1�L�d$�M��H��L1�I��H�\$�H��I��H��L��H��H��I��L	�I��H1�M!�M1�H�L$�I!�L�T$�I��I��L��I��H!�I	�L��I��L��H1�H1�M1�H�$H�T$�I��L�|$ I��L1�L�d$�H�\$�H��L�l$`L�d$XL1�H�l$M1�H��M1�L3\$8I��
I��H1�H��L��M��I��H!�M	�H1�I1�H	�H�|$�L��H1�H��H�\$H�\$H��H��H!�H�D$0H	�H�l$pI��I1�H1�M1�I��H��	L3D$PL1�L�$M��H��L3L$(H��I��I��H��I��M��L!�M	�H)l$@I!�L1�I1�H�L$@M1�M��I��H�t$M	�I!�L�l$0M1�I1�L�D$(M��L�L$8L�\$xL\$HH9�������|$�kn��L�D$HI�0M�HM�XI�hI�H I�P(I�@0M�P8I�x@I�XHH1t$�M�pPL1L$�L1\$�H1l$�H1L$�H1T$�H1D$�L1T$�H1|$�H1\$�L1t$�I�pXM�H`M�XhI�hpI�HxI���I���M3��M3��H1t$�M���L1L$ L1\$�H1l$�H1L$�H1$H1D$L1D$�)n��fDH�o@H�OHH�WPH�GXH1l$�H1L$�H1T$�H1D$�A��
���A����m��H�w`H1t$ ��m��f.�L3��H���H1$�|$��m���8���H��$�H�L$@�B���ff.����AWAVAUATUSH��X���H�t$dH�%(H�D$H1�������I��H�������H��L�4$E1�H�T$@I����H�T$ ���D$8�|$(���|$,H�$E���L)�E���D�l$(I9����,$H�\$L��D)�H��A��A��A��L�\$M�D���{������Hރ�������H�|$ �¹H�D$@����H�|$@H�T$A��K1<�HT$A���9l$(�oL9<$�E���1�H�L$HdH3%(��H��X[]A\A]A^A_�ff.�D�L$,E����L�l$�t$8H��L��L���;j��L��H�I�H�L$�ff.��l$(D)ʼn�H�t$H9���,$D)�A��L�L$M�E��E��L�\$A��A��A������L�|$0H�|$ M��M�މl$<D����E1�D)�D9�AG܉؃���L���H��H�D$H�D$@���L�D$@��H�t$B��H�ǃ�I��I�M1�A)�u�M���l$<L�|$0E���D�H�t$Ht$A���;l$(�����L���
��Adž��y���E�A��I����B��I��O1�A���,����L|$���D�O1�L�D$@E�������L�|$����ff.���AUATUSH��hdH�%(H�D$X1�H�F����1���H���H������H�:�����H��H��1�H��H���������������|$$�x���H�����H�T$H���TH��H�4$H�{H���O������k���H���o��H��3 H�H�L$XdH3%(��H��h[]A\A]�D���H���H���D����V��H����I���B��H�4$H�{H��������H#T$����H���A������L�����E������H������H�'3 H��Z�������H����I������H�4$H�{H��������H#T$�Y���H���A���j��L�����E��uH���e��H��2 H�������?���ff.����������H�����f.���AWAVAUATI��UH��SH���H�^dH�%(H��$�1�H�FH���.H��L�jE1�H��H��$�L�5 H��Q1�I�jj�R��H�� H���Z���H���LH�(I��tH�x�
�����7���L�5�1 M�>���������f�I�)D$`)D$p)�$�)�$�)�$��������O���L������H��H����Hǀ�H��< I9���H�5; I9��fH�=_9 I9���L��7 M9��6L�
�5 M9���L�O4 M9������L�kH�{fv�1�H��L��I�����H�CHǃ�H)�������H�KL�[PL�[pL���L���Hǃ�@Hǃ�ƃ�H�����L�eM��$�A����I��$�H���}���H�:�s���H�t$`1�H��H�t$ ����������$��#���L�t$pI����'I��D���I��L�4$E������M���H�l$`H�D$XH�\$D���H�D$0L��H�l$D��A����D�L$H�L$8���L$<L�l$L�4$E���M)�E���qD�d$8M9��#D�,$L�d$H��E)�L��D��E���L�t$(M������D��E���L�A���	A����H�|$0D�¹H�D$X�~���L�T$H�t$XL�L$(H14�E��LL$E���D9l$8��L;<$�6���H�\$H�|$ ���H��$�dH3<%(H���zH���[]A\A]A^A_����1�M�������1����f.�L�kH�{fv�1�H��L��I�����H�CHǃ�H)�������H�SL�cPL�cpL���L���Hǃ�@Hǃ�ƃ�H��������)���ff.�f�L�kH�{fv�1�H��L��H�����I�H)�H�C���Hǃ����H�[H�SPH�SpH���H���Hǃ�@L���ƃ�H����������l$<���L��L�t$�t$HH��L���}a��I�I�L�t$�@���ff.�f�D�l$8E)�D��H�|$(I9���D�,$E)�E��L�\$(M�D��E��H�t$E���A��E����L�|$@L�L$0I�߉�D�l$LI���ff.�E1��D)�D9�AG�A���bL�ϹL��L��H�D$XL�D$�ѽ��H�|$A��B��I��H�D$X��I�H��K1�A)�u�L��D�l$LL�|$@L�\$E���H�L$E�H�T$(HT$D���D9l$8����H�����L�l$ADž�����ff.�f�L�kH�{fv�1�H��L��I�����I�H)�H�C���Hǃ����H�kL�CPL�CpL���L���Hǃ�@L���ƃ�H����������L�kH�{fv�1�H��L��I�����H��H)�H�C���Hǃ����H�cL�{PL�{pL���L���Hǃ�@H���ƃ�H���L������L�kH�{fv�1�H��L��I�����I��H)�H�C���Hǃ����H�sL�SPL�SpL���L���Hǃ��L���ƃ�H��������c����A�UA��I����B��H��K1�A���X������H���*���H���_���I������û��H�t$pL��I��H��H�t$`�6���L��A��苻��E����H�|$ �X�������H�=t) H�5H�?�-���H�+u
H���߻��H��tH�|$h�����1����L|$(�h����H�|$H1�H�D$XD��������K���L�|$������f.�f�H�=6 H�6 H9�tH��( H��t	�����H�=�5 H�5�5 H)�H��H��H��?H�H�tH��( H��t��fD�����=�5 u+UH�=�( H��tH�=�$ �I����d����}5 ]������w������USQH�( H�芺�����h�����H�=�* 豺��H��H���p���H�-&( H�=w3 H�-x3 ������H���H�\3 H�5�H��H�J3 赸�����"���H�=�1 H�-�1 誸��������H�{1 H�5mH��H�i1 �t��������H�=�/ H�-�/ �i���������H��/ H�5H��H��/ �3����������H�=�- H�-�- �(����������H��- H�5�H��H��- �����_���H�=�+ H�-�+ ������D���H��+ H�5|H��H��+ 豷��������H�=* H�-* 覷��������H��) H�5+H��H��) �p��������@H�5�H�����������H��H�5pH���V�����xH��Z[]�����H��H���_sha3length is too largeinternal error in SHA3 done()keccakoptimplementationcopyhexdigestupdateblock_sizenamedigest_size_capacity_bits_rate_bits_suffixusedforsecurity_sha3.shake_256_sha3.shake_128_sha3.sha3_512_sha3.sha3_384_sha3.sha3_256_sha3.sha3_224%s is not available in FIPS mode/builddir/build/BUILD/Python-3.8.17/Modules/_sha3/sha3module.cinternal error in SHA3 Final()internal error in SHA3 Squeeze()Unicode-objects must be encoded before hashingobject supporting the buffer API requiredBuffer must be single dimensioninternal error in SHA3 Update()generic 64-bit optimized implementation (lane complementing, all rounds unrolled)hexdigest($self, /)
--

Return the digest value as a string of hexadecimal digits.digest($self, /)
--

Return the digest value as a bytes object.sha3_224([data], *, usedforsecurity=True) -> SHA3 object

Return a new SHA3 hash object with a hashbit length of 28 bytes.sha3_256([data], *, usedforsecurity=True) -> SHA3 object

Return a new SHA3 hash object with a hashbit length of 32 bytes.sha3_384([data], *, usedforsecurity=True) -> SHA3 object

Return a new SHA3 hash object with a hashbit length of 48 bytes.sha3_512([data], *, usedforsecurity=True) -> SHA3 object

Return a new SHA3 hash object with a hashbit length of 64 bytes.update($self, data, /)
--

Update this hash object's state with the provided bytes-like object.hexdigest($self, length, /)
--

Return the digest value as a string of hexadecimal digits.digest($self, length, /)
--

Return the digest value as a bytes object.copy($self, /)
--

Return a copy of the hash object.shake_128([data], *, usedforsecurity=True) -> SHAKE object

Return a new SHAKE hash object.shake_256([data], *, usedforsecurity=True) -> SHAKE object

Return a new SHAKE hash object.;�>d�������<����Tڱ��<8����M�������������h���|W������v���������J���������� ;����.�(	2��	���	��	u��	��
[� ��4<��������(����<
4�h��������������D����P��������$�d�$>��P�>���?��T?��0t@��|�D���D���K����N��4�N��HtQ����Q��D	S��D
D��
T�t4��T�d���
zRx�$H���0FJw�?:*3$"DP��� \X���&p��QH C
A���������(�5a�O�(�L�xF�H�D �bABzRx� ���$����^Xl��WTzRx�����T���g�����3Pa�����30���F�A�A �D0e
 AABAt��H$�4F�B�E �E(�A0�C8�D`t
8A0A(B BBBApC���`�����D\������F�B�E �B(�D0�A8�D@Z
8I0D(E BBBE8A0A(B BBB������HX��IF�E�B �B(�A0�A8�D��I8A0A(B BBB$X�8��hE�A�D0YCAzRx�0�� ڮ��2H������$F�B�B �B(�A0�A8�D��$8A0A(B BBB��8��qH ^
A�8��<E�k
AFH89��F�B�B �E(�A0�D8�FP�
8A0A(B BBBAL��9��oB�B�B �E(�A0�A8�G��
8A0A(B BBBB$zRx��������,N��X�=��	L$�=���F�B�B �B(�A0�G8�G�
8A0A(B BBBA$zRx��������,��PL�DD���B�B�E �B(�A0�A8�G��
8A0A(B BBBA$zRx��������,���I<�F��	HP�F��F�E�B �B(�D0�D8�D�H
8A0A(B BBBA$zRx��������,w����>��$��H��9E�D�E ^DAzRx� �� ���AAA8LhH��BF�B�A �A(�M��
(A ABBA zRx������(���t����wH n�E��X\�����F�E�E �B(�D0�D8�B@n
8A0A(B BBBED8A0A(B BBBLL�H��4�F�B�B �B(�A0�A8�G�XJ
8A0A(B BBBI$zRx��������,Y��>L�l��F�B�B �B(�A0�A8�D�8
8A0A(B BBBL�3��H<<	g���B�E�E �H(�G0�D@q0A(A BBB8|	����F�B�A �A(�D��
(A ABBF zRx������(`����	D�
���`
<�D	F�B�B �B(�D0�D8�G�h�]�G�B�I�K
8A0A(B BBBI$zRx��������$,2��R`�[�D�B�I�H�
\���F�D�B �B(�A0�A8�G��8A0A(B BBB(L�
E�A�A �
AAA4���;GNU�pg0g@�!�iEjUft�X
�i0�!8�!���o`X
P
;x�!0(��	���o���o0���o�o����oPh�!������� 0@P`p��������    0 @ P ` p � � � �i`_ p�i��l�i�`ljp[oj_j�_j�^#j�^2j�^=jP^�i`_ p�i��o�i��`ojp[o�i��������P�!�jUj� _�p��!��!p]ej� _`p��!��!p]uj� _�n�!��!p]�j� _n�!��!p]�j� _�m�!��!p]�j� _m�!��!p]GA$3a1X�i_sha3.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debugl�`��7zXZ�ִF!t/���]?�E�h=��ڊ�2N�`��� ��*DI�uB� �`���h�?ʱҰ7���ܩ������)pL�!��>fm.�s��_�M��*o&�;\#_�D�RPw=�~�vb�]Z�h�M�Ð�#m�ت�1� !���R,㆏S�
~�U�az��]	q�/��-y�b�%F�
�0�b��D0L�hs��l�6��_�06��
J<)a�����}�)=�'�8����u������z�����iKXF-d@�9�Kfŀ3�gd3�v	���0�Yp�|�"�����f���jOb��^G<1���s�<Ƞ
�st��~}:�P��څ��	/L.nB�2���+�_ �R��Iq�v25RK�Cn��;��A�G>���|5��9���Xn��–~G�/�\�-3ܛO��6U���u���3�ݑ��P�D�<vLƒ���G%�Mw(N��k�~D�Z\s�f4)��Cm�~Z{��A�m3;&5�hk��yOus&�.��Sa��
���;)�jC�&�|�r����b���
q�� Lb;�! �a#��-n�^�]۱�߭�q�@��:o�I�3���k�������U�I��%�9Z݉%}��+wG*%o,�%�ȁ��d>l��(Ӈu��r�>	���
z�j\���C#i�|]�S�rͫ���>n)��͜�_��ߕ�6�N��G�>�u�A���:S3�����Q�7��G2�j�'M�S�7�%��
��E+�ו�\׀0��@�+Ls��v�E�Jf�eb�2H�i�"*��+̫�ھe۽#C�J�G��
��)�c�����K]1��q�*�ǽ�g�D�7;��Vr��D��{5�ټq!>ƅ(�����򦞇�^7�~ۆz� @ks�"�J��'���-sN��{ �Y}�]}\�/�H��O����s���O����vS$]��<"��'�"	!���r�t��ޞ�K�1���3�;��Z�ùu�|�{Ba�1��{I��i�ץ�e���(@���řl7O^Y�&l�x
�@��g:�4���Vws�{]�B>�T��Y�l�*{A' ܅;M�P<��c#`��6�oc���Bz�ʩ]����׸)�cH��&�<Q�N��MV}�H�J���o�0��PqNJ����V�����|,rmUd)�1��o��1�r�~_�@�a�"����T��׊ɔ�E�+rxF	��2&��c�_ڥ.ʝ_c{;��C�11)�h�t��c��z�JT�w†$�����ۦ9ϗ
��}�*MN��	�"�vW�t-�]�z��
�� +���[%mX<��pK�c��F�[%w3ո��tP�#fҡď	z'A*D��ߵj.���Lif����g��
�F�	�g����D�\�c�]]+�=B���~�`�d�'f��D�;&I1������F�5�̹�Y��,�8�I���g�S����%��w�Q˧�SX���$Am�׷�)��/W��o��V3
��!�$��v���4���'��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``�(PP0X
X
;8���o���E���o00pT���^B((0hXXc��0n� �  w�"�"�F}�i�i
��i�i| �qq��ssX�p~p~ �0�!0��8�!8��@�!@�(�h�!h��x�!x����!�� ��!���a�$
�\`�0��(lib-dynload/audioop.cpython-38-x86_64-linux-gnu.so000075500000120510151153537510015550 0ustar00ELF>�@�@8	@X�X� H�H� H� �� `�`� `� 888$$8�8�8�  S�td8�8�8�  P�td{{{Q�tdR�tdH�H� H� ��GNU����F�,t��h���0�k/�@ /12��|CE���qX�ZϷ?��f �� �)�, �F"R� ��
��t��,8��-
JV:���c�q��gؓ Tȓ [ȓ �cm__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libm.so.6libpthread.so.0libc.so.6PyErr_SetStringPyObject_GetBuffer_PyArg_CheckPositionalPyBuffer_IsContiguous_PyArg_BadArgumentPyFloat_TypePyExc_TypeErrorPyType_IsSubtype_PyLong_AsIntPyErr_OccurredPyBytes_FromStringAndSizePyBytes_AsStringPyBuffer_Release__stack_chk_failPyExc_MemoryError_Py_BuildValue_SizeT_Py_NoneStruct_PyArg_ParseTuple_SizeTPyExc_ValueError_Py_DeallocPyExc_OverflowErrorPyMem_MallocPyErr_NoMemoryPyTuple_TypePyTuple_SizePyTuple_GetItemPyTuple_NewPyTuple_SetItemPyMem_FreePyNumber_IndexPyLong_AsSsize_tPyLong_FromLongfloorPyFloat_AsDoublePyLong_FromSsize_tPyFloat_FromDoublePyLong_FromUnsignedLongsqrtPyInit_audioopPyModule_Create2PyModule_GetDictPyErr_NewExceptionPyDict_SetItemString_edata__bss_start_endGLIBC_2.2.5GLIBC_2.4f ui	l�ii
xui	lH� cP� �bX� X� � �e� �^� @t � �d(� A48� �s@� peH� KHX� `s`� �eh� q\x� �r�� �e�� �Y�� `r�� �e�� m`�� �q�� bdȐ 1ؐ `q� �e� �U�� �p� �e� �W� `p � �e(� FT8� �o@� �eH� �QX� @o`� 8dh� �-x� �n�� 3d�� �+��  n�� *d�� �)�� �m�� !dȑ a'ؑ  m� d� K%�� �l� d� #�  l � d(� ` 8� �k@� �dH� �9X�  k`� �dh� �5x� �j�� }e�� �M��  j�� te�� #J�� �i�� SeȒ !Fؒ  i� �c� a�� �h� �c� ��  h � �d(� �=8� �g�� �e�� � �� �� �� �� 	ȏ 
Џ ؏ � � � �� �� �� �� �� �� �� 
�� �� Ȏ Ў ؎ � � � �� � � � �  � (� 0�  8� !@� "H� #P� $X� %`� &h� 'p� (x� )�� *�� +�� ,�� -�� .��H��H��w H��t��H����5�v �%�v ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#��������%=t D���%5t D���%-t D���%%t D���%t D���%t D���%
t D���%t D���%�s D���%�s D���%�s D���%�s D���%�s D���%�s D���%�s D���%�s D���%�s D���%�s D���%�s D���%�s D���%�s D���%�s D���%�s D���%�s D���%}s D���%us D���%ms D���%es D���%]s D���%Us D���%Ms D���%Es D���%=s D���%5s D���%-s D���%%s D�V�Q��w,H��Hc�H�H���H��t,H�=+w H�5G�O���1��H�=w H�5�F�8���1�Z���AT�UH��SH��`dH�%(H�D$X1�H��H���H��uH�}1�H�������t!�NH�ֹ�H�=�F������u��/�CH�������u%H�MH��FH�5�FH�=~F����1���H�UH�5^r H�zH9�uH�6r H�5H1�H�8�m�����s�����u�H�}���A�ă��tH�|$D�������u�����H��t��H�t$1����H��H���w���H������Mc�E1�1�L�H;t$}-1�A9�~L�$H��H��I�H��G�D�L8���L�M�L���H�|$tH�����H�\$XdH3%(H��t���H��`[]A\���AV�ATUH��SH��hdH�%(H�D$X1�I��L���H��uH�}1�L���
�����t!�NH�ֹ�H�=BE�n�����u��/�CL��������u&H�MH��DH�5	EH�=
E�y���E1��.H�UH�5�p H�zH9�uH��p H�5�FE1�H�8�����������u�H�}�]������tH�|$���*�����u��?���H��t��H�t$1����I��H���w���H���H���Lc�E1�E1�H�\$I9���L�$K�<��u
�H��L)È�i��uf�7H��L)�f�4�T��uDC�tC�LH��D�L)É�����DوH�\$L)Èl�H�|$��L)LjL8���7L)�L)É4M�M��d���H�|$tL�����H�\$XdH3%(L��t���H��h[]A\A^���AW�AVAUATI��USH��hdH�%(H�D$X1�H��H���H��uI�<$1�H���
�����t'�gH�ֹ�H�=DC�h�����u��E�CH��������u&I�$H��BE1�H�5�BH�=	C�m�����I�T$L�-�n H�zL9�tHL�������u<I�|$�m����Ń��tI�t$H�~L9�u��Q���H��t��L�������tL�
Ln H�5�DE1�I�9����TI�|$����A��tH�|$��������u�o��H��t��cE�D$�A��wEH�D$Lc�Mc�H�I��H��H��������H�I��H9�~9H��m H�5=DE1�H�8������H�=�q H�5�A���E1��I��1��7���I��H��t�H�����E1�L;L$��L�$O�
��u	A����7��u	A����)��u!C�L
C�T
A�3���������A�A��u����+A��u��f��A��uA�Ј0��A���PD�@��M�L��e���H�|$tH���9���H�\$XdH3%(L��t�A���H��h[]A\A]A^A_���AU�ATUH��SH��hdH�%(H�D$X1�H��H���H��uH�}1�H���`�����t!�NH�ֹ�H�=�@�����u��/�CH���n�����u&H�MH�Q@H�5\@H�=p@����E1��lH�UH�5l H�zH9�uH��k H�5:BE1�H�8�'����:�-�����u�H�}����Ń��tH�|$���}�����u����H��t��H�D$Lc�1�H�I��H���4���I��H���l���H�����1�L��VH;t$��L�$M�1��u
E�A���<��u
E�A���-��u%A�L1E�T1A���A����A�A�A���E�A��H��A��E��E��y	A��A�U1ɉ�fE;KA��A����fA�A��E	�D���H��H��u�A���A�������D	�A1�D�H�L��1���H�|$tH�����H�\$XdH3%(L��t����H��h[]A\A]���AU�ATUH��SH��hdH�%(H�D$X1�H��H���H��uH�}1�H���#�����t'�H�ֹ�H�=n>�����u����CH���+�����u%H�MH�>H�5>1�H�=4>����@H�UH�5�i H�zH9�uH��i H�5�?1�H�:��������u�H�}�o���A�ă��u�b�H��tC�T�p���w9Lc�H�t$H��������H�I��H9�~7H�pi H�5�?1�H�8�����H�=Cm H�5=�g���1��I��1���H��H��t�H����L�$E1�L�RL�D$M��M9�}WI��A�J�A�<K��A��u	��B�<�3A��u
��fB�<�#A��u����B���B�|B�t�B�<M��H�|$tH�����H�\$XdH3%(H��t���H��h[]A\A]���AU�ATUH��SH��hdH�%(H�D$X1�H��H���H��uH�}1�H���
��t!�NH�ֹ�H�=d<�n��u��/�CH�����u&H�MH��;H�5	<H�=/<�y�E1��H�UH�5�g H�zH9�uH��g H�5�=E1�H�8���������u�H�}�]�Ń��tH�|$���*��u��?�H��t��H�D$Lc�1�H�I��H�����I��H���l���H���=�1�L�TRH;|$}nL�$I�49��u
D�A���=��u
D�A���.��u&A�L9E�\9�A��A��A��E�A�A���D�H��A��A��yA��A��H�|$tOH�����EA��!E1�D��fG;PA���A����փ�D	�D1��I��I��u�D�΃�@�p�L��4���H�\$XdH3%(L��t��H��h[]A\A]���AU�ATUH��SH��hdH�%(H�D$X1�H��H���H��uH�}1�H������t'�H�ֹ�H�=@:�A��u����CH������u%H�MH��9H�5�91�H�=:�G��@H�UH�5�e H�zH9�uH�oe H�5�;1�H�:������u�H�}�/�A�ă��u�"�H��tC�T�p���w9Lc�H�t$H��������H�I��H9�~7H�0e H�5y;1�H�8�?��H�=i H�5�8�'�1��I��1��u�H��H��t�H�����L�$E1�L��KL�D$M��M9�}WI��A�J�A�<K��A��u	��B�<�3A��u
��fB�<�#A��u����B���B�|B�t�B�<M��H�|$tH����H�\$XdH3%(H��t��H��h[]A\A]���AV�AUATI��USH��`dH�%(H�D$X1�H��H���H��uI�<$1�H�������t'��H�ֹ�H�=18�)���u���CH�������u&I�$H��7E1�H�5�7H�=�7�.��rI�T$L�-}c H�zL9�tFL������u:I�|$�.�A�ƃ��tI�\$H�{L9�u���H��t��"L���r���tH�c H�5X9H�8�H�E1��I�|$���A�ă��tH�|$D������u����H��t���H�t$1��c�I��H��t�H��1���Ic�H�5�I1�D��H;\$��L�$M�A��uA��:A��uA��.A��u%E�LA�TE�A����D�Dځ���A�D�D!�A��u��%A��uf��A��u��t���T��H�H��f���H�|$tH���W�H�\$XdH3%(L��t�_�H��`[]A\A]A^���AWAVAUATUSH��H�ֺH��H��dH�%(H��$�1�L�d$PH��L���H��H���H��uH�;1�L���d���t!���H�=�5�����u��w�CL���r���u%H�H�V5E1�H�5^5H�=�5����$H�{1�H������u/�CH���*���u&H�KH�
5H�5`5H�=U5��E1���H�sH�~H�5�` H9�uH��` H�5�6E1�H�8���������u�H�{�l�A��tH�|$`D���7���u��L�H��t��H�t$`H;t$tH�=bd H�5�4E1����IMc�L�DEL�
E1�C��C�,���I��H���:���H����1�1�M��H;|$`�L�|$PL�$M�7M�3A��u
A�A�
�XA��u
A�A�
�HA��u:A�L7A�T7E�9E�L3�����A�L3A��E�D���D�D��A�A�
щ�9�|G9͉�M��>�*��*��*��X�f/�w"�*��
�Jf(��X����T�U�V��,��-A��u�0�%A��uf�0�A��u�0�t0���T0��0L�L���H�|$Xt
H�|$P�C�H�|$tH���3�H��$�dH3%(L��t�8�H�ĸ[]A\A]A^A_���AUATI��H�ֺUH��SH��dH�%(H��$�1�H�l$PH��H���H��H���H��uI�<$1�H���;���t$����H�=�2����u���CH���F���u&I�$H�)2E1�H�512H�=�2���$I�|$1�H�������ud�CH������u'I�L$H��1E1�H�5.2H�=M2�V���L�d$`A��uH�D$I��A��tH�=�a H�5$2��E1��I�H�L�$1�W�I9�}H�=ba H�52E1����vH9�~A�RH���*��Y��X���H�L$PE1�EW�L9�~F�iI���A*��Y��DX���1�EW�H9�~"�<qE�rH���D*��E*��EY��EX���fA(�f(�L�I1��AY�A�I)��AY��\��A^�M9���A�|A�A�Q�EW��*�1��*��Y��Y��DX��D\�H9�~#E�yA�zH���E*��D*��EY��EX���fA(�fD(��AY��EY��D\��E^�fA/�vfA(�L��I��I���k���L�6W�L�L9�~!F�AG�$BI���A*��A*��Y��X����^�H�=�0��k�I��H�|$XtH����H�|$tH����H��$�dH3%(L��t�
�H�ĸ[]A\A]���U�H��SH��hdH�%(H�D$X1�H��H���H��uH�}1�H���1���t!�NH�ֹ�H�=0����u��/�CH���?���u%H�MH�"/H�5-/H�=�/��1���H�UH�5�Z H�zH9�uH��Z H�511�H�:�������u�H�}���Ń��t+H�|$���P���t�L�T$Lc�L�$E1ۺ������(�L�H��t��u�����uA�9�L�9�O�M�M�M9�|��/��uA��ރ�uA�HA�@�����A���A��H�=�.1���H��H�|$tH���R�H�\$XdH3%(H��t�Z�H��h[]���AW�AVAUATI��USH��dH�%(H��$�1�H�\$0H���H��uI�<$1�H���u���t'�gH�ֹ�H�=^.�����u��E�CH���}���u#I�$H�`-H�5k-H�=&.����I�T$H�5*Y H�zH9�uH�Y H�5K/E1�H�8�8����>���u�I�|$���Ń��tH�|$@��M�l$����u���H��t��L;-�X u�D$(�D$,�I�u���uL�
vX H�5w-E1�I�9���A1�H�L$,H�T$(L��H�5�.����t3D�D$(A���A����w�|$,XvH�-
X H�5<-H�}�U�E1���H�D$@D�T-1�Mc�H�I��H����I��H��t�H��L�5_=A����Hc�Lc|$,E1�H�L$E1��D$G��L�t$H�L$L;\$@�T$(�L$,�PL�t$0O���u	A�0���>��uA�0�3��u(C�|C�tE�0A����A��D�D������A�0��9�~A�пA)�D���)�1�E��E1�A��A9�D)�E�A�E��A�A9�
A��D)�E�A��A9�A��E�F���tD)�A��A���~
�D$(��A���������DL�D�L$(A��H�=�;E	�Ic��y
�D$,���XA�XAOΉL$,HcL$,L�|$E��E��tA��D�D$�DD$H��D�@�A��L\$LT$���1�L��H�=d+���I�$I��uL�����H�|$8tH���v�H��$�dH3%(L��t�{�H�Ę[]A\A]A^A_���AW�AVAUATUSH��H��dH�%(H�D$x1�H�l$ H���H��uH�;1�H������t'�H�ֹ�H�=�*�����u���CH������u"H�H�{)H�5�)H�={*���YH�SH�5FU H�zH9�uH�U H�5g+E1�H�:�T���Z�A�ą�u�H�{���A�ǃ��t
�p���v�1����H��t'��H�{H;=�T u0�D$�D$�H�=�X H�5�(E1�����>L�GA���uL�T H�5�)E1�I�;���1�H�L$H�T$H�5+�����tlD�L$A���A����w�|$XvL�T H�5H)E1�I�:�_��H��������?Mc�H�\$0H�I��H9�~H�T H�5`*H�8�(�E1��I��1�H�H���o��I��H��t�H������Hc|$E1�1�H�
.9L�L$ H�L$�<�H9ӋL$�E��tD����E�!I��D����Lc�L��8A��C�y
�D$���XA�XAOʉL$A��A����@��t�@��t	A��A�D�@��t����|$�49E��t)ω����~
�D$�������A����AL�t$HcL$L�\$A�<�A��u	�L$�,�<A��u
D�\$fD��)A��u�D�T$D�T�L$�l�
�t$���4L�����T$1�L��H�=�'���I�I��uL�����H�|$(tH�����H�T$xdH3%(L��t���H�Ĉ[]A\A]A^A_���AW�AVI��H�R�AUATUSH��H��dH�%(H��$�1�H�l$@H���H��wH�;1�H�������t'����L��H�=�&�����u���CH��������u$H�H��%H�5�%1�H�=�&�%���H�sH�-uQ H�~H9��ZH��������JH�{����D$��tL�CI�xH9�u�'���H��t��2H���^�����H�{�����D$��tL�KI�yH9�u�����H��t���H���������H�{����D$ ��tL�S I�zH9�u��|��H��t��H������A�ą���H�{ �V��A�Ń��tL�{(I����:��H��t��lL�[0I�{H9�tEH�����A�ą�u6H�{0����D$��tI��u�n���H��t��(L�c8I�|$H9�uL��O H�58&1�I�8�&���H���)����u�H�{8���A�ă��u���H��t
���D$�\$�˃�w!�|$4H�=�S H�5�$1������H�=�S H�5S#1�����������|$9D$~H�=�O H�51&1�H�?����\D�t$D�t$�|$~E��yH�=,S H�5%&1��N���+H�D$PIc�H�H��H��tH�=S H�5�"�$��1���|$ ~E��D$ E��H�=�R H�5$1�������A��D���tA����D��D��A���D$$�D$�D$��t	����؉���Lcl$�D$�D$4J��H������H��H�D$����H�|$H��tH��u���1��GH�L$PL;=[N H�L$(uaD�L$$E1�A��D�L$4L�\$B��C��I��D9T$�D$ �A��A��H�D$(H�H��I��H���1�1��k��H���MI����uL��M H�5�"1�I�8�����1�H�T$4L�D$8L��H�
�M H�5�$�'�����}H�|$8E1��2��L9�tRH�=fQ H�5�"1�����SJ��H��1�H�H�5�$HT$�������'I��D9|$����H�|$8L�����H�p���u�H�-�L H�5K$H�}1������H�@�Ic�Hct$$H�H��H�xH��������H�H��H�H��H9�~H�
�L H�5#1�H�9�����H��H��1����H��H��t̋D$H��|$�D$D��|$A���a��H�t$@LcD$�L$H�|$I��D�L$$�|$4��M����Hc|$���H�D$8H���L�t$L�%� B��C�4�L��1����H�|$8L��I��H������D9l$����H����H������H��I)����L��H���F��H�MI��uH���U��M����H�L$8�T$41�L��H�=!���H�|$8H��H�u� ��I��gL������Z�*l$E1��A*�f(��X�B��B����u����3��u����&��uD�V�VA����D�D�D����B���B*�L��D*�fD(��DY��DY��EX��D^��A,�B��I��D9\$�v���I��DL$4�g����A*�H�\$1ҋD$4H�\$E��Lc��B*�A)��*��B*��A*��Y��Y��X��^��,���u��A��0��u	��fA��"��uA�����A��A�E�WA�G�A�M��9T$�y���D)t$4x1��k���H�\$���1�H�|$���H���~��H�|$Ht
H�|$@�,��H��$�dH3%(H��t�1��H�Ĩ[]A\A]A^A_���AU�ATUSH��H��hdH�%(H�D$X1�H��H���H��uH�;1�H���N����t'�MH�ֹ�H�=������u��+�CH���V����u%H�H�:E1�H�5BH�=�����UH�SL�-I H�zL9�tGL���1����u;H�{���A�ă��tH�sH�~L9�u����H��t��L�������tL�-�H H�5�E1�I�}������H�{�
��I��H��u�M��H��H��t!�ZH�����I�MH��uL���	��H���t�H�|$D�������t*H��xH�D$Mc�H�I��H9�|H�=$L H�5��H��E1��[L�$A��uE��?A��uE�Y�2A��u$L�[C�TG�TC�<��A��A�A��I��E�Ic��[��I��H�|$tH�����H�T$XdH3%(L��t���H��h[]A\A]���AT�I��USH��`dH�%(H�D$X1�H��H���H��uI�<$1�H���%����t!�NH�ֹ�H�=������u��/�CH���3����u&I�$H�H�5!H�=����E1��I�T$H�5�F H�zH9�uH�-�F H�5�E1�H�}�����������Ņ�u�I�|$�p��A�ă��t%H�|$D���;����t�H�D$Mc�L�$W�E1��'�>��H��t��s���A��uA�1�*��X�M�M�I9�|��@A��u
A��*���A��u#A�qA�IA�9A���A��D���*���A*�H��tH�I���H*��^��-���,�Hc����I��H�|$tH�����H�\$XdH3%(L��t�&��H��`[]A\���AW�AVAUATUH��SH��dH�%(H��$�1�L�d$@H��L��L�d$(�uH�t$(H�}1��8����t$�H�ֹ�H�=������u��cH�|$(�C�A����u%H�MH�$H�5/1�H�=������H�UL�-�D H�zL9�uH�-�D H�5H�}���1��L�������u�H�}����Ã��tH�}L9ou�_�\$�-�^��H��t������f.�/�D$zu
�;��H��u�H�}L9ou
�o�l$ �%���f.z/�D$ zu���H���]���H�|$P���������I���Lc�H�5)L��(I��������?F�<�H�t$PG�4�L9�~H��C H�5;1�H�;����H�1��R��H��H������A*�H��E1�E1��A*��|$�D$���N�(I��L�T$0L;|$P�LL�\$@K�#��uD��A*��:��uD��A*��*��u!C�L#C�T#�0��������*���*�D$�Y�f/D$w�>.�XT$f/�v�D$��D$�L$8�)���D,��D$8�YD$ f/D$w�D�-�DXD$fD/�v�D$��D$D�T$8�������L$8�,�uC�~C�T~�O��u
fC�~fC�T~�=��u+��C�~��C�L~��C�T~��C�D~C�L~C�T~�
L�\$0C�~C�{M�M����H�|$Ht
H�|$(�m��H��$�dH3%(H��t�r��H�Ĩ[]A\A]A^A_���AW�AVAUATUH��SH��dH�%(H��$�1�L�d$@L���H��uH�}1�L�������t$�H�ֹ�H�=2������u��a�CL�������u&H�MH�pE1�H�5xH�=������H�UL�-8A H�zL9�uH�A H�5YH�;�I��E1��L���I����u�H�}�����Ã��tH�}L9ou�W�T$�-���H��t�����f.�+�D$zu
���H��u�H�}L9ou
�g�d$�%����f.�+�D$zu�N��H���\���H�t$@L�l$PH�t$(L���������;���L��Lc�H�I����H��tH�=:D H�5E1��[���L��A�L�%1�H��C*4�L�
�$I���t$�C*<��|$ H���x��I��H������H������D�H�L$(I��Ic�I9��3��u�D�Y�*��A*��d��uD�	D�Q�A*��A*��J��u;�QD�I�AD���A���qA��Q��E���A*����*��
�*�B*1�YD$�YL$�X�f/D$w�DO*�DXD$ fD/�v�D$ ��D$H�|$8L�D$0H�L$(�/��H��L�D$0H��D,�H�|$8H��H�L$(��I�4uD��,��ufD��!��uD��D�A����E�LA�T�D�H�H�����H�|$HtL������H��$�dH3%(L��t����H�Ĩ[]A\A]A^A_���AW�AVAUATI��USH��dH�%(H�D$x1�H�l$ H���H��uI�<$1�H��������t!�NH�ֹ�H�=��B����u��/�CH��������u&I�$H��H�5�H�=f�M��E1���I�T$L�-�= H�zL9�uH�q= H�5�E1�H�;����L�������u�I�|$�,���Ã��tI�|$L9ou�W�$�0�	��H��t���}��f.](�$zu����H���a���H�|$0��������M���Lc�H�5�!L��!1��B*$�H�t$0�C*,��d$�l$�U��I��H������H��E1����I��1�H;D$0��L�L$ O�)��uE��A*��>��u
A�2�*��/��u%C�L)C�|)A�A���A��D���*���A*�Y$f/D$w�
b'�XL$f/�v�D$��D$H�D$�N����H�D$�,�uC�/�+��ufC�/���u��C�/��C�L/C�T/�C�/L�M�����H�|$(tH�����H�\$xdH3%(L��t���H�Ĉ[]A\A]A^A_���U�H��SH��hdH�%(H�D$X1�H��H���H��uH�}1�H���,����t!�NH�ֹ�H�=������u��/�CH���:����u%H�MH�H�5(H�=����1���H�UH�5�: H�zH9�uH�
�: H�51�H�9���������u�H�}�~���Ń��t*H�|$���K����t�L�L$Lc�L�$H���E1��*�H��H��t��v�����uA���9�tH��M�M‰�M9�|��%��u	A����܃�u
A�B����A������B��H��H�|$tH���_��H�\$XdH3%(H��t�g��H��h[]���AT�USH��H��`dH�%(H�D$X1�H��H���H��uH�;1�H�������t'�H�ֹ�H�=R������u����CH�������u$H�H�}
H�5�
1�H�=����AH�SH�5F9 H�zH9�uH�=9 H�5g1�H�?�U����[����u�H�{���I��H��u����H��H��t!�CH�����I�$H��uL�����H���t�L�T$L�$L�׃�tH�=�< H�5R
����1��I�H��x
1�W�L9�~H�=�< H�5R1�����sH9�~A�HH���*��Y��X���H�4f(�A�I)�L�M9�7B�DN�G�\H��*��A*��Y��Y��X��\�f/�vf(�L��I�����3��H��H�|$tH���P��H�T$XdH3%(H��t�X��H��`[]A\���ATI��H�ֺUH��SH��dH�%(H��$�1�H�l$PH��H���H��H���H��uI�<$1�H���f����t$����H�=P
������u���CH���q����u&I�$H�TE1�H�5\H�=
�����I�|$1�H�������ub�CH���'����u'I�L$H�	E1�H�5YH�=�����H�D$`�uH�t$I��A��tH�=�: H�5Q����E1��}H9�tH�=�: H�5�E1������`L�$H�1�W�H9�~A�zH���*��Y��X���L�L$PW�L9�~ G�AC�BI���A*��*��Y��X����^���I��H�|$XtH���p��H�|$tH���`��H��$�dH3%(L��t�e���H�İ[]A\���AV�AUATI��USH��`dH�%(H�D$X1�H��H���H��uI�<$1�H�������t$�H�ֹ�H�=������u��b�CH�������u&I�$H�s	E1�H�5{	H�=[����I�T$H�5:5 H�zH9�uH�
5 H�5[H�9�K���E1���N����Å�u�I�|$����A�ă��tH�|$D�������u��访��H��t��L�L$Mc�M9�1��c���I���'H�<$A��u��E1�E1�W�A��VA��u
����A��u �G�W�D�������D�빋L���A��u�4E��9�uHL�E���I9���A��u�4��A��u�D�tA����A��D��붋4���A����E��D9�u�E��t*9�}
)��H*��X��A��A)��I*��X�A�‰��v�����A��i���1�E��t�A*��^��H,؉�����I��H�|$tH���Կ��H�\$XdH3%(L��t�ܾ��H��`[]A\A]A^���AV�AUATI��USH��`dH�%(H�D$X1�H��H���H��uI�<$1�H�������t$�H�ֹ�H�=	�Y�����u��b�CH��������u&I�$H��E1�H�5�H�=��a����I�T$H�5�2 H�zH9�uH�=�2 H�5�H�?���E1��Y�Ľ���Ņ�u�I�|$�D���A�ă��tH�|$D��������u���$���H��t��L�\$Mc�M9�1��ٽ��I���L�$A��uA���=A��uA���,A��u A�QA�AE�����кD��A�L��E1�A�1�I9���A��uA��4A��uA��'A��uA�tA�L�����A�4��A�E��9�t>@��A��@��E��D9�u)��tA��E)�D9�}E��A)�D9�A��IB��A���L�E�����d���賻��I��H�|$tH���p���H�\$XdH3%(L��t�x���H��`[]A\A]A^���U�H��SH��hdH�%(H�D$X1�H��H���H��uH�}1�H��蝻����t!�NH�ֹ�H�=e�����u��/�CH��諻����u%H�MH��H�5�H�=0�	���1���H�UH�5W0 H�zH9�uH�=/0 H�5x1�H�?�f�����l�����u�H�}����Ń��t"H�|$��輼����t�L�L$Lc�L�$1�1��&���H��t�끃�uA��1�)�9�HB�L�M�L9�|��/��uA��݃�uA�RA�BA�
�������A������H��H�|$tH���һ��H�\$XdH3%(H��t�ں��H��h[]���U�H��SH��hdH�%(H�D$X1�H��H���H��uH�}1�H��������t!�NH�ֹ�H�="�f�����u��/�CH��������u%H�MH��H�5H�=��q���1��H�UH�5�. H�zH9�uH��. H�5�1�H�8�κ�����Թ����u�H�}�W����Ń��t$H�|$���$�����t�H�D$Lc�L�$W�E1��*�'���H��t��|�����uA�1�*��Y�M�M��X�I9�|��>��u
A��*��܃�u#A�qA�IA�9A���A��D���*���A*�1�H��tH�I���H*��^��3����H,��G���H��H�|$tH������H�\$XdH3%(H��t����H��h[]�1��4f.�@H�=q1 H�j1 H9�tH�V- H��t	�����H�=A1 H�5:1 H)�H��H��H��?H�H�tH�- H��t��fD�����=�0 u+UH�=- H��tH�=v) �ٷ���d�����0 ]������w������U��H�=?0 SQ舸��H���
���H��H��褷��H��H����1�1�H�=����H�q0 H��tH��H�5�H���ʶ��H��Z[]���H��H���Size should be 1, 2, 3 or 4not a whole number of framesbyteswapcontiguous bufferargument 1reverselin2linlin2alawalaw2linlin2ulawulaw2linbiasaddargument 2Lengths should be the samefindfitStrings should be even-sizedFirst sample should be longer(nf)minmax(ii)lin2adpcmstate must be a tuple or Nonebad state(O(ii))adpcm2linratecv# of channels should be >= 1sampling rate not > 0illegal state argument(O(iO))getsampleIndex out of rangeavgtostereotomonomulcrossfindmaxInput sample should be longerfindfactorSamples should be same sizeavgppmaxpprmsaudioop.erroraudioopinteger argument expected, got floatnot enough memory for output bufferii;lin2adpcm(): illegal state argumentii;adpcm2lin(): illegal state argumentwidth * nchannels too big for a C intweightA should be >= 1, weightB should be >= 0iO!;ratecv(): illegal state argumentratecv(): illegal state argumentii;ratecv(): illegal state argumentratecv($module, fragment, width, nchannels, inrate, outrate, state,
       weightA=1, weightB=0, /)
--

Convert the frame rate of the input fragment.byteswap($module, fragment, width, /)
--

Convert big-endian samples to little-endian and vice versa.reverse($module, fragment, width, /)
--

Reverse the samples in a fragment and returns the modified fragment.getsample($module, fragment, width, index, /)
--

Return the value of sample index from the fragment.tostereo($module, fragment, width, lfactor, rfactor, /)
--

Generate a stereo fragment from a mono fragment.tomono($module, fragment, width, lfactor, rfactor, /)
--

Convert a stereo fragment to a mono fragment.lin2adpcm($module, fragment, width, state, /)
--

Convert samples to 4 bit Intel/DVI ADPCM encoding.adpcm2lin($module, fragment, width, state, /)
--

Decode an Intel/DVI ADPCM coded fragment to a linear fragment.lin2lin($module, fragment, width, newwidth, /)
--

Convert samples between 1-, 2-, 3- and 4-byte formats.lin2alaw($module, fragment, width, /)
--

Convert samples in the audio fragment to a-LAW encoding.alaw2lin($module, fragment, width, /)
--

Convert sound fragments in a-LAW encoding to linearly encoded sound fragments.lin2ulaw($module, fragment, width, /)
--

Convert samples in the audio fragment to u-LAW encoding.ulaw2lin($module, fragment, width, /)
--

Convert sound fragments in u-LAW encoding to linearly encoded sound fragments.bias($module, fragment, width, bias, /)
--

Return a fragment that is the original fragment with a bias added to each sample.add($module, fragment1, fragment2, width, /)
--

Return a fragment which is the addition of the two samples passed as parameters.mul($module, fragment, width, factor, /)
--

Return a fragment that has all samples in the original fragment multiplied by the floating-point value factor.cross($module, fragment, width, /)
--

Return the number of zero crossings in the fragment passed as an argument.findfactor($module, fragment, reference, /)
--

Return a factor F such that rms(add(fragment, mul(reference, -F))) is minimal.findmax($module, fragment, length, /)
--

Search fragment for a slice of specified number of samples with maximum energy.findfit($module, fragment, reference, /)
--

Try to match reference as well as possible to a portion of fragment.rms($module, fragment, width, /)
--

Return the root-mean-square of the fragment, i.e. sqrt(sum(S_i^2)/n).avgpp($module, fragment, width, /)
--

Return the average peak-peak value over all samples in the fragment.maxpp($module, fragment, width, /)
--

Return the maximum peak-peak value in the sound fragment.avg($module, fragment, width, /)
--

Return the average over all samples in the fragment.minmax($module, fragment, width, /)
--

Return the minimum and maximum values of all samples in the sound fragment.max($module, fragment, width, /)
--

Return the maximum of the absolute value of all samples in a fragment.������������������������������������������������	

"%)-27<BIPXakv��������3Qs��� V��l�$���V��	�
��L�L�T���!%�(�,[1K6�;�ADH~OqW/`�ibt����������������������������������������������ÄńDŽɄ˄̈́τфӄՄׄلۄ݄�������������������D���D���D���D���D��D��D��D����$�d����$�d����$�d����$�d��������4�T�t��������4�T�t���������������,�<�L�\�l�|�����������������������|}|y|u|q|m|i|e|a|]|Y|U|Q|M|I|E|A|>|<|:|8|6|4|2|0|.|,|*|(|&|$|"| ����������������<�<�
<
�<�<�
<
�	<	�<�\��\��\��\��lL,����lL,����tdTD4$��������xph`XPH@80( �����������������@���@��@���@���@��@��@��@���������������������������������˨�����������(�8���h�x�H�X�������������(�8���h�x�H�X���� �`���� �`���� �`���� �`�P�p��0�����P�p��0����������������������
@
�@�@�	@	�@�@�@�
@
VR^ZFBNJvr~zfbnj+)/-#!'%;9?=3175XHxh8(��������XHxh8(��������` ��` ��` ��` ������0pP����0pP?�����?�������?�;�� 0���Hp���`����xQ����P��������4;���pQ����{��������$޲��h
����1����ݺ��Ǿ��h������;��<��p����t��6��T������������a�,��p]��+���zRx�$����PFJw�?:*3$"D��@\���LDG0t<����F�F�D �D�| AAB8������F�G�A �D(�D��(A ABBH�`����F�G�B �B(�D0�A8�D��8A0A(B BBB80¥��=F�G�A �D(�D� (A ABB8lç��F�G�A �D(�D��(A ABB8�����*F�G�A �D(�D�
(A ABB8�����F�G�A �D(�D��(A ABB@ e���MF�G�B �D(�A0�D�,0A(A BBBHdn���,F�B�B �B(�A0�A8�U��8A0A(B BBB8�N���'F�B�L �D(�G�(A ABB(�9����E�I�D��AAH�����F�G�B �B(�D0�A8�G��8A0A(B BBBHdW����F�G�B �B(�A0�A8�J��8A0A(B BBBH���F�G�I �B(�A0�A8�J�V8A0A(B BBB8�	��*F�G�A �A(�G�
(A ABB08����F�I�A �D�� AABHl����F�G�B �B(�A0�D8�G��8A0A(B BBBH����F�G�B �B(�A0�D8�G�|8A0A(B BBBHd���F�G�B �B(�D0�A8�G��8A0A(B BBB(P����E�I�D��AA0|H��F�F�A �G�� AAB0�%���F�L�D �G�� AAB@�����F�G�B �D(�A0�D�i0A(A BBB@(-��dF�G�B �D(�A0�D�C0A(A BBB(lM���E�I�D��AA(�����E�I�D��AA$�0�mE�M�A WAAzRx� �� ��GNU�c�bX� Ufp��
�cH� P� ���o``�
�p� `h��	���o���oH���o�o�
���oS`�  0@P`p�������� 0@P`p�������� 0�e�^�@t�dA4��speKH�`s�eq\��r�e�Y�`r�em`��qbd1�`q�e�U��p�e�W�`p�eFT��o�e�Q�@o8d�-��n3d�+� n*d�)��m!da'� mdK%��ld#� ld` ��k�d�9� k�d�5��j}e�M� jte#J��iSe!F� i�ca��h�c�� h�d�=��g�e��������� GA$3a1��caudioop.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug�e��7zXZ�ִF!t/��oO]?�E�h=��ڊ�2N��� ���Cr��jf��y�򸗨��F{�8�.�V?w̜m�_�g���ǀ�����02�v���c����{T�)+��oΏ�ߡ��F����qؙ��L����RO���\]Xs/�%��IJ<������������[ԑ�@f�zo.��ҭ�]ף�Z
M�4��B�%�L��>>��>dIB��z}���cb5sG�]��3�~�q7hX����k�:ε�p�;�B���)Z�۝cչs\��J��
f�u�Y�D��.�n/-@��3U�#�
�Y&C���3�G�<Q�0nlv�,�!T7�h��b���
3?�����s�ecs3U^K�R�Ԩ�����(:�Z/Y���mԍ�����	���<��8��7E	͞������R�uJ�o*ܜ��"F?buwV ��_?jĚ�(03�,{5c�Yq�Y6�&rtC���P�qLa���8��_�5��ίV��H���y󙤀�<��^ ���F��;��f{>�d��R(�m�Sޛ2�Lp���
�V1o�#a�R�wE�=Pü��Qn&5�����t5)�|�{s�=�r^ 
i:�;z0@>&'��G��~�
�u���t��*ZS'.�י�P�O��5���Bm�������M�"�(���H_��M�ÓYBo%��VB�
"�Zi�e#ݡ:@�ԛ���.Y��>ć��Z6-��"s)�$��p��gc��=|�4�Y�&����r�	@*����NƐ�!ŋ�\�iKV�����"�@�w�
K�n���)�~I'k��.AQYT��p���O�T��n����I\�)⬐ٰ�}w\��
e�j��������G�!gf���}��ٸ���V=���(��E�/{��"R�S#@=k[���$qœ������вb.��=\m|,A$��{�yRU�0yC���aC�Tʠ����SY�DKw���P��tN� �H�P:+</�\B��n�����^�� K#BѰR�Z��2�L���061�E��b\���΍M��
)=m��MU�w��8��k�h\��>�}������������4;n��;�������$ƌ�6��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(���0``�8���o�
�
fE���oHHPT���^Bhh`h��c��Pn@@@w���F}�c�c
��c�cp �{{�||�8�8� �H� H��P� P��X� X��`� `��p� p���� �� �ȓ ȓ�ؓ`ȓ$
�`L��ܘ(lib-dynload/_lsprof.cpython-38-x86_64-linux-gnu.so000075500000050740151153537510015563 0ustar00ELF>�@�J@8	@�5�5 �<�< �< �� �<�< �< 888$$�5�5�5  S�td�5�5�5  P�tdP1P1P1��Q�tdR�td�<�< �< ��GNU�5,`�:�7�/:p���-�@2%�-13|WʚU��|CE����	�qX�=ʚ�����6 �T'�� , �F"n>Q�1��`���	������y�P�epl#� ?j#L� H �`D � '��`D �)__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6PyArg_ParseTupleAndKeywords_Py_Dealloc__stack_chk_failPyMem_FreePyEval_SetProfile_Py_NoneStructPyObject_CallFunctionPyList_Append_PyObject_MakeTpCall_Py_CheckFunctionResult_PyTime_FromNanosecondsObject_PyTime_FromSecondsObjectPyErr_WriteUnraisablePyInit__lsprofPyModule_Create2PyModule_GetDictPyType_ReadyPyDict_SetItemStringPyStructSequence_InitType2PyModule_AddObjectRotatingTree_AddRotatingTree_Get_PyTime_GetPerfCounterPyExc_MemoryErrorPyErr_SetStringPyErr_FetchPyMem_MallocPyCFunction_TypePyModule_TypePyModule_GetNameObjectPyErr_ClearPyType_IsSubtype_PyUnicode_EqualToASCIIStringPyUnicode_FromFormatPyUnicode_FromString_PyType_LookupPyObject_ReprPyErr_RestoreRotatingTree_Enum_PyTime_FromSecondsPyList_NewPyType_GenericAllocPyType_GenericNewPyObject_Free_edata__bss_start_endGLIBC_2.4GLIBC_2.2.5vii
�ui	��< '�< �&�< �<  @ �((@ �)0@ �(8@ *@@ �(H@  *P@ �(X@ �(`@ �(h@ H*p@ �(x@ �(�@ �(�@ x*�@ �(�@ �(�@ �(�@ �*�@ �(�@ )�@ �(�@ �*A #)A �$A �, A 3((A �8A �+@A ,)HA XA `+`A 4)hA $xA  +�A :)�A �@ �A T)�A  @ B |)B �) B �D PB �)XB ~(�B �)�B �)�B �)�B ~(�B k)�B $pC �/�C A �C ��? �? �? 
�? �? �? �? �? $�C *�C D !�> �> �> �> �> �> �> 	�> 
�> �> ? ? ? ?  ? (? 0? 8? @? H? P? X? `? h? p?  x? "�? #�? %�? &�? '�? (�? )�? +�? ,��H��H�a* H��t��H����5*) �%+) ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!���������%' D���%�& D���%�& D���%�& D���%�& D���%�& D���%�& D���%�& D���%�& D���%�& D���%�& D���%�& D���%�& D���%�& D���%�& D���%�& D���%�& D���%}& D���%u& D���%m& D���%e& D���%]& D���%U& D���%M& D���%E& D���%=& D���%5& D���%-& D���%%& D���%& D���%& D���%
& D���%& D���%�% D��SH��H��H��H�
�( H�� dH�%(H�D$1�H���$H�D$H�D$�D$P1�H�T$RH�L�L$L�D$ ����Z��Y��tV�|$u�c(��~�K(�<$u�c(��~�K(�D$H�L$�C8H��tH�H�{0H�K0H��t
H�u���1�H�L$dH3%(��t�N���H�� [���P����1�Z���SH�
�' H��H��H��H�]
H��dH�%(H�D$1�I��L�D$�D$�����$�����.�����1���tB�|$u�c(��~�K(�<$u�c(��~�K(H��H�=����H��$ �K(H�H�L$dH3%(t���H��[���ATI��U��S�H*W �H*G�NH�5�H�H�O(L�G0H�=A) H�P��Y��Y����H��tI�|$H��H���I���H���uH���J�����[]A\�AT1�I��UH��SH��H�dH�%(H�D$1�H�CH�P8���t	H�H��uH��1�1�����H���H��1�1���H��1�H���O���H��H��tB�A$W�H��f/�v
H���}���A���
1�H�����A��H�uH�����H�$E��yH�}���1�H�L$dH3%(t�E���H��[]A\�1��?��H�H��tH�xH�H9s�H�x��W�FH�7����=�' wi# ����" �y' �
s' H��ʃ����b' ��t H����H90��H�xHGxH����H��twD��" E1�E1�L�I9�uE��t�' E����D��" Ã�w
Ai�A�A��A����A��I9�vH�HH��u �	H�HH��u:��& E��tD�A" 1��E��uL�QL�PH�AH�A�H���t���H�x��E��uL�YL�XH�AH���H�x���AUI��ATI��USH��H��H�0tH�w8H�0��������I+EH��I+EH�D$I�EH��tHhI�D$H�K@uHk �H�C8�~D$K(�f��K(A�D$(t6H��t1H�xH��H��H�J���H��tH�H8uHh�H�@0P f��@ H��[]A\A]�UH��SRH�]H��t(H�SH��t
H��H�������H�CH�EH��������X[]���S1�H���g(�1����H������C(��rH��  H�� -H��  H�5j
�C(H�:����1�[�USRH�oH��t5H��H��w���H��tH��H��H������H�EH�CH�S H�UH�k X[]�AWI��AVAUI��ATUSH��H��8dH�%(H�D$(1�H�T$H�t$H�|$ ���H�{L��H�|$���H��H�����P���H��H���vH�� I9EtI�EL���iM�uM����M�e M��tgI�|$���tI�$�.H�5v H9�uL����I��H��u�����0�=�����u��%H�5�L���������I�$uL�����M�UH�=�1�I�2�m����I�UH�:�,���M�e H��u�^���M��M�Eu[�~I�~H��H�D$���H�t$H��I��tH�H�uH������M��t�L�����I�uL��H�D$���H�D$H��uV�M�L$A���tI�L��H�=�1������I�0H�=1����H��u���H���R����K(��L�}W�H��H�{H�EH�E@H�EHE E0����L�s M��t
I�~H�{ �� ����I��H��t�H�CI�nI�FI�FL�sH�E@�C(t`H��t[L�`H��I��HL������H��H��u<�@�v���H��H��u	�K(�%H�(W�H��L��H�@8HH(�_���H�A8H�{0tH�s8H�{0�i�������I�H�T$H�t$H�|$ ���H�D$(dH3%(t>�I���M�]1�L��H�=�I��a���I�$�����L��H�D$�J���H�D$���H��8[]A\A]A^A_�����wo��APL��Ic�L�>��H�v H������HH�v �1����=�G(t7L�
� L9Iu*H�qH���U�����G(tH�5� H9qu	H�q��1�Z�1����AUATI��UH��SH��QH��t)H�{H��L��������uL�kH��H��A��L��t��1�Z[]A\A]�SH��H�1�H�5����H�{H�CH��t
���H�CH�{ H��tH�GH�C �����[���P���H�� H�Z���SH���G(t	1�1���H�����H���u���H�{0H��t
H�u���H�CH��[H��@����SH��H�H1�H�5.������H�{H�u��H���;�1�[���SH��H�� dH�%(H�D$1��G(��r	H�0u$�2-H� H�5��G(H�:�{�1��u�G8W�f.�z%u#��]��=�H*��^��\$��D$1��g�H�$H��t%H�{H��H�59�%���H�<$��tH�u���1��H��H�L$dH3%(t�}�H�� [���ATE1�USH�0��H�HH��H��t;1����H�CH��t%H�}HH��H�5���������t"H�{H�u�O�A���~H� H�H�F�H*U(�KH�=�  �H�M0H�UH�5�H*E L�E8L�K�Y��Y��M�H�{H��H�u���H��t�H�;H�����H�MA��uH�����D��[]A\�H�=� H�� H9�tH�V H��t	�����H�=� H�5� H)�H��H��H��?H�H�tH� H��t��fD�����=� u+UH�=� H��tH�=� �I��d����] ]������w������U��H�=� SQ��H���s���H��H���$�H�=m H���e���Q���H�V H�5H���7�=@ u2H�57 H�=� �K������H�5� H�=5 �0��xMH�� H�5�H��H�� H� ���H�� H�5ZH������ H��Z[]�����H��H���|Odii:Profiler|ii:enable((Olldd))<%U.%s><%s><built-in method %S.%s><built-in method %s>builtins((OllddO))codereccallcounttotaltimetotal time in this entryinlinetimedetails of the callshow many times this is calledtotal time spent in this callgetstatsdisableclear_lsprof.profiler_subentry_lsprof.profiler_entry_lsprof.Profiler_lsprofFast profilersubcallstimertimeunitmemory was exhausted while profilingcode object or built-in function namehow many times this was calledhow many times called recursivelyinline time in this entry (not in subcalls)called code object or built-in function namehow many times this is called recursivelyinline time (not in further subcalls)
���c���c������&���G���G���clear()

Clear all profiling information collected so far.
disable()

Stop collecting profiling information.
enable(subcalls=True, builtins=True)

Start collecting profiling information.
If 'subcalls' is True, also records for each function
statistics separated according to its current caller.
If 'builtins' is True, records the time spent in
built-in functions separately from their caller.
getstats() -> list of profiler_entry objects

Return all information collected by the profiler.
Each profiler_entry is a tuple-like object with the
following attributes:

    code          code object
    callcount     how many times this was called
    reccallcount  how many times called recursively
    totaltime     total time in this entry
    inlinetime    inline time in this entry (not in subcalls)
    calls         details of the calls

The calls attribute is either None or a list of
profiler_subentry objects:

    code          called code object
    callcount     how many times this is called
    reccallcount  how many times this is called recursively
    totaltime     total time spent in this call
    inlinetime    inline time (not in further subcalls)
Profiler(timer=None, timeunit=None, subcalls=True, builtins=True)

    Builds a profiler object using the specified timer function.
    The default timer is a fast built-in one based on real time.
    For custom timer functions returning integers, timeunit can
    be a float specifying a scale (i.e. how long each integer unit
    is, in seconds).
�?;� ��P�p�(X�Tf�l�����d�0k�D��X��lv�������J���\�tf��������I�)�8����zRx�$0�0FJw�?:*3$"D8� (\@��E�T0u8H@W8D0uA���EH����E�[ �A(���vF�D�D �dAB,����B�F�D �D0� AAB(���E�M�A �
AAAzRx� �� ,�x�)�4� 4�@��B�E�D �A(�G@�(A ABB$���;A�D�A rAA��TE�N$�EA�A�A AAHD2�UB�E�B �E(�A0�A8�Gp38A0A(B BBB�;�{Mj4���LF�B�D �D(�D0q(A ABB���NA�L���EP��KE�}0�4E�nL)��E�G0�A(l���F�D�A ��ABGNU�'�&�< UfvP
(�< �< ���o`��
��> 0 �0	���o���o����o�oR���o7�< �������� 0@P`p�������� 0@P`p���(�)�(*�( *�(�(�(H*�(�(�(x*�(�(�(�*�()�(�*#)�$�,3(��+,)`+4)$ +:)�@ T) @ |)�)���������D �)~(�)�)�)~(k)@$�/A �GA$3a1P(_lsprof.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debugF,��7zXZ�ִF!t/���M]?�E�h=��ڊ�2N�+O> �.��G�'di҂��X��z�h��.��֒��>�z�S�3$���n*��]b��6os�=�"ɧGƦ`��8�S@���>O�B��V-��$����Q/�uՎ�hbU�|��	u� �z���_{��j톮ɷ5��C��b�@s�>��]�}���:\M�wZ�g)D6h�ȑhZI�O����w�V����k}t;��d����9e�j7�҂�/Ö�eS��,m��P��N��0�s�y�
Qbg	JBjEP�cV�m��X�hq&��i�t�S���rI"6��9�H�0�� ?�DP�{���Z��@����#S�,�Or.	G�H��AEޣ�9B%��m
i��e0�c�L�[��=��f����<2��21�N�;Oɼ#(y��*�O���_L�tj�uM�;��Y�&a�c
�H	i��S���כ���I�
d�Qs�
��)�y:m���N������=�J�nÿ���a�;����4���jc�1笖tHW�=�S���T�K��aV��U���C,}\Ǡ�]��W#�v�p�9N�4�9B4�{����ɒ7��<�:�}3�'t�X��%Z�y�'����x>2c��E��)d,�I	����i�-<JSbWD�r���[�F���x�۽�gP���u�t�j�?����~b�5V'vۥX��.�G���x�2\��C�Y�:�z��A$p��K��gO��}Y��)��?��p�R�U{z��-v�T./��Q���(��3�J�{`�Muck��I��������	�-~����8�C������(�if��M^�u.��5�<Ѵ��
]�`�O�bV��T^eO���T_Ii9�]dv�D�?�ɐ����i������G��1#�����Nd��σ~����a�4y��]u��QI`T�ÔQ<��r�S��P��"+yֻƒKfO#�Q��ԋ�h8C�ņ'�'N7E�H���•�C�4������n`m)#�UU���!?y�������4[��3��ZX��Yjq��'o�)l���Ҭw�M����$Q�s��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``@(���0���8���oRRhE���o��0T��0^B  0hPPcpp0n�� w��F}((
� ( (0	 �P1P1�� 2 2���5�5 ��< �<��< �<��< �<��< �<��> �>h�@ @` �`D `D� � H``D$
�D`�D�tI(lib-dynload/_crypt.cpython-38-x86_64-linux-gnu.so000075500000026400151153537510015413 0ustar00ELF>�	@�%@8	@(( PP P X` hh h 888$$  S�td  P�td44Q�tdR�tdPP P ��GNU��m�ݻ�Lj��y����@  ��|CE���qXs�Dl� � , F"����&�J�  7�  >�   __gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libcrypt.so.1libpthread.so.0libc.so.6crypt_rPy_BuildValue__stack_chk_fail_PyArg_BadArgument_PyArg_CheckPositionalPyUnicode_AsUTF8AndSizePyExc_ValueErrorPyErr_SetStringPyInit__cryptPyModule_Create2_edata__bss_start_endXCRYPT_2.0GLIBC_2.4GLIBC_2.2.5f `�]O�ii
Zui	dP X �` `   �  	
  �h  ��    � � � � � � � � � � 	� 
� � � 
��H��H�� H��t��H����5 �% ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a�������%� D���%} D���%u D���%m D���%e D���%] D���%U D���%M D���%E DL��$���H��H�$L9�u�H��� dH�%(H��$�1�H��I��H���L���x���H�=�H��1��G���H��$�dH3%(t�?���H������AUATI��USH��(dH�%(H�D$1�H��u2I�$H�A���u@H�H�5H�=?�%���1���H�ֹ�H�=�����u��^H�t$H���r���H��H��tII��1�H��L����H��L�H;L$u\I�L$H�Q���uH��H�5�H�=����1��RH�t$H������H��H��t�H��L����H��H��H;L$tL�� H�5TI�8�K���1��H���_�����H�T$dH3%(t���H��([]A\A]�f.��H�=A H�: H9�tH�n H��t	�����H�= H�5
 H)�H��H��H��?H�H�tH�5 H��t��fD�����=� u+UH�= H��tH�=n �����d����� ]������w��������H�= �+�����H��H���sstrargument 1embedded null characterargument 2_cryptcrypt($module, word, salt, /)
--

Hash a *word* with the given *salt* and return the hashed password.

*word* will usually be a user's password.  *salt* (either a random 2 or 16
character string, possibly prefixed with $digit$ to indicate the method)
will be used to perturb the encryption algorithm and produce distinct
results for a given *word*.;4`���P���x�����	���� ����zRx�$����FJw�?:*3$"D����� \����yH��Q
D��[8�M���LF�B�D �A(�DP4(A ABB�(���GNU��` Uft�@
8P X ���o`H�
px �h08	���o���o����o�o����oh p���������	
�����������  GA$3a1@E_crypt.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug���X�7zXZ�ִF!t/��g(]?�E�h=��ڊ�2N���> ��(	�c�xc��y8�3 \�	@,�%��d��+i��;�D��~-�w������ɭ'���4,���͞ED�|������b%�?��J�w��$�װ���u�'d�������;}�&Hy���y5�K%�k3�mԹ�T�-�[�J��n���ˢ�MR�
1��H+�0��B~��~oJ�Z3��Q����E�/�s�+f���X8�	�;q�G~�/�h�Q�_5w%L�9�R���3���1��uOAw���>^�kNQ
t/����e!y޹^)_�y �\g*Bn�@*[O<�P��®��$�Lz�S-~S�)0����������*��L�B��՟l��
c�:+΀���@���Jg�	`�lO�AK��n�t�@b�_Ȏ�$q���_�����
�$���!��>.\���	�:��P]��Ћ?�~��+�	�k���Z�,���>�7�,�]
5�9�����2z���Ѕ�^�'�^�Ԉ���?~a���uB�C�mѻۤ6�X�32!d�w�/fzF9~�@uY����	�_�C�����B�r4^k�zSYz�*O�������\���6����h�pq�K4=$�#���5iTy����߂g�'m+��8�I����<Ѓz*'�?��o
�8��j�{�"6���������
G��
��+Zqi� $�Cj��@�!F~4�p�Q��_���ҲP�pr��
+������|D�b;(�E�')�+�V7�!sH�rMlڌ=�.��W
]�I��L
i��m���S�Y'��s��N����g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(���0HHp8���o��$E���o��PT008^Bhh�h@@c``�n		�w�	�	�}88
�``� �4�88�� �P P�X X�` `�h h�x x��   � ��  � �� `� $
� `,!h�$(lib-dynload/zlib.cpython-38-x86_64-linux-gnu.so000075500000112740151153537510015056 0ustar00ELF>�"@��@8	@�l�l �z�z �z 
 
 �{�{ �{ 888$$�l�l�l  S�td�l�l�l  P�td`d`d`d<<Q�tdR�td�z�z �z GNUk�wg��V�3�hQ��VGFj=�B$=?��|CE���qXS�[��q�^6 ����P���r� ��A;�, C|�*F"I�1���0]�����Q���c����v/�d� Q� X� ��Id__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libz.so.1libpthread.so.0libc.so.6PyMem_RawFreePyMem_RawMalloc_PyObject_NewPyBytes_FromStringAndSize_Py_DeallocPyThread_allocate_lockPyExc_MemoryErrorPyErr_SetString_PyLong_FromNbIndexOrNbIntPyLong_AsSsize_tPyErr_OccurredPyThread_free_lockPyObject_FreeinflateEnddeflateEndPyErr_NoMemoryPyObject_GetBuffer_PyArg_CheckPositionalPyBuffer_IsContiguous_PyArg_BadArgumentPyFloat_TypePyExc_TypeErrorPyType_IsSubtypePyLong_AsUnsignedLongMaskPyEval_SaveThreadcrc32PyEval_RestoreThreadPyLong_FromUnsignedLongPyBuffer_Release__stack_chk_failadler32PyErr_Format_PyArg_UnpackKeywords_PyLong_AsIntPyExc_OverflowErrordeflateInit2_deflateSetDictionaryPyExc_ValueErrorPyThread_acquire_lockinflateCopyPyThread_release_lockdeflateCopyinflateSetDictionaryinflateInit2__PyBytes_ResizeinflatedeflatedeflateInit_PyInit_zlibPyType_ReadyPyModule_Create2PyErr_NewExceptionPyModule_AddObjectPyModule_AddIntConstantPyUnicode_FromStringzlibVersionPyModule_AddStringConstant_edata__bss_start_endZLIB_1.2.0GLIBC_2.4GLIBC_2.2.5f ��'i�ii
tui	~�z pD�z 0D{ {  { �O({ QM@{ �LH{ �OP{ �O`{ �Mh{ �Op{ �Ox{ �O�{ �O�{ QM�{ �L�{ �M�{ �L�{ �O� �O� �8� `T � N(� >8� S@� XOH� �7X� �R`� ]Oh� �0x� �R�� fO�� �7�� `R�� WMȀ 4؀ �V� N� M@��  V� XO� �7� �U � ]O(� b/8� �U@� fOH� �7X� �U�� sO�� OЁ �O � [L(� )'8�  a@� �OH� �DX� @``� �Oh� -)x� �[�� 8L�� w%��  [�� WM�� �F�� Z�� �OȂ �1؂ �X(� �O0� �a@�  � �� �{ �� WMȃ  { Ѓ �O� �O0� 5$� �� � �� �� @{ �� WM� `{ � �O8� �OP� U$� � ȇ �{ Ї �O� � � � � � � �  � +~ ~ ~ ~  ~ (~ 0~ 	8~ 
@~ H~ 
P~ X~ `~ h~ p~ x~ �~ �~ �~ �~ �~ �~ �~ �~ �~ �~ !�~ "�~ #�~ $�~ %�~ &�~ ' ( ) * ,  -( .0 /8 0@ 1H 2P 3X 4` 5h 6p 7x 8� 9� :� ;� <��H��H�yc H��t��H����5�a �%�a ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&�������h'��q������h(��a������h)��Q������h*��A������h+��1������h,��!������h-��������h.��������h/������h0�������h1��������h2�������h3��������%e^ D���%]^ D���%U^ D���%M^ D���%E^ D���%=^ D���%5^ D���%-^ D���%%^ D���%^ D���%^ D���%
^ D���%^ D���%�] D���%�] D���%�] D���%�] D���%�] D���%�] D���%�] D���%�] D���%�] D���%�] D���%�] D���%�] D���%�] D���%�] D���%�] D���%�] D���%}] D���%u] D���%m] D���%e] D���%]] D���%U] D���%M] D���%E] D���%=] D���%5] D���%-] D���%%] D���%] D���%] D���%
] D���%] D���%�\ D���%�\ D���%�\ D���%�\ D���%�\ D���%�\ D���%�\ D1����1��S�P���H����ƀ�1�H�=�)H��ǀ�Hǀ����H���H��t1�H�=�)���H���H��uH�u@H��1������6���H���H��u%H�uH�����H�f\ H�5�(H�8����1�H��[�ATI��US���H��u1��8H��H������H�H��uH���X���H���tI�,$������H��u���[]A\�SH��H����6���H���H��t
H�u����H���H��t
H�u���H���H��t
H�u���H��[�����S���H��t	H��Q���H��[���S���H��t	H��q���H��[�b�����AVI��AUI��ATUSH���G������H���I�.H��������H.H+oL�bL)�H9�~
�(������1�I�4,���H��u���H���H�x L��H�v �H��H�s�H���H���H�u���C�8��t4H�{I�6IuH)����H��t�H���H���H�u���1��L���I�xu���[]A\A]A^���AW�AVAUATI��H�R�USH��H��xdH�%(H�D$h1�H�l$H���H��wH�;1�H�������t!�M��L��H�=Y&�����u��.�CH���Y�����u%H�H�9&H�5D&H�=%&���E1���I��~VH�sH�~H�5�Y H9�uL�pY H�5�)E1�I�8������$�����u�H�{�'������u�,���H��t�1�L�|$ L�d$I��~G���M��A�����H�D$K�4<��L)�M9�~��M)���������D������H�|$A���;������D��L�����A��D������I��H�|$tH���~���H�L$hdH3%(L��t���H��x[]A\A]A^A_���AW�AVAUATI��H�R�USH��H��xdH�%(H�D$h1�H�l$H���H��wH�;1�H���I�����t!�M��L��H�=�$�
�����u��.�CH�������u%H�H��$H�5�$H�=�$���E1���I��~VH�sH�~H�5�W H9�uL��W H�5�'E1�I�8�\�����r�����u�H�{�u������u�z���H��t띻L�|$ L�d$I��~G���M��A�����H�D$K�4<��L)�M9�~��M)��������D����H�|$A��������D��L������A��D������I��H�|$tH������H�L$hdH3%(L��t���H��x[]A\A]A^A_�L��#�e���t���t!���t(��1�H�5�#�g���L�m#�:L�G#�.L��&�"��AWAVAUATUH��H��H��S1�H��dH�%(H��$�1�H��tH�YL�D$ 1�H�L��H��L�D$�uH��xH��H��u3WH��H��L�;\ 1�L�L$xAQE1�jj�F���H�� H��H����H���*H�uH��tNH�~H�5�U H9��j���A�ą��ZH�}�'����D$��t
H��u����H��t���D$����L�UM��tNI�zH�5�U H9���,���A�ą���H�}����A�ǃ��t
H��u��!���H��t��-A�L�]M��tNI�{H�5%U H9�������A�ą���H�}�k���A�ƃ��t
H��u�g����H��t���A�L�mM��tFI�}H�5�T H9�tU�v���A�ą�uIH�}����A�Ń��t
H��u��o���H��t��{A�H�U H��t`H�zH�5sT H9�uH�OT H�5�$H�;1�����A������u�H�} ���A��t
H��u�����H��t��E1�H�}(H�t$1���������H�|$�C�|�����ulH�M(H�[ H�5� 1�H�=�#����E1�A�A�A��D$�����(A�A�A��A�A��A�H�|$ t*A�����L9D$0vH��S H�5�#1�H�:����BH�=�Y �X���H��H���(H�
[D��E��E��H�L$�~D$H�kD��H�@`H�!H�= H�D$H�C�CD$CPjpW�t$H����ZY�������t%�����L�%�R H�5X#I�<$�?����ǃ�H�t$ H��t~�T$0H���
������t��tiL�JR H�5�I�;���BL�2R H�5lI�:����*L�
R H�5~I�9����H�{@H��"���H�uH���Z�1�H�|$(t
H�|$��H��$�dH3%(H��t���H�ĸ[]A\A]A^A_�ATUH��H�=�U S���H���EH����H����I����L�����H�uH�{�\���t$��tR���u6L�Q H�5h"I�8����H�,Q H�5�H�8����H�}@H�e"����H���H���H�H���H��t
H�u�J�H���H���H�H���H��t
H�u�#�H���H��tH�H���H���H��t
H�u��@���ǃ�@���H����s��H����e�H�uH����1�H��[]A\������ATUH��H�=�V S�\�H���EH����H����I����L���e�H�uH�{�(���t$��tR���u6L�P H�5� I�8����H��O H�5:H�8�i��H�}@H�!���"�H���H���H�H���H��t
H�u���H���H���H�H���H��t
H�u��H���H��tH�H���H���H��t
H�u��@���ǃ�@���H������H������H�uH���D�1�H��[]A\������AT1�UH��SH��`H���dH�%(H�D$X1�I��L�������tbH�T$�����H9�v#H��N H�5��H�:�$�L���<��0H�4$H�}�=�L����#��tH�}@��H�����H�L$XdH3%(��t�#�H��`[]A\���ATU1�SH��H��H��0dH�%(H�D$(1�H��tH�iH�H��uH��xH��H��u/PH��E1�L��Q 1�H�D$Pjj��H�� H��H����H����H�H��t\H�zH�5�M H9�uL�~M H�5�1�I�8����3���u�H�;���A�ă��tH��u�[�3�H��t��xA�H�kH��t?H�MH���H��tH�>u)H�=
M H�5�1�H�?���<1�A��1�H�=4Q �	�H��H���L�
�L�H�@`L�T$�~D$L�L$H�@�@D$@PH��tH�EH���H�{�pH��D�������t:��t���u�VH���ǃ���E����H���c�����yu�`H�uH����L�
L H�5n1�I�;���LH�uH���Z�H�L H�51�H�8���%H�{@H�����NH�uH���!�1���H�T$(dH3%(H��t��H��0[]A\���AWI��H��AVE1�AUI��ATUSH��H��dH�%(H��$�1�H��tL�qL�d$@�1�H�D$0L���H��uM��~I��M��u7PH��L��A�L��N 1�H��$�VL��jj�P�H�� I��H��tCI�}1�L�����Ņ�u/�CL���s���u%I�MH�RH�5]H�=]��1��M�I��u0H�D$8L�l$0M��y1L�=xJ H�5q1�I�?�'��aI�}H�t$0�<���u��I��������ME�L�D$���H����I���B�L����L�L$@L�|$PL�KM��tM��I���?~A�@L�T$L�\$8L�\$(I�L�T$ �����I9�IF�H�T$�L$�KH�D$8H��uL��1����H�D$8H���uE1��[L�C(H�� I)�M9�uKL;t$uM��������FL;t$ K�<6HO|$L�D$H��I��H�|$(��L�D$���L��A�����A��L)�L9�wE��E)�L�\$8D�S0K�T H�S(I���t�M������H�{�H�D$���H�|$���T��M��w�H��atB�{0�������u1H���t'H�������y��x��������tL+|$�����I�T$��L��H���T���xI��u	ƃ����t���tH�{@H������L�l$8H�s(H�|$8I�� L)������tH�|$8H��tH�D$8H�u��H�����H�\$8H�|$HtL�����H��$�dH3%(H��t���H�ĸ[]A\A]A^A_���������	������t��������L�oH�� I)�L9�tIH��M��L)����H9�wo��D)�Lȉ} H�EH����t��H������cE1Ƀ�H�� ��H��������H9�t�H��������?H9�~ H��H��L�������yH������H���I�$H��M��L)�H�� �g�����AW�1�E1�AVAUI��ATUSH��H��dH�%(H��$�1�H�l$0H��H���L�������D�CH���<���u"L��H�H�5RH�=��{��H�D$(A�����L�s���H����I���Z�L����H�t$(H�T$0L�l$@H�4$H�S�@M9�M��MF�D�cH�4$L���	H��H�D$xo�}�1�L��H�D$�>�H�|$�D$�@�D�L$H�T$A���uH�{@H��D���=	�(�{0t�M)�u�L�T$(H�s(H�<$I�� L)��G���tH�|$(H��tH�D$(H�u���H����j�L�|$(H�|$8tH���%�H��$�dH3%(L��t�:�H�Ę[]A\A]A^A_�H�IE H�5*H�8���H�|$(H��t
H�/�D1��H��$�H�����a��H�����t$H��$�H���?�H������H�MH�6H�5A1�H�=����AH�uH�~H�5�D H9����A�����H�}����ƃ����	�@�H����	1���
I��PH��H��A�1�L��$�APL�-L jj�d�H�� H��H���>	�L�aH�\$0�1�H���I��H�=9L H�5������DŽ$�����M)�E1���	��1��a
L�
�C H�5�1�I�9�F��D
1���H���r�L��C H�5�I�8���
L�%�C H�5�I�<$����L�4C H�5Z1�I�:����gH�uH��t@H�~H�52C H9��B������5H�}�{�A����=I���FH�}H�t$������
1��H�����U������D$x����E1�H)<$�<H�MH�%H�501�H�=.���I��PH��H��A�1�L��$�APL�JH jj��H�� H��H����	�m���L�aH�\$ 1��H�D$@H���I��H�<$��
H����H��$�H��D���o�H��$�H����T�iL�
�A H�5	1�I�9�g���
��H������������h	��AWAVAUATI��UH��SH��H��(dH�%(H�D$1�H��wH��0H�D$A��1ҹH��H�=��*���u��*I�$H�5AA H�xH9�uH�A H�5ZH�:��1��|�����u�I�<$�q�A�ă��u���H��u�H�D$�H�D$��u1�1�����2�4�H����I����L��L�l$����C�@L�sL��L���(H����H�D$���D��L��I����L���������H�T$tP�{0t���u<A��u6L���Z���tH�{@H����H�|$H��u[�lǃ��'��t#���tH�{@H�F���aH�|$H��u(�9H�|$H�s(H�� H)�L���m���yH�|$H��tH�D$H�u��H�����H�D$��H�L$dH3%(t�r�H��([]A\A]A^A_���AWAVAUATI��UH��SH��H��dH�%(H��$�1�H�D$ @H��wH���.1ҹH��H�=c
����u��;I�<$H�t$ �����t)H�D$(L�d$ M��L�
�> H�5UI�9�u�E1����H�l$0H���1�H�����E1�������H����I����L��L�k����H�D$0H�T$(L�|$@H�T$H�C�����I9�IF�I)ωKI������t$H�t$L��L����I��H��������t$L��H�D$����H�|$A���]��A�N��w�H��at5�{0t��A��u'H���tH������y��yA��t	M���X���H�UD��H��H���i���xTA��u1ƃ�L��ǃ��o����tH�{@H�������H�|$(H�s(H�� H)�H�|$�����tH�|$(H��tH�D$(H�u���H������H������L�D$(H��$�dH3%(L��t���H�Ę[]A\A]A^A_�1��.	f.�D��H���T��@�����օ�����H��������1�H��H9�����H���_��ff.�@I��H��H�=�D ������M�������1�H�5[	����AUATI��UH��SH��H��H�H�����H��1��G��I�$H�����A�����L9����H�� �] H�EH��H��[]A\A]�f�H�=9D H�2D H9�tH��; H��t	�����H�=	D H�5D H)�H��H��H��?H�H�tH��; H��t��fD�����=�C u+UH�=�; H��tH�=�6 ����d�����C ]������w������AWAVAUATUH��H��H��SH��dH�%(H��$1�H����H�\$0�1�H���H�������H�������I��H�������H�}1�H���������i����CH���C�������I��������L�l$0L�����L������pL�\$�~D$H��$�H��L�T$H��L�d$@H�D$(HDŽ$�D$L��$�)�$����A�ƃ���,��������@L�t$(A�����M9��#���D��$�A�E1�L��H�����H������H�D$�D��D��H��H�D$���H�|$�D$����|$�����$�H�T$t�A��u�H���������H�L$(H��$�L��H�� H)��
�����@�H�l$(H�|$8tH���
��H��$dH3%(H��u?H��[]A\A]A^A_Ã�����H���4��H��$�H��D���m������������AWAVAUATUH��H��H��SH��dH�%(H��$�1�H���j���H�\$ �1�H�D$@H���H������H�������I��H����H�}1�H���o����������CH�������������A�I������H�D$L�d$M�����L�5D���L�=M���H�T$ L�\$0L�|$�~D$H�l$pD��L�t$A��pH��H�T$pMD�H��L�$D$�D$xHDŽ$�)�$��S��A�ƃ���0�L�l$���MH�$�����H9����L$xA�H�$L��L��H������I��H���������H��D��H�D$���H�|$A�����A��������A������$�t�A�����H����������L�L$H��$�L��I�� L)������xfH�l$H�|$(tH�����H��$�dH3%(H��u_H��[]A\A]A^A_�A����u���H���m��H��$�H� D�����H�|$H�����H�/������1��{����=��H���%��H��$�H��D�������-����SH�=t< ���������H�=@: �������������H�='9 �b��H��H�����1�1�H�=(����H�> H��tH�H��H�5H���t���H�5H��� ���H�5�H������H�5�H������@H�5�H������1�H�5�H�������H�5�H������	H�5�H�����H��H�5�H������H�5�H������H�5�H���p���H�5�H���\���H�5�H���H��1�H�5�H���7��1�H�5�H���&���H�5�H������H�5�H������H�5�H�������H�5�H�������H�5�H������H�ߺH�5����H�=1�2��H��tH��H�5iH�������&��H�����H��tH��H�5RH�����H�XH�5UH������H��[���H��H���Unable to allocate lockcrc32contiguous bufferargument 1adler32inconsistent stream stateinvalid input datalibrary version mismatchError %d %sError %d %s: %.200sargument 'zdict'1.2.11Invalid dictionarydeflateSetDictionary()Invalid initialization optionInconsistent stream statewhile setting zdictdecompresswhile decompressing dataargumentwhile compressing dataBad compression levelwhile finishing compressionbufsize must be non-negativewhile finishing decompressionflushwhile flushingzlib.errorMAX_WBITSDEFLATEDDEF_MEM_LEVELDEF_BUF_SIZEZ_NO_COMPRESSIONZ_BEST_SPEEDZ_BEST_COMPRESSIONZ_DEFAULT_COMPRESSIONZ_FILTEREDZ_HUFFMAN_ONLYZ_RLEZ_FIXEDZ_DEFAULT_STRATEGYZ_NO_FLUSHZ_PARTIAL_FLUSHZ_SYNC_FLUSHZ_FULL_FLUSHZ_FINISHZ_BLOCKZ_TREESZLIB_VERSIONZLIB_RUNTIME_VERSION1.0__version__copy__copy____deepcopy__unused_dataunconsumed_taileofdecompressobjwbitsbufsizemethodmemLevelstrategymax_lengthzlibzlib.Decompresszlib.Compressinteger argument expected, got floatincomplete or truncated streamzdict length does not fit in an unsigned intCan't allocate memory for compression objectwhile creating compression objectCan't allocate memory for decompression objectwhile copying decompression objectwhile copying compression objectzdict argument must support the buffer protocolwhile creating decompression objectmax_length must be non-negativeOut of memory while compressing dataOut of memory while decompressing datawhile preparing to decompress datalength must be greater than zero__deepcopy__($self, memo, /)
--

__copy__($self, /)
--

copy($self, /)
--

Return a copy of the compression object.flush($self, mode=zlib.Z_FINISH, /)
--

Return a bytes object containing any remaining compressed data.

  mode
    One of the constants Z_SYNC_FLUSH, Z_FULL_FLUSH, Z_FINISH.
    If mode == Z_FINISH, the compressor object can no longer be
    used after calling the flush() method.  Otherwise, more data
    can still be compressed.compress($self, data, /)
--

Returns a bytes object containing compressed data.

  data
    Binary data to be compressed.

After calling this function, some of the input data may still
be stored in internal buffers for later processing.
Call the flush() method to clear these buffers.__deepcopy__($self, memo, /)
--

__copy__($self, /)
--

copy($self, /)
--

Return a copy of the decompression object.flush($self, length=zlib.DEF_BUF_SIZE, /)
--

Return a bytes object containing any remaining decompressed data.

  length
    the initial size of the output buffer.decompress($self, data, /, max_length=0)
--

Return a bytes object containing the decompressed version of the data.

  data
    The binary data to decompress.
  max_length
    The maximum allowable length of the decompressed data.
    Unconsumed input data will be stored in
    the unconsumed_tail attribute.

After calling this function, some of the input data may still be stored in
internal buffers for later processing.
Call the flush() method to clear these buffers.decompressobj($module, /, wbits=MAX_WBITS, zdict=b'')
--

Return a decompressor object.

  wbits
    The window buffer size and container format.
  zdict
    The predefined compression dictionary.  This must be the same
    dictionary as used by the compressor that produced the input data.decompress($module, data, /, wbits=MAX_WBITS, bufsize=DEF_BUF_SIZE)
--

Returns a bytes object containing the uncompressed data.

  data
    Compressed data.
  wbits
    The window buffer size and container format.
  bufsize
    The initial output buffer size.crc32($module, data, value=0, /)
--

Compute a CRC-32 checksum of data.

  value
    Starting value of the checksum.

The returned checksum is an integer.compressobj($module, /, level=Z_DEFAULT_COMPRESSION, method=DEFLATED,
            wbits=MAX_WBITS, memLevel=DEF_MEM_LEVEL,
            strategy=Z_DEFAULT_STRATEGY, zdict=None)
--

Return a compressor object.

  level
    The compression level (an integer in the range 0-9 or -1; default is
    currently equivalent to 6).  Higher compression levels are slower,
    but produce smaller results.
  method
    The compression algorithm.  If given, this must be DEFLATED.
  wbits
    +9 to +15: The base-two logarithm of the window size.  Include a zlib
        container.
    -9 to -15: Generate a raw stream.
    +25 to +31: Include a gzip container.
  memLevel
    Controls the amount of memory used for internal compression state.
    Valid values range from 1 to 9.  Higher values result in higher memory
    usage, faster compression, and smaller output.
  strategy
    Used to tune the compression algorithm.  Possible values are
    Z_DEFAULT_STRATEGY, Z_FILTERED, and Z_HUFFMAN_ONLY.
  zdict
    The predefined compression dictionary - a sequence of bytes
    containing subsequences that are likely to occur in the input data.compress($module, data, /, level=Z_DEFAULT_COMPRESSION)
--

Returns a bytes object containing compressed data.

  data
    Binary data to be compressed.
  level
    Compression level, in 0-9 or -1.adler32($module, data, value=1, /)
--

Compute an Adler-32 checksum of data.

  value
    Starting value of the checksum.

The returned checksum is an integer.The functions in this module allow compression and decompression using the
zlib library, which is based on GNU zip.

adler32(string[, start]) -- Compute an Adler-32 checksum.
compress(data[, level]) -- Compress data, with compression level 0-9 or -1.
compressobj([level[, ...]]) -- Return a compressor object.
crc32(string[, start]) -- Compute a CRC-32 checksum.
decompress(string,[wbits],[bufsize]) -- Decompresses a compressed string.
decompressobj([wbits[, zdict]]]) -- Return a decompressor object.

'wbits' is window buffer size and container format.
Compressor objects support compress() and flush() methods; decompressor
objects support decompress() and flush().;<&��X0����p����z����(����z���տ��8����T���p��������~��X���l��������v��H��\6�������|��0���D���X���l����R���(������P���x����j��H�����������D��� �8p��@�zRx�$����PFJw�?:*3$"D����@\���p���1�����
������A��(�0���RB�D�A �GAB�V���[A�U����� E�Y����#E�Y84�����D�E�E �A(�A0��(A BBBHpc����F�G�B �B(�H0�A8�G��8A0A(B BBBH�ɿ���F�G�B �B(�H0�A8�G��8A0A(B BBB���/���Ol0Y����F�B�B �B(�A0�J8�I�K�V�E�B�I�'�A�M�A��8A0A(B BBB(����kB�A�K �YAB����	(����kB�A�K �YAB&��	0 ���B�C�D �D�� AAB<T����F�A�C �JPrXU`BhBpIP AAB\�����F�H�E �E(�A0�A8�J�L�^�E�B�I�8A0A(B BBB�D��	9��	.��	0#��	4Dx��^B�B�D �D(�G0A(D ABBzRx�0����$����H�^���F�L�B �E(�A0�A8�J��8A0A(B BBBL����MF�B�B �B(�A0�J8�G��
8A0A(B BBBA$zRx��������$,p�����X�I�B�I�L�����F�B�B �B(�A0�J8�G�(
8A0A(B BBBA$zRx��������$,g����X�I�B�I�H<6��7F�B�B �B(�D0�D8�G`8A0A(B BBBH�!��}F�B�B �B(�D0�D8�J�T8A0A(B BBB�(��dE�^zRx�� ��GNU�pD0D{ �OQM�L�O�O�M�O�O�O�OQM�L�M�L�OUfp� 
L�z �z ���o`��
��} �@0		���o���o�
���o�o:
���oY�{ P`p�������� 0@P`p�������� 0@P`p�������� 0@P`p��O�8`TN>�SXO�7�R]O�0�RfO�7`RWM4��VNM@� VXO�7�U]Ob/�UfO�7�UsO�O��O�[L)'� a�O�D�@`�O-)��[8Lw%� [WM�F�Z�O�1��X�O�a�������� � �{ WM { �O�O�5$�� �� @{ WM`{ �O�O�U$� �{ �OGA$3a1 Lzlib.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug��p��7zXZ�ִF!t/���]?�E�h=��ڊ�2N�`��� ��)��twM0*���V��ӵ�
���w���c�y>G��y��dɪ�p�1�0�uG�k��?�`@]��S#�����]O��W�LZ�o��Ĉ9�ԩ�)F.Ck���R7UW̓O;�<��cRy)�8<@6��E� ��}x�����D�%#0Ab	
�5Y�cC6��h%Oq�
���$%�|<(n����%�b�����W��h�гd�YC�����`�̄�a��D��QKWm*��J&�t$hb���|2O�5�Gv���Eo�A�q�4�Іu^� &�ƌ�EԬ��D�(d�`ů�ʕd��O����,sp�����u�̈́o0��|�.�p�")`qoZ��wVE�ϛ��Fj�/v��t
@�]�ąk1y��W�u���t�}�v5�A	-��C�
���tr�dP\��O6�_�`���#V�$�3Dij��k�Di;���P5l��TA����V�G�<�y���:yr�O�_f�vˇ�9fEA��T�-7
�,�@�c�g=�C���81>������)�M�w�;Y;� {�u��<&���M�`��kY�V�ְ2W��Fx����$3�J� {�_"�`�g.׭��B;1��6
��=B��~��C}��yP�M_�$c��D�Բ���t���ꄟ�Ѻ�W��\n�tP���,=�R��V��B���It<_�"�˿H�(���jy�b`*��P�I`#A,=�drd�-�jNMf�'�}Vp���9�8�5�_\$��c�
C-�+��\��ۊF�#�ٿ�p��KIC)���:��ף�6�<0�If�еc���Rt8�h��.��ODFqU��4��Lz�@�����٦Q%�/�5���U�r��SJ����e{�d����z�^���\`�"EN�C�l��n|��4ҕ;�U)��U�I]Ԭ_��8d-�[�JK����+��[��g�;�k�h�,�$�@Yפγ���^K�e\Zo�CF���JD����T|�k��_��V��|0��j�$fH-����
`������{���ݽ{|ˬ�kpG�U�˵���L-]D	%��!UKY�u@1����N0�̞�k'E	��J�9�~ҿA�ԋ�g%蓩>m�'4�j���d�]_�"�~����Z F��E���~Nަn:�@E�_��	�(�.�ѱ�g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(��0���8���o:
:
�E���o�
�
PT0	^B@@�h  c@@Pn��@w�"�"4)}LL
� L L> �`d`d<��e�e ��l�l ��z �z��z �z�{ {� ��{ �{��} �}�� � �� ���`�$
$�\���x�(lib-dynload/_posixsubprocess.cpython-38-x86_64-linux-gnu.so000075500000046640151153537510017535 0ustar00ELF>�@`F@8	@(0(0 0<0< 0< �� H<H< H< 888$$000  S�td000  P�tdl.l.l.<<Q�tdR�td0<0< 0< ��GNU�}�}Wo?�<u�
�1�:�E4�@ 467��|CE���qX�����"��� C��#� ��, �CF"�������'��S�q^����Ph7�Y	��0+tA aA hA 8�(__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6PyErr_Fetch_PyObject_CallMethodIdPyErr_Restore_Py_Dealloc__stack_chk_failPyTuple_TypePyArg_ParseTuple_Py_NoneStructPyLong_AsLong_PySequence_BytesToCharpArrayPySequence_FastPyTuple_NewPyUnicode_FSConverterfork_Py_FreeCharPArrayPyLong_FromLongPyExc_ValueErrorPyErr_SetStringPyOS_AfterFork_Parent_PyInterpreterState_GetPyInterpreterState_MainPyExc_RuntimeErrorPyImport_ImportModule__errno_locationPyExc_OSErrorPyErr_SetFromErrnoPyObject_IsTruePyOS_AfterFork_Child_Py_set_inheritable_async_safePyOS_BeforeForkclosedup_Py_write_noraise_exitPyBytes_AsStringchdirexecvedup2_Py_RestoreSignalssetsidPyObject_Call_Py_open_noraisesyscallexecvsysconfPy_hexdigitsPyInit__posixsubprocessPyModule_Create2_edata__bss_start_endGLIBC_2.2.5GLIBC_2.4f ui	yvii
�ui	y0< �)8< �)@< @< @ �)@ �$@  +h@ �*p@ @.�@ @ �@ �*�@ �*�@ �*�? �? �? �? �? �? �? �? �? !�? 3`> h> p> x> �> �> 	�> 
�> �> �> 
�> �> �> �> �> �> �> �> �> �> ? ? ? ?  ?  (? "0? #8? $@? %H? &P? 'X? (`? )h? *p? +x? ,�? -�? .�? /�? 0�? 1�? 2��H��H��- H��t��H����5�+ �%�+ ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&�������h'��q������h(��a������h)��Q�������%U) D���%M) D���%E) D���%=) D���%5) D���%-) D���%%) D���%) D���%) D���%
) D���%) D���%�( D���%�( D���%�( D���%�( D���%�( D���%�( D���%�( D���%�( D���%�( D���%�( D���%�( D���%�( D���%�( D���%�( D���%�( D���%�( D���%}( D���%u( D���%m( D���%e( D���%]( D���%U( D���%M( D���%E( D���%=( D���%5( D���%-( D���%%( D���%( D���%( D���%
( DUSH��H��(dH�%(H�D$1�H��H�t$H�|$���H��1�1�H�5) ���H�|$H��H��tH�$H�t$�'����H��tH�1�H�P�H�H��uH������H�L$dH3%(��t�M���H��([]�L�w' H�57E1�I�;�����D$ E1�I�/uL���o����|$ M��ubH��udL���H�|$�.����|$tH�|$����������DE�H���H�|$��A�����Ic�����I����������B���I������I9�uK��$�t`��$�VH�-�& H�5�E1�H�}�����H��$�H�}����L�-�& H�5�E1�I�}����H��$�H�}���NH�=��g���H�D$H��t9H��1�H�51' 1�����I��H���"L�T$I�H�D$H��I��2
E1��H�D$�D$H�|$t2E1�E1�M��H�|$���M��tI�,$��M��t
I�/���|$upH�t$H��t�H�H�\$H��H�u�H��E1�����
����L�S% E1��I�8�&����v
H�L$H�1H�t$H��H�1�:���H���O����-���H�|$�����L���6����a���L���)����c���H�m��H���������H���t���I�/�D$uL�����|$��	H�|$1�H�5�% 1��r���I��H���	H�(uH�����H��$��+���H�D$H������H��$�H9�tSH�5�����I��H���}���L�pL�����I��H���	L�l$L�l$E1��d����D$H�D$E1�H��$�1�H9��{�
H�D$(E1�H9�$�t���H��$�L��$�H�l$hD�T$|Hc�$�H�|$ ��$�D�T$H��$���$�D��$��D$��$�M�Q�T$0D��$�D��$��L$D��$��t$8D�D$<�|$@L�T$XH�D$`D�\$LE1�D�|$TD��$�L��D�t$PM��M��H9l$X��I�|�����H;D$`t1Ҿ���k������,H�����D$ E1����A���L��$�M��������t���H�D$(1��1���I��H��t;�����D$ �7���A�ƅ������1ۃ��u��H��$�������H��tH���q���E1�M�������L��E1�E1��W������M��|$<�M��H�l$hM�����|$8����|$0�t�|$0�����tB�|$T�����t4�|$�0A���RD�����A�ǃ��t1�1����;�����y�L�%'1��y���D�0E���H�\$�H�5Y�����L��H��1��L���H��H�Q��������@����|$<������5����H��$����H�D$(H9�$�������D$ E1����H�-]! H�5�H�}����S���I�/uL���2���M������)���I�|�L���������"���L��$�M�L�H��L9����1��i����D$������1�1�������������������|$@���D$@������|$���T$�����A���A����H�|$(tH�|$(������n����|$L��|$H�H9\$ ��M��A������D!�H�D$�����|$P�(E1�1�H�T$Hc�H�<�H����H����H��L���R����1�1���������+�������1��������������1Ҿ������������������������1Ҿ����������n����D����������S�����������������6���H�|$ 1�L������H�����L�\$L�%�	�A��
���1�H�=]	�z�H��$�A��H�L$ �����L��I��L��I��H�T$ �D��1������D$<����1�M��M��A��Ic�H\$ 1�L�CA�8D�W�A��	��Dk�
I��A�L:���E��tH�L$L�%��D�)�Z���L�%x��I���L���o�H�t$D�>A��A��A��A��E��tE��u��E�����E������H��H���tNM�^E1�H�l$0I��A�L��L��L�\$ H9l$ ��H�|��u�Lc�I�ƉD$(M9���H���ҿ뫋|$H�5�A���L�
� L��$�I�r	M�D��H���A��Lc�A��G�$D�&��tL9�u�D�|$I�R	H)�D���N�H�5�D���:���h����|$�H�5����N���D��L��M���J�����H�l$0L��M9������Mc�L9������D��A������D��A����D9|$(�A�~Lc����@��u��x
A9�t���sA�D;d$<���M��M�����L�]I��xsHc�H�\$0E1�H�T$@D�l$(I��L��D�d$8M��J�D%��L$HH�H��I�|�H�����H;D$@���L$H��H�kL9�~�L��H�\$0D�l$(D�d$8���G��Z���L�������L�L$M�L�D$I��M������L��E1����H�|$H�H�L$H��H��}�������|$8�����'����y���L��H�\$0D�l$(D�d$8����L�c��K���M���W��f���AWH��AVAUATUSH��dH�%(H��$�1�H��$�H��$�H��$�PH��$�SH��$�VH�5�H��$�UL��$�APL��$�AQL�
� L��$�ARL��$�ASL��$�ATL��$�AUL��$�AVL��$AWH��$P1�H��$0SL��$��2�H��p���B�H�_ H9�$��J��$�������$��S�H��$�H�}~KH�}H�O����Z���I��H=����F�H���=�H�}�H9�$��g�H��$��=�H�D$H�����H��$�H9��P���H�5���I��H���z�L�pL������D$I��H������H�D$M��~hM9w��1�L��$�I��������M�WL��I�<��#����&L��$�M�\�H��L9�tM9wt����f.�L���h�I�mI�������L�����I�/�����M�����H��$�H9���1�H��$�H9����HDŽ$�H9�$���������A�ƅ��O����K���L��$�1�M�����H���,M�����L����H�|$���D$�����H�����H�|$���A����w�Ic����I��H��$�dH3%(L����H��[]A\A]A^A_�ff.�@H�} H�w������f�I��H=������L9����H�}�����H�}(L�GA������A��"�L9����H=������I��L;u�g���J�|�I��H�W���u���DH��L����������H��H���S����i���������H�=@ ��f.��H�=� H�� H9�tH�� H��t	�����H�=� H�5� H)�H��H��H��?H�H�tH�e H��t��fD�����=} u+UH�=B H��tH�=� �I��d����U ]������w�����H��H���OOpO!OOiiiiiiiiiiO:fork_execerrpipe_write must be >= 3gcargv must be a tupleargs changed during iteration/proc/self/fdOSError:noexecSubprocessError:0:bad value(s) in fds_to_keep_posixsubprocessdisableisenabledenableException occurred in preexec_fn.preexec_fn not supported within subinterpretersfork_exec(args, executable_list, close_fds, cwd, env,
          p2cread, p2cwrite, c2pread, c2pwrite,
          errread, errwrite, errpipe_read, errpipe_write,
          restore_signals, call_setsid, preexec_fn)

Forks a child process, closes parent file descriptors as appropriate in the
child and dups the few that are needed before calling exec() in the child
process.

The preexec_fn, if supplied, will be called immediately before exec.
WARNING: preexec_fn is NOT SAFE if your application uses threads.
         It may trigger infrequent, difficult to debug deadlocks.

If an error occurs in the child process before the exec, it is
serialized and written to the errpipe_write fd per subprocess.py.

Returns: the child process's PID.

Raises: Only on an error in the parent process.
A POSIX helper for the subprocess module.;8��T��|4����p4���������zRx�$���FJw�?:*3$"D��$\���A�A�G@�AA��p���PF�E�B �B(�A0�A8�G�l�I�I�P�J�J�Q�J�J�J�J�J�I�K�Q��
8A0A(B BBBP$zRx��������,V�dL����GNU��)�)@< Ufv(
�)0< 8< ���o`��
�H> �8(	���o���o����o�oh���oH< `p�������� 0@P`p�������� 0@P`p���������)�$ +�*@.��������@ �*�*�*GA$3a1(�)GA$3a1�)�)_posixsubprocess.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug�=��7zXZ�ִF!t/��w:]?�E�h=��ڊ�2N�Hiy^ �ړ�[\νt"wL�,PgZ�a� Şm�m�XC�d�+�L/�1�-��\v]�^B����ɻ��2gʰ�J��|���h<SA���T#��}�'ɘ���E	�~�MY_�A�>\̹$�B/���v�>���'�B?��_�$���;3��(Cg�=��]L�����gt�I��g�����^nj3��0)�M)��Q={���ux��&���w�j�Ζ<�29N+#ƃ���x��e��a�(�)��0il�^�j�F�}kO֎)2d�n��v�
ZS4�!�h�O~5��j� �ǂ��P�"�9S�tʩbJ0�W�6R�*�C�"�?�i�ny�y`.jPq*"���Q�߻��&�
@p��*�>w�V�k�	���7�(ls�h,`A!a����Q�vC{��GD��w3)�H=M!2��Ći�
:������؆���L�K�v]��Ub������i�wn�1"��*�N���� ͍��l��pm�~2�/s
2����D�kW���w}��Fn��|�N�ڮ��y��9E�[�(�م̻]8��;�,���R�@0_���ÜY��
���Գ2�b�#��0���'���)@�.��°^U�=>�q�Q�%@6����@�61�Ҍ飧@�= %�,%y�4wc*+�����o��KO#ǔ?~��#@��!z�d/�	.���8�a;)޲<m.
qG��z맆�(Ac7��Z��s��ɩ���KYZ�mL������Y�q���q�%DZRW�+g�!l��)���	�#��W�Qa3[/v���x���u�����ޱ�g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(��@0���8���ohhpE���o��PT((^B88�h((cPP�n�w��)}�)�)
��)�)� �l.l.<��.�.`�00 �0< 0<�8< 8<�@< @<�H< H<�H> H>��@ @ �A A�A`AH
PAh�A|4E(lib-dynload/_asyncio.cpython-38-x86_64-linux-gnu.so000075500000175270151153537510015731 0ustar00ELF>PD@x�@8	@0�0� ���� �� � x! ���� �� 888$$���  S�td���  P�td���$$Q�tdR�td���� �� ppGNUw:�l�B|�f���]tX-SVg�@ �@gj�y���|CE���qXwM���Y���YR� �aL�=��s�����
� Q�-t�, F"��6����G7����*��b��t���4B��&��i���$*P���iDfc{;���7��p������ �`� �`� __gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6_Py_TrueStruct_Py_FalseStruct_Py_NoneStructPyObject_Hash_PyDict_GetItem_KnownHashPyExc_RuntimeErrorPyErr_Format_PyDict_DelItem_KnownHash_PyArg_UnpackKeywords__stack_chk_failPyErr_SetStringPyThreadState_Get_PyDict_GetItemIdWithErrorPyErr_Occurredgetpid_PyObject_MakeTpCall_Py_CheckFunctionResultPyObject_CallFunctionObjArgsPyExc_AttributeErrorPyObject_IsTruePyExc_ValueError_PyUnicode_FromIdPyErr_SetNonePyType_IsSubtype_PyErr_BadInternalCall_Py_tracemalloc_config_PyTraceMalloc_NewReference_PyObject_GC_NewPyObject_GC_Track_Py_DeallocPyObject_GC_DelPyObject_FreePyUnicode_TypePyObject_Str_PyObject_CallMethodId_PyDict_SetItem_KnownHash_PyObject_CallMethodIdObjArgsPyObject_GC_UnTrackPyArg_ParseTuplePyTraceBack_TypePyExc_TypeErrorPyErr_NormalizeExceptionPyException_GetTracebackPyErr_Restore_PyObject_GetAttrIdPyExc_StopIterationPyErr_FetchPyDict_New_PyType_NamePyUnicode_FromFormat_PyDict_SetItemIdPyErr_WriteUnraisablePyUnicode_FromStringPyUnicode_JoinPyList_NewPyTuple_NewPyList_AppendPyObject_RichCompareBoolPyList_SetSlicePyLong_FromSsize_tPyErr_SetObject_PyGen_SetStopIterationValuePyObject_ClearWeakRefsPyObject_CallFinalizerFromDeallocPyUnicode_FromFormatVPyContext_CopyCurrent_Py_IsFinalizingPyThreadState_GetDict_PyObject_NewPyCoro_TypePySet_ContainsPySet_AddPyExc_DeprecationWarningPyErr_WarnExPyObject_IsInstancePyGen_Type_PyGen_Send_PyGen_FetchStopIterationValuePyErr_ExceptionMatchesPyErr_ClearPyException_SetTracebackPyExc_KeyboardInterruptPyErr_GivenExceptionMatchesPyExc_SystemExit_PyObject_LookupAttrId_PyObject_SetAttrId_PyErr_ChainExceptionsPyObject_CallMethodPyInit__asyncioPyImport_ImportModulePySet_NewPy_BuildValuePyObject_GetAttrStringPyType_ReadyPyModule_Create2PyModule_AddObjectPyType_GenericNewPyObject_GenericGetAttrPyObject_SelfIter_edata__bss_start_endGLIBC_2.4GLIBC_2.2.5vii
�ui	��� ���� ���� �� �� ��� ���� ��� ��� ��� �� � ��(� �0� �@� ��H� ��`� ��p� ��� ��� ���� ��� �� IO � �(� �f8�  �@� #�H� lNX� �`� �h� i^x� ��� ��� �]�� @��� -��� Pi�� ��� ?��� 
d�� @��� ��� �\�� `�� T�� PD� � � ^�(� wD8� @�@� c�H� �IX� �`� 9�h� �Lx� Б�� l��� �M�� s��� {E�� �M�� C��� �E� �� � -b@� �H� Ih� "�p� �H�� ���� KI�� .M�� ���� �E � ��(� yg@� ��H� BX`� Íh� �Q�� ɍ�� 9F� ɍ� iF`� �h� �fx�  ��� #��� lN�� ��� -��� Pi�� ��� ?��� 
d�� @��� T��� PD�� �� ^�� wD� @� � �(� �H8� �@� �H� �HX� ��`� ҍh� �px� ���� ���� �o��  ��� ��� �S�� ��� ���� L�� ���� ���� DK��  �� 9�� �L� � � ߍ(� �D8� �@� �H� vSX� ��`� �h� �Dx� ���� l��� �M�� s��� {E�� �M�� C��� �E� �� � -b@� �H� Ih� "�p� �H�� ���� KI�� .M�� ���� �E�� ���� �F�� �L� �� G0� �8� ?GX� �`� WG�� (��� �T�� `��� 8��� �J�� ��� 7�� iJ� � � I�(� El8� @�@� [�H� WX� ��`� j�h� Vx� `��� {��� qU�� ���� ���� �G�� @�� ��� �� � �� @� �~h� �� p� ҍ�� ҍ�� p� �� ��� ��(�  � 0� ֎h� -��� s��� ���� ���� C�� c�(� �� 0� #�h� ���� (��� �� �� -��� Î� 9�(� ێH� ��h� ���� ��� ێ�� ���� ��� #�(� �H� � P� [��� ���� � �� j��� ��� �� � {�H� �h� *��� 3��� =��� `� �� ��� @� � ��H� ��h� �� p� ���� ͎�� �g�� � �� �aP� ��X� �F`� �Rx� IO�� `� �� �� �� �� �� m(� `X� �p� �W�� �E � �f(�  � �� �� �g0� � 8� �a�� ���� �D�� �Q�� IO��  � �� �� � �kh� �^�� E��� �W� |8� �E@� gQx� �� 8� Y�P� �W�� Cz�� QF�� =Q� � �� o��� JSX� `� h� p� 	x� �� 
�� ��  �� #�� '�� (�� )�� ,�� -�� .�� 4�� 9�� G�� L�� U�� � �� 3� 3�� 3P� 3� �� �� �� �� �� 
� � � �  � (� 0� 8� @� H� P� X� `� h� p� x� �� �� !�� "�� $�� %�� &�� (�� *�� +�� /�� 0�� 1�� 2�� 5�� 6�� 7� 8� :� ;� < � =(� >0� ?8� @@� AH� BP� CX� D`� Eh� Fp� Hx� I�� J�� K�� M�� N�� O�� P�� Q�� R�� S�� T�� V�� W�� X�� Y�� Z�� [� \� ]� ^� _ � `(� a0� b8� c@� dH� eP� f��H��H�Y� H��t��H����5�� �%�� ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&�������h'��q������h(��a������h)��Q������h*��A������h+��1������h,��!������h-��������h.��������h/������h0�������h1��������h2�������h3�������h4�������h5�������h6�������h7��q������h8��a������h9��Q������h:��A������h;��1������h<��!������h=��������h>��������h?������h@�������hA��������hB�������hC�������hD�������hE�������hF�������hG��q������hH��a������hI��Q������hJ��A������hK��1������hL��!������hM��������hN��������hO�������%}� D���%u� D���%m� D���%e� D���%]� D���%U� D���%M� D���%E� D���%=� D���%5� D���%-� D���%%� D���%� D���%� D���%
� D���%� D���%�� D���%�� D���%� D���%� D���%݌ D���%Ռ D���%͌ D���%Ō D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%}� D���%u� D���%m� D���%e� D���%]� D���%U� D���%M� D���%E� D���%=� D���%5� D���%-� D���%%� D���%� D���%� D���%
� D���%� D���%�� D���%�� D���%� D���%� D���%݋ D���%Ջ D���%͋ D���%ŋ D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%}� D���%u� D���%m� D���%e� D���%]� D���%U� D���%M� D���%E� D���%=� D���%5� D���%-� D���%%� D���%� D���%� D���%
� D���%� D��H�t�HuH�`� H��H�=� H����H�t�HuH�!� H��H�.� H����H�GpH����H�GxH��uH�"� H����ATI��UH��SH�H��H��uI�|$H��u�H��Ӆ�t��H��Ӆ�uwI�|$ H��t	H��Ӆ�udI�|$(H��t	H��Ӆ�uQI�|$8H��t	H��Ӆ�u>I�|$0H��t	H��Ӆ�u+I�|$@H��t	H��Ӆ�uI�|$X1�H��tH��H��[]A\��[]A\���H�t�PtH�5� H��H�� H����H�GH��uH�*� H��H����H�t	H�G@H��uH�� H��H����H�H��H��tH���1����ATI��UH��SH�H��H��uI�|$1�H��tH��H��[]A\��H��Ӆ�t�[]A\���H�GH��uH��� H����H�H��H��tH���1����H�GH��uH�c� H����ATI��UH��SH���H��H��uI�|$pH��u
�H��Ӆ�t��?H��Ӆ�u6I�|$xH��t	H��Ӆ�u#I�|$hH��t	H��Ӆ�uH��H��L������1�[]A\������tH��� H��H��� H�������tH��� H��H�u� H����H�GpH��uH��� H����H�GhH��uH�u� H��ATI��UH��S�b���H��H��t_H�=c� H��H������L9�t2H��uH�7� H��H�� E1�L��H�5 >H�81��������H�=� H��H��[]A\�k�����[]A\���H��(H��H��dH�<%(H�|$1�H��uH��~H��H��u/RA�L�2� H��H�T$R1�jj���H�� H��u1��H�pH�8������x�H�z� H���H�|$dH3<%(t����H��(���PH�=� H�5~=H�8�>���1�Z���PH�� H�5�=H�8����1�Z���SH�_H��tH�_0H��u$H��� H��H�� H�5�=H�8����H�H��[���SH�_H��tH�_8H��u$H��� H��H��� H�5?=H�8����H�H��[���SH�_H��t�Lt$H�b� H��"H�^� H�5�<H�8�_����
H�&� H�H��[���SH�_H��tH��H�$� H�5�<H�8�%���H��[�ATI��US�t���H��H�� H9�uH��� H��uLH���H��tcH�5B� �m���H��H��u����H��tEI�$���BH��H��� H��� H�kH;-�� t�'���;CuH�E1�I�,$�
I�$1�[]A\���H��dH�%(H�D$1�H���7���1҅�uH�$H��u
H�A� H�H�L$dH3%(H��t���H�����H��dH�%(H�D$1�H�����1҅�u!H�<$uH�݄ H�5�?H�8����H�$H�L$dH3%(H��t�B���H���J�H����3SH����H��1�[H���,�����UH��H��H��S1�H��(dH�<%(H�|$1�H��tH�YH�H��uH��xH��u(RE1�L�o� H��H�T$R1�jj�;���H�� H��tHH��tH�H��tH��u	�H�� H�H�H�
� H���H�
�� H�=� E1�H��1��
�H�|$dH3<%(t�U���H��([]���UH��H��H��S1�H��dH�%(H�\$1�H��tH�QH�2H��uH��xH��u(RE1�L�`� 1�H�|$WH��jj�l���H�� H��t$H��tH��H�R� H�=;� 1�H��1��_�H�|$dH3<%(t���H��[]���H��H�=�� 1�1��,���H��H�=ޝ 1�1�����SH��uH�� H�5�=H�8�������H��H�������x���1҉�[���SH��uH��� H�5�=H�:������8H��H�����x&tH�� H�5.9H�8�f�������CL���[���SH�t H��u6H�C� H�5:=H�8�,������2H�
� H�5�8H�9�������H��H���1����x�CP1҉�[���H��H�GH��t�WH��t=��t+��tB1��RH�
�� H�5U8H�D$H�9���H�D$�0H�=b� �=��H�=4� �/��H�=� �!�H��tH�H�����SH�_H��uH�=7� H�5�7�S����S�GH��uH�=� 1����;��tH�=� H�5D<1������H�_0H��t�GLH��
H�� H�H��[�Q�GH��uH�=�� ����F��tH�=�� H�5<�����)H�W0�GLH��t
H��H��H�O81�H�H�Z���UH��H�5�� SQH�H9�t!���u�nH�=P71����H�]H��tH�d� H��u�ZH�=.� H�5�6H�?�/��fH�F� H�
� H��H�-� H�S�yH�CH�� tH����H��H�=D� �/�H��H��tH�EH��H�k��H��Z[]����H�=�� H����/�/��H�=r� H����/�/��H�=(� H����/��/��H�=V� H���/�#/�s�H�=4� H���;/�K/�Y�H�=*� H���/�/�?�H�=Й H����.�.�%�H�=ޙ H���H.�X.��H�=�� H���
.�.H�_H�-� ��H��H��u�H�ҙ �8� �/��H�GH��tH�GH�u
RH����1�Y�1����SH��H�H��tH�CH�u�v�H�{H��tH�CH�u�[�1�[���H�GH��t"H�GH�uRH���4�H�
~ H�Y�H�~ H����SH��H�H��tH�CH�u��H�{H��tH�CH�u���H�{ H��tH�C H�u���H�{(H��tH�C(H�u��H�{8H��tH�C8H�u��H�{0H��tH�C0H�u�s�H�{@H��tH�C@H�u�X�H�{XH��tH�CXH�u�=�1�[���SH������H���H��tHǃ�H�u��H�{pH��tH�CpH�u���H�{xH��tH�CxH�u���H�{hH��tH�ChH�u��1�[���SH��H�H��tH�CH�u��H��[����SH��H��H�0| H9VtH����H��u�$H�H�{xH�CxH��t
H�u�I�H�"| H�[����H�GLtH��{ H��ATUSH��H�hH��t<1�H�5H� 1���H��H��u1��4H����H�MA��uH�����E��x�u
ǃ�H��{ H�[]A\�SH��dH�%(H�D$1�H���_�����t1��KH�$H��uBH�=� 1�1�1��<*H��H��t�1�H��H�5� 1��a�H�$H�uH���P�H�$H�L$dH3%(t��H��[����l���AUI��ATUH��SAQ��H���tNH�=�� H��H��I����H��H��t<H�H��H��z E1�L��H�5�1H�81��n�H�uH����Z��[]A\A]���H��u�H�=�� L��AXL��[H��]A\A]�?���H��(H��H��dH�<%(H�|$1�H��uH��~H��H��u/RA�L�M� H��H�T$R1�jj��H�� H��u1��H�pH�8�����x�H��y H���H�|$dH3<%(t�Y�H��(���H��H��H��dH�<%(H�|$1�H��uH��~H��H��u/RA�L�S� H��H�T$R1�jj��H�� H��u1��:H�H�=� 1�1�H�5]� ��H��t�H�uH���f�H�?y H���H�L$dH3%(t��H���SH��H�=�� 1�H�5�� 1�����H��tH��H�1�H�P�H�H��u����[���H��H��H��dH�<%(H�|$1�H��uH��~H��H��u/RA�L��� H��H�T$R1�jj��H�� H��u1��H�8�V�����x�H�ix H���H�|$dH3<%(t���H�����SH���;�H�����H�CH��[H��@����SH����H�����H�CH��[H��@����SH�����H�{H��tH�CH�u���H�� H=�H�ޒ H��H�Ԓ H�Œ H�S[�H��[����AUATUSH��H��H�5�2H��(dH�%(H�D$1�I��L�d$H�l$M��L��H��H�D$H�$�'����`H�8w H9T$u	H�D$H�$H9�u
H�$�-H��t(H�
w H9HtH�=�v H�5e.H�?����	H�|$L�D$H�M��tI�L�$M��tI�L�WI�����s���@tL��L��H���_��X��s:M��tH�3v H�5$.H�;�|��eH�|$L�T$I�M��u#���H�$�L��u H�5'.I�;�G��0H�{H��tH�CH�u�J�H�$H�t$H�|$���6H�|$H�u�&�H�|$H��t
H�u��H�<$H��t
H�u��1�H�\$dH3%(t�H�H��([]A\A]�AUI��ATUSH��H��(dH�%(H�D$1�H��uH��E1�H��H�5�� �C�I���[H�5w� I����H��H��u���_L�,$�H��t
H�\$�H�
ۏ H��H��L�$��$H�MI��uH���C�M��t�I�E1�H�P�I�UH��uL���#�H�L$dH3%(��t�l�H��([]A\A]�AUA��ATI��UH��H�=k� SQ��H��tEH�EH��H�hM��tI�$L�cH�����H�}1�H��H�������H�A��uH����ZD��[]A\A]�ATUSH�wH��H��tlH�O H�H�����H�{��H��tH�CH�u�R�H�{ H��tH�C H�u�7���t H�{(H����H�C(H����%H�{(H����L�g1�M��u7H�C(H�ul����gH�GH�{H��H�J H�rH�������uH��H�{(L9�|�� H�{(H��tH�C(H�u�����H��tH�C(H�u��1��[]A\ÃH�GLtH�s H��Q�GH����1��t
H�s H�H��Z���H�t�PH��r H�5�)H�8��1�Z�S�HH��u<H�FH������tF���@t=1�1�1��!H��H��tZ�{Ht'H�u���H�=�� H�5�-��1��H�H�O���@u$H�u��L�r H�5�-I�8�g�1��XH��q H;
u$H�u�m�H�=�q H�5g*H�?�7�1��(H�{0H���CH�����t�H�r �CLH�[���H�t����PH��q H�5�(H�8���1�Z�SH�_H��t�Ht/H�=�� H�5-1����;H��q H�5A(H�8���#H�1�H�w8�GH������t
H�q H�H��[���H�t�PH�Rq H�5�'H�8�S�1�Z���ATUSH�� dH�%(H�D$1��L�F�GLH��H�t$H��H�|$����X�H��H����H�}�S�H�=l)H��1��b�I��H����H��H�5 H��������H�U0H�5�~ H��������H��H�5�~ H���o���xqH�U@H��uH�}H�57~ ��H��H��u�NH�5A~ H���9���y��91�H��H��1��d�H��u
H���w��
H�uH���H�H�MuH���:�H�uH���-�M��uH�$H�t$H�|$�u��I�$u�L������H�D$dH3%(t�N�H�� []A\���AUATI��USH��(dH�%(H�D$1��H�����H��H�t$H�|$�[����H��H����H�=(�>��H��H����H��H�5�| H��� �����L��H�5�| H������xsI�T$@H��uI�|$H�5L| ��I��H��u�NH�5V| H�������y��91�H��H��1����H��u
L�����
H�uH�����I�MuL�����H�uH�����H��u0H�$H�t$H�|$�
�L���3���H�D$dH3%(t���H�Mu�H�����H��([]A\A]���ATUSL�gM��t 1�H�5X{ 1�I�����H��H��uE1��fH�
n H�5�$H�8���N1�H������H�MH��uH����H��t�I�|$�?�H��H�=H)H��1��K��H�I��uH�����L��[]A\���USQH�_H��tH�H��H�_(u9�L�|m H�5$I�:�}��H��uH�lm H��H���H��tH�{H���v�H��H��t����H��uH�uH���B�1��EH�UH�M H�{H�H�PH�H�H H�1�H�}(tH�u(H9F~L�FM��I�L�L�H����H��Z[]�AUATUSQH�_H��uH�
�l H�5/(H�9�����HH��I��I��tH��H��H�����������hH�(uH�uH�H�uH�H�U �z�����H��H��t8I�EL�hI�$L�` H�}(H��t5H������H���tH��H�uH���8��1��6H��H�u$H���$�����(�H�E(H��t�H�@H�H��k H�ZH��[]A\A]���AWAVAUATUSH��H�H�4$tH�wI��H��u1��uL�
�k H�50"I�9����H�<$��]���������u�I�|$H��tI�D$H�u�s��I�|$ H��tI�D$ H�u�V���I�|$(H��tpL�oM��uI�D$(H�uY�+���RI��uTH��L�H�<$I�p��������X��u&I�|$(H��tI�D$(H�u����H�{�
H���L������H��H���E1�E1�I�|$(L9w~tH�GH�<$�J��H�H�qH�L$�H��H�T$��u'M9�}
H�uJ��I���2H��H��H�T$����H�T$H�
uH�׉D$�G���D$����I���M��u'I�D$(H�u���H�MuH�����J�<+�@M9�}L�}L�mL�gM9�uH�MuH�������1�H��L�������y��L)�J�<#H��[]A\A]A^A_���H�MuH�����H��1�[]A\A]A^A_�SH��H�_dH�%(H�D$1�H��uH�=+� H�5��G���1H���D����t"H�$��tH�{H���T��H�<$H�u�6��1�H�T$dH3%(H��t�|��H��[����u�����USQH�_H��tm�{Hu,�{Pu�CPH��WH��h H�5N$1�H�8����=H�GH���#���H��H��tH�����H�MuH�����H�uH�����1�H��Z[]����q�����SH�y H��H9GtH���A��H�{`tH���B���������y�[�H����H�SH��[H��@����SH�| H��H9GtH������H�{`tH������������y�[�H�����H�SH��[H��@��ATI��USH��H���H�L$8L�D$@L�L$H��t7)D$P)L$`)T$p)�$�)�$�)�$�)�$�)�$�dH�%(H�D$1�H�L$ H��H��H��$��$�D$0H�D$H�L$���H��H��tG1�H��H��1��'��H�MH��uH�����H��t"H��L����H���uH��H�uH������1��H��H�uH������H��f H�H�L$dH3%(t���H���[]A\���ATH��H��1�UH��SH�� dH�<%(H�|$1�H��tH�QH�2H��uH��~H��H��u/RA�L��r 1�H�|$WH��jj�%��H�� H��u1��PH��L� t	H�PH��u-���H��H��t�H��H��L������H�H��uH������H��L�����H����H�|$dH3<%(H��t�0��H�� []A\�ATUH��SH��H�H��tH�CH�u���H�{H��tH�CH�u���H�{ H��tH�C H�u�l��H�{(H��tH�C(H�u�Q��H�{8H��tH�C8H�u�6��H�{0H��tH�C0H�u���H�{@H��tH�C@H�u���H;-�d H�CH�CPu�'�H��H��u	���qH�EH�kH��1�H�5"q 1����H��H��t�H�����H�MA��uH�����E��x�u1��*������u�H�= 1�1�1��4H��H�C@������[]A\���UH��H��S1�H��H�vdH�%(H�D$1�H��H	�H��tH�ZH�H��H��t/��PE1�L�0p H�L$Q1�jj����H�� H�ǃ�H��tH��tH�7�H�5�c H������H�L$dH3%(t�"��H��[]���ATI��US�{��H��H��uH�
lc H�5EH�9�m���H�=A| ���H��H��t;����H��H�5�s H�߉EI�$L�e�����H�EyH��H�EuH���9��1��5H��H�EuH���$��H�-�} �X��H��b H��H�H��} H��[]A\���AVH��AUATUSH��H�� H�vdH�%(H�L$1�H����1�H��tH�jH�H��H��u��u/QA�L��m 1�H�|$WH��jj�j��H�� H����L� H��tH�pH��tH��u	�H�5<b H�h�H�-/b H���H�-#b H���t�������I�t$H;5�a ��H�=�| �������H�=�| 1�L�����I��H��tnH�����I�MA��uL������E��~H�=O| H�cNI�t$�����t@�2A���t,E��u3H�.a 1�L��H�5rǃ�H�81��&�������t�L�������H���M��tI�MuL���T��H���t�H�{hH��tH�ChH�u�/���H�{pH�� H���I�$L�cpH��t
H�u���H;-�` u%L�\{ H�=�1�I�pH�5H{ �;��H���H�5�` H9ut
H�����H���H�EH�{xH�kxH��t
H�u���H�{x����1�H�����������H���>���H�L$dH3%(t����H�� []A\A]A^���UH��H��1�SH��dH�<%(H�|$1�H��tH�QH�2H��uH��xH��H��u,RE1�L��j 1�H�|$WH��jj����H�� H��u1��nH��tH�(�H�-�_ H��_ �H�5�H�8�J����x�H�=Wz H�5�j ���H��H��t�1�H��H��1����H�H��uH���|����H�|$dH3<%(H��t���H��[]���ATH��H��1�USH��dH�<%(H�|$1�H��tH�QH�2H��uH��xH��H��u(WE1�L�hi 1�H�|$WH��jj����H�� H��tnH��tH�(�H�-�^ H��^ �H�5H�8�O����x>H�=\y H�5Mi ���H��H��t#H;-y^ uN���H��H��uH�uH���}��E1��R1�H��H��1��i��H�I��uH���Y��H�Mu-H���K���#1�H��H��1��:��H�I��uH���*����H�L$dH3%(L��t�n��H��[]A\�AWAVAUATI��USH��H��H��HH�dH�%(H�D$81��������{Ht,M��uL�%�] H�=lx L��H��1�H�5C�@���VD���E��tSM��u%H�=3x 1�1�1�A��2I��H��u$� H�5x L�����������t�E1�ǃ�H�{hH��tH�ChH�u�!��H�{pH��u6H�=�\ H�5�H�?����E����I�$��L�������M��u?H�GH;j\ H��\ t	H;"\ u
H�����H���>1�H�5jh 1��C��H���)1�L��H�52h 1��+��H��E��tI�$uL���u��H����H�������u]���tǃ�H�����H���H�4$H���6�H��H�<$H�u�#��H����H�M�vH������iH�=�v ������t�.��H���m�I���L�t$L�|$L�l$L��L��L�����H�T$H��uL��L��L���I���H�zH�t$H9�t	�����t�H�t$H��t
H�|$�l��H�t$H���X�H�$H��u?H�|$H�u�W��H�|$H��t
H�u�C��H�|$H����H�����H�uH�����H�
[ H�|$H�1�6����tH�T$H�t$H�|$�N���H�5JZ H�|$H�6�����u�H�|$H�u����H�|$H��t
H�u���H�|$H��t
H�u���L�%sZ I�$�@H9�u8H�NZ H��H��H��H�01���H�H�$��H���R����H�UL�="n L9�tL�%�j L9���L�KL9M���}P�s�EPH�='q �2��I��H����H�H��H�X���H���L��H�����I�I��uL������M���bI�MuL��������H�khtJ1�H�5�h H��1����I��H���=H�����I���uL���k�����t
ǃ�L�0Y I��<L�-!Y L9�u1�H���1������H��H�5�d H���C������H�<$H���L9�����H�<$A��H�u����E���|H�uL9�tL9�u	L�}I��`H�T$H�5�d H���������IH�|$H��t1�1�1��NH�|$I��H�u�|���H�5Sd H���[��I��M���I�?H��L9{I�?tH����L���?���H��uL���-��E����H��W H�5�c H���������H�=o �*��I��H����H�H��H�X���H�58c H�����I��H��uI�$�dL������WL���H�
r H�t$ H�ǺL�d$ L�D$(�GI�I��uL���w��I�$uL���i��M���I�uL���S�����H�khtMH��1�H�5zf 1��3��H��H����H���/��H�MA��uH�����E����t
ǃ�I�E��H�u����H�5?V H�������xyH�
�V H�1tI��H��H�b�<H��H��H��1�����0I��H��H���
I��H��H��L�OV I�3H��1���H�$H�MuH���`��L�$$�H�MuH���L���M��u@H�T$H�t$H�|$����H�{H�����H�T$H�t$H�|$���E1��(L�%�U H�{H���h����yI�$u�L��E1�����H�L$8dH3%(L��t�,��H��H[]A\A]A^A_���AUATUH��H��SH��8dH�%(H�D$(1�H��t$H�ztH�=U H�5�1�H�?�U���YH�T$H�5�1�1�������<H�|$H�'i H�]H�GH9�tH�
�e H9�uNH�D$ H�t$ ������tj��H�t$ uH�uJH������@H����H�|$ H��H�����1�1�H�5��P��H��tH�uH�����H��1����H���H�l$ L�d$L�l$L��H��L���O��H�t$H��uH��L��L������H�~H�t$H9�t	������t�H�t$H���L���H�|$H��H�u�?��H�|$ H��t
H�u�+��H�|$H��t
H�u���H�L$(dH3%(H��t�_��H��8[]A\A]���APH��tH�ztH�cS H�54H�:����2H��tH�~tH�?S H�58H�8����H�wH�Y���1�Z�H�+uH�����1�1��]�oH���p��H�=Ig �������H�=�e ��������H�=�h ��������H�=Mj �������H�=�c �������H�=�k ���������H�=�\ �7��H��H����H��f H�5�H��H��f �
������H�Nc H�5}H��H�<c �������H�m H�5{H��H�������yH�=�l H�/u�_��H�+tP1��IH�;m H�5IH��H�������'H�=m H�/u���H�+u�H��1�����H��1������H�-�b uH�=�b ����H�+u�H��1�������H�-�e uH�=�e ���H�+�V���H��1�����H������HH�������H���~���zH���q���,H���d���H���W���H���J���%DH�GL�@8����N�����fD��H�=�k SH��tH�/H��k ����H�=�k H��tH�/H�k ����H�=�k H��tH�/H�~k �t��H�=Ik H��tH�/H�5k �uH�= k H��tH�/H�k ����H�=?k H��tH�/H�+k ����H�=&k H��tH�/H�k ����H�=�j H��tH�/H��j �M��H�=�j H��tH�/H��j ���H�=�j H��tH�/H��j �%��H�=Rj H��tH�/H�>j ��H�=�j H��tH�/H��j t`H�=j H��tH�/H��i u�q��H�=�i H��tH�/H��i u�O��H�=Hj H���I����i [��.����'���r������������UH�=�
SH�����H��i H���d����Ti �����Bi ���H��i H���7���1����H�/i H��� ���H�5�
H�=�
1����H�i H�������H�=r
���H��H�����H�5i
H���z���H��h H�������H�+����H�=V
�T���H��H�������H�5S
H���9���H��h H���u���H�+�y���H�=<
����H��H���a���H�57
H�����H��h H���4���H�5*
H���ٿ��H�bh H������H�+����H�=
���H��H������H�5
H��蘿��H�9h H������H�5�	H���y���H�"h H�������H�5�	H���Z���H�h H�������H�+����H�=�	�4���H��H�������H�5�	H������H��g H���U���H�+�s���H�=�
��H��H���A���H�5�	H���ؾ��H�Qg H������H�+�?���H�=�	貿��H��H������H�5q	H��藾��H��H������1�1�1�H������H�mH��f �����H�H��H�=�f �����H�H�������H�=` 讻���������H�=O^ 蚻���������H�={a 膻���������H�=c �r����������H�=s\ �^������m���H�=d �J������Y�����H�=�U ��H��H���<���H�n_ H�5�
H��H�\_ �Ǻ���������H�\ H�57
H��H��[ 衺�����O���H��e H�55H��H������������H�f H�5H��H��]�����x
H��H��[]�����f.�H�=Ie H�Be H9�tH�fJ H��t	�����H�=e H�5e H)�H��H��H��?H�H�tH�5J H��t��fD�����=�d u+UH�=J H��tH�=�C �Y����d�����d ]������w�����H��H���Leaving task %R does not match the current task %R.Task does not support set_exception operationTask does not support set_result operationFuture object is not initialized._log_traceback can only be set to False/builddir/build/BUILD/Python-3.8.17/Modules/_asynciomodule.cCannot enter into task %R while another task %R is being executed.throw() third argument must be a tracebackinstance exception may not have a separate valueexceptions must be classes deriving BaseException or instances of such a classStopIteration interacts badly with generators and cannot be raised into a Future%s exception was never retrievedTask was destroyed but it is pending!thread-local storage is not availablea coroutine was expected, got %RTask.all_tasks() is deprecated, use asyncio.all_tasks() insteadTask.current_task() is deprecated, use asyncio.current_task() insteadTask cannot await on itself: %Ryield was used instead of yield from for generator in task %R with %Ryield was used instead of yield from in task %R with %RTask %R got Future %R attached to a different loopfunction takes no keyword argumentsfunction takes no positional arguments__asyncio_running_event_loop__no running event loopcannot delete attributeException is not set.Result is not set.O|OOinvalid stateinvalid exception object<%s %U>uninitialized Future objectawait wasn't used with futureTask-%lu_step(): already done: %R %Runinitialized Task objectTask got bad yield: %Rcontext(s)asyncio.eventsget_event_loop_policyasyncio.base_futures_future_repr_infoasyncio.exceptionsInvalidStateErrorCancelledErrorasyncio.base_tasks_task_repr_info_task_get_stack_task_print_stackasyncio.coroutinesiscoroutineextract_stackweakrefWeakSet_all_tasks_current_tasksset_resultset_exceptionadd_done_callbackremove_done_callbackcancelleddoneget_loop_state_asyncio_future_blocking_callbacks_log_traceback_source_tracebacksendthrowclose__self__current_taskget_nameset_nameget_coro_log_destroy_pending_must_cancel_fut_waiterget_event_loop_get_running_loop_set_running_loop_register_task_unregister_task_enter_task_leave_tasklimitfile_asyncio_all_tasks_compatget_debugcall_soon_asyncio.Taskcall_exception_handlermessageadddiscard_asyncio.FutureIter_asyncio.FutureFINISHEDCANCELLEDPENDINGTaskStepMethWrapperTaskWakeupMethWrapper_RunningLoopHolderFuture(*, loop=None)
--

This class is *almost* compatible with concurrent.futures.Future.

    Differences:

    - result() and exception() do not take a timeout argument and
      raise an exception when the future isn't done yet.

    - Callbacks registered with add_done_callback() are always called
      via the event loop's call_soon_threadsafe().

    - This class is not compatible with the wait() and as_completed()
      methods in the concurrent.futures package.Task(coro, *, loop=None, name=None)
--

A coroutine wrapped in a Future._repr_info($self, /)
--

get_loop($self, /)
--

Return the event loop the Future is bound to.cancel($self, /)
--

Cancel the future and schedule callbacks.

If the future is already done or cancelled, return False.  Otherwise,
change the future's state to cancelled, schedule the callbacks and
return True.set_exception($self, exception, /)
--

Mark the future done and set an exception.

If the future is already done when this method is called, raises
InvalidStateError.set_result($self, result, /)
--

Mark the future done and set its result.

If the future is already done when this method is called, raises
InvalidStateError.get_coro($self, /)
--

set_name($self, value, /)
--

get_name($self, /)
--

_repr_info($self, /)
--

print_stack($self, /, *, limit=None, file=None)
--

Print the stack or traceback for this task's coroutine.

This produces output similar to that of the traceback module,
for the frames retrieved by get_stack().  The limit argument
is passed to get_stack().  The file argument is an I/O stream
to which the output is written; by default output is written
to sys.stderr.get_stack($self, /, *, limit=None)
--

Return the list of stack frames for this task's coroutine.

If the coroutine is not done, this returns the stack where it is
suspended.  If the coroutine has completed successfully or was
cancelled, this returns an empty list.  If the coroutine was
terminated by an exception, this returns the list of traceback
frames.

The frames are always ordered from oldest to newest.

The optional limit gives the maximum number of frames to
return; by default all available frames are returned.  Its
meaning differs depending on whether a stack or a traceback is
returned: the newest frames of a stack are returned, but the
oldest frames of a traceback are returned.  (This matches the
behavior of the traceback module.)

For reasons beyond our control, only one stack frame is
returned for a suspended coroutine.cancel($self, /)
--

Request that this task cancel itself.

This arranges for a CancelledError to be thrown into the
wrapped coroutine on the next cycle through the event loop.
The coroutine then has a chance to clean up or even deny
the request using try/except/finally.

Unlike Future.cancel, this does not guarantee that the
task will be cancelled: the exception might be caught and
acted upon, delaying cancellation of the task or preventing
cancellation completely.  The task may also return a value or
raise a different exception.

Immediately after this method is called, Task.cancelled() will
not return True (unless the task was already cancelled).  A
task will be marked as cancelled when the wrapped coroutine
terminates with a CancelledError exception (even if cancel()
was not called).all_tasks($type, /, loop=None)
--

Return a set of all tasks for an event loop.

By default all tasks for the current event loop are returned.current_task($type, /, loop=None)
--

Return the currently running task in an event loop or None.

By default the current task for the current event loop is returned.

None is returned when called not in the context of a Task.set_exception($self, exception, /)
--

set_result($self, result, /)
--

done($self, /)
--

Return True if the future is done.

Done means either that a result / exception are available, or that the
future was cancelled.cancelled($self, /)
--

Return True if the future was cancelled.remove_done_callback($self, fn, /)
--

Remove all instances of a callback from the "call when done" list.

Returns the number of callbacks removed.add_done_callback($self, fn, /, *, context=<unrepresentable>)
--

Add a callback to be run when the future becomes done.

The callback is called with a single argument - the future object. If
the future is already done when this is called, the callback is
scheduled with call_soon.exception($self, /)
--

Return the exception that was set on this future.

The exception (or None if no exception was set) is returned only if
the future is done.  If the future has been cancelled, raises
CancelledError.  If the future isn't done yet, raises
InvalidStateError.result($self, /)
--

Return the result this future represents.

If the future has been cancelled, raises CancelledError.  If the
future's result isn't yet available, raises InvalidStateError.  If
the future is done and has an exception set, this exception is raised._leave_task($module, /, loop, task)
--

Leave task execution or suspend a task.

Task belongs to loop.

Returns None._enter_task($module, /, loop, task)
--

Enter into task execution or resume suspended task.

Task belongs to loop.

Returns None._unregister_task($module, /, task)
--

Unregister a task.

Returns None._register_task($module, /, task)
--

Register a new task in asyncio as executed by loop.

Returns None._set_running_loop($module, loop, /)
--

Set the running event loop.

This is a low-level function intended to be used by event loops.
This function is thread-specific._get_running_loop($module, /)
--

Return the running event loop or None.

This is a low-level function intended to be used by event loops.
This function is thread-specific.get_running_loop($module, /)
--

Return the running event loop.  Raise a RuntimeError if there is none.

This function is thread-specific.get_event_loop($module, /)
--

Return an asyncio event loop.

When called from a coroutine or a callback (e.g. scheduled with
call_soon or similar API), this function will always return the
running event loop.

If there is no running event loop set, the function will return
the result of `get_event_loop_policy().get_event_loop()` call.Accelerator module for asyncio;$c`���@p���hp��������������ʚ����������›��ޛ��0���D���XY����q������������������<���_��� w���4����H���������ƞ������(����k�������,��H����tߠ���C����d����2���ݢ��D�X���lN����������������������i���@���p]���������ɧ����������j���	����$	��@	d���l	���	�����	�����	,���
��<
"���X
�����
ޭ���
����
b����
C������L�������������	���������"�������0����H;���|�����M����.���
-���D
�����

����
����
���������8F���Xp����Y���������e��0(��\����������$c��p,������������4���zRx�$���FJw�?:*3$"D���\��'p����'��������4�
����F�D�D ��
ABBAAB�����'���������# ����44����@F�D�D �_
ABBJABl�����ŗ���ɗ��(�͗��xF�D�D �fAB����#�(���#�7���;���4$?���}B�D�D �d
ABECAB$\�����H0m8V@DHBPI0@�����EY�����EY����CE�}�,���CE�}�S���GE�A~���.E�h($�����B�D�A ��ABP
���VH MhK���dH [�4�������!N�K�4������E�J�F@nHSPDXB`I@fAA4�����E�J�F0o8R@EHBPI0BAA ����4����H����CE�}d����_E�Y����bE�\�G���}H t�����{E�u����bA`$�U����E�K�A �AA���L��
AzRx�� ȝ��`ў��*[Kx��BE�|�	���:[S�+����E�����E�}�Z���,E�bj���ME�G(�����^�A�A �]ABH��A�D �Ah[���	H|P����B�E�A �D(�B0Z
(D ABBAV(D DBB$������H0m8V@DHBPI0@$�����H l(V0D8B@I \����@A�~$4¢���H l(V0D8B@I |\0���&E�Xx:���&E�X�D���^E�O
AD8������F�B�A �A(�QP�(A ABB4�'����B�E�A �A(�GP�(A ABB4(˥��rB�F�D �K(�A0P(D ABB(`���B�A�A �AB���:Y`����(NY�!����A����+QY����gA�e	Q���(NY0$	a����F�A�A �D@y AAB8X	����sF�B�D �A(�DP[(A ABB(�	���F�A�A ��AB$�	a����E�A�A �AA4�	����B�B�A �A(�A0�(D ABB` 
��[F�B�B �B(�A0�A8�DP
8A0A(B BBBER8C0A(B BBB�
خ���A�D {A�
:���	$�
/����E�A�A |AA�
����	�
����RE�s
AP����RE�s
AP04��*B�D�A �J� AAB<hܰ���F�I�D �D@sHUPEXB`I@u AAB(�����gB�A�D �\AB4������E�G�F0t8P@DHBPI0}AA(-����F�D�A ��ABL8ij���F�E�B �A(�A0�GPwXU`EhBpIP'0A(A BBB4�����E�I�D0s8R@EHBPI0�AA<�۶��TF�I�A �D0s8R@EHBPI0� AABH
��HB�B�B �B(�D0�A8�J�&8A0A(B BBB8L
���F�B�A �G(�D`�(A ABB�
x���`FQ
EC(�
<��E�H�D �
DAAzRx� �� p���OGNU������� ��������������������������Ufv:
̅�� �� ���o`��
��� ��2��	���o���op���o�o����o�� P:`:p:�:�:�:�:�:�:�:�:;; ;0;@;P;`;p;�;�;�;�;�;�;�;�;<< <0<@<P<`<p<�<�<�<�<�<�<�<�<== =0=@=P=`=p=�=�=�=�=�=�=�=�=>> >0>@>P>`>p>�>�>�>�>�>�>�>�>?? ?0?@?IO��f �#�lN��i^���]@�-�Pi��?�
d@���\`�T�PD�^�wD@�c��I�9��LБl��Ms�{E�MC��E��-b�I"��H��KI.M���E��yg��BXÍ�Qɍ9FɍiF��f �#�lN�-�Pi��?�
d@�T�PD�^�wD@���H���H��ҍ�p������o� ���S���L�����DK� �9��L�ߍ�D��vS����D��l��Ms�{E�MC��E��-b�I"��H��KI.M���E���F�L�G�?G�WG(��T`�8��J��7�iJ�I�El@�[�W���j�V�`�{�qU������G�@��������������� �~�� ҍҍp� ���� � ֎-�s�����C�c��� #���(��� -�Î9�ێ�����ێ����#��� [���� j����� {��*�3�=�`� ��@� ������ ��͎��g� �aD���F�R`IO`� �� �� Xm`��W@�E�f � �h�g� �aD���D�Q`IO � �� X�k�^E� �W|@�EgQ�� Y��WCz@QF=Q� o� JSGA$3a1:ɅGA$3a1̅م_asyncio.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug{aPL�7zXZ�ִF!t/��G]?�E�h=��ڊ�2N�a�܎9���R��B��X���_��>.����kҸe&���o�
�)����*���2/�5ڌ���/��sf�v�`�p�@U�֬L��?�7z�L������^����g�*�ʛ��Ԓ{ �L<���ە%3�)��6g���ˏ��x+��aYw�	���X��2f�h�N޽�%��v%��$�r{�e��%G��E��9$-�]�����������S|C�9����`j̬{��i��#u���g3�Vd��0���u0�����t��:��'��$��KM�V���\�~�/�����ό�i㭋��8��)�b����x���8���\����E�K�g�k̞L��@�H�x<���҆����kL�N�vx�J9�J��
�2����B�|�p�$di1W��	
X��L�n��nD�t^5oE��_�w�/�� �|��-�э�[DR_�������^��4�8�k�Զ
]]'��`����/�6G�mENZ������y�e���/�u��<)��7�$��gs��?�������8�1�a]��߼ړ�WΣ���Ap��WKVKI_�R�Y��6t��3p�ƑX��i�+�srs���-
^��狊�v�h������+�A�VGӋ�W��܂�!��,��lVEW�G�>{�h��'���
��Sj������>]�f�M�[�#��_��������xO�oYնe�^�_�'�,y�3��L嫨C#i�ֳJ~:��`n����=��"���Lj���
dp��8N���l�u?h�߃T�$I��s�\�W�
��á�d��7Z�'0iI��y4>c�ܵQ�v�TTq�]�`
h2H�������S��hE���7s�����[�G 9z.E#���lze��!�I��#���l6���P[
�L��m�2�-�g�Ip����c��J�'�Iɪ�L{x����?).U�T�}4�K�~rו]&�NZ)�ξ���@6��tLO�P������ةq%w�u�ii��,&#d�$�&��h��)���a���oF��H#��,?7D�z�6�}���G/7Eȿ&�֮��uIS)`�?�����i;
�"�?���P��g���J_|�G)��s|V�n��I�j#%-L
G*x'����a�2X�yoA�_�A�V]�\�w6d��\��������:{�Q&����!�kd��u��pDc� W�$}�K+��ǡДukN��x���\�
l��m�t�$�KvQN�Z#�i��$GIl� F��]�7Z�g���̟>.i�_J�}Ħ��2\���Z�j��f�z)��v�$�Ck��iː��Xu�B�R�t�����j2�/x1�*�湚��3���E�����g[�2s�|"����26��ܕ�4CN(O3��Q4��5[
 2��N���}��U3�q��C�O��1�zH�>����P�[�(�c�$7\9�=-G����^ �)��V4��Vx����V� �/ηe��P�6���3u"կZzƘt/}(��&Z׸�P�B�vK(=]&�O PEn�����t�ȋ%ĺ��#��rN,�g|�	����}��7+��vĭ�'}~ɗ�����`zު`C���:�R�c���Y�c�92�O��ȝ32rt!���`:Χ���ѳ�(��/.L��B O�a�kz,k8k�k'�(Q7�ɻ�uuR�;
���h7k%��]��"�Q�#&~��R3� p�Yo�_��<�V�b��sѰ��>!uu���g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(��
0���8���o���E���opp0T���^B�2�2�h::c@:@:nP?P?wPDPDyA}̅̅
����# ���$������ ��� ����� ����� ��  ��� ����� ��8�� �` �`� `����``�H
��`�DL�(lib-dynload/_random.cpython-38-x86_64-linux-gnu.so000075500000057710151153537510015542 0ustar00ELF>@@�X@8	@H>H> �L�L �L X` �L�L �L 888$$(>(>(>  S�td(>(>(>  P�td�9�9�9��Q�tdR�td�L�L �L xxGNU�~%bX��,�kRv ��VAǭ�+�@ +-.��|CE���qX!������ }���M� K�n�, ^TF"6�k4���$���|*�����R �R 
�R ��5U__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6_PyOS_URandomNonblock__stack_chk_fail_Py_NoneStructPyObject_HashPyLong_FromSize_t_PyLong_NumBitsPyMem_Malloc_PyLong_AsByteArray_Py_DeallocPyMem_FreePyLong_TypePyErr_Clear_PyTime_GetSystemClockgetpid_PyTime_GetMonotonicClockPyErr_OccurredPyErr_NoMemory_PyArg_NoKeywordsPyExc_TypeErrorPyErr_SetStringPyTuple_SizePyExc_ValueErrorPyLong_AsUnsignedLongPyLong_AsLongPyTuple_NewPyLong_FromUnsignedLongPyLong_FromLong_PyArg_CheckPositionalPyFloat_FromDoublePyFloat_TypePyType_IsSubtype_PyLong_AsInt_PyLong_FromByteArrayPyInit__randomPyType_ReadyPyModule_Create2PyModule_AddObjectPyObject_GenericGetAttrPyObject_Free_edata__bss_start_endGLIBC_2.4GLIBC_2.2.5vii
ui	(�L -�L �,�L �L P �6P PP �8 P k6(P �58P @8@P p6HP 9XP �7`P y6hP �xP �7�P �6�P @!�P  7�P �6�P �9XQ �6�Q  9(R P xR 5�O �O �O 	�O �O �O �O �O �O �Q �R !�N �N �N �N �N �N �N 
�N �N O 
O O O  O (O 0O 8O @O HO PO XO `O hO  pO "xO #�O $�O %�O &�O '�O (�O )�O *��H��H��> H��t��H����5r= �%s= ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h�������%m; D���%e; D���%]; D���%U; D���%M; D���%E; D���%=; D���%5; D���%-; D���%%; D���%; D���%; D���%
; D���%; D���%�: D���%�: D���%�: D���%�: D���%�: D���%�: D���%�: D���%�: D���%�: D���%�: D���%�: D���%�: D���%�: D���%�: D���%�: D���%�: D���%}: D���%u: D���A������H�D$�d����D$���H�t$�L��H�D$��zE1�1��H�D$�k���H�L$H����E1�1���������1���1���H�������H�+t1��{H��1�����l��AVAUATUSH���	dH�%(H��$�	1�H�F���uL�
�9 H�5 I�9����1���I��H��H��1��]���I��H=qt8L�S9 H�5< I�8���1�����H��uXE�t�H��H��ptH�|����I��H���u���H�������H���u$�>���H��uH�=�8 H�5�H�?�3���1��0H=pw�A�D$1�A�T
A�TH��H���	u�H��8 H�H��$�	dH3%(t�W���H���	[]A\A]A^���ATI���qUS���H��tKH��1�A�|,���H��t*H�DkH��H���	u�Ic|$�
���H��t	H����H�uH������1�H��[]A\�1ҹH��H�=����������[1�]A\�H�5 8 ��L��7 H�5�E1�I�8���������E1�����H��uH��7 H�5�E1�H�;������E1��1���f.���UL�GS�G=o���HHcЉOA�4����1މ�����V,�1�A��A��A����D1�A��A��D1����p�����GHc�E��E��A��E1�D�����V,�D1ۉ��%��1É��1�f��f�[�*��Y
� ��]�*��X��Y� ����E�P�OH�� L��H���E�Ӂ��D��A������A	�D��A����A3�4B3�A�D�WE��A���A���A	�D��A����3�LB3�D�_ �WE��A���E	�L�W D��A����3�PB3��Wf�E�JA�rA���D��A���D�ʁ��A����D	�A���A	�A�ˉ��A�rA��E3�4D3�D��A����A3�8B3�A��A������A�JA	щ�A�rE�D��A��E�Z��A3�<B3�A��A������A�JA	щ�A�rD��A����A3�@B3�A��A���A�JA	�D����A3�D���A����A�rB3�I��A�J�A����A���A	щ�D�ށ��D��A��	���A3�,B3�A���A�J�A��E3�0D3�E�J�L9������H��D���I��M)�I��I��I��A����I��toI��t3��A��������%���	�A�Ã�A��E3D3�E���I�@���H��A�ɋ���ʁ��D	�A�҃�A��D3P�D3�D������H��A�ˋ���΁��D	މ����3P�3����H9����D������H��A��D��A������E��D���D	щ΃���3p�34�D�ف��A�����|D	�D���D�މʃ�E����3P�3�A���A������A	�D��A����3H�B3��������΁��D	Ή����3P�3����H9��5����G���	�G��A�Á����A���1�D	�A�‰��A����3�D3�A��V,����	D1Љ������1�A��A��D1���ōF�GA�<�A��A��D1�A��A��A��V,�D1߉�������1׉����q���A�X�wL��L�_ L�
2H����ف�����	��A�ʃ����A��E3�4E3�E�D�WD��A������	�ك���3�LA3��_ �O�ف��D	щ΃���3�PA34��wE�S���D�с��	ى΃���A3�4A34�D��A�3A�s���A��A���A	ʉ�D��A�������A3�8C3�E�SA�[D�ց��	�D�щ�������A3�<A3�A�sA�[A��A���A	ʉ�D��A�������A3�@C3�E�SA�[D�ց��	�D�щ���A3�D��I��A3�A�s����A�[�A����A���A	ʉ�D��A����A3�,C3�A�[�A��ށ��	�A���A��E3�0E3�E�S�L9������H��D���I��M)�I��I��I��A����I��tiI��t1�����A�����%���	ȉÃ���A3A3�A���I�@���H��A�󋰌����D	ى˃���3X�A3�������H��A�󋰌����D	ى˃���3X�A3����H9���f�������A��΁�����D	�A�ˉ����3A3��������������D	�A��˃���3XA3��������΁�����D	�A�ˉ����3XA3����H�X���H������D	�A�ʃ�A��D3P�E3�D���H9��4������	�G1�%������	‰Ѓ���3�DA3����	�����AWAVAUATUH��SH��H��(H�~H�5}. H9��q��������d���H���O�Ã���|������~����� wHcuL�E��o�T�F� �EA�,�)ى��1�A��A��A��V,�D1�A��A��A����D1߉���1�H��(��[]A\A]A^A_�]�ff.�f�D�h�A��B�4�Hc�H�|$���I��H������H���H�C�A��H�L$A��H�uL�cE)�L��DA��E)�A�� ��LcuA��o��E�~D�}F�,�D���D1�����V,�1�A��A��A����D1�A��A��D1������:��H���� �{DL�z�:��L��D9���Hc}�� ��o�2D�oD�m�����1�A��A��A��V,�D1�A��A��A����D1�A��A��D1�~bA�?��H���� Lc}A��o��A��}F�,�D���D1�����V,�1�A��A��A����D1�A��A��D1����4���� )���:��H��D9�t�� ���fDH�t$L��1ɺ�,�L��I����H��(L��[]A\A]A^A_�A�xD�ML��L�-�L���A��A�����A������E	�D��A����A3�4C3T�A��uL�u A����A���A	�D��A����3�LC3T�D�U �UE��A���A	�D��A����3�PC3T��Uf�E�~E�NA���E�^D��D��A���A���������D	�D	��΃��׃���A3�4A3t���D��A3�8A3|�A�6���A�VA�~A���D	�E�NA�ʃ��ׁ��A��E3�<E3T�D�Ɂ�����E�V	�D	�A��A�ʃ�A��A��E3�@E3|�E3�D��E�~A���E3T�E�~I��E�V�E�D��A���D�с�����D	�D	������ʃ���A3�,��A3t�A3�0A3T�A�v�A�V�M9������L��D���M��M)�I��I��I��A����I��trI��t5A��A���A�����%���D	��ǃ���A38A3|�A���I�@���H��A�ȋ��A��A���E	�D��A����3P�C3T�������H��A�ʋ��A��A���E	�D��A����3P�C3T����I9���ff.�@���D������L�HH��A��E�ց��A���A���A���A	�A	ˋ��D��A��D��A����3H�C3L�A��A�����|��3P�E	�C3T����D��A�������3H�C3L����A���A��A���A	�D��A����3P�C3T�A���I9��+����}D���	�E��A���%���A	�D��A����3�DC3T����	����1�����V,�1�A��A��A����D1߉���1Ϲ )����L�|$D�uH��H��I)�I��I��I��A����I��trI��t5A���E��D�vD�����D	�A����A��D3�4E3,�D�.H�~A���H��E��D�7E��A���E	�E��A��A��D3�0G3<�D��A���H��E��D�7E��A���E	�E��A��A��D3�0G3<�D��H9|$��L�d$L�l$ff.�D�OA���H��E��A���A���E	�E��A��A��D3�$G3<�D�w�D��E��A���A���E	�E��A��A��D3�(G3<�D�O�D��E��A���A���E	�E��A��A��D3�,G3<�D�7D��E��A���E	�E��A��A��D3�0G3<�D��I9��0���L�d$L��D���H)�H��H��H������H��twH��t8E��D���A���D�Ɂ��D	�A�΃�A��D36E34�D���H�NA���H��E��D���D�ρ��D	�A����A��D3q�E34�D���A���H��E��D���D�ρ��D	�A����A��D3q�E34�D���I9���f.�D���A���H��E��E��A���A���E	�D���D��A����3y�C3<�D�����|D��E��E��A������A���A���D	�E	�E��A����A��D3q�E34�D��A����3y�D���C3<�D������E��A���E	�D��A����3y�C3<����I9��%����MD���	�EA��A���A���E	�D��A����3�DC3<����	���1�A��A��A��V,�D1�A��A��A����D1�����1σ��s����e���f�H�=�& H��& H9�tH�f# H��t	�����H�=Y& H�5R& H)�H��H��H��?H�H�tH�-# H��t��fD�����=& u+UH�=# H��tH�=� �I��d�����% ]������w����SH�OA��� 4��G��+�G�҂�G�� 4E��A��E1�Ei�e�lL�PA�A�ۉ\�A��A1�Ei�e�lC�A��B�\�L�PA��A1�H�XEi�e�lG�F�L�E��A��E1�Ei�e�lE�E��D�\�H�XA��E1�Ei�e�lE�L�PE��D�\�H�XA��E1�Ei�e�lE�D�\�D���D1�L�XDi�e�lG�F�L�E��A��E1�Ai�e�lF�E��F�L�L�XH��	A��E1�Ei�e�lE�F�T�H=p���H��p�GpHC�E1�I���L�Ã���H����H��t6D�	A�D���D1�Di�
fD3YD�D�YL9��bI��H��H��L��\�A��A��A1�B��Ei�
fE3D�I��A�E�H=o�!L9��/I��L��H��B�\	�N�	A��A��A1�B��Ei�
fE3D�I��A�E�H=o��L9���I�����oI��I��A��M���lH��D�T�L�D���D1�Di�e�X]E3A)�H��E�H����I���*I��t6L��F�L�N�D���D1�i�e�X]A3)�H��A�H���BL��F�T�N�E��A��E1�Ai�e�X]A3)�H��A�H�����H����H��D�D�L�E��A��E1�Ei�e�X]E3A)�H�XE�H����H��D�D�L�E��A��E1�Ei�e�X]E3A)�H�XE�H����H��H��D�D�L�E��A��E1�Ei�e�X]E3A)�E�H��tTH��D�D�L�H�XE��A��E1�Ei�e�X]E3A)�E�H��p�������	�G�H���-����G�[�E1�L��H��I��B�\	�N�	A��A��A1�B��Ei�
fE3D�I��A�E�H=o�4L9��BL��H��B�\	�N�	A��A��A1�B��Ei�
fE3D�I��A�E�H=o��L9���L��H��B�\	�N�	A��A��A1�B��Ei�
fE3D�I��A�E�H=owcL9�vqI���)���L��H��B�\	�N�	A��A��A1�B��Ei�
fE3D�I��A�E�H=o��L9������������	�G�L9�w�E1�늋��	�G�L9��,���E1��$������	�G�L9������E1�������	�G�L9��^���E1��V������	�G��j���E1�������	�G�L9�����E1�����U��	H��SH���	dH�%(H��$�	1�H��H����������pH��H�����1�H��$�	dH3%(u
H���	[]����DAWAVAUI��ATUSH��8H�-0 dH�%(H�D$(1�H9��
H���H�F�����H���m�H����t�H�����I��M���`�L����H��H����U�H���n�H��H��H�YL�<�L�����I��H���P�E1��L��H��L���3�����=�H��L��L���|���H�EI�,$uL�����L������H�L$(dH3%(H��u?H��8[]A\A]A^A_�H� H��H�Z`�S@I���-���L���M������M�H�E��y��f���H�% UH��SH��QH9�uH��u8H��1���0H��H��t=H��H���d���H�����H�(�k�H��Z[]�H��H�=.�{����u��_��Z�ff.�f���ATI��UH��SH��H�����H��~I�4$[H��]A\����ff.���SH�=d �o�����S���H�=� ���H��H��tH�7 H�5�H��H�% � ��H��[���H��H���state vector must be a tupleinvalid stateseedgetstatesetstategetrandbits_random_random.Randomstate vector is the wrong sizeinteger argument expected, got floatnumber of bits must be greater than zerogetrandbits($self, k, /)
--

getrandbits(k) -> x.  Generates an int with k random bits.setstate($self, state, /)
--

setstate(state) -> None.  Restores generator state.getstate($self, /)
--

getstate() -> tuple containing the current state.seed($self, n=None, /)
--

seed([n]) -> None.

Defaults to use urandom and falls back to a combination
of the current time and the process identifier.random($self, /)
--

random() -> x in the interval [0, 1).Random() -> create a random number generator with its own internal state.Module implements the Mersenne Twister random number generator.߰��A�<;�X���h���h��dp������D��Xa���������d��4x��4h�\8�h������x8��������������zRx�$���FJw�?:*3$"D���\8�0A�5
A(|H���kA�I�G�R
AAAzRx����$���H�X���WB�B�B �E(�A0�A8�Dp
8A0A(B BBBA zRx�p������(����(`4���sL�D�D 
AAAzRx� �� ���)@����FF�B�B �A(�A0�G�*0A(A BBB(���oF�I�A �[AB(,��5F�D�D �W
DBEzRx� ���$���5c
CBA$�<���E�E��
PUd��F�B�B �B(�A0�D8�G`�
8C0A(B BBBR�
8D0A(B BBBA zRx�`������(��_`�UE�OzRx�� (��GNU�-�,�L Ufv
(6�L �L ���o`�
4�N �
H	���o���o�
���o�o4
���o�L @P`p�������� 0@P`p�������� 0�6P�8k6�5�@8p69�7y6��7�6@! 7�6�9���������6�	 9P 5GA$3a156_random.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug?���7zXZ�ִF!t/����]?�E�h=��ڊ�2N�:4j[�P	���кZO7���@pnY(��4qa�<�˒M&�ד�f���EYDj���i�MzH����>��2��'���ʾ�j�$�҇d��k;���M������j�ޟE��$.cw#�p^`���ސ�'�O�2���^7'i��i�y���m�덺w��@Q���+^f���f	�LO����92�,��⫊Z�_���o��S�+ޑ��v���6^eW�K�cK���`�C�
��!�J��{���H�4ֽC��V&K���L%�h��}�l�Mk:���/���4���v���S$~z�ScR�_$�Ed>�6
?M�O2e��{'>����f�"��T��}j-�{t�dX`���2釴�m"����0�]��L����}���]�'��95��=�MC���C<�F�j�w�ە	�>1!�	Q��i��P���MXx��_�n�,<'w���-)*�[����&�
E6J��W�<�϶
v2}��4FeKw�-A��kf�:�u��O�L�``�?��__��o#�2Yh�Yc�?s�N�u�+�x�U��Rs�x�$�)64_�K�Nq�Y�Ӽ$�Sr�"J�*k���-!t���1`
9#���:��˰]�8��~*Sh.����r�\��^�"K�MY=8�8�>��HB�×WG�f�)�E�B�˔RRN	K�zQ\y:E�>�B�ǻ$��V���[�X��s��k:��%�כ��\�T��;~�#�MF�e�I�s{K2ͭ�׆V�Y�a�1���:TI�8&����1�د�bG�����?J��H.#�Τ��y��V4�ދ����<f�\�[���i��<B,�G.<P�9����xve]&:�qj ���	�~8�%�1c��OuI 2�{�4�K�!+|�Q'�J�
:s|f��sB�?Ki�ٵ{���,�#o���!���ұ�g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(��h048���o4
4
^E���o�
�
0T�
�
H^Bhc00n@@w@@� }(6(6
�@6@6� ��9�9��x:x:��(>(> ��L �L��L �L��L �L��L �L��N �N`�P P� ��R �R��R`�R$
S`dS�`W(lib-dynload/grp.cpython-38-x86_64-linux-gnu.so000075500000037200151153537510014703 0ustar00ELF>`@@7@8	@h&h& P,P, P, �� �,�, �, 888$$H&H&H&  S�tdH&H&H&  P�td$$$LLQ�tdR�tdP,P, P, ��GNUbA��.Ћ2Il�����t+�� +-.��|CE���qX�o��q��F �0��� �@��, �F"�c����
����W�|`��3�3 2 
2 �P�__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6PyStructSequence_NewPyList_NewPyUnicode_DecodeFSDefaultPyList_Append_Py_Dealloc_Py_NoneStruct_PyLong_FromGidPyErr_Occurredsetgrentgetgrentendgrent_PyArg_UnpackKeywords_PyArg_BadArgumentPyUnicode_EncodeFSDefault_PyUnicode_ReadyPyBytes_AsStringAndSizePyEval_SaveThreadsysconfPyMem_RawReallocgetgrnam_rPyEval_RestoreThreadPyErr_NoMemoryPyExc_KeyErrorPyErr_FormatPyMem_RawFree__stack_chk_fail_Py_Gid_ConverterPyExc_TypeErrorPyErr_ExceptionMatchesPyErr_ClearPyExc_DeprecationWarningPyErr_WarnFormatPyNumber_Longgetgrgid_rPyInit_grpPyModule_Create2PyModule_GetDictPyStructSequence_InitType2PyDict_SetItemString_edata__bss_start_endGLIBC_2.4GLIBC_2.2.5vii
ui	%P, @X, `, `, p, I�, n0 ;0 C0 N0 X 0 a(0 h00 q80 x`0 �h0 $x0 `!�0 �0 �0 � �0 ��0 y�0 ��0 ��0 �0 0 (1 �01 "@1 `0 �1 �, �1 ��1 p, �1 �/ �/ 	�/ 
�/ 
�/ �/ �/ �/ �. �. �. �. �. �. �. �. �. �. �. / / / /  / (/ 0/ 8/ @/ H/ P/ X/ `/ h/  p/ !x/ "�/ #�/ $�/ %�/ &�/ '�/ (�/ )�/ *��H��H�� H��t��H����5� �%� ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"��������%m D���%e D���%] D���%U D���%M D���%E D���%= D���%5 D���%- D���%% D���% D���% D���%
 D���% D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%} D���%u D���%m D���%e D���%] DAVAUATI��H�=� USH������H����1�H�����H��H����M�l$I�}H��tU���I��H��t"H��H�����I���t H��I�uL���	���H�Mu}H������sH��I�uL�����I���I�<$�Z���I�|$H�CH��t�G���H�C �H�� H�H�C A�|$����H�D$�~D$H�l$D$C(���H��tH�uH���y���1�H��H��[]A\A]A^���U1�SQ���H��H��tq�������H��t]H�����H��H��t$H��H�������H�Et'H��H�EuH������H�uH����������1��H��H�Eu�H���������H��Z[]���AWAVAUATUSH��H��H��XdH�%(H�D$H1�H��uH��~H��H��u.PH��A�1�L�i H�D$HPjj�j���H�� H��H��t*H�H�Q���u"H�wH�5tH�=}���E1��Y�y y��L�#E1�L�����H��H��u�4H���O�����u���1�H�t$H���Z��������=����EH�$���I��H���uA�H�L$ E1�L�|$H�L$L��L������H��H��uH�D$L���JH�t$H�|$M��L��H�������t.H�D$��"uH��������?I9�M�I���1���H�<$�D$���L�t$�|$M��u(��u�����/L� L��H�5�1�I�8�����L�����I���E1�1�H���Q���H�MuH�����H�T$HdH3%(L��t�k���H��X[]A\A]A^A_���AWAVAUATUSH��H��H��XdH�%(H�D$H1�H��uH��~H��H��u2PH��A�1�L� H�D$HPjj�M���H�� H��H����H�H�l$H��H���
�������H� H�:������tb�*���H�K1��H�= H��H�IH�?�%�����x4H������I��H��t$H��H�����I�4$��uH��I�4$uL�����1��4H��I�4$uL��������EH�D$�Q���H��H���u�E1�L�|$L�t$ I��������?H��L���q���H��H��uH�D$L��A��B�|$M��H��H��L�����A�ą�t&H�D$��"u
L9�
H�I���E1��A�H�|$�9���H�\$H��uZH���G���A��u
�}���H���V�|$���I��H������L�� H��1�H�5�I�8�x���I����L������H���
���H��H�����H�T$HdH3%(H��t�
���H��X[]A\A]A^A_�1��7@H�=i H�b H9�tH�. H��t	�����H�=9 H�52 H)�H��H��H��?H�H�tH�� H��t��fD�����=� u+UH�=� H��tH�=> ����d����� ]������w������U��H�=� SQ���H������H��H�������=� H��uH�5Q H�=� ������x0H�� H�5�H���{�����x�] H��Z[]���������H��H���strargument 'name'getgrnamgetgrgid(): gid not found: %Sgr_namegroup namegr_passwdpasswordgr_gidgroup idgr_memgroup membersgetgrgidgetgrallgrp.struct_groupgrpgetgrnam(): name not found: %Rgroup id must be int, not %.200grp.struct_group: Results from getgr*() routines.

This object may be accessed either as a tuple of
  (gr_name,gr_passwd,gr_gid,gr_mem)
or via the object attributes as named in the above tuple.
getgrall($module, /)
--

Return a list of all available group entries, in arbitrary order.

An entry whose name starts with '+' or '-' represents an instruction
to use YP/NIS and may not be accessible via getgrnam or getgrgid.getgrnam($module, /, name)
--

Return the group database entry for the given group name.

If name is not valid, raise KeyError.getgrgid($module, /, id)
--

Return the group database entry for the given numeric group ID.

If id is not valid, raise KeyError.Access to the Unix group database.

Group entries are reported as 4-tuples containing the following fields
from the group database, in order:

  gr_name   - name of the group
  gr_passwd - group password (encrypted); often empty
  gr_gid    - numeric ID of the group
  gr_mem    - list of members

The gid is an integer, name and password are strings.  (Note that most
users are not explicitly listed as members of the groups they are in
according to the password database.  Check both databases to get
complete membership information.);H��d�D�]�������li���4����zRx�$h�@FJw�?:*3$"D��0<\��B�B�B �K(�A0�D@�0D(A BBB$�q�E�C�A �AA\���F�B�B �B(�A0�A8�J�f�X�B�B�I��8A0A(B BBB\$��aF�B�B �B(�A0�A8�J�f�X�B�B�I��8A0A(B BBB(�`����E�M�A d
AAAzRx� �� M���GNU�@`, InUfv�
�P, X, ���o`�
1�. H��
�	���o���o�
���o�o2
���o �,  0@P`p�������� 0@P`p�������� ;CNXahqx�$�`!�� �y��0 �"��������`0 �, �p, GA$3a1��grp.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debugǑtU�7zXZ�ִF!t/���Q]?�E�h=��ڊ�2N��>c��[r4�5�ܹE�2��B^k���R
���D�`)�YI���S��0�S�>��z��bˊ�9�ʃW#�	��c�¢O��שE;�ŧF�/�������"{�6�%	�s(�`�3a�FB�;�AI��Y��.|۟��P�г�흄r�21�@��EV�m{��=��Ad7�~e��i��X�m�<X�J�8(<r hc��^D[k��#U����T�C�sa��I����%�DB+�0�fG#{�{K���S9e�Z�w{���RP���c��'@����hܬmnH�,��[b�7�{q��	�?d[�h�L�c+��U�o����ZÇ���9�3Ӧ��:�����_Q�1
��
_���e�?nb���Xn�s_�9�Cd8ģ3k�N.��)O�]����-���e�L�1���$�8��*��-2\��K<�u�O�[�l\��H]e�=:��2;��;�4cOuŖ��oV���V�hg�a�-^�ho2Dm���������Ǧ(CX9�٭�d9���
��B���X�-���d�T;�8{��{����o�-V	֓��a��y��N����L17�w�m;�@V���k&�)��tF%�,��{��|E�N.�?*��[C��@�����[�.;���:PM@���z�{�d"%v��S!Eg�B7q�����$��j��fA!��7	[m�nx�_�H�'plٙ�@�d�}Z@��Ob:��<���-c;���1S�coE]�����w�I;�z}�vu���h*\���`�i[q��"�9�VKR~�P�Y�
b���]hem8�9`�����ao6�����A��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(��h018���o2
2
^E���o�
�
0T�
�
�^B��Hh��c��@n000w``t}��
� �$$L�h$h$��H&H& �P, P,�X, X,�`, `,0��, �,��. �.p�0 0 �2 2� ��3`2$
$2\�2�6(lib-dynload/_queue.cpython-38-x86_64-linux-gnu.so000075500000040240151153537510015374 0ustar00ELF>@`9@8	@�'�' ,, , �� �,�, �, 888$$x'x'x'  S�tdx'x'x'  P�td�$�$�$��Q�tdR�td,, , ��GNU�	G�^Qy��������3�d�'�@  ')*��|CE���qX%�Cm�� (��R��� �	<, &F"n��\�e@��|��������!�3 �3 �3 ���__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6_PyArg_NoPositionalPyList_NewPyThread_allocate_lock_Py_DeallocPyExc_MemoryErrorPyErr_SetString_PyArg_NoKeywordsPyLong_FromSsize_tPyErr_OccurredPyBool_FromLongPyObject_GC_UnTrackPyThread_release_lockPyThread_free_lockPyObject_ClearWeakRefsPyList_Append_Py_NoneStruct_PyArg_UnpackKeywords__stack_chk_failPyObject_IsTrue_PyTime_FromSecondsObjectPyExc_ValueError_PyTime_AsMicrosecondsPyExc_OverflowError_PyTime_GetMonotonicClockPyThread_acquire_lock_timedPyEval_SaveThreadPyEval_RestoreThreadPy_MakePendingCallsPyErr_SetNonePyList_SetSlicePyInit__queuePyModule_Create2PyErr_NewExceptionWithDocPyModule_AddObjectPyType_Ready_edata__bss_start_endGLIBC_2.4GLIBC_2.2.5vii
&ui	0, �, � ,  , @, &`, &h, +p, 1�, +�, 10 �0 *0 �# 0 (0 >80 �!@0 H0 ,X0 !`0 h0 ax0   �0 �0 ��0 `�0  �0 ��0 1 91  $h1 �, p1 �1 `, �1 �1 @, �1 82 @P2 E�2 ��2 3 0 X3 �/ �/ �/ 
�/ �/ �/ �/ �/ �. �. �. �. �. �. �. 	�. 
�. �. / / / /  / (/ 0/ 8/ @/ H/ P/ X/ `/ h/ p/  x/ !�/ "�/ #�/ $�/ %�/ &��H��H�� H��t��H����5� �%� ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h���������%� D���%� D���%� D���%} D���%u D���%m D���%e D���%] D���%U D���%M D���%E D���%= D���%5 D���%- D���%% D���% D���% D���%
 D���% D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D��H� H��H��tH���1����H�� USH��QH9�t1�H���0H��H��u �kH��H����H�=������up�MH�@01����H�E ����H�E(H�EH��u(H�MuH������H�1 H�5H�:�2���1��?H�} u8H�Mu���H��1������"H���V���H��H�=e�������?����H��Z[]���SH�G H�XH+_(H���t	H��[������H��t���1�[���H�G H�W(1�H9P@�������SH�����H�{H��t�{~�j���H�{����H�{ H��t
H�u����H�{0tH�����H�CH��[H��@��SH��H� �����1���x �{t�CH�{����H� H�[���SH��H��H��H��dH�<%(H�|$1�H��uH��~H��H��u+WA�L�� H��H�T$R1�jj�^���H�� H��tH�0H���\���H�\$dH3%(t����H��[���ATH��H��USH��H�� dH�%(H�T$1�H��tH�QH�,2H��uH��~H��H��u/RA�L�� 1�H�|$WH��jj����H�� H��u1��)H��L� u
L��H������H�xH��t��V�����y���H�\$dH3%(t�K���H�� []A\�AVAUATUSH��H��dH�%(H�L$1Ʌ���H;� H����H��H��������xH�<$H��yH�/ H�5�H�;�X���E1��w�����H��S㥛� I��H9�~H�
- H�5E1�H�9�����=����H$H���
E1�1��I��1�H�s H�S(H�~H9���H�{1�1��I���A��u)M��t$����H�{�L��I���$���L��A������A��u�~�����y�=���E��uH�=q E1��!�����CH���q����g���H��H)�H�<$����I���P���L�FL�8 M��H��H)�M�!I�M�H�S(H9�~5H�{ 1�1������tL�k L�[(M�uI��L�[(O�$�E1��H�C(�{tH�{�����CH�L$dH3%(L��t�A���H��[]A\A]A^���H�� 1������ATI��U1�SH��H��H�� dH�%(H�D$1�H��tH�iH�H��uH��xH��H��u/PH��E1�L�� 1�H�D$Pjj���H�� H��H��u1��KH��t#H�;H��t�����x�H��u��H�S�H�� ��H�� ��L���"�����H�T$dH3%(t�K���H�� []A\�1��lf.��H�=� H�� H9�tH�n H��t	�����H�=Y H�5R H)�H��H��H��?H�H�tH�5 H��t��fD�����= u+UH�= H��tH�=^ �)����d����� ]������w������S��H�=� ���H������1�1�H�5fH��H�=�����H�� H�����H�H��H�5�H�����������H�=� ����������H�� H�5�H��H�� ����������H��[���H��H���can't allocate locktimeout value is too large_queue.Emptyemptygetget_nowaitputput_nowaitqsizeitemblocktimeout_queue_queue.SimpleQueue'timeout' must be a non-negative numberException raised by Queue.get(block=0)/get_nowait().SimpleQueue()
--

Simple, unbounded, reentrant FIFO queue.qsize($self, /)
--

Return the approximate size of the queue (not reliable!).put_nowait($self, /, item)
--

Put an item into the queue without blocking.

This is exactly equivalent to `put(item)` and is only provided
for compatibility with the Queue class.put($self, /, item, block=True, timeout=None)
--

Put the item on the queue.

The optional 'block' and 'timeout' arguments are ignored, as this method
never blocks.  They are provided for compatibility with the Queue class.get_nowait($self, /)
--

Remove and return an item from the queue without blocking.

Only get an item if one is immediately available. Otherwise
raise the Empty exception.get($self, /, block=True, timeout=None)
--

Remove and return an item from the queue.

If optional args 'block' is true and 'timeout' is None (the default),
block if necessary until an item is available. If 'timeout' is
a non-negative number, it blocks at most 'timeout' seconds and raises
the Empty exception if no item was available within that time.
Otherwise ('block' is false), return an item if one is immediately
available, else raise the Empty exception ('timeout' is ignored
in that case).empty($self, /)
--

Return True if the queue is empty, False otherwise (not reliable!).C implementation of the Python queue module.
This module is an implementation detail, please do not use it directly.;�x��x��h�����`���<��P
�lA���������<����P�����X����zRx�$��FJw�?:*3$"D���\��$p���L�A�D �AA�<�2E�V
EQ�N��U�]E�O���7A�u,��E�M f(V0D8B@I iA<4	�F�G�A �G@sHUPEXB`I@K AAB@t��B�B�B �A(�A0�G@�0A(A BBB�P�<�N��F�D�C �J@rHUPBXB`I@p AAB�����E��zRx�� ��GNU��� , &&+1+1Ufv�
�, , ���o`��
<�. �h
�	���o���o8
���o�o�	���o)�,  0@P`p�������� 0@P`p���������*�#>��!,!a�  ��` �9 $���������, `, @, @8ED�00 GA$3a1��_queue.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug�I�M�7zXZ�ִF!t/��W�]?�E�h=��ڊ�2N�s�U�6o�#�s�3c�A�k�F2hE;��/Ph�Ӳu�M�*������T�:/u0"ŗ�����65o#�s��HiZ�v��k��-/O5(�S58#/��ٻ����+y�){V�=^;Y~��{�!�Y?%+<9�
�`��8ӄ�C�'�JJ{�sj'�^�6p�@��Nʫ�;ـ��%��oUb���?��w��r|+���T
�=�F���Cu}��:��*`�
)Z%}:4��+�D9-�TO��
��.A�yc�jX���bu2�Y�1������� E����?��cc|滳P�i>R��qqI_�
ټ/B�=�ۄۅ�;
qU�_E��6<iK��`�7)�l]�-K�g���Y��c�kA�2D�I�	�R0�b�c-�;��Y[�&t��{�����26f������@B*ؑ%cal??s	+w��K[����e�[��vH)Gr��8"����@ĕ�NmƋ	ϟ���ĸ��70�)��H��8�tQI��d���R��*���={�IK=��R�bۓf�gp�����
9�@�A�
.�,-3mM����#����e�����D�v^��-<�0^+^e_)�G���{�eTз�5[
���� 7����<Ӗ�Ł��=BK�6�����@
��2�ԏ_G�����Jd�#�Y���vTM҇G.������|�-�����re+G�n�������_.)1��w�2�4�4�X�#�?"I��@���*�ic�&�������v���8���E�9}�ݭ
D�j�|�
�U�R-�?��3���>��ֈ���㎫f*l�t� -���Cnb���:Óbw�v?~Z�n�WB�D3�{����J�i\F����
ҹ<�=�h;��.����U��~c�
a����lYcGs�ws����_2Y�9z�� 1Ү��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(��0��<8���o�	�	VE���o8
8
0Th
h
�^B�h��cn�w�}��
���� ��$�$�� % %X�x'x' �, ,�, ,� ,  ,x ��, �,��. �.P�0 0� ��3 �3��3`�3$
�3`D4�88(lib-dynload/_gdbm.cpython-38-x86_64-linux-gnu.so000075500000060570151153537510015171 0ustar00ELF>p@8Z@8	@P@P@ �K�K �K hx LL L 888$$0@0@0@  S�td0@0@0@  P�td�;�;�;��Q�tdR�td�K�K �K GNU-�T7�@�A�mu���:	�d:�@!:<=��|CE���qX;������3�\�< ~�"D/ ���, ��F"1�R�R�A����x����H�p��V��m]��hT 
XT XT {`*�__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libgdbm.so.6libpthread.so.0libc.so.6_PyObject_CallMethodId_SizeT_PyArg_Parse_SizeTPyExc_TypeErrorPyErr_SetStringPyExc_OverflowError__stack_chk_failgdbm_deletegdbm_errno_locationPyExc_KeyErrorPyErr_SetObject__errno_locationgdbm_storePyErr_SetFromErrnogdbm_strerrorgdbm_fetchPyBytes_FromStringAndSizefree_PyArg_CheckPositional_Py_NoneStructPyErr_ExceptionMatchesPyErr_Cleargdbm_nextkeygdbm_firstkeygdbm_closePyUnicode_AsUTF8AndSizePyErr_Formatgdbm_existsPyObject_Free_PyErr_BadInternalCallPyList_NewPyList_Append_Py_Deallocgdbm_syncgdbm_reorganize_PyArg_BadArgument_PyUnicode_ReadyPyFloat_TypePyType_IsSubtype_PyLong_AsIntPyErr_OccurredPyOS_snprintfPyUnicode_EncodeFSDefaultPyExc_ValueError_PyObject_Newgdbm_openPyErr_SetFromErrnoWithFilenamePyInit__gdbmPyType_ReadyPyModule_Create2PyExc_OSErrorPyErr_NewExceptionPyModule_AddObjectPyModule_AddStringConstant_Py_BuildValue_SizeT_edata__bss_start_endGLIBC_2.2.5GLIBC_2.4s ui	"�ii
.ui	"�K P*�K *L L P "P yP ,XP [#�P ,�P 1#�P �4�P ,�P 3$�P �4�P  ,�P �"�P `3�P �+�P e!�P  2Q ),Q �%Q �0 Q 4,(Q U%8Q �/@Q �+HQ � XQ �/`Q +hQ 4 xQ /�Q 9,�Q p�Q C,�Q {�Q �+�Q &�Q 5HR L,PR �9`R �Q �R R,�R $S  P S P PS �-�S �P HT ,�O �O �O �O �O �O �O �O �O �O &�O '0N 8N @N HN PN XN `N 	hN 
pN xN 
�N �N �N �N �N �N �N �N �N �N �N �N �N �N  �N !�N "O #O $O %O ( O )(O *0O +8O ,@O -HO .PO /XO 0`O 1hO 2pO 3xO 4�O 5�O 6�O 7�O 8�O 9��H��H�I8 H��t��H����5�6 �%�6 ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&�������h'��q������h(��a������h)��Q������h*��A������h+��1������h,��!������h-��������h.���������%�3 D���%�3 D���%�3 D���%�3 D���%�3 D���%}3 D���%u3 D���%m3 D���%e3 D���%]3 D���%U3 D���%M3 D���%E3 D���%=3 D���%53 D���%-3 D���%%3 D���%3 D���%3 D���%
3 D���%3 D���%�2 D���%�2 D���%�2 D���%�2 D���%�2 D���%�2 D���%�2 D���%�2 D���%�2 D���%�2 D���%�2 D���%�2 D���%�2 D���%�2 D���%�2 D���%�2 D���%}2 D���%u2 D���%m2 D���%e2 D���%]2 D���%U2 D���%M2 D���%E2 D���%=2 D���%52 D��H��H����1�H�5�6 1�����ATI��H��UH��H�5�
SH��dH�%(H�D$1�H�������u��M��tBH�
�1 L��H�9�4����.H�$H=���~H�2 H�5k
1�H�:������E�H�T$dH3%(��t����H��[]A\���ATI��UH��H� SH��L��H��0dH�%(H�D$(1�H�t$�*�������H�{H��uH�=�5 H�5��������C����H��u>H�t$H�T$����x1�������8u|H�1 L��H�8������H��H�{
H�������tg�:���H�{H�$A��L�D$I��H�t$H�T$�����y�A�<$tH�=-5 ��������N����8���H�=5 H�������H�L$(dH3%(t����H��0[]A\���AT1�I��UH��SH��1�H�� dH�%(H�D$1�H�������teI�\$H��uH�=�4 H�5��E����FH�4$H�T$H���2���H��H��uH��/ H��H�8�����Hc�H���k���H��I���p���L��H�L$dH3%(H��t����H�� []A\���H�B�AUI��ATI��USH��APH��wI��I�m~'M�m�(��L��H�=	�����u�1��SL�-f/ H��H�����H��u<H�'/ H�:�����t��.���L��H��H���l�����x�YH��H��[]A\A]���Z[]A\A]���H�B�ATI��UH��SH��H��wH��H�u~'H�m�(��H��H�=n
�����u�1��7H�-�. L���A���H��u#H��. H�:������t����H�EH����[]A\�����UH��H��H�5
S1�H��(dH�%(H�D$1�H�L$H�T$������tYH�]H�t$�T$H��uH�=�2 H�5�
�F����2H�����H��H��tHc�H�����H��H������
H��- H�H�L$dH3%(H��t�*���H��([]���AWI��AVAUATUSH��H�H��uH�=2 H�5G
����H���pA�ye�P���1�1�I�����H��A��I��1�H��t>��tH�D$��H�D$L!�D��I�H��H��H	����L��H��I��D��A���A�oIcGH��[]A\A]A^A_���USQH�_H��uH�=v1 H�5�	�����2H�����H��H��tHc�H���]���H��H���b����
H��, H�H��Z[]���SH��H�H��t���H��, H�CH�[���SH��H��dH�%(H�D$1�H�uH�=�0 H�5	�������cH�FH��H�����sH������$H�ƃ�H��u0�7��r!H�
�+ H�P1�H�5�H�9�l�������WH�v H�{����H�L$dH3%(t�2���H��[���SH��H�H��t����H��[�}�����AWAVAUATUSH��H��tI��H�L. H9Gt�,H�=�1������H�_H��uH�=�/ H�5����1����H��H����I�~����H��I��A���ZH��H�����I�uL���D$�����D$��uN�����I�~E��L��H�� H!�L	����L��H�D$H��A���q���L�d$M��t*Ic�L���L���I��H��u�L���L���H�uH���_���1�H��H��[]A\A]A^A_���SH�_H��uH�=�. H�5����H���P���H�i* H�H��[���USQH�_H��uH�=�. H�5��^����Y�w���H���H��������y5�}tH�=�. 1��^����)���1ۋ8����H�=g. H�������
H��) H�H��Z[]���AWAVAUI��ATUH��SH��HdH�%(H�D$81�H�B�H��w-H�MH�Q���u;H�@H�5=H�=-����1��L��H�=�����u���y xH�������u1��L�eI����H�MH�Y���u!H��H�5�1�H�=��z����IH�t$H���H�I��H��t�H��1�L���H��H��H��H;t$�eI��tgL�EH�5�( I�xH9�uL�
�( H�5�1�I�9��������u�H�}�X����Ń��u"��H��t�&�����L�5D���E�A��nt<A�A��ct9�A��rt.A�A��wt%H�=�, H�5�1��?����^A��E1�I�V���tZ��st��ut��fuA���@A�� �:A��@�4L�t$�˾(1�H��L��1���H�=-, L�������H���L����I��H���K���L�` I����L��L���H��L�I;Nt*M>uL����L�%' H�5&1�I�;�t��H�=�) �s�H��H��tlD�x�r�E1���D���1�L��I���7�H�CH��uAA�?tH�=q+ L��������8���H�=T+ H����H�uH����1�I�uL���p���H�T$8dH3%(H��t���H��H[]A\A]A^A_�H�muH���6�H�+t1���H�=�* H�/u�����H��1����fDH�=�* H��* H9�tH�& H��t	�����H�=�* H�5z* H)�H��H��H��?H�H�tH��% H��t��fD�����==* u+UH�=�% H��tH�=�! �y��d����* ]������w������UH�=4( SQ�M���������H�=�' �d�H��H������H�	% 1�H�=DH�0��H��) H�������H�H��H�5$H�����������H��H�5H��������n���1ɺ�1�H�=��:�H��H���H���H��H�5�H���L�������H��Z[]���H��H���s#size does not fit in an intsetdefaultgets#:nextkeyopenstrargument 1argument 2embedded null characterFlag '%c' is not supported._gdbm.erroropen_flagsiii_GDBM_VERSIONclosekeysfirstkeyreorganizesync__enter____exit___gdbm_gdbm.gdbmgdbm mappings have bytes or string indices onlyGDBM object has already been closedgdbm key must be bytes or string, not %.100s/builddir/build/BUILD/Python-3.8.17/Modules/_gdbmmodule.cinteger argument expected, got floatFirst flag must be one of 'r', 'w', 'c' or 'n'This object represents a GDBM database.
GDBM objects behave like mappings (dictionaries), except that keys and
values are always immutable bytes-like objects or strings.  Printing
a GDBM object doesn't print the keys and values, and the items() and
values() methods are not supported.

GDBM objects also support additional operations such as firstkey,
nextkey, reorganize, and sync.setdefault($self, key, default=None, /)
--

Get value for key, or set it to default and return default if not present.get($self, key, default=None, /)
--

Get the value for key, or default if not present.sync($self, /)
--

Flush the database to the disk file.

When the database has been opened in fast mode, this method forces
any unwritten data to be written to the disk.reorganize($self, /)
--

Reorganize the database.

If you have carried out a lot of deletions and would like to shrink
the space used by the GDBM file, this routine will reorganize the
database.  GDBM will not shorten the length of a database file except
by using this reorganization; otherwise, deleted file space will be
kept and reused as new (key,value) pairs are added.nextkey($self, key, /)
--

Returns the key that follows key in the traversal.

The following code prints every key in the database db, without having
to create a list in memory that contains them all:

      k = db.firstkey()
      while k != None:
          print(k)
          k = db.nextkey(k)firstkey($self, /)
--

Return the starting key for the traversal.

It's possible to loop over every key in the database using this method
and the nextkey() method.  The traversal is ordered by GDBM's internal
hash values, and won't be sorted by the key values.keys($self, /)
--

Get a list of all keys in the database.close($self, /)
--

Close the database.open($module, filename, flags='r', mode=0o666, /)
--

Open a dbm database and return a dbm object.

The filename argument is the name of the database file.

The optional flags argument can be 'r' (to open an existing database
for reading only -- default), 'w' (to open an existing database for
reading and writing), 'c' (which creates the database if it doesn't
exist), or 'n' (which always creates a new empty database).

Some versions of gdbm support additional flags which must be
appended to one of the flags described above.  The module constant
'open_flags' is a string of valid additional flags.  The 'f' flag
opens the database in fast mode; altered data will not automatically
be written to the disk after every change.  This results in faster
writes to the database, but may result in an inconsistent database
if the program crashes while the database is still open.  Use the
sync() method to force any unwritten data to be written to the disk.
The 's' flag causes all database operations to be synchronized to
disk.  The 'u' flag disables locking of the database file.

The optional mode argument is the Unix mode of the file, used only
when the database has to be created.  It defaults to octal 0o666.This module provides an interface to the GNU DBM (GDBM) library.

This module is quite similar to the dbm module, but uses GDBM instead to
provide some additional functionality.  Please note that the file formats
created by GDBM and dbm are incompatible.

GDBM objects behave like mappings (dictionaries), except that keys and
values are always immutable bytes-like objects or strings.  Printing
a GDBM object doesn't print the keys and values, and the items() and
values() methods are not supported.rwcnfsu;�������������$��8l�h���t�����D]�l��q�����T�s�4������T����T��zRx�$���FJw�?:*3$"D����\��p��,����B�G�K �D0� AAB0���MF�D�K �JP) AAB,���F�F�D �I@� AABH���J�E�D �A(�E0x
(G ABBEA(A ABB(d���J�D�D �qAB$�Y��I�N�F@�AAD����F�E�B �B(�A0�A8�DP�8A0A(B BBB$W�^E�A�A TAA(��*E�dD���E�G �Ad4�E�UH�7�"F�B�B �B(�A0�A8�DP8D0A(B BBB�
�:E�t$�+��E�A�A {AAH��GF�B�B �E(�A0�D8�D�$8A0A(B BBB$\���E�H�A �AAzRx� �� ?�?GNU�P**L Ufs�`
D+�K �K ���o`h�
8N h�p
�	���o���o 
���o�o����o0L ������� 0@P`p�������� 0@P`p�������� 0@P`p"y,[#,1#�4,3$�4 ,�"`3�+e! 2),�%�04,U%�/�+� ��/+4 �/9,pC,{�+&�5L,�9���������Q R, $ P P �-�P ,GA$3a1`Q+_gdbm.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug�4�b�7zXZ�ִF!t/����]?�E�h=��ڊ�2N�$]7@���&�Ph�!h�s�A��w�Zw�}V�}	~�Ue[�:
k1Y����uu�Q�KU������U�~��P}�<8���r���e�5"��,6"˳T�
L*�Ϟ.��{ͭ0�g#)�S���1�hG����x9!�m���x$�Cܑ�^��GAށ}XO�+�Pmͪ`��rDΉ<�(�+{�II�TEue�����6B&�sl�X�H�$؆0�
�D~�X���?���3�|>GiT�4���K����2�[��Ųt��#��E�'������l`�y
w
$�����&�i�	�*�$�Uu���W�ԛ�eL6�<g�'N[�Yy����H3�����a�a�$�LOZ},o�̅�����ZiG�y�7��Eko�gZc(�fD�gA���™2�F��w��d*���=�Z��tȽH��a;d�מ��uU�:'�\0/����ҍg��Ud��³�ʦ��k��G´`� �k?5y{��;B�$\���M	�dD�PAŇ�������Y_��n5�NO�/��j{�����j��Ib&Q�Q�q�D�kp'�^}K�m��q��T����hw��/��Y�y�cex��Ҩ�55���Нe���Yq�*r�Q�A��SK������r/�+�.0̝'�'�h!����{XO*^;
G�b�:�b	g̊U.j�:(݂L7�� .�#�7�'�7�E��7�f�m�8c�e|R��YfG;賰��8o�c�,���*����Mۋm�K�����:s��l�� �)a4,�T�w�����%�	�dN�F���H�>��J�ux�P�sq�}7[��ϥ�3-�5(��M�]B�s�# �0���E�K���-!��(�aR_���%���Y0�+R������M�
�U�M#�K�H������i�df���G��$�4��� rKy�e�s��Sh�o3�	@��ó�/Q~���1�\xѷ8���k�<����B)���!��Rg��3��!�nw��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(���0hh88���o��|E���o 
 
PTp
p
�^B��hh``c��n���wpp�
}D+D+
�`+`+` ��;�;��x<x<��0@0@ ��K �K��K �K�L L�L L�N N��P PX �XT XT�hT`XT$
|T\�T8Y(lib-dynload/_hmacopenssl.cpython-38-x86_64-linux-gnu.so000075500000040070151153537510016565 0ustar00ELF>�@�8@8	@p+p+  , ,  , � P,P, P, 888$$P+P+P+  S�tdP+P+P+  P�td�'�'�'��Q�tdR�td , ,  , ��GNU�e�u���Ɐm�4�M�Z�r/�D h/13��|CE���qX�3��#cIpJ ��h![��X\ �-�, F"C9������o��}��w��'����� 3 �3 �3 +�2  ~#__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libssl.so.1.1libpthread.so.0libc.so.6PyUnicode_FromFormatERR_peek_last_errorPyErr_SetStringERR_clear_errorERR_lib_error_stringERR_func_error_stringERR_reason_error_stringPyErr_Format_PyArg_ParseTupleAndKeywords_SizeTPyExc_ValueErrorEVP_get_digestbynameHMAC_CTX_newHMAC_Init_exPyBuffer_ReleaseHMAC_CTX_free_Py_Dealloc__stack_chk_failHMAC_CTX_get_mdEVP_MD_block_sizePyLong_FromLongHMAC_CTX_copyPyThread_free_lockPyModule_GetStateHmacType_specPyType_FromSpecPyModule_AddObjectEVP_MD_sizePyErr_NoMemoryHMAC_Final_Py_strhexPyBytes_FromStringAndSize_PyArg_UnpackKeywordsPyObject_GetBufferPyBuffer_IsContiguous_PyArg_BadArgumentPyEval_SaveThreadPyThread_acquire_lockHMAC_UpdatePyThread_release_lockPyEval_RestoreThreadPyThread_allocate_lock_Py_NoneStructPyInit__hmacopensslPyModuleDef_Init_edata__bss_start_endGLIBC_2.4GLIBC_2.2.5OPENSSL_1_1_0�0ii
�ui	�Um� , �"(, P"0, 0, @,  $0 �# 0 �#`0 �#h0 ��0 $�0 [�0 �#�0  �0 �%1 $1 =1 @% 1 $(1 x81 �$@1 $H1 �X1 @$�1 �%�1 ��1 �1 �0 �1 `0 �1 0 �1 ]2 �"H2 $$h2 2 p2 �!x2 `�2 @, �2 �#�2 `#�2 �1 3 1$3 5$�/ �/ �/ �/ �/ �/  �/ 2x. �. �. �. �. �. �. 	�. 
�. �. �. 
�. �. �. �. �. �. / / / /  / (/ 0/ 8/ @/ H/ P/ !X/ "`/ #h/ $p/ %x/ &�/ '�/ (�/ )�/ *�/ +�/ ,�/ -�/ .��H��H�i H��t��H����5� �%� ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&�������h'��q������h(��a�������%] D���%U D���%M D���%E D���%= D���%5 D���%- D���%% D���% D���% D���%
 D���% D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%} D���%u D���%m D���%e D���%] D���%U D���%M D���%E D���%= D���%5 D���%- D���%% D���% D��H�wH��1�H�=l	���AUATUSH��Q����H��uH�5b	H���D����uI���j���L�����L��H���G���L��I���,���I��H��tM��tL��H��H�5(	H��1�����)H��tL��H��H�5	H��1�����L��H������Z1�[]A\A]���AVI��I���AUH��H��ATUSH�ĀdH�%(H�D$x1�L�d$ L�L$H�D$L��M���H�
L L�������tgH�\$E1�H��uH�=� H�5�H�?�=����NA��Ic�@�4@��t7D�^�A��v�D�V�A��	v�@��-t�H�
� H�5oH�9���1��H���J���H��H��uL�{ H�5^I�8������H�t$H�=[1��D���H��H�������I��H��uH�4 H�;�%����|�T$0H�t$ E1�H��H���3�����uH� H�:����HL�����1�L��H�D$ A��0H��H��t#H�l$�~D$L�l$H�@ D$@�,L���~���H�MuH�����H�|$ �����L��1�����H�T$xdH3%(H��t�b���H��[]A\A]A^���QH����H��uH�K H�8Z�;���H���j���Hc�X�A�����ATI��US���H��tI�t$H��H�������uH������H�
� []A\H�9���I�D$1�H���0H��H��u
H������I�T$H�hH�H�PH�@ H��[]A\���SH��H� H��t�e���H�{�\���H�{H��tH�CH�u���H�CH��[H��@����Q���H��tH�8H��tH�H�u�x���1�Z�H�+t���WH�߉D$�Z����D$�BV���H��t	H��Y�
���H�� H�8���1�Z���QH�������uH�� H�8Z�����X����ATI��USH��H���T$�	���H��u	�?���1��HH�3H��H���m�����tH��H�T$L������H����=�����uH�b H�8�S�����H����[]A\���UH��ATSH��H��H�dH�%(H�E�1��
�����uH� H�8�����iA��H��I�L$H��H��H��H���H)�H9�tH��H��$����t	H)�H�L�H�{��H������1���tL��H���`���H�]�dH3%(t�|���H�e�[A\]���UH��ATSH��H��H�dH�%(H�E�1��H�����uH�N H�8�?����iA��H��I�L$H��H��H��H���H)�H9�tH��H��$����t	H)�H�L�H�{��H���.�����1���tL��H������H�]�dH3%(t���H�e�[A\]���AUATI��USH��H��H�ʹH��hdH�%(H�D$X1�H��H���H��uH��~H��H��u2PH��H��A�1�L�D$XAPL�5 jj�|���H�� H��H��t?H�;1�H�������u.�CH��������u%H�H�H�5'H�=/���E1��I�|$ t@���I�|$ �I�����I�|$H�T$H�4$�w���I�|$ �����L���3����/H�|$�~���I�D$ H��u�I�|$H�T$H�4$�4����Å�uH�5w E1�H�>�e����L�%� I�$H�|$tH������H�L$XdH3%(L��t�'���H��h[]A\A]�f.�f���UH��SH��H���k���H��tH�8H��tH��H��H��[]��H��1�[]��H�=1 H�* H9�tH��
 H��t	�����H�= H�5� H)�H��H��H��?H�H�tH��
 H��t��fD�����=� u+UH�=z
 H��tH�=�	 ����d����� ]������w������UH��SH��H�=<
 ���H������H��H�5�H��H���9��������H���8���H�1�H�H��[]����H�= � �����H��H���<%U HMAC object @ %p>unknown reasons[%s: %s] %s[%s] %sy*|$s:_hmacopenssl.HMACdigestmod must be specifieddigestmod must be lowercaseunknown hash functionhmac-%scontiguous bufferargument 'msg'updateHMAC namedigest_sizeblock_sizehexdigestcopymsg_hmacopensslkeydigestmodcopy($self, /)
--

Return a copy ("clone") of the HMAC object.hexdigest($self, /)
--

Return hexadecimal digest of the bytes passed to the update() method so far.

This may be used to exchange the value safely in email or other non-binary
environments.digest($self, /)
--

Return the digest of the bytes passed to the update() method so far.update($self, /, msg)
--

Update the HMAC object with msg.The object used to calculate HMAC of a message.

Methods:

update() -- updates the current digest with an additional string
digest() -- return the current digest value
hexdigest() -- return the current digest as a string of hexadecimal digits
copy() -- return a copy of the current hash object

Attributes:

name -- the name, including the hash algorithm used by this object
digest_size -- number of bytes in digest() output
;��������-���H������������������#����J����t����������8v���\������Lt����zRx�$ ��FJw�?:*3$"D���\�4p�B�B�A �A(�D0�(C ABB@���F�M�L �A(�A0�D��0A(A BBB�;�4EY
EL4O�F�D�A �n
ABH~ABD��KE�}`��,Ef0x�9E�D�G V
GABDCA$�����XE�D�D0HAAzRx�0�� h�#w�'AN
ER$~�*EX
EC,D��xB�D�A �G0c CAB t���E�C
C��� �q��E�C
C���L�����F�B�D �A(�R�n�U�I�B�I�(A ABB����GNU��"P"0,  $Uft�P
# , (, ���o`x�
�`. �xh	���o���o����o�oX���o(P, �������� 0@P`p�������� 0@P`p���������#�#�#�$[�# ��%$=@%$x�$$�@$8�%B�4@�0 I`0 H0 A]�"$$2 �!`@, �#`#(�1 1$5$GA$3a1P#_hmacopenssl.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug����7zXZ�ִF!t/����]?�E�h=��ڊ�2N�HoO> ��t�'�'�	��A�A"��!x5?��!�x�2����D������@����]��f$�n����F���7o]ҿ�1�c\�N��N��2�>�zح$'z\C2Nbʞ9���2�~���e����Z���dM�����%�ڭ1O̰�k�h�>	�뚃o��	�{,=�`,�a����cZ��@S�R�N'���f�6$瞊t#H����Y�6H��*v[���8�΍?oI�;]�_O7%���%��xt%�#��/���P�=�c�E�%�^��Q�4��2{kt2����VEѐb�*�N!x�^C�6ZN����M��r�>$v�s�	��Xe�*Xk��?��g:�rԆ	P��Y�����Ӌ�,a����]��S��џ��&�v�ˍ����q�IU�SY�F
�"�B�6��'*e�؂��{���J>��vʆT��|+���=�,7�LF'��!%4�Dp���`�nC��/B����#�>(2}'���!�H`i?�c��ܲ\��x�Y�K1�W��r6<�.�q\�S0�~�i�ݚ��R]9��r��9��<Z�~�p��e�[7z�		D�Gn��e�^��|'�Ո��|�ʾ2,����Y(��Q���Ԏ���O�C7LB��g���!O���.��X�mq)��ƪ�j+[<2R���jr�/����摈:�f3��'a�4}d��g�N	XC��|	6,5Fߠ��[�N��ڼS��i�F�c6n��1�<��+XgU�HD�|R�2cr|�������G	ѫ�04r��[�D��9J�g�ݜ�y�6k����^ܢJ��̭EZ����k���5F�F'&N��(�
���н��ل
�=�0�ҭ���<����•'L2����M�v�M��A���Ҷ'��h3��cD2<L�c;?É\º�W���S#��$op�,��5��m�:@�
�����:�_�k<'?OG F�\�FmTv��!��۱�g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``8(���0xx�8���oXXhE���o��PTh^Bxx�hPPcpp�n�w��p	}##
� # #j ��'�'��0(0( �P+P+ � ,  ,�(, (,�0, 0, �P, P,�`. `.��0 0 �3 3� 3`3$
<3d�3,�7(lib-dynload/xxlimited.cpython-38-x86_64-linux-gnu.so000075500000027540151153537510016130 0ustar00ELF>@@ (@8	@�� �� � �� �� � 888$$���  S�td���  P�tdPPP||Q�tdR�td�� �   GNU���	��~���.��j�@ 
 !��|CE���qXY���E� �r� ��	�, F"��Z���� ��5@�d�" Q�" X�" /�__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6_Py_NotImplementedStructPyArg_ParseTuple_Py_NoneStruct__stack_chk_failPyType_GetFlagsPyDict_NewPyDict_DelItemStringPyExc_KeyErrorPyErr_ExceptionMatchesPyExc_AttributeErrorPyErr_SetStringPyDict_SetItemStringPyObject_GenericGetAttrPyDict_GetItemWithErrorPyErr_Occurred_Py_DeallocPyBaseObject_TypePyType_GenericNewPyUnicode_TypePyType_FromSpecPyErr_NewExceptionPyModule_AddObject_PyObject_GC_NewPyLong_FromLongPyInit_xxlimitedPyModuleDef_Init_edata__bss_start_endGLIBC_2.4GLIBC_2.2.5vii
iui	s� �� p� �    
(  �8  +h  :x  @�  �  ��  D�     �  �! ! g! G ! '(! �8! �@!  H! YX! X�! o�!  �! ! �! �  " y" `"  " �8"   @" �X" `  �" X� � � � � � 	� 
� � � �     ( 
0 8 @ H P X ` h p x � � � � � ��H��H�� H��t��H����5* �%+ ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h��������%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%} D���%u D���%m D���%e D��H�H��H��tH���1����H�U H����H��(H��H�5�dH�%(H�D$1�H�T$H�L$�����1���t
H�I H�H�t$dH34%(t����H��(���H��H��H�51dH�%(H�D$1�H��H�$�J���1҅�t+H�$H��tH�x�����s	H�$H��
H��
 H�H�L$dH3%(H��t���H�����ATI��UH��SH�H��tH�{M��uN�����H�CH��u���HH���n�����y:H�1
 H�8�����t'H�V
 H�5�H�:�_����[L��H��]A\�^�����[]A\���ATI��UH��SH�H��u[L��H��]A\����<���H��H��tH��
�Z���H��t�H��[]A\���H�GH��tH�GH�uH�������H��tH�+t���|H��������l��QH��1�H�5�������1���tH�=2 �
���H��tH�@Z���H��(H��H�5�dH�%(H�D$1�H�T$H�L$�}�����1���tH�|$H|$����H�t$dH34%(t����H��(�f.�f�H�=� H�� H9�tH�� H��t	�����H�=i H�5b H)�H��H��H��?H�H�tH�} H��t��fD�����=% u+UH�=Z H��tH�=^ �����d�����
 ]������w������H� H��
 SH��H�
 H�=\
 H�}
 H��
 H�
 ���H��
 H���(���H�=�
 u 1�1�H�=����H�y
 H����H�i
 H��H�5�H����H�=� �"���H��tdH��H��H�50���H�=� ���H�������H��H��H�5��t���H�=] ����H�������H��H�5�H���M���1�[��j����e���ff.�@��H�=� �0�����H��H���O#:roj|O:demoxxlimited.error:newll:foodemo() -> NoneThe Xxo typeroj(a,b) -> Nonenew() -> new Xx objectxxlimitedxxlimited.Nullxxlimited.Strxxlimited.Xxodelete non-existing Xxo attributefoo(i,j)

Return the sum of i and j.This is a template module just for instruction.;|�������������������t����0y���h�������	���B���p��������4zRx�$��@FJw�?:*3$"D����0\���p�������]H0T�T����H w4������F�D�D �b
GBECAB4�	���JF�D�D �J
GBE`AB$���#8����S��
AzRx�� ��#�����9Es����bH0Y�T���GNU��p� Ufv�
�� � ���o`��
� ��� 	���o���o����o�oH���o!� �� 0@P`p��������0
�+8:G@P:�DD@   �gG'�� YXo ! �  y`" �  �@`  0ACXGA$3a1��xxlimited.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug��#�7zXZ�ִF!t/����]?�E�h=��ڊ�2N�-lPj[��~`���кZO7���B^���2g���D�������)�.�Y�!�/焻i�'�z.
0h��e��jX��7A�5r�
)�Mp�Zɣ���f��}rJ�h粥3����`������?L8�O��~�j!&���͓�15��w/�)2G]����~l��T�
��2~�_',.9����B+��1.�z"ZH�a�[���,Ӈ��x�O�C�.�Z{q��Z-�VK�
7aI�k�x�$޸���g���Z��:�s;�y��{=��y�l|jO�-���������h���Rj��F)�<�Qd2g����N�@34�!�^K���% V�K��;�8�9u=Pg~M�e�L'$�Ō�٠�(Z�h�|�
��^$-E��z�Lg�\�"SA�������\�)�bB����[sU�0���/��������`�����)�@�/0�]i�ޞ����p��n%���g��]\x��@w$e�Urt8����%;o,cR�d�_�*�f=�f)N'��*�r���%Y��4�S\2���7W#��Be��
�1�)]��x���6�4�2%���'��ڷp���g`\�q�	r�՜v�����8��|�BUx/4��f2(�[���3v�P4�����n������A���n�3=h�"�"cCl�0m,dC�$>n������L@�1;�����fL�c13HW���&Yp�d�pn��~��v8L��=�K��:M�Ւp�k��t��urȐ�9	"+k�VȢ�D�����i�H���SSe��G��kI��üC�KE�e�iX��"+xY�Y��D�13?O�d���-Y�A��`U��,����
n'��5��oN�%���B���^�>���C>1���Y����61��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(��00��8���oHHDE���o��0T�� ^B���h��c��@n0w@@�}��
�P �PP|������� �� ��� ��� ��� ��� ��   � ��" �"��"`�"$
�"`$#��&(lib-dynload/_bz2.cpython-38-x86_64-linux-gnu.so000075500000061160151153537510014751 0ustar00ELF>�@0[@8	@(I(I �K�K �K p	x	 LL L 888$$III  S�tdIII  P�tdtDtDtD��Q�tdR�td�K�K �K 00GNU�`����dv��\0���x�:�@ @:<��|CE���qX��L��>���� +������ �\�D�, �F"/�M��)�n����x9�a���LZ{k���1HU @U %@U �p7�__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libbz2.so.1libpthread.so.0libc.so.6BZ2_bzDecompressEndPyThread_free_lockPyMem_Free_Py_DeallocPyMem_RawMallocPyMem_RawFreePyFloat_TypePyType_IsSubtype_PyLong_AsIntPyThread_allocate_lockBZ2_bzCompressInitPyExc_OSErrorPyErr_SetString_PyArg_NoKeywordsPyExc_RuntimeErrorPyExc_ValueErrorPyExc_EOFError_PyArg_CheckPositionalPyErr_OccurredPyErr_FormatPyExc_MemoryErrorPyExc_TypeErrorPyExc_SystemErrorPyErr_NoMemoryBZ2_bzCompressEnd_PyBytes_ResizePyExc_OverflowError_PyArg_NoPositionalPyBytes_FromStringAndSizeBZ2_bzDecompressInit_PyArg_UnpackKeywordsPyObject_GetBufferPyBuffer_IsContiguousPyNumber_IndexPyLong_AsSsize_tPyThread_acquire_lockmemcpyPyEval_SaveThreadBZ2_bzDecompressPyEval_RestoreThreadPyThread_release_lockPyBuffer_ReleasePyMem_Malloc__stack_chk_failPyMem_ReallocPyErr_SetNonememmove_PyArg_BadArgumentBZ2_bzCompressPyInit__bz2PyType_ReadyPyModule_Create2PyModule_AddObjectPyType_GenericNew_edata__bss_start_endGLIBC_2.14GLIBC_2.4GLIBC_2.2.5����6ii
Aui	K�K  7�K �6�K �K �K �8�K 	9P �8P �1P �? P �8(P �48P �>`P �8hP �)xP �@�P �8�P @D�P �8�P D�P �8Q �ChQ 9�Q �K �Q �8R 90R �'�R  =�R P (S �%�S ,9�S @%PT  >�T `P �T �P �T (�O �O �O �O �O 
�O �O �O �O �O �O �O $�O *8S �T 0N 8N @N HN 	PN XN 
`N hN pN xN �N �N �N �N �N �N �N �N �N �N �N  �N !�N "�N #�N %�N &O 'O (O )O + O ,(O -0O .8O /@O 0HO 1PO 2XO 3`O 4hO 5pO 6xO 7�O 8�O 9��H��H�a9 H��t��H����5�7 �%�7 ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&�������h'��q������h(��a������h)��Q������h*��A������h+��1�������%�4 D���%�4 D���%�4 D���%�4 D���%�4 D���%�4 D���%�4 D���%�4 D���%�4 D���%�4 D���%�4 D���%�4 D���%�4 D���%�4 D���%�4 D���%}4 D���%u4 D���%m4 D���%e4 D���%]4 D���%U4 D���%M4 D���%E4 D���%=4 D���%54 D���%-4 D���%%4 D���%4 D���%4 D���%
4 D���%4 D���%�3 D���%�3 D���%�3 D���%�3 D���%�3 D���%�3 D���%�3 D���%�3 D���%�3 D���%�3 D���%�3 D���%�3 D���%�3 D1��L��3 H�5?I�:�W����xL��3 H�5�I�;�<����]H�`3 H�5H�:�!����BH�-e3 H�5�H�}�����&H�uH��v1ҹH�=��S�������H�uH����L�]H�533 I�{H9�����������H�}����Ń��t.���@����+
H��2 H�5�H�;�s������
���H��t��SH�=�2 ��H�5o1�H�?����f
H��2 H�5�H�;�*������	H�s2 H�5�H�:�������	H�
=2 H�5.H�9����
���
�	�w	H�CH��[H��@��H�=M2 H�5�H�?�����Z�H�ChH�/u�f���H��������Hǃ��I�,$��L���4���H�Ch�H��1 H�59H�8�E����H�y1 H�5jH�:�*�����
L�%N1 ��H�551�I�<$�j�����
H�
N1 H�5�H�9����
M����
��t7L��H�=��N������/�
L�B1 H�5�I�:����h
�u
L��0 H�5�I�;����H
H�D$���H�D$�d
H��0 H�5$H�;�\������	�_����
H�5�0 H�>�����A��������I9��������I�GxI����jL�y0 I�8���H�mt1���
H��1�����
L�������R���H������L�=0 H�5�1�I�?����
H�0 H�5iH�8����?A�L�L$�����L�$I�kI��L)�H9�HG�H9�LF�A�o0L)�E�GI����)���L��H���>���L�t$E�_H��M��M�V M�w(�D$M)������D$�x	��
wH�5������Hc�H�>��L�
/ ��H�5�1�I�9�+�������I����I���-���L���u����
L��H�$��I�xH�$I�I����
����5A�M9�t}O�D3 M�G(I�������H�=�. H�5�H�?�<����L�\$L��M�S��t\I����hA�0uI9��XM9���O�L3 M�O(I������H�|$H�������L�\$�c����kL�����I�Gh��L��- H�5�I�:����\L��- H�5#I�;����AH�
�- H�5�H�9�h����&H�H�WH�5b1�H�=i����.H�<$H�������
L�\$���������E1�H�|$8��H�������H�/u����E1�H�{h�����H�=- D��H�5�1�H�?�+�����������L�==- H�5�I�?����L�5�, H�5I�>����H�
�, H�5H�9�p����H��, H�5�H�8�U����dL�-�, H�5�I�}�9����H����H�{h�I�����L������{`tCL�A, H�5TE1�I�8�������L��H��E1�H�5'H�=��B������� 1�L�t$@L�|$0�g���H�D$(H�������H�� L�{�CH�C(�C0 ��H�/���K���E1�H�{h�����(�u����VL�=�+ H�52I�?�J����;L�-v+ H�5�I�}�.��������H�{h�H�����H�������{`���C`� 1����H�D$H��t[H�� H�C�CH�C(�C0 �H�-�* H�5�H�}����L�%�* H�5/I�<$����E1��	���L��* H�5�E1�I�8�h������L�5�* H�5�I�>�M����>H�=q* D��H�5W1�H�?���1�����SH��H�xH��uBH�{���H�{hH��tH�ChH�/t)H���H��t��H�CH��[H��@����������ff.�@�����4������,���Hc�Hc�H����ff.�f���H���t�@��UH�, H��SH��H��H9Gu	H����H�uH���F���H����H�UH�5�) H�zH9�������f�����H�}�����������H����e����9�H�ChH�������H�5U���H�=���1�1�H�|$�~D$H�{H�t$��H�CXD$CH��D�@	A��
�1���L�
	Oc�M�>A��ff.�1���H��[]ý	��H�ChH������H�
���H�5����H�CX1�H�t$�~L$H�{��H�L$1�L$KH��x	��
�����L��Mc�M�>A��H�( H�5�H�8���H�{h��H�Ch���W���H��H�=u�2��������D��SH��H�����H�{hH���������H�KH��[H��@��ff.����ATI��UH�-�+ SH��H��H9o��H���M������E���H�=������H9k��M����L��H�=��y���Z�<�H���q���H���H���M����Cpf�L�ch1�H���H�Cx���Z�H�ChM���&���H�����H�{1�1���H	��
�V���H�5dHc�H�>��f.�1�H��[]A\�H�-~& H�5H�}�>�H�{hH��������w�H����H���H�������H���f��1�1��CpL�chH�Cx����H�ChM���_�H���7�H�{1�1����x	��
���L��Mc�M�>A����1��9������1�������f.���AWI��AVAUATUH��SH��H��dH�%(H��$�1�H���Vf��H��L�aH��)L$(A�L��' )L$8I�1�)L$H)L$X)L$hH�t$xVH��jj��H�� H��H����L�l$ H�81�L���������CL��������X���I����H�KH�5% H�yH9������������H�{���I��H�����H����I�.H�����H������I���1������|���A�`��I�wL�d$0H�D$ H����M���I���M�WxM��H�<O�2I)�I)�M9���M9��K���L��H��� �M��M�gH����HH��1��n�H�D$H����L�HH�x A�����I�(M9��_�M���E�O0M9�MF�M)�E�WM����`�L��H���u�A�wM�w(H��I���$H�D$H�P I)����$�H	��
�K�L��Ic<�L�>��ff.�@H�l$I��L�U����I���H���=E�O0E���b�L9��c�L9�u`A�`A�Gp��I����T�H�|$(tL����H��$�dH3%(H����H�Ę[]A\A]A^A_��A�H�|$L��������H�l$H���A�`I����$H���kA�GpE���zI�����H�|$(�a���H�|$ ���R���fDf�)D$ )D$0)D$@)D$P)D$`H����H����H���}L�d$ H�;1�L���U������CL�������%�H����H�SH�5�! H�zH9�����������H�{��I��H���}�H���|�I�.H���[�H����^�I���1������I�A�`��I�wL�d$0H�D$ H���MM���I���M�WxL��H�<O�2H)�I)�I9���M9���L��H��A����M��M�gH����H��1��5�H�D$H���OH�HH�P �����I�W(H9���M���A�����A�O0M9�MF�M)�E�OM����"�L��H���7�L�T$M�w(H��$A�GI��M�Z M)�����$�x	��
�
�H�5�Hc�H�>��L�\$L��M�S��tuI���tA�O0���[�I9��M9��a����8���f�I�GE1�M������ff.�f�A�� 1���H�D$���@A�A�G`�H�| H�5H�:�=�H�|$H��tH�/u��I�G1����f�A�GpH�����f�I�M�wh��I�GhM��t
I�.��H����������f�H��������@I�GA�Gp���A���I�xH���p�H����I�GxH����I���H��I���H��I�w��M�oxM�o�:���H�� H�5t1�H�;�?�����RH��A�1�L��  1�H��H�D$xPjj���H�� H��H���L���1������M�L)�L��H�$M)�I��L����H��H�����J�|-H�$I�oxI�I��M������w����1�ff.�f���AWf�1�AVAUATI��USH��L��H��dH�%(H��$�1�H�l$0)D$0H��)D$@)D$P)D$`)D$p�������CH���>����$�H�{h1��������S`����� 1�L�t$@L�l$0��H�D$(H�����H�� L�k�CH�C(�C0 H�L$(1�E1�A�����H�L$L�%�	����M��uqL�t$(M9~��H�|$(L��������H�{hL�t$(��H�|$8tH���_�H��$�dH3%(L���\H�Ę[]A\A]A^A_�M9�L��s0IFƉCI)ƅ������H�{(1�H�$H�|$H�{�(�H�<$L�C(L+D$�D$M���D�D$E�H	A��
���Oc�M�>A�␋S�
����{0t[��H�s(H�{H�$H�t$1����H�{(H+|$I�H�<$�D$�<�D�D$E�H	A��
�s�L��Oc�M�>A��L�\$(I�CL)�u'H�|$H�����x;H�L$(J�T9 H�AH�S(L)�L9�IGʼnC0�a���L�%, H�5�I�<$���H�|$(H���������d����ff.�@��AW1�AVAUATUSH��H��(H�hdH�%(H�D$1������_��C`������C`� 1���H�D$H�����H�� H�C�CH�C(�C0 H�SH�L$E1�H�$L�-�H�L$�
�H�<$�L�c(H���H�H�s(H��A��L)�I����A�~	��
���McD�M�>A��f.�A��tZ�{0u�L�L$I�AL)�u+H�|$H���x����L�T$O�\: I�BL�[(L)������H9�HG‰C0�U����L�l$M9}���H�|$L������xFH�{hL�l$���H�L$dH3%(L��u8H��([]A\A]A^A_�H�
I H�5�H�9�
�H�|$H���s��m���f�H�=� H�� H9�tH�6 H��t	�����H�=� H�5� H)�H��H��H��?H�H�tH�� H��t��fD�����=U u+UH�=� H��tH�=� ���d����- ]������w����APH�H�HH��H��L�DH��~L9�rL��H9��A�Y�/�ff.�@��SH�=� �������H�= ���������H�=� ��H��H��t<H�C H�5ZH��H�1 �\�H�� H��H�5LH�� �>�H��[���H��H���Unable to allocate lockInvalid data streamUnknown I/O errorcontiguous bufferargument 'data'decompressEnd of stream already reachedargumentCompressor has been flushedRepeated call to flush()flusheofunused_dataneeds_inputmax_length_bz2_bz2.BZ2Compressor_bz2.BZ2Decompressorinteger argument expected, got floatcompresslevel must be between 1 and 9libbzip2 was not compiled correctlyInternal error - invalid parameters passed to libbzip2Compressed file ended before the logical end-of-stream was detectedInternal error - Invalid sequence of commands sent to libbzip2Unrecognized error from libbzip2: %dUnable to allocate buffer - output too large|�!�d�I�������.�������D���,��X�X�_����������������������������o�O�����������������}�������7��6�6�6�6�6�"������M�M�$�N�	�����������������������������K���|�����������������������r�W���������2���<�H���H���H���H���H���U���:������������p�����������������%�@�����h���h����C�(���������������������BZ2Compressor(compresslevel=9, /)
--

Create a compressor object for compressing data incrementally.

  compresslevel
    Compression level, as a number between 1 and 9.

For one-shot compression, use the compress() function instead.BZ2Decompressor()
--

Create a decompressor object for decompressing data incrementally.

For one-shot decompression, use the decompress() function instead.flush($self, /)
--

Finish the compression process.

Returns the compressed data left in internal buffers.

The compressor object may not be used after this method is called.compress($self, data, /)
--

Provide data to the compressor object.

Returns a chunk of compressed data if possible, or b'' otherwise.

When you have finished providing data to the compressor, call the
flush() method to finish the compression process.decompress($self, /, data, max_length=-1)
--

Decompress *data*, returning uncompressed data as bytes.

If *max_length* is nonnegative, returns at most *max_length* bytes of
decompressed data. If this limit is reached and further output can be
produced, *self.needs_input* will be set to ``False``. In this case, the next
call to *decompress()* may provide *data* as b'' to obtain more of the output.

If all of the input data was decompressed and returned (either because this
was less than *max_length* bytes, or because *max_length* was negative),
*self.needs_input* will be set to True.

Attempting to decompress data after the end of stream is reached raises an
EOFError.  Any data found after the end of the stream is ignored and saved in
the unused_data attribute.True if more input is needed before more decompressed data can be produced.Data found after the end of the compressed stream.True if the end-of-stream marker has been reached.;���������|��H�����(��HC������d����b��L��|��<�4l�\|�pL����\l��\�x,������`zRx�$���FJw�?:*3$"D����\���aE�E
I|�#�,����(���E�K�G0�
AAAzRx�0�� ����x�4E�fzRx�� ��H`��1BjzRx����Z0�(��F�D�H �G0�
 AABAzRx�0���$���_t���F�E�B �B(�A0�D8�J�d�x�E�B�I�s
8A0A(B BBBI7�]�B�B�I�$zRx��������,6��/L����F�H�B �B(�D0�A8�M�>
8A0A(B BBBD����H$H��F�D�B �B(�A0�A8�G`~
8A0A(B BBBA zRx�`������(��b����E���@��GNU� 7�6�K �8	9Ufr�8
�7�K �K ���o`h�
WN  �
�	���o���o@
���o�o����o"L p�������� 0@P`p�������� 0@P`p�������� �8�1�?�8�4�>�8�)��@�8`@D�8hD�8p�C9���������K �89p�' =P �%,9�@% >`P �P (GA$3a188_bz2.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug�b(�7zXZ�ִF!t/���]?�E�h=��ڊ�2N�	O$���la�Y��1C!H*�V �՘�G�j1��8𯛹Դ��w�^���$�O��Mw)�t��B%��!4nN��JDڎ��^�8s�c�\0Hڠ��Ū�J�=lFm#V��4>D���]dbq�gr�̷�Ɍ������8B\�E�$$�m$����('h���j?���5+!�;�;�>�eZ�?���,��xF=1���4'�W��߆��>y�n�d���#
l����u`����֫9W:��WO�i#p/}:�Sc����Pb�w� 7���h	�A�T�7&���ά�`g-=�t���"�Uc�w.o'�HK֏$l�-ȧ �V��∺�>��Sr�{<�7�̹��I�K�Ļ�G�%nM^P�|�Ѻ>���e�z��H����>�M~��>�E�Ƌ
_�x�U��LWZ
��%z�ᦌ��b����gך���_'�ޥ�TE#����AJ�g]J���B�#l�N��ov7T�f�L��)�q�?l�����E�,8�v�Ê�e���k�o ���@'7�ᑠAhiYrթE��OD�E���obt��c��.��Ż2~SC���&�V(A
�X'�=G�W�����
2��~��Gm9b�u�,K�c���bBd	w���{���~��Ѯyp�v�5�u�Щ~h����҉�0�uJ��=ABT�}(;��ӄ5潀��h�`��	]���u=-�!b7Éd /�T�5j���DX�;�,�_���[e��������#�+qXwT�ւY������x�fy�|��t	�a��^�ɂfo��nj/�	n����I�����u6jU_���J�~H+w������T��k~��e��y��V��D'�?�����B�j.ZΓbM�w/�iF�?���IH�Wm%첊{�NzH���ØD���B}�/�!�P�<UFx��"�j
�͛�3j�1^җ��_�r��3s;�x�wFǂ���_/@�3���2nk�����6r��~��#(Re���g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(���0hhW8���o��|E���o@
@
@T�
�
�^B h88c``�n00�w��}�7�7
� 8 8S �tDtD��0E0E��II ��K �K��K �K��K �K(�L L�N N��P P@ �@U @U�HU`@U$
dU\�UHZ(lib-dynload/_pickle.cpython-38-x86_64-linux-gnu.so000075500000432730151153537510015530 0ustar00ELF>V@�.@8	@ � � ��"�"�� PP"P"888$$���  S�td���  P�tdH�H�H�,,Q�tdR�td��"�"P	P	GNUP�;R����g<�n����K%-��@0����|5�CE���qX#��
3�f
��6x��� �B��g�P�!;�
�~�,	��	Y	�0�	p�
�	(
[�
mN E���_�Ii	���, )�	�wF"�/��?�'�hg����	L	�{�
��g�?�	���@	�Vq
�iRR�`��t��
>��Y6O��	��F��[����#^��	������%�	/�P
�O9
Ds��51���ny��	�
�
y
�	�1
�""�`�$��""
�""__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6_Py_Deallocmemset_Py_NoneStructPyMem_MallocPyErr_NoMemoryPyMem_FreePyObject_GC_UnTrackPyObject_GC_DelPyObject_FreePyBytes_FromStringAndSizePyExc_TypeErrorPyErr_SetStringPyCallable_CheckPyExc_AttributeErrorPyMethod_New_PyObject_GC_NewPyObject_GC_Track_PySys_GetSizeOfPyLong_FromSsize_tPyErr_OccurredPyObject_CallFunctionObjArgs_PyBytesWriter_Init_PyBytesWriter_Alloc_PyBytesWriter_Finish_PyBytesWriter_PreparePy_hexdigits__stack_chk_fail_PyUnicode_Ready_PyBytesWriter_Dealloc_PyObject_LookupAttr_PyUnicode_EqualToASCIIStringmemcpy_PyBytes_ResizePyMem_ReallocPyBuffer_Release_PyObject_LookupAttrId_PyObject_CallMethodIdObjArgsPyObject_CallObjectPyModule_GetStatePyState_FindModulePyErr_FormatPyDict_NextPyLong_AsSsize_tPyExc_ValueErrorPyDict_NewPyDict_SetItemPyTuple_NewPyDict_TypePyLong_FromVoidPtrPy_BuildValuePyDict_GetItemWithErrorPySys_AuditPyTuple_PackPyImport_Import_PyUnicode_FromIdPyUnicode_SplitPyExc_RuntimeError_PyArg_CheckPositionalmemmovePyDict_DelItemPyObject_GetBuffer_Py_CheckFunctionResultPyObject_CallFunctionPyExc_NotImplementedErrorPyErr_ExceptionMatchesPyErr_Clear_PyObject_MakeTpCallPyLong_FromLongPyTuple_SizePyExc_KeyErrorPyErr_SetObjectstrcmpPyUnicode_DecodePyList_TypePyList_NewPyList_SetSlice_PyObject_GetAttrIdPyUnicode_DecodeASCII_PyArg_UnpackKeywords_PyMem_Strdup_PyObject_NewPyMethod_TypePyObject_GetIterPyUnicode_AsUTF8AndSizePyObject_IsTrue_PyArg_BadArgumentPyUnicode_DecodeUTF8PyExc_OverflowErrorPyLong_AsLongPyObject_SetItemPyOS_snprintfPyMemoryView_FromMemory_PyLong_FromByteArrayPyLong_FromStringPyUnicode_TypePySet_New__errno_locationstrtol_PyFloat_Unpack8PyFloat_FromDoublePyUnicode_DecodeRawUnicodeEscapePyByteArray_FromStringAndSizePyUnicode_InternInPlacePyExc_EOFErrorPyOS_string_to_double_PyByteArray_empty_stringPyObject_SetAttr_Py_FalseStructPyFrozenSet_NewPyMemoryView_FromObjectPySet_Type_PySet_Update_Py_TrueStructPyIter_NextPyBool_FromLongPyBytes_DecodeEscapePyUnicode_FromEncodedObjectPyExc_UnicodeDecodeErrorPyType_IsSubtypePyLong_TypePyFloat_TypePyBytes_TypePyThreadState_Get_Py_CheckRecursionLimitPyFrozenSet_TypePyTuple_TypePyByteArray_TypePyPickleBuffer_TypePyType_Type_PyNone_TypePyEllipsis_Type_PyNotImplemented_TypePyLong_AsLongAndOverflow__sprintf_chkPyFunction_TypePyUnicode_DecodeLatin1PyList_Size_PyLong_Sign_PyLong_NumBits_PyLong_AsByteArrayPyObject_Repr_PyFloat_Pack8PyObject_GetItem_PyObject_CallMethodIdPyOS_double_to_stringPyBytes_FromObjectPySequence_ListPyPickleBuffer_GetBufferPyBuffer_IsContiguous_Py_NotImplementedStruct_PySet_NextEntryPyObject_Str_Py_EllipsisObjectPyUnicode_AsEncodedString_Py_CheckRecursiveCallPyArg_UnpackTuple_PyUnicode_EqualToASCIIIdPyTuple_GetSlice_PyObject_NextNotImplementedPyObject_CallPyUnicode_AsASCIIStringPyUnicode_AsUTF8String_PySys_GetObjectIdPyExc_UnicodeEncodeErrorPyInit__picklePyType_ReadyPyModule_Create2PyModule_AddObjectPyErr_NewException_PyEval_GetBuiltinIdPyImport_ImportModulePyObject_GetAttrStringPyType_GenericAllocPyType_GenericNewPyObject_HashNotImplementedPyObject_GenericGetAttrPyObject_GenericSetAttr_edata__bss_start_endGLIBC_2.2.5GLIBC_2.14GLIBC_2.3.4GLIBC_2.4f ui	
v���!
ti	,
ii
8
ui	
�"�{�"�{�"�"�"#��"(��"1��"=� "#�("1�0"M�8"V�@"]�`"I�h"1�p"M�x"V��"]��"#��"1��"M��"V��"]��"e��"(��"1��"=� "e�("#�0"(�8"1�@"=�"�"�u"�� "�("8"��@"�H"p�X"@��"���"@W�"���"��"�d�"@��"	��"1d�"�"�("�P"A��"��"0��"���"��"`��" Y "�("`8"`�@"��H"P�X"�`"�h"�x"���"���"@�"���"��"�b�"`��"	��"�b�" � "�("�0"��H"�P"0�X"�X�"��"���"���"��"�l�"��"��" ��" �""�"0"��H"`"P""��"�"�"��"i��"p�"y�("��H"��h"���"p��"���"�"�"�" ""�H"��h"	��"���"�"�"a��"A�"�("̵H"еh" "p"6��"��"ֵ�"ߵ"�("�H"�h"���"��"��"���"�("��0"��@"�"P"�X"Ђ`"��x"���"��"@��"��h"���"��"N��"��"��".�0"��"���"`|�"�[�" "�" "("��"Y��"@�P"�X"�{`"{W�""�""�"�"�"�X"i�p"��"TV "�V( "�"� "��!"��!"�V�!"�V�!"�"�"
�"
�"�"�"�"�"�"�""�"#�"%�"'�")"*"4">"B "E("H0"K8"M@"OH"PP"TX"U`"Yh"Zp"bx"h�"i�"m�"w�"x�"{�"|�"��"��"��"��"��"��"�0"��"�8"�"@"�"�"tX!"t�"_p!"_�";x!";h
"p
"x
"�
"�
"�
"�
"�
"	�
"�
"�
"�
"�
"�
"�
"�
"�
"�
"�
"""""  "!("$0"&8"(@"+H",P"-X".`"/h"0p"1x"2�"3�"5�"6�"7�"8�"9�":�"<�"=�"?�"@�"A�"C�"D�"F�"G"H"I"J"L "N("Q0"R8"S@"VH"WP"XX"[`"\h"]p"^x"`�"a�"c�"d�"e�"f�"g�"j�"k�"l�"n�"o�"p�"q�"r�"s�"u
"v
"y
"z
"} 
"~(
"0
"�8
"�@
"�H
"�P
"�X
"�`
"�h
"�p
"�x
"��
"��
"��
"��
"��
"��
"��
"��
"��
"��
"��
"��
"��
"��
"��
"��
"�"�"�"�"� "�("�0"�8"�@"�H"�P"�X"�`"�h"�p"�x"��"��"��"���H��H���!H��t��H����5"�!�%#�!��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&�������h'��q������h(��a������h)��Q������h*��A������h+��1������h,��!������h-��������h.��������h/������h0�������h1��������h2�������h3�������h4�������h5�������h6�������h7��q������h8��a������h9��Q������h:��A������h;��1������h<��!������h=��������h>��������h?������h@�������hA��������hB�������hC�������hD�������hE�������hF�������hG��q������hH��a������hI��Q������hJ��A������hK��1������hL��!������hM��������hN��������hO������hP�������hQ��������hR�������hS�������hT�������hU�������hV�������hW��q������hX��a������hY��Q������hZ��A������h[��1������h\��!������h]��������h^��������h_������h`�������ha��������hb�������hc�������hd�������he�������hf�������hg��q������hh��a������hi��Q������hj��A������hk��1������hl��!������hm��������hn��������ho������hp�������hq��������hr�������hs�������ht�������hu�������hv�������hw��q������hx��a������hy��Q������hz��A������h{��1������h|��!������h}��������h~��������h������h��������h���������h��������h��������h��������h���������%��!D���%��!D���%��!D���%��!D���%��!D���%��!D���%��!D���%��!D���%}�!D���%u�!D���%m�!D���%e�!D���%]�!D���%U�!D���%M�!D���%E�!D���%=�!D���%5�!D���%-�!D���%%�!D���%�!D���%�!D���%
�!D���%�!D���%��!D���%��!D���%�!D���%�!D���%ݻ!D���%ջ!D���%ͻ!D���%Ż!D���%��!D���%��!D���%��!D���%��!D���%��!D���%��!D���%��!D���%��!D���%}�!D���%u�!D���%m�!D���%e�!D���%]�!D���%U�!D���%M�!D���%E�!D���%=�!D���%5�!D���%-�!D���%%�!D���%�!D���%�!D���%
�!D���%�!D���%��!D���%��!D���%�!D���%�!D���%ݺ!D���%պ!D���%ͺ!D���%ź!D���%��!D���%��!D���%��!D���%��!D���%��!D���%��!D���%��!D���%��!D���%}�!D���%u�!D���%m�!D���%e�!D���%]�!D���%U�!D���%M�!D���%E�!D���%=�!D���%5�!D���%-�!D���%%�!D���%�!D���%�!D���%
�!D���%�!D���%��!D���%��!D���%�!D���%�!D���%ݹ!D���%չ!D���%͹!D���%Ź!D���%��!D���%��!D���%��!D���%��!D���%��!D���%��!D���%��!D���%��!D���%}�!D���%u�!D���%m�!D���%e�!D���%]�!D���%U�!D���%M�!D���%E�!D���%=�!D���%5�!D���%-�!D���%%�!D���%�!D���%�!D���%
�!D���%�!D���%��!D���%��!D���%�!D���%�!D���%ݸ!D���%ո!D���%͸!D���%Ÿ!D���%��!D���%��!D���%��!D���%��!D���%��!D���%��!D[L��H��]A\��L��Յ��#&�&L��Յ��&��%L��Յ���%��%L��Յ���%��%��H�H��H��tH���1��[L��H��]A\��L��Յ��d&�2&L��Յ��R&�;&��H�H��H��tH���1����H�GH��tH�GH�u
RH������1�Y�1����H�GH��tH�GH�u
RH�����1�Y�1��H�t$���H�t$�<����&����=&[�z����u����q'��H�GH�xH��tP�<H�B�!H�Z�H�6�!H���-���1��=���SH��H�@H��tH�C@H�u����H�{8H��tH�C8H�u���H�{H��tH�CH�u����H�{(H��tH�C(H�u���H���H��tHǃ�H�u���H�{0H��tH�C0H�u���H���H��tHǃ�H�u�d���H�{H��t
H�C�><1�[��5����<H��1�����!����<X[]��#����'�����D'���=��USQH��uH��!H�5�DH�:������QH��H��H���W�����uH��!H�5�DH�8�}������$H�}0H�E8H�H�]0H��t
H�u���1�Z[]���USQH��uH���!H�5fDH�:�.������QH��H��H��������uH�h�!H�5�DH�8�������$H�}H�E H�H�]H��t
H�u����1�Z[]�H�w8H��t	H��[���H��<H�w H��t	H��[����H��<�I���H��u	H����&1�[�SH���.���H��uH�ʴ!H�53DH�8�c���H���H��tHǃ�H�u���H���H��tHǃ�H�u�a���H���H��tHǃ�H�u�@���H���H��tHǃ�H�u������[����H����&��1�[��/�����uEI��L�����E�u M�}A�� tA��@��=I��0�K<M�mH�B<L�����1��=1��=L��H�t$���L�d$H�t$�s@L�������?H�t$�|���L�L$H�t$�@L��L�\$H�t$�[���H�\$H�t$L�\$�n@H���?���H�L$�<?L���-���H�\$�?H��D$�����D$�:&H�H���+&H��������&���H���A�����+C��SH��H���H��tHǃ�H�u���H���H��tHǃ�H�u���H���H��tHǃ�H�u�l���H���H��tHǃ�H�u�K���H�{H��tH�CH�u�0���H�{0H��tH�C0H�u����H���H��tHǃ�H�u��H�{@tH�{@����H�C@H�s H�{�O8H�����H���Hǃ��l�H���Hǃ��U�H���Hǃ��>�1�Hǃ�[�1��.%�c����E%H�xH��t
H��Ӆ���I�|$H��t
H��Ӆ���I�|$H��t
H��Ӆ���I�|$ H��t
H��Ӆ���I�|$(H��t
H��Ӆ���I�|$0H��t
H��Ӆ���I�|$8H��t	H��Ӆ�uwI�|$@H��t	H��Ӆ�udI�|$HH��t	H��Ӆ�uQI�|$PH��t	H��Ӆ�u>I�|$XH��t	H��Ӆ�u+I�|$`H��t	H��Ӆ�uI�|$h1�H��tH��H��[]A\��[]A\�L���>����8&L���1�����%L���$�����%H�xH�5@������%L���������%L�������%I�EL����������'���'��� �8H�D$ ��5I��H���BH�t$0H�|$(H�l$ H�t$H�|$H�,$H�L$H�T$L��H�4$�K���L�D$0M�HA�����I�x��I�x�H�I��H����L�T$0I�mI�}M�Z H��L���_H�8��I�M�}L�L�`I��H�UUUUUUUUM�}I9���I�UK�H�H9��F���J��I��P���A�L9���M���H���!H�5�=H�;�H���X&H�
��!H�P1�H�5$?H�9�����4&���,&�&L�
`�!H�5�>I�9��L���!4���&��H������L�`���M�L���R��������H��������I9�wqM��I��L��L�D$�J�I�EH��tTM�eI��H�T$1�M�eH����M�eI��M��t6M�;M��tI�}I�uL��I����I�{L�8H�xI����I�m�p���H���,�������&H�p�!H�5A<H�:�	���y&L�R�!H�5�OI�;����&���V&I��������L�M9�wbH��H�{L�\$(H��H�L$ H�D$�L�H��t>H�s H�T$H�CH�L$ H�|$(H9�v,H��H����H�/��%���%���%H�{ �	&AVAUI��ATUS��H��tbH��1�I�EH;h sUH�PL�4�M��uH����H����I��H��t$L��H��H���B�I�$A��uL���1�E��y�H�uH����1�H��[]A\A]A^���H���n�����UH��SQ�^���H��tO�H���b�H��H��uH�Mu4H������D��@�H��uH�MuH����H�uH����1��H�ū!H�hH�C H�H�SH��Z[]�H� ��1��	>AWAVAUATUSH��Q��H����H��H�E1�L�h�8H��twH��L��H���1�I�A��uL���!�H�uH����E��xQI��M;esxL��H��IUH�H��t�L�zH����H��H�=�MI��L��1���H��M��u�M��uH��u!H�MuH����1��I�u�L������H�u�H������ZH��[]A\A]A^A_���UH��SQ����H��tO�H�����H��H��uH�Mu4H���G��D���H��uH�MuH���(�H�uH����1��H�@�!H�hH�C H�H�SH��Z[]���H���~���AUI��ATI��UH��SQH�>u��H�EH��tQL���q�H��H��tAH�}H���-�H��t=H�uH����I�EH�=��!L��H�5�:H�PH�?1���A�$����E1��S���H��tH�u��"H�C�!H�}H���G�H���yH��H�u�H���0��H��A�H�uH����ZD��[]A\A]�H�
Ʃ!H�RH�5[;1�H�9��1���<L�����1�H�+��<��H��H�D$���H�D$�<I�HH�WH�5�:1�L�c�!I�8��1��<H�
M�!H�V1�H�5H:H�9��1��b<H��u����H����H�D$�t���H�ֹ�H�=K����u;1��!<H����=��H��u�I�~@H����H��uK�w�H����;��H�]H�m1�H�5�JH�=�JH��H���i���x�A��$�p;��:H���<H��H�-��!H��1�H�5�JH�}���7���UH��H��SQ�7�H��t&H�}H��H����H���yH��H�uH���\�1��H�ʽH�uH���C���Z[]�H����=��H���=1�1�1�L���X�I���?L�����AI���@I�,$uL�����H���w?H�=+�!��H����H�5�9H�x�~�H���J?L������?I�|$H�5�I�W����G"H�+�Z"H���}����-"I�m�?"L���b����"I�mtH�H�}H���6����!L��H�D$�.�H�D$��L��D$���D$�!I�m��!L�������!I�muL�����H�-ѥ!H��H�5�81�H�}������|!I�muL����� �H���|!L�%��!H��H�5�81�I�<$�����;!H���*�H��H����!L���!H��I�;��H�+��!H���J����!H�=��!�v�H����H�5w8H��������H�x1��2����#H�<$H�/u�����A���A1��AL������AH������BI�<$I�v�)I�<$H�oI�mu�L�����I�muL����I���BL�����lE�j�I����B1�1�1�L����I����D���#H�muH���B��}��#L���0��U#I�EH��I�E��#L��H�D$��H�D$�y#L��H�D$��H�D$�W#���E����J�����FH�/�J���JH�/��F���FH��FL�-�FA�H�T$H��������O��MH�5�F1�L�-�FA�H�t$H�����=M�|�A�ƅ���OM��I���OOL�-YF1�L�l$L�-RF�LI�(�NL�����
NPH�~A�1�L���!1�L��H�D$(Pjj���H�� H��H���0OL� M����NL�5��!H�5�EI�>�j����8LH��H�GH�5�EH�=J�����I�(�mNL���q�H�|$�[NH�P�!H�5�EH�;������KH��FH�5�EH�=�I�o�����H�C���KH�C0H�m�MH��D$���D$��LL�=EL�-EA�L�|$�D��������[KI�,$uL������H�CH���	N�LH�C���%K���Q�r����QH�k�!H�5�4H��������H�81��x����TS�;����GS�n�A�Ņ��*I����XL�5�!L���WI�,$��XL����H�|$��XL�������H�C���`V���H�C���KVH�ܠ!H�5}4H�;�u����-VL���!�H�5D1�I�:�����VL�%q�!�WH�CH�/��W�D$�a��D$�WL��A�H����L��I���:VPH��A�1�L��!1�L��H�D$(Pjj��H�� H��H��uW���U��VL�%�!�nWI�,$�DWL������7WA����UL��A�M���c���H�H�T$�hU��UM�&��I�\$�X1���X�D$�{��D$��XM�b�ZH��>H�6��]�E������ZH�=��!���H����H�5j3H�x������ZL�m������Z���Z�s�H��t	I���saH�ޞ!H�5o3H�:����H�(uH������
Lc��@aH�
��!1�H�53H�9����H�+u�H��I�����a���Ed�v�����8d����A�����L9�gH�sH�k`�$j�|$L�cPI���usH�FI9�|uH�K@A��D1 jH�kHL�A �T$A�T(�kH�[�!H�;�s����j�����H�=M�!�8��H������H�5�2H�x����A��iA�A��-mL���!H�5�21�H��������I�;�������nH�(uH������Hc��`oH�=f�!1�H�5�1H�?���I�,$�FoL���R��9o���H���+oH�(�!H�5�1H�8����o������Cn������r�XH���!H�52H�:�����\r�D$�1�L�D$ ��H��H��A�<0H��H��u�D�s`A�	�\t�������v1��L�H���vH�=ݦ!����H���`��H�5�1H�x�0����vH���`�鹕H�xH�503����H���>��ف�t���́M��$�M��$��xH�=`�!�K��H������H�5\3H�x��鎁�I����tI�L$��M��$�M��$���wH�5/�!L���g��I��H���K�I��I�D$M9�taH�PL��J�4��n#H����H�(uH���w�I����H���i��~�L���\��H���O���H���B���H�XM��$�M��$��$w��H�L$��I��L���H�+tXM�����I�m���A��L�������șH��������H�=�!���H�����H�5�>H�x�l��H�����M���9�I�m�.�A���I�|$I�w�ZM�L$I�Y��L���d���ȓH;H�!���Β�H���;���H� �H�+��E1�H���%���|L���������������H�+��H�������H�=1�!���H�����H�5�0H�x���A��鑘L������&�����DL�����M��$�M��$��uM��$�M��$��ruH�~ ��
���M��$�M��$��Lu�7����~L���:���{�p
����~M��$�M��$��uI�t����D
����~M��$�M��$���tH�-ؙ!H�5�.1�H��������H�}�����_~I�x �&
�Q~H�=��!����H���}��H�5�<H�x�M��M��tI�/uL���z��H�+�~H���h���~L���[��M��$�M��$��FtI�/uL���8���s����}M��$�M��$��t����}�� @��^vpH�xH�54<1�1������}�%���}}M��$�M��$���sH�=�!���H�����H�5
/H�x�d���?}1��x�rsH�xH�5�;1�1�����k}L��H�D$�m��H�D$��u�����|M��$�M��$��AsH��H�D$�4��H�D$�L��H�D$���H�D$�iH�=\�!�G��H������H�5P;H�x����p����%���}|M��$�M��$���r���)��H�����H�+�F|H������9|H�=�!����H���e��H�5�:H�x�5�����H���h���uH�x ��
�{���H��H����{L�=}�!H��I�?���H�m��{H������{H�J��J�t�H�������x=I��鰐L�5�!H�5�-1�H��������I�>����q{H������餔H�+�Z{H������M{L�AA���tQH�t$H���R��I��H��tVH��1�L���H��H��H;L$uTI���G1��N�K��I�/tP1��iH��9H�5�8H�=t7�t��1��HI���rI���jL�
�!H�5\8I�9��������L��1�����
L���#������I�muL���������I�I�Gt	H����I�/�Y���L��1�����I�G������J���A�ƅ��&���M��I���"L��71�L�%�7L�$�CH�q���tGH��H�t$���H��H�$H��tHH��1��H��H��H;L$u9I����1�L�%27��H�h8H�5,7H�='6�'��1��L�ɓ!H�57I�:�����H�
�6H�=�6A�H�$H�|$���E1��ޢH��6H�5�6A�H�$H�t$H�muH���r���]��I�I�Gt	H�����I�/uaL���K���WH�q�����H��H�t$����H��H�$H��t-H��1��H��H��H;L$tVL�-�!H�5H6I�}���1��ҟ���A�ƅ�x�L��H���ԠL��5L�
�5E1�L�$L�L$�#�H�����E1���H�7H�5�5H�=�6�����H��6H�5�5H�=�6����t����Q���͢I����I����I�G���I�/��A���<�H�=�6�������I�/��A���@��}X~H�D$`�H�t$`E1�H�VB��M��I��F�
I��I��u�	�Z�L��A������ߩL���!H�5*I�8�a��H���.H�+�$H��A������!�H�=+6������ڭ�V���L���\����I�.uL���I��I�/�
���L��A���3���>�A���5����H����A����L������}�H�
��!1�H�\$A��H�5�)H�9���鹳�F��H���cL���!H�5H5A��I�8�s���R�D�e|H�}|H���A��D�e|A��1�ɼL����������C���L��A���l���w�E1�A��G�R��A���аL�����@�x�L���8���c�L�����������DD��+�E1��N�1�����R��E1�A���ϸA���ͲA��G�I��H�=�4�f�������I�.��A���вH�=i4�?��������H�=�!A������H���m��H�5�(H�x�=��鈩H�+uH���j��A����H�+u�H���S����L���I����H�t$`�H��f�D$`��H���Ƣ�D�u|H���E�F�D�E|A��1��L������a���DD��1����L�������_�L��A�������۱L�-�!1�H�\$A��H�5�'I�}����鯨H�����骡I�,$���L��A���{��鞦I�t$H��I�t$H�־L���Z���+�L��A��G���j�L���j�����������H����������D�M|H�}|H���A��D�M|A��1�ůL���	�������%���L��H�5��!L��������k�L�t$8M��tfM�N1�M�Y8A����UK�H���H1�1�L����1�L��H������I��遴L�������O��_����X��A���6�H�=��!1����H���)��I�T$L��H�5�&H�x1�A���K���6�A���-�1�A���"����4v�&�H�=�1����������L�=�!M9���L�=\�!M9��Q�L�=��!M9���L�=Č!M9����L;%\�!����a��T$�"H�}8�T$�ǝH����-�T$������H��T$��T$��������1�1�L�����I���C�L��A���8���n�������H�/�c����YH��1����������HL��!�H�5n/1�I�8����H��!H�5�H�;�����I�/t1���L�����1��������H���H���	��%I�G0H�/���h������A�Ņ�x�I����H�-6�!��L�%*�!�H�
F�!H�5%H�9����I�muKL��������5�L��H���]!H���N��%H��!H�5�$H�;���H�muH����������H�֊!H�5�$H�;�o�����ԿI�.u�L�������H�m�m���H������`����j����響�]�����E�H�mt&���6����H��A��A�����H�mu
H���0��M��t�I�mu�L����������H��D$����D$��x��{`H�sPH�KH���i�H������1���L��������H�������f�L��H��� H������I���H�\$ I�~H�5%1�L�cI�T$������g�I�~H�5T&�/�����O�H��D$�[���D$��I�~H�5).������"�I�~H�5?&�������
�L�������M�l$I�E�j�L�������I�.tH�|$HH�/�T���������L��������H�m�2�H���������I�PI�~H�5;%1�������|�H�VI�~1�H�5�$������^�H�QI�~H�5o$1�������@��S���8����.�I�~H�5�#1��T�������������I�~H�5d"���������I�~H�5�"��������I�~H�5�!�������H�/�[������Q����dH�m���H�������H�|$�����H�\$A����H�\$A����H�|$�n���s�H�D$8H�<$L�L�D$I��L��!��B����H�D$1�A��H�D$���1�H�<$�����1�H�������������H�|$H�t$(����H�|$HH�t$(�=�������I�}���A���S�1��A���F�H�5ٌ!L���Q��H��H�D$0H���	�A���F�H�|$�}����H�|$���H�D$H����H�|$����H�D$8H����H�|$H�����H�D$@H���nH�|$8H��L��H���H�|$@��L�'��I��L�'u���H�|$8H�/u�����W��H��t�H�T$H�H�$H��H��wH�D$A��1�H�D$�]�L�e�!H�5�*1�A��I�:�P��H�D$�3�H�D$1�A����L�\$I�H�$H��I�uL���Q��H�=��!�U��H�$H�D$8H����H���H�|$� �����L�=ԅ!H�J1�1�H�WH�5�#I�?A�����H�\$��H���!I�PA��1�H�5+#H�81�����H�\$�U�H�|$8H��H�/u���H�|$L�L�$I��L���H�D$A��H�D$�)�I��L�'u�j��H�L$L�9L�<$I��L�9uH���M��H�t$8H�4$H�����H�D$1�A��H�D$����	��I�/t,H�\$A��1�������H�mt(H�\$A��1��}�L��1�A������H�\$�e�H��A��1����H�\$�M�H�|$A�����H�D$H�D$�C�H�D$A��1�H�D$�&�L��H�t$(�h��L�d$HH�t$(L�d$�R�H�D$1�A��H�D$���H�=��!A��1��e��H�����H�5NH�x������H�|$������H�<$�����|�I��L��H��L��������A��1��`�A��1��U�1�H�\$A���E�H��������H����I�}PH�4$���H��H���V�����H���~A�VX�H�H�<$�_��A�VXH�,$�2�H�|$A��1��B��H�D$H�D$���H��!H�P1�A��H�5!1�H�;�)��H�\$��H�\$A��1�������A��H�\$1��p�E1��������H�|$A�~XH�|$0�����H�D$I��I�,$H��M9�u%I�,$H��t[A�~X����.�H�D$I��I�,$H��uL���d��L�|$L�D$0L��1�H�$H�5�1�I�A���[�����L���.���H�\$H�$L��1�H�5_A��H�{1��(��H�D$H�D$��H�D$A��1�H�D$��H�t$H��L��1�H�~H�5�����A��1��B�H��H�t$���L�d$HH�t$�S�M�K�P�H���!A��H�;����H�\$�����L�l$A�NXH�5�1�H�$I�}�h���H�\$���L�-׀!�h�H��������H���'��_���L�%'�!I�<$�f�����uH�\$A��1���A�NXL�t$1�A��H�T$0H�5g1�I�~���H�\$�X�H�\$A��1��H�蝿��A��H�\$1��3�H�|$H�t$(���L�d$HH�t$(��H�\$A��1����Z���A��H�\$1�����E���A��1����M����q���A��1�������H���l���L�t$L��L��1�H�5/I�~�&����J���H�\$A����H�\$A���{�H�-�!H�{H��u+A�L�c���H�C0H�/���������վ��A�Dž���I��u�L�%}!��H�/����y��������U������L�I~!�H�5�!1�I�;�c�����L�%'!A�����E1���H�+uH�����E1���H�-�~!�$���L�%�~!A�L����E1����I����I����L�%�~!A�L��E1��}���訽����螽���{�H�/�6�����,�H�C0H�/���~����L�KhI����o�H�V�K�| L)�H��v/��H�WH�sHH��H�Ch����H�C@�6�����y*E1����H�w	���L�SHH�Ch����I�r�H�sH��H�l$H���
�H�{81�1�H���
���H�m���H�����H�(�-�L�-�}!I�E�p�H��zL������mL�[XH�Z}!H�5�I�kH�81�H�U衽��I�$H��I�$uL���k���H�����&L���V�����
L���I����t
H�
�|!I�RH�5�1�H�9�H���I�mu�L�������H�=�|!I�QH�5u1�H�?������I�PL��|!H�51�I�8����L�
�|!H�WH�5�1�I�9�߼���L������	L�i|!H�RH�5�1�I�;贼���g���H�-H|!H�P1�H�5�H�}蒼���E���L�&|!H�V1�H�5I�:�q����$���L�%|!H�QH�5�1�I�<$�O�������f.�UH��SH��H�_H9�/�:ff.��H�EH��H�:H��tH�H�/�7��H��H9�~�H�uH��1�[]�f�UH��SQH�_H�OH��x!H��H��H�<H��t�H�/u�葿��H�M��H�UH�E1�H��H�����Z1�[]�ff.�H��������SH9��
��H��H�����H������H��1�H���v���H��H��[�ff.�H������SH���>���H�{赹��H��[鬹��ff.��S� �E���H��H�����foCH�@������H��H�CH���\��� 1�H���H��[�ff.�USQH�/H���E��H�H�H��xH�|�H��t�H�/u��L�����ZH��[]���ff.�@��USH��H��H�kH�H��y�и��H��H��[]����H��H�*tH��H���t���H�����H�{��ff.�USH��QH�wPH�o@1��K���H�C@H��tH�muH��製��H�{@����H�CH1�H�Ch����Z[]�f���SH�_0H���Z��H�gy!H�5�H�8����H��[���SH�_H���E��H�7y!H�5pH�8���H��[�S1�H��1�H���/���H�+tH��[�H��H�D$���H�D$��ff.�@AWAVAUI��ATUSH��8dH�%(H��$(1�� ����I��L���d���E�u M�}A�� ����A��@�NI��0A��L��L��A�����H�������D$M����1�H��H��L�����A��tK��C�\H��\����
������������
���I�hH�FA�\-��\����
������������
��L�EH�p�L��M9��y���L���ѵ��H��$(dH3<%(�SH��8[]A\A]A^A_��A����A�\-��\t+��
t&��t"��t��
t�H��H�����I��H����H��L������I��H���O��H�-w!A�ۉ�A��f�\uA������H�2��A��A��B�A�BH�:I�BD�E�BL�C�4A�rH��A�ZH��L9��W���H�����A��uMA�\m���@�ƃ�\�T���@���K������C�����
�:�����
�1������(����H���A�\�����w���@����b���L��	H������H��H���Q���f�\UH�*v!A��A��A��A��L�A��G�A��A��D�WH�A��A��A��B�A���OH�0���F���D�OL�A��A��C�A���WL�A�4@�wL�G�
D�_H��؃������H�G
�O��_	���@AWAVI��AUATUSH��H��(H�|$H�H�nH����H�FI��L�|$L��H�0�/���H�L$H����H��tkI�UL�bH�+�����L��H��L��H�L$���L�d$H�|$M����H��uWL��I���M��u&M��t$I�,$u�u���f.�I��H��M��t�M�&H��(H��[]A\A]A^A_�E1�H��u���I�]H�sH����L��L���j���H�\$H����H��tvI�uM��I��H�vI�(����ff.�A�L��L��L�\$����H�\$L�\$H����I��L9��*���I�EJ�4�M����I���@M���2�������H�/M���/���L��L��L�L$赴��L�d$L�D$M��tTH��uL��M������DM�UI�rM���O����2���I��I�,$�����鿾��I�,$�n����վ��M����I�����AUATI��UH��SH��H���E`H�wHH�P���
H�3H��H9��WL�E@I�� H����H����A�$A�0H���|A�t$L�mHC�t(H��tgE�L$L�UHG�LH��tRE�\$H�UHE�\H��t=A�|$H�MHA�|H��t(A�D$H�uHA�D0H��tE�d$L�mHG�d(@H]HH��H��[]A\A]�ff.�I�<0H��L�����H�MHH�H�MHH��H��[]A\A]��H�}h����H�R	H�2H9���L�E@I�� H���������H�uhL�H�>�F�H�MHH�q	H�uHH���H�3H�������H��E1�I��������?I)�I9������H�A�H�}@I��H�4@H�uP�k������v���L�E@H�uHI�� E��t��q���A��DH�GH�WH;G0tH�HH�OH�4�1��ATI��H��������UH��H)�H��SH��H��H9�����H��������H�H9������H�4�H���/���H�����L�CH�CH�k0M�HL�KN�$�1�[]A\����ATUH��SH���m���H�8I��H��� ���H��Ӆ��&���I�|$H������H��Ӆ�����I�|$H������H��Ӆ���I�|$H������H��Ӆ��վ��I�|$ H������H��Ӆ������I�|$(H������H��Ӆ������I�|$0H������H��Ӆ������I�|$8H�������H��Ӆ��i���I�|$@H�������H��Ӆ��N���I�|$HH�����H��Ӆ��3���I�|$PH�����H��Ӆ�����I�|$XH���߽��H��Ӆ������I�|$`H���׽��H��Ӆ����I�|$hH���Խ��H��H��[]A\��H���H��~MH��H���H�OH���@��L��D��H��D�I tN�T�L�Q(�f.�H�A(��b�f�ATUH��SH9w(� ��H�_I��H)�H���
���H��t"1�H9�}H�MI�4H�<�H�|�H����L�e[]A\Ð��AWAVAUATI��UH��SH��(dH�%(H�D$1�H������H�H�nH�=�H�5�H��H��螳��������A��$��A��$����H�=0w!����H��賮��H��H�޿I��1��^���I��H���{��I�~8H���&���I�mI���h��L��萱��M������H���B��I�~@H�����H�����ϭ��H�����H���^���H��H�����A��$WH�T$H��H���7���H�D$H������H�+��H�L$dH3%(��H��([]A\A]A^A_�ff.��H�=�x!���H�����H��H������I��H������L�hM����L�HH�5�I�9������8I��txM�T$H�5dI�z�î�����I��tUM�\$H�5AI�{蠮������I��t2A�L�=I�D$L��J�<��t�������I��M9�u�1�L��H�����H�D$I�,$��L�����H�D$H���q��H�+�������ff.�H��H�S����V������I�w������I������I�_I�o H�{L�E��������A����
������膮��H�=Ok!1�H��H��H�5�H�?�X���I�,$�K����>����M������ff.�H�GhH���tZSH�WHH��H�O@H��	H)�H�| H��v,��E1�B��H��I��H��B�4I��u�H�Ch����[�H�w	�s���H�kH	���ff.�ATUH��S�G`H��H�OHH�WP��u'H�AH9�r�uH�{@�@�t H�CH[]A\�f�H�h�u�H�A
H9���L�C@I�� H���������H�KhL�H�1�A�H�KHH�I	H�KH�}�A�<H�CH�E1�A�I��������?M)�I9������H�A�H�{@I��H�4@H�sP�ѫ���������L�C@H�KHI�� E��t��o���A�A�
�DH��������AVAUATUH��SH���H)�H�H9������H��H���H���H+��I��H���qH�����H���t
H������H���ҭ��I��H���+���H���1�H��1��#���I�.I����H������H�{@L�s@��L������L��L��薩��������L�sPH�{@Hǃ�H���L���L���I�,$����M�������L9��4I�}H��H���[]A\A]A^�f�L���M�FM�H8A�������K�H������1�1�1�L����1�L��H���^���I��M���'���H�{@L�s@tL�������L��L��迨�������L�sPL�S@Hǃ�L���L���L���I�,$�����M�������L9��]L���H��M�]H���[]A\A]A^ÿ�*���H�������H���H���B�I��H���H�{@L�s@tL���c����L��L���������(���L�sPH�K@Hǃ�H���L���L���I�,$���Hǃ�L9�bH���=������1�H�57�̫��H���ؾ��H�(uH��赪��H���H���H����=���H���t
H��������H���.���I��H�������H���1�H��1�����I�.I���7���L���J����*�����H�����H�5Bf!H�>芦�����7����}���H���H��t�Hǃ�H�/�v�������l���f�AWAVAUATUSH��L�/dH�%(H�D$1�I�]H9��H��I;u(�H9������I�EL�4�H��d!N�|0�I9W��H)�H���ߪ��I��H�������H��~nI�UH�@J�2H�1H�0H��tVJ�|2H�xH��tGN�D2L�@H��t8N�L2L�HH��t)N�t2 L�p H��tA�N��N��I��L9�u�I�mI�wL��L��H���:���I�,$��uL���٨��H�L$dH3%(���H��[]A\A]A^A_�I��H��H�5�m!L���ߨ���������H�<$t|M�$$I�\$H)�H���ܩ��E1�H���f���L9�~M�L$L�XM�O��O��I����I�l$H�<$H��� �H�<$I��H�/u�.���M���*���I�/�7���1��;���H�5�l!L��赤��I��H�������I��I�$L9�t)H�qL��J�4���H���
���H�(��I����H�iI�mu�L��1�诧�������զ��I�} �������DAVAUATUH��SH���H��H���H9���H���L�4A�>
�H�BH9����|
tbH�BH9����|
tNH�BH9����|
t:H�BH9����|
t&H�BH9�~}�|
tH��H9�}m�<
u��I��H��H���H���I)�I�uM�e����H���3���L��L��H���D���B�D(H���H�E[L��]A\A]A^��H���H����H+��H���mL���M�L$M�Q8A����Ѽ��O�4M���ļ��1�1�1�L��A��1�L��H���\���I��H���{���H�{@L�c@��L�������L��L��蹢�����=���L�cPL�s@Hǃ�L���L���L���I�m�"���M��������C�|&�
��L���H���I�t$�۠��H��H����L��L��H������B� H���[H�E]L��A\A]A^�DH���H���H���脠��H�������A�>A��@@�8H���[H�E]L��A\A]A^�1�H�5P���H���G���H�(uH���Τ��L���H���I�|$H���L�G8����2���O�,M���%���1�1�1�L��A��1�L��H��轢��I��M����H�{@L�c@tL���~����L��L�������������L�cPL�[@Hǃ�L���L���L���I�m�����M���u���t>L���C�|%�
u/L���H���I�t$�A���H��H���V���L��L���a�����Lc��*����#����USH��H��(dH�%(H�D$1�H�G@�`H�D$uH�C@H�sHH�|$�r���������H�l$H����H�{81�1�H���l���H�mH����H����H�1�H�z�H�;H��tlH�L$dH3%(��H��([]�H�OhH����s���H�wHH�| H�V�H)�H��vL��1��I��H��I��D�/H��u�H�Ch�����0���H�߉D$謢���D$�H��螢���[���H�w	�P���H�kH	�ă��]���謡��ff.����ATUH��S�`���H�}@H���IH�}8H���XH�}H���CH�}(H���JH���H���M���H�}0H���T���H���H���,L�eM���-I�\$I�D$H����H�S����H����H����H��trH��tTH��t6H��tH��H��H�<H���nH��H��H��H�<0H���H��H��H��H�<8H���%H��I��I��J�<H����H��I��I��J�<H����H��I��I��J�<H���H��I��I��J�<H���aH��H�����I�T$1�H��I�D$H���'���I�|$荛��L��腛��L�e[H��]I��$@A\��H�/u
襠��I�D$H��H��H��H�<H���hH�s�H��H�<0H���3H�{�H��H�<8H����L�C�I��J�<H����L�K�I��J�<H����L�S�I��J�<H��ucL�[�I��J�<H��u2H��H�������H��H��H�<H���P����;���ff.�H�/u��՟��I�D$�ff.�H�/u�赟��I�D$�ff.�H�/�b���葟��I�D$�S����H�/�-����q���I�D$�����H�/������Q���I�D$����H�/�����1���I�D$����H�/���������I�D$����H�/������I�D$����H�/������ߞ��H�}H����H�}(H����H���H�����H�}0H����������H�/�����葞��I�D$���H�/�L����x���I�D$�=���H�/����_���I�D$����H�/�����F���I�D$��H�/�����-���I�D$����H�/���������I�D$�y���H�/�����������H�/�����������H�/������H�/�������@��AWAVAUATUH��SH��H��XL�vdH�%(H�D$H1�H���DH��L�jH�~L��H�L$(A�L�a!Q1�M�jM�}�j�G���H�� H��H����L� M���CH��������H���H�5�a!L���W������tH���H�5Qa!L���9������VH���H�5a!L������H���H�5�`!L������H���H���ŵ��H���H�������H�=����H�=��H����֘��H���H��������H�������H��H�T$Hǃ�H�5>`!ǃ����H�|$H����H�k0H�C8H���������yH�=b!蘗��I��H���]���foT H�@�@�@ @(�G���I�D$H������L�c�H�C  �#���I��H���z���H�xH��H�Hǀ�H��H��H)������H�L�cǃH�L$HdH3%(��H��X[]A\A]A^A_�M�~�I���6���H�^�L�fL�-Z�H�T$H����_H���H�5v_!L���>������[H���H�58_!L��� ������=H���H�5�^!L������H���H�5�^!L�����H�������H�����L���ؖ��H�|$H����ǖ��H���H��������H����H��t
H;-=V!��Hǃ�D��H��H�T$H�5^!�a���H�|$H����H�k0H�C8H��������[H�=�_!�z���I��H���?���fo
6H�@�@�@ H(�)���I�D$H�����L�cH�C  �����I��H���\�����H�xH��H�Hǀ�H��1�H)������H�L�[ǃ����L�C0L�
U!L9O�[H;_�QL�WI�H�[8L�S0M�������H�/�����������H�}A�H�������H�}L�-
�H��uBH�ML�
��L�L$H����H�m ���H���˖��H���H���_������)���H�w������H�t$�8���I��H���°��H��1�L���I��I��I��L;D$�����I���m���L�g�1�L�\$�
���L�QA����԰��H��H�t$�Г��H��H�D$H�������H��1��H��H��H;L$�~���I������1����H�C8H�{0M������頯������R����ٰ������fD��ATI��US萒��I��$�H���0I��$�H���?I��$�H���NI��$�H���yI�|$H��tH�/u�7���I�|$0H���BI��$�H���I�|$@tI�|$@�&���I�D$@I�l$H��t[I�D$I�\$ H��y�=ff.�f�H��H���t&H�|�H��t�H�/u�豖��H��H���u��H���X���I��$��K���I��$��>���I��$��1���I��$��$���I�D$[L��]A\H��@��H�/�����@���I��$�H�������H�/������ ���I��$�H�������H�/������������H�/�����������H�/������ؕ�����H�/�}����ĕ���s���ff.�@AVAUATUSL�7I�nH9��<H��I��H)�I;n(�H�����I��H�����H��~lI�FH�}H��H�
I�MH��tSL��H�4�M�E H��t=L�L0M�M(H��t.L�T0M�U0H��tA�J��K�D�I��L9�u��I�nM�4$I�^I�~I;^0tH�k1�I�nL�,�[]A\A]A^�H��������I��I��H)�I��I9��+���H��������I�I9�����J�4����H�������I�~I�FM�f0H�wI�vL�,�1��I�~ ������[I�~ ]A\A]A^��ff.�ATHc�UI��SH��H��H���dH�%(H�D$1�H���H��H)�H9��2H���H�H���H�H�<$�/A��tx�G�WH��H��H	�H	��oH��H	�A��tJD�GI�� L	�A��t8D�OD�WI��(I��0L	�L	�A��uD�_I��8L	�������H���L���L)�H9���H���H��H���L�I�L���H�<$����H��H���RH�[L�CH�K0H�{I9���M�HL�KJ��1�H�t$dH34%(�H��[]A\�ff.�@H���(�H����H�<$�/A�������9���f�H��H��H�����H����H�<$H��H����Ɠ��H��H����H�[H�sH�K0H�{H9�tH�VH�SH��1��F���I��������I��I��I)�I��M9��ѫ��I��������I�M9������J�4��^���H�������H�{H�CL�c0H�wH�sH�,�1���������������f���AWAVAUATUH�nSH��H��XL�~dH�%(H�D$H1�H���-H��L�jH��1�H�t$(A�L�[T!VL��M�jM�u�j�G���H�� H��H���>���L�8L�|$M���bL�`M�������M��I����H�{8L�5M!�����M9��.���L�����H���FH���9���1�H���CXH�S8@��H��H�5[T!A���{\L��E��D������������H�{8�Ӫ��Hǃ�H�{�n� ���I��H�������fo�H�@���ő��I�FH���K���H�xH�H��H�@xH)����1����H�L�sH�CHH�{@�H�CP�1�腏��H�C@H���ߪ��H�CxH��H�T$H�5!S!Hǃ�����H�|$H���YH�{H�C H���"����������H�S(H�5�R!H���Ï����H�L$HdH3%(��H��X[]A\A]A^A_�M�w�I������H�NH�L$M���iL�eM���9���M��I����L�5K!A�L��H�{8��L��I��L9��������H���JH���4���E1�H���CXH�|$A��E����H��D�[\@��D��H�5BR!A!�H�S8D����ߎ���������H�{8�����M9�t	M���bE1�H�{L���uS� �ӏ��I��H���w���fo
�H�@��誏��I��I�FH���-���� 1�L���L�sH�{@H�CHu!H�CP�1�臍��H�C@H���kH�CxH��H�T$H�5#Q!Hǃ�����H�|$H��u_H�{H�C H���(������������H�S(H�5�P!H���ō�������H�}A�H���'���H�mL�5OI!�G���L�cL�-'I!L9ou[H;_uUH�oH�EH�[ H�kM������H�/u�����뀃{XL��G!H�5��I�8������x���I�$�s���H�C H�{M���=������H�{8L�5�H!�����M��A�������ڋ��M��A�H��������H������������q����&���DAWAVAUATUSH��L�'I�\$H9���I;t$(��H9������H��I��I��H)���I�L$H�nL�|�H9���I�L$H��H�t�L���ډ�����W���H��M�&H9��I�\$1�I9�|,�8�I�T$H�4�H�>H��tH�H�/�*���H��I9�~�M�l$H��[]A\A]A^A_Ð1��H��I�|$ []A\A]A^A_��H�=�P!訆��H���@���H�5i�H�x�������ff.�AWAVAUATUSH��X�OxdH�%(H�D$H1��D$�����H�oH��H��H��H�UL�mD�uL�eI��I!�M��I��M�M�L9���M����J�DN��M��I!�I��M�M�M���}L9�txI��I��O�\I��O�<�M!�I��M�M�L9�tSM��tNH��
I��J�L?N��M!�I��M�M�L9�t,M��t'H��I��I�D8N��M!�I��M�M�M��tL9�u�M�������H�UUUUUUUUH�I�2H�uM�bH��H�uH9������H�}L�vL�<?M9���{X���k\����I����vD�{`H�kH�D$ qD�d$!L�sPE���7H�EI9��CL�[@A�D+ qL�CH�T$!C�T!A�LSH1�H�\$HdH3%(��H��X[]A\A]A^A_�H�t$H�����H��?��ff.�f�H�l$ L��1�H�}H����D$ p輄��I��A�
I����������!ȉƁ怀��t��M�jD�c`L�sP�����E�MDՉ��I��I)�H�kHE��uCM�*L��M9���L�[@I�� I����M��uvL�KH1�����ff.�A�H�{h�u�I�z	H�/L9���L�[@I�� I���������H�khL�L�}�E�H�sHH�n	H�kHI���;I��M��t�D�l$ E�,+I�������L�sH�l$!C�l3I���r���H�KH�T$"A�TI���`���H�CHD�L$#E�LI���G���H�{HD�D$$E�D;I���.���L�{H�t$%C�t;I���"L�cHD�l$&G�l#����ff.�H�{h�A���������f.�A�����M9���D�{`H�kHD�t$!�D$ rL�sPE�������H�EI9��)L�c@A�A�D, rL�KHM�\$ �|$!C�|���ff.�f�H��P��j���H��H��v`H���7H�� �8H��@�9A��H���vM�I9�r�H��������I9��\���M��I���@A����A��A�L��L�D$輇��H�EH������L�}I��H�T$1�L�}H���t���L�MM����L�UL��H�7H���L�]I��I��I��L��L!�H��H��L�H�H9���H����I�DL��L��L!�H��L�H�H���~H9�tyL��H��I�DN��L��L!�H��L�H�H9�tTH��tOI��
L��K�T8J��H!�H��L�L�L9�t-M��t(I��J�D:H��L��H!�H��L�H�H��tH9�uِH�0H�wH��H�pM������L�������#���ff.�H������H�L$ L�E��L�l$ L�uH�MN�L$I��N�L%�L)�A�*I)�Ѓ���"E1ۍx����O�D����O�9���������tu��tb��tN��t;��t(��tA��K�t=K�4>A�̃�O�L%O�&�ʃ�I�DI��σ�M�\=M�>A�ȃ�O�|O�<�΃�M�d5M�$6�ʃ�M�LM�9�sj��D�YD�yI�|D�aI�<O�D�A �y(O�K�t=D�A0K�4>K�T%�q8��@K�&M�LM�M�\=M�>O�|O�<M�d5M�$69�r�LSHM�����A����A� ��A�@���莂��1����A�A�I��������?M)�I9��۞��H�A�H�{@I��H�4@H�sP����������L�[@H�kHM��I�� E���������M��E1��A�A��M��A�I���AUI��ATI��UH��SH��H���H���H)�H��~6H9�HO�H��L��H���.���H��I)�uH��L��[]A\A]�I�H���H����H���H+��H����H�����L��L���\��I��H���"���H���1�H��1��-}��I�mH��tKH�������H������H�mtH���ڝ��I9��W�����Lc��J���H��H�D$迁��H�D$��L��谁���1�H�5�蠂��H�������H�(uH��艁��H���H����,���L������H���g���H���H���6��H��H���L���H�P����w���L;`�R���H�p L��L�����H�+�����H���������f�AVAUATI��UH��SH��H�� D�o`I�����bH�wHH�SPH��E����H�D5H9��L�S@M�Z H���vE�4$E�t2 A�t$H�{HA�t;H��tgE�t$L�SHG�tH��tRA�T$H�CHA�TH��t=A�t$H�{HA�t;H��t(E�t$L�SHG�tH��tE�d$H�SHE�d@HkHH�kHI������D�[`L�KPE���:I�4(H��L9��aL�S@I�� I���8M����A�*I��tr�iH�{HA�l:I��t_�qH�SHA�tI��tLD�aL�KHG�d
I��t8D�YL�sHG�\2I��t$�AH�kHA�D*I��t�IH�{HA�L:@LCH1�D�k`H�� []A\A]A^�f�H�{h��_���L�U	A�I�2H9��bH�C@L�X H���������H�{hL�H�7�G�L�SHI�r	H�sHH����A�$A�3�.���f.�H�{h������I�x	A�H�/L9���L�S@L�cHI�� I���������L�chM�M�$A�D$�L�[HI�k	H�kHI����I�4(M�������@H�sHM�������D�k`H�� 1�[]A\A]A^�M�4$I��I�sM�3I�T<�H��I�T;�I)�B�TM)�A��A��A������1�E�s�D��M�<A��A��L�>�D9������E����A��ttA��t`A��tMA��t9A��t&A��t��M�L�A����O�4N�6����M�L�A����O�4N�6����M�L�A����O�4N�6����M�L�9�����A���WO�4N�6M�D�wL�O�4�WN�6M�D�w L�O�4�W(N�6M�D�w0L�O�4�W8��@N�6M�L�9�r����D�s`L�KPE�������I�(I9���L�S@I�� f.�I�<*L��H��L�D$�,~��L�t$LsHD�k`1��2���E����H�sHH�SP�C`���H�{8L�L$�{���H��L�D$H�L$����������L�T$H�T$L�D$M����H�{81�L��1��)w��I��M���j���I�.uL����{��H���������\����G���L�L$L�D$H�L$���L�L$L�D$H�L$�C���I��E1�H��������?L)�H9�����H�H�L$�H�{@H��L�L$L�D$H�4@H�sP�ly�����ї��H�C@H�sHH�L$L�D$L�L$L�X H��E���[����2���L��H���z��I��H����H�{81�H��1��1v��I�,$I�������L���z����L��H��������?L�D$H)�H�L$H9��H���H��H�{@H��H�4@H�sP�x��������L�S@H�kHH�L$L�D$I�� E��I���#������L��E1�����ff.��ATI��UI��SH��H��0dH�%(H�D$(1�H�GH�H�xI��M!�M��I��I�M�L9���M����K�TI��J�,�I!�I��I�M�M����L9���M��I��N�\I��M�$�M!�I��I�M�L9�t^M��tYI��
I��K�D N��M!�I��I�M�L9�t7M��t2I��I��K�TN��M!�I��I�M�M��tL9�u�ff.�M���E����s\A�zI�J����H����ѕ��H�sH�k`�$h�L$L�cPI���uMH�FL9���H�C@�D0 hL�[H�|$B�|!A�LSH1�H�|$(dH3<%(�DH��0[]A\�A�H�{h���M�2L��M9���L�C@I�� I����M����L�[H1��ff.��I��H�)�1��$gI�|$��!t��M��A�2I����������!�A��A����t�D��M�JH�sH�k`�����AE�MD�I����I��M)�L�cP���J����:���I�z	H�7L9��cL�C@M��I�� H�shL�M��I���������L��F�H�kHL�M	L�KHI����M��M������ff.�D�$G�I�������L�cH�L$C�L I���|���H�kH�t$A�t(I���j���H�{H�D$A�D8I���R���H�SHD�L$E�LI���9���L�[HD�d$G�dI���sH�KH�l$A�l�
���H�$M�I��D��M�`I�I�t;�I��I�t8�M)�M)�E�D������1�D�@����M�A��A��M�9���E����A��tqA��t^A��tKA��t8A��t%A��t��I�<+I�<,���M�M����M�M�����I�<+I�<,���M�M����M�M�����I�<+I�<,9�s^��V�nM�M�M��FM�I�<+�V I�<,M��n(M�M��F0M�I�<+�V8��@I�<,M�M�M�M�9�r�LSHM������fDA������t��M�ԽI��H��������?L)�H9��t���H�A�H�{@I��H�4@H�sP�cs�����H���L�C@H�sHM��I�� I����p����D���A�A��M��1���AVHc�AUATI��USH��H�� H���dH�%(H�D$1�H���H)�H9���H���H�H���H�H�t$�.A��to�V�~H��H��H	�H	��nH��H	�A��tHD�FI�� L	�A��t6D�ND�VI��(I��0L	�L	�A��uD�^I��8L	������fDH��1���s��I��H���5H���L���L�p I)�M��~pI9�L��LO�H��L���u��L��L)�uHH�[L�KH�s0H�CI9��,M�QL�SN�,�1�H�|$dH3<%(�H�� []A\A]A^�M�H���H���eH���H+��H����H����ML���H���p��I��H��tOH���1�H��1��pn��I�.I����M��t*L���Fq��I�,$teH���ِ��H9���H������I�muL���s�����)���ff.�f�H�t$�F��H��x�H�t$�.A�������z���L��H�D$�r��H�D$�H��������H��H��H)�H��H9��q���I��������H�L9��[���H�4�H����m��H���B���H�CL�KH�k0�s���L���Mr������胡Hc������v�Hc�����H����r��H���	���H���H�����I��H�����H�P����t���H;h�O���H�p H��L���xs��I�,$�����L����q�������p��1�H�5��r��H�������H�(uH���q��H���H������AWAVAUATUSH��8dH�%(H�D$(1�H���k���H��I��I��H��H�����L�_HD�w`�D$C�L$ L�WPM��E���oI�CI9��nL�W@A�I�� D�D$G�L�[H�T$ C�TI��tfL�KH�D$!C�D
I��tRH�sH�|$"A�|2I��t>L�CH�L$#C�LI��t*L�[H�T$$C�TI���
L�KH�D$%C�D
@LcHL�cHH�������s`L�SP���<N�\%L��M9��0L�C@I�� H����H���E�]G� H���}E�ML�cHG�L H��tiE�UH�SHE�TH��tUA�uH�{HA�t8H��tAA�EH�KHA�DH��t-E�]L�KHG�\H��tE�mL�cHG�l ff.�HkHD�s`L��H���M���H�|$(dH3<%(��H��8[]A\A]A^A_Ë{`L�SP��u<J�D%I9��L�C@I�� K�< H��L����p��L�[HI�L�[H�f.�H�{h������H�M	�J�!L9���L�C@H�sHI�� H�sh1�I�0�8�H��H��	u�H�KHL�a	L�cHH������M��H���������A�H�{h���K�!I9��cL�S@I�� ���A���������H9��b����D$BD�w`�L$ H������L�_HL�WPA�M��E��u�I�CI9��WL�W@A�I�� ����M�D$	K�L9��$L�S@I�� L�Kh1�O�
A�9�H��H��	u�H�CHL�X	L�[HI������M�H�t$L��L����>���H�{8�L���H������������M���vH�{81�L��1��h��H��H�������H�muH���om��H��藯���������l���A�E����L�[H�C`K�#H9CP�L�S@I�� I���M�������H��1�H��������?�|$H)�L9����H�A�H�{@I��H�4@H�sP��j�������L�C@L�cHD�T$I�� L��E�����������k��H��虽���Y���1�A�A�H��������?L)�L9��i���H���t$H�{@H��H�4@H�sP�aj�����k���L�S@L�[HI�� E��M��D�t$�_����5���H������D��M��E1��L��H���k��I��H��tLH�{81�H��1��!g��I�mH���l���L����k���_���D��A��B���1�A�A��/����҉��ATLc�UL��SH��H�� H���dH�%(H�D$1�H���H)�I9���H���H�L�H�t$H���D�I�������JMc�E�������E�������L���H���L)�I9���H���L�M�H�|$L�����L���g��H��H����H�[H�{H�s0H�CH9���L�GL�CH�,�1�H�t$dH34%(�H�� []A\�H�t$L�����H��xUH�t$D�I���(����N�~H��H��I	�I	�I��t.��t>Mc�����H�t$L��H��譼��H�������t���D�NI��M	ȃ�����M��A���I��M	�E��E���w���E���_���Mc����H��������I��I��H)�I��I9��)���H��������I�I9�����J�4�H���e��H�������H�CH�{L�c0������h��H�|$�}���f.�AWAVAUATI��USH��XdH�%(H�D$H1�HLJ�H�H�D$ H��G H�G(ADŽ$�����M��$�M��$�H���������L��L)�H����I��$�L�I��H�t$ M��$����F�b�
��a���D��P�a,�U��K���&��M��I��$�I)�I����M��$�I�H��I��$�L�T$@A�:�h��H����I�|$H���������M��$�M��$�L��L)�H���%���fDH�t$ �L���^���H����H�D$ ���F�}����a�����P�|+t��K���E��MuM��$������-��N��,H�5z#!I�|$H��<������M��$�M��$��_���ff.�@��T��$~E��V���&��X���L����������M��$�M��$�������R��I�D$H�PL�H(L9��`&H�pH�J�H�HL��L�4�M���`I9��0$N�l�H��H�PM���#$L��L���Fe��I�m����I�.�OH���I�|$H���+������M��$�M��$��N���ff.���]�n+1��g��H����I�|$H���ڰ������M��$�M��$�����_(I�|$0H���!���I�D$H�PH;P(�s���L�HH��H�PI��H���]I�t$8H���ВH�+I���3���M���:I�|$L���M������%M��$�M��$��p�����l������r������p�)��I��$�I)�M���(ff.�@I��$�H�H��H�|$@I��$�I�t$H�VH;V(�"L�FH�D$@M�|$I�\�D�(M;l$ �� O��H�I�:I�H����I�D$(M��$�M��$����ff.�f���t��I��$�H���* H��M��$�I�L$@��I��$�H��@��I�D��q tI�T�H�Q(H����M�D$I�|$I�pH)��k������M��$�M��$����ff.��
I�D$I�|$H�pH���c�����kM��$�M��$����fD��o��(L��菰��H���6I�|$L�_I)�M����"H�p�Ȱ��H��H���I�|$H�wH;w(����H�OH��H�wL�,�M������H��L��蕑I�mI�����H�+��M����I�|$L���ǭ������M��$�M��$����f.���u���}�(�d��H���`I�|$H���s������KM��$�M��$����fD��e�7����c��L�t$@L��L���غ��H����H������H�|$@H�p�H�q��c��I��H����L��L��虺��H���t H���Є��H�|$@H�p�H�2��Qc��H��H���I E1�H��L��1�H�5�&!L���{b��H�+I���I�/uL���a��M���WI�|$L���j������BM��$�M��$����ff.�f���M�D$I�PI�H(H�r�H9��%H9������M�HH��I�PL��I��H����K�|�H�T$(H�5�%!H�|$�[a��������L�l$(M����1�L��1�H���\��H�+I���H�|$(H�/u��`��M���pI�m�b���M��$�M��$������hu{M��$�M)�M���I��$�L�I��H�T$@M��$��:I�D$I;|$ ����H�4�H������H�I�|$�
�������M��$�M��$��0�������g�X%H�t$@L��脸��H����H������H�|$@�
1��]��H��H����H����]��H�������M�L$I;D$ �$M�,�M���$H�+��I�EI�|$L���Y�����x5M��$�M��$������i��L��还���s���[��H��H����I��$�I+�$�H���HM�d$I�t$I;t$(��H��I�L$I�t$H��H��H�\$HdH3%(�LH��X[]A\A]A^A_�f���j�$L�������g���M��$�M��$����f�������A����%v����=I�\$H�SH;S(�<H�CM�l$(M�t$H�\�M;l$ ��K�4�H�H�>H�H����
I�D$(M��$�M��$��*���f.���0�Ru��)�|��.�������(�1#M��$�I��$�M;�$�I�|$M�JL�_�G L�_(M��$�N��M��$�M��$�����2���v��B����C��"�L���R����
���M��$�M��$��U�D�
������\M�D$M�PI�H(I9��0I��M�hM�PO�|�I9���I�pI��M�PJ��H����H�={!H9{�0��M���ŀ��I9�A"E1�1�L��H��H�5�!!L���T]��I�/�����H�+�_���H���7���I�|$H���J������"���M��$�M��$��m�ff.�f�����h��������������
��M�l$I�]H����L�s�M;u(����\��I��H�������I�EH��M�WL�H�T�M9�s
I�O(H9���	�o
AOI�\$M�uH�CL�KL;K0�}
M�qM��$�M��$�L�sN�<�������~5�����}j�L���-��������M��$�M��$��P����K���L���t�������M��$�M��$�������������5 1���Z��H�������I�|$H��补�����y���M��$�M��$����@����W�I��$�I)�M���Vff.�f�M��$�I�H��L�|$@I��$�A�����A��$M��$�M��$��J�f.�����~	��I��$�I)�I���\
I��$�H�H��H�t$@I��$�D�FD�V�~�^I��I���VD�>H��M	�D�^H�� I	�D�NH��8I	�I��(M	�I��0M	�I	�M	���~��M��$�M��$�L��L)�I9���
M��$��y�f���I��H�t$@L���ʱ��I��H�����H����|���OX��H�|$@H�t$81��I���W��H��A�E����H�T$8D�
A��
t	E����I��u
H�����X��H�������I�|$H��蓣�����k���M��$�M��$���fD��I��$�I)�I����
M��$�I�H��L�|$@I��$�A�A�wA�OE�H��H��H	�H��H	�L	�I��A���I��L	���W��H������I�|$H������������M��$�M��$��	�f���G�.I��$�I)�I���*
M��$�I�H��L�\$@I��$�H�|$@1��JT��f.B����S��H���>���I�|$H���Q������)���M��$�M��$��t�@��I�����AM��$����@��l���A��r�h����p�	�s�M��$�I��$�I)�M�����H�t$@�L���U���H��������������~E����Y���������0����m���������>M��$��j���ff.�������������0�������	
��M��$�I��$�I)�M�������H�t$@�L��蕨��H������L�|$@���f���G�NM��$�����f.���e���p��h�����M��$��0���ff.�M��$�I��$�I)�I����H�t$@�L������H���8���M�t$M�~M;~(��H�|$@I�V�_�wD�GD�H��H��N�l��M�|$H	�I��L	�L	�I;\$ �M��I�EI�;M�+H���9I�D$(M��$�M��$���ff.�M��$�I��$�I)�M����I��$�H�H��H�t$@I��$��>�pT��H���W���I�|$H���j������B���M��$�M��$���ff.�f�H�t$@�L���Φ��H������L�D$@A�8�T��H�����I�|$H�����������M��$�M��$��$�@H�t$@L��H�D$@�z���H�����H���/x��M�L$M�qM;q(�M�yH�|$@�
1�O�l���zQ��H��H���^�H����Q��H�+I��uH���S��M����I�\$M;t$ �:N��I�EI�;M�+H���tI�D$(M��$�M��$��Y�f�H�/�&M��$�M��$��1��M�T$M�ZI�s�I;r(��I�|$���������M��$�M��$����f�H�/�v��R��M��$�M��$����ff.��H�/���R��M��$�M��$���ff.��H�t$@L��H�D$@���H������u��H�|$@1�H�p��KS��H�����I�|$H�����������M��$�M��$��(���R��M��$�M��$���fDH�/�M��$�M��$�����H�2I�wH�|�I� ���ff.�O�|I9���t��J�4�H���M��H����t��I��$�M��$�M��$��ff.��M��$�M��$��[�ff.�L���8���H�����I�|$H���B��������M��$�M��$���M��$�M��$���H�t$@�L���N���H�����H�t$@������P��M��$�M��$���M��$�M��$�M)�I���	M��$�M�I��L�T$@M��$�H�|$@�_D�_D�O�WH��I���GD�7I��L	�H�� D�oL	�H��(D�H	�I��0H	�I��8L	�L	�L	��Ar��H��1��.K��I��H�����H�x��H�p(H��L���(��H���sI�|$L��袚�����z�M��$�M��$����DH�t$@�L������H���E�H�t$@���L��胜��I��H���'�M�t$M�~I)�L����P��H���
�M��~rI�^J��H�PH�<H�7H�2I��tRL�DL�BI��tCL�LL�JI��t4L�TL�RI��t%L�\ L�Z I��t�H��H��H��I9�u�M�nI�|$H��袙�����z�M��$�M��$����H�t$@L��L������H���L�M��$�M��$�M)�����H�t$@�L�����H����H�T$@���ff.�@I�|$�衸�������M��$�M��$��4�I��������M��I��M)�I��M9��
o��M�I9���n��J�4�H���WI��H����n��H�CL�KL�k0�,�H�t$@�L���+���H���b�L�|$@�?���H�t$@�L������H�������8��1�I�|$�Է������M��$�M��$��g�L�[I�����vH;:	!��� �im��H�|$H�5�!��I��I��H���m��H�L$8L�|$@H�D$@H�L$L�|$L�|$0H�t$L��H����H����tTH�t$0L�j!H�L9Vu
L���xN��H�t$0H�T$8L���J��H�|$0��L���l��I��L��ul��H�L$�I�.��m��M����H�+�M��$�M��$��`�H�=�!�G��H���,I��M�|$I�WM�G(L9��>I�OH�r�I�wL��H��H�����H�{�����I9���N�l�H��I�WM����M�]A������M��8M���hj��1�H��L��A��I��H���tH�+�:j��I�m�+l��I�|$L���J������"�M��$�M��$��m�H�t$@L��H�D$@�ǣ��H�����H���m��H�|$@L�\�A�;Lu	A�H�|$@1�1���H��H�����I�|$H���̕�������M��$�M��$����I�|$��0������x�M��$�M��$����L��諗��H���R�I�|$H���5������=�M��$�M��$���L���p���I��H����M�\$M�s�L��H��H�����L��L)���uM�oI�|$M9�� o��L������I�|$H����������M��$�M��$���H�=Q!�<E��H����F��H�x�KF����tH��!H�5��1�H�:��E��1���H���I������L��������F�M��$�M��$����L����������M��$�M��$��g�H�t$@L���ʡ��H�����H���>k���RH��H�=3!H�t$8�H�H�|$@�#C��f.���L�D$8E�A��
t	E����(E��H�����I�|$H��袓�����z�M��$�M��$�����I�D$I��$�L�XH��aL;X(~5H�PI�[�H�<�H�/u
�H��I�D$H�XM��$�M��$��t��H�x ��w����M��$�M��$��N��M��$�M;\�u�H����I��$�D��D�h �j��H�p(M��$�M��$��	��H���H���Q�����D$�[D���D$H�������w�H�= 
!�C��H���D��H�5u�H�x�sH��H�+�I�H���G���<�H�t$@�L�����H���������I�m��L���iG����H�5e!�U���I�} �v�����M��$�M��$��2��L��H�D$�%G��H�D$��L������H�����I�|$H���݆��M��$�M��$�����H����F�����H�{�qg��L�sL�k I�I�EH�+��f��L;5�!tI�FL��H����U���L��I�U��� ��g��H�t$@L�L$0H�D$@H�t$L�|$8L�L$H�T$H�t$L��L���.B��A�ƅ�tH�T$8H�t$0H�|$�E����y��fg��H�+��I�m�+f��E�����M��$�M��$����I�|$L�wL;w(&H�� �Ou���w�M��$�M��$�����L�GK�t�H��p������H�M��$�M��$��������D$��A���D$H�������H���fE���U����L���4�������M��$�M��$��7��A�EH�|$@1�1���B��H���8�H�-!H�5��H�}�E����H�5}!I�|$H�觏������M��$�M��$������L���}������U�M��$�M��$�����L���y���+�M��$�M��$��v���L���y����M��$�M��$��L���u��L��L��O�t-H���?��I��H���e��M�L$ I�D$M9�vL��J�<�1�L)�H���N>��M�t$ �%��M��$�M��$�����L���ǐ��H���n�I�|$H������I��H���U�H���A��I�.I��uL���C��M���3�I�|$L���F�������M��$�M��$��i��I�|$�s�����M��$�M��$��B��I�x �rH�=�!�m>��H���@��H�5v�H�x��C��M�����I�/���L���B����I�x E1��YrM�D$M�PI�H(���H�~ �>r���f�M��$�M��$�����L���z���<�M��$�M��$����H�x ��qI�.���Oc��I�|$ ��q�Q�I�z ��q�C�O�<6I9���c��L��H��H���=��H��H����c��M�T$ I�D$M9�vL��J�<�1�L)�H���V<��M�|$ �p��g>��H�����H�-� H�5�H�}�B���r�I�y �9q���a�M��$�M��$����I�/�B�L���A���5�O�|-I9��qd��L��L��H����<��I��H���Vd��I�L$ I�D$I9�vL��H�<�1�H)�H���;��M�|$ ���H�{ �p�����M��$�M��$�����L���y�����M��$�M��$�����I��$�1�H�5C���A��H������H�(uH���@��I��$�I��$��v���?��H�� �p���6�M��$�M��$����H�x ��o��I�t$L�vL;v(��a��L�FI��O�|0�L���>��H������xX��H�(��a��H���&@��M��$�M��$����L�����H��H�����I�L$L�iL9�}H;A(~wL9��_��L�qH�5U� M�|�I�H9���^��H��H������H��H���L�H��L���<��H�+A��uH���?��E���'�M��$�M��$��r��H�y ��nA����M�T$�@XI�zJ�D7�I�/��`��M��$�M��$��0��H��L��L�4H���}:��I��H���c`��M�T$ I�D$M9�vL��J�<�1�L)�H���=9��M�t$ ��I�~ �Jn���r��M��$�M��$����M��$�I�H��L�l$@I��$���H�5-� I�|$H��G��������M��$�M��$��j��I��$�H��t~��8��H��t=I�|$H������������M��$�M��$��)����8��H���;�����:��H������H�=Q!�<9��H����:��H�5M�H�x�>�����H�=(!�9��H���:��H�5ԎH�x�{>���V��H�-�� H�5p�1�H�}�9���8��H�t$@L�����H���"��L�P�I����L�\$@A�A:\�����'t	��"��H�p�I�{E1�1�1��<��I��H������M��$�H�5I�L���{<����t1I��$�L��L���:��I�mI��uL����<��M������M��I�|$L��虇�����q��M��$�M��$����H�=!��7��H���9��H�5!�H�x�X=���3���L���q�����M��$�M��$��i��I�} ��k���I�x ��kA���5���I�|$0�'[��H�t$@L��衔��H��������Z��H�|$@H�p�H�>��6��H��H��t}I�t$8I�|$0H���iH�+I���u[��M���}��I�|$L��萆�����h��M��$�M��$�����8��H��uL�� H��I�:�8��H�+�-���1[��H�=�� H�?��7�������H�=�!�6��H���=8��H�5~�H�x�
<������H�xH�5��;��H�+tHI�m�����Z��H�xH�5���;��H�+�����Y��I� �jj��I� �_j����Z��H�-� H�5��H�}�;���i��H�=!�5��H���7��L�d$ A�$��'��A�À�\A��E����]���]����^���_����AWAVAUATUSH��H��H��XdH�%(H�D$H1�H���H�j�H����b��H����b��H����b��L�#H���H�=l!�7��I��H���b��H�@0f�f��foc�H�X@���Hǀ�Hǀ������������H@KK K0K@P �:��I��H����`��H�xH��H�Hǀ�H��H��H)������H�M�oH�=P� ��4��H��H����a��fo��H�@�@�@ X(�z:��I��H�EH���\`��I�I�o��`��L���:��M�o@M����H����9���H��L���5�����'M�_PM�W@ILJ�M���M���M���M����H�=����4��H�=��I����4��I���I�����`��H����`��ILJ�L��ALJ���I�/H��uL���8��H�t$HdH34%(H����H��X[]A\A]A^A_�L��L�
�A�L�$L�L$�H��L���4�����/I�WPM�g@ILJ�M���I���I���H����H�|$��3��H�<$I�����3��I���I�����_��H����_��M��t
L;-9� ��ILJ�E��L�����I�/H����������A�H�{A�H���_��H�KH���H�A����[_��H��H�t$�2��H��H�D$H����^��H��1��H��H��H;L$��^��H����H�ÔE1�H�$H�=� �4��I��H����^��f��H�X@H�@0���H��fo-����Hǀ�����������Hǀ1��Ao �H���k7��I��H����H�xH��H�Hǀ�H��H��H)������H�M�_H�=� �@1��H��H���X^��fo5��H�@�@�@ p(��6��H�EH���I�I�o��L���7��I�@�z���H���h6���m���L�iI�I�m�PH��A�1�L��� L�d$(ATjj�5��H�� H��H���]��L� H�����L�5�L��E1�L�4$A�L�T$�D���L�=�L�|$H�KH��H�$H���g\��L�k ����L���2��I���H���W���I�/��\����L��1��w4���Y����3���[���
\����[��ff.���H���t���SH��H�=�� �m/��H���1��H�SH�5:�H�x1�H�R�+0��1�[��AWAVAUI��ATUH��SH���w`dH�%(H��$�1�H�D$8�������MH�}H����L�5�� M�eM9��IL;-� H�#� �sI9��jL;%U� �oL;%�� ��H�}M��I��H�M��H�OL�T$I!�M��I��J�	I9���H����O�\H��L��O�<�L!�H��H�1H��tiI9�tdI��H��K�DN��L!�H��H�H��tDI9�t?H��
M�L8K�4�I��I!�I��J�I9�tH��tH��L�|7I�4���ff.�H����L;%`� ��L;%� ���80��D�P E�BD�@ H�
� D;�U`��L�=�� M9��L�=�� M9���L�=� M9��TL�=-� M9���L;%�� ��L;%P� ��L;%#� �H�}0H����L�=�� M9���L;-�� �4L;-�� ��L;-� �j1�L��H���T0A���\/��H�-=� D�h E�m�D�h �E=��0\����2A9�}	�./���@$H�|$8H����
H��$�dH3%(D����H�Ę[]A\A]A^A_�H�OhH����`���H�GHH��	H)�H=���I����e_��fDH�t$HL����-���t$H����A��A�����I�M9����]\����H��I�‰D$aH��H��I������T
E��t/H�t$`�H���D$`M�Xy��H��?I��� ���ff.��H�t$`�H���D$`K�)y��H��?I����ff.�f�L���D$7(�D$@t�D$H0�D$P1�D$`)����<0��I��H��xT�>H���D�}X�:I�uH��t1E1�1�H�������x I��M9��SK�t�H��u�f�A�������DD�e\E����	A�} �V\��H�t$PL���K+��H���uL�D$P�t$PI����x�}X��H�t$`I��H���H���D$`�D�D$a�@������\��H���[L��H�������A�����f�L��H��蕴��A�����ff.�f�L�d$`I��1�A�IL�� �H�
N��/��L��D�/H��A������A��D!��က��t�Ή�H�W�����D�HE�L��H����H��L)��Iw��H��?I������L�5V� M�eM9������f��D$PNH�t$PH�����H��?I������f�L;%Y� �-
H�}(H���_H�=_� �J)��H����*��L��H�x�v)��H�D$8H�����S*��H���vH�|$8H����L��L���!,������L�|$8H�5}� L��L����-�����6H�|$8��Z��Hc}X�5-��I��H���H�|$81�H��1��(��I�,$I���QH����H�XH�����,��PL��H��L���"A����*��H��� �h D�m�D�h �=���W����2A9��k�*��H�|$8�@$H���bI�/�r���L����,���e����H�t$7H���~��H�����I�uH������1�H�����������I���1I�u H�������1�H���j����������I���I�u(H�������1�H���A������y���I����I�u0H���b���1�H���������P���I����I�u8H���9���A�1�H��������!���I��M9���K�t�H��u�����D�}XI�M�PH����H�=�� ��&��H���u(��I�uI�} H���I���^-��I��H���W��H�={� �v'��I�wXL��H�=��H��1��>*��I�,$H����V��H����V��L��H��H��� A��H�+�����H���+�����L��L��H��L���)A��ff.��(��H�=�� D�h E�m�D�h �=���U����2D9�~	�~(���@$H�|$8H���H���G���I������ff.�A�����M9��G�D$`X��t$aH�t$`I��H��H���`������ ����&W��H�uL�L$L�L�FM!�M��I��K�H����I9���H�|$J�TN�4�L��L!�H��I�H��t_I9�tZI��M��I��K�t>J��I!�I��K�H��t7H��
I9�t.L�\L��I��H!�H��I�H��tI9�t
H�����H���<H�t$@H����z��H�������L��H���6�����A���+'��H�� �h D�m�D�h �=��aU����2D9���������ff.�D�ExE�����u\�����D$`]�H�t$`H����q��H����Q��L��� '��I��H����Q��L��H��虝������Q��M���M9}�sD�MXE���f�l&��L�5M� D�` E�T$D�P E;�R��I�}�D$@a�D$He�D$P(��L�L$HE1�L�t$PL�L$L��H���y��H���kM����)fDI�UH��J�4�1��.����I��M9�tM;}|�H�t$H���jy��H���,M9}��%��D�X A�{��x H��� D�A����mR��A��2D9���R���%���@$D�exE������E1�D�u|H���E�~�D�}|A��1������YR��ff.��L�UL�L$M�I�rM!�L��H��L�M9���M����H�|$M��J�TJ��I!�I��N�>M��t_M9�tZI��M��I��N�T1I��I!�I��N�M��t7H��
M9�t.H�D:M��H��I!�I��N�M��tM9�t
H�����M���zJ�t$`H���x��H����L��H���f�����A���[$��H�<� �h D�m�D�h �=������dQ���H�/�
����a&������ff.��H�t$`�H���D$`J�	o��H��?I�����ff.�f�L���D$PV�3i��H��H����Q��H�t$PH���Zw��H����Q��H�SH�s H���n��H���`Q��H�+uH����%��H�5C�H���w��H��������CQ��ff.�f�H�/����%�����A�(l�fD�T$`�h���H�/������g%�����I�U L��H���ӳ��A�����L���c#��I��H���)N����"���P D�ZD�X H��� D;��M��L��H���A����"��H�
�� �x �1D�G�D�@ �����R����2A9�}	�"���@$I�/uL����$��D�MxE����������E1���M�E1�H��I�0����;O��H�t$@H����u��H��?I���9"��H�5� �H D��y��x A�����N��A��2A9�~��"���@$뀃}X��L���#��A�ą���O��L���p$��H����;N��H��L�pH�D$I������/N��L��1��#��H��H���|O��L�x A�L��L��L���9������M��E��yI��vL�\$C�<�u
C�|�MH�I������D$`��D�t$aH�D$PH�t$`H���>l��H���EM��L��L��H���'l��H���.M��E1�� ���D�UxE���P���U\���f�D$`}�H�t$`H����k��H���JN��L��H��������7N��I�}�>M9}�wD�]XE���j� ��L�u� D�` A�T$�P A;��M��M�}�D$5(H�D$@H�D$HH�D$P�D$6s�D$7uL�|$I����H�T$@H�t$PL��H�L$H�D��H�t$@1�H���U����UM��H�t$H1�H���>����>M��H�t$6H���s��H��?I������L�
�� �p A�D�V�D�P �����L����2A9�}	����@$D�]xE������M��f�D�eXE���e�D$^)�H�t$^H���|j��H��?I�����L���D$@L�#��H��H���M��H�t$PH���:��I��H���NK��H�t$@H���r��H���8K��H�T$PL��H���j��H���K��H�UHD�}`L�EPI��E���iH�BI9���H�}@H�� B�LL�MHE1�B�D
H�EH����1�L��H���A�����}\�AE�'1�H�|$a�D$`GH�\$`�[�����IL���	H��H���si��H���0L��E1��6�H�|$HL�D$7H�\$H�|$L�t$5L�d$@L�D$(L�t$ L�t$PH�t$ H���q��H����1��'�H�t$@1�H���1�����H�t$H1�H��������H�L$D�{L��L��L��D����������H�t$@1�H��������rH�t$H1�H��������QH�L$L��L��L����������H�t$@1�H�������H�t$H1�H���~�����
H�L$L��L��L��A�_�?����tUH�t$@1�H���L�����
H�t$H1�H���5�����
A�_���tH�L$L��L��L������������H�t$(H���Yp��H���
H�D$I;E��H������p���H�\$E1����f�D$`(d����L�����H�D$8H����L�5�� I�>�������&����H�|$8H����L��L���������wL�|$8H�5(� L��L���������H�|$8�PK��Hc}X����I��H����H�|$81�H��1��3��I�,$I��uL�����M����I�H���������L��L��H��L���FA�����H�}h������H�BI9���
H�}@H�� H�UhE1�H�B��I��I��	u�L�]HI��	L�]H�b������1�H�5V� L��1����I��H����H��H���h��I�/I��uL���7��M���jH�������x D�GD�@ H��� D;�,H��L��H����A�����L��� �H E�
�q��p A�����G��A��2D9�}	����@$I�.����L���������E1����H�t$PH���D$�D$PF��m��H����G���D$1ɺ1��r���I��H����I��I��1�L��L��L���H��H��J�!�e��H��xH�5�{H���m��H��?I��L���������}XI�M��H���UL���]��I��H����H��L��H�=�{1�����I�.I����F��M���cL��L��H���9I�/A�����L��������D$`��D�t$aH�D$P�����}X�D$5�H�D$H�D$6(�D$7��-L���x��I��H���&I��H��L��H�={1��(��I�,$I����G��M����H��L��L��H���I�.A����L������	�H�u L���D$HP�D$PQ�HI��H���mF��L�5�� L9��0�}\���H��H�������H�t$PH���k��H���A���H�|$8H�����H�L��H��H������f�D$^(t����E1�L�|$HL��H���k��H���q�I��M9��L��H��譟����A���"��}X��I9�A��A��xD�t$P���}X��L������I��H���qH�x@�%E���AH��������E��H���H����1�L��1����I��H���)H�����I�.A����E��A����
E���@H�t$HH���D$H��j��H���-G��A� tH�t$PH���D$P��j��H���G��1��1�1�L��1��5��I��H����H;� ����H�(�
��NE��1�L��H���A������}x�D$@(�D$H��C���}X�6L������I��H���qA��H��L��H�=hx1����I�,$I���vB��M���FA��L��L��H����
I�/A���p�L���X���c�H����I�U(L��H���SA���C�H�t$5H���i��H����E��L��H���Ҍ������E��I�}H�D$6H�D$ H�|$H���`L�D$HH�L$7H�\$L�D$L�t$PL�|$@H�L$(H�t$ H���i��H���l1���ff.�H�t$@1�H��������H�t$D�cL��L��L��D���_������H�t$@1�H���X�����H�t$L��L��L����*����trH�t$@1�H���'����OH�t$L��L��L��A�\$�����t?H�t$@1�H���������A�\$���tH�t$L��L��L��������$���H�t$(H���h��H����H�t$I;u��B���������H�\$E1����M|H�}|H������M|��1�F���C��A���k��}\�kH�t$PH���g��H���{�L��H�������A���5�A� I�OI��gL��H��1�膤��A����H�H�|$8I�EL����X��I������H�=)� L��A���
��H�����H�5njH�x�u����L��H�=Gu1����I������L��L��H����ZA����I9�L�
�t�H��H�5�tIE��/^��H��?I����E1�A�H��������?L)�H9��?���H�H�}@H��H�4@H�uP�������>��H�}@H�UHH�� I��E������V���A�����M9��d���=��H���x��I��H���?�@ @�H�t$HH���f��H���A��A�D$ I�T$� �-A���@�A��I�t$0H���T]��H����@��H�5�sH����e��H����I�,$�����@��H�T� ����H�P� L��H���YA���=�H�� L��H���{YA���#�H�=\� A���C��H������H�5�gH�x�����E1�L�|$HL��H���3e��H���
�I��M9�}����H�=� ����H�����H�5�eH�x�X��I�,$��<��A����H�t$@H����d��H���9<��L�����I��H���%<��L����
��I��H����1�H��H���9������<��I�.u���<��L��H�=�r1����H������h��H�xqH�5�rL���2
��H��H���|>��H�KH�@ H�L$P�R�H�+���H��������A�A��b���L��H��1��oMA����I�.�'�L�����������H���3;��I�/uL���d��L�]L��I�sI�;�;H�8u,H�t$HH���c��H���;��L��H�������A���/�H�t$PH���D$P1�mc��H����;��L��H��艗����A����H�\$�?���<��H�\$��<���y<��H�\$�?��H�\$�?��H�\$�?��H�\$�?��H�\$�<���>��H�\$�<��H�\$�<��H�\$�<��H�\$�y<��H�\$�o<��H�\$�e<��H�\$�[<��H�\$�Q<��H�\$�?����;���~:��DAWI��������?AVAUATI��USH��H��(dH�%(H�D$1��X�D$(�D$s�D$ut-�8�I�AI9��tL�[@�l$C�l H�CHL���8��I��H����H�x�����@��H�����H����@��I�v1�H���{������@��I�v 1�H���e��I�.�c����@��D�S`L�CPL�KHE���^���H�{h��S���I�A
I9��gH�K@H�q L�KhE1�J�B��I��I��	u�L�[HI��	L�[H�l$B�,H�CH�%����P��H��A��A���H�|$dH3<%(�[H��([]A\A]A^A_�L�t$L�|$L���
��H��H����H�@�����?��H�����H���}?��L����	��I��H��ub����H���u?��H�u1�H���C�����_?��H�u 1�H���-�����I?��H�t$H���x`��H���3?��H�m��1��*���L��H���R`��H���R?��H�u1�H���������<?��H�u 1�H���������&?��H�m���I�U����g>��L�����H���U>��I�u1�H���|�����U>��I�u 1�H���f�����?>��I�muL���O��������8>��L�����I��H��u��
��H����H�t$H���u_��H�������:>��H���
��1��%���L���D$��
���D$���H����
���$����A
��H��@��@������A��
M��I)�M9��&>��H�A�H�{@I��H�4@H�sP�������=��L�K@I�q L�KHM��E���q����F������E1���=��AWAVAUATI��USH��H��(�WXdH�%(H�D$1�L�|$�D$(L�t$�D$a�D$e���I���������A�I��������?�-ff.��H�AH9��;L�C@D�L$E�L H�CHL���7��H��H��t1�H��H�����H�m��=�����1=���{`H�sPH�KH��t�H�{h�u�H�A
H9��{L�[@I�� H�KhL�L�1�A�H�KHH�y	H�{H�D$A�;H�CH�x�������H�������H�|$dH3<%(�oH��([]A\A]A^A_�L���u��H��H����<��L���a��I��H��uK�D��H���f<��1�H��H��������Q<��H�t$H���	]��H���;<��H�m��<��1��n���L��H����\��H���;<��1�H��H���m�����&<��H�m��<���1�L��H���H�����<��I�m�[<��������f<��L�����I��H��u����H��u~H�t$H���_\��H���a����;���A�
L��L)�H9��e;��H�H�{@I��H�4@H�sP������[;��L�[@H�KHI�� H�υ��X����9�����	��1�A���+;��f�AWAVAUI��ATI��USH��H�=�� H��hH�-K� dH�%(H�D$X1�H�D$8H�l$0H�l$(H�l$ �n��H�����L���D$RI���D$b�D$��D$��'
��H��H���
=��H�D$ L��P1�H�T$0R�H�L$@Q�H�t$PVH�5�iL�L$`L�D$h����H�� ��� H�|$H�&�����<��H�|$@L�GA�����<��H9l$8�,L�L$0I9���H�D$0L�|$(M9��>H�D$(H�|$ L9��,�{XH�|$HH�D$ ��H�l$PH�5�� H���T	������;��H�|$PH����H�W����<��H�5�� �!������H�|$PH�5]� ���H�|$PA��H��t@H�/t5E����H�t$H1�H�������y=f�������nfD�{��E����H�|$H1�H��H���`����x�H�t$@1�H���M����x��C`H�KHH�SP���FH�AH9���H�s@�|$@�| H�CHM����H�CM��I��L�L�HM��M!�L��H��M�4M9���M��t|K�LJ�4�I��M!�I��O�49M��t`M9�t[L��H��L�l>M�\�L��L!�H��M�4)M��t7I��
M9�t.K�DN��L��L!�H��M�4M��tM9�t
I�����M����L��H���|���������H�t$0H����H�t$(H���JH�t$8H����1�H�L$XdH3%(��H��h[]A\A]A^A_�DH�{h������H�A
H9��hL�C@I�� I���������H�KhL�L�)�A�H�kHL�u	L�sH�L$C�0H�CH���f�L�D$ M����1�H���x�������H�t$H����W��H��?�B���f.�H�D$8L�L$0I9��pH�D$0L�|$(I9��	H�D$(H�|$ H9���H�D$ �{XH�|$H�������H�t$@H�~��7��L�~I������J7��M��t<H��H�5�� L����������7��L�l$PM������I�m�o7��M9��N7��1�L��H���{�������H�|$@�H�W����H��H������1�H��H���G��H�m��6���������H�t$H���V��H���������M�oI���H;W� t	H�����I�UI�~H�5
[1����������H�����������9���M�QM���L;� t	M���|���I�RI�~H�5mZ1��������H���9������K������H�t$PH���D$P0��U��H���7��L��H��������6����y��E1�A�I��������?M)�I9���6��H�A�H�{@I��H�4@H�sP������v���L�C@H�KHI�� I��E���B�������H�|$PH��tH�/u����H�l$@H�UH���{6��L�mI�M�����66��L�} I�w����6��H�}(L�GH�|$A��� ��5���{X~\1�L��H���i��������1�L��H���T���������H�t$1�H���=���������H�t$H���T��H���	������M�OI�y���H��H���q���H�5j� L�����H���5��H�EE1�I�EL�m M9W��I�~hH�T$H���^��H�D$HH�muH�����H�|$H����1����I��H����4��H�t$H1�H���|�����{4��1�L��H���g�����f4��H�t$H���S��H����I�.�94��H�|$HH�/������4��O�\�I�N�\�(I���;�������������[3��1�L��H���D$P��D$0��������4��1�L��H����������4��H�t$81�H��������i4��H�t$PH���
S��H���S4��H�t$H����R��H���=4��H�t$H����R��H���[����"4��A�A�
�����a3��f.�AWAVI��H�=�� AUI��ATUSH��H��dH�%(H�D$x1�H�D$0�Q���H�����H�D$H���kH�T$0H�5?� L���'�����H�\$0H���!5��H�=�� ����H�����H��H����H��H���j4��L�eM����H�EH�5w^H�8��������I��tyH�UH�5V^H�z�������I��tWH�MH�54^H�y�������I��t5A�H�uJ�<�H�5^�k�������I��M9�u�f.�H�\$8H�5�� L��H�D$@H��� ������H�|$8H�<$H����H;=�� �P3������H��H���|9��L�]H�UI�D�H�D$H�H�\$HH�L�}M���lI�3H�T$HH��H�T$ �w���L�d$HM���I����H�MH�qH�+��9��H�T$ L���@���H�t$HH�t$H����I���L�EI�pM����H�T$ H�|$����L�d$HM����I��tTL�MH�|$I�q��L�d$L��I��H�T$ ���H�|$HH���kI��M9���I����H�\$H�m��7��H���x���I�,$H��M9���7��I�,$H���$8��A�~X~_H�T$0H�4$�1�����I��H���{8��L�|$H��I� ���I�mH����8��L������H�����m���H���=8��H;\$�L�D$H�|$0I�H�/��6��A�~XL�D$0�!E�^`M�NHM�VPE���,	I�AI9��yM�~@C�D cA�VXI�FH���c	E���E���58��H�=�� ���H���?���H�T$0H�4$�I��1����I��H���|5��I�}HH�����I�/H���s5��L������H���B�|���H���o0��I�}PH�4$�v���H��H�����U���H���V0��A�~X�L�-j� H�<$A��H��H���07��I�vHE�^`L�H L�xM�FPH��E����I�7H��I9���M�V@I�� I���M����D�M E�:I��t}�}!M�^HC�|I��tjD�E"I�VHE�DI��tV�M#I�FHA�LI��tC�u$M�NHC�t
I��t0�}%M�^HC�|I��tD�E&I�VHE�Dff.�@M~HH�muH������E�V`I�nHM�~PE���XH�EL9���I�N@�D) 
I�FHH�|$0A��I��H���s6��I�vHA�F`I�o M�oM�NPH�����zM�T5L��M9���M�F@I�� I���M�����MA�8I��tp�}M�^HC�|I��t]D�UI�VHE�TI��tID�MI�FHE�LI��t5�uI�NHA�tI��t"�}M�^HC�|I��u�mM�VHC�lf�MnHI�/uL�����E�n`M�~HM�FPE���II�GL9��I�V@B�D: 
I�FHE�~x�D$H�E���NM�nL��H��I�uI�}M�MH��H!�I��I��I�I�+L9���H����H�l
L�T�M��I!�I��I�I�+L9���H����I��I��K�DJ��I��I!�I��I�I�+H��t^L9�tYH��
L�\
M��M��I!�I��I�I�+H��t7L9�t2H��J�lN�T�M��I!�I��I�I�+L9�tH��u�f.�H����3��I�$M�EM�#I�UUUUUUUUI��M�KM�EM9��5��I�uK�@H�6H9���	A�~X��E�n\E���_I����	A�n`M�fPD�L$QM�NH�D$PqM�˅���I�AL9���I�v@B�D qM�NH�L$QB�L!�INHL�4$I�H�L$H��I���,��H�l$0H���aH�m��1��H����H�+�n,��H�\$H���zL�#L�$$I��L�#��+��L�l$I�EH�$H��I�E�#H�\$xdH3%(D����
H�Ĉ[]A\A]A^A_��H�m�
H�����H�+H��I9��l1��H�+I��H�D$H����1��A�~X�w���A�~X�H�=� ���H����H�L$H�T$H�=AWH�p`1�����H��H����+��1�H��L����H�mA��uH���d���E���VA�~x�D$H����1���@H�t$HL���H��H���4L�$I�H�T$H��I���*��H�l$0H����H�m�0��H���eH�+�(+��L�D$M����M�L�$I��M��<+��H�l$H�}H�<$H��H�}�g����y,��H�4$1�L���D$H��������.��H�t$01�L���v������.��H�t$HL���G��H�������.��I�~h������I�G
L9���M�N@I�� I���������M�~hM�M�A�G�M�VHM�B	M�FHC�
E1�I�FH���f�I�~h��{���M�]	I�3L9���M�F@M��I�� I�vhL�M��H���������H��F�I�vHH�~	I�~HI���XM���Q���I�ff.��M�VHM��������U,��ff.�I�~h������H�E
L9���
M�N@I�� I���������I�nhL�L�E�E�I�nHL�U	M�VHC�
�o����I�~h��n���I�	A�H�7I9��_
M�V@I�� H���������I�vhL�H��F�I�vHH�~	I�~HI���XI�?M���?���ff.�I�NHM��������+��ff.�I�~h�����I�A
I9���I�N@H�� H���������M�NhI�I�9A�A�M�NHM�Q	M�VHB�cA�VXI�FH�������@���GL�-�� �A���ff.�L��L�d$H�|$�c���ff.�H�t$PM܉�H�|$PM�\$I�4$L�LHI��M�L�M)�L)�A�D����� 1�D�h��A��L�A��A��M�9���E����A��tuA��tbA��tOA��t;A��t'A��tA��J�,K�,A���J�K�A����J�/K�+A���N�O�����L�/M�+���L�,M�,���L�M�D9�sdA��FD�nJ�,D�FK�,L��n M�J�/K�+N�D�n(�V0O�H�/D�V8��@I�+N�/O�+L�M�J�,K�,D9�r�I�~HH�ff.�I�~H1�L�,$I�UH�T$H��I�U�EL�D$0M��t
I�(�P*��H��t
H�+�H�|$tL�T$I�:H�<$H��I�:�h%��H���G%��H�|$�����H�l$L�]L�$I��L�]������'��fDL�-� ��@L�l$PL�ɾ1�I�}H�IP�D$Pp�L�L��D�H��A������A��D!�A��A����t�D��D��H�O�����D�HEω�@�H��L)�M�NHE�n`M�fPM��E����J�<	H��L9���	M�f@I�� H���:���H��������|$PC�<H���7���M�^H�t$QC�tH������I�FHD�l$RE�lH������M�NH�T$SC�TH�����M�FHD�T$TG�TH������I�nH�|$UA�|,H���
M�^H�t$VC�t�����I�~h��$���L�Y	K�L9��	M�f@I��I�� M�NhM�L��I���������M�A�A�I�nHL�]	M�^HI���2���L��M����������������I9���'��M��L��M���D$PrI��H��D�L$Q�I��D�T$R�T$SD�D$T�g���ff.�L�]H�|$K�4���H�|$���f�H�H�\$0H�=�� ��H�����H��H����H��H������'���I��P���*��I��A���I��vNI���7I�� �7I��@�7��I���vH�L9�r�I��������L9��#��I��I��H�|$L��L�L$(H�L$ �9�H�|$H��I�E��"��L�L$ 1�L��I�y�M�MI�}H�����I�mL�\$L�D$(H����M�eL��ff.�H�H����M�MH��H��H��L��H!�H��H��L�L�L9���M����H�D>H�<�L��H!�H��L�L�L9�tbM��t]H��H��L�TL��I�<�H!�H��L�L�M��t8H��
L9�t/H�D>H�<�L��H!�H��L�L�M��tL9�tH����fDH�yH�H��H�xH���(���L��L�D$�K�L�L$�J�H���������ff.�f�L�L��L�����M~H�m�f�L�L��H�����MnH�m�H�E�����%��H�$H�EH�1H�t$ H��H�1��%��A�VXH�,$��������� ���@���L�EA�����"��H�}��"��L�mH�m I�}H�U����z"������m"��L�$M�L�T$ I��M��v$��H�|$0H��tH�D$0H�/�Q ��I�EA�VXH�EL�,$H�l$0����I�,$�)��#��H�=� ��H�D$H���`!��L�L$L�0� M9Q�~ ��H�D$HL�|$@L�d$HH�|$L��H��L��������H�t$@H�|$8H��L�����uL�L$8I�L�$H�<$�����H��t��"��L�5�� 1�H��H�5zKI�>��H�muH���`�H�|$0H���9H�/A��������d��L�d$H�t$L�&L�d$ I��L�&�#��H�muH����L�L$L�$L��1�H�L$0H�5mCA��1�I�y��H�D$�n���H�L$H�H�D$(H��H��"�������L�T$M�L�\$(I��M�����%�����L��E1�H��������?H)�H9��v!��A�H�I�~@L�L$ I��D�\$(H�4@I�vP�S�L�L$ �L$(���D!��M�V@I�vHI�� H�����i����@���1�A�H��������?L)�L9��V%��H�A�I�~@I��H�4@I�vP������"%��I�N@M�NHH�� M�ʅ�������h���L��1�H��������?L)�H9��� ��H�A��|$I�~@I��H�L$ H�4@I�vP��D�L$L�T$ ���] ��M�F@I�vHM��I�� H��E�������H�\$����H�U����g#��H���3�H�H�I��H�������$��H=��H=�����D$P��f�D$QH�t$PL���1��H���+#��E1�1��n���E1��H��������?H)�H9��K$��H�A�I�~@I��H�4@I�vP�����$��M�N@I�nHI�� I��E���c��9�1�H��������?H)�L9��m!���H�H��I�~@H�4@I�vP�A����:!��M�N@M�~HI�� M���������E1�1�����D$P���D$Q�����D$P���D$Q���A��I��������?I)�M9��r#��H��I�~@H��H�4@I�vP�����T#��M�f@M�NHL��I�� M�˅��s����F���1�H�|$�X�������A�
�I���A��
�����
����I�ͽL���V���I��1��L���L��M���[���������������������+���
!���C ���"�����AWAVAUATI��USH��H��H��HdH�%(H�D$81�H���nL�r�H����#��H����#��H����#��L�+M����H�kH����"��H�=l� ��H��H���U#��fo
�jH�@f� H�@8H�@h����H�@xǀ�H�@X�@`��HH@(�}�I��H����"��foIjH�@���T�I�FH���#��H�xH�H��H�@xH)����L����H�L�s1�H�sP�/�H�{H�C@�l"��H���c"��H���?�L�5h� L9��_H���g�H����H����!��1�H���CXH��Hǃ���H��@�ƉS\@��H�5�� ���H�l$H���R����wL�d$H�{0M����H���)!��D�sXA��~JD�S`E��L�KHL�{PE����I�AI9��*H�K@B�D	 �H�CHD�d!H�CH�{X~�C`1�L��H��莰�������C`H�KHL�cP���H�AL9��.L�k@A�D
 .L�[HD�s`I�sH�sHE���CL�c0M���[H�{@H�|$H��H�C@����xL�d$H�+uH����H�L$8dH3%(L���TH��H[]A\A]A^A_�H�{h�����I�AI9��L�[@I�� I���������L�KhM�M�A�A�L�KHM�y	L�{HC�;�L�SHG�dH�CH�{X��������f�H�{h���H�A
L9���H�s@H�� H���������L�SHL�ShI�I�
A�B�L�cHM�l$	L�kHB�..L�[H�{`I�sH�sHt>ff.�@L�shI���t%L)�H�{@H�V�J�|7 H��v��H�WH�Ch����L�c0�C`M����H�s@H�t$H�sHH�C@H�������������H�{0�C`H����H�+�_����H��E1��f��[���H�w	��H�kH	�u���L�yI�M�w�APH��L�G� L��1�L�L$AQA�jj��H�� H��H������L�(M������H�hH������I��M����L�%ϝ A�H�=« �M��H��H������fo%9fH�@f�ۿ H�@8H�@h����H�@xǀ�H�@X�@`��`HX(���I��H���fo-�eH�@��(��I��I�FH����� 1�L���L�sH�sP1���H�{H�C@����H������H����L�5؜ L9��k��H������H���H���d��1�H���CX��E��@��E1�H���S\A��A!�D���M��tM9�uEE1�L���H�l$H�5
� H��H����������L�d$H�{0M��u7H���a������H��tL�-.� H�5/I�}������I�$�L�c0H���&������ǃ�A�@I��L�CX�f���H�C0H�/�b��������X���M��A�H��u�3��H���;�������H�-�� A�I����������E1��H��������?H)�L9�����H�H�{@H��H�4@H�sP�]��������L�[@L�KHI�� M��E��������x���E1�A�H��������?L)�H9�����H�A�H�{@I��H�4@H�sP������b���H�s@L�kHH�� E����������H�C0I�,$����L������C`L�{@H�sHL�|$�������L�ChI������H��	K�| L)�H��v��H�wH�Ch����H�sH���L�O	H��L���!��H�kH	��A�A�
����A���������Q���b��f.���AVAUATUSH��H�� L�o8dH�%(H�D$1�M���,I��H�wPH�o@1��n��H�C@H���<H�m�1H�����H�{@��H�CHH�l$H��H�5,� H�Ch����H���������VH�D$H�{0H����H�������SX��~H�{`A��H�KHH�sP���+H�AH9��pL�C@A�D �L�KHG�l!H�CH�{X~�C`1�L��H����������D�[`L�kHL�cPE���?I�EL9��DL�s@C�D. .H�sH�K`H�vH�sH���qH�{0H����H�S@H�C@H��H�T$������a��H�l$H����H�{81�1�H�����H�m�%H���qH�(��L�-@� I�EH�L$dH3%(L����H�� []A\A]A^��H�{h�����H�AH9���L�S@M�Z H�KhE1�M�C��I��I��	u�H�CHH��	H�CHA��L�SHG�lH�CH�{X���������H�{h������I�E
L9���L�C@M�H L�khE1�K�4)B�6�I��I��	u�H�KHH��	H�KHA�	.L�kH�{`I�uH�sHt6L�chI���t)L)�H�{@H�V�J�|' H�����H�WH�Ch����H�{0�C`H���3L�[@H�sHL�\$H�C@H������������H�l$H����H�{81�1�H������H�mtzH����H�(tL�-�� I�E�T���H�������H����H�CHH�l$H��H�5� H�Ch����H�������x3H�D$H�{0H��ukH��������H��H�D$�8��H�D$�o���H�{0�C`H��uE1�����H�w	����H�kH	����H�C0H�/u�����E1����H�C0H���r����-��H�C0H�/��������L�C@�{`H�sHL�D$������*������E1�I��������?I)�M9�����H�A�H�{@I��H�4@H�sP�d�����.���H�C@L�kHL�H L��E���������A��H��������?H)�H9��k��H��H�{@H��H�4@H�sP���������H�{@H�KHL�_ H��E���	�������A��
�8���E1���H�=
� ���H�����H�[H�5u3H�x1�H�S����F����H�=Y� H�R� H9�tH�Γ H��t	�����H�=)� H�5"� H)�H��H��H��?H�H�tH��� H��t��fD�����=� u+UH�=�� H��tH�=� ����d������ ]������w������ATI��UH��SH��H�8H��t	H��Յ�u9H�{H��u5H�{(H��u6H���H��u%H�{0H��u&H���H������1�[]A\����������������ff.���ATI��UH��SH��H���H��t	H��Յ�ucH���H��t	L��Յ�uNH���H��t	L��Յ�u9H���H��u2H�{H��t	L��Յ�uH�{0H��uH���H������1�[]A\��������I��I��L��H!�H��H��H�L�M��t.L9�t)I�DH��H��H!�H��H�L�M��tL9�tI�����f�SH��H�?H��tH�H�/����H�{H��tH�CH�/�uH�{H��tH�CH�/�PH�{H��tH�CH�/�^��H�{ H��tH�C H�/�H�{(H��tH�C(H�/��H�{0H��tH�C0H�/��H�{8H��tH�C8H�/u���H�{@H��tH�C@H�/u�i��H�{HH��tH�CHH�/u�M��H�{PH��tH�CPH�/u�1��H�{XH��tH�CXH�/t8H�{`H��tH�C`H�/����H�{hH��tH�ChH�/�d��[�����������0������������������������������f���H�H��tP����H�v� H�Z�H�i� H��@��USH��QH�H�w H������H�kH�} ����H�EH�CH�@H��tH� � H�Z[]����SH�����H�{H��t
H�/����H��[�������SH������H�{H��t
H�/����H��[������UH��H�=� SQ�*��H��H��tH�EH��H�h�Q��H��Z[]�f.���UH��H�=� SQ����H��H��tH�EH��H�h���H��Z[]�f.���SH�GH�WH�X H��t
H�JH��H�\ H�@H��t����H�H���$��H������H��[���ff.�@H��H��t	1�1�����H��1�1�������SH�GH��H�H�X tH�O H��H���tH��H��H���H��uMH���H��tH��1��I��I��L�H���H��tH��1��I��I��L�H����"��H��[����H��1��H��H��H��H;5	� tlATI��UH��SH��H��H�G���tH�5@/�=����u1�L��H���|��H��u��H��[]A\�H�H�J�H9�����H�M1�H��u��������UH��SH��H��dH�%(H�D$1�H�~udH�G����tWH��H�5F� ���������H�<$H��u-1�H��H�5� H��1�����H�L$dH3%(uH��[]�H�/����H��H��������7�����P����ZH�����ff.�f���P���H���n���1�Z�f.�PH�=� ����H�����H�5�-H�x�[����Z�fDSH��H�=Օ ���H���X���;H��-H�5�-HD�H�x�����[�DAVAUATUH��H�=�� S�y��H�����H�}H�WH�w(H9��NL�GH�J�H�OL��I��H���H9��?O�d�L�R�L�WM���2L9���O�l�H��H�WM����I�}�����3M��8M���}��M�t$A���t]H�S��� ��H��L��L��A��H�+I����I�,$�,��I�m���M��tRH�}L�������[]A\A]A^�H�xI�VH�5A1��:��H�+uH�����I�,$����I�m�������H�� �X���H�+uH������I�,$u�����H�� �5������H������P���H�� ����H�+u�H��������[���H�xH�RH�5�1�����_���H�WH�xH�5"1�����D���ff.�PH�=�� ���H�����H�5�+H�x����H��Z�D��AWAVAUATUSH��HdH�%(H�D$81�H���W��H�FH�z� H��I��H9����L�VI�j����I��H������H�MH�UI�}H�HH�PH�EI�E�a��H�}H��������H9�����H������I�EH������H�uE1�H�U�I��I9�sM��I��N�$M��t�I�$H�U��H��H������H�{���L�k1�H�\$8dH3%(uH��H[]A\A]A^A_��4��@��AWAVAUATUSH��XdH�%(H�D$H1�H���v��H�FH��� H��I��H9��p��� �BH�D$0H�nH��I���6
��I��H���d��H�t$8H�|$0H�t$L�t$@H�|$H�T$H�t$L��L���<����tyH�|$8L�GA�������L��H��H��������H��uL�� H�5I�8����H�]�H���I�<�H���8��H��H���u�L��������H�s H�{�R
��L�c 1�L�{H�L$HdH3%(��H��X[]A\A]A^A_�H���w���H�L$@H;C �o��L�SH�I��H�8H�H��uoH�C(���H�
}� H�P1�H�5�H�9�p�����H�nL�e L������E1�I��H��u
����K��I��M9��;���L�UK��H��t�H���H�/�����������������f�AVLc�AUM��ATUH��H�=� SH�� dH�%(H�D$1�����H�����H���I��H���H)�I9��yH�t$L��H������H���FH�t$1�1�D�>��H��I��L	�I9��A���H������H������I��H����I�|$(H�����H�������{��H������I�|$0L���u��I��H���%��L�PA�������H������H������I�VL�ZA�������I�N H�A�������E1�H�5�� H��1��&��H��H���h��I�|$(H��L���j��I�m�8��������H�}H�������H�\$dH3%(uEH�� []A\A]A^���I��A���I��L	�����H���H�L�H�L$H���������ff.�SH��H��H���dH�%(H�D$1�H���H)�H��+H�����H��y2��H�L$dH3%(u}H��[�H���H�H��H�$H���H�<$E1�1�F�B��I��I��L	�I��u�H��H������L�SH9s ����I�4�H��tH�H�{�������s����:�����DATHc�UI��SH��H��H���dH�%(H�D$1�H���H)�H9���H���H�H���H�H�4$H�<$E1�1�B�B��I��H��H	�E9��H���=��L���L���M)�I9���L���M�I�L�$L���L���H�5e%L�����H�<$��tnH���L��H�����H��t9H�{H��������H�|$dH3<%(uBH��[]A\�H���H��H���2�������H��H��H���,��H���v�����H���I�������f�AVAUATUSH��H�� dH�%(H�D$1��|��H���L�l$H��I��L������H����H�����H�|$H�p�H�y$���H��H����L��H�����H����H������H�|$H�p�H�:$���I��H����E1�H��H��1�H�5�� H�����I�.I������H�muH������M��tOH�{L�����I��H�����H��L����I�,$����I�m�p��H��tH�{H���8�������H�L$dH3%(uH�� []A\A]A^�H�mu�E1��u����o��ff.�@USH��(dH�%(H�D$1�H������D$�H��H�t$H��I��1�H�~��M��I��D�H��H��u�H��I��	H����C�����D�H��H���w9����H�\$dH3%(uH��([]��������AWAVAUATUH��H��SH��XdH�%(H�D$H1�H����L�z�H���-�H����A�H����H�]M����L�-X"1�L�%H"A�L�,$H�=[� ���I��H�����f�H�x@H�@0���fo
FH��Hǀ�����������Hǀ1��AO �H�L$����I��H�����H�xH��H�Hǀ�H��H�D$H)������H�M�oH�=F� ���I��H�����fo}GH�@�@�@ P(�p��I�EH����I�M�o��L�����I���H�5>� H��������c�I���H�5� H���������E�I���H�5† H������I���H�5�� H�����I����t�I����f�H�<$蟾��L��I���萾��I���I������H���H��t
H;-~ ��ILJ�E��L���vX��I�/H��uL�����H��H�\$HdH3%(��H��X[]A\A]A^A_�L�aI�M�|$�PH��A�1�L�p� H�D$(Pjj���H�� H��H���H����'�H��蔿��I���H���_�����H�}A�H�����H�MH�tH�$H�����H�ML�%UH���s�H�m �����B������P����AWAVAUATUSH��H��H��XdH�%(H�D$H1�H���DL�z�H���0�H����H��H����H�L�sH�T$M����L�cM���H�I��I����H�-e| A�H�=X� ���I��H�����fo
�DH�@f� H�@8H�@h����H�@xǀ�H�@X�@`��HH@(�i���H��H���J�fo5DH�@���@���H��H�CH������ 1�H���I�_I�wP1��5���I�I�G@���H�����L���E���H�n{ I9����L���m���H����H���^�E1�H��A�GXL��A��E��H�5ς A��H��E�O\A��A��D!�A���I�W8�X������.I�8�+�H��t	H9���1�I���H�T$H�5r� L����������L�t$I�0M����H���8�A�oX��~JA�`M�oHM�gP��I�EI9���I�w@H�� B�.�M�WHB�lI�GHA�X~A�G`H�t$1�L���U������>A�`M�gHM�_P�I�D$I9��[M�o@I�� C�D%.M�GHA�`I�PI�WH�|I�0A�G`H����L���:������I�/��L���н��1���H�t$HdH34%(��H��X[]A\A]A^A_�H�{H���7�A�H�k ����H�iH�L�}�PH��A�1�L�� H�D$(Pjj�N���H�� H��H���������I�/uL���;���H�H���e���I�h����I�D$
I9��M�o@I�� M�gh1�M�A�<�H��H��	u�I�GH	M�gH����I�h��B���I�EI9��CI�w@H�� M�ohE1�I�C�D
�I��I��	u�I�GH	M�oH����L�%�x A�L������M�OhI����v���L)�M�W@H��	K�|
 H��v/��E1�B��H��I��H��B�I��u�I�Gh�����1���H�w	���I�oH	��I�G0H�/�$������������7�����
I��������?I)�M9����H��I�@H��H�4@I�wP�̹������M�o@M�gHI�� ����������H��u����H���������3���A��H��������?H)�L9��>�H�A�I�@I��H�4@I�wP�P�����x=I�w@M�oHH�� E��������j���A�XxH�-v H�5
H�}�Ի���-���I�0A�G`H������I�G0H�/����������E1���O���1�����M�w0H��������H�E���f�ATI��H�5\v 1�UH��H�=�S�q���H�����H��H��L��H�����H�+��uH���W�����[]A\���AVH�=� AUATUS�x���I��H���q���H�=u� 谴������H�=� 蜴������H�=
� 舴������H�=y� �t�������H�=� �`���������H�= �'���H��H���sH��� H�5NH��H��� �}������MH�΁ H�5�H��H��� �W������'H��t H�5�H��H��5������H������1�1�H�=qH���r���H�H����1�H��H�=e�U���H�CH����H�31�H�=]�7���H�CH����H�H�5H��H�贲������H�SH�5H��H�蕲�����eH�SH�5H��H��v������FH�=�} ����H�C`H�������H�=�艸��I��H�����H�5�H���^���H�CH���	���H�@L�%Vs L9������H�5�L���.���H�C H������H�PL9��D���H�5�L������H�C0H�������H�HL9�����H�5�L���ܶ��H�C(H�������H�pL9��5���I�m����H�=h軷��I��H������H�5gH��萶��H�C8H���;���H�xL9��{���H�5SL���g���H�C@H������L�@M9��4���H�5
L���>���H�CHH�����L�HM9����H�5�L������H�CPH�������L�PM9������I�m����H�=���I��H���M���H�5�H���ɵ��H�CXH������H�����������I�,$�#���H�=�襶��I��H�����H�5�H���z���I�$H��H�Ch���H��I��I�$���[L��]A\A]A^���H��H���attribute deletion is not supportedpersistent_load must be a callable taking one argumentpersistent_id must be a callable taking one argumentfile must have 'read' and 'readline' attributesNEWOBJ_EX class argument must be a type, not %.200sNEWOBJ_EX class argument doesn't have __new__NEWOBJ_EX args argument must be a tuple, not %.200sNEWOBJ_EX kwargs argument must be a dict, not %.200s'memo' values must be 2-item tuples'memo' attribute must be a PicklerMemoProxy object or dict, not %.200smemo key must be positive integers.'memo' attribute must be an UnpicklerMemoProxy object or dict, not %.200sfast mode: can't pickle cyclic objects including object type %.200s at %p_compat_pickle.NAME_MAPPING values should be 2-tuples, not %.200s_compat_pickle.NAME_MAPPING values should be pairs of str, not (%.200s, %.200s)_compat_pickle.IMPORT_MAPPING values should be strings, not %.200sCan't pickle local attribute %R on %Rread would overflow (invalid bytecode)unregistered extension code %ld_inverted_registry[%ld] isn't a 2-tuple of stringsBINSTRING exceeds system's maximum size of %zd bytesBINUNICODE exceeds system's maximum size of %zd bytesfile must have a 'write' attributebuffer_callback needs protocol >= 5odd number of items for SETITEMSmemo id too large for LONG_BINPUTread() returned non-bytes object (%R)readinto() returned negative sizememo id too large for LONG_BINGETBINBYTES exceeds system's maximum size of %zd bytesserializing a bytes object larger than 4 GiB requires pickle protocol 4 or higherLONG pickle has negative byte countcould not convert string to intcould not convert string to floatBYTEARRAY8 exceeds system's maximum size of %zd bytespickle stream refers to out-of-band data but no *buffers* argument was givennot enough out-of-band buffersthe STRING opcode argument must be quotedNEWOBJ class argument isn't a type objectNEWOBJ class argument has NULL tp_newslot state is not a dictionarypersistent IDs in protocol 0 must be ASCII stringsA load persistent id instruction was encountered,
but no persistent_load function was specified.unsupported pickle protocol: %dFRAME length exceeds system's maximum of %zd bytesUnpickler.__init__() was not called by %s.__init__()serializing a string larger than 4 GiB requires pickle protocol 4 or higherdictionary changed size during iterationset changed size during iterationPickleBuffer can only pickled with protocol >= 5PickleBuffer can not be pickled when pointing to a non-contiguous buffercan't pickle '%.200s' object: %R__reduce__ must return a string or tupledict items iterator must return 2-tuplestuple returned by __reduce__ must contain 2 through 6 elementsfirst item of the tuple returned by __reduce__ must be callablesecond item of the tuple returned by __reduce__ must be a tuplefourth element of the tuple returned by __reduce__ must be an iterator, not %sfifth element of the tuple returned by __reduce__ must be an iterator, not %ssixth element of the tuple returned by __reduce__ must be a function, not %slength of the NEWOBJ_EX argument tuple must be exactly 3, not %zdfirst item from NEWOBJ_EX argument tuple must be a class, not %.200ssecond item from NEWOBJ_EX argument tuple must be a tuple, not %.200sthird item from NEWOBJ_EX argument tuple must be a dict, not %.200sargs[0] from __newobj__ args is not a typeargs[0] from __newobj__ args has the wrong classCan't pickle %R: import of module %R failedCan't pickle %R: attribute lookup %S on %S failedCan't pickle %R: it's not the same object as %S.%SCan't pickle %R: extension code %R isn't an integerCan't pickle %R: extension code %ld is out of range_compat_pickle.REVERSE_NAME_MAPPING values should be 2-tuples, not %.200s_compat_pickle.REVERSE_NAME_MAPPING values should be pairs of str, not (%.200s, %.200s)_compat_pickle.REVERSE_IMPORT_MAPPING values should be strings, not %.200scan't pickle module identifier '%S' using pickle protocol %ican't pickle global identifier '%S' using pickle protocol %iPickler.__init__() was not called by %s.__init__()copyreg.dispatch_table should be a dict, not %.200scopyreg._extension_registry should be a dict, not %.200scopyreg._inverted_registry should be a dict, not %.200scopyreg._extension_cache should be a dict, not %.200s_compat_pickle.NAME_MAPPING should be a dict, not %.200s_compat_pickle.IMPORT_MAPPING should be a dict, not %.200s_compat_pickle.REVERSE_NAME_MAPPING should be a dict, not %.200s_compat_pickle.REVERSE_IMPORT_MAPPING should be a dict, not %.200scodecs.encode should be a callable, not %.200spersistent_loadpersistent_id__main__pickle data was truncatedunexpected MARK foundunpickling stack underflowcould not find MARKmemo key must be integersnOOOpickle.find_class<locals>Can't get attribute %R on %REXT specifies code <= 0bytesstrictASCIIargument 'encoding'embedded null characterargument 'errors'surrogatepasspickle protocol must be <= %d%zd
Ran out of inputodd number of items for DICTNEWOBJ expected an arg tuple.state is not a dictionarynegative PUT argumentinvalid load key, '%c'.invalid load key, '\x%02x'.STACK_GLOBAL requires strloadsI01
I00
%c%ld
int too large to pickle(O())(O(OO))utf-8 while pickling an object(O(O))save_reduce__newobj__ arglist is emptyO(O)Can't pickle local object %Runable to get sys.modulesPickleBuffer_pickle.PickleError_pickle.PicklingError_pickle.UnpicklingErrorcopyregdispatch_table_extension_registry_inverted_registry_extension_cache_compat_pickleREVERSE_NAME_MAPPINGREVERSE_IMPORT_MAPPINGcodecsencodefunctoolspartialdumpclear_memo__sizeof__clearcopy__reduce__binfastdumpsfileprotocolfix_importsbuffer_callbackencodingerrorsbuffersobjlatin1__name____qualname____new____newobj____newobj_ex__itemsreducer_override__reduce_ex__addwritereadlinereadreadintopeek__dict____setstate__appendextendgetattr__getinitargs___pickle.Unpickler_pickle.Pdata__module___pickle.Pickler_pickle.PicklerMemoProxy_pickle.UnpicklerMemoProxy__class__Optimized C implementation for the Python pickle module.Pickler(file, protocol=None, fix_imports=True, buffer_callback=None)
--

This takes a binary file for writing a pickle data stream.

The optional *protocol* argument tells the pickler to use the given
protocol; supported protocols are 0, 1, 2, 3, 4 and 5.  The default
protocol is 4. It was introduced in Python 3.4, and is incompatible
with previous versions.

Specifying a negative protocol version selects the highest protocol
version supported.  The higher the protocol used, the more recent the
version of Python needed to read the pickle produced.

The *file* argument must have a write() method that accepts a single
bytes argument. It can thus be a file object opened for binary
writing, an io.BytesIO instance, or any other custom object that meets
this interface.

If *fix_imports* is True and protocol is less than 3, pickle will try
to map the new Python 3 names to the old module names used in Python
2, so that the pickle data stream is readable with Python 2.

If *buffer_callback* is None (the default), buffer views are
serialized into *file* as part of the pickle stream.

If *buffer_callback* is not None, then it can be called any number
of times with a buffer view.  If the callback returns a false value
(such as None), the given buffer is out-of-band; otherwise the
buffer is serialized in-band, i.e. inside the pickle stream.

It is an error if *buffer_callback* is not None and *protocol*
is None or smaller than 5.Unpickler(file, *, fix_imports=True, encoding='ASCII', errors='strict',
          buffers=())
--

This takes a binary file for reading a pickle data stream.

The protocol version of the pickle is detected automatically, so no
protocol argument is needed.  Bytes past the pickled object's
representation are ignored.

The argument *file* must have two methods, a read() method that takes
an integer argument, and a readline() method that requires no
arguments.  Both methods should return bytes.  Thus *file* can be a
binary file object opened for reading, an io.BytesIO object, or any
other custom object that meets this interface.

Optional keyword arguments are *fix_imports*, *encoding* and *errors*,
which are used to control compatibility support for pickle stream
generated by Python 2.  If *fix_imports* is True, pickle will try to
map the old Python 2 names to the new names used in Python 3.  The
*encoding* and *errors* tell pickle how to decode 8-bit string
instances pickled by Python 2; these default to 'ASCII' and 'strict',
respectively.  The *encoding* can be 'bytes' to read these 8-bit
string instances as bytes objects.__sizeof__($self, /)
--

Returns size in memory, in bytes.clear_memo($self, /)
--

Clears the pickler's "memo".

The memo is the data structure that remembers which objects the
pickler has already seen, so that shared or recursive objects are
pickled by reference and not by value.  This method is useful when
re-using picklers.dump($self, obj, /)
--

Write a pickled representation of the given object to the open file.__reduce__($self, /)
--

Implement pickle support.copy($self, /)
--

Copy the memo to a new object.clear($self, /)
--

Remove all items from memo.__sizeof__($self, /)
--

Returns size in memory, in bytes.find_class($self, module_name, global_name, /)
--

Return an object from a specified module.

If necessary, the module will be imported. Subclasses may override
this method (e.g. to restrict unpickling of arbitrary classes and
functions).

This method is called whenever a class or a function object is
needed.  Both arguments passed are str objects.load($self, /)
--

Load a pickle.

Read a pickled object representation from the open file object given
in the constructor, and return the reconstituted object hierarchy
specified therein.__reduce__($self, /)
--

Implement pickling support.copy($self, /)
--

Copy the memo to a new object.clear($self, /)
--

Remove all items from memo.loads($module, /, data, *, fix_imports=True, encoding='ASCII',
      errors='strict', buffers=())
--

Read and return an object from the given pickle data.

The protocol version of the pickle is detected automatically, so no
protocol argument is needed.  Bytes past the pickled object's
representation are ignored.

Optional keyword arguments are *fix_imports*, *encoding* and *errors*,
which are used to control compatibility support for pickle stream
generated by Python 2.  If *fix_imports* is True, pickle will try to
map the old Python 2 names to the new names used in Python 3.  The
*encoding* and *errors* tell pickle how to decode 8-bit string
instances pickled by Python 2; these default to 'ASCII' and 'strict',
respectively.  The *encoding* can be 'bytes' to read these 8-bit
string instances as bytes objects.load($module, /, file, *, fix_imports=True, encoding='ASCII',
     errors='strict', buffers=())
--

Read and return an object from the pickle data stored in a file.

This is equivalent to ``Unpickler(file).load()``, but may be more
efficient.

The protocol version of the pickle is detected automatically, so no
protocol argument is needed.  Bytes past the pickled object's
representation are ignored.

The argument *file* must have two methods, a read() method that takes
an integer argument, and a readline() method that requires no
arguments.  Both methods should return bytes.  Thus *file* can be a
binary file object opened for reading, an io.BytesIO object, or any
other custom object that meets this interface.

Optional keyword arguments are *fix_imports*, *encoding* and *errors*,
which are used to control compatibility support for pickle stream
generated by Python 2.  If *fix_imports* is True, pickle will try to
map the old Python 2 names to the new names used in Python 3.  The
*encoding* and *errors* tell pickle how to decode 8-bit string
instances pickled by Python 2; these default to 'ASCII' and 'strict',
respectively.  The *encoding* can be 'bytes' to read these 8-bit
string instances as bytes objects.dumps($module, /, obj, protocol=None, *, fix_imports=True,
      buffer_callback=None)
--

Return the pickled representation of the object as a bytes object.

The optional *protocol* argument tells the pickler to use the given
protocol; supported protocols are 0, 1, 2, 3, 4 and 5.  The default
protocol is 4. It was introduced in Python 3.4, and is incompatible
with previous versions.

Specifying a negative protocol version selects the highest protocol
version supported.  The higher the protocol used, the more recent the
version of Python needed to read the pickle produced.

If *fix_imports* is True and *protocol* is less than 3, pickle will
try to map the new Python 3 names to the old module names used in
Python 2, so that the pickle data stream is readable with Python 2.

If *buffer_callback* is None (the default), buffer views are serialized
into *file* as part of the pickle stream.  It is an error if
*buffer_callback* is not None and *protocol* is None or smaller than 5.dump($module, /, obj, file, protocol=None, *, fix_imports=True,
     buffer_callback=None)
--

Write a pickled representation of obj to the open file object file.

This is equivalent to ``Pickler(file, protocol).dump(obj)``, but may
be more efficient.

The optional *protocol* argument tells the pickler to use the given
protocol; supported protocols are 0, 1, 2, 3, 4 and 5.  The default
protocol is 4. It was introduced in Python 3.4, and is incompatible
with previous versions.

Specifying a negative protocol version selects the highest protocol
version supported.  The higher the protocol used, the more recent the
version of Python needed to read the pickle produced.

The *file* argument must have a write() method that accepts a single
bytes argument.  It can thus be a file object opened for binary
writing, an io.BytesIO instance, or any other custom object that meets
this interface.

If *fix_imports* is True and protocol is less than 3, pickle will try
to map the new Python 3 names to the old module names used in Python
2, so that the pickle data stream is readable with Python 2.

If *buffer_callback* is None (the default), buffer views are serialized
into *file* as part of the pickle stream.  It is an error if
*buffer_callback* is not None and *protocol* is None or smaller than 5. �;,��l��HXu��p�}���~���$~��<T~��\l~����~����~����~��H�~���&���2��3�����P<����@���	J���8	T����	\����	؀���	T��� 
o���T
�����
�����
N���`d��������pE����v���`
�����
�����
�����

���<"���,~�������l҉���W����d������$����8���n����{����[���@ӎ��x+����B���4�������&���L^����đ��H
����}��������@�����ٔ��`���%��� ͖�������`����՗�����0�������Q���t��������@���������0)����:���P3����������������������| ����� ����L!�����!H��������`����X��������4��d8���L	����x	��
���8
H�������t��8���(��t
���X��X�������X��T��������x��`��������������T�����(�t�����H(�����$h�������DH����	�����������@���G��DhG��`8j��dn����p��$z�� x���� H���!������������p���Ȧ��������H����x���	����l
���
(����
����,����@H����ȩ���
h���d����|�����ت����������@H���lh��������H�����h�������\8���ض��Th�����������`!zRx�$�g��pFJw�?:*3$"D�o��`,\���uF�D�D �O
ABAzRx� ���$�w��TA
GBB�x��,�����F�D�D �|
ABA��w��0A
GBB0�w��D@���NX�w��*[Kp�w��*[K$�����WA�D�D0ICAzRx�0�� �w�����A�|
AzRx�� �w��$U
E$4@���UA�D�A JCA\hw��.RPt ���,NQ�H���BK�v�Jw���h���$J�U��&w���w���E��L���UA�S(�w��$8|���AA�A�A tDAzRx� �� �w��AAA$�,���HE�A�D {AA�T���)E�_�0w��
�T���)E�_
w��
( ��RE�A�G W
DAE$L���NA�A�D EAA�v��$��v��|E�A�A rAA$��v��|E�A�A rAA�ܳ��-E�g�,w��M
Eس��-E�g,w��M
E$@4���6E�K�A bAA$hL���6E�K�A bAA�d���QE�G��v��V��v���A�� �8���1A�K O
AAT���`����E��
E8�v��ULH���|B�B�B �E(�A0�A8�G�I
8A0A(B BBBI$zRx��������,pv��UH����(B�B�E �B(�A0�A8�G`�
8D0A(B BBBA zRx�`������(Av���4X����yK�D�D �G0v
 AABA`���zRx�0���$av��1L�@����B�B�D �D(�G0�
(A ABBO^
(D ABBIzRx�0����$v��(H�����b�N�K �ZAB��u��
��u��hE�b(���A�D�G0n
AAA$�v��(������F�A�D �}AB$��v��
ABBAAB8	����EFP	���EPh	���*Ah�	$���;A�y<�	H����B�B�B �A(�K0�
(A BBBA zRx�0�����(�v��\
��+Ai,
����^H@
ԝ��F�B�B �B(�A0�A8�D��
8A0A(B BBBA$zRx��������,�v���L�
l���F�B�B �B(�A0�A8�D�>
8A0A(B BBBA$zRx��������,�x���8TJy���B�B�E �A(�A0�r(A BBB��y��
$��y���E�E�A wAA(�����OB�A�D �DABp�y��D�y���B�B�B �B(�A0�A8�D@�8D0A(B BBB$Taz���E�E�A wAA|�z��
4��z���B�E�D �D(�A0�(D ABBH����BF�B�B �B(�D0�D8�D`Q
8A0A(B BBBM�{��x (
����eK�H
AP�$L
S|��XA�G�A LAA(t
 ����B�A�D �s
ABC
W|��P�
���L�B�B �A(�D0�!
(A BBBC�
(A BBBA0|��~@8����B�E�E �A(�K0�DP�
0A(A BBBA zRx�P�����(|��% ������A�G P
AAzRx� � �|��A0�H���NB�D�D �G0�
 AABA��|��8H4���[B�B�B �B(�A0�A8�DP#
8A0A(B BBBA zRx�P������(�|��f`����B�B�B �A(�D0��
(D BBBH,
(E EBBF~
(E EBBADt|��I@0T���qB�B�B �A(�A0�GPE
0A(A BBBAe|��p(�����4A�A�G@�
AAAzRx�@�� y|��,�����F�A�D ��
DJB�=|��<`(L��F�B�B �B(�A0�D8�G�a�^�G�F�I�
8A0A(B BBBA$x|����^�B�B�I�,�����F�D�A �7
DBIL����eB�B�B �A(�A0��
(A BBBAx(E BBB\q}��0H���wB�D�D �G0K
 AABP�
>}��7`����KF�B�B �B(�A0�E8�G�a�\�H�F�I��
8A0A(B BBBA$��|����]�B�B�I�`���%B�B�B �B(�A0�A8�DP�
8A0A(B BBBBH
8F0A(B BBBE~��)L�`��pB�B�B �B(�A0�A8�D��
8A0A(B BBBD��}��j8�l���B�E�D �D(�D@
(D ABBAzRx�@����$�}��uXh���B�B�B �D(�D0�GP�
0A(A BBBJ�
0C(A BBBAh�}��(�,����A�A�D@�
AAAT�}��0��IB�D�E �GPy
 AABAzRx�P���$R}���@����B�E�B �D(�A0�GPO
0A(A BBBAh�}���H����B�B�B �B(�A0�A8�Dp
8A0A(B BBBA zRx�p������(�}��g0\�6B�D�D �G@�
 AABAzRx�@���$�}��HL���.B�B�B �B(�D0�A8�D�{

8A0A(B BBBJ�}���`(|����F�B�B �B(�A0�G8�D��
8A0A(B BBBAM�X�B�B�I�x�����`�$��"F�B�B �B(�A0�A8�J�j
8A0A(B BBBA��Y�B�B�I��h�����)��IT�tL4*���"B�B�B �E(�A0�D8�G��
8A0A(B BBBA$zRx��������,I���`�t���WF�B�B �B(�A0�A8�J�6
8A0A(B BBBAh�X�B�B�I����H8�K���B�L�B �B(�D0�A8�G`W
8A0A(B BBBAh{����H�LO���B�B�B �B(�D0�A8�G`4
8A0A(B BBBA�ތ���`��Q��&	B�B�B �E(�D0�A8�N�r�H�K�K�Z��
8A0A(B BBBF$zRx��������,	����(�����PB�M�K �rAB<����L�Z��_B�B�L �E(�A0�A8�J�	
8A0A(B BBBI$zRx��������,)����`d�s���F�B�B �B(�D0�A8�J��
8A0A(B BBBA��V�H�B�I�@����2@�8|���F�B�B �A(�A0�GP�
0A(A BBBH�
a����84����$F�I�B �A(�A0�(D BBB�	����GNU��{�{�"#�(�1�=�#�1�M�V�]�I�1�M�V�]�#�1�M�V�]�e�(�1�=�e�#�(�1�=�UfvE
���"�"���o`��
B
P
"�x8#`	���o���o�"���o�o2!���o�P"@EPE`EpE�E�E�E�E�E�E�E�EFF F0F@FPF`FpF�F�F�F�F�F�F�F�FGG G0G@GPG`GpG�G�G�G�G�G�G�G�GHH H0H@HPH`HpH�H�H�H�H�H�H�H�HII I0I@IPI`IpI�I�I�I�I�I�I�I�IJJ J0J@JPJ`JpJ�J�J�J�J�J�J�J�JKK K0K@KPK`KpK�K�K�K�K�K�K�K�KLL L0L@LPL`LpL�L�L�L�L�L�L�L�LMM M0M@MPM`MpM�M�M��u������p�@���@W����d@�	�1d��\�xA�(�0����`� Y�``���P���������@����b`�	��b ������0��X��������l��� �� �"�0���`""��"�i�p�y�������p����"� "���	����"a�A��̵е "6��ֵߵ��������������p�"�Ђ�����@�8�����N����.��D��`|�[ " "�Y��@�D��{{W""�"�i��DTV�V�"���D�V�V�"GA$3a1E��_pickle.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug��C�7zXZ�ִF!t/��+'
%]?�E�h=��ڊ�2N�uUˢo��t��9Zޱ%��R%a?'�(q.�ފ�N���r�z��ɨ����5��
T�|z0�*�p�d���o��&E1�/���[��*�������<��Io�|]kjf����sÐ�1��2�7�x�gh��O(��mU#��W�+`WgRb��zHId�٘/7?澵��s"�bB�)n�{�*��r��2�����/c'�`�]$R,9�D#xiDK"�p�}����D!�_	����QA&4��Dh9
�g�5M�e/�?��6㮏
@&�x�Nm	Ru5m�:�X��uS��ʨ����h����H�y�u�։+����/�F���U��t�e��K��jٺu8�|�
ev[�-P�ňFSd�/�s�&�E��Z|l�1iK�s�)W�N|4T��Rq3m�hRxF�����*p˶��Z┱F/=��7Q�a�򂦽�h�(�����m
�P�߯nZ訓2���u
�����ȓğL�3B:��N-�icH���篭4�֗<w7�%���F8~��9�����19��n![ 9�/�F��#3P5�н�!�A�C�ƌ�sb$��V�ʸjt^E��r�ks!kjfԸ�h�WƧ�$�]���Ʒ/��M:��֔�)���*���L�i;�O�#�G��DS��{J�K����v|�63޻=TSo�pP%F�RRʩ aA�{d���@m-W��F*��->]œ��Vnb���[��Y��'e��f>tA�����c��Ӎd�I.�R���4����s%�$�t�+�믠�m�bյ�16�l��s'�W��m�JB*]�X�E�FΙF��D��Ĭ��X�5&��D�I2i�Dm�z,|z�����#}�q��P��V�.��N��-5�?�I��q�׀���_�k�E�O~V�� �8	��X#��5ܢ���^Dj�sĬi��{�CE�&�6��O9|2���I@x���2�·Z(@�iV�P���`F)#2�^�3n?�����"}�R��$8wA���U�4��\\��X��ߌs�W@��B)��	Rzɱ�D%�9Wx�|	I���������'������)Y��6Xdi��k���6H�?L"<��S����y���{��{��[RN��c��_Y�������AXx�giB�Cd!
QhD��>s�^]`�]2����*_R"�u�öuٷ��c��ix��1�G�^Ld,�惟qn(�ę�~%5>�"��h�+�&�v��s���p���e��gGG�495��ߵ��ul	�x�B�!0�#�o���ܯ��Q�c�׏����*V�b��{�W$�ug(ٚ���O�-�8Z�+6:&�7cQ��7����j@9d���|� �uL�kȌLŃ���V�����̓�Hރ��Qk��P+�5�RX�-Ri�z��"[B���\�����Γ���ۡ�by��}4�9�4�ĻH"��!��j$!�2K�ƳJ7;5b�	�a�u��L�EJ]`���iB#�Z	�6{��[k���!%'`�����
-�Gǖ͊��.��oOύ���J!FA�xx��?ۆ�	K��k�S��=�W�=�=y`�Aq�Z:��gD�"���qZ|e�9n�L��)�y�-���&��z�s�Z4:/m��L`
J�b��>�1!�*2�Dp0t�������=A9��ԯ�"!<��{�‹3��b��W�use�2|���|�x�Y���h���;�Q&���K�'zbz��C �'#�zc��נi�f�AB�v��w�.�_]י�������ߠŠW��i��ߐ{�p-�6]�>+}�\�ȑ"��"��
KCtc�#�'p;)��i/����ڿ�÷J�)�NKi����B�����d���h�5�)��)2�r('����t�zKe�k�L�eV��$���HF:K�"2�'�J�����I})C=J������jN��2�oi��A�a��]���J��������Ś$x��|L�\N�$$�
�:09FJ�����i+nqH�N��U�~���!DˌJ6��I+�s��/�뎏y��(-���6rcX�B��s@�K���+��U���ܔ�I��r��z�!�M�n5�/Ж�eY�9�!��$��6������v8�-R��>[C�$��uG��B��Ek�����-��'w��o�7����X��og8��2������=�\��K��kwܗ�S�ke^"J8��%U9��ʬ8x~	K�	`�K�Q����J�!Cw�L�4�
���UA��z��h�gx?���>��^gY��pq�#�Ͻ�0�-��j��=|�A�.[aݼ�9�Ys*]�'F�0-'�����X��Y��;�R��{�W+�63x��@��ώN:���㉐
F�+,�F�����t-@N��!Y������1$[�"�"��>���Cv��*k��T�"�8�"pJ�zMШKK�C�)��]X����~�3��{�W�<<�WY��Ď� T�pTiE<�h&�|'z6ѡx����8�H��c��T�
�U_��U��� Q�UZ��VfKol��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(��X0��B
8���o2!2!rE���o�"�"pT##`^Bx8x8�hEEc0E0Epn�M�M`wVV�G}����
������: �H�H�,�x�x����� ��"���"���"�� �P"P�P
"P
��"� ��""�"��"b�"$
�"`#h
l-(lib-dynload/_codecs_kr.cpython-38-x86_64-linux-gnu.so000075500000416650151153537510016220 0ustar00ELF>`)@h@8	@���� ����!��!5(5 @
@
"@
"888$$������  S�td������  P�td4�4�4���Q�tdR�td����!��!p4p4GNU������4 ���0���]�@ "l:@`��|CE���qXs� � , �F">���b.��P�B���"��"��"__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6_PyUnicodeWriter_WriteCharPyUnicode_AsUTF8strcmpPyCapsule_NewPyObject_CallFunctionObjArgs_Py_DeallocPyImport_ImportModuleNoBlockPyObject_GetAttrStringPyExc_TypeErrorPyErr_SetStringPyExc_LookupErrorPyInit__codecs_krPyModule_Create2PyModule_AddObject__stack_chk_fail_edata__bss_start_endGLIBC_2.4GLIBC_2.2.5vii
�ui	���!�B��!@B��!��!��!�D��!@�!��!lD��!@�!��!�D�!@�!�!�D �!eD8�!�1P�! >h�!lD��!�3��!�;��!@D��!�5��!�7��!�DP�!��`�!�p�!����!���!����!���!����!���!����!����!x��!��!p� �!�0�!h�@�!�P�!`�`�!ܞp�!X���!ԡ��!P���!̤��!H���!ħ��!@���!����!8��!���!0� �!��0�!(�@�!��P�! �`�!�p�!����!`���! ���!���!����!`���! ���!���!���!`��! � �!�0�!��@�!`�P�! �`�!�p�!����!`���! ���!����!����!`���! ���!����!���!`��! � �!��0�!��@�!`�P�! �`�!��p�!����!`���! ���!��P�!E`�!�Ep�!JF��!G��!�G��!rH��!�H��!�I��!TJ��!K��!�K�!bL@�!MP�!�M`�!|Np�!8O��!�O��!�P��!lQ��!(R��!�R��!�S��!\T��!U�!�U�!�V �!LW0�!X@�!�XP�!�Y`�!<Zp�!�Z��!�[��!p\��!,]��!�]��!�^��!`_��!`�!�`�!�a �!Pb0�!c@�!�cP�!�d`�!@ep�!�e��!�f��!tg��!0h��!�h��!�i��!dj��! k��!�k�!�l�!Tm �!n0�!�n@�!�oP�!Dp`�!qp�!�q��!xr��!4s��!�s��!�t��!hu��!$v��!�v��!�w�!Xx�!y �!�y0�!�z@�!H{P�!|`�!�|p�!|}��!8~��!�~��!���!l���!(���!���!����!\��!��!Ԅ@�! �P�!��`�!��p�!����!*�@�!��P�!��`�!��p�!����!����!���!��@"x�P"f�`""�p""� "��0"��@"��P"��`"��p"���"���"���"���"z��"n��"j��"L��"�"
�"� "�0"�@"�P"�`"�p"��"�
�"��"��"��"��"T�"T�"H""� "�0"�@"�!P"�#`"�%p"�'�"z)�"h+�"`-�"^/�"D1�"83�".5�".7"�8"�: "�<0"�=@"�?P"~A`"xCp"lE�"fG�"ZI�"8K�"2M�"0O�""Q�"S�"U":V"�W "�Y0"�[@"�]P"�_`"lap"Lc�"2e�"*f�"g�"�h�"�j�"�l�"�n�"�p"4r"t "�u0"�w"�x"�z "�|0"�~@"΀P"΂`"΄p"Ά�"Έ�"Ί�"Ό�"Ύ�"ΐ�"Β�"Δ�"Ζ	"Θ	"Κ 	"Μ0	"Ξ@	"ΠP	"΢`	"Τp	"Φ�	"Ψ�	"Ϊ�	"ά�	"ή�	"ΰ�	"β�	"δ�	"ζ
"θ
"κ 
"μ0
"ξ@
"�P
"��`
"��p
"���
"���
"���
"���
"���"��"�0
".�"�D"�@"�Dh"�D�""�"�"�"�"�"	�"
X"`"h"p"x"	�"�"�"
�"�"�"�"�"��H��H�)�!H��t��H����5��!�%��!��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!�������%��!D���%��!D���%��!D���%��!D���%��!D���%��!D���%��!D���%��!D���%}�!D���%u�!D���%m�!D���%e�!D���%]�!DH�H���M�(I��M�(H�M9���B�i�ƒ�wGH���H���X	H��~�H�H���M�(I��M�(H�M9���B����v�=����H�������H��L�L�L�\$�M��tqD�ZD��E9�rm�R	A9�wxE)�L�\$�C�kf���tyf��x~��L��ʀH��f���ȀA�L�.A�UI�H���A���f����"���H�������w�p�k��c��Y��OH����L�.1�H��A�E�L�D��T��A�C�H�A�L�@�D��A��L��DA�CH�H�PH�1��@�D��A��A��1�A��A��H�B��BL�H���F�,*A�C�H�D�hI�H���H���H�(H��@�uI�0H��I�0H�I9��
�4q��wHH���H���C	H��~�L�H��A�3I�0H��I�0H�I9����4���vҁ�����H����A��A��I��I�M�M����A�j@��9�r~E�R	D9���)�A�4sf�������L�f���̀A�+L�f��x�΀A�rI�0H��H��I�0H�L9����y���U�������H���d��Z��P�I�D��<��2��(H�H���M�0I��M�0H�M9���B�q�ƒ�wHH���H����	H��~�L�H��A�M�0I��M�0H�M9��IB����v�=���DH����D��T��A���+��D��A�1�D�\$�A��A�A��1�A��F�43��1�D�\�D$�A��A��E	�L�O�E�A��
E	�fA���H�E��H��fA��D�0H�D�ZI�H��4A���G�������H����D�����A��2wG�t뮉��H��L�L�2M��t_D�Z��D9�rf�R	9�whD)�E�4FfA���tcD��f��D�X�A��v�P���3��E�^�A��]vF��t�m�h��`��V��L��B��8��vf��Iw�����f����؃�^D�L�6D�X�A��P"A��Mw�PH�H���PI�H�������!��A��t
A��i
A��^
@�����L�3�H��C�4*��1� �������I������&
@���t.H�
?�H���4��1���������A���	�0H�����������D�h_A��2��A���	A��	��1��
H���H��B�4��1�{������<�V���A��}	H������
��
��
�z��
I�����z����z����z����BA�D�@_A��w-�L�
ѣH�E�D�Z�BA�SA����E��fA��<���fA����1�E��E��Ei�LEk�A��8�H��D��������H����������|��rH������f��\��R��H��>�H_��w--�H�5բH��<fA��t
f���I�����	����I�I����H������/H�
G�!H�5HE1�H�9�����E1��H�A�!H�5�E1�H�:�w����H��[]A\A]A^A_�����f.����AWA��A�AVA�AUATL�%>�!UH�-�SH�t$8H��H�|$@M�(M9���A������H�����DB�)A�Ń������H���9���H�H��D�(M�M�kM�(H�M9�}{H���H��t-B�D���?���L�.H��A�EM�(I��M�(H�M9�}>B�)A�Ã�����H�H��D�M�(I��M�(H�M9���ff.��1�[]A\A]A^A_�B�D����L�H��A�M�(I�EI�H�L9�}�B�D)����H�>�M�(H�z�I�EI�H�L9�}�B�D)��w]H�>�M�(H�z�I��M�(H�M9��n���B�)��w=H�������L�.H�W�H��A�EM�I�CI�H�L9��F����1��������
�����������ff.�f���I�0USH�D$H�|$ L9���H�=�!���;���I��A���?�41A�������H���D���H�0H��D�I�(H�uI�0H�L9�}qI����I��t+�t)���L���L�H��A�2I�0H��I�0H�L9�}6�41����� ���H�0H��@�.I�0H��I�0H�L9���fD1�[]�ff.��t)������H�(H��@�uM�I�sI�0H�L9�}�B�t�������H�8@�7M�I�z�I�sI�0H�L9�}�B�t�������H�8@�7M�I�z�I�sI�0H�L9��h����41���T���H������L�A�2I�(L�W�L��H�uI�0H�L9��>����)���f���AWA��A�LAVAUL�-��!ATL�%=�UH�-՟SH�t$8H���H�|$@M�0M9���A�������H�����CB�1A�ƃ������H�������H�H��D�0M�M�sM�0H�M9�}zH���H��t,B�D�������L�6H��A�M�0I��M�0H�M9�}>B�1A�Ã������H�H��D�M�0I��M�0H�M9���ff.��1�[]A\A]A^A_�B�D����L�H��A�M�0I�FI�H�L9�}�B�D1����H�>�M�0H�z�I�FI�H�L9�}�B�D1��w\H�>�M�0H�z�I��M�0H�M9��n���B�1��wAH���v���L�6H�W�H��A�M�I�CI�H�L9��G����2�������������|���ff.���AWAVAUATUSH��H����I��I��L�5�L��I�<$�7@����M�o�L����H���M���-���I�$M��H�xI�<$�p@��xmH����H��t)H����������I�$I��H�zI�<$�r@��x4H����������I�$I��H�yI�<$�q@�����I�����G@�����A����D����A����L��H�
�A��A	�A�<G�.A��B�4A���@��@���A��D��0@����&A����2@������E��@��Ai�LDk����@����.A�@��H��D���������I�$I���q���H��L��[]A\A]A^A_�@H������������M�$I��I�xI�<$A�p@�����H�������z���M�$M�}�I�yI�<$A�q@�������H���l����L���M�$M�}�I�zI�<$A�r@�������H���>�������I�4$M�o�M��H�~I�<$M���4����v@���=����H���@���A��@���@��A���<0���P������������h�@�������D�D6i@�����<�������C<]@��E�L0!�+��=E��H�=��!I��I�M�M����A�j@8����A8B	����)�H�A�4C�������H���?�����I��I�$M��������:���A��/���A��$���@������@����a�A�����D�D6N�-���D�H�������y���A�����I���������E1�����ff.���H���jAWI��AVAUL�-��!ATUL��SH��H��H��2@���UM�w�M��A���H���M������H�M��H�PH��p@���I����I��t+H���������H�I��H�QH��q@����H��������}�H�3I��H�VH��v@�����H�������M�L�I��I�PH�A�p@����H�������!�L�M�~�I�QH�A�q@��x[H���d������L�M�~�I�RH�A�r@��x3H���<������H�;M�w�M��H�WH�M��t�w@���Q���I����D�^�E��I��M�M�4$M��ta�BA�|$���@8�rOA:D$	wH��)�Lc�G�FA����t2D��H�������J�H�I���*���1�H��[]A\A]A^A_�H��L���!I�I�2H��t?�RE�ZD8���A:R	w ��D)�H��4F����u�����뜸�H������1��fD��AWI��AVAUATI��UH�-�!SL��H��M���3I��2@����M�l$�M��A����H��������=�I�M��H�PI��p@��xnI���xI��t'H��������I�I��H�QI��q@��x7H���o������I�7I��H�VI��v@��� ff.��I���k@������D�^�E��I��I�I�H���!�BA�v���@8����A:F	�����)�Lc�B�4i�����h�H��������B�I�I������1���@H��������M�I��I�PI�A�p@���D���H���|������M�M�e�I�QI�A�q@������H���P������M�M�e�I�RI�A�r@�����H���$������I�?M�l$�M��H�WI�M��t)�w@���H�������H��[]A\A]A^A_�H��1�[]A\A]A^A_�H�������1���ff.���ATUSH�F������H����H��H�����H�-��!H����H��H�=��$���t?H��H�=�����ttL�%��!H�=?H������tI��HI�<$�?u���L�%��!1�H�5_L����H��H��t1�1�H��H���b�H�+I��uH����L��[]A\�L�%��!�H�=��$�H��H����H�5�H���I�H�mH�
�!���H�-�!H������������f.�H�=��!H���!H9�tH���!H��t	�����H�=��!H�5��!H)�H��H��H��?H�H�tH���!H��t��fD�����=]�!u+UH�=��!H��tH�=>�!�i��d����5�!]������w������AW��H�=��!AVAUATUSH��dH�%(H��$1��W�I��H���E1�H�l$�<1�H��H��H�T$1�H�__map_I��H�ksx1001H�$D���H�t$H�=��!H�5j��L��L��H���Y�����D��H��H��E1��1�H�57L�L$I�__map_H�=k�!L�$�D$cp94fA�D$
9�:�L��L��H������tYD��H��H��E1��1�H�5�L�\$I�__map_H�=*�!I�cp949extL�$M�t$A�D$���L��L��H����H��$dH3%(L���������H��H���johab_multibytecodec__create_codeceuc_krcp949no such codec is supported.multibytecodec.__map_*ksx1001cp949extgetcodec_codecs_krencoding name must be a string.000�% & �0� %"<�<"    000	0
000
00000���`"d"e""4"�2 3 !+!���B&@& "�"#""a"R"�; &&�%�%�%�%�%�%�%�%�%�%�%�!�!�!�!�!0j"k""=""5"+","""�"�"�"�"*")"'"("��!�!""�^�����������."""�	!0 �%�%�%�%d&`&a&e&g&c&�"�%�%�%�%�%�%�%�%�%�%�%h&&&&&�  ! �!�!�!�!�!m&i&j&l&22!�3"!�3�3!!� ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;��=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]��112131415161718191:1;1<1=1>1?1@1A1B1C1D1E1F1G1H1I1J1K1L1M1N1O1P1Q1R1S1T1U1V1W1X1Y1Z1[1\1]1^1_1`1a1b1c1d1e1f1g1h1i1j1k1l1m1n1o1p1q1r1s1t1u1v1w1x1y1z1{1|1}1~11�1�1�1�1�1�1�1�1�1�1�1�1�1�1�1p!q!r!s!t!u!v!w!x!y!����������`!a!b!c!d!e!f!g!h!i!������������������������������������������������������������������������������%%%%%%%,%$%4%<%%%%%%%#%3%+%;%K% %/%(%7%?%%0%%%8%B%%%%%%%%
%%%!%"%&%'%)%*%-%.%1%2%5%6%9%:%=%>%@%A%C%D%E%F%G%H%I%J%�3�3�3!�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3&!�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3�3���&��2��?A�R��fJ��`2a2b2c2d2e2f2g2h2i2j2k2l2m2n2o2p2q2r2s2t2u2v2w2x2y2z2{2�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$`$a$b$c$d$e$f$g$h$i$j$k$l$m$n$�S!T!��[!\!]!^!��'138@B�S��gKI222222222	2
222
222222222222222�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$�$t$u$v$w$x$y$z${$|$}$~$$�$�$�$���t  � � � � A0B0C0D0E0F0G0H0I0J0K0L0M0N0O0P0Q0R0S0T0U0V0W0X0Y0Z0[0\0]0^0_0`0a0b0c0d0e0f0g0h0i0j0k0l0m0n0o0p0q0r0s0t0u0v0w0x0y0z0{0|0}0~00�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0 !"#$%&'()*+,-./������������������������������012345Q6789:;<=>?@ABCDEFGHIJKLMNO�����	�
�������������� �$�,�-�/�0�1�8�9�<�@�K�M�T�X�\�p�q�t�w�x�z�����������������������������������������������������������ĬȬ̬լ׬���������������������
����� �)�,�-�4�5�8�<�D�E�G�I�P�T�X�a�c�l�m�p�s�t�u�v�{�|�}��������������������������ĭȭЭѭӭܭ������������	��
��0�1�4�7�8�:�@�A�C�E�F�J�L�M�N�P�T�V�\�]�_�`�a�e�h�i�l�p�x�y�{�|�}���������������Į̮ͮϮЮѮخٮܮ��������
��,�-�0�2�4�<�=�?�A�B�C�H�I�P�\�]�d�e�y�����������������������ǯȯɯ˯ͯίԯܯ�������������(�D�E�H�J�L�N�S�T�U�W�Y�]�|�}�������������������������������������������������������İŰǰȰɰаѰ԰ذ���	�����������#�$�%�(�,�4�5�7�8�9�@�A�D�H�P�Q�T�U�X�\�`�x�y�|�������������������������̱бԱܱݱ߱����������������� �4�<�X�\�`�h�i�t�u�|�������������������������������������Ȳɲ̲вҲزٲ۲ݲ����������������������������������T�U�V�X�[�\�^�_�d�e�g�i�k�n�p�q�t�x�������������������������ijųȳ˳̳γгԳճ׳ٳ۳ݳ������� �(�)�+�4�P�Q�T�X�`�a�c�e�l���������������������Ĵȴдմܴݴ�������������$�%�'�(�)�*�0�1�4�8�@�A�C�D�E�K�L�M�P�T�\�]�_�`�a�������������������������������ĵ̵͵ϵеѵص�����%�,�4�H�d�h���������������Զ�����(�)�,�/�0�8�9�;�D�H�L�T�U�`�d�h�p�q�s�u�|�}���������������������������������������������Ƿɷ������������	�������$�%�(�,�4�5�7�8�9�@�D�Q�S�\�]�`�d�l�m�o�q�x�|���������������øŸ̸иԸݸ߸������������� �<�=�@�D�L�O�Q�X�Y�\�`�h�i�k�m�t�u�x�|�������������������������������ȹɹ̹ιϹйѹҹعٹ۹ݹ޹�������������������8�9�<�@�B�H�I�K�M�N�S�T�U�X�\�d�e�g�h�i�p�q�t�x�������������������������������ĺȺغٺ����
����� �)�+�4�5�6�8�;�<�=�>�D�E�G�I�M�O�P�T�X�a�c�l�������������������ĻȻлӻ�����������	���
�������������$�%�'�)�-�0�1�4�8�@�A�C�D�E�I�L�M�P�]�������������������������������������������������ļͼϼмѼռؼܼ����������	���$�,�@�H�I�L�P�X�Y�d�h�����������������������������������Խսؽܽ�������
������D�E�H�L�N�T�U�W�Y�Z�[�`�a�d�h�j�p�q�s�t�u�{�|�}���������������������оѾԾ׾ؾ�������	������@�A�D�H�P�Q�U�����ſ̿ͿпԿܿ߿�<�Q�X�\�`�h�i����������������������������������������������������������������������� �#�$�&�'�,�-�/�0�1�6�8�9�<�@�H�I�K�L�M�T�U�X�\�d�e�g�h�i�p�t�x����������������������������������������������������
������� �(�)�+�-�/�1�2�4�H�P�Q�T�X�`�e�l�m�p�t�|�}�ˆ‰˜›¤¥¨¬­´µ·¹����������������������������	��
������$�%�(�)�E�h�i�l�p�r�x�y�|�}ÄÈÌ��������������������������$�,�0�4�<�=�H�d�e�h�l�t�u�yĀĔĜĸļ������������������(�)�,�0�8�9�;�=�D�E�H�I�J�L�M�N�S�T�U�W�X�Y�]�^�`�a�d�h�p�q�s�t�u�|�}ŀńŇŌōŏőŕŗŘŜŠũŴŵŸŹŻżŽž���������������������������������������������������������������$�%�(�,�-�.�0�3�4�5�7�9�;�@�A�D�H�P�Q�S�T�U�\�]�`�l�o�q�x�y�|ƀƈƉƋƍƔƕƘƜƤƥƧƩưƱƴƸƹƺ������������������������������������������ �!�$�(�0�1�3�5�7�<�=�@�D�J�L�M�O�Q�R�S�T�U�V�W�X�\�`�h�k�t�u�x�|�}�~ǃDŽDžLJLjljNJǎǐǑǔǖǗǘǚǠǡǣǤǥǦǬǭǰǴǼǽǿ���������������������������
�������� �$�,�-�/�1�8�<�@�H�I�L�M�T�p�q�t�x�zȀȁȃȅȆȇȋȌȍȔȝȟȡȨȼȽ�����������������������������
����,�4�P�Q�T�X�`�a�c�l�p�t�|ɈɉɌɐɘəɛɝ����������������������������������������������������	���
���)�L�M�P�T�\�]�_�`�a�h�}ʄʘʼʽ���������������������������� �!�A�H�I�L�P�X�Y�]�d�x�y˜˸����������
�����!�"�'�(�)�,�.�0�8�9�;�<�=�>�D�E�H�L�T�U�W�X�Y�`�d�f�h�p�ų̴̵̸̘̙̜̠̩̫̬̭̼���������������������	�������$�(�,�9�\�`�d�l�m�o�q�x͈͔͕ͤͥͧͩ͘͜Ͱ���������������������� �!�$�(�0�1�3�5�X�Y�\�_�`�a�h�i�k�m�t�u�x�|΄΅·ΉΐΑΔΘΠΡΣΤΥάέ��������������������������� �$�,�-�/�0�1�8�T�U�X�\�d�e�g�i�p�q�t�xπυόϡϨϰ�����������������������-�4�5�8�<�D�E�G�I�P�T�X�`�l�m�p�t�|�}ЁФХШЬдезй��������������������������������������
�0�1�4�8�:�@�A�C�D�E�L�M�P�T�\�]�_�a�h�l�|фшѠѡѤѨѰѱѳѵѺѼ��������	��,�-�0�4�<�=�?�A�H�\�dҀҁ҄҈ҐґҕҜҠҤҬұҸҹҼҿ��������������������������������
�������� �!�%�(�)�,�0�8�9�;�<�=�D�E�|�}ӀӄӌӍӏӐӑӘәӜӠӨөӫӭӴӸӼ�������������������������������@�D�\�`�d�m�o�x�y�|�ԀԂԈԉԋԍԔԩ��������������������������<�=�@�D�L�M�O�Q�X�Y�\�`�e�h�i�k�m�t�u�x�|ՄՅՇՈՉՐե������������������������������������������ �$�-�8�9�<�@�E�H�I�K�M�Q�T�U�X�\�g�i�p�q�tփօ֌֍֐ְֹֻ֔֝֟֡֨֬���������������������������������� �(�)�+�-�4�5�8�<�D�G�I�P�Q�T�V�W�X�Y�`�a�c�e�i�l�p�t�|�}ׁ׈׉׌אטיכם�=OsOGP�P�R�SuT�T	V�Z�[�f�g�g�gLk�s�u<zۂ�W���6�Ȍύ���ՙ;RtSTj`da�k�s���҉���O
R�XxY�Yr^y^�a�cFg�gh�oNvw�xz�z!|��n�q�늓�kN�U�f4n�x�z[��N����RNW*XL]a�a!bbe�gDjnu�u�v�w:}��Q�R���#S�\2uۀ@���[RX�Y�\]�^:_J_wa_lzu�u�|s}�}�T�!���A����M�G��N�NP�QOX7a>aha9e�io�u�v�v�{��˄������U�[QW��|���(P�SE\�]�bnc�d�d n�p[yݍ��}�E���~N�NeP�]�^aWiq�T�G�u�+�^N�Ppg@h	Q�R�R�j�w�Ԟ�R/`�HP�a�c�d<h�j�o������X}r�ruy}m~����t�c�Q��bzlToP}:#�|QJa�{�W����N�OP�PQ�R�RSpW�X�^�_va�a�dleof�f�f�h�m�p�p�t�t�t�ulx�x�z�zE}�}�?����f�����8�Z���OSU:XQYc[F\�`bBh�h�h�nLuxv�x=z�|k~|~���?���ĝ�S�SJTqT�V�Yd[;\�^�b7eEere�f�g�i�l�u�v~w?z���������1��������.�ǖg�ؚ��T�e�f�h@z7�`��VdW]f�h�h�n(t���hl����OlQqQ�RT[�]P`m`�b�c;e�szz������2N�[b�g�t�yӃ�����N�K�F��^�i�����Q�[�[ca�h>kLp/t�t�{PŃ����ܕ(�.R]`�b��OIQ!S�X�^�f8m�p�r�sP{�[�fS�ckVN�PJX�X*`'a�b�iA��[}��_��N�P�T�U[�]�]*eNe!hKj�r�v�w^}���N�߆�N�ʐ�U���NEN]N�N�OwQ�R@S�S�S�TVuW�W�[�]�^�a�bQe�g�g�iPk�k�kBl�nxp�r�st�w�wvz}	����
�߂b�3��������d���ҙE��ם��W@\ʃ������T�z�و͎�XH\�c�z�[_yz�z����&P8R�RwSW�brc
k�m7w�SWsh�v�Օ:g�jpom�̎K��wfxk��<���S-WNY�c�i�sEx�z�z�|u���s�5����RGWGu`{̃��XjKQKR�Rb�hui���P�R�R�a�e9h�i~tK{��냲�9�яI�	��N�Y�df�j4t�y�y��~��_�
�&�O�S%`qbrl}f}�NbQ�w��OOvQ�Q�UhV;W�W�WYGY�Y�[�\]�]~^�_�b�e�egg^g�h�h_j:k#l}l�l�m�s&t*t�t�txuu�x�xAyGyHyzy�{}�}��-����O�H�w�!�$��Q���e����}vO	T�bThё�U:Q��Z�a
��b�b��������������������f�Vq��� �OczcWS!��g`isn"�7u#�$�%�
}&�'�r��VZ(�)�*�+�,�CN-�gQHY�g�.�sYt^�d�y�_l`�b{c�[�[�R/�tY)_`0�1�2�Yt3�4�5�6�7�8�љ9�:�;�<�=�>�?�@�A�B�C��oD�E������`F�G�f�H�I�?\J�K�L�M�N�O�P�Q��Z%�{g}R�S�T�U�V�W���X�Y�<\�l?S�nY6�9N�NFO�UW�XV_�e�e�j�kMn�w�z|�}ˆ��2�[��d�ozs�uT�VUMW�a�d�f�m[nmo�o�uC���A���NJZ���lSuT{�]�UXXXb^b�d�hvu�|����N�WnW'Y
\�\6^�_4b�d�s��������۞�[�_�`PR0RW5XWX\`\�\�]�^�_�`c�cdCh�h�j�m!n�n�o�q�vyw�y;z�����H���S���M�v�ܗ�kpXr�rhscw�y�{�~���X�`fe�e�f�lq�qZ��mN�z�N�Q�Q�RT�aqgPh�hm|o�u�w�z�c���\Q�e\g�g�u�zs�Z�F��-�o\����A�o�
��_�]Yj�q{vI{��'�0��U�a[�iv�?�������\�m�p�sa}=�]�j��^��NuSkk>pr-��LR��P]�d,ek�oC|�~ͅd����b؁��^gjm�rtot��ސ�O
]�_
��Q�ceu�NPiQ�Q�hj�|�|�|o�Ҋ�ϑ�O7Q�RBT�^na>b�e�j�o*y܅#���b�j���Ξ�R�fwkp+yb�B��ab#e#oIq�t�}o��&�#�J��QR�Rm�pˆ�^�e�k�o>|us�N6O�V_��\�]`�s-{��F��4���H��a��O�o�y�����R`��d�d�j^opr�v��\���2�o���u��xy�}Ƀ����֊�X_'g'p�t`|~�!Q(pbr�xŒڌ��N�P�[�^�e�qBv�wJ���|�'����XAZb\j�mo;v/}7~�8��K��R�e�g�iAm�np	t`tYu$vkx,�^�mQ.bx��O+P]�m�}*��_Daha����R���Q�Q^iz�}�u��O)R�STUe\�`Ng�hlm�r�rt�tb��ul|y���ψ�̑Б�ɛT~o�q�t������W����g�m3t��,x�z {�|idjt�u�x�x��T����[U^ o������NMS)Z�]N_ba=cif�f�n+ocp�w,��;��E�;�U�b+g�l	�j�z��N�Y�_�_g�}T��+�������W�Y�Z�['f�g�h�kdqu��㌁�E����L�@���_[ls�v�v��Q��MQ�Q�R�h�lw w�}�}b����n��Q
T}Tf�f'i�n�v�w�„��i�����O�Q�R�Y=^Uaxdyd�f�g!j�k�k_rarAt8w�w�����(���(g�lgr�vfwFz��k�l"Y&g��oS�X�Y�^�c4fsg:n+s�zׂ(��R�]�a�a
b�b�d�eYifk�k!q�s]uF~��j�����'�a��X؞PR;TOU�evl
}}^������R�lirsT�Z>\K]L_�_*g�hci<nDn	ws|������a��\�`
a�aOe�e�el�l�s�s�}���[��]RZS�bd�d4g8j�l�s�t�{�|~��6�������4OJS�S�S�b,de�e�i�lXo�sTu"v�v�v�x�x,yF},��ԏ���R�b�d$nQo|vˍ��b��C�#P�PJW�Y(\G^w_?b>e�e�e	f�g�i�n�x!}����+�������*����2���
P�Oc��W�_�b�cogCnq�v̀ڀ���)�M�j�/OpO^�g"h}v~vD�a^
jiq�qjud�A~C��ܘOO{p���Q^�h>lNl�l�r�{��l:t�P�R�X�d�j�tVv�x��9�e�^S_��������%R�wI��NPuQ[\w^f:f�g�h�pu�u�y�z'� ���O!X1X�[nfekmzn}o�s+u�܈�\��O�PS\S�[�_
g�yy�/�����9�;����,gvN�OIY\�\�\gc�h�p�q+t+~��"�Ғ�
N�N�O�PVRoR&T�T�W+YfZZ[u[�[�^f�vbwe�enm�n6r&{?|6P�Q���@����������t����ܑ�D�ٙ�SR)TtV�XTYnY�_�anbf~lq�v�|�|}�����g�[O__�b)]g�h|xC~l�N�PS*SQS�YbZ�^�`�aIbyb�e�g�i�k�k�k�k�lh�5t�ux�x�y�y�|�}���>���船�l����^�ۘ;��V*[l_�e�j�k\m�op]r�s��ӌ;��a7lX��MN�N�N�N:O<OO�O�P�S�SU�U�V�XbYZ�[�[\�]+^�_`hc�e�e�g�g�h{k�l�l#n	pEsx>y@y`y�y�{}r}��
���фdž߈P�^��܌f�������ߙ��JRi�gj��P*Rq\ceUl�s#u�u�{��x�0�wN�d�k^q��	Nk�Ig�hn���k��c�o���
N�P�PQFU�UV@[\�\8^�^�^�^�`QhajXn=r@r�r�vey�{���s�a�ތ�^X�t���Ul�az"}r�rru%um�{�X�X�]�^�^�_U`�bcMe�f�f�fh�h�r^tn{n}�}r���������͞ �YmY-^�`fsf�gPl�m_o�w�xƄˑ+��N�PHQ�U[�[Gb~e�e2n}qtDt�t�tlv�y�}U~�z���9���u��x���%�M���hSQ\Ti�l)m+n���;�-����g�aR�f�k�~��
���]�e�m�qn��W�Y�['`�`bf_f)s�s�vwl{V�r�e�����N�Rrkmz9{0}o����S/VQX�[\\�]@b�cd-f�h�l�m�np�p�q&u�u�uv{�{+| }9},�m��4�
�a�������7��Ol\_g�m�|�~���k[�]
d��\�ᘇs�[�`~g�m�����7Rp�Qp�x��p�ב�O�S�U�V�W�X�Z�[�\�\%^a
bKb�cd6exe9j�k4lm1o�q�rxst�t&vaw�yWz�z�|�}�}a~�)�1���ڄꅖ�����8�B���l�����������֖����Ӛ��S~XYp[�[�mZo�q!t�t�����]�_�_B`�ehoiSj�k5m�m�s�v�wM{}#��@��c�b�Ċ������bS��e�]']i]_t��h��o�b�6�r�NXN�P�RGSbfi~�^��OS6V�Y�Z8\N\M\^_C`�e/fBf�g�gs�w:y���̈́��f�i��U�z��W�[_o`�b
i�k\n�q�{U�X���ߘ��8O�O�O{T Z�[<a�ehf�q3u^y3}N�じ���΅�
�����q�ŏ1Y�[�[�`�[\�_�lr��mpu�����NASs�ٖl�N�ORQ^U%Z�\bYr������Y��?�Ŗ�	�]�
X�\�]D^�`a�cj%n�T�N��w��[�\	cOfHh<w����T����e�ˎ��5U�\�]�^�fLv�Ǖ�X�b�r(��N.Y`;f�k�y&��S�T�W]a�f�m�x~���D��S|b�c�m
~K�M��jL���_N;P�QY�`�c0i:r6�t�Α1_u�v�}�o���免�w�oOx�y��XC[Y`�ceme�fz�Ji#jmplq�u
v�ypz{��|�D�}�����}�~�
�W�_�eov�y����Z�l�Q�a�b�jƁCP0Xf_	q���|[��O<Q�VDY�c�m�]mi�Q�NYO������Y����_k]l���ty���E�9�?�]�����������N���Wy_f�����uy~o����[��V'X�YZ�[���^����Pc;c��=i�l�l�m�m�mo���p6qYq���q�q��Oxox��u{�}��/~��M�ߎ������[������������`�m���q�������S�������g���p0q0tv�҂�����}��f���qI�����KX�����]q_�� f�fyi�i8l�l6nAo�op/pPq�qps��[t���t�vNz�~�����`�Ώ��H��������BN*P��R�S�fml�o
swbz��݅���Ԉc�}�k����������N
O�O�PHS>T3T�UbX�XgYZ�[�`���aVe�edf�hZl�o�p�qRs}{���2��K\�lDs�s:��netviz~
�@Q�X�d�tupv���͖T�&n�t�z�z�نx��IZ�[�[�hicm�st,t�x�}��U���L�.���f�_�e�gjl�s-PZjk�wYl]�]%sOu�����P�Q/X-Y�Y�Y�[�����]�bd�d�d���f��Hj���qdt���z�zG~^~�p��� �Y����R�~a2ktm~%����O�P�Q�R�W�X�[�^Ba�i�mgn�n�qbt(u,us�8�Ʉ
���ޓ��NQOvP*Q�S�S�S�[�[$\a�a�e[r�s@t�vPy�y�y}���Յ^�G���ꑅ����Rg_�e1f/h\q6z��
��N�Rj�k�o�q���S�K�����1��N�qĖCQ�S�TWW�W�Z�Z�[(`?a�c�l9mrn�n0r?sWtт��E�`��b�X��g��^�MOIP�PqS
W�YZ	\pa�f-n2rKt�}À�f�?�_�[���U�˗O�sN�OQjQ�/U�Uz[�[|^}^�^�`�`a	a�c8e	g��g�g�aibi�l'm�8n��o6s7s�\t1u�Rv���}��8�Ո��ۊ�0�B�J�>�z�I�ɑn���	X��k������AQkY9\��do�s�����������bph}����Wi`Ga�k������YNT�m-�p����c�l���Q�a�����OPQ�[a�a�di�k�u�w�d�����c���p����N�N
O��7Y�Y��]_[_!`����>r�s�pu�u�y��3����Q��������������7p�v�����N�NRpS�T�V�Y�[_�_nn��j}5�����m�w���NZO~O�X�e�n8������N�X�Y�YA`�z��O�ÌeQDS�������NiRU[���N:R�T�Y�YP[W[\[c`Ha�n�pnq�s�t�u�x+}��(��Ʌ�nj̖\O�R�V�e(f|p�p5r�}��L���r�q[�h�kzo�v�\�f[o�{*|6�ܖN�N S4X�X�XlY\3^�^5_�c�fVgj�jk?oFr��Ps�t�z�|x�߁灊�l�#���υ݈���w����Q�T(W�[MbPg=h�h=n�n}p!~����	�K�N�-r�{͊�GONO2Q�T�Y�^�bugnij�ln�r*s�u�{5}��W���[��������Ζ_��R
T�Z�[Xdue�n�r���vMz{M|>~�{�+�ʌd��_���i�ѓCOzO�PhQxQMRjRaX|X`Y\U\�^�`0bh�kl�oNq t0u8uQurvL{�{�{�{�~n�>�I�?���"�+���Z�k��R*b�bYmdv�z�{v}`S�\�^8o�p�|���ޞ�czdv�N�N�N\PuPHT�Y�[@^�^�^�_�`:c?ete�evfxf�ghi�jck@l�m�mn^np�p�s�s:u[w�x�yz}z�|�}G��ꊞ�-�J�ؑf�̒ ��V�\���6R�R|U$X^_�`�c�h�omy,{́������D���d���=�L�J��OFQ�Q�R2V_k_�c�d�eAf�f�fg�h�h�ionogq�q*r�t:wVyZy�y z�z�|�|D}p~������T������� �m��;�Ֆ��e|��ÓX[
\RS�bs'P�[�_�`ka�h�m.t.zB}�}1~k�*�5�~��POPW�]�^+cj;NOO�OZP�YĀjThT�UOY�[�]�^]f1g�g*h�l2mJn�o�p�s�uL|},}�}�ۆ;���p���3�1�N�R�D�Й�z�|�OQ�Q�W�[�\Yf=jZm�n�oqou�z"�!�u�˖���-N�NF�͑}S�jkiAlz��X�a�f�b�pu�uR~��I��KN�S�T0W@W�_ccod/e�ezf�g�gbk`l�l,o�w%xIyWy}���󁝂����������r��vz7zT~w�U�UuX/c"dIfKfmh�i�k%m�n�sht�t[u�u�vw�w�y	~~��/���:�ь뎰�2���c�s���O�S�Y�Z^Nh�t�u�y�z����̍폟eg���WWo�}/���Ɩ�_�a�oN�OP�S�Uo]�]!kdk�x�{��I�ʎn�Ic>d@w�z/��j��d�o�q�t�t�z|�~�|�~��
�}��L�9R�[�d-g.}�P�SyXXaYa�a�e�z����	P!PuR1U<Z�^p_4a^ef6f�f�i�n2os!v�z9�Y�փ���P�W�[�[i_�c&x�}܃!�Ǒ���Q�gV{���Q�Y�`U�P��TR:\}ab�b�d�e�n v
�`�_����NCS�U)Y�]�d�l�m�sz�����w���!�Ɨ�Q�T�U�_�d�o�}�M�5��P\�l�mu�w=|d|y�ŠX�Y^wcRr�ukw܊����^tf�m}���ˊQ�֛�CR�f�m�n�}�.�^�ԚRR�T�a�b�b�hiZi5j�p&q]xyy�y
z��x�ՂI�I�����b������O�V�q�w����[�_Qg���SZX�[�`�a`d=~p�%����d�P]g�X�b�cixijkn�v�y��)�ϊ�����K�������ۖ6�
�N\u]y�zQ{�{.~ĄY�t����%f?iCt�Q.gܞEQ�_�l�]�w��`�����S9T4V6Z1\�p�Z��큣���_��tP�N�S�`,nd\�O$P�U�\_^e`�h�l�m�q�u�uavzIz�}�}n􁩆�ɖ��R�GR�R혪�N�go�O�[�g�lxmt'xݑ|�ć�y1z�_�N�T>U�X�Y�`Sb�b6gUi5�@���ݙ,PSSDU|W�Xb��dkf�g�o�o"t8t�8�QTVfWH_�aNkXp�p�}��jY+��cw=���TX-d�i�[^on�i�LQ�S*Y `Ka�kpl�l{΀Ԃƍ������d�o�deNQTW�_avh��uR{q}�X�i�*��9�xPWY�Y�b�*�]ayr֕aWFZ�]�b�d�dwg�l>m,r6t4xw��ۍ�$RBWgHr�t�����*�kQ�SLciOU�`We�lmLr�rz����m_�o�p��a�OOPAbGr�{�}�M������jWs^�g
�U� T[c^�^
_�e��=���[�HOS
SS�T�TW^`�b�bUc��lfm�u2xހ/�ނa�����������E^�f�fpr��O}Rj_SaSgjo�thyh�y�ǘĘC��TzSi��J�����|_�b�u�v���B�9S<_�_�l�sbu�uF{����ON<�NUO�SY�^0f�lUtw�f���P����Xx[P�����[h`�`�eWl"o�opU�����P�ӗrRD��Q+T�TcU�U�j�m�}f���w�y�T�T�v䆤�ԕ\��N	O�Y�Z�]R`�bmgAh�l/n8��*��	���NUP�T�WZYi[�[�awiwm#p���r�犂�홸��R8hPx^OgG�L��NT�V�s���	�W���SV�X[�1��a�j{sҎGk��W�UYrk�i��O�\&_�a[f�l�p�s�s�s)wMwC}b}#~7�R�
��I�o�Q[tz@���Z�OTS>Y�\>cym�r����ϒ0��NDQR�Wb_�l�npPp�p�q�sitJ���a��������nQW_�`ga�fY�J�����NN�N|T�X�X}Y�\'_6bHb
fgf�kim�mVn�n�o�o�o]p�r%tZt�t�v\y�|~ဦ�k���N�_�t�w�j����e��`bw�ZZf�m>n?tB��_�`{�T_^l�l*m�p}y��;�S�T[:jkpuu�y�y���q�A���t���d+e�x�xkz8N�UPY�[{^�`�cakefShneq�t}��i�%�;m�n>sA�ʕ�QL^�_M`�`0aLaCfDf�i�l_n�nboLq�t�v�{'|R�W�Q���Þ/S�V�^�_b`�`�affg�j�m�oppjsj~��4�Ԇ��Č�Rrs�[kj��T�V][He�e�f�h�m�m;r��u�M��OP�ST<T�U�U?^�_=gfq�s��R�RdX�Xq�q�q����f���U�fJq1�IS�U�kY_�_�c�fGq����O:d�pfug�d`N���GQ�QS6m��ўf#k�p�uTy\}� k=kFk8Tp`=m���P�Q�UkV�V�Y	[^�a�a1b^f�f�q�q�q�r�yz�p�������
������!�"�#�%�&�'�(�)�*�+�.�2�3�4�������������5�6�7�:�;�=�>�?�A�B�C�D�E�F�G�H�I�J�L�N�O�P�Q�R�S�U�������������V�W�Y�Z�[�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�r�s�u�v�y�{�|�}�~����������������������������������������������������������������������������¬ìŬƬǬɬʬˬͬάϬЬѬҬӬԬ֬ج٬ڬ۬ܬݬެ߬����������������������������	�
����������������!�"�#�$�%�&�'�(�*�+�.�/�0�1�2�3�������������6�7�9�:�;�=�>�?�@�A�B�C�F�H�J�K�L�M�N�O�Q�R�S�U�V�W�������������Y�Z�[�\�]�^�_�`�b�d�e�f�g�h�i�j�k�n�o�q�r�w�x�y�z�~�������������������������������������������������������������������������������������������������������������­íŭƭǭɭʭ˭̭ͭέϭҭԭխ֭׭ح٭ڭۭݭޭ߭�������������������������������������
������������������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�2�3�5�6�9�;�<�������������=�>�?�B�D�G�H�I�K�O�Q�R�S�U�W�X�Y�Z�[�^�b�c�d�f�g�j�k�m�n�o�q�r�s�t�u�v�w�z�~������������������������������������������������������������������������������������������������������������������������®îŮƮǮȮɮʮˮήҮӮԮծ֮׮ڮۮݮޮ߮����������������������������������������������������	�
�������������������� �!�"�#�������������$�%�&�'�(�)�*�+�.�/�1�3�5�6�7�8�9�:�;�>�@�D�E�F�G�J�K�L�M�N�O�Q�R�S�T�U�V�W�X�Y�Z�[�^�_�`�a�b�c�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�z�{�|�}�~����������������������������������������������������������������������������������������������������������������¯ïįůƯʯ̯ϯЯѯүӯկ֯ׯدٯگۯݯޯ߯���������������������������������������������������������������	�
��
��������������� �!�"�#�$�%�&�'�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�F�G�I�K�M�O�P�Q�R�V�X�Z�[�\�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�~��������������������������������������������������������������������������������°ðưʰ˰̰ͰΰϰҰ������������Ӱհְװٰڰ۰ܰݰް߰���������������������������������������������������������
�
����������� �!�"�&�'�)�*�+�-�.�/�0�1�2�3�6�:�;�<�=�>�?�B�C�E�F�G�I�J�K�L�M�N�O�R�S�V�W�Y�Z�[�]�^�_�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�z�{�}�~��������������������������������������������������������������������������������������������������������������������������±ñıűƱDZȱɱʱ˱ͱαϱѱұӱձ������������ֱױرٱڱ۱ޱ�������������������������������������	�
�
���������������!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�5�6�7�8�9�:�;�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�Y�Z�[�]�^�_�a�b�c�d�e�f�g�j�k�l�m�n�o�p�q�r�s�v�w�x�y�z�{�}�~��������������������������������������������������������������������������������������������������������������������������²òIJŲƲDzʲ˲ͲβϲѲӲԲղֲײڲܲ޲߲��������������������	�
���
������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�W�Y�Z�]�`�a�b�c�f�h�j�l�m�o�r�s�u�v�w�y�z�{�|�}�~��������������������������������������������������������������������������������������������������������������������������������������³óƳdzɳʳͳϳѳҳӳֳسڳܳ޳߳���������������������������������������������	�
���
����������������!�"�#�$�%�&�'�*�,�-�.�/�0�1�2�3�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�R�S�U�V�W�Y�Z�[�\�]�^�_�b�d�f�������������g�h�i�j�k�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~������������������������������������������������������������������������������������������������������������������������������´ôŴƴǴɴʴ˴̴ʹδϴѴҴӴԴִ״شٴڴ۴޴ߴ����������������������������������������	�
���
�������������� �!�"�#�&�+�,�-�.�/�2�3�5�6�7�9�:�;�<�=�>�?�B�F�������������G�H�I�J�N�O�Q�R�S�U�V�W�X�Y�Z�[�^�b�c�d�e�f�g�h�i�j�������������k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~��������������������������������������������������������������������������������������������������������µõŵƵǵȵɵʵ˵εҵӵԵյֵ׵ٵڵ۵ܵݵ޵ߵ�������������������������������������������������	�
���
��������������������������� �!�"�#�$�&�'�(�)�*�+�-�.�/�0�1�2�3�5�6�7�8�9�:�������������;�<�=�>�?�@�A�B�C�D�E�F�G�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�e�f�g�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~������������������������������������������������������������������������������������������������������������������������¶öĶŶƶǶȶɶʶ˶̶Ͷζ϶жѶҶӶնֶ׶ضٶڶ۶ܶݶ������������޶߶�������������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�*�+�-�.�1�2�3�4�5�6�7�:�<�=�>�?�@�A�B�C�E�F�G�I�J�K�M�N�O�P�Q�R�S�V�W�X�Y�Z�[�\�]�^�_�a�b�c�e�f�g�i�j�k�l�m�n�o�r�t�v�w�x�y�z�{�~������������������������������������������������������������������������������������������������������·÷ķŷƷȷʷ˷̷ͷηϷзѷҷӷԷշַ׷طٷڷ۷ܷݷ������������޷߷������������������������������������
��
�������������� �!�"�#�&�'�)�*�+�-�.�/�0�1�2�3�6�:�;�<�=�>�?�A�B�C�E�F�G�H�I�J�K�L�M�N�O�P�R�T�U�V�W�X�Y�Z�[�^�_�a�b�c�e�f�g�h�i�j�k�n�p�r�s�t�u�v�w�y�z�{�}�~������������������������������������������������������������������������������������������������������������������������������������������������¸ĸƸǸȸɸʸ˸͸θϸѸҸӸոָ׸ظٸڸ۸ܸ޸������������������������������������	�
���
������������������!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�>�?�A�B�C�E�F�G�H�I�J�K�M�N�P�R�S�T�U�V�W�Z�[�]�^�_�a�b�c�d�e�f�g�j�l�n�o�p�q�r�s�v�w�y�z�{�}�������������~��������������������������������������������������������������������������������������������������������������������¹ùĹŹƹǹʹ˹͹ӹԹչֹ׹ڹܹ߹������������������������������	�
���
������������������ �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�:�;�=�>�?�A�C�D�E�F�G�J�L�O�P�Q�R�V�W�Y�Z�[�]�^�_�`�a�b�c�f�j�k�l�m�n�o�������������r�s�u�v�w�y�z�{�|�}�~��������������������������������������������������������������������������������������������������������������������ºúźƺǺɺʺ˺̺ͺκϺкѺҺӺԺպֺ׺ںۺܺݺ޺ߺ����������������������������������������������	�
�����������������!�"�#�$�%�&�'�(�*�,�-�.�/�0�1�2�3�7�9�:�?�@�A�B�C�F�H�J�K�L�N�Q�R�������������S�U�V�W�Y�Z�[�\�]�^�_�`�b�d�e�f�g�h�i�j�k�m�n�o�p�q�������������r�s�t�u�v�w�x�y�z�{�|�}�~��������������������������������������������������������������������������������������������������������������������»ûŻƻǻɻʻ˻̻ͻλϻѻһԻջֻ׻ػٻڻۻܻݻ޻߻���������������������������������������
������� �!�"�#�&�(�*�+�,�.�/�2�3�5�������������6�7�9�:�;�<�=�>�?�B�F�G�H�J�K�N�O�Q�R�S�T�U�V�W�X�Y�������������Z�[�\�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~��������������������������������������������������������������������������������������¼üżƼǼȼɼʼ˼̼μҼӼԼּ׼ټڼۼݼ޼߼��������������������������������������
���
����������������������������� �!�"�#�%�&�'�(�)�*�+�-�.�/�0�1�2�3�4�5�6�7�8�9�������������:�;�<�=�>�?�A�B�C�D�E�F�G�J�K�M�N�O�Q�R�S�T�U�V�W�Z�[�\�]�^�_�`�a�b�c�e�f�g�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������������������������������������������������������������������������������½ýĽŽƽǽȽɽʽ˽̽ͽνϽнѽҽӽֽ׽ٽڽ۽ݽ޽߽����������������������������������������������������	�
��������������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�F�G�I�J�K�M�O�P�Q�R�S�V�X�\�]�^�_�b�c�e�f�g�i�k�l�m�n�o�r�v�w�x�y�z�~������������������������������������������������������������������������������������������������������������������¾þľžƾǾȾɾʾ˾̾;ξϾҾӾ������������վ־پھ۾ܾݾ޾߾�������������������������������������������������������
���
�������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�B�C�E�F�G�I�J�K�L�M�N�O�R�S�T�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~����������������������������������������������������������������������������������������������������������������������������������������������������������¿ÿĿƿǿȿɿʿ˿οϿѿҿӿտֿ׿ؿٿڿۿݿ޿�������������������������������������������������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�R�S�T�U�V�W�Y�Z�[�������������]�^�_�a�b�c�d�e�f�g�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�������������z�{�|�}�~����������������������������������������������������������������������������������������������������������������������������������������������������	�
���
�������������!�"�%�(�)�*�+�.�2�3�4�5�7�:�;�=�>�?�A�B�C�D�E�F�G�J�N�O�P�Q�R�S�V�W�������������Y�Z�[�]�^�_�`�a�b�c�f�j�k�l�m�n�o�q�r�s�u�v�w�y�z�{�������������|�}�~������������������������������������������������������������������������������������������������������������������������������������������������������������������	�
��������������!�"�#�$�%�&�'�*�,�.�0�3�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E������������F�G�I�J�K�L�M�N�O�R�S�U�V�W�Y�Z�[�\�]�^�_�a�b�c�d�f������������g�h�i�j�k�n�o�q�r�s�u�v�w�x�y�z�{�~€‚ƒ„…†‡Š‹ŒŽ‘’“”•–—™šœžŸ ¡¢£¦§©ª«®¯°±²³¶¸º»¼½¾¿��������������������������������������������������������������������������������������������������
��������������� �!�"�#�&�'�*�+�,�-�.�/�0�1�2������������3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�F�G�H�I�J�K�L�M������������N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�j�k�m�n�o�q�s�t�u�v�w�z�{�~�ÀÁÂÃÅÆÇÉÊËÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ�����������������������������������������������������������������������������������������������������������������	�
���
����������������������������� �!�"�#�%�&�'�(�)�*�+�-�.�/�1�2�3�5�6�7�8�9�:�;�>�?�@�A�B�C�D�E�F�G�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�f�g�i�j�k�m�n�o�p�q�r�s�v�w�x�z�{�|�}�~�āĂ㥹ĆćĈĉĊċČčĎďĐđĒēĕĖėĘęĚěĝĞğĠġĢģĤĥĦħĨĩĪīĬĭĮįİıIJijĴĵĶķĹĺĻĽľĿ��������������������������������������������������������������������������������������������������������������������������������������	�
��
���������������� �!�"�#�$�%�&�'�*�+�-�.�/�1�2�3�4�5�6�7�:�<�>�?�@�A�B�C�F�G�K�O�P�Q�R�V�Z�[�\�_�b�c�e�f�g�i�j�k�l�m�n�o�r�v�w�x�y�z�{�~�ŁłŃŅņňʼnŊŋŎŐŒœŔŖřŚśŝŞşšŢţŤťŦŧŨŪūŬŭŮůŰűŲųŶ�������������źſ��������������������������������������������������������������������������������	�
��
�������������� �!�"�#�&�'�)�*�+�/�1�2�6�8�:�<�=�>�?�B�C�E�F�G�I�J�K�L�M�N�O�R�V�W�X�Y�Z�[�^�_�a�b�c�d�e�f�g�h�i�j�k�m�n�p�r�s�t�u�v�w�z�{�}�~�ƁƂƃƄƅƆƇƊƌƎƏƐƑƒƓƖƗƙƚƛƝƞƟƠơƢƣƦƨƪƫƬƭƮƯƲƳƵƶƷƻƼƽƾƿ���������������������������������������������������������������������������������������������������������������	�
��
���������������"�#�%�&�'�)�*�+�,�-�.�/�2�4�6�8�9�:�;�>�?�A�B�C�E�F�G�H�I�K�N�P�Y�Z�[�]�^�_�a�b�c�d�e�f�g�i�j�l�m�n�o�p�q�r�s�v�w�y�z�{�ǀǁǂdžNjnjǍǏǒǓǕǙǛǜǝǞǟǢǧǨǩǪǫǮǯDZDzdzǵǶǷǸǹǺǻǾ��������������������������������������������������������������������������������������������������������������������������	���
������������!�"�#�%�&�'�(�)�*�+�.�0�2�3�4�5�6�7�9�:�;�=�>�?�A�B�C�D�E�F�G�J�K�N�O�P�Q�R�S�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�r�s�u�v�w�y�{�|�}�~�ȂȄȈȉȊȎȏȐȑȒȓȕȖȗȘșȚțȜȞȠȢȣȤȥȦȧȩȪȫȬȭȮȯȰȱȲȳȴȵȶȷȸȹȺȻȾȿ������������������������������������������������������������������������������������������������������������������������	�
����������������� �!�"�#�$�%�&�'�(�)�*�+������������-�.�/�0�1�2�3�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G������������H�I�J�K�L�M�N�O�R�S�U�V�W�Y�Z�[�\�]�^�_�b�d�e�f�g�h�i�j�k�m�n�o�q�r�s�u�v�w�x�y�z�{�}�~�ɀɁɂɃɄɅɆɇɊɋɍɎɏ�������������ɒɓɔɕɖɗɚɜɞɟɠɡɢɣɤɥɦɧɨɩɪɫɬɭɮ�������������ɰɱɲɳɴɵɶɷɸɹɺɻɼɽɾɿ�������������������������������������������������������������������������������������
����������������� �!�"�#�$�%������������&�'�(�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�N�O�Q�R�S�U�V�W�X�Y�Z�[�^�b�c�d�e�f�g�i�j������������k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�~�ʀʁʂʃʅʆ�������������ʈʉʊʋʌʍʎʏʐʑʒʓʔʕʖʗʙʚʛʜʝʞʟʠʡʢʣʤʥʦʧʨʩʪʫʬʭʮʯʰʱʲʳʴʵʶʷʸʹʺʻʾʿ���������������������������������������������������������������������������������������������������������������������������	�
���
����������������"�#�$�%�&�'�(�)������������*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�B�C�D������������E�F�G�J�K�M�N�O�Q�R�S�T�U�V�W�Z�[�\�^�_�`�a�b�c�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�z�{�|�}�~�ˀˁ˂˃˄˅ˆˇˈ�������������ˊˋˌˍˎˏːˑ˒˓˔˕˖˗˘˙˚˛˝˞˟ˠˡˢˣ�������������˥˦˧˨˩˪˫ˬ˭ˮ˯˰˱˲˳˴˵˶˷˹˺˻˼˽˾˿��������������������������������������������������������������������������������������������������������������������������������������������	�
���������������� �#�$�%�&�*�+�-�/�1�2�3�4�5�6�7�:�?�@�A�B�C�F�G�I�J�K�M�N������������O�P�Q�R�S�V�Z�[�\�]�^�_�a�b�c�e�g�i�j�k�l�m�n�o�q�r������������s�t�v�w�x�y�z�{�|�}�~�̶̷̡̢̧̛̖̗̝̞̟̣̤̥̦̪̮̯̰̱̲̳̹̀́̂̃̄̅̆̇̈̉̊̋̌̍̎̏̐̑̒̓̔̕̚�������������̻̽̾̿��������������������������������������������������������������������������������������������������������������������
��
�������������� ������������!�"�#�%�&�'�)�*�+�-�.�/�0�1�2�3�4�5�6�7�8�:�;�<�=�>������������?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�]�^�_�a�b�c�e�f�g�h�i�j�k�n�p�r�s�t�u�v�w�y�z�{�|�}�~�̀�������������͇͉͍͎͂̓̈́͆͊͋͌ͅ͏͓͖͙͚͐͑͒͗͛͟͝͞�������������ͣͦͨͪͫͬͭͮͯ͢͡ͱͲͳʹ͵Ͷͷ͸͹ͺͻͼͽ;Ϳ���������������������������������������������������������������������������������������������������������������������������������	�
��
�����������������"�#�%�&�'�)�*�+�,�-�.�/�2�4�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I������������J�K�L�M�N�O�P�Q�R�S�T�U�V�W�Z�[�]�^�b�c�d�e�f�g�j�l������������n�o�p�q�r�s�v�w�y�z�{�}�~�΀΁΂΃ΆΈΊ΋Ό΍ΎΏΒΓΕΖΗΙΚΛΜΝΞΟ΢ΦΧΨΩΪΫήίΰαβγδεζηθικ�������������μνξο�������������������������������������������������������������������������������������������������������������������	�
���
��������������!�"�#������������%�&�'�(�)�*�+�.�2�3�4�5�6�7�9�:�;�<�=�>�?�@�A�B�C�D������������E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�V�W�Y�Z�[�]�^�_�`�a�b�c�f�h�j�k�l�m�n�o�r�s�u�v�w�y�z�{�|�}�~�ρςστφχψωϊϋύ�������������ϏϐϑϒϓϔϕϖϗϘϙϚϛϜϝϞϟϠϢϣϤϥϦϧϩ�������������ϫϬϭϮϯϱϲϳϴϵ϶ϷϸϹϺϻϼϽϾϿ��������������������������������������������������������������������������������������������������������������������	�
��������������
����������������� �!�"�#�$�%�&�'�(�)�*�+�,�.�/�0�1�2�3�6�7�9�:�;�=�>�?�@�A�B�C�F�H�J�K�L�M�N�O������������Q�R�S�U�V�W�Y�Z�[�\�]�^�_�a�b�c�d�e�f�g�h�i�j�k�n�o������������q�r�s�u�v�w�x�y�z�{�~�ЀЂЃЄЅІЇЈЉЊЋЌЍЎЏАБВГДЕЖЗИЙКЛМНОПРСТУЦЧЩЪЫЭЮЯабв�������������жиклмноп���������������������������������������������������������������������������������������������������	�
�������������������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�2�3�5�6�7�9�;�<�=�>������������?�B�F�G�H�I�J�K�N�O�Q�R�S�U�V�W�X�Y�Z�[�^�`�b�c�d�e�f�g�i�j�k�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�}�~�рстухцчщъ�������������ьэюяѐёђѓєѕіїјљњћќѝўџѢѣѥѦѧ�������������ѪѫѬѭѮѯѲѴѶѷѸѹѻѽѾѿ��������������������������������������������������������������������������������������������������������������������������������������������
���
������������������ �!�"�#�$�%�&�'�(�)�*�+�.�/�1�2�3�5�6�7�8�9�:�;�>�@�B�C�D�E�F�G�I�J�K�L������������M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�]�^�_�`�a�b�c�e�f�g�h������������i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�҂҃҅҆҇҉ҊҋҌҍҎҏҒғҔҖҗҘҙҚқҝҞҟҡҢңҥҦҧҨҩҪҫҭ�������������үҰҲҳҴҵҶҷҺһҽҾ����������������������������������������������������������������������������������������������������������	�
�������������"�#������������$�&�'�*�+�-�.�/�1�2�3�4�5�6�7�:�>�?�@�A�B�C�F�G�H�I������������J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�~�ӁӂӃӅӆӇ�������������ӉӊӋӎӒӓӔӕӖӗӚӛӝӞӟӡӢӣӤӥӦӧӪӬӮ�������������ӰӱӲӳӵӶӷӹӺӻӽӾӿ������������������������������������������������������������������������������������������������������������	�
���
����������������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�A�B�C�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S������������T�U�V�W�X�Y�Z�[�]�^�_�a�b�c�e�f�g�h�i�j�k�l�n�p�q�r������������s�t�u�v�w�z�{�}�~ԁԃԄԅԆԇԊԌԎԏԐԑԒԓԕԖԗԘԙԚԛԜԝԞԟԠԡԢԣԤԥԦԧԨԪԫԬԭԮԯ԰ԱԲԳԴԵԶԷԸ�������������ԺԻԼԽԾԿ�������������������������������������������������������������������������������������������������������������������	�
��
��������������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7������������8�9�:�;�>�?�A�B�C�E�F�G�H�I�J�K�N�P�R�S�T�U�V�W�Z�[�]�^�_�a�b�c�d�f�g�j�l�n�o�p�q�r�s�v�w�y�z�{�}�~�ՀՁՂՃՆՊՋ�������������ՍՎՏՑՒՓՔՕՖ՗՘ՙ՚՛՜՝՞՟ՠաբգդզէ�������������թժիլխծկհձղճմյնշոչպջռսվտ�����������������������������������������������������������������������������������������������������	�
���
������������������������!�"�#�%�&�'�(�)�*�+�,�.�/�0�1�2�3�4�5�6�7�:�;�=�>�?�A�B�C�D�F�G�J�L�N�O�P�R�S�V�W�Y�Z�[�]�^�_�`�a������������b�c�d�e�f�h�j�k�l�m�n�o�r�s�u�v�w�x�y�z�{�|�}�~�ր�������������ւքֆևֈ։֊֋֎֏ֱֲֳִֵֶַָֺּֽ֑֖֛֢֣֤֥֦֧֪֚֭֮֒֓֕֗֘֙֜֞֠֩֫֯־ֿ����������������������������������������������������������������������������������������������������������������������	�
���
���������������!�"�#�$�%�&�'�*�,�.�/�0�1�2�3�6�7�9������������:�;�=�>�?�@�A�B�C�E�F�H�J�K�L�M�N�O�R�S�U�Z�[�\�]�^������������_�b�d�f�g�h�j�k�m�n�o�q�r�s�u�v�w�x�y�z�{�~�׀ׂ׃ׅׄ׆ׇ׊׋׍׎׏בגדהוזחךלמןנסעף�."����4"����W!'!��#(����)!g"��F!>!w)x)%"��R"$!,"v),(��y(v(z(/"������������!(������������������"(������������?!*(����������-(,)������������!)������������������#)������������@!*)����������-)")����������������������������������������$($)������������������%)&(&)��������')������������((())())������������0)/(/)������������+(+)������������������������������������.(.)'"����������������0"��������������("+"*"-"��)"A%B%C%D%E%F%G%H%I%J%K%L%M%N%O%P%Q%��R%S%T%U%V%W%X%��������������a%b%c%d%e%f%g%h%i%j%k%l%m%n%o%p%q%��r%s%t%u%v%w%x%',����������������������������!,",#,$,%,&,(,),*,+,,,-,.,/,0,1,2,3,4,5,6,7,8,9,:,;,<,=,>,?,@,A,Q,R,S,T,U,V,X,Y,Z,[,\,],^,_,`,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,��W,*!����.!/!����0!1!����S"T"������%!&!������������������6"��G!H!��������������X!����������������������������������������������������������������������������������������������������������������y)��������������������z)��{)|)})~)������������������������������������������������������������������������������f"I!����������5"������������������$'����`"��������������������e"b"������Y'��������J!������������������������������������������������������������������������������w(x(������������{(|(}(~(��0%1%2%3%4%5%6%7%8%9%������������!%"%#%$%%%&%'%(%)%*%��������������������������������������������g!h!f!i!j!U"X"V"Y"W"����������������������������������������������������������������������������������������������������������������!"��""#"��S!$"������T!t!����u!������3"��2"����������������n!����p!D!��P!��������+!��|!}!{!z!r!s!��1"����������E!q!������������-!o!����������������������������������������V!��������������������������A!U!����B!C!��������l!m!��������������������������������������������x!y!����v!w!����������������������������������A"����������������������Q!R!g(h(i(j(k(l(m(n(o(p(q(r(s(t(u(����������g)h)i)j)k)l)m)n)o)p)q)r)s)t)u)��������������������������������������������������M)N)O)P)Q)R)S)T)U)V)W)X)Y)Z)[)\)])^)_)`)a)b)c)d)e)f)����������������������������������������������������M(N(O(P(Q(R(S(T(U(V(W(X(Y(Z([(\(](^(_(`(a(b(c(d(e(f(!&,&"&-&����������������#&H&G&.&$&B&A&/&&&F&E&1&%&D&C&0&'&<&I&J&7&K&L&2&)&>&M&N&9&O&P&4&(&Q&R&8&=&S&T&3&*&U&V&:&?&W&X&5&+&Y&Z&;&[&\&@&]&^&_&`&a&b&c&d&6&��������������������������������������������������������������������������������������������������������������������������������������������F"��������������������������a!`!��C"G"H"K"J"I"L"����������������c!b!����:"9"��������e!d!����8"7"��������_!^!B"����[!����]!\!D"E"Z!Y!��������������O"N"������������������������P"��Q"������������������������������������������������������������������O!��N!����������������������������������������������������������<"="��@";">"��?"M"["\"��]"Z"!!"!#!(!��������4!5!6!7!8!9!:!;!<!=!��k!2!3!��������������������������������������������������������������������������������������!*"*#*$*%*&*'*(*)***+*,*-*.*/*0*1*2*3*4*5*6*7*8*9*:*;*<*=*>*?*@*A*B*C*D*E*F*G*H*I*J*K*L*M*N*O*P*Q*R*S*T*U*V*W*X*Y*Z*[*\*]*^*_*`*a*b*c*d*e*f*g*h*i*j*k*l*m*n*o*p*q*r*s*��������������������������!+"+#+$+%+&+'+(+)+*+++,+-+.+/+0+1+2+3+4+5+6+7+8+9+:+;+<+=+>+?+@+A+B+C+D+E+F+G+H+I+J+K+L+M+N+O+P+Q+R+S+T+U+V+W+X+Y+Z+[+\+]+^+_+`+a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v+!$"$#$$$%$&$'$($)$*$+$,$-$.$/$0$1$2$3$4$5$6$7$8$9$:$;$<$=$>$?$@$A$B$C$D$E$F$G$H$I$J$K$L$M$N$O$P$Q$R$S$T$U$V$W$X$Y$Z$[$\$]$^$_$`$a$b$c$d$e$f$g$h$i$j$k$l$m$n$o$p$q$r$s$t$u$v$w$x$y$z${$|$}$~$1)2)3)4)5)6)7)8)9):);)<)=)>)?)@)A)B)C)D)E)F)G)H)I)J)K)L)_"��������������������������������������������������������������������������������������������������������������������������������������1(2(3(4(5(6(7(8(9(:(;(<(=(>(?(@(A(B(C(D(E(F(G(H(I(J(K(L(������^"I'J'K'L'M'������:';'\']'^'6'7'8'T'U'V'W'X'!'"'#'%'+','-'.'/'0'1'2'3'4'''(')'*'='>'e'f'g'h'a'b'c'?'@'A'B'C'D'E'F'G'H'N'O'P'Q'R'S'Z'['c"l'&'`'o'a"<'m'5'��������9'j'����k'����_'��d"����d'n'i'ilKo��Rv������2X[m2_>_;y��t\������du����&s`]&a��xN0\��������*c����������������������������iq��������zM����������/|!S��+q������������Qg,R��yN����������}q��?^:{9y������������RN��+c`k������zNwK%e����������������������aJ��LT����������aj����c\-_������������kK������/U������uV��xe����@^#l��Mi��'jvi;{��igLo����fP����A^����,d����LXqy��_N$z2f��{z����=zHLMoUU��������������"S������Ql����������'dRl����1v����{N����QP?K��$m������������(mB^bv\mu\9`������NT��5t������[S5V$l��������������������fd��jq������lK@K������rljP��������������ry%l_P��jgkPQ\i[L}����������������������������������������������������������W[��������aZ��6V��_c��C^��D^!J����������ln����#S7nOx��������Hj8n,q%qNi������<y������yejlV]Bm������������������������%x����������:eX[����"J����MQ������mn������klE^��`c��IJir��NU��6v��BNGV��4c��-q��bj��������BW��'s����jM��nk��������������������������������2Y%}����������UvbU����������������5x����uL5u-d��������kgUq������;p����5i��ILUz����Ta����VW����A\��F^ozac������������������������sav\��|N��D[��qx����d\��oe1\������VU����Zs��AK��C[������zYnS������8z����&}ok��&t��JL(s��[s��'[7v��fOrpZK��RgCWpv^h��������������������������&e��������������ge������#J'LIj����������6x����������%z��������.q��No����������������mK����������������������������0vOoOi��^w��������������SN��������w\��������������([������xK������������!_a]������������������������������������Ju6i��������lgnn��ps��?_������������KL������������AP������Rt:`��������@_��`N������R\j}������vV������Jj������������ih��,c����������Ps����������������������$J��x[������G^pkVq����be��LL����{K����������������cj������������������������A_��mV����������������Pi��������������9n��������cU����SQ��pe������4hCk��*j|zvu<pT};`CN��:P:wsXMw������.d������������������_T����������gP����}l��.RonWUdj"xkM?W1{����lM������2\lP}Npn������BL������mP����������we������|s����"n��������3Y����tX��7i����������������.N��������"Y��������qX��OT������������������'eRU����������)V������������"t��Wq����XU��=pPWPT����������������������������OWjkk}����m[����������������������������E|BK��������U}��Htjhsu����^yoS����Sl����B]7oTg��JJ������{Y����}z����������*V����������xt������������ww,\������WW"_������>N��pS����������$plagOKs)m>J��������������ot������Nv����{^;P7Uqn������������(t��x\��������'K��NZ������f`��������������%mrn��������y\����\y����\s��������������rx��yt������q|������<Py[1W������|K������%p}K����������������tU������mM%J����+VBP��������>p=R$L������������������������������������6z����ML��zZ��Ov��8i��uX������NL��������MW����QTmi��kJbY��2}��-cLV4Y����'aSnCP����������������������������3}��dU����hO��Cm2P����~N(ZPx����V}��������Qx��RxS\��������b]y{A]��5c������������]mDN��!K������������c]��������]|������������������/y����������{R!O(d��6t~l����.cmgA}bZ����3X������d]opqvpz����uQ����OZ��T\��&\��?o����������ON��Y`������������VYTlKj����?J0U��iO����������mq��OL��������xd����������������������������md��������XW��'}��������+j2v��������pO=y������������tf��������������������������[K��������������Qs��������Qi)s`PRi��cZ������������Rb��"vta������dZ����������Ug?u"O/M#O������0M~q#P/a#x��&J;wjrH^Si��������I^^}@J������jyNQTn��RT#Y(}YWNw>z������������������VO��pW��akEx����������z\����C]��_y��������������og��������e}#v��|Y)}��ng������eU����������Po��1M������������"w��������������������������������������������2q��1q������������2M��+Z��'J����������bc<{$Y����:n����������Sx����������z{��$O��{\��������������������������������������cv������*m����!raN������������&z��������`y��������Vl����nd!y����o{������ky#n����������������������������������������������,j������(J����zt��������VMv|������It��������������Tx&x��J^Fr������������ZW��PS����������������������EX������������������������������������fj��]s������Zd����������������dv����������rv��B_����������������}Y������vL����:S��������������/d��������ay������������������������������������������������&p������SK������<`��JtzT��*}by��������������������������7tB}0|��l}bJ������������������=}��gjC_RQbN��$S��������������������������������������������+}��`_������������������������Gr����������pg��nP����*s������K^8v������������������������������������������������ua3q#w����)J��������������������%O����D_����������������������������������������������0a����?p��$v��6c��������������������������������������������������������Fz����������������������������������������oP����m}����������������D]����������������������������������w|������������������������������������������������������������?f������������-^��?z����������qe��������������Dm��������������������������%R����n}������6u����������������vaL^����^|��Wl������������������������������]M����������������7V3MUxXe������jO����PO��Lj��������.j-j����qS��%S������������Ow����������������$n��������$P����"r��������������������pP��������#r��xw��������3P����)[����;SlJ��&qUK������������������������������gw����^M��$w������@x������]S��PL��������&O������������sv����������wa����������\S����~z��������������'z������������������������Yk��'O/j��������������������������������������������������������������od������9iXq����XX����r`��������������������������������4f|\������������������������������qs������Pc����{r��F[qP��rP\O��QS����1LXw��(K<k>d��������������������������������������\t����B\����'p����@f����mJ��������khheC\����^mrS��������wL������������������������������TN+g������CK��1a����2w����sSRS��@u������]_����snqg��4}��������������������������������Hr������Rs����tn��Sb��������QL��j_������:i������������������WY����������������Mu��rqGz����������������xYBT��������ev��������E]������������rg_m����KJ����z[������5h��&S������������5}����Iy��bd��={����$WEN��������UNfV��������=e������������M^sl����`m������������������ll>{k_��xa>y��������sP*`bh����Tb}R��(e����������SY��������^S��8t<w}\��lhgd����wc����������(l������������qz����������re����tP/Re\��������%P4q1|xL����F]Qz��_w����(z����������un��N^��������sg����,wDkam+`G]��������3R?R������LJ��������?{��������}ee]MX����������tl����������������uP����mhRP��XY����������������������fv����*[������`w������������������������YX��#t����]t��������Qo����5Y����+m��7c��������;n4M��s`Mj��������ulnh��)K/q����������������MJ��)l��kr��o}��sy������������������Af����Xl������,mNj��_h��������������������������O^������������&R����tgVQ����Bfcc��������0d������4X������������������������%v����������^s��������%W��������hw����Fh��������������������������������f{��������������f]������~\��������������������������������������������������������������������������������������ZX��������������,Z0j����������������8c��������������������������������������������������������*Jya��1j��������lr����nz����������������������������������������Un��������ty����lR{{������p}��=`cN������������������Fx��������������������������������������.^������������������������������������������E_����>e������������������������-mjz����nM&m��.mmp��!]��/mx|��kX������yL5M��������)z��]a��������UbOm������"]����Jy��hj��me����������������kS��TizaLd��daGh����[N������U\��5ws|sp/N5qRoHhqk����������TK>`xcij2|����������t`��`O��%n����*zCf2a+J��dc;i����������Vbrs��Vn2jvPYlKZ(O��������#]������[X��NyUiQc����<R������������,XLs��{MVv��ugohyc;Rss{c��P^0N��wVYq����������AuD\��;u��Q^f\����R^����bmvnOjnp|c��_StS3a��4a��������St����F_��������������������Vi������+[����������������&v������������9cEk)t6MyR��-ZcRQO��������\KzL��]O����)h��;c:c����Z`������wn����������3\��������uS��&W��5v[W������������Ua����jT��#_��������������_}��������������������������������������������wPTm������������������������������*K��������������[d��{a"K��������`S��?d��@{��>ZMd��9V������@o��|a������������������������������������������������9v������������G_��������������1d������������g\h\������Vz��vS��������Zq��rz}b����������OUxP����_M����Ku��pd+K��DW��������������������������~b��Z]������������������������������������������������������������������.ZnJ������9U������������������������������������������������!c����ch����+s����������������������������������������������)O������wS����������������������������������qT����dN��rh��������������ue��������������������������.g��:V��l_@d������������������������������dh��������5X������\d������������9t6q����^b5a����oM'qeN]K����cY����,s����yP+lS^iw����uy����������^anK<cVx����n[����������q}��������6w��������^t����mr��Y[��(p��������������}a����������T^��,`����������cm����aS��H_��������6Y��,}So������Adkx��,[��������F|����������������-X������������������:v��_[SSGx����������������������������NJAx4R����4\9zOJ��3|jjkjzP����������dm����g]����I_��������m_����������<n��Ao����RL��$]������J_����������xS(q������7M��To��������������]dn_,K<i����������lj������K_����������?y/VFU����������*O����)N����xV������7qxn������YY_s��HxFN����������������fU������������ft����EfUo����oK_|'\����gV����������Ix��������Rc��=c��aO@pZl��W]p{����,l������)p������������WzA{��@R��������������0e������em��������-K��0y����������������������%w��.K��/Z��6X��������������'S2{��D}��-l������������!{������ieni��tssxAp/^0x����`s/g����������-[��5f����(y����X]YhVo������bS��_b����`|HW-}������o_SLyS��������pTG[U^��������tp��PUYe������������G|V\`b������0Z������������#s��lS��Kt������E}����������}c��1y������������{P[l����������������<u$rNXOX������������wu��������������������av������������������7R��������������l{��H]hd����AR������Wx����������;VV^����=w.l������aP��u`3j��VN��������%L����������������������������������vlab>c������������������H|����pM��vy����p_������?e������?N��������a|0mQ};v����OyZkAJ��8RqM��Scf}����������������������������������������mf������zc����*pPy������������b|��'x������eayn������vgmj����4|Bu����\W����������������up��h]mS|u��?Z��{L������zS$t��������������Wo��CT������������������c{����������������m{��-`����nj3{Bd����������������������������gv]R��L_����I|����)ev`3v~a��������pK��ojpj������@Z4xrk����������Cd��������Wiqd������oJ��������������WN����������������J|������as����DK��������ec��EK4j����=i��IW����[k1m��CL>wK|������������tx��7Y����SsTs������dw��Qw����7X1NBJ����4{FK����vp����gU��Pj����������TL/K����������*t/i����CuXi��������������i]������sq��{U;^����{t������s}r}&w������������������I]����ST��(L��AZUL��dY������Jz������ce������<S������pJ��������DP������PJ+zkkxgeY����������������������������������������������������WQ����������������������$s������{Tc|Xz��Us��+O����sk|U������������TS|M��fY��yb!bTk��w`2d|L������d{������+t��������=P��qJ����������������8o������@W��znt}����cS��B{��������������hU.[6a7x����������?`C{j]��"b��&n����������hv��������uv������������������������������������������J]����bP��������&]����k]����yd����/c|P������|t��������<Ljw������������deq_����aw��wy9o����Xx������������������������������)y����������Yx������=n������FX����cdNu��������Y]��������gY9RCU����eZPZ��YQXN��^K,t{Z��ivsh,Opp��}tH[������������������������������@NTcOQuq��rM��kO������8M������������&cZQ%r����������&r��Nd��������������{S��������������������������������������������������)q������Ir��������������������XoIf��8Xsz��������������������5s����$x����sQHf��������Zx����������������������������������i\W^����������_K������lO��������_t����tQ:R������r_������7a��������#b|S����fm����������I[������zd��^O����PN��������SUus.w����Ho��sMOuseBp������������������������������������������QJ������qj��&P����������������ZY+p����������gk������@e5|����������Dd����������������������)LF}����������5j��*e:__a��QZ��������8a��th}S��������$b����������Jr������������������fZ3w������������������������M}������6s��������������������������������������������������Wn��������������Du����������������$X����������'r����������������8Y9YIo��������������������������NV����������������Kw._uh������������5R������US����������Lt|Z����������hY��kwIu��<s��RZ����������������5S����������6h����OV:t��Iw����*L����CpVL������SP��=S������{[��`K������������dSwv����:UMsaK��������tk����������-t��*|����������lw������vhgZ������Lw��������������������������������������Ae��������n`����������}U������������fN+|;U����(r������������%b9MrjGK��tM����/[Yo����������:M����y|��������s_gNBZ��-O��������yg(x������������bs������rJ$_����DT����������WLBe��������;M��ZoXn��']&b����������@`������0VJx��z|��~Y��������0^������l]hZ����������`T��yV��WMX^����xr��Vd����EP.t��(]������EmVs����Y^fc������������(S��0[����Ze?c������1[������iU����������A`[o����ip����2W��������}P����������������iY����~P��ml)S��)rDp����bboi������Qy����Yi����������ZhCZDZET��zg`M0c��2[D{��cs��%Yg{K]TP��6f.`Z}����������������5\x`1g��������pu��\XFm��������9a��@c@ypi����[Y��ds������6\id����������EpAcL|M|��������Kr��Lr������Od������������������[q��Yz��8qu}y`��������{g7|d|E{gc9X��xv����E\XL������/`gt��\o|O]o��*r������������������>}����,J;}G}��������2g��Qjt_��������lQ^dCe��������&Y����<M��es����������������Um����:Y������gm5{lx��������g`��YL����FT����������%g��uU>S��{|������������������������rd����u_����xhmx����GN����������v}������������������Xh��XMVgZL����cJv_GpFp��:X��tqptLu����e|��������Ejsj��[]��W\������������}^yr��GU������PX��Hp!Q"Q������������TYhVJY��1ZGXb\Nstu����9q����SZ��jv������uO����.}����������������RJ����4_��������]W:z'n=u��ux����hm����������aT��#QVa��������������������������xy��J[yKTT��\Y��>n��mw������nR����fayw��������������m]��[h��3[������wQ0`����bT��Wv��yW����]X��}M+r����������������������������������=MBx����,r����-J.J.O����������Bc����������7\��������������������Z[;YsJSvxfuj����������vj����yv����������������������/O����SJ����/J0R:q��3WCc}sZ^��������[^����^ocb{n����w_JW������������������hN[[��������������;q��������qi����������������7zFP����+L(n����zKyy}L~S��������Pd����������nr��UTM_��8|PQ������������������������������������������������Mr����������������Rw����������������TJ��YU������^X������������������YM������)n<v����[L����������Ip��||��Ih~t��������|g^W��������\^��,p~LaM��:a��o[2Z��������������������������%Q8\������vX��$Q��bM��������j\����wp��Jp>P��\]��������VTVS������������Pm!M����������5_������x_������������!T2NJh��������uk��������������UcPu������!u����������������������������������������'Y����������������+e������������������������Kf��qu��������������������Ee����������������#y[`kv��qK��jY"u������QW��xQxjyj3Z��������_o����oq��ve?ndb����������?P��,zQu3g������������������������������������������������������>i����������Nr4[����������������N|��n]������������4g����������4W������������4w����������>M��iZ��������������0OYwfs����YN����������������������������������������������*N��HK��������������������������������'P��Kp��GPEd��������������`[������������ZU��'W������@n��vx��������Ruim��<Y��Fe����������������������������������#u����TZ'b|{����\q������������tJ������zh����iN������������xieb��������9PrT����������&Q��N_������������������t|����������������������������������������*S������,L��������`o������eeUP����������������|[��������f|����������~Kjm������������������������������1^��������������cy������������"TvO������������������������������PV������������jUnq����������������������������������������������������Kz��������!e1U����������mO��km����������2U������<U������������������b}-s��[}����������������������������0i��������������'Q����c}3N��������������d}Nz��������0J��'w��1O����������������������������"f��6|-rao.sF\kY������`h��������������(a��������vU}O����]^������QY������jdOr��?w����fb(b����������������������Vc��Qm����������yi������������������������������1V2^����h`����+S��\k����/_��CJ����|n��C}������vk2O��������lY��=Y��_X����8T>ko]��p]q]r]����>Y������������������������������F{3O}n������������+d��EZ��lX������������������������������(Q��������������������������������)b����<^5g����������p[��bopq4O����������������������q[��1`��������%_��Ry����}g����#fq{0K.r��������������gM��\h����Wg����@w��cP������!Z������=L����)QL]����~c*Q*h��6jzyLfXv������GT������KY��RYKSwX)Zxu����^^/r)x������������������������������HX����An��������Ay��������s]zj��=v;a?MTtMf��O|"{��\`��������;tUZ��2y������������r{��v[��_^������r[����������\xnwhk��zR����<q����Zz����jZFZAw����6gGe,V��������G\����������)a��*b��&U����WT������������Pr��{j��]`s{��������������=q����gbW}��HN7j��@|��g}ow����5W����������������������������������������������:o]q��3^������������Kh����]x����G{HU��_W��)]����������1i����-zYvtz����������*x����������nf��\L<ao`����?i}|Nf����Wa��Of��qt��������������������������������������������������sd����{d����dy��������������������co����nO>v2`~|+Q������zW������H{��Wb������������#Txp(W������ga����?S������������do��EWbk����g|����"d��hb��Pf��h{htte<tUt6_��9|BnuJ������eobK$T��`^}ZFd>h��������^`4vRj��{y����B`��dJ��7g��}j��]Y��4Z*ni{��������K[5Z����������>q����,S����������������I{��O_����@SWc��foP|��������������@i������Su����\l7w����8jyQ������������H\������������������������������������������9j����������^q����������6W5O��(Y����nl����*]��������"M.h������=a��Qr��������Ai������|R��������������5[��gs~X������Q|��2m/t��#{����A|��+n%T����������������������������������������������������rt��������Yn������J{����������cM;X[ewx������Tv����������������)W��IK����QfLp��������������������.X��Sy~U��������������<X0r��������+bhs����������Bo������������lm��8g������������������������������~Z����>L����|rkZ��XbVm����QV3`����R|��Hk����������������ASMp��wO������������������Rm��XTI\qW����;_����%s������Mt��������?q1x��zi������K{����UJ����������������������TyJw����HV������������h|=s��~n��~g����������BS��������6S��-Lzv2VXR������������Xg��������������������%c��������9g��������-pL{!k����&T��������M{��=U_q����{v��4^������������������������kUHe������${9T����a^��#d������7W��nx������5^����RV��Uy:gUkwUgo>a������.z������iVnV������������;g��������������Kl������������3U��������������������������4N������%{na������������(w��������N{����������=X��������������}{��������i|��������������6O������Gm,n��������������]L��������'v������zf������$u����������\}3mIN������������ho����?a������������[zcK)w��&{������9\������@qHmCo����������������������������-V����N}������!h����������������t{'U������vq��Sf����������������������������������^L��������������2x������k\6}��������je����`q������������������������L[M]������HT����mY��������%u������������������{f����������Tf��������������������������������H}��!V?}��S|��!o��<g����������nQ����Uf����ri��0_����������`X:|/}Np��a[����Ie��4m����������������������������C`������������Xc��������{i(j��������7}����'{��Bi��������w}����������Yb����l\������������������"h��������pf��������������x}y}������?v����'g��Wf��������sTIT��������zV��rW��@a��b[Xf������������������=g����������Op>s,b����������7up`������������������������8}hc��'T|hRz����������ox������������������SV��������������������4U����������������������������Pp��pw3n����:j��Sj����Im+]������,e!}��P_3l��Q_����������mm8xzw������+x����������`t����������:T3d��Zi��6^��?Y��@YoV��������LY��*Z����������������e_������������ew������2L����y_`W����������������������������������������������������������������;T��������z}��������3L����s[��������������������������������R_��JN��Zn������������������dd��O{������������7O��Cn��������������jN��������������-b����������������������������aWuz����IU,xYg����������������������is��������mXDcqp��������������eh������z`Dn^Y��������������������"k#k������������B|;j��������+hb^��������������������om��#h��������qO��������������������������������<T��j|����������>g��r|����4V����.b��7SLz����������������\z��5mca��,h��]h����io����������=t��8O[i,Q������������GZ��������������Ik��Lh������7^��������<VeS����������]z������������VZ��1J������������HZ&_��3yRr��DJ������������KN����uM������0}(U��Aq����ibJ\4l@z����({(P����lZ������������������nY��{`������jo^zD`��9O��JUbW/b��8W������������������Mh��������������Zv��������"oZb|v����P{-Q��dM��.Qm\Nh��yp5N|f����{WVPu]qw��}v��w[��������j{\iAY��ruE`������������Tj������������������By��<j��ERQ{@g%k��z_"c9W��Ci��}h/h����Sr){%X��������KU����������������������������HP������/QcW������F`��"V��pm������������������������sW������T|��WZ_L��Tr��0Q��`L��}[?s��Qp����������;|��0b����%f������[b������^_��G`������������or������aL��������jV��������Bg������6N��@s��~M������R{��xx{w����?h��������������7h����������������6m:\����4L������������������������wq������8h����vJ��$dVt������f_������'_��g_Aa��Di����K\Ei������#o&k#Kic������{Q$o��ko������������������������4P��������#M����fh��%o��LSmZ��������:W��UreuoY��������4y����TUO}������c[��������aq6l��������~{WS��1Q��1K��������2Q������������2KBq����at5y����CaBa��wk����������������������(_��������������JK����������9f����������^x*ywJ��7m����8SVr����YTEnpr������2J����;\��xq����������7l��������Je��@v]}����cTbL��Tw������������eW��������������������������CS��&X��Av����������v]��@M\e������������������������Ke����������������������Da����������0h0tjsnZ��;W��1b����������������������������������������*W������������{V������������������_d��VJ������(k������~[��������������������Bv����;o��������}T����H`������9h��&o����������$M����tT![\[][����������\n��KKU|������������kN��AM����S{����������������������������������������������������+y����������������������Tu��������)Y����]iM[����N]��Cg��Ll��������������ly������LK��������|`(T��SmoX��Wr��xJoZ����TV������������MY������nX��Ar������S_������pZ��jb}`����xX������/w6Z��WJ������������������������������������Xr��yX����������������_z��������������������������oOBY��Rp��Qd������7s������������������������`z��������������������������lo����������2b��=T����NY��������bt��������������������������)T��������BMZg����������������������Yr����������*Y������������������������>X������������-\������������kb|V����yJ����ZT��������������Wt!L����:O����������������������������������������������8u������CYhP����������Ecxk��1r������;O������-SahlN������4`c^������������������������������w]������������������������������������2rvs[v��������~W����������_x��rw��������������������������������)P������������������Zf��������������������������&u��������������������������<WcL����[f������������������������]]��������3Q����������mo��������^Vtdoa����x]����������Oh����������������������eJ������!\��5`��������������������������������,|-|'X��������8m������6[��������pV/s����%M��qZ����������������������������������������������(X������dL����4Q����������XJ����������rZ'u������������������������(u��������������&f��������������������������������������lUxUsZ��������������������������Fc������d^��e^5Q����������6Q7Q3r������������^i����������Sp4r����TpdKT{fujc��f^��������T_����yx��������.p������������������������8Q��������_V��WP����������������������!|noX\��_i����������������������������������������]e{}����I`������IV����*T��Le����������`i������XP"|>T3bg^��������������<\6RUu����������!N)u����y]����z]������������Up��������_v��Zrkd��qr����������������������������������9l|}��������*a����YJ����oo��*u������������yl����-x��BrCv��RW����"yVp��������������������������zp����`v��������siCr������+T3J&M��CMZM����������OY����Dv������]nDg����������������4b������������������b_[g������������1h��.|��������Me������kz��<O����bOvM����po��>t��MT����8s������!i������������������rrks��Wp����WO������������_O������������������@hAh������cO"i��������������������*P������������������As+P��dT����<o!X����������������������_Y��Ws������=\��eLqm����bq��[T��������5b����fJ��.S������������fL����Sqgu��������ZJn{��Ea��������������i_��^n����Bw��"X����������,]����������/p=V����������������������+a������������������������6y����uT��IP'olb��j[LNhuUw��MS��~s������������������5P����������������������~`��{_������������]f��������������$h������������������MK������(o������4n��������XZ9Q��)_����0s����DL������7N����������������������)o������U_����Wm������Fn��������������=oV|����t[��*o9x��iu����������������Yc��������������������������Fa������?T��������h^jp��������������������Bs����������������������/S����[J����������W|����XmGa����������������������������������Xt3V-]������>U����������������Cq_n������������������������������������kV������Yt��������������fW������������7Z������������������������������{]����������O]����������������#X����YZ��XpDo������������Xa����������Tq��rm������������[U����\UDsWK����������6b��������qo����������������������U{����������������������XS��������������P]Yp3K������������]U��������������������������������������'M����,P:Q��Dq��3eu{ai`}<|��"Z#Z��!R����oR������mb����i^\N5rdPQ]��������Ha7[c_����������������9mEq��Os+W,a����kc��Gn������IazJ��������������{pazZpgLtZ������������������?L��������������������������mN����)Ubz������eP��Vk��_l������|_����Vwj^4K����>o����5L����������=O����������������������������ro7b������hL����������������|p������`V��Fq������������������8b+k������5KQX��Ntws����FW��;Q*w��JmSWzX��������������Ev����LQ|]��������������������}_��ey��J`����}r0S��stIZ��^f��������:xPh����{X����Uj��������#V������������Fv[r|d��������������������2h����������ZZ��\rV{2i��-n��cz��������������n\����ju`f��}p����������,W����������Eu`n����e[��^]����pY#i��������������������yq��DrK`����������������$i����9b��������������1ck|(M��6L����[p����������������:f����)M����������Cs������������������Ya����+o������Eg����i`��Es����@T?U.]��|y��@L����������������������������������"e������8N������RXVy����������������������������������������*qQN����Gv��k[��~_����aX��sw��gW����������������������~T����<Q��Oe��6K��8Z����������DM����������>V������:b����������XO������L`yk����������������}}����������hWXK������bi������:h������Gc��������Ml��Nl��?V������'c��V_h}������������������an(v}]��������������;x��Qh��������Wy����������������nN����Ol%iUV��EM��:m=Q����>O����;l������1R��������iL��DY|i����������������������������������������>Q����������<l����-e������������0w��jL������DS����@V������}V����������������������!a��=^��)v������$Z��������������������������������$VFu��"aFi������Er����������itlVSk��������=l\bk^\p��?k��NW?Q������������������+u��������}y��\J������FM6r����~]������7L8[��������iP��]N@k��"}����������Kx����������������Vj0q��������������N[��Cw����������������������O[$K����`x����W{����Jk!`����������������������MN����\T������X}��������vR7r����vz*vwzfX��1t��������������������������Rh��EJkL��������������nb����������;b��-w������ax������������������ls��������!^������������������������}d����lc��/]0]����7KSh������������������������������#a`R��������~p��������&irK������������smY\M`��������Zw9[��������������.L��[Z��������GM��������������������1]��/X#c����oN����sr��������3x��������������������N`��}u��������lk����ESl|[RkT��"^������fe������������0p��������������������DU������������tm������mc��Bh��um|W��;m����+v����������8rHv����������fS]r?O��,k@O��(fi}��AO��_`l^��������"`����������������?tob��qYGq��8K����������������~y:[uZ����������������lv\Zdz��O`������������2]��������)f��so����������������������������������ms��������������������zk��fy��������������]J^U��^Jd_������}f��,u����������ud������������������������ci��KmdO������SX������������3]lT����9r��7_����������NKX{����YP����R]tw\g%d��#|��;[������:r}iJP��VuEY4d��'m����������������������������������=j~f��Dw-u��`Y������4J����bxBO��>l������4eHMHn������������������Hg����������������������IM7yhqrYu[5JFY������IX��������������������������+Y��������������������������������<m����TX������Z\��<b����m|`l~R��Gi*f������������pb������������;z��.u*{��������{l��?lX|����������������������������������������������������������������eT������Cy������bn��������������������������iWvm������m^��������������lL��nc����������Th������xz������������4]5d0X����������������������������������UX������jt������9N������aVRO��6P������������"N����ns����������xs������������������������L\��KP������$|JMTW#^��`d��������In������]b~u,T����������QU��pXCxWj����������������������������������������������������Wu����?X��������@}������������-k��������*U����������������������(g��������������������������Jn������gJ����������cx��]T����Xj��������Y{wm����5e����������-P��������qq������������������������������������������=b������Hc��������UY����*_��������<[��������������������������������dx����������zq����6eos����Z{`a��,Y��ku��6`����Hi��OK��Ic������n^����������������>b����������������������������������o\��%V����������qb��������������~V!Y��@X[\����=m8_��%j������-W����ys��xm��Gu������������Jack��^r��������������������������Lx��Yj��FS��f[����������/u��������pN��������~i����������6{������������������rb��������rO9wsY����Ka��������������������������������������������]Z����9Z��������������{k��9K����ym������������``��������������������@t��<}1_oc��������#`9}������������������1p������������KM��������������>m������@Upczm����������di������������mU]g������������vT7e������g[?b������������������������Kn����tW]p������+N^g������VVLa����3h����������������������ne"\����P`������������������������������������5U����������������������������������!U����������������������������[{��Ky������sK%t����������HzWV��ei\{��������������P}����������������������������������v{��������������������������������%Z��=[������������bl������������������������������wM^p��������Iv����������������������������������������������������������o^������1S����������������n|��������Ch��Hq������qN��������my����������������tr��������������������������������6d9u��p\qc��������%h������������������������������;r��$^��LZ��������������������������������������������������������������������������������������������������iJ������������Zc��Y|��������������Zj������������Dy��$c����������������������]{��Jo��Dh������������������LU��������������������Wk����������������������������������-Y����+{��������������������������������YS������������"U������������������^v������������������������������������������������������vZ����������������������Q`����(i����yu������������/z��|k����j`2c��������������������������������������������������EU����cqnU��������������������������LM��������Ym��������AX��������lz����������kq����������<zbf��������ezzb������6J��7d��[j��zu������,{CO}k��������zx����9_��������qa��$R��������{u������������ZP[P��>j1Y����������7J����gS��ex��������2S������@b_r������������eM������������������������,y����������������MM������������������������.n.V������������������������jW��������`g.k������YO����M\{m��p^��kW������������%^��������������������W_P[Q[����#U��������2p\\����������������hJ��fxN\��������\jR[����������������������3i��������[w����������������������(c��.W����a`����������:K����Qe����������������������������������������������������\P��������AU����������JX��������������)c������������������������$`��)i��GS����]\.x������8L������.P������rX����Jc��������������������/L��������������-TQv��������������LP��������������FJ����BU����:N����������������������������������GJ��������������������������������0z��������������������������������X_������:uke��to5]��������*M��rc��w{��Pw��������:}����a}~v@Q����Eh��8d��ha������AL��mR��������>[����b`������Iz����Ma��8J������`rIq����������������������������������������q^������_pDx����������Ln����r^��Ig��sbag����Kc����Lc������xO,o��~}%|1zY_��R`������Zt����������������������Jq��#N��������<rcl����������%`��+w����/k����������^e��$a+M��tY&hNMia��o|��c`����������Ab��$N������������&^����~k��]k`p����[t��tb����HS������kt��5n��Xu����_U������eV��������0kct��������Mc��������tt2z����uo_J��1k?m����I}��������&d$y3p��le������gQGYWd]j��wT������������������:Z��MZ������Ly��Za?[��ELPl;K��s^����*i��������������HY����cn=W������������DO����������MP��������������&|��������������{q��������R}AQ����������������[c��IS��O\������������������mL����������'^����;f!l������9L����^{����������bg����AT������������������(\����������Bb��XsSe����Ys������Fs[M��������������,M��C|��������gT��BQ��%y��Uh����������������Nc��������JT������������Z_����������������_{cg��������������������������{xOc��������������0u��������������gX��IY��������������������������������/xvo��6]/nxM��������8^'||w1w;N!t����Mn.a����Cl~O��?xbXhS����(^dtBl��uYEyS]qV|lp|����@m9J��dn������������ar��9^������������rV��t^��[_��S[��gzcXAt��7]������ur����.T������������sV������������8]EO__>r!v��Kk|q��Gs����k`����������|m����[a����������������������������������������������������������������������������������������������������������������������������������������������������������en��u^��������Sz��������Kq����/P9]����CQ��������������������������1u��������Fj����������������������������ap������������������,v��������Yu��������������������kp������������:]������?r��������������Ew��������"[vr����:J����������������������uw��eK������fn��S`��������%N������������XV������/TIi��������NSBt��������������������������fK����������������������!q����������2k��������"q������������������������3k��4p����tK0T2s7{����������������������������lu����������gn2t��������������������������������������mu��sO��������������������bp����������Nn����Lq����8e��������������������������������������������������������uWsceO��������������������������������������FO������������������3sXdyOZO��������Mz������������������������cf����������������������br������������������������nu����;J����\crN��YV������0n����������������etBXP\nL����������`UJvJ}VXOt������������&V>\��T[GW��������~r������Mq��������Cb^\��_\����-o+f��������]y?j������.o������PtsN����������������������������,f��^N����yU����������������������������������������������������������������������������������������������������������������tcPM������������8U����}w��)\��������v^��*\cr4i\R������������������������������fi����vc����������������Jg����NP����wZ����������������������������������<J������hn^Z��wr����{b��&L��������;Z��in������Zu\wjaAN1T��1}=f��-{����gx��Na��bwouGO����2ToL��hT��OnWw����&`AV\acpdqq\'V��������������������ut����Nqdr����0P����ol������:y��5k����mTDb��������gi����4k!j��<x&N��FyZ|��3T9S^j������+i����aaOSvt��@jOa��:L����������jn������dp4snT����@r����eq��CtT`��6k��!WhK��-y-idX3zEb=|����Dl1X��+\��������$U��ik������;h������WX����������������.{aQ����@[��>u��w^��������{JFwHO������Pa����Pn����������������ti����������������tN��������������������������������������MU����[O������������;]��������,N��������������hi��������������4TGd������������������������������[u����Az������)^��������������������������xT����������wo��������3S��������������������������������������������7kxo\uLmU[Oq������Pq������������������������������2u������������.Y,U��Fb����������������#}��e{+_����������������������������ub��-v��3u��5p��������%a������������������]u����������������������������"l}m��4u8{��#[����JVYK��������������������Te������������zs��8k��7`lWlq/eaUmWQQ����������rayo������<]\v����������ep������Dt����ii��������������������{soT����"L~w<_��������Mk������������7P������������������������������������������BV����������-h��������/o%K��������iK������hz��������������������������FL������gf����Gj������$[��IO|bzo��������������������������������������������������^k����Hu��^T����������������������U`��0o����Gb��/Y������gy��������������������������������������������eg����JOQa��Hb������������������������������������{o����yz����r\����������������������������������'`����������hx��������������������������jK������<KbV����������������������^u��������������_u��6n������vbJS|oDQ1o��EQ��^P��aY����8`����QM9s������������������������������������������������Lg��(V'N��5T������������Hd������������4S������������������������������������9k������������uK������������]v��#q��������������������������GL��������������Ji��pa������`u����������������/{������QK��������`{er����pl������������������������������������lp��������������������������kn������������������������Ki����pL����/W����������������������������������!su|��������������������������������������$q������������������������V`����������2o������������������Qt����!w����������������������Qq������������������������|J}J����������������NN������������������������������������������������������������������Hs��:s~m����������������&Z����l`����������Mx��RK������Nk��XyYy`JJZ������&K��������������������HJnyl[����1P��������oU������sf������������������"gYd��������������������ad����D|������������������oytOfw����������<N��������Et#\=]��������Ft����������������!x������Vh������A[����������������fp������9dmv��.y��>]������������0WhX=K����Zy��������������������Nxpym`3c3t����Bjfr6p����������V[����������dk����gr��UW6ThyAW��������Ue��������������jiLW������iSIb��[|-M����������0L"j����vd@P��7p!n������������vW������JbKb��Oz������������_k����������KV������4t��������MmRd����)j:d"sRM��Kv��fqAm<hQn������������gpLb����*d��auZm����������nWqQ��������kilid`��������'ZT]��#j������CVtV��_Z��3oMb����������}ohr������������������Eo��gg����}W����Ng����\_��Gy����������������vY����������������,_��ZV������������$\������8p��������zU��wd������DV����������������lt��������~o����������!p��*^����<Z|X������������Tz������el������������(|����fl����KX��������������������������������9{��Sd��yM��������������������������������SO��������������jJ����TO��=x������������������������������������������������Gt��������_j��������������[y����������������7T��������������������������������������������ek����Ra��������$j������Bza{mz"pqL��#zwb��Nb��ui��ka������hgWhxZKT������vwEV����������������������������������������iT����zz��������������rL]w��:^��������������������(N����������9p~dId����������Td������Cj��4o������>W������������b{��SM������5o������iz����������������������������������������������������������������������������������������������������������������&y������������=_��Gw������������������������������������}x����|x��������������������������������������+^h[����]c��baFQ��������������������PvfkyZ��������Gl��������������x^ix^cuN����������CzWe��Hl������Is����;d��������.f����������6o��?\��������������=N��������������������������������������������������������CX������OP��zOJsW`������GQ.i��=h����Dz����������������������������������������������������������������������������������������������������������������������������Ob����Ez������8y��������������`\����0{������)X_e'y����nv��Lvxb��������ql��������������`Z����������������������������RqLRKO����=J������?]������ov��y^��������������������������4z������-U��������������������������gq>^������������@\����������HQIQ������������������>x����������������������������������vK��������yT����������buSa����������������iX����~x��LO��������������$}��������������vN��Pz����sL>f������.v����pU����JQ������>|qU��������������������������������������������������������������������������������������������������������������������������iM������������������������������5z����������������������������������������������������Pbwt������TM������������������������#g����������������%[Qb������������������������"W����cw������������&j��������������������!P��������ZNk{&[^[eX������������������`j��������*X����������`e����������������������������������������[V������������������������������������������������������������Fo����jx��������������������������Ud����������������������wN����X`����������������������������������������������������oW������������������������mt��������������������������fM������tLcu����Jd��a\����Hy������������������������������?|������������������������'h����������������DX����������������������>K��.\��������������������������wW������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������hp��@]��MO������������������s\0Y��if<d����������������������������������Dj��������������������ld��ed������������������������������������x{������������������������������������������;L����������������������=d����\MwY��������������������_]����������Nm������������������������������������������������������������������������������������������������������������PY����������#e��������My������������������������������.M������������������������������������NO����������������������������������������������������/v����������S}mk\V$e������6U����������������������������������������������������������������������������������������������������������������������������������������������������������������������������]V������iy������$g��cV������������������������������������KQdV������rU����������z^��xW����������jX����������������������������UO}X����������+X����K}��������\|������������������(`sU����Y}����#L������yY����jSuu��Go������������������ZS����������������������=Z(h/\����������#p��������UM������������������������)`����������������������������������������������������,^����������������������������:p1n����2n������Mv������������������������Rn��FV����������e`����;s��ae��������������������Kd������������������������������������������#W����B[��������~J������������OO!0"0A�B�#0C�D�$0%0&0'0E�F�G�H�I�(0)0*0+0,0-0.0/0J�0010203040K�L�50M�N�O�60P�Q�R�S�T�U�V�7080W�90:0;0X�Y�Z�a�b�c�<0=0d�e�>0f�g�h�?0i�j�k�l�m�n�o�p�q�r�@0s�A0t�u�v�w�x�y�B0z�����C0������D0��������������������������������������E0F0����G0����H0I0��J0����������K0L0��M0N0O0P0����Q0R0S0T0������U0������V0��������������W0X0��Y0Z0[0������������\0]0^0��_0����`0a0����������Áb0c0ād0e0f0ŁƁǁg0ȁɁh0ʁˁ́i0́΁ρj0ЁсҁӁԁՁցׁk0؁l0فځہ܁݁ށ߁�m0n0��o0��p0q0�r0�s0��t0u0v0�w0�x0y0�����z0{0��|0���}0��~0����������!1"1��#1��$1����A�B�C�D�%1E�F�G�&1H�I�J�'1K�L�M�N�O�P�Q�R�(1S�T�)1*1U�V�W�X�Y�Z�+1,1a�b�-1c�d�e�.1f�g�h�i�j�k�l�/101m�11n�21o�p�q�r�s�t�31u�v�w�41x�y�z�51����������������61��71����������������8191����:1����;1<1=1>1��������?1@1A1��B1��C1D1����������E1F1����G1������H1����������������������I1J1������������K1����������������������‚ÂĂłƂǂȂL1ɂʂ˂̂͂΂ςЂM1N1т҂O1ӂԂՂP1ւׂ؂قڂۂ܂Q1R1݂S1ނ߂������T1���U1���V1���������������������������W1X1A�B�Y1C�D�Z1[1\1E�F�G�H�I�J�]1^1K�_1L�`1M�N�O�P�Q�R�a1S�T�U�V�W�X�Y�Z�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�b1c1t�u�d1v�w�e1f1x�g1y�z�������h1i1��j1��k1l1������m1��n1o1p1��q1������r1��s1����������t1u1��v1w1x1������y1����z1{1����|1������}1��������������~1!2��"2#2$2������������%2&2������������'2������������������������������ƒÃăŃƃǃȃɃʃ˃̃̓΃σЃу҃ӃԃՃփ׃؃كڃۃ܃݃ރ߃��(2)2*2�+2���,2�������-2.2�/20212������2232�42������������������A�B�52C�D�62E�72F�G�H�I�J�K�82L�M�N�92O�P�Q�:2R�S�T�U�V�W�X�Y�Z�a�;2<2b�c�d�e�=2f�g�>2h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�����������������?2@2����A2��B2��C2��������������D2E2��F2��G2H2I2��������J2K2������������L2����������������������M2N2������������O2P2����������������������������������„ÄQ2ĄńƄDŽȄɄR2ʄ˄̄S2̈́΄τT2Єф҄ӄԄՄքU2V2ׄ؄لW2ڄۄ܄݄ބ߄X2�������������������������������Y2Z2����[2����A�\2B�C�D�E�F�G�]2^2_2H�`2I�a2b2J�K�L�M�N�c2O�P�Q�R�S�T�U�d2V�W�X�Y�Z�a�b�c�d�e�f�e2f2g�h�i�j�k�l�g2h2m�n�i2o�p�q�j2r�s�t�u�v�w�x�k2l2y�z�m2��������������n2������o2������p2��������������q2r2��������������������s2������������������������������������������������������t2u2����v2��w2��x2��y2������…z2{2|2Å}2ą~2ŅƅDž!3ȅɅʅ˅̅ͅ΅υЅх҅ӅԅՅօׅ؅مڅۅ܅݅ޅ߅������"3#3��$3���%3�������&3'3�(3�)3���������*3+3,3��-3����.3/30313����A�B�C�2333D�4353637383E�93F�:3;3<3G�H�=3I�J�K�>3L�M�N�O�P�Q�R�?3@3S�A3B3C3T�U�V�W�X�Y�D3E3Z�a�F3b�c�d�G3e�f�g�h�i�j�k�H3l�m�n�o�I3p�q�r�s�t�u�v�w�x�y�z�����������������������������������������������J3K3��L3M3������N3��O3P3��������Q3R3��S3T3U3����������V3W3X3����Y3������Z3��������������[3\3��]3^3_3������������`3a3����b3������c3������†ÆĆņd3e3Ɔdžf3g3ȆɆh3ʆˆ̆i3͆Άφj3Іц҆ӆԆՆֆ׆؆نچۆ܆݆ކ߆�������k3l3��m3���n3�o3�����p3q3�r3�s3�����t3u3v3������w3������x3��A�B�C�D�E�F�G�H�I�J�y3K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�z3t�u�v�{3w�x�y�|3z�������������}3~3��!4����������������"4#4����$4������%4����������������&4��'4��(4������������)4*4����+4����,4-4��������������.4/4��04��14������������24��������������������‡ÇćŇƇLJȇɇʇ34ˇ͇̇·χЇч44҇ӇԇՇևׇ؇هڇۇ܇݇އ߇�������������54���64���74����������8494����������A�B�C�D�E�:4;4F�G�H�I�J�K�<4L�M�N�O�P�Q�R�=4>4S�T�U�?4V�W�X�Y�Z�a�@4A4b�c�B4d�e�f�C4D4E4g�h�i�j�k�F4G4l�H4m�I4J4n�o�p�K4q�L4r�s�t�M4u�v�w�N4x�y�z���������������������������������O4P4����Q4������R4��S4����������T4U4��V4��W4��������X4��Y4Z4[4��\4����]4^4_4`4a4������b4c4d4��e4f4g4h4i4������j4k4l4����m4������n4��������������o4p4��q4r4s4������������t4����ˆÈĈňƈLjȈɈʈˈ͈̈ΈψЈш҈ӈԈՈֈ׈؈وڈۈ܈݈ވ߈�����������������������u4v4w4��x4����y4z4��{4|4��������}4~4A�!5B�"5C�#5D�E�$5F�%5&5G�H�'5I�J�K�(5L�M�N�O�P�Q�R�)5*5S�+5,5-5T�U�V�W�X�Y�.5Z�a�b�/5c�d�e�05f�g�h�i�j�k�l�m�n�o�p�1525q�r�s�t�u�v�35w�x�y�45z���������������������������������������������5565����75����8595��:5��;5������<5=5��>5��?5��@5��A5����B5������C5������D5��������������������������������������E5������‰ÉĉʼnƉljȉɉʉˉ͉̉ΉωЉщF5҉ӉԉՉ։׉؉G5ىډۉH5܉݉މI5߉������J5K5�L5��������M5������������������������A�B�C�D�E�F�G�H�I�J�K�N5O5L�M�P5N�O�P�Q5Q�R�S�T�U�V�W�R5S5X�T5Y�U5Z�a�b�c�d�e�V5f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�W5y�z�����������X5����������������������������������������Y5������������Z5������[5������\5����������������]5��^5��_5������������`5������a5������b5������������Šc5ÊĊŊƊd5NJȊɊʊˊ̊e5f5͊Ίg5ϊЊh5i5ъj5ҊӊԊՊ֊k5l5׊m5؊n5يڊۊ܊݊ފo5ߊ�����������������������������p5q5����r5����s5t5��A�B�C�D�E�F�u5v5G�w5x5y5z5H�I�J�K�L�{5|5M�N�}5O�P�Q�~5R�S�T�U�V�W�X�!6"6Y�#6$6%6Z�a�b�c�d�&6'6(6e�f�)6g�h�i�*6j�k�l�m�n�o�p�+6,6q�-6.6/6r�s�t�u�v�w�x�y�z�����������������������������������������������������������������������������������������������������������0616����26������36��4656��������6676��8696:6��‹Ëċŋ;6<6=6ƋNj>6ȋɋʋ?6ˋ̋͋΋ϋЋы@6A6ҋB6C6D6ӋԋՋ֋׋؋E6ًڋۋ܋݋ދߋ������������F6���������������������������A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�G6H6Q�R�I6S�T�U�J6V�W�X�Y�Z�a�b�c�d�e�f�g�K6h�i�j�k�l�m�L6n�o�p�q�r�s�t�M6u�v�w�x�y�z���������������������������N6������������������������������������������������������O6������P6��������������������������������������������ŒÌČŌƌnjȌɌʌˌ̌͌ΌόЌьҌӌԌՌ֌׌،ٌڌی܌݌ތQ6R6ߌ�S6���T6������U6V6����W6�������������������������A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�X6R�S�T�U�V�W�X�Y�Z�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�Y6s�t�u�Z6v�w�x�[6y�z�����������\6]6������^6��������������������������������������������������������������������_6`6����a6����b6c6��������������d6e6��f6����������������g6������h6Íči6ōƍǍȍɍʍˍj6k6͍̍΍ύЍэҍӍԍՍl6֍׍؍m6ٍڍۍn6܍ݍލߍ���o6p6�q6�r6������s6t6��u6���v6�������w6x6��y6z6{6|6������}6~6!7"7����#7����A�$7B�C�D�E�F�G�H�%7&7I�'7(7)7J�K�L�M�N�O�*7+7P�Q�,7R�S�T�U�V�W�X�Y�Z�a�b�c�d�e�-7f�.7g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�����������������������������/707����17������27��������������3747��576777����������8797:7����;7������<7��������������=7>7��?7��@7������������A7B7����C7������D7��������������E7F7��G7H7I7ŽÎĎŎƎǎJ7ȎɎʎK7ˎ͎̎ΎώЎюҎӎԎՎ֎L7׎M7؎َڎێ܎ݎގߎN7O7��P7���Q7�������R7S7�T7�U7������V7���W7����������������A�B�C�D�E�F�G�H�X7I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�a�b�c�d�e�f�g�h�Y7i�j�k�l�m�n�o�Z7p�q�r�[7s�t�u�\7v�w�x�y�z�����]7^7��_7��`7������������a7������b7������c7����������������d7��e7��f7������������g7h7����i7������j7��������������k7l7��m7��n7������������o7��������������������������ÏďŏƏǏp7ȏɏʏˏ̏͏Ώq7ϏЏяҏӏԏՏ֏׏؏ُڏۏ܏ݏޏߏ����������r7s7��t7���u7������v7����w7��x7������������y7z7A�B�{7C�D�E�|7F�G�H�I�J�K�L�}7~7M�!8N�"8O�P�Q�R�S�T�#8$8U�V�%8W�X�Y�&8Z�a�b�c�d�e�f�'8(8g�)8h�*8+8i�j�,8-8k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z���������������������������.8/8����08������18��������������2838��48��58������������6878����88��98:8;8<8=8����������>8?8��@8��A8B8����C8��D8E8F8����G8������H8��������������I8J8��K8L8M8N8����������O8P8��ÐĐŐƐQ8ǐȐɐʐː̐͐ΐϐАѐҐR8ӐԐՐ֐אِؐڐېܐݐސߐ���������������������S8T8����U8������V8��W8��������A�X8Y8B�Z8C�[8\8D�E�F�G�]8^8_8H�I�`8J�K�L�a8M�N�O�P�Q�R�S�b8c8T�d8e8f8U�V�W�X�Y�Z�g8h8a�b�i8c�d�e�j8f�g�h�i�j�k�l�m�n�o�k8l8m8p�n8q�r�s�t�o8u�v�w�x�y�z�������������������������������������������p8q8��r8s8������t8��u8����������v8w8��x8��y8������������z8������{8������������������������������|8}8����������������‘ÑđőƑǑȑɑʑˑ̑͑ΑϑБёґӑԑՑ֑בّؑڑۑ~8ܑݑޑ!9ߑ��"9��������#9�$9�%9������&9���'9������(9��������������A�)9B�*9C�D�E�F�G�H�I�J�+9,9-9K�.9L�M�/9091929N�O�P�Q�R�3949S�59T�69U�V�W�79X�8999Y�Z�a�:9b�c�d�;9e�f�g�h�i�j�k�l�<9m�=9n�o�p�q�r�s�t�u�>9v�w�x�y�z���������������������������������������������?9������@9������A9��������������������������������������B9������C9������D9��������������E9����F9������’ÒĒŒƒG9ǒȒɒH9ʒ˒̒I9͒ΒϒВђҒӒJ9ԒՒK9֒גْؒڒےܒݒޒߒ�����������������������������L9M9����N9����O9P9��Q9A�B�C�D�E�R9S9F�T9U9V9G�W9H�X9I�J�Y9Z9[9\9]9K�L�^9_9`9a9b9M�N�O�P�c9d9Q�e9R�f9S�T�U�g9V�W�h9i9X�Y�j9Z�a�b�k9c�d�e�f�g�h�i�l9m9j�n9o9p9k�l�m�q9n�o�r9s9p�q�t9r�s�t�u�v�w�x�y�z�������u9����������������������������������������������������������������������������v9w9����x9����y9z9��{9����������|9}9��~9��!:":����������#:$:����%:����&:':������“Óēœ(:):Ɠ*:+:,:Ǔȓɓʓ˓̓-:.:͓Γ/:ϓГѓ0:ғӓԓՓ֓דؓٓ1:ړ2:3:4:ۓܓݓ5:ޓߓ6:���7:��������������������������8:9:::��;:������<:��A�B�C�D�E�F�=:>:G�?:H�@:I�J�K�L�M�N�A:O�P�Q�B:R�S�T�U�V�W�X�Y�Z�a�b�c�d�e�f�C:g�h�i�j�k�l�m�D:n�o�p�q�r�s�t�u�v�w�x�y�z�������������E:��������������F:G:����H:������I:��������������J:K:��������������������L:������M:����������������������������������������������N:O:����P:����Q:R:S:T:”ÔĔŔƔU:V:ǔW:ȔX:ɔʔ˔Y:Z:̔[:͔ΔϔДєҔӔ\:ԔՔ֔הؔٔڔ۔ܔݔޔ]:ߔ������^:���������������������������������A�B�_:`:C�D�a:E�F�G�b:H�I�J�K�L�M�N�O�P�Q�R�S�c:T�U�V�W�X�Y�d:Z�a�b�e:c�d�e�f:f�g�h�i�j�k�l�g:m�n�h:o�i:p�q�r�s�t�u�j:k:v�w�l:x�y�z�m:��������������n:o:��p:������������������������������������������������������������������������q:r:����s:������t:��u:����������v:w:��x:��y:z:{:��������|:}:����~:����•!;Õ";ĕŕƕǕȕ#;$;ɕ%;&;';ʕ˕͕̕Ε(;);*;ϕЕ+;ѕҕӕ,;ԕՕ֕וٕؕڕ-;.;ە/;0;1;ܕݕޕߕ��2;3;��������������4;�����������������������A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�5;6;Y�Z�7;a�b�8;9;c�d�e�f�g�h�i�:;j�k�;;<;=;l�m�n�o�p�q�>;r�s�t�u�v�w�x�y�z�����������������������?;������������@;A;����������������������������B;C;��D;E;F;������������������������������������������������������������������–G;H;ÖĖI;ŖƖǖJ;Ȗɖʖ˖̖͖ΖK;L;ϖЖіM;ҖӖԖՖ֖זٖؖږۖܖݖޖߖ���������������������������������������A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�N;R�S�T�U�V�W�X�Y�Z�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�O;s�t�u�v�w�x�y�z�������������������������P;������������Q;R;����S;������T;��������������U;����V;��W;����������������������������������������������������������������—×ėŗƗǗȗɗʗ˗̗͗ΗϗЗїҗӗԗ՗֗חؗٗڗۗܗݗޗߗ���������������������������������X;������A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�Y;R�S�T�U�V�W�Z;X�Y�Z�[;a�b�c�\;d�e�f�g�h�i�j�];^;k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z���������������������������������������������_;`;����a;������b;��������������c;d;��e;��f;������������g;h;��i;j;����k;l;m;n;����������o;p;��q;r;s;������t;����u;v;����w;������x;��������˜ØĘy;z;Ř{;|;};ƘǘȘɘʘ˘~;!<̘͘"<ΘϘИ#<јҘӘԘ՘֘ט$<%<ؘ&<٘'<ژۘܘݘޘߘ(<���)<���*<�������+<����,<������-<.</<0<1<����2<3<��4<5<��������6<7<��8<9<:<A�B�C�D�;<E�<<=<F�G�><H�I�J�?<K�L�M�N�O�P�Q�@<A<R�B<C<D<S�T�U�V�W�X�E<F<Y�Z�G<a�b�c�H<d�e�f�g�h�i�j�I<J<k�K<L<M<l�m�n�o�p�q�N<r�s�t�O<u�v�w�P<x�y�z�������������������Q<������������R<S<T<��U<������V<��W<����������X<Y<��Z<��[<������\<����]<^<����_<������`<������������������������a<������������b<������c<������d<��������™Ùęe<řƙf<g<Ǚșəʙ˙̙͙h<ΙϙЙi<љҙәj<ԙՙ֙יؙٙڙk<l<ۙm<ܙݙޙߙ����n<o<��p<���q<�������r<s<�t<�u<�������v<w<����x<����y<z<������A�B�C�D�{<|<E�}<F�~<G�!=H�"=#=I�$=J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�a�b�%=c�d�e�f�g�h�i�&='=j�k�(=l�m�n�)=o�p�q�r�s�t�u�*=v�w�x�y�+=z�����������,=-=����.=������/=��������������0=1=��2=��3=������������4=5=������������6=��������������7=����8=��9=������������:=;=����<=������==>=������������?=@=��A=��B=����������šÚĚŚƚǚȚɚʚ˚͚̚ΚϚКњҚӚԚ՚֚ךؚٚښۚܚݚޚC=D=ߚ�E=��F=G=������H=I=J=�K=�L=����M=�N=O=�P=Q=���R=�����������S=T=����U=V=����A�B�C�W=X=Y=D�E�Z=F�G�H�[=I�J�K�L�M�N�O�\=]=P�Q�^=_=R�S�T�U�V�W�X�Y�Z�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�`=s�t�u�v�w�x�y�z�����������������������������������������������������a=b=����c=������d=��e=����������f=g=����h=i=������������j=������k=������l=����������������������������›ÛěśƛǛțɛʛ˛̛͛ΛϛЛћқӛԛ՛֛כ؛ٛڛۛܛݛޛߛ�������m=������������������������������n=o=��A�p=B�C�q=r=D�s=E�F�G�H�I�t=u=J�K�L�v=M�N�O�P�Q�R�w=x=S�T�y=U�V�W�X�Y�Z�a�b�c�d�e�f�g�h�i�z=j�k�l�m�n�o�p�{=q�r�s�t�u�v�w�x�y�z�������������������|=��������������}=������~=������!>��������������">#>��������������������$>����������������������������������������������������œ%>&>ÜĜ'>ŜƜǜ(>Ȝɜʜ˜̜͜Μ)>*>ϜМќ+>ҜӜԜ՜֜ל,>؜ٜڜۜܜݜޜߜ�����������->�������.>���������������������A�B�C�D�E�F�G�H�I�J�K�L�M�N�/>O�P�Q�0>R�S�T�U�V�W�X�Y�Z�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�������������������1>������������2>3>����4>������5>��6>��������7>8>9>��������������������:>������;>������<>��������������=>����������������������>>?>����@>������A>��ÝĝŝƝǝB>C>ȝD>ɝE>ʝ˝̝͝ΝϝF>G>НѝH>I>J>ҝK>L>M>ӝԝ՝֝N>O>P>םQ>R>S>؝ٝڝT>U>۝V>W>ܝݝX>ޝߝ�Y>�������Z>[>�\>]>^>������_>`>��a>���b>�c>��������d>e>��f>��g>������h>A�i>j>B�C�D�k>E�F�G�l>H�I�J�K�L�M�N�O�m>P�Q�R�S�T�U�V�W�X�Y�n>o>Z�a�p>q>b�r>s>t>u>c�d�e�f�g�v>w>x>y>z>{>|>h�}>i�~>j�!?"?k�l�#?m�n�o�$?p�q�r�s�t�u�v�%?&?w�'?x�(?y�z���������)?*?+?��,?������-?��.?/?��������0?1?2?3?4?5?������6?7?8?9?������:?������;?��������������<?=?��>???��������������@?A?����B?������C?D?E?��F?����G?H?I?��J?��K?��L?��������M?N?����O?������P?��������������Q?R?��S?T?U?žÞĞŞƞǞV?W?ȞɞX?ʞ˞̞͞ΞϞОўҞӞԞY?՞֞Z?מ[?؞ٞڞ۞ܞݞ\?]?ޞߞ^?���_?�������`?a?�b?�c?������d?e?��f?���g?��������������h?i?��j?A�k?B�C�D�E�F�G�l?m?H�I�n?J�K�L�o?p?q?M�N�O�P�Q�r?s?R�t?S�u?T�U�V�W�X�Y�v?w?Z�a�x?b�c�d�y?e�f�g�h�i�j�k�z?{?l�m�|?}?n�o�p�q�r�s�~?!@t�u�"@v�w�x�#@y�z�����������$@%@������&@������������'@(@����)@������*@��������������+@,@��-@��.@������������/@0@����1@������2@��������������3@4@��5@��6@��7@��������8@9@����:@������;@����������<@��=@>@��?@Ÿ@@A@B@C@D@E@F@G@ßğşH@ƟǟȟI@ɟʟ˟̟͟ΟϟJ@ПџK@ҟӟԟ՟֟ן؟ٟL@M@ڟ۟N@ܟݟޟO@P@Q@ߟ���R@S@T@�U@V@W@X@���Y@�Z@[@��\@�]@^@_@�`@�����a@b@�c@d@e@f@�����g@h@����i@������j@������A�B�C�D�k@l@E�m@n@o@F�G�H�I�J�K�p@q@L�M�r@N�s@O�t@P�Q�R�S�T�U�V�u@W�X�Y�Z�v@a�b�c�d�e�f�w@g�h�i�x@j�k�l�y@m�n�o�p�q�r�s�t�u�v�w�x�y�z�����������z@{@����|@������}@��~@����������!A"A��#A��$A%A����������&A'A����(A������)A��������������*A+A��,A��-A������������.A������/A������0A��������������1A2A����3A4A������������5A�� àĠŠƠǠȠɠʠˠ̠͠ΠϠРѠҠӠԠՠ֠נؠ٠ڠ۠6A7Aܠݠ8Aޠߠ�9A�:A�����;A<A�=A�>A?A@A���AABACA������DA�����������EA��FA��GA������A�B�C�HAD�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�IAJAW�X�Y�Z�a�b�KAc�d�e�LAf�g�h�MAi�j�k�l�m�n�o�NAOAp�PAq�QAr�s�t�u�v�w�RASAx�y�TAz�������������������������������UA������������VAWA����XA������YAZA[A����������\A]A��^AA�_AB�C�D�E�F�G�`AH�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�aAa�b�c�d�e�f�g�bAh�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�����������������cAdA����eA������fA��������������gAhA��iA����������������jA������kAA�B�C�lAD�E�F�G�H�I�J�mAK�L�M�N�O�P�Q�R�S�T�U�nAoAV�W�pAX�Y�Z�qAa�b�c�d�e�f�g�rAsAh�tAi�uAj�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�����������������������������������vAwA����xA����yAzA��{A����������|A}A��~A��!B"B����#B$B��%B&BA�B�'BC�(BD�)BE�F�*BG�H�I�J�+B,BK�-B.B/BL�M�N�O�P�Q�0B1BR�S�2BT�U�V�3BW�X�Y�Z�a�b�c�4B5Bd�6B7B8Be�f�g�h�i�j�9Bk�l�m�:Bn�o�p�q�r�s�t�u�v�w�x�y�z�������;B����������������������������������������������������������A�B�C�D�E�<B=BF�G�>BH�I�J�?BK�L�M�N�O�P�Q�@BABR�BBCBDBS�T�U�V�W�X�EBY�Z�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�FBs�t�u�v�w�x�GBy�z�����������������������������������HB������������������������������A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�IBJBU�V�KBW�X�Y�LBZ�a�b�c�d�e�f�MBNBg�OBh�PBi�QBj�k�l�m�RBSBn�o�p�q�r�s�TBt�u�v�w�x�y�z���������UB��������������VB��������������������������������������WB����A�B�C�D�E�XBF�G�H�YBI�J�K�ZBL�M�N�O�P�Q�R�[B\BS�T�U�V�W�X�Y�Z�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�]Bx�y�z�������^B_B����`B������aB��������������bBcB������dB������������eB����������������A�B�C�D�E�F�G�H�I�J�K�fBgBL�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�hBt�u�v�w�x�y�z�����������������������������������������iB������������������������A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�jBP�Q�R�S�T�U�V�W�X�Y�Z�a�b�c�d�kBe�f�lBg�mBh�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�������������������������������nBoB����pB������qB��������������rBsB������tBuB����A�B�vBwBxBC�D�yBE�zBF�{BG�H�I�J�K�L�M�|B}BN�~B!C"C#CO�P�Q�R�S�$C%CT�U�&CV�W�X�'CY�Z�a�b�c�d�e�(C)Cf�*C+C,Cg�h�i�j�k�l�-Cm�n�o�.Cp�/Cq�0Cr�s�t�u�v�w�x�1Cy�z�����2C������������������������������������������������������������A�B�C�D�3C4CE�F�5CG�H�I�6CJ�K�L�M�N�O�P�7C8CQ�9C:C;CR�S�T�U�V�W�<C=CX�Y�>CZ�a�b�?Cc�d�e�f�g�h�i�@CACj�BCk�CCl�m�n�o�p�q�DCr�s�t�ECu�v�w�x�y�z�������������������FC��������������GC������HC��������������������������A�B�C�ICD�E�F�G�H�I�JCKCJ�K�LCL�M�N�MCO�P�Q�R�S�T�U�NCOCV�PCW�QCX�Y�Z�a�b�c�RCd�e�f�SCg�h�i�TCj�k�l�m�n�o�p�q�r�s�t�u�UCv�w�x�y�z�����������������������������������������������������������VC������WCA�B�C�XCD�E�F�G�H�I�J�YCZCK�[CL�\CM�N�O�P�Q�R�]CS�T�U�V�W�X�Y�Z�a�b�c�d�e�f�g�^Ch�i�j�k�l�m�n�o�p�q�r�_C`Cs�t�aCu�v�w�bCx�y�z���������cCdC��eC��fC������������gC��������������������������������������hC��A�B�C�D�E�F�iCG�H�I�jCJ�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�a�b�c�d�e�f�kCg�h�i�lCj�k�l�mCm�n�o�p�q�r�s�nCoCt�pCu�qCv�w�x�y�z���rC������sC������tC��������������uC��������vC������������wCxC����yC������zC������A�B�C�D�{C|CE�}CF�~CG�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�a�b�c�d�e�f�g�h�i�j�k�l�m�n�!D"Do�p�#Dq�r�$D%D&Ds�t�u�v�w�x�'D(Dy�)Dz�*D������������+D,D����-D������.D��������������/D0D��1D��2D������������3D4D����5D������6D��A�B�C�D�E�F�7D8DG�9D:D;DH�I�J�K�L�M�<D=DN�O�P�Q�R�S�T�U�V�W�X�Y�Z�a�b�c�d�e�f�>Dg�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�����������������������������?D@D����AD����BDCD��������������DDED��FDGDHD������������IDJDA�B�KDC�D�E�LDF�G�H�I�J�K�L�MDNDM�ODN�PDO�P�Q�R�S�T�QDU�V�W�RDX�Y�Z�SDa�b�c�d�e�f�g�TDUDh�VDWDXDi�j�k�l�m�n�YDo�p�q�r�s�t�u�v�w�x�y�z�������������������������������ZD[D����\D������]D��������������^D_D��`D��aD������A�B�C�bDcDD�E�dDF�G�H�eDI�J�K�L�M�N�O�fDP�Q�R�S�gDT�U�V�W�X�Y�hDZ�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�iDt�u�v�w�x�y�jDz�������������kD��������������������������������������lD��������������A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�mDnDU�V�oDW�X�Y�pDZ�a�b�c�d�e�f�qDrDg�sDh�tDi�j�k�l�m�n�uDo�p�q�vDr�s�t�wDu�v�w�x�y�z�������������xD������������yD����������������������������������������zDA�B�C�D�E�F�{D|DG�H�}DI�J�K�~DL�M�N�O�P�Q�R�!E"ES�#ET�$EU�V�W�X�Y�Z�%Ea�b�c�&Ed�e�f�'Eg�h�i�j�k�l�m�(En�o�p�q�r�s�t�u�v�w�x�)E*Ey�z�+E������,E��������������-E.E������/E��������������������������������������A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�0E1EP�Q�2ER�S�T�3EU�V�W�X�Y�Z�a�4E5Eb�6Ec�7Ed�e�f�g�h�i�8E9Ej�k�:El�m�n�;E<Eo�p�q�r�s�t�=E>Eu�?E@EAEv�w�x�y�z���BECE����DE������EE��������������FEGE��HEIEJE������������KE������������������������A�B�C�D�E�F�G�H�LEI�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�MENEq�r�OEs�t�u�PEv�QEw�x�y�z���RESE��TEUEVE������������WEXE����YE������ZE��������������[E\E��]E��^E������������_E������`E��A�B�C�D�E�F�G�H�I�J�K�L�M�N�aEO�P�Q�R�S�T�U�bEV�W�X�cEY�Z�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�dEeEv�w�fEx�y�z�gE��������������hEiE��jE��kE��������lE��mE������nE������������������������������A�B�C�D�E�F�G�H�oEI�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�a�b�c�d�e�f�g�h�i�pEj�k�l�qEm�n�o�p�q�r�s�t�u�v�w�x�y�z�rE��sE������������tE��������������������������������������������������A�B�uEvEC�D�wEE�F�G�xEH�I�J�K�L�M�N�yEzEO�{EP�|EQ�R�S�T�U�V�}EW�X�Y�Z�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�~Ep�q�r�s�t�u�v�!Fw�x�y�z�����������������������������������������������"F#F����$F������%F��������A�B�C�&F'FD�E�F�(FG�H�I�J�K�L�)FM�N�O�*FP�Q�R�+FS�T�U�V�W�X�Y�,FZ�a�b�c�-Fd�e�f�g�h�i�.F/Fj�k�0Fl�m�1F2Fn�3Fo�p�q�r�s�4F5Ft�6Fu�v�w�x�y�z�����7F������8F������9F��������������:F;F��������������������<F=F����>F������?F����A�B�C�D�E�@FAFF�BFG�CFH�I�J�K�L�M�DFEFFFN�GFO�P�Q�HFR�IFS�T�U�V�W�JFKFX�LFMFNFY�Z�a�OFb�c�PFQFd�e�RFf�g�h�SFi�j�k�l�m�n�o�TFUFp�VFWFXFq�r�s�t�u�v�YFZFw�x�y�z�����������������������������������������������������������������A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�[F\FS�T�]FU�V�W�^FX�Y�Z�a�b�c�d�_F`Fe�aFbFcFf�g�h�i�j�k�dFeFl�m�fFn�o�p�gFq�r�s�t�u�v�w�hFiFx�jFy�kFz�����������lF������mF������nF��������������oFpF����qFrF������������sF������������A�tFB�C�D�E�F�G�H�I�uFJ�vFK�L�M�N�O�P�Q�R�wFxFS�T�yFU�V�W�zFX�Y�Z�a�b�c�d�{F|Fe�}Ff�~Fg�h�i�j�k�l�!Gm�n�o�p�q�r�s�t�u�v�w�x�y�z�������������"G����������������������������������������������������A�B�C�D�E�F�G�H�#GI�J�K�$GL�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�a�b�c�d�e�f�g�h�%Gi�j�k�&Gl�m�n�'Go�p�q�r�s�t�u�v�(Gw�)Gx�y�z�����������*G+G����,G����-G.G��/G����������0G1G��2G��3G������������4G������������������A�B�C�D�E�F�G�H�I�J�K�5GL�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�6Gt�u�v�7Gw�x�y�8Gz�������������9G����:G����������������;G������<G������=G��������������>G����?G��@GA�B�C�D�E�F�AGG�H�I�BGJ�K�L�CGM�N�O�P�Q�R�S�DGEGT�FGU�V�W�X�Y�Z�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z���������GGHG����IG������JG��������������KGLG��MG��NG������������OGPG����QG������RG������A�SGB�C�TGUGD�VGE�WGF�G�H�I�J�K�XGYGL�M�ZGN�O�P�[GQ�R�S�T�U�V�W�\G]GX�^G_G`GY�Z�a�b�c�d�aGe�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�bGy�z�����������������������������������������������������������������cGdGA�B�eGC�D�E�fGF�gGG�H�I�J�K�hGiGL�jGM�kGN�O�P�Q�R�S�lGmGT�U�nGV�W�X�oGY�Z�a�b�c�d�e�pGqGf�rGg�sGh�i�j�k�l�m�tGuGn�o�vGp�q�r�wGs�t�u�v�w�x�y�xGyGz�zG{G|G�‚ƒ„…†�}G�ˆ‰�~G�‹Œ�!H�Ž‘’“”�"H�–—˜™š›œž�#H$H� �%HA�B�C�&HD�E�F�G�'HH�I�(H)HJ�*HK�+HL�M�N�,HO�P�-H.HQ�R�/HS�T�U�0HV�W�X�Y�Z�a�b�c�d�e�1Hf�2Hg�h�i�j�k�l�3H4Hm�n�5Ho�p�q�r�s�t�u�v�w�x�y�zÁÂ�6H��7H�ÅÆÇÈÉ�8H9H�Ë�:H�ÍÎ�;H�ÐÑÒÓÔÕÖ�<H��=H��>H�ÚÛÜÝÞ�?H�à�A�@HB�C�D�AHE�F�G�H�I�J�K�L�BHM�CHN�O�P�Q�R�S�T�U�DHEHV�W�FHX�Y�Z�GHa�b�c�d�HHe�f�IHg�h�JHi�KHj�k�l�m�n�o�LHp�q�r�MHs�t�u�NHv�w�x�y�zāĂ�OH�ĄąĆ�PH�ĈĉĊċČ�QHRH�Ď�SH�Đđ�TH�ēĔĕĖėĘęĚěĜĝ�UH�ğĠ�A�B�C�VHWHD�E�XHF�G�H�YHI�J�K�L�M�N�O�ZH[HP�\HQ�]HR�S�T�U�V�W�^H_HX�Y�`HZ�a�b�aHc�d�e�f�g�h�i�bHj�k�cHl�dHm�n�o�p�q�r�eHfHs�t�gHu�hHiHjHkHv�w�x�y�zŁ�lHmH��nH��oH�Ņņ�pH�ň�qH�Ŋŋ�rH�ōŎ�sH�ŐőŒœŔŕ�tHuH�ŗŘ�vH�ŚśŜŝŞ�wHxH�Š�yHA�B�C�zHD�E�F�G�H�I�J�{H|HK�}HL�~HM�N�O�P�Q�R�PKVKgKOMhM-N{O"P8PPP]PTQUQXQ[Q\Q]Q^Q_Q`QbQcQdQeQfQhQiQjQkQmQoQpQrQvQzQ|Q}Q~Q"R#R'R(R)R*R+R-R2R>RBRCRDRFRGRHRIRJRKRMRNRORPRQRRRSRTRURVRWRYRZR^R_RaRbRdReRfRgRhRiRjRkRpRqRrRsRtRuRwRxRfT|T%U+U.U8VMVKWdWE[d[%\%]U]t]|^~^3_a_h_q`-amauc!d)d.e1e2e9e;e<eDeNePeReVeze{e|e~e!f$f'f-f/f0f1f3f7f8f<fDfFfGfJfRfVfYf\f_fafdfefffhfjfkflfofqfrfufvfwfyf!g&g)g*g,g-g0g?gAgFgGgKgMgOgPgSg_gdgfgwgghhhphqhwhyh{h~h'i,iLiwiAjejtjwj|j~j$k'k)k*k:k;k=kAkBkFkGkLkOkPkQkRkXk&l'l*l/l0l1l2l5l8l:l@lAlElFlIlJlUl]l^laldlglhlwlxlzl!m"m#mnm[n=rzr1s'tnttvvv8wHwSw[xpx!z"zfz)|!#"###$#%#&#'#(#)#*#+#,#-#.#/#0#1#2#3#4#5#6#7#8#9#:#;#<#=#>#?#@#A#B#C#D#E#F#G#H#I#J#K#L#M#N#O#P#Q#R#S#T#U#V#W#X#Y#Z#[#,!]#^#_#`#a#b#c#d#e#f#g#h#i#j#k#l#m#n#o#p#q#r#s#t#u#v#w#x#y#z#{#|#}#&"������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������K!L!~!~#��M!\#	

	

��124789ABCEFGHIJKLMN��������������OPQRS��TUVWXY��Z[\]^_��`abc����12345679:;<=>?@A�BDEFGHJKLMN����	

��������	
��
������	

�����������A�A�D�A�F�G�A�A�A�J�K�L�M�N�O�P�A�A�A�T�A�A�A�A�A�A�A�A�A�A�a��������A�a��������A�a��������A�a�����	



	

ԡ������������������������������������������������������������������;�|Q���\R���,S��`U���fV���X����Y���Y��|9[����[��P�[����]��tl_���la��(le����g��\j���\l���zRx�$�P���FJw�?:*3$"DxQ���D\�Z���F�K�H �B(�H0�H8��
0A(B BBBD zRx�8������(�Q���$�0\���H�A��
ALzRx��� RS��TD4�]���F�K�B �I(�H0�H8��
0A(B BBBD�JT��9H�<_���F�B�B �B(�A0�A8�D@�
8D0A(B BBBE zRx�@������(�U��
T�b��zO�E�B �I(�A0�D8�G@�
8A0A(B BBBAe��������V�� `��d��bF�E�B �B(�D0�H8�G@
8A0A(B BBBAD
8C0A(B BBBAEV��p,��f��3F�A�A ��
ABAzRx� ���$QW��Q0\`h���F�N�B �B(�A0�A8�G�$zRx��������(,2W��G
8A0A(B BBBAGNU��B@B��!�D@�!lD@�!�D@�!�DeD�1 >lD�3�;@D�5�7�D��A��A���A��A���A��A���A��A���A���A�x�A��A�p�A��A�h�A��A�`�A�ܞA�X�A�ԡA�P�A�̤A�H�A�ħA�@�A���A�8�A���A�0�A���A�(�A���A� �A��A���A�`�A� �A��A���A�`�A� �A��A���A�`�A� �A��A���A�`�A� �A��A���A�`�A� �A���A���A�`�A� �A���A���A�`�A� �A���A���A�`�A� �A���A���A�`�A� �A���ARE!~�E!gJF!~G!~�G!xrH!d�H!o�I!~TJ!~K!s�K!vbL!qM!~�M!~|N!~8O!~�O!~�P!~lQ!~(R!~�R!~�S!~\T!~U!~�U!~�V!~LW!~X!~�X!~�Y!~<Z!~�Z!~�[!~p\!~,]!~�]!~�^!~`_!~`!~�`!~�a!~Pb!~c!~�c!~�d!~@e!~�e!~�f!~tg!~0h!~�h!~�i!~dj!~ k!~�k!~�l!~Tm!~n!~�n!~�o!~Dp!~q!~�q!~xr!~4s!~�s!~�t!~hu!~$v!~�v!~�w!~Xx!~y!~�y!~�z!~H{!~|!~�|!~|}!~8~!~�~!~�!~l�!~(�!~�!~��!~\�!~�!~Ԅ!~ �����g��������*�Q�������������`�����mx��f�1�"�"������������������������������z��n��j��L����
�����������������

���������T�T�H���������!��#��%��'
�z)�h+�`-�^/�D1�83�.5�.7��8��:��<	��=6��?�~A�xC�lE�fG�ZI�8K�2M�0O�"Q�S�U�:V7��W��Y
��[��]��_�la
�Lc�2e*fw�g��h��j��l��n��p�4r
�t	��u��w��x��z��|��~�΀�΂�΄�Ά�Έ�Ί�Ό�Ύ�ΐ�Β�Δ�Ζ�Θ�Κ�Μ�Ξ�Π�΢�Τ�Φ�Ψ�Ϊ�ά�ή�ΰ�β�δ�ζ�θ�κ�μ�ξ���������������������������.��Ufv�'
D��!��!���o`��
�@"8P&�h	���o���o����o�o����oI@
"�'�'�'�'(( (0(@(P(`(p(�(�D�@�D�D"GA$3a1�'!D_codecs_kr.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug��j��7zXZ�ִF!t/��w�]?�E�h=��ڊ�2N��y \�S�ߖ�C����N���S,u��u�/[lF	>Uh�>O10�3�C�t|������w�N�X�qV;�baa��j�}��p�l�= ��M���ko�I��:n�~8�W\�:�ӭ��H��q�j��\L�h��p��Ĺ/����_�:w]�Gt�kxM����}Qj��͡�#�=�� 
�-8��W3��T{o�^Q��;X#o�֓
�������<'5�V�>�ݾR�h3���fqD�#R��2�N9g����ѣ�+�+�=�˺iXc���Ix�������*]��$N�1­"2��%|G�y$Q�R�JU��n�I��?��2��������t�n�WJ3�U�]���.[0˘<���V�ǩC�2}�M;W�
����U!:d��x��5'��{�h�ZO�/��Ujѐ2	��m"o�6#��p�׵��J��v�����xE�G�QcB�Ց-o�ږL��X�-فF,67�777$�0T�#A*_�~GL-��ʠ���i��?A3��|c�P[�=��H�wÖ���G	s����4
�F�E.[�#�m���T�T�c������Kw�`8[�е�8�7�-P��Rr܁���-��=�U6�k�!b�j�{�w�39�%�+]CUrg�ʛ-���2�2n[�o��:;q��w`�B.t�f/@���F�‘�ʾ_���[���M��q�m��V�ޘre�N=�jgw",�p�/1�{7�(E��I�pJs���4�~�iY������sg3EYIT~��@Ҙ���X;4���f�����U�ă��@\�O7K��U'x$B=`��?|����G�ܘp�CǺ���N�`d���@/��D��>��>�m#�VY�l2y5��(W��_Apu�\�xS'�pSx�78a��!���� ��;�EM�6���	���۬6@���� ����g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(��(0���8���o��.E���o��0T��h^BP&P&8h�'�'c�'�'�n�(�(�w`)`)�}DD
�@D@D� �4�4������������� ���!�����!�����!���1 �@
"@
�@"@��"� ��"���b�$
�d0<(lib-dynload/_dbm.cpython-38-x86_64-linux-gnu.so000075500000050260151153537510015015 0ustar00ELF>�@pI@8	@ - - (<(< (< �� @<@< @<   888$$---  S�td---  P�td�)�)�)��Q�tdR�td(<(< (< ��GNULg��z_]d�l-­�n/1�@ 14��|2�L�CE���qXb�,����w M�;��� a, 5F"J�.Bd
�Zn�:�p����S
�$�#���C ��#�w�C ~�C __gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libgdbm.so.6libgdbm_compat.so.4libpthread.so.0libc.so.6_PyObject_CallMethodId_SizeTPyErr_SetStringdbm_firstkeydbm_nextkeydbm_close_Py_NoneStruct_PyArg_Parse_SizeTPyExc_TypeErrordbm_deletedbm_clearerrPyExc_KeyErrorPyErr_SetObjectdbm_storedbm_error__stack_chk_faildbm_fetchPyBytes_FromStringAndSizePyUnicode_AsUTF8AndSizePyErr_FormatPyObject_Free_PyArg_ParseStack_SizeT_Py_Dealloc_PyArg_BadArgument_PyArg_CheckPositional_PyUnicode_ReadyPyFloat_TypePyType_IsSubtype_PyLong_AsIntPyErr_OccurredstrcmpPyUnicode_EncodeFSDefaultPyExc_ValueError_PyObject_Newdbm_openPyErr_SetFromErrnoWithFilenamePyList_NewPyList_AppendPyInit__dbmPyType_ReadyPyModule_Create2PyModule_GetDictPyExc_OSErrorPyErr_NewExceptionPyUnicode_FromStringPyDict_SetItemString_edata__bss_start_endGLIBC_2.4GLIBC_2.2.5�ii
�ui	�(< �#0< �#8< 8< @ �@ @ OX@ �@ �&�@ %�@ @(�@ �&�@ ^"�@ (�@ <&�@ �@ �'�@ E&�@ ��@ �&A �&A � A �&(A �`A P&hA jxA �(�A �&�A `A 8B �&PB ��B  @ �B @ C �@ �C �&�? �? �? 	�? �? 
�? �? �? �? �? !x> �> �> �> �> �> �> 
�> �> �> �> �> �> �> �> �> �> ? ? ? ?  ? (? 0?  8? "@? #H? $P? %X? &`? 'h? (p? )x? *�? +�? ,�? -�? .�? /�? 0��H��H�, H��t��H����5�* �%�* ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&��������%-( D���%%( D���%( D���%( D���%
( D���%( D���%�' D���%�' D���%�' D���%�' D���%�' D���%�' D���%�' D���%�' D���%�' D���%�' D���%�' D���%�' D���%�' D���%�' D���%�' D���%�' D���%}' D���%u' D���%m' D���%e' D���%]' D���%U' D���%M' D���%E' D���%=' D���%5' D���%-' D���%%' D���%' D���%' D���%
' D���%' D���%�& D��H��H����1�H�5�* 1��A�����USH��QH�H��uH�=�* H�5��k���H���&�{y�Z���1�H��t
H�{���x�����kHcCZ[]���SH��H�H��t���H��& H�CH�[���AUI��H�5�ATUH��SH��L��H��HdH�%(H�D$81�L�d$H�T$ L���n�����uL�+& H�5dI�8������IH�D$H�{�D$(H��uH�=* H�5�������C����H��u[H�t$ H�T$(�������H�{�3����CtH�=�% L��H�?�������H�=�) H�5�
� ������1�H�T$L��H��H�5������uH�
\% H�5�
H�9������}H�T$H�{A�H�L$H�t$ �T$H�T$(L�D$����y!H�{���H�= ) H�5T������,H�{�����tH�{�Y���H�=�( H�5%�f�����H�L$8dH3%(t���H��H[]A\A]���AUI��H�5�
ATI��L��US1�H��8dH�%(H�D$(1�H�L$H�T$�������H�D$I�\$�D$H��uH�=b( H�5[	�����nH�t$H�T$H���b���H��H��H��uH� $ L��H�:�e����=I�|$�����t!I�|$1��i���H�=( H�55
�v����H��Hc����H��H�L$(dH3%(H��t���H��8[]A\A]���SH��H��dH�%(H�D$1�H�uH�=�' H�5��
������lH�FH��H�����sH���\����$��H��u0�C��r!H�
:# H�P1�H�5�H�9�=�������VH�F H�{H���E���1�H��@��H�\$dH3%(��t����H��[���SH��H�H��t�9���H��[�0�������ATI��H��H��UH�	S1�H�� dH�%(H�D$1�H�L$I��L�D$H��" H�$1������tPI�\$H�,$H�t$�T$H��uH�=m& H�5f����$H���w���H��tHc�H���W���H���H�EH��H�L$dH3%(H��t��H�� []A\�����AVAUATI��H��H��UH�[S1�H��@dH�%(H�D$81�H�L$I��L�D$H�$�:������'I�\$H�,$L�t$D�l$H��uH�=�% H�5������H��L��L�����H��H�D$ H�T$(H��tHct$(H���u���H����H��u(1�1��_���H��H����H�D$ �D$(�D1�H�L$H�T$ H��H�5R�5�����uH��  H�5�H�:�{����^H�D$�D$(H�EI�|$H�L$ E1�L��L�D$(L�������y-I�|$�!���H�=�$ H�5��.���H�Mu
H������H��H�L$8dH3%(H��t�S���H��@[]A\A]A^���AWAVAUI��ATI��USH��dH�%(H�D$1�H�B�H��w-I�$H�Q���u;H��H�5�H�=������1��L��H�=s�����u���y xH���z�����u1��6I�,$I����I�L$H�Y���u!H�-H�551�H�=�c����H��H�����I��H��t�H��1�L���H��H��H��H;4$�GI��tkM�D$H�5c I�xH9�uL�
3 H�5$1�I�9���������u�I�|$���A�Ń��u$�%���H��t�%���A��L�5��A��H�5�L�����A�ą�tzH�5�L��������tYH�5mL�������tNH�5]L�������t;H�5L��A�B�����t(H�=�" H�5�1������A��A�BH������H��H���l���L�p I��1�L��L���H��L�H;Mt(L}uH���f���L�� H�5�1�I�:����cH�=E  ���H��H��t;D�xD��D��L��D�`��H�CH��uH�=�! L���j�H�uH�����1�H�MuH�������H�T$dH3%(H��t�a���H��[]A\A]A^A_���AUATUSQH�_H��uH�=g! H�5`�����pI��1����H��H��t\I�|$���+H��H��� ���H�MA��uH���_���E��u"I�|$��H��t"Hc�H������H��H��u�H�uH���+���1�ZH��[]A\A]�H�mt1��H�������pH��1����@H�=�  H��  H9�tH�� H��t	�����H�=q  H�5j  H)�H��H��H��?H�H�tH�U H��t��fD�����=-  u+UH�=: H��tH�=v �I��d����  ]������w������ATH�=# US�l���������H�=� �3�H��H�����H����H�=� I��uH�k 1�H�=>H�0�j�H�� H�=4�7�H��H��tH��H�5L����H�+�����H�L H��tH�5�L�����C�H���L���H��[]A\���H��H���DBM object has already been closeddbm mappings have bytes or string keys onlycannot delete item from databasedbm mappings have bytes or string elements onlydbm key must be bytes or string, not %.100sinteger argument expected, got floatarg 2 to open should be 'r', 'w', 'c', or 'n's#cannot add item to databases#|O:gets#|O:setdefaultopenstrargument 1argument 2embedded null characterrwc_dbm.errorlibraryclosekeys__enter____exit___dbm_dbm.dbmsetdefault($self, key, default=b'', /)
--

Return the value for key if present, otherwise default.

If key is not in the database, it is inserted with default as the value.get($self, key, default=None, /)
--

Return the value for key if present, otherwise default.keys($self, /)
--

Return a list of all keys in the database.close($self, /)
--

Close the database.open($module, filename, flags='r', mode=0o666, /)
--

Return a database object.

  filename
    The filename to open.
  flags
    How to open the file.  "r" for reading, "w" for writing, etc.
  mode
    If creating a new file, the mode bits for the new file
    (e.g. os.O_RDWR).GNU gdbm;����������+���4��Py�y��=��\�"�0���t�����^���DL����zRx�$p��FJw�?:*3$"D��p\ �p�$��VE�A�D IAA�E�*E�d8�S��F�L�A �D(�Jp�(A ABB4��F�L�G �A(�F`�(A ABB<���E�G �A\Q�E�U,xT��J�J�H �F@� AAB@���J�B�B �J(�H0�Fpu0A(A BBBH�J��F�B�B �E(�D0�A8�DP�8A0A(B BBB48��F�B�A �A(�A0�(D ABB(pL����F�H�A ��ABzRx� ���$���*GNU��#�#8< Ufs���
�$(< 0< ���o`��
�`> ��� 	���o���o����o�o6���o"@< ��� 0@P`p�������� 0@P`p�������� 0�O�&%@(�&^"(<&��'E&���&�&��&�P&j��(�&��������`A �& � @ @ �@ �&GA$3a1��$_dbm.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug
WT�7zXZ�ִF!t/����]?�E�h=��ڊ�2N���dN ��Fgxoة��!�3;�zA"��/+Y�p�1d�����H�;42�v��٨1!`3���$�q~��r�S8c^���kKwH���gs�a7����v�W���b��(ȯ+��LԮ)�c��9qr��ba�Ŀ�ha)rN���C��+�6󤷨`�jJ�#
�[�s!F��c���Y>�J�hh�=(�{��{�a
�~��7��4+�T�XK�bQ[:��'1V�x���B�`�~����	�jh�n�;G~z�p("s�m�$�
nE���+Jxϖ���SC/M��fj�����j���Au��c+�kABi�u,C�[<��3��񺧏��C�R֞�)^�CN���2;�_�P��A�G�kÉ�h�Nw�(�H�L-�����|ˏ��z���LA[�^t��ͤAY�L�p!�|h��#N
�N�i�)�u
�OT�3��_�k���T���Fr׏7p~�mT,�5�n�1��!�OA��ޠ�=�S�97�U�,�u�9�vT�*���Q1܍�Q�Mb<РW(d/A�v?��;@h��jʱ���r�+/~8��1q��I��\�#��ub�2P� :\&�l7G��͹�$��	Kt�W�y���j�dH!����2���J�+�Yel�Q6�Rv\|A��v�V���*�(},��Ԗ�X+H�y��;}>�u=I�yj������sXҩ	,�g29��kU>bW���0qC��Y�kw��d��M�+�-��܀	����mɜ��P�H��?����!��K7�y��[�3`dE���Kԍo�T���x�g{�~NG=�Шj)�հw�M��~w�å���ŗ"����IE���V��W6�:�k�:�����g������V��[ �0"K-��_8:�����0)��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(���0���8���o66jE���o��0T�� ^B���h��c���n@@pw��}�$�$
��$�$� ��)�)��0*0*��-- �(< (<�0< 0<�8< 8<�@< @< �`> `>��@ @� ��C �C��C`�C$
�C\XD�DH(lib-dynload/_struct.cpython-38-x86_64-linux-gnu.so000075500000157100151153537510015600 0ustar00ELF>02@�@8	@�� p�p� p� �� p�p� p� 888$$���  S�td���  P�td�����Q�tdR�tdp�p� p� ��GNU
�|�䵒ۣ��3c��ƹr�R�@  HRU�W��|CE���qXuf�U�E�L ��t�6�W����g ������(�, $F"�B1I���{���mbm��]�1���o8�����/�?�S�`�+S)�'�8� � � � � __gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6_Py_NoneStructPyFloat_FromDouble_PyFloat_Unpack8PyErr_Occurred_PyFloat_Unpack4_PyFloat_Unpack2PyObject_IsTruePyBool_FromLong__stack_chk_failPyLong_FromUnsignedLongLongPyLong_FromLongLongPyLong_FromUnsignedLongPyLong_FromLongPyBytes_FromStringAndSizePyLong_FromVoidPtrPyLong_FromSize_tPyLong_FromSsize_t_Py_DeallocPyObject_GC_UnTrackPyBuffer_ReleasePyObject_GC_DelPyErr_SetStringPyUnicode_AsASCIIStringstrlen_Py_ctype_tablePyMem_MallocPyMem_FreePyExc_TypeErrorPyErr_FormatPyErr_NoMemory_PyArg_UnpackKeywordsPyUnicode_FromStringAndSizePyType_GenericAllocPyObject_GetBufferPyObject_ClearWeakRefsPyTuple_NewPyNumber_IndexPyBuffer_IsContiguousPyFloat_TypePyType_IsSubtypePyLong_AsSsize_t_PyArg_BadArgumentmemsetPyExc_OverflowErrorPyErr_ExceptionMatchesmemcpyPyByteArray_TypePyFloat_AsDouble_PyFloat_Pack8_PyFloat_Pack4_PyFloat_Pack2_PyLong_AsByteArrayPyLong_AsVoidPtrPyDict_GetItemWithErrorPyDict_NewPyObject_CallFunctionObjArgsPyDict_ClearPyDict_SetItemPyErr_Clear_PyArg_CheckPositionalPyLong_AsLongPyLong_AsUnsignedLongPyLong_AsUnsignedLongLongPyLong_AsLongLongPyLong_AsSize_t_PyArg_Parse_SizeTPyExc_IndexErrorPyNumber_AsSsize_tPyInit__structPyModule_Create2PyType_TypePyType_ReadyPyErr_NewExceptionPyModule_AddObjectPyObject_GenericGetAttrPyObject_GenericSetAttrPyObject_FreePyObject_SelfIter_edata__bss_start_endGLIBC_2.14GLIBC_2.4GLIBC_2.2.5v����ii
�ui	p� 0tx� �s�� �� �� ��� ��� �� (�� �� �@� 0DH� nh� 0vp� �^�� @v��  w�  D� m0� D8� �YX� D`� @g�� �B�� �X�� �C�� @jй �Bع @c�� �D�  d � @D(� eH� �AP� ``p� �@x� p_�� �u�� Pv�� P�Ⱥ @�� `t� �|� @t� P|8� 3@� ~� ��� pv@� N�H� pwX� @�`� U�h� �Px� ���� ���� p�� `��� S��� �z�� ���� )�� @y� `�� Ĉ� PD��  � � �(� Pw8� ψH� 	�P� )3`� ��� ���� �v�� ���� ��  o�  �� N�� ��� �� U�� �Z� @� � ��(� `�8�  �@� S�H� PUX� @�`� )�h� 0~x� @��� ��� ��� �� (� � 0� )�h� �� p� )��� �� �� �� � 0D(� nH� 0vP� �^p� @vx�  w�� PC��  k�  B� Pa8� PC@�  k`�  Bh� Pa�� PC��  k��  B�� Pa�� �@�� �f� �?� �e(� �u0� �uP� �uX� �}x� 0u�� @}�� �t�� | � 0D(� nH� 0vP� �^p� @vx�  w�� �B�� �S� �A� �h8� �B@� �S`� �Ah� �h�� �B�� �S�� �A�� �h�� �2�� 7� �2� �6(� �u0� �uP� �uX� �}x�  u�� �|�� �t�� �{�� ��� 0O�� @��� @� ��  � � �D� �?�� ��� �v8� 02`� 0xh� � �� �� �� �� �� "�� #ȿ $п %ؿ +� 4� 5� Hp� (� (x� � I � ?X� �� �� �� �� �� �� �� �� 	Ƚ 
н ؽ 
� � � �� � � � �  � (� 0� 8� @� H� P�  X� !`� $h� &p� 'x� )�� *�� ,�� -�� .�� /�� 0�� 1�� 2�� 3Ⱦ 6о 7ؾ 8� 9� :� ;�� <� =� >� @� A � B(� C0� D8� E@� FH� GP� IX� J`� Kh� Lp� Mx� N�� O�� P�� Q��H��H�ɕ H��t��H����5�� �%�� ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&�������h'��q������h(��a������h)��Q������h*��A������h+��1������h,��!������h-��������h.��������h/������h0�������h1��������h2�������h3�������h4�������h5�������h6�������h7��q������h8��a������h9��Q������h:��A������h;��1������h<��!������h=��������h>��������h?������h@�������hA���������%m� D���%e� D���%]� D���%U� D���%M� D���%E� D���%=� D���%5� D���%-� D���%%� D���%� D���%� D���%
� D���%� D���%�� D���%�� D���%� D���%� D���%ݎ D���%Վ D���%͎ D���%Ŏ D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%}� D���%u� D���%m� D���%e� D���%]� D���%U� D���%M� D���%E� D���%=� D���%5� D���%-� D���%%� D���%� D���%� D���%
� D���%� D���%�� D���%�� D���%� D���%� D���%ݍ D���%Ս D���%͍ D���%ō D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%}� D���%u� D���%m� D���%e� D��ATI��UH��SH�H��H��uI�|$ 1�H��tH��H��[]A\��H��Ӆ�t�[]A\�1�H���1�H���1�H�����H�V1�H��H���H	�H���H��������H�N1�H��H��H���4H	�H���H��������H��H!�H��H	�H������������H��H!�H��H	����H�����H�������H�?�'�����H��*���H�=� H�5�N�'������CPH�=י H�5O������Z�I�.uL�����I�^H�-� H�5O1�H�SH�}������]H���H�=� H�5T����%�����*QA�1�H��L��� H�l$Ujj�
���H�� H��t�L�0M�NA����XL�����I��H���H�l�������M�t$(�ZH�+t1��CH�����������H�{ H�����&�����I�mtE1��4H�q��L��E1��~����H���q�����CI���CI����EI����EL��H�D$�G���H�L$�XEH�MH�'SE1�H�5/SH�=:S�,����NE���H��t&E1��<EL�
�� H�5wOE1�I�9�L����EH���EL��H��RH�5GS1�H�=S�����F1��EH�5D� H9�tL�L$L�T$���L�T$L�L$��txH�$L�CH�zI�p�H��tTL�$I�s(�yH�5�� H9�tL�L$L�T$�=���L�T$L�L$��tnL�$I�xH����H�4$H�v(�H��H��HN��oH�=+� H�5,O�_����1��|H�=� H��H�5�NH��1�1������ZH�=� H�5�N�����yH��[��H��[���H�=�� H�5�K������EH�=�� H�5�K�������&FH��[���H��[���H��[]�����ATI��H��U��S�H��t*H��E1���L��H������H���uH��������[]A\���ATI��H��U��S�>H��t-H��A�L��H�ǹ�����H���uH�������[]A\�H��H�����H�+I��tM��tL�e1��FH���������H��t��FH�>H�/u�j���H�E��V�c����L��H�D$�A���H�L$�`GI��PH��H��A�1�L�D$xAPL�'� jj���H�� H��H����F�GL�aH�\$ 1��H�D$H���I��H�MH��OH�5�O1�H�=�O������F����H���,GH����FL�
#� H�5L1�I�9����F�x�����FH�D$�i���H�D$�aGH�ֹ�H�=�O������
G1��%GH��H�D$�*���H�D$�H��t(H��tj�EH�W�H��L�]I��1�H���K�L����I������A�$H�=� 1�A��H����H�5L������A��A�����I�M9�����I�MH�wNH�5�NH�=�N����E1��8I�mu�L��E1��U����!H�w���R�����I�MH�'NH�5�NH�=gN�/����H�ֹ�H�=LN�D������I�mH��uH�%H������bH�� H�����H��H�D$���H�D$�H��H�D$���H�D$�H������!H�� H�5�ME1�H�;�����!E1��|!H�5�� H9�t5L�T$(H�L$ L�L$L�D$�1���L�D$L�L$��H�L$ L�T$(��H�T$H�}H�RH�w�H��tH�D$H�p(��"H�%H��HN�I���#H�5y� H9�t1L�T$(H�L$ L�L$L�D$��L�D$L�L$��H�L$ L�T$(t*H�t$L�^M���
"H�D$H�p(��!����d!H�=�� H�5sI������ H�=�� H�5�I���� H��H�D$�D���H�D$��"H��H�D$�-���H�D$H�����#��#H��H�D$����H�D$H�����$�$H��I���EH��A�I��I��D�M�%H��H�D$���H�D$�&H��H�D$��H�D$�	'H��H�D$��H�D$H�����'��'H��H�D$�x�H�D$H�����(�(H�߉D$�X�D$�_)H�߉D$�C�D$�)H��H�D$�-�H�D$�*H��f�EL�UH���A��,H��H�D$��H�D$�+H��H�D$���H�D$�8-�D
�L�I�H��I��1�M����.�L.H��H�D$��H�D$�/H���.�.H��H�D$��H�D$�/H��H�D$�l�H�D$�0���H��H��u0��H�+��1H��H�D$�8�H�D$�1H�%1����+��1H�5�� H9�t'L�L$L�T$L�D$���L�D$L�T$��L�L$thH�<$H�EL�_H�P�M��tDH�4$H�v(��4H��L��H9���H�\$ 1�L�H����H�m L�uM���R2��2H��L��HN���4H�=�� H�5�F����3H�5� H9�t'L�L$L�T$L�D$�3�L�D$L�T$��L�L$tJH�$H�BH����3H�$H�q(�3H�=+� H��t=H��tJH�J�H�5�GH��1����2H�=�� H�5�E�3��|2�2H�5:G1�����l2H�5OG1�����Y2H�,� H�5IH�8���1��:AH�D$�|�H�D$�&A1��hBf.����H��1���0H��tH�� H�@ fv�@H�H�P(H������H�V�H�J�H�����wH��H	�H����D�GH��L	�H��ttD�OH��L	�H��tbD�WH��L	�H��tPD�_H��L	�H��t>�OH��H	�H��t-�wH��L�GH	�H��tH�I��A�P�H��H	�I9�u�H�����D��H�?���@��H�V�H�J�H�����wH��H	�H����D�GH��L	�H���}D�OH��L	�H��tkD�WH��L	�H��tYD�_H��L	�H��tG�OH��H	�H��t6�wH��L�GH	�H��t+H�I��E�H�H��L	�I9�u�f�H���f�H���^�ff.���H�?�D�@��H�VH�J��D�H��~M�t�H��H	�H��t;D�D�H��L	�H��t(D�L�H��L	�H��tH��H��D�L	�H��u�H���U�D��H�V�H�J�H��~Q�wH��H	�H��t@D�GH��L	�H��t.D�WH��L�OL	�H��tH�I��E�Y�H��L	�I9�u�H�������H�?���@���?���D��H�VH�J��D�H��~Z�t�H��H	�H��tHD�D�H��L	�H��t5D�L�H��I��L	�I��tI��H��F�L	�M��u�f.�H�����������H��H!�H��H	���f���H�V�H�J�H��~\�wH��H	�H��tKD�GH��L	�H��t9D�WH��L�OL	�H��t-L�I��A�y�H��H	�M9�u�f.�H���K�������H��H!�H��H	����f���H�?���@��Hc?���@���?��@��H�?����H�?����H�?��@��H�GH�W H�H H�:H�q tH)�H�� H�|�u�H�����ff.����H�?���@��AWAVAUATI��H�~USH��(dH�%(H�D$1�H�FH�����H�����L�vI�V����w	L�����I��H�����H�H����P�I�|$(I�D$(H�/���L�h L���f�I;F��	A�^ I�n!��!����H�=�C��Lc�I�>A��f�H�i~ I��1�E1�1�I��������I��������I��������A����L�->z ��I��A�D�uލPЀ�	��D�E���/D8��/�K(H�S(���8��uD�CPH�SPE����D8��Z�KxH�Sx����8��BD���H���E����D8��!���H�������8��D���H���E����D8�����H�����e8����H��(D�E���GA8�u�A��s��A��x��A��p��I�H���oH��L�BH�BH��~	H���@H����{L��H)�H�I��H9��gI��A�H΄��d��I��A�D��P����PЀ�	�r�������0Hc�I��E�A�A��/��A��9�����}A8����C(H�S(���dA8������CPH�SP���KA8������CxH�Sx���2A8�������H������A8��������H�������A8���������H�������A8��������H������A8��k���D���M���ff.��<s�4<x��<p�$I����[���f.�I��������H��L9���H�4$�~$H��L�$$AD$���I��H�����I�|$ H���
M�l$ 1�I��������D�}E����L��v A��H��A��u�E�g��A��	�����k�D8���D�s(H�s(E���P�E8��mD�CPH�sPE���5�E8��R�CxH�sx����A8��9���H��������A8��D���H���E�����E8���D���H���E�����E8���D��H��E�����A�E8�t%H��(D�E���~�E8�u�ff.�@L�fH��~	M����A��s�bA��p�XA��x�|M�������I�}L�~I�� M�E�M��M�}�I�u�D�}L�E���:E��H��C���I���E�g�A��	�p���E��A��0Mc�H��D�}�A�w�@��	������A8����C(H�s(�����A8��-����SPH�sP�����A8�����D�KxH�sxE���l�E8������D���H���E���K�E8�����D���H���E���*�E8���������H�������A8��������H�������A8��T����t���@A��e���DI�E1�I�}I�EI�EH�|$dH3<%(��H��([]A\A]A^A_�L��H��k �G���A��s��A��xtA��p��I�H����H���L�BH�BH��~	H����H���tL��H)�H�I��H9��������H�=�� H�5H;������O���I��������H��L9�����A�L�cH��M���q���H���h���H�G�M�t$�M��H�I)�I��I)�M9����L��@���<s�8<x�=<p�(I���H��H���!���H��y �,���H��H�@�H�T$H�$H�F�H�H�|$H�$H)�L��H)�H9�����H���L9��{Hk�
A��0Mc�L�����H�Yj �����I��H�����H�<$�~$I�� L�L�$I�u�I�E�$AM�����L�����Mk�
A�ǃ�0H�I�����H�=  H�5�9�T���������2���E���J���H�=�~ H�5�4�&������H�ڹ�R���H�ڹ��I�M�VA������I�|$(M�t$(H�/���M�n H��1�L���H��H��I;Nu,E�^ I�n!A��!A���X���H��:E��Jc�H�>��H�=K~ H�5�8����������������L9�����A�PЃ��r����j���H�����D��SH�0H����H� H��t�?��H�{(H�/u��H�CH��[H��@��ff.�@AWI��AVAUATUSH��H����H�����H�I��1�L�#M��uH��L��[]A\A]A^A_�L�sH�SM�H�H9�uH�� ��A�$<st1<ptEH�T$L��L��A�T$H�T$H���g�H��LsI�D��H�sL��H�T$�x�H�T$��A�6H�KH9��>�I�~H�T$�R�H�T$�ff.�H�G���tH�H���H�P`H��tH��t�S�PH�=�| H�5�3���1�Z�ff.���AWAVAUATUSH��(H�GH�t$H9��I�H�wH��1����H��H���(�L�` H�S1�L��� ��H�[ L�+M����E1�L�SM��tmL�KM��M�H�T$I��A�uJ�L�H�$@��s�A@��p��L�T$L��H�4$L��L�L$A�U ��x>L��L�T$L�L$L)�LKL�u�M��H�� L�+M���z���H��(H��[]A\A]A^A_�L�$M�HA���tL�$n I�:�����uH�m�;�H��1��+���H�=B{ H�5@6�v����L�$I�{����L�H�$L�CH�xH�p I��H��I9�IN�H��~9I�yH��L�T$L�L$H�$�r��H�$A��L�T$H���IO�L�L$A�	L��LKL)�L���������H�$H�x�����H�$H�zH�r H9{HN{H��H��~�L��L�$���L�$I��롐ATUH��SH�����H�=@z H��t&H�=4z H���$��H��t'H�H�E�[]A\����H�	z H��u�1����S��H��u�1�H��H�=�v ���I��H��t�H�=�y H�c~�r��H�=�y L��H��������?�L�e��ff.����ATI��UH��SH��H��H�F�����H�H���n��H�+�
�H�����I�|$H��t&H���3�H�����������H�H9�wf�EH��L�]H�W�I��L��E�#H��H��t9L��A�CH��H��t(L��I�KA�sH��H��tH�H���Y�H��H9�u�1�H��[]A\�A�$H�=�x 1�A����H��H�5�0�������H�p`H����H��tvH���(��H��H��u>������H��trH�-k H�}�����t�H�=Fx H�5i3�z�����f���H���*��H�+t;H���t�I�|$H��������H�=x H�54/�7�����#���H������@��AWf�AVAUI��ATUSH��dH�%(H�D$x1�)D$ )D$0)D$@)D$P)D$`H���T�H�.H���r�H�=vw H���H���]��H��H���{H�L�d$ I�}1�L������������CL�����������H�D$ H�SH�D$H9T$0�H�{���I��H���p�H�k L�}M����H�$L�MM��t}L�4$L�D$LEA���s����p��L�L$L��L��L�D$A�WH����H�$I��L�L$L�D$LEK�D�L)�L�u�H�� L�}M��tL�ML�4$M��u�H�� L�}M���i���H�+�<�H�|$(tL�����H�L$xdH3%(L����H�Ĉ[]A\A]A^A_�ff.��H�=�u H�5z-1�E1������1��H���;1�H��H�=|r �w��H��H���H�=�u H�c��H��H���^�����.�L�d$ I�}1�L����������CL��������8���������6��H�Gu H����H��H���+��H��H���I���H��H�uL��L�L$L�D$���L�D$L�L$H���y�H�4$I��LEK�D�L)�L������d���A�0H�}H9��]�I�xL�L$L�D$�*��L�D$L�L$��I��H�=�t ��E1�H�|$(�Y���H�|$ �����J������f.���ATI��UH��SH��H��H�F���tyH�H�����H�+�Q�H���t"�����H9���A�$1�H��[]A\�D�[��H����H�=�f H�?�3����tgH�=�s H�5/���������H�P`H��t1H��t'H���j��H��H��t*H���z��H�+�h�����H�=�s H�5�*�������b���I���H+M1���L���UH�=`s H��H��H�5�+�^��D���(���fD��UH��SH��H��H�F���tKH�H�����H�+�=�H���teH=��w
f�E1�H��[]�H�=�r H�5l+����������H�P`H��teH��t[H���m��H��H��t�H�����H�+u���������H��t�H�
Ie H�9������t�H�=~r H�5�-������q���H�=cr H�5�)������V���ff.�@��AWAVAUATUSH��8H���y��L�&I��M������H�=r H��H���L������H��H���aH�PH��H�H9���H�s1��?��I��H���5��L�p H�S1�L�����H�k H�MH����E1�L�UM��tyL�MM��M�I���K�D�H�D$��s�d��p��L�T$(H��H�t$L��L�D$ L�L$H�L$�Q ��xaL�D$ L��L�T$(L�L$LML)�L�H�L$u�M��H�� H�MH���m���H�+�G��H��8L��[]A\A]A^A_�ff.�H�t$H�~���tL�c I�8�����uI�,$�"��L��E1�����H�=�p H�5�+����������H����1�L��H�=$m ���H��H����H�=Tp H�c��H��L�����������H�SH��H9��R���H�=%p H��1�E1�H�5�'�!������H�T$H�z�������H�|$L�_H�w L9]LN]L��M��~)L��L�T$H�L$L�D$�Q��L�D$H�L$L�T$I��L��LML)�L������y����2��H�=�o �5���E1��~���L�\$I�{�������H�D$H�}H�PH�p H��H9�HN�I��H��~LI�yL�T$(H�L$ L�D$L�L$H�T$���L�\$A��L�T$(H�L$ L�D$I���MO�L�L$E��A�������H��n H���U���L��H�����H��H���6���H��~���ff.���UH��SH��H��H�F���tJH�H�����H�+���H���tdH=�w�E1�H��[]�H�=\n H�5'����������H�P`H��teH��t[H������H��H��t�H�����H�+u�����^��H��t�H�
�` H�9�:����t�H�=�m H�5)�#�����q���H�=�m H�5%������V�����UH��SH��H��H�F�����H�H���C��H�+�/��H���tH�E1�H��[]�fD���H����H�
` H�9�����t2H�=Hm H�5k(�|��H�������[]�H�=)m H�5Z$�]�����H�P`H��t�H��t�H�����H��H��t�H�����H�+�������H���R���D��UH��SH��H��H�F�����H�H���#��H�+�`��H���tH�E1�H��[]�fD����H����H�
#_ H�9�����t2H�=Xl H�5{'���H�������[]�H�=9l H�5j#�m�����H�P`H��t�H��t�H�����H��H��t�H���}��H�+�������H���R���D��ATI��UH��SH��H��H�F����-H�H���~��H�+����H�����I�t$H���w�����H��H9���L�^��D5�H��M��~IB�D�H��I��1�I��t7M��F�T�1�I��I��t#F�d�I��I��tI��F�TI��M��u�1�H��[]A\��Y��H��t/H�=�] H�?�5������H�=�j H�5	&������I�t$H�������H��A�$H�=�j H)�H��H�5#��H��H��1�������v���H�P`H��tcH��tYH���"��H��H��u���K���H���*��H�+tSH����<���I�t$H��t9��A�I��I9�������[���H�=j H�5K!�N��������������ff.����UH��SH��H��H�F���t^H�H�����H�+����H���t
H�E1�H��[]����H��t|H�
Q\ H�9������tH�=�i H�5�$�������H�P`H��t-H��t#H���
��H��H��t�H�����H�+u��b��H�=8i H�5i �l�����s���H���d���ff.���UH��SH��H��H�F���t^H�H�����H�+���H���t
H�E1�H��[]����H��tzH�
q[ H�9������tH�=�h H�5�#��������H�P`H��t1H��t'H���*��H��H��t�H���*��H�+�������H�=Th H�5�����H���f���ff.�f���UH��SH��H��H�F���tiH�H���G��H�+�X��H���u@�B��H��t2H�
�Z H�9�����tH�=�g H�5�"��������H��[]�H��H�EH��1�[]�H�P`H��t1H��t'H���?��H��H��t�H�����H�+��������H�=ig H�5����������UH��SH��H��H�F���t*H�E1�1�H���H�����H�+����H��[]�H�P`H��t=H��t3H�����H�Ã�H��t�E1�1ɺH��H�����H�+u��?��H�=�f H�5��������ff.���UH��SH��H��H�F���t-H�1�H��A��H���G��H�+����H��[]�H�P`H��t@H��t6H������H�Ã�H��t�1�A��H��H�����H�+u����H�=f H�57�:�����D��ATI��UH��SH��H��H�F�����H�H�����H�+�Z��H������������H�H9�w�E1�H��[]A\�f.�H������1�I+L$��I��A�$H�=[e I��H�5�I��L��H���S��H����[]A\�H�P`H��tiH��t_H������H��H��tGH���
��H�+�O�������I��H��tIH�=�W H�?�%����tH�=�d H�5�������3���H�=�d H�5�����������H���
���f���ATI��UH��SH��H��H�F����(H�H���>��H�+�A��H�����I�|$H���V���H��H9�vwI��L�O��EI��M��~JI��L�UD�EH��I��t5I��A�I��I��t%I�RE�bH��I��tH�H���B�H��H9�u�1�H��[]A\�I�|$H���}���H��A�$H�5H)�H��H�=�c ��H��H��1�����������H��t�H�1V H�;�����t>H�=fc H�5�������z���H�P`H��t9H��t/H������H��H��u���O���H������H�+���������H�=	c H�5:�=�������������UH��SH��H��H�F���t)H�H������H�+����H���tCH�E1�H��[]�H�P`H��tbH��tXH���?��H��H��tCH�����H�+u��h�����H��tFH�
U H�9�����tH�=Pb H�5s������H�=8b H�5i�l�����s���H���d���ff.���ATI��UH��SH��H��H�F����H�H������H�+����H����?I�L$H��t&H����H�������������H�H9�wa�D
�H��L�I�I��M��F�T
�1�I��I��t5M��F�\
�I��I��t#F�d
�I��I��tI��F�T
I��M��u�1�H��[]A\�A�$A����H��H�=a H�5H1��!��H�������[]A\�L����I�����Q���A�$A��H�����H�P`H��tH��tuH���k��H��H��t�H�����H�+txH���tI�L$H������������H��tNH�-2S H�}������X���H�=b` H�5�������
���H�=G` H�5x�{������H����R�����UH��SH��H��H�F�����H�H����H�+�9��H���t5H���H����w
f�E1�H��[]�H�=�_ H�5������������H��tbH�5UR H�>������t�H�=�_ H�5������H�P`H��t:H��t0H�����H��H��t�H���Q���H�+�^������H���f���H�=2_ H�5c�f���n������UH��SH��H��H�F�����H�H����H�+�P��H���t4H���H���w�E1�H��[]�H�=�^ H�5������������H��teH�5VQ H�>������t�H�=�^ H�5�������H�P`H��t:H��t0H�����H��H��t�H���O���H�+�\������H���d���H�=0^ H�5a�d�����N���ff.����H������UH��SH��H�=�] H��t5�ٿ��H��H��tcH�xH�H����M�����H�+��H��[]����H��] H��t|H��H��荿��H��H��tH�H�{H�������
���ɿ��H��uH1�H��H�=Z ����H��H��t/H�=L] H�c~���H�=9] H��H�������u�����1��e��������AWAVAUATUSH��dH�%(H�D$x1�H�GH�HH9�����I��H��L�l$ 1�I�<$L��H�52�Z������XH�[O I�|$H�2访��H��H�����H����L�L$0H�UH��L��H)�H9��,H\$ 1�H���^���H�m L�uM����A�L�UM��tmL�MM��I�I��A�O�\�L�$<s��<p��L�T$L��H�4$L��L�D$L�L$A�V ��xkL�D$L��L�T$L�L$LML)�L�u�M��H�� L�uM���y���L���(���H�qN H�H�L$xdH3%(�H�Ĉ[]A\A]A^A_�H�$L�KA���tL�6N I�:趽����uL���ʿ��1��H�=_[ H�5]蓿����I��H�H�=C[ H��1�H��H�5D�?���L��臿��1��c����k���H��u�H�UL�M��~'H�=[ H��H�5�1�����L���I���1��%���L�L$0M��I�����H�=�Z L��H��1�H�5K�Ƽ��L������1������H�<$H�����
��L�$I�CI�s H9EHNEH��H��~L��L�T$L�$���L�$L�T$I��L��LML)�L�������W���H�$H�z�������H�4$H�EL�^H�v H��L��L9�HN�H��~CI�yH��L�T$L�D$L�L$H�$�t���H�$A��L�T$L�L$H���IO�L�D$A�	�e����H�=�Y H��Y H9�tH�L H��t	�����H�=iY H�5bY H)�H��H��H��?H�H�tH��K H��t��fD�����=%Y u+UH�=�K H��tH�=nC 詻���d�����X ]������w������H�H�D$��D$����f���f��Z�ߺ��ff.�@H������f.g&{	H��鴺��u��D$�׺��H��������D$��fD����D��1���H���w���f.&{	H���T���u��D$�w���H���e����D$��fD����D��1���H������f.�%{	H����u��D$����H�������D$��fD����D��1�����SH��H���@�����x�1�[Ã�[Ð���?@��@���̸��ff.����H��dH�%(H�D$1���D$H�D$dH3%(u�|$H��郸���^���ff.����?锺��@����R���f���SH��H��萸����x�1�[Ã�[���H�OH��tH�G(H+GhH�H�yH���ͺ��1���f���H�=}V H��uH�)I H��H�/H�]V u�P�=���H�I H�Z���SH�����H�{H��uH�{葺��H��[騷��H�/u������ff.���QH�F�������H�~������V 1��Z�D��H�(H�wH�� ����ff.���ATUSH�taH��I��H�=�S 1��
���H��H�������1�H�pL�������������H�C(H�MH�H��H��u2H�EH�kH�ChH��[]A\�H�=IU H�51�1��I�����H�=0U 1�H��H�54�/���H�+�'���H��1�����f���H�GH��tLSH��H�WhH;W(}HWH�xH�p �$��H�SH�JHKh[�H�GH�(����H�{����1�[��fDAPI��H�GH��xBL�
M��M)�I9�|H�H�w H�YL����H�=iT J�H��1�H�5�d���1�Z�H�H��~H�=@T H��1�L��H�5�
�<�����L�
L��L������H�=T L��L��1�H�5�
�����ff.���AUATI��UH��H��H��SH��dH�%(H�D$x1�H���H�\$�1�H���H���$���H������I��H������H�}1�H��������G����CH������������I����H�uH�~H�5�E H9���������������H�}�׷��I��H�����H���ӵ��I�mH�������H�����L��H�SH���L���I��H�|$tH���9���H�\$xdH3%(L��ucH�Ĉ[]A\A]�1��H�\$L�i�H���I�PH��H��A�1�L�D$hAPL��H jj�H���H�� H��H�������6���讵���"���f���AT�I��1�UH��SH��`dH�%(H�D$X1�H��H��H���L��蔴�����2����CH��说���������H�$H�uH9t$u<H�}H�u �+��H��H�|$tH���(���H�L$XdH3%(H��u%H��`[]A\�H�=�Q H��1�1�H�5	袳����۴��ff.���SH��H��H���|���f.,{H��H�߾[�@���u��D$蓳��H���a����D$��f���SH��H��H���,���f.�{H��H��1�[��u��D$�F���H�������D$��D��SH��H��H���ܳ��f.�{f�1�H��[�u��D$���H���۹���D$�����SH��H��H��茳���Z�.A{f~1�H��[�u��D$覲��H��������D$��D��SH��H��H���<���f.�{H��H�߾[��u��D$�S���H���k����D$��f���SH��H��H�����f.�{H��H��1�[飲��u��D$����H���(����D$��DU��SH��H��H��蝲��f.M{H����H��[]�s���u��D$趱��H������D$��D����D��1�����ATUH��H��S�M��H���?�����[]A\�ff.����ATUH��H��H��SH��dH�%(H��$�1�H�������H�\$ �1�H�D$H���H���Q���H���G���I��H���;���H�}H�t$�$������H�}1�H����������CH���	������[���I����H�uH�~H�5�@ H9��u���������h���H�}�ɲ��I��H���<���H���Ű��I�,$H�������H���tgH�|$H�SH���@���H��H�|$H��t
H�/�,���H�|$(tH������H��$�dH3%(H��uH�Đ[]A\�1��1���ڰ��鴸��D��SH��H�� dH�%(H�D$1�H�D$H���Ҹ��H�;H�t$������t=H�sH�|$�r���H�|$H��t
H�/�����H�L$dH3%(uH�� [��S���頸��ff.�����B���f�������f���USH��(dH�%(H�D$1�H�D$H�����H��H�t$H��H�;�1����t8H�|$H�U�H�s�[�H�|$H�/�ƾ��H�L$dH3%(uH��([]�1���蜯��ff.����S��H�=�A �*���H�������H��H��> H�=�H H��H �������j���H�=EJ �������V���H�5�E H�=�6 �x�6L9�uH��(L�OM9Hu�Ѓ�<dt��?t
�oGA@H��(���t���tI��8�t�I��(A���u���H�=yK u1�1�H�=��Ǯ��H�`K H��t=H�TK H�5�H��H��!���H��G H��H�5�H��G ����H��[�釽����H��H���char format requires a bytes object of length 1required argument is not a floatStruct() argument 1 must be a str or bytes object, not %.200srepeat count given without format specifiercannot iteratively unpack with a struct of length 0iterative unpacking requires a buffer of a multiple of %zd bytesnot enough data to unpack %zd bytes at offset %zdoffset %zd out of range for %zd-byte bufferunpack_from requires a buffer of at least %zu bytes for unpacking %zd bytes at offset %zd (actual buffer size is %zd)required argument is not an integerinteger argument expected, got floatunpack requires a buffer of %zd bytespack expected %zd items for packing (got %zd)argument for 's' must be a bytes objectargument for 'p' must be a bytes object'%c' format requires %zd <= number <= %zd'%c' format requires 0 <= number <= %zuushort format requires 0 <= number <= (0x7fff * 2 + 1)ubyte format requires 0 <= number <= 255short format requires (-0x7fff - 1) <= number <= 0x7fffbyte format requires -128 <= number <= 127pack_into expected buffer argumentpack_into expected offset argumentpack_into expected %zd items for packing (got %zd)no space to pack %zd bytes at offset %zdpack_into requires a buffer of at least %zu bytes for packing %zd bytes at offset %zd (actual buffer size is %zd)embedded null characterbad char in struct formattotal struct size too longcontiguous bufferargument 'buffer'unpack_fromint too large to convertiter_unpackargument out of rangeargument 2missing format argumentw*Structstruct.error__length_hint__pack_into__sizeof__struct format stringstruct size in bytes_clearcachecalcsizeoffset_structunpack_iterator0���������������������������������������������������������������������������������������0������`������a��a��a��a��a��a��a��a��a��a��a��a��a��a��a��a��a��a��a��a��a��a��a��a��a��a����������a�����Struct(format)
--

Create a compiled struct object.

Return a new Struct object which writes and reads binary data according to
the format string.

See help(struct) for more on format strings.S.__sizeof__() -> size of S in memory, in bytesunpack_from($self, /, buffer, offset=0)
--

Return a tuple containing unpacked values.

Values are unpacked according to the format string Struct.format.

The buffer's size in bytes, starting at position offset, must be
at least Struct.size.

See help(struct) for more on format strings.unpack($self, buffer, /)
--

Return a tuple containing unpacked values.

Unpack according to the format string Struct.format. The buffer's size
in bytes must be Struct.size.

See help(struct) for more on format strings.S.pack_into(buffer, offset, v1, v2, ...)

Pack the values v1, v2, ... according to the format string S.format
and write the packed bytes into the writable buffer buf starting at
offset.  Note that the offset is a required argument.  See
help(struct) for more on format strings.S.pack(v1, v2, ...) -> bytes

Return a bytes object containing values v1, v2, ... packed according
to the format string S.format.  See help(struct) for more on format
strings.iter_unpack($self, buffer, /)
--

Return an iterator yielding tuples.

Tuples are unpacked from the given bytes source, like a repeated
invocation of unpack_from().

Requires that the bytes length be a multiple of the struct size.unpack_from($module, format, /, buffer, offset=0)
--

Return a tuple containing values unpacked according to the format string.

The buffer's size, minus offset, must be at least calcsize(format).

See help(struct) for more on format strings.unpack($module, format, buffer, /)
--

Return a tuple containing values unpacked according to the format string.

The buffer's size in bytes must be calcsize(format).

See help(struct) for more on format strings.pack_into(format, buffer, offset, v1, v2, ...)

Pack the values v1, v2, ... according to the format string and write
the packed bytes into the writable buffer buf starting at offset.  Note
that the offset is a required argument.  See help(struct) for more
on format strings.pack(format, v1, v2, ...) -> bytes

Return a bytes object containing the values v1, v2, ... packed according
to the format string.  See help(struct) for more on format strings.iter_unpack($module, format, buffer, /)
--

Return an iterator yielding tuples unpacked from the given bytes.

The bytes are unpacked according to the format string, like
a repeated invocation of unpack_from().

Requires that the bytes length be a multiple of the format struct size.calcsize($module, format, /)
--

Return size in bytes of the struct described by the format string._clearcache($module, /)
--

Clear the internal cache.Functions to convert between Python values and C structs.
Python bytes objects are used to hold the data representing the C struct
and also as format strings (explained below) to describe the layout of data
in the C struct.

The optional first format char indicates byte order, size and alignment:
  @: native order, size & alignment (default)
  =: native order, std. size & alignment
  <: little-endian, std. size & alignment
  >: big-endian, std. size & alignment
  !: same as >

The remaining chars indicate types of args and must match exactly;
these can be preceded by a decimal repeat count:
  x: pad byte (no data); c:char; b:signed byte; B:unsigned byte;
  ?: _Bool (requires C99; if not available, char is used instead)
  h:short; H:unsigned short; i:int; I:unsigned int;
  l:long; L:unsigned long; f:float; d:double; e:half-float.
Special cases (preceding decimal count indicates length):
  s:string (array of char); p: pascal string (with count byte).
Special cases (only available in native format):
  n:ssize_t; N:size_t;
  P:an integer type that is wide enough to hold a pointer.
Special case (not in native mode unless 'long long' in platform C):
  q:long long; Q:unsigned long long
Whitespace between formats is ignored.

The variable struct.error is an exception raised on errors.
���;��܎������,���4l����s��� z���x��������@��h	�����������%���	2����	M����	f���T
8����
O���(k������������������.���$
Y����
S����
]���g���P�������������������\���������W���$����d���������8՝������TE����\����s���`�����Ҡ����8����O����f�������L����������ҡ��$��l ����7���|���D��������������4i�������������������,����T����|������������������������L�����0����D���X���l,����<����L���	����@	�����	,����
|���<\���,����8
̷��8����tL��������h������|��tl���\��L��L<������������`����<������8<����������X������<��l\���|����������������4,��H<��\|�������������������,���<���L���l��,	���T	���l	���	L��x
l���
,�������<��D�������
���
L�,��d���<������x������,�x���<�LL�`\�H���zRx�$����0FJw�?:*3$"D��� \����9Hp4t�@F�D�D �_
ABBJAB������������:D S
EzRx� ����F���0���D���:D S
EtK���Ft�����������:D S
E�����F������������E�T
AD���(���BH p
EDu���%X̝���lx����^���F�`�����|�����������k�p���m�̟��ȟ�� ğ���4
���H<����\��p�������������������
���������
�������� E�U
AD5���0D���D@���4X���
l8��'�D����@��@nQ�h��5E�^
E����+EezRx�r���y���AWH$�����
F�B�B �B(�H0�A8�D`]
8A0A(B BBBA zRx�`������ (
����khXpBxB�I`����,�����F�A�A �d
ABAzRx� ���$T���04���AE�szRx�� ���H|8����B�E�B �B(�A0�A8�GPb
8D0A(B BBBA zRx�P������(����( d��ZN�k
A^A������
8����Bf
H_
A|����l(���EnVP�����F�B�D �J(�G�
(A ABBA[�U�I�B�I� zRx������(���0���F�K�D �D��
 AABAzRx�����$���+Hxl���F�B�B �B(�A0�A8�D`�
8D0A(B BBBAX͌��� ���NE�J S
IEzRx� � s���
DA 0	��KE�J S
FE\A���
DA l	��HE�J Y
AA���� �	0��KE�J \
AA�� �	H��NE�J S
IEՌ��
DA 
\��KE�J S
FED����
DA(T
p��KA�C�J0S
FAEzRx�0�� M���DAA�
\���
X��(�
���LF�G�D �wAB(4���OF�G�D �zAB(8���$F�A�G �RABl+���=(x�����B�A�D �x
ABA�(���*4����{F�A�J �G�L
 AABAzRx�����$$���[�U�I�B�I� 8����E�G0j
AAzRx�0� Y���<��������0�����F�D�D �G0�
 AABAzRx�0���$����L
h���fF�F�B �E(�A0�A8�G��
8A0A(B BBBM$zRx��������,#����0�
L���*F�D�D �G0A
 AABF�����(�
4����E�D�G0{
AAA�x���H0��F�B�B �B(�A0�A8�Dp2
8D0A(B BBBO zRx�p������(���H(�����E�D�G0z
AAAd���4������E�D�G0w
AAGx
FAA�ތ��!4@T����E�D�G0w
AAGx
FAA�����!0������F�D�D �G0�
 AABA�����;(������E�D�G0s
AAA�����(@����E�D�G0s
AAA�^���!4T���E�D�G0b
AAAL
CAA3���!(�t����E�D�G0t
AAAP���(����E�D�G0w
AAA���@ T���NF�D�D �G0L
 AABKA
 CABA�����0xL����F�D�D �G0�
 AABA�u���7(������E�D�G0s
AAApl���@T����F�D�D �G0�
 AABAk
 FABA`+���E(X���E�D�G0G
AAA0���(�����E�D�G0F
AAAH���(�|����N�D�D0~
AAA�ފ��Lt��J0��L$ ���hF�B�B �B(�A0�A8�G�i
8A0A(B BBBA����s(����E�A�D@n
AAAzRx�@�� ы��1�@��'E�
A�
΋��GNU�0t�s�� ���(���xb0DnB0v�^c@v wsph DmHD�YiD@gI�B�Xl�C@jL�B@cn�D dN@Deq�A``Q�@p_?�uPveP�@�f`t�|d@tP|P3~Ufv�)
�p� x� ���o`�
�
p� 0�#��	���o���oh���o�o����o�p� �)** *0*@*P*`*p*�*�*�*�*�*�*�*�*++ +0+@+P+`+p+�+�+�+�+�+�+�+�+,, ,0,@,P,`,p,�,�,�,�,�,�,�,�,-- -0-@-P-`-p-�-�-�-�-�-�-�-�-.��pvN�pw@�U��P�����p�`�S��z��)�@y�`�ĈPD ��Pwψ	�)3����v��� o �N����U��Z�@���`�� �S�PU�@�)�0~�@������������� � )��� )��� ��xb0DnB0v�^c@v wsphPC kH BPaiPC kI BPalPC kL BPaq�@�fQ�?�e?�u�ue�u�}f0u@}d�t|xb0DnB0v�^c@v wsph�B�SH�A�hi�B�SI�A�hl�B�SL�A�hq�27Q�2�6?�u�ue�u�}f u�|d�t�{��80O@�0@�  � �D�?�p�v@020x� GA$3a1�)%�_struct.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug}f$�7zXZ�ִF!t/��$��]?�E�h=��ڊ�2N��#������b
m][/	�\Ї�7F�éN��������f��>QI��`>�{�(e�I��A�vB�>v�9CZZ�yyu	�R�vP?'d�Wq��Y�b�!L��7�LѺc�ī�B��@����h�,?`�Aq��%�s�i��T�w��
f���A�w�b�AY�%9h�P\�)ӝ�֜�<0��o�^�rm�|��)9S#�>V�0�j�Y����'@�hF4k��#Bdnݝ1
hg/ĮWm��i�Hˁ�h���gE�ksa�$��:L���L��5���P��n"J/<����̜��lq{��h�>
�w\�$Fj-;�9�PL}�� ���Oa���2��~��m���e�C�h�pw��Ӓk�'S����΅N]*� vpn��~��4T~�HP���f�`Gj�����⸽F��ԟ�,����`�-"�O�f�{��o��mA�5�`[�ց�_5fk�_�P�a/���-�E����'G�ڲϤ<�~}�R�!�o1��D��7�9�700>�,��+��`f޶y�_�ۧ)������	�;F^"�p��c��#	
9�@���:i��;@]�z���M!��5[��Qov��u��\з�آ����X���b����>?�`N}M�/`���V��S��ש�~���9ZGR�IC�t����ڠO��$m秳{����dYB�]'�P�������<��7f(M-;����5�
ڡ�Rb���\���!X�H��%:�?>f������7��mє�k����I��N�CeHo��ǘ#���n�<�Xg��݄��l�#�G6j
0>0+�Pr���.=��.�^����iyR��M�g��#Ї�����NŦ�Em�W�vᷚ��oڃ�~��:���Y�i&u�mP�ώ޲X��?o��\oeh�6e.��'
|�����ܚ���*�fܕ�p3���F,?U��/1~��WU�/�V!*�a�G�A\{	n��pN��\#U��`��_�;`����)�0!��Y��f���W��{#�/p�✐��S���f2e#57ab�̨	<�<�(	Z/g���>
�/#wd3�N� Γ��ճI�a�ZHU�m�ë�
o�r�#�q,,�l�]��������,�e�O�1�.l}X�D~�2��V�f4��(�=�
5����%��ԧ6�SA�?}Q���Q��X8
��V�z�$l������)��ֳ��h
��-Py��;=5�Ӯ�/����X���P�	��F�=)f�45�iXa|X��(��#����S� e{/��(c=��Ѵ�@"A���7*�I����̺����q�"{����6C߉.�e��y4n�}��Y	4�;V�p���|�g;}#$lRrow�j��>&
>�lg�|,�j�4r�7JvW�lU�����~�M^(eO��&�Zl�c-��vZ{8�K��T+O6
^���F�iI.�q�{�<��:����m��W��v"З�_���ŗ���з�Xulg�4�Fq��5ˉ���EN{�y���o����sxE�6����ԈLg}�{���B2��Bwf��R�nX�ޭ���Yq/�mJ�ϣ���y@���}�9�5���eAV�&����	O/���A"�'�j�X_smz��B���Xm46�f�l��v�횠6>N�|�9�&�$o2ݽ"F2�,�0!�#ް�/!�4U��d���|�طxe���9Dc����uJ�_����|o��ɋ^u7N�U���p�X���]��lg���}1{G��a�W���Bcy�lr��/�=�w�Z�mx�0v��
L� #@�=*��GIJ秥»�n�z��i�<������q�U�����n9m��Q��Pt��!�-> �O9�!'�0s���&;r\���1V
��]��!���:��sH�H�q�
A�X��RǶE-�6�ga�ɬ�1dE�4<l�"�bɱ}!yF
��Iz\8K��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(��0�
�
8���o���E���ohh@T���^B�#�#0h�)�)c�)�)0n.. w0202�O}��
�@�@�� �����ȟȟ��� �p� p��x� x���� ��� �p� p��p� p���� � 
 � �  ��8�` �$
D�`��0��(lib-dynload/parser.cpython-38-x86_64-linux-gnu.so000075500000061220151153537510015406 0ustar00ELF>�!@P[@8	@(G(G �K�K �K �	�	 �K�K �K 888$$GGG  S�tdGGG  P�td�A�A�A��Q�tdR�td�K�K �K 88GNU5���� =XI*�e���A�@ @AD.`ȓ��|CE���qX!�_��4O ��P��h���� |1l, ���F"���������p'6/����#�`�Ql>@�QF�� 7���U �pU �pU __gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6PyArg_ParseTupleAndKeywordsPyModule_TypePyType_IsSubtype_Py_FalseStruct_Py_TrueStructPyNode_FreePyObject_Free_PyParser_GrammarPyErr_Formatstrcmp_PyParser_TokenNames_PyNode_SizeOfPyLong_FromSsize_t_PyErr_BadInternalCall_Py_NotImplementedStructPy_FatalErrorPyObject_SizePySequence_GetItemPyUnicode_AsUTF8AndSizePyObject_Malloc_Py_DeallocPyNode_AddChildPy_BuildValuePyErr_SetObjectPySequence_Check_PyLong_AsIntPyErr_OccurredPyErr_SetStringPyErr_NoMemoryPyExc_ValueError__stack_chk_failPyLong_AsLongPySequence_GetSlicePyNode_New_PyObject_NewPyUnicode_FSDecoderPyArena_NewPyUnicode_FromStringPyAST_FromNodeObjectPyAST_CompileObjectPyArena_Free_Py_NoneStructPyLong_FromLongPyList_NewPyList_SetItemPyTuple_NewPyTuple_SetItemPyArg_ParseTuplePyDict_NewPyParser_ParseStringFlagsFilenameExPyParser_SetErrorPyParser_ClearErrorPyInit_parserPyType_ReadyPyModule_Create2PyErr_NewExceptionPyModule_AddObjectPyModule_AddStringConstantPyImport_ImportModuleNoBlock_PyObject_GetAttrIdPyObject_CallFunctionObjArgs_edata__bss_start_endGLIBC_2.4GLIBC_2.2.5vii
�ui	��K 7�K �6�K �K P �9P �.P 8= P 9(P l"8P h=@P 9HP �!XP �=`P �9hP �1xP �=�P :�P �2�P >�P }:�P Y&�P @>�P �9�P �.�P h>Q 4:Q �5Q �> Q 9(Q l"8Q �>@Q 9HQ �!XQ ?`Q ,:hQ �5xQ @?�Q b9�Q U+�Q h?�Q :�Q �2�Q �?�Q �9�Q �1�Q �?�Q �:�Q U+�Q h?R :R �3R @HR :hR b9�R �:�R �:�R �P  S �:(S �:0S �:@S �:HS �:PS �:`S �:hS �:�S �:�S �:�S �:�S �:�S #pT @@�T y&�T P `U �:xO �O �O 	�O �O �O �O �O �O �O �O #�O &�O ,�O 7�O :�O >�O ?�M N N N N  N (N 
0N 8N @N 
HN PN XN `N hN pN xN �N �N �N �N �N �N  �N !�N "�N $�N %�N '�N (�N )�N *�N +�N -O .O /O 0O 1 O 2(O 30O 48O 5@O 6HO 8PO 9XO ;`O <hO =pO @��H��H��3 H��t��H����522 �%32 ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&�������h'��q������h(��a������h)��Q������h*��A������h+��1������h,��!������h-��������h.��������h/�������%-/ D���%%/ D���%/ D���%/ D���%
/ D���%/ D���%�. D���%�. D���%�. D���%�. D���%�. D���%�. D���%�. D���%�. D���%�. D���%�. D���%�. D���%�. D���%�. D���%�. D���%�. D���%�. D���%}. D���%u. D���%m. D���%e. D���%]. D���%U. D���%M. D���%E. D���%=. D���%5. D���%-. D���%%. D���%. D���%. D���%
. D���%. D���%�- D���%�- D���%�- D���%�- D���%�- D���%�- D���%�- D���%�- D���%�- D���%�- D��UH��SH��H��H�|$H��u)L�L$H��H��1�L��1 H�
k3 H�����2H�H�5�- H9�t��H�����u�H�
E3 H��H��H�����1҅�t'H�D$�xuH�s- H�
�
H�o- H�
H��H�
H��H��[]���UH��SH��H��H�|$H��u)L�L$H��H��1�L�&1 H�
�0 H�c�C����2H�H�5�, H9�t������u�H�
�0 H�7H��H������1҅�t'H�D$�xuH��, H�
�
H��, H�
H��H�
H��H��[]���SH��H��7���H��[���AWAVAUATUSH��8�L�-f, �����A9m�)HcՋGE1�H��Lk�(M}�D$M�g���G�=���������0uf�}�XD�H�5, A�$L�t$M��M�L$L�d$ A��H�N�\$1�L�<$M��H�l$(H��9\$��I��H�<�H�|$H��H�D9!��I�~H�qH����M��H�\$ L�<$L�t$H�l$(A���zL�SL�\$I��K�TLk�(MgD9t$�/Mk�0E�]LU A�:A��A9��������H�=�0 H�5�1�����1��3H���u����#�����u�g���L���t�������q���H���
���M�7Mc�L�$fE����I��H�=�0 L�HcE=�~WL�%�* M�T$A���
H�5�* J���A��Mc�Ik�(I�L-H�5�H�Lk�(1�K�T
�\���1��zH�UH��tH�5p1��A���1��_L�V* H�5I��1��$���1��BA�4$M��1�9�~I�L$fD��H��fE��u��I�PH�=�/ H�5W1����1�H��8[]A\A]A^A_Ëf;|_af=�
H�vH�����AU��ATUSQD�oD;n|@�9H��H��E1�E9�~Ik�0H�u I��H�H{ �����t��1��
��ø�Z[]A\A]���SH�GH�H�X ���H�<[������USQH��tH��u�1H�=�����1��H�- H9GuH9FtH��( H��H9��Ӊ�t[H�vH�������wNH�
�Hc�H�>��u���tH��( H��D��x�H��( H��4�������؅�x��҃�vH�=T�g���H�5XHc<�H�>��Z[]�AWAVI��AUATUSH��H��HH�|$dH�%(H�D$81�����H�D$H�D$H�D$0H�|$H�D$ ��^�L�����I��H���HH�p�����H�|$0�H�t$ L�����H����L�\$0H�D$(I�{�l���H�t$(H��H���wH�D$0H��H�H�I�MuL������A�PH��E1�jD��H��A���E���ZY���b���wA�����Lkd$0H�S L��N�l"�L��L������I9��tI�uL���q���H�D$H�L$H9L$�zH�t$H�|$���I��H��u?L��H�=�1�H�g���H�=�, I��H���+���M��uzM���1��$H���n�����t�1�L���0���I��H��t�H�PE1�H�����tH�����A�ă��u�}���H���I�MuL�����H��u�W���I�u�L������t���A����L�����H�D$0H��H�������H�=�+ H�5������@H�VH�=�+ 1�H�5�����I�M���L���U���H��H��tuH�x���t=H���(���A�����u�D$(���D�L$(H��u7E�H�M�����H���������M�EH�=(+ H�5�1�I�P�F���H�MuH�����I�M��L������zI�MuL���v���I�uL���i������R���1��y���I�uL���K���H��1��Q����l��XI�uL���-���H���5���H��$ H�5OH�;������I���L��������A���l���A��d���H�L$8dH3%(H��t�j���H��H[]A\A]A^A_���AUH��H�
( H��ATH��
USH��(dH�%(H�D$1�L�D$�_��t$H�|$����uL��# H�5�I�:����1���L�d$1�L����H��H��u8L��H�=|
1�H����H�=�) H��H����H�����sH����H�H��uH�����H���~��D$1�H��U���L����H��H��uH�=) H�5
�!����H�@���u/H�PH�=�( H�5M1���H���H���e���L��1��q�I��H��tӉ��2�H��H����H�T$H��L���d���H9�tH���i�H�����}H����H�t$H���e�I��H��u,H���5�H�uH�����I�$�@L������3H�T$H�z��H�EH��u-H�����H�uH����I�$uL��������H�L$H��L��H����H����1�H�uH���S�I�$uL���E�H����D�EfA��tLfA��UtfA��tLH�=�' H�5
���u�}uH�} A��H�=b' H�5Y�f��NH��A�H��t@�	H��A�����t,H�=k% ��H��H��tA�H�hI��#D�`L�H�,H������I�H��H���&���H�=�& H�5�
���H�L$dH3%(H��t���H��([]A\A]���AUATUH��SH��H��(L�%�  H�|$L�l$dH�%(H�D$1�H��H�D$u/AUH�
K$ H��H��ATH��
L��$ 1�L�L$��ZY�8H�H�5R  H9�t����u�M��M��H�
$ H��H�]
H���}�H�T$��u1�1��mH��t�D�H��H��u��H�=7
�~�H�D$H��u���H�L$H�T$H�yH�qH���(�H��H��tH�t$I�؃�H��H�VH�t$�D�H��H�|$H��t
H�u�
�H��tH����H�L$dH3%(H��t��H��([]A\A]�AWAVAUATUSH��H��uH�� H��y�D�D$A��I��I��H��f=���f=U�O��D��F�LIc���H��H���6H�}�@�H���H��1�H��E1�A��D9u~8Mc�D�D$D��L��Ik�0L��H} �X���H����A��H��H��Ic�A����f�}U��H�}��H����A�nH��H��Hc�A����T$�|Hc���H��H����H�}��H��to1�H��H��A��H�}��H��tVH�¾H��A��E��tHc}�[�H��t5H�¾H��A�ԃ|$t/Hc}�8�H��tA�uH��H��Hc�A���H�uH���D�1�H��H��[]A\A]A^A_���AUATUH��SH��H��(H�|$L�l$L�d$dH�%(H�D$1�H���D$�D$u/AUH�
! H��H��ATH��L�y! 1�L�L$��ZY�8H�H�56 H9�t������u�M��M��H�
�  H��H�iH���a�1Ʌ�t(H�T$�L$D�D$H�5N H�zH�; �y���H��H��H�L$dH3%(t���H��([]A\A]���AUATUH��SH��H��(H�|$L�l$L�d$dH�%(H�D$1�H���D$�D$u/AUH�
� H��H��ATH��L�y  1�L�L$��ZY�8H�H�56 H9�t������u�M��M��H�
� H��H��H���a�1Ʌ�t(H�T$�L$D�D$H�56 H�zH�3 �y���H��H��H�L$dH3%(t���H��([]A\A]���AUH��H�� H�5ATUSH��dH�%(H�D$1�H��H�$����uE1����H��H��t�H�4$�1�E1�H�=��N�H��H��tLH��H��1��y���I��H��t)H�5! H��1�H�=���I�$I��uL���x�H�MuH���j�H�uH���]�H�L$dH3%(L��t���H��[]A\A]�AUA��H�
� ATUS1�H��HdH�%(H�D$81�L�D$�D$H�D$�������1�A��H�l$H� ��H�|$L�L$I��1���I��H��t;H�=c ��H��H��tL�`D�h�D$�C %��C�L������
H��1���H����H�T$8dH3%(H��t��H��H[]A\A]���H���H��H�N�����H���H��H�;����1���L������H�����H������H������eM���\�tL������Qf.�@H�=	 H� H9�tH�& H��t	�����H�=� H�5� H)�H��H��H��?H�H�tH�� H��t��fD�����=� u+UH�=� H��tH�=� ���d����m ]������w������AUH�=� ATUSQ�����������H�=U ��H��H�������H� H��u 1�1�H�=��H�H� H���t���H�H��H�5�H���"����V���H� H�5�H��H� ��H�5	H�5�H���&�H��H�5yH����H��H�5kH����H�=h��I��H����H�5[ H����H�5, H��I����H�5� H��H�( ��H�
 H��H������H�M��t>H��t&E1�H��H�5= 1�L�����H��t
H�(�����I�,$t<H�
� H��t
H�)�d���H��tH�m�G���I�m�/���ZH��[]A\A]��a�����H��H���O!:issuiteO!:isexprUnrecognized node type %d.Expected %s, got %s.Illegal node construct.OsO:sequence2stmissed encodingError Parsing encoding_declunspecified ST error occurredO!|O&:compilest|O&:compile<syntax-tree>O!|pp:st2list|pp:tolistO!|pp:st2tuple|pp:totupleO!:_picklerOiO(O)s:suites:exprparser.ParserErrorSTType__copyright____doc____version__copyreg__sizeof__tuple2stpickleparserline_infocol_infofilenamesequencesourceparser.stIllegal terminal: expected '%s'.Illegal terminal: expected %s.Illegal number of children for %s node./builddir/build/BUILD/Python-3.8.17/Modules/parsermodule.cUnreachable C code path reachedterminal nodes must have 2 or 3 entriessecond item in terminal node must be a string, found %sthird item in terminal node must be an integer, found %sunsupported number of child nodessequence2st() requires a single sequence argumentIllegal syntax-tree; cannot start with terminal symbol.encoding must be a string, found %.200sparse tree does not use a valid start symbolCompile this ST object into a code object.Determines if this ST object was created from an expression.Determines if this ST object was created from a suite.Creates a list-tree representation of this ST.Creates a tuple-tree representation of this ST.Returns size in memory, in bytes.Compiles an ST object into a code object.Creates an ST object from an expression.Determines if an ST object was created from an expression.Determines if an ST object was created from a suite.Creates an ST object from a suite.Creates an ST object from a tree representation.Creates a tuple-tree representation of an ST.Creates a list-tree representation of an ST.Returns the pickle magic to allow ST objects to be pickled.Intermediate representation of a Python parse tree.����p�v�����r�b�b�r�r�b�0.5This is an interface to Python's internal parser.Copyright 1995-1996 by Virginia Polytechnic Institute & State
University, Blacksburg, Virginia, USA, and Fred L. Drake, Jr., Reston,
Virginia, USA.  Portions copyright 1991-1995 by Stichting Mathematisch
Centrum, Amsterdam, The Netherlands.;������������x�4$�\>�x���e���,Z�Ta�����?�0��|������<��t���,����zRx�$���FJw�?:*3$"D���$\����E�D�G0�DA$�<���E�D�G0�DA����E�PH�����B�B�B �B(�A0�A8�Dp�8A0A(B BBBH!�x^�E�A �A(�A0@����J0����A(A ABB`M� E�V$|Q��E�A�A �AAX���B�B�E �B(�A0�A8�G���H�O�A��8A0A(B BBB8��tF�O�H �A(�DPK(A ABB@<��jF�B�A �D(�GPqXO`[XAP�(A ABBH���B�B�B �B(�A0�A8�DP�8D0A(B BBB@�h�F�B�A �D(�GPvXO`[XAP�(A ABB@$�F�B�A �D(�GPvXO`[XAP�(A ABB4T���F�S�A �A(�D@�(A ABB4����B�L�A �A(�Fp�(A ABB�V��]�8����F�I�A �A(�A0�
(D ABBAzRx�0����$�VGNU�7�6�K Ufv�
�8�K �K ���o`	�
��M ��p	���o���oh���o�o�
���oI�K ���� 0@P`p�������� 0@P`p�������� 0@P`p�����9�.8=9l"h=9�!�=�9�1�=:�2>}:Y&@>�9�.h>4:�5�>9l"�>9�!?,:�5@?b9U+h?:�2�?�9�1�?�:U+h?:�3@:b9�:�:���������P �:�:�:�:�:�:�:�:�:�:�:�:(#@@y&P �:GA$3a1��8parser.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug&��7zXZ�ִF!t/����]?�E�h=��ڊ�2N�B�� ��9�<p�T>�J��y�ہƨ� �h7��m����)A��_�d�k'|���L[�.�@�Y}F�)oR��P�`"$"%�k�J�{L_�e�tV���JN��s�ar��x��/�#65��oJ�8�
�Tr����=d"�y���d�@8S@�ݚ&�ۈ�
\�]��3[�{u��ə!�i8~(�T��	���)
܍h�;�p�%��B��
iڀ�?�<��jg�c���I3iJ�
5	�/�t��9	9-3�p����W��
fq��b���].��HR��K��j�禕F�M*Hx�R�Җ�t`�RZ*K&іn�8�}mv��}��T�m��Ri�)��aZfƘom�k<����e�S�[1LbV�Z���]�F��fo$.�m�D��w�eˑ���lHMe�)y���Y\e^3�u��H0��W��)�7[�����w{�aK�%XE����zXQK�,Q1��4�4��'�4HW��X1 ��������_�tE�\��,��;^%Ow3��Ee�=l/p4��iʐ`F^�	F5���EcB��Q�6[�>��G�����x0���~jf)X�P�-���pb1~��V6�s�,��j�uX7^�y��V;� ��Q�����@�~��b��]_eM��PE�!q����+L�g�^��y717�|:��J�ō
v��ͯq�?Z'���,������9�3�<`_�%X9Q��rP���*�
]J�V��u�2��o�L��c�ߨ���z�YvEp>�iߵ-�!ۢG-ͧVB��Y�_�ud�ӛ�h4����ʁ�j��h@Dc$�j�
GfWqwƝY d	�R��������ɏ7P�v�).��+Ö��.�3��%�˂)d�\��8]�ڼP���˅q1�b-bL�߼��5�̘���@�8I�2�i�Z��}�5;�a(˺v��0��/N�tÁTJ�X��$�J_�%�Cq��5��M�1Ed�����!�8@��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(��x0		�8���o�
�
�E���ohh0T��p^B�h��c��n��w�!�!$}�8�8
�99� ��A�A���B�B\�GG ��K �K��K �K��K �K��K �K��M �M �P Pp �pU pU��U`pU$
�U`�U0$Z(lib-dynload/_codecs_tw.cpython-38-x86_64-linux-gnu.so000075500000336570151153537510016240 0ustar00ELF>�@8�@8	@PfPf �k�k!�k!�D�D @�@�!@�!888$$0f0f0f  S�td0f0f0f  P�tdlblblb||Q�tdR�td�k�k!�k!0D0DGNU
��>\Jaö��
3�N���@ 	@��|CE���qX�;@`s� � , �F">���b.�����!���!���!P�-!__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6_PyUnicodeWriter_WriteCharPyUnicode_AsUTF8PyImport_ImportModuleNoBlockPyObject_GetAttrStringstrcmpPyCapsule_NewPyObject_CallFunctionObjArgs_Py_DeallocPyExc_TypeErrorPyErr_SetStringPyExc_LookupErrorPyInit__codecs_twPyModule_Create2PyModule_AddObject__stack_chk_fail_edata__bss_start_endGLIBC_2.4GLIBC_2.2.5vii
�ui	��k!�-�k!@-�k!�k!l!R/l!@�!l!@m!l!W/ l!@�!(l!@}!0l!Q/`l!R/xl!0#�l!�)�l!`/�l!�$�l!�&�l!Q/Pw!�/`w!�0pw!|2�w!|3�w!�4�w!x6�w!�7�w!t9�w!�:�w!p<�w!�=x!l?x!�@ x!hB0x!�C@x!dEPx!�F`x!`Hpx!�I�x!\K�x!�L�x!XN�x!�O�x!TQ�x!�R�x!PT�x!�Uy!LWy!�X y!HZ0y!�[@y!D]Py!�^`y!@`py!�a�y!<c�y!�d�y!8f�y!�g�y!0i�y!�j�y!,lz!�mz!(o z!�p0z!$r@z!�sPz! u`z!�vpz!x�z!�y�z!{�z!�|�z!~�z!��z!��z!���z!�{!��{!� {!��0{!�@{!��P{!�`{!~�p{!���{!z��{!���{!v��{!��{!r��{!��{!n��{!�|!j�|!� |!f�0|!�@|!b�P|!�`|!^�p|!ܧ�|!Z��|!ت�|!V��|!ԭ�|!R��|!аP�! \`�!~]p�!�]Ќ!�]@�!�]@�!�]`�!�^��!�_��!~`�!�`@�!�`��!�`�!�`��!�``�!�` �!�`0�!�`@�!�`�!��p�!Ҳ��!D�@�!�P�!>�`�!l���!����!���!��@�!<�P�!:�`�!��p�!�� �!�0�!�@�!�P�!�`�!�p�!���!���!����!����!����!��Т!���!���!���!���!�� �!��0�!��@�!��P�!��`�!��p�!����!����!����!����!����!��У!���!���!���!���!~� �!z�0�!z�@�!z�P�!z`�!zp�!x��!x��!x	��!x��!v
��!pФ!l�!b�!b�!b�!` �!X0�!�@�! P�! `�!"p�!$��!&��!(��!*��!,��!.Х!0�!2�!4�!T5�!�6 �!�80�!�:@�!�<P�!�>`�!�@p�!�B��!�D��!�E��!�F��!�H��!�JЦ!�L�!�N�!�P�!�R�!|T �!|V0�!|X�!�Y �!�Y0�!BZ�!f/�!�+�!Q/h�!o/��!�!��!ȯ!Я!د!�!	�!
X�!`�!h�!p�!x�!	��!��!��!
��!��!��!��!��!��H��H�ё!H��t��H����5B�!�%C�!��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!�������%m�!D���%e�!D���%]�!D���%U�!D���%M�!D���%E�!D���%=�!D���%5�!D���%-�!D���%%�!D���%�!D���%�!D���%
�!DH�(H��@�uI�0H��I�0H�I9����4q��wIH���H���)H��~�H�(H��@�uI�0H��I�0H�I9����4���vс�����H����A��A��I��I�M�M��tuA�j@��9�rrE�R	D9���)�A�4sf���tH�(A��H��fA��D�]L�A�rI�0H��I�0H�L9����n���e����"���H���Y��O��E�>�9��1��'��L�H��A�3I�0H��I�0H�I9��;�4q��wHH���H���H��~�L�H��A�3I�0H��I�0H�I9���4���vҁ�����H����A��A��M��I��I�M�,$M��twE�t$D��E9�rhE�d$	E9�w]E)�G�t]fA���tML� E��H��fA��E�,$H�0D�vI�0H��I�0H�L9��:����_�������H����I��I�M�*M��t6E�Z@��D9�rFE�R	D9�wFD)�E�tufA����x�����������}��s��i��H������������	H���������H�
��!H�5E1�H�9�����	H��!H�50E1�H�:����	H���Y����E	E1��	H��[]A\A]A^A_�����D��I�0USH�D$H�|$ L9���H��y!���F���I��A���?�41A�������H���^���H�0H��D�I�(H�uI�0H�L9�}qI����I��t+�t)���g���L�H��A�2I�0H��I�0H�L9�}6�41�����;���H�0H��@�.I�0H��I�0H�L9���fD1�[]�ff.��t)�������H�(H��@�uM�I�sI�0H�L9�}�B�t������H�8@�7M�I�z�I�sI�0H�L9�}�B�t�������H�8@�7M�I�z�I�sI�0H�L9��h����41���o���H���"���L�A�2I�(L�W�L��H�uI�0H�L9��>����)���f���I�0AVAUATUSH�D$0H�|$8L9���H�-'h!H� x!������I��A���C�41A���!���H������H�0H��D�M� I�t$I�0H�L9�}sI���I��t,B�t!������L�0H��A�6I�0H��I�0H�L9�}7�41�������L�H��A�2I�0H��I�0H�L9���f�1�[]A\A]A^�DB�t)���h���L� H��A�4$M�(I�uI�0H�L9�}�B�t)���;���H�8@�7M�I�z�M�cM� H�M9�}�B�t������L�0A�6I�8H�wI�z�I�0H�L9��g����41A������H�������H�0L�W�L��D�&M�(M�uM�0H�M9��:����%���D��H����AWI��AVI��AUATUH�-]V!SL��H��I��2@����M�g�M��A����H���}������h���I�M��H�PI��p@��xoI����I��t'H���G������2���I�I��H�QI��q@��x8H��� ���������I�6I��H�VI��v@���Cff.�f�I����D��M��I��I�I�EH���oI��L�pE!M�M�M���AD�RA�SA8������E:S	�����A)�Mc�C�4Y�����|���H���u������`���I�I�������H��1�[]A\A]A^A_�ff.�H���8������#���M�I��I�PI�A�p@���$���H�������������M�M�|$�I�QI�A�q@�������H������������M�M�|$�I�RI�A�r@������H������������I�>M�g�M��H�WI�M���1����w@���C������ff.��H��[]A\A]A^A_��JA�u@8�����A:M	�u�����)�Lc�B�4`�����\������H������1��fD��H���GAWAVI��AUI��ATUH�-�C!SL��H��I�U�2@����M�~�M��A����H�����������I�EM��H�PI�U�p@��xlI���lI��t)H������������I�MI��H�QI�U�q@��x3H���[������p���I�uI��H�VI�U�v@���fDI���ZH��L�\5M�#M���1�BA�K8��)���A:C	�3)�Hc�A�4t������H���������I�EI������H��1�[]A\A]A^A_�H����������M�EI��I�PI�UA�p@���R���H���z�������M�MM�w�I�QI�UA�q@���$���H���L���a���M�UM�w�I�RI�UA�r@�������H������3���I�}M�~�M��H�WI�UM���9����w@���=��������H��[]A\A]A^A_�H���������1��f���ATUSH�F�������H����I��H�������H�-��!H��uDH�=����H��H������H�5�H�����H�+H�e�!�����H�-X�!H��tlH��?!H�;�?tXL������uAH��1�H�5���H��H��t.1�1�H��H���`�H�+I��uH����L��[]A\�H��H��H��������>���f�H�=у!H�ʃ!H9�tH��!H��t	�����H�=��!H�5��!H)�H��H��H��?H�H�tH���!H��t��fD�����=]�!u+UH�=��!H��tH�=~>!���d����5�!]������w������AW��H�=��!AVAUATUSH��dH�%(H��$1���I��H����E1�H�l$�<1�H��H��H�T$I��H�__map_1�H�56H�$D���H�=�=!�D$big5A�E
���L��L��H�����tXD��H��H��E1��1�H�=�=!L�D$H�__map_I�cp950extH�4$H�5�L�L$A�E��L��L��H���N�H��$dH3%(L���h��u���H��H���encoding name must be a string._multibytecodec__create_codecno such codec is supported.multibytecodec.__map_*big5cp950extcp950getcodec_codecs_tw0�00�" ����0�& % P�d�R��T�U�V�W�\� 1� 3�t%4�O��	�5�6�[�]�7�8�009�:�00;�<�
00=�>�0	0?�@�0
0A�B�00C�D�Y�Z���������������������������������������������������������������������[�\�]�^�    005 2 ��
�; �0�%�%�%�%�%&&�%�%�%�%�%�%�2!> �?��I�J�M�N�K�L�_�`�a��
����"���f"g"`""R"a"b�c�d�e�f�<")"*"�" ""�"�3�3+"."5"4"@&B&A&	&�!�!�!�!�!�!�!�!%"#"�<��<���0��� �!	!i�j�k��3�3�3�3�3�3�3�3�3�YQ[Q^Q]QaQcQ�U�t�|�%�%�%�%�%�%�%�%�%�%�%�%�%�%�%<%4%,%$%%�%%%�%%%%%m%��������������������������������������������������������������������n%p%o%P%^%j%a%�%�%�%�%q%r%s%����������`!a!b!c!d!e!f!g!h!i!!0"0#0$0%0&0'0(0)0ASDSES!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�������������������������������������������������1111	1
111
111��������������������������������������������������������������������1111111111111111 1!1"1#1$1%1&1'1(1)1�����NYNNNCN]N�N�N�N?QeQkQ�QRR�RSAS\S�S	NNN
N+N8N�QENHN_N^N�N�N@QR�RCS�S�SW�XY'YsYP[Q[S[�[\"\8\q\�]�]�]�]�]�]r^�^__Mb��������������������������������������������������������������������NN
N-N0N9NKN9\�N�N�N�N�N�N�N�N�N�N�N�N�N�N�NCQAQgQmQnQlQ�Q�QRRR�R�R�RS9SHSGSES^S�S�S�S�S�X)Y+Y*Y-YT[\$\:\o\�]{^�^__�_b6bKbNb/e�e�e�e�e�e�fg(g kbkyk�k�k�kl4lkp*r6r;rGrYr[r�r�sNNNNN;NMNONNN�N�N�N�N�N�N�N�N�N�NEQDQ�Q�Q�Q�Q�Q�Q
R�R�RSSSS�NJSISaS`SoSnS�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�S�V�VY��������������������������������������������������������������������.Y1YtYvYU[�[<\�]�]�]^^s^|^___�_
bSbTbRbQb�e�e.g,g*g+g-gck�kll8lAl@l>l�r�s�s�t�tuu(u)u0u1u2u3u�u}v�v�v�v�w�w�w:y�ytz�zNNRNSNiN�N�N�N�N�N	OO
OO
OOOO�N�N�N�N�N�NOOIQGQFQHQhQqQ�Q�QRRRRR�RS!S SpSqS	TTT
TTTTTT
TTTTTT�V�V�V3W0W(W-W,W/W)WYY7Y8Y�YxY�Y}YyY�Y�YW[X[�[�[�[�[�[\y\�]^v^t^��������������������������������������������������������������������__�_�_bb
bbcb[bXb6e�e�e�e�e�f�f	g=g4g1g5g!kdk{kl]lWlYl_l`lPlUlal[lMlNlpp_r]r~v�zs|�|6������3��������������n�r�~�k�@�L�c��!�2N�NMOOOGOWO^O4O[OUO0OPOQO=O:O8OCOTO<OFOcO\O`O/ONO6OYO]OHOZOLQKQMQuQ�Q�Q%R$R)R*R(R�R�R�R�R#SsSuST-TT>T&TNT'TFTCT3THTBTT)TJT9T;T8T.T5T6T T<T@T1T+TT,T�V�V�V�VJWQW@WMW��������������������������������������������������������������������GWNW>WPWOW;W�X>Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y][\[Z[[[�[�[�[,\@\A\?\>\�\�\�\�\�]^�^�^�^�^__d_b_w_y_�_�_�_�_�_�_�_�_bb�b�b�b�bvb�bmb�b|b~bybsb�bob�bnb�b�b�b�b9e;e8e�e�f_gNgOgPgQg\gVg^gIgFg`gSgWgek�kBl^l�l�l�l�l�l�ljlzl�lpl�lhl�l�l}l�lrl~ltl�lvl�l�l�l�lvp|p}pxpbrar`r�r�r�s,u+u7u8u�v�v�w�y�y�yvz�|U��������������o�����������������������������������������������������������������������������҉�7�F�U���d�p�����ʎ����Əŏď�]����������I�Ƒ̑2�.�1�*�,�&NVNsN�N�N�N�N�NoO�O�OsOOlO�O�O�O�OpOuO�OiO{O�O~O�O�OzOTQRQUQiQwQvQxQ�Q�Q;R8R7R:R0R.R6RAR�R�RRSTSSSQSfSwSxSyS�S�S�SsTuT�TxT�T�T{TwT�T�T�T|T�TqTvT�T�TbThT�T}T�T�V�WwWjWiWaWfWdW|WYIYGYHYDYTY�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y_[d[c[�[�[�[�[�[�[\H\E\��������������������������������������������������������������������F\�\�\�\�\�\�\�\^^^^^^x^�^�^�^�^�^�^&_'_)_�_�__|_�_�_�_�_�_``/`5``*``!`'`)`+``bb?b>b@bb�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b�b>e�e�e�efffffffff
ff
ggmg�g�gqg�gsgwg�g�g�gogpgg�g~g�gug�g�g|gjgrg#kfkgkkll�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l���������������������������������������������������������������������p�p�p�p�p,r-r8rHrgrir�r�r�r�r�r�s�s�s�s�s=u�u�u�u�v�v�v�v�w�w>y@yAy�y�yzzyz�z�|T�������������������������
���������������������������������N�q�Rh�ˎΏԏя��������Ǒёw����@�?�;�D�B����R�^��N�N�N�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�OWQ�Q�Q�QNRCRJRMRLRKRGR�R�R�R�R
SWS{S�S�S�T�T�T�T�T�T�T�T�T�T�T�T�T���������������������������������������������������������������������T�T�T�T�T�T�T�T�T�V�W�W�W�W�W�W�W�WUYQYOYNYPY�Y�Y�Y�Y�YZ�Y�Y�Y�YZ�Yi[�[�[�[�[�[\N\O\M\K\�\�\�]^%^^}^�^�^�^_-_e_�_�_�_�_�_�_�_`` `%``(`M`p`h`b`F`C`l`k`j`d`Ab�bc	c�b�bc�b�bc�b�b�b�b�b�bcc?eEe�e�e�e%f-f f'f/ff(f1f$f�f�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�gjk�k�k�k�k�kl�lm2m*mAm%mm1mmm��������������������������������������������������������������������;m=m>m6mm�l9m'm8m)m.m5mm+m�p�p�p�p�p�p�p�p�p0rrrortr�r�r�r�s�s�s�s�s�s�su-uOuLuNuKu�u�u�u�u�uxv�v�v�v�v�v�v�vw�v�v	ww�v�vw�wxxx
xFyIyHyGy�y�y�y�y�yz�z�z�z}|}}}	}}}}8����
��6�ր�ڀÀĀ̀�ۀ΀ހ�݀�"�����ۂ����	�҂ׂ��܂Ԃтނӂ߂��P�y�{�z�M�k���ԉ�������t�s���͎̎����������������������������������������������������������������������������ʐΐ��ÐK�J�͑��P�K�L�M�b�i�˗�����ۘߘ����XN�NP
P#P�O&P%P�O)PPP<PPPPP�OPP(P�O!PPPP�O�O-P*P�O+P	P|Q�Q�Q�Q�Q�Q�Q�QVR\RTR[R]R*SS�S�S�S�TUU7U�T�T�TU�TU�T�T�T	U�T�T�T'UU�TUWW�W�W�W�W	XYWYXYZYZZZZZZ�Y Z#Z)Z%ZZ	Zk[X\�[�[�[�[�[�[�[�[\Q\U\P\�\�\�\�\�\�\�\]�\�]-^+^�^�^�^1_�_�_�_Y`��������������������������������������������������������������������c`e`P`U`m`i`o`�`�`�`�`�`�`�`�`Gb�bc�bNc>c/cUcBcFcOcIc:cPc=c*c+c(cMcLcHeIe�e�e�eBfIfOfCfRfLfEfAf�fggg!h8hHhFhSh9hBhTh)h�hhLhQh=h�gPh@h<hCh*hEhhhAh�k�k�k#l'l(l&l$l�ljm�m�m�mfmxmwmYm�mlm�mnmZmtmim�m�mym�mem�m�p�p�p�p�p�p9ryr�r�r�r�r�r�s�s	t�s�s�s�sTu]u\uZuYu�u�u�u�u�u�u�u�u�u�u�v�v�v�v�v)ww w(w�w0x'x8xx4x7x��������������������������������������������������������������������%x-x xx2xUyPy`y_yVy^y]yWyZy�y�y�y�y�y�y�y�z�z�z{{�|!}}}
} }"}}}}}}
}}}:_��������=�?��������������
��������*�+�(�,���+�R�T�J�8�P�I�5�4�O�2�9�6��@�1�(�C�T�����������������p�w�����}�y������
������H�z�y�����w���ҎԎώ�������������������ݐ�R�M�L�ؑݑבّܑ��b�c�a���������������������������������������������������������������������[�]�d�X�^���☬���ؚ%�2�<�~NzP}P\PGPCPLPZPIPePvPNPUPuPtPwPOPPoPmP\Q�Q�QjRoR�R�R�R�RSSS?S@S>S�S�fFUjUfUDU^UaUCUJU1UVUOUUU/UdU8U.U\U,UcU3UAUWUWW	W�WX
XX�W�W�WX5X�W�W YbY6ZAZIZfZjZ@Z<ZbZZZFZJZp[�[�[�[�[�[�[	\\\`\\\]\]]]]]"]])]]]$]']]�]8^6^3^7^�^�^�^�^�^5_7_W_l_i_k_�_�_�_�_�_�_�_`�`�`�`�`�`�`�`�`���������������������������������������������������������������������`�`�`�`�`�`�`�`�`�`�`�`bbHb�c�crc�c�c�cwcgc�c�cqc�c�c�c�ckc�c�c�c�c�c�c�c�c�c{cichczc]eVeQeYeWe_UOeXeUeTe�e�e�e�e�e�e�e]fZfdfhfff^f�f�Rg�h�h�h�h�hhvh�h�h�h�h�h�h�h�h�h�h�h�h�h�h�h2k�k�k�k+l�m�m�m�m�m�m�m�m�m�mn�m�m�m�m�m�m�m�m�m�m�m�mn�m�m�m�m�m�m�m�m�m�m�m�m�m�m�p	q
q�p�p=r}r�rsssss�st
ttt�s
t�t�t���������������������������������������������������������������������tu"ueufubupu�u�u�u�u�u�u�v�v�v�v7w>w<w6w8w:wkxCxNxeyhymy�y�z�z {({{,{&{{{.{�|�|�|F}C}q}.}9}<}@}0}3}D}/}B}2}1}=������J�F�/��#�+�)�0�$��5�7�6�9�������x�������������������w�{�|�����U�j_dž����Ć��Ɔˆ����ɆS�������������������*��#�%�1�-���"�I�Z�������������g�f�����ێߎ�
���#������ ��"���������������������������������������������������������������������������W�Α������鑉�j�u�s�x�p�t�v�w�l������z�z��Z��u�������P�P�P�P�P�P�P�P�Pg�QrRtRuRiR�R�R�RZS�S{U�U�U|U�U�U�U�U�U�U�U�U�U�U�U�U�U>U�U�U�U�U�U~U�U�U�U
W/X*X4X$X0X1X!XX X�X�X`YwZ�ZZ�Z�Z�Zs[q[�[�[�[�[
\\1\L]P]4]G]�]E^=^@^C^~^�^�^�^�^<_m_�_�_�_�`�`�`�`�`a#a�`a�`�`�`ha�`a�`	aaabIb�c�c�c�c�c�c�c�c���������������������������������������������������������������������c�c�c�c�c�c�cvc�c�c�cRd�c�c^efebece�e�e�enfpftfvfof�fzf~fwf�f�fgg�h�h�h�h�hi�h�h�h�h�h�h�h�h�h�h
iii�h�hni�h>k:k=k�k�k�k�k.l/l,l/n8nTn!n2ngnJn n%n#nn[nXn$nVnnn-n&non4nMn:n,nCnn>n�n�nnNncnDnrnin_nqq&q0q!q6qnqqLr�r�r6s%s4s)s:t*t3t"t%t5t6t4t/tt&t(t%u&ukuju�u�u�u�u�u�u�u{v|v�v�v�v�vOw�w]xlxox
zzzzz�z���������������������������������������������������������������������z�z�z�zI{V{F{P{R{T{M{K{O{Q{�|�|^}P}h}U}+}n}r}a}f}b}p}s}�U���R���U�T�K�Q�N�9�F�>�L�S�t�������
��������W�
���̃���ʃ8���܃�ԃ߃[�߆ن�Ԇۆ�ІކW���ˆ������;�`�U�^�<�A�T�[�P�F�4�:�6�V�a���������������������������������΍ݍˍڍэ̍ۍƍ��������.�5�1�8�2�6����	���c�e�ϑ��#�	��
��������������������������������������������������������������������������������������������}�������r�����ŖĖƖǖ��̗��������혮���Þ͞ў�N�P�P�P�P�P�P�P�P�P�P�PRwR}R�R�R�R�R�R/S�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�UWW^XQXXXWXZXTXkXLXmXJXbXRXKXgY�Z�Z�Z�Z�Z�Z�Z�Z�Zi]o]L^y^�^�^_Y_�_�_aaHaa�`a�`aaNaLaDaMa>a4a'a
aa7a!b"bd>dd*d-d=d,dddd
d6ddddle�e�e�f�f�f�f�f�f�f�fg�imi��������������������������������������������������������������������Ziwi`iTiui0i�iJihiki^iSiyi�i]ici[iGkrk�k�k�k�k�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�nNqYqiqdqIqgq\qlqfqLqeq^qFqhqVq:rRr7sEs?s>sotZtUt_t^tAt?tYt[t\tvuxuv�uv�u�u�u�u�u�u�v�v[wkwfw^wcwywjwlw\wewhwbw�w�x�x�x�x�x�x|x�x�xxzyy�y,��yzz zzzz�z�zw{�{`{n{g{�|�|�|�}y}�}�}�}[}nijr���V�X�����q�p�x�e�n�s�k���������������������������������������������������������������������y�z�f��G���w�=�1�u�f�k�I�l�[�<�5�a�c�i�m�F�^�\�_��������������
�Y�߈Ԉو܈؈݈�ʈՈ҈���k�r�s�f�i�p���|�c���q���m�b�n�l�y�{�>�h�b�����ʌnjȌČ��̌Ō�ߍ�����捲��	���
�����K�J�S�B�T�<�U�P�G�O�N�M�Q�>�A���l�j�i�ɑ7�W�8�=�@�>�[�K�d�Q�4�I�M�E�9�?�Z���������͖˖ɖʖ��������V�t�v����
�����������������������������������������������������������������������������������霂��� ��P�P�P�P�P�P�P�P�P�P�P�PbQ�Q�R�R1S�S�UVVV�UVV	V
VV�UVVVV�UWWuX~X�X�X�XyX�X}X�X%Y"Y$YjYiY�Z�Z�Z�Z�Z�Z�Zu[�[�[�[�[�[�[�[�[�[
\b\�]�][^c^U^W^T^�^�^
_F_p_�_Ga?aKawabaca_aZaXaua*b�dXdTd�dxd_dzdQdgd4dmd{dre�e�e�e�f�f�f�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�iIkLk3l3oo�no�n)o>o o,ooo"o���������������������������������������������������������������������n�no1o8o2o#oo+o/o�o*o�no�n�n�n�q�q}q�q�q�q>r�r�rDsPsdtctjtptmtu�u'v
vv	vv�v�v�w}wwaw�x�x�x�x�x�x�y�y�y.z1z�z�z�z�z�{�{�{u{�{�{�{�{�{�{�{�|�|�|�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}p���^�Z���P�����������������K�Ʉ��ƄĄ��������˄����ӄ����фʄ?��;�"�%�4��U�7�)�����������������������������������������������������������������������������������������������������������j�����ӌьҌk�������������`�X�\�c�Y�^�b�]�[����u�x�w�t�x���������{�������|���������������������̖Җ�|��������������	��������A�B��󜼞;�J�QQ�P�P�PQQ	QQ�Q�R�R�R�R�R�R�S.V;V9V2V?V4V)VSVNVWVtV6V/V0V�X�X�X�X�X�X�X�XmY	[�Z[�Z[[�[�[�[�[d\e\�]�]b^_^a^�^�^�^�^�^�^H_q_�_�_vagana]aUa�a��������������������������������������������������������������������|apaka~a�a�a�a�a�a�a�a�a�a.bidodyd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�duewexe�f�f�f�f#jj�ijjj�i!jj
j�ijj�ijPkNk�k�k�k?o|o�oQofoTo�omo[oxono�ozopodo�oXo�noo`o_o�q�q�q�qVr�rNsWsit�t�t~t�tu v)vv$v&v!v"v�v�v�v�w�w�w�w�w�x�x�x�x�x�x�x�x?z<z@z=z7z;z�z�z�{�{�{�{�{�{�{�{�{�|�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}uw����������������������������������������������������������������������&��������������=���,�-���#�!���%������t�v�`�f�x�h�Y�W�L�S�[�]������
���ҊNJĊ��ˊ����ɊŠ����֊͊����ۊL�N�l��ތ������܌��m�����+���"��)��!�������)�&�*���%�i�n�h�m�w�0�-�'�1���������Œ����꒬�������Ғǒ𒲒�������	�`�������!�+����
����ݙЙߙۙљՙҙٙ����'�E�D�w�o��	��������������������������������������������������������������������������Ξ�XR�QQQQQ�Q�Q�Q�R�R�RYVkVyViVdVxVjVhVeVqVoVlVbVvV�X�X�X�XnY[4[x[�[\J_�a�a�a�a�a�a�a�a�a0b�d�d�d�d�d�d�d�d�d�d�d�d�d�dte�f�f�f�f�f�f=j8j:jYjkjXj9jDjbjajKjGj5j_jHjYkwkl�o�o�o�o�o�o�o�o�o�o�o�o�o�o�q�q�q�q�q�q�q�q�q�q�q�qhs�t�t�t�t�t�tu
u4v8v:v�v�v�w�w�w�w�x�x�x�x�yMzNzFzLzKz�z�{|�{�{�{�{�{�{�|�|
~��������������������������������������������������������������������~~~#~~~	~~y����(����������X�Y�J�Y�H�h�i�C�I�m�j�^�����������a�*�2�%�+�!����������܊�����������k�m����D�1�4�B�9�5�;�/�8�3�����u�t�x�r�|�z�4��� �6���3�/�"���+����&�!��.����������Ֆ���
���[�\�f���0�8�;�7�-�9�$��(���!����񙸚�����(����#�&�(���؞Ԟ����*QQ!Q2Q�R�V�V�V�V�V���������������������������������������������������������������������V�X�X�X�X0[*[$[z[7\h\�]�]�]�]k^L_�_�a�a�a�a�a2b4b�d�d�d�d�d�d�d�d�d�d�e�e�f�f�j�j�j�j�j�j�j~j�j�j�j\k�k�kl�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�q�q�q�q�q�q�q�q�q5rFrpsrs�t�t�t�tFvBvLv�v�w�w�w�w�w�w�w�x�x�x�xy�y�yWz�z|
|�{�{|�{�|�|�|�|�|�|�|.~>~F~7~2~C~+~=~1~E~A~4~9~H~5~?~/~D��q�r�p�o�s�ƁÁ��������Ɂ���	�q�������������������������������������������������������������������������~�����������������g���ч��҇Ƈ������ȇˇ;�6�D�8�=�������
� ����A�?�s�������������I�K�H�J�D�>�B�E�?��}���������9�������M���(�u�J�e�K��~�l�[�p�Z�T�ʕ˕̕ȕƕ����֖����ӗF���5������������;�?���Ϟޞܞݞ۞>�K��S�V�V�X�X8[]_�a3b�d�d�de�d�d�d�e�f&g�j�j�j�j�j�j�j�j_kxk�k	pp�op�opp�q�q�q�qwsus�t�tuVvXv��������������������������������������������������������������������Rv�w�w�w�wy�yazbz`z�z�z+|'|*||#|!|�|T~U~^~Z~a~R~Y~H��w�v�́ρ
�υ��ͅЅɅ����������������(�9�,�+�P��Y�c�f�d�_�U���I�M�����������Б����������������������ԕ֕ЕՕ�ܖٖۖޖ$���������M�O�L�N�S���>�?�=�.��������O�N�M�ʛɛ��ț��Q�]�`���,�3Q�V�X�X�X�[���^�a�a�a�aee�f�f�j�j�j�jpp(pppppr
rXr�rxs��������������������������������������������������������������������zs�t�t�t�u�u_vav�wy�ykziz>|?|8|=|7|@|k~m~y~i~j~�s~���؁�݅�Յ������
�����`�_�V�^�A�\�X�I�Z�N�O�F�Y��
�|�r���v�l�z�t�T�N������������ѓߓÓȓܓݓ֓�͓ؓ�ד�ܕ���*�'�a�ܗ��^�X�[���E�I���
���֛ۛ��a�r�j�l����������R�V�V�V�V�V�X@[C[}[�[�]�a�aeee�f'g�j>p0p2pr{s�tbvev&y*y,y+y�z�zL|C|M|�|�|��}~|~���������������������������������������������������������������������~L�ځf�����������
���d�����p�l�f�o�_�k��
�����������ˑ�����0�ĘR�Q���+�0�7�5��
�y����/�_�c�a�7Q8Q�V�V�VYl\�]�a�aee�e�f�jk�j�kLpr�r�t�tiv�wP|�~�~��-��#�"�!��j�l���t�w�}��������_�����.�3�5�:�8�2�+��8�9�2���g�e�W�E�C�@�>�ϚT�Q�-�%�����������\�f�g�<Q;Q�V�V�V[�]�]N_�a$e
kakQpXp�s�t�unvlv���������������������������������������������������������������������y`|_|~�}�߁r�o�����������a�H�D�Q�R�=�>�×��k�U�U�M�Қ�I�1�>�;�ӝם4�l�j����V�]b#e+e*e�fk�t�zd|c|e|�~�~�~�8�?�1�������c�`�d�h�o�\�Z�[�W�ӚԚњT�W�V�坟���V�X,e^pqvrv�wP�6�9�b�������w����j�B�H�D�Ɨp�_�"�X�_�����|�}��w�r��^kcpl|n|;�������r�p�q�^�֚#�̞dp�w��w�ɗb�e��~����ő}�~�|�w�x���T���(rj�1���r|���������������������������������������������������������������������0�0�00A0B0C0D0E0F0G0H0I0J0K0L0M0N0O0P0Q0R0S0T0U0V0W0X0Y0Z0[0\0]0^0_0`0a0b0c0d0e0f0g0h0i0j0k0l0m0n0o0p0q0r0s0t0u0v0w0x0y0z0{0|0}0~00�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0���������������������������������������������������������������������0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0#$%&'()*+,-./012345Q6789:;<=>?@ABCDEFGHIJKLMNO`$a$b$c$d$e$f$g$h$i$t$u$v$w$x$y$z${$|$}$BN\N�QS�SNNGN�N�V�n\s_N�QN.N�N�N�N�N�Q�RlS�S WY,Y\�]�e�k�kl?r1N<N�N�N�N�N�N�NRSLS"W#WY/Y�[�[\;\t\s\^�^�^�_	bPbl��������������������������������������������������������������������6lCl?l;l�r�r�s�y���OO,O�NO�NO�NOOOO"OOO�NO�QR	RR�R"SSMS�ST�V�V.W*W4W<Y�Y|Y�Y{Y~YwYYV[\%\|\z\{\~\�]u^�^__t_�_�_�_\b^bdbabfbbbYb`bZbeb�e�e>g9g8g;g:g?g<g3glFlRl\lOlJlTlKlLlqp^r�r�r�s*uvuzQx�|���}��M�~�����������"�$� �#�VO;ObOIOSOdO>OgORO_OAOXO-O3O?OaO�Q�QRR!R�R�R	ScSrS�S�S0T7T*TTTETTT%TT��������������������������������������������������������������������=TOTAT(T$TGT�V�V�VAWEWLWIWKWRWY@Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�[�[(\*\�\�\�\�\�\�\�\�\�\�\�]
^^�^�^�^�^�^__x_v_�_�_�_�_�_�_�_�_�_�_�_�_�_�_`�_:b�b�b�b�b�b�bqb{bzbpb�b�bwb}brbtb7e�e�e�e�e�eEgGgYgUgLgHg]gMgZgKg�kllxlglkl�l�l�lqlolil�lml�l�l�lflslel{l�ltpzpcr�r�r�r�r�r�r�r�s�s�s�s�s:u9u�u�u�v=y4�������������������������������������������������������������������������������������������������x�ɏ��������������0�(�/�-�3N�O|O�O}O�O�OvOtO�O�OwOLO�OjO�OyO�OxO�O�O�O�O�O�O�OkOnO�Q�Q�Q5R2R3RFR1R�R
SS<S�S�S�TT�T�T�T�TkTzT~TeTlTtTfT�ToTaT`T�TcTgTdT�V�VoWrWmWkWqWpWvW�WuW{WsWtWbWhW}WYEY�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Yb[e[�[�[D\G\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\�\^^^(_"_#_$_T_�_~_}_�_�_-`&``2``��������������������������������������������������������������������4`
``3```,`"`
``.````	``b=b�b�b�b�b�b�b�b�b�b�b�b�b�b�b=e�e�e	f�efff�eff
ff�eff�f
g�glg�g�gvg{g�g�g�gtg�g�gzg�g�g�g�g}g�gxgyg�g%k�k~k�kl�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l�l0m�l�l�l�l�l�l�l�p�p�p�p�p�p�p�p�p�p�pjr�r�r�r�r�r�r�r�r�r�r�s�s�s�s�s�s�s�s�t�t?u@u>u�u�u�v�v�v�v�v�w�w�w�w�w���������������������������������������������������������������������wBy?y�yxz{z�zu|�|5������������� ���������������������������������‚��Â����p�o�m�n�V�ҏˏӏ͏֏Տ׏����������9�=�<�:�C��O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�O�ODRIR�R�R=S|S�S�S�S�S�T�T�T�T�T�T
��T�T�T�T�T�T�TpT�T�T�TrT�T�T�W�W�W�W�W�W�W�W�W�W�W�W�W�W�W�X
YSY�Y�Y�YZ�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�Y�[L\�\�\�\�\�\�\���������������������������������������������������������������������\�\�\�\�\�\�\�\�\�\�\�\�\�\�]!^"^#^ ^$^�^�^�^�^�^�^_._V_�_7`9`T`r`^`E`S`G`I`[`L`@`B`_`$`D`X`f`n`BbCb�b
cc�bcc�b�bcc�b�bccc�bc�b�bAeCe�e�e6f!f2f5ff&f"f3f+f:ff4f9f.fgg�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g�g(k�k�k�k�k�k�k l!l(m4m-mm<m?mm
m�l3mmm:mmmmmBm��������������������������������������������������������������������mm7mmm@mm m,mm"m	mm�p�p�p�p�p�p�p�p�pArIrJrlrprsrnr�r�r�r�r�r�r�r�r�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�t�t.uGuHu�u�uyv�vwwww
w�v�v�v�w�wxxxxxxx	xxxJyLyKyEyDy�y�y�y�y�y�z~z�z{{z|x|y||�|�|}}}X�������7�؀ǀ�рȀ€Ѐŀ�ـ܀ʀՀɀπ׀�̀��!���ق�������Ղ:��ւ�����������������������������������������������������������������������������������w�t�|�s�A�N�g�j�i�Ӊ��r�����񐽐��ՐŐ��ǐːȐԑӑT�O�Q�S�J�N�PPPP"P0PP�O�O3P7P,P�O�OPP P'P5P/P1PPZQ�Q�Q�Q�Q�Q�Q�QaRZRRR^R_RURbR�RS�S&U�TUU�T�T�TU�TUU�TUU�T
U�T�T�T�TUUUWW�W2X�W�W�W�W�W�W�W�W�W�W�W�W�WYJYZZ-Z.ZZZZ
ZZ3Zl[�[�[�[\V\T\�\�\�\�\�\]�\)^(^�^�^�^�^3_0_g_]`Z`g`��������������������������������������������������������������������A`�`�`�`�`�`�`�`�`�`�`�`�`�`bFb�bcVc,cDcEc6cCc�c9cKcJc<c)cAc4cXcTcYc-cGc3cZcQc8cWc@cHcJeFe�e�e�e�eJf_fGfQfgghhIh2h3h;hKhOhh1hh5h+h-h/hNhDh4hhhh&h(h.hMh:h%h h,k/k-k1k4kmk���k�k�k�k�k�k�k%lzmcmdmvm
mam�mXmbmmmom�m�m�mm�m^mgm`m�mpm|m_m�m�m/mhm�m~m�m�mm�m{m}mum�m�p�p�p�p�p9�p�p�p�p�p�p�p�p�p�p�p�p�pBrxr��������������������������������������������������������������������wrvrs�r�r�r�r�r�rs�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�s�t�t�t�t!u[u_u�u�u�u�u�u�u�u�u�v�vwwwww#wwwww"w'w#x,x"x5x/x(x.x+x!x)x3x*x1xTy[yOy\ySyRyQy�y�y�y�y�y�y�y�y�y�z�z�z�z�z�z�z�z{{{{{{
{{	{{�|�|�|�|�|�|�|}}}}}}}}}}}\a^`][������>�9�����������/�%�3�-�D��Q�%�V�?�A�&��"���������������������������������������������������������������������B�N��*��<�M��$� �7�/�)�G�E�L�S��,�K�'�H�S�R���������������������������������������������C�D�m�u�v�r���q��o���~�t�|��G�W�{�����v�x�������юӎ��������������֐�ِڐ�ߐ�ؐېאܐ�P�N�O�Ց�ڑ\�_����ߚ/�NpPjPaP^P`PSPKP]PrPHPMPAP[PJPbPPEP_PiPkPcPdPFP@PnPsPWPQP�QkRmRlRnR�R�R-S�SuUvU<UMUPU4U*UQUbU6U5U0URUEU��������������������������������������������������������������������U2UeUNU9UHU-U;U@UKU
WW�WX�W�W�W�WX�W�WX�WX�W�WX�W�W�W�W�W�WX�WX�WXX�W�W�W
XX\Y`ZXZUZgZ^Z8Z5ZmZPZ_ZeZlZSZdZWZCZ]ZRZDZ[ZHZ�Z>ZMZ9ZLZpZiZGZQZVZBZ\Zr[n[�[�[Y\]]]] ]](]
]&]%]]0]]#]].]>^4^�^�^�^�^�^6_8_�_�_�_�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`�`2cec�c�c}c�c�c�c�c�c�c�coc�c�cnc�cuc�cmc�c|c�c;c�c��������������������������������������������������������������������xc�c�c�c�cpcSe�eefaf[fYf\fbfgyh�h�h�hmhnh�h�hVioh�h�h�huhth�h�hwh�h|hkhrh�h�hqh~h�h�h�h�h�h�hxh{h�h�h�h}h6k3k7k8k�k�k�k�k�k*l�m�m�m�mtn�m�m�m�m�m�mn�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�m�p
q�pq�pq�pq�pq�p�pqqq�p�pqqq~r{r|rrsssss
ss�rss�s�s�s�stt�stt�s�s�stt�stducu�u�u�u���������������������������������������������������������������������u�u�u�u�v�v�v9w/w-w1w2w4w3w=w%w;w5wHxRxIxMxJxLx&xExPxdygyiyjycykyay�y�y�y�y�y�z�z�z5{G{4{%{0{"{${3{{*{{1{+{-{/{2{8{{#{�|�|�|�|5}=}8}6}:}E},})}A}G}>}?}J};}(}c���������������G�C�H��%���-��,��!��'��"��8�3�:�4�2�t���������z�s���t���������u�����}�������������~������������������v���Y�V�������������������������������������������������������������������������†��ņ����Ȇ������̆������Æ����R�����������������������������������������։ىՉ0�'�,��9�;�\�]�}���}�{�y���������؎ގݎ܎׎��$�����!�������Ԑ���V�X�Z�S�U������������z�����|�m�k�q�o���j��嘗��P�P�P�P�P�P�P�P�P�PhP�P�P�P�P_Q�QSS�S�S�U�U�U�UwUEV�U�U�U�U�U�U�U�U�U}U�U�UU�U�U�UW)X7X��������������������������������������������������������������������XX'X#X(X�WHX%XXX3X?X6X.X9X8X-X,X;XaY�Z�Z�ZzZ�Z�ZxZ�Z|Z�Z�Z�Z�Z7Z�Z�Z�Z�Z�Z�Z{Z}Z�Z�Z�Z�Z�Z�[�[�[�[�[�[�[\0\7]C]k]A]K]?]5]Q]N]U]3]:]R]=]1]Y]B]9]I]8]<]2]6]@]E]D^A^X_�_�_�_�`�`�`�`�`�`a�`
aaa�`a�`�`�`�`aaaa�`aaJb�c�c�c�c�c�c�c�c�d�c�c�c�c�c�c�cad�c�c�c�c�c�c�c�c�c�c�c�c�c�c�c2egejede\eheee�e�e�e�e�e�e��������������������������������������������������������������������|flf{f�fqfyfjfrfgi�hi�h*i�h�h�hi�h�h�h�h�hii�h�hi�hipi�hi�h�hi�h�h�h�h�hi
ii�h�h�h�h�h�h�hi�h�hi%i�h9k;k?k<k�k�k�k�k�k�k�k�k0l�mFnGnnIn�n<n=nEnbn+n?nAn]nsnn3nKn@nQn;nn.n^nhn\nan1n(n`nqnkn9n"n0nSnen'nxndnwnUnynRnfn5n6nZn qq/q�p.q1q#q%q"q2qq(q:qqKrZr�r�r�r�r�rss0s"s1s3s's2s-s&s#s5ss.t,t0t+tt��������������������������������������������������������������������t!t-t1t$t#tt)t t2t�t/uoulu�u�u�u�u�u�u�u�u�v�v�vFwGwDwMwEwJwNwKwLw�w�w`xdxex\xmxqxjxnxpxixhx^xbxtysyrypyz
zzzz�z�z�zJ{;{D{H{L{N{@{X{E{�|�|�|�|X}o}c}S}V}g}j}O}m}\}k}R}T}i}Q}_}N}>?ef����Q�O�P���ԀC�J�R�O�G�=�M�:���������<�=�?�u�;�σ��#�����������ƃȃ�ヿ��݃�؃���˃΃փ��Ƀ	��ރ��ƒ�������������������������������������������������������������������Ճ��ǃу��Ã��ă��׃��ۃ��؆��ӆ�چ�݆�܆��׆�цH�V�U���׈�������������������Ɉ������݉ډۉN�M�9�Y�@�W�X�D�E�R�H�Q�J�L�O�_���������������������؍Ӎ͍Ǎ֍܍ύՍٍȍ׍ō������������������-�4�/��,����������������a�d�_�b�`��
�%���&�����������'���$�����{���������~�����������������������������������������������������������������������������–ȖÖ��l�p�n��������N�N�N�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�QzRxR{R|R�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�U�UWSXhXdXOXMXIXoXUXNX]XYXeX[X=XcXqX�X�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�[�[�[\3\q]c]J]e]r]l]^]h]g]b]�]O^N^J^M^K^�^�^�^�^�^@_�_�_�`IaJa+aEa6a2a.aFa/aOa)a@a bh�#b%b$b�c�c�cdd	d d$d��������������������������������������������������������������������3dCdddd9d7d"d#dd&d0d(dAd5d/d
dd@d%d'dd�cd.d!ddoe�e�e�f�f�f�f�f�f�f�fxf gfi_i8iNibiqi?iEiji9iBiWiYiziHiIi5ili3i=iei�hxi4iii@ioiDiviXiAitiLi;iKi7i\iOiQi2iRi/i{i<iFkEkCkBkHkAk�k
��k�k�k�k�k�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�n�nGqTqRqcq`qAq]qbqrqxqjqaqBqXqCqKqpq_qPqSq��������������������������������������������������������������������DqMqZqOr�r�r�r�r�r<sBs;s:s@sJsIsDtJtKtRtQtWt@tOtPtNtBtFtMtTt�t�t�t�tuyuwu�i�uvv�u�u�u�u�uv�u�u�u�u�u�v�v�vUw_w`wRwVwZwiwgwTwYwmw�w�x�x�x�x�x�x�x�x�x�xyx�x�x�x{x|y�y}yyyzzzzzz"zzzz�z�z�z�zf{d{m{t{i{r{e{s{q{p{a{x{v{c{�|�|�|�}�}�}�}}�}z}�}{}�}|}�}�}�}}}�}mkghl�����!�d�`�w�\�i�[�b�r�!g^�v�g�o���������������������������������������������������������������������D�a��I�D�@�B�E��?�V�v�y�����e�Q�@���g�0�M�}�Z�Y�t�s�]��^�7�:�4�z�C�x�2�E�)�كK�/�B�-�_�p�9�N�L�R�o�ń��;�G�6�3�h�~�D�+�`�T�n�P��������ֆ��M����	����
��ֈˈ͈Έވۈڈ̈Ј����߉�����܉�v����a�?�w�����u�����t�z�<�K�J�e�d�f�������̌h�i������������������������Ѝ�����������������R�?���������������������������������������������������������������������D�I�=��
�������n�o�H�R�0�:�f�3�e�^���.�J�F�m�l�O�`�g�o�6�a�p�1�T�c�P�r�N�S�L�V�2�������������������������s�w�x�r��
��������������������[���眀����P�P�P�P�P�P�P�P�P�P�P�P�P�P�P�Q�R�R�R�R0S�S'VVVV�UVVVVV�UVV�U�U�X|X�X�X�X�XXtX�XzX�X�X�XvX�X�X{X�X�X�XkY�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Z�Zw[�[���������������������������������������������������������������������[c\�]�]}]�]z]�]w]�]�]�]~]|]�]y]]X^Y^S^�^�^�^�^�^�^�^�^�^D_C_o_�_,a(aAa^aqasaRaSarala�ataTaza[aea;ajaaaVa)b'b+b+dMd[d]dtdvdrdsd}dudfd�dNd�d^d\dKdSd`dPdd?dldkdYdedwdse�e�f�f�fgg"g�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�iJkMkKk�k�k�k�k�k�k�n�n�no%o�n7o�n.o	oNooo'oo;oo�n
o��������������������������������������������������������������������6oso�n�n-o@o0o<o5o�nooCoo�n�n9oo�n:oo
ooo!o�q�q�q�q�q�q�q{q�q�q�qDrSr�r�r�rCsMsQsLsbtstqtutrtgtntuuu}u�uvvvvv
vv�v�w|w�w�wnw�wow~w�w�x�x�x�x�x~x�x�x�x�x�x�x�x�y�y�y�y�y�y�y�y�y�y�y+zJz0z/z(z&z�z�z�z�z�{�{�{�{�{�{�{�{�{�{�{�{�R�{�{�{�|�|�|�|�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}�}s������������������������������������������������������������������������$�]�\��������������������������΄„������������̈́������Є����������DŽ̄��������ք����τ��ׄԄ҄ۄ����a�3�#�(�k�@�.��!���C�,�A�>�F� �2�*�-�<��:�1�5�B�&�'�8�$��0�����������������눝���������艫�����������=�h�i�Ռό׌��	����
���
������������
�#�� �"����$�!��z�r�y�s�����v���z�����������������������������������������������������������������������������������y�������������}���������������~���������-�������X�}�z�~�������{������Η͗������������Ù������™��Ǚ����>�?�`�a�_������PQ0Q�PQQ�P�PQQ�P
Q�R�R�R�RHVBVLV5VAVJVIVFVXVZV@V3V=V,V>V8V*V:VW�X�X�X�X�X�X�X�X�X�X�Z�Z�Z�Z�Z[�Z[�Z[[[[g\�]�]�]�]�]�]�]�]�]�]�]�]i^]^`^\^�}�^�^�^I_�_�a�aya�a�a�a�a���������������������������������������������������������������������a�a�a�a�a�a�a�a�afa�a-bndpd�d�d�d�d�d�d�d�d�d�d�dhd�d�dvezeye{e�e�e�f�f�f�f�f�f�fjjj�i�ij�i�i j�i�i�ijj�i'j�i�ij�i�i@jj�i�i
j�i�i	jjj%jj�i&jj�ijQk�k�k�k�kll�klAo&o~o�o�o�o�o�o�oboOo�oZo�ovolo�oUoroRoPoWo�o�o]ooaoko}ogo�oSo�oioo�ocowojo{o�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�r�rXsRs^s_s`s]s[sasZsYs��������������������������������������������������������������������bs�t�t�t�t�t}t�t�t|tytuu~u%vvvvv#vv(vv�v�v�v�v�w�w�w�w�x�x�x�x�x�x�x�x�x�x�x�y�y�y�y�y�yvk9z�z�z�z�{�{�{�{�{�{�{�{�{�|�|�|�|�}�}�}�}�}�}~�}�}�}�}�}�}�}v���������d�g����������������O�S�R�P�N�Q�$�;���)��	�
��
�'����+������*�������������(��.�������1�&������� �0���/�b���������������������������������������������������������������������V�c�d�w��s�X�T�[�R�a�Z�Q�^�m�j�P�N�_�]�o�l�z�n�\�e�O�{�u�b�g�i�Z������������	����������ϊƊ��ӊъԊՊ��׊����Ŋ؊Ê����ي>�M����ߌٌ�ڌ݌猠������� �#�%�$�.������&�'��������,�$��� �#���s�p�o�g�k�/�+�)�*�2�&�.���������������ВÒĒ��ْ��ϒ�ߒؒ�גݒ̒�’�ʒȒΒ�͒Ւɒ�ޒ�ђӒ�����������������������������������������������������������������������ƒ��|�������������Ӗ���Z�������Зϗ��&�)�(� ��'�����������ܙ͙ϙәԙΙəؙ֙˙י̙�������F�C�g�t�q�f�v�u�p�h�d�l����������������������Ӟ��QQQQQ�Q4S�SpV`VnVsVfVcVmVrV^VwVWW�X�X�X�X�X�X�X�X[[[![[[[[([[ [[�[�]�]�]�]�]�]�]�]�]�]�]�]�]g^h^f^o^�^�^�^�^�^K_�_�a�a�a�a�a�a�a�a�a���������������������������������������������������������������������a�a�a�d�d�d�d�d�d�d�d�d�d�d3ee|e�e�f�f�f�f�f�f�f�f�f�f#g4jfjIjgj2jhj>j]jmjvj[jQj(jZj;j?jAjjjdjPjOjTjojij`j<j^jVjUjMjNjFjUkTkVk�k�k�k�k�klll�o�o�o�o�o�o�o^o�o�o�o�o�op�o�o�o�o�o�o�o�o�o�o�o�o�o�o�o�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�q�r�risfsgslsesksjst�t�t�t�t�t�tu�u/v-v1v=v3v<v5v2v0v�v�v�w�w�w�w�w�w�w�w�w���������������������������������������������������������������������w�x�x�x�x�x�x�x�x�x�x�x�x�yDzHzGz�z�z�z�z�z�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�{�|�|�|�|�|~!~~~~ ~~~~~~"~~~~
~~%~$~C{|z��*�)�l��������������������������U�V�W�V�E�k�M�S�a�X�@�F�d�A�b�D�Q�G�c�>�[�q�N�n�u�U�g�`���f�]�T�e�l�c�e�d�������������������y������������������������&�0�-�.�'�1�"�)�#�/�,��������������������������������������������������������������������������݊��ߊ�Ȋފ�����������������l�n�����3�>�8�@�E�6�<�=�A�0�?���6�.�5�2�9�7�4�v�y�{�����3�5�6�����������'������z�8�<��#���F�-��
�˒���%������4��$���)�9�5�*������	�������͕����������������Ԗ����������5�/�2�$��'�)�����������癹���������������3�������|�~�{���������z�����������������������������������������������������������������������}���%�� ���)���"��������������՞֞���=�&Q%Q"Q$Q Q)Q�R�V�V�V�V�V�V~V�VV�V�X�X�X�X-[%[2[#[,['[&[/[.[{[�[�[�]l^j^�_�_�a�a�a�a�a�a�a�a�a�d�d�d�d�d�d�e�e�e�e�f�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�j�jj�j�j�j�j�j[k�k	l�o�o�o�o�o�o�o�o�o�o�o�o�o�o�q�q�q�q�q�q�qssnsos�t�t�t�t�t�t�t�t�tuuuu�uCvHvIvGv�v�v�w�w�w�w�w���������������������������������������������������������������������w�w�w�w�x�xy�x�x�xy�x�xy�y�y\z[zVzXzTzZz�z�z�z||�{|�{�{|�{|�{|	|||�{�{|�{�{|
|�|-~<~B~3~H�8~*~I~@~G~)~L~0~;~6~D~:~E~}��,���ā́ʁŁǁ���[�Z�\�����������������{�������w�|�����z�x�W�����������������������y�v�������h�������Ň������������ɇLJ̇����ćʇ����������އ��5�3�<�>�A�R�7�B�����������������������������������������������������������������������������������"�����
������O�p�r�q�o�������o�N�M�S�P�L�G�C�@���~�8�����������������������d�V�G�|�X�\�v�I�P�Q�`�m���L�j�y�W�U�R�O�q�w�{�a�^�c�g���N�Y�Ǖ��ɕÕŕ�������� ���������������՗ԗ�A�D�J�I�E�C�%�+�,�*�3�2�/�-�1�0�����������������������������������H�������������������������3�A�g�6�.�/�1�8�0���������������������������������������������������������������������E�B�C�>�7�@�=��-���������Ȟڞ����$�#�"�T���1Q-Q.Q�V�V�V�V�V�VpY<[i\j\�]m^n^�a�a�a�a�a�a�a�a�a�a�de�d�dee�d�e�e�f�f�f�j�j�j�j�j�j�j�j�j�j�j^k�klpp
ppppp�op�o&p�o�o
pr�q�qr�qvs�t�t�t�t�t�t�t�tuu\vdvYvPvSvWvZv�v�v�v�w�w�xyyy	yyyy�y�y_z|)|| ||-||&|(|"|%|0|\~P~V~c~X~b~_~Q~`~W~S~����u�сҁ��������������������������������������������������������������������Ё_�^���ƅ��Ņ������Džą��˅΅ȅŅ����҅$�������i����ۇ���߇��ԇ܇Ӈ�؇㇤�ׇه���݇S�K�O�L�F�P�Q�I�*�'�#�3�0�5�G�/�<�>�1�%�7�&�6�.�$�;�=�:�B�u������������\�b�`�W�V�^�e�g�[�Z�a�]�i�T�F�G�H�K�(�:�;�>�������������������������������������������������������������ҕӕѕ��זږ�]ߖؖݖ#�"�%�������������������������������������������������������������������������������������חٗ֗ؗ��P�Q�R���A�<�:���	�
���
������ܚ���)�5�J�L�K�ǛƛÛ��������ӛ��ě����\�S�O�J�[�K�Y�V�L�W�R�T�_�X�Z�����ߞ���%�+�*�)�(�L�U�4Q5Q�R�R�S�V�V�V�V�V�V�X�X�XY=[>[?[�]p^�_�aee
e	eee�e�e�e�f�j�j�j�j�j�j�j�j�j�j�j�j�j`k�klp'p pp+p!p"p#p)pp$pp*pr
rrrr�r�r�r�r�r�t�t�t�tu`v�w�w�w�wyy��������������������������������������������������������������������!yyyy�ygzhz3|<|9|,|;|�|�|v~u~x~p~w~o~z~r~t~h~KJ�����x�ׁՁd�a�c����م��څׅ��؅߅�܅х���ޅ���������	���������
��b�Z�[�W�a�\�X�]�Y���������P�H�J�@�S�V�T�K�U�Q�B�R�W�C�w�v�����	���������m�x�s�j�o�{�ŽR�Q�O�P�S���@�?�����ޓǓϓ“ړГ���̓ٓ���ʓԓ��ՓēΓ��ғ�}�ڕە�)�+�,�(�&���������������������������������������������������������������������������ݗޗߗ\�Y�]�W���������H�G�C�������%��$��"� �'�#����š�
���7����ޛ����ԛכ�ܛٛ�՛�ڛw���������q���x�������}�k�t�u�p�i���s�{���o�y����h���������-�@�A�M�V�W�X�7S�V�V�V�XE[�]�]�^�^�_�_�aeeee�e�f�f�f�j�j�j�j�j�j�j�j<p5p/p7p4p1pBp8p?p:p9p@p;p3pAprr�r}s|s�t�v�v�v�v�w�w�w�w�w%y#y'y(y$y)y���������������������������������������������������������������������ynzlzmz�zI|H|J|G|E|�|{~~~�~�~��y�ہف�h�i�"�����������	�����������c�f�����`�j�]�h�c�e�g�m���������Y�V�W�U�X�Z���C�A������������� �������(��
������������	���
����������ޕ�ߕ.�/���������`�b�c�_���˜P�N�Y�L�K�S�2�4�1�,�*�6�)�.�8�-�ǚʚƚ�����������@������	�������������������������������������������������������������������������������������������������������������������������������0�.�[�`�^�]�Y���:Q9Q�R�R�V�V�VH[G[�]�]�^�aek�jk�jkCpDpJpHpIpEpFprrr~sujv�w-y1y/yT|S|�|�~�~�~�~�~�~M�0�݁�*�&��#���'�.�!� �)��%�)��� �$��+�J�m�i�n�k���y�x�E�z�{���������^�[�]�F�D�E���?�;�6�)�=�<�0�9�*�7�,�@�1����5�:����d�ɘƘ��X�V�9�=�F�D�B�A�:���������������������������������������������������������������������?�͚����:�R�+���,�#�(�)�$�!���������ǝʝϝ��ŝÝ����Ν������ȝ����̝��͝��z���������1�N�e�d����N�V�V�VqYK[L[�]�]�^!e e&e"ekk	k
lUpVpWpRprr�rs�t�t�t�tmv�v5y�ypzqzW|\|Y|[|Z|�|�|�~O�ށk�4�5�3�,�2�6�,�(�&�*�%�q�������~�������������������������`�b�G�L�P�J�K�O�G�E�H�I�F�?��j�i�˘T�[�N�S�T�L�O�H�J���������������������������������������������������������������������I�R�P�К�+�;�V�U�F�H�?�D�9�3�A�<�7�4�2�=�6�۝ҝޝڝ˝Нܝѝߝ�ٝ؝֝��՝ݝ���5�3�2�B�k�����=Q�R�X�XrYM[�]/�O_bbb)e%e�e�fkkk�k[pZp"r�s�s�spv�wg|f|�~l�:�@�9�<�1�;�>�0�2�.�3�v�t�s�����������E����d�c���b�U�]�W�^�ėŗ�V�Y��� �R�X�P�J�M�K�U�Y�L�N����������������������žО����8�7�6�C�O���������������������������������������������������������������������q�p�n�o��V�VN[m\-e�f�fk_pap]p`p#r�t�t�w8y�y�yj|�~�m�C�8�7�5�K�����������������‘k�h�i��F�C�G�Ǘ�^�՚Y�c�g�f�b�^�`����������	���������F�t�u�v��V.e�ekkkkbp&r�r�w�w9yi|k|�|�~�~�~�~��F�G�H�y�z�|�{�������������n�m�o�q�s�I�r�_�h�n�m��
���������	�G�x�{�z�y�Wfpo|<�����Ñt�x�v�u�`�t�s�q�u�����
�����������������������������������������������������������������������hpep�|j�>�=�?�������ɎK�s�t�̘a���d�f�g�$���H�bk'rL���������i�h�.��)rK�����y���uvk�z��ipjp��~�I���F�G���D���������������������X�ӡ����������P���������������������������������������������������������������ѡ��������������������������������������������������������������ҡ������������š������������������������D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T���U�V�W�X�Y�Z�[���������������\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l���m�n�o�p�q�r�s���������������������������������������DzǴǵǶǷǸǹǺ�������������ǼǽǾǿ����������������������������������������������������������������������������������V�X���������������������������E�����L�K�����������������������������������������������¡J�����������K�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������¢���������������������������������������������������������������������������������������������ԡ������ۡ����������������������������������������������������������������������������������������ܡ��������������������������ڡݡ��������ء١��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������w���x�������������������z�������{�������|�������}�������u���������������t���������������s���������������r���������������q�������������������������������������������������������������������������������������������������~�������������Z�������������������������b�c�d�e�f�g�h�i�p�o�n�m�l�k�j���������v�y���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������@�B�C����������q�r�m�n�u�v�y�z�i�j�E���e�f�����������������������âĢŢƢǢȢɢʢˢ�����������������������������������������������ƦƧƨƩƪƫƬƭƮƯưƱƲƳƴƵƶƷƸƹƺƻƼƽƾƿ������������������������������������������������������������������������������������������������������������������������������ƣ������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~ǡǢǣǤǥǦǧǨǩǪǫǬǭǮǯǰ����������������t�u�v�w�x�y�z�{�|�}�~�������������������������������������������������������U�V�������������������������P�Q�R�����T���������������������������������������������������������������������W�������������������S����������O�@�B���C�������E�V�T�W�U�Fɣ�O�Mɢ�������B�A�@���C������������������������è��������X�����P����c�ꦱ��������Y�����D�d����������@�D���[���G�\���������E�G�F����������Ĩ����A�����A�E�^�]�������������������������������������Ũ����������������������K����ö�ܲ��F���������ƨG�H�_���������Qɭ�����������Ǩ����ȨE���`�������������ɨʨF�G���������������������H���������������Rɱ���������T�Sɵ�������������������J�K�L�M�I�P�j��f�i�Q�a���h��N�O�H�����e�g������������������ɮ�������������饱������ɶ���������������ɸɯ�������������������������������������������f��B����g��D���������[����`�h��d�����������G�]�������C�����b�^���Z��e�E�H��@�F��c�A�i�\��_����a��ب����Ш����˨ը����Ψ��֨�˼����ި٨�˵�ۨϨ������Ԩ�˴�Ө��ר���Ҩ��ͨ��ܨ��ݨ�������ڨ�˲����Ѩ��̨�������������������������������V�J����������I�Q�]��������������K�����Y�P�X���������T������[�N�W�M����������U�R���Z�����O�\�S�L�H������������������������׭����ѭ��֭��������ĭ��ͭ������ڭέ����������ǭ���ܭ��ӭ�����п���̭˭��ϭ[�ƭ��խԭʭ�������ɭ��ҭ�����í­��Эŭ٭ۭ��ح������������������������ȭ������c�W������\�bԲ�UԶ�Y�RԴ�VԹ�����g��Q������f������XԱ�S�O�]�P�N�Z�`�aԷ�����[�^�M�_����d��L��T�eԼ�����������������������ȳ��^�W��ų��_������U�X�ijY����dz]��S�R�ɳ��ʳƳ˳Q�\�Z�T������óV����������������ʶĶ��Ͷ���ƶǶ��Ŷ��˶�����̶����ɶ����ܼ����ȶ��ζ���ܹ������������������ಹ��������������������ஹ�ହ�෹���హ����൹�������������������������������������������������觾�詾�����訾��������v���w�����������u�����������x�_������������l�k����I�a�������S�R�����������J�I�K�����������ߨ��^���Y���Z�°\�[�`��]���^���J���������K�����������@�������L���������ݭ��������������������N��T�U�����A���j��`�_�����ð����U�������������a�����ޭ߭������������V�������B����������M�N���k�����������������������������������h������a������@�����������L�Z�����������������������������İͳ������Bɿ���Y�W�X������M�N���b���������¤��Z���k��F�����D�E������G�C���������l��m����n����P�O�����S�Q�R������������������������������������c������h�����d�g�f�e�b��������������������������������������������ѳŰi�k�j�l�ư����γ��ϳг��ж���������Ѷ��϶A�Bỹ��Z���@�A�B�D�����C������������������������O�������\�[�����H����������U�V�T�W�o�p�������������������������������l���k�������i���j����������������ǰn��ʰm��ɰȰ��Գ��ӳҳҶ����նֶԶ��Ӷ����C�D�������E�������y�����U��c�äV��ĤŤ]�^���I�q������m���̰˰c�b����P�Ƥ_���ͰC��l�`�����K�J���X�����������������o��׶EἹ����������Ǥ��������аΰϰQ���d�͢ʤ��ɤȤc�b���m���������������n�����ճ��R���ˤ��e�d���r����������������W��g�f�L�M�s�Y���Z�����������o����������D��̤�����������������t�u���������������p���p������������d�ֳ��e��������Fό��������F����������X��h���������������Ѱ��������S�e�Τͤ��Ϥ��������������������������q�����������O�f�j�y�t���o�n�u�s�l�z�m�i�x�w�v�k���r�����q�����{�p�S���Y�U���[���X�N�Q�T�P�W�Z�O�R�V�\�����������~�{��g�|�[�]�u�p���������}�_�a���h�x�t�v�\�m���v�s���d���n�o�w�l�j���k�q���^���r���f�c���z�b���e���i�������`����������y��������������������������O�����������P��������������I�K�M�����L�E�A�����D�I�R�����C������F���H��������Q�M���S���J���G�����B�@������N�����������H��K������x���t���}���r���CΣ�OΥ���y�����E�B�w����ͦ�J�|�LΩ�s�~�{�@Ρ�F�G�z���v���������u��������������D��������������N��D��������@����������������������������B�C����A��C������F����B����@�Gѡ��E�D������������������������������������������A�����w��䰧��߰|�۰���v�{�z��ᰥ����s��������ְٰ~�Ӱ�����ڰ���tԤ�ݰu�x�}����ްܰ����������װұ��ذy��ణ�հ������԰��������������������q�r�j������׳ڳu��x�سq�޳䳽������n��۳�v���{�o��f�s�m��y����ݳ���߳ܳ����z�l�r�t�h�w�ٳg�����i���������p�����������������������������޶�����������ܶ����߶��ڶ��������������ݶ���ض��������۶_�ٶ����������������������͹ȹ��U�Q�K�¹��TΌN�P�S�Ĺ��˹Ź����I�ƹǹL�̹��J�O�ùH�ɹ����������M�R�ʹ��������������G�M�G�D�G�S�T���J�B�L���R���F�I�H�H���C�E�K�A�����k��������O���������N�������P��䲾@�����E�����B鶾��A�����������C�輾�軾D�@�Q�����F鷾��������������{���������}���~�������������z���|�������P����������������������`�����V���������Q��������A�Y�@�X�W��������Z������������������m�o�n���Ŧ����������������I����}�|���_�^���]������y���������w�z��������x������������������T�����������H�I�E�F��������밫��|�������������Ϲ��ι��I�H�G�k�g�Y��n�o��������b�f����d�c���e�a�����`������������������������}�����������������{��ʬ�~�������|������������������������������Y����[���Z���@�X�W�����������������V���������\�A���������U�����������������T����Z��������X�^��U�Y�[�]�W��V�Q�Rέ�������S�\������������������������������P�S��R�W�N��Q�P��T��X�G�J�����O�U������I�J������V��M��H�L�������������������ԯԽ�������������ԴԼ�����ԾԹԲԦذ��������ԵԳ�������ﰻԶ�K�����������������������������ة������������������إ�}���رخ����Kѫ����~ذد����������������������������������������������������������������������������������������]�йc���չ_�f�W�׹ѹ\�U�[�d�ҹ��ֹZ�`�e�V�Թ^���b�h�X�a�ӹg�����Y�����Y�K�W�V�M�R�N�Q�\�����[���J�P�Z�O�L�X�������������M�O�J�L���N���þP�¾I�K�������������������S�R����a�b����c�B�[���������h�Ф��������������_����������������عi�S�Z���������������B�`�Y�L���������i�~�p��g�h���]�����������ڹ��۹ٹ��j���ѤӤҤ[�Ԥ��q��������������i�j���������������������a�C��_�`�^�Z����������������a�b�����M�N���O���������������������������ݹܹj�]�ľ������k���������l�o�������n�������q�p�m�k�������������������ʹʸ�������������ʳʮ��������������ʻʷʭ������ʺʫ�����������g�o���O�H�p�S�D�K����f�E�d�L�P�c���Q�J��M��r�i�T�R��n�l�I�k�G�F�j�h�q�m�e���N��������oθ�g�c��s�b����lξ�������pο���V�v�d����f�m�q�u�r�k�n����h�ëj�i�tκ�e�«��������������\�b��[�����`��P���U���_�\�a�Q�[��T�R���c�S�W�����X���Z�������Y�������]�^��������d��������������@�����������������C������D����������������������������B��������������A������������������������������������@�������ؽ����B�������������������������������G��C��ض��������A�D����غط����������ؼ�E������������ص���B�@�C��D�@��F����������A��A������������B���E��������������n����z�p�v�k�y�x�|�u�޹t���m�߹��{��o�r�w�q�l�������s�U�a�X�W�Z�\�_���V�T�]�[�Y�_�^�c�^���`�b�����`�W���V�U�X�Q�R�Z�S�ž\�[�T���������Y�����������������ƾ������T�����������\����]��C��������������l�m���n�դ����r�s�������������s�����U�u�t�V������ī��]�e�����E�G���F�����}�Ǿ������^��p��r����s�v���t�u�w����������ʻ�������W��X��v�x�z�w�{�y�����������ȫūǫɫƫf�w������h�g�c���_�����`�b�d�a���f�e�����������J�����I���H�G�K�F���������I������K���H�J����H��I�J����������~��칡������f���g�e���d�]�Ⱦ������d�_��o���x�ʫ��i�g�����N�M�L�L�M����ɾp�\�֤t������y�������|���������K����q���פ���������������������N���L��������r���ؤuɧ���������������Y�~���Z�}�����Ϋx�ͫ˫̫j�h�����k�i�j��^������P�Q�����O�����h�i���a������Ĩ�K�٤��s���w�v��������z����������������������������������ħ������§����ç���������������h��b�]̣�e�c�\�i�l�g�`̥�f̦�a�d�[�_�ķ�������^�j̢������������������������������ΤΪΣΥ�}�{���Ω�y��Ы�Ψ����|�z�ϫ��~�����έ����������������o���n���l�k�n��p�o����s���q�pѮ�r��m���l���m�q�r���������S�R�����������T����X�A��Z���V�^���[���U�������C���W�B�\����]���Y���������D��@�������Q���������������������������������R�����O���O������P������������������������S������V�N��P��U�T�C�����R����D���M�Q��������������������������������������e�g�k�h�c�b�l�j�j�m�d�i�k�f�������a�f�`�e�^�h�d�i�c�_�g�j�b�������������������r���D�E�`������������r��q��������������t�{����ʵ�_�����u�����������ŧ����t���W�v�w�x�ڤ����ѫ���������S�y�]ɫ���x��|����������Ƨ�������������n̬���m̩�o̪�����ҫ��ԫ�ΰαβδ�ӫ����t�s��v���u�����������b�F��a�c�`���������U�E��V����W���T���������Z�\�E�[�Y�X������������������q�o�m�p�n�l����m�k�l�n���������n��z���~���}�����F���ۤ��իX���y��z�������ȧ����ɧ�������ǧ�����������������������β�������֫���ιζκ�׫y�u��w�w�x�x�v����G�J�K�H�g�f�d�e�I��������h�����Z�[���\�]�_�a�H�G�Y�`�^����������������p�s��r�t�q�t�u�o�s���s�q�p�r�o���f��F�G���U������ʧ����ث������{�ܤ�����˧�����٫����|�������������I�}�ݤޤ���������ɢ������̧����q�r�s������p̸�������ګ���z�z���y��i�L�j�M������]�������b�����������u�v�ʾt���s����������t����k���J�������U��������Χ��ͧ۫��{��m�C�n�l�^�����v���L������ϧ��Ч������w�v̻�����u����ݫ���ܫ�ޫ߫������}�|�{�������O�o�r�p���N�u���q�P�t�s�����������a�_�`���K�d�L�c����w���x���w���������u���@�H�I�ߤ����������{����ҧԧ��������������ɤ�ӧѧ����������x�����������y�������ا֧���������է�����������ק�������������������������������̢�~̮̩��©�̭�㫬�éȩƩ���|̥�ͩ��䫦���ɩ������{�ʩ�˩ǩ̩��z̫�ĩ����}̡̤�ũ�������������������Ρ�������������������������������Τ�������~�}����|��������쫡�򫢮��~�뫦���﫥��Χ����������������������������v��Ѧ���Ѩ���Sլѣ�x�Q���������R��������ѯ���������ѭѧ����y�����w���������z���������������U�^�d���|���e�`ժ���Vբ���~�T�b�e�I��c�ء�����]��a�{���d��Y��b���W�Xէ�������[ի�_դ�\����f�c����Z��}�������������������k�o�@�Q�m�D�q�e�F�S�i�l�G��H�N�s�T���J�O�C�^���U�r�A�P��]�p�N�M��t�E��j�B��K��M�R�g�L��P�������h�������\���p��h���l�n����k��[���j�_�����������Z�@�q�����X�i�m��O�f�g�A�W�Y�V�o����������}���G���F���|���E�����C�D������z�n����᣼��{�������������H�y�B���z�������������~�y���������~�ξx��娼����̾��嬼��x���������v�����}���������w�;�姼���孼��|�{�˾��z���о����~���Ѿ��|���y�{�Ӿ��Ҿ��}�Ͼ������������������������������������V�����������������������g����j�i�h�a�J�b�A������t���������������|ɳ�������������ڧ٧����ϩΩ�����ѭ���������u�r�`�a�t�v�u������I����宼��Ծ����W¹����������������ѩЩҩ���������Ѱ���v�Q���~���}ɷ������������������ɪ������������ɩ�����������������������������ߧ������������өާ�����ۧ������������������������ݧܧ������������������������������᩾̷�ܩ侀̺̼̿����̴�詸����٩�����⩶�ש����ة��֩�����ԩ��ߩթ����䩵�کݩީ�������۩�����������������������������A�����@�����ѱ�C�����������������B������E�������������������������β�D�����������������������������������������������ѿ��������������f���������ѺѼ�}սѾ������ѿѸ��ѵѶѹ����ѻ��ѻ�î®������������ѷ�����������������������������g����˱ʱ������y�u�rզպ�������wը������̱ɱ{�j����ȱ��iս������s�±��h��x���q�DZtդ�Ʊ��R����oո�ñ����x�n�l�~հ�ı��w�|յ�����������p�űm�z�v�T�S����������������������k�d��z���j�Y�g�w�}�k�n�|�\�m�l�~�U�y�������i��_٥�p�h�q٭���f�e��c�]٤�������V����W�{���y������X�o�x�`�[٩�a�^������p�����|ݱݶݪ�l���i�z��{�b�k���n�o�����ݸ�j���d���}ݺݨݩ�~ݴݫݵݭ��e���h�f��ݰݬ������S���m�����������g�c���ݮ�������������������������Q�����L�������K�����������O���b����������R��导������T��尼��������������N���P�U���������������J�����������嵼��������������������Zٲ����¼��M������������������������峼ü��������������ؾپ���߾��־ݾ��۾վ��ܾ����׾��޾��������������ھ����������������������������������Y­�X����^���\�]�����Z���k�������[�B�E��F�D�G�l�C��N�d�M�L�K�c�e���������������u������������ũ������rٯ��������������F���������G����ĮŮ���������ӱ��ϱ����ֱձαѱԱб����v�ͱ������������u�xٰ�s�w��t��q����������V����ļ��żƼ���������������H����������y��������������������Ʈ��رױz�{�r���W���礸���������H�ٱ��|ٵ�s�����������_�������I������Ǯ������Ȯ���������۱ܱ��ݱڱ}��~پ����Y�X���������J�I�O�^�J�����餹���������������������������������������������������@�����������������������������������������P�M������S�K���N�Q��������L���O���R����������������������������Юɮ̮��Ϯ�����ʮ���ή����ˮ����ͮ��������������߱�խ�ޱ�����ծ��౩������������������٨�����������ݦټ��١�������������y�����v�w�u������{������ݻ��������x�t�z��������\�������Z�����������[�����ȼ����Ǽ����ʼ��ɼ�����澻��������������辳�徶�������������������������`�n�K�m����Q�R�f��P������Ū��������������T�Ѯ����Ұ������̳���|������뤳���B���A�����������ҮӮ��Ԯ�������´������z�����a�g����������������������ɵ���������������ɴ�������������������C����G�B�E����������@���A��A���@�F����D���������������������W�����C���M�N�F�X�H���S���I���������V���Q�O��������������J���P���D��������R�����U���E���L�����T���G�K��������������������������������[�\�i���V�L�b�J�[�E�e�R��A��������D��Q�a�`�F�X����_�`�c�Z�K�S�f�Y�a�m�V�X�������C�j�c�]�@�l�g�I����k�P�H�d�\�T��^�b�G�Z�Y�O�_�U�W���h��]�N�M�B��^��W����U���������߮��������������ծ�������������ݮ������������������������֮ڮ�����������ۮ����خ��׮���������������ٮܮ������������������������������������������������յչ��������ս����հ�����������������������������������ղ�����������������ճ���������鱺�����������շջ������ޮ�������������������������������������ִ��Ѵ��Ҵ�������δ����Ĵ��Ǵƴ��״��������ɴŴ���д�����̴���ٰٵٯ��˴���ݱ�ϴ����ʴ�ٴ���ʹôٴ���٬�ȴ�ټپ�����٪�Ӵմ�ٹ��Դ�����������������������������������������������������ݦ���������������������������������������������ݨ��������������ݬ������������ݡ����ݯ����ݣ����ݰ�������������ݪ���~�ش�ݿ�������ݥ��ݢ��ݭ�������������������������������������J�H�^�F�X�}�_�B�]�G�U�d�]���[�@�Z�o�Q�a�m�I�^�K�Y�g�D�k�a�M�C��W�h�`��e���S�f�E�P�L�N�`�_�n�O�b�����T�c�l�j�A�V�i�����b�R�������\�������������������������ͼ��������ؼ��������ռ��������������Ѽ������μּ����׼��������Լ��������ټ��Ӽ����������м������ϼ̼��Ҽ��˼��������������������������������������������������������������������������������������������������������������������������������������E����A��H�������I�����D�J���@��������G�������������C��F�B�����c���h�i������b�������f�����e����������g�d������������Q�N�W�V�T�O�r����������P�q��S�p�X�R�M�������o��L�V�U�U�h��Y�Z�T�X�S�������W��������������������v�����������������V�����������������Y��������d����������������������������۴����ܴڴ����������ݲ���p�c�e�q�d�ۼ��ڼ����������������K������j�Y�w����B�Z�[�����n������������������������k�����������\����e�o�f��p��������������������������޴��ݴ��������f�g�h�����ܼ������������L��l�Z���_��q�g���������ߴ�����������i�j�ݼ޼��������`����C�H��r����h�s�i���������j��B�A�����C�@����@�A������������������A�B�@����ݷ�k������������M���[����¥����]�a�~ɻ�����I�J�^������t�k�l����D������B����������r�����å���������ƥ��ťĥD����������������@�ŦƦ����������¦����������Ħ�ɼ�E�����æ������[�Y�L�Q�S�L�M��U��R�O�Q�V�Z�X���Z���K��M�\��T�W���E�G�^�U�N�J�Y�V�H�I�C�O�P�[�]�P�N���S���\�W�R���]�F�T�K�X�D��������������������������j�z���q���K�b���e�B�����m�o���v�h�f�g�u�G�p����n�s���J��u�y���c�I��M��O�@�l���k�}�r�����u�x�|�A�F��~�w�i�_���d�����`�N���������{���t���a�����������L�|ϡ����w�����ϪϬ�t�v�{�Iҭ��ϭ�{�s������d�~���x�zϥ���}�}�pϨ�������z�����mϪ�x�����oϫ�^�H�|�w�v�nϬ����ϩ���yϡ�qϢ���rϦ�y�~������������������������������������������L��C�������U�[�W�J�M�F�G�J���V�_�E�����@�N�B�O�Y������D�h�H����H�E�f�Z�g�a�S�b��\�e�c�I�T����A�G�`�F�Q�C���i�P�K��K�����X�]����������������������������������e������R�P�����G�����[�����U�����G�D�����g�������d�X�c�N�����O�I�E����@�Q�Y�B������D�^�F�\�������S�����H���F�J���h���b���_�]�f���a�R��`�A�E���W���V���T�L�K���C���������M���������������������������������������A�Z����������I�����M�D����������J�C����U�V���H�����������������D���������������B�������S�K��Q���W��A����G�E�B���C�O�L�T��@�F���G�������F�E��������P�N�R������������������������������@�������a�`�F޽���_�I�J��Ƿh�·^��C�ȷ��R�H�K�c޸�j�b��W�̷����˷ŷ����i޹�U�L�Y�e�ͷ����T��M�ķ��÷P�Z�d�G�Q޼�[�ɷ��N޿�E�S�g����V�l�X�f�ƷO޺�ʷ�D��]������\�����������������������������⭺}�⢺��n⯺��w�m�ⱺq��s���u���S殺}�o��⣺���u�~������|�����|�v�t�������z�w�x������z���~�����p��y�x�����{���t⪺�⤺��s������r⥺���{��y�߼�����������������������v�D�N��M�Y��K�O���F���R�����T�C�^����W�[�`�U�I������L����H�_����a��V��\����J��E��嫺A�Z�B�@���X���Q�P�]�G���������������I���@���A���H�C���O��B�����D�F�E�D�J���G�����F���������E�B���@���������A�����N�C����������Q�����������S�Y�W����Z�R����V�U�[�����T�����X�P�������q����o�������������p���m��n�������s��r������x�_�e�y�\�v�s�g�w��t�^�a�b�c�f��]�u�d�h�`����]�j�`�k�h�_�\�^�b�e�d�g�[�i�c�f�i�a���������������������x��������y��������ŭ�������W�eƣ�l�����������������ǦA����^��_���b���_��`�a���������X�Z�U�R�T��������������������Vͣ�S�P͡�W��Qͥ�Y����������������������������������������ϱ�����ϵ���ϵ������������������������w�x�y�P���L�n��v�{�Q���l�r�k�u����q�M�O�z��j�m�s��t�|�p��N���������������������m�N����P�L��X�J�W�i�H�[�R�l���S�V��Z��O��T����j�k�Y�M�I�[��Q����U������K��H�I�e�O���Y�b�X�L�`�^��_�J���c����������\�Z�K�]�a������M�������d������������p�w�yޡ��ڷk��ҷ��z�׷��η��}��m�~�l��ܷ��x�Ϸ���Էq�ٷ|�o�v�r�n�ѷطַӷ۷зu��շ��N���{��s����������t�������������������������⵺�������������������������g�d�p�j�l��f�n���m�k�q�h�o�������c�e�b�r�i���J�Q�����U�S�K�I�L�M�H�U�V�G�V�Q�O�L�P�N���R�R�M���N���O�P�K�T�S�W�X�T�������\�b�`����^���������a�]�_�������w��t�u��v���l��m�z�k��j�i�{����l����j�k���������������������������y������������������������������R�ݷ����n���b����}��������Ϲ�f�P����������޷��������|��g����ɦB�Ȧe�d�c�`������������[������Ϻ�������ϻ����ҡ�~�S���]�^�o�\�_�R�p�����Q�k�j��h�i��lڦޥީ���ާ޹����⺺��s�t���Y�Z���r�}�q�p�n�o���l�����������ǥ�������C�D��������f����b��aˬ�e�g�c�f�g�d����_;�]�d��������e�a��b��\ͯ�^ͮ�c��`�����Ͻ������Ͽ������ϼ������������������ҥ����X�W�U��ҩ�T�V���g֣Ҫ����������b�f��e�n�y����h��c�m�t�����s�a�d�u���r�q�`�i������p�w��T�v�s��V�������u����o�q�t�r�U�x�S�߷�����ެު���ᷮ�����⻺�������ޯ������������v���������u�~�}�{�z�w�x�y�|����_�\�]�W�[�a�`�^�d�e���c�y��x�~����m�n�m���z����ȥ��Y�v�j�ɥ�������E������l�j�k�h�h�i����������m����k�g�j��f͵�i����������l�h��������¬Ŭ�����Ͽ���������������Ĭ����������������������ì���������ҫҶ���ҹҺҬҸҵҳҷ�_���]������������һҲ�^����Z�\�����������x�m�k��l��s��t�p�{�u�r�o��y�n�w�z�q�y�[�x�w�v�|�����������������~��������`���������ڢ�Z��ڥ�[�a���b���X�}�{ڣ�z�_�|ڤڪ�Y�^�\�]�������W���������鷷�跻�������������޳���޺޸޹޵޴��������������������⾺�����������������������������������������@�b�A����������������������i�f�e�g�f�Z���c�X���\�[�d�h�Y���m�z���j�h�k�n��l�g���B�E�u�@�o�F��D�{�A�C�G�v�t��������s����n�����������������Ų�ʥnͼҽ�}���]���{ų�˥��o�`��������������������ҿ�~����������������������º���������i�^�_���r�o�p�q�I�H�|�w��̥��Ƭ�������ͥ���ң�����c�d���ΥϥF�j�i�Ǭ�Ϭ�Хѥҥӥ������k�l�n�m������r�p�q�������������������ˬɬ��ʬȬ��������`���������d�c���b�a����������{�z֤���������f�e�������ڧ�������������������������B�j�����s��å����|�ԥs��������ú����o�p����t͸�����������������ϬЬͬά���������̬�����������h�i��������n�l�����k�j�e�������m�����f���g��������֢֭�|�~֤֣�}����������k�j���h�����l���m���g�i�����گ�����������������������������������������������������Ǻ��ƺ��ź��������Ⱥ���������������E�C�H�I���F���G�ĺ��D�������l�k�s�m�r�o�`�q���a���b���p�n���������t�����w�u�v�����������M��N��}�O�~�L�P�J����x��o��K�p�����������~��}�������������Ѭ���n�o�եʦG��q�m�������ҬӬԬ����o��������������q�����p�������J��������������x�Q����q�p��֥u�p�������r��������K�t�R�r�ץ������׬��ج֬��լ��q�����r�s����������֯������������ڱ�s��������ɺ��ʺL�d�u�c���y���S�s�إn�x�wͼ�vͽ�y����۬ڬ����߬��ެ٬������������ܬ��ݬ����������������������������������u�v�������������w�t��������������ֲֵ֭֮֬������ַ��ִ��ֳ������������ھںڻ��������ڽ��t����������������������C���������κF�����D�����E���A���B�����������������������@�������̺��ͺ��������˺��N����Q�O���M���P�������}���~�v�z�y�w�f�g�e�x�{�|�h���@�����{�A���������|���z�~�}���U�¥¢�������T�{�����y�z�t�w�u�v����������������f�٥��������ڥo�����������x�������u�G�B���|�x�ۥ��������z�|�~�}�{Ϳ�����������������������������������������������|������������������z����������Ң�����y��ҥ���}����~�{�������������������������������ֵַ���ֶֺ���������������������������v����������������������ڸ�w�����x�����������������������N�����Q�����������������M�����L���H����O���P�������J�K������������к�����Ժ����Ѻ��Ӻ���������I�����Һ����������T���X���V�����Ϻ������S���������U�R��������Y�������W���������j�������������l�i����k���F��������E�����C�����D������V�G����������Z��W���[�]�\�X�Y������~��}�����z�}�y�q�{�|�~�r�t�s���������������������ܥ����r�����ª������������������ҧ��������Ҧ��������������Ҭ�����������ֻּ����ּ��ֿ���������������������������R�������S���T������������A����׺պֺC�B�����@��������������������m�H���I���_�^�����á����������������V�ݥr�q�p������������Īê������������������������������Ҳ���������������������������������������������������־�}���������|�����z�����{���y�����A����Z��������X�@�W���\�[�Y����������I�H���D���غG�F�ٺ����������^�����_�[�]���Z�\���������p����E�r�q�n�o���������������J���������`�¨©��������������ã����������ޥH�s�����ƪŪ�����@�����������ҷ�������������������������~����������D�]�^���C�B��������J�ۺںK�L�a�`���������������s���������K�������¬��u������ߥ����������A�������������Ҹ����������������������ڣ����������E��ܺM�ݺ������������vĥ�˦Ǫ�����B�C����@�Bӹ���D�G�E������F�C�Һ�H�A����������Ʋ��ò����Dz��������������Ų��²������IJ��Ȳ�����������������������������������������ڧ����ڥ��ڬ��ګ��ڭ��������������������������������a�P��S�G�L�F�c���J������H�b���O�N�K�M�I��R�_�Q������������������]��X��N�P��U�T�W��R�Q����ߺS��Y�[�V�O�����i�޺����\���������������b�����c�����e����������������`�h�����d���f�g���v�����j��������������������t���x�������Q�y����w���{����z���������������������O��������N��������������L���������P�M������u���������������c��a�g��e�d��j���k�h��i�b�­«�f��l��������ðê���îïó����x��������w�y�������������������������������Ţ�������������������X��Y�m�����~�̦�������E�F�D�����G�H�I����I�O����Mӻ�K��L�N������J�ɲ����˲��ʲ������������گ�����������������������������V��d�T�e�U�f��������a�^�`���_���������������k�����a�����������|�}���W�����S�X�T�V�R���U�����������������z�{�A���@�������ͦ����t�����Ȫ��L��J��������K������Z�ǯS�Y�ïR�X�V�¯įUӽ�T�ȯůɯƯQ�P�W��������������������������ϲֲӲٲزԲ���������в����Ѳ������Ҳ��ײͲղ��̲���������������ڲ������ڴ���������l���������������������ڳ��������ڶ��ڻ�β��������������h�]�_�a�e��[�Y�j���`�d�\�X��W������b�Z�^�k���i�f�g�c��r����������j�x�t��x�e���u�b�w�f�����v�p�������c�q��s���h�g�d�l�i�m���y��n�o�k�����������������p�y�u���r�v���l���t���������s�w���q�����n�����z�r�m�������{���o�������������~����������꨿�����������������ꣿ�ꦿ���������ꤿ������������_�����Y�i���a�]���d�g���\���e�������`�Z�h���c���^���b�[���f�����������n�t��w�µ�o�v�q�·��m��s�u��r�p��������øô���������÷�����õ��~�}ĭ����������������������B���������Ź�@�B���A�l�Φ����o�ʯ����ڲ����������j��������������C���I����ɪu�����M����`�[�_�]�˯^�\�������@�i�j�n�o�h�k�g�m���@���p�z�|���}�����������������������ü�D��ź�Ϧ˪ʪO������N�b��̯��a������ܲ������۲��B�C�A��s�m�l�n�r�q���������~����꪿y�x�ý�üð����ЦP��e�ίd�c��ͯ���������ݲ��޲����߲��������D������o�p��~�C�A�B�{�|�}���桽����歿�꫿����k����z�{�����l������Ѧ��Ҧ��̪ϯQ��������ӦA�R�S�@�B�Ԧ��T�ѯf�ӯЯү��A���@���q��������������������������զs˪�C�U��h������ԯg�կ������C�����B�D����������F�G�E��������t���u���E������D���������������������������p�o�m�n�q���|�¾�������Ť�֦�������w�µv�F���צ��ئ٦������v��w�w���t�v���y�u�{�z�x�x�������ѪϪ���Ϊ������ӪժҪ���ͬ�֪��Ъ|���Ԫ��������ͪ��������������[�G�H�]��W�Z�c�a��I�g�L�d�\�Y����I�b�D�e�V�_�F�K�`�O�M���X�J���^�N�E�f������������گ���د֯j�ޯۯl����ݯk�i�n���H�o�m�ׯ����ٯܯ��߯����������������������N���E�G��H��P�L�J��M�Q���F��O�����K�I�������������������ȵQ����O�ʵ��������Jۡ��ɵN����K�ŵ˵P�ǵM�G�ƵL�̵ĵõ����������w�u��{��sߢ�x��r�{���}��v��~�����|�~�y�x�y�}�͵��|�t�z�������������L�H���M��������J���K�����I�����������A�D稽C秽������@�榽��B�������걿���������������꯿��������t�����x�z�w�v���u�s�����r���y��������¡�}�~�����ô�ij��E���C�D���ڦ��תR�N�{���ۦ����S��������ܦP�����T�U�V�O���ݦ��تh��p���Wۤ���P���|��µ�ަ٪�����R�ε��Q���E�������ߦϵ��R�঱�i�Q�����r������������q����W�T�V����S��U��X�Y��Zۦ������ߨ���������S�����J�F�I�K�H�G����괿����������������������F����}���}���X�[��A�J������K�M��N�L�����ˣ�{���������ˡ�����|�z�y�}�~�~�j��������ܪ�ͷ��۪��ߪ�����������Ϳ������ݪ������ڪ�͸�����ઽ�쯻�ު����������������������������������b�\�d�a�q�t�]���k��V�`���c�e���w��U���Y�W�R�o��~�s�vХ��f�}�^�xФ�u�y�|����mУ�{����l�p�_�Z�S�X�T�g�nХ�[�����z�A���������������������v����}��������~����x�|ӵ���Ӥ���t���������s������r�\ۦ����z��{ӡ��uӯ���Ӷ���ӰӧӢ���w����y��������������������������������������������������������^�`�e�y���]����h�o�u��b��i����@�w�r����n�j�\��a�Y������f�c��s��d�z�l��k�������Z�_�p�v�A�[�g�m������x�q�t����������������������������l�`�׵}۪ۧ�յhۣ�i�w��s�ߵ��t�]�������赡�u۬�p�������n�z��Եrۭ�k�d�o��c�a�е��jۨ����صݵٵ�~�ڵv�f��ҵ^ۢ۫�e�൰�q�m��ѵ��|���x�ֵܵ޵ӵ�y�g�{�bۦ�����������������������������_���������������U�����ߵߩ�����߱��߿������߰������߲���������߶�����������߶�����߱���������۵���߸߯����߾����߲��������߫����ߴ�������������������ߺߪ��ߧ��߭���������������������������������������߮�`�������������X�����[���Y���������������������������Z�������]�����a�����U�^����W���V���T�c�\��������b���_���������������������������������s�t�g�f�b紽����v�u��_�c�]�p�a�w�Z�X�d�n�i綽O�m���������[�R�U�{�\�S�Q�N���e篽��`�h穽x�|竽��W�k�o�T�y粽����L絽r�V�j�P�^�Y筽��l�}�z�q�����������������M���I�@�C���E��A�G븿����������L���F���U�O��F�귿��J�T뿿��Q��D�H�B�V�S�P빿������W뽿M���K�����N�S�@�E�R�D��A�������M�O���Q�I�P�B���R�J�G��U���������H�T�K����L��V��C�N��������~������������³��������������������������������°������������������������������������������������������������������ĩĦ������������Ĭ����ī�����������������������ļ����������������J���������K�I�G�H�L���������������������E�F�G��������O���h����ӷ�@�B�|����{��굸�����������~�X�Z�Y���W���������������Ч�������i�k�j��������������������ӿ����A���F�������ӽ��C����ӻ���������H��Ӿ�����ӹ�G�D�����Ӻ�E�B���������L���K����׫�H�F�~שקפ׬׭ׯװ�}�E��ס׮�G���I�D���M���J����������������߽۱�쵶�ﵺ۸�������۵������ۼ۷۹ۻ����������������������ߺ���������������¸����ø������ĸ��������������㻸��������j�������e���������g�����h�������m�����������������i���l�����f�����d������������������������߲�����½��k����翽������绽�����缽�羽��������������繽�纽�罽d�����������a븽��k�g�e�`�o�����Ŀ��\�h�i�_�^�l�b�]�c�n�[�m�j�¿������ÿf����������Y�]�Z�a�g�\�p�j�_�k�f�m�^���`�n�X�l���d�c�h�[�����b�i�e���������������������������o����¥�����������������������������������������������������������������������������į�������B�E�A�����C�����D�Q�O���N�@�P�F�M������������������ž������Z�n�������妪��������������G����l����������N�������Ÿ��ý��Ľ������ſ�����������Э�m��������I������������J���N�������M�������K�L����������P����U���T��������R������S��׻׽׷׾����O�����׵��������״����Q������������������������������������������������������͸�����������ϸ��Ǹθ����ʸȸ���ɸ˸��Ƹ��̸������������t�����B�A���v�@���n�p������r�q�����s�����o���������ƽ����ʽ������Ž��ǽȽ��ɽ��������u�������p�|�ʿw�y�ȿq�u�x�ƿɿ{�s�t�z�r�v�ǿr�q�w�������s�t���u�x���������������������v�������������������������������������I���K���H�J����R��������������H�I�K�J���P���n����������������������W�������V���������������иC�F�E�D�������̿������˿����y�{�z����������������������T�S�[��������������������������������������o��������������C������A�@�B�Ѹ���D�I�G�H���������}�|�}����������L�U������L�����q�r��������p���T���R���Q�X�P�Y���V���S�W�U�O�����_���Y���^�����`�Z���[��������X�����]�������\�����D���F�������E��������I������������C�����������������B������@���G��������A�����������H�߸ڸ����ո���ָ��Ҹ�޸��׸ܸӸԸP�M�E�J��Q��ٸ����G�O�K�N�L�ݸF�ظ������L�x�{���N���M�}���ϽO���K䦻������y���۸|���z�~���w���������J�������ֽ��ҽ������ٽ����ڽ����˽����ս��Խ��ν����ͽ��ӽ��н��ؽ������̽������׽������۽ҿ����~�����Ϳӿ����Ͽ��ٿԿ���п��ڿ���ۿؿѽ��ο��ܿ��տ��ѿֿ׿�������������������������������~����������������������������������������������������������A��O����������������@�B�����C���������������������������Ĵ���ij�����������@�N�M�P�Q���A�V�[����X���W�Z�Y���C�����B�@���A������������@��M�N�g��m��������������R�P���������D�D�����Z�a�T�S�ܽ��ݽ���������vƨ��������b�����������H���V�U�W�Q�R䨻ݿ޽޿������������F�E��\�[�������������I���Y�Z�X�����������������߿���������G����s���t�]�^��������h�f�c�g�e�d�����J�����L�Q���S�R�U�����O�K�M���T�P�N����������[���T���������S�U�����������߽��������������併������࿴������������������H�I���J�����������R�����B�S�\��Ŭ��E���B����������������������������������������������������������������������������������������������������������������������������������������������������j�i�\�]�����꽺�����v�u�����_����������������X�������W���������V���_�b�`�a�e�^�f�c�d఻V���������������������������L�N�K�M���T�����o���w����������l������k�������������`�������[�^���Y���l�]��������������\�_���Z����h��o�n�����p��m�r�i�k��g�j�q�s���������������[�a�Y�b�X�]�c�`�_�^�W�\���Z����A�C�@���E�B��F��D�������������������������������������������������������������������E�������A�@��C�����B����������D�R���O�S����Q�������P���T�����������ľ������������C�E�V�D�U���a���`���^�]�b�c�F���_���������\��Q�P�O�p�������nƭ�`����������������������������������������U���������������y�x���c�����a���b������������m�������n����������C�A�E�F�L��H�J��B���I����K�D�G��b�@��a�c�����u�w�v�{���x�t�y�z���|�g�f�d�e䳻������M�N�I�J���������K���L�H�@�������������G����������������������������������F�G�H����I�����X�Y�W�V�Z���������������X���Y�W�F�d���e�H�G���������������������������������������������������������������������������������������������������������������d�����@�������������������������|�GŰ�d�A���[�����������������������������������������������������������������������������д�|��У�~�{�������}����������z�������j�����g�n���i�����l�����h�e���k���m�f�������������p���z�v������~�w�|�r���o�q�}���u�x�t�y���{�s������������������M�e�O��g�i���N�f�j���h�������G���O�~�P�E�������J�����C�B���M�L�K�I�N�}�D�F�H�����������������������������������R�C�A���S�D�B�Q�P��O�����E�������������������������������������Ŷ�����U�o���R�S�Q��T�����˧ˬ˨˷������˹��������������������������������������мй��������������п����������������������׺����������q�������p�r�����������������ע������׷�������l�������V���W�Tܣ�n�S�Y�X�k�\�R�[�P�Z�U�m�����������Q�������R�����n�q�i�m�»l�j�p�k�h�o�Y�H�J�V�W�U�Q�G�Z�T�F�I�X�����������K�L��M�]�\�����[�\�Z�f��Ż�����u�t�@�A���s�������פ�������������_�a�]�`�o�^�p�����s�U�T���S��������s�u�ƻû��ŻĻt�r���������a�^�_�M�`�[�\�J���K�]�L�������������������������������������������O�P�N�R�����_���Q�^������������]�H��I�����C�]��q���oƼ�����V����Ľ�����q���������B��x�v�z�D��y�w���������CԨ��������Bث���@�ת�C���������צ���A��������m��l�j�b�q�e�o�v�n�y���u�c��i�w���h�x�z�k��r�s�w�u��t�f��r��v���������t�s�d�g�p��������������������a�����W�Y�e�����Z�\�f�[���������d�����b���^���c������`���������X�����g�]������������_������������������������x�ǻ��z�̻л����Ȼ�����ɻ��������~����ѻ��ͻ|��˻��ʻ���y�λ����{����w�v���ϻ��}��R�����������Z�U����g�P�������O�V�������e�T�q�c�d�N���X�t�y�s���o�w�u�h�b�}�W�~�x�m�k�f�����n�{�j�z����S���v�|�r�l�Q���������p�Y�i���������������D���A��C������������B�@��������@��������C�E��E�����������B��������A����������D�����������������������������������������������������������������������������������������������������������������������������������`�Y����T�c�[���e�U���_�������a���W�X�]�b�����j�g�k�^�Z�h�j�\����������d�f���i�S�V��������������s�c���q��a����l�h���r�b�e���t�m�p�������i�d�����`��������o����k�u�������g�n������������B����f����@��������������D�������A��������C�������������������������������������a�f�O�h���I��d�j�N�J��K�`�g�M�e�L�_�c�b���^�i���������m�p�l�n�o�i�j�g�����k�h��ų����K���M�����������L�N������J������������D����S�R�T�_�U�^�V�r�u�t�h�s�������r�p�q�w�������������D�xܥ�v��������{�����E��Fج���}�z�yܣ�|�{�~�����{�������h�������������һ��ջ׻ֻ����ӻԻ�����[�����\�������M�K���I�J�F�F�N�H�L������������������G�����n�l�m�����������w�x���E�G�F���P�m�l�k��������X��V�Y�W�������������¨�˿��˭��������������������������������@���������������Ю��������Э���������������������EԢ���F��~�|�}���������������Iص�H��Kر�Jث�������������������Gا�}��������ܬ�����|�~ܡܤ�������������������j�k�����i�ػ��ڻٻ�������������G�H�O�I����������o���������A�����G����Lض����ܦܯ���������n�o�m�ۻl�������ܻ��P�J���p�t��q���u��s�y���������B����������������ܧܳ�������s�p���r���q�������ݻ����]���^�_���`���Q�N�K�P�S�L�R�O�����M���������������w�v��x�~��}�z��{�|�H�I����S����n�����Q�R�o������ŵ�q�����E��G����F�W�����������������C�������t�������Q�R���D���a��ñ�������S����Ų�M���������������u���v���������޻���������������߻��������c���b���d���������V���U�T�T����A�@�������}����{�~�|�y�@�z������������J���K�������p��������O�P�H����i����������������C�B�������ä���q���r������������������������W�D���������X�Aç���L�M�T�Q�������Nص����ܷ���z���|�������w�x�{�y��������������g������e�����[��������f���Y���Z�U���[���Y�X�V�Z���W�����������E�J�F�I�����H�G�D�B�E�Cè���F��������@Ĩ�Aħ���Q�N���O�P�r�V��U��t�s����������I�`�X��������������������������������������������������������������������������������������������������������������������������仾�h�����������Gí�BĬ���u�R�S������t�����s���u�����������������������������������������������H��O���������������������������~����������}�����������������i���������\���k�j���������l���a�_�����^�]�`�����\�K�^�]�_�N�L�M�R�K�Q�T�S�P�O��������������J�H�I�����C�����D��X�W���U���T�����Y�v���w�W�v�V���w����a�Y���������������������������������������������������������������������������������������������������������������P�Uﻭ��������`���W�V�Lò������������������ह�ࣹ�������������������������������������������n�q�s�����r�������t���p���m���o�����c�f�d�c�i�h�g�b�b�a�e�d�����Z�^�[�]�\�Y�_�b�`�a�@��X�c���������Mï������E����FĴ�����������`�^���]�c�a�����\�Z���[���_���b�x�~�����y�[š�Z�}�|�Y�{�X�z���}���~���{���x�|�������y�z���R����S���������J�v���j����kƴ�����z������������������������������������������������������������������������������������������������������������������������������������������l���u�e�j�m�f���d�k��N�����f�d�����e���������\Ť��ż������b�������������I���������������������h�v�w�����������n�q�p�o�g�h�f�e�g�Oü��P����������G���g�i�h����������������������T�U�V���K�cƶ�����x�i���������J��{Ƭ�r����������������������z�y���i������S�R�Q��^Ũ���]ũ�����L����������������������������������|�������������{�����}�x�v��w�s�y���t�r�u��������������|�j�{�z�~�������j�m���l�t�o�s�q�p�n�k�C�B��D�A�u������������������������X�����������W�U�T����������������������J�������K�����������������I�H����������������������l�o���������V�m�s�q�k�v���j�����r�������n���u�����t���������������������������`��������������_�������Ŵ������������������ű����Ŭ�p�������������������Z�\�_�[�`���Y���W�����]�����X�^����������M������������Z���������\�[�����y���x�w�z���s�t��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������}�����~���������������o�����k�������p����������l�����m���n���������z�{�~�|�v���y��}���E�����F¦�w��������������������Y���������������������Z����[�M����������x�����O���P����������N�����������������������������������L����������}���{�����������|�x���~���z���w���������y��������������������a�����bŽ�����dſ�����������������cŻ���������������������������������������������������i�n�d�g���k���r�����e�o�s�j�c�m���l�q�p��h�b�f�N�O�a������������������]���^���`�_�b�a�|�{����������x�|���}�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������P�Q������������������G���������Q�S����R���������e�����c�����������������������������T�����������³�������t�����������������d����H�u�¶����r����q�����L�J�K�I���\������������������������f����v�w���d�}�u���ܶ����������������x�R��e�~��������������쪹��]����g���y������������������������^���ĸ�������|�{�z��������M������}������f�����N�����~�������������������hŽ����Ļ��������i�j������������������T�����S�g�j�i�h����������������������������������s�����eÿ������������������t��������������J��J�W���Y�[�_�`�c�d�g�h�k�l�o�p�s�t�w�x�{�|���������ơǡʡˡȡɡ\�M���O���Q�R�S�T���}�~���������̡͡Ρޡߡ������L�M�N�I�����C�H�����]�^���ϡA�СD�A���������������������G�F�աס֡H�I�ϢТѢҢӢԢբ֢עآ٢ڢۢܢݢޢߢ����������B�����ġ��������������������������������@�A�B�C�a�U�b�������������N�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������á' ����������������Q��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������^������������������������������"�""h������� �x��ψ�XR`�|�ZT%f%W%`%l%c%Z%i%]%R%d%U%^%j%a%X%g%[%S%e%V%_%k%b%Y%h%\%Q%P%m%n%p%o%�%¡E��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������A������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������N���������������������������������������������B�������������������������������������������������������������������������������������������@�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������F�G�������D�;x�����t����D��������
���87����W��� ������������,T�����Lt���$��4zRx�$�����FJw�?:*3$"D�����$\���H�A��
ALzRx��� $���E<�P����I�B�B �A(�A0��
(A BBBF zRx�0�����(��l,����O�E�E �B(�A0�H8�G@J
8C0A(B BBBO�
8A0A(B BBBAC������ zRx�@������(ͽ��*l����WO�B�E �E(�A0�H8�G@(
8C0A(B BBBA�
8A0A(B BBBAP�������s��� ,X����F�A�A ��
ABAzRx� ���$/���Q0����!F�N�B �B(�A0�A8�G�$zRx��������(,���G
8A0A(B BBBAGNU��-@-�k!R/@�!@m!W/@�!@}!Q/R/0#�)`/�$�&Q/�/@��0@�|2@�|3@��4@�x6@��7@�t9@��:@�p<@��=@�l?@��@@�hB@��C@�dE@��F@�`H@��I@�\K@��L@�XN@��O@�TQ@��R@�PT@��U@�LW@��X@�HZ@��[@�D]@��^@�@`@��a@�<c@��d@�8f@��g@�0i@��j@�,l@��m@�(o@��p@�$r@��s@� u@��v@�x@��y@�{@��|@�~@��@��@���@��@���@��@���@��@���@��@�~�@���@�z�@���@�v�@��@�r�@��@�n�@��@�j�@��@�f�@��@�b�@��@�^�@�ܧ@�Z�@�ت@�V�@�ԭ@�R�@�а@� \E�~]AG�]���]��]���]'��^��_Q�~`���`���`RR�`���`���`���`���`Qh�`��������Ҳ��D�Q�>>��l����`}����B<��:�)����������������������������������������������������������������������������������������������~��z��z��z��z�z�x�x�x	�x�v
�p�l�b�b�b�`�X��6� � �"�$�&�(�*�,�.�0�2�4�T57��6��8��:��<��>��@��B��D��Ew��F��H��J��L��N��P��R�|T�|V�|X��Y
�Y0kBZ�Ufv�
�.�k!�k!���o`��
�@�!8���	���o���o����o�o����o�@�! 0@P`p������f/�+Q/o/�!GA$3a1��._codecs_tw.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug�Dz�7zXZ�ִF!t/����]?�E�h=��ڊ�2N����� ��/v4�'�'�	��A�A"��.���´E�K7�ndZ�ٚ=5{��3;���x��hu�!�;OI}s�'u+{_�j��)�B��=�TAy���5'�01@J�z ��������"���3��H,���w��q-F&hdDތ;�V3��Q�I|�R���_ؽ��F�F�-�����M�d:NbB:�Itzؕ��/V$
���T��c>��*�ҝ<�A���������Ri��D���E�-M9��Fj��%T���:��-��(��"%�=���g
�<`�3%f�\�I�)��ZC1��<�؎a�k�ybUiA#mF�
�����Y�+Ӽ�-8����޺d3������ވ��x�:��06ʣ��
��`��X����s��QT�,g�\��(���vW��s*�x�FIS;�:��9�,K�R�FB^m��bJD�y%i"�
t�`�!Nf�UPs�Hr��>�F��^�\��Xým���Q3ʽ�J;I��h�T�B�I�_ʹ�C����-�h�Z�x�q���ͩ����o-��=�݂ҹ1W�;Zz������+���B_/����H�5��x".�]��?:@��E��P�|3}����ԃS���n�Y��3��r��x������,�U�!���U?��˭R 4?㷪��ڮ�=�+�v���/j��bj�v�:�
�*��7�-W7���*� �2b-�
7�k���ѺU� �a�)O~�I�ݱwa����^�bB{,�����FӨ��x�4�5q�H$K>P�T�t�5�~޻�$�<�,0;�mm-�%Z۵��cmq�4��9II�KCR�MU�V��f�Ga�J��c��*y�9�D[[�(����}��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(��(0���8���o��.E���o��0T���^B��8h��c�n���w��}�.�.
��.�.�3 �lblb|��b�bD�0f0f ��k!�k��k!�k��k!�k`A �@�!@��@�!@����!�� ���!�����a��$
̰d0���(lib-dynload/_ssl.cpython-38-x86_64-linux-gnu.so000075500000554120151153537510015060 0ustar00ELF>@�@8	@�H�H �R�R"�R"Ps�s TT"T"888$$`H`H`H  S�td`H`H`H  P�td@-@-@-��Q�tdR�td�R�R"�R"

GNU"o��qo�@b*��o8��7�P 79:��|CE���qX33M����S�	~���3�
��,���[yH
I���� K�nf�EX�	f	��=		�f]�����By����
�#
/�~
�b�^�Q
��f:���?���� y�>/Q��v1�0
�q<, 8��]�m�
F"y�����,��Z�!���H��
��^y�SA�	&w�a�
$����i�	��
�*C�
h�
@v����Z�
[N'�u�
S�$�/
�z��
��	��	�����H��;
2�
p�7�����A��~+��f
��<�
���w��h�Z	�
��O��k`(	���*���#{	r�]=O��	�	���i3'0�_��	��Bg
(�M
a�G�<���z=��"*@�"1@�"O@��
__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libssl.so.1.1libpthread.so.0libc.so.6_Py_NoneStructPyLong_FromLongPyLong_FromUnsignedLongPyObject_StrPyExc_AttributeErrorPyErr_SetStringPyObject_IsTrueRAND_statusPyObject_GetBufferPyBuffer_IsContiguous_PyArg_BadArgumentPyExc_NotImplementedErrorPyBuffer_Release__stack_chk_fail_PyArg_CheckPositionalPyUnicode_AsUTF8AndSizePyBuffer_FillInfoPyFloat_TypePyFloat_AsDoublePyErr_OccurredRAND_addBIO_freeSSL_SESSION_get_timeoutSSL_SESSION_get_timeSSL_SESSION_get_ticket_lifetime_hintSSL_SESSION_get_idPyBytes_FromStringAndSizeSSL_SESSION_has_ticket_Py_TrueStruct_Py_FalseStruct_PyErr_BadInternalCallmemcmp_Py_NotImplementedStructPyErr_BadArgumentBIO_s_memBIO_new_PyArg_NoPositional_PyArg_NoKeywordsBIO_set_flagsBIO_ctrlPyBool_FromLongBIO_ctrl_pendingPyLong_FromSize_tSSL_session_reusedPyExc_ValueErrori2d_SSL_SESSIONPyMem_MallocPyErr_NoMemoryPyMem_Freed2i_SSL_SESSIONSSL_get_session_PyObject_GC_NewSSL_SESSION_freePyObject_GC_TrackPyWeakref_GetObject__errno_locationSSL_get_error_PyTime_AsMillisecondsPyEval_SaveThreadpollPyEval_RestoreThreadSSL_CTX_get_verify_modeSSL_CTX_ctrl_PyArg_Parse_SizeTSSL_CTX_get0_paramX509_VERIFY_PARAM_set_hostflagsX509_VERIFY_PARAM_get_flagsSSL_CTX_get_optionsSSL_CTX_clear_optionsSSL_CTX_set_optionsSSL_CTX_set_num_ticketsSSL_CTX_get_num_ticketsPyGILState_EnsureSSL_get_ex_dataPyThread_allocate_lockPyExc_MemoryErrorPyErr_FetchPyThread_acquire_lockBIO_printfPyThread_release_lockPyExc_OSErrorPyErr_SetFromErrnoWithFilenameObjectPyGILState_ReleaseSSL_CIPHER_get_nameSSL_CIPHER_get_versionSSL_CIPHER_get_idSSL_CIPHER_descriptionSSL_CIPHER_get_bitsSSL_CIPHER_is_aeadSSL_CIPHER_get_cipher_nidOBJ_nid2lnSSL_CIPHER_get_digest_nidSSL_CIPHER_get_kx_nidSSL_CIPHER_get_auth_nid_Py_BuildValue_SizeTSSL_select_next_proto_Py_DeallocRAND_bytesERR_get_errorERR_reason_error_stringPyErr_SetObjectPyExc_TypeErrorPyType_IsSubtype_PyLong_AsIntPyObject_GC_UnTrackPyObject_GC_DelSSL_CTX_callback_ctrlPyCallable_CheckSSL_get_servernamePyObject_CallFunctionObjArgsPyBytes_FromStringPyErr_WriteUnraisablePyUnicode_FromEncodedObjectPyLong_AsLongBIO_free_allSSL_CTX_freeSSL_freePyObject_FreePyWeakref_NewRefSSL_set_SSL_CTXSSL_set_msg_callback_PyObject_CallFunction_SizeTPyTuple_NewPyUnicode_FromStringX509_get_ext_d2iOPENSSL_sk_numAUTHORITY_INFO_ACCESS_freePyList_NewOPENSSL_sk_valueOBJ_obj2nidPyUnicode_FromStringAndSizePyList_AppendPyList_SizePyList_AsTuplePyDict_GetItemWithErrorSSL_get_verify_resultPyUnicode_FromFormatX509_verify_cert_error_stringPyObject_CallObject_PyObject_SetAttrIdSSL_CTX_set_keylog_callback_Py_fopen_objBIO_new_fpBIO_putsSSL_CTX_set_msg_callbackBIO_clear_flagsSSL_get_current_compressionCOMP_get_typeOBJ_nid2snPyUnicode_DecodeFSDefaultSSL_get0_alpn_selectedSSL_is_init_finishedSSL_get_versionstrcmpPyExc_OverflowErrorPyErr_Format_PyArg_UnpackKeywordsSSL_get_finishedSSL_get_peer_finishedSSL_CTX_set_cipher_listERR_clear_errorSSL_CTX_get_verify_callbackSSL_CTX_set_verifySSL_CTX_get_cert_storeX509_STORE_get0_objectsX509_OBJECT_get_typeX509_OBJECT_get0_X509X509_check_caSSL_CTX_set_alpn_protosSSL_CTX_set_alpn_select_cbX509_get_default_cert_file_envX509_get_default_cert_fileX509_get_default_cert_dir_envX509_get_default_cert_dirPyUnicode_AsUTF8StringPyByteArray_Type_PyByteArray_empty_stringERR_peek_last_errorPyUnicode_FSConverterOBJ_sn2nidEC_KEY_new_by_curve_nameEC_KEY_freePEM_read_DHparamsfcloseDH_freeX509_VERIFY_PARAM_clear_flagsX509_VERIFY_PARAM_set_flagsTLSv1_methodSSL_CTX_newTLSv1_1_methodTLSv1_2_methodTLS_methodTLS_client_methodTLS_server_methodOpenSSL_version_numSSL_CTX_set_session_id_contextSSL_CTX_set_post_handshake_authSSL_set_sessioni2d_X509CRYPTO_freeOBJ_obj2txtX509_NAME_entry_countX509_NAME_get_entryX509_NAME_ENTRY_setX509_NAME_ENTRY_get_objectX509_NAME_ENTRY_get_dataASN1_STRING_to_UTF8PyDict_NewX509_get_subject_namePyDict_SetItemStringX509_get_issuer_nameX509_get_versionX509_get_serialNumberi2a_ASN1_INTEGERBIO_getsX509_get0_notBeforeASN1_TIME_printX509_get0_notAfterASN1_STRING_lengthASN1_STRING_get0_datai2t_ASN1_OBJECT__sprintf_chkGENERAL_NAME_printPyExc_RuntimeWarningPyErr_WarnFormatstrchrGENERAL_NAME_freeOPENSSL_sk_pop_freeCRL_DIST_POINTS_freeBIO_writeSSL_verify_client_post_handshakeSSL_CTX_set_default_verify_pathsBIO_new_mem_bufd2i_X509_bioSSL_CTX_get_default_passwd_cb_userdataSSL_CTX_get_default_passwd_cbPEM_read_bio_X509X509_STORE_add_certX509_freePyErr_ExceptionMatchesPyUnicode_AsASCIIStringPyExc_UnicodeEncodeErrorSSL_CTX_load_verify_locationsPyErr_SetFromErrno_PyErr_ChainExceptionsSSL_get_rbioSSL_get_wbio_PyTime_GetMonotonicClockSSL_set_read_aheadSSL_shutdownSSL_pendingSSL_do_handshakePyErr_CheckSignals_PyArg_ParseTuple_SizeTSSL_readSSL_get_shutdown_PyBytes_ResizeSSL_writeSSL_get_peer_certificateSSL_get_SSL_CTXBIO_s_filePyBytes_AsStringBIO_readSSL_get_current_cipherSSL_get_ciphersSSL_newSSL_CTX_set_default_passwd_cbSSL_CTX_set_default_passwd_cb_userdataSSL_CTX_use_certificate_chain_fileSSL_CTX_use_PrivateKey_fileSSL_CTX_check_private_key_PyObject_NewSSL_get0_paramSSL_set_ex_dataSSL_set_fdBIO_up_refSSL_set_bioSSL_ctrlSSL_get_verify_modeSSL_get_verify_callbackSSL_set_verifySSL_set_post_handshake_autha2i_IPADDRESSPyUnicode_DecodeX509_VERIFY_PARAM_set1_hostX509_VERIFY_PARAM_set1_ipASN1_OCTET_STRING_freeSSL_set_connect_stateSSL_set_accept_stateOBJ_nid2objASN1_OBJECT_free_PyObject_MakeTpCall_Py_CheckFunctionResultstrlenOBJ_txt2objPyInit__sslPyType_ReadyPyModule_Create2PyModule_GetDictPyCapsule_ImportPyType_FromSpecPyErr_NewExceptionWithDocPyModule_AddStringConstantPyModule_AddIntConstantPyModule_AddObjectPyDict_SetItemOpenSSL_version_edata__bss_start_endGLIBC_2.2.5GLIBC_2.3.4GLIBC_2.4OPENSSL_1_1_0OPENSSL_1_1_1t ui	B�@ti	Nii
Zui	BU mdfmrmd�R"���R"@�S"S" S"��(S";�@S"��PS"ġ`S"СhS"סpS"ޡ�S"��S"��S"���S"���S"��S"P��S"\��S"l��S"��S"��S"P��S"\��S"l�T"�`"H�`"@`"�'`"`(`"P�0`"�@`" P`"\�X`"Lh`"�x`"l��`"��`"�'�`"��`"��`"e�`"iB�`"@�`"r��`"=�`" a"��(a"�c8a"�@a"�Ha"%jXa" `a"�ha"�exa"��a"���a"�b�a"`�a"��a"�m�a"��a"���a"�3�a" �a"���a"�p�a"�b"��b"#qb"� b"�(b"�18b"�@b"��Hb"�1Xb"�`b"ßhb"<1xb"P�b"ϟ�b"}`�b"�b"؟�b"�X�b"��b"���b"��b"�6c"�c"@c"�0c"�8c"@c"�3Xc" �`c"Uhc"�3�c"0��c"(�c"(/�c"@��c"�c"u0�c"N��c"��c"�#�c"�c"[�d"�d"�d"� d"g�(d">0d"UHd"o�Pd"�Xd"spd"��xd"3�d"���d"�d"m>�d"��d"��d"87 e"�(e"�|8e"�!@e"Q�He"kzXe" !`e"�he"{5xe"� �e"G��e"r8�e"� �e"ӓ�e"��e"` �e"���e"Yr�e" �e"���e"d=�e"�f"��f"�Zf"` f"Š(f"lS8f"0@f"ӠHf"�XXf"`f"�hf"�<xf"��f"���f"�7�f"��f"��f"�Q�f"`�f"��f"�q�f"@g"��g"&g"`"(g"+�0g"�@g" "�g"��g"�o�g"�#�g"��g"{W�g" #�g"%��g"1�g"�"h"/�h"�h"`%(h"��0h"�@h"H%Ph":�Xh"jhh"0%xh"O��h"S�h"%�h"T��h"<�h"�$i"\�i"xni"�* i"�(i"q8i"*@i"n�Hi"/#Xi"�)`i"y�hi"�"xi"�(�i"���i"��i"(�i"���i"�9�i"'�i"ԙ�i"��i" &�i"���i"�~�i"�% j"�0j"W�@j"
�Pj"�`j"�pj""��j"&��j"6��j"+��j":��j"b��j"4��j"���j"M�k"`�k"2� k"V�0k"8�@k"<�Pk"A�`k"F�pk"d��k"J��k"o��k"N��k"Y��k"]��k"d��k"j��k"�l"o�l"� l"s�0l"�@l"w�Pl"z�`l"�pl"���l"���l"���l"���l"���l"ɢ�l"ۢm"�m"� m"	�0m"!�@m"`�Pm"2�`m"J�pm"k��m"X��m"���m"��m"g��m"z��m"���m"���m"��n"գn"� n"�0n"�@n"-�Pn"=�`n"V�pn"f��n"y��n"���n"���n"���n"���n"Ф�n"��n"�o"�o"� o"��0o"+�@o";�Po"N�`o"a�po"v��o"���o"���o"ǥ�o"��o"z��o"��o"���o"�p"&�p"@� p"R�0p"�@p"m�Pp"��`p"��pp"���p"���p"���p"ɦ�p"զ�p"��p"���p"��p"!�q"4�q"D� q"ʨ0q"W�@q"��Pq"g�`q"�pq"���q"���q"ç�q"ا�q"��q"��q"��q"5��q"N�r"k�r"v� r"��0r"��@r"��Pr"�`r"Ũpr"���r"���r"���r"ۨ�r"��r"��r"(�r"��r"Hs"!�s"5� s"M�0s"i�@s"pPs"u�`s"��ps"���s"���s"ȩ�s"��s"ީ�s"��s"��s"��s"&�t"3�t"P� t"j�0t"y�@t"3�Pt"�`t"��pt"���t"���t"ƪ�t"ת�t"��t"���t"��t"���t"�u".�u"� u"�0u"A�@u"Q�Pu"k�`u"^�pu"t��u"���u"���u"���u"ʫ�u"ޫ�u"��u"��u"�v"*�v"=� v"Y�0v"p�@v"{�Pv"��`v"��pv"���v"���v"Ϭ�v"2��v"۬�v"���v"���v"
��v"�w"&�w"Q� w"3�0w">�@w"J�Pw"`�`w"o�pw"���w"���w"���w"���w"̭�w"��w"���w"�w"�x".�x"6� x"Q�0x"c�@x"0Px"X`x"y�px"���x"���x"���x"G��x"���x"x�x"Ϯ�x"��x"��y"�y"� y"-�0y"�@y"?�Py"Z�`y"�py"m��y"���y"���y"k��y"���y"���y"Ư�y"د�y"�z"�z"� z"��0z"��@z"�Pz"�`z"�pz",��z"?��z"U��z"k��z"{��z"���z"���z"���z"��{"{"° {"װ0{"�@{"�P{"�`{"%�p{"6��{"j��{"O��{"f��{"~��{"���{"���{"���{"ٱ|"@|"h |"�0|"��@|"�P|"�`|"�p|"���|"2��|"?��|"N��|"4��|"c��|"v��|"���|"��}"��}"² }"߲0}"�@}"�P}"$�`}"3�p}"��}";��}"Q��}"��}"��}"F��}"b��}"|��}"��~"��~"³ ~"߳0~"�@~"�P~"%�`~"=�p~"O��~"d��~"x��~"���~"���~"���~"Ѵ�~"��~"��"�"� "-�0">�@"R�P"^�`"v�p"���"b��"���"���"D��"Ƶ�"ܵ�"��"��"��"5� �"G�0�"^�@�"k�P�"p�`�"��p�"����"����"����"Ͷ��"ܶ��"�Ѐ"��"��"(��"A��"P� �"b�0�"|�@�"��P�"D�`�"k�p�"����"����"����"·��"ܶ��"�Ё"(��"d��"ַ�"��"� �"�0�"��@�"�P�"*�`�"8�p�"����"N���"f���"r���"~���"��Ђ"���"���"c��"���"ø �"Ѹ0�"!�@�"�P�"�`�"�p�"��"(���"k���"C���"X���"u�Ѓ"���"���"���"ι�"ƪ �"�0�"��@�"�P�""�`�"��p�"1���"B���"P���"]���"����"q�Є"���"���"���"ƺ�"�� �"��0�"޺@�"�P�"�`�"�p�"����"·��"%���";���"����"Q�Ѕ"��"��"L��"d��"A� �"z�0�"��@�"��P�" `�"��p�"@��"P���"ֻ��"���"���"�І"��"#��"1��"C��"Z� �"��0�"f�@�"�P�"��`�"��p�"����"Ӽ��"���"����"
���" �Ї";��"Q��"f��"���"*� �"��0�"�@�"��P�"ƪ`�"½p�"ӽ��"���"����"����"���"�Ј"'��"0��"A��"N��"]� �"r�0�"`@�"��P�"��`�"��p�"ʾ��"־��"!���"���"����"�Љ",��"7��"��"��"k� �"L�0�"`�@�"z�P�"u�`�"��p�"����"����"˿��"߿��"���"�Њ"%��"#��"6��"��"P� �""�0�"f�@�"x�P�"��`�"�p�"����"����"���"����"����"�Ћ"���"��"��"���"� �"�0�" �@�"1�P�"�`�"H�p�"a���"w���"����"���"����"��Ќ"��"���"��"��"�� �"�0�"u�@�")�P�"(`�"?�p�"T���"q���"P��"����"����"��Ѝ"���""��"���"ڴ�"�� �"	�0�"�@�"(�P�"5�`�"D�p�"Q���":���"h���"v���"����"�Ў"���"���"���"���"�� �"��0�"�@�"(�P�"A�`�"R�p�"b���"��"p���"x��"����"��Џ"���"���"��"���"�� �"��0�"�@�"��P�"�`�"%�p�"<���"N���"���"i���"x���"��А"���"���"���"���"�� �"��0�"��@�"��P�"�`�"p�"���"���"'���"=���"U���"o�Б"ʾ�"���"���"���"<� �"��0�"��@�"��P�"��`�"��p�"���"-���"2���"F���"a���"s�В"���"���"���"���"�� �"��0�"��@�"��P�"��`�"
�p�"u���"���"3���"����"N���"b�Г"k��"��"x��"8�"�� �"��0�"��@�"��P�"��`�"��p�"����"���"���"����"+���"I�Д"b��"���"y��"��"`� �"��0�"��@�"��P�"G�`�"��p�"����"`��"����"����"���")�Е"��"���"B��"��"`� �"��0�"�@�"v�P�"��`�"��p�"��"����"���"����"���"�Ж"���"���"���"��"/� �"A�0�"�@�"Y�P�"l�`�"}�p�"����"����"����"����"����"�З"��"�"-��"E��"( �"^�0�"w�@�"��P�"��`�"��p�"����"a���"����"����"����"PИ"��"#��"p�"��"<� �"L�0�"a�@�"w�P�"��`�"��p�"����"����"����"����"���"$�Й"0��"I��"ø�"\��"q� �"��0�"��@�"��P�"��`�"��p�"����"���"���"'���"B���"Z�К"r��"���"��""��"�� �"��0�"��@�"��P�"��`�"��p�"���"'���"7���"L���"c���"w�Л"���"���"���"���"�� �"��0�"�@�"·P�"ܶ`�"�p�"��"���"(���";���" ��"U�М"j��"��"~��"���"�� �";�0�"d�@�"��P�"��`�"��p�"���"���"���"���".���"B�Н"W��"s��"���"���"�� �"h�0�"��@�"��P�"ø`�"!�p�"����"���"���"���""���"��О"1��"B��"��"��"H �"#�0�"p@�"�P�"�`�"9�p�"P���"[���"d���"����"����"^�П"���"���"���"���"�� �"��0�"�@�"�P�""�`�"0�p�"?���"����"R���"]���"o���"��Р"���"���"���"ø�"�� �"��0�"��@�"�P�"��`�"A�p�"���"���"8���"3���"���"M�С"]��"r��"���"���"�� �"��0�"��@�"��P�"`�"��p�"���",���"?���"Z���"o���"8Т"���"���"���"���"�� �"`0�"��@�"�P�"�`�" �p�"���":���"T���"p���"����"��У"���"���"���")��"� �"�0�"�@�"�P�"(�`�"=�p�"V���"o���"����"	��"����"��Ф"8	�"���"���"��"� �"4�0�"H�@�"]�P�"u�`�"��p�"����"����"����"����"����"
�Х"*��"F��"Y��"o��"}� �"��0�"��@�"��P�"��`�"��p�"���"���"/���"G���"^���"t�Ц"���"���"���"���"�� �"`�0�"��@�"��P�"�`�"F�p�"���"5���"P���"����"X	��"^�Ч"v��"���"���"���"�� �"x	0�"��@�"��P�"�	`�"�p�"+���"E���"P���"h���"����"��Ш"���"���"���"���"�� �"�0�"-�@�"�	P�"D�`�"X�p�"j���"����"S���"����"����"��Щ"�	�"���"���"
�"�� �"�0�"�@�"*�P�"A�`�"0
p�"P
��"W���"f���"}���"����"�
Ъ"���"���"���"�
�"�� �"��0�"��@�"�P�""�`�"3�p�"D���"Y���"p���"����"����"��Ы"���"���"���"�
�"�
 �"�0�"�@�" P�",�`�"C�p�"H��"^���"p��"���"���"�Ь"i��"�"���"���"�� �"00�"P@�"pP�"�`�"��p�"����"���"���"���"b���"|�Э"
�",��"B��"]��"�� �"��0�"(
@�"q�P�"H
`�"��p�"����"����"����"h
��"�
��"��Ю"��"��";��"�
�"�
 �"�
0�"U�@�"p�P�"��`�"��p�"����"����" ��"H��"p��"��Я"��"��",��"B��"� �"]�0�"r�@�"��P�"�`�"�p�" ��"H��"����"����"����"��а"��"���"��" ��"8� �"L�0�"]�@�"�P�"m�`�"��p�"����"����"����"p��"����"@б"���"���"��"*��"B� �"Z�0�"k�@�"{�P�"��`�"��p�"����"����"����"����"����"�в"��"��"��"&��"7� �"�0�"G�@�"\�P�"o�`�"��p�"����"����"���"���"����"��г"���"��"��"v��"&� �"B�0�"^�@�"P�"n�`�"��p�"����"����"����"����"����"��д"���"��"��"$��"b� �"=�0�"K�@�"Y�P�"�`�"^�p�"n���"~���"����"����"����"��е"���"���"���"��" �"#�0�"2�@�"=�P�"M�`�"f�p�"t���"����"����"����"����"��ж"���"��"��"0�"0� �"F�0�"^�@�"z�P�"��`�"��p�"����"����"����"����"���"��з"��"&��"���"9��"I� �"c�0�"r�@�"��P�"��`�"��p�"����"����"����"���"����"�и"*��"@��"R��"P�"�� �"g�0�"z�@�"��P�"x`�"��p�"���"���"����"����"����"��й"��"��"��"0��"�� �"C�0�"Q�@�"��P�"_�`�"d�p�"q���"����"����"����"����"��к"���"���"��"��"&� �"8�0�"L�@�"]�P�"�`�"n�p�"|���"����"����"����"����"��л"���"��")��"��" �"6�0�"��@�"G�P�"Z�`�"�p�"k���"}���"����"��"ؼ"��"L(�"��0�"+@�"i"��" S"��"ԙȽ"�S"н"��"�S"�"Q�X�"��p�"G'��"h�"�!(�" a"8�"`"�"�S"�"��(�"PS"0�"�h�"`S"p�"����"@S"��"���"���"��(�"��H�"��x�"����"'�"� �"r&H�" e"X�"�b"��"1?�"��0�"��"�g"��"g"8�"��"����"�#X�"`�"\!h�"���"h"H_"P_"X_" `_"'h_":p_";x_"F�_"V�_"Y�_"n�_"p�_"w�_"y�_"��_"��_"��_"��_"��_"��_"��_"8V"@V"HV"PV"XV"`V"hV"pV"xV"	�V"
�V"�V"
�V"�V"�V"�V"�V"�V"�V"�V"�V"�V"�V"�V"�V"W"W"W"W" W"!(W""0W"#8W"$@W"%HW"&PW"(XW")`W"*hW"+pW",xW"-�W".�W"/�W"0�W"1�W"2�W"3�W"4�W"5�W"6�W"7�W"8�W"9�W"<�W"=�W">�W"?X"@X"AX"BX"C X"D(X"E0X"G8X"H@X"IHX"JPX"KXX"L`X"MhX"NpX"OxX"P�X"Q�X"R�X"S�X"T�X"U�X"W�X"X�X"Z�X"[�X"\�X"]�X"^�X"_�X"`�X"a�X"bY"cY"dY"eY"f Y"g(Y"h0Y"i8Y"j@Y"kHY"lPY"mXY"o`Y"qhY"rpY"sxY"t�Y"u�Y"v�Y"w�Y"x�Y"z�Y"{�Y"|�Y"}�Y"~�Y"�Y"��Y"��Y"��Y"��Y"��Y"�Z"�Z"�Z"�Z"� Z"�(Z"�0Z"�8Z"�@Z"�HZ"�PZ"�XZ"�`Z"�hZ"�pZ"�xZ"��Z"��Z"��Z"��Z"��Z"��Z"��Z"��Z"��Z"��Z"��Z"��Z"��Z"��Z"��Z"��Z"�["�["�["�["� ["�(["�0["�8["�@["�H["�P["�X["�`["�h["�p["�x["��["��["��["��["��["��["��["��["��["��["��["��["��["��["��["��["�\"�\"�\"�\"� \"�(\"�0\"�8\"�@\"�H\"�P\"�X\"�`\"�h\"�p\"�x\"��\"��\"��\"��\"��\"��\"��\"��\"��\"��\"��\"��\"��\"��\"��\"��\"�]"�]"�]"�]"� ]"�(]"�0]"�8]"�@]"�H]"�P]"�X]"�`]"�h]"�p]"�x]"��]"��]"��]"��]"�]"�]"�]"�]"�]"�]"�]"�]"	�]"
�]"�]"�]"
^"^"^"^" ^"(^"0^"8^"@^"H^"P^"X^"`^"h^"p^"x^"�^"�^"�^" �^"!�^""�^"#�^"$�^"%�^"&�^"'�^"(�^")�^"*�^"+�^",�^"-_"._"/_"0_"1 _"2(_"30_"48_"5@_"6��H��H��r!H��t��H����5bi!�%ci!��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&�������h'��q������h(��a������h)��Q������h*��A������h+��1������h,��!������h-��������h.��������h/������h0�������h1��������h2�������h3�������h4�������h5�������h6�������h7��q������h8��a������h9��Q������h:��A������h;��1������h<��!������h=��������h>��������h?������h@�������hA��������hB�������hC�������hD�������hE�������hF�������hG��q������hH��a������hI��Q������hJ��A������hK��1������hL��!������hM��������hN��������hO������hP�������hQ��������hR�������hS�������hT�������hU�������hV�������hW��q������hX��a������hY��Q������hZ��A������h[��1������h\��!������h]��������h^��������h_������h`�������ha��������hb�������hc�������hd�������he�������hf�������hg��q������hh��a������hi��Q������hj��A������hk��1������hl��!������hm��������hn��������ho������hp�������hq��������hr�������hs�������ht�������hu�������hv�������hw��q������hx��a������hy��Q������hz��A������h{��1������h|��!������h}��������h~��������h������h��������h���������h��������h��������h��������h��������h��������h���q������h���a������h���Q������h���A������h���1������h���!������h���������h���������h�������h��������h���������h��������h��������h��������h��������h��������h���q������h���a������h���Q������h���A������h���1������h���!������h���������h���������h�������h��������h���������h��������h��������h��������h��������h��������h���q������h���a������h���Q������h���A������h���1������h���!������h���������h���������h�������h�������h�������h������h������h������h������h������h���q���h���a���h���Q���h���A���h���1���h���!���h������h������h�������h�������h�������h������h������h������h������h������h���q���h���a���h���Q���h���A���h���1���h���!���h������h������h�������h�������h�������h������h������h������h������h������h���q���h���a���h���Q���h���A���h���1���h���!���h������h������h�������h�������h�������h������h������h������h������h������h���q���h���a���h���Q���h���A���h���1���h���!���h������h������h�������h�������h�������h������h������h������h������h������h���q���h���a���h���Q���h���A���h���1���h���!���h������h������h��������h�������h�������h������h������h������h������h������h��q����h��a����h	��Q����h
��A����h��1����h��!����h
������h������h�������h�������h�������h������h������h������h������h������h��q����h��a����h��Q����h��A����h��1����h��!����h������h������h�������h �������h!��������%=W!D���%5W!D���%-W!D���%%W!D���%W!D���%W!D���%
W!D���%W!D���%�V!D���%�V!D���%�V!D���%�V!D���%�V!D���%�V!D���%�V!D���%�V!D���%�V!D���%�V!D���%�V!D���%�V!D���%�V!D���%�V!D���%�V!D���%�V!D���%}V!D���%uV!D���%mV!D���%eV!D���%]V!D���%UV!D���%MV!D���%EV!D���%=V!D���%5V!D���%-V!D���%%V!D���%V!D���%V!D���%
V!D���%V!D���%�U!D���%�U!D���%�U!D���%�U!D���%�U!D���%�U!D���%�U!D���%�U!D���%�U!D���%�U!D���%�U!D���%�U!D���%�U!D���%�U!D���%�U!D���%�U!D���%}U!D���%uU!D���%mU!D���%eU!D���%]U!D���%UU!D���%MU!D���%EU!D���%=U!D���%5U!D���%-U!D���%%U!D���%U!D���%U!D���%
U!D���%U!D���%�T!D���%�T!D���%�T!D���%�T!D���%�T!D���%�T!D���%�T!D���%�T!D���%�T!D���%�T!D���%�T!D���%�T!D���%�T!D���%�T!D���%�T!D���%�T!D���%}T!D���%uT!D���%mT!D���%eT!D���%]T!D���%UT!D���%MT!D���%ET!D���%=T!D���%5T!D���%-T!D���%%T!D���%T!D���%T!D���%
T!D���%T!D���%�S!D���%�S!D���%�S!D���%�S!D���%�S!D���%�S!D���%�S!D���%�S!D���%�S!D���%�S!D���%�S!D���%�S!D���%�S!D���%�S!D���%�S!D���%�S!D���%}S!D���%uS!D���%mS!D���%eS!D���%]S!D���%US!D���%MS!D���%ES!D���%=S!D���%5S!D���%-S!D���%%S!D���%S!D���%S!D���%
S!D���%S!D���%�R!D���%�R!D���%�R!D���%�R!D���%�R!D���%�R!D���%�R!D���%�R!D���%�R!D���%�R!D���%�R!D���%�R!D���%�R!D���%�R!D���%�R!D���%�R!D���%}R!D���%uR!D���%mR!D���%eR!D���%]R!D���%UR!D���%MR!D���%ER!D���%=R!D���%5R!D���%-R!D���%%R!D���%R!D���%R!D���%
R!D���%R!D���%�Q!D���%�Q!D���%�Q!D���%�Q!D���%�Q!D���%�Q!D���%�Q!D���%�Q!D���%�Q!D���%�Q!D���%�Q!D���%�Q!D���%�Q!D���%�Q!D���%�Q!D���%�Q!D���%}Q!D���%uQ!D���%mQ!D���%eQ!D���%]Q!D���%UQ!D���%MQ!D���%EQ!D���%=Q!D���%5Q!D���%-Q!D���%%Q!D���%Q!D���%Q!D���%
Q!D���%Q!D���%�P!D���%�P!D���%�P!D���%�P!D���%�P!D���%�P!D���%�P!D���%�P!D���%�P!D���%�P!D���%�P!D���%�P!D���%�P!D���%�P!D���%�P!D���%�P!D���%}P!D���%uP!D���%mP!D���%eP!D���%]P!D���%UP!D���%MP!D���%EP!D���%=P!D���%5P!D���%-P!D���%%P!D���%P!D���%P!D���%
P!D���%P!D���%�O!D���%�O!D���%�O!D���%�O!D���%�O!D���%�O!D���%�O!D���%�O!D���%�O!D���%�O!D���%�O!D���%�O!D���%�O!D���%�O!D���%�O!D���%�O!D���%}O!D���%uO!D���%mO!D���%eO!D���%]O!D���%UO!D���%MO!D���%EO!D���%=O!D���%5O!D���%-O!D���%%O!D���%O!D���%O!D���%
O!D���%O!D���%�N!D���%�N!D���%�N!D���%�N!D���%�N!D���%�N!D���%�N!D���%�N!D���%�N!D���%�N!D���%�N!D���%�N!D���%�N!D���%�N!D���%�N!D���%�N!D���%}N!D���%uN!D���%mN!D���%eN!D���%]N!D���%UN!D���%MN!D���%EN!D���%=N!D���%5N!D��H�G@H��uH��N!H����H�GHH��uH��N!H����H�G H����H�G8H��uH�`N!H��H����ATI��UH��SH�HH��H��uI�|$PH��u
�H��Ӆ�t��!H��Ӆ�uI�|$X1�H��tH��H��[]A\��[]A\���ATI��UH��SH�(H��H��uI�|$@1�H��tH��H��[]A\��H��Ӆ�t�[]A\���H�G(H��uH��M!H��H����H�H��H��tH���1����Hc8�p������4�4���H�GHH��t
H�P���u	H��q�H����SH��uH�LM!H�5�H�8�m������H��H���m����t�C<1�[���P�w���ZHc������U�H��1�SH��hdH�%(H�D$X1�H��H��H���H���'��uF�CH���f��uH��H���H�5��H�=������H��L!H�5��H�:���H�|$tH������1�H�T$XdH3%(t����H��h[]���AV�AUATI��USH�ĀdH�%(H�D$x1�H�l$ H���H��uI�<$H�W���u!�TH�ֹ�H�=��[�����u��rH�t$��I��H����H�L$I�4$E1�H��A�H���b��E1�H�����u/�CH���E��u&I�$H�~H�5�H�=��s���E1��I�|$H�7K!H9_u�O�+��f.�f(�zu�D$����L$H��u�L�l$ H�\$0A����M��f(�L���L$H�����LN�D��M�����L)��L$u�L�-�J!I�EH�|$(tH���{���H�T$xdH3%(L��t�#���H��[]A\A]A^���SH��H�����H�CH��[H��@����PH��V�ZH���]�����PH�����ZH���F�����PH���ZH������H��H�dH�%(H�D$1�H�t$�����t$H�����H�T$dH3%(t�h�H�����QH������tH��I!H��
H��I!H�Z���ATUSH��dH�%(H�D$1�H��tH��H��u�H�=��?���1��H�a�!H9G��H9F����E1�H9�t:H�H�t$�U���H�{H��I���F����T$A�;$uH��L������A����wG���H���3u,��u��t.E��uH��H!H��$E��u�H��H!H��H��H!H���h�1�H�L$dH3%(t�1�H��[]A\���H��!USH��QH9�t*�-�H���5�H��H��uIH�=��!H�5�|����0H��H��tH�=�������tH��t�H��H�={�����u�1��LH�Ǿ	�w�1�H����H���D���H��1���0H��H��u
H���I����H�h�@��H��Z[]���Hc<�T���Hc0�G����,@��@���2���SH��H���1�H��u
1��{@��[�
���PH���ZH������QH�����tH�bG!H��
H�FG!H�Z�ATUSH�� dH�%(H�D$1�H��uH�
�F!H�5{1�H�9�d����1�I�������t=�~H��F!H�5]{1�H�:�2����tHc�H���5���H��H��u���ZH�t$L��H�D$�T�����u"H�IF!H�5{H�8���H��1����"H�t$H��1�H�\$�z�H��I���_�L��H�L$dH3%(H��t���H�� []A\���ATI��USH��W�H��uH�;F!H��KH������H��H��t;H�=��!��H��H��uH��1�����I�D$ H��H�EH�H�]H���k���H��[]A\���H�0H��uH��E!H��P�u�H�Z�ATUS��tH��A���m�D��H��������1�H�� ��H	�[]A\�USH��dH�%(H�D$1�H����H����yH�(�~y��r�O����te��H�׾�$�1ۃ��f�D$����=�!H��t��H�É�H�����=��!��tH�������u�1�H�L$dH3%(t�8�H��[]���AQH��b����t��t��u1�AX��^�}�Y�r�H�=��!H�5,���1�Z���PH�1�1ɾ��$������Z��D�Hc��1���PH�1�1ɾ��������Z��D�Hc�����SH��H��H�5	�H��dH�%(H�D$1�H�T$�D$������tH�{���t$H�ljs4���1�H�L$dH3%(��t��H��[���PH��C�H����ZH���B���PH��D�ZH���[���ATA��UH��H��H�5jzSH��dH�%(H�D$1�H������t>H�}��H�$H��H��H��H��H!�H!�t	H�}��E1�H��tH�}H�����H�L$dH3%(D��t�L�H��[]A\���SH��H��H�5�yH��dH�%(H�D$1�H���e�����tmH�4$H��yH�=B!H�5�vH�?����I�{8tH�
�A!H�5V�H�9����(H�{�@�1��tH��A!H�5�vH�8�t��H�L$dH3%(��t��H��[���PH���ZH������AWAVAUATUH��SH��AP��1�H��A���u�H��H�@ H�xP�H�=��!uC�4�H���!H��u2L��A!H�5?vI�8���YH�SXH�sPH�{H[]A\A]A^A_��E1�=l�!t�U�I��H�=S�!��q�H�S H�5v1�H�zPH�����A�����H�K 1ҾH��D�0H�yP1��4�H�=�!�(��=�!tL����A��u,H�s H�=o@!D�uH�vHH�?�G�H�SXH�sPH�{H��ZD��[]A\A]A^A_���X[]A\A]A^A_�AW��AVAUATUSH��H��HdH�%(H��$81�H�l$0H���H����H��H�$��H��H�D$�`�H��H�߉�H�T$�����H��1�H���H��H��H��H��v�F�H��|0
u�D0H�t$,H��E1��~�H�߉D$��H��A�������t
���,�I��H��E1�����t
����I��H��E1��u���t
����I��H���O�E1���t
�����I��E��u	L�
j?!�L�
q?!L�0�L�HtPH�KtH�=NtAPH�4tARH�5AtAVL�=AtASAUSATRAQL�
*W��$�H�=�sQH�
�V��$�H�5�sP1�AWUH�-tU��$�H��$�L��$���H�ĐH��$8dH3%(t�1�H��H[]A\A]A^A_���H��WH��A�I H��I�QH��u
E1�H�JsH��u	1�H�<sE��I����������Z�I���H�GH��tH�GH�u
RH���1�1�Y�1����SH��H�HH��tH�CHH�u��H�{PH��tH�CPH�u���H�{XH��tH�CXH�u���1�[�ATUS��yH�^=!H�5�r1�H�8�����A��Hc�1��Y�H��H����H�x ��E��t@�����vH�u<H���k��2t	H�X=!�H�_=!H��H�=�r[1�]A\������u��K�R��H��H������H��H�=_rH��1����H��H��tH�=�!H����H�MuH�����1�H��[]A\���SH��H�~H�5�<!H9�uH��<!H�5��H�8���/�����u�H��������t
�߾[�����Z�H��t�1�[���SH��H�~H�5V<!H9�uH�"<!H�5��H�8���,�|���u�H���p��Ã��t
��1�[�b�����H��t�1�[���SH�����H�{H��t
H�u��H�{H��t����H��[�����USQ�8uH�v;!H�5�H�:�����H��H�(H��H��tH�C(H�u��H;-�;!uH�{1Ҿ5���1��eH�����H�{��u'1Ҿ5��H�;!H�5�pH�8�����.H�EH�'�5H�k(��H�{H��1Ҿ6���1�Z[]���AWAVAUI��1�ATI��USH��Q�i��H����I�|$(A��u��E1�����H��1��}�H�x0H��H��u	H�xH��t�s��H��H�H;�:!�0H��u$I�|$(E1�L��H��H��:!1����H���H�����H��H��u
L������1�H�5�oH����I��H��uH���i�H�M��H���'��H�MuH����I�|$(E1�1�L��L��H���,��I�H��uL�����H�uH�����H��uI�|$(A����A�E(�FE1�H;-�9!t,H��A����A�E�m��H��tH�����A�EPH�MuH���z�D������#H�uH���c�A�EPD��A����ZD��[]A\A]A^A_���USH��QH�(H��tH�C(H�u��H�{@H��tH�C@H�u��H�{HH��tH�CHH�u���H�{Pt51�=�!t����H��H�{P����=ɟ!tH������H�CPZ1�[]���SH�����H���N���H�{����H�{�j��H�CH��[H��@����SH��H�H��t���H�{H��t
H�u�@�H�{ H��t
H�u�-�H�{8H��t
H�u��H�{0H��t
H�u��H��[����UH��H��1�SQH�]0��H�E0H��t
H�uH�����1�H�}0Z��[]�����UH��SH��QH�~H�5X�!H9�uH�{ H�EH�k H�u+���$�����u�H�;7!H�5��H�8�����5H�S H�{H�r�f��H�K �H�5H�y@HD�H�{�d�1�Z[]���AWI��AVA��AUATA��USL��H���|$L�D$����1�H��A����H��H�@ H�x@��H�{0H��uH�{H��H��t���H��H�EA��tFA�A��t<A��t�A��tA��tA���E�G�E�gA�WA��A	�E�H�{ �|$E��H�5�oH�
�kH�@RHD�H��t$H�5�k1�AWAPE���3��H�� H��uH�SXH�sPH�{H�i���
H�uH���
�H�MuH����H��D��[]A\A]A^A_�&��UH���SQ�v�H����H��H�����H��uH��5!H�H�C�H���U��H��tOH�CH������H��uH��5!H�H�S �H���'��H��t!H�C 1�H������Hc��\�H��tH�C(�H�uH���D�1�H��Z[]�AW1�AVA����AUATUSQ1���H��tH��H������uH�����H�-5!��1�E1��-�H��H����H���I�A9�}eH��D���I��H�8I���^��D9�tA����I�D$�8u�H�PHc2H�z��I��H��tlH��H���w��I�$A��uL���v�E��y��IH�����H���o��H��uH��N���H���I�H�-R4!�6H������H�H��u&H���(��H�����H��t
H�uH����1�ZH��[]A\A]A^A_�AWI��AVI��AUATUSH��(H�t$�T$D�D$M����D��D��H�=#i1�����L�ˉ��~�I��H���H�=��!H�����I�$I��uL����M��tHc��u��I��H��u���3��H������H�=I�!H���I��I�$H��uL���8�H��tM��u.H������I�������H���|��1�E1�M��uL�5qhM����H�D$H9ۙ!��I��l��H��H������I��H���.H��>tH��@u.I�w8H�=��1��'��H���=I�w8H�=?�1����H���&H���C��H��t
H���&��H���H�z2!H��H��u
�E1�1�M����H��t*��t&H��tgD�L$I��L��L��H��H�=�g1�����[H��t"��tD�D$L��L��H��H�=�g1��|���4H��t�L$L��H��1�H�=�g�]����T$L��H�=qg1��F��H�����t$H��H�=vg1����r�H����H�|$H��H�D$���H�t$I��H�uH���r��M����M��uL�-m1!L��H�5�!L���k����upH��uH�-K1!H��H�5��!L���I����uNM��uH�|$L���#���:H�|$H9=��!u�L��H�5I�!L�������uH��H�5�!L�������t�I�uL������M��tI�$uL�����H��tH�uH��(H��[]A\A]A^A_���H��([]A\A]A^A_���AUATUH��1�SH��QH����H�{HH��tH�CHH�u�Q��L�kPM��t5E1�=N�!H�CPt�/��I��L���T���=-�!tL���3��1�H;-0!��H�5�eH�������H�����H������H�CPH��uH�=�!H�5��������vH�EH�kH1�=��!t���H��H�{P1�1Ҿ������u"H�{PH�5���Z��H�{P1�1Ҿ����=q�!tH���w��H�{H�5_����1҉�Z[]A\A]���UH��SH��QH�@H��tH�C@H�u���H;-/!uH�{1����1��HH���c��H�{��u"1����H��.!H�5dH�8������H�EH�5����H�k@�e��1�Z[]���SH����GH�����H�{1�1Ҿ����H��.!H�[���H�H��uH�p.!H��S���H��H��t H���V����tH���J�����S��H��uH�7.!H�[�H��[�����H��(H�dH�%(H�D$1�H�T$H�t$�.��H�|$H��uH��-!H��	�t$�/��H�L$dH3%(t�:��H��(���SH��H�H��t(�����tH�{����H�5XcH��H�������uH��-!H�[�H��[���ATI��H�5�dU��SH��H��H��dH�%(H�D$1�H�����A������H�$H=���~L�.-!H�5�bI�:�W��A����A�$��w�H���uL�
~,!H�5O�I�9���A�����u4H���tH��uH�$�H�$H�$H�;�{1��r�����2H���tH��uH�$�H�$H�$H�;�|1��>����E1���u H�=�+!H�$H�5�1�H�?�i��A��H�\$dH3%(D��t���H��[]A\���H��H�w8H�������H��1�H�w8H���~�����UH��H��H��S1�H��dH�%(H��$�1�H��tH�QH�2H��uH��xH��H��u,RE1�L�}�!1�H�|$WH��jj�I��H�� H����H��tH�H�A���u!H�CaH�5@aH�=La�M��1���H��H���{��H��H����H��1�H���H��H��H��H;4$t$L��*!H�5aI�8�?��1��H��`H�5�`H��������u8H�}�u��E1҃},H�}A��H�l$��D9�H��t����&����L�
/*!H��H�5}�1�I�9���1�� H��uH�{*!H��H��H�������H��$�dH3%(t���H�Ĩ[]���SH��H��dH�%(H�D$1�H�F���u!H�5^H��_H�=-`���1��H��H��H���-��H��H��tkH��1�H���H��H��H��H;$tL�T)!H�5�_I�8���1��7H�{�����u���H�=��!H�5�_����1��H�5�)!H���H�T$dH3%(H��t����H��[�USQ��w(��H���H��H�?�,����H�;H�‰����1��H��(!H�5k_H�8�V����Z[]���SH��H��H�5h_H��dH�%(H�D$1�H�T$�����u���3�|$u�D$�C01��!H�{�k����u�H�{��M�����u���H�L$dH3%(t���H��[���SH��H��H�5ebH��dH�%(H�D$1�H�T$����ƒ���t2�t$��u!�{0tH��'!H�5K�H�8�k�����	H�{���H�L$dH3%(t�x��H��[���AWAVAUE1�ATE1�U1�S1�RH��@��H�����I��L���-��9�}AL�����/��H��I�������t
��uA���L��������H�������A�����PE���L�
�]AUH�
�]H�5�]1�H�=�]���H��[]A\A]A^A_���AU�I��1�ATUH��S1�H��hdH�%(H�D$X1�I��L��L���L���n�������CL�������u"L��H��ZH�5�ZH�=d]����������H9T$vL��&!��1�1�H�5�I�8�����jH�}���H�|$����H�EH��t'H�4$H�L$H���H�T$H�uH�}�U ������t
�0��H���H�}H��H�5�����H�A&!H�H�|$tL������H�L$XdH3%(H��t���H��h[]A\A]���AUATUSAR�z��H��u
L�%�%!I�$�'H��H���]��I��H��uH���-��I��H������I��H��u
H�-�%!H�E�&H�����H��H��uL��1�����H��H��������I��H��uH�m%!H�� H������H��H��uL�����H��H��tU����I��H��uH�4%!H��H�����H��u
L���z��H��t"AYI��H��H��[L��]1�A\H�=�[A]���I�$uL������H��tH�MuH������H��t
H�uH�����Z1�[]A\A]�AWI��AVI��AUI��ATUSAPH�zH�����sH�����H��H����L�` H�h�^��sL�b H�j1��LH�5$!H9�uI�oH��u11�L�%Z$!�TH���X��A�ą�u�H��#!H��H�:�_���M�g(1�H�����~L�
�#!����H�5x�1�I�9����YI�>����H���,��I�H��uL��#!H�5n�I�8����)H��L��H���A�mH��t
H�uH�����A��H��t
H�uH���q��E1�ZD��[]A\A]A^A_�U��1�SH��QH��u�����H�5Z�!Lc�A��H��1��7����Z1�[]���ATI��UH��SH��1�H��dH�%(H�D$1�H����������H�$H�x ���H�<$��H�u������uH�
h"!H��1�1�H�5��H�9�����C�����H��H��u��1��6����&I�|$H��1Ҿ�_��H���g��H��"!H�H�L$dH3%(H��t����H��[]A\���AWI��AVAUATI��H�5�XUL��SAP����H��H��������E1��=�!I���t���I��1�1�1�H�����H��H��� ���=�!tL������H��u2A�}t�N��H�O!!L��1�H�8�*���V��1�1��;����FI�H��1Ҿ�e��H��H��u���Y��[1�]A\A]A^A_�����l��H�e!!H�ZH��[]A\A]A^A_���USH��H��H�5�aH��dH�%(H�D$1�H����������tpH�{����H��H�����H�$H��H��H��H��H!�H!�tH�������u�&1��j������'H��u1��H��H���@����u�,1��A�������H�L$dH3%(t���H��[]���H�$�!AUATUH��SH��QH9�uH��uH�uH��t8�H��H�=p������u����H�=Q��������H�UH�5�!H�zH9�t	�2����tL��!H�5�1�I�:�6���H�}���A�ă��tE1�=ֆ!t���I������H��t��gA�L$���w}H�5*�Hc<�H�>������H�����H���`����H�����H���N�g���H���o��H���<襾��H���]��H���*�C���H���K��H�������H���9��H���1�A���='�!tL���-��A���uL�
�!H�5��1�I�9�?���H��u�[1�1��x����H��1���0H��H��u
H������`W�H�hH�x�@4D�`8@@H�@PH�@H�@(A��u�@0�������u3��@01��	�����uH�uH���D��1����T�A��t�T�H�{H��B�
��E��u?H�5�TH��������u,H�uH�����胿��H�=�!H�5'T1��.����$��L����I���v#H-H=�vH�{1ɺ�!���H�{�H�5WT���H�{�C����H��I�������s4L������C<H�{1��v����ZH��[]A\A]���ATH�*�!USH9FtL��!H�5�S��I�:�i���H�NH�W H��I��H�YH9ZtL�
�!H�5���I�9�3����,tL�q!H�5"���I�8����jH��4����Å�tH�=G!H�5(���H�?�����@I�|$�@��I��H��t+H�}H���e��L����;�����u��1�����������[]A\�SH��dH�%(H�D$1�H��H�$�����y�C1�1�����$H�<$Hc�����H�<$�HH�5��H������H�L$dH3%(H��t�W��H��[þ1��f���1��?��L��1�1����D�pIc����I��H��tT��L��D��H���|����xLt+Hc�L������I9��g?L��H�D$�U���H�D$�P?@��t�H�^!H����#���1��1?��1�����1��AWAVAUATUSH��8H�<$dH�%(H�D$(1��e��1��D$�:��H����1�H��A��1��!��I��H�D$ H�D$M����;l$�=H�<$������I��E��xfH�����A9�tYL���I���I�I��uL�����M���wL��H���e��I�MA��uL���d��E���R1����I��H���?L���0��L��A�����L��I�����H�|$H�D$ H���t���Hc�H��y��1������L�d$ 1�L��H�L$�w=H�L$H�=�PL��H��1����H�|$ ��H�5M�I��蕾��M����L��L�����I�$A��uL�����E��xu�����I�~~@L���%���I�H��uL���e��H��tWH��H���E��H�MA��uH���D��E��y�4I�uL���0��H���ع��H�H��u&H������I�uL���	��H�uH�����1�H�L$(dH3%(H��t�b��H��8[]A\A]A^A_�AWAVAUATUSH��H�$H��XdH�%(H��$H1�H�����H���t
H��I���j��H���V���H��H���H
H��H�5XOL��������H���H��H�uH���I��H��衸��H���
���H��H����	H��H�5OL���˷����H�xFH��H�uH�����H�����H�x����H��H����	H��H�5EXL��腷����H�yH��H���	H������	H��H�uH������@���H���H���H�D$H��uH�=�~!H�5�K�����H	H�|$1�1ɾL�l$@���H���&���H�|$H���y���H�|$��L��跻����y��1������Hc�L���w��I��H����H��H�5�ML��詶��I�$����H��I�$uL������H�|$1�1ɾ���H���a���H�|$H�����H�|$��L���"�����y��1��3��UHc�L������I��H���>H��H�5tML������I�$���%H��I�$uL���G��H�|$1�1ɾ�d��H�����H�|$H���O���H�|$��L��荺����y��1����Hc�L���M��H��H����H��H�5�LL������L����PI��L�uH�����H�����F���H���N���H�D$H��uH�=�|!H�5�I�����D1�1ҾUH���K��H�D$H����1����H��H����H��$@�D$$E1�H�T$(H�l$0H��H�|$���9D$$�,H�|$�t$$舴���I�čy�����H�5��Lc�I�>A���{��I��H���8H�=�K�s���H����I�FI�|$���I��H���u�e��L$8�-��I��H����D�\$8A��t#A��t31�A��u@H�=�K�
���I�L$I���*H�=�����I�L$I���H�=_K���I�L$I��M����M�nH��H�L$8�O��H�|$8A���"���Ic�H���W��I��H�������|���I��H���9H�=�J�t���H����I�FI�T$��H���5�����yI�uL�������1��)���=��H�=�J����I���)����I��H����H�=�J��H���M�L$I�FE�A��u-M�QH�=lJ1�A�JA�RA�2E�B肶��I���A����M�YfA�CfE�kfA���fA������RfA�C��D��ATfA�S
����WfA�CH�����VfA�S���D�ºAPfA�CD��H�
�I��D��1�AQE������H��0Hc�H������I���H�=�I���I�����wY�H��)tJH�|$1�1Ҿ�O���H�|$L������H�|$��H��耶��A�ą�y7��1����QL�5�!1��H�QII�>������u��+�:H������I��H��u#H�-F!H�T$(H�55I1�H�}迵������ ���I��H����L��H��H)�H��H�T$8���L�D$8H��tI�FIc�I�}H��L)����I��M��uI����M�n L��H������I�6��yH��I�6uvL�������lH��I�6uL�����D$$���H�5�!H�|$H�l$0�d����H��!H�|$����L�5�!L9���H���Y���H�I��uFH��虽���<H�|$�ݿ��H;�!�HH���?L�I��L��0H���`����#M���M9�tEL��H�5�GL�����I�$��yH��I�$��L��������H��I�$uL��������H�����H��H����H;�!u��H�����I��H��u1�H��H�5�GL���j���H�A��uH��誼��E��y��hH;�!uH��1�1Ҿg�f���H��H��u.�\H��H�56GL������I�A��uL���Z���E��y��1�E1�膿��H��H��uCH��薳��M����L;-6!��H�|$�f����D��H��膮��L�M��uA��H���c���A9�|��oM�rE1�L���M���A9�}�D��L���M����8tA����L�XIc3I�{����H����H��H��H�D$芹��H�|$H�u
�D$臻���D$��y��aH�{L�-�!~VH������I���IL��H�5&FL������I�M��uL���@���������H�|$�~���I�uL���!���E1��E1�H�����H����������H��$HdH3%(L��t�h���H��X[]A\A]A^A_���AVH��H��AUATUH��SH��dH�%(H�T$1�H��tH�QH�2H��uH��xH��H��u,WE1�L��m!1�H�|$WH��jj�<���H�� H����E1�H��tH�8误��A�Ņ���1��}���H��H����H�}E1�蕳��H���]���I��L��肼��A9���D��L���~���H��H���S�����uZH���7���H��H���\�����tCH��E��t
��H������H��H��t=H��H��螷����H�EtH��H�EuH��蕹��A���s���H��H�EuH���|���H�uH���o���1���H�L$dH3%(H��t�Ѷ��H��[]A\A]A^���AUATUH��SQ�1���H����H�}1�1ҾH����H������I��H��uH���H�����H��H�5�CH��苫��I�$A��uL���ʸ��E��x�H�}1�1Ҿ蓯��H��諷��I��H��t�H��H�5�CH���A���I�$A��uL��耸��E���t���H�}1�1Ҿ�E���H���]���I��H���N���H��H�5:CH�����I�$A��uL���.���E���"���H�}1�1Ҿ��H������I��H�������H��H�5�BH��蝪��I�$A��uL���ܷ��E������H�}1�1Ҿ衮��H��蹶��I��H�������H��H�5�BH���K���I�$A��uL��芷��E���~���H�}1�1Ҿ�O���H���g���I��H���X���H��H�5lBH�����I�$A��uL���8���E���,���H�}1�1Ҿ���H������I��H������H��H�5&BH��觩��I�$A��uL�����E������H�}1�1Ҿ諭��H���õ��I��H�������H��H�5�AH���U���I�$A��uL��蔶��E�������H�}1�1Ҿ�Y���H���q���I��H���b���H��H�5�AH������I�$A��uL���B���E���6���H�}1�1Ҿ����H������I��H������H��H�5HAH��豨��I�$A��uL����E�����H�}1�1Ҿ赬��H���ʹ��I��H�������H��H�5�@H���_���I�$A��uL��螵��E�������H�}1�1Ҿ�c���H���{���H��H���l���H��H�5�@H���
���H�MA��uH���L���E��y�?���1�ZH��[]A\A]���AU�I��1�ATI��US1�H��hdH�%(H�D$X1�H��H��H���L���e��������CH��蠯����uL��H��;H�5�;H�='=�ϸ���{H�T$H�����~!L��!����1�1�H�5�?I�8����LA�|$tH�=�n!H�5(�1�����-I�|$H�4$聱����y��1�1�����Hc��E���H��H�|$tH����H�L$XdH3%(H��t蚱��H��h[]A\A]���VH��A�����u
�1�Y��H��!H�Z���QH��f�����u��1��g�1��
H��!H�Z�AWAVAUATUSH��H��L�<!H�5?A��I�:�ٴ���tH�����~L�
�!H�5�>A��I�9豴���LI��H����A���,���H��H��u�H�=�>A������I�}1�菬��I��A��u1�H���<���I���(I�}���I�}I������L��1�H��H���³��I��M��tDL��L���/���L���D$裵���D$��u�f��������u%���eu�-������z����A�����u%A��L����AH�=O�IE�A�����P��A���A��u��
u)�ǁ���{u�Ӧ��E1��&��	u
�Ɓ���lt�t�P1�A����H���`���H��D��[]A\A]A^A_���AWH��H��AVI��AUE1�ATUSH��dH�%(H��$�1�H��tL�iI�H��uH��xH��H��u,RE1�L�Ne!H��H�T$xR1�jj�Z���H�� H���CM��L�%�!t.H�H��tI��u�*L��H�hH��t
I��M��u�L��L�x�M��L��L���M��L��H�D$H�D$���H�$�L9�u1�L9�u1�M9�uE1�H��H	�H�D$u9M��tI�O�����H�
�!H�5
�E1�H�9�
����EH��tFH�t$H��胩��A�Ņ�u-H�-U!H�}�L������gH�}H�5��ı���H��tCH�t$H���=���A�Ņ��PH�!H�;�������H�;H�5ٙ�|����M���*�0���L����I��H��uH�:!H�:躧��������H�PH�p I�~��!���I�MA����L���¯���H���H��t~H�>txL�l$ 1�L��L���	�����ux�CL���H�����t�|$D~ L���5���H�=.!H�5?�H�?诰���@H�T$0H�t$ I�~����L��A�����A��u �H��!H�5=�H�8�m���E1��H�|$uA��M������H��tL�D$I�X H��t	L�L$I�i E1��=�h!t�̨��I��I�~H��H��躧���=�h!A��tL���Ƨ��A��t�L�$E�*E��t� ���L�!!E1�I�;�α�����1����H�|$H��t
H�u�\���H�|$H��t
H�u�H���1�E��tI�$L��H��$�dH3%(t被��H�Ę[]A\A]A^A_�AVAUA��ATA��UH�-h!SH��裪��H�KI��H���H�C@�ȃ��,H���Hc�H�>��H�
���:H�-�g!�H�
 ��"H�-tg!�H�
8��
H�-Tg!�H�
H���M����H�{H��tG�kD����H;Z!t;E��t6H��tFA��uA�ġ����t#���H�5�� �([H�>]A\A]A^�b���E��uH�-�f!�H�
*��H�-�f!�H�
�8�j�H�
/�M��tYD������uGE��A��A���u4H�-�f!1��0�
H�
v8�"1���H�
ۖ��1���1�H��M��E��H���m����H�{HH��tH�SXH�sP蝠��H�CXW�CH[1�]A\A]A^���AWAVAUATUSH��H��(H�H��u
E1�1�E1����I��H��t�H;� t�x�u�x
H�=`�E1��y���H�H�h(E1�H�{H��H��?虞��H��1ɾfH���׭��H�{���H��1ɾfH��輭��I�o(H��~
����L�dH�l$�D$H�D$�=le!t
�U���H�D$�{(tH�{1��O���H�{�v���H�s�lj�A����s����=,e!I�ƉD$t
H�|$�)���L�s@E����u�|$���C(�D$�r���H��~�d���L��H)�H�L$A��uH�T$1�L���8����A��tM��uh�sH�T$�L��������u*�|$H�=Bd!uH�5e6�ī���mH�5t6趫���_��uH�=pd!H�5��蜫���E�������I�uL���2�����
D��H��E1������UH�{HuM��uIL�=� I��=M��t
I�uL����L�{HM��t"H�SXH�sPL��E1��'���H�CXW�CHH��(L��[]A\A]A^A_���AVAUE1�=�c!ATUH��St薣��I��H�}誩��H�uA�ĉ‰�A��A���¶���={c!I��tL���~���L�u@E��t��H��[��	]A\A]A^�.���Hc�[]A\A]A^�.�����AWAVAUATUSH��H��H�H��u
1�E1�E1��辟��H��H��t�H;�� u�1H�=a��}��1��H�L�`(E1�H�{I��I��?蛛��1�L��fH���٪��H�{��1�L��fH��辪��L�m(M��~
����M�tL�,$1Ƀ=~b!t�g���H��H�{H�L$���1�H�s����A��@��萵���=Ib!I��H�D$tH���G���L�c@辦������M��~蜠��L��H)�H�$A��uH�$1�H���r����A��uwH�$�H���Y�����uH�=�a!H�5���
������uH�=�a!H�5�������uH�=�a!H�5���Ө���g��tA��A�������H��tH�MuH���\���E��H��D��H�ߺk[]A\A]A^A_�)���H�{HH��t
H�SXH�sP�3H�/� H��=H��tH�MuH������H�CHH��t!H�SXH�sPH���>���H�CXW�1�CHH��[]A\A]A^A_���AW�I��AVAUATI��USH��H�^dH�%(H��$�1�H�T$PH��H��H�T$(�tH��t$�LH�T$DL��1�E1�H�5�2�њ����uL�H�L$(H�T$DL��1�H�5p2A�觚����u"�bL�
� H�5��1�I�9�f����GI�\$�l$DH�D$HH��tH��貜��H��E��u"��yH�-� H�52H�}1������H��t$H;� u��	H�=.�1��H����H�E��uDHc�1��P���H�D$HH���`H�� H�D$ ��uiH���H��H���[����H�t$PL�L$`H�t$ ��~Lc�M9�}/Mc�D��M9�tL�5A� H�5‘I�>�j�����E����H��tdL�s(I�|$�ٗ��I��1ɾfI��?H��L������I�|$�&���1�L��fH����L�{(H�D$M��~�=���L�H�D$�H�D$E1�L�|$E1��=�^!t聞��I��I�|$H�t$ ��L�D$8����1�I�t$����A��@��衱���=Z^!H�T$8H�D$�D$�D$4tH���N���H�L$I�L$@迢������M��~蝜��H�|$H)�H�|$�|$uH�T$1�H���n����9�|$uH�T$�H���S�����|$4��I�|$�h�����u|1��;��uH�=c]!H�5�/����s��tZ�t$��������HI�|$HD��uRH��t
H�uH���b���E��uHc�H�|$H� ���H�l$H�H��u�Hc��<���H���mE����K
D��L������I�|$HH��t!I�T$XI�t$P�Y���W�I�D$XAD$HH��t
H�uH�����E��uH�|$HH��t
H�u�̢��1�H�|$Xt
H�|$(�x���H��$�dH3%(H��t����H�ĸ[]A\A]A^A_���AW�1�AVAUATI��UH��S1�H��dH�%(H�D$x1�L�|$ L��L���L��貚�������CL�������u"L��H�')H�52)H�=t*�����H�}H��u1��1赘��H��H��t�H;�� u�i	H�=X�1��r���qH�H�|$0���~"L�
�� ����H�5-1�I�9�ј���H��tbL�s(H�}�j���I��1ɾfI��?H��L��衣��H�}踜��1�L��fH��膣��L�k(H�D$M��~�ϙ��L�H�D$�H�D$E1�L��H��蝮���������L�l$��u0H�=[!H�5���:����NA����A��A����1҃=�Z!t轚��H��H�}H�t$ H�T$�T$0�#���H�u1�����A��@���ݭ���=�Z!H�t$I��tH��蔙��L�u@��������M��~���L�D$I)�L�D$A���]���H�T$1�H��跭���H�T$�H��裭����uH�=�Y!H�5,�W����n��uH�=Z!H�5���=����T������H��t
H�uH���џ��E����	D��H����H���\H�}HH��t
H�UXH�uP�3Ic�蜞��H���<H��t
H�uH��腟��H�]HH��t!H�UXH�uPH��輓��H�EXW�1�EHH�|$(tL������H�L$xdH3%(H��t賜��H�Ĉ[]A\A]A^A_���ATI��UH��SH��H��H��wH���.1ҹH��H�=A+�i�����u��8I�<$�:���A�ą�y�&E1�H�}�E�����uH�Z� H�5+H�8���1��fH�}����H��H��uH��� H��IE��t
H���1���$H�}�B���H���*����u�a����H�����H��H�D$�*���H�D$��H��[]A\�����AUH��ATUS1�H��dH�%(H�D$1�H���������L�$$蘕��H��蠖��H��H��uH�=�W!H�5ʊ�%����yL��������lH��H�������H�=�W!H�5*1�����A1�1�1�H���m���H��H��uH�=�W!H�5���ž���H�����H��I���=���L��I�$uL���L���H��tH��菟��H�T$dH3%(H��t觚��H��[]A\A]���ATI��UH��SH��H��dH�%(H�D$1�H��wH���T1ҹH��H�=)�T�����u��TI�$H�5�� H�xH9�t*�����u!I�<$�؜��A�ă��u-�k���H��uA���H�I� H�5��H�:�ʝ��1��H�}�z�������H=���wH�}�d�����E��xA9�~A��Ic�1����H�$H��tOE��tJH�}H�p D��蝚����yH�<$H�u������1����1��A9�~Hc�H��軖��H�$��H�L$dH3%(t�N���H��[]A\���H�H��uH��� H��Q�Ǐ��H��uH��� H�Z�H��X駸����ATUSH��L���H��uH��� H��^H��I��1��Ν��Hc�薞��H��H��u�=H�SHc��H��L��觝��9�}&L���詍��H���;���H��u�H�uH������1�H��[]A\���AUATUSQH�����H��H��u�=
1��~���yH��E1�蠐��H��I���5���Hc����H��H��tFL������A9�};L��D������H�����H��uH�uH��1�聚���H�SIc�A��H���1�H��H����ZH��[]A\A]���AWH��H��AVE1�AUATUSH��H��hdH�%(H�T$X1�H��tL�qI�H��uH��~H��H��u/RA�L�*M!H��H�T$HR1�jj趙��H�� H���cI��L�8H�-�� tL�`M��tI��I��u�I��L�h�I��I��H�D$H�{H�D$蛗��H�{H�$�~���W�H�D$0H�D$)D$ H�D$8�*����I���܍��I9�uE1�H�t$L��������u-H��� H�;�������H�;H�5J��]���1��M��t>H�t$L���ԑ����u-H�-�� H�}蠐�����H�}H�55������I9�tSL��L�|$ �!�����tL�l$(�I�wI�L��H�
,���������H�{H�5����H�{L��蛋���=tR!t
�]���H�D$ H�D$H�{H�p 趒���=OR!A����H�|$ �L���A��t,�|$<t
諌���QA�>����1�����6�=R!t
���H�D$ M��tH�t$�H�t$H�{H�� ������=�Q!A��t
H�|$ �ϐ��H�|$H��tH�D$H�u蒗��H�|$H��tH�D$H�u�u���A��t8�|$<�E���A�>t���H�
�� H�9蛚�����1������s�=AQ!t
�*���H�D$ H�{�l����=%Q!A��t
H�|$ �&���A��t��1�����.H�{H�4$�V���H�{H�t$����H�|$0辊��H�EH���OH�{H�4$�(���H�{H�t$�ډ��H�|$0萊��H�|$H��t
H�u茖��H�|$H��t
H�u�x���1�H�T$XdH3%(t���A���1����k���H��h[]A\A]A^A_�AWM��AVM��AUI��ATI��UH��SH��(H�GH�=�G!�T$H�D$�.���H����W�H�h H��@H�E�@(H�@@H�@X@0@H�b���1҃=�O!t���H��H�|$H�T$�Ѝ���=�O!H�L$H�CtH��趎��H�{H��u H�uH��耕����1�1�����託���u4H��荔��H�{1�H�����M��tA�uH�{�݋���3H�t$`H�>�Δ��H�|$hH�?���L�D$hL�L$`H�{I�I�1�h���H�{1ɺ�!����}<u<�|$H�{u'����Ũt&H�{�N�����H�{��H��轗���
�豋��M���dH��1�L���H��I��I��L�T$tA�<$.uL�
� H�58�I�9����L���#���H��H��u���H�t$H�
� H��L��軏��H����H�C8H��u)H�{1�L��7����H��u��1�����L�[ A�{0��H�{�(���I��H��u5H��1�L��L���L��H��H��H�R�������ux��1��Q���EH��H�D$�ޗ��H��A��賊��H�|$Ic�H���C�����tE1����1�A������
H����A��H����A��u
��H��u�M��tAI�}(x:H�{����1ɺ�fH���K���H�{�b���1ɺ�fH���.���1�=M!t���H�Ń|$H�{u�K�����D����=�L!tH������t$�s,M��t1�L���}���H�CH��t>M��tL;5�� t1�L��H��苭����tM��t)L;=�� t 1�L��H���#����uH�uH���Y���1�H��(H��[]A\A]A^A_���AWI��AVAUATUSH��H��hH�|$dH�%(H�D$X1�H��tH�i�H��~
H��1�H��u71�VL��A�1�L�5C!H��H�D$(Pjj裑��H�� I��H����I�H�5	H!I��H�zH9�t.�،����u%I�H�H!E1�H�5H�=*蔕���aI�OM�'H�yL9�t6H�5�G!蓌����u&I�OH��G!E1�H�5�H�=��N����I�wM�oH�~H�5� H9�uH�=�� H�5;vH�?�[���E1����.�����u�I��!���A�ƃ��tH�L�
�� I��I��u�&蟈��H��t��I�H��tI��I��uL��L���L��L��L���L��I�_ H��tpI��L��ukH�D$L9�u7I��I��D��I��AUI��1�ATH�|$H�L$(����I��XZH�|$�<����,1�H�L$H��H�5`"������u�����L��I�o(�H�L$XdH3%(L��t膍��H��h[]A\A]A^A_���AWAVI��AUATUH��SH��H��HdH�%(H�D$81�H��tL�y�H��~H��E1�H��u4E1�VH��A�1�L��@!H��H�D$Pjj�U���H�� H��H��t=H�H�5I!H�zH9�t1葊����u(L�
I!H�H�5H�=I�Q�L���1��H�KH�5� L�+H�yH9�uH�=�� H�58t1�H�?�V������,�����u�H�{����A�ă��tL�L��� H��H��u�&蝆��H��t��H�{H��tH��H��uM��L���L��M��L���L��H�kH��toH��M��ujH�D$L9�u3jD��L��M��jH�L$I��L������H�|$H��XZH��t6�>����/��H�L$H��1�1�H�5\ �����u��	L��L�{ �H�L$8dH3%(H��t腋��H��H[]A\A]A^A_���AUATUSH��QH�~H�5�� H9�uH�=�� H�5�r1�H�?�����������u�H���ڍ���Ń��u1���j���1�H����H�(� H�5]1�H�:�ǎ�����x߉�����H��H��uH�
�� ��H�5A1�H�9�u����rH���ہ���Ņ�uH��� H�5(1�H�81��K����=���2�����I���h����H��I�����L��L��I��H�=�1�诐��H��H��H���A���ZH��[]A\A]���AUA��ATI��USH��AP�=�F!tH�9����{��H�kH����H�E1�H�P8���t
H�DH��uH��1�1���H���H��1�1���H��1�H���e���H��H����H�
:zH�sH��H�{�|���H�M��tWH��H�MuH���	���D9k~L��� D��H�5�s1�I�8�����4�=�E!t�؅��H�HcKH�sL���C�,H��H�MuH��貋���=�E!t褅��H��C��Z[]A\A]�H���LPL��A�1�L�C<!1�H��H�D$Pjj�/���H�� I��H���uI�}H�W����H�t$老��H��H���JH��1�H���H��H��H;L$�H����I�}�T������1���H��@��輆��H��H��txH���l���Ņ�tN���ߌ����I������H��I���5��L��L��I��H�=�1��\���H����H�������L�� H�5k1�1�I�:莁����L��� H��H�5w1�1�I�;�o����H�������H���������1��/���H��H�H�51�H�=%�����_H��� H�51�H�:�/����B1��;E1���H���É���L��趉���H��詉��H�+uH��蛉��I��I�<$H���
�
H���}����A�AV��H��AUATI��U���SH�� dH�%(H��$1�H�\$H���"������Y���=��a�����u��u3Hc�H���k���H��$dH3%(uH�� []A\A]A^��c���I�����ff.���AUI��ATUSH��H��8dH�%(H�D$(1�H������H��L�aA�L��H�t$L�V9!VI�H��1�jj�D���H�� H��H�������H�8L�GA����4���H�t$�~��H��H���_���H��葀��H9D$�/���I�������H�{�s}�����1���A��H��A���ۃ��H��H�������H���|���Ņ��e����������I���,|���H��I���L�����L��L��I��H�=�1��s���H��H������H�T$(dH3%(H��uH��8[]A\A]����D��AVH�=<!AUATUS��z�����}���H�=�8!�z�����i���H�=�=!�z�����U���H�=?!�z�����A�����H�=X7!胇��I��H���$���H���?����H�='H��車��H�������H�c� �oH�=�6!H�@��@!H�
)[@!H�d@!H�
�6!���H��@!H�������H�5!� H�=�H�H��1��=���H��H�������1�H��H�5��H�=�艁��H�mH�-@!�����H�H@!1�H�5W�H�=��[���H�,@!1�H�5��H�=�H��?!�8���H�	@!1�H�5�H�=~H��?!����H��?!1�H�5��H�=qH��?!��H��?!1�H�5R�H�=bH�\?!�π��H�=w?!H�P?!�����H�=Z?!�����H�=D?!�����H�=.?!�}���H�=?!�o���H���f���H�J?!H�5iH����w�����H���H�?!H�5eH���w�����*���H��>!H�5dH���w��������H��>!H�5]H���yw�������H��>!H�5TH���[w��������H�d>!H�5LH���=w���������H�N>!H�5BH���w���������H�9!H�5�hH���w�����v���H��5!H�5*hH����v�����X���H�t:!H�5WhH����v�����:���H��;!H�5�H���v��������H�rH�5�L���w���H�5�L����z���H�5�L���z���H�5�L���z���H�5�L���z���H�5�L���z���H�5�L���qz���H�5�L���]z���H�5�L���Iz���
H�5�L���5z��1�H�5�L���$z���H�5�L���z���H�5�L���y��1�H�5�L����y���H�5�L����y���H�5�L����y��� H�5�L���y����H�5�L���y��1�H�5�pL���y���
H�5�pL���vy���H�5�pL���by���H�5qL���Ny���H�5qL���:y���(H�5.qL���&y���*H�5BqL���y���+H�5VqL���x���,H�5rqL����x���-H�5�qL����x���.H�5�qL����x���/H�5�qL���x���0H�5�L���x���1H�5�qL���x���2H�5�qL���rx���3H�5�qL���^x���FH�5�qL���Jx���GH�5�qL���6x���PH�5�qL���"x���ZH�5rL���x���dH�5"rL���w���nH�56rL����w���oH�5JrL����w���pH�5frL���w���qH�5zrL���w���rH�5�rL���w���sH�5�rL���w���H�5�L���nw���H�5�L���Zw���H�5�L���Fw���H�5�L���2w���H�5�L���w���H�5�L���
w���H�5�L���v���T�H�5�L����v��1�H�5�L����v���H�5�L���v���H�5�L���v���H�5�L���v���H�5�L���v��� H�5}L���mv���@H�5wL���Yv��1�H�5�L���Hv���@H�5L���4v��1�H�5{L���#v���H�5zL���v���H�5xL���u���@H�5L����u���H�5L����u��� H�5�L���u���H�5�L���u���H�5�L���u���H�5�pL���u���H�5�pL���ou��H�����H�5tL���Yu��H�����H�5vL���Cu���H�5zL���/u���H�5rL���u���H�5jL���u���H�5dL����t���H�5^L����t��L�%�� H�5VL��I�$L����o��I�$L��L��H�5<��o��I�$L��L��H�54��o��L�-t� H�5*L��I�EL���o��I�$L��L��H�5�o��I�EL��L��H�5�wo��I�EL��L��H�5��`o��I�$L��L��H�5��Io��I�$L��L��H�5��2o��I�$L��L��H�5��o��I�$L��L��H�5��o��迀��H��6!賀��H�=�6!H�D6!���H�����H�=~� H����L�%n� L�-���q��A�T$A�t$L��H��1��$���H��H���u�H���l�H�=86!H��H���������R�H�=�5!H��H���������8�H�m�O�H�+�S�I��I�<$H���u���H��5!H�5�
L���n�������H�`5!H�5�
L����m����������H��5!H�����H�=�� tnL�-�� Ic}�wz��I�}I���p��H��M�����H�����H�=G5!H��L��������i�I�,$�s�H�+�\�I��I�}u�H�
5!H�5<
L���Fm�����+��Ir��H��H���n��H����H��H�5
L���m�������I��I��H��I��I��H��I��I��A��A��@��A��A��E��H�=��\~��H�����H��H�5�L���l�������1��R}��H���
o��H���~�H��H�5�L���l�����d�A�A����H�=m��}��H���4�H��H�5�L���5l������[L��]A\A]A^ÐH�=i3!H�b3!H9�tH��� H��t	�����H�=93!H�523!H)�H��H��H��?H�H�tH�e� H��t��fD�����=�2!u+UH�=J� H��tH�=�� �9r���d�����2!]������w�����H��H���cannot delete attributecontiguous bufferargument_set_npn_protocolsRAND_addargument 1failed to allocate BIOInvalid sessioni2d() failed.value must be non-negativefailed to set num tickets.Unable to allocate lock%s
id{sksssssssisisOssssssss}keadigestsymmetricaeadalg_bitsstrength_bitsdescriptionnum must be positiveNO(ks)not a callable objectasciiwriteOsiiiy#unknown error[%S: %S] %s: %S (_ssl.c:%d)[%S: %S] %s (_ssl.c:%d)[%S] %s (_ssl.c:%d)iNabunknownOption is too longtls-uniquestrargument 'cb_type'get_channel_bindingembedded null characterset_ciphersNo cipher can be selected.invalid value for verify_modepx509_cacrlx509{sisisi}_set_alpn_protocolsNNNNrbHIGH:!aNULL:!eNULLPythonValue is not a SSLSession.Ns#subjectissuerserialNumbernotBeforenotAfterDirNameemailURIRegistered ID<INVALID>IP Address%d.%d.%d.%d%X:%X:%X:%X:%X:%X:%X:%X<invalid>Unknown general name type %dInvalid value %.200ssubjectAltNameOCSPcaIssuerscrlDistributionPointsnumberconnectconnect_goodconnect_renegotiateacceptaccept_goodaccept_renegotiatehitsmissestimeoutscache_fullstring longer than %d bytesEmpty certificate dataCertificate data is too long.Can't allocate bufferSome I/O error occurredInvalid error codeThe read operation timed outThe write operation timed outi:readiw*:readsize should not be negativegetpeercerthandshake not done yetCan't open filestrictargument 'incoming'_wrap_bioargument 'outgoing'argument 'sock'_wrap_socketNID must be positive.unknown NID %iUnknown objectissNargument 'txt'txt2objunknown object '%.100s'_socket.CAPIOOssl.SSLCertVerificationErrorssl.SSLZeroReturnErrorssl.SSLWantReadErrorssl.SSLWantWriteErrorssl.SSLSyscallErrorssl.SSLEOFErrorSSLSession_DEFAULT_CIPHERSSSL_ERROR_ZERO_RETURNSSL_ERROR_WANT_READSSL_ERROR_WANT_WRITESSL_ERROR_WANT_X509_LOOKUPSSL_ERROR_SYSCALLSSL_ERROR_SSLSSL_ERROR_WANT_CONNECTSSL_ERROR_EOFSSL_ERROR_INVALID_ERROR_CODECERT_NONECERT_OPTIONALCERT_REQUIREDVERIFY_DEFAULTVERIFY_CRL_CHECK_LEAFVERIFY_CRL_CHECK_CHAINVERIFY_X509_STRICTVERIFY_X509_TRUSTED_FIRSTALERT_DESCRIPTION_UNKNOWN_CAPROTOCOL_SSLv23PROTOCOL_TLSPROTOCOL_TLS_CLIENTPROTOCOL_TLS_SERVERPROTOCOL_TLSv1PROTOCOL_TLSv1_1PROTOCOL_TLSv1_2OP_ALLOP_NO_SSLv2OP_NO_SSLv3OP_NO_TLSv1OP_NO_TLSv1_1OP_NO_TLSv1_2OP_NO_TLSv1_3OP_CIPHER_SERVER_PREFERENCEOP_SINGLE_DH_USEOP_NO_TICKETOP_SINGLE_ECDH_USEOP_NO_COMPRESSIONOP_ENABLE_MIDDLEBOX_COMPATOP_NO_RENEGOTIATIONHOSTFLAG_ALWAYS_CHECK_SUBJECTHOSTFLAG_NEVER_CHECK_SUBJECTHOSTFLAG_NO_WILDCARDSHOSTFLAG_NO_PARTIAL_WILDCARDSPROTO_MINIMUM_SUPPORTEDPROTO_MAXIMUM_SUPPORTEDPROTO_SSLv3PROTO_TLSv1PROTO_TLSv1_1PROTO_TLSv1_2PROTO_TLSv1_3HAS_SNIHAS_TLS_UNIQUEHAS_ECDHHAS_NPNHAS_ALPNHAS_SSLv2HAS_SSLv3HAS_TLSv1HAS_TLSv1_1HAS_TLSv1_2HAS_TLSv1_3err_codes_to_nameserr_names_to_codeslib_codes_to_namesOPENSSL_VERSION_NUMBERIIIIIOPENSSL_VERSION_INFOOPENSSL_VERSION_OPENSSL_API_VERSIONcontextserver_sideserver_hostnameownersession_reuseddo_handshakependingciphershared_ciphersselected_alpn_protocolcompressionshutdownverify_client_post_handshakecheck_hostname_host_flagsminimum_versionmaximum_versionkeylog_filename_msg_callbacksni_callbacknum_ticketsoptionspost_handshake_authverify_flagsload_cert_chainload_dh_paramsload_verify_locationssession_statsset_default_verify_pathsset_ecdh_curvecert_store_statsget_ca_certsget_cipherswrite_eofhas_ticketticket_lifetime_hinttimetimeout_test_decode_certRAND_bytesRAND_pseudo_bytesRAND_statusget_default_verify_pathsnid2objtxtcb_typebinary_formcafilecapathcadatacertfilekeyfilepasswordincomingoutgoingsockASN1BNBUFCMSCOMPCRYPTOECDSAEVPFIPSHMACKDFOBJOSSL_STOREPEMPKCS12PKCS7RANDSM2SYSUIUSERX509X509V3ADDING_OBJECTASN1_PARSE_ERRORASN1_SIG_PARSE_ERRORAUX_ERRORBAD_OBJECT_HEADERBAD_TEMPLATEBMPSTRING_IS_WRONG_LENGTHBN_LIBBOOLEAN_IS_WRONG_LENGTHBUFFER_TOO_SMALLCONTEXT_NOT_INITIALISEDDATA_IS_WRONGDEPTH_EXCEEDEDERROR_GETTING_TIMEERROR_LOADING_SECTIONERROR_SETTING_CIPHER_PARAMSEXPECTING_AN_INTEGEREXPECTING_AN_OBJECTEXPLICIT_LENGTH_MISMATCHEXPLICIT_TAG_NOT_CONSTRUCTEDFIELD_MISSINGFIRST_NUM_TOO_LARGEHEADER_TOO_LONGILLEGAL_BITSTRING_FORMATILLEGAL_BOOLEANILLEGAL_CHARACTERSILLEGAL_FORMATILLEGAL_HEXILLEGAL_IMPLICIT_TAGILLEGAL_INTEGERILLEGAL_NEGATIVE_VALUEILLEGAL_NESTED_TAGGINGILLEGAL_NULLILLEGAL_NULL_VALUEILLEGAL_OBJECTILLEGAL_OPTIONAL_ANYILLEGAL_PADDINGILLEGAL_TAGGED_ANYILLEGAL_TIME_VALUEILLEGAL_ZERO_CONTENTINTEGER_NOT_ASCII_FORMATINTEGER_TOO_LARGE_FOR_LONGINVALID_BIT_STRING_BITS_LEFTINVALID_BMPSTRING_LENGTHINVALID_DIGITINVALID_MODIFIERINVALID_NUMBERINVALID_OBJECT_ENCODINGINVALID_SCRYPT_PARAMETERSINVALID_SEPARATORINVALID_STRING_TABLE_VALUEINVALID_UTF8STRINGINVALID_VALUEMIME_NO_CONTENT_TYPEMIME_PARSE_ERRORMIME_SIG_PARSE_ERRORMISSING_EOCMISSING_SECOND_NUMBERMISSING_VALUEMSTRING_NOT_UNIVERSALMSTRING_WRONG_TAGNESTED_ASN1_STRINGNESTED_TOO_DEEPNON_HEX_CHARACTERSNOT_ENOUGH_DATANO_MATCHING_CHOICE_TYPENO_MULTIPART_BODY_FAILURENO_MULTIPART_BOUNDARYNO_SIG_CONTENT_TYPENULL_IS_WRONG_LENGTHOBJECT_NOT_ASCII_FORMATODD_NUMBER_OF_CHARSSECOND_NUMBER_TOO_LARGESEQUENCE_LENGTH_MISMATCHSEQUENCE_NOT_CONSTRUCTEDSEQUENCE_OR_SET_NEEDS_CONFIGSHORT_LINESIG_INVALID_MIME_TYPESTREAMING_NOT_SUPPORTEDSTRING_TOO_LONGSTRING_TOO_SHORTTIME_NOT_ASCII_FORMATTYPE_NOT_CONSTRUCTEDTYPE_NOT_PRIMITIVEUNEXPECTED_EOCUNKNOWN_FORMATUNKNOWN_OBJECT_TYPEUNKNOWN_PUBLIC_KEY_TYPEUNKNOWN_SIGNATURE_ALGORITHMUNKNOWN_TAGUNSUPPORTED_CIPHERUNSUPPORTED_PUBLIC_KEY_TYPEUNSUPPORTED_TYPEWRONG_INTEGER_TYPEWRONG_PUBLIC_KEY_TYPEFAILED_TO_SET_POOLFAILED_TO_SWAP_CONTEXTINIT_FAILEDINVALID_POOL_SIZEACCEPT_ERRORADDRINFO_ADDR_IS_NOT_AF_INETAMBIGUOUS_HOST_OR_SERVICEBAD_FOPEN_MODEBROKEN_PIPEGETSOCKNAME_ERRORGETSOCKNAME_TRUNCATED_ADDRESSGETTING_SOCKTYPEINVALID_ARGUMENTINVALID_SOCKETIN_USELISTEN_V6_ONLYLOOKUP_RETURNED_NOTHINGMALFORMED_HOST_OR_SERVICENBIO_CONNECT_ERRORNO_PORT_DEFINEDNO_SUCH_FILEUNABLE_TO_BIND_SOCKETUNABLE_TO_CREATE_SOCKETUNABLE_TO_KEEPALIVEUNABLE_TO_LISTEN_SOCKETUNABLE_TO_NODELAYUNABLE_TO_REUSEADDRUNAVAILABLE_IP_FAMILYUNINITIALIZEDUNKNOWN_INFO_TYPEUNSUPPORTED_IP_FAMILYUNSUPPORTED_METHODUNSUPPORTED_PROTOCOL_FAMILYWRITE_TO_READ_ONLY_BIOWSASTARTUPARG2_LT_ARG3BAD_RECIPROCALBIGNUM_TOO_LONGBITS_TOO_SMALLCALLED_WITH_EVEN_MODULUSDIV_BY_ZEROEXPAND_ON_STATIC_BIGNUM_DATAINPUT_NOT_REDUCEDINVALID_RANGEINVALID_SHIFTNOT_A_SQUARENO_INVERSENO_SOLUTIONPRIVATE_KEY_TOO_LARGEP_IS_NOT_PRIMETOO_MANY_ITERATIONSTOO_MANY_TEMPORARY_VARIABLESATTRIBUTE_ERRORCERTIFICATE_ALREADY_PRESENTCERTIFICATE_HAS_NO_KEYIDCERTIFICATE_VERIFY_ERRORCIPHER_INITIALISATION_ERRORCMS_DATAFINAL_ERRORCMS_LIBCONTENTIDENTIFIER_MISMATCHCONTENT_NOT_FOUNDCONTENT_TYPE_MISMATCHCONTENT_TYPE_NOT_SIGNED_DATACONTENT_VERIFY_ERRORCTRL_ERRORERROR_GETTING_PUBLIC_KEYERROR_SETTING_KEYERROR_SETTING_RECIPIENTINFOINVALID_ENCRYPTED_KEY_LENGTHINVALID_KEY_LENGTHMD_BIO_INIT_ERRORMESSAGEDIGEST_WRONG_LENGTHMSGSIGDIGEST_ERRORMSGSIGDIGEST_WRONG_LENGTHNEED_ONE_SIGNERNOT_A_SIGNED_RECEIPTNOT_KEKNOT_KEY_AGREEMENTNOT_KEY_TRANSPORTNOT_PWRINO_CIPHERNO_CONTENTNO_DEFAULT_DIGESTNO_DIGEST_SETNO_KEYNO_KEY_OR_CERTNO_MATCHING_DIGESTNO_MATCHING_RECIPIENTNO_MATCHING_SIGNATURENO_MSGSIGDIGESTNO_PASSWORDNO_PRIVATE_KEYNO_PUBLIC_KEYNO_RECEIPT_REQUESTNO_SIGNERSRECEIPT_DECODE_ERRORRECIPIENT_ERRORSIGNER_CERTIFICATE_NOT_FOUNDSIGNFINAL_ERRORSMIME_TEXT_ERRORSTORE_INIT_ERRORTYPE_NOT_COMPRESSED_DATATYPE_NOT_DIGESTED_DATATYPE_NOT_ENCRYPTED_DATATYPE_NOT_ENVELOPED_DATAUNABLE_TO_FINALIZE_CONTEXTUNKNOWN_CIPHERUNKNOWN_DIGEST_ALGORITHMUNKNOWN_IDUNSUPPORTED_CONTENT_TYPEUNSUPPORTED_KEK_ALGORITHMUNSUPPORTED_RECIPIENT_TYPEUNWRAP_ERRORUNWRAP_FAILUREVERIFICATION_FAILUREZLIB_DEFLATE_ERRORZLIB_INFLATE_ERRORZLIB_NOT_SUPPORTEDERROR_LOADING_DSOLIST_CANNOT_BE_NULLMISSING_CLOSE_SQUARE_BRACKETMISSING_EQUAL_SIGNMISSING_INIT_FUNCTIONMODULE_INITIALIZATION_ERRORNO_CLOSE_BRACENO_CONFNO_SECTIONRECURSIVE_DIRECTORY_INCLUDESSL_COMMAND_SECTION_EMPTYSSL_COMMAND_SECTION_NOT_FOUNDSSL_SECTION_EMPTYSSL_SECTION_NOT_FOUNDUNABLE_TO_CREATE_NEW_SECTIONUNKNOWN_MODULE_NAMEVARIABLE_EXPANSION_TOO_LONGVARIABLE_HAS_NO_VALUEFIPS_MODE_NOT_SUPPORTEDILLEGAL_HEX_DIGITODD_NUMBER_OF_DIGITSBASE64_DECODE_ERRORINVALID_LOG_ID_LENGTHLOG_CONF_INVALIDLOG_CONF_INVALID_KEYLOG_CONF_MISSING_DESCRIPTIONLOG_CONF_MISSING_KEYLOG_KEY_INVALIDSCT_FUTURE_TIMESTAMPSCT_INVALIDSCT_INVALID_SIGNATURESCT_LIST_INVALIDSCT_LOG_ID_MISMATCHSCT_NOT_SETSCT_UNSUPPORTED_VERSIONUNRECOGNIZED_SIGNATURE_NIDUNSUPPORTED_ENTRY_TYPEBAD_GENERATORBN_DECODE_ERRORCHECK_INVALID_J_VALUECHECK_INVALID_Q_VALUECHECK_PUBKEY_INVALIDCHECK_PUBKEY_TOO_LARGECHECK_PUBKEY_TOO_SMALLCHECK_P_NOT_PRIMECHECK_P_NOT_SAFE_PRIMECHECK_Q_NOT_PRIMEINVALID_PARAMETER_NAMEINVALID_PARAMETER_NIDINVALID_PUBKEYKDF_PARAMETER_ERRORKEYS_NOT_SETMISSING_PUBKEYMODULUS_TOO_LARGENOT_SUITABLE_GENERATORNO_PARAMETERS_SETNO_PRIVATE_VALUEPARAMETER_ENCODING_ERRORPEER_KEY_ERRORSHARED_INFO_ERRORUNABLE_TO_CHECK_GENERATORBAD_Q_VALUEINVALID_DIGEST_TYPEINVALID_PARAMETERSMISSING_PARAMETERSMISSING_PRIVATE_KEYSEED_LEN_SMALLCTRL_FAILEDDSO_ALREADY_LOADEDEMPTY_FILE_STRUCTUREFILENAME_TOO_BIGFINISH_FAILEDINCORRECT_FILE_SYNTAXNAME_TRANSLATION_FAILEDNO_FILENAMENULL_HANDLESET_FILENAME_FAILEDSTACK_ERRORSYM_FAILUREUNLOAD_FAILEDASN1_ERRORBAD_SIGNATUREBIGNUM_OUT_OF_RANGECANNOT_INVERTCOORDINATES_OUT_OF_RANGECURVE_DOES_NOT_SUPPORT_ECDHD2I_ECPKPARAMETERS_FAILUREDISCRIMINANT_IS_ZEROEC_GROUP_NEW_BY_NAME_FAILUREFIELD_TOO_LARGEGF2M_NOT_SUPPORTEDGROUP2PKPARAMETERS_FAILUREI2D_ECPKPARAMETERS_FAILUREINCOMPATIBLE_OBJECTSINVALID_COMPRESSED_POINTINVALID_COMPRESSION_BITINVALID_CURVEINVALID_DIGESTINVALID_ENCODINGINVALID_FIELDINVALID_FORMINVALID_GROUP_ORDERINVALID_OUTPUT_LENGTHINVALID_PEER_KEYINVALID_PENTANOMIAL_BASISINVALID_PRIVATE_KEYINVALID_TRINOMIAL_BASISLADDER_POST_FAILURELADDER_PRE_FAILURELADDER_STEP_FAILUREMISSING_OIDNEED_NEW_SETUP_VALUESNOT_A_NIST_PRIMEOPERATION_NOT_SUPPORTEDPASSED_NULL_PARAMETERPKPARAMETERS2GROUP_FAILUREPOINT_ARITHMETIC_FAILUREPOINT_AT_INFINITYPOINT_IS_NOT_ON_CURVESLOT_FULLUNDEFINED_GENERATORUNDEFINED_ORDERUNKNOWN_COFACTORUNKNOWN_GROUPUNKNOWN_ORDERUNSUPPORTED_FIELDWRONG_CURVE_PARAMETERSWRONG_ORDERARGUMENT_IS_NOT_A_NUMBERCMD_NOT_EXECUTABLECOMMAND_TAKES_INPUTCOMMAND_TAKES_NO_INPUTCONFLICTING_ENGINE_IDCTRL_COMMAND_NOT_IMPLEMENTEDDSO_FAILUREDSO_NOT_FOUNDENGINES_SECTION_ERRORENGINE_CONFIGURATION_ERRORENGINE_IS_NOT_IN_LISTENGINE_SECTION_ERRORFAILED_LOADING_PRIVATE_KEYFAILED_LOADING_PUBLIC_KEYID_OR_NAME_MISSINGINTERNAL_LIST_ERRORINVALID_CMD_NAMEINVALID_CMD_NUMBERINVALID_INIT_VALUEINVALID_STRINGNOT_LOADEDNO_CONTROL_FUNCTIONNO_INDEXNO_LOAD_FUNCTIONNO_REFERENCENO_SUCH_ENGINEUNIMPLEMENTED_CIPHERUNIMPLEMENTED_DIGESTVERSION_INCOMPATIBILITYAES_KEY_SETUP_FAILEDARIA_KEY_SETUP_FAILEDBAD_DECRYPTBAD_KEY_LENGTHCAMELLIA_KEY_SETUP_FAILEDCIPHER_PARAMETER_ERRORCOMMAND_NOT_SUPPORTEDCOPY_ERRORCTRL_NOT_IMPLEMENTEDDIFFERENT_KEY_TYPESDIFFERENT_PARAMETERSERROR_SETTING_FIPS_MODEEXPECTING_AN_HMAC_KEYEXPECTING_AN_RSA_KEYEXPECTING_A_DH_KEYEXPECTING_A_DSA_KEYEXPECTING_A_EC_KEYEXPECTING_A_POLY1305_KEYEXPECTING_A_SIPHASH_KEYGET_RAW_KEY_FAILEDILLEGAL_SCRYPT_PARAMETERSINPUT_NOT_INITIALIZEDINVALID_FIPS_MODEINVALID_IV_LENGTHINVALID_OPERATIONKEYGEN_FAILUREMEMORY_LIMIT_EXCEEDEDMESSAGE_DIGEST_IS_NULLMETHOD_NOT_SUPPORTEDNOT_XOF_OR_INVALID_LENGTHNO_CIPHER_SETNO_KEY_SETNO_OPERATION_SETONLY_ONESHOT_SUPPORTEDOPERATON_NOT_INITIALIZEDOUTPUT_WOULD_OVERFLOWPARTIALLY_OVERLAPPINGPBKDF2_ERRORPRIVATE_KEY_DECODE_ERRORPRIVATE_KEY_ENCODE_ERRORPUBLIC_KEY_NOT_RSAUNKNOWN_DIGESTUNKNOWN_OPTIONUNKNOWN_PBE_ALGORITHMUNSUPPORTED_ALGORITHMUNSUPPORTED_KEYLENGTHUNSUPPORTED_KEY_SIZEUNSUPPORTED_NUMBER_OF_ROUNDSUNSUPPORTED_PRFUNSUPPORTED_SALT_TYPEWRAP_MODE_NOT_ALLOWEDWRONG_FINAL_BLOCK_LENGTHXTS_DUPLICATED_KEYSMISSING_ITERATION_COUNTMISSING_MESSAGE_DIGESTMISSING_PARAMETERMISSING_PASSMISSING_SALTMISSING_SECRETMISSING_SEEDUNKNOWN_PARAMETER_TYPEVALUE_MISSINGOID_EXISTSUNKNOWN_NIDDIGEST_ERRERROR_IN_NEXTUPDATE_FIELDERROR_IN_THISUPDATE_FIELDERROR_PARSING_URLMISSING_OCSPSIGNING_USAGENEXTUPDATE_BEFORE_THISUPDATENOT_BASIC_RESPONSENO_CERTIFICATES_IN_CHAINNO_RESPONSE_DATANO_REVOKED_TIMENO_SIGNER_KEYREQUEST_NOT_SIGNEDROOT_CA_NOT_TRUSTEDSERVER_RESPONSE_ERRORSERVER_RESPONSE_PARSE_ERRORSIGNATURE_FAILURESTATUS_EXPIREDSTATUS_NOT_YET_VALIDSTATUS_TOO_OLDUNKNOWN_MESSAGE_DIGESTAMBIGUOUS_CONTENT_TYPEBAD_PASSWORD_READERROR_VERIFYING_PKCS12_MACINVALID_SCHEMEIS_NOT_ALOADER_INCOMPLETELOADING_STARTEDNOT_A_CERTIFICATENOT_A_CRLNOT_A_KEYNOT_A_NAMENOT_PARAMETERSPASSPHRASE_CALLBACK_ERRORPATH_MUST_BE_ABSOLUTEUNREGISTERED_SCHEMEUNSUPPORTED_OPERATIONUNSUPPORTED_SEARCH_TYPEURI_AUTHORITY_UNSUPPORTEDBAD_BASE64_DECODEBAD_END_LINEBAD_IV_CHARSBAD_MAGIC_NUMBERBAD_VERSION_NUMBERBIO_WRITE_FAILURECIPHER_IS_NULLERROR_CONVERTING_PRIVATE_KEYEXPECTING_PRIVATE_KEY_BLOBEXPECTING_PUBLIC_KEY_BLOBINCONSISTENT_HEADERKEYBLOB_HEADER_PARSE_ERRORKEYBLOB_TOO_SHORTMISSING_DEK_IVNOT_DEK_INFONOT_ENCRYPTEDNOT_PROC_TYPENO_START_LINEPROBLEMS_GETTING_PASSWORDPVK_DATA_TOO_SHORTPVK_TOO_SHORTREAD_KEYSHORT_HEADERUNEXPECTED_DEK_IVUNSUPPORTED_ENCRYPTIONUNSUPPORTED_KEY_COMPONENTSCANT_PACK_STRUCTURECONTENT_TYPE_NOT_DATAENCRYPT_ERRORINVALID_NULL_ARGUMENTINVALID_NULL_PKCS12_POINTERIV_GEN_ERRORKEY_GEN_ERRORMAC_ABSENTMAC_GENERATION_ERRORMAC_SETUP_ERRORMAC_STRING_SET_ERRORMAC_VERIFY_FAILUREPKCS12_ALGOR_CIPHERINIT_ERRORPKCS12_CIPHERFINAL_ERRORPKCS12_PBE_CRYPT_ERRORUNSUPPORTED_PKCS12_MODECIPHER_NOT_INITIALIZEDCONTENT_AND_DATA_PRESENTDIGEST_FAILUREENCRYPTION_CTRL_FAILUREERROR_ADDING_RECIPIENTERROR_SETTING_CIPHERINVALID_NULL_POINTERINVALID_SIGNED_DATA_TYPENO_MATCHING_DIGEST_TYPE_FOUNDNO_SIGNATURES_ON_DATAPKCS7_ADD_SIGNATURE_ERRORPKCS7_ADD_SIGNER_ERRORPKCS7_DATASIGNSIGNING_CTRL_FAILUREUNABLE_TO_FIND_CERTIFICATEUNABLE_TO_FIND_MEM_BIOUNABLE_TO_FIND_MESSAGE_DIGESTUNKNOWN_DIGEST_TYPEUNKNOWN_OPERATIONUNSUPPORTED_CIPHER_TYPEWRONG_CONTENT_TYPEWRONG_PKCS7_TYPEADDITIONAL_INPUT_TOO_LONGALREADY_INSTANTIATEDARGUMENT_OUT_OF_RANGECANNOT_OPEN_FILEDRBG_ALREADY_INITIALIZEDDRBG_NOT_INITIALISEDENTROPY_INPUT_TOO_LONGENTROPY_OUT_OF_RANGEERROR_INITIALISING_DRBGERROR_INSTANTIATING_DRBGERROR_RETRIEVING_ENTROPYERROR_RETRIEVING_NONCEFAILED_TO_CREATE_LOCKFUNC_NOT_IMPLEMENTEDFWRITE_ERRORGENERATE_ERRORIN_ERROR_STATENOT_A_REGULAR_FILENOT_INSTANTIATEDPARENT_LOCKING_NOT_ENABLEDPARENT_STRENGTH_TOO_WEAKPRNG_NOT_SEEDEDRANDOM_POOL_OVERFLOWRANDOM_POOL_UNDERFLOWREQUEST_TOO_LARGE_FOR_DRBGRESEED_ERRORSELFTEST_FAILURETOO_LITTLE_NONCE_REQUESTEDTOO_MUCH_NONCE_REQUESTEDUNSUPPORTED_DRBG_FLAGSUNSUPPORTED_DRBG_TYPEALGORITHM_MISMATCHBAD_E_VALUEBAD_FIXED_HEADER_DECRYPTBAD_PAD_BYTE_COUNTBLOCK_TYPE_IS_NOT_01BLOCK_TYPE_IS_NOT_02DATA_GREATER_THAN_MOD_LENDATA_TOO_LARGEDATA_TOO_LARGE_FOR_KEY_SIZEDATA_TOO_LARGE_FOR_MODULUSDATA_TOO_SMALLDATA_TOO_SMALL_FOR_KEY_SIZEDIGEST_DOES_NOT_MATCHDIGEST_TOO_BIG_FOR_RSA_KEYDMP1_NOT_CONGRUENT_TO_DDMQ1_NOT_CONGRUENT_TO_DD_E_NOT_CONGRUENT_TO_1FIRST_OCTET_INVALIDINVALID_DIGEST_LENGTHINVALID_HEADERINVALID_LABELINVALID_MESSAGE_LENGTHINVALID_MGF1_MDINVALID_MULTI_PRIME_KEYINVALID_OAEP_PARAMETERSINVALID_PADDINGINVALID_PADDING_MODEINVALID_PSS_PARAMETERSINVALID_PSS_SALTLENINVALID_SALT_LENGTHINVALID_TRAILERINVALID_X931_DIGESTIQMP_NOT_INVERSE_OF_QKEY_PRIME_NUM_INVALIDKEY_SIZE_TOO_SMALLLAST_OCTET_INVALIDMGF1_DIGEST_NOT_ALLOWEDMP_R_NOT_PRIMENO_PUBLIC_EXPONENTNULL_BEFORE_BLOCK_MISSINGN_DOES_NOT_EQUAL_P_QOAEP_DECODING_ERRORPADDING_CHECK_FAILEDPKCS_DECODING_ERRORPSS_SALTLEN_TOO_SMALLRSA_OPERATIONS_NOT_SUPPORTEDSLEN_CHECK_FAILEDSLEN_RECOVERY_FAILEDSSLV3_ROLLBACK_ATTACKUNKNOWN_ALGORITHM_TYPEUNKNOWN_MASK_DIGESTUNKNOWN_PADDING_TYPEUNSUPPORTED_ENCRYPTION_TYPEUNSUPPORTED_LABEL_SOURCEUNSUPPORTED_MASK_ALGORITHMUNSUPPORTED_MASK_PARAMETERUNSUPPORTED_SIGNATURE_TYPEWRONG_SIGNATURE_LENGTHDIST_ID_TOO_LARGEID_NOT_SETUSER_ID_TOO_LARGEAPP_DATA_IN_HANDSHAKEBAD_CHANGE_CIPHER_SPECBAD_CIPHERBAD_DATABAD_DATA_RETURNED_BY_CALLBACKBAD_DECOMPRESSIONBAD_DH_VALUEBAD_EARLY_DATABAD_ECC_CERTBAD_ECPOINTBAD_EXTENSIONBAD_HANDSHAKE_LENGTHBAD_HANDSHAKE_STATEBAD_HELLO_REQUESTBAD_HRR_VERSIONBAD_KEY_SHAREBAD_KEY_UPDATEBAD_LEGACY_VERSIONBAD_PACKETBAD_PACKET_LENGTHBAD_PROTOCOL_VERSION_NUMBERBAD_PSKBAD_PSK_IDENTITYBAD_RECORD_TYPEBAD_RSA_ENCRYPTBAD_SRP_A_LENGTHBAD_SRP_PARAMETERSBAD_SRTP_MKI_VALUEBAD_SSL_FILETYPEBAD_WRITE_RETRYBINDER_DOES_NOT_VERIFYBLOCK_CIPHER_PAD_IS_WRONGCALLBACK_FAILEDCANNOT_CHANGE_CIPHERCA_DN_LENGTH_MISMATCHCA_KEY_TOO_SMALLCA_MD_TOO_WEAKCCS_RECEIVED_EARLYCERTIFICATE_VERIFY_FAILEDCERT_CB_ERRORCERT_LENGTH_MISMATCHCIPHER_CODE_WRONG_LENGTHCIPHER_OR_HASH_UNAVAILABLECLIENTHELLO_TLSEXTCOMPRESSED_LENGTH_TOO_LONGCOMPRESSION_DISABLEDCOMPRESSION_FAILURECOMPRESSION_LIBRARY_ERRORCONNECTION_TYPE_NOT_SETCONTEXT_NOT_DANE_ENABLEDCOOKIE_GEN_CALLBACK_FAILURECOOKIE_MISMATCHDANE_ALREADY_ENABLEDDANE_NOT_ENABLEDDANE_TLSA_BAD_CERTIFICATEDANE_TLSA_BAD_DATA_LENGTHDANE_TLSA_BAD_DIGEST_LENGTHDANE_TLSA_BAD_MATCHING_TYPEDANE_TLSA_BAD_PUBLIC_KEYDANE_TLSA_BAD_SELECTORDANE_TLSA_NULL_DATADATA_BETWEEN_CCS_AND_FINISHEDDATA_LENGTH_TOO_LONGDH_KEY_TOO_SMALLDIGEST_CHECK_FAILEDDTLS_MESSAGE_TOO_BIGDUPLICATE_COMPRESSION_IDECC_CERT_NOT_FOR_SIGNINGECDH_REQUIRED_FOR_SUITEB_MODEEE_KEY_TOO_SMALLENCRYPTED_LENGTH_TOO_LONGERROR_IN_RECEIVED_CIPHER_LISTEXCEEDS_MAX_FRAGMENT_SIZEEXCESSIVE_MESSAGE_SIZEEXTENSION_NOT_RECEIVEDEXTRA_DATA_IN_MESSAGEEXT_LENGTH_MISMATCHFAILED_TO_INIT_ASYNCFRAGMENTED_CLIENT_HELLOGOT_A_FIN_BEFORE_A_CCSHTTPS_PROXY_REQUESTHTTP_REQUESTILLEGAL_POINT_COMPRESSIONILLEGAL_SUITEB_DIGESTINAPPROPRIATE_FALLBACKINCONSISTENT_COMPRESSIONINCONSISTENT_EARLY_DATA_ALPNINCONSISTENT_EARLY_DATA_SNIINCONSISTENT_EXTMSINSUFFICIENT_SECURITYINVALID_ALERTINVALID_CCS_MESSAGEINVALID_CERTIFICATE_OR_ALGINVALID_COMMANDINVALID_COMPRESSION_ALGORITHMINVALID_CONFIGINVALID_CONFIGURATION_NAMEINVALID_CONTEXTINVALID_CT_VALIDATION_TYPEINVALID_KEY_UPDATE_TYPEINVALID_MAX_EARLY_DATAINVALID_NULL_CMD_NAMEINVALID_SEQUENCE_NUMBERINVALID_SERVERINFO_DATAINVALID_SESSION_IDINVALID_SRP_USERNAMEINVALID_STATUS_RESPONSEINVALID_TICKET_KEYS_LENGTHLENGTH_TOO_SHORTLIBRARY_BUGMISSING_DSA_SIGNING_CERTMISSING_ECDSA_SIGNING_CERTMISSING_FATALMISSING_RSA_CERTIFICATEMISSING_RSA_ENCRYPTING_CERTMISSING_RSA_SIGNING_CERTMISSING_SIGALGS_EXTENSIONMISSING_SIGNING_CERTMISSING_SRP_PARAMMISSING_TMP_DH_KEYMISSING_TMP_ECDH_KEYNOT_ON_RECORD_BOUNDARYNOT_REPLACING_CERTIFICATENOT_SERVERNO_APPLICATION_PROTOCOLNO_CERTIFICATES_RETURNEDNO_CERTIFICATE_ASSIGNEDNO_CERTIFICATE_SETNO_CHANGE_FOLLOWING_HRRNO_CIPHERS_AVAILABLENO_CIPHERS_SPECIFIEDNO_CIPHER_MATCHNO_CLIENT_CERT_METHODNO_COMPRESSION_SPECIFIEDNO_COOKIE_CALLBACK_SETNO_METHOD_SPECIFIEDNO_PEM_EXTENSIONSNO_PRIVATE_KEY_ASSIGNEDNO_PROTOCOLS_AVAILABLENO_REQUIRED_DIGESTNO_SHARED_CIPHERNO_SHARED_GROUPSNO_SRTP_PROFILESNO_SUITABLE_KEY_SHARENO_VALID_SCTSNO_VERIFY_COOKIE_CALLBACKNULL_SSL_CTXNULL_SSL_METHOD_PASSEDOCSP_CALLBACK_FAILUREOVERFLOW_ERRORPACKET_LENGTH_TOO_LONGPARSE_TLSEXTPATH_TOO_LONGPEM_NAME_BAD_PREFIXPEM_NAME_TOO_SHORTPIPELINE_FAILUREPRIVATE_KEY_MISMATCHPROTOCOL_IS_SHUTDOWNPSK_IDENTITY_NOT_FOUNDPSK_NO_CLIENT_CBPSK_NO_SERVER_CBREAD_BIO_NOT_SETREAD_TIMEOUT_EXPIREDRECORD_LENGTH_MISMATCHRECORD_TOO_SMALLRENEGOTIATE_EXT_TOO_LONGRENEGOTIATION_ENCODING_ERRRENEGOTIATION_MISMATCHREQUEST_PENDINGREQUEST_SENTREQUIRED_CIPHER_MISSINGSCT_VERIFICATION_FAILEDSERVERHELLO_TLSEXTSHUTDOWN_WHILE_IN_INITSIGNATURE_ALGORITHMS_ERRORSRP_A_CALCSSL3_EXT_INVALID_SERVERNAMESSL3_SESSION_ID_TOO_LONGSSLV3_ALERT_BAD_CERTIFICATESSLV3_ALERT_BAD_RECORD_MACSSLV3_ALERT_HANDSHAKE_FAILURESSLV3_ALERT_ILLEGAL_PARAMETERSSLV3_ALERT_NO_CERTIFICATESSL_HANDSHAKE_FAILURESSL_LIBRARY_HAS_NO_CIPHERSSSL_NEGATIVE_LENGTHSSL_SESSION_ID_CONFLICTSSL_SESSION_ID_HAS_BAD_LENGTHSSL_SESSION_ID_TOO_LONGSSL_SESSION_VERSION_MISMATCHSTILL_IN_INITTLSV1_ALERT_ACCESS_DENIEDTLSV1_ALERT_DECODE_ERRORTLSV1_ALERT_DECRYPTION_FAILEDTLSV1_ALERT_DECRYPT_ERRORTLSV1_ALERT_INTERNAL_ERRORTLSV1_ALERT_NO_RENEGOTIATIONTLSV1_ALERT_PROTOCOL_VERSIONTLSV1_ALERT_RECORD_OVERFLOWTLSV1_ALERT_UNKNOWN_CATLSV1_ALERT_USER_CANCELLEDTLSV1_UNRECOGNIZED_NAMETLSV1_UNSUPPORTED_EXTENSIONTLS_HEARTBEAT_PENDINGTLS_ILLEGAL_EXPORTER_LABELTOO_MANY_KEY_UPDATESTOO_MANY_WARN_ALERTSTOO_MUCH_EARLY_DATAUNEXPECTED_CCS_MESSAGEUNEXPECTED_END_OF_EARLY_DATAUNEXPECTED_MESSAGEUNEXPECTED_RECORDUNKNOWN_ALERT_TYPEUNKNOWN_CERTIFICATE_TYPEUNKNOWN_CIPHER_RETURNEDUNKNOWN_CIPHER_TYPEUNKNOWN_CMD_NAMEUNKNOWN_COMMANDUNKNOWN_KEY_EXCHANGE_TYPEUNKNOWN_PKEY_TYPEUNKNOWN_PROTOCOLUNKNOWN_SSL_VERSIONUNKNOWN_STATEUNSOLICITED_EXTENSIONUNSUPPORTED_ELLIPTIC_CURVEUNSUPPORTED_PROTOCOLUNSUPPORTED_SSL_VERSIONUNSUPPORTED_STATUS_TYPEUSE_SRTP_NOT_NEGOTIATEDVERSION_TOO_HIGHVERSION_TOO_LOWWRONG_CERTIFICATE_TYPEWRONG_CIPHER_RETURNEDWRONG_CURVEWRONG_SIGNATURE_SIZEWRONG_SIGNATURE_TYPEWRONG_SSL_VERSIONWRONG_VERSION_NUMBERX509_LIBBAD_PKCS7_TYPEBAD_TYPECANNOT_LOAD_CERTCANNOT_LOAD_KEYCOULD_NOT_SET_ENGINECOULD_NOT_SET_TIMEDETACHED_CONTENTESS_ADD_SIGNING_CERT_ERRORESS_ADD_SIGNING_CERT_V2_ERRORESS_SIGNING_CERTIFICATE_ERRORMESSAGE_IMPRINT_MISMATCHNONCE_MISMATCHNONCE_NOT_RETURNEDNO_TIME_STAMP_TOKENPKCS7_ADD_SIGNED_ATTR_ERRORPKCS7_TO_TS_TST_INFO_FAILEDPOLICY_MISMATCHRESPONSE_SETUP_ERRORTHERE_MUST_BE_ONE_SIGNERTIME_SYSCALL_ERRORTOKEN_NOT_PRESENTTOKEN_PRESENTTSA_NAME_MISMATCHTSA_UNTRUSTEDTST_INFO_SETUP_ERRORTS_DATASIGNUNACCEPTABLE_POLICYUNSUPPORTED_MD_ALGORITHMVAR_BAD_VALUEVAR_LOOKUP_FAILUREINDEX_TOO_LARGEINDEX_TOO_SMALLNO_RESULT_BUFFERPROCESSING_ERRORRESULT_TOO_LARGERESULT_TOO_SMALLSYSASSIGN_ERRORSYSDASSGN_ERRORSYSQIOW_ERRORUNKNOWN_CONTROL_COMMANDUNKNOWN_TTYGET_ERRNO_VALUEBAD_IP_ADDRESSBAD_OBJECTBN_DEC2BN_ERRORBN_TO_ASN1_INTEGER_ERRORDIRNAME_ERRORDISTPOINT_ALREADY_SETDUPLICATE_ZONE_IDERROR_CONVERTING_ZONEERROR_CREATING_EXTENSIONERROR_IN_EXTENSIONEXPECTED_A_SECTION_NAMEEXTENSION_EXISTSEXTENSION_NAME_ERROREXTENSION_NOT_FOUNDEXTENSION_VALUE_ERRORILLEGAL_EMPTY_EXTENSIONINCORRECT_POLICY_SYNTAX_TAGINVALID_ASNUMBERINVALID_ASRANGEINVALID_BOOLEAN_STRINGINVALID_EXTENSION_STRINGINVALID_INHERITANCEINVALID_IPADDRESSINVALID_MULTIPLE_RDNSINVALID_NAMEINVALID_NULL_NAMEINVALID_NULL_VALUEINVALID_NUMBERSINVALID_OBJECT_IDENTIFIERINVALID_OPTIONINVALID_POLICY_IDENTIFIERINVALID_PROXY_POLICY_SETTINGINVALID_PURPOSEINVALID_SAFIINVALID_SECTIONINVALID_SYNTAXISSUER_DECODE_ERRORNEED_ORGANIZATION_AND_NUMBERSNO_CONFIG_DATABASENO_ISSUER_CERTIFICATENO_ISSUER_DETAILSNO_POLICY_IDENTIFIERNO_SUBJECT_DETAILSOPERATION_NOT_DEFINEDOTHERNAME_ERRORPOLICY_PATH_LENGTHUNABLE_TO_GET_ISSUER_DETAILSUNABLE_TO_GET_ISSUER_KEYIDUNKNOWN_BIT_STRING_ARGUMENTUNKNOWN_EXTENSIONUNKNOWN_EXTENSION_NAMEUNSUPPORTED_OPTIONUSER_TOO_LONGAKID_MISMATCHBAD_X509_FILETYPECANT_CHECK_DH_KEYCERT_ALREADY_IN_HASH_TABLECRL_ALREADY_DELTACRL_VERIFY_FAILUREIDP_MISMATCHINVALID_ATTRIBUTESINVALID_DIRECTORYINVALID_FIELD_NAMEINVALID_TRUSTISSUER_MISMATCHKEY_TYPE_MISMATCHKEY_VALUES_MISMATCHLOADING_CERT_DIRLOADING_DEFAULTSNAME_TOO_LONGNEWER_CRL_NOT_NEWERNO_CERTIFICATE_FOUNDNO_CERTIFICATE_OR_CRL_FOUNDNO_CERT_SET_FOR_US_TO_VERIFYNO_CRL_FOUNDNO_CRL_NUMBERPUBLIC_KEY_DECODE_ERRORPUBLIC_KEY_ENCODE_ERRORSHOULD_RETRYUNKNOWN_KEY_TYPEUNKNOWN_PURPOSE_IDUNKNOWN_TRUST_IDWRONG_LOOKUP_TYPEWRONG_TYPEssl.SSLError_ssl_ssl._SSLSocketverify_messageverify_codelibraryreason_ssl._SSLContext_ssl.MemoryBIO_ssl.SessionThe NPN extension requires OpenSSL 1.0.1 or later./builddir/build/BUILD/Python-3.8.17/Modules/_ssl.cinvalid return value from SSL_CTX_get_verify_modeSSLContext is not a server context.integer argument expected, got floatsni_callback cannot be set on TLS_CLIENT contextThe value must be a SSLContextHostname mismatch, certificate is not valid for '%S'.IP address mismatch, certificate is not valid for '%S'.Can't malloc memory for keylog file# TLS secrets log file, generated by OpenSSL / Python
The context's protocol doesn't support modification of highest and lowest version.Unsupported protocol version 0x%x'%s' channel binding type not implementedCannot set verify_mode to CERT_NONE when check_hostname is enabled.protocols longer than %u bytespassword cannot be longer than %d bytesunable to allocate password bufferunknown elliptic curve name %Rinvalid or unsupported protocol versionSession refers to a different SSLContext.Cannot set session for server-side SSLSocket.Cannot set session after handshake.cannot write() after write_eof()no start line: cadata does not contain a certificatenot enough data: cadata does not contain a certificatecafile, capath and cadata cannot be all omittedcafile should be a valid filesystem pathcapath should be a valid filesystem pathcadata should be a contiguous buffer with a single dimensioncadata should be an ASCII string or a bytes-like objectThe operation did not complete (X509 lookup)TLS/SSL connection has been closed (EOF)The operation did not complete (read)The operation did not complete (write)The operation did not complete (connect)EOF occurred in violation of protocolA failure in the SSL library occurredUnderlying socket connection goneUnderlying socket too large for select()._ssl.c:1114: The handshake operation timed out_ssl.c:1118: Underlying socket has been closed._ssl.c:1122: Underlying socket too large for select()._ssl._SSLSocket.read requires 1 to 2 argumentsmaximum length can't fit in a C 'int'Underlying socket has been closed.Can't malloc memory to read fileError decoding PEM-encoded filecertfile should be a valid filesystem pathkeyfile should be a valid filesystem pathpassword should be a string or callableserver_hostname cannot be an empty string or start with a leading dot.password callback must return a stringALL:!COMPLEMENTOFDEFAULT:!eNULLALERT_DESCRIPTION_CLOSE_NOTIFYALERT_DESCRIPTION_UNEXPECTED_MESSAGEALERT_DESCRIPTION_BAD_RECORD_MACALERT_DESCRIPTION_RECORD_OVERFLOWALERT_DESCRIPTION_DECOMPRESSION_FAILUREALERT_DESCRIPTION_HANDSHAKE_FAILUREALERT_DESCRIPTION_BAD_CERTIFICATEALERT_DESCRIPTION_UNSUPPORTED_CERTIFICATEALERT_DESCRIPTION_CERTIFICATE_REVOKEDALERT_DESCRIPTION_CERTIFICATE_EXPIREDALERT_DESCRIPTION_CERTIFICATE_UNKNOWNALERT_DESCRIPTION_ILLEGAL_PARAMETERALERT_DESCRIPTION_ACCESS_DENIEDALERT_DESCRIPTION_DECODE_ERRORALERT_DESCRIPTION_DECRYPT_ERRORALERT_DESCRIPTION_PROTOCOL_VERSIONALERT_DESCRIPTION_INSUFFICIENT_SECURITYALERT_DESCRIPTION_INTERNAL_ERRORALERT_DESCRIPTION_USER_CANCELLEDALERT_DESCRIPTION_NO_RENEGOTIATIONALERT_DESCRIPTION_UNSUPPORTED_EXTENSIONALERT_DESCRIPTION_CERTIFICATE_UNOBTAINABLEALERT_DESCRIPTION_UNRECOGNIZED_NAMEALERT_DESCRIPTION_BAD_CERTIFICATE_STATUS_RESPONSEALERT_DESCRIPTION_BAD_CERTIFICATE_HASH_VALUEALERT_DESCRIPTION_UNKNOWN_PSK_IDENTITYHOSTFLAG_MULTI_LABEL_WILDCARDSHOSTFLAG_SINGLE_LABEL_SUBDOMAINSCIPHER_HAS_NO_OBJECT_IDENTIFIERDIGEST_AND_KEY_TYPE_NOT_SUPPORTEDILLEGAL_OPTIONS_ON_ITEM_TEMPLATEINVALID_UNIVERSALSTRING_LENGTHTHE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MDUNIVERSALSTRING_IS_WRONG_LENGTHUNKNOWN_MESSAGE_DIGEST_ALGORITHMUNSUPPORTED_ANY_DEFINED_BY_TYPEGETHOSTBYNAME_ADDR_IS_NOT_AF_INETNO_ACCEPT_ADDR_OR_SERVICE_SPECIFIEDNO_HOSTNAME_OR_SERVICE_SPECIFIEDCIPHER_PARAMETER_INITIALISATION_ERRORCONTENT_TYPE_NOT_COMPRESSED_DATACONTENT_TYPE_NOT_ENVELOPED_DATAERROR_READING_MESSAGEDIGEST_ATTRIBUTEINVALID_KEY_ENCRYPTION_PARAMETERMESSAGEDIGEST_ATTRIBUTE_WRONG_LENGTHMSGSIGDIGEST_VERIFICATION_FAILUREPRIVATE_KEY_DOES_NOT_MATCH_CERTIFICATEUNSUPPORTED_COMPRESSION_ALGORITHMUNSUPPORTED_CONTENT_ENCRYPTION_ALGORITHMUNSUPPORTED_KEY_ENCRYPTION_ALGORITHMUNSUPPORTED_RECIPIENTINFO_TYPENO_CONF_OR_ENVIRONMENT_VARIABLECURVE_DOES_NOT_SUPPORT_SIGNINGPOINT_COORDINATES_BLIND_FAILURERANDOM_NUMBER_GENERATION_FAILEDUNIMPLEMENTED_PUBLIC_KEY_METHODCTRL_OPERATION_NOT_IMPLEMENTEDDATA_NOT_MULTIPLE_OF_BLOCK_LENGTHOPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPEPKEY_APPLICATION_ASN1_METHOD_ALREADY_REGISTEREDUNSUPPORTED_KEY_DERIVATION_FUNCTIONUNSUPPORTED_PRIVATE_KEY_ALGORITHMRESPONSE_CONTAINS_NO_REVOCATION_DATAUNSUPPORTED_REQUESTORNAME_TYPEFINGERPRINT_SIZE_DOES_NOT_MATCH_DIGESTSEARCH_ONLY_SUPPORTED_FOR_DIRECTORIESUI_PROCESS_INTERRUPTED_OR_CANCELLEDERROR_SETTING_ENCRYPTED_DATA_TYPEENCRYPTION_NOT_SUPPORTED_FOR_THIS_KEY_TYPENO_RECIPIENT_MATCHES_CERTIFICATEOPERATION_NOT_SUPPORTED_ON_THIS_TYPESIGNING_NOT_SUPPORTED_FOR_THIS_KEY_TYPEERROR_ENTROPY_POOL_WAS_IGNOREDERROR_RETRIEVING_ADDITIONAL_INPUTNO_DRBG_IMPLEMENTATION_SELECTEDPERSONALISATION_STRING_TOO_LONGPREDICTION_RESISTANCE_NOT_SUPPORTEDILLEGAL_OR_UNSUPPORTED_PADDING_MODEMP_COEFFICIENT_NOT_INVERSE_OF_RMP_EXPONENT_NOT_CONGRUENT_TO_DN_DOES_NOT_EQUAL_PRODUCT_OF_PRIMESAPPLICATION_DATA_AFTER_CLOSE_NOTIFYATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXTAT_LEAST_TLS_1_0_NEEDED_IN_FIPS_MODEAT_LEAST_TLS_1_2_NEEDED_IN_SUITEB_MODEBAD_SRTP_PROTECTION_PROFILE_LISTCIPHERSUITE_DIGEST_HAS_CHANGEDCOMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGECUSTOM_EXT_HANDLER_ALREADY_INSTALLEDDANE_CANNOT_OVERRIDE_MTYPE_FULLDANE_TLSA_BAD_CERTIFICATE_USAGEDECRYPTION_FAILED_OR_BAD_RECORD_MACDH_PUBLIC_VALUE_LENGTH_IS_WRONGEMPTY_SRTP_PROTECTION_PROFILE_LISTERROR_SETTING_TLSA_BASE_DOMAINMISSING_PSK_KEX_MODES_EXTENSIONMISSING_SUPPORTED_GROUPS_EXTENSIONMIXED_HANDSHAKE_AND_NON_HANDSHAKE_DATANO_GOST_CERTIFICATE_SENT_BY_PEERNO_SHARED_SIGNATURE_ALGORITHMSNO_SUITABLE_SIGNATURE_ALGORITHMOLD_SESSION_CIPHER_NOT_RETURNEDOLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNEDPEER_DID_NOT_RETURN_A_CERTIFICATEPOST_HANDSHAKE_AUTH_ENCODING_ERRREQUIRED_COMPRESSION_ALGORITHM_MISSINGSCSV_RECEIVED_WHEN_RENEGOTIATINGSESSION_ID_CONTEXT_UNINITIALIZEDSIGNATURE_FOR_NON_SIGNING_CERTIFICATESRTP_COULD_NOT_ALLOCATE_PROFILESSRTP_PROTECTION_PROFILE_LIST_TOO_LONGSRTP_UNKNOWN_PROTECTION_PROFILESSL3_EXT_INVALID_MAX_FRAGMENT_LENGTHSSL3_EXT_INVALID_SERVERNAME_TYPESSLV3_ALERT_CERTIFICATE_EXPIREDSSLV3_ALERT_CERTIFICATE_REVOKEDSSLV3_ALERT_CERTIFICATE_UNKNOWNSSLV3_ALERT_DECOMPRESSION_FAILURESSLV3_ALERT_UNEXPECTED_MESSAGESSLV3_ALERT_UNSUPPORTED_CERTIFICATESSL_CTX_HAS_NO_DEFAULT_SSL_VERSIONSSL_SESSION_ID_CALLBACK_FAILEDSSL_SESSION_ID_CONTEXT_TOO_LONGTLSV13_ALERT_CERTIFICATE_REQUIREDTLSV13_ALERT_MISSING_EXTENSIONTLSV1_ALERT_EXPORT_RESTRICTIONTLSV1_ALERT_INAPPROPRIATE_FALLBACKTLSV1_ALERT_INSUFFICIENT_SECURITYTLSV1_BAD_CERTIFICATE_HASH_VALUETLSV1_BAD_CERTIFICATE_STATUS_RESPONSETLSV1_CERTIFICATE_UNOBTAINABLETLS_HEARTBEAT_PEER_DOESNT_ACCEPTTLS_INVALID_ECPOINTFORMAT_LISTUNABLE_TO_FIND_ECDH_PARAMETERSUNABLE_TO_FIND_PUBLIC_KEY_PARAMETERSUNABLE_TO_LOAD_SSL3_MD5_ROUTINESUNABLE_TO_LOAD_SSL3_SHA1_ROUTINESUNSAFE_LEGACY_RENEGOTIATION_DISABLEDX509_VERIFICATION_SETUP_PROBLEMSINVALID_SIGNER_CERTIFICATE_PURPOSECOMMON_OK_AND_CANCEL_CHARACTERSUSER_DATA_DUPLICATION_UNSUPPORTEDEXTENSION_SETTING_NOT_SUPPORTEDNO_PROXY_CERT_POLICY_LANGUAGE_DEFINEDPOLICY_LANGUAGE_ALREADY_DEFINEDPOLICY_PATH_LENGTH_ALREADY_DEFINEDPOLICY_WHEN_PROXY_LANGUAGE_REQUIRES_NO_POLICYUNABLE_TO_FIND_PARAMETERS_IN_CHAINUNABLE_TO_GET_CERTS_PUBLIC_KEY/���.���.��/��L/��L/��L/��L/��L/��L/��L/��L/��L/��L/��(/��:/���9���9���;��K9���;���9���:��J:��-N��uM���M��yN���M��]M��LM��An error occurred in the SSL implementation.Was the client session reused during handshake?_setter_session(session)
Get / set SSLSession.The Python-level owner of this object.Passed as "self" in servername callback.The currently set server hostname (for SNI).Whether this is a server-side socket._setter_context(ctx)
This changes the context associated with the SSLSocket. This is typically
used from within a callback function set by the sni_callback
on the SSLContext to change the certificate information associated with the
SSLSocket before the cryptographic exchange handshake messages
verify_client_post_handshake($self, /)
--

Initiate TLS 1.3 post-handshake authenticationshutdown($self, /)
--

Does the SSL shutdown handshake with the remote end.compression($self, /)
--

selected_alpn_protocol($self, /)
--

version($self, /)
--

shared_ciphers($self, /)
--

cipher($self, /)
--

get_channel_binding($self, /, cb_type='tls-unique')
--

Get channel binding data for current connection.

Raise ValueError if the requested `cb_type` is not supported.  Return bytes
of the data or None if the data is not available (e.g. before the handshake).
Only 'tls-unique' channel binding data from RFC 5929 is supported.getpeercert($self, der=False, /)
--

Returns the certificate for the peer.

If no certificate was provided, returns None.  If a certificate was
provided, but not validated, returns an empty dictionary.  Otherwise
returns a dict containing information about the peer certificate.

If the optional argument is True, returns a DER-encoded copy of the
peer certificate, or None if no certificate was provided.  This will
return the certificate even if it wasn't validated.pending($self, /)
--

Returns the number of already decrypted bytes available for read, pending on the connection.read(size, [buffer])
Read up to size bytes from the SSL socket.write($self, b, /)
--

Writes the bytes-like object b into the SSL object.

Returns the number of bytes written.do_handshake($self, /)
--

Control the number of TLSv1.3 session ticketsSet a callback that will be called when a server name is provided by the SSL/TLS client in the SNI extension.

If the argument is None then the callback is disabled. The method is called
with the SSLSocket, the server name as a string, and the SSLContext object.
See RFC 6066 for details of the SNI extension.get_ciphers($self, /)
--

get_ca_certs($self, /, binary_form=False)
--

Returns a list of dicts with information of loaded CA certs.

If the optional argument is True, returns a DER-encoded copy of the CA
certificate.

NOTE: Certificates in a capath directory aren't loaded unless they have
been used at least once.cert_store_stats($self, /)
--

Returns quantities of loaded X.509 certificates.

X.509 certificates with a CA extension and certificate revocation lists
inside the context's cert store.

NOTE: Certificates in a capath directory aren't loaded unless they have
been used at least once.set_ecdh_curve($self, name, /)
--

set_default_verify_paths($self, /)
--

session_stats($self, /)
--

load_verify_locations($self, /, cafile=None, capath=None, cadata=None)
--

load_dh_params($self, path, /)
--

load_cert_chain($self, /, certfile, keyfile=None, password=None)
--

_set_npn_protocols($self, protos, /)
--

_set_alpn_protocols($self, protos, /)
--

set_ciphers($self, cipherlist, /)
--

_wrap_bio($self, /, incoming, outgoing, server_side,
          server_hostname=None, *, owner=None, session=None)
--

_wrap_socket($self, /, sock, server_side, server_hostname=None, *,
             owner=None, session=None)
--

Whether the memory BIO is at EOF.The number of bytes pending in the memory BIO.write_eof($self, /)
--

Write an EOF marker to the memory BIO.

When all data has been read, the "eof" property will be True.write($self, b, /)
--

Writes the bytes b into the memory BIO.

Returns the number of bytes written.read($self, size=-1, /)
--

Read up to size bytes from the memory BIO.

If size is not specified, read the entire buffer.
If the return value is an empty bytes instance, this means either
EOF or that no data is available. Use the "eof" property to
distinguish between the two.Session timeout (delta in seconds).Session creation time (seconds since epoch).Ticket life time hint.Session idDoes the session contain a ticket?nid2obj($module, nid, /)
--

Lookup NID, short name, long name and OID of an ASN1_OBJECT by NID.txt2obj($module, /, txt, name=False)
--

Lookup NID, short name, long name and OID of an ASN1_OBJECT.

By default objects are looked up by OID. With name=True short and
long name are also matched.get_default_verify_paths($module, /)
--

Return search paths and environment vars that are used by SSLContext's set_default_verify_paths() to load default CAs.

The values are 'cert_file_env', 'cert_file', 'cert_dir_env', 'cert_dir'.RAND_status($module, /)
--

Returns 1 if the OpenSSL PRNG has been seeded with enough data and 0 if not.

It is necessary to seed the PRNG with RAND_add() on some platforms before
using the ssl() function.RAND_pseudo_bytes($module, n, /)
--

Generate n pseudo-random bytes.

Return a pair (bytes, is_cryptographic).  is_cryptographic is True
if the bytes generated are cryptographically strong.RAND_bytes($module, n, /)
--

Generate n cryptographically strong pseudo-random bytes.RAND_add($module, string, entropy, /)
--

Mix string into the OpenSSL PRNG state.

entropy (a float) is a lower bound on the entropy contained in
string.  See RFC 4086._test_decode_cert($module, path, /)
--

Implementation module for SSL socket operations.  See the socket module
for documentation.SSL/TLS connection terminated abruptly.System error when attempting SSL operation.Non-blocking SSL socket needs to write more data
before the requested operation can be completed.Non-blocking SSL socket needs to read more data
before the requested operation can be completed.SSL/TLS session closed cleanly.A certificate could not be verified.�;�{�������(��@��T�h�|(����������(�<�P3�do�����1������$�<*�TA�l���������������� ��4��P��h'��%���������� ��H�t?��i������������$	l�D	��\	���	��p
�
F�
��
�����
��O���4����PX���x2�����������r���$����LB���t�����5����u���@
����
5���
������$W��D���\	��|\���u�������;��$	��8q	��`�	���~
���2���u��,�
��x���I���$��-��|����)���$������D��������$��`,&���;*���a+��(�+��H�+��`r-���`1��=3��\�5���B6����8��X�<���O@���8A�� TB��X�C����C���kD���E��,I��p+M���yO��,zQ����R����S����U��V��,�V��X���zRx�$x���0FJw�?:*3$"D��� \���p�����������4����WF�D�D �
ABBAAB4����@F�D�D �_
ABBJAB���0���D���
X���l���'����<E�v����EF(�����E�K�D��AA@�e��F�G�B �D(�A0�D��0A(A BBB$��"E�T@��EJX��EJp��EJ���LH C��*Ed0��F�A�A �D0 AAB$����L�A�D �AA��
(��
<��P��(E�^l��EJ���*Ed,����B�A�A �D@� AAB(�m�xF�D�A �iAB���#YI(��4B�A�A �lAB$<���A�A�D0�AA(do�VF^
EF
EF
EV���*EX���*EX���vE�Q ^A��ER��EJ,��F�E�N �D0v AAB@���E�Q �A` �EJxx�VF�B�B �B(�A0�D8�E@V
8M0A(B BBBE�
8D0A(B BBBEA8A0A(B BBB�����B�G�B �B(�A0�A8�J�$�P�I�I�I�B�A�B�A�B�H�O�H�O�D�A�H�G�\�_8A0A(B BBB�Y�KH���*[K���]E�W4����B�A�A �}
CBEZAB��cE�K
EM0��`E�H
EMP�7E�m$l.��E�A�A �AAH����F�B�B �G(�D0�A8�D@�8D0A(B BBB$�f��E�A�D �CA��8E�j$��kE�a$@F�>E�I�A gDA$h\��E�D�D �AAT���HF�E�E �B(�D0�A8�GP�XK`KhBpLPw8D0A(B BBB$����A�I�A �AAH	9�@B�D�J �B(�A0�A8�A@8D0A(B BBB`\	-�sB�E�E �B(�A0�A8�D`>
8D0A(B BBBED8A0A(B BBB8�	<�MF�B�A �F(�D03(A ABB$�	M����E�D�D |AA$
����;E�u@
���[Y�x
AD�`
���dH0[x
W���NE�
AD0�
����SB�K�C �J04 AAB�
�����
����<�
�����E�J�I�v�R�E�B�I�=AA4����E�G �A$T��MA�A�A GAA|	����E�Q oA�p����E�Q nAL�����F�B�B �E(�D0�C8�C@bHNP`8A0A(B BBB8:���CF�L�A �D(�F�(A ABBHHA���UF�B�A �A(�B0�
(J DDIEt(C ABBH�J���GB�E�E �E(�A0�A8�B@$8D0A(B BBB$�E���8A�E�D iCA,
U����F�D�D �I0� AAB\8
���	F�E�B �B(�K0�D8�B@�
8F0C(B BBBEP8D0A(B BBB$�
�����E�A�Q0�AA8�
E��8M�B�A �D(�D0(D ABB(�
A���F�H�A ��AB(��{A�D tA@H�C���B�G�B �D(�H0�G�a
0A(A BBBA zRx�������(���H����YB�B�B �B(�A0�A8�Dp@8A0A(B BBBh����
B�B�B �B(�A0�A8�G� I�!��!M�!K�!N�!W�!Z�!M�!�8A0A(B BBBL|2���F�H�B �A(�D0�D@sHRPEXB`I@0A(A BBB8�t��F�B�A �D(�A0�(D ABB8G��&F�L�D �A(�F�(A ABBD1��+EU
EKd<��.EhH|R���B�B�B �B(�A0�A8�DP�8D0A(B BBB\�����F�H�E �E(�A0�A8�G�u�S�D�B�I�k8A0A(B BBBL(L���B�B�E �D(�H0��
(D BBBE�(C BBBHx���}F�B�B �B(�A0�A8�G`Z8D0A(B BBBH�
 ���F�B�L �A(�D0�N
(F BBBED(A BBB`F ��`F�B�B �B(�A0�A8�GP�
8L0A(B BBBE`8A0A(B BBBHtB"��CF�J�B �B(�D0�A8�G�8A0A(B BBBH�9&��jF�I�B �B(�D0�D8�I�;8A0A(B BBB,W)���F�D�D �G0� AAB4<*��J�E�A �A(�F@�(A ABB0t�*��WF�D�D �G0= AAB�,��8YU
AD(�/,���F�A�A �|AB4��,���F�B�A �A(�A0�(D ABB\,-��F�H�E �B(�A0�A8�G�r�V�D�B�I��8A0A(B BBBH��0���B�E�E �E(�D0�D8�D`�8D0A(B BBBl�g4��NF�E�B �B(�A0�A8�G�v�[�B�B�I�^�G�S�A�T8A0A(B BBBlHE6��F�B�E �B(�A0�D8�G�s�[�B�B�I��K�Y�A�W8A0A(B BBB8��7��0F�B�A �A(�D0(D ABB8��8��7F�E�D �A(�E0(A ABBH0�<��[F�E�A �A(�G`]hZpJxB�I`�
(A ABBAzRx�`���� $Y9���Jh]pBxB�I`8�T=���
F�I�B �A(�A0�q
(D BBB zRx�0�����(�:��[GNU���@�S"��;���ġСסޡ�������P�\�l���P�\�l��Uft���
���R"�R"���o`  �
� V"0p��:��	���o���o:���o�o�7���o2T"�������� �0�@�P�`�p������������������� �0�@�P�`�p������������������� �0�@�P�`�p������������������� �0�@�P�`�p������������������� �0�@�P�`�p������������������� �0�@�P�`�p������������������� �0�@�P�`�p������������������� �0�@�P�`�p������������������� �0�@�P�`�p���������������� �0�@�P�`�p���������������� �0�@�P�`�p���������������� �0�@�P�`�p���������������� �0�@�P�`�p���������������� �0�@�P�`�p���������������� �0�@�P�`�p���������������� �0�@�P�`�p���������������� �0�@�P�`�p���������������� �0�@�P�`�p�������������H�@�'`P�� \�L�l���'��eiB@r�=���c��%j ��e����b`��m�����3� ���p���#q���1����1�ß<1Pϟ}`؟�X�����6�@���3 �U�30�((/@�u0N���#[����g�>Uo��s��3��m>��87��|��!Q�kz� !�{5� G�r8� ӓ�` ��Yr� ��d=����Z�`ŠlS0Ӡ�X��<����7���Q�`��q@��&`"+�� "��o��#�{W #%�1�"/��`%���H%:�j0%O�S%T�<�$\�xn�*�q�*n�/#�)y��"�(���(���9'ԙ�� &���~�%�
W�3
� ��"�.&�)6�+�:�2b�4�
��%M�`�+2�*V�&8�<�-A�0F�4d�J�o�'N�,Y�	]�#d�!j�$�o�5�s��/w�(z�����"��
���
���
���
dɢ
fۢ
��
��
i	�
j!�
k`�
l2�
�J�
mk�
nX�
���
��
pg�
�z�
���
r��
s��
tգ
w�
x�
y�
z-�
{=�
�V�
�f�
|y�
���
���
���
���
�Ф
��
}�
��
��
~��
�+�
�;�
N�
�a�
�v�
���
���
�ǥ
��
�z�
��
���
��
�&�
�@�
�R�
��
�m�
���
���
���
���
���
�ɦ
�զ
��
���
��
�!�
�4�
�D�
�ʨ
�W�
���
�g�
��
���
���
�ç
�ا
��
��
��
�5�
�N�
�k�
�v�
���
���
���
��
�Ũ
���
���
���
�ۨ
��
��
�(
��
�H
�!�
�5�
�M�
�i�
�p
�u�
���
���
���
�ȩ
��
�ީ3e�3f�3i�3g&� d3� �P� �j� ey� |3� g� k�� ��� ��� �ƪ }ת �� {�� f� ��� �� �.� n� �� �A� qQ� �k� s^� ut� v�� ��� w�� �ʫ �ޫ �� x� �� �*� y=� �Y� ~p� z{�d��e��r��v��fϬg2�h۬i��n��j
�s�w&�oQ�k3�l>�tJ�u`�po�q��m��.c��.���.�̭.��.d��.e.f�.g.�.h6�.�Q�.ic�.�0.jX.ky�.l��.m��.n��.oG�.p��.qx.rϮ.s�.t��.u�.��.v-�.w�.x?�.yZ�.��.�m�.���.���.�k�.z��.{��.�Ư.|د.��.}�.~�.��.���.��.��.��.�,�.�?�.�U�.�k�.�{�.���.���.���.���.�.�°.�װ.��.��.��.�%�.�6�.�j�.�O�.�f�.�~�.���.���.���.�ٱ.�@.�h.��.���.��.��.��.���.�2�.�?�.�N�.�4�.�c�)cv�)d��)e��n��s²d߲e�p�m$�f3�i�j;�kQ�r�l�yF�ob�u|�v��w��x³g߳q�t�h%�e=�fO�gd�2lx�2d��2m��2n��2oѴ2p�2q��2t�2h�2k-�2i>�2rR�2j^�2sv�2e��2fb�2g��e��mD�jƵsܵt�z�{�|5�uG�v^�wk�hp�n��r��f��p��lͶ}ܶg�x�k�d(�iA�oP�qb�y|�
f��
lD�
mk�
h��
j��
p��
e·
oܶ
g�
k(�
id�
qַ
n�%d�%n�%q��%r�%e*�%f8�%s��%gN�%mf�%or�%h~�%p��%i��%j��%kc�%l��sø�Ѹ�!�d�������(�uk��C�vX�wu�������x��yιeƪp�n��m��"�����1�fB�gP�h]�z��tq����������{ƺ�������޺���������|·}%��;����~Q�o����L��d��A��z������j ���k@�P��ֻl�q������#�r1��C��Z����&df�&��&���&���&���&gӼ&w�&h��&�
�&� �&f;�&iQ�&�f�&���&�*�&j��&l�&m��&nƪ&�½&�ӽ&��&���&���&u�&p�&x'�&�0�&}A�&�N�&t]�&�r�&�`&e��&�������ʾd־�!������z��,��7������k�rL�e`��z��u����������˿�߿�����%��#��6����P�o"��f��x������������x������������g����������� ��1����H��a��w��������������j���������y��u�k)�{(|?�lT��q�}Pv��~�����m���"�4d��4mڴ4h��4i	�4e�4n(�4o5�4kD�4jQ�4g:�4lh�4fv�f��e�'e��'f��'z��'{��'y��'g��'|�'h(�'iA�'lR�'mb�'�'np�'�x'o��'p��'r��'s��'u�'v��'}��'~��'�'w��'x�'�%�,k<�,sN�,q�,yi�,jx�,p��,t��,u��,d��,e��,f��,g��,h��,r��,l�,w,m�,i�,n'�,v=�,xU�,oo�	dʾ	e��	f��	g��	t<�	h��	u��	v��	��	s��	w�	x-�	�2�	yF�	za�	{s�	���	i��	j��	k��	l��	m��	|��	}��	o��	p
�	�u�	q�	r3�	~��	nN�#db�#yk�#e�#fx�#g8#x��#h��#i��#j��#k��#l��#m��#n�#o�#q��#r+�#sI�#tb�#u��#vy�#w�!u`�!���!t��!v��!�G�!w��!e��!�`!���!x��!y�!�)�!��!z��!�B�!��!s`�!{��!��!hv�!|��!���!�!��!i�!���!��!��!���!j��!k��!l�!m/�!nA�!o�!pY�!ql�!r}�$f��$g��$i��$y��$���$h�$j�$|$-�$kE�$l($m^�$nw�$o��$~��$e��${��$pa�$q��$r��$z��$sP$��$�#�$�p$t�$�<�$dL�$}a�$�w�$u��$v��$w��$���$���$���$x�d$�e0�fI�gøh\�jq�k��l��m��n�����o��z����'�pB�|Z�}r�{�����"����������������������'��7��L��c��w����������~�����x�����·�ܶi�����(��;�q �U�j�y��~�r������;��d������������s�t�u��.��B�vW��s�����������h����w��5dø5e!�5k��5n�5p�5o�5l"�5f��5g1�5hB�5i�5m�5jH##�dp����9�gP��[��d�j��k��f^�o�����0��2��n��L����i�"�l0�z?�$��R��]�so�t�����r�����wø{��[��s��`�a��|A�����8��3����M��]�mr����������������y���������,��?��Z�Wo��83��������������4`�������� ����:��T��p�����������������)���������(�N=�5V�>o�v���	b������8	����������4��H��]��u�������������|��u��T
��*��F�hY��o��}��������U����q���/�xG��^��t����������e��H��E`���������F����5�}P���"X	6^��v�������p�����fx	������7�	%��+�!E�P��h����������������������K��-��	JD��X��j�����S�S��D�������	x��g��e
v�������*��A�&0
�P
XW��f��}�����
�����������
�� ��������"��3��D�8Y��p�*��O��P��Q��������
V�
Y��� ,��C�hH�^�ipj�k�l��i�?@��,�����0Pp���������b�u|�}
�,��B��]�t��~���(
-q�.H
��/��������yh
\�
U�����;��
$�
>�
/U�8p�L��.�������B ZHYpW��X�V�m,�nB�o��]��r������:�� �H������������������ ��8��L��]���pm��������������pR���@��;���*�IB�qZ��k��{�����z����	��r��
����
�/��/�&�/�7�/��/dG�/\�/so�/���/t��/���/e�/f�/u��/g��/h��/i�/j�/kv�/v&�/wB�/�^�/l/xn�/y��/m��/n��/z��/���/���/o��/p��/{�/|�/}$�/~b�/q=�/�K�/�Y�/r�(h^�(fn�(g~�(i��(k��(d��(e��(m��(n��(o��(j�(l(p#�"v2�"w=�"dM�"ef�"�t�"���"���"���"���"���"���"��"s�"f0"g0�"tF�"�^�"�z�"���"���"h��"i��"���"���"��"j��"k�"l&�"m��"�9�"�I�"nc�"�r�"���"���"���"���"���"���"~�"|��"��"�*�"y@�"R�"�P"���"rg�"}z�"���"�x"���"��"��"���"���"z��"{��"o�"��"��"x0�"u��"�C�"�Q�n���_�dd�vq�r��e�������������q��w�{��&�s8�tL�g]�h�|n��|����������i��������}�~)�j�kl6�u��mG�yZ�x�ok�p}�z��h��"08�FL��+��������i" S"ԙ�S"��S"Q���`G'h�! a"`"�S"��PS"�`S"��@S"������������X'D�r& e"�b"1?�� �g"g"�� �#@\!�h"GA$3a1����GA$3a1����_ssl.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug�3�7zXZ�ִF!t/��#��]?�E�h=��ڊ�2N��#~��-�����:�	���}T���#݉�d�0ٲ�Vnˮ�����_&R�`v�#���fj�� �~f�¾Y�N9�k�Sd���?Z�P�9�����X�pP�z�������*�c8�!���-�
|~L��b�����l��YTlO/����k:(�7R��������5�M5�]�f��9 z�ʰ��:��Y��-�(��?�-��EkS$�|Ʃ繦j1G���:(S��l�֝��@a��t4E%��$_�0�"f�e�8�6��=y~��!?�:jE����q��e`����u�(�Q����m��=��'e�N�������E�r��y��_��E���y,]���壀�o4:��H��#�ߨQDPw�)!����F�N�
����|?z��$��Ԕ�}K@!��B��HFv��˻�#��-e;ڹ
�X����=�����!~��&������/��q�}�y��$+7�tVqš��uL�W4{���ƻ���?��N:�5�J�(Ֆ�<q��_�$�#V*<p��VЀp��u�J�d�I�_|xHW��\�J
�`F�@>�dϿ�k��s*µuZE(�J�e>�e� ��(���-�@��W��:����˸ErP��/���O����U[ZÐyC��Ga�
S���B��v���j�C-	�&i6+Ѳ;Jls�nc:�=0��F�P>��R꾋v�R��ޜ���?$"�;U�FhՌ�_U��- �#w�q�ˏ14���^K�'N��V�{��o<��n�/�^�A'�w��PR'��9�`k��Zs����7_׊/թ3E�Z#io����8���Lj��������1AW�J���C!8w��JbTf���K}�C=��Eֶ����Gz�cݮ%���O���Gt��z���t�{f'��.6����j�~��WY����5r/�kj�h��U����g_�`��m�s@[��"�aҗ��U�)�3-�Q�:��Pc�κ�5;A=x�o���s.��m"���P�D��S��-�W[�Ņ.Rv��OfP@��k��(�R�<���s}�jVW#�U��7��T07P�3������B���R��hD��>��gA�>��OT�#/�<���!����7�ǹ�a>���Z���A�NJ���,�]�$.�^X�m��K@�b�@d�G���;���'�7z�iVY�W�҇J!���A��X���!ŧ�@��l��y��,!z[U���!�.�;u��^پ��K�R�R��P���{���㒜&��T�L��˄�QύLhCL)���+�B���\ΰ�I �;���)��~N1;J�&���t�WgnI{��4�I�Ԟ8_紳�S�0{��Bh9_J/�Ň$`G �Ҿ:���1��h-Eaj[���8��
��lG0��H�4P��p�'W\Uu5d��7��RH����~��D�)��
[�T�ꆘ�u����8��=�iڥA:�ѕ��Ċ��3�v�n���M�׮��6��c���Z3P�E�I�d��C�N>f�N���(ɡ�--�[3��:��
3=��%vH�4��Lȵ�XE�n�3U��S{A�W|���Q���A��|]t�,�c��9}��r����Ym�H&$� ���|�*赑�x�1#�uG_�m��b��O��(�5d(t
��$^)x�k��e0���á��Gn9�]󄕨h\x�٘b9�jf]ݗ��yH�+�e��^���B���#�n���Sr ��5_'��`��-^�]�x�������C�+�.0�Y���C�k��F��?��KG[/��<аTl0Tz��@��ȡ?l�Xrr���Xx��&r 4����ϕ��O޶G�E4���4�b)!�6��h��S����t�1Q�򑴨a���uם�(��zjM~�#3U��EC��Y��/�?����'���A���*¯��2M����c�~�ԕ(]�)��d^9���)O?�C��&k/T��KU�����Y�x/y��R���?Et�B$�(0��nп1	�y�P����A���~�l�Y����a��ݧC߆ml,��~)���I٦t�y��&)q;����&{��IQ%�$hB��jZl�P�������D-ϖo>D`�����m"��3���œ��,67��G@���g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(���0    �8���o�7�7vE���o::�T�:�:��^Bp�p�0h����c����0n�� wy�}����
������� �@-@-��(1(14�`H`H ��R"�R��R"�R�S"S �T"T� V" V�	�`"`@f �@�"@�����b@�H
��\��	��(lib-dynload/_codecs_hk.cpython-38-x86_64-linux-gnu.so000075500000466570151153537510016214 0ustar00ELF>�,@8f@8	@�(�( �+�+"�+"�4�4  ] ]" ]"888$$`(`(`(  S�td`(`(`(  P�td%%%llQ�tdR�td�+�+"�+"44GNU7�U�$�8�9�B�=e>���@ ��|CE���qX:@`��� ? , F"_���3q�O�����`"�`"
�`"� ;�__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6_PyUnicodeWriter_WriteChar_PyUnicodeWriter_PrepareInternalPyUnicode_AsUTF8PyImport_ImportModuleNoBlockPyObject_GetAttrStringstrcmpPyCapsule_NewPyObject_CallFunctionObjArgs_Py_DeallocPyExc_TypeErrorPyErr_SetStringPyExc_LookupErrorPyImport_ImportModulePyCapsule_IsValidPyCapsule_GetPointerPyExc_ValueErrorPyInit__codecs_hkPyModule_Create2PyModule_AddObject__stack_chk_fail_edata__bss_start_endGLIBC_2.4GLIBC_2.2.5vii
ui	(�+"`9�+" 9,"," ,"r=0," -"8,"d=@," M"P,"|=X," ="h,"1=�,"r=�,"`:�,"3�,"5�,"1=�5"�=�5"4>�5"
?�5"�@�5"B�5"�C�5"E6"~F6"�G 6"xI06"�J@6"tLP6"�M`6"pOp6"�P�6"lR�6"�S�6"hU�6"�V�6"dX�6"�Y�6"`[�6"�\7"\^7"�_ 7"Xa�9"�b�9"�c�9"e�<"�f�<"�f�<"^h�<"�i�<"Zk="�l ="�<0="\>@="*@P="�A`="�Cp="�E�="�F�="�G�="�H�="�I�="�K�="M�="�N�="�P>"DR>"4T >"�U0>"�W@>"�XP>"xZ`>"r\p>"H^�>"�^�>"r`�>"Rb�>"d�>"�e�>"Xf�>"Vg�>"\h?"�i?"8k ?"�l0?"\n@?"�oP?"zp`?".rp?"@s�?"�t�?"Pv�?"�w�?"�y�?"�z�?"�{�?"}�?"^~@".�@"� @"Ԃ0@"$�@@"�P@"��`@"��p@"���@"8��@"��@"���@"�@"Đ�@"l��@"��@"(�A"��A"�� A"�0A"��@A"��PA"j�`A"B�pA"��A"p��A"��A"���A"|��A"t��A",��A"���A"��B"h�B"B� B"��0B"��@B"
�PB"|�`B"��pB"���B"��B"к�B"���B"���B"2��B"^��B"H��B"D�C"��C""� C"��0C"��@C"f�PC"X�`C"��pC"��C"j��C"@��C"���C"��C"���C",��C"��C"t�D"�D"�� D"6�0D"�@D"��PD".�`D"��pD"T��D"j��D"���D"��D"���D"���D"n��D"L��D"��E"�E"� E"��0E"��@E"��PE"j�`E"t�pE"V��E">��E"��E"��E"f��E"���E"��E"��E"^F"jF" F"0F"`F"�	pF"\�F"
�F"t
�F"J�F"��F"$�F"��F"<G"�G"� G"0G"�@G"�PG"�`G"2pG"��G"��L"��L"2! M"`n0M"
o@M"�p`M"�qO"Tr0O"\rPO"t`O"tpO"@t�O"�tP"�tP"Lu P"Nu0P"Bw@P"bw`P"dwpP"�x�P"�z�P"�|�P"�~�P"���P"z��P"p��P">��P"�Q"܉Q"Ћ Q"ƍ0Q"��@Q"��PQ"|�`Q"�pQ"��Q"Ę�Q"���Q"r��Q"h��Q",��Q"��Q"p��Q"D�R"p�R"Z� R"P�0R"D�@R"@�PR"0�`R",�pR"��R"ڵ�R"̷�R"ʹ�R"���R"���R"���R"���R"|�S"H�S"0� S"��0S"��@S"F�PS"��`S"��pS"P��S"<��S"���S"���S"���S"v��S"^��S"J��S"�T"�T"�� T"��0T"��@T"��PT"��`T"~�pT"l��T"��T"���T"���T"���T"l��T"^��T"B��T"�U"�U"~ U"h0U"R@U":PU"
	`U"�
pU"��U"��U"��U"��U"��U"\�U"�U"��U"V"�V"� V"^0V"� @V"4"PV" $`V"&pV"�'�V"�)�V"0+�V"-�V"�.�V"�0�V"�2�V"�4�V"�5W"z7W"d9�\"�:]"�:`"�=`"p9`"1=h`"�=�`"`"�_"�_"�_"�_"�_"�_"
�_"8_"@_"H_"P_"	X_"
`_"h_"
p_"x_"�_"�_"�_"�_"�_"�_"�_"�_"��H��H�15"H��t��H����5r4"�%s4"��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h��������%]3"D���%U3"D���%M3"D���%E3"D���%=3"D���%53"D���%-3"D���%%3"D���%3"D���%3"D���%
3"D���%3"D���%�2"D���%�2"D���%�2"D���%�2"D���%�2"D��tU�<����M��~RH�.I��@�}I�H��I�H�I9���L�I��A�;I�H��I�H�I9����<A��wM���H���I��� A��A��L�d$�I��I�M�$L�\$�M���E�\$@��D9���E�d$	D9���D)�L�\$�A�,kf�����A�f����ML���I��f��A�H�>@�oI�L�I�H�L9��c1��I���������H���D����A����������H��L�L�]M����D�e@��D9����E	9��D)�A�,{f����A��N���H���H�D$�H��H42"H�(H��t0D�`@��D9�r:D�X	D9�wDD)��l}f���u���F��<H���3�,��$��������L��H)�H��~<A��A�����tH����tK��A���tE���D��A�AD��k����|$�u�H�����������A�A��A��A��u�����A�	�H�==����,G�
����{��L�KL+K I�����{L�[H�K ������~A���D�{L�QA����A���aC��H�C I��I����{vsH�kH+k H��~eD�KL�CH�S A��tkA��ttA����CH�j������t^A��똺�H���������5���H������$��H���Y�����y���A��L�CH�S �fA�P�fA�DP�7�����H�������x�I�I���A��L�[H�K ����{vcL�SL+S I��~U�sL�CH�S ��������A�������A�D���H������`fA�K�fA�DK�����H�������y������{v3H�{H+{ H��~%D�{L�[H�K A��t9A��tEA���������H���*�����y����A�D����A��L�[H�K ���fA�K��X���A��L�CH�S �6���fA�P����H�
�-"H�5l
E1�H�9�1�����H��H�H�|-"H�5�
E1�H�:�
����H�������IE1��H������KH������3H�
�,"H�5�
H�9���H�mt���%H���y������H��[]A\A]A^A_��:���f.���AWAVAUATUS�D$HH�t$8L�T$@���D$�I�L9���H��"A�f���A�����L�=�	"���~���M��A���4�<��������M�������H�>I��@�/M�I�CI�H�L9�}lI����I��t,B�|�������H�I��@�8I�H��I�H�L9�}0�<�����b���H�>I��@�/I�H��I�H�L9���1�[]A\A]A^A_��|9����H�I��@�8M� I�D$I�H�L9�}�B�|!����L�A�:I�8L�U�H�GI�H�L9�}��|9��wdH�L�U�@�8I�H��I�H�L9��m����<��wIM�������L�&I�j�I��A�<$I�8H�GI�H�L9��F����1���1��,����f����a����\����W���fD��AWAVI��AUI��ATL�%�!USL��H��M���>I��0@���M�}�L������H���N������O���I�M��H�pI�6�p@��xpH����H��t'H������������I�I��H�xI�>�p@��x9H��������I�I��L�@M��p@���/ff.�I�����N:�P���]D����I��L�*"M�M���XA�x@8��JA8P	�@��)�H�E�<AA�����(D��H���M������N���I�I������H��1�[]A\A]A^A_�fDH������������I�I��L�PM��p@���5���H����������I�M�o�L�XM��p@���
���H������������I�L�hM�.�pM�o�@������H������������I�M�}�M��L�HM�M���>����p@���H������I���[�N:�P�������@���u	�����������D��L��I��M�M�M��t$A�s@8�wA8S	r��)�Lc�C�4B����ue����	�=d��}���~2=������=���M����H��[]A\A]A^A_��=b�����H���[]A\A]A^A_�DiٿDݍ������evf���k�����vO��cE������&���L�r��ʃ���Hc�A�,�������H���1���2���I�I�����L����L����H������7���H������+���f�H�=�'"H��'"H9�tH�'"H��t	�����H�=�'"H�5�'"H)�H��H��H��?H�H�tH��&"H��t��fD�����=}'"u+UH�=�&"H��tH�=��!����d����U'"]������w������ATUSH�F��������H���/�I��H�������H�-'"H��uDH�=0�+�H��H������H�5(H���`�H�+H��&"�����H�-�&"H��tjH���!H�;�?tVL���L���X���H��1�H�5���H��H��t(1�1�H��H����H�+I��uH����L��[]A\��F��������<���@���=M&"��UH�=�SQ���H��H���K���H�5�H����H��H���)���H�5mH����������H�5VH����H�PH�@H��%"H��%"H�+�����H�m�������%"1�Z[]���%"1��ff.���AW��H�=%"AVAUATUSH��dH�%(H��$1��'�I��H���E1�H�l$�<I��H�__map_H��H�5�H��H�$D��M�|$H�big5hksc�H�T$H�=p�!1�fA�D$s�A�L��L��H�������E1�D��H��H���L�D$�L��H�__map_1�H�4$H�5\�H�5
H�= �!���L��L��H������tRD��fo��H��1�H��E1�I�__map_�H�5�L�$H�=��!L�T$AD$��L��L��H���N�H��$dH3%(L���S����`�����H��H���encoding name must be a string._multibytecodec__create_codecno such codec is supported.multibytecodec.__map_*_codecs_tw__map_big5map data must be a Capsule.big5hkscs_bmpbig5hkscsbig5hkscs_nonbmpgetcodec_codecs_hk�C2LF�ExEgrwM�E�|�L�|�;6GDGGL@L�B6Rs�n�pWLQ�OG�E�Ll|M�J�F#k%rTZc>a?Mf�V���}Y���=4��{�[^�Z%6���Z�[�\ng��E�at�t�1�1�1�1�1�1���1�1���1��1�1�1�1�1�1�����L�������������Q��+���M���k�����������������������������������������������������������������������������������a�#�#��E��
e����=N�nN�ߑ����5w�dO(O�OVQtQ�Q�Q�R�R;SNS�S�S�V�XYY2Y4Yf[�[�[�\�^;`�e�ghehNm�p5u�~�~�~�~�~�~7z�ςo�Ɖ���f�g�n���������������������������������������������������������������������t�|�}Fi�z'R�����������x^���������	������Ǟ�Lɝ�>L��p
�3��5���n>�u��Il������yl����*$N�N�N�N�N�N7OL4�OH>P�P}4�4�4�QY�Q�QR�NyR�R'S�5�SQ5�SS5�S#Tm5r5�6�T�T�T�T�T�TU#U(U�5?U�5�5�U�5�}%U��B
+Q�U�,�9AF��M�S@��zw8,4:�G]��i�M�d|
����d~��d�,V��D��F
M���G�N�,��g:��?5�Rԗ�xD-n�����C�`�d�TL-�+w�9o���������������������������������������������������������������������fg�y�dRPCh��!L�1��H��?sX�-���E��`L�
yU�@�C���Jf*������
yc�9u'���V|dC>���	�*�,����9�9:��x5I^� RV1�, ��4=l;N����tu�."[�͌z4h��(9)�5�Q����?0G
OL����H
�=�?�&2d��39v�+~

Q,U,:��.2�PkҌ��ʌ���TĂ�U��Þ&���^w�-@qm��\re4��7_S�����w��5�M	6��V�'�xxH�UyPN�-TZ���W���������������������������������������������������������������������v͂�{~Q7���R���I:wA|��XhR6=W�{h[H,K'��I���t[=1�U�5�V(NY�x�Q��[N�N>5#\Q_�_�8Lb5ezk5l:llp+r,N�r�HR;y�|Sjb�4��Kc���fQi]Sd����x�����x�����u�Θޘc��|��Ğok�7N��7b��;P�ms����=��NAwp�\ K�QY50]"a2������qg�s�2��<�K�xt�Q�	@cj��#B�o
*zG��U�Mp$S~ ��v㉧��w�N�O�P/NO��4T�}�X�X��^�^�_'�e���������������������������������������������������������������������3iCjc<�l��rE�s�>J[�t���\�V�z�{�|l~��������������Ϗ_��!�����?q@�BZ������h�kgvB=W��օ{I��
q�Ltm{]k�o�����[���f[~Wn�y�=�DV2�'�C6E���\;��x\=Q5x]��WqXE�@#wLx9J4�Al̊�O9�Yl�V���;_����!m�A�Fy�?�����@�7�FFl|A���smE�8�TaEE�M{LvM�E�?Ka6�D�D�A>]H]V]�=8�]�] 888B^�^%_�_99?9M9�`=a�\�9�a�a�a�9,b�b�bc�9�V��������������������������������������������������������������������:�c�cdZdK:�d]!V���:�e�:�eSf�:�f";gB;�ghX;Jh�hr;q;{;	iCi\rdi�i�i�;�i�;ejtjqj�j�;�j�;�j�j�j�j�k�k�kul�l�<mm&m�m�<�m�mnn)n�n���n�n�n��n�n$o4oF=A?�o�oj=u=�q�\�=,p�=PpTpopp�p%�C�5��>�W�n>q�WN6�i�t[Iz�Xٔez}z�Y�z�z�z�z�q�d�A�z�z�z�A�T\{U{){S�\�{o{���[l�{!��{�� ]�=e\���{��5|�\D|�|�H�|}fxE�|�|�|t|�|�|����������������������������������������������������������������������g~EDn]}�n�t�}�}5q�}��W@)`�}=�}��}m���!aZan~�~+Cl�'~@AG6y�bᙗQc�ah\Ef7E:���d������/����l;�<�a�'�I&f�=�f%g��H����X�&l�d�O�d��^SjeJ�JzD)�
Rj~=�O��b�
k�I05s�=��i���AK�Ђ���6}1Z5{����>�mk�k�5�=��U��E�m����Ӄ~4�nWjZ��4Bn�.X��[q��=�D�jJ��<Xy���kwnCnބ�����D��䄑\@B�\CE4��Z�n'Es�E�g���������������������������������������������������������������������%�;����p���p��jE(�H6��S�s~�q����',��ڇ�aVl�VhFE�F��u�=�u^���[F�����cňwww������������%��$y�z���w����Yz�z:{�?G8{|q��0TeU?�L�M���zJ�������FO���T}�}�%7S}֌�}�}��ی\p��L�>����I|;��q�z����ÎԒ�-�e�������P
��*Iމ=��=�^b2������%#�9�n7�<��za�l�����Đ憮���g��:��đ�|3����lA�b��U��Ɗ�<��U��������������������������������������������������������������������1
,�k��닏p�Z��eID��9���s�[�������&����o�Bz&؆|.>�Il{���lA���n�a���x���S�I�ltd����J
31�B�6�J=E�E�JupA[���ՑW�J[�_�%��P�0�0����������җ�lT�t3������zy�J4�3�K�f�;uqQ=0\AWʘ��Șǘ�J'm��U���x�9�)JrKW�����;��X�%W�6��՛����L�-��4P4��i�8}0P�@�>�EZc��KB����h�ԝ�������#�ߡ~���4���h��������������������������������������������������������������������ĝ[!�� �;3�9�������������4M����dC��`;�9=2O�7+����K$��m���9��V�VE�������b�i��z��r�KuI�Iwq�IHCQJ�sڋ��y~�6�i��D�쒁�˓l��Dr�>rwCz�psD�C~q��p��5�>�/T�"7�9�6t�K_#7�[W%J������6��U��Ieq1>\U�>Rp�D�6��&o�g37<�=lX"hW@?7�@�@A!l�T�V�f�V��
Ɠ����N+Q86D�NeKO�OQVhZ���9
54)O���uڊ�N���������������������������������������������������������������������P
Q�OOJ�>BO.PlP�P�O�OXP�P��������vn�59>�>rm��>�Q�Q��D���z���YR�Rs�R��zF�q�C �I��i���>�ttVt�s�K�J�@�S�5r�@�UE�T�W]��f��W�WW>6�X�ZF��o,Z�Y��~Z�ZZFY�a�B�6mCt!Z�^�Z׋�tqrI������7\�\^^H^�|�:�^O[7��6��6*�G��r4��__'�kZ;D[��u`�~``(+&�_�>�%�%��so�a>F&�a�au`�,-�FM���������������������������������������������������������������������qdeFj+):"+P4�x.7c[��d1c�c�Ig-�b�,;dkeri�;�0�2�I�2
U�2�?��f�2�1�:�A�U"��U�[U%T�x1*42d42�1�B�f$mkf�K0fpx�cf�2�2frX�8:8�7�;�7�3�t�;�g*F�hh�;�jc8�7�D3jRj�jke�hLj�;zjWk�?�<����ˊ���܉g��mo�I��?�=n<@=Z
nGX$mBx;qCvB�pPr�r�r�G%GyQ�J�zt�>_6JJI�_?�>�J#�5?�`�>�t<t��7t�D�mQE�uc?�LMX?Uusvƥ;ht̊�I�I�:���������������������������������������������������������������������=NJ�>�I�H��2WB��d�P!R�Qxw22ww{w�F�7^:�H8t�t�>�J�J�@�J�a��Ux�x�x�x�sYyAw�VA�����y-j�>:z�ynA�2A5��yL
�I��=n�5kUp5�6�
�zYZ�&�Z�Z
Z[�x*Z�[�z�A]|m|B�[�^�^�|�I��|||�|�j�}~�}Nab\aH{�}�^jBuk	�gN�5�Wd�cbI�'{,�ZC]{^�E�c�j?4�9�I�e��e��'q�l�D7�Dƀ	�B��gØBjb�e�QjS��m�r�ZA@+[��Z������=-�"tZ��������������������������������������������������������������������n�EO�����e�M��VT��w�w��ً�����>���F�F�7=��H�M_+��B�e)q�pEm�����}�Y�w�YnC�6*���	L0�J��BXl�o!#�Hyo�n�雵6/I����qUI���K�b@��'��;��+���������4�Et�>�HBJ�C�>%2���f�e��>�IxJ�?tkt�>A���GhJ���W��h���&�/��c��[i�<I�sB��q�8�&�]ŋ�J�ڔ��ו�DP�gJd�ܘE�?*�%I�;�M�{�=��oK��\�e��X�j!��Z/��KH����K�K}�rX"X�I���������������������������������������������������������������������Dx'�=�h}=X�'9Pa�'k)aO�S�{�5���ϛ-�������!��LA��L�����/�����n�o�k��3E�m�n�m ��n�7d`�y�5@6-I�Ib=ۓ��H���xw�M��O@4d�]U=xTx�xKxW�1AI�6rO�o�o��pT�A�W�X�W��W4q�4�A�q@l�O���I�a�ZZ�B�D,7{K�������r��l�B&,�C�Y�=Ag�}[a�`�I�I����s�>�tc���>�J�j�s�s�>>J�J�fJ�$�IHtI�pvI���s_��1�Ί�����U5I��kq��������������������������������������������������������������������CI��V��U�y��}�PJR.E�
7���I�Y���t�Z�6[=�6_�yZ��bt��<�
�J�9�Pi=L=�uq�B�n��DWmO~gp�l�<�?->noo=�Qu�6�4�F�>qH�Yn�>IA���kX�W�6R�pbCqJ�/��#�hgi��4�{�6���7�3�Lj�6�l>��D�D&mQm�l�oo	q=�:타lSp��Y�Z�aZqZ�A-7�Y<�6�q���f�BnZ+Z�B+j�>6w[D�BqYBተO(m�\�DM~�CjVB�p3q�C�=�l%�OJe~�Y/]�=\_]J��}&����������������������������������������������������������������������T�:3~W��?���p[�p]�s�|Y� ��O��rs�z8s9s�VAsHs�>{l��q�H�s���>w�>�l�Vttt�>�>�>�>�t?S?Bumuru�u|?�u�u�?Mv�?tv�?zv\O�q#V��iX@Cw9@agE@�5�wj@o@^\�w�w�Xx�px�@9xGxQxfxH�5U3yh2yA	A�y�y��z��gA�z�A�zy��A�z�z�A!Nb{l{{{||`BzB{|�|�B�|�B�|���p��}�}�}�}���r�C �%�9{.�1�T��=�W�p����C�*s��`u�D9;V�Y�Z���������������������������������������������������������������������D:X|���%D��-D���W���T��D��v�ʂ؂���DW�i��i��pd��`��E�����8�R�;Eo�p��wEr������E���FF����$�G���gy)�8�����Q�Ԍ���G_XÍ�G�N:��UTWq��U��7HΎ���򎷏��ʏ̏3�ę�H��I(�X�k�����������C�����EIQI���S�-�>�jIT�y�-����I�3��I�g$J@�5J��—TV�J�`��K�DX���Q�7�B�]�b�pKř�K<���zi���ݛ��mL �o7�I�:�����������������������������������������������������������������������PV������������{�������ƞܔ���zD����iÔ�Y�@X���7�v�WWsq�
�
�jT;���T�;Se|�`�zV���o
�
�
Ui/�����-s \�^\Ovg{��G6��/;dS���u6��w��xN�p-j-E*p���b��qUhE �i�6|"�#�#*'q(O)��g)�)�*���*��+��?+G���L,���,�,�[--�-�-B.t/�/30f03�3�_Hf�fyzg5�5���I��67��F�Xg��������������������������������������������������������������������i�:Wv�_>�>�u� �H�JA���B
C;@4C�CEJ��Q�Y��;�<D�D�WtF�9/G�əb7�!^�N���H�HJ	r�JxeY�N�Oyڎ,P�R?Wqq�RTJ?�J�UFTnTRk��s4?U2v^UGbUfU�W?I]XfP�4�3��Y|GH��Z�[\��WQq��a|V��a�Ob�dJd[]�k���d�I�d�?e�K�e�f'e��W�a'Z����V!E�fjN4IV��m�l6w��gnhd^h���hB{��
&i��9iEz���i&�-j_6id!�y4j[k,]5���k�F�l;ue��m�X��������������������������������������������������������������������7�%Kp�qT<�r�r��z!�r0��r�I9l��Pt�'���&)s���n*J �9�6����?E�f����C��wXx�V�@
�9/7���qf��y�����L�p���y
z{f}zAC{~y	��oߢj��Sn��6h]�o�#��i�/2H��]0���W#�I��]�I�e�i�S�J�?<6g���.��O�������/����5h����H�cV�xU����C��C�F�ԋ�Y	���ŏ���<��=^��JЏ�r�V�镰���2�јI�j�Ù(��Z����~��#��LG����q���M�˥�M����U�����������������������������������������������������������������������$���J	E~Vo�j�N�4,��x:7���$�l���>z�f�=Uv�<5VVY�N�^Xb�Vm�m[�>�L�c���{0e-VJ\TS�=��}L"VVI�^uY@=p�N�I
�6�^��;vE�Nv�wE�2TH���%V2�����UbyCVT��5V�U�f�-64u�U�U�TrUA��^HQvb,���Z}�Uu�bm��T͌�qv��c�c�ciUC+r��.�Q�4�
�QMTUUfv-��h�u�����Lj�����DsG�[��h{V�&/}�As}�n�rp����<����fr�NG�O���@��������������������������������������������������������������������]�e�-�H�G|��
���u���H`��q�~P�NNw5
[�lgS�6�9}S�6F�XnK-�KT�W�Zy	��R:e$ts��	M�<0�[L�O��ޟ\��=�r�g 7.c%}�>,>*:��Rt>z6�E�@v�Z�zx.�X�@|V��t]Tv4����L���7a�0�C��]V��WcI�4R�p�5��|�V|9��WlS\�dД5cdq��(
"m�Jq
���Q�]����L�{��\�{hb5c���{*�~|��B|�|��{	����>IZ�sU�[�O���O`R>�RgWVP�Y^ȗ��\�iT��@���,S0a��������������������������������������������������������������������,i�S
��;LA��i�PFumڙsR��Y���\���Q���c#m�jV��zu�b�Osp|!\�<��I�v��*N���B���J\�i��zWR�]�N1l�9O�T�T�R���5���5��Rk|�����.���������zq{���k�x�� VJ�w�S���ԍO����b}�(�u��zwJ>z�x�lg�vZ�&��lև�u��Sx@���rqs-�s�t댻J/��_���D��;n��~�%���`gvךD�n�����������,s!����5�rLQ|J�YaYaL��}a��_Woa�b9b��\:�a�S�3dch�5��������������������������������������������������������������������W]‹ڏ9����PFy2S8�;e@���w���|_�|-zf�c�M}u�t���gb��t[��t�$w���gSu�n��·ȁ��I���C�+w�tڄ56�i���������m��@�t�=vq�`�a�<��w`��q-����`~K R<�<�^Vv1UD���m�p�\�a�w6�FhObE[LcP���kb`$a$b$c$d$e$f$g$h$i$t$u$v$w$x$y$z${$|$}$p!q!r!s!t!u!v!w!x!y!6N?N�N�N�Q�Q�Q�R8SiS�S
Y�[�]3/^��P_a_4e���u���������0�0�0�0����000�0;�=�='A0B0C0D0E0F0G0H0I0J0K0L0M0N0O0P0Q0R0S0T0U0V0W0X0Y0Z0[0\0]0^0_0`0a0b0c0d0e0f0g0h0i0j0k0l0m0n0o0p0q0r0s0t0u0v0w0x0y0z0{0|0}0~00�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0���������������������������������������������������������������������0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0�0 !"#$%&'()*+,-./012345Q6789:;<=>?@ABCDEFGHIJKLMNO�!�!�!�1�ZN�R�D�����������������������������������������������������������������������Q��v������������������������������������������������������������������������������������12!!!�0�0�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�.�������P[TuS�K�j�x��ψ�XR`�|�ZT%f%W%`%l%c%Z%i%]%R%d%U%^%j%a%X%g%[%S%e%V%_%k%b%Y%h%\%Q%P%m%n%p%o%�Gے��?L��B�s�QI6BI�D����<<xDg�b3I����k�O�$P)m�z6�J%��~�_�G�n��Qz4Ql�C7��I�`Q�3jQ�� �0%�32��[}���<�Q�Q��������������������������������������������������������������������4��Q�Q�Q�<�Q�J�Q�QBS�Q̓>i-7{_R&R<R�RWR�R�R�R|B��R
�k��ފIU�n�?T	�?3S����l&h�sJ`�>�8��q�DmStS��~S����w�S���S�S�S�srWY?�s�S�SIlIN�W�S�:��S�?�-�SwTyp+UWf[mmTSkt
]U�T�T�G
��=M
���&GU�L/Tt�U�U���:@RE5D�f�7V�f�2�f�fMVOV�x�V���SW�V�Vf�#6OFW�Anl�pBW�6~l�WXTcC&X�K\X�Xa5�X�X<�X�[CWP�xBӓ�5Y�h�6Yn��������������������������������������������������������������������>$ZSU���YN
�l*m��Y���mqm(��YEn�ZcZ�6�I��7�Zet�Z�oT%�=27��^�Rv[�e|[z@]H�[`a4�Y��[�[M\D\�s\�(kI\�H�\�\�\�]�7]]F]��\�]��-8II s!��68�;.^�j��z^�D��S�N���Sq	^�^���^�^�8�^>h�
_����:�H::_�h�#��q$c_��nnr_@�6��_�]_=PRj�ph&֑�)�1`�fwc9�=96�W�'qy@>�`���`�I�ISz�t�P�Zda$�Ba���n�a�QV�a�[�?��������������������������������������������������������������������_(�a��]��a29�)�(#`\ae�c�bp�b
.lc�I:8d�c�����o6.��@W�d�d{�f::dW:Meo(J#J�eme_e~0�e@I7K�e�@)�e�e�_4f�1�1Df�1�1Kfugf�Qsf��=12��1S�w�(��g�C!J+;�i�7��ggbg�A��g�D"hPn<�h�3�m]ho4�ijߊsi�h�5ii2=:<6�;�gaiJ��B6i�i�;�c��P�iY6*!Ej7�j�;�g�j��
<k#	�`5ktk�'�n�:�X@7!TZ;�k�>�k7l�$�HQkZl&�yl�=�D�=�AII���������������������������������������������������������������������<�6�<2
���1�$�7h%m�m�m�m\m|noI�@rn3�to�Q����.�!���/>St�?�yOn�ZK0�o
7�o0>�n�=@UE�Do\oN=top�;=�oDA�o�@UA9@�?�??A�QVAWA@A�aKp~p�p�p�p�p�p�pA�=�q�qwB+qEq�ZJq���\eCOqb��B,qZD'J"J�q苽prB�rYC�$rA�V.r@rtI�hUrWrU>D0
h=o�r��+s#H+��H�(s.s�s�s:.j�sIt�A�$J#f�6�I�I�I�sti&J9t��>���(`t��Gt�svt��lt07tt�,j�tSI�J��������������������������������������������������������������������_AyJ��F[���t�u��uَK�[����MuJugunu�O?M�u]t�u�uv,vQvOvovvv�c�v�7ii�v�v�v�v�ob��P}Qw&w@w�d RXw�2�wd�h���w��vJ�h�x�x�x��.y�U�x4y�xv����+��`&�y�i�yWX�y9{<y�y*n&q�>�y
��y�����������������������������������������������Y�W�������������]�[�����������������a�_�������������������������j�h�������������o�m�����s�q���������w�u�����������{�y�����V�g���������������������������������Z�l�������������\�n�������������������������������p�����������������������������������������������������������������^�t����������������������������������������������������������x���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������X�i���r�`�v���z���|���}���~�������k������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u��[�c���e��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ƶƷƸƹƺƻƼƽƾ����������������������������������������������������������������������������������������������������������������������������w�x������������������������������������������������������������������������������������������vȩ����ƢƣƤƥƦƧƨƩƪ���������������������ƬƭƮƯưƱƲƳƴ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�������������������������{�|�}�~ǡǢǣǤǥǦǧǨǩǪǫǬǭǮǯǰDZDzdzǴǵǶǷǸǹǺǻǼǽǾǿ��������������������������������������������������������������������������������������������������������������������@�A�B�C�D�F�I�J�M�O�P�Q�R�T�U�y���w���������������������ߖ�������������������Չ����������������������������������������������͓����������������������������ߛ������������h�����ډY�����������������������������������������ۉ����]�����������������������������܉��������������������������������������������ڊ��������܋������������ۗ��������������������������������������������S��������������������������������������������������������n���������������������������������������������������������������������������������������������������������������ȋ������������������������������������������������K���������������p���������������������������ݔ������������ӊ����������������������ے������������������������������������۔������������������z�������������������������������������������������������������������������������F�������������~�������h�����������h�������������������������������������������ٟ������������������ןj�����������������������������\���������������������^���p����������������������������Р������f�������������������������욫�H���������E���������������������������������o���\�������������������������������������������������ޞ������������������������������������������������������������������������������������������ޔ������������e�������֕������������ڗ��������E���}�X�d���V�M���������������������[�Ǖ��������������Y�������������������������������������������������W������������������������������������������������������������������������������E�S�����x�����Q�������������������������l�����k�������������������������������������������������������������›������������������������{�������������������������������������������������������������������������������`�����������������K�����������������������������������������������������������������������������������������������������������K�������������������������������������������������������������������������d�������������������i�������������g�������������������������������������������h�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������B���������������������������������������������������������������������f��������������������������ݓ����R���������������������������������������������������������������������������̋m�����������������������n�������������������������������������������������������������������������������������o���������������������������p�������������������������������������������d������������������������������������������������������`�����������������t�×��������������Њ������������t���������������Ȝ��������������������������������������������x�����������������������������������������������������������������������������������Z�������������������H�����������������������}�����}�����ŠJ���������ъ����������������������������������G�����������������������������������ڞ������������������Q�����������������������������������������������������������Ş�����������������x��������������������k�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������I�����������������������������������o���������������������~�����������������������y�������������������������������������������������������������{�������������������������������������������������������������������������������������������������������������������������������������D�������L�����������������������������������������K�������������������S�����������������������������������������������������Í�����������������������������������������������������������ō����������������������������ʍ����������̍]���a���������������R�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������V�������������������������������������������������������������������������������������������������������������������������������֍����������ޠ��������җ������������������������������������������������ۍꌯ�������������������������������������������������������������I������������������������������������������������Ɨ�����������������������������������Y�����֖������������ŗ��������ח���������������������������������������������ߌ���������I�������������������������������������������r���������������k�����������������������������������P�������������̝e���D�����n�������������c���������������ڠ����������������������S���������������������y�j�����]���������c�i�p�������������������������������������������������������������������������������������������������������������������j�����NJ��������׉������������������������M�������������������������������������������������������������ݞ�����������������������������������������������������������������������������������������������������������������������d�������������o�������������������������������Ø������������Ř��������f�n�����ݗ������Ғ����a�˘���������]�����������̘����i�͘����������Θ����������b�����������c�G�������������И����������������������������������������������������������������������������������������������������������������������������������������ј��������u�������������������r�������������������������������������������������֘�����������������������������������������������������������������������������������������������������������������������������������٘��������������Z�����������������������������ۘ��������ݘ��������������������������������m������������������������������������]���������������������������������������������������������������������������������������������������������������������������������������������M�������W���������������������ߕ������������������������Ì��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Ɯ������������������������������������������������J���~�D�����������@���������ɔ����������������������������������������������������������������������Ӕ��������������������������������������������������������������������������������������������������������F�������������є��������������������������N�����s���������������������������������“������������������������������������������������������������������H�����������������������������������K�����������U���������N�����������������������������������������������������������_���Y������������������������������������������������������`���������������������������������������������������������t���������������������������������������������������������������U�������������������D�����������������������ˌ������V�����������������������������������Y���������������[���������������������������Č������������������������������������E�������������C���������������������������������������������������������������������������������������������������������������͕������������ɗP���������������������������������������������������������������������������������������������������������������������������������������ƕ��������������������������������������������������������������������������������g���������������������������������������������������������������������������������������������������������������������������������v�����������Q���������������������������s�����@���O�z�d�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������~��������������������������n�p��������������������������������������������S�����������^�����\�������z�������������������������������������������������]�����������d�����������b�͗d���������������L�Ɏ��������������T���������������������|���������U�����������������������z�����������������������Ȗ������������Ù��֐����������v���������������������������p�K����������������ǎ��������T�����������������������Q�������������������ǙD�������������������������א����������������������������������������������������������������C�������������������������G�����������������������������������������������������������������������������X�����������������������������ߞY�B�����Ι������������������������������ϙ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ɒ����������ܗ����������������������������������������������������������������]���������������������������������������������������E�����������������������������������������y�����������������������������������������������������������������������������L�ۏ������������������������������������������������������������������L���������������������������M�������������������z�W�����������������������������������������������������������������������������������������������������������������������������������������������ޙ������������������������������������������������������������������������������������������������������������������������R�����������������������������������������������������������g��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ޗ����������������������������������������������������������������������������������ѕ������������������������������������J����������������������������������������������������������������������������������������������������������������������������V�������������������������I�ە��������������������ʼn��������������������������������������d���������U�����Ԗ��������������|�������������M���������������H�����������������������I���}���������������������������������������������P���������������G���������������������������������������������؎����������������������������������������������ɐ����������U���������������������������������������������������������������������������������������������������������������������������X�����Ր��������������������������A�������������Z���������������������������������\�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������—��������������������������\�������������������������������������������������������������������������������������������������������������������������������`�����������������������������������������������������E�X�����������������c�������������I������������������������������������������������������������������������������������������������������������������������������������������������������������k�n���O�����������������F�����������������������������������ג��u�����ԓ������y�����������p���������������������������������������������������������������x�͑��J�o�����j�������������_�����������������������������������������������������������������������A���������������������������O�������������N�������������������������������U�������͞����������������������������������y������������������������W���Ν������Ҍ������Y�������������������������������������������������������������s�������������������������������������ќ�����������������������������������������������������������������������������������I���������������������C�[���ɞ�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������X�F�����������������������������������V���������������x���������������������{�������������������������������������������������֝��������O�����Ή����������ğ��ԋ����r��������������������������F������������������������������������������������������{�Ƌ����������������������������W�������������������������������������������Љω���������щ������������������������������~��������������������o�����������������������������������������������Njk�����҉����������������������������ϟ��������������������������������������������������������Ӊ����������������������g�����������������������������������������s�����N���������������������������O�x���������������������������ԉ��ҟ����������������������������������n���������������������������������������������������������������������������������������������������������������������������o�����������������������������������������������������������P�����W���������f�������������������������։����������������������������������������������������������������������������ޖ����������������������p���n������������������l�؉��������Y���������������������������������������������������������������������������������������c�������������@�����������������������������������������������������s�������������������������������������������������������������������������������������������������ى��������������V���������������������������������������������������������������������������������������q�����������������������������������������������������������������������r�������������������������������������ė����������������g�������������������������i���������������������������������������������������������h�������������������������������������������������������������������������������������Q�������������������o�������������������q�������������������R���������Z������������������������݉������������������������������������R���S���������������������U������������[�������}���h�G�����~���������������������������������������������������������������������߉���������������T�������������������������������z�����������������O�}������������������������������������������������������͟����������������������������������������������������������������������������������������������������������������Ē������������o�������������������������������������������������������������������������������������������ӛ������������������՟������������U�����Œ������V�����������������������������������������������������������������������ܞ�������q�������������������������������ǒ������������������������������������������������L���������������������������������������������������������������������h�������������}���������������������������W�������������������������������������X�������������������������������a�����������������������������������������������������������������������������������������������������������������������������������������z���������������������������������������������������������Ȑ������ڒY�������������Z���������������������������������������������������������������������Y����������ʝ������������m�������������������������D�������u�������������������������������������������������V�������������������������������������������������������y�ǚ������������������������������������������������������������������������������G���������������ӟ��ʚ�����������������������������������Z�������������������������������������������]�Q����������������������ԟ����������������y�����������������������������������������������������������X���������������������W�������������A����������������������������������������������������������������B�������������������������������������������������������������������N���ܔ����������ڕ��j�������������������������������������F�������������������F�������������������������������������������������G�������������H�������ޒ��������S�����ڛ��������~�������������������������������������������������������C�������������������������R��������������������������������������������������������������������������Н��럩�ϝ����������������ȝ������������������O�����������������������������������������T���U�����֊��_���������������������������������������������������������������������������Қj���������������������������‘b�������������`�����������������������^�����Ŋ��������������������������l���~���������������T���������������������������������������������������������Ŝ����������������������[���������������������\���[���W�������������������e���ǘZ���������������������������������������������������������������������������������������������������������������������̌��ԛ����d�v�����`�������������������������������š��������������s���������������r�������������������������������������̟�����������������������������������g�����������������������}��������������������������������������������o����������������A�����������J������������������������������������������������B���������������g������������������������������������������������i�����������������������������������������������������������}�������l�����������������������������������������������������������e�����N�����������������������������������������n�����ߙ����������������������T�����������{���������������������������������������������������������������w���������������������������������������������o�������������������}�~������������������������������������������������x�����������������������r�������q�������������������������������\�����������������t�����]�މ��^������������������B�����������������������h���{�������������������������������������_���`�������������������������������������������������������������������������������������������������͛������������������������������ӝ��������������������������������������L���������������������R�����������Õ��������������������������������������������������������t����������������������ߗ����������������������������������������������������������������������������w�������T�ŕ��������������U���~�����������������B���������������������������Ō������������������������Q������\��������������������������������L���������������k�����������������������������x�����������������������O�������������q�����e�����[�����P����������������������������@�M�������r�����������������������������������������������s�������o�����������������������������������������������������������������������������������A��r�������������������������������������w�������������������������x����������������������r���������K���������������������������������������������������u�������������������������������������������ڐ����g�����������ߐ��������T���������������������������������������������a���������������������������H������������������������y���������������������������g�����������ٌ�������������b�c���������������������}�������������������������s�����������������������k����������������������������������������������m����������������������������������������������������������������������u��������������������������������������������]���L�������ɋ���������������������������������������������������������������������������ɟ����������������D���������������������������������������������������������������������������������������������������������������������������������������d����M��������������������������������������������������������������������h�����������������������������X�������������������������������������s�����������������������������H�������������t�����������������������������������������������������u�����x�����������������������������`�����������������a���������������������������b���������@�����������������������������������������������������������Ԍ��������������������������������Q�������������������������������������������e��������������������������������X�����f���������������T����������������������������������������������������������������������������������������������������Ο����������������u��������������������������������������������������������������������������������������������i�����������O�������������������������������������������N��������������������������������������������������������������������������e�����������������������z�������������{�����������������������������������������������������������������������j�������������������������������S�������������������������������������������������������������������������������������Y�@���A�C�a�F�b���������������������������������������������k�����������������������������������������L���������������������������������������������ʋ��������������������z������������Q�����������������������������T���������������������������������l�����������������������������������������������������������������a�����W�������������������p�����������������Q���������������|���ˋ��������������������������������������������n������������������������������������a�������������������f�����������������������������������������������������������������������������������������������������������������z���������������k���������������������������������������������������������������k�����������ܠ����h�����������������������m�����������������������������������������������������������������������q�������������d�����������������Кa���������������������������������������[�����������@����������������������������������������M���������������������������~�������������������������r���������v���������������������������������������������n��������������������t���������������������t���������������������������q�������y�����������|���������������������������P�����y�x�����ݠ����������������������������������������������������u���v�������������t�����������������������������w���������������������Ð��������������y�y�������������������������v�������������������������������������͋������������������������������������������������������Z����������������������������������������������������������������������������z�������������������������E�����������������u���������������������������������������������������������F�������������������������������������������������������Q�����������{�|�������������������������������������������֞������������[���������������������������������������������������������������������������������������������|�������������������������������������������������������������������������������������������������������������������������������������������������������������������������L���������������ŏ��������������������������������������������������������Ý��������������J�������������������������������������������K���M������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Ɗ��������������������������������[�������M��������������������������������������������������������������������x�������������������������������������������������������������E�������������������V�������������������������C������������������������������������������������������������������������ǝ��������΋�����������������������������������������������������������������������������������������������������������������������������������������������������������������g���~���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ۓ��������c�������������������������Փ���������������������������������������������q��������d����������������������������������������ؓ�������������ӓ��������������������������������v���������������b�����������������ѓ����������������������Y�������������������R�����������������S�����������M�����������������������r���������������������������P���������������������������������������������������ی�����������������������������������������~���������������������R���������������������܎������������������������������������������������������������P����������������������������������������������������������������������ʌ����u�������������������������������������������������������������������������������������������������Y�����������������������M���������^���������������������������}���������������������������������������������G���������������������������������������������������������������������P���������h�����}���i�����������������O�����V������������������������������������������������������������������������㜩�������������D�����������������@���������������������������J�������������������������������j���������������������������������������������������������������������~��������������������������������������������������������|�����������������������������������������J�����������E��������������H�G��j�����������������������������������������������������������������������������������������������������Q�������������������������������������������������������������ٚ����������������������N��������������������������������D�����������������������������������������������������������������������R�������������������F�������������������������������Ѡ��������������������������ʟ��������������������������������ϒ�������č��������������������A���������������L�������������������������������W��ޜ��������������B�l�������������������������������X�����������������������������^�{�͔��������������������������������������������Z��������������������������������[�����������������������^���ƍ����������������������ȍ����Ǎ��������������������������ɍ���������������������p�������������������ˍ������\�������������������e�������͍������������������΍����������������������������������_�𓶟������������������ύ������c�����������������������������������������������������������Ѝ���������������������������������������������b�����������������������������������������������e���������������������������������������������������������۟������������������������������������������������������������������f�����������ϋ������������э������������������������������������������������������������������������������������������������������������������������������ҍ����������������������������������������������������q���������o�����������������Ӎ������������������������������矽�����������������������������������������П������Ћ��r�����ы����ۊ��������������������������������������������������Ε��v���������������������������������������b�������������ԍ������x�������������������������������������������������������������������������v�����Ƙ��������������Ս��������ї�����������������������������������������������������������B���������������������������������s�����������������������������������������������������������������׍������؍����������������������������������������������������������O���ٍ������������������������������������������������������������������������������k�����������������Η�������������������������������������������������������������������������������ڍ��������������������������Z�����������������������������������������܍D�����������������������ݍ��������������֠����������������������������������������������������������������������������������������������������������������������������������������A�՗��J�����������M���������˗����������ލ����ߍ��������������������������������������������������������������������������������������������������������������������������݌��~�������������������������������������������������������������������������������������������������ӕ����������������������������������������������������������������������������������h������������������������������������������������������������������������d���G�������������������������������������������������������������������E�֗�������������������D�����������������������������������������������������������������������P��������������������������������������������������������������������������������������������������������������������ҕ������������������������������������������������������������������������������������������������������������������ܜ����������ϕ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������g���������������������������������������������������З��������ҋ����������������ِ��G��������������������������������c�����������������������������������������p�������p�o��������������������������������������l�������^����������������������������������������������������������������������������������������T��������������������������F�����������������������������������������������c�����������������������������������������p���������������Q�����C���Z���������������������������������������������������������������������������~�����������՛��Ú��ȗ۠Б������ݏ��������������������������ʒ��W�����Q�����������I�������������������v���������������������̜�����������������������������������������������������������������S������������������������������������������������������������������������I�������������������ʛ����������ܒ����������A�̑������������������������D�_�����������Ӌ����G�����������������������������������H�������������������������������U���������K���L�����������������������������x�������������������������������������������������������Q���������V���������������a���������W���������������������f���������������������������Ջ��������i�����������������������������������������������������������������������������������������������I�L���e�����������������������������������������������������������������������X���u�S�e���Y�������������������������������������������������������������������������������������������������������������������������������������J�����Ǟ����������������������������������������������������������������������֒��������ԑ���������������������[�������������������������������S�����������������������������^����������Z�Ŕ���������������������������������\���t���s�����������������F�������d�������h���N���e�Z�����������������������������������Ԓi���E���Ș������ɘʘ����������������������������������������������m���l�����k�������������������s�n�_�������������������������Ւ������������������q�x�������������z�������w���������������y���u�������]���������������|�������������������D�������������������������Ӓ������y�������������q�������������������������������^�����������������������������������������������j�����������Ϙ��������������������������������������٠������������������M�������������Π����������������������������������������É�����������������������������������������������������m�����������{�������������Ҙ����������������������������ٗ��Ġ��v���������������������x�������������������������Ә��������Ԙ��������������������������������q�������������������՘���������������������������������������������������������������������\�����������������������������������D���������ט��������������������������������������ؘ������������������������������������������������������������������������������������������������������������������ݝ��������������������������������ژߝ��������������������������������������������Y�\�����������������������w�ܘ����������ޘ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Ÿ����k�Ę����������������������������������������������������������͠������������������������������������������������������������������������������������������������������������������������������������������������Ǐ����O�������������������������������������������������ԏ���������������������������������������������������������������������������������������ĕ����������������������������������������������n�����������������������������������������������������������������L�������������������������������������������������������������������������������������������������O���������P�������������������������������F����������������������������������������������������������������������������������������������������Ô��������”��������������������������������������������������������������������������������ۖ����������������������������������������������Ĕ������������������������������Y�������������������ɓ���V�������Ő������������������������������������������������������������������������������������������������������؋��������������������������������������������������������h�Ɣ��������������������������������������������i�������������������������ڜ�����r������ɉ������������������A���������������B�����������ב����������̔������������������������������������������������������������������������ތ����������������������������������������������і����������������������������Ք����ДD�����������������������������������������������������������������������c�������������������������������ϔ������������������j�������I�������������������������������������������������������L�����������������������������������������������M�����������s���������������������������G�������������������������������������������������������������P���������������������O�I�����������Q�R�����������������������L���������������������V�M�ʑW�����������������G���؏X����������������������������������������\�S�����������������������������������V���������������O���^�������������������������������j�����������������d�ٜ����������������������������������]�������������������������P�������������������Q�����b�����������������������R���������������������������������������������h�������������������������������a�Y���������������������������������������������������������������������������������������]�f�����������������������������������������������������������������������������������n���d�S�����������������T���������������������������������������������������p�������������������������a���r�������������������������k���������@�������������������������������������������������������{�������������W�����_���������s�����b�������������������������������������������X�������������������u����������r�����������������������Z�����������������������������y���x������������������������������������������������������z�������������\�����������|���}�������ً������מ��������������������������������������������������������������������������������������������������������B�������������������������������������������������������������������������������������������������v�������������������g���B�������������������������}�������U�����������������������������������������������������������������������������`�b�������a���������������������������������������������������������������������������������c���������������������������������������������������������������������������������������������������������������������������������������������������������������������������܌������������������v�������������������������������������������������������������������������������������������������������������������p���������n���������������o���������������������������p�������������������������q���������������r�������������������������������s�t�������������������������������������������������������������������������������������������������u�����������������������������������ѝ����������������׋ڋ��������������������������������������������������������������������������������������������������������������������������������Ž����������������������Ď��������������������d�����������e���������������������������������������������������������������������������������N���������������������������������������������������������ˎߋ����������Ύ����������������������������������������ώ����h���������i�����������������k�ю��l�������������������ԎՎ����������������������������������������������m�������������������������֎����������������������������������������������������������������������������������������������������������������������������������������ݎ����������������������������]�q���������������������������e���������������������������������������������������������������������r�����\�����������������������������ߎ��f�����t���v�������w���y�����ڝ����������������������������������\�����������������_�����c���������������������g�������������������������������������|�����}�~�������������������������������������[�������������������������������������������������������������������������������������������������������������������������������������������������a�����������������������������������Ƞ�����������������������������������������������������������������������������������������˜��������������������������w���������������������������������������������‰����������������������������������������������������������������������k�����l���������������������������������������J�v�H�������������������������������������������������������������������������������������������������������������������������������������Ќ��������R���������������������w�A�����������������������������������I�����������������������M�����������������䝵��������T�����h�������������������������J���B�����Q���������������������������������������������������������������F���������������������������������������������������������������������������U�����͜����������������x�������������������������������������������S�����������������������o���������������������c�������������������������������V�������������������������v���������Ɵ����������������������������������������X���������������������������������������������������H�������������������������������e���l���������b�������̖g�����u���~�����������������������������������������������������������������������f�����������������n���E�����`�������ў���������������������������������������b�L�������������������������Ǒ_�����������������������������������m�q�����˔�������������������������������������������������������������������������Ö��������������������������������������������������������Ϡ������m��������r���������������������������������������B�������������������������������������������������������������������������������������������������w���������������������������������������������@�D�����������™��������������\�����������������������������������������ęř����{���������������������������������������������������������������v�������������������������������������������������������������������������������������������������������������������������������������Ό������������������ƙ��������������������������͖��������������������������ǖ��������������������������a�p�������h���~�������������������������������������������������P�������������������������������������Ӑ����V�����������������������������������������������������������������������������������������ș��������������������������������������������������������������ə��������������������������y�������������������������I���������ʙ������������������������������������������������������������������������������������������������������������������������˙՝������������������������z�����������������_���������͙ɠ������������������������������������������������ۚ������Ơ����������������������������������������������נ������������������������Ǡ��������������C�������������������������������������������������������������a�^�������������������������������������������������������������������������������|�����������������������������������������ǟ��������������������������������������������������������j��������|���������������������������������������������������������������������������������E���������������������������������R���������������������������Й����������Ïď������������������������������Ə��`��������������������������������������������������������������������������������������������������������������љ���������������������������������������������������������������������ҙ������������������������������������������������������������œ������ә����������������������������������������������������������������������������������������������]�����������������������������ɏ�� ʏ������������ԙ��������������������������������������X���͏��Ԡ������������������������������������Ώ����������������y�����������������������������������������������������������������Џ��������������������������֙��������������������������י��������������������������������ʠ��������������������������������������������������������������������������������������������������������X�����������������������������������֏������ؙ��������������ӏ������������������������������������������ٙ��������������������������������������������������������������������������|�������������������������������E������������������������������ޏ������������������������������������ߏ��������������������������K�����������������������������������������̠�������������������������������������������������ě��������������������L�������������������������������������������������������������������������������������������������������������������������������������������������������������������z�����������������������������������������������������������������������{�ڙ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ˠ��������������������������������������������������������������H�������������ۙ�����������������������������������������N�������������ܙ��������d�������������������H�����������������������ܝ������ݙ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������֟����������������������������������������������������������������������Ҡ����@���������������������������������������������Ċ��������������������������������������������������������������������������������������������������������������������ȕ����Z�����������������������������������������������J��������������������������������������������������������������������������������������������������������\���������������������������������������������������������������������������������ɕ����������H���������������I�������������������������J�������������������������������������������ћ�����������������������������������������L���������������������������������������M�����˕������������������������������������������������̕����������������������������������x�������������������|�}�������������~�������������������������������������������������������������������������]�������������������������Z���������P���O�����������������������T����ƨ������C�E���}��������������������������`���������������������������������������������������������������������������������[�۞������������������y����������������������������������������������������������������������b�����������������������������������������U�����������������������������������������e�������������������������������������������������������������������������������������������������������������������������������������������h�����������l�������������������������ؕ����������������j���������������������������������������������n�����������������q�����������J�����������ܟ����������������������������������������������������������������������������������������p�������������������������c���������ܕ����������������q�����������������������������������^�����������������I�����������[���������������������������������P���������������Տs�����������u�������������������������������������������������������c���������������������Ԕ����������������������w���������������������������������������M�����������������������x���������������������������������������ܖ������������������������r���������@���������������������������������������������������������������������������������������������J�������ؖ������������������������������������������K�������������A���������������@���[�����������A�ݑ������������B�C���Y�������������D�Q�������������������������������������������������������������������������������������������v�����������������������������U�E���E�K�����ٖ��������������������������������������������t���������������E�ڑ��������_�������������������L���������z�������ޑ����F���y�l�����������������X�����������������������f���������������������������������G���������������������I�����H���J���������������d���������ߑ��������������y���������������ז��������C��������������������������������z���ۑj�������ݕ������H�����������������������������K�������E���M���������������␴�����������N���������������������������������O�������@�C�������������������ݖ������������Q���������������������������������N���C�����������������������������������R���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������S���������������������������������������������������t����������������������������������������������������������������������������������������������������������������������������������������������������������������������������T�������������P�������������������������������������������������������������������������������������������������������������������������������������������������V���������������������������������������������W�����������������������������������̙��������������������������������Y������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Đ������������ǐ�������������������������������������������������������������������������������������������������������������R�����������������������������������������������ې����������f�������������������������������Ґ����k���Ԑ������������������[���������������������������������ċ������f���ސ��������������������������������������F�������Q�������������������������������������������X�������������������������������������P������������������������������������������]���z�������\���|�����R�����^�����������v���������������������������������������������������������������������������Ƒ�����t�������������������W���������������������������ߟ������������������������������������������������^�����������������������������������������������������������������Ɍ������j�������������������������������������������������������������������������������������������������������������������������������������������������B���b�������������������i�������D�C���A��������������������������������`������I���������J�����������K���������d���������f���������������������g�����i�����������������������������������������������������j�R�M���f���������{���k���������������l�����g�������������������������������l���������m��������������������������������������������������������������������������������������������������������������j���������������������������l���������������������������đ������w����������������o�����������������������������������������������������������������U�����������������������������R�S�������U�����������������������������]���q���������m�����������������s�����������������������T�q�������������������������������������������������������V�������m�������������W�����������������Ɖ��������������������������������������������������������������������lj��������������������������������������������������������������������j�������W�����������_���������������������������������������������������]�����������������[���\�����������������������������������^���������������������\�W�������������e�����������r���������`�������������������������������������������^�����a�������������d���������A�������������i�������������������������������h�������������������������������������������������t�����������������������������������������������u�����������������������m�`���������������ޟ����������ß������������������������������������g�����������������������������������������������������������������������������������������v�����������������������Օ������ʞ������w�����x���������������������p�o�������������������q�����������������c�����������g���������z�����������V�����������������ښ��������������������~���������������������ޝ����������������������������������������������������������������������������������������P�������������������􋤟�������������������������������������������������������������������������������������������������������������������������������^���������}���������H�������������������������������۝������������������������������s�������������������������������z���������{�������������������������������������������������������������������–����������w���������������������������������������������������������������������������������s�����������������������������������������������������������������������������������������}����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������T��������������������������������������p���m�����������������������������������A���������������������������������������J�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������A�������������������������������������������������������������Ñ��������������������������������������i���������������ȑ������������ɑ����������������������������������������������������������������������ˑ��������������������ȉ����������������������ݟC�m�t���������׌،ڌ�ȣ��H�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������q���������������������������������������������������������u���������������v���������������H���������������������������������������������������Ǝ����������������������������������������������������������ŋ������|������������������������������������������������������������������������������������������������������������������������������N�K�z�H�������G�����������������������������������������������������������E���S�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������r�������������������������������������������G�������������������������������������ߔ����������������������������������������������������������џ���������������}�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ː{�����������������������������������������������������������������������ؔ��������_���T�������������������������������������������������������������ږy�������������������������������������������������������������������������t�u�������������������������������������������������������������������������������������������������������������I�������ߒ|�c�������������������������������������������������������������������������������������������������������������`�m�b�����������������������������������������������������������������������������k���������������������������j���������������������������������������T���s�����������������������������������������������������������������������������������ؗ��������������B�v���������������������e�������������������������������������������������������������������������������������������������������������������������������������������l�������������������������������������������������������������������n�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������u�@���������������������������������������������������������������������������������������������������������������������������������������������v������������������������������������������������������������������������{�������������������������������m�������������������������̉����������������������������B�����������������������\�������������������������������������������������������������������������������������������������������������������������������������������{�����������������������������������������������������������������Ò��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ЛP���������������������������������������������������������������������������������������������������������������������������������������������ƒ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������F�������������������������c��������������������������������������������������������������������������������������������������������������������������������������������������������������������������Þ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������f�����������������������������������������������������������������������������������������������������������������������������S�������������������������������������������������������������b���������������������������������������������������������������������������������������������������������������������������������������������������������������������Ě��������������������Ś������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������@�����������������b���������������������������������������������ƚ��������������������ɚ���������������������������������������������������������������������������������������������˚������r�^���������������������������������������̒������������������������������������������������\�̚������������C���������������������������������͚����������������������������������Κ�����������������������������������̛������Ϛ��������������������������������њ����������������������������|�������������������������������������������������Ӛ��������������������������������������������������_���������şY�k�������������Ԛ������������������������������՚������������������������������������D�������������������������������������J�����������������������������������������������������������d��؝����֔��������������������������������������������������������������������֚��M���������������������W���C�D�������������������������������������������������������������������������������T���������������������ך������������������������������������������ؚܚ��������ʊ������c�ݚe�o�~���������C�������������В����������������������������������������������������������������������������������������������������������������������������������������������������������������������������f�p�u�䊤���������������������������������������������������]���H�����������������@�����������������v�����������������������������������������������������������������������������������ޚ������������������������������������������������������������������w�d�g�K�����������������S��������������J����׊����������������������������������������������������������������������������������������������������_�������������������������������������������������������������������������������������ߚ����������������������������������������������������������������������X�����������������������������������������������������������������������������������a���������������������ם}�����B�����������������y�z�������������������������������������������������������������������������������������������������������������������������������������������������������������~�����������D��|�q�����������������������������������������������������������������������������������������������������������������N�����������������������c�����������I�Ίn�������������������������������������������������Β������������������������������Z�{�|����������������������������������������A�����r����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������r�s�������������������������������������_���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������|�E�n�V���������������������������������������������������������������������������������������������������������K����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Ǘ��������������������������������������������������������������������������������˜@���������������������������������������������������������������������������������������������������������������N�����h���������������������������l�����������������������������������������������������Œ��������������������������������������j�t����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������A�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ǜ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������Ŏ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������G�����������������������������������Ҕa��������������������������������������Ɠ��Z����������������������������������������������������������������������������������������G�f�U���������������������������������������������������������������������������������������������C���ڔ���������������������������������������������������������������������������������������������������������������������d���������������N�D�������������������������������������������������������������������������i�ԕK�������|�������������������������������������������ŝ��񑱎�������������������������˓�����������������������������U���������t�������������������������������������������������������������������l���������������������������������������c�������Ɲ��������������������������������������������������������������������`�X�v���������������������������������������������������������쑴���������������������������������������������J�I�x�������������������������������������������������������������������֑U�V�Q����������������������������А������������D�����������U���������c�����������������������������������������������������������������������������������������������k�����������������������������������������������������������������������Q�������W�����x�������������������������������������P�����������������������������������������������������������������������������������������������������������������������������������������L�������������������������������������������������@����������������������������������������������A�����������������������������������������������������������a����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������‹|�B�������������������������������������������������������������������������������������������������������������������������������������������C���������������������������������������������������������������������������������������������������y������������������D�������������������������������������������������n����������������������������������������������������������������������������������������������������������������������������������������������������������������������������y�������^�������������������������������ˉ������������S���������������������������������������������������ד���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������t���������������������������������������������������������������������������������������������������������������������������E�������������������������G�P�����������H�������������������������������������������������������������������������������������������������������������������������������������������������������������������������[�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������L�K���������������������������������������������������������������������������������������������������������������i�������������������������������������������������������������������������������������������������������������������������������������������������Պ��������������������������������������������������������������������������������������������������������s�Y�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������B���Û��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������N�Е������_���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������N�������������O���������������������������������������������������������������������P�ƞ����������������������P���������������������������������������������������s���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������X�^���������������Y�����������������������������������������u�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������p�����������������������������q�w�����������������������������m�������������������������������������������������������������������������������������������������������������������������]�����������������������������������������������������������������������������������������������A���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������k���}���׎������������M�����������������������������Q�����������������������������������������������������������������������������������������������������������������������������������������������������Ê��������������������������������������������������������������������������������������������������������������������������h�m�����������������������������������������������g�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������l���������������������������������R�����������������������������������������������������������������������������������������������������������������������p�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������S�����������������������������������������������U���������������������������������������������������������������������������������������V�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ˊ����������W���������������������������������͉��Y�[�������������������������������������������������������������������������������������������������]�������O�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������{�������B�P�����������������������������������P���������������������������������������`���������E�������F�����������������������������������������������������������������������������������������������������b�������������������������������������{���������������������������`�����������������؊��������c���������������������i�������G�����̊|�e�������������������f���������������������������������������������������������������������������������������������������r���������������z�������������������������������������������������������������������������������������������������������������������������������������������������h����������������������������w�������������������������������������g�������������������������������������������������������������������������������������������������������������Y�����������������������������������������������������������������������������������������������������������i�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Q�����������������������������������������������������������������������������������������������������������������������_�j�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������k����������������������������������������������l���������������������������������N������������������������������������������������������������������m���������������������������������������������g�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ʓ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������F���������ϓ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Γ���������������������������������������������������������������w�̓����������������������������������������������������������������������������������������Z�������������������������������������������������������������T�����������������Q����������������������������������������������������������������������������������������������������������������������������������������������ٓ����������������������������ړ��������������������ѐ����������������������������������������n���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������p���������������������������������������������������������������������������������o�������������������������������������������@�{�����������������������������������������������������������������������������������������������������������������������������������������������Y�����������������������������������������������������������������������������������������������@�����_��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������v�������������������������������������������������������������������������������������������������������������������������������G�������������������������t�������������������������������������������������������������������������������������������������������Җ������������������������������������������������������������������������������������������������F�O�I�����������������������������������������������������������������������u�\���������������������������������������������Q�����y�������������������������������������������������������������������K�������Ӗ������������������������������������������������X�����������_���������������������������������������������������������������������������������������������������������������������������������������������C���������������������������������������ٝ���������������������������������������������������������������������������������������������������M�[�������������������������������������z�������������������՞����������������������������ɜ������������������������������X�����������������������������������������������������������������������������Ȏ������������������������������������������������������������������������������������������������������������������������������������������������������������������������ߓ�����������������������������������������������ϖޓϊ��������������������������������������������������������������������������������������������������������i�������������������������������������R�������������������������������������������������������������������������������������������������������������������������������������������������������n�������������������������������������������������������������������������������������������������������������|���|���������������������������������������������������g������������������������������������N�������������������������������������������������������������������������������������������������������t���˞��ԝ���������������������������������������������������������������������������������������������������������������������������������������������������������{�����������������������������������������������������������������������������ҞS�����ٔX�y�{���������������������������������������������������������������������������ڎ������������������������������������������b���������������������������������������������������������������������������ٞԗ�����H�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������K�������������������������������������������������������������������������������������������������������������������������������������������������������@���������������������������������������������������������������؞^�_�ΔJ�p�g���������������������������������������؛��������������������������������������������c�����������������������������������������������������������H�������������������������������ڏ�����������������������������������������������������������������������������~���������������������������C�����������������������������������������������������������������������������ӗ��H��ؠ�������������������������������������������������������������������������������J���K������������������������������������������������������������������������������������������������������������������������������������������������������������Z���ْ���������������������������������������������������������������������������������������������������������������������ݒ����������������������������������������������Y������������������������������������������[��������������������������������������������������������������������������������������������������������������������������F������������������������������������������������������������������������������������؜��������������������������������������������������������������������������������m�|�a�������������������������������������������������������������������������������������������������������������������`���������������������������������������������������R�O�����������������������������������������������������������������������������������������������n���������������������m�����d���������������������������������������������������������S��x�����������������������������������������������������]�����������������������������������Z���������������������������������������������������P�������������������Гb�����������������������������������������������������������������������������������������������O���������������������������R�������������������������������������������������������������������������������������������ґ���������������������������������������������������k������������������������������������������������������������������������������˒����������������������������������������������������������������������������������������������k�������Q�������������������������������������������������������������������������������q������������������������葺�������������������������������������������������������������������������������������������������L�j�������������������������������������������������������������������������a��������������������������������������������������������������������������������������D�����������������������������������������������������������������������������������������������������������������������������������������i���������b���������������������������������������������������������������U�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������w�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������}�f�������������������������������������������������������������Y�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������X�������������������������������������������������������������������������������������������������������������������������������������������������������������������Ǜ��������������������������������T���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������t�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������֋��������������t�������������������ț�������~���������������������}�������������������o�a�����������������������������������������������ו������R�X�������������������h����I���������������������������������������������������������������M�����������������������������������I�Αq���������ό������������n�����������򜸓C�Y�הf�}�o���������F�������������������������������m�������������|�͒��������������������e�~�X�w�ϑ��������������������������������������������������������������������Ֆ������������m�������������F�������������������F�[�ё�g��������������ɛ�������������������������b���k����N�����������������������������������������g���������������������`���������u���ӑ����������������������{����������������j�^���������������������������������������������������������������������~���������������h�쎽���������������������������[�����ٛ������������������]�V�b���������������O�ؒ������˛������������������_�������������ϐ��������������������������e�����L�������������ؐ[���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������m�ʕ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������s�t�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������K���������������������������������������������������������������������������������������������������U�i�܊����������������������������������������v�������������������������������������������������������������������������������������������������������������������������������������������������������������������������Λ��h�������������������������������������������������������������������������������������������������������������������������������������������������������������ߘ����������������������������������������������������������������������������������ϛ��������������������������������������������������������������������Ξ����������������������������������������������{�қ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������E����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������J������������������������������������������������������������������������������������������������������������������������������������������������Z�������������������������������������������������������������������������������������������������������������������������������������������������֛������������������������������������������������������������������������������������������o�����������������������������������_�����˝���כ����������������������ȓ�������������������������������������������������������������ۛ����������������������������������������������������������������������������ܛ��������������������������������������������������������������������������������������S���������������������������������������������������������������������������������ǓI�����������������������������������������������������������������������Ó��������������������œ����������������������������������������������������������������������������������y�������������������������������������������������������{�����������~����������F�������������������������������������������������������������������������������������������������������������������������������������������������������p���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Ȕ��������������������������������������@�������������������������������������������������������������W��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������C�D�O��������������������������������������������������ܓ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������o�������������������������������������������������J�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������N����������������������������������������������������������������`���������������������������������������������������������������������������������������������������������������������������������ž�����������������������������������������������������������������������������������������������������������������������������������������������������������������Q�����������������������������������������������������������������������������������������������������������������������������d���������������������������������������������������������������������������������������������a�������d�[����������������������������������������������������������������������������������������������������������������������������������������������ɝ����������������������������������������������������l���������������������������������������������������������������������������������������s���������������������������������������������������������������������������������������������u�q�������������������������������������������������������������������������������������������������������������������������`�j�������������������������������L�������������������������������������R�T���������������������������������������������������������������������������������������������������������������������Ԋ����������������������������������������������������������������������������������������������������������������C��������������������������������������������������������������������������������������������������������������������������������������������������������������������ҝ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������b�������������������������������������������������������������������������������������������������������������������������Ж����������������������������������������������������������������������������������������������������������������������������W�w�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������m���V�@�����������������������������������������������������������������������������������������������������������������������������������������������������������������󠾔���������������������������������������������������������������������������������������������������������������������������������ۋ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������G�������������������������������������������ދ����������Î������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������I������������������������������������������������������������������������������������������������������������������L�����������������������������̐`�K�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������p�����������������������������������������������������C�������G�̎������T����������������������I�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������^�������������������������������������������������������������������������������������������^�������������������������\�����������������������������������K���������������������������������������َ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������_�������L�����������������������������������������������������������������������������������������������������ێ��������������������������������������V���������������������������������������������������������������������������������������T�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������^���������������������������������������������������Ԟh�����������������������������������������������à����������������������������������������������������������������������������������������������������������������������������������a�������������������������������_���������������������������������������������������M���[�����������������i�������������������������������������������������������������������������������������������������������c�����������������������������������������������g�������������������������������������i���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������e�������������������������������������������������������������������������������������������������������������������������������������������������T���������������l�n�]�����������s���������������������������j�����������������������������m��M�������������������������������Ռ��������������������������^����������������������������������������������������������������������������������������L�u�ݛ����������������t���������������������������������������������������E�������������������������Ɩ��������������������������������������j�N�����������x�������������������������������������������U�������������������������������������������������������������������������������������������������������������������������������������A�\�������������������������������������������������������������������������M���������������������������������������������������������������������������������������������������������������f�e�I���B�������������������������������������������������������������������z���������������������������������������ʐ��������[�����M�����ӎ��������������������������a�K���ғ��@�F�g�Z�������������������������������������������������������������������������������A���������������������������������������������������������������������ӌ��������������������������������������������������������������������������������������������L�ɖU���o�������������}��������������������������������������������������������������������������������������������������������������������o�����������˖Ζ��������V�����������������������Ė����������������������������������������������������������������������������������������������^�l�������������������������������������������������������������������������������������S�����������������k�������������������������ʖ������������S���������������������������y�������������������������������������������������������������������������������������������������������������o�Šx�B�Z���a�O���������������������������������������������������������������������������������������������������������������������������������������������������������s����������������������������������������������������������������������������������������������������������������������������������������������������֌��������������������������������������������������������������C�Ŗ����������������������������������������������������������������������������������������������������������������������������������������K�J������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Ҝ��������������������������������������������������������������������T���������������������������������������������������������������������������\�E�����F�ь��������������������������������������������������`�������������������������������������������������������������������������������������������������������������������������H�G�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������q�������������������������������������������������������������������������������������������������������������������������������������������������������E�����������������������������������������������������������������������������������������������������������������������������������������������������Ӟ������p�������������������������������������������������������������������������������������������������R���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������P�}���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ߊ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������i��������������������������������������������������������������������������������������������������A���������������������������������������������������������렣���������������������������������������������������������������������������������������������������������������������������ȏ��������������������������������������������������������������������������L�`���������������������ǔ��������������������������������������������������������X���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ÜĜ����������������������������������������������֓����������������������������������������������������������������������������������������������������������������������������������������������������������������������������q�я������������������������������������������������������������������������������������������������������������������������������������ՙ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Μ��������������������������������������������������������������Ԝ՜�����������������������������������������������������������������������������������������������������������������������������������������������p�����������׏��������������������������������������������������������������s���������������������[�����������������������������������������������������������������������������������������������������������������ҏd�������������������������������������������������������������������������������������������������������������h���������֜����������������������������������������������������������������������������������������܏��ُ��������������������������A���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������l��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Z�����������������������������������������������������������������������������������������������������������������������������������������H���������������������������������������J�l����������������������������������������������������������������������������������������������������������ל������������������������n���������������������������������@��������������������������������������������������������������������������������������������������������������������������������������������������������������������������•j���ϗ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������|�A�������������ۜ����������������������������������������A���������朰�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������b�N�����������������������������������������������������������������������������������ʜf���������������������������������������������������������������������������������������������������������������������S�������������������������������������������������������������������������������������@���������������������������������������������������������������������������A�������������������������E�s���������������������������������ʗ��B�����������������������������������������������������������������������������������������������������������������������a�����������������������������������������������������������������������������������������������������������������������������������������Ҋ���������������������������������������������������������������������������������������������������������������������������������������������C�����������������������������������ߜ��������������������������������������������D���������������������ʎ������������������������������������������������������������������������������������N�������������������������������������������������������������������������E�O���������������������������������������������������������������������������������������������������������������������������������������������������������������������������G�������ʉ��������������������������������������������^���������������������������������������������������������������������������������������������������������������������c�W���������������������������������������������������������������������������������������������f��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������b���������������������g�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������H��������������O�������������������]�����������������������������������������������������������������������������������k�\�������i�W�����������������������������������������������������������������������������U�s�����������������������������������������������������������������K������������������������������������������C���������������������������������ؑ��������������������F�������������������������������������������������������������`���S�Ӝ������������������������N�������@�������������������������������������������������������������B���V�����e���l�J�����P�R�����������������������������������Z�I�G������������x�����������������������������Ϗ������`�����������������N�������V���������������������������ܑa��]�ގ��O�ޕ����������������������������@�������������������������������������������������������������������������������}��������������������������������������������������’����������������������������������������������������������������������������������{�����������{���w���������������������������������C�Ɛ������������������e������������������������������������}�������������e�����������������������������ē��������������������H���������������������������������������������S���������������ś��]�������������������������������������_�_�n�]���������������������������������������������������������������������������������������������������������������������������������������������������������������������i�����������������������U�����������������������������T�����A�����Ց������������������������z���G���������������������������������������������������������V������������������������������������������������f�����G�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������O�������������M���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������N���������������������������������������������������������������������������������������������������������������������������������������������ّ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������r�z��������������������������������������������������������������������������������������������������������X�F�����������������������������r�����ő��������������B�������������������������������������������������������͐��Y�����������������������������e�����������������������������������������������������������������������̗ΐ������������Y���������[���������������������������������������������������������������������������������������\���������������������������������~���������������������������������^��������������������������������������������������������������������������������������������������������������������������`�����������������������Ϝ����������������������������������������������������������������������������������������ݐ�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������F�����������������K�X���������������������L���c�Ϟ����������������������������������e���������������f�������������������������������������������������������������Z�����������������������������������d���������������������l�ي����������������������������������g�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������p��������������������������������������������������������������������������������������������������������������������������������������������P���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������h���������������������������������������������������������������t���������������������Q�������������������������������������������������������������������������������������������������������������������������������w���d�v�i�����������������������������������������������������������������j�����������������������������������������������������������������������������������������������������N���������������������������������������������������������������������������k�������������l�������������������������������������������������������������������������e�]�����������������m�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Z�B���������������������������������������������������������������������������������������������������������������������j�������������������������������������������������������n���������������������������������������������������������������������������������������������������������������������������͝����o�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������r���������������������������������������������������������������������������������������������������������������������������������������Ȟ������q�������������������������������������U���������������������������������������������������������������������������������������������������������q�r�������������������������̞����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������t�����������������������������������������������������������������������������О\�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Ҏ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������w�����������������������������������������������������������U�������������������������������������������������������x���������������������������������|�������������������������������������������������������w�����������������������������������������������������������������������������������������������������������������������������������u�������������������������������������������������v�������������������I�����������������������������������������������������������������������������������y�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������u�����������������������R�������������������������������������E���������������_�������������������������������������������������������������������������ݜ��������������������������������������������������������������w�V�������������������������������������������������������������������������������������������������������������������������������������������������������������������������������@�������������������������������������������������������������������������������x���������z�Ɋ������������������������������������������������������������������������������������������������K�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������u�t�������������������������������������������Ț��������G���������������������������������������������������������������������������������������������������������������Ë������������������������������������������������������H�����������������������������������w�����������������������������������������������������������������������������R���������������������������������������������������������������������������������z���������������������������������������������������Z��3�����	���V�B-��w�`�!F8`H��$ބ�$�P�4�(��|�X"�B�S��4��@�=�H���-�:���� _DR��,� W+��n���&��v�����2D����G���d�@ ������H0T0D5�& @ +� c($P`��*�h5�O� Ă(�Q
���C�57`�zm=�9�"����t0Р	)�߀@���`�v}��Ӆ��n�	/`Txh"pV�%��^,���]lmC`6J`�>�����b">�%���\h
�J��D5��������4���[�ڐ�ۇ���-v:vb��}��W'�[7n�!�@ �xn_?~�=�������k���꺺]�s�����%K^��*඙�t�O�)�&um�RP`~o��P��#%���u�����{R ��=	(�" �P@0J���$b�d�����big5hkscs_nonbmp;l�����������4�
���6
��P�
����
��������H`��P��d���zRx�$�� FJw�?:*3$"D��D\0
���F�B�B �B(�A0�A8��
0A(B BBBD zRx�8������(����|�����F�B�E �E(�H0�A8�G@K
8C0A(B BBBG]
8A0A(B BBBIO
8F0A(B BBBA zRx�@������(����,�X���F�A�A ��
ABAzRx� ���$�
��Z(�����R�H�A �AAA��zRx� �� �
��O0TH���F�N�B �B(�A0�A8�G�$zRx��������(,�
��G
8A0A(B BBBAGNU�`9 9,"r= -"d= M"|= ="1=r=`:351=�=@y4>@�
?@��@@�B@��C@�E@�~F@��G@�xI@��J@�tL@��M@�pO@��P@�lR@��S@�hU@��V@�dX@��Y@�`[@��\@�\^@��_@�Xa@��b���c@�e@��f��f@�^h@��i@�Zk@��l@��<!�\>�*@��A
��C��EG��Fv�Gy�H,��I��K�M
��N��P�DR�4T��U��W/��X<�xZ�r\�H^w��^
�r`
�Rb �d��e-cXfD�Vg*�\hF��i�8k��lE�\n*��o|zp!�.re�@s��t�Pv��w��y&��zf��{�}&�^~�.�
��t�Ԃ3�$�������������8������::��Đ��l�Z�c�(�@������5���������j�
�B����p�������|��t��,����	����h�;�B����,���+�
� �|������1�����W����2�T�^�t�H��D� C���"����)����f�X�X�5������j��@���������-R,���!�t�"�����&�6���	����.�R���"�T�t�j������X���$���
�n��L����/��MO�.������.����j��t��V��>����+f�3��������^4�j���y�
��	�\��
 �t
�J��(M$��s�<>����#����� ��Q�24[������%�2!��`n��
o��pP��qQTr��\r�t��t`}@tPp�t==�t��Lu33Nu�Bw��bw11dw5��x��z	��|��~����z��p��>�
���܉�Ћ�ƍ�������|�+�����Ę����r��h��,����p��D��p��Z��P��D��@��0��,����ڵ�̷�ʹ���������
����|��H�	�0����#����F�,�������P�
�<�����������v��^��J���������������������~��l�������������l��^��B���%���~�h�R�:�
	��
������p�����\���Q������^�� Q�4"� $�&��'-��)�0+�-��.��0��2��4|�5�z7
�d9��:�:�Ufv�*
�<�+"�+"���o`8�
4 _"��(�!	���o���o����o�ol���oZ ]"�*�*�*�*++ +0+@+P+`+p+�+�+�+�+�+�=p91=�=`"GA$3a1�*�<_codecs_hk.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debugأI��7zXZ�ִF!t/����]?�E�h=��ڊ�2N�����".�c4�'�'�	��A�A"�@#b�QY�-s��
f�:ptfL��b�o>���o��u�^��&|d��j궁�Y���"pp?U�"3��� �~jf�R�k���9���ؓ:O��`�C3�nB��B���#E�=�t�L���rUܲ�Z�X �4�ߛ0�%Aj-��0�Ӄ���6���B%$Ͻ?�j�.�yߕ^�tݶ@�En��L(q0�5�G�8�T�{�lj<��-�����!DS�y�K��va��l���"�'���]�d�-+'o��W�� �l��>6aS2Kc��N8K�'�y+|��k����>�F��}�rr�X�k0�Zb�B�	k̨~,%�/iFs'�U�{M�@�K>ȴ���Ί⿧>�(��r�ѐ
�b&��rϕ��U4>��e�¹��G�H�53�{%����>8 xG[v|I���j�@Vl���e�C��ռB�]�#oe+��
nA%ùqV�Mj��i�W���W�Zk�$�&xÈ#�E[�:l�cK���5��5v��w��?�m���)c��"r�U�K���c�Cՙ��O������s��<�NO�[R; ��/�8/�.pH��麗�y�6��k�GA���d�_�v��;K7`y�s?D�nC��QY9�]1Fu�O�㷓�P�&=�?g��حj�9|e!��o�$�q�ޯ��]:���q ��d���Y:��a_ �:�6�f��K�=�ߙ��,Ċ�Gl�vӏ�^y$�	Ԉ0b��™����xs��r��g���E��((���I
�4��cW6��6D���8�����}�� ������m��D��I���_���χ@�͠n����s��b�p��>=7�1`�o�b���I3Y|�,��rn����H֫,��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(���08848���oll8E���o��0T��!^B�(�(�h�*�*c�*�* n�+�+w�,�,�}�<�<
��<�<P� �%%l��%�%��`(`( ��+"�+��+"�+�,", 1 � ]" ]� _" _��`"`� ��`"�`(��`b�`$
�`d0a�e(lib-dynload/_xxsubinterpreters.cpython-38-x86_64-linux-gnu.so000075500000112640151153537510020074 0ustar00ELF>�,@`�@8	@�k�k 0{0{ 0{ 0� H{H{ H{ 888$$�k�k�k  S�td�k�k�k  P�td�b�b�bddQ�tdR�td0{0{ 0{ ��GNU�ԅ���oX����ln�8�T�@ !TVW��|CE���qXa����Tb>
�#��� h�$p���/S�S ,��, cF"����PG��C_���}i�Y�t�/�A�
�L����C��03���;�#��Ї �`� �`� 	pNz__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6PyMem_MallocPyMem_FreePyThread_acquire_lockPyThread_release_lockPyType_IsSubtypePyLong_AsLongLongPyErr_OccurredPyExc_ValueErrorPyErr_FormatPyExc_TypeErrorPyErr_NoMemoryPyErr_SetString_PyCrossInterpreterData_ReleasePyArg_ParseTupleAndKeywords_PyObject_CheckCrossInterpreterData_Py_TrueStructPyErr_Clear_Py_FalseStruct__stack_chk_failPyInterpreterState_ThreadHeadPyThreadState_NextPyExc_RuntimeError_PyInterpreterID_LookUpPyUnicode_AsUTF8strcpyPyUnicode_FromFormat_PyInterpreterID_New_PyInterpreterState_Get_PyInterpreterState_GetIDObjectPyList_NewPyInterpreterState_HeadPyList_Insert_Py_DeallocPyInterpreterState_NextPyThreadState_SwapPy_EndInterpreter_Py_NoneStructPyArg_UnpackTuplePyThreadState_GetPy_NewInterpreter_PyInterpreterState_RequireIDRefPyLong_FromLongLongPyLong_AsLongLongAndOverflowPyNumber_CheckPyObject_RichCompare_Py_NotImplementedStructPyObject_Hash_PyType_Name_PyObject_NewPyErr_ExceptionMatchesPyImport_ImportModulePyObject_GetAttrStringPyObject_CallFunctionObjArgsPyUnicode_InternFromStringPyThread_free_lockPyInterpreterState_GetID_PyObject_GetCrossInterpreterDataPyThread_allocate_lock_PyCrossInterpreterData_NewObjectPyUnicode_AsUTF8AndSizePyDict_SizePyDict_Next_PyInterpreterState_GetMainModulePyModule_GetDictPyUnicode_FromStringPyDict_SetItemPyRun_StringFlagsPyErr_FetchPyExc_MemoryErrorstderr__fprintf_chkPyErr_SetNonePyInit__xxsubinterpretersPyType_ReadyPyModule_Create2PyErr_NewExceptionPyDict_SetItemString_PyInterpreterID_Type_PyCrossInterpreterData_RegisterClassPyType_Type_edata__bss_start_endGLIBC_2.4GLIBC_2.2.5GLIBC_2.3.4vii
�ui	�ti	�0{ `N8{  N@{ @{ �� 3(� 3@� VH� �6X� Wh� Vp� �6�� 7W�� � �� pV�� �6�� UW�� � � �W� ~2�� �a� U� �1� @a � �W(� 118� �`@� sWH� 1X� �``� Wh� 
1x� ``�� �T�� '0�� `�� �V�� WG�� �_�� �TȂ (/؂ _� �W� -B�� �^� �U� �;� �] � �W(� �C8� �]@� VH� ?X�  ]`� hVh� $Ex� �\�� �U�� e8�� `Y�� �U�� �<�� `X�� �Wȃ 'A(� �W0� @b@� � �� �W�� �W�� �W�� �W�� V�� pV�� �WЄ �W� �W� �W�� �W � �W(� V0� pV8� �W`� �Wh� Vp� pVx� �W�� �W�� �W�� �W�� �W؅ �W� �7� �4 �  � 8� �4H� �0p�  X�� )3�� @� � � � � � � � !� #� $� &� '� 0� 5� =� Mȅ 3`} h} p} x} �} �} �} �} 	�} 
�} �} �} 
�} �} �} �} �} �} �} �} ~ ~ ~ ~  ~ (~ 0~  8~ "@~ #H~ %P~ (X~ )`~ *h~ +p~ ,x~ -�~ .�~ /�~ 1�~ 2�~ 4�~ 6�~ 7�~ 8�~ 9�~ :�~ ;�~ <�~ >�~ ?�~ @�~ A B C D E  F( G0 H8 I@ JH KP LX N` Oh Pp Qx R� S��H��H��[ H��t��H����5JY �%KY ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&�������h'��q������h(��a������h)��Q������h*��A������h+��1������h,��!������h-��������h.��������h/������h0�������h1��������h2�������h3�������h4�������h5�������h6�������h7��q������h8��a������h9��Q������h:��A������h;��1������h<��!������h=��������h>��������h?������h@�������hA��������hB�������hC�������hD��������%�T D���%�T D���%�T D���%�T D���%�T D���%�T D���%�T D���%�T D���%�T D���%�T D���%�T D���%�T D���%�T D���%�T D���%�T D���%}T D���%uT D���%mT D���%eT D���%]T D���%UT D���%MT D���%ET D���%=T D���%5T D���%-T D���%%T D���%T D���%T D���%
T D���%T D���%�S D���%�S D���%�S D���%�S D���%�S D���%�S D���%�S D���%�S D���%�S D���%�S D���%�S D���%�S D���%�S D���%�S D���%�S D���%�S D���%}S D���%uS D���%mS D���%eS D���%]S D���%US D���%MS D���%ES D���%=S D���%5S D���%-S D���%%S D���%S D���%S D���%
S D���%S D���%�R D���%�R D���%�R D���%�R D���%�R D���%�R D��UH��SH���H�����H�ƒ�H��t=H�C�KH�=	�sH�|$�~D$H�1��J�r�R H�UH�H�]EH��[]�UH���SH��RH�?�q���H�}H��t
����H�EH�;X[]���SH��H�H��t	H�w ���H��[�����ATI��H�5AX USH��H�H9�uH�C�|�(�����u�H�CH�P`H��tFH��t<H�����H���u'�(���H��uKH�=�Q H��H�5"#1�H�?����.H��y ��H�
�Q H�P1�H�5+#H�9�����	I�$���[]A\�UH���SQ�1���H��H��u�����H�H�h�@H��Z[]�AT��A��USH��H�GHEG1�H��t.H;ptH��H���1ɃxuTH�=0Y H�5&������<H���v�����H��t,H��uE��tH�C�H�C�H�EE��tH�1��H�C1�[��]A\�USH��RH��t5H�;H�kH��t���H�;���H�H�CH��H��������X[]���H��H��H�
vV H��dH�%(H�D$1�H�s%I�����1҅�t(H�<$������uH�bP H�����H�AP H�H�L$dH3%(H��t���H���S�c���H��H������H��tH�
P H�5�!H�9�m������H�CH��u�
���H���������@t[�Q�����xt H��O H�5�$H�81���������Z���H��H��H�
gU H��dH�%(H�D$1�I��H��$�����u1��2H�<$�$���H��t�H���.�����x�tH�RO H��
H�6O H�H�L$dH3%(t���H���S���H��H��t2H��1�H���H��H�����H��u	�c���1��H��H������H��H��[���H�w1�H�=�#�����1�������V���H��t	H��Y���1�Z���AU1�ATUSQ�
���H��t]H�����I���.1�H��H�����H�MA��uH���}���E��x L�����I��M��tL���@���H��H��u�H�uH���K���1�ZH��[]A\A]���UH��H�
�S H��SH�7#H��dH�%(H�D$1�I���(�����t6H�<$���H��H��t%����H��tH9�uH��M H�5fH�8����1��<H��������x�H������H��H���K���H��H�����H���8���H��M H�H�L$dH3%(t����H��[]���ATH��1�1�UH�5�$1�1�S������ts���H����H��H������H��uH�M H�5A"1�H�8�j����<H�{���H��H��uH�����H��I������L������H�{��,���H��[]A\���H������AUATUSH��dH�%(H�D$1��B�����I��H�H��A��H�5YR H9�H��t
�L�������H�}H9�u#�M1�A9L$��1�H�uI9t$���H�5R ������u�H�U���t<H�t$H����H���u����H��tl1���|$u^H��xY1�I9D$���MH���U�����t5I�|$1�����I��H��tYD��H��H���_���I�$H��uBL������8H�UK H��,A��u��uA��u��uH�kK H��
H�OK H�H�L$dH3%(H��t���H��[]A\A]���UH��SQH��-���H��tH��H���=���H�H��uH������H��Z[]���SH��H��5����SH�=4 ��t��H�=9 H�
E HE�H�SH��[1���AWA��AVE��AUE��ATI��UH��SAR�C�H��tqH�h H�}�H��L�`D�xD�p�=���H�EH��tL; t]H�@��H�=2R L��1�A��H�5��=�H�}�d�E��t6E��uH�uH���=���1�� H�=�Q ���t��T����	H�@E1��ZH��[]A\A]A^A_���ATE1�E1�H�
�Q USH�/H�=�O �UH�u����D�eH��E�����}��H�=`����H��H��u����H�=:���H��H��tjA��H�H�5H��HE���H�MI��uH���j���M��t71�1�H��L����I�$H��uL���E���H��tH�uH��H���0����
�Y����H��H��[]A\���H��H��H��tH�O H�wA�H�D�H������O��uH�=���uH�=Q��H�=t��ATH�w USH������H�;��S���H�kH�}���H�EW�H��E��H�kH�}H��t
L�'�z�L����H�EH�}H�EH��t
L�'�T�L����H�EH��H�E�7�H�;�/�H�;��H��[]A\����USRH�_ H�GH�o��@H�;���H�S1�H��H��t;H;/t	H��H���H�Ou'H�wH9�u)H�sH�KH�o�	���H��tH������H�;X[]��H�q����AVH��H��L���AUATUSH��(dH�%(H�D$ 1�H�D$�D$�D$�D$P1�H�T$RH��H�L$$QH�
�K L�L$0�:�H�� ��u1��
H�=�N �D�t$�\$D+t$L�l$��H�-xN H��tL;mt@H�m��H�=�N L��H�5%1����H�==N ���u�H��F H��L�eM������uA��uI�|$ ��I�<$���A�|$uH�=%N H�5�����j��u#I�t$H�>~H�=�M H�5����o��CA�D$I�|$L�OM��tA�AM�	H���L�GM��tA�@M�H�O��1�I�<$�������A���	���H�=iM ���������L�UI�z t H�=jM L��1���H�5U�f�������L�m1�M�������I�}���I�} tH�=!M H�5'����������I�E H��tH�(1�I�}�,��c���H�}�N���H�E�M���H�L$dH3%(t�L�H�� []A\A]A^�UH���SQH�=]L �x�H�
YL 1�H��H��tH�CH;+tGH��H����H�=_L H��H�5�1����k�H�=L ����uH��t;H������1���,H9�u	H��K �H�FH�kH��H�
�K ��H��1�밉�Z[]���H��H��L���H��dH�%(H�D$1�I��H�
�H H������u1��H�<$�
�����u�H��C H�H�L$dH3%(t�&�H���ATI��UH���SH��H�=8K �S�I�$H�H��tH9+t3H�[��H�=AK H��H�5�1��P�I�<$uJH�=�J �m��<H�CH��t�xuH�=K H��1�1�H�5���H��J I�$H�[�H��[]A\���AVH��H��L���AUATUSH��8dH�%(H�D$01�H�D$�D$�D$�D$P1�H�T$ RH��H�L$,QH�
�G L�L$8���H�� ��t6�\$\$u�D$�D$D�d$D�l$H�l$�`�I��H��u1��cH��H�T$ H�=�I H�D$ ���H��H��t�L��E)���H�}�I������}uH�=�I H�5�A���S���H�]E��y	H�CE1��XH�CE1�H��tL;`t)I��H���L����H����M����H�CH��@H�E��u8�L;`t%I��H�H��u�L����H��tvM��ukH�CH�C�@H�KH�u�H�>uH�~u1�H�~u1�H�~@�lj}E1�H�}�A�H�|$ �7�E�������H�A H��I�E�A����I��J���H�L$(dH3%(t�I�H��0[]A\A]A^���AWH��H�
�E H��AVH��L�8�AUATUS1�H��0dH�%(H�D$ 1�H�D$P1�L�L$��ZY����L�<$L�d$�c�H��H���uH�T$L��H�=�G H�D$���I��H���LH�X H��t)H�=�G L��1�1�H�5���H�|$�!���(�r�I��H��uH�|$���H��L�������tH�|$���L�������H���M�I�}�I���\�A�}uH�=nG H�5tA������dI�}�L�����A�ą�uH�I�m���H��u��A���.H�@L�0H�EH�}uH�E�H�UH�BH�E�A��I�}�/�H�|$�%�E��tL����L�����H��> H��1�H�L$dH3%(H��t�8�H��([]A\A]A^A_���H��(H��H��dH�%(H�D$1�H�D$�$�����D$�����D$�D$P1�H�T$RH��H�L$QH�
�C L�D$APL���L�L$0�r�H�� ��1���ti�<$D�L$��uE��u,L��= H�5I�:�o�1��>��uA��1�A�����
1�A�����D�L$D�D$H�
~E H�=�C H�t$�
�H�L$dH3%(t�(�H��(���U�(SQ�"�H��H�����a�H�H��u"H��1���H�=`E H�5�����n����H��u��H�CH��1��a��CW�H�� @H�C��W�H��u;H�kH�CH�}��H�EW�H��U��H��1�����H�=sD �HH�C�CH�C �r�H�-cD H��yH�=�D H�5�H������HH�E� H�5D ��H��t*H�D H�(H�XH�PH�@H��C H��C �H��H�=�C �Y�H���uH��1��y��.E1�E1�H�
�C 1�H��H�=�A �F�H��H��uH���*���H��Z[]���AVH�=�C �AUATUS��H�=~C H��������H9�uH��; H�5E1�H�;1����NH��������H9�vE1�1��8H����H��H��t�H�=C H��H��tH�H��H�H�N���L�-C H�=�B �h�H��uM��uv[1�]A\A]A^��L��E1�L�5�B ��H��H��u
�>L�EK��I��M9�}0J�4�E1�E1�1�L��H�=�@ �%�H��u�H�MuH�����1�H��H�����H��[]A\A]A^���AUH��L�;�H��ATH�
�? H�US1�H��(dH�%(H�D$1�L�L$�����uL�d$�e�H��H��u1��\H�T$L��H�=�A H�D$���H��H��t�H�����H�;�I������{uH�=�A H�5�1��^��nH�{1�L���e���t1��XH�CH�xH��u���H��H��t0��H�WH�PH;xuH�@H�H�/W����H��u��H�{ t��CH�;��H�KH�9u(H�s H��tL�.H��H�s ��H��I�E��H�|$�j�H��u+�P�H��H������H�=�@ L��H�5�1���� H�����H��H��tH�����H����H�L$dH3%(H��t�R�H��([]A\A]�ATI��U1�SI�|$I9,$~)Hk�0H�H�;H��t���H�H�{H���\�����[L��]A\����AWH��H�
= H��AVH�AUATUSH�ĀdH�%(H�D$p1�H�D$@H�D$@P1�L�L$PL�D$X�c�ZY��t\H�|$H���I��H��tJH�|$@H�t$0��H�$H��t2H�<$H��1��H��H��H��H;T$0tH��7 H�5)H�:�1�1��=L��L�|$8�����x�M���>L;=�7 �1L����I��H������H��H��u
����H��������L�(I9�v
H�@�Ik�0���H�CH��u��H���X��H�l$`L�D$XE1�H�D$PL�L$PH�l$L�D$ L�L$(H�L$H�T$ L��H�t$(�����tjL�T$`H�|$XIk�0HkL�T$��H�EH��tEH�|$H�uH�t$�����t"H�}H��t
����H�EH�|$�R��I��M9��{�����H��tH������}�H��H��������\�E1�I9�tL���|�H�����I��H�D$PL��H�D$XH�D$`���I��H����H����I�$H��uL���	�H����H�EE1�H��t}L;#}xMk�0LsI�>���I��H����I�~���I��H��uI���L�����{H��L��H���1�I��D$uL����I�uL�����|$uHI���H�<$E1�H��H����H�MI��uH���O�M��t$I���L���9��H�MuH���&�H�T$`H�t$XH�|$P���L�|$XL�d$P�n�H��H��u
�A���W�L��H�=�1����I��H����H����H�EI�uL����H�}u%H�=�4 L�%�H�?�����H��LD��wM����L��H�=1����I��H��tNH����H�EI�uL���I�H�}uTL�4 L�%I�;���H�
���LD��L�%N�L�%��8�H�}H��t
�
��H�EL�eH�|$PH��t
H�u����H�|$XH��t
H�u����H�|$`H��t
H�u���H����L��3 H��1�A��I�8������M��u�M����1�E1�L�����H��trH�UH�=; H�MH��tH��tH�5�	1�����H���}���H��t
H���n������H�}H��t���H�}H��t���H�����H��u-�3E��uE1�H��uH��2 H��6���H�����A��H������E��t�����A��M���7����?���H�L$hdH3%(t����H��x[]A\A]A^A_�H�=J: H�5����IL�%J2 �1��6f.�@H�=�9 H��9 H9�tH��1 H��t	�����H�=y9 H�5r9 H)�H��H��H��?H�H�tH��1 H��t��fD�����=59 u+UH�=�1 H��tH�=�, �����d����
9 ]������w������H�=9 ATUSu�)��H��H��8 H������f�H�=7 H��8 )�8 �����������H�=05 �[��H��H�������H�����H�=�8 H�������L�%�0 1�H�=�I�4$�]��H��8 H���x���H��H�5wH���[������I�4$1�H�=~�!��H�r8 H����H��H�5JH��������"���H�5H8 1�H�=�����H�8 H�������H��H�5H�����������H�5	8 1�H�=p���H��7 H�������H��H�5�H������������H�5�7 1�H�=Y�d��H��7 H������H��H�5�H���b�����e���H�5�7 1�H�=B�%��H�N7 H���@���H��H�5�H���#�����&���H�D5 H�5|H��H�25 ���������H�F/ H�5fH��H�����������H�5���H�=�4 ���������H��[]A\���������H��H���channel ID must be a non-negative int, got %Rchannel ID must be an int, got %.100sinterpreter has more than one threadcannot destroy the current interpretermay not be closed if not empty (try force=True)'send' and 'recv' cannot both be Falsecan't initialize mutex for new channelunable to format exception type nameunable to encode and copy exception type nameunable to format exception messageunable to encode and copy exception messageout of memory copying exception messageout of memory copying exception type namesource code string cannot contain null bytesRunFailedError: script raised an uncaught exceptioncan't initialize mutex for channel management_xxsubinterpreters.ChannelError_xxsubinterpreters.RunFailedError_xxsubinterpreters.ChannelNotFoundError_xxsubinterpreters.ChannelClosedError_xxsubinterpreters.ChannelEmptyError_xxsubinterpreters.ChannelNotEmptyErrorchannel already closedO:is_shareableinterpreter already runningO:is_running%ldO:destroyinterpreter creation failed%s(%ld, send=True)%s(%ld, recv=True)%s(%ld)channel %ld not foundRecvChannelSendChanneltest.support.interpretersbothO&|$ppp:channel_closechannel %ld closedchannel closedO&:channel_destroyO&|$ppp:channel_releaseO&O:channel_sendO&|$pppp:ChannelID.__new__failed to get a channel IDtoo many channels openO&:channel_recvchannel %ld is emptyOU|O:run_string%S%s: %sRunFailedErrorChannelErrorChannelNotFoundErrorChannelClosedErrorChannelEmptyErrorChannelNotEmptyErrorInterpreterID'send', 'recv', or 'both'the 'send' end of the channelthe 'recv' end of the channelget_currentget_mainchannel_createchannel_list_all_channel_id_xxsubinterpretersscriptsharedcidforceobj_resolve_xxsubinterpreters.ChannelIDA channel ID identifies a channel and may be used as an int.channel_release(cid, *, send=None, recv=None, force=True)

Close the channel for the current interpreter.  'send' and 'recv'
(bool) may be used to indicate the ends to close.  By default both
ends are closed.  Closing an already closed end is a noop.channel_close(cid, *, send=None, recv=None, force=False)

Close the channel for all interpreters.

If the channel is empty then the keyword args are ignored and both
ends are immediately closed.  Otherwise, if 'force' is True then
all queued items are released and both ends are immediately
closed.

If the channel is not empty *and* 'force' is False then following
happens:

 * recv is True (regardless of send):
   - raise ChannelNotEmptyError
 * recv is None and send is None:
   - raise ChannelNotEmptyError
 * send is True and recv is not True:
   - fully close the 'send' end
   - close the 'recv' end to interpreters not already receiving
   - fully close it once empty

Closing an already closed channel results in a ChannelClosedError.

Once the channel's ID has no more ref counts in any interpreter
the channel will be destroyed.channel_recv(cid) -> obj

Return a new object from the data at the from of the channel's queue.channel_send(cid, obj)

Add the object's data to the channel's queue.channel_list_all() -> [cid]

Return the list of all IDs for active channels.channel_destroy(cid)

Close and finalize the channel.  Afterward attempts to use the channel
will behave as though it never existed.channel_create() -> cid

Create a new cross-interpreter channel and return a unique generated ID.is_shareable(obj) -> bool

Return True if the object's data may be shared between interpreters and
False otherwise.run_string(id, script, shared)

Execute the provided string in the identified interpreter.

See PyRun_SimpleStrings.is_running(id) -> bool

Return whether or not the identified interpreter is running.get_main() -> ID

Return the ID of main interpreter.get_current() -> ID

Return the ID of current interpreter.list_all() -> [ID]

Return a list containing the ID of every existing interpreter.destroy(id)

Destroy the identified interpreter.

Attempting to destroy the current interpreter results in a RuntimeError.
So does an unrecognized ID.create() -> ID

Create a new interpreter and return a unique generated ID.This module provides primitive operations to manage Python interpreters.
The 'interpreters' module provides a more convenient interface.;`+4���|��������M���������(S��T���|���\�������-��[�����4(��P>��dI��xe�����������P��$]��8���t���Q�������,d��@��l����E������c��(
��TH���[���a�� "�LX��=���������\zRx�$����`FJw�?:*3$"D���P$\ ��iE�D�L0QAA$�a��7A�I�D bAA�p��A�Y(�s���F�K�A ��AB$����8A�I�A jAA(���B�F�A �~CB$Hh��DA�A�D {AAp���H v����RA�P�!��.Al�7���H ����EA�C����������EN
EC48����F�D�A �A(�A0j(D ABB$p���E�N�K0�AA(�����F�H�L ��AB�$��
8���vF�B�A �A(�D@a(A ABB$W��;E�E�A mAA<j��CE�wDX����B�E�E �E(�D0�D8�B@�8D0A(B BBB(����F�N�A ��AB����\(����B�E�A ��AB(����E�A�A l
AAEL8����F�O�B �A(�A0�DXn`HhMpUP.0A(A BBB$�U���A�I�A �AA����tH k(�3���B�D�I ��ABL����;F�O�B �A(�A0�DhnpHxM�U`�0A(A BBBPD���F�O�P �B(�A0�A8�FhVpMhA`�8A0A(B BBB$�[��H0{8H@MHNPU0�(�9���E�F�A �AAL����6F�N�B �A(�A0��
(C BBBEk(A BBB8<����F�O�O �A(�FP�(A ABB(x]��NB�D�C �zDBT��� F�O�I �B(�A0�A8�D�_�R�A��8A0A(B BBB,�@�zN�A�A �\
ABAzRx� ���$��+GNU�`N N@{ Ufv�#
�P0{ 8{ ���o`�
�
�H} xh��
	���o���ox���o�o����obH{ $ $0$@$P$`$p$�$�$�$�$�$�$�$�$%% %0%@%P%`%p%�%�%�%�%�%�%�%�%&& &0&@&P&`&p&�&�&�&�&�&�&�&�&'' '0'@'P'`'p'�'�'�'�'�'�'�'�'(( (0(@(P(����33V�6WV�67W� pV�6UW� �W~2�aU�1@a�W11�`sW1�`W
1``�T'0`�VWG�_�T(/_�W-B�^�U�;�]�W�C�]V? ]hV$E�\�Ue8`Y�U�<`X�W'A�W@b��������� �W�W�W�WVpV�W�W�W�W�W�WVpV�W�WVpV�W�W�W�W�W�W(�7�4 � �4�0 X)3@� GA$3a1�#�P_xxsubinterpreters.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug�w��7zXZ�ִF!t/��w]?�E�h=��ڊ�2N��� �ړ���νt"wL�,PgZ�a�W%�RCn������E�Q��ӿ�x�)gG^��Z_2�/,4{��dK��V[�r�N��"u�'�d�U��?���n��8���kO��k
���G��¸v�.3����tu�**L�)./��Y�z�2^ �����k�X��쑘ݕ��#�ԡ�SC�!����I@�.X�
�1�r!�%���`{f��neX�ӵo�Tg��_ �2�����E��yX�Q��̊�tu�B�@�}#��:�z�7ݝf:��L����@q2�B�o?+uև����@9�M "��ݮ���a��U���j�wj�8q>۲NV��Ș���ۅƕ�gq� �}����f��k�M�����.�8����ې���Ly�j�"�_b���C̼���ẳX�&�m���:G6{�y���%�w���0�5�5%'3UK�:MO�eԴ��u�J(��y<n��`�O|!�E6�O%,E~�Rlw0�S4خ�`u$�PZ++;f�M5|�·�F��:���3E��4�
�5��ܜ�G���xv6M\�,��(��~;����2\��LQe��;}��7���v���e��=}�¢@��=:�EDL��	pz۲z�{�6��
B��juҫ�/\3jRK��z݁�J��Sڰ��Wn��d�5�����-Ծ�y�Β���:�������&a�K	���/�b|�J�(H�)�T�՛�J,��/?�D�0��,)�
:^oB\=m:o��7�F7���V�]�^7�综�a�8k�_qC�H�4�2��9b�r�/��o�ؘ���c��#�uN���}A
<̅QoPs֣w!��$7[}Z/Z����t�$���{�M�
2o#�*�w���+�MF��~��(��2�2+�.���FU�l�,vP� 5[
�nu�]5�0�I�x*����Ժu��:�
\��dn����v�%8�1��~���"-������wX4����E�ԓâ"�Uk!�HE�	��`,%K%B�:���M �Oo'�(FQQ��	�Ao��n
�5���u�f���*�{lVK��{�_db¤��"Y�p5�OP�P�ri�Az�A�WDm�#b8�R�����a���JO�_> o�&�e7��OR���0h.͡h��!���Tt�e����j-���"S�м�@p=u�,	�H o��\6��Ҿ���$N)�l�g����[|
|Abc
�
�(_�۱�g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(��@0�
�
�8���o���E���oxx@T���
^Bhhxh�#�#c$$`n`(`(Pw�,�,:$}�P�P
�QQ� ��b�bd�0d0d`��k�k �0{ 0{�8{ 8{�@{ @{�H{ H{�H} H}��� �` �`� `�p �Ї``�$
��l�D4�(lib-dynload/readline.cpython-38-x86_64-linux-gnu.so000075500000101120151153537520015670 0ustar00ELF>�3@{@8	@�h�h HjHj Hj �	�	 `j`j `j 888$$�h�h�h  S�td�h�h�h  P�td ` ` `��Q�tdR�tdHjHj Hj ��GNU���T�u�G)g����M��o�@  oq��|CE��$]��qX8k���G���X&��� V5~���l���J����V B���)=, ���LF"��bs�u��=_R��s�����Hc�(��x�v�i%"I�U��-7��|�������r,�8t �t c�Kt�t __gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libreadline.so.7libpthread.so.0libc.so.6PyModule_GetStaterl_callback_handler_removesetlocalestrdupPy_FatalError_Py_SetLocaleFromEnvrl_instreamrl_outstreamrl_prep_terminalrl_catch_signalsrl_callback_handler_installPyOS_InputHookrl_resize_terminalfileno__fdelt_chkselect__errno_locationrl_callback_read_char_PyOS_ReadlineTStatePyEval_RestoreThreadPyErr_CheckSignalsPyEval_SaveThreadrl_free_line_staterl_callback_sigcleanuprl_cleanup_after_signalfreePyMem_RawMallochistory_get_history_statehistory_getstrcmpadd_history__stack_chk_failclear_history_Py_NoneStructPyState_FindModulePyArg_ParseTuplerl_line_bufferPyUnicode_DecodeLocalerl_completer_word_break_charactersPyExc_ValueErrorPyErr_SetStringremove_historyPyErr_Formatfree_history_entryPyLong_FromLongrl_completion_typerl_redisplay_Py_DeallocPyGILState_Ensurerl_completion_suppress_appendrl_completion_append_characterPy_DecodeLocalePyMem_RawFreerl_completion_matchesPyGILState_ReleasePyUnicode_EncodeLocalerl_attempted_completion_overPyObject_CallFunctionPyErr_ClearPyList_NewPyLong_AsLongPyErr_Occurredrl_insert_textreplace_history_entryPyErr_NoMemoryPyOS_snprintfPyCallable_CheckPyExc_TypeErrorrl_completion_display_matches_hookPyUnicode_FSConverterPyBytes_AsStringappend_historyhistory_truncate_filePyExc_OSErrorPyErr_SetFromErrnowrite_historyread_historyrl_read_init_filerl_variable_bindPyMem_Mallocstrcpyrl_parse_and_bindPyMem_Free_PyObject_MakeTpCall_Py_CheckFunctionResult_PyLong_AsIntPyInit_readlinerl_library_versionstrncmpPyModule_Create2PyModule_AddIntConstantrl_readline_versionPyModule_AddStringConstantPyOS_ReadlineFunctionPointerrl_readline_nameusing_historyrl_insertrl_bind_keyemacs_meta_keymaprl_completerl_bind_key_in_mapPyOS_setsigrl_attempted_completion_functionrl_startup_hookrl_pre_input_hookisattyrl_initialize_edata__bss_start_endGLIBC_2.2.5GLIBC_2.15GLIBC_2.4w ui	������ii
�ui	�Hj �KPj PKXj Xj  p �O(p cG8p �^@p �OHp F9Xp �^`p �Ohp 2@xp  ^�p �O�p ';�p �]�p O�p fF�p  ]�p �N�p �E�p �\�p �N�p �D�p  \q �Nq �Cq �[ q zN(q `98q  [@q �OHq �:Xq �Z`q UNhq �8xq Z�q �O�q ;�q �Y�q �O�q �B�q �X�q 
P�q �7�q  X�q P�q ;�q �Wr ,Pr m8r `W r 7P(r 388r W@r BPHr `JXr �V`r BNhr �8xr @V�r WP�r �=�r V�r �N�r 0:�r �U�r �N�r s@�r  U�r cP�r :�r �Ts �Qs %Cs �S s xP(s �B8s S@s �PHs �BXs R`s �Phs �7xs �Q�s �P�s @_�s  p �s `I�s �It �Ko o  o (o 0o 8o @o Ho Po Xo `o  ho #po *xo ,�o /�o 1�o 3�o 5�o 7�o <�o @�o E�o K�o L�o S�o V�o W�o \�o e�o l�l �l �l �l �l 	�l 
�l �l 
�l �l �l �l �l �l �l m m m m  m (m 0m !8m "@m $Hm %Pm &Xm '`m (hm )pm +xm -�m .�m 0�m 1�m 2�m 4�m 6�m 8�m 9�m :�m ;�m =�m >�m ?�m A�m B�m Cn Dn Fn Gn H n I(n J0n M8n N@n OHn PPn QXn R`n Thn Upn Xxn Y�n Z�n [�n ]�n ^�n _�n `�n a�n b�n c�n d�n f�n g�n h�n i�n j�n ko mo n��H��H��E H��t��H����5�B �%�B ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&�������h'��q������h(��a������h)��Q������h*��A������h+��1������h,��!������h-��������h.��������h/������h0�������h1��������h2�������h3�������h4�������h5�������h6�������h7��q������h8��a������h9��Q������h:��A������h;��1������h<��!������h=��������h>��������h?������h@�������hA��������hB�������hC�������hD�������hE�������hF�������hG��q������hH��a������hI��Q������hJ��A������hK��1������hL��!������hM��������hN��������hO������hP��������%�= D���%�= D���%�= D���%�= D���%�= D���%�= D���%}= D���%u= D���%m= D���%e= D���%]= D���%U= D���%M= D���%E= D���%== D���%5= D���%-= D���%%= D���%= D���%= D���%
= D���%= D���%�< D���%�< D���%�< D���%�< D���%�< D���%�< D���%�< D���%�< D���%�< D���%�< D���%�< D���%�< D���%�< D���%�< D���%�< D���%�< D���%}< D���%u< D���%m< D���%e< D���%]< D���%U< D���%M< D���%E< D���%=< D���%5< D���%-< D���%%< D���%< D���%< D���%
< D���%< D���%�; D���%�; D���%�; D���%�; D���%�; D���%�; D���%�; D���%�; D���%�; D���%�; D���%�; D���%�; D���%�; D���%�; D���%�; D���%�; D���%}; D���%u; D���%m; D���%e; D���%]; D���%U; D���%M; D���%E; D���%=; D���%5; D���%-; D��H�=@ �;@ H��v���L��Յ�uMH�{H��uTH�{H��u@H�{H��u)H�{ H��t	L��Յ�u H�{(1�H��t[L��H��]A\��L��Յ�t�[]A\�L��Յ�t���L��Յ�t�����H�=�? �����AWAVI��AUI��1�ATI��1�USH���dH�%(H��$�1����H�����H��uH�=��>���1�H����H�-E: H��: L9muL9 t�L�mL� �J���H��: L��L�d$0H�5S�������1��L���H�H�5LL�D$ E1�H�5�> H�t$L�D$L�=�> L;|$�!L�-r: (�*D��> A�I�}LE|$)D$ E��t��> �z���H�}�!���H�}�D$����Hc����A�@H�}A�I�ËD$�A����I��N	L�0���M��1�1ҍxL�����A������8I�E�|$H��t��E���L���~
�����'����|$����H�5�8 H�>�����A������E��������]���A������������H��= ����E��tH��1�E1����H�������M��u����I��H������H��1�L���=(9 I��I��M��M�f�taM��t\�k����hH�������	H�5}�+�== tD�
�< B�|
����������H��t�H�0L�������tL������I�|$���I��H��tH��L��L���B�D(�
B�D L���#���1�H������H������H��$�dH3%(L��t�V���H���[]A\A]A^A_���P����H��7 H�Z���QH�=�; ���H������H�xuH��7 H��3H�=�; ����H�����H�=�; H�@H����H�����H�@Z���PH�=a; ���H���d���H�=M; H�@(H��q���H���I���H�@(Z���PH�='; �R���H���*���H�=; H�@ H��7���H������H�@ Z���QH��H�N7 1�H�5������1���t
H��6 H�Z���H��H��H�5idH�%(H�D$1��7 H�T$�D$1��P�����1���tH��6 �L$H��
�6 H�L$dH3%(t���H�����H��6 H�5H�8� �����SH��H�5	H��dH�%(H�D$1�H�T$�D$������1���t^�=x: t,���H�NjX����L$�X: ��ɉL$9�%�9�}�|$����H��tH�8H�5~����
H��5 H�H�L$dH3%(t��H��[���H�?5 H�5@H�8�P�����SH��H�5L1�H��dH�%(H�D$1�H�T$������te�|$��yH��4 H�5gH�:�����E�h�H��H��uH��4 �T$H�5fH�81�����H���:���H�����H�5 H�H�L$dH3%(H��t� ���H��[���S�p����XH�����Hc�[�l�����H�4 Hc8�Y�����Hc=�4 �I�����P��H��4 H�Z�H�H�/t;H�xH����H�xH��uWH�xH��umH�x H������ �����H�D$����H�D$�H�D$����H�D$H�x(H�����H�@H�/u�H�D$����H�D$�H�@H�/u�H�D$���H�D$�q���H�@H�/�M���H�D$���H�D$�9�����AWLc�AVAUATM��US��H��8H�|$dH�%(H�D$(1�����H�-�3 H�t$ H�S3 �D$H��2 H�M��L�D�)�H�}���H�uF�,>H��tJH��Lc���H�}H�t$L�D�7�H�}L���L�EG�4(H��tH���S�H�\$ A��\$H�=�6 ���H����H�x H��t
H�u���H�=�6 ��H����H�x(H��t
H�u�i���H�=b6 ��H���e�Ic�I������H�=C6 I�G �j�H���B�Hc�H����H�|$H�5}H�E(���|$I�����L��H�L$(dH3%(t�N�H��8[]A\A]A^A_���SH��H�5���H��H��t H�x �z���H�uH����H��1 H�H��[���AUATA��USH��H�=�5 Q��H����H�hH�����7�H�5(H��A��H�[1 ��(�H�=A5 H���i�H���A�D��H��H�5&H�x1���H��H��tMH;21 t3H�5�H���9�I��H��t-H�x ��I�$H��uL������1�H�u#H���������H��t
H�uH����1�D���s�ZH��[]A\A]���AWAVAUATA��UH��SH���T$�G�Ic��D$�K�H����I��E1�L�=E9�~,A�FL��H�H�|���H��H����I�UJ��I����H�}H�5����H�=
4 H���5�H���
�D�D$H��L��H�8H�5�1��q�H��H��t%H;�/ t>H���8�H��u1��E1�H��u�"1�E1����M��tI�MuL����H��t
H�uH����|$H��[]A\A]A^A_�>���SH��H�5'��H��H��t H�x ��H�uH���<�H�]/ H�H��[���UH��H�5#SH��(dH�%(H�D$1�H�L$H�T$����t�|$yH�x. H�5!H�:�9�1��vH�|$H�5�
��H��H��t�|$1�H�p ��H�MH��uH����H��uH� . �T$H�5�H�81����H����H���i�H��. H�H�L$dH3%(H��t��H��([]�H��t-H�=�2 �/�H��- H�I. H�-�2 H�*H��>	X[]��AVH��I��H�
AUATI��UH���PSH��pH�. dH�%(H�D$h1�L�l$L��H�\$��H�T$L��L��1��g�1Ʌ�tqH�|$H9�uH�}H��tXH�EH�uK�#���t!H�T$H�}H�H�UH��t+H�u&�W��H��, L��H�5�H�81����1��H�H��H��H�L$hdH3%(t�x�H��p[]A\A]A^���SH�=�0 H���'�H����H��H�=S
[H�p������SH�=�0 H����H�����H��H�=�
[H�p�����SH�=�0 H�����H����H��H�=a
[H�p�u�����SH�=o0 H����H���o�H��H�=H���G���H�=F0 H���n�H���F��H�
�+ H�8H�����HD�H�H��[���AUH��H�5-ATUSH��(H�, dH�%(H�D$1�H�L$H�T$H�\$����u1��H�|$H9�tH�t$�����t�H�|$��I���H�D$E1�|$L���v�����I�ʼn(��u�5�+ ��xL���4�H�|$H��t
H�u�P�A�m��tH��* H�8�)��H�H��H�T$dH3%(t�|�H��([]A\A]���AUH��H�5C
ATUSH��(H�+ dH�%(H�D$1�H�T$H�\$����u1��H�|$H9�tH�t$�����t�H�|$��I���H�D$E1�L���������I�ʼn(��u�5�* ��xL���;�H�|$H��t
H�u�W�A�m��tH��) H�8�0��H�H��H�L$dH3%(t��H��([]A\A]���ATH��H�5`	USH�� H�#* dH�%(H�D$1�H�T$H�\$����u1��|H�|$H9�t?H�t$�����t�H�|$��I����L��H����H�|$�EH�u�����1�H���l��E�t��8tH��( H�8�P��H�H��H�L$dH3%(t��H�� []A\���ATH��H�5�USH�� H�E) dH�%(H�D$1�H�T$H�\$����u1��H�|$H9�t?H�t$����t�H�|$�1�I�����L��H����H�|$�EH�u�����1�H�����E���8tH��' H�8�o��"�=�, uH�5�H�=���H�H��H�L$dH3%(t��H�� []A\���USWH��H�5��g�H��H��t]H�@H�x��H��H��uH�uH����Y[]��H�s H����H�uH�����H���d�H���|�H��' H�H��Z[]�U1�SQH����H�GH��1�H�P8���t	H�,H��uH��1�1����H���1�1���H��1�H����H��H��t(H;�' tH���a����u��H��u�1��1��S�H��t
H�uH���!���Z[]���USP���H�=+ ���1�H���	�H�x�5����������Z[]���USP��H�=�* ����H�����H�x�������}���Z[]��+ H��H��* ��1��s������H�=����H�+t1���H��1��Q���f.�f���ATI��UH��S�=�H�8H��H���|�H�xH�����H�xH�����H�xH�����H�x H���~�L��Յ����H�{(H�����[L��H��]A\��@��H�����H�8H���D�H�xH�����H�xH�����H�xH�����H�x H��tH�@ H�/�[�H�x(H��tH�@(H�/�%�1�H�����UH��H�5�SH���g�H��H��tOH�x �&�H�+H������H����H�����H�=a) ���H�
% H��$ H�-G) H�H�(H��H��[]�fDH�=!) H�) H9�tH�n$ H��t	�����H�=�( H�5�( H)�H��H��H��?H�H�tH�=$ H��t��fD�����=�( u+UH�="$ H��tH�=� �i��d�����( ]������w�������7������AV�H�5.AUATUH�-�# SH�}����������=5( ������H�=�' ���H��H���4����H�5$H����������H��# H�5H��Hc�������H�UH�5H�����������H���F�H�5# H�
�1�I��H�1����H���!�H��H�������H�=F# L���=l' L��i���H�=�������H��A��E��D�7' ����H�5�" �	���L�5
" �	L�-I" L��L���F�L��L���6�H�5����E�H�=^" L��" H�
��H�9" H�5'���H��& H�S���H�H�=�I�H�2�/�L��! 1�H�& I����1�I�D$ ����=p& I�D$(�_�����o���u H�5SH�=�����==& �1������=+& uH�5%H�="��1�H���@�H����H��[]A\A]A^���H��H���p:set_auto_historyi:set_history_lengthsurrogateescapei:get_history_itemi:remove_history_itemNNiiU:replace_history_item|O:set_%.50si|O:append_history_file|O:write_history_file|O:read_history_file|O:read_init_fileoffenable-bracketed-paste_READLINE_VERSION_READLINE_RUNTIME_VERSION_READLINE_LIBRARY_VERSIONpython1enable-meta-keyparse_and_bindget_line_bufferinsert_textredisplayget_current_history_lengthget_history_lengthset_completerget_completerget_completion_typeget_begidxget_endidxset_completer_delimsadd_historyget_completer_delimsset_startup_hookset_pre_input_hookclear_historyreadlinenot enough memory to save localeHistory index cannot be negativeNo history item at position %dset_%.50s(func): argument not callablecompletion_display_matches_hook 	
`~!@#$%^&*()-=+[{]}\|;:'",<>/?set_completion_display_matches_hookclear_history() -> None
Clear the current readline history.set_pre_input_hook([function]) -> None
Set or remove the function invoked by the rl_pre_input_hook callback.
The function is called with no arguments after the first prompt
has been printed and just before readline starts reading input
characters.set_startup_hook([function]) -> None
Set or remove the function invoked by the rl_startup_hook callback.
The function is called with no arguments just
before readline prints the first prompt.set_completion_display_matches_hook([function]) -> None
Set or remove the completion display function.
The function is called as
  function(substitution, [matches], longest_match_length)
once each time matches need to be displayed.get_completer_delims() -> string
get the word delimiters for completionreplace_history_item(pos, line) -> None
replaces history item given by its position with contents of lineremove_history_item(pos) -> None
remove history item given by its positionadd_history(string) -> None
add an item to the history bufferset_auto_history(enabled) -> None
Enables or disables automatic history.set_completer_delims(string) -> None
set the word delimiters for completionget_endidx() -> int
get the ending index of the completion scopeget_begidx() -> int
get the beginning index of the completion scopeget_completion_type() -> int
Get the type of completion being attempted.get_completer() -> function

Returns current completer function.set_completer([function]) -> None
Set or remove the completer function.
The function is called as function(text, state),
for state in 0, 1, 2, ..., until it returns a non-string.
It should return the next possible completion starting with 'text'.get_history_length() -> int
return the maximum number of lines that will be written to
the history file.set_history_length(length) -> None
set the maximal number of lines which will be written to
the history file. A negative length is used to inhibit
history truncation.get_current_history_length() -> integer
return the current (not the maximum) length of history.get_history_item() -> string
return the current contents of history item at index.append_history_file(nelements[, filename]) -> None
Append the last nelements items of the history list to file.
The default filename is ~/.history.write_history_file([filename]) -> None
Save a readline history file.
The default filename is ~/.history.read_history_file([filename]) -> None
Load a readline history file.
The default filename is ~/.history.read_init_file([filename]) -> None
Execute a readline initialization file.
The default filename is the last filename used.redisplay() -> None
Change what's displayed on the screen to reflect the current
contents of the line buffer.insert_text(string) -> None
Insert text into the line buffer at the cursor position.get_line_buffer() -> string
return the current contents of the line buffer.parse_and_bind(string) -> None
Execute the init line provided in the string argument.Importing this module enables command line editing using GNU readline.Importing this module enables command line editing using libedit readline.EditLine wrapper��;�/���������������@O��l_��������������M�����,���D&��\@��p�����������������������P���x������������dS��@��z�u�L��h�����m��o��h�,F�\C�����e�������@���� @����d��8zRx�$��� FJw�?:*3$"D���\���(pD�|F�D�D �cGBzRx� ���($���qB
GBBJ
ABA����H����=F�B�E �G(�F0�A8�G�8A0A(B BBBH���EP`���aE[x��:Et�1��:Et�S��1Ek�l��nH e���������E�N �A^�� d���E�P �A@���E�T\���p�������EP���}H tzRx� ������	H�~���F�E�B �B(�D0�A8�Fp~8A0A(B BBB@���AE�{4\���F�B�D �A(�K0�(D ABBH����*F�B�B �B(�D0�D8�DP8A0A(B BBB����AE�{$�����E�K�D@�AA$$��zE�K�D `DAzRx� �� L��:sAA@�j���B�O�B �D(�I0�D��0A(A BBB�!��0E�b�5��0E�bI��0E�b]��hE�b48���F�L�A �A(�DP�(A ABB4ps���F�L�A �A(�DP�(A ABB,�4���F�K�A �D@� AAB,�����F�K�A �D@� AAB0����E�A�A z
AAEwAA$<����A�C�A �AA$du�:E�A�A pAA$���:E�A�A pAA8�P�tF�N�B �A(�H0�M(A BBB zRx�0�����(9�[GNU��KPKXj Ufw��)
$NHj Pj ���o``
�
pl ��!�@	���o���oP���o�of���oZ`j �)�)�)�)** *0*@*P*`*p*�*�*�*�*�*�*�*�*++ +0+@+P+`+p+�+�+�+�+�+�+�+�+,, ,0,@,P,`,p,�,�,�,�,�,�,�,�,-- -0-@-P-`-p-�-�-�-�-�-�-�-�-.. .0.@.P.`.p.�.�.�.�.�.�����OcG�^�OF9�^�O2@ ^�O';�]OfF ]�N�E�\�N�D \�N�C�[zN`9 [�O�:�ZUN�8Z�O;�Y�O�B�X
P�7 XP;�W,Pm8`W7P38WBP`J�VBN�8@VWP�=V�N0:�U�Ns@ UcP:�T�Q%C�SxP�BS�P�BR�P�7�Q�P@_0 p `I�I�KGA$3a1�)1Nreadline.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debugy�ұ�7zXZ�ִF!t/��G]?�E�h=��ڊ�2N��3.������.�!���%3��/���)�%7
1�3w<+6K���a�M77W��I7��K1�2\��2fA�|f
7b�虢6����SE��~-������䊂7����+hW�SK�1���?X2����1;�)�J��i�+�����!�,z̍!��:>�C�h�ۧ<�N�v�(�]p0�ۍ�ۢ�~`����i�&`d�M#xCR��3�䊕̩>������AUx��
~̵x*����}���tj5�3J��Ӵ�%R#�4l�Ve	%�v}]��o�+: �qi�T>7�CT?�_0�Y`�EEZy�9!��#O˳
!�B�J�'��r�~u����B3J��m���\"bԖ;�9�
��9#�l�|DZv�[ɧ�񠗦��`�s�,��9&M�f<�n;l�Y����}����ʣ���+��
a:�Q�[|����x�o�:К�Q͏��eGX�H��ѡ#%Ki0e:n��2��B�)ɷ�Vܩ�,��^O����ig	���~uw�	���W5�����8\V^���7��2'���o7,U��1d�u��Jݦ�f��`�7�{�������T��
`]�R��a�n���<Z��B����J���l{�u�=pS����*���Q��N�FJ_e2geb��)I!����AD���vA��6�
ޛ�,�#j43	t�6a�%P"'�OCȹ?� H����5.��m���
�bF�O/�Ao�3K�X�߀������M܃���aP�.#,x:s��J?�?z�to�u�d?�h�*g�k�&�xGD��OJ�|����39�-(��,
�oY�gg�07�Y*D�^��e�Kd[<�7Ϝ�XH�Q�i��8]dSW��J8���>�nIi�#d�;gL�i��Q+O�ɂ��On��@lq|�º v�0�^׼�4Ȋ��W��u��*�~)��F"k�vV���{v<�$b~����G��h�9�)�(:a�v�_-�i��wC>?L��H��M9rR��SV�R[�xs�wK�2�7�)�d�K{��c�Sx�f���隄�sT�-�F;��p0g�U����L�:�l��O�$DP���n��d�csu������^�f�L@�"3;k9C5m��˅$e�^��5�C�ve�A�c2�ԡN�����eJ_�:�S��+sO��c���"?��	�'qM4���	��z�7�����fCy���wW�T�r�g��\�1��7�BI�KbV�+x�u��
�*�9Uñ�g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(���
0`
`
8���off�E���oPP`T��@^B�!�!�h�)�)c�)�) n�.�.w�3�3D}$N$N
�@N@N� � ` `���a�a(��h�h �Hj Hj�Pj Pj�Xj Xj�`j `j�pl pl��p p �t t0�8t`t$
,t`�t\�y(lib-dynload/_uuid.cpython-38-x86_64-linux-gnu.so000075500000016400151153537520015220 0ustar00ELF>�@�@8	@XX h
h
 h
 @H �
�
 �
 888$$888  S�td888  P�td8
8
8
44Q�tdR�tdh
h
 h
 ��GNUv�pe�h�
}�l�xn9���@ �
��|CE���qX��� � , F"���� � 
� � ��	C__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libuuid.so.1libpthread.so.0libc.so.6uuid_generate_time_safe_Py_BuildValue_SizeT__stack_chk_failPyInit__uuidPyModule_Create2PyModule_AddIntConstant_Py_Dealloc_edata__bss_start_endUUID_2.20GLIBC_2.4GLIBC_2.2.5f �+�
%�ii
/ui	9h
 �	p
 p	x
 x
  
 �h 1
�  � � � � � � � � � � 	� 
��H��H�i H��t��H����5 �% ��h�������h��������h�������h�������h�������h�������h��������%� D���%� D���%} D���%u D���%m D���%e D���%] D��SH�� dH�%(H�D$1�H��H������H��H�=^��1����H�T$dH3%(t�_���H�� [�H�+t1��H��1��R����f.�H�=� H�� H9�tH�� H��t	�����H�=q H�5j H)�H��H��H��?H�H�tH�� H��t��fD�����=- u+UH�=r H��tH�=� ����d���� ]������w������S��H�=o �z���H��������H�5*H��H������������H��[���H��H���y#ihas_uuid_generate_time_safe_uuid;4X���P���xH��������������zRx�$����FJw�?:*3$"DX���p\����WE�D0LA|���CE�}zRx�� ����GNU��	p	x
 Ufs�h

h
 p
 ���o`�
E� ���	���o���oh���o�oF���o�
 ������
�1
�������� GA$3a1h
_uuid.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debugpb0�7zXZ�ִF!t/��o)]?�E�h=��ڊ�2N����N ����jf��y�򸗨��F{���7��52�j�`pbҫ:����ر�ć	���L&�%stlz�t�&dh۴��U��_��
�¦�D���xF]����%�J<Uz�5�56�Z����{/�]
�}�^I��NmM+M`l)<2E�os�y�e�	�?m0jS�<��	<�Qo�����Z��BʔW�1�.��7�OƝ�e�~n�͌�n��@�ފ��V�����hI1Q��&N�G��
vVj#nu�.����H�ѹ]E�^�p	��$%IF�&�ޑH�q�~۹���a�Y!:\9$j�&�;q5���M�u؛�H�9k-�`�`�����Z��9�q��TL����-d������i!����;�ݷ��:�ܲ�HP��ui���ȜFD�װ(I��)`SY�,j2c"Ij�SH2��~���b�X�Ęf\'6H�ŦI����-�9x�W~h`��:�j���8����o�0�!�h=ܿwK�o���Cg�i�Z�i���is��a	�)No2H���L���c(�7f�$\�������T������&=ňf��	f��؉��s2���=��'�~˻ 70���
@lK�
b!���k����O����PS��p�;S�B�
?���Pk�㓗L;�?��r�V�1��+k��cPr8:$�Y߻���}�ـ��h[j`�A�<�.�D0�������\�hPS��!'iq���W��T����~�*�E�-�� 8�����lz('S,���������j���g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(��h0E8���oFFE���ohhPT��^B���hhhc���npw���}


�2

&�8
8
4�p
p
��88 �h
 h
�p
 p
�x
 x
��
 �
�� �p� � �� ���`�$
�\(l�(lib-dynload/_hashlib.cpython-38-x86_64-linux-gnu.so000075500000204430151153537520015666 0ustar00ELF>�4@�@8	@���� P�P� P�  �� � 888$$������  S�td������  P�td�����Q�tdR�tdP�P� P� ��GNU*P��>e��Xd�V�°Y�@ 	Y\ڐ3��|CE���qX���U���,�{�A ������2dv���W
	:gG ��UF� ��, )�F"?���-6���6�o-��t�|TB��X�h����"L�n���_p���h� �`� �`� __gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libssl.so.1.1libpthread.so.0libc.so.6ERR_peek_last_errorPyErr_SetStringERR_clear_errorERR_lib_error_stringERR_func_error_stringERR_reason_error_stringPyErr_FormatFIPS_modePyLong_FromLongEVP_MD_CTX_mdEVP_MD_sizeEVP_MD_block_sizeEVP_MD_CTX_freePyObject_FreePyThread_free_lock_PyArg_UnpackKeywordsPyObject_GetBufferPyBuffer_IsContiguous_PyArg_BadArgumentPyUnicode_AsUTF8AndSizePyExc_ValueErrorEVP_get_digestbynamePyExc_OverflowErrorPyEval_SaveThreadPyEval_RestoreThreadPyBytes_FromStringAndSizePyBuffer_Release__stack_chk_fail_PyObject_NewEVP_MD_CTX_newEVP_MD_CTX_copyPyThread_acquire_lockPyThread_release_lock_Py_DeallocPyErr_NoMemoryPyLong_AsUnsignedLongEVP_PBE_scryptPyFloat_TypePyType_IsSubtypePyLong_AsLongPyErr_OccurredPyExc_TypeError_Py_NoneStructstrlenPKCS5_PBKDF2_HMACEVP_MD_typePyUnicode_FromStringPySet_AddOBJ_nid2lnOBJ_nid2snEVP_DigestFinal_Py_strhexEVP_DigestUpdatePyThread_allocate_lockPyExc_BufferErrorPyObject_IsTrue_PyArg_Parse_SizeTEVP_DigestInit_exEVP_MD_CTX_set_flagsstrcmpEVP_shake256EVP_sha3_256EVP_sha3_224EVP_sha512_256EVP_sha512_224EVP_sha3_512EVP_sha3_384EVP_shake128EVP_blake2b512EVP_blake2s256PyUnicode_FromFormatEVP_sha512EVP_sha1EVP_sha224EVP_sha384EVP_sha256EVP_md5PyInit__hashlibPyType_TypePyType_ReadyPyModule_Create2PyFrozenSet_NewEVP_MD_do_allPyModule_AddObject_edata__bss_start_endGLIBC_2.4GLIBC_2.2.5OPENSSL_1_1_1OPENSSL_1_1_0�0ii
�ui	�Um�mP� `�X�  �`� `� �� j��� ���� j��� ���� j��� ���� j��� ��� j�� �� � j�(� ��@� j�H� ��`� j�h� ���� j��� ���� j��� ���� j��� ���� j��� ��� j�� �� � j�(� ��@� �H� 	�P� ʱ`� 
�h� �p� (�x� ���� ��� ��� $��� *��� 
��� ��� 4��� $��� /��� j��� ��� ɳ� �e� `� � ʱ(� �c8�  �@� гH� �dX� ��`� ڳh� @Tx� ���� ߳�� �S�� ��� �S�� /��� n� ��@� �H�  hX�  �`� �h� @\x� `��� Z��� �T�� ���� 
��� �S�� ���� ű�� D5�� `��� ��� ��� ��� $�� `z�  � � 1�(� �~8� ��@� @�H� ��X� �`� O�h� 0�x� @��� ^��� �u�� ���� m��� p��� ��� }��� Ц�� `��� ���� �o�� ��� ��� 0��  � � ��(� P�8� ��@� ��H� НX� �`� Ѵh� �x� @��� ��� p��� ���� ?�� @� H�  � P� ��� � �� $��� �� �� 1�� �� � @�H� �� P� O��� �� �� ^�� `� � m�� @� � }�H�  � P� ���� � �� ��� �� � ��� �� � ��H� �� P� Ѵ�� �� �� �� �� � �� �� � �H� `� P� Z��� @� �� ű� H�� T� tp� ���� � �� �� �� 	�� 
�� �� "�� (�� +�� ,�� .�� :�� @�� A(� 0� 8� @� H� P� X� `� h� 
p� x� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� � �  � !� # � $(� %0� &8� '@� )H� *P� -X� .`� /h� 0p� 1x� 2�� 3�� 4�� 5�� 6�� 7�� 8�� 9�� ;�� <�� =�� >�� ?�� B�� C�� D�� E� F� G� H� I � J(� K0� L8� M@� NH� OP� PX� Q`� Rh� Sp� Tx� U�� V�� W�� X��H��H��� H��t��H����5B� �%C� ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&�������h'��q������h(��a������h)��Q������h*��A������h+��1������h,��!������h-��������h.��������h/������h0�������h1��������h2�������h3�������h4�������h5�������h6�������h7��q������h8��a������h9��Q������h:��A������h;��1������h<��!������h=��������h>��������h?������h@�������hA��������hB�������hC�������hD�������hE�������hF�������hG��q������hH��a������hI��Q������hJ��A������hK��1������hL��!������hM���������%]� D���%U� D���%M� D���%E� D���%=� D���%5� D���%-� D���%%� D���%� D���%� D���%
� D���%� D���%�� D���%�� D���%� D���%� D���%ݼ D���%ռ D���%ͼ D���%ż D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%}� D���%u� D���%m� D���%e� D���%]� D���%U� D���%M� D���%E� D���%=� D���%5� D���%-� D���%%� D���%� D���%� D���%
� D���%� D���%�� D���%�� D���%� D���%� D���%ݻ D���%ջ D���%ͻ D���%Ż D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%}� D���%u� D���%m� D���%e� D���%]� D���%U� D���%M� D���%E� D���%=� D���%5� D���%-� D���%%� D���%� D���%� D���%
� D���%� D���%�� D���%�� DAUATUSH��Q�Q���H��uH�5�|H���=����uI������L�����L��H�����L��I������I��H��tM��tL��H��H�5�|H��1�����)H��tL��H��H�5y|H��1��c����L��H������Z1�[]A\A]���AVI��AUATUSH��H�ֺH��H�� dH�%(H��$1�L�d$`H�l$L���H��H���M��uH��~H��H��u9WA�H��L��1�L��$�APL��� jj����H�� H��H����H�;1�L�����������CL�������u$H�H��{H�5�{1�H�=�{�Z�����H�{1�H������A�Ņ��J�CH���_�����u%H�KH�D{H�5j{1�H�=U{�����{H�KH�q���u!H�N{H�5K{1�H�=#{�����IH�t$H���W���I��H����H��1�L���I��I��I��L;\$tL�5�� H�5{1�I�>�����L��$�D���D$L���L�����H��H��uL�g� H�5�zI�;����H�|$p���~L�
�� H�5�z1�I�9����H�|$ ���~L�i� H�5�zI�8�r���1��c����H��M��I��PL�T$ARLcD$0H�L$ ��$�H�t$p�m���ZL��YH���`���H��uH��� H�:�����t$L���^���H��H�|$htL���K���H�|$tH���;���H��$dH3%(H��t��H�� []A\A]A^��+���H�}�I���:���L������H�uL������H�}H���)�TH�+uH���6����1���1��H�+uH������H�� H�8H��[]A\A]���L�-� �� L�=� � L�-� H�5�y1�I�}�����?L�=� H�5�y1�I�?����"L�=ɶ �n H�D$@L�-�� M���sL�-�� �{ H�MH�YxH�5�x1�H�=�x� �����H�MH�4xH�5�x1�H�=�x����L�5O� ��H���KL�5� H�5�{1�I�>�J����wH�muH�����H�ǵ 1�H�8�����RH�D$@L�-� �L�5� �`H�-�� H�5I{H�}1�����H�D$@L�-�� �sH�D$@L�-�� M���[H�MH�MwH�5�w1�H�=�x�����$H� � H�5ww1�H�:�w�����$L�%� H�5�z1�I�<$�Y����$L�t$�%L�t$��%H�muH����L�
´ 1�I�9����$H�=�� H�5x1�H�?�����f$L�ߴ H�5�w1�I�:����I$L�´ H�5�w1�I�8�����,$L�-�� H�5Rw1�I�}����$H�MH�?vH�5�v1�H�=�w������#�E��&�EH�+��&XH��[]�������b���H���&H�۳ 1�H�8�����S(���1��G(H��� H�:���H���0(�|���H�}�I�����L���#���H�uH���'���H�}H����'�5(H�f� 1�H�8�d�����(�z���(H�F� H�:�F���H���(�	���H�}�I������L�����H�uH�����H�}H���=(��(L�� I�8��H�}�*���L���r���L�����1��*L�
� H�5�zI�9����L���e�����L��� H�55zI�:����L��� H�5�yI�;����H�
t� H�9�t���L�������H�\$ �*RA�L�r� 1�H��H��H�T$xR1�jj�9���H�� H����L�(H����1�H�|$ ��H�T$H�5tL��������:0�D$L�|$L���!�H��H����L�l$0L�|$ I��1�H�=ߺ ��H��H����H�@��H��H�EH��tC�|$��+�5,1���+L��� H�50y1�I�:����L�������+1��+H�muH���c����^�1��v+H�(� H�8�(���H�mt1��Y+H��1��0����J+��-H�5�� H�>���H�|$�}�H�mu�H��1����+��I��L�l$0L�|$ M���������.H��� H�:������I�������I�����-���I������I����Y�I�����I������I�����1��*H�XH���[)H���Q)�B+��I���]�����I���P���L� � H�5�w1�I�;�g��S*���k�H����.H�+uH������1��y2L�-گ H�5[w1�I�}� ��m21��f2H�ů H�5fw1�H�:��L���D��A2L�5�� I�>��H�+��1��2RE1�L�� 1�H��H��H�L$hQ1�jj�K�H�� H���#11���1VE1�L�̵ 1�H��H��H�T$hR1�jj��H�� H����0��L�%�� I�<$���L���|�H�+�l���H��1����s1H�5Į H�>�����1��m1H��1�����L1H��H���3���
�H���r3WE1�L�g� 1�H��H��H�T$hR1�jj�n�H�� H���}61��,6L�-K� I�}�J�L�����H�+t*1��5H��H�+�	H�D$1��<�H�l$��5H��1��(���51���5H�

� H�5�u1�H�9�D�L�����5L�5ȭ I�>���H�+u�H��1�����s5RE1�L��� 1�H��H��H�L$hQ1�jj��H�� H����5����1��H5H�5g� H�>�g�� ���H���(���H�=K� H�5�o1�H�?���5L�%>� H�5�t1�I�<$����4H��H�D$�2�H�D$���WE1�L�ݱ 1�H��H��H�T$hR1�jj���H�� H���s:1��,9H��H�+�*H�D$1����H�l$�8L�-�� I�}��L���%�H�+��1���81���8L�5n� I�>�n�H�+u�H��1��~��8L�%j� H�5t1�I�<$��L������8H�4� H�5�sH�;1��{��r81��k8H�5� H�>���f���H�=� H�5[n1�H�?�C��:8H��1�����8RE1�L��� 1�H��H��H�L$hQ1�jj��H�� H���C9����H��H�D$��H�D$���H�����H��H�+�`H�D$1���H�l$�<WE1�L�l� 1�H��H��H�T$hR1�jj�3�H�� H���">1���;RE1�L�4� 1�H��H��H�L$hQ1�jj��H�� H����=��H���m���L�-ժ I�}���L���\�H�+tC1��i;1��t;H�5�� H�>����1��\;H��� H�5"rH�;1�����?;H��1����;L�5e� I�>�e�H�+u�H��1��u��:L�%a� H�5r1�I�<$��L�������:H�=� H�5�l1�H�?�r���:H��H�D$� �H�D$���H��H�+�`H�D$1���H�l$��>WE1�L�h� 1�H��H��H�T$hR1�jj��H�� H���A1���>RE1�L�0� 1�H��H��H�L$hQ1�jj�w�H�� H����@��H���m���L�-Q� I�}�P�L�����H�+tC1��U>1��`>H�5%� H�>�%���1��H>H�� H�5�pH�;1��d��+>H��1����
>L�5� I�>���H�+u�H��1������=L�%ݨ H�5~p1�I�<$��L���[���=H�=�� H�5k1�H�?����=H��H�D$��H�D$���H��H�+�`H�D$1��y�H�l$��AWE1�L��� 1�H��H��H�T$hR1�jj�+�H�� H����C1��ARE1�L�l� 1�H��H��H�L$hQ1�jj���H�� H����C��H���m���L�-ͧ I�}���L���T�H�+tC1��AA1��LAH�5�� H�>����1��4AH��� H�5oH�;1�����AH��1����@L�5]� I�>�]�H�+u�H��1��m���@L�%Y� H�5�n1�I�<$��L������@H�=� H�5�i1�H�?�j��@H��H�D$��H�D$���1��DL�-ئ I�}���L���_�H�+t1��DH�5�� H�>����H��1�����DH��� H�5i1�H�8����DI��H�+uH������L��1��aDI����VE1�L��� 1�H��H��H�T$hR1�jj�<�H�� H���[F1��6DRE1�L��� 1�H��H��H�L$hQ1�jj��H�� H���(F��L�%�� H�5wm1�I�<$�<���C1���CL�5�� I�>��H�+���H��1�����CH��� H�5Zm1�H�:���L���8��CH�+uH������1���GL�5Z� I�>�Z�H�+t1��GH��1��c��GL�-?� H�5�l1�I�}���G1��GH�*� H�5�l1�H�:�a�L�����fG1��_GL�%ޤ I�<$���L���e�H�+�w���H��1�����GH�5�� H�>����RE1�L��� 1�H��H��H�L$hQ1�jj��H�� H���?G1���FVE1�L�H� 1�H��H��H�T$hR1�jj�O�H�� H����F��H�+uH���R��M�1��6LL�-'� H�5�k1�I�}�m��*L1��#LH�� H�5�k1�H�:�I�L�����KL�5ͣ I�>���H�+��1���KRE1�L�Q� 1�H��H��H�L$hQ1�jj��H�� H����J1��KVE1�L�� 1�H��H��H�T$hR1�jj�`�H�� H����J��L�%B� I�<$�A�L�����H�+�l���H��1��E��0KH�5� H�>����1��*KH��1����	KL�
� H�5�j1�I�;�A�L�����FNH�բ H�5Vj1�H�:���)N1��"NVE1�L�Ũ 1�H��H��H�T$hR1�jj��H�� H���;N1���MRE1�L��� 1�H��H��H�L$hQ1�jj�T�H�� H���N��H�6� H�5�d1�H�8���ML�5� I�>��L����H�mt 1��cM1��nML�%� I�<$�����H��1����;MH�muH��������1�� MH�5�� H�>��H�mu�H��1����LH�+uH������1��qRL�-�� H�5i1�I�}����eR1��^RH�m� H�5i1�H�:��L������9RL�5(� I�>�(�H�+��1��RRE1�L�l� 1�H��H��H�L$hQ1�jj���H�� H���Q1���QVE1�L�4� 1�H��H��H�T$hR1�jj��H�� H����P��L�%�� I�<$��L���$�H�+�l���H��1����kQH�5l� H�>�l���1��eQH��1��y��DQH�+uH���f��a�1��UL�-;� H�5�g1�I�}���U1��UH�&� H�5�g1�H�:�]�L�����rUL�5� I�>���H�+��1��@URE1�L�� 1�H��H��H�L$hQ1�jj��H�� H���TT1��UVE1�L��� 1�H��H��H�T$hR1�jj�t�H�� H���T��L�%V� I�<$�U�L�����H�+�l���H��1��Y��TH�5%� H�>�%���1��TH��1��2��}TL�� H�5�f1�I�;�U�L�����WH�� H�5jf1�H�:�0��W1��WVE1�L�� 1�H��H��H�T$hR1�jj��H�� H����W1��^WRE1�L�� 1�H��H��H�L$hQ1�jj�h�H�� H����W��H�J� H�5�`1�H�8���WL�5-� I�>�-�L����H�mt 1���V1���VL�%� I�<$����H��1����VH�muH�������1��VH�5ŝ H�>���H�mu�H��1�����oVH�+uH�������1���[L�-�� H�5e1�I�}�����[1���[H��� H�5"e1�H�:��L�����[L�5<� I�>�<�H�+��1��{[RE1�L�� 1�H��H��H�L$hQ1�jj��H�� H����Z1��U[VE1�L�ȣ 1�H��H��H�T$hR1�jj���H�� H���NZ��L�%�� I�<$��L���8��H�+�l���H��1�����ZH�5�� H�>����1���ZH��1����ZH�+t+1��]H�<$H�/u�l�H�+u�H��1��\���]H��1��M���]���H����H��Hc��������H��H����H�����H��Hc����ff.���H��H��O��H������H��Hc��{��ff.���SH��H�H��uH�{���H��[���ff.�f������f���AUATUH��H�=m� SH�����H��H��tCH�@�.��I��H�CH�����H�}H��u5H�uL�����H�}H��u0�����H��H��[]A\A]�f.�1�������u��p��D$����D$���AWAVAUI��ATUH��SH��dH�%(H��$�1�H���of�H��L�aH��)D$hA�L��)D$xI�1�)�$�I�\$�)�$�)�$�)D$)D$()D$8)D$H)D$XL��$�APL��� jj���H�� H��H����L�|$`H�81�L���P�����x�CL���������s�H���6H�}H���UH�\$1�H��������6�CH��������V�L��H����L�uM���a�M�^A�����L��H�����L�}M�����I�W����<L��H���m�L�m M�����I�}����H�D$@L��H���H�|$p�����H�l$H���H�|$ ���� �L�����I��H�����H���?L�H�I���2L���i��I��H����bL���T��I��H����"H�������L�T$I��I������0jM��M��1�j1�1�1�SAW���H�� ����L�l$1�L������H��H��������L�] M��M��H�D$AUASSAWH�L$@H�T$0H��$�H��$��)��H�� H�|$���Y����uW���L�%� 1�L�E0I�xL9���L����������H�}0�m��H�D$H����������H���w���1�H�|$h�-H�|$`���H�|$t
H�|$���H��$�dH3%(H����H��[]A\A]A^A_�H�Z�L�t$`�1�L��H��L�d$�L��H���M���4I���*H���!H�}1�L���+�����S����CL���������N�H���H�}H��t41�L�������������CL��������:�L��H����L�uM�����M�NA����mH����L�}M���[��M�WA����"H����L�m M���&��I�E�����H�D$@H�����H�M(H������H�yL�%�� L9�����L������������H�}(���H��H���uH�D$���H������H�t$H���v��H�D$@H���v���L�
`� H�5�X1�I�9������H�C� H�5\1�H�:�������H�|$��������H�=� ����1�1�H�5�[H�?������L��H��WH�5�W1�H�=�W����n���L��H��WH�5�W1�H�=|W����J���PH��A�1�L�E� 1�H��$�VL��jj���H�� H��H��������	���H�
j� ����1�1�H�5�ZH�9�J������p��H������L�H� H�5yZ1�I�8�������E��H�������L�%� H�5Z1�I�<$�c�����L��H��VH�5�V1�H�=�V����l���L�ۓ H�5�VI�:�$���Q�������H���B���L�5�� H�5�Y1�I�>����&���L�-͓ 1�H�D$@M��M���~�����������������AWAVI��H��AUATUH��SH��dH�%(H��$�1�H���f�)D$p)�$�)�$�)�$�)�$�)D$ )D$0)D$@)D$P)D$`I������I������H������H�>H�G����tH�t$���I��H����H������H;D$�[��L�d$pH�}1�L���������T�CL���r�������L�l$ H�}1�L��������$�CL���B��������H�MH�5G� H�yH9�����-��������H�}����H��H�����I����L��H�m ���I��H���qH��$�����W��H�|$0������H���*H���������H;-ϑ ��L���A��Hc�I��H����1����H��H���D�*��H�u A��M��H�D$VAWH��$��L$@H�T$0��$��k��Y^H�|$��������5��H�|$x��L�����H�|$(tL�����H��$�dH3%(H���
H��[]A\A]A^A_�DH�����I��H����H���H=������H��1��<��H��H���e�K��H�U M��A��RI��AWH��$��L$@H�T$0��$����L��A��XZ����E���X��H�|$xt
H�|$p����H�|$(�)���H�|$ �������L�t$�!��H����H��H�|$����L��� ��I��H��t|H��$�����b��H�|$0������H��~9H����������������H��u{H�
�� H�5�V1�H�9�����A���H�j� H�5{V1�H�8����$���L�M� H�5�Q1�I�;�������H��H�uQH�5{R1�H�=�R������1������H�Y1�H�|$pH���H�|$ H��L��H�\$WH��H��A�1�L��L��$�APL�*� jj���H�� H��H��t�H�8L�OA����a���H�t$���I��H���o���H��1�L���I��I��I��L;T$�;��L�d$pH�}1�L��������4����CL���R��������L�l$ H�}1�L������������CL���"��������L�]H�5'� I�{H9������
��������H�}���H��H������������E��D��H��u�fDUH��SH��������=!�S�H�=?R=�t1��H�=R��@tH�=R=�tH�=�Q������[��H��H�����H�}H����������H�+��H��[]�f.�H�=R=It��|H�=R=Kt�H�=�Q|�H�=R=Lt�H�=R=M�u����iH�=RQ=��^���H�=mQ�Q���H�=oQ= �?����3ff.�f�=GtCH�=gQ����H�=
P=F�
������C��H��H��������I��H�= Q���H�=�O�����!��D��ATUH��SH��`dH�%(H�D$X1����H�����H�}H��H����H�uH���w��H�}H����������H��L�d$�E��H���m��1�L��H�߉������������L���<��H��H�����H�L$XdH3%(H��u@H��`[]A\�D1��I�����n������ff.���D$�w���D$�d������f���ATUH��SH��`dH�%(H�D$X1����H��H������H�}H����H�uH���w��H�}H�������m��H��L�d$�E��H���m��1�L��H�߉�������!��H�������L�����H��H�L$XdH3%(H��u@H��`[]A\�D1��I�����n������ff.���D$�w���D$�d������f���AWAVAUATUSH��xdH�%(H�D$h1�H�F����R��H���H���*��H�:� ��L�d$H��1�H��L�������������|$4����H�}�/�j��H�}�I���y��H�\$ H����A����H�����L�t$H�}L��HN�H��H�t$L���N�����D��H�|$H)�I�H����H�����LN�H�}L��L����������L)�M�H��~eH�����A������fDH�}�'��L���o��L�����H�� H�H�T$hdH3%(�/H��x[]A\A]A^A_�f�H�}����L�����L���7��H��� H��f.�H�\$ H�����H����A����H�����L�l$H�}M��LN�L��L���-��������L)�M�H��~jH�����H�}L��LN�L��������u��L)�M�H��~=A����H�����M��H�}L��LN�L���������?��L)�M�H����L���X�������K��H�EH�����������@��AWH��AVAUATUH��SH��dH�4%(H��$�1�H���H��L�aA�H��H�t$xL�L� VI�H��1�jj���H�� H������L�(I������H�XH��t
I����H�x����D$���>��f�1�H�T$L��H�5�H)D$ )D$0)D$@)D$P)D$`�a������H������H�C����?H���H���P��H�9�F��L�d$ 1�H��L�������������|$D����L�|$L���r��I��H���H�=?� L�l$0L�|$ �p��H��H��tQH�@���H��H�EH������D�D$E����1�L���#��������M��tM��uAH��t
L�d$ L���_��H��$�dH3%(H����H�Ę[]A\A]A^A_�I����sM��~�H�}L��L���_����u����fD����H�}�`���ff.�f�H�Z�H������H������H������L�(H������H�XH���
���f��1�H�T$L��H�5�F)L$ )L$0)L$@)L$P)L$`������H�{����kL���M���|��I�9�r��L�d$ 1�H��L�������������|$D����L�|$L�����I��H���/H�=k� L�l$0L�|$ ���H��H���y���H�@�#��H��H�EH���6������ff.�����A����H�}L��I�����M��H�D$MN�L������������M)�M�M��~pI�����H�}L��MN�L�����������M)�M�M��~CA����I�����M��H�}L��MN�L���p�����b��M)�M�M���ff.�f�H�|$��������L�5A� H�5�J1�I�>����t����D$H�5�FL��������|��H�5�FL��������e��H�5�FL���~�����D��H�5�FL���g�����-��H�5�GL���P�������H�5�GL���9��������H�5�GL���"�������H�5�GL�����������H�5�GL������������H�5�GL���������^��H�5FL������������H�5	FL�����������H�5�FL�����������H�5�FL�����������L�ʁ H�59D1�I�8�!�����L�
�� H�5iE1�I�9�����������D��SH����H�����=!�?��{=��>��@��=���H�=�E��t���'��H��H���)��[�5��DH�=�E=�t�H�=�E|�H�=�E= u�[���DH�=�E=It�~@H�=F=Kt�H�=�E|�H�=�E=Lt�H�=�E=Mt��j����=GtYH�=�E�a���H�=*D=F�<����J���DH�=�D�9���@H�=E�)���@H�=�D[�S���H�=�C�	���@H�=E���@��AWH��AVAUATUSH��H��dH�4%(H�t$x1�H����H��L�aE1�H��H�t$hL�r� VI�H��1�jj���H�� H���u��M����H�(H����I����H�x����D$�������H�}f��I��)L$)L$ )L$0)L$@)L$P����@L���M���`��I�8�V��L�|$1�H��L���}�������Y���|$4�U��L�d$ L�t$M���H�=� �J���H��H����H�@����H��H�CH������D�L$E���1��y���H�{1�L����������M���*M���!I����OM���H�{L��L���\��������|��ff.�@H������H������H������H����H�(H���/H�x�6���A�ƅ��N�6��f�I��)D$)D$ )D$0)D$@)D$PH���H�=� �!���H��H��tkH�@���H��H�CH������1�E��H��A�A�����1�L���Ƚ��������M��tM�����f�H��t
L�|$L�����H�t$xdH34%(H���KH�Ĉ[]A\A]A^A_���I��I�����A����H�{L��MN�L�����������M)�M�M���L���r����I���:�������L�|$L�U�I��L��1��A�����M���M������I�;����1�L��H������������|$4����L�d$ L�t$M��t|H�=|� 跽��H��H������H�@�>���H��H�CH��������6���d���H�|$E1�E1�I�Ź1�1���H�
| H�5[CH�;1��Q�������g���L��{ H�5G>1�I�8�/����j���H��{ H�5*>1�H�8�����_����j���e����UH��SH��H�����H��費��=!�r����H�=@=�tA��H�=�?��@t/H�=�?=�t!H�=�?��t������H��H������f��+���H��H���f��H��H��H�=�>1�蛼��H�+H���B��H������H��H��[]�ff.��H�=�?=It���H�=�?=Kt�H�=�?|�H�=�?=L�s���H�=�?=M�a����G���ff.��H�=?=��>���H�=?�1���H�=?= ��������f.�=Gt0H�=?�����H�=�==F�������H�=�>����H�=�=����ff.�f���AWH��AVAUATUSH��H��dH�4%(H�t$x1�H����H��L�aE1�H��H�t$hL�r VI�H��1�jj耽��H�� H�����M����H�(H����I���tH�x�{����D$����躽��L�Ef��I��)L$)L$ )L$0)L$@)L$PA����uM���M������I�9����L�|$1�H��L���<�����������|$4����L�l$ L�t$M���DH�=΁ �	���H��H��tkH�@蔻��H�CH���%��D�T$E���6�H���<���H�{1�L��许�������M��tM���,�H��t
L�|$L���޼��H�t$xdH34%(H����H�Ĉ[]A\A]A^A_�DH���D��H���[��H���R��H���%H�(H����H�x����Ņ��m�7���f�I��)D$)D$ )D$0)D$@)D$PH���4��H�=�� ���H��H���H���H�@�i���H�CH���*����A��A�����1�L��H��膷�����W��M�����M������I����M������H�{L��L�������������t��f.��[���L�]f��I��)T$)T$ )T$0)T$@)T$PA����I���H���\��H�:�R��L�|$1�H��L���ݸ����������|$4�m��L�l$ L�t$M����H�=o 誷��H��H�����H�@�1���H�CH���������ff.�@I��I������������ɸ��I��I�����A����H�{L��MN�L���ַ�����t��M)�M�M���L���K����v����1���H�|$E1�E1�I�Ĺ1�1���4���H��u H�5�<H�;1��۹���H�����L�bu H�5�71�I�8蹹��������������f.���AWH��AVAUATUSH��H��dH�4%(H�t$x1�H����H��L�aE1�H��H�t$hL��y VI�H��1�jj���H�� H������M���wH�(H���NI����H�x�۵���D$�����ڷ��L�Ef��I��)L$)L$ )L$0)L$@)L$PA����5M���M���%��I�9���L�|$1�H��L��蜶����������|$4����L�l$ L�t$M���H�=.} �i���H��H��tUH�@��H�CH���e��D�T$E����1�L��H���������G��M��t	M���H��t
L�|$L���T���H�t$xdH34%(H����H�Ĉ[]A\A]A^A_�ff.�H�x藴���Ņ��o蘶��f�I��)D$)D$ )D$0)D$@)D$PH���4��H�=H| 胴��H��H���s���H�@�
���H�CH���0����A��A������H��觴��H�{1�L���������D��M������M�������I���_M�����H�{L��L��莴���������r���H������H���e��H���\��H���H�(H������I���������I��I�����A����H�{L��MN�L���������j��M)�M�M���L��蔴���I����:���L�|$L�]�I��L��1��A�����I���H������H�:����1�L��H���
����������|$4�@��L�l$ L�t$M��tuH�=�z �޲��H��H������H�@�e���H�CH���������莴��H�|$E1�E1�I�Ĺ1�1���H�-4q H�5�81�H�}�z����q���L�q H�5u31�I�8�]����B����s���������f���AWH��AVAUATUSH��H��dH�4%(H�t$x1�H����H��L�aE1�H��H�t$hL��u VI�H��1�jj耴��H�� H���M��M���H�(H���NI���{H�x�{����D$��������L�Ef��I��)L$)L$ )L$0)L$@)L$PA����@M���M���X��I�9�N��L�|$1�H��L���<�������,���|$4�x��L�l$ L�t$M���H�=�x �	���H��H��tUH�@蔲��H�CH���
��D�T$E����1�L��H��輯��������M��t	M���H��t
L�|$L����H�t$xdH34%(H����H�Ĉ[]A\A]A^A_�ff.�H�x�7����Ņ��z�ر��f�I��)D$)D$ )D$0)D$@)D$PH������H�=�w �#���H��H���s���H�@誱��H�CH���&����A��A������H���G���H�{1�L��蹮��������M������M�������I���%M�����H�{L��L���.����������i�����I��I�����A����H�{L��MN�L��������
��M)�M�M���L���n������贰��L�|$L�]�I��L��1��A�����I���H������H�:����1�L��H������������|$4�#��L�l$ L�t$M����H�=yv 贮��H��H������H�@�;���H�CH��������=��f�H�������H�������H�������H��tH�(H�����I������Ư��H�|$E1�E1�I�Ĺ1�1���_���H�-�l H�541�H�}�����f����%���L��l H�5/1�I�8����2����]����X���ff.���AWH��AVAUATUSH��H��dH�4%(H�t$x1�H����H��L�aE1�H��H�t$hL��q VI�H��1�jj����H�� H���a��M���H�(H���NI���{H�x�����D$����芬��L�Ef��I��)L$)L$ )L$0)L$@)L$PA����@M���M���l��I�9�b��L�|$1�H��L���̭������@���|$4����L�l$ L�t$M���H�=^t 虬��H��H��tUH�@�$���H�CH���!���D�T$E����1�L��H���L��������M��t	M���H��t
L�|$L��脯��H�t$xdH34%(H����H�Ĉ[]A\A]A^A_�ff.�H�x�ǫ���Ņ��z�H���f�I��)D$)D$ )D$0)D$@)D$PH�������H�=xs 賫��H��H���s���H�@�:���H�CH���:�����A��A������H���׫��H�{1�L���I���������M������M�������I���%M�����H�{L��L��辫���������}����|���I��I�����A����H�{L��MN�L��艫�����!���M)�M�M���L���������$���L�|$L�]�I��L��1��A�����I���H������H�:����1�L��H���w������ӿ���|$4�7���L�l$ L�t$M����H�=	r �D���H��H�������H�@�˫��H�CH��������Q���f�H������H���ʾ��H�������H��tH�(H�����I������6���H�|$E1�E1�I�Ĺ1�1���_���H�-Yh H�5�/1�H�}蟬���f���赫��L�&h H�5�*1�I�8�}����2����q����l���ff.���AWH��AVAUATUSH��H��dH�4%(H�t$x1�H����H��L�aE1�H��H�t$hL�m VI�H��1�jj蠫��H�� H���u���M���H�(H���NI���{H�x蛨���D$�������L�Ef��I��)L$)L$ )L$0)L$@)L$PA����@M���M�������I�9�v���L�|$1�H��L���\�������T����|$4�����L�l$ L�t$M���H�=�o �)���H��H��tUH�@贩��H�CH���5���D�T$E����1�L��H���ܦ��������M��t	M���H��t
L�|$L������H�t$xdH34%(H����H�Ĉ[]A\A]A^A_�ff.�H�x�W����Ņ��z訪��f�I��)D$)D$ )D$0)D$@)D$PH���;��H�=o �C���H��H���s���H�@�ʨ��H�CH���N�����A��A������H���g���H�{1�L���٥��������M������M�������I���%M�����H�{L��L���N���������鑽������I��I�����A����H�{L��MN�L���������5���M)�M�M���L��莧�����脩��L�|$L�]�I��L��1��A�����I���H���&���H�:����1�L��H������������|$4�K���L�l$ L�t$M����H�=�m �ԥ��H��H�������H�@�[���H�CH��������e���f�H��� ���H���޻��H���ջ��H��tH�(H�����I�����薨��H�|$E1�E1�I�Ĺ1�1���_���H�-�c H�5:+1�H�}�/����f����E���L��c H�5%&1�I�8�
����2���酻��逻��ff.���AWH��AVAUATUSH��H��dH�4%(H�t$x1�H���lH��L�aE1�H��H�t$hL��g VI�H��1�jj�0���H�� H����M���_H�(H���NI���~H�x�+����D$�����z���H�}f��I��)L$)L$ )L$0)L$@)L$P�����L���M�������I�8�����L�|$1�H��L��������������|$4�Ѽ��L�l$ L�t$M���H�=k 躣��H��H��tXH�@�E���I��H�CH�������D�L$E����1�L��L���j������B���M��t	M���H��t
L�|$L��袦��H�t$xdH34%(H����H�Ĉ[]A\A]A^A_�f�H�x����Ņ��v�8���f�I��)D$)D$ )D$0)D$@)D$PH���ݺ��H�=�j �Ӣ��H��H���u���H�@�Z���I��H�CH���Ⱥ����A��A��
����L����H�{1�L���f������>���M������M�������I���%M�����H�{L��L���ۢ������������虣��I��I�����A����H�{L��MN�L��覢���������M)�M�M���L�������������L�|$L�U�I��L��1��A���uGM���M���Z���I�;�P���1�L��H��蘢�����A����|$4�|���L�l$ L�t$�{H�` H�5j'H�;1��`����	���ff.�H�������H���}���H���t���H��tH�(H������I������F���H�|$E1�E1�I�Ĺ1�1��M��t:H�=�h ���H��H�������H�@�s���I��H�CH���<������L�O_ H�5�!1�I�8覣���=���輢����������f���AWH��AVAUATUSH��H��dH�4%(H�t$x1�H����H��L�aE1�H��H�t$hL��f VI�H��1�jj�Т��H�� H���I���M���H�(H���I����H�x�˟���D$�����:���H�}f��I��)L$)L$ )L$0)L$@)L$P����>L���M������I�8����L�|$1�H��L��荠����������|$4����L�d$ L�t$M���%H�=g �Z���H��H��t\H�@���H��H�CH���R���D�L$E���)1�L���
������L���M��tM���;�H��t
L�|$L���>���H�t$xdH34%(H����H�Ĉ[]A\A]A^A_�DH�������H���ڸ��H���Ѹ��H���H�(H���9H�x�V���A�ƅ��\�Ɲ��f�I��)D$)D$ )D$0)D$@)D$PH����H�=f �A���H��H���G���H�@�ȟ��H��H�CH���5���1�E��H��A�A�������d���H�{1�L���֜��������M������M������I���%M�������H�{L��L���K����������邷���	���I��I�����A����H�{L��MN�L���������!���M)�M�M���L��苞���V���I���@���虜��L�|$L�U�I��L��1��A�����M���M���u���I�;�k���1�L��H�������������|$4�o���L�d$ L�t$M����H�=�d �ɜ��H��H���	���H�@�P���H��H�CH���y���鸵�����H�|$E1�E1�I�Ź1�1���H�[ H�5m"H�;1��c����p���H��Z H�5^1�H�8�F����S���L��Z H�5A1�I�8�)����$����?����@����;���D��AWH��AVAUATUSH��H��dH�4%(H�t$x1�H����H��L�aE1�H��H�t$hL�b VI�H��1�jj�P���H�� H�������M����H�(H����I����H�x�K����D$����芛��H�}f��I��)L$)L$ )L$0)L$@)L$P����@L���M�������I�8�����L�|$1�H��L���
������������|$4�����L�d$ L�t$M���H�=�b �ښ��H��H����H�@�a���H��H�CH������D�L$E���1��	���H�{1�L���{������G���M���*M���!I����OM���H�{L��L���������鿵��ff.�@H������H���9���H���0���H����H�(H���/H�x�ƙ��A�ƅ��N����f�I��)D$)D$ )D$0)D$@)D$PH���H�=va 豙��H��H��tkH�@�<���H��H�CH�����1�E��H��A�A�����1�L���X������$���M��tM�����f�H��t
L�|$L��莜��H�t$xdH34%(H���KH�Ĉ[]A\A]A^A_�耚��I��I�����A����H�{L��MN�L��荙�����4���M)�M�M���L�������I���:������L�|$L�U�I��L��1��A�����M���M������I�;�����1�L��H���v�����������|$4����L�d$ L�t$M��t|H�=` �G���H��H������H�@�Ι��H��H�CH��������y����4���H�|$E1�E1�I�Ź1�1���H��V H�5�H�;1����������L�hV H�5�1�I�8迚���j���H�KV H�5�1�H�8袚���_���魲��騲����AWH��AVAUATUH��SH��dH�4%(H�t$x1�H����H��L�aE1�H��H�\$hL�\ H��SI�1�jj�Й��H�� H���D���M���{H�H���I����H�x�˖���D$�����j���H�sf��I��)L$)L$ )L$0)L$@)L$P����:H���H���u���H�?�k���L�|$1�H��L��荗������m����|$4� ���L�d$ L�t$M���
H�=^ �Z���H��H��t\H�@���H��H�EH�������D�D$E���)1�L���
����������M��tM���;�H��t
L�|$L���>���H�t$xdH34%(H���vH�Ĉ[]A\A]A^A_�DH���߱��H�������H�������H����H�H���9H�x�V���A�ƅ��=���f�I��)D$)D$ )D$0)D$@)D$PH�������H�=] �A���H��H���G���H�@�Ȗ��H��H�EH���ݱ��1�E��H��A�A�������d���H�}1�L���֓���������M������M������I���%M�������H�}L��L���K�����������B����	���I��I�����A����H�}L��MN�L�����������M)�M�M���L��苕���V���I���@����ɖ��L�|$L�K�I��L��1��A�����M���M���߯��I�:�կ��1�L��H�������������|$4�����L�d$ L�t$M��t}H�=�[ �͓��H��H���W���H�@�T���H��H�EH���}����d�������H�|$E1�E1�I�Ź1�1���L�- R H�5q1�I�}�f����s����|���H�-�Q H�5\H�}1��C����>����Z����U���@��AWH��AVAUATUSH��H��dH�4%(H�t$x1�H����H��L�aE1�H��H�t$hL��X VI�H��1�jj�p���H�� H���}���M����H�(H����I����H�x�k����D$�����
���H�}f��I��)L$)L$ )L$0)L$@)L$P����@L���M���h���I�8�^���L�|$1�H��L���-�������a����|$4�]���L�d$ L�t$M���H�=�Y ���H��H����H�@聓��H��H�CH���֮��D�L$E���1��)���H�{1�L��蛐��������M���*M���!I����OM���H�{L��L����������鄯��ff.�@H���Ю��H�������H�������H����H�(H���/H�x���A�ƅ��N膐��f�I��)D$)D$ )D$0)D$@)D$PH���H�=�X �ѐ��H��H��tkH�@�\���H��H�CH�������1�E��H��A�A�����1�L���x��������M��tM�����f�H��t
L�|$L��讓��H�t$xdH34%(H���KH�Ĉ[]A\A]A^A_�蠑��I��I�����A����H�{L��MN�L��譐���������M)�M�M���L���"����I���:����c���L�|$L�U�I��L��1��A�����M���M���̬��I�;�¬��1�L��H��薐�����í���|$4�Ƭ��L�d$ L�t$M��t|H�=,W �g���H��H���ݬ��H�@���H��H�CH��������>���贎��H�|$E1�E1�I�Ź1�1���H��M H�5H�;1������������L��M H�5�1�I�8�ߑ���j���H�kM H�5�1�H�8�‘���_����r����m�����AWH��AVAUATUSH��H��dH�4%(H�t$x1�H����H��L�aE1�H��H�t$hL�"T VI�H��1�jj��H�� H���D���M����H�(H����I����H�x����D$�����Z���H�}f��I��)L$)L$ )L$0)L$@)L$P����@L���M���/���I�8�%���L�|$1�H��L��譎������(����|$4�$���L�d$ L�t$M���H�=?U �z���H��H����H�@����H��H�CH�������D�L$E���1�詍��H�{1�L���������ӫ��M���*M���!I����OM���H�{L��L��茍�������K���ff.�@H�������H���ū��H�������H����H�(H���/H�x�f���A�ƅ��N�֍��f�I��)D$)D$ )D$0)D$@)D$PH���H�=T �Q���H��H��tkH�@�܍��H��H�CH���x���1�E��H��A�A�����1�L������������M��tM�����f�H��t
L�|$L���.���H�t$xdH34%(H���KH�Ĉ[]A\A]A^A_�� ���I��I�����A����H�{L��MN�L���-����������M)�M�M���L��袌���I���:���賌��L�|$L�U�I��L��1��A�����M���M�������I�;�����1�L��H��������������|$4�����L�d$ L�t$M��t|H�=�R ���H��H�������H�@�n���H��H�CH���������������H�|$E1�E1�I�Ź1�1���H�:I H�5�H�;1�聍�����藌��L�I H�5w1�I�8�_����j���H��H H�5Z1�H�8�B����_����9����4�����AWH��AVAUATUH��SH��dH�4%(H�t$x1�H����H��L�aE1�H��H�\$hL��N H��SI�1�jj�p���H�� H���Щ��M���{H�H���I����H�x�k����D$����誈��H�sf��I��)L$)L$ )L$0)L$@)L$P����:H���H������H�?�����L�|$1�H��L���-������������|$4�����L�d$ L�t$M���
H�=�P ���H��H��t\H�@腊��H��H�EH�������D�D$E���)1�L��譇���������M��tM���;�H��t
L�|$L���ދ��H�t$xdH34%(H���vH�Ĉ[]A\A]A^A_�DH���k���H���)���H��� ���H����H�H���9H�x���A�ƅ��=�6���f�I��)D$)D$ )D$0)D$@)D$PH���4���H�=�O ���H��H���G���H�@�h���H��H�EH���i���1�E��H��A�A����������H�}1�L���v������J���M������M������I���%M�������H�}L��L�������������Χ��詈��I��I�����A����H�}L��MN�L��趇�����r���M)�M�M���L���+����V���I���@����	���L�|$L�K�I��L��1��A�����M���M���k���I�:�a���1�L��H��蜇���������|$4����L�d$ L�t$M��t}H�=2N �m���H��H�����H�@��H��H�EH���}������Z���H�|$E1�E1�I�Ź1�1���L�-�D H�51�I�}�����s�������H�-�D H�5�H�}1�����>���������@��AWH��AVAUATUSH��H��dH�4%(H�t$x1�H����H��L�aE1�H��H�t$hL�K VI�H��1�jj����H�� H���	���M����H�(H����I����H�x�����D$����躆��H�}f��I��)L$)L$ )L$0)L$@)L$P����@L���M����I�8���L�|$1�H��L���ͅ���������|$4���L�d$ L�t$M���H�=_L 蚄��H��H����H�@�!���H��H�CH���b���D�L$E���1��Ʉ��H�{1�L���;����������M���*M���!I����OM���H�{L��L��謄����������ff.�@H���\���H�������H�������H����H�(H���/H�x膃��A�ƅ��N�6���f�I��)D$)D$ )D$0)D$@)D$PH���H�=6K �q���H��H��tkH�@���H��H�CH���=���1�E��H��A�A�����1�L���������u���M��tM�����f�H��t
L�|$L���N���H�t$xdH34%(H���KH�Ĉ[]A\A]A^A_��@���I��I�����A����H�{L��MN�L���M����������M)�M�M���L���ƒ���I���:�������L�|$L�U�I��L��1��A�����M���M���X���I�;�N���1�L��H���6������O����|$4�R���L�d$ L�t$M��t|H�=�I ����H��H���i���H�@莃��H��H�CH��������ʢ���d���H�|$E1�E1�I�Ź1�1���H�Z@ H�5�H�;1�衄�����跃��L�(@ H�5�1�I�8�����j���H�@ H�5z1�H�8�b����_���������H�=�J H��J H9�tH��? H��t	�����H�=yJ H�5rJ H)�H��H��H��?H�H�tH��? H��t��fD�����=5J u+UH�=�? H��tH�=8 �ف���d����
J ]������w������SH�=DH H�� dH�%(H�D$1�H�A? H�*H ������������H�=	C �4���H��H���v���1�葁��H�$H���x���H��H�=�����D$轀���|$�G���H�$H���I���H�5�H���~��������H��G H�5!H��H��G �~��H�L$dH3%(H��uH�� [������H��H���unknown reasons[%s: %s] %s[%s] %scontiguous bufferargument 'key'hmac_digestargument 'msg'strargument 'digest'embedded null characterunsupported hash typekey is too long.msg is too long.argument 'password'scryptargument 'salt'intargument 'n'argument 'r'argument 'p'password is too long.salt is requiredsalt is too long.n must be a power of 2.argument 'hash_name'pbkdf2_hmaciteration value is too great.key length is too great.sha512_224sha512_256name must be a stringSHA512_224SHA512_256blake2s256blake2b512<%U HASH object @ %p>openssl_md_meth_namesupdatehexdigestcopydigest_sizeblock_sizealgorithm name.newget_fips_modeopenssl_md5openssl_sha1openssl_sha224openssl_sha256openssl_sha384openssl_sha512openssl_blake2bopenssl_blake2sopenssl_sha3_224openssl_sha3_256openssl_sha3_384openssl_sha3_512openssl_shake_128openssl_shake_256usedforsecuritykeymsgpasswordsaltpmaxmemdklenhash_nameiterations_hashlib_hashlib.HASHinteger argument expected, got floatn is required and must be an unsigned intr is required and must be an unsigned intp is required and must be an unsigned intmaxmem must be positive and smaller than %ddklen must be greater than 0 and smaller than %dInvalid parameter combination for n, r, p, maxmem.iteration value must be greater than 0.key length must be greater than 0.Unicode-objects must be encoded before hashingobject supporting the buffer API requiredBuffer must be single dimensioncopy($self, /)
--

Return a copy of the hash object.hexdigest($self, /)
--

Return the digest value as a string of hexadecimal digits.digest($self, /)
--

Return the digest value as a bytes object.update($self, obj, /)
--

Update this hash object's state with the provided string.HASH(name, string=b'')
--

A hash is an object used to calculate a checksum of a string of information.

Methods:

update() -- updates the current digest with an additional string
digest() -- return the current digest value
hexdigest() -- return the current digest as a string of hexadecimal digits
copy() -- return a copy of the current hash object

Attributes:

name -- the hash algorithm being used by this object
digest_size -- number of bytes in this hashes outputopenssl_shake_256($module, /, string=b'', *, usedforsecurity=True)
--

Returns a shake_256 hash object; optionally initialized with a stringopenssl_shake_128($module, /, string=b'', *, usedforsecurity=True)
--

Returns a shake_128 hash object; optionally initialized with a stringopenssl_sha3_512($module, /, string=b'', *, usedforsecurity=True)
--

Returns a sha3-512 hash object; optionally initialized with a stringopenssl_sha3_384($module, /, string=b'', *, usedforsecurity=True)
--

Returns a sha3_384 hash object; optionally initialized with a stringopenssl_sha3_256($module, /, string=b'', *, usedforsecurity=True)
--

Returns a sha3_256 hash object; optionally initialized with a stringopenssl_sha3_224($module, /, string=b'', *, usedforsecurity=True)
--

Returns a sha3_224 hash object; optionally initialized with a stringopenssl_blake2s($module, /, string=b'', *, usedforsecurity=True)
--

Returns a blake2s hash object; optionally initialized with a stringopenssl_blake2b($module, /, string=b'', *, usedforsecurity=True)
--

Returns a blake2b hash object; optionally initialized with a stringopenssl_sha512($module, /, string=b'', *, usedforsecurity=True)
--

Returns a sha512 hash object; optionally initialized with a stringopenssl_sha384($module, /, string=b'', *, usedforsecurity=True)
--

Returns a sha384 hash object; optionally initialized with a stringopenssl_sha256($module, /, string=b'', *, usedforsecurity=True)
--

Returns a sha256 hash object; optionally initialized with a stringopenssl_sha224($module, /, string=b'', *, usedforsecurity=True)
--

Returns a sha224 hash object; optionally initialized with a stringopenssl_sha1($module, /, string=b'', *, usedforsecurity=True)
--

Returns a sha1 hash object; optionally initialized with a stringopenssl_md5($module, /, string=b'', *, usedforsecurity=True)
--

Returns a md5 hash object; optionally initialized with a stringhmac_digest($module, /, key, msg, digest)
--

Single-shot HMAC.get_fips_mode($module, /)
--

Determine the OpenSSL FIPS mode of operation.

Effectively any non-zero return value indicates FIPS mode;
values other than 1 may have additional significance.

See OpenSSL documentation for the FIPS_mode() function for details.scrypt($module, /, password, *, salt=None, n=None, r=None, p=None,
       maxmem=0, dklen=64)
--

scrypt password-based key derivation function.pbkdf2_hmac($module, /, hash_name, password, salt, iterations,
            dklen=None)
--

Password based key derivation function 2 (PKCS #5 v2.0) with HMAC as pseudorandom function.new($module, /, name, string=b'', *, usedforsecurity=True)
--

Return a new hash object using the named algorithm.

An optional string argument may be provided and will be
automatically hashed.

The MD5 and SHA1 algorithms are always supported.;�:�c����h�� �m��8,n���(q����q���4s��$gt����t���u��<�u���(v��h�x����x��x�y����y��X	�{���	}���
�~��8��������x���
H����
����X���4����{���8ي��� ���Th���p�������������(���<ȍ���(����Ț��8h����h���h���P���������h������������H����	����4
����
����t���X������T
X���
����8��4�����tX�zRx�$�a���FJw�?:*3$"D�f���4\Hk���B�B�A �A(�D0�(C ABB��HI�����%HU����%HU�(���7E�Y
Rd�Pk���F�E�B �A(�A0�U�A�X�I�B�I���G�\�D�o0A(A BBB8`���F�B�A �K(�D@T
(D ABBKzRx�@���� $�m��}r(A ABB�����XF�B�B �E(�A0�D8�G�d�_�I�B�I���J�G�B�I�y�B�A�B�c��
8A0A(B BBBAc�]�E�B�I�$zRx��������,m����������F�B�H �B(�A0�D8�G���B�^�A�Y
8A0A(B BBBFP�E�d�A�Z�[�I�B�I��n��3(\�����Q�D�D �
AAKzRx� �� �n��7^
D�A�E0������F�A�D �D��
 AABFzRx�����$�n��u0,X����F�A�D �D��
 AABFl�n��sLt����F�B�B �B(�A0�A8�D�Z
8A0A(B BBBJ$zRx��������,�n���`$����F�E�B �B(�A0�D8�G�`�Z�J�B�I��
8A0A(B BBBD$zRx��������$,�n��^A�[�D�B�I�(�`���lE�a
Jf
J�
HzRx�� �p��`t���}F�E�B �B(�A0�A8�J�]�W�J�B�I��
8A0A(B BBBA$zRx��������8,p��G��X�D�B�I�Q�X�D�B�I�(�,����E�D�D �
DAM��p��`�����F�E�B �B(�A0�A8�J�]�W�J�B�I�l
8A0A(B BBBF8�p���A�X�D�B�I���X�D�B�I�`�����WF�E�B �B(�A0�A8�J�]�W�J�B�I�V
8A0A(B BBBL8��q���A�X�D�B�I��X�D�B�I�`Xl���bF�E�B �B(�A0�A8�J�]�W�J�B�I�V
8A0A(B BBBL8Lnr���d�X�D�B�I�Q�X�D�B�I�`�<���bF�E�B �B(�A0�A8�J�]�W�J�B�I�V
8A0A(B BBBL8�Rs���d�X�D�B�I�Q�X�D�B�I�`�	���bF�E�B �B(�A0�A8�J�]�W�J�B�I�V
8A0A(B BBBL8�6t���d�X�D�B�I�Q�X�D�B�I�`8
ܸ��^F�E�B �B(�A0�A8�J�]�W�J�B�I�X
8A0A(B BBBJ8,u��k��X�D�B�I�Q�X�D�B�I�`�
����{F�E�B �B(�A0�A8�J�]�W�J�B�I�\
8A0A(B BBBF8��u��C��X�D�B�I�Q�X�D�B�I�`x|���}F�E�B �B(�A0�A8�J�]�W�J�B�I��
8A0A(B BBBA8l�v��G��X�D�B�I�Q�X�D�B�I�`\��\F�E�B �B(�A0�D8�G�]�Z�G�B�I�\
8A0A(B BBBF8/w��^J�X�D�B�I�Q�X�D�B�I�`���}F�E�B �B(�A0�A8�J�]�W�J�B�I��
8A0A(B BBBA8��w��G��X�D�B�I�Q�X�D�B�I�`X
���}F�E�B �B(�A0�A8�J�]�W�J�B�I��
8A0A(B BBBA8L�x��G��X�D�B�I�Q�X�D�B�I�`�
���\F�E�B �B(�A0�D8�G�]�Z�G�B�I�\
8A0A(B BBBF8�;y��^J�X�D�B�I�Q�X�D�B�I�`����}F�E�B �B(�A0�A8�J�]�W�J�B�I��
8A0A(B BBBA8��y��G��X�D�B�I�Q�X�D�B�I� 8<���E�K0�
AAzRx�0� �z��@GNU�`� �`� j���j���j���j���j���j���j���j���j���j���j���j���j���j����	�ʱ
��(�����$�*�
��4�$�/�j���Uft��*
`�P� X� ���o`P�
� P`#��	���o���o ���o�od���o�� �*�*++ +0+@+P+`+p+�+�+�+�+�+�+�+�+,, ,0,@,P,`,p,�,�,�,�,�,�,�,�,-- -0-@-P-`-p-�-�-�-�-�-�-�-�-.. .0.@.P.`.p.�.�.�.�.�.�.�.�.// /0/@/P/`/p/�/�/�/�/ɳ�e`�ʱ�c �г�d��ڳ@T��߳�S��S/�n��� h� ��@\�`�Z��T���
��S��űD5�`������$�`z� �1��~���@�����O�0��@�^��u���m�p���}�Ц�`����o�����0�� ���P������Н��Ѵ��@��p����?���������@�  � �� $��� 1��� @��� O��� ^�`� m�@� }� � ��� ���� ���� ���� Ѵ�� ��� ��� �`� Z�@� űH� Tt��� �� GA$3a1�*m�_hashlib.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug�Qy��7zXZ�ִF!t/��/�]?�E�h=��ڊ�2N�H�� ��^"�b�/q�>�5��i��A$��,��Ũzd�E+2��Z��,%_��Mb(���e��Q�rZ��/�!5n�/	�+��&�U^��������^o ��*��KX9I���Z����~��~���Z��2���Ce}�I�d�1̘�Z�&}�0P�+��Qu�0�?���I�
K�I�"֠۴�q�~yN0,&��yeBN-��_a�6�i� ǟ��;�D�H2L�*��J����`�Oygc��ç!�e�䀖X��A���ݸ���f�`Z0p6r'c��,�
)����,^Sd��PPML�Қ;�JM����1��>Ş%���Y��1S�ڻJ����-vb��|��y�?��I�X�Ik
��|��[Ve?k�\ ��*�̔gα�1Gxɟ�])($��Cy�k
2+�Lrl�l/��Or0v���Ϊ�	SW2Oɦ"�أ��2�<����O���d�@��
�n�M����Rq��L�d2�i�͛�.�}��G�-uDž�L�TS�U���ەt+��B�6!;�����u�x�T;YJ?��t��`���]�]!����k�S3�&x}cRKC�bdKDI��#���4y���"�#f�!^����˱�3��I�!+E�wa����b劾����TFݯ6�fd�5K��.*�~�,2�/ߑ*��G'>��WQ��+y���a�
�2��=g>d��cx�����)9�B�a{)��8B�O�G�����J͋��Q�@I-�r�~���m-���e�xCS�8��P��SJF�R�C�r��"�����G;ާ��&�jO۬d�V8�N0|-9�ǝ�`j̀�t&x��-GʮT�Mo�\��
��
F�V-�S-mpS7f��
��[�,
�t�/��M���(�eU�F�V�r$7*��(k�Ov(Q�5��f�J 5@�����2���~�*�m8�O��hy�O8,�gJ7����9Ƴ��Q8�mV��m^��x��sf�_NӐ_O���P�ܫ���Ļ�<P!�)ybY��Ve
�9���X85y��L��(0������`��~�o�_��O	
��`3:Ga�/"��_��N	���t�ıPA��<Rᨻ�Q�oT$?�0

n�����_JE�W.>*��g`�ҔX��ֵ�DHI�|�X�#�Z��?u�Y��;�~�O�F$%tC9���3�)�6b�XS�j�G݀h�}Mt�b�|4������g)���tgY�?EU3�<���V����:����
<k������3p-�x<�I�C����rGu���r�8�,aY�͇b�i�O�E�cP���q�ʖP8��Xϊ�������vM��PX����M���W�����[�ZԮ|�7h��½���>�����0�-��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(���0PP8���odd�E���o  `T���^B`#`#Ph�*�*c�*�*�n�/�/�w�4�4�|}`�`�
������ ��������������� �P� P��X� X��`� `�� �� ��� ���� �`
 �`� `��h�``�$
��`���(lib-dynload/fcntl.cpython-38-x86_64-linux-gnu.so000075500000046640151153537520015232 0ustar00ELF>�@`F@8	@�7�7 �<�< �< `h �<�< �< 888$$�7�7�7  S�td�7�7�7  P�td�4�4�4\\Q�tdR�td�<�< �< XXGNUʤ�����2d6�dKN��%�@ %'��|CE���qXki��'' X���8� �, �F"�j��|�F�W����u�->��A �A �A h�E__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6PyObject_AsFileDescriptor_PyArg_CheckPositionalPyFloat_TypePyType_IsSubtype_PyLong_AsIntPyErr_OccurredPyExc_TypeErrorPyErr_SetString_Py_NoneStructPySys_AuditPyExc_ValueErrorPyLong_AsLong__errno_locationPyErr_CheckSignalsPyEval_SaveThreadfcntl64PyEval_RestoreThreadPyExc_OSErrorPyErr_SetFromErrno__stack_chk_failflock_PyArg_Parse_SizeT__memcpy_chkPyErr_ClearPyBytes_FromStringAndSizePyLong_FromLongioctlPyBuffer_ReleasePyLong_AsUnsignedLongMaskPyObject_IsTruePyInit_fcntlPyModule_Create2PyModule_AddIntConstant_edata__bss_start_endGLIBC_2.2.5GLIBC_2.4GLIBC_2.28GLIBC_2.3.4f ui	�vii
�����ti	�ui	��< ��< ��< �< @ �#@ �@ @1 @ �#(@ 8@ �+@@ w#H@ �X@ �*`@ L#h@ �x@ �&�@ �#�@  4�@ @ �? �? �? �? �? �? 
�? �? �? �> �> �> �> �> 	? 
? ? ?  ? (? 0? 8? @? H? P? X? `? h? p? x? �? �? �?  �? !�? "�? #�? $��H��H�y0 H��t��H����5b/ �%c/ ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1�������%�- D���%�- D���%�- D���%�- D���%}- D���%u- D���%m- D���%e- D���%]- D���%U- D���%M- D���%E- D���%=- D���%5- D���%-- D���%%- D���%- D���%- D���%
- D���%- D���%�, D���%�, D���%�, D���%�, D���%�, D���%�, D���%�, D���%�, D��AWI��AVAUATUH��SH��HdH�%(H�D$81�H�B�H��wH�}�%����D$��y'� ��L��H�=�����u��H�UH�zH;=, tbH�5v, �i���A�ƅ�uOH�}����Ã��tI�����H��t��L�mI��txL�eI��t]H�M H�yH;=, uL��+ H�5�I�8���1��H�5�+ �����u�H�} �m���A�ƃ��u���H���?M��M��uL�
�+ �
L�
�+ E1�M��M��uL��+ �L�
�+ E1�E1�M��P��H�5�1�AV�T$H�=��m���ZY������u	f�D$�7��t	f�D$�)��t	f�D$�H�=+ H�5�H�?����W�D$M��uM��u�0L�����H�D$���H��t��iL���y���H�D$ ���H��uR��fD�t$L�|$���������8u6������u)����|$L����I��1����L�����_������t��1��#H�5U* H�>�e������x�H��* H���H�L$8dH3%(t���H��H[]A\A]A^A_���AUATUSH��WH��uH�;����Ņ�y!�IH�ֹ�H�=�
� �����u��*H�CH�5�) H�xH9�uH�
�) H�5�H�9���1��������u�H�{�G������t1���H�53
��H�=-
�����y!��<���H��t������8u-������u��M������I���Q���L��A���&���A���t��H�) H�:Y[]A\A]�(���E��x�H�D) H���Z[]A\A]�AVI��AUATA��U��SH��H��0dH�%(H��$(1��D$H��uL��( 1�D��H�5m��H�=h������xPH����1�H�L$H�T$H��H�5L�
�������H�T$H��vH�]( H�5&H�:�.���1���H�\$ H�t$�H�������+�����H��D��I��1��I���L��A�����A������O����8uk�e�����t�����1�H�T$H��H�5�
�d�����t������T$��D��I��1����L��A�����A���u=���8u������t��A���H��' H�8����!E��x�H�t$H������
E��x�Ic����H��$(dH3%(t���H��0[]A\A]A^���H�B�AUATUH��SH��WH��wH�;���A�ą�y$���H��H�=�
�-�����u��rH�SH�5' H�zH9�uH�
�& H�5�H�9����F������u�H�{�Y���A���t1�H��~H�S��^���H��t��YD��[D��]A\A]�x���Z1�[]A\A]�AWI��A��AVA��AUATUH��S��H��dH�%(H��$x1��D$H��uL�]& 1���H�5
D��H�=�	�+�������H��u/����T$��D��I��1��V���L�������������L�d$ 1�H�5�	H��L���F�������L�l$ H�l$0E��tH����H�|$pL�3H�|$pH��~%L���g���H�p% H�5l	H�:�A���1���H��L������D,p�I9�u)�9�����D��H�T$pH�D$1����H�|$�������L��D��1��x�����E��tH��
H�t$pL��H���L����������E����H�|$pH���E������{���1�L��H��H�5��7�������H�l$0H�t$ H���	���L�l$p�H��L�������D,p�i���D����L��I��1�����L��A���<���L��E��y�/���H�0$ H�8�@���1��U����H��L������C����1�H�T$H��H�5|
�������������L��# I�8��1��Hc��w���H��$xdH3%(t����H�Ĉ[]A\A]A^A_���H�B�AVAUATUH��SH��H��wH�;����A�ą�y'���H��H�=]�����u��H�SH�5x# H�zH9�uH�
P# H�5!	H�9�����l�J�����u�H�{����I���tH���*���H��t��>L�s�H��tH�{�i��y
� �E1�[L��]D��D��A\A]A^�X���[1�]A\A]A^�1���H�=�# H��# H9�tH��" H��t	�����H�=�# H�5�# H)�H��H��H��?H�H�tH�u" H��t��fD�����=}# u+UH�=Z" H��tH�= ���d����U# ]������w������S��H�=�" ��H�������H�5�H��H���z��������H�5�H���^�������H�5�H���B�������H�5�H���&�������� H�5�H���
��������@H�5�H�������n�����H�5tH�������R�����H�5cH������6���1�H�5RH����������H�5>H����������H�52H���e������H�5H���I�������H�5
H���-��������H�5�H�����������H�5�H������u����H�5�H�������Y����H�5�H������=����	H�5�H������!����H�5�H����������H�5�H���i������
H�5nH���M������1�H�5^H���4��������H�5JH�����������H�56H������|����H�5"H�������`����H�5H�������D����H�5�H������(���� H�5�H����������H�5�H���p�����H�5�H���T�������H�5�H���8��������H�5�H�����������H�5�H�����������H�5�H��������d����H�5_H��������H����H�5MH�������,����H�5;H�����������H�5)H���t������H�5H���X�������� H�5H���<����������H�5�H��� ���������	H�5�H������������
H�5�H��������h����H�5�H��������L����H�5�H�������0����H�5�H�����������H�5�H���x��������H��[���H��H���iiOOifcntl.lockfunrecognized lockf argumentiifcntl.flockiiOfcntl.fcntls#fcntl string arg too longiIOfcntl.ioctlw*:ioctlioctl string arg too longs*:ioctlLOCK_SHLOCK_EXLOCK_NBLOCK_UNLOCK_MANDLOCK_READLOCK_WRITELOCK_RWF_DUPFDF_DUPFD_CLOEXECF_GETFDF_SETFDF_GETFLF_SETFLF_GETLKF_SETLKF_SETLKWF_GETOWNF_SETOWNF_GETSIGF_SETSIGF_RDLCKF_WRLCKF_UNLCKF_GETLK64F_SETLK64F_SETLKW64FASYNCF_SETLEASEF_GETLEASEF_NOTIFYF_EXLCKF_SHLCKDN_ACCESSDN_MODIFYDN_CREATEDN_DELETEDN_RENAMEDN_ATTRIBDN_MULTISHOTF_ADD_SEALSF_GET_SEALSF_SEAL_SEALF_SEAL_SHRINKF_SEAL_GROWF_SEAL_WRITEinteger argument expected, got floatI;fcntl requires a file or file descriptor, an integer and optionally a third integer or a stringi;ioctl requires a file or file descriptor, an integer and optionally an integer or buffer argumentlockf($module, fd, cmd, len=0, start=0, whence=0, /)
--

A wrapper around the fcntl() locking calls.

`fd` is the file descriptor of the file to lock or unlock, and operation is one
of the following values:

    LOCK_UN - unlock
    LOCK_SH - acquire a shared lock
    LOCK_EX - acquire an exclusive lock

When operation is LOCK_SH or LOCK_EX, it can also be bitwise ORed with
LOCK_NB to avoid blocking on lock acquisition.  If LOCK_NB is used and the
lock cannot be acquired, an OSError will be raised and the exception will
have an errno attribute set to EACCES or EAGAIN (depending on the operating
system -- for portability, check for either value).

`len` is the number of bytes to lock, with the default meaning to lock to
EOF.  `start` is the byte offset, relative to `whence`, to that the lock
starts.  `whence` is as with fileobj.seek(), specifically:

    0 - relative to the start of the file (SEEK_SET)
    1 - relative to the current buffer position (SEEK_CUR)
    2 - relative to the end of the file (SEEK_END)flock($module, fd, operation, /)
--

Perform the lock operation `operation` on file descriptor `fd`.

See the Unix manual page for flock(2) for details (On some systems, this
function is emulated using fcntl()).ioctl($module, fd, request, arg=0, mutate_flag=True, /)
--

Perform the operation `request` on file descriptor `fd`.

The values used for `request` are operating system dependent, and are available
as constants in the fcntl or termios library modules, using the same names as
used in the relevant C header files.

The argument `arg` is optional, and defaults to 0; it may be an int or a
buffer containing character data (most likely a string or an array).

If the argument is a mutable buffer (such as an array) and if the
mutate_flag argument (which is only allowed in this case) is true then the
buffer is (in effect) passed to the operating system and changes made by
the OS will be reflected in the contents of the buffer after the call has
returned.  The return value is the integer returned by the ioctl system
call.

If the argument is a mutable buffer and the mutable_flag argument is false,
the behavior is as if a string had been passed.

If the argument is an immutable buffer (most likely a string) then a copy
of the buffer is passed to the operating system and the return value is a
string of the same length containing whatever the operating system put in
the buffer.  The length of the arg buffer in this case is not allowed to
exceed 1024 bytes.

If the arg given is an integer or if none is specified, the result value is
an integer corresponding to the return value of the ioctl call in the C
code.fcntl($module, fd, cmd, arg=0, /)
--

Perform the operation `cmd` on file descriptor fd.

The values used for `cmd` are operating system dependent, and are available
as constants in the fcntl module, using the same names as used in
the relevant C header files.  The argument arg is optional, and
defaults to 0; it may be an int or a string.  If arg is given as a string,
the return value of fcntl is a string of that length, containing the
resulting value put in the arg buffer by the operating system.  The length
of the arg string is not allowed to exceed 1024 bytes.  If the arg given
is an integer or if none is specified, the result value is an integer
corresponding to the return value of the fcntl call in the C code.This module performs file control and I/O control on file
descriptors.  It is an interface to the fcntl() and ioctl() Unix
routines.  File descriptors can be obtained with the fileno() method of
a file or socket object.;X
d��t4�����������\���Y���8�����zRx�$����FJw�?:*3$"D����X\8���F�E�B �B(�A0�D8�D�N�M�Q�A�#8A0A(B BBBH���� F�B�A �A(�D0�
(A ABBET(A ABB@c��B�E�B �D(�C0�J��0A(A BBBHH���J�B�A �D(�D0�
(D DBBEA(C ABBH�e��B�H�E �B(�A0�D8�I�	�8A0A(B BBBH����J�B�B �A(�D0��
(D JBBEA(C BBB,H�EE�?zRx�� H�GNU����< Ufv@
#�< �< ���o`p�
��> ��
�	���o���o�	���o�oT	���o�< p�������� 0@P`p�������� �#��@1�#��+w#���*L#���&�# 4��������@ GA$3a1@%#fcntl.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug�Vy��7zXZ�ִF!t/��/n]?�E�h=��ڊ�2N�	4���`���`ݢ��k����	�X��7�h�J\��6{�8��p	{&��J^�>�6jr~�R{��O&��H�U����Ӧin}fߑ��[���Y���&X�!�
ah�ȍ�]�
��نT��I�);z�ov��M�W���83��z�$��gգ��6�C�ll��+���$lX4���͂ �@H�Cݐ���S���Š�_��3gp�	Z�Y��@W�C�NZ�Q�����S2[`i.ZN�/��b���:�P����6�<�إ`��d��4х��D�b�HV-�}��Es:�=k�E�l�!�6dM��(��,?Qk�
:]��j&���eA܄�GD�a�-��S�u��G�BRL�;�wQ�0�����٭a�/��0�6�t"�凲Iڸ�tZ�uM,�r��� ?�� �����%�%r�ľ���y��`;�\:+OA���-
��h�X�Ѭ|�ȵ[S��V��`"4�x�ɨ��2�<[�n���R�&�0V�y+�u�YT��[��BSΉ�|d��z��1+M���i�����K�
��X&{���G?îj��qZתݯ�^f�p-wA��� c*�;ߓ���g��#a�}�,H1�XD�|&k��LڝE���\����4ΖY�������.ԭ=!�u�f�=}
��sp���;�{��T	�Q��8�,P�g;`R_?��&��"��.�m���J�D�N2u�x�g2�&���|�On�8��,~GH]Z.��|�-�H��+�m�[�^��5��`��t�cK65�(a7j���D�{�����)#	Z����b]vӑ�p���XSx�޼�>)��D�^Q
D�����ű�g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(���0pp�8���oT	T	RE���o�	�	pT

�^B���h@@c``�n00�w��%}##
�@#@#� ��4�4\�X5X5x��7�7 ��< �<��< �<��< �<��< �<��> �>@�@ @ �A A�A`A$
,A\�A�8E(lib-dynload/resource.cpython-38-x86_64-linux-gnu.so000075500000037420151153537520015747 0ustar00ELF>�@�7@8	@()() �,�, �, �� �,�, �, 888$$)))  S�td)))  P�td�&�&�&\\Q�tdR�td�,�, �, PPGNUO(X���7�SA.v�N��$�B $&��|CE���qXIZ�<��� ,�j ��, �eF"��O�q�J����<+��Y��`4 �h2 �h2 *__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6getpagesizePyLong_FromLongPyErr_OccurredPySequence_TuplePyExc_ValueErrorPyErr_SetStringPyLong_AsLong_Py_DeallocPyFloat_Type_PyArg_CheckPositionalPyType_IsSubtypePyExc_TypeError_PyLong_AsInt_Py_NoneStructPySys_Auditsetrlimit64__errno_locationPyExc_OSErrorPyErr_SetFromErrno__stack_chk_failPyArg_ParseTupleprlimit64Py_BuildValuegetrlimit64getrusagePyStructSequence_NewPyFloat_FromDoublePyInit_resourcePyModule_Create2PyModule_AddObjectPyStructSequence_InitType2PyModule_AddIntConstant_edata__bss_start_endGLIBC_2.2.5GLIBC_2.13GLIBC_2.4f ui	�v����ii
�ui	��, ��, ��, �, 0 �"0 �"0 �"0 �" 0 �"(0 �"00 �"80 �"@0 �"H0 #P0 #X0  #`0 4#h0 >#p0 \#x0 f#�0 �#�0 �#�0 �#�0 �#�0 �#�0 �#�0 �#�0 �#�0 �#�0 $�0 $�0 *$�0 ;$�0 P$�0 D$�0 N$ 1 k$(1 �81 �&@1 u$H1 X1 �&`1 Z!h1 Xx1 @&�1 ,!�1 ��1 &�1 $�1 ��1 �%�1 �$�1 �$�1 0 (2 �$@2  1 �/ �/ �/ �/ �/ 	�/ 
�/ �/ �/ �. �. �. �. / 
/ / /  / (/ 0/ 8/ @/ H/ P/ X/ `/ h/ p/ x/ �/ �/ �/ �/  �/ !�/ "�/ #��H��H�i H��t��H����5Z �%[ ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A�������%� D���%� D���%� D���%� D���%� D���%} D���%u D���%m D���%e D���%] D���%U D���%M D���%E D���%= D���%5 D���%- D���%% D���% D���% D���%
 D���% D���%� D���%� D���%� D���%� D���%� D���%� D��S�������t	Hc�[�g������H��t���1�[�AUI��ATI��USQ�3���H����H�xH��tH�
� H�5
H�9�Z����[H�xH�h ���I�EH��tH�����I�$H��u�����H��u(������H��uH�E1�H�P�H�H��uH�������H�uH�����A��ZD��[]A\A]���ATUH��SH�� dH�%(H�D$1�H��uH�EH�5� H�xH9�u$�+H�ֹ�H�=
������u�������tL�� H�5-	I�:�e���1��H�}�5������t&L�e��v,L�
^ H�5�	I�9�/���1�������H��t��L��M��uH�
b 1���H�5�	H�={	������xdH��L��H�UH���H�����xNH���������uW�F������uL�� H�5�I�8���1��?��uH�=� H�5�H�?���1��!H�
� H�9���1��H�� H���H�L$dH3%(t���H�� []A\���AUH��ATUSH��HdH�%(H�D$81�H�FH�D$H��tH��t$�LH��H�T$1�E1�H�5�������uL�H��H�T$L�D$1�H�5uA������u"��L�� H�5�I�8���1����$L�l$�l$��vH�=� H�5�H�?�|���1���M��M��uL�� 1���H�5��H�=�m�����xeE��t,L�d$ H�T$(L��L�������xGH�L$L��މ��J����H�L$1҉މ��8�����u7�����8uH�
 H�5�H�9���1��/H�� H�:���1��H�T$H�t$H�=~1��%�����H�\$8dH3%(t�,���H��H[]A\A]���SH��H�� H�~H�5� dH�%(H�D$1�H9�uH�=� H�5H�?�O���1���s�����u�H���������t��v/�������H��1�H��uRH�
1 H�5rH�9����1��8H����D�����uH� H�8��1��H�T$H�4$H�=�1��6���H�L$dH3%(t�A���H�� [���USH��H��H�~H�5� dH�%(H��$�1�H9�uH�
� H�5*1�H�9�`����������u�H���*������tH���������t�R������1�H��t������8uH�- H�5�1�H�:����_H� 1�H�8����IH�=� �u���H��H���/�H*D$�Y�
�H*$�X��{����H*D$�Y�
�H*T$H�C�X��X���H�|$ H�C �:���H�|$(H�C(�,���H�|$0H�C0����H�|$8H�C8����H�|$@H�C@����H�|$HH�CH��H�|$PH�CP���H�|$XH�CX����H�|$`H�C`����H�|$hH�Ch���H�|$pH�Cp���H�|$xH�Cx���H��$�H������H��$�H����x���H������H��tH�uH���j���1�H��$�dH3%(H��t�
���H�Ĩ[]�1���f.�f�H�=! H� H9�tH�~ H��t	�����H�=� H�5� H)�H��H��H��?H�H�tH�E H��t��fD�����=� u+UH�=* H��tH�=� �����d����� ]������w������S��H�=� �z���H������H��H�� H�5KH��H�H����=Z uH�5� H�=j �������H�V H�5#H��H�D ���1�H�5�H�������H�5�H������H�5�H������H�5�H������H�5�H���~����H�5�H���j����H�5�H���V����	H�5�H���B����H�5�H���.����H�5�H�������H�5�H�������H�5�H�����
H�5�H�����H�5�H�����H�5�H����H�5�H����1�H�5�H����H��H�5�H���~�H�ߺH�5�j�H���a���H��tH��H�5pH������ H��[�������H��H���expected a tuple of 2 integersinteger argument expected, got floatcurrent limit exceeds maximum limitnot allowed to raise maximum limitresource.prlimit requires 2 to 3 argumentsinvalid resource specifiedresource.setrlimitii:prlimitiiO:prlimitiiOresource.prlimitllinvalid who parametererrorRLIMIT_CPURLIMIT_FSIZERLIMIT_DATARLIMIT_STACKRLIMIT_CORERLIMIT_NOFILERLIMIT_OFILERLIMIT_ASRLIMIT_RSSRLIMIT_NPROCRLIMIT_MEMLOCKRLIMIT_MSGQUEUERLIMIT_NICERLIMIT_RTPRIORLIMIT_RTTIMERLIMIT_SIGPENDINGRUSAGE_SELFRUSAGE_CHILDRENRUSAGE_THREADRLIM_INFINITYru_utimeuser time usedru_stimesystem time usedru_maxrssmax. resident set sizeru_ixrssshared memory sizeru_idrssunshared data sizeru_isrssunshared stack sizeru_minfltpage faults not requiring I/Oru_majfltpage faults requiring I/Oru_nswapnumber of swap outsru_inblockblock input operationsru_oublockblock output operationsru_msgsndIPC messages sentru_msgrcvIPC messages receivedru_nsignalssignals receivedru_nvcswru_nivcswinvoluntary context switchesgetrusagegetrlimitgetpagesizeresource.struct_rusageresourcestruct_rusage: Result from getrusage.

This object may be accessed either as a tuple of
    (utime,stime,maxrss,ixrss,idrss,isrss,minflt,majflt,
    nswap,inblock,oublock,msgsnd,msgrcv,nsignals,nvcsw,nivcsw)
or via the attributes ru_utime, ru_stime, ru_maxrss, and so on.getpagesize($module, /)
--

setrlimit($module, resource, limits, /)
--

prlimit(pid, resource, [limits])getrlimit($module, resource, /)
--

getrusage($module, who, /)
--

���ư>;\
��xH�����#����p�D'�
�E�������zRx�$��FJw�?:*3$"D���\8�+E�O
EQ4|C��B�E�D �A(�A0�(D ABB0����F�A�D �D@� AAB8�$�F�E�A �A(�Dp�(A ABB$���E�G0�A(De�8E�A�J�%AApD���*E�
AzRx�� 5�GNU����, UfvP
, �, �, ���o`X�
��. ���		���o���oh	���o�o	���o7�, �������� 0@P`p�������� �"�"�"�"�"�"�"�"�"## #4#>#\#f#�#�#�#�#�#�#�#�#�#$$*$;$P$D$N$k$��&u$�&Z!X@&,!��&$��%�$�$0 �$�������� 1 GA$3a1P9 resource.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug�EP�7zXZ�ִF!t/��?w]?�E�h=��ڊ�2N��ۤ��6Q�!{}��H�`�`��2�8���'WF�k�4�����i2�[�����7v6�Q�.��pK׽�
��B���k�x�5�lЗ/�x��o��l�Zo�����a#��i?�Ͻ�H��M�$G�٣����	P>CX$Eq>5��S6/�b�9V�6|���
8OIـ�ʎv[#u�}�,U�7Z
^0	9���ͨ����_�ݶ��?as��uZ���̸������S��މ���K�]AD��^�< %岋N(�e��.��~`Ql�K
���o�������R����O;�枿�
8�'��;��f�x�3V�
lT�IJ��U#p*ee$������h���5��{���x��]E�.��e�F��%�}�Ȳ������j#E�s��6�q�����/Y�+5ײ��̴�5?���&o3��>�i�G����em*����p�(�(��n�̂�2P7,����E�Q�4�%!� 'N��jM~��0�
��#iX��
�n�Y���C2?�p��}/���T�����&��,��E���-������g=�R }ʴ�?�MC���7�D��D�W6M�,a�y�%����k�hn�UR�tm�)�4��'5m$4��)�6q~�$7�^
-*\8"�-��D��2��Л�|w�R�������� ��l�xr)�	8��#�"Z�����I`�dz+N�%�r��V�fe�(�X��'�n,�]<�aQI�Mf���́K׬���ʾ��ϕ���x�����:S>�"o��S풤����ǘ�w>΁,E�V��܇�4d��z��5��f��a�.:]�>�a���'���աE�wQq$�t�k��l���	K»+Ӆ���\r���g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(���0XX�8���o		PE���oh	h	`T�	�	^B���hPPcpp�n00�w��J
}, , 
�@ @ � ��&�&\�H'H'��)) ��, �,��, �,��, �,��, �,��. �.8�0 0h ��2 h2� �`4`h2$
�2`�2��6(lib-dynload/_sqlite3.cpython-38-x86_64-linux-gnu.so000075500000345340151153537520015646 0ustar00ELF>|@��@8	@���� ��!�!�$(% ��!�!888$$������  S�td������  P�td�q�q�qQ�tdR�td��!�!��GNUة��I�!dԍ�"��0?
C�	v��@	������H��%8 `�Q�X�PGH�`4������Q�Qc+����������������������������������
��i��w�Щ2�'��@�<2�H%[W�8h��觛�z�����ō'䢣I���P�,��;�G�H�r"6�����uSR[��y@'�D"f�U.:̧���0a� ��_J�g%�l�-�Ǩ�0Ц�ƳJ���[�!wA�o)C�)�˵�g5A
���[�W�,�2?$�JK�(<bHw^Ni=�e�/����ʒ_�z�x�>n�xhP��J)<���d��]9*���;�Z�uE�ɽi�f�BE��k`�P�ҿո7�%�t�ARX~�B�~�����/�H�E��|X�Kl��vGC�A6�M��4�~߆0�2����e$�qX�Td�L���[%`	L��:S��
���f��e� AK��W�
-	xi�K
B
g5Q	_^$���	����	���|�
��|�
 �}dhj	<j�, 	2-�l*�
F"���	��
�B	��m
��b]
�����"B�{��
�@$
��	�
��	Q���l�U&j#���U`���Oo��M�
��t��{�z8��	���W�^�	;���
W�A��gt
���?W�	qRy�-�
0�z���B>���!�, �!���3�
�����N�k��!��(�!*
�!�p9��p�r�0O)�0�;O�!�`Be�!84[��N��Fr��s�0���0�!T�!' �!j�7�`���
p�8�!��L��>b������Xxظ!����,
`�&��>���0��Q`4N���`O;�!��K�
��dB
���!��!�
��9d��O�(��,�!� q �!���!���Q+�F9���;4и!��J9��K	R
��h��!�ȸ!�3G�O0�Lw���|�J��y�!�g`�e9p��	�!��8�!1`�!������@/b���E@M� ;�/`�"n)�ȸ!8�M>��T�O__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libsqlite3.so.0libpthread.so.0libc.so.6pysqlite_cache_dealloc_Py_Deallocpysqlite_node_deallocpysqlite_cache_init_PyArg_ParseTuple_SizeTPyDict_New__stack_chk_failpysqlite_cache_getPyDict_GetItemWithErrorPyErr_Occurred_PyObject_CallFunction_SizeTpysqlite_NodeTypePyDict_SetItemPyDict_DelItempysqlite_cache_display_Py_NoneStructPyUnicode_FromFormatstdoutPyObject_Printpysqlite_connection_deallocsqlite3_close_v2pysqlite_connection_executescript_PyObject_CallMethodId_SizeTPyObject_GetAttrStringPyObject_CallObjectpysqlite_connection_executemanypysqlite_connection_execute_PyObject_CallMethod_SizeT_Py_FalseStructPyGILState_EnsurePyUnicode_FromStringAndSizePyObject_CallFunctionObjArgsPyLong_AsLongAndOverflowPyGILState_ReleasePyErr_ClearstrlenPyUnicode_DecodeUTF8_pysqlite_enable_callback_tracebacksPyErr_Print_PyLong_AsIntpysqlite_noop_pysqlite_converters_PyArg_ParseTupleAndKeywords_SizeTsqlite3_enable_shared_cachepysqlite_OperationalErrorPyErr_SetStringsqlite3_complete_Py_TrueStructpysqlite_ConnectionTypePyObject_Callpysqlite_prepare_protocol_initpysqlite_prepare_protocol_deallocpysqlite_row_deallocPyObject_GetIterpysqlite_CursorType_PyArg_NoKeywordsPyType_IsSubtypePyExc_TypeErrorpysqlite_row_itemPyTuple_GetItempysqlite_row_keysPyList_NewPyTuple_SizePyList_Appendpysqlite_row_subscriptPyObject_RichCompareBool_Py_ctype_tolowerPyExc_IndexErrorPySlice_TypePyObject_GetItemPyNumber_AsSsize_tPyObject_Hashpysqlite_RowTypePyObject_RichComparePyBool_FromLong_Py_NotImplementedStructpysqlite_statement_deallocPyObject_ClearWeakRefsPyEval_SaveThreadsqlite3_finalizePyEval_RestoreThreadsqlite3_errcodesqlite3_errmsgpysqlite_IntegrityErrorpysqlite_DatabaseErrorpysqlite_InternalErrorpysqlite_ProgrammingErrorPyErr_NoMemorypysqlite_DataErrorsqlite3_user_datasqlite3_aggregate_context_Py_CheckFunctionResultPyTuple_Newsqlite3_value_typesqlite3_value_textPyUnicode_FromStringPyTuple_SetItemsqlite3_value_bytessqlite3_value_blobPyBytes_FromStringAndSizesqlite3_value_int64PyLong_FromLong_PyObject_MakeTpCallsqlite3_result_errorsqlite3_value_doublePyFloat_FromDoublesqlite3_data_countsqlite3_column_typesqlite3_column_int64sqlite3_column_textsqlite3_column_bytesPyUnicode_TypePyExc_UnicodeDecodeErrorPyErr_ExceptionMatchessqlite3_column_namePyOS_snprintfPyUnicode_DecodePyErr_SetObjectsqlite3_column_blobPyBytes_TypePyByteArray_Typesqlite3_column_doublePyByteArray_FromStringAndSizepysqlite_InterfaceErrorPyObject_IsTruepysqlite_connection_cursorPyThread_get_thread_identPyErr_FormatPyList_SizePyList_GetItemPyWeakref_GetObjectpysqlite_connection_create_function_pysqlite_func_callbacksqlite3_create_function_v2sqlite3_libversion_numberpysqlite_NotSupportedErrorPyWeakref_NewRefPyLong_TypePyFloat_Typepysqlite_PrepareProtocolTypePy_BuildValuepysqlite_BaseTypeAdaptedsqlite3_reset_pysqlite_final_callbackPyErr_FetchPyLong_AsLongLongAndOverflowsqlite3_result_int64PyErr_RestorePyUnicode_AsUTF8sqlite3_result_textPyFloat_AsDoublesqlite3_result_doublesqlite3_result_nullPyObject_GetBuffersqlite3_result_blobPyBuffer_ReleasePyExc_ValueErrorPyExc_OverflowErrorpysqlite_connection_closepysqlite_connection_create_aggregatepysqlite_cursor_closepysqlite_connection_commitsqlite3_get_autocommitsqlite3_prepare_v2sqlite3_steppysqlite_connection_initPyUnicode_FSConverterPySys_AuditPyBytes_AsStringsqlite3_open_v2_PyObject_CallMethodIdObjArgs_PyUnicode_EqualToASCIIStringpysqlite_CacheTypesqlite3_busy_timeoutpysqlite_Warningpysqlite_ErrorPyExc_AttributeErrorpysqlite_connection_callpysqlite_StatementType_PyObject_NewPyUnicode_AsUTF8AndSizePyOS_mystrnicmpsqlite3_set_authorizersqlite3_progress_handlersqlite3_tracePyCallable_Checksqlite3_create_collation_PyUnicode_Readysqlite3_backup_initsqlite3_backup_stepsqlite3_backup_pagecountsqlite3_backup_remainingsqlite3_backup_finishsqlite3_errstrsqlite3_sleep_PyTime_FromSecondsObject_PyTime_AsMillisecondspysqlite_new_nodepysqlite_cache_setup_typesPyType_GenericNewPyType_Readypysqlite_connection_register_cursorpysqlite_check_connectionPyImport_ImportModulePyModule_GetDict_PyDict_GetItemIdWithErrorsqlite3_interruptsqlite3_total_changes_Py_BuildValue_SizeT_pysqlite_connection_begin_pysqlite_build_py_paramspysqlite_check_threadsqlite3_load_extensionsqlite3_enable_load_extensionpysqlite_connection_setup_typespysqlite_cursor_setup_typespysqlite_microprotocols_initPyDict_SetItemStringpysqlite_microprotocols_addpysqlite_microprotocols_adapt_PyObject_LookupAttrIdpysqlite_adaptPyArg_ParseTuplepysqlite_prepare_protocol_setup_typesPyType_Typepysqlite_row_setup_typespysqlite_row_as_mappingpysqlite_statement_createpysqlite_statement_bind_parametersqlite3_bind_int64sqlite3_bind_textsqlite3_bind_blobsqlite3_bind_doublesqlite3_bind_nullpysqlite_cursor_executemany_PyObject_NextNotImplementedPyIter_Nextsqlite3_bind_parameter_countPyTuple_TypePyList_Typesqlite3_column_countsqlite3_changessqlite3_column_decltypesqlite3_bind_parameter_namePyDict_TypePySequence_CheckPySequence_SizePySequence_GetItemPyExc_LookupError_PyErr_FormatFromCausepysqlite_cursor_executesqlite3_last_insert_rowidpysqlite_statement_bind_parameterspysqlite_statement_finalizepysqlite_statement_resetpysqlite_cursor_iternextpysqlite_do_all_statementspysqlite_connection_rollbackpysqlite_cursor_fetchallpysqlite_cursor_fetchonepysqlite_cursor_fetchmanypysqlite_statement_mark_dirtypysqlite_statement_setup_typesPyInit__sqlite3PyModule_Create2PyModule_AddObjectPyExc_ExceptionPyErr_NewExceptionsqlite3_libversionPyExc_ImportErrorpysqlite_step_pysqlite_seterror_pysqlite_long_from_int64_pysqlite_long_as_int64PyObject_SelfIter_edata__bss_start_endGLIBC_2.4GLIBC_2.2.5�ii
$ui	.�!0M�!�L �! �!@�!yRP�!cT`�!rTp�!|T��!�T��!�T��!�T��!�T��!�TД!�T�!U�!#U�!9U�!LU �!ZU0�!lU@�!~UP�!�U`�!�Up�!�U��!�U��!�U��!V��!V��!VЕ!(V�!6V�!IV�!WV�!eV �!sV0�!�V@�!�VP�!�V`�!�Vp�!�V��!�V��!�V��!�V��!<QȖ!^QЖ!Qؖ!�X�!�S��!�S��!�S�!��0�!��x�!�Sآ!`M(�!��8�! �H�!��!�!�S��!4Q��!����!�o��!�Sȥ!��إ!`o�!T�!���!�n�!$T�!���!`n �!5T(�!�8�!n@�!TRX�!�a`�!HTh�!�x�!�m��!P��!�W��!Pئ!b�!�O�!����!(b�!�W�!hb �!oR8�!�b@�!�WX�!�b`�!�Wx�!X��!X��!�b��!"X��!�b��!0X�!����!�pȨ!��!Ш!�!�!����!iX��!c��!�W��!pX��!Pة!@c�!!P��!`c�!�X�!�c �!�P8�!�c@�!�QH�!P�X�!�c`�!�Xh�!e�x�!d��!�X��!����!Hd��!�Q��!����!xd��!�QȪ!@�ت!�d�!P��!e�!P�!(e �!�O8�!(b@�!�XH�!��X�!`e`�!�Xh�!U�x�!�e��!OY��!�M��!�e��!�Q��!P���! f��!�Xȫ!�ث!Pf�!�X�!P���!Pf8�!mQЬ!`q�!��!�!�!�!@�!��!5Yح!xf�!aY��!iY8�!}Y�!��!د!�Y��!
W��!��!ر!W�!W�!"W�!*W�!7W �!GW(�!aX0�!YW8�!kWP�!Tp�!oW��!yW��!�W�!�W�!�W0�!�WX�!�W��!�W��!�W�!+X(�!W@�!7WH�!�P�!��h�!?Xp�!�N��!MX��!���!�R�!�R0�!�RX�!�R��!;S��!�Rе!$S��!�R �!SH�!MSp�!�W��!\X�!aX�!W�!"W�!*W�!7W �!GW(�!aX0�!YW8�!kWX�!W��!�X��!�X��!�X��!�X��!�Xȷ!Yз!Y�!Y�!�Q��!�Q�!�Q �!2Y(�!9Y0�!?Y8�!�X@�!HYX�!Wx�!NY��!iX��!XY0�!8�!@�!H�!�P�!X�!�`�!h�!p�!�x�!���!$��!%��!&��!'��!(��!���!���!,��!.Ȟ!�О!�؞!;�!	�!E�!J��!��!M�!�!N�!O �!P(�!T0�!U8�!\@�!_H�!nP�!oX�!�`�!�h�!�p�!�x�!���!��!���!���!���!���!���!���!���!�ȟ!�П!�؟!��!�0�!���!
��!8�!���!�0�!�(�!�H�!��!�Ȧ!�!�(�!�H�!h�!���!���!���!��!���!��!�ȩ!��!��!�(�!��!��!(�!�P�!���!�H�!�ȭ!��!P�!H�!��!��!�! �!(�!0�!8�!@�!	H�!
P�!X�!`�!
h�!p�!x�!��!��!��!��!��!��!��!��!��!ș!Й!ؙ! �!!�!"�!#��!)�!*�!+�!-�!/ �!0(�!10�!28�!3@�!4H�!5P�!6X�!7`�!8h�!9p�!:x�!<��!=��!>��!?��!@��!A��!B��!C��!D��!FȚ!GК!Hؚ!I�!K�!L�!N��!Q�!R�!S�!V�!W �!X(�!Y0�!Z8�![@�!]H�!^P�!`X�!a`�!bh�!cp�!dx�!e��!f��!g��!h��!i��!j��!k��!l��!m��!pț!qЛ!r؛!s�!t�!u�!v��!w�!x�!y�!z�!{ �!|(�!}0�!~8�!@�!�H�!�P�!�X�!�`�!�h�!�p�!�x�!���!���!���!���!���!���!���!���!���!�Ȝ!�М!�؜!��!��!��!���!��!��!��!��!� �!�(�!�0�!�8�!�@�!�H�!�P�!�X�!�`�!�h�!�p�!�x�!���!���!���!���!���!���!���!���!���!�ȝ!�Н!�؝!��!��!��!���!��!��!��!��!� �!�(�!���H��H��6!H��t��H����5�1!�%�1!��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&�������h'��q������h(��a������h)��Q������h*��A������h+��1������h,��!������h-��������h.��������h/������h0�������h1��������h2�������h3�������h4�������h5�������h6�������h7��q������h8��a������h9��Q������h:��A������h;��1������h<��!������h=��������h>��������h?������h@�������hA��������hB�������hC�������hD�������hE�������hF�������hG��q������hH��a������hI��Q������hJ��A������hK��1������hL��!������hM��������hN��������hO������hP�������hQ��������hR�������hS�������hT�������hU�������hV�������hW��q������hX��a������hY��Q������hZ��A������h[��1������h\��!������h]��������h^��������h_������h`�������ha��������hb�������hc�������hd�������he�������hf�������hg��q������hh��a������hi��Q������hj��A������hk��1������hl��!������hm��������hn��������ho������hp�������hq��������hr�������hs�������ht�������hu�������hv�������hw��q������hx��a������hy��Q������hz��A������h{��1������h|��!������h}��������h~��������h������h��������h���������h��������h��������h��������h��������h��������h���q������h���a������h���Q������h���A������h���1������h���!������h���������h���������h�������h��������h���������h��������h��������h��������h��������h��������h���q������h���a������h���Q������h���A������h���1������h���!������h���������h���������h�������h��������h���������h��������h���������%E'!D���%='!D���%5'!D���%-'!D���%%'!D���%'!D���%'!D���%
'!D���%'!D���%�&!D���%�&!D���%�&!D���%�&!D���%�&!D���%�&!D���%�&!D���%�&!D���%�&!D���%�&!D���%�&!D���%�&!D���%�&!D���%�&!D���%�&!D���%�&!D���%}&!D���%u&!D���%m&!D���%e&!D���%]&!D���%U&!D���%M&!D���%E&!D���%=&!D���%5&!D���%-&!D���%%&!D���%&!D���%&!D���%
&!D���%&!D���%�%!D���%�%!D���%�%!D���%�%!D���%�%!D���%�%!D���%�%!D���%�%!D���%�%!D���%�%!D���%�%!D���%�%!D���%�%!D���%�%!D���%�%!D���%�%!D���%}%!D���%u%!D���%m%!D���%e%!D���%]%!D���%U%!D���%M%!D���%E%!D���%=%!D���%5%!D���%-%!D���%%%!D���%%!D���%%!D���%
%!D���%%!D���%�$!D���%�$!D���%�$!D���%�$!D���%�$!D���%�$!D���%�$!D���%�$!D���%�$!D���%�$!D���%�$!D���%�$!D���%�$!D���%�$!D���%�$!D���%�$!D���%}$!D���%u$!D���%m$!D���%e$!D���%]$!D���%U$!D���%M$!D���%E$!D���%=$!D���%5$!D���%-$!D���%%$!D���%$!D���%$!D���%
$!D���%$!D���%�#!D���%�#!D���%�#!D���%�#!D���%�#!D���%�#!D���%�#!D���%�#!D���%�#!D���%�#!D���%�#!D���%�#!D���%�#!D���%�#!D���%�#!D���%�#!D���%}#!D���%u#!D���%m#!D���%e#!D���%]#!D���%U#!D���%M#!D���%E#!D���%=#!D���%5#!D���%-#!D���%%#!D���%#!D���%#!D���%
#!D���%#!D���%�"!D���%�"!D���%�"!D���%�"!D���%�"!D���%�"!D���%�"!D���%�"!D���%�"!D���%�"!D���%�"!D���%�"!D���%�"!D���%�"!D���%�"!D���%�"!D���%}"!D���%u"!D���%m"!D���%e"!D���%]"!D���%U"!D���%M"!D���%E"!D���%="!D���%5"!D���%-"!DH��H��H���B���H���I$H���#�H�{ H�/u�!���H�{H�/u����L�KH��M��@Z[]A��H��H��H���H��H��H���H�{H�/�T$�����J$�Cf��K(�D$����H�CH��tH�L$1�H�H�K �C8�$���$��ATL�%�USH�o(H��tlH�E(H��tH�p�H�5z"!H�U0H��tH�J�H�
d"!H�UL��1����H��H��t4H�
�"!�H��H�1����H�uH���
���H�m0�H�"!H�H��[]A\������&����
'H�muH������1�H���O(H����H�mtH�+u�H��H�D$���H�D$��H��H�D$���H�D$��H�����H����H�muH���o���1�H���(H����H�mtH�+u�H��H�D$�F���H�D$��H��H�D$�2���H�D$��H���#���H����H��H�D$����H�D$��(H�mt1���(H����1���(H����(H������H���(1��W)H�������)�Y���H�����|$u�D$����I�,$t\I�/t1I�.�c*�*M��tI�,$thM���I*I�/�?*E1�L���[���M��u��**I�,$t9I�/�*��L���6���I�/u����y����D$�{����u����h���L��E1�����M��u���)H�����v*H� !�8t
�n����`*�$����V*�Z�����+H������*�>�����"+��QH��!H��1�H�5�����1���t
H��!H�Z�1��+H�1�H�J�H�H����+H��H�D$�J���H�D$�+��H��H��H�
N2!H��dH�%(H�D$1�H��L�D$�j���1҅�t1�|$������tH�@!H�51�H�8����1��
H��!H�H�L$dH3%(H��t���H�����H��H��H�
�1!H��dH�%(H�D$1�H�w�I�����1҅�t)H�<$�s�����tH�P!H��
H�,!H�H��H�H�L$dH3%(H��t�+���H���1��d+��1����H�G��@H�{H��tH�/u����H�KH��[H��@��L�
&!H�5��I�9����1��_,H�mt1��4-H��1�����%-A�� L�CHuKH�}HH����/H��!�A�0�,
@8,2�x.�.H�
D!H�5��H�9�]���1���.H�}0�1��)0H�sH�}��'�����x��/�/1��0H�����L�
!H��I�9������0H������L�+!H��I�;����0����0H�����L�B!H��I�8����0�U����U3H�m�2H������1H���}3H�muH�����I�/��1L���~�����1H�+�u3H���g����h3����L3���H�l!H��2L���;����5L�5O!I��X6L�%�!H�5��I�<$����5L�
S!H�5D�I�9����[5H����4H���������D��<7H��!�:t
�N���A�������A����Cl1��k���I��H��tVL�%�!E1�H�{`Mc����H�{`I9�}CL���<�H��I���A�L9�tL��L�����u4A����B�����7L�%V!�w8L�k`H�/�i8�����_8I�m�T8L�������G8�D�;H���:H��H�
3!L��H��P1�H�T$RH�1�L�L$L�D$����ZY��t2�<$��4:�:H�-�!H�5�H�}�|���1���91��9�y��U<�o���<L�$$�=�\�L�E�<H���K��=�A�L�E�n<H�C H�/�.<�!��$<H�C`H�/�<���;H�CHH�/��;�����;H�m��<H��A������{;����?���>H�=�!H�5��H�?��H�+��@H�����@�"�H��u�|$ tL��!H�5H�I�8�P���H��u�H��L���
��?����[@H�
\!H�5m�H�9��H�����z���H������AH�}�r,1��C�D��DH���DRH�
N1!L��H��H�]�H�D$P1�L�L$L�D$��Y^��tvL�D$H�XH�{E1�H�
�,I�PR�5�!Q��T$$H�t$(���H�� ��uH��!H���CH�=�!H�5��H�?�<�1���C1���C1��CL�
X!H�5)�E1�I�9���DI�}u>L�3!H�5,�E1�I�8����DH�����L�-!�EPI�E�{DH�_HH���BD�D1��DF�V�H����FH�{�+�FH�{�+�qF1��F1���G1���G��H���.HH�{��*� HH�{��*�H�D�@HH�H���H������F��G�$���iLH�����NI�,$��KL����H����KH�CPH�/u���H�{XH����H�{`H��tH�C`H�/u��L�%�!H�{pI�$L�cpH��tH�/u��L�-i!H�{xI�EL�kxH��tH�/u�l��G��|$�I���lN�bN��=x�-~x�D$�)M�5��nLH�C0H�/u��L�t$(M����KH�=H!H�5��H�?����MH������LH�CXH�/����������H�$!H�5��H�;����J����NL�
�!H�5��I�9����NH�����<OH�=�!H�5l�H�?�T�1��O����S��SM��I���Q����S�;T��1T��SM����P��TL������Q1���QI�.��SL������S�Eh1���I��H����OE1�H�}XMc��,�H�}XI9�}1L���{�H��H����H;�!tH��L�������uA���L�uXH�/��O�o��OI�.��OL���X��O�D�UWH��0W1�I��H�
�,!L��H�m�H������toH�{H�$H�5��8���u$H�$H���H�H���H����V��VH�=)!H�5��H�?��H���Hǃ�H��tH�/t1��cV��1��WV1��W�D�"XH���W1�L�L$L�D$L��H�
,!H���H������tH�L$H�-i!H�{H9��3W�W1��[W�D�dYH��Y1�I��H�
�+!L��H�s�H���]�����XH�$H�-
!H�{H9��\X�X�D��[H���\1�H�L$H�T$H��H�5���8�����[H�T$H�=t!1�1�H�5�+!�4�H��H����[�@ ��y,�K L�C����� t�@��[H�s0�[H�sH�[H���������Z�C �H���H���?�H�}�%��ZM���yYI��M9�tJF�NA��0A��/�]Y��I������E1�B����0��/�>YI���4YI��M9�u���Y��Y��D��I����L�������^�}�1��]H���~��_�T�D��I�����L�����^H���T��m^�D$�����"�H�UL��H�L$H�5��I����L��H���l�H���n]����t$H��I�����L��A���D�H9\$ ��]�l\A���}Dt4H�}uH��!H�5��H�:��1���\L�|$(A�D��H�
�!H�5��H�9�~�1��\H�|$0������ucH�|$0�A��A������y�I�M9�wh�}@A���f������H;EH�W�����L�Q!H�UHH�5��H��1�I�8�A�1��\H����E�D$�A��v&E����\��[L�
!H�5��I�9������D��I���1�L���	��k\M�gM������I9��R]H�|$ H9���Z��[���`H�=�!H�5��H�?�[�L�����I�/�N`L���Q��A`L�5!H�5V�I�8�&������H��u�|$tL�
D!H�5��I�9����H��u�H��L������]H�+��_H�������_�&�H��!H��7^L�����]��H��I���y�L�������:�H���i��d�3H�l$ H��u���H���HH�|$ ���L�[M�cL�������&cL��A��Kc,�L�>���T�H�D$H��t8L�{A�@t��I;GHu'A�DtdI�H��t@������=`�b�b�x�L�	
!I�WHH�5F�H��1�I�;���taH�
�!H�5��H�9���YaL��!H�5��I�:���>aI�� �a��H����aI��� �aL�l$ �Z��M`H�|$ ��e��a������H�CH�x� ��`H�|$ ����`���`L�����H�=�!H��H�?����`L����L�5I
!H��I�>����`L����L�=�!H��I�?���b`H�|$�?��_�O`��UH��SH��1�QH��!H���0H��tH�EW�H�hH�H�X@(Z[]�[�H��t"H�+uH��1��J��r�H���=��e�1��^����H��tH��t"H��1��/�H�a!H�5�H�8�����������SH���b��1���tH�{�)�H��!H�[�1�[�H�{�0��c1��c�O�H����cH�{�
�c1��\c��UH��SH��H��(dH�%(H�D$1���d��tSH���b��tG1�H�T$H�5;�H��������t-H�{H�t$1�H�L$����tH�r!H�t$H�8��1��
H�*!H�H�L$dH3%(t���H��([]���UH��SH��H��dH�%(H�D$1��&d��tMH���ja��tA1�H�T$H�5��H���0����t'H�{�t$�����tH��
!H�5T�H�8�e�1��
H��
!H�H�L$dH3%(t�B�H��[]�[�H�
g	!H�56�H�9� �1��3eH���Pe���H����eH�\$H�5f!L��H���+�����eH�|$H����1�1�L�����H�|$H�/t0H;�	!tcH����dH��!H�8�=�����oe����JH�D$��H�D$�H�D$��H�D$�dH�(�#eH���g��eH�(uH���T�H��H�5�!L���r����eH�|$H����d��d��H��(H��H�5�dH�%(H�D$1�H�T$H��L�D$H�D$H�x!H�$1��-����1���tH�T$H�4$H�|$��bH�L$dH3%(t��H��(��C��H��u�|$uh�2��H����hH�}H��D���i���WgH�
�!H�5��H�9�N�L��������1gH�-o!H�5x�H�}�'����gL�P!H�5�I�8�	��H�=!H�5!�H�?����H�����lL�=�!�T$I�?�o���T$����z�flL��!A�:t*�L��iL����I�m��L�����i����`iL��H�L$��H�L$�vL�S�qL�-�!H�5��I�}�F��`iL���I���r����H����H�{ H��tH�C H�/tKH�h!H�5�1�H�:�����hH�EH���lL�J(�3rH�����H�{�%l��h����I�.��hL�����hL�S�Rp�D$D�D$��D�D$�D$�Cw�|$L��H�D$���|$L�\$��vH�=�!����H�CHI�.uL���T�H�{HH���GhH�sH�T$(�b����L�sHA�~(��qI�~��q����I�~I�����L��A���K��E��uuH�KL�SHA�F(H�y8A�B(��iA�z,��m��iI�)�%{L�����1��#q�gH�{HH����gH�CHH�/��g����L�sH�)qH����H�l$L�}L�|$I��L�}��H���K���r�H���>���H�=�!L�|$���H�|$H�CHH�/u���H�{HH���G�H�sH�T$8��`����L�{HA�(�d�I��Y�L�|$���L�L$I��I�y���L��A�����E��L�\$��L�CL�SHA�C(I�x8A�B(�`~A�z,�e��P~�k���F��L�KH�D$I�y���H�|$H�D$���H�|$����H�C0A��d��釃L��� ���H�{HH���N�H�CHH�/�<����I�muL�������2�L�{H�\��$�H������H�{����~�X��H�����H�{ H��tH�C H�/�L��!H�5��1�I�;�,��飀�r���`�I�p(韎H����H�EH����~L�D$�E��L�D$�x�H��運H��麋H��锋H����L�KA�A�g���L�=�!I�?������ʑ�P}L�ljD$�����D$�5�H�|$�����
�H�|$@H�/������I�+�@�L�����1��ˇH��H�D$���H�D$鮌�u������H�-�!�}t�����gL���U�������UL����L���7�H�k`1��,�L�M!H�5��1�I�8�����H��1������H�}XH������H������H;!I��tH�H��脖I�.uL������A��H�}XIc��&��H9�|�鬚H�����鏚�D��H�H������S��������Ɯ1�馜H�{��鱜H�{���3��H�|$I�����L���������������H���v�H�{��h�1��H�I��L��鲟H������I��L��鍟H��������H�k`�L��鴝L�� H�5Z�I�8���龢H�k`鵢L���8�H�����頢L���ǢH�k`��H��A���z��D9l$����E1���I��L����I��L����L��餤H���<��鼤���G(�H�� H�5]�H�8���I�.tE1��_�H�������L��E1������B�H�������ȪH��H������L�e�M���D��y�I�.u�L��E1������f���H� �`��USH��H��H�(H����H�/H�o0�&��H��txH�mH�}0�[��H��tdH�/H�o0����H��tQH�mH�}0�?��H��t=H�/H�o0����H��t*H�mH�}0����H��tH�/H�o0����H��H��u�s8������H�{H�/��������H�{L��@H��H��[]A��ff.���SH��H�H�/�������H�{H�/u���H�CH��[H��@��D��SH��H��H�5�H�� dH�%(H�D$1�H�C H�L$H�T$�D$
����������D$���F���Cf�C(�f��H�CH���i��H�T$1�H�H�S �C8H�t$dH34%(uH�� [�������AVAUI��ATUSH��H��H�����I��H���4�0��H����H�{HcCH9G��H�{ L��H�5/�1��`��I��H����H�}� 1�H���0H��H��tzL�l$�~D$L�t$H�s0I�EI�H�@0D$H�p(@I�H��uL�����H�{H��L���*������H�{0H����H�o0H�k0I��M�d$I�$H��L��[]A\A]A^�H�k0H���.���H�u�����u�H�U(H��tH�B0H�S0H�mH�E(�����H���f�����I��������L�@ M9�tI��L�@ M�l$(M���n���I�T$ I;U �_���L��L�P(M��t/I;R ~)L����H�k(�8���H�m�>���H��E1������.���M�\$0M��uVL�k0M�]0M��u(L�T$�~L$H�D$L$AL$(L�c(L�`(���L�T$�~T$H�D$M�b0T$AT$(��M�k(M�l$(L�P(M��u��f.���H�G0H����H��H��@��H�/t��@����SH��H�PH��tH�/u�$��H�{H����H�{0H��t
H�/���H���H����H���H����H���H����H�{pH��t
H�/��H�{xH��t
H�/��H���H��tH�/u���H�{XH��tH�/u���H�{`H��tH�/u�o��H�CH��[H��@��ff.��k���/���fDH�/�b����I���H�/�B����!���8���H�/�����
����������P�������3���@��AT1�I��1�UH�5!SH�����H������H�5e�H��H�����H��H������L��H������H��������H�(����H�+����H���v��H��H��[]A\�f.���AT1�I��1�UH�5�!SH���!��H������H�5�H��H�����H��H������L��H���O��H��������H�(����H�+����H������H��H��[]A\�f.���AT1�I��1�UH�5�!SH�����H������H�5_�H��H���v��H��H������L��H�����H��t:��H�(����H�+�x��H���Z��H��H��[]A\�ff.�H�m���H�+uH��H�D$�"��H�D$H��H��H��[]A\�ff.���SH��H��H�5��H�� dH�%(H�D$1�H�L$H�T$I���X��������H�� H9D$ubH9D$u[H9$uU1�1�H�5d�H������H������H�(����H�H� H�H�L$dH3%(uGH�� [�ff.�1�1�H�5�H���m��H���b��H�(�_��H�� H��������AWI��AVI��AUATA��UL��S��H��dH�%(H�D$1��D$����A���k��H����Ic�L�����Hc�H��I�����I��M�����H�����H��L��1�L��1����I��H���%��H�t$H���I��H��������T$������H���.���D$I�,$����I�/����I�.t7D������D$H�T$dH3%(u%H��[]A\A]A^A_�ff.��L��������������ATI��USH��H������H�߉��o��H���H��H���]��H������H��1�H��L��1����H�+t"H������H�(�}��H����[]A\����H��H�D$�]��H�D$H���`��H�(�I������AWM��AVI��AUI��ATU��SH��H��L�L$�&��H��L���L�L$A��M��H��H�5ڥ1�AQM������ZYH��tBH��H�@���tNH���
�����tOH�+����D���$��H����[]A\A]A^A_�H�
�� �9����������˽H�+u�������H��t�H�~� �:���������ϐ��H�e� H����SH��H�5�H��0dH�%(H�D$(1�H�L$H�T$ ���������H�|$ 1�H�5x!1�����H��H���r��H��H�K� H�T$H�8������Z��H��� H�H�+�Z��H�t$(dH34%(uH��0[����fD��UH��SH��H��HdH�%(H�D$81�H���H�T$�D$H�D$ H�D$1��D$�D$RH��H�L$QH�
�!H�t$0VH��H�|$(WH��L�D$HAPL�L$<AQL�L$HL�D$`�X��H��0������H�|$ H��u.H�=�� H��H��H�|$ �K��H�L$8dH3%(uH��H[]�H��H���)�������f���H�GH�@���SH��H�H���a��H�/�W���l��H�{H���Y��H�/�O���P��H�CH��[H��@��ff.�@��H������UH��SH��H��(dH�%(H�D$1�H����H�L$H�T$H��H�5���n��������H�D$H�5Z� H�xH9���H�T$H�J�������1�H���0H��tH�t$H�|$H�H�pL�GI�L�@H�\$dH3%(umH��([]�H��H�=�������l��1�H�L$H�T$H��H�5��������R����D���������Y���L�G� H�5x�I�:����1���������AUI��1�ATUSQ���H�����I�}H������I��H��~(1�I�EH��H�T�H�r����������H��I9�u�ZH��[]A\A]�ff.���AWAVAUATI��USH��H��H�VH��������wH�E1�L�{0�G��I��H���(I�t$�J�|�H�oH��H���������eL�CA�����L�MA�����D�S A��@��D�] A��@��H�CH;E��A�� ����A�� M������H�}0H����H��� D�U0D�K0F�F8
ueH���vA�H�w�,
@8,2uHH���YE�PD�OF�F8
u)�H9��6�4A�,H��D�2D8*t�I��M9�����L��� H�5�I�:����H��1�[]A\A]A^A_�ff.��H;� �@��H�H��[]A\A]A^A_�\��ff.��x}I�|$L���a��H�H��[]A\A]A^A_�ff.�L�1� H��I�3���H��H���t*H��x@I�|$H�����H��t�H�H��[]A\A]A^A_�����H��t1��ff.�f�I�|$H�wH�����H��u��h���I�|$L�����H��R���ff.�@���B���wtATA��UH��SH��H�~H�5�� H9�ucH�sH�}��u�����-��tH�sH�}D��[]A\����1�A��[]@��A\���ff.�f�H�y� H��������uH�d� H�[]A\�����fD��USH��H��H�uLH�{ H��tH�/t-H�{0tH�����H�CH��H��@H��[]���������f����H�{H�����H�����H�C�ff.�f�UH��SH���"������H�
���Hc�H�>��@H�����L��� H��I�:�6��H����[]�ff.�f��{��1�H����[]�H������H�=�� H��H�?���H����[]�ff.�f�H�����H�-a� H��H�}����H����[]�ff.����AWI��AVAUI��ATA��USH��(���L��A�����L��H�����H�8H���%H��H�C1�1�1�H������L�@8J�H������1�H��H�����H�E����H����H�}H�5F����H��H��t_Ic����H��H���>��E��iH��H���.��H�+I���9��H������M����H�m�5��H�����I�/�-��H��(D��[]A\A]A^A_�
���ff.�f�A�T$�E1�H�T$K��H��H�L$���H�t$���-����uIH���ѽ��H�����H��H������L��H������M�L$L;d$�)���M���ff.�f����%H��H�t$�z��H�|$�D$蜼��Hct$H���?��H��H��u��Y��f�����H������H���g��H���5��H���i���fD���H�E�2���H���_���L��� H�EA�;���������H�5)�L��������H�5t��(��H��H���*������H��诽���j���H���F���L�3� A�:�����\����H�5�L���*���H�m�<���H�������/���H��� H����f�AWAVAUATUSH����WTdH�%(H��$�1����{��H���y���H��H�EHH�x艾��H��A���ξ��Ic����I��H����1�E����H�MA�ދq�����(���H�}H��I��H�趾��L���D$�z���D�\$A���[H�UHD��H�zA��uz�ս��H�����H���`H��H��L��H�����A9��z����t���H���7H��$�dH3%(L����H���[]A\A]A^A_�ff.�@A���A���!���H�MHD��I��H�y�4���H�}Hc�H�xH;=2� ��L���D��H���G���L�-t� I�}軼�������n���H�mHD��H�}���H�����H�\$H��M����H�&�H��1��t���1�H��H���H��H��H��H�q�H�
��謾��I��H������L��� H��I�8�޼��I�.�Q��I�,$uL�����E1����ff.�f�L�E M����I9X��M�HM�<�L;=j� ��H�uHH�~������L�UH��Lc�I�z���H������L��H���o���H���r���H��H�D$H�5��1�L�����H�T$I��H�*uH���׿��M���:���L������fDL�5�� I���苼��L�UHD��I��I�z�]���H;=�� t_H;=�� tfH��L��H�5ۖ1��r���I�������裺��I������&���D��A��H�EHH�x裿��Ic�H��蘾��I���Y���L��舾��I���I���L���(���I���9������ff.���ATUSH������1�1�1���H�CH����tXL�@8N�$M��tKA��H��1�H���;���H��H������H���׸��H�+A������������D��[]A\�ff.��{���H��H��t$H��蛸��H�+A���{�����Ƿ��D��[]A\��{��f.���AWH�
� AVAUATUSH��H��H��H�+�H��dH�%(H�D$1�I��H�$�W��������S@�����o���H;CH���CD����H�{��H�<$H����L�%;� 1�H��1�L��L�$$踷��H��H���^H�xL9���Kl�q�sl�������L�KpL;
� ��H�L$dH3%(H����H��[]A\A]A^A_Ã{D�JH�{��H�<$H��uH�=�� H�<$f.�1�H��1�����H��H����H�xL�%m� L9�uh�{lD�GD�Cl������L�%�� L�KpM9��T���ff.�f�H�}@I�L�M@H���2���H�/�(����5��ff.��L��������u�L�UL��� 1�H�5��I�RI�;�t���H�muH��1��3�������1�����H�H� H�5A�1�H�:������蕸��H�=&� H�SH1�H��H�5^�1�H�?�������H�� H�5ѝ1�H�8跼���i���譺��ff.�f���ATI��UH��SH��H�� D�W@dH�%(H�D$1��$E���v������H;CH�`D�KDE���~H�{�*H��H��H���1�QH�
i� H�t$VL��L�L$L�D$聼��_AX�����<$����L�D$L���H��H�{L�
� �I�ASjj�T$$H�t$(�C���H�� ��u(H��� H�H�L$dH3%(��H�� []A\�L��� H�5�I�8�}���1����Ի���=�-����L�D$H�{H��L�
m� I�PSjj�T$$H�t$(赹��H�� ��u�H�V� H��m���1��f���L�%G� H�5@�I�<$���1��H���蓶��H�SHH�5h�H��H�� H�81�����1�����L��� H�5ϛI�:跺��1�����諸��ff.���AVAUATUSH��H��D�oXdH�%(H�D$1�E���bH��� H��H��H�5�������WL�$$H�{I�$M��L�cH���H�{HH���5��H�{`H�����H�{ H������H�-4� H�{H�EH�kH�PH�UH���H�{0H�HH�k0H�MH���)H�{@H���C(H�CPH�C8����H�EH�k@H����A�t$@���E�,���I;D$H��1�H��L�$$蓷��H��H���oI�|$`H��誷�����~��H�m����C\E1�H�L$dH3%(D���sH��[]A\A]A^�H�/����H�{HH�����H�{`H������H�{ H������H�-� H�{L�EH�kI��L�EH��tH�/����L�EH�{0I��H�k0L�EH��tH�/�J��L�EH�{@I���C(H�CPH�C8����L�EH�k@H��u|L�sA�~@��������I;FHupL�$$1�H���b���H��H��tBI�|$`H���}������Q��H�m�����C\����L�?� H�5șI�:���A�����H�/�z����|���{���L�
� I�VHH�5I�H��1�A��I�9����v���讵��ff.���UH��H�5h�SH��8dH�%(H�D$(1�H�L$H�T$ �
�������H�t$ H;5q� ��H;5�� ��	�H;53� �����H;5�� twH��� H�=��1�H�l$���H��H��t?H�=�� H��H���K���H�+t+���t"H�� H�H�L$(dH3%(u/H��8[]�1���H�߉D$�ε���D$��H��� ��w���衴�����AUATUSH��H��H�oHH����H�{H��t
H�/��H�{ H���"H�{H��tiH�/uc�^���H�{0H���H�/����H�{@H��t
H�/�v���H�{`H��u^H�{htH���̳��H�SH��H��@H��[]A\A]��f�H�{0H����H�/�!���H�{@H��t�H�/����H�{`H��t�H�/u��´��땋E(��u)H�m����H��覴�������蛴������fDH�}t��d���H�}I���x���L��A��轰��E��u�E(H�kH�ff.�H�/�����A�������H�{@H�������H�/���b�����AUATI��USH��dH�%(H�D$x1������L��A���W���H�8��H��H�T$H�t$H�|$�&���H�}1�1�H�5� 蒳��H�}H��H�/��蜳��H����H;�� �H�{�����H�t$ H�����H����׿���t$ ���hH��L������H�+��H�T$H�t$H�|$�I���D��葬��H�D$xdH3%(�H�Ĉ[]A\A]�H���c���L�
� A�9������0�����H�56�L������H�5e� H9�t>�k�����u5H�C���tWH���´��H�������H����H��L������;���H�����L��蒫���&���L���u�������H���X�������H���H�������H�:�����H�l$ 1�H��H��������k���H�T$0H������Ҿ��H�t$ L��H���<���H���d�������ڰ���o���D��AUATUH��SH���G@��t�S���H;EH�#E1�H�}XIc�����H9���H�}XH���e���H���m���H;�� H��tMH�H�xH�QH����G���H�{I���˭��L��裭��H�3H�C�C(H��H�3����A���u���ff.�H�}`臮��H����H�}`1��ө��H���۫��H�� H9����@TH�}`�K���H����H�}`�蓩��H��蛫��H9����@TH�}`����H����H�}`��Z���H���b���H9�t�@TA�H�}`Mc��ԭ��I9�}OH�}`L���#���H���+���H9�t�@TA����f�H�}`藭��H���L���ff.�f�H�}H��td�"��������H�� H�EH�H��[]A\A]�ff.��H�}`�7���H���%�����@(H�H���t���鋼��H��� H���!���H�=�� H�UHH�5�H��1�H�?袪��1��ff.���ATI��UH��SH��H�� D�W@dH�%(H�D$1�E���3���蹫��H;CH��D�KDE����H�{��H��H��H�
i� 1�H�t$H�w�VL��L�L$L�D$�8���_AX�������L�D$H�{H��E1�L�f��H����I�AS�5�� S�T$$H�t$(���H�� ���!���H��� H�H�L$dH3%(u2H�� []A\����L�%{� H�SHH�5��H��1�I�<$�j���1���!���L�R� H�5K�I�8����1��H�-8� H�5	�H�}��1��ff.����AUATUSH���wX����L�oH��M����A�M@���:�F���I;EH��H�E�PD���f���H�x�����H�]HH���}�{(��u>H�EHH�+�x���L�-�� �EPI�EH��L��[]A\A]�ff.�H�{t�����H�{I���(���L��A���m���E��u�C(H�]HH��u�L�-!� �EPI�EH��L��[]A\A]�H�-� H�5��E1�H�}轭���o���L��� H�5R�I�;袭���T����8���L��� I�UHH�5�H��1�E1�I�:趧���(���A�}D�]����:������ATUSH��H�� �W@dH�%(H�D$1���t�ը��H;CH�p�CD���HH�{H������������H�{H�L$L�D$�����H�5��I������L����5������>���H�l$H��ty讨��H��I��蓩��L����	�����euZ菨��H�|$I������L���������չ���+���H�������H��� H�H�T$dH3%(��H�� []A\�H�{���,���H�|$I��诧��L���腧������ff.�f�軦��H�������H�+� H��H�
&� H�5�H�9�߫��1��q���H�=	� H�5ڌH�?�«��1��T����V���L��� H�SHH�5$�H��1�I�8�ץ��1��)���苩���۸��fDATUSH��H�� �W@dH�%(H�D$1����������H;CH�p�CD���HH�{H���������������H�{H�L$L�D$�����H�5сI���?���L����U����������H�l$H��ty�Φ��H��I��賧��L����)�����euZ详��H�|$I���2���L����������4����K���H������H��� H�H�T$dH3%(��H�� []A\�H�{����L���H�|$I���ϥ��L���襥������ff.�f��ۤ��H�������H�K� H��H�
F� H�5?�H�9���1��q���H�=)� H�5��H�?���1��T����v���L�� H�SHH�5D�H��1�I�8���1��)���諧���:���fD��AVAUATUSH��H��H��H��HdH�%(H�D$@1�H���H�T$�D$H�D$0H�D$ 1�H�D$(�D$�D$d�D$RH��H�L$QH�
�� H�l$8UL�D$0APL��� L�L$PAQL�T$DARL�\$PASL�L$p�Z���H��@����H�T$01�H�5�~H�=��������H�|$0�"���H�{P�CDH��H�C8H�������H�{XH�������H�{`H���¶��L�%�� H�{pI�$L�cpH���Ѷ��L�-E� H�{xI�EL�kxH���ض���*����t$I�ƅ��N1�H��H�s����L�����n���H�|$0H�/�O�
������sH�T$(H���bH�=�}蘠��I��H�D$(H����H�{0H�������L9��1H�H����tH��1�H�5�� L��1��J���H��H���;H�5y~H���������WH�m��H�=Q~H�{8H�{0I�L�s0H���|H�|$(H�/�����L$H�=�� 1�H��H�5~�!���H�CP踡��H����H�Ch1��Ч��1�H�CX�ŧ��H�{XH�C`��H����L�cPA�D$8H�+�ҵ���D$D�t$H�{�C �Y�D�s�,������(���H�CH�D$���9����C@f��L���Hǃ����ç��H���M���D���H���H�k� L�5�� 1�H�-�� L�
�� L��� L�-~� �~*H�
� �A~6L�W� �~}L�{� Am�E~H�5b� 1���A~#A8��E��&D����H�L$8dH3%(�H��@[]A\A]A^�H�H�{0H���L�t$(M9���I�N����&1�L��H�5V� L��1����H��H����H�5+|H��L�-�� 躡����u$fDH�5-|H��L�-�� 蚡������H�m�NM�MM����L�K8H�{0I�L�s0H���H�|$(H�/������L$H�=� 1�H��H�5�{覝��H�CP�=���H���PH�Ch1��U���1�H�CX�J���H�{XH�C`�'H���H�sP�F8H�+�Y����T$�|$�S �Yv��{H�{�,�覤��豟��H�CH�D$���²���C@f��L���Hǃ����L���H���M��������ȱ���H�/�����������ff.��L�-� H��衢�����ff.��H�����H��t0H�(�]���H�C8M�����L�R� H�5S�I�:�C���H�|$(H�/���������L�m� H�QH�5�1�I�;�P�����I��L��yI�pH��藟���������I��M�EM��u�����F1�H��H�s蚛��L����� ���H�|$0H�/u�����u-H�T$(H������H�=Jx�R���H�D$(H�������K���H�{����=����l����G������AUATUSH��H�������H;5r� I��H����H�F����H�=� H��1�1�H�5 � �ˡ��H��H���b���H�5�xH��萞����tLH�m��H�
�xI�L$8I�|$0H�I�\$0H��u1�H��[]A\A]�DH�/u�赠����H�5�xH��L�-� �*�������H�mt+I�MH��u�H�=k� H�5l�H�?�\������L�-н H���X��������H�������H�(�����I�D$8�K���L�a� H�P1�H�5܃I�8�D������<���I��H��wH�rH��腝�����[���I��I�UH��u��I���ff.���H���GD���C���H�WH��t)H���|�����tH�q� H�H���H�y� H���H�
�� H�5��H�T$H�9�`���H�D$��f���AVAUATI��UH��SH��H�� �w@dH�%(H�D$1����跛��H;EH���MD����H�}�gH���1�H��H�5�uL���z������߯���Eh�x�}h=����H�=O� �"���H��H�������f�H�@ H�t$@H�@0L�,$�@(L���&���I��H����H���"���H;D$�?H�C0I�EL�k �C,E�$E����M��A�� �D�H�5XvL��������h�H�5CvL���Ĝ�����L�H�5.vL��訜�����0�H�5�tL��茜����@��@�ljC,蚚��H�}H�KL��I��L�D$������͞��L��A�����H�}H�{E����L�L$A�9/�E�H�
O�Nc�I�>A��ff.��1�H���V���I��H���
H�}XH���n������*���I�.����H�L$dH3%(H���{H�� []A\A]A^��I�&�M�������A�L$I�D$���{�� ��M��I���|����C,脙��H�}H�KL��I��L�D$�����距��L��A���̘��H�}H�{E����L�L$A�9/�E�H�5��Jc�H�>���A�y/M�A��E�qL�
��Oc,�M�>A��f.�H��H��L�������A�L$I�D$������ �*���H��L�������A�H������{�� ����L��H��L��u��\���������<���f��I��L�%��A�8/wE�Kc4�L�>���-�����tc��t^H�{���H�CH��� H�5�H�:�"���f�H�+�#���H��1����������t���t�������u�I���r����A�y/M�Aw�A�AH�
��Lc�I�>A��1����A����n���A���u@L�� I�8�1������i���H�� H�5+H�8�s����N���ff.�D�K(E��u
�����-���H�{t��1���H�{I���E���L��A��芖��E��u�C(H�}�H�=� H�5b~H�?�����]����WD����H�t[H��tH��H�=	r�G������ܪ��1�H��H�5�pL���[�������D�EhE�HD�MhA����������DH�
�� H�5�{1�H�9�x����g�������H�UHH�-�� 1�H��H�5�z1�H�}茔���;��������������$���H�}L��H�KI��L�D$���Y���L��A���n���H�}H�{E���M���L�L$A�9/�����E�L�-��Oc\�M�>A������������x�����t���8�����.�����$�����t/��������
�����������p����u������1������t4���"�����a�����t&���T�����J�����@�����6���1��/���L�K� H�5z1�I�:�������������ATI��UH��SH��H���W@dH�%(H�D$1����}����[���H;CH���KD����H�{��1�I��H�
/� L��H��oH��������ة��H�{H�$H�56��衐���������H�4$H���H�H���H��u(H�g� H�H�L$dH3%(��H��[]A\�H�/u����H�4� H���L�/� H�5(yI�8���1��L�
� H�5�xI�9�Η��1���e���L��� H�SHH�53xH��1�I�:���1��l���蚕��f.���ATI��UH��SH��H�� �W@dH�%(H�D$1����ݨ�����H;CH��CD����H�{��1�L�L$L�D$L��H�
�� H��nH��膗���������H�L$H�-2� H�{H9�tQ�t$H�����َ��H�L$H���H�H���H��uGH�EH��H�T$dH3%(��H�� []A\�1�1�1�荎��H���Hǃ�H��t�H�/u�苕��H�EH���H�=�� H�5�wH�?�[���1��L��� H�5YwI�8�A���1��u����Ց��L�
f� H�SHH�5�vH��1�I�9�V���1��J����
���f.���ATI��UH��SH��H���W@dH�%(H�D$1���������k���H;CH���CD���H�{��1�I��H�
o� L��H�mH���������H�$H�-�� H�{H9�tHH�5�������H�$H���H�H���H��uAH�EH��H�L$dH3%(uPH��[]A\�1�1����H���Hǃ�H��t�H�/u������H�=-� H�5&vH�?���1���ݒ���x���L�
	� H�SHH�5FuH��1�I�9���1��p���L�� H�5�uI�8蜔��1��S���D��AUATUH��SH��H��(�W@dH�%(H�D$1�����������H;EH���ED���[H�}�1�H�L$H�T$H��H�5&x������IH�T$H�=�� 1�1�H�5� 轓��H��H���!�@ ���������L�C����� ������@�.H�s0M��������{0��0��/w)I������I��sI����D�VA��0A��/vH�-�� H�5�wH�}�g����4f�M��s�I����D�^A��0A��/w�M��s�I����D�fA��0A��/w�M��s�I��tfD�nA��0A��/w�M��L��s�I��tH�F��0��/�j���I���`���I��t(��<��0��/�E���H���;���H��L9�u�H���ؓ��I��H��trH�|$L�%ķ L9���薓�����	H�T$H���L9���H��豓�����t.H�L$L�P���L9���H�}�L���֓��������H�+uXH���0����ˌ��H��uPH�?� H�H�t$dH34%(��H��([]A\A]�H�� H�5�rH�8�֑��fD�{���H��t�1��E1�1��q���H���H���َ�����D����m���H�sHM��������ux�>��0��/���������L��� H�5�hI�8�_����,����U�����H�=�� H�UHH�5�qH��1�H�?�q����\���H�]� H�5VrH�;�����A���I������E1Ƀ��
�������fD��AWAVAUATUH��H��H��SH��HH��� dH�%(H�D$81�H�T$H�`hH�D$(H�D$1��D$����H�\$ H�D$RH�7hH�L$ QH�
W� L�D$0APL��� L�L$$AQL�L$H�Ȑ��H�� ����H�t$H���Ǥ���u@���_����΋��H;EH������}D�������H�}�M���L�T$(E�ZDE���h���M�bM���.���L9���H�|$ A��H9��"�T$�������豋��H�UL��H�L$H�5\gI���6���L��H�����H�����}����t$H��I���^���L��A���ӊ��H9\$ �H��谏��H��A���e���H�|$ E��D��H�5g1��J���H���/H�(�-���E�L$�A���W���E�������H��I�����L����U�����ujE1�D	���H�H��H�L$8dH3%(��H��H[]A\A]A^A_�ff.�軏������H�D$(L�`����L���
���Ņ�t�����������'���H�г H��H�;�e���1����ff.�A�L$��������E���*����$����t$H��I������L��A���z���H9\$ tAH���[���H��A������H�|$ E��D��H�5�e1����H����H�(�����A�t$����[���E�������L�5�e蟉���t$H��I��耇��L��A�����H9\$ t9H���֍��H��A��苇��H�|$ E��D��L��1��t���H��t]H�(�ߠ��A�|$��������E���/����H�5� H�5~qH�8�&���1��A���L�`� H�5�qI�;�	���1��$������H��I�����L�����H���A�����؊�����AWI��AVAUATI��U��SH��xdH�%(H�D$h1����L��D$蕈��Hc�I������H����H�Å���H��L��軉��H�+I��uH���j���M���VL;=z� �<I�����CH�t$L���ƃ��H���������t$���GH��L���Ո��I�/�E����|$�r���H�D$hdH3%(�H��x[]A\A]A^A_�ff.�@�E�1�H�$M�4�L���[�������~@��ukL���#���H���K���H�������H��H��H���D���H�UH;,$��H��몐���*L������H������H���\���H���f�����L��诈��L���D$�ӂ��Hct$H���v���H��H���{�������DH�5�� H9�t>蟇����u5I�O���t=L�����H���j���H����H��L���������L������L���Ƃ�����H���H���.���H�;�$���L�l$1�L��L���5������!���H�T$ H������ڟ��H�t$L��H��芆��L��貊���(���H�V� H����L��襃���`���H������L��� ������L�� A�:�o����E�����H�5�nL�����������ɇ��鱟��@��AWAVAUATUSH��H��H�5}_H��8dH�%(H�D$(1�H�T$�'������7D�K\E���D�CPE���TH�k�}@���q��H;EH�
H�S�rD����H�z���KX����H�|$�CTL�WA����S�/���H�D$H����L�{E�_@E���ܟ���{���I;GH��E�gDE���+���I�H������蒄������蕄��L�l$ I�L�D$L�����H�5R_I�����L�����փ������L�d$ M���X�K���L��I���0���L����覃����e�5�(���H�|$ I��諃��L��A��考��E��������‚��H����H�=2� H�?�'L�|$A������؃��L�KM��L��H�t$D��I��I�y�
���L���� �������H�l$ H���<���蕃��H��I���z���L������;���H���j�����d����H�|$ ��e��������4���L�D$A�8�b���ff.�@���H����H�H��H�L$(dH3%(�AH��8[]A\A]A^A_�I��������H�|$ I���m���L����C������ff.��{���H��u�H�=� H�?�a���L�l$ ���ff.�����H�SL�bL���;�����woH�
�w��Lc�I�>A��f�L���8���H��H��� H�8�V�������H������1�����L���	���L�-�� H��I�}�&�������|�������L���߄��H��� H��H�:������L�cI�|$�j�������}D��H�}t]�{Xu:H�|$�CTH�G��������H��� H�5�jH�;蛅��1��i���H�ũ H�5NgH�;�~���1��L���L�
�� H�5�fI�9�a���1��/���L��� H�5\fI�8�D���1������؀��H�UHH�-e� H�5�eH��1�H�}�X��1����L�-B� H�5�iI�}���1�����L�5$� H�5�gI�>�݄��1�����т���}����W������UH��H��1�SH���ɂ��H��tGH�}`H��H�������H�u(H�P��H�H��uH�߉D$聃���D$H��[]�H��H�t1���H���a���1���ff.�f���H���GD��tH�t$�H���H�
Q� H�5"eH�9�
���1���H�7� H�50eH�:��1���ff.����ATUSH��H�� dH�%(H�D$1����H�{H�s8H�L$L�D$�����I���݃��L�����~�����Ҝ��H�l$H��tu�l��H��I���Q���L�����~����euV�M��H�|$I����~��L����~�����������}��H�������H�Y� H�H�T$dH3%(uMH�� []A\�H�{胻����~��H�|$I���q~��L����G~����u �}��H���M���H��� H���À������ff.���AWHc�AVAUI��ATI��US1�Q�!���H��H��t#A9�"ZH��[]A\A]A^A_�H�muH���v���1���M�t�L����������~��u*L����z��H���z��H��H��uA舁��H�Q� H��/��u>L�����L��A����y��Ic�H���h���H��H���w���H��H��H��譁���O���H�� H��߃�u�L�����H���v���H���L���9{����{��H���ff.�@���G@��tSH���}��H9CHu
�[ø��}��H�=�� H�SHH�5�aH��1�H�?�{��1�[Ð��UH��SH��H��uH�5ǥ H��1�H��H�=�W��~��H��H��tH�=� H��H���I���H�+tH��[]Ã���H�߉D$�����D$��D��AUI��ATI��UH��L��SH��(H�wH�=BWdH�%(H�D$1��v~��H���gH�=v� H��H����y��H�D$H�+�S���H���t��H�D$H�����{��H���"H�\$H�5�� L��H���q�����H�|$H���F���H��H�5a� L���I������H�|$H��ugH�������H�EH��H�L$dH3%(��H��([]A\A]��H�H��1�1�L����x��H�|$H�/u�� ���ff.�f�1�1�L���x��H�|$H�/uH�D$�~��H�D$H;�� ��H���n���H��� H�:��y����t�~��H�������H�EH���@���1��9����}��f.���AUI��ATI��USH��H��(dH�%(H�D$1�H�GH�t$�G(H���}x��H����H��H��1�H���H��H��H��H;T$�H�C0A��A�I�EI��	�C,L�k I��A�M��t�� ��H�5�UL��� |�������H�5�UL���|�������H�5nUL����{�������H�5�SL����{����A��E��D�[,��y��I�|$H���I��H�KL�D$�
~��L����#y��I�|$H�{��uCH�L$A�L��o�9/���Ic�L�>��H��� H�5�`�����H�;�s}��H�\$dH3%(��u.H��([]A\A]�A��Y���L��H��L������I������.{��������A��t6A��uA�H���h���A��u�H�{������xx��H�C�x���A���A��u��A��t@A��t�A��t��A��t7E��u�A��E��t�A��t�A��tA��u�A��A��u���E1��m���f���AUATA��UH��SH��xdH�%(H�D$h1�H;�� ��H�zH;=\� H��u_H�t$H����s��H���������t$����H�}H��D���
w��H�L$hdH3%(��H��x[]A\A]�ff.�H;=�� �H;=�� uJH�t$H���mu��H���H�L$H������d���H�}I�����H��D���<x���z��������4���H�5� �'x������H�C�����H���H����H�:��L�l$1�H��L����u������H�L$ H����������H�}H�T$I�����D���{��L��D$�d{���D$����ff.�H���Hx��H�}D���<u������H��s�������������H�t$H���;t��H��t�H�L$H������6���H�}I��H��D���w���O����Wx���3����F���ff.�f���AWAVAUATUSH��H��HdH�%(H�D$81��G\H�D$0��������WP����H�oI��D�}@E�����u��H;EH��H�KD�qDE����H�y��D�kXE���kH�H�{`H�sTH���1�H�L$0H�T$(L��H�5VO�r������H�|$(L�GA����1L�l$0M�MM���L;ĝ ��M����I�E���s��H����H�kH�}(��L�CI�x肱��I�,$���I�muL����w���CX�s��H����	H�H��H�t$8dH34%(�tH��H[]A\A]A^A_�L���
u��I��H��t�H�kHH���H�-�� H�{H�EH�kH�/�H�C8���w��I��H���Y���H�T$(1�H��H��x�����>���L�{HM���L�[L��M�sPI�~�]q��H���	�r��I��H����
I�~IcFH9G�JI�~ 1�L��H�5�M��p��H��H�D$��
H��� 1�H���0H��H����
L�D$I�v0L�d$�~D$I�$L�D$I�8H�@0H�p(D$@I�8H�����I�~H��L��H�D$�x��L�L$�������M�~0M��� M�O0M�N0M�qI�L�sHI�,$��E�^(E�������H�KA�F(H�y8tE�v,E���$@L���n��I��H������L�sHA�F(�r��I�~H�D$�w��H�|$A���r��M�\$L;�� t
L;�� ��
L;~� �=
I�L$Mc�I9��=
E1�Ic�H9��(�q��H���H���H�KHL�yM�������$r��L��I���	s��L��A���~q��E�W�A�����L�CE�XE���_��q��L�SHI��I�z�t��L���D$�>q��H9k�PD�D$E���BHc|$�Lu��H�mH�C�ѓ��H�������H�D$��!u��I��H�������L�[H�t$I�{�tt��I��H���v���H�C�@�-L��L�L$�
p��H�|$H���Pu��H���z���L��H��1��t��H�EL��H����t��H�EL��H����t��H�EL��H���t��H�EL��H���t��H�EL��H���t��H�EL��H���|t��L��L�t$H�{L��I���dt��L�t$D9t$���L�sHA�v,����H�C8����A��d�E�~(E���I�,$�j���L���Rs���]���ff.�f�I�D$H;$� ��M�D�H�5B� D�I�E����H�5�� L��L��H�L$L�D$��L�D$H�L$I�(�+H�L$H���l���A�H��H�D$���|$L���*���H�T$�t$H�L$H�*������A������f�H�SH�z�Co��H�HC8A��d�L�sHE�~(E�������I�~���2o��I�~H�D$�Dk��H�|$A���n��E������A�F(����M�N(M�N0M�qI�L�sHI�,$��E�~(E�������H�KA�F(H�y8���E�f,E�����H�y�n��������H�{���H�������H�(�����韏��H;�� H�L$L����
�Tj��I��H������H�H�L$L��� A�:�L���ff.�I�xH;=M� ��H;=ۖ A��D	�H;=
� ���u
H;=�� ����E�_L��L��H�L$D��L�D$D�\$�h���L�L$�t$H�L$I�)�>���L�ωt$�D$H�L$��p���t$�D$H�L$����f�L�s 1��ur��H�C M��tI�.uL���p��H�{ �d���E1�H�{HH��o��A9��[���L�SA�B��A�B�xL�CHD��I�x�Pl��H���_D�A����bA��(�X�xH�p@�����@��(��D�HH�pA���twA��(tq�HH�p���td��(t_�PH�p���tR��(tMD�PH�pA���t>A��(t8D�@H�pA���t)A��(t#D�XH�pA���tA��(tH��D�A���u�H)�H���rp��H����
H��1�H�D$H�5(� 1��1o��H�t$H��H�.uH��H�D$�6o��H�|$H���B
L�
�� H��H�|$I�9�Qi��H�L$H��H�)uH��H�D$�n��H�t$H���
H�{ �n���������A���N���H�x0H���
M�^0I�{0M����	L�L$�~T$H�T$T$P(I�F(H�B(H�@H�H�CHM���gI�,$uL���hn��L�sHM���[���A�v(���ݍ��H�KA�F(H�y8�H���A�~,�=����X����H�C8����1��<���I��������H�P L9�tH��H�P L�X(M���Z���H�x I;{ �L���L��L�J(M�������I;y ��L����H�SHD��H�z�m��H���-���D�E���@�H1�H�PA��[HD����H�p��[���]��D�PH��E����L�@A��[��A��]��D�XL��E����L�HA��[�yA��]�a�HL�ʄ��IH�p��[�4��]�D�PH��E���L�@A��[��A��]���pL��@����L�Z@��[�v@��]��A�3L��@��u�L�S�.����}(�eH�-�� H�{H�EH�kH�/u�`l��H�C8���l��I��H���B�H�T$(1�H��H���l�����'�L�{HM����L�CL��M�pPI�~�Ff��H������g��H���[I�~McNL9O�6I�~ 1�L��H�5�B��e��H��H�D$�&H�� 1�H���0H��H���L�D$I�v0L�d$�~L$I�$L�D$I�8H�@0H�p(L$HI�8H���͉��I�~H��L��H�L$�m��L�L$���v���M�V0M��t,M�J0M�N0M�qI�L�sHM�����I�/�����鳉��M�N(M�N0M�qI�L�sHM��u�����A��� �9A�E9��a���D�D$�g��D�L$I�~H�D$D��D�L$�$m��H�|$H�D$��f��H�|$�D$H����H���D$H�|$�!d��H�������L$H�5�� H�D$L��I9t$H�ƉL$�e�~d��L�\$�|$H��I����H�I�+u#�|$L��L�D$�j��L�D$�|$M����L�
� A�9u=I�@H;� A��H;y� @��A	�H;�� ��A���H; � ��H�5;� �|$L��L��L�D$��L�D$�|$I��I�(��M������|$L��L��L�\$���H�|$D�D$H�/��������A���k���L�����ts��[t_H����H�CH���A�(�����I������e��I�I����a��L���D$�8e���L$��uA�G(L�{H���I9�t
�~� uH��L)�L���i��H���e��ڇ��M�V0M�������I�rL�T$�f������L�\$I�S(H��tH�B0I�V0I�+I�C(�{���L���Ph���n���I�L$Ic�H9����H�[� D��H�5�NH�81��Oc����H�}�������d��H�}I���`��L��A���Cd��E���k����E(�_����b��L�\$�|$I��I�+��������L�5ߌ ��H�5�N1�I�>��b���7�L���'f��I�T$��tqH;w� �6���H;�� �)���L���d��H��H����������I�+�1����|$��b���T$H���H���L�5[� H�5�N1�I�>�Rb������ �8���L�5�� H�5�NI�>��g����M���u����c��H�L$H��I���h����j�H���+���H��H)��g��H���q���1�H��H�D$1�H�5r� �}f��H�|$H��H�/uH�D$�f��H�T$H���3���L�
� H��H�T$I�9�`��H�L$H��H�)uH��H�D$�Ef��H�t$H���O������L�������a��H�����L�=�� H�T$H�5�M1�I�?�/a����L�S���H����������L������L�S�w���H����������H������L�S�X���H��������L�����L�S�9���H�������I���L���A���L�S����H�����������H�����L�S��L�S����8d��L�i� H�5�JI�8�"f���<��}Dt&H�}�O�H�
=� H�56GH�9�e����L�"� H�5�FI�:��e�����`��H����H�����L�L$�~\$H�T$I�A0\$X(����L�_(L�X(M�������L�J(����1�����H�C`H�/����vd�����H�-�� H�5�LH�}�Je���C�H�v� H�5�FH�8�/e���I�L�
#� H�5�JI�9�e���.��`��H�UHH�-7� H�5xEH��1�H�}�*_�����_��H����L�5�� D��H�5�J1�I�>�^���_�H���B�I�����L��H�D$H�L$�c��L�T$M���/�M��H�L$�q�H�}�`��Z`��H�}I���n\��L��A���_��E���;��E(�/��{�������鈁��ff.�@��AWAVAUATUSH��H��XD�\dH�%(H�D$H1�H�D$@E���gD�wPE����H�oI��D�m@E�����__��H;EH�lH�CD�XDE���iH�x��D�SXE����H�H�{`H�STH���1�H�L$@H�T$8L��H�5z;�[������H�L$8H�q�����1��d��I��H����H�t$@H����1��b��H�D$@H���aH��L���Ga�����<���H�|$@H�/�y���L���H_��I��H���+H�kHH���?H�-� H�{H�EH�kH�/��H�C8��b��I��H����H�T$81�H��H��@b������H�{HH�|$H���&L�CL��M�xPI��[��H������\��H�D$H���I�McOL9O��I� 1�L��H�5�7�[��H��H�D$��H�*� 1�H���0I��H����H�|$M�W0L�d$�~D$I�$H�|$L�H�@0L�P(D$@L�M���R���I�H��L��H�D$��b��L�\$���փ��I�W0H���L�Z0M�_0M�{I�L�{HI�,$��A�W(������L�CA�G(I�x8tA�O,���f�L���(Y��I��H���LL�{HA�G(��\��I�H�D$��a��H�|$�D$�/\��I�t$H;5� L��� t	L9���L9���I�L$LcD$L9���1�Hc�L9����2[��H����H�CHL�xM���x�S\��L��H�D$�6]��H�|$A���[��E�O�A���KH�sD�VE���*�\��H�KHH�D$H�y�C^��H�|$�D$�e[��H9k�^�T$���RHc|$�u_��H�mH�C����H���	H�D$��J_��H�D$H����L�KH�t$I�y�^��H��H���C���H�C�@��H��H�T$ �4Z��H�|$ H���w_��H����~��H�|$H��1��_��H�EH�|$H���_��H�EH�|$H����^��H�EH�|$H����^��H�EH�|$H����^��H�EH�|$H���^��H�EH�|$H���^��H�t$H�{H�T$�^��H�D$H�t$9t$����L�SHE�B,E����H�{0H�C8����H�/����aZ��L�[H�D$I�{�`��H�|$H�D$�Y��H�|$�]��H�C0A��d��A��eu"L�{HA�W(����H�CHI�/��~��I�,$�����L���
]�������X��H����H�kHD�U(E���d
L�[I�{�D���I�,$��f�I�muL���\��I�.uL���\���CX�7X��H���~H�H��H�L$HdH3%(�CH��X[]A\A]A^A_�@M�_(M�_0M�{I�L�{HI�,$��E�g(E����|��L�CA�G(I�x8�����E�,E����I�x��X��������H�{���H���-���H�(�����|��ff.�M�L$M9���M�L�H�5ր �I�����H�51� L��L��L�T$ L�D$�L$L�L$���L�L$�L$L�D$L�T$ I�)��L�T$(L�D$ H��������qH��L���L$�t$H�D$���L�L$D�\$L�D$ L�T$(I�)�����i
�L$�f���f�H�KH�y�W��H�{0H�HC8H�/���W��H�D$H�CH�x�h]��H�|$H�D$�	W��H�|$�_Z��H�C0A��d�Y���H���ɗ��H�C`H���l�������I��C����PW��I�H�D$�bS��H�|$�D$�V���t$��uA�G(L�{HM����������f�H�H���dY�����Y}��H�|$@H�/��|��L���eW��I��H���H���H�kHH���\H�-� H�{H�EH�kH�/��H�C8��<Z��I��H����H�T$81�H��H��]Z��������H�KHH�L$H���CL�KL��M�yPI��S��H����U��H����
I�IcGH9G�
I� 1�L��H�5�/�1S��H��H�D$��
H�L 1�H���0I��H����
H�|$I�w0L�d$�~L$I�$H�|$L�H�@0H�p(L$HL�M���t{��I�L��L��L�D$��Z��L�\$����{��M�W0M��tIM�Z0M�_0M�{I�H�|$L�{H����L�|$I�H�L$H��I����{��f.�M�_(M�_0M�{I�H�|$L�{H����L;
?} L�T$L��L�D$�L$����P��I��H���h���H��L$L�D$L�T$H�=} D�E���2���f.�I�yH;=e} ��H;=�} A��D	�H;=�} @��@�u
H;=} ����qL��L��L�T$(L�D$ �L$�t$L�L$����H�T$D�\$L�D$ L�T$(H�*�:���I��L��L�T$(�D$ L�D$D�\$�6W��L�T$(�D$ L�D$D�\$����ff.�L�C 1�L�D$��X��L�\$H�C M��tI�+uL����V��H�C H���Cy���D$H�KHH�y��U��9D$�~���H�S�B�����H�CH�t$H�x�R��H���eD�A����pA��(�fD�PH�pA�����A��(���xH�p@���tw@��(tqD�@H�pA���tbA��(t\D�XH�pA���tMA��(tG�HH�p���t:��(t5�PH�p���t(��(t#D�HH�pA���tA��(tH��D�A���u�H)�H����V��H����1�H�5�� H��H�D$1��U��H�t$I��H�.uH��H�D$�U��L�T$M���HH�=�{ L��L�T$H�?�O��L�D$H��I�(uL��H�D$�FU��H�t$H���H�{ �oT�����xw���D$�N���ff.�f�H�C8����1��z���L�X0M����I�W0H�B0H�T$f��T$P(I�G(H�B(H�@H�H�|$H�CH�=���I�,$uff.�@L���T��L�{HM������E�g(E���Eu��L�CA�G(I�x8�G�A�,�<��G����I��������H�x L9�tH��H�x H�P(H���Z���H�H H;J �L���H�r(H������H;N �+L�F(M���_I;H �
I�p(H���	H;N ��I����M�D$HcT$L9���L��H�=�x �T$H�5(:1�H�?��N����f�D�e(E�������H�}������SP��H�}I���gL��L��A���O��E���g����E(�[����L�|$A�w(�������I�������O��I�H�D$�L��H�|$A���TO��E��uH�|$�G(L�CHL�D$�b���D��R������D�H��E��tuA��[toD�BH�rE��taA��[���JL�Z���*��[t0D�JH�rE��t4A��[�H��H�����t<[u�I��H��L9���t��A�{� IE�H)�H���JS��H�������r��ff.����M��H���st��H�����H�CH�W���H�{H�t$H���Q��H����t��D�E����H�pA��[�;1�D�E����A��[�A��]��H��D�E����A��[��A��]��H�����ty��[����]��H�����t\��[����]��H�����t?<[��<]��H�����t$I��L��I����[�8��]��A�	��u�H�S�B�]���������� ���L$�D$���A��M��I��t$H�D$�AS��H�|$H�D$ �M��H�|$ H���EH��H�|$ �FJ��H�����L��u M9\$H��H�D$L���o�J��L�D$H��I���H�I�(uL��L�T$�CP��L�T$M���H�5Nu ���u6I�BH;%v @��H;�u A��D	�H;�u A��D�u;H;\u t2H�5{u L��L��L�T$���H�L$H�)�;s��H���,�I�‹t$L��L��L�T$���L�D$I�(��r�������D$�t$9t$��������H�}����ML��H�}I���aH��L���D$�K��D�D$E���f��E(�Z�M�_0M�����I�sL�\$�@M������L�T$I�R(H��tH�B0I�W0I�*I�B(�����L����N�����M��I��L��L�X0M��uVI�W0L�Z0H����H�t$�~\$L��L�D$H�F0\$X(����L�X0M��uI�W0H�B0H�����I��I�S(H�P(H����p��I�p(�1����H�zs H�54H�:�3O����}D��H�}���L�
Js H�5C0I�9�O���k�I���1��8���L��L�T$�L��I�T$����L�T$L9��
���H;�r �����L��L�T$�K��L�T$H���I�������D�\$�?I��H�����L�=7s �T$H�5l41�I�?�H�����H�C`H�/����^M�������I��H�=ur H�UHH�5�.H��1�H�?�eH������ �7���H�r H�5�4H�8�M���q��H��H���c�L�=�r H�T$ H�5�41�I�?�
H���A�I�����I��H���^���L�5�q H�5o/I�>�M����L�-�q H�5�2I�}�M�����H�-�q H�50H�}�gM�����L������H���M���H)��YM��H����n��H��1�H�D$H�5� 1��L��H�t$H��H�.uH��H�D$�L��H�|$H���Rn��L�xr H��H�|$I�8�8F��L�\$H��I�+uL��H�D$��K��H�t$H��������
n��L������L��H�D$L�T$ L�D$�L$�K��H�D$H����I��L�T$ L�D$�L$����H���L$L�D$H��I��L�T$�w����H��p �T$H�5m2H�81��sF����I�(uL���0K����F��H���n��L�Cp �T$H�5�21�I�:�6F���j��E��L�D$I��I�(��������L������H���s����m��H��H���T���H��H���+���H���M����nm��H��H�����H�����H���+����^m��H�������Ym��H��H������L�����H�~H���"���H�������j��H�lo H�5=,H�8�%K�����I���k���m����m��ff.����AWAVAUATI��USH��H����F��I�|$H����K��H��A���+F��H�CH�-�o H9�t	H;�n u7H9���L�sIc�E1�L9���Ic�L9���H��[]A\A]A^A_��� �uA�E9���NF��I�|$D��H����K��H��I���E��M����I�H�<$��B��I��H��t�H�
~n H��H��H9K���YC��H��H����H�I�/uL���H��H����H�5n �>u6L�EL;�n A��L;pn A��E	�L;�n A��E�ukL;n tbH�59n H��H�����H�mI��uH���H��M�����L��D��L������I�/uL���D$�cH���D$���A������I����I�/�<�����C��H���D��H�5�/L�-Hm I�}H��1�[]A\A]A^A_�7C��H�(m L��D��H�5s.H�8H��1�[]A\A]A^A_�C��H;�l ����H���E��I��H����������H�SH9��L�l�I�EH�=�l �?��H�5m L��L�����I�mI����M������E�oL��L��L�$D�����L�$I�+tL��uE�������B��H�������D��H�5.L�-�l ��H��l H�;�B���������^���L�߉$��F���$�L��H�$��F��L�$�f���I�uH;5�l A��H;5]l ��A	�H;5�l A��E�u
H;5l �
���M���.���H;�k H�����M?��I��H������H�����D��H�5~-�2����A��I�/H���D����G�����A��H�������L�%�k H�$H�5�-1�I�<$H��[]A\A]A^A_�9A��H���D����H�C�3������ �j���H��j H�5�-H�:H��[]A\A]A^A_�F����B��I��H����������ff.���ATUSH�H��t1�iB��H�{I����A��L�����A��H�C���C([]A\�1���f���ATUS�o(��u��[]A\�f.�H�t0H���B��H�{I���>��L����[A����u��C(��[]A\�1��D��AVAUATUSD�O\E����h��D�GPH��E���H�o�}@���_�CA��H;EH��H�C�pD���oH�x�G�KX����ST����H�k`H���\H�{@H;=�j H�C`ucL�SHM��tNM�bM���6�A��L��I���B��L��A���v@���?��H����E�^�A���
A��d��[H��]A\A]A^�H��H��H�5�1���=��I��H����g��H�m�)L�KHM���}g��M�iM�����@��L��I���oA��L��A����?���/?��H���?g��E�E�L��A���xA��d�k���ff.��CXH��聀���CXH�C`H���=���H�{H���H�m��H��1��C������f.�H�kHH��t`�E(��u!H�CHH�m��f��1�[H��]A\A]A^�H�}t��?��H�}I����;��L��A���?��E��u�E(H�kHH��u�1����H���B������H�
4h H�55:1�H�9�kC���v���H��g H�5 %1�H�:�NC���Y����}Dt(H�}�����L�ig H�5b$1�I�:� C���+���L�Lg H�5$1�I�;�C������L���=��H�������H�{H��`{������v>��L�
g H�UHH�5D#H��1�1�I�9�<�����L�-�f H�5r'1�I�}�B�����f���AVAUA��ATE1�UH��S����e��H�}XIc���>��H9�~qH�}XH���5:��H���=<��H;vg H��tAH�H�x�F�>��H�{I���=��L���y=��H�+H�C�C(�de��A���f.�E����H�}`�^>��H����H�}`1��9��H���;��L�5�f L9����@TH�}`�">��H����H�}`��j9��H���r;��L9�t�@TH�}`��=��H��~rH�}`��99��H���A;��L9�t�@TA�H�}`Mc��=��I9�}9H�}`L���9��H���
;��L9�t�@TA����H�}`�=��H���]���[]A\A]A^�H�(�@(�����:d��fD��ATUSH��H�� �W@dH�%(H�D$1����d���A<��H;CH�K�CD���&H�{H�����Z<��������H�������K<��H�{H�L$L�D$�����H�5dI���y@��L����;������c��H�l$H����c���<��H��I����<��L����_;����e��c����;��H�|$I���d;��L����:;������c���}:��H���^c��H��d H�H�T$dH3%(u$H�� []A\��K:��H����c��H��d H����=��H�
�c H�5� H�9�j?��1��H�=�c H�5h H�?�P?��1����:��L�xc H�SHH�5�H��1�I�8�h9��1��h������AWAVAUATUSH��1�H����?��H���zI��L�-�D�K\E����D�CPE���^H�k�}@����c:��H;EH��H�C�pD����H�x��KX����ST���fH�k`H����H�{@H;=�c H�C`��L�SHM��tNM�rM�����8:��L��I���;��L��A���9����8��H���#b��E�^�A���-b��A��d��H��L���Q<��H�m�����a���H�kHH��t�E(����H�CHH�m��a���t8��H���+H��L��[]A\A]A^A_�f�H��H��L��1��6��I��H����a��H�mu
H���<��DL�KHM����a��M�yM�����A9��L��H���&:��H��A���8����7��H����E�G�A����L��A��d����f��CXH���Ay���CXH�C`H�������H�}������8��H�}I����4��L��A���8��E��u�E(H�kHH����������ff.�I�,$uL���;��E1����L��` H�5;!I�8�c<�����L���7��H��u
H�{H���t��H�{H���H�m�g���H���8;���Z���H�
�` H�5�2H�9�
<���?���L�9` H�5
I�;��;���$���H�` H�5�H�;��;���	����m7��L�
�_ H�UHH�5;H��1�I�9��5������}Dt�H�}�����L��_ H�5�I�:�;�����H��_ H�57H�:�g;������__���r_�����AVAUATUSD�O\E���w_��D�GPH��E���)H�o�}@�����6��H;EH��H�C�pD����H�x���KX�����ST���;H�k`H���|H�{@H;=�_ H�C`��L�SHM��tNM�bM�����6��L��I���m7��L��A����5���-5��H����E�^�A����A��d��[H��]A\A]A^�H�kHH���\�E(����H�CHH�m��^����4��1�H��u�H�-B_ H�E�ff.�H��H��H�5�1��2��I��H���;^��H�m�OL�KHM���,^��M�iM�����5��L��I���6��L��A���5���K4��H���^��E�E�L��A����A��d������CXH���u���CXH�C`H����[H��]A\A]A^ÐH�}������ 5��H�}I���41��L��A���y4��E��u�E(H�kHH�������L�-/] H�5�I�}��8���3��1�H���{������L���z3��H��u
H�{H��8q��H�{H�o�H�mu�H���7���H�
O] H�5P/H�9�8���H���7�����L��\ H�5{I�;�c8���w����3��L�
�\ H�UHH�5�H��1�I�9�z2���N����}Dt�H�}�5���L�U\ H�5NI�:�8���"���H�:\ H�5�H�:��7������ff.���AWH�
�q AVAUATUSH��H��H��H��H��(dH�%(H�D$1��C(L�D$�D$1��8�����2\��1��e8��I��H���\��E1�D�C\E���l�{P���|H�k�u@������2��H;EH��H�S�JD����H�z�pD�KXE����D�STE���H�k`H����H�{@H;=$\ H�C`��L�[HM��tMM�sM�����2��L��I���3��L��A���2���`1��H���`[��A�F����H[��A��d�&H��L����4��H�m�[��A��D9l$������1��H��uMH�L$dH3%(L���IH��([]A\A]A^A_�H�kHH��tǃ}(��H�CHH�mu���Z��I�,$��Z��L��E1��5���H��H��H�5�1��.��I��H���]Z��H�m��L�CHM����Z��I�xH���{H�|$�1��H�|$I���2��L���D$��0���?0���T$H�����J�����L����d�����CXH���q���CXH�C`H�������� H�}�����"1��H�}I���6-��L��A���{0��E��u�E(H�kHH���������H�
.Y H�5�H�9��4���w���H�Y H�5�H�:��4���\����}DtOH�}�����H��X H�5�H�8�4���0����60��H�=�X H�UHH�5H��1�H�?�.������L��X H�5tI�8�\4�����L��X H�5I�;�A4������L����.��H��u
L�KI�y�l��H�{H���H�m�����H���3������1��L��X H�5�*I�:��3���v���H����2�������X���{X��f.���AV��H�=�j AUATUS�#3��H����X��I�������X���%����X�������X�������X�������X���A����H�ZW H�5p
L��H��*��H��X H�5L��H��*��H��W H�5�L��H��*��H�W H�5�L��H��q*��L����.��I��H���'H�-W 1�H�=H�u��0��H�5W H�H����H��H�5�
L���?*��H�u1�H�=�
�0��H�X H�H����H��H�5�
L���*��H�31�H�=�
�0��H�
�V H�H����H��H�5�
L����)��H�31�H�=�
�Q0��L�%�V I�$H���WH��H�5y
L���)��I�4$1�H�=r
�0��H�5�U H�H��� H��H�5X
L���d)��I�4$H�=S
1���/��H�=�V H�H����H��H�57
L���-)��I�4$1�H�=3
�/��L��U I�H����H��H�5
L���(��I�4$1�H�=
�t/��L�
�U I�H���{H��H�5�	L���(��I�4$1�H�=�	�=/��L�nV I�H���DH��H�5�	L���(��I�4$1�H�=�	�/��L�/V I�H���
H��H�5�	L���Q(��H��U H�5�	L��H�-�J L�%�H��)(��f�Hc}�'/��H��H����H��L��L���'��H�+�vU��H��L�e�M��u�H�=_	��(��H��H��t|H��H�5U	L���'��H�m�+U��� 0��H���(��H��H��tJH��H�5	L���'��H�+��T��L����71��H�@U H�H��tH��H�5�L���V'���Q*��H���}T��[L��]A\A]A^���T�����USH��H��t&H���Y+��H��H���>,��H����*��H����[]�1������UH��SQ��*����wH�
"��Hc�H�>��H����-��H�-�S H��H�}�.����Z[]�H���-��H�=�S H��H�?��.����H���-��L�CT H��I�8�.�����'���H���-��L�
�R H��I�9�.���H���c-��L��S H��I�:�.�����-���y���H���=-��L��R H��I�;�[.���Z���fD���-�����SH��dH�%(H�D$1�H�t$�%��H��H��t:�|$tH�>S H�5�H��H�8��-��H�T$dH3%(H��uH��[��(��H��t�����+��f�H�=Al H�:l H9�tH�>R H��t	�����H�=l H�5
l H)�H��H��H��?H�H�tH�
R H��t��fD�����=�k u+UH�=
R H��tH�=G �i(���d�����k ]������w������QH���,��H��tH�Z����UH��SPH��}*��H�}H���q*��ZH1�[]�f.���H��P H�=�Q SH��P H��8H��8��$�����*E��H��[��$��f���AUATI��USH��Q�������E��H�=%�v+��H��H����D��H���B(��H���E��H�5Rj H����#��I��H����D����+��H��H��t.I�$L��1�H���+��H��L���/)��H��H��H�/u��*��H�m��D��ZH��[]A\A]����SH���c�������D��H�{��#��H�=�[��1���,�����H�=�O H�fO H��8�#��f���H�=�P H�FO H��8�#��f���SH���,��H�j H����E��H��H��H�5[�"����H�=�O H�P H��N H�WH��8�7#�����H�uR H�=�N H��]��H�T$��~D$�H��8O Gh�"��D��H�=-P H��N H��8��"����H��H���O|i%S <- %S -> %S
executescriptexecutemanyexecuteOOOcommitrollbackreplaceissssUOO|diOiOipNo item with that keyIndex must be int or stringstep<unknown column name>asciiCould not decode to UTF-8y#siO|$pError creating functionO!(OO)siO:create_aggregateError creating aggregateCOMMITBEGIN IMMEDIATEO&|diOiOipsqlite3.connectBEGIN Oicannot delete attributeBEGIN DEFERREDsqlite3.ConnectioninsertupdatedeleteO:set_authorizerOi:set_progress_handlerO:set_trace_callbackparameter must be callablemainO!|$iOsO:backupsleep is too largeiiisqlite3.dumpError enabling load extensionadapterscan't adaptO|OOO|OROLLBACK|i:fetchmanyPARSE_DECLTYPESsqlite3.Errorsqlite3.Warningsqlite3.InterfaceErrorsqlite3.DatabaseErrorsqlite3.InternalErrorsqlite3.OperationalErrorsqlite3.ProgrammingErrorsqlite3.IntegrityErrorsqlite3.DataErrorsqlite3.NotSupportedErrorOptimizedUnicode2.6.0sqlite_versionconverterssqlite3: init failedsqlite3.StatementkeysReturns the keys of the row.sqlite3.Rowsqlite3.PrepareProtocolcomplete_statementenable_shared_cacheregister_adapterregister_converterenable_callback_tracebacksPARSE_COLNAMESSQLITE_OKSQLITE_DENYSQLITE_IGNORESQLITE_CREATE_INDEXSQLITE_CREATE_TABLESQLITE_CREATE_TEMP_INDEXSQLITE_CREATE_TEMP_TABLESQLITE_CREATE_TEMP_TRIGGERSQLITE_CREATE_TEMP_VIEWSQLITE_CREATE_TRIGGERSQLITE_CREATE_VIEWSQLITE_DELETESQLITE_DROP_INDEXSQLITE_DROP_TABLESQLITE_DROP_TEMP_INDEXSQLITE_DROP_TEMP_TABLESQLITE_DROP_TEMP_TRIGGERSQLITE_DROP_TEMP_VIEWSQLITE_DROP_TRIGGERSQLITE_DROP_VIEWSQLITE_INSERTSQLITE_PRAGMASQLITE_READSQLITE_SELECTSQLITE_TRANSACTIONSQLITE_UPDATESQLITE_ATTACHSQLITE_DETACHSQLITE_ALTER_TABLESQLITE_REINDEXSQLITE_ANALYZESQLITE_CREATE_VTABLESQLITE_DROP_VTABLESQLITE_FUNCTIONSQLITE_SAVEPOINTSQLITE_RECURSIVESQLITE_DONE_sqlite3upperdatabasetimeoutdetect_typesisolation_levelcheck_same_threadcached_statementsurido_enable__conform____adapt__connectiondescriptionarraysizelastrowidrowcountrow_factoryExecutes a SQL statement.fetchonefetchallcloseCloses the cursor.setinputsizessetoutputsizesqlite3.Cursortotal_changesin_transactiontext_factorycursorCloses the connection.create_functionenable_load_extensioncreate_collationinterrupt__enter____exit__BEGIN EXCLUSIVEnamenargfuncdeterministicn_argaggregate_classauthorizer_callbacktargetpagesprogresssleep_iterdumpfinalizedisplayFor debugging only.sqlite3.Cachesqlite3NodeChanging the shared_cache flag failedinstance of cursor required for first argumenttuple required for second argumentuser-defined aggregate's '__init__' method raised erroruser-defined aggregate's 'step' method raised errorCould not decode to UTF-8 column '%s' with text '%s'SQLite objects created in a thread can only be used in that same thread. The object was created in thread id %lu and this is thread id %lu.Base Connection.__init__ not called.Cannot operate on a closed database.factory must return a cursor, not %.100sdeterministic=True requires SQLite 3.8.3 or higherRecursive use of cursors not allowed.Python int too large to convert to SQLite INTEGERcould not convert BLOB to bufferBLOB longer than INT_MAX bytesuser-defined aggregate's 'finalize' method raised errorBase Cursor.__init__ not called.isolation_level must be a string or None, not %.100sinvalid value for isolation_levelshared connections not availablethe query contains a null characterYou can only execute one statement at a time.SQL is of wrong type. Must be string.Error setting authorizer callbackUO:create_collation(name, callback)invalid character in collation nametarget cannot be the same connection instanceprogress argument must be a callableuser-defined function raised exceptionCannot operate on a closed cursor.script argument must be unicode.Failed to obtain _iterdump() referencestring longer than INT_MAX bytesoperation parameter must be strIncorrect number of bindings supplied. The current statement uses %d, and there are %zd supplied.Error binding parameter %d - probably unsupported type.Binding %d has no name, but you supplied a dictionary (which has only names).You did not supply a value for binding %d.Error binding parameter :%s - probably unsupported type.parameters are of unsupported typeError while building row_cast_mapexecutemany() can only execute DML statements.adapt(obj, protocol, alternate) -> adapt obj to given protocol. Non-standard.Repeatedly executes a SQL statement.Executes a multiple SQL statements at once. Non-standard.Fetches one row from the resultset.Fetches several rows from the resultset.Fetches all rows from the resultset.Required by DB-API. Does nothing in pysqlite.Return a cursor for the connection.Commit the current transaction.Roll back the current transaction.Creates a new function. Non-standard.Creates a new aggregate. Non-standard.Sets authorizer callback. Non-standard.Enable dynamic loading of SQLite extension modules. Non-standard.Load SQLite extension module. Non-standard.Sets progress handler callback. Non-standard.Sets a trace callback called for each SQL statement (passed as unicode). Non-standard.Executes a SQL statement. Non-standard.Repeatedly executes a SQL statement. Non-standard.Creates a collation function. Non-standard.Abort any pending database operation. Non-standard.Returns iterator to the dump of the database in an SQL text format. Non-standard.Makes a backup of the database. Non-standard.For context manager. Non-standard.Gets an entry from the cache or calls the factory function to produce one.@L��L��?��L��L��L��L��}��L��L��L���L��?��L��L��L��L��L�����PL��PL��^���t���v���v���v���v���v���v���v���v���u���u���v���v���u���v���v���v���v���v���v���v���v���v���v���v���v���v���v���v���v���v���v���u���v���v���v���v���v���v���v���v���v���v���v���v��Mw���v��&w��t���u���u���u���u���u���u���u���u��u��u���u���u��u���u���u���u���u���u���u���u���u���u���u���u���u���u���u���u���u���u���u��u���u���u���u���u���u���u���u���u���u���u���u���u���v���u��fv��Hs��?u��?u��?u��?u��?u��?u��?u��?u��u��u��?u��?u��u��?u��?u��?u��?u��?u��?u��?u��?u��?u��?u��?u��?u��?u��?u��?u��?u��?u��?u��u��?u��?u��?u��?u��?u��?u��?u��?u��?u���w��?u��?u��x��?u��x���r��lt��lt��lt��lt��lt��lt��lt��lt���t��@w��lt��lt��@w��lt��lt��lt��lt��lt��lt��lt��lt��lt��lt��lt��lt��lt��lt��lt��lt��lt��lt���t��lt��lt��lt��lt��lt��lt��lt��lt��lt���t��lt��lt��|w��lt��dw���q���s���s���s���s���s���s���s���s���s���u���s���s���u���s���s���s���s���s���s���s���s���s���s���s���s���s���s���s���s���s���s���s���s���s���s���s���s���s���s���s���s��6v���s���s��iv���s��ms��q���r���r���r���r���r���r���r���r��r��r���r���r��r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r���r��r���r���r���r���r���r���r���r���r���r���r���r���r���s���r��fs��g�������&��������������&�����������q����&������������������&��G���G����&���������1&������������������'&�����������������1&����������������������P&������o&��e�������������������������������������������������������������������������������������������������������������������������������������������������������������������$�������������������������}��a��}��}��}��}��Z��}��}��}����a��}��}��}��}��}��>��"��"�����enable_callback_tracebacks(flag)

Enable or disable callback functions throwing errors to stderr.register_converter(typename, callable)

Registers a converter with pysqlite. Non-standard.register_adapter(type, callable)

Registers an adapter with pysqlite's adapter registry. Non-standard.enable_shared_cache(do_enable)

Enable or disable shared cache mode for the calling thread.
Experimental/Non-standard.complete_statement(sql)

Checks if a string contains a complete SQL statement. Non-standard.connect(database[, timeout, detect_types, isolation_level,
        check_same_thread, factory, cached_statements, uri])

Opens a connection to the SQLite database file *database*. You can use
":memory:" to open a database connection to a database that resides in
RAM instead of on disk.SQLite database cursor class.Cursor needed to be reset because of commit/rollback and can no longer be fetched from.SQLite database connection object.@@�@;����0(��Xh
����
���
��p0������P����:������L�������	�
��P	�
���	���	E��<
x��P
��h
����
����
������L�������@���
X���
���D����u��T����������:�� ���������d�������D����.������p���>��[���e��������\����	��l-������x!���W!���Y!��d�!��x�!����!���'"��|�"���m#��r#����$���%��|�%���@(��lq+���+��`,����,�� �,��p )-��� �-��� �-��L!.��p/���H/��0�/���H2���X2��h2��x2��0�3��dX4����4���5��`�6����7��	x8��d	h9���	x9���	(:���
;��(;��0�;��`�;��t�<���8=��T�?��H
�@���
(A���
�A��X�D����H��hxI���L��N���Q��4R��`�S����U��(XX��x�Y���H[��X(]���_���Hf����g���Xh���o���q����r��(t��p�w����{����~�����h���Ȅ����������Xh���$؇��P�����(���h����������������0h��\������ ���t����X�� ���� ���!(��`!h���!X���!h���!������� 
����8��,����(���H���h�������������� zRx�$��P
FJw�?:*3$"D���@
(\�(���P�A�G �D�A�zRx� ��( ���h_��A ��m
A�A�C�)��;E�mzRx�� ��� )���E�Q0�
AAzRx�0� p��H@pl)��FF�B�E �A(�A0�G@�
0D(A BBBA(�`���F�H�A ��AB�L+��
�H+��D+��@+��LE��
WTn��,P\,���F�H�H �D0d DABzRx�0���$��`,��,���F�H�H �D0d DABh:��`<��,���F�H�H �D0`
 DABOg GAB�F��L LP-���E�Q0�
AO4Z��H�.��/F�E�E �B(�D0�D8�FP�
8A0A(B BBBM zRx�P������(����0�.���F�D�A �G0Y
 CABE�d��-TP/���F�E�E �E(�A0�C8�GPNX^`IXAPz
8C0A(B BBBA�%��+��/���(��1Ek �t/���E�N@�
AAzRx�@� ��3< ���H �T����H w@l�/���E�D�G`EhMpMxI�J�G�S`}
AAAzRx�`�� ������������/��
�/��QE�CPJ��%\L 0��
(`0��)E�D�G@�
AAAzRx�@�� �������ES4��0��eF�G�A �A(�A0K(D ABBzRx�0����$����@�0���F�B�B �B(�D0�A8�G@
8C0A(B BBBMU
8A0A(B BBBQW
8A0A(B BBBOz
8A0A(B BBBA zRx�@������(���[$���&E�D�A VDAL4�2���N�D�D �{
�A�B�LG�A�F�^ ���U
ABAzRx� ���$���/(��2���E�A�G w
AAJH�(3���A�D�D E
CANK
CAA^
CAN_CA�;��gHD	�3���F�E�B �E(�D0�A8�D`�
8D0A(B BBBR zRx�`������(���L�	6���B�B�B �B(�A0�A8�G�
8A0A(B BBBP$zRx��������,��`8T
H9���F�A�A �i
ABLm
ABA)��:H�
�9���F�I�B �B(�A0�A8�TP�
8A0A(B BBBA$���\�;���F�D�D �G@[HMPSHB@cHVPBXB`R@g
 AABAKHAPBXB`R@zRx�@���$���fHHPWHA@@�H=���F�B�B �A(�A0�G@k
0A(A BBBA zRx�@�����(���( �?���E�K�DP�
AAA8L�@���F�B�A �A(�G0�
(A ABBD�L��<��A��;F�B�D �A(�G�
(A ABBA zRx������(����8
�C��rF�B�A �D(�D0�
(A ABBMH4��Ld
�E��dF�D�D �G@HHYPSHB@UH\PFXA`R@g
 AABA(T����VHZPRHA@cHAPFXA`W@L�
�F��F�B�A �A(�D0�
(D ABBLO
(D ABBA(5��u0D�G���F�A�A �G@
 AABAb��80��I���B�A�A �G@
 AABA`R��a`�K��9F�B�B �A(�A0�MxV�M�M�G�N�G�G�Np[
0A(A BBBA zRx�p�����(��|8p�Q���F�B�A �A(�D0�
(A ABBF�C��3�S��gH o
AzRx� .��@4S��XF�B�B �D(�D0�GPF
0A(A BBBI zRx�P�����(���
0�Z��VF�D�D �G0�
 AABA<����0�0[���F�D�D �G@�
 AABA���j0x\��kF�D�D �G0�
 AABA�$��X8\�]���F�B�A �D(�GP�
(A ABBAzRx�P����$��)`��`��F�B�B �B(�A0�J8�D�J�M�N�N�N��
8A0A(B BBBL$zRx��������,���$HlPd��F�E�B �B(�D0�C8�D��
8A0A(B BBBP$zRx��������,1���H��f���F�B�B �B(�A0�A8�Qp�
8A0A(B BBBA zRx�p������(��$x���>E�D�F lAA�<��>S�f���A(��j��sE�I�D0E
AAA�Pk��THW
A4���F�B�D �A(�D0�(D ABBH
���dd=��.I�d�\��/E�a�3��C0��j��"F�A�A �G@�
 AABA�	���8H��k��F�E�B �E(�D0�A8�C@S
8D0A(B BBBA D�l��OL�TA�F�g$h����E�D�G@�AA$�!���E�D�G0�AA�T���`���l��0E�fU��D(<l��kE�D�D0D
AAA8<�l���F�E�D �G(�DP�
(A ABBH��������H0v����)��;8��m���F�E�D �A(�GP�
(A ABBA8p��3F�B�D �D(�D�w
(A ABBO zRx������(����L|�q��F�B�B �B(�A0�A8�G�~
8A0A(B BBBA�����L�����F�B�B �B(�A0�A8�G��
8A0A(B BBBE$zRx��������,�
��1�l ���bF�B�B �B(�D0�A8�GPb
8A0A(B BBBAs
8C0A(B BBBE[
8C0A(B BBBE�
8A0A(B BBBEv
8A0A(B BBBE(��GF�A�A �w
ABA4H���[F�A�A �J
ABKs
ABAP�,���NF�B�B �A(�A0��
(D BBBA

(D BBBA zRx�0�����(]��G<��F�B�E �D(�D0��
(A BBBA|P��a0`\����F�A�A �G@
 AABA4i���H�ĩ���F�B�B �B(�A0�A8�I@R
8D0A(B BBBJ$���AP4���bF�B�B �A(�A0��
(D BBBA
(D BBBB�p��AHp<���F�I�B �B(�A0�A8�T`q
8A0A(B BBBA0Q��X��������<�Գ��9F�N�B �A(�A0�
(D BBBAh9���(L����9E�A�D f
CAA(xԷ���E�D�A }
AAA�����	 �����wE�D [
AAGNU�0M�L �!yRcTrT|T�T�T�T�T�T�TU#U9ULU	ZU
lU~U�U
�U�U�U�UVVV(V6VIVWVeVsV�V�V�V�V�V�V �V!�Ve<Q^QQ�XUfv�Hg
�O�!�!���o`�
:��!`�W@9�	���o���o9���o�o�6���o��!�g�g�g�g�g�g�g�ghh h0h@hPh`hph�h�h�h�h�h�h�h�hii i0i@iPi`ipi�i�i�i�i�i�i�i�ijj j0j@jPj`jpj�j�j�j�j�j�j�j�jkk k0k@kPk`kpk�k�k�k�k�k�k�k�kll l0l@lPl`lpl�l�l�l�l�l�l�l�lmm m0m@mPm`mpm�m�m�m�m�m�m�m�mnn n0n@nPn`npn�n�n�n�n�n�n�n�noo o0o@oPo`opo�o�o�o�o�o�o�o�opp p0p@pPp`ppp�p�p�p�p�p�p�p�pqq q0q@qPq`qpq�q�q�q�q�S80�S�S�����S `M�� ���!�S4Q���o�S��`oT��n$T��`n5T�nTR�aHT��mP�WPb�O��(b�WhboR�b�W�b�WXX�b"X�b0Xp���ph��!�!��iXc�WpXP@c!P`c�X�c�P�c�QP��c�Xe�d�X��Hd�Q��xd�Q@��dPeP(e�O(b�X��`e�XU��eOY�M�e�QP� f�X�Pf�XP�PfmQ�`q��!�!@�!5YxfaYiY}Y@��!�Y8
W����������!WW"W*W7WGWaXYWkWToWyW�W�W�W�W(�W0�W8�W@+XW7W���?X�NMX���R��R��R��R�;S��R�$S��R�S�MS��Wp\XxaXW"W*W7WGWaXYWkWW�X�X�X�X�XYYY�Q�Q�Q2Y9Y?Y�XHYWNYiXXYGA$3a1Hg�O_sqlite3.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug���.�7zXZ�ִF!t/��*��]?�E�h=��ڊ�2N�vB�M,�¾�dMZ�)���P������"}Uay�|"5j��,�`m(����K�r	�;���nǜ�����Eʷm6��j�(�|U�eB�\��;}����l����
,����_��۳�G�A�6��UTL�����!A����L�
�r�E6N�é��2��U�@M�_��!��f��Ҫ`�LY<��g[�x�ML�U-����?��vQ��s�߳!*��w���
�p
�|nT�|{�vr�)�žu.S��§X�Zh�&�8�ÚL�+J}�|i�o~;��͛F�+���9�}f�Ƣ#��]�jӟ5��L.���U��ume>>�vgYkץ|�pT��\����=��
��6��X�*���o�܍�/s(�ɕ���F�������⯘��n
�LI#C��Q���CmU�6��xQ�Kt�*��z(��j���:�Y҃�;>3�.F!��
��'���歔���"R�N�@��Dc�x������g�g$�.3�G�k�o�VD��
.?�Q�@Z�ӃG�΃K�����&����VK���S#�p���W�j����49��hR=G�I�m�=^��+����A�Ȩ5���T�(�#1v6�k�o;4W������v\O�,�LD(�$ �D�J-��S`��#�W^Û@ZC���O"��Vͱ8c&M;V�O����d���F��@�H,u"�
�zrN��nj���b�G�;�<D�C,=}���eg�+�
��\E�����$�R
~ۈgZ0R��wF��45&���0��@� .��)�|�k.َxn-�Ks��%t�,����>:q2�B�`J�d��cxnV$:-�<��)z*uP��N��o:���0����E��-�#�"�X��-��OZ��<I�W�R�|1x��-?
w@G��m(�3J�%��֘T���B�T�5
p��Л���rE��ֱt�z�98<�=��C^��{T�0�Pj��.�ÀDZU�nͲIou���l�P5��R���ݻq5�NC><�e�3��[�S��m%<��S_y����4�*�(�=�]�'\��Pƈ<O>
�g����-�qY��-��!���S��h;��0����y4*���Th��x���e�%]�(ikK�H���AM�8D2�C��@�O(�CZ�?�y�Si�J`\z
�vI�ZF�B)�`oZ�-@��)�
��n��n�F�|.xx��^��a�1[�.�7Zb���U�5��cLAYz��zR;NhxYQR�}-=�+ro�;HǑF����������D
����[��O
�6��ҋp��¨�˘��W(d��bסJ�tr��|!�}��b�N��̲6���q��,��dcS�O���g��H�\{u�s��$H�t,u绶��(d��N�����?Ъ���T����Ivs�;��r2&�=�e�y�+y�Tf�,���/��*n�5<�$�x<��:W5!2�F*rq	�E��&�i��z��n��:.t=`�e��o|���2�Ք?W�뗽&6d��
�F_��r�s��X�Ǐ����Rm6�/�涟���+�w�Tß�AvDt��E�=�Y.���	�E�u�Zh�n��Va\{i�Lg40��Š�`�;�>k����uV�����7)���a����y
)��/�Jpc^z�;
��kӳKIdm���SKk�B�)�����`nԑ����s��|k��&8q�4yj��Ϧ�=P����������7ȫK[�b���(4��0���g�H�|R2���k�dψ�쩐��۱����$ҽk�N��nk�C��ܚ$�ܞ���3G%��KR���%���ǵL}�L��L���=��IW�0�E��]|�PfBl3{�����|�ֿ��Gr,C����0�0��tH�H��AƔ?0{'=y
�C�P�uj�c'��ݶrÄ��n@��T��VRt��h�ٺ�#rtZ�
E��'�dz��U\���*�N/��݄U��j[�o��tWɧ��[�Am�;�8L}���C�Tn�ʸ�p���:h�m�-��aA}���t���^-�k>wmי0����P}֒�����x_�AԹr|�yHr�ĺčb��~�.��y��+�Ԭ�b9�|��:t{����G�ZY��7�NCNl�F�~f7I�]�㝰=���OU�d^Q��7�1`�j��*�=�ѵs=M
���Ȧ�=H"�_y"j&��.�z��yWΈ�m+�/c����U����g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``�(�0��:8���o�6�66E���o990T@9@9�^B�W�W`hHgHgcpgpgP
n�q�q@
w||��}�O�O
��O�O�! ��q�q��v�v������ ��!���!�� �! �� ��!����!�����!�� �ȸ!ȸp�8�aȸ$
�`L�,	x�(lib-dynload/_lzma.cpython-38-x86_64-linux-gnu.so000075500000123060151153537520015216 0ustar00ELF>�)@�@8	@���� ЊЊ Њ P
h
 8�8� 8� 888$$`�`�`�  S�td`�`�`�  P�tdX}X}X}<<Q�tdR�tdЊЊ Њ 00GNU���h�DžW�s��oS܍�R�@0RTU��|CE���qX����
�W@ U�U�G-l���� �{������, YF"�l��8�� �f��D[dB�B��~*�$�s��K�w�1�v����1�/�(8� � � � � i�^'__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1liblzma.so.5libpthread.so.0libc.so.6PyLong_AsUnsignedLongLongPyErr_OccurredPyExc_OverflowErrorPyErr_SetStringPyMem_RawFreePyMem_RawMallocPyErr_FormatPyErr_NoMemory_PyBytes_Resizelzma_endPyThread_free_lockPyMem_Free_Py_DeallocPyLong_FromUnsignedLongLong_PyDict_SetItemIdPyLong_FromLongLongPyModule_AddObjectPyObject_GetBufferPyBuffer_IsContiguouslzma_properties_decodePyDict_NewfreePyBuffer_ReleasePyExc_ValueError__stack_chk_fail_PyArg_BadArgument_PyArg_CheckPositionalPyFloat_TypePyType_IsSubtype_PyLong_AsIntlzma_check_is_supportedPyBool_FromLongPyExc_TypeErrorPyMapping_CheckPyMapping_GetItemString_PyArg_ParseTupleAndKeywords_SizeTPyMem_Malloclzma_properties_sizePyBytes_FromStringAndSizelzma_properties_encodelzma_lzma_presetPyExc_KeyErrorPyErr_ExceptionMatchesPyErr_ClearPyThread_acquire_lockPyEval_SaveThreadlzma_codePyEval_RestoreThreadPyThread_release_lock_PyArg_UnpackKeywordsPyNumber_IndexPyLong_AsSsize_tmemcpylzma_get_checkPyMem_ReallocPyExc_EOFErrormemmovePyExc_MemoryErrorPyErr_SetNonePySequence_SizePySequence_GetItem_Py_NoneStructPyThread_allocate_locklzma_auto_decoderlzma_stream_decoderlzma_raw_decoderlzma_alone_decoderlzma_easy_encoderlzma_raw_encoderlzma_alone_encoderlzma_stream_encoderPyInit__lzmaPyTuple_NewPyModule_Create2PyModule_AddIntConstantPyErr_NewExceptionWithDocPyType_ReadyPyType_GenericNew_edata__bss_startGLIBC_2.14GLIBC_2.4GLIBC_2.2.5XZ_5.0�@����ii
ui	f(�Њ X؊ �W� � � j� j� &j � �f(� .j� �g�  9� @m � �i(� �I8� �l`� �f��  w�� �i�� �v�� �iА �vؐ �i�� @v@� �gH� <X�  s�� �i�� Z�� �|�� �i�� pZ�� �{�� ,gȑ  Xؑ �z(� ej@� �� �� j�� �f�� ~g�� &jȒ � В ?j� {g� ~g� kj� uj � xj(� {j0� ~j8� �j@� �jH� �jh� �j�� �j�� kjȓ kj� {j� xj(� ujH� {gh�  � p� �g�� {g�� �j�� {gȔ �j�� 9j� �7�� `wȕ @� Е `� � �K�� Pj�� P80� @nh� � �� 0R�� �� �� �� �� �� �� �� ȏ Џ !؏ 5� 6� �� `� h� p� x� �� 	�� 
�� �� 
�� �� �� �� �� ȍ Ѝ ؍ � � � �� � � �  � " � #(� $0� %8� &@� 'H� (P� )X� *`� +h� ,p� -x� .�� /�� 0�� 1�� 2�� 3�� 4�� 7�� 8�� 9Ȏ :Ў ;؎ <� =� >� ?�� @� A� B� C� D � E(� F0� G8� H@� IH� JP� KX� L`� Mh� Np� Ox� P�� Q��H��H��n H��t��H����5Jl �%Kl ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&�������h'��q������h(��a������h)��Q������h*��A������h+��1������h,��!������h-��������h.��������h/������h0�������h1��������h2�������h3�������h4�������h5�������h6�������h7��q������h8��a������h9��Q������h:��A������h;��1������h<��!������h=��������h>��������h?������h@�������hA��������hB�������hC�������hD��������%�g D���%�g D���%�g D���%�g D���%�g D���%�g D���%�g D���%�g D���%�g D���%�g D���%�g D���%�g D���%�g D���%�g D���%�g D���%}g D���%ug D���%mg D���%eg D���%]g D���%Ug D���%Mg D���%Eg D���%=g D���%5g D���%-g D���%%g D���%g D���%g D���%
g D���%g D���%�f D���%�f D���%�f D���%�f D���%�f D���%�f D���%�f D���%�f D���%�f D���%�f D���%�f D���%�f D���%�f D���%�f D���%�f D���%�f D���%}f D���%uf D���%mf D���%ef D���%]f D���%Uf D���%Mf D���%Ef D���%=f D���%5f D���%-f D���%%f D���%f D���%f D���%
f D���%f D���%�e D���%�e D���%�e D���%�e D���%�e D���%�e D��ATI��U1�S�~���H�����H��u(��H9�tH�f H�5<9H�:�����	A�$���[]A\���ATI��U1�S�0���H���8���H��u(��H9�tH��e H�59H�:�����	A�$���[]A\�H��e H�59H�:����R1�����1��H�=�m H�5g91�����H�=�m H�5h<�`���������H�=zm H�5�;�>�������
H�߉D$����D$��
H�+uH��������I�L$H�@<H�5K<H�=<�w����.H�ֹ�H�=�;�y������-�.L�L$H�50h H��A�Q�4
���1.H�+tJ1��$.L�D$H�5�g H��A��
���.��H�T$H�5h H�ߋ������-�H��1������-H��c H�5>8H�8�&���H��1�[ÉD$�e����|$H���X.��H�
�c H�5p7H�9���2���H����0H��1��d���H�=�k D��1�H�5a8�����0�2���1��0�&�����/1��0�E���H��H���/I���01�E1��0H������?.E1��0�
���H���_0H��b H�57H�;�?����1L����H�{0�EH�{H�]���H�|$1�I������H�T$(L�{@H�J I)σ�
���|$��H�{Hu�L�����H�=�j H�5�9�����1���H����I���D���L���\�������w� 1�L�d$@L�|$0���H�D$(H��t#H�xH�p L�{(L�c0H�s@H�{H�LH�/tE1��
���E1��{
L��H�s9E1�H�5�9H�=�9����b
L���D$�����t$��vsH�=&j ��1�H�5�5�����U
����K
H�=j H�5�8�����3
H�|$H���a	���
L�L$(M�YO�T9 L�S@M)�L�[H�H�=�<Lc�I�>A������I�v0Idž��L�%(a I�<$�O���H�mtV1��bI������I����H������H������A����*I�v(L�l$@H�L$0H�����yH��1��h����I�������JH�
j` H�5�41�H�9�����L���,���I�������I���1��0������l����F���H�=�h D��H�5Z41������H�=�h H�57�S�����H�<$����H�=nh H�5:7�2���������I�$H�a7H�5�71�H�=�7����.L���y���I����H�5�_ H�>�����H�r_ H�54H�8����H�+��H���1�����'���E1���L� _ �H�5�41�I�8����L��������H��tH�+�v�E1��H�UH��	w=H����H�����'����H������H������H��!�pH�@H9�u2�\H�|$E1�H�A���m�Ic�H��H|$H�?������L�=�^ H�5*2I�?������ �����F�I����L��E1���T$H�=�f 1�H�53������GH�������XH�/t{E1��}����H����H������H��������5ǃ�� 1�����H�D$H��t�H�xH�p H�C(H�C0H�s@H�{H��H���E1���k��H�=�e H�5`4����H�{HtjL���O�H�{Ht{�S�L��I���3���L�|$I�W L�{@I)׃�
t�L��D$��D$��vqH�=re ��H�5!11��R��L�����H�=Ne H�54�����pH�|$H������YH�|$L�ON�D? L�C@M)�L�KH�!��Ic4�L�>����4���L�l$M;}tH�|$L�������L�l$��H�=�d H�5B3����PL��E1�L�2_ 1�1�L��H�D$Pjj���H�� I��H��� H�H��t\H�zH�5�[ H9����{����I�<$����toI������I��H�D$���H�D$�-1��~I��I�m�eL���J�H����Q��I��t�ML�-�[ ���H�h[ H�5�3H�;����cH�=�c ��H�5Y/1����H�=�c H�5Z2�R�������H�-�Z H�5E/H�}�,���L�
�Z H�5�0I�9���M!H�=2c D��H�5�/1����0!L��$�L���l���!H�@H9�$�uH��$���H�
1Z H�51A�H�9��E1�Ic�H��L�H�?��!H�A������H�=�b H�5c1�[�� ��� H�=ub H�5�0�9��x H�=]b ��H�5.1��=��\ L��D��L��E1����Mc�I��M�I�:���I�z�D$A���r��D$��H�=�Y H�5�1H�?�����pL�-?Y H�5�/I�}����QH��$�L���o�A����1��,��UH��SH����H����H��u��H9����]�H��[]�1����H����@��H��H�����H��������1�H��H9��v�H���/�ff.�@H�����T�H��3��Hc�H�>��1�H���H�=�` H�5�/����H�=�` H�5�/����H�=�` H�5T,����H�=�` H�5,�r��H�=�` H�56/�]��ff.�H�H�HH��H��L�DH��~I9�L���K�ff.���SH��H���H��uHH�{(�3�H���H��tHǃ�H�/t)H���H��t��H�CH��[H��@���O���8���fD��SH��H��(���H���H��t�n�H�CH��[H��@��ff.�f�ATI��UH��H��SH�����H����H��H��L��H����H�+��H��[]A\�ff.�f�ATI��UH��H��S�n�H�����H��L��H��H���T������[]A\����AWf�1�AVAUATI��USH��L��H��dH�%(H��$�1�H�l$0)D$0H��)D$@)D$P)D$`)D$p�#����V�CH���~����/�H���1�������������*� 1�L�d$@L�l$0�<�H�D$(H�����H�HH�P L�k(L�c0H�S@H�KHL�C(L�L$(L�D$L�-�0L�L$��H�|$1�I����L�T$(L�{@I�� M)�M���D$D�\$��
u	E����L���D$�`��t$�����IcD�L�>���H�{0�N�L�d$(M;|$��H�|$(L���x������H���L�t$(��H�|$8tH���N�H��$�dH3%(L����H�Ę[]A\A]A^A_�f�H�{H��L����H�{0���L�d$(M9|$tH�|$(L��������t8L�d$(M��H����0�H�|$8�n����q���H�=�\ H�51(��H�|$(H���2��'�H�=�\ H�5?+�f���H�=�\ H�5s+�Q���H�=x\ H�5	(�<��H�=c\ H�5+�'��E1��m�����L�-�S H�5�+E1�I�}���=���f���AWAVI��AUATI��UH��SH��dH�%(H��$�1�H���Ff�)D$0)D$@)D$P)D$`)D$pH����H�����H�����H�\$0I�<$1�H���
����w�CH���e����'�H���sI���1���������A���@�t$@���3I�v(L�l$@H�L$0H����I�~(I�N(I�����M�n0H�|$� 1����H�D$(H���\L�hH�p H�|$(I�v@H�-.M�nHH�|$�x�H�|$1�H�$�X�L�D$(M�~@A��I�� M)ǃ�
�|H�<$�3�A�����E��NcT�I�>A��f.�A�E�����A���)I�~H�XI�~0�v���H�l$(L;}t$H�|$(L���+�����{H�l$(H����A���I�v0��H���)I�~HI�F(�=AƆ�I����2�H�|$8tH�����H��$�dH3%(H���H�Ĩ[]A\A]A^A_�fDL�if��)L$0I�)L$@)L$P)L$`)L$pH��L��A�1�H��$�L��U H��Pjj��H�� I��H���&H�\$0H�81�H��������CH���������I��������I�T$H�5�P H�zH9�����������I�|$��I��H����H����I�/I�����H����|I���1������"�A����mI�v(L�l$@H�L$0H����M�F(I�N(M�n0L�D$�D$I����/���L���,���ff.�@I�~0���I�~HH�<$�����I�~H�����M9��OH�l$(L9}���������f��|$AƆ���I�����H�|$8��������I�����M���I�V0M���M��H�<K�I)�H)�M9��L9��}L��H����I�V(Mn0H�T$�D$I����2������DH�l$(AƆ�L;}�������@AƆ�H����I����S�H�|$8�%���H�|$0��������H�|$��A����W���H�=�V H�5,"��H�|$(H��tH�/u���I�F(1��H�=�V H�5u%�S���H�=zV H�5%�>��H�=eV H�5�!�)��H�=PV H�5	%���f�I�~(M�����I���M��tI�m���H��������ff.�I���H���%H����I���H���1I�v0H��I���H��I�v(���I���I�^(���H�|$L���!��������L�\$(I�SK�L; I�N@L)�I�VH���O�<*L)�L��H�L$I)�H�4$L����H��H���3�I�~0H,$I���H�L$M���I�n(H�����D�H�������1�����H�=uL H�5�$1�H�?������L��H�$�[�I���H�$I�~(I~0�_���I���O���I9������AƆ�����g���f�AWAVI��AUATUH��SH��XH�|$H��dH�%(H�D$H1���H����aI��H�����E1�H���7H�D$@H�D$L��L����H��H���H��������H�5_#H���l�I��H����H����H�EI�/�=���H���A�H�UH��	��H����H���}H��H�=�S H��1��D$@L�T$@L�
��ARL�D$H�
�O H��"�\�^_���Y�(�x�H�����f��@@D�\$8D�XH�EH��A��H�+���E���I��H��M9�����H�l$I��1�J�D%����H�L$HdH3%(�HH��X[]A\A]A^A_�ff.�H��!�vH�5
"H����H�D$@H����H����H�D$��H����H�|$A���|$L9����H�|$ H�|$@H�D$(H�/����p�f�I��H����H�xH��H�H��H�@hH�D$(H)���p���H�L��H�t$ �r����L�M�W,L�O�ARI�w(H�r�M�G$M�O ASH�
��I�VH��I�GM�WRAPH�!ASAQQH�
�L WH�=�Q ASP1�ASARASAWASL��$�L��$��o�H�쀅��DL�}H�+�(�I��H��M9��"����J���ff.�@H�@H9��w���L�5�H 1�H�5` I�>���H�+�{H�\$H�E����H�;��i��������f.�L�aH I�;�������J��T��D$�p���I��H�����H�xH��H�H��H�@h1�H)���p���H�L���t$���������I�w,L���VI�W(L�
��M�W$M�_ APH�
 �I�GRI�I�wAQARH��APASQH�
�J P1�APWH�=P APVH��APAWAPL��$�L��$����H�쀅���M��L�}A�����@H��H�=�O H��1��D$@L�|$@H�
LL AWL�D$H�L�
����ZY�������H�������T$8�H�EH�+�E������L�%�F I�<$�f������H�+�)����V�L��F H�5�I�8���L��E1��~���%���H�
jF H�5�H�9����1����H�|$@H�/�^���L�
9F H�5�I�9���1����L�-F H�5�I�}���H�+��������`�����t�fD��AW1�AVAUATUSH��H��(H���dH�%(H�D$1����������������:ǃ�� 1����H�D$H�����H�HH�P H�C(H�C0H�S@H�KHL�D$L�k(L�D$H�->!L�5g!����L��I���b��L�L$L�{@�D$M�Q M)׃�
��L���=���D$���'�A��Ncd�I�>A�䐃�unL�l$M;}��H�|$L���_�������H���L�l$���H�L$dH3%(L��u]H��([]A\A]A^A_�H�{H���L�����H�{H����U�H�-^D H�5�E1�H�}����H����7������H�=�L H�5����H�|$H���G��<�H�=�L H�5l�w����H�=�L H�5/�b����H�=�L H�5��M���H�=tL H�5�8���fD��AVAUATL�fUSH��H��L�ndH�%(H��$�1�H���H��L�rL��E1�H�t$L��F 1�VL��M�jj�:��H�� I��H����M���!H�8H����H�H�5ZC H9��N��������A�I�<$����Ń����I��M����I�|$H����M�d$L�-!C ��� M9���L���L�
��f��L�L$�~D$L�SL�D$L�SXK D$C���H���S�H���H�����H���1�L���ǃ�ƃ�Hǃ�Hǃ����H���M�����H���FI�������t@���T����H�{(�L����������L�/A��Oc�M�>A��H�{(�L���`�����9������1�H��$�dH3%(��H�Đ[]A\A]A^��I���f�M���MH�NI��H���AH�yH�5�A H9��v�������i�I�~�C���Ń����I����I�~ H���,���I���zL�-HA M�d$L9������������I�����H��uM9�t2H��@ H�5H�8�,��������@M9���I�����H�5��H�
��f��H�L$�~T$H�{H�t$H�{X[ T$S����H���,�H���H����H���1�1�L���ǃ�ƃ�Hǃ�Hǃ����H���M���sH����������������(���SL�l$0L��L�s(ǃ�L��������L��L�����H�|$0�A��tVH�|$8���H�|$@�tDH�|$H�z��H�|$P�t2H�|$X�h��H�|$`�t M�E0I�x���P��Lc�I��M�I�8�u�D������������6ff.�L�%a? 1�I������k���H�=�G H�5
�h��H���H��tHǃ�H�/�=���H��������Hǃ�����ǃ�H�{(L���~�������������L�-�> L9�uq����M��I����������L�-�> ��M��1��]���M�����H����������H�+> H�5H�:������n���1��"����p��M������H�=�F H�5��e�����H�=�F H�5�M�����H�=qF H�5*�5������H�=YF H�5�������L��= H�5�I�;��������������H�q= ��H�5H�81�����i������AVH�
C@ AUATUSH��H��H��H��H�-~= dH�%(H��$�1�H�D$ �D$�D$�����D$H�l$(H�l$ P1�H�T$0RH��L�L$(L�D$,�]��ZY���2�|$�8L�d$(I9��jH�5��H�
��H�C H�L$�~D$H�{H�t$H�{XD$C����H���H����ǃ��T$���*���#���qD�l$A����UL�D$ �D$L�s(�t$M9��x�L���k�����>�L�{A��Oc�M�>A��ff.�f�1�H��$�dH3%(��H��[]A\A]A^�H��; H�5YH�;���������f.�D�d$A��A���/�L�d$(I9��H���H���H�C H�T$�~L$H�sH�D$H�sXL$K���H���H����ǃ��T$�����������&D�l$A���u�D$A�L�D$ �t$L�s(I9�u5D��L���$�������H�dA��Jc�H�>���A�L��$�L��L�����Ń�����H��������Hǃ����ff.�H9l$ �����H�t$L���(�����������H�t$ L�s(H9��e��H��$�H���	�����H��L���%��H��$��A����H��$�����H��$��toH��$����H��$��tWH��$����H��$��t?H��$����H��$��t'A�L�E@I�xA���l��Mc�I��I�I�8�u�D��������n���H��������Hǃ��O���H�t$ D�t$L�c(H9�����H�l$0D��H��������e��H��L���C��A�����H��u�D���^���������H�
�8 H�5^1�H�9�L���k���H�=PA H�5	����S���H�=8A H�5�����;���H�= A H�5������#���H�=A H�5���������H�=�@ H�5�������������DH�=�@ H��@ H9�tH�68 H��t	�����H�=�@ H�5�@ H)�H��H��H��?H�H�tH��7 H��t��fD�����=E@ u+UH�=�7 H��tH�=�2 ����d����@ ]������w������AU�ATI��USH��xdH�%(H�D$h1�H�l$H���H������I�<$����I������H��H����I�|$1�H��������m�CH���u�����W��H�L$ H�T$H��1�L�,$�5�����N���������H��H������H�$H�5Z; H��������n��H�$H��	��H��!����H�@H9���L�d$H�5�: H��A�T$�U�����!��A�T$H�5�: H���8�������A�T$H�5s: H�����������A�$H�57: H�������tnH�|$����H�|$tH���p��H�L$hdH3%(H��u<H��x[]A\A]�H������H��t+L��5 H�5w
1�I�:�*���j��1�������\���6��f���SH��H��H�~H�5�5 H9��������������H���[���ǃ���������H����[�>��ff.���AWH��AVAUI��ATUSH��8dH�%(H�D$(1����������H�5�L������H��H���xH���x��H�+H�������v��I��H������H��	�H����H���`�D$L�t$1�H�== VM��L�
[��H�
t9 H�fL��L�|$AW����_AX����(����H��H�����H�x�1���D�d$D�cL��L��H�l$H�\$�<�����u���������t$1��b��I��H������L��H�p ������C�����HI�,$��L��E1�����-H��!�WH�5}L�����H�D$H���lH���!��I���)��H����D��E��I9�����H�|$H�/���p����H��H������1��H��D���H�����������L�C,L�
���H�=�; L�S(L���APH�U��H�sAQH�KH�CARL�{$L�s ASAWAQAVRH��
VL��AQQH�
!6 AQP1�AQSAQL��$�L��$����H�쀅���E1�H��A��E����H��tH���e��H�L$(dH3%(L���bH��8[]A\A]A^A_�H�@H9������L�2 H��1�1�H�5�	I�;����H�52 H�>������������A����L�t$L�|$�����D$H�=`: H�
�6 H��	PL�
���L��1�H�\$SL�D$ ���ZY������9��H��H��������|$�8���H�|$H�/�,�����H�i1 H�:�����tL�-61 H�5I�}���E1����L�1 H�5x1�I�:�~�����L��0 H�5�1�I�8�a���f����G��L�-�0 H�5	I�}�@��H��1������;������������S1�����H�59 H���}����H�=�2 ����H��H���`��1�H�58	H���������F���H�5'	H���������)���H�5	H�����������H�5	H�����������1�H�5�H���E���������H�5�H���(���������H�5�H������������
H�5�H���������~���H�5�H���������a���H�5�H��������D��H�@H�5�H��������"���!H�5}H���u��������H�5mH���X���������H�5]H���;���������H�5KH������������H�5:H������������H�5(H���������t���	H�5H���������W���H�5H��������:���H�5�H�����������H�5�H���p��������H�5�H���S���������H�5�H���6���������H�5�H������������H�5�H������������H�5|H���������o���H�5kH���������R����H�5]H��������5��1�1�H�5PH�=a���H��5 H�����H�H��H�5DH������������H�=�3 ����������H��3 H�5�H��H��3 ���������H�=2 ���������H��1 H�5VH��H��1 �g�����w��H��[���H��H���Value too large for lzma_match_finder typeValue too large for lzma_mode typeValue too large for uint32_t typeInput format not supported by decoderInvalid or unsupported optionsUnrecognized error from liblzma: %dinteger argument expected, got floatFilter specifier must be a dict or dict-like objectFilter specifier must have an "id" entryInvalid compression preset: %uInvalid filter specifier for LZMA filterInvalid filter specifier for delta filterInvalid filter specifier for BCJ filterToo many filters - liblzma supports a maximum of %dCannot specify memory limit with FORMAT_RAWMust specify filters for FORMAT_RAWCannot specify filters except with FORMAT_RAWIntegrity checks are only supported by FORMAT_XZCannot specify both preset and filter chainInvalid filter chain for FORMAT_ALONE - must be a single LZMA1 filterUnsupported integrity checkMemory usage limit exceededCorrupt input dataInsufficient buffer spaceInternal error_decode_filter_propertiescontiguous bufferargument 2Invalid filter ID: %lluidpreset|OOO&O&O&O&O&O&O&O&|OO&argumentCompressor has been flushedargument 'data'decompressAlready at end of streamRepeated call to flush()Unable to allocate lockInvalid container format: %d|iiOO:LZMACompressorFORMAT_AUTOFORMAT_XZFORMAT_ALONEFORMAT_RAWCHECK_NONECHECK_CRC32CHECK_CRC64CHECK_SHA256CHECK_ID_MAXCHECK_UNKNOWNFILTER_LZMA1FILTER_LZMA2FILTER_DELTAFILTER_X86FILTER_IA64FILTER_ARMFILTER_ARMTHUMBFILTER_SPARCFILTER_POWERPCMF_HC3MF_HC4MF_BT2MF_BT3MF_BT4MODE_FASTMODE_NORMALPRESET_DEFAULTPRESET_EXTREMECall to liblzma failed._lzma.LZMAErrorflusheofneeds_inputunused_datais_check_supported_encode_filter_propertiesformatmemlimitfiltersmax_length_lzma.LZMADecompressor_lzma.LZMACompressor_lzmadict_sizelclppbmodenice_lenmfdepthstart_offsetdistp��p��p����p����������������Ϳ��w�����������9�����/�����q��������;�����������������	���������g��A����������|��`��`��`��J��`�����_����t�����-��J�� �� �� ����� �����5� �����7�������������������������������������������������������������������������������������)�p�p�p�t��p�j����������R����flush($self, /)
--

Finish the compression process.

Returns the compressed data left in internal buffers.

The compressor object may not be used after this method is called.compress($self, data, /)
--

Provide data to the compressor object.

Returns a chunk of compressed data if possible, or b'' otherwise.

When you have finished providing data to the compressor, call the
flush() method to finish the compression process.LZMACompressor(format=FORMAT_XZ, check=-1, preset=None, filters=None)

Create a compressor object for compressing data incrementally.

format specifies the container format to use for the output. This can
be FORMAT_XZ (default), FORMAT_ALONE, or FORMAT_RAW.

check specifies the integrity check to use. For FORMAT_XZ, the default
is CHECK_CRC64. FORMAT_ALONE and FORMAT_RAW do not support integrity
checks; for these formats, check must be omitted, or be CHECK_NONE.

The settings used by the compressor can be specified either as a
preset compression level (with the 'preset' argument), or in detail
as a custom filter chain (with the 'filters' argument). For FORMAT_XZ
and FORMAT_ALONE, the default is to use the PRESET_DEFAULT preset
level. For FORMAT_RAW, the caller must always specify a filter chain;
the raw compressor does not support preset compression levels.

preset (if provided) should be an integer in the range 0-9, optionally
OR-ed with the constant PRESET_EXTREME.

filters (if provided) should be a sequence of dicts. Each dict should
have an entry for "id" indicating the ID of the filter, plus
additional entries for options to the filter.

For one-shot compression, use the compress() function instead.
decompress($self, /, data, max_length=-1)
--

Decompress *data*, returning uncompressed data as bytes.

If *max_length* is nonnegative, returns at most *max_length* bytes of
decompressed data. If this limit is reached and further output can be
produced, *self.needs_input* will be set to ``False``. In this case, the next
call to *decompress()* may provide *data* as b'' to obtain more of the output.

If all of the input data was decompressed and returned (either because this
was less than *max_length* bytes, or because *max_length* was negative),
*self.needs_input* will be set to True.

Attempting to decompress data after the end of stream is reached raises an
EOFError.  Any data found after the end of the stream is ignored and saved in
the unused_data attribute.Data found after the end of the compressed stream.True if more input is needed before more decompressed data can be produced.True if the end-of-stream marker has been reached.ID of the integrity check used by the input stream.LZMADecompressor(format=FORMAT_AUTO, memlimit=None, filters=None)
--

Create a decompressor object for decompressing data incrementally.

  format
    Specifies the container format of the input stream.  If this is
    FORMAT_AUTO (the default), the decompressor will automatically detect
    whether the input is FORMAT_XZ or FORMAT_ALONE.  Streams created with
    FORMAT_RAW cannot be autodetected.
  memlimit
    Limit the amount of memory used by the decompressor.  This will cause
    decompression to fail if the input cannot be decompressed within the
    given limit.
  filters
    A custom filter chain.  This argument is required for FORMAT_RAW, and
    not accepted with any other format.  When provided, this should be a
    sequence of dicts, each indicating the ID and options for a single
    filter.

For one-shot decompression, use the decompress() function instead._decode_filter_properties($module, filter_id, encoded_props, /)
--

Return a bytes object encoding the options (properties) of the filter specified by *filter* (a dict).

The result does not include the filter ID itself, only the options._encode_filter_properties($module, filter, /)
--

Return a bytes object encoding the options (properties) of the filter specified by *filter* (a dict).

The result does not include the filter ID itself, only the options.is_check_supported($module, check_id, /)
--

Test whether the given integrity check is supported.

Always returns True for CHECK_NONE and CHECK_CRC32.;<&����X����X����������8���t����o���p���������Hl���������n���0����ϲ���Z���h���������	!����	(����h���Lx���`�����X�������������8��� �����Ȼ�������$8���H���x��|���$	�������\������	zRx�$H���`FJw�?:*3$"D����P(\����NF�D�C �}AB(�ڪ��NF�D�C �}AB(�0���=E�D�D i
AAAzRx� �� �������$���18����
L(����Db
AzRx�U���V�����%�����jE�N
I���3E�e,����CB�D�G �D0m AABzRx�0���$����(H����9B�D�G �hABzRx� ���$����<�����F�G�D �A(�D��
(A ABBA zRx������(R���� T��RE�G }DzRx� � ̩��6Z
CA�x\��iF�E�B �E(�A0�A8�Dp�xb�FxBp]xM�J�J�B�B�B�A�H�E�A�I�A�D�A�B�YpD
8A0A(B BBBA�xR�KxAp zRx�p������(����L\(����F�H�B �B(�D0�A8�M��
8A0A(B BBBC$zRx��������,V����`�����~F�B�E �B(�D0�D8�G�Q
8A0A(B BBBGh�^�B�B�I�$zRx��������,x������l���
B�B�E �B(�A0�D8�D���b�Y�A��
8A0A(B BBBO��U�L�L�B�I�B�A�H�I�A�D�B�B�B�B�Y��U�L�J�B�I�B�A�H�D�A�I�A�E�B�B�Y�`�b�Y�A�$zRx��������,���H�H��*F�D�B �B(�A0�A8�G`;
8A0A(B BBBD zRx�`������(���X@���_F�B�B �E(�A0�J�d�Y�H�B�I��
0A(A BBBH zRx�������$(���tY�Z�B�B�I�T����+F�I�B �A(�A0�P�B�H�W�A�
0A(A BBBA zRx�������(ܭ���x���'E�!zRx�� -���GNU�X�W� jj&j�f.jUfs�� 
cЊ ؊ ���o`�
�
H� x`��	���o���ox���o�o����oM8� ! !0!@!P!`!p!�!�!�!�!�!�!�!�!"" "0"@"P"`"p"�"�"�"�"�"�"�"�"## #0#@#P#`#p#�#�#�#�#�#�#�#�#$$ $0$@$P$`$p$�$�$�$�$�$�$�$�$%% %0%@%P%�g 9@m�i�I�l�f� w�i��v�i��v�i�@v�g<� s�iZ�|�ipZ�{,g X��zej���������� j�f~g&j� ?j{g~gkjujxj{j~j�j�j�j�j�jkjkj{jxjuj{g � �g{g�j{g�j9j��7`w@� `� �KPj�P8@n� 0RGA$3a1� c_lzma.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug<��7zXZ�ִF!t/����]?�E�h=��ڊ�2N����> ��<Bt�'�'�	��A�A"��!hm��-B�
T��~f�^�i��T`p��]�a��l��L>9Eѫ�O�՗�F�SQ�֗�p���nJJ��äF�i�y4�D�l���K�oB=��W�N�3��N�iy�ŜSP�1r�h�7�f�
�=@Z��V;�����:�9�N(V����!��6.��Q�9e�<SlX��m��x��$��>�*�o�4o��}���$yIE�Rg�E����;I9��j��V�Ϩۯ��3#�Ѯ~OH^|y0t�cJ���䕵��k��p��ϳ�6�d�)3^���м��Mx�|�g�$u�;S�A�n�ϸZ�[����)�x�\;���J��O�8�@>�>)����3g�fD#����)�l�Z��!'N��1�y�\��)�������I�&��$�V��+���P����iCA���^�f�a>�>sMB��3C�T8Y9+�1�c��rNU��Lc�M�N��S��K��Pғ�,(jK�y��h$��^k"oB��}K!����Opy⌻y��^�����1��o���ئ��3�C���lA1�����a=��0*^O��ȡ��p�����>�ل	��y눱��G��;
��Dh�#i�,NS���Q�b+`��c�r�6�Sަ@���'^0����3lۍ���2&����*'�4�
�!�^�U��Nm��S�wh�R�@�['��|'b��.h�.=�����b��TH���IaZf�
Y�(�&�<4ҋf�h�>�p�tڷ(q���Eߙ lf�x�G_>6{H&�V�}�)��!n�ձ��i�g��g�3m�oP&�VZ���ޓa��V#�A��	�f��~u6"�)���A_�,��v�rH&,�Ȗ��7첶O$��(���rŜQ���[���~$R��a6����$���)y�}����C����@�'��L�™�>̏��$Q�B���S���4�
�R<n�!�ֺ3�^���͑���抉H�8�n߿�y���-N��#D=��ZZ)4�d[�i���3b=�q'���v߈�*o�%��..��s	�
�|dz���d�X��R��Lo�?�"�t)#�[ݰb�s�!��s�n9k�A�I&�a��C�6��e�'��FH��ܦ�޽�̖U/9ݶ�!R>h.˿�7���5o�{`W#��(���n9~�
�)�����g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(��0�
�
8���o���E���oxx`T���^B``xh� � c!!`n`%`%Pw�)�)W9}cc
� c c7 �X}X}<��~�~��`�`� �Њ Њ�؊ ؊�� �X �8� 8��H� H���� �  � �  ��8�` �$
D�\��(ȝ(lib-dynload/_socket.cpython-38-x86_64-linux-gnu.so000075500000276060151153537520015554 0ustar00ELF>�L@�t@8	@XX XYXY!XY!Hh pYpY!pY!888$$�W�W�W  S�td�W�W�W  P�td@@@llQ�tdR�tdXYXY!XY!��GNU��Si������[���,���@ ����|(A�CE���qXS�����=��Q���� ���w�.�B�����#� �3�H�G
 fo�F, y��wF"��q�9��\_�q=���K�4��6�i%�R�1�/%���+va�:�f��j
!����k����B����N�/yS
�$��������,�	�k!'����k!��k!__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6_Py_TrueStruct_Py_FalseStructPyExc_OSErrorPyErr_SetString_PyArg_ParseTuple_SizeTPyLong_FromSize_tPyExc_OverflowError__stack_chk_failPyErr_FormatPyErr_SetFromErrnoPyLong_AsUnsignedLongif_indextonamePyUnicode_DecodeFSDefault_Py_DeallocPyUnicode_FSConverterif_nametoindexPyLong_FromUnsignedLongPyList_Newif_nameindex_Py_BuildValue_SizeTPyList_Appendif_freenameindex_PyTime_FromSeconds_Py_NoneStruct_PyTime_FromSecondsObjectPyExc_ValueError_PyTime_AsSecondsDoublePyFloat_FromDoublegai_strerrorPyErr_SetObjectPyErr_OccurredPyExc_TypeErrorinet_ntopPyUnicode_FromString__sprintf_chkPyBytes_FromStringAndSizeioctlstrnlenPyBuffer_Releaseinet_ptoninet_ntoainet_atonPyExc_DeprecationWarningPyErr_WarnExPyEval_SaveThreadPyEval_RestoreThreadclose__errno_locationPyLong_AsLongPyLong_FromLong_Py_dupgetprotobynamePySys_AuditgetservbyportgetservbynamePyErr_ClearPyObject_GetBuffersethostnamegethostnamePyErr_FetchPyErr_RestorePyErr_ResourceWarningPyExc_WarningPyErr_ExceptionMatchesPyErr_WriteUnraisablegetsockoptPyLong_FromSsize_tsendmsgsscanfrecvmsg_PyBytes_Resize_PyLong_AsIntshutdownsetsockoptsendtosendrecvfromrecvlistenacceptaccept4PyUnicode_FromFormatPyObject_CallFinalizerFromDealloc__memset_chkgetpeernamegetsocknamePyByteArray_TypePyType_IsSubtypePyUnicode_AsEncodedString_PyUnicode_ReadyPyByteArray_AsStringPyByteArray_SizePyBytes_AsStringPyBytes_SizePyOS_snprintfgetaddrinfogetnameinfofreeaddrinfo_PyArg_ParseTupleAndKeywords_SizeTPyLong_TypePyUnicode_AsUTF8strcmpstrchrPyMem_FreePySequence_FastPyMem_MallocPyErr_NoMemory_PyArg_Parse_SizeT_PyTime_AsMillisecondspoll_PyTime_GetMonotonicClockPyErr_CheckSignalsPyExc_RuntimeErrorPyExc_RuntimeWarningPyTuple_Packconnect_Py_set_inheritablestrncpymemcpyPyUnicode_EncodeFSDefaultPyTuple_SizePyType_GenericNewsocketpairbind__h_errno_locationhstrerrorgethostbyname_rgethostbyaddr_rPyFloat_TypePyInit__socketPyType_TypePyModule_Create2PyModule_AddObjectPyErr_NewExceptionPyCapsule_NewPyModule_AddIntConstantPyModule_AddStringConstantPyObject_GenericGetAttrPyType_GenericAllocPyObject_Free_edata__bss_start_endGLIBC_2.2.5GLIBC_2.14GLIBC_2.3.4GLIBC_2.4GLIBC_2.10f ui		v���	ti	#	ii
/	���9	ui		XY!0�`Y!��hY!hY! `!�(`!B�8`!�(@`!��H`!@�X`!�'``!�h`!��x`!�'�`!���`!��`!'�`!t��`!c��`!`&�`!��`!=_�`!�%�`!��`!0_�`! %a!��a!�ka!�$ a!�(a!Kl8a!�#@a!��Ha!�eXa!�"`a!2�ha!3jxa!�!�a!1��a!���a!  �a!��a!���a!��a!G��a!���a!@�a!���a!ˇ�a!�b!��b!�~b!� b!;�(b!z�8b!�@b!��Hb!��Xb!`b!�hb!�^xb!@�b!��b!*M�b!��b!(��b!�]�b!��b!3��b!�R�b!��b!$��b!�g�b!�c!>�c!lgc!  c!��(c!Յ8c!@@c!��Hc!�Xc!@	`c!6�hc!�xc!��c!w��c!�z�c! �c!��c!G��c!2�d!Y�d!i�0d!o�`d!��hd!�Rxd!���d!T��d!vv�d!@?�d!���d!a��d!`>e!��e!|�e!�= e!��(e!c8e!@=@e!��He!bXe!=`e!=�he!/axe! <�e!��e!;`�e!@;�e!���e!�_�e!�:�e!��e!h^�e!:�e!���e!S_�e!@9f!��f!ߦf!8 f!��(f!�\8f!�6@f!��Hf!xSXf! 6`f!��hf!5\xf!�4�f!���f!S�f!@4�f!���f!�[�f!`3�f!���f![�f!�2�f!w��f!(Z�f!@2g!P�g!Yg!�1 g!��(g!�p8g! 1@g!p�Hg!?nXg!�0`g!��hg!`Rxg!�/�g!���g!	R�g!�.�g!��g!�P�g!`.�g!V��g!'P�g!�-�g!��g!�O�g!`-h!J�h!Oh!`+ h!=�(h!|N8h!�)`h!j!�h!��h!�?�h!�d!i!�i!2�i!i�i!�@i!��Hi!�Pi!�`i!��hi!�pi!��i!:��i!W��i!��i!��i!��i!��i!
��i!��i!2��i!i��i!�j!�0j!@�Xj!kk�j!��j! `!�j!�c!�j!`d!(k!�8k!@��k!��X_!`_!h_!p_!x_!�_!!�_!(�_!+�_!2�_!4�_!9�_!:�_!;�_!@�_!B�_!O�_!R�_!a�_!b�_!e�_!f�j!K0k!�@k!r�[!�[!�[!�[!�[!�[!�[!	�[!
�[!�[!�[!
�[!�[!�[!�[!\!\!\!\! \!(\!0\!8\!@\!H\!P\!X\!`\! h\!"p\!#x\!$�\!%�\!&�\!'�\!)�\!*�\!,�\!-�\!.�\!/�\!0�\!1�\!3�\!5�\!6�\!7�\!8]!:]!<]!=]!> ]!?(]!A0]!C8]!D@]!EH]!FP]!GX]!H`]!Ih]!Jp]!Lx]!M�]!N�]!P�]!Q�]!S�]!T�]!U�]!V�]!W�]!X�]!Y�]!Z�]![�]!\�]!]�]!^�]!_^!`^!c^!d^!g ^!h(^!i0^!j8^!k@^!lH^!mP^!nX^!o`^!ph^!qp^!sx^!t�^!u�^!v�^!w�^!x�^!y�^!z�^!{�^!|�^!}�^!~�^!�^!��^!��^!��^!��^!�_!�_!�_!�_!� _!�(_!�0_!�8_!�@_!�H_!�P_!���H��H�	"!H��t��H����5�!�%�!��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&�������h'��q������h(��a������h)��Q������h*��A������h+��1������h,��!������h-��������h.��������h/������h0�������h1��������h2�������h3�������h4�������h5�������h6�������h7��q������h8��a������h9��Q������h:��A������h;��1������h<��!������h=��������h>��������h?������h@�������hA��������hB�������hC�������hD�������hE�������hF�������hG��q������hH��a������hI��Q������hJ��A������hK��1������hL��!������hM��������hN��������hO������hP�������hQ��������hR�������hS�������hT�������hU�������hV�������hW��q������hX��a������hY��Q������hZ��A������h[��1������h\��!������h]��������h^��������h_������h`�������ha��������hb�������hc�������hd�������he�������hf�������hg��q������hh��a������hi��Q������hj��A������hk��1������hl��!������hm��������hn��������ho������hp�������hq��������hr�������hs�������ht�������hu�������hv�������hw��q������hx��a������hy��Q�������%M!D���%E!D���%=!D���%5!D���%-!D���%%!D���%!D���%!D���%
!D���%!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%}!D���%u!D���%m!D���%e!D���%]!D���%U!D���%M!D���%E!D���%=!D���%5!D���%-!D���%%!D���%!D���%!D���%
!D���%!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%}!D���%u!D���%m!D���%e!D���%]!D���%U!D���%M!D���%E!D���%=!D���%5!D���%-!D���%%!D���%!D���%!D���%
!D���%!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%}!D���%u!D���%m!D���%e!D���%]!D���%U!D���%M!D���%E!D���%=!D���%5!D���%-!D���%%!D���%!D���%!D���%
!D���%!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D��H��tQL�O M��tHI��M)�I���w<H�O(I��I9�w/H�>H��v&H��L)�H9�rH��H)�H9�wH�:1��H�
����H�(tH��!H��H�q!H��Q������8��
����ta��tw����t]����������tl��tH��tC���(t9��*t$��&���X���n����������x���t*��u9���^��t��u"�
��G��?���2H�	!H�5��H�8����1��H��!H�5��H�:���1�Z���H��H��H�5��dH�%(H�D$1�H�������1���t<H�$H=�wH�xH��H��H9�r�����H�
!H�5H�H�9���1�H�L$dH3%(t�1���H�����H��H��H�52�dH�%(H�D$1�H���"�����1���t4H�<$H���w
H��r����H��!H�5�H�81����1�H�L$dH3%(t���H�����H��!H�8�����UH��S1�H��(dH�%(H�D$1����H���t1H���H�����H��H��uH�{!H�8�K����H�����H��H�T$dH3%(H��t�&���H��([]�H�H�(t�H��������SH��H�5�H��H�g!dH�%(H�D$1�H�������1���tDH�$H�x �B���H�<$��H�u�r���H��uH�
�!H�5ԐH�9����1��H������H�T$dH3%(t�v���H��[���AV1�AUATUS�M���H��H�����<���E1�L�-��H��H��umH�uH�����H�
N!1�H�9���������H�HH�<!L��1��Z���I��H��tLH��H������I���t*H��I�uL�����A��Ic�H��H�0A�����u��)H��I�uL���f���H�uH���Y���H��1�����H�����H��[]A\A]A^�H;52!SH��u�����1�H��2���������x!1�H�;yH�m
!H�5��H�8�n�������[���H��dH�%(H�D$1�H�������1���xH�$H��
!H��
!H�H�L$dH3%(t����H�����H�=�
!H��xP����Z���H�m
!H����H�(H��xP���Z���H�I
!H�Ã��uH��!H�8�q���S���	�����H�=ЎH��1����H��H��tH�=�!H���?���H�uH����1�[���H�F���tEAQH�����H���u$�x�H��uGH�=�!H�5j�1�H�?AX���H9�u��Y���h�H�
!H�P1�H�5Q�H�9���1�Z����UH�w�.�
SH��HdH�%(H�D$81�H��H�����H��uH��H��!H�8�l����H����H��H�T$8dH3%(H��t�G���H��H[]�UH�w��SH��(dH�%(H�D$1�H��H���1���H��uH��H�*!H�8����H���0�H��H�T$dH3%(H��t����H��([]�SH�� dH�%(H�D$1��H��P�W1�R�O�Q�wH�
:�VD�O�D�GH������H�� H����H�T$dH3%(t�]���H�� [�AUATUSH��HdH�%(H�D$81�H��uH��
!H���H���6A��f���w:f��
��wf����f��tT�f����f�����f��&�2wf���#f�����cf��(t~f��*t_�RH���\���I��H�����[H��H�=D�1����������H��H�{H��t�{u
���������S�sH�=,�1������S�sH�=�1��}�����H���^���I��H�����C�KL��H�=��D�C�����1��A����y����	��t�������t1�H�{���I��H�����SH��H�=W�1�����&H�{���I��H��tq�SH��H�=/�1�����I�$�!L��H�D$��H�D$�
�sH�=��1������H�{�W�����L�I!H�5܊I�8�J�1����s��tL�l$�t$ 1���L���D�L��tH�5���S�K
W1�D�KD�CH�=����AQL�K���
���AXAY�f�K��u'�K�S�1�D�KD�CH�=h�����7��u&�K�S�1�D�KH�=@�A�������u&�K�SE1��D�KH�=�1�����H�=E!H�5�H�?�F�1����C��tH�l$�D$ ��1�H���@�H��tH���A��H�5�!u�KD�CH�=��1����sH�=��1����cL�c�@H�kL������H��I�����L��H��M��R�SH�=v�RD�KH��1���Y^�H�S�H�=Z�1���H�L$8dH3%(t�&�H��H[]A\A]���UH��H�5(�S1�H��dH�%(H��$�1�H�l$H�T$H���������|$��u*H�|$ tWH�
�!H�5�y1�H�9���H���d��u��
u
H�|$ t(��H��!��H�5��1�H�81���H���/��@H�t$H�T$`�.�y�H��H����H��uH�j!H�:�:��H���p�H��H��$�dH3%(H��t��H�Ĩ[]���SH��H�5=�H��0dH�%(H�D$(1�H�T$H�L$����1�����H�\$H�t$�|$H�������yH�5�!H�>��1��`uH�=�!H�5yH�?���1��D�D$��u�H������,��
u�H������H�
v!H�5��H�9��1�H�L$(dH3%(t�(�H��0[���UH��H�5{�SH��hdH�%(H�D$X1�H��H������1���tGH�|$t"H�
!H�5}xH�9�
�H����1��H�$H�ߋ(�s���\�H�����H�L$XdH3%(t��H��h[]���SH��H�5�H�� dH�%(H�D$1�H�T$�{���1���t=H�\$H�|$H�������t�H�����H�O!H�5�wH�8�X�1�H�L$dH3%(t��H�� [���H��H��H�5j�dH�%(H�D$1�H�T$�����t�D$��yH��!H�5�wH�:���1��;=���|$f�����!��!H�
!�H�5�wH�9�����t��H�L$dH3%(t�Y�H�����H��H��H�5˅dH�%(H�D$1�H�T$�H���t�D$��yH��!H�5�wH�:�F�1��;=���|$f�����z��!H�
q!�H�5�wH�9�-���t��H�L$dH3%(t��H���USH��H���t$���;H�T$�!TH��1��|$��1ۉD$1����H������v���tH��!H�:�S�H����[]���SH��H��dH�%(H�D$1�H�����y1��#H�4$H�{H�s(H��?�\�����t�H��!H�H�T$dH3%(t���H��[����8h�]pH�C []A\����USWH����H���t����H�����H�������y,���H��t�1��&�`��8htH��!H�8Y[]�i�H�"!H�Z[]���USH��H��Q�9�H��H��u����H��t1��-1�H��@����a�H�{��H�C(�e�����t�H��!H�Z[]���Hc�����G�G����Hc��}���UH��SQ��H���t�����Ń��u�
�"�H��t�1��Hc��A�H��H��u�����H��Z[]���UH��H�5
�S1�H��dH�%(H�D$1�H���}���tE���H�<$H����H��H���M�H��uH�Y� H�5̂H�8�b��Hc{��H��H�L$dH3%(H��t��H��[]���UH��H�5��SH��(dH�%(H�D$1�H�L$H�T$H�D$�����t"�T$����vH�j� H�5uH�:���1��oH�L$1�H�5H�H�=D�����x�����|$H�t$H��f������H��H���X�H��uH�d� H�5�H�8�m��H�;�c�H��H�L$dH3%(H��t��H��([]���UH��H�5�SH��(dH�%(H�D$1�H�L$H�T$H�D$�����u1��uH�L$H�T$1�H�5W�H�=�������x���H�|$H�t$H����H��H����H��uH��� H�5��H�8����{f�������H��H�T$dH3%(H��t�0�H��([]���ATUSH��H�5J�H��H��pdH�%(H�D$h1�H�l$H������u0���H��H��1�H�S� H�5�������u	1��1�H�T$1�H�5��H�=�������x�L�d$H�|$1�L�����Ņ�uMH�|$H�t$ ���L����,���tH�|$H�u����tH�v� H�8�F��H��� H����u���H�L$hdH3%(t��H��p[]A\���AT1�H�=l�USH��dH�%(H��$1�����1���xG�G�H��H��I����L��������yH�� H�8���H��Ƅ$���H��$dH3%(t�}�H��[]A\�1�H��H��H�߾�8���u&�k�C��������H����H���C��kH�� H�8����t�H���3����U��S1�H���dH�%(H�D$1�H�L$I���$�����u�l$��jt��t�����(��H�T$dH3%(��t��H��[]�������SH��V�H�6��H�CH��[H��?�SH��H��0dH�%(H�D$(1�H�L$H�T$PH�D$P1�H�t$4VH�5�~L�D$8APL�L$<L�D$8�k�H�� ��uJD�T$$D�L$ D�\$�|$D�ҋt$�L$D	�D	�	�	�	ʁ��wD�D�KD�[@�{@�s�K�H�� H�5T~H�;�����H�L$(dH3%(t��H��0[���SH��V�H�6�N�H�CH��[H��?���SH�H��H9x~H��H����H�H��tH�[���USH��H��H�5�}H��8dH�%(H�D$(1�H�l$H�L$�D$H�T$I���D$�������t$�C��up��(�T$�t$L�D$�{u2H�L$ �D$H�D$ ������H�|$ �5���H�L$�D$������Hc|$�����(uH�=�� H�5�nH�?��1��x�V����vH�
n� H�5�nH�9�w�1��S1���H�D$ H��t�{�T$H�H I��t$����yH�|$ H�u���S ��t$H�|$ ��H�D$ H�\$(dH3%(t���H��8[]���ATUSH��H�������t*���{��I������L�������yH�C []A\������H��t�1��
H�,� H�[]A\���AVAUATUH��SH��H��dH�%(H��$�1��(L�t$ L�d$$uEL�l$0L��L��H��M��H�5�{�+��1Ʌ���{�T$ A�L��t$$�����L�l$1�L��L��M��H�5�{H��������t�{�T$ A�L��t$$�w�����H�V� L��H��H�5g{L�@P1�H�T$ RL��L�L$8���ZY��t�{D�D$1ɋT$ �t$$�"���T�;�L�l$0L��L��M��H�5%{H��1��L��1Ʌ�t@�{D�D$@H�L$0�T$ �t$$����L��D$���D$��y�S H���
H�
�� H�H��$�dH3%(H��t���H�Đ[]A\A]A^���SH��NH�VD�NL�F�H�6�	�H�C H��[H��?���SH��NH�V�H�6���H�CH��[H��?���SH�FI��H��H�~ �1��NH�VA�xL�KL�C H�6�1�H�C(H��[H��?���SH��NH�V�H�6�z��H�CH��[H��?���ATUSH��H��H�5�yH��dH�%(H�D$1�H�T$�D$�������1���t@�%���|$I��y�D$�{�t$�g��L��������y�S �
H�=� H�H�L$dH3%(t�e��H��[]A\���AUI��ATUSH��Q�&H�.tL�f��EE1�1�=�� uA�}H��L�����C�>A�}�H��L�������C#�� ��u�����8&���Љ�� �=�� t��CZ[]��A\A]������O�W1�HcwD�GH�=�j���[���AUH�wATUSH��H���dH�%(H��$�1�L�d$L������1���tU�T$H�l$1���H���������{L��H��I���2��L��A���7��E��y�S ��K�T$H��{��H��$�dH3%(t����H�Ĩ[]A\A]���AUH�wATUSH��H���dH�%(H��$�1�L�d$L�������1���tU�T$H�l$1���H����������{L��H��I�����L��A���y��E��y�S ��K�T$H��{��H��$�dH3%(t�5��H�Ĩ[]A\A]�H��A��C�
cL�]M��tH�EI�+t1L�%>� H�57iI�<$E1��#����bH�sH�bH�sH�bL�������1�H�5�vH������I��H����H�x H�EH��1�H�}�H��H��I9K�sb�p���H���C�����cb�bH�
�� H�P1�H�5ihH�9�y���=bH�����H��H�E���I���aH���P��H��H�E�$��I����aL�M� H�5vI�8�6����a��ATH��H�5vUSH��dH�%(H��$�1�H�L$H�T$(H�D$(H�D$�D$�D$�D$�����t(H�|$(H�G���uL��� H�5�gI�8���1���1�H�L$H�T$ L�L$L�D$H�5�g�W����tӁ|$��vH�=�� H�5�g1�H�?�Q���H�T$(1�H�5NtH�=0u�"����x�H�l$`�L$� 1�H�sH��H�\$0���1�H�|$4���D$0�D$8���H�|$ H��H��H�L$I�����L��������t��1������L�D$I�X(H��tH�-�� H�5_g1�H�}����A�P��t��
u>M�PD�\$�L$A�E�ZA�J�$H�t$(H�~tL�
4� H�5QtI�9�=���bL��$�A�pI�xP�D$�L��I��A� P����ZY��t	���=��'L�����H��H��tH��H��H�=
t1����H��H�|$H��t�
��H��$�dH34%(H��t�o��H�Đ[]A\���AWH��H��AVAUATUSH��dH�%(H��$�1�H�D$H�D$(H�D$ H�D$�D$�D$�D$�D$P1�H�T$RH�RsH�L$ QH�
h� H�\$,SL�L$8L�D$@�s��H�� ��tfH�|$ L�-o� L9�t\H�wH�����s1�H�5�r���H��L�` H��u6�(��s���1�I���"H�=�� H�5�eH�?���1��p1�E1�H�|$L�GL;�� u>�"��I��H���t L�|$`L��1�H��rL�������^�t��H������M���A��s�&��I��H��u3��A��L� r#E1�L9�tL��� H�5=rI�:�����PD�\$H�5:r1�H�=7rASD�L$ D�D$$H�L$(H�T$0���ZY������1�H�|$@�fnT$�fn\$L�l$0fnL$fnD$fb�fb�fl�)D$0���L��H�L$(L��L��I���I��L���������t������1�����H��H����L�d$(L�-�nM����A�T$I�t$���L$�j�I��H����M�D$ A�L$I��H�=VqA�T$A�t$M��MD�1�����I�I��uL���9��M��taL��H�����I���tH��I�uGL������=H��I�uL�����M�d$(�V���H��t
H�uH������H�|$(H��t<����5H�MuH������H��t
H�uH�����H�|$(H��������`��1�H��$�dH3%(H��t����H�Ę[]A\A]A^A_�H�SH���������$<f���[<H�T$H��D�BH�rM9�MG�D���H������D�fA�����fA��
�<L�g� H�5�mI�:�p�����;E����1�H�{��f���C������;1�H�|$,�	D�d$$�L�|$ �D$(�D$ �?��1�H�L$L��H�5�uI������L��A�����E��u[H�l$�U��t^��
��H�����L�-�� H�55oI�}������;;L��� H�5MoI�;������;D��������
;A�H�}(u5D�MH�uH��D�D$M9�MG�D���H������D$��:A���H���q��H�� H�5CaH�;������:���G�����:��:��UH��H��mH�5�nSH��1�H��8dH�%(H�D$(1�H�L$�����tU1�H��H�5QtH�=�n�����y1��+H�\$H�|$��H���P9��x�H������H��H�|$����H�T$(dH3%(H��t���H��8[]�AWAVI��AUATI��UH��H�5w`SH��L�$���H��H����L�hI�����~$L��� E1�A��1�H�5i`I�8������M�,$M��~MH��������I9�wL��H�����I��H��u����E1�A��1��H�EIk�P�h��I��H��u��E1�E1�M��1�I9�~YH�S���t
H�KH�<��H�|�1�L��L�L$H�5�_�����t3L�L$H��I��I�1I�yI��PI�t$�I�|$��E1��E1�A��1��A��L�$M�>I�*H��t
H�uH���u��H��D��[]A\A]A^A_�ATUSH��dH�%(H�D$1����tf���<$H�������ƃ���EƾH��f�D$�8��H�����H��H��H��HHӾI������L����<���؅�x����H�L$dH3%(t���H��[]A\�AW1�AVAUE��ATUH��SL��H��8L�d$p�t$H�T$ M��H�L$(H�D$��E1�D	��D$�|$��M��~UE��t'�S��H�T$H)�y(H�����A����,��L��L�H�D$�}�t$D�����D�t$A����}�t$D��L�����A��A���u@���H��t�0�3�8u%������`���H���������A����U �A��u<�Z���H�=d� H�5kA������v���H��t�����uE�0����u��'��H��L�|$ H�t$(H�D$A��H�|$A�����E��t�E1�H��t$��H�}(~	�������H��u�U A��H��8D��[]A\A]A^A_���AW�AVAUI��ATUS1�H��dH�%(H��$�1�H��$���A�}&H��H�D$8�H�D$0H�D$(H�D$ H�D$�D$tH�
�� H�5�\E1�H�9����=WI��H��L�
Y� H�
�� L��1�E1�H�T$RH��iL�D$(APAQUL�\$HASL�D$X�"��H��0����L�d$`���L���H�|$ H��u	H�5�\�9����D$��x�H�|$H��tA���A�ǃ��u.���H���HH�5^iL�
J� 1�E1�I�9�5���-��y��A��H��$�A�tH��$�L�NI��M�q(A���tI��L�����H��H��u
���E1���1�H��L���L��$�H��$�H�|$(H��uL��$�I��w'�2H�L$0I�T$E1�I�t$L�D$8�B�����u��~L��$�M��uL��� H�5�[E1�I�8�[���SD�D$H��$�H�I�I�SE�CH��t_I��'v	M��I��uL�=u� H�5v[E1�I�?����H��$�I�{,I�M�s H�AA�K(H��H��I�C��M��A���tpM�L��H�ڃ�H��I��v%L�$�M)�L9�wI)�M9�w
I��I��M�uL�-�� H�5[E1�I�}�n���iI�I�M�YE�yL�d$@D�d$E1�E1�H�L$@�L��E1�D�d$HH�[�PA�u(����ZY��xH�|$P���I���1�E1�H���{��H��$�tH���h��H�|$p1��\��H�|$0H9l$8~Hk�PH��H��A�����:��H��$�dH3%(L��t�_��H��[]A\A]A^A_���UH��H��H�5�fSH��dH�%(H��$�1�H�\$0H�L$�D$H���&����1���t`H�D$0H�L$@H��E1ɋt$H�W�E1�H�D$H�L$H�L$�t$ �P�u(���ZH��Y��y	�q��1���h��H�|$(����H��$�dH34%(t���H�Ę[]�AWA�ϹAVE1�AUATI��UH��I�t$SL��H��8H��$p�T$L�l$`H�T$4L�L$L��H�D$ dH�%(H��$(1�H�D$8�A�|$�"��L�l$�����T$4L��$���1�L���/��fDŽ$�H�����vH�=�� H�5�XE1�H�?�����@H��tH�����I��H��u����I���E1�T$4L�t$`E1�L��Hct$L�D$H�l$pH�L$@�T$hH���H�t$x1�L�D$@E1�L��$�H��$�D�|$HPA�t$(�*���ZY��yE1���1����H��H����H��$�wg�t$49t$hFt$hA�L$A�|$��L�����H�t$ H�|$P��$�I��L�t$A��M��H��H�=/dH�Ɖ�1��
��I��H���P�4L�L$8H��$�L�L$H��t�H�T$H�|$H�����A�Dž�u%H�t$8H��yHL��� H�5�cI�8�����L��� �H�5aWI�:�������E��y�����H�{����S�sH�=�cH��1��W��H����H��H��H�D$(���H�L$(H�	uH�ωD$(����D$(��u[E�������H�H��$�H��H�ڃ�H��H�������H�$�H)�H9������H)�H9��u���H��H��H�����H��$�w'H���+���E1�H�MuH�����L�������L�L$8L��$�I�L�L$M��t�H�T$H�|$L�����A�ƅ�x�M9gtE��t.�H�\$8L��H��L�H9�t�xH�D$���H�D$H����M�L��$�L��H�ك�H��I���D���L�$�M)�L9��0���I)�M9��$���I��I��M��W���H��$(dH3%(L��t�S��H��8[]A\A]A^A_���AWAVAUATUSH��8H�|$H�L$ H��H�T$L�D$H�5�adH�%(H�D$(1��D$H�D$ �����uE1��]H�|$H�5CU���H��H��t�L�pI�����~&L��� E1�E1�1�H�5CUE1�I�8������M����L��H�����I��H��tIk�P�}��I��H��tI��1�����E1�E1�1��H�E���t
H�UH�<��H�|�1�L��H�5�T�����t[I�H��I�H��H��I��PI�L5I�|5I9�u�L���E1�E1�1�PD��L�
J��L��jL�D$0�L$$H�|$�K���ZYI���E1�Hk�PM��L�L9�tL��I��P�b����L���X���L���P���H�MuH���B��H�L$(dH3%(L��t�j��H��8[]A\A]A^A_���SH��H��H�5�_H��@dH�%(H�D$81�H�L$H�T$H�D$L�D$�D$H�D$�'�����t H�t$H��yH�
"� H�5TH�9�#��1��f1��X��H�D$H��t�H�� H�t$ H��H�D$ H�D$L�
@��H�D$(PH�T$RL�D$ ��L$����H�|$ZH��YH��t
H�u�9��H�L$8dH3%(H��t�a��H��@[�AWI��H�wAVI��AUA��ATM��USH��H����dH�%(H��$�1�I�H�l$H���(����uH���tL�|$ L�|$PE1�E1�H�l$H�L$ 1�H���~D$L�|$H�m�L�t$(D�l$0D$D$8P�s(��ZY��x��K�T$L���{�F��I�$H��t�H�D$HH��$�dH3%(t�w��H���[]A\A]A^A_���UH�
�� H��H��SH��H�^H��dH�%(H�D$x1�H�\$ �D$H�D$I��H�D$PH�D$P1�L�L$(���ZY��teH�T$H�t$ H�L$0H��y%H�����L�� H�5RI�8���1��uH�L$�'H9�~"H���g��H�=�� H�5	RH�?����1��Y�L$H�T$H��L�D$����H��H��H��y�'��H�|$H��t�H�u����1���
��H�T$H��1�H�=]���H�L$xdH3%(t����H�Ĉ[]�H��8dH�%(H�D$(1�H��t7H�4$E1�E1�1�H�T$H����L$H��P�w(���ZH��Y��xH�T$H�t$(dH34%(H��t���H��8���UH�
�� H��H��SH��H�\\H��xdH�%(H�D$h1�H�\$�D$H�D$I��PH�D$P1�L�L$���Y^��1�����H�|$H�t$H�L$ y"H�����L�L� H�5�PI�8�M���1��`uH�L$H�T$H9�~"H�����H�=� H�5�PH�?����1��-�L$H�����H��H��H��y	�z���1��
�q���H������H�L$hdH3%(t蔿��H��x[]���SH��H��H�5\[H�� dH�%(H�D$1�H�L$H�T$�D$�p�����t H�t$H��yH�k� H�5[H�8�l���1��W1�衿��H�D$H��t�L$H�T$H�p H�����H��yH�|$H�u�访��1��H9D$t
H�|$H��薽��H�D$H�\$dH3%(t輾��H�� [���AWAVI��H��H�5�ZAUE1�ATUSH��dH�%(H��$�1�I�F(H�l$PH�L$,H���D$,H�D$1��y�������H�T$0L�l$PH�\$`E1�H�D$L�d$H�T$H�|$~EE��t�ʻ��L�d$I)��軻��IF(H�D$M��H�=n� H�5!YE1��'����uA��L$,L�l$0E1�E1�H�\$8H�8���L���L$@PATH�L$(��ZY��yE1��0H�t$HI�H)�������u�H���W���H���;���L�-4� I�EH���(���H��$�dH3%(L��t�M���H�ĸ[]A\A]A^A_���SH��H��H�5<YH��0dH�%(H�D$(1�H�L$H�T$H�D$ H�D$�D$������t H�t$H��yH�� H�5�MH�8����1��1��:���H�D$ H��t�L$H�T$H�p H��L�D$�;���H��y1��5H9D$uH�T$H�t$ �1��к��H���H�|$ H��������y���H�|$ H��t
H�u����H�|$H��t
H�u��H�L$(dH3%(H��t����H��0[�AVA��AUATI��U��SH��H��dH�%(H�D$1��V����{L��D��I������L��A���ڹ��E��u1��虻��I�Ƌ�D$��u*����������H�{(u��T$tzA��S ���oH�{(~�su�H�S(��t)AQA�E1�1�R�H�B��H���I�AZA[��2VA�H��1�R�H���L�L$��_AX���Q����T$H�L$dH3%(��t���H��[]A\A]A^���AUH�wATUSH��H����dH�%(H��$�1�H�l$H���ν�������T$L�l$@��1�L�����H�l$E1�E1��~D$L�l$H�L$ 1�H���H��D$)D$ P�s(�W�ZY��x3�= � �l$0u1�1����˸����xHc��Ϻ��I��H��u���p���E1��R�K�{L��E1�T$���H��H��tH��L��1��L���I��I�$uL��蛺��H��t
H�uH��艺��H��$�dH3%(L��t讹��H���[]A\A]�L�%a� L��1�1�H�5sLI�<$貶����!H�->� L��1�1�H�5�UH�}菶����!L�-� I�}誶������1��!L��L�5y� I�H1�H�5�K1�I�>�J����!f�)EL�NA����H�L$0H�T$(L��1�H�5U�����Å��M!E�]D�|$0�D�t$(fD�]D�}D�uA�$� !L�}E1�VL��D���f�E&H�V����WH�L$(H�T$0L��1�L�ML�EH�5�M�{����Å��� H�t$0H��D��H��H���H��H�H��
�ZL����@���H�t$(H��D��H���H��H��H��?�JH�}�@�����A�$X�V H� � I�QH�5�I1�H�81����3 H�^���teH�L$(H�T$0L��1�H�5�S贳���Å�� �t$0�|$(f�E*��u�}A�$��I�}L��H�5�S1������L��� H�SH�5�H1�1�I�8�\����L�%h� H�J1�L��H�58L1�I�<$�5����w�_�������������f�EH�ML��1�H�T$0H�5(S�ܲ���Å��H�|$0H�u�;�����!A�$
��H�V�D$�����H�L$(H�T$0PL��H�5�J1�L�D$ APL�L$,L�D$0�d���ZY�Å���D�T$�t$0H�}1���f�ED�U@�u�������������\$(D�L$ �]D�MA�$��Nf�EH�UL��1�H�5�M�ܱ���Å�tA�$��L��� L��H�5�Q1�I�8蹲���L�%�� H�J1�L��H�5}I1�I�<$蒲��������L�}��H�T$0�L��H�5�Q�f�E1�L��L���F�������H�|$0H�u�����x
A�$��qH�vf�E���t#H�uI�z �q����x4A�$��;L�
�� L��1�1�H�5QI�9�ױ���1��L��� L��H�5�P1�I�;谱����1���D�t$(D�l$ �T$D�uD�m�U�m���L�-w� L��1�1�H�5QGI�}�h����L��L�5Q� H�5�P1�I�>�H����D�\$(D�|$ D�]D�}����H�-=� H�5�K1�H�}�#����UH�v�����H�L$(H�T$0L��1�H�5�D�ү���Å���\$0�L$(f�E�]��MA�$�H�vf��)T$0�����L�|$0L�D$(L��1�L��H��8H�5xE�c����Å���H�|$8��H���2L����������L$(������f��f�E�f�MA�$�WH�!� H�NL��1�H�5�CH�81�����1D�GE����A���A����1�H�L$0L�L$ L��H��� L�D$(H�5~J蒮�����YH�|$0H�wH����DŽ$�L�\$(L�|$ �f�ED��$�D�]D�MD�}A�$H�/���Ͳ���H�\$0L�F�1�H���D$��D$A�����H�L$ H�T$(VL��SH�5/E1�L�L$,L�D$(�έ��_AX����H�t$(H��$��謲��A�}�3�Ƅ$�H��1��Ѭ�����+H�t$0H��tH�|$@��D�l$ A������D�L$D�\$fA��f�ED��$�fD�mD�M
D�UfD�]H����L�|$@H�}L���H���D�}A�$H�߻蟲���QL��L�5�� 1�1�H�5�EI�>����/H�~�����H�L�t$01�L��L�T$L��H�5�L����H�T$����L�|$@M����H�t$0�>��I��l��E�UH�T$H�}L��A��fD�U脲��E�<$L�L$L��L�L$�ޱ��H�l$H�m��H���ư���xL�-"� L��1�1�H�5�LI�}�����UH��膫��I��H���'���1��:H�*u�H��1��s����%I��kwB�D=H�t$0�F���L��� H�5�KH�T$1�I�;軰��L�L$�F���L��L��� H�N1�H�5ZA1�I�8耬����L�%� I�<$蛬����u1��I�<$L��H�5mK1��K����H��� L��H�5PK1�H�81��)����kL��L�52� I�H1�H�5B1�I�>�����EL�-�� I�}�����Å��+I�}L��H�5^B1�1��ͫ���H�N���tqH��� 1�H�L$0L��H�5+C莪������H�|$0H�GH��ueDŽ$�D��$�f�E�D�UA�$H�/���߮���H�-[� H�IL��1�H�5�B1�H�}�(����jH��wKH�w �H��$����A�}�3�Ƅ$�H��1�������yCA�U H�|$0H�/t>1��H�=�� H�5|BH�?�̮��H�|$0H�/u��<���1���H�|$0�����&���1���H��wOH�w �H��$��c���A�}�3�Ƅ$�H��1�舨����yGA�U H�|$0H�/��1��H�+� H�5�AH�;�4���H�|$0H�/u�褭��1��TH�|$0���H�-�� H�5_I1�H�}����,L�� H�5WI1�I�:�ݭ���L�%Y� L��H�5I1�I�<$謩��H��1��2�����H�-�� H�5?@H�}薭��H��1�������E�J���A�U H��1�������1����AWAVAUATI��H��H�5�HUSH��8dH�%(H��$(1�H�L$ H�T$(H�D$8L�L$L�D$H�D$0�D$H�D$ H�D$�ŧ����uE1��L�|$`�1�H�t$L���H�
<� H9�tnH��tiH��$�H�L$L��L�aHH�����uE1�1�E1�E1�1���H�L$1�L��H�5�HH�=$H�P������w����T$H�\$`�T$h� 1�L��H�5�HH�=�G�!������H���H�|$(H�L$0I�WI�wL�D$8�������v���H�l$ H����H��H�5M@�h���H��H���M���H�XH����H�]t�E]tH9�~�ۦ��E1�E1�E1�1���Hk�X�r���I��H��t�I��E1�E1�L�]M�BI�JA���t
H�EJ�<��J�|�1�L��H�5�?L�$L�L$袪������L�$I��M�BI���w/I�HH��H��I9�wL�L$1�I�@��I�����w@��t/�	H�5�F�H�5�FH�ؾ E1�H�;L��E1��ߪ���"I��XL9��<���@�|$L��L�$茫��H�4$�T$H��I��u
�ǥ��E1���H��H��E1�E1�H��$���H��$��M��uH��$�vgL��$��AM�L��$�L��H�ރ�H��I��vHL�$�M)�L9�w8I)�M9�w0I��I��M�M��uGM��H��EL��EID��H��E�H��EL�Q� H�5�>1�E1�I�8�ͥ��� Ik�XI�LH���w5H��H��r,H��$�H��u=L�%	� H�5�>I�<$E1�薩����L�=� H�5�>E1�I�?�x����M��I��I)�I��M9�w�I�L;�$�w�I�I�CL��$�H��H)�L9�w�I)�L9�w�E�TI��H��E�SA�tA�sI�t�L9�������T$L�|$@L��E1�H�L$@E1���T$HH���PA�t$(E1����ZY��xH�|$P趨��I���	L��E1�E1�Lk�XL��M���)���M�M9�tI�~I��X������L���
���H��tH�MuH�����H�|$p1����H�|$0H9l$8~Hk�PH��H��Ш�����ɢ���
E1�1�E1��/���H��$(dH3%(L��t�ߦ��H��8[]A\A]A^A_���ATL�DI��USH��H��dH�%(H��$�1�H�l$H�L$H����
��u1��<1�L��H�5DH��H�=�C虨����x݋T$1�H��H���B���x�Hc����H��$�dH3%(t�0���H�Ġ[]A\���ATL�mCI��USH��H��dH�%(H��$�1�H�l$H�L$H���#
��u1��A1�L��H�5oCH��H�=C����x݋T$�H��H������x�H�]� H�H��$�dH3%(t肥��H�Ġ[]A\���UH��SH��H��H��(dH�%(H��$1��$����H��tH��t#�E1�H�L$H�T$@H��H�5{B�8�����uH�?1�H��H�T$@H��L�D$H�5bB������u$�H�=/� H��1�H�5S;H�?����1���H��$�H�t$H�L$H��L�,BH������uH�|$@�Z���1��H�L$1�H��H�5"BH�=�A覦����x�H�D$@H�T$PE1�E1��$�t$H�l$(H��H�D$H�T$H�����L$ H�L$�t$$�P�s(�%��ZY���y���H�|$@�ӥ��H�|$0�9���H��$dH3%(t��H��([]�AVA��H�=�� AUA��1�ATA��U��1�S�Ԟ��H��t`H��D�pH����D�h��%������D�c�CH�S s
H�C(�.H�
\� H�K(H��x1�H�{�ö����uH�uH������1�H��[]A\A]A^���ATH��H�5�@USH�� dH�%(H�D$1�H�L$H�T$�D$L�D$�D$�D$������uE1��c�^����=�� H�l$�T$I�ċt$�|$tU��H��蓡���=�� ���uF��x�z� �6胢���8u,�T$�t$H���Y� �|$�P������
H���D�����L���z�����yH��� H�8�W���I����|$1�H�� �͠����xg�|$1�H��� 跠����xQ�L$�T$�t$�|$�'���H��H��t4�L$�T$�t$�|$�
���H��H��t"H��H��1��7���I���"�|$1������|$����H�������E1�1�H�MuH���b���H��t
H�uH���P���H�L$dH3%(L��t�x���H�� []A\�S �(1��(AWAVAUATUSH��HH�4$�T$dH�%(H�D$81�H��uV蠜����������H�=�8H��1��t���H��H���rH�=�� H�����H�M�YH��E1�褡����H���D$9Gt"讠��L�� E1��aI�;趢���1�蚢��I��H���1�臢��H��H���rL�mM��uGL�}L�l$�诜��I��H���MH��L��舠��I�A��uL������E���&I��I�}H��u��1�I�}��f�D$L��I��2�t$�˩��I��L;}u
L�$(D$A)M����L��H������I�uL���D$萠���D$����I��I�?tt�|$t��|$
tL�ʹ H�5Y:I�:�֠��E1��1�I�}��f�D$
L��M�A	L$质��I��L;}�d����H�<$L����Q���H�}�}���I��H��tH��H��L��1�H�=�<�~���I���E1�I�$uL���ȟ��H��t
H�uH��趟��H�T$8dH3%(L��t�ޞ��H��H[]A\A]A^A_���USL��$���H��H�$L9�u�H���H��81�dH�%(H��$�@1�H��H�L$H�5!<H��薚������1�H��H�5C?H�=x9膠����y1��kH�\$@H�|$���H���B��x�虜��H�|$H�t$ H��$�L�L$L�D$��?H���P���H�������T$@H�|$H�����H��H�|$虙��H��$�@dH3%(H��t辝��H���@[]���AVAUATUSL��$���H��H�$L9�u�H���H��71�dH�%(H��$�@1�H��H�L$H�5;H���u�������1�H��H�5">H�=;�e�����xCH�\$@H�|$1ɺ�H���(��x&�T$@f��t f��
t&H�
%� H�5�7H�9�.���1��iA�L�c�
A�L�c���<���H�L$ ��L��I��H�D$A��?PH�t$VD��L��$�轙��XL��Z裚��H�|$H�މ��$���H��H�|$�7���H��$�@dH3%(H��t�\���H���@[]A\A]A^�H�{1�蔯���Ã����$����}����$H�C(1��$����_����$����8t%L����������	$H�� H�:����X$�$�t$��� �|$�a�����뽋$�t$�|$�M�������$�c#�D$�L#�D$�4#���#膚��A�Ņ���H�|$�Q���I�ĉŃ��������H�t$ � D���D$�H��H�T$�D���D��������|$����|$����<$��.#H�L$L�D$�&D���D$�ؙ����ujD�T$D�$�"H�� H�5`1H�;�����%#����H��u�L�ǯ H�5�8I�;�ț���փ|$�t�Z����0��	t	��X�Y���H�-�� H�}�Z����D�D$ D�D$�7���H�L$L�D$�D���D$�$�����u�D�L$D�L$����1��Of.�H�H���՟���AWf�AVAUI��ATA��USH��H��hdH�%(H�D$X1�)�?����H�5�4H��E�����A����s��H�5z4H���̙�����\��E��A��E������A��
tE��t_�%H�����H��uM�H��H�SH���
�|�����~.f�
�H�T$XdH3%(uH��h[]A\A]A^A_��
���L�t$ 1��L���D�d$$�_���H��1�H�L$L��I���
���L���������?������AWAVM��AUATUSH���_dH�%(H��$�1��C���)���H��H��II��I��Hc�I��H�>��L�Ff���D$)L$0�D$ A������L�|$0AQH�t1�L��H�5�*H�|$$WL��L�L$0L�D$8�0���AZA[������H�|$8�
�H�����L��������������T$(�����L��D�T$ A�������E�MD�\$f��A�f�U�fD�MD�UD�]A�$H��$�dH34%(��uH�ĸ[]A\A]A^A_��]���ff.�f���U��H�=�� SH��H�۬ H�� �7���H���
���H�-?� H�5*5H��H��H�UH�
H�4� H��H�
��H�u1�H�=�4���H�W� H�������H�H��H�5�4H��踑��H�u1�H�=�4�Ɩ��H�'� H�������H�H��H�5�4H��耑��H�u1�H�=�4莖��H�߷ H���M���H��� H��H�5�FH��H��A���H�
� H��H�5o4H��� �#������
���H�� H�5�FH��H�ҵ ��������H��� H�514H��H��ې��1�H�5%4H�=�� �f���H�54H��H��贐���������1�H�54H��諒���H�5�3H��藒���H�5�3H��胒���H�5�3H���o����H�5�3H���[����H�5�3H���G����H�5�3H���3����H�5�3H�������H�5�3H�������&H�5�3H������	H�5�3H������
H�5�3H���ϑ���H�5~3H��軑���H�5r3H��觑���
H�5h3H��蓑���H�5_3H�������H�5W3H���k����H�5J3H���W���1�H�5D3H���F����H�5>3H���2����H�5;3H�������H�583H���
����H�523H������
H�5+3H������H�5&3H���ΐ���H�5"3H��躐���*H�53H��覐���(H�53H��蒐��1�H�53H��聐���H�53H���m����H�53H���Y��������H�5&3H���E��������H�5!3H���1����H�53H�����������H�53H���	�����H�5�)H������H�53H������H�53H���͏���H�5�2H��蹏���H�5�2H��襏���H�5�2H��葏���H�5�2H���}����H�5�2H���i����H�5�2H���U����H�5�2H���A����H�5�2H���-���1�H�5�2H�������H�5�2H������1�H�5�2H������H�5�2H������H�5�2H���ώ���H�5}2H��軎���H�5v2H��觎���H�5n2H��蓎��H�n2H�5y2H���
���H�u2H�5�2H������H�5y2H���S����H�5l2H���?����H�5_2H���+����H�5R2H�������H�5E2H�������H�5;2H�����1�H�542H���ލ���H�5,2H���ʍ���H�5)2H��趍���H�5&2H��袍���H�5#2H��莍���H�52H���z����H�52H���f����H�52H���R����H�52H���>����H�5
2H���*����H�52H�������H�5�1H�������H�5�1H������H�5�1H���ڌ���H�5�1H���ƌ���H�5�1H��貌����H�5�1H��螌����H�5�1H��芌����H�5�1H���v���1�H�5�1H���e����H�5�1H���Q����H�5�1H���=����H�5�1H���)����H�5�1H�������H�5�1H�������H�5�1H�����H�����H�5�1H���׋���H�5�1H���Ë���H�5�1H��诋���H�5�1H��蛋��1�H�5�1H��芋���H�5�1H���v����H�5�1H���b����H�5�1H���N����H�5�1H���:����H�5�1H���&����H�5�1H�������H�5�1H�����1�H�5�1H������H�5�1H���ي���H�5�1H���Ŋ���H�5�1H��豊���H�5�1H��蝊���H�5�1H��艊���H�5�1H���u����H�5~1H���a����H�5y1H���M����H�5n1H���9����H�5g1H���%����H�5a1H�������H�5V1H������H�5P1H������	H�5I1H���Չ���H�5B1H������H�5;1H��證���
H�541H��虉���
H�5*1H��腉���H�5#1H���q����H�51H���]����H�51H���I����H�51H���5����H�51H���!����H�5�0H���
����H�5�0H������H�5�0H������H�5�0H���ш���H�5�0H��轈���H�5�0H��詈���"H�5�0H��蕈���H�5�0H��聈���H�5�0H���m����H�5�0H���Y����$H�5�0H���E����'H�5�0H���1����&H�5�0H��������H�5�0H���	����H�5{0H������H�5r0H������H�5n0H���͇���H�5b0H��蹇���H�5W0H��襇���@H�5Q0H��葇����H�5J0H���}���� H�5>0H���i����H�540H���U����H�5+0H���A����@H�5#0H���-����@H�50H������� H�50H�������H�50H������H�5
0H���݆��� H�5�/H���Ɇ���H�5�/H��赆��1�H�5�/H��褆���H�5�/H��萆���H�5�/H���|����dH�5�/H���h����eH�5�/H���T����H�5�/H���@�����H�5�/H���,����@H�5�/H������� H�5�/H��������H�5�/H��������H�5�/H���܅������H�5�/H���ȅ���H�5�/H��贅���H�5v/H��蠅���H�5q/H��茅���H�5p/H���x����H�5m/H���d����H�5o/H���P����H�5m/H���<����H�5a/H���(����H�5^/H�������H�5\/H�������H�5X/H������H�5T/H���؄���H�5Q/H���Ą���H�5O/H��谄���H�5K/H��蜄���	H�5I/H��舄���
H�5H/H���t����H�5F/H���`����H�5E/H���L����H�5D/H���8����H�5A/H���$����H�5@/H�������H�5@/H������H�5@/H������ H�5A/H���ԃ���@H�5B/H�������H�5C/H��謃���H�5G/H��蘃���H�5N/H��脃���H�5U/H���p����H�5V/H���\����H�5W/H���H����H�5K/H���4���1�H�5B/H���#���1�H�5</H�������H�58/H������H�51/H������)H�5*/H���ւ���H�5#/H���‚���H�5/H��讂���H�5/H��蚂���H�5/H��膂���H�5/H���r����H�5�.H���^����H�5�.H���J����+H�5�.H���6����,H�5�.H���"����.H�5�.H�������/H�5�.H������2H�5�.H������3H�5�.H���ҁ���:H�5�.H��辁���;H�5�.H��誁���<H�5�.H��薁���gH�5�.H��肁����H�5�.H���n�����H�5�.H���Z����H�5�.H���F�����H�5�.H���2���1�H�5�.H���!��������H�5�.H���
����H�5�.H�������H�5�.H�������H�5�.H���р�����H�5�.H��轀�������H�5�.H��詀���H�5�.H��蕀���H�5�.H��聀���H�5w.H���m����H�5j.H���Y����H�5].H���E����H�5U.H���1����H�5P.H������� H�5G.H���	����!H�5C.H������"H�5@.H�������#H�5>.H�������$H�5<.H������H�5;.H������H�5@.H������H�5F.H���}���H�5E.H���i���H�5@.H���U���H�5<.H���A���H�59.H���-���H�59.H������H�57.H������H�57.H����~���H�55.H����~���H�5-.H����~���>H�5'.H���~���;H�5!.H���~���4H�5.H���~���6H�5.H���y~���	H�5
.H���e~���=H�5.H���Q~���2H�5�-H���=~���:H�5�-H���)~���3H�5�-H���~���5H�5�-H���~���1H�5�-H����}���8H�5�-H����}���BH�5�-H����}���9H�5�-H���}���7H�5�-H���}��1�H�5�-H���}���<H�5�-H���x}���CH�5�-H���d}���H�5�-H���P}���H�5�-H���<}���H�5�-H���(}���H�5�-H���}���H�5�-H���}���H�5�-H����|���H�5�-H����|���H�5�-H����|���	H�5�-H���|���
H�5�-H���|���H�5�-H���|���H�5|-H���t|���H�5u-H���`|���
H�5n-H���L|���H�5i-H���8|���H�5f-H���$|��H�����H�5b-H���|��H�����H�5[-H���{��H�����H�5O-H����{��H�����H�5F-H����{��H�����H�59-H���{��H�����H�5.-H���{��H�����H�5#-H���{��H�����H�5-H���t{��H���H�5
-H���^{��H�����H�5-H���H{��H�����H�5�,H���2{��H�����H�5�,H���{���H�5�,H���{���H�5�,H����z���H�5�,H����z���H�5�,H����z���H�5�,H���z��� H�5�,H���z���H�5�,H���z���H�5�,H���|z��� H�5�,H���hz���H�5�,H���Tz���H�5�,H���@z���H�5�,H���,z���H�5�,H���z���H�5�,H���z��1�H�5},H����y���H�5q,H����y���H�5e,H����y��H��H��[]ÐH�=� H�� H9�tH��� H��t	�����H�=� H�5� H)�H��H��H��?H�H�tH��� H��t��fD�����=�� u+UH�=�� H��tH�=V� �	z���d����}� ]������w������S1���0H��H��t�@�������z��H�C(H����H�C H��[����ATUS�o���t+�G����H���z����I����v��L����y���������H�.� H�[]A\�D��USH��H��(dH�%(H�D$1�H��H�t$H�|$�z���{������H�$H�t$H�|$��y��H�D$dH3%(uH��([]��z�����SH����w�����6���H�CH��[H��@��f.���ATUH��SH�������H��H�H�����i���H�5ڏ H9��=����y��A�ą��-���H�C���������{ �۝���C �ƒ�`��`uI� �k����@�Z���H�s0H�uL�KH�}H��1��I��I��I��M9������A�D��[]A\��8���f.���ATL�}I��USH��H��dH�%(H��$�1�H�l$H�L$H��������@��1�L��H�5;H��H�=$�{���������w���{�T$H��I����z��L����sw��������H�� H�H��$�dH3%(uH�Ġ[]A\��,y��ff.����AUH�
� ATUSH��H��H��H��dH�%(H��$�1�H�D$�$����H�D$�D$�����D$����P1�H�T$RH��L�L$L�D$�Xz��ZY�����D�$D�D$1�H�ڋL$H�5"H�=h�z��������H�L$H��t
H;
 � ���|$������|$������<$������v���=�� I���h���t$�$�|$���w���=؍ ��������������� L���u��1�H��� ���fv���������D$D�d$�kH�5}���<$H�s ��D�c�����{�K���q��L�j� L�C(M���9��1�H��$�dH3%(��uH�ĸ[]A\A]��[w��H�yH�5�� H9������|����H��H���getsockaddrlen: unknown BT protocolCMSG_SPACE() argument out of rangeCMSG_LEN() argument out of rangeinvalid length of packed IP address stringillegal IP address string passed to inet_ptonpacked IP wrong length for inet_ntoaillegal IP address string passed to inet_atonhtons: can't convert negative Python int to C 16-bit unsigned integerhtons: Python int too large to convert to C 16-bit unsigned integer (The silent truncation is deprecated)ntohs: can't convert negative Python int to C 16-bit unsigned integerntohs: Python int too large to convert to C 16-bit unsigned integer (The silent truncation is deprecated)getservbyport: port must be 0-65535.getsockopt string buffer not allowedgetsockopt buflen out of range<socket object, fd=%ld, family=%d, type=%d, proto=%d>str, bytes or bytearray expected, not %shost name must not contain null charactergetnameinfo() argument 1 must be a tuplesi|II;getnameinfo(): illegal sockaddr argumentgetnameinfo(): flowinfo must be 0-1048575.sockaddr resolved to multiple addressesgetaddrinfo() argument 1 must be string or Nonewildcard resolved to multiple addresssendmsg() argument 1 must be an iterablesendmsg() argument 1 is too longy*;sendmsg() argument 1 must be an iterable of bytes-like objectsalgset is only supported for AF_ALGInvalid or missing argument 'op'unexpected NULL result from CMSG_FIRSTHDRunexpected NULL result from CMSG_NXTHDR(iv)unexpected NULL result from CMSG_NXTHDR(assoc)invalid ancillary data buffer lengthreceived malformed or improperly-truncated ancillary datarecvmsg_into() argument 1 must be an iterablerecvmsg_into() argument 1 is too longw*;recvmsg_into() argument 1 must be an iterable of single-segment read-write buffersnegative buffer size in recvmsg()negative buffersize in recvfrom_intonbytes is greater than the length of the buffernegative buffersize in recv_intobuffer too small for requested bytesnegative buffersize in recvfrom%s(): AF_NETLINK address must be tuple, not %.500sII;AF_NETLINK address must be a pair (pid, groups)getsockaddrarg: AF_QIPCRTR address must be tuple, not %.500sgetsockaddrarg: AF_VSOCK address must be tuple, not %.500s%s(): AF_INET address must be tuple, not %.500sO&i;AF_INET address must be a pair (host, port)%s(): AF_INET6 address must be tuple, not %.500sO&i|II;AF_INET6 address must be a tuple (host, port[, flowinfo[, scopeid]])%s(): flowinfo must be 0-1048575.%s(): unknown Bluetooth protocol%s(): AF_PACKET address must be tuple, not %.500ssi|iiy*;AF_PACKET address must be a tuple of two to five elements%s(): address argument out of rangeHardware address must be 8 bytes or less%s(): AF_TIPC address must be tuple, not %.500sIIII|I;AF_TIPC address must be a tuple (addr_type, v1, v2, v3[, scope])%s(): AF_CAN address must be tuple, not %.500sO&;AF_CAN address must be a tuple (interface, )AF_CAN interface name too long%s(): unsupported CAN protocol%s(): AF_ALG address must be tuple, not %.500sss|HH;AF_ALG address must be a tuple (type, name[, feat[, mask]])sendmsg() argument 2 must be an iterable(iiy*):[sendmsg() ancillary data items]unexpected NULL result from %s()ancillary data does not fit in calculated spaceitem size out of range for CMSG_LEN()sendto() takes 2 or 3 arguments (%zd given)integer argument expected, got floatIOCTL_VM_SOCKETS_GET_LOCAL_CIDgetsockaddrlen: bad familyn:CMSG_SPACEn:CMSG_LENO&:if_nametoindexno interface with this nameIO&Timeout value out of range(is)int larger than 32 bitsexpected int, %s found%02X:%02X:%02X:%02X:%02X:%02XOiOiIIUnknown Bluetooth protocolshbhy#IIIIIInvalid address typeO&kk(O&)s#s#HHiy#iy*:inet_ntopunknown address family %dis:inet_ptonunknown address familyy*:inet_ntoas:inet_atoni:htonsi:ntohss:getprotobynameprotocol not foundi|s:getservbyportissocket.getservbyportport/proto not founds|s:getservbynamesocket.getservbynameservice/proto not foundS:sethostnameO&:sethostname(O)socket.sethostnamesocket.gethostnameunclosed %R%X:%X:%X:%X:%X:%X%cbad bluetooth addressii|i:getsockoptiiK:setsockoptiii:setsockoptiiO!I:setsockoptiiy*:setsockopt|i:listenidnaencoding of hostname failedOi:getnameinfosocket.getnameinfoIPv4 sockaddr must be 2 tupleNsOO|iiii:getaddrinfo%ldInt or String expectedOOiiisocket.getaddrinfoiiisOunsupported address family255.255.255.255<broadcast>address family mismatchedet:gethostbynamesocket.gethostbynametimed out|O$O!y*O!i:sendmsg_afalgassoclen must be positivey*|i:sendNOiNcontrol message too longiiNO|ni:recvmsg_inton|ni:recvmsgw*|ni:recvfrom_intonNw*|ni:recv_inton|i:recvnegative buffersize in recvy*|i:sendalln|i:recvfromy*AF_UNIX path too longII:getsockaddrarg%s(): port must be 0-65535.si%s(): wrong format%s(): proto must be 0-65535.AF_ALG type too long.AF_ALG name too long.%s(): bad familyCMSG_FIRSTHDRCMSG_NXTHDRO|OiO:sendmsgsocket.sendmsgancillary data item too largetoo much ancillary dataconnect_exsocket.connecty*O:sendtoy*iO:sendtosocket.sendto|iii:socketpairsocket.bindNOOet:gethostbyname_exet:gethostbyaddrsocket.gethostbyaddr|iiiO:socketsocket.__new__negative file descriptorsocket.herrorsocket.gaierrorsocket.timeoutSocketTypehas_ipv6_socket.CAPIAF_UNSPECAF_INETAF_UNIXAF_AX25AF_IPXAF_APPLETALKAF_NETROMAF_BRIDGEAF_ATMPVCAF_ALGAF_X25AF_INET6AF_ROSEAF_DECnetAF_NETBEUIAF_SECURITYAF_KEYAF_NETLINKNETLINK_ROUTENETLINK_USERSOCKNETLINK_FIREWALLNETLINK_NFLOGNETLINK_XFRMNETLINK_IP6_FWNETLINK_DNRTMSGNETLINK_CRYPTOAF_QIPCRTRAF_VSOCKSO_VM_SOCKETS_BUFFER_SIZESO_VM_SOCKETS_BUFFER_MIN_SIZESO_VM_SOCKETS_BUFFER_MAX_SIZEVMADDR_CID_ANYVMADDR_PORT_ANYVMADDR_CID_HOSTVM_SOCKETS_INVALID_VERSIONAF_ROUTEAF_ASHAF_ECONETAF_ATMSVCAF_SNAAF_IRDAAF_PPPOXAF_WANPIPEAF_LLCAF_BLUETOOTHBTPROTO_L2CAPBTPROTO_HCISOL_HCIHCI_FILTERHCI_TIME_STAMPHCI_DATA_DIRBTPROTO_SCOBTPROTO_RFCOMM00:00:00:00:00:00BDADDR_ANY00:00:00:FF:FF:FFBDADDR_LOCALAF_CANPF_CANAF_RDSPF_RDSAF_PACKETPF_PACKETPACKET_HOSTPACKET_BROADCASTPACKET_MULTICASTPACKET_OTHERHOSTPACKET_OUTGOINGPACKET_LOOPBACKPACKET_FASTROUTEAF_TIPCTIPC_ADDR_NAMESEQTIPC_ADDR_NAMETIPC_ADDR_IDTIPC_ZONE_SCOPETIPC_CLUSTER_SCOPETIPC_NODE_SCOPESOL_TIPCTIPC_IMPORTANCETIPC_SRC_DROPPABLETIPC_DEST_DROPPABLETIPC_CONN_TIMEOUTTIPC_LOW_IMPORTANCETIPC_MEDIUM_IMPORTANCETIPC_HIGH_IMPORTANCETIPC_CRITICAL_IMPORTANCETIPC_SUB_PORTSTIPC_SUB_SERVICETIPC_SUB_CANCELTIPC_WAIT_FOREVERTIPC_PUBLISHEDTIPC_WITHDRAWNTIPC_SUBSCR_TIMEOUTTIPC_CFG_SRVTIPC_TOP_SRVALG_SET_KEYALG_SET_IVALG_SET_OPALG_SET_AEAD_ASSOCLENALG_SET_AEAD_AUTHSIZEALG_SET_PUBKEYALG_OP_DECRYPTALG_OP_ENCRYPTALG_OP_SIGNALG_OP_VERIFYSOCK_STREAMSOCK_DGRAMSOCK_RAWSOCK_SEQPACKETSOCK_RDMSOCK_CLOEXECSOCK_NONBLOCKSO_DEBUGSO_ACCEPTCONNSO_REUSEADDRSO_KEEPALIVESO_DONTROUTESO_BROADCASTSO_LINGERSO_OOBINLINESO_REUSEPORTSO_SNDBUFSO_RCVBUFSO_SNDLOWATSO_RCVLOWATSO_SNDTIMEOSO_RCVTIMEOSO_ERRORSO_TYPESO_PASSCREDSO_PEERCREDSO_PASSSECSO_PEERSECSO_BINDTODEVICESO_PRIORITYSO_MARKSO_DOMAINSO_PROTOCOLSOMAXCONNSCM_RIGHTSSCM_CREDENTIALSMSG_OOBMSG_PEEKMSG_DONTROUTEMSG_DONTWAITMSG_EORMSG_TRUNCMSG_CTRUNCMSG_WAITALLMSG_NOSIGNALMSG_CMSG_CLOEXECMSG_ERRQUEUEMSG_CONFIRMMSG_MOREMSG_FASTOPENSOL_SOCKETSOL_IPSOL_TCPSOL_UDPSOL_CAN_BASESOL_CAN_RAWCAN_EFF_FLAGCAN_RTR_FLAGCAN_ERR_FLAGCAN_SFF_MASKCAN_EFF_MASKCAN_ERR_MASKCAN_ISOTPCAN_RAW_FILTERCAN_RAW_ERR_FILTERCAN_RAW_LOOPBACKCAN_RAW_RECV_OWN_MSGSCAN_RAW_FD_FRAMESCAN_BCMCAN_BCM_TX_SETUPCAN_BCM_TX_DELETECAN_BCM_TX_READCAN_BCM_TX_SENDCAN_BCM_RX_SETUPCAN_BCM_RX_DELETECAN_BCM_RX_READCAN_BCM_TX_STATUSCAN_BCM_TX_EXPIREDCAN_BCM_RX_STATUSCAN_BCM_RX_TIMEOUTCAN_BCM_RX_CHANGEDCAN_BCM_SETTIMERCAN_BCM_STARTTIMERCAN_BCM_TX_COUNTEVTCAN_BCM_TX_ANNOUNCECAN_BCM_TX_CP_CAN_IDCAN_BCM_RX_FILTER_IDCAN_BCM_RX_CHECK_DLCCAN_BCM_RX_NO_AUTOTIMERCAN_BCM_RX_ANNOUNCE_RESUMECAN_BCM_TX_RESET_MULTI_IDXCAN_BCM_RX_RTR_FRAMECAN_BCM_CAN_FD_FRAMESOL_RDSSOL_ALGIPPROTO_IPIPPROTO_HOPOPTSIPPROTO_ICMPIPPROTO_IGMPIPPROTO_IPV6IPPROTO_IPIPIPPROTO_TCPIPPROTO_EGPIPPROTO_PUPIPPROTO_UDPIPPROTO_IDPIPPROTO_TPIPPROTO_ROUTINGIPPROTO_FRAGMENTIPPROTO_RSVPIPPROTO_GREIPPROTO_ESPIPPROTO_AHIPPROTO_ICMPV6IPPROTO_NONEIPPROTO_DSTOPTSIPPROTO_PIMIPPROTO_SCTPIPPROTO_RAWIPPORT_RESERVEDIPPORT_USERRESERVEDINADDR_ANYINADDR_BROADCASTINADDR_LOOPBACKINADDR_UNSPEC_GROUPINADDR_ALLHOSTS_GROUPINADDR_MAX_LOCAL_GROUPINADDR_NONEIP_OPTIONSIP_HDRINCLIP_TOSIP_TTLIP_RECVOPTSIP_RECVRETOPTSIP_RETOPTSIP_MULTICAST_IFIP_MULTICAST_TTLIP_MULTICAST_LOOPIP_ADD_MEMBERSHIPIP_DROP_MEMBERSHIPIP_DEFAULT_MULTICAST_TTLIP_DEFAULT_MULTICAST_LOOPIP_MAX_MEMBERSHIPSIP_TRANSPARENTIPV6_JOIN_GROUPIPV6_LEAVE_GROUPIPV6_MULTICAST_HOPSIPV6_MULTICAST_IFIPV6_MULTICAST_LOOPIPV6_UNICAST_HOPSIPV6_V6ONLYIPV6_CHECKSUMIPV6_DONTFRAGIPV6_DSTOPTSIPV6_HOPLIMITIPV6_HOPOPTSIPV6_NEXTHOPIPV6_PATHMTUIPV6_PKTINFOIPV6_RECVDSTOPTSIPV6_RECVHOPLIMITIPV6_RECVHOPOPTSIPV6_RECVPKTINFOIPV6_RECVRTHDRIPV6_RECVTCLASSIPV6_RTHDRIPV6_RTHDRDSTOPTSIPV6_RTHDR_TYPE_0IPV6_RECVPATHMTUIPV6_TCLASSTCP_NODELAYTCP_MAXSEGTCP_CORKTCP_KEEPIDLETCP_KEEPINTVLTCP_KEEPCNTTCP_SYNCNTTCP_LINGER2TCP_DEFER_ACCEPTTCP_WINDOW_CLAMPTCP_INFOTCP_QUICKACKTCP_FASTOPENTCP_CONGESTIONTCP_USER_TIMEOUTTCP_NOTSENT_LOWATEAI_ADDRFAMILYEAI_AGAINEAI_BADFLAGSEAI_FAILEAI_FAMILYEAI_MEMORYEAI_NODATAEAI_NONAMEEAI_OVERFLOWEAI_SERVICEEAI_SOCKTYPEEAI_SYSTEMAI_PASSIVEAI_CANONNAMEAI_NUMERICHOSTAI_NUMERICSERVAI_ALLAI_ADDRCONFIGAI_V4MAPPEDNI_MAXHOSTNI_MAXSERVNI_NOFQDNNI_NUMERICHOSTNI_NAMEREQDNI_NUMERICSERVNI_DGRAMSHUT_RDSHUT_WRSHUT_RDWR_acceptclosedetachfilenogetpeernamegetsocknamesetblockinggetblockingsettimeoutgettimeoutshutdownthe socket familythe socket typeprotothe socket protocolthe socket timeoutdupntohlhtonlgetdefaulttimeoutsetdefaulttimeoutif_nameindexif_indextoname_socket_socket.socketbuffernbytesflagsivassoclenhost8���n������������������������������������������n�����������������6���f����������������G�����ە����4���socket(family=AF_INET, type=SOCK_STREAM, proto=0) -> socket object
socket(family=-1, type=-1, proto=-1, fileno=None) -> socket object

Open a socket of the given type.  The family argument specifies the
address family; it defaults to AF_INET.  The type argument specifies
whether this is a stream (SOCK_STREAM, this is the default)
or datagram (SOCK_DGRAM) socket.  The protocol argument defaults to 0,
specifying the default protocol.  Keyword arguments are accepted.
The socket is created as non-inheritable.

When a fileno is passed in, family, type and proto are auto-detected,
unless they are explicitly set.

A socket object represents one endpoint of a network connection.

Methods of socket objects (keyword arguments not allowed):

_accept() -- accept connection, returning new socket fd and client address
bind(addr) -- bind the socket to a local address
close() -- close the socket
connect(addr) -- connect the socket to a remote address
connect_ex(addr) -- connect, return an error code instead of an exception
dup() -- return a new socket fd duplicated from fileno()
fileno() -- return underlying file descriptor
getpeername() -- return remote address [*]
getsockname() -- return local address
getsockopt(level, optname[, buflen]) -- get socket options
gettimeout() -- return timeout or None
listen([n]) -- start listening for incoming connections
recv(buflen[, flags]) -- receive data
recv_into(buffer[, nbytes[, flags]]) -- receive data (into a buffer)
recvfrom(buflen[, flags]) -- receive data and sender's address
recvfrom_into(buffer[, nbytes, [, flags])
  -- receive data and sender's address (into a buffer)
sendall(data[, flags]) -- send all data
send(data[, flags]) -- send data, may not send all of it
sendto(data[, flags], addr) -- send data to a given address
setblocking(0 | 1) -- set or clear the blocking I/O flag
getblocking() -- return True if socket is blocking, False if non-blocking
setsockopt(level, optname, value[, optlen]) -- set socket options
settimeout(None | float) -- set or clear the timeout
shutdown(how) -- shut down traffic in one or both directions
if_nameindex() -- return all network interface indices and names
if_nametoindex(name) -- return the corresponding interface index
if_indextoname(index) -- return the corresponding interface name

 [*] not available on all platforms!sendmsg_afalg([msg], *, op[, iv[, assoclen[, flags=MSG_MORE]]])

Set operation mode, IV and length of associated data for an AF_ALG
operation socket.sendmsg(buffers[, ancdata[, flags[, address]]]) -> count

Send normal and ancillary data to the socket, gathering the
non-ancillary data from a series of buffers and concatenating it into
a single message.  The buffers argument specifies the non-ancillary
data as an iterable of bytes-like objects (e.g. bytes objects).
The ancdata argument specifies the ancillary data (control messages)
as an iterable of zero or more tuples (cmsg_level, cmsg_type,
cmsg_data), where cmsg_level and cmsg_type are integers specifying the
protocol level and protocol-specific type respectively, and cmsg_data
is a bytes-like object holding the associated data.  The flags
argument defaults to 0 and has the same meaning as for send().  If
address is supplied and not None, it sets a destination address for
the message.  The return value is the number of bytes of non-ancillary
data sent.recvmsg_into(buffers[, ancbufsize[, flags]]) -> (nbytes, ancdata, msg_flags, address)

Receive normal data and ancillary data from the socket, scattering the
non-ancillary data into a series of buffers.  The buffers argument
must be an iterable of objects that export writable buffers
(e.g. bytearray objects); these will be filled with successive chunks
of the non-ancillary data until it has all been written or there are
no more buffers.  The ancbufsize argument sets the size in bytes of
the internal buffer used to receive the ancillary data; it defaults to
0, meaning that no ancillary data will be received.  Appropriate
buffer sizes for ancillary data can be calculated using CMSG_SPACE()
or CMSG_LEN(), and items which do not fit into the buffer might be
truncated or discarded.  The flags argument defaults to 0 and has the
same meaning as for recv().

The return value is a 4-tuple: (nbytes, ancdata, msg_flags, address).
The nbytes item is the total number of bytes of non-ancillary data
written into the buffers.  The ancdata item is a list of zero or more
tuples (cmsg_level, cmsg_type, cmsg_data) representing the ancillary
data (control messages) received: cmsg_level and cmsg_type are
integers specifying the protocol level and protocol-specific type
respectively, and cmsg_data is a bytes object holding the associated
data.  The msg_flags item is the bitwise OR of various flags
indicating conditions on the received message; see your system
documentation for details.  If the receiving socket is unconnected,
address is the address of the sending socket, if available; otherwise,
its value is unspecified.

If recvmsg_into() raises an exception after the system call returns,
it will first attempt to close any file descriptors received via the
SCM_RIGHTS mechanism.recvmsg(bufsize[, ancbufsize[, flags]]) -> (data, ancdata, msg_flags, address)

Receive normal data (up to bufsize bytes) and ancillary data from the
socket.  The ancbufsize argument sets the size in bytes of the
internal buffer used to receive the ancillary data; it defaults to 0,
meaning that no ancillary data will be received.  Appropriate buffer
sizes for ancillary data can be calculated using CMSG_SPACE() or
CMSG_LEN(), and items which do not fit into the buffer might be
truncated or discarded.  The flags argument defaults to 0 and has the
same meaning as for recv().

The return value is a 4-tuple: (data, ancdata, msg_flags, address).
The data item is a bytes object holding the non-ancillary data
received.  The ancdata item is a list of zero or more tuples
(cmsg_level, cmsg_type, cmsg_data) representing the ancillary data
(control messages) received: cmsg_level and cmsg_type are integers
specifying the protocol level and protocol-specific type respectively,
and cmsg_data is a bytes object holding the associated data.  The
msg_flags item is the bitwise OR of various flags indicating
conditions on the received message; see your system documentation for
details.  If the receiving socket is unconnected, address is the
address of the sending socket, if available; otherwise, its value is
unspecified.

If recvmsg() raises an exception after the system call returns, it
will first attempt to close any file descriptors received via the
SCM_RIGHTS mechanism.shutdown(flag)

Shut down the reading side of the socket (flag == SHUT_RD), the writing side
of the socket (flag == SHUT_WR), or both ends (flag == SHUT_RDWR).setsockopt(level, option, value: int)
setsockopt(level, option, value: buffer)
setsockopt(level, option, None, optlen: int)

Set a socket option.  See the Unix manual for level and option.
The value argument can either be an integer, a string buffer, or
None, optlen.gettimeout() -> timeout

Returns the timeout in seconds (float) associated with socket
operations. A timeout of None indicates that timeouts on socket
operations are disabled.settimeout(timeout)

Set a timeout on socket operations.  'timeout' can be a float,
giving in seconds, or None.  Setting a timeout of None disables
the timeout feature and is equivalent to setblocking(1).
Setting a timeout of zero is the same as setblocking(0).getblocking()

Returns True if socket is in blocking mode, or False if it
is in non-blocking mode.setblocking(flag)

Set the socket to blocking (flag is true) or non-blocking (false).
setblocking(True) is equivalent to settimeout(None);
setblocking(False) is equivalent to settimeout(0.0).sendto(data[, flags], address) -> count

Like send(data, flags) but allows specifying the destination address.
For IP sockets, the address is a pair (hostaddr, port).sendall(data[, flags])

Send a data string to the socket.  For the optional flags
argument, see the Unix manual.  This calls send() repeatedly
until all data is sent.  If an error occurs, it's impossible
to tell how much data has been sent.send(data[, flags]) -> count

Send a data string to the socket.  For the optional flags
argument, see the Unix manual.  Return the number of bytes
sent; this may be less than len(data) if the network is busy.recvfrom_into(buffer[, nbytes[, flags]]) -> (nbytes, address info)

Like recv_into(buffer[, nbytes[, flags]]) but also return the sender's address info.recvfrom(buffersize[, flags]) -> (data, address info)

Like recv(buffersize, flags) but also return the sender's address info.recv_into(buffer, [nbytes[, flags]]) -> nbytes_read

A version of recv() that stores its data into a buffer rather than creating
a new string.  Receive up to buffersize bytes from the socket.  If buffersize
is not specified (or 0), receive up to the size available in the given buffer.

See recv() for documentation about the flags.recv(buffersize[, flags]) -> data

Receive up to buffersize bytes from the socket.  For the optional flags
argument, see the Unix manual.  When no data is available, block until
at least one byte is available or until the remote end is closed.  When
the remote end is closed and all data is read, return the empty string.listen([backlog])

Enable a server to accept connections.  If backlog is specified, it must be
at least 0 (if it is lower, it is set to 0); it specifies the number of
unaccepted connections that the system will allow before refusing new
connections. If not specified, a default reasonable value is chosen.getsockopt(level, option[, buffersize]) -> value

Get a socket option.  See the Unix manual for level and option.
If a nonzero buffersize argument is given, the return value is a
string of that length; otherwise it is an integer.getsockname() -> address info

Return the address of the local endpoint. The format depends on the
address family. For IPv4 sockets, the address info is a pair
(hostaddr, port).getpeername() -> address info

Return the address of the remote endpoint.  For IP sockets, the address
info is a pair (hostaddr, port).fileno() -> integer

Return the integer file descriptor of the socket.detach()

Close the socket object without closing the underlying file descriptor.
The object cannot be used after this call, but the file descriptor
can be reused for other purposes.  The file descriptor is returned.connect_ex(address) -> errno

This is like connect(address), but returns an error code (the errno value)
instead of raising an exception when an error occurs.connect(address)

Connect the socket to a remote address.  For IP sockets, the address
is a pair (host, port).close()

Close the socket.  It cannot be used after this call.bind(address)

Bind the socket to a local address.  For IP sockets, the address is a
pair (host, port); the host must refer to the local host. For raw packet
sockets the address is a tuple (ifname, proto [,pkttype [,hatype [,addr]]])_accept() -> (integer, address info)

Wait for an incoming connection.  Return a new socket file descriptor
representing the connection, and the address of the client.
For IP sockets, the address info is a pair (hostaddr, port).CMSG_SPACE(length) -> buffer size

Return the buffer size needed for recvmsg() to receive an ancillary
data item with associated data of the given length, along with any
trailing padding.  The buffer space needed to receive multiple items
is the sum of the CMSG_SPACE() values for their associated data
lengths.  Raises OverflowError if length is outside the permissible
range of values.CMSG_LEN(length) -> control message length

Return the total length, without trailing padding, of an ancillary
data item with associated data of the given length.  This value can
often be used as the buffer size for recvmsg() to receive a single
item of ancillary data, but RFC 3542 requires portable applications to
use CMSG_SPACE() and thus include space for padding, even when the
item will be the last in the buffer.  Raises OverflowError if length
is outside the permissible range of values.if_indextoname(if_index)

Returns the interface name corresponding to the interface index if_index.if_nametoindex(if_name)

Returns the interface index corresponding to the interface name if_name.if_nameindex()

Returns a list of network interface information (index, name) tuples.setdefaulttimeout(timeout)

Set the default timeout in seconds (float) for new socket objects.
A value of None indicates that new socket objects have no timeout.
When the socket module is first imported, the default is None.getdefaulttimeout() -> timeout

Returns the default timeout in seconds (float) for new socket objects.
A value of None indicates that new socket objects have no timeout.
When the socket module is first imported, the default is None.getnameinfo(sockaddr, flags) --> (host, port)

Get host and port for a sockaddr.getaddrinfo(host, port [, family, type, proto, flags])
    -> list of (family, type, proto, canonname, sockaddr)

Resolve host and port into addrinfo struct.inet_ntop(af, packed_ip) -> string formatted IP address

Convert a packed IP address of the given family to string format.inet_pton(af, ip) -> packed IP address string

Convert an IP address from string format to a packed string suitable
for use with low-level network functions.inet_ntoa(packed_ip) -> ip_address_string

Convert an IP address from 32-bit packed binary format to string formatinet_aton(string) -> bytes giving packed 32-bit IP representation

Convert an IP address in string format (123.45.67.89) to the 32-bit packed
binary format used in low-level network functions.htonl(integer) -> integer

Convert a 32-bit integer from host to network byte order.htons(integer) -> integer

Convert a 16-bit unsigned integer from host to network byte order.
Note that in case the received integer does not fit in 16-bit unsigned
integer, but does fit in a positive C int, it is silently truncated to
16-bit unsigned integer.
However, this silent truncation feature is deprecated, and will raise an
exception in future versions of Python.ntohl(integer) -> integer

Convert a 32-bit integer from network to host byte order.ntohs(integer) -> integer

Convert a 16-bit unsigned integer from network to host byte order.
Note that in case the received integer does not fit in 16-bit unsigned
integer, but does fit in a positive C int, it is silently truncated to
16-bit unsigned integer.
However, this silent truncation feature is deprecated, and will raise an
exception in future versions of Python.socketpair([family[, type [, proto]]]) -> (socket object, socket object)

Create a pair of socket objects from the sockets returned by the platform
socketpair() function.
The arguments are the same as for socket() except the default family is
AF_UNIX if defined on the platform; otherwise, the default is AF_INET.dup(integer) -> integer

Duplicate an integer socket file descriptor.  This is like os.dup(), but for
sockets; on some platforms os.dup() won't work for socket file descriptors.close(integer) -> None

Close an integer socket file descriptor.  This is like os.close(), but for
sockets; on some platforms os.close() won't work for socket file descriptors.getprotobyname(name) -> integer

Return the protocol number for the named protocol.  (Rarely used.)getservbyport(port[, protocolname]) -> string

Return the service name from a port number and protocol name.
The optional protocol name, if given, should be 'tcp' or 'udp',
otherwise any protocol will match.getservbyname(servicename[, protocolname]) -> integer

Return a port number from a service name and protocol name.
The optional protocol name, if given, should be 'tcp' or 'udp',
otherwise any protocol will match.sethostname(name)

Sets the hostname to name.gethostname() -> string

Return the current host name.gethostbyaddr(host) -> (name, aliaslist, addresslist)

Return the true host name, a list of aliases, and a list of IP addresses,
for a host.  The host argument is a string giving a host name or IP number.gethostbyname_ex(host) -> (name, aliaslist, addresslist)

Return the true host name, a list of aliases, and a list of IP addresses,
for a host.  The host argument is a string giving a host name or IP number.gethostbyname(host) -> address

Return the IP address (a string of the form '255.255.255.255') for a host.Implementation module for socket operations.

See the socket module for documentation.;llh�����������
���3
���d�����$l��<��P�����������������4H��Lo��d���|����`���f�������J�� ���P�������������� ��@���Xk��p����8��P�� ���T��|%���;�������# ���!��	�!��D	#��x	�#���	$��
�$��0
�$��D
�$��`
�%���
�%���
�%���
T'���
�'��,])����)����)����)���*����*�� S+��Xs+���u+���3,����,��`
'.��t
�0���
g4���^6���7���u8��(9��X�:����>���?��X�C����E���F��8�G���I���pI����J��0bK��P�L���N���*O��(xP����]��4Kc����c����d���1f��4�f��p�h����h��Ik��Xdl����m��`p���p��x(p��,Xq��t�r��t(����h���������	(���lX���0
(���������zRx�$����FJw�?:*3$"D`���\���Zp.	��!�;	��1A/�P
���H ��
���H w�(��$�'��zE�D�F@hAA�k��
 e��4g���E�N �A8T����F�D�B �A(�A0��(A BBB�$���8E�r���RH�I����WH N����'QF�
��$NF
��WU�A ,J
��vSm
EJcCP�
��$d�
��rA�O�D`[AA$��
��rA�O�D@[AA,�"��wA�D0W8G@JHLP[0aAT�i��<B�B�A �A(�Dp�xW�NxBp7xK�OxApr(A ABB(<M��E�K�I��AAh4���E�N@�A(�����E�K�D��AA�h���E�N0xA�����H ��d���H �$���cA�A�G0UCA,.��jE�G \A(L����KF�A�A �ABzRx� ���$,��SAB0�(��mE�A�A Q
AAEKAA$�a��[E�A�G KAA���
$���$8���RE�D�A EAA$`����E�K�F0}AA$�'���E�K�D@�AA$�����E�K�D@�AA0����F�A�A �Q�� AAB0����F�J�A �G�� AAB(@���hE�A�G@S
AAAzRx�@�� ���`$����|E�K�F0cAA�K��	�@��#E�Y,�G���A�G@[HFPHXN`S@�A$���#E�Y@���)E�c(\���E�A�QPjAA4�X��`F�A�A �v
ABBYABP�����F�B�B �A(�D0�J���H�N�A��0A(A BBB���/E�e0���'E�]L���AE�wh��'E�],�#���F�A�A �Q0� AAB4�����F�E�A �A(�D0z(A ADB���� 	����&E�XzRx�� ���A8L	����F�F�A �A(�J��(A ABB8�	7���F�F�A �A(�J��(A ABB,�	 ����F�A�D ��
ABA����6@
� ���F�K�A �G�	��	V�	F�	A�	e AABpL
�"���F�H�B �B(�A0�A8�G�T�H�M�M�S��W�Z�A��8A0A(B BBBH�
�a��-B�F�B �E(�D0�A8�G��
8A0A(B BBBA$zRx��������,�%���$H�'���E�R�IP�AAHp,(��eB�B�E �B(�D0�K8�DP98D0A(B BBB,�E)���B�A�A �D0� AABH��)���B�D�B �E(�A0�D8�Gp�8D0A(B BBBt8+��F�G�B �E(�A0�A8�I�}�b�N�B�A�G�N���D�F�A��8A0A(B BBB8��.���E�N�G�l�C�F�D�{AAX�</��;B�J�E �B(�D0�I8�J��E�F�A��8A0A(B BBBTH
3���F�B�B �B(�A0�A8�DpFxO�TxAp_8A0A(B BBB(�
�4��E�QP�XF`YXDPkAX�
}5���B�I�E �E(�D0�A8�J�z�C�F�A�C8A0A(B BBB8(6��PE�N�Q�s�F�M�A��AA d+7��mD@uHCPFHE@e8�t7��E�N�N�j�F�M�A��AA�S8���E�Q0�AX�
9��{F�B�O �E(�A0�A8�G���B�K�A�c8A0A(B BBB @):��)E�Q@ATd.;��$B�E�B �D(�C0�G@�HLPVHB@DHLPWHB@g0A(A BBBH��;��NF�F�A �A(�J�u�C�F�A��(A ABB\�]��cB�B�E �B(�A0�A8�G�q�Y�T�B��
8A0A(B BBBA$zRx��������4,t<���
:�S�P�A�x�D�Y�B�X��I��RF�B�B �B(�N0�A8�G�Z�E�I�A��8A0A(B BBB0$�N���F�K�A �J�� AAB0X(O���F�K�A �J�� AAB8��O���E�D�M�1�C�F�A�{AA8��P���B�L�G �D(�E0�p(A BBB0OQ���F�K�A �D@� AAB08|z���F�K�A �J��
 AABAzRx�����$�R��H��R���B�B�B �B(�A0�A8�D�x8A0A(B BBB0��T��E�A�H��Q
G��AA\ �U��hF�B�B �A(�A0�H��Q
G�����F��Q��D��C0A(A BBBL�z���F�I�A �A(�P�y�H�W�A�?
(A ABBA zRx������(dV��;(L[���E�M�D �DAzRx� �� CX��GNU�0���hY!UfvX=
��XY!`Y!���o`��
D	p[!p�1�h	���o���o���o�o����o�pY!�=�=�=�=�=�=�=>> >0>@>P>`>p>�>�>�>�>�>�>�>�>?? ?0?@?P?`?p?�?�?�?�?�?�?�?�?@@ @0@@@P@`@p@�@�@�@�@�@�@�@�@AA A0A@APA`ApA�A�A�A�A�A�A�A�ABB B0B@BPB`BpB�B�B�B�B�B�B�B�BCC C0C@CPC`CpC�C�C�C�C�C�C�C�CDD D0D@DPD`DpD�D�D�D�D�D�D�D�DEE E��������6e�����B��(��@��'����'���'t�c�`&�=_�%�0_ %���k�$�Kl�#���e�"2�3j�!1���  ����G���@��ˇ����~�;�z��������^@�*M�(��]�3��R�$��g�>�lg ��Յ@���@	6���w��z �G�2�Y�i�o����R��T�vv@?��a�`>��|��=��c@=��b==�/a <�;`@;���_�:�h^:��S_@9��ߦ8���\�6��xS 6��5\�4��S@4���[`3��[�2w�(Z@2P�Y�1���p 1p�?n�0��`R�/��	R�.��P`.V�'P�-��O`-J�O`+=�|N�)j!��?���������d!�2�i����������:�W�����
��2�i���0@�kk� `!�c!`d!�@���GA$3a1X=��_socket.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug�R��7zXZ�ִF!t/���c]?�E�h=��ڊ�2N�a ���Rf���_|�`���j�H���e.oN�]0qw|����$�0;
G��.�h!�Q��>x-��ᒼ�jv�A�♛���q�>�3����L��%��P���_�6�c �rw�~�E�2�n��##YP�D��Ug��h�O�+~��h٭�(����vҠ��}ˮ�+��T�2l�{����p�\���#ۤ�����Z�M�S����!�~�>�}+A�Gj����	��{��-�@�1z�@�bKe���4/��H�[�V�X�tG�~��d'�c
w�ꡲ�Z�8���3��}"J�O&�1���mQ��@��R΄T�M�ho��76ܺ
�_�␱���r珽�9k~X�L;�Cm�Q�<���1\&�;<����+�ӏ�UI��)�(���P>�"8ڔiu���
VD�
ک���L������84�˛e�9���="�r�#%�8ne��%��!Wm1y9ڐ�W("�_ӯW,�܅:�^)�Z
Kn��c�1��`^�𪊹�N{eY�Ķ��~��O���<�>.=ٵ�X�`�Z����<��W�gXu�I���%���~xja/E��/wuY���ba�b��T�����Eʻ�`uPt���΅����
�<w�(5�1�׾����v|�&����Dr�s��
]���.�Ƥ/�!o�!
L��Xd��������'��q<q��ך����o�9W1
X&}'��8�<f��bQz�{��n �B񿬇� �1��Ցba0H��`qj���')���+i��F��r��Æ�TMVݻkN�k�u�x6��p��P��N��P]!"a�
���Ħ�"��̟�P��_x,��Y^�?�6i������8���Ie}Ik���b(�n!K�N}
r�&⹰#��@O���v�$Y�2^�d�2��i��e��=p�"��E`Ia�,�hK����H�2�ZN���f��4<�oLJ�08:�@�����ǭ;��V���`c��C�L�US�&ь�� ۓ٠������g��X6��q���}N�֮�(�\c�W�l�����$RnK���\�L|gHY��%�k6�l�o����z!����@��ggg�2��S��ձ��r�a�?��w�0�E���R�����L�6�	�_Ձ3��|���"�� �B��$� �A��Ln辧`���!���ԀI}z�i���S��`ߣMQ8+��e��݁$��/#��9u�]%ٹ@C�������o��L#�fYN�s��b*�F����o��3��I*tY�����ZDtS5m`|���y;�W��i9*���z
�ROM:u2�^��B�#�XWQZ�8�`����!i�&�j�����!��x�gr`핍���i�fs��'<�K�5��U���>@=5�.(���
�6.%
<��H;i���`�k"��0t��^��٤�:ז�t�ik%�:�oA��w��(���[ �[�����-mE����R�yA����1�kN�Z�i�+�I�D��)LJIx����%��gM�0jN��ݩ\�y�u�Y^�֥���?c�̮�!s�p���Ÿ`{��l8��T
��z�1�|�n���7����,�e������P�L)�Va�}��]9�(F8\2&�z&ۑk���)�|�-w[c��A�l��G#���uB��ȃ�l��'�8�2��wNk*0�BO�z�kA+�j/�H�!y�N$�����G�Eu����z���v�\fΤ|�p�U=�Cp�f�Ar����V���Ġ|�����1�
�[��(���r��4��������	V���<1�Y[$?�_��Q�����=*F���g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(���
0��D	8���o��*E���o�T��h^B�1�1phX=X=c�=�=�n0E0E�w�L�L�}����
���m �@@l��C�Cd��W�W �XY!XY�`Y!`Y�hY!hY�pY!pY�p[!p[��`!`� ��k!�k ��ka�k$
�k`$l��s(lib-dynload/pyexpat.cpython-38-x86_64-linux-gnu.so000075500000213620151153537520015610 0ustar00ELF>p?@P@8	@���� ���� �� � �� � 888$$������  S�td������  P�td��������Q�tdR�td���� �� PPGNUS�D����Dڨi��������@ ���|CE��l��C�qX��Bz�I\X�0� �kC�;�����Q����0W�
' �	�\x�	yc, ?��	F"'�7M	����c	{��K/	%o0�	~N�m�	>�.���4��	S��
$Q����6$w!�	E_Y����@evm�����i����.
�!
�!4��"
�!__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libexpat.so.1libpthread.so.0libc.so.6_Py_NoneStructPyLong_FromLongXML_GetErrorCodeXML_GetCurrentColumnNumberXML_GetCurrentLineNumberPyFloat_TypePyExc_TypeErrorPyErr_SetStringPyType_IsSubtypePyLong_AsLongXML_ErrorStringPy_BuildValuePyErr_OccurredPyBool_FromLongPyExc_RuntimeErrorPyObject_IsTrueXML_SetReturnNSTripletXML_GetCurrentByteIndex_PyLong_AsIntXML_SetParamEntityParsingXML_GetBasePyObject_GC_UnTrackXML_ParserFree_Py_DeallocPyMem_FreePyObject_GC_DelPyUnicode_DecodePyExc_ValueError_PyUnicode_Ready_PyArg_CheckPositionalPyUnicode_AsUTF8AndSize_PyArg_BadArgument_PyObject_GC_NewXML_ExternalEntityParserCreatePyObject_GC_TrackPyMem_MallocXML_SetUserDataPyErr_NoMemory__stack_chk_failXML_GetInputContextPyBytes_FromStringAndSizeXML_SetBasestrlenPyDict_NewXML_ParserCreate_MM_Py_HashSecretXML_SetHashSaltXML_SetUnknownEncodingHandler_PyArg_UnpackKeywordsPyUnicode_DecodeUTF8PyEval_CallObjectWithKeywords_PyTraceback_AddXML_StopParserPyTuple_NewPyDict_GetItemWithErrorPyDict_SetItemXML_SetExternalEntityRefHandlerXML_SetCharacterDataHandler__sprintf_chkmemcpyXML_FreeContentModelPyUnicode_FromFormatPyObject_CallFunctionObjArgsPyObject_SetAttrStringPyErr_SetObjectXML_UseForeignDTDXML_SetEncodingXML_ParsePyObject_GetBufferPyBuffer_ReleaseXML_GetSpecifiedAttributeCountPyList_New_PyObject_LookupAttrIdXML_ParseBufferXML_GetBufferPyObject_CallFunctionPyByteArray_Type_PyByteArray_empty_stringPyErr_FormatPyInit_pyexpatPyUnicode_FromStringPyType_ReadyPyDescr_NewGetSetPyModule_Create2PyErr_NewExceptionPyModule_AddObjectXML_ExpatVersionPyModule_AddStringConstantXML_ExpatVersionInfoPyModule_GetDictPyModule_New_PyImport_SetModuleXML_GetFeatureListPyList_AppendPyDict_SetItemStringPyModule_AddIntConstantXML_SetCommentHandlerXML_SetElementHandlerXML_SetProcessingInstructionHandlerXML_SetDefaultHandlerExpandXML_SetNamespaceDeclHandlerXML_SetStartDoctypeDeclHandlerPyCapsule_NewPyErr_ClearPyObject_MallocPyObject_ReallocPyObject_FreeXML_SetStartElementHandlerXML_SetEndElementHandlerXML_SetUnparsedEntityDeclHandlerXML_SetNotationDeclHandlerXML_SetStartNamespaceDeclHandlerXML_SetEndNamespaceDeclHandlerXML_SetStartCdataSectionHandlerXML_SetEndCdataSectionHandlerXML_SetDefaultHandlerXML_SetNotStandaloneHandlerXML_SetEndDoctypeDeclHandlerXML_SetEntityDeclHandlerXML_SetXmlDeclHandlerXML_SetElementDeclHandlerXML_SetAttlistDeclHandlerXML_SetSkippedEntityHandler_edata__bss_start_endGLIBC_2.14GLIBC_2.3.4GLIBC_2.4GLIBC_2.2.5����3
ti	>
ii
J
ui	T
�� P��� ��� �� �� ���� s��� ��� ��� `�� �� � W�(� �b8� ��@� �H� _EX� @�`� a�h� �Ax� ��� i��� �D�� ��� ���� :B��  ��� y��� 
A�� ���� ���� �\�� `� � ���� ���� �?�� ���� |�� ����  |�� ¿� A � ѿ(� @lH� �P�  lp� ��x� �@�� ��� �?�� �K�� ��� q@�� �~��  ��� �?� ,�� d@ � �@8� ?�@� W@H� `l`� R�h� J@p�  }�� ���� @w�� ���� g��� �?�� `�H� ��P� `�`� �� �� ���� �� �� ��� ��0� �l�� H��� �k�� �I� � �  � �� �� �� ��� ��� ��� `�@� �P� ���� ��� `�� ��� %Z� �� tS@� ,�P� 0��� F���  ��� ^�� ��� m�� �R@� ��P� R�� ���� /Q�� )�� @�� ��� ~P@� ��P� tO�� ��� ^N�� �� �M� �� �X@� �P� �W�� ��� �V�� *�� jU� =�� �T�� � � � 
�  � (� 0� 8� @� H� #P� &X� '�� '`� )� )h� /p� 3x� 5�� ?�� B�� F� F�� KH� K�� N�� S�� Z�� \�� _�� `�� j�� u�� u�� ~�� G�� p�� ^� i� � {� QH� 1�� O� (H� D�� 9� >H� +� 4� WH� ,�� M� g� H(� 0� 8� @� H� P� X� 	`� 
h� p� x� �� �� �� �� �� �� �� �� �� �� �� �� �� ��  �� !�� "� #� $� %� * � +(� -0� .8� 0@� 2H� 5P� 6X� 7`� 8h� :p� ;x� <�� =�� @�� A�� B�� C�� E�� I�� J�� L�� N�� P�� R�� T�� U�� V�� X� Y� Z� [� ] � `(� a0� b8� c@� dH� eP� fX� h`� jh� kp� lx� m�� n�� o�� q�� r�� s�� t�� u�� v�� w�� x�� y�� z�� |�� }�� ~��H��H�� H��t��H����5� �%� ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&�������h'��q������h(��a������h)��Q������h*��A������h+��1������h,��!������h-��������h.��������h/������h0�������h1��������h2�������h3�������h4�������h5�������h6�������h7��q������h8��a������h9��Q������h:��A������h;��1������h<��!������h=��������h>��������h?������h@�������hA��������hB�������hC�������hD�������hE�������hF�������hG��q������hH��a������hI��Q������hJ��A������hK��1������hL��!������hM��������hN��������hO������hP�������hQ��������hR�������hS�������hT�������hU�������hV�������hW��q������hX��a������hY��Q�������%M� D���%E� D���%=� D���%5� D���%-� D���%%� D���%� D���%� D���%
� D���%� D���%�� D���%�� D���%� D���%� D���%ݱ D���%ձ D���%ͱ D���%ű D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%}� D���%u� D���%m� D���%e� D���%]� D���%U� D���%M� D���%E� D���%=� D���%5� D���%-� D���%%� D���%� D���%� D���%
� D���%� D���%�� D���%�� D���%� D���%� D���%ݰ D���%հ D���%Ͱ D���%Ű D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%}� D���%u� D���%m� D���%e� D���%]� D���%U� D���%M� D���%E� D���%=� D���%5� D���%-� D���%%� D���%� D���%� D���%
� D���%� D���%�� D���%�� D���%� D���%� D���%ݯ D���%կ D���%ͯ D���%ů D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D��1�������H�9� H�W@H)�H��Hc�H��H��uH�� H����Hc4������Hc0�����PH��/���Z�������SH��H�~H�5�� H9�uH�0� H�5�tH�8�Y����=�����u�H���F���H��H���t�����H�=_x[H��1�����o���H��t�1�[���Hc�)�����Hc������Hc$������H�(@��@�������SH��uH�� H�5�wH�8������"H��H���9�������x�C$H�{�����1҉�[�H��� H�5�wH�8�x������+��PH��r���ZH���y���������UH��SH��APH�~H�5J� H9�uH��� H�5GsH�8�����8�H�����u�H������Ã��tH�}���
���Y[Hc�]�����:���H��t�Z1�[]���PH�����H�=�vZH��1��O���H�U@H���z+H�=
� �\+�+H���������+H�m��.H������1��m.��c.L�E0����.����+E1҃�C�����D�B�I��I��u���-L�EH���AUI��ATUH��SH��H��dH�%(H�D$1�H�B�H��wI�MH;
2� u'���H��H�=!v�J�����u��H�Q���tJH��H�����I��H����H��1�L���H��H��H��H;4$t=H�-$� H�5�uH�}�l����UH��uH�5�u1�H�=�u�>����E1�H��~eI�ML�AA���u!H��uH�5�uH�=lu����1��{H��H�����I��H��t�H��1�L���I��I��I��L;$t�Y���E1�H�=r� ����H��H��t�D�U0D�]�@4�U�u$H�@(D�P0H�}�PL��p$L��D�X�@ �T���L�e8H�C@H�CL�c8M��tI�$H������H�}(tHc{0���H�C(H��tJH�{H��tAH��L�%�� ����L��E1�H��@H�x�tA����Ic�H�����L�
e� H�C@H��uH�uH���?����:���H���RI��@I�y�t
H�H����E1�I�<$t0L�E@K�(H��tH�{@H�J�/I�t$H�{A�T$I��@I����H�T$dH3%(H��t�;���H��[]A\A]���H��dH�%(H�D$1�� t-H�H�T$H������H��tHc<$�t$)�H�Hc��7����
H�f� H�H�L$dH3%(t����H�����SH��H��dH�%(H�D$1�H�F���uH�5|sH�fsH�=ws���1��oH��H��H�����H��H��tYH��1�H���H��H��H��H;$tL�+� H�5�rI�8�t���1��%H�{������u
��H���H�5�� H���H�T$dH3%(H��t��H��[�1���2H�?� H�5sH�8����I�,$t/E1��2H�
� H�5�rH�9���I�,$��A�L��E1������2I��H��1�L��I�_�H��H��H����H9���H����3H�S��� �H�=� �x���I��H���Sf��H�X8E1�HH�@(H�@0 H�@@�3M��E1�I���K3I�_�L��I�_I��E1��q���E1��+3L�
�� H�5oqI�9���E1��1L��H�mqE1�H�5�qH�=7q������1I��H�-� �L2E1���2��H�+A���1H������1H�-6� H�5�pH�}�~���E1��|1H��H��pH�5�lE1�H�=�p�F����W1I��RE1�L��� L��1�H��H�|$(WL��jj�i���H�� I��H���M��tYM�H�-R� M��tUE1�I9��z1�-1PL��E1�L�F� 1�1�H�t$(VH��jj����H�� I��H����I���E1�E1���1�91H�=D� ��I��H��t~f��f��E1�1�AT$I�D$(I�D$0 A\$8��1L�=(� H�5)pE1�I�?�N����O0E1��\1L�aI����I�,$uL���v��q�I���0E1��0L�-�� H�5�kE1�I�}���/E1���/AUATUSH��AS���H��tgH��E1�D;c}2Mc�L��H��H{����H��uH�Mu=H������3J�D�A���ȋSL�CI��1��3H�
�1AZH�=�o[]A\A]��Z1�[]A\A]���ATE1�UH�-�� SH��H�}t3H�C@L�H�8H��tH�H�u�u�H�{1�I���UH��@��H�{8H��tH�C8H�u�G�[1�]A\�H�+t1��c2H���[2H��1��!��L2H���D2H�ݤ H�5�mH�8����2H�muH�����H���2H�{H�5������3H���_2H�{H�5{������_3H�
�� H�s@1�H�H�HH�~H���C ��I��H��tD�C H�muH���a�I�<$1�L�G�M�$M���3L���B�1���2����2��2��USH��xdH�%(H�D$h1�H��uL�
أ H�5�lI�9����H�F���uL�U� H�5�iI�8�~����H��H���k�H��H��(��H��uH�=�� H�5{iH�?�C���HcS01�H9���H�����~9H��A�����d�H�
aiH���!�H�
�� H��H�9�����FH�{(t�{4uH�{(����H���*2��y��H���\�H�C(H��u
������k01�H�L$hdH3%(t�O�H��x[]�H��� H�5�k��H�:�o��T2�����G21��@2H���72H���1��xH�{(�(�H�C(�2���
2��L��H��[]A\�r0H���j1���T2H�s@H�~�E2;k0~��L��H���A0�C4�'2Hc{4Hc�H{(L���r�k4�2��H�G@H�����ATUSH�����H����H����0��x{H�=�k1���H��H��uH��[]A\�Q/H�S@L�CH�����C H�=gkH����-�C H�MI��uH���o�M��t�I�$u[L��]A\�X�[]A\����H�G@H�xx�AWI��AVI��AUI��ATUD��SH��AQ��H����H���0����L�c8L��L���-L��L��I���y-L��L��I���k-A��L��L��H��H�=�j1���H��H��uYH��[]A\A]A^A_�F.H�S@L�CH�����C H�=rjH�Rx�,�C H�MI��uH���g�M��t�I�MuZL��[]A\A]A^A_�I�X[]A\A]A^A_����AWAVAUATUSAQH�H�C@H�xpt~M��I��I��H���
�H��uhH���/��x\L�c8L��L���},L��L��I���o,L��L��I���a,M��M��H��H��H�5~+H�=�i1����I��H��uH���@-1��\H�S@L�CH�����C H�=�iH�Rp�u+�C I�MH��uL���]�H��t�H����H�M��uH���@�Z��[]A\A]A^A_���ATUSH�G@H�xht7H����H��u*H���.��xH�=�h1��8�I��H��uH���,1��\H�S@L�CH�����C H�=�hH�Rh�*�C I�$H��uL����H��t�H���H�H�M��uH������[]A\���H�G@H�xX��ATI��U��SH���]�H����H���\-����M��uH�0� H��Hc�H��gL���A�H��H�=:h1��P�H��H��uH��[]A\�+H�S@L�CH����C H�=hH�RX��)�C H�MI��uH����M��t�I�$u[L��]A\��[]A\����H�G@H�xP��ATUSH����H����H���,��xxH�=6g1���H��H��uH��[]A\��*H�S@L�CH���{�C H�=[gH�RP�#)�C H�MI��uH����M��t�I�$u[L��]A\���[]A\����H�G@H�xH��ATUSH�����H����H����+��xxH�=�f1����H��H��uH��[]A\�8*H�S@L�CH���w�C H�=�fH�RH�q(�C H�MI��uH���Y�M��t�I�$u[L��]A\�B�[]A\����H�G@H�x(�AWM��AVI��AUI��ATI��USH��AQ�	�H����H���+����H�k8L��H���q(L��H��I���c(L��H��I���U(H��L��I���G(M��L��L��H��H�=�e1����H��H��uYH��[]A\A]A^A_�")H�S@L�CH���c�C H�=�eH�R(�['�C H�MI��uH���C�M��t�I�$uZL��[]A\A]A^A_�%�X[]A\A]A^A_����H�G@H�����ATI��U��SH�����H����H����)����H�{8L���\'��H�=(eH��1���H��H��uH��[]A\�E(H�S@L�CH���X�C H�=�dH����{&�C H�MI��uH���c�M��t�I�$u[L��]A\�L�[]A\����H�G@H����AWI��AVI��AUE��ATM��USH��H��H�L$�	�H����H���)����H�k8L��H���q&L��H��I���c&AUL��L�
�%ATL�D$H��L��H�=)d1����I��XZM��uH��H��[]A\A]A^A_�,'H�S@L�CL��P�C H�=�cH����b%�C I�MI��uL���J�M��t�I�$uH��L��[]A\A]A^A_�)�H��[]A\A]A^A_����AUATI��USH��QH�G@H�����I�����H����H����'����L����H��H��u
H���]&�H�{8L���<%H��uH�Mu�H������H��H��H�=7c1����I��H��t�H�S@L�CH���7�C H�=�bH����Q$�C H��u
H����%�
H�uH���.�I�MuL��� �H�{L��Z[]A\A]��X[]A\A]���H�G@H�����AUA��ATI��UH��SH��AP���H����H����&����H�
v#E��M��H��H��H�=;b1����I��H��uYH��[]A\A]�%%H�S@L�CH�����C H�=bH����[#�C I�MI��uL���C�M��t�I�$uZL��[]A\A]�)�X[]A\A]����AWAVAUATUSH��(H�G@L�|$`L�l$hH���L�t$p�SL�L$I��H��D�D$�T$H�t$���H���,H����%���H�k8L��H���7#L��H��I���)#L��H��I���#H�t$H��I���#H�D$M��u
L�%b� I�$�Hct$L��H�	`�p�I��H�t$H����"AVM��L��AU�T$(H��H�=�`L�D$1��\�H��XZH��uH��(H��[]A\A]A^A_�#H�S@L�CH����C H�=�`H�����!�C H�MI��uH����M��t�I�uH��(L��[]A\A]A^A_��H��([]A\A]A^A_���H�G@H�x �2AWM��AVM��AUI��ATI��USH��H��H�t$�Q�H����H���P$����H�k8L��H���!L��H��I���!L��H��I���!L��H��I���!H�t$H��I���!M��M��L��H��L��H�=�_1���H��H��uH��H��[]A\A]A^A_�T"H�S@L�CH�����C H�=N_H�R � �C H�MI��uH���u�M��t�I�uH��L��[]A\A]A^A_�U�H��[]A\A]A^A_��L�� H�5]I�:������$A�|$ H�5��u1�I�|$@Hc�L��I�9I�H���'%�7%���p$L�����H���o&Hc���H��H����H��H�5�^H���3�����H�muH����Ic��c�H��H��tkH��H�5h^H������tkH�muH���e�Ic��-�H��H��t5H��H�59^H�������t5H�muH���/�H�=� H�����H�+��%H�����%H�mu�H��������ATI��UH��SH��H��wH�� �-1ҹH��H�=�]������u�1��FI�<$������y��1�H�}��@���'����tH�}[��]A\��#H�u� H���[]A\�L�L$I��I���H�T$H����&H�{1ɺL�������u�E1��&��L��H�="]�D������I��L�e��H�uH�~H�5�� H9�tu������ulH�}���Ń��u
����H��uh��M�D$A�����%H�t$L��H�D$�+��I��H����%H�{H�5�\����H�T$�%H�=� H�57VH�?��1��!%1��[L��]A\�H��H��[]A\��I���d'H�mtE1��U'H��E1�����E'I���='�sH�5�VH�=\���H�{1��*���C H�muH������H��[]A\�hI�,$��(�e(L���@+A��Ic�I�<�u�{�n�#�I��M���3E���.*�(H���I�muL���b��H�$L�L�D$I��L���)H��H��([]A\A]A^A_�3��L����I�/tI�m�q)L����H���*L�������H�4$H��L��H�L$�r����H�D$uAH�$L�
L�L$I��L�
tlH�(�*H�������	*H���UI�m��(�H��H�D$�;H�,$L�t$L�eL�d$I��L�etAI�.�M���L���m���@���H��H�D$�[��H�D$�H��(H��[]A\A]A^A_��H��L�t$�1��L�t$��e��I�����L��I���,L��M���,[L��]A\A]A^���I��L��E1��,I���,I���-H��[]A\A]A^�iI�,$I��u�L��E1�����\,H�mtE1���,I����,H��E1������,H�mtE1��.H��E1��n���.H�-Z� H�{8H�EH��t,H�����I��H��u$��-I���q.XH��[]A\A]��I���Z.��.[L��]A\���H�mtE1���0I����0H��E1�������0H��[]A\�|H�-͍ H�{8H�EH��tH���/��I��H��u
�/I���0�50H�5�� H�=�W1�H�����I��H��tUH�K@�C 1�H��H�y`�{��I��H����1�C I�muL���I��I�,$��1XL��[]A\A]�/��ZH��[]A\A]���AVAUATUH��H��H�5� SH�� dH�%(H�D$1�H�T$H�D$�������H�D$L�-	WH��uxL�
8� H�5�RH�D$I�9�\��H�D$�L��L���H�uH�����E���'A��H�}D��A��������i��H������E���H�}�����H�|$H��I��u"H��t
H�u�%��� ��H������L��1�����H��H����H�xH�p ���uKH�5o� H9�uH�{u4H�5ԋ �/�����u�H�SH�
.� H�5R1�H�RH�9����5H�s(L�cI�����L�ۊ L��1�H�5RI�8�Z��H�uH���]��H�|$H�u�H�|$H��t
H�u�=��1��LH�|$H��t
H�u�%��� ��H��uޅ�uH�}�^��H�}���c�H���	��x�Hc����H�L$dH3%(t�H��H�� []A\A]A^�I�,$��1��NL���$����$��KH���$����$�KL���$����$�JH�׉$�u���$��JL���$�b���$�-JL�߉$�O���$�JL���$�<���$�`IL�ω$�)���$�CIL���$����$�H�$����$�yHL���$�����$��GH�ω$�����$�GL���$�����$�FH�׉$����$��FL���$����$�/FL�׉$����$�FL���$����$�bEL�lj$�n���$�EEL���$�[���$�DH���$�H���$�xDL���$�5���$��CH�׉$�"���$�CL���$����$�BL�߉$����$��BL���$�����$�.BL�ω$�����$�BL���$�����$�aA�$����$�GAL���$����$�@H�ω$����$�z@L���$�z���$��?H�׉$�g���$�?L���$�T���$�>L�׉$�A���$��>L���$�.���$�0>L�lj$����$�>L���$����$�c=H���$����$�F=L���$�����$�<H�׉$�����$�y<L���$����$��;L�߉$����$�;L���$����$�:L�ω$����$��:L���$�p���$�/:�$�`���$�:L���$�M���$�e9H�ω$�:���$�H9L���$�'���$�8H�׉$����$�{8L���$����$��7L�׉$�����$�7L���$�����$�6L�lj$�����$��6L���$����$�16H���$����$�6L���$����$�d5H�׉$�|���$�G5L���$�i���$�4L�߉$�V���$�z4L���$�C���$��3L�ω$�0���$�3L���$����$�2�$�
���$��2L���$����$�32H�ω$�����$�2L���$�����$�f1H�׉$����$�I1L���$����$�0L�׉$����$�|0L���$����$��/L�lj$�u���$�/L���$�b���$�.H���$�O���$��.M��tI�.tAM���s���I�,$�h���L��1������HL���D$�
���t$��y:�P����-L�������H�$H�H�D$H��H���-H�������-A��Ic�Lk�M�A�8�--�-����-I�.tH�+����H��1�����SHL���}���,L���p���H,H�+�����H��1��W��� HI�,$uL���C��H��@H�M�H���*�*I�,$�b���L�������GL��1������GfD��H�=� tZAVL�5�� AUI��ATI��UH��S1��fDH��I�<�t"H�E@H�<H��t�L��A�ԅ�u
H��I�<�u�1�[]A\A]A^�1��D��PH��R��ZH���I��f���PH��b��ZH���)��f���SH���d��H��H���w�����g���C1�[����ATUH��S�0��H�}H����������H�U@H�EH��teH�=�� tK1�L�%� ��H��I�<�t-H�H�8H��t�H�H�/u����H��H�U@I�<�u�H���0��H�E@H�}(H��t
���H�E(H�}8H��tH�/u�^��[H��]A\�B��f���UH��SH��H���;��H����=� �wH��H�
K�H�=�� ���H��H�����x ���H�EH�}H�p����U ������� �M����@���L�EH�������2	fDo�\E1�f��Go$fEo�I�R�Go|fEo��Cot fAo��GoL0fAo�fDi�fAo�fa�fEv�fa�fDv�fDi�fo�fEo�fAo�fa�fE��fDa�fi�FdSfD��fv�fEo�fAv�fAo�fEo�F,SfDv�fv�I�J �Gol@fEv�f��fDi�fD�fEo�fAo�SfDi�fAo�D|SfD��f��I�z0fE��DKfDa�fAv�fEo�tKfAv�D${fEv��ColP�GoD`�GodpM�J@fAo�fD��fo�fAo�fD��fAo�fAo�DL{fE�FlKfa�fi�fa�fDi�fa�F<KfDi�fEo�fEo�fEo�fEo�M�ZPfv�fv�I�B`fDv�fEv�I�RpI��fDv�fEv�f��f��fD��fE��B[fD��fE��Bl[DCDDCD,SDdSI����HǃfE��D�H�uH������H���]���H��[]�H�uH��uH���@��H��~ H�5*DH�;����H��1�[]�1���I��H9�sL��M9����Aof��f�fo�fh�f`�fo�fi�fo�fa�fi�S0fa�[#k �Aopfo�fh�f`�fDo�fi�fDo�fDa�fi�spfDa�{PDK`DC@�EoP fEo�fDh�fD`�fEo�fDi�fEo�fDa�fDi�D��fDa�D��D��D���Eop0fEo�fDh�fD`�fAo�fDi�fAo�fa�fDi�D��fa�D�������Aoh@fo�fh�f`�fo�fi�fo�fa�fi��0fa���� �Eo@PfEo�fDh�fD`�fEo�fDi�fEo�fDa�fDi�D�pfDa�D�PD�@D�`�Eo``fEo�fDh�fD`�fEo�fDi�fEo�fDa�fDi�fDa�D��D��D��D���AoPpfo�fh�f`�fo�fi�fo�fa�fi���fa��������Ao��fDo�fh�fD`�fDo�fi�fAo�fDa�fDi��0fa�D��D� �Eo��fEo�fDh�fD`�fEo�fDi�fEo�fDa�fDi�D�pfDa�D�PD�`D�@�Eo��fEo�fDh�fD`�fAo�fDi�fAo�fa�fDi�D��fa�D�������Ao��fo�fh�f`�fDo�fi�fo�fDa�fi���fa�����D���Eo��fEo�fDh�fD`�fEo�fDi�fAo�fDa�fDi�D�0fa�D��D� �Eo��fEo�fDh�fD`�fEo�fDi�fEo�fDa�fDi�D�pfDa�D�PD�@D�`�Ao��fo�fh�f`�fo�fi�fo�fa�fi���fa��������Ao��fDo�fh�fD`�fDo�fo�fEo�fDa�fDi�fDa�fi�D��D��D�������E1�G�F��C�DB�D�C�TB�T�C�LB�L�C�|B�|�G�LF�L�G�\F�\�C�DB�D�I��I��u��$���fo�Sfo
�SH��H�
�Bfo�Sfo�S�H�=h� fo%�Sfo-�S)Q� fo5�S)
R� fo=�SfDo�S)J� fDo
�SfDo�S)A� fDo�SfDo%�S)%8� fDo-�SfDo5�S)-/� fDo=�S)5/� )=8� D)@� D)
H� D)P� D)X� D)%`� D)-h� D)5p� D)=x� ���H��H���f����x ��������������AWI��AVI��AUATUSH��H��HdH�%(H�D$81�H������H������H������H�����H���	��L�M������H�-�w I9���H��I���U��H�~H���j��H9��K��H�G������H�t$�M��I��H������H������H;D$����H���}��L�����H���!���
��H��H�����H�=�| ���I��H���S��f�H�X8H��@H�@(H�@0 H�@@H����L��H�5~ 1��h���I�D$H������H��v H��H�r���I�|$L���J��I�|$1�H�5������H�=�} ��L�~ A�E1�f�I��@A��I�x�u�Mc�J�<�����I�D$@H������H�=�} L��} tf�I�;H�I��@H��H��u�E��t
H�+��H�t$8dH34%(L����H��H[]A\A]A^A_�A�1��I��M�BA�������H�t$L�����I��H������H��1�L���H��H��H;L$�o��I���]��M��I�H���;��H9����L�_L�T$A�������H�t$����I��H������I��1�L��L���H��L�H;L$�{��I��H�\$�7��L��L���H��H��H������I�����H��H����H�=mz ����I��H����I�\$8f��A�I�D$(I�D$0 I�D$@Ad$H�L���@��L��H�5�{ L������I�D$H���:��H�51t H��H�v�M��I�|$L����I�|$1�H�52����H�=�{ ����L��{ ��������S�������]��ff.�@��H��tSH���N���H��H��=[H���;��H�t H��ff.�@AUA��H��ATI��H��1�UL��SAQ��H��H��tZH��[]A\A]�L��D��H�5J9����H�}1�������H��H����H��H���c�����H��H��O���H��H���C���ATI��USH����H��H���u���H��H��<H���c��H��H������I�<$H������H��蒾��H��H��u*����H������I�<$H��H���}����uUH��[]A\ÐH�H�+uH��H������H��[]A\�H����ff.�H��r H�?H�H����������_��ff.�@��SH���n��H��H��跽�����q���C1�[��ATI��U1�SH�`y �I�|$1�H���SH��@H�;t$I�D$@H�H�8H��t�H�H�/u�������I�|$[H�5���]A\�
���ff.�f�AUATUSH��H�G@H�x����H���A��I���D���H��H���}��M�����Ic�H�Y;L�����H������H�S@H�EH���C H�z1�臼��I��H��t2�C H�m����H���U���I�,$���1�H��[]A\A]úH�5�6H�=�:�E���H�{1��Z����C H�m�A��H�������4��ff.�H�w(H��t�G4��u�1��S��H������C4[����USH��H������H��H������Ņ����H�C(����H������Hc{0�̿��H�C(H�������C41�H����[]�ff.�f���ATI��U��SH���;���H��u8H�{(H������HcC4�S0�(9�����9�����H�Hc�L���a���k4[]A\�f���AUL�-�v ATUSH��L)�H��H��H������I��H����t]H;5�o ����H�W@Hc�H�H��H��H��H�9L�H�pH�)H����I�|$�P1�H��[]A\A]�ff.�@H�w(H��t�W4��uPH;-Ao ��M�D$@H�EH�5w I�xI�hH��uEI�|$��v H��1�[]A\A]�ff.�f�����A�D$4��y����f�Hc�ff.�f�H�/uH�t$���H�t$H��I�|$A�T1��,����z���AVAUATU��SH��莻��H��I���S�����I���ٻ��D��D��H�=79H��1�����H����H�=2� I��1�H��1��s���I�.H���L��H����Hc����H��H������H��H�5�8H��臻���������H�m�P��Ic�軻��H��H������H��H�5�8H���M����������H�m�L��Ic�聻��H��H������H��H�5�8H�������������H�m�H��H�=X� H�����H�+t[1�]A\A]A^��D��f.���AUI��ATUH��SH��H��xdH�%(H�D$h1�H�B�H������L�&H������H�VH�5�l H�zH9������ѹ�����t��H�}�����Ń�����I�L$�����H�t$L��H�D$�=���I��H����H�{H�5�7��H�T$H���3��H�{��L������H�|$A�����]���H��uhE����H�s(H��t�S4��u/Ic�����H�L$hdH3%(��H��x[]A\A]��H�������C4��y�ff.�f�1��ff.��1�H�t$L��������x�H�T$ L�l$H�T$H���e��H�{��L���3���A��H�|$�2���@H�|$膺��職��H��� ���1��:����H�{跶��H�{������ ����¸��f���H�G@H�x�9ATUH��SH���.���H����H�s(H��t�S4���!H����H��� ���H��H��4H������H��H������H�{8H������H���=���I��H����輶��H�����H�{8H��H���$������h��H��H�=�4�ͷ��H��H���9��H�S@�C H��H�z1��x���I��H����C H�m��H���B���I�,$�4[]A\�f�H�H�muUH������L��H�=641��L���H��H���������ff.�H������C4��x������L��H�=�31����H��H���k��H�K@�C 1�H��H�y誴��I��H��tP�C H�muH���|���I�,$�:������ff.��H�-Qi H�{8H�EH���r����-����H�5�.H�=>4�J���H�{1��_����C H�muH���	�������������f���H�G@H�x@��ATUH��SH���δ��H����H�s(H��t�S4��uuH��H�5k�H�=�31��ݵ��H��H��trH�S@�C H��H�z@1�茳��I��H���c���C H�muDH���Z���I�,$u*[L��]A\�G����H���H����C4���t���[]A\���J���Q��f���H�G@H�8�pAWAVAUATI��UH��SH��H��(���H���-H�s(H��t�S4���5D�sE���0H�{�o����SA�ƅ��	��Hc��ٶ��I��H���9��E���4H���{H��蓳��H� 1H��H��聶��I��H���-��H�{8H���0��L��谲��H��H�����/���H������H�{8L��L��藶��������L��L��H�=)2�=���I��H��tIL�k@�C 1�L��I�}���I��H����C I�.��L��跴��I�,$�H��([]A\A]A^A_�ff.�f�H�I�/�L���z���L��H��1�H�=�1観��I��H���e�����H�{8E1�H�|$Mc�K�4�L�L$���H�$H���i��A�GH�t$H�M��M���.L��H�t$L�T$����H�|$H��/H������H��H���c��H�t$D�[E�������~$M�UH�$$A�A��E9��#���H�|$�Y���ff.�f�H�����C4���������@L��H��H�=�01�蜲��I��H�������H�{@�C 1�L��H�?�H���I��H��t`�C I�.uL������I�,$�d�������ff.�L�=�d H�{8I�H��������+��H�
�d H������H�5L*H�=�/�ر��H�{1�����C I�.u
L��蘲���?���:����U��������H�G@H�x0�_AVAUATI��UH��SH���W���H���fH�s(H��t�S4���ZH����H���I���H��H��-H���7���H��H���c��H�{8H���^��H���f���I��H������H���-��H�{8H��H���M��������M���ZL���ԯ��L��H�^-H���²��I��H������H�{8H������H����I��H����p���H������H�{8L��L���ز��������H��L��H�=j.�~���I��H���Y��H�S@�C H��H�z01��)���I��H�����C I�m�L����I�,$��[]A\A]A^�ff.�@H�H�m�H��蹰��M���QL���Ȯ��L��H�R,H��趱��I��H������H�{8H���`��L��L�����I��H����I�I�,$uL���S���H��L��H�=m-1�����I��H���Z��H�K@�C 1�H��H�y0�*���I��H�����C I�muL�����I�,$����[]A\A]A^�@H������C4��������@M��t\L���ӭ��L��H�]+H�����I��H����H�{8H�������q��H�-qa H�{8H�EH���i������I��L�%Pa I�$뼺jH�5�&H�=w,�Y���H�{1��n����C I�mu
L�������:���5�����������H�G@H�x�MAUATI��UH��SH��H���լ��H���oH�s(H��t�S4����H���H���Ǭ��H��H�Q*H��赯��H��H�����H�{8H���=��H�����I��H����c���H������H�{8H��H���˯��������L��H���H��H�={+�j���I��H������H�S@�C L��H�z1�����I��H����C I�m��L���߭��I�,$u{H��L��[]A\A]�ƭ��L��L��H�y�1�H�=�*���I��H���h��H�K@�C 1�H��H�y薪��I��H�����C I�muL���d���I�,$t�H��[]A\A]�f�I�EH�m�z���H���8���L��L��1�H���H�=n*�]���I��H��������ff.��H�����C4��x��0�����H�5d$H�='*��H�{1������C I�muL��诬���s���<���i���ff.�@��H�G@H�x8��ATUH��SH���n���H����H�s(H��t�S4���H����H���`���H��H��'H���N���H��H�����H�{8H�����H���}���I��H�������H������H�{8H��H���d���������H��H�=�'�
���H��H������H�S@�C H��H�z81�踨��I��H�����C H�m��H��肫��I�,$��[]A\�f�I�$H�muBH���\���L��H�=u'1�苪��H��H���~����R��H���B��C4��x�����L��H�=;'1��Q���H��H�����H�K@�C 1�H��H�y8���I��H��t&�C H�muH���Ϊ��I�,$�L�������oH�5:"H�=(�Ʃ��H�{1��۪���C H�muH��腪����������Z�������H�G@H�x`��AUATA��UH��SH��H���E���H����H�s(H��t�S4����H���SIc�H��%H���-���H�=)&H��1��<���I��H������H�S@�C H��H�z`1����I��H��tW�C I�m�t��L��赩��I�,$��H��[]A\A]�ff.�@H�����C4��x��P�����H�5� H�=�&耨��H�{1�蕩���C I�muL���?���H�=Gb tNL�-Fb 1�M�e��fD1�H�{A�T�H��I�<�t#H�s@H�H�>H��t�H�H�/u������H�{H��H�5����[]A\A]�ݦ����"�����f���AWH�=A&AVAUATUSH��8肥��H������H�=/&I���j���I��H������H�=�_ ��������H�
sa H����H�c�H����H�$�~$H�-da H�$fo�$)$ff.��H�E�fo$H�MH��H�E H�=U_ )U���I��H���0��H�pH�==` �P���H�������ҥ��H��H������I�t$H�=` L���2������}��I�,$�T��H��@H�M�H���n�����H�=�] �ݧ��H��H���[H�=Iq u 1�1�H�=R%���H�0q H���,H� q H�5�$H��H��M���H�q H�5'%H��H��3���H�\^ H��H�5�$H�J^ ����� ���H�5�$H��H���n����ɥ��H�=�$��H�D$$�t$$1��T$,�T$(���H�5�$H��H���Ƣ��H�$H�5~$H��� ���H���X���I��H���\L��H�����H��H��u;�d���H��u1H�=�#�â��H��H��tH��L��� ���H��H�5�#H���N���I�m����L��L��舣��I��H��uF����H���^��H�=�#�f���I��H���F��H��L��M��輣��L��H�5w#H�����I�.�;��H�����M���������1�I���ߦ��H�$H������A�?t]M��E1�I�PI�pH�=�#1�谤��I��H���s��H�<$H�����I�.�5�����A��A��Mc�O�IO��E�E��u�H�$H�5:#H���<���触��I��蟦��I��M������H��������P���H�5#H��H���n���������蜤��I��H����������L��L��H���������������H���n���H������L��H��L��H�$��H�4$H�.���I�/�����������詣��H�5u"H��H���Ǡ�����o������I��H���Y����o���L��L��H���A������9����O���H���Ǡ��H�����H��L��L��H�$�L���L�$I�(�>��I�/�!�������������H�5�!H��H��� �����������N���I��H��������Ȣ��L��L��H��蚟���������訢��H��� ���H���w��H��L��L��H�$襤��L�$I�*�q��I�/�T�����E����[���H�5N!H��H���y������!���觢��I��H�������!���L��L��H���������������H���y���H������H��L��L��H�$���H�$H�*����I�/�����������贡��H�5� H��H���Ҟ�����z�������I��H���d����z���L��L��H���L������D����Z���H���Ҟ��H���)��H��L��L��H�$�W���H�$H�)����I�/������������
���H�51 H��H���+�����������Y���I��H��������Ӡ��L��L��H��襝���������賠��H���+���H������L��H��L��H�$谢��H�<$H�/�
��I�/�������P����f���H�5�H��H��脝�����,���負��I��H�������,���L��L��H����������������H��脝��H������H��L��L��H�$�	���L�$I�)�@��I�/�#���������迟��H�5H��H���ݜ�������������I��H���o���腟��L��L��H���W������O����e���H���ݜ��H���4��H��L��L��H�$�b���L�$I�+�s��I�/�V��������	����H�5�H��H���6����������	�d���I��H�������	�ޞ��L��L��H��谛���������	辞��H���6���H������H��L��L��H�$軠��H�$H�*����I�/�������[���
�q���H�5�H��H��菛�����7���
轞��I��H���!���
�7���L��L��H���	���������
����H��菛��H������L��H��L��H�$����H�4$H�.����I�/������������ʝ��H�5UH��H����������������I��H���z���萝��L��L��H���b������Z����p���H�����H���?��H��L��L��H�$�m���L�$I�(���I�/�������
����#���H�5�H��H���A�����������o���I��H����������L��L��H��軙����������ɜ��H���A���H������H��L��L��H�$�ƞ��L�$I�*�?��I�/�"�����f���
�|���H�5"H��H��蚙�����B���
�Ȝ��I��H���,���
�B���L��L��H������������
�"���H��蚙��H������H��L��L��H�$����H�$H�*�r��I�/�U����������՛��H�5�H��H������������!���I��H�������蛛��L��L��H���m������e����{���H����H���J��H��L��L��H�$�x���H�$H�)����I�/�����������.���H�5H��H���L�����������z���I��H���������L��L��H���Ɨ����������Ԛ��H���L���H������L��H��L��H�$�ќ��H�<$H�/����I�/�������q���臚��H�58H��H��襗�����M����Ӛ��I��H���7����M���L��L��H�������������-���H��襗��H�������H��L��L��H�$�*���L�$I�)���I�/��������������H�5�H��H��������������,���I��H��������覙��L��L��H���x������p����膙��H�����H���U���H��L��L��H�$胛��L�$I�+�A��I�/�$�����#�����9���H�5DH��H���W�����������腙��I��H���������L��L��H���ѕ����������ߘ��H���W���H�������H��L��L��H�$�ܚ��H�$H�*�t��I�/�W�����|����蒘��H�5�H��H��谕�����X�����ޘ��I��H���B�����X���L��L��H���*������"�����8���H��谕��H������L��H��L��H�$�5���H�4$H�.����I�/�������տ������H�5�H��H���	������������7���I��H��������豗��L��L��H��胔�����{����著��H���	���H���`���H��L��L��H�$莙��L�$I�(����I�/��������.�����D���H�5EH��H���b������
����萗��I��H������
���L��L��H���ܓ�����Ծ������H���b���H�������H��L��L��H�$���L�$I�*�
���I�/����������蝖��H�5�H��H��軓�����c�������I��H���M�����c���L��L��H���5������-�����C���H��軓��H������H��L��L��H�$�@���H�$H�*�@���I�/�#������������H�5RH��H���������������B���I��H��������輕��L��L��H��莒����������蜕��H������H���k���H��L��L��H�$虗��H�$H�)�s���I�/�V������9�����O���H�5xH��H���m����������蛕��I��H������������L��L��H��������߼������H���m���H���ļ��L��H��L��H�$��H�<$H�/�����I�/�������������訔��H�5�H��H���Ƒ�����n������I��H���X�����n���L��L��H���@������8�����N���H���Ƒ��H������H��L��L��H�$�K���L�$I�)�ܽ��I�/���������������H�5rH��H���������ǻ����M���I��H���������Ǔ��L��L��H��虐����������觓��H������H���v���H��L��L��H�$褕��L�$I�+����I�/�����D�����Z���H�5�H��H���x������ ����覓��I��H���
����� ���L��L��H��������������H���x���H���Ϻ��H��L��L��H�$���H�$H�*�B���I�/�%�����������賒��H�5CH��H���я�����y�������I��H���c�����y���L��L��H���K������C�����Y���H���я��H���(���L��H��L��H�$�V���H�4$H�.�u���I�/�X���������������H�5�H��H���*������ҹ����X���I��H���������ґ��L��L��H��褎����������貑��H���*���H�������H��L��L��H�$诓��L�$I�(�����I�/��������O�����e���H�5*H��H��胎�����+����豑��I��H��������+���L��L��H�����������������H��胎��H���ڸ��H��L��L��H�$����L�$I�*�۹��I�/�������������辐��H�5�H��H���܍�����������
���I��H���n����脐��L��L��H���V������N�����d���H���܍��H���3���H��L��L��H�$�a���H�$H�*����I�/��������� ����H�5H��H���5������ݷ��� �c���I��H���Ƿ��� �ݏ��L��L��H��诌���������� 轏��H���5���H�������H��L��L��H�$躑��H�$H�)�A���I�/�$������Z����!�p���H�5oH��H��莌�����6����!輏��I��H��� ����!�6���L��L��H�������������!����H��莌��H�����L��H��L��H�$����H�<$H�/�w���I�/�Z�����������"�Ɏ��H�5�H��H�������������"����I��H���y����"菎��L��L��H���a������Y����"�o���H�����H���>���H��L��L��H�$�l���L�$I�)�����I�/������������#�"���H�5MH��H���@���������#�n���I��H���ҵ���#���L��L��H��躊����������#�ȍ��H���@���H�������H��L��L��H�$�ŏ��L�$I�+�ݵ��I�/��������e����$�{���H�5�H��H��虊�����A����$�Ǎ��I��H���+����$�A���L��L��H�������������$�!���H��虊��H����H��L��L��H�$����H�$H�*����I�/����������%�Ԍ��H�5$H��H������������%� ���I��H��������%蚌��L��L��H���l������d����%�z���H����H���I���L��H��L��H�$�w���H�4$H�.�C���I�/�&���������H��H�5�
H���Q����������L��H�5�
H���Lj�����߳��L��H�5o
H��譈�����ų��H�-.���1�H���~
�= H�,$H�5�$)$�����H�5�H�������H�5�H����L��H��H�5�諈��L��H�5��lj��L��H�5�賉��L��H�5�蟉��L��H�5�苉��L��H�5��w���L��H�5��c���1�L��H�5��R���L��H�5��>���L��H�5��*���L��H�5�����fo%>1��~-4= �~5�< fDo,$L�-�H�5��~=@= L�5I= -�< H�=;T �D~= 5�< �D~
�< L�-T �D~�< =#< �D~�< %T �D~%B< D�< D
b< -�S D< D�< 5�S D%4< =�S D�S D
�S DT D
T D%T D-T L�5&T 虈��H��tH��H�5�H���R���H��8H��[]A\A]A^A_�鰷���V����Q����H�=S H�S H9�tH��; H��t	�����H�=�R H�5�R H)�H��H��H��?H�H�tH�m; H��t��fD�����=�R u+UH�=R; H��tH�=�5 �ه���d����}R ]������w�����H��H���integer argument expected, got floatmulti-byte encodings are not supportedargument 'namespace_separator'namespace_separator must be at most one character, omitted, or None/builddir/build/BUILD/Python-3.8.17/Modules/pyexpat.cbuffer_size must be an integerbuffer_size must be greater than zerobuffer_size must not be greater than %iargument must have 'read' attributeread() did not return a bytes object (type=%.400s)read() returned too much data: %i bytes requested, %zd returnedXML_ERROR_JUNK_AFTER_DOC_ELEMENTXML_ERROR_RECURSIVE_ENTITY_REFXML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REFXML_ERROR_UNCLOSED_CDATA_SECTIONXML_ERROR_EXTERNAL_ENTITY_HANDLINGXML_ERROR_ENTITY_DECLARED_IN_PEXML_ERROR_FEATURE_REQUIRES_XML_DTDXML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSINGConstants used to describe error conditions.XML_PARAM_ENTITY_PARSING_NEVERXML_PARAM_ENTITY_PARSING_UNLESS_STANDALONEXML_PARAM_ENTITY_PARSING_ALWAYSConstants used to interpret content model information.zCannot delete attributereplaceExternalEntityParserCreateembedded null characterstr or Noneargument 1strargument 2argumentSetBaseargument 'encoding'intern must be a dictionaryXML_ParserCreate failedstrict(iiO&N)CharacterData()EndDoctypeDecl(NNNi)StartDoctypeDecl(O&NNN)ExternalEntityRefNotStandalone(N)DefaultEndCdataSectionStartCdataSection(NNNN)NotationDeclNiSkippedEntity(NNO&O&i)AttlistDeclElementDecl(O&O&i)XmlDeclNiNNNNN(NNNNN)UnparsedEntityDecl%s: line %i, column %icodeoffsetlinenoUseForeignDTDutf-8ParseEndElement(O&)Comment(NN)StartElementStartNamespaceDecl(NO&)ProcessingInstructionEndNamespaceDeclDefaultHandlerExpandpyexpat.errorspyexpat.modelerrorXMLParserTypeEXPAT_VERSION(iii)version_infoUTF-8native_encodingxml.parsers.expat.ExpatErrorsifeaturesXML_ERROR_NO_MEMORYXML_ERROR_SYNTAXXML_ERROR_NO_ELEMENTSXML_ERROR_INVALID_TOKENXML_ERROR_UNCLOSED_TOKENXML_ERROR_PARTIAL_CHARXML_ERROR_TAG_MISMATCHXML_ERROR_DUPLICATE_ATTRIBUTEXML_ERROR_PARAM_ENTITY_REFXML_ERROR_UNDEFINED_ENTITYXML_ERROR_ASYNC_ENTITYXML_ERROR_BAD_CHAR_REFXML_ERROR_BINARY_ENTITY_REFXML_ERROR_MISPLACED_XML_PIXML_ERROR_UNKNOWN_ENCODINGXML_ERROR_INCORRECT_ENCODINGXML_ERROR_NOT_STANDALONEXML_ERROR_UNEXPECTED_STATEXML_ERROR_UNBOUND_PREFIXXML_ERROR_UNDECLARING_PREFIXXML_ERROR_INCOMPLETE_PEXML_ERROR_XML_DECLXML_ERROR_TEXT_DECLXML_ERROR_PUBLICIDXML_ERROR_SUSPENDEDXML_ERROR_NOT_SUSPENDEDXML_ERROR_ABORTEDXML_ERROR_FINISHEDXML_ERROR_SUSPEND_PE__doc__codesmessagesXML_CTYPE_EMPTYXML_CTYPE_ANYXML_CTYPE_MIXEDXML_CTYPE_NAMEXML_CTYPE_CHOICEXML_CTYPE_SEQXML_CQUANT_NONEXML_CQUANT_OPTXML_CQUANT_REPXML_CQUANT_PLUSpyexpat.expat_CAPI 1.1pyexpat.expat_CAPIParseFileGetBaseGetInputContextSetParamEntityParsinginternErrorCodeErrorLineNumberErrorColumnNumberErrorByteIndexCurrentLineNumberCurrentColumnNumberCurrentByteIndexbuffer_sizebuffer_textbuffer_usednamespace_prefixesordered_attributesspecified_attributesErrorStringnamespace_separatorpyexpatreadpyexpat.xmlparserStartElementHandlerEndElementHandlerProcessingInstructionHandlerCharacterDataHandlerUnparsedEntityDeclHandlerNotationDeclHandlerStartNamespaceDeclHandlerEndNamespaceDeclHandlerCommentHandlerStartCdataSectionHandlerEndCdataSectionHandlerDefaultHandlerNotStandaloneHandlerExternalEntityRefHandlerStartDoctypeDeclHandlerEndDoctypeDeclHandlerXmlDeclHandlerElementDeclHandlerAttlistDeclHandlerSkippedEntityHandlerUseForeignDTD($self, flag=True, /)
--

Allows the application to provide an artificial external subset if one is not specified as part of the document instance.

This readily allows the use of a 'default' document type controlled by the
application, while still getting the advantage of providing document type
information to the parser. 'flag' defaults to True if not provided.SetParamEntityParsing($self, flag, /)
--

Controls parsing of parameter entities (including the external DTD subset).

Possible flag values are XML_PARAM_ENTITY_PARSING_NEVER,
XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE and
XML_PARAM_ENTITY_PARSING_ALWAYS. Returns true if setting the flag
was successful.ExternalEntityParserCreate($self, context, encoding=<unrepresentable>,
                           /)
--

Create a parser for parsing an external entity based on the information passed to the ExternalEntityRefHandler.GetInputContext($self, /)
--

Return the untranslated text of the input that caused the current event.

If the event was generated by a large amount of text (such as a start tag
for an element with many attributes), not all of the text may be available.GetBase($self, /)
--

Return base URL string for the parser.SetBase($self, base, /)
--

Set the base URL for the parser.ParseFile($self, file, /)
--

Parse XML data from file-like object.Parse($self, data, isfinal=False, /)
--

Parse XML data.

`isfinal' should be true at end of input.XML parserErrorString($module, code, /)
--

Returns string error for given number.ParserCreate($module, /, encoding=None, namespace_separator=None,
             intern=<unrepresentable>)
--

Return a new XML parser object.Python wrapper for Expat parser.	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~��������������������������������������������������������������������������������������������������������������������������������������;�Ypi��� o���t��0�t��D�t��X�t���u���u���)u���u��<�u��P�u��d�u��x�u���"v���@v���Wv��]v�� �v��T�v���w�� �w��4@z��p�z����{�� �~���O����������
���d	Ҁ���	(����	����(
����H
�����
Ą�� ΅��h����`�������0Ĉ��|��
����X
���
����<���u���0����,������������T������ H�������x��� ���[�����P5������lp���������������l��������������\���xP���,p���D����\p������������	���x	@����	�����	����`���@���������h�����@�������p��H����@���zRx�$xf���FJw�?:*3$"Dl���\�q��p{q���lq��-<�����kP�I�E �D(�D0�z(A BBBA������Eq��
�>q��
7q��EJ|���EJ0����EJHq��qE�T
JMhVq��
|Oq��
�Hq��
�Aq���Cq��KE�E����(E�bzRx�� :q�� Dq��EJ8Cq��0L5q��tE�D�E L
ADEKCA�uq�� EQ(�l����F�A�D ��DBzRx� ���$1q�� 4�ܜ���	E�D�G �
AAAk
CAAzRx� �� �p��y8`Nq���F�E�A �D(�G@�(A ABB��s��oH f�t���E�G �AL���!F�E�E �B(�A0�A8�G�&
8A0A(B BBBA$zRx��������8,[t��C��X�E�B�I�r�W�E�B�I��\���1J�S�8�����PB�H�I �D(�B0N
(D ABBAH�
w���B�B�A �A(�E0b
(H ABBEA(C ABB(,Gw��qF�D�H �YCBX���HMp$���HM8�,����B�D�A �t
ABBY
ABD w��,�����(E�bw��(����cB�D�C �KHB84����B�B�A �A(�D0�
(A ABBAzRx�0����$�v��������(U�R(�6w��VE�A�D�IAA$�x���cE�A�D TCA�8x��e((����WF�D�C �FAB�]x��iI
ABEHt�x���X�A�A �w
�A�B�EN
�D�B�EAABA��̈�y��U�E�E �E(�A0�D8�E@l
8D�0A�(B� B�B�B�EK
8D�0A�(B� B�B�B�EA8A0A(B BBBA������DL�y��
F�B�B �B(�A0�A8�B@�8C0A(B BBB(�^z���F�A�A ��ABL��z���U�D�C �a
�A�B�EK
�D�B�EAABA���H	t{���U�A�A �w
�A�B�EK
�D�B�EAABA���H\	�{���U�A�A �w
�A�B�EK
�D�B�EAABA��̈�	@|��$U�E�E �E(�D0�A8�E@z
8D�0A�(B� B�B�B�EK
8D�0A�(B� B�B�B�EA8A0A(B BBBA������L4
�|���X�D�C �L
�A�B�EN
�D�B�EAABA�����
Z}��-X�E�E �E(�D0�A8�GPBXL`]XAPI
8D�0A�(B� B�B�B�EQ
8D�0A�(B� B�B�B�ED8A0A(B BBBA������H�}��F�B�D �A(�D0�
(A ABBEA(A ABBhh�~���X�E�D �D(�E0H
(D� A�B�B�EN
(D� A�B�B�EA(A ABBA������0���F�B�B �B(�A0�A8�D`�hHp^hA`I
8D0A(B BBBEP
8D0A(B BBBED8A0A(B BBB�\=���FU�E�E �E(�D0�A8�GP�
8D�0A�(B� B�B�B�EM
8D�0A�(B� B�B�B�ED8A0A(B BBBA������L�L���OF�I�A �A(�N@[
(A ABBPJ
(C ABBNzRx�@����$����[<l
���FB�B�B �A(�C0�-
(C BBBA zRx�0�����(j����4�
H����F�D�D �\
CBEOAB<�����F�E�A �D(�G�
(A ABBI zRx������(3���<�@���WU�A�D �
ABC,���A ���,����GA
�D�B�ED
�A�B�ED0����U�A�D ��
�D�B�LXABA���A ����ˁ��U}
�A�B�Edl�����T�B�B �B(�D0�D8�G`?
8A0A(B BBBN������A`������ zRx�`������L(t����v
8A�0A�(B� B�B�B�E�
8D�0A�(B� B�B�B�EdH\���}U�B�B �D(�D0�x
(A BBBP�
(A BBBE������A0�����<W����W
�(D� B�B�B�Eb
�(A� B�B�B�EX�4���aU�B�D �D(�G0
(D� A�B�B�Em
(A ABBC�����$�
P���mR
(D� A�B�B�E<t ��� U�A�D �
ABC����A ���,�U���vA
�D�B�Ek
�A�B�EX���U�B�D �D(�G0�
(A ABBP�(H� A�B�B�F0����8�?����h
(D� A�B�B�EA(D� A�B�B�@|����UF�B�B �A(�N0�DP/0A(A BBBH������F�I�B �B(�A0�A8�Dpy
8D0A(B BBBA zRx�p������()����GNU�P���� ��s���Uft�4
\��� �� ���o`��
`
� p�+��	���o���oH���o�o@���o~� 04@4P4`4p4�4�4�4�4�4�4�4�455 505@5P5`5p5�5�5�5�5�5�5�5�566 606@6P6`6p6�6�6�6�6�6�6�6�677 707@7P7`7p7�7�7�7�7�7�7�7�788 808@8P8`8p8�8�8�8�8�8�8�8�899 909@9P9`9p9�9�9�9�9�9��`����W��b���_E@�a��A�i��D���:B� �y�
A�����\�`���8���?��|�� |¿Aѿ@l� l���@��?�K�q@�~ ��?,�d@�@?�W@`lR�J@ }��@w���g��?`���`����������� ���� ����H�l@H��k�I�  � �� ������`�����`��%Z�tS,�0�F� �^���m��R��R��/Q)�@���~P��tO�^N��M��X��W��V*�jU=��TGA$3a14Y�GA$3a1\�i�pyexpat.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug,N��7zXZ�ִF!t/���|]?�E�h=��ڊ�2N�$ɛ����R+�Mp�s�A��w�^lf"��?���۝:��S�2
W�F�VQ��yw��!iֲ�2T1�g�&����8�B&�0�;)P�u>/�����^��
.m�)0i0k�u@Av"1��=���7���˻(no�kΣ���=�9���?��r�����,D�\�����|"�z���Q��ѱ�r#�L���Z*�I������m�Ľ��$x�$p��k�=���7u�@'$�hZ�32�s������	Ҽֽ���eaI�E�܇�M���!��Y2��|B'a�&)�цZ��ˌ�b�����`�=����;j2Ə.(qC�k�:_b�߷�`l,�,[��ፒ�����la�v�=�x	��v��i!ͩp��/��߈��HmfAB�=�x
�-��O86V"��S��Y�{SS��|V'������*�Z��s)ӫ�]���oi$W�
�6�ѡU��O*9d����I|�y8�_v�x&��v�3E�ĉ:?�ʆ*�˧��q-6R����1��g]w;e ނU�<��m���?�
\�w]b��YT�FU��u?9'گ��ZD�J����n��c��B\_�g��2h�����[����!�pcN/�j��LAԇA�g�;���ٟ-!��"������_�U���p>�ڟ�9_�9K`(F�-�ל�ݫ�֠�\��ч��k�gb���ˋJ�>N��dL��!�G�''�ۃ/4�9�y������{һ�*kx8"йۇ��늷d���y���*��:o<���f<�X�SD�m�E�����ې�� �dQr�D2k�v�H�A�+C��,PS�S��ֽ���w�\Pn��'�_��sBJ�kJz�@"M�&�D��-Qu8D^
s%�
rr�e�K{��u����V�o��V��rg��9�E��z�C}�TG}P�0�#�U�$͛����資Yf3t��tBX�c�`|�ԓ=�~]��1?ق�s�?Uiq��Q��30\θC�$��{XOQvV�/��z�`�2;�<#�$u��k
�+5{�VA}7�=u~txX�#�l\Ͳ�`�-��Q*��"'�u���|y��(m4��GB��y<%���2�߳&�������W@a�\t��L�-����b0���F�.�.��sqˮ�IPqBqk�B��ڼ��F��>r���L��|��3�P-�{���q���g�T�( /���mv�����|$�
�0�ʼ�`,���Q�=�&�|vR��l;�z��ýZ���	�!��W���z[��*��p�ġ74�Ɩ4	�{����6�>��H���W��%�z<���t�H�(]L�o[��|����cx�i�=Hxb�7B����!�3��2��g�nR��K��@���.2y�Z6�x0:�YCj���.<:P}����iū�('�7�,]��ӎ��/���,8II���ʵI+/���P�����>����F�bH4�E~�N�@�^�$� ��i����&U�U�Q6{X��}(�}ɜ�~���ByVh[�"����4>�?J�30�$�A��őK���t���R�m,
U�n�ȠN���y���{G~����W.��լ��<P��nU,�l�0��}�kibMY�+�RK*�d�ٟo�^��4�`���sT{�#rԷ"�L[�ꆡo�U�3���=��2����J�*e��8�!�f>�V
�?�z�o7����|�u�ؾ�>��CD����h��k�O^:�E2�bb?R>��m�P��h�v��_���V��(m�|3�5f���uJz����9�(� }>r�	�=�#])��LL�$H����S=/�ĴS�#��X#��܀}j�T�.L#8�uX$KL��TA_	��G�m���?ļ���g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(��H0��`
8���o@@E���oHHPT���^B�+�+ph44c 4 4�n�9�9�wp?p?�t}\�\�
�����0 �����������D����� ��� ����� ����� ��@ �� ��� ���� �� ��!�� ��a�H
`h�$(lib-dynload/_json.cpython-38-x86_64-linux-gnu.so000075500000242750151153537520015234 0ustar00ELF>`#@�>@8	@�(�( �+�+!�+!�( �+�+!�+!888$$�(�(�(  S�td�(�(�(  P�td�����Q�tdR�td�+�+!�+!XXGNU3�9D��`��`tW�H5Z��E�@ EHڪ�|CE���qX����J�y� ��A����U� �, ��F":�+Qm�?��.�ii�[��.�g�R���*���B��#z�^���
�7!�p7!�p7!__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6PyArg_ParseTupleAndKeywords_Py_NoneStructPyCFunction_TypePyCFunction_GetFunction__stack_chk_failPyExc_TypeErrorPyErr_FormatPyUnicode_NewPy_hexdigits_PyUnicode_ReadyPyExc_OverflowErrorPyErr_SetString_Py_DeallocPyDict_NewPyObject_GetAttrStringPyObject_IsTruePyLong_FromSsize_tPyExc_StopIterationPyErr_SetObjectPyObject_CallFunctionPyImport_ImportModulePyObject_CallFunctionObjArgsPyUnicode_InternFromString_Py_TrueStruct_Py_FalseStructPyExc_ValueErrorPyLong_TypePyBytes_FromStringAndSizePyLong_FromStringPyFloat_FromStringPyFloat_TypePyUnicode_FromKindAndDataPyArg_ParseTuplePyTuple_NewPyUnicode_FromStringAndSizePyList_AppendPyUnicode_JoinPyList_NewPyType_IsSubtypePyThreadState_Get_Py_CheckRecursionLimitPySequence_FastPyLong_FromVoidPtrPyDict_ContainsPyDict_SetItem_PyAccu_AccumulatePyMapping_ItemsPyObject_GetIterPyIter_NextPyDict_DelItemPyUnicode_FromStringPyErr_OccurredPyList_Sort_Py_CheckRecursiveCallPyObject_GC_UnTrackPyDict_GetItemWithErrorPyTuple_PackPyDict_Clear_PyAccu_Init_PyAccu_Destroy_PyAccu_FinishAsListPyInit__jsonPyModule_Create2PyType_ReadyPyModule_AddObject_edata__bss_start_endGLIBC_2.4GLIBC_2.2.5vii
ui	�+!��+!P�+!�+!0!�
 0!�
(0!�
H0!�
P0!�
x0!�
�0!�
�0!�
�0!�
�0!�
�0!�
 1!r@1!rH1!zh1!zp1!o
�1!o
�1!��1!��1!��1!��1!�2!�2!�02!�82!�X2!��2!��2!��2!`�2!��2!P�2!�2!/�2!�p�2! 83!�P3!Ќ�3!`��3!��3!��3! c4! 1!X4!pZ�4!��4!@�@5!�p5!�x5!�Y�5!�c�5!0!�5!�d�6!��6!��6!�2!�6!�6!	�6!��6!7!# 7!r(7!z07!o
87!�@7!�H7!�P7!�X7!�`7!+�/!�/!�/!	�/!�/!�/!�/!�/!�/!�/!�/!�/!+�/!-�/!.�/!8�/!A�-!�-!�-!�-!�-!.!.!
.!.! .!
(.!0.!8.!@.!H.!P.!X.!`.!h.!p.!x.!�.! �.!!�.!"�.!#�.!$�.!%�.!&�.!'�.!(�.!)�.!*�.!,�.!/�.!0�.!1�.!2/!3/!4/!5/!6 /!7(/!90/!:8/!;@/!<H/!=P/!>X/!?`/!@h/!Bp/!Cx/!D��H��H��!H��t��H����5!�%!��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&�������h'��q������h(��a������h)��Q������h*��A������h+��1������h,��!������h-��������h.��������h/������h0�������h1��������h2�������h3�������h4��������%�
!D���%�
!D���%�
!D���%�
!D���%�
!D���%�
!D���%�
!D���%�
!D���%}
!D���%u
!D���%m
!D���%e
!D���%]
!D���%U
!D���%M
!D���%E
!D���%=
!D���%5
!D���%-
!D���%%
!D���%
!D���%
!D���%

!D���%
!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%�!D���%}!D���%u!D���%m!D���%e!D���%]!D���%U!D���%M!D���%E!D���%=!D���%5!D���%-!D���%%!D���%!DI�|$ H��t	H��Ӆ�u>I�|$(H��t	H��Ӆ�u+I�|$0H��t	H��Ӆ�uI�|$81�H��tH��H��[]A\��[]A\�1�[]A\�H��!I�RH�5i�1�H�;1������7H���(��������1��?�A�\H��A�r��A���@������@L�@HtL�@0A�"�E1�I�4I9��iF�\-H�zI�8E��A����A��	�9A��
�MA���RA���W�\E��A��H�zL�
Q!�uA��A�D0A�D0I�1F�E�\I�	F�$!E�dI��H���\���A��6�A��+�H��
!H�5s�H�;����1��$�B�D���L�@H�	������~�I�l$0����y�I�l$H�o�H�
D
!H�P1�H�5�H�9���1����fA�\H��fA�$\��fA�\H��fA�$"�m�fA�\H��fA�$r�W��"�}�A��fA�\��H��E��fA�$ufA�D80fA�D80fG�T
fE�T8fA�TfA�T8
��H�x0�R�fA�\H��fA�$f���L�@0�g�L�@H�^�H�xH�!�fA�\H��fA�$n��fA�\H��fA�$t���\H�z�f�[���A��"tA��\t7A��
������\H�z�r�6����\H�z�"�'����\H�z�t�����\H�z�\�	����\H�z�n����\H�z�b���D�&���A��A�\��H��A��A�uB�D/0B�D/0G�F�L/A�B�T/��A�\H��A�b��A�\H��A�"�h�A�\H��A�\�Q�A�\H��A�t�:�A�\H��A�n�#�A�\H��A�f��fA�\H��fA�$b�1�L�%	!H�5��I�<$��1��
6L�HHA�"M���6�5�����t��E L�e� uH�mH��4L�HH�ɨ@�a8H��0�41��z=H��������<H��[����H��H��[]��H��L�D$H�$���H�$L�D$�>H��1��������1��~�H��!H�5n�H�8�(���1��a���tCN�\�1�A��A�L H��I9�u��BA���#�|�.L���0E1��?GM�E1�L�F�TMG�T
 I��M9�u��SBA���B�T�L�4���߃�E��BH�CH9��=F�T5A��+A����E��EA���X�L��D�Y�A��	�YBM�uL;5!H��A��w�`BA����fB�|}-�I�_H9����D]�P�f����H��H9���D�D]fA��/vfA��9��H9���f�|].H��D�LfA��/��fA��9�H��A�H9���D�L]fA��/vfA��9��H9���A�H�D�T]A���fA��EtA��PA�DH�CH9�}`D�\A��+fA���tRD�\EfA��/vfA��9w	H��H9�~��TE�D�R�fA��	w0M�uL;5�!H��A�A�u$�A~���A��/DA���@�C�CE1��J���F�tA��/vA��9E�����DBE1��DA��hCH��H�t$H�$���H�$H�t$��uzE1�� @H��A��������D���/vD��9w?H��H9�~��E@A�������D�t�A��/�����A��9�����H��H9�~����H9�}E��A��C����?�z @�� uH�jH�fB�'D@��@�SBH�j0�NBH��H9��!����?�?E��E1��DA��wBB�|�-tRL��D�D�E�P�A��wNH��H9��PBA����:A���f���D�t�A��/vNA��9wHH��H9�~��BI�_H9�}��cCA��0A���QCL�������ICf��0A���7C�L;H9�������A��AH��H9�����AL����������HA�F M�n� ueM�fH����D��H����L9����D$D�)DH�D$1��HH�m�{HH�����1���DH������'G�@tM�f0�H�D$1��QHM�fH�|���H�|$�0HH�l$L�]L�\$I��L�]�H1��rMH��!H�5Q�H�:���1��JDA�4��KH��H�T$�R�H�T$�IH�muH���9�L�t$M�>L�|$I��M�>��G1��MH�T$0L��H�=���7�G��7	���KA��t9A���KA�<�\�"FH��C�<�uA���\KH��fC�<DuA���IKA�D�hKH�
�!H�P1�H�5��H�9� �1��kCH�+uH���{�H�m��FH���h�1��CCH�m�����H���N����A�A�4�A��D�T$D�NЃ�6wJM��I��A��~uEM��uMA���t-A	�D�T$DH�xH9�~@H���H��L�\$8���L�\$8�7FH�D$�G��7A	�D�T$D�ă�WA	�D�T$D��\DE1�A��G�[�XE1�H�=��������WH�muH����M���VI�/�VL��A���f��MH�=�!t!H�=�!�g[H�=q!�Y[�L�O[E1�H�$H�}��R�;QA��A��G�[�0SH��I�uL�����UH������Y�UH��A�������RA���A��A��G�[��RL�����Y���hTH�m��TH�����TH�$�XH�/�cT�p�E1��YTL�5�� H�5��I�>���E1��;TH�{� H�W1�H�5N�L�$H�;��L�$$I�,$�	TL�����SH�=.!tEH�=!�AWH�=!�3W�WH������MI�(��SL�������S�WH�5�!L���������O�QH�����/LH�����Q���[�u��[�k��!\�a��[�W�H�{ H���[\�h\H�KH��[H��@���/�H�{0H���i\�v\��H�{(H���7\�D\��H�{8H���V\�d\H�
 � H�P1�H�5��H�9�c�1���]H�-M� H�5��H�}�5���H��H�t$�V��t�H�t$�F H�n� u$H�^H�|\H�pH�"H����]�*]H�pH��@��_H�^0�P\L�|� H�5'�L��I�:���HDŽ$������3r�|$ tR�|�aL��u^B�|NA���#��|$ tyB�|�rJ�����|u���|e@���h�f�|MaH�	uf�|NA���Ԍ�v��vL���!uL��L��H�=�L�$�52L�$�mqfB�|urO�6ufB�|uufB�|e@����v�v�v�vB�T�鉅�D��3����[�}tL�$$G��A�� �Br��H��	L���/r�isL��H�T$0��H�T$0�L��L�L$ ��L�L$ ��tDA�M M�u�ʉ���� ����l$ �vrC���� w]A��I��	I���<s�qL���tI�,$uL����L�D$ HDŽ$�����I�H�$H��I��LdE1����oqH��L�D$ �B�L�D$ �iL���������A�E � ���@��yM�U0L�$�~yL�4$E��A�� �A��I��	M���H��H;T$n�|$��H�,$�D< ��A��I��	I��sBH��H�,$H;T$3�|$���D< �{A��I��	I��sH��H;T$~�L���6dH�|$ HDŽ$������6cH�l$ L�eL�$$I��L�e�cE1��݄L��L��H�=���/�mH�-� H�5��H�:�v�HDŽ$�������bH�D$ E1��|L���|�����bA�E �'|I�mH�2|H�.H��tI�(��bL�����bE1�H��L�$��L�$M���db��H�D$(�~bL��L�L$ ��L�L$ ��tA�E ���poL���q�|$u9L�$$A�4Tf�� ��~A��I��	I����~�^���<:��~���H�$D��A�� wA��I��	M���/���A��:�g����~�|$u#�tUf�� w8��H��	H���2����s~D�D�A�� w�A��I��	M��s��
����N~H�|$0L��HDŽ$������`mL�T$0I�H�$H��I��GmE1�逃M�EHL�$�vI�mH1��kn�|$ �
B�|�aJ���*
�|l�)
�|s�(
�|e���C�L�<$C���� wA��I��	I��rB��}���ifI��L9t$|XL�$C�,rf�� ��yA��I��	I���ry�)rI��L9t$|&H�$B���� w���H��	H��s��q����HDŽ$������Tj��7	��|H��H9T$�������t;E��A�� wA��I��	M��rwA��]A���TtL�T$p���L�T$p�rA�Tf�� wA��I��	I����f��]A���tH�<$B���� w��H��	H��rT��}��t��r��uI��L9t$|~H�$�D$B�qf�� wA��I��	I��raf��}��[�rI��L;t$�_�|$�8t�|$t�H�$F�<�A�� w
L���A��}��[�fr��^�Xu��}L������Xe���-C�<�]��rL��L��L�L$ H�=��L�\$0�O+L�L$ L�t$0�}oI�,$uL����HDŽ$������:���A��t	�D��z�Du�zL��H�T$8L�L$ �U�L�L$ H�T$8�zvI�+L��uL���5�L�L$0HDŽ$�����I�9H�<$H��I�9�jE1��K���|H�$B�<��� �k��H��	H����j�k���LC�pf�� w��H��	H���}f��]�GnfC�<p]��q����L�zL9|$�}�jD�D��|hH�ߋD�A��D��$��HЃ�6wrA�I��A��~��I�~M����A����A	�D��$�H�FH9�toH���L��L�L$ ��L�L$ ���mE1���m�2zL��L�L$`���L�L$`��n���[�l��7A	�D��$�똃�WA	�D��$���tc��yL�����aH�D$(�\H���}��pH�mM���GmH��L�t$0L�L$ �X�L�L$ L�t$0�&m�|$ � �|�IH���hm�|
n�]�|
f�\�|
i�[�|
n�Z�|
i�Y�|
t�X�|
yA����|$ t%B�|�uJ�<�u;�|=lu>�|=l@���q�fB�|UuO�$ufB�|%lufB�|%l@���K��l�l�l�l��t+C�4��� wA��I��	I������]��k�o���C�pf�� �������H��	H���p����~f�|UIL��KlfB�|nuGfB�|fuHfB�|iuIfB�|nuJfB�|
iuKfB�|tuLfB�|yA����G~�k�k��k��k��k��k��k��k��k��k��k��kC���� w��H��	H��r$L;t$������8lHDŽ$�����L���W|��p��7A	��Ic��tQA�<�,��nL����w��tNA���� wk��H��	H��rf�jB���� �]���H���S����yfA�<T,u�VnL���{wE�TfA�� wA��I��	M��r�kj�fj�aj�n�nf�|uuI�QI��@���(b�|�\��I���b�|$tZB�<�,��I��L;t$���|$�%_A��I��	H�,$F�L�A�� ��M�����jnI�mH��ffB�<w,u}I��L9t$|w��H��	H�$F�$pfA�� ��L�����"n�j�X�|$ t&�t��a�|�\�_H��B�|�u���t�tU�Ya��m�`j�QX�|�uI�QI��@���aI��L;t$�"����(XH��fB�|]u���Dt�m�|$ tgB�|�nN����B�|f��B�|i��B�|n��B�|i��B�|t��B�|y@���yL���IgfB�|unK�<6u<f�|=fu>f�|=iu@f�|=nuBf�|=iuDf�|=
tuFf�|=y@����x��h��h�h�h�h�h�h�h�h�h�h�hL���K��\I�,$�+WL���3��WL���&���fH��L�D$ ��L�D$ ��ffB�|uaO�6u&fB�|lu'fB�|su(fB�|e���<}�h�h�
h�h�h�gB�<�"�p�}VH�/L��u���HDŽ$������1��������_C�4��� �%�����H��	H������M�wM9�|VC�4��� �����A��I��	I������yM�wM9�|,C�pf�� �k�����H��	H���X����Ry�f�fM�EH�SfI��L;t$����UM�oH��H�������C�H��H�U�>�H������1�A��tQA�L��� ����H��	H�����R�A��tyA�|�]���H�T$L��H�=G��!�څE�DUfA�� ���A��I��	M������A���(A�|mf�� w
H���7f��]�]�fA�|m]�9��A��txE�D�A�� wA��I��	M����A��]���y�L��H�T$���H�T$�d�I�,$tYH�T$L�d$I�$����H�
H�L$H��H�
��E1���E�LUfA�� wA��I��	M��rfA��]����L���D����e��`�L��L�D$8�+��L�D$8��L����������E1�顄L������D�E�\�A�� wL��rA��]�:��_������ޅ�|$tXB�|�aN��udB�|N��鵋�|$��B�|�uN����B�|
l��B�|
lA���_�fB�|EaO�ufB�|
N���_������|$trB�|�aJ�����|
l���|
s���|
e@���j�fB�|UuO�$ufB�|%lufB�|%lA���ԋ騃飃鞃陃fB�|maK�t-u*f�|5lu,f�|5su.f�|5e@�������I�6��\��W��R��M��H��C����I�
�H���������A�G �Ɖ�@�� ���@��I�o0�
�L�
^� H�5	�E1�I�9���H�D$H������{�|�\�H~H���|�uA���τH��f�|UuA��鼄I�oH�r�L��������cA�O M�o�ʉ���� ���‰D$�-�I�oH1��i�H�D$H�|$H������L�D$I�(H�l$H��I�(�E1��ކ�|$��B�|�nN���B�|f�B�|i�B�|n�B�|i��B�|t��B�|y@��鐇�|$tj�|�IL�$����B�|%n��B�|%f��B�|%i��B�|%n��B�|%i��B�|%t��B�|%yA���Їf�|MIL�	�=�fB�|nuBfB�|fuCfB�|iuDfB�|nuEfB�|
iuFfB�|tuGfB�|yA���z����������ހ�ـ�Ԁ�π�ʀ�ŀ�黀�|$t>�|�rH�4�uY�|5u���|5e���G�L��L��H�=2��U�)}f�|MrH�	��f�|u��f�|e�����G�fB�|mnK�|-u<f�|=fu>f�|=iu@f�|=nuBf�|=iuDf�|=
tuFf�|=y@���ԅ�������������������������D�D��}D�T��_}I�,$uL������H�t$H������9�����7	���|$tE�T�頁A��t#A�|�,�a��V�L�l$I�E�����fA�|U,u�<��1��Tu�Z�H��L�\$8�P��L�\$8�y�A��G�<��A��tbE��A�� wL��rA��]���A�<�]tsL��L��H�=���麑A����E��A�� w
M����A��]���E�\fA�� wL��r(fA��]�I�fA�<\]u�I���%���I�����
�H�����I�&�8�H��H��-�H���f��� �A�<tf�� wI��rf��]���4��M��H�L��L�L$��������A�F L�L$�Ɖ�@�� ���@��M�n0��I�,$��H�m�;�H������1�鋋L��� H�5��I�;�@��H�D$H�����H�
�� H�P1�H�5��H�9�&��1��D�A��tuA�|�IH�<��{�A�|=n��A�|=f��A�|=i��A�|=n��A�|=i��A�|=t��A�|=y��韖M�nH1��fA�|mIH�T-��fA�|nuAfA�|fuBfA�|iuCfA�|nuDfA�|
iuEfA�|tuFfA�|y���=�龏鹏鴏鯏骏饏頏雏閏鑏錏量L��L�L$�$�����)H�,$H�}@�.��1���H��L��H�=�����k�L���8���C���L��H�T$����H�T$���/�1���A����A�|�aH����A�|N���#�A���A�|�nL���QC�|f�TC�|i�RC�|n�PC�|i�NC�|t�LC�|y@���S�fA�|}aL�?��fC�|N��隕�]�A�t��H�E�|��A��tUE��A�� ������H��	L�������I�[I9�|vE��A�� ���L�������4�H�D$H�����A�E�\fA�� ������H��	L������I�[I9�|$E�\fA�� ���L������ے�-��(�A����C�|�aN����C�|l��C�|s��C�|eA���&�A����E��A�� �Y���M���O���H��I9��E��I��A�� �1���M���'����
�fC�|eaK�4$u'fA�|5lu(fA�|5su)fA�|5eA��騒�ь�̌�nj�Œ齌鸌A����A�<�,��H�VI9���A���-E��A�� ��M����H��I9�}���A�<tf�� ����I�������H��I9�|-A�<tI��f�� ����I�������+�fA�<t,�t���H����L��A������C���锋��7A	���A�A����A�t��N�A����6��M��I��A��~��I�~M����A�����A	�H��H9�|�鮇M�nH��M�fH齊M����H��I9�|E�TfA�� ������A�N M�fL�L$�ʉ���� ��D���y�H�muH�����H�D$H����L�L$M�9L�|$I��M�9�5�L�������(�A�tU����H�\$鍏A��tXA�|�rH�<�unA�|=u��A�|=e@���r�A��tRA�|�uL��uhC�|lujC�|lA��饔fA�|urL�6uXfC�|uuYfC�|e@�����G�fA�|EuH�ufA�|lufA�|lA���T��������
������H��H�T$����H�T$�a�H�m����H������H�D$H�������fA�|MnL�$	uGfC�|%fuHfC�|%iuIfC�|%nuJfC�|%iuKfC�|%
tuLfC�|%y@���M��w��r��m��h��c��^��Y��T��O��J��E��@��;�H���-��鴅fC�|EuI��H�VL��A���ĄC�|�\tEL��遅A��G�<雇H�D$H����H�|$�%�������7A	��@�����WA	��5���C�|�uI��H�VL��A���^�H�\$�a�H�������H������I�,$���L���q��镘L���d���ŜH���W���r��D$�������@�m�H�$L�i龗L���*���E�L������T�L������˙H�=C� ��H�=-� �h�H�=� �Z��!�L�������׬H�$I�����H�I�/�ΣE1�鵣A��G�R魗L��� H�W1�H�5��I�:���I�mt-H�l$�c�H��� H�5�H�l$E1�H�:�����C�1��V�鸧�D$�������4v銣L���$���ߘH������[�H���
��铨H�������L��������H�$I�H�D$�ĔH�5� L�����������鐟L�����鮜H�������L�����鸖L�����龜L���z��阙I�m���L���b��這I��M�$uL���K���d�H���>���u��R�L���,���D$�����$�1��E�H�$��I��H�l$I�+��L��E1�������H������頡H�$H��H�T$(�L��A�����飕A��G�R遛H�=�� �H�=�� ���H�=�� �|��թ���R�:�H�=���������H�muH���R��M���l�I�m�a�L���6���T�L���)���A�L������@����4v��H�=E��@�������I�muL������M���	�I�,$���L��������I�,$��L������ٔI�m�ȗL�����黗L�����鮗�}�H��I�$u7L���t����H��� H�5�I��L�|$8H�l$0H�:����1�静�әL���8����H�)���H���!��鯙I�m�/�L���	���"�M��I��L�|$8H�l$0I�+�@�L������1��3�H�-�� uH�=�� ����H�+t1�鎳H�-� u�H�=� �����H��1�����g����ATI��UH��SH�H��H���r��H��Ӆ�����I�|$ H���j��H��Ӆ�����I�|$(H���b��H��Ӆ�����I�|$0H���Z��H��Ӆ��e��I�|$8H���W��H��H��[]A\��f.���SH��H��H��H��hdH�%(H�D$`1�H�D$$P1�H�T$0RH���H�L$<QH�
l� L�D$HAPL�L$XAQL�T$hARL�\$xASL��$�L��$��;��H��@���H�t$PH;5�� �L�VA��� ����H��1���0H��H����H�|$@�~\$0�~l$PD�\$$H�|$�t$ \$(�~d$l$HX0H��� hd$8D�X@` @�pA�D$H�CH�CDH9Wu�k��H�
��H9�u_H�CHH�{L�KL�S L�[(H�s0H�C8H�I�I�I�H�H�H�L$XdH3%(H����H��`[�ff.�L�	3L9�t��1���H��1���0H��H��t�H�|$@�~D$0�~T$P�T$ H�|$D$(�~L$T$H@0�L$L��� L$8PH �D$$�SA�C@�KDH�CHL9G�����q��H�=z2H9�����L�
��L9������W���AVAUATUH��S�G ���5��L�g� �?���@��H��0����M���H��M�,�I��������I��������I������������D�2A��\D��A��A��"@��A���
A�� A��^��L9��n��H��H��L9�u���/��H���e���x @�� �^����@����L�H0�@0"M��~r�1Ƀ�uv�T
L�FM�1O�4��\A��"A��E����D�j�A��^��H��A�L��L9�u�A�"[]A\A]A^�@��]���fDA�A"[]A\A]A^�f����"�TML�FM�1O�4��"A��\A��E��t#D�j�A��^wH��A�L9�t�L����A�\��������"���\����
��H�=C� A�u��L�7A���A��E�6A��A�փ�A��G�TL�/A��C�tC�tL�I�pG�2M�41G�\H�?�C�TH��L9����������ff.���	�)��
�����c���H��A�bM�41����
vK��"����\M����MD�D��J��L9��H��H��H�I9����������ff.�������M�؀�MGŀ�H�H��H��뱃���I��������J�teI��������I�����������"A��A�Ń�\A��E���e�� ��^�YM��A�I9�����H��L�H9�u��)���M�ع�,����T�L�FM�,1O�4��\A�Ã�"A��E�����z�^��A�UL���y���H��H�L���H��A�"M�41�_���1�I��I��I��I��������D�t�A��"@��A��\��@���A�F�L�ι��^��H9�����H��H�I9�u��_���H��A�nM�41�����"�q�����\t��
�!H��A�rM�41����H��A�\M�41���H��A�tM�41���H��A�fM�41���fA��
w,fA��sKA��M��fA��MG�fA��M�I��I���}���fA��"tfA��\M����MD���L���W���M��A��I���A��
�A���E�F�A���A����L��IG�A��H�H��H������A�E\���3��������	������
���������������A���A��H�=�� A�u��A��
���A����L�/E��E��A��A��A��A��G�\5E�\1L�7G�,E��A��A��E�l1L�A��G�4E�t1L�/G�DA�D1\E�D1L�FO�4���A��"t
A��\�����L�ֹ�����SH��H�H��tH�CH�/u����H�{H��tH�CH�/u����H�{ H��tH�C H�/u���H�{(H��tH�C(H�/u�Ⱦ��H�{0H��tH�C0H�/u謾��H�{8H��tH�C8H�/u萾��1�[�ff.����SH��H�H��tH�CH�/u�\���H�{ H��tH�C H�/u�@���H�{(H��tH�C(H�/u�$���H�{0H��tH�C0H�/u����H�{8H��tH�C8H�/u���H�{@H��tH�C@H�/u�н��1�[�ff.����UH�
d� SH��H��H��H�רH��dH�%(H�D$1�I���G������a��H��1���0H��H���J���S���H�C@H����H�<$H�5���ּ��H��H����H��蒻���CH�m�
���{��H�<$H�5Y�蚼��H�CH��t~H�<$H�5L�聼��H�C H��teH�<$H�5E��h���H�C(H��tLH�<$H�58��O���H�C0H��t3H�<$H�5)��6���H�C8H��tH�L$dH3%(H��uH��[]�H�+uH��1��s����������I���UH��I��SH��H��H�=�� H��t9H��H�5ȧ1��ļ��H��H��tH�=�� H�����H�+���H��[]�H�=��H�T$H�4$����H��H��t�H�5��H���p���H�mH�$H�0� L�D$����H�=� H���p����AWI��AVAUI��ATM��USH���z @������@�� �!��@��@��@��H�BH�j0��D��H�H�A������B�|:0@��-�A	�Wπ���I�_H9��i	��DI��I)�D�X�A��A��	��H��H9���M����I����I��tvI��tYI��t<I��tI����D�PЀ�	�iH���DD�@�A��	�RH���DD�H�A��	�;H���DD�P�A��	�$H���DD�X�A��	�
H���DD�p�A��	��H��H9���A�H9���A��������D��fDL�KB�D
L��D�@�A��	��H���DD�P�A��	��B�D
I�YD�X�A��	wzB�D
I�YD�p�A��	wfB�D
I�Y�PЀ�	wTB�D
I�YD�@�A��	w@B�D
I�YD�P�A��	w,I�YH9��6����D�PЀ�	�N���ff.�H9���<.�TE1�<e��<E��E����L�6L;5�� �8I��1�D�$M)�L���߸��I��H�����H�x M���J�L=L�@0H9�N�L=@��M9�D�$��@���M�^�I����L���Ao	H��AM H��tC�AoQAU0H��t2�AoY A]@H��t!�H��H��H���Ao1AD5 H9�u�M��I���M9��bN�T
M�YC�:B�M9��GI�I�AC�;B�TL9��-H�M�QB�48B�tM9��I�M�YC�:B�LM9���I�I�AC�;B�TL9���H�M�QB�48B�tM9���I�M�YC�:B�LM9���I�I�AC�;B�TL9���H�M�Q	B�48B�tM9�}{I�M�Y
C�:B�L	M9�}eI�I�AC�;B�T
L9�}OH�M�QB�48B�tM9�}9I�M�Y
C�:B�LM9�}#I�I�AC�;B�T
L9�}
H�B�,8B�lE��uP1��
���I�mI��uL�����I�$H��L��[]A\A]A^A_��DD�p�A��	�H���H������L�����I��I�mt��E����E��M�uL;5�� E��A���I��1�D�D$M)�D�$L������I��H���K���M��H�x �4$D�D$�7������q���J�D=N�L=H9�M�U0��M9�����2���M��E1�A����I��trI��t^I��tJI��t6I��t"I��tA�1A�A�u C�C�L I��G�G�\ I��C�C�T I��C�C�D I��C�,C�l I��G�<G�| I��M9��m����C�4C�t C�LC�L!G�\G�\"C�TC�T#C�DC�D$C�lC�l%G�|G�|&C�tC�t'I��M9�u������D</�����<9A��„������H�SH9���A���׽���DD�P�A��	��H�SH9��e�DD�X�A��	w~H�SH9��I�DD�p�A��	wbH�SH9��-�DD�H�A��	wFH�SH9���DD�P�A��	w*H��H9�������DD�X�A��	wH��H9�~����H��H9���������H�jH@��H�J��D��H��A��� ���B�|=@��-��L��D�O�A���TH���H9��y���A�L�6E1�L;5� �4���H��L)�M���%���@��I��H�t=D���5���I��H���t���H��L��1�1�蚱��I�����H�CH9��eD�tA�A��+A��uH�CH9��(A���T���D�LA��0A��	�L�pI9�GD�\A�SЀ�	w8L�pI9�/D�TE�J�A��	wL�pI9�B�D5��0<	w	I��I9�~�L���L�A�D�q�A��	�
���M�uL;5Ϳ H��A�A���������L��@��0A��A��E��uL��E1����{���H�����H��H9������E��A�A���ٸ���D����I�_H9��B�|=�0���I���F���A���?������A��G��������$��������ff.���AWH��H�5j�AVAUATUSH��hdH�%(H�D$X1�H�L$HH�T$P�D$@L�D$@��������L�t$PI�F��������H�\$H�T$@A�F H�s��T$$H�t$0���ͻ��M�n� �߻���@�V�����M�f0��D��H���w���L9��n����D$D����H�|$DD��L�t$1�H�D$E��I�~H�|$L�L$(A����E�D�T$DA��"t
A��\�ZA��"t
A��\�8H�SA��"��H�|$��H����H���ư��H��H���L�����p���H�������H�l$�~L$H�\$L$HH�t$XdH34%(�lH��h[]A\A]A^A_�ff.�L9��h	A�4H�C�t$D��u��H�s�D$DL9���H9���E�A�KЃ�6�f�H��~�OL���}���?�L$DH�CH9��E�D��A�ʉL$DA�HЃ�6��H���~��L���4����A	�D�T$DL�CI9���E�\A��D�T$DA�KЃ�6���H��~��L���a����A	�D�T$DH�{H9��qE�LA��D�T$DA�IЃ�6�_�H��~�wL���"���8A	�D�T$DI��H��H��H��A��(�������H���tH�t$�����H��H���o����D$DI9��]���L�t$�A�K��L$D���E�H�E	�D�T$D����D��$��A���w!A��
��A���D	׍��\$DH��H����H�t$���l���H��H���ܸ���D$DI9�����L�t$�	A�{�A	�D�T$D���H������A�I����I��L��H�����I��L��H�������|$$��A��w����L�[M9���A����G�D�T$DA��"t
A��\��A��"tA��\usI9�u)I�SA��"�^���L9��?A���jL������H���L��D��L�\$8H)�H�\$(I�4�`���H��H���з��D�T$DL�\$8�1��S���L�t$H�T$0L��H�=՚��H�|$�H��t�H�mu�H���8���1�����A��w��ugL�[M9�}TA��u;G�D�T$DA��"����A��\�
���A��w��u0I��M9�|�L�t$�q���A��uG�\�G���L�t$�T���L�d$L��L��H�=���I��L���1�H�=ڗH�T$�1���L�l$H��H������L�����H��H���n����蒫��H���з��H�l$�~D$H�\$D$@����H�D$H��H�=H��������A��u8E�\D�T$DA��"t
A��\����A��"tA��\uI������L�t$�x���E����H��t*H�|$H��H�T$自�����w���H�mH�T$�P���H�=� � H�t$H�=�� H�T$諨��L�l$H��H����L�D$M� L�d$I��M� ���L��L�l$�S���L�l$����L�t$����A�KɉL$D���I��H�Ã�btmwM��/�c�����\�Z�����"�Q���H�t$L��H�=��D$D�����A��7E	�D�T$D������ntEv1��rt��tu��D$D	�����D$D���D$D
�����fu��D$D�����D$D
����1�H�=��H�T$����H�T$H��H�Ǿ ���������A�����A�4T�t$DI�C��u�bI�[�D$DL9����H9��]���E1�A�A�������E�DA��A�IЃ�6�L��H���~�L�������A	�H�xH9��XH���A��7E	�D�T$D���I�sL9�����L�@A����A�<<\�����H��C�<uA��1�A�E�������H9��i���A���T���A��J����6wAM��I��A��~�'���M��u"A���t 	�H���A��7E	�D�T$D�����W	���H�D$I�S���A�������fA�<|\��������H�|$��H�|$H���v������M���H�m��麲���I���H�|$��H�|$H��L�\$8�;���������H�mL�\$8������c���D�T$D���L�t$����L�d$I�����A��u3G�\�(���H�\$H�;H�|$H��H�;����H�|$�	������G�����1�货��H�D$H���#������H�D$D�T$D���H�����A��WE	����A��7E	����1�L�\$8�f���L�\$8H��H�D$�����G����P���L�T$�g���L�T$�]���DAWAVI��AUATI��USH��H;�� ��L;5˳ H�$�����
L;5�� ��
H��I�~H������	���H;=T� �^	H�5G� �B���A�Ņ��G	I�NH����������P �J�H H�,� ;��H�=� ��H�=ֺ ��H�=�� ��H�5S�L�����H��H���H�x�
H�5ݲ H9s�CL���;���I��H����H�{H���C������%H�{L��L�������u_H�5Q� L���9�����uLL�~� L9C(�Ʋ��H�}��L�uA�����
L�MH�$L��H��I��Q�������I�/�K
H�m�IJ��迣��L�-� D�` E�]E�L$�D�H A��������A��2A�����E9�~	膣���@$H��D��[]A\A]A^A_é �u�`���L�
�� �x D�GD�@ E;��
H�=E� �b
H�=/� �T
H�=� �F
I�~��L�i� L9S��
L���ǡ��I��H���;H�{H���ϡ������H�{L��L��舤�����H�5�� L���������L�� L9[(���L���У��I��H�����{@��
H��蒢��I�.I�������H����E1�L������H��H���5H�M��������H�}�����L�EI�x�����I�M���H�CHH���L��L9�������s���L��L�D$���H�L$H��H�)�(H����L��H��H�D$赡��H�|$�������H�/�ð��H�s0L��蒡�����HH�U H�$L��H���������I�/�����L���-���H�m�IH������M����I�m�m�!���L�j� D�h E�E�M�D�H A����d�������f�H�5I� H9s��H�{1�L��1����H��H���C辠��L�5� �x D�GD�@ E;�خ��H�$L��H��H������A��艠��E�D�H E�Q�D�P A��������A��2E9����[����@$H�m��H���������E��DE����H�5I� L���1�����uXH�=v� H9{(�����H�}�GE1�L�UA�����L�]I�H�$L��H���F������NM�����H�m�����赟��H�-�� �x D�]D�O�D�H A����Y���A��2A�����E9������f.�H��� L���PXH��H����H��L���\���H�+A��������|���f.�H�}��H�U�����	H�ML�qH�s8L���������*���H�$L��L��H���V���������H�}~bA�H�E�����	H�uJ��M���H�$L��H������������I��L;u|��ff.��H�}�P���M�������H�{L��蠞��������I�/�t���L���&���H�5W� L���G������j���H�m�`	����L�h� D�x E�E�O�D�H A����Ǭ��A��2E9��d����h�����t%L�=� H�5�I�?�/���ff.�@I�mu	L��葞���A�����襝��L�� �h E�D�M�D�H A��������A��2�H;=�� �YH�5�� L�D$菝��L�D$���;L;�� @��L;�� ��@��$L;�� �I�x�����H�g� L��PXI��H����M��t&�H�s8L��L�D$���L�D$����H�CHH����H�5N
H9��]I�x����:���L��L�D$����H�L$H��H�)��H��tNL��H��H�T$耜��H�|$���ī��H�/�����H�s0L���]�����uH�U H�$L��H�������tRE1�I�/uL��L�$���L�$H�muH��L�$���L�$M������M���0����;���ff.�I��H�m�x����ɫ��ff.���Av�"�f(�fT=�f.�rZL��L�5Ʃ A�VXH��H���/���fDA�������DL�kHM����L��M9���L�����H��뷃{D�EfE�fA/���fD/���H�=,��%���H���蛚��I�H���ש��H��I�uL���Λ��M��t#H�{L������������I�muL��覛��H�5�� L���ǚ��A�Ņ��������E1�H�muH���u���E���
M������I�/��������L���܄H��H���	�������L���#���I��H������H�{H���+�������H�{L��L������������H�{1�L��1��<���H��H��t����L�5H� �P �J�H A;�'H�$L��H��H���D�A���̙��E��p D�V�D�P A����٧��A��2E9�����蟙���@$��H��H�T$�i���H�T$���M����H�{L��誙�����Ƨ��I�/����L��E1��-�������H�=]��L���H�����H�=@��8���H�����H�U�2����A@�y�f(�fT
]�f.��5H�� L��PXI��M���������H�=-�虘��H�=$�H�î 膘��H�=�H��� �s���H�=�� H��� ����H�=�� ����H������I�~�L�=Ŧ L9{��L���#���I��H�������H�{H���+������I���H�{L��L��������\���H�5� L������������H�-^� H9k(�K���L���,���I��H������{@tL���"�������L�����I�.I���ݦ��M���P������H�s8L��H�T$覗��H�T$���������H�(�h���H�5�� L���{���A���?���E���������H�5F� L���V���A������{A�X���L�E� H�WH�5��1�I�8舖��E1����L���x�I��H�����������L�
�� H�5a�I�9�A����\���H�{ L��L�D$苀H�L$H���/����{D��f��f/��f��f/���H�=��蜕��I�����L���\���H�m�q���A���D���L��1�A��H������L��L�D$1���H�L$H�����H�=X��S����������饤�����D�H�� H�5R�H�;�g����)�H�=9��ƕ��H�=0�H�� 賕��H�=�H�� 蠕��H�=� H�ѫ �J���H�=˫ �<���H������.���H�=��裔��I�����H�=��菔��I�����H�=��苖��������0���E1��:���L�u �A�����tH�I� H�5}�H�8蒖��I�/�����L��A�������I�.����L���������J�T��>���L�
�� H�5`�I�9�@���E1����H�{ L���~H���5����������ۤ��D��SH���Ó��H�{H����H�CH�/���_���H�{H����H�CH�/���;���H�{ H����H�C H�/�����H�{(H����H�C(H�/�����H�{0H����H�C0H�/�n���H�{8H��tH�C8H�/�I���H�CH��[H��@��H�{H��tH�CH�/u薔��H�{ H��tH�C H�/�����H�{(H��tH�C(H�/�����H�{0H��tH�C0H�/�գ��H�{8H���u���H�C8H�/�c���駣�����SH���S���H�{H��tH�CH�/�����H�{ H��tH�C H�/�����H�{(H��tH�C(H�/�����H�{0H��tH�C0H�/�����H�{8H��tH�C8H�/u苓��H�{@H���9���H�C@H�/�'����g���H�CH��[H��@��fD��AVAUATUSH��H�F����@����F ���p���H�n� ������@�dH�^0��A��A��H���H��L�L�I��������I��������I��������A����D�2A��\D��A��A��"@��A���<A�� A��^�.L9������H��H��L9�u���Œ��H��������x @�� �����@�΢��H�p0�@0"H��~x�1�A��u|�L�GL�,>N�4��\A��A�Ã�"A��E���D�Y�A��^�H��A�ML��H9�u�A�"H��[]A\A]A^�f���W���fD�F"H��[]A\A]A^�A����S��\L�GL�,>A�Ã�"N�4A��E����D�I�A��^��A�ML��H��H9��+����t�����
v@��"�+��\M����MD�D��J��L9��k���H��H�L9��d������������M�؀�MGŀ�H�H��H���A�E\A���6��A��"�CA��\��A��
��L�
Z� B�u��M�1A���A��E�,>A��A�΃�A��F�lM�A��C�<B�|M�)I�xG�\5L�4>F�\M�	A�	B�L���A��	�sA��
�<A���v���H��A�bL�4>���M�ع���1�A����I��������I��������I���������S��"A��A�Ã�\@��A���3�� M����^�I9���H��H�H9�u��,���H�^H��������H��A�"L�4>����I��I��I��I������������"A�ƃ�\A��E��tOD�p�L��A�A��^w<H9��u���H��L�H9�u����H��A�rL�4>���H��A�\L�4>�����
�	����H����=��L��IG�=M�I��I���A�E\���
����"������\t���
�w�����������A��L�
)� A�u��A��
���A����M�)E��E��A��A��A��A��G�\5D�\>M�1G�,E��A��A��D�l>M�A��G�4D�t>M�)G�D�D>\D�D>L�G�K���H��A�nL�4>�����"t	��\�����L��A����H��A�tL�4>�V�����	t�
t��������x���H��A�fL�4>�-���fA��
w,fA��sMA��M��fA��MG�fA��H�H��H�����fA��"t!fA��\M��A��MD�A��H�4����M�˾�y���ff.�AWAVI��AUI��ATUSH��A�E H�|$H� H�L$hdH�4%(H��$�1�H�|$H�������� ������@�G��H�L� I�u0��I�EH�4$��H�T$@L�x��\$L�|$H9���苍��H�D$(H������M9��S���G�T50A�� �A��}���D$�|$��L�$C�<0"�L�L$A�E I�^E�QD�T$8���K���M�}� �Z����@����I�m0��D��L9����H���ߟ��DŽ$�L9���H��$���L�t$PE1�H�D$ E��H�|$0H�t$XA���<�L��$���\t	��"�Z��\t	��"�H�S��"��L9��N*I��D�DI�qD��$�A��u�DŽ$�I�YL9��yH9���D�D5A�HЃ�6�]�I��I��A��~��#H�~I���h	A���%��$�B�t
��I�yA�ȉ�$��NЃ�6��H��~�	'I�~L��������D	�H�G��$��|=��A�ȉ�$��OЃ�6���H���~�jI�~L���R���pA	�D��$�D�\A��H�pD��$�A�KЃ�6�B�H��~�H�~H�������A	�L�VA��(��D��$�=��zM���rH�t$0���Y���I��H������DŽ$�L9�����L�t$P�ff.�@I�&M���<L;t$����L��L��H�=Tx���ff.�@L�T$(M�:L�<$I��M�:�����L�����H�D$(H��$�dH3%(H�D$(��H�Ĩ[]A\A]A^A_��H�|$ ��M����H�L$L��H��$�H�y@����I��H��tzH�I�,$�qH��$�H;T$1�|$��H�$�,@�� ��H�&H���L���L��L��H�=�t���H�m������y���f�諆��H������L�T$L��L��I�z@辈������&H��$�H;T$��"�|$�]L�$M��A�,@�� �c���f�@��:�k���L�zL;|$��H�<$D�tA�� wI�&M����A�E �������ƃ� �����@���I�m0M�u�����ډ\$ M����M9��9#����C�t=0��"@��Y�9H��v@��Hc<�H�>���H�L$I�_D�QD�T$PL9��i���DŽ$����H��$���L�|$XE1�H�D$0M��M��H�|$8H�T$`�|$ ��D�LD��$�A��"t
A��\�		A��\t
A��"�aH�{A��"�+L9��
%�D=H�S��$���u�>DŽ$�L�cM9���"I9��8D�TA�JЃ�6��"A�I��A��~�R"I�~M���|A����d"L�K��$�M9��sB�T
����JЉ�$���6�2"�H���~�o"I�~L��������!	�I�q��$�I9��D�L5����$�A�IЃ�6��!�H���~��!I�~L��������!	ȉ�$�H�VL9���D�T5����$�A�JЃ�6�f!A�I��A��~��I�~M���8A����0!	�L�F��(����$�����3!M���}H�t$8������I��H�������DŽ$�M9��7L������H�|$0M��H��M����M���PH��$�H�D$@H9D$HL��L��L�\$0L�L$ �Z
H�|$(蠄��H�t$ L�D$0�������H�.�U���I�(�����L��$�L;t$�`�|$�8H�$F�<0A�� wH�&L����A��}�„���
�|$H�<$�ɠ��B�<7,�	I��L;t$��L�<$G�7A�� �������H��	L�������M�NL;L$�^H�$B�L2�� w
H���MM���z���A��n�V��A��r�6A��t��DŽ$�	f�M���\H�t$0���C���I��H���	���DŽ$�I9���������ff.�E�S�E	�D��$�H�~E��(��A���w�I�QL9�}�L�^I��A����A���A���f�|}\�]���鏠�����WA	�D��$����ff.�f�D�^�E	�D��$�H�G�|=A��D��$��OЃ�6�7�����ff.�E�X�D��$�B�t
A��I�yE��D��$��NЃ�6������DA�J���$�L�KM9������L��M���CH�t$8���؀��I��H�������DŽ$�I9��f���L��M��L�|$X���D�B�D	���$�I�qL9������I��H��L��D��(��A����s���I�zL9��A�|$ I�qI���I��B�|\���|5uI�Q@��E1�@����H9��a�|$ �u����t�NЃ�6���A��H���~�Μ��I�~L�������A	�H��뛃�n�����r����t� DŽ$�	M����L��H�t$8���p��I��H������DŽ$�M9���������ff.�E�A�D	���$����ff.�f�A�J������I��I��L�����f��|$8�ƒ�wS��tOI��L��L��H�=�j���H�|$ HDŽ$�������M������I�,$����L����~������L�KM9��Z���A����B�L
��$���\tg��"tb��w���y���L�KM9�����A����B�L
��$���"t,��\t'��w���>���I��M9�|����ff.����"��L9��I�Q��"�q���L9��7A�����A�������D�DUD��$�I�qA��u��DŽ$�I�YL9��H9��7���H��E1�A����E���DuA���HЃ�6�AA�I��A��~�KI�~M���-A����A	�H�FH9��&H���@�|$PA��A��waE��t\H��L��L��H�=iL�$����L�$H�|$0HDŽ$������1M���
H�m����^���ff.�L�SM9�����|$ ��F�LD��$�A��"tdA��\t^A��w	E����L�SM9�������|$ ��F�LD��$�A��"t#A��\tA��w	E����I��M9�|��h���A��"�I9��qI�zA��"����L9��O�|$ ��L������|$����L�$G�$zfA�� wA��I��	M����@A�E �����m����ƃ� ������@��I�m0��M�u����D��D�D$ M���BM9����|$ �B�\=���"��Y��L��lIc<�L�>��L�d$I�_E�T$D�T$P���Q���@���!�����@�7
I�m0L9��ʋ��DŽ$��f�H�D$0L��E1�L��L��H�=piL�$菾��L�$����fDI��L;|$���|$�@H�4$B�>< ����H�&H�������I��L�4$L;|$������|$�4G�>A�� �������H��	L�������I��L;|$~��q������\�������f�A��\���I����L�L$ �Fy��L�%�� H�L$ D�H A�qA;4$�p �~H�|$I�WH�L$0L��H��$���H�D$ �x��A�$L�\$ �P L�L$0����z��x ����29�}L�\$0L�L$ ��x���@$L�L$ L�\$0L��M�������H�m�o����f.�1���dx��H�t$ L�D$0H��I�������H�.�#���I�(����H�|$(L����x������ޘ��I�,$�������@L�L$ �&x��H�o� D�H A�i;+L�L$ �h ��A�} M�w��1�L�L$ �y��L�L$ H��I����A�] �� �������@�mM�E0M�U����M�b�M9�+�������G�0A�� �O��H��	L���~H��$�L�d$0M��M��H�T$ L��M��H�L$ H�|$L���H��H���&M��I�.�$���L��L�L$ �x��L�L$ E1�L�\$0L�L$ �w��L�L$ L�\$0H�5T� D�P �A�z��x ����������2����H�l$L��L��L�L$ L��$�H�u0H�}(���L�L$ I�����I��L9t$�?L�$$G�<4A�� ��A��I��	M����I��L�$$L;t$%�|$��G�<4A�� ��L;t$���L��L��H�=�c赺����M���L��D��L�L$`H)�H�\$XH�t�v��I��H��������$�L�L$`���M����L�ҋ|$ L�T$pH)�H�\$`H�t�tv��I��H������D��$�L�T$p�I���M�NL;L$��L�$C�l2@�� ���H�����M�NL;L$��C�D2L��< �i�H���_�I��L;t$���F�$6A�� wA��I��	M��rL;t$������DI��L;t$~���1��v��H�D$(H�|$(�V���L;t$����|$�7L�$G�1A�� �O�A��}�4�L�\$hM�nH�\$@M�+H9\$H�3L�t$I�~H;|$@��H�l$(1�1�H���s��H�uI��H�N�H�4$H�MH�������H���0u��L�d$(�@�A��]�����C�<0]�F���M�vL��$����H��L���t�����t���H�m�\���H��$�H9T$0�v	�������A�<@�� w��H��	H���@��]A��E���L���R���A�<,��
H��H9T$0�/������G���E�A�� ������H��	L��������L�T$L�|$(1�1�I�z L���|r��I�?I��L�_�H�<$M�M���/L���
t��L�l$(��I��L9t$���L�$$C�<4@�� v�D$@��}�w��6�����H��	H����	�D$L;t$�L��o�H�L$hI�nH�)����M�MHL�$M�]��L�%�� ��I���D$L�\$L�d$@L9d$H�y����Dt��H�D$(�v���M��M��I��L�d$0M���������L���H�|$ �;H�|$ L����r�����j���I�,$�x�����L��L�L$ ��r��L�d$ �
�L�l$(���I��H�|$0��H�|$0L��L�\$p�xr��H�|$p�������H�/L������
���H�����A��I��	M���J���I��L;t$�!����A���A���K�L]��$���\t	��"���"t	��\���I����H��A��b���S�A��/���A��\�w�A��"�m�L��L��H�=�]DŽ$�耵�����I��I�ԃ�b�^����/����\����"���L��L��H�=�]L��L�$DŽ$��'���L�$�_�|$ ��
D�L]D��$�A��"t
A��\��A��"t
A��\�]�I��������fu�DŽ$��h�A��f�!���DŽ$��~�M��t=H�|$PH�|$0L��L�L$8L�\$ �p��L�\$ L�L$8�������I�+H�T$P�e���H�=,� ��	H�t$0H�=� L�L$ H�T$8��n��L�L$ L�D$8H��I����H�L$0H�H�\$ H��H�u&H��L�D$8L�L$ H�D$0�`p��L�D$8L�\$0L�L$ L��$�����|$�V���L�$C�,pf�� w��H��	H���	f��}�����o��H�|$ ��H�|$ L��L�L$`�o�����@���I�,$L�L$`��������|$H�$�����fB�<r"��H�L$I�^�A�D$8A�E �������M�}� �̓���@tTI�m0����D��H���_���L9��V���DŽ$��z�H�D$ E1�L��L��H�=�]�Ӳ���$�I�mH�1�L�\$p��o��L�\$pH��H�D$0�?���饋��M��t*H�|$ L��H�T$0�n�����U���I�,$H�T$0�ˀ��H�=5� �H�t$ H�=#� H�T$0��l��H�T$0H��I����
H�|$ L�L�L$ I��L�uH�T$ �n��H�T$ H��$�H�D$L��H�x@��l��I��H���V�H�I�,$�M���I���i�H�|$0�H�|$0L��L�T$xL�\$p��m��H�|$p���a���H�/L�T$x�=�������I�mH����WA	���A��$���������
A��I��%�A	�A����$����H�=�Y1�H�T$ �9n��H�|$ I��H��$�H���p������|$�����H�$F�<rfA�� w��H��	L���I�D$fA��}��������I�mH�r�I�QL�^I9����B�|\��H��B�|u��1���u_�g�A���m����D5�H����6�A�I��A��~�����I�~M����A����	�H��H9�|�D��$��A������A��
��A���D	Ǎ���$�H�����M��|$�H��H�4$�4Vf�� wA��I��	I���"f��:���L�zL;|$�2�|$���H�,$F�t=A�� �|�����W	��C���1��l��H�D$ H��������|���DŽ$�
��I�QL��H�=�W�G�����H�|$01�H�=�WL�L$ �*l��L�L$ L�D$0I���'���DŽ$�
���DŽ$�
���L��L��H�=XH�\$0L�|$ �ܮ��L�L$ L�t$0�
�1�L�T$xL�\$p��k��L�\$pL�T$xH��H�D$0����頇��1�L�L$`�k��L�L$`H��H�D$ ���鍁����7A	�D��$���A�S�A	�D��$���1�H�=�VH�T$0�Ak��H�T$0H��H�� �����}��H�=�YH�L$ �j��H�L$ ���d�H�����|$ �ч��f�|U\�����I����L��L��H�=QVL��H��L�$�ŭ��L�$���D$��I��H�$H��	L;t$����|$u4B�,1@�� v@��}�,����B�H������I��L;t$~����|$�����F�<qfA�� �U���L���K�����L���9���M���U��|$�G{��L�4$G�~fA�� �����H��	L���t����|$��{��C�~f�� �U�A��I��	I���A����|$ ��z���D}��$�M�b��u�#���DŽ$�I�ZL9��s1��L9�������|$ �sz��B�Te���JЉ�$���6�^I��I��A��~��I�~M����A����+	ȉ�$�I�T$H9���I���H�{u L��H�5UH�;�h��H�m�&���|��M�gM9��a�|$ M�w�Ԇ��B�|=n�F�B�|=f�:�B�|=i�.�B�|=n�"�B�|=i��B�|=t�
�B�|=y@��@�����H�t$H��$�L��L�L$ H�~8H�5�S��PL�L$ I������|$ ��B�\}��E�X�D��$����L�l$ M�}L�<$I��M�}�T�H�|$ �<g���E�M�EH��1�H�=dSH�T$8L�L$ �g��L�L$ H�T$8H��H�j| �>���L�����I�+uHL����f��H�m�����F{��L�t$0M�>L�<$I��M�>���H�|$0L�$�f��L�$��H�m�����{��M�����M�����D�L������|$���C�,tf�� w��H��	H�����L;t$�1�����L;t$�����DŽ$���DŽ$�
�S��L���H�=�UL�L$ �9f��L�L$ ����L���Z�M�wM9��u�G�T8A�� ����H��	L���R�I��M9��E����)���G�0A�� �i��H��	L����I��M9�}���DŽ$���D��$����H�����WA	������7A	����E��D��$���A����B�LM�[��|$ ��F�LU�6�A��uB�LM�o�B�L��e�L������|$ ��F�LU�>�L��L���~�A��7I��H�VD	�I��L�㉄$����I�_L9�����|$ I�W�/��B�|=I���B�|=n���B�|=f���B�|=i���B�|=n�y�B�|=i�m�B�|=t�a�B�|=yA��E���N�H�D$L��H��$�H�5,PL�L$ H�x8�ML�L$ I���I�L��L���LH�m�����4x��M������W	Љ�$��>�����7	Љ�$��-�����7A	�D��$����B�\���A�Jɉ�$��8�H��L��H�=|OL��L�$��L�$�,�H��L��H�=ZOL��L�$�Ҧ��L�$�
�H�{I9��\�H��I��I����A��7D	ȉ�$������7	Љ�$��'�I�OL9����|$ M�w��x��B�|=a���B�|=l���B�|=s���B�|=e�������L��o I��L��$�I����I�_L9�����|$ M�W��}��B�|=u���B�|=l���B�|=l@��@���r�L�\$@I��L��$�I��1��I�WL9��K��|$ I�O��r��B�|=a�0�B�|=NA��E����L�L$ L�L$H��$�L��H�5NI�y8��JL�L$ I����M�_M9�����|$ M�w��r��B�|=r���B�|=u���B�|=e@��@�����L��n I��L��$�I��a��F�L���B�L���F�L����ur��L��M��L�l$X�mr��L�t$P��t���Nw����w���{x���bz���{z���z����z���es���{��L�t$P�t��L��M��L�l$X�r��L���y��ff.�@AWI��AVI��AUATUSH��H��XH�L$dH�%(H�D$H1��F �������Ɖ��� �ą���@�,
��I�o0M�o�������|$M����M9������bC�D70��"<Y��H��R��Hc4�H�>��ff.���[�\$/I�^I9�������D$@���L�L$@��E1�H�D$L�L$ H�T$0�|$��	D�\D�\$@A��"t
A��\��A��"t
A��\�?H�SA��"uJH�|$��	M���%L�T$I�H�\$HdH3%(L���d
H��X[]A\A]A^A_��L9���D�TI��H�sD�T$@A��u��H���D$@L9���
H9��-D�L5A�IЃ�6��
�H��H���~��H�~H���p���P
�L$@F�L��M�C��A�IЉD$@��6�,
H���~�H�~H��������		�M�H�L$@F�D���A�HЉD$@��6��	�H���~��H�~H��������		�I�q�D$@B�|
���D$@�OЃ�6��	A�I��A��~�CI�~M���~A����L		�L�N��(���D$@����3M����H�t$ ���7]��I��H��������D$@L9�������DE�Q�D�T$@F�LD��M�C��A�IЉD$@��6������H��A��b�"	�/A��n�	�A��r�	A��t�)�D$@	ff.�f�M����H�t$ ���s\��I��H��������D$@L9������<�A��WD	��D$@B�|
��I�q�D$@�OЃ�6�A�I��A��~��I�~M��������W�	ЉD$@H�~��(������P���M�CM9��C����|$H�VI�����|$�Ӏ��f�|}\�����߀��DE�Q�D	ЉD$@M�HF�D�v���fD�|$/@��A��wQ@��tLI��L��L��H�={G�'���L�t$H�|$I�������M����E1�����ff.�H�SI��L9���	�|$�ID�\D�\$@A��"tdA��\t^A��w	@���v���L�CM9���	�|$�6F�\D�\$@A��"t&A��\t A��w	@���8���I��M9�|��~	A��"��L9���A��"�)���L9��<�|$�h����|$�����D�TUD�T$@H�sA��u�)L�K�D$@M9��L9��L��1��|$�L���D�Du��A�HЉD$@��6��A�I��A��~��I�~M����A����	ȉD$@L�FM9��eL���DA��\�����|���X��L�-$g �h D�eD�` E;e�P
H�L$I�VH��L���[��I���X��A�MD�p A�~��x ������29������xX���@$���jX��D�@ E�PD�P H��f D;�T
A� I�n��
1���Y��I��H����
E�w A�� �z��A��@��	M�o0M�OA����A��H��	I��L�L$H9l$|$A����z��A�t-@�� ��H����H�L$@H��H�L$H�L$L��H������H��H����I�,$�b{��L��E1��gX���W��H�5�e D�X �A�{��x �����|����2����L�D$H�s0H�{(L��L���r���I�����M���oL�‹|$L�D$8H)�H�\$0H�t��W��I��H���J}��D�\$@H�\$8H�S�&���@��]�#���A�|-]�My��H�\$L�}L�;�E���H��L���aW��H�U����x��H��H�U��x��H�T$@H9T$�@A���xy��A�|@�� w��H��	H��ry@��]����u\A������A�|,��H��H9T$�����A���ix��A�D< �p���A��I��	I���\�����H������H��A�������Vx��H���N���H�|$t`H�|$L���zV������~��I�,$���y��H�|$��H�|$L��L�D$8�DV������~��I�,$L�D$8�[����/y��1�� W��H�D$H��u���~��M�CM9������H�VB�|
\�t���H���|uA��1�E���\���L9����|$�U~���T5�JЃ�6��A���I��A��~�!~��I�~M���iA���f	�H��뚃|$��D�\]D�\$@A��"t
A��\���A��\�����A��"������2M��t*H�|$L��H�T$� U������w��I�,$H�T$��w��H�=�j �H�t$H�=�j H�T$�DS��H�T$H��I����H�\$H�;H�|$H��H�;�����H��H�T$��T��H�T$�}����T��A��fu+�D$@�
���A��/����A��\�����A��"���L��L��H�=�@�D$@�2�������L���5=����L��a H�5)AE1�I�8��T��������W	����I�SL��H�=f@������1�H�=v@H�T$��T��H�T$I����D��$��A����L�����
��%�	Ǎ��\$@L���*����D$@
�����D$@�����D$@
����D�\�����I�,$�H���L��E1��S���A�L�|$M�L�\$I��M�����H�|$�zS������I��L���H���A��WD	��D$@�s���A��7D	��D$@�c���L�����I��H���.���I�oH��M�o����D��D�D$M�������M9������|$�2F�T5�A��"A��Y�����L�
�FOc�M�>A��I�VL9�������|$M�n�Xx��B�|5n�t���B�|5f�h���B�|5i�\���B�|5n�P���B�|5i�D���B�|5t�8���B�|5y@��@���%���H�L$H�{8L��H�5>�w;I�����E�Q�D�T$@��I�vL9�����|$I�N�x��B�|5I����B�|5n����B�|5f�����B�|5i�����B�|5n�����B�|5i�����B�|5t�����B�|5yA��E���t���H�L$H�{8L��H�5�=��:I���1��[�\$/I�^����v��@����v����@t>I�o0L9��"v���D$@�y�H�D$E1�L��L��H�=�?�Ӕ�����I�oH�M�fM9�����|$M�F�;t��B�|5a����B�|5N���������H�L$H�{8L��H�5=�:I���r�|$umF�Tu����I�~L9��v����|$I�N��w��B�|5r�[���B�|5u�O���B�|5e�„��>���L�|$L�%�] I��M�7I�$��F�T��[���M�FM9��
����|$M�V��s��B�|5u���B�|5l���B�|5lA��E������H�\$L�%~] I��L�3I�$��I�~L9�������|$M�n��s��B�|5a�����B�|5l����B�|5s�s���B�|5e@��@���`���H�T$L�%�\ I��L�2I�$� ��7	��D$@�I�A��7D	ȉD$@��A��7D	��D$@���H�=�>�O����������L��H�=�;�ǒ�����1�H�=X;H�T$�O��H�T$H��H�hd ������Pq��M�oH����|$uZD�\U��H�=s>�O�����`�����|$u9F�\E��1�L�D$8�cO��L�D$8H��H�D$������v��D�\��R�F�\����bq����p���Gq���r���u���u��f���AWH�
�b AVAUATUSH��xH�<$L�L$PH��L�D$XH��H�;dH�%(H�D$h1�H�D$H�����L�����LL�t$XI�F����.x��A�F L�L$P������w���ƃ� ��x���@����M�n0M�f����D��M���HM9��A����C�T0��"��Y�}H�5�B��Hc<�H�>��H�,$I�YD�UD�T$'I9��ow��H���fw���D$`I9����L�|$`��L�L$(1�H�D$L�|$H�|$0L�t$E��A���c
A�D�D$`��\t	��"����"t	��\��H�S��"�I9��E�|H�{D�|$`A��u��	L�{�D$`M9��jL9���E�\=A�KЃ�6���H��~��H�~H���&����H�s�L$`L9��*E�D5���A�HЉD$`��6�rA�I��A��~��
I�~M���5A���<	�L�^�D$`M9��,G�D���D$`A�HЃ�6��H���~�I�~L���T����	ȉD$`M�SM9��UC�|���D$`�OЃ�6���H���~��I�~L������}	�I�s��(���D$`����H����H�t$���J��H��H����|���D$`M9���L������ff.�H�|$��H���	H�$H�T$HH�x@�YK��H�|$H��J��I��H����t����J��H���et��H�,$�~$L�$$$@H�L$hdH3%(��H��x[]A\A]A^A_��A�K��L$`H�sL9����ff.�L��H����H�t$���I��H��H����{���D$`M9�������ff.�A�x�	��D$`L�^M9�����M�ڍ�(�����w�H�{I9���L�FL��A����I��L��A�|\��C�|uH�VA��E����H9���E1�A�A���>x��A�tA���NЃ�6��M��I��A��~�
x��I�~M����A�����A	�H��H9�|�A��$�����wD��
A��H��%�A	�A���D$`�"A����z��fC�|U\�`z���L��H���WH�t$���0H��H��H���cz���D$`I9��G����Yff.�E�H�D	ȉD$`����O�����L���r�����|$'�ƒ�wS��tOL�d$I��L��L��H�=�3�u���H�D$H����H�|$�:
H���H�$H�{@�zH��1��X���L�[M9���A����
C�D�D$`��\tZ��"tU��w����
L�[M9�~zA����
C�D�D$`��"t&��\t!��w����
I��M9���Df���"u1I9��<I�S��"�U���I9���
A����
L���4�����\t�H�t$H�T$(H�=L5�o������f.�L�L$��E��L�%T L�l$D�@ E�HE;$D�H ��H�<$I�UL��H�L$H�O���H���E��E�<$D�p E�n�D�h A����o��A��2E9�}	�lE���@$H�4$H�~@�G��H�������1����ff.�L�L$�6E��L�S H�T$�x �oA;*�h ��A�~ H�Z��q��1�H�T$�F��L�\$H��H����E�~ A�� �Hu��A��@�9M�f0I�FA��A��L�h�L9�/I��A���Jr��C�D< ��H�&H����L�\$`H��L�\$H�L$H�<$L����H��H����H�m�q��H��1��,E���GD��L�5�R D�` E�>E�l$�D�h A����w��A��2���H�$L�D$HL��H�r0H�z(L���.���H�����H����L��D��L�\$8H)�H�\$0I�t�D��H��H����v���D$`L�\$8���I��<]����C�<]�mm��I��L�L$H�E���H��H���&D��H������m��I�&H��H���m��H�t$`I9��	
I��A����q��A�4< w
I���
<]�„���A���Lr��A�<4,��	H�VI9������A�\4�� �y���I���o���H�VL9��b���A�L4�� �S���I���I���H�VI9��<���E�D4A�� �,���M���"���H�VI9�����A�4@�� ����I�������H��I9�}����ff.��I��A��������%r��ff.�L��H�|$�H�|$H����B�����t��H�m�}����t��ff.��I��H��A��b��wwA��/�G���A��\�=���A��"�3���H�t$L��H�=�.�D$`�4������A���A�D]�D$`��"t	��\�m�����"t	��\�z���I���E���A��n�$v+A��r�2A��tu��D$`	���ff.�A��f�f����D$`���1���B��H�D$H������n��H�|$�~H�|$H��L�\$8�A������r��H�mL�\$8����Wj���_A��H��t*H�|$H��H�T$�XA�����rq��H�mH�T$��r��H�=�V ��H�t$H�=�V H�T$�|?��H�L$H��H���(L�T$M�L�D$I��M�uL��H�L$�(A��H�L$H�L$H����M�nH��M�f����D��M����M9��sA���RG�\
�A��"A��Y����L�=�7Kc�L�>��L�$I�YE�ZD�\$'���$l��@���p����@tDM�n0H����j��L9���j���D$`�M�L��L��H�=�.����H�D$H�������M�nH뺃�WA	��i���H�\$I�SH��H�=K,�ʃ���P���H�\$��H�t$H�=.,譃���3���H�=�/�<@��H�T$���8�����I�[I9��r���C�DI��< �7���H���W���H��I9��J�����H��	I��A���fh��A�< �����H������H��I9�}�����M�fH����I�IL9��j���M�aA����l��C�|
a�P���C�|
l�D���C�|
s�8���C�|
eA��E���%���H�-xL I��L�L$HH�EL�$I�y@��?���o�M�yM9���I�iA���Ni��C�|
I����C�|
n����C�|
f�����C�|
i�����C�|
n�����C�|
i�����C�|
t�����C�|
y�����~���L�4$H�L$HL��H�5�*I�~8�'H������L�-uK H�5�*I�}�>��L�4$I�~@�?��1�����D$`
����D$`����D$`
���A��7D	��D$`�L�I�iL9����I�yA����i��C�|
a����C�|
N�„������L�$H�L$HL��H�5�)I�{8��&H���N���I�YL9������I�IA����i��C�|
n�u���C�|
f�i���C�|
i�]���C�|
n�Q���C�|
i�E���C�|
t�9���C�|
y@��@���&���L�,$H�L$HL��H�5@)I�}8�4&H�����H�{I9��o�M�CH��I��L��L���v�1�H�=)H�T$�g=��H�T$H��H� R �@����l��A��u5C�D]�M���H�\$�Y���1�H�=�(H�T$�=��H�L$H���O���C�D�����A�D�����A���i��E�|UD�|$`I�[A��u�a���M�{�D$`M9�����1�A�I9����A����h��A�t]���NЉD$`��6�V���M��I��A��~��I�~M���oA����#���	ȉD$`L�SM9��kL���H�m���H���;��H�,$H�}@�W<��1��5�L���($H�<$H�@�;<��1���I�IL9��]���I�qA���k��C�|
r�C���C�|
u�7���C�|
e@��@���$���H�-H I��L�L$HH�E���I�QL9������I�AA���Pk��C�|
u���C�|
l����C�|
lA��E������H�-7H I��L�L$HH�E���A�KɉL$`��A��u[G�\M���L�l$M�uL�t$I��M�u���L���b:�����W	�D$`�����7	�D$`���H��L����G�\��N���H��L��H�=�&�}�����H��I9�|�A�4I��< ���I������H��I9�|�I��A����b��A�4< �����I���������A��u|C�D]�/�H�=)��9��L�l$��������7L��M�S	��D$`���A��7D	��D$`��L�d$�~�1�L�\$8�:��L�\$8H��H�D$�c����Kf��C�D���H�|$L�d$(��d���e���i��H�|$L�d$(�d��ff.�@��AWH�
cM AVAUATUSH��H��H��H��%H��xdH�%(H�D$h1�L�L$@L�D$H�x7������m��L�t$PL���6�����|m��L�d$HL;%F ��L;%�E H�D$@���H�$��L;%�E ��I�|$H�����"��+H;=�E ��
H�5~E �y7���D$���i
I�t$H�������!7��D�@ E�hD�h H�^E D;(��H�=M �PH�=M �BH�=�L �4H�5�&L���,7��I��H����H�x�L�
E L9K��
L���l5��H��H�D$H���^H�{�r5������H�{H�t$L���)8�����vH�5zL L���b6�����_L��D L9S(�Jj��I���
H�D$I�o����I�WH�L$L�,�H���L;-WD @��L;-4D @��@��L;-D �
I�}H���������H;=�C ��
H�5�C ��5������
M�EI�������u5��D�` E�\$D�X H��C D;��H�=pK �H�=ZK ��H�=DK ��H�5�$L���5��I��H����H�x�'H�-aC H9k��L���3��H��H����H�{H����3�����zH�{L��H���6����uiH�5�J L���4����uVL�,$H��B H9S(�5h��I�|$��I�|$����zI�t$H�L��L��H���Ў������	H��tH�m��I�,$�Pj��A���44��L�
}B �h E�D�e�D�` A����Jh��A��2E9�}	�4���@$E���DH�|$��H�t$L�L�$I��L���I�/�ti����3��L�B D�x E�O�D�H A�=��0g����2D9����3���@$��� ���p3���H �q�p H��A ;0�fH�=XI �!H�=BI �H�=,I �I�|$�H�={A H9{�8L����1��H��H���H�{H����1�����H�{L��H���4������
H�5�H L����2������
L�-A L9k(�rh��L����3��I��H����
�{@��H���2��I�/I���{f��H���q
H�D$H�l$L���1��I��H����M�WA�����f��I���f��M�oI�}�����I�EH�|$�+	H�CHH���iH�5����H9������$f��L���m��I�mH����H����H��L����1�����g��H�m��g��H�s0L���1������I�W H�$L��H��������I�,$H�l$��e��L���;2��I�/�O	L���)2��H���N	H�m���01��L�%y? �X A�4$D�C�D�@ �����e����2D9�~	�1���@$L���/��1�H�L$hdH3%(��H��x[]A\A]A^A_é ���0��D�@ E�HD�H H��> D;�H�=�F ��H�=�F ��H�=xF ��I�}�iL�%�> L9c�QL���&/��H��H����H�{H���./�����H�{L��H����1������H�5 F L��� 0�����{L�$L�]> L�T$(L9[(��e��L���&1��I��H���M�{@��L����/��I�mI���.c��M���$H�D$ H�l$0L�|$8L���F.��H��H���$L�}A�����f��H�}��f��L�mI�}�����I�EH�|$ ��	H�CHH���~L��1���I��I�m�\M��tIL��L���%/������f��I�/��e��H�s0L���/����uH�U H�L$(L��H���O�������I��L�|$8H�l$01�I�,$uL��H�L$ �/��H�L$ I�muL��H�L$ �{/��H�L$ H���:f��H��tH�m�BA���t.��L�
�< �p E�D�F�D�@ A����vd��A��2E9��E����@.���@$�7���H�|$�
/��I�/��c���D$�����.��L�_< D�h E�M�D�H A�=���a����2D9�~	��-���@$�L$������L���.������E1�L�
!< L9K�8
H�{L��1�1���,��I��H�����-��L��; D�P A�j�h A;+�Od��H�$L��L��H���ه�����b-��H�=�; �P �7�J��H ����
d����29�}	�8-���@$I�muL���.�����BM������I�,$�����c��H�5C L���-���������1��=���H�=?; H9{��H�{1�L��1��+��H��H�������E1��,��L�%�: D�@ E�HD�H E;$��b��H�$H��L��H����A���z,��A�$D�P E�Z�D�X �����b����2A9�}	�Q,���@$H�muH���-��E����M���/���I�m�$����za��H�55B L���,��������L�%^: L9c(�9H�D$I��������`��M��t#H�{L���
,������b��I�,$uL���,��H�D$H�T$I;W�y���H�|$��`��H�{H�\$H���+���������H�H�$H��H��s`��H���=,��H�5nA L���^+��������I�/�!����a`��H��9 L��SXI��H���!���H��L���#+��I�/�D$�!����^��L�\$O�l�M�����H�s8L����*�����������I�|$�M�D$A�����M�L$M�QH�s8L��L�T$ �*�����;���H�T$ L��L��H������� ���I�|$��L��A�L�l$ I��M��H��I�T$����I�L$J��M���H�L$ H��L��葄�����KH��L��I�����H�\8 L��PXI��H�������H��L���)��I�,$A�������]���Et$�5&fE(�fDT=&fA.���L��L�%�7 A�T$XH��H�������H��L���)��H�m�D$������_��H�D$I�/�����%]��H;=�7 ��H�5y7 �t)������L;-}7 A��L;-j7 ��A��'L;-w7 �I�M�����L��L�-N7 A�UXI��H���!H�|$tH�s8L����(�����H�CHH���*L�
F���L9���I�}�����\��L����c��H��I�m�xH����H��L���(�����<^��H�m�S^��H�s0L���c(������
I�W H�$L��H��訂���������H�l$E1�I�,$uL���(��I�/uL����(��M����_��H��tH�m�x�D$������'��H�=.6 �H �7D�A�D�@ ����n\����2D9������'���@$�����D%$�EUfE(�fDT�#fE.��{L��L�-�5 A�UXH��H���r�H��L���n'��H�mA���P��&\��L�kHM���oL��1�A��I��M���-���L��L���/'��I�,$�D$�,����\\��H�D$ H�m�\����,\��H�kHH���-L��1���I��M�����L��L����&��I�,$A������[���{D��f��fD/���fA/��H�=��%��H�����H�l$�&��M�$H����[��I��M�$uL���6'��H��t#H�{H���&�����@���H�muH���'��H�5'< L���/&���D$���)�������L����&���{���L���iH��H�����H��L����%��H�m�D$����Y��I��M;l$�j���H��L��I��H��t#H�{H����%�����J�H�muH���n&��H�5�; L���%��A�Ņ��,�I�,$�0��]��H�s8L���h%�����	���L��L�|$8I��H�l$0�s���L���$��I��H���*�H�{H���$����uCH�{L��L����&�����0\��H�{1�L��1�� $��H��H���.���I�m����\����tH��2 H�5H�;�&��I�m���L���%����M�����I�,$�����Y��H�=��#��H������M�������H�{L���$������Y��I�m�t���L���$%���g���K�T����M�T$ ����I�v8H��H�T$(�*$��H�T$(����������{D��fE��fE/���fE/��vH�=���"��H���]���H�{ L���
I�����H�{ L���o
I������H�=��k#��H�=�H��9 �X#��H�=�H��9 �E#��H�=�9 H�v9 �=���H�=p9 �/���H���n��!���H�={�#��H�=rH�J9 �"��H�=^H�/9 ��"��H�=*9 H�9 ���H�=
9 ���H�������H�(��W��H�5�8 L����"��A���������H�=�0 H�5�H�?�$����H�(�`W��H�5�8 L���"���D$�_�H���R#���{���H�=��q!��H�����H�=e�]!��H������L�F0 H�5�I�;�#���3��{A��H�10 H�QH�5�E1�H�l$H�81��l!������L���_I��H�������H�l$���L��1���H���9���H�=��� ��H������H��/ H�5 H�:�#�����AE�5�f(�fT
�f.�r2H�-�/ L��UXI��M���|���H�l$�-���I�/����U���{DtQf�f/�w6f��f/�vH�=:�3 ��I���H�l$���H�=)� ��I���H�=� ��I���H�=�. H�5\H�l$E1�H�?�4"�����H�l$���L���-H��H�����H��L��� ��H�mA������T��H�{ L���G
H�����L���G��I��H���t�H�{H���O�����(H�{L��L���"��������S��H���!����� ��H�=�
����H�=x
H�6 ����H�=d
H��5 ����H�=�5 H��5 ��H�=�5 ���H������I�|$��H�-. H9k��L���v��H��H�������H�{H���~������H�{L��H���7!�����r���H�5p5 L���p�����V���L��- L9C(�U��L��� ��I��H���1����{@uL���E��I�/I���S��M���������H�5�4 L������D$����H�=� ��������
U��1��c���������L�=�, H�5�I�?� �����L��������q���I�/�����L���l�����H�=�������|���H�=�������]��*R�������L�M, H�5�I�8�����������H�=), H�5]H�?�r����1����H�5�3 L�����A���v�H�=G���H�=>H��3 ���H�=*H��3 ���H�=�3 H��3 �+�H�=�3 ��H������H�=�
�����������H���K����H�l$0L�|$8����I�$H����T��H��I�$uL�����H��t#H�{H���g�������H�muH������H�5	3 L�����A���}��t�H���9������I�m�I�L������<�L�������H�{ L���pI���x�H;=�* ��H�5�* �������L;-�* @��L;-�* @��@���L;-�* ��M�EA���t[H��* L��PXI��H������X���tH�+* H�5_	H�;�t��I�,$��L��������I�T$���{A��L�
�) I�P1�I��H�5�H�l$0L�|$8I�9�/��1����L��� I��H���Q�����AU�-f(�fT%�f.�r/L�=�) L��A�WXI��M������H�m����N���{Dt)fE�fA/�w[fE��fD/�v;H�==�6��I���L�") H�5�
I��L�|$8H�l$0I�:�^��1��/�H�=���I���u���H�=�����I���a���H�l$��H�l$���O��H�l$��H�l$�w�f�H�=�0 H��0 H9�tH��( H��t	�����H�=Y0 H�5R0 H)�H��H��H��?H�H�tH�m( H��t��fD�����=0 u+UH�=R( H��tH�=F$ ����d�����/ ]������w������ATI��UH��SH�H��H��t	H��Ӆ�ufI�|$H��t	H��Ӆ�ugI�|$ H��t	H��Ӆ�uOI�|$(H��t	H��Ӆ�u7I�|$0H��t	H��Ӆ�uI�|$8H������H��H��[]A\������������{���v��ff.���AUATUSQH�F��������~ I���g��A�D$ I�\$���� �@�o�ƒ���������������E�I�l$H���?���E1�I��������A��A��I9�}oA���,��A���NB�DU��
w=������D�@�A������ M�A��I��L��L)�H9�����L�I��럃�"������\u������_��H�������H �ʉ���� ������������@��������@L�@H����L�-^& fA�"�1�M�mH�<	M�8H9�}yD�TuL�YM�d8D��fA���8��w8fA��	�r��fA��
�Q��fA���
A������fA�L��H���fA��"�l��fA��\�K��fA��
u��k��fA�"Z[]A\A]�B�D����@��������@H�xH����L��% �"�1�M� L�,�N�/H9�|	A�"맋T�L�VN�\/�����w,��	������
������tK���)��A�L��H��뢃�"�r����\������
u����A��&����C���,������)���S���H��tH��H��H�X$ H�8���H�+���[�@S1�1��f��H��t6H��H�@���u(H�
2$ H�P1�H�55H�9�u��H�+���1�H��[�@AUI��ATI��H��UH��SAP���H��H��t,I�<$1�H��1�����HkH�+I��uH�����I�mL��ZH��[]A\A]��QH;=�# t:H;=�# tH;=�# ����H��+ H��t*H�Z�H��+ H��tRH�Z�H�u+ H��t#H�Z�H�=����H�O+ H��u��8��H�=�����H�:+ H��u����H�=�����H�%+ H�������f���S��H�=�) ����H����L��H�=�' H���r������L��H�=C& �^������L��H��' H�5�H��H��' �������L��H�	& H�5LH��H��% �������OL��H��[���H��H���OOOOUUppp:make_encoderstring is too long to escapeO:make_scannerstrictobject_hookobject_pairs_hookparse_floatparse_intparse_constantzOnjson.decoderJSONDecodeErrornulltruefalsenot a constOn|i:scanstringend is out of boundsInvalid control character atInvalid \escapeInvalid \uXXXX escape-InfinityNaN while encoding a JSON object[[]Circular reference detected{{}items must return 2-tuplesExpecting ':' delimiteridx cannot be negativeExpecting ',' delimiterExpecting valueOn:scan_onceOn:_iterencodemarkersdefaultindentkey_separatoritem_separatorsort_keysskipkeysencode_basestring_asciiencode_basestring_json.Encoder_json.Scanner_jsonobj_current_indent_levelidxcontextallow_nanmake_encoder() argument 1 must be dict or None, not %.200sfirst argument must be a string, not %.80sencoder() must return a string, not %.80sUnterminated string starting atOut of range float values are not JSON compliant_iterencode_list needs a sequencekeys must be str, int, float, bool or None, not %.100sExpecting property name enclosed in double quotes while decoding a JSON object from a unicode string while decoding a JSON array from a unicode string@���]���]���]���]���]���]���]���]���]���]�������]���]���]���]���]���]���]���]���]���]���]���]���]���]���]���]���]���]���]���]���]���]���]���]���]���]���]�����]���]���]���]������]���]���]���]���]���]���]���]���]���]���]���]������]���]���]���]���]���]���]���]���]���]���7���]���]���]���]���]���]���]�������]���]���]���]���]���r���]���]���]���]���]���]����X�������������������������������������������$�����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������ϫ������������������������������<�����������������������
�������������������������������P���������������������������������������������������������������������������������������������������������������������z���������������(������������������������������������������������������������������������c���������������������������������������������������������������������Z��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������+���������������������������(��� ���������������������������������������������������������������������������������������������������������������������������������������������������������������������������`�������������������������������������������������������|����������������������������������������Y���������������������� �������������������������������������������������������������������&���������������������������������������������������������������������������������������������X��JSON scanner object_iterencode(obj, _current_indent_level) -> iterablescanstring(string, end, strict=True) -> (string, end)

Scan the string s for a JSON string. End is the index of the
character in s after the quote that started the JSON string.
Unescapes all valid JSON string escape sequences and raises ValueError
on attempt to decode an invalid string. If strict is False then literal
control characters are allowed in the string.

Returns a tuple of the decoded string and the index of the character in s
after the end quote.encode_basestring(string) -> string

Return a JSON representation of a Python stringencode_basestring_ascii(string) -> string

Return an ASCII-only JSON representation of a Python stringjson speedups
��������������;�/��������h��,����������p�	���J
���^
���g
���
��T�
����
��d������P�������y��L
����%��d	-���	�6��T
�;���
�;���x<����>���(E���E��(�F��DH����H����R��x�]���n��dHp���q���8w��`��������x	h��
��TX���H�8��h�����h
zRx�$���`FJw�?:*3$"DH��P(\�9���F�D�D ��ABzRx� ���$$4��VL
ABBAAB,�L��F�D�D �v
ABB|2��CAB@�9��IE�MxV�H�M�N�G�G�G�Yp
AOzRx�p� ���#8�<��F�B�A �A(�A0�
(A ABBAzRx�0����$p���L<;��]B�B�B �A(�D0�9
(A BBBEV
(A BBBC zRx�0�����(���j�A���E����A���E��(�\B��YE�H�T0
AAAzRx�0�� ���p�,A�jzRx�� ~��	D(hC���A�G�G0B
AAA�G��-D
DAE��LA�J�8��4�(�XB�E�G �D(�B0z(D ABB$P��Ap
AQ
AQ
AzRx����$Hp�B���	B�E�B �E(�D0�A8�DP�
8D0A(B BBBA zRx�P������([��GL�8L��;F�L�B �B(�A0�A8�D��
8A0A(B BBBL$zRx��������,���H��V���B�B�E �B(�D0�A8�DP�
8D0A(B BBBAU
��7�lg��oE��
I�X��(�h���E���P��m_
IXHDi��F�B�B �A(�A0�D@U
0A(A BBBCX
0A(A BBBA zRx�@�����(%���L��n��q,B�B�E �E(�A0�A8�G�V
8A0A(B BBBI$zRx��������,-��|Lh��WB�E�E �B(�A0�A8�G�W
8A0A(B BBBH$zRx��������,���L�����AF�I�B �B(�A0�A8�D�
8A0A(B BBBI$zRx��������,#���	L�\���~F�I�B �B(�A0�A8�T�
8A0A(B BBBA�n,����8��E���1��JGNU��P�+!Ufv�
<
�+!�+!���o`p	�
%�-!��X@	���o���o(���o�o����oH�+!���� 0@P`p�������� 0@P`p�������� 0@P`p�������� �
�
�
�
�
 �
(�
�
0�
�
8�
rrzzo
 o
�(��0��8��@��A���`�P/�p �PЌ`�@�� c 1!pZ�H@��@��Y�c0!�d�����������2!	�#rzo
�����+GA$3a1�I
_json.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug^��G�7zXZ�ִF!t/���I]?�E�h=��ڊ�2N��f���g��@�����Y��Ax?PS�+��oBֆ�;>�
�n��ް,w55��C����V#�kB|4"h��X�^A�ź�^�wj*X�񭍠�2�"%����b�|�+�+f|�#�`�]4w}g��4��V��54��!U�.l��f�rռ�m�Z�˷��.:=*ӠO�IDy�Ӻ��h7��?�a9O�>�8��C�0?q�	�A�W3P�L��_ȶɮ�(LԿo�!���7]A'���Vk4Mt���Cg"�4�<_l�L��I��dT줡�KU�=�ޢ8�T��b�	���i��Fs�S�R�(K	T�s��7�H?s����h��?}�,��4{�oF��vG�_% *o�0=Cᑟax�Jr�d�Q���ex�H4C�/�<25�ǓP�����ـJ��X�=C)�Hx;����Ut�o��/Jy�=�PB,w\\?�#���1�	$2	7Ϊ�=�%��|@��U+�E6AT3�BqAZ��֜OjL
�%c�x4�֧��_ea����:�*�ֵ�%��d1�����D���1x���w�h�1�iv*j�I��
:u�½��<�wJ�A?�Krv��I`M�/'f��IVmU��ڿ������4�t��\��ACp7�m�9�
��\���1MT��m�^
,��	IW�pI��}���Ef	r|�9�Q�ػ��?Evt*N&7����;�)����\?�`��!*Äl�P�({>'���qұ�On�h�n���T5����5j
I��(t��rd�݈��/��nvј��=/`DK��5@0/�,��»�\������*�Dݎ�m���{˒$���Ŵd�@n�|���e����( �[�#k^8i���xIT_��̊���<�81y�|�~NЕ�5��;xxc���u�3.!��(�@�馳E+F|Z>!�[QjZ����*\v��~V���n����P��h�P@hy�C��;p
����U�c��9���u�'21V>>=���]�J�<Y�3�OE+f��Ʌ^��;i�TAZ�s���Ge����<lqiP}gW7���"7�������5��@ͯ�@Z�^�3
UmVc9N5�n7�{�ە�I�)\h ���S{36��(_�WB���0ݏ��1a�p-LJ����>=�F,�^���i�u����b��K/��5l*�	xXƭ�ϓ6;�ȩ�e>z��뇄ۼ+�,��8_c}��"<A�*��._xE�޼���:�Uq%q"��b�.[2���j��ܕ�_(��6�$��Ê�����g��v����y?nu#��~�}:�[՗��p��3�'v��	�:I,����E
!����
�,�Ob��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(���0p	p	%8���o���E���o((0TXX@^B���h��c��`n  Pw`#`#��}<
<

�`
`
� �������	��(�( ��+!�+��+!�+��+!�+��+!�+��-!�-@�0!0p �p7!p7`��7ap7$
�7\�7�|=(lib-dynload/_statistics.cpython-38-x86_64-linux-gnu.so000075500000026420151153537520016447 0ustar00ELF>�	@�%@8	@�� XX X PX pp p 888$$���  S�td���  P�tdppp44Q�tdR�tdXX X ��GNU���:o�L
>q
j6��H @�MM���|CE���qX��  ��, �F"�����8�  %�  ,�  __gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libpthread.so.0libc.so.6PyFloat_TypePyFloat_FromDoublePyExc_ValueErrorPyErr_SetStringPyErr_Occurred_PyArg_CheckPositionalPyFloat_AsDoublelogsqrtPyInit__statisticsPyModule_Create2_edata__bss_start_endGLIBC_2.2.5vui	=X �` Ph h   �  �  @h  �p  ��    � � � � � � 	� � � � 	� 
� � � 
� ��H��H�� H��t��H����5" �%# ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a�������%� D���%� D���%} D���%u D���%m D���%e D���%] D���%U D���%M DH�ֹ�H�=L�������H�}H�D H9_���DH�}H9_���oH�}H9_�
�l$�D|$�Q���f.��D|$f(��l$�
f��fA/����5�fD/���f/��y�D-�fE(��D\ofE(�fDT%�	fE/��%�D-]fE(��D5W�EY��E\��EY��DX5G�EY��DX5A�EY��DX5;�EY��DX55�EY��DX5/�EY��DX5)�EY��DX5#�EY��D�EY��DX�EY��DX�EY��DX�EY��DX�EY��DX��EY��DX��EY��DX�fD.��YfA(��A^��Y��X�f.2�MH��8[]�q���fA/�sfD(��E\�fE(�fA/��fD/���fA(��d$�l$�t$(�\$ �D\$�L����~tfW�����~=c�DL$f(��@�DT$�DD$�l$ f/��d$(���\
�5\��Y��X5P�Y��X�Y��X5@�Y��X��Y��X50�Y��X��Y��X5 �Y��X��Y��X5�Y��X��Y��X5�Y��X��Y��Y��X��X�f.����^�fA/����AY��AX��^������D$����D|$�l$H���d$����H��81�[]��Z�)������f.HfD(��I����C����D$����D|$H���(�����D|$���f.�D|$f(����������D$�D����D|$�l$H������^����g�����\�����Y��Y��X�X��Y��Y��X��X��Y��Y��X��X��Y��Y��X��X��Y��Y��X��X��Y��Y��X��Xs�Y��Y��Xkf(��X��>������=����������fW��8����������@��UH��SH��8H�������H�>H�� H9_�P����DH�~H9_�w����oH�~H9_�����f���gfA/��m�5jfD/��Zf/��PfE(��X�D\GfA(�fT�f/������fA(��=3�Dr�D)�AY�fD(��D\��EY��DXT�EY��DX�EY��DX@�EY��DX��EY��DX,�EY��DX��EY��DX�EY��DX��EY��DX�EY��DX��EY��DX��EY��DX��EY��EY��DX��DX��EY�fD.�{'fA(��A^��Y��X�f.{6H��8[]�O���u�H� H�5GH�8����B���H���n����r���u���H�=� H�� H9�tH�� H��t	�����H�=� H�5� H)�H��H��H��?H�H�tH�� H��t��fD�����=M u+UH�=� H��tH�=� ����d����% ]������w��������H�=� �����H��H���_normal_dist_inv_cdf_statisticsinv_cdf undefined for these parameters_normal_dist_inv_cdf($module, p, mu, sigma, /)
--

Accelerators for the statistics module.
��?�?333333�?��Q��?^�}o)��@�E.k�R�@ ��Ul�@*u��>l�@�N����@�"]Ξ@nC���`@u��@iK��~j�@v��|E�@��d�|1�@fR��r��@��u.2�@���~y�@�n8(E@@�������?鬷�ZaI?g�El�D�?7\�����?�uS�S�?�=�.
@j%b�@���Hw�@jR�e�?�9dh?
>('߿��A?��~z �?@�3��?Ʌ3��?3fR�x�?I�F��l@����t��>*�Y��n�>ESB\T?�N;A+�?�UR1��?E�F���?P�n��@&�>���@����i�<�@�F�>�tcI,\�>�ŝ���I?*F2�v�?�C4�?��O�1�?��������;4��P��x����p����0���zRx�$��FJw�?:*3$"D�(\���E�D�DP�
AAEzRx�P��, 0�\
AAE�
CAA� ���GNU��Ph Ufv0
�X ` ���o``�
Ip �X�h	���o���o����o�o����o	p `p����������@����������  GA$3a10�_statistics.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug�!�1�7zXZ�ִF!t/���6]?�E�h=��ڊ�2N����> ���0`X��D���!��T����U��p�f���w*2���c|������?ݵ�2�L67�F5}>L�
��Z,�'���o\�j���W;��I���de�D`�C%T�}�d@�s,�U�\pI-�+99�jt��Jb
��}ݯ/~Y��Loߘ���W�bE�H
��y&����F;���V���̠g��q�����1	y5}�`6�g"�c؜G�lAB���6�(>Ը���S�u
�IF�B���ږ�J7X��
fp	,|jVj���i��� ���p��Mg�D��ƅ�ix$���M¢�!���1��8�~��b�CẢ8�4Chq���|��"}�L�ǀvH���1~Ur�HDڽ�t�����<l�oa�B�L?-U�U�d�-�E��A�Fr�r�?�Ĩ�e�;�O㫿��1T�����E|1ѿ���mNWow5��a�M���}��)b��#lI{{�nЛ��i�:t͕�v	��\nu�&�a����'�a��q����}�FmXH�תo\L����!�]KÊ�T{��lA��!T�s;?�V��A}%���2|G�y�I'��f�u����;�rV�5�ot �nxz
W�Ȩ����t�7F��j�Ns{�$(�0x�|b�%ݑ��x�w�~���_�I/�(��ڣ��0S׳f��C���/12S�T�󧕲�X,�	��c��ߵ��*�K�`-�-U��R��)Iz�;�,��<�ä�h@k�����s�S���
�)8X�p�I�;1�����_˩ !9�RkN�yź"����M]���g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(���0``I8���o��&E���o�� T��h^BXX�h00cPP�n���w�	�	5}��
���� �pp4������� �X X�` `�h h�p p�p p��   � ��  � �� `� $
� d0!x�$(lib-dynload/nis.cpython-38-x86_64-linux-gnu.so000075500000037020151153537520014705 0ustar00ELF>�@�6@8	@`%`% �+�+ �+ �� �,�, �,   888$$@%@%@%  S�td@%@%@%  P�td�"�"�"llQ�tdR�td�+�+ �+ ppGNU	��* ��%�q�H���h�+"%�H %'(��|CE���qX�0o���� 2�� ��, �F"hq��/��G��\P`��'z���1 �X1 �X1 U`__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libnsl.so.2libtirpc.so.3libpthread.so.0libc.so.6yp_get_default_domainyperr_stringPyErr_SetStringPyUnicode_FromStringAndSize__stack_chk_failxdr_stringxdr_pointerxdr_enumPyEval_RestoreThreadPyUnicode_DecodeFSDefaultAndSizePyErr_Clear_Py_DeallocPyEval_SaveThreadPyDict_SetItemstrcmpPyArg_ParseTupleAndKeywordsPyDict_Newyp_allPyUnicode_EncodeFSDefaultPyBytes_AsStringAndSizeyp_matchfreeyp_masterclnt_createclnt_spcreateerrorPyList_NewPyUnicode_FromStringPyList_AppendPyInit_nisPyModule_Create2PyModule_GetDictPyErr_NewExceptionPyDict_SetItemString_edata__bss_start_endGLIBC_2.4GLIBC_2.2.5LIBNSL_1.0TIRPC_0.3.0�0ii
�ui	�f `/��rP�{	��+ �+ ��+ �+ �+ ��+ ��+ ��+ ��+ ��+ �, 	,  , (, &8, 9@, BP, WX, Rh, _p, f0 �0 v0 `! 0 �(0 K80 � @0 �H0 X0   `0 �h0 �x0 ��0 ��0 @"�0 0 1 � 1 �(1 �01 �@1 �H1 ��/ �/ 
�/ 
�/ �. �. �. �. �. �. / / 	/ /  / (/ 0/ 8/ @/ H/ P/ X/ `/ h/ p/ x/ �/ �/ �/ �/ �/ �/ �/  �/ !�/ "�/ #�/ $��H��H�i H��t��H����5: �%; ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h ��������%% D���% D���% D���%
 D���% D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%� D���%} D���%u D���%m D���%e D���%] D���%U D���%M D���%E D���%= D���%5 D���%- D���%% D��H��dH�%(H�D$1�H���0�����t������H�=� H���v���1��H�$H��1�H���H��H��H�q��d���H�T$dH3%(t���H�����U�@H��SH��Q�����t H�sH�
����H�����������Z[]���P��|���Z���������UH��SH��Q�����t H�sH�
�����H���d���������Z[]���AWAVAUA�ATUSAR����A��I�yM��I����I��D���o���A�|$t$��~�E�Hc�A�<D��~�K�Hc�A�<6D�Hc�L�����Hc�L��I�����H��M��tH��u6���M��t
I�uL������H��tH�MuH���������I�D$�LI�<$H��L������I�A��uL�����H�MuH�����E��t������E��I�D$@��D��ZD��[]A\A]A^A_�AWAVI��AUATI��UH�-� SI��1�Q�H�}H��t<L�����L�}��tL��L��H�������uHc�M��Hk�A�LA�$����ZL��[]A\A]A^A_���UH��H�
� H��SH�H��HdH�%(H�D$81�H�l$I��H�D$I���������H�\$H��u'H���T�����t�����H�=� H����������H��H��t}H�<$H�t$(H�l$ H�\$ H����H�D$����H�l$H�$�f���H�|$H�4$H�T$H�D$0�~���H�|$0���2�����t%H�uH�������j���H�=3 H������1�H�L$8dH3%(H��t�a���H��H[]���ATH��H�
� H��UH��SH��HdH�%(H�D$@1�L�d$0H�D$0ATL�L$ L�D$�{���ZY��t5H�|$���H��H��t#H�T$ H�t$H�������uH�uH���0���1���H�l$(H��u8L�����A�ą�t)H�uH������D���{���H�=D H�������H�|$H���~����<$H�D$tH�D$ �����L$ H�T$L�L$H�t$H�|$(I��L�D$0���L�������H�uH������<$t�L$��t��1���H�=� H������H�|$0Hct$���H�|$0H���E���H�L$8dH3%(H��t����H��@[]A\���ATH��H�
� H��UH�lSH�� dH�%(H�D$1�H��H�$I��������H�$H��u'H�������t���=���H�= H�������H�$H�-. L�d$H�D$H�D$H�|$H����H��H�]�H����H�|$L��H���<�����W�H�L$H�߾)� L�cH�m���L�
q �5�L�r���H�-] �5gA�$Z�H�߅�YH�KHE�Q H��ts�}umH�|$���L�eM��uh1���H�=  H�5���H�
#�����I���H��H���C���H�|$��H�=� H�����H�|$1��x����u1����H��H��t�I�<$����H��H��t$H��H������H�u��y'H��H�uuH���2���H��K���H���!����>���H��H�uuH������M�d$M��u�H�T$dH3%(H��t���H�� []A\�H�= H�� H9�tH�v H��t	�����H�=� H�5� H)�H��H��H��?H�H�tH�= H��t��fD�����=� u+UH�= H��tH�=�
 �i����d����m ]������w������U��H�= SQ�(���H��H��t9H���H���1�1�H�=\H�����H�. H��tH��H�5BH���7���H��Z[]���H��H���s|s:catUs|s:match|s:mapstcpnis.errorget_default_domainniskeymappasswdpasswd.bynamegroupgroup.bynamenetworksnetworks.byaddrhostshosts.bynameprotocolsprotocols.bynumberservicesservices.bynamemail.aliasesethersethers.bynameNo NIS master found for any mapget_default_domain() -> str
Corresponds to the C library yp_get_default_domain() call, returning
the default NIS domain.
maps(domain = defaultdomain)
Returns an array of all available NIS maps within a domain. If domain
is not specified it defaults to the system default domain.
cat(map, domain = defaultdomain)
Returns the entire map as a dictionary. Optionally domain can be
specified but it defaults to the system default domain.
match(key, map, domain = defaultdomain)
Corresponds to the C library yp_match() call, returning the value of
key in the given map. Optionally domain can be specified but it
defaults to the system default domain.
This module contains functions for accessing NIS maps.
;l���� ��������� (�HD�����������|���@�����zRx�$`� FJw�?:*3$"DX�\P�vH m$t��?E�I�D jAA���EK$���:E�D�D jAAD���F�B�B �H(�A0�A8�B@�8D0A(B BBBD$��wB�B�E �B(�D0�H8�F@L8D0A(B BBB(l��+E�N�K`
AA8���F�N�H �Dh`pPhA`@ AAB<�4���DF�N�H �D@�HTPEHK@" AAB$����`E�M�A JAAGNU���+ ������	&9BWR_fUfr��`
p�+ �+ ���o`p�
��. H(
 	���o���o�	���o�o`	���o(�, ������� 0@P`p�������� 0@P`p���v`!�K� �  ����@"��������0 ������GA$3a1`}nis.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug�l�7zXZ�ִF!t/��o�]?�E�h=��ڊ�2N����~ �����jf��y�򸗨��Fv�.&$PYf�EMW4��G�^XZS�3*��n�ȃP�U太�5��l��Z�"�0����zZ�W>�렡�6���	�^�"�f�e�s�	D	dS-lĆM� ���
D����j��y�R�$���ޑ"�8}���h��F��=PS��h��4�r:�>$a�}"���?���v�9��2ĈD+g/��T���EI}C�#Ǭ�B���eO�_5�X�����vɨ"8�d���P&�w7z�̒�"��	��v��^�t�8��>^�J~J�s����D��(���PkQ��N&�tʩg��iċ����:h�	(�vUl{�1���g��|=0��x��j���S*�s��)Ɨ
Oa[]6U]R�˸�J�u3Ŧ�*���j����#.��BB�!�G|����$�Q󘝓�����վ�G�7��� �Dp��C��-�Jp���+��GB�ww�2�AF��g�֗�M�R�f��*[�	�����Mei���@���SԪ˄VG>u^�=�J�ܭ�#����NJ���P�9)�Ԟ�n0ao�کy]��lp�x�M'�	h��uyJ�Fc
�Hz3�\�h�#���SY��_���Gm[v��H��.��
J��2���I�M�y������w�> A����	�629��Ƨѱ�AO~���7�#b��gK{��vCړj�rCK�?>���&�+��eJb��f�J�f��*�o�]��Q|f����a�a},1(��V�e���Ź���V��6�@+�0=+�bA|wFwAϪ�
��^������K�p���k�������̼l���J�{�Z��j�R����m�������&s��T6K&X��xl/���������I%����,Y��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``4(���0pp�8���o`	`	RE���o�	�	pT(
(
 ^BHHh``c�� n��w���}pp
��� ��"�"l�##<�@%@% ��+ �+��+ �+��+ �+� ��, �, ��. �.@�0 0X �`1 X1(��1`X1$
|1\�1��5(lib-dynload/math.cpython-38-x86_64-linux-gnu.so000075500000213710151153537520015047 0ustar00ELF>07@�@8	@���� �� � �
�
 ���� �� 888$$������  S�td������  P�td � � �LLQ�tdR�td�� � ��GNUJt�λ�-:�ψ�9^.�n
bf�H!�fhj��|CE��
�T��qX���HIERf7���(����P�b{ ���V\�� ����@�, ��~�F"�����s�f��z��+�4j������=��PlW��8�,�l���\�=���.������!z�!, ����!�`�__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalizelibcrypto.so.1.1libm.so.6libpthread.so.0libc.so.6sqrtPyFloat_TypePyFloat_AsDoublePyFloat_FromDoublePyErr_OccurredfmodroundPy_FatalErrorfloorlog__errno_locationPyBool_FromLongpowPyObject_GetIterPyIter_NextPyLong_TypePyLong_AsDouble_Py_DeallocPyMem_Realloc__stack_chk_failPyMem_FreePyMem_MallocmemcpyPyExc_ValueErrorPyErr_SetStringPyExc_MemoryErrorPyExc_OverflowErrorPyLong_FromUnsignedLongPyNumber_MultiplyPyNumber_IndexPyNumber_SubtractPyObject_RichCompareBoolPyLong_AsLongLongAndOverflowPyLong_FromUnsignedLongLongPyNumber_FloorDivide_PyLong_OnePyLong_FromLong_PyLong_Copy_PyArg_CheckPositionalPyErr_Formaterfcerf_PyArg_UnpackKeywordsPyLong_AsLongAndOverflowmodfPy_BuildValue_PyLong_GCDfrexpPyErr_SetFromErrnoldexpPyExc_TypeErroratan2PyObject_FreePyObject_MallocPyErr_NoMemory_Py_log1p_Py_CheckFunctionResult_PyObject_MakeTpCall_PyObject_LookupSpecialPyType_ReadyPySequence_Tuplelog2log10_PyLong_Sign_PyLong_NumBits_PyLong_RshiftPyLong_AsUnsignedLongLong_PyLong_LshiftPyNumber_AddPyType_IsSubtypePyLong_FromDouble_Py_NoneStructfabsexpm1atanhatanasinhasinacoshacosceilPyErr_ExceptionMatchesPyErr_Clear_PyLong_FrexpPyArg_ParseTuplePyNumber_TrueDividePyInit_mathPyModule_Create2PyModule_AddObject_Py_dg_infinity_Py_dg_stdnan_edata__bss_start_endGLIBC_2.2.5GLIBC_2.14GLIBC_2.4p ui	��@����ii
�ui	�fui	�� `��  � �  � @� 5�H� j�`� ?�h� /�p� p�x� x�!��! �!�� !��(!�8!`�@!��H!�X!�`!��h!��x!���!���!���!@��!q��!��!���!���!���!@��!���!@��!��!��!��!� !��(!��8!��@!��H!`�X!`�`!��h!Бx!��!w��!�W�!���!���!��!���!���!��!`��!m��!pc�! �!��!@�!�� !��(! �8! �@!��H!�dX!��`!�h!�x!@��!f��!p��!���!��!0S�!��!'��!�B�!`��!;��!Ч�! �!6�!�R!�� !�(!@�8!`�@!�H!��X!��`!�h!P�x! ��!(��!R�!���!.��!�B�!@��!4��!P]�!��!k��!T�!��!:�!��! � !��(! �8!��@!A�H!�X!�`!G�h!�x!���!M��!��!`��!R��!�P�!��!b��!��!���!W��!p��!@�!��!P�! � !��(!��8!��@!��H!�X!��`!5�h!�ax!@��!���!���!��!���!���!���!_��!���! ��!e��!P��!�!|�! |!@� !,�(!�K8!`��!���! ��!!�!���!��!��H!@� P!e��!`� �!��  � (� 	0� 8� @� H� P� X� `� h� p� $x� %�� '�� )�� *�� ,�� -�� /�� 5�� >�� A� B� D� Q� j� d� e�� �� �� � � � � 
� 
� �� � � � �  � (� 0� 8� @� H� P� X� `�  h� !p� "x� #�� &�� (�� *�� +�� .�� 0�� 1�� 2�� 3� 4� 6� 7� 8� 9� :�� ;� <� =� ?� @ � C(� E0� F8� G@� HH� IP� JX� K`� Lh� Mp� Nx� O�� P�� R�� S�� T�� U�� V�� W�� X�� Y� Z� [� \� ]� ^� _�� `� a� b� c��H��H��� H��t��H����5� �%� ��h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h	��Q������h
��A������h��1������h��!������h
��������h��������h������h�������h��������h�������h�������h�������h�������h�������h��q������h��a������h��Q������h��A������h��1������h��!������h��������h��������h������h �������h!��������h"�������h#�������h$�������h%�������h&�������h'��q������h(��a������h)��Q������h*��A������h+��1������h,��!������h-��������h.��������h/������h0�������h1��������h2�������h3�������h4�������h5�������h6�������h7��q������h8��a������h9��Q������h:��A������h;��1������h<��!������h=��������h>��������h?������h@�������hA��������hB�������hC�������hD�������hE�������hF�������hG��q������hH��a������hI��Q������hJ��A������hK��1������hL��!�������%E� D���%=� D���%5� D���%-� D���%%� D���%� D���%� D���%
� D���%� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%}� D���%u� D���%m� D���%e� D���%]� D���%U� D���%M� D���%E� D���%=� D���%5� D���%-� D���%%� D���%� D���%� D���%
� D���%� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%�� D���%}� D���%u� D���%m� D���%e� D���%]� D���%U� D���%M� D���%E� D���%=� D���%5� D���%-� D���%%� D���%� D���%� D���%
� D���%� D���%�� D���%�� D���%�� D���%�� D�F�aZ1�H���1�H���H�=�|���1�H���1�H���1��~M��H�-%� H�5��1�H�}����EH��1������6L�(� H�5A�1�I�:�o����H���D$�����D$f��~-ʠ��D$�H�+�H������	I�,$uL��1������1���H�|$�|����H�|$E1��j�����H�+�vE1�H���P���M���bI�.�XL���5����KL���(���H����M����L�T$M�L�\$I��M��QL������mH�|$����uH�|$E1������LH�|$���������L������<H�|$����|H�;L�k���H�D$H��tOH�D$L�5�� L9p���H�+��������H��L�����I�/I���1L���=����$��L$�T$�B���f.:��T$f(��L$�`a�Za�D$�3����T$�L$H���d$upI���Ba�aI���gaH���Y`�d$�L$�T$����f.���T$�L$�d$�va�pa���H���a��`�`H�+uH���Y���I�m��E1��heH���>����b�D$�.���I��H��trL��H�����I�.H��uL���
���I�/uL�����H���4dI�m�eL������cH�������NcI�,$�idL��1�����dI�/uL�����I�m��dL��1�����cL������d��1�H�T$dH3%(uH��(�����1�Z�H�ֹ�H�=ݚ�r�������H�;H�k�~���H��H��tlH���n���H��H����H��H���G���H�+uH��H�D$��H�D$H�m�K��H��H�D$����H�D$�0H�����1��!�-1�H�L$dH3%(uH��(�����H�*� H�:�����d�"�eH�=&� H�5xH�?����1���H�}H�5-� H9wu
�o���D���t$fT�fD.��Bm�"�am����anL��H�$�	���H�$�Lnf(���m1�1�1��l����������pE1��4pH��D�$����D�$���M���H���L�;H�kI�O����AE1��OE����I�/��L���j������$�dA�����E���o"I���#H��trL��H��L)�H���I���H�+I��uH������M��taL��L�����I�.H��uL�����I�muL�����H����#A��A�����!M���� H�+��#H������#I�m��#L������#H������#H������"H���x����!H����B#��H��1��Z����!H�� H�:�V�����$H�5� H�>�B����%I�.uL������L�l$I�]H�$H��I�]u
H�|$���I�/uL����I�,$uL�����H�m��<H��E1������g)I�/uL�����L�l$I�]H�$H��I�]u�H�|$����H�(u�H������L����4L���I�*u�L���j����u���H���]����N4H�|$�N����'?H�|$�?����>L���2���H��uI�.�m@L�������`@H��L����I�.I���q>L������d>H�|$E1�����>H�|$E1������>H�|$�����"@H�\$L�+L�l$I��L�+�$@H������u>H�|$����@H�+��?H���v����?H�|$�g����>H��H�;~?H�kH;-n� �i?���H�D$H����?H�t$H�A� H9^�V>�>�6?H��� H�:�����n1���p1��MqH�+��DH��E1�����BE1��9C�<��L��!�C�T$fT�f.���K�"�KH�;���-���$f.�{sH�{�l$���D|$�D$fA.�{W����~5O��D$�
��H���fDT�fA.���J�DT$fDT�fA.���J�Ju��Iu��IfDT�fE.���L�"�;MH�;���
��$f.��\M�BM�QMf���H��f(����fT
��f.�rf��f/�vH����f.�z
f/u�v:H����D$����D$f���!f.�z
���t���������!��@��H��� H9Fu�F1�f.�@����H��H����f.�{1�f.�@��H���b�u��D$���D$H���j���@��AWH��AVAUATUSH��XdH�%(H��$H1��0�H���9�f�L�l$@I�Ľ M���t$�t$1�I��f�L���h�f��~-<�H��H���0H�@H;� ���CH�+�&�M���1M��O��f(�E1�L��L)������Af(�fT�f(�fT�f/���f(��X��|$8�DD$8�D\��DD$0�DL$0�A\��L$(�DT$(fD.�z��D\$(�T$8I���G�I���AfD(�fDT�fD(�fDT�fE/��fD(��DX��Dt$8�D|$8�D\��D|$0�d$0�\��L$(�L$(f.�z��|$(I�xI�Y�T$8I���C<�L9��	�fD(�I��fDT�fD(�fDT�fE/�wwfD(��DX��DT$8�D\$8�D\��D\$0�Dd$0�A\��L$(�Dl$(fD.�z���Dt$(L�G�T$8L�K�E4����ff.�f�fD(��DX��D|$8�\$8�\��\$0�d$0�\��T$(�L$(f.�z�}�|$(I��I�Y�T$8�C<�M9�tI������f(�1�f.�z�o���f(��5�fT-��f.���H9��"L�{�A��>���ff.�I���T$8L��M9�u��H;}� H�����f.o�H�h�f��~-<�H�T$���������f�f��~-�H����H�+���1��/�;�fE��H��H��u��D$fA.���H�D$8M����I���G��DT$8M�����Dd$8I���G,�J��fE(��EX��Dt$8�T$8�A\��T$0�D|$0�E\��Dl$(�\$(fA.�zt�M��tj�d$(fD/����L$(fA/�vL�A|�fA/�v>�DD$(�DL$8�l$8�EX��EX�fA(��\��T$0�D$0fA.����D$8���H��I�,$uL�����M9���H��$HdH3<%(H����H��X[]A\A]A^A_�fE/\��c����C���H�H9��;�H��������H9��H�4��T$M9���L���
�H����I���T$���fD(�fDT�fA.���fD.�v�DL$�DX��DL$�XD$�D$���������DL$8���K�L���3������DT$fE.�zE�D$��H������H�����I��H���R�H��L��H�����T$����H��� H�5֌H�:��������k�����|���ff.��H��H)�H��H��H���w{I��L��I��@wnL�_L9���L��H�WH9�vAL��H�OH9�v4L��H�GH9�v'L��L�G
L9�vH��M��H9�v
L��H��H9�w�L����ff.�AUATUSH�H��H�k�I��H��I���I��I���I��I���I��I���
I��I���H��H����H��H����I��I����I��I��	��H��
A�
t
I��H��u��H��I��L��H�����I��H���V�H��H��L�����H��H���&�H��L���N�I�,$H�����L����H�+uH����H��H��[]A\A]�ff.�����A��p���A��e���DA��U���A��J���A��?���A��4���A��)���A�����A�	������AWAVAUATUSH��H��8dH�%(H�D$(1�H���WH�>L�n�%�I��H�D$H���L�5ճ L9p��L����H�D$H����L9p��I�L����H�x�~H��H�����I��H���~H�x�81�H��H��������I�m����KH�|$H�t$$��I�ċD$$����I����#M���H�\$H�3I����H�L$H��H�1I���I��I�ο�sf.�L����M���J�H����I��H���/�H��L����I�.I����L���{�I�m���M����H�}I��I9���H��� H��L��H�2��I�.H����H���
�H��L����I�/I���T���M�����H���c�I��H�����H��L���\�I�.I��uL�����I�m�`�����H�\$I��H�+��L�D$M�L�L$I��M����L�T$M�L�\$I��M�t{H�T$(dH3%(L����H��8[]A\A]A^A_�H�|$L�l$H�/������L�|$H��I�7H�t$H�H�D$H��H��u�H�L$H�H�\$H��H�u�H�|$���v������I���H�\$H��� �H�I��H�y�H�L$H�;H���?�M���
L�d$L����H�D$H����L�D$M9pt5H�l$H�����L�UI��L�T$I��L�U�|�L�|$M���G�L�\$I�{��L�|$I�xIH�t$H�|$��I��H��tIH�x�L�t$1�H��L����������L��L�l$���H�-�� H�5�dH�}�e�L�l$I�}H�|$H��I�}���L�D$M�L�L$I��M����E1��!���H�8� H�5dH�:����
���H�ֹ�E1�H�=������������L�%~� H�5d1�H��������I�<$�*��P���L��D$�)��D$���I�muL����1����I������H�������L�t$M�&L�d$I��M�&�,����_�fD��H��(dH�%(H�D$1�H��� H9FtxH�����f.��{mf(��
�fT��f.�ru�D$����D$H�|$��.�H�D$dH3%(u?�L$H�=҄�H��(���F�u��D$�_��D$H��t�����f.�v9H�D$dH3%(f(�fT��u�f(�H�=n�f(�H��(���f.��B���H�D$dH3%(u�f(�H�=7��H��(������H��H�a� H9Fu&�Ff(�fTj�f.…w31�H�����H���m�f.e�{3f(�fT
7�f.
��v�fPЃ���H�H����H����u��I�H������ff.���USH��H��H���~�H�>H�n��H��H��t=H���
�H��H��t#H��H�����H�+���H�mtH��[]�H�+���1�����ff.�@��H��(dH�%(H�D$1�H�1� H9Fuk�Ff.�zxf(�fT
4�f.
����w_f��f.���Eʄ�uMH�|$���H�D$dH3%(uZ�t$H�=���H��(�2�f�H����f.�{f.�{��D$�u��D$�����D$H��t������ff.����ATUH��SH�� dH�%(H�D$1�H���H�>H�=� H9G��OH�~H�W�L$������H�t$����t$H���H���g��D�d$�Dl$H��E����fD.-�����~�fA(��5�fT�f.���H�������H������EfA(ʼn������~%��fD(�fAT�f.%����M�����j��H�L$dH3%(��H�� []A\�ff.�f��[��f.S�f(���H�}�l$L�GA������H�t$�c���t$H���H���AD�d$�t$�P���Dl$E��H����fD.-́�4�~=��fE(��D
�fDT�fE.�rmH�������H������EfA(ʼn�����D~f�fD(�fET�fD.����D�ME��udfA(��:�������E����E��fD.-%��7�D%n�fE(�fDT�fE.�r�fDT-��E"fDV-�fA(��Dl$�I��t1��Z����Dl$�t����E"���t$H�������t$H�������1�� ��������P����P����D$����l$H���6���1��������H�ֹ�H�=
�j�������1����E�������fD.-!�{0�D=n�fE(�fDT5�fE.�����fDT-�����u�����������D��AWAVAUATUSH��H���dH�%(H��$�1�H����L�>H�nI�G����7H�U�����L�eM;g��I���f��M����E1�E1�H�L$0H��H�5� f��E1�1��~'�fD(�I�|�L�WI9����OH�|�L�_I9���\OfA(�fAT�E1�f.���A��H��E	�f/�vf(�L9�|�fT�f.%vVH9��E���$E���-f(����H��H��$�dH3%(H����H���[]A\A]A^A_�E��t
��~�f�f.�A��DE�E��u�I���w���f(�H��L��H�L$D�D$H�$�p7H�$D�D$f(�H�L$�C���H�
� �=
~H�D$�<$L;\$H�L$(�T$ �L$H�T$D�D$�����f.$�~-�~D�D$H�T$�L$�T$ fD(�H�5f� H�L$(��\�f(�fT����L�
{� H�L$(�T$ L�L$H�T$D�D$M9�������5S}f(�f.��4$�~-~D�D$H�T$�T$ H�5� H�L$(fD(���H�|�L�_I9������G�`���E1�E1�J�<�D�$����H�L$0H��H����D�$�k����%��H���T$D�$���D�$�T$E������I�/����L���$�i���$����������D�D$H�T$�~-B}H���L$�T$ H�5� H�L$(fD(�uQ�$����1���W��������A��D�D$H�T$�~-�|H���T$ H�5�� H�L$(fD(��rH9����E���/E���=1���������H�=�{f.�{f(�H�<$�f���H�-� H�5�XH�}1���������H�m����H���$�V���$���L������A�I��H��t�H�uE1��tqL�eM9gu�I���=���M������f���S�����H�ֹ�1�H�=�y������J����/�H���|��H��H������E1�A��H��D�$A��S��D�$H��H���m����	�I�/����L���|�����H�m�����H��1��b�������������AWH��AVAUATUSH��(���H���?H��H���������H��������#H���2��H�����L�h�L��H��H�D$I��?��L��H����A�L�t$I��H��I�u�I�����I��H����H���k��I�/H����L�����H����UH��H��1�H��>H��;D�GI��1�F�@H��H��5I��1�B�4�H��H��)��H����1��H��H��H��H����D)�H�H���y��H��H���A���sM�}L�|$L�|$H�t$D��H��I��L)�L)��<��H���
��H��H��H�D$�3��H�|$I��H�/�q�����M������L��H��L)�H�����H�+I���l��H���|��M������L��L���X��I�.H���d��L���S��I�m�`��L���@��H���>A��M��A����,���H��H�����I��H���F��1�H��H���r��I�,$A������L������A������E����H�m�N��H��(H��[]A\A]A^A_�L��A�H���UA�L$�����ff.�@H��H�����I��H������1�H��H������I�,$A�����L���V��A�������E���j���I��L�
�� H��I�1���I�mH���G���L������:���H������H�mH���p��H����,L�T$H��1�Ak���>H��H��I��H��;D)�H��>D�~I��1�F�,xL��H��5I��1�F�4�L��H��)E��I��A��1�A�L��H��L��I���H�H��I��L��I��I9�@��H��(@��H)�[]A\A]A^A_���L��A�H��	�����A��H�t$D��H��H����������b��H��������I������L��� H�5�SI�:�y��H�m����1�����H�m�B��H��(1�[]A\A]A^A_������H�����������H��(H�����f.�u�D${`����l$f���f.��Q�wvf.�{
f.���~%Yvf(��=�ufT�f.���f(�H��(�2��f�u��i���D$H�����D$����Q
'u�l$�f(��L$H�D$�l$����L$�l$H�D$f.�{f.�{{�~%�uf(��=ufT�f.�wSf.��]�������S�����!tD��"�/���D�tfD/��1���H�
�� H�5sH�9����1�H��(�fT�f.�r�H�=ڛ H�5�rH�?����א��SH��H���?��f.7t�D$���v���D$�H������f.�{�d$f.����4tf.��f.�r���uH��[���@��!����"�]����sf/�w�H�=�� H�53rH�?���H��1�[�f��_������H��u������#t���L$fT
=tf.��i���H�T� H�5�qH�:����H��� H�5�qH�8����L��� H�5�qI�8�m���n������AWAVAUATUSH��H��HH�~H�5�� dH�%(H�D$81�H9��"�r�����H������H��H����H�t$4H������H�mH��H�$���H����z�D$4���B����uH���lI��H���q�����H��H���0H�$H�H��H���BI��H���~M��I����I���A��
f.�M��I��M�Mu�I���I��H�$D��H��H����H��H��L�S�M��I����M��I����M��I���lL��H����L��H����I��A�tI��I��u�ff.�f�H��H)�H��H��H����'I��M��I��@�H�xH9���
H��L�xL9�vLI��L�HL9�v?I��L�XL9�v2I��L�p
L9�v%H��I��H9�vH��H��H9�w�ff.�����I��H������L��H�����I�.I����L���o��M���v��H�m�+H���S��L��L������H��H����I�,$�#L��I��I��L�����I���t)H��H�$D��H��H���d���I��I����B���@H�m�`��H������H�<$H�_�H!��GH�s��H!�t>H�S��H!�t0L�S��I!�t"M�B��M!�tM�H�H��M!�u��H�4$L��H)����I�,$I��uL���_��H�L$8dH3%(L����H��H[]A\A]A^A_�f�L��L�����H��H������I�,$����I��I��H��L��I����E�������f�H�H��L�Q�M��I����M��I����M��I����L��H����L��H����L��H����M��I����M��I����M��I��	�(I��
A�
tI��I��u�ff.��I��I)�M��I��I�����L��I��H��@��H�xH9��H��L�xL9�vLI��L�PL9�v?I��L�pL9�v2I��H�P
H9�v%H��H��H9�vH��H��H9�w�ff.�H�L$L�D$���I��H������H�L$I��I)�M��I��I���L�D$��L��I��H��@�wH�yH9��CH��H�qH9�vGH��H�QH9�v:H��L�QL9�v-I��L�A
L9�v H��I��H9�vH��H��H9�w�fD�[��H�����H�D$H��L�����I�/I��H�D$�)L������H�D$H�(uH������M���-��������H���A������f�A��e���DA��U����L��L��H�L$L�D$ L�T$�6��I��H������H�t$H�|$L�����H���y��H��L��H�D$���I�/L�T$H�L$L�D$ u0L��H�D$(L�T$ H�L$L�D$���L�D$H�L$L�T$ H�D$(I�*u&L��H�D$ H�L$L�D$����H�D$ H�L$L�D$H�L$(L�D$ H������L�t$H��H�D$L���&��M�H�T$I��L�D$ H�L$(L�L$I��M�u(H�|$H�T$ H�L$L�D$�Z��L�D$H�L$H�T$ H�*uH��H�L$L�D$�3��H�L$L�D$M���0��I��I)�M��I��I���wL��I��H��@�����I�I��M�Y�L��H����L��H����M��I����M��I����L��H����L��H���	
L��H���
L��H���
M��I��	�SI��
A�
tI��I��u�fDM��I)�M��I��I�����L��I��H��@�vH�yI9���H��L�QM9�vLI��L�qM9�v?I��H�AI9�v2H��H�q
I9�v%H��H��I9�vH��H��I9�w�ff.�L�D$L�L$���L�\$L�D$H�D$H�|$����H��L)�H��H��H����!I��M��I��@�I�xH9��I��I�pH9�vAH��I�PH9�v4H��M�PL9�v'I��I�H
H9�vI��H��L9�v
I��I��L9�w��l��H������L�t$H��H�D$L�����I�>I��H�D$H�|$H��I�>��L��L�\$����L�L$L�\$I�)��L�����L�\$M������L�����f�I�I��I�W�H��H���K
I��I���j
I��I���~
I��I����
H��H����
H��H����
I��I����
I��I����
I��I��	�
H��
A�
tI��H��u�ff.��L��H)�H��H��H����GH��I��H��@�6L�HM9�vmL��L�XM9���M��H�PI9���L��L�PM9���M��H�p
I9���L��H�xL��I9�vH��H��I9�w�ff.��H��H�L$L�D$���L�D$H�L$H�D$H�|$�C��I��M)�L��H��I�����I��M��I��@��I�H9���I��M�_L9�vAI��I�wH9�v4H��M�WL9�v'I��I�G
H9�vI��H��L9�v
I��I��L9�w�H�L$ L�D$���H������L�t$H��H�D$L�����M�L��H�T$I��L�D$H�L$ L�L$I��M�����H�T$H�L$L�D$�C��H�T$L�D$H�L$H�*����H���"��M���t����$��@H���h����A����L��L��L�\$���H��H�D$����H�T$L��H�����L�t$H������L��H��H�D$�4��L�T$H�L$H��I�*uL��H�L$H�D$���H�L$H�|$H�)uH�|$H���b��H�|$H���5��L�t$H��H�|$L������M�I��H�D$L�L$I��M�uH�|$H�D$L�\$���L�\$H�D$H�(uH��L�\$���L�\$M������L��L��L�\$�g���I�/I��H�D$uL��H�D$���H�D$H�(�������A��e�DA��U��K��df(�fTlef.���f(��$�4���$f.�����f(����I��H���?H�t$4H���}���I�,$H�$uL���
��H�<$���T$4����H�<$����H�<$���L�<$ff.�@H��_J�<�����I���I�H�muH�����L�,$I��I�]�L!������A�I����M�48I��M�V�L��H����L��H���+L��H���2L��H���aL��H���JM��I����L��H����L��H������L��H��	��I��
�
���H��I��u�����ff.�@N�41I��I�F�H��H���PH��H���uI��I���|H��H����H��H����H��H���I��I����H��H���
H��H��	��H��
�
t	H��H��u�L��H��L�L$L�T$L�D$����L�D$L�T$H��L�L$����L��L��L��H�D$L�D$(L�L$ ���H��I��H�D$�7��L��H��L�t$H�D$�G���H�t$H�T$L�D$ L�\$(H�D$H�.u&H��H�T$ L�D$L�\$聿��L�\$L�D$H�T$ H�*�����H��L�D$L�\$�V���L�D$L�\$���M�I��I�A�M��H��H����H��H����H��H���I��I���MI��I���6H��H����H��H���lH��H���L�I��I��	��H��
�
�5�H��H��u��'��H�H��L�R�I��L��H���8L��H���?L��H���nL��H����L��H����L��H����L��H����L��H���L��H��	��I��
�
t	H��I��u�L��H��L�\$ H�L$L�D$L�L$���L�L$L�D$H��H�L$L�\$ ����L��L��L��H�D$H�L$(L�D$ ���L�T$H���+��H��L��H�D$L�T$����H�t$H�|$L�D$ H�L$(H�D$H�.u&H�|$ H��H�L$L�D$�X���H�|$ H�L$L�D$H�/����H�L$L�D$�0���H�L$L�D$���H���i���I���!���H��H�L$L�D$�O���L�D$H�L$I�����L�����A���A���A��t�A��D���A��^�A��S�A��H�A��=�A��2�H����L��H�L$L�D$踹��L�D$H�L$��L��衹��H�����A�	���A��3���A����A�	��A�	����A�����A���A��|���A����A��{�A��p�A�����A��E���A��O�A����A����A��.�A��#�A��x���A��
�A��b�����h�����"�����:�������&����������"�������������������j��������������������8��.��������������|���������������������(���������	������
����	�<����	���	���������H�-/� H�5:1�H��������H�}�۷��E1�������H��u�|$4t�H�=c� H�5�9E1�H�?�9����U��/���L�-@� H�5y9E1�I�}�����1����ff.���AWAVI��AUATUH��SH��H��8dH�%(H�D$(1�H�B�H���_H�>H���[H�nH;-O� �J�t���I��H�D$H����H�$� H9X�H���J���H�D$H����H9X��I��H�x�1�H��L��I���,������{H�t$$L��臵���L$$H�D$���H�����H����M�7H���tI��M�7H���VL�l$L�%�� �M��H�D$H)�u}�)L���8���M������H��I��M��H;l$��I�4$L���n���I�mH������H������H��L���|���I�.I��uVL���۷��M���J��H��I��M��I�4$L������I�mH���t���H���x���H��L���*���I�.I���M���M�������H��I��M��H;l$����ff.�@H�+��H�t$L�L�D$I��L���L�L$M�L�T$I��M�����H�T$(dH3%(L���kH��8[]A\A]A^A_�L�|$L���/���I�?I��H�|$H��I�?�f���M���NL�d$H������H�D$H���_L�D$I9X��L�\$I�{��H�D$H�x��H�t$H�|$1�������2H�|$H�t$$�<����|$$H�D$��H�T$H�����H��tGH�L$H�|$L�1t&H�l$I��H�|$L�u�����H�\$I�����L�|$I��M�7����觵��I�����H��L�����I�����H�] H�5>4H�:�6���H�L$H�)H�l$H��H�)�Ͽ��L�d$I�$H�D$H��I�$�����E1��V���H�=� H�5KV1�H��������H�?�F����L�t$M�>L�|$I��M�>u��H������{���1����I������L�l$L���U���M�UI��L�T$I��M�U�d���L�|$M���I����*�������H��E1�H�=�U�����������Y���L�L~ H�5U3I�;�%����������H��蓴���8���ff.���ATH��USH��0dH�%(H�D$(1�H�FH�D$H����1�H�T$H�55U�W�������H�\$H�l$H�S�����H�{��H���Q���f.V��f(��-GVfT
�Vf.��uf�f/����B���轱��H��H��t	H���FH�L$(dH3%(H����H��0[]A\�H���1�H�L$H�T$H�5gT花�����3����ff.�f�H���h���f.`Uf(���$蜲���$�~V�5wUI���f(�fT�f.��l$��f��f/��4�c����D~�Uf.�fD(�{�D$fE.���fET�fD.UfA(��'�D5�TfE.��ZA�4$���0fA(��{���H��H������H�������H��H�5�����g.H��H���X���H��H���в��H�+I��uH���/���H�muH��� ���L���l��������M���H���3���H�=%| H�?�%����������8���H�t$ H��軱��f.�S������$��S����fE��L*|$ �AY��X$蛯��I��M���o���H���f���L�������D%�SfD.d$s[�D-�SfD.�r%A�<$tfA(��D$��D$����fA(�����e���H����臰���!H�
�z H�5�QE1�H�9�x��������n����$�T����$f��!f.�z�GS�!����AS����f���!f.�zluj�D�RfD.D$�{����D
S�G���L�
/z H�5�0I�9���E1��@���f.������f/VR�����賯���!�w���f.������D
�R���L��y H�5�PE1�I�8臰���j���f.�z
f/�Qv"�|$f.=DRfD(�f(�������d����!������$����$H���κ������f���ATUSH��H�5ހ H��H��肰��H���#购��I��H���;H��耮��f.xQ�D$��跮���t$�~9R�DR�f(�f(�f(�fT�fD.�wCf.�f(�{
f.���fD(�fDT�fD.LQ��f(�H��[]A\镬��D�H,�f��fU��D�P�H*�fD(��D��fET��A\�fV�f.�f(�z���>����Ŭ���D$H��uM�D$�߭���d$�f(�f(��t���H��H���+%H�mI��uH���9���H��L��[]A\�E1����D%Pf(�fT�fD.�r�H��w H�5�NH�:�z�������H��H������f.�O�D${K�;����D$��*���f.�{�d$f.�{\�~
�Pf(�fT�f.�Ow*H��酫��u�辫��H��uC����LP����l$�5�OfT�f.�r�H��v H�5�MH�8趭��1�H���ff.�@��H��H���0���f.(O�D${K�k����D$��ʪ��f.�{�d$f.�{\�~
�Of(�fT�f. Ow*H��鵪��u����H��uC������O����l$�5�NfT�f.�r�H�
v H�5
MH�8���1�H���ff.�@��SH��H�� H����H�>�R����-JN�$f.��
H�{�l$�,����D|$�D$fA.��o�_����~5�N�D$�
9NH���fDT�fA.����D$fD(�fDT�fA.��gf.�M�)fA(�fA(��DT$�D\$芩���DT$�D~5zNfD(��D\$fE(��D\�fD/�v]�$fAT�fV[N�AY�f.����~5$NfD(��
wMfDT�fD.��F����yH�� [��fA/�v�D~5�MfE(�fEW��fA(�fA(��D\$�A\��Y�L�Dl$躨���Dl$�D~5�M�X��D\$�D\��8���������D|$賨���|$H���f�|$�ɩ���~5QM�D$H���
�L�fDT��Dd$fA.���D2L�Dd$�w�������,$�>����$H����H�{�$�����$$�D$f.��g�$$�3����~5�L�DT$H���
	L�fDT��D,$fA.���D�K�DL$fD.
|K����������K�|$f.<${]��$�$�A����,$f.�zJ�\$f.�zRfD.�w��$$fT�f.�wU�;t��$����t�H�� 1�[��!�$���$�$�$�u����DD$�$�D$���$fA.��������^���H�ֹ�H�=�I轧����t�����$�n����D�J�D,$�3���������$$薦���D$H���I����DD$諧���DL$�DCJH����Dd$�D$fE(����$f.�z�Dd$�����$�Dd$�����SH��H��H����H�>����
�I�$f.��)H�{�L$輦���T$f.�{u�D$����DD$�~vJ�D,$�fA(�fT-mJfDT�fDV�fE.����D�IfE(�fDT�fE.���H��fA(�[����u��T$�N���H��u�D$�D$�h����DD$�~�I�D,$�fA(�fT%�IfDT�fDV�fE.��s����D$$fE.�z��!fA(��D,$�h�D,$���`���H��1�[������$貤��H��u��$H�{�L$�y����T$f.��F����@����%����D$fDT�fE.�������%���H�ֹ�H�=G�:������x�������f.�H�=	x H�x H9�tH��o H��t	�����H�=�w H�5�w H)�H��H��H��?H�H�tH�mo H��t��fD�����=�w u+UH�=Zo H��tH�=�i �٣���d����mw ]������w�����
8Gf/�vA�`f��f��H�=�DL�gD�Y��Y��X7�AX0H��H���u�f(��^��1�f��f��H�
�DH�)D�^��^��X�XH��H��hu��ff.�H��f(�1��
�Ff��)��H���^��Y�f(��X��\��X��X�f(�H9�|��\
jF�l$�X��c����d$H���Y��@��H��H�n H9F�����H���/���f.'F{�Y%FH����u��D$�'����D$H��t��q������H��m H9Fu�F�Y�E魡��H��H�����f.�E{�Y�EH��醡��u��D$蹡���D$H���������H���
�E�$fTGF�R���f(��X��L$����,����ʤ��H��#���T$Hc4�H�>���\IE�9E�Y��Р���~�E�$fT�fV
�EH���Y���\E��D�Y�蕠���~�EfW���Y�Df(������~�E���D�\��Y�D����~{E��\�D��D�Y�����~XE�[�����H��(f(��-�DfT$Ef.����\$�D$����L$�T$f.���DRDfD/��4f(��L$�T$����E����DT$�D
%D�A\��EX��D$fA(��\�C����fE��D\$�D|$f(��\
�C�|$fE(�fE/��D\%�C�DY��AX�vNfA(��|$����fT7D貢���D$�D$衢����C�\\$�l$�\��\�f(�f(�fT%�Cf.%MCw{f(�H��(�����Cf/�����f�f/�rJ�+����=C�!�f(��"���f(�fW=�C�f.�fH~�HK�BH�D$�|$�f���|$�՟���|$�"�i���@��H��H�!j H9Fu(�FfT.C�
�B1�f.�@��H��飝��H���+���f.#Bz�u��D$�4����D$H����������H��8f(�fD(��%'BfT
�Bf.�� f�f.��3fA(��L$�DL$�p����T$�DD$f.�����AfA/��VfD/�A���D
�AfA(��AX�fE/��l$��DT$�E\��E\��DY�AfA(��T$�D^T$�DD$�DT$ �����Dd$fE���Dl$�D$(fE/��lfA(��Dl$�_����D$�D$螛���L$�5HA�^t$�DAA�T$ �^�fD/��Y��^t$(�Y��\��t$�l�\
�@�D$���DL$�D^�fA(�fT=8Af.=�@wAfA(�H��8��A\�fD(��E\����� @�^�fD(�fT�@f.O@v��DL$�Q����DL$�"��S���f�f/�wE�J@f/��7����,�H�E<��H��D��g���f.��]���f/�?�O�������D
�?�!�6����D$�Dl$�B����Dt$(�L$ �%�?�D^��AY��AX��L$�L$f/�vw�\
\?�D$詛���DL$�DY�����Y
8?�D$�\
�?�}����DL$�D^��D^����f�f/�v~f(��T���fE���D^��w����Y
�>�D$�\
G?�*����DL$�DY��DY��/��������D$�ӛ���DL$fDT
c?fDV
z?�!����誛���D
�>�"���fD���������������ATUSH��H��H��PdH�%(H�D$H1�H���pH���lH����A�H�����H�;H�-�e H9o���WH�{H9o���OI�����%4>f�f.�z-�u&�����H�T$HdH3%(��H��P[]A\��~=5>f(��-�=fT�f.���fD(�fDT�fD.���fD(ɿ�Y��D\�fDT�fT�fA/�s��Y�fT�fA/��m���1�fA/�@���]���H�{H����H9o�v����gI��u|f�f/�� ���H�!d H�5zH�:���赘��H�������1�����L�aI�PH��A�1�L�+l H�D$(Pjj�,���H�� H��H���z�����%�<H�{H9o�X����Gf��f/��q���f/�������b����
���f.<f(��B����<����D$�
����T$H���"����J����T$�˘��f.�;�T$f(��
��������D$�—���T$�L$H�����1�����1����I������Ҙ��f���AWH��H��AVAUATUSH��HdH�%(H�D$81�H���]H����H����H����H�?諗��I��H����襘��H��H�����L�5�b L9u�L�|$H��L�������|$I����H�m�Y���L��跕��H��H����L9p��L��H���֖���|$uwf�f��f��L���I*��H*�H���Y��H*�f.�zuH�+I��u�H���0�����\�f��f/�sfW(;f��f/�sfW;�Y�:f/�s�L��谗��I��H���}���H��H���i���I�/H����H�+uH��辗��H���^L�%�a L9e��H�m�u�t$uH��芗��H�l$DL��蘔��I��H��t`H�HL9��L9��!���H��H��试���t$���
���f��I�/�H*��Y\$�\$u�L��� ���L���8���I��H��u�I�muL�������<���H����D$���H��H�L$8dH3%(H���rH��H[]A\A]A^A_�I��L���%�H��訖��H�+uCH��L��藖��M��t8L��誓��H��H��tRL��H������H�mI��t�H�+uH���_���M��u�1��4fD�|$�YxH�(�|$������U����k���H���T���I�m�2�����L�������!���I�muL������2���H�������L��衕��I��L����1����L���Ǖ�����H�YH�APA�L�Lg 1�H�D$(Pjj苕��H�� H��t�H��H�8�����H�h�,���I��H��t�H���|���H�E���H����ה��I�m�����L��E1��A����^���ff.��H���D$葔���D$���!tC��"�r���fT8�
71�f/�vH���H�
_ H�5�5H�9�X������H�=b^ H�5b5H�?�;�����@��USH��H��HH���)H�;H�-o^ H9o�H�oH�{H9o���W�~e7fD(��%�6fDT�fA.���fD(�fDT�fA.����d$ )\$�T$0�l$臓���L$0�D$�H��蝒��fD(d$�Dl$ fD(��Dt$fET�fE.����DL$�7����d$�8��H��Hf(�[]驑���d$8)\$ �T$�DT$0�l$����|$�DD$0��DL$f.�f(D$ �L$8��fE.�z{fD.�fAT���f.����E5fD.�{lfE�fE/�vfD/��<���fE/���fA/���fDW
6fA.����������!������4f.��������u�fD(�����f.��|$rA�
�4�DL$�DD$0藐����4�DD$0�DL$�l$f.���f�fD/���fD.���fE���j����X���f.P4f(������������D$�U����l$H��������f(��d$�����d$���/���H��H1�[]�f.����!����l$�ސ��f.�3�l$f(��9����3����D$0�Տ���l$�T$0H��u��~|4f(��%�3fT�f.��/����d$8)\$ �T$�t$0�l$谐���|$�DD$0��DL$f.�f(D$ �L$8�����fD(��3���fE.��(���fD.5�2�l����f����!�����t���f��fD/�vfD(����fE(����fD.�{ofT-�3fD(�������2�����C���fD.
�2z5u3��2���H�ֹ�H�=1臏�����h������fD(��m������������USH��H��H���kH�;H�-�Y H9o���o�,$H�{H9o��W�~�2f(��
42fT�f.����T$�+����L$�$�H��貍��f.�fD(�{@�$$�DD$fA.����!fA(��D$�:����D$��tH��1�[]Ã;u�H��fA(�[]�B����]���f.U1�$�/����)����_���H��������<$fT�f.��;���H��f(�[]��������f.�0f(��������D$�����T$H������N���H�ֹ�H�=`/�ō�����-����o����UH��SH��蒍��f.�0{R�D$�͍���D$H����Ճ;f(�uH��f(�[]�4����D$����L$��t�H��1�[]�u��D$�I����D$H��t���ff.����H��H�5���]���ff.�f���H��H�5���=���ff.�f���H��H�5������ff.�f���H��H�5r����ff.�f�f.�zl�~b0f(���/fT�fT�f.�wSf.%�/��wf��f.���E„�tN�~510fT�fV
50fT�f.
!/{)fVo0��~/�f.�wfT�/fV?0�u���։���~=�/fT�fV
�/fT�f.
�.zu	fV�/�fV�/���SH��H��H����H�;袋��f.�.�${jH�{芋��f.�.�D${e�ŋ���L$�$�H������f.�f(�zK�~*/fT�f.~.wL�;uiH��f(�[�	���u��B���H��t�H��1�[�u��.���H��t����D$fD.L${$���,$�=#.fT�f.�r��|����!f(��$�p����$��u��{���H�ֹ�H�=O,詊�����t������ff.����AWAVI��AUATI��USH��dH�%(H��$�1�H���ML�|$M��1�f��1��~.�=I�<�H�OH;
�T ���GfT�1�f.��AD��_�@��f(�H��	�L9�|�f(�fT�-f.-v;M9���f(�褈��H��$�dH3%(�;H�Ĩ[]A\A]A^A_Å����
�,�H;
zT �$��袈���j,�$�~=-f.�f(��;����d$�/����^����$�~-H���t$��1�M9��S������L���$����$�.���H�<�L�|$�و��I��H�������驐���ӈ���%�+�$�~�,f.�������`���f��f.���E„������I�������f(�L��L����f(�����͈���X������f.<+{魆��u��f.�H�GH�P8����$���H�H������S1�H��1�1��H��1�[H��餇��@��ATUH��SH�~H�����H�5,Z H��贉��H��H��t!H�����H�+I��uH��蓈��L��[]A\��Ɔ��I��H�������H�EH�
'R H�5�H�PH�91��J��������H��f(���*fT
4+f.�rAf��f/�v	H���˅���D$耇���D$f���!f.�{2�z*H���f.�z�f/�)w��H����X*�!��u��>*��ff.����H��f(���)fT
�*f.�rf��f/�v1H���;���f.�zf/u)w�ֆ���!��)H����D$踆���D$f���!f.�z���)t���fDAUA��ATI��UH��SH���(���f. )�D$���_����D$H���A��f.�{�l$f.����~
�)f(��)fT�f.�wpf.�r���uH��H��[]A\A]��!te��"�k����%�(f/�w�H�=�P H�5'H�?�܆��H��1�[]A\A]��U���脄��H���G������t$fT�f.�r�E��u�H�
�O H�5�&H�9莆���ff.����H��H��O H�5kO 1�����@��H��H��O H�5kO 1����@��H��H�zO H�5�O �������H��H�ZO H�5�O 1��d���@��H��H�:O H�5{O 1��D���@��H��H�O H�5�O ��!������H��H��N H�5O ��������H��H��N H�5O 1����@��H��H��N H�5�N 1�����@��H��H��N H�5SN 1����@��H��H�zN H�5�N 1����@��H��H�ZN H�5N 1��d���@��H��H�:N H�5�N 1��D���@��UH��H�5�U SH��AQ�F���H��t#H��H������H�+H��uH���%���H��Z[]��Y���H������H��M H�5�M H��1�AX[]����@UH��SH��H��(dH�%(H�D$1�H�G���t<H�������f.�%{2��要��H�T$dH3%(��H��([]�H�LM 1��]�����u��D$讁���D$H��t�H��M H�:脁�����R���藃��H�t$H������f.R%{N���D$�X%��f���H*L$�Y��XD$�Y�������H�
�L H�5�#H�9�i���1��<���u��D$�����D$H���̍���@��H��H�5������ff.�f���H��H�5B������ff.�f���S��H�=/S �ʂ��H��H������$�Q���H�5\#H��H������'%�2���H�5�#H��H����~���%����H�5!#H��H����~��1�������H�5x#H��H���~��1��|�������H�5`#H��H���~����H��[���H��H���Unreachable C code path reachedn must be a non-negative integerk must be a non-negative integermin(n - k, k) must not exceed %lldtolerances must be non-negativeExpected an int as second argument to ldexp.type %.100s doesn't define __trunc__ methodboth points must have the same number of dimensionsisqrt() argument must be nonnegativefactorial() only accepts integral valuesfactorial() argument should not exceed %ldfactorial() not defined for negative valuesmath.log requires 1 to 2 arguments���W�����������comb($module, n, k, /)
--

Number of ways to choose k items from n items without repetition and without order.

Evaluates to n! / (k! * (n - k)!) when k <= n and evaluates
to zero when k > n.

Also called the binomial coefficient because it is equivalent
to the coefficient of k-th term in polynomial expansion of the
expression (1 + x)**n.

Raises TypeError if either of the arguments are not integers.
Raises ValueError if either of the arguments are negative.perm($module, n, k=None, /)
--

Number of ways to choose k items from n items without repetition and with order.

Evaluates to n! / (n - k)! when k <= n and evaluates
to zero when k > n.

If k is not specified or is None, then k defaults to n
and the function returns n!.

Raises TypeError if either of the arguments are not integers.
Raises ValueError if either of the arguments are negative.prod($module, iterable, /, *, start=1)
--

Calculate the product of all the elements in the input iterable.

The default start value for the product is 1.

When the iterable is empty, return the start value.  This function is
intended specifically for use with numeric values and may reject
non-numeric types.trunc($module, x, /)
--

Truncates the Real x to the nearest Integral toward 0.

Uses the __trunc__ magic method.tanh($module, x, /)
--

Return the hyperbolic tangent of x.tan($module, x, /)
--

Return the tangent of x (measured in radians).sqrt($module, x, /)
--

Return the square root of x.sinh($module, x, /)
--

Return the hyperbolic sine of x.sin($module, x, /)
--

Return the sine of x (measured in radians).remainder($module, x, y, /)
--

Difference between x and the closest integer multiple of y.

Return x - n*y where n*y is the closest integer multiple of y.
In the case where x is exactly halfway between two multiples of
y, the nearest even value of n is used. The result is always exact.radians($module, x, /)
--

Convert angle x from degrees to radians.pow($module, x, y, /)
--

Return x**y (x to the power of y).modf($module, x, /)
--

Return the fractional and integer parts of x.

Both results carry the sign of x and are floats.log2($module, x, /)
--

Return the base 2 logarithm of x.log10($module, x, /)
--

Return the base 10 logarithm of x.log1p($module, x, /)
--

Return the natural logarithm of 1+x (base e).

The result is computed in a way which is accurate for x near zero.log(x, [base=math.e])
Return the logarithm of x to the given base.

If the base not specified, returns the natural logarithm (base e) of x.lgamma($module, x, /)
--

Natural logarithm of absolute value of Gamma function at x.ldexp($module, x, i, /)
--

Return x * (2**i).

This is essentially the inverse of frexp().isqrt($module, n, /)
--

Return the integer part of the square root of the input.isnan($module, x, /)
--

Return True if x is a NaN (not a number), and False otherwise.isinf($module, x, /)
--

Return True if x is a positive or negative infinity, and False otherwise.isfinite($module, x, /)
--

Return True if x is neither an infinity nor a NaN, and False otherwise.isclose($module, /, a, b, *, rel_tol=1e-09, abs_tol=0.0)
--

Determine whether two floating point numbers are close in value.

  rel_tol
    maximum difference for being considered "close", relative to the
    magnitude of the input values
  abs_tol
    maximum difference for being considered "close", regardless of the
    magnitude of the input values

Return True if a is close in value to b, and False otherwise.

For the values to be considered close, the difference between them
must be smaller than at least one of the tolerances.

-inf, inf and NaN behave similarly to the IEEE 754 Standard.  That
is, NaN is not close to anything, even itself.  inf and -inf are
only close to themselves.hypot(*coordinates) -> value

Multidimensional Euclidean distance from the origin to a point.

Roughly equivalent to:
    sqrt(sum(x**2 for x in coordinates))

For a two dimensional point (x, y), gives the hypotenuse
using the Pythagorean theorem:  sqrt(x*x + y*y).

For example, the hypotenuse of a 3/4/5 right triangle is:

    >>> hypot(3.0, 4.0)
    5.0
gcd($module, x, y, /)
--

greatest common divisor of x and ygamma($module, x, /)
--

Gamma function at x.fsum($module, seq, /)
--

Return an accurate floating point sum of values in the iterable seq.

Assumes IEEE-754 floating point arithmetic.frexp($module, x, /)
--

Return the mantissa and exponent of x, as pair (m, e).

m is a float and e is an int, such that x = m * 2.**e.
If x is 0, m and e are both 0.  Else 0.5 <= abs(m) < 1.0.fmod($module, x, y, /)
--

Return fmod(x, y), according to platform C.

x % y may differ.floor($module, x, /)
--

Return the floor of x as an Integral.

This is the largest integer <= x.factorial($module, x, /)
--

Find x!.

Raise a ValueError if x is negative or non-integral.fabs($module, x, /)
--

Return the absolute value of the float x.expm1($module, x, /)
--

Return exp(x)-1.

This function avoids the loss of precision involved in the direct evaluation of exp(x)-1 for small x.exp($module, x, /)
--

Return e raised to the power of x.erfc($module, x, /)
--

Complementary error function at x.erf($module, x, /)
--

Error function at x.dist($module, p, q, /)
--

Return the Euclidean distance between two points p and q.

The points should be specified as sequences (or iterables) of
coordinates.  Both inputs must have the same dimension.

Roughly equivalent to:
    sqrt(sum((px - qx) ** 2.0 for px, qx in zip(p, q)))degrees($module, x, /)
--

Convert angle x from radians to degrees.cosh($module, x, /)
--

Return the hyperbolic cosine of x.cos($module, x, /)
--

Return the cosine of x (measured in radians).copysign($module, x, y, /)
--

Return a float with the magnitude (absolute value) of x but the sign of y.

On platforms that support signed zeros, copysign(1.0, -0.0)
returns -1.0.
ceil($module, x, /)
--

Return the ceiling of x as an Integral.

This is the smallest integer >= x.atanh($module, x, /)
--

Return the inverse hyperbolic tangent of x.atan2($module, y, x, /)
--

Return the arc tangent (measured in radians) of y/x.

Unlike atan(y/x), the signs of both x and y are considered.atan($module, x, /)
--

Return the arc tangent (measured in radians) of x.asinh($module, x, /)
--

Return the inverse hyperbolic sine of x.asin($module, x, /)
--

Return the arc sine (measured in radians) of x.acosh($module, x, /)
--

Return the inverse hyperbolic cosine of x.acos($module, x, /)
--

Return the arc cosine (measured in radians) of x.This module provides access to the mathematical functions
defined by the C standard.x������_7a���(s(;LXww0�uw���~Cs����+���|g�!�?�?@@8@^@��@��@��@&A��KA��A���A��2�A(;L4B�uwsB�uw�B���7�Bs��6C�h0�{CZA���C Ƶ�;(Dl�YaRwND��A�i��A����Apq�A���A�qqiA{DA��A���@�@�P@�?���CQ�BWL�up�#B���2� B&�"��B补���A?��t�A*_�{��A��]�v�}AL�P��EA뇇B�A�X���@R;�{`Zj@'��
@intermediate overflow in fsummath.fsum partials-inf + inf in fsumcomb(dd)gcd(di)math domain errormath range errorpowfmodldexpatan2distpermk must not exceed %lldOO:logremaindercopysignpitauacosacoshasinasinhatanatanhceildegreeserferfcexpm1fabsfactorialfloorfrexphypotiscloseisfiniteisinfisnanisqrtlgammalog1plog10log2modfradianstruncprodstartrel_tolabs_tolmath__ceil____floor____trunc__@�?�9�R�Fߑ?��cܥL@@-DT�!	@�?�?��������#B����;��E@���H�P�?��7@i@��E@-DT�!	��a@�?��&�.>@@8�,6V��?0C�	�T�꿌�(J�?iW�
�@-DT�!@���������?�-DT�!�?�!3|�@-DT�!�?-DT�!	@;Lh`T��h@Y���^��!^��8(^��h4^���;^��B^����^��,�^���M`��Ta���b��H!b���%b����b��$	�b��X	c���	c���
Hc��hqc����c��4�c����c��$
%d��+e��T?e���Se���(f��Xkg���g��D�g����g���g���h��X�h���`i����i��4Pp���pr��@�w���x��`�y���z��	�z���
�~���0���x
Ј��0P���h��������������D�����`����0��������(P�������P�������� ���L@���|0��������`����p���������0��hP��<	���l	P���	��
���T
���h
���|
����
�����  ��|@��`�����H0��8
���X
`��l�������������,��@ ��T@��h`��|������������������� ������X������0��lzRx�$�P���FJw�?:*3$"D�U���\�����p���lD c�t���YH o
EzRx� Z��P�����hg ^
EL�Y��F̴��D �
E|�Y��0�����H0U
AL0d���H h
ET
Al�d��li `
E�XY��F�@���mH p
E/Y��F������H@�
AL��d��tF�E�B �B(�A0�A8�G�
8A0A(B BBBA$zRx��������,�X���Ht�j����B�A �A(�S0�(D ABBM����E0����zRx�0����$�X��4H�(l��:F�B�B �B(�A0�A8�Gp�
8A0A(B BBBA zRx�p������(BX��Sx����	�����	D������F�A�A �Jp�
 AABA�xX�B�B�IpzRx�p���$�X���`����F�H�B �B(�A0�A8�D�n
8A0A(B BBBA�U�B�B�I�$zRx��������,Y���$��o��8H0�
E^
JnzRx�0�Y�� Z
A�p���Hn
Ey
LzRx��Y��C(`�p��qE�A�G0N
AAAzRx�0�� )Y����q���H0�
G��Y��V
A����|D }
Al�Y��8 \���xE�A�G`�
EAE�
CAAzRx�`�� 4Y��@�p���E�A�G0�
CAAI
FAEE
EAE4�����A�D�D0x
EAEY
CAA4��@��0L��DX��0XDp���F�A�D �D@/
 AABNzRx�@���$X��=�����(����4E�G �
EEP
CAzRx� � �W��)H0���F�B�E �B(�D0�A8�G��
8A0A(B BBBA$zRx��������,yW��(�4���@��<c�Q��]W��,�P���F�A�D �F
ABAzRx� ���$W��L`	�q��xF�B�B �B(�A0�A8�J�J
8A0A(B BBBD$zRx��������,�V��l�	����H h
Em
A
p���H h
Eg
A|,
�v���F�E�B �B(�A0�A8�D`q
8D0A(B BBBAR
8H0A(B BBBE|
8C0A(B BBBE zRx�`������(V�� �
�z��H0q
G�
A(�V��(�{��HE�G j
AIz
CCL�V��L\�|��UF�B�B �B(�A0�A8�G��
8A0A(B BBBJ0SV���H����F�B�E �B(�A0�D8�Gp^
8A0A(B BBBA��V��CL ���B�E�D �D(�D@t
(D ABBBv
(C ABBAzRx�@����$�W����������������������
���
���0
���D
���X
���l
���
���
��0�
$��lE�K�E j
AAAcAAzRx� �� 3V��(0��,A�D�G@V
AAAzRx�@�� �U��0hD����F�D�A �DP�
 AABAzRx�P���$}U��:��������@������F�A�A �Q0�
 AABJ�
 DABA<����H ^
EU\�����H ^
EU,|`���mE�G0K
AH�
CAzRx�0� �T���,�p����E�G �
FE�
CA"U��E ����E��GNU�`� � � 5�j�?�/�p�x�Ufp�`-
�� � ���o`��
��� 8(&�x	���o���o0���o�oT���o��� �-�-�-�-�-�-�-.. .0.@.P.`.p.�.�.�.�.�.�.�.�.// /0/@/P/`/p/�/�/�/�/�/�/�/�/00 000@0P0`0p0�0�0�0�0�0�0�0�011 101@1P1`1p1�1�1�1�1�1�1�1�122 202@2P2�� ������`���������������@�q���������@���@�����������������`�`���Б�w��W�����������`�m�pc ���@����� � ����d����@�f�p�����0S�'��B`�;�Ч �6��R����@��`��������P� �(�R��.��B@�4�P]�k�T���:��� ��� ���A���G����M��`�R��P�b�����W�p�@���P�� ������������5��a@������������_��� �e�P���|� |�@�,��K�`��� ���������!������@� e�`� �GA$3a1`-�math.cpython-38-x86_64-linux-gnu.so-3.8.17-2.module_el8.9.0+3633+e453b53a.x86_64.debug�L�+�7zXZ�ִF!t/���]?�E�h=��ڊ�2N��4������R��� �}FF�B�%�2({t_b�t[���J�=4D�HaK�[�9.B�A�*�C���b&��ϙ�һ����kF^��p��b>��:��ӭ֊���|F�1�8�"t�F��ٜڐ3��5`�hJ��$WH�	S܋r���Y�ո� %Q����N���bЎ6v>v�sl��'J�^��{t�,�\��yXp6(/w���cC�uyZ����1UH5�����:�͡tZ���XEZ�"m���3>��D|�1zS-�8�|��(9���dr���i��_!�f��'��ÕY�81�3ٖ���-b_jj">�"w]!B�1M��J����L`?��Y�
��"5sO5�Ċ׎�?lO�t��o��P�WDSS�ٞ!���Ǻ}	#z2�ؖ0#B�^�o����x�*:�U���f�]��l��y�Õ��5�?��Z^�1���b-�&�F�E���5>o�?�p��� ��M�z�(s#C����Qu�6gU���a;�o�[k�0̃��G)�UFعhwi!�G�@����&͵�Yu��w�v�\K�m�N�Ǫ(@bS��@=���0�)�wkp@�k.� ��u�IG���bܼ��D%n�-��`@Ң�,��t~��%��C��X|��dq�:����"���%S�����:��ߜm�^
��i�i�Lˌ!������F��FV�y����,��Iq�l]B,��e`s�̷�e��K�3�C�*��9�`�&����h�j�tЂs�h��^-���y�����
|���yK�Pz�׍*0v�ǝ��ޖ<�-�b�E�f-	�m�,9�0���?EN	�r8�Ń�5�+�BU?f�YƂ�>�������O|}�_���r�4����c&H0a���k���.�I��=Kӫ�}����A�V�~�sVע�K��S��'���wo��/��r<ihM&��`��
����2;�d-�FdKt����5
��`a,-[�	V�b��-���ycXg�_0T������4���c�c&��̣��“�kO�ud@̓���.�ٻ���p�
ۘ�~-RG�%����h/)�A�q�!�RC��݈ܪx?q�Ys�V��.(d�ҮZ�/�N�ɝ�w��iz��]��ʣ��V_���
A
�ߺH׶`Pck$!t�;���__���i�F����cF��������{��?�z�-��^��Fo�p�~}F�Ќ�];fe���vO�2m��ߤ�,���@�k��j}&p���9�B�x�X�cM�NG?��Yٹ�	$��'Bifa�Mf�Y����q�w\l�$<�,�?|�K0y���}�l1Ey�O5�Sec��AD�m�>���-�%�5%��J��*�p(,�����#����j�2�����ʷe�xbe��+pNOR|�^�D��z�*�	޶=�1B^r�z�����D��*֪��ldn�&\��;8� e�6��ָOL�"�R
��D8k)MST*�J,�uZ�ɎY����@6�H�7W3����Iָ���a^ڛ��G+(Mv�1��.	�X���Ϸ,X�& �#�a�7fa�ya�RH���Y����R��2!�{����q`�������V��mG�@h魹["nuƨ�U+�WΩ�Bllκ�y��-(z��H	
̹�L
�C͟H��هa�B�~��뾳�9�O@?����&�A>����t7��K�
�:�� ��g�YZ.shstrtab.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.plt.sec.text.fini.rodata.eh_frame_hdr.eh_frame.note.gnu.property.init_array.fini_array.data.rel.ro.dynamic.got.data.bss.gnu.build.attributes.gnu_debuglink.gnu_debugdata88$���o``8(��
0���8���oTT�E���o00�T��x^B(&(&8h`-`-c�-�-�n`2`2�w0707�|}��
��� % � � �L�p�p�<����� �� ��� �� �  �h ��� ����� ��`�!� ��!���a�$
�\@ `(asyncio/base_events.py000064400000215655151153537520011106 0ustar00"""Base implementation of event loop.

The event loop can be broken up into a multiplexer (the part
responsible for notifying us of I/O events) and the event loop proper,
which wraps a multiplexer with functionality for scheduling callbacks,
immediately or at a given time in the future.

Whenever a public API takes a callback, subsequent positional
arguments will be passed to the callback if/when it is called.  This
avoids the proliferation of trivial lambdas implementing closures.
Keyword arguments for the callback are not supported; this is a
conscious design decision, leaving the door open for keyword arguments
to modify the meaning of the API call itself.
"""

import collections
import collections.abc
import concurrent.futures
import functools
import heapq
import itertools
import os
import socket
import stat
import subprocess
import threading
import time
import traceback
import sys
import warnings
import weakref

try:
    import ssl
except ImportError:  # pragma: no cover
    ssl = None

from . import constants
from . import coroutines
from . import events
from . import exceptions
from . import futures
from . import protocols
from . import sslproto
from . import staggered
from . import tasks
from . import transports
from . import trsock
from .log import logger


__all__ = 'BaseEventLoop',


# Minimum number of _scheduled timer handles before cleanup of
# cancelled handles is performed.
_MIN_SCHEDULED_TIMER_HANDLES = 100

# Minimum fraction of _scheduled timer handles that are cancelled
# before cleanup of cancelled handles is performed.
_MIN_CANCELLED_TIMER_HANDLES_FRACTION = 0.5


_HAS_IPv6 = hasattr(socket, 'AF_INET6')

# Maximum timeout passed to select to avoid OS limitations
MAXIMUM_SELECT_TIMEOUT = 24 * 3600

# Used for deprecation and removal of `loop.create_datagram_endpoint()`'s
# *reuse_address* parameter
_unset = object()


def _format_handle(handle):
    cb = handle._callback
    if isinstance(getattr(cb, '__self__', None), tasks.Task):
        # format the task
        return repr(cb.__self__)
    else:
        return str(handle)


def _format_pipe(fd):
    if fd == subprocess.PIPE:
        return '<pipe>'
    elif fd == subprocess.STDOUT:
        return '<stdout>'
    else:
        return repr(fd)


def _set_reuseport(sock):
    if not hasattr(socket, 'SO_REUSEPORT'):
        raise ValueError('reuse_port not supported by socket module')
    else:
        try:
            sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
        except OSError:
            raise ValueError('reuse_port not supported by socket module, '
                             'SO_REUSEPORT defined but not implemented.')


def _ipaddr_info(host, port, family, type, proto, flowinfo=0, scopeid=0):
    # Try to skip getaddrinfo if "host" is already an IP. Users might have
    # handled name resolution in their own code and pass in resolved IPs.
    if not hasattr(socket, 'inet_pton'):
        return

    if proto not in {0, socket.IPPROTO_TCP, socket.IPPROTO_UDP} or \
            host is None:
        return None

    if type == socket.SOCK_STREAM:
        proto = socket.IPPROTO_TCP
    elif type == socket.SOCK_DGRAM:
        proto = socket.IPPROTO_UDP
    else:
        return None

    if port is None:
        port = 0
    elif isinstance(port, bytes) and port == b'':
        port = 0
    elif isinstance(port, str) and port == '':
        port = 0
    else:
        # If port's a service name like "http", don't skip getaddrinfo.
        try:
            port = int(port)
        except (TypeError, ValueError):
            return None

    if family == socket.AF_UNSPEC:
        afs = [socket.AF_INET]
        if _HAS_IPv6:
            afs.append(socket.AF_INET6)
    else:
        afs = [family]

    if isinstance(host, bytes):
        host = host.decode('idna')
    if '%' in host:
        # Linux's inet_pton doesn't accept an IPv6 zone index after host,
        # like '::1%lo0'.
        return None

    for af in afs:
        try:
            socket.inet_pton(af, host)
            # The host has already been resolved.
            if _HAS_IPv6 and af == socket.AF_INET6:
                return af, type, proto, '', (host, port, flowinfo, scopeid)
            else:
                return af, type, proto, '', (host, port)
        except OSError:
            pass

    # "host" is not an IP address.
    return None


def _interleave_addrinfos(addrinfos, first_address_family_count=1):
    """Interleave list of addrinfo tuples by family."""
    # Group addresses by family
    addrinfos_by_family = collections.OrderedDict()
    for addr in addrinfos:
        family = addr[0]
        if family not in addrinfos_by_family:
            addrinfos_by_family[family] = []
        addrinfos_by_family[family].append(addr)
    addrinfos_lists = list(addrinfos_by_family.values())

    reordered = []
    if first_address_family_count > 1:
        reordered.extend(addrinfos_lists[0][:first_address_family_count - 1])
        del addrinfos_lists[0][:first_address_family_count - 1]
    reordered.extend(
        a for a in itertools.chain.from_iterable(
            itertools.zip_longest(*addrinfos_lists)
        ) if a is not None)
    return reordered


def _run_until_complete_cb(fut):
    if not fut.cancelled():
        exc = fut.exception()
        if isinstance(exc, (SystemExit, KeyboardInterrupt)):
            # Issue #22429: run_forever() already finished, no need to
            # stop it.
            return
    futures._get_loop(fut).stop()


if hasattr(socket, 'TCP_NODELAY'):
    def _set_nodelay(sock):
        if (sock.family in {socket.AF_INET, socket.AF_INET6} and
                sock.type == socket.SOCK_STREAM and
                sock.proto == socket.IPPROTO_TCP):
            sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
else:
    def _set_nodelay(sock):
        pass


class _SendfileFallbackProtocol(protocols.Protocol):
    def __init__(self, transp):
        if not isinstance(transp, transports._FlowControlMixin):
            raise TypeError("transport should be _FlowControlMixin instance")
        self._transport = transp
        self._proto = transp.get_protocol()
        self._should_resume_reading = transp.is_reading()
        self._should_resume_writing = transp._protocol_paused
        transp.pause_reading()
        transp.set_protocol(self)
        if self._should_resume_writing:
            self._write_ready_fut = self._transport._loop.create_future()
        else:
            self._write_ready_fut = None

    async def drain(self):
        if self._transport.is_closing():
            raise ConnectionError("Connection closed by peer")
        fut = self._write_ready_fut
        if fut is None:
            return
        await fut

    def connection_made(self, transport):
        raise RuntimeError("Invalid state: "
                           "connection should have been established already.")

    def connection_lost(self, exc):
        if self._write_ready_fut is not None:
            # Never happens if peer disconnects after sending the whole content
            # Thus disconnection is always an exception from user perspective
            if exc is None:
                self._write_ready_fut.set_exception(
                    ConnectionError("Connection is closed by peer"))
            else:
                self._write_ready_fut.set_exception(exc)
        self._proto.connection_lost(exc)

    def pause_writing(self):
        if self._write_ready_fut is not None:
            return
        self._write_ready_fut = self._transport._loop.create_future()

    def resume_writing(self):
        if self._write_ready_fut is None:
            return
        self._write_ready_fut.set_result(False)
        self._write_ready_fut = None

    def data_received(self, data):
        raise RuntimeError("Invalid state: reading should be paused")

    def eof_received(self):
        raise RuntimeError("Invalid state: reading should be paused")

    async def restore(self):
        self._transport.set_protocol(self._proto)
        if self._should_resume_reading:
            self._transport.resume_reading()
        if self._write_ready_fut is not None:
            # Cancel the future.
            # Basically it has no effect because protocol is switched back,
            # no code should wait for it anymore.
            self._write_ready_fut.cancel()
        if self._should_resume_writing:
            self._proto.resume_writing()


class Server(events.AbstractServer):

    def __init__(self, loop, sockets, protocol_factory, ssl_context, backlog,
                 ssl_handshake_timeout):
        self._loop = loop
        self._sockets = sockets
        self._active_count = 0
        self._waiters = []
        self._protocol_factory = protocol_factory
        self._backlog = backlog
        self._ssl_context = ssl_context
        self._ssl_handshake_timeout = ssl_handshake_timeout
        self._serving = False
        self._serving_forever_fut = None

    def __repr__(self):
        return f'<{self.__class__.__name__} sockets={self.sockets!r}>'

    def _attach(self):
        assert self._sockets is not None
        self._active_count += 1

    def _detach(self):
        assert self._active_count > 0
        self._active_count -= 1
        if self._active_count == 0 and self._sockets is None:
            self._wakeup()

    def _wakeup(self):
        waiters = self._waiters
        self._waiters = None
        for waiter in waiters:
            if not waiter.done():
                waiter.set_result(waiter)

    def _start_serving(self):
        if self._serving:
            return
        self._serving = True
        for sock in self._sockets:
            sock.listen(self._backlog)
            self._loop._start_serving(
                self._protocol_factory, sock, self._ssl_context,
                self, self._backlog, self._ssl_handshake_timeout)

    def get_loop(self):
        return self._loop

    def is_serving(self):
        return self._serving

    @property
    def sockets(self):
        if self._sockets is None:
            return ()
        return tuple(trsock.TransportSocket(s) for s in self._sockets)

    def close(self):
        sockets = self._sockets
        if sockets is None:
            return
        self._sockets = None

        for sock in sockets:
            self._loop._stop_serving(sock)

        self._serving = False

        if (self._serving_forever_fut is not None and
                not self._serving_forever_fut.done()):
            self._serving_forever_fut.cancel()
            self._serving_forever_fut = None

        if self._active_count == 0:
            self._wakeup()

    async def start_serving(self):
        self._start_serving()
        # Skip one loop iteration so that all 'loop.add_reader'
        # go through.
        await tasks.sleep(0, loop=self._loop)

    async def serve_forever(self):
        if self._serving_forever_fut is not None:
            raise RuntimeError(
                f'server {self!r} is already being awaited on serve_forever()')
        if self._sockets is None:
            raise RuntimeError(f'server {self!r} is closed')

        self._start_serving()
        self._serving_forever_fut = self._loop.create_future()

        try:
            await self._serving_forever_fut
        except exceptions.CancelledError:
            try:
                self.close()
                await self.wait_closed()
            finally:
                raise
        finally:
            self._serving_forever_fut = None

    async def wait_closed(self):
        if self._sockets is None or self._waiters is None:
            return
        waiter = self._loop.create_future()
        self._waiters.append(waiter)
        await waiter


class BaseEventLoop(events.AbstractEventLoop):

    def __init__(self):
        self._timer_cancelled_count = 0
        self._closed = False
        self._stopping = False
        self._ready = collections.deque()
        self._scheduled = []
        self._default_executor = None
        self._internal_fds = 0
        # Identifier of the thread running the event loop, or None if the
        # event loop is not running
        self._thread_id = None
        self._clock_resolution = time.get_clock_info('monotonic').resolution
        self._exception_handler = None
        self.set_debug(coroutines._is_debug_mode())
        # In debug mode, if the execution of a callback or a step of a task
        # exceed this duration in seconds, the slow callback/task is logged.
        self.slow_callback_duration = 0.1
        self._current_handle = None
        self._task_factory = None
        self._coroutine_origin_tracking_enabled = False
        self._coroutine_origin_tracking_saved_depth = None

        # A weak set of all asynchronous generators that are
        # being iterated by the loop.
        self._asyncgens = weakref.WeakSet()
        # Set to True when `loop.shutdown_asyncgens` is called.
        self._asyncgens_shutdown_called = False

    def __repr__(self):
        return (
            f'<{self.__class__.__name__} running={self.is_running()} '
            f'closed={self.is_closed()} debug={self.get_debug()}>'
        )

    def create_future(self):
        """Create a Future object attached to the loop."""
        return futures.Future(loop=self)

    def create_task(self, coro, *, name=None):
        """Schedule a coroutine object.

        Return a task object.
        """
        self._check_closed()
        if self._task_factory is None:
            task = tasks.Task(coro, loop=self, name=name)
            if task._source_traceback:
                del task._source_traceback[-1]
        else:
            task = self._task_factory(self, coro)
            tasks._set_task_name(task, name)

        return task

    def set_task_factory(self, factory):
        """Set a task factory that will be used by loop.create_task().

        If factory is None the default task factory will be set.

        If factory is a callable, it should have a signature matching
        '(loop, coro)', where 'loop' will be a reference to the active
        event loop, 'coro' will be a coroutine object.  The callable
        must return a Future.
        """
        if factory is not None and not callable(factory):
            raise TypeError('task factory must be a callable or None')
        self._task_factory = factory

    def get_task_factory(self):
        """Return a task factory, or None if the default one is in use."""
        return self._task_factory

    def _make_socket_transport(self, sock, protocol, waiter=None, *,
                               extra=None, server=None):
        """Create socket transport."""
        raise NotImplementedError

    def _make_ssl_transport(
            self, rawsock, protocol, sslcontext, waiter=None,
            *, server_side=False, server_hostname=None,
            extra=None, server=None,
            ssl_handshake_timeout=None,
            call_connection_made=True):
        """Create SSL transport."""
        raise NotImplementedError

    def _make_datagram_transport(self, sock, protocol,
                                 address=None, waiter=None, extra=None):
        """Create datagram transport."""
        raise NotImplementedError

    def _make_read_pipe_transport(self, pipe, protocol, waiter=None,
                                  extra=None):
        """Create read pipe transport."""
        raise NotImplementedError

    def _make_write_pipe_transport(self, pipe, protocol, waiter=None,
                                   extra=None):
        """Create write pipe transport."""
        raise NotImplementedError

    async def _make_subprocess_transport(self, protocol, args, shell,
                                         stdin, stdout, stderr, bufsize,
                                         extra=None, **kwargs):
        """Create subprocess transport."""
        raise NotImplementedError

    def _write_to_self(self):
        """Write a byte to self-pipe, to wake up the event loop.

        This may be called from a different thread.

        The subclass is responsible for implementing the self-pipe.
        """
        raise NotImplementedError

    def _process_events(self, event_list):
        """Process selector events."""
        raise NotImplementedError

    def _check_closed(self):
        if self._closed:
            raise RuntimeError('Event loop is closed')

    def _asyncgen_finalizer_hook(self, agen):
        self._asyncgens.discard(agen)
        if not self.is_closed():
            self.call_soon_threadsafe(self.create_task, agen.aclose())

    def _asyncgen_firstiter_hook(self, agen):
        if self._asyncgens_shutdown_called:
            warnings.warn(
                f"asynchronous generator {agen!r} was scheduled after "
                f"loop.shutdown_asyncgens() call",
                ResourceWarning, source=self)

        self._asyncgens.add(agen)

    async def shutdown_asyncgens(self):
        """Shutdown all active asynchronous generators."""
        self._asyncgens_shutdown_called = True

        if not len(self._asyncgens):
            # If Python version is <3.6 or we don't have any asynchronous
            # generators alive.
            return

        closing_agens = list(self._asyncgens)
        self._asyncgens.clear()

        results = await tasks.gather(
            *[ag.aclose() for ag in closing_agens],
            return_exceptions=True,
            loop=self)

        for result, agen in zip(results, closing_agens):
            if isinstance(result, Exception):
                self.call_exception_handler({
                    'message': f'an error occurred during closing of '
                               f'asynchronous generator {agen!r}',
                    'exception': result,
                    'asyncgen': agen
                })

    def _check_running(self):
        if self.is_running():
            raise RuntimeError('This event loop is already running')
        if events._get_running_loop() is not None:
            raise RuntimeError(
                'Cannot run the event loop while another loop is running')

    def run_forever(self):
        """Run until stop() is called."""
        self._check_closed()
        self._check_running()
        self._set_coroutine_origin_tracking(self._debug)
        self._thread_id = threading.get_ident()

        old_agen_hooks = sys.get_asyncgen_hooks()
        sys.set_asyncgen_hooks(firstiter=self._asyncgen_firstiter_hook,
                               finalizer=self._asyncgen_finalizer_hook)
        try:
            events._set_running_loop(self)
            while True:
                self._run_once()
                if self._stopping:
                    break
        finally:
            self._stopping = False
            self._thread_id = None
            events._set_running_loop(None)
            self._set_coroutine_origin_tracking(False)
            sys.set_asyncgen_hooks(*old_agen_hooks)

    def run_until_complete(self, future):
        """Run until the Future is done.

        If the argument is a coroutine, it is wrapped in a Task.

        WARNING: It would be disastrous to call run_until_complete()
        with the same coroutine twice -- it would wrap it in two
        different Tasks and that can't be good.

        Return the Future's result, or raise its exception.
        """
        self._check_closed()
        self._check_running()

        new_task = not futures.isfuture(future)
        future = tasks.ensure_future(future, loop=self)
        if new_task:
            # An exception is raised if the future didn't complete, so there
            # is no need to log the "destroy pending task" message
            future._log_destroy_pending = False

        future.add_done_callback(_run_until_complete_cb)
        try:
            self.run_forever()
        except:
            if new_task and future.done() and not future.cancelled():
                # The coroutine raised a BaseException. Consume the exception
                # to not log a warning, the caller doesn't have access to the
                # local task.
                future.exception()
            raise
        finally:
            future.remove_done_callback(_run_until_complete_cb)
        if not future.done():
            raise RuntimeError('Event loop stopped before Future completed.')

        return future.result()

    def stop(self):
        """Stop running the event loop.

        Every callback already scheduled will still run.  This simply informs
        run_forever to stop looping after a complete iteration.
        """
        self._stopping = True

    def close(self):
        """Close the event loop.

        This clears the queues and shuts down the executor,
        but does not wait for the executor to finish.

        The event loop must not be running.
        """
        if self.is_running():
            raise RuntimeError("Cannot close a running event loop")
        if self._closed:
            return
        if self._debug:
            logger.debug("Close %r", self)
        self._closed = True
        self._ready.clear()
        self._scheduled.clear()
        executor = self._default_executor
        if executor is not None:
            self._default_executor = None
            executor.shutdown(wait=False)

    def is_closed(self):
        """Returns True if the event loop was closed."""
        return self._closed

    def __del__(self, _warn=warnings.warn):
        if not self.is_closed():
            _warn(f"unclosed event loop {self!r}", ResourceWarning, source=self)
            if not self.is_running():
                self.close()

    def is_running(self):
        """Returns True if the event loop is running."""
        return (self._thread_id is not None)

    def time(self):
        """Return the time according to the event loop's clock.

        This is a float expressed in seconds since an epoch, but the
        epoch, precision, accuracy and drift are unspecified and may
        differ per event loop.
        """
        return time.monotonic()

    def call_later(self, delay, callback, *args, context=None):
        """Arrange for a callback to be called at a given time.

        Return a Handle: an opaque object with a cancel() method that
        can be used to cancel the call.

        The delay can be an int or float, expressed in seconds.  It is
        always relative to the current time.

        Each callback will be called exactly once.  If two callbacks
        are scheduled for exactly the same time, it undefined which
        will be called first.

        Any positional arguments after the callback will be passed to
        the callback when it is called.
        """
        timer = self.call_at(self.time() + delay, callback, *args,
                             context=context)
        if timer._source_traceback:
            del timer._source_traceback[-1]
        return timer

    def call_at(self, when, callback, *args, context=None):
        """Like call_later(), but uses an absolute time.

        Absolute time corresponds to the event loop's time() method.
        """
        self._check_closed()
        if self._debug:
            self._check_thread()
            self._check_callback(callback, 'call_at')
        timer = events.TimerHandle(when, callback, args, self, context)
        if timer._source_traceback:
            del timer._source_traceback[-1]
        heapq.heappush(self._scheduled, timer)
        timer._scheduled = True
        return timer

    def call_soon(self, callback, *args, context=None):
        """Arrange for a callback to be called as soon as possible.

        This operates as a FIFO queue: callbacks are called in the
        order in which they are registered.  Each callback will be
        called exactly once.

        Any positional arguments after the callback will be passed to
        the callback when it is called.
        """
        self._check_closed()
        if self._debug:
            self._check_thread()
            self._check_callback(callback, 'call_soon')
        handle = self._call_soon(callback, args, context)
        if handle._source_traceback:
            del handle._source_traceback[-1]
        return handle

    def _check_callback(self, callback, method):
        if (coroutines.iscoroutine(callback) or
                coroutines.iscoroutinefunction(callback)):
            raise TypeError(
                f"coroutines cannot be used with {method}()")
        if not callable(callback):
            raise TypeError(
                f'a callable object was expected by {method}(), '
                f'got {callback!r}')

    def _call_soon(self, callback, args, context):
        handle = events.Handle(callback, args, self, context)
        if handle._source_traceback:
            del handle._source_traceback[-1]
        self._ready.append(handle)
        return handle

    def _check_thread(self):
        """Check that the current thread is the thread running the event loop.

        Non-thread-safe methods of this class make this assumption and will
        likely behave incorrectly when the assumption is violated.

        Should only be called when (self._debug == True).  The caller is
        responsible for checking this condition for performance reasons.
        """
        if self._thread_id is None:
            return
        thread_id = threading.get_ident()
        if thread_id != self._thread_id:
            raise RuntimeError(
                "Non-thread-safe operation invoked on an event loop other "
                "than the current one")

    def call_soon_threadsafe(self, callback, *args, context=None):
        """Like call_soon(), but thread-safe."""
        self._check_closed()
        if self._debug:
            self._check_callback(callback, 'call_soon_threadsafe')
        handle = self._call_soon(callback, args, context)
        if handle._source_traceback:
            del handle._source_traceback[-1]
        self._write_to_self()
        return handle

    def run_in_executor(self, executor, func, *args):
        self._check_closed()
        if self._debug:
            self._check_callback(func, 'run_in_executor')
        if executor is None:
            executor = self._default_executor
            if executor is None:
                executor = concurrent.futures.ThreadPoolExecutor()
                self._default_executor = executor
        return futures.wrap_future(
            executor.submit(func, *args), loop=self)

    def set_default_executor(self, executor):
        if not isinstance(executor, concurrent.futures.ThreadPoolExecutor):
            warnings.warn(
                'Using the default executor that is not an instance of '
                'ThreadPoolExecutor is deprecated and will be prohibited '
                'in Python 3.9',
                DeprecationWarning, 2)
        self._default_executor = executor

    def _getaddrinfo_debug(self, host, port, family, type, proto, flags):
        msg = [f"{host}:{port!r}"]
        if family:
            msg.append(f'family={family!r}')
        if type:
            msg.append(f'type={type!r}')
        if proto:
            msg.append(f'proto={proto!r}')
        if flags:
            msg.append(f'flags={flags!r}')
        msg = ', '.join(msg)
        logger.debug('Get address info %s', msg)

        t0 = self.time()
        addrinfo = socket.getaddrinfo(host, port, family, type, proto, flags)
        dt = self.time() - t0

        msg = f'Getting address info {msg} took {dt * 1e3:.3f}ms: {addrinfo!r}'
        if dt >= self.slow_callback_duration:
            logger.info(msg)
        else:
            logger.debug(msg)
        return addrinfo

    async def getaddrinfo(self, host, port, *,
                          family=0, type=0, proto=0, flags=0):
        if self._debug:
            getaddr_func = self._getaddrinfo_debug
        else:
            getaddr_func = socket.getaddrinfo

        return await self.run_in_executor(
            None, getaddr_func, host, port, family, type, proto, flags)

    async def getnameinfo(self, sockaddr, flags=0):
        return await self.run_in_executor(
            None, socket.getnameinfo, sockaddr, flags)

    async def sock_sendfile(self, sock, file, offset=0, count=None,
                            *, fallback=True):
        if self._debug and sock.gettimeout() != 0:
            raise ValueError("the socket must be non-blocking")
        self._check_sendfile_params(sock, file, offset, count)
        try:
            return await self._sock_sendfile_native(sock, file,
                                                    offset, count)
        except exceptions.SendfileNotAvailableError as exc:
            if not fallback:
                raise
        return await self._sock_sendfile_fallback(sock, file,
                                                  offset, count)

    async def _sock_sendfile_native(self, sock, file, offset, count):
        # NB: sendfile syscall is not supported for SSL sockets and
        # non-mmap files even if sendfile is supported by OS
        raise exceptions.SendfileNotAvailableError(
            f"syscall sendfile is not available for socket {sock!r} "
            "and file {file!r} combination")

    async def _sock_sendfile_fallback(self, sock, file, offset, count):
        if offset:
            file.seek(offset)
        blocksize = (
            min(count, constants.SENDFILE_FALLBACK_READBUFFER_SIZE)
            if count else constants.SENDFILE_FALLBACK_READBUFFER_SIZE
        )
        buf = bytearray(blocksize)
        total_sent = 0
        try:
            while True:
                if count:
                    blocksize = min(count - total_sent, blocksize)
                    if blocksize <= 0:
                        break
                view = memoryview(buf)[:blocksize]
                read = await self.run_in_executor(None, file.readinto, view)
                if not read:
                    break  # EOF
                await self.sock_sendall(sock, view[:read])
                total_sent += read
            return total_sent
        finally:
            if total_sent > 0 and hasattr(file, 'seek'):
                file.seek(offset + total_sent)

    def _check_sendfile_params(self, sock, file, offset, count):
        if 'b' not in getattr(file, 'mode', 'b'):
            raise ValueError("file should be opened in binary mode")
        if not sock.type == socket.SOCK_STREAM:
            raise ValueError("only SOCK_STREAM type sockets are supported")
        if count is not None:
            if not isinstance(count, int):
                raise TypeError(
                    "count must be a positive integer (got {!r})".format(count))
            if count <= 0:
                raise ValueError(
                    "count must be a positive integer (got {!r})".format(count))
        if not isinstance(offset, int):
            raise TypeError(
                "offset must be a non-negative integer (got {!r})".format(
                    offset))
        if offset < 0:
            raise ValueError(
                "offset must be a non-negative integer (got {!r})".format(
                    offset))

    async def _connect_sock(self, exceptions, addr_info, local_addr_infos=None):
        """Create, bind and connect one socket."""
        my_exceptions = []
        exceptions.append(my_exceptions)
        family, type_, proto, _, address = addr_info
        sock = None
        try:
            sock = socket.socket(family=family, type=type_, proto=proto)
            sock.setblocking(False)
            if local_addr_infos is not None:
                for _, _, _, _, laddr in local_addr_infos:
                    try:
                        sock.bind(laddr)
                        break
                    except OSError as exc:
                        msg = (
                            f'error while attempting to bind on '
                            f'address {laddr!r}: '
                            f'{exc.strerror.lower()}'
                        )
                        exc = OSError(exc.errno, msg)
                        my_exceptions.append(exc)
                else:  # all bind attempts failed
                    raise my_exceptions.pop()
            await self.sock_connect(sock, address)
            return sock
        except OSError as exc:
            my_exceptions.append(exc)
            if sock is not None:
                sock.close()
            raise
        except:
            if sock is not None:
                sock.close()
            raise

    async def create_connection(
            self, protocol_factory, host=None, port=None,
            *, ssl=None, family=0,
            proto=0, flags=0, sock=None,
            local_addr=None, server_hostname=None,
            ssl_handshake_timeout=None,
            happy_eyeballs_delay=None, interleave=None):
        """Connect to a TCP server.

        Create a streaming transport connection to a given Internet host and
        port: socket family AF_INET or socket.AF_INET6 depending on host (or
        family if specified), socket type SOCK_STREAM. protocol_factory must be
        a callable returning a protocol instance.

        This method is a coroutine which will try to establish the connection
        in the background.  When successful, the coroutine returns a
        (transport, protocol) pair.
        """
        if server_hostname is not None and not ssl:
            raise ValueError('server_hostname is only meaningful with ssl')

        if server_hostname is None and ssl:
            # Use host as default for server_hostname.  It is an error
            # if host is empty or not set, e.g. when an
            # already-connected socket was passed or when only a port
            # is given.  To avoid this error, you can pass
            # server_hostname='' -- this will bypass the hostname
            # check.  (This also means that if host is a numeric
            # IP/IPv6 address, we will attempt to verify that exact
            # address; this will probably fail, but it is possible to
            # create a certificate for a specific IP address, so we
            # don't judge it here.)
            if not host:
                raise ValueError('You must set server_hostname '
                                 'when using ssl without a host')
            server_hostname = host

        if ssl_handshake_timeout is not None and not ssl:
            raise ValueError(
                'ssl_handshake_timeout is only meaningful with ssl')

        if happy_eyeballs_delay is not None and interleave is None:
            # If using happy eyeballs, default to interleave addresses by family
            interleave = 1

        if host is not None or port is not None:
            if sock is not None:
                raise ValueError(
                    'host/port and sock can not be specified at the same time')

            infos = await self._ensure_resolved(
                (host, port), family=family,
                type=socket.SOCK_STREAM, proto=proto, flags=flags, loop=self)
            if not infos:
                raise OSError('getaddrinfo() returned empty list')

            if local_addr is not None:
                laddr_infos = await self._ensure_resolved(
                    local_addr, family=family,
                    type=socket.SOCK_STREAM, proto=proto,
                    flags=flags, loop=self)
                if not laddr_infos:
                    raise OSError('getaddrinfo() returned empty list')
            else:
                laddr_infos = None

            if interleave:
                infos = _interleave_addrinfos(infos, interleave)

            exceptions = []
            if happy_eyeballs_delay is None:
                # not using happy eyeballs
                for addrinfo in infos:
                    try:
                        sock = await self._connect_sock(
                            exceptions, addrinfo, laddr_infos)
                        break
                    except OSError:
                        continue
            else:  # using happy eyeballs
                sock, _, _ = await staggered.staggered_race(
                    (functools.partial(self._connect_sock,
                                       exceptions, addrinfo, laddr_infos)
                     for addrinfo in infos),
                    happy_eyeballs_delay, loop=self)

            if sock is None:
                exceptions = [exc for sub in exceptions for exc in sub]
                if len(exceptions) == 1:
                    raise exceptions[0]
                else:
                    # If they all have the same str(), raise one.
                    model = str(exceptions[0])
                    if all(str(exc) == model for exc in exceptions):
                        raise exceptions[0]
                    # Raise a combined exception so the user can see all
                    # the various error messages.
                    raise OSError('Multiple exceptions: {}'.format(
                        ', '.join(str(exc) for exc in exceptions)))

        else:
            if sock is None:
                raise ValueError(
                    'host and port was not specified and no sock specified')
            if sock.type != socket.SOCK_STREAM:
                # We allow AF_INET, AF_INET6, AF_UNIX as long as they
                # are SOCK_STREAM.
                # We support passing AF_UNIX sockets even though we have
                # a dedicated API for that: create_unix_connection.
                # Disallowing AF_UNIX in this method, breaks backwards
                # compatibility.
                raise ValueError(
                    f'A Stream Socket was expected, got {sock!r}')

        transport, protocol = await self._create_connection_transport(
            sock, protocol_factory, ssl, server_hostname,
            ssl_handshake_timeout=ssl_handshake_timeout)
        if self._debug:
            # Get the socket from the transport because SSL transport closes
            # the old socket and creates a new SSL socket
            sock = transport.get_extra_info('socket')
            logger.debug("%r connected to %s:%r: (%r, %r)",
                         sock, host, port, transport, protocol)
        return transport, protocol

    async def _create_connection_transport(
            self, sock, protocol_factory, ssl,
            server_hostname, server_side=False,
            ssl_handshake_timeout=None):

        sock.setblocking(False)

        protocol = protocol_factory()
        waiter = self.create_future()
        if ssl:
            sslcontext = None if isinstance(ssl, bool) else ssl
            transport = self._make_ssl_transport(
                sock, protocol, sslcontext, waiter,
                server_side=server_side, server_hostname=server_hostname,
                ssl_handshake_timeout=ssl_handshake_timeout)
        else:
            transport = self._make_socket_transport(sock, protocol, waiter)

        try:
            await waiter
        except:
            transport.close()
            raise

        return transport, protocol

    async def sendfile(self, transport, file, offset=0, count=None,
                       *, fallback=True):
        """Send a file to transport.

        Return the total number of bytes which were sent.

        The method uses high-performance os.sendfile if available.

        file must be a regular file object opened in binary mode.

        offset tells from where to start reading the file. If specified,
        count is the total number of bytes to transmit as opposed to
        sending the file until EOF is reached. File position is updated on
        return or also in case of error in which case file.tell()
        can be used to figure out the number of bytes
        which were sent.

        fallback set to True makes asyncio to manually read and send
        the file when the platform does not support the sendfile syscall
        (e.g. Windows or SSL socket on Unix).

        Raise SendfileNotAvailableError if the system does not support
        sendfile syscall and fallback is False.
        """
        if transport.is_closing():
            raise RuntimeError("Transport is closing")
        mode = getattr(transport, '_sendfile_compatible',
                       constants._SendfileMode.UNSUPPORTED)
        if mode is constants._SendfileMode.UNSUPPORTED:
            raise RuntimeError(
                f"sendfile is not supported for transport {transport!r}")
        if mode is constants._SendfileMode.TRY_NATIVE:
            try:
                return await self._sendfile_native(transport, file,
                                                   offset, count)
            except exceptions.SendfileNotAvailableError as exc:
                if not fallback:
                    raise

        if not fallback:
            raise RuntimeError(
                f"fallback is disabled and native sendfile is not "
                f"supported for transport {transport!r}")

        return await self._sendfile_fallback(transport, file,
                                             offset, count)

    async def _sendfile_native(self, transp, file, offset, count):
        raise exceptions.SendfileNotAvailableError(
            "sendfile syscall is not supported")

    async def _sendfile_fallback(self, transp, file, offset, count):
        if offset:
            file.seek(offset)
        blocksize = min(count, 16384) if count else 16384
        buf = bytearray(blocksize)
        total_sent = 0
        proto = _SendfileFallbackProtocol(transp)
        try:
            while True:
                if count:
                    blocksize = min(count - total_sent, blocksize)
                    if blocksize <= 0:
                        return total_sent
                view = memoryview(buf)[:blocksize]
                read = await self.run_in_executor(None, file.readinto, view)
                if not read:
                    return total_sent  # EOF
                await proto.drain()
                transp.write(view[:read])
                total_sent += read
        finally:
            if total_sent > 0 and hasattr(file, 'seek'):
                file.seek(offset + total_sent)
            await proto.restore()

    async def start_tls(self, transport, protocol, sslcontext, *,
                        server_side=False,
                        server_hostname=None,
                        ssl_handshake_timeout=None):
        """Upgrade transport to TLS.

        Return a new transport that *protocol* should start using
        immediately.
        """
        if ssl is None:
            raise RuntimeError('Python ssl module is not available')

        if not isinstance(sslcontext, ssl.SSLContext):
            raise TypeError(
                f'sslcontext is expected to be an instance of ssl.SSLContext, '
                f'got {sslcontext!r}')

        if not getattr(transport, '_start_tls_compatible', False):
            raise TypeError(
                f'transport {transport!r} is not supported by start_tls()')

        waiter = self.create_future()
        ssl_protocol = sslproto.SSLProtocol(
            self, protocol, sslcontext, waiter,
            server_side, server_hostname,
            ssl_handshake_timeout=ssl_handshake_timeout,
            call_connection_made=False)

        # Pause early so that "ssl_protocol.data_received()" doesn't
        # have a chance to get called before "ssl_protocol.connection_made()".
        transport.pause_reading()

        transport.set_protocol(ssl_protocol)
        conmade_cb = self.call_soon(ssl_protocol.connection_made, transport)
        resume_cb = self.call_soon(transport.resume_reading)

        try:
            await waiter
        except BaseException:
            transport.close()
            conmade_cb.cancel()
            resume_cb.cancel()
            raise

        return ssl_protocol._app_transport

    async def create_datagram_endpoint(self, protocol_factory,
                                       local_addr=None, remote_addr=None, *,
                                       family=0, proto=0, flags=0,
                                       reuse_address=_unset, reuse_port=None,
                                       allow_broadcast=None, sock=None):
        """Create datagram connection."""
        if sock is not None:
            if sock.type != socket.SOCK_DGRAM:
                raise ValueError(
                    f'A UDP Socket was expected, got {sock!r}')
            if (local_addr or remote_addr or
                    family or proto or flags or
                    reuse_port or allow_broadcast):
                # show the problematic kwargs in exception msg
                opts = dict(local_addr=local_addr, remote_addr=remote_addr,
                            family=family, proto=proto, flags=flags,
                            reuse_address=reuse_address, reuse_port=reuse_port,
                            allow_broadcast=allow_broadcast)
                problems = ', '.join(f'{k}={v}' for k, v in opts.items() if v)
                raise ValueError(
                    f'socket modifier keyword arguments can not be used '
                    f'when sock is specified. ({problems})')
            sock.setblocking(False)
            r_addr = None
        else:
            if not (local_addr or remote_addr):
                if family == 0:
                    raise ValueError('unexpected address family')
                addr_pairs_info = (((family, proto), (None, None)),)
            elif hasattr(socket, 'AF_UNIX') and family == socket.AF_UNIX:
                for addr in (local_addr, remote_addr):
                    if addr is not None and not isinstance(addr, str):
                        raise TypeError('string is expected')

                if local_addr and local_addr[0] not in (0, '\x00'):
                    try:
                        if stat.S_ISSOCK(os.stat(local_addr).st_mode):
                            os.remove(local_addr)
                    except FileNotFoundError:
                        pass
                    except OSError as err:
                        # Directory may have permissions only to create socket.
                        logger.error('Unable to check or remove stale UNIX '
                                     'socket %r: %r',
                                     local_addr, err)

                addr_pairs_info = (((family, proto),
                                    (local_addr, remote_addr)), )
            else:
                # join address by (family, protocol)
                addr_infos = {}  # Using order preserving dict
                for idx, addr in ((0, local_addr), (1, remote_addr)):
                    if addr is not None:
                        assert isinstance(addr, tuple) and len(addr) == 2, (
                            '2-tuple is expected')

                        infos = await self._ensure_resolved(
                            addr, family=family, type=socket.SOCK_DGRAM,
                            proto=proto, flags=flags, loop=self)
                        if not infos:
                            raise OSError('getaddrinfo() returned empty list')

                        for fam, _, pro, _, address in infos:
                            key = (fam, pro)
                            if key not in addr_infos:
                                addr_infos[key] = [None, None]
                            addr_infos[key][idx] = address

                # each addr has to have info for each (family, proto) pair
                addr_pairs_info = [
                    (key, addr_pair) for key, addr_pair in addr_infos.items()
                    if not ((local_addr and addr_pair[0] is None) or
                            (remote_addr and addr_pair[1] is None))]

                if not addr_pairs_info:
                    raise ValueError('can not get address information')

            exceptions = []

            # bpo-37228
            if reuse_address is not _unset:
                if reuse_address:
                    raise ValueError("Passing `reuse_address=True` is no "
                                     "longer supported, as the usage of "
                                     "SO_REUSEPORT in UDP poses a significant "
                                     "security concern.")
                else:
                    warnings.warn("The *reuse_address* parameter has been "
                                  "deprecated as of 3.5.10 and is scheduled "
                                  "for removal in 3.11.", DeprecationWarning,
                                  stacklevel=2)

            for ((family, proto),
                 (local_address, remote_address)) in addr_pairs_info:
                sock = None
                r_addr = None
                try:
                    sock = socket.socket(
                        family=family, type=socket.SOCK_DGRAM, proto=proto)
                    if reuse_port:
                        _set_reuseport(sock)
                    if allow_broadcast:
                        sock.setsockopt(
                            socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
                    sock.setblocking(False)

                    if local_addr:
                        sock.bind(local_address)
                    if remote_addr:
                        if not allow_broadcast:
                            await self.sock_connect(sock, remote_address)
                        r_addr = remote_address
                except OSError as exc:
                    if sock is not None:
                        sock.close()
                    exceptions.append(exc)
                except:
                    if sock is not None:
                        sock.close()
                    raise
                else:
                    break
            else:
                raise exceptions[0]

        protocol = protocol_factory()
        waiter = self.create_future()
        transport = self._make_datagram_transport(
            sock, protocol, r_addr, waiter)
        if self._debug:
            if local_addr:
                logger.info("Datagram endpoint local_addr=%r remote_addr=%r "
                            "created: (%r, %r)",
                            local_addr, remote_addr, transport, protocol)
            else:
                logger.debug("Datagram endpoint remote_addr=%r created: "
                             "(%r, %r)",
                             remote_addr, transport, protocol)

        try:
            await waiter
        except:
            transport.close()
            raise

        return transport, protocol

    async def _ensure_resolved(self, address, *,
                               family=0, type=socket.SOCK_STREAM,
                               proto=0, flags=0, loop):
        host, port = address[:2]
        info = _ipaddr_info(host, port, family, type, proto, *address[2:])
        if info is not None:
            # "host" is already a resolved IP.
            return [info]
        else:
            return await loop.getaddrinfo(host, port, family=family, type=type,
                                          proto=proto, flags=flags)

    async def _create_server_getaddrinfo(self, host, port, family, flags):
        infos = await self._ensure_resolved((host, port), family=family,
                                            type=socket.SOCK_STREAM,
                                            flags=flags, loop=self)
        if not infos:
            raise OSError(f'getaddrinfo({host!r}) returned empty list')
        return infos

    async def create_server(
            self, protocol_factory, host=None, port=None,
            *,
            family=socket.AF_UNSPEC,
            flags=socket.AI_PASSIVE,
            sock=None,
            backlog=100,
            ssl=None,
            reuse_address=None,
            reuse_port=None,
            ssl_handshake_timeout=None,
            start_serving=True):
        """Create a TCP server.

        The host parameter can be a string, in that case the TCP server is
        bound to host and port.

        The host parameter can also be a sequence of strings and in that case
        the TCP server is bound to all hosts of the sequence. If a host
        appears multiple times (possibly indirectly e.g. when hostnames
        resolve to the same IP address), the server is only bound once to that
        host.

        Return a Server object which can be used to stop the service.

        This method is a coroutine.
        """
        if isinstance(ssl, bool):
            raise TypeError('ssl argument must be an SSLContext or None')

        if ssl_handshake_timeout is not None and ssl is None:
            raise ValueError(
                'ssl_handshake_timeout is only meaningful with ssl')

        if host is not None or port is not None:
            if sock is not None:
                raise ValueError(
                    'host/port and sock can not be specified at the same time')

            if reuse_address is None:
                reuse_address = os.name == 'posix' and sys.platform != 'cygwin'
            sockets = []
            if host == '':
                hosts = [None]
            elif (isinstance(host, str) or
                  not isinstance(host, collections.abc.Iterable)):
                hosts = [host]
            else:
                hosts = host

            fs = [self._create_server_getaddrinfo(host, port, family=family,
                                                  flags=flags)
                  for host in hosts]
            infos = await tasks.gather(*fs, loop=self)
            infos = set(itertools.chain.from_iterable(infos))

            completed = False
            try:
                for res in infos:
                    af, socktype, proto, canonname, sa = res
                    try:
                        sock = socket.socket(af, socktype, proto)
                    except socket.error:
                        # Assume it's a bad family/type/protocol combination.
                        if self._debug:
                            logger.warning('create_server() failed to create '
                                           'socket.socket(%r, %r, %r)',
                                           af, socktype, proto, exc_info=True)
                        continue
                    sockets.append(sock)
                    if reuse_address:
                        sock.setsockopt(
                            socket.SOL_SOCKET, socket.SO_REUSEADDR, True)
                    if reuse_port:
                        _set_reuseport(sock)
                    # Disable IPv4/IPv6 dual stack support (enabled by
                    # default on Linux) which makes a single socket
                    # listen on both address families.
                    if (_HAS_IPv6 and
                            af == socket.AF_INET6 and
                            hasattr(socket, 'IPPROTO_IPV6')):
                        sock.setsockopt(socket.IPPROTO_IPV6,
                                        socket.IPV6_V6ONLY,
                                        True)
                    try:
                        sock.bind(sa)
                    except OSError as err:
                        raise OSError(err.errno, 'error while attempting '
                                      'to bind on address %r: %s'
                                      % (sa, err.strerror.lower())) from None
                completed = True
            finally:
                if not completed:
                    for sock in sockets:
                        sock.close()
        else:
            if sock is None:
                raise ValueError('Neither host/port nor sock were specified')
            if sock.type != socket.SOCK_STREAM:
                raise ValueError(f'A Stream Socket was expected, got {sock!r}')
            sockets = [sock]

        for sock in sockets:
            sock.setblocking(False)

        server = Server(self, sockets, protocol_factory,
                        ssl, backlog, ssl_handshake_timeout)
        if start_serving:
            server._start_serving()
            # Skip one loop iteration so that all 'loop.add_reader'
            # go through.
            await tasks.sleep(0, loop=self)

        if self._debug:
            logger.info("%r is serving", server)
        return server

    async def connect_accepted_socket(
            self, protocol_factory, sock,
            *, ssl=None,
            ssl_handshake_timeout=None):
        """Handle an accepted connection.

        This is used by servers that accept connections outside of
        asyncio but that use asyncio to handle connections.

        This method is a coroutine.  When completed, the coroutine
        returns a (transport, protocol) pair.
        """
        if sock.type != socket.SOCK_STREAM:
            raise ValueError(f'A Stream Socket was expected, got {sock!r}')

        if ssl_handshake_timeout is not None and not ssl:
            raise ValueError(
                'ssl_handshake_timeout is only meaningful with ssl')

        transport, protocol = await self._create_connection_transport(
            sock, protocol_factory, ssl, '', server_side=True,
            ssl_handshake_timeout=ssl_handshake_timeout)
        if self._debug:
            # Get the socket from the transport because SSL transport closes
            # the old socket and creates a new SSL socket
            sock = transport.get_extra_info('socket')
            logger.debug("%r handled: (%r, %r)", sock, transport, protocol)
        return transport, protocol

    async def connect_read_pipe(self, protocol_factory, pipe):
        protocol = protocol_factory()
        waiter = self.create_future()
        transport = self._make_read_pipe_transport(pipe, protocol, waiter)

        try:
            await waiter
        except:
            transport.close()
            raise

        if self._debug:
            logger.debug('Read pipe %r connected: (%r, %r)',
                         pipe.fileno(), transport, protocol)
        return transport, protocol

    async def connect_write_pipe(self, protocol_factory, pipe):
        protocol = protocol_factory()
        waiter = self.create_future()
        transport = self._make_write_pipe_transport(pipe, protocol, waiter)

        try:
            await waiter
        except:
            transport.close()
            raise

        if self._debug:
            logger.debug('Write pipe %r connected: (%r, %r)',
                         pipe.fileno(), transport, protocol)
        return transport, protocol

    def _log_subprocess(self, msg, stdin, stdout, stderr):
        info = [msg]
        if stdin is not None:
            info.append(f'stdin={_format_pipe(stdin)}')
        if stdout is not None and stderr == subprocess.STDOUT:
            info.append(f'stdout=stderr={_format_pipe(stdout)}')
        else:
            if stdout is not None:
                info.append(f'stdout={_format_pipe(stdout)}')
            if stderr is not None:
                info.append(f'stderr={_format_pipe(stderr)}')
        logger.debug(' '.join(info))

    async def subprocess_shell(self, protocol_factory, cmd, *,
                               stdin=subprocess.PIPE,
                               stdout=subprocess.PIPE,
                               stderr=subprocess.PIPE,
                               universal_newlines=False,
                               shell=True, bufsize=0,
                               encoding=None, errors=None, text=None,
                               **kwargs):
        if not isinstance(cmd, (bytes, str)):
            raise ValueError("cmd must be a string")
        if universal_newlines:
            raise ValueError("universal_newlines must be False")
        if not shell:
            raise ValueError("shell must be True")
        if bufsize != 0:
            raise ValueError("bufsize must be 0")
        if text:
            raise ValueError("text must be False")
        if encoding is not None:
            raise ValueError("encoding must be None")
        if errors is not None:
            raise ValueError("errors must be None")

        protocol = protocol_factory()
        debug_log = None
        if self._debug:
            # don't log parameters: they may contain sensitive information
            # (password) and may be too long
            debug_log = 'run shell command %r' % cmd
            self._log_subprocess(debug_log, stdin, stdout, stderr)
        transport = await self._make_subprocess_transport(
            protocol, cmd, True, stdin, stdout, stderr, bufsize, **kwargs)
        if self._debug and debug_log is not None:
            logger.info('%s: %r', debug_log, transport)
        return transport, protocol

    async def subprocess_exec(self, protocol_factory, program, *args,
                              stdin=subprocess.PIPE, stdout=subprocess.PIPE,
                              stderr=subprocess.PIPE, universal_newlines=False,
                              shell=False, bufsize=0,
                              encoding=None, errors=None, text=None,
                              **kwargs):
        if universal_newlines:
            raise ValueError("universal_newlines must be False")
        if shell:
            raise ValueError("shell must be False")
        if bufsize != 0:
            raise ValueError("bufsize must be 0")
        if text:
            raise ValueError("text must be False")
        if encoding is not None:
            raise ValueError("encoding must be None")
        if errors is not None:
            raise ValueError("errors must be None")

        popen_args = (program,) + args
        protocol = protocol_factory()
        debug_log = None
        if self._debug:
            # don't log parameters: they may contain sensitive information
            # (password) and may be too long
            debug_log = f'execute program {program!r}'
            self._log_subprocess(debug_log, stdin, stdout, stderr)
        transport = await self._make_subprocess_transport(
            protocol, popen_args, False, stdin, stdout, stderr,
            bufsize, **kwargs)
        if self._debug and debug_log is not None:
            logger.info('%s: %r', debug_log, transport)
        return transport, protocol

    def get_exception_handler(self):
        """Return an exception handler, or None if the default one is in use.
        """
        return self._exception_handler

    def set_exception_handler(self, handler):
        """Set handler as the new event loop exception handler.

        If handler is None, the default exception handler will
        be set.

        If handler is a callable object, it should have a
        signature matching '(loop, context)', where 'loop'
        will be a reference to the active event loop, 'context'
        will be a dict object (see `call_exception_handler()`
        documentation for details about context).
        """
        if handler is not None and not callable(handler):
            raise TypeError(f'A callable object or None is expected, '
                            f'got {handler!r}')
        self._exception_handler = handler

    def default_exception_handler(self, context):
        """Default exception handler.

        This is called when an exception occurs and no exception
        handler is set, and can be called by a custom exception
        handler that wants to defer to the default behavior.

        This default handler logs the error message and other
        context-dependent information.  In debug mode, a truncated
        stack trace is also appended showing where the given object
        (e.g. a handle or future or task) was created, if any.

        The context parameter has the same meaning as in
        `call_exception_handler()`.
        """
        message = context.get('message')
        if not message:
            message = 'Unhandled exception in event loop'

        exception = context.get('exception')
        if exception is not None:
            exc_info = (type(exception), exception, exception.__traceback__)
        else:
            exc_info = False

        if ('source_traceback' not in context and
                self._current_handle is not None and
                self._current_handle._source_traceback):
            context['handle_traceback'] = \
                self._current_handle._source_traceback

        log_lines = [message]
        for key in sorted(context):
            if key in {'message', 'exception'}:
                continue
            value = context[key]
            if key == 'source_traceback':
                tb = ''.join(traceback.format_list(value))
                value = 'Object created at (most recent call last):\n'
                value += tb.rstrip()
            elif key == 'handle_traceback':
                tb = ''.join(traceback.format_list(value))
                value = 'Handle created at (most recent call last):\n'
                value += tb.rstrip()
            else:
                value = repr(value)
            log_lines.append(f'{key}: {value}')

        logger.error('\n'.join(log_lines), exc_info=exc_info)

    def call_exception_handler(self, context):
        """Call the current event loop's exception handler.

        The context argument is a dict containing the following keys:

        - 'message': Error message;
        - 'exception' (optional): Exception object;
        - 'future' (optional): Future instance;
        - 'task' (optional): Task instance;
        - 'handle' (optional): Handle instance;
        - 'protocol' (optional): Protocol instance;
        - 'transport' (optional): Transport instance;
        - 'socket' (optional): Socket instance;
        - 'asyncgen' (optional): Asynchronous generator that caused
                                 the exception.

        New keys maybe introduced in the future.

        Note: do not overload this method in an event loop subclass.
        For custom exception handling, use the
        `set_exception_handler()` method.
        """
        if self._exception_handler is None:
            try:
                self.default_exception_handler(context)
            except (SystemExit, KeyboardInterrupt):
                raise
            except BaseException:
                # Second protection layer for unexpected errors
                # in the default implementation, as well as for subclassed
                # event loops with overloaded "default_exception_handler".
                logger.error('Exception in default exception handler',
                             exc_info=True)
        else:
            try:
                self._exception_handler(self, context)
            except (SystemExit, KeyboardInterrupt):
                raise
            except BaseException as exc:
                # Exception in the user set custom exception handler.
                try:
                    # Let's try default handler.
                    self.default_exception_handler({
                        'message': 'Unhandled error in exception handler',
                        'exception': exc,
                        'context': context,
                    })
                except (SystemExit, KeyboardInterrupt):
                    raise
                except BaseException:
                    # Guard 'default_exception_handler' in case it is
                    # overloaded.
                    logger.error('Exception in default exception handler '
                                 'while handling an unexpected error '
                                 'in custom exception handler',
                                 exc_info=True)

    def _add_callback(self, handle):
        """Add a Handle to _scheduled (TimerHandle) or _ready."""
        assert isinstance(handle, events.Handle), 'A Handle is required here'
        if handle._cancelled:
            return
        assert not isinstance(handle, events.TimerHandle)
        self._ready.append(handle)

    def _add_callback_signalsafe(self, handle):
        """Like _add_callback() but called from a signal handler."""
        self._add_callback(handle)
        self._write_to_self()

    def _timer_handle_cancelled(self, handle):
        """Notification that a TimerHandle has been cancelled."""
        if handle._scheduled:
            self._timer_cancelled_count += 1

    def _run_once(self):
        """Run one full iteration of the event loop.

        This calls all currently ready callbacks, polls for I/O,
        schedules the resulting callbacks, and finally schedules
        'call_later' callbacks.
        """

        sched_count = len(self._scheduled)
        if (sched_count > _MIN_SCHEDULED_TIMER_HANDLES and
            self._timer_cancelled_count / sched_count >
                _MIN_CANCELLED_TIMER_HANDLES_FRACTION):
            # Remove delayed calls that were cancelled if their number
            # is too high
            new_scheduled = []
            for handle in self._scheduled:
                if handle._cancelled:
                    handle._scheduled = False
                else:
                    new_scheduled.append(handle)

            heapq.heapify(new_scheduled)
            self._scheduled = new_scheduled
            self._timer_cancelled_count = 0
        else:
            # Remove delayed calls that were cancelled from head of queue.
            while self._scheduled and self._scheduled[0]._cancelled:
                self._timer_cancelled_count -= 1
                handle = heapq.heappop(self._scheduled)
                handle._scheduled = False

        timeout = None
        if self._ready or self._stopping:
            timeout = 0
        elif self._scheduled:
            # Compute the desired timeout.
            when = self._scheduled[0]._when
            timeout = min(max(0, when - self.time()), MAXIMUM_SELECT_TIMEOUT)

        event_list = self._selector.select(timeout)
        self._process_events(event_list)

        # Handle 'later' callbacks that are ready.
        end_time = self.time() + self._clock_resolution
        while self._scheduled:
            handle = self._scheduled[0]
            if handle._when >= end_time:
                break
            handle = heapq.heappop(self._scheduled)
            handle._scheduled = False
            self._ready.append(handle)

        # This is the only place where callbacks are actually *called*.
        # All other places just add them to ready.
        # Note: We run all currently scheduled callbacks, but not any
        # callbacks scheduled by callbacks run this time around --
        # they will be run the next time (after another I/O poll).
        # Use an idiom that is thread-safe without using locks.
        ntodo = len(self._ready)
        for i in range(ntodo):
            handle = self._ready.popleft()
            if handle._cancelled:
                continue
            if self._debug:
                try:
                    self._current_handle = handle
                    t0 = self.time()
                    handle._run()
                    dt = self.time() - t0
                    if dt >= self.slow_callback_duration:
                        logger.warning('Executing %s took %.3f seconds',
                                       _format_handle(handle), dt)
                finally:
                    self._current_handle = None
            else:
                handle._run()
        handle = None  # Needed to break cycles when an exception occurs.

    def _set_coroutine_origin_tracking(self, enabled):
        if bool(enabled) == bool(self._coroutine_origin_tracking_enabled):
            return

        if enabled:
            self._coroutine_origin_tracking_saved_depth = (
                sys.get_coroutine_origin_tracking_depth())
            sys.set_coroutine_origin_tracking_depth(
                constants.DEBUG_STACK_DEPTH)
        else:
            sys.set_coroutine_origin_tracking_depth(
                self._coroutine_origin_tracking_saved_depth)

        self._coroutine_origin_tracking_enabled = enabled

    def get_debug(self):
        return self._debug

    def set_debug(self, enabled):
        self._debug = enabled

        if self.is_running():
            self.call_soon_threadsafe(self._set_coroutine_origin_tracking, enabled)
asyncio/format_helpers.py000064400000004544151153537520011613 0ustar00import functools
import inspect
import reprlib
import sys
import traceback

from . import constants


def _get_function_source(func):
    func = inspect.unwrap(func)
    if inspect.isfunction(func):
        code = func.__code__
        return (code.co_filename, code.co_firstlineno)
    if isinstance(func, functools.partial):
        return _get_function_source(func.func)
    if isinstance(func, functools.partialmethod):
        return _get_function_source(func.func)
    return None


def _format_callback_source(func, args):
    func_repr = _format_callback(func, args, None)
    source = _get_function_source(func)
    if source:
        func_repr += f' at {source[0]}:{source[1]}'
    return func_repr


def _format_args_and_kwargs(args, kwargs):
    """Format function arguments and keyword arguments.

    Special case for a single parameter: ('hello',) is formatted as ('hello').
    """
    # use reprlib to limit the length of the output
    items = []
    if args:
        items.extend(reprlib.repr(arg) for arg in args)
    if kwargs:
        items.extend(f'{k}={reprlib.repr(v)}' for k, v in kwargs.items())
    return '({})'.format(', '.join(items))


def _format_callback(func, args, kwargs, suffix=''):
    if isinstance(func, functools.partial):
        suffix = _format_args_and_kwargs(args, kwargs) + suffix
        return _format_callback(func.func, func.args, func.keywords, suffix)

    if hasattr(func, '__qualname__') and func.__qualname__:
        func_repr = func.__qualname__
    elif hasattr(func, '__name__') and func.__name__:
        func_repr = func.__name__
    else:
        func_repr = repr(func)

    func_repr += _format_args_and_kwargs(args, kwargs)
    if suffix:
        func_repr += suffix
    return func_repr


def extract_stack(f=None, limit=None):
    """Replacement for traceback.extract_stack() that only does the
    necessary work for asyncio debug mode.
    """
    if f is None:
        f = sys._getframe().f_back
    if limit is None:
        # Limit the amount of work to a reasonable amount, as extract_stack()
        # can be called for each coroutine and future in debug mode.
        limit = constants.DEBUG_STACK_DEPTH
    stack = traceback.StackSummary.extract(traceback.walk_stack(f),
                                           limit=limit,
                                           lookup_lines=False)
    stack.reverse()
    return stack
asyncio/transports.py000064400000024366151153537520011024 0ustar00"""Abstract Transport class."""

__all__ = (
    'BaseTransport', 'ReadTransport', 'WriteTransport',
    'Transport', 'DatagramTransport', 'SubprocessTransport',
)


class BaseTransport:
    """Base class for transports."""

    __slots__ = ('_extra',)

    def __init__(self, extra=None):
        if extra is None:
            extra = {}
        self._extra = extra

    def get_extra_info(self, name, default=None):
        """Get optional transport information."""
        return self._extra.get(name, default)

    def is_closing(self):
        """Return True if the transport is closing or closed."""
        raise NotImplementedError

    def close(self):
        """Close the transport.

        Buffered data will be flushed asynchronously.  No more data
        will be received.  After all buffered data is flushed, the
        protocol's connection_lost() method will (eventually) be
        called with None as its argument.
        """
        raise NotImplementedError

    def set_protocol(self, protocol):
        """Set a new protocol."""
        raise NotImplementedError

    def get_protocol(self):
        """Return the current protocol."""
        raise NotImplementedError


class ReadTransport(BaseTransport):
    """Interface for read-only transports."""

    __slots__ = ()

    def is_reading(self):
        """Return True if the transport is receiving."""
        raise NotImplementedError

    def pause_reading(self):
        """Pause the receiving end.

        No data will be passed to the protocol's data_received()
        method until resume_reading() is called.
        """
        raise NotImplementedError

    def resume_reading(self):
        """Resume the receiving end.

        Data received will once again be passed to the protocol's
        data_received() method.
        """
        raise NotImplementedError


class WriteTransport(BaseTransport):
    """Interface for write-only transports."""

    __slots__ = ()

    def set_write_buffer_limits(self, high=None, low=None):
        """Set the high- and low-water limits for write flow control.

        These two values control when to call the protocol's
        pause_writing() and resume_writing() methods.  If specified,
        the low-water limit must be less than or equal to the
        high-water limit.  Neither value can be negative.

        The defaults are implementation-specific.  If only the
        high-water limit is given, the low-water limit defaults to an
        implementation-specific value less than or equal to the
        high-water limit.  Setting high to zero forces low to zero as
        well, and causes pause_writing() to be called whenever the
        buffer becomes non-empty.  Setting low to zero causes
        resume_writing() to be called only once the buffer is empty.
        Use of zero for either limit is generally sub-optimal as it
        reduces opportunities for doing I/O and computation
        concurrently.
        """
        raise NotImplementedError

    def get_write_buffer_size(self):
        """Return the current size of the write buffer."""
        raise NotImplementedError

    def write(self, data):
        """Write some data bytes to the transport.

        This does not block; it buffers the data and arranges for it
        to be sent out asynchronously.
        """
        raise NotImplementedError

    def writelines(self, list_of_data):
        """Write a list (or any iterable) of data bytes to the transport.

        The default implementation concatenates the arguments and
        calls write() on the result.
        """
        data = b''.join(list_of_data)
        self.write(data)

    def write_eof(self):
        """Close the write end after flushing buffered data.

        (This is like typing ^D into a UNIX program reading from stdin.)

        Data may still be received.
        """
        raise NotImplementedError

    def can_write_eof(self):
        """Return True if this transport supports write_eof(), False if not."""
        raise NotImplementedError

    def abort(self):
        """Close the transport immediately.

        Buffered data will be lost.  No more data will be received.
        The protocol's connection_lost() method will (eventually) be
        called with None as its argument.
        """
        raise NotImplementedError


class Transport(ReadTransport, WriteTransport):
    """Interface representing a bidirectional transport.

    There may be several implementations, but typically, the user does
    not implement new transports; rather, the platform provides some
    useful transports that are implemented using the platform's best
    practices.

    The user never instantiates a transport directly; they call a
    utility function, passing it a protocol factory and other
    information necessary to create the transport and protocol.  (E.g.
    EventLoop.create_connection() or EventLoop.create_server().)

    The utility function will asynchronously create a transport and a
    protocol and hook them up by calling the protocol's
    connection_made() method, passing it the transport.

    The implementation here raises NotImplemented for every method
    except writelines(), which calls write() in a loop.
    """

    __slots__ = ()


class DatagramTransport(BaseTransport):
    """Interface for datagram (UDP) transports."""

    __slots__ = ()

    def sendto(self, data, addr=None):
        """Send data to the transport.

        This does not block; it buffers the data and arranges for it
        to be sent out asynchronously.
        addr is target socket address.
        If addr is None use target address pointed on transport creation.
        """
        raise NotImplementedError

    def abort(self):
        """Close the transport immediately.

        Buffered data will be lost.  No more data will be received.
        The protocol's connection_lost() method will (eventually) be
        called with None as its argument.
        """
        raise NotImplementedError


class SubprocessTransport(BaseTransport):

    __slots__ = ()

    def get_pid(self):
        """Get subprocess id."""
        raise NotImplementedError

    def get_returncode(self):
        """Get subprocess returncode.

        See also
        http://docs.python.org/3/library/subprocess#subprocess.Popen.returncode
        """
        raise NotImplementedError

    def get_pipe_transport(self, fd):
        """Get transport for pipe with number fd."""
        raise NotImplementedError

    def send_signal(self, signal):
        """Send signal to subprocess.

        See also:
        docs.python.org/3/library/subprocess#subprocess.Popen.send_signal
        """
        raise NotImplementedError

    def terminate(self):
        """Stop the subprocess.

        Alias for close() method.

        On Posix OSs the method sends SIGTERM to the subprocess.
        On Windows the Win32 API function TerminateProcess()
         is called to stop the subprocess.

        See also:
        http://docs.python.org/3/library/subprocess#subprocess.Popen.terminate
        """
        raise NotImplementedError

    def kill(self):
        """Kill the subprocess.

        On Posix OSs the function sends SIGKILL to the subprocess.
        On Windows kill() is an alias for terminate().

        See also:
        http://docs.python.org/3/library/subprocess#subprocess.Popen.kill
        """
        raise NotImplementedError


class _FlowControlMixin(Transport):
    """All the logic for (write) flow control in a mix-in base class.

    The subclass must implement get_write_buffer_size().  It must call
    _maybe_pause_protocol() whenever the write buffer size increases,
    and _maybe_resume_protocol() whenever it decreases.  It may also
    override set_write_buffer_limits() (e.g. to specify different
    defaults).

    The subclass constructor must call super().__init__(extra).  This
    will call set_write_buffer_limits().

    The user may call set_write_buffer_limits() and
    get_write_buffer_size(), and their protocol's pause_writing() and
    resume_writing() may be called.
    """

    __slots__ = ('_loop', '_protocol_paused', '_high_water', '_low_water')

    def __init__(self, extra=None, loop=None):
        super().__init__(extra)
        assert loop is not None
        self._loop = loop
        self._protocol_paused = False
        self._set_write_buffer_limits()

    def _maybe_pause_protocol(self):
        size = self.get_write_buffer_size()
        if size <= self._high_water:
            return
        if not self._protocol_paused:
            self._protocol_paused = True
            try:
                self._protocol.pause_writing()
            except (SystemExit, KeyboardInterrupt):
                raise
            except BaseException as exc:
                self._loop.call_exception_handler({
                    'message': 'protocol.pause_writing() failed',
                    'exception': exc,
                    'transport': self,
                    'protocol': self._protocol,
                })

    def _maybe_resume_protocol(self):
        if (self._protocol_paused and
                self.get_write_buffer_size() <= self._low_water):
            self._protocol_paused = False
            try:
                self._protocol.resume_writing()
            except (SystemExit, KeyboardInterrupt):
                raise
            except BaseException as exc:
                self._loop.call_exception_handler({
                    'message': 'protocol.resume_writing() failed',
                    'exception': exc,
                    'transport': self,
                    'protocol': self._protocol,
                })

    def get_write_buffer_limits(self):
        return (self._low_water, self._high_water)

    def _set_write_buffer_limits(self, high=None, low=None):
        if high is None:
            if low is None:
                high = 64 * 1024
            else:
                high = 4 * low
        if low is None:
            low = high // 4

        if not high >= low >= 0:
            raise ValueError(
                f'high ({high!r}) must be >= low ({low!r}) must be >= 0')

        self._high_water = high
        self._low_water = low

    def set_write_buffer_limits(self, high=None, low=None):
        self._set_write_buffer_limits(high=high, low=low)
        self._maybe_pause_protocol()

    def get_write_buffer_size(self):
        raise NotImplementedError
asyncio/exceptions.py000064400000003141151153537520010752 0ustar00"""asyncio exceptions."""


__all__ = ('CancelledError', 'InvalidStateError', 'TimeoutError',
           'IncompleteReadError', 'LimitOverrunError',
           'SendfileNotAvailableError')


class CancelledError(BaseException):
    """The Future or Task was cancelled."""


class TimeoutError(Exception):
    """The operation exceeded the given deadline."""


class InvalidStateError(Exception):
    """The operation is not allowed in this state."""


class SendfileNotAvailableError(RuntimeError):
    """Sendfile syscall is not available.

    Raised if OS does not support sendfile syscall for given socket or
    file type.
    """


class IncompleteReadError(EOFError):
    """
    Incomplete read error. Attributes:

    - partial: read bytes string before the end of stream was reached
    - expected: total number of expected bytes (or None if unknown)
    """
    def __init__(self, partial, expected):
        r_expected = 'undefined' if expected is None else repr(expected)
        super().__init__(f'{len(partial)} bytes read on a total of '
                         f'{r_expected} expected bytes')
        self.partial = partial
        self.expected = expected

    def __reduce__(self):
        return type(self), (self.partial, self.expected)


class LimitOverrunError(Exception):
    """Reached the buffer limit while looking for a separator.

    Attributes:
    - consumed: total number of to be consumed bytes.
    """
    def __init__(self, message, consumed):
        super().__init__(message)
        self.consumed = consumed

    def __reduce__(self):
        return type(self), (self.args[0], self.consumed)
asyncio/protocols.py000064400000015740151153537520010625 0ustar00"""Abstract Protocol base classes."""

__all__ = (
    'BaseProtocol', 'Protocol', 'DatagramProtocol',
    'SubprocessProtocol', 'BufferedProtocol',
)


class BaseProtocol:
    """Common base class for protocol interfaces.

    Usually user implements protocols that derived from BaseProtocol
    like Protocol or ProcessProtocol.

    The only case when BaseProtocol should be implemented directly is
    write-only transport like write pipe
    """

    __slots__ = ()

    def connection_made(self, transport):
        """Called when a connection is made.

        The argument is the transport representing the pipe connection.
        To receive data, wait for data_received() calls.
        When the connection is closed, connection_lost() is called.
        """

    def connection_lost(self, exc):
        """Called when the connection is lost or closed.

        The argument is an exception object or None (the latter
        meaning a regular EOF is received or the connection was
        aborted or closed).
        """

    def pause_writing(self):
        """Called when the transport's buffer goes over the high-water mark.

        Pause and resume calls are paired -- pause_writing() is called
        once when the buffer goes strictly over the high-water mark
        (even if subsequent writes increases the buffer size even
        more), and eventually resume_writing() is called once when the
        buffer size reaches the low-water mark.

        Note that if the buffer size equals the high-water mark,
        pause_writing() is not called -- it must go strictly over.
        Conversely, resume_writing() is called when the buffer size is
        equal or lower than the low-water mark.  These end conditions
        are important to ensure that things go as expected when either
        mark is zero.

        NOTE: This is the only Protocol callback that is not called
        through EventLoop.call_soon() -- if it were, it would have no
        effect when it's most needed (when the app keeps writing
        without yielding until pause_writing() is called).
        """

    def resume_writing(self):
        """Called when the transport's buffer drains below the low-water mark.

        See pause_writing() for details.
        """


class Protocol(BaseProtocol):
    """Interface for stream protocol.

    The user should implement this interface.  They can inherit from
    this class but don't need to.  The implementations here do
    nothing (they don't raise exceptions).

    When the user wants to requests a transport, they pass a protocol
    factory to a utility function (e.g., EventLoop.create_connection()).

    When the connection is made successfully, connection_made() is
    called with a suitable transport object.  Then data_received()
    will be called 0 or more times with data (bytes) received from the
    transport; finally, connection_lost() will be called exactly once
    with either an exception object or None as an argument.

    State machine of calls:

      start -> CM [-> DR*] [-> ER?] -> CL -> end

    * CM: connection_made()
    * DR: data_received()
    * ER: eof_received()
    * CL: connection_lost()
    """

    __slots__ = ()

    def data_received(self, data):
        """Called when some data is received.

        The argument is a bytes object.
        """

    def eof_received(self):
        """Called when the other end calls write_eof() or equivalent.

        If this returns a false value (including None), the transport
        will close itself.  If it returns a true value, closing the
        transport is up to the protocol.
        """


class BufferedProtocol(BaseProtocol):
    """Interface for stream protocol with manual buffer control.

    Important: this has been added to asyncio in Python 3.7
    *on a provisional basis*!  Consider it as an experimental API that
    might be changed or removed in Python 3.8.

    Event methods, such as `create_server` and `create_connection`,
    accept factories that return protocols that implement this interface.

    The idea of BufferedProtocol is that it allows to manually allocate
    and control the receive buffer.  Event loops can then use the buffer
    provided by the protocol to avoid unnecessary data copies.  This
    can result in noticeable performance improvement for protocols that
    receive big amounts of data.  Sophisticated protocols can allocate
    the buffer only once at creation time.

    State machine of calls:

      start -> CM [-> GB [-> BU?]]* [-> ER?] -> CL -> end

    * CM: connection_made()
    * GB: get_buffer()
    * BU: buffer_updated()
    * ER: eof_received()
    * CL: connection_lost()
    """

    __slots__ = ()

    def get_buffer(self, sizehint):
        """Called to allocate a new receive buffer.

        *sizehint* is a recommended minimal size for the returned
        buffer.  When set to -1, the buffer size can be arbitrary.

        Must return an object that implements the
        :ref:`buffer protocol <bufferobjects>`.
        It is an error to return a zero-sized buffer.
        """

    def buffer_updated(self, nbytes):
        """Called when the buffer was updated with the received data.

        *nbytes* is the total number of bytes that were written to
        the buffer.
        """

    def eof_received(self):
        """Called when the other end calls write_eof() or equivalent.

        If this returns a false value (including None), the transport
        will close itself.  If it returns a true value, closing the
        transport is up to the protocol.
        """


class DatagramProtocol(BaseProtocol):
    """Interface for datagram protocol."""

    __slots__ = ()

    def datagram_received(self, data, addr):
        """Called when some datagram is received."""

    def error_received(self, exc):
        """Called when a send or receive operation raises an OSError.

        (Other than BlockingIOError or InterruptedError.)
        """


class SubprocessProtocol(BaseProtocol):
    """Interface for protocol for subprocess calls."""

    __slots__ = ()

    def pipe_data_received(self, fd, data):
        """Called when the subprocess writes data into stdout/stderr pipe.

        fd is int file descriptor.
        data is bytes object.
        """

    def pipe_connection_lost(self, fd, exc):
        """Called when a file descriptor associated with the child process is
        closed.

        fd is the int file descriptor that was closed.
        """

    def process_exited(self):
        """Called when subprocess has exited."""


def _feed_data_to_buffered_proto(proto, data):
    data_len = len(data)
    while data_len:
        buf = proto.get_buffer(data_len)
        buf_len = len(buf)
        if not buf_len:
            raise RuntimeError('get_buffer() returned an empty buffer')

        if buf_len >= data_len:
            buf[:data_len] = data
            proto.buffer_updated(data_len)
            return
        else:
            buf[:buf_len] = data[:buf_len]
            proto.buffer_updated(buf_len)
            data = data[buf_len:]
            data_len = len(data)
asyncio/subprocess.py000064400000017604151153537520010772 0ustar00__all__ = 'create_subprocess_exec', 'create_subprocess_shell'

import subprocess
import warnings

from . import events
from . import protocols
from . import streams
from . import tasks
from .log import logger


PIPE = subprocess.PIPE
STDOUT = subprocess.STDOUT
DEVNULL = subprocess.DEVNULL


class SubprocessStreamProtocol(streams.FlowControlMixin,
                               protocols.SubprocessProtocol):
    """Like StreamReaderProtocol, but for a subprocess."""

    def __init__(self, limit, loop):
        super().__init__(loop=loop)
        self._limit = limit
        self.stdin = self.stdout = self.stderr = None
        self._transport = None
        self._process_exited = False
        self._pipe_fds = []
        self._stdin_closed = self._loop.create_future()

    def __repr__(self):
        info = [self.__class__.__name__]
        if self.stdin is not None:
            info.append(f'stdin={self.stdin!r}')
        if self.stdout is not None:
            info.append(f'stdout={self.stdout!r}')
        if self.stderr is not None:
            info.append(f'stderr={self.stderr!r}')
        return '<{}>'.format(' '.join(info))

    def connection_made(self, transport):
        self._transport = transport

        stdout_transport = transport.get_pipe_transport(1)
        if stdout_transport is not None:
            self.stdout = streams.StreamReader(limit=self._limit,
                                               loop=self._loop)
            self.stdout.set_transport(stdout_transport)
            self._pipe_fds.append(1)

        stderr_transport = transport.get_pipe_transport(2)
        if stderr_transport is not None:
            self.stderr = streams.StreamReader(limit=self._limit,
                                               loop=self._loop)
            self.stderr.set_transport(stderr_transport)
            self._pipe_fds.append(2)

        stdin_transport = transport.get_pipe_transport(0)
        if stdin_transport is not None:
            self.stdin = streams.StreamWriter(stdin_transport,
                                              protocol=self,
                                              reader=None,
                                              loop=self._loop)

    def pipe_data_received(self, fd, data):
        if fd == 1:
            reader = self.stdout
        elif fd == 2:
            reader = self.stderr
        else:
            reader = None
        if reader is not None:
            reader.feed_data(data)

    def pipe_connection_lost(self, fd, exc):
        if fd == 0:
            pipe = self.stdin
            if pipe is not None:
                pipe.close()
            self.connection_lost(exc)
            if exc is None:
                self._stdin_closed.set_result(None)
            else:
                self._stdin_closed.set_exception(exc)
            return
        if fd == 1:
            reader = self.stdout
        elif fd == 2:
            reader = self.stderr
        else:
            reader = None
        if reader is not None:
            if exc is None:
                reader.feed_eof()
            else:
                reader.set_exception(exc)

        if fd in self._pipe_fds:
            self._pipe_fds.remove(fd)
        self._maybe_close_transport()

    def process_exited(self):
        self._process_exited = True
        self._maybe_close_transport()

    def _maybe_close_transport(self):
        if len(self._pipe_fds) == 0 and self._process_exited:
            self._transport.close()
            self._transport = None

    def _get_close_waiter(self, stream):
        if stream is self.stdin:
            return self._stdin_closed


class Process:
    def __init__(self, transport, protocol, loop):
        self._transport = transport
        self._protocol = protocol
        self._loop = loop
        self.stdin = protocol.stdin
        self.stdout = protocol.stdout
        self.stderr = protocol.stderr
        self.pid = transport.get_pid()

    def __repr__(self):
        return f'<{self.__class__.__name__} {self.pid}>'

    @property
    def returncode(self):
        return self._transport.get_returncode()

    async def wait(self):
        """Wait until the process exit and return the process return code."""
        return await self._transport._wait()

    def send_signal(self, signal):
        self._transport.send_signal(signal)

    def terminate(self):
        self._transport.terminate()

    def kill(self):
        self._transport.kill()

    async def _feed_stdin(self, input):
        debug = self._loop.get_debug()
        self.stdin.write(input)
        if debug:
            logger.debug(
                '%r communicate: feed stdin (%s bytes)', self, len(input))
        try:
            await self.stdin.drain()
        except (BrokenPipeError, ConnectionResetError) as exc:
            # communicate() ignores BrokenPipeError and ConnectionResetError
            if debug:
                logger.debug('%r communicate: stdin got %r', self, exc)

        if debug:
            logger.debug('%r communicate: close stdin', self)
        self.stdin.close()

    async def _noop(self):
        return None

    async def _read_stream(self, fd):
        transport = self._transport.get_pipe_transport(fd)
        if fd == 2:
            stream = self.stderr
        else:
            assert fd == 1
            stream = self.stdout
        if self._loop.get_debug():
            name = 'stdout' if fd == 1 else 'stderr'
            logger.debug('%r communicate: read %s', self, name)
        output = await stream.read()
        if self._loop.get_debug():
            name = 'stdout' if fd == 1 else 'stderr'
            logger.debug('%r communicate: close %s', self, name)
        transport.close()
        return output

    async def communicate(self, input=None):
        if input is not None:
            stdin = self._feed_stdin(input)
        else:
            stdin = self._noop()
        if self.stdout is not None:
            stdout = self._read_stream(1)
        else:
            stdout = self._noop()
        if self.stderr is not None:
            stderr = self._read_stream(2)
        else:
            stderr = self._noop()
        stdin, stdout, stderr = await tasks.gather(stdin, stdout, stderr,
                                                   loop=self._loop)
        await self.wait()
        return (stdout, stderr)


async def create_subprocess_shell(cmd, stdin=None, stdout=None, stderr=None,
                                  loop=None, limit=streams._DEFAULT_LIMIT,
                                  **kwds):
    if loop is None:
        loop = events.get_event_loop()
    else:
        warnings.warn("The loop argument is deprecated since Python 3.8 "
                      "and scheduled for removal in Python 3.10.",
                      DeprecationWarning,
                      stacklevel=2
        )

    protocol_factory = lambda: SubprocessStreamProtocol(limit=limit,
                                                        loop=loop)
    transport, protocol = await loop.subprocess_shell(
        protocol_factory,
        cmd, stdin=stdin, stdout=stdout,
        stderr=stderr, **kwds)
    return Process(transport, protocol, loop)


async def create_subprocess_exec(program, *args, stdin=None, stdout=None,
                                 stderr=None, loop=None,
                                 limit=streams._DEFAULT_LIMIT, **kwds):
    if loop is None:
        loop = events.get_event_loop()
    else:
        warnings.warn("The loop argument is deprecated since Python 3.8 "
                      "and scheduled for removal in Python 3.10.",
                      DeprecationWarning,
                      stacklevel=2
        )
    protocol_factory = lambda: SubprocessStreamProtocol(limit=limit,
                                                        loop=loop)
    transport, protocol = await loop.subprocess_exec(
        protocol_factory,
        program, *args,
        stdin=stdin, stdout=stdout,
        stderr=stderr, **kwds)
    return Process(transport, protocol, loop)
asyncio/constants.py000064400000001570151153537520010611 0ustar00import enum

# After the connection is lost, log warnings after this many write()s.
LOG_THRESHOLD_FOR_CONNLOST_WRITES = 5

# Seconds to wait before retrying accept().
ACCEPT_RETRY_DELAY = 1

# Number of stack entries to capture in debug mode.
# The larger the number, the slower the operation in debug mode
# (see extract_stack() in format_helpers.py).
DEBUG_STACK_DEPTH = 10

# Number of seconds to wait for SSL handshake to complete
# The default timeout matches that of Nginx.
SSL_HANDSHAKE_TIMEOUT = 60.0

# Used in sendfile fallback code.  We use fallback for platforms
# that don't support sendfile, or for TLS connections.
SENDFILE_FALLBACK_READBUFFER_SIZE = 1024 * 256

# The enum should be here to break circular dependencies between
# base_events and sslproto
class _SendfileMode(enum.Enum):
    UNSUPPORTED = enum.auto()
    TRY_NATIVE = enum.auto()
    FALLBACK = enum.auto()
asyncio/staggered.py000064400000013550151153537520010543 0ustar00"""Support for running coroutines in parallel with staggered start times."""

__all__ = 'staggered_race',

import contextlib
import typing

from . import events
from . import exceptions as exceptions_mod
from . import locks
from . import tasks


async def staggered_race(
        coro_fns: typing.Iterable[typing.Callable[[], typing.Awaitable]],
        delay: typing.Optional[float],
        *,
        loop: events.AbstractEventLoop = None,
) -> typing.Tuple[
    typing.Any,
    typing.Optional[int],
    typing.List[typing.Optional[Exception]]
]:
    """Run coroutines with staggered start times and take the first to finish.

    This method takes an iterable of coroutine functions. The first one is
    started immediately. From then on, whenever the immediately preceding one
    fails (raises an exception), or when *delay* seconds has passed, the next
    coroutine is started. This continues until one of the coroutines complete
    successfully, in which case all others are cancelled, or until all
    coroutines fail.

    The coroutines provided should be well-behaved in the following way:

    * They should only ``return`` if completed successfully.

    * They should always raise an exception if they did not complete
      successfully. In particular, if they handle cancellation, they should
      probably reraise, like this::

        try:
            # do work
        except asyncio.CancelledError:
            # undo partially completed work
            raise

    Args:
        coro_fns: an iterable of coroutine functions, i.e. callables that
            return a coroutine object when called. Use ``functools.partial`` or
            lambdas to pass arguments.

        delay: amount of time, in seconds, between starting coroutines. If
            ``None``, the coroutines will run sequentially.

        loop: the event loop to use.

    Returns:
        tuple *(winner_result, winner_index, exceptions)* where

        - *winner_result*: the result of the winning coroutine, or ``None``
          if no coroutines won.

        - *winner_index*: the index of the winning coroutine in
          ``coro_fns``, or ``None`` if no coroutines won. If the winning
          coroutine may return None on success, *winner_index* can be used
          to definitively determine whether any coroutine won.

        - *exceptions*: list of exceptions returned by the coroutines.
          ``len(exceptions)`` is equal to the number of coroutines actually
          started, and the order is the same as in ``coro_fns``. The winning
          coroutine's entry is ``None``.

    """
    # TODO: when we have aiter() and anext(), allow async iterables in coro_fns.
    loop = loop or events.get_running_loop()
    enum_coro_fns = enumerate(coro_fns)
    winner_result = None
    winner_index = None
    exceptions = []
    running_tasks = []

    async def run_one_coro(
            previous_failed: typing.Optional[locks.Event]) -> None:
        # Wait for the previous task to finish, or for delay seconds
        if previous_failed is not None:
            with contextlib.suppress(exceptions_mod.TimeoutError):
                # Use asyncio.wait_for() instead of asyncio.wait() here, so
                # that if we get cancelled at this point, Event.wait() is also
                # cancelled, otherwise there will be a "Task destroyed but it is
                # pending" later.
                await tasks.wait_for(previous_failed.wait(), delay)
        # Get the next coroutine to run
        try:
            this_index, coro_fn = next(enum_coro_fns)
        except StopIteration:
            return
        # Start task that will run the next coroutine
        this_failed = locks.Event()
        next_task = loop.create_task(run_one_coro(this_failed))
        running_tasks.append(next_task)
        assert len(running_tasks) == this_index + 2
        # Prepare place to put this coroutine's exceptions if not won
        exceptions.append(None)
        assert len(exceptions) == this_index + 1

        try:
            result = await coro_fn()
        except (SystemExit, KeyboardInterrupt):
            raise
        except BaseException as e:
            exceptions[this_index] = e
            this_failed.set()  # Kickstart the next coroutine
        else:
            # Store winner's results
            nonlocal winner_index, winner_result
            assert winner_index is None
            winner_index = this_index
            winner_result = result
            # Cancel all other tasks. We take care to not cancel the current
            # task as well. If we do so, then since there is no `await` after
            # here and CancelledError are usually thrown at one, we will
            # encounter a curious corner case where the current task will end
            # up as done() == True, cancelled() == False, exception() ==
            # asyncio.CancelledError. This behavior is specified in
            # https://bugs.python.org/issue30048
            for i, t in enumerate(running_tasks):
                if i != this_index:
                    t.cancel()

    first_task = loop.create_task(run_one_coro(None))
    running_tasks.append(first_task)
    try:
        # Wait for a growing list of tasks to all finish: poor man's version of
        # curio's TaskGroup or trio's nursery
        done_count = 0
        while done_count != len(running_tasks):
            done, _ = await tasks.wait(running_tasks)
            done_count = len(done)
            # If run_one_coro raises an unhandled exception, it's probably a
            # programming error, and I want to see it.
            if __debug__:
                for d in done:
                    if d.done() and not d.cancelled() and d.exception():
                        raise d.exception()
        return winner_result, winner_index, exceptions
    finally:
        # Make sure no tasks are left running if we leave this function
        for t in running_tasks:
            t.cancel()
asyncio/__main__.py000064400000006417151153537520010322 0ustar00import ast
import asyncio
import code
import concurrent.futures
import inspect
import sys
import threading
import types
import warnings

from . import futures


class AsyncIOInteractiveConsole(code.InteractiveConsole):

    def __init__(self, locals, loop):
        super().__init__(locals)
        self.compile.compiler.flags |= ast.PyCF_ALLOW_TOP_LEVEL_AWAIT

        self.loop = loop

    def runcode(self, code):
        future = concurrent.futures.Future()

        def callback():
            global repl_future
            global repl_future_interrupted

            repl_future = None
            repl_future_interrupted = False

            func = types.FunctionType(code, self.locals)
            try:
                coro = func()
            except SystemExit:
                raise
            except KeyboardInterrupt as ex:
                repl_future_interrupted = True
                future.set_exception(ex)
                return
            except BaseException as ex:
                future.set_exception(ex)
                return

            if not inspect.iscoroutine(coro):
                future.set_result(coro)
                return

            try:
                repl_future = self.loop.create_task(coro)
                futures._chain_future(repl_future, future)
            except BaseException as exc:
                future.set_exception(exc)

        loop.call_soon_threadsafe(callback)

        try:
            return future.result()
        except SystemExit:
            raise
        except BaseException:
            if repl_future_interrupted:
                self.write("\nKeyboardInterrupt\n")
            else:
                self.showtraceback()


class REPLThread(threading.Thread):

    def run(self):
        try:
            banner = (
                f'asyncio REPL {sys.version} on {sys.platform}\n'
                f'Use "await" directly instead of "asyncio.run()".\n'
                f'Type "help", "copyright", "credits" or "license" '
                f'for more information.\n'
                f'{getattr(sys, "ps1", ">>> ")}import asyncio'
            )

            console.interact(
                banner=banner,
                exitmsg='exiting asyncio REPL...')
        finally:
            warnings.filterwarnings(
                'ignore',
                message=r'^coroutine .* was never awaited$',
                category=RuntimeWarning)

            loop.call_soon_threadsafe(loop.stop)


if __name__ == '__main__':
    loop = asyncio.new_event_loop()
    asyncio.set_event_loop(loop)

    repl_locals = {'asyncio': asyncio}
    for key in {'__name__', '__package__',
                '__loader__', '__spec__',
                '__builtins__', '__file__'}:
        repl_locals[key] = locals()[key]

    console = AsyncIOInteractiveConsole(repl_locals, loop)

    repl_future = None
    repl_future_interrupted = False

    try:
        import readline  # NoQA
    except ImportError:
        pass

    repl_thread = REPLThread()
    repl_thread.daemon = True
    repl_thread.start()

    while True:
        try:
            loop.run_forever()
        except KeyboardInterrupt:
            if repl_future and not repl_future.done():
                repl_future.cancel()
                repl_future_interrupted = True
            continue
        else:
            break
asyncio/queues.py000064400000020037151153537520010103 0ustar00__all__ = ('Queue', 'PriorityQueue', 'LifoQueue', 'QueueFull', 'QueueEmpty')

import collections
import heapq
import warnings

from . import events
from . import locks


class QueueEmpty(Exception):
    """Raised when Queue.get_nowait() is called on an empty Queue."""
    pass


class QueueFull(Exception):
    """Raised when the Queue.put_nowait() method is called on a full Queue."""
    pass


class Queue:
    """A queue, useful for coordinating producer and consumer coroutines.

    If maxsize is less than or equal to zero, the queue size is infinite. If it
    is an integer greater than 0, then "await put()" will block when the
    queue reaches maxsize, until an item is removed by get().

    Unlike the standard library Queue, you can reliably know this Queue's size
    with qsize(), since your single-threaded asyncio application won't be
    interrupted between calling qsize() and doing an operation on the Queue.
    """

    def __init__(self, maxsize=0, *, loop=None):
        if loop is None:
            self._loop = events.get_event_loop()
        else:
            self._loop = loop
            warnings.warn("The loop argument is deprecated since Python 3.8, "
                          "and scheduled for removal in Python 3.10.",
                          DeprecationWarning, stacklevel=2)
        self._maxsize = maxsize

        # Futures.
        self._getters = collections.deque()
        # Futures.
        self._putters = collections.deque()
        self._unfinished_tasks = 0
        self._finished = locks.Event(loop=loop)
        self._finished.set()
        self._init(maxsize)

    # These three are overridable in subclasses.

    def _init(self, maxsize):
        self._queue = collections.deque()

    def _get(self):
        return self._queue.popleft()

    def _put(self, item):
        self._queue.append(item)

    # End of the overridable methods.

    def _wakeup_next(self, waiters):
        # Wake up the next waiter (if any) that isn't cancelled.
        while waiters:
            waiter = waiters.popleft()
            if not waiter.done():
                waiter.set_result(None)
                break

    def __repr__(self):
        return f'<{type(self).__name__} at {id(self):#x} {self._format()}>'

    def __str__(self):
        return f'<{type(self).__name__} {self._format()}>'

    def _format(self):
        result = f'maxsize={self._maxsize!r}'
        if getattr(self, '_queue', None):
            result += f' _queue={list(self._queue)!r}'
        if self._getters:
            result += f' _getters[{len(self._getters)}]'
        if self._putters:
            result += f' _putters[{len(self._putters)}]'
        if self._unfinished_tasks:
            result += f' tasks={self._unfinished_tasks}'
        return result

    def qsize(self):
        """Number of items in the queue."""
        return len(self._queue)

    @property
    def maxsize(self):
        """Number of items allowed in the queue."""
        return self._maxsize

    def empty(self):
        """Return True if the queue is empty, False otherwise."""
        return not self._queue

    def full(self):
        """Return True if there are maxsize items in the queue.

        Note: if the Queue was initialized with maxsize=0 (the default),
        then full() is never True.
        """
        if self._maxsize <= 0:
            return False
        else:
            return self.qsize() >= self._maxsize

    async def put(self, item):
        """Put an item into the queue.

        Put an item into the queue. If the queue is full, wait until a free
        slot is available before adding item.
        """
        while self.full():
            putter = self._loop.create_future()
            self._putters.append(putter)
            try:
                await putter
            except:
                putter.cancel()  # Just in case putter is not done yet.
                try:
                    # Clean self._putters from canceled putters.
                    self._putters.remove(putter)
                except ValueError:
                    # The putter could be removed from self._putters by a
                    # previous get_nowait call.
                    pass
                if not self.full() and not putter.cancelled():
                    # We were woken up by get_nowait(), but can't take
                    # the call.  Wake up the next in line.
                    self._wakeup_next(self._putters)
                raise
        return self.put_nowait(item)

    def put_nowait(self, item):
        """Put an item into the queue without blocking.

        If no free slot is immediately available, raise QueueFull.
        """
        if self.full():
            raise QueueFull
        self._put(item)
        self._unfinished_tasks += 1
        self._finished.clear()
        self._wakeup_next(self._getters)

    async def get(self):
        """Remove and return an item from the queue.

        If queue is empty, wait until an item is available.
        """
        while self.empty():
            getter = self._loop.create_future()
            self._getters.append(getter)
            try:
                await getter
            except:
                getter.cancel()  # Just in case getter is not done yet.
                try:
                    # Clean self._getters from canceled getters.
                    self._getters.remove(getter)
                except ValueError:
                    # The getter could be removed from self._getters by a
                    # previous put_nowait call.
                    pass
                if not self.empty() and not getter.cancelled():
                    # We were woken up by put_nowait(), but can't take
                    # the call.  Wake up the next in line.
                    self._wakeup_next(self._getters)
                raise
        return self.get_nowait()

    def get_nowait(self):
        """Remove and return an item from the queue.

        Return an item if one is immediately available, else raise QueueEmpty.
        """
        if self.empty():
            raise QueueEmpty
        item = self._get()
        self._wakeup_next(self._putters)
        return item

    def task_done(self):
        """Indicate that a formerly enqueued task is complete.

        Used by queue consumers. For each get() used to fetch a task,
        a subsequent call to task_done() tells the queue that the processing
        on the task is complete.

        If a join() is currently blocking, it will resume when all items have
        been processed (meaning that a task_done() call was received for every
        item that had been put() into the queue).

        Raises ValueError if called more times than there were items placed in
        the queue.
        """
        if self._unfinished_tasks <= 0:
            raise ValueError('task_done() called too many times')
        self._unfinished_tasks -= 1
        if self._unfinished_tasks == 0:
            self._finished.set()

    async def join(self):
        """Block until all items in the queue have been gotten and processed.

        The count of unfinished tasks goes up whenever an item is added to the
        queue. The count goes down whenever a consumer calls task_done() to
        indicate that the item was retrieved and all work on it is complete.
        When the count of unfinished tasks drops to zero, join() unblocks.
        """
        if self._unfinished_tasks > 0:
            await self._finished.wait()


class PriorityQueue(Queue):
    """A subclass of Queue; retrieves entries in priority order (lowest first).

    Entries are typically tuples of the form: (priority number, data).
    """

    def _init(self, maxsize):
        self._queue = []

    def _put(self, item, heappush=heapq.heappush):
        heappush(self._queue, item)

    def _get(self, heappop=heapq.heappop):
        return heappop(self._queue)


class LifoQueue(Queue):
    """A subclass of Queue that retrieves most recently added entries first."""

    def _init(self, maxsize):
        self._queue = []

    def _put(self, item):
        self._queue.append(item)

    def _get(self):
        return self._queue.pop()
asyncio/__init__.py000064400000002313151153537520010330 0ustar00"""The asyncio package, tracking PEP 3156."""

# flake8: noqa

import sys

# This relies on each of the submodules having an __all__ variable.
from .base_events import *
from .coroutines import *
from .events import *
from .exceptions import *
from .futures import *
from .locks import *
from .protocols import *
from .runners import *
from .queues import *
from .streams import *
from .subprocess import *
from .tasks import *
from .transports import *

# Exposed for _asynciomodule.c to implement now deprecated
# Task.all_tasks() method.  This function will be removed in 3.9.
from .tasks import _all_tasks_compat  # NoQA

__all__ = (base_events.__all__ +
           coroutines.__all__ +
           events.__all__ +
           exceptions.__all__ +
           futures.__all__ +
           locks.__all__ +
           protocols.__all__ +
           runners.__all__ +
           queues.__all__ +
           streams.__all__ +
           subprocess.__all__ +
           tasks.__all__ +
           transports.__all__)

if sys.platform == 'win32':  # pragma: no cover
    from .windows_events import *
    __all__ += windows_events.__all__
else:
    from .unix_events import *  # pragma: no cover
    __all__ += unix_events.__all__
asyncio/proactor_events.py000064400000076474151153537520012031 0ustar00"""Event loop using a proactor and related classes.

A proactor is a "notify-on-completion" multiplexer.  Currently a
proactor is only implemented on Windows with IOCP.
"""

__all__ = 'BaseProactorEventLoop',

import io
import os
import socket
import warnings
import signal
import threading
import collections

from . import base_events
from . import constants
from . import futures
from . import exceptions
from . import protocols
from . import sslproto
from . import transports
from . import trsock
from .log import logger


def _set_socket_extra(transport, sock):
    transport._extra['socket'] = trsock.TransportSocket(sock)

    try:
        transport._extra['sockname'] = sock.getsockname()
    except socket.error:
        if transport._loop.get_debug():
            logger.warning(
                "getsockname() failed on %r", sock, exc_info=True)

    if 'peername' not in transport._extra:
        try:
            transport._extra['peername'] = sock.getpeername()
        except socket.error:
            # UDP sockets may not have a peer name
            transport._extra['peername'] = None


class _ProactorBasePipeTransport(transports._FlowControlMixin,
                                 transports.BaseTransport):
    """Base class for pipe and socket transports."""

    def __init__(self, loop, sock, protocol, waiter=None,
                 extra=None, server=None):
        super().__init__(extra, loop)
        self._set_extra(sock)
        self._sock = sock
        self.set_protocol(protocol)
        self._server = server
        self._buffer = None  # None or bytearray.
        self._read_fut = None
        self._write_fut = None
        self._pending_write = 0
        self._conn_lost = 0
        self._closing = False  # Set when close() called.
        self._eof_written = False
        if self._server is not None:
            self._server._attach()
        self._loop.call_soon(self._protocol.connection_made, self)
        if waiter is not None:
            # only wake up the waiter when connection_made() has been called
            self._loop.call_soon(futures._set_result_unless_cancelled,
                                 waiter, None)

    def __repr__(self):
        info = [self.__class__.__name__]
        if self._sock is None:
            info.append('closed')
        elif self._closing:
            info.append('closing')
        if self._sock is not None:
            info.append(f'fd={self._sock.fileno()}')
        if self._read_fut is not None:
            info.append(f'read={self._read_fut!r}')
        if self._write_fut is not None:
            info.append(f'write={self._write_fut!r}')
        if self._buffer:
            info.append(f'write_bufsize={len(self._buffer)}')
        if self._eof_written:
            info.append('EOF written')
        return '<{}>'.format(' '.join(info))

    def _set_extra(self, sock):
        self._extra['pipe'] = sock

    def set_protocol(self, protocol):
        self._protocol = protocol

    def get_protocol(self):
        return self._protocol

    def is_closing(self):
        return self._closing

    def close(self):
        if self._closing:
            return
        self._closing = True
        self._conn_lost += 1
        if not self._buffer and self._write_fut is None:
            self._loop.call_soon(self._call_connection_lost, None)
        if self._read_fut is not None:
            self._read_fut.cancel()
            self._read_fut = None

    def __del__(self, _warn=warnings.warn):
        if self._sock is not None:
            _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
            self.close()

    def _fatal_error(self, exc, message='Fatal error on pipe transport'):
        try:
            if isinstance(exc, OSError):
                if self._loop.get_debug():
                    logger.debug("%r: %s", self, message, exc_info=True)
            else:
                self._loop.call_exception_handler({
                    'message': message,
                    'exception': exc,
                    'transport': self,
                    'protocol': self._protocol,
                })
        finally:
            self._force_close(exc)

    def _force_close(self, exc):
        if self._empty_waiter is not None and not self._empty_waiter.done():
            if exc is None:
                self._empty_waiter.set_result(None)
            else:
                self._empty_waiter.set_exception(exc)
        if self._closing:
            return
        self._closing = True
        self._conn_lost += 1
        if self._write_fut:
            self._write_fut.cancel()
            self._write_fut = None
        if self._read_fut:
            self._read_fut.cancel()
            self._read_fut = None
        self._pending_write = 0
        self._buffer = None
        self._loop.call_soon(self._call_connection_lost, exc)

    def _call_connection_lost(self, exc):
        try:
            self._protocol.connection_lost(exc)
        finally:
            # XXX If there is a pending overlapped read on the other
            # end then it may fail with ERROR_NETNAME_DELETED if we
            # just close our end.  First calling shutdown() seems to
            # cure it, but maybe using DisconnectEx() would be better.
            if hasattr(self._sock, 'shutdown'):
                self._sock.shutdown(socket.SHUT_RDWR)
            self._sock.close()
            self._sock = None
            server = self._server
            if server is not None:
                server._detach()
                self._server = None

    def get_write_buffer_size(self):
        size = self._pending_write
        if self._buffer is not None:
            size += len(self._buffer)
        return size


class _ProactorReadPipeTransport(_ProactorBasePipeTransport,
                                 transports.ReadTransport):
    """Transport for read pipes."""

    def __init__(self, loop, sock, protocol, waiter=None,
                 extra=None, server=None):
        self._pending_data = None
        self._paused = True
        super().__init__(loop, sock, protocol, waiter, extra, server)

        self._loop.call_soon(self._loop_reading)
        self._paused = False

    def is_reading(self):
        return not self._paused and not self._closing

    def pause_reading(self):
        if self._closing or self._paused:
            return
        self._paused = True

        # bpo-33694: Don't cancel self._read_fut because cancelling an
        # overlapped WSASend() loss silently data with the current proactor
        # implementation.
        #
        # If CancelIoEx() fails with ERROR_NOT_FOUND, it means that WSASend()
        # completed (even if HasOverlappedIoCompleted() returns 0), but
        # Overlapped.cancel() currently silently ignores the ERROR_NOT_FOUND
        # error. Once the overlapped is ignored, the IOCP loop will ignores the
        # completion I/O event and so not read the result of the overlapped
        # WSARecv().

        if self._loop.get_debug():
            logger.debug("%r pauses reading", self)

    def resume_reading(self):
        if self._closing or not self._paused:
            return

        self._paused = False
        if self._read_fut is None:
            self._loop.call_soon(self._loop_reading, None)

        data = self._pending_data
        self._pending_data = None
        if data is not None:
            # Call the protocol methode after calling _loop_reading(),
            # since the protocol can decide to pause reading again.
            self._loop.call_soon(self._data_received, data)

        if self._loop.get_debug():
            logger.debug("%r resumes reading", self)

    def _eof_received(self):
        if self._loop.get_debug():
            logger.debug("%r received EOF", self)

        try:
            keep_open = self._protocol.eof_received()
        except (SystemExit, KeyboardInterrupt):
            raise
        except BaseException as exc:
            self._fatal_error(
                exc, 'Fatal error: protocol.eof_received() call failed.')
            return

        if not keep_open:
            self.close()

    def _data_received(self, data):
        if self._paused:
            # Don't call any protocol method while reading is paused.
            # The protocol will be called on resume_reading().
            assert self._pending_data is None
            self._pending_data = data
            return

        if not data:
            self._eof_received()
            return

        if isinstance(self._protocol, protocols.BufferedProtocol):
            try:
                protocols._feed_data_to_buffered_proto(self._protocol, data)
            except (SystemExit, KeyboardInterrupt):
                raise
            except BaseException as exc:
                self._fatal_error(exc,
                                  'Fatal error: protocol.buffer_updated() '
                                  'call failed.')
                return
        else:
            self._protocol.data_received(data)

    def _loop_reading(self, fut=None):
        data = None
        try:
            if fut is not None:
                assert self._read_fut is fut or (self._read_fut is None and
                                                 self._closing)
                self._read_fut = None
                if fut.done():
                    # deliver data later in "finally" clause
                    data = fut.result()
                else:
                    # the future will be replaced by next proactor.recv call
                    fut.cancel()

            if self._closing:
                # since close() has been called we ignore any read data
                data = None
                return

            if data == b'':
                # we got end-of-file so no need to reschedule a new read
                return

            # bpo-33694: buffer_updated() has currently no fast path because of
            # a data loss issue caused by overlapped WSASend() cancellation.

            if not self._paused:
                # reschedule a new read
                self._read_fut = self._loop._proactor.recv(self._sock, 32768)
        except ConnectionAbortedError as exc:
            if not self._closing:
                self._fatal_error(exc, 'Fatal read error on pipe transport')
            elif self._loop.get_debug():
                logger.debug("Read error on pipe transport while closing",
                             exc_info=True)
        except ConnectionResetError as exc:
            self._force_close(exc)
        except OSError as exc:
            self._fatal_error(exc, 'Fatal read error on pipe transport')
        except exceptions.CancelledError:
            if not self._closing:
                raise
        else:
            if not self._paused:
                self._read_fut.add_done_callback(self._loop_reading)
        finally:
            if data is not None:
                self._data_received(data)


class _ProactorBaseWritePipeTransport(_ProactorBasePipeTransport,
                                      transports.WriteTransport):
    """Transport for write pipes."""

    _start_tls_compatible = True

    def __init__(self, *args, **kw):
        super().__init__(*args, **kw)
        self._empty_waiter = None

    def write(self, data):
        if not isinstance(data, (bytes, bytearray, memoryview)):
            raise TypeError(
                f"data argument must be a bytes-like object, "
                f"not {type(data).__name__}")
        if self._eof_written:
            raise RuntimeError('write_eof() already called')
        if self._empty_waiter is not None:
            raise RuntimeError('unable to write; sendfile is in progress')

        if not data:
            return

        if self._conn_lost:
            if self._conn_lost >= constants.LOG_THRESHOLD_FOR_CONNLOST_WRITES:
                logger.warning('socket.send() raised exception.')
            self._conn_lost += 1
            return

        # Observable states:
        # 1. IDLE: _write_fut and _buffer both None
        # 2. WRITING: _write_fut set; _buffer None
        # 3. BACKED UP: _write_fut set; _buffer a bytearray
        # We always copy the data, so the caller can't modify it
        # while we're still waiting for the I/O to happen.
        if self._write_fut is None:  # IDLE -> WRITING
            assert self._buffer is None
            # Pass a copy, except if it's already immutable.
            self._loop_writing(data=bytes(data))
        elif not self._buffer:  # WRITING -> BACKED UP
            # Make a mutable copy which we can extend.
            self._buffer = bytearray(data)
            self._maybe_pause_protocol()
        else:  # BACKED UP
            # Append to buffer (also copies).
            self._buffer.extend(data)
            self._maybe_pause_protocol()

    def _loop_writing(self, f=None, data=None):
        try:
            if f is not None and self._write_fut is None and self._closing:
                # XXX most likely self._force_close() has been called, and
                # it has set self._write_fut to None.
                return
            assert f is self._write_fut
            self._write_fut = None
            self._pending_write = 0
            if f:
                f.result()
            if data is None:
                data = self._buffer
                self._buffer = None
            if not data:
                if self._closing:
                    self._loop.call_soon(self._call_connection_lost, None)
                if self._eof_written:
                    self._sock.shutdown(socket.SHUT_WR)
                # Now that we've reduced the buffer size, tell the
                # protocol to resume writing if it was paused.  Note that
                # we do this last since the callback is called immediately
                # and it may add more data to the buffer (even causing the
                # protocol to be paused again).
                self._maybe_resume_protocol()
            else:
                self._write_fut = self._loop._proactor.send(self._sock, data)
                if not self._write_fut.done():
                    assert self._pending_write == 0
                    self._pending_write = len(data)
                    self._write_fut.add_done_callback(self._loop_writing)
                    self._maybe_pause_protocol()
                else:
                    self._write_fut.add_done_callback(self._loop_writing)
            if self._empty_waiter is not None and self._write_fut is None:
                self._empty_waiter.set_result(None)
        except ConnectionResetError as exc:
            self._force_close(exc)
        except OSError as exc:
            self._fatal_error(exc, 'Fatal write error on pipe transport')

    def can_write_eof(self):
        return True

    def write_eof(self):
        self.close()

    def abort(self):
        self._force_close(None)

    def _make_empty_waiter(self):
        if self._empty_waiter is not None:
            raise RuntimeError("Empty waiter is already set")
        self._empty_waiter = self._loop.create_future()
        if self._write_fut is None:
            self._empty_waiter.set_result(None)
        return self._empty_waiter

    def _reset_empty_waiter(self):
        self._empty_waiter = None


class _ProactorWritePipeTransport(_ProactorBaseWritePipeTransport):
    def __init__(self, *args, **kw):
        super().__init__(*args, **kw)
        self._read_fut = self._loop._proactor.recv(self._sock, 16)
        self._read_fut.add_done_callback(self._pipe_closed)

    def _pipe_closed(self, fut):
        if fut.cancelled():
            # the transport has been closed
            return
        assert fut.result() == b''
        if self._closing:
            assert self._read_fut is None
            return
        assert fut is self._read_fut, (fut, self._read_fut)
        self._read_fut = None
        if self._write_fut is not None:
            self._force_close(BrokenPipeError())
        else:
            self.close()


class _ProactorDatagramTransport(_ProactorBasePipeTransport):
    max_size = 256 * 1024
    def __init__(self, loop, sock, protocol, address=None,
                 waiter=None, extra=None):
        self._address = address
        self._empty_waiter = None
        # We don't need to call _protocol.connection_made() since our base
        # constructor does it for us.
        super().__init__(loop, sock, protocol, waiter=waiter, extra=extra)

        # The base constructor sets _buffer = None, so we set it here
        self._buffer = collections.deque()
        self._loop.call_soon(self._loop_reading)

    def _set_extra(self, sock):
        _set_socket_extra(self, sock)

    def get_write_buffer_size(self):
        return sum(len(data) for data, _ in self._buffer)

    def abort(self):
        self._force_close(None)

    def sendto(self, data, addr=None):
        if not isinstance(data, (bytes, bytearray, memoryview)):
            raise TypeError('data argument must be bytes-like object (%r)',
                            type(data))

        if not data:
            return

        if self._address is not None and addr not in (None, self._address):
            raise ValueError(
                f'Invalid address: must be None or {self._address}')

        if self._conn_lost and self._address:
            if self._conn_lost >= constants.LOG_THRESHOLD_FOR_CONNLOST_WRITES:
                logger.warning('socket.sendto() raised exception.')
            self._conn_lost += 1
            return

        # Ensure that what we buffer is immutable.
        self._buffer.append((bytes(data), addr))

        if self._write_fut is None:
            # No current write operations are active, kick one off
            self._loop_writing()
        # else: A write operation is already kicked off

        self._maybe_pause_protocol()

    def _loop_writing(self, fut=None):
        try:
            if self._conn_lost:
                return

            assert fut is self._write_fut
            self._write_fut = None
            if fut:
                # We are in a _loop_writing() done callback, get the result
                fut.result()

            if not self._buffer or (self._conn_lost and self._address):
                # The connection has been closed
                if self._closing:
                    self._loop.call_soon(self._call_connection_lost, None)
                return

            data, addr = self._buffer.popleft()
            if self._address is not None:
                self._write_fut = self._loop._proactor.send(self._sock,
                                                            data)
            else:
                self._write_fut = self._loop._proactor.sendto(self._sock,
                                                              data,
                                                              addr=addr)
        except OSError as exc:
            self._protocol.error_received(exc)
        except Exception as exc:
            self._fatal_error(exc, 'Fatal write error on datagram transport')
        else:
            self._write_fut.add_done_callback(self._loop_writing)
            self._maybe_resume_protocol()

    def _loop_reading(self, fut=None):
        data = None
        try:
            if self._conn_lost:
                return

            assert self._read_fut is fut or (self._read_fut is None and
                                             self._closing)

            self._read_fut = None
            if fut is not None:
                res = fut.result()

                if self._closing:
                    # since close() has been called we ignore any read data
                    data = None
                    return

                if self._address is not None:
                    data, addr = res, self._address
                else:
                    data, addr = res

            if self._conn_lost:
                return
            if self._address is not None:
                self._read_fut = self._loop._proactor.recv(self._sock,
                                                           self.max_size)
            else:
                self._read_fut = self._loop._proactor.recvfrom(self._sock,
                                                               self.max_size)
        except OSError as exc:
            self._protocol.error_received(exc)
        except exceptions.CancelledError:
            if not self._closing:
                raise
        else:
            if self._read_fut is not None:
                self._read_fut.add_done_callback(self._loop_reading)
        finally:
            if data:
                self._protocol.datagram_received(data, addr)


class _ProactorDuplexPipeTransport(_ProactorReadPipeTransport,
                                   _ProactorBaseWritePipeTransport,
                                   transports.Transport):
    """Transport for duplex pipes."""

    def can_write_eof(self):
        return False

    def write_eof(self):
        raise NotImplementedError


class _ProactorSocketTransport(_ProactorReadPipeTransport,
                               _ProactorBaseWritePipeTransport,
                               transports.Transport):
    """Transport for connected sockets."""

    _sendfile_compatible = constants._SendfileMode.TRY_NATIVE

    def __init__(self, loop, sock, protocol, waiter=None,
                 extra=None, server=None):
        super().__init__(loop, sock, protocol, waiter, extra, server)
        base_events._set_nodelay(sock)

    def _set_extra(self, sock):
        _set_socket_extra(self, sock)

    def can_write_eof(self):
        return True

    def write_eof(self):
        if self._closing or self._eof_written:
            return
        self._eof_written = True
        if self._write_fut is None:
            self._sock.shutdown(socket.SHUT_WR)


class BaseProactorEventLoop(base_events.BaseEventLoop):

    def __init__(self, proactor):
        super().__init__()
        logger.debug('Using proactor: %s', proactor.__class__.__name__)
        self._proactor = proactor
        self._selector = proactor   # convenient alias
        self._self_reading_future = None
        self._accept_futures = {}   # socket file descriptor => Future
        proactor.set_loop(self)
        self._make_self_pipe()
        if threading.current_thread() is threading.main_thread():
            # wakeup fd can only be installed to a file descriptor from the main thread
            signal.set_wakeup_fd(self._csock.fileno())

    def _make_socket_transport(self, sock, protocol, waiter=None,
                               extra=None, server=None):
        return _ProactorSocketTransport(self, sock, protocol, waiter,
                                        extra, server)

    def _make_ssl_transport(
            self, rawsock, protocol, sslcontext, waiter=None,
            *, server_side=False, server_hostname=None,
            extra=None, server=None,
            ssl_handshake_timeout=None):
        ssl_protocol = sslproto.SSLProtocol(
                self, protocol, sslcontext, waiter,
                server_side, server_hostname,
                ssl_handshake_timeout=ssl_handshake_timeout)
        _ProactorSocketTransport(self, rawsock, ssl_protocol,
                                 extra=extra, server=server)
        return ssl_protocol._app_transport

    def _make_datagram_transport(self, sock, protocol,
                                 address=None, waiter=None, extra=None):
        return _ProactorDatagramTransport(self, sock, protocol, address,
                                          waiter, extra)

    def _make_duplex_pipe_transport(self, sock, protocol, waiter=None,
                                    extra=None):
        return _ProactorDuplexPipeTransport(self,
                                            sock, protocol, waiter, extra)

    def _make_read_pipe_transport(self, sock, protocol, waiter=None,
                                  extra=None):
        return _ProactorReadPipeTransport(self, sock, protocol, waiter, extra)

    def _make_write_pipe_transport(self, sock, protocol, waiter=None,
                                   extra=None):
        # We want connection_lost() to be called when other end closes
        return _ProactorWritePipeTransport(self,
                                           sock, protocol, waiter, extra)

    def close(self):
        if self.is_running():
            raise RuntimeError("Cannot close a running event loop")
        if self.is_closed():
            return

        if threading.current_thread() is threading.main_thread():
            signal.set_wakeup_fd(-1)
        # Call these methods before closing the event loop (before calling
        # BaseEventLoop.close), because they can schedule callbacks with
        # call_soon(), which is forbidden when the event loop is closed.
        self._stop_accept_futures()
        self._close_self_pipe()
        self._proactor.close()
        self._proactor = None
        self._selector = None

        # Close the event loop
        super().close()

    async def sock_recv(self, sock, n):
        return await self._proactor.recv(sock, n)

    async def sock_recv_into(self, sock, buf):
        return await self._proactor.recv_into(sock, buf)

    async def sock_sendall(self, sock, data):
        return await self._proactor.send(sock, data)

    async def sock_connect(self, sock, address):
        return await self._proactor.connect(sock, address)

    async def sock_accept(self, sock):
        return await self._proactor.accept(sock)

    async def _sock_sendfile_native(self, sock, file, offset, count):
        try:
            fileno = file.fileno()
        except (AttributeError, io.UnsupportedOperation) as err:
            raise exceptions.SendfileNotAvailableError("not a regular file")
        try:
            fsize = os.fstat(fileno).st_size
        except OSError as err:
            raise exceptions.SendfileNotAvailableError("not a regular file")
        blocksize = count if count else fsize
        if not blocksize:
            return 0  # empty file

        blocksize = min(blocksize, 0xffff_ffff)
        end_pos = min(offset + count, fsize) if count else fsize
        offset = min(offset, fsize)
        total_sent = 0
        try:
            while True:
                blocksize = min(end_pos - offset, blocksize)
                if blocksize <= 0:
                    return total_sent
                await self._proactor.sendfile(sock, file, offset, blocksize)
                offset += blocksize
                total_sent += blocksize
        finally:
            if total_sent > 0:
                file.seek(offset)

    async def _sendfile_native(self, transp, file, offset, count):
        resume_reading = transp.is_reading()
        transp.pause_reading()
        await transp._make_empty_waiter()
        try:
            return await self.sock_sendfile(transp._sock, file, offset, count,
                                            fallback=False)
        finally:
            transp._reset_empty_waiter()
            if resume_reading:
                transp.resume_reading()

    def _close_self_pipe(self):
        if self._self_reading_future is not None:
            self._self_reading_future.cancel()
            self._self_reading_future = None
        self._ssock.close()
        self._ssock = None
        self._csock.close()
        self._csock = None
        self._internal_fds -= 1

    def _make_self_pipe(self):
        # A self-socket, really. :-)
        self._ssock, self._csock = socket.socketpair()
        self._ssock.setblocking(False)
        self._csock.setblocking(False)
        self._internal_fds += 1

    def _loop_self_reading(self, f=None):
        try:
            if f is not None:
                f.result()  # may raise
            if self._self_reading_future is not f:
                # When we scheduled this Future, we assigned it to
                # _self_reading_future. If it's not there now, something has
                # tried to cancel the loop while this callback was still in the
                # queue (see windows_events.ProactorEventLoop.run_forever). In
                # that case stop here instead of continuing to schedule a new
                # iteration.
                return
            f = self._proactor.recv(self._ssock, 4096)
        except exceptions.CancelledError:
            # _close_self_pipe() has been called, stop waiting for data
            return
        except (SystemExit, KeyboardInterrupt):
            raise
        except BaseException as exc:
            self.call_exception_handler({
                'message': 'Error on reading from the event loop self pipe',
                'exception': exc,
                'loop': self,
            })
        else:
            self._self_reading_future = f
            f.add_done_callback(self._loop_self_reading)

    def _write_to_self(self):
        # This may be called from a different thread, possibly after
        # _close_self_pipe() has been called or even while it is
        # running.  Guard for self._csock being None or closed.  When
        # a socket is closed, send() raises OSError (with errno set to
        # EBADF, but let's not rely on the exact error code).
        csock = self._csock
        if csock is None:
            return

        try:
            csock.send(b'\0')
        except OSError:
            if self._debug:
                logger.debug("Fail to write a null byte into the "
                             "self-pipe socket",
                             exc_info=True)

    def _start_serving(self, protocol_factory, sock,
                       sslcontext=None, server=None, backlog=100,
                       ssl_handshake_timeout=None):

        def loop(f=None):
            try:
                if f is not None:
                    conn, addr = f.result()
                    if self._debug:
                        logger.debug("%r got a new connection from %r: %r",
                                     server, addr, conn)
                    protocol = protocol_factory()
                    if sslcontext is not None:
                        self._make_ssl_transport(
                            conn, protocol, sslcontext, server_side=True,
                            extra={'peername': addr}, server=server,
                            ssl_handshake_timeout=ssl_handshake_timeout)
                    else:
                        self._make_socket_transport(
                            conn, protocol,
                            extra={'peername': addr}, server=server)
                if self.is_closed():
                    return
                f = self._proactor.accept(sock)
            except OSError as exc:
                if sock.fileno() != -1:
                    self.call_exception_handler({
                        'message': 'Accept failed on a socket',
                        'exception': exc,
                        'socket': trsock.TransportSocket(sock),
                    })
                    sock.close()
                elif self._debug:
                    logger.debug("Accept failed on socket %r",
                                 sock, exc_info=True)
            except exceptions.CancelledError:
                sock.close()
            else:
                self._accept_futures[sock.fileno()] = f
                f.add_done_callback(loop)

        self.call_soon(loop)

    def _process_events(self, event_list):
        # Events are processed in the IocpProactor._poll() method
        pass

    def _stop_accept_futures(self):
        for future in self._accept_futures.values():
            future.cancel()
        self._accept_futures.clear()

    def _stop_serving(self, sock):
        future = self._accept_futures.pop(sock.fileno(), None)
        if future:
            future.cancel()
        self._proactor._stop_serving(sock)
        sock.close()
asyncio/base_subprocess.py000064400000021213151153537520011753 0ustar00import collections
import subprocess
import warnings

from . import protocols
from . import transports
from .log import logger


class BaseSubprocessTransport(transports.SubprocessTransport):

    def __init__(self, loop, protocol, args, shell,
                 stdin, stdout, stderr, bufsize,
                 waiter=None, extra=None, **kwargs):
        super().__init__(extra)
        self._closed = False
        self._protocol = protocol
        self._loop = loop
        self._proc = None
        self._pid = None
        self._returncode = None
        self._exit_waiters = []
        self._pending_calls = collections.deque()
        self._pipes = {}
        self._finished = False

        if stdin == subprocess.PIPE:
            self._pipes[0] = None
        if stdout == subprocess.PIPE:
            self._pipes[1] = None
        if stderr == subprocess.PIPE:
            self._pipes[2] = None

        # Create the child process: set the _proc attribute
        try:
            self._start(args=args, shell=shell, stdin=stdin, stdout=stdout,
                        stderr=stderr, bufsize=bufsize, **kwargs)
        except:
            self.close()
            raise

        self._pid = self._proc.pid
        self._extra['subprocess'] = self._proc

        if self._loop.get_debug():
            if isinstance(args, (bytes, str)):
                program = args
            else:
                program = args[0]
            logger.debug('process %r created: pid %s',
                         program, self._pid)

        self._loop.create_task(self._connect_pipes(waiter))

    def __repr__(self):
        info = [self.__class__.__name__]
        if self._closed:
            info.append('closed')
        if self._pid is not None:
            info.append(f'pid={self._pid}')
        if self._returncode is not None:
            info.append(f'returncode={self._returncode}')
        elif self._pid is not None:
            info.append('running')
        else:
            info.append('not started')

        stdin = self._pipes.get(0)
        if stdin is not None:
            info.append(f'stdin={stdin.pipe}')

        stdout = self._pipes.get(1)
        stderr = self._pipes.get(2)
        if stdout is not None and stderr is stdout:
            info.append(f'stdout=stderr={stdout.pipe}')
        else:
            if stdout is not None:
                info.append(f'stdout={stdout.pipe}')
            if stderr is not None:
                info.append(f'stderr={stderr.pipe}')

        return '<{}>'.format(' '.join(info))

    def _start(self, args, shell, stdin, stdout, stderr, bufsize, **kwargs):
        raise NotImplementedError

    def set_protocol(self, protocol):
        self._protocol = protocol

    def get_protocol(self):
        return self._protocol

    def is_closing(self):
        return self._closed

    def close(self):
        if self._closed:
            return
        self._closed = True

        for proto in self._pipes.values():
            if proto is None:
                continue
            proto.pipe.close()

        if (self._proc is not None and
                # has the child process finished?
                self._returncode is None and
                # the child process has finished, but the
                # transport hasn't been notified yet?
                self._proc.poll() is None):

            if self._loop.get_debug():
                logger.warning('Close running child process: kill %r', self)

            try:
                self._proc.kill()
            except ProcessLookupError:
                pass

            # Don't clear the _proc reference yet: _post_init() may still run

    def __del__(self, _warn=warnings.warn):
        if not self._closed:
            _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
            self.close()

    def get_pid(self):
        return self._pid

    def get_returncode(self):
        return self._returncode

    def get_pipe_transport(self, fd):
        if fd in self._pipes:
            return self._pipes[fd].pipe
        else:
            return None

    def _check_proc(self):
        if self._proc is None:
            raise ProcessLookupError()

    def send_signal(self, signal):
        self._check_proc()
        self._proc.send_signal(signal)

    def terminate(self):
        self._check_proc()
        self._proc.terminate()

    def kill(self):
        self._check_proc()
        self._proc.kill()

    async def _connect_pipes(self, waiter):
        try:
            proc = self._proc
            loop = self._loop

            if proc.stdin is not None:
                _, pipe = await loop.connect_write_pipe(
                    lambda: WriteSubprocessPipeProto(self, 0),
                    proc.stdin)
                self._pipes[0] = pipe

            if proc.stdout is not None:
                _, pipe = await loop.connect_read_pipe(
                    lambda: ReadSubprocessPipeProto(self, 1),
                    proc.stdout)
                self._pipes[1] = pipe

            if proc.stderr is not None:
                _, pipe = await loop.connect_read_pipe(
                    lambda: ReadSubprocessPipeProto(self, 2),
                    proc.stderr)
                self._pipes[2] = pipe

            assert self._pending_calls is not None

            loop.call_soon(self._protocol.connection_made, self)
            for callback, data in self._pending_calls:
                loop.call_soon(callback, *data)
            self._pending_calls = None
        except (SystemExit, KeyboardInterrupt):
            raise
        except BaseException as exc:
            if waiter is not None and not waiter.cancelled():
                waiter.set_exception(exc)
        else:
            if waiter is not None and not waiter.cancelled():
                waiter.set_result(None)

    def _call(self, cb, *data):
        if self._pending_calls is not None:
            self._pending_calls.append((cb, data))
        else:
            self._loop.call_soon(cb, *data)

    def _pipe_connection_lost(self, fd, exc):
        self._call(self._protocol.pipe_connection_lost, fd, exc)
        self._try_finish()

    def _pipe_data_received(self, fd, data):
        self._call(self._protocol.pipe_data_received, fd, data)

    def _process_exited(self, returncode):
        assert returncode is not None, returncode
        assert self._returncode is None, self._returncode
        if self._loop.get_debug():
            logger.info('%r exited with return code %r', self, returncode)
        self._returncode = returncode
        if self._proc.returncode is None:
            # asyncio uses a child watcher: copy the status into the Popen
            # object. On Python 3.6, it is required to avoid a ResourceWarning.
            self._proc.returncode = returncode
        self._call(self._protocol.process_exited)
        self._try_finish()

        # wake up futures waiting for wait()
        for waiter in self._exit_waiters:
            if not waiter.cancelled():
                waiter.set_result(returncode)
        self._exit_waiters = None

    async def _wait(self):
        """Wait until the process exit and return the process return code.

        This method is a coroutine."""
        if self._returncode is not None:
            return self._returncode

        waiter = self._loop.create_future()
        self._exit_waiters.append(waiter)
        return await waiter

    def _try_finish(self):
        assert not self._finished
        if self._returncode is None:
            return
        if all(p is not None and p.disconnected
               for p in self._pipes.values()):
            self._finished = True
            self._call(self._call_connection_lost, None)

    def _call_connection_lost(self, exc):
        try:
            self._protocol.connection_lost(exc)
        finally:
            self._loop = None
            self._proc = None
            self._protocol = None


class WriteSubprocessPipeProto(protocols.BaseProtocol):

    def __init__(self, proc, fd):
        self.proc = proc
        self.fd = fd
        self.pipe = None
        self.disconnected = False

    def connection_made(self, transport):
        self.pipe = transport

    def __repr__(self):
        return f'<{self.__class__.__name__} fd={self.fd} pipe={self.pipe!r}>'

    def connection_lost(self, exc):
        self.disconnected = True
        self.proc._pipe_connection_lost(self.fd, exc)
        self.proc = None

    def pause_writing(self):
        self.proc._protocol.pause_writing()

    def resume_writing(self):
        self.proc._protocol.resume_writing()


class ReadSubprocessPipeProto(WriteSubprocessPipeProto,
                              protocols.Protocol):

    def data_received(self, data):
        self.proc._pipe_data_received(self.fd, data)
asyncio/base_tasks.py000064400000004643151153537520010720 0ustar00import linecache
import traceback

from . import base_futures
from . import coroutines


def _task_repr_info(task):
    info = base_futures._future_repr_info(task)

    if task._must_cancel:
        # replace status
        info[0] = 'cancelling'

    info.insert(1, 'name=%r' % task.get_name())

    coro = coroutines._format_coroutine(task._coro)
    info.insert(2, f'coro=<{coro}>')

    if task._fut_waiter is not None:
        info.insert(3, f'wait_for={task._fut_waiter!r}')
    return info


def _task_get_stack(task, limit):
    frames = []
    if hasattr(task._coro, 'cr_frame'):
        # case 1: 'async def' coroutines
        f = task._coro.cr_frame
    elif hasattr(task._coro, 'gi_frame'):
        # case 2: legacy coroutines
        f = task._coro.gi_frame
    elif hasattr(task._coro, 'ag_frame'):
        # case 3: async generators
        f = task._coro.ag_frame
    else:
        # case 4: unknown objects
        f = None
    if f is not None:
        while f is not None:
            if limit is not None:
                if limit <= 0:
                    break
                limit -= 1
            frames.append(f)
            f = f.f_back
        frames.reverse()
    elif task._exception is not None:
        tb = task._exception.__traceback__
        while tb is not None:
            if limit is not None:
                if limit <= 0:
                    break
                limit -= 1
            frames.append(tb.tb_frame)
            tb = tb.tb_next
    return frames


def _task_print_stack(task, limit, file):
    extracted_list = []
    checked = set()
    for f in task.get_stack(limit=limit):
        lineno = f.f_lineno
        co = f.f_code
        filename = co.co_filename
        name = co.co_name
        if filename not in checked:
            checked.add(filename)
            linecache.checkcache(filename)
        line = linecache.getline(filename, lineno, f.f_globals)
        extracted_list.append((filename, lineno, name, line))

    exc = task._exception
    if not extracted_list:
        print(f'No stack for {task!r}', file=file)
    elif exc is not None:
        print(f'Traceback for {task!r} (most recent call last):', file=file)
    else:
        print(f'Stack for {task!r} (most recent call last):', file=file)

    traceback.print_list(extracted_list, file=file)
    if exc is not None:
        for line in traceback.format_exception_only(exc.__class__, exc):
            print(line, file=file, end='')
asyncio/sslproto.py000064400000065112151153537520010464 0ustar00import collections
import warnings
try:
    import ssl
except ImportError:  # pragma: no cover
    ssl = None

from . import base_events
from . import constants
from . import protocols
from . import transports
from .log import logger


def _create_transport_context(server_side, server_hostname):
    if server_side:
        raise ValueError('Server side SSL needs a valid SSLContext')

    # Client side may pass ssl=True to use a default
    # context; in that case the sslcontext passed is None.
    # The default is secure for client connections.
    # Python 3.4+: use up-to-date strong settings.
    sslcontext = ssl.create_default_context()
    if not server_hostname:
        sslcontext.check_hostname = False
    return sslcontext


# States of an _SSLPipe.
_UNWRAPPED = "UNWRAPPED"
_DO_HANDSHAKE = "DO_HANDSHAKE"
_WRAPPED = "WRAPPED"
_SHUTDOWN = "SHUTDOWN"


class _SSLPipe(object):
    """An SSL "Pipe".

    An SSL pipe allows you to communicate with an SSL/TLS protocol instance
    through memory buffers. It can be used to implement a security layer for an
    existing connection where you don't have access to the connection's file
    descriptor, or for some reason you don't want to use it.

    An SSL pipe can be in "wrapped" and "unwrapped" mode. In unwrapped mode,
    data is passed through untransformed. In wrapped mode, application level
    data is encrypted to SSL record level data and vice versa. The SSL record
    level is the lowest level in the SSL protocol suite and is what travels
    as-is over the wire.

    An SslPipe initially is in "unwrapped" mode. To start SSL, call
    do_handshake(). To shutdown SSL again, call unwrap().
    """

    max_size = 256 * 1024   # Buffer size passed to read()

    def __init__(self, context, server_side, server_hostname=None):
        """
        The *context* argument specifies the ssl.SSLContext to use.

        The *server_side* argument indicates whether this is a server side or
        client side transport.

        The optional *server_hostname* argument can be used to specify the
        hostname you are connecting to. You may only specify this parameter if
        the _ssl module supports Server Name Indication (SNI).
        """
        self._context = context
        self._server_side = server_side
        self._server_hostname = server_hostname
        self._state = _UNWRAPPED
        self._incoming = ssl.MemoryBIO()
        self._outgoing = ssl.MemoryBIO()
        self._sslobj = None
        self._need_ssldata = False
        self._handshake_cb = None
        self._shutdown_cb = None

    @property
    def context(self):
        """The SSL context passed to the constructor."""
        return self._context

    @property
    def ssl_object(self):
        """The internal ssl.SSLObject instance.

        Return None if the pipe is not wrapped.
        """
        return self._sslobj

    @property
    def need_ssldata(self):
        """Whether more record level data is needed to complete a handshake
        that is currently in progress."""
        return self._need_ssldata

    @property
    def wrapped(self):
        """
        Whether a security layer is currently in effect.

        Return False during handshake.
        """
        return self._state == _WRAPPED

    def do_handshake(self, callback=None):
        """Start the SSL handshake.

        Return a list of ssldata. A ssldata element is a list of buffers

        The optional *callback* argument can be used to install a callback that
        will be called when the handshake is complete. The callback will be
        called with None if successful, else an exception instance.
        """
        if self._state != _UNWRAPPED:
            raise RuntimeError('handshake in progress or completed')
        self._sslobj = self._context.wrap_bio(
            self._incoming, self._outgoing,
            server_side=self._server_side,
            server_hostname=self._server_hostname)
        self._state = _DO_HANDSHAKE
        self._handshake_cb = callback
        ssldata, appdata = self.feed_ssldata(b'', only_handshake=True)
        assert len(appdata) == 0
        return ssldata

    def shutdown(self, callback=None):
        """Start the SSL shutdown sequence.

        Return a list of ssldata. A ssldata element is a list of buffers

        The optional *callback* argument can be used to install a callback that
        will be called when the shutdown is complete. The callback will be
        called without arguments.
        """
        if self._state == _UNWRAPPED:
            raise RuntimeError('no security layer present')
        if self._state == _SHUTDOWN:
            raise RuntimeError('shutdown in progress')
        assert self._state in (_WRAPPED, _DO_HANDSHAKE)
        self._state = _SHUTDOWN
        self._shutdown_cb = callback
        ssldata, appdata = self.feed_ssldata(b'')
        assert appdata == [] or appdata == [b'']
        return ssldata

    def feed_eof(self):
        """Send a potentially "ragged" EOF.

        This method will raise an SSL_ERROR_EOF exception if the EOF is
        unexpected.
        """
        self._incoming.write_eof()
        ssldata, appdata = self.feed_ssldata(b'')
        assert appdata == [] or appdata == [b'']

    def feed_ssldata(self, data, only_handshake=False):
        """Feed SSL record level data into the pipe.

        The data must be a bytes instance. It is OK to send an empty bytes
        instance. This can be used to get ssldata for a handshake initiated by
        this endpoint.

        Return a (ssldata, appdata) tuple. The ssldata element is a list of
        buffers containing SSL data that needs to be sent to the remote SSL.

        The appdata element is a list of buffers containing plaintext data that
        needs to be forwarded to the application. The appdata list may contain
        an empty buffer indicating an SSL "close_notify" alert. This alert must
        be acknowledged by calling shutdown().
        """
        if self._state == _UNWRAPPED:
            # If unwrapped, pass plaintext data straight through.
            if data:
                appdata = [data]
            else:
                appdata = []
            return ([], appdata)

        self._need_ssldata = False
        if data:
            self._incoming.write(data)

        ssldata = []
        appdata = []
        try:
            if self._state == _DO_HANDSHAKE:
                # Call do_handshake() until it doesn't raise anymore.
                self._sslobj.do_handshake()
                self._state = _WRAPPED
                if self._handshake_cb:
                    self._handshake_cb(None)
                if only_handshake:
                    return (ssldata, appdata)
                # Handshake done: execute the wrapped block

            if self._state == _WRAPPED:
                # Main state: read data from SSL until close_notify
                while True:
                    chunk = self._sslobj.read(self.max_size)
                    appdata.append(chunk)
                    if not chunk:  # close_notify
                        break

            elif self._state == _SHUTDOWN:
                # Call shutdown() until it doesn't raise anymore.
                self._sslobj.unwrap()
                self._sslobj = None
                self._state = _UNWRAPPED
                if self._shutdown_cb:
                    self._shutdown_cb()

            elif self._state == _UNWRAPPED:
                # Drain possible plaintext data after close_notify.
                appdata.append(self._incoming.read())
        except (ssl.SSLError, ssl.CertificateError) as exc:
            exc_errno = getattr(exc, 'errno', None)
            if exc_errno not in (
                    ssl.SSL_ERROR_WANT_READ, ssl.SSL_ERROR_WANT_WRITE,
                    ssl.SSL_ERROR_SYSCALL):
                if self._state == _DO_HANDSHAKE and self._handshake_cb:
                    self._handshake_cb(exc)
                raise
            self._need_ssldata = (exc_errno == ssl.SSL_ERROR_WANT_READ)

        # Check for record level data that needs to be sent back.
        # Happens for the initial handshake and renegotiations.
        if self._outgoing.pending:
            ssldata.append(self._outgoing.read())
        return (ssldata, appdata)

    def feed_appdata(self, data, offset=0):
        """Feed plaintext data into the pipe.

        Return an (ssldata, offset) tuple. The ssldata element is a list of
        buffers containing record level data that needs to be sent to the
        remote SSL instance. The offset is the number of plaintext bytes that
        were processed, which may be less than the length of data.

        NOTE: In case of short writes, this call MUST be retried with the SAME
        buffer passed into the *data* argument (i.e. the id() must be the
        same). This is an OpenSSL requirement. A further particularity is that
        a short write will always have offset == 0, because the _ssl module
        does not enable partial writes. And even though the offset is zero,
        there will still be encrypted data in ssldata.
        """
        assert 0 <= offset <= len(data)
        if self._state == _UNWRAPPED:
            # pass through data in unwrapped mode
            if offset < len(data):
                ssldata = [data[offset:]]
            else:
                ssldata = []
            return (ssldata, len(data))

        ssldata = []
        view = memoryview(data)
        while True:
            self._need_ssldata = False
            try:
                if offset < len(view):
                    offset += self._sslobj.write(view[offset:])
            except ssl.SSLError as exc:
                # It is not allowed to call write() after unwrap() until the
                # close_notify is acknowledged. We return the condition to the
                # caller as a short write.
                exc_errno = getattr(exc, 'errno', None)
                if exc.reason == 'PROTOCOL_IS_SHUTDOWN':
                    exc_errno = exc.errno = ssl.SSL_ERROR_WANT_READ
                if exc_errno not in (ssl.SSL_ERROR_WANT_READ,
                                     ssl.SSL_ERROR_WANT_WRITE,
                                     ssl.SSL_ERROR_SYSCALL):
                    raise
                self._need_ssldata = (exc_errno == ssl.SSL_ERROR_WANT_READ)

            # See if there's any record level data back for us.
            if self._outgoing.pending:
                ssldata.append(self._outgoing.read())
            if offset == len(view) or self._need_ssldata:
                break
        return (ssldata, offset)


class _SSLProtocolTransport(transports._FlowControlMixin,
                            transports.Transport):

    _sendfile_compatible = constants._SendfileMode.FALLBACK

    def __init__(self, loop, ssl_protocol):
        self._loop = loop
        # SSLProtocol instance
        self._ssl_protocol = ssl_protocol
        self._closed = False

    def get_extra_info(self, name, default=None):
        """Get optional transport information."""
        return self._ssl_protocol._get_extra_info(name, default)

    def set_protocol(self, protocol):
        self._ssl_protocol._set_app_protocol(protocol)

    def get_protocol(self):
        return self._ssl_protocol._app_protocol

    def is_closing(self):
        return self._closed

    def close(self):
        """Close the transport.

        Buffered data will be flushed asynchronously.  No more data
        will be received.  After all buffered data is flushed, the
        protocol's connection_lost() method will (eventually) called
        with None as its argument.
        """
        self._closed = True
        self._ssl_protocol._start_shutdown()

    def __del__(self, _warn=warnings.warn):
        if not self._closed:
            _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
            self.close()

    def is_reading(self):
        tr = self._ssl_protocol._transport
        if tr is None:
            raise RuntimeError('SSL transport has not been initialized yet')
        return tr.is_reading()

    def pause_reading(self):
        """Pause the receiving end.

        No data will be passed to the protocol's data_received()
        method until resume_reading() is called.
        """
        self._ssl_protocol._transport.pause_reading()

    def resume_reading(self):
        """Resume the receiving end.

        Data received will once again be passed to the protocol's
        data_received() method.
        """
        self._ssl_protocol._transport.resume_reading()

    def set_write_buffer_limits(self, high=None, low=None):
        """Set the high- and low-water limits for write flow control.

        These two values control when to call the protocol's
        pause_writing() and resume_writing() methods.  If specified,
        the low-water limit must be less than or equal to the
        high-water limit.  Neither value can be negative.

        The defaults are implementation-specific.  If only the
        high-water limit is given, the low-water limit defaults to an
        implementation-specific value less than or equal to the
        high-water limit.  Setting high to zero forces low to zero as
        well, and causes pause_writing() to be called whenever the
        buffer becomes non-empty.  Setting low to zero causes
        resume_writing() to be called only once the buffer is empty.
        Use of zero for either limit is generally sub-optimal as it
        reduces opportunities for doing I/O and computation
        concurrently.
        """
        self._ssl_protocol._transport.set_write_buffer_limits(high, low)

    def get_write_buffer_size(self):
        """Return the current size of the write buffer."""
        return self._ssl_protocol._transport.get_write_buffer_size()

    @property
    def _protocol_paused(self):
        # Required for sendfile fallback pause_writing/resume_writing logic
        return self._ssl_protocol._transport._protocol_paused

    def write(self, data):
        """Write some data bytes to the transport.

        This does not block; it buffers the data and arranges for it
        to be sent out asynchronously.
        """
        if not isinstance(data, (bytes, bytearray, memoryview)):
            raise TypeError(f"data: expecting a bytes-like instance, "
                            f"got {type(data).__name__}")
        if not data:
            return
        self._ssl_protocol._write_appdata(data)

    def can_write_eof(self):
        """Return True if this transport supports write_eof(), False if not."""
        return False

    def abort(self):
        """Close the transport immediately.

        Buffered data will be lost.  No more data will be received.
        The protocol's connection_lost() method will (eventually) be
        called with None as its argument.
        """
        self._ssl_protocol._abort()
        self._closed = True


class SSLProtocol(protocols.Protocol):
    """SSL protocol.

    Implementation of SSL on top of a socket using incoming and outgoing
    buffers which are ssl.MemoryBIO objects.
    """

    def __init__(self, loop, app_protocol, sslcontext, waiter,
                 server_side=False, server_hostname=None,
                 call_connection_made=True,
                 ssl_handshake_timeout=None):
        if ssl is None:
            raise RuntimeError('stdlib ssl module not available')

        if ssl_handshake_timeout is None:
            ssl_handshake_timeout = constants.SSL_HANDSHAKE_TIMEOUT
        elif ssl_handshake_timeout <= 0:
            raise ValueError(
                f"ssl_handshake_timeout should be a positive number, "
                f"got {ssl_handshake_timeout}")

        if not sslcontext:
            sslcontext = _create_transport_context(
                server_side, server_hostname)

        self._server_side = server_side
        if server_hostname and not server_side:
            self._server_hostname = server_hostname
        else:
            self._server_hostname = None
        self._sslcontext = sslcontext
        # SSL-specific extra info. More info are set when the handshake
        # completes.
        self._extra = dict(sslcontext=sslcontext)

        # App data write buffering
        self._write_backlog = collections.deque()
        self._write_buffer_size = 0

        self._waiter = waiter
        self._loop = loop
        self._set_app_protocol(app_protocol)
        self._app_transport = _SSLProtocolTransport(self._loop, self)
        # _SSLPipe instance (None until the connection is made)
        self._sslpipe = None
        self._session_established = False
        self._in_handshake = False
        self._in_shutdown = False
        # transport, ex: SelectorSocketTransport
        self._transport = None
        self._call_connection_made = call_connection_made
        self._ssl_handshake_timeout = ssl_handshake_timeout

    def _set_app_protocol(self, app_protocol):
        self._app_protocol = app_protocol
        self._app_protocol_is_buffer = \
            isinstance(app_protocol, protocols.BufferedProtocol)

    def _wakeup_waiter(self, exc=None):
        if self._waiter is None:
            return
        if not self._waiter.cancelled():
            if exc is not None:
                self._waiter.set_exception(exc)
            else:
                self._waiter.set_result(None)
        self._waiter = None

    def connection_made(self, transport):
        """Called when the low-level connection is made.

        Start the SSL handshake.
        """
        self._transport = transport
        self._sslpipe = _SSLPipe(self._sslcontext,
                                 self._server_side,
                                 self._server_hostname)
        self._start_handshake()

    def connection_lost(self, exc):
        """Called when the low-level connection is lost or closed.

        The argument is an exception object or None (the latter
        meaning a regular EOF is received or the connection was
        aborted or closed).
        """
        if self._session_established:
            self._session_established = False
            self._loop.call_soon(self._app_protocol.connection_lost, exc)
        else:
            # Most likely an exception occurred while in SSL handshake.
            # Just mark the app transport as closed so that its __del__
            # doesn't complain.
            if self._app_transport is not None:
                self._app_transport._closed = True
        self._transport = None
        self._app_transport = None
        if getattr(self, '_handshake_timeout_handle', None):
            self._handshake_timeout_handle.cancel()
        self._wakeup_waiter(exc)
        self._app_protocol = None
        self._sslpipe = None

    def pause_writing(self):
        """Called when the low-level transport's buffer goes over
        the high-water mark.
        """
        self._app_protocol.pause_writing()

    def resume_writing(self):
        """Called when the low-level transport's buffer drains below
        the low-water mark.
        """
        self._app_protocol.resume_writing()

    def data_received(self, data):
        """Called when some SSL data is received.

        The argument is a bytes object.
        """
        if self._sslpipe is None:
            # transport closing, sslpipe is destroyed
            return

        try:
            ssldata, appdata = self._sslpipe.feed_ssldata(data)
        except (SystemExit, KeyboardInterrupt):
            raise
        except BaseException as e:
            self._fatal_error(e, 'SSL error in data received')
            return

        for chunk in ssldata:
            self._transport.write(chunk)

        for chunk in appdata:
            if chunk:
                try:
                    if self._app_protocol_is_buffer:
                        protocols._feed_data_to_buffered_proto(
                            self._app_protocol, chunk)
                    else:
                        self._app_protocol.data_received(chunk)
                except (SystemExit, KeyboardInterrupt):
                    raise
                except BaseException as ex:
                    self._fatal_error(
                        ex, 'application protocol failed to receive SSL data')
                    return
            else:
                self._start_shutdown()
                break

    def eof_received(self):
        """Called when the other end of the low-level stream
        is half-closed.

        If this returns a false value (including None), the transport
        will close itself.  If it returns a true value, closing the
        transport is up to the protocol.
        """
        try:
            if self._loop.get_debug():
                logger.debug("%r received EOF", self)

            self._wakeup_waiter(ConnectionResetError)

            if not self._in_handshake:
                keep_open = self._app_protocol.eof_received()
                if keep_open:
                    logger.warning('returning true from eof_received() '
                                   'has no effect when using ssl')
        finally:
            self._transport.close()

    def _get_extra_info(self, name, default=None):
        if name in self._extra:
            return self._extra[name]
        elif self._transport is not None:
            return self._transport.get_extra_info(name, default)
        else:
            return default

    def _start_shutdown(self):
        if self._in_shutdown:
            return
        if self._in_handshake:
            self._abort()
        else:
            self._in_shutdown = True
            self._write_appdata(b'')

    def _write_appdata(self, data):
        self._write_backlog.append((data, 0))
        self._write_buffer_size += len(data)
        self._process_write_backlog()

    def _start_handshake(self):
        if self._loop.get_debug():
            logger.debug("%r starts SSL handshake", self)
            self._handshake_start_time = self._loop.time()
        else:
            self._handshake_start_time = None
        self._in_handshake = True
        # (b'', 1) is a special value in _process_write_backlog() to do
        # the SSL handshake
        self._write_backlog.append((b'', 1))
        self._handshake_timeout_handle = \
            self._loop.call_later(self._ssl_handshake_timeout,
                                  self._check_handshake_timeout)
        self._process_write_backlog()

    def _check_handshake_timeout(self):
        if self._in_handshake is True:
            msg = (
                f"SSL handshake is taking longer than "
                f"{self._ssl_handshake_timeout} seconds: "
                f"aborting the connection"
            )
            self._fatal_error(ConnectionAbortedError(msg))

    def _on_handshake_complete(self, handshake_exc):
        self._in_handshake = False
        self._handshake_timeout_handle.cancel()

        sslobj = self._sslpipe.ssl_object
        try:
            if handshake_exc is not None:
                raise handshake_exc

            peercert = sslobj.getpeercert()
        except (SystemExit, KeyboardInterrupt):
            raise
        except BaseException as exc:
            if isinstance(exc, ssl.CertificateError):
                msg = 'SSL handshake failed on verifying the certificate'
            else:
                msg = 'SSL handshake failed'
            self._fatal_error(exc, msg)
            return

        if self._loop.get_debug():
            dt = self._loop.time() - self._handshake_start_time
            logger.debug("%r: SSL handshake took %.1f ms", self, dt * 1e3)

        # Add extra info that becomes available after handshake.
        self._extra.update(peercert=peercert,
                           cipher=sslobj.cipher(),
                           compression=sslobj.compression(),
                           ssl_object=sslobj,
                           )
        if self._call_connection_made:
            self._app_protocol.connection_made(self._app_transport)
        self._wakeup_waiter()
        self._session_established = True
        # In case transport.write() was already called. Don't call
        # immediately _process_write_backlog(), but schedule it:
        # _on_handshake_complete() can be called indirectly from
        # _process_write_backlog(), and _process_write_backlog() is not
        # reentrant.
        self._loop.call_soon(self._process_write_backlog)

    def _process_write_backlog(self):
        # Try to make progress on the write backlog.
        if self._transport is None or self._sslpipe is None:
            return

        try:
            for i in range(len(self._write_backlog)):
                data, offset = self._write_backlog[0]
                if data:
                    ssldata, offset = self._sslpipe.feed_appdata(data, offset)
                elif offset:
                    ssldata = self._sslpipe.do_handshake(
                        self._on_handshake_complete)
                    offset = 1
                else:
                    ssldata = self._sslpipe.shutdown(self._finalize)
                    offset = 1

                for chunk in ssldata:
                    self._transport.write(chunk)

                if offset < len(data):
                    self._write_backlog[0] = (data, offset)
                    # A short write means that a write is blocked on a read
                    # We need to enable reading if it is paused!
                    assert self._sslpipe.need_ssldata
                    if self._transport._paused:
                        self._transport.resume_reading()
                    break

                # An entire chunk from the backlog was processed. We can
                # delete it and reduce the outstanding buffer size.
                del self._write_backlog[0]
                self._write_buffer_size -= len(data)
        except (SystemExit, KeyboardInterrupt):
            raise
        except BaseException as exc:
            if self._in_handshake:
                # Exceptions will be re-raised in _on_handshake_complete.
                self._on_handshake_complete(exc)
            else:
                self._fatal_error(exc, 'Fatal error on SSL transport')

    def _fatal_error(self, exc, message='Fatal error on transport'):
        if isinstance(exc, OSError):
            if self._loop.get_debug():
                logger.debug("%r: %s", self, message, exc_info=True)
        else:
            self._loop.call_exception_handler({
                'message': message,
                'exception': exc,
                'transport': self._transport,
                'protocol': self,
            })
        if self._transport:
            self._transport._force_close(exc)

    def _finalize(self):
        self._sslpipe = None

        if self._transport is not None:
            self._transport.close()

    def _abort(self):
        try:
            if self._transport is not None:
                self._transport.abort()
        finally:
            self._finalize()
asyncio/runners.py000064400000004006151153537520010266 0ustar00__all__ = 'run',

from . import coroutines
from . import events
from . import tasks


def run(main, *, debug=None):
    """Execute the coroutine and return the result.

    This function runs the passed coroutine, taking care of
    managing the asyncio event loop and finalizing asynchronous
    generators.

    This function cannot be called when another asyncio event loop is
    running in the same thread.

    If debug is True, the event loop will be run in debug mode.

    This function always creates a new event loop and closes it at the end.
    It should be used as a main entry point for asyncio programs, and should
    ideally only be called once.

    Example:

        async def main():
            await asyncio.sleep(1)
            print('hello')

        asyncio.run(main())
    """
    if events._get_running_loop() is not None:
        raise RuntimeError(
            "asyncio.run() cannot be called from a running event loop")

    if not coroutines.iscoroutine(main):
        raise ValueError("a coroutine was expected, got {!r}".format(main))

    loop = events.new_event_loop()
    try:
        events.set_event_loop(loop)
        if debug is not None:
            loop.set_debug(debug)
        return loop.run_until_complete(main)
    finally:
        try:
            _cancel_all_tasks(loop)
            loop.run_until_complete(loop.shutdown_asyncgens())
        finally:
            events.set_event_loop(None)
            loop.close()


def _cancel_all_tasks(loop):
    to_cancel = tasks.all_tasks(loop)
    if not to_cancel:
        return

    for task in to_cancel:
        task.cancel()

    loop.run_until_complete(
        tasks.gather(*to_cancel, loop=loop, return_exceptions=True))

    for task in to_cancel:
        if task.cancelled():
            continue
        if task.exception() is not None:
            loop.call_exception_handler({
                'message': 'unhandled exception during asyncio.run() shutdown',
                'exception': task.exception(),
                'task': task,
            })
asyncio/selector_events.py000064400000114124151153537520012001 0ustar00"""Event loop using a selector and related classes.

A selector is a "notify-when-ready" multiplexer.  For a subclass which
also includes support for signal handling, see the unix_events sub-module.
"""

__all__ = 'BaseSelectorEventLoop',

import collections
import errno
import functools
import selectors
import socket
import warnings
import weakref
try:
    import ssl
except ImportError:  # pragma: no cover
    ssl = None

from . import base_events
from . import constants
from . import events
from . import futures
from . import protocols
from . import sslproto
from . import transports
from . import trsock
from .log import logger


def _test_selector_event(selector, fd, event):
    # Test if the selector is monitoring 'event' events
    # for the file descriptor 'fd'.
    try:
        key = selector.get_key(fd)
    except KeyError:
        return False
    else:
        return bool(key.events & event)


def _check_ssl_socket(sock):
    if ssl is not None and isinstance(sock, ssl.SSLSocket):
        raise TypeError("Socket cannot be of type SSLSocket")


class BaseSelectorEventLoop(base_events.BaseEventLoop):
    """Selector event loop.

    See events.EventLoop for API specification.
    """

    def __init__(self, selector=None):
        super().__init__()

        if selector is None:
            selector = selectors.DefaultSelector()
        logger.debug('Using selector: %s', selector.__class__.__name__)
        self._selector = selector
        self._make_self_pipe()
        self._transports = weakref.WeakValueDictionary()

    def _make_socket_transport(self, sock, protocol, waiter=None, *,
                               extra=None, server=None):
        return _SelectorSocketTransport(self, sock, protocol, waiter,
                                        extra, server)

    def _make_ssl_transport(
            self, rawsock, protocol, sslcontext, waiter=None,
            *, server_side=False, server_hostname=None,
            extra=None, server=None,
            ssl_handshake_timeout=constants.SSL_HANDSHAKE_TIMEOUT):
        ssl_protocol = sslproto.SSLProtocol(
                self, protocol, sslcontext, waiter,
                server_side, server_hostname,
                ssl_handshake_timeout=ssl_handshake_timeout)
        _SelectorSocketTransport(self, rawsock, ssl_protocol,
                                 extra=extra, server=server)
        return ssl_protocol._app_transport

    def _make_datagram_transport(self, sock, protocol,
                                 address=None, waiter=None, extra=None):
        return _SelectorDatagramTransport(self, sock, protocol,
                                          address, waiter, extra)

    def close(self):
        if self.is_running():
            raise RuntimeError("Cannot close a running event loop")
        if self.is_closed():
            return
        self._close_self_pipe()
        super().close()
        if self._selector is not None:
            self._selector.close()
            self._selector = None

    def _close_self_pipe(self):
        self._remove_reader(self._ssock.fileno())
        self._ssock.close()
        self._ssock = None
        self._csock.close()
        self._csock = None
        self._internal_fds -= 1

    def _make_self_pipe(self):
        # A self-socket, really. :-)
        self._ssock, self._csock = socket.socketpair()
        self._ssock.setblocking(False)
        self._csock.setblocking(False)
        self._internal_fds += 1
        self._add_reader(self._ssock.fileno(), self._read_from_self)

    def _process_self_data(self, data):
        pass

    def _read_from_self(self):
        while True:
            try:
                data = self._ssock.recv(4096)
                if not data:
                    break
                self._process_self_data(data)
            except InterruptedError:
                continue
            except BlockingIOError:
                break

    def _write_to_self(self):
        # This may be called from a different thread, possibly after
        # _close_self_pipe() has been called or even while it is
        # running.  Guard for self._csock being None or closed.  When
        # a socket is closed, send() raises OSError (with errno set to
        # EBADF, but let's not rely on the exact error code).
        csock = self._csock
        if csock is None:
            return

        try:
            csock.send(b'\0')
        except OSError:
            if self._debug:
                logger.debug("Fail to write a null byte into the "
                             "self-pipe socket",
                             exc_info=True)

    def _start_serving(self, protocol_factory, sock,
                       sslcontext=None, server=None, backlog=100,
                       ssl_handshake_timeout=constants.SSL_HANDSHAKE_TIMEOUT):
        self._add_reader(sock.fileno(), self._accept_connection,
                         protocol_factory, sock, sslcontext, server, backlog,
                         ssl_handshake_timeout)

    def _accept_connection(
            self, protocol_factory, sock,
            sslcontext=None, server=None, backlog=100,
            ssl_handshake_timeout=constants.SSL_HANDSHAKE_TIMEOUT):
        # This method is only called once for each event loop tick where the
        # listening socket has triggered an EVENT_READ. There may be multiple
        # connections waiting for an .accept() so it is called in a loop.
        # See https://bugs.python.org/issue27906 for more details.
        for _ in range(backlog):
            try:
                conn, addr = sock.accept()
                if self._debug:
                    logger.debug("%r got a new connection from %r: %r",
                                 server, addr, conn)
                conn.setblocking(False)
            except (BlockingIOError, InterruptedError, ConnectionAbortedError):
                # Early exit because the socket accept buffer is empty.
                return None
            except OSError as exc:
                # There's nowhere to send the error, so just log it.
                if exc.errno in (errno.EMFILE, errno.ENFILE,
                                 errno.ENOBUFS, errno.ENOMEM):
                    # Some platforms (e.g. Linux keep reporting the FD as
                    # ready, so we remove the read handler temporarily.
                    # We'll try again in a while.
                    self.call_exception_handler({
                        'message': 'socket.accept() out of system resource',
                        'exception': exc,
                        'socket': trsock.TransportSocket(sock),
                    })
                    self._remove_reader(sock.fileno())
                    self.call_later(constants.ACCEPT_RETRY_DELAY,
                                    self._start_serving,
                                    protocol_factory, sock, sslcontext, server,
                                    backlog, ssl_handshake_timeout)
                else:
                    raise  # The event loop will catch, log and ignore it.
            else:
                extra = {'peername': addr}
                accept = self._accept_connection2(
                    protocol_factory, conn, extra, sslcontext, server,
                    ssl_handshake_timeout)
                self.create_task(accept)

    async def _accept_connection2(
            self, protocol_factory, conn, extra,
            sslcontext=None, server=None,
            ssl_handshake_timeout=constants.SSL_HANDSHAKE_TIMEOUT):
        protocol = None
        transport = None
        try:
            protocol = protocol_factory()
            waiter = self.create_future()
            if sslcontext:
                transport = self._make_ssl_transport(
                    conn, protocol, sslcontext, waiter=waiter,
                    server_side=True, extra=extra, server=server,
                    ssl_handshake_timeout=ssl_handshake_timeout)
            else:
                transport = self._make_socket_transport(
                    conn, protocol, waiter=waiter, extra=extra,
                    server=server)

            try:
                await waiter
            except BaseException:
                transport.close()
                raise
                # It's now up to the protocol to handle the connection.

        except (SystemExit, KeyboardInterrupt):
            raise
        except BaseException as exc:
            if self._debug:
                context = {
                    'message':
                        'Error on transport creation for incoming connection',
                    'exception': exc,
                }
                if protocol is not None:
                    context['protocol'] = protocol
                if transport is not None:
                    context['transport'] = transport
                self.call_exception_handler(context)

    def _ensure_fd_no_transport(self, fd):
        fileno = fd
        if not isinstance(fileno, int):
            try:
                fileno = int(fileno.fileno())
            except (AttributeError, TypeError, ValueError):
                # This code matches selectors._fileobj_to_fd function.
                raise ValueError(f"Invalid file object: {fd!r}") from None
        try:
            transport = self._transports[fileno]
        except KeyError:
            pass
        else:
            if not transport.is_closing():
                raise RuntimeError(
                    f'File descriptor {fd!r} is used by transport '
                    f'{transport!r}')

    def _add_reader(self, fd, callback, *args):
        self._check_closed()
        handle = events.Handle(callback, args, self, None)
        try:
            key = self._selector.get_key(fd)
        except KeyError:
            self._selector.register(fd, selectors.EVENT_READ,
                                    (handle, None))
        else:
            mask, (reader, writer) = key.events, key.data
            self._selector.modify(fd, mask | selectors.EVENT_READ,
                                  (handle, writer))
            if reader is not None:
                reader.cancel()

    def _remove_reader(self, fd):
        if self.is_closed():
            return False
        try:
            key = self._selector.get_key(fd)
        except KeyError:
            return False
        else:
            mask, (reader, writer) = key.events, key.data
            mask &= ~selectors.EVENT_READ
            if not mask:
                self._selector.unregister(fd)
            else:
                self._selector.modify(fd, mask, (None, writer))

            if reader is not None:
                reader.cancel()
                return True
            else:
                return False

    def _add_writer(self, fd, callback, *args):
        self._check_closed()
        handle = events.Handle(callback, args, self, None)
        try:
            key = self._selector.get_key(fd)
        except KeyError:
            self._selector.register(fd, selectors.EVENT_WRITE,
                                    (None, handle))
        else:
            mask, (reader, writer) = key.events, key.data
            self._selector.modify(fd, mask | selectors.EVENT_WRITE,
                                  (reader, handle))
            if writer is not None:
                writer.cancel()

    def _remove_writer(self, fd):
        """Remove a writer callback."""
        if self.is_closed():
            return False
        try:
            key = self._selector.get_key(fd)
        except KeyError:
            return False
        else:
            mask, (reader, writer) = key.events, key.data
            # Remove both writer and connector.
            mask &= ~selectors.EVENT_WRITE
            if not mask:
                self._selector.unregister(fd)
            else:
                self._selector.modify(fd, mask, (reader, None))

            if writer is not None:
                writer.cancel()
                return True
            else:
                return False

    def add_reader(self, fd, callback, *args):
        """Add a reader callback."""
        self._ensure_fd_no_transport(fd)
        return self._add_reader(fd, callback, *args)

    def remove_reader(self, fd):
        """Remove a reader callback."""
        self._ensure_fd_no_transport(fd)
        return self._remove_reader(fd)

    def add_writer(self, fd, callback, *args):
        """Add a writer callback.."""
        self._ensure_fd_no_transport(fd)
        return self._add_writer(fd, callback, *args)

    def remove_writer(self, fd):
        """Remove a writer callback."""
        self._ensure_fd_no_transport(fd)
        return self._remove_writer(fd)

    async def sock_recv(self, sock, n):
        """Receive data from the socket.

        The return value is a bytes object representing the data received.
        The maximum amount of data to be received at once is specified by
        nbytes.
        """
        _check_ssl_socket(sock)
        if self._debug and sock.gettimeout() != 0:
            raise ValueError("the socket must be non-blocking")
        try:
            return sock.recv(n)
        except (BlockingIOError, InterruptedError):
            pass
        fut = self.create_future()
        fd = sock.fileno()
        self.add_reader(fd, self._sock_recv, fut, sock, n)
        fut.add_done_callback(
            functools.partial(self._sock_read_done, fd))
        return await fut

    def _sock_read_done(self, fd, fut):
        self.remove_reader(fd)

    def _sock_recv(self, fut, sock, n):
        # _sock_recv() can add itself as an I/O callback if the operation can't
        # be done immediately. Don't use it directly, call sock_recv().
        if fut.done():
            return
        try:
            data = sock.recv(n)
        except (BlockingIOError, InterruptedError):
            return  # try again next time
        except (SystemExit, KeyboardInterrupt):
            raise
        except BaseException as exc:
            fut.set_exception(exc)
        else:
            fut.set_result(data)

    async def sock_recv_into(self, sock, buf):
        """Receive data from the socket.

        The received data is written into *buf* (a writable buffer).
        The return value is the number of bytes written.
        """
        _check_ssl_socket(sock)
        if self._debug and sock.gettimeout() != 0:
            raise ValueError("the socket must be non-blocking")
        try:
            return sock.recv_into(buf)
        except (BlockingIOError, InterruptedError):
            pass
        fut = self.create_future()
        fd = sock.fileno()
        self.add_reader(fd, self._sock_recv_into, fut, sock, buf)
        fut.add_done_callback(
            functools.partial(self._sock_read_done, fd))
        return await fut

    def _sock_recv_into(self, fut, sock, buf):
        # _sock_recv_into() can add itself as an I/O callback if the operation
        # can't be done immediately. Don't use it directly, call
        # sock_recv_into().
        if fut.done():
            return
        try:
            nbytes = sock.recv_into(buf)
        except (BlockingIOError, InterruptedError):
            return  # try again next time
        except (SystemExit, KeyboardInterrupt):
            raise
        except BaseException as exc:
            fut.set_exception(exc)
        else:
            fut.set_result(nbytes)

    async def sock_sendall(self, sock, data):
        """Send data to the socket.

        The socket must be connected to a remote socket. This method continues
        to send data from data until either all data has been sent or an
        error occurs. None is returned on success. On error, an exception is
        raised, and there is no way to determine how much data, if any, was
        successfully processed by the receiving end of the connection.
        """
        _check_ssl_socket(sock)
        if self._debug and sock.gettimeout() != 0:
            raise ValueError("the socket must be non-blocking")
        try:
            n = sock.send(data)
        except (BlockingIOError, InterruptedError):
            n = 0

        if n == len(data):
            # all data sent
            return

        fut = self.create_future()
        fd = sock.fileno()
        fut.add_done_callback(
            functools.partial(self._sock_write_done, fd))
        # use a trick with a list in closure to store a mutable state
        self.add_writer(fd, self._sock_sendall, fut, sock,
                        memoryview(data), [n])
        return await fut

    def _sock_sendall(self, fut, sock, view, pos):
        if fut.done():
            # Future cancellation can be scheduled on previous loop iteration
            return
        start = pos[0]
        try:
            n = sock.send(view[start:])
        except (BlockingIOError, InterruptedError):
            return
        except (SystemExit, KeyboardInterrupt):
            raise
        except BaseException as exc:
            fut.set_exception(exc)
            return

        start += n

        if start == len(view):
            fut.set_result(None)
        else:
            pos[0] = start

    async def sock_connect(self, sock, address):
        """Connect to a remote socket at address.

        This method is a coroutine.
        """
        _check_ssl_socket(sock)
        if self._debug and sock.gettimeout() != 0:
            raise ValueError("the socket must be non-blocking")

        if not hasattr(socket, 'AF_UNIX') or sock.family != socket.AF_UNIX:
            resolved = await self._ensure_resolved(
                address, family=sock.family, proto=sock.proto, loop=self)
            _, _, _, _, address = resolved[0]

        fut = self.create_future()
        self._sock_connect(fut, sock, address)
        return await fut

    def _sock_connect(self, fut, sock, address):
        fd = sock.fileno()
        try:
            sock.connect(address)
        except (BlockingIOError, InterruptedError):
            # Issue #23618: When the C function connect() fails with EINTR, the
            # connection runs in background. We have to wait until the socket
            # becomes writable to be notified when the connection succeed or
            # fails.
            fut.add_done_callback(
                functools.partial(self._sock_write_done, fd))
            self.add_writer(fd, self._sock_connect_cb, fut, sock, address)
        except (SystemExit, KeyboardInterrupt):
            raise
        except BaseException as exc:
            fut.set_exception(exc)
        else:
            fut.set_result(None)

    def _sock_write_done(self, fd, fut):
        self.remove_writer(fd)

    def _sock_connect_cb(self, fut, sock, address):
        if fut.done():
            return

        try:
            err = sock.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR)
            if err != 0:
                # Jump to any except clause below.
                raise OSError(err, f'Connect call failed {address}')
        except (BlockingIOError, InterruptedError):
            # socket is still registered, the callback will be retried later
            pass
        except (SystemExit, KeyboardInterrupt):
            raise
        except BaseException as exc:
            fut.set_exception(exc)
        else:
            fut.set_result(None)

    async def sock_accept(self, sock):
        """Accept a connection.

        The socket must be bound to an address and listening for connections.
        The return value is a pair (conn, address) where conn is a new socket
        object usable to send and receive data on the connection, and address
        is the address bound to the socket on the other end of the connection.
        """
        _check_ssl_socket(sock)
        if self._debug and sock.gettimeout() != 0:
            raise ValueError("the socket must be non-blocking")
        fut = self.create_future()
        self._sock_accept(fut, False, sock)
        return await fut

    def _sock_accept(self, fut, registered, sock):
        fd = sock.fileno()
        if registered:
            self.remove_reader(fd)
        if fut.done():
            return
        try:
            conn, address = sock.accept()
            conn.setblocking(False)
        except (BlockingIOError, InterruptedError):
            self.add_reader(fd, self._sock_accept, fut, True, sock)
        except (SystemExit, KeyboardInterrupt):
            raise
        except BaseException as exc:
            fut.set_exception(exc)
        else:
            fut.set_result((conn, address))

    async def _sendfile_native(self, transp, file, offset, count):
        del self._transports[transp._sock_fd]
        resume_reading = transp.is_reading()
        transp.pause_reading()
        await transp._make_empty_waiter()
        try:
            return await self.sock_sendfile(transp._sock, file, offset, count,
                                            fallback=False)
        finally:
            transp._reset_empty_waiter()
            if resume_reading:
                transp.resume_reading()
            self._transports[transp._sock_fd] = transp

    def _process_events(self, event_list):
        for key, mask in event_list:
            fileobj, (reader, writer) = key.fileobj, key.data
            if mask & selectors.EVENT_READ and reader is not None:
                if reader._cancelled:
                    self._remove_reader(fileobj)
                else:
                    self._add_callback(reader)
            if mask & selectors.EVENT_WRITE and writer is not None:
                if writer._cancelled:
                    self._remove_writer(fileobj)
                else:
                    self._add_callback(writer)

    def _stop_serving(self, sock):
        self._remove_reader(sock.fileno())
        sock.close()


class _SelectorTransport(transports._FlowControlMixin,
                         transports.Transport):

    max_size = 256 * 1024  # Buffer size passed to recv().

    _buffer_factory = bytearray  # Constructs initial value for self._buffer.

    # Attribute used in the destructor: it must be set even if the constructor
    # is not called (see _SelectorSslTransport which may start by raising an
    # exception)
    _sock = None

    def __init__(self, loop, sock, protocol, extra=None, server=None):
        super().__init__(extra, loop)
        self._extra['socket'] = trsock.TransportSocket(sock)
        try:
            self._extra['sockname'] = sock.getsockname()
        except OSError:
            self._extra['sockname'] = None
        if 'peername' not in self._extra:
            try:
                self._extra['peername'] = sock.getpeername()
            except socket.error:
                self._extra['peername'] = None
        self._sock = sock
        self._sock_fd = sock.fileno()

        self._protocol_connected = False
        self.set_protocol(protocol)

        self._server = server
        self._buffer = self._buffer_factory()
        self._conn_lost = 0  # Set when call to connection_lost scheduled.
        self._closing = False  # Set when close() called.
        if self._server is not None:
            self._server._attach()
        loop._transports[self._sock_fd] = self

    def __repr__(self):
        info = [self.__class__.__name__]
        if self._sock is None:
            info.append('closed')
        elif self._closing:
            info.append('closing')
        info.append(f'fd={self._sock_fd}')
        # test if the transport was closed
        if self._loop is not None and not self._loop.is_closed():
            polling = _test_selector_event(self._loop._selector,
                                           self._sock_fd, selectors.EVENT_READ)
            if polling:
                info.append('read=polling')
            else:
                info.append('read=idle')

            polling = _test_selector_event(self._loop._selector,
                                           self._sock_fd,
                                           selectors.EVENT_WRITE)
            if polling:
                state = 'polling'
            else:
                state = 'idle'

            bufsize = self.get_write_buffer_size()
            info.append(f'write=<{state}, bufsize={bufsize}>')
        return '<{}>'.format(' '.join(info))

    def abort(self):
        self._force_close(None)

    def set_protocol(self, protocol):
        self._protocol = protocol
        self._protocol_connected = True

    def get_protocol(self):
        return self._protocol

    def is_closing(self):
        return self._closing

    def close(self):
        if self._closing:
            return
        self._closing = True
        self._loop._remove_reader(self._sock_fd)
        if not self._buffer:
            self._conn_lost += 1
            self._loop._remove_writer(self._sock_fd)
            self._loop.call_soon(self._call_connection_lost, None)

    def __del__(self, _warn=warnings.warn):
        if self._sock is not None:
            _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
            self._sock.close()

    def _fatal_error(self, exc, message='Fatal error on transport'):
        # Should be called from exception handler only.
        if isinstance(exc, OSError):
            if self._loop.get_debug():
                logger.debug("%r: %s", self, message, exc_info=True)
        else:
            self._loop.call_exception_handler({
                'message': message,
                'exception': exc,
                'transport': self,
                'protocol': self._protocol,
            })
        self._force_close(exc)

    def _force_close(self, exc):
        if self._conn_lost:
            return
        if self._buffer:
            self._buffer.clear()
            self._loop._remove_writer(self._sock_fd)
        if not self._closing:
            self._closing = True
            self._loop._remove_reader(self._sock_fd)
        self._conn_lost += 1
        self._loop.call_soon(self._call_connection_lost, exc)

    def _call_connection_lost(self, exc):
        try:
            if self._protocol_connected:
                self._protocol.connection_lost(exc)
        finally:
            self._sock.close()
            self._sock = None
            self._protocol = None
            self._loop = None
            server = self._server
            if server is not None:
                server._detach()
                self._server = None

    def get_write_buffer_size(self):
        return len(self._buffer)

    def _add_reader(self, fd, callback, *args):
        if self._closing:
            return

        self._loop._add_reader(fd, callback, *args)


class _SelectorSocketTransport(_SelectorTransport):

    _start_tls_compatible = True
    _sendfile_compatible = constants._SendfileMode.TRY_NATIVE

    def __init__(self, loop, sock, protocol, waiter=None,
                 extra=None, server=None):

        self._read_ready_cb = None
        super().__init__(loop, sock, protocol, extra, server)
        self._eof = False
        self._paused = False
        self._empty_waiter = None

        # Disable the Nagle algorithm -- small writes will be
        # sent without waiting for the TCP ACK.  This generally
        # decreases the latency (in some cases significantly.)
        base_events._set_nodelay(self._sock)

        self._loop.call_soon(self._protocol.connection_made, self)
        # only start reading when connection_made() has been called
        self._loop.call_soon(self._add_reader,
                             self._sock_fd, self._read_ready)
        if waiter is not None:
            # only wake up the waiter when connection_made() has been called
            self._loop.call_soon(futures._set_result_unless_cancelled,
                                 waiter, None)

    def set_protocol(self, protocol):
        if isinstance(protocol, protocols.BufferedProtocol):
            self._read_ready_cb = self._read_ready__get_buffer
        else:
            self._read_ready_cb = self._read_ready__data_received

        super().set_protocol(protocol)

    def is_reading(self):
        return not self._paused and not self._closing

    def pause_reading(self):
        if self._closing or self._paused:
            return
        self._paused = True
        self._loop._remove_reader(self._sock_fd)
        if self._loop.get_debug():
            logger.debug("%r pauses reading", self)

    def resume_reading(self):
        if self._closing or not self._paused:
            return
        self._paused = False
        self._add_reader(self._sock_fd, self._read_ready)
        if self._loop.get_debug():
            logger.debug("%r resumes reading", self)

    def _read_ready(self):
        self._read_ready_cb()

    def _read_ready__get_buffer(self):
        if self._conn_lost:
            return

        try:
            buf = self._protocol.get_buffer(-1)
            if not len(buf):
                raise RuntimeError('get_buffer() returned an empty buffer')
        except (SystemExit, KeyboardInterrupt):
            raise
        except BaseException as exc:
            self._fatal_error(
                exc, 'Fatal error: protocol.get_buffer() call failed.')
            return

        try:
            nbytes = self._sock.recv_into(buf)
        except (BlockingIOError, InterruptedError):
            return
        except (SystemExit, KeyboardInterrupt):
            raise
        except BaseException as exc:
            self._fatal_error(exc, 'Fatal read error on socket transport')
            return

        if not nbytes:
            self._read_ready__on_eof()
            return

        try:
            self._protocol.buffer_updated(nbytes)
        except (SystemExit, KeyboardInterrupt):
            raise
        except BaseException as exc:
            self._fatal_error(
                exc, 'Fatal error: protocol.buffer_updated() call failed.')

    def _read_ready__data_received(self):
        if self._conn_lost:
            return
        try:
            data = self._sock.recv(self.max_size)
        except (BlockingIOError, InterruptedError):
            return
        except (SystemExit, KeyboardInterrupt):
            raise
        except BaseException as exc:
            self._fatal_error(exc, 'Fatal read error on socket transport')
            return

        if not data:
            self._read_ready__on_eof()
            return

        try:
            self._protocol.data_received(data)
        except (SystemExit, KeyboardInterrupt):
            raise
        except BaseException as exc:
            self._fatal_error(
                exc, 'Fatal error: protocol.data_received() call failed.')

    def _read_ready__on_eof(self):
        if self._loop.get_debug():
            logger.debug("%r received EOF", self)

        try:
            keep_open = self._protocol.eof_received()
        except (SystemExit, KeyboardInterrupt):
            raise
        except BaseException as exc:
            self._fatal_error(
                exc, 'Fatal error: protocol.eof_received() call failed.')
            return

        if keep_open:
            # We're keeping the connection open so the
            # protocol can write more, but we still can't
            # receive more, so remove the reader callback.
            self._loop._remove_reader(self._sock_fd)
        else:
            self.close()

    def write(self, data):
        if not isinstance(data, (bytes, bytearray, memoryview)):
            raise TypeError(f'data argument must be a bytes-like object, '
                            f'not {type(data).__name__!r}')
        if self._eof:
            raise RuntimeError('Cannot call write() after write_eof()')
        if self._empty_waiter is not None:
            raise RuntimeError('unable to write; sendfile is in progress')
        if not data:
            return

        if self._conn_lost:
            if self._conn_lost >= constants.LOG_THRESHOLD_FOR_CONNLOST_WRITES:
                logger.warning('socket.send() raised exception.')
            self._conn_lost += 1
            return

        if not self._buffer:
            # Optimization: try to send now.
            try:
                n = self._sock.send(data)
            except (BlockingIOError, InterruptedError):
                pass
            except (SystemExit, KeyboardInterrupt):
                raise
            except BaseException as exc:
                self._fatal_error(exc, 'Fatal write error on socket transport')
                return
            else:
                data = data[n:]
                if not data:
                    return
            # Not all was written; register write handler.
            self._loop._add_writer(self._sock_fd, self._write_ready)

        # Add it to the buffer.
        self._buffer.extend(data)
        self._maybe_pause_protocol()

    def _write_ready(self):
        assert self._buffer, 'Data should not be empty'

        if self._conn_lost:
            return
        try:
            n = self._sock.send(self._buffer)
        except (BlockingIOError, InterruptedError):
            pass
        except (SystemExit, KeyboardInterrupt):
            raise
        except BaseException as exc:
            self._loop._remove_writer(self._sock_fd)
            self._buffer.clear()
            self._fatal_error(exc, 'Fatal write error on socket transport')
            if self._empty_waiter is not None:
                self._empty_waiter.set_exception(exc)
        else:
            if n:
                del self._buffer[:n]
            self._maybe_resume_protocol()  # May append to buffer.
            if not self._buffer:
                self._loop._remove_writer(self._sock_fd)
                if self._empty_waiter is not None:
                    self._empty_waiter.set_result(None)
                if self._closing:
                    self._call_connection_lost(None)
                elif self._eof:
                    self._sock.shutdown(socket.SHUT_WR)

    def write_eof(self):
        if self._closing or self._eof:
            return
        self._eof = True
        if not self._buffer:
            self._sock.shutdown(socket.SHUT_WR)

    def can_write_eof(self):
        return True

    def _call_connection_lost(self, exc):
        super()._call_connection_lost(exc)
        if self._empty_waiter is not None:
            self._empty_waiter.set_exception(
                ConnectionError("Connection is closed by peer"))

    def _make_empty_waiter(self):
        if self._empty_waiter is not None:
            raise RuntimeError("Empty waiter is already set")
        self._empty_waiter = self._loop.create_future()
        if not self._buffer:
            self._empty_waiter.set_result(None)
        return self._empty_waiter

    def _reset_empty_waiter(self):
        self._empty_waiter = None


class _SelectorDatagramTransport(_SelectorTransport):

    _buffer_factory = collections.deque

    def __init__(self, loop, sock, protocol, address=None,
                 waiter=None, extra=None):
        super().__init__(loop, sock, protocol, extra)
        self._address = address
        self._loop.call_soon(self._protocol.connection_made, self)
        # only start reading when connection_made() has been called
        self._loop.call_soon(self._add_reader,
                             self._sock_fd, self._read_ready)
        if waiter is not None:
            # only wake up the waiter when connection_made() has been called
            self._loop.call_soon(futures._set_result_unless_cancelled,
                                 waiter, None)

    def get_write_buffer_size(self):
        return sum(len(data) for data, _ in self._buffer)

    def _read_ready(self):
        if self._conn_lost:
            return
        try:
            data, addr = self._sock.recvfrom(self.max_size)
        except (BlockingIOError, InterruptedError):
            pass
        except OSError as exc:
            self._protocol.error_received(exc)
        except (SystemExit, KeyboardInterrupt):
            raise
        except BaseException as exc:
            self._fatal_error(exc, 'Fatal read error on datagram transport')
        else:
            self._protocol.datagram_received(data, addr)

    def sendto(self, data, addr=None):
        if not isinstance(data, (bytes, bytearray, memoryview)):
            raise TypeError(f'data argument must be a bytes-like object, '
                            f'not {type(data).__name__!r}')
        if not data:
            return

        if self._address:
            if addr not in (None, self._address):
                raise ValueError(
                    f'Invalid address: must be None or {self._address}')
            addr = self._address

        if self._conn_lost and self._address:
            if self._conn_lost >= constants.LOG_THRESHOLD_FOR_CONNLOST_WRITES:
                logger.warning('socket.send() raised exception.')
            self._conn_lost += 1
            return

        if not self._buffer:
            # Attempt to send it right away first.
            try:
                if self._extra['peername']:
                    self._sock.send(data)
                else:
                    self._sock.sendto(data, addr)
                return
            except (BlockingIOError, InterruptedError):
                self._loop._add_writer(self._sock_fd, self._sendto_ready)
            except OSError as exc:
                self._protocol.error_received(exc)
                return
            except (SystemExit, KeyboardInterrupt):
                raise
            except BaseException as exc:
                self._fatal_error(
                    exc, 'Fatal write error on datagram transport')
                return

        # Ensure that what we buffer is immutable.
        self._buffer.append((bytes(data), addr))
        self._maybe_pause_protocol()

    def _sendto_ready(self):
        while self._buffer:
            data, addr = self._buffer.popleft()
            try:
                if self._extra['peername']:
                    self._sock.send(data)
                else:
                    self._sock.sendto(data, addr)
            except (BlockingIOError, InterruptedError):
                self._buffer.appendleft((data, addr))  # Try again later.
                break
            except OSError as exc:
                self._protocol.error_received(exc)
                return
            except (SystemExit, KeyboardInterrupt):
                raise
            except BaseException as exc:
                self._fatal_error(
                    exc, 'Fatal write error on datagram transport')
                return

        self._maybe_resume_protocol()  # May append to buffer.
        if not self._buffer:
            self._loop._remove_writer(self._sock_fd)
            if self._closing:
                self._call_connection_lost(None)
asyncio/base_futures.py000064400000005016151153537520011263 0ustar00__all__ = ()

import reprlib
from _thread import get_ident

from . import format_helpers

# States for Future.
_PENDING = 'PENDING'
_CANCELLED = 'CANCELLED'
_FINISHED = 'FINISHED'


def isfuture(obj):
    """Check for a Future.

    This returns True when obj is a Future instance or is advertising
    itself as duck-type compatible by setting _asyncio_future_blocking.
    See comment in Future for more details.
    """
    return (hasattr(obj.__class__, '_asyncio_future_blocking') and
            obj._asyncio_future_blocking is not None)


def _format_callbacks(cb):
    """helper function for Future.__repr__"""
    size = len(cb)
    if not size:
        cb = ''

    def format_cb(callback):
        return format_helpers._format_callback_source(callback, ())

    if size == 1:
        cb = format_cb(cb[0][0])
    elif size == 2:
        cb = '{}, {}'.format(format_cb(cb[0][0]), format_cb(cb[1][0]))
    elif size > 2:
        cb = '{}, <{} more>, {}'.format(format_cb(cb[0][0]),
                                        size - 2,
                                        format_cb(cb[-1][0]))
    return f'cb=[{cb}]'


# bpo-42183: _repr_running is needed for repr protection
# when a Future or Task result contains itself directly or indirectly.
# The logic is borrowed from @reprlib.recursive_repr decorator.
# Unfortunately, the direct decorator usage is impossible because of
# AttributeError: '_asyncio.Task' object has no attribute '__module__' error.
#
# After fixing this thing we can return to the decorator based approach.
_repr_running = set()


def _future_repr_info(future):
    # (Future) -> str
    """helper function for Future.__repr__"""
    info = [future._state.lower()]
    if future._state == _FINISHED:
        if future._exception is not None:
            info.append(f'exception={future._exception!r}')
        else:
            key = id(future), get_ident()
            if key in _repr_running:
                result = '...'
            else:
                _repr_running.add(key)
                try:
                    # use reprlib to limit the length of the output, especially
                    # for very long strings
                    result = reprlib.repr(future._result)
                finally:
                    _repr_running.discard(key)
            info.append(f'result={result}')
    if future._callbacks:
        info.append(_format_callbacks(future._callbacks))
    if future._source_traceback:
        frame = future._source_traceback[-1]
        info.append(f'created at {frame[0]}:{frame[1]}')
    return info
asyncio/locks.py000064400000041574151153537520007720 0ustar00"""Synchronization primitives."""

__all__ = ('Lock', 'Event', 'Condition', 'Semaphore', 'BoundedSemaphore')

import collections
import types
import warnings

from . import events
from . import futures
from . import exceptions
from .import coroutines


class _ContextManager:
    """Context manager.

    This enables the following idiom for acquiring and releasing a
    lock around a block:

        with (yield from lock):
            <block>

    while failing loudly when accidentally using:

        with lock:
            <block>

    Deprecated, use 'async with' statement:
        async with lock:
            <block>
    """

    def __init__(self, lock):
        self._lock = lock

    def __enter__(self):
        # We have no use for the "as ..."  clause in the with
        # statement for locks.
        return None

    def __exit__(self, *args):
        try:
            self._lock.release()
        finally:
            self._lock = None  # Crudely prevent reuse.


class _ContextManagerMixin:
    def __enter__(self):
        raise RuntimeError(
            '"yield from" should be used as context manager expression')

    def __exit__(self, *args):
        # This must exist because __enter__ exists, even though that
        # always raises; that's how the with-statement works.
        pass

    @types.coroutine
    def __iter__(self):
        # This is not a coroutine.  It is meant to enable the idiom:
        #
        #     with (yield from lock):
        #         <block>
        #
        # as an alternative to:
        #
        #     yield from lock.acquire()
        #     try:
        #         <block>
        #     finally:
        #         lock.release()
        # Deprecated, use 'async with' statement:
        #     async with lock:
        #         <block>
        warnings.warn("'with (yield from lock)' is deprecated "
                      "use 'async with lock' instead",
                      DeprecationWarning, stacklevel=2)
        yield from self.acquire()
        return _ContextManager(self)

    # The flag is needed for legacy asyncio.iscoroutine()
    __iter__._is_coroutine = coroutines._is_coroutine

    async def __acquire_ctx(self):
        await self.acquire()
        return _ContextManager(self)

    def __await__(self):
        warnings.warn("'with await lock' is deprecated "
                      "use 'async with lock' instead",
                      DeprecationWarning, stacklevel=2)
        # To make "with await lock" work.
        return self.__acquire_ctx().__await__()

    async def __aenter__(self):
        await self.acquire()
        # We have no use for the "as ..."  clause in the with
        # statement for locks.
        return None

    async def __aexit__(self, exc_type, exc, tb):
        self.release()


class Lock(_ContextManagerMixin):
    """Primitive lock objects.

    A primitive lock is a synchronization primitive that is not owned
    by a particular coroutine when locked.  A primitive lock is in one
    of two states, 'locked' or 'unlocked'.

    It is created in the unlocked state.  It has two basic methods,
    acquire() and release().  When the state is unlocked, acquire()
    changes the state to locked and returns immediately.  When the
    state is locked, acquire() blocks until a call to release() in
    another coroutine changes it to unlocked, then the acquire() call
    resets it to locked and returns.  The release() method should only
    be called in the locked state; it changes the state to unlocked
    and returns immediately.  If an attempt is made to release an
    unlocked lock, a RuntimeError will be raised.

    When more than one coroutine is blocked in acquire() waiting for
    the state to turn to unlocked, only one coroutine proceeds when a
    release() call resets the state to unlocked; first coroutine which
    is blocked in acquire() is being processed.

    acquire() is a coroutine and should be called with 'await'.

    Locks also support the asynchronous context management protocol.
    'async with lock' statement should be used.

    Usage:

        lock = Lock()
        ...
        await lock.acquire()
        try:
            ...
        finally:
            lock.release()

    Context manager usage:

        lock = Lock()
        ...
        async with lock:
             ...

    Lock objects can be tested for locking state:

        if not lock.locked():
           await lock.acquire()
        else:
           # lock is acquired
           ...

    """

    def __init__(self, *, loop=None):
        self._waiters = None
        self._locked = False
        if loop is None:
            self._loop = events.get_event_loop()
        else:
            self._loop = loop
            warnings.warn("The loop argument is deprecated since Python 3.8, "
                          "and scheduled for removal in Python 3.10.",
                          DeprecationWarning, stacklevel=2)

    def __repr__(self):
        res = super().__repr__()
        extra = 'locked' if self._locked else 'unlocked'
        if self._waiters:
            extra = f'{extra}, waiters:{len(self._waiters)}'
        return f'<{res[1:-1]} [{extra}]>'

    def locked(self):
        """Return True if lock is acquired."""
        return self._locked

    async def acquire(self):
        """Acquire a lock.

        This method blocks until the lock is unlocked, then sets it to
        locked and returns True.
        """
        if (not self._locked and (self._waiters is None or
                all(w.cancelled() for w in self._waiters))):
            self._locked = True
            return True

        if self._waiters is None:
            self._waiters = collections.deque()
        fut = self._loop.create_future()
        self._waiters.append(fut)

        # Finally block should be called before the CancelledError
        # handling as we don't want CancelledError to call
        # _wake_up_first() and attempt to wake up itself.
        try:
            try:
                await fut
            finally:
                self._waiters.remove(fut)
        except exceptions.CancelledError:
            if not self._locked:
                self._wake_up_first()
            raise

        self._locked = True
        return True

    def release(self):
        """Release a lock.

        When the lock is locked, reset it to unlocked, and return.
        If any other coroutines are blocked waiting for the lock to become
        unlocked, allow exactly one of them to proceed.

        When invoked on an unlocked lock, a RuntimeError is raised.

        There is no return value.
        """
        if self._locked:
            self._locked = False
            self._wake_up_first()
        else:
            raise RuntimeError('Lock is not acquired.')

    def _wake_up_first(self):
        """Wake up the first waiter if it isn't done."""
        if not self._waiters:
            return
        try:
            fut = next(iter(self._waiters))
        except StopIteration:
            return

        # .done() necessarily means that a waiter will wake up later on and
        # either take the lock, or, if it was cancelled and lock wasn't
        # taken already, will hit this again and wake up a new waiter.
        if not fut.done():
            fut.set_result(True)


class Event:
    """Asynchronous equivalent to threading.Event.

    Class implementing event objects. An event manages a flag that can be set
    to true with the set() method and reset to false with the clear() method.
    The wait() method blocks until the flag is true. The flag is initially
    false.
    """

    def __init__(self, *, loop=None):
        self._waiters = collections.deque()
        self._value = False
        if loop is None:
            self._loop = events.get_event_loop()
        else:
            self._loop = loop
            warnings.warn("The loop argument is deprecated since Python 3.8, "
                          "and scheduled for removal in Python 3.10.",
                          DeprecationWarning, stacklevel=2)

    def __repr__(self):
        res = super().__repr__()
        extra = 'set' if self._value else 'unset'
        if self._waiters:
            extra = f'{extra}, waiters:{len(self._waiters)}'
        return f'<{res[1:-1]} [{extra}]>'

    def is_set(self):
        """Return True if and only if the internal flag is true."""
        return self._value

    def set(self):
        """Set the internal flag to true. All coroutines waiting for it to
        become true are awakened. Coroutine that call wait() once the flag is
        true will not block at all.
        """
        if not self._value:
            self._value = True

            for fut in self._waiters:
                if not fut.done():
                    fut.set_result(True)

    def clear(self):
        """Reset the internal flag to false. Subsequently, coroutines calling
        wait() will block until set() is called to set the internal flag
        to true again."""
        self._value = False

    async def wait(self):
        """Block until the internal flag is true.

        If the internal flag is true on entry, return True
        immediately.  Otherwise, block until another coroutine calls
        set() to set the flag to true, then return True.
        """
        if self._value:
            return True

        fut = self._loop.create_future()
        self._waiters.append(fut)
        try:
            await fut
            return True
        finally:
            self._waiters.remove(fut)


class Condition(_ContextManagerMixin):
    """Asynchronous equivalent to threading.Condition.

    This class implements condition variable objects. A condition variable
    allows one or more coroutines to wait until they are notified by another
    coroutine.

    A new Lock object is created and used as the underlying lock.
    """

    def __init__(self, lock=None, *, loop=None):
        if loop is None:
            self._loop = events.get_event_loop()
        else:
            self._loop = loop
            warnings.warn("The loop argument is deprecated since Python 3.8, "
                          "and scheduled for removal in Python 3.10.",
                          DeprecationWarning, stacklevel=2)

        if lock is None:
            lock = Lock(loop=loop)
        elif lock._loop is not self._loop:
            raise ValueError("loop argument must agree with lock")

        self._lock = lock
        # Export the lock's locked(), acquire() and release() methods.
        self.locked = lock.locked
        self.acquire = lock.acquire
        self.release = lock.release

        self._waiters = collections.deque()

    def __repr__(self):
        res = super().__repr__()
        extra = 'locked' if self.locked() else 'unlocked'
        if self._waiters:
            extra = f'{extra}, waiters:{len(self._waiters)}'
        return f'<{res[1:-1]} [{extra}]>'

    async def wait(self):
        """Wait until notified.

        If the calling coroutine has not acquired the lock when this
        method is called, a RuntimeError is raised.

        This method releases the underlying lock, and then blocks
        until it is awakened by a notify() or notify_all() call for
        the same condition variable in another coroutine.  Once
        awakened, it re-acquires the lock and returns True.
        """
        if not self.locked():
            raise RuntimeError('cannot wait on un-acquired lock')

        self.release()
        try:
            fut = self._loop.create_future()
            self._waiters.append(fut)
            try:
                await fut
                return True
            finally:
                self._waiters.remove(fut)

        finally:
            # Must reacquire lock even if wait is cancelled
            cancelled = False
            while True:
                try:
                    await self.acquire()
                    break
                except exceptions.CancelledError:
                    cancelled = True

            if cancelled:
                raise exceptions.CancelledError

    async def wait_for(self, predicate):
        """Wait until a predicate becomes true.

        The predicate should be a callable which result will be
        interpreted as a boolean value.  The final predicate value is
        the return value.
        """
        result = predicate()
        while not result:
            await self.wait()
            result = predicate()
        return result

    def notify(self, n=1):
        """By default, wake up one coroutine waiting on this condition, if any.
        If the calling coroutine has not acquired the lock when this method
        is called, a RuntimeError is raised.

        This method wakes up at most n of the coroutines waiting for the
        condition variable; it is a no-op if no coroutines are waiting.

        Note: an awakened coroutine does not actually return from its
        wait() call until it can reacquire the lock. Since notify() does
        not release the lock, its caller should.
        """
        if not self.locked():
            raise RuntimeError('cannot notify on un-acquired lock')

        idx = 0
        for fut in self._waiters:
            if idx >= n:
                break

            if not fut.done():
                idx += 1
                fut.set_result(False)

    def notify_all(self):
        """Wake up all threads waiting on this condition. This method acts
        like notify(), but wakes up all waiting threads instead of one. If the
        calling thread has not acquired the lock when this method is called,
        a RuntimeError is raised.
        """
        self.notify(len(self._waiters))


class Semaphore(_ContextManagerMixin):
    """A Semaphore implementation.

    A semaphore manages an internal counter which is decremented by each
    acquire() call and incremented by each release() call. The counter
    can never go below zero; when acquire() finds that it is zero, it blocks,
    waiting until some other thread calls release().

    Semaphores also support the context management protocol.

    The optional argument gives the initial value for the internal
    counter; it defaults to 1. If the value given is less than 0,
    ValueError is raised.
    """

    def __init__(self, value=1, *, loop=None):
        if value < 0:
            raise ValueError("Semaphore initial value must be >= 0")
        self._value = value
        self._waiters = collections.deque()
        if loop is None:
            self._loop = events.get_event_loop()
        else:
            self._loop = loop
            warnings.warn("The loop argument is deprecated since Python 3.8, "
                          "and scheduled for removal in Python 3.10.",
                          DeprecationWarning, stacklevel=2)

    def __repr__(self):
        res = super().__repr__()
        extra = 'locked' if self.locked() else f'unlocked, value:{self._value}'
        if self._waiters:
            extra = f'{extra}, waiters:{len(self._waiters)}'
        return f'<{res[1:-1]} [{extra}]>'

    def _wake_up_next(self):
        while self._waiters:
            waiter = self._waiters.popleft()
            if not waiter.done():
                waiter.set_result(None)
                return

    def locked(self):
        """Returns True if semaphore can not be acquired immediately."""
        return self._value == 0

    async def acquire(self):
        """Acquire a semaphore.

        If the internal counter is larger than zero on entry,
        decrement it by one and return True immediately.  If it is
        zero on entry, block, waiting until some other coroutine has
        called release() to make it larger than 0, and then return
        True.
        """
        while self._value <= 0:
            fut = self._loop.create_future()
            self._waiters.append(fut)
            try:
                await fut
            except:
                # See the similar code in Queue.get.
                fut.cancel()
                if self._value > 0 and not fut.cancelled():
                    self._wake_up_next()
                raise
        self._value -= 1
        return True

    def release(self):
        """Release a semaphore, incrementing the internal counter by one.
        When it was zero on entry and another coroutine is waiting for it to
        become larger than zero again, wake up that coroutine.
        """
        self._value += 1
        self._wake_up_next()


class BoundedSemaphore(Semaphore):
    """A bounded semaphore implementation.

    This raises ValueError in release() if it would increase the value
    above the initial value.
    """

    def __init__(self, value=1, *, loop=None):
        if loop:
            warnings.warn("The loop argument is deprecated since Python 3.8, "
                          "and scheduled for removal in Python 3.10.",
                          DeprecationWarning, stacklevel=2)

        self._bound_value = value
        super().__init__(value, loop=loop)

    def release(self):
        if self._value >= self._bound_value:
            raise ValueError('BoundedSemaphore released too many times')
        super().release()
asyncio/trsock.py000064400000013364151153537520010106 0ustar00import socket
import warnings


class TransportSocket:

    """A socket-like wrapper for exposing real transport sockets.

    These objects can be safely returned by APIs like
    `transport.get_extra_info('socket')`.  All potentially disruptive
    operations (like "socket.close()") are banned.
    """

    __slots__ = ('_sock',)

    def __init__(self, sock: socket.socket):
        self._sock = sock

    def _na(self, what):
        warnings.warn(
            f"Using {what} on sockets returned from get_extra_info('socket') "
            f"will be prohibited in asyncio 3.9. Please report your use case "
            f"to bugs.python.org.",
            DeprecationWarning, source=self)

    @property
    def family(self):
        return self._sock.family

    @property
    def type(self):
        return self._sock.type

    @property
    def proto(self):
        return self._sock.proto

    def __repr__(self):
        s = (
            f"<asyncio.TransportSocket fd={self.fileno()}, "
            f"family={self.family!s}, type={self.type!s}, "
            f"proto={self.proto}"
        )

        if self.fileno() != -1:
            try:
                laddr = self.getsockname()
                if laddr:
                    s = f"{s}, laddr={laddr}"
            except socket.error:
                pass
            try:
                raddr = self.getpeername()
                if raddr:
                    s = f"{s}, raddr={raddr}"
            except socket.error:
                pass

        return f"{s}>"

    def __getstate__(self):
        raise TypeError("Cannot serialize asyncio.TransportSocket object")

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

    def dup(self):
        return self._sock.dup()

    def get_inheritable(self):
        return self._sock.get_inheritable()

    def shutdown(self, how):
        # asyncio doesn't currently provide a high-level transport API
        # to shutdown the connection.
        self._sock.shutdown(how)

    def getsockopt(self, *args, **kwargs):
        return self._sock.getsockopt(*args, **kwargs)

    def setsockopt(self, *args, **kwargs):
        self._sock.setsockopt(*args, **kwargs)

    def getpeername(self):
        return self._sock.getpeername()

    def getsockname(self):
        return self._sock.getsockname()

    def getsockbyname(self):
        return self._sock.getsockbyname()

    def accept(self):
        self._na('accept() method')
        return self._sock.accept()

    def connect(self, *args, **kwargs):
        self._na('connect() method')
        return self._sock.connect(*args, **kwargs)

    def connect_ex(self, *args, **kwargs):
        self._na('connect_ex() method')
        return self._sock.connect_ex(*args, **kwargs)

    def bind(self, *args, **kwargs):
        self._na('bind() method')
        return self._sock.bind(*args, **kwargs)

    def ioctl(self, *args, **kwargs):
        self._na('ioctl() method')
        return self._sock.ioctl(*args, **kwargs)

    def listen(self, *args, **kwargs):
        self._na('listen() method')
        return self._sock.listen(*args, **kwargs)

    def makefile(self):
        self._na('makefile() method')
        return self._sock.makefile()

    def sendfile(self, *args, **kwargs):
        self._na('sendfile() method')
        return self._sock.sendfile(*args, **kwargs)

    def close(self):
        self._na('close() method')
        return self._sock.close()

    def detach(self):
        self._na('detach() method')
        return self._sock.detach()

    def sendmsg_afalg(self, *args, **kwargs):
        self._na('sendmsg_afalg() method')
        return self._sock.sendmsg_afalg(*args, **kwargs)

    def sendmsg(self, *args, **kwargs):
        self._na('sendmsg() method')
        return self._sock.sendmsg(*args, **kwargs)

    def sendto(self, *args, **kwargs):
        self._na('sendto() method')
        return self._sock.sendto(*args, **kwargs)

    def send(self, *args, **kwargs):
        self._na('send() method')
        return self._sock.send(*args, **kwargs)

    def sendall(self, *args, **kwargs):
        self._na('sendall() method')
        return self._sock.sendall(*args, **kwargs)

    def set_inheritable(self, *args, **kwargs):
        self._na('set_inheritable() method')
        return self._sock.set_inheritable(*args, **kwargs)

    def share(self, process_id):
        self._na('share() method')
        return self._sock.share(process_id)

    def recv_into(self, *args, **kwargs):
        self._na('recv_into() method')
        return self._sock.recv_into(*args, **kwargs)

    def recvfrom_into(self, *args, **kwargs):
        self._na('recvfrom_into() method')
        return self._sock.recvfrom_into(*args, **kwargs)

    def recvmsg_into(self, *args, **kwargs):
        self._na('recvmsg_into() method')
        return self._sock.recvmsg_into(*args, **kwargs)

    def recvmsg(self, *args, **kwargs):
        self._na('recvmsg() method')
        return self._sock.recvmsg(*args, **kwargs)

    def recvfrom(self, *args, **kwargs):
        self._na('recvfrom() method')
        return self._sock.recvfrom(*args, **kwargs)

    def recv(self, *args, **kwargs):
        self._na('recv() method')
        return self._sock.recv(*args, **kwargs)

    def settimeout(self, value):
        if value == 0:
            return
        raise ValueError(
            'settimeout(): only 0 timeout is allowed on transport sockets')

    def gettimeout(self):
        return 0

    def setblocking(self, flag):
        if not flag:
            return
        raise ValueError(
            'setblocking(): transport sockets cannot be blocking')

    def __enter__(self):
        self._na('context manager protocol')
        return self._sock.__enter__()

    def __exit__(self, *err):
        self._na('context manager protocol')
        return self._sock.__exit__(*err)
asyncio/__pycache__/subprocess.cpython-38.pyc000064400000016300151153537520015250 0ustar00U

e5d��@s�dZddlZddlZddlmZddlmZddlmZddlmZddlm	Z	ej
Z
ejZejZGd	d
�d
ej
ej�ZGdd�d�Zddddejfd
d�Zddddejd�dd�ZdS))�create_subprocess_exec�create_subprocess_shell�N�)�events)�	protocols)�streams)�tasks)�loggercsXeZdZdZ�fdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Z�ZS)�SubprocessStreamProtocolz0Like StreamReaderProtocol, but for a subprocess.csHt�j|d�||_d|_|_|_d|_d|_g|_|j	�
�|_dS)N��loopF)�super�__init__�_limit�stdin�stdout�stderr�
_transport�_process_exited�	_pipe_fds�_loopZ
create_future�
_stdin_closed)�self�limitr��	__class__��*/usr/lib64/python3.8/asyncio/subprocess.pyrsz!SubprocessStreamProtocol.__init__cCsn|jjg}|jdk	r&|�d|j���|jdk	rB|�d|j���|jdk	r^|�d|j���d�d�|��S)Nzstdin=zstdout=zstderr=z<{}>� )r�__name__r�appendrr�format�join)r�inforrr�__repr__s



z!SubprocessStreamProtocol.__repr__cCs�||_|�d�}|dk	rDtj|j|jd�|_|j�|�|j�	d�|�d�}|dk	r�tj|j|jd�|_
|j
�|�|j�	d�|�d�}|dk	r�tj||d|jd�|_dS)Nr�rr�r)�protocol�readerr)
r�get_pipe_transportr�StreamReaderrrrZ
set_transportrr r�StreamWriterr)r�	transportZstdout_transportZstderr_transportZstdin_transportrrr�connection_made)s,
�
�
�z(SubprocessStreamProtocol.connection_madecCs:|dkr|j}n|dkr |j}nd}|dk	r6|�|�dS)Nrr&)rrZ	feed_data)r�fd�datar(rrr�pipe_data_receivedAsz+SubprocessStreamProtocol.pipe_data_receivedcCs�|dkrN|j}|dk	r|��|�|�|dkr>|j�d�n|j�|�dS|dkr^|j}n|dkrn|j}nd}|dk	r�|dkr�|��n
|�|�||j	kr�|j	�
|�|��dS)Nrrr&)r�closeZconnection_lostrZ
set_resultZ
set_exceptionrrZfeed_eofr�remove�_maybe_close_transport)rr.�exc�piper(rrr�pipe_connection_lostKs*



z-SubprocessStreamProtocol.pipe_connection_lostcCsd|_|��dS)NT)rr3�rrrr�process_exitedfsz'SubprocessStreamProtocol.process_exitedcCs(t|j�dkr$|jr$|j��d|_dS)Nr)�lenrrrr1r7rrrr3js
z/SubprocessStreamProtocol._maybe_close_transportcCs||jkr|jSdS�N)rr)r�streamrrr�_get_close_waiteros
z*SubprocessStreamProtocol._get_close_waiter)
r�
__module__�__qualname__�__doc__rr$r-r0r6r8r3r<�
__classcell__rrrrr
s	

r
c@sjeZdZdd�Zdd�Zedd��Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
ddd�ZdS)�ProcesscCs8||_||_||_|j|_|j|_|j|_|��|_dSr:)rZ	_protocolrrrrZget_pid�pid)rr,r'rrrrruszProcess.__init__cCsd|jj�d|j�d�S)N�<r�>)rrrBr7rrrr$~szProcess.__repr__cCs
|j��Sr:)rZget_returncoder7rrr�
returncode�szProcess.returncodec�s|j��IdHS)z?Wait until the process exit and return the process return code.N)rZ_waitr7rrr�wait�szProcess.waitcCs|j�|�dSr:)r�send_signal)r�signalrrrrG�szProcess.send_signalcCs|j��dSr:)r�	terminater7rrrrI�szProcess.terminatecCs|j��dSr:)r�killr7rrrrJ�szProcess.killc
�s�|j��}|j�|�|r,t�d|t|��z|j��IdHWn8tt	fk
rx}z|rht�d||�W5d}~XYnX|r�t�d|�|j�
�dS)Nz%%r communicate: feed stdin (%s bytes)z%r communicate: stdin got %rz%r communicate: close stdin)r�	get_debugr�writer	�debugr9Zdrain�BrokenPipeError�ConnectionResetErrorr1)r�inputrMr4rrr�_feed_stdin�s 
� zProcess._feed_stdinc�sdSr:rr7rrr�_noop�sz
Process._noopc�s�|j�|�}|dkr|j}n|dks(t�|j}|j��rV|dkrDdnd}t�d||�|�	�IdH}|j��r�|dkrzdnd}t�d||�|�
�|S)Nr&rrrz%r communicate: read %sz%r communicate: close %s)rr)r�AssertionErrorrrrKr	rM�readr1)rr.r,r;�name�outputrrr�_read_stream�s

zProcess._read_streamNc�s�|dk	r|�|�}n|��}|jdk	r2|�d�}n|��}|jdk	rP|�d�}n|��}tj||||jd�IdH\}}}|��IdH||fS)Nrr&r)	rQrRrrWrrZgatherrrF)rrPrrrrrr�communicate�s


�zProcess.communicate)N)rr=r>rr$�propertyrErFrGrIrJrQrRrWrXrrrrrAts	
rAc
�sb�dkrt���ntjdtdd���fdd�}�j||f|||d�|��IdH\}}	t||	��S)N�ZThe loop argument is deprecated since Python 3.8 and scheduled for removal in Python 3.10.r&��
stacklevelcst��d�S�Nr%�r
rr%rr�<lambda>�s�z)create_subprocess_shell.<locals>.<lambda>�rrr)r�get_event_loop�warnings�warn�DeprecationWarningZsubprocess_shellrA)
�cmdrrrrr�kwds�protocol_factoryr,r'rr%rr�s$
����r)rrrrrc�sf�dkrt���ntjdtdd���fdd�}�j||f|�|||d�|��IdH\}	}
t|	|
��S)NrZr&r[cst��d�Sr]r^rr%rrr_�s�z(create_subprocess_exec.<locals>.<lambda>r`)rrarbrcrdZsubprocess_execrA)Zprogramrrrrr�argsrfrgr,r'rr%rr�s(
�����r)�__all__�
subprocessrb�rrrr�logr	�PIPEZSTDOUTZDEVNULLZFlowControlMixinZSubprocessProtocolr
rAZ_DEFAULT_LIMITrrrrrr�<module>s.�bV�
�asyncio/__pycache__/locks.cpython-38.pyc000064400000037762151153537520014212 0ustar00U

e5d|C�@s�dZdZddlZddlZddlZddlmZddlmZddlmZddlm	Z	Gd	d
�d
�Z
Gdd�d�ZGd
d�de�ZGdd�d�Z
Gdd�de�ZGdd�de�ZGdd�de�ZdS)zSynchronization primitives.)�Lock�Event�	Condition�	Semaphore�BoundedSemaphore�N�)�events)�futures)�
exceptions)�
coroutinesc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_ContextManagera\Context manager.

    This enables the following idiom for acquiring and releasing a
    lock around a block:

        with (yield from lock):
            <block>

    while failing loudly when accidentally using:

        with lock:
            <block>

    Deprecated, use 'async with' statement:
        async with lock:
            <block>
    cCs
||_dS�N)�_lock)�self�lock�r�%/usr/lib64/python3.8/asyncio/locks.py�__init__"sz_ContextManager.__init__cCsdSr
r�rrrr�	__enter__%sz_ContextManager.__enter__cGsz|j��W5d|_XdSr
)r�release�r�argsrrr�__exit__*sz_ContextManager.__exit__N)�__name__�
__module__�__qualname__�__doc__rrrrrrrrsrc@sReZdZdd�Zdd�Zejdd��Zej	e_	dd�Z
d	d
�Zdd�Zd
d�Z
dS)�_ContextManagerMixincCstd��dS)Nz9"yield from" should be used as context manager expression)�RuntimeErrorrrrrr2s�z_ContextManagerMixin.__enter__cGsdSr
rrrrrr6sz_ContextManagerMixin.__exit__ccs&tjdtdd�|��EdHt|�S)NzD'with (yield from lock)' is deprecated use 'async with lock' instead���
stacklevel)�warnings�warn�DeprecationWarning�acquirerrrrr�__iter__;s�z_ContextManagerMixin.__iter__c�s|��IdHt|�Sr
)r&rrrrrZ
__acquire_ctxUsz"_ContextManagerMixin.__acquire_ctxcCstjdtdd�|����S)Nz='with await lock' is deprecated use 'async with lock' insteadr r!)r#r$r%�!_ContextManagerMixin__acquire_ctx�	__await__rrrrr)Ys
�z_ContextManagerMixin.__await__c�s|��IdHdSr
)r&rrrr�
__aenter__`sz_ContextManagerMixin.__aenter__c�s|��dSr
)r)r�exc_type�exc�tbrrr�	__aexit__fsz_ContextManagerMixin.__aexit__N)rrrrr�types�	coroutiner'rZ
_is_coroutiner(r)r*r.rrrrr1s
rcsNeZdZdZdd�dd�Z�fdd�Zdd	�Zd
d�Zdd
�Zdd�Z	�Z
S)ra�Primitive lock objects.

    A primitive lock is a synchronization primitive that is not owned
    by a particular coroutine when locked.  A primitive lock is in one
    of two states, 'locked' or 'unlocked'.

    It is created in the unlocked state.  It has two basic methods,
    acquire() and release().  When the state is unlocked, acquire()
    changes the state to locked and returns immediately.  When the
    state is locked, acquire() blocks until a call to release() in
    another coroutine changes it to unlocked, then the acquire() call
    resets it to locked and returns.  The release() method should only
    be called in the locked state; it changes the state to unlocked
    and returns immediately.  If an attempt is made to release an
    unlocked lock, a RuntimeError will be raised.

    When more than one coroutine is blocked in acquire() waiting for
    the state to turn to unlocked, only one coroutine proceeds when a
    release() call resets the state to unlocked; first coroutine which
    is blocked in acquire() is being processed.

    acquire() is a coroutine and should be called with 'await'.

    Locks also support the asynchronous context management protocol.
    'async with lock' statement should be used.

    Usage:

        lock = Lock()
        ...
        await lock.acquire()
        try:
            ...
        finally:
            lock.release()

    Context manager usage:

        lock = Lock()
        ...
        async with lock:
             ...

    Lock objects can be tested for locking state:

        if not lock.locked():
           await lock.acquire()
        else:
           # lock is acquired
           ...

    N��loopcCs:d|_d|_|dkr t��|_n||_tjdtdd�dS�NF�[The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.r r!)�_waiters�_lockedr�get_event_loop�_loopr#r$r%�rr2rrrr�s�z
Lock.__init__csLt���}|jrdnd}|jr2|�dt|j���}d|dd��d|�d�S�	N�lockedZunlocked�
, waiters:�<r���� [�]>)�super�__repr__r6r5�len�r�resZextra��	__class__rrrB�s

z
Lock.__repr__cCs|jS)z Return True if lock is acquired.)r6rrrrr;�szLock.lockedc	�s�|js.|jdks$tdd�|jD��r.d|_dS|jdkrBt��|_|j��}|j�|�z"z|IdHW5|j�|�XWn&t	j
k
r�|js�|���YnXd|_dS)z�Acquire a lock.

        This method blocks until the lock is unlocked, then sets it to
        locked and returns True.
        Ncss|]}|��VqdSr
)�	cancelled)�.0�wrrr�	<genexpr>�szLock.acquire.<locals>.<genexpr>T)r6r5�all�collections�dequer8�
create_future�append�remover
�CancelledError�_wake_up_first�r�futrrrr&�s&�


zLock.acquirecCs"|jrd|_|��ntd��dS)aGRelease a lock.

        When the lock is locked, reset it to unlocked, and return.
        If any other coroutines are blocked waiting for the lock to become
        unlocked, allow exactly one of them to proceed.

        When invoked on an unlocked lock, a RuntimeError is raised.

        There is no return value.
        FzLock is not acquired.N)r6rSrrrrrr�s
zLock.releasecCsJ|js
dSztt|j��}Wntk
r2YdSX|��sF|�d�dS)z*Wake up the first waiter if it isn't done.NT)r5�next�iter�
StopIteration�done�
set_resultrTrrrrS�szLock._wake_up_first)rrrrrrBr;r&rrS�
__classcell__rrrFrrjs5 rcsNeZdZdZdd�dd�Z�fdd�Zdd	�Zd
d�Zdd
�Zdd�Z	�Z
S)ra#Asynchronous equivalent to threading.Event.

    Class implementing event objects. An event manages a flag that can be set
    to true with the set() method and reset to false with the clear() method.
    The wait() method blocks until the flag is true. The flag is initially
    false.
    Nr1cCs>t��|_d|_|dkr$t��|_n||_tjdt	dd�dSr3)
rMrNr5�_valuerr7r8r#r$r%r9rrrrs
�zEvent.__init__csLt���}|jrdnd}|jr2|�dt|j���}d|dd��d|�d�S)	N�setZunsetr<r=rr>r?r@)rArBr\r5rCrDrFrrrBs

zEvent.__repr__cCs|jS)z5Return True if and only if the internal flag is true.�r\rrrr�is_setszEvent.is_setcCs.|js*d|_|jD]}|��s|�d�qdS)z�Set the internal flag to true. All coroutines waiting for it to
        become true are awakened. Coroutine that call wait() once the flag is
        true will not block at all.
        TN)r\r5rYrZrTrrrr]s

z	Event.setcCs
d|_dS)z�Reset the internal flag to false. Subsequently, coroutines calling
        wait() will block until set() is called to set the internal flag
        to true again.FNr^rrrr�clear"szEvent.clearc	�sF|jr
dS|j��}|j�|�z|IdHW�dS|j�|�XdS)z�Block until the internal flag is true.

        If the internal flag is true on entry, return True
        immediately.  Otherwise, block until another coroutine calls
        set() to set the flag to true, then return True.
        TN)r\r8rOr5rPrQrTrrr�wait(s

z
Event.wait)rrrrrrBr_r]r`rar[rrrFrr�srcsReZdZdZddd�dd�Z�fdd�Zdd	�Zd
d�Zdd
d�Zdd�Z	�Z
S)raAsynchronous equivalent to threading.Condition.

    This class implements condition variable objects. A condition variable
    allows one or more coroutines to wait until they are notified by another
    coroutine.

    A new Lock object is created and used as the underlying lock.
    Nr1cCs~|dkrt��|_n||_tjdtdd�|dkr>t|d�}n|j|jk	rRtd��||_|j	|_	|j
|_
|j|_t�
�|_dS)Nr4r r!r1z"loop argument must agree with lock)rr7r8r#r$r%r�
ValueErrorrr;r&rrMrNr5)rrr2rrrrEs �zCondition.__init__csNt���}|��rdnd}|jr4|�dt|j���}d|dd��d|�d�Sr:)rArBr;r5rCrDrFrrrB[s

zCondition.__repr__c�s�|��std��|��z@|j��}|j�	|�z|IdHW�W�dS|j�
|�XW5d}z|��IdHWq�Wq^tjk
r�d}Yq^Xq^|r�tj�XdS)a�Wait until notified.

        If the calling coroutine has not acquired the lock when this
        method is called, a RuntimeError is raised.

        This method releases the underlying lock, and then blocks
        until it is awakened by a notify() or notify_all() call for
        the same condition variable in another coroutine.  Once
        awakened, it re-acquires the lock and returns True.
        zcannot wait on un-acquired lockFNT)r;rrr&r
rRr8rOr5rPrQ)rrHrUrrrrabs$

zCondition.waitc�s$|�}|s |��IdH|�}q|S)z�Wait until a predicate becomes true.

        The predicate should be a callable which result will be
        interpreted as a boolean value.  The final predicate value is
        the return value.
        N)ra)rZ	predicate�resultrrr�wait_for�s
zCondition.wait_forrcCsJ|��std��d}|jD]*}||kr*qF|��s|d7}|�d�qdS)aBy default, wake up one coroutine waiting on this condition, if any.
        If the calling coroutine has not acquired the lock when this method
        is called, a RuntimeError is raised.

        This method wakes up at most n of the coroutines waiting for the
        condition variable; it is a no-op if no coroutines are waiting.

        Note: an awakened coroutine does not actually return from its
        wait() call until it can reacquire the lock. Since notify() does
        not release the lock, its caller should.
        z!cannot notify on un-acquired lockrrFN)r;rr5rYrZ)r�n�idxrUrrr�notify�s
zCondition.notifycCs|�t|j��dS)aWake up all threads waiting on this condition. This method acts
        like notify(), but wakes up all waiting threads instead of one. If the
        calling thread has not acquired the lock when this method is called,
        a RuntimeError is raised.
        N)rgrCr5rrrr�
notify_all�szCondition.notify_all)N)r)rrrrrrBrardrgrhr[rrrFrr;s	%
rcsPeZdZdZddd�dd�Z�fdd�Zd	d
�Zdd�Zd
d�Zdd�Z	�Z
S)raA Semaphore implementation.

    A semaphore manages an internal counter which is decremented by each
    acquire() call and incremented by each release() call. The counter
    can never go below zero; when acquire() finds that it is zero, it blocks,
    waiting until some other thread calls release().

    Semaphores also support the context management protocol.

    The optional argument gives the initial value for the internal
    counter; it defaults to 1. If the value given is less than 0,
    ValueError is raised.
    rNr1cCsN|dkrtd��||_t��|_|dkr4t��|_n||_tj	dt
dd�dS)Nrz$Semaphore initial value must be >= 0r4r r!)rbr\rMrNr5rr7r8r#r$r%�r�valuer2rrrr�s
�zSemaphore.__init__csVt���}|��rdn
d|j��}|jr<|�dt|j���}d|dd��d|�d�S)	Nr;zunlocked, value:r<r=rr>r?r@)rArBr;r\r5rCrDrFrrrB�s

zSemaphore.__repr__cCs,|jr(|j��}|��s|�d�dSqdSr
)r5�popleftrYrZ)rZwaiterrrr�
_wake_up_next�s


zSemaphore._wake_up_nextcCs
|jdkS)z:Returns True if semaphore can not be acquired immediately.rr^rrrrr;�szSemaphore.lockedc�st|jdkrb|j��}|j�|�z|IdHWq|��|jdkrX|��sX|���YqXq|jd8_dS)a5Acquire a semaphore.

        If the internal counter is larger than zero on entry,
        decrement it by one and return True immediately.  If it is
        zero on entry, block, waiting until some other coroutine has
        called release() to make it larger than 0, and then return
        True.
        rNrT)r\r8rOr5rPZcancelrHrlrTrrrr&�s	


zSemaphore.acquirecCs|jd7_|��dS)z�Release a semaphore, incrementing the internal counter by one.
        When it was zero on entry and another coroutine is waiting for it to
        become larger than zero again, wake up that coroutine.
        rN)r\rlrrrrr�szSemaphore.release)r)rrrrrrBrlr;r&rr[rrrFrr�s
rcs4eZdZdZd	dd��fdd�Z�fdd�Z�ZS)
rz�A bounded semaphore implementation.

    This raises ValueError in release() if it would increase the value
    above the initial value.
    rNr1cs.|rtjdtdd�||_t�j||d�dS)Nr4r r!r1)r#r$r%�_bound_valuerArrirFrrr
s�zBoundedSemaphore.__init__cs"|j|jkrtd��t���dS)Nz(BoundedSemaphore released too many times)r\rmrbrArrrFrrrszBoundedSemaphore.release)r)rrrrrrr[rrrFrrs	r)r�__all__rMr/r#�rr	r
rrrrrrrrrrrr�<module>s "9DzNasyncio/__pycache__/streams.cpython-38.opt-2.pyc000064400000034211151153537520015477 0ustar00U

e5d h�@s&dZddlZddlZddlZddlZeed�r6ed7ZddlmZddlmZddlm	Z	dd	lm
Z
dd
lmZddlm
Z
ddlmZd
Zdded�dd�Zd ded�dd�Zeed�r�d!ded�dd�Zd"ded�dd�ZGdd�dej�ZGdd�deej�ZGdd�d�ZGdd�d�ZdS)#)�StreamReader�StreamWriter�StreamReaderProtocol�open_connection�start_server�NZAF_UNIX)�open_unix_connection�start_unix_server�)�
coroutines)�events)�
exceptions)�format_helpers)�	protocols)�logger)�sleepi)�loop�limitc	�st|dkrt��}ntjdtdd�t||d�}t||d��|j�fdd�||f|�IdH\}}t|�||�}||fS)N�[The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.���
stacklevel�rr�rcs�S�N�r��protocolr�'/usr/lib64/python3.8/asyncio/streams.py�<lambda>5�z!open_connection.<locals>.<lambda>)	r�get_event_loop�warnings�warn�DeprecationWarningrrZcreate_connectionr)	�host�portrr�kwds�reader�	transport�_�writerrrrrs"
�
��rc�sJ�dkrt���ntjdtdd����fdd�}�j|||f|�IdHS)Nrrrcst��d�}t|��d�}|S�Nrr�rr�r'r��client_connected_cbrrrr�factoryXs
�zstart_server.<locals>.factory)rr r!r"r#Z
create_server)r/r$r%rrr&r0rr.rr:s
�rc�sr|dkrt��}ntjdtdd�t||d�}t||d��|j�fdd�|f|�IdH\}}t|�||�}||fS)Nrrrrrcs�Srrrrrrrprz&open_unix_connection.<locals>.<lambda>)	rr r!r"r#rrZcreate_unix_connectionr)�pathrrr&r'r(r)r*rrrrds 
�
��rc�sH�dkrt���ntjdtdd����fdd�}�j||f|�IdHS)Nrrrcst��d�}t|��d�}|Sr+r,r-r.rrr0~s
�z"start_unix_server.<locals>.factory)rr r!r"r#Zcreate_unix_server)r/r1rrr&r0rr.rrts
�rc@s>eZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�ZdS)�FlowControlMixinNcCs0|dkrt��|_n||_d|_d|_d|_dS�NF)rr �_loop�_paused�
_drain_waiter�_connection_lost)�selfrrrr�__init__�szFlowControlMixin.__init__cCs d|_|j��rt�d|�dS)NTz%r pauses writing)r5r4�	get_debugr�debug�r8rrr�
pause_writing�s
zFlowControlMixin.pause_writingcCsFd|_|j��rt�d|�|j}|dk	rBd|_|��sB|�d�dS)NFz%r resumes writing)r5r4r:rr;r6�done�
set_result�r8�waiterrrr�resume_writing�s
zFlowControlMixin.resume_writingcCsVd|_|jsdS|j}|dkr"dSd|_|��r4dS|dkrH|�d�n
|�|�dS�NT)r7r5r6r>r?�
set_exception�r8�excrArrr�connection_lost�sz FlowControlMixin.connection_lostc�s<|jrtd��|jsdS|j}|j��}||_|IdHdS)NzConnection lost)r7�ConnectionResetErrorr5r6r4�
create_futurer@rrr�
_drain_helper�s
zFlowControlMixin._drain_helpercCst�dSr)�NotImplementedError�r8�streamrrr�_get_close_waiter�sz"FlowControlMixin._get_close_waiter)N)	�__name__�
__module__�__qualname__r9r=rBrGrJrNrrrrr2�s

	r2csbeZdZdZd�fdd�	Zedd��Zdd�Z�fdd	�Zd
d�Z	dd
�Z
dd�Zdd�Z�Z
S)rNcsnt�j|d�|dk	r,t�|�|_|j|_nd|_|dk	r@||_d|_d|_d|_	||_
d|_|j�
�|_dS)NrF)�superr9�weakref�ref�_stream_reader_wr�_source_traceback�_strong_reader�_reject_connection�_stream_writer�
_transport�_client_connected_cb�	_over_sslr4rI�_closed)r8Z
stream_readerr/r��	__class__rrr9�s
zStreamReaderProtocol.__init__cCs|jdkrdS|��Sr)rUr<rrr�_stream_reader�s
z#StreamReaderProtocol._stream_readercCs�|jr6ddi}|jr|j|d<|j�|�|��dS||_|j}|dk	rT|�|�|�d�dk	|_	|j
dk	r�t||||j�|_|�
||j�}t
�|�r�|j�|�d|_dS)N�messagezpAn open stream was garbage collected prior to establishing network connection; call "stream.close()" explicitly.Zsource_tracebackZ
sslcontext)rXrVr4Zcall_exception_handler�abortrZr`�
set_transport�get_extra_infor\r[rrYr
ZiscoroutineZcreate_taskrW)r8r(�contextr'�resrrr�connection_made�s2�


��
z$StreamReaderProtocol.connection_madecsx|j}|dk	r*|dkr |��n
|�|�|j��sV|dkrJ|j�d�n|j�|�t��|�d|_d|_	d|_
dSr)r`�feed_eofrDr]r>r?rRrGrUrYrZ)r8rFr'r^rrrG
s


z$StreamReaderProtocol.connection_lostcCs|j}|dk	r|�|�dSr)r`�	feed_data)r8�datar'rrr�
data_receivedsz"StreamReaderProtocol.data_receivedcCs$|j}|dk	r|��|jr dSdS)NFT)r`rhr\)r8r'rrr�eof_received sz!StreamReaderProtocol.eof_receivedcCs|jSr)r]rLrrrrN+sz&StreamReaderProtocol._get_close_waitercCs"|j}|��r|��s|��dSr)r]r>�	cancelled�	exception)r8�closedrrr�__del__.szStreamReaderProtocol.__del__)NN)rOrPrQrVr9�propertyr`rgrGrkrlrNrp�
__classcell__rrr^rr�s	
rc@sreZdZdd�Zdd�Zedd��Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
ddd�Zdd�ZdS)rcCs4||_||_||_||_|j��|_|j�d�dSr)rZ�	_protocol�_readerr4rIZ
_complete_futr?)r8r(rr'rrrrr9@szStreamWriter.__init__cCs@|jjd|j��g}|jdk	r0|�d|j���d�d�|��S)N�
transport=zreader=�<{}>� )r_rOrZrt�append�format�join�r8�inforrr�__repr__Js
zStreamWriter.__repr__cCs|jSr�rZr<rrrr(PszStreamWriter.transportcCs|j�|�dSr)rZ�write�r8rjrrrrTszStreamWriter.writecCs|j�|�dSr)rZ�
writelinesr�rrrr�WszStreamWriter.writelinescCs
|j��Sr)rZ�	write_eofr<rrrr�ZszStreamWriter.write_eofcCs
|j��Sr)rZ�
can_write_eofr<rrrr�]szStreamWriter.can_write_eofcCs
|j��Sr)rZ�closer<rrrr�`szStreamWriter.closecCs
|j��Sr)rZ�
is_closingr<rrrr�cszStreamWriter.is_closingc�s|j�|�IdHdSr)rsrNr<rrr�wait_closedfszStreamWriter.wait_closedNcCs|j�||�Sr)rZrd)r8�name�defaultrrrrdiszStreamWriter.get_extra_infoc�sL|jdk	r |j��}|dk	r |�|j��r8td�IdH|j��IdHdS)Nr)rtrnrZr�rrsrJ)r8rFrrr�drainls



zStreamWriter.drain)N)rOrPrQr9r}rqr(rr�r�r�r�r�r�rdr�rrrrr6s



rc@s�eZdZdZedfdd�Zdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd&dd�Zd'dd�Zd d!�Zd"d#�Zd$d%�ZdS)(rNcCsv|dkrtd��||_|dkr*t��|_n||_t�|_d|_d|_d|_	d|_
d|_|j��rrt
�t�d��|_dS)NrzLimit cannot be <= 0Fr	)�
ValueError�_limitrr r4�	bytearray�_buffer�_eof�_waiter�
_exceptionrZr5r:r
�
extract_stack�sys�	_getframerV)r8rrrrrr9�s 
�zStreamReader.__init__cCs�dg}|jr"|�t|j��d��|jr2|�d�|jtkrN|�d|j���|jrf|�d|j���|jr~|�d|j���|jr�|�d|j���|j	r�|�d�d	�
d
�|��S)Nrz bytes�eofzlimit=zwaiter=z
exception=ruZpausedrvrw)r�rx�lenr�r��_DEFAULT_LIMITr�r�rZr5ryrzr{rrrr}�s 


zStreamReader.__repr__cCs|jSr)r�r<rrrrn�szStreamReader.exceptioncCs0||_|j}|dk	r,d|_|��s,|�|�dSr)r�r�rmrDrErrrrD�szStreamReader.set_exceptioncCs*|j}|dk	r&d|_|��s&|�d�dSr)r�rmr?r@rrr�_wakeup_waiter�s
zStreamReader._wakeup_waitercCs
||_dSrr~)r8r(rrrrc�szStreamReader.set_transportcCs*|jr&t|j�|jkr&d|_|j��dSr3)r5r�r�r�rZ�resume_readingr<rrr�_maybe_resume_transport�sz$StreamReader._maybe_resume_transportcCsd|_|��dSrC)r�r�r<rrrrh�szStreamReader.feed_eofcCs|jo|jSr)r�r�r<rrr�at_eof�szStreamReader.at_eofcCst|sdS|j�|�|��|jdk	rp|jspt|j�d|jkrpz|j��Wntk
rhd|_YnXd|_dS)NrT)	r��extendr�rZr5r�r�Z
pause_readingrKr�rrrri�s
��zStreamReader.feed_datac�sX|jdk	rt|�d���|jr.d|_|j��|j��|_z|jIdHW5d|_XdS)NzF() called while another coroutine is already waiting for incoming dataF)r��RuntimeErrorr5rZr�r4rI)r8Z	func_namerrr�_wait_for_data�s	
�
zStreamReader._wait_for_datac
�s�d}t|�}z|�|�IdH}Wn�tjk
rN}z|jWY�Sd}~XYnhtjk
r�}zH|j�||j�r�|jd|j|�=n
|j�	�|�
�t|jd��W5d}~XYnX|S)N�
r)
r��	readuntilr�IncompleteReadError�partial�LimitOverrunErrorr��
startswith�consumed�clearr�r��args)r8�sep�seplen�line�errr�readline	s
 zStreamReader.readliner�c�s�t|�}|dkrtd��|jdk	r(|j�d}t|j�}|||kr||j�||�}|dkrZq�|d|}||jkr|t�d|��|jr�t	|j�}|j�
�t�|d��|�d�IdHq,||jkr�t�d|��|jd||�}|jd||�=|�
�t	|�S)Nrz,Separator should be at least one-byte string���r	z2Separator is not found, and chunk exceed the limitr�z2Separator is found, but chunk is longer than limit)r�r�r�r��findr�rr�r��bytesr�r�r�r�)r8Z	separatorr��offsetZbuflenZisep�chunkrrrr�(s>


�


�zStreamReader.readuntilr�c�s�|jdk	r|j�|dkrdS|dkrVg}|�|j�IdH}|s@qL|�|�q(d�|�S|jsr|jsr|�d�IdHt|jd|��}|jd|�=|�	�|S)Nrr�read)
r�r�r�rxrzr�r�r�r�r�)r8�nZblocks�blockrjrrrr��s"

zStreamReader.readc�s�|dkrtd��|jdk	r |j�|dkr,dSt|j�|krr|jr`t|j�}|j��t�||��|�	d�IdHq,t|j�|kr�t|j�}|j��nt|jd|��}|jd|�=|�
�|S)Nrz*readexactly size can not be less than zeror�readexactly)r�r�r�r�r�r�r�rr�r�r�)r8r�Z
incompleterjrrrr��s&



zStreamReader.readexactlycCs|Srrr<rrr�	__aiter__�szStreamReader.__aiter__c�s|��IdH}|dkrt�|S)Nr)r��StopAsyncIteration)r8�valrrr�	__anext__�szStreamReader.__anext__)r�)r�)rOrPrQrVr�r9r}rnrDr�rcr�rhr�rir�r�r�r�r�r�r�rrrrr�s$	
[
2)r)NN)NN)N)N)�__all__Zsocketr�r!rS�hasattr�r
rrr
r�logrZtasksrr�rrrrZProtocolr2rrrrrrr�<module>sF
�!�'
��DkPasyncio/__pycache__/base_tasks.cpython-38.opt-1.pyc000064400000003632151153537520016142 0ustar00U

e5d�	�@sDddlZddlZddlmZddlmZdd�Zdd�Zd	d
�ZdS)�N�)�base_futures)�
coroutinescCsnt�|�}|jrd|d<|�dd|���t�|j�}|�dd|�d��|jdk	rj|�dd	|j���|S)
NZ
cancellingrrzname=%r�zcoro=<�>�z	wait_for=)	rZ_future_repr_infoZ_must_cancel�insertZget_namerZ_format_coroutine�_coroZ_fut_waiter)�task�info�coro�r
�*/usr/lib64/python3.8/asyncio/base_tasks.py�_task_repr_infos

rcCs�g}t|jd�r|jj}n0t|jd�r0|jj}nt|jd�rF|jj}nd}|dk	r�|dk	r�|dk	rt|dkrlq�|d8}|�|�|j}qR|��nH|jdk	r�|jj	}|dk	r�|dk	r�|dkr�q�|d8}|�|j
�|j}q�|S)N�cr_frame�gi_frame�ag_framerr)�hasattrr	rrr�append�f_back�reverse�
_exception�
__traceback__�tb_frame�tb_next)r
�limitZframes�f�tbr
r
r�_task_get_stacks6





rcCs�g}t�}|j|d�D]Z}|j}|j}|j}|j}	||krN|�|�t�|�t�	|||j
�}
|�|||	|
f�q|j}|s�t
d|��|d�n2|dk	r�t
d|�d�|d�nt
d|�d�|d�tj||d�|dk	r�t�|j|�D]}
t
|
|dd�q�dS)	N)rz
No stack for )�filezTraceback for z (most recent call last):z
Stack for �)r�end)�setZ	get_stack�f_lineno�f_code�co_filename�co_name�add�	linecache�
checkcache�getline�	f_globalsrr�print�	traceback�
print_list�format_exception_only�	__class__)r
rr�extracted_list�checkedr�lineno�co�filename�name�line�excr
r
r�_task_print_stack<s,

r9)r(r-r rrrrr9r
r
r
r�<module>s#asyncio/__pycache__/sslproto.cpython-38.opt-2.pyc000064400000034431151153537520015712 0ustar00U

e5dJj�@s�ddlZddlZzddlZWnek
r4dZYnXddlmZddlmZddlmZddlmZddl	m
Z
dd	�Zd
ZdZ
dZd
ZGdd�de�ZGdd�dejej�ZGdd�dej�ZdS)�N�)�base_events)�	constants)�	protocols)�
transports)�loggercCs"|rtd��t��}|sd|_|S)Nz(Server side SSL needs a valid SSLContextF)�
ValueError�sslZcreate_default_contextZcheck_hostname)�server_side�server_hostname�
sslcontext�r
�(/usr/lib64/python3.8/asyncio/sslproto.py�_create_transport_contextsrZ	UNWRAPPEDZDO_HANDSHAKEZWRAPPEDZSHUTDOWNc@szeZdZdZddd�Zedd��Zedd��Zed	d
��Zedd��Z	dd
d�Z
ddd�Zdd�Zddd�Z
ddd�ZdS)�_SSLPipeiNcCsH||_||_||_t|_t��|_t��|_d|_	d|_
d|_d|_dS�NF)
�_context�_server_side�_server_hostname�
_UNWRAPPED�_stater	Z	MemoryBIO�	_incoming�	_outgoing�_sslobj�
_need_ssldata�
_handshake_cb�_shutdown_cb)�self�contextr
rr
r
r�__init__8s

z_SSLPipe.__init__cCs|jS�N)r�rr
r
rrNsz_SSLPipe.contextcCs|jSr )rr!r
r
r�
ssl_objectSsz_SSLPipe.ssl_objectcCs|jSr )rr!r
r
r�need_ssldata[sz_SSLPipe.need_ssldatacCs
|jtkSr )r�_WRAPPEDr!r
r
r�wrappedasz_SSLPipe.wrappedcCsR|jtkrtd��|jj|j|j|j|jd�|_	t
|_||_|jddd�\}}|S)Nz"handshake in progress or completed)r
r�T)�only_handshake)
rr�RuntimeErrorrZwrap_biorrrrr�
_DO_HANDSHAKEr�feed_ssldata�r�callback�ssldata�appdatar
r
r�do_handshakejs	
�z_SSLPipe.do_handshakecCsB|jtkrtd��|jtkr$td��t|_||_|�d�\}}|S)Nzno security layer presentzshutdown in progressr&)rrr(�	_SHUTDOWNrr*r+r
r
r�shutdowns	

z_SSLPipe.shutdowncCs|j��|�d�\}}dS)Nr&)rZ	write_eofr*)rr-r.r
r
r�feed_eof�s
z_SSLPipe.feed_eofFc
Cs�|jtkr"|r|g}ng}g|fSd|_|r8|j�|�g}g}z�|jtkrz|j��t|_|j	rl|�	d�|rz||fWS|jtkr�|j�
|j�}|�|�|s�q�q�nJ|jt
kr�|j��d|_t|_|jr�|��n|jtkr�|�|j�
��Wnztjtjfk
�rl}zRt|dd�}|tjtjtjfk�rP|jtk�rN|j	�rN|�	|��|tjk|_W5d}~XYnX|jj�r�|�|j�
��||fS)NF�errno)rrrr�writer)rr/r$r�read�max_size�appendr0Zunwraprr	�SSLError�CertificateError�getattr�SSL_ERROR_WANT_READ�SSL_ERROR_WANT_WRITE�SSL_ERROR_SYSCALLr�pending)r�datar'r.r-�chunk�exc�	exc_errnor
r
rr*�sZ










�

z_SSLPipe.feed_ssldatarc
Cs|jtkr6|t|�kr&||d�g}ng}|t|�fSg}t|�}d|_z(|t|�krn||j�||d��7}Wnhtjk
r�}zHt	|dd�}|j
dkr�tj}|_|tjtj
tjfkr��|tjk|_W5d}~XYnX|jjr�|�|j���|t|�k�s|jrB�qqB||fS)NFr3ZPROTOCOL_IS_SHUTDOWN)rr�len�
memoryviewrrr4r	r8r:�reasonr;r3r<r=rr>r7r5)rr?�offsetr-ZviewrArBr
r
r�feed_appdata�s4

�z_SSLPipe.feed_appdata)N)N)N)F)r)�__name__�
__module__�__qualname__r6r�propertyrr"r#r%r/r1r2r*rGr
r
r
rr$s








Krc@s�eZdZejjZdd�Zd"dd�Zdd�Z	dd	�Z
d
d�Zdd
�Ze
jfdd�Zdd�Zdd�Zdd�Zd#dd�Zdd�Zedd��Zdd�Zdd�Zd d!�ZdS)$�_SSLProtocolTransportcCs||_||_d|_dSr)�_loop�
_ssl_protocol�_closed)r�loopZssl_protocolr
r
rr!sz_SSLProtocolTransport.__init__NcCs|j�||�Sr )rN�_get_extra_info�r�name�defaultr
r
r�get_extra_info'sz$_SSLProtocolTransport.get_extra_infocCs|j�|�dSr )rN�_set_app_protocol)r�protocolr
r
r�set_protocol+sz"_SSLProtocolTransport.set_protocolcCs|jjSr )rN�
_app_protocolr!r
r
r�get_protocol.sz"_SSLProtocolTransport.get_protocolcCs|jSr )rOr!r
r
r�
is_closing1sz _SSLProtocolTransport.is_closingcCsd|_|j��dS�NT)rOrN�_start_shutdownr!r
r
r�close4sz_SSLProtocolTransport.closecCs&|js"|d|��t|d�|��dS)Nzunclosed transport )�source)rO�ResourceWarningr^)rZ_warnr
r
r�__del__?sz_SSLProtocolTransport.__del__cCs |jj}|dkrtd��|��S)Nz*SSL transport has not been initialized yet)rN�
_transportr(�
is_reading)rZtrr
r
rrcDsz _SSLProtocolTransport.is_readingcCs|jj��dSr )rNrb�
pause_readingr!r
r
rrdJsz#_SSLProtocolTransport.pause_readingcCs|jj��dSr )rNrb�resume_readingr!r
r
rreRsz$_SSLProtocolTransport.resume_readingcCs|jj�||�dSr )rNrb�set_write_buffer_limits)rZhighZlowr
r
rrfZsz-_SSLProtocolTransport.set_write_buffer_limitscCs|jj��Sr )rNrb�get_write_buffer_sizer!r
r
rrgosz+_SSLProtocolTransport.get_write_buffer_sizecCs
|jjjSr )rNrb�_protocol_pausedr!r
r
rrhssz&_SSLProtocolTransport._protocol_pausedcCs<t|tttf�s$tdt|�j����|s,dS|j�|�dS)Nz+data: expecting a bytes-like instance, got )	�
isinstance�bytes�	bytearrayrD�	TypeError�typerHrN�_write_appdata�rr?r
r
rr4xs
z_SSLProtocolTransport.writecCsdSrr
r!r
r
r�
can_write_eof�sz#_SSLProtocolTransport.can_write_eofcCs|j��d|_dSr\)rN�_abortrOr!r
r
r�abort�s
z_SSLProtocolTransport.abort)N)NN)rHrIrJrZ
_SendfileModeZFALLBACKZ_sendfile_compatiblerrUrXrZr[r^�warnings�warnrarcrdrerfrgrKrhr4rprrr
r
r
rrLs$



rLc@s�eZdZd+dd�Zdd�Zd,dd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�Zd-dd�Zdd�Z
dd�Zdd�Zdd�Zd d!�Zd"d#�Zd.d%d&�Zd'd(�Zd)d*�ZdS)/�SSLProtocolFNTc		Cs�tdkrtd��|dkr tj}n|dkr6td|����|sDt||�}||_|rZ|sZ||_nd|_||_t	|d�|_
t��|_
d|_||_||_|�|�t|j|�|_d|_d|_d|_d|_d|_||_||_dS)Nzstdlib ssl module not availablerz7ssl_handshake_timeout should be a positive number, got )rF)r	r(rZSSL_HANDSHAKE_TIMEOUTrrrr�_sslcontext�dict�_extra�collections�deque�_write_backlog�_write_buffer_size�_waiterrMrVrL�_app_transport�_sslpipe�_session_established�
_in_handshake�_in_shutdownrb�_call_connection_made�_ssl_handshake_timeout)	rrP�app_protocolrZwaiterr
rZcall_connection_madeZssl_handshake_timeoutr
r
rr�s@��

zSSLProtocol.__init__cCs||_t|tj�|_dSr )rYrirZBufferedProtocol�_app_protocol_is_buffer)rr�r
r
rrV�s
�zSSLProtocol._set_app_protocolcCsD|jdkrdS|j��s:|dk	r.|j�|�n|j�d�d|_dSr )r}Z	cancelledZ
set_exceptionZ
set_result�rrAr
r
r�_wakeup_waiter�s

zSSLProtocol._wakeup_waitercCs&||_t|j|j|j�|_|��dSr )rbrrvrrr�_start_handshake)r�	transportr
r
r�connection_made�s�zSSLProtocol.connection_madecCsn|jr d|_|j�|jj|�n|jdk	r2d|j_d|_d|_t|dd�rT|j	�
�|�|�d|_d|_dS)NFT�_handshake_timeout_handle)
r�rM�	call_soonrY�connection_lostr~rOrbr:r��cancelr�rr�r
r
rr��s


zSSLProtocol.connection_lostcCs|j��dSr )rY�
pause_writingr!r
r
rr��szSSLProtocol.pause_writingcCs|j��dSr )rY�resume_writingr!r
r
rr�szSSLProtocol.resume_writingcCs"|jdkrdSz|j�|�\}}WnLttfk
r<�Yn4tk
rn}z|�|d�WY�dSd}~XYnX|D]}|j�|�qt|D]�}|�rz&|jr�t	�
|j|�n|j�|�WnPttfk
r��Yn8tk
�r
}z|�|d�WY�dSd}~XYnXq�|�
��qq�dS)NzSSL error in data receivedz/application protocol failed to receive SSL data)rr*�
SystemExit�KeyboardInterrupt�
BaseException�_fatal_errorrbr4r�rZ_feed_data_to_buffered_protorY�
data_receivedr])rr?r-r.�er@Zexr
r
rr�s<
��zSSLProtocol.data_receivedcCsTzB|j��rt�d|�|�t�|js@|j	�
�}|r@t�d�W5|j��XdS)Nz%r received EOFz?returning true from eof_received() has no effect when using ssl)rbr^rM�	get_debugr�debugr��ConnectionResetErrorr�rY�eof_receivedZwarning)rZ	keep_openr
r
rr�-s


zSSLProtocol.eof_receivedcCs4||jkr|j|S|jdk	r,|j�||�S|SdSr )rxrbrUrRr
r
rrQCs



zSSLProtocol._get_extra_infocCs.|jr
dS|jr|��nd|_|�d�dS)NTr&)r�r�rqrnr!r
r
rr]Ks
zSSLProtocol._start_shutdowncCs.|j�|df�|jt|�7_|��dS)Nr)r{r7r|rC�_process_write_backlogror
r
rrnTszSSLProtocol._write_appdatacCs\|j��r$t�d|�|j��|_nd|_d|_|j�d�|j�	|j
|j�|_|�
�dS)Nz%r starts SSL handshakeT)r&r)rMr�rr��time�_handshake_start_timer�r{r7Z
call_laterr��_check_handshake_timeoutr�r�r!r
r
rr�Ys

��zSSLProtocol._start_handshakecCs*|jdkr&d|j�d�}|�t|��dS)NTz$SSL handshake is taking longer than z! seconds: aborting the connection)r�r�r��ConnectionAbortedError)r�msgr
r
rr�hs
�z$SSLProtocol._check_handshake_timeoutc
Csd|_|j��|jj}z|dk	r&|�|��}Wnbttfk
rJ�YnJtk
r�}z,t	|t
j�rld}nd}|�||�WY�dSd}~XYnX|j
��r�|j
��|j}t�d||d�|jj||��|��|d�|jr�|j�|j�|��d|_|j
�|j�dS)NFz1SSL handshake failed on verifying the certificatezSSL handshake failedz%r: SSL handshake took %.1f msg@�@)�peercert�cipher�compressionr"T)r�r�r�rr"Zgetpeercertr�r�r�rir	r9r�rMr�r�r�rr�rx�updater�r�r�rYr�r~r�r�r�r�)rZ
handshake_excZsslobjr�rAr�Zdtr
r
r�_on_handshake_completeqs8

�z"SSLProtocol._on_handshake_completec
CsB|jdks|jdkrdSz�tt|j��D]�}|jd\}}|rR|j�||�\}}n*|rj|j�|j�}d}n|j�|j	�}d}|D]}|j�
|�q�|t|�kr�||f|jd<|jjr�|j��q�|jd=|j
t|�8_
q(Wn\ttfk
r��YnDtk
�r<}z$|j�r |�|�n|�|d�W5d}~XYnXdS)NrrzFatal error on SSL transport)rbr�rangerCr{rGr/r�r1�	_finalizer4Z_pausedrer|r�r�r�r�r�)r�ir?rFr-r@rAr
r
rr��s:�
z"SSLProtocol._process_write_backlog�Fatal error on transportcCsVt|t�r(|j��r@tjd||dd�n|j�|||j|d��|jrR|j�|�dS)Nz%r: %sT)�exc_info)�messageZ	exceptionr�rW)	ri�OSErrorrMr�rr�Zcall_exception_handlerrbZ_force_close)rrAr�r
r
rr��s

�zSSLProtocol._fatal_errorcCsd|_|jdk	r|j��dSr )rrbr^r!r
r
rr��s
zSSLProtocol._finalizecCs(z|jdk	r|j��W5|��XdSr )r�rbrrr!r
r
rrq�s
zSSLProtocol._abort)FNTN)N)N)r�)rHrIrJrrVr�r�r�r�r�r�r�rQr]rnr�r�r�r�r�r�rqr
r
r
rru�s.�
.

&
		)+
ru)ryrsr	�ImportError�rrrr�logrrrr)r$r0�objectrZ_FlowControlMixinZ	TransportrLZProtocolrur
r
r
r�<module>s*
y�xasyncio/__pycache__/trsock.cpython-38.opt-1.pyc000064400000020445151153537520015331 0ustar00U

e5d��@s"ddlZddlZGdd�d�ZdS)�Nc@s�eZdZdZdZejd�dd�Zdd�Zedd	��Z	ed
d��Z
edd
��Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Z d8d9�Z!d:d;�Z"d<d=�Z#d>d?�Z$d@dA�Z%dBdC�Z&dDdE�Z'dFdG�Z(dHdI�Z)dJdK�Z*dLdM�Z+dNdO�Z,dPdQ�Z-dRdS�Z.dTdU�Z/dVdW�Z0dXdY�Z1dZd[�Z2d\S)]�TransportSocketz�A socket-like wrapper for exposing real transport sockets.

    These objects can be safely returned by APIs like
    `transport.get_extra_info('socket')`.  All potentially disruptive
    operations (like "socket.close()") are banned.
    ��_sock)�sockcCs
||_dS�Nr)�selfr�r�&/usr/lib64/python3.8/asyncio/trsock.py�__init__szTransportSocket.__init__cCstjd|�d�t|d�dS)NzUsing z� on sockets returned from get_extra_info('socket') will be prohibited in asyncio 3.9. Please report your use case to bugs.python.org.)�source)�warnings�warn�DeprecationWarning)rZwhatrrr	�_nas

�zTransportSocket._nacCs|jjSr)r�family�rrrr	rszTransportSocket.familycCs|jjSr)r�typerrrr	rszTransportSocket.typecCs|jjSr)r�protorrrr	r"szTransportSocket.protocCs�d|���d|j�d|j�d|j��}|��dkr�z|��}|rN|�d|��}Wntjk
rfYnXz|��}|r�|�d|��}Wntjk
r�YnX|�d�S)	Nz<asyncio.TransportSocket fd=z	, family=z, type=z, proto=���z, laddr=z, raddr=�>)�filenorrr�getsockname�socket�error�getpeername)r�sZladdrZraddrrrr	�__repr__&s $�zTransportSocket.__repr__cCstd��dS)Nz/Cannot serialize asyncio.TransportSocket object)�	TypeErrorrrrr	�__getstate__=szTransportSocket.__getstate__cCs
|j��Sr)rrrrrr	r@szTransportSocket.filenocCs
|j��Sr)r�duprrrr	rCszTransportSocket.dupcCs
|j��Sr)r�get_inheritablerrrr	r FszTransportSocket.get_inheritablecCs|j�|�dSr)r�shutdown)rZhowrrr	r!IszTransportSocket.shutdowncOs|jj||�Sr)r�
getsockopt�r�args�kwargsrrr	r"NszTransportSocket.getsockoptcOs|jj||�dSr)r�
setsockoptr#rrr	r&QszTransportSocket.setsockoptcCs
|j��Sr)rrrrrr	rTszTransportSocket.getpeernamecCs
|j��Sr)rrrrrr	rWszTransportSocket.getsocknamecCs
|j��Sr)r�
getsockbynamerrrr	r'ZszTransportSocket.getsockbynamecCs|�d�|j��S)Nzaccept() method)rr�acceptrrrr	r(]s
zTransportSocket.acceptcOs|�d�|jj||�S)Nzconnect() method)rr�connectr#rrr	r)as
zTransportSocket.connectcOs|�d�|jj||�S)Nzconnect_ex() method)rr�
connect_exr#rrr	r*es
zTransportSocket.connect_excOs|�d�|jj||�S)Nz
bind() method)rr�bindr#rrr	r+is
zTransportSocket.bindcOs|�d�|jj||�S)Nzioctl() method)rr�ioctlr#rrr	r,ms
zTransportSocket.ioctlcOs|�d�|jj||�S)Nzlisten() method)rr�listenr#rrr	r-qs
zTransportSocket.listencCs|�d�|j��S)Nzmakefile() method)rr�makefilerrrr	r.us
zTransportSocket.makefilecOs|�d�|jj||�S)Nzsendfile() method)rr�sendfiler#rrr	r/ys
zTransportSocket.sendfilecCs|�d�|j��S)Nzclose() method)rr�closerrrr	r0}s
zTransportSocket.closecCs|�d�|j��S)Nzdetach() method)rr�detachrrrr	r1�s
zTransportSocket.detachcOs|�d�|jj||�S)Nzsendmsg_afalg() method)rr�
sendmsg_afalgr#rrr	r2�s
zTransportSocket.sendmsg_afalgcOs|�d�|jj||�S)Nzsendmsg() method)rr�sendmsgr#rrr	r3�s
zTransportSocket.sendmsgcOs|�d�|jj||�S)Nzsendto() method)rr�sendtor#rrr	r4�s
zTransportSocket.sendtocOs|�d�|jj||�S)Nz
send() method)rr�sendr#rrr	r5�s
zTransportSocket.sendcOs|�d�|jj||�S)Nzsendall() method)rr�sendallr#rrr	r6�s
zTransportSocket.sendallcOs|�d�|jj||�S)Nzset_inheritable() method)rr�set_inheritabler#rrr	r7�s
zTransportSocket.set_inheritablecCs|�d�|j�|�S)Nzshare() method)rr�share)rZ
process_idrrr	r8�s
zTransportSocket.sharecOs|�d�|jj||�S)Nzrecv_into() method)rr�	recv_intor#rrr	r9�s
zTransportSocket.recv_intocOs|�d�|jj||�S)Nzrecvfrom_into() method)rr�
recvfrom_intor#rrr	r:�s
zTransportSocket.recvfrom_intocOs|�d�|jj||�S)Nzrecvmsg_into() method)rr�recvmsg_intor#rrr	r;�s
zTransportSocket.recvmsg_intocOs|�d�|jj||�S)Nzrecvmsg() method)rr�recvmsgr#rrr	r<�s
zTransportSocket.recvmsgcOs|�d�|jj||�S)Nzrecvfrom() method)rr�recvfromr#rrr	r=�s
zTransportSocket.recvfromcOs|�d�|jj||�S)Nz
recv() method)rr�recvr#rrr	r>�s
zTransportSocket.recvcCs|dkrdStd��dS)Nrz<settimeout(): only 0 timeout is allowed on transport sockets��
ValueError)r�valuerrr	�
settimeout�s
�zTransportSocket.settimeoutcCsdS)Nrrrrrr	�
gettimeout�szTransportSocket.gettimeoutcCs|sdStd��dS)Nz3setblocking(): transport sockets cannot be blockingr?)r�flagrrr	�setblocking�s
�zTransportSocket.setblockingcCs|�d�|j��S�Nzcontext manager protocol)rr�	__enter__rrrr	rG�s
zTransportSocket.__enter__cGs|�d�|jj|�SrF)rr�__exit__)r�errrrr	rH�s
zTransportSocket.__exit__N)3�__name__�
__module__�__qualname__�__doc__�	__slots__rr
r�propertyrrrrrrrr r!r"r&rrr'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>rBrCrErGrHrrrr	rsb


r)rrrrrrr	�<module>sasyncio/__pycache__/unix_events.cpython-38.opt-1.pyc000064400000114055151153537520016374 0ustar00U

e5dۿ�@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
mZddl
mZddl
mZddl
mZddl
mZdd	l
mZdd
l
mZddl
mZddl
mZdd
l
mZddlmZdZe
jdkr�ed��dd�ZGdd�dej�ZGdd�dej �Z!Gdd�dej"ej#�Z$Gdd�dej%�Z&Gdd�d�Z'dd�Z(Gd d!�d!e'�Z)Gd"d#�d#e)�Z*Gd$d%�d%e)�Z+Gd&d'�d'e'�Z,Gd(d)�d)e'�Z-Gd*d+�d+ej.�Z/eZ0e/Z1dS),z2Selector event loop for Unix with signal handling.�N�)�base_events)�base_subprocess)�	constants)�
coroutines)�events)�
exceptions)�futures)�selector_events)�tasks)�
transports)�logger)�SelectorEventLoop�AbstractChildWatcher�SafeChildWatcher�FastChildWatcher�MultiLoopChildWatcher�ThreadedChildWatcher�DefaultEventLoopPolicyZwin32z+Signals are not really supported on WindowscCsdS)zDummy signal handler.N�)�signum�framerr�+/usr/lib64/python3.8/asyncio/unix_events.py�_sighandler_noop*srcs�eZdZdZd)�fdd�	Z�fdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
d*dd�Zd+dd�Zd,dd�Z
dd�Zd-ddddd�dd�Zd.dddddd�dd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Z�ZS)/�_UnixSelectorEventLoopzdUnix event loop.

    Adds signal handling and UNIX Domain Socket support to SelectorEventLoop.
    Ncst��|�i|_dS�N)�super�__init__�_signal_handlers)�self�selector��	__class__rrr5sz_UnixSelectorEventLoop.__init__csZt���t��s.t|j�D]}|�|�qn(|jrVtjd|�d�t	|d�|j�
�dS)NzClosing the loop z@ on interpreter shutdown stage, skipping signal handlers removal��source)r�close�sys�
is_finalizing�listr�remove_signal_handler�warnings�warn�ResourceWarning�clear�r�sigr!rrr%9s
�z_UnixSelectorEventLoop.closecCs|D]}|sq|�|�qdSr)�_handle_signal)r�datarrrr�_process_self_dataGsz)_UnixSelectorEventLoop._process_self_datac
GsLt�|�st�|�rtd��|�|�|��zt�|j�	��Wn2t
tfk
rt}ztt
|���W5d}~XYnXt�|||d�}||j|<zt�|t�t�|d�Wn�tk
�rF}zz|j|=|j�szt�d�Wn4t
tfk
�r}zt�d|�W5d}~XYnX|jtjk�r4td|�d���n�W5d}~XYnXdS)z�Add a handler for a signal.  UNIX only.

        Raise ValueError if the signal number is invalid or uncatchable.
        Raise RuntimeError if there is a problem setting up the handler.
        z3coroutines cannot be used with add_signal_handler()NF����set_wakeup_fd(-1) failed: %s�sig � cannot be caught)rZiscoroutineZiscoroutinefunction�	TypeError�
_check_signalZ
_check_closed�signal�
set_wakeup_fdZ_csock�fileno�
ValueError�OSError�RuntimeError�strrZHandlerr�siginterruptr
�info�errno�EINVAL)rr/�callback�args�exc�handleZnexcrrr�add_signal_handlerNs2
�

z)_UnixSelectorEventLoop.add_signal_handlercCs8|j�|�}|dkrdS|jr*|�|�n
|�|�dS)z2Internal helper that is the actual signal handler.N)r�getZ
_cancelledr)Z_add_callback_signalsafe)rr/rGrrrr0{sz%_UnixSelectorEventLoop._handle_signalc
Cs�|�|�z|j|=Wntk
r,YdSX|tjkr@tj}ntj}zt�||�WnBtk
r�}z$|jtj	kr�t
d|�d���n�W5d}~XYnX|js�zt�d�Wn2ttfk
r�}zt
�d|�W5d}~XYnXdS)zwRemove a handler for a signal.  UNIX only.

        Return True if a signal handler was removed, False if not.
        Fr5r6Nr3r4T)r8r�KeyErrorr9�SIGINT�default_int_handler�SIG_DFLr=rBrCr>r:r<r
rA)rr/�handlerrFrrrr)�s(

z,_UnixSelectorEventLoop.remove_signal_handlercCs6t|t�std|����|t��kr2td|����dS)z�Internal helper to validate a signal.

        Raise ValueError if the signal number is invalid or uncatchable.
        Raise RuntimeError if there is a problem setting up the handler.
        zsig must be an int, not zinvalid signal number N)�
isinstance�intr7r9�
valid_signalsr<r.rrrr8�s
z$_UnixSelectorEventLoop._check_signalcCst|||||�Sr)�_UnixReadPipeTransport�r�pipe�protocol�waiter�extrarrr�_make_read_pipe_transport�sz0_UnixSelectorEventLoop._make_read_pipe_transportcCst|||||�Sr)�_UnixWritePipeTransportrSrrr�_make_write_pipe_transport�sz1_UnixSelectorEventLoop._make_write_pipe_transportc	

�s�t����}
|
��std��|��}t||||||||f||d�|	��}|
�|��|j|�z|IdHWnDt	t
fk
r��Yn,tk
r�|��|�
�IdH�YnXW5QRX|S)NzRasyncio.get_child_watcher() is not activated, subprocess support is not installed.)rVrW)r�get_child_watcher�	is_activer>�
create_future�_UnixSubprocessTransport�add_child_handlerZget_pid�_child_watcher_callback�
SystemExit�KeyboardInterrupt�
BaseExceptionr%Z_wait)
rrUrE�shell�stdin�stdout�stderr�bufsizerW�kwargs�watcherrV�transprrr�_make_subprocess_transport�s8

���
�z1_UnixSelectorEventLoop._make_subprocess_transportcCs|�|j|�dSr)�call_soon_threadsafeZ_process_exited)r�pid�
returncoderkrrrr`�sz._UnixSelectorEventLoop._child_watcher_callback)�ssl�sock�server_hostname�ssl_handshake_timeoutc	�s
|r|dkr6td��n |dk	r&td��|dk	r6td��|dk	r�|dk	rNtd��t�|�}t�tjtjd�}z |�d�|�||�IdHWq�|���Yq�Xn@|dkr�td��|j	tjks�|j
tjkr�td|����|�d�|j|||||d	�IdH\}}||fS)
Nz/you have to pass server_hostname when using sslz+server_hostname is only meaningful with ssl�1ssl_handshake_timeout is only meaningful with ssl�3path and sock can not be specified at the same timerFzno path and sock were specified�.A UNIX Domain Stream Socket was expected, got )rs)r<�os�fspath�socket�AF_UNIX�SOCK_STREAM�setblockingZsock_connectr%�family�typeZ_create_connection_transport)	r�protocol_factory�pathrprqrrrs�	transportrUrrr�create_unix_connection�sR���



��
�z-_UnixSelectorEventLoop.create_unix_connection�dT)rq�backlogrprs�
start_servingc
�s�t|t�rtd��|dk	r&|s&td��|dk	�rH|dk	r@td��t�|�}t�tjtj�}|ddkr�z t	�
t�	|�j�r�t�|�WnBt
k
r�Yn0tk
r�}zt�d||�W5d}~XYnXz|�|�Wnltk
�r0}	z8|��|	jtjk�rd|�d�}
ttj|
�d�n�W5d}	~	XYn|���YnXn<|dk�rZtd	��|jtjk�sv|jtjk�r�td
|����|�d�t�||g||||�}|�r�|��tjd|d�IdH|S)
Nz*ssl argument must be an SSLContext or Nonertrur)r�z2Unable to check or remove stale UNIX socket %r: %rzAddress z is already in usez-path was not specified, and no sock specifiedrvF)�loop)rO�boolr7r<rwrxryrzr{�stat�S_ISSOCK�st_mode�remove�FileNotFoundErrorr=r
�errorZbindr%rBZ
EADDRINUSEr}r~r|rZServerZ_start_servingr�sleep)rrr�rqr�rprsr��errrF�msgZserverrrr�create_unix_serversn
�
�
�

�
��
�z)_UnixSelectorEventLoop.create_unix_serverc
�s�z
tjWn,tk
r6}zt�d��W5d}~XYnXz|��}Wn2ttjfk
rv}zt�d��W5d}~XYnXzt�|�j	}Wn,t
k
r�}zt�d��W5d}~XYnX|r�|n|}	|	s�dS|��}
|�|
d|||||	d�|
IdHS)Nzos.sendfile() is not availableznot a regular filer)
rw�sendfile�AttributeErrorr�SendfileNotAvailableErrorr;�io�UnsupportedOperation�fstat�st_sizer=r]�_sock_sendfile_native_impl)rrq�file�offset�countrFr;r�Zfsize�	blocksize�futrrr�_sock_sendfile_nativeJs2
��z,_UnixSelectorEventLoop._sock_sendfile_nativec	Cs,|��}	|dk	r|�|�|��r4|�|||�dS|rd||}|dkrd|�|||�|�|�dSzt�|	|||�}
W�nDttfk
r�|dkr�|�	||�|�
|	|j||	||||||�
Y�nbtk
�rj}z�|dk	�r|j
t
jk�rt|�tk	�rtdt
j�}||_|}|dk�rBt�d�}
|�|||�|�|
�n|�|||�|�|�W5d}~XYn�ttfk
�r��Yn�tk
�r�}z|�|||�|�|�W5d}~XYnjX|
dk�r�|�|||�|�|�nD||
7}||
7}|dk�r
|�	||�|�
|	|j||	||||||�
dS)Nrzsocket is not connectedzos.sendfile call failed)r;�
remove_writer�	cancelled�_sock_sendfile_update_fileposZ
set_resultrwr��BlockingIOError�InterruptedError�_sock_add_cancellation_callbackZ
add_writerr�r=rBZENOTCONNr~�ConnectionError�	__cause__rr�Z
set_exceptionrarbrc)rr�Z
registered_fdrqr;r�r�r��
total_sent�fdZsentrF�new_excr�rrrr�as�

�


�
��
�

�z1_UnixSelectorEventLoop._sock_sendfile_native_implcCs|dkrt�||tj�dS�Nr)rw�lseek�SEEK_SET)rr;r�r�rrrr��sz4_UnixSelectorEventLoop._sock_sendfile_update_fileposcs��fdd�}|�|�dS)Ncs&|��r"���}|dkr"��|�dS)Nr3)r�r;r�)r�r��rrqrr�cb�szB_UnixSelectorEventLoop._sock_add_cancellation_callback.<locals>.cb)Zadd_done_callback)rr�rqr�rr�rr��sz6_UnixSelectorEventLoop._sock_add_cancellation_callback)N)NN)NN)N)N)N)�__name__�
__module__�__qualname__�__doc__rr%r2rHr0r)r8rXrZrlr`r�r�r�r�r�r��
__classcell__rrr!rr/sH-
 �
�
�
��.��CFrcs�eZdZdZd�fdd�	Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Ze
jfdd�Zddd�Zdd�Zdd�Z�ZS) rRiNcs�t��|�||jd<||_||_|��|_||_d|_d|_	t
�|j�j}t
�|�s�t
�|�s�t
�|�s�d|_d|_d|_td��t
�|jd�|j�|jj|�|j�|jj|j|j�|dk	r�|j�tj|d�dS)NrTFz)Pipe transport is for pipes/sockets only.)rr�_extra�_loop�_piper;�_fileno�	_protocol�_closing�_pausedrwr�r�r��S_ISFIFOr��S_ISCHRr<�set_blocking�	call_soon�connection_made�_add_reader�_read_readyr	�_set_result_unless_cancelled)rr�rTrUrVrW�moder!rrr�s:


���
�z_UnixReadPipeTransport.__init__cCs�|jjg}|jdkr |�d�n|jr0|�d�|�d|j���t|jdd�}|jdk	r�|dk	r�t�	||jt
j�}|r�|�d�q�|�d�n |jdk	r�|�d�n
|�d�d�d	�
|��S)
N�closed�closing�fd=�	_selector�polling�idle�open�<{}>� )r"r�r��appendr�r��getattrr�r
�_test_selector_event�	selectorsZ
EVENT_READ�format�join)rrAr r�rrr�__repr__�s(


�

z_UnixReadPipeTransport.__repr__c
Cs�zt�|j|j�}WnDttfk
r,Yn�tk
rX}z|�|d�W5d}~XYn^X|rl|j�	|�nJ|j
��r�t�
d|�d|_|j
�|j�|j
�|jj�|j
�|jd�dS)Nz"Fatal read error on pipe transport�%r was closed by peerT)rw�readr��max_sizer�r�r=�_fatal_errorr�Z
data_receivedr��	get_debugr
rAr��_remove_readerr�Zeof_received�_call_connection_lost)rr1rFrrrr��s
z"_UnixReadPipeTransport._read_readycCs>|js|jrdSd|_|j�|j�|j��r:t�d|�dS)NTz%r pauses reading)r�r�r�r�r�r�r
�debug�rrrr�
pause_reading�s
z$_UnixReadPipeTransport.pause_readingcCsB|js|jsdSd|_|j�|j|j�|j��r>t�d|�dS)NFz%r resumes reading)	r�r�r�r�r�r�r�r
r�r�rrr�resume_readings
z%_UnixReadPipeTransport.resume_readingcCs
||_dSr�r��rrUrrr�set_protocol
sz#_UnixReadPipeTransport.set_protocolcCs|jSrr�r�rrr�get_protocolsz#_UnixReadPipeTransport.get_protocolcCs|jSr�r�r�rrr�
is_closingsz!_UnixReadPipeTransport.is_closingcCs|js|�d�dSr)r��_closer�rrrr%sz_UnixReadPipeTransport.closecCs,|jdk	r(|d|��t|d�|j��dS�Nzunclosed transport r#�r�r,r%�r�_warnrrr�__del__s
z_UnixReadPipeTransport.__del__�Fatal error on pipe transportcCsZt|t�r4|jtjkr4|j��rLtjd||dd�n|j�||||j	d��|�
|�dS�Nz%r: %sT��exc_info)�message�	exceptionr�rU)rOr=rBZEIOr�r�r
r��call_exception_handlerr�r��rrFr�rrrr�s
�z#_UnixReadPipeTransport._fatal_errorcCs(d|_|j�|j�|j�|j|�dS�NT)r�r�r�r�r�r��rrFrrrr�-sz_UnixReadPipeTransport._closecCs4z|j�|�W5|j��d|_d|_d|_XdSr�r�r%r�r�Zconnection_lostr�rrrr�2s
z,_UnixReadPipeTransport._call_connection_lost)NN)r�)r�r�r�r�rr�r�r�r�r�r�r�r%r*r+r�r�r�r�r�rrr!rrR�s
rRcs�eZdZd%�fdd�	Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zejfdd�Zdd�Zd&dd �Zd'd!d"�Zd#d$�Z�ZS)(rYNc
s�t��||�||jd<||_|��|_||_t�|_d|_	d|_
t�|j�j
}t�|�}t�|�}t�|�}	|s�|s�|	s�d|_d|_d|_td��t�|jd�|j�|jj|�|	s�|r�tj�d�s�|j�|jj|j|j�|dk	r�|j�tj|d�dS)NrTrFz?Pipe transport is only for pipes, sockets and character devicesZaix)rrr�r�r;r�r��	bytearray�_buffer�
_conn_lostr�rwr�r�r�r�r�r�r<r�r�r�r�r&�platform�
startswithr�r�r	r�)
rr�rTrUrVrWr�Zis_charZis_fifoZ	is_socketr!rrr?s:




�
�z _UnixWritePipeTransport.__init__cCs�|jjg}|jdkr |�d�n|jr0|�d�|�d|j���t|jdd�}|jdk	r�|dk	r�t�	||jt
j�}|r�|�d�n
|�d�|��}|�d|���n |jdk	r�|�d�n
|�d�d	�
d
�|��S)Nr�r�r�r�r�r�zbufsize=r�r�r�)r"r�r�r�r�r�r�r�r
r�r�ZEVENT_WRITE�get_write_buffer_sizer�r�)rrAr r�rhrrrr�ds,


�


z _UnixWritePipeTransport.__repr__cCs
t|j�Sr)�lenr�r�rrrr�|sz-_UnixWritePipeTransport.get_write_buffer_sizecCs6|j��rt�d|�|jr*|�t��n|��dS)Nr�)r�r�r
rAr�r��BrokenPipeErrorr�rrrr�s

z#_UnixWritePipeTransport._read_readyc
Cs4t|t�rt|�}|sdS|js&|jrN|jtjkr<t�d�|jd7_dS|j	�szt
�|j|�}Wntt
tfk
r�d}YnZttfk
r��YnBtk
r�}z$|jd7_|�|d�WY�dSd}~XYnX|t|�kr�dS|dk�rt|�|d�}|j�|j|j�|j	|7_	|��dS)Nz=pipe closed by peer or os.write(pipe, data) raised exception.rr�#Fatal write error on pipe transport)rOr��
memoryviewr�r�rZ!LOG_THRESHOLD_FOR_CONNLOST_WRITESr
�warningr�rw�writer�r�r�rarbrcr�r�r�Z_add_writer�_write_readyZ_maybe_pause_protocol)rr1�nrFrrrr�s6


z_UnixWritePipeTransport.writec
Cszt�|j|j�}Wn�ttfk
r,Yn�ttfk
rD�Yn�tk
r�}z6|j�	�|j
d7_
|j�|j�|�
|d�W5d}~XYnfX|t|j�kr�|j�	�|j�|j�|��|jr�|j�|j�|�d�dS|dkr�|jd|�=dS)Nrrr)rwrr�r�r�r�rarbrcr-r�r��_remove_writerr�r�Z_maybe_resume_protocolr�r�r�)rrrFrrrr�s*


z$_UnixWritePipeTransport._write_readycCsdSr�rr�rrr�
can_write_eof�sz%_UnixWritePipeTransport.can_write_eofcCs8|jr
dSd|_|js4|j�|j�|j�|jd�dSr�)r�r�r�r�r�r�r�r�rrr�	write_eof�sz!_UnixWritePipeTransport.write_eofcCs
||_dSrr�r�rrrr��sz$_UnixWritePipeTransport.set_protocolcCs|jSrr�r�rrrr��sz$_UnixWritePipeTransport.get_protocolcCs|jSrr�r�rrrr��sz"_UnixWritePipeTransport.is_closingcCs|jdk	r|js|��dSr)r�r�rr�rrrr%�sz_UnixWritePipeTransport.closecCs,|jdk	r(|d|��t|d�|j��dSr�r�r�rrrr��s
z_UnixWritePipeTransport.__del__cCs|�d�dSr)r�r�rrr�abort�sz_UnixWritePipeTransport.abortr�cCsNt|t�r(|j��r@tjd||dd�n|j�||||jd��|�|�dSr�)	rOr=r�r�r
r�r�r�r�r�rrrr��s

�z$_UnixWritePipeTransport._fatal_errorcCsFd|_|jr|j�|j�|j��|j�|j�|j�|j|�dSr�)	r�r�r�rr�r-r�r�r�r�rrrr��s
z_UnixWritePipeTransport._closecCs4z|j�|�W5|j��d|_d|_d|_XdSrr�r�rrrr��s
z-_UnixWritePipeTransport._call_connection_lost)NN)r�)N)r�r�r�rr�r�r�rrrrr�r�r�r%r*r+r�r	r�r�r�r�rrr!rrY<s"%	#	

rYc@seZdZdd�ZdS)r^c		Ks�d}|tjkrt��\}}zPtj|f||||d|d�|��|_|dk	rh|��t|��d|d�|j_	d}W5|dk	r�|��|��XdS)NF)rdrerfrgZuniversal_newlinesrh�wb)�	buffering)
�
subprocess�PIPEryZ
socketpairr%�Popen�_procr��detachre)	rrErdrerfrgrhriZstdin_wrrr�_starts.
���z_UnixSubprocessTransport._startN)r�r�r�rrrrrr^	sr^c@sHeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)raHAbstract base class for monitoring child processes.

    Objects derived from this class monitor a collection of subprocesses and
    report their termination or interruption by a signal.

    New callbacks are registered with .add_child_handler(). Starting a new
    process must be done within a 'with' block to allow the watcher to suspend
    its activity until the new process if fully registered (this is needed to
    prevent a race condition in some implementations).

    Example:
        with watcher:
            proc = subprocess.Popen("sleep 1")
            watcher.add_child_handler(proc.pid, callback)

    Notes:
        Implementations of this class must be thread-safe.

        Since child watcher objects may catch the SIGCHLD signal and call
        waitpid(-1), there should be only one active object per process.
    cGs
t��dS)aRegister a new child handler.

        Arrange for callback(pid, returncode, *args) to be called when
        process 'pid' terminates. Specifying another callback for the same
        process replaces the previous handler.

        Note: callback() must be thread-safe.
        N��NotImplementedError�rrnrDrErrrr_9s	z&AbstractChildWatcher.add_child_handlercCs
t��dS)z�Removes the handler for process 'pid'.

        The function returns True if the handler was successfully removed,
        False if there was nothing to remove.Nr�rrnrrr�remove_child_handlerDsz)AbstractChildWatcher.remove_child_handlercCs
t��dS)z�Attach the watcher to an event loop.

        If the watcher was previously attached to an event loop, then it is
        first detached before attaching to the new loop.

        Note: loop may be None.
        Nr�rr�rrr�attach_loopLsz AbstractChildWatcher.attach_loopcCs
t��dS)zlClose the watcher.

        This must be called to make sure that any underlying resource is freed.
        Nrr�rrrr%VszAbstractChildWatcher.closecCs
t��dS)z�Return ``True`` if the watcher is active and is used by the event loop.

        Return True if the watcher is installed and ready to handle process exit
        notifications.

        Nrr�rrrr\]szAbstractChildWatcher.is_activecCs
t��dS)zdEnter the watcher's context and allow starting new processes

        This function must return selfNrr�rrr�	__enter__fszAbstractChildWatcher.__enter__cCs
t��dS)zExit the watcher's contextNr�r�a�b�crrr�__exit__lszAbstractChildWatcher.__exit__N)r�r�r�r�r_rrr%r\rrrrrrr"s
	rcCs2t�|�rt�|�St�|�r*t�|�S|SdSr)rw�WIFSIGNALED�WTERMSIG�	WIFEXITED�WEXITSTATUS)�statusrrr�_compute_returncodeqs



r$c@sDeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�BaseChildWatchercCsd|_i|_dSr)r��
_callbacksr�rrrr�szBaseChildWatcher.__init__cCs|�d�dSr)rr�rrrr%�szBaseChildWatcher.closecCs|jdk	o|j��Sr)r�Z
is_runningr�rrrr\�szBaseChildWatcher.is_activecCs
t��dSrr)r�expected_pidrrr�_do_waitpid�szBaseChildWatcher._do_waitpidcCs
t��dSrrr�rrr�_do_waitpid_all�sz BaseChildWatcher._do_waitpid_allcCsf|jdk	r$|dkr$|jr$t�dt�|jdk	r<|j�tj�||_|dk	rb|�tj|j	�|�
�dS)NzCA loop is being detached from a child watcher with pending handlers)r�r&r*r+�RuntimeWarningr)r9�SIGCHLDrH�	_sig_chldr)rrrrr�s�
zBaseChildWatcher.attach_loopc
Cs^z|��WnLttfk
r&�Yn4tk
rX}z|j�d|d��W5d}~XYnXdS)N�$Unknown exception in SIGCHLD handler)r�r�)r)rarbrcr�r�r�rrrr,�s�zBaseChildWatcher._sig_chldN)
r�r�r�rr%r\r(r)rr,rrrrr%sr%csPeZdZdZ�fdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
�ZS)rad'Safe' child watcher implementation.

    This implementation avoids disrupting other code spawning processes by
    polling explicitly each process in the SIGCHLD handler instead of calling
    os.waitpid(-1).

    This is a safe solution but it has a significant overhead when handling a
    big number of children (O(n) each time SIGCHLD is raised)
    cs|j��t���dSr)r&r-rr%r�r!rrr%�s
zSafeChildWatcher.closecCs|Srrr�rrrr�szSafeChildWatcher.__enter__cCsdSrrrrrrr�szSafeChildWatcher.__exit__cGs||f|j|<|�|�dSr)r&r(rrrrr_�sz"SafeChildWatcher.add_child_handlercCs*z|j|=WdStk
r$YdSXdS�NTF�r&rJrrrrr�s
z%SafeChildWatcher.remove_child_handlercCst|j�D]}|�|�q
dSr�r(r&r(rrrrr)�sz SafeChildWatcher._do_waitpid_allcCs�zt�|tj�\}}Wn(tk
r>|}d}t�d|�Yn.X|dkrLdSt|�}|j��rlt�	d||�z|j
�|�\}}Wn.tk
r�|j��r�tjd|dd�YnX|||f|��dS)N��8Unknown child process pid %d, will report returncode 255r�$process %s exited with returncode %s�'Child watcher got an unexpected pid: %rTr�)
rw�waitpid�WNOHANG�ChildProcessErrorr
rr$r�r�r�r&�poprJ)rr'rnr#rorDrErrrr(�s4�

�
�zSafeChildWatcher._do_waitpid)r�r�r�r�r%rrr_rr)r(r�rrr!rr�s
rcsTeZdZdZ�fdd�Z�fdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
�ZS)raW'Fast' child watcher implementation.

    This implementation reaps every terminated processes by calling
    os.waitpid(-1) directly, possibly breaking other code spawning processes
    and waiting for their termination.

    There is no noticeable overhead when handling a big number of children
    (O(1) each time a child terminates).
    cs$t���t��|_i|_d|_dSr�)rr�	threadingZLock�_lock�_zombies�_forksr�r!rrrs

zFastChildWatcher.__init__cs"|j��|j��t���dSr)r&r-r;rr%r�r!rrr%s

zFastChildWatcher.closec
Cs0|j� |jd7_|W5QR�SQRXdS)Nr)r:r<r�rrrrszFastChildWatcher.__enter__c	Cs^|j�B|jd8_|js"|js0W5QR�dSt|j�}|j��W5QRXt�d|�dS)Nrz5Caught subprocesses termination from unknown pids: %s)r:r<r;r?r-r
r)rrrrZcollateral_victimsrrrrs
�zFastChildWatcher.__exit__c	Gsf|j�Fz|j�|�}Wn.tk
rF||f|j|<YW5QR�dSXW5QRX|||f|��dSr)r:r;r8rJr&)rrnrDrErorrrr_'sz"FastChildWatcher.add_child_handlercCs*z|j|=WdStk
r$YdSXdSr.r/rrrrr5s
z%FastChildWatcher.remove_child_handlerc	Cs�zt�dtj�\}}Wntk
r,YdSX|dkr:dSt|�}|j��z|j�|�\}}WnNtk
r�|j	r�||j
|<|j��r�t
�d||�YW5QR�qd}YnX|j��r�t
�d||�W5QRX|dkr�t
�d||�q|||f|��qdS)Nr3rz,unknown process %s exited with returncode %sr3z8Caught subprocess termination from unknown pid: %d -> %d)rwr5r6r7r$r:r&r8rJr<r;r�r�r
r�r)rrnr#rorDrErrrr)<s@

�

��z FastChildWatcher._do_waitpid_all)r�r�r�r�rr%rrr_rr)r�rrr!rr�s	rc@sheZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)ra~A watcher that doesn't require running loop in the main thread.

    This implementation registers a SIGCHLD signal handler on
    instantiation (which may conflict with other code that
    install own handler for this signal).

    The solution is safe but it has a significant overhead when
    handling a big number of processes (*O(n)* each time a
    SIGCHLD is received).
    cCsi|_d|_dSr)r&�_saved_sighandlerr�rrrrzszMultiLoopChildWatcher.__init__cCs
|jdk	Sr)r=r�rrrr\~szMultiLoopChildWatcher.is_activecCsT|j��|jdkrdSt�tj�}||jkr:t�d�nt�tj|j�d|_dS)Nz+SIGCHLD handler was changed by outside code)	r&r-r=r9�	getsignalr+r,r
r)rrNrrrr%�s


zMultiLoopChildWatcher.closecCs|Srrr�rrrr�szMultiLoopChildWatcher.__enter__cCsdSrr�r�exc_typeZexc_valZexc_tbrrrr�szMultiLoopChildWatcher.__exit__cGs&t��}|||f|j|<|�|�dSr)r�get_running_loopr&r()rrnrDrEr�rrrr_�sz'MultiLoopChildWatcher.add_child_handlercCs*z|j|=WdStk
r$YdSXdSr.r/rrrrr�s
z*MultiLoopChildWatcher.remove_child_handlercCsN|jdk	rdSt�tj|j�|_|jdkr<t�d�tj|_t�tjd�dS)NzaPrevious SIGCHLD handler was set by non-Python code, restore to default handler on watcher close.F)r=r9r+r,r
rrMr@rrrrr�s


z!MultiLoopChildWatcher.attach_loopcCst|j�D]}|�|�q
dSrr0rrrrr)�sz%MultiLoopChildWatcher._do_waitpid_allc	Cs�zt�|tj�\}}Wn,tk
rB|}d}t�d|�d}YnX|dkrPdSt|�}d}z|j�|�\}}}Wn$t	k
r�tjd|dd�YnHX|�
�r�t�d||�n.|r�|��r�t�d	||�|j
|||f|��dS)
Nr1r2FrTr4r��%Loop %r that handles pid %r is closedr3)rwr5r6r7r
rr$r&r8rJ�	is_closedr�r�rm)	rr'rnr#roZ	debug_logr�rDrErrrr(�s:�
��z!MultiLoopChildWatcher._do_waitpidc	CsLz|��Wn:ttfk
r&�Yn"tk
rFtjddd�YnXdS)Nr-Tr�)r)rarbrcr
r)rrrrrrr,�szMultiLoopChildWatcher._sig_chldN)r�r�r�r�rr\r%rrr_rrr)r(r,rrrrrgs%rc@sneZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	e
jfdd�Zdd�Z
dd�Zdd�Zdd�ZdS)raAThreaded child watcher implementation.

    The watcher uses a thread per process
    for waiting for the process finish.

    It doesn't require subscription on POSIX signal
    but a thread creation is not free.

    The watcher has O(1) complexity, its performance doesn't depend
    on amount of spawn processes.
    cCst�d�|_i|_dSr�)�	itertoolsr��_pid_counter�_threadsr�rrrr�szThreadedChildWatcher.__init__cCsdSr�rr�rrrr\�szThreadedChildWatcher.is_activecCs|��dSr)�
_join_threadsr�rrrr%�szThreadedChildWatcher.closecCs.dd�t|j���D�}|D]}|��qdS)z%Internal: Join all non-daemon threadscSsg|]}|��r|js|�qSr)�is_alive�daemon��.0�threadrrr�
<listcomp>�s�z6ThreadedChildWatcher._join_threads.<locals>.<listcomp>N)r(rF�valuesr�)r�threadsrLrrrrG�sz"ThreadedChildWatcher._join_threadscCs|Srrr�rrrrszThreadedChildWatcher.__enter__cCsdSrrr?rrrrszThreadedChildWatcher.__exit__cCs6dd�t|j���D�}|r2||j�d�t|d�dS)NcSsg|]}|��r|�qSr)rHrJrrrrM	s�z0ThreadedChildWatcher.__del__.<locals>.<listcomp>z0 has registered but not finished child processesr#)r(rFrNr"r,)rr�rOrrrr�s�zThreadedChildWatcher.__del__cGsFt��}tj|jdt|j���||||fdd�}||j|<|��dS)Nzwaitpid-T)�target�namerErI)	rrAr9ZThreadr(�nextrErF�start)rrnrDrEr�rLrrrr_s
�
z&ThreadedChildWatcher.add_child_handlercCsdSr�rrrrrrsz)ThreadedChildWatcher.remove_child_handlercCsdSrrrrrrrsz ThreadedChildWatcher.attach_loopcCs�zt�|d�\}}Wn(tk
r<|}d}t�d|�Yn Xt|�}|��r\t�d||�|��rtt�d||�n|j	|||f|��|j
�|�dS)Nrr1r2r3rB)rwr5r7r
rr$r�r�rCrmrFr8)rr�r'rDrErnr#rorrrr("s&�
�z ThreadedChildWatcher._do_waitpidN)r�r�r�r�rr\r%rGrrr*r+r�r_rrr(rrrrr�s	rcsHeZdZdZeZ�fdd�Zdd�Z�fdd�Zdd	�Z	d
d�Z
�ZS)�_UnixDefaultEventLoopPolicyz:UNIX event loop policy with a watcher for child processes.cst���d|_dSr)rr�_watcherr�r!rrrAs
z$_UnixDefaultEventLoopPolicy.__init__c	CsHtj�8|jdkr:t�|_tt��tj�r:|j�|j	j
�W5QRXdSr)rr:rUrrOr9�current_thread�_MainThreadr�_localr�r�rrr�
_init_watcherEs
�z)_UnixDefaultEventLoopPolicy._init_watchercs6t��|�|jdk	r2tt��tj�r2|j�|�dS)z�Set the event loop.

        As a side effect, if a child watcher was set before, then calling
        .set_event_loop() from the main thread will call .attach_loop(loop) on
        the child watcher.
        N)r�set_event_looprUrOr9rVrWrrr!rrrZMs

�z*_UnixDefaultEventLoopPolicy.set_event_loopcCs|jdkr|��|jS)z~Get the watcher for child processes.

        If not yet set, a ThreadedChildWatcher object is automatically created.
        N)rUrYr�rrrr[[s
z-_UnixDefaultEventLoopPolicy.get_child_watchercCs|jdk	r|j��||_dS)z$Set the watcher for child processes.N)rUr%)rrjrrr�set_child_watcheres

z-_UnixDefaultEventLoopPolicy.set_child_watcher)r�r�r�r�rZ
_loop_factoryrrYrZr[r[r�rrr!rrT=s
rT)2r�rBr�rDrwr�r9ryr�rr&r9r*�rrrrrrr	r
rr�logr
�__all__r��ImportErrorrZBaseSelectorEventLooprZ
ReadTransportrRZ_FlowControlMixinZWriteTransportrYZBaseSubprocessTransportr^rr$r%rrrrZBaseDefaultEventLoopPolicyrTrrrrrr�<module>s`	
	�NO5Ji}Y3asyncio/__pycache__/tasks.cpython-38.opt-1.pyc000064400000057243151153537520015157 0ustar00U

e5d���@svdZdZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZddlm
Z
ddlmZddlmZdd	lmZdd
l
mZe�d�jZdBdd�ZdCd
d�ZdDdd�Zdd�ZGdd�dej�ZeZzddlZWnek
r�YnXejZZdd�dd�Zejj Z ejj!Z!ejj"Z"dde"d�dd�Z#dd�Z$dd�dd�Z%d d!�Z&d"d#�Z'ddd$�d%d&�Z(ej)d'd(��Z*dEdd�d)d*�Z+dd�d+d,�Z,ej)d-d.��Z-ee-_Gd/d0�d0ej.�Z/dd1d2�d3d4�Z0dd�d5d6�Z1d7d8�Z2e
�3�Z4iZ5d9d:�Z6d;d<�Z7d=d>�Z8d?d@�Z9e6Z:e9Z;e7Z<e8Z=z$ddAlm6Z6m9Z9m7Z7m8Z8m4Z4m5Z5Wnek
�r`YnXe6Z>e9Z?e7Z@e8ZAdS)Fz0Support for tasks, coroutines and the scheduler.)�Task�create_task�FIRST_COMPLETED�FIRST_EXCEPTION�
ALL_COMPLETED�wait�wait_for�as_completed�sleep�gather�shield�
ensure_future�run_coroutine_threadsafe�current_task�	all_tasks�_register_task�_unregister_task�_enter_task�_leave_task�N�)�
base_tasks)�
coroutines)�events)�
exceptions)�futures)�
_is_coroutinecCs|dkrt��}t�|�S)z!Return a currently executed task.N)r�get_running_loop�_current_tasks�get��loop�r!�%/usr/lib64/python3.8/asyncio/tasks.pyr"srcs^�dkrt���d}ztt�}WqLtk
rF|d7}|dkrB�YqXqLq�fdd�|D�S)z'Return a set of all tasks for the loop.Nrr��cs&h|]}t�|��kr|��s|�qSr!)r�	_get_loop�done��.0�trr!r"�	<setcomp><s�zall_tasks.<locals>.<setcomp>)rr�list�
_all_tasks�RuntimeError�r �iZtasksr!rr"r)srcs^�dkrt���d}ztt�}WqLtk
rF|d7}|dkrB�YqXqLq�fdd�|D�S)Nrrr#csh|]}t�|��kr|�qSr!)rr$r&rr!r"r)Usz$_all_tasks_compat.<locals>.<setcomp>)r�get_event_loopr*r+r,r-r!rr"�_all_tasks_compat@sr0cCs4|dk	r0z
|j}Wntk
r&Yn
X||�dS�N)�set_name�AttributeError)�task�namer2r!r!r"�_set_task_nameXs
r6cs�eZdZdZdZed%dd��Zed&dd��Zddd��fd	d
�
Z�fdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�dd�Zddd�dd�Zdd �Zd'�fd!d"�	Zd#d$�Z�ZS)(rz A coroutine wrapped in a Future.TNcCs(tjdtdd�|dkr t��}t|�S)z�Return the currently running task in an event loop or None.

        By default the current task for the current event loop is returned.

        None is returned when called not in the context of a Task.
        zVTask.current_task() is deprecated since Python 3.7, use asyncio.current_task() instead���
stacklevelN)�warnings�warn�DeprecationWarningrr/r��clsr r!r!r"rts�zTask.current_taskcCstjdtdd�t|�S)z|Return a set of all tasks for an event loop.

        By default all tasks for the current event loop are returned.
        zPTask.all_tasks() is deprecated since Python 3.7, use asyncio.all_tasks() insteadr7r8)r:r;r<r0r=r!r!r"r�s
�zTask.all_tasks)r r5cs�t�j|d�|jr|jd=t�|�s:d|_td|����|dkrRdt���|_n
t	|�|_d|_
d|_||_t
��|_|jj|j|jd�t|�dS)Nr���Fza coroutine was expected, got zTask-��context)�super�__init__�_source_tracebackr�iscoroutine�_log_destroy_pending�	TypeError�_task_name_counter�_name�str�_must_cancel�_fut_waiter�_coro�contextvarsZcopy_context�_context�_loop�	call_soon�_Task__stepr)�self�coror r5��	__class__r!r"rC�s


z
Task.__init__csF|jtjkr8|jr8|dd�}|jr,|j|d<|j�|�t���dS)Nz%Task was destroyed but it is pending!)r4�messageZsource_traceback)	Z_staterZ_PENDINGrFrDrPZcall_exception_handlerrB�__del__)rSrArUr!r"rX�s�
zTask.__del__cCs
t�|�Sr1)rZ_task_repr_info�rSr!r!r"�
_repr_info�szTask._repr_infocCs|jSr1)rMrYr!r!r"�get_coro�sz
Task.get_corocCs|jSr1)rIrYr!r!r"�get_name�sz
Task.get_namecCst|�|_dSr1)rJrI)rS�valuer!r!r"r2�sz
Task.set_namecCstd��dS)Nz*Task does not support set_result operation�r,)rS�resultr!r!r"�
set_result�szTask.set_resultcCstd��dS)Nz-Task does not support set_exception operationr^)rS�	exceptionr!r!r"�
set_exception�szTask.set_exception)�limitcCst�||�S)a�Return the list of stack frames for this task's coroutine.

        If the coroutine is not done, this returns the stack where it is
        suspended.  If the coroutine has completed successfully or was
        cancelled, this returns an empty list.  If the coroutine was
        terminated by an exception, this returns the list of traceback
        frames.

        The frames are always ordered from oldest to newest.

        The optional limit gives the maximum number of frames to
        return; by default all available frames are returned.  Its
        meaning differs depending on whether a stack or a traceback is
        returned: the newest frames of a stack are returned, but the
        oldest frames of a traceback are returned.  (This matches the
        behavior of the traceback module.)

        For reasons beyond our control, only one stack frame is
        returned for a suspended coroutine.
        )rZ_task_get_stack)rSrcr!r!r"�	get_stack�szTask.get_stack)rc�filecCst�|||�S)anPrint the stack or traceback for this task's coroutine.

        This produces output similar to that of the traceback module,
        for the frames retrieved by get_stack().  The limit argument
        is passed to get_stack().  The file argument is an I/O stream
        to which the output is written; by default output is written
        to sys.stderr.
        )rZ_task_print_stack)rSrcrer!r!r"�print_stack�s	zTask.print_stackcCs4d|_|��rdS|jdk	r*|j��r*dSd|_dS)a�Request that this task cancel itself.

        This arranges for a CancelledError to be thrown into the
        wrapped coroutine on the next cycle through the event loop.
        The coroutine then has a chance to clean up or even deny
        the request using try/except/finally.

        Unlike Future.cancel, this does not guarantee that the
        task will be cancelled: the exception might be caught and
        acted upon, delaying cancellation of the task or preventing
        cancellation completely.  The task may also return a value or
        raise a different exception.

        Immediately after this method is called, Task.cancelled() will
        not return True (unless the task was already cancelled).  A
        task will be marked as cancelled when the wrapped coroutine
        terminates with a CancelledError exception (even if cancel()
        was not called).
        FNT)Z_log_tracebackr%rL�cancelrKrYr!r!r"rg�s

zTask.cancelc
s�|��rt�d|�d|����|jr>t|tj�s8t��}d|_|j}d|_t|j	|��zfz"|dkrp|�d�}n
|�|�}Wn�t
k
r�}z*|jr�d|_t���nt��|j�W5d}~XY�n�tjk
r�t���Y�n�ttfk
�r}zt��|��W5d}~XY�n�tk
�rL}zt��|�W5d}~XY�npXt|dd�}|dk	�r@t�|�|j	k	�r�td|�d|�d��}|j	j|j||jd�n�|�r||k�r�td	|���}|j	j|j||jd�n8d|_|j|j|jd�||_|j�r>|j���r>d|_n*td
|�d|���}|j	j|j||jd�n||dk�r`|j	j|j|jd�n\t �!|��r�td|�d|���}|j	j|j||jd�n$td
|���}|j	j|j||jd�W5t
|j	|�d}XdS)Nz_step(): already done: z, F�_asyncio_future_blockingzTask z got Future z attached to a different loopr@zTask cannot await on itself: z-yield was used instead of yield from in task z with z;yield was used instead of yield from for generator in task zTask got bad yield: )"r%rZInvalidStateErrorrK�
isinstance�CancelledErrorrMrLrrPr�send�throw�
StopIterationrBrgr`r]�KeyboardInterrupt�
SystemExitrb�
BaseException�getattrrr$r,rQrRrOrh�add_done_callback�
_Task__wakeup�inspectZisgenerator)rS�excrTr_Zblocking�new_excrUr!r"Z__steps��  
��
�����
���
zTask.__stepc
CsJz|��Wn,tk
r8}z|�|�W5d}~XYn
X|��d}dSr1)r_rprR)rS�futurerur!r!r"Z__wakeup[sz
Task.__wakeup)N)N)N)�__name__�
__module__�__qualname__�__doc__rF�classmethodrrrCrXrZr[r\r2r`rbrdrfrgrRrs�
__classcell__r!r!rUr"rbs&
!Tr)r5cCs t��}|�|�}t||�|S)z]Schedule the execution of a coroutine object in a spawn task.

    Return a Task object.
    )rrrr6)rTr5r r4r!r!r"rxs

r)r �timeout�return_whenc�s�t�|�st�|�r(tdt|�j����|s4td��|tt	t
fkrPtd|�����dkrbt���nt
jdtdd��fdd	�t|�D�}t|||��IdHS)
a�Wait for the Futures and coroutines given by fs to complete.

    The fs iterable must not be empty.

    Coroutines will be wrapped in Tasks.

    Returns two sets of Future: (done, pending).

    Usage:

        done, pending = await asyncio.wait(fs)

    Note: This does not raise TimeoutError! Futures that aren't done
    when the timeout occurs are returned in the second set.
    zexpect a list of futures, not z#Set of coroutines/Futures is empty.zInvalid return_when value: N�[The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.r7r8csh|]}t|�d��qS�r�r�r'�frr!r"r)�szwait.<locals>.<setcomp>)r�isfuturerrErG�typerx�
ValueErrorrrrrrr:r;r<�set�_wait)�fsr r~rr!rr"r�s
�rcGs|��s|�d�dSr1)r%r`)�waiter�argsr!r!r"�_release_waiter�sr�rc
�s�|dkrt��}ntjdtdd�|dkr4|IdHS|dkr�t||d�}|��rX|��St||d�IdHz|��Wn.t	j
k
r�}zt	��|�W5d}~XYn
Xt	���|��}|�
|t|�}t�t|�}t||d�}|�|�z�z|IdHWnPt	j
k
�rF|���r$|��YW�dS|�|�t||d�IdH�YnX|���r^|��W�*S|�|�t||d�IdHt	���W5|��XdS)a�Wait for the single Future or coroutine to complete, with timeout.

    Coroutine will be wrapped in Task.

    Returns result of the Future or coroutine.  When a timeout occurs,
    it cancels the task and raises TimeoutError.  To avoid the task
    cancellation, wrap it in shield().

    If the wait is cancelled, the task is also cancelled.

    This function is a coroutine.
    Nr�r7r8rr)rrr:r;r<rr%r_�_cancel_and_waitrrj�TimeoutError�
create_future�
call_laterr��	functools�partialrrrg�remove_done_callback)�futr~r rur��timeout_handle�cbr!r!r"r�sL

�





rc
�s�|���d�|dk	r"|�|t���t|������fdd�}|D]}|�|�q@z�IdHW5�dk	rp���|D]}|�|�qtXt�t�}}|D]"}|��r�|�	|�q�|�	|�q�||fS)zVInternal helper for wait().

    The fs argument must be a collection of Futures.
    NcsZ�d8��dks4�tks4�tkrV|��sV|��dk	rV�dk	rD������sV��d�dS)Nrr)rr�	cancelledrargr%r`�r��Zcounterrr�r�r!r"�_on_completions���
�z_wait.<locals>._on_completion)
r�r�r��lenrrrgr�r�r%�add)r�r~rr r�r�r%Zpendingr!r�r"r��s(r�c	�sF|��}t�t|�}|�|�z|��|IdHW5|�|�XdS)z<Cancel the *fut* future or task and wait until it completes.N)r�r�r�r�rrr�rg)r�r r�r�r!r!r"r�&s
r�)r r~c#s�t�|�st�|�r(tdt|�j����ddlm}|�d���dkrPt	�
��ntjdt
dd��fd	d
�t|�D��d����fdd�}���fd
d���fdd�}�D]}|���q��r�|dk	r҈�||��tt���D]}|�Vq�dS)a^Return an iterator whose values are coroutines.

    When waiting for the yielded coroutines you'll get the results (or
    exceptions!) of the original Futures (or coroutines), in the order
    in which and as soon as they complete.

    This differs from PEP 3148; the proper way to use this is:

        for f in as_completed(fs):
            result = await f  # The 'await' may raise.
            # Use result.

    If a timeout is specified, the 'await' will raise
    TimeoutError when the timeout occurs before all Futures are done.

    Note: The futures 'f' are not necessarily members of fs.
    z#expect an iterable of futures, not r)�QueuerNr�r7r8csh|]}t|�d��qSr�r�r�rr!r"r)Uszas_completed.<locals>.<setcomp>cs*�D]}|�����d�q���dSr1)r��
put_nowait�clearr�)r�r%�todor!r"�_on_timeoutXs
z!as_completed.<locals>._on_timeoutcs4�sdS��|���|��s0�dk	r0���dSr1)�remover�rgr�)r%r�r�r!r"r�^s

z$as_completed.<locals>._on_completionc�s$���IdH}|dkrtj�|��Sr1)rrr�r_r�)r%r!r"�
_wait_for_onefsz#as_completed.<locals>._wait_for_one)rr�rrErGr�rxZqueuesr�rr/r:r;r<r�rrr��ranger�)r�r r~r�r�r�r��_r!)r�r%r r�r�r"r7s*

�rccs
dVdS)z�Skip one event loop run cycle.

    This is a private helper for 'asyncio.sleep()', used
    when the 'delay' is set to 0.  It uses a bare 'yield'
    expression (which Task.__step knows how to handle)
    instead of creating a Future object.
    Nr!r!r!r!r"�__sleep0us	r�c�sr|dkrt�IdH|S|dkr*t��}ntjdtdd�|��}|�|tj	||�}z|IdHW�S|�
�XdS)z9Coroutine that completes after a given time (in seconds).rNr�r7r8)r�rrr:r;r<r�r�rZ_set_result_unless_cancelledrg)Zdelayr_r rw�hr!r!r"r	�s$
��r	cCs�t�|�r6|dkrt��}|�|�}|jr2|jd=|St�|�rb|dk	r^|t�|�k	r^t	d��|St
�|�r|tt
|�|d�Std��dS)zmWrap a coroutine or an awaitable in a future.

    If the argument is a Future, it is returned directly.
    Nr?zRThe future belongs to a different loop than the one specified as the loop argumentrz:An asyncio.Future, a coroutine or an awaitable is required)rrErr/rrDrr�r$r�rtZisawaitabler�_wrap_awaitablerG)Zcoro_or_futurer r4r!r!r"r�s



rccs|��EdHS)z�Helper for asyncio.ensure_future().

    Wraps awaitable (an object with __await__) into a coroutine
    that will later be wrapped in a Task by ensure_future().
    N)�	__await__)Z	awaitabler!r!r"r��sr�cs.eZdZdZdd��fdd�
Zdd�Z�ZS)�_GatheringFuturez�Helper for gather().

    This overrides cancel() to cancel all the children and act more
    like Task.cancel(), which doesn't immediately mark itself as
    cancelled.
    Nrcst�j|d�||_d|_dS)NrF)rBrC�	_children�_cancel_requested)rS�childrenr rUr!r"rC�sz_GatheringFuture.__init__cCs6|��rdSd}|jD]}|��rd}q|r2d|_|S)NFT)r%r�rgr�)rSZretZchildr!r!r"rg�s
z_GatheringFuture.cancel)rxryrzr{rCrgr}r!r!rUr"r��sr�F)r �return_exceptionscs�|s<|dkrt��}ntjdtdd�|�����g��S�����fdd�}i}g�d�d�|D]f}||kr�t||d�}|dkr�t�	|�}||k	r�d	|_
�d
7�|||<|�|�n||}��|�qdt
�|d���S)a�Return a future aggregating results from the given coroutines/futures.

    Coroutines will be wrapped in a future and scheduled in the event
    loop. They will not necessarily be scheduled in the same order as
    passed in.

    All futures must share the same event loop.  If all the tasks are
    done successfully, the returned future's result is the list of
    results (in the order of the original sequence, not necessarily
    the order of results arrival).  If *return_exceptions* is True,
    exceptions in the tasks are treated the same as successful
    results, and gathered in the result list; otherwise, the first
    raised exception will be immediately propagated to the returned
    future.

    Cancellation: if the outer Future is cancelled, all children (that
    have not completed yet) are also cancelled.  If any child is
    cancelled, this is treated as if it raised CancelledError --
    the outer Future is *not* cancelled in this case.  (This is to
    prevent the cancellation of one child to cause other children to
    be cancelled.)

    If *return_exceptions* is False, cancelling gather() after it
    has been marked done won't cancel any submitted awaitables.
    For instance, gather can be marked done after propagating an
    exception to the caller, therefore, calling ``gather.cancel()``
    after catching an exception (raised by one of the awaitables) from
    gather won't cancel any other awaitables.
    Nr�r7r8cs��d7����r$|��s |��dS�sd|��rFt��}��|�dS|��}|dk	rd��|�dS��kr�g}�D]8}|��r�t��}n|��}|dkr�|��}|�|�qt�jrĈ�t���n
��	|�dS)Nr)
r%r�rarrjrbr_�appendr�r`)r�ruZresults�res�r�Z	nfinishedZnfuts�outerr�r!r"�_done_callbacks4


zgather.<locals>._done_callbackrrFr)rr/r:r;r<r�r`rrr$rFrrr�r�)r r�Zcoros_or_futuresr�Z
arg_to_fut�argr�r!r�r"r
�s:
�
1
r
cst|dk	rtjdtdd�t||d�����r0�St���}|����fdd����fdd	�}������|��S)
a.Wait for a future, shielding it from cancellation.

    The statement

        res = await shield(something())

    is exactly equivalent to the statement

        res = await something()

    *except* that if the coroutine containing it is cancelled, the
    task running in something() is not cancelled.  From the POV of
    something(), the cancellation did not happen.  But its caller is
    still cancelled, so the yield-from expression still raises
    CancelledError.  Note: If something() is cancelled by other means
    this will still cancel shield().

    If you want to completely ignore cancellation (not recommended)
    you can combine shield() with a try/except clause, as follows:

        try:
            res = await shield(something())
        except CancelledError:
            res = None
    Nr�r7r8rcs\���r|��s|��dS|��r.���n*|��}|dk	rJ��|�n��|���dSr1)r�rargrbr`r_)�innerru�r�r!r"�_inner_done_callbackus
z$shield.<locals>._inner_done_callbackcs���s����dSr1)r%r�r�)r�r�r!r"�_outer_done_callback�sz$shield.<locals>._outer_done_callback)	r:r;r<rr%rr$r�rr)r�r r�r!)r�r�r�r"rPs�


rcs:t���std��tj������fdd�}��|��S)zsSubmit a coroutine object to a given event loop.

    Return a concurrent.futures.Future to access the result.
    zA coroutine object is requiredc
slzt�t��d���WnNttfk
r2�Yn6tk
rf}z���rT��|��W5d}~XYnXdS)Nr)rZ
_chain_futurerrornrpZset_running_or_notify_cancelrb)ru�rTrwr r!r"�callback�s
z*run_coroutine_threadsafe.<locals>.callback)rrErG�
concurrentr�FutureZcall_soon_threadsafe)rTr r�r!r�r"r
�s



r
cCst�|�dS)z3Register a new task in asyncio as executed by loop.N)r+r��r4r!r!r"r�srcCs4t�|�}|dk	r(td|�d|�d���|t|<dS)NzCannot enter into task z while another task z is being executed.�rrr,�r r4rr!r!r"r�s
rcCs2t�|�}||k	r(td|�d|�d���t|=dS)Nz
Leaving task z! does not match the current task �.r�r�r!r!r"r�s
rcCst�|�dS)zUnregister a task.N)r+�discardr�r!r!r"r�sr)rrrrr+r)N)N)N)N)Br{�__all__Zconcurrent.futuresr�rNr�rt�	itertools�typesr:�weakref�rrrrrr�count�__next__rHrrr0r6Z	_PyFuturerZ_PyTaskZ_asyncio�ImportErrorZ_CTaskrrrrrr�rr�r�r�	coroutiner�r	rr�r�r�r
rr
ZWeakSetr+rrrrrZ_py_register_taskZ_py_unregister_taskZ_py_enter_taskZ_py_leave_taskZ_c_register_taskZ_c_unregister_taskZ
_c_enter_taskZ
_c_leave_taskr!r!r!r"�<module>s�	





#H,>

x?$asyncio/__pycache__/protocols.cpython-38.opt-2.pyc000064400000006435151153537520016054 0ustar00U

e5d��@s^dZGdd�d�ZGdd�de�ZGdd�de�ZGdd�de�ZGd	d
�d
e�Zdd�Zd
S))�BaseProtocol�Protocol�DatagramProtocol�SubprocessProtocol�BufferedProtocolc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r�cCsdS�Nr)�selfZ	transportrr�)/usr/lib64/python3.8/asyncio/protocols.py�connection_madeszBaseProtocol.connection_madecCsdSrr�r�excrrr	�connection_lostszBaseProtocol.connection_lostcCsdSrr�rrrr	�
pause_writing%szBaseProtocol.pause_writingcCsdSrrrrrr	�resume_writing;szBaseProtocol.resume_writingN)�__name__�
__module__�__qualname__�	__slots__r
r
rrrrrr	r	s

rc@s eZdZdZdd�Zdd�ZdS)rrcCsdSrr)r�datarrr	�
data_received^szProtocol.data_receivedcCsdSrrrrrr	�eof_receiveddszProtocol.eof_receivedN)rrrrrrrrrr	rBsrc@s(eZdZdZdd�Zdd�Zdd�ZdS)	rrcCsdSrr)r�sizehintrrr	�
get_buffer�szBufferedProtocol.get_buffercCsdSrr)r�nbytesrrr	�buffer_updated�szBufferedProtocol.buffer_updatedcCsdSrrrrrr	r�szBufferedProtocol.eof_receivedN)rrrrrrrrrrr	rmsrc@s eZdZdZdd�Zdd�ZdS)rrcCsdSrr)rrZaddrrrr	�datagram_received�sz"DatagramProtocol.datagram_receivedcCsdSrrrrrr	�error_received�szDatagramProtocol.error_receivedN)rrrrrrrrrr	r�src@s(eZdZdZdd�Zdd�Zdd�ZdS)	rrcCsdSrr)r�fdrrrr	�pipe_data_received�sz%SubprocessProtocol.pipe_data_receivedcCsdSrr)rrrrrr	�pipe_connection_lost�sz'SubprocessProtocol.pipe_connection_lostcCsdSrrrrrr	�process_exited�sz!SubprocessProtocol.process_exitedN)rrrrrr r!rrrr	r�srcCs�t|�}|r�|�|�}t|�}|s*td��||krL||d|�<|�|�dS|d|�|d|�<|�|�||d�}t|�}qdS)Nz%get_buffer() returned an empty buffer)�lenr�RuntimeErrorr)�protorZdata_lenZbufZbuf_lenrrr	�_feed_data_to_buffered_proto�s


r%N)�__all__rrrrrr%rrrr	�<module>s9+9asyncio/__pycache__/windows_events.cpython-38.opt-1.pyc000064400000057751151153537520017114 0ustar00U

e5di��@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddl
mZddl
m
Z
ddl
mZddl
mZdd	l
mZdd
l
mZddl
mZddlmZd
ZdZdZdZdZdZdZGdd�de
j�ZGdd�de
j�ZGdd�de�ZGdd�de�Z Gdd�de!�Z"Gdd�dej#�Z$Gdd �d ej%�Z&Gd!d"�d"�Z'Gd#d$�d$ej(�Z)e$Z*Gd%d&�d&ej+�Z,Gd'd(�d(ej+�Z-e-Z.dS))z.Selector and proactor event loops for Windows.�N�)�events)�base_subprocess)�futures)�
exceptions)�proactor_events)�selector_events)�tasks)�
windows_utils)�logger)�SelectorEventLoop�ProactorEventLoop�IocpProactor�DefaultEventLoopPolicy�WindowsSelectorEventLoopPolicy�WindowsProactorEventLoopPolicy���i�i�g����MbP?g�������?cs^eZdZdZdd��fdd�
Z�fdd�Zdd	�Z�fd
d�Z�fdd
�Z�fdd�Z	�Z
S)�_OverlappedFuturez�Subclass of Future which represents an overlapped operation.

    Cancelling it will immediately cancel the overlapped operation.
    N��loopcs&t�j|d�|jr|jd=||_dS�Nr���)�super�__init__�_source_traceback�_ov)�self�ovr��	__class__��./usr/lib64/python3.8/asyncio/windows_events.pyr1sz_OverlappedFuture.__init__csHt���}|jdk	rD|jjr dnd}|�dd|�d|jjd�d��|S)N�pendingZ	completedrzoverlapped=<z, �#x�>)r�
_repr_inforr"�insert�address�r�info�staterr r!r%7s


 z_OverlappedFuture._repr_infoc
Csr|jdkrdSz|j��WnJtk
rf}z,d||d�}|jrJ|j|d<|j�|�W5d}~XYnXd|_dS)Nz&Cancelling an overlapped future failed��message�	exception�future�source_traceback)r�cancel�OSErrorr�_loop�call_exception_handler)r�exc�contextr r r!�_cancel_overlapped>s
�
z$_OverlappedFuture._cancel_overlappedcs|��t���S�N)r6rr0�rrr r!r0Nsz_OverlappedFuture.cancelcst��|�|��dSr7)r�
set_exceptionr6�rr-rr r!r9Rsz_OverlappedFuture.set_exceptioncst��|�d|_dSr7)r�
set_resultr�r�resultrr r!r;Vsz_OverlappedFuture.set_result)�__name__�
__module__�__qualname__�__doc__rr%r6r0r9r;�
__classcell__r r rr!r+srcsneZdZdZdd��fdd�
Zdd�Z�fdd	�Zd
d�Zdd
�Z�fdd�Z	�fdd�Z
�fdd�Z�ZS)�_BaseWaitHandleFuturez2Subclass of Future which represents a wait handle.Nrcs8t�j|d�|jr|jd=||_||_||_d|_dS)NrrT)rrrr�_handle�_wait_handle�_registered)rr�handle�wait_handlerrr r!r^sz_BaseWaitHandleFuture.__init__cCst�|jd�tjkS�Nr)�_winapiZWaitForSingleObjectrDZ
WAIT_OBJECT_0r8r r r!�_pollls�z_BaseWaitHandleFuture._pollcsdt���}|�d|jd���|jdk	rB|��r4dnd}|�|�|jdk	r`|�d|jd���|S)Nzhandle=r#ZsignaledZwaitingzwait_handle=)rr%�appendrDrKrEr(rr r!r%qs



z _BaseWaitHandleFuture._repr_infocCs
d|_dSr7)r�r�futr r r!�_unregister_wait_cb{sz)_BaseWaitHandleFuture._unregister_wait_cbc
Cs�|js
dSd|_|j}d|_zt�|�Wn`tk
r�}zB|jtjkrzd||d�}|jrd|j|d<|j�	|�WY�dSW5d}~XYnX|�
d�dS�NFz$Failed to unregister the wait handler+r/)rFrE�_overlappedZUnregisterWaitr1�winerror�ERROR_IO_PENDINGrr2r3rO�rrHr4r5r r r!�_unregister_wait�s$�
z&_BaseWaitHandleFuture._unregister_waitcs|��t���Sr7)rUrr0r8rr r!r0�sz_BaseWaitHandleFuture.cancelcs|��t��|�dSr7)rUrr9r:rr r!r9�sz#_BaseWaitHandleFuture.set_exceptioncs|��t��|�dSr7)rUrr;r<rr r!r;�sz _BaseWaitHandleFuture.set_result)
r>r?r@rArrKr%rOrUr0r9r;rBr r rr!rC[s
rCcsFeZdZdZdd��fdd�
Zdd�Z�fdd	�Z�fd
d�Z�ZS)�_WaitCancelFuturezoSubclass of Future which represents a wait for the cancellation of a
    _WaitHandleFuture using an event.
    Nrcst�j||||d�d|_dS)Nr)rr�_done_callback)rr�eventrHrrr r!r�sz_WaitCancelFuture.__init__cCstd��dS)Nz'_WaitCancelFuture must not be cancelled)�RuntimeErrorr8r r r!r0�sz_WaitCancelFuture.cancelcs$t��|�|jdk	r |�|�dSr7)rr;rWr<rr r!r;�s
z_WaitCancelFuture.set_resultcs$t��|�|jdk	r |�|�dSr7)rr9rWr:rr r!r9�s
z_WaitCancelFuture.set_exception)	r>r?r@rArr0r;r9rBr r rr!rV�s
rVcs6eZdZdd��fdd�
Z�fdd�Zdd�Z�ZS)	�_WaitHandleFutureNrcs<t�j||||d�||_d|_t�dddd�|_d|_dS)NrTF)rr�	_proactorZ_unregister_proactorrQZCreateEvent�_event�
_event_fut)rrrGrH�proactorrrr r!r�s
z_WaitHandleFuture.__init__csF|jdk	r"t�|j�d|_d|_|j�|j�d|_t��|�dSr7)	r\rJ�CloseHandler]r[�_unregisterrrrOrMrr r!rO�s
	z%_WaitHandleFuture._unregister_wait_cbc
Cs�|js
dSd|_|j}d|_zt�||j�Wn`tk
r�}zB|jtjkr~d||d�}|jrh|j|d<|j	�
|�WY�dSW5d}~XYnX|j�|j|j
�|_dSrP)rFrErQZUnregisterWaitExr\r1rRrSrr2r3r[�_wait_cancelrOr]rTr r r!rU�s(�

�z"_WaitHandleFuture._unregister_wait)r>r?r@rrOrUrBr r rr!rZ�srZc@s<eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZeZ	dS)
�
PipeServerzXClass representing a pipe server.

    This is much like a bound, listening socket.
    cCs,||_t��|_d|_d|_|�d�|_dS�NT)�_address�weakref�WeakSet�_free_instances�_pipe�_accept_pipe_future�_server_pipe_handle)rr'r r r!r�s

zPipeServer.__init__cCs|j|�d�}|_|S)NF)rhrj)r�tmpr r r!�_get_unconnected_pipesz PipeServer._get_unconnected_pipec
Csr|��rdStjtjB}|r&|tjO}t�|j|tjtjBtj	Btj
tjtjtj
tj�}t�|�}|j�|�|Sr7)�closedrJZPIPE_ACCESS_DUPLEXZFILE_FLAG_OVERLAPPEDZFILE_FLAG_FIRST_PIPE_INSTANCEZCreateNamedPiperdZPIPE_TYPE_MESSAGEZPIPE_READMODE_MESSAGEZ	PIPE_WAITZPIPE_UNLIMITED_INSTANCESr
ZBUFSIZEZNMPWAIT_WAIT_FOREVER�NULL�
PipeHandlerg�add)r�first�flags�h�piper r r!rjs(

��
zPipeServer._server_pipe_handlecCs
|jdkSr7)rdr8r r r!rmszPipeServer.closedcCsR|jdk	r|j��d|_|jdk	rN|jD]}|��q*d|_d|_|j��dSr7)rir0rdrg�closerh�clear)rrtr r r!rus




zPipeServer.closeN)
r>r?r@rArrlrjrmru�__del__r r r r!rb�s
rbc@seZdZdZdS)�_WindowsSelectorEventLoopz'Windows version of selector event loop.N)r>r?r@rAr r r r!rx,srxcsHeZdZdZd
�fdd�	Z�fdd�Zdd�Zd	d
�Zddd�Z�Z	S)r
z2Windows version of proactor event loop using IOCP.Ncs|dkrt�}t��|�dSr7)rrr)rr^rr r!r3szProactorEventLoop.__init__c	sXz|�|j�t���W5|jdk	rR|jj}|j��|dk	rL|j�|�d|_XdSr7)	Z_self_reading_futurerr0r[r`�	call_soonZ_loop_self_readingr�run_forever�rrrr r!rz8s

zProactorEventLoop.run_foreverc�s8|j�|�}|IdH}|�}|j||d|id�}||fS)N�addr��extra)r[�connect_pipe�_make_duplex_pipe_transport)r�protocol_factoryr'�frt�protocol�transr r r!�create_pipe_connectionKs
�z(ProactorEventLoop.create_pipe_connectionc�s.t���d�����fdd�	������gS)Nc
sd}zn|rN|��}�j�|����r4|��WdS��}�j||d�id����}|dkrdWdS�j�|�}Wn�t	k
r�}zF|r�|�
�dkr���d||d��|��n�jr�t
jd|dd�W5d}~XYn2tjk
r�|r�|��YnX|�_|���dS)	Nr|r}rzPipe accept failed)r,r-rtzAccept pipe failed on pipe %rT)�exc_info)r=rg�discardrmrur�rlr[�accept_piper1�filenor3Z_debugrZwarningr�CancelledErrorri�add_done_callback)r�rtr�r4�r'�loop_accept_piper�rZserverr r!r�VsH��
�z>ProactorEventLoop.start_serving_pipe.<locals>.loop_accept_pipe)N)rbry)rr�r'r r�r!�start_serving_pipeSs(
z$ProactorEventLoop.start_serving_pipec		�s�|��}
t||||||||f|
|d�|	��}z|
IdHWnDttfk
rT�Yn,tk
r~|��|��IdH�YnX|S)N)�waiterr~)�
create_future�_WindowsSubprocessTransport�
SystemExit�KeyboardInterrupt�
BaseExceptionruZ_wait)rr��args�shell�stdin�stdout�stderr�bufsizer~�kwargsr�Ztranspr r r!�_make_subprocess_transport�s*
���z,ProactorEventLoop._make_subprocess_transport)N)N)
r>r?r@rArrzr�r�r�rBr r rr!r
0s0�r
c@s�eZdZdZd;dd�Zdd�Zdd�Zd	d
�Zd<dd
�Zdd�Z	d=dd�Z
d>dd�Zd?dd�Zd@dd�Z
dAdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�ZdBd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�ZdCd3d4�Zd5d6�Zd7d8�Zd9d:�ZdS)Drz#Proactor implementation using IOCP.rcCsDd|_g|_t�tjtd|�|_i|_t�	�|_
g|_t�	�|_dSrI)
r2�_resultsrQ�CreateIoCompletionPort�INVALID_HANDLE_VALUErn�_iocp�_cachererfrF�
_unregistered�_stopped_serving)rZconcurrencyr r r!r�s�
zIocpProactor.__init__cCs|jdkrtd��dS)NzIocpProactor is closed)r�rYr8r r r!�
_check_closed�s
zIocpProactor._check_closedcCsFdt|j�dt|j�g}|jdkr0|�d�d|jjd�|�fS)Nzoverlapped#=%sz
result#=%srmz<%s %s>� )�lenr�r�r�rLrr>�join)rr)r r r!�__repr__�s�

zIocpProactor.__repr__cCs
||_dSr7)r2)rrr r r!�set_loop�szIocpProactor.set_loopNcCs |js|�|�|j}g|_|Sr7)r�rK)r�timeoutrkr r r!�select�s

zIocpProactor.selectcCs|j��}|�|�|Sr7)r2r�r;)r�valuerNr r r!�_result�s

zIocpProactor._resultrcCs~|�|�t�t�}z4t|tj�r6|�|��||�n|�|��|�Wnt	k
rf|�
d�YSXdd�}|�|||�S)N�c
SsRz
|��WStk
rL}z$|jtjtjfkr:t|j��n�W5d}~XYnXdSr7��	getresultr1rRrQZERROR_NETNAME_DELETEDZERROR_OPERATION_ABORTED�ConnectionResetErrorr��r��keyrr4r r r!�finish_recv�s
�z&IocpProactor.recv.<locals>.finish_recv)�_register_with_iocprQ�
Overlappedrn�
isinstance�socketZWSARecvr�ZReadFile�BrokenPipeErrorr��	_register�r�conn�nbytesrrrr�r r r!�recv�s


zIocpProactor.recvcCs~|�|�t�t�}z4t|tj�r6|�|��||�n|�|��|�Wnt	k
rf|�
d�YSXdd�}|�|||�S)Nrc
SsRz
|��WStk
rL}z$|jtjtjfkr:t|j��n�W5d}~XYnXdSr7r�r�r r r!r��s
�z+IocpProactor.recv_into.<locals>.finish_recv)r�rQr�rnr�r�ZWSARecvIntor�ZReadFileIntor�r�r�)rr��bufrrrr�r r r!�	recv_into�s


zIocpProactor.recv_intocCs`|�|�t�t�}z|�|��||�Wntk
rH|�d�YSXdd�}|�|||�S)N)r�Nc
SsRz
|��WStk
rL}z$|jtjtjfkr:t|j��n�W5d}~XYnXdSr7r�r�r r r!r��s
�z*IocpProactor.recvfrom.<locals>.finish_recv)	r�rQr�rnZWSARecvFromr�r�r�r�r�r r r!�recvfrom�s


zIocpProactor.recvfromcCs>|�|�t�t�}|�|��|||�dd�}|�|||�S)Nc
SsRz
|��WStk
rL}z$|jtjtjfkr:t|j��n�W5d}~XYnXdSr7r�r�r r r!�finish_sends
�z(IocpProactor.sendto.<locals>.finish_send)r�rQr�rnZ	WSASendTor�r�)rr�r�rrr|rr�r r r!�sendto�s



zIocpProactor.sendtocCsZ|�|�t�t�}t|tj�r4|�|��||�n|�|��|�dd�}|�	|||�S)Nc
SsRz
|��WStk
rL}z$|jtjtjfkr:t|j��n�W5d}~XYnXdSr7r�r�r r r!r�s
�z&IocpProactor.send.<locals>.finish_send)
r�rQr�rnr�r�ZWSASendr�Z	WriteFiler�)rr�r�rrrr�r r r!�sends


zIocpProactor.sendcsv|���|��j��t�t�}|����������fdd�}dd�}|�|�|�}||��}t	j
||jd�|S)NcsD|��t�d����}��tjtj|���	��
������fS)Nz@P)r��structZpackr��
setsockoptr��
SOL_SOCKETrQZSO_UPDATE_ACCEPT_CONTEXT�
settimeoutZ
gettimeoutZgetpeername)r�r�rr��r��listenerr r!�
finish_accept*s�z*IocpProactor.accept.<locals>.finish_acceptc�s4z|IdHWn tjk
r.|���YnXdSr7)rr�ru)r.r�r r r!�accept_coro3s
z(IocpProactor.accept.<locals>.accept_coror)r��_get_accept_socket�familyrQr�rnZAcceptExr�r�r	Z
ensure_futurer2)rr�rr�r�r.�coror r�r!�accept$s

	
zIocpProactor.acceptc
s��jtjkr4t����|�|j��}|�d�|S|�	��zt�
����j�WnBtk
r�}z$|j
tjkrt����ddkr��W5d}~XYnXt�t�}|����|��fdd�}|�|�|�S)Nrrcs|����tjtjd��SrI)r�r�r�r�rQZSO_UPDATE_CONNECT_CONTEXT�r�r�r�r�r r!�finish_connectVs�z,IocpProactor.connect.<locals>.finish_connect)�typer�Z
SOCK_DGRAMrQZ
WSAConnectr�r2r�r;r�Z	BindLocalr�r1rR�errnoZ	WSAEINVALZgetsocknamer�rnZ	ConnectExr�)rr�r'rN�err�r r�r!�connect@s"



zIocpProactor.connectc		Csb|�|�t�t�}|d@}|d?d@}|�|��t�|���|||dd�dd�}|�|||�S)Nr� rc
SsRz
|��WStk
rL}z$|jtjtjfkr:t|j��n�W5d}~XYnXdSr7r�r�r r r!�finish_sendfileis
�z.IocpProactor.sendfile.<locals>.finish_sendfile)	r�rQr�rnZTransmitFiler��msvcrtZ
get_osfhandler�)	rZsock�file�offset�countrZ
offset_lowZoffset_highr�r r r!�sendfile_s


�	zIocpProactor.sendfilecsJ|���t�t�}|�����}|r0|���S�fdd�}|�|�|�S)Ncs|���Sr7)r�r��rtr r!�finish_accept_pipesz4IocpProactor.accept_pipe.<locals>.finish_accept_pipe)r�rQr�rnZConnectNamedPiper�r�r�)rrtrZ	connectedr�r r�r!r�ts


zIocpProactor.accept_pipec
�srt}zt�|�}WqhWn0tk
rF}z|jtjkr6�W5d}~XYnXt|dt�}t�	|�IdHqt
�|�S)N�)�CONNECT_PIPE_INIT_DELAYrQZConnectPiper1rRZERROR_PIPE_BUSY�min�CONNECT_PIPE_MAX_DELAYr	�sleepr
ro)rr'ZdelayrGr4r r r!r�s
zIocpProactor.connect_pipecCs|�||d�S)z�Wait for a handle.

        Return a Future object. The result of the future is True if the wait
        completed, or False if the wait did not complete (on timeout).
        F)�_wait_for_handle)rrGr�r r r!�wait_for_handle�szIocpProactor.wait_for_handlecCs|�|dd�}||_|Src)r�rW)rrXZ
done_callbackrNr r r!ra�szIocpProactor._wait_cancelcs�|��|dkrtj}nt�|d�}t�t�}t�||j	|j
|�}|r\t||||jd��nt
|||||jd���jr~�jd=�fdd�}�|d|f|j|j
<�S)N�@�@rrcs���Sr7)rKr��r�r r!�finish_wait_for_handle�sz=IocpProactor._wait_for_handle.<locals>.finish_wait_for_handler)r�rJ�INFINITE�math�ceilrQr�rnZRegisterWaitWithQueuer�r'rVr2rZrr�)rrGr�Z
_is_cancel�msrrHr�r r�r!r��s*
�
�	zIocpProactor._wait_for_handlecCs0||jkr,|j�|�t�|��|jdd�dSrI)rFrprQr�r�r��r�objr r r!r��s
z IocpProactor._register_with_iocpc
Cs�|��t||jd�}|jr$|jd=|jsrz|dd|�}Wn,tk
rf}z|�|�W5d}~XYnX|�|�||||f|j|j	<|Sr)
r�rr2rr"r1r9r;r�r')rrr��callbackr�r�r�r r r!r��s

zIocpProactor._registercCs|��|j�|�dS)a
Unregister an overlapped object.

        Call this method when its future has been cancelled. The event can
        already be signalled (pending in the proactor event queue). It is also
        safe if the event is never signalled (because it was cancelled).
        N)r�r�rLr{r r r!r`�szIocpProactor._unregistercCst�|�}|�d�|SrI)r�r�)rr��sr r r!r��s

zIocpProactor._get_accept_socketcCs�|dkrt}n0|dkr td��nt�|d�}|tkr>td��t�|j|�}|dkrX�qZd}|\}}}}z|j�|�\}}	}
}WnXt	k
r�|j
��r�|j
�dd||||fd��|dtj
fkr�t�|�Yq>YnX|
|jkr�|��q>|��s>z||||	�}Wn:tk
�r@}
z|�|
�|j�|�W5d}
~
XYq>X|�|�|j�|�q>|jD]}	|j�|	jd��q`|j��dS)Nrznegative timeoutr�ztimeout too bigz8GetQueuedCompletionStatus() returned an unexpected eventz)err=%s transferred=%s key=%#x address=%#x)r,�status)r��
ValueErrorr�r�rQZGetQueuedCompletionStatusr�r��pop�KeyErrorr2Z	get_debugr3r�rJr_r�r0Zdoner1r9r�rLr;r�r'rv)rr�r�r��errZtransferredr�r'r�rr�r�r�r�r r r!rKsL


��	






zIocpProactor._pollcCs|j�|�dSr7)r�rpr�r r r!�
_stop_serving9szIocpProactor._stop_servingcCs|jdkrdSt|j���D]�\}\}}}}|��r6qt|t�rBqz|��Wqtk
r�}z6|j	dk	r�d||d�}|j
r�|j
|d<|j	�|�W5d}~XYqXqd}t�
�}	|	|}
|jr�|
t�
�kr�t�d|t�
�|	�t�
�|}
|�|�q�g|_t�|j�d|_dS)NzCancelling a future failedr+r/g�?z,%r is running after closing for %.1f seconds)r��listr��itemsZ	cancelledr�rVr0r1r2rr3�time�	monotonicr�debugrKr�rJr_)rr'rNrr�r�r4r5Z
msg_updateZ
start_timeZnext_msgr r r!ru?s@


�
 
�zIocpProactor.closecCs|��dSr7)rur8r r r!rwnszIocpProactor.__del__)r)N)r)r)r)rN)r)N)N)r>r?r@rArr�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�rar�r�r�r`r�rKr�rurwr r r r!r�s8








"
 

7/rc@seZdZdd�ZdS)r�c
sPtj|f|||||d�|���_�fdd�}�jj�t�jj��}	|	�|�dS)N)r�r�r�r�r�cs�j��}��|�dSr7)�_procZpollZ_process_exited)r��
returncoder8r r!r�ys
z4_WindowsSubprocessTransport._start.<locals>.callback)	r
�Popenr�r2r[r��intrDr�)
rr�r�r�r�r�r�r�r�r�r r8r!�_startts���z"_WindowsSubprocessTransport._startN)r>r?r@rr r r r!r�rsr�c@seZdZeZdS)rN)r>r?r@r�
_loop_factoryr r r r!r�src@seZdZeZdS)rN)r>r?r@r
rr r r r!r�sr)/rArQrJr�r�r�r�r�r�re�rrrrrrr	r
�logr�__all__rnr�ZERROR_CONNECTION_REFUSEDZERROR_CONNECTION_ABORTEDr�r�ZFuturerrCrVrZ�objectrbZBaseSelectorEventLooprxZBaseProactorEventLoopr
rZBaseSubprocessTransportr�rZBaseDefaultEventLoopPolicyrrrr r r r!�<module>sR0J4;e`asyncio/__pycache__/coroutines.cpython-38.pyc000064400000015000151153537520015246 0ustar00U

e5d]"�@s�dZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddl
mZddl
m
Z
ddlmZdd	�Ze�ZGd
d�d�Zdd
�Ze�Zdd�ZejejejjefZe�Zdd�Zdd�ZdS))�	coroutine�iscoroutinefunction�iscoroutine�N�)�base_futures)�	constants)�format_helpers)�loggercCs"tjjp tjjo ttj�d��S)NZPYTHONASYNCIODEBUG)�sys�flags�dev_mode�ignore_environment�bool�os�environ�get�rr�*/usr/lib64/python3.8/asyncio/coroutines.py�_is_debug_modes�rc@s�eZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zddd
�Zdd�Z	e
dd��Ze
dd��Ze
dd��Z
dd�Ze
dd��Zdd�ZdS)�CoroWrapperNcCsZt�|�st�|�st|��||_||_t�t�	d��|_
t|dd�|_t|dd�|_
dS)Nr�__name__�__qualname__)�inspect�isgeneratorr�AssertionError�gen�funcr�
extract_stackr
�	_getframe�_source_traceback�getattrrr)�selfrrrrr�__init__'szCoroWrapper.__init__cCsJt|�}|jr4|jd}|d|d�d|d��7}d|jj�d|�d�S)	N���z
, created at r�:r�<� �>)�_format_coroutiner�	__class__r)r!�	coro_repr�framerrr�__repr__/s

zCoroWrapper.__repr__cCs|S�Nr�r!rrr�__iter__7szCoroWrapper.__iter__cCs|j�d�Sr-�r�sendr.rrr�__next__:szCoroWrapper.__next__cCs|j�|�Sr-r0)r!�valuerrrr1=szCoroWrapper.sendcCs|j�|||�Sr-)r�throw)r!�typer3�	tracebackrrrr4@szCoroWrapper.throwcCs
|j��Sr-)r�closer.rrrr7CszCoroWrapper.closecCs|jjSr-)r�gi_framer.rrrr8FszCoroWrapper.gi_framecCs|jjSr-)r�
gi_runningr.rrrr9JszCoroWrapper.gi_runningcCs|jjSr-)r�gi_coder.rrrr:NszCoroWrapper.gi_codecCs|Sr-rr.rrr�	__await__RszCoroWrapper.__await__cCs|jjSr-)r�gi_yieldfromr.rrrr<UszCoroWrapper.gi_yieldfromcCs�t|dd�}t|dd�}|dk	r||jdkr||�d�}t|dd�}|rrd�t�|��}|dtj�d	�7}||��7}t�	|�dS)
Nrr8r#z was never yielded fromrr�zB
Coroutine object created at (most recent call last, truncated to z last lines):
)
r �f_lasti�joinr6�format_listrZDEBUG_STACK_DEPTH�rstripr	�error)r!rr+�msg�tbrrr�__del__Ys
zCoroWrapper.__del__)N)NN)r�
__module__rr"r,r/r2r1r4r7�propertyr8r9r:r;r<rErrrrr$s"





rcsztjdtdd�t���r�St���r.��nt����fdd���t�	���t
sX�}nt�����fdd��}t|_|S)z�Decorator to mark coroutines.

    If the coroutine is not yielded from before it is destroyed,
    an error message is logged.
    zN"@coroutine" decorator is deprecated since Python 3.8, use "async def" instead�)�
stacklevelc?sr�||�}t�|�s(t�|�s(t|t�r4|EdH}n:z
|j}Wntk
rRYnXt|tj	j
�rn|�EdH}|Sr-)rZisfuturerr�
isinstancerr;�AttributeError�collections�abc�	Awaitable)�args�kw�resZ
await_meth�rrr�corozs
�
zcoroutine.<locals>.corocs@t�||��d�}|jr |jd=t�dd�|_t�dd�|_|S)NrRr#rr)rrr rr)rO�kwds�w�rSrrr�wrapper�szcoroutine.<locals>.wrapper)�warnings�warn�DeprecationWarningrr�isgeneratorfunction�	functools�wraps�typesr�_DEBUG�
_is_coroutine)rrWrrVrris"�


rcCst�|�pt|dd�tkS)z6Return True if func is a decorated coroutine function.r`N)rrr r`rRrrrr�s
�rcCs@t|�tkrdSt|t�r8tt�dkr4t�t|��dSdSdS)z)Return True if obj is a coroutine object.T�dFN)r5�_iscoroutine_typecacherJ�_COROUTINE_TYPES�len�add)�objrrrr�s
rc
stt|�st�t|t���fdd�}dd�}d}t|d�rF|jrF|j}nt|d�r\|jr\|j}||�}|s~||�rz|�d�S|Sd}t|d�r�|jr�|j}nt|d	�r�|jr�|j}|j	p�d
}d}��r0|j
dk	�r0t�|j
��s0t
�|j
�}|dk	r�|\}}|dk�r|�d|�d
|��}	n|�d|�d
|��}	n@|dk	�rV|j}|�d|�d
|��}	n|j}|�d|�d
|��}	|	S)Ncs`�rt�|jdi�St|d�r,|jr,|j}n*t|d�rD|jrD|j}ndt|�j�d�}|�d�S)Nrrrr%z without __name__>z())rZ_format_callbackr�hasattrrrr5)rS�	coro_name�Zis_corowrapperrr�get_name�sz#_format_coroutine.<locals>.get_namecSsHz|jWStk
rBz|jWYStk
r<YYdSXYnXdS)NF)�
cr_runningrKr9)rSrrr�
is_running�sz%_format_coroutine.<locals>.is_running�cr_coder:z runningr8�cr_framez<empty co_filename>rz done, defined at r$z running, defined at z running at )rrrJrrgrmr:r8rn�co_filenamerrr[rZ_get_function_source�f_lineno�co_firstlineno)
rSrjrlZ	coro_coderhZ
coro_frame�filename�lineno�sourcer*rrirr(�sL
	

�
�

r() �__all__Zcollections.abcrLr\rrr
r6r^rXr=rrr�logr	rr_rr�objectr`r�
CoroutineType�
GeneratorTyperM�	Coroutinerc�setrbrr(rrrr�<module>s2E8�asyncio/__pycache__/proactor_events.cpython-38.opt-1.pyc000064400000056475151153537520017255 0ustar00U

e5d<}�@sTdZdZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddl	mZddl	mZddl	m
Z
dd	l	mZdd
l	mZddl	mZddl	mZdd
lmZdd�ZGdd�dejej�ZGdd�deej�ZGdd�deej�ZGdd�de�ZGdd�de�ZGdd�deeej�ZGdd�deeej�Z Gdd�de
j!�Z"dS) z�Event loop using a proactor and related classes.

A proactor is a "notify-on-completion" multiplexer.  Currently a
proactor is only implemented on Windows with IOCP.
)�BaseProactorEventLoop�N�)�base_events)�	constants)�futures)�
exceptions)�	protocols)�sslproto)�
transports)�trsock)�loggercCs�t�|�|jd<z|��|jd<Wn0tjk
rR|j��rNtj	d|dd�YnXd|jkr�z|�
�|jd<Wn tjk
r�d|jd<YnXdS)N�socketZsocknamezgetsockname() failed on %rT��exc_info�peername)r�TransportSocket�_extraZgetsocknamer
�error�_loop�	get_debugr�warningZgetpeername)�	transport�sock�r�//usr/lib64/python3.8/asyncio/proactor_events.py�_set_socket_extras
�
rcs�eZdZdZd�fdd�	Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
ejfdd�Z
ddd�Zdd�Zdd�Zdd�Z�ZS)�_ProactorBasePipeTransportz*Base class for pipe and socket transports.Ncs�t��||�|�|�||_|�|�||_d|_d|_d|_d|_	d|_
d|_d|_|jdk	rl|j�
�|j�|jj|�|dk	r�|j�tj|d�dS)NrF)�super�__init__�
_set_extra�_sock�set_protocol�_server�_buffer�	_read_fut�
_write_fut�_pending_write�
_conn_lost�_closing�_eof_writtenZ_attachr�	call_soon�	_protocolZconnection_maderZ_set_result_unless_cancelled��self�loopr�protocol�waiter�extra�server��	__class__rrr2s(




�z#_ProactorBasePipeTransport.__init__cCs�|jjg}|jdkr |�d�n|jr0|�d�|jdk	rP|�d|j�����|jdk	rl|�d|j���|jdk	r�|�d|j���|jr�|�dt	|j����|j
r�|�d�d�d	�|��S)
N�closed�closingzfd=zread=zwrite=zwrite_bufsize=zEOF writtenz<{}>� )
r4�__name__r �appendr(�filenor$r%r#�lenr)�format�join)r-�inforrr�__repr__Hs 






z#_ProactorBasePipeTransport.__repr__cCs||jd<dS)N�pipe)r�r-rrrrrZsz%_ProactorBasePipeTransport._set_extracCs
||_dS�N�r+)r-r/rrrr!]sz'_ProactorBasePipeTransport.set_protocolcCs|jSrBrC�r-rrr�get_protocol`sz'_ProactorBasePipeTransport.get_protocolcCs|jSrB)r(rDrrr�
is_closingcsz%_ProactorBasePipeTransport.is_closingcCs\|jr
dSd|_|jd7_|js>|jdkr>|j�|jd�|jdk	rX|j��d|_dS)NTr)	r(r'r#r%rr*�_call_connection_lostr$�cancelrDrrr�closefs

z _ProactorBasePipeTransport.closecCs*|jdk	r&|d|��t|d�|��dS)Nzunclosed transport )�source)r �ResourceWarningrI)r-Z_warnrrr�__del__qs
z"_ProactorBasePipeTransport.__del__�Fatal error on pipe transportc	CsVzDt|t�r*|j��rBtjd||dd�n|j�||||jd��W5|�|�XdS)Nz%r: %sTr)�message�	exceptionrr/)	�_force_close�
isinstance�OSErrorrrr�debug�call_exception_handlerr+)r-�excrNrrr�_fatal_errorvs

�z'_ProactorBasePipeTransport._fatal_errorcCs�|jdk	r6|j��s6|dkr*|j�d�n|j�|�|jr@dSd|_|jd7_|jrj|j��d|_|jr�|j��d|_d|_	d|_
|j�|j
|�dS)NTrr)�
_empty_waiter�done�
set_resultZ
set_exceptionr(r'r%rHr$r&r#rr*rG)r-rUrrrrP�s"

z'_ProactorBasePipeTransport._force_closec	Cs^z|j�	|�W5t|jd�r,|j�tj�|j��d|_|j}|dk	rX|��d|_XdS)N�shutdown)
�hasattrr rZr
Z	SHUT_RDWRrIr"Z_detachr+Zconnection_lost)r-rUr2rrrrG�s
z0_ProactorBasePipeTransport._call_connection_lostcCs"|j}|jdk	r|t|j�7}|SrB)r&r#r;)r-�sizerrr�get_write_buffer_size�s
z0_ProactorBasePipeTransport.get_write_buffer_size)NNN)rM)r8�
__module__�__qualname__�__doc__rr?rr!rErFrI�warnings�warnrLrVrPrGr]�
__classcell__rrr3rr.s �
rcsTeZdZdZd�fdd�	Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	ddd�Z
�ZS)�_ProactorReadPipeTransportzTransport for read pipes.Ncs:d|_d|_t��||||||�|j�|j�d|_dS)NTF)�
_pending_data�_pausedrrrr*�
_loop_readingr,r3rrr�s
z#_ProactorReadPipeTransport.__init__cCs|jo|jSrB)rfr(rDrrr�
is_reading�sz%_ProactorReadPipeTransport.is_readingcCs0|js|jrdSd|_|j��r,t�d|�dS)NTz%r pauses reading)r(rfrrrrSrDrrr�
pause_reading�s

z(_ProactorReadPipeTransport.pause_readingcCsn|js|jsdSd|_|jdkr0|j�|jd�|j}d|_|dk	rT|j�|j|�|j��rjt	�
d|�dS)NFz%r resumes reading)r(rfr$rr*rgre�_data_receivedrrrS�r-�datarrr�resume_reading�s

z)_ProactorReadPipeTransport.resume_readingc
Cs�|j��rt�d|�z|j��}WnLttfk
r>�Yn4tk
rp}z|�	|d�WY�dSd}~XYnX|s~|�
�dS)Nz%r received EOFz1Fatal error: protocol.eof_received() call failed.)rrrrSr+Zeof_received�
SystemExit�KeyboardInterrupt�
BaseExceptionrVrI)r-Z	keep_openrUrrr�
_eof_received�s
�z(_ProactorReadPipeTransport._eof_receivedc
Cs�|jr||_dS|s |��dSt|jtj�r�zt�|j|�Wq�tt	fk
rZ�Yq�t
k
r�}z|�|d�WY�dSd}~XYq�Xn|j�|�dS)Nz3Fatal error: protocol.buffer_updated() call failed.)
rfrerqrQr+rZBufferedProtocolZ_feed_data_to_buffered_protornrorprVZ
data_received)r-rlrUrrrrj�s"�z)_ProactorReadPipeTransport._data_receivedc
Cstd}�zRzp|dk	r2d|_|��r*|��}n|��|jrHd}WW��dS|dkr\WW��dS|jsv|jj�	|j
d�|_Wn�tk
r�}z0|js�|�|d�n|j�
�r�tjddd�W5d}~XYn�tk
r�}z|�|�W5d}~XYnftk
�r}z|�|d�W5d}~XYn8tjk
�r>|j�s:�YnX|j�sV|j�|j�W5|dk	�rn|�|�XdS)N�i�z"Fatal read error on pipe transportz*Read error on pipe transport while closingTr)rjr$rX�resultrHr(rfr�	_proactor�recvr �ConnectionAbortedErrorrVrrrS�ConnectionResetErrorrPrRr�CancelledError�add_done_callbackrg)r-�futrlrUrrrrgs@

�
z(_ProactorReadPipeTransport._loop_reading)NNN)N)r8r^r_r`rrhrirmrqrjrgrcrrr3rrd�s�	rdcs^eZdZdZdZ�fdd�Zdd�Zddd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Z�Z
S)�_ProactorBaseWritePipeTransportzTransport for write pipes.Tcst�j||�d|_dSrB)rrrW�r-�args�kwr3rrrGsz(_ProactorBaseWritePipeTransport.__init__cCs�t|tttf�s$tdt|�j����|jr2td��|j	dk	rDtd��|sLdS|j
rz|j
tjkrht
�d�|j
d7_
dS|jdkr�|jt|�d�n.|js�t|�|_|��n|j�|�|��dS)Nz/data argument must be a bytes-like object, not zwrite_eof() already calledz(unable to write; sendfile is in progresszsocket.send() raised exception.r)rl)rQ�bytes�	bytearray�
memoryview�	TypeError�typer8r)�RuntimeErrorrWr'r�!LOG_THRESHOLD_FOR_CONNLOST_WRITESrrr%�
_loop_writingr#�_maybe_pause_protocol�extendrkrrr�writeKs,�




z%_ProactorBaseWritePipeTransport.writeNc
CsVz�|dk	r |jdkr |jr WdSd|_d|_|r8|��|dkrL|j}d|_|s�|jrf|j�|jd�|jrz|j	�
tj�|�
�nN|jj�|j	|�|_|j��s�t|�|_|j�|j�|��n|j�|j�|jdk	r�|jdkr�|j�d�Wn\tk
�r"}z|�|�W5d}~XYn0tk
�rP}z|�|d�W5d}~XYnXdS)Nrz#Fatal write error on pipe transport)r%r(r&rsr#rr*rGr)r rZr
�SHUT_WR�_maybe_resume_protocolrt�sendrXr;ryr�r�rWrYrwrPrRrV)r-�frlrUrrrr�qs8



z-_ProactorBaseWritePipeTransport._loop_writingcCsdS�NTrrDrrr�
can_write_eof�sz-_ProactorBaseWritePipeTransport.can_write_eofcCs|��dSrB)rIrDrrr�	write_eof�sz)_ProactorBaseWritePipeTransport.write_eofcCs|�d�dSrB�rPrDrrr�abort�sz%_ProactorBaseWritePipeTransport.abortcCs:|jdk	rtd��|j��|_|jdkr4|j�d�|jS)NzEmpty waiter is already set)rWr�rZ
create_futurer%rYrDrrr�_make_empty_waiter�s

z2_ProactorBaseWritePipeTransport._make_empty_waitercCs
d|_dSrB)rWrDrrr�_reset_empty_waiter�sz3_ProactorBaseWritePipeTransport._reset_empty_waiter)NN)r8r^r_r`Z_start_tls_compatiblerr�r�r�r�r�r�r�rcrrr3rr{As&
)r{cs$eZdZ�fdd�Zdd�Z�ZS)�_ProactorWritePipeTransportcs4t�j||�|jj�|jd�|_|j�|j�dS)N�)	rrrrtrur r$ry�_pipe_closedr|r3rrr�sz$_ProactorWritePipeTransport.__init__cCs@|��rdS|jrdSd|_|jdk	r4|�t��n|��dSrB)Z	cancelledr(r$r%rP�BrokenPipeErrorrI)r-rzrrrr��s
z(_ProactorWritePipeTransport._pipe_closed)r8r^r_rr�rcrrr3rr��sr�csXeZdZdZd�fdd�	Zdd�Zdd�Zd	d
�Zddd�Zdd
d�Z	ddd�Z
�ZS)�_ProactorDatagramTransportiNcs>||_d|_t�j|||||d�t��|_|j�|j	�dS)N)r0r1)
�_addressrWrr�collections�dequer#rr*rg)r-r.rr/�addressr0r1r3rrr�s

z#_ProactorDatagramTransport.__init__cCst||�dSrB�rrArrrr�sz%_ProactorDatagramTransport._set_extracCstdd�|jD��S)Ncss|]\}}t|�VqdSrB)r;)�.0rl�_rrr�	<genexpr>�szC_ProactorDatagramTransport.get_write_buffer_size.<locals>.<genexpr>)�sumr#rDrrrr]�sz0_ProactorDatagramTransport.get_write_buffer_sizecCs|�d�dSrBr�rDrrrr��sz _ProactorDatagramTransport.abortcCs�t|tttf�stdt|���|s&dS|jdk	rN|d|jfkrNtd|j����|jr�|jr�|jt	j
krpt�d�|jd7_dS|j
�t|�|f�|jdkr�|��|��dS)Nz,data argument must be bytes-like object (%r)z!Invalid address: must be None or z!socket.sendto() raised exception.r)rQrr�r�r�r�r��
ValueErrorr'rr�rrr#r9r%r�r�)r-rl�addrrrr�sendto�s&�
�

z!_ProactorDatagramTransport.sendtoc
Csz�|jrWdSd|_|r |��|jr2|jrN|jrN|jrH|j�|jd�WdS|j�	�\}}|jdk	r||jj
�|j|�|_n|jj
j
|j||d�|_WnZtk
r�}z|j�|�W5d}~XYnDtk
r�}z|�|d�W5d}~XYnX|j�|j�|��dS)N)r�z'Fatal write error on datagram transport)r'r%rsr#r�r(rr*rG�popleftrtr�r r�rRr+�error_received�	ExceptionrVryr�r�)r-rzrlr�rUrrrr��s2
��z(_ProactorDatagramTransport._loop_writingc
Cs4d}�zz�|jrWW��dSd|_|dk	rf|��}|jrFd}WW��dS|jdk	r^||j}}n|\}}|jrvWW��dS|jdk	r�|jj�	|j
|j�|_n|jj�|j
|j�|_WnJt
k
r�}z|j�|�W5d}~XYn8tjk
r�|js��YnX|jdk	�r|j�|j�W5|�r.|j�||�XdSrB)r+Zdatagram_receivedr'r$rsr(r�rrtrur �max_sizeZrecvfromrRr�rrxryrg)r-rzrlr��resrUrrrrgs>



��
z(_ProactorDatagramTransport._loop_reading)NNN)N)N)N)r8r^r_r�rrr]r�r�r�rgrcrrr3rr��s�

!r�c@s eZdZdZdd�Zdd�ZdS)�_ProactorDuplexPipeTransportzTransport for duplex pipes.cCsdS)NFrrDrrrr�Jsz*_ProactorDuplexPipeTransport.can_write_eofcCst�dSrB)�NotImplementedErrorrDrrrr�Msz&_ProactorDuplexPipeTransport.write_eofN)r8r^r_r`r�r�rrrrr�Esr�csBeZdZdZejjZd�fdd�	Zdd�Z	dd�Z
d	d
�Z�ZS)�_ProactorSocketTransportz Transport for connected sockets.Ncs$t��||||||�t�|�dSrB)rrrZ_set_nodelayr,r3rrrXsz!_ProactorSocketTransport.__init__cCst||�dSrBr�rArrrr]sz#_ProactorSocketTransport._set_extracCsdSr�rrDrrrr�`sz&_ProactorSocketTransport.can_write_eofcCs2|js|jrdSd|_|jdkr.|j�tj�dSr�)r(r)r%r rZr
r�rDrrrr�cs

z"_ProactorSocketTransport.write_eof)NNN)
r8r^r_r`rZ
_SendfileModeZ
TRY_NATIVEZ_sendfile_compatiblerrr�r�rcrrr3rr�Qs�r�cs�eZdZ�fdd�Zd3dd�Zd4dddddd�dd	�Zd5d
d�Zd6dd
�Zd7dd�Zd8dd�Z	�fdd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd9d&d'�Zd(d)�Zd:d+d,�Zd-d.�Zd/d0�Zd1d2�Z�ZS);rcsht���t�d|jj�||_||_d|_i|_	|�
|�|��t�
�t��krdt�|j���dS)NzUsing proactor: %s)rrrrSr4r8rt�	_selector�_self_reading_future�_accept_futuresZset_loop�_make_self_pipe�	threading�current_thread�main_thread�signal�
set_wakeup_fd�_csockr:)r-Zproactorr3rrrms

zBaseProactorEventLoop.__init__NcCst||||||�SrB)r�)r-rr/r0r1r2rrr�_make_socket_transportzs
�z,BaseProactorEventLoop._make_socket_transportF)�server_side�server_hostnamer1r2�ssl_handshake_timeoutc	Cs0tj|||||||	d�}
t|||
||d�|
jS)N)r��r1r2)r	ZSSLProtocolr�Z_app_transport)r-Zrawsockr/�
sslcontextr0r�r�r1r2r�Zssl_protocolrrr�_make_ssl_transports��z)BaseProactorEventLoop._make_ssl_transportcCst||||||�SrB)r�)r-rr/r�r0r1rrr�_make_datagram_transport�s
�z.BaseProactorEventLoop._make_datagram_transportcCst|||||�SrB)r��r-rr/r0r1rrr�_make_duplex_pipe_transport�s�z1BaseProactorEventLoop._make_duplex_pipe_transportcCst|||||�SrB)rdr�rrr�_make_read_pipe_transport�sz/BaseProactorEventLoop._make_read_pipe_transportcCst|||||�SrB)r�r�rrr�_make_write_pipe_transport�s�z0BaseProactorEventLoop._make_write_pipe_transportcsj|��rtd��|��rdSt��t��kr6t�d�|��|�	�|j
��d|_
d|_t
���dS)Nz!Cannot close a running event loop���)Z
is_runningr��	is_closedr�r�r�r�r��_stop_accept_futures�_close_self_pipertrIr�rrDr3rrrI�s

zBaseProactorEventLoop.closec�s|j�||�IdHSrB)rtru)r-r�nrrr�	sock_recv�szBaseProactorEventLoop.sock_recvc�s|j�||�IdHSrB)rtZ	recv_into)r-rZbufrrr�sock_recv_into�sz$BaseProactorEventLoop.sock_recv_intoc�s|j�||�IdHSrB)rtr�)r-rrlrrr�sock_sendall�sz"BaseProactorEventLoop.sock_sendallc�s|j�||�IdHSrB)rtZconnect)r-rr�rrr�sock_connect�sz"BaseProactorEventLoop.sock_connectc�s|j�|�IdHSrB)rt�acceptrArrr�sock_accept�sz!BaseProactorEventLoop.sock_acceptc
�s(z|��}Wn2ttjfk
r>}zt�d��W5d}~XYnXzt�|�j}Wn,t	k
r|}zt�d��W5d}~XYnX|r�|n|}|s�dSt
|d�}|r�t
|||�n|}	t
||�}d}
zLt
|	||�}|dkr�|
W�0S|j�
||||�IdH||7}|
|7}
q�W5|
dk�r"|�|�XdS)Nznot a regular filerl��)r:�AttributeError�io�UnsupportedOperationrZSendfileNotAvailableError�os�fstat�st_sizerR�min�seekrt�sendfile)r-r�file�offset�countr:�errZfsizeZ	blocksizeZend_posZ
total_sentrrr�_sock_sendfile_native�s0


z+BaseProactorEventLoop._sock_sendfile_nativec�sZ|��}|��|��IdHz |j|j|||dd�IdHW�S|��|rT|��XdS)NF)Zfallback)rhrir�r�rmZ
sock_sendfiler )r-Ztranspr�r�r�rmrrr�_sendfile_native�s�z&BaseProactorEventLoop._sendfile_nativecCsL|jdk	r|j��d|_|j��d|_|j��d|_|jd8_dS)Nr)r�rH�_ssockrIr��
_internal_fdsrDrrrr��s



z&BaseProactorEventLoop._close_self_pipecCs:t��\|_|_|j�d�|j�d�|jd7_dS)NFr)r
Z
socketpairr�r�Zsetblockingr�rDrrrr��sz%BaseProactorEventLoop._make_self_pipec
Cs�z4|dk	r|��|j|k	r"WdS|j�|jd�}Wnbtjk
rLYdSttfk
rd�YnFt	k
r�}z|�
d||d��W5d}~XYnX||_|�|j�dS)Niz.Error on reading from the event loop self pipe)rNrOr.)
rsr�rtrur�rrxrnrorprTry�_loop_self_reading)r-r�rUrrrr��s$
�z(BaseProactorEventLoop._loop_self_readingcCsN|j}|dkrdSz|�d�Wn(tk
rH|jrDtjddd�YnXdS)N�z3Fail to write a null byte into the self-pipe socketTr)r�r�rR�_debugrrS)r-Zcsockrrr�_write_to_selfs�z$BaseProactorEventLoop._write_to_self�dcs(d�������fdd�	�����dS)Nc
s,z�|dk	rn|��\}}�jr,t�d�||���}�dk	rX�j||�dd|i��d�n�j||d|i�d����r|WdS�j���}Wn�t	k
r�}zH��
�dkrʈ�d|t�
��d�����n�jr�tjd	�dd
�W5d}~XYn8tjk
�r���YnX|�j��
�<|���dS)Nz#%r got a new connection from %r: %rTr)r�r1r2r�r�r�zAccept failed on a socket)rNrOr
zAccept failed on socket %rr)rsr�rrSr�r�r�rtr�rRr:rTrrrIrrxr�ry)r�Zconnr�r/rU�r.�protocol_factoryr-r2rr�r�rrr./s\����
�z2BaseProactorEventLoop._start_serving.<locals>.loop)N)r*)r-r�rr�r2Zbacklogr�rr�r�_start_serving+s%z$BaseProactorEventLoop._start_servingcCsdSrBr)r-Z
event_listrrr�_process_eventsVsz%BaseProactorEventLoop._process_eventscCs&|j��D]}|��q
|j��dSrB)r��valuesrH�clear)r-�futurerrrr�Zs
z*BaseProactorEventLoop._stop_accept_futurescCs6|j�|��d�}|r|��|j�|�|��dSrB)r��popr:rHrt�
_stop_servingrI)r-rr�rrrr�_s
z#BaseProactorEventLoop._stop_serving)NNN)N)NNN)NN)NN)NN)N)NNr�N)r8r^r_rr�r�r�r�r�r�rIr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rcrrr3rrks\
�
���
�
�
�


�
+r)#r`�__all__r�r�r
rar�r�r��rrrrrr	r
r�logrrZ_FlowControlMixinZ
BaseTransportrZ
ReadTransportrdZWriteTransportr{r�r�Z	Transportr�r�Z
BaseEventLooprrrrr�<module>sR���n��asyncio/__pycache__/exceptions.cpython-38.opt-1.pyc000064400000004767151153537520016216 0ustar00U

e5da�@sldZdZGdd�de�ZGdd�de�ZGdd�de�ZGdd	�d	e�ZGd
d�de	�Z
Gdd
�d
e�ZdS)zasyncio exceptions.)�CancelledError�InvalidStateError�TimeoutError�IncompleteReadError�LimitOverrunError�SendfileNotAvailableErrorc@seZdZdZdS)rz!The Future or Task was cancelled.N��__name__�
__module__�__qualname__�__doc__�rr�*/usr/lib64/python3.8/asyncio/exceptions.pyr	src@seZdZdZdS)rz*The operation exceeded the given deadline.Nrrrrr
r
src@seZdZdZdS)rz+The operation is not allowed in this state.Nrrrrr
rsrc@seZdZdZdS)rz~Sendfile syscall is not available.

    Raised if OS does not support sendfile syscall for given socket or
    file type.
    Nrrrrr
rsrcs(eZdZdZ�fdd�Zdd�Z�ZS)rz�
    Incomplete read error. Attributes:

    - partial: read bytes string before the end of stream was reached
    - expected: total number of expected bytes (or None if unknown)
    cs@|dkrdnt|�}t��t|��d|�d��||_||_dS)NZ	undefinedz bytes read on a total of z expected bytes)�repr�super�__init__�len�partial�expected)�selfrrZ
r_expected��	__class__rr
r$szIncompleteReadError.__init__cCst|�|j|jffS�N)�typerr�rrrr
�
__reduce__+szIncompleteReadError.__reduce__�rr	r
rrr�
__classcell__rrrr
rsrcs(eZdZdZ�fdd�Zdd�Z�ZS)rz�Reached the buffer limit while looking for a separator.

    Attributes:
    - consumed: total number of to be consumed bytes.
    cst��|�||_dSr)rr�consumed)r�messagerrrr
r5szLimitOverrunError.__init__cCst|�|jd|jffS)N�)r�argsrrrrr
r9szLimitOverrunError.__reduce__rrrrr
r/srN)r�__all__�
BaseExceptionr�	Exceptionrr�RuntimeErrorr�EOFErrorrrrrrr
�<module>sasyncio/__pycache__/log.cpython-38.pyc000064400000000344151153537520013642 0ustar00U

e5d|�@sdZddlZe�e�ZdS)zLogging configuration.�N)�__doc__ZloggingZ	getLogger�__package__Zlogger�rr�#/usr/lib64/python3.8/asyncio/log.py�<module>sasyncio/__pycache__/selector_events.cpython-38.opt-1.pyc000064400000071673151153537520017241 0ustar00U

e5dT��@s.dZdZddlZddlZddlZddlZddlZddlZddlZzddl	Z	Wne
k
rddZ	YnXddlmZddlm
Z
ddlmZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZdd�Zdd�ZGdd�dej�ZGdd�dejej�ZGdd�de�ZGdd�de�ZdS)z�Event loop using a selector and related classes.

A selector is a "notify-when-ready" multiplexer.  For a subclass which
also includes support for signal handling, see the unix_events sub-module.
)�BaseSelectorEventLoop�N�)�base_events)�	constants)�events)�futures)�	protocols)�sslproto)�
transports)�trsock)�loggercCs8z|�|�}Wntk
r$YdSXt|j|@�SdS�NF)�get_key�KeyError�boolr)�selector�fdZevent�key�r�//usr/lib64/python3.8/asyncio/selector_events.py�_test_selector_event s
rcCs tdk	rt|tj�rtd��dS)Nz"Socket cannot be of type SSLSocket)�ssl�
isinstanceZ	SSLSocket�	TypeError)�sockrrr�_check_ssl_socket+srcs�eZdZdZdS�fdd�	ZdTddd�dd�ZdUddddejd	�d
d�ZdVdd
�Z	�fdd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdddejfdd�Zdddejfdd�Zddejfdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dAdB�Z#dCdD�Z$dEdF�Z%dGdH�Z&dIdJ�Z'dKdL�Z(dMdN�Z)dOdP�Z*dQdR�Z+�Z,S)WrzJSelector event loop.

    See events.EventLoop for API specification.
    NcsFt���|dkrt��}t�d|jj�||_|�	�t
��|_dS)NzUsing selector: %s)
�super�__init__�	selectorsZDefaultSelectorr�debug�	__class__�__name__�	_selector�_make_self_pipe�weakrefZWeakValueDictionary�_transports)�selfr�r rrr6s
zBaseSelectorEventLoop.__init__��extra�servercCst||||||�S�N)�_SelectorSocketTransport)r&r�protocol�waiterr)r*rrr�_make_socket_transport@s
�z,BaseSelectorEventLoop._make_socket_transportF)�server_side�server_hostnamer)r*�ssl_handshake_timeoutc	Cs0tj|||||||	d�}
t|||
||d�|
jS)N)r2r()r	ZSSLProtocolr,Z_app_transport)r&Zrawsockr-�
sslcontextr.r0r1r)r*r2Zssl_protocolrrr�_make_ssl_transportEs��z)BaseSelectorEventLoop._make_ssl_transportcCst||||||�Sr+)�_SelectorDatagramTransport)r&rr-�addressr.r)rrr�_make_datagram_transportRs
�z.BaseSelectorEventLoop._make_datagram_transportcsL|��rtd��|��rdS|��t���|jdk	rH|j��d|_dS)Nz!Cannot close a running event loop)Z
is_running�RuntimeError�	is_closed�_close_self_piper�closer"�r&r'rrr;Ws


zBaseSelectorEventLoop.closecCsB|�|j���|j��d|_|j��d|_|jd8_dS)Nr)�_remove_reader�_ssock�filenor;�_csock�
_internal_fdsr<rrrr:bs

z&BaseSelectorEventLoop._close_self_pipecCsNt��\|_|_|j�d�|j�d�|jd7_|�|j��|j�dS)NFr)	�socketZ
socketpairr>r@�setblockingrA�_add_readerr?�_read_from_selfr<rrrr#js
z%BaseSelectorEventLoop._make_self_pipecCsdSr+r�r&�datarrr�_process_self_datarsz(BaseSelectorEventLoop._process_self_datacCsXz"|j�d�}|sWqT|�|�Wqtk
r:YqYqtk
rPYqTYqXqdS)Ni)r>�recvrH�InterruptedError�BlockingIOErrorrFrrrrEusz%BaseSelectorEventLoop._read_from_selfcCsN|j}|dkrdSz|�d�Wn(tk
rH|jrDtjddd�YnXdS)N�z3Fail to write a null byte into the self-pipe socketT��exc_info)r@�send�OSError�_debugrr)r&Zcsockrrr�_write_to_self�s�z$BaseSelectorEventLoop._write_to_self�dc
Cs"|�|��|j||||||�dSr+)rDr?�_accept_connection)r&�protocol_factoryrr3r*�backlogr2rrr�_start_serving�s�z$BaseSelectorEventLoop._start_servingc
Cst|�D]�}z0|��\}}	|jr0t�d||	|�|�d�Wn�tttfk
rZYdSt	k
r�}
zd|
j
t
jt
jt
j
t
jfkr�|�d|
t�|�d��|�|���|�tj|j||||||�n�W5d}
~
XYqXd|	i}|�||||||�}|�|�qdS)Nz#%r got a new connection from %r: %rFz&socket.accept() out of system resource)�message�	exceptionrB�peername)�range�acceptrQrrrCrKrJ�ConnectionAbortedErrorrP�errnoZEMFILEZENFILEZENOBUFSZENOMEM�call_exception_handlerr�TransportSocketr=r?Z
call_laterrZACCEPT_RETRY_DELAYrW�_accept_connection2Zcreate_task)
r&rUrr3r*rVr2�_�conn�addr�excr)r\rrrrT�sV�����z(BaseSelectorEventLoop._accept_connectionc
�s�d}d}zt|�}|��}	|r8|j||||	d|||d�}n|j|||	||d�}z|	IdHWntk
rx|���YnXWntttfk
r��Yn\tk
r�}
z>|jr�d|
d�}|dk	r�||d<|dk	r�||d<|�|�W5d}
~
XYnXdS)NT)r.r0r)r*r2)r.r)r*z3Error on transport creation for incoming connection)rXrYr-�	transport)	�
create_futurer4r/�
BaseExceptionr;�
SystemExit�KeyboardInterruptrQr_)r&rUrcr)r3r*r2r-rfr.re�contextrrrra�sP���z)BaseSelectorEventLoop._accept_connection2c
Cs�|}t|t�sJzt|���}Wn*tttfk
rHtd|���d�YnXz|j|}Wntk
rlYnX|��s�t	d|�d|����dS)NzInvalid file object: zFile descriptor z is used by transport )
r�intr?�AttributeErrorr�
ValueErrorr%r�
is_closingr8)r&rr?rfrrr�_ensure_fd_no_transport�s
�z-BaseSelectorEventLoop._ensure_fd_no_transportc		Gs�|��t�|||d�}z|j�|�}Wn*tk
rR|j�|tj|df�Yn>X|j|j	}\}}|j�
||tjB||f�|dk	r�|��dSr+)�
_check_closedr�Handler"rr�registerr�
EVENT_READrG�modify�cancel�	r&r�callback�argsZhandler�mask�reader�writerrrrrDs�
�z!BaseSelectorEventLoop._add_readercCs�|��rdSz|j�|�}Wntk
r2YdSX|j|j}\}}|tjM}|sd|j�|�n|j�	||d|f�|dk	r�|�
�dSdSdS�NFT)r9r"rrrrGrrt�
unregisterrurv�r&rrrzr{r|rrrr=sz$BaseSelectorEventLoop._remove_readerc		Gs�|��t�|||d�}z|j�|�}Wn*tk
rR|j�|tjd|f�Yn>X|j|j	}\}}|j�
||tjB||f�|dk	r�|��dSr+)rqrrrr"rrrsr�EVENT_WRITErGrurvrwrrr�_add_writer%s�
�z!BaseSelectorEventLoop._add_writercCs�|��rdSz|j�|�}Wntk
r2YdSX|j|j}\}}|tjM}|sd|j�|�n|j�	|||df�|dk	r�|�
�dSdSdS)�Remove a writer callback.FNT)r9r"rrrrGrr�r~rurvrrrr�_remove_writer4sz$BaseSelectorEventLoop._remove_writercGs|�|�|j||f|��S)zAdd a reader callback.)rprD�r&rrxryrrr�
add_readerKs
z BaseSelectorEventLoop.add_readercCs|�|�|�|�S)zRemove a reader callback.)rpr=�r&rrrr�
remove_readerPs
z#BaseSelectorEventLoop.remove_readercGs|�|�|j||f|��S)zAdd a writer callback..)rpr�r�rrr�
add_writerUs
z BaseSelectorEventLoop.add_writercCs|�|�|�|�S)r�)rpr�r�rrr�
remove_writerZs
z#BaseSelectorEventLoop.remove_writerc	�s�t|�|jr"|��dkr"td��z|�|�WSttfk
rFYnX|��}|��}|�	||j
|||�|�t�
|j|��|IdHS)z�Receive data from the socket.

        The return value is a bytes object representing the data received.
        The maximum amount of data to be received at once is specified by
        nbytes.
        r�the socket must be non-blockingN)rrQ�
gettimeoutrnrIrKrJrgr?r��
_sock_recv�add_done_callback�	functools�partial�_sock_read_done)r&r�n�futrrrr�	sock_recv_s�zBaseSelectorEventLoop.sock_recvcCs|�|�dSr+)r��r&rr�rrrr�tsz%BaseSelectorEventLoop._sock_read_donec
Cs�|��rdSz|�|�}Wn\ttfk
r4YdSttfk
rL�Yn6tk
rv}z|�|�W5d}~XYnX|�|�dSr+)	�donerIrKrJrirjrh�
set_exception�
set_result)r&r�rr�rGrerrrr�wsz BaseSelectorEventLoop._sock_recvc	�s�t|�|jr"|��dkr"td��z|�|�WSttfk
rFYnX|��}|��}|�	||j
|||�|�t�
|j|��|IdHS)z�Receive data from the socket.

        The received data is written into *buf* (a writable buffer).
        The return value is the number of bytes written.
        rr�N)rrQr�rn�	recv_intorKrJrgr?r��_sock_recv_intor�r�r�r�)r&r�bufr�rrrr�sock_recv_into�s�z$BaseSelectorEventLoop.sock_recv_intoc
Cs�|��rdSz|�|�}Wn\ttfk
r4YdSttfk
rL�Yn6tk
rv}z|�|�W5d}~XYnX|�|�dSr+)	r�r�rKrJrirjrhr�r�)r&r�rr��nbytesrerrrr��sz%BaseSelectorEventLoop._sock_recv_intoc	�s�t|�|jr"|��dkr"td��z|�|�}Wnttfk
rLd}YnX|t|�kr^dS|��}|�	�}|�
t�|j
|��|�||j||t|�|g�|IdHS)a�Send data to the socket.

        The socket must be connected to a remote socket. This method continues
        to send data from data until either all data has been sent or an
        error occurs. None is returned on success. On error, an exception is
        raised, and there is no way to determine how much data, if any, was
        successfully processed by the receiving end of the connection.
        rr�N)rrQr�rnrOrKrJ�lenrgr?r�r�r��_sock_write_doner��
_sock_sendall�
memoryview)r&rrGr�r�rrrr�sock_sendall�s&	
��z"BaseSelectorEventLoop.sock_sendallc
Cs�|��rdS|d}z|�||d��}Wnbttfk
rDYdSttfk
r\�Yn2tk
r�}z|�|�WY�dSd}~XYnX||7}|t|�kr�|�	d�n||d<dS)Nr)
r�rOrKrJrirjrhr�r�r�)r&r�rZview�pos�startr�rerrrr��s 
z#BaseSelectorEventLoop._sock_sendallc�s�t|�|jr"|��dkr"td��ttd�r8|jtjkrf|j||j|j	|d�IdH}|d\}}}}}|�
�}|�|||�|IdHS)zTConnect to a remote socket at address.

        This method is a coroutine.
        rr��AF_UNIX)�family�proto�loopN)rrQr�rn�hasattrrBr�r�Z_ensure_resolvedr�rg�
_sock_connect)r&rr6Zresolvedrbr�rrr�sock_connect�s�z"BaseSelectorEventLoop.sock_connectc
Cs�|��}z|�|�Wn�ttfk
rV|�t�|j|��|�||j	|||�YnNt
tfk
rn�Yn6tk
r�}z|�
|�W5d}~XYnX|�d�dSr+)r?ZconnectrKrJr�r�r�r�r��_sock_connect_cbrirjrhr�r�)r&r�rr6rrerrrr��s�z#BaseSelectorEventLoop._sock_connectcCs|�|�dSr+)r�r�rrrr�sz&BaseSelectorEventLoop._sock_write_donec
Cs�|��rdSz,|�tjtj�}|dkr6t|d|����WnZttfk
rPYnNtt	fk
rh�Yn6t
k
r�}z|�|�W5d}~XYnX|�d�dS)NrzConnect call failed )
r�Z
getsockoptrBZ
SOL_SOCKETZSO_ERRORrPrKrJrirjrhr�r�)r&r�rr6�errrerrrr�sz&BaseSelectorEventLoop._sock_connect_cbc�sBt|�|jr"|��dkr"td��|��}|�|d|�|IdHS)aWAccept a connection.

        The socket must be bound to an address and listening for connections.
        The return value is a pair (conn, address) where conn is a new socket
        object usable to send and receive data on the connection, and address
        is the address bound to the socket on the other end of the connection.
        rr�FN)rrQr�rnrg�_sock_accept)r&rr�rrr�sock_acceptsz!BaseSelectorEventLoop.sock_acceptc
Cs�|��}|r|�|�|��r"dSz|��\}}|�d�Wnnttfk
rh|�||j|d|�YnRt	t
fk
r��Yn:tk
r�}z|�|�W5d}~XYnX|�
||f�dSr})r?r�r�r\rCrKrJr�r�rirjrhr�r�)r&r�Z
registeredrrrcr6rerrrr�*s
z"BaseSelectorEventLoop._sock_acceptc	�sp|j|j=|��}|��|��IdHz |j|j|||dd�IdHW�S|��|r^|��||j|j<XdS)NF)Zfallback)	r%�_sock_fd�
is_reading�
pause_reading�_make_empty_waiter�_reset_empty_waiter�resume_readingZ
sock_sendfile�_sock)r&Ztransp�file�offset�countr�rrr�_sendfile_native<s
�z&BaseSelectorEventLoop._sendfile_nativecCs�|D]v\}}|j|j}\}}|tj@rL|dk	rL|jrB|�|�n
|�|�|tj@r|dk	r|jrp|�|�q|�|�qdSr+)	�fileobjrGrrtZ
_cancelledr=Z
_add_callbackr�r�)r&Z
event_listrrzr�r{r|rrr�_process_eventsJs
z%BaseSelectorEventLoop._process_eventscCs|�|���|��dSr+)r=r?r;)r&rrrr�
_stop_servingXsz#BaseSelectorEventLoop._stop_serving)N)N)N)NNN)-r!�
__module__�__qualname__�__doc__rr/rZSSL_HANDSHAKE_TIMEOUTr4r7r;r:r#rHrErRrWrTrarprDr=r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��
__classcell__rrr'rr0s~
����
�
	�
.�
)rcs�eZdZdZeZdZd�fdd�	Zdd�Zdd�Z	d	d
�Z
dd�Zd
d�Zdd�Z
ejfdd�Zddd�Zdd�Zdd�Zdd�Zdd�Z�ZS) �_SelectorTransportiNcs�t��||�t�|�|jd<z|��|jd<Wntk
rNd|jd<YnXd|jkr�z|��|jd<Wn tj	k
r�d|jd<YnX||_
|��|_d|_
|�|�||_|��|_d|_d|_|jdk	r�|j��||j|j<dS)NrBZsocknamerZFr)rrrr`�_extraZgetsocknamerPZgetpeernamerB�errorr�r?r��_protocol_connected�set_protocol�_server�_buffer_factory�_buffer�
_conn_lost�_closingZ_attachr%)r&r�rr-r)r*r'rrris,





z_SelectorTransport.__init__cCs�|jjg}|jdkr |�d�n|jr0|�d�|�d|j���|jdk	r�|j��s�t|jj	|jt
j�}|rz|�d�n
|�d�t|jj	|jt
j�}|r�d}nd}|�
�}|�d|�d	|�d
��d�d�|��S)
N�closed�closingzfd=zread=pollingz	read=idle�pollingZidlezwrite=<z
, bufsize=�>z<{}>� )r r!r��appendr�r��_loopr9rr"rrtr��get_write_buffer_size�format�join)r&�infor��state�bufsizerrr�__repr__�s0


�
�z_SelectorTransport.__repr__cCs|�d�dSr+)�_force_closer<rrr�abort�sz_SelectorTransport.abortcCs||_d|_dS�NT)�	_protocolr��r&r-rrrr��sz_SelectorTransport.set_protocolcCs|jSr+)r�r<rrr�get_protocol�sz_SelectorTransport.get_protocolcCs|jSr+)r�r<rrrro�sz_SelectorTransport.is_closingcCsT|jr
dSd|_|j�|j�|jsP|jd7_|j�|j�|j�|jd�dS�NTr)	r�r�r=r�r�r�r��	call_soon�_call_connection_lostr<rrrr;�sz_SelectorTransport.closecCs,|jdk	r(|d|��t|d�|j��dS)Nzunclosed transport )�source)r��ResourceWarningr;)r&Z_warnrrr�__del__�s
z_SelectorTransport.__del__�Fatal error on transportcCsNt|t�r(|j��r@tjd||dd�n|j�||||jd��|�|�dS)Nz%r: %sTrM)rXrYrfr-)	rrPr��	get_debugrrr_r�r�)r&rerXrrr�_fatal_error�s

�z_SelectorTransport._fatal_errorcCsd|jr
dS|jr(|j��|j�|j�|jsBd|_|j�|j�|jd7_|j�|j	|�dSr�)
r�r��clearr�r�r�r�r=r�r��r&rerrrr��s
z_SelectorTransport._force_closecCsVz|jr|j�|�W5|j��d|_d|_d|_|j}|dk	rP|��d|_XdSr+)r�r;r�r�r�Z_detachr�Zconnection_lost)r&rer*rrrr��s
z(_SelectorTransport._call_connection_lostcCs
t|j�Sr+)r�r�r<rrrr��sz(_SelectorTransport.get_write_buffer_sizecGs"|jr
dS|jj||f|��dSr+)r�r�rDr�rrrrD�sz_SelectorTransport._add_reader)NN)r�)r!r�r��max_size�	bytearrayr�r�rr�r�r�r�ror;�warnings�warnr�r�r�r�r�rDr�rrr'rr�]s 

r�cs�eZdZdZejjZd#�fdd�	Z�fdd�Z	dd�Z
d	d
�Zdd�Zd
d�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Z�fdd�Zdd �Zd!d"�Z�ZS)$r,TNcs~d|_t��|||||�d|_d|_d|_t�|j�|j	�
|jj|�|j	�
|j
|j|j�|dk	rz|j	�
tj|d�dSr
)�_read_ready_cbrr�_eof�_paused�
_empty_waiterrZ_set_nodelayr�r�r�r��connection_maderDr��_read_readyr�_set_result_unless_cancelled)r&r�rr-r.r)r*r'rrr�s 
�
�z!_SelectorSocketTransport.__init__cs.t|tj�r|j|_n|j|_t��|�dSr+)rrZBufferedProtocol�_read_ready__get_bufferr��_read_ready__data_receivedrr�r�r'rrr�	s
z%_SelectorSocketTransport.set_protocolcCs|jo|jSr+)r�r�r<rrrr�sz#_SelectorSocketTransport.is_readingcCs>|js|jrdSd|_|j�|j�|j��r:t�d|�dS)NTz%r pauses reading)r�r�r�r=r�r�rrr<rrrr�s
z&_SelectorSocketTransport.pause_readingcCs@|js|jsdSd|_|�|j|j�|j��r<t�d|�dS)NFz%r resumes reading)	r�r�rDr�r�r�r�rrr<rrrr�s
z'_SelectorSocketTransport.resume_readingcCs|��dSr+)r�r<rrrr�$sz$_SelectorSocketTransport._read_readyc
Cs`|jr
dSz |j�d�}t|�s(td��WnLttfk
rD�Yn4tk
rv}z|�|d�WY�dSd}~XYnXz|j	�
|�}Wndttfk
r�YdSttfk
r��Yn4tk
r�}z|�|d�WY�dSd}~XYnX|�s|�
�dSz|j�|�WnJttfk
�r,�Yn0tk
�rZ}z|�|d�W5d}~XYnXdS)N���z%get_buffer() returned an empty bufferz/Fatal error: protocol.get_buffer() call failed.�$Fatal read error on socket transportz3Fatal error: protocol.buffer_updated() call failed.)r�r�Z
get_bufferr�r8rirjrhr�r�r�rKrJ�_read_ready__on_eofZbuffer_updated)r&r�rer�rrrr�'sF��z0_SelectorSocketTransport._read_ready__get_bufferc
Cs�|jr
dSz|j�|j�}Wndttfk
r6YdSttfk
rN�Yn4tk
r�}z|�	|d�WY�dSd}~XYnX|s�|�
�dSz|j�|�WnFttfk
r��Yn.tk
r�}z|�	|d�W5d}~XYnXdS)Nr�z2Fatal error: protocol.data_received() call failed.)
r�r�rIr�rKrJrirjrhr�r�r�Z
data_received)r&rGrerrrr�Ls.�z3_SelectorSocketTransport._read_ready__data_receivedc
Cs�|j��rt�d|�z|j��}WnLttfk
r>�Yn4tk
rp}z|�	|d�WY�dSd}~XYnX|r�|j�
|j�n|��dS)Nz%r received EOFz1Fatal error: protocol.eof_received() call failed.)
r�r�rrr�Zeof_receivedrirjrhr�r=r�r;)r&Z	keep_openrerrrr�es
�z,_SelectorSocketTransport._read_ready__on_eofc
Cs6t|tttf�s$tdt|�j����|jr2td��|j	dk	rDtd��|sLdS|j
rz|j
tjkrht
�d�|j
d7_
dS|j�sz|j�|�}Wnbttfk
r�Ynbttfk
r��YnJtk
r�}z|�|d�WY�dSd}~XYnX||d�}|�sdS|j�|j|j�|j�|�|��dS)N�/data argument must be a bytes-like object, not z%Cannot call write() after write_eof()z(unable to write; sendfile is in progress�socket.send() raised exception.r�%Fatal write error on socket transport)r�bytesr�r�r�typer!r�r8r�r�r�!LOG_THRESHOLD_FOR_CONNLOST_WRITESr�warningr�r�rOrKrJrirjrhr�r�r�r��_write_ready�extend�_maybe_pause_protocol)r&rGr�rerrr�writezs:

z_SelectorSocketTransport.writec
Cs|jr
dSz|j�|j�}Wn�ttfk
r4Yn�ttfk
rL�Yn�tk
r�}z>|j	�
|j�|j��|�
|d�|jdk	r�|j�|�W5d}~XYnnX|r�|jd|�=|��|j�s|j	�
|j�|jdk	r�|j�d�|jr�|�d�n|j�r|j�tj�dS)Nr�)r�r�rOr�rKrJrirjrhr�r�r�r�r�r�r��_maybe_resume_protocolr�r�r�r��shutdownrB�SHUT_WR)r&r�rerrrr�s2


z%_SelectorSocketTransport._write_readycCs.|js|jrdSd|_|js*|j�tj�dSr�)r�r�r�r�rrBrr<rrr�	write_eof�s
z"_SelectorSocketTransport.write_eofcCsdSr�rr<rrr�
can_write_eof�sz&_SelectorSocketTransport.can_write_eofcs*t��|�|jdk	r&|j�td��dS)NzConnection is closed by peer)rr�r�r��ConnectionErrorr�r'rrr��s

�z._SelectorSocketTransport._call_connection_lostcCs6|jdk	rtd��|j��|_|js0|j�d�|jS)NzEmpty waiter is already set)r�r8r�rgr�r�r<rrrr��s
z+_SelectorSocketTransport._make_empty_waitercCs
d|_dSr+)r�r<rrrr��sz,_SelectorSocketTransport._reset_empty_waiter)NNN)r!r�r�Z_start_tls_compatiblerZ
_SendfileModeZ
TRY_NATIVEZ_sendfile_compatiblerr�r�r�r�r�r�r�r�rrrr	r�r�r�r�rrr'rr,�s*�%'r,csFeZdZejZd�fdd�	Zdd�Zdd�Zd
dd	�Z	d
d�Z
�ZS)r5Ncs^t��||||�||_|j�|jj|�|j�|j|j|j	�|dk	rZ|j�t
j|d�dSr+)rr�_addressr�r�r�r�rDr�r�rr�)r&r�rr-r6r.r)r'rrr�s
�
�z#_SelectorDatagramTransport.__init__cCstdd�|jD��S)Ncss|]\}}t|�VqdSr+)r�)�.0rGrbrrr�	<genexpr>�szC_SelectorDatagramTransport.get_write_buffer_size.<locals>.<genexpr>)�sumr�r<rrrr��sz0_SelectorDatagramTransport.get_write_buffer_sizec
Cs�|jr
dSz|j�|j�\}}Wn�ttfk
r8Yn�tk
rd}z|j�|�W5d}~XYnTt	t
fk
r|�Yn<tk
r�}z|�|d�W5d}~XYnX|j�
||�dS)Nz&Fatal read error on datagram transport)r�r�Zrecvfromr�rKrJrPr��error_receivedrirjrhr�Zdatagram_received�r&rGrdrerrrr��sz&_SelectorDatagramTransport._read_readyc
Cs�t|tttf�s$tdt|�j����|s,dS|jrV|d|jfkrPtd|j����|j}|j	r�|jr�|j	t
jkrxt�
d�|j	d7_	dS|j�slz,|jdr�|j�|�n|j�||�WdSttfk
r�|j�|j|j�Yn�tk
�r}z|j�|�WY�dSd}~XYnPttfk
�r6�Yn6tk
�rj}z|�|d�WY�dSd}~XYnX|j� t|�|f�|�!�dS)Nr�z!Invalid address: must be None or r�rrZ�'Fatal write error on datagram transport)"rr�r�r�rr�r!rrnr�rr�rrr�r�r�rO�sendtorKrJr�r�r��
_sendto_readyrPr�rrirjrhr�r�rrrrrr�sH
�

�z!_SelectorDatagramTransport.sendtoc
Cs|jr�|j��\}}z*|jdr.|j�|�n|j�||�Wqttfk
rj|j�||f�Yq�Yqt	k
r�}z|j
�|�WY�dSd}~XYqtt
fk
r��Yqtk
r�}z|�|d�WY�dSd}~XYqXq|��|j�s|j�|j�|j�r|�d�dS)NrZr)r��popleftr�r�rOrrKrJ�
appendleftrPr�rrirjrhr�rr�r�r�r�r�rrrrr*s2
�z(_SelectorDatagramTransport._sendto_ready)NNN)N)r!r�r��collections�dequer�rr�r�rrr�rrr'rr5�s�

+r5)r��__all__rr^r�rrBr�r$r�ImportError�rrrrrr	r
r�logrrrZ
BaseEventLooprZ_FlowControlMixinZ	Transportr�r,r5rrrr�<module>sF
1�oasyncio/__pycache__/runners.cpython-38.opt-1.pyc000064400000003635151153537520015522 0ustar00U

e5d�@sBdZddlmZddlmZddlmZdd�dd�Zd	d
�ZdS))�run�)�
coroutines)�events)�tasksN)�debugcCs�t��dk	rtd��t�|�s,td�|���t��}z*t�|�|dk	rR|�
|�|�|�W�Szt
|�|�|���W5t�d�|�	�XXdS)a�Execute the coroutine and return the result.

    This function runs the passed coroutine, taking care of
    managing the asyncio event loop and finalizing asynchronous
    generators.

    This function cannot be called when another asyncio event loop is
    running in the same thread.

    If debug is True, the event loop will be run in debug mode.

    This function always creates a new event loop and closes it at the end.
    It should be used as a main entry point for asyncio programs, and should
    ideally only be called once.

    Example:

        async def main():
            await asyncio.sleep(1)
            print('hello')

        asyncio.run(main())
    Nz8asyncio.run() cannot be called from a running event loopz"a coroutine was expected, got {!r})rZ_get_running_loop�RuntimeErrorrZiscoroutine�
ValueError�formatZnew_event_loopZset_event_loop�close�_cancel_all_tasks�run_until_completeZshutdown_asyncgensZ	set_debug)�mainr�loop�r�'/usr/lib64/python3.8/asyncio/runners.pyrs"�



rcCsvt�|�}|sdS|D]}|��q|�tj||dd���|D]0}|��rNq@|��dk	r@|�d|��|d��q@dS)NT)rZreturn_exceptionsz1unhandled exception during asyncio.run() shutdown)�message�	exception�task)rZ	all_tasksZcancelrZgatherZ	cancelledrZcall_exception_handler)rZ	to_cancelrrrrr6s"

��r)�__all__�rrrrrrrrr�<module>s
.asyncio/__pycache__/unix_events.cpython-38.pyc000064400000114652151153537520015440 0ustar00U

e5dۿ�@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
mZddl
mZddl
mZddl
mZddl
mZdd	l
mZdd
l
mZddl
mZddl
mZdd
l
mZddlmZdZe
jdkr�ed��dd�ZGdd�dej�ZGdd�dej �Z!Gdd�dej"ej#�Z$Gdd�dej%�Z&Gdd�d�Z'dd�Z(Gd d!�d!e'�Z)Gd"d#�d#e)�Z*Gd$d%�d%e)�Z+Gd&d'�d'e'�Z,Gd(d)�d)e'�Z-Gd*d+�d+ej.�Z/eZ0e/Z1dS),z2Selector event loop for Unix with signal handling.�N�)�base_events)�base_subprocess)�	constants)�
coroutines)�events)�
exceptions)�futures)�selector_events)�tasks)�
transports)�logger)�SelectorEventLoop�AbstractChildWatcher�SafeChildWatcher�FastChildWatcher�MultiLoopChildWatcher�ThreadedChildWatcher�DefaultEventLoopPolicyZwin32z+Signals are not really supported on WindowscCsdS)zDummy signal handler.N�)�signum�framerr�+/usr/lib64/python3.8/asyncio/unix_events.py�_sighandler_noop*srcs�eZdZdZd)�fdd�	Z�fdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
d*dd�Zd+dd�Zd,dd�Z
dd�Zd-ddddd�dd�Zd.dddddd�dd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Z�ZS)/�_UnixSelectorEventLoopzdUnix event loop.

    Adds signal handling and UNIX Domain Socket support to SelectorEventLoop.
    Ncst��|�i|_dS�N)�super�__init__�_signal_handlers)�self�selector��	__class__rrr5sz_UnixSelectorEventLoop.__init__csZt���t��s.t|j�D]}|�|�qn(|jrVtjd|�d�t	|d�|j�
�dS)NzClosing the loop z@ on interpreter shutdown stage, skipping signal handlers removal��source)r�close�sys�
is_finalizing�listr�remove_signal_handler�warnings�warn�ResourceWarning�clear�r�sigr!rrr%9s
�z_UnixSelectorEventLoop.closecCs|D]}|sq|�|�qdSr)�_handle_signal)r�datarrrr�_process_self_dataGsz)_UnixSelectorEventLoop._process_self_datac
GsLt�|�st�|�rtd��|�|�|��zt�|j�	��Wn2t
tfk
rt}ztt
|���W5d}~XYnXt�|||d�}||j|<zt�|t�t�|d�Wn�tk
�rF}zz|j|=|j�szt�d�Wn4t
tfk
�r}zt�d|�W5d}~XYnX|jtjk�r4td|�d���n�W5d}~XYnXdS)z�Add a handler for a signal.  UNIX only.

        Raise ValueError if the signal number is invalid or uncatchable.
        Raise RuntimeError if there is a problem setting up the handler.
        z3coroutines cannot be used with add_signal_handler()NF����set_wakeup_fd(-1) failed: %s�sig � cannot be caught)rZiscoroutineZiscoroutinefunction�	TypeError�
_check_signalZ
_check_closed�signal�
set_wakeup_fdZ_csock�fileno�
ValueError�OSError�RuntimeError�strrZHandlerr�siginterruptr
�info�errno�EINVAL)rr/�callback�args�exc�handleZnexcrrr�add_signal_handlerNs2
�

z)_UnixSelectorEventLoop.add_signal_handlercCs8|j�|�}|dkrdS|jr*|�|�n
|�|�dS)z2Internal helper that is the actual signal handler.N)r�getZ
_cancelledr)Z_add_callback_signalsafe)rr/rGrrrr0{sz%_UnixSelectorEventLoop._handle_signalc
Cs�|�|�z|j|=Wntk
r,YdSX|tjkr@tj}ntj}zt�||�WnBtk
r�}z$|jtj	kr�t
d|�d���n�W5d}~XYnX|js�zt�d�Wn2ttfk
r�}zt
�d|�W5d}~XYnXdS)zwRemove a handler for a signal.  UNIX only.

        Return True if a signal handler was removed, False if not.
        Fr5r6Nr3r4T)r8r�KeyErrorr9�SIGINT�default_int_handler�SIG_DFLr=rBrCr>r:r<r
rA)rr/�handlerrFrrrr)�s(

z,_UnixSelectorEventLoop.remove_signal_handlercCs6t|t�std|����|t��kr2td|����dS)z�Internal helper to validate a signal.

        Raise ValueError if the signal number is invalid or uncatchable.
        Raise RuntimeError if there is a problem setting up the handler.
        zsig must be an int, not zinvalid signal number N)�
isinstance�intr7r9�
valid_signalsr<r.rrrr8�s
z$_UnixSelectorEventLoop._check_signalcCst|||||�Sr)�_UnixReadPipeTransport�r�pipe�protocol�waiter�extrarrr�_make_read_pipe_transport�sz0_UnixSelectorEventLoop._make_read_pipe_transportcCst|||||�Sr)�_UnixWritePipeTransportrSrrr�_make_write_pipe_transport�sz1_UnixSelectorEventLoop._make_write_pipe_transportc	

�s�t����}
|
��std��|��}t||||||||f||d�|	��}|
�|��|j|�z|IdHWnDt	t
fk
r��Yn,tk
r�|��|�
�IdH�YnXW5QRX|S)NzRasyncio.get_child_watcher() is not activated, subprocess support is not installed.)rVrW)r�get_child_watcher�	is_activer>�
create_future�_UnixSubprocessTransport�add_child_handlerZget_pid�_child_watcher_callback�
SystemExit�KeyboardInterrupt�
BaseExceptionr%Z_wait)
rrUrE�shell�stdin�stdout�stderr�bufsizerW�kwargs�watcherrV�transprrr�_make_subprocess_transport�s8

���
�z1_UnixSelectorEventLoop._make_subprocess_transportcCs|�|j|�dSr)�call_soon_threadsafeZ_process_exited)r�pid�
returncoderkrrrr`�sz._UnixSelectorEventLoop._child_watcher_callback)�ssl�sock�server_hostname�ssl_handshake_timeoutc	�s |dkst|t�st�|r,|dkrLtd��n |dk	r<td��|dk	rLtd��|dk	r�|dk	rdtd��t�|�}t�tjtjd�}z |�	d�|�
||�IdHWq�|���Yq�Xn@|dkr�td��|jtjks�|j
tjkr�td|����|�	d�|j|||||d	�IdH\}}||fS)
Nz/you have to pass server_hostname when using sslz+server_hostname is only meaningful with ssl�1ssl_handshake_timeout is only meaningful with ssl�3path and sock can not be specified at the same timerFzno path and sock were specified�.A UNIX Domain Stream Socket was expected, got )rs)rOr?�AssertionErrorr<�os�fspath�socket�AF_UNIX�SOCK_STREAM�setblockingZsock_connectr%�family�typeZ_create_connection_transport)	r�protocol_factory�pathrprqrrrs�	transportrUrrr�create_unix_connection�sT���



��
�z-_UnixSelectorEventLoop.create_unix_connection�dT)rq�backlogrprs�
start_servingc
�s�t|t�rtd��|dk	r&|s&td��|dk	�rH|dk	r@td��t�|�}t�tjtj�}|ddkr�z t	�
t�	|�j�r�t�|�WnBt
k
r�Yn0tk
r�}zt�d||�W5d}~XYnXz|�|�Wnltk
�r0}	z8|��|	jtjk�rd|�d�}
ttj|
�d�n�W5d}	~	XYn|���YnXn<|dk�rZtd	��|jtjk�sv|jtjk�r�td
|����|�d�t�||g||||�}|�r�|��tjd|d�IdH|S)
Nz*ssl argument must be an SSLContext or Nonertrur)r�z2Unable to check or remove stale UNIX socket %r: %rzAddress z is already in usez-path was not specified, and no sock specifiedrvF)�loop)rO�boolr7r<rxryrzr{r|�stat�S_ISSOCK�st_mode�remove�FileNotFoundErrorr=r
�errorZbindr%rBZ
EADDRINUSEr~rr}rZServerZ_start_servingr�sleep)rr�r�rqr�rprsr��errrF�msgZserverrrr�create_unix_serversn
�
�
�

�
��
�z)_UnixSelectorEventLoop.create_unix_serverc
�s�z
tjWn,tk
r6}zt�d��W5d}~XYnXz|��}Wn2ttjfk
rv}zt�d��W5d}~XYnXzt�|�j	}Wn,t
k
r�}zt�d��W5d}~XYnX|r�|n|}	|	s�dS|��}
|�|
d|||||	d�|
IdHS)Nzos.sendfile() is not availableznot a regular filer)
rx�sendfile�AttributeErrorr�SendfileNotAvailableErrorr;�io�UnsupportedOperation�fstat�st_sizer=r]�_sock_sendfile_native_impl)rrq�file�offset�countrFr;r�Zfsize�	blocksize�futrrr�_sock_sendfile_nativeJs2
��z,_UnixSelectorEventLoop._sock_sendfile_nativec	Cs,|��}	|dk	r|�|�|��r4|�|||�dS|rd||}|dkrd|�|||�|�|�dSzt�|	|||�}
W�nDttfk
r�|dkr�|�	||�|�
|	|j||	||||||�
Y�nbtk
�rj}z�|dk	�r|j
t
jk�rt|�tk	�rtdt
j�}||_|}|dk�rBt�d�}
|�|||�|�|
�n|�|||�|�|�W5d}~XYn�ttfk
�r��Yn�tk
�r�}z|�|||�|�|�W5d}~XYnjX|
dk�r�|�|||�|�|�nD||
7}||
7}|dk�r
|�	||�|�
|	|j||	||||||�
dS)Nrzsocket is not connectedzos.sendfile call failed)r;�
remove_writer�	cancelled�_sock_sendfile_update_fileposZ
set_resultrxr��BlockingIOError�InterruptedError�_sock_add_cancellation_callbackZ
add_writerr�r=rBZENOTCONNr�ConnectionError�	__cause__rr�Z
set_exceptionrarbrc)rr�Z
registered_fdrqr;r�r�r��
total_sent�fdZsentrF�new_excr�rrrr�as�

�


�
��
�

�z1_UnixSelectorEventLoop._sock_sendfile_native_implcCs|dkrt�||tj�dS�Nr)rx�lseek�SEEK_SET)rr;r�r�rrrr��sz4_UnixSelectorEventLoop._sock_sendfile_update_fileposcs��fdd�}|�|�dS)Ncs&|��r"���}|dkr"��|�dS)Nr3)r�r;r�)r�r��rrqrr�cb�szB_UnixSelectorEventLoop._sock_add_cancellation_callback.<locals>.cb)Zadd_done_callback)rr�rqr�rr�rr��sz6_UnixSelectorEventLoop._sock_add_cancellation_callback)N)NN)NN)N)N)N)�__name__�
__module__�__qualname__�__doc__rr%r2rHr0r)r8rXrZrlr`r�r�r�r�r�r��
__classcell__rrr!rr/sH-
 �
�
�
��.��CFrcs�eZdZdZd�fdd�	Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Ze
jfdd�Zddd�Zdd�Zdd�Z�ZS) rRiNcs�t��|�||jd<||_||_|��|_||_d|_d|_	t
�|j�j}t
�|�s�t
�|�s�t
�|�s�d|_d|_d|_td��t
�|jd�|j�|jj|�|j�|jj|j|j�|dk	r�|j�tj|d�dS)NrTFz)Pipe transport is for pipes/sockets only.)rr�_extra�_loop�_piper;�_fileno�	_protocol�_closing�_pausedrxr�r�r��S_ISFIFOr��S_ISCHRr<�set_blocking�	call_soon�connection_made�_add_reader�_read_readyr	�_set_result_unless_cancelled)rr�rTrUrVrW�moder!rrr�s:


���
�z_UnixReadPipeTransport.__init__cCs�|jjg}|jdkr |�d�n|jr0|�d�|�d|j���t|jdd�}|jdk	r�|dk	r�t�	||jt
j�}|r�|�d�q�|�d�n |jdk	r�|�d�n
|�d�d�d	�
|��S)
N�closed�closing�fd=�	_selector�polling�idle�open�<{}>� )r"r�r��appendr�r��getattrr�r
�_test_selector_event�	selectorsZ
EVENT_READ�format�join)rrAr r�rrr�__repr__�s(


�

z_UnixReadPipeTransport.__repr__c
Cs�zt�|j|j�}WnDttfk
r,Yn�tk
rX}z|�|d�W5d}~XYn^X|rl|j�	|�nJ|j
��r�t�
d|�d|_|j
�|j�|j
�|jj�|j
�|jd�dS)Nz"Fatal read error on pipe transport�%r was closed by peerT)rx�readr��max_sizer�r�r=�_fatal_errorr�Z
data_receivedr��	get_debugr
rAr��_remove_readerr�Zeof_received�_call_connection_lost)rr1rFrrrr��s
z"_UnixReadPipeTransport._read_readycCs>|js|jrdSd|_|j�|j�|j��r:t�d|�dS)NTz%r pauses reading)r�r�r�r�r�r�r
�debug�rrrr�
pause_reading�s
z$_UnixReadPipeTransport.pause_readingcCsB|js|jsdSd|_|j�|j|j�|j��r>t�d|�dS)NFz%r resumes reading)	r�r�r�r�r�r�r�r
r�r�rrr�resume_readings
z%_UnixReadPipeTransport.resume_readingcCs
||_dSr�r��rrUrrr�set_protocol
sz#_UnixReadPipeTransport.set_protocolcCs|jSrr�r�rrr�get_protocolsz#_UnixReadPipeTransport.get_protocolcCs|jSr�r�r�rrr�
is_closingsz!_UnixReadPipeTransport.is_closingcCs|js|�d�dSr)r��_closer�rrrr%sz_UnixReadPipeTransport.closecCs,|jdk	r(|d|��t|d�|j��dS�Nzunclosed transport r#�r�r,r%�r�_warnrrr�__del__s
z_UnixReadPipeTransport.__del__�Fatal error on pipe transportcCsZt|t�r4|jtjkr4|j��rLtjd||dd�n|j�||||j	d��|�
|�dS�Nz%r: %sT��exc_info)�message�	exceptionr�rU)rOr=rBZEIOr�r�r
r��call_exception_handlerr�r��rrFr�rrrr�s
�z#_UnixReadPipeTransport._fatal_errorcCs(d|_|j�|j�|j�|j|�dS�NT)r�r�r�r�r�r��rrFrrrr�-sz_UnixReadPipeTransport._closecCs4z|j�|�W5|j��d|_d|_d|_XdSr�r�r%r�r�Zconnection_lostr�rrrr�2s
z,_UnixReadPipeTransport._call_connection_lost)NN)r�)r�r�r�r�rr�r�r�r�r�r�r�r%r*r+r�r�r�r�r�rrr!rrR�s
rRcs�eZdZd%�fdd�	Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zejfdd�Zdd�Zd&dd �Zd'd!d"�Zd#d$�Z�ZS)(rYNc
s�t��||�||jd<||_|��|_||_t�|_d|_	d|_
t�|j�j
}t�|�}t�|�}t�|�}	|s�|s�|	s�d|_d|_d|_td��t�|jd�|j�|jj|�|	s�|r�tj�d�s�|j�|jj|j|j�|dk	r�|j�tj|d�dS)NrTrFz?Pipe transport is only for pipes, sockets and character devicesZaix)rrr�r�r;r�r��	bytearray�_buffer�
_conn_lostr�rxr�r�r�r�r�r�r<r�r�r�r�r&�platform�
startswithr�r�r	r�)
rr�rTrUrVrWr�Zis_charZis_fifoZ	is_socketr!rrr?s:




�
�z _UnixWritePipeTransport.__init__cCs�|jjg}|jdkr |�d�n|jr0|�d�|�d|j���t|jdd�}|jdk	r�|dk	r�t�	||jt
j�}|r�|�d�n
|�d�|��}|�d|���n |jdk	r�|�d�n
|�d�d	�
d
�|��S)Nr�r�r�r�r�r�zbufsize=r�r�r�)r"r�r�r�r�r�r�r�r
r�r�ZEVENT_WRITE�get_write_buffer_sizer�r�)rrAr r�rhrrrr�ds,


�


z _UnixWritePipeTransport.__repr__cCs
t|j�Sr)�lenr�r�rrrr�|sz-_UnixWritePipeTransport.get_write_buffer_sizecCs6|j��rt�d|�|jr*|�t��n|��dS)Nr�)r�r�r
rAr�r��BrokenPipeErrorr�rrrr�s

z#_UnixWritePipeTransport._read_readyc
CsRt|tttf�stt|���t|t�r.t|�}|s6dS|jsB|jrj|jtj	krXt
�d�|jd7_dS|j�s8zt
�|j|�}Wntttfk
r�d}YnZttfk
r��YnBtk
r�}z$|jd7_|�|d�WY�dSd}~XYnX|t|�k�rdS|dk�r&t|�|d�}|j�|j|j�|j|7_|��dS)Nz=pipe closed by peer or os.write(pipe, data) raised exception.rr�#Fatal write error on pipe transport)rO�bytesr��
memoryviewrw�reprr�r�rZ!LOG_THRESHOLD_FOR_CONNLOST_WRITESr
�warningr�rx�writer�r�r�rarbrcr�r�r�Z_add_writer�_write_readyZ_maybe_pause_protocol)rr1�nrFrrrr�s8


z_UnixWritePipeTransport.writec
Cs|jstd��zt�|j|j�}Wn�ttfk
r:Yn�ttfk
rR�Yn�t	k
r�}z6|j�
�|jd7_|j�
|j�|�|d�W5d}~XYnhX|t|j�kr�|j�
�|j�
|j�|��|jr�|j�|j�|�d�dS|dk�r|jd|�=dS)NzData should not be emptyrrr)r�rwrxrr�r�r�rarbrcr-r�r��_remove_writerr�r�Z_maybe_resume_protocolr�r�r�)rrrFrrrr�s,



z$_UnixWritePipeTransport._write_readycCsdSr�rr�rrr�
can_write_eof�sz%_UnixWritePipeTransport.can_write_eofcCsB|jr
dS|jst�d|_|js>|j�|j�|j�|jd�dSr�)	r�r�rwr�r�r�r�r�r�r�rrr�	write_eof�s
z!_UnixWritePipeTransport.write_eofcCs
||_dSrr�r�rrrr��sz$_UnixWritePipeTransport.set_protocolcCs|jSrr�r�rrrr��sz$_UnixWritePipeTransport.get_protocolcCs|jSrr�r�rrrr��sz"_UnixWritePipeTransport.is_closingcCs|jdk	r|js|��dSr)r�r�rr�rrrr%�sz_UnixWritePipeTransport.closecCs,|jdk	r(|d|��t|d�|j��dSr�r�r�rrrr��s
z_UnixWritePipeTransport.__del__cCs|�d�dSr)r�r�rrr�abort�sz_UnixWritePipeTransport.abortr�cCsNt|t�r(|j��r@tjd||dd�n|j�||||jd��|�|�dSr�)	rOr=r�r�r
r�r�r�r�r�rrrr��s

�z$_UnixWritePipeTransport._fatal_errorcCsFd|_|jr|j�|j�|j��|j�|j�|j�|j|�dSr�)	r�r�r�r	r�r-r�r�r�r�rrrr��s
z_UnixWritePipeTransport._closecCs4z|j�|�W5|j��d|_d|_d|_XdSrr�r�rrrr��s
z-_UnixWritePipeTransport._call_connection_lost)NN)r�)N)r�r�r�rr�r�r�rrr
rr�r�r�r%r*r+r�rr�r�r�r�rrr!rrY<s"%	#	

rYc@seZdZdd�ZdS)r^c		Ks�d}|tjkrt��\}}zPtj|f||||d|d�|��|_|dk	rh|��t|��d|d�|j_	d}W5|dk	r�|��|��XdS)NF)rdrerfrgZuniversal_newlinesrh�wb)�	buffering)
�
subprocess�PIPErzZ
socketpairr%�Popen�_procr��detachre)	rrErdrerfrgrhriZstdin_wrrr�_starts.
���z_UnixSubprocessTransport._startN)r�r�r�rrrrrr^	sr^c@sHeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)raHAbstract base class for monitoring child processes.

    Objects derived from this class monitor a collection of subprocesses and
    report their termination or interruption by a signal.

    New callbacks are registered with .add_child_handler(). Starting a new
    process must be done within a 'with' block to allow the watcher to suspend
    its activity until the new process if fully registered (this is needed to
    prevent a race condition in some implementations).

    Example:
        with watcher:
            proc = subprocess.Popen("sleep 1")
            watcher.add_child_handler(proc.pid, callback)

    Notes:
        Implementations of this class must be thread-safe.

        Since child watcher objects may catch the SIGCHLD signal and call
        waitpid(-1), there should be only one active object per process.
    cGs
t��dS)aRegister a new child handler.

        Arrange for callback(pid, returncode, *args) to be called when
        process 'pid' terminates. Specifying another callback for the same
        process replaces the previous handler.

        Note: callback() must be thread-safe.
        N��NotImplementedError�rrnrDrErrrr_9s	z&AbstractChildWatcher.add_child_handlercCs
t��dS)z�Removes the handler for process 'pid'.

        The function returns True if the handler was successfully removed,
        False if there was nothing to remove.Nr�rrnrrr�remove_child_handlerDsz)AbstractChildWatcher.remove_child_handlercCs
t��dS)z�Attach the watcher to an event loop.

        If the watcher was previously attached to an event loop, then it is
        first detached before attaching to the new loop.

        Note: loop may be None.
        Nr�rr�rrr�attach_loopLsz AbstractChildWatcher.attach_loopcCs
t��dS)zlClose the watcher.

        This must be called to make sure that any underlying resource is freed.
        Nrr�rrrr%VszAbstractChildWatcher.closecCs
t��dS)z�Return ``True`` if the watcher is active and is used by the event loop.

        Return True if the watcher is installed and ready to handle process exit
        notifications.

        Nrr�rrrr\]szAbstractChildWatcher.is_activecCs
t��dS)zdEnter the watcher's context and allow starting new processes

        This function must return selfNrr�rrr�	__enter__fszAbstractChildWatcher.__enter__cCs
t��dS)zExit the watcher's contextNr�r�a�b�crrr�__exit__lszAbstractChildWatcher.__exit__N)r�r�r�r�r_rrr%r\rr!rrrrr"s
	rcCs2t�|�rt�|�St�|�r*t�|�S|SdSr)rx�WIFSIGNALED�WTERMSIG�	WIFEXITED�WEXITSTATUS)�statusrrr�_compute_returncodeqs



r'c@sDeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�BaseChildWatchercCsd|_i|_dSr)r��
_callbacksr�rrrr�szBaseChildWatcher.__init__cCs|�d�dSr)rr�rrrr%�szBaseChildWatcher.closecCs|jdk	o|j��Sr)r�Z
is_runningr�rrrr\�szBaseChildWatcher.is_activecCs
t��dSrr)r�expected_pidrrr�_do_waitpid�szBaseChildWatcher._do_waitpidcCs
t��dSrrr�rrr�_do_waitpid_all�sz BaseChildWatcher._do_waitpid_allcCs~|dkst|tj�st�|jdk	r<|dkr<|jr<t�dt�|jdk	rT|j�	t
j�||_|dk	rz|�t
j|j
�|��dS)NzCA loop is being detached from a child watcher with pending handlers)rOrZAbstractEventLooprwr�r)r*r+�RuntimeWarningr)r9�SIGCHLDrH�	_sig_chldr,rrrrr�s�
zBaseChildWatcher.attach_loopc
Cs^z|��WnLttfk
r&�Yn4tk
rX}z|j�d|d��W5d}~XYnXdS)N�$Unknown exception in SIGCHLD handler)r�r�)r,rarbrcr�r�r�rrrr/�s�zBaseChildWatcher._sig_chldN)
r�r�r�rr%r\r+r,rr/rrrrr(sr(csPeZdZdZ�fdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
�ZS)rad'Safe' child watcher implementation.

    This implementation avoids disrupting other code spawning processes by
    polling explicitly each process in the SIGCHLD handler instead of calling
    os.waitpid(-1).

    This is a safe solution but it has a significant overhead when handling a
    big number of children (O(n) each time SIGCHLD is raised)
    cs|j��t���dSr)r)r-rr%r�r!rrr%�s
zSafeChildWatcher.closecCs|Srrr�rrrr�szSafeChildWatcher.__enter__cCsdSrrrrrrr!�szSafeChildWatcher.__exit__cGs||f|j|<|�|�dSr)r)r+rrrrr_�sz"SafeChildWatcher.add_child_handlercCs*z|j|=WdStk
r$YdSXdS�NTF�r)rJrrrrr�s
z%SafeChildWatcher.remove_child_handlercCst|j�D]}|�|�q
dSr�r(r)r+rrrrr,�sz SafeChildWatcher._do_waitpid_allcCs�|dkst�zt�|tj�\}}Wn(tk
rJ|}d}t�d|�Yn.X|dkrXdSt|�}|j�	�rxt�
d||�z|j�|�\}}Wn.t
k
r�|j�	�r�tjd|dd�YnX|||f|��dS)Nr��8Unknown child process pid %d, will report returncode 255�$process %s exited with returncode %s�'Child watcher got an unexpected pid: %rTr�)rwrx�waitpid�WNOHANG�ChildProcessErrorr
rr'r�r�r�r)�poprJ)rr*rnr&rorDrErrrr+�s6�

�
�zSafeChildWatcher._do_waitpid)r�r�r�r�r%rr!r_rr,r+r�rrr!rr�s
rcsTeZdZdZ�fdd�Z�fdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
�ZS)raW'Fast' child watcher implementation.

    This implementation reaps every terminated processes by calling
    os.waitpid(-1) directly, possibly breaking other code spawning processes
    and waiting for their termination.

    There is no noticeable overhead when handling a big number of children
    (O(1) each time a child terminates).
    cs$t���t��|_i|_d|_dSr�)rr�	threadingZLock�_lock�_zombies�_forksr�r!rrrs

zFastChildWatcher.__init__cs"|j��|j��t���dSr)r)r-r>rr%r�r!rrr%s

zFastChildWatcher.closec
Cs0|j� |jd7_|W5QR�SQRXdS)Nr)r=r?r�rrrrszFastChildWatcher.__enter__c	Cs^|j�B|jd8_|js"|js0W5QR�dSt|j�}|j��W5QRXt�d|�dS)Nrz5Caught subprocesses termination from unknown pids: %s)r=r?r>r?r-r
r)rrrr Zcollateral_victimsrrrr!s
�zFastChildWatcher.__exit__c	Gst|jstd��|j�Fz|j�|�}Wn.tk
rT||f|j|<YW5QR�dSXW5QRX|||f|��dS)NzMust use the context manager)r?rwr=r>r;rJr))rrnrDrErorrrr_'sz"FastChildWatcher.add_child_handlercCs*z|j|=WdStk
r$YdSXdSr1r2rrrrr5s
z%FastChildWatcher.remove_child_handlerc	Cs�zt�dtj�\}}Wntk
r,YdSX|dkr:dSt|�}|j��z|j�|�\}}WnNtk
r�|j	r�||j
|<|j��r�t
�d||�YW5QR�qd}YnX|j��r�t
�d||�W5QRX|dkr�t
�d||�q|||f|��qdS)Nr3rz,unknown process %s exited with returncode %sr6z8Caught subprocess termination from unknown pid: %d -> %d)rxr8r9r:r'r=r)r;rJr?r>r�r�r
r�r)rrnr&rorDrErrrr,<s@

�

��z FastChildWatcher._do_waitpid_all)r�r�r�r�rr%rr!r_rr,r�rrr!rr�s	rc@sheZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)ra~A watcher that doesn't require running loop in the main thread.

    This implementation registers a SIGCHLD signal handler on
    instantiation (which may conflict with other code that
    install own handler for this signal).

    The solution is safe but it has a significant overhead when
    handling a big number of processes (*O(n)* each time a
    SIGCHLD is received).
    cCsi|_d|_dSr)r)�_saved_sighandlerr�rrrrzszMultiLoopChildWatcher.__init__cCs
|jdk	Sr)r@r�rrrr\~szMultiLoopChildWatcher.is_activecCsT|j��|jdkrdSt�tj�}||jkr:t�d�nt�tj|j�d|_dS)Nz+SIGCHLD handler was changed by outside code)	r)r-r@r9�	getsignalr.r/r
r)rrNrrrr%�s


zMultiLoopChildWatcher.closecCs|Srrr�rrrr�szMultiLoopChildWatcher.__enter__cCsdSrr�r�exc_typeZexc_valZexc_tbrrrr!�szMultiLoopChildWatcher.__exit__cGs&t��}|||f|j|<|�|�dSr)r�get_running_loopr)r+)rrnrDrEr�rrrr_�sz'MultiLoopChildWatcher.add_child_handlercCs*z|j|=WdStk
r$YdSXdSr1r2rrrrr�s
z*MultiLoopChildWatcher.remove_child_handlercCsN|jdk	rdSt�tj|j�|_|jdkr<t�d�tj|_t�tjd�dS)NzaPrevious SIGCHLD handler was set by non-Python code, restore to default handler on watcher close.F)r@r9r.r/r
rrMr@rrrrr�s


z!MultiLoopChildWatcher.attach_loopcCst|j�D]}|�|�q
dSrr3rrrrr,�sz%MultiLoopChildWatcher._do_waitpid_allc	Cs�|dkst�zt�|tj�\}}Wn,tk
rN|}d}t�d|�d}YnX|dkr\dSt|�}d}z|j�	|�\}}}Wn$t
k
r�tjd|dd�YnHX|��r�t�d||�n.|r�|��r�t�
d	||�|j|||f|��dS)
Nrr4r5FTr7r��%Loop %r that handles pid %r is closedr6)rwrxr8r9r:r
rr'r)r;rJ�	is_closedr�r�rm)	rr*rnr&roZ	debug_logr�rDrErrrr+�s<�
��z!MultiLoopChildWatcher._do_waitpidc	CsLz|��Wn:ttfk
r&�Yn"tk
rFtjddd�YnXdS)Nr0Tr�)r,rarbrcr
r)rrrrrrr/�szMultiLoopChildWatcher._sig_chldN)r�r�r�r�rr\r%rr!r_rrr,r+r/rrrrrgs%rc@sneZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	e
jfdd�Zdd�Z
dd�Zdd�Zdd�ZdS)raAThreaded child watcher implementation.

    The watcher uses a thread per process
    for waiting for the process finish.

    It doesn't require subscription on POSIX signal
    but a thread creation is not free.

    The watcher has O(1) complexity, its performance doesn't depend
    on amount of spawn processes.
    cCst�d�|_i|_dSr�)�	itertoolsr��_pid_counter�_threadsr�rrrr�szThreadedChildWatcher.__init__cCsdSr�rr�rrrr\�szThreadedChildWatcher.is_activecCs|��dSr)�
_join_threadsr�rrrr%�szThreadedChildWatcher.closecCs.dd�t|j���D�}|D]}|��qdS)z%Internal: Join all non-daemon threadscSsg|]}|��r|js|�qSr)�is_alive�daemon��.0�threadrrr�
<listcomp>�s�z6ThreadedChildWatcher._join_threads.<locals>.<listcomp>N)r(rI�valuesr�)r�threadsrOrrrrJ�sz"ThreadedChildWatcher._join_threadscCs|Srrr�rrrrszThreadedChildWatcher.__enter__cCsdSrrrBrrrr!szThreadedChildWatcher.__exit__cCs6dd�t|j���D�}|r2||j�d�t|d�dS)NcSsg|]}|��r|�qSr)rKrMrrrrP	s�z0ThreadedChildWatcher.__del__.<locals>.<listcomp>z0 has registered but not finished child processesr#)r(rIrQr"r,)rr�rRrrrr�s�zThreadedChildWatcher.__del__cGsFt��}tj|jdt|j���||||fdd�}||j|<|��dS)Nzwaitpid-T)�target�namerErL)	rrDr<ZThreadr+�nextrHrI�start)rrnrDrEr�rOrrrr_s
�
z&ThreadedChildWatcher.add_child_handlercCsdSr�rrrrrrsz)ThreadedChildWatcher.remove_child_handlercCsdSrrrrrrrsz ThreadedChildWatcher.attach_loopcCs�|dkst�zt�|d�\}}Wn(tk
rH|}d}t�d|�Yn Xt|�}|��rht�d||�|�	�r�t�d||�n|j
|||f|��|j�|�dS)Nrr4r5r6rE)
rwrxr8r:r
rr'r�r�rFrmrIr;)rr�r*rDrErnr&rorrrr+"s(�
�z ThreadedChildWatcher._do_waitpidN)r�r�r�r�rr\r%rJrr!r*r+r�r_rrr+rrrrr�s	rcsHeZdZdZeZ�fdd�Zdd�Z�fdd�Zdd	�Z	d
d�Z
�ZS)�_UnixDefaultEventLoopPolicyz:UNIX event loop policy with a watcher for child processes.cst���d|_dSr)rr�_watcherr�r!rrrAs
z$_UnixDefaultEventLoopPolicy.__init__c	CsHtj�8|jdkr:t�|_tt��tj�r:|j�|j	j
�W5QRXdSr)rr=rXrrOr<�current_thread�_MainThreadr�_localr�r�rrr�
_init_watcherEs
�z)_UnixDefaultEventLoopPolicy._init_watchercs6t��|�|jdk	r2tt��tj�r2|j�|�dS)z�Set the event loop.

        As a side effect, if a child watcher was set before, then calling
        .set_event_loop() from the main thread will call .attach_loop(loop) on
        the child watcher.
        N)r�set_event_looprXrOr<rYrZrrr!rrr]Ms

�z*_UnixDefaultEventLoopPolicy.set_event_loopcCs|jdkr|��|jS)z~Get the watcher for child processes.

        If not yet set, a ThreadedChildWatcher object is automatically created.
        N)rXr\r�rrrr[[s
z-_UnixDefaultEventLoopPolicy.get_child_watchercCs4|dkst|t�st�|jdk	r*|j��||_dS)z$Set the watcher for child processes.N)rOrrwrXr%)rrjrrr�set_child_watcheres

z-_UnixDefaultEventLoopPolicy.set_child_watcher)r�r�r�r�rZ
_loop_factoryrr\r]r[r^r�rrr!rrW=s
rW)2r�rBr�rGrxr�r9rzr�rr&r<r*�rrrrrrr	r
rr�logr
�__all__r��ImportErrorrZBaseSelectorEventLooprZ
ReadTransportrRZ_FlowControlMixinZWriteTransportrYZBaseSubprocessTransportr^rr'r(rrrrZBaseDefaultEventLoopPolicyrWrrrrrr�<module>s`	
	�NO5Ji}Y3asyncio/__pycache__/base_tasks.cpython-38.pyc000064400000003632151153537520015203 0ustar00U

e5d�	�@sDddlZddlZddlmZddlmZdd�Zdd�Zd	d
�ZdS)�N�)�base_futures)�
coroutinescCsnt�|�}|jrd|d<|�dd|���t�|j�}|�dd|�d��|jdk	rj|�dd	|j���|S)
NZ
cancellingrrzname=%r�zcoro=<�>�z	wait_for=)	rZ_future_repr_infoZ_must_cancel�insertZget_namerZ_format_coroutine�_coroZ_fut_waiter)�task�info�coro�r
�*/usr/lib64/python3.8/asyncio/base_tasks.py�_task_repr_infos

rcCs�g}t|jd�r|jj}n0t|jd�r0|jj}nt|jd�rF|jj}nd}|dk	r�|dk	r�|dk	rt|dkrlq�|d8}|�|�|j}qR|��nH|jdk	r�|jj	}|dk	r�|dk	r�|dkr�q�|d8}|�|j
�|j}q�|S)N�cr_frame�gi_frame�ag_framerr)�hasattrr	rrr�append�f_back�reverse�
_exception�
__traceback__�tb_frame�tb_next)r
�limitZframes�f�tbr
r
r�_task_get_stacks6





rcCs�g}t�}|j|d�D]Z}|j}|j}|j}|j}	||krN|�|�t�|�t�	|||j
�}
|�|||	|
f�q|j}|s�t
d|��|d�n2|dk	r�t
d|�d�|d�nt
d|�d�|d�tj||d�|dk	r�t�|j|�D]}
t
|
|dd�q�dS)	N)rz
No stack for )�filezTraceback for z (most recent call last):z
Stack for �)r�end)�setZ	get_stack�f_lineno�f_code�co_filename�co_name�add�	linecache�
checkcache�getline�	f_globalsrr�print�	traceback�
print_list�format_exception_only�	__class__)r
rr�extracted_list�checkedr�lineno�co�filename�name�line�excr
r
r�_task_print_stack<s,

r9)r(r-r rrrrr9r
r
r
r�<module>s#asyncio/__pycache__/proactor_events.cpython-38.pyc000064400000057123151153537520016305 0ustar00U

e5d<}�@sTdZdZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddl	mZddl	mZddl	m
Z
dd	l	mZdd
l	mZddl	mZddl	mZdd
lmZdd�ZGdd�dejej�ZGdd�deej�ZGdd�deej�ZGdd�de�ZGdd�de�ZGdd�deeej�ZGdd�deeej�Z Gdd�de
j!�Z"dS) z�Event loop using a proactor and related classes.

A proactor is a "notify-on-completion" multiplexer.  Currently a
proactor is only implemented on Windows with IOCP.
)�BaseProactorEventLoop�N�)�base_events)�	constants)�futures)�
exceptions)�	protocols)�sslproto)�
transports)�trsock)�loggercCs�t�|�|jd<z|��|jd<Wn0tjk
rR|j��rNtj	d|dd�YnXd|jkr�z|�
�|jd<Wn tjk
r�d|jd<YnXdS)N�socketZsocknamezgetsockname() failed on %rT��exc_info�peername)r�TransportSocket�_extraZgetsocknamer
�error�_loop�	get_debugr�warningZgetpeername)�	transport�sock�r�//usr/lib64/python3.8/asyncio/proactor_events.py�_set_socket_extras
�
rcs�eZdZdZd�fdd�	Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
ejfdd�Z
ddd�Zdd�Zdd�Zdd�Z�ZS)�_ProactorBasePipeTransportz*Base class for pipe and socket transports.Ncs�t��||�|�|�||_|�|�||_d|_d|_d|_d|_	d|_
d|_d|_|jdk	rl|j�
�|j�|jj|�|dk	r�|j�tj|d�dS)NrF)�super�__init__�
_set_extra�_sock�set_protocol�_server�_buffer�	_read_fut�
_write_fut�_pending_write�
_conn_lost�_closing�_eof_writtenZ_attachr�	call_soon�	_protocolZconnection_maderZ_set_result_unless_cancelled��self�loopr�protocol�waiter�extra�server��	__class__rrr2s(




�z#_ProactorBasePipeTransport.__init__cCs�|jjg}|jdkr |�d�n|jr0|�d�|jdk	rP|�d|j�����|jdk	rl|�d|j���|jdk	r�|�d|j���|jr�|�dt	|j����|j
r�|�d�d�d	�|��S)
N�closed�closingzfd=zread=zwrite=zwrite_bufsize=zEOF writtenz<{}>� )
r4�__name__r �appendr(�filenor$r%r#�lenr)�format�join)r-�inforrr�__repr__Hs 






z#_ProactorBasePipeTransport.__repr__cCs||jd<dS)N�pipe)r�r-rrrrrZsz%_ProactorBasePipeTransport._set_extracCs
||_dS�N�r+)r-r/rrrr!]sz'_ProactorBasePipeTransport.set_protocolcCs|jSrBrC�r-rrr�get_protocol`sz'_ProactorBasePipeTransport.get_protocolcCs|jSrB)r(rDrrr�
is_closingcsz%_ProactorBasePipeTransport.is_closingcCs\|jr
dSd|_|jd7_|js>|jdkr>|j�|jd�|jdk	rX|j��d|_dS)NTr)	r(r'r#r%rr*�_call_connection_lostr$�cancelrDrrr�closefs

z _ProactorBasePipeTransport.closecCs*|jdk	r&|d|��t|d�|��dS)Nzunclosed transport )�source)r �ResourceWarningrI)r-Z_warnrrr�__del__qs
z"_ProactorBasePipeTransport.__del__�Fatal error on pipe transportc	CsVzDt|t�r*|j��rBtjd||dd�n|j�||||jd��W5|�|�XdS)Nz%r: %sTr)�message�	exceptionrr/)	�_force_close�
isinstance�OSErrorrrr�debug�call_exception_handlerr+)r-�excrNrrr�_fatal_errorvs

�z'_ProactorBasePipeTransport._fatal_errorcCs�|jdk	r6|j��s6|dkr*|j�d�n|j�|�|jr@dSd|_|jd7_|jrj|j��d|_|jr�|j��d|_d|_	d|_
|j�|j
|�dS)NTrr)�
_empty_waiter�done�
set_resultZ
set_exceptionr(r'r%rHr$r&r#rr*rG)r-rUrrrrP�s"

z'_ProactorBasePipeTransport._force_closec	Cs^z|j�	|�W5t|jd�r,|j�tj�|j��d|_|j}|dk	rX|��d|_XdS)N�shutdown)
�hasattrr rZr
Z	SHUT_RDWRrIr"Z_detachr+Zconnection_lost)r-rUr2rrrrG�s
z0_ProactorBasePipeTransport._call_connection_lostcCs"|j}|jdk	r|t|j�7}|SrB)r&r#r;)r-�sizerrr�get_write_buffer_size�s
z0_ProactorBasePipeTransport.get_write_buffer_size)NNN)rM)r8�
__module__�__qualname__�__doc__rr?rr!rErFrI�warnings�warnrLrVrPrGr]�
__classcell__rrr3rr.s �
rcsTeZdZdZd�fdd�	Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	ddd�Z
�ZS)�_ProactorReadPipeTransportzTransport for read pipes.Ncs:d|_d|_t��||||||�|j�|j�d|_dS)NTF)�
_pending_data�_pausedrrrr*�
_loop_readingr,r3rrr�s
z#_ProactorReadPipeTransport.__init__cCs|jo|jSrB)rfr(rDrrr�
is_reading�sz%_ProactorReadPipeTransport.is_readingcCs0|js|jrdSd|_|j��r,t�d|�dS)NTz%r pauses reading)r(rfrrrrSrDrrr�
pause_reading�s

z(_ProactorReadPipeTransport.pause_readingcCsn|js|jsdSd|_|jdkr0|j�|jd�|j}d|_|dk	rT|j�|j|�|j��rjt	�
d|�dS)NFz%r resumes reading)r(rfr$rr*rgre�_data_receivedrrrS�r-�datarrr�resume_reading�s

z)_ProactorReadPipeTransport.resume_readingc
Cs�|j��rt�d|�z|j��}WnLttfk
r>�Yn4tk
rp}z|�	|d�WY�dSd}~XYnX|s~|�
�dS)Nz%r received EOFz1Fatal error: protocol.eof_received() call failed.)rrrrSr+Zeof_received�
SystemExit�KeyboardInterrupt�
BaseExceptionrVrI)r-Z	keep_openrUrrr�
_eof_received�s
�z(_ProactorReadPipeTransport._eof_receivedc
Cs�|jr|jdkst�||_dS|s.|��dSt|jtj�r�zt�|j|�Wq�t	t
fk
rh�Yq�tk
r�}z|�|d�WY�dSd}~XYq�Xn|j�
|�dS)Nz3Fatal error: protocol.buffer_updated() call failed.)rfre�AssertionErrorrqrQr+rZBufferedProtocolZ_feed_data_to_buffered_protornrorprVZ
data_received)r-rlrUrrrrj�s$�z)_ProactorReadPipeTransport._data_receivedc
Cs�d}�zrz�|dk	rP|j|ks0|jdkr,|js0t�d|_|��rH|��}n|��|jrfd}WW��dS|dkrzWW��dS|js�|jj	�
|jd�|_Wn�tk
r�}z0|js�|�
|d�n|j��r�tjddd�W5d}~XYn�tk
�r}z|�|�W5d}~XYnftk
�r>}z|�
|d�W5d}~XYn8tjk
�r^|j�sZ�YnX|j�sv|j�|j�W5|dk	�r�|�|�XdS)N�i�z"Fatal read error on pipe transportz*Read error on pipe transport while closingTr)rjr$r(rrrX�resultrHrfr�	_proactor�recvr �ConnectionAbortedErrorrVrrrS�ConnectionResetErrorrPrRr�CancelledError�add_done_callbackrg)r-�futrlrUrrrrgsF�

�
z(_ProactorReadPipeTransport._loop_reading)NNN)N)r8r^r_r`rrhrirmrqrjrgrcrrr3rrd�s�	rdcs^eZdZdZdZ�fdd�Zdd�Zddd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Z�Z
S)�_ProactorBaseWritePipeTransportzTransport for write pipes.Tcst�j||�d|_dSrB)rrrW�r-�args�kwr3rrrGsz(_ProactorBaseWritePipeTransport.__init__cCs�t|tttf�s$tdt|�j����|jr2td��|j	dk	rDtd��|sLdS|j
rz|j
tjkrht
�d�|j
d7_
dS|jdkr�|jdks�t�|jt|�d�n.|js�t|�|_|��n|j�|�|��dS)Nz/data argument must be a bytes-like object, not zwrite_eof() already calledz(unable to write; sendfile is in progresszsocket.send() raised exception.r)rl)rQ�bytes�	bytearray�
memoryview�	TypeError�typer8r)�RuntimeErrorrWr'r�!LOG_THRESHOLD_FOR_CONNLOST_WRITESrrr%r#rr�
_loop_writing�_maybe_pause_protocol�extendrkrrr�writeKs.�




z%_ProactorBaseWritePipeTransport.writeNc
Csx�z|dk	r"|jdkr"|jr"WdS||jks0t�d|_d|_|rH|��|dkr\|j}d|_|s�|jrv|j�|jd�|j	r�|j
�tj
�|��n\|jj�|j
|�|_|j��s�|jdks�t�t|�|_|j�|j�|��n|j�|j�|jdk	�r|jdk�r|j�d�Wn\tk
�rD}z|�|�W5d}~XYn0tk
�rr}z|�|d�W5d}~XYnXdS)Nrz#Fatal write error on pipe transport)r%r(rrr&rtr#rr*rGr)r rZr
�SHUT_WR�_maybe_resume_protocolru�sendrXr;rzr�r�rWrYrxrPrRrV)r-�frlrUrrrr�qs<



z-_ProactorBaseWritePipeTransport._loop_writingcCsdS�NTrrDrrr�
can_write_eof�sz-_ProactorBaseWritePipeTransport.can_write_eofcCs|��dSrB)rIrDrrr�	write_eof�sz)_ProactorBaseWritePipeTransport.write_eofcCs|�d�dSrB�rPrDrrr�abort�sz%_ProactorBaseWritePipeTransport.abortcCs:|jdk	rtd��|j��|_|jdkr4|j�d�|jS)NzEmpty waiter is already set)rWr�rZ
create_futurer%rYrDrrr�_make_empty_waiter�s

z2_ProactorBaseWritePipeTransport._make_empty_waitercCs
d|_dSrB)rWrDrrr�_reset_empty_waiter�sz3_ProactorBaseWritePipeTransport._reset_empty_waiter)NN)r8r^r_r`Z_start_tls_compatiblerr�r�r�r�r�r�r�rcrrr3rr|As&
)r|cs$eZdZ�fdd�Zdd�Z�ZS)�_ProactorWritePipeTransportcs4t�j||�|jj�|jd�|_|j�|j�dS)N�)	rrrrurvr r$rz�_pipe_closedr}r3rrr�sz$_ProactorWritePipeTransport.__init__cCsv|��rdS|��dkst�|jr4|jdks0t�dS||jksLt||jf��d|_|jdk	rj|�t��n|��dS)Nrs)	Z	cancelledrtrrr(r$r%rP�BrokenPipeErrorrI)r-r{rrrr��s
z(_ProactorWritePipeTransport._pipe_closed)r8r^r_rr�rcrrr3rr��sr�csXeZdZdZd�fdd�	Zdd�Zdd�Zd	d
�Zddd�Zdd
d�Z	ddd�Z
�ZS)�_ProactorDatagramTransportiNcs>||_d|_t�j|||||d�t��|_|j�|j	�dS)N)r0r1)
�_addressrWrr�collections�dequer#rr*rg)r-r.rr/�addressr0r1r3rrr�s

z#_ProactorDatagramTransport.__init__cCst||�dSrB�rrArrrr�sz%_ProactorDatagramTransport._set_extracCstdd�|jD��S)Ncss|]\}}t|�VqdSrB)r;)�.0rl�_rrr�	<genexpr>�szC_ProactorDatagramTransport.get_write_buffer_size.<locals>.<genexpr>)�sumr#rDrrrr]�sz0_ProactorDatagramTransport.get_write_buffer_sizecCs|�d�dSrBr�rDrrrr��sz _ProactorDatagramTransport.abortcCs�t|tttf�stdt|���|s&dS|jdk	rN|d|jfkrNtd|j����|jr�|jr�|jt	j
krpt�d�|jd7_dS|j
�t|�|f�|jdkr�|��|��dS)Nz,data argument must be bytes-like object (%r)z!Invalid address: must be None or z!socket.sendto() raised exception.r)rQr�r�r�r�r�r��
ValueErrorr'rr�rrr#r9r%r�r�)r-rl�addrrrr�sendto�s&�
�

z!_ProactorDatagramTransport.sendtoc
Csz�|jrWdS||jkst�d|_|r.|��|jr@|jr\|jr\|jrV|j�|j	d�WdS|j�
�\}}|jdk	r�|jj�|j
|�|_n|jjj|j
||d�|_WnZtk
r�}z|j�|�W5d}~XYnDtk
r�}z|�|d�W5d}~XYnX|j�|j�|��dS)N)r�z'Fatal write error on datagram transport)r'r%rrrtr#r�r(rr*rG�popleftrur�r r�rRr+�error_received�	ExceptionrVrzr�r�)r-r{rlr�rUrrrr��s4
��z(_ProactorDatagramTransport._loop_writingc
CsVd}�z4z�|jrWW��$dS|j|ks:|jdkr6|js:t�d|_|dk	r�|��}|jrdd}WW��dS|jdk	r|||j}}n|\}}|jr�WW��dS|jdk	r�|jj	�
|j|j�|_n|jj	�
|j|j�|_WnNtk
r�}z|j�|�W5d}~XYn<tjk
�r|j�s�YnX|jdk	�r8|j�|j�W5|�rP|j�||�XdSrB)r+Zdatagram_receivedr'r$r(rrrtr�rrurvr �max_sizeZrecvfromrRr�rryrzrg)r-r{rlr��resrUrrrrgsD�



��
z(_ProactorDatagramTransport._loop_reading)NNN)N)N)N)r8r^r_r�rrr]r�r�r�rgrcrrr3rr��s�

!r�c@s eZdZdZdd�Zdd�ZdS)�_ProactorDuplexPipeTransportzTransport for duplex pipes.cCsdS)NFrrDrrrr�Jsz*_ProactorDuplexPipeTransport.can_write_eofcCst�dSrB)�NotImplementedErrorrDrrrr�Msz&_ProactorDuplexPipeTransport.write_eofN)r8r^r_r`r�r�rrrrr�Esr�csBeZdZdZejjZd�fdd�	Zdd�Z	dd�Z
d	d
�Z�ZS)�_ProactorSocketTransportz Transport for connected sockets.Ncs$t��||||||�t�|�dSrB)rrrZ_set_nodelayr,r3rrrXsz!_ProactorSocketTransport.__init__cCst||�dSrBr�rArrrr]sz#_ProactorSocketTransport._set_extracCsdSr�rrDrrrr�`sz&_ProactorSocketTransport.can_write_eofcCs2|js|jrdSd|_|jdkr.|j�tj�dSr�)r(r)r%r rZr
r�rDrrrr�cs

z"_ProactorSocketTransport.write_eof)NNN)
r8r^r_r`rZ
_SendfileModeZ
TRY_NATIVEZ_sendfile_compatiblerrr�r�rcrrr3rr�Qs�r�cs�eZdZ�fdd�Zd3dd�Zd4dddddd�dd	�Zd5d
d�Zd6dd
�Zd7dd�Zd8dd�Z	�fdd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd9d&d'�Zd(d)�Zd:d+d,�Zd-d.�Zd/d0�Zd1d2�Z�ZS);rcsht���t�d|jj�||_||_d|_i|_	|�
|�|��t�
�t��krdt�|j���dS)NzUsing proactor: %s)rrrrSr4r8ru�	_selector�_self_reading_future�_accept_futuresZset_loop�_make_self_pipe�	threading�current_thread�main_thread�signal�
set_wakeup_fd�_csockr:)r-Zproactorr3rrrms

zBaseProactorEventLoop.__init__NcCst||||||�SrB)r�)r-rr/r0r1r2rrr�_make_socket_transportzs
�z,BaseProactorEventLoop._make_socket_transportF)�server_side�server_hostnamer1r2�ssl_handshake_timeoutc	Cs0tj|||||||	d�}
t|||
||d�|
jS)N)r��r1r2)r	ZSSLProtocolr�Z_app_transport)r-Zrawsockr/�
sslcontextr0r�r�r1r2r�Zssl_protocolrrr�_make_ssl_transports��z)BaseProactorEventLoop._make_ssl_transportcCst||||||�SrB)r�)r-rr/r�r0r1rrr�_make_datagram_transport�s
�z.BaseProactorEventLoop._make_datagram_transportcCst|||||�SrB)r��r-rr/r0r1rrr�_make_duplex_pipe_transport�s�z1BaseProactorEventLoop._make_duplex_pipe_transportcCst|||||�SrB)rdr�rrr�_make_read_pipe_transport�sz/BaseProactorEventLoop._make_read_pipe_transportcCst|||||�SrB)r�r�rrr�_make_write_pipe_transport�s�z0BaseProactorEventLoop._make_write_pipe_transportcsj|��rtd��|��rdSt��t��kr6t�d�|��|�	�|j
��d|_
d|_t
���dS)Nz!Cannot close a running event loop���)Z
is_runningr��	is_closedr�r�r�r�r��_stop_accept_futures�_close_self_piperurIr�rrDr3rrrI�s

zBaseProactorEventLoop.closec�s|j�||�IdHSrB)rurv)r-r�nrrr�	sock_recv�szBaseProactorEventLoop.sock_recvc�s|j�||�IdHSrB)ruZ	recv_into)r-rZbufrrr�sock_recv_into�sz$BaseProactorEventLoop.sock_recv_intoc�s|j�||�IdHSrB)rur�)r-rrlrrr�sock_sendall�sz"BaseProactorEventLoop.sock_sendallc�s|j�||�IdHSrB)ruZconnect)r-rr�rrr�sock_connect�sz"BaseProactorEventLoop.sock_connectc�s|j�|�IdHSrB)ru�acceptrArrr�sock_accept�sz!BaseProactorEventLoop.sock_acceptc
�s(z|��}Wn2ttjfk
r>}zt�d��W5d}~XYnXzt�|�j}Wn,t	k
r|}zt�d��W5d}~XYnX|r�|n|}|s�dSt
|d�}|r�t
|||�n|}	t
||�}d}
zLt
|	||�}|dkr�|
W�0S|j�
||||�IdH||7}|
|7}
q�W5|
dk�r"|�|�XdS)Nznot a regular filerl��)r:�AttributeError�io�UnsupportedOperationrZSendfileNotAvailableError�os�fstat�st_sizerR�min�seekru�sendfile)r-r�file�offset�countr:�errZfsizeZ	blocksizeZend_posZ
total_sentrrr�_sock_sendfile_native�s0


z+BaseProactorEventLoop._sock_sendfile_nativec�sZ|��}|��|��IdHz |j|j|||dd�IdHW�S|��|rT|��XdS)NF)Zfallback)rhrir�r�rmZ
sock_sendfiler )r-Ztranspr�r�r�rmrrr�_sendfile_native�s�z&BaseProactorEventLoop._sendfile_nativecCsL|jdk	r|j��d|_|j��d|_|j��d|_|jd8_dS)Nr)r�rH�_ssockrIr��
_internal_fdsrDrrrr��s



z&BaseProactorEventLoop._close_self_pipecCs:t��\|_|_|j�d�|j�d�|jd7_dS)NFr)r
Z
socketpairr�r�Zsetblockingr�rDrrrr��sz%BaseProactorEventLoop._make_self_pipec
Cs�z4|dk	r|��|j|k	r"WdS|j�|jd�}Wnbtjk
rLYdSttfk
rd�YnFt	k
r�}z|�
d||d��W5d}~XYnX||_|�|j�dS)Niz.Error on reading from the event loop self pipe)rNrOr.)
rtr�rurvr�rryrnrorprTrz�_loop_self_reading)r-r�rUrrrr��s$
�z(BaseProactorEventLoop._loop_self_readingcCsN|j}|dkrdSz|�d�Wn(tk
rH|jrDtjddd�YnXdS)N�z3Fail to write a null byte into the self-pipe socketTr)r�r�rR�_debugrrS)r-Zcsockrrr�_write_to_selfs�z$BaseProactorEventLoop._write_to_self�dcs(d�������fdd�	�����dS)Nc
s,z�|dk	rn|��\}}�jr,t�d�||���}�dk	rX�j||�dd|i��d�n�j||d|i�d����r|WdS�j���}Wn�t	k
r�}zH��
�dkrʈ�d|t�
��d�����n�jr�tjd	�dd
�W5d}~XYn8tjk
�r���YnX|�j��
�<|���dS)Nz#%r got a new connection from %r: %rTr)r�r1r2r�r�r�zAccept failed on a socket)rNrOr
zAccept failed on socket %rr)rtr�rrSr�r�r�rur�rRr:rTrrrIrryr�rz)r�Zconnr�r/rU�r.�protocol_factoryr-r2rr�r�rrr./s\����
�z2BaseProactorEventLoop._start_serving.<locals>.loop)N)r*)r-r�rr�r2Zbacklogr�rr�r�_start_serving+s%z$BaseProactorEventLoop._start_servingcCsdSrBr)r-Z
event_listrrr�_process_eventsVsz%BaseProactorEventLoop._process_eventscCs&|j��D]}|��q
|j��dSrB)r��valuesrH�clear)r-�futurerrrr�Zs
z*BaseProactorEventLoop._stop_accept_futurescCs6|j�|��d�}|r|��|j�|�|��dSrB)r��popr:rHru�
_stop_servingrI)r-rr�rrrr�_s
z#BaseProactorEventLoop._stop_serving)NNN)N)NNN)NN)NN)NN)N)NNr�N)r8r^r_rr�r�r�r�r�r�rIr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rcrrr3rrks\
�
���
�
�
�


�
+r)#r`�__all__r�r�r
rar�r�r��rrrrrr	r
r�logrrZ_FlowControlMixinZ
BaseTransportrZ
ReadTransportrdZWriteTransportr|r�r�Z	Transportr�r�Z
BaseEventLooprrrrr�<module>sR���n��asyncio/__pycache__/events.cpython-38.opt-1.pyc000064400000066457151153537520015345 0ustar00U

e5d4f�@s|dZdZddlZddlZddlZddlZddlZddlZddlm	Z	ddlm
Z
Gdd�d�ZGd	d
�d
e�ZGdd�d�Z
Gd
d�d�ZGdd�d�ZGdd�de�Zdae��ZGdd�dej�Ze�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Z d)d*�Z!eZ"eZ#eZ$eZ%zdd+l&mZmZmZmZWne'k
�rfYnXeZ(eZ)eZ*eZ+dS),z!Event loop and event loop policy.)�AbstractEventLoopPolicy�AbstractEventLoop�AbstractServer�Handle�TimerHandle�get_event_loop_policy�set_event_loop_policy�get_event_loop�set_event_loop�new_event_loop�get_child_watcher�set_child_watcher�_set_running_loop�get_running_loop�_get_running_loop�N�)�format_helpers)�
exceptionsc@sFeZdZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)rz1Object returned by callback registration methods.)�	_callback�_args�
_cancelled�_loop�_source_traceback�_repr�__weakref__�_contextNcCs\|dkrt��}||_||_||_||_d|_d|_|j��rRt	�
t�d��|_
nd|_
dS)NFr)�contextvarsZcopy_contextrrrrrr�	get_debugr�
extract_stack�sys�	_getframer)�self�callback�args�loop�context�r&�&/usr/lib64/python3.8/asyncio/events.py�__init__ s
�zHandle.__init__cCsl|jjg}|jr|�d�|jdk	r:|�t�|j|j��|jrh|jd}|�d|d�d|d���|S)N�	cancelled���zcreated at r�:r)	�	__class__�__name__r�appendrr�_format_callback_sourcerr)r!�info�framer&r&r'�
_repr_info/s


�
zHandle._repr_infocCs(|jdk	r|jS|��}d�d�|��S)Nz<{}>� )rr2�format�join)r!r0r&r&r'�__repr__;s
zHandle.__repr__cCs0|js,d|_|j��r t|�|_d|_d|_dS�NT)rrr�reprrrr�r!r&r&r'�cancelAs

z
Handle.cancelcCs|jS�N)rr9r&r&r'r)LszHandle.cancelledc
Cs�z|jj|jf|j��Wn|ttfk
r4�Yndtk
r�}zFt�|j|j�}d|��}|||d�}|j	rz|j	|d<|j
�|�W5d}~XYnXd}dS)NzException in callback )�messageZ	exception�handleZsource_traceback)r�runrr�
SystemExit�KeyboardInterrupt�
BaseExceptionrr/rr�call_exception_handler)r!�exc�cb�msgr%r&r&r'�_runOs$�
�
zHandle._run)N)r-�
__module__�__qualname__�__doc__�	__slots__r(r2r6r:r)rFr&r&r&r'rs
rcs�eZdZdZddgZd�fdd�	Z�fdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
�fdd�Zdd�Z�ZS)rz7Object returned by timed callback registration methods.�
_scheduled�_whenNcs0t��||||�|jr |jd=||_d|_dS)Nr*F)�superr(rrLrK)r!�whenr"r#r$r%�r,r&r'r(hs
zTimerHandle.__init__cs0t���}|jrdnd}|�|d|j���|S)N�rzwhen=)rMr2r�insertrL)r!r0�posrOr&r'r2ps
zTimerHandle._repr_infocCs
t|j�Sr;)�hashrLr9r&r&r'�__hash__vszTimerHandle.__hash__cCs|j|jkSr;�rL�r!�otherr&r&r'�__lt__yszTimerHandle.__lt__cCs|j|jkrdS|�|�Sr7�rL�__eq__rVr&r&r'�__le__|szTimerHandle.__le__cCs|j|jkSr;rUrVr&r&r'�__gt__�szTimerHandle.__gt__cCs|j|jkrdS|�|�Sr7rYrVr&r&r'�__ge__�szTimerHandle.__ge__cCs>t|t�r:|j|jko8|j|jko8|j|jko8|j|jkStSr;)�
isinstancerrLrrr�NotImplementedrVr&r&r'rZ�s

�
�
�zTimerHandle.__eq__cCs|�|�}|tkrtS|Sr;)rZr_)r!rWZequalr&r&r'�__ne__�s
zTimerHandle.__ne__cs |js|j�|�t���dSr;)rr�_timer_handle_cancelledrMr:r9rOr&r'r:�szTimerHandle.cancelcCs|jS)z�Return a scheduled callback time.

        The time is an absolute timestamp, using the same time
        reference as loop.time().
        rUr9r&r&r'rN�szTimerHandle.when)N)r-rGrHrIrJr(r2rTrXr[r\r]rZr`r:rN�
__classcell__r&r&rOr'rcsrc@sPeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�ZdS)rz,Abstract server returned by create_server().cCst�dS)z5Stop serving.  This leaves existing connections open.N��NotImplementedErrorr9r&r&r'�close�szAbstractServer.closecCst�dS)z4Get the event loop the Server object is attached to.Nrcr9r&r&r'�get_loop�szAbstractServer.get_loopcCst�dS)z3Return True if the server is accepting connections.Nrcr9r&r&r'�
is_serving�szAbstractServer.is_servingc�st�dS)z�Start accepting connections.

        This method is idempotent, so it can be called when
        the server is already being serving.
        Nrcr9r&r&r'�
start_serving�szAbstractServer.start_servingc�st�dS)z�Start accepting connections until the coroutine is cancelled.

        The server is closed when the coroutine is cancelled.
        Nrcr9r&r&r'�
serve_forever�szAbstractServer.serve_foreverc�st�dS)z*Coroutine to wait until service is closed.Nrcr9r&r&r'�wait_closed�szAbstractServer.wait_closedc�s|Sr;r&r9r&r&r'�
__aenter__�szAbstractServer.__aenter__c�s|��|��IdHdSr;)rerj)r!rCr&r&r'�	__aexit__�szAbstractServer.__aexit__N)r-rGrHrIrerfrgrhrirjrkrlr&r&r&r'r�src@sVeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�dd�Zd d!�Zd"d#�Zd$d%�Zd&d&d&d&d'�d(d)�Zdud*d+�Zdvdd&d&d&ddddddd,�
d-d.�Zdwejejdd/ddddd0d1�	d2d3�Zdxd0d4�d5d6�Zd7ddd8�d9d:�Zdyddddd;�d<d=�Zdzdd/ddd0d>�d?d@�Zd{d&d&d&dddddA�dBdC�Z dDdE�Z!dFdG�Z"e#j$e#j$e#j$dH�dIdJ�Z%e#j$e#j$e#j$dH�dKdL�Z&dMdN�Z'dOdP�Z(dQdR�Z)dSdT�Z*dUdV�Z+dWdX�Z,dYdZ�Z-d[d\�Z.d]d^�Z/d|dd4�d_d`�Z0dadb�Z1dcdd�Z2dedf�Z3dgdh�Z4didj�Z5dkdl�Z6dmdn�Z7dodp�Z8dqdr�Z9dsdt�Z:dS)}rzAbstract event loop.cCst�dS)z*Run the event loop until stop() is called.Nrcr9r&r&r'�run_forever�szAbstractEventLoop.run_forevercCst�dS)zpRun the event loop until a Future is done.

        Return the Future's result, or raise its exception.
        Nrc)r!Zfuturer&r&r'�run_until_complete�sz$AbstractEventLoop.run_until_completecCst�dS)z�Stop the event loop as soon as reasonable.

        Exactly how soon that is may depend on the implementation, but
        no more I/O callbacks should be scheduled.
        Nrcr9r&r&r'�stop�szAbstractEventLoop.stopcCst�dS)z3Return whether the event loop is currently running.Nrcr9r&r&r'�
is_running�szAbstractEventLoop.is_runningcCst�dS)z*Returns True if the event loop was closed.Nrcr9r&r&r'�	is_closed�szAbstractEventLoop.is_closedcCst�dS)z�Close the loop.

        The loop should not be running.

        This is idempotent and irreversible.

        No other methods should be called after this one.
        Nrcr9r&r&r're�s	zAbstractEventLoop.closec�st�dS)z,Shutdown all active asynchronous generators.Nrcr9r&r&r'�shutdown_asyncgens�sz$AbstractEventLoop.shutdown_asyncgenscCst�dS)z3Notification that a TimerHandle has been cancelled.Nrc)r!r=r&r&r'ra�sz)AbstractEventLoop._timer_handle_cancelledcGs|jd|f|��S)Nr)�
call_later�r!r"r#r&r&r'�	call_soonszAbstractEventLoop.call_sooncGst�dSr;rc)r!Zdelayr"r#r&r&r'rsszAbstractEventLoop.call_latercGst�dSr;rc)r!rNr"r#r&r&r'�call_atszAbstractEventLoop.call_atcCst�dSr;rcr9r&r&r'�timeszAbstractEventLoop.timecCst�dSr;rcr9r&r&r'�
create_futureszAbstractEventLoop.create_futureN)�namecCst�dSr;rc)r!�cororyr&r&r'�create_taskszAbstractEventLoop.create_taskcGst�dSr;rcrtr&r&r'�call_soon_threadsafesz&AbstractEventLoop.call_soon_threadsafecGst�dSr;rc)r!�executor�funcr#r&r&r'�run_in_executorsz!AbstractEventLoop.run_in_executorcCst�dSr;rc)r!r}r&r&r'�set_default_executorsz&AbstractEventLoop.set_default_executorr)�family�type�proto�flagsc�st�dSr;rc)r!�host�portr�r�r�r�r&r&r'�getaddrinfo#szAbstractEventLoop.getaddrinfoc�st�dSr;rc)r!Zsockaddrr�r&r&r'�getnameinfo'szAbstractEventLoop.getnameinfo)
�sslr�r�r��sock�
local_addr�server_hostname�ssl_handshake_timeout�happy_eyeballs_delay�
interleavec
�st�dSr;rc)r!�protocol_factoryr�r�r�r�r�r�r�r�r�r�r�r�r&r&r'�create_connection*sz#AbstractEventLoop.create_connection�dT)	r�r�r��backlogr��
reuse_address�
reuse_portr�rhc	
�st�dS)adA coroutine which creates a TCP server bound to host and port.

        The return value is a Server object which can be used to stop
        the service.

        If host is an empty string or None all interfaces are assumed
        and a list of multiple sockets will be returned (most likely
        one for IPv4 and another one for IPv6). The host parameter can also be
        a sequence (e.g. list) of hosts to bind to.

        family can be set to either AF_INET or AF_INET6 to force the
        socket to use IPv4 or IPv6. If not set it will be determined
        from host (defaults to AF_UNSPEC).

        flags is a bitmask for getaddrinfo().

        sock can optionally be specified in order to use a preexisting
        socket object.

        backlog is the maximum number of queued connections passed to
        listen() (defaults to 100).

        ssl can be set to an SSLContext to enable SSL over the
        accepted connections.

        reuse_address tells the kernel to reuse a local socket in
        TIME_WAIT state, without waiting for its natural timeout to
        expire. If not specified will automatically be set to True on
        UNIX.

        reuse_port tells the kernel to allow this endpoint to be bound to
        the same port as other existing endpoints are bound to, so long as
        they all set this flag when being created. This option is not
        supported on Windows.

        ssl_handshake_timeout is the time in seconds that an SSL server
        will wait for completion of the SSL handshake before aborting the
        connection. Default is 60s.

        start_serving set to True (default) causes the created server
        to start accepting connections immediately.  When set to False,
        the user should await Server.start_serving() or Server.serve_forever()
        to make the server to start accepting connections.
        Nrc)
r!r�r�r�r�r�r�r�r�r�r�r�rhr&r&r'�
create_server3s3zAbstractEventLoop.create_server)�fallbackc�st�dS)zRSend a file through a transport.

        Return an amount of sent bytes.
        Nrc)r!�	transport�file�offset�countr�r&r&r'�sendfilehszAbstractEventLoop.sendfileF)�server_sider�r�c�st�dS)z|Upgrade a transport to TLS.

        Return a new transport that *protocol* should start using
        immediately.
        Nrc)r!r�ZprotocolZ
sslcontextr�r�r�r&r&r'�	start_tlsps	zAbstractEventLoop.start_tls)r�r�r�r�c�st�dSr;rc)r!r��pathr�r�r�r�r&r&r'�create_unix_connection{sz(AbstractEventLoop.create_unix_connection)r�r�r�r�rhc�st�dS)a�A coroutine which creates a UNIX Domain Socket server.

        The return value is a Server object, which can be used to stop
        the service.

        path is a str, representing a file systsem path to bind the
        server socket to.

        sock can optionally be specified in order to use a preexisting
        socket object.

        backlog is the maximum number of queued connections passed to
        listen() (defaults to 100).

        ssl can be set to an SSLContext to enable SSL over the
        accepted connections.

        ssl_handshake_timeout is the time in seconds that an SSL server
        will wait for the SSL handshake to complete (defaults to 60s).

        start_serving set to True (default) causes the created server
        to start accepting connections immediately.  When set to False,
        the user should await Server.start_serving() or Server.serve_forever()
        to make the server to start accepting connections.
        Nrc)r!r�r�r�r�r�r�rhr&r&r'�create_unix_server�sz$AbstractEventLoop.create_unix_server)r�r�r�r�r��allow_broadcastr�c�st�dS)a�A coroutine which creates a datagram endpoint.

        This method will try to establish the endpoint in the background.
        When successful, the coroutine returns a (transport, protocol) pair.

        protocol_factory must be a callable returning a protocol instance.

        socket family AF_INET, socket.AF_INET6 or socket.AF_UNIX depending on
        host (or family if specified), socket type SOCK_DGRAM.

        reuse_address tells the kernel to reuse a local socket in
        TIME_WAIT state, without waiting for its natural timeout to
        expire. If not specified it will automatically be set to True on
        UNIX.

        reuse_port tells the kernel to allow this endpoint to be bound to
        the same port as other existing endpoints are bound to, so long as
        they all set this flag when being created. This option is not
        supported on Windows and some UNIX's. If the
        :py:data:`~socket.SO_REUSEPORT` constant is not defined then this
        capability is unsupported.

        allow_broadcast tells the kernel to allow this endpoint to send
        messages to the broadcast address.

        sock can optionally be specified in order to use a preexisting
        socket object.
        Nrc)r!r�r�Zremote_addrr�r�r�r�r�r�r�r&r&r'�create_datagram_endpoint�s!z*AbstractEventLoop.create_datagram_endpointc�st�dS)aRegister read pipe in event loop. Set the pipe to non-blocking mode.

        protocol_factory should instantiate object with Protocol interface.
        pipe is a file-like object.
        Return pair (transport, protocol), where transport supports the
        ReadTransport interface.Nrc�r!r��piper&r&r'�connect_read_pipe�sz#AbstractEventLoop.connect_read_pipec�st�dS)aRegister write pipe in event loop.

        protocol_factory should instantiate object with BaseProtocol interface.
        Pipe is file-like object already switched to nonblocking.
        Return pair (transport, protocol), where transport support
        WriteTransport interface.Nrcr�r&r&r'�connect_write_pipe�sz$AbstractEventLoop.connect_write_pipe)�stdin�stdout�stderrc�st�dSr;rc)r!r��cmdr�r�r��kwargsr&r&r'�subprocess_shell�sz"AbstractEventLoop.subprocess_shellc�st�dSr;rc)r!r�r�r�r�r#r�r&r&r'�subprocess_exec�sz!AbstractEventLoop.subprocess_execcGst�dSr;rc�r!�fdr"r#r&r&r'�
add_reader�szAbstractEventLoop.add_readercCst�dSr;rc�r!r�r&r&r'�
remove_reader�szAbstractEventLoop.remove_readercGst�dSr;rcr�r&r&r'�
add_writer�szAbstractEventLoop.add_writercCst�dSr;rcr�r&r&r'�
remove_writer�szAbstractEventLoop.remove_writerc�st�dSr;rc)r!r��nbytesr&r&r'�	sock_recvszAbstractEventLoop.sock_recvc�st�dSr;rc)r!r�Zbufr&r&r'�sock_recv_intosz AbstractEventLoop.sock_recv_intoc�st�dSr;rc)r!r��datar&r&r'�sock_sendallszAbstractEventLoop.sock_sendallc�st�dSr;rc)r!r�Zaddressr&r&r'�sock_connectszAbstractEventLoop.sock_connectc�st�dSr;rc)r!r�r&r&r'�sock_acceptszAbstractEventLoop.sock_acceptc�st�dSr;rc)r!r�r�r�r�r�r&r&r'�
sock_sendfileszAbstractEventLoop.sock_sendfilecGst�dSr;rc)r!�sigr"r#r&r&r'�add_signal_handlersz$AbstractEventLoop.add_signal_handlercCst�dSr;rc)r!r�r&r&r'�remove_signal_handlersz'AbstractEventLoop.remove_signal_handlercCst�dSr;rc)r!�factoryr&r&r'�set_task_factorysz"AbstractEventLoop.set_task_factorycCst�dSr;rcr9r&r&r'�get_task_factory"sz"AbstractEventLoop.get_task_factorycCst�dSr;rcr9r&r&r'�get_exception_handler'sz'AbstractEventLoop.get_exception_handlercCst�dSr;rc)r!Zhandlerr&r&r'�set_exception_handler*sz'AbstractEventLoop.set_exception_handlercCst�dSr;rc�r!r%r&r&r'�default_exception_handler-sz+AbstractEventLoop.default_exception_handlercCst�dSr;rcr�r&r&r'rB0sz(AbstractEventLoop.call_exception_handlercCst�dSr;rcr9r&r&r'r5szAbstractEventLoop.get_debugcCst�dSr;rc)r!Zenabledr&r&r'�	set_debug8szAbstractEventLoop.set_debug)r)NN)NN)rN)N)N)NN)rN);r-rGrHrIrmrnrorprqrerrrarursrvrwrxr{r|rr�r�r�r��socketZ	AF_UNSPECZ
AI_PASSIVEr�r�r�r�r�r�r�r��
subprocess�PIPEr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rBrr�r&r&r&r'r�s��
��
��5�	�����!��%
���rc@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
rz-Abstract policy for accessing the event loop.cCst�dS)a:Get the event loop for the current context.

        Returns an event loop object implementing the BaseEventLoop interface,
        or raises an exception in case no event loop has been set for the
        current context and the current policy does not specify to create one.

        It should never return None.Nrcr9r&r&r'r?sz&AbstractEventLoopPolicy.get_event_loopcCst�dS)z3Set the event loop for the current context to loop.Nrc�r!r$r&r&r'r	Isz&AbstractEventLoopPolicy.set_event_loopcCst�dS)z�Create and return a new event loop object according to this
        policy's rules. If there's need to set this loop as the event loop for
        the current context, set_event_loop must be called explicitly.Nrcr9r&r&r'r
Msz&AbstractEventLoopPolicy.new_event_loopcCst�dS)z$Get the watcher for child processes.Nrcr9r&r&r'rUsz)AbstractEventLoopPolicy.get_child_watchercCst�dS)z$Set the watcher for child processes.Nrc)r!�watcherr&r&r'rYsz)AbstractEventLoopPolicy.set_child_watcherN)	r-rGrHrIrr	r
rrr&r&r&r'r<s
rc@sFeZdZdZdZGdd�dej�Zdd�Zdd�Z	d	d
�Z
dd�ZdS)
�BaseDefaultEventLoopPolicya�Default policy implementation for accessing the event loop.

    In this policy, each thread has its own event loop.  However, we
    only automatically create an event loop by default for the main
    thread; other threads by default have no event loop.

    Other policies may have different rules (e.g. a single global
    event loop, or automatically creating an event loop per thread, or
    using some other notion of context to which an event loop is
    associated).
    Nc@seZdZdZdZdS)z!BaseDefaultEventLoopPolicy._LocalNF)r-rGrHr�_set_calledr&r&r&r'�_Localmsr�cCs|��|_dSr;)r��_localr9r&r&r'r(qsz#BaseDefaultEventLoopPolicy.__init__cCsX|jjdkr2|jjs2tt��tj�r2|�|���|jjdkrPt	dt��j
��|jjS)zvGet the event loop for the current context.

        Returns an instance of EventLoop or raises an exception.
        Nz,There is no current event loop in thread %r.)r�rr�r^�	threadingZcurrent_threadZ_MainThreadr	r
�RuntimeErrorryr9r&r&r'rts���z)BaseDefaultEventLoopPolicy.get_event_loopcCsd|j_||j_dS)zSet the event loop.TN)r�r�rr�r&r&r'r	�sz)BaseDefaultEventLoopPolicy.set_event_loopcCs|��S)zvCreate a new event loop.

        You must call set_event_loop() to make this the current event
        loop.
        )�
_loop_factoryr9r&r&r'r
�sz)BaseDefaultEventLoopPolicy.new_event_loop)r-rGrHrIr�r��localr�r(rr	r
r&r&r&r'r�^sr�c@seZdZdZdS)�_RunningLoop)NNN)r-rGrH�loop_pidr&r&r&r'r��sr�cCst�}|dkrtd��|S)zrReturn the running event loop.  Raise a RuntimeError if there is none.

    This function is thread-specific.
    Nzno running event loop)rr��r$r&r&r'r�srcCs&tj\}}|dk	r"|t��kr"|SdS)z�Return the running event loop or None.

    This is a low-level function intended to be used by event loops.
    This function is thread-specific.
    N)�
_running_loopr��os�getpid)Zrunning_loop�pidr&r&r'r�s
rcCs|t��ft_dS)z�Set the running event loop.

    This is a low-level function intended to be used by event loops.
    This function is thread-specific.
    N)r�r�r�r�r�r&r&r'r
�sr
c	Cs.t� tdkr ddlm}|�aW5QRXdS)Nr��DefaultEventLoopPolicy)�_lock�_event_loop_policy�r�r�r&r&r'�_init_event_loop_policy�sr�cCstdkrt�tS)z"Get the current event loop policy.N)r�r�r&r&r&r'r�srcCs|adS)zZSet the current event loop policy.

    If policy is None, the default policy is restored.N)r�)Zpolicyr&r&r'r�srcCst�}|dk	r|St���S)aGReturn an asyncio event loop.

    When called from a coroutine or a callback (e.g. scheduled with call_soon
    or similar API), this function will always return the running event loop.

    If there is no running event loop set, the function will return
    the result of `get_event_loop_policy().get_event_loop()` call.
    N)rrr)Zcurrent_loopr&r&r'r�s
rcCst��|�dS)zCEquivalent to calling get_event_loop_policy().set_event_loop(loop).N)rr	r�r&r&r'r	�sr	cCs
t���S)z?Equivalent to calling get_event_loop_policy().new_event_loop().)rr
r&r&r&r'r
�sr
cCs
t���S)zBEquivalent to calling get_event_loop_policy().get_child_watcher().)rrr&r&r&r'r�srcCst��|�S)zMEquivalent to calling
    get_event_loop_policy().set_child_watcher(watcher).)rr)r�r&r&r'r�sr)rr
rr),rI�__all__rr�r�r�rr�r�rrrrrrrr�r�ZLockr�r�r�r�rrr
r�rrrr	r
rrZ_py__get_running_loopZ_py__set_running_loopZ_py_get_running_loopZ_py_get_event_loopZ_asyncio�ImportErrorZ_c__get_running_loopZ_c__set_running_loopZ_c_get_running_loopZ_c_get_event_loopr&r&r&r'�<module>sXJ@*q"9
	asyncio/__pycache__/protocols.cpython-38.opt-1.pyc000064400000020650151153537520016046 0ustar00U

e5d��@sbdZdZGdd�d�ZGdd�de�ZGdd�de�ZGdd	�d	e�ZGd
d�de�Zdd
�ZdS)zAbstract Protocol base classes.)�BaseProtocol�Protocol�DatagramProtocol�SubprocessProtocol�BufferedProtocolc@s4eZdZdZdZdd�Zdd�Zdd�Zd	d
�ZdS)raCommon base class for protocol interfaces.

    Usually user implements protocols that derived from BaseProtocol
    like Protocol or ProcessProtocol.

    The only case when BaseProtocol should be implemented directly is
    write-only transport like write pipe
    �cCsdS)z�Called when a connection is made.

        The argument is the transport representing the pipe connection.
        To receive data, wait for data_received() calls.
        When the connection is closed, connection_lost() is called.
        Nr)�selfZ	transportrr�)/usr/lib64/python3.8/asyncio/protocols.py�connection_madeszBaseProtocol.connection_madecCsdS)z�Called when the connection is lost or closed.

        The argument is an exception object or None (the latter
        meaning a regular EOF is received or the connection was
        aborted or closed).
        Nr�r�excrrr�connection_lostszBaseProtocol.connection_lostcCsdS)aCalled when the transport's buffer goes over the high-water mark.

        Pause and resume calls are paired -- pause_writing() is called
        once when the buffer goes strictly over the high-water mark
        (even if subsequent writes increases the buffer size even
        more), and eventually resume_writing() is called once when the
        buffer size reaches the low-water mark.

        Note that if the buffer size equals the high-water mark,
        pause_writing() is not called -- it must go strictly over.
        Conversely, resume_writing() is called when the buffer size is
        equal or lower than the low-water mark.  These end conditions
        are important to ensure that things go as expected when either
        mark is zero.

        NOTE: This is the only Protocol callback that is not called
        through EventLoop.call_soon() -- if it were, it would have no
        effect when it's most needed (when the app keeps writing
        without yielding until pause_writing() is called).
        Nr�rrrr�
pause_writing%szBaseProtocol.pause_writingcCsdS)zvCalled when the transport's buffer drains below the low-water mark.

        See pause_writing() for details.
        Nrr
rrr�resume_writing;szBaseProtocol.resume_writingN)	�__name__�
__module__�__qualname__�__doc__�	__slots__r	rrrrrrrr	s	rc@s$eZdZdZdZdd�Zdd�ZdS)ranInterface for stream protocol.

    The user should implement this interface.  They can inherit from
    this class but don't need to.  The implementations here do
    nothing (they don't raise exceptions).

    When the user wants to requests a transport, they pass a protocol
    factory to a utility function (e.g., EventLoop.create_connection()).

    When the connection is made successfully, connection_made() is
    called with a suitable transport object.  Then data_received()
    will be called 0 or more times with data (bytes) received from the
    transport; finally, connection_lost() will be called exactly once
    with either an exception object or None as an argument.

    State machine of calls:

      start -> CM [-> DR*] [-> ER?] -> CL -> end

    * CM: connection_made()
    * DR: data_received()
    * ER: eof_received()
    * CL: connection_lost()
    rcCsdS)zTCalled when some data is received.

        The argument is a bytes object.
        Nr)r�datarrr�
data_received^szProtocol.data_receivedcCsdS�z�Called when the other end calls write_eof() or equivalent.

        If this returns a false value (including None), the transport
        will close itself.  If it returns a true value, closing the
        transport is up to the protocol.
        Nrr
rrr�eof_receiveddszProtocol.eof_receivedN)rrrrrrrrrrrrBsrc@s,eZdZdZdZdd�Zdd�Zdd�Zd	S)
ra�Interface for stream protocol with manual buffer control.

    Important: this has been added to asyncio in Python 3.7
    *on a provisional basis*!  Consider it as an experimental API that
    might be changed or removed in Python 3.8.

    Event methods, such as `create_server` and `create_connection`,
    accept factories that return protocols that implement this interface.

    The idea of BufferedProtocol is that it allows to manually allocate
    and control the receive buffer.  Event loops can then use the buffer
    provided by the protocol to avoid unnecessary data copies.  This
    can result in noticeable performance improvement for protocols that
    receive big amounts of data.  Sophisticated protocols can allocate
    the buffer only once at creation time.

    State machine of calls:

      start -> CM [-> GB [-> BU?]]* [-> ER?] -> CL -> end

    * CM: connection_made()
    * GB: get_buffer()
    * BU: buffer_updated()
    * ER: eof_received()
    * CL: connection_lost()
    rcCsdS)aPCalled to allocate a new receive buffer.

        *sizehint* is a recommended minimal size for the returned
        buffer.  When set to -1, the buffer size can be arbitrary.

        Must return an object that implements the
        :ref:`buffer protocol <bufferobjects>`.
        It is an error to return a zero-sized buffer.
        Nr)r�sizehintrrr�
get_buffer�szBufferedProtocol.get_buffercCsdS)z�Called when the buffer was updated with the received data.

        *nbytes* is the total number of bytes that were written to
        the buffer.
        Nr)r�nbytesrrr�buffer_updated�szBufferedProtocol.buffer_updatedcCsdSrrr
rrrr�szBufferedProtocol.eof_receivedN)rrrrrrrrrrrrrms
rc@s$eZdZdZdZdd�Zdd�ZdS)rz Interface for datagram protocol.rcCsdS)z&Called when some datagram is received.Nr)rrZaddrrrr�datagram_received�sz"DatagramProtocol.datagram_receivedcCsdS)z~Called when a send or receive operation raises an OSError.

        (Other than BlockingIOError or InterruptedError.)
        Nrr
rrr�error_received�szDatagramProtocol.error_receivedN)rrrrrrrrrrrr�src@s,eZdZdZdZdd�Zdd�Zdd�Zd	S)
rz,Interface for protocol for subprocess calls.rcCsdS)z�Called when the subprocess writes data into stdout/stderr pipe.

        fd is int file descriptor.
        data is bytes object.
        Nr)r�fdrrrr�pipe_data_received�sz%SubprocessProtocol.pipe_data_receivedcCsdS)z�Called when a file descriptor associated with the child process is
        closed.

        fd is the int file descriptor that was closed.
        Nr)rrrrrr�pipe_connection_lost�sz'SubprocessProtocol.pipe_connection_lostcCsdS)z"Called when subprocess has exited.Nrr
rrr�process_exited�sz!SubprocessProtocol.process_exitedN)rrrrrr r!r"rrrrr�s
rcCs�t|�}|r�|�|�}t|�}|s*td��||krL||d|�<|�|�dS|d|�|d|�<|�|�||d�}t|�}qdS)Nz%get_buffer() returned an empty buffer)�lenr�RuntimeErrorr)�protorZdata_lenZbufZbuf_lenrrr�_feed_data_to_buffered_proto�s


r&N)r�__all__rrrrrr&rrrr�<module>s9+9asyncio/__pycache__/subprocess.cpython-38.opt-2.pyc000064400000016042151153537520016213 0ustar00U

e5d��@s�dZddlZddlZddlmZddlmZddlmZddlmZddlm	Z	ej
Z
ejZejZGd	d
�d
ej
ej�ZGdd�d�Zddddejfd
d�Zddddejd�dd�ZdS))�create_subprocess_exec�create_subprocess_shell�N�)�events)�	protocols)�streams)�tasks)�loggercsTeZdZ�fdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
�ZS)�SubprocessStreamProtocolcsHt�j|d�||_d|_|_|_d|_d|_g|_|j	�
�|_dS)N��loopF)�super�__init__�_limit�stdin�stdout�stderr�
_transport�_process_exited�	_pipe_fds�_loopZ
create_future�
_stdin_closed)�self�limitr��	__class__��*/usr/lib64/python3.8/asyncio/subprocess.pyrsz!SubprocessStreamProtocol.__init__cCsn|jjg}|jdk	r&|�d|j���|jdk	rB|�d|j���|jdk	r^|�d|j���d�d�|��S)Nzstdin=zstdout=zstderr=z<{}>� )r�__name__r�appendrr�format�join)r�inforrr�__repr__s



z!SubprocessStreamProtocol.__repr__cCs�||_|�d�}|dk	rDtj|j|jd�|_|j�|�|j�	d�|�d�}|dk	r�tj|j|jd�|_
|j
�|�|j�	d�|�d�}|dk	r�tj||d|jd�|_dS)Nr�rr�r)�protocol�readerr)
r�get_pipe_transportr�StreamReaderrrrZ
set_transportrr r�StreamWriterr)r�	transportZstdout_transportZstderr_transportZstdin_transportrrr�connection_made)s,
�
�
�z(SubprocessStreamProtocol.connection_madecCs:|dkr|j}n|dkr |j}nd}|dk	r6|�|�dS)Nrr&)rrZ	feed_data)r�fd�datar(rrr�pipe_data_receivedAsz+SubprocessStreamProtocol.pipe_data_receivedcCs�|dkrN|j}|dk	r|��|�|�|dkr>|j�d�n|j�|�dS|dkr^|j}n|dkrn|j}nd}|dk	r�|dkr�|��n
|�|�||j	kr�|j	�
|�|��dS)Nrrr&)r�closeZconnection_lostrZ
set_resultZ
set_exceptionrrZfeed_eofr�remove�_maybe_close_transport)rr.�exc�piper(rrr�pipe_connection_lostKs*



z-SubprocessStreamProtocol.pipe_connection_lostcCsd|_|��dS)NT)rr3�rrrr�process_exitedfsz'SubprocessStreamProtocol.process_exitedcCs(t|j�dkr$|jr$|j��d|_dS)Nr)�lenrrrr1r7rrrr3js
z/SubprocessStreamProtocol._maybe_close_transportcCs||jkr|jSdS�N)rr)r�streamrrr�_get_close_waiteros
z*SubprocessStreamProtocol._get_close_waiter)r�
__module__�__qualname__rr$r-r0r6r8r3r<�
__classcell__rrrrr
s	

r
c@sjeZdZdd�Zdd�Zedd��Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
ddd�ZdS)�ProcesscCs8||_||_||_|j|_|j|_|j|_|��|_dSr:)rZ	_protocolrrrrZget_pid�pid)rr,r'rrrrruszProcess.__init__cCsd|jj�d|j�d�S)N�<r�>)rrrAr7rrrr$~szProcess.__repr__cCs
|j��Sr:)rZget_returncoder7rrr�
returncode�szProcess.returncodec�s|j��IdHSr:)rZ_waitr7rrr�wait�szProcess.waitcCs|j�|�dSr:)r�send_signal)r�signalrrrrF�szProcess.send_signalcCs|j��dSr:)r�	terminater7rrrrH�szProcess.terminatecCs|j��dSr:)r�killr7rrrrI�szProcess.killc
�s�|j��}|j�|�|r,t�d|t|��z|j��IdHWn8tt	fk
rx}z|rht�d||�W5d}~XYnX|r�t�d|�|j�
�dS)Nz%%r communicate: feed stdin (%s bytes)z%r communicate: stdin got %rz%r communicate: close stdin)r�	get_debugr�writer	�debugr9Zdrain�BrokenPipeError�ConnectionResetErrorr1)r�inputrLr4rrr�_feed_stdin�s 
� zProcess._feed_stdinc�sdSr:rr7rrr�_noop�sz
Process._noopc�s�|j�|�}|dkr|j}n|j}|j��rJ|dkr8dnd}t�d||�|��IdH}|j��r�|dkrndnd}t�d||�|�	�|S)Nr&rrrz%r communicate: read %sz%r communicate: close %s)
rr)rrrrJr	rL�readr1)rr.r,r;�name�outputrrr�_read_stream�s

zProcess._read_streamNc�s�|dk	r|�|�}n|��}|jdk	r2|�d�}n|��}|jdk	rP|�d�}n|��}tj||||jd�IdH\}}}|��IdH||fS)Nrr&r)	rPrQrrUrrZgatherrrE)rrOrrrrrr�communicate�s


�zProcess.communicate)N)rr=r>rr$�propertyrDrErFrHrIrPrQrUrVrrrrr@ts	
r@c
�sb�dkrt���ntjdtdd���fdd�}�j||f|||d�|��IdH\}}	t||	��S)N�ZThe loop argument is deprecated since Python 3.8 and scheduled for removal in Python 3.10.r&��
stacklevelcst��d�S�Nr%�r
rr%rr�<lambda>�s�z)create_subprocess_shell.<locals>.<lambda>�rrr)r�get_event_loop�warnings�warn�DeprecationWarningZsubprocess_shellr@)
�cmdrrrrr�kwds�protocol_factoryr,r'rr%rr�s$
����r)rrrrrc�sf�dkrt���ntjdtdd���fdd�}�j||f|�|||d�|��IdH\}	}
t|	|
��S)NrXr&rYcst��d�Sr[r\rr%rrr]�s�z(create_subprocess_exec.<locals>.<lambda>r^)rr_r`rarbZsubprocess_execr@)Zprogramrrrrr�argsrdrer,r'rr%rr�s(
�����r)�__all__�
subprocessr`�rrrr�logr	�PIPEZSTDOUTZDEVNULLZFlowControlMixinZSubprocessProtocolr
r@Z_DEFAULT_LIMITrrrrrr�<module>s.�bV�
�asyncio/__pycache__/windows_events.cpython-38.opt-2.pyc000064400000055626151153537520017114 0ustar00U

e5di��@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddl	mZddl	mZddl	m
Z
ddl	mZddl	mZdd	l	mZdd
l	mZddlmZdZdZd
ZdZdZdZdZGdd�dej�ZGdd�dej�ZGdd�de�ZGdd�de�ZGdd�de �Z!Gdd�dej"�Z#Gdd�dej$�Z%Gd d!�d!�Z&Gd"d#�d#ej'�Z(e#Z)Gd$d%�d%e
j*�Z+Gd&d'�d'e
j*�Z,e,Z-dS)(�N�)�events)�base_subprocess)�futures)�
exceptions)�proactor_events)�selector_events)�tasks)�
windows_utils)�logger)�SelectorEventLoop�ProactorEventLoop�IocpProactor�DefaultEventLoopPolicy�WindowsSelectorEventLoopPolicy�WindowsProactorEventLoopPolicy���i�i�g����MbP?g�������?csZeZdZdd��fdd�
Z�fdd�Zdd�Z�fd	d
�Z�fdd�Z�fd
d�Z�Z	S)�_OverlappedFutureN��loopcs&t�j|d�|jr|jd=||_dS�Nr���)�super�__init__�_source_traceback�_ov)�self�ovr��	__class__��./usr/lib64/python3.8/asyncio/windows_events.pyr1sz_OverlappedFuture.__init__csHt���}|jdk	rD|jjr dnd}|�dd|�d|jjd�d��|S)N�pendingZ	completedrzoverlapped=<z, �#x�>)r�
_repr_inforr"�insert�address�r�info�staterr r!r%7s


 z_OverlappedFuture._repr_infoc
Csr|jdkrdSz|j��WnJtk
rf}z,d||d�}|jrJ|j|d<|j�|�W5d}~XYnXd|_dS)Nz&Cancelling an overlapped future failed��message�	exception�future�source_traceback)r�cancel�OSErrorr�_loop�call_exception_handler)r�exc�contextr r r!�_cancel_overlapped>s
�
z$_OverlappedFuture._cancel_overlappedcs|��t���S�N)r6rr0�rrr r!r0Nsz_OverlappedFuture.cancelcst��|�|��dSr7)r�
set_exceptionr6�rr-rr r!r9Rsz_OverlappedFuture.set_exceptioncst��|�d|_dSr7)r�
set_resultr�r�resultrr r!r;Vsz_OverlappedFuture.set_result)
�__name__�
__module__�__qualname__rr%r6r0r9r;�
__classcell__r r rr!r+srcsjeZdZdd��fdd�
Zdd�Z�fdd�Zd	d
�Zdd�Z�fd
d�Z�fdd�Z	�fdd�Z
�ZS)�_BaseWaitHandleFutureNrcs8t�j|d�|jr|jd=||_||_||_d|_dS)NrrT)rrrr�_handle�_wait_handle�_registered)rr�handle�wait_handlerrr r!r^sz_BaseWaitHandleFuture.__init__cCst�|jd�tjkS�Nr)�_winapiZWaitForSingleObjectrCZ
WAIT_OBJECT_0r8r r r!�_pollls�z_BaseWaitHandleFuture._pollcsdt���}|�d|jd���|jdk	rB|��r4dnd}|�|�|jdk	r`|�d|jd���|S)Nzhandle=r#ZsignaledZwaitingzwait_handle=)rr%�appendrCrJrDr(rr r!r%qs



z _BaseWaitHandleFuture._repr_infocCs
d|_dSr7)r�r�futr r r!�_unregister_wait_cb{sz)_BaseWaitHandleFuture._unregister_wait_cbc
Cs�|js
dSd|_|j}d|_zt�|�Wn`tk
r�}zB|jtjkrzd||d�}|jrd|j|d<|j�	|�WY�dSW5d}~XYnX|�
d�dS�NFz$Failed to unregister the wait handler+r/)rErD�_overlappedZUnregisterWaitr1�winerror�ERROR_IO_PENDINGrr2r3rN�rrGr4r5r r r!�_unregister_wait�s$�
z&_BaseWaitHandleFuture._unregister_waitcs|��t���Sr7)rTrr0r8rr r!r0�sz_BaseWaitHandleFuture.cancelcs|��t��|�dSr7)rTrr9r:rr r!r9�sz#_BaseWaitHandleFuture.set_exceptioncs|��t��|�dSr7)rTrr;r<rr r!r;�sz _BaseWaitHandleFuture.set_result)r>r?r@rrJr%rNrTr0r9r;rAr r rr!rB[s
rBcsBeZdZdd��fdd�
Zdd�Z�fdd�Z�fd	d
�Z�ZS)�_WaitCancelFutureNrcst�j||||d�d|_dS)Nr)rr�_done_callback)rr�eventrGrrr r!r�sz_WaitCancelFuture.__init__cCstd��dS)Nz'_WaitCancelFuture must not be cancelled)�RuntimeErrorr8r r r!r0�sz_WaitCancelFuture.cancelcs$t��|�|jdk	r |�|�dSr7)rr;rVr<rr r!r;�s
z_WaitCancelFuture.set_resultcs$t��|�|jdk	r |�|�dSr7)rr9rVr:rr r!r9�s
z_WaitCancelFuture.set_exception)r>r?r@rr0r;r9rAr r rr!rU�srUcs6eZdZdd��fdd�
Z�fdd�Zdd�Z�ZS)	�_WaitHandleFutureNrcs<t�j||||d�||_d|_t�dddd�|_d|_dS)NrTF)rr�	_proactorZ_unregister_proactorrPZCreateEvent�_event�
_event_fut)rrrFrG�proactorrrr r!r�s
z_WaitHandleFuture.__init__csF|jdk	r"t�|j�d|_d|_|j�|j�d|_t��|�dSr7)	r[rI�CloseHandler\rZ�_unregisterrrrNrLrr r!rN�s
	z%_WaitHandleFuture._unregister_wait_cbc
Cs�|js
dSd|_|j}d|_zt�||j�Wn`tk
r�}zB|jtjkr~d||d�}|jrh|j|d<|j	�
|�WY�dSW5d}~XYnX|j�|j|j
�|_dSrO)rErDrPZUnregisterWaitExr[r1rQrRrr2r3rZ�_wait_cancelrNr\rSr r r!rT�s(�

�z"_WaitHandleFuture._unregister_wait)r>r?r@rrNrTrAr r rr!rY�srYc@s8eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZeZdS)�
PipeServercCs,||_t��|_d|_d|_|�d�|_dS�NT)�_address�weakref�WeakSet�_free_instances�_pipe�_accept_pipe_future�_server_pipe_handle)rr'r r r!r�s

zPipeServer.__init__cCs|j|�d�}|_|S�NF)rgri)r�tmpr r r!�_get_unconnected_pipesz PipeServer._get_unconnected_pipec
Csr|��rdStjtjB}|r&|tjO}t�|j|tjtjBtj	Btj
tjtjtj
tj�}t�|�}|j�|�|Sr7)�closedrIZPIPE_ACCESS_DUPLEXZFILE_FLAG_OVERLAPPEDZFILE_FLAG_FIRST_PIPE_INSTANCEZCreateNamedPipercZPIPE_TYPE_MESSAGEZPIPE_READMODE_MESSAGEZ	PIPE_WAITZPIPE_UNLIMITED_INSTANCESr
ZBUFSIZEZNMPWAIT_WAIT_FOREVER�NULL�
PipeHandlerf�add)r�first�flags�h�piper r r!ris(

��
zPipeServer._server_pipe_handlecCs
|jdkSr7)rcr8r r r!rmszPipeServer.closedcCsR|jdk	r|j��d|_|jdk	rN|jD]}|��q*d|_d|_|j��dSr7)rhr0rcrf�closerg�clear)rrtr r r!rus




zPipeServer.closeN)	r>r?r@rrlrirmru�__del__r r r r!ra�s
rac@seZdZdS)�_WindowsSelectorEventLoopN)r>r?r@r r r r!rx,srxcsDeZdZd�fdd�	Z�fdd�Zdd�Zdd	�Zd
d
d�Z�ZS)r
Ncs|dkrt�}t��|�dSr7)rrr)rr]rr r!r3szProactorEventLoop.__init__c	sXz|�|j�t���W5|jdk	rR|jj}|j��|dk	rL|j�|�d|_XdSr7)	Z_self_reading_futurerr0rZr_�	call_soonZ_loop_self_readingr�run_forever�rrrr r!rz8s

zProactorEventLoop.run_foreverc�s8|j�|�}|IdH}|�}|j||d|id�}||fS)N�addr��extra)rZ�connect_pipe�_make_duplex_pipe_transport)r�protocol_factoryr'�frt�protocol�transr r r!�create_pipe_connectionKs
�z(ProactorEventLoop.create_pipe_connectionc�s.t���d�����fdd�	������gS)Nc
sd}zn|rN|��}�j�|����r4|��WdS��}�j||d�id����}|dkrdWdS�j�|�}Wn�t	k
r�}zF|r�|�
�dkr���d||d��|��n�jr�t
jd|dd�W5d}~XYn2tjk
r�|r�|��YnX|�_|���dS)	Nr|r}rzPipe accept failed)r,r-rtzAccept pipe failed on pipe %rT)�exc_info)r=rf�discardrmrur�rlrZ�accept_piper1�filenor3Z_debugrZwarningr�CancelledErrorrh�add_done_callback)r�rtr�r4�r'�loop_accept_piper�rZserverr r!r�VsH��
�z>ProactorEventLoop.start_serving_pipe.<locals>.loop_accept_pipe)N)rary)rr�r'r r�r!�start_serving_pipeSs(
z$ProactorEventLoop.start_serving_pipec		�s�|��}
t||||||||f|
|d�|	��}z|
IdHWnDttfk
rT�Yn,tk
r~|��|��IdH�YnX|S)N)�waiterr~)�
create_future�_WindowsSubprocessTransport�
SystemExit�KeyboardInterrupt�
BaseExceptionruZ_wait)rr��args�shell�stdin�stdout�stderr�bufsizer~�kwargsr�Ztranspr r r!�_make_subprocess_transport�s*
���z,ProactorEventLoop._make_subprocess_transport)N)N)	r>r?r@rrzr�r�r�rAr r rr!r
0s0�r
c@s�eZdZd:dd�Zdd�Zdd�Zdd	�Zd;dd�Zd
d�Zd<dd�Z	d=dd�Z
d>dd�Zd?dd�Zd@dd�Z
dd�Zdd�Zdd�Zd d!�Zd"d#�ZdAd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�ZdBd2d3�Zd4d5�Zd6d7�Zd8d9�Zd
S)CrrcCsDd|_g|_t�tjtd|�|_i|_t�	�|_
g|_t�	�|_dSrH)
r2�_resultsrP�CreateIoCompletionPort�INVALID_HANDLE_VALUErn�_iocp�_cacherdrerE�
_unregistered�_stopped_serving)rZconcurrencyr r r!r�s�
zIocpProactor.__init__cCs|jdkrtd��dS)NzIocpProactor is closed)r�rXr8r r r!�
_check_closed�s
zIocpProactor._check_closedcCsFdt|j�dt|j�g}|jdkr0|�d�d|jjd�|�fS)Nzoverlapped#=%sz
result#=%srmz<%s %s>� )�lenr�r�r�rKrr>�join)rr)r r r!�__repr__�s�

zIocpProactor.__repr__cCs
||_dSr7)r2)rrr r r!�set_loop�szIocpProactor.set_loopNcCs |js|�|�|j}g|_|Sr7)r�rJ)r�timeoutrkr r r!�select�s

zIocpProactor.selectcCs|j��}|�|�|Sr7)r2r�r;)r�valuerMr r r!�_result�s

zIocpProactor._resultrcCs~|�|�t�t�}z4t|tj�r6|�|��||�n|�|��|�Wnt	k
rf|�
d�YSXdd�}|�|||�S)N�c
SsRz
|��WStk
rL}z$|jtjtjfkr:t|j��n�W5d}~XYnXdSr7��	getresultr1rQrPZERROR_NETNAME_DELETEDZERROR_OPERATION_ABORTED�ConnectionResetErrorr��r��keyrr4r r r!�finish_recv�s
�z&IocpProactor.recv.<locals>.finish_recv)�_register_with_iocprP�
Overlappedrn�
isinstance�socketZWSARecvr�ZReadFile�BrokenPipeErrorr��	_register�r�conn�nbytesrrrr�r r r!�recv�s


zIocpProactor.recvcCs~|�|�t�t�}z4t|tj�r6|�|��||�n|�|��|�Wnt	k
rf|�
d�YSXdd�}|�|||�S)Nrc
SsRz
|��WStk
rL}z$|jtjtjfkr:t|j��n�W5d}~XYnXdSr7r�r�r r r!r��s
�z+IocpProactor.recv_into.<locals>.finish_recv)r�rPr�rnr�r�ZWSARecvIntor�ZReadFileIntor�r�r�)rr��bufrrrr�r r r!�	recv_into�s


zIocpProactor.recv_intocCs`|�|�t�t�}z|�|��||�Wntk
rH|�d�YSXdd�}|�|||�S)N)r�Nc
SsRz
|��WStk
rL}z$|jtjtjfkr:t|j��n�W5d}~XYnXdSr7r�r�r r r!r��s
�z*IocpProactor.recvfrom.<locals>.finish_recv)	r�rPr�rnZWSARecvFromr�r�r�r�r�r r r!�recvfrom�s


zIocpProactor.recvfromcCs>|�|�t�t�}|�|��|||�dd�}|�|||�S)Nc
SsRz
|��WStk
rL}z$|jtjtjfkr:t|j��n�W5d}~XYnXdSr7r�r�r r r!�finish_sends
�z(IocpProactor.sendto.<locals>.finish_send)r�rPr�rnZ	WSASendTor�r�)rr�r�rrr|rr�r r r!�sendto�s



zIocpProactor.sendtocCsZ|�|�t�t�}t|tj�r4|�|��||�n|�|��|�dd�}|�	|||�S)Nc
SsRz
|��WStk
rL}z$|jtjtjfkr:t|j��n�W5d}~XYnXdSr7r�r�r r r!r�s
�z&IocpProactor.send.<locals>.finish_send)
r�rPr�rnr�r�ZWSASendr�Z	WriteFiler�)rr�r�rrrr�r r r!�sends


zIocpProactor.sendcsv|���|��j��t�t�}|����������fdd�}dd�}|�|�|�}||��}t	j
||jd�|S)NcsD|��t�d����}��tjtj|���	��
������fS)Nz@P)r��structZpackr��
setsockoptr��
SOL_SOCKETrPZSO_UPDATE_ACCEPT_CONTEXT�
settimeoutZ
gettimeoutZgetpeername)r�r�rr��r��listenerr r!�
finish_accept*s�z*IocpProactor.accept.<locals>.finish_acceptc�s4z|IdHWn tjk
r.|���YnXdSr7)rr�ru)r.r�r r r!�accept_coro3s
z(IocpProactor.accept.<locals>.accept_coror)r��_get_accept_socket�familyrPr�rnZAcceptExr�r�r	Z
ensure_futurer2)rr�rr�r�r.�coror r�r!�accept$s

	
zIocpProactor.acceptc
s��jtjkr4t����|�|j��}|�d�|S|�	��zt�
����j�WnBtk
r�}z$|j
tjkrt����ddkr��W5d}~XYnXt�t�}|����|��fdd�}|�|�|�S)Nrrcs|����tjtjd��SrH)r�r�r�r�rPZSO_UPDATE_CONNECT_CONTEXT�r�r�r�r�r r!�finish_connectVs�z,IocpProactor.connect.<locals>.finish_connect)�typer�Z
SOCK_DGRAMrPZ
WSAConnectr�r2r�r;r�Z	BindLocalr�r1rQ�errnoZ	WSAEINVALZgetsocknamer�rnZ	ConnectExr�)rr�r'rM�err�r r�r!�connect@s"



zIocpProactor.connectc		Csb|�|�t�t�}|d@}|d?d@}|�|��t�|���|||dd�dd�}|�|||�S)Nr� rc
SsRz
|��WStk
rL}z$|jtjtjfkr:t|j��n�W5d}~XYnXdSr7r�r�r r r!�finish_sendfileis
�z.IocpProactor.sendfile.<locals>.finish_sendfile)	r�rPr�rnZTransmitFiler��msvcrtZ
get_osfhandler�)	rZsock�file�offset�countrZ
offset_lowZoffset_highr�r r r!�sendfile_s


�	zIocpProactor.sendfilecsJ|���t�t�}|�����}|r0|���S�fdd�}|�|�|�S)Ncs|���Sr7)r�r��rtr r!�finish_accept_pipesz4IocpProactor.accept_pipe.<locals>.finish_accept_pipe)r�rPr�rnZConnectNamedPiper�r�r�)rrtrZ	connectedr�r r�r!r�ts


zIocpProactor.accept_pipec
�srt}zt�|�}WqhWn0tk
rF}z|jtjkr6�W5d}~XYnXt|dt�}t�	|�IdHqt
�|�S)N�)�CONNECT_PIPE_INIT_DELAYrPZConnectPiper1rQZERROR_PIPE_BUSY�min�CONNECT_PIPE_MAX_DELAYr	�sleepr
ro)rr'ZdelayrFr4r r r!r�s
zIocpProactor.connect_pipecCs|�||d�Srj)�_wait_for_handle)rrFr�r r r!�wait_for_handle�szIocpProactor.wait_for_handlecCs|�|dd�}||_|Srb)r�rV)rrWZ
done_callbackrMr r r!r`�szIocpProactor._wait_cancelcs�|��|dkrtj}nt�|d�}t�t�}t�||j	|j
|�}|r\t||||jd��nt
|||||jd���jr~�jd=�fdd�}�|d|f|j|j
<�S)N�@�@rrcs���Sr7)rJr��r�r r!�finish_wait_for_handle�sz=IocpProactor._wait_for_handle.<locals>.finish_wait_for_handler)r�rI�INFINITE�math�ceilrPr�rnZRegisterWaitWithQueuer�r'rUr2rYrr�)rrFr�Z
_is_cancel�msrrGr�r r�r!r��s*
�
�	zIocpProactor._wait_for_handlecCs0||jkr,|j�|�t�|��|jdd�dSrH)rErprPr�r�r��r�objr r r!r��s
z IocpProactor._register_with_iocpc
Cs�|��t||jd�}|jr$|jd=|jsrz|dd|�}Wn,tk
rf}z|�|�W5d}~XYnX|�|�||||f|j|j	<|Sr)
r�rr2rr"r1r9r;r�r')rrr��callbackr�r�r�r r r!r��s

zIocpProactor._registercCs|��|j�|�dSr7)r�r�rKr{r r r!r_�szIocpProactor._unregistercCst�|�}|�d�|SrH)r�r�)rr��sr r r!r��s

zIocpProactor._get_accept_socketcCs�|dkrt}n0|dkr td��nt�|d�}|tkr>td��t�|j|�}|dkrX�qZd}|\}}}}z|j�|�\}}	}
}WnXt	k
r�|j
��r�|j
�dd||||fd��|dtj
fkr�t�|�Yq>YnX|
|jkr�|��q>|��s>z||||	�}Wn:tk
�r@}
z|�|
�|j�|�W5d}
~
XYq>X|�|�|j�|�q>|jD]}	|j�|	jd��q`|j��dS)Nrznegative timeoutr�ztimeout too bigz8GetQueuedCompletionStatus() returned an unexpected eventz)err=%s transferred=%s key=%#x address=%#x)r,�status)r��
ValueErrorr�r�rPZGetQueuedCompletionStatusr�r��pop�KeyErrorr2Z	get_debugr3r�rIr^r�r0Zdoner1r9r�rKr;r�r'rv)rr�r�r��errZtransferredr�r'r�rr�r�r�r�r r r!rJsL


��	






zIocpProactor._pollcCs|j�|�dSr7)r�rpr�r r r!�
_stop_serving9szIocpProactor._stop_servingcCs|jdkrdSt|j���D]�\}\}}}}|��r6qt|t�rBqz|��Wqtk
r�}z6|j	dk	r�d||d�}|j
r�|j
|d<|j	�|�W5d}~XYqXqd}t�
�}	|	|}
|jr�|
t�
�kr�t�d|t�
�|	�t�
�|}
|�|�q�g|_t�|j�d|_dS)NzCancelling a future failedr+r/g�?z,%r is running after closing for %.1f seconds)r��listr��itemsZ	cancelledr�rUr0r1r2rr3�time�	monotonicr�debugrJr�rIr^)rr'rMrr�r�r4r5Z
msg_updateZ
start_timeZnext_msgr r r!ru?s@


�
 
�zIocpProactor.closecCs|��dSr7)rur8r r r!rwnszIocpProactor.__del__)r)N)r)r)r)rN)r)N)N)r>r?r@rr�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r`r�r�r�r_r�rJr�rurwr r r r!r�s6








"
 

7/rc@seZdZdd�ZdS)r�c
sPtj|f|||||d�|���_�fdd�}�jj�t�jj��}	|	�|�dS)N)r�r�r�r�r�cs�j��}��|�dSr7)�_procZpollZ_process_exited)r��
returncoder8r r!r�ys
z4_WindowsSubprocessTransport._start.<locals>.callback)	r
�Popenr�r2rZr��intrCr�)
rr�r�r�r�r�r�r�r�r�r r8r!�_startts���z"_WindowsSubprocessTransport._startN)r>r?r@rr r r r!r�rsr�c@seZdZeZdS)rN)r>r?r@r�
_loop_factoryr r r r!r�src@seZdZeZdS)rN)r>r?r@r
rr r r r!r�sr).rPrIr�r�r�r�r�r�rd�rrrrrrr	r
�logr�__all__rnr�ZERROR_CONNECTION_REFUSEDZERROR_CONNECTION_ABORTEDr�r�ZFuturerrBrUrY�objectraZBaseSelectorEventLooprxZBaseProactorEventLoopr
rZBaseSubprocessTransportr�rZBaseDefaultEventLoopPolicyrrrr r r r!�<module>sP0J4;e`asyncio/__pycache__/constants.cpython-38.opt-2.pyc000064400000001107151153537520016033 0ustar00U

e5dx�@s2ddlZdZdZdZdZdZGdd�dej�ZdS)	�N���
gN@ic@s$eZdZe��Ze��Ze��ZdS)�
_SendfileModeN)�__name__�
__module__�__qualname__�enum�autoZUNSUPPORTEDZ
TRY_NATIVEZFALLBACK�rr�)/usr/lib64/python3.8/asyncio/constants.pyrsr)r	Z!LOG_THRESHOLD_FOR_CONNLOST_WRITESZACCEPT_RETRY_DELAYZDEBUG_STACK_DEPTHZSSL_HANDSHAKE_TIMEOUTZ!SENDFILE_FALLBACK_READBUFFER_SIZE�Enumrrrrr�<module>sasyncio/__pycache__/__init__.cpython-38.opt-1.pyc000064400000001360151153537520015556 0ustar00U

e5d��@sdZddlZddlTddlTddlTddlTddlTddlTddlTddl	Tddl
TddlTddlTddl
TddlTddl
mZejejejejejejeje	je
jejeje
jejZejdkr�ddlTeej7ZnddlTeej7ZdS)z'The asyncio package, tracking PEP 3156.�N�)�*)�_all_tasks_compatZwin32)�__doc__�sysZbase_eventsZ
coroutinesZevents�
exceptionsZfuturesZlocksZ	protocolsZrunnersZqueuesZstreams�
subprocessZtasksZ
transportsr�__all__�platformZwindows_eventsZunix_events�rr�(/usr/lib64/python3.8/asyncio/__init__.py�<module>sZ��������	�
���
asyncio/__pycache__/tasks.cpython-38.opt-2.pyc000064400000040401151153537520015144 0ustar00U

e5d���@srdZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddl
mZddl
m
Z
ddl
mZddl
mZdd	lmZe�d�jZdAd
d�ZdBdd
�ZdCdd�Zdd�ZGdd�dej�ZeZzddlZWnek
r�YnXejZZdd�dd�ZejjZejj Z ejj!Z!dde!d�dd�Z"dd�Z#dd�dd�Z$dd �Z%d!d"�Z&ddd#�d$d%�Z'ej(d&d'��Z)dDdd�d(d)�Z*dd�d*d+�Z+ej(d,d-��Z,ee,_Gd.d/�d/ej-�Z.dd0d1�d2d3�Z/dd�d4d5�Z0d6d7�Z1e	�2�Z3iZ4d8d9�Z5d:d;�Z6d<d=�Z7d>d?�Z8e5Z9e8Z:e6Z;e7Z<z$dd@lm5Z5m8Z8m6Z6m7Z7m3Z3m4Z4Wnek
�r\YnXe5Z=e8Z>e6Z?e7Z@dS)E)�Task�create_task�FIRST_COMPLETED�FIRST_EXCEPTION�
ALL_COMPLETED�wait�wait_for�as_completed�sleep�gather�shield�
ensure_future�run_coroutine_threadsafe�current_task�	all_tasks�_register_task�_unregister_task�_enter_task�_leave_task�N�)�
base_tasks)�
coroutines)�events)�
exceptions)�futures)�
_is_coroutinecCs|dkrt��}t�|�S�N)r�get_running_loop�_current_tasks�get��loop�r"�%/usr/lib64/python3.8/asyncio/tasks.pyr"srcs^�dkrt���d}ztt�}WqLtk
rF|d7}|dkrB�YqXqLq�fdd�|D�S)Nrr��cs&h|]}t�|��kr|��s|�qSr")r�	_get_loop�done��.0�tr r"r#�	<setcomp><s�zall_tasks.<locals>.<setcomp>)rr�list�
_all_tasks�RuntimeError�r!�iZtasksr"r r#r)srcs^�dkrt���d}ztt�}WqLtk
rF|d7}|dkrB�YqXqLq�fdd�|D�S)Nrrr$csh|]}t�|��kr|�qSr")rr%r'r r"r#r*Usz$_all_tasks_compat.<locals>.<setcomp>)r�get_event_loopr+r,r-r.r"r r#�_all_tasks_compat@sr1cCs4|dk	r0z
|j}Wntk
r&Yn
X||�dSr)�set_name�AttributeError)�task�namer2r"r"r#�_set_task_nameXs
r6cs�eZdZdZed$dd��Zed%dd��Zddd��fdd	�
Z�fd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�dd�Zddd�dd�Zdd�Zd&�fd d!�	Zd"d#�Z�ZS)'rTNcCs(tjdtdd�|dkr t��}t|�S)NzVTask.current_task() is deprecated since Python 3.7, use asyncio.current_task() instead���
stacklevel)�warnings�warn�DeprecationWarningrr0r��clsr!r"r"r#rts�zTask.current_taskcCstjdtdd�t|�S)NzPTask.all_tasks() is deprecated since Python 3.7, use asyncio.all_tasks() insteadr7r8)r:r;r<r1r=r"r"r#r�s
�zTask.all_tasks)r!r5cs�t�j|d�|jr|jd=t�|�s:d|_td|����|dkrRdt���|_n
t	|�|_d|_
d|_||_t
��|_|jj|j|jd�t|�dS)Nr ���Fza coroutine was expected, got zTask-��context)�super�__init__�_source_tracebackr�iscoroutine�_log_destroy_pending�	TypeError�_task_name_counter�_name�str�_must_cancel�_fut_waiter�_coro�contextvarsZcopy_context�_context�_loop�	call_soon�_Task__stepr)�self�coror!r5��	__class__r"r#rC�s


z
Task.__init__csF|jtjkr8|jr8|dd�}|jr,|j|d<|j�|�t���dS)Nz%Task was destroyed but it is pending!)r4�messageZsource_traceback)	Z_staterZ_PENDINGrFrDrPZcall_exception_handlerrB�__del__)rSrArUr"r#rX�s�
zTask.__del__cCs
t�|�Sr)rZ_task_repr_info�rSr"r"r#�
_repr_info�szTask._repr_infocCs|jSr)rMrYr"r"r#�get_coro�sz
Task.get_corocCs|jSr)rIrYr"r"r#�get_name�sz
Task.get_namecCst|�|_dSr)rJrI)rS�valuer"r"r#r2�sz
Task.set_namecCstd��dS)Nz*Task does not support set_result operation�r-)rS�resultr"r"r#�
set_result�szTask.set_resultcCstd��dS)Nz-Task does not support set_exception operationr^)rS�	exceptionr"r"r#�
set_exception�szTask.set_exception)�limitcCst�||�Sr)rZ_task_get_stack)rSrcr"r"r#�	get_stack�szTask.get_stack)rc�filecCst�|||�Sr)rZ_task_print_stack)rSrcrer"r"r#�print_stack�s	zTask.print_stackcCs4d|_|��rdS|jdk	r*|j��r*dSd|_dS�NFT)Z_log_tracebackr&rL�cancelrKrYr"r"r#rh�s

zTask.cancelc
s�|��rt�d|�d|����|jr>t|tj�s8t��}d|_|j}d|_t|j	|��zfz"|dkrp|�d�}n
|�|�}Wn�t
k
r�}z*|jr�d|_t���nt��|j�W5d}~XY�n�tjk
r�t���Y�n�ttfk
�r}zt��|��W5d}~XY�n�tk
�rL}zt��|�W5d}~XY�npXt|dd�}|dk	�r@t�|�|j	k	�r�td|�d|�d��}|j	j|j||jd�n�|�r||k�r�td	|���}|j	j|j||jd�n8d|_|j|j|jd�||_|j�r>|j���r>d|_n*td
|�d|���}|j	j|j||jd�n||dk�r`|j	j|j|jd�n\t �!|��r�td|�d|���}|j	j|j||jd�n$td
|���}|j	j|j||jd�W5t
|j	|�d}XdS)Nz_step(): already done: z, F�_asyncio_future_blockingzTask z got Future z attached to a different loopr@zTask cannot await on itself: z-yield was used instead of yield from in task z with z;yield was used instead of yield from for generator in task zTask got bad yield: )"r&rZInvalidStateErrorrK�
isinstance�CancelledErrorrMrLrrPr�send�throw�
StopIterationrBrhr`r]�KeyboardInterrupt�
SystemExitrb�
BaseException�getattrrr%r-rQrRrOri�add_done_callback�
_Task__wakeup�inspectZisgenerator)rS�excrTr_Zblocking�new_excrUr"r#Z__steps��  
��
�����
���
zTask.__stepc
CsJz|��Wn,tk
r8}z|�|�W5d}~XYn
X|��d}dSr)r_rqrR)rS�futurervr"r"r#Z__wakeup[sz
Task.__wakeup)N)N)N)�__name__�
__module__�__qualname__rF�classmethodrrrCrXrZr[r\r2r`rbrdrfrhrRrt�
__classcell__r"r"rUr#rbs$!Tr)r5cCs t��}|�|�}t||�|Sr)rrrr6)rTr5r!r4r"r"r#rxs

r)r!�timeout�return_whenc�s�t�|�st�|�r(tdt|�j����|s4td��|tt	t
fkrPtd|�����dkrbt���nt
jdtdd��fdd�t|�D�}t|||��IdHS)	Nzexpect a list of futures, not z#Set of coroutines/Futures is empty.zInvalid return_when value: �[The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.r7r8csh|]}t|�d��qS�r �r�r(�fr r"r#r*�szwait.<locals>.<setcomp>)r�isfuturerrErG�typery�
ValueErrorrrrrrr:r;r<�set�_wait)�fsr!r~rr"r r#r�s
�rcGs|��s|�d�dSr)r&r`)�waiter�argsr"r"r#�_release_waiter�sr�r c
�s�|dkrt��}ntjdtdd�|dkr4|IdHS|dkr�t||d�}|��rX|��St||d�IdHz|��Wn.t	j
k
r�}zt	��|�W5d}~XYn
Xt	���|��}|�
|t|�}t�t|�}t||d�}|�|�z�z|IdHWnPt	j
k
�rF|���r$|��YW�dS|�|�t||d�IdH�YnX|���r^|��W�*S|�|�t||d�IdHt	���W5|��XdS)Nr�r7r8rr )rrr:r;r<rr&r_�_cancel_and_waitrrk�TimeoutError�
create_future�
call_laterr��	functools�partialrsrh�remove_done_callback)�futr~r!rvr��timeout_handle�cbr"r"r#r�sL

�





rc
�s�|���d�|dk	r"|�|t���t|������fdd�}|D]}|�|�q@z�IdHW5�dk	rp���|D]}|�|�qtXt�t�}}|D]"}|��r�|�	|�q�|�	|�q�||fS)NcsZ�d8��dks4�tks4�tkrV|��sV|��dk	rV�dk	rD������sV��d�dS)Nrr)rr�	cancelledrarhr&r`�r��Zcounterrr�r�r"r#�_on_completions���
�z_wait.<locals>._on_completion)
r�r�r��lenrsrhr�r�r&�add)r�r~rr!r�r�r&Zpendingr"r�r#r��s(r�c	�sF|��}t�t|�}|�|�z|��|IdHW5|�|�XdSr)r�r�r�r�rsr�rh)r�r!r�r�r"r"r#r�&s
r�)r!r~c#s�t�|�st�|�r(tdt|�j����ddlm}|�d���dkrPt	�
��ntjdt
dd��fdd	�t|�D��d����fd
d�}���fdd
���fdd�}�D]}|���q��r�|dk	r҈�||��tt���D]}|�Vq�dS)Nz#expect an iterable of futures, not r)�Queuer r�r7r8csh|]}t|�d��qSr�r�r�r r"r#r*Uszas_completed.<locals>.<setcomp>cs*�D]}|�����d�q���dSr)r��
put_nowait�clearr�)r�r&�todor"r#�_on_timeoutXs
z!as_completed.<locals>._on_timeoutcs4�sdS��|���|��s0�dk	r0���dSr)�remover�rhr�)r&r�r�r"r#r�^s

z$as_completed.<locals>._on_completionc�s$���IdH}|dkrtj�|��Sr)rrr�r_r�)r&r"r#�
_wait_for_onefsz#as_completed.<locals>._wait_for_one)rr�rrErGr�ryZqueuesr�rr0r:r;r<r�rsr��ranger�)r�r!r~r�r�r�r��_r")r�r&r!r�r�r#r7s*

�rccs
dVdSrr"r"r"r"r#�__sleep0us	r�c�sr|dkrt�IdH|S|dkr*t��}ntjdtdd�|��}|�|tj	||�}z|IdHW�S|�
�XdS)Nrr�r7r8)r�rrr:r;r<r�r�rZ_set_result_unless_cancelledrh)Zdelayr_r!rx�hr"r"r#r	�s$
��r	cCs�t�|�r6|dkrt��}|�|�}|jr2|jd=|St�|�rb|dk	r^|t�|�k	r^t	d��|St
�|�r|tt
|�|d�Std��dS)Nr?zRThe future belongs to a different loop than the one specified as the loop argumentr z:An asyncio.Future, a coroutine or an awaitable is required)rrErr0rrDrr�r%r�ruZisawaitabler�_wrap_awaitablerG)Zcoro_or_futurer!r4r"r"r#r�s



rccs|��EdHSr)�	__await__)Z	awaitabler"r"r#r��sr�cs*eZdZdd��fdd�
Zdd�Z�ZS)�_GatheringFutureNr cst�j|d�||_d|_dS)Nr F)rBrC�	_children�_cancel_requested)rS�childrenr!rUr"r#rC�sz_GatheringFuture.__init__cCs6|��rdSd}|jD]}|��rd}q|r2d|_|Srg)r&r�rhr�)rSZretZchildr"r"r#rh�s
z_GatheringFuture.cancel)ryrzr{rCrhr}r"r"rUr#r��sr�F)r!�return_exceptionscs�|s<|dkrt��}ntjdtdd�|�����g��S�����fdd�}i}g�d�d�|D]f}||kr�t||d�}|dkr�t�	|�}||k	r�d|_
�d	7�|||<|�|�n||}��|�qdt
�|d���S)
Nr�r7r8cs��d7����r$|��s |��dS�sd|��rFt��}��|�dS|��}|dk	rd��|�dS��kr�g}�D]8}|��r�t��}n|��}|dkr�|��}|�|�qt�jrĈ�t���n
��	|�dS)Nr)
r&r�rarrkrbr_�appendr�r`)r�rvZresults�res�r�Z	nfinishedZnfuts�outerr�r"r#�_done_callbacks4


zgather.<locals>._done_callbackrr Fr)rr0r:r;r<r�r`rrr%rFrsr�r�)r!r�Zcoros_or_futuresr�Z
arg_to_fut�argr�r"r�r#r
�s:
�
1
r
cst|dk	rtjdtdd�t||d�����r0�St���}|����fdd����fdd�}������|��S)	Nr�r7r8r cs\���r|��s|��dS|��r.���n*|��}|dk	rJ��|�n��|���dSr)r�rarhrbr`r_)�innerrv�r�r"r#�_inner_done_callbackus
z$shield.<locals>._inner_done_callbackcs���s����dSr)r&r�r�)r�r�r"r#�_outer_done_callback�sz$shield.<locals>._outer_done_callback)	r:r;r<rr&rr%r�rs)r�r!r�r")r�r�r�r#rPs�


rcs:t���std��tj������fdd�}��|��S)NzA coroutine object is requiredc
slzt�t��d���WnNttfk
r2�Yn6tk
rf}z���rT��|��W5d}~XYnXdS)Nr )rZ
_chain_futurerrprorqZset_running_or_notify_cancelrb)rv�rTrxr!r"r#�callback�s
z*run_coroutine_threadsafe.<locals>.callback)rrErG�
concurrentr�FutureZcall_soon_threadsafe)rTr!r�r"r�r#r
�s



r
cCst�|�dSr)r,r��r4r"r"r#r�srcCs4t�|�}|dk	r(td|�d|�d���|t|<dS)NzCannot enter into task z while another task z is being executed.�rrr-�r!r4rr"r"r#r�s
rcCs2t�|�}||k	r(td|�d|�d���t|=dS)Nz
Leaving task z! does not match the current task �.r�r�r"r"r#r�s
rcCst�|�dSr)r,�discardr�r"r"r#r�sr)rrrrr,r)N)N)N)N)A�__all__Zconcurrent.futuresr�rNr�ru�	itertools�typesr:�weakref�rrrrrr�count�__next__rHrrr1r6Z	_PyFuturerZ_PyTaskZ_asyncio�ImportErrorZ_CTaskrrrrrr�rr�r�r�	coroutiner�r	rr�r�r�r
rr
ZWeakSetr,rrrrrZ_py_register_taskZ_py_unregister_taskZ_py_enter_taskZ_py_leave_taskZ_c_register_taskZ_c_unregister_taskZ
_c_enter_taskZ
_c_leave_taskr"r"r"r#�<module>s�	





#H,>

x?$asyncio/__pycache__/queues.cpython-38.opt-2.pyc000064400000013110151153537520015323 0ustar00U

e5d �@s�dZddlZddlZddlZddlmZddlmZGdd�de�ZGdd	�d	e�Z	Gd
d�d�Z
Gdd
�d
e
�ZGdd�de
�ZdS))�Queue�
PriorityQueue�	LifoQueue�	QueueFull�
QueueEmpty�N�)�events)�locksc@seZdZdS)rN��__name__�
__module__�__qualname__�rr�&/usr/lib64/python3.8/asyncio/queues.pyrsrc@seZdZdS)rNr
rrrrrsrc@s�eZdZd(dd�dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�Zedd��Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�ZdS))rrN��loopcCsp|dkrt��|_n||_tjdtdd�||_t��|_	t��|_
d|_tj
|d�|_|j��|�|�dS)Nz[The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.�)�
stacklevelrr)rZget_event_loop�_loop�warnings�warn�DeprecationWarning�_maxsize�collections�deque�_getters�_putters�_unfinished_tasksr	ZEvent�	_finished�set�_init)�self�maxsizerrrr�__init__!s�


zQueue.__init__cCst��|_dS�N)rr�_queue�r!r"rrrr 6szQueue._initcCs
|j��Sr$)r%�popleft�r!rrr�_get9sz
Queue._getcCs|j�|�dSr$�r%�append�r!�itemrrr�_put<sz
Queue._putcCs&|r"|��}|��s|�d�q"qdSr$)r'ZdoneZ
set_result)r!�waitersZwaiterrrr�_wakeup_nextAs

zQueue._wakeup_nextcCs(dt|�j�dt|�d�d|���d�S)N�<z at z#x� �>)�typer�id�_formatr(rrr�__repr__IszQueue.__repr__cCsdt|�j�d|���d�S)Nr1r2r3)r4rr6r(rrr�__str__Lsz
Queue.__str__cCs~d|j��}t|dd�r,|dt|j���7}|jrH|dt|j��d�7}|jrd|dt|j��d�7}|jrz|d|j��7}|S)Nzmaxsize=r%z _queue=z
 _getters[�]z
 _putters[z tasks=)r�getattr�listr%r�lenrr)r!�resultrrrr6Osz
Queue._formatcCs
t|j�Sr$)r<r%r(rrr�qsize[szQueue.qsizecCs|jSr$)rr(rrrr"_sz
Queue.maxsizecCs|jSr$�r%r(rrr�emptydszQueue.emptycCs |jdkrdS|��|jkSdS)NrF)rr>r(rrr�fullhs
z
Queue.fullc�s�|��r�|j��}|j�|�z|IdHWq|��z|j�|�Wntk
r`YnX|��s~|��s~|�	|j��YqXq|�
|�Sr$)rAr�
create_futurerr+�cancel�remove�
ValueError�	cancelledr0�
put_nowait)r!r-Zputterrrr�putss

z	Queue.putcCs>|��rt�|�|�|jd7_|j��|�|j�dS)Nr)rArr.rr�clearr0rr,rrrrG�s

zQueue.put_nowaitc�s�|��r�|j��}|j�|�z|IdHWq|��z|j�|�Wntk
r`YnX|��s~|��s~|�	|j��YqXq|�
�Sr$)r@rrBrr+rCrDrErFr0�
get_nowait)r!�getterrrr�get�s

z	Queue.getcCs$|��rt�|��}|�|j�|Sr$)r@rr)r0rr,rrrrJ�s
zQueue.get_nowaitcCs8|jdkrtd��|jd8_|jdkr4|j��dS)Nrz!task_done() called too many timesr)rrErrr(rrr�	task_done�s


zQueue.task_donec�s|jdkr|j��IdHdS)Nr)rr�waitr(rrr�join�s
z
Queue.join)r)rrr
r#r r)r.r0r7r8r6r>�propertyr"r@rArHrGrLrJrMrOrrrrrs&
rc@s0eZdZdd�Zejfdd�Zejfdd�ZdS)rcCs
g|_dSr$r?r&rrrr �szPriorityQueue._initcCs||j|�dSr$r?)r!r-�heappushrrrr.�szPriorityQueue._putcCs
||j�Sr$r?)r!�heappoprrrr)�szPriorityQueue._getN)	rrr
r �heapqrQr.rRr)rrrrr�src@s$eZdZdd�Zdd�Zdd�ZdS)rcCs
g|_dSr$r?r&rrrr �szLifoQueue._initcCs|j�|�dSr$r*r,rrrr.�szLifoQueue._putcCs
|j��Sr$)r%�popr(rrrr)�szLifoQueue._getN)rrr
r r.r)rrrrr�sr)
�__all__rrSr�rr	�	Exceptionrrrrrrrrr�<module>sKasyncio/__pycache__/transports.cpython-38.pyc000064400000027750151153537520015312 0ustar00U

e5d�(�@s|dZdZGdd�d�ZGdd�de�ZGdd�de�ZGdd	�d	ee�ZGd
d�de�ZGdd
�d
e�ZGdd�de�ZdS)zAbstract Transport class.)�
BaseTransport�
ReadTransport�WriteTransport�	Transport�DatagramTransport�SubprocessTransportc@sHeZdZdZdZddd�Zddd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)rzBase class for transports.��_extraNcCs|dkri}||_dS�Nr)�self�extra�r�*/usr/lib64/python3.8/asyncio/transports.py�__init__szBaseTransport.__init__cCs|j�||�S)z#Get optional transport information.)r�get)r
�name�defaultrrr
�get_extra_infoszBaseTransport.get_extra_infocCst�dS)z2Return True if the transport is closing or closed.N��NotImplementedError�r
rrr
�
is_closingszBaseTransport.is_closingcCst�dS)aClose the transport.

        Buffered data will be flushed asynchronously.  No more data
        will be received.  After all buffered data is flushed, the
        protocol's connection_lost() method will (eventually) be
        called with None as its argument.
        Nrrrrr
�closeszBaseTransport.closecCst�dS)zSet a new protocol.Nr)r
�protocolrrr
�set_protocol%szBaseTransport.set_protocolcCst�dS)zReturn the current protocol.Nrrrrr
�get_protocol)szBaseTransport.get_protocol)N)N)�__name__�
__module__�__qualname__�__doc__�	__slots__rrrrrrrrrr
r	s


rc@s,eZdZdZdZdd�Zdd�Zdd�Zd	S)
rz#Interface for read-only transports.rcCst�dS)z*Return True if the transport is receiving.Nrrrrr
�
is_reading3szReadTransport.is_readingcCst�dS)z�Pause the receiving end.

        No data will be passed to the protocol's data_received()
        method until resume_reading() is called.
        Nrrrrr
�
pause_reading7szReadTransport.pause_readingcCst�dS)z�Resume the receiving end.

        Data received will once again be passed to the protocol's
        data_received() method.
        Nrrrrr
�resume_reading?szReadTransport.resume_readingN)rrrrrr r!r"rrrr
r.s
rc@sNeZdZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�ZdS)rz$Interface for write-only transports.rNcCst�dS)a�Set the high- and low-water limits for write flow control.

        These two values control when to call the protocol's
        pause_writing() and resume_writing() methods.  If specified,
        the low-water limit must be less than or equal to the
        high-water limit.  Neither value can be negative.

        The defaults are implementation-specific.  If only the
        high-water limit is given, the low-water limit defaults to an
        implementation-specific value less than or equal to the
        high-water limit.  Setting high to zero forces low to zero as
        well, and causes pause_writing() to be called whenever the
        buffer becomes non-empty.  Setting low to zero causes
        resume_writing() to be called only once the buffer is empty.
        Use of zero for either limit is generally sub-optimal as it
        reduces opportunities for doing I/O and computation
        concurrently.
        Nr�r
�high�lowrrr
�set_write_buffer_limitsMsz&WriteTransport.set_write_buffer_limitscCst�dS)z,Return the current size of the write buffer.Nrrrrr
�get_write_buffer_sizebsz$WriteTransport.get_write_buffer_sizecCst�dS)z�Write some data bytes to the transport.

        This does not block; it buffers the data and arranges for it
        to be sent out asynchronously.
        Nr)r
�datarrr
�writefszWriteTransport.writecCsd�|�}|�|�dS)z�Write a list (or any iterable) of data bytes to the transport.

        The default implementation concatenates the arguments and
        calls write() on the result.
        �N)�joinr))r
Zlist_of_datar(rrr
�
writelinesns
zWriteTransport.writelinescCst�dS)z�Close the write end after flushing buffered data.

        (This is like typing ^D into a UNIX program reading from stdin.)

        Data may still be received.
        Nrrrrr
�	write_eofwszWriteTransport.write_eofcCst�dS)zAReturn True if this transport supports write_eof(), False if not.Nrrrrr
�
can_write_eof�szWriteTransport.can_write_eofcCst�dS�z�Close the transport immediately.

        Buffered data will be lost.  No more data will be received.
        The protocol's connection_lost() method will (eventually) be
        called with None as its argument.
        Nrrrrr
�abort�szWriteTransport.abort)NN)rrrrrr&r'r)r,r-r.r0rrrr
rHs
		rc@seZdZdZdZdS)raSInterface representing a bidirectional transport.

    There may be several implementations, but typically, the user does
    not implement new transports; rather, the platform provides some
    useful transports that are implemented using the platform's best
    practices.

    The user never instantiates a transport directly; they call a
    utility function, passing it a protocol factory and other
    information necessary to create the transport and protocol.  (E.g.
    EventLoop.create_connection() or EventLoop.create_server().)

    The utility function will asynchronously create a transport and a
    protocol and hook them up by calling the protocol's
    connection_made() method, passing it the transport.

    The implementation here raises NotImplemented for every method
    except writelines(), which calls write() in a loop.
    rN)rrrrrrrrr
r�src@s&eZdZdZdZddd�Zdd�ZdS)	rz(Interface for datagram (UDP) transports.rNcCst�dS)aSend data to the transport.

        This does not block; it buffers the data and arranges for it
        to be sent out asynchronously.
        addr is target socket address.
        If addr is None use target address pointed on transport creation.
        Nr)r
r(Zaddrrrr
�sendto�szDatagramTransport.sendtocCst�dSr/rrrrr
r0�szDatagramTransport.abort)N)rrrrrr1r0rrrr
r�s

rc@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)rrcCst�dS)zGet subprocess id.Nrrrrr
�get_pid�szSubprocessTransport.get_pidcCst�dS)z�Get subprocess returncode.

        See also
        http://docs.python.org/3/library/subprocess#subprocess.Popen.returncode
        Nrrrrr
�get_returncode�sz"SubprocessTransport.get_returncodecCst�dS)z&Get transport for pipe with number fd.Nr)r
�fdrrr
�get_pipe_transport�sz&SubprocessTransport.get_pipe_transportcCst�dS)z�Send signal to subprocess.

        See also:
        docs.python.org/3/library/subprocess#subprocess.Popen.send_signal
        Nr)r
�signalrrr
�send_signal�szSubprocessTransport.send_signalcCst�dS)aLStop the subprocess.

        Alias for close() method.

        On Posix OSs the method sends SIGTERM to the subprocess.
        On Windows the Win32 API function TerminateProcess()
         is called to stop the subprocess.

        See also:
        http://docs.python.org/3/library/subprocess#subprocess.Popen.terminate
        Nrrrrr
�	terminate�szSubprocessTransport.terminatecCst�dS)z�Kill the subprocess.

        On Posix OSs the function sends SIGKILL to the subprocess.
        On Windows kill() is an alias for terminate().

        See also:
        http://docs.python.org/3/library/subprocess#subprocess.Popen.kill
        Nrrrrr
�kill�s	zSubprocessTransport.killN)
rrrrr2r3r5r7r8r9rrrr
r�srcsZeZdZdZdZd�fdd�	Zdd�Zdd	�Zd
d�Zddd
�Z	ddd�Z
dd�Z�ZS)�_FlowControlMixinavAll the logic for (write) flow control in a mix-in base class.

    The subclass must implement get_write_buffer_size().  It must call
    _maybe_pause_protocol() whenever the write buffer size increases,
    and _maybe_resume_protocol() whenever it decreases.  It may also
    override set_write_buffer_limits() (e.g. to specify different
    defaults).

    The subclass constructor must call super().__init__(extra).  This
    will call set_write_buffer_limits().

    The user may call set_write_buffer_limits() and
    get_write_buffer_size(), and their protocol's pause_writing() and
    resume_writing() may be called.
    )�_loop�_protocol_paused�_high_water�
_low_waterNcs0t��|�|dk	st�||_d|_|��dS)NF)�superr�AssertionErrorr;r<�_set_write_buffer_limits)r
rZloop��	__class__rr
rs
z_FlowControlMixin.__init__c
Cs�|��}||jkrdS|js�d|_z|j��WnRttfk
rJ�Yn:tk
r�}z|j�	d|||jd��W5d}~XYnXdS)NTzprotocol.pause_writing() failed��messageZ	exceptionZ	transportr)
r'r=r<�	_protocolZ
pause_writing�
SystemExit�KeyboardInterrupt�
BaseExceptionr;�call_exception_handler)r
�size�excrrr
�_maybe_pause_protocols 
�z'_FlowControlMixin._maybe_pause_protocolc
Cs�|jr||��|jkr|d|_z|j��WnRttfk
rB�Yn:tk
rz}z|j�	d|||jd��W5d}~XYnXdS)NFz protocol.resume_writing() failedrD)
r<r'r>rFZresume_writingrGrHrIr;rJ)r
rLrrr
�_maybe_resume_protocol!s��z(_FlowControlMixin._maybe_resume_protocolcCs|j|jfSr	)r>r=rrrr
�get_write_buffer_limits1sz)_FlowControlMixin.get_write_buffer_limitscCsj|dkr|dkrd}nd|}|dkr.|d}||krBdksZntd|�d|�d���||_||_dS)Ni��zhigh (z) must be >= low (z) must be >= 0)�
ValueErrorr=r>r#rrr
rA4s�z*_FlowControlMixin._set_write_buffer_limitscCs|j||d�|��dS)N)r$r%)rArMr#rrr
r&Dsz)_FlowControlMixin.set_write_buffer_limitscCst�dSr	rrrrr
r'Hsz'_FlowControlMixin.get_write_buffer_size)NN)NN)NN)
rrrrrrrMrNrOrAr&r'�
__classcell__rrrBr
r:�s

r:N)	r�__all__rrrrrrr:rrrr
�<module>s%F6asyncio/__pycache__/windows_events.cpython-38.pyc000064400000060011151153537520016134 0ustar00U

e5di��@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddl
mZddl
m
Z
ddl
mZddl
mZdd	l
mZdd
l
mZddl
mZddlmZd
ZdZdZdZdZdZdZGdd�de
j�ZGdd�de
j�ZGdd�de�ZGdd�de�Z Gdd�de!�Z"Gdd�dej#�Z$Gdd �d ej%�Z&Gd!d"�d"�Z'Gd#d$�d$ej(�Z)e$Z*Gd%d&�d&ej+�Z,Gd'd(�d(ej+�Z-e-Z.dS))z.Selector and proactor event loops for Windows.�N�)�events)�base_subprocess)�futures)�
exceptions)�proactor_events)�selector_events)�tasks)�
windows_utils)�logger)�SelectorEventLoop�ProactorEventLoop�IocpProactor�DefaultEventLoopPolicy�WindowsSelectorEventLoopPolicy�WindowsProactorEventLoopPolicy���i�i�g����MbP?g�������?cs^eZdZdZdd��fdd�
Z�fdd�Zdd	�Z�fd
d�Z�fdd
�Z�fdd�Z	�Z
S)�_OverlappedFuturez�Subclass of Future which represents an overlapped operation.

    Cancelling it will immediately cancel the overlapped operation.
    N��loopcs&t�j|d�|jr|jd=||_dS�Nr���)�super�__init__�_source_traceback�_ov)�self�ovr��	__class__��./usr/lib64/python3.8/asyncio/windows_events.pyr1sz_OverlappedFuture.__init__csHt���}|jdk	rD|jjr dnd}|�dd|�d|jjd�d��|S)N�pendingZ	completedrzoverlapped=<z, �#x�>)r�
_repr_inforr"�insert�address�r�info�staterr r!r%7s


 z_OverlappedFuture._repr_infoc
Csr|jdkrdSz|j��WnJtk
rf}z,d||d�}|jrJ|j|d<|j�|�W5d}~XYnXd|_dS)Nz&Cancelling an overlapped future failed��message�	exception�future�source_traceback)r�cancel�OSErrorr�_loop�call_exception_handler)r�exc�contextr r r!�_cancel_overlapped>s
�
z$_OverlappedFuture._cancel_overlappedcs|��t���S�N)r6rr0�rrr r!r0Nsz_OverlappedFuture.cancelcst��|�|��dSr7)r�
set_exceptionr6�rr-rr r!r9Rsz_OverlappedFuture.set_exceptioncst��|�d|_dSr7)r�
set_resultr�r�resultrr r!r;Vsz_OverlappedFuture.set_result)�__name__�
__module__�__qualname__�__doc__rr%r6r0r9r;�
__classcell__r r rr!r+srcsneZdZdZdd��fdd�
Zdd�Z�fdd	�Zd
d�Zdd
�Z�fdd�Z	�fdd�Z
�fdd�Z�ZS)�_BaseWaitHandleFuturez2Subclass of Future which represents a wait handle.Nrcs8t�j|d�|jr|jd=||_||_||_d|_dS)NrrT)rrrr�_handle�_wait_handle�_registered)rr�handle�wait_handlerrr r!r^sz_BaseWaitHandleFuture.__init__cCst�|jd�tjkS�Nr)�_winapiZWaitForSingleObjectrDZ
WAIT_OBJECT_0r8r r r!�_pollls�z_BaseWaitHandleFuture._pollcsdt���}|�d|jd���|jdk	rB|��r4dnd}|�|�|jdk	r`|�d|jd���|S)Nzhandle=r#ZsignaledZwaitingzwait_handle=)rr%�appendrDrKrEr(rr r!r%qs



z _BaseWaitHandleFuture._repr_infocCs
d|_dSr7)r�r�futr r r!�_unregister_wait_cb{sz)_BaseWaitHandleFuture._unregister_wait_cbc
Cs�|js
dSd|_|j}d|_zt�|�Wn`tk
r�}zB|jtjkrzd||d�}|jrd|j|d<|j�	|�WY�dSW5d}~XYnX|�
d�dS�NFz$Failed to unregister the wait handler+r/)rFrE�_overlappedZUnregisterWaitr1�winerror�ERROR_IO_PENDINGrr2r3rO�rrHr4r5r r r!�_unregister_wait�s$�
z&_BaseWaitHandleFuture._unregister_waitcs|��t���Sr7)rUrr0r8rr r!r0�sz_BaseWaitHandleFuture.cancelcs|��t��|�dSr7)rUrr9r:rr r!r9�sz#_BaseWaitHandleFuture.set_exceptioncs|��t��|�dSr7)rUrr;r<rr r!r;�sz _BaseWaitHandleFuture.set_result)
r>r?r@rArrKr%rOrUr0r9r;rBr r rr!rC[s
rCcsFeZdZdZdd��fdd�
Zdd�Z�fdd	�Z�fd
d�Z�ZS)�_WaitCancelFuturezoSubclass of Future which represents a wait for the cancellation of a
    _WaitHandleFuture using an event.
    Nrcst�j||||d�d|_dS)Nr)rr�_done_callback)rr�eventrHrrr r!r�sz_WaitCancelFuture.__init__cCstd��dS)Nz'_WaitCancelFuture must not be cancelled)�RuntimeErrorr8r r r!r0�sz_WaitCancelFuture.cancelcs$t��|�|jdk	r |�|�dSr7)rr;rWr<rr r!r;�s
z_WaitCancelFuture.set_resultcs$t��|�|jdk	r |�|�dSr7)rr9rWr:rr r!r9�s
z_WaitCancelFuture.set_exception)	r>r?r@rArr0r;r9rBr r rr!rV�s
rVcs6eZdZdd��fdd�
Z�fdd�Zdd�Z�ZS)	�_WaitHandleFutureNrcs<t�j||||d�||_d|_t�dddd�|_d|_dS)NrTF)rr�	_proactorZ_unregister_proactorrQZCreateEvent�_event�
_event_fut)rrrGrH�proactorrrr r!r�s
z_WaitHandleFuture.__init__csF|jdk	r"t�|j�d|_d|_|j�|j�d|_t��|�dSr7)	r\rJ�CloseHandler]r[�_unregisterrrrOrMrr r!rO�s
	z%_WaitHandleFuture._unregister_wait_cbc
Cs�|js
dSd|_|j}d|_zt�||j�Wn`tk
r�}zB|jtjkr~d||d�}|jrh|j|d<|j	�
|�WY�dSW5d}~XYnX|j�|j|j
�|_dSrP)rFrErQZUnregisterWaitExr\r1rRrSrr2r3r[�_wait_cancelrOr]rTr r r!rU�s(�

�z"_WaitHandleFuture._unregister_wait)r>r?r@rrOrUrBr r rr!rZ�srZc@s<eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZeZ	dS)
�
PipeServerzXClass representing a pipe server.

    This is much like a bound, listening socket.
    cCs,||_t��|_d|_d|_|�d�|_dS�NT)�_address�weakref�WeakSet�_free_instances�_pipe�_accept_pipe_future�_server_pipe_handle)rr'r r r!r�s

zPipeServer.__init__cCs|j|�d�}|_|S)NF)rhrj)r�tmpr r r!�_get_unconnected_pipesz PipeServer._get_unconnected_pipec
Csr|��rdStjtjB}|r&|tjO}t�|j|tjtjBtj	Btj
tjtjtj
tj�}t�|�}|j�|�|Sr7)�closedrJZPIPE_ACCESS_DUPLEXZFILE_FLAG_OVERLAPPEDZFILE_FLAG_FIRST_PIPE_INSTANCEZCreateNamedPiperdZPIPE_TYPE_MESSAGEZPIPE_READMODE_MESSAGEZ	PIPE_WAITZPIPE_UNLIMITED_INSTANCESr
ZBUFSIZEZNMPWAIT_WAIT_FOREVER�NULL�
PipeHandlerg�add)r�first�flags�h�piper r r!rjs(

��
zPipeServer._server_pipe_handlecCs
|jdkSr7)rdr8r r r!rmszPipeServer.closedcCsR|jdk	r|j��d|_|jdk	rN|jD]}|��q*d|_d|_|j��dSr7)rir0rdrg�closerh�clear)rrtr r r!rus




zPipeServer.closeN)
r>r?r@rArrlrjrmru�__del__r r r r!rb�s
rbc@seZdZdZdS)�_WindowsSelectorEventLoopz'Windows version of selector event loop.N)r>r?r@rAr r r r!rx,srxcsHeZdZdZd
�fdd�	Z�fdd�Zdd�Zd	d
�Zddd�Z�Z	S)r
z2Windows version of proactor event loop using IOCP.Ncs|dkrt�}t��|�dSr7)rrr)rr^rr r!r3szProactorEventLoop.__init__c	sfz(|jdkst�|�|j�t��	�W5|jdk	r`|jj}|j��|dk	rZ|j�|�d|_XdSr7)
Z_self_reading_futurerr0r[r`�AssertionError�	call_soonZ_loop_self_readingr�run_forever�rrrr r!r{8s

zProactorEventLoop.run_foreverc�s8|j�|�}|IdH}|�}|j||d|id�}||fS)N�addr��extra)r[�connect_pipe�_make_duplex_pipe_transport)r�protocol_factoryr'�frt�protocol�transr r r!�create_pipe_connectionKs
�z(ProactorEventLoop.create_pipe_connectionc�s.t���d�����fdd�	������gS)Nc
sd}zn|rN|��}�j�|����r4|��WdS��}�j||d�id����}|dkrdWdS�j�|�}Wn�t	k
r�}zF|r�|�
�dkr���d||d��|��n�jr�t
jd|dd�W5d}~XYn2tjk
r�|r�|��YnX|�_|���dS)	Nr}r~rzPipe accept failed)r,r-rtzAccept pipe failed on pipe %rT)�exc_info)r=rg�discardrmrur�rlr[�accept_piper1�filenor3Z_debugrZwarningr�CancelledErrorri�add_done_callback)r�rtr�r4�r'�loop_accept_piper�rZserverr r!r�VsH��
�z>ProactorEventLoop.start_serving_pipe.<locals>.loop_accept_pipe)N)rbrz)rr�r'r r�r!�start_serving_pipeSs(
z$ProactorEventLoop.start_serving_pipec		�s�|��}
t||||||||f|
|d�|	��}z|
IdHWnDttfk
rT�Yn,tk
r~|��|��IdH�YnX|S)N)�waiterr)�
create_future�_WindowsSubprocessTransport�
SystemExit�KeyboardInterrupt�
BaseExceptionruZ_wait)rr��args�shell�stdin�stdout�stderr�bufsizer�kwargsr�Ztranspr r r!�_make_subprocess_transport�s*
���z,ProactorEventLoop._make_subprocess_transport)N)N)
r>r?r@rArr{r�r�r�rBr r rr!r
0s0�r
c@s�eZdZdZd;dd�Zdd�Zdd�Zd	d
�Zd<dd
�Zdd�Z	d=dd�Z
d>dd�Zd?dd�Zd@dd�Z
dAdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�ZdBd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�ZdCd3d4�Zd5d6�Zd7d8�Zd9d:�ZdS)Drz#Proactor implementation using IOCP.rcCsDd|_g|_t�tjtd|�|_i|_t�	�|_
g|_t�	�|_dSrI)
r2�_resultsrQ�CreateIoCompletionPort�INVALID_HANDLE_VALUErn�_iocp�_cachererfrF�
_unregistered�_stopped_serving)rZconcurrencyr r r!r�s�
zIocpProactor.__init__cCs|jdkrtd��dS)NzIocpProactor is closed)r�rYr8r r r!�
_check_closed�s
zIocpProactor._check_closedcCsFdt|j�dt|j�g}|jdkr0|�d�d|jjd�|�fS)Nzoverlapped#=%sz
result#=%srmz<%s %s>� )�lenr�r�r�rLrr>�join)rr)r r r!�__repr__�s�

zIocpProactor.__repr__cCs
||_dSr7)r2)rrr r r!�set_loop�szIocpProactor.set_loopNcCs |js|�|�|j}g|_|Sr7)r�rK)r�timeoutrkr r r!�select�s

zIocpProactor.selectcCs|j��}|�|�|Sr7)r2r�r;)r�valuerNr r r!�_result�s

zIocpProactor._resultrcCs~|�|�t�t�}z4t|tj�r6|�|��||�n|�|��|�Wnt	k
rf|�
d�YSXdd�}|�|||�S)N�c
SsRz
|��WStk
rL}z$|jtjtjfkr:t|j��n�W5d}~XYnXdSr7��	getresultr1rRrQZERROR_NETNAME_DELETEDZERROR_OPERATION_ABORTED�ConnectionResetErrorr��r��keyrr4r r r!�finish_recv�s
�z&IocpProactor.recv.<locals>.finish_recv)�_register_with_iocprQ�
Overlappedrn�
isinstance�socketZWSARecvr�ZReadFile�BrokenPipeErrorr��	_register�r�conn�nbytesrrrr�r r r!�recv�s


zIocpProactor.recvcCs~|�|�t�t�}z4t|tj�r6|�|��||�n|�|��|�Wnt	k
rf|�
d�YSXdd�}|�|||�S)Nrc
SsRz
|��WStk
rL}z$|jtjtjfkr:t|j��n�W5d}~XYnXdSr7r�r�r r r!r��s
�z+IocpProactor.recv_into.<locals>.finish_recv)r�rQr�rnr�r�ZWSARecvIntor�ZReadFileIntor�r�r�)rr��bufrrrr�r r r!�	recv_into�s


zIocpProactor.recv_intocCs`|�|�t�t�}z|�|��||�Wntk
rH|�d�YSXdd�}|�|||�S)N)r�Nc
SsRz
|��WStk
rL}z$|jtjtjfkr:t|j��n�W5d}~XYnXdSr7r�r�r r r!r��s
�z*IocpProactor.recvfrom.<locals>.finish_recv)	r�rQr�rnZWSARecvFromr�r�r�r�r�r r r!�recvfrom�s


zIocpProactor.recvfromcCs>|�|�t�t�}|�|��|||�dd�}|�|||�S)Nc
SsRz
|��WStk
rL}z$|jtjtjfkr:t|j��n�W5d}~XYnXdSr7r�r�r r r!�finish_sends
�z(IocpProactor.sendto.<locals>.finish_send)r�rQr�rnZ	WSASendTor�r�)rr�r�rrr}rr�r r r!�sendto�s



zIocpProactor.sendtocCsZ|�|�t�t�}t|tj�r4|�|��||�n|�|��|�dd�}|�	|||�S)Nc
SsRz
|��WStk
rL}z$|jtjtjfkr:t|j��n�W5d}~XYnXdSr7r�r�r r r!r�s
�z&IocpProactor.send.<locals>.finish_send)
r�rQr�rnr�r�ZWSASendr�Z	WriteFiler�)rr�r�rrrr�r r r!�sends


zIocpProactor.sendcsv|���|��j��t�t�}|����������fdd�}dd�}|�|�|�}||��}t	j
||jd�|S)NcsD|��t�d����}��tjtj|���	��
������fS)Nz@P)r��structZpackr��
setsockoptr��
SOL_SOCKETrQZSO_UPDATE_ACCEPT_CONTEXT�
settimeoutZ
gettimeoutZgetpeername)r�r�rr��r��listenerr r!�
finish_accept*s�z*IocpProactor.accept.<locals>.finish_acceptc�s4z|IdHWn tjk
r.|���YnXdSr7)rr�ru)r.r�r r r!�accept_coro3s
z(IocpProactor.accept.<locals>.accept_coror)r��_get_accept_socket�familyrQr�rnZAcceptExr�r�r	Z
ensure_futurer2)rr�rr�r�r.�coror r�r!�accept$s

	
zIocpProactor.acceptc
s��jtjkr4t����|�|j��}|�d�|S|�	��zt�
����j�WnBtk
r�}z$|j
tjkrt����ddkr��W5d}~XYnXt�t�}|����|��fdd�}|�|�|�S)Nrrcs|����tjtjd��SrI)r�r�r�r�rQZSO_UPDATE_CONNECT_CONTEXT�r�r�r�r�r r!�finish_connectVs�z,IocpProactor.connect.<locals>.finish_connect)�typer�Z
SOCK_DGRAMrQZ
WSAConnectr�r2r�r;r�Z	BindLocalr�r1rR�errnoZ	WSAEINVALZgetsocknamer�rnZ	ConnectExr�)rr�r'rN�err�r r�r!�connect@s"



zIocpProactor.connectc		Csb|�|�t�t�}|d@}|d?d@}|�|��t�|���|||dd�dd�}|�|||�S)Nr� rc
SsRz
|��WStk
rL}z$|jtjtjfkr:t|j��n�W5d}~XYnXdSr7r�r�r r r!�finish_sendfileis
�z.IocpProactor.sendfile.<locals>.finish_sendfile)	r�rQr�rnZTransmitFiler��msvcrtZ
get_osfhandler�)	rZsock�file�offset�countrZ
offset_lowZoffset_highr�r r r!�sendfile_s


�	zIocpProactor.sendfilecsJ|���t�t�}|�����}|r0|���S�fdd�}|�|�|�S)Ncs|���Sr7)r�r��rtr r!�finish_accept_pipesz4IocpProactor.accept_pipe.<locals>.finish_accept_pipe)r�rQr�rnZConnectNamedPiper�r�r�)rrtrZ	connectedr�r r�r!r�ts


zIocpProactor.accept_pipec
�srt}zt�|�}WqhWn0tk
rF}z|jtjkr6�W5d}~XYnXt|dt�}t�	|�IdHqt
�|�S)N�)�CONNECT_PIPE_INIT_DELAYrQZConnectPiper1rRZERROR_PIPE_BUSY�min�CONNECT_PIPE_MAX_DELAYr	�sleepr
ro)rr'ZdelayrGr4r r r!r��s
zIocpProactor.connect_pipecCs|�||d�S)z�Wait for a handle.

        Return a Future object. The result of the future is True if the wait
        completed, or False if the wait did not complete (on timeout).
        F)�_wait_for_handle)rrGr�r r r!�wait_for_handle�szIocpProactor.wait_for_handlecCs|�|dd�}||_|Src)r�rW)rrXZ
done_callbackrNr r r!ra�szIocpProactor._wait_cancelcs�|��|dkrtj}nt�|d�}t�t�}t�||j	|j
|�}|r\t||||jd��nt
|||||jd���jr~�jd=�fdd�}�|d|f|j|j
<�S)N�@�@rrcs���Sr7)rKr��r�r r!�finish_wait_for_handle�sz=IocpProactor._wait_for_handle.<locals>.finish_wait_for_handler)r�rJ�INFINITE�math�ceilrQr�rnZRegisterWaitWithQueuer�r'rVr2rZrr�)rrGr�Z
_is_cancel�msrrHr�r r�r!r��s*
�
�	zIocpProactor._wait_for_handlecCs0||jkr,|j�|�t�|��|jdd�dSrI)rFrprQr�r�r��r�objr r r!r��s
z IocpProactor._register_with_iocpc
Cs�|��t||jd�}|jr$|jd=|jsrz|dd|�}Wn,tk
rf}z|�|�W5d}~XYnX|�|�||||f|j|j	<|Sr)
r�rr2rr"r1r9r;r�r')rrr��callbackr�r�r�r r r!r��s

zIocpProactor._registercCs|��|j�|�dS)a
Unregister an overlapped object.

        Call this method when its future has been cancelled. The event can
        already be signalled (pending in the proactor event queue). It is also
        safe if the event is never signalled (because it was cancelled).
        N)r�r�rLr|r r r!r`�szIocpProactor._unregistercCst�|�}|�d�|SrI)r�r�)rr��sr r r!r��s

zIocpProactor._get_accept_socketcCs�|dkrt}n0|dkr td��nt�|d�}|tkr>td��t�|j|�}|dkrX�qZd}|\}}}}z|j�|�\}}	}
}WnXt	k
r�|j
��r�|j
�dd||||fd��|dtj
fkr�t�|�Yq>YnX|
|jkr�|��q>|��s>z||||	�}Wn:tk
�r@}
z|�|
�|j�|�W5d}
~
XYq>X|�|�|j�|�q>|jD]}	|j�|	jd��q`|j��dS)Nrznegative timeoutr�ztimeout too bigz8GetQueuedCompletionStatus() returned an unexpected eventz)err=%s transferred=%s key=%#x address=%#x)r,�status)r��
ValueErrorr�r�rQZGetQueuedCompletionStatusr�r��pop�KeyErrorr2Z	get_debugr3r�rJr_r�r0Zdoner1r9r�rLr;r�r'rv)rr�r�r��errZtransferredr�r'r�rr�r�r�r�r r r!rKsL


��	






zIocpProactor._pollcCs|j�|�dSr7)r�rpr�r r r!�
_stop_serving9szIocpProactor._stop_servingcCs|jdkrdSt|j���D]�\}\}}}}|��r6qt|t�rBqz|��Wqtk
r�}z6|j	dk	r�d||d�}|j
r�|j
|d<|j	�|�W5d}~XYqXqd}t�
�}	|	|}
|jr�|
t�
�kr�t�d|t�
�|	�t�
�|}
|�|�q�g|_t�|j�d|_dS)NzCancelling a future failedr+r/g�?z,%r is running after closing for %.1f seconds)r��listr��itemsZ	cancelledr�rVr0r1r2rr3�time�	monotonicr�debugrKr�rJr_)rr'rNrr�r�r4r5Z
msg_updateZ
start_timeZnext_msgr r r!ru?s@


�
 
�zIocpProactor.closecCs|��dSr7)rur8r r r!rwnszIocpProactor.__del__)r)N)r)r)r)rN)r)N)N)r>r?r@rArr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rar�r�r�r`r�rKr�rurwr r r r!r�s8








"
 

7/rc@seZdZdd�ZdS)r�c
sPtj|f|||||d�|���_�fdd�}�jj�t�jj��}	|	�|�dS)N)r�r�r�r�r�cs�j��}��|�dSr7)�_procZpollZ_process_exited)r��
returncoder8r r!r�ys
z4_WindowsSubprocessTransport._start.<locals>.callback)	r
�Popenr�r2r[r��intrDr�)
rr�r�r�r�r�r�r�r�r�r r8r!�_startts���z"_WindowsSubprocessTransport._startN)r>r?r@rr r r r!r�rsr�c@seZdZeZdS)rN)r>r?r@r�
_loop_factoryr r r r!r�src@seZdZeZdS)rN)r>r?r@r
rr r r r!r�sr)/rArQrJr�r�r�r�r�r�re�rrrrrrr	r
�logr�__all__rnr�ZERROR_CONNECTION_REFUSEDZERROR_CONNECTION_ABORTEDr�r�ZFuturerrCrVrZ�objectrbZBaseSelectorEventLooprxZBaseProactorEventLoopr
rZBaseSubprocessTransportr�rZBaseDefaultEventLoopPolicyrrrr r r r!�<module>sR0J4;e`asyncio/__pycache__/selector_events.cpython-38.opt-2.pyc000064400000066531151153537520017237 0ustar00U

e5dT��@s*dZddlZddlZddlZddlZddlZddlZddlZzddlZWne	k
r`dZYnXddl
mZddl
mZddl
m
Z
ddl
mZddl
mZdd	l
mZdd
l
mZddl
mZddlmZd
d�Zdd�ZGdd�dej�ZGdd�dejej�ZGdd�de�ZGdd�de�ZdS))�BaseSelectorEventLoop�N�)�base_events)�	constants)�events)�futures)�	protocols)�sslproto)�
transports)�trsock)�loggercCs8z|�|�}Wntk
r$YdSXt|j|@�SdS�NF)�get_key�KeyError�boolr)�selector�fdZevent�key�r�//usr/lib64/python3.8/asyncio/selector_events.py�_test_selector_event s
rcCs tdk	rt|tj�rtd��dS)Nz"Socket cannot be of type SSLSocket)�ssl�
isinstanceZ	SSLSocket�	TypeError)�sockrrr�_check_ssl_socket+srcs�eZdZdR�fdd�	ZdSddd�dd�ZdTddddejd�d	d
�ZdUdd�Z�fd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdddejfdd�Zdddejfdd�Zddejfdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Zd<d=�Z d>d?�Z!d@dA�Z"dBdC�Z#dDdE�Z$dFdG�Z%dHdI�Z&dJdK�Z'dLdM�Z(dNdO�Z)dPdQ�Z*�Z+S)VrNcsFt���|dkrt��}t�d|jj�||_|�	�t
��|_dS)NzUsing selector: %s)
�super�__init__�	selectorsZDefaultSelectorr�debug�	__class__�__name__�	_selector�_make_self_pipe�weakrefZWeakValueDictionary�_transports)�selfr�r rrr6s
zBaseSelectorEventLoop.__init__��extra�servercCst||||||�S�N)�_SelectorSocketTransport)r&r�protocol�waiterr)r*rrr�_make_socket_transport@s
�z,BaseSelectorEventLoop._make_socket_transportF)�server_side�server_hostnamer)r*�ssl_handshake_timeoutc	Cs0tj|||||||	d�}
t|||
||d�|
jS)N)r2r()r	ZSSLProtocolr,Z_app_transport)r&Zrawsockr-�
sslcontextr.r0r1r)r*r2Zssl_protocolrrr�_make_ssl_transportEs��z)BaseSelectorEventLoop._make_ssl_transportcCst||||||�Sr+)�_SelectorDatagramTransport)r&rr-�addressr.r)rrr�_make_datagram_transportRs
�z.BaseSelectorEventLoop._make_datagram_transportcsL|��rtd��|��rdS|��t���|jdk	rH|j��d|_dS)Nz!Cannot close a running event loop)Z
is_running�RuntimeError�	is_closed�_close_self_piper�closer"�r&r'rrr;Ws


zBaseSelectorEventLoop.closecCsB|�|j���|j��d|_|j��d|_|jd8_dS)Nr)�_remove_reader�_ssock�filenor;�_csock�
_internal_fdsr<rrrr:bs

z&BaseSelectorEventLoop._close_self_pipecCsNt��\|_|_|j�d�|j�d�|jd7_|�|j��|j�dS)NFr)	�socketZ
socketpairr>r@�setblockingrA�_add_readerr?�_read_from_selfr<rrrr#js
z%BaseSelectorEventLoop._make_self_pipecCsdSr+r�r&�datarrr�_process_self_datarsz(BaseSelectorEventLoop._process_self_datacCsXz"|j�d�}|sWqT|�|�Wqtk
r:YqYqtk
rPYqTYqXqdS)Ni)r>�recvrH�InterruptedError�BlockingIOErrorrFrrrrEusz%BaseSelectorEventLoop._read_from_selfcCsN|j}|dkrdSz|�d�Wn(tk
rH|jrDtjddd�YnXdS)N�z3Fail to write a null byte into the self-pipe socketT��exc_info)r@�send�OSError�_debugrr)r&Zcsockrrr�_write_to_self�s�z$BaseSelectorEventLoop._write_to_self�dc
Cs"|�|��|j||||||�dSr+)rDr?�_accept_connection)r&�protocol_factoryrr3r*�backlogr2rrr�_start_serving�s�z$BaseSelectorEventLoop._start_servingc
Cst|�D]�}z0|��\}}	|jr0t�d||	|�|�d�Wn�tttfk
rZYdSt	k
r�}
zd|
j
t
jt
jt
j
t
jfkr�|�d|
t�|�d��|�|���|�tj|j||||||�n�W5d}
~
XYqXd|	i}|�||||||�}|�|�qdS)Nz#%r got a new connection from %r: %rFz&socket.accept() out of system resource)�message�	exceptionrB�peername)�range�acceptrQrrrCrKrJ�ConnectionAbortedErrorrP�errnoZEMFILEZENFILEZENOBUFSZENOMEM�call_exception_handlerr�TransportSocketr=r?Z
call_laterrZACCEPT_RETRY_DELAYrW�_accept_connection2Zcreate_task)
r&rUrr3r*rVr2�_�conn�addr�excr)r\rrrrT�sV�����z(BaseSelectorEventLoop._accept_connectionc
�s�d}d}zt|�}|��}	|r8|j||||	d|||d�}n|j|||	||d�}z|	IdHWntk
rx|���YnXWntttfk
r��Yn\tk
r�}
z>|jr�d|
d�}|dk	r�||d<|dk	r�||d<|�|�W5d}
~
XYnXdS)NT)r.r0r)r*r2)r.r)r*z3Error on transport creation for incoming connection)rXrYr-�	transport)	�
create_futurer4r/�
BaseExceptionr;�
SystemExit�KeyboardInterruptrQr_)r&rUrcr)r3r*r2r-rfr.re�contextrrrra�sP���z)BaseSelectorEventLoop._accept_connection2c
Cs�|}t|t�sJzt|���}Wn*tttfk
rHtd|���d�YnXz|j|}Wntk
rlYnX|��s�t	d|�d|����dS)NzInvalid file object: zFile descriptor z is used by transport )
r�intr?�AttributeErrorr�
ValueErrorr%r�
is_closingr8)r&rr?rfrrr�_ensure_fd_no_transport�s
�z-BaseSelectorEventLoop._ensure_fd_no_transportc		Gs�|��t�|||d�}z|j�|�}Wn*tk
rR|j�|tj|df�Yn>X|j|j	}\}}|j�
||tjB||f�|dk	r�|��dSr+)�
_check_closedr�Handler"rr�registerr�
EVENT_READrG�modify�cancel�	r&r�callback�argsZhandler�mask�reader�writerrrrrDs�
�z!BaseSelectorEventLoop._add_readercCs�|��rdSz|j�|�}Wntk
r2YdSX|j|j}\}}|tjM}|sd|j�|�n|j�	||d|f�|dk	r�|�
�dSdSdS�NFT)r9r"rrrrGrrt�
unregisterrurv�r&rrrzr{r|rrrr=sz$BaseSelectorEventLoop._remove_readerc		Gs�|��t�|||d�}z|j�|�}Wn*tk
rR|j�|tjd|f�Yn>X|j|j	}\}}|j�
||tjB||f�|dk	r�|��dSr+)rqrrrr"rrrsr�EVENT_WRITErGrurvrwrrr�_add_writer%s�
�z!BaseSelectorEventLoop._add_writercCs�|��rdSz|j�|�}Wntk
r2YdSX|j|j}\}}|tjM}|sd|j�|�n|j�	|||df�|dk	r�|�
�dSdSdSr})r9r"rrrrGrr�r~rurvrrrr�_remove_writer4sz$BaseSelectorEventLoop._remove_writercGs|�|�|j||f|��Sr+)rprD�r&rrxryrrr�
add_readerKs
z BaseSelectorEventLoop.add_readercCs|�|�|�|�Sr+)rpr=�r&rrrr�
remove_readerPs
z#BaseSelectorEventLoop.remove_readercGs|�|�|j||f|��Sr+)rpr�r�rrr�
add_writerUs
z BaseSelectorEventLoop.add_writercCs|�|�|�|�Sr+)rpr�r�rrr�
remove_writerZs
z#BaseSelectorEventLoop.remove_writerc	�s�t|�|jr"|��dkr"td��z|�|�WSttfk
rFYnX|��}|��}|�	||j
|||�|�t�
|j|��|IdHS�Nr�the socket must be non-blocking)rrQ�
gettimeoutrnrIrKrJrgr?r��
_sock_recv�add_done_callback�	functools�partial�_sock_read_done)r&r�n�futrrrr�	sock_recv_s�zBaseSelectorEventLoop.sock_recvcCs|�|�dSr+)r��r&rr�rrrr�tsz%BaseSelectorEventLoop._sock_read_donec
Cs�|��rdSz|�|�}Wn\ttfk
r4YdSttfk
rL�Yn6tk
rv}z|�|�W5d}~XYnX|�|�dSr+)	�donerIrKrJrirjrh�
set_exception�
set_result)r&r�rr�rGrerrrr�wsz BaseSelectorEventLoop._sock_recvc	�s�t|�|jr"|��dkr"td��z|�|�WSttfk
rFYnX|��}|��}|�	||j
|||�|�t�
|j|��|IdHSr�)rrQr�rn�	recv_intorKrJrgr?r��_sock_recv_intor�r�r�r�)r&r�bufr�rrrr�sock_recv_into�s�z$BaseSelectorEventLoop.sock_recv_intoc
Cs�|��rdSz|�|�}Wn\ttfk
r4YdSttfk
rL�Yn6tk
rv}z|�|�W5d}~XYnX|�|�dSr+)	r�r�rKrJrirjrhr�r�)r&r�rr��nbytesrerrrr��sz%BaseSelectorEventLoop._sock_recv_intoc	�s�t|�|jr"|��dkr"td��z|�|�}Wnttfk
rLd}YnX|t|�kr^dS|��}|�	�}|�
t�|j
|��|�||j||t|�|g�|IdHSr�)rrQr�rnrOrKrJ�lenrgr?r�r�r��_sock_write_doner��
_sock_sendall�
memoryview)r&rrGr�r�rrrr�sock_sendall�s&	
��z"BaseSelectorEventLoop.sock_sendallc
Cs�|��rdS|d}z|�||d��}Wnbttfk
rDYdSttfk
r\�Yn2tk
r�}z|�|�WY�dSd}~XYnX||7}|t|�kr�|�	d�n||d<dS)Nr)
r�rOrKrJrirjrhr�r�r�)r&r�rZview�pos�startr�rerrrr��s 
z#BaseSelectorEventLoop._sock_sendallc�s�t|�|jr"|��dkr"td��ttd�r8|jtjkrf|j||j|j	|d�IdH}|d\}}}}}|�
�}|�|||�|IdHS)Nrr��AF_UNIX)�family�proto�loop)rrQr�rn�hasattrrBr�r�Z_ensure_resolvedr�rg�
_sock_connect)r&rr6Zresolvedrbr�rrr�sock_connect�s�z"BaseSelectorEventLoop.sock_connectc
Cs�|��}z|�|�Wn�ttfk
rV|�t�|j|��|�||j	|||�YnNt
tfk
rn�Yn6tk
r�}z|�
|�W5d}~XYnX|�d�dSr+)r?ZconnectrKrJr�r�r�r�r��_sock_connect_cbrirjrhr�r�)r&r�rr6rrerrrr��s�z#BaseSelectorEventLoop._sock_connectcCs|�|�dSr+)r�r�rrrr�sz&BaseSelectorEventLoop._sock_write_donec
Cs�|��rdSz,|�tjtj�}|dkr6t|d|����WnZttfk
rPYnNtt	fk
rh�Yn6t
k
r�}z|�|�W5d}~XYnX|�d�dS)NrzConnect call failed )
r�Z
getsockoptrBZ
SOL_SOCKETZSO_ERRORrPrKrJrirjrhr�r�)r&r�rr6�errrerrrr�sz&BaseSelectorEventLoop._sock_connect_cbc�sBt|�|jr"|��dkr"td��|��}|�|d|�|IdHS)Nrr�F)rrQr�rnrg�_sock_accept)r&rr�rrr�sock_acceptsz!BaseSelectorEventLoop.sock_acceptc
Cs�|��}|r|�|�|��r"dSz|��\}}|�d�Wnnttfk
rh|�||j|d|�YnRt	t
fk
r��Yn:tk
r�}z|�|�W5d}~XYnX|�
||f�dSr})r?r�r�r\rCrKrJr�r�rirjrhr�r�)r&r�Z
registeredrrrcr6rerrrr�*s
z"BaseSelectorEventLoop._sock_acceptc	�sp|j|j=|��}|��|��IdHz |j|j|||dd�IdHW�S|��|r^|��||j|j<XdS)NF)Zfallback)	r%�_sock_fd�
is_reading�
pause_reading�_make_empty_waiter�_reset_empty_waiter�resume_readingZ
sock_sendfile�_sock)r&Ztransp�file�offset�countr�rrr�_sendfile_native<s
�z&BaseSelectorEventLoop._sendfile_nativecCs�|D]v\}}|j|j}\}}|tj@rL|dk	rL|jrB|�|�n
|�|�|tj@r|dk	r|jrp|�|�q|�|�qdSr+)	�fileobjrGrrtZ
_cancelledr=Z
_add_callbackr�r�)r&Z
event_listrrzr�r{r|rrr�_process_eventsJs
z%BaseSelectorEventLoop._process_eventscCs|�|���|��dSr+)r=r?r;)r&rrrr�
_stop_servingXsz#BaseSelectorEventLoop._stop_serving)N)N)N)NNN),r!�
__module__�__qualname__rr/rZSSL_HANDSHAKE_TIMEOUTr4r7r;r:r#rHrErRrWrTrarprDr=r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��
__classcell__rrr'rr0s|
����
�
	�
.�
)rcs�eZdZdZeZdZd�fdd�	Zdd�Zdd�Z	d	d
�Z
dd�Zd
d�Zdd�Z
ejfdd�Zddd�Zdd�Zdd�Zdd�Zdd�Z�ZS) �_SelectorTransportiNcs�t��||�t�|�|jd<z|��|jd<Wntk
rNd|jd<YnXd|jkr�z|��|jd<Wn tj	k
r�d|jd<YnX||_
|��|_d|_
|�|�||_|��|_d|_d|_|jdk	r�|j��||j|j<dS)NrBZsocknamerZFr)rrrr`�_extraZgetsocknamerPZgetpeernamerB�errorr�r?r��_protocol_connected�set_protocol�_server�_buffer_factory�_buffer�
_conn_lost�_closingZ_attachr%)r&r�rr-r)r*r'rrris,





z_SelectorTransport.__init__cCs�|jjg}|jdkr |�d�n|jr0|�d�|�d|j���|jdk	r�|j��s�t|jj	|jt
j�}|rz|�d�n
|�d�t|jj	|jt
j�}|r�d}nd}|�
�}|�d|�d	|�d
��d�d�|��S)
N�closed�closingzfd=zread=pollingz	read=idle�pollingZidlezwrite=<z
, bufsize=�>z<{}>� )r r!r��appendr�r��_loopr9rr"rrtr��get_write_buffer_size�format�join)r&�infor��state�bufsizerrr�__repr__�s0


�
�z_SelectorTransport.__repr__cCs|�d�dSr+)�_force_closer<rrr�abort�sz_SelectorTransport.abortcCs||_d|_dS�NT)�	_protocolr��r&r-rrrr��sz_SelectorTransport.set_protocolcCs|jSr+)r�r<rrr�get_protocol�sz_SelectorTransport.get_protocolcCs|jSr+)r�r<rrrro�sz_SelectorTransport.is_closingcCsT|jr
dSd|_|j�|j�|jsP|jd7_|j�|j�|j�|jd�dS�NTr)	r�r�r=r�r�r�r��	call_soon�_call_connection_lostr<rrrr;�sz_SelectorTransport.closecCs,|jdk	r(|d|��t|d�|j��dS)Nzunclosed transport )�source)r��ResourceWarningr;)r&Z_warnrrr�__del__�s
z_SelectorTransport.__del__�Fatal error on transportcCsNt|t�r(|j��r@tjd||dd�n|j�||||jd��|�|�dS)Nz%r: %sTrM)rXrYrfr-)	rrPr��	get_debugrrr_r�r�)r&rerXrrr�_fatal_error�s

�z_SelectorTransport._fatal_errorcCsd|jr
dS|jr(|j��|j�|j�|jsBd|_|j�|j�|jd7_|j�|j	|�dSr�)
r�r��clearr�r�r�r�r=r�r��r&rerrrr��s
z_SelectorTransport._force_closecCsVz|jr|j�|�W5|j��d|_d|_d|_|j}|dk	rP|��d|_XdSr+)r�r;r�r�r�Z_detachr�Zconnection_lost)r&rer*rrrr��s
z(_SelectorTransport._call_connection_lostcCs
t|j�Sr+)r�r�r<rrrr��sz(_SelectorTransport.get_write_buffer_sizecGs"|jr
dS|jj||f|��dSr+)r�r�rDr�rrrrD�sz_SelectorTransport._add_reader)NN)r�)r!r�r��max_size�	bytearrayr�r�rr�r�r�r�ror;�warnings�warnr�r�r�r�r�rDr�rrr'rr�]s 

r�cs�eZdZdZejjZd#�fdd�	Z�fdd�Z	dd�Z
d	d
�Zdd�Zd
d�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Z�fdd�Zdd �Zd!d"�Z�ZS)$r,TNcs~d|_t��|||||�d|_d|_d|_t�|j�|j	�
|jj|�|j	�
|j
|j|j�|dk	rz|j	�
tj|d�dSr
)�_read_ready_cbrr�_eof�_paused�
_empty_waiterrZ_set_nodelayr�r�r�r��connection_maderDr��_read_readyr�_set_result_unless_cancelled)r&r�rr-r.r)r*r'rrr�s 
�
�z!_SelectorSocketTransport.__init__cs.t|tj�r|j|_n|j|_t��|�dSr+)rrZBufferedProtocol�_read_ready__get_bufferr��_read_ready__data_receivedrr�r�r'rrr�	s
z%_SelectorSocketTransport.set_protocolcCs|jo|jSr+)r�r�r<rrrr�sz#_SelectorSocketTransport.is_readingcCs>|js|jrdSd|_|j�|j�|j��r:t�d|�dS)NTz%r pauses reading)r�r�r�r=r�r�rrr<rrrr�s
z&_SelectorSocketTransport.pause_readingcCs@|js|jsdSd|_|�|j|j�|j��r<t�d|�dS)NFz%r resumes reading)	r�r�rDr�r�r�r�rrr<rrrr�s
z'_SelectorSocketTransport.resume_readingcCs|��dSr+)r�r<rrrr�$sz$_SelectorSocketTransport._read_readyc
Cs`|jr
dSz |j�d�}t|�s(td��WnLttfk
rD�Yn4tk
rv}z|�|d�WY�dSd}~XYnXz|j	�
|�}Wndttfk
r�YdSttfk
r��Yn4tk
r�}z|�|d�WY�dSd}~XYnX|�s|�
�dSz|j�|�WnJttfk
�r,�Yn0tk
�rZ}z|�|d�W5d}~XYnXdS)N���z%get_buffer() returned an empty bufferz/Fatal error: protocol.get_buffer() call failed.�$Fatal read error on socket transportz3Fatal error: protocol.buffer_updated() call failed.)r�r�Z
get_bufferr�r8rirjrhr�r�r�rKrJ�_read_ready__on_eofZbuffer_updated)r&r�rer�rrrr�'sF��z0_SelectorSocketTransport._read_ready__get_bufferc
Cs�|jr
dSz|j�|j�}Wndttfk
r6YdSttfk
rN�Yn4tk
r�}z|�	|d�WY�dSd}~XYnX|s�|�
�dSz|j�|�WnFttfk
r��Yn.tk
r�}z|�	|d�W5d}~XYnXdS)Nr�z2Fatal error: protocol.data_received() call failed.)
r�r�rIr�rKrJrirjrhr�r�r�Z
data_received)r&rGrerrrr�Ls.�z3_SelectorSocketTransport._read_ready__data_receivedc
Cs�|j��rt�d|�z|j��}WnLttfk
r>�Yn4tk
rp}z|�	|d�WY�dSd}~XYnX|r�|j�
|j�n|��dS)Nz%r received EOFz1Fatal error: protocol.eof_received() call failed.)
r�r�rrr�Zeof_receivedrirjrhr�r=r�r;)r&Z	keep_openrerrrr�es
�z,_SelectorSocketTransport._read_ready__on_eofc
Cs6t|tttf�s$tdt|�j����|jr2td��|j	dk	rDtd��|sLdS|j
rz|j
tjkrht
�d�|j
d7_
dS|j�sz|j�|�}Wnbttfk
r�Ynbttfk
r��YnJtk
r�}z|�|d�WY�dSd}~XYnX||d�}|�sdS|j�|j|j�|j�|�|��dS)N�/data argument must be a bytes-like object, not z%Cannot call write() after write_eof()z(unable to write; sendfile is in progress�socket.send() raised exception.r�%Fatal write error on socket transport)r�bytesr�r�r�typer!r�r8r�r�r�!LOG_THRESHOLD_FOR_CONNLOST_WRITESr�warningr�r�rOrKrJrirjrhr�r�r�r��_write_ready�extend�_maybe_pause_protocol)r&rGr�rerrr�writezs:

z_SelectorSocketTransport.writec
Cs|jr
dSz|j�|j�}Wn�ttfk
r4Yn�ttfk
rL�Yn�tk
r�}z>|j	�
|j�|j��|�
|d�|jdk	r�|j�|�W5d}~XYnnX|r�|jd|�=|��|j�s|j	�
|j�|jdk	r�|j�d�|jr�|�d�n|j�r|j�tj�dS)Nr�)r�r�rOr�rKrJrirjrhr�r�r�r�r�r�r��_maybe_resume_protocolr�r�r�r��shutdownrB�SHUT_WR)r&r�rerrrr�s2


z%_SelectorSocketTransport._write_readycCs.|js|jrdSd|_|js*|j�tj�dSr�)r�r�r�r�rrBrr<rrr�	write_eof�s
z"_SelectorSocketTransport.write_eofcCsdSr�rr<rrr�
can_write_eof�sz&_SelectorSocketTransport.can_write_eofcs*t��|�|jdk	r&|j�td��dS)NzConnection is closed by peer)rr�r�r��ConnectionErrorr�r'rrr��s

�z._SelectorSocketTransport._call_connection_lostcCs6|jdk	rtd��|j��|_|js0|j�d�|jS)NzEmpty waiter is already set)r�r8r�rgr�r�r<rrrr��s
z+_SelectorSocketTransport._make_empty_waitercCs
d|_dSr+)r�r<rrrr��sz,_SelectorSocketTransport._reset_empty_waiter)NNN)r!r�r�Z_start_tls_compatiblerZ
_SendfileModeZ
TRY_NATIVEZ_sendfile_compatiblerr�r�r�r�r�r�r�r�rrrrr�r�r�r�rrr'rr,�s*�%'r,csFeZdZejZd�fdd�	Zdd�Zdd�Zd
dd	�Z	d
d�Z
�ZS)r5Ncs^t��||||�||_|j�|jj|�|j�|j|j|j	�|dk	rZ|j�t
j|d�dSr+)rr�_addressr�r�r�r�rDr�r�rr�)r&r�rr-r6r.r)r'rrr�s
�
�z#_SelectorDatagramTransport.__init__cCstdd�|jD��S)Ncss|]\}}t|�VqdSr+)r�)�.0rGrbrrr�	<genexpr>�szC_SelectorDatagramTransport.get_write_buffer_size.<locals>.<genexpr>)�sumr�r<rrrr��sz0_SelectorDatagramTransport.get_write_buffer_sizec
Cs�|jr
dSz|j�|j�\}}Wn�ttfk
r8Yn�tk
rd}z|j�|�W5d}~XYnTt	t
fk
r|�Yn<tk
r�}z|�|d�W5d}~XYnX|j�
||�dS)Nz&Fatal read error on datagram transport)r�r�Zrecvfromr�rKrJrPr��error_receivedrirjrhr�Zdatagram_received�r&rGrdrerrrr��sz&_SelectorDatagramTransport._read_readyc
Cs�t|tttf�s$tdt|�j����|s,dS|jrV|d|jfkrPtd|j����|j}|j	r�|jr�|j	t
jkrxt�
d�|j	d7_	dS|j�slz,|jdr�|j�|�n|j�||�WdSttfk
r�|j�|j|j�Yn�tk
�r}z|j�|�WY�dSd}~XYnPttfk
�r6�Yn6tk
�rj}z|�|d�WY�dSd}~XYnX|j� t|�|f�|�!�dS)Nr�z!Invalid address: must be None or r�rrZ�'Fatal write error on datagram transport)"rr�r�r�rr�r!r
rnr�rr�rr�r�r�r�rO�sendtorKrJr�r�r��
_sendto_readyrPr�rrirjrhr�r�rrrrrr�sH
�

�z!_SelectorDatagramTransport.sendtoc
Cs|jr�|j��\}}z*|jdr.|j�|�n|j�||�Wqttfk
rj|j�||f�Yq�Yqt	k
r�}z|j
�|�WY�dSd}~XYqtt
fk
r��Yqtk
r�}z|�|d�WY�dSd}~XYqXq|��|j�s|j�|j�|j�r|�d�dS)NrZr)r��popleftr�r�rOrrKrJ�
appendleftrPr�rrirjrhr�rr�r�r�r�r�rrrrr*s2
�z(_SelectorDatagramTransport._sendto_ready)NNN)N)r!r�r��collections�dequer�rr�r�rrr�rrr'rr5�s�

+r5)�__all__rr^r�rrBr�r$r�ImportError�rrrrrr	r
r�logrrrZ
BaseEventLooprZ_FlowControlMixinZ	Transportr�r,r5rrrr�<module>sD
1�oasyncio/__pycache__/proactor_events.cpython-38.opt-2.pyc000064400000055655151153537520017255 0ustar00U

e5d<}�@sPdZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddlm
Z
ddlmZddlmZddlm
Z
dd	lmZdd
lmZddlmZddlmZd
d�ZGdd�dejej�ZGdd�deej�ZGdd�deej�ZGdd�de�ZGdd�de�ZGdd�deeej�ZGdd�deeej�ZGdd�de	j �Z!dS))�BaseProactorEventLoop�N�)�base_events)�	constants)�futures)�
exceptions)�	protocols)�sslproto)�
transports)�trsock)�loggercCs�t�|�|jd<z|��|jd<Wn0tjk
rR|j��rNtj	d|dd�YnXd|jkr�z|�
�|jd<Wn tjk
r�d|jd<YnXdS)N�socketZsocknamezgetsockname() failed on %rT��exc_info�peername)r�TransportSocket�_extraZgetsocknamer
�error�_loop�	get_debugr�warningZgetpeername)�	transport�sock�r�//usr/lib64/python3.8/asyncio/proactor_events.py�_set_socket_extras
�
rcs~eZdZd�fdd�	Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	e
jfdd�Zddd�Z
dd�Zdd�Zdd�Z�ZS)�_ProactorBasePipeTransportNcs�t��||�|�|�||_|�|�||_d|_d|_d|_d|_	d|_
d|_d|_|jdk	rl|j�
�|j�|jj|�|dk	r�|j�tj|d�dS)NrF)�super�__init__�
_set_extra�_sock�set_protocol�_server�_buffer�	_read_fut�
_write_fut�_pending_write�
_conn_lost�_closing�_eof_writtenZ_attachr�	call_soon�	_protocolZconnection_maderZ_set_result_unless_cancelled��self�loopr�protocol�waiter�extra�server��	__class__rrr2s(




�z#_ProactorBasePipeTransport.__init__cCs�|jjg}|jdkr |�d�n|jr0|�d�|jdk	rP|�d|j�����|jdk	rl|�d|j���|jdk	r�|�d|j���|jr�|�dt	|j����|j
r�|�d�d�d	�|��S)
N�closed�closingzfd=zread=zwrite=zwrite_bufsize=zEOF writtenz<{}>� )
r4�__name__r �appendr(�filenor$r%r#�lenr)�format�join)r-�inforrr�__repr__Hs 






z#_ProactorBasePipeTransport.__repr__cCs||jd<dS)N�pipe)r�r-rrrrrZsz%_ProactorBasePipeTransport._set_extracCs
||_dS�N�r+)r-r/rrrr!]sz'_ProactorBasePipeTransport.set_protocolcCs|jSrBrC�r-rrr�get_protocol`sz'_ProactorBasePipeTransport.get_protocolcCs|jSrB)r(rDrrr�
is_closingcsz%_ProactorBasePipeTransport.is_closingcCs\|jr
dSd|_|jd7_|js>|jdkr>|j�|jd�|jdk	rX|j��d|_dS)NTr)	r(r'r#r%rr*�_call_connection_lostr$�cancelrDrrr�closefs

z _ProactorBasePipeTransport.closecCs*|jdk	r&|d|��t|d�|��dS)Nzunclosed transport )�source)r �ResourceWarningrI)r-Z_warnrrr�__del__qs
z"_ProactorBasePipeTransport.__del__�Fatal error on pipe transportc	CsVzDt|t�r*|j��rBtjd||dd�n|j�||||jd��W5|�|�XdS)Nz%r: %sTr)�message�	exceptionrr/)	�_force_close�
isinstance�OSErrorrrr�debug�call_exception_handlerr+)r-�excrNrrr�_fatal_errorvs

�z'_ProactorBasePipeTransport._fatal_errorcCs�|jdk	r6|j��s6|dkr*|j�d�n|j�|�|jr@dSd|_|jd7_|jrj|j��d|_|jr�|j��d|_d|_	d|_
|j�|j
|�dS)NTrr)�
_empty_waiter�done�
set_resultZ
set_exceptionr(r'r%rHr$r&r#rr*rG)r-rUrrrrP�s"

z'_ProactorBasePipeTransport._force_closec	Cs^z|j�	|�W5t|jd�r,|j�tj�|j��d|_|j}|dk	rX|��d|_XdS)N�shutdown)
�hasattrr rZr
Z	SHUT_RDWRrIr"Z_detachr+Zconnection_lost)r-rUr2rrrrG�s
z0_ProactorBasePipeTransport._call_connection_lostcCs"|j}|jdk	r|t|j�7}|SrB)r&r#r;)r-�sizerrr�get_write_buffer_size�s
z0_ProactorBasePipeTransport.get_write_buffer_size)NNN)rM)r8�
__module__�__qualname__rr?rr!rErFrI�warnings�warnrLrVrPrGr]�
__classcell__rrr3rr.s�
rcsPeZdZd�fdd�	Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zddd�Z	�Z
S)�_ProactorReadPipeTransportNcs:d|_d|_t��||||||�|j�|j�d|_dS)NTF)�
_pending_data�_pausedrrrr*�
_loop_readingr,r3rrr�s
z#_ProactorReadPipeTransport.__init__cCs|jo|jSrB)rer(rDrrr�
is_reading�sz%_ProactorReadPipeTransport.is_readingcCs0|js|jrdSd|_|j��r,t�d|�dS)NTz%r pauses reading)r(rerrrrSrDrrr�
pause_reading�s

z(_ProactorReadPipeTransport.pause_readingcCsn|js|jsdSd|_|jdkr0|j�|jd�|j}d|_|dk	rT|j�|j|�|j��rjt	�
d|�dS)NFz%r resumes reading)r(rer$rr*rfrd�_data_receivedrrrS�r-�datarrr�resume_reading�s

z)_ProactorReadPipeTransport.resume_readingc
Cs�|j��rt�d|�z|j��}WnLttfk
r>�Yn4tk
rp}z|�	|d�WY�dSd}~XYnX|s~|�
�dS)Nz%r received EOFz1Fatal error: protocol.eof_received() call failed.)rrrrSr+Zeof_received�
SystemExit�KeyboardInterrupt�
BaseExceptionrVrI)r-Z	keep_openrUrrr�
_eof_received�s
�z(_ProactorReadPipeTransport._eof_receivedc
Cs�|jr||_dS|s |��dSt|jtj�r�zt�|j|�Wq�tt	fk
rZ�Yq�t
k
r�}z|�|d�WY�dSd}~XYq�Xn|j�|�dS)Nz3Fatal error: protocol.buffer_updated() call failed.)
rerdrprQr+rZBufferedProtocolZ_feed_data_to_buffered_protormrnrorVZ
data_received)r-rkrUrrrri�s"�z)_ProactorReadPipeTransport._data_receivedc
Cstd}�zRzp|dk	r2d|_|��r*|��}n|��|jrHd}WW��dS|dkr\WW��dS|jsv|jj�	|j
d�|_Wn�tk
r�}z0|js�|�|d�n|j�
�r�tjddd�W5d}~XYn�tk
r�}z|�|�W5d}~XYnftk
�r}z|�|d�W5d}~XYn8tjk
�r>|j�s:�YnX|j�sV|j�|j�W5|dk	�rn|�|�XdS)N�i�z"Fatal read error on pipe transportz*Read error on pipe transport while closingTr)rir$rX�resultrHr(rer�	_proactor�recvr �ConnectionAbortedErrorrVrrrS�ConnectionResetErrorrPrRr�CancelledError�add_done_callbackrf)r-�futrkrUrrrrfs@

�
z(_ProactorReadPipeTransport._loop_reading)NNN)N)r8r^r_rrgrhrlrprirfrbrrr3rrc�s�	rccsZeZdZdZ�fdd�Zdd�Zddd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Z�ZS)�_ProactorBaseWritePipeTransportTcst�j||�d|_dSrB)rrrW�r-�args�kwr3rrrGsz(_ProactorBaseWritePipeTransport.__init__cCs�t|tttf�s$tdt|�j����|jr2td��|j	dk	rDtd��|sLdS|j
rz|j
tjkrht
�d�|j
d7_
dS|jdkr�|jt|�d�n.|js�t|�|_|��n|j�|�|��dS)Nz/data argument must be a bytes-like object, not zwrite_eof() already calledz(unable to write; sendfile is in progresszsocket.send() raised exception.r)rk)rQ�bytes�	bytearray�
memoryview�	TypeError�typer8r)�RuntimeErrorrWr'r�!LOG_THRESHOLD_FOR_CONNLOST_WRITESrrr%�
_loop_writingr#�_maybe_pause_protocol�extendrjrrr�writeKs,�




z%_ProactorBaseWritePipeTransport.writeNc
CsVz�|dk	r |jdkr |jr WdSd|_d|_|r8|��|dkrL|j}d|_|s�|jrf|j�|jd�|jrz|j	�
tj�|�
�nN|jj�|j	|�|_|j��s�t|�|_|j�|j�|��n|j�|j�|jdk	r�|jdkr�|j�d�Wn\tk
�r"}z|�|�W5d}~XYn0tk
�rP}z|�|d�W5d}~XYnXdS)Nrz#Fatal write error on pipe transport)r%r(r&rrr#rr*rGr)r rZr
�SHUT_WR�_maybe_resume_protocolrs�sendrXr;rxr�r�rWrYrvrPrRrV)r-�frkrUrrrr�qs8



z-_ProactorBaseWritePipeTransport._loop_writingcCsdS�NTrrDrrr�
can_write_eof�sz-_ProactorBaseWritePipeTransport.can_write_eofcCs|��dSrB)rIrDrrr�	write_eof�sz)_ProactorBaseWritePipeTransport.write_eofcCs|�d�dSrB�rPrDrrr�abort�sz%_ProactorBaseWritePipeTransport.abortcCs:|jdk	rtd��|j��|_|jdkr4|j�d�|jS)NzEmpty waiter is already set)rWr�rZ
create_futurer%rYrDrrr�_make_empty_waiter�s

z2_ProactorBaseWritePipeTransport._make_empty_waitercCs
d|_dSrB)rWrDrrr�_reset_empty_waiter�sz3_ProactorBaseWritePipeTransport._reset_empty_waiter)NN)
r8r^r_Z_start_tls_compatiblerr�r�r�r�r�r�r�rbrrr3rrzAs&
)rzcs$eZdZ�fdd�Zdd�Z�ZS)�_ProactorWritePipeTransportcs4t�j||�|jj�|jd�|_|j�|j�dS)N�)	rrrrsrtr r$rx�_pipe_closedr{r3rrr�sz$_ProactorWritePipeTransport.__init__cCs@|��rdS|jrdSd|_|jdk	r4|�t��n|��dSrB)Z	cancelledr(r$r%rP�BrokenPipeErrorrI)r-ryrrrr��s
z(_ProactorWritePipeTransport._pipe_closed)r8r^r_rr�rbrrr3rr��sr�csXeZdZdZd�fdd�	Zdd�Zdd�Zd	d
�Zddd�Zdd
d�Z	ddd�Z
�ZS)�_ProactorDatagramTransportiNcs>||_d|_t�j|||||d�t��|_|j�|j	�dS)N)r0r1)
�_addressrWrr�collections�dequer#rr*rf)r-r.rr/�addressr0r1r3rrr�s

z#_ProactorDatagramTransport.__init__cCst||�dSrB�rrArrrr�sz%_ProactorDatagramTransport._set_extracCstdd�|jD��S)Ncss|]\}}t|�VqdSrB)r;)�.0rk�_rrr�	<genexpr>�szC_ProactorDatagramTransport.get_write_buffer_size.<locals>.<genexpr>)�sumr#rDrrrr]�sz0_ProactorDatagramTransport.get_write_buffer_sizecCs|�d�dSrBr�rDrrrr��sz _ProactorDatagramTransport.abortcCs�t|tttf�stdt|���|s&dS|jdk	rN|d|jfkrNtd|j����|jr�|jr�|jt	j
krpt�d�|jd7_dS|j
�t|�|f�|jdkr�|��|��dS)Nz,data argument must be bytes-like object (%r)z!Invalid address: must be None or z!socket.sendto() raised exception.r)rQr~rr�r�r�r��
ValueErrorr'rr�rrr#r9r%r�r�)r-rk�addrrrr�sendto�s&�
�

z!_ProactorDatagramTransport.sendtoc
Csz�|jrWdSd|_|r |��|jr2|jrN|jrN|jrH|j�|jd�WdS|j�	�\}}|jdk	r||jj
�|j|�|_n|jj
j
|j||d�|_WnZtk
r�}z|j�|�W5d}~XYnDtk
r�}z|�|d�W5d}~XYnX|j�|j�|��dS)N)r�z'Fatal write error on datagram transport)r'r%rrr#r�r(rr*rG�popleftrsr�r r�rRr+�error_received�	ExceptionrVrxr�r�)r-ryrkr�rUrrrr��s2
��z(_ProactorDatagramTransport._loop_writingc
Cs4d}�zz�|jrWW��dSd|_|dk	rf|��}|jrFd}WW��dS|jdk	r^||j}}n|\}}|jrvWW��dS|jdk	r�|jj�	|j
|j�|_n|jj�|j
|j�|_WnJt
k
r�}z|j�|�W5d}~XYn8tjk
r�|js��YnX|jdk	�r|j�|j�W5|�r.|j�||�XdSrB)r+Zdatagram_receivedr'r$rrr(r�rrsrtr �max_sizeZrecvfromrRr�rrwrxrf)r-ryrkr��resrUrrrrfs>



��
z(_ProactorDatagramTransport._loop_reading)NNN)N)N)N)r8r^r_r�rrr]r�r�r�rfrbrrr3rr��s�

!r�c@seZdZdd�Zdd�ZdS)�_ProactorDuplexPipeTransportcCsdS)NFrrDrrrr�Jsz*_ProactorDuplexPipeTransport.can_write_eofcCst�dSrB)�NotImplementedErrorrDrrrr�Msz&_ProactorDuplexPipeTransport.write_eofN)r8r^r_r�r�rrrrr�Esr�cs>eZdZejjZd
�fdd�	Zdd�Zdd�Z	dd	�Z
�ZS)�_ProactorSocketTransportNcs$t��||||||�t�|�dSrB)rrrZ_set_nodelayr,r3rrrXsz!_ProactorSocketTransport.__init__cCst||�dSrBr�rArrrr]sz#_ProactorSocketTransport._set_extracCsdSr�rrDrrrr�`sz&_ProactorSocketTransport.can_write_eofcCs2|js|jrdSd|_|jdkr.|j�tj�dSr�)r(r)r%r rZr
r�rDrrrr�cs

z"_ProactorSocketTransport.write_eof)NNN)r8r^r_rZ
_SendfileModeZ
TRY_NATIVEZ_sendfile_compatiblerrr�r�rbrrr3rr�Qs�r�cs�eZdZ�fdd�Zd3dd�Zd4dddddd�dd	�Zd5d
d�Zd6dd
�Zd7dd�Zd8dd�Z	�fdd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd9d&d'�Zd(d)�Zd:d+d,�Zd-d.�Zd/d0�Zd1d2�Z�ZS);rcsht���t�d|jj�||_||_d|_i|_	|�
|�|��t�
�t��krdt�|j���dS)NzUsing proactor: %s)rrrrSr4r8rs�	_selector�_self_reading_future�_accept_futuresZset_loop�_make_self_pipe�	threading�current_thread�main_thread�signal�
set_wakeup_fd�_csockr:)r-Zproactorr3rrrms

zBaseProactorEventLoop.__init__NcCst||||||�SrB)r�)r-rr/r0r1r2rrr�_make_socket_transportzs
�z,BaseProactorEventLoop._make_socket_transportF)�server_side�server_hostnamer1r2�ssl_handshake_timeoutc	Cs0tj|||||||	d�}
t|||
||d�|
jS)N)r��r1r2)r	ZSSLProtocolr�Z_app_transport)r-Zrawsockr/�
sslcontextr0r�r�r1r2r�Zssl_protocolrrr�_make_ssl_transports��z)BaseProactorEventLoop._make_ssl_transportcCst||||||�SrB)r�)r-rr/r�r0r1rrr�_make_datagram_transport�s
�z.BaseProactorEventLoop._make_datagram_transportcCst|||||�SrB)r��r-rr/r0r1rrr�_make_duplex_pipe_transport�s�z1BaseProactorEventLoop._make_duplex_pipe_transportcCst|||||�SrB)rcr�rrr�_make_read_pipe_transport�sz/BaseProactorEventLoop._make_read_pipe_transportcCst|||||�SrB)r�r�rrr�_make_write_pipe_transport�s�z0BaseProactorEventLoop._make_write_pipe_transportcsj|��rtd��|��rdSt��t��kr6t�d�|��|�	�|j
��d|_
d|_t
���dS)Nz!Cannot close a running event loop���)Z
is_runningr��	is_closedr�r�r�r�r��_stop_accept_futures�_close_self_pipersrIr�rrDr3rrrI�s

zBaseProactorEventLoop.closec�s|j�||�IdHSrB)rsrt)r-r�nrrr�	sock_recv�szBaseProactorEventLoop.sock_recvc�s|j�||�IdHSrB)rsZ	recv_into)r-rZbufrrr�sock_recv_into�sz$BaseProactorEventLoop.sock_recv_intoc�s|j�||�IdHSrB)rsr�)r-rrkrrr�sock_sendall�sz"BaseProactorEventLoop.sock_sendallc�s|j�||�IdHSrB)rsZconnect)r-rr�rrr�sock_connect�sz"BaseProactorEventLoop.sock_connectc�s|j�|�IdHSrB)rs�acceptrArrr�sock_accept�sz!BaseProactorEventLoop.sock_acceptc
�s(z|��}Wn2ttjfk
r>}zt�d��W5d}~XYnXzt�|�j}Wn,t	k
r|}zt�d��W5d}~XYnX|r�|n|}|s�dSt
|d�}|r�t
|||�n|}	t
||�}d}
zLt
|	||�}|dkr�|
W�0S|j�
||||�IdH||7}|
|7}
q�W5|
dk�r"|�|�XdS)Nznot a regular filerl��)r:�AttributeError�io�UnsupportedOperationrZSendfileNotAvailableError�os�fstat�st_sizerR�min�seekrs�sendfile)r-r�file�offset�countr:�errZfsizeZ	blocksizeZend_posZ
total_sentrrr�_sock_sendfile_native�s0


z+BaseProactorEventLoop._sock_sendfile_nativec�sZ|��}|��|��IdHz |j|j|||dd�IdHW�S|��|rT|��XdS)NF)Zfallback)rgrhr�r�rlZ
sock_sendfiler )r-Ztranspr�r�r�rlrrr�_sendfile_native�s�z&BaseProactorEventLoop._sendfile_nativecCsL|jdk	r|j��d|_|j��d|_|j��d|_|jd8_dS)Nr)r�rH�_ssockrIr��
_internal_fdsrDrrrr��s



z&BaseProactorEventLoop._close_self_pipecCs:t��\|_|_|j�d�|j�d�|jd7_dS)NFr)r
Z
socketpairr�r�Zsetblockingr�rDrrrr��sz%BaseProactorEventLoop._make_self_pipec
Cs�z4|dk	r|��|j|k	r"WdS|j�|jd�}Wnbtjk
rLYdSttfk
rd�YnFt	k
r�}z|�
d||d��W5d}~XYnX||_|�|j�dS)Niz.Error on reading from the event loop self pipe)rNrOr.)
rrr�rsrtr�rrwrmrnrorTrx�_loop_self_reading)r-r�rUrrrr��s$
�z(BaseProactorEventLoop._loop_self_readingcCsN|j}|dkrdSz|�d�Wn(tk
rH|jrDtjddd�YnXdS)N�z3Fail to write a null byte into the self-pipe socketTr)r�r�rR�_debugrrS)r-Zcsockrrr�_write_to_selfs�z$BaseProactorEventLoop._write_to_self�dcs(d�������fdd�	�����dS)Nc
s,z�|dk	rn|��\}}�jr,t�d�||���}�dk	rX�j||�dd|i��d�n�j||d|i�d����r|WdS�j���}Wn�t	k
r�}zH��
�dkrʈ�d|t�
��d�����n�jr�tjd	�dd
�W5d}~XYn8tjk
�r���YnX|�j��
�<|���dS)Nz#%r got a new connection from %r: %rTr)r�r1r2r�r�r�zAccept failed on a socket)rNrOr
zAccept failed on socket %rr)rrr�rrSr�r�r�rsr�rRr:rTrrrIrrwr�rx)r�Zconnr�r/rU�r.�protocol_factoryr-r2rr�r�rrr./s\����
�z2BaseProactorEventLoop._start_serving.<locals>.loop)N)r*)r-r�rr�r2Zbacklogr�rr�r�_start_serving+s%z$BaseProactorEventLoop._start_servingcCsdSrBr)r-Z
event_listrrr�_process_eventsVsz%BaseProactorEventLoop._process_eventscCs&|j��D]}|��q
|j��dSrB)r��valuesrH�clear)r-�futurerrrr�Zs
z*BaseProactorEventLoop._stop_accept_futurescCs6|j�|��d�}|r|��|j�|�|��dSrB)r��popr:rHrs�
_stop_servingrI)r-rr�rrrr�_s
z#BaseProactorEventLoop._stop_serving)NNN)N)NNN)NN)NN)NN)N)NNr�N)r8r^r_rr�r�r�r�r�r�rIr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rbrrr3rrks\
�
���
�
�
�


�
+r)"�__all__r�r�r
r`r�r�r��rrrrrr	r
r�logrrZ_FlowControlMixinZ
BaseTransportrZ
ReadTransportrcZWriteTransportrzr�r�Z	Transportr�r�Z
BaseEventLooprrrrr�<module>sP���n��asyncio/__pycache__/coroutines.cpython-38.opt-1.pyc000064400000014653151153537520016222 0ustar00U

e5d]"�@s�dZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddl
mZddl
m
Z
ddlmZdd	�Ze�ZGd
d�d�Zdd
�Ze�Zdd�ZejejejjefZe�Zdd�Zdd�ZdS))�	coroutine�iscoroutinefunction�iscoroutine�N�)�base_futures)�	constants)�format_helpers)�loggercCs"tjjp tjjo ttj�d��S)NZPYTHONASYNCIODEBUG)�sys�flags�dev_mode�ignore_environment�bool�os�environ�get�rr�*/usr/lib64/python3.8/asyncio/coroutines.py�_is_debug_modes�rc@s�eZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zddd
�Zdd�Z	e
dd��Ze
dd��Ze
dd��Z
dd�Ze
dd��Zdd�ZdS)�CoroWrapperNcCs>||_||_t�t�d��|_t|dd�|_t|dd�|_	dS)Nr�__name__�__qualname__)
�gen�funcr�
extract_stackr
�	_getframe�_source_traceback�getattrrr)�selfrrrrr�__init__'s
zCoroWrapper.__init__cCsJt|�}|jr4|jd}|d|d�d|d��7}d|jj�d|�d�S)	N���z
, created at r�:r�<� �>)�_format_coroutiner�	__class__r)r�	coro_repr�framerrr�__repr__/s

zCoroWrapper.__repr__cCs|S�Nr�rrrr�__iter__7szCoroWrapper.__iter__cCs|j�d�Sr*�r�sendr+rrr�__next__:szCoroWrapper.__next__cCs|j�|�Sr*r-)r�valuerrrr.=szCoroWrapper.sendcCs|j�|||�Sr*)r�throw)r�typer0�	tracebackrrrr1@szCoroWrapper.throwcCs
|j��Sr*)r�closer+rrrr4CszCoroWrapper.closecCs|jjSr*)r�gi_framer+rrrr5FszCoroWrapper.gi_framecCs|jjSr*)r�
gi_runningr+rrrr6JszCoroWrapper.gi_runningcCs|jjSr*)r�gi_coder+rrrr7NszCoroWrapper.gi_codecCs|Sr*rr+rrr�	__await__RszCoroWrapper.__await__cCs|jjSr*)r�gi_yieldfromr+rrrr9UszCoroWrapper.gi_yieldfromcCs�t|dd�}t|dd�}|dk	r||jdkr||�d�}t|dd�}|rrd�t�|��}|dtj�d	�7}||��7}t�	|�dS)
Nrr5r z was never yielded fromrr�zB
Coroutine object created at (most recent call last, truncated to z last lines):
)
r�f_lasti�joinr3�format_listrZDEBUG_STACK_DEPTH�rstripr	�error)rrr(�msg�tbrrr�__del__Ys
zCoroWrapper.__del__)N)NN)r�
__module__rrr)r,r/r.r1r4�propertyr5r6r7r8r9rBrrrrr$s"





rcsztjdtdd�t���r�St���r.��nt����fdd���t�	���t
sX�}nt�����fdd��}t|_|S)z�Decorator to mark coroutines.

    If the coroutine is not yielded from before it is destroyed,
    an error message is logged.
    zN"@coroutine" decorator is deprecated since Python 3.8, use "async def" instead�)�
stacklevelc?sr�||�}t�|�s(t�|�s(t|t�r4|EdH}n:z
|j}Wntk
rRYnXt|tj	j
�rn|�EdH}|Sr*)rZisfuture�inspectZisgenerator�
isinstancerr8�AttributeError�collections�abc�	Awaitable)�args�kw�resZ
await_meth�rrr�corozs
�
zcoroutine.<locals>.corocs@t�||��d�}|jr |jd=t�dd�|_t�dd�|_|S)NrPr rr)rrrrr)rM�kwds�w�rQrrr�wrapper�szcoroutine.<locals>.wrapper)�warnings�warn�DeprecationWarningrGr�isgeneratorfunction�	functools�wraps�typesr�_DEBUG�
_is_coroutine)rrUrrTrris"�


rcCst�|�pt|dd�tkS)z6Return True if func is a decorated coroutine function.r^N)rGrrr^rPrrrr�s
�rcCs@t|�tkrdSt|t�r8tt�dkr4t�t|��dSdSdS)z)Return True if obj is a coroutine object.T�dFN)r2�_iscoroutine_typecacherH�_COROUTINE_TYPES�len�add)�objrrrr�s
rc
sht|t���fdd�}dd�}d}t|d�r:|jr:|j}nt|d�rP|jrP|j}||�}|sr||�rn|�d�S|Sd}t|d�r�|jr�|j}nt|d	�r�|jr�|j}|jp�d
}d}��r$|jdk	�r$t	�
|j��s$t�|j�}|dk	r�|\}}|dk�r|�d|�d
|��}	n|�d|�d
|��}	n@|dk	�rJ|j
}|�d|�d
|��}	n|j}|�d|�d
|��}	|	S)Ncs`�rt�|jdi�St|d�r,|jr,|j}n*t|d�rD|jrD|j}ndt|�j�d�}|�d�S)Nrrrr"z without __name__>z())rZ_format_callbackr�hasattrrrr2)rQ�	coro_name�Zis_corowrapperrr�get_name�sz#_format_coroutine.<locals>.get_namecSsHz|jWStk
rBz|jWYStk
r<YYdSXYnXdS)NF)�
cr_runningrIr6)rQrrr�
is_running�sz%_format_coroutine.<locals>.is_running�cr_coder7z runningr5�cr_framez<empty co_filename>rz done, defined at r!z running, defined at z running at )rHrrerkr7r5rl�co_filenamerrGrYrZ_get_function_source�f_lineno�co_firstlineno)
rQrhrjZ	coro_coderfZ
coro_frame�filename�lineno�sourcer'rrgrr%�sJ
	

�
�

r%) �__all__Zcollections.abcrJrZrGrr
r3r\rVr:rrr�logr	rr]rr�objectr^r�
CoroutineType�
GeneratorTyperK�	Coroutinera�setr`rr%rrrr�<module>s2E8�asyncio/__pycache__/tasks.cpython-38.pyc000064400000057333151153537520014220 0ustar00U

e5d���@svdZdZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZddlm
Z
ddlmZddlmZdd	lmZdd
l
mZe�d�jZdBdd�ZdCd
d�ZdDdd�Zdd�ZGdd�dej�ZeZzddlZWnek
r�YnXejZZdd�dd�Zejj Z ejj!Z!ejj"Z"dde"d�dd�Z#dd�Z$dd�dd�Z%d d!�Z&d"d#�Z'ddd$�d%d&�Z(ej)d'd(��Z*dEdd�d)d*�Z+dd�d+d,�Z,ej)d-d.��Z-ee-_Gd/d0�d0ej.�Z/dd1d2�d3d4�Z0dd�d5d6�Z1d7d8�Z2e
�3�Z4iZ5d9d:�Z6d;d<�Z7d=d>�Z8d?d@�Z9e6Z:e9Z;e7Z<e8Z=z$ddAlm6Z6m9Z9m7Z7m8Z8m4Z4m5Z5Wnek
�r`YnXe6Z>e9Z?e7Z@e8ZAdS)Fz0Support for tasks, coroutines and the scheduler.)�Task�create_task�FIRST_COMPLETED�FIRST_EXCEPTION�
ALL_COMPLETED�wait�wait_for�as_completed�sleep�gather�shield�
ensure_future�run_coroutine_threadsafe�current_task�	all_tasks�_register_task�_unregister_task�_enter_task�_leave_task�N�)�
base_tasks)�
coroutines)�events)�
exceptions)�futures)�
_is_coroutinecCs|dkrt��}t�|�S)z!Return a currently executed task.N)r�get_running_loop�_current_tasks�get��loop�r!�%/usr/lib64/python3.8/asyncio/tasks.pyr"srcs^�dkrt���d}ztt�}WqLtk
rF|d7}|dkrB�YqXqLq�fdd�|D�S)z'Return a set of all tasks for the loop.Nrr��cs&h|]}t�|��kr|��s|�qSr!)r�	_get_loop�done��.0�trr!r"�	<setcomp><s�zall_tasks.<locals>.<setcomp>)rr�list�
_all_tasks�RuntimeError�r �iZtasksr!rr"r)srcs^�dkrt���d}ztt�}WqLtk
rF|d7}|dkrB�YqXqLq�fdd�|D�S)Nrrr#csh|]}t�|��kr|�qSr!)rr$r&rr!r"r)Usz$_all_tasks_compat.<locals>.<setcomp>)r�get_event_loopr*r+r,r-r!rr"�_all_tasks_compat@sr0cCs4|dk	r0z
|j}Wntk
r&Yn
X||�dS�N)�set_name�AttributeError)�task�namer2r!r!r"�_set_task_nameXs
r6cs�eZdZdZdZed%dd��Zed&dd��Zddd��fd	d
�
Z�fdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�dd�Zddd�dd�Zdd �Zd'�fd!d"�	Zd#d$�Z�ZS)(rz A coroutine wrapped in a Future.TNcCs(tjdtdd�|dkr t��}t|�S)z�Return the currently running task in an event loop or None.

        By default the current task for the current event loop is returned.

        None is returned when called not in the context of a Task.
        zVTask.current_task() is deprecated since Python 3.7, use asyncio.current_task() instead���
stacklevelN)�warnings�warn�DeprecationWarningrr/r��clsr r!r!r"rts�zTask.current_taskcCstjdtdd�t|�S)z|Return a set of all tasks for an event loop.

        By default all tasks for the current event loop are returned.
        zPTask.all_tasks() is deprecated since Python 3.7, use asyncio.all_tasks() insteadr7r8)r:r;r<r0r=r!r!r"r�s
�zTask.all_tasks)r r5cs�t�j|d�|jr|jd=t�|�s:d|_td|����|dkrRdt���|_n
t	|�|_d|_
d|_||_t
��|_|jj|j|jd�t|�dS)Nr���Fza coroutine was expected, got zTask-��context)�super�__init__�_source_tracebackr�iscoroutine�_log_destroy_pending�	TypeError�_task_name_counter�_name�str�_must_cancel�_fut_waiter�_coro�contextvarsZcopy_context�_context�_loop�	call_soon�_Task__stepr)�self�coror r5��	__class__r!r"rC�s


z
Task.__init__csF|jtjkr8|jr8|dd�}|jr,|j|d<|j�|�t���dS)Nz%Task was destroyed but it is pending!)r4�messageZsource_traceback)	Z_staterZ_PENDINGrFrDrPZcall_exception_handlerrB�__del__)rSrArUr!r"rX�s�
zTask.__del__cCs
t�|�Sr1)rZ_task_repr_info�rSr!r!r"�
_repr_info�szTask._repr_infocCs|jSr1)rMrYr!r!r"�get_coro�sz
Task.get_corocCs|jSr1)rIrYr!r!r"�get_name�sz
Task.get_namecCst|�|_dSr1)rJrI)rS�valuer!r!r"r2�sz
Task.set_namecCstd��dS)Nz*Task does not support set_result operation�r,)rS�resultr!r!r"�
set_result�szTask.set_resultcCstd��dS)Nz-Task does not support set_exception operationr^)rS�	exceptionr!r!r"�
set_exception�szTask.set_exception)�limitcCst�||�S)a�Return the list of stack frames for this task's coroutine.

        If the coroutine is not done, this returns the stack where it is
        suspended.  If the coroutine has completed successfully or was
        cancelled, this returns an empty list.  If the coroutine was
        terminated by an exception, this returns the list of traceback
        frames.

        The frames are always ordered from oldest to newest.

        The optional limit gives the maximum number of frames to
        return; by default all available frames are returned.  Its
        meaning differs depending on whether a stack or a traceback is
        returned: the newest frames of a stack are returned, but the
        oldest frames of a traceback are returned.  (This matches the
        behavior of the traceback module.)

        For reasons beyond our control, only one stack frame is
        returned for a suspended coroutine.
        )rZ_task_get_stack)rSrcr!r!r"�	get_stack�szTask.get_stack)rc�filecCst�|||�S)anPrint the stack or traceback for this task's coroutine.

        This produces output similar to that of the traceback module,
        for the frames retrieved by get_stack().  The limit argument
        is passed to get_stack().  The file argument is an I/O stream
        to which the output is written; by default output is written
        to sys.stderr.
        )rZ_task_print_stack)rSrcrer!r!r"�print_stack�s	zTask.print_stackcCs4d|_|��rdS|jdk	r*|j��r*dSd|_dS)a�Request that this task cancel itself.

        This arranges for a CancelledError to be thrown into the
        wrapped coroutine on the next cycle through the event loop.
        The coroutine then has a chance to clean up or even deny
        the request using try/except/finally.

        Unlike Future.cancel, this does not guarantee that the
        task will be cancelled: the exception might be caught and
        acted upon, delaying cancellation of the task or preventing
        cancellation completely.  The task may also return a value or
        raise a different exception.

        Immediately after this method is called, Task.cancelled() will
        not return True (unless the task was already cancelled).  A
        task will be marked as cancelled when the wrapped coroutine
        terminates with a CancelledError exception (even if cancel()
        was not called).
        FNT)Z_log_tracebackr%rL�cancelrKrYr!r!r"rg�s

zTask.cancelc
s�|��rt�d|�d|����|jr>t|tj�s8t��}d|_|j}d|_t|j	|��zfz"|dkrp|�d�}n
|�|�}Wn�t
k
r�}z*|jr�d|_t���nt��|j�W5d}~XY�n�tjk
r�t���Y�n�ttfk
�r}zt��|��W5d}~XY�n�tk
�rL}zt��|�W5d}~XY�npXt|dd�}|dk	�r@t�|�|j	k	�r�td|�d|�d��}|j	j|j||jd�n�|�r||k�r�td	|���}|j	j|j||jd�n8d|_|j|j|jd�||_|j�r>|j���r>d|_n*td
|�d|���}|j	j|j||jd�n||dk�r`|j	j|j|jd�n\t �!|��r�td|�d|���}|j	j|j||jd�n$td
|���}|j	j|j||jd�W5t
|j	|�d}XdS)Nz_step(): already done: z, F�_asyncio_future_blockingzTask z got Future z attached to a different loopr@zTask cannot await on itself: z-yield was used instead of yield from in task z with z;yield was used instead of yield from for generator in task zTask got bad yield: )"r%rZInvalidStateErrorrK�
isinstance�CancelledErrorrMrLrrPr�send�throw�
StopIterationrBrgr`r]�KeyboardInterrupt�
SystemExitrb�
BaseException�getattrrr$r,rQrRrOrh�add_done_callback�
_Task__wakeup�inspectZisgenerator)rS�excrTr_Zblocking�new_excrUr!r"Z__steps��  
��
�����
���
zTask.__stepc
CsJz|��Wn,tk
r8}z|�|�W5d}~XYn
X|��d}dSr1)r_rprR)rS�futurerur!r!r"Z__wakeup[sz
Task.__wakeup)N)N)N)�__name__�
__module__�__qualname__�__doc__rF�classmethodrrrCrXrZr[r\r2r`rbrdrfrgrRrs�
__classcell__r!r!rUr"rbs&
!Tr)r5cCs t��}|�|�}t||�|S)z]Schedule the execution of a coroutine object in a spawn task.

    Return a Task object.
    )rrrr6)rTr5r r4r!r!r"rxs

r)r �timeout�return_whenc�s�t�|�st�|�r(tdt|�j����|s4td��|tt	t
fkrPtd|�����dkrbt���nt
jdtdd��fdd	�t|�D�}t|||��IdHS)
a�Wait for the Futures and coroutines given by fs to complete.

    The fs iterable must not be empty.

    Coroutines will be wrapped in Tasks.

    Returns two sets of Future: (done, pending).

    Usage:

        done, pending = await asyncio.wait(fs)

    Note: This does not raise TimeoutError! Futures that aren't done
    when the timeout occurs are returned in the second set.
    zexpect a list of futures, not z#Set of coroutines/Futures is empty.zInvalid return_when value: N�[The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.r7r8csh|]}t|�d��qS�r�r�r'�frr!r"r)�szwait.<locals>.<setcomp>)r�isfuturerrErG�typerx�
ValueErrorrrrrrr:r;r<�set�_wait)�fsr r~rr!rr"r�s
�rcGs|��s|�d�dSr1)r%r`)�waiter�argsr!r!r"�_release_waiter�sr�rc
�s�|dkrt��}ntjdtdd�|dkr4|IdHS|dkr�t||d�}|��rX|��St||d�IdHz|��Wn.t	j
k
r�}zt	��|�W5d}~XYn
Xt	���|��}|�
|t|�}t�t|�}t||d�}|�|�z�z|IdHWnPt	j
k
�rF|���r$|��YW�dS|�|�t||d�IdH�YnX|���r^|��W�*S|�|�t||d�IdHt	���W5|��XdS)a�Wait for the single Future or coroutine to complete, with timeout.

    Coroutine will be wrapped in Task.

    Returns result of the Future or coroutine.  When a timeout occurs,
    it cancels the task and raises TimeoutError.  To avoid the task
    cancellation, wrap it in shield().

    If the wait is cancelled, the task is also cancelled.

    This function is a coroutine.
    Nr�r7r8rr)rrr:r;r<rr%r_�_cancel_and_waitrrj�TimeoutError�
create_future�
call_laterr��	functools�partialrrrg�remove_done_callback)�futr~r rur��timeout_handle�cbr!r!r"r�sL

�





rc
�s�|std��|���d�|dk	r.|�|t���t|������fdd�}|D]}|�|�qLz�IdHW5�dk	r|���|D]}|�|�q�Xt�t�}}|D]"}|�	�r�|�
|�q�|�
|�q�||fS)zVInternal helper for wait().

    The fs argument must be a collection of Futures.
    zSet of Futures is empty.NcsZ�d8��dks4�tks4�tkrV|��sV|��dk	rV�dk	rD������sV��d�dS)Nrr)rr�	cancelledrargr%r`�r��Zcounterrr�r�r!r"�_on_completions���
�z_wait.<locals>._on_completion)�AssertionErrorr�r�r��lenrrrgr�r�r%�add)r�r~rr r�r�r%Zpendingr!r�r"r��s*r�c	�sF|��}t�t|�}|�|�z|��|IdHW5|�|�XdS)z<Cancel the *fut* future or task and wait until it completes.N)r�r�r�r�rrr�rg)r�r r�r�r!r!r"r�&s
r�)r r~c#s�t�|�st�|�r(tdt|�j����ddlm}|�d���dkrPt	�
��ntjdt
dd��fd	d
�t|�D��d����fdd�}���fd
d���fdd�}�D]}|���q��r�|dk	r҈�||��tt���D]}|�Vq�dS)a^Return an iterator whose values are coroutines.

    When waiting for the yielded coroutines you'll get the results (or
    exceptions!) of the original Futures (or coroutines), in the order
    in which and as soon as they complete.

    This differs from PEP 3148; the proper way to use this is:

        for f in as_completed(fs):
            result = await f  # The 'await' may raise.
            # Use result.

    If a timeout is specified, the 'await' will raise
    TimeoutError when the timeout occurs before all Futures are done.

    Note: The futures 'f' are not necessarily members of fs.
    z#expect an iterable of futures, not r)�QueuerNr�r7r8csh|]}t|�d��qSr�r�r�rr!r"r)Uszas_completed.<locals>.<setcomp>cs*�D]}|�����d�q���dSr1)r��
put_nowait�clearr�)r�r%�todor!r"�_on_timeoutXs
z!as_completed.<locals>._on_timeoutcs4�sdS��|���|��s0�dk	r0���dSr1)�remover�rgr�)r%r�r�r!r"r�^s

z$as_completed.<locals>._on_completionc�s$���IdH}|dkrtj�|��Sr1)rrr�r_r�)r%r!r"�
_wait_for_onefsz#as_completed.<locals>._wait_for_one)rr�rrErGr�rxZqueuesr�rr/r:r;r<r�rrr��ranger�)r�r r~r�r�r�r��_r!)r�r%r r�r�r"r7s*

�rccs
dVdS)z�Skip one event loop run cycle.

    This is a private helper for 'asyncio.sleep()', used
    when the 'delay' is set to 0.  It uses a bare 'yield'
    expression (which Task.__step knows how to handle)
    instead of creating a Future object.
    Nr!r!r!r!r"�__sleep0us	r�c�sr|dkrt�IdH|S|dkr*t��}ntjdtdd�|��}|�|tj	||�}z|IdHW�S|�
�XdS)z9Coroutine that completes after a given time (in seconds).rNr�r7r8)r�rrr:r;r<r�r�rZ_set_result_unless_cancelledrg)Zdelayr_r rw�hr!r!r"r	�s$
��r	cCs�t�|�r6|dkrt��}|�|�}|jr2|jd=|St�|�rb|dk	r^|t�|�k	r^t	d��|St
�|�r|tt
|�|d�Std��dS)zmWrap a coroutine or an awaitable in a future.

    If the argument is a Future, it is returned directly.
    Nr?zRThe future belongs to a different loop than the one specified as the loop argumentrz:An asyncio.Future, a coroutine or an awaitable is required)rrErr/rrDrr�r$r�rtZisawaitabler�_wrap_awaitablerG)Zcoro_or_futurer r4r!r!r"r�s



rccs|��EdHS)z�Helper for asyncio.ensure_future().

    Wraps awaitable (an object with __await__) into a coroutine
    that will later be wrapped in a Task by ensure_future().
    N)�	__await__)Z	awaitabler!r!r"r��sr�cs.eZdZdZdd��fdd�
Zdd�Z�ZS)�_GatheringFuturez�Helper for gather().

    This overrides cancel() to cancel all the children and act more
    like Task.cancel(), which doesn't immediately mark itself as
    cancelled.
    Nrcst�j|d�||_d|_dS)NrF)rBrC�	_children�_cancel_requested)rS�childrenr rUr!r"rC�sz_GatheringFuture.__init__cCs6|��rdSd}|jD]}|��rd}q|r2d|_|S)NFT)r%r�rgr�)rSZretZchildr!r!r"rg�s
z_GatheringFuture.cancel)rxryrzr{rCrgr}r!r!rUr"r��sr�F)r �return_exceptionscs�|s<|dkrt��}ntjdtdd�|�����g��S�����fdd�}i}g�d�d�|D]f}||kr�t||d�}|dkr�t�	|�}||k	r�d	|_
�d
7�|||<|�|�n||}��|�qdt
�|d���S)a�Return a future aggregating results from the given coroutines/futures.

    Coroutines will be wrapped in a future and scheduled in the event
    loop. They will not necessarily be scheduled in the same order as
    passed in.

    All futures must share the same event loop.  If all the tasks are
    done successfully, the returned future's result is the list of
    results (in the order of the original sequence, not necessarily
    the order of results arrival).  If *return_exceptions* is True,
    exceptions in the tasks are treated the same as successful
    results, and gathered in the result list; otherwise, the first
    raised exception will be immediately propagated to the returned
    future.

    Cancellation: if the outer Future is cancelled, all children (that
    have not completed yet) are also cancelled.  If any child is
    cancelled, this is treated as if it raised CancelledError --
    the outer Future is *not* cancelled in this case.  (This is to
    prevent the cancellation of one child to cause other children to
    be cancelled.)

    If *return_exceptions* is False, cancelling gather() after it
    has been marked done won't cancel any submitted awaitables.
    For instance, gather can be marked done after propagating an
    exception to the caller, therefore, calling ``gather.cancel()``
    after catching an exception (raised by one of the awaitables) from
    gather won't cancel any other awaitables.
    Nr�r7r8cs��d7����r$|��s |��dS�sd|��rFt��}��|�dS|��}|dk	rd��|�dS��kr�g}�D]8}|��r�t��}n|��}|dkr�|��}|�|�qt�jrĈ�t���n
��	|�dS)Nr)
r%r�rarrjrbr_�appendr�r`)r�ruZresults�res�r�Z	nfinishedZnfuts�outerr�r!r"�_done_callbacks4


zgather.<locals>._done_callbackrrFr)rr/r:r;r<r�r`rrr$rFrrr�r�)r r�Zcoros_or_futuresr�Z
arg_to_fut�argr�r!r�r"r
�s:
�
1
r
cst|dk	rtjdtdd�t||d�����r0�St���}|����fdd����fdd	�}������|��S)
a.Wait for a future, shielding it from cancellation.

    The statement

        res = await shield(something())

    is exactly equivalent to the statement

        res = await something()

    *except* that if the coroutine containing it is cancelled, the
    task running in something() is not cancelled.  From the POV of
    something(), the cancellation did not happen.  But its caller is
    still cancelled, so the yield-from expression still raises
    CancelledError.  Note: If something() is cancelled by other means
    this will still cancel shield().

    If you want to completely ignore cancellation (not recommended)
    you can combine shield() with a try/except clause, as follows:

        try:
            res = await shield(something())
        except CancelledError:
            res = None
    Nr�r7r8rcs\���r|��s|��dS|��r.���n*|��}|dk	rJ��|�n��|���dSr1)r�rargrbr`r_)�innerru�r�r!r"�_inner_done_callbackus
z$shield.<locals>._inner_done_callbackcs���s����dSr1)r%r�r�)r�r�r!r"�_outer_done_callback�sz$shield.<locals>._outer_done_callback)	r:r;r<rr%rr$r�rr)r�r r�r!)r�r�r�r"rPs�


rcs:t���std��tj������fdd�}��|��S)zsSubmit a coroutine object to a given event loop.

    Return a concurrent.futures.Future to access the result.
    zA coroutine object is requiredc
slzt�t��d���WnNttfk
r2�Yn6tk
rf}z���rT��|��W5d}~XYnXdS)Nr)rZ
_chain_futurerrornrpZset_running_or_notify_cancelrb)ru�rTrwr r!r"�callback�s
z*run_coroutine_threadsafe.<locals>.callback)rrErG�
concurrentr�FutureZcall_soon_threadsafe)rTr r�r!r�r"r
�s



r
cCst�|�dS)z3Register a new task in asyncio as executed by loop.N)r+r��r4r!r!r"r�srcCs4t�|�}|dk	r(td|�d|�d���|t|<dS)NzCannot enter into task z while another task z is being executed.�rrr,�r r4rr!r!r"r�s
rcCs2t�|�}||k	r(td|�d|�d���t|=dS)Nz
Leaving task z! does not match the current task �.r�r�r!r!r"r�s
rcCst�|�dS)zUnregister a task.N)r+�discardr�r!r!r"r�sr)rrrrr+r)N)N)N)N)Br{�__all__Zconcurrent.futuresr�rNr�rt�	itertools�typesr:�weakref�rrrrrr�count�__next__rHrrr0r6Z	_PyFuturerZ_PyTaskZ_asyncio�ImportErrorZ_CTaskrrrrrr�rr�r�r�	coroutiner�r	rr�r�r�r
rr
ZWeakSetr+rrrrrZ_py_register_taskZ_py_unregister_taskZ_py_enter_taskZ_py_leave_taskZ_c_register_taskZ_c_unregister_taskZ
_c_enter_taskZ
_c_leave_taskr!r!r!r"�<module>s�	





#H,>

x?$asyncio/__pycache__/windows_utils.cpython-38.opt-1.pyc000064400000010445151153537520016735 0ustar00U

e5d��@s�dZddlZejdkred��ddlZddlZddlZddlZddlZddl	Z	ddl
Z
dZdZej
Z
ejZe��Zdded	�d
d�ZGdd
�d
�ZGdd�dej�ZdS)z)Various Windows specific bits and pieces.�NZwin32z
win32 only)�pipe�Popen�PIPE�
PipeHandlei F)TT)�duplex�
overlapped�bufsizec
Cs$tjd�t��tt��d�}|r>tj}tj	tj
B}||}}ntj}tj
}d|}}|tjO}|drp|tj
O}|dr�tj
}nd}d}	}
z\t�||tjd||tjtj�}	t�||dtjtj|tj�}
tj|	dd�}|�d�|	|
fWS|	dk	�rt�|	�|
dk	�rt�|
��YnXdS)zELike os.pipe() but with overlapped support and using handles not fds.z\\.\pipe\python-pipe-{:d}-{:d}-)�prefixr�NT�r)�tempfileZmktemp�format�os�getpid�next�
_mmap_counter�_winapiZPIPE_ACCESS_DUPLEXZGENERIC_READZ
GENERIC_WRITEZPIPE_ACCESS_INBOUNDZFILE_FLAG_FIRST_PIPE_INSTANCEZFILE_FLAG_OVERLAPPEDZCreateNamedPipeZ	PIPE_WAITZNMPWAIT_WAIT_FOREVERZNULLZ
CreateFileZ
OPEN_EXISTINGZConnectNamedPipeZGetOverlappedResult�CloseHandle)rrrZaddressZopenmode�accessZobsizeZibsizeZflags_and_attribsZh1Zh2Zov�r�-/usr/lib64/python3.8/asyncio/windows_utils.pyr sb��


��





rc@sbeZdZdZdd�Zdd�Zedd��Zdd	�Ze	j
d
�dd�Zej
fd
d�Zdd�Zdd�ZdS)rz�Wrapper for an overlapped pipe handle which is vaguely file-object like.

    The IOCP event loop can use these instead of socket objects.
    cCs
||_dS�N��_handle��self�handlerrr�__init__VszPipeHandle.__init__cCs2|jdk	rd|j��}nd}d|jj�d|�d�S)Nzhandle=�closed�<� �>)r�	__class__�__name__rrrr�__repr__Ys
zPipeHandle.__repr__cCs|jSrr�rrrrr`szPipeHandle.handlecCs|jdkrtd��|jS)NzI/O operation on closed pipe)r�
ValueErrorr%rrr�filenods
zPipeHandle.fileno)rcCs|jdk	r||j�d|_dSrr)rrrrr�closeis

zPipeHandle.closecCs*|jdk	r&|d|��t|d�|��dS)Nz	unclosed )�source)r�ResourceWarningr()rZ_warnrrr�__del__ns
zPipeHandle.__del__cCs|Srrr%rrr�	__enter__sszPipeHandle.__enter__cCs|��dSr)r()r�t�v�tbrrr�__exit__vszPipeHandle.__exit__N)r#�
__module__�__qualname__�__doc__rr$�propertyrr'rrr(�warnings�warnr+r,r0rrrrrQs
rcs"eZdZdZd�fdd�	Z�ZS)rz�Replacement for subprocess.Popen using overlapped pipe handles.

    The stdin, stdout, stderr are None or instances of PipeHandle.
    Nc	sxd}}}d}	}
}|tkr@tddd�\}}	t�|tj�}n|}|tkrhtdd�\}
}
t�|
d�}n|}|tkr�tdd�\}}t�|d�}n|tkr�|}n|}z�z t�j	|f|||d�|��Wn0|	|
|fD]}|dk	r�t
�|�qւYn>X|	dk	�r
t|	�|_
|
dk	�rt|
�|_|dk	�r2t|�|_W5|tk�rJt�|�|tk�r^t�|�|tk�rrt�|�XdS)N)FTT)rr)TFrr)�stdin�stdout�stderr)rr�msvcrtZopen_osfhandler�O_RDONLY�STDOUTr(�superrrrrr7r8r9)r�argsr7r8r9�kwdsZ	stdin_rfdZ
stdout_wfdZ
stderr_wfdZstdin_whZ	stdout_rhZ	stderr_rhZstdin_rhZ	stdout_whZ	stderr_wh�h�r"rrr�sN��










zPopen.__init__)NNN)r#r1r2r3r�
__classcell__rrrArr}sr)r3�sys�platform�ImportErrorr�	itertoolsr:r�
subprocessrr5�__all__ZBUFSIZErr<�countrrrrrrrr�<module>s$
1,asyncio/__pycache__/__main__.cpython-38.opt-2.pyc000064400000006102151153537520015537 0ustar00U

e5d
�@sJddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZGdd�dej�Z
Gdd�dej�Zedk�rFe��Ze�e�d	eiZd
D]Ze�eee<q�e
ee�ZdadazddlZWnek
r�YnXe�Zde_e��ze��Wn6e k
�r>t�r6t�!��s6t�"�daYq�Yq�X�qFq�dS)
�N�)�futurescs$eZdZ�fdd�Zdd�Z�ZS)�AsyncIOInteractiveConsolecs*t��|�|jjjtjO_||_dS)N)�super�__init__�compileZcompiler�flags�astZPyCF_ALLOW_TOP_LEVEL_AWAIT�loop)�self�localsr
��	__class__��(/usr/lib64/python3.8/asyncio/__main__.pyrsz"AsyncIOInteractiveConsole.__init__csttj������fdd�}t�|�z
���WStk
rD�Yn,tk
rntrb��	d�n��
�YnXdS)Nc
sdadat���j�}z
|�}Wnztk
r6�Ynftk
rj}zda��|�WY�dSd}~XYn2tk
r�}z��|�WY�dSd}~XYnXt	�
|�s���|�dSz�j�
|�at�t��Wn.tk
�r�}z��|�W5d}~XYnXdS)NFT)�repl_future�repl_future_interrupted�types�FunctionTyper�
SystemExit�KeyboardInterruptZ
set_exception�
BaseException�inspectZiscoroutineZ
set_resultr
Zcreate_taskrZ
_chain_future)�func�coroZex�exc��codeZfuturerrr�callbacks,




z3AsyncIOInteractiveConsole.runcode.<locals>.callbackz
KeyboardInterrupt
)�
concurrentrZFuturer
�call_soon_threadsafe�resultrrr�writeZ
showtraceback)rrrrrr�runcodes


z!AsyncIOInteractiveConsole.runcode)�__name__�
__module__�__qualname__rr#�
__classcell__rrr
rrsrc@seZdZdd�ZdS)�
REPLThreadcCsZz6dtj�dtj�dt	tdd��d	�}t
j|d
d�W5tjddtd�t�tj�XdS)N�ignorez ^coroutine .* was never awaited$)�message�categoryz
asyncio REPL z on zy
Use "await" directly instead of "asyncio.run()".
Type "help", "copyright", "credits" or "license" for more information.
Zps1z>>> zimport asynciozexiting asyncio REPL...)�bannerZexitmsg)�warnings�filterwarnings�RuntimeWarningr
r �stop�sys�version�platform�getattr�consoleZinteract)rr,rrr�runFs"��
�zREPLThread.runN)r$r%r&r6rrrrr(Dsr(�__main__�asyncio>�__builtins__�__spec__r$�__file__�
__loader__�__package__FT)#r	r8rZconcurrent.futuresrrr1Z	threadingrr-�rZInteractiveConsolerZThreadr(r$Znew_event_loopr
Zset_event_loopZrepl_locals�keyrr5rr�readline�ImportErrorZrepl_threadZdaemon�startZrun_foreverrZdoneZcancelrrrr�<module>sF6



asyncio/__pycache__/format_helpers.cpython-38.opt-2.pyc000064400000004052151153537520017033 0ustar00U

e5dd	�@sdddlZddlZddlZddlZddlZddlmZdd�Zdd�Zdd	�Z	ddd�Z
dd
d�ZdS)�N�)�	constantscCsVt�|�}t�|�r&|j}|j|jfSt|tj�r<t	|j
�St|tj�rRt	|j
�SdS�N)�inspectZunwrapZ
isfunction�__code__�co_filename�co_firstlineno�
isinstance�	functools�partial�_get_function_source�func�
partialmethod)r
�code�r�./usr/lib64/python3.8/asyncio/format_helpers.pyr
s



rcCs8t||d�}t|�}|r4|d|d�d|d��7}|S)Nz at r�:r)�_format_callbackr)r
�args�	func_repr�sourcerrr�_format_callback_sources
rcCsHg}|r|�dd�|D��|r8|�dd�|��D��d�d�|��S)Ncss|]}t�|�VqdSr��reprlib�repr)�.0�argrrr�	<genexpr>&sz*_format_args_and_kwargs.<locals>.<genexpr>css&|]\}}|�dt�|���VqdS)�=Nr)r�k�vrrrr(sz({})z, )�extend�items�format�join)r�kwargsr"rrr�_format_args_and_kwargssr&�cCs�t|tj�r.t||�|}t|j|j|j|�St|d�rF|j	rF|j	}n t|d�r^|j
r^|j
}nt|�}|t||�7}|r�||7}|S)N�__qualname__�__name__)r	r
rr&rr
r�keywords�hasattrr(r)r)r
rr%�suffixrrrrr,srcCsD|dkrt��j}|dkr tj}tjjt�|�|dd�}|�	�|S)NF)�limit�lookup_lines)
�sys�	_getframe�f_backrZDEBUG_STACK_DEPTH�	traceback�StackSummary�extract�
walk_stack�reverse)�fr-�stackrrr�
extract_stack>s
�r9)r')NN)r
rrr/r2r'rrrr&rr9rrrr�<module>s
asyncio/__pycache__/log.cpython-38.opt-2.pyc000064400000000275151153537520014605 0ustar00U

e5d|�@sddlZe�e�ZdS)�N)ZloggingZ	getLogger�__package__Zlogger�rr�#/usr/lib64/python3.8/asyncio/log.py�<module>sasyncio/__pycache__/subprocess.cpython-38.opt-1.pyc000064400000016242151153537520016214 0ustar00U

e5d��@s�dZddlZddlZddlmZddlmZddlmZddlmZddlm	Z	ej
Z
ejZejZGd	d
�d
ej
ej�ZGdd�d�Zddddejfd
d�Zddddejd�dd�ZdS))�create_subprocess_exec�create_subprocess_shell�N�)�events)�	protocols)�streams)�tasks)�loggercsXeZdZdZ�fdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Z�ZS)�SubprocessStreamProtocolz0Like StreamReaderProtocol, but for a subprocess.csHt�j|d�||_d|_|_|_d|_d|_g|_|j	�
�|_dS)N��loopF)�super�__init__�_limit�stdin�stdout�stderr�
_transport�_process_exited�	_pipe_fds�_loopZ
create_future�
_stdin_closed)�self�limitr��	__class__��*/usr/lib64/python3.8/asyncio/subprocess.pyrsz!SubprocessStreamProtocol.__init__cCsn|jjg}|jdk	r&|�d|j���|jdk	rB|�d|j���|jdk	r^|�d|j���d�d�|��S)Nzstdin=zstdout=zstderr=z<{}>� )r�__name__r�appendrr�format�join)r�inforrr�__repr__s



z!SubprocessStreamProtocol.__repr__cCs�||_|�d�}|dk	rDtj|j|jd�|_|j�|�|j�	d�|�d�}|dk	r�tj|j|jd�|_
|j
�|�|j�	d�|�d�}|dk	r�tj||d|jd�|_dS)Nr�rr�r)�protocol�readerr)
r�get_pipe_transportr�StreamReaderrrrZ
set_transportrr r�StreamWriterr)r�	transportZstdout_transportZstderr_transportZstdin_transportrrr�connection_made)s,
�
�
�z(SubprocessStreamProtocol.connection_madecCs:|dkr|j}n|dkr |j}nd}|dk	r6|�|�dS)Nrr&)rrZ	feed_data)r�fd�datar(rrr�pipe_data_receivedAsz+SubprocessStreamProtocol.pipe_data_receivedcCs�|dkrN|j}|dk	r|��|�|�|dkr>|j�d�n|j�|�dS|dkr^|j}n|dkrn|j}nd}|dk	r�|dkr�|��n
|�|�||j	kr�|j	�
|�|��dS)Nrrr&)r�closeZconnection_lostrZ
set_resultZ
set_exceptionrrZfeed_eofr�remove�_maybe_close_transport)rr.�exc�piper(rrr�pipe_connection_lostKs*



z-SubprocessStreamProtocol.pipe_connection_lostcCsd|_|��dS)NT)rr3�rrrr�process_exitedfsz'SubprocessStreamProtocol.process_exitedcCs(t|j�dkr$|jr$|j��d|_dS)Nr)�lenrrrr1r7rrrr3js
z/SubprocessStreamProtocol._maybe_close_transportcCs||jkr|jSdS�N)rr)r�streamrrr�_get_close_waiteros
z*SubprocessStreamProtocol._get_close_waiter)
r�
__module__�__qualname__�__doc__rr$r-r0r6r8r3r<�
__classcell__rrrrr
s	

r
c@sjeZdZdd�Zdd�Zedd��Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
ddd�ZdS)�ProcesscCs8||_||_||_|j|_|j|_|j|_|��|_dSr:)rZ	_protocolrrrrZget_pid�pid)rr,r'rrrrruszProcess.__init__cCsd|jj�d|j�d�S)N�<r�>)rrrBr7rrrr$~szProcess.__repr__cCs
|j��Sr:)rZget_returncoder7rrr�
returncode�szProcess.returncodec�s|j��IdHS)z?Wait until the process exit and return the process return code.N)rZ_waitr7rrr�wait�szProcess.waitcCs|j�|�dSr:)r�send_signal)r�signalrrrrG�szProcess.send_signalcCs|j��dSr:)r�	terminater7rrrrI�szProcess.terminatecCs|j��dSr:)r�killr7rrrrJ�szProcess.killc
�s�|j��}|j�|�|r,t�d|t|��z|j��IdHWn8tt	fk
rx}z|rht�d||�W5d}~XYnX|r�t�d|�|j�
�dS)Nz%%r communicate: feed stdin (%s bytes)z%r communicate: stdin got %rz%r communicate: close stdin)r�	get_debugr�writer	�debugr9Zdrain�BrokenPipeError�ConnectionResetErrorr1)r�inputrMr4rrr�_feed_stdin�s 
� zProcess._feed_stdinc�sdSr:rr7rrr�_noop�sz
Process._noopc�s�|j�|�}|dkr|j}n|j}|j��rJ|dkr8dnd}t�d||�|��IdH}|j��r�|dkrndnd}t�d||�|�	�|S)Nr&rrrz%r communicate: read %sz%r communicate: close %s)
rr)rrrrKr	rM�readr1)rr.r,r;�name�outputrrr�_read_stream�s

zProcess._read_streamNc�s�|dk	r|�|�}n|��}|jdk	r2|�d�}n|��}|jdk	rP|�d�}n|��}tj||||jd�IdH\}}}|��IdH||fS)Nrr&r)	rQrRrrVrrZgatherrrF)rrPrrrrrr�communicate�s


�zProcess.communicate)N)rr=r>rr$�propertyrErFrGrIrJrQrRrVrWrrrrrAts	
rAc
�sb�dkrt���ntjdtdd���fdd�}�j||f|||d�|��IdH\}}	t||	��S)N�ZThe loop argument is deprecated since Python 3.8 and scheduled for removal in Python 3.10.r&��
stacklevelcst��d�S�Nr%�r
rr%rr�<lambda>�s�z)create_subprocess_shell.<locals>.<lambda>�rrr)r�get_event_loop�warnings�warn�DeprecationWarningZsubprocess_shellrA)
�cmdrrrrr�kwds�protocol_factoryr,r'rr%rr�s$
����r)rrrrrc�sf�dkrt���ntjdtdd���fdd�}�j||f|�|||d�|��IdH\}	}
t|	|
��S)NrYr&rZcst��d�Sr\r]rr%rrr^�s�z(create_subprocess_exec.<locals>.<lambda>r_)rr`rarbrcZsubprocess_execrA)Zprogramrrrrr�argsrerfr,r'rr%rr�s(
�����r)�__all__�
subprocessra�rrrr�logr	�PIPEZSTDOUTZDEVNULLZFlowControlMixinZSubprocessProtocolr
rAZ_DEFAULT_LIMITrrrrrr�<module>s.�bV�
�asyncio/__pycache__/staggered.cpython-38.pyc000064400000010030151153537520015017 0ustar00U

e5dh�
@s�dZdZddlZddlZddlmZddlmZddlmZddlm	Z	dd	�ej
ejgejfej
eejejejej
eejej
efd
�dd�ZdS)
zFSupport for running coroutines in parallel with staggered start times.)�staggered_race�N�)�events)�
exceptions)�locks)�tasks)�loop)�coro_fns�delayr�returnc		�s��p
t���t|��d�d�g�g�tjtjdd���������fdd�����d��}��|�zfd}|t
��kr�t���IdH\}}t
|�}|D]$}|�
�r�|��s�|��r�|���q�ql���fW�S�D]}|�	�q�XdS)a�Run coroutines with staggered start times and take the first to finish.

    This method takes an iterable of coroutine functions. The first one is
    started immediately. From then on, whenever the immediately preceding one
    fails (raises an exception), or when *delay* seconds has passed, the next
    coroutine is started. This continues until one of the coroutines complete
    successfully, in which case all others are cancelled, or until all
    coroutines fail.

    The coroutines provided should be well-behaved in the following way:

    * They should only ``return`` if completed successfully.

    * They should always raise an exception if they did not complete
      successfully. In particular, if they handle cancellation, they should
      probably reraise, like this::

        try:
            # do work
        except asyncio.CancelledError:
            # undo partially completed work
            raise

    Args:
        coro_fns: an iterable of coroutine functions, i.e. callables that
            return a coroutine object when called. Use ``functools.partial`` or
            lambdas to pass arguments.

        delay: amount of time, in seconds, between starting coroutines. If
            ``None``, the coroutines will run sequentially.

        loop: the event loop to use.

    Returns:
        tuple *(winner_result, winner_index, exceptions)* where

        - *winner_result*: the result of the winning coroutine, or ``None``
          if no coroutines won.

        - *winner_index*: the index of the winning coroutine in
          ``coro_fns``, or ``None`` if no coroutines won. If the winning
          coroutine may return None on success, *winner_index* can be used
          to definitively determine whether any coroutine won.

        - *exceptions*: list of exceptions returned by the coroutines.
          ``len(exceptions)`` is equal to the number of coroutines actually
          started, and the order is the same as in ``coro_fns``. The winning
          coroutine's entry is ``None``.

    N)�previous_failedrc	
�sN|dk	r6t�tj��t�|����IdHW5QRXzt��\}}Wntk
r\YdSXt	�
�}���|��}��|�t
��|dks�t���d�t
��|dks�t�z|�IdH}WnLttfk
r��Ynptk
�r}z|�|<|��W5d}~XYn>X�dk�st�|�|�t��D]\}}||k�r,|���q,dS)N�r)�
contextlib�suppress�exceptions_mod�TimeoutErrorrZwait_for�wait�next�
StopIterationr�Event�create_task�append�len�AssertionError�
SystemExit�KeyboardInterrupt�
BaseException�set�	enumerate�cancel)	rZ
this_indexZcoro_fnZthis_failedZ	next_task�result�e�i�t�r
Z
enum_coro_fnsrr�run_one_coroZ
running_tasksZwinner_indexZ
winner_result��)/usr/lib64/python3.8/asyncio/staggered.pyr%Rs4 


z$staggered_race.<locals>.run_one_coror)rZget_running_loopr�typing�Optionalrrrrrrrr�doneZ	cancelledZ	exception)	r	r
rZ
first_taskr#Z
done_countr*�_�dr&r$r'rs,=
�0
r)�__doc__�__all__rr(�rrrrr�Iterable�Callable�	Awaitabler)�floatZAbstractEventLoopZTupleZAny�intZList�	Exceptionrr&r&r&r'�<module>s&����asyncio/__pycache__/constants.cpython-38.pyc000064400000001107151153537520015073 0ustar00U

e5dx�@s2ddlZdZdZdZdZdZGdd�dej�ZdS)	�N���
gN@ic@s$eZdZe��Ze��Ze��ZdS)�
_SendfileModeN)�__name__�
__module__�__qualname__�enum�autoZUNSUPPORTEDZ
TRY_NATIVEZFALLBACK�rr�)/usr/lib64/python3.8/asyncio/constants.pyrsr)r	Z!LOG_THRESHOLD_FOR_CONNLOST_WRITESZACCEPT_RETRY_DELAYZDEBUG_STACK_DEPTHZSSL_HANDSHAKE_TIMEOUTZ!SENDFILE_FALLBACK_READBUFFER_SIZE�Enumrrrrr�<module>sasyncio/__pycache__/constants.cpython-38.opt-1.pyc000064400000001107151153537520016032 0ustar00U

e5dx�@s2ddlZdZdZdZdZdZGdd�dej�ZdS)	�N���
gN@ic@s$eZdZe��Ze��Ze��ZdS)�
_SendfileModeN)�__name__�
__module__�__qualname__�enum�autoZUNSUPPORTEDZ
TRY_NATIVEZFALLBACK�rr�)/usr/lib64/python3.8/asyncio/constants.pyrsr)r	Z!LOG_THRESHOLD_FOR_CONNLOST_WRITESZACCEPT_RETRY_DELAYZDEBUG_STACK_DEPTHZSSL_HANDSHAKE_TIMEOUTZ!SENDFILE_FALLBACK_READBUFFER_SIZE�Enumrrrrr�<module>sasyncio/__pycache__/base_futures.cpython-38.pyc000064400000003554151153537520015556 0ustar00U

e5d
�@sRdZddlZddlmZddlmZdZdZdZd	d
�Z	dd�Z
e�Zd
d�Z
dS)��N)�	get_ident�)�format_helpersZPENDINGZ	CANCELLEDZFINISHEDcCst|jd�o|jdk	S)z�Check for a Future.

    This returns True when obj is a Future instance or is advertising
    itself as duck-type compatible by setting _asyncio_future_blocking.
    See comment in Future for more details.
    �_asyncio_future_blockingN)�hasattr�	__class__r)�objrr�,/usr/lib64/python3.8/asyncio/base_futures.py�isfutures�rcCs�t|�}|sd}dd�}|dkr2||dd�}n`|dkr`d�||dd�||dd��}n2|dkr�d�||dd�|d||d	d��}d
|�d�S)�#helper function for Future.__repr__�cSst�|d�S)Nr)rZ_format_callback_source)�callbackrrr
�	format_cbsz$_format_callbacks.<locals>.format_cbrr�z{}, {}z{}, <{} more>, {}���zcb=[�])�len�format)�cb�sizerrrr
�_format_callbackss&�rc	Cs�|j��g}|jtkr�|jdk	r4|�d|j���nTt|�t�f}|tkrPd}n(t�|�zt
�|j�}W5t�	|�X|�d|���|j
r�|�t|j
��|jr�|jd}|�d|d�d|d	���|S)
rNz
exception=z...zresult=rzcreated at r�:r)Z_state�lower�	_FINISHEDZ
_exception�append�idr�
_repr_running�add�discard�reprlib�reprZ_resultZ
_callbacksrZ_source_traceback)Zfuture�info�key�result�framerrr
�_future_repr_info7s$



r&)�__all__r �_threadrr
rZ_PENDINGZ
_CANCELLEDrrr�setrr&rrrr
�<module>sasyncio/__pycache__/base_events.cpython-38.pyc000064400000143516151153537520015370 0ustar00U

e5d��@s�dZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZzddlZWnek
r�dZYnXddlmZddlmZddlmZddlmZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZddlmZddl m!Z!dZ"dZ#dZ$e%e	d�Z&dZ'e(�Z)dd�Z*dd�Z+dd�Z,d+dd�Z-d,dd�Z.dd �Z/e%e	d!��r�d"d#�Z0nd$d#�Z0Gd%d&�d&ej1�Z2Gd'd(�d(ej3�Z4Gd)d*�d*ej5�Z6dS)-a�Base implementation of event loop.

The event loop can be broken up into a multiplexer (the part
responsible for notifying us of I/O events) and the event loop proper,
which wraps a multiplexer with functionality for scheduling callbacks,
immediately or at a given time in the future.

Whenever a public API takes a callback, subsequent positional
arguments will be passed to the callback if/when it is called.  This
avoids the proliferation of trivial lambdas implementing closures.
Keyword arguments for the callback are not supported; this is a
conscious design decision, leaving the door open for keyword arguments
to modify the meaning of the API call itself.
�N�)�	constants)�
coroutines)�events)�
exceptions)�futures)�	protocols)�sslproto)�	staggered)�tasks)�
transports)�trsock)�logger)�
BaseEventLoop�dg�?�AF_INET6i�QcCs0|j}tt|dd�tj�r$t|j�St|�SdS)N�__self__)Z	_callback�
isinstance�getattrr�Task�reprr�str)�handle�cb�r�+/usr/lib64/python3.8/asyncio/base_events.py�_format_handleJs
rcCs(|tjkrdS|tjkrdSt|�SdS)Nz<pipe>z<stdout>)�
subprocess�PIPE�STDOUTr)�fdrrr�_format_pipeSs


r!cCsLttd�std��n4z|�tjtjd�Wntk
rFtd��YnXdS)N�SO_REUSEPORTz)reuse_port not supported by socket modulerzTreuse_port not supported by socket module, SO_REUSEPORT defined but not implemented.)�hasattr�socket�
ValueError�
setsockopt�
SOL_SOCKETr"�OSError��sockrrr�_set_reuseport\s

r+c		Cs�ttd�sdS|dtjtjhks(|dkr,dS|tjkr>tj}n|tjkrPtj}ndS|dkrbd}nXt|t�rz|dkrzd}n@t|t�r�|dkr�d}n(zt	|�}Wnt
tfk
r�YdSX|tjkr�tj
g}tr�|�tj�n|g}t|t�r�|�d�}d|k�rdS|D]t}zVt�||�t�rJ|tjk�rJ|||d||||ffWS|||d||ffWSWntk
�rzYnX�q
dS)N�	inet_ptonr��Zidna�%)r#r$�IPPROTO_TCPZIPPROTO_UDP�SOCK_STREAM�
SOCK_DGRAMr�bytesr�int�	TypeErrorr%�	AF_UNSPEC�AF_INET�	_HAS_IPv6�appendr�decoder,r()	�host�port�family�type�protoZflowinfoZscopeidZafs�afrrr�_ipaddr_infogsN
�






rAcCs�t��}|D]*}|d}||kr(g||<||�|�qt|���}g}|dkr||�|dd|d��|dd|d�=|�dd�tj�tj	|��D��|S)z-Interleave list of addrinfo tuples by family.rrNcss|]}|dk	r|VqdS�Nr)�.0�arrr�	<genexpr>�s�z(_interleave_addrinfos.<locals>.<genexpr>)
�collections�OrderedDictr9�list�values�extend�	itertools�chain�
from_iterable�zip_longest)Z	addrinfosZfirst_address_family_countZaddrinfos_by_family�addrr=Zaddrinfos_listsZ	reorderedrrr�_interleave_addrinfos�s"
��rPcCs4|��s"|��}t|ttf�r"dSt�|���dSrB)�	cancelled�	exceptionr�
SystemExit�KeyboardInterruptrZ	_get_loop�stop)�fut�excrrr�_run_until_complete_cb�s
rX�TCP_NODELAYcCs@|jtjtjhkr<|jtjkr<|jtjkr<|�tjtj	d�dS�Nr)
r=r$r7rr>r1r?r0r&rYr)rrr�_set_nodelay�s
�
�r[cCsdSrBrr)rrrr[�sc@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�_SendfileFallbackProtocolcCsht|tj�std��||_|��|_|��|_|j	|_
|��|�|�|j
r^|jj
��|_nd|_dS)Nz.transport should be _FlowControlMixin instance)rrZ_FlowControlMixinr5�
_transportZget_protocol�_protoZ
is_reading�_should_resume_readingZ_protocol_paused�_should_resume_writing�
pause_reading�set_protocol�_loop�
create_future�_write_ready_fut)�self�transprrr�__init__�s


z"_SendfileFallbackProtocol.__init__c�s2|j��rtd��|j}|dkr$dS|IdHdS)NzConnection closed by peer)r]�
is_closing�ConnectionErrorre)rfrVrrr�drain�s
z_SendfileFallbackProtocol.draincCstd��dS)Nz?Invalid state: connection should have been established already.��RuntimeError)rf�	transportrrr�connection_made�sz)_SendfileFallbackProtocol.connection_madecCs@|jdk	r0|dkr$|j�td��n|j�|�|j�|�dS)NzConnection is closed by peer)reZ
set_exceptionrjr^�connection_lost)rfrWrrrrp�s
�z)_SendfileFallbackProtocol.connection_lostcCs |jdk	rdS|jj��|_dSrB)rer]rcrd�rfrrr�
pause_writing�s
z'_SendfileFallbackProtocol.pause_writingcCs$|jdkrdS|j�d�d|_dS)NF)re�
set_resultrqrrr�resume_writing�s
z(_SendfileFallbackProtocol.resume_writingcCstd��dS�Nz'Invalid state: reading should be pausedrl)rf�datarrr�
data_received�sz'_SendfileFallbackProtocol.data_receivedcCstd��dSrurlrqrrr�eof_receivedsz&_SendfileFallbackProtocol.eof_receivedc�sF|j�|j�|jr|j��|jdk	r2|j��|jrB|j��dSrB)	r]rbr^r_�resume_readingre�cancelr`rtrqrrr�restores


z!_SendfileFallbackProtocol.restoreN)�__name__�
__module__�__qualname__rhrkrorprrrtrwrxr{rrrrr\�sr\c@sxeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
edd��Zdd�Z
dd�Zdd�Zdd�ZdS)�ServercCs@||_||_d|_g|_||_||_||_||_d|_d|_	dS)NrF)
rc�_sockets�
_active_count�_waiters�_protocol_factory�_backlog�_ssl_context�_ssl_handshake_timeout�_serving�_serving_forever_fut)rf�loop�sockets�protocol_factoryZssl_context�backlog�ssl_handshake_timeoutrrrrhszServer.__init__cCsd|jj�d|j�d�S)N�<z	 sockets=�>)�	__class__r|r�rqrrr�__repr__ szServer.__repr__cCs |jdk	st�|jd7_dSrZ)r��AssertionErrorr�rqrrr�_attach#szServer._attachcCs<|jdkst�|jd8_|jdkr8|jdkr8|��dS)Nrr)r�r�r��_wakeuprqrrr�_detach'szServer._detachcCs,|j}d|_|D]}|��s|�|�qdSrB)r��doners)rf�waiters�waiterrrrr�-s
zServer._wakeupc	CsJ|jr
dSd|_|jD].}|�|j�|j�|j||j||j|j�qdS)NT)	r�r�Zlistenr�rc�_start_servingr�r�r�)rfr*rrrr�4s
�zServer._start_servingcCs|jSrB)rcrqrrr�get_loop>szServer.get_loopcCs|jSrB)r�rqrrr�
is_servingAszServer.is_servingcCs"|jdkrdStdd�|jD��S)Nrcss|]}t�|�VqdSrB)r
ZTransportSocket)rC�srrrrEHsz!Server.sockets.<locals>.<genexpr>)r��tuplerqrrrr�Ds
zServer.socketscCsn|j}|dkrdSd|_|D]}|j�|�qd|_|jdk	rX|j��sX|j��d|_|jdkrj|��dS)NFr)	r�rcZ
_stop_servingr�r�r�rzr�r�)rfr�r*rrr�closeJs
�

zServer.closec�s"|��tjd|jd�IdHdS)Nr�r�)r�r�sleeprcrqrrr�
start_serving]szServer.start_servingc	�s�|jdk	rtd|�d���|jdkr4td|�d���|��|j��|_zLz|jIdHWn6tjk
r�z|��|�	�IdHW5�XYnXW5d|_XdS)Nzserver z, is already being awaited on serve_forever()z
 is closed)
r�rmr�r�rcrdrZCancelledErrorr��wait_closedrqrrr�
serve_forevercs 

�
zServer.serve_foreverc�s<|jdks|jdkrdS|j��}|j�|�|IdHdSrB)r�r�rcrdr9)rfr�rrrr�xs

zServer.wait_closedN)r|r}r~rhr�r�r�r�r�r�r��propertyr�r�r�r�r�rrrrrs


rc@sPeZdZdd�Zdd�Zdd�Zdd�d	d
�Zdd�Zd
d�Zd�ddd�dd�Z	d�ddddddd�dd�Z
d�dd�Zd�dd�Zd�dd�Z
d�dd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zejfd7d8�Zd9d:�Zd;d<�Zdd=�d>d?�Z dd=�d@dA�Z!dd=�dBdC�Z"dDdE�Z#dFdG�Z$dHdI�Z%dd=�dJdK�Z&dLdM�Z'dNdO�Z(dPdQ�Z)dRdRdRdRdS�dTdU�Z*d�dVdW�Z+d�ddX�dYdZ�Z,d[d\�Z-d]d^�Z.d_d`�Z/d�dadb�Z0d�ddRdRdRdddddddc�
ddde�Z1d�dfdg�Z2d�ddX�dhdi�Z3djdk�Z4dldm�Z5ddddn�dodp�Z6d�dRdRdRe7ddddq�drds�Z8dRe9j:dRdRdS�dtdu�Z;dvdw�Z<d�e9j=e9j>ddxddddddy�	dzd{�Z?ddd|�d}d~�Z@dd��ZAd�d��ZBd�d��ZCeDjEeDjEeDjEdddRdddd��	d�d��ZFeDjEeDjEeDjEdddRdddd��	d�d��ZGd�d��ZHd�d��ZId�d��ZJd�d��ZKd�d��ZLd�d��ZMd�d��ZNd�d��ZOd�d��ZPd�d��ZQd�d��ZRdS)�rcCs�d|_d|_d|_t��|_g|_d|_d|_d|_	t
�d�j|_
d|_|�t���d|_d|_d|_d|_d|_t��|_d|_dS)NrF�	monotonicg�������?)�_timer_cancelled_count�_closed�	_stoppingrF�deque�_ready�
_scheduled�_default_executorZ
_internal_fds�
_thread_id�time�get_clock_infoZ
resolution�_clock_resolution�_exception_handler�	set_debugrZ_is_debug_mode�slow_callback_duration�_current_handle�
_task_factory�"_coroutine_origin_tracking_enabled�&_coroutine_origin_tracking_saved_depth�weakrefZWeakSet�
_asyncgens�_asyncgens_shutdown_calledrqrrrrh�s$

zBaseEventLoop.__init__c	Cs.d|jj�d|���d|���d|���d�	S)Nr�z	 running=z closed=z debug=r�)r�r|�
is_running�	is_closed�	get_debugrqrrrr��s,�zBaseEventLoop.__repr__cCstj|d�S)z,Create a Future object attached to the loop.r�)rZFuturerqrrrrd�szBaseEventLoop.create_futureN)�namecCsN|��|jdkr2tj|||d�}|jrJ|jd=n|�||�}t�||�|S)zDSchedule a coroutine object.

        Return a task object.
        N)r�r����)�
_check_closedr�rr�_source_tracebackZ_set_task_name)rf�coror�Ztaskrrr�create_task�s

zBaseEventLoop.create_taskcCs"|dk	rt|�std��||_dS)awSet a task factory that will be used by loop.create_task().

        If factory is None the default task factory will be set.

        If factory is a callable, it should have a signature matching
        '(loop, coro)', where 'loop' will be a reference to the active
        event loop, 'coro' will be a coroutine object.  The callable
        must return a Future.
        Nz'task factory must be a callable or None)�callabler5r�)rf�factoryrrr�set_task_factory�s
zBaseEventLoop.set_task_factorycCs|jS)z<Return a task factory, or None if the default one is in use.)r�rqrrr�get_task_factory�szBaseEventLoop.get_task_factory)�extra�servercCst�dS)zCreate socket transport.N��NotImplementedError)rfr*�protocolr�r�r�rrr�_make_socket_transport�sz$BaseEventLoop._make_socket_transportFT)�server_side�server_hostnamer�r�r��call_connection_madecCst�dS)zCreate SSL transport.Nr�)rfZrawsockr��
sslcontextr�r�r�r�r�r�r�rrr�_make_ssl_transport�sz!BaseEventLoop._make_ssl_transportcCst�dS)zCreate datagram transport.Nr�)rfr*r��addressr�r�rrr�_make_datagram_transport�sz&BaseEventLoop._make_datagram_transportcCst�dS)zCreate read pipe transport.Nr��rf�piper�r�r�rrr�_make_read_pipe_transport�sz'BaseEventLoop._make_read_pipe_transportcCst�dS)zCreate write pipe transport.Nr�r�rrr�_make_write_pipe_transport�sz(BaseEventLoop._make_write_pipe_transportc	
�st�dS)zCreate subprocess transport.Nr�)
rfr��args�shell�stdin�stdout�stderr�bufsizer��kwargsrrr�_make_subprocess_transport�sz(BaseEventLoop._make_subprocess_transportcCst�dS)z�Write a byte to self-pipe, to wake up the event loop.

        This may be called from a different thread.

        The subclass is responsible for implementing the self-pipe.
        Nr�rqrrr�_write_to_self�szBaseEventLoop._write_to_selfcCst�dS)zProcess selector events.Nr�)rf�
event_listrrr�_process_events�szBaseEventLoop._process_eventscCs|jrtd��dS)NzEvent loop is closed)r�rmrqrrrr��szBaseEventLoop._check_closedcCs*|j�|�|��s&|�|j|���dSrB)r��discardr��call_soon_threadsafer��aclose�rf�agenrrr�_asyncgen_finalizer_hook�sz&BaseEventLoop._asyncgen_finalizer_hookcCs.|jrtjd|�d�t|d�|j�|�dS)Nzasynchronous generator z3 was scheduled after loop.shutdown_asyncgens() call��source)r��warnings�warn�ResourceWarningr��addr�rrr�_asyncgen_firstiter_hooks
�z&BaseEventLoop._asyncgen_firstiter_hookc�s�d|_t|j�sdSt|j�}|j��tjdd�|D�d|d��IdH}t||�D]*\}}t|t	�rT|�
d|��||d��qTdS)z,Shutdown all active asynchronous generators.TNcSsg|]}|���qSr)r�)rCZagrrr�
<listcomp>sz4BaseEventLoop.shutdown_asyncgens.<locals>.<listcomp>)Zreturn_exceptionsr�z;an error occurred during closing of asynchronous generator )�messagerRZasyncgen)r��lenr�rH�clearr�gather�zipr�	Exception�call_exception_handler)rfZ
closing_agensZresults�resultr�rrr�shutdown_asyncgenss"


�
�z BaseEventLoop.shutdown_asyncgenscCs(|��rtd��t��dk	r$td��dS)Nz"This event loop is already runningz7Cannot run the event loop while another loop is running)r�rmrZ_get_running_looprqrrr�_check_running&s�zBaseEventLoop._check_runningc	Cs�|��|��|�|j�t��|_t��}tj	|j
|jd�z t
�|�|��|jrLq^qLW5d|_d|_t
�d�|�d�tj	|�XdS)zRun until stop() is called.)�	firstiter�	finalizerFN)r�r��_set_coroutine_origin_tracking�_debug�	threading�	get_identr��sys�get_asyncgen_hooks�set_asyncgen_hooksr�r�r�rZ_set_running_loop�	_run_once)rfZold_agen_hooksrrr�run_forever-s$
�


zBaseEventLoop.run_foreverc	Cs�|��|��t�|�}tj||d�}|r4d|_|�t�z<z|�
�Wn*|rp|��rp|��sp|�
��YnXW5|�	t�X|��s�td��|��S)a\Run until the Future is done.

        If the argument is a coroutine, it is wrapped in a Task.

        WARNING: It would be disastrous to call run_until_complete()
        with the same coroutine twice -- it would wrap it in two
        different Tasks and that can't be good.

        Return the Future's result, or raise its exception.
        r�Fz+Event loop stopped before Future completed.)r�r�rZisfuturerZ
ensure_futureZ_log_destroy_pendingZadd_done_callbackrXZremove_done_callbackrr�rQrRrmr�)rfZfutureZnew_taskrrr�run_until_completeDs"
z BaseEventLoop.run_until_completecCs
d|_dS)z�Stop running the event loop.

        Every callback already scheduled will still run.  This simply informs
        run_forever to stop looping after a complete iteration.
        TN)r�rqrrrrUjszBaseEventLoop.stopcCsj|��rtd��|jrdS|jr,t�d|�d|_|j��|j��|j	}|dk	rfd|_	|j
dd�dS)z�Close the event loop.

        This clears the queues and shuts down the executor,
        but does not wait for the executor to finish.

        The event loop must not be running.
        z!Cannot close a running event loopNzClose %rTF)�wait)r�rmr�r�r�debugr�r�r�r�Zshutdown�rf�executorrrrr�rs

zBaseEventLoop.closecCs|jS)z*Returns True if the event loop was closed.)r�rqrrrr��szBaseEventLoop.is_closedcCs0|��s,|d|��t|d�|��s,|��dS)Nzunclosed event loop r�)r�r�r�r�)rfZ_warnrrr�__del__�szBaseEventLoop.__del__cCs
|jdk	S)z*Returns True if the event loop is running.N)r�rqrrrr��szBaseEventLoop.is_runningcCst��S)z�Return the time according to the event loop's clock.

        This is a float expressed in seconds since an epoch, but the
        epoch, precision, accuracy and drift are unspecified and may
        differ per event loop.
        )r�r�rqrrrr��szBaseEventLoop.time)�contextcGs2|j|��||f|�d|i�}|jr.|jd=|S)a8Arrange for a callback to be called at a given time.

        Return a Handle: an opaque object with a cancel() method that
        can be used to cancel the call.

        The delay can be an int or float, expressed in seconds.  It is
        always relative to the current time.

        Each callback will be called exactly once.  If two callbacks
        are scheduled for exactly the same time, it undefined which
        will be called first.

        Any positional arguments after the callback will be passed to
        the callback when it is called.
        r
r�)�call_atr�r�)rfZdelay�callbackr
r��timerrrr�
call_later�s�zBaseEventLoop.call_latercGsZ|��|jr"|��|�|d�t�|||||�}|jrB|jd=t�|j	|�d|_	|S)z|Like call_later(), but uses an absolute time.

        Absolute time corresponds to the event loop's time() method.
        rr�T)
r�r��
_check_thread�_check_callbackr�TimerHandler��heapq�heappushr�)rf�whenrr
r�rrrrr�szBaseEventLoop.call_atcGsB|��|jr"|��|�|d�|�|||�}|jr>|jd=|S)aTArrange for a callback to be called as soon as possible.

        This operates as a FIFO queue: callbacks are called in the
        order in which they are registered.  Each callback will be
        called exactly once.

        Any positional arguments after the callback will be passed to
        the callback when it is called.
        �	call_soonr�)r�r�rr�
_call_soonr��rfrr
r�rrrrr�s
zBaseEventLoop.call_sooncCsDt�|�st�|�r$td|�d���t|�s@td|�d|����dS)Nzcoroutines cannot be used with z()z"a callable object was expected by z(), got )rZiscoroutineZiscoroutinefunctionr5r�)rfr�methodrrrr�s
�
��zBaseEventLoop._check_callbackcCs.t�||||�}|jr|jd=|j�|�|S)Nr�)r�Handler�r�r9)rfrr�r
rrrrr�s
zBaseEventLoop._call_sooncCs,|jdkrdSt��}||jkr(td��dS)aoCheck that the current thread is the thread running the event loop.

        Non-thread-safe methods of this class make this assumption and will
        likely behave incorrectly when the assumption is violated.

        Should only be called when (self._debug == True).  The caller is
        responsible for checking this condition for performance reasons.
        NzMNon-thread-safe operation invoked on an event loop other than the current one)r�rrrm)rfZ	thread_idrrrr�s	

�zBaseEventLoop._check_threadcGsB|��|jr|�|d�|�|||�}|jr6|jd=|��|S)z"Like call_soon(), but thread-safe.r�r�)r�r�rrr�r�rrrrr��sz"BaseEventLoop.call_soon_threadsafecGsZ|��|jr|�|d�|dkr@|j}|dkr@tj��}||_tj|j|f|��|d�S)N�run_in_executorr�)	r�r�rr��
concurrentr�ThreadPoolExecutorZwrap_futureZsubmit)rfr�funcr�rrrrs
�zBaseEventLoop.run_in_executorcCs&t|tjj�st�dtd�||_dS)Nz{Using the default executor that is not an instance of ThreadPoolExecutor is deprecated and will be prohibited in Python 3.9�)rrrrr�r��DeprecationWarningr�r
rrr�set_default_executors�z"BaseEventLoop.set_default_executorcCs�|�d|��g}|r$|�d|���|r8|�d|���|rL|�d|���|r`|�d|���d�|�}t�d|�|��}t�||||||�}	|��|}
d|�d	|
d
d�d|	��}|
|jkr�t�|�n
t�|�|	S)
N�:zfamily=ztype=zproto=zflags=�, zGet address info %szGetting address info z took g@�@z.3fzms: )	r9�joinrr	r�r$�getaddrinfor��info)rfr;r<r=r>r?�flags�msg�t0�addrinfo�dtrrr�_getaddrinfo_debugs&


z BaseEventLoop._getaddrinfo_debugr�r=r>r?r)c
�s2|jr|j}ntj}|�d|||||||�IdHSrB)r�r.r$r'r)rfr;r<r=r>r?r)Zgetaddr_funcrrrr'2s�zBaseEventLoop.getaddrinfoc�s|�dtj||�IdHSrB)rr$�getnameinfo)rfZsockaddrr)rrrr0<s�zBaseEventLoop.getnameinfo)�fallbackc
�s�|jr|��dkrtd��|�||||�z|�||||�IdHWStjk
rl}z
|s\�W5d}~XYnX|�||||�IdHS)Nrzthe socket must be non-blocking)r�Z
gettimeoutr%�_check_sendfile_params�_sock_sendfile_nativer�SendfileNotAvailableError�_sock_sendfile_fallback)rfr*�file�offset�countr1rWrrr�
sock_sendfile@s��zBaseEventLoop.sock_sendfilec�st�d|�d���dS)Nz-syscall sendfile is not available for socket z and file {file!r} combination�rr4�rfr*r6r7r8rrrr3Ns
�z#BaseEventLoop._sock_sendfile_nativec

�s�|r|�|�|rt|tj�ntj}t|�}d}zt|rNt|||�}|dkrNq�t|�d|�}|�d|j|�IdH}	|	szq�|�	||d|	��IdH||	7}q2|W�S|dkr�t|d�r�|�||�XdS)Nr�seek)
r<�minrZ!SENDFILE_FALLBACK_READBUFFER_SIZE�	bytearrayr#�
memoryviewr�readintoZsock_sendall)
rfr*r6r7r8�	blocksize�buf�
total_sent�view�readrrrr5Us,
��
z%BaseEventLoop._sock_sendfile_fallbackcCs�dt|dd�krtd��|jtjks,td��|dk	rbt|t�sLtd�|���|dkrbtd�|���t|t�sztd�|���|dkr�td�|���dS)N�b�modez$file should be opened in binary modez+only SOCK_STREAM type sockets are supportedz+count must be a positive integer (got {!r})rz0offset must be a non-negative integer (got {!r}))	rr%r>r$r1rr4r5�formatr;rrrr2os2
��
����z$BaseEventLoop._check_sendfile_paramsc�s@g}|�|�|\}}}}}	d}
z�tj|||d�}
|
�d�|dk	r�|D]r\}}}}}z|
�|�Wq�WqHtk
r�}z0d|�d|j����}
t|j|
�}|�|�W5d}~XYqHXqH|���|�	|
|	�IdH|
WStk
�r}z"|�|�|
dk	�r
|
�
��W5d}~XYn |
dk	�r4|
�
��YnXdS)z$Create, bind and connect one socket.N�r=r>r?Fz*error while attempting to bind on address �: )r9r$�setblocking�bindr(�strerror�lower�errno�pop�sock_connectr�)rfrZ	addr_infoZlocal_addr_infosZ
my_exceptionsr=Ztype_r?�_r�r*ZladdrrWr*rrr�
_connect_sock�s:



�


zBaseEventLoop._connect_sock)
�sslr=r?r)r*�
local_addrr�r��happy_eyeballs_delay�
interleavec
	�sl|
dk	r|std��|
dkr0|r0|s,td��|}
|dk	rD|sDtd��|dk	rX|
dkrXd}
|dk	sj|dk	�r�|dk	rztd���j||f|tj||�d�IdH}|s�td��|	dk	r܈j|	|tj||�d�IdH��s�td��nd�|
r�t||
�}g�|dk�rH|D]D}z ���|��IdH}W�qvWntk
�r@Y�qYnX�qn.tj���fd	d
�|D�|�d�IdH\}}}|dk�r dd
��D��t	��dk�r��d�nJt
�d��t�fdd
��D���r҈d�td�d�
dd
��D�����n.|dk�rtd��|jtjk�r td|�����j||||
|d�IdH\}}�j�rd|�d�}t�d|||||�||fS)a�Connect to a TCP server.

        Create a streaming transport connection to a given Internet host and
        port: socket family AF_INET or socket.AF_INET6 depending on host (or
        family if specified), socket type SOCK_STREAM. protocol_factory must be
        a callable returning a protocol instance.

        This method is a coroutine which will try to establish the connection
        in the background.  When successful, the coroutine returns a
        (transport, protocol) pair.
        Nz+server_hostname is only meaningful with sslz:You must set server_hostname when using ssl without a host�1ssl_handshake_timeout is only meaningful with sslr�8host/port and sock can not be specified at the same time�r=r>r?r)r��!getaddrinfo() returned empty listc3s |]}t��j�|��VqdSrB)�	functools�partialrS)rCr,)r�laddr_infosrfrrrE�s��z2BaseEventLoop.create_connection.<locals>.<genexpr>r�cSsg|]}|D]}|�qqSrr)rC�subrWrrrr��sz3BaseEventLoop.create_connection.<locals>.<listcomp>rc3s|]}t|��kVqdSrB�r�rCrW)�modelrrrEszMultiple exceptions: {}r%css|]}t|�VqdSrBr`rarrrrE
sz5host and port was not specified and no sock specified�"A Stream Socket was expected, got )r�r$z%r connected to %s:%r: (%r, %r))r%�_ensure_resolvedr$r1r(rPrSr
Zstaggered_racer�r�allrHr&r>�_create_connection_transportr��get_extra_inforr	)rfr�r;r<rTr=r?r)r*rUr�r�rVrW�infosr,rRrnr�r)rr^rbrfr�create_connection�s�����


�
��

�
���
�zBaseEventLoop.create_connectionc	�s�|�d�|�}|��}|rHt|t�r*dn|}	|j|||	||||d�}
n|�|||�}
z|IdHWn|
���YnX|
|fS)NF�r�r�r�)rKrdr�boolr�r�r�)rfr*r�rTr�r�r�r�r�r�rnrrrrf%s*
�z*BaseEventLoop._create_connection_transportc
�s�|��rtd��t|dtjj�}|tjjkr:td|����|tjjkr�z|�||||�IdHWStj	k
r�}z
|sx�W5d}~XYnX|s�td|����|�
||||�IdHS)a�Send a file to transport.

        Return the total number of bytes which were sent.

        The method uses high-performance os.sendfile if available.

        file must be a regular file object opened in binary mode.

        offset tells from where to start reading the file. If specified,
        count is the total number of bytes to transmit as opposed to
        sending the file until EOF is reached. File position is updated on
        return or also in case of error in which case file.tell()
        can be used to figure out the number of bytes
        which were sent.

        fallback set to True makes asyncio to manually read and send
        the file when the platform does not support the sendfile syscall
        (e.g. Windows or SSL socket on Unix).

        Raise SendfileNotAvailableError if the system does not support
        sendfile syscall and fallback is False.
        zTransport is closingZ_sendfile_compatiblez(sendfile is not supported for transport NzHfallback is disabled and native sendfile is not supported for transport )rirmrrZ
_SendfileModeZUNSUPPORTEDZ
TRY_NATIVE�_sendfile_nativerr4�_sendfile_fallback)rfrnr6r7r8r1rGrWrrr�sendfile?s4�����zBaseEventLoop.sendfilec�st�d��dS)Nz!sendfile syscall is not supportedr:)rfrgr6r7r8rrrrlns�zBaseEventLoop._sendfile_nativec
�s�|r|�|�|rt|d�nd}t|�}d}t|�}z�|rXt|||�}|dkrX|W�bSt|�d|�}	|�d|j|	�IdH}
|
s�|W�0S|�	�IdH|�
|	d|
��||
7}q6W5|dkr�t|d�r�|�||�|��IdHXdS)Ni@rr<)r<r=r>r\r#r{r?rr@rk�write)rfrgr6r7r8rArBrCr?rDrErrrrmrs*
z BaseEventLoop._sendfile_fallbackrjc
�s�tdkrtd��t|tj�s*td|����t|dd�sFtd|�d���|��}tj|||||||dd�}|�	�|�
|�|�|j|�}	|�|j
�}
z|IdHWn.tk
r�|��|	��|
���YnX|jS)	zzUpgrade transport to TLS.

        Return a new transport that *protocol* should start using
        immediately.
        Nz"Python ssl module is not availablez@sslcontext is expected to be an instance of ssl.SSLContext, got Z_start_tls_compatibleFz
transport z  is not supported by start_tls())r�r�)rTrmrZ
SSLContextr5rrdr	ZSSLProtocolrarbrrory�
BaseExceptionr�rzZ_app_transport)rfrnr�r�r�r�r�r�Zssl_protocolZ
conmade_cbZ	resume_cbrrr�	start_tls�sB	�
��
zBaseEventLoop.start_tls)r=r?r)�
reuse_address�
reuse_port�allow_broadcastr*c �s|
dk	r�|
jtjkr"td|
�����s>�s>|s>|s>|s>|s>|	r~t��||||||	d�}d�dd�|��D��}td|�d���|
�d	�d}
�n�s��s�|d
kr�td��||fdff}�n�ttd
��r�|tj	k�r���fD]}|dk	r�t
|t�s�td��qڈ�rx�d
dk�rxz"t
�t�
��j��r.t���WnFtk
�rFYn2tk
�rv}zt�d�|�W5d}~XYnX||f��fff}n�i}d
�fd�ffD]�\}}|dk	�r�t
|t��r�t|�dk�s�td��|j||tj|||d�IdH}|�std��|D]:\}}}}}||f}||k�r0ddg||<||||<�q�q���fdd�|��D�}|�sjtd��g}|tk	�r�|�r�td��ntjdtdd�|D]�\\}}\}}d}
d}
zxtj|tj|d�}
|�r�t|
�|	�r�|
�tj tj!d�|
�d	���r|
�"|���r*|	�s&|�#|
|�IdH|}
Wn^tk
�rl}z |
dk	�rR|
�$�|�%|�W5d}~XYn&|
dk	�r�|
�$��YnX�q��q�|d
�|�}|�&�}|�'|
||
|�}|j(�r��r�t�)d��||�nt�*d�||�z|IdHWn|�$��YnX||fS)zCreate datagram connection.NzA UDP Socket was expected, got )rU�remote_addrr=r?r)rrrsrtr%css$|]\}}|r|�d|��VqdS)�=Nr)rC�k�vrrrrE�sz9BaseEventLoop.create_datagram_endpoint.<locals>.<genexpr>zKsocket modifier keyword arguments can not be used when sock is specified. (�)Frzunexpected address family)NN�AF_UNIXzstring is expected)r�z2Unable to check or remove stale UNIX socket %r: %rrr!z2-tuple is expectedrZr[cs8g|]0\}}�r|ddks�r,|ddks||f�qS)rNrr)rC�keyZ	addr_pair�rUrurrr��s�z:BaseEventLoop.create_datagram_endpoint.<locals>.<listcomp>zcan not get address informationz~Passing `reuse_address=True` is no longer supported, as the usage of SO_REUSEPORT in UDP poses a significant security concern.zdThe *reuse_address* parameter has been deprecated as of 3.5.10 and is scheduled for removal in 3.11.)�
stacklevelrIz@Datagram endpoint local_addr=%r remote_addr=%r created: (%r, %r)z2Datagram endpoint remote_addr=%r created: (%r, %r))+r>r$r2r%�dictr&�itemsrKr#rzrrr5�stat�S_ISSOCK�os�st_mode�remove�FileNotFoundErrorr(r�errorr�r�r�rd�_unsetr�r�r"r+r&r'ZSO_BROADCASTrLrQr�r9rdr�r�r(r	) rfr�rUrur=r?r)rrrsrtr*ZoptsZproblemsZr_addrZaddr_pairs_inforO�errZ
addr_infos�idxrhZfamrRZpror�r|rZ
local_addressZremote_addressrWr�r�rnrr}r�create_datagram_endpoint�s*�������
�

��
��
�

����




���z&BaseEventLoop.create_datagram_endpointc
�s\|dd�\}}t|||||f|dd���}	|	dk	r<|	gS|j||||||d�IdHSdS)Nr!r/)rAr')
rfr�r=r>r?r)r�r;r<r(rrrrdLs�zBaseEventLoop._ensure_resolvedc�s8|j||f|tj||d�IdH}|s4td|�d���|S)N)r=r>r)r�zgetaddrinfo(z) returned empty list)rdr$r1r()rfr;r<r=r)rhrrr�_create_server_getaddrinfoXs�z(BaseEventLoop._create_server_getaddrinfor)	r=r)r*r�rTrrrsr�r�c	�s�t|t�rtd��|dk	r*|dkr*td��|dk	s<�dk	�r"|dk	rLtd��|	dkrhtjdkoftjdk}	g}
|dkr|dg}n$t|t�s�t|t	j
j�s�|g}n|}����fdd	�|D�}tj
|d
�i�IdH}ttj�|��}d}�z|D�]}|\}}}}}zt�|||�}Wn8tjk
�rH�j�r@tjd|||d
d�Yq�YnX|
�|�|	�rl|�tjtjd
�|
�rzt|�t�r�|tjk�r�ttd��r�|�tj tj!d
�z|�"|�Wq�t#k
�r�}z t#|j$d||j%�&�f�d�W5d}~XYq�Xq�d
}W5|�s|
D]}|���qXn4|dk�r4td��|j'tj(k�rPtd|����|g}
|
D]}|�)d��qZt*�|
||||�}|�r�|�+�tj,d�d�IdH�j�r�t�-d|�|S)a1Create a TCP server.

        The host parameter can be a string, in that case the TCP server is
        bound to host and port.

        The host parameter can also be a sequence of strings and in that case
        the TCP server is bound to all hosts of the sequence. If a host
        appears multiple times (possibly indirectly e.g. when hostnames
        resolve to the same IP address), the server is only bound once to that
        host.

        Return a Server object which can be used to stop the service.

        This method is a coroutine.
        z*ssl argument must be an SSLContext or NoneNrXrY�posix�cygwinr.csg|]}�j|���d��qS))r=r))r�)rCr;�r=r)r<rfrrr��s�
�z/BaseEventLoop.create_server.<locals>.<listcomp>r�Fz:create_server() failed to create socket.socket(%r, %r, %r)T��exc_info�IPPROTO_IPV6z0error while attempting to bind on address %r: %sz)Neither host/port nor sock were specifiedrcrr�z
%r is serving).rrkr5r%r�r�r�platformrrF�abc�Iterablerr��setrKrLrMr�r$r�r�r�warningr9r&r'ZSO_REUSEADDRr+r8rr#r�ZIPV6_V6ONLYrLr(rOrMrNr>r1rKrr�r�r()rfr�r;r<r=r)r*r�rTrrrsr�r�r�ZhostsZfsrhZ	completed�resr@Zsocktyper?Z	canonnameZsar�r�rr�r�
create_server`s�
��
��
�

������
�zBaseEventLoop.create_server)rTr�c�sv|jtjkrtd|����|dk	r.|s.td��|j|||dd|d�IdH\}}|jrn|�d�}t�d|||�||fS)	aHandle an accepted connection.

        This is used by servers that accept connections outside of
        asyncio but that use asyncio to handle connections.

        This method is a coroutine.  When completed, the coroutine
        returns a (transport, protocol) pair.
        rcNrXr.T)r�r�r$z%r handled: (%r, %r))	r>r$r1r%rfr�rgrr	)rfr�r*rTr�rnr�rrr�connect_accepted_socket�s$��
z%BaseEventLoop.connect_accepted_socketc�sd|�}|��}|�|||�}z|IdHWn|���YnX|jr\t�d|��||�||fS)Nz Read pipe %r connected: (%r, %r))rdr�r�r�rr	�fileno�rfr�r�r�r�rnrrr�connect_read_pipe�s�zBaseEventLoop.connect_read_pipec�sd|�}|��}|�|||�}z|IdHWn|���YnX|jr\t�d|��||�||fS)Nz!Write pipe %r connected: (%r, %r))rdr�r�r�rr	r�r�rrr�connect_write_pipes�z BaseEventLoop.connect_write_pipecCs�|g}|dk	r"|�dt|����|dk	rJ|tjkrJ|�dt|����n8|dk	rf|�dt|����|dk	r�|�dt|����t�d�|��dS)Nzstdin=zstdout=stderr=zstdout=zstderr=� )r9r!rrrr	r&)rfr*r�r�r�r(rrr�_log_subprocessszBaseEventLoop._log_subprocess)	r�r�r��universal_newlinesr�r��encoding�errors�textc	�s�t|ttf�std��|r"td��|s.td��|dkr>td��|rJtd��|	dk	rZtd��|
dk	rjtd��|�}
d}|jr�d	|}|�||||�|j|
|d
||||f|�IdH}|jr�|dk	r�t�d||�||
fS)Nzcmd must be a string� universal_newlines must be Falsezshell must be Truer�bufsize must be 0�text must be False�encoding must be None�errors must be Nonezrun shell command %rT�%s: %r)	rr3rr%r�r�r�rr()rfr��cmdr�r�r�r�r�r�r�r�r�r�r��	debug_logrnrrr�subprocess_shellsB��
zBaseEventLoop.subprocess_shellc	�s�|rtd��|rtd��|dkr(td��|r4td��|	dk	rDtd��|
dk	rTtd��|f|}|�}d}|jr�d|��}|�||||�|j||d	||||f|
�IdH}|jr�|dk	r�t�d
||�||fS)Nr�zshell must be Falserr�r�r�r�zexecute program Fr�)r%r�r�r�rr()rfr�Zprogramr�r�r�r�r�r�r�r�r�r�r�Z
popen_argsr�r�rnrrr�subprocess_execCs@

��
zBaseEventLoop.subprocess_execcCs|jS)zKReturn an exception handler, or None if the default one is in use.
        )r�rqrrr�get_exception_handleresz#BaseEventLoop.get_exception_handlercCs(|dk	rt|�std|����||_dS)a�Set handler as the new event loop exception handler.

        If handler is None, the default exception handler will
        be set.

        If handler is a callable object, it should have a
        signature matching '(loop, context)', where 'loop'
        will be a reference to the active event loop, 'context'
        will be a dict object (see `call_exception_handler()`
        documentation for details about context).
        Nz+A callable object or None is expected, got )r�r5r�)rfZhandlerrrr�set_exception_handlerjsz#BaseEventLoop.set_exception_handlerc	Cs|�d�}|sd}|�d�}|dk	r6t|�||jf}nd}d|kr`|jdk	r`|jjr`|jj|d<|g}t|�D]�}|dkr|qn||}|dkr�d	�t�|��}d
}||�	�7}n2|dkr�d	�t�|��}d}||�	�7}nt
|�}|�|�d|���qntj
d
�|�|d�dS)aEDefault exception handler.

        This is called when an exception occurs and no exception
        handler is set, and can be called by a custom exception
        handler that wants to defer to the default behavior.

        This default handler logs the error message and other
        context-dependent information.  In debug mode, a truncated
        stack trace is also appended showing where the given object
        (e.g. a handle or future or task) was created, if any.

        The context parameter has the same meaning as in
        `call_exception_handler()`.
        r�z!Unhandled exception in event looprRNFZsource_tracebackZhandle_traceback>r�rRr.z+Object created at (most recent call last):
z+Handle created at (most recent call last):
rJ�
r�)�getr>�
__traceback__r�r��sortedr&�	traceback�format_list�rstriprr9rr�)	rfr
r�rRr�Z	log_linesr|�value�tbrrr�default_exception_handler{s<

���z'BaseEventLoop.default_exception_handlercCs�|jdkrVz|�|�Wq�ttfk
r2�Yq�tk
rRtjddd�Yq�Xn�z|�||�Wn�ttfk
r��Ynttk
r�}zVz|�d||d��Wn:ttfk
r��Yn"tk
r�tjddd�YnXW5d}~XYnXdS)aDCall the current event loop's exception handler.

        The context argument is a dict containing the following keys:

        - 'message': Error message;
        - 'exception' (optional): Exception object;
        - 'future' (optional): Future instance;
        - 'task' (optional): Task instance;
        - 'handle' (optional): Handle instance;
        - 'protocol' (optional): Protocol instance;
        - 'transport' (optional): Transport instance;
        - 'socket' (optional): Socket instance;
        - 'asyncgen' (optional): Asynchronous generator that caused
                                 the exception.

        New keys maybe introduced in the future.

        Note: do not overload this method in an event loop subclass.
        For custom exception handling, use the
        `set_exception_handler()` method.
        Nz&Exception in default exception handlerTr�z$Unhandled error in exception handler)r�rRr
zeException in default exception handler while handling an unexpected error in custom exception handler)r�r�rSrTrprr�)rfr
rWrrrr��s4
���z$BaseEventLoop.call_exception_handlercCs>t|tj�std��|jrdSt|tj�r.t�|j�|�dS)z3Add a Handle to _scheduled (TimerHandle) or _ready.zA Handle is required hereN)rrrr��
_cancelledrr�r9�rfrrrr�
_add_callback�s
zBaseEventLoop._add_callbackcCs|�|�|��dS)z6Like _add_callback() but called from a signal handler.N)r�r�r�rrr�_add_callback_signalsafe�s
z&BaseEventLoop._add_callback_signalsafecCs|jr|jd7_dS)z3Notification that a TimerHandle has been cancelled.rN)r�r�r�rrr�_timer_handle_cancelled�sz%BaseEventLoop._timer_handle_cancelledc	Cs�t|j�}|tkr`|j|tkr`g}|jD]}|jr<d|_q*|�|�q*t�|�||_d|_n4|jr�|jdjr�|jd8_t�	|j�}d|_q`d}|j
s�|jr�d}n*|jr�|jdj}t
td||���t�}|j�|�}|�|�|��|j}|j�r:|jd}|j|k�r�q:t�	|j�}d|_|j
�|�q�t|j
�}t|�D]|}	|j
��}|j�rf�qL|j�r�zD||_|��}
|��|��|
}||jk�r�t�dt|�|�W5d|_Xn|���qLd}dS)z�Run one full iteration of the event loop.

        This calls all currently ready callbacks, polls for I/O,
        schedules the resulting callbacks, and finally schedules
        'call_later' callbacks.
        FrrNzExecuting %s took %.3f seconds)r�r��_MIN_SCHEDULED_TIMER_HANDLESr��%_MIN_CANCELLED_TIMER_HANDLES_FRACTIONr�r9r�heapify�heappopr�r�Z_whenr=�maxr��MAXIMUM_SELECT_TIMEOUTZ	_selectorZselectr�r��range�popleftr�r�Z_runr�rr�r)rfZsched_countZ
new_scheduledrZtimeoutrr�Zend_timeZntodo�ir+r-rrrr�sj
��





�
zBaseEventLoop._run_oncecCsHt|�t|j�krdS|r2t��|_t�tj�nt�|j�||_dSrB)rkr�r�#get_coroutine_origin_tracking_depthr��#set_coroutine_origin_tracking_depthrZDEBUG_STACK_DEPTH�rfZenabledrrrr�Fs���z,BaseEventLoop._set_coroutine_origin_trackingcCs|jSrB)r�rqrrrr�UszBaseEventLoop.get_debugcCs ||_|��r|�|j|�dSrB)r�r�r�r�r�rrrr�XszBaseEventLoop.set_debug)N)N)NNN)NN)NN)N)r)rN)N)NN)FN)rN)NN)NN)Sr|r}r~rhr�rdr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrUr�r�r�r�rr�r�rrrrrrr�rr#r.r'r0r9r3r5r2rSrirfrnrlrmrqr�r�r$r1rdr�r6Z
AI_PASSIVEr�r�r�r�r�rrr�r�r�r�r�r�r�r�r�rr�r�r�rrrrr�sF���
�
�
�
�
		&	
	�

�
%���
�/�/���	��w��%�"29Nr)rr)r)7�__doc__rFZcollections.abcZconcurrent.futuresrr\rrKr�r$r�rrr�r�rr�r�rT�ImportErrorr.rrrrrrr	r
rrr
�logr�__all__r�r�r#r8r��objectr�rr!r+rArPrXr[ZProtocolr\ZAbstractServerrZAbstractEventLooprrrrr�<module>sd

		
;


Doasyncio/__pycache__/staggered.cpython-38.opt-2.pyc000064400000003426151153537520015772 0ustar00U

e5dh�
@s�dZddlZddlZddlmZddlmZddlmZddlmZdd�ej	ej
gejfeje
ejejejejeejejefd	�d
d�ZdS))�staggered_race�N�)�events)�
exceptions)�locks)�tasks)�loop)�coro_fns�delayr�returnc	�s��p
t���t|��d�d�g�g�tjtjdd���������fdd�����d��}��|�z<d}|t
��kr�t���IdH\}}t
|�}ql���fW�S�D]}|�	�q�XdS)N)�previous_failedrc	
�s|dk	r6t�tj��t�|����IdHW5QRXzt��\}}Wntk
r\YdSXt	�
�}���|��}��|���d�z|�IdH}WnJt
tfk
r��Yn\tk
r�}z|�|<|��W5d}~XYn,X|�|�t��D]\}}||kr�|��q�dS)N)�
contextlib�suppress�exceptions_mod�TimeoutErrorrZwait_for�wait�next�
StopIterationr�Event�create_task�append�
SystemExit�KeyboardInterrupt�
BaseException�set�	enumerate�cancel)	rZ
this_indexZcoro_fnZthis_failedZ	next_task�result�e�i�t�r
Z
enum_coro_fnsrr�run_one_coroZ
running_tasksZwinner_indexZ
winner_result��)/usr/lib64/python3.8/asyncio/staggered.pyr"Rs. 

z$staggered_race.<locals>.run_one_coror)
rZget_running_loopr�typing�Optionalrrrrr�lenrr)r	r
rZ
first_taskr Z
done_countZdone�_r#r!r$rs(=
�0
r)�__all__r
r%�rrrrr�Iterable�Callable�	Awaitabler&�floatZAbstractEventLoopZTupleZAny�intZList�	Exceptionrr#r#r#r$�<module>s$����asyncio/__pycache__/streams.cpython-38.pyc000064400000050242151153537520014541 0ustar00U

e5d h�@s&dZddlZddlZddlZddlZeed�r6ed7ZddlmZddlmZddlm	Z	dd	lm
Z
dd
lmZddlm
Z
ddlmZd
Zdded�dd�Zd ded�dd�Zeed�r�d!ded�dd�Zd"ded�dd�ZGdd�dej�ZGdd�deej�ZGdd�d�ZGdd�d�ZdS)#)�StreamReader�StreamWriter�StreamReaderProtocol�open_connection�start_server�NZAF_UNIX)�open_unix_connection�start_unix_server�)�
coroutines)�events)�
exceptions)�format_helpers)�	protocols)�logger)�sleepi)�loop�limitc	�st|dkrt��}ntjdtdd�t||d�}t||d��|j�fdd�||f|�IdH\}}t|�||�}||fS)	a�A wrapper for create_connection() returning a (reader, writer) pair.

    The reader returned is a StreamReader instance; the writer is a
    StreamWriter instance.

    The arguments are all the usual arguments to create_connection()
    except protocol_factory; most common are positional host and port,
    with various optional keyword arguments following.

    Additional optional keyword arguments are loop (to set the event loop
    instance to use) and limit (to set the buffer limit passed to the
    StreamReader).

    (If you want to customize the StreamReader and/or
    StreamReaderProtocol classes, just copy the code -- there's
    really nothing special here except some convenience.)
    N�[The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.���
stacklevel�rr�rcs�S�N�r��protocolr�'/usr/lib64/python3.8/asyncio/streams.py�<lambda>5�z!open_connection.<locals>.<lambda>)	r�get_event_loop�warnings�warn�DeprecationWarningrrZcreate_connectionr)	�host�portrr�kwds�reader�	transport�_�writerrrrrs"
�
��rc�sJ�dkrt���ntjdtdd����fdd�}�j|||f|�IdHS)a�Start a socket server, call back for each client connected.

    The first parameter, `client_connected_cb`, takes two parameters:
    client_reader, client_writer.  client_reader is a StreamReader
    object, while client_writer is a StreamWriter object.  This
    parameter can either be a plain callback function or a coroutine;
    if it is a coroutine, it will be automatically converted into a
    Task.

    The rest of the arguments are all the usual arguments to
    loop.create_server() except protocol_factory; most common are
    positional host and port, with various optional keyword arguments
    following.  The return value is the same as loop.create_server().

    Additional optional keyword arguments are loop (to set the event loop
    instance to use) and limit (to set the buffer limit passed to the
    StreamReader).

    The return value is the same as loop.create_server(), i.e. a
    Server object which can be used to stop the service.
    Nrrrcst��d�}t|��d�}|S�Nrr�rr�r'r��client_connected_cbrrrr�factoryXs
�zstart_server.<locals>.factory)rr r!r"r#Z
create_server)r/r$r%rrr&r0rr.rr:s
�rc�sr|dkrt��}ntjdtdd�t||d�}t||d��|j�fdd�|f|�IdH\}}t|�||�}||fS)	z@Similar to `open_connection` but works with UNIX Domain Sockets.Nrrrrrcs�Srrrrrrrprz&open_unix_connection.<locals>.<lambda>)	rr r!r"r#rrZcreate_unix_connectionr)�pathrrr&r'r(r)r*rrrrds 
�
��rc�sH�dkrt���ntjdtdd����fdd�}�j||f|�IdHS)z=Similar to `start_server` but works with UNIX Domain Sockets.Nrrrcst��d�}t|��d�}|Sr+r,r-r.rrr0~s
�z"start_unix_server.<locals>.factory)rr r!r"r#Zcreate_unix_server)r/r1rrr&r0rr.rrts
�rc@sBeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�FlowControlMixina)Reusable flow control logic for StreamWriter.drain().

    This implements the protocol methods pause_writing(),
    resume_writing() and connection_lost().  If the subclass overrides
    these it must call the super methods.

    StreamWriter.drain() must wait for _drain_helper() coroutine.
    NcCs0|dkrt��|_n||_d|_d|_d|_dS�NF)rr �_loop�_paused�
_drain_waiter�_connection_lost)�selfrrrr�__init__�szFlowControlMixin.__init__cCs*|jr
t�d|_|j��r&t�d|�dS)NTz%r pauses writing)r5�AssertionErrorr4�	get_debugr�debug�r8rrr�
pause_writing�s

zFlowControlMixin.pause_writingcCsP|js
t�d|_|j��r&t�d|�|j}|dk	rLd|_|��sL|�d�dS)NFz%r resumes writing)	r5r:r4r;rr<r6�done�
set_result�r8�waiterrrr�resume_writing�s

zFlowControlMixin.resume_writingcCsVd|_|jsdS|j}|dkr"dSd|_|��r4dS|dkrH|�d�n
|�|�dS�NT)r7r5r6r?r@�
set_exception�r8�excrBrrr�connection_lost�sz FlowControlMixin.connection_lostc�sP|jrtd��|jsdS|j}|dks2|��s2t�|j��}||_|IdHdS)NzConnection lost)r7�ConnectionResetErrorr5r6�	cancelledr:r4�
create_futurerArrr�
_drain_helper�s
zFlowControlMixin._drain_helpercCst�dSr)�NotImplementedError�r8�streamrrr�_get_close_waiter�sz"FlowControlMixin._get_close_waiter)N)
�__name__�
__module__�__qualname__�__doc__r9r>rCrHrLrPrrrrr2�s	
	r2csfeZdZdZdZd�fdd�	Zedd��Zdd�Z�fd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
�ZS)ra=Helper class to adapt between Protocol and StreamReader.

    (This is a helper class instead of making StreamReader itself a
    Protocol subclass, because the StreamReader has other potential
    uses, and to prevent the user of the StreamReader to accidentally
    call inappropriate methods of the protocol.)
    Ncsnt�j|d�|dk	r,t�|�|_|j|_nd|_|dk	r@||_d|_d|_d|_	||_
d|_|j�
�|_dS)NrF)�superr9�weakref�ref�_stream_reader_wr�_source_traceback�_strong_reader�_reject_connection�_stream_writer�
_transport�_client_connected_cb�	_over_sslr4rK�_closed)r8Z
stream_readerr/r��	__class__rrr9�s
zStreamReaderProtocol.__init__cCs|jdkrdS|��Sr)rXr=rrr�_stream_reader�s
z#StreamReaderProtocol._stream_readercCs�|jr6ddi}|jr|j|d<|j�|�|��dS||_|j}|dk	rT|�|�|�d�dk	|_	|j
dk	r�t||||j�|_|�
||j�}t
�|�r�|j�|�d|_dS)N�messagezpAn open stream was garbage collected prior to establishing network connection; call "stream.close()" explicitly.Zsource_tracebackZ
sslcontext)r[rYr4Zcall_exception_handler�abortr]rc�
set_transport�get_extra_infor_r^rr\r
ZiscoroutineZcreate_taskrZ)r8r(�contextr'�resrrr�connection_made�s2�


��
z$StreamReaderProtocol.connection_madecsx|j}|dk	r*|dkr |��n
|�|�|j��sV|dkrJ|j�d�n|j�|�t��|�d|_d|_	d|_
dSr)rc�feed_eofrEr`r?r@rUrHrXr\r])r8rGr'rarrrH
s


z$StreamReaderProtocol.connection_lostcCs|j}|dk	r|�|�dSr)rc�	feed_data)r8�datar'rrr�
data_receivedsz"StreamReaderProtocol.data_receivedcCs$|j}|dk	r|��|jr dSdS)NFT)rcrkr_)r8r'rrr�eof_received sz!StreamReaderProtocol.eof_receivedcCs|jSr)r`rNrrrrP+sz&StreamReaderProtocol._get_close_waitercCs"|j}|��r|��s|��dSr)r`r?rJ�	exception)r8�closedrrr�__del__.szStreamReaderProtocol.__del__)NN)rQrRrSrTrYr9�propertyrcrjrHrnrorPrr�
__classcell__rrrarr�s
rc@sveZdZdZdd�Zdd�Zedd��Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zddd�Zdd�ZdS)ra'Wraps a Transport.

    This exposes write(), writelines(), [can_]write_eof(),
    get_extra_info() and close().  It adds drain() which returns an
    optional Future on which you can wait for flow control.  It also
    adds a transport property which references the Transport
    directly.
    cCsJ||_||_|dks"t|t�s"t�||_||_|j��|_|j�	d�dSr)
r]�	_protocol�
isinstancerr:�_readerr4rKZ
_complete_futr@)r8r(rr'rrrrr9@szStreamWriter.__init__cCs@|jjd|j��g}|jdk	r0|�d|j���d�d�|��S)N�
transport=zreader=�<{}>� )rbrQr]rw�append�format�join�r8�inforrr�__repr__Js
zStreamWriter.__repr__cCs|jSr)r]r=rrrr(PszStreamWriter.transportcCs|j�|�dSr)r]�write�r8rmrrrr�TszStreamWriter.writecCs|j�|�dSr)r]�
writelinesr�rrrr�WszStreamWriter.writelinescCs
|j��Sr)r]�	write_eofr=rrrr�ZszStreamWriter.write_eofcCs
|j��Sr)r]�
can_write_eofr=rrrr�]szStreamWriter.can_write_eofcCs
|j��Sr)r]�closer=rrrr�`szStreamWriter.closecCs
|j��Sr)r]�
is_closingr=rrrr�cszStreamWriter.is_closingc�s|j�|�IdHdSr)rurPr=rrr�wait_closedfszStreamWriter.wait_closedNcCs|j�||�Sr)r]rg)r8�name�defaultrrrrgiszStreamWriter.get_extra_infoc�sL|jdk	r |j��}|dk	r |�|j��r8td�IdH|j��IdHdS)zyFlush the write buffer.

        The intended use is to write

          w.write(data)
          await w.drain()
        Nr)rwrpr]r�rrurL)r8rGrrr�drainls



zStreamWriter.drain)N)rQrRrSrTr9r�rsr(r�r�r�r�r�r�r�rgr�rrrrr6s	


rc@s�eZdZdZedfdd�Zdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd&dd�Zd'dd�Zd d!�Zd"d#�Zd$d%�ZdS)(rNcCsv|dkrtd��||_|dkr*t��|_n||_t�|_d|_d|_d|_	d|_
d|_|j��rrt
�t�d��|_dS)NrzLimit cannot be <= 0Fr	)�
ValueError�_limitrr r4�	bytearray�_buffer�_eof�_waiter�
_exceptionr]r5r;r
�
extract_stack�sys�	_getframerY)r8rrrrrr9�s 
�zStreamReader.__init__cCs�dg}|jr"|�t|j��d��|jr2|�d�|jtkrN|�d|j���|jrf|�d|j���|jr~|�d|j���|jr�|�d|j���|j	r�|�d�d	�
d
�|��S)Nrz bytes�eofzlimit=zwaiter=z
exception=rxZpausedryrz)r�r{�lenr�r��_DEFAULT_LIMITr�r�r]r5r|r}r~rrrr��s 


zStreamReader.__repr__cCs|jSr)r�r=rrrrp�szStreamReader.exceptioncCs0||_|j}|dk	r,d|_|��s,|�|�dSr)r�r�rJrErFrrrrE�szStreamReader.set_exceptioncCs*|j}|dk	r&d|_|��s&|�d�dS)z1Wakeup read*() functions waiting for data or EOF.N)r�rJr@rArrr�_wakeup_waiter�s
zStreamReader._wakeup_waitercCs|jdkstd��||_dS)NzTransport already set)r]r:)r8r(rrrrf�szStreamReader.set_transportcCs*|jr&t|j�|jkr&d|_|j��dSr3)r5r�r�r�r]�resume_readingr=rrr�_maybe_resume_transport�sz$StreamReader._maybe_resume_transportcCsd|_|��dSrD)r�r�r=rrrrk�szStreamReader.feed_eofcCs|jo|jS)z=Return True if the buffer is empty and 'feed_eof' was called.)r�r�r=rrr�at_eof�szStreamReader.at_eofcCs�|jrtd��|sdS|j�|�|��|jdk	r~|js~t|j�d|jkr~z|j�	�Wnt
k
rvd|_YnXd|_dS)Nzfeed_data after feed_eofrT)r�r:r��extendr�r]r5r�r�Z
pause_readingrMr�rrrrl�s
��zStreamReader.feed_datac�sf|jdk	rt|�d���|jr&td��|jr<d|_|j��|j��|_z|jIdHW5d|_XdS)zpWait until feed_data() or feed_eof() is called.

        If stream was paused, automatically resume it.
        NzF() called while another coroutine is already waiting for incoming dataz_wait_for_data after EOFF)	r��RuntimeErrorr�r:r5r]r�r4rK)r8Z	func_namerrr�_wait_for_data�s	
�
zStreamReader._wait_for_datac
�s�d}t|�}z|�|�IdH}Wn�tjk
rN}z|jWY�Sd}~XYnhtjk
r�}zH|j�||j�r�|jd|j|�=n
|j�	�|�
�t|jd��W5d}~XYnX|S)a�Read chunk of data from the stream until newline (b'
') is found.

        On success, return chunk that ends with newline. If only partial
        line can be read due to EOF, return incomplete line without
        terminating newline. When EOF was reached while no bytes read, empty
        bytes object is returned.

        If limit is reached, ValueError will be raised. In that case, if
        newline was found, complete line including newline will be removed
        from internal buffer. Else, internal buffer will be cleared. Limit is
        compared against part of the line without newline.

        If stream was paused, this function will automatically resume it if
        needed.
        �
Nr)
r��	readuntilr�IncompleteReadError�partial�LimitOverrunErrorr��
startswith�consumed�clearr�r��args)r8�sep�seplen�line�errr�readline	s
 zStreamReader.readliner�c�s�t|�}|dkrtd��|jdk	r(|j�d}t|j�}|||kr||j�||�}|dkrZq�|d|}||jkr|t�d|��|jr�t	|j�}|j�
�t�|d��|�d�IdHq,||jkr�t�d|��|jd||�}|jd||�=|�
�t	|�S)	aVRead data from the stream until ``separator`` is found.

        On success, the data and separator will be removed from the
        internal buffer (consumed). Returned data will include the
        separator at the end.

        Configured stream limit is used to check result. Limit sets the
        maximal length of data that can be returned, not counting the
        separator.

        If an EOF occurs and the complete separator is still not found,
        an IncompleteReadError exception will be raised, and the internal
        buffer will be reset.  The IncompleteReadError.partial attribute
        may contain the separator partially.

        If the data cannot be read because of over limit, a
        LimitOverrunError exception  will be raised, and the data
        will be left in the internal buffer, so it can be read again.
        rz,Separator should be at least one-byte stringN���r	z2Separator is not found, and chunk exceed the limitr�z2Separator is found, but chunk is longer than limit)r�r�r�r��findr�rr�r��bytesr�r�r�r�)r8Z	separatorr��offsetZbuflenZisep�chunkrrrr�(s>


�


�zStreamReader.readuntilr�c�s�|jdk	r|j�|dkrdS|dkrVg}|�|j�IdH}|s@qL|�|�q(d�|�S|jsr|jsr|�d�IdHt|jd|��}|jd|�=|�	�|S)a�Read up to `n` bytes from the stream.

        If n is not provided, or set to -1, read until EOF and return all read
        bytes. If the EOF was received and the internal buffer is empty, return
        an empty bytes object.

        If n is zero, return empty bytes object immediately.

        If n is positive, this function try to read `n` bytes, and may return
        less or equal bytes than requested, but at least one byte. If EOF was
        received before any byte is read, this function returns empty byte
        object.

        Returned value is not limited with limit, configured at stream
        creation.

        If stream was paused, this function will automatically resume it if
        needed.
        Nrr�read)
r�r�r�r{r}r�r�r�r�r�)r8�nZblocks�blockrmrrrr��s"

zStreamReader.readc�s�|dkrtd��|jdk	r |j�|dkr,dSt|j�|krr|jr`t|j�}|j��t�||��|�	d�IdHq,t|j�|kr�t|j�}|j��nt|jd|��}|jd|�=|�
�|S)a�Read exactly `n` bytes.

        Raise an IncompleteReadError if EOF is reached before `n` bytes can be
        read. The IncompleteReadError.partial attribute of the exception will
        contain the partial read bytes.

        if n is zero, return empty bytes object.

        Returned value is not limited with limit, configured at stream
        creation.

        If stream was paused, this function will automatically resume it if
        needed.
        rz*readexactly size can not be less than zeroNr�readexactly)r�r�r�r�r�r�r�rr�r�r�)r8r�Z
incompletermrrrr��s&



zStreamReader.readexactlycCs|Srrr=rrr�	__aiter__�szStreamReader.__aiter__c�s|��IdH}|dkrt�|S)Nr)r��StopAsyncIteration)r8�valrrr�	__anext__�szStreamReader.__anext__)r�)r�)rQrRrSrYr�r9r�rprEr�rfr�rkr�rlr�r�r�r�r�r�r�rrrrr�s$	
[
2)r)NN)NN)N)N)�__all__Zsocketr�r!rV�hasattr�r
rrr
r�logrZtasksrr�rrrrZProtocolr2rrrrrrr�<module>sF
�!�'
��DkPasyncio/__pycache__/base_events.cpython-38.opt-1.pyc000064400000143154151153537520016325 0ustar00U

e5d��@s�dZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZzddlZWnek
r�dZYnXddlmZddlmZddlmZddlmZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZddlmZddl m!Z!dZ"dZ#dZ$e%e	d�Z&dZ'e(�Z)dd�Z*dd�Z+dd�Z,d+dd�Z-d,dd�Z.dd �Z/e%e	d!��r�d"d#�Z0nd$d#�Z0Gd%d&�d&ej1�Z2Gd'd(�d(ej3�Z4Gd)d*�d*ej5�Z6dS)-a�Base implementation of event loop.

The event loop can be broken up into a multiplexer (the part
responsible for notifying us of I/O events) and the event loop proper,
which wraps a multiplexer with functionality for scheduling callbacks,
immediately or at a given time in the future.

Whenever a public API takes a callback, subsequent positional
arguments will be passed to the callback if/when it is called.  This
avoids the proliferation of trivial lambdas implementing closures.
Keyword arguments for the callback are not supported; this is a
conscious design decision, leaving the door open for keyword arguments
to modify the meaning of the API call itself.
�N�)�	constants)�
coroutines)�events)�
exceptions)�futures)�	protocols)�sslproto)�	staggered)�tasks)�
transports)�trsock)�logger)�
BaseEventLoop�dg�?�AF_INET6i�QcCs0|j}tt|dd�tj�r$t|j�St|�SdS)N�__self__)Z	_callback�
isinstance�getattrr�Task�reprr�str)�handle�cb�r�+/usr/lib64/python3.8/asyncio/base_events.py�_format_handleJs
rcCs(|tjkrdS|tjkrdSt|�SdS)Nz<pipe>z<stdout>)�
subprocess�PIPE�STDOUTr)�fdrrr�_format_pipeSs


r!cCsLttd�std��n4z|�tjtjd�Wntk
rFtd��YnXdS)N�SO_REUSEPORTz)reuse_port not supported by socket modulerzTreuse_port not supported by socket module, SO_REUSEPORT defined but not implemented.)�hasattr�socket�
ValueError�
setsockopt�
SOL_SOCKETr"�OSError��sockrrr�_set_reuseport\s

r+c		Cs�ttd�sdS|dtjtjhks(|dkr,dS|tjkr>tj}n|tjkrPtj}ndS|dkrbd}nXt|t�rz|dkrzd}n@t|t�r�|dkr�d}n(zt	|�}Wnt
tfk
r�YdSX|tjkr�tj
g}tr�|�tj�n|g}t|t�r�|�d�}d|k�rdS|D]t}zVt�||�t�rJ|tjk�rJ|||d||||ffWS|||d||ffWSWntk
�rzYnX�q
dS)N�	inet_ptonr��Zidna�%)r#r$�IPPROTO_TCPZIPPROTO_UDP�SOCK_STREAM�
SOCK_DGRAMr�bytesr�int�	TypeErrorr%�	AF_UNSPEC�AF_INET�	_HAS_IPv6�appendr�decoder,r()	�host�port�family�type�protoZflowinfoZscopeidZafs�afrrr�_ipaddr_infogsN
�






rAcCs�t��}|D]*}|d}||kr(g||<||�|�qt|���}g}|dkr||�|dd|d��|dd|d�=|�dd�tj�tj	|��D��|S)z-Interleave list of addrinfo tuples by family.rrNcss|]}|dk	r|VqdS�Nr)�.0�arrr�	<genexpr>�s�z(_interleave_addrinfos.<locals>.<genexpr>)
�collections�OrderedDictr9�list�values�extend�	itertools�chain�
from_iterable�zip_longest)Z	addrinfosZfirst_address_family_countZaddrinfos_by_family�addrr=Zaddrinfos_listsZ	reorderedrrr�_interleave_addrinfos�s"
��rPcCs4|��s"|��}t|ttf�r"dSt�|���dSrB)�	cancelled�	exceptionr�
SystemExit�KeyboardInterruptrZ	_get_loop�stop)�fut�excrrr�_run_until_complete_cb�s
rX�TCP_NODELAYcCs@|jtjtjhkr<|jtjkr<|jtjkr<|�tjtj	d�dS�Nr)
r=r$r7rr>r1r?r0r&rYr)rrr�_set_nodelay�s
�
�r[cCsdSrBrr)rrrr[�sc@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�_SendfileFallbackProtocolcCsht|tj�std��||_|��|_|��|_|j	|_
|��|�|�|j
r^|jj
��|_nd|_dS)Nz.transport should be _FlowControlMixin instance)rrZ_FlowControlMixinr5�
_transportZget_protocol�_protoZ
is_reading�_should_resume_readingZ_protocol_paused�_should_resume_writing�
pause_reading�set_protocol�_loop�
create_future�_write_ready_fut)�self�transprrr�__init__�s


z"_SendfileFallbackProtocol.__init__c�s2|j��rtd��|j}|dkr$dS|IdHdS)NzConnection closed by peer)r]�
is_closing�ConnectionErrorre)rfrVrrr�drain�s
z_SendfileFallbackProtocol.draincCstd��dS)Nz?Invalid state: connection should have been established already.��RuntimeError)rf�	transportrrr�connection_made�sz)_SendfileFallbackProtocol.connection_madecCs@|jdk	r0|dkr$|j�td��n|j�|�|j�|�dS)NzConnection is closed by peer)reZ
set_exceptionrjr^�connection_lost)rfrWrrrrp�s
�z)_SendfileFallbackProtocol.connection_lostcCs |jdk	rdS|jj��|_dSrB)rer]rcrd�rfrrr�
pause_writing�s
z'_SendfileFallbackProtocol.pause_writingcCs$|jdkrdS|j�d�d|_dS)NF)re�
set_resultrqrrr�resume_writing�s
z(_SendfileFallbackProtocol.resume_writingcCstd��dS�Nz'Invalid state: reading should be pausedrl)rf�datarrr�
data_received�sz'_SendfileFallbackProtocol.data_receivedcCstd��dSrurlrqrrr�eof_receivedsz&_SendfileFallbackProtocol.eof_receivedc�sF|j�|j�|jr|j��|jdk	r2|j��|jrB|j��dSrB)	r]rbr^r_�resume_readingre�cancelr`rtrqrrr�restores


z!_SendfileFallbackProtocol.restoreN)�__name__�
__module__�__qualname__rhrkrorprrrtrwrxr{rrrrr\�sr\c@sxeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
edd��Zdd�Z
dd�Zdd�Zdd�ZdS)�ServercCs@||_||_d|_g|_||_||_||_||_d|_d|_	dS)NrF)
rc�_sockets�
_active_count�_waiters�_protocol_factory�_backlog�_ssl_context�_ssl_handshake_timeout�_serving�_serving_forever_fut)rf�loop�sockets�protocol_factoryZssl_context�backlog�ssl_handshake_timeoutrrrrhszServer.__init__cCsd|jj�d|j�d�S)N�<z	 sockets=�>)�	__class__r|r�rqrrr�__repr__ szServer.__repr__cCs|jd7_dSrZ)r�rqrrr�_attach#szServer._attachcCs.|jd8_|jdkr*|jdkr*|��dS)Nrr)r�r��_wakeuprqrrr�_detach'szServer._detachcCs,|j}d|_|D]}|��s|�|�qdSrB)r��doners)rf�waiters�waiterrrrr�-s
zServer._wakeupc	CsJ|jr
dSd|_|jD].}|�|j�|j�|j||j||j|j�qdS)NT)	r�r�Zlistenr�rc�_start_servingr�r�r�)rfr*rrrr�4s
�zServer._start_servingcCs|jSrB)rcrqrrr�get_loop>szServer.get_loopcCs|jSrB)r�rqrrr�
is_servingAszServer.is_servingcCs"|jdkrdStdd�|jD��S)Nrcss|]}t�|�VqdSrB)r
ZTransportSocket)rC�srrrrEHsz!Server.sockets.<locals>.<genexpr>)r��tuplerqrrrr�Ds
zServer.socketscCsn|j}|dkrdSd|_|D]}|j�|�qd|_|jdk	rX|j��sX|j��d|_|jdkrj|��dS)NFr)	r�rcZ
_stop_servingr�r�r�rzr�r�)rfr�r*rrr�closeJs
�

zServer.closec�s"|��tjd|jd�IdHdS)Nr�r�)r�r�sleeprcrqrrr�
start_serving]szServer.start_servingc	�s�|jdk	rtd|�d���|jdkr4td|�d���|��|j��|_zLz|jIdHWn6tjk
r�z|��|�	�IdHW5�XYnXW5d|_XdS)Nzserver z, is already being awaited on serve_forever()z
 is closed)
r�rmr�r�rcrdrZCancelledErrorr��wait_closedrqrrr�
serve_forevercs 

�
zServer.serve_foreverc�s<|jdks|jdkrdS|j��}|j�|�|IdHdSrB)r�r�rcrdr9)rfr�rrrr�xs

zServer.wait_closedN)r|r}r~rhr�r�r�r�r�r�r��propertyr�r�r�r�r�rrrrrs


rc@sPeZdZdd�Zdd�Zdd�Zdd�d	d
�Zdd�Zd
d�Zd�ddd�dd�Z	d�ddddddd�dd�Z
d�dd�Zd�dd�Zd�dd�Z
d�dd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zejfd7d8�Zd9d:�Zd;d<�Zdd=�d>d?�Z dd=�d@dA�Z!dd=�dBdC�Z"dDdE�Z#dFdG�Z$dHdI�Z%dd=�dJdK�Z&dLdM�Z'dNdO�Z(dPdQ�Z)dRdRdRdRdS�dTdU�Z*d�dVdW�Z+d�ddX�dYdZ�Z,d[d\�Z-d]d^�Z.d_d`�Z/d�dadb�Z0d�ddRdRdRdddddddc�
ddde�Z1d�dfdg�Z2d�ddX�dhdi�Z3djdk�Z4dldm�Z5ddddn�dodp�Z6d�dRdRdRe7ddddq�drds�Z8dRe9j:dRdRdS�dtdu�Z;dvdw�Z<d�e9j=e9j>ddxddddddy�	dzd{�Z?ddd|�d}d~�Z@dd��ZAd�d��ZBd�d��ZCeDjEeDjEeDjEdddRdddd��	d�d��ZFeDjEeDjEeDjEdddRdddd��	d�d��ZGd�d��ZHd�d��ZId�d��ZJd�d��ZKd�d��ZLd�d��ZMd�d��ZNd�d��ZOd�d��ZPd�d��ZQd�d��ZRdS)�rcCs�d|_d|_d|_t��|_g|_d|_d|_d|_	t
�d�j|_
d|_|�t���d|_d|_d|_d|_d|_t��|_d|_dS)NrF�	monotonicg�������?)�_timer_cancelled_count�_closed�	_stoppingrF�deque�_ready�
_scheduled�_default_executorZ
_internal_fds�
_thread_id�time�get_clock_infoZ
resolution�_clock_resolution�_exception_handler�	set_debugrZ_is_debug_mode�slow_callback_duration�_current_handle�
_task_factory�"_coroutine_origin_tracking_enabled�&_coroutine_origin_tracking_saved_depth�weakrefZWeakSet�
_asyncgens�_asyncgens_shutdown_calledrqrrrrh�s$

zBaseEventLoop.__init__c	Cs.d|jj�d|���d|���d|���d�	S)Nr�z	 running=z closed=z debug=r�)r�r|�
is_running�	is_closed�	get_debugrqrrrr��s,�zBaseEventLoop.__repr__cCstj|d�S)z,Create a Future object attached to the loop.r�)rZFuturerqrrrrd�szBaseEventLoop.create_futureN)�namecCsN|��|jdkr2tj|||d�}|jrJ|jd=n|�||�}t�||�|S)zDSchedule a coroutine object.

        Return a task object.
        N)r�r����)�
_check_closedr�rr�_source_tracebackZ_set_task_name)rf�coror�Ztaskrrr�create_task�s

zBaseEventLoop.create_taskcCs"|dk	rt|�std��||_dS)awSet a task factory that will be used by loop.create_task().

        If factory is None the default task factory will be set.

        If factory is a callable, it should have a signature matching
        '(loop, coro)', where 'loop' will be a reference to the active
        event loop, 'coro' will be a coroutine object.  The callable
        must return a Future.
        Nz'task factory must be a callable or None)�callabler5r�)rf�factoryrrr�set_task_factory�s
zBaseEventLoop.set_task_factorycCs|jS)z<Return a task factory, or None if the default one is in use.)r�rqrrr�get_task_factory�szBaseEventLoop.get_task_factory)�extra�servercCst�dS)zCreate socket transport.N��NotImplementedError)rfr*�protocolr�r�r�rrr�_make_socket_transport�sz$BaseEventLoop._make_socket_transportFT)�server_side�server_hostnamer�r�r��call_connection_madecCst�dS)zCreate SSL transport.Nr�)rfZrawsockr��
sslcontextr�r�r�r�r�r�r�rrr�_make_ssl_transport�sz!BaseEventLoop._make_ssl_transportcCst�dS)zCreate datagram transport.Nr�)rfr*r��addressr�r�rrr�_make_datagram_transport�sz&BaseEventLoop._make_datagram_transportcCst�dS)zCreate read pipe transport.Nr��rf�piper�r�r�rrr�_make_read_pipe_transport�sz'BaseEventLoop._make_read_pipe_transportcCst�dS)zCreate write pipe transport.Nr�r�rrr�_make_write_pipe_transport�sz(BaseEventLoop._make_write_pipe_transportc	
�st�dS)zCreate subprocess transport.Nr�)
rfr��args�shell�stdin�stdout�stderr�bufsizer��kwargsrrr�_make_subprocess_transport�sz(BaseEventLoop._make_subprocess_transportcCst�dS)z�Write a byte to self-pipe, to wake up the event loop.

        This may be called from a different thread.

        The subclass is responsible for implementing the self-pipe.
        Nr�rqrrr�_write_to_self�szBaseEventLoop._write_to_selfcCst�dS)zProcess selector events.Nr�)rf�
event_listrrr�_process_events�szBaseEventLoop._process_eventscCs|jrtd��dS)NzEvent loop is closed)r�rmrqrrrr��szBaseEventLoop._check_closedcCs*|j�|�|��s&|�|j|���dSrB)r��discardr��call_soon_threadsafer��aclose�rf�agenrrr�_asyncgen_finalizer_hook�sz&BaseEventLoop._asyncgen_finalizer_hookcCs.|jrtjd|�d�t|d�|j�|�dS)Nzasynchronous generator z3 was scheduled after loop.shutdown_asyncgens() call��source)r��warnings�warn�ResourceWarningr��addr�rrr�_asyncgen_firstiter_hooks
�z&BaseEventLoop._asyncgen_firstiter_hookc�s�d|_t|j�sdSt|j�}|j��tjdd�|D�d|d��IdH}t||�D]*\}}t|t	�rT|�
d|��||d��qTdS)z,Shutdown all active asynchronous generators.TNcSsg|]}|���qSr)r�)rCZagrrr�
<listcomp>sz4BaseEventLoop.shutdown_asyncgens.<locals>.<listcomp>)Zreturn_exceptionsr�z;an error occurred during closing of asynchronous generator )�messagerRZasyncgen)r��lenr�rH�clearr�gather�zipr�	Exception�call_exception_handler)rfZ
closing_agensZresults�resultr�rrr�shutdown_asyncgenss"


�
�z BaseEventLoop.shutdown_asyncgenscCs(|��rtd��t��dk	r$td��dS)Nz"This event loop is already runningz7Cannot run the event loop while another loop is running)r�rmrZ_get_running_looprqrrr�_check_running&s�zBaseEventLoop._check_runningc	Cs�|��|��|�|j�t��|_t��}tj	|j
|jd�z t
�|�|��|jrLq^qLW5d|_d|_t
�d�|�d�tj	|�XdS)zRun until stop() is called.)�	firstiter�	finalizerFN)r�r��_set_coroutine_origin_tracking�_debug�	threading�	get_identr��sys�get_asyncgen_hooks�set_asyncgen_hooksr�r�r�rZ_set_running_loop�	_run_once)rfZold_agen_hooksrrr�run_forever-s$
�


zBaseEventLoop.run_foreverc	Cs�|��|��t�|�}tj||d�}|r4d|_|�t�z<z|�
�Wn*|rp|��rp|��sp|�
��YnXW5|�	t�X|��s�td��|��S)a\Run until the Future is done.

        If the argument is a coroutine, it is wrapped in a Task.

        WARNING: It would be disastrous to call run_until_complete()
        with the same coroutine twice -- it would wrap it in two
        different Tasks and that can't be good.

        Return the Future's result, or raise its exception.
        r�Fz+Event loop stopped before Future completed.)r�r�rZisfuturerZ
ensure_futureZ_log_destroy_pendingZadd_done_callbackrXZremove_done_callbackrr�rQrRrmr�)rfZfutureZnew_taskrrr�run_until_completeDs"
z BaseEventLoop.run_until_completecCs
d|_dS)z�Stop running the event loop.

        Every callback already scheduled will still run.  This simply informs
        run_forever to stop looping after a complete iteration.
        TN)r�rqrrrrUjszBaseEventLoop.stopcCsj|��rtd��|jrdS|jr,t�d|�d|_|j��|j��|j	}|dk	rfd|_	|j
dd�dS)z�Close the event loop.

        This clears the queues and shuts down the executor,
        but does not wait for the executor to finish.

        The event loop must not be running.
        z!Cannot close a running event loopNzClose %rTF)�wait)r�rmr�r�r�debugr�r�r�r�Zshutdown�rf�executorrrrr�rs

zBaseEventLoop.closecCs|jS)z*Returns True if the event loop was closed.)r�rqrrrr��szBaseEventLoop.is_closedcCs0|��s,|d|��t|d�|��s,|��dS)Nzunclosed event loop r�)r�r�r�r�)rfZ_warnrrr�__del__�szBaseEventLoop.__del__cCs
|jdk	S)z*Returns True if the event loop is running.N)r�rqrrrr��szBaseEventLoop.is_runningcCst��S)z�Return the time according to the event loop's clock.

        This is a float expressed in seconds since an epoch, but the
        epoch, precision, accuracy and drift are unspecified and may
        differ per event loop.
        )r�r�rqrrrr��szBaseEventLoop.time)�contextcGs2|j|��||f|�d|i�}|jr.|jd=|S)a8Arrange for a callback to be called at a given time.

        Return a Handle: an opaque object with a cancel() method that
        can be used to cancel the call.

        The delay can be an int or float, expressed in seconds.  It is
        always relative to the current time.

        Each callback will be called exactly once.  If two callbacks
        are scheduled for exactly the same time, it undefined which
        will be called first.

        Any positional arguments after the callback will be passed to
        the callback when it is called.
        rr�)�call_atr�r�)rfZdelay�callbackrr��timerrrr�
call_later�s�zBaseEventLoop.call_latercGsZ|��|jr"|��|�|d�t�|||||�}|jrB|jd=t�|j	|�d|_	|S)z|Like call_later(), but uses an absolute time.

        Absolute time corresponds to the event loop's time() method.
        r
r�T)
r�r��
_check_thread�_check_callbackrZTimerHandler��heapq�heappushr�)rf�whenrrr�rrrrr
�szBaseEventLoop.call_atcGsB|��|jr"|��|�|d�|�|||�}|jr>|jd=|S)aTArrange for a callback to be called as soon as possible.

        This operates as a FIFO queue: callbacks are called in the
        order in which they are registered.  Each callback will be
        called exactly once.

        Any positional arguments after the callback will be passed to
        the callback when it is called.
        �	call_soonr�)r�r�rr�
_call_soonr��rfrrr�rrrrr�s
zBaseEventLoop.call_sooncCsDt�|�st�|�r$td|�d���t|�s@td|�d|����dS)Nzcoroutines cannot be used with z()z"a callable object was expected by z(), got )rZiscoroutineZiscoroutinefunctionr5r�)rfr�methodrrrr�s
�
��zBaseEventLoop._check_callbackcCs.t�||||�}|jr|jd=|j�|�|S)Nr�)rZHandler�r�r9)rfrr�rrrrrr�s
zBaseEventLoop._call_sooncCs,|jdkrdSt��}||jkr(td��dS)aoCheck that the current thread is the thread running the event loop.

        Non-thread-safe methods of this class make this assumption and will
        likely behave incorrectly when the assumption is violated.

        Should only be called when (self._debug == True).  The caller is
        responsible for checking this condition for performance reasons.
        NzMNon-thread-safe operation invoked on an event loop other than the current one)r�r�rrm)rfZ	thread_idrrrr�s	

�zBaseEventLoop._check_threadcGsB|��|jr|�|d�|�|||�}|jr6|jd=|��|S)z"Like call_soon(), but thread-safe.r�r�)r�r�rrr�r�rrrrr��sz"BaseEventLoop.call_soon_threadsafecGsZ|��|jr|�|d�|dkr@|j}|dkr@tj��}||_tj|j|f|��|d�S)N�run_in_executorr�)	r�r�rr��
concurrentr�ThreadPoolExecutorZwrap_futureZsubmit)rfr
�funcr�rrrrs
�zBaseEventLoop.run_in_executorcCs&t|tjj�st�dtd�||_dS)Nz{Using the default executor that is not an instance of ThreadPoolExecutor is deprecated and will be prohibited in Python 3.9�)rrrrr�r��DeprecationWarningr�r	rrr�set_default_executors�z"BaseEventLoop.set_default_executorcCs�|�d|��g}|r$|�d|���|r8|�d|���|rL|�d|���|r`|�d|���d�|�}t�d|�|��}t�||||||�}	|��|}
d|�d	|
d
d�d|	��}|
|jkr�t�|�n
t�|�|	S)
N�:zfamily=ztype=zproto=zflags=�, zGet address info %szGetting address info z took g@�@z.3fzms: )	r9�joinrrr�r$�getaddrinfor��info)rfr;r<r=r>r?�flags�msg�t0�addrinfo�dtrrr�_getaddrinfo_debugs&


z BaseEventLoop._getaddrinfo_debugr�r=r>r?r&c
�s2|jr|j}ntj}|�d|||||||�IdHSrB)r�r+r$r$r)rfr;r<r=r>r?r&Zgetaddr_funcrrrr$2s�zBaseEventLoop.getaddrinfoc�s|�dtj||�IdHSrB)rr$�getnameinfo)rfZsockaddrr&rrrr-<s�zBaseEventLoop.getnameinfo)�fallbackc
�s�|jr|��dkrtd��|�||||�z|�||||�IdHWStjk
rl}z
|s\�W5d}~XYnX|�||||�IdHS)Nrzthe socket must be non-blocking)r�Z
gettimeoutr%�_check_sendfile_params�_sock_sendfile_nativer�SendfileNotAvailableError�_sock_sendfile_fallback)rfr*�file�offset�countr.rWrrr�
sock_sendfile@s��zBaseEventLoop.sock_sendfilec�st�d|�d���dS)Nz-syscall sendfile is not available for socket z and file {file!r} combination�rr1�rfr*r3r4r5rrrr0Ns
�z#BaseEventLoop._sock_sendfile_nativec

�s�|r|�|�|rt|tj�ntj}t|�}d}zt|rNt|||�}|dkrNq�t|�d|�}|�d|j|�IdH}	|	szq�|�	||d|	��IdH||	7}q2|W�S|dkr�t|d�r�|�||�XdS)Nr�seek)
r9�minrZ!SENDFILE_FALLBACK_READBUFFER_SIZE�	bytearrayr#�
memoryviewr�readintoZsock_sendall)
rfr*r3r4r5�	blocksize�buf�
total_sent�view�readrrrr2Us,
��
z%BaseEventLoop._sock_sendfile_fallbackcCs�dt|dd�krtd��|jtjks,td��|dk	rbt|t�sLtd�|���|dkrbtd�|���t|t�sztd�|���|dkr�td�|���dS)N�b�modez$file should be opened in binary modez+only SOCK_STREAM type sockets are supportedz+count must be a positive integer (got {!r})rz0offset must be a non-negative integer (got {!r}))	rr%r>r$r1rr4r5�formatr8rrrr/os2
��
����z$BaseEventLoop._check_sendfile_paramsc�s@g}|�|�|\}}}}}	d}
z�tj|||d�}
|
�d�|dk	r�|D]r\}}}}}z|
�|�Wq�WqHtk
r�}z0d|�d|j����}
t|j|
�}|�|�W5d}~XYqHXqH|���|�	|
|	�IdH|
WStk
�r}z"|�|�|
dk	�r
|
�
��W5d}~XYn |
dk	�r4|
�
��YnXdS)z$Create, bind and connect one socket.N�r=r>r?Fz*error while attempting to bind on address �: )r9r$�setblocking�bindr(�strerror�lower�errno�pop�sock_connectr�)rfrZ	addr_infoZlocal_addr_infosZ
my_exceptionsr=Ztype_r?�_r�r*ZladdrrWr'rrr�
_connect_sock�s:



�


zBaseEventLoop._connect_sock)
�sslr=r?r&r*�
local_addrr�r��happy_eyeballs_delay�
interleavec
	�sl|
dk	r|std��|
dkr0|r0|s,td��|}
|dk	rD|sDtd��|dk	rX|
dkrXd}
|dk	sj|dk	�r�|dk	rztd���j||f|tj||�d�IdH}|s�td��|	dk	r܈j|	|tj||�d�IdH��s�td��nd�|
r�t||
�}g�|dk�rH|D]D}z ���|��IdH}W�qvWntk
�r@Y�qYnX�qn.tj���fd	d
�|D�|�d�IdH\}}}|dk�r dd
��D��t	��dk�r��d�nJt
�d��t�fdd
��D���r҈d�td�d�
dd
��D�����n.|dk�rtd��|jtjk�r td|�����j||||
|d�IdH\}}�j�rd|�d�}t�d|||||�||fS)a�Connect to a TCP server.

        Create a streaming transport connection to a given Internet host and
        port: socket family AF_INET or socket.AF_INET6 depending on host (or
        family if specified), socket type SOCK_STREAM. protocol_factory must be
        a callable returning a protocol instance.

        This method is a coroutine which will try to establish the connection
        in the background.  When successful, the coroutine returns a
        (transport, protocol) pair.
        Nz+server_hostname is only meaningful with sslz:You must set server_hostname when using ssl without a host�1ssl_handshake_timeout is only meaningful with sslr�8host/port and sock can not be specified at the same time�r=r>r?r&r��!getaddrinfo() returned empty listc3s |]}t��j�|��VqdSrB)�	functools�partialrP)rCr))r�laddr_infosrfrrrE�s��z2BaseEventLoop.create_connection.<locals>.<genexpr>r�cSsg|]}|D]}|�qqSrr)rC�subrWrrrr��sz3BaseEventLoop.create_connection.<locals>.<listcomp>rc3s|]}t|��kVqdSrB�r�rCrW)�modelrrrEszMultiple exceptions: {}r"css|]}t|�VqdSrBr]r^rrrrE
sz5host and port was not specified and no sock specified�"A Stream Socket was expected, got )r�r$z%r connected to %s:%r: (%r, %r))r%�_ensure_resolvedr$r1r(rPrPr
Zstaggered_racer�r�allrEr#r>�_create_connection_transportr��get_extra_inforr)rfr�r;r<rQr=r?r&r*rRr�r�rSrT�infosr)rOrnr�r)rr[r_rfr�create_connection�s�����


�
��

�
���
�zBaseEventLoop.create_connectionc	�s�|�d�|�}|��}|rHt|t�r*dn|}	|j|||	||||d�}
n|�|||�}
z|IdHWn|
���YnX|
|fS)NF�r�r�r�)rHrdr�boolr�r�r�)rfr*r�rQr�r�r�r�r�r�rnrrrrc%s*
�z*BaseEventLoop._create_connection_transportc
�s�|��rtd��t|dtjj�}|tjjkr:td|����|tjjkr�z|�||||�IdHWStj	k
r�}z
|sx�W5d}~XYnX|s�td|����|�
||||�IdHS)a�Send a file to transport.

        Return the total number of bytes which were sent.

        The method uses high-performance os.sendfile if available.

        file must be a regular file object opened in binary mode.

        offset tells from where to start reading the file. If specified,
        count is the total number of bytes to transmit as opposed to
        sending the file until EOF is reached. File position is updated on
        return or also in case of error in which case file.tell()
        can be used to figure out the number of bytes
        which were sent.

        fallback set to True makes asyncio to manually read and send
        the file when the platform does not support the sendfile syscall
        (e.g. Windows or SSL socket on Unix).

        Raise SendfileNotAvailableError if the system does not support
        sendfile syscall and fallback is False.
        zTransport is closingZ_sendfile_compatiblez(sendfile is not supported for transport NzHfallback is disabled and native sendfile is not supported for transport )rirmrrZ
_SendfileModeZUNSUPPORTEDZ
TRY_NATIVE�_sendfile_nativerr1�_sendfile_fallback)rfrnr3r4r5r.rDrWrrr�sendfile?s4�����zBaseEventLoop.sendfilec�st�d��dS)Nz!sendfile syscall is not supportedr7)rfrgr3r4r5rrrrins�zBaseEventLoop._sendfile_nativec
�s�|r|�|�|rt|d�nd}t|�}d}t|�}z�|rXt|||�}|dkrX|W�bSt|�d|�}	|�d|j|	�IdH}
|
s�|W�0S|�	�IdH|�
|	d|
��||
7}q6W5|dkr�t|d�r�|�||�|��IdHXdS)Ni@rr9)r9r:r;r\r#r{r<rr=rk�write)rfrgr3r4r5r>r?r@r?rArBrrrrjrs*
z BaseEventLoop._sendfile_fallbackrgc
�s�tdkrtd��t|tj�s*td|����t|dd�sFtd|�d���|��}tj|||||||dd�}|�	�|�
|�|�|j|�}	|�|j
�}
z|IdHWn.tk
r�|��|	��|
���YnX|jS)	zzUpgrade transport to TLS.

        Return a new transport that *protocol* should start using
        immediately.
        Nz"Python ssl module is not availablez@sslcontext is expected to be an instance of ssl.SSLContext, got Z_start_tls_compatibleFz
transport z  is not supported by start_tls())r�r�)rQrmrZ
SSLContextr5rrdr	ZSSLProtocolrarbrrory�
BaseExceptionr�rzZ_app_transport)rfrnr�r�r�r�r�r�Zssl_protocolZ
conmade_cbZ	resume_cbrrr�	start_tls�sB	�
��
zBaseEventLoop.start_tls)r=r?r&�
reuse_address�
reuse_port�allow_broadcastr*c �s�|
dk	r�|
jtjkr"td|
�����s>�s>|s>|s>|s>|s>|	r~t��||||||	d�}d�dd�|��D��}td|�d���|
�d	�d}
�n�s��s�|d
kr�td��||fdff}�n�ttd
��r�|tj	k�r���fD]}|dk	r�t
|t�s�td��qڈ�rx�d
dk�rxz"t
�t�
��j��r.t���WnFtk
�rFYn2tk
�rv}zt�d�|�W5d}~XYnX||f��fff}n�i}d
�fd�ffD]�\}}|dk	�r�|j||tj|||d�IdH}|�s�td��|D]:\}}}}}||f}||k�rddg||<||||<�q�q���fdd�|��D�}|�sHtd��g}|tk	�rv|�rftd��ntjdtdd�|D]�\\}}\}}d}
d}
zxtj|tj|d�}
|�r�t|
�|	�r�|
�tjtjd�|
�d	���r�|
�|���r|	�s|� |
|�IdH|}
Wn^tk
�rJ}z |
dk	�r0|
�!�|�"|�W5d}~XYn&|
dk	�rb|
�!��YnX�q|�qz|d
�|�}|�#�}|�$|
||
|�}|j%�r̈�r�t�&d��||�nt�'d�||�z|IdHWn|�!��YnX||fS)zCreate datagram connection.NzA UDP Socket was expected, got )rR�remote_addrr=r?r&rorprqr"css$|]\}}|r|�d|��VqdS)�=Nr)rC�k�vrrrrE�sz9BaseEventLoop.create_datagram_endpoint.<locals>.<genexpr>zKsocket modifier keyword arguments can not be used when sock is specified. (�)Frzunexpected address family)NN�AF_UNIXzstring is expected)r�z2Unable to check or remove stale UNIX socket %r: %rrrWrXcs8g|]0\}}�r|ddks�r,|ddks||f�qS)rNrr)rC�keyZ	addr_pair�rRrrrrr��s�z:BaseEventLoop.create_datagram_endpoint.<locals>.<listcomp>zcan not get address informationz~Passing `reuse_address=True` is no longer supported, as the usage of SO_REUSEPORT in UDP poses a significant security concern.zdThe *reuse_address* parameter has been deprecated as of 3.5.10 and is scheduled for removal in 3.11.r)�
stacklevelrFz@Datagram endpoint local_addr=%r remote_addr=%r created: (%r, %r)z2Datagram endpoint remote_addr=%r created: (%r, %r))(r>r$r2r%�dictr#�itemsrHr#rwrrr5�stat�S_ISSOCK�os�st_mode�remove�FileNotFoundErrorr(r�errorra�_unsetr�r�rr+r&r'ZSO_BROADCASTrIrNr�r9rdr�r�r%r) rfr�rRrrr=r?r&rorprqr*ZoptsZproblemsZr_addrZaddr_pairs_inforO�errZ
addr_infos�idxreZfamrOZpror�ryrZ
local_addressZremote_addressrWr�r�rnrrzr�create_datagram_endpoint�s$�������
�

��
�
�

����




���z&BaseEventLoop.create_datagram_endpointc
�s\|dd�\}}t|||||f|dd���}	|	dk	r<|	gS|j||||||d�IdHSdS)Nrr,)rAr$)
rfr�r=r>r?r&r�r;r<r%rrrraLs�zBaseEventLoop._ensure_resolvedc�s8|j||f|tj||d�IdH}|s4td|�d���|S)N)r=r>r&r�zgetaddrinfo(z) returned empty list)rar$r1r()rfr;r<r=r&rerrr�_create_server_getaddrinfoXs�z(BaseEventLoop._create_server_getaddrinfor)	r=r&r*r�rQrorpr�r�c	�s�t|t�rtd��|dk	r*|dkr*td��|dk	s<�dk	�r"|dk	rLtd��|	dkrhtjdkoftjdk}	g}
|dkr|dg}n$t|t�s�t|t	j
j�s�|g}n|}����fdd	�|D�}tj
|d
�i�IdH}ttj�|��}d}�z|D�]}|\}}}}}zt�|||�}Wn8tjk
�rH�j�r@tjd|||d
d�Yq�YnX|
�|�|	�rl|�tjtjd
�|
�rzt|�t�r�|tjk�r�ttd��r�|�tj tj!d
�z|�"|�Wq�t#k
�r�}z t#|j$d||j%�&�f�d�W5d}~XYq�Xq�d
}W5|�s|
D]}|���qXn4|dk�r4td��|j'tj(k�rPtd|����|g}
|
D]}|�)d��qZt*�|
||||�}|�r�|�+�tj,d�d�IdH�j�r�t�-d|�|S)a1Create a TCP server.

        The host parameter can be a string, in that case the TCP server is
        bound to host and port.

        The host parameter can also be a sequence of strings and in that case
        the TCP server is bound to all hosts of the sequence. If a host
        appears multiple times (possibly indirectly e.g. when hostnames
        resolve to the same IP address), the server is only bound once to that
        host.

        Return a Server object which can be used to stop the service.

        This method is a coroutine.
        z*ssl argument must be an SSLContext or NoneNrUrV�posix�cygwinr.csg|]}�j|���d��qS))r=r&)r�)rCr;�r=r&r<rfrrr��s�
�z/BaseEventLoop.create_server.<locals>.<listcomp>r�Fz:create_server() failed to create socket.socket(%r, %r, %r)T��exc_info�IPPROTO_IPV6z0error while attempting to bind on address %r: %sz)Neither host/port nor sock were specifiedr`rr�z
%r is serving).rrhr5r%r�r�r�platformrrF�abc�Iterablerr��setrKrLrMr�r$r�r�r�warningr9r&r'ZSO_REUSEADDRr+r8rr#r�ZIPV6_V6ONLYrIr(rLrJrKr>r1rHrr�r�r%)rfr�r;r<r=r&r*r�rQrorpr�r�r�ZhostsZfsreZ	completed�resr@Zsocktyper?Z	canonnameZsar�r�rr�r�
create_server`s�
��
��
�

������
�zBaseEventLoop.create_server)rQr�c�sv|jtjkrtd|����|dk	r.|s.td��|j|||dd|d�IdH\}}|jrn|�d�}t�d|||�||fS)	aHandle an accepted connection.

        This is used by servers that accept connections outside of
        asyncio but that use asyncio to handle connections.

        This method is a coroutine.  When completed, the coroutine
        returns a (transport, protocol) pair.
        r`NrUr.T)r�r�r$z%r handled: (%r, %r))	r>r$r1r%rcr�rdrr)rfr�r*rQr�rnr�rrr�connect_accepted_socket�s$��
z%BaseEventLoop.connect_accepted_socketc�sd|�}|��}|�|||�}z|IdHWn|���YnX|jr\t�d|��||�||fS)Nz Read pipe %r connected: (%r, %r))rdr�r�r�rr�fileno�rfr�r�r�r�rnrrr�connect_read_pipe�s�zBaseEventLoop.connect_read_pipec�sd|�}|��}|�|||�}z|IdHWn|���YnX|jr\t�d|��||�||fS)Nz!Write pipe %r connected: (%r, %r))rdr�r�r�rrr�r�rrr�connect_write_pipes�z BaseEventLoop.connect_write_pipecCs�|g}|dk	r"|�dt|����|dk	rJ|tjkrJ|�dt|����n8|dk	rf|�dt|����|dk	r�|�dt|����t�d�|��dS)Nzstdin=zstdout=stderr=zstdout=zstderr=� )r9r!rrrrr#)rfr'r�r�r�r%rrr�_log_subprocessszBaseEventLoop._log_subprocess)	r�r�r��universal_newlinesr�r��encoding�errors�textc	�s�t|ttf�std��|r"td��|s.td��|dkr>td��|rJtd��|	dk	rZtd��|
dk	rjtd��|�}
d}|jr�d	|}|�||||�|j|
|d
||||f|�IdH}|jr�|dk	r�t�d||�||
fS)Nzcmd must be a string� universal_newlines must be Falsezshell must be Truer�bufsize must be 0�text must be False�encoding must be None�errors must be Nonezrun shell command %rT�%s: %r)	rr3rr%r�r�r�rr%)rfr��cmdr�r�r�r�r�r�r�r�r�r�r��	debug_logrnrrr�subprocess_shellsB��
zBaseEventLoop.subprocess_shellc	�s�|rtd��|rtd��|dkr(td��|r4td��|	dk	rDtd��|
dk	rTtd��|f|}|�}d}|jr�d|��}|�||||�|j||d	||||f|
�IdH}|jr�|dk	r�t�d
||�||fS)Nr�zshell must be Falserr�r�r�r�zexecute program Fr�)r%r�r�r�rr%)rfr�Zprogramr�r�r�r�r�r�r�r�r�r�r�Z
popen_argsr�r�rnrrr�subprocess_execCs@

��
zBaseEventLoop.subprocess_execcCs|jS)zKReturn an exception handler, or None if the default one is in use.
        )r�rqrrr�get_exception_handleresz#BaseEventLoop.get_exception_handlercCs(|dk	rt|�std|����||_dS)a�Set handler as the new event loop exception handler.

        If handler is None, the default exception handler will
        be set.

        If handler is a callable object, it should have a
        signature matching '(loop, context)', where 'loop'
        will be a reference to the active event loop, 'context'
        will be a dict object (see `call_exception_handler()`
        documentation for details about context).
        Nz+A callable object or None is expected, got )r�r5r�)rfZhandlerrrr�set_exception_handlerjsz#BaseEventLoop.set_exception_handlerc	Cs|�d�}|sd}|�d�}|dk	r6t|�||jf}nd}d|kr`|jdk	r`|jjr`|jj|d<|g}t|�D]�}|dkr|qn||}|dkr�d	�t�|��}d
}||�	�7}n2|dkr�d	�t�|��}d}||�	�7}nt
|�}|�|�d|���qntj
d
�|�|d�dS)aEDefault exception handler.

        This is called when an exception occurs and no exception
        handler is set, and can be called by a custom exception
        handler that wants to defer to the default behavior.

        This default handler logs the error message and other
        context-dependent information.  In debug mode, a truncated
        stack trace is also appended showing where the given object
        (e.g. a handle or future or task) was created, if any.

        The context parameter has the same meaning as in
        `call_exception_handler()`.
        r�z!Unhandled exception in event looprRNFZsource_tracebackZhandle_traceback>r�rRr.z+Object created at (most recent call last):
z+Handle created at (most recent call last):
rG�
r�)�getr>�
__traceback__r�r��sortedr#�	traceback�format_list�rstriprr9rr�)	rfrr�rRr�Z	log_linesry�value�tbrrr�default_exception_handler{s<

���z'BaseEventLoop.default_exception_handlercCs�|jdkrVz|�|�Wq�ttfk
r2�Yq�tk
rRtjddd�Yq�Xn�z|�||�Wn�ttfk
r��Ynttk
r�}zVz|�d||d��Wn:ttfk
r��Yn"tk
r�tjddd�YnXW5d}~XYnXdS)aDCall the current event loop's exception handler.

        The context argument is a dict containing the following keys:

        - 'message': Error message;
        - 'exception' (optional): Exception object;
        - 'future' (optional): Future instance;
        - 'task' (optional): Task instance;
        - 'handle' (optional): Handle instance;
        - 'protocol' (optional): Protocol instance;
        - 'transport' (optional): Transport instance;
        - 'socket' (optional): Socket instance;
        - 'asyncgen' (optional): Asynchronous generator that caused
                                 the exception.

        New keys maybe introduced in the future.

        Note: do not overload this method in an event loop subclass.
        For custom exception handling, use the
        `set_exception_handler()` method.
        Nz&Exception in default exception handlerTr�z$Unhandled error in exception handler)r�rRrzeException in default exception handler while handling an unexpected error in custom exception handler)r�r�rSrTrmrr�)rfrrWrrrr��s4
���z$BaseEventLoop.call_exception_handlercCs|jr
dS|j�|�dS)z3Add a Handle to _scheduled (TimerHandle) or _ready.N)�
_cancelledr�r9�rfrrrr�
_add_callback�szBaseEventLoop._add_callbackcCs|�|�|��dS)z6Like _add_callback() but called from a signal handler.N)r�r�r�rrr�_add_callback_signalsafe�s
z&BaseEventLoop._add_callback_signalsafecCs|jr|jd7_dS)z3Notification that a TimerHandle has been cancelled.rN)r�r�r�rrr�_timer_handle_cancelled�sz%BaseEventLoop._timer_handle_cancelledc	Cs�t|j�}|tkr`|j|tkr`g}|jD]}|jr<d|_q*|�|�q*t�|�||_d|_n4|jr�|jdjr�|jd8_t�	|j�}d|_q`d}|j
s�|jr�d}n*|jr�|jdj}t
td||���t�}|j�|�}|�|�|��|j}|j�r:|jd}|j|k�r�q:t�	|j�}d|_|j
�|�q�t|j
�}t|�D]|}	|j
��}|j�rf�qL|j�r�zD||_|��}
|��|��|
}||jk�r�t�dt|�|�W5d|_Xn|���qLd}dS)z�Run one full iteration of the event loop.

        This calls all currently ready callbacks, polls for I/O,
        schedules the resulting callbacks, and finally schedules
        'call_later' callbacks.
        FrrNzExecuting %s took %.3f seconds)r�r��_MIN_SCHEDULED_TIMER_HANDLESr��%_MIN_CANCELLED_TIMER_HANDLES_FRACTIONr�r9r�heapify�heappopr�r�Z_whenr:�maxr��MAXIMUM_SELECT_TIMEOUTZ	_selectorZselectr�r��range�popleftr�r�Z_runr�rr�r)rfZsched_countZ
new_scheduledrZtimeoutrr�Zend_timeZntodo�ir(r*rrrr�sj
��





�
zBaseEventLoop._run_oncecCsHt|�t|j�krdS|r2t��|_t�tj�nt�|j�||_dSrB)rhr�r�#get_coroutine_origin_tracking_depthr��#set_coroutine_origin_tracking_depthrZDEBUG_STACK_DEPTH�rfZenabledrrrr�Fs���z,BaseEventLoop._set_coroutine_origin_trackingcCs|jSrB)r�rqrrrr�UszBaseEventLoop.get_debugcCs ||_|��r|�|j|�dSrB)r�r�r�r�r�rrrr�XszBaseEventLoop.set_debug)N)N)NNN)NN)NN)N)r)rN)N)NN)FN)rN)NN)NN)Sr|r}r~rhr�rdr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrUr�r�r�r�rr�r�rr
rrrrr�rr r+r$r-r6r0r2r/rPrfrcrkrirjrnr�r�r$r1rar�r6Z
AI_PASSIVEr�r�r�r�r�rrr�r�r�r�r�r�r�r�r�rr�r�r�rrrrr�sF���
�
�
�
�
		&	
	�

�
%���
�/�/���	��w��%�"29Nr)rr)r)7�__doc__rFZcollections.abcZconcurrent.futuresrrYrrKr�r$r~rr�r�r�rr�r�rQ�ImportErrorr.rrrrrrr	r
rrr
�logr�__all__r�r�r#r8r��objectr�rr!r+rArPrXr[ZProtocolr\ZAbstractServerrZAbstractEventLooprrrrr�<module>sd

		
;


Doasyncio/__pycache__/protocols.cpython-38.pyc000064400000020650151153537520015107 0ustar00U

e5d��@sbdZdZGdd�d�ZGdd�de�ZGdd�de�ZGdd	�d	e�ZGd
d�de�Zdd
�ZdS)zAbstract Protocol base classes.)�BaseProtocol�Protocol�DatagramProtocol�SubprocessProtocol�BufferedProtocolc@s4eZdZdZdZdd�Zdd�Zdd�Zd	d
�ZdS)raCommon base class for protocol interfaces.

    Usually user implements protocols that derived from BaseProtocol
    like Protocol or ProcessProtocol.

    The only case when BaseProtocol should be implemented directly is
    write-only transport like write pipe
    �cCsdS)z�Called when a connection is made.

        The argument is the transport representing the pipe connection.
        To receive data, wait for data_received() calls.
        When the connection is closed, connection_lost() is called.
        Nr)�selfZ	transportrr�)/usr/lib64/python3.8/asyncio/protocols.py�connection_madeszBaseProtocol.connection_madecCsdS)z�Called when the connection is lost or closed.

        The argument is an exception object or None (the latter
        meaning a regular EOF is received or the connection was
        aborted or closed).
        Nr�r�excrrr�connection_lostszBaseProtocol.connection_lostcCsdS)aCalled when the transport's buffer goes over the high-water mark.

        Pause and resume calls are paired -- pause_writing() is called
        once when the buffer goes strictly over the high-water mark
        (even if subsequent writes increases the buffer size even
        more), and eventually resume_writing() is called once when the
        buffer size reaches the low-water mark.

        Note that if the buffer size equals the high-water mark,
        pause_writing() is not called -- it must go strictly over.
        Conversely, resume_writing() is called when the buffer size is
        equal or lower than the low-water mark.  These end conditions
        are important to ensure that things go as expected when either
        mark is zero.

        NOTE: This is the only Protocol callback that is not called
        through EventLoop.call_soon() -- if it were, it would have no
        effect when it's most needed (when the app keeps writing
        without yielding until pause_writing() is called).
        Nr�rrrr�
pause_writing%szBaseProtocol.pause_writingcCsdS)zvCalled when the transport's buffer drains below the low-water mark.

        See pause_writing() for details.
        Nrr
rrr�resume_writing;szBaseProtocol.resume_writingN)	�__name__�
__module__�__qualname__�__doc__�	__slots__r	rrrrrrrr	s	rc@s$eZdZdZdZdd�Zdd�ZdS)ranInterface for stream protocol.

    The user should implement this interface.  They can inherit from
    this class but don't need to.  The implementations here do
    nothing (they don't raise exceptions).

    When the user wants to requests a transport, they pass a protocol
    factory to a utility function (e.g., EventLoop.create_connection()).

    When the connection is made successfully, connection_made() is
    called with a suitable transport object.  Then data_received()
    will be called 0 or more times with data (bytes) received from the
    transport; finally, connection_lost() will be called exactly once
    with either an exception object or None as an argument.

    State machine of calls:

      start -> CM [-> DR*] [-> ER?] -> CL -> end

    * CM: connection_made()
    * DR: data_received()
    * ER: eof_received()
    * CL: connection_lost()
    rcCsdS)zTCalled when some data is received.

        The argument is a bytes object.
        Nr)r�datarrr�
data_received^szProtocol.data_receivedcCsdS�z�Called when the other end calls write_eof() or equivalent.

        If this returns a false value (including None), the transport
        will close itself.  If it returns a true value, closing the
        transport is up to the protocol.
        Nrr
rrr�eof_receiveddszProtocol.eof_receivedN)rrrrrrrrrrrrBsrc@s,eZdZdZdZdd�Zdd�Zdd�Zd	S)
ra�Interface for stream protocol with manual buffer control.

    Important: this has been added to asyncio in Python 3.7
    *on a provisional basis*!  Consider it as an experimental API that
    might be changed or removed in Python 3.8.

    Event methods, such as `create_server` and `create_connection`,
    accept factories that return protocols that implement this interface.

    The idea of BufferedProtocol is that it allows to manually allocate
    and control the receive buffer.  Event loops can then use the buffer
    provided by the protocol to avoid unnecessary data copies.  This
    can result in noticeable performance improvement for protocols that
    receive big amounts of data.  Sophisticated protocols can allocate
    the buffer only once at creation time.

    State machine of calls:

      start -> CM [-> GB [-> BU?]]* [-> ER?] -> CL -> end

    * CM: connection_made()
    * GB: get_buffer()
    * BU: buffer_updated()
    * ER: eof_received()
    * CL: connection_lost()
    rcCsdS)aPCalled to allocate a new receive buffer.

        *sizehint* is a recommended minimal size for the returned
        buffer.  When set to -1, the buffer size can be arbitrary.

        Must return an object that implements the
        :ref:`buffer protocol <bufferobjects>`.
        It is an error to return a zero-sized buffer.
        Nr)r�sizehintrrr�
get_buffer�szBufferedProtocol.get_buffercCsdS)z�Called when the buffer was updated with the received data.

        *nbytes* is the total number of bytes that were written to
        the buffer.
        Nr)r�nbytesrrr�buffer_updated�szBufferedProtocol.buffer_updatedcCsdSrrr
rrrr�szBufferedProtocol.eof_receivedN)rrrrrrrrrrrrrms
rc@s$eZdZdZdZdd�Zdd�ZdS)rz Interface for datagram protocol.rcCsdS)z&Called when some datagram is received.Nr)rrZaddrrrr�datagram_received�sz"DatagramProtocol.datagram_receivedcCsdS)z~Called when a send or receive operation raises an OSError.

        (Other than BlockingIOError or InterruptedError.)
        Nrr
rrr�error_received�szDatagramProtocol.error_receivedN)rrrrrrrrrrrr�src@s,eZdZdZdZdd�Zdd�Zdd�Zd	S)
rz,Interface for protocol for subprocess calls.rcCsdS)z�Called when the subprocess writes data into stdout/stderr pipe.

        fd is int file descriptor.
        data is bytes object.
        Nr)r�fdrrrr�pipe_data_received�sz%SubprocessProtocol.pipe_data_receivedcCsdS)z�Called when a file descriptor associated with the child process is
        closed.

        fd is the int file descriptor that was closed.
        Nr)rrrrrr�pipe_connection_lost�sz'SubprocessProtocol.pipe_connection_lostcCsdS)z"Called when subprocess has exited.Nrr
rrr�process_exited�sz!SubprocessProtocol.process_exitedN)rrrrrr r!r"rrrrr�s
rcCs�t|�}|r�|�|�}t|�}|s*td��||krL||d|�<|�|�dS|d|�|d|�<|�|�||d�}t|�}qdS)Nz%get_buffer() returned an empty buffer)�lenr�RuntimeErrorr)�protorZdata_lenZbufZbuf_lenrrr�_feed_data_to_buffered_proto�s


r&N)r�__all__rrrrrr&rrrr�<module>s9+9asyncio/__pycache__/streams.cpython-38.opt-1.pyc000064400000047617151153537520015514 0ustar00U

e5d h�@s&dZddlZddlZddlZddlZeed�r6ed7ZddlmZddlmZddlm	Z	dd	lm
Z
dd
lmZddlm
Z
ddlmZd
Zdded�dd�Zd ded�dd�Zeed�r�d!ded�dd�Zd"ded�dd�ZGdd�dej�ZGdd�deej�ZGdd�d�ZGdd�d�ZdS)#)�StreamReader�StreamWriter�StreamReaderProtocol�open_connection�start_server�NZAF_UNIX)�open_unix_connection�start_unix_server�)�
coroutines)�events)�
exceptions)�format_helpers)�	protocols)�logger)�sleepi)�loop�limitc	�st|dkrt��}ntjdtdd�t||d�}t||d��|j�fdd�||f|�IdH\}}t|�||�}||fS)	a�A wrapper for create_connection() returning a (reader, writer) pair.

    The reader returned is a StreamReader instance; the writer is a
    StreamWriter instance.

    The arguments are all the usual arguments to create_connection()
    except protocol_factory; most common are positional host and port,
    with various optional keyword arguments following.

    Additional optional keyword arguments are loop (to set the event loop
    instance to use) and limit (to set the buffer limit passed to the
    StreamReader).

    (If you want to customize the StreamReader and/or
    StreamReaderProtocol classes, just copy the code -- there's
    really nothing special here except some convenience.)
    N�[The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.���
stacklevel�rr�rcs�S�N�r��protocolr�'/usr/lib64/python3.8/asyncio/streams.py�<lambda>5�z!open_connection.<locals>.<lambda>)	r�get_event_loop�warnings�warn�DeprecationWarningrrZcreate_connectionr)	�host�portrr�kwds�reader�	transport�_�writerrrrrs"
�
��rc�sJ�dkrt���ntjdtdd����fdd�}�j|||f|�IdHS)a�Start a socket server, call back for each client connected.

    The first parameter, `client_connected_cb`, takes two parameters:
    client_reader, client_writer.  client_reader is a StreamReader
    object, while client_writer is a StreamWriter object.  This
    parameter can either be a plain callback function or a coroutine;
    if it is a coroutine, it will be automatically converted into a
    Task.

    The rest of the arguments are all the usual arguments to
    loop.create_server() except protocol_factory; most common are
    positional host and port, with various optional keyword arguments
    following.  The return value is the same as loop.create_server().

    Additional optional keyword arguments are loop (to set the event loop
    instance to use) and limit (to set the buffer limit passed to the
    StreamReader).

    The return value is the same as loop.create_server(), i.e. a
    Server object which can be used to stop the service.
    Nrrrcst��d�}t|��d�}|S�Nrr�rr�r'r��client_connected_cbrrrr�factoryXs
�zstart_server.<locals>.factory)rr r!r"r#Z
create_server)r/r$r%rrr&r0rr.rr:s
�rc�sr|dkrt��}ntjdtdd�t||d�}t||d��|j�fdd�|f|�IdH\}}t|�||�}||fS)	z@Similar to `open_connection` but works with UNIX Domain Sockets.Nrrrrrcs�Srrrrrrrprz&open_unix_connection.<locals>.<lambda>)	rr r!r"r#rrZcreate_unix_connectionr)�pathrrr&r'r(r)r*rrrrds 
�
��rc�sH�dkrt���ntjdtdd����fdd�}�j||f|�IdHS)z=Similar to `start_server` but works with UNIX Domain Sockets.Nrrrcst��d�}t|��d�}|Sr+r,r-r.rrr0~s
�z"start_unix_server.<locals>.factory)rr r!r"r#Zcreate_unix_server)r/r1rrr&r0rr.rrts
�rc@sBeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�FlowControlMixina)Reusable flow control logic for StreamWriter.drain().

    This implements the protocol methods pause_writing(),
    resume_writing() and connection_lost().  If the subclass overrides
    these it must call the super methods.

    StreamWriter.drain() must wait for _drain_helper() coroutine.
    NcCs0|dkrt��|_n||_d|_d|_d|_dS�NF)rr �_loop�_paused�
_drain_waiter�_connection_lost)�selfrrrr�__init__�szFlowControlMixin.__init__cCs d|_|j��rt�d|�dS)NTz%r pauses writing)r5r4�	get_debugr�debug�r8rrr�
pause_writing�s
zFlowControlMixin.pause_writingcCsFd|_|j��rt�d|�|j}|dk	rBd|_|��sB|�d�dS)NFz%r resumes writing)r5r4r:rr;r6�done�
set_result�r8�waiterrrr�resume_writing�s
zFlowControlMixin.resume_writingcCsVd|_|jsdS|j}|dkr"dSd|_|��r4dS|dkrH|�d�n
|�|�dS�NT)r7r5r6r>r?�
set_exception�r8�excrArrr�connection_lost�sz FlowControlMixin.connection_lostc�s<|jrtd��|jsdS|j}|j��}||_|IdHdS)NzConnection lost)r7�ConnectionResetErrorr5r6r4�
create_futurer@rrr�
_drain_helper�s
zFlowControlMixin._drain_helpercCst�dSr)�NotImplementedError�r8�streamrrr�_get_close_waiter�sz"FlowControlMixin._get_close_waiter)N)
�__name__�
__module__�__qualname__�__doc__r9r=rBrGrJrNrrrrr2�s	
	r2csfeZdZdZdZd�fdd�	Zedd��Zdd�Z�fd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
�ZS)ra=Helper class to adapt between Protocol and StreamReader.

    (This is a helper class instead of making StreamReader itself a
    Protocol subclass, because the StreamReader has other potential
    uses, and to prevent the user of the StreamReader to accidentally
    call inappropriate methods of the protocol.)
    Ncsnt�j|d�|dk	r,t�|�|_|j|_nd|_|dk	r@||_d|_d|_d|_	||_
d|_|j�
�|_dS)NrF)�superr9�weakref�ref�_stream_reader_wr�_source_traceback�_strong_reader�_reject_connection�_stream_writer�
_transport�_client_connected_cb�	_over_sslr4rI�_closed)r8Z
stream_readerr/r��	__class__rrr9�s
zStreamReaderProtocol.__init__cCs|jdkrdS|��Sr)rVr<rrr�_stream_reader�s
z#StreamReaderProtocol._stream_readercCs�|jr6ddi}|jr|j|d<|j�|�|��dS||_|j}|dk	rT|�|�|�d�dk	|_	|j
dk	r�t||||j�|_|�
||j�}t
�|�r�|j�|�d|_dS)N�messagezpAn open stream was garbage collected prior to establishing network connection; call "stream.close()" explicitly.Zsource_tracebackZ
sslcontext)rYrWr4Zcall_exception_handler�abortr[ra�
set_transport�get_extra_infor]r\rrZr
ZiscoroutineZcreate_taskrX)r8r(�contextr'�resrrr�connection_made�s2�


��
z$StreamReaderProtocol.connection_madecsx|j}|dk	r*|dkr |��n
|�|�|j��sV|dkrJ|j�d�n|j�|�t��|�d|_d|_	d|_
dSr)ra�feed_eofrDr^r>r?rSrGrVrZr[)r8rFr'r_rrrG
s


z$StreamReaderProtocol.connection_lostcCs|j}|dk	r|�|�dSr)ra�	feed_data)r8�datar'rrr�
data_receivedsz"StreamReaderProtocol.data_receivedcCs$|j}|dk	r|��|jr dSdS)NFT)rarir])r8r'rrr�eof_received sz!StreamReaderProtocol.eof_receivedcCs|jSr)r^rLrrrrN+sz&StreamReaderProtocol._get_close_waitercCs"|j}|��r|��s|��dSr)r^r>�	cancelled�	exception)r8�closedrrr�__del__.szStreamReaderProtocol.__del__)NN)rOrPrQrRrWr9�propertyrarhrGrlrmrNrq�
__classcell__rrr_rr�s
rc@sveZdZdZdd�Zdd�Zedd��Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zddd�Zdd�ZdS)ra'Wraps a Transport.

    This exposes write(), writelines(), [can_]write_eof(),
    get_extra_info() and close().  It adds drain() which returns an
    optional Future on which you can wait for flow control.  It also
    adds a transport property which references the Transport
    directly.
    cCs4||_||_||_||_|j��|_|j�d�dSr)r[�	_protocol�_readerr4rIZ
_complete_futr?)r8r(rr'rrrrr9@szStreamWriter.__init__cCs@|jjd|j��g}|jdk	r0|�d|j���d�d�|��S)N�
transport=zreader=�<{}>� )r`rOr[ru�append�format�join�r8�inforrr�__repr__Js
zStreamWriter.__repr__cCs|jSr�r[r<rrrr(PszStreamWriter.transportcCs|j�|�dSr)r[�write�r8rkrrrr�TszStreamWriter.writecCs|j�|�dSr)r[�
writelinesr�rrrr�WszStreamWriter.writelinescCs
|j��Sr)r[�	write_eofr<rrrr�ZszStreamWriter.write_eofcCs
|j��Sr)r[�
can_write_eofr<rrrr�]szStreamWriter.can_write_eofcCs
|j��Sr)r[�closer<rrrr�`szStreamWriter.closecCs
|j��Sr)r[�
is_closingr<rrrr�cszStreamWriter.is_closingc�s|j�|�IdHdSr)rtrNr<rrr�wait_closedfszStreamWriter.wait_closedNcCs|j�||�Sr)r[re)r8�name�defaultrrrreiszStreamWriter.get_extra_infoc�sL|jdk	r |j��}|dk	r |�|j��r8td�IdH|j��IdHdS)zyFlush the write buffer.

        The intended use is to write

          w.write(data)
          await w.drain()
        Nr)ruror[r�rrtrJ)r8rFrrr�drainls



zStreamWriter.drain)N)rOrPrQrRr9r~rrr(r�r�r�r�r�r�r�rer�rrrrr6s	


rc@s�eZdZdZedfdd�Zdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd&dd�Zd'dd�Zd d!�Zd"d#�Zd$d%�ZdS)(rNcCsv|dkrtd��||_|dkr*t��|_n||_t�|_d|_d|_d|_	d|_
d|_|j��rrt
�t�d��|_dS)NrzLimit cannot be <= 0Fr	)�
ValueError�_limitrr r4�	bytearray�_buffer�_eof�_waiter�
_exceptionr[r5r:r
�
extract_stack�sys�	_getframerW)r8rrrrrr9�s 
�zStreamReader.__init__cCs�dg}|jr"|�t|j��d��|jr2|�d�|jtkrN|�d|j���|jrf|�d|j���|jr~|�d|j���|jr�|�d|j���|j	r�|�d�d	�
d
�|��S)Nrz bytes�eofzlimit=zwaiter=z
exception=rvZpausedrwrx)r�ry�lenr�r��_DEFAULT_LIMITr�r�r[r5rzr{r|rrrr~�s 


zStreamReader.__repr__cCs|jSr)r�r<rrrro�szStreamReader.exceptioncCs0||_|j}|dk	r,d|_|��s,|�|�dSr)r�r�rnrDrErrrrD�szStreamReader.set_exceptioncCs*|j}|dk	r&d|_|��s&|�d�dS)z1Wakeup read*() functions waiting for data or EOF.N)r�rnr?r@rrr�_wakeup_waiter�s
zStreamReader._wakeup_waitercCs
||_dSrr)r8r(rrrrd�szStreamReader.set_transportcCs*|jr&t|j�|jkr&d|_|j��dSr3)r5r�r�r�r[�resume_readingr<rrr�_maybe_resume_transport�sz$StreamReader._maybe_resume_transportcCsd|_|��dSrC)r�r�r<rrrri�szStreamReader.feed_eofcCs|jo|jS)z=Return True if the buffer is empty and 'feed_eof' was called.)r�r�r<rrr�at_eof�szStreamReader.at_eofcCst|sdS|j�|�|��|jdk	rp|jspt|j�d|jkrpz|j��Wntk
rhd|_YnXd|_dS)NrT)	r��extendr�r[r5r�r�Z
pause_readingrKr�rrrrj�s
��zStreamReader.feed_datac�sX|jdk	rt|�d���|jr.d|_|j��|j��|_z|jIdHW5d|_XdS)zpWait until feed_data() or feed_eof() is called.

        If stream was paused, automatically resume it.
        NzF() called while another coroutine is already waiting for incoming dataF)r��RuntimeErrorr5r[r�r4rI)r8Z	func_namerrr�_wait_for_data�s	
�
zStreamReader._wait_for_datac
�s�d}t|�}z|�|�IdH}Wn�tjk
rN}z|jWY�Sd}~XYnhtjk
r�}zH|j�||j�r�|jd|j|�=n
|j�	�|�
�t|jd��W5d}~XYnX|S)a�Read chunk of data from the stream until newline (b'
') is found.

        On success, return chunk that ends with newline. If only partial
        line can be read due to EOF, return incomplete line without
        terminating newline. When EOF was reached while no bytes read, empty
        bytes object is returned.

        If limit is reached, ValueError will be raised. In that case, if
        newline was found, complete line including newline will be removed
        from internal buffer. Else, internal buffer will be cleared. Limit is
        compared against part of the line without newline.

        If stream was paused, this function will automatically resume it if
        needed.
        �
Nr)
r��	readuntilr�IncompleteReadError�partial�LimitOverrunErrorr��
startswith�consumed�clearr�r��args)r8�sep�seplen�line�errr�readline	s
 zStreamReader.readliner�c�s�t|�}|dkrtd��|jdk	r(|j�d}t|j�}|||kr||j�||�}|dkrZq�|d|}||jkr|t�d|��|jr�t	|j�}|j�
�t�|d��|�d�IdHq,||jkr�t�d|��|jd||�}|jd||�=|�
�t	|�S)	aVRead data from the stream until ``separator`` is found.

        On success, the data and separator will be removed from the
        internal buffer (consumed). Returned data will include the
        separator at the end.

        Configured stream limit is used to check result. Limit sets the
        maximal length of data that can be returned, not counting the
        separator.

        If an EOF occurs and the complete separator is still not found,
        an IncompleteReadError exception will be raised, and the internal
        buffer will be reset.  The IncompleteReadError.partial attribute
        may contain the separator partially.

        If the data cannot be read because of over limit, a
        LimitOverrunError exception  will be raised, and the data
        will be left in the internal buffer, so it can be read again.
        rz,Separator should be at least one-byte stringN���r	z2Separator is not found, and chunk exceed the limitr�z2Separator is found, but chunk is longer than limit)r�r�r�r��findr�rr�r��bytesr�r�r�r�)r8Z	separatorr��offsetZbuflenZisep�chunkrrrr�(s>


�


�zStreamReader.readuntilr�c�s�|jdk	r|j�|dkrdS|dkrVg}|�|j�IdH}|s@qL|�|�q(d�|�S|jsr|jsr|�d�IdHt|jd|��}|jd|�=|�	�|S)a�Read up to `n` bytes from the stream.

        If n is not provided, or set to -1, read until EOF and return all read
        bytes. If the EOF was received and the internal buffer is empty, return
        an empty bytes object.

        If n is zero, return empty bytes object immediately.

        If n is positive, this function try to read `n` bytes, and may return
        less or equal bytes than requested, but at least one byte. If EOF was
        received before any byte is read, this function returns empty byte
        object.

        Returned value is not limited with limit, configured at stream
        creation.

        If stream was paused, this function will automatically resume it if
        needed.
        Nrr�read)
r�r�r�ryr{r�r�r�r�r�)r8�nZblocks�blockrkrrrr��s"

zStreamReader.readc�s�|dkrtd��|jdk	r |j�|dkr,dSt|j�|krr|jr`t|j�}|j��t�||��|�	d�IdHq,t|j�|kr�t|j�}|j��nt|jd|��}|jd|�=|�
�|S)a�Read exactly `n` bytes.

        Raise an IncompleteReadError if EOF is reached before `n` bytes can be
        read. The IncompleteReadError.partial attribute of the exception will
        contain the partial read bytes.

        if n is zero, return empty bytes object.

        Returned value is not limited with limit, configured at stream
        creation.

        If stream was paused, this function will automatically resume it if
        needed.
        rz*readexactly size can not be less than zeroNr�readexactly)r�r�r�r�r�r�r�rr�r�r�)r8r�Z
incompleterkrrrr��s&



zStreamReader.readexactlycCs|Srrr<rrr�	__aiter__�szStreamReader.__aiter__c�s|��IdH}|dkrt�|S)Nr)r��StopAsyncIteration)r8�valrrr�	__anext__�szStreamReader.__anext__)r�)r�)rOrPrQrWr�r9r~rorDr�rdr�rir�rjr�r�r�r�r�r�r�rrrrr�s$	
[
2)r)NN)NN)N)N)�__all__Zsocketr�r!rT�hasattr�r
rrr
r�logrZtasksrr�rrrrZProtocolr2rrrrrrr�<module>sF
�!�'
��DkPasyncio/__pycache__/sslproto.cpython-38.opt-1.pyc000064400000051654151153537520015717 0ustar00U

e5dJj�@s�ddlZddlZzddlZWnek
r4dZYnXddlmZddlmZddlmZddlmZddl	m
Z
dd	�Zd
ZdZ
dZd
ZGdd�de�ZGdd�dejej�ZGdd�dej�ZdS)�N�)�base_events)�	constants)�	protocols)�
transports)�loggercCs"|rtd��t��}|sd|_|S)Nz(Server side SSL needs a valid SSLContextF)�
ValueError�sslZcreate_default_contextZcheck_hostname)�server_side�server_hostname�
sslcontext�r
�(/usr/lib64/python3.8/asyncio/sslproto.py�_create_transport_contextsrZ	UNWRAPPEDZDO_HANDSHAKEZWRAPPEDZSHUTDOWNc@s~eZdZdZdZddd�Zedd��Zedd	��Zed
d��Z	edd
��Z
ddd�Zddd�Zdd�Z
ddd�Zddd�ZdS)�_SSLPipeaAn SSL "Pipe".

    An SSL pipe allows you to communicate with an SSL/TLS protocol instance
    through memory buffers. It can be used to implement a security layer for an
    existing connection where you don't have access to the connection's file
    descriptor, or for some reason you don't want to use it.

    An SSL pipe can be in "wrapped" and "unwrapped" mode. In unwrapped mode,
    data is passed through untransformed. In wrapped mode, application level
    data is encrypted to SSL record level data and vice versa. The SSL record
    level is the lowest level in the SSL protocol suite and is what travels
    as-is over the wire.

    An SslPipe initially is in "unwrapped" mode. To start SSL, call
    do_handshake(). To shutdown SSL again, call unwrap().
    iNcCsH||_||_||_t|_t��|_t��|_d|_	d|_
d|_d|_dS)a�
        The *context* argument specifies the ssl.SSLContext to use.

        The *server_side* argument indicates whether this is a server side or
        client side transport.

        The optional *server_hostname* argument can be used to specify the
        hostname you are connecting to. You may only specify this parameter if
        the _ssl module supports Server Name Indication (SNI).
        NF)
�_context�_server_side�_server_hostname�
_UNWRAPPED�_stater	Z	MemoryBIO�	_incoming�	_outgoing�_sslobj�
_need_ssldata�
_handshake_cb�_shutdown_cb)�self�contextr
rr
r
r�__init__8s

z_SSLPipe.__init__cCs|jS)z*The SSL context passed to the constructor.)r�rr
r
rrNsz_SSLPipe.contextcCs|jS)z^The internal ssl.SSLObject instance.

        Return None if the pipe is not wrapped.
        )rrr
r
r�
ssl_objectSsz_SSLPipe.ssl_objectcCs|jS)zgWhether more record level data is needed to complete a handshake
        that is currently in progress.)rrr
r
r�need_ssldata[sz_SSLPipe.need_ssldatacCs
|jtkS)zj
        Whether a security layer is currently in effect.

        Return False during handshake.
        )r�_WRAPPEDrr
r
r�wrappedasz_SSLPipe.wrappedcCsR|jtkrtd��|jj|j|j|j|jd�|_	t
|_||_|jddd�\}}|S)aLStart the SSL handshake.

        Return a list of ssldata. A ssldata element is a list of buffers

        The optional *callback* argument can be used to install a callback that
        will be called when the handshake is complete. The callback will be
        called with None if successful, else an exception instance.
        z"handshake in progress or completed)r
r�T)�only_handshake)
rr�RuntimeErrorrZwrap_biorrrrr�
_DO_HANDSHAKEr�feed_ssldata�r�callback�ssldata�appdatar
r
r�do_handshakejs	
�z_SSLPipe.do_handshakecCsB|jtkrtd��|jtkr$td��t|_||_|�d�\}}|S)a1Start the SSL shutdown sequence.

        Return a list of ssldata. A ssldata element is a list of buffers

        The optional *callback* argument can be used to install a callback that
        will be called when the shutdown is complete. The callback will be
        called without arguments.
        zno security layer presentzshutdown in progressr$)rrr&�	_SHUTDOWNrr(r)r
r
r�shutdowns	

z_SSLPipe.shutdowncCs|j��|�d�\}}dS)z�Send a potentially "ragged" EOF.

        This method will raise an SSL_ERROR_EOF exception if the EOF is
        unexpected.
        r$N)rZ	write_eofr()rr+r,r
r
r�feed_eof�s
z_SSLPipe.feed_eofFc
Cs�|jtkr"|r|g}ng}g|fSd|_|r8|j�|�g}g}z�|jtkrz|j��t|_|j	rl|�	d�|rz||fWS|jtkr�|j�
|j�}|�|�|s�q�q�nJ|jt
kr�|j��d|_t|_|jr�|��n|jtkr�|�|j�
��Wnztjtjfk
�rl}zRt|dd�}|tjtjtjfk�rP|jtk�rN|j	�rN|�	|��|tjk|_W5d}~XYnX|jj�r�|�|j�
��||fS)a�Feed SSL record level data into the pipe.

        The data must be a bytes instance. It is OK to send an empty bytes
        instance. This can be used to get ssldata for a handshake initiated by
        this endpoint.

        Return a (ssldata, appdata) tuple. The ssldata element is a list of
        buffers containing SSL data that needs to be sent to the remote SSL.

        The appdata element is a list of buffers containing plaintext data that
        needs to be forwarded to the application. The appdata list may contain
        an empty buffer indicating an SSL "close_notify" alert. This alert must
        be acknowledged by calling shutdown().
        FN�errno)rrrr�writer'rr-r"r�read�max_size�appendr.Zunwraprr	�SSLError�CertificateError�getattr�SSL_ERROR_WANT_READ�SSL_ERROR_WANT_WRITE�SSL_ERROR_SYSCALLr�pending)r�datar%r,r+�chunk�exc�	exc_errnor
r
rr(�sZ










�

z_SSLPipe.feed_ssldatarc
Cs|jtkr6|t|�kr&||d�g}ng}|t|�fSg}t|�}d|_z(|t|�krn||j�||d��7}Wnhtjk
r�}zHt	|dd�}|j
dkr�tj}|_|tjtj
tjfkr��|tjk|_W5d}~XYnX|jjr�|�|j���|t|�k�s|jrB�qqB||fS)aFeed plaintext data into the pipe.

        Return an (ssldata, offset) tuple. The ssldata element is a list of
        buffers containing record level data that needs to be sent to the
        remote SSL instance. The offset is the number of plaintext bytes that
        were processed, which may be less than the length of data.

        NOTE: In case of short writes, this call MUST be retried with the SAME
        buffer passed into the *data* argument (i.e. the id() must be the
        same). This is an OpenSSL requirement. A further particularity is that
        a short write will always have offset == 0, because the _ssl module
        does not enable partial writes. And even though the offset is zero,
        there will still be encrypted data in ssldata.
        NFr1ZPROTOCOL_IS_SHUTDOWN)rr�len�
memoryviewrrr2r	r6r8�reasonr9r1r:r;rr<r5r3)rr=�offsetr+Zviewr?r@r
r
r�feed_appdata�s4

�z_SSLPipe.feed_appdata)N)N)N)F)r)�__name__�
__module__�__qualname__�__doc__r4r�propertyrr r!r#r-r/r0r(rEr
r
r
rr$s 








Krc@s�eZdZejjZdd�Zd"dd�Zdd�Z	dd	�Z
d
d�Zdd
�Ze
jfdd�Zdd�Zdd�Zdd�Zd#dd�Zdd�Zedd��Zdd�Zdd�Zd d!�ZdS)$�_SSLProtocolTransportcCs||_||_d|_dS)NF)�_loop�
_ssl_protocol�_closed)r�loopZssl_protocolr
r
rr!sz_SSLProtocolTransport.__init__NcCs|j�||�S)z#Get optional transport information.)rM�_get_extra_info�r�name�defaultr
r
r�get_extra_info'sz$_SSLProtocolTransport.get_extra_infocCs|j�|�dS�N)rM�_set_app_protocol)r�protocolr
r
r�set_protocol+sz"_SSLProtocolTransport.set_protocolcCs|jjSrU)rM�
_app_protocolrr
r
r�get_protocol.sz"_SSLProtocolTransport.get_protocolcCs|jSrU)rNrr
r
r�
is_closing1sz _SSLProtocolTransport.is_closingcCsd|_|j��dS)a
Close the transport.

        Buffered data will be flushed asynchronously.  No more data
        will be received.  After all buffered data is flushed, the
        protocol's connection_lost() method will (eventually) called
        with None as its argument.
        TN)rNrM�_start_shutdownrr
r
r�close4sz_SSLProtocolTransport.closecCs&|js"|d|��t|d�|��dS)Nzunclosed transport )�source)rN�ResourceWarningr])rZ_warnr
r
r�__del__?sz_SSLProtocolTransport.__del__cCs |jj}|dkrtd��|��S)Nz*SSL transport has not been initialized yet)rM�
_transportr&�
is_reading)rZtrr
r
rrbDsz _SSLProtocolTransport.is_readingcCs|jj��dS)z�Pause the receiving end.

        No data will be passed to the protocol's data_received()
        method until resume_reading() is called.
        N)rMra�
pause_readingrr
r
rrcJsz#_SSLProtocolTransport.pause_readingcCs|jj��dS)z�Resume the receiving end.

        Data received will once again be passed to the protocol's
        data_received() method.
        N)rMra�resume_readingrr
r
rrdRsz$_SSLProtocolTransport.resume_readingcCs|jj�||�dS)a�Set the high- and low-water limits for write flow control.

        These two values control when to call the protocol's
        pause_writing() and resume_writing() methods.  If specified,
        the low-water limit must be less than or equal to the
        high-water limit.  Neither value can be negative.

        The defaults are implementation-specific.  If only the
        high-water limit is given, the low-water limit defaults to an
        implementation-specific value less than or equal to the
        high-water limit.  Setting high to zero forces low to zero as
        well, and causes pause_writing() to be called whenever the
        buffer becomes non-empty.  Setting low to zero causes
        resume_writing() to be called only once the buffer is empty.
        Use of zero for either limit is generally sub-optimal as it
        reduces opportunities for doing I/O and computation
        concurrently.
        N)rMra�set_write_buffer_limits)rZhighZlowr
r
rreZsz-_SSLProtocolTransport.set_write_buffer_limitscCs|jj��S)z,Return the current size of the write buffer.)rMra�get_write_buffer_sizerr
r
rrfosz+_SSLProtocolTransport.get_write_buffer_sizecCs
|jjjSrU)rMra�_protocol_pausedrr
r
rrgssz&_SSLProtocolTransport._protocol_pausedcCs<t|tttf�s$tdt|�j����|s,dS|j�|�dS)z�Write some data bytes to the transport.

        This does not block; it buffers the data and arranges for it
        to be sent out asynchronously.
        z+data: expecting a bytes-like instance, got N)	�
isinstance�bytes�	bytearrayrB�	TypeError�typerFrM�_write_appdata�rr=r
r
rr2xs
z_SSLProtocolTransport.writecCsdS)zAReturn True if this transport supports write_eof(), False if not.Fr
rr
r
r�
can_write_eof�sz#_SSLProtocolTransport.can_write_eofcCs|j��d|_dS)z�Close the transport immediately.

        Buffered data will be lost.  No more data will be received.
        The protocol's connection_lost() method will (eventually) be
        called with None as its argument.
        TN)rM�_abortrNrr
r
r�abort�s
z_SSLProtocolTransport.abort)N)NN)rFrGrHrZ
_SendfileModeZFALLBACKZ_sendfile_compatiblerrTrXrZr[r]�warnings�warnr`rbrcrdrerfrJrgr2rorqr
r
r
rrKs$



rKc@s�eZdZdZd,dd�Zdd�Zd-d	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zd.dd�Z
dd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd/d&d'�Zd(d)�Zd*d+�ZdS)0�SSLProtocolz�SSL protocol.

    Implementation of SSL on top of a socket using incoming and outgoing
    buffers which are ssl.MemoryBIO objects.
    FNTc		Cs�tdkrtd��|dkr tj}n|dkr6td|����|sDt||�}||_|rZ|sZ||_nd|_||_t	|d�|_
t��|_
d|_||_||_|�|�t|j|�|_d|_d|_d|_d|_d|_||_||_dS)Nzstdlib ssl module not availablerz7ssl_handshake_timeout should be a positive number, got )rF)r	r&rZSSL_HANDSHAKE_TIMEOUTrrrr�_sslcontext�dict�_extra�collections�deque�_write_backlog�_write_buffer_size�_waiterrLrVrK�_app_transport�_sslpipe�_session_established�
_in_handshake�_in_shutdownra�_call_connection_made�_ssl_handshake_timeout)	rrO�app_protocolrZwaiterr
rZcall_connection_madeZssl_handshake_timeoutr
r
rr�s@��

zSSLProtocol.__init__cCs||_t|tj�|_dSrU)rYrhrZBufferedProtocol�_app_protocol_is_buffer)rr�r
r
rrV�s
�zSSLProtocol._set_app_protocolcCsD|jdkrdS|j��s:|dk	r.|j�|�n|j�d�d|_dSrU)r|Z	cancelledZ
set_exceptionZ
set_result�rr?r
r
r�_wakeup_waiter�s

zSSLProtocol._wakeup_waitercCs&||_t|j|j|j�|_|��dS)zXCalled when the low-level connection is made.

        Start the SSL handshake.
        N)rarrurrr~�_start_handshake)r�	transportr
r
r�connection_made�s�zSSLProtocol.connection_madecCsn|jr d|_|j�|jj|�n|jdk	r2d|j_d|_d|_t|dd�rT|j	�
�|�|�d|_d|_dS)z�Called when the low-level connection is lost or closed.

        The argument is an exception object or None (the latter
        meaning a regular EOF is received or the connection was
        aborted or closed).
        FNT�_handshake_timeout_handle)
rrL�	call_soonrY�connection_lostr}rNrar8r��cancelr�r~r�r
r
rr��s


zSSLProtocol.connection_lostcCs|j��dS)z\Called when the low-level transport's buffer goes over
        the high-water mark.
        N)rY�
pause_writingrr
r
rr��szSSLProtocol.pause_writingcCs|j��dS)z^Called when the low-level transport's buffer drains below
        the low-water mark.
        N)rY�resume_writingrr
r
rr�szSSLProtocol.resume_writingcCs"|jdkrdSz|j�|�\}}WnLttfk
r<�Yn4tk
rn}z|�|d�WY�dSd}~XYnX|D]}|j�|�qt|D]�}|�rz&|jr�t	�
|j|�n|j�|�WnPttfk
r��Yn8tk
�r
}z|�|d�WY�dSd}~XYnXq�|�
��qq�dS)zXCalled when some SSL data is received.

        The argument is a bytes object.
        NzSSL error in data receivedz/application protocol failed to receive SSL data)r~r(�
SystemExit�KeyboardInterrupt�
BaseException�_fatal_errorrar2r�rZ_feed_data_to_buffered_protorY�
data_receivedr\)rr=r+r,�er>Zexr
r
rr�s<
��zSSLProtocol.data_receivedcCsTzB|j��rt�d|�|�t�|js@|j	�
�}|r@t�d�W5|j��XdS)aCalled when the other end of the low-level stream
        is half-closed.

        If this returns a false value (including None), the transport
        will close itself.  If it returns a true value, closing the
        transport is up to the protocol.
        z%r received EOFz?returning true from eof_received() has no effect when using sslN)rar]rL�	get_debugr�debugr��ConnectionResetErrorr�rY�eof_receivedZwarning)rZ	keep_openr
r
rr�-s


zSSLProtocol.eof_receivedcCs4||jkr|j|S|jdk	r,|j�||�S|SdSrU)rwrarTrQr
r
rrPCs



zSSLProtocol._get_extra_infocCs.|jr
dS|jr|��nd|_|�d�dS)NTr$)r�r�rprmrr
r
rr\Ks
zSSLProtocol._start_shutdowncCs.|j�|df�|jt|�7_|��dS)Nr)rzr5r{rA�_process_write_backlogrnr
r
rrmTszSSLProtocol._write_appdatacCs\|j��r$t�d|�|j��|_nd|_d|_|j�d�|j�	|j
|j�|_|�
�dS)Nz%r starts SSL handshakeT)r$r)rLr�rr��time�_handshake_start_timer�rzr5Z
call_laterr��_check_handshake_timeoutr�r�rr
r
rr�Ys

��zSSLProtocol._start_handshakecCs*|jdkr&d|j�d�}|�t|��dS)NTz$SSL handshake is taking longer than z! seconds: aborting the connection)r�r�r��ConnectionAbortedError)r�msgr
r
rr�hs
�z$SSLProtocol._check_handshake_timeoutc
Csd|_|j��|jj}z|dk	r&|�|��}Wnbttfk
rJ�YnJtk
r�}z,t	|t
j�rld}nd}|�||�WY�dSd}~XYnX|j
��r�|j
��|j}t�d||d�|jj||��|��|d�|jr�|j�|j�|��d|_|j
�|j�dS)NFz1SSL handshake failed on verifying the certificatezSSL handshake failedz%r: SSL handshake took %.1f msg@�@)�peercert�cipher�compressionr T)r�r�r�r~r Zgetpeercertr�r�r�rhr	r7r�rLr�r�r�rr�rw�updater�r�r�rYr�r}r�rr�r�)rZ
handshake_excZsslobjr�r?r�Zdtr
r
r�_on_handshake_completeqs8

�z"SSLProtocol._on_handshake_completec
CsB|jdks|jdkrdSz�tt|j��D]�}|jd\}}|rR|j�||�\}}n*|rj|j�|j�}d}n|j�|j	�}d}|D]}|j�
|�q�|t|�kr�||f|jd<|jjr�|j��q�|jd=|j
t|�8_
q(Wn\ttfk
r��YnDtk
�r<}z$|j�r |�|�n|�|d�W5d}~XYnXdS)NrrzFatal error on SSL transport)rar~�rangerArzrEr-r�r/�	_finalizer2Z_pausedrdr{r�r�r�r�r�)r�ir=rDr+r>r?r
r
rr��s:�
z"SSLProtocol._process_write_backlog�Fatal error on transportcCsVt|t�r(|j��r@tjd||dd�n|j�|||j|d��|jrR|j�|�dS)Nz%r: %sT)�exc_info)�messageZ	exceptionr�rW)	rh�OSErrorrLr�rr�Zcall_exception_handlerraZ_force_close)rr?r�r
r
rr��s

�zSSLProtocol._fatal_errorcCsd|_|jdk	r|j��dSrU)r~rar]rr
r
rr��s
zSSLProtocol._finalizecCs(z|jdk	r|j��W5|��XdSrU)r�rarqrr
r
rrp�s
zSSLProtocol._abort)FNTN)N)N)r�)rFrGrHrIrrVr�r�r�r�r�r�r�rPr\rmr�r�r�r�r�r�rpr
r
r
rrt�s0�
.

&
		)+
rt)rxrrr	�ImportError�rrrr�logrrrr'r"r.�objectrZ_FlowControlMixinZ	TransportrKZProtocolrtr
r
r
r�<module>s*
y�xasyncio/__pycache__/base_subprocess.cpython-38.opt-2.pyc000064400000022006151153537520017202 0ustar00U

e5d�"�@sxddlZddlZddlZddlmZddlmZddlmZGdd�dej�Z	Gdd	�d	ej
�ZGd
d�deej�Z
dS)�N�)�	protocols)�
transports)�loggercs�eZdZd0�fdd�	Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	e
jfdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Z�ZS)1�BaseSubprocessTransportNc
	s&t��|
�d|_||_||_d|_d|_d|_g|_t	�
�|_i|_d|_
|tjkr`d|jd<|tjkrtd|jd<|tjkr�d|jd<z"|jf||||||d�|��Wn|���YnX|jj|_|j|jd<|j���rt|ttf�r�|}n|d}t�d||j�|j�|�|	��dS)NFrr�)�args�shell�stdin�stdout�stderr�bufsize�
subprocesszprocess %r created: pid %s)�super�__init__�_closed�	_protocol�_loop�_proc�_pid�_returncode�
_exit_waiters�collections�deque�_pending_calls�_pipes�	_finishedr�PIPE�_start�close�pidZ_extra�	get_debug�
isinstance�bytes�strr�debugZcreate_task�_connect_pipes)
�self�loop�protocolrr	r
rrr
�waiterZextra�kwargsZprogram��	__class__��//usr/lib64/python3.8/asyncio/base_subprocess.pyrsL






��

�z BaseSubprocessTransport.__init__cCs|jjg}|jr|�d�|jdk	r6|�d|j���|jdk	rT|�d|j���n |jdk	rj|�d�n
|�d�|j�d�}|dk	r�|�d|j���|j�d�}|j�d	�}|dk	r�||kr�|�d
|j���n6|dk	r�|�d|j���|dk	�r|�d|j���d
�	d�
|��S)N�closedzpid=zreturncode=Zrunningznot startedrzstdin=rrzstdout=stderr=zstdout=zstderr=z<{}>� )r-�__name__r�appendrrr�get�pipe�format�join)r'�infor
rrr.r.r/�__repr__7s,






z BaseSubprocessTransport.__repr__cKst�dS�N)�NotImplementedError)r'rr	r
rrr
r+r.r.r/rTszBaseSubprocessTransport._startcCs
||_dSr:�r)r'r)r.r.r/�set_protocolWsz$BaseSubprocessTransport.set_protocolcCs|jSr:r<�r'r.r.r/�get_protocolZsz$BaseSubprocessTransport.get_protocolcCs|jSr:)rr>r.r.r/�
is_closing]sz"BaseSubprocessTransport.is_closingcCs�|jr
dSd|_|j��D]}|dkr(q|j��q|jdk	r�|jdkr�|j��dkr�|j�	�rlt
�d|�z|j��Wnt
k
r�YnXdS)NTz$Close running child process: kill %r)rr�valuesr5rrrZpollrr!rZwarning�kill�ProcessLookupError)r'�protor.r.r/r`s$
��
zBaseSubprocessTransport.closecCs&|js"|d|��t|d�|��dS)Nzunclosed transport )�source)r�ResourceWarningr)r'Z_warnr.r.r/�__del__{szBaseSubprocessTransport.__del__cCs|jSr:)rr>r.r.r/�get_pid�szBaseSubprocessTransport.get_pidcCs|jSr:)rr>r.r.r/�get_returncode�sz&BaseSubprocessTransport.get_returncodecCs||jkr|j|jSdSdSr:)rr5)r'�fdr.r.r/�get_pipe_transport�s
z*BaseSubprocessTransport.get_pipe_transportcCs|jdkrt��dSr:)rrCr>r.r.r/�_check_proc�s
z#BaseSubprocessTransport._check_proccCs|��|j�|�dSr:)rLr�send_signal)r'�signalr.r.r/rM�sz#BaseSubprocessTransport.send_signalcCs|��|j��dSr:)rLr�	terminater>r.r.r/rO�sz!BaseSubprocessTransport.terminatecCs|��|j��dSr:)rLrrBr>r.r.r/rB�szBaseSubprocessTransport.killc	
�s`z�j}�j}|jdk	rB|��fdd�|j�IdH\}}|�jd<|jdk	rv|��fdd�|j�IdH\}}|�jd<|jdk	r�|��fdd�|j�IdH\}}|�jd<|��j	j
���jD]\}}|j|f|��q�d�_WnZtt
fk
r��Yn`tk
�r<}z"|dk	�r,|���s,|�|�W5d}~XYn X|dk	�r\|���s\|�d�dS)Ncs
t�d�S)Nr)�WriteSubprocessPipeProtor.r>r.r/�<lambda>��z8BaseSubprocessTransport._connect_pipes.<locals>.<lambda>rcs
t�d�S)Nr��ReadSubprocessPipeProtor.r>r.r/rQ�rRrcs
t�d�S)NrrSr.r>r.r/rQ�rRr)rrr
Zconnect_write_piperrZconnect_read_piper�	call_soonr�connection_mader�
SystemExit�KeyboardInterrupt�
BaseException�	cancelledZ
set_exception�
set_result)	r'r*�procr(�_r5�callback�data�excr.r>r/r&�s@

�


�


�

z&BaseSubprocessTransport._connect_pipescGs2|jdk	r|j�||f�n|jj|f|��dSr:)rr3rrU)r'�cbr_r.r.r/�_call�s
zBaseSubprocessTransport._callcCs|�|jj||�|��dSr:)rbrZpipe_connection_lost�_try_finish)r'rJr`r.r.r/�_pipe_connection_lost�sz-BaseSubprocessTransport._pipe_connection_lostcCs|�|jj||�dSr:)rbrZpipe_data_received)r'rJr_r.r.r/�_pipe_data_received�sz+BaseSubprocessTransport._pipe_data_receivedcCsp|j��rt�d||�||_|jjdkr2||j_|�|jj	�|�
�|jD]}|��sN|�
|�qNd|_dS)Nz%r exited with return code %r)rr!rr8rr�
returncoderbrZprocess_exitedrcrrZr[)r'rfr*r.r.r/�_process_exited�s

z'BaseSubprocessTransport._process_exitedc�s0|jdk	r|jS|j��}|j�|�|IdHSr:)rrZ
create_futurerr3)r'r*r.r.r/�_wait�s


zBaseSubprocessTransport._waitcCs>|jdkrdStdd�|j��D��r:d|_|�|jd�dS)Ncss|]}|dk	o|jVqdSr:)�disconnected)�.0�pr.r.r/�	<genexpr>�s�z6BaseSubprocessTransport._try_finish.<locals>.<genexpr>T)r�allrrArrb�_call_connection_lostr>r.r.r/rc�s
�z#BaseSubprocessTransport._try_finishcCs*z|j�|�W5d|_d|_d|_XdSr:)rrr�connection_lost�r'r`r.r.r/rn�s
z-BaseSubprocessTransport._call_connection_lost)NN)r2�
__module__�__qualname__rr9rr=r?r@r�warnings�warnrGrHrIrKrLrMrOrBr&rbrdrergrhrcrn�
__classcell__r.r.r,r/r
s2�+&	rc@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)rPcCs||_||_d|_d|_dS)NF)r\rJr5ri)r'r\rJr.r.r/rsz!WriteSubprocessPipeProto.__init__cCs
||_dSr:)r5)r'Z	transportr.r.r/rVsz(WriteSubprocessPipeProto.connection_madecCs d|jj�d|j�d|j�d�S)N�<z fd=z pipe=�>)r-r2rJr5r>r.r.r/r9
sz!WriteSubprocessPipeProto.__repr__cCs d|_|j�|j|�d|_dS)NT)rir\rdrJrpr.r.r/ro
sz(WriteSubprocessPipeProto.connection_lostcCs|jj��dSr:)r\r�
pause_writingr>r.r.r/rxsz&WriteSubprocessPipeProto.pause_writingcCs|jj��dSr:)r\r�resume_writingr>r.r.r/rysz'WriteSubprocessPipeProto.resume_writingN)	r2rqrrrrVr9rorxryr.r.r.r/rP�srPc@seZdZdd�ZdS)rTcCs|j�|j|�dSr:)r\rerJ)r'r_r.r.r/�
data_receivedsz%ReadSubprocessPipeProto.data_receivedN)r2rqrrrzr.r.r.r/rTsrT)rrrs�rr�logrZSubprocessTransportrZBaseProtocolrPZProtocolrTr.r.r.r/�<module>sv�asyncio/__pycache__/base_subprocess.cpython-38.opt-1.pyc000064400000022152151153537520017203 0ustar00U

e5d�"�@sxddlZddlZddlZddlmZddlmZddlmZGdd�dej�Z	Gdd	�d	ej
�ZGd
d�deej�Z
dS)�N�)�	protocols)�
transports)�loggercs�eZdZd0�fdd�	Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	e
jfdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Z�ZS)1�BaseSubprocessTransportNc
	s&t��|
�d|_||_||_d|_d|_d|_g|_t	�
�|_i|_d|_
|tjkr`d|jd<|tjkrtd|jd<|tjkr�d|jd<z"|jf||||||d�|��Wn|���YnX|jj|_|j|jd<|j���rt|ttf�r�|}n|d}t�d||j�|j�|�|	��dS)NFrr�)�args�shell�stdin�stdout�stderr�bufsize�
subprocesszprocess %r created: pid %s)�super�__init__�_closed�	_protocol�_loop�_proc�_pid�_returncode�
_exit_waiters�collections�deque�_pending_calls�_pipes�	_finishedr�PIPE�_start�close�pidZ_extra�	get_debug�
isinstance�bytes�strr�debugZcreate_task�_connect_pipes)
�self�loop�protocolrr	r
rrr
�waiterZextra�kwargsZprogram��	__class__��//usr/lib64/python3.8/asyncio/base_subprocess.pyrsL






��

�z BaseSubprocessTransport.__init__cCs|jjg}|jr|�d�|jdk	r6|�d|j���|jdk	rT|�d|j���n |jdk	rj|�d�n
|�d�|j�d�}|dk	r�|�d|j���|j�d�}|j�d	�}|dk	r�||kr�|�d
|j���n6|dk	r�|�d|j���|dk	�r|�d|j���d
�	d�
|��S)N�closedzpid=zreturncode=Zrunningznot startedrzstdin=rrzstdout=stderr=zstdout=zstderr=z<{}>� )r-�__name__r�appendrrr�get�pipe�format�join)r'�infor
rrr.r.r/�__repr__7s,






z BaseSubprocessTransport.__repr__cKst�dS�N)�NotImplementedError)r'rr	r
rrr
r+r.r.r/rTszBaseSubprocessTransport._startcCs
||_dSr:�r)r'r)r.r.r/�set_protocolWsz$BaseSubprocessTransport.set_protocolcCs|jSr:r<�r'r.r.r/�get_protocolZsz$BaseSubprocessTransport.get_protocolcCs|jSr:)rr>r.r.r/�
is_closing]sz"BaseSubprocessTransport.is_closingcCs�|jr
dSd|_|j��D]}|dkr(q|j��q|jdk	r�|jdkr�|j��dkr�|j�	�rlt
�d|�z|j��Wnt
k
r�YnXdS)NTz$Close running child process: kill %r)rr�valuesr5rrrZpollrr!rZwarning�kill�ProcessLookupError)r'�protor.r.r/r`s$
��
zBaseSubprocessTransport.closecCs&|js"|d|��t|d�|��dS)Nzunclosed transport )�source)r�ResourceWarningr)r'Z_warnr.r.r/�__del__{szBaseSubprocessTransport.__del__cCs|jSr:)rr>r.r.r/�get_pid�szBaseSubprocessTransport.get_pidcCs|jSr:)rr>r.r.r/�get_returncode�sz&BaseSubprocessTransport.get_returncodecCs||jkr|j|jSdSdSr:)rr5)r'�fdr.r.r/�get_pipe_transport�s
z*BaseSubprocessTransport.get_pipe_transportcCs|jdkrt��dSr:)rrCr>r.r.r/�_check_proc�s
z#BaseSubprocessTransport._check_proccCs|��|j�|�dSr:)rLr�send_signal)r'�signalr.r.r/rM�sz#BaseSubprocessTransport.send_signalcCs|��|j��dSr:)rLr�	terminater>r.r.r/rO�sz!BaseSubprocessTransport.terminatecCs|��|j��dSr:)rLrrBr>r.r.r/rB�szBaseSubprocessTransport.killc	
�s`z�j}�j}|jdk	rB|��fdd�|j�IdH\}}|�jd<|jdk	rv|��fdd�|j�IdH\}}|�jd<|jdk	r�|��fdd�|j�IdH\}}|�jd<|��j	j
���jD]\}}|j|f|��q�d�_WnZtt
fk
r��Yn`tk
�r<}z"|dk	�r,|���s,|�|�W5d}~XYn X|dk	�r\|���s\|�d�dS)Ncs
t�d�S)Nr)�WriteSubprocessPipeProtor.r>r.r/�<lambda>��z8BaseSubprocessTransport._connect_pipes.<locals>.<lambda>rcs
t�d�S)Nr��ReadSubprocessPipeProtor.r>r.r/rQ�rRrcs
t�d�S)NrrSr.r>r.r/rQ�rRr)rrr
Zconnect_write_piperrZconnect_read_piper�	call_soonr�connection_mader�
SystemExit�KeyboardInterrupt�
BaseException�	cancelledZ
set_exception�
set_result)	r'r*�procr(�_r5�callback�data�excr.r>r/r&�s@

�


�


�

z&BaseSubprocessTransport._connect_pipescGs2|jdk	r|j�||f�n|jj|f|��dSr:)rr3rrU)r'�cbr_r.r.r/�_call�s
zBaseSubprocessTransport._callcCs|�|jj||�|��dSr:)rbrZpipe_connection_lost�_try_finish)r'rJr`r.r.r/�_pipe_connection_lost�sz-BaseSubprocessTransport._pipe_connection_lostcCs|�|jj||�dSr:)rbrZpipe_data_received)r'rJr_r.r.r/�_pipe_data_received�sz+BaseSubprocessTransport._pipe_data_receivedcCsp|j��rt�d||�||_|jjdkr2||j_|�|jj	�|�
�|jD]}|��sN|�
|�qNd|_dS)Nz%r exited with return code %r)rr!rr8rr�
returncoderbrZprocess_exitedrcrrZr[)r'rfr*r.r.r/�_process_exited�s

z'BaseSubprocessTransport._process_exitedc�s0|jdk	r|jS|j��}|j�|�|IdHS)zdWait until the process exit and return the process return code.

        This method is a coroutine.N)rrZ
create_futurerr3)r'r*r.r.r/�_wait�s


zBaseSubprocessTransport._waitcCs>|jdkrdStdd�|j��D��r:d|_|�|jd�dS)Ncss|]}|dk	o|jVqdSr:)�disconnected)�.0�pr.r.r/�	<genexpr>�s�z6BaseSubprocessTransport._try_finish.<locals>.<genexpr>T)r�allrrArrb�_call_connection_lostr>r.r.r/rc�s
�z#BaseSubprocessTransport._try_finishcCs*z|j�|�W5d|_d|_d|_XdSr:)rrr�connection_lost�r'r`r.r.r/rn�s
z-BaseSubprocessTransport._call_connection_lost)NN)r2�
__module__�__qualname__rr9rr=r?r@r�warnings�warnrGrHrIrKrLrMrOrBr&rbrdrergrhrcrn�
__classcell__r.r.r,r/r
s2�+&	rc@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)rPcCs||_||_d|_d|_dS)NF)r\rJr5ri)r'r\rJr.r.r/rsz!WriteSubprocessPipeProto.__init__cCs
||_dSr:)r5)r'Z	transportr.r.r/rVsz(WriteSubprocessPipeProto.connection_madecCs d|jj�d|j�d|j�d�S)N�<z fd=z pipe=�>)r-r2rJr5r>r.r.r/r9
sz!WriteSubprocessPipeProto.__repr__cCs d|_|j�|j|�d|_dS)NT)rir\rdrJrpr.r.r/ro
sz(WriteSubprocessPipeProto.connection_lostcCs|jj��dSr:)r\r�
pause_writingr>r.r.r/rxsz&WriteSubprocessPipeProto.pause_writingcCs|jj��dSr:)r\r�resume_writingr>r.r.r/rysz'WriteSubprocessPipeProto.resume_writingN)	r2rqrrrrVr9rorxryr.r.r.r/rP�srPc@seZdZdd�ZdS)rTcCs|j�|j|�dSr:)r\rerJ)r'r_r.r.r/�
data_receivedsz%ReadSubprocessPipeProto.data_receivedN)r2rqrrrzr.r.r.r/rTsrT)rrrs�rr�logrZSubprocessTransportrZBaseProtocolrPZProtocolrTr.r.r.r/�<module>sv�asyncio/__pycache__/trsock.cpython-38.pyc000064400000020445151153537520014372 0ustar00U

e5d��@s"ddlZddlZGdd�d�ZdS)�Nc@s�eZdZdZdZejd�dd�Zdd�Zedd	��Z	ed
d��Z
edd
��Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Z d8d9�Z!d:d;�Z"d<d=�Z#d>d?�Z$d@dA�Z%dBdC�Z&dDdE�Z'dFdG�Z(dHdI�Z)dJdK�Z*dLdM�Z+dNdO�Z,dPdQ�Z-dRdS�Z.dTdU�Z/dVdW�Z0dXdY�Z1dZd[�Z2d\S)]�TransportSocketz�A socket-like wrapper for exposing real transport sockets.

    These objects can be safely returned by APIs like
    `transport.get_extra_info('socket')`.  All potentially disruptive
    operations (like "socket.close()") are banned.
    ��_sock)�sockcCs
||_dS�Nr)�selfr�r�&/usr/lib64/python3.8/asyncio/trsock.py�__init__szTransportSocket.__init__cCstjd|�d�t|d�dS)NzUsing z� on sockets returned from get_extra_info('socket') will be prohibited in asyncio 3.9. Please report your use case to bugs.python.org.)�source)�warnings�warn�DeprecationWarning)rZwhatrrr	�_nas

�zTransportSocket._nacCs|jjSr)r�family�rrrr	rszTransportSocket.familycCs|jjSr)r�typerrrr	rszTransportSocket.typecCs|jjSr)r�protorrrr	r"szTransportSocket.protocCs�d|���d|j�d|j�d|j��}|��dkr�z|��}|rN|�d|��}Wntjk
rfYnXz|��}|r�|�d|��}Wntjk
r�YnX|�d�S)	Nz<asyncio.TransportSocket fd=z	, family=z, type=z, proto=���z, laddr=z, raddr=�>)�filenorrr�getsockname�socket�error�getpeername)r�sZladdrZraddrrrr	�__repr__&s $�zTransportSocket.__repr__cCstd��dS)Nz/Cannot serialize asyncio.TransportSocket object)�	TypeErrorrrrr	�__getstate__=szTransportSocket.__getstate__cCs
|j��Sr)rrrrrr	r@szTransportSocket.filenocCs
|j��Sr)r�duprrrr	rCszTransportSocket.dupcCs
|j��Sr)r�get_inheritablerrrr	r FszTransportSocket.get_inheritablecCs|j�|�dSr)r�shutdown)rZhowrrr	r!IszTransportSocket.shutdowncOs|jj||�Sr)r�
getsockopt�r�args�kwargsrrr	r"NszTransportSocket.getsockoptcOs|jj||�dSr)r�
setsockoptr#rrr	r&QszTransportSocket.setsockoptcCs
|j��Sr)rrrrrr	rTszTransportSocket.getpeernamecCs
|j��Sr)rrrrrr	rWszTransportSocket.getsocknamecCs
|j��Sr)r�
getsockbynamerrrr	r'ZszTransportSocket.getsockbynamecCs|�d�|j��S)Nzaccept() method)rr�acceptrrrr	r(]s
zTransportSocket.acceptcOs|�d�|jj||�S)Nzconnect() method)rr�connectr#rrr	r)as
zTransportSocket.connectcOs|�d�|jj||�S)Nzconnect_ex() method)rr�
connect_exr#rrr	r*es
zTransportSocket.connect_excOs|�d�|jj||�S)Nz
bind() method)rr�bindr#rrr	r+is
zTransportSocket.bindcOs|�d�|jj||�S)Nzioctl() method)rr�ioctlr#rrr	r,ms
zTransportSocket.ioctlcOs|�d�|jj||�S)Nzlisten() method)rr�listenr#rrr	r-qs
zTransportSocket.listencCs|�d�|j��S)Nzmakefile() method)rr�makefilerrrr	r.us
zTransportSocket.makefilecOs|�d�|jj||�S)Nzsendfile() method)rr�sendfiler#rrr	r/ys
zTransportSocket.sendfilecCs|�d�|j��S)Nzclose() method)rr�closerrrr	r0}s
zTransportSocket.closecCs|�d�|j��S)Nzdetach() method)rr�detachrrrr	r1�s
zTransportSocket.detachcOs|�d�|jj||�S)Nzsendmsg_afalg() method)rr�
sendmsg_afalgr#rrr	r2�s
zTransportSocket.sendmsg_afalgcOs|�d�|jj||�S)Nzsendmsg() method)rr�sendmsgr#rrr	r3�s
zTransportSocket.sendmsgcOs|�d�|jj||�S)Nzsendto() method)rr�sendtor#rrr	r4�s
zTransportSocket.sendtocOs|�d�|jj||�S)Nz
send() method)rr�sendr#rrr	r5�s
zTransportSocket.sendcOs|�d�|jj||�S)Nzsendall() method)rr�sendallr#rrr	r6�s
zTransportSocket.sendallcOs|�d�|jj||�S)Nzset_inheritable() method)rr�set_inheritabler#rrr	r7�s
zTransportSocket.set_inheritablecCs|�d�|j�|�S)Nzshare() method)rr�share)rZ
process_idrrr	r8�s
zTransportSocket.sharecOs|�d�|jj||�S)Nzrecv_into() method)rr�	recv_intor#rrr	r9�s
zTransportSocket.recv_intocOs|�d�|jj||�S)Nzrecvfrom_into() method)rr�
recvfrom_intor#rrr	r:�s
zTransportSocket.recvfrom_intocOs|�d�|jj||�S)Nzrecvmsg_into() method)rr�recvmsg_intor#rrr	r;�s
zTransportSocket.recvmsg_intocOs|�d�|jj||�S)Nzrecvmsg() method)rr�recvmsgr#rrr	r<�s
zTransportSocket.recvmsgcOs|�d�|jj||�S)Nzrecvfrom() method)rr�recvfromr#rrr	r=�s
zTransportSocket.recvfromcOs|�d�|jj||�S)Nz
recv() method)rr�recvr#rrr	r>�s
zTransportSocket.recvcCs|dkrdStd��dS)Nrz<settimeout(): only 0 timeout is allowed on transport sockets��
ValueError)r�valuerrr	�
settimeout�s
�zTransportSocket.settimeoutcCsdS)Nrrrrrr	�
gettimeout�szTransportSocket.gettimeoutcCs|sdStd��dS)Nz3setblocking(): transport sockets cannot be blockingr?)r�flagrrr	�setblocking�s
�zTransportSocket.setblockingcCs|�d�|j��S�Nzcontext manager protocol)rr�	__enter__rrrr	rG�s
zTransportSocket.__enter__cGs|�d�|jj|�SrF)rr�__exit__)r�errrrr	rH�s
zTransportSocket.__exit__N)3�__name__�
__module__�__qualname__�__doc__�	__slots__rr
r�propertyrrrrrrrr r!r"r&rrr'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>rBrCrErGrHrrrr	rsb


r)rrrrrrr	�<module>sasyncio/__pycache__/transports.cpython-38.opt-1.pyc000064400000027712151153537520016247 0ustar00U

e5d�(�@s|dZdZGdd�d�ZGdd�de�ZGdd�de�ZGdd	�d	ee�ZGd
d�de�ZGdd
�d
e�ZGdd�de�ZdS)zAbstract Transport class.)�
BaseTransport�
ReadTransport�WriteTransport�	Transport�DatagramTransport�SubprocessTransportc@sHeZdZdZdZddd�Zddd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)rzBase class for transports.��_extraNcCs|dkri}||_dS�Nr)�self�extra�r�*/usr/lib64/python3.8/asyncio/transports.py�__init__szBaseTransport.__init__cCs|j�||�S)z#Get optional transport information.)r�get)r
�name�defaultrrr
�get_extra_infoszBaseTransport.get_extra_infocCst�dS)z2Return True if the transport is closing or closed.N��NotImplementedError�r
rrr
�
is_closingszBaseTransport.is_closingcCst�dS)aClose the transport.

        Buffered data will be flushed asynchronously.  No more data
        will be received.  After all buffered data is flushed, the
        protocol's connection_lost() method will (eventually) be
        called with None as its argument.
        Nrrrrr
�closeszBaseTransport.closecCst�dS)zSet a new protocol.Nr)r
�protocolrrr
�set_protocol%szBaseTransport.set_protocolcCst�dS)zReturn the current protocol.Nrrrrr
�get_protocol)szBaseTransport.get_protocol)N)N)�__name__�
__module__�__qualname__�__doc__�	__slots__rrrrrrrrrr
r	s


rc@s,eZdZdZdZdd�Zdd�Zdd�Zd	S)
rz#Interface for read-only transports.rcCst�dS)z*Return True if the transport is receiving.Nrrrrr
�
is_reading3szReadTransport.is_readingcCst�dS)z�Pause the receiving end.

        No data will be passed to the protocol's data_received()
        method until resume_reading() is called.
        Nrrrrr
�
pause_reading7szReadTransport.pause_readingcCst�dS)z�Resume the receiving end.

        Data received will once again be passed to the protocol's
        data_received() method.
        Nrrrrr
�resume_reading?szReadTransport.resume_readingN)rrrrrr r!r"rrrr
r.s
rc@sNeZdZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�ZdS)rz$Interface for write-only transports.rNcCst�dS)a�Set the high- and low-water limits for write flow control.

        These two values control when to call the protocol's
        pause_writing() and resume_writing() methods.  If specified,
        the low-water limit must be less than or equal to the
        high-water limit.  Neither value can be negative.

        The defaults are implementation-specific.  If only the
        high-water limit is given, the low-water limit defaults to an
        implementation-specific value less than or equal to the
        high-water limit.  Setting high to zero forces low to zero as
        well, and causes pause_writing() to be called whenever the
        buffer becomes non-empty.  Setting low to zero causes
        resume_writing() to be called only once the buffer is empty.
        Use of zero for either limit is generally sub-optimal as it
        reduces opportunities for doing I/O and computation
        concurrently.
        Nr�r
�high�lowrrr
�set_write_buffer_limitsMsz&WriteTransport.set_write_buffer_limitscCst�dS)z,Return the current size of the write buffer.Nrrrrr
�get_write_buffer_sizebsz$WriteTransport.get_write_buffer_sizecCst�dS)z�Write some data bytes to the transport.

        This does not block; it buffers the data and arranges for it
        to be sent out asynchronously.
        Nr)r
�datarrr
�writefszWriteTransport.writecCsd�|�}|�|�dS)z�Write a list (or any iterable) of data bytes to the transport.

        The default implementation concatenates the arguments and
        calls write() on the result.
        �N)�joinr))r
Zlist_of_datar(rrr
�
writelinesns
zWriteTransport.writelinescCst�dS)z�Close the write end after flushing buffered data.

        (This is like typing ^D into a UNIX program reading from stdin.)

        Data may still be received.
        Nrrrrr
�	write_eofwszWriteTransport.write_eofcCst�dS)zAReturn True if this transport supports write_eof(), False if not.Nrrrrr
�
can_write_eof�szWriteTransport.can_write_eofcCst�dS�z�Close the transport immediately.

        Buffered data will be lost.  No more data will be received.
        The protocol's connection_lost() method will (eventually) be
        called with None as its argument.
        Nrrrrr
�abort�szWriteTransport.abort)NN)rrrrrr&r'r)r,r-r.r0rrrr
rHs
		rc@seZdZdZdZdS)raSInterface representing a bidirectional transport.

    There may be several implementations, but typically, the user does
    not implement new transports; rather, the platform provides some
    useful transports that are implemented using the platform's best
    practices.

    The user never instantiates a transport directly; they call a
    utility function, passing it a protocol factory and other
    information necessary to create the transport and protocol.  (E.g.
    EventLoop.create_connection() or EventLoop.create_server().)

    The utility function will asynchronously create a transport and a
    protocol and hook them up by calling the protocol's
    connection_made() method, passing it the transport.

    The implementation here raises NotImplemented for every method
    except writelines(), which calls write() in a loop.
    rN)rrrrrrrrr
r�src@s&eZdZdZdZddd�Zdd�ZdS)	rz(Interface for datagram (UDP) transports.rNcCst�dS)aSend data to the transport.

        This does not block; it buffers the data and arranges for it
        to be sent out asynchronously.
        addr is target socket address.
        If addr is None use target address pointed on transport creation.
        Nr)r
r(Zaddrrrr
�sendto�szDatagramTransport.sendtocCst�dSr/rrrrr
r0�szDatagramTransport.abort)N)rrrrrr1r0rrrr
r�s

rc@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)rrcCst�dS)zGet subprocess id.Nrrrrr
�get_pid�szSubprocessTransport.get_pidcCst�dS)z�Get subprocess returncode.

        See also
        http://docs.python.org/3/library/subprocess#subprocess.Popen.returncode
        Nrrrrr
�get_returncode�sz"SubprocessTransport.get_returncodecCst�dS)z&Get transport for pipe with number fd.Nr)r
�fdrrr
�get_pipe_transport�sz&SubprocessTransport.get_pipe_transportcCst�dS)z�Send signal to subprocess.

        See also:
        docs.python.org/3/library/subprocess#subprocess.Popen.send_signal
        Nr)r
�signalrrr
�send_signal�szSubprocessTransport.send_signalcCst�dS)aLStop the subprocess.

        Alias for close() method.

        On Posix OSs the method sends SIGTERM to the subprocess.
        On Windows the Win32 API function TerminateProcess()
         is called to stop the subprocess.

        See also:
        http://docs.python.org/3/library/subprocess#subprocess.Popen.terminate
        Nrrrrr
�	terminate�szSubprocessTransport.terminatecCst�dS)z�Kill the subprocess.

        On Posix OSs the function sends SIGKILL to the subprocess.
        On Windows kill() is an alias for terminate().

        See also:
        http://docs.python.org/3/library/subprocess#subprocess.Popen.kill
        Nrrrrr
�kill�s	zSubprocessTransport.killN)
rrrrr2r3r5r7r8r9rrrr
r�srcsZeZdZdZdZd�fdd�	Zdd�Zdd	�Zd
d�Zddd
�Z	ddd�Z
dd�Z�ZS)�_FlowControlMixinavAll the logic for (write) flow control in a mix-in base class.

    The subclass must implement get_write_buffer_size().  It must call
    _maybe_pause_protocol() whenever the write buffer size increases,
    and _maybe_resume_protocol() whenever it decreases.  It may also
    override set_write_buffer_limits() (e.g. to specify different
    defaults).

    The subclass constructor must call super().__init__(extra).  This
    will call set_write_buffer_limits().

    The user may call set_write_buffer_limits() and
    get_write_buffer_size(), and their protocol's pause_writing() and
    resume_writing() may be called.
    )�_loop�_protocol_paused�_high_water�
_low_waterNcs$t��|�||_d|_|��dS)NF)�superrr;r<�_set_write_buffer_limits)r
rZloop��	__class__rr
rsz_FlowControlMixin.__init__c
Cs�|��}||jkrdS|js�d|_z|j��WnRttfk
rJ�Yn:tk
r�}z|j�	d|||jd��W5d}~XYnXdS)NTzprotocol.pause_writing() failed��messageZ	exceptionZ	transportr)
r'r=r<�	_protocolZ
pause_writing�
SystemExit�KeyboardInterrupt�
BaseExceptionr;�call_exception_handler)r
�size�excrrr
�_maybe_pause_protocols 
�z'_FlowControlMixin._maybe_pause_protocolc
Cs�|jr||��|jkr|d|_z|j��WnRttfk
rB�Yn:tk
rz}z|j�	d|||jd��W5d}~XYnXdS)NFz protocol.resume_writing() failedrC)
r<r'r>rEZresume_writingrFrGrHr;rI)r
rKrrr
�_maybe_resume_protocol!s��z(_FlowControlMixin._maybe_resume_protocolcCs|j|jfSr	)r>r=rrrr
�get_write_buffer_limits1sz)_FlowControlMixin.get_write_buffer_limitscCsj|dkr|dkrd}nd|}|dkr.|d}||krBdksZntd|�d|�d���||_||_dS)Ni��zhigh (z) must be >= low (z) must be >= 0)�
ValueErrorr=r>r#rrr
r@4s�z*_FlowControlMixin._set_write_buffer_limitscCs|j||d�|��dS)N)r$r%)r@rLr#rrr
r&Dsz)_FlowControlMixin.set_write_buffer_limitscCst�dSr	rrrrr
r'Hsz'_FlowControlMixin.get_write_buffer_size)NN)NN)NN)
rrrrrrrLrMrNr@r&r'�
__classcell__rrrAr
r:�s

r:N)	r�__all__rrrrrrr:rrrr
�<module>s%F6asyncio/__pycache__/__main__.cpython-38.opt-1.pyc000064400000006102151153537520015536 0ustar00U

e5d
�@sJddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZGdd�dej�Z
Gdd�dej�Zedk�rFe��Ze�e�d	eiZd
D]Ze�eee<q�e
ee�ZdadazddlZWnek
r�YnXe�Zde_e��ze��Wn6e k
�r>t�r6t�!��s6t�"�daYq�Yq�X�qFq�dS)
�N�)�futurescs$eZdZ�fdd�Zdd�Z�ZS)�AsyncIOInteractiveConsolecs*t��|�|jjjtjO_||_dS)N)�super�__init__�compileZcompiler�flags�astZPyCF_ALLOW_TOP_LEVEL_AWAIT�loop)�self�localsr
��	__class__��(/usr/lib64/python3.8/asyncio/__main__.pyrsz"AsyncIOInteractiveConsole.__init__csttj������fdd�}t�|�z
���WStk
rD�Yn,tk
rntrb��	d�n��
�YnXdS)Nc
sdadat���j�}z
|�}Wnztk
r6�Ynftk
rj}zda��|�WY�dSd}~XYn2tk
r�}z��|�WY�dSd}~XYnXt	�
|�s���|�dSz�j�
|�at�t��Wn.tk
�r�}z��|�W5d}~XYnXdS)NFT)�repl_future�repl_future_interrupted�types�FunctionTyper�
SystemExit�KeyboardInterruptZ
set_exception�
BaseException�inspectZiscoroutineZ
set_resultr
Zcreate_taskrZ
_chain_future)�func�coroZex�exc��codeZfuturerrr�callbacks,




z3AsyncIOInteractiveConsole.runcode.<locals>.callbackz
KeyboardInterrupt
)�
concurrentrZFuturer
�call_soon_threadsafe�resultrrr�writeZ
showtraceback)rrrrrr�runcodes


z!AsyncIOInteractiveConsole.runcode)�__name__�
__module__�__qualname__rr#�
__classcell__rrr
rrsrc@seZdZdd�ZdS)�
REPLThreadcCsZz6dtj�dtj�dt	tdd��d	�}t
j|d
d�W5tjddtd�t�tj�XdS)N�ignorez ^coroutine .* was never awaited$)�message�categoryz
asyncio REPL z on zy
Use "await" directly instead of "asyncio.run()".
Type "help", "copyright", "credits" or "license" for more information.
Zps1z>>> zimport asynciozexiting asyncio REPL...)�bannerZexitmsg)�warnings�filterwarnings�RuntimeWarningr
r �stop�sys�version�platform�getattr�consoleZinteract)rr,rrr�runFs"��
�zREPLThread.runN)r$r%r&r6rrrrr(Dsr(�__main__�asyncio>�__builtins__�__spec__r$�__file__�
__loader__�__package__FT)#r	r8rZconcurrent.futuresrrr1Z	threadingrr-�rZInteractiveConsolerZThreadr(r$Znew_event_loopr
Zset_event_loopZrepl_locals�keyrr5rr�readline�ImportErrorZrepl_threadZdaemon�startZrun_foreverrZdoneZcancelrrrr�<module>sF6



asyncio/__pycache__/base_tasks.cpython-38.opt-2.pyc000064400000003632151153537520016143 0ustar00U

e5d�	�@sDddlZddlZddlmZddlmZdd�Zdd�Zd	d
�ZdS)�N�)�base_futures)�
coroutinescCsnt�|�}|jrd|d<|�dd|���t�|j�}|�dd|�d��|jdk	rj|�dd	|j���|S)
NZ
cancellingrrzname=%r�zcoro=<�>�z	wait_for=)	rZ_future_repr_infoZ_must_cancel�insertZget_namerZ_format_coroutine�_coroZ_fut_waiter)�task�info�coro�r
�*/usr/lib64/python3.8/asyncio/base_tasks.py�_task_repr_infos

rcCs�g}t|jd�r|jj}n0t|jd�r0|jj}nt|jd�rF|jj}nd}|dk	r�|dk	r�|dk	rt|dkrlq�|d8}|�|�|j}qR|��nH|jdk	r�|jj	}|dk	r�|dk	r�|dkr�q�|d8}|�|j
�|j}q�|S)N�cr_frame�gi_frame�ag_framerr)�hasattrr	rrr�append�f_back�reverse�
_exception�
__traceback__�tb_frame�tb_next)r
�limitZframes�f�tbr
r
r�_task_get_stacks6





rcCs�g}t�}|j|d�D]Z}|j}|j}|j}|j}	||krN|�|�t�|�t�	|||j
�}
|�|||	|
f�q|j}|s�t
d|��|d�n2|dk	r�t
d|�d�|d�nt
d|�d�|d�tj||d�|dk	r�t�|j|�D]}
t
|
|dd�q�dS)	N)rz
No stack for )�filezTraceback for z (most recent call last):z
Stack for �)r�end)�setZ	get_stack�f_lineno�f_code�co_filename�co_name�add�	linecache�
checkcache�getline�	f_globalsrr�print�	traceback�
print_list�format_exception_only�	__class__)r
rr�extracted_list�checkedr�lineno�co�filename�name�line�excr
r
r�_task_print_stack<s,

r9)r(r-r rrrrr9r
r
r
r�<module>s#asyncio/__pycache__/base_futures.cpython-38.opt-1.pyc000064400000003554151153537520016515 0ustar00U

e5d
�@sRdZddlZddlmZddlmZdZdZdZd	d
�Z	dd�Z
e�Zd
d�Z
dS)��N)�	get_ident�)�format_helpersZPENDINGZ	CANCELLEDZFINISHEDcCst|jd�o|jdk	S)z�Check for a Future.

    This returns True when obj is a Future instance or is advertising
    itself as duck-type compatible by setting _asyncio_future_blocking.
    See comment in Future for more details.
    �_asyncio_future_blockingN)�hasattr�	__class__r)�objrr�,/usr/lib64/python3.8/asyncio/base_futures.py�isfutures�rcCs�t|�}|sd}dd�}|dkr2||dd�}n`|dkr`d�||dd�||dd��}n2|dkr�d�||dd�|d||d	d��}d
|�d�S)�#helper function for Future.__repr__�cSst�|d�S)Nr)rZ_format_callback_source)�callbackrrr
�	format_cbsz$_format_callbacks.<locals>.format_cbrr�z{}, {}z{}, <{} more>, {}���zcb=[�])�len�format)�cb�sizerrrr
�_format_callbackss&�rc	Cs�|j��g}|jtkr�|jdk	r4|�d|j���nTt|�t�f}|tkrPd}n(t�|�zt
�|j�}W5t�	|�X|�d|���|j
r�|�t|j
��|jr�|jd}|�d|d�d|d	���|S)
rNz
exception=z...zresult=rzcreated at r�:r)Z_state�lower�	_FINISHEDZ
_exception�append�idr�
_repr_running�add�discard�reprlib�reprZ_resultZ
_callbacksrZ_source_traceback)Zfuture�info�key�result�framerrr
�_future_repr_info7s$



r&)�__all__r �_threadrr
rZ_PENDINGZ
_CANCELLEDrrr�setrr&rrrr
�<module>sasyncio/__pycache__/windows_utils.cpython-38.pyc000064400000010571151153537520015776 0ustar00U

e5d��@s�dZddlZejdkred��ddlZddlZddlZddlZddlZddl	Z	ddl
Z
dZdZej
Z
ejZe��Zdded	�d
d�ZGdd
�d
�ZGdd�dej�ZdS)z)Various Windows specific bits and pieces.�NZwin32z
win32 only)�pipe�Popen�PIPE�
PipeHandlei F)TT)�duplex�
overlapped�bufsizec
Cs$tjd�t��tt��d�}|r>tj}tj	tj
B}||}}ntj}tj
}d|}}|tjO}|drp|tj
O}|dr�tj
}nd}d}	}
z\t�||tjd||tjtj�}	t�||dtjtj|tj�}
tj|	dd�}|�d�|	|
fWS|	dk	�rt�|	�|
dk	�rt�|
��YnXdS)zELike os.pipe() but with overlapped support and using handles not fds.z\\.\pipe\python-pipe-{:d}-{:d}-)�prefixr�NT�r)�tempfileZmktemp�format�os�getpid�next�
_mmap_counter�_winapiZPIPE_ACCESS_DUPLEXZGENERIC_READZ
GENERIC_WRITEZPIPE_ACCESS_INBOUNDZFILE_FLAG_FIRST_PIPE_INSTANCEZFILE_FLAG_OVERLAPPEDZCreateNamedPipeZ	PIPE_WAITZNMPWAIT_WAIT_FOREVERZNULLZ
CreateFileZ
OPEN_EXISTINGZConnectNamedPipeZGetOverlappedResult�CloseHandle)rrrZaddressZopenmode�accessZobsizeZibsizeZflags_and_attribsZh1Zh2Zov�r�-/usr/lib64/python3.8/asyncio/windows_utils.pyr sb��


��





rc@sbeZdZdZdd�Zdd�Zedd��Zdd	�Ze	j
d
�dd�Zej
fd
d�Zdd�Zdd�ZdS)rz�Wrapper for an overlapped pipe handle which is vaguely file-object like.

    The IOCP event loop can use these instead of socket objects.
    cCs
||_dS�N��_handle��self�handlerrr�__init__VszPipeHandle.__init__cCs2|jdk	rd|j��}nd}d|jj�d|�d�S)Nzhandle=�closed�<� �>)r�	__class__�__name__rrrr�__repr__Ys
zPipeHandle.__repr__cCs|jSrr�rrrrr`szPipeHandle.handlecCs|jdkrtd��|jS)NzI/O operation on closed pipe)r�
ValueErrorr%rrr�filenods
zPipeHandle.fileno)rcCs|jdk	r||j�d|_dSrr)rrrrr�closeis

zPipeHandle.closecCs*|jdk	r&|d|��t|d�|��dS)Nz	unclosed )�source)r�ResourceWarningr()rZ_warnrrr�__del__ns
zPipeHandle.__del__cCs|Srrr%rrr�	__enter__sszPipeHandle.__enter__cCs|��dSr)r()r�t�v�tbrrr�__exit__vszPipeHandle.__exit__N)r#�
__module__�__qualname__�__doc__rr$�propertyrr'rrr(�warnings�warnr+r,r0rrrrrQs
rcs"eZdZdZd�fdd�	Z�ZS)rz�Replacement for subprocess.Popen using overlapped pipe handles.

    The stdin, stdout, stderr are None or instances of PipeHandle.
    Nc	s�|�d�rt�|�dd�dks"t�d}}}d}	}
}|tkrbtddd�\}}	t�|tj�}n|}|tkr�tdd�\}
}
t�|
d�}n|}|tkr�tdd�\}}t�|d�}n|tkr�|}n|}z�z t
�j|f|||d	�|��Wn0|	|
|fD]}|dk	r�t�
|�q��Yn>X|	dk	�r,t|	�|_|
dk	�r@t|
�|_|dk	�rTt|�|_W5|tk�rlt�	|�|tk�r�t�	|�|tk�r�t�	|�XdS)
NZuniversal_newlinesrr)FTT)rr)TFr)�stdin�stdout�stderr)�get�AssertionErrorrr�msvcrtZopen_osfhandler�O_RDONLY�STDOUTr(�superrrrrr7r8r9)r�argsr7r8r9�kwdsZ	stdin_rfdZ
stdout_wfdZ
stderr_wfdZstdin_whZ	stdout_rhZ	stderr_rhZstdin_rhZ	stdout_whZ	stderr_wh�h�r"rrr�sR��










zPopen.__init__)NNN)r#r1r2r3r�
__classcell__rrrCrr}sr)r3�sys�platform�ImportErrorr�	itertoolsr<r�
subprocessrr5�__all__ZBUFSIZErr>�countrrrrrrrr�<module>s$
1,asyncio/__pycache__/locks.cpython-38.opt-1.pyc000064400000037762151153537520015151 0ustar00U

e5d|C�@s�dZdZddlZddlZddlZddlmZddlmZddlmZddlm	Z	Gd	d
�d
�Z
Gdd�d�ZGd
d�de�ZGdd�d�Z
Gdd�de�ZGdd�de�ZGdd�de�ZdS)zSynchronization primitives.)�Lock�Event�	Condition�	Semaphore�BoundedSemaphore�N�)�events)�futures)�
exceptions)�
coroutinesc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_ContextManagera\Context manager.

    This enables the following idiom for acquiring and releasing a
    lock around a block:

        with (yield from lock):
            <block>

    while failing loudly when accidentally using:

        with lock:
            <block>

    Deprecated, use 'async with' statement:
        async with lock:
            <block>
    cCs
||_dS�N)�_lock)�self�lock�r�%/usr/lib64/python3.8/asyncio/locks.py�__init__"sz_ContextManager.__init__cCsdSr
r�rrrr�	__enter__%sz_ContextManager.__enter__cGsz|j��W5d|_XdSr
)r�release�r�argsrrr�__exit__*sz_ContextManager.__exit__N)�__name__�
__module__�__qualname__�__doc__rrrrrrrrsrc@sReZdZdd�Zdd�Zejdd��Zej	e_	dd�Z
d	d
�Zdd�Zd
d�Z
dS)�_ContextManagerMixincCstd��dS)Nz9"yield from" should be used as context manager expression)�RuntimeErrorrrrrr2s�z_ContextManagerMixin.__enter__cGsdSr
rrrrrr6sz_ContextManagerMixin.__exit__ccs&tjdtdd�|��EdHt|�S)NzD'with (yield from lock)' is deprecated use 'async with lock' instead���
stacklevel)�warnings�warn�DeprecationWarning�acquirerrrrr�__iter__;s�z_ContextManagerMixin.__iter__c�s|��IdHt|�Sr
)r&rrrrrZ
__acquire_ctxUsz"_ContextManagerMixin.__acquire_ctxcCstjdtdd�|����S)Nz='with await lock' is deprecated use 'async with lock' insteadr r!)r#r$r%�!_ContextManagerMixin__acquire_ctx�	__await__rrrrr)Ys
�z_ContextManagerMixin.__await__c�s|��IdHdSr
)r&rrrr�
__aenter__`sz_ContextManagerMixin.__aenter__c�s|��dSr
)r)r�exc_type�exc�tbrrr�	__aexit__fsz_ContextManagerMixin.__aexit__N)rrrrr�types�	coroutiner'rZ
_is_coroutiner(r)r*r.rrrrr1s
rcsNeZdZdZdd�dd�Z�fdd�Zdd	�Zd
d�Zdd
�Zdd�Z	�Z
S)ra�Primitive lock objects.

    A primitive lock is a synchronization primitive that is not owned
    by a particular coroutine when locked.  A primitive lock is in one
    of two states, 'locked' or 'unlocked'.

    It is created in the unlocked state.  It has two basic methods,
    acquire() and release().  When the state is unlocked, acquire()
    changes the state to locked and returns immediately.  When the
    state is locked, acquire() blocks until a call to release() in
    another coroutine changes it to unlocked, then the acquire() call
    resets it to locked and returns.  The release() method should only
    be called in the locked state; it changes the state to unlocked
    and returns immediately.  If an attempt is made to release an
    unlocked lock, a RuntimeError will be raised.

    When more than one coroutine is blocked in acquire() waiting for
    the state to turn to unlocked, only one coroutine proceeds when a
    release() call resets the state to unlocked; first coroutine which
    is blocked in acquire() is being processed.

    acquire() is a coroutine and should be called with 'await'.

    Locks also support the asynchronous context management protocol.
    'async with lock' statement should be used.

    Usage:

        lock = Lock()
        ...
        await lock.acquire()
        try:
            ...
        finally:
            lock.release()

    Context manager usage:

        lock = Lock()
        ...
        async with lock:
             ...

    Lock objects can be tested for locking state:

        if not lock.locked():
           await lock.acquire()
        else:
           # lock is acquired
           ...

    N��loopcCs:d|_d|_|dkr t��|_n||_tjdtdd�dS�NF�[The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.r r!)�_waiters�_lockedr�get_event_loop�_loopr#r$r%�rr2rrrr�s�z
Lock.__init__csLt���}|jrdnd}|jr2|�dt|j���}d|dd��d|�d�S�	N�lockedZunlocked�
, waiters:�<r���� [�]>)�super�__repr__r6r5�len�r�resZextra��	__class__rrrB�s

z
Lock.__repr__cCs|jS)z Return True if lock is acquired.)r6rrrrr;�szLock.lockedc	�s�|js.|jdks$tdd�|jD��r.d|_dS|jdkrBt��|_|j��}|j�|�z"z|IdHW5|j�|�XWn&t	j
k
r�|js�|���YnXd|_dS)z�Acquire a lock.

        This method blocks until the lock is unlocked, then sets it to
        locked and returns True.
        Ncss|]}|��VqdSr
)�	cancelled)�.0�wrrr�	<genexpr>�szLock.acquire.<locals>.<genexpr>T)r6r5�all�collections�dequer8�
create_future�append�remover
�CancelledError�_wake_up_first�r�futrrrr&�s&�


zLock.acquirecCs"|jrd|_|��ntd��dS)aGRelease a lock.

        When the lock is locked, reset it to unlocked, and return.
        If any other coroutines are blocked waiting for the lock to become
        unlocked, allow exactly one of them to proceed.

        When invoked on an unlocked lock, a RuntimeError is raised.

        There is no return value.
        FzLock is not acquired.N)r6rSrrrrrr�s
zLock.releasecCsJ|js
dSztt|j��}Wntk
r2YdSX|��sF|�d�dS)z*Wake up the first waiter if it isn't done.NT)r5�next�iter�
StopIteration�done�
set_resultrTrrrrS�szLock._wake_up_first)rrrrrrBr;r&rrS�
__classcell__rrrFrrjs5 rcsNeZdZdZdd�dd�Z�fdd�Zdd	�Zd
d�Zdd
�Zdd�Z	�Z
S)ra#Asynchronous equivalent to threading.Event.

    Class implementing event objects. An event manages a flag that can be set
    to true with the set() method and reset to false with the clear() method.
    The wait() method blocks until the flag is true. The flag is initially
    false.
    Nr1cCs>t��|_d|_|dkr$t��|_n||_tjdt	dd�dSr3)
rMrNr5�_valuerr7r8r#r$r%r9rrrrs
�zEvent.__init__csLt���}|jrdnd}|jr2|�dt|j���}d|dd��d|�d�S)	N�setZunsetr<r=rr>r?r@)rArBr\r5rCrDrFrrrBs

zEvent.__repr__cCs|jS)z5Return True if and only if the internal flag is true.�r\rrrr�is_setszEvent.is_setcCs.|js*d|_|jD]}|��s|�d�qdS)z�Set the internal flag to true. All coroutines waiting for it to
        become true are awakened. Coroutine that call wait() once the flag is
        true will not block at all.
        TN)r\r5rYrZrTrrrr]s

z	Event.setcCs
d|_dS)z�Reset the internal flag to false. Subsequently, coroutines calling
        wait() will block until set() is called to set the internal flag
        to true again.FNr^rrrr�clear"szEvent.clearc	�sF|jr
dS|j��}|j�|�z|IdHW�dS|j�|�XdS)z�Block until the internal flag is true.

        If the internal flag is true on entry, return True
        immediately.  Otherwise, block until another coroutine calls
        set() to set the flag to true, then return True.
        TN)r\r8rOr5rPrQrTrrr�wait(s

z
Event.wait)rrrrrrBr_r]r`rar[rrrFrr�srcsReZdZdZddd�dd�Z�fdd�Zdd	�Zd
d�Zdd
d�Zdd�Z	�Z
S)raAsynchronous equivalent to threading.Condition.

    This class implements condition variable objects. A condition variable
    allows one or more coroutines to wait until they are notified by another
    coroutine.

    A new Lock object is created and used as the underlying lock.
    Nr1cCs~|dkrt��|_n||_tjdtdd�|dkr>t|d�}n|j|jk	rRtd��||_|j	|_	|j
|_
|j|_t�
�|_dS)Nr4r r!r1z"loop argument must agree with lock)rr7r8r#r$r%r�
ValueErrorrr;r&rrMrNr5)rrr2rrrrEs �zCondition.__init__csNt���}|��rdnd}|jr4|�dt|j���}d|dd��d|�d�Sr:)rArBr;r5rCrDrFrrrB[s

zCondition.__repr__c�s�|��std��|��z@|j��}|j�	|�z|IdHW�W�dS|j�
|�XW5d}z|��IdHWq�Wq^tjk
r�d}Yq^Xq^|r�tj�XdS)a�Wait until notified.

        If the calling coroutine has not acquired the lock when this
        method is called, a RuntimeError is raised.

        This method releases the underlying lock, and then blocks
        until it is awakened by a notify() or notify_all() call for
        the same condition variable in another coroutine.  Once
        awakened, it re-acquires the lock and returns True.
        zcannot wait on un-acquired lockFNT)r;rrr&r
rRr8rOr5rPrQ)rrHrUrrrrabs$

zCondition.waitc�s$|�}|s |��IdH|�}q|S)z�Wait until a predicate becomes true.

        The predicate should be a callable which result will be
        interpreted as a boolean value.  The final predicate value is
        the return value.
        N)ra)rZ	predicate�resultrrr�wait_for�s
zCondition.wait_forrcCsJ|��std��d}|jD]*}||kr*qF|��s|d7}|�d�qdS)aBy default, wake up one coroutine waiting on this condition, if any.
        If the calling coroutine has not acquired the lock when this method
        is called, a RuntimeError is raised.

        This method wakes up at most n of the coroutines waiting for the
        condition variable; it is a no-op if no coroutines are waiting.

        Note: an awakened coroutine does not actually return from its
        wait() call until it can reacquire the lock. Since notify() does
        not release the lock, its caller should.
        z!cannot notify on un-acquired lockrrFN)r;rr5rYrZ)r�n�idxrUrrr�notify�s
zCondition.notifycCs|�t|j��dS)aWake up all threads waiting on this condition. This method acts
        like notify(), but wakes up all waiting threads instead of one. If the
        calling thread has not acquired the lock when this method is called,
        a RuntimeError is raised.
        N)rgrCr5rrrr�
notify_all�szCondition.notify_all)N)r)rrrrrrBrardrgrhr[rrrFrr;s	%
rcsPeZdZdZddd�dd�Z�fdd�Zd	d
�Zdd�Zd
d�Zdd�Z	�Z
S)raA Semaphore implementation.

    A semaphore manages an internal counter which is decremented by each
    acquire() call and incremented by each release() call. The counter
    can never go below zero; when acquire() finds that it is zero, it blocks,
    waiting until some other thread calls release().

    Semaphores also support the context management protocol.

    The optional argument gives the initial value for the internal
    counter; it defaults to 1. If the value given is less than 0,
    ValueError is raised.
    rNr1cCsN|dkrtd��||_t��|_|dkr4t��|_n||_tj	dt
dd�dS)Nrz$Semaphore initial value must be >= 0r4r r!)rbr\rMrNr5rr7r8r#r$r%�r�valuer2rrrr�s
�zSemaphore.__init__csVt���}|��rdn
d|j��}|jr<|�dt|j���}d|dd��d|�d�S)	Nr;zunlocked, value:r<r=rr>r?r@)rArBr;r\r5rCrDrFrrrB�s

zSemaphore.__repr__cCs,|jr(|j��}|��s|�d�dSqdSr
)r5�popleftrYrZ)rZwaiterrrr�
_wake_up_next�s


zSemaphore._wake_up_nextcCs
|jdkS)z:Returns True if semaphore can not be acquired immediately.rr^rrrrr;�szSemaphore.lockedc�st|jdkrb|j��}|j�|�z|IdHWq|��|jdkrX|��sX|���YqXq|jd8_dS)a5Acquire a semaphore.

        If the internal counter is larger than zero on entry,
        decrement it by one and return True immediately.  If it is
        zero on entry, block, waiting until some other coroutine has
        called release() to make it larger than 0, and then return
        True.
        rNrT)r\r8rOr5rPZcancelrHrlrTrrrr&�s	


zSemaphore.acquirecCs|jd7_|��dS)z�Release a semaphore, incrementing the internal counter by one.
        When it was zero on entry and another coroutine is waiting for it to
        become larger than zero again, wake up that coroutine.
        rN)r\rlrrrrr�szSemaphore.release)r)rrrrrrBrlr;r&rr[rrrFrr�s
rcs4eZdZdZd	dd��fdd�Z�fdd�Z�ZS)
rz�A bounded semaphore implementation.

    This raises ValueError in release() if it would increase the value
    above the initial value.
    rNr1cs.|rtjdtdd�||_t�j||d�dS)Nr4r r!r1)r#r$r%�_bound_valuerArrirFrrr
s�zBoundedSemaphore.__init__cs"|j|jkrtd��t���dS)Nz(BoundedSemaphore released too many times)r\rmrbrArrrFrrrszBoundedSemaphore.release)r)rrrrrrr[rrrFrrs	r)r�__all__rMr/r#�rr	r
rrrrrrrrrrrr�<module>s "9DzNasyncio/__pycache__/runners.cpython-38.pyc000064400000003635151153537520014563 0ustar00U

e5d�@sBdZddlmZddlmZddlmZdd�dd�Zd	d
�ZdS))�run�)�
coroutines)�events)�tasksN)�debugcCs�t��dk	rtd��t�|�s,td�|���t��}z*t�|�|dk	rR|�
|�|�|�W�Szt
|�|�|���W5t�d�|�	�XXdS)a�Execute the coroutine and return the result.

    This function runs the passed coroutine, taking care of
    managing the asyncio event loop and finalizing asynchronous
    generators.

    This function cannot be called when another asyncio event loop is
    running in the same thread.

    If debug is True, the event loop will be run in debug mode.

    This function always creates a new event loop and closes it at the end.
    It should be used as a main entry point for asyncio programs, and should
    ideally only be called once.

    Example:

        async def main():
            await asyncio.sleep(1)
            print('hello')

        asyncio.run(main())
    Nz8asyncio.run() cannot be called from a running event loopz"a coroutine was expected, got {!r})rZ_get_running_loop�RuntimeErrorrZiscoroutine�
ValueError�formatZnew_event_loopZset_event_loop�close�_cancel_all_tasks�run_until_completeZshutdown_asyncgensZ	set_debug)�mainr�loop�r�'/usr/lib64/python3.8/asyncio/runners.pyrs"�



rcCsvt�|�}|sdS|D]}|��q|�tj||dd���|D]0}|��rNq@|��dk	r@|�d|��|d��q@dS)NT)rZreturn_exceptionsz1unhandled exception during asyncio.run() shutdown)�message�	exception�task)rZ	all_tasksZcancelrZgatherZ	cancelledrZcall_exception_handler)rZ	to_cancelrrrrr6s"

��r)�__all__�rrrrrrrrr�<module>s
.asyncio/__pycache__/sslproto.cpython-38.pyc000064400000052164151153537520014755 0ustar00U

e5dJj�@s�ddlZddlZzddlZWnek
r4dZYnXddlmZddlmZddlmZddlmZddl	m
Z
dd	�Zd
ZdZ
dZd
ZGdd�de�ZGdd�dejej�ZGdd�dej�ZdS)�N�)�base_events)�	constants)�	protocols)�
transports)�loggercCs"|rtd��t��}|sd|_|S)Nz(Server side SSL needs a valid SSLContextF)�
ValueError�sslZcreate_default_contextZcheck_hostname)�server_side�server_hostname�
sslcontext�r
�(/usr/lib64/python3.8/asyncio/sslproto.py�_create_transport_contextsrZ	UNWRAPPEDZDO_HANDSHAKEZWRAPPEDZSHUTDOWNc@s~eZdZdZdZddd�Zedd��Zedd	��Zed
d��Z	edd
��Z
ddd�Zddd�Zdd�Z
ddd�Zddd�ZdS)�_SSLPipeaAn SSL "Pipe".

    An SSL pipe allows you to communicate with an SSL/TLS protocol instance
    through memory buffers. It can be used to implement a security layer for an
    existing connection where you don't have access to the connection's file
    descriptor, or for some reason you don't want to use it.

    An SSL pipe can be in "wrapped" and "unwrapped" mode. In unwrapped mode,
    data is passed through untransformed. In wrapped mode, application level
    data is encrypted to SSL record level data and vice versa. The SSL record
    level is the lowest level in the SSL protocol suite and is what travels
    as-is over the wire.

    An SslPipe initially is in "unwrapped" mode. To start SSL, call
    do_handshake(). To shutdown SSL again, call unwrap().
    iNcCsH||_||_||_t|_t��|_t��|_d|_	d|_
d|_d|_dS)a�
        The *context* argument specifies the ssl.SSLContext to use.

        The *server_side* argument indicates whether this is a server side or
        client side transport.

        The optional *server_hostname* argument can be used to specify the
        hostname you are connecting to. You may only specify this parameter if
        the _ssl module supports Server Name Indication (SNI).
        NF)
�_context�_server_side�_server_hostname�
_UNWRAPPED�_stater	Z	MemoryBIO�	_incoming�	_outgoing�_sslobj�
_need_ssldata�
_handshake_cb�_shutdown_cb)�self�contextr
rr
r
r�__init__8s

z_SSLPipe.__init__cCs|jS)z*The SSL context passed to the constructor.)r�rr
r
rrNsz_SSLPipe.contextcCs|jS)z^The internal ssl.SSLObject instance.

        Return None if the pipe is not wrapped.
        )rrr
r
r�
ssl_objectSsz_SSLPipe.ssl_objectcCs|jS)zgWhether more record level data is needed to complete a handshake
        that is currently in progress.)rrr
r
r�need_ssldata[sz_SSLPipe.need_ssldatacCs
|jtkS)zj
        Whether a security layer is currently in effect.

        Return False during handshake.
        )r�_WRAPPEDrr
r
r�wrappedasz_SSLPipe.wrappedcCsb|jtkrtd��|jj|j|j|j|jd�|_	t
|_||_|jddd�\}}t
|�dks^t�|S)aLStart the SSL handshake.

        Return a list of ssldata. A ssldata element is a list of buffers

        The optional *callback* argument can be used to install a callback that
        will be called when the handshake is complete. The callback will be
        called with None if successful, else an exception instance.
        z"handshake in progress or completed)r
r�T)�only_handshaker)rr�RuntimeErrorrZwrap_biorrrrr�
_DO_HANDSHAKEr�feed_ssldata�len�AssertionError�r�callback�ssldata�appdatar
r
r�do_handshakejs	
�z_SSLPipe.do_handshakecCsj|jtkrtd��|jtkr$td��|jttfks6t�t|_||_|�d�\}}|gksf|dgksft�|S)a1Start the SSL shutdown sequence.

        Return a list of ssldata. A ssldata element is a list of buffers

        The optional *callback* argument can be used to install a callback that
        will be called when the shutdown is complete. The callback will be
        called without arguments.
        zno security layer presentzshutdown in progressr$)	rrr&�	_SHUTDOWNr"r'r*rr(r+r
r
r�shutdowns	

z_SSLPipe.shutdowncCs2|j��|�d�\}}|gks.|dgks.t�dS)z�Send a potentially "ragged" EOF.

        This method will raise an SSL_ERROR_EOF exception if the EOF is
        unexpected.
        r$N)rZ	write_eofr(r*)rr-r.r
r
r�feed_eof�s
z_SSLPipe.feed_eofFc
Cs�|jtkr"|r|g}ng}g|fSd|_|r8|j�|�g}g}z�|jtkrz|j��t|_|j	rl|�	d�|rz||fWS|jtkr�|j�
|j�}|�|�|s�q�q�nJ|jt
kr�|j��d|_t|_|jr�|��n|jtkr�|�|j�
��Wnztjtjfk
�rl}zRt|dd�}|tjtjtjfk�rP|jtk�rN|j	�rN|�	|��|tjk|_W5d}~XYnX|jj�r�|�|j�
��||fS)a�Feed SSL record level data into the pipe.

        The data must be a bytes instance. It is OK to send an empty bytes
        instance. This can be used to get ssldata for a handshake initiated by
        this endpoint.

        Return a (ssldata, appdata) tuple. The ssldata element is a list of
        buffers containing SSL data that needs to be sent to the remote SSL.

        The appdata element is a list of buffers containing plaintext data that
        needs to be forwarded to the application. The appdata list may contain
        an empty buffer indicating an SSL "close_notify" alert. This alert must
        be acknowledged by calling shutdown().
        FN�errno)rrrr�writer'rr/r"r�read�max_size�appendr0Zunwraprr	�SSLError�CertificateError�getattr�SSL_ERROR_WANT_READ�SSL_ERROR_WANT_WRITE�SSL_ERROR_SYSCALLr�pending)r�datar%r.r-�chunk�exc�	exc_errnor
r
rr(�sZ










�

z_SSLPipe.feed_ssldatarc
Cs4d|krt|�ksnt�|jtkrT|t|�krD||d�g}ng}|t|�fSg}t|�}d|_z(|t|�kr�||j�||d��7}Wnhtj	k
r�}zHt
|dd�}|jdkr�tj}|_
|tjtjtjfkrڂ|tjk|_W5d}~XYnX|jj�r|�|j���|t|�k�s,|jr`�q,q`||fS)aFeed plaintext data into the pipe.

        Return an (ssldata, offset) tuple. The ssldata element is a list of
        buffers containing record level data that needs to be sent to the
        remote SSL instance. The offset is the number of plaintext bytes that
        were processed, which may be less than the length of data.

        NOTE: In case of short writes, this call MUST be retried with the SAME
        buffer passed into the *data* argument (i.e. the id() must be the
        same). This is an OpenSSL requirement. A further particularity is that
        a short write will always have offset == 0, because the _ssl module
        does not enable partial writes. And even though the offset is zero,
        there will still be encrypted data in ssldata.
        rNFr3ZPROTOCOL_IS_SHUTDOWN)r)r*rr�
memoryviewrrr4r	r8r:�reasonr;r3r<r=rr>r7r5)rr?�offsetr-ZviewrArBr
r
r�feed_appdata�s6

�
z_SSLPipe.feed_appdata)N)N)N)F)r)�__name__�
__module__�__qualname__�__doc__r6r�propertyrr r!r#r/r1r2r(rFr
r
r
rr$s 








Krc@s�eZdZejjZdd�Zd"dd�Zdd�Z	dd	�Z
d
d�Zdd
�Ze
jfdd�Zdd�Zdd�Zdd�Zd#dd�Zdd�Zedd��Zdd�Zdd�Zd d!�ZdS)$�_SSLProtocolTransportcCs||_||_d|_dS)NF)�_loop�
_ssl_protocol�_closed)r�loopZssl_protocolr
r
rr!sz_SSLProtocolTransport.__init__NcCs|j�||�S)z#Get optional transport information.)rN�_get_extra_info�r�name�defaultr
r
r�get_extra_info'sz$_SSLProtocolTransport.get_extra_infocCs|j�|�dS�N)rN�_set_app_protocol)r�protocolr
r
r�set_protocol+sz"_SSLProtocolTransport.set_protocolcCs|jjSrV)rN�
_app_protocolrr
r
r�get_protocol.sz"_SSLProtocolTransport.get_protocolcCs|jSrV)rOrr
r
r�
is_closing1sz _SSLProtocolTransport.is_closingcCsd|_|j��dS)a
Close the transport.

        Buffered data will be flushed asynchronously.  No more data
        will be received.  After all buffered data is flushed, the
        protocol's connection_lost() method will (eventually) called
        with None as its argument.
        TN)rOrN�_start_shutdownrr
r
r�close4sz_SSLProtocolTransport.closecCs&|js"|d|��t|d�|��dS)Nzunclosed transport )�source)rO�ResourceWarningr^)rZ_warnr
r
r�__del__?sz_SSLProtocolTransport.__del__cCs |jj}|dkrtd��|��S)Nz*SSL transport has not been initialized yet)rN�
_transportr&�
is_reading)rZtrr
r
rrcDsz _SSLProtocolTransport.is_readingcCs|jj��dS)z�Pause the receiving end.

        No data will be passed to the protocol's data_received()
        method until resume_reading() is called.
        N)rNrb�
pause_readingrr
r
rrdJsz#_SSLProtocolTransport.pause_readingcCs|jj��dS)z�Resume the receiving end.

        Data received will once again be passed to the protocol's
        data_received() method.
        N)rNrb�resume_readingrr
r
rreRsz$_SSLProtocolTransport.resume_readingcCs|jj�||�dS)a�Set the high- and low-water limits for write flow control.

        These two values control when to call the protocol's
        pause_writing() and resume_writing() methods.  If specified,
        the low-water limit must be less than or equal to the
        high-water limit.  Neither value can be negative.

        The defaults are implementation-specific.  If only the
        high-water limit is given, the low-water limit defaults to an
        implementation-specific value less than or equal to the
        high-water limit.  Setting high to zero forces low to zero as
        well, and causes pause_writing() to be called whenever the
        buffer becomes non-empty.  Setting low to zero causes
        resume_writing() to be called only once the buffer is empty.
        Use of zero for either limit is generally sub-optimal as it
        reduces opportunities for doing I/O and computation
        concurrently.
        N)rNrb�set_write_buffer_limits)rZhighZlowr
r
rrfZsz-_SSLProtocolTransport.set_write_buffer_limitscCs|jj��S)z,Return the current size of the write buffer.)rNrb�get_write_buffer_sizerr
r
rrgosz+_SSLProtocolTransport.get_write_buffer_sizecCs
|jjjSrV)rNrb�_protocol_pausedrr
r
rrhssz&_SSLProtocolTransport._protocol_pausedcCs<t|tttf�s$tdt|�j����|s,dS|j�|�dS)z�Write some data bytes to the transport.

        This does not block; it buffers the data and arranges for it
        to be sent out asynchronously.
        z+data: expecting a bytes-like instance, got N)	�
isinstance�bytes�	bytearrayrC�	TypeError�typerGrN�_write_appdata�rr?r
r
rr4xs
z_SSLProtocolTransport.writecCsdS)zAReturn True if this transport supports write_eof(), False if not.Fr
rr
r
r�
can_write_eof�sz#_SSLProtocolTransport.can_write_eofcCs|j��d|_dS)z�Close the transport immediately.

        Buffered data will be lost.  No more data will be received.
        The protocol's connection_lost() method will (eventually) be
        called with None as its argument.
        TN)rN�_abortrOrr
r
r�abort�s
z_SSLProtocolTransport.abort)N)NN)rGrHrIrZ
_SendfileModeZFALLBACKZ_sendfile_compatiblerrUrYr[r\r^�warnings�warnrarcrdrerfrgrKrhr4rprrr
r
r
rrLs$



rLc@s�eZdZdZd,dd�Zdd�Zd-d	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zd.dd�Z
dd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd/d&d'�Zd(d)�Zd*d+�ZdS)0�SSLProtocolz�SSL protocol.

    Implementation of SSL on top of a socket using incoming and outgoing
    buffers which are ssl.MemoryBIO objects.
    FNTc		Cs�tdkrtd��|dkr tj}n|dkr6td|����|sDt||�}||_|rZ|sZ||_nd|_||_t	|d�|_
t��|_
d|_||_||_|�|�t|j|�|_d|_d|_d|_d|_d|_||_||_dS)Nzstdlib ssl module not availablerz7ssl_handshake_timeout should be a positive number, got )rF)r	r&rZSSL_HANDSHAKE_TIMEOUTrrrr�_sslcontext�dict�_extra�collections�deque�_write_backlog�_write_buffer_size�_waiterrMrWrL�_app_transport�_sslpipe�_session_established�
_in_handshake�_in_shutdownrb�_call_connection_made�_ssl_handshake_timeout)	rrP�app_protocolrZwaiterr
rZcall_connection_madeZssl_handshake_timeoutr
r
rr�s@��

zSSLProtocol.__init__cCs||_t|tj�|_dSrV)rZrirZBufferedProtocol�_app_protocol_is_buffer)rr�r
r
rrW�s
�zSSLProtocol._set_app_protocolcCsD|jdkrdS|j��s:|dk	r.|j�|�n|j�d�d|_dSrV)r}Z	cancelledZ
set_exceptionZ
set_result�rrAr
r
r�_wakeup_waiter�s

zSSLProtocol._wakeup_waitercCs&||_t|j|j|j�|_|��dS)zXCalled when the low-level connection is made.

        Start the SSL handshake.
        N)rbrrvrrr�_start_handshake)r�	transportr
r
r�connection_made�s�zSSLProtocol.connection_madecCsn|jr d|_|j�|jj|�n|jdk	r2d|j_d|_d|_t|dd�rT|j	�
�|�|�d|_d|_dS)z�Called when the low-level connection is lost or closed.

        The argument is an exception object or None (the latter
        meaning a regular EOF is received or the connection was
        aborted or closed).
        FNT�_handshake_timeout_handle)
r�rM�	call_soonrZ�connection_lostr~rOrbr:r��cancelr�rr�r
r
rr��s


zSSLProtocol.connection_lostcCs|j��dS)z\Called when the low-level transport's buffer goes over
        the high-water mark.
        N)rZ�
pause_writingrr
r
rr��szSSLProtocol.pause_writingcCs|j��dS)z^Called when the low-level transport's buffer drains below
        the low-water mark.
        N)rZ�resume_writingrr
r
rr�szSSLProtocol.resume_writingcCs"|jdkrdSz|j�|�\}}WnLttfk
r<�Yn4tk
rn}z|�|d�WY�dSd}~XYnX|D]}|j�|�qt|D]�}|�rz&|jr�t	�
|j|�n|j�|�WnPttfk
r��Yn8tk
�r
}z|�|d�WY�dSd}~XYnXq�|�
��qq�dS)zXCalled when some SSL data is received.

        The argument is a bytes object.
        NzSSL error in data receivedz/application protocol failed to receive SSL data)rr(�
SystemExit�KeyboardInterrupt�
BaseException�_fatal_errorrbr4r�rZ_feed_data_to_buffered_protorZ�
data_receivedr])rr?r-r.�er@Zexr
r
rr�s<
��zSSLProtocol.data_receivedcCsTzB|j��rt�d|�|�t�|js@|j	�
�}|r@t�d�W5|j��XdS)aCalled when the other end of the low-level stream
        is half-closed.

        If this returns a false value (including None), the transport
        will close itself.  If it returns a true value, closing the
        transport is up to the protocol.
        z%r received EOFz?returning true from eof_received() has no effect when using sslN)rbr^rM�	get_debugr�debugr��ConnectionResetErrorr�rZ�eof_receivedZwarning)rZ	keep_openr
r
rr�-s


zSSLProtocol.eof_receivedcCs4||jkr|j|S|jdk	r,|j�||�S|SdSrV)rxrbrUrRr
r
rrQCs



zSSLProtocol._get_extra_infocCs.|jr
dS|jr|��nd|_|�d�dS)NTr$)r�r�rqrnrr
r
rr]Ks
zSSLProtocol._start_shutdowncCs.|j�|df�|jt|�7_|��dS)Nr)r{r7r|r)�_process_write_backlogror
r
rrnTszSSLProtocol._write_appdatacCs\|j��r$t�d|�|j��|_nd|_d|_|j�d�|j�	|j
|j�|_|�
�dS)Nz%r starts SSL handshakeT)r$r)rMr�rr��time�_handshake_start_timer�r{r7Z
call_laterr��_check_handshake_timeoutr�r�rr
r
rr�Ys

��zSSLProtocol._start_handshakecCs*|jdkr&d|j�d�}|�t|��dS)NTz$SSL handshake is taking longer than z! seconds: aborting the connection)r�r�r��ConnectionAbortedError)r�msgr
r
rr�hs
�z$SSLProtocol._check_handshake_timeoutc
Csd|_|j��|jj}z|dk	r&|�|��}Wnbttfk
rJ�YnJtk
r�}z,t	|t
j�rld}nd}|�||�WY�dSd}~XYnX|j
��r�|j
��|j}t�d||d�|jj||��|��|d�|jr�|j�|j�|��d|_|j
�|j�dS)NFz1SSL handshake failed on verifying the certificatezSSL handshake failedz%r: SSL handshake took %.1f msg@�@)�peercert�cipher�compressionr T)r�r�r�rr Zgetpeercertr�r�r�rir	r9r�rMr�r�r�rr�rx�updater�r�r�rZr�r~r�r�r�r�)rZ
handshake_excZsslobjr�rAr�Zdtr
r
r�_on_handshake_completeqs8

�z"SSLProtocol._on_handshake_completec
CsP|jdks|jdkrdSz�tt|j��D]�}|jd\}}|rR|j�||�\}}n*|rj|j�|j�}d}n|j�|j	�}d}|D]}|j�
|�q�|t|�kr�||f|jd<|jjs�t�|jj
r�|j��q�|jd=|jt|�8_q(Wn^ttfk
�r�YnDtk
�rJ}z$|j�r.|�|�n|�|d�W5d}~XYnXdS)NrrzFatal error on SSL transport)rbr�ranger)r{rFr/r�r1�	_finalizer4r!r*Z_pausedrer|r�r�r�r�r�)r�ir?rEr-r@rAr
r
rr��s<�
z"SSLProtocol._process_write_backlog�Fatal error on transportcCsVt|t�r(|j��r@tjd||dd�n|j�|||j|d��|jrR|j�|�dS)Nz%r: %sT)�exc_info)�messageZ	exceptionr�rX)	ri�OSErrorrMr�rr�Zcall_exception_handlerrbZ_force_close)rrAr�r
r
rr��s

�zSSLProtocol._fatal_errorcCsd|_|jdk	r|j��dSrV)rrbr^rr
r
rr��s
zSSLProtocol._finalizecCs(z|jdk	r|j��W5|��XdSrV)r�rbrrrr
r
rrq�s
zSSLProtocol._abort)FNTN)N)N)r�)rGrHrIrJrrWr�r�r�r�r�r�r�rQr]rnr�r�r�r�r�r�rqr
r
r
rru�s0�
.

&
		)+
ru)ryrsr	�ImportError�rrrr�logrrrr'r"r0�objectrZ_FlowControlMixinZ	TransportrLZProtocolrur
r
r
r�<module>s*
y�xasyncio/__pycache__/log.cpython-38.opt-1.pyc000064400000000344151153537520014601 0ustar00U

e5d|�@sdZddlZe�e�ZdS)zLogging configuration.�N)�__doc__ZloggingZ	getLogger�__package__Zlogger�rr�#/usr/lib64/python3.8/asyncio/log.py�<module>sasyncio/__pycache__/exceptions.cpython-38.opt-2.pyc000064400000003563151153537520016210 0ustar00U

e5da�@shdZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGd	d
�d
e�Z	Gdd�de�Z
d
S))�CancelledError�InvalidStateError�TimeoutError�IncompleteReadError�LimitOverrunError�SendfileNotAvailableErrorc@seZdZdS)rN��__name__�
__module__�__qualname__�rr�*/usr/lib64/python3.8/asyncio/exceptions.pyr	src@seZdZdS)rNrrrrrr
src@seZdZdS)rNrrrrrrsrc@seZdZdS)rNrrrrrrsrcs$eZdZ�fdd�Zdd�Z�ZS)rcs@|dkrdnt|�}t��t|��d|�d��||_||_dS)NZ	undefinedz bytes read on a total of z expected bytes)�repr�super�__init__�len�partial�expected)�selfrrZ
r_expected��	__class__rrr$szIncompleteReadError.__init__cCst|�|j|jffS�N)�typerr�rrrr�
__reduce__+szIncompleteReadError.__reduce__�rr	r
rr�
__classcell__rrrrrsrcs$eZdZ�fdd�Zdd�Z�ZS)rcst��|�||_dSr)rr�consumed)r�messagerrrrr5szLimitOverrunError.__init__cCst|�|jd|jffS)N�)r�argsrrrrrr9szLimitOverrunError.__reduce__rrrrrr/srN)�__all__�
BaseExceptionr�	Exceptionrr�RuntimeErrorr�EOFErrorrrrrrr�<module>sasyncio/__pycache__/base_futures.cpython-38.opt-2.pyc000064400000003156151153537520016514 0ustar00U

e5d
�@sRdZddlZddlmZddlmZdZdZdZd	d
�Z	dd�Z
e�Zd
d�Z
dS)��N)�	get_ident�)�format_helpersZPENDINGZ	CANCELLEDZFINISHEDcCst|jd�o|jdk	S)N�_asyncio_future_blocking)�hasattr�	__class__r)�objrr�,/usr/lib64/python3.8/asyncio/base_futures.py�isfutures�rcCs�t|�}|sd}dd�}|dkr2||dd�}n`|dkr`d�||dd�||dd��}n2|dkr�d�||dd�|d||d	d��}d
|�d�S)N�cSst�|d�S)Nr)rZ_format_callback_source)�callbackrrr
�	format_cbsz$_format_callbacks.<locals>.format_cbrr�z{}, {}z{}, <{} more>, {}���zcb=[�])�len�format)�cb�sizerrrr
�_format_callbackss&�rc	Cs�|j��g}|jtkr�|jdk	r4|�d|j���nTt|�t�f}|tkrPd}n(t�|�zt
�|j�}W5t�	|�X|�d|���|j
r�|�t|j
��|jr�|jd}|�d|d�d|d���|S)	Nz
exception=z...zresult=rzcreated at r�:r)Z_state�lower�	_FINISHEDZ
_exception�append�idr�
_repr_running�add�discard�reprlib�reprZ_resultZ
_callbacksrZ_source_traceback)Zfuture�info�key�result�framerrr
�_future_repr_info7s$



r%)�__all__r�_threadrrrZ_PENDINGZ
_CANCELLEDrrr�setrr%rrrr
�<module>sasyncio/__pycache__/selector_events.cpython-38.pyc000064400000071767151153537520016306 0ustar00U

e5dT��@s.dZdZddlZddlZddlZddlZddlZddlZddlZzddl	Z	Wne
k
rddZ	YnXddlmZddlm
Z
ddlmZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZdd�Zdd�ZGdd�dej�ZGdd�dejej�ZGdd�de�ZGdd�de�ZdS)z�Event loop using a selector and related classes.

A selector is a "notify-when-ready" multiplexer.  For a subclass which
also includes support for signal handling, see the unix_events sub-module.
)�BaseSelectorEventLoop�N�)�base_events)�	constants)�events)�futures)�	protocols)�sslproto)�
transports)�trsock)�loggercCs8z|�|�}Wntk
r$YdSXt|j|@�SdS�NF)�get_key�KeyError�boolr)�selector�fdZevent�key�r�//usr/lib64/python3.8/asyncio/selector_events.py�_test_selector_event s
rcCs tdk	rt|tj�rtd��dS)Nz"Socket cannot be of type SSLSocket)�ssl�
isinstanceZ	SSLSocket�	TypeError)�sockrrr�_check_ssl_socket+srcs�eZdZdZdS�fdd�	ZdTddd�dd�ZdUddddejd	�d
d�ZdVdd
�Z	�fdd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdddejfdd�Zdddejfdd�Zddejfdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dAdB�Z#dCdD�Z$dEdF�Z%dGdH�Z&dIdJ�Z'dKdL�Z(dMdN�Z)dOdP�Z*dQdR�Z+�Z,S)WrzJSelector event loop.

    See events.EventLoop for API specification.
    NcsFt���|dkrt��}t�d|jj�||_|�	�t
��|_dS)NzUsing selector: %s)
�super�__init__�	selectorsZDefaultSelectorr�debug�	__class__�__name__�	_selector�_make_self_pipe�weakrefZWeakValueDictionary�_transports)�selfr�r rrr6s
zBaseSelectorEventLoop.__init__��extra�servercCst||||||�S�N)�_SelectorSocketTransport)r&r�protocol�waiterr)r*rrr�_make_socket_transport@s
�z,BaseSelectorEventLoop._make_socket_transportF)�server_side�server_hostnamer)r*�ssl_handshake_timeoutc	Cs0tj|||||||	d�}
t|||
||d�|
jS)N)r2r()r	ZSSLProtocolr,Z_app_transport)r&Zrawsockr-�
sslcontextr.r0r1r)r*r2Zssl_protocolrrr�_make_ssl_transportEs��z)BaseSelectorEventLoop._make_ssl_transportcCst||||||�Sr+)�_SelectorDatagramTransport)r&rr-�addressr.r)rrr�_make_datagram_transportRs
�z.BaseSelectorEventLoop._make_datagram_transportcsL|��rtd��|��rdS|��t���|jdk	rH|j��d|_dS)Nz!Cannot close a running event loop)Z
is_running�RuntimeError�	is_closed�_close_self_piper�closer"�r&r'rrr;Ws


zBaseSelectorEventLoop.closecCsB|�|j���|j��d|_|j��d|_|jd8_dS)Nr)�_remove_reader�_ssock�filenor;�_csock�
_internal_fdsr<rrrr:bs

z&BaseSelectorEventLoop._close_self_pipecCsNt��\|_|_|j�d�|j�d�|jd7_|�|j��|j�dS)NFr)	�socketZ
socketpairr>r@�setblockingrA�_add_readerr?�_read_from_selfr<rrrr#js
z%BaseSelectorEventLoop._make_self_pipecCsdSr+r�r&�datarrr�_process_self_datarsz(BaseSelectorEventLoop._process_self_datacCsXz"|j�d�}|sWqT|�|�Wqtk
r:YqYqtk
rPYqTYqXqdS)Ni)r>�recvrH�InterruptedError�BlockingIOErrorrFrrrrEusz%BaseSelectorEventLoop._read_from_selfcCsN|j}|dkrdSz|�d�Wn(tk
rH|jrDtjddd�YnXdS)N�z3Fail to write a null byte into the self-pipe socketT��exc_info)r@�send�OSError�_debugrr)r&Zcsockrrr�_write_to_self�s�z$BaseSelectorEventLoop._write_to_self�dc
Cs"|�|��|j||||||�dSr+)rDr?�_accept_connection)r&�protocol_factoryrr3r*�backlogr2rrr�_start_serving�s�z$BaseSelectorEventLoop._start_servingc
Cst|�D]�}z0|��\}}	|jr0t�d||	|�|�d�Wn�tttfk
rZYdSt	k
r�}
zd|
j
t
jt
jt
j
t
jfkr�|�d|
t�|�d��|�|���|�tj|j||||||�n�W5d}
~
XYqXd|	i}|�||||||�}|�|�qdS)Nz#%r got a new connection from %r: %rFz&socket.accept() out of system resource)�message�	exceptionrB�peername)�range�acceptrQrrrCrKrJ�ConnectionAbortedErrorrP�errnoZEMFILEZENFILEZENOBUFSZENOMEM�call_exception_handlerr�TransportSocketr=r?Z
call_laterrZACCEPT_RETRY_DELAYrW�_accept_connection2Zcreate_task)
r&rUrr3r*rVr2�_�conn�addr�excr)r\rrrrT�sV�����z(BaseSelectorEventLoop._accept_connectionc
�s�d}d}zt|�}|��}	|r8|j||||	d|||d�}n|j|||	||d�}z|	IdHWntk
rx|���YnXWntttfk
r��Yn\tk
r�}
z>|jr�d|
d�}|dk	r�||d<|dk	r�||d<|�|�W5d}
~
XYnXdS)NT)r.r0r)r*r2)r.r)r*z3Error on transport creation for incoming connection)rXrYr-�	transport)	�
create_futurer4r/�
BaseExceptionr;�
SystemExit�KeyboardInterruptrQr_)r&rUrcr)r3r*r2r-rfr.re�contextrrrra�sP���z)BaseSelectorEventLoop._accept_connection2c
Cs�|}t|t�sJzt|���}Wn*tttfk
rHtd|���d�YnXz|j|}Wntk
rlYnX|��s�t	d|�d|����dS)NzInvalid file object: zFile descriptor z is used by transport )
r�intr?�AttributeErrorr�
ValueErrorr%r�
is_closingr8)r&rr?rfrrr�_ensure_fd_no_transport�s
�z-BaseSelectorEventLoop._ensure_fd_no_transportc		Gs�|��t�|||d�}z|j�|�}Wn*tk
rR|j�|tj|df�Yn>X|j|j	}\}}|j�
||tjB||f�|dk	r�|��dSr+)�
_check_closedr�Handler"rr�registerr�
EVENT_READrG�modify�cancel�	r&r�callback�argsZhandler�mask�reader�writerrrrrDs�
�z!BaseSelectorEventLoop._add_readercCs�|��rdSz|j�|�}Wntk
r2YdSX|j|j}\}}|tjM}|sd|j�|�n|j�	||d|f�|dk	r�|�
�dSdSdS�NFT)r9r"rrrrGrrt�
unregisterrurv�r&rrrzr{r|rrrr=sz$BaseSelectorEventLoop._remove_readerc		Gs�|��t�|||d�}z|j�|�}Wn*tk
rR|j�|tjd|f�Yn>X|j|j	}\}}|j�
||tjB||f�|dk	r�|��dSr+)rqrrrr"rrrsr�EVENT_WRITErGrurvrwrrr�_add_writer%s�
�z!BaseSelectorEventLoop._add_writercCs�|��rdSz|j�|�}Wntk
r2YdSX|j|j}\}}|tjM}|sd|j�|�n|j�	|||df�|dk	r�|�
�dSdSdS)�Remove a writer callback.FNT)r9r"rrrrGrr�r~rurvrrrr�_remove_writer4sz$BaseSelectorEventLoop._remove_writercGs|�|�|j||f|��S)zAdd a reader callback.)rprD�r&rrxryrrr�
add_readerKs
z BaseSelectorEventLoop.add_readercCs|�|�|�|�S)zRemove a reader callback.)rpr=�r&rrrr�
remove_readerPs
z#BaseSelectorEventLoop.remove_readercGs|�|�|j||f|��S)zAdd a writer callback..)rpr�r�rrr�
add_writerUs
z BaseSelectorEventLoop.add_writercCs|�|�|�|�S)r�)rpr�r�rrr�
remove_writerZs
z#BaseSelectorEventLoop.remove_writerc	�s�t|�|jr"|��dkr"td��z|�|�WSttfk
rFYnX|��}|��}|�	||j
|||�|�t�
|j|��|IdHS)z�Receive data from the socket.

        The return value is a bytes object representing the data received.
        The maximum amount of data to be received at once is specified by
        nbytes.
        r�the socket must be non-blockingN)rrQ�
gettimeoutrnrIrKrJrgr?r��
_sock_recv�add_done_callback�	functools�partial�_sock_read_done)r&r�n�futrrrr�	sock_recv_s�zBaseSelectorEventLoop.sock_recvcCs|�|�dSr+)r��r&rr�rrrr�tsz%BaseSelectorEventLoop._sock_read_donec
Cs�|��rdSz|�|�}Wn\ttfk
r4YdSttfk
rL�Yn6tk
rv}z|�|�W5d}~XYnX|�|�dSr+)	�donerIrKrJrirjrh�
set_exception�
set_result)r&r�rr�rGrerrrr�wsz BaseSelectorEventLoop._sock_recvc	�s�t|�|jr"|��dkr"td��z|�|�WSttfk
rFYnX|��}|��}|�	||j
|||�|�t�
|j|��|IdHS)z�Receive data from the socket.

        The received data is written into *buf* (a writable buffer).
        The return value is the number of bytes written.
        rr�N)rrQr�rn�	recv_intorKrJrgr?r��_sock_recv_intor�r�r�r�)r&r�bufr�rrrr�sock_recv_into�s�z$BaseSelectorEventLoop.sock_recv_intoc
Cs�|��rdSz|�|�}Wn\ttfk
r4YdSttfk
rL�Yn6tk
rv}z|�|�W5d}~XYnX|�|�dSr+)	r�r�rKrJrirjrhr�r�)r&r�rr��nbytesrerrrr��sz%BaseSelectorEventLoop._sock_recv_intoc	�s�t|�|jr"|��dkr"td��z|�|�}Wnttfk
rLd}YnX|t|�kr^dS|��}|�	�}|�
t�|j
|��|�||j||t|�|g�|IdHS)a�Send data to the socket.

        The socket must be connected to a remote socket. This method continues
        to send data from data until either all data has been sent or an
        error occurs. None is returned on success. On error, an exception is
        raised, and there is no way to determine how much data, if any, was
        successfully processed by the receiving end of the connection.
        rr�N)rrQr�rnrOrKrJ�lenrgr?r�r�r��_sock_write_doner��
_sock_sendall�
memoryview)r&rrGr�r�rrrr�sock_sendall�s&	
��z"BaseSelectorEventLoop.sock_sendallc
Cs�|��rdS|d}z|�||d��}Wnbttfk
rDYdSttfk
r\�Yn2tk
r�}z|�|�WY�dSd}~XYnX||7}|t|�kr�|�	d�n||d<dS)Nr)
r�rOrKrJrirjrhr�r�r�)r&r�rZview�pos�startr�rerrrr��s 
z#BaseSelectorEventLoop._sock_sendallc�s�t|�|jr"|��dkr"td��ttd�r8|jtjkrf|j||j|j	|d�IdH}|d\}}}}}|�
�}|�|||�|IdHS)zTConnect to a remote socket at address.

        This method is a coroutine.
        rr��AF_UNIX)�family�proto�loopN)rrQr�rn�hasattrrBr�r�Z_ensure_resolvedr�rg�
_sock_connect)r&rr6Zresolvedrbr�rrr�sock_connect�s�z"BaseSelectorEventLoop.sock_connectc
Cs�|��}z|�|�Wn�ttfk
rV|�t�|j|��|�||j	|||�YnNt
tfk
rn�Yn6tk
r�}z|�
|�W5d}~XYnX|�d�dSr+)r?ZconnectrKrJr�r�r�r�r��_sock_connect_cbrirjrhr�r�)r&r�rr6rrerrrr��s�z#BaseSelectorEventLoop._sock_connectcCs|�|�dSr+)r�r�rrrr�sz&BaseSelectorEventLoop._sock_write_donec
Cs�|��rdSz,|�tjtj�}|dkr6t|d|����WnZttfk
rPYnNtt	fk
rh�Yn6t
k
r�}z|�|�W5d}~XYnX|�d�dS)NrzConnect call failed )
r�Z
getsockoptrBZ
SOL_SOCKETZSO_ERRORrPrKrJrirjrhr�r�)r&r�rr6�errrerrrr�sz&BaseSelectorEventLoop._sock_connect_cbc�sBt|�|jr"|��dkr"td��|��}|�|d|�|IdHS)aWAccept a connection.

        The socket must be bound to an address and listening for connections.
        The return value is a pair (conn, address) where conn is a new socket
        object usable to send and receive data on the connection, and address
        is the address bound to the socket on the other end of the connection.
        rr�FN)rrQr�rnrg�_sock_accept)r&rr�rrr�sock_acceptsz!BaseSelectorEventLoop.sock_acceptc
Cs�|��}|r|�|�|��r"dSz|��\}}|�d�Wnnttfk
rh|�||j|d|�YnRt	t
fk
r��Yn:tk
r�}z|�|�W5d}~XYnX|�
||f�dSr})r?r�r�r\rCrKrJr�r�rirjrhr�r�)r&r�Z
registeredrrrcr6rerrrr�*s
z"BaseSelectorEventLoop._sock_acceptc	�sp|j|j=|��}|��|��IdHz |j|j|||dd�IdHW�S|��|r^|��||j|j<XdS)NF)Zfallback)	r%�_sock_fd�
is_reading�
pause_reading�_make_empty_waiter�_reset_empty_waiter�resume_readingZ
sock_sendfile�_sock)r&Ztransp�file�offset�countr�rrr�_sendfile_native<s
�z&BaseSelectorEventLoop._sendfile_nativecCs�|D]v\}}|j|j}\}}|tj@rL|dk	rL|jrB|�|�n
|�|�|tj@r|dk	r|jrp|�|�q|�|�qdSr+)	�fileobjrGrrtZ
_cancelledr=Z
_add_callbackr�r�)r&Z
event_listrrzr�r{r|rrr�_process_eventsJs
z%BaseSelectorEventLoop._process_eventscCs|�|���|��dSr+)r=r?r;)r&rrrr�
_stop_servingXsz#BaseSelectorEventLoop._stop_serving)N)N)N)NNN)-r!�
__module__�__qualname__�__doc__rr/rZSSL_HANDSHAKE_TIMEOUTr4r7r;r:r#rHrErRrWrTrarprDr=r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��
__classcell__rrr'rr0s~
����
�
	�
.�
)rcs�eZdZdZeZdZd�fdd�	Zdd�Zdd�Z	d	d
�Z
dd�Zd
d�Zdd�Z
ejfdd�Zddd�Zdd�Zdd�Zdd�Zdd�Z�ZS) �_SelectorTransportiNcs�t��||�t�|�|jd<z|��|jd<Wntk
rNd|jd<YnXd|jkr�z|��|jd<Wn tj	k
r�d|jd<YnX||_
|��|_d|_
|�|�||_|��|_d|_d|_|jdk	r�|j��||j|j<dS)NrBZsocknamerZFr)rrrr`�_extraZgetsocknamerPZgetpeernamerB�errorr�r?r��_protocol_connected�set_protocol�_server�_buffer_factory�_buffer�
_conn_lost�_closingZ_attachr%)r&r�rr-r)r*r'rrris,





z_SelectorTransport.__init__cCs�|jjg}|jdkr |�d�n|jr0|�d�|�d|j���|jdk	r�|j��s�t|jj	|jt
j�}|rz|�d�n
|�d�t|jj	|jt
j�}|r�d}nd}|�
�}|�d|�d	|�d
��d�d�|��S)
N�closed�closingzfd=zread=pollingz	read=idle�pollingZidlezwrite=<z
, bufsize=�>z<{}>� )r r!r��appendr�r��_loopr9rr"rrtr��get_write_buffer_size�format�join)r&�infor��state�bufsizerrr�__repr__�s0


�
�z_SelectorTransport.__repr__cCs|�d�dSr+)�_force_closer<rrr�abort�sz_SelectorTransport.abortcCs||_d|_dS�NT)�	_protocolr��r&r-rrrr��sz_SelectorTransport.set_protocolcCs|jSr+)r�r<rrr�get_protocol�sz_SelectorTransport.get_protocolcCs|jSr+)r�r<rrrro�sz_SelectorTransport.is_closingcCsT|jr
dSd|_|j�|j�|jsP|jd7_|j�|j�|j�|jd�dS�NTr)	r�r�r=r�r�r�r��	call_soon�_call_connection_lostr<rrrr;�sz_SelectorTransport.closecCs,|jdk	r(|d|��t|d�|j��dS)Nzunclosed transport )�source)r��ResourceWarningr;)r&Z_warnrrr�__del__�s
z_SelectorTransport.__del__�Fatal error on transportcCsNt|t�r(|j��r@tjd||dd�n|j�||||jd��|�|�dS)Nz%r: %sTrM)rXrYrfr-)	rrPr��	get_debugrrr_r�r�)r&rerXrrr�_fatal_error�s

�z_SelectorTransport._fatal_errorcCsd|jr
dS|jr(|j��|j�|j�|jsBd|_|j�|j�|jd7_|j�|j	|�dSr�)
r�r��clearr�r�r�r�r=r�r��r&rerrrr��s
z_SelectorTransport._force_closecCsVz|jr|j�|�W5|j��d|_d|_d|_|j}|dk	rP|��d|_XdSr+)r�r;r�r�r�Z_detachr�Zconnection_lost)r&rer*rrrr��s
z(_SelectorTransport._call_connection_lostcCs
t|j�Sr+)r�r�r<rrrr��sz(_SelectorTransport.get_write_buffer_sizecGs"|jr
dS|jj||f|��dSr+)r�r�rDr�rrrrD�sz_SelectorTransport._add_reader)NN)r�)r!r�r��max_size�	bytearrayr�r�rr�r�r�r�ror;�warnings�warnr�r�r�r�r�rDr�rrr'rr�]s 

r�cs�eZdZdZejjZd#�fdd�	Z�fdd�Z	dd�Z
d	d
�Zdd�Zd
d�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Z�fdd�Zdd �Zd!d"�Z�ZS)$r,TNcs~d|_t��|||||�d|_d|_d|_t�|j�|j	�
|jj|�|j	�
|j
|j|j�|dk	rz|j	�
tj|d�dSr
)�_read_ready_cbrr�_eof�_paused�
_empty_waiterrZ_set_nodelayr�r�r�r��connection_maderDr��_read_readyr�_set_result_unless_cancelled)r&r�rr-r.r)r*r'rrr�s 
�
�z!_SelectorSocketTransport.__init__cs.t|tj�r|j|_n|j|_t��|�dSr+)rrZBufferedProtocol�_read_ready__get_bufferr��_read_ready__data_receivedrr�r�r'rrr�	s
z%_SelectorSocketTransport.set_protocolcCs|jo|jSr+)r�r�r<rrrr�sz#_SelectorSocketTransport.is_readingcCs>|js|jrdSd|_|j�|j�|j��r:t�d|�dS)NTz%r pauses reading)r�r�r�r=r�r�rrr<rrrr�s
z&_SelectorSocketTransport.pause_readingcCs@|js|jsdSd|_|�|j|j�|j��r<t�d|�dS)NFz%r resumes reading)	r�r�rDr�r�r�r�rrr<rrrr�s
z'_SelectorSocketTransport.resume_readingcCs|��dSr+)r�r<rrrr�$sz$_SelectorSocketTransport._read_readyc
Cs`|jr
dSz |j�d�}t|�s(td��WnLttfk
rD�Yn4tk
rv}z|�|d�WY�dSd}~XYnXz|j	�
|�}Wndttfk
r�YdSttfk
r��Yn4tk
r�}z|�|d�WY�dSd}~XYnX|�s|�
�dSz|j�|�WnJttfk
�r,�Yn0tk
�rZ}z|�|d�W5d}~XYnXdS)N���z%get_buffer() returned an empty bufferz/Fatal error: protocol.get_buffer() call failed.�$Fatal read error on socket transportz3Fatal error: protocol.buffer_updated() call failed.)r�r�Z
get_bufferr�r8rirjrhr�r�r�rKrJ�_read_ready__on_eofZbuffer_updated)r&r�rer�rrrr�'sF��z0_SelectorSocketTransport._read_ready__get_bufferc
Cs�|jr
dSz|j�|j�}Wndttfk
r6YdSttfk
rN�Yn4tk
r�}z|�	|d�WY�dSd}~XYnX|s�|�
�dSz|j�|�WnFttfk
r��Yn.tk
r�}z|�	|d�W5d}~XYnXdS)Nr�z2Fatal error: protocol.data_received() call failed.)
r�r�rIr�rKrJrirjrhr�r�r�Z
data_received)r&rGrerrrr�Ls.�z3_SelectorSocketTransport._read_ready__data_receivedc
Cs�|j��rt�d|�z|j��}WnLttfk
r>�Yn4tk
rp}z|�	|d�WY�dSd}~XYnX|r�|j�
|j�n|��dS)Nz%r received EOFz1Fatal error: protocol.eof_received() call failed.)
r�r�rrr�Zeof_receivedrirjrhr�r=r�r;)r&Z	keep_openrerrrr�es
�z,_SelectorSocketTransport._read_ready__on_eofc
Cs6t|tttf�s$tdt|�j����|jr2td��|j	dk	rDtd��|sLdS|j
rz|j
tjkrht
�d�|j
d7_
dS|j�sz|j�|�}Wnbttfk
r�Ynbttfk
r��YnJtk
r�}z|�|d�WY�dSd}~XYnX||d�}|�sdS|j�|j|j�|j�|�|��dS)N�/data argument must be a bytes-like object, not z%Cannot call write() after write_eof()z(unable to write; sendfile is in progress�socket.send() raised exception.r�%Fatal write error on socket transport)r�bytesr�r�r�typer!r�r8r�r�r�!LOG_THRESHOLD_FOR_CONNLOST_WRITESr�warningr�r�rOrKrJrirjrhr�r�r�r��_write_ready�extend�_maybe_pause_protocol)r&rGr�rerrr�writezs:

z_SelectorSocketTransport.writec
Cs(|jstd��|jrdSz|j�|j�}Wn�ttfk
rBYn�ttfk
rZ�Yn�t	k
r�}z>|j
�|j�|j�
�|�|d�|jdk	r�|j�|�W5d}~XYnpX|r�|jd|�=|��|j�s$|j
�|j�|jdk	r�|j�d�|j�r|�d�n|j�r$|j�tj�dS)NzData should not be emptyr�)r��AssertionErrorr�r�rOrKrJrirjrhr�r�r�r�r�r�r��_maybe_resume_protocolr�r�r�r��shutdownrB�SHUT_WR)r&r�rerrrr�s4


z%_SelectorSocketTransport._write_readycCs.|js|jrdSd|_|js*|j�tj�dSr�)r�r�r�r�rrBrr<rrr�	write_eof�s
z"_SelectorSocketTransport.write_eofcCsdSr�rr<rrr�
can_write_eof�sz&_SelectorSocketTransport.can_write_eofcs*t��|�|jdk	r&|j�td��dS)NzConnection is closed by peer)rr�r�r��ConnectionErrorr�r'rrr��s

�z._SelectorSocketTransport._call_connection_lostcCs6|jdk	rtd��|j��|_|js0|j�d�|jS)NzEmpty waiter is already set)r�r8r�rgr�r�r<rrrr��s
z+_SelectorSocketTransport._make_empty_waitercCs
d|_dSr+)r�r<rrrr��sz,_SelectorSocketTransport._reset_empty_waiter)NNN)r!r�r�Z_start_tls_compatiblerZ
_SendfileModeZ
TRY_NATIVEZ_sendfile_compatiblerr�r�r�r�r�r�r�r�rrr	r
r�r�r�r�rrr'rr,�s*�%'r,csFeZdZejZd�fdd�	Zdd�Zdd�Zd
dd	�Z	d
d�Z
�ZS)r5Ncs^t��||||�||_|j�|jj|�|j�|j|j|j	�|dk	rZ|j�t
j|d�dSr+)rr�_addressr�r�r�r�rDr�r�rr�)r&r�rr-r6r.r)r'rrr�s
�
�z#_SelectorDatagramTransport.__init__cCstdd�|jD��S)Ncss|]\}}t|�VqdSr+)r�)�.0rGrbrrr�	<genexpr>�szC_SelectorDatagramTransport.get_write_buffer_size.<locals>.<genexpr>)�sumr�r<rrrr��sz0_SelectorDatagramTransport.get_write_buffer_sizec
Cs�|jr
dSz|j�|j�\}}Wn�ttfk
r8Yn�tk
rd}z|j�|�W5d}~XYnTt	t
fk
r|�Yn<tk
r�}z|�|d�W5d}~XYnX|j�
||�dS)Nz&Fatal read error on datagram transport)r�r�Zrecvfromr�rKrJrPr��error_receivedrirjrhr�Zdatagram_received�r&rGrdrerrrr��sz&_SelectorDatagramTransport._read_readyc
Cs�t|tttf�s$tdt|�j����|s,dS|jrV|d|jfkrPtd|j����|j}|j	r�|jr�|j	t
jkrxt�
d�|j	d7_	dS|j�slz,|jdr�|j�|�n|j�||�WdSttfk
r�|j�|j|j�Yn�tk
�r}z|j�|�WY�dSd}~XYnPttfk
�r6�Yn6tk
�rj}z|�|d�WY�dSd}~XYnX|j� t|�|f�|�!�dS)Nr�z!Invalid address: must be None or r�rrZ�'Fatal write error on datagram transport)"rr�r�r�rr�r!rrnr�rr�rrr�r�r�rO�sendtorKrJr�r�r��
_sendto_readyrPr�rrirjrhr�r�rrrrrr�sH
�

�z!_SelectorDatagramTransport.sendtoc
Cs|jr�|j��\}}z*|jdr.|j�|�n|j�||�Wqttfk
rj|j�||f�Yq�Yqt	k
r�}z|j
�|�WY�dSd}~XYqtt
fk
r��Yqtk
r�}z|�|d�WY�dSd}~XYqXq|��|j�s|j�|j�|j�r|�d�dS)NrZr)r��popleftr�r�rOrrKrJ�
appendleftrPr�rrirjrhr�rr�r�r�r�r�rrrrr*s2
�z(_SelectorDatagramTransport._sendto_ready)NNN)N)r!r�r��collections�dequer�rr�r�rrr�rrr'rr5�s�

+r5)r��__all__rr^r�rrBr�r$r�ImportError�rrrrrr	r
r�logrrrZ
BaseEventLooprZ_FlowControlMixinZ	Transportr�r,r5rrrr�<module>sF
1�oasyncio/__pycache__/__init__.cpython-38.opt-2.pyc000064400000001270151153537520015557 0ustar00U

e5d��@s�ddlZddlTddlTddlTddlTddlTddlTddlTddlTddl	Tddl
TddlTddlTddl
TddlmZejejejejejejejeje	je
jejeje
jZejdkr�ddlTeej7ZnddlTeej7ZdS)�N�)�*)�_all_tasks_compatZwin32)�sysZbase_eventsZ
coroutinesZevents�
exceptionsZfuturesZlocksZ	protocolsZrunnersZqueuesZstreams�
subprocessZtasksZ
transportsr�__all__�platformZwindows_eventsZunix_events�r
r
�(/usr/lib64/python3.8/asyncio/__init__.py�<module>sX��������	�
���
asyncio/__pycache__/futures.cpython-38.pyc000064400000025673151153537520014572 0ustar00U

e5db3�@s�dZdZddlZddlZddlZddlZddlmZddlm	Z	ddlm
Z
ddlmZejZej
Z
ejZejZejdZGd	d
�d
�ZeZdd�Zd
d�Zdd�Zdd�Zdd�Zdd�Zdd�dd�ZzddlZWnek
r�YnXejZZdS)z.A Future class similar to the one in PEP 3148.)�Future�wrap_future�isfuture�N�)�base_futures)�events)�
exceptions)�format_helpersc@s�eZdZdZeZdZdZdZdZ	dZ
dZdd�dd�Ze
jZdd�Zd	d
�Zedd��Zejd
d��Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�dd�Zdd �Zd!d"�Zd#d$�Zd%d&�Z e Z!dS)'ra,This class is *almost* compatible with concurrent.futures.Future.

    Differences:

    - This class is not thread-safe.

    - result() and exception() do not take a timeout argument and
      raise an exception when the future isn't done yet.

    - Callbacks registered with add_done_callback() are always called
      via the event loop's call_soon().

    - This class is not compatible with the wait() and as_completed()
      methods in the concurrent.futures package.

    (In Python 3.4 or later we may be able to unify the implementations.)
    NF��loopcCs@|dkrt��|_n||_g|_|j��r<t�t�d��|_	dS)z�Initialize the future.

        The optional event_loop argument allows explicitly setting the event
        loop object used by the future. If it's not provided, the future uses
        the default event loop.
        Nr)
r�get_event_loop�_loop�
_callbacksZ	get_debugr	�
extract_stack�sys�	_getframe�_source_traceback��selfr�r�'/usr/lib64/python3.8/asyncio/futures.py�__init__Ds
�zFuture.__init__cCsd�|jjd�|����S)Nz<{} {}>� )�format�	__class__�__name__�join�
_repr_info�rrrr�__repr__Vs
�zFuture.__repr__cCsF|js
dS|j}|jj�d�||d�}|jr6|j|d<|j�|�dS)Nz exception was never retrieved)�message�	exception�futureZsource_traceback)�_Future__log_traceback�
_exceptionrrrr
Zcall_exception_handler)r�exc�contextrrr�__del__Zs�
zFuture.__del__cCs|jS�N)r#rrrr�_log_tracebackjszFuture._log_tracebackcCst|�rtd��d|_dS)Nz'_log_traceback can only be set to FalseF)�bool�
ValueErrorr#)r�valrrrr)nscCs|j}|dkrtd��|S)z-Return the event loop the Future is bound to.Nz!Future object is not initialized.)r
�RuntimeErrorrrrr�get_looptszFuture.get_loopcCs&d|_|jtkrdSt|_|��dS)z�Cancel the future and schedule callbacks.

        If the future is already done or cancelled, return False.  Otherwise,
        change the future's state to cancelled, schedule the callbacks and
        return True.
        FT)r#�_state�_PENDING�
_CANCELLED�_Future__schedule_callbacksrrrr�cancel{s
z
Future.cancelcCsH|jdd�}|sdSg|jdd�<|D]\}}|jj|||d�q(dS)z�Internal: Ask the event loop to call all callbacks.

        The callbacks are scheduled to be called as soon as possible. Also
        clears the callback list.
        N�r&)rr
�	call_soon)rZ	callbacks�callback�ctxrrrZ__schedule_callbacks�szFuture.__schedule_callbackscCs
|jtkS)z(Return True if the future was cancelled.)r/r1rrrr�	cancelled�szFuture.cancelledcCs
|jtkS)z�Return True if the future is done.

        Done means either that a result / exception are available, or that the
        future was cancelled.
        )r/r0rrrr�done�szFuture.donecCs@|jtkrtj�|jtkr$t�d��d|_|jdk	r:|j�|jS)aReturn the result this future represents.

        If the future has been cancelled, raises CancelledError.  If the
        future's result isn't yet available, raises InvalidStateError.  If
        the future is done and has an exception set, this exception is raised.
        zResult is not ready.FN)	r/r1r�CancelledError�	_FINISHED�InvalidStateErrorr#r$�_resultrrrr�result�s



z
Future.resultcCs0|jtkrtj�|jtkr$t�d��d|_|jS)a&Return the exception that was set on this future.

        The exception (or None if no exception was set) is returned only if
        the future is done.  If the future has been cancelled, raises
        CancelledError.  If the future isn't done yet, raises
        InvalidStateError.
        zException is not set.F)r/r1rr:r;r<r#r$rrrrr!�s


zFuture.exceptionr4cCsB|jtkr|jj|||d�n |dkr.t��}|j�||f�dS)z�Add a callback to be run when the future becomes done.

        The callback is called with a single argument - the future object. If
        the future is already done when this is called, the callback is
        scheduled with call_soon.
        r4N)r/r0r
r5�contextvarsZcopy_contextr�append)r�fnr&rrr�add_done_callback�s

zFuture.add_done_callbackcs<�fdd�|jD�}t|j�t|�}|r8||jdd�<|S)z}Remove all instances of a callback from the "call when done" list.

        Returns the number of callbacks removed.
        cs g|]\}}|�kr||f�qSrr)�.0�fr7�rArr�
<listcomp>�s�z/Future.remove_done_callback.<locals>.<listcomp>N)r�len)rrAZfiltered_callbacksZ
removed_countrrEr�remove_done_callback�s
�zFuture.remove_done_callbackcCs8|jtkr t�|j�d|����||_t|_|��dS)z�Mark the future done and set its result.

        If the future is already done when this method is called, raises
        InvalidStateError.
        �: N)r/r0rr<r=r;r2)rr>rrr�
set_result�s

zFuture.set_resultcCsb|jtkr t�|j�d|����t|t�r0|�}t|�tkrDtd��||_t	|_|�
�d|_dS)z�Mark the future done and set an exception.

        If the future is already done when this method is called, raises
        InvalidStateError.
        rIzPStopIteration interacts badly with generators and cannot be raised into a FutureTN)r/r0rr<�
isinstance�type�
StopIteration�	TypeErrorr$r;r2r#)rr!rrr�
set_exception�s

zFuture.set_exceptionccs,|��sd|_|V|��s$td��|��S)NTzawait wasn't used with future)r9�_asyncio_future_blockingr-r>rrrr�	__await__szFuture.__await__)"r�
__module__�__qualname__�__doc__r0r/r=r$r
rrPr#rrZ_future_repr_inforrr'�propertyr)�setterr.r3r2r8r9r>r!rBrHrJrOrQ�__iter__rrrrrs:

rcCs,z
|j}Wntk
rYnX|�S|jSr()r.�AttributeErrorr
)�futr.rrr�	_get_loops
rZcCs|��rdS|�|�dS)z?Helper setting the result only if the future was not cancelled.N)r8rJ)rYr>rrr�_set_result_unless_cancelledsr[cCsXt|�}|tjjkr tj|j�S|tjjkr8tj|j�S|tjjkrPtj|j�S|SdSr()rL�
concurrent�futuresr:r�args�TimeoutErrorr<)r%Z	exc_classrrr�_convert_future_exc#sr`cCs^|��st�|��r|��|��s(dS|��}|dk	rH|�t|��n|��}|�	|�dS)z8Copy state from a future to a concurrent.futures.Future.N)
r9�AssertionErrorr8r3Zset_running_or_notify_cancelr!rOr`r>rJ)r\�sourcer!r>rrr�_set_concurrent_future_state/srccCsl|��st�|��rdS|��r$t�|��r6|��n2|��}|dk	rV|�t|��n|��}|�|�dS)zqInternal helper to copy state from another Future.

    The other Future may be a concurrent.futures.Future.
    N)	r9rar8r3r!rOr`r>rJ)rb�destr!r>rrr�_copy_future_state>s
recs�t��st�tjj�std��t��s<t�tjj�s<td��t��rLt��nd�t��r`t��nd�dd�����fdd�}����fdd	�}��|���|�dS)
aChain two futures so that when one completes, so does the other.

    The result (or exception) of source will be copied to destination.
    If destination is cancelled, source gets cancelled too.
    Compatible with both asyncio.Future and concurrent.futures.Future.
    z(A future is required for source argumentz-A future is required for destination argumentNcSs"t|�rt||�n
t||�dSr()rrerc)r"�otherrrr�
_set_statebsz!_chain_future.<locals>._set_statecs2|��r.�dks��kr"���n���j�dSr()r8r3�call_soon_threadsafe)�destination)�	dest_looprb�source_looprr�_call_check_cancelhs
z)_chain_future.<locals>._call_check_cancelcsJ���r�dk	r���rdS�dks,��kr8��|�n����|�dSr()r8Z	is_closedrh)rb)rgrjrirkrr�_call_set_stateos��z&_chain_future.<locals>._call_set_state)rrKr\r]rrNrZrB)rbrirlrmr)rgrjrirbrkr�
_chain_futureRs��	
rnr
cCsNt|�r|St|tjj�s(td|����|dkr8t��}|��}t	||�|S)z&Wrap concurrent.futures.Future object.z+concurrent.futures.Future is expected, got N)
rrKr\r]rrarrZ
create_futurern)r"rZ
new_futurerrrr|s�
r)rT�__all__Zconcurrent.futuresr\r?Zloggingr�rrrr	rr0r1r;�DEBUGZSTACK_DEBUGrZ	_PyFuturerZr[r`rcrernrZ_asyncio�ImportErrorZ_CFuturerrrr�<module>s:
q*
asyncio/__pycache__/futures.cpython-38.opt-1.pyc000064400000025412151153537520015520 0ustar00U

e5db3�@s�dZdZddlZddlZddlZddlZddlmZddlm	Z	ddlm
Z
ddlmZejZej
Z
ejZejZejdZGd	d
�d
�ZeZdd�Zd
d�Zdd�Zdd�Zdd�Zdd�Zdd�dd�ZzddlZWnek
r�YnXejZZdS)z.A Future class similar to the one in PEP 3148.)�Future�wrap_future�isfuture�N�)�base_futures)�events)�
exceptions)�format_helpersc@s�eZdZdZeZdZdZdZdZ	dZ
dZdd�dd�Ze
jZdd�Zd	d
�Zedd��Zejd
d��Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�dd�Zdd �Zd!d"�Zd#d$�Zd%d&�Z e Z!dS)'ra,This class is *almost* compatible with concurrent.futures.Future.

    Differences:

    - This class is not thread-safe.

    - result() and exception() do not take a timeout argument and
      raise an exception when the future isn't done yet.

    - Callbacks registered with add_done_callback() are always called
      via the event loop's call_soon().

    - This class is not compatible with the wait() and as_completed()
      methods in the concurrent.futures package.

    (In Python 3.4 or later we may be able to unify the implementations.)
    NF��loopcCs@|dkrt��|_n||_g|_|j��r<t�t�d��|_	dS)z�Initialize the future.

        The optional event_loop argument allows explicitly setting the event
        loop object used by the future. If it's not provided, the future uses
        the default event loop.
        Nr)
r�get_event_loop�_loop�
_callbacksZ	get_debugr	�
extract_stack�sys�	_getframe�_source_traceback��selfr�r�'/usr/lib64/python3.8/asyncio/futures.py�__init__Ds
�zFuture.__init__cCsd�|jjd�|����S)Nz<{} {}>� )�format�	__class__�__name__�join�
_repr_info�rrrr�__repr__Vs
�zFuture.__repr__cCsF|js
dS|j}|jj�d�||d�}|jr6|j|d<|j�|�dS)Nz exception was never retrieved)�message�	exception�futureZsource_traceback)�_Future__log_traceback�
_exceptionrrrr
Zcall_exception_handler)r�exc�contextrrr�__del__Zs�
zFuture.__del__cCs|jS�N)r#rrrr�_log_tracebackjszFuture._log_tracebackcCst|�rtd��d|_dS)Nz'_log_traceback can only be set to FalseF)�bool�
ValueErrorr#)r�valrrrr)nscCs|j}|dkrtd��|S)z-Return the event loop the Future is bound to.Nz!Future object is not initialized.)r
�RuntimeErrorrrrr�get_looptszFuture.get_loopcCs&d|_|jtkrdSt|_|��dS)z�Cancel the future and schedule callbacks.

        If the future is already done or cancelled, return False.  Otherwise,
        change the future's state to cancelled, schedule the callbacks and
        return True.
        FT)r#�_state�_PENDING�
_CANCELLED�_Future__schedule_callbacksrrrr�cancel{s
z
Future.cancelcCsH|jdd�}|sdSg|jdd�<|D]\}}|jj|||d�q(dS)z�Internal: Ask the event loop to call all callbacks.

        The callbacks are scheduled to be called as soon as possible. Also
        clears the callback list.
        N�r&)rr
�	call_soon)rZ	callbacks�callback�ctxrrrZ__schedule_callbacks�szFuture.__schedule_callbackscCs
|jtkS)z(Return True if the future was cancelled.)r/r1rrrr�	cancelled�szFuture.cancelledcCs
|jtkS)z�Return True if the future is done.

        Done means either that a result / exception are available, or that the
        future was cancelled.
        )r/r0rrrr�done�szFuture.donecCs@|jtkrtj�|jtkr$t�d��d|_|jdk	r:|j�|jS)aReturn the result this future represents.

        If the future has been cancelled, raises CancelledError.  If the
        future's result isn't yet available, raises InvalidStateError.  If
        the future is done and has an exception set, this exception is raised.
        zResult is not ready.FN)	r/r1r�CancelledError�	_FINISHED�InvalidStateErrorr#r$�_resultrrrr�result�s



z
Future.resultcCs0|jtkrtj�|jtkr$t�d��d|_|jS)a&Return the exception that was set on this future.

        The exception (or None if no exception was set) is returned only if
        the future is done.  If the future has been cancelled, raises
        CancelledError.  If the future isn't done yet, raises
        InvalidStateError.
        zException is not set.F)r/r1rr:r;r<r#r$rrrrr!�s


zFuture.exceptionr4cCsB|jtkr|jj|||d�n |dkr.t��}|j�||f�dS)z�Add a callback to be run when the future becomes done.

        The callback is called with a single argument - the future object. If
        the future is already done when this is called, the callback is
        scheduled with call_soon.
        r4N)r/r0r
r5�contextvarsZcopy_contextr�append)r�fnr&rrr�add_done_callback�s

zFuture.add_done_callbackcs<�fdd�|jD�}t|j�t|�}|r8||jdd�<|S)z}Remove all instances of a callback from the "call when done" list.

        Returns the number of callbacks removed.
        cs g|]\}}|�kr||f�qSrr)�.0�fr7�rArr�
<listcomp>�s�z/Future.remove_done_callback.<locals>.<listcomp>N)r�len)rrAZfiltered_callbacksZ
removed_countrrEr�remove_done_callback�s
�zFuture.remove_done_callbackcCs8|jtkr t�|j�d|����||_t|_|��dS)z�Mark the future done and set its result.

        If the future is already done when this method is called, raises
        InvalidStateError.
        �: N)r/r0rr<r=r;r2)rr>rrr�
set_result�s

zFuture.set_resultcCsb|jtkr t�|j�d|����t|t�r0|�}t|�tkrDtd��||_t	|_|�
�d|_dS)z�Mark the future done and set an exception.

        If the future is already done when this method is called, raises
        InvalidStateError.
        rIzPStopIteration interacts badly with generators and cannot be raised into a FutureTN)r/r0rr<�
isinstance�type�
StopIteration�	TypeErrorr$r;r2r#)rr!rrr�
set_exception�s

zFuture.set_exceptionccs,|��sd|_|V|��s$td��|��S)NTzawait wasn't used with future)r9�_asyncio_future_blockingr-r>rrrr�	__await__szFuture.__await__)"r�
__module__�__qualname__�__doc__r0r/r=r$r
rrPr#rrZ_future_repr_inforrr'�propertyr)�setterr.r3r2r8r9r>r!rBrHrJrOrQ�__iter__rrrrrs:

rcCs,z
|j}Wntk
rYnX|�S|jSr()r.�AttributeErrorr
)�futr.rrr�	_get_loops
rZcCs|��rdS|�|�dS)z?Helper setting the result only if the future was not cancelled.N)r8rJ)rYr>rrr�_set_result_unless_cancelledsr[cCsXt|�}|tjjkr tj|j�S|tjjkr8tj|j�S|tjjkrPtj|j�S|SdSr()rL�
concurrent�futuresr:r�args�TimeoutErrorr<)r%Z	exc_classrrr�_convert_future_exc#sr`cCsR|��r|��|��sdS|��}|dk	r<|�t|��n|��}|�|�dS)z8Copy state from a future to a concurrent.futures.Future.N)r8r3Zset_running_or_notify_cancelr!rOr`r>rJ)r\�sourcer!r>rrr�_set_concurrent_future_state/srbcCsT|��rdS|��r|��n2|��}|dk	r>|�t|��n|��}|�|�dS)zqInternal helper to copy state from another Future.

    The other Future may be a concurrent.futures.Future.
    N)r8r3r!rOr`r>rJ)ra�destr!r>rrr�_copy_future_state>s
rdcs�t��st�tjj�std��t��s<t�tjj�s<td��t��rLt��nd�t��r`t��nd�dd�����fdd�}����fdd	�}��|���|�dS)
aChain two futures so that when one completes, so does the other.

    The result (or exception) of source will be copied to destination.
    If destination is cancelled, source gets cancelled too.
    Compatible with both asyncio.Future and concurrent.futures.Future.
    z(A future is required for source argumentz-A future is required for destination argumentNcSs"t|�rt||�n
t||�dSr()rrdrb)r"�otherrrr�
_set_statebsz!_chain_future.<locals>._set_statecs2|��r.�dks��kr"���n���j�dSr()r8r3�call_soon_threadsafe)�destination)�	dest_loopra�source_looprr�_call_check_cancelhs
z)_chain_future.<locals>._call_check_cancelcsJ���r�dk	r���rdS�dks,��kr8��|�n����|�dSr()r8Z	is_closedrg)ra)rfrirhrjrr�_call_set_stateos��z&_chain_future.<locals>._call_set_state)rrKr\r]rrNrZrB)rarhrkrlr)rfrirhrarjr�
_chain_futureRs��	
rmr
cCs2t|�r|S|dkrt��}|��}t||�|S)z&Wrap concurrent.futures.Future object.N)rrrZ
create_futurerm)r"rZ
new_futurerrrr|s
r)rT�__all__Zconcurrent.futuresr\r?Zloggingr�rrrr	rr0r1r;�DEBUGZSTACK_DEBUGrZ	_PyFuturerZr[r`rbrdrmrZ_asyncio�ImportErrorZ_CFuturerrrr�<module>s:
q*
asyncio/__pycache__/windows_utils.cpython-38.opt-2.pyc000064400000007563151153537520016745 0ustar00U

e5d��@s�ddlZejdkred��ddlZddlZddlZddlZddlZddlZddl	Z	dZ
dZejZej
Z
e��Zdded�d	d
�ZGdd�d�ZGd
d�dej�ZdS)�NZwin32z
win32 only)�pipe�Popen�PIPE�
PipeHandlei F)TT)�duplex�
overlapped�bufsizec
Cs$tjd�t��tt��d�}|r>tj}tj	tj
B}||}}ntj}tj
}d|}}|tjO}|drp|tj
O}|dr�tj
}nd}d}	}
z\t�||tjd||tjtj�}	t�||dtjtj|tj�}
tj|	dd�}|�d�|	|
fWS|	dk	�rt�|	�|
dk	�rt�|
��YnXdS)Nz\\.\pipe\python-pipe-{:d}-{:d}-)�prefixr�T�r)�tempfileZmktemp�format�os�getpid�next�
_mmap_counter�_winapiZPIPE_ACCESS_DUPLEXZGENERIC_READZ
GENERIC_WRITEZPIPE_ACCESS_INBOUNDZFILE_FLAG_FIRST_PIPE_INSTANCEZFILE_FLAG_OVERLAPPEDZCreateNamedPipeZ	PIPE_WAITZNMPWAIT_WAIT_FOREVERZNULLZ
CreateFileZ
OPEN_EXISTINGZConnectNamedPipeZGetOverlappedResult�CloseHandle)rrrZaddressZopenmode�accessZobsizeZibsizeZflags_and_attribsZh1Zh2Zov�r�-/usr/lib64/python3.8/asyncio/windows_utils.pyr sb��


��





rc@s^eZdZdd�Zdd�Zedd��Zdd�Zej	d	�d
d�Z
ejfdd
�Z
dd�Zdd�ZdS)rcCs
||_dS�N��_handle��self�handlerrr�__init__VszPipeHandle.__init__cCs2|jdk	rd|j��}nd}d|jj�d|�d�S)Nzhandle=�closed�<� �>)r�	__class__�__name__rrrr�__repr__Ys
zPipeHandle.__repr__cCs|jSrr�rrrrr`szPipeHandle.handlecCs|jdkrtd��|jS)NzI/O operation on closed pipe)r�
ValueErrorr%rrr�filenods
zPipeHandle.fileno)rcCs|jdk	r||j�d|_dSrr)rrrrr�closeis

zPipeHandle.closecCs*|jdk	r&|d|��t|d�|��dS)Nz	unclosed )�source)r�ResourceWarningr()rZ_warnrrr�__del__ns
zPipeHandle.__del__cCs|Srrr%rrr�	__enter__sszPipeHandle.__enter__cCs|��dSr)r()r�t�v�tbrrr�__exit__vszPipeHandle.__exit__N)r#�
__module__�__qualname__rr$�propertyrr'rrr(�warnings�warnr+r,r0rrrrrQs
rcseZdZd�fdd�	Z�ZS)rNc	sxd}}}d}	}
}|tkr@tddd�\}}	t�|tj�}n|}|tkrhtdd�\}
}
t�|
d�}n|}|tkr�tdd�\}}t�|d�}n|tkr�|}n|}z�z t�j	|f|||d�|��Wn0|	|
|fD]}|dk	r�t
�|�qւYn>X|	dk	�r
t|	�|_
|
dk	�rt|
�|_|dk	�r2t|�|_W5|tk�rJt�|�|tk�r^t�|�|tk�rrt�|�XdS)N)FTT)rr)TFrr)�stdin�stdout�stderr)rr�msvcrtZopen_osfhandler�O_RDONLY�STDOUTr(�superrrrrr6r7r8)r�argsr6r7r8�kwdsZ	stdin_rfdZ
stdout_wfdZ
stderr_wfdZstdin_whZ	stdout_rhZ	stderr_rhZstdin_rhZ	stdout_whZ	stderr_wh�h�r"rrr�sN��










zPopen.__init__)NNN)r#r1r2r�
__classcell__rrr@rr}sr)�sys�platform�ImportErrorr�	itertoolsr9r�
subprocessrr4�__all__ZBUFSIZErr;�countrrrrrrrr�<module>s"
1,asyncio/__pycache__/runners.cpython-38.opt-2.pyc000064400000002363151153537520015520 0ustar00U

e5d�@sBdZddlmZddlmZddlmZdd�dd�Zd	d
�ZdS))�run�)�
coroutines)�events)�tasksN)�debugcCs�t��dk	rtd��t�|�s,td�|���t��}z*t�|�|dk	rR|�
|�|�|�W�Szt
|�|�|���W5t�d�|�	�XXdS)Nz8asyncio.run() cannot be called from a running event loopz"a coroutine was expected, got {!r})rZ_get_running_loop�RuntimeErrorrZiscoroutine�
ValueError�formatZnew_event_loopZset_event_loop�close�_cancel_all_tasks�run_until_completeZshutdown_asyncgensZ	set_debug)�mainr�loop�r�'/usr/lib64/python3.8/asyncio/runners.pyrs"�



rcCsvt�|�}|sdS|D]}|��q|�tj||dd���|D]0}|��rNq@|��dk	r@|�d|��|d��q@dS)NT)rZreturn_exceptionsz1unhandled exception during asyncio.run() shutdown)�message�	exception�task)rZ	all_tasksZcancelrZgatherZ	cancelledrZcall_exception_handler)rZ	to_cancelrrrrr6s"

��r)�__all__�rrrrrrrrr�<module>s
.asyncio/__pycache__/unix_events.cpython-38.opt-2.pyc000064400000103014151153537520016366 0ustar00U

e5dۿ�@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
Z
ddlmZddlmZddlmZddlmZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZdZe	jdkr�ed��dd�ZGdd�dej�ZGdd�dej�Z Gdd�dej!ej"�Z#Gdd�dej$�Z%Gdd�d�Z&dd�Z'Gdd �d e&�Z(Gd!d"�d"e(�Z)Gd#d$�d$e(�Z*Gd%d&�d&e&�Z+Gd'd(�d(e&�Z,Gd)d*�d*ej-�Z.eZ/e.Z0dS)+�N�)�base_events)�base_subprocess)�	constants)�
coroutines)�events)�
exceptions)�futures)�selector_events)�tasks)�
transports)�logger)�SelectorEventLoop�AbstractChildWatcher�SafeChildWatcher�FastChildWatcher�MultiLoopChildWatcher�ThreadedChildWatcher�DefaultEventLoopPolicyZwin32z+Signals are not really supported on WindowscCsdS�N�)�signum�framerr�+/usr/lib64/python3.8/asyncio/unix_events.py�_sighandler_noop*srcs�eZdZd(�fdd�	Z�fdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	d)dd�Z
d*dd�Zd+dd�Zdd�Z
d,ddddd�dd�Zd-dddddd�dd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Z�ZS).�_UnixSelectorEventLoopNcst��|�i|_dSr)�super�__init__�_signal_handlers)�self�selector��	__class__rrr5sz_UnixSelectorEventLoop.__init__csZt���t��s.t|j�D]}|�|�qn(|jrVtjd|�d�t	|d�|j�
�dS)NzClosing the loop z@ on interpreter shutdown stage, skipping signal handlers removal��source)r�close�sys�
is_finalizing�listr�remove_signal_handler�warnings�warn�ResourceWarning�clear�r�sigr!rrr%9s
�z_UnixSelectorEventLoop.closecCs|D]}|sq|�|�qdSr)�_handle_signal)r�datarrrr�_process_self_dataGsz)_UnixSelectorEventLoop._process_self_datac
GsLt�|�st�|�rtd��|�|�|��zt�|j�	��Wn2t
tfk
rt}ztt
|���W5d}~XYnXt�|||d�}||j|<zt�|t�t�|d�Wn�tk
�rF}zz|j|=|j�szt�d�Wn4t
tfk
�r}zt�d|�W5d}~XYnX|jtjk�r4td|�d���n�W5d}~XYnXdS)Nz3coroutines cannot be used with add_signal_handler()F����set_wakeup_fd(-1) failed: %s�sig � cannot be caught)rZiscoroutineZiscoroutinefunction�	TypeError�
_check_signalZ
_check_closed�signal�
set_wakeup_fdZ_csock�fileno�
ValueError�OSError�RuntimeError�strrZHandlerr�siginterruptr
�info�errno�EINVAL)rr/�callback�args�exc�handleZnexcrrr�add_signal_handlerNs2
�

z)_UnixSelectorEventLoop.add_signal_handlercCs8|j�|�}|dkrdS|jr*|�|�n
|�|�dSr)r�getZ
_cancelledr)Z_add_callback_signalsafe)rr/rGrrrr0{sz%_UnixSelectorEventLoop._handle_signalc
Cs�|�|�z|j|=Wntk
r,YdSX|tjkr@tj}ntj}zt�||�WnBtk
r�}z$|jtj	kr�t
d|�d���n�W5d}~XYnX|js�zt�d�Wn2ttfk
r�}zt
�d|�W5d}~XYnXdS)NFr5r6r3r4T)r8r�KeyErrorr9�SIGINT�default_int_handler�SIG_DFLr=rBrCr>r:r<r
rA)rr/�handlerrFrrrr)�s(

z,_UnixSelectorEventLoop.remove_signal_handlercCs6t|t�std|����|t��kr2td|����dS)Nzsig must be an int, not zinvalid signal number )�
isinstance�intr7r9�
valid_signalsr<r.rrrr8�s
z$_UnixSelectorEventLoop._check_signalcCst|||||�Sr)�_UnixReadPipeTransport�r�pipe�protocol�waiter�extrarrr�_make_read_pipe_transport�sz0_UnixSelectorEventLoop._make_read_pipe_transportcCst|||||�Sr)�_UnixWritePipeTransportrSrrr�_make_write_pipe_transport�sz1_UnixSelectorEventLoop._make_write_pipe_transportc	

�s�t����}
|
��std��|��}t||||||||f||d�|	��}|
�|��|j|�z|IdHWnDt	t
fk
r��Yn,tk
r�|��|�
�IdH�YnXW5QRX|S)NzRasyncio.get_child_watcher() is not activated, subprocess support is not installed.)rVrW)r�get_child_watcher�	is_activer>�
create_future�_UnixSubprocessTransport�add_child_handlerZget_pid�_child_watcher_callback�
SystemExit�KeyboardInterrupt�
BaseExceptionr%Z_wait)
rrUrE�shell�stdin�stdout�stderr�bufsizerW�kwargs�watcherrV�transprrr�_make_subprocess_transport�s8

���
�z1_UnixSelectorEventLoop._make_subprocess_transportcCs|�|j|�dSr)�call_soon_threadsafeZ_process_exited)r�pid�
returncoderkrrrr`�sz._UnixSelectorEventLoop._child_watcher_callback)�ssl�sock�server_hostname�ssl_handshake_timeoutc	�s
|r|dkr6td��n |dk	r&td��|dk	r6td��|dk	r�|dk	rNtd��t�|�}t�tjtjd�}z |�d�|�||�IdHWq�|���Yq�Xn@|dkr�td��|j	tjks�|j
tjkr�td|����|�d�|j|||||d	�IdH\}}||fS)
Nz/you have to pass server_hostname when using sslz+server_hostname is only meaningful with ssl�1ssl_handshake_timeout is only meaningful with ssl�3path and sock can not be specified at the same timerFzno path and sock were specified�.A UNIX Domain Stream Socket was expected, got )rs)r<�os�fspath�socket�AF_UNIX�SOCK_STREAM�setblockingZsock_connectr%�family�typeZ_create_connection_transport)	r�protocol_factory�pathrprqrrrs�	transportrUrrr�create_unix_connection�sR���



��
�z-_UnixSelectorEventLoop.create_unix_connection�dT)rq�backlogrprs�
start_servingc
�s�t|t�rtd��|dk	r&|s&td��|dk	�rH|dk	r@td��t�|�}t�tjtj�}|ddkr�z t	�
t�	|�j�r�t�|�WnBt
k
r�Yn0tk
r�}zt�d||�W5d}~XYnXz|�|�Wnltk
�r0}	z8|��|	jtjk�rd|�d�}
ttj|
�d�n�W5d}	~	XYn|���YnXn<|dk�rZtd	��|jtjk�sv|jtjk�r�td
|����|�d�t�||g||||�}|�r�|��tjd|d�IdH|S)
Nz*ssl argument must be an SSLContext or Nonertrur)r�z2Unable to check or remove stale UNIX socket %r: %rzAddress z is already in usez-path was not specified, and no sock specifiedrvF)�loop)rO�boolr7r<rwrxryrzr{�stat�S_ISSOCK�st_mode�remove�FileNotFoundErrorr=r
�errorZbindr%rBZ
EADDRINUSEr}r~r|rZServerZ_start_servingr�sleep)rrr�rqr�rprsr��errrF�msgZserverrrr�create_unix_serversn
�
�
�

�
��
�z)_UnixSelectorEventLoop.create_unix_serverc
�s�z
tjWn,tk
r6}zt�d��W5d}~XYnXz|��}Wn2ttjfk
rv}zt�d��W5d}~XYnXzt�|�j	}Wn,t
k
r�}zt�d��W5d}~XYnX|r�|n|}	|	s�dS|��}
|�|
d|||||	d�|
IdHS)Nzos.sendfile() is not availableznot a regular filer)
rw�sendfile�AttributeErrorr�SendfileNotAvailableErrorr;�io�UnsupportedOperation�fstat�st_sizer=r]�_sock_sendfile_native_impl)rrq�file�offset�countrFr;r�Zfsize�	blocksize�futrrr�_sock_sendfile_nativeJs2
��z,_UnixSelectorEventLoop._sock_sendfile_nativec	Cs,|��}	|dk	r|�|�|��r4|�|||�dS|rd||}|dkrd|�|||�|�|�dSzt�|	|||�}
W�nDttfk
r�|dkr�|�	||�|�
|	|j||	||||||�
Y�nbtk
�rj}z�|dk	�r|j
t
jk�rt|�tk	�rtdt
j�}||_|}|dk�rBt�d�}
|�|||�|�|
�n|�|||�|�|�W5d}~XYn�ttfk
�r��Yn�tk
�r�}z|�|||�|�|�W5d}~XYnjX|
dk�r�|�|||�|�|�nD||
7}||
7}|dk�r
|�	||�|�
|	|j||	||||||�
dS)Nrzsocket is not connectedzos.sendfile call failed)r;�
remove_writer�	cancelled�_sock_sendfile_update_fileposZ
set_resultrwr��BlockingIOError�InterruptedError�_sock_add_cancellation_callbackZ
add_writerr�r=rBZENOTCONNr~�ConnectionError�	__cause__rr�Z
set_exceptionrarbrc)rr�Z
registered_fdrqr;r�r�r��
total_sent�fdZsentrF�new_excr�rrrr�as�

�


�
��
�

�z1_UnixSelectorEventLoop._sock_sendfile_native_implcCs|dkrt�||tj�dS�Nr)rw�lseek�SEEK_SET)rr;r�r�rrrr��sz4_UnixSelectorEventLoop._sock_sendfile_update_fileposcs��fdd�}|�|�dS)Ncs&|��r"���}|dkr"��|�dS)Nr3)r�r;r�)r�r��rrqrr�cb�szB_UnixSelectorEventLoop._sock_add_cancellation_callback.<locals>.cb)Zadd_done_callback)rr�rqr�rr�rr��sz6_UnixSelectorEventLoop._sock_add_cancellation_callback)N)NN)NN)N)N)N)�__name__�
__module__�__qualname__rr%r2rHr0r)r8rXrZrlr`r�r�r�r�r�r��
__classcell__rrr!rr/sF-
 �
�
�
��.��CFrcs�eZdZdZd�fdd�	Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Ze
jfdd�Zddd�Zdd�Zdd�Z�ZS) rRiNcs�t��|�||jd<||_||_|��|_||_d|_d|_	t
�|j�j}t
�|�s�t
�|�s�t
�|�s�d|_d|_d|_td��t
�|jd�|j�|jj|�|j�|jj|j|j�|dk	r�|j�tj|d�dS)NrTFz)Pipe transport is for pipes/sockets only.)rr�_extra�_loop�_piper;�_fileno�	_protocol�_closing�_pausedrwr�r�r��S_ISFIFOr��S_ISCHRr<�set_blocking�	call_soon�connection_made�_add_reader�_read_readyr	�_set_result_unless_cancelled)rr�rTrUrVrW�moder!rrr�s:


���
�z_UnixReadPipeTransport.__init__cCs�|jjg}|jdkr |�d�n|jr0|�d�|�d|j���t|jdd�}|jdk	r�|dk	r�t�	||jt
j�}|r�|�d�q�|�d�n |jdk	r�|�d�n
|�d�d�d	�
|��S)
N�closed�closing�fd=�	_selector�polling�idle�open�<{}>� )r"r�r��appendr�r��getattrr�r
�_test_selector_event�	selectorsZ
EVENT_READ�format�join)rrAr r�rrr�__repr__�s(


�

z_UnixReadPipeTransport.__repr__c
Cs�zt�|j|j�}WnDttfk
r,Yn�tk
rX}z|�|d�W5d}~XYn^X|rl|j�	|�nJ|j
��r�t�
d|�d|_|j
�|j�|j
�|jj�|j
�|jd�dS)Nz"Fatal read error on pipe transport�%r was closed by peerT)rw�readr��max_sizer�r�r=�_fatal_errorr�Z
data_receivedr��	get_debugr
rAr��_remove_readerr�Zeof_received�_call_connection_lost)rr1rFrrrr��s
z"_UnixReadPipeTransport._read_readycCs>|js|jrdSd|_|j�|j�|j��r:t�d|�dS)NTz%r pauses reading)r�r�r�r�r�r�r
�debug�rrrr�
pause_reading�s
z$_UnixReadPipeTransport.pause_readingcCsB|js|jsdSd|_|j�|j|j�|j��r>t�d|�dS)NFz%r resumes reading)	r�r�r�r�r�r�r�r
r�r�rrr�resume_readings
z%_UnixReadPipeTransport.resume_readingcCs
||_dSr�r��rrUrrr�set_protocol
sz#_UnixReadPipeTransport.set_protocolcCs|jSrr�r�rrr�get_protocolsz#_UnixReadPipeTransport.get_protocolcCs|jSr�r�r�rrr�
is_closingsz!_UnixReadPipeTransport.is_closingcCs|js|�d�dSr)r��_closer�rrrr%sz_UnixReadPipeTransport.closecCs,|jdk	r(|d|��t|d�|j��dS�Nzunclosed transport r#�r�r,r%�r�_warnrrr�__del__s
z_UnixReadPipeTransport.__del__�Fatal error on pipe transportcCsZt|t�r4|jtjkr4|j��rLtjd||dd�n|j�||||j	d��|�
|�dS�Nz%r: %sT��exc_info)�message�	exceptionr�rU)rOr=rBZEIOr�r�r
r��call_exception_handlerr�r��rrFr�rrrr�s
�z#_UnixReadPipeTransport._fatal_errorcCs(d|_|j�|j�|j�|j|�dS�NT)r�r�r�r�r�r��rrFrrrr�-sz_UnixReadPipeTransport._closecCs4z|j�|�W5|j��d|_d|_d|_XdSr�r�r%r�r�Zconnection_lostr�rrrr�2s
z,_UnixReadPipeTransport._call_connection_lost)NN)r�)r�r�r�r�rr�r�r�r�r�r�r�r%r*r+r�r�r�r�r�rrr!rrR�s
rRcs�eZdZd%�fdd�	Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zejfdd�Zdd�Zd&dd �Zd'd!d"�Zd#d$�Z�ZS)(rYNc
s�t��||�||jd<||_|��|_||_t�|_d|_	d|_
t�|j�j
}t�|�}t�|�}t�|�}	|s�|s�|	s�d|_d|_d|_td��t�|jd�|j�|jj|�|	s�|r�tj�d�s�|j�|jj|j|j�|dk	r�|j�tj|d�dS)NrTrFz?Pipe transport is only for pipes, sockets and character devicesZaix)rrr�r�r;r�r��	bytearray�_buffer�
_conn_lostr�rwr�r�r�r�r�r�r<r�r�r�r�r&�platform�
startswithr�r�r	r�)
rr�rTrUrVrWr�Zis_charZis_fifoZ	is_socketr!rrr?s:




�
�z _UnixWritePipeTransport.__init__cCs�|jjg}|jdkr |�d�n|jr0|�d�|�d|j���t|jdd�}|jdk	r�|dk	r�t�	||jt
j�}|r�|�d�n
|�d�|��}|�d|���n |jdk	r�|�d�n
|�d�d	�
d
�|��S)Nr�r�r�r�r�r�zbufsize=r�r�r�)r"r�r�r�r�r�r�r�r
r�r�ZEVENT_WRITE�get_write_buffer_sizer�r�)rrAr r�rhrrrr�ds,


�


z _UnixWritePipeTransport.__repr__cCs
t|j�Sr)�lenr�r�rrrr�|sz-_UnixWritePipeTransport.get_write_buffer_sizecCs6|j��rt�d|�|jr*|�t��n|��dS)Nr�)r�r�r
rAr�r��BrokenPipeErrorr�rrrr�s

z#_UnixWritePipeTransport._read_readyc
Cs4t|t�rt|�}|sdS|js&|jrN|jtjkr<t�d�|jd7_dS|j	�szt
�|j|�}Wntt
tfk
r�d}YnZttfk
r��YnBtk
r�}z$|jd7_|�|d�WY�dSd}~XYnX|t|�kr�dS|dk�rt|�|d�}|j�|j|j�|j	|7_	|��dS)Nz=pipe closed by peer or os.write(pipe, data) raised exception.rr�#Fatal write error on pipe transport)rOr��
memoryviewr�r�rZ!LOG_THRESHOLD_FOR_CONNLOST_WRITESr
�warningr�rw�writer�r�r�rarbrcr�r�r�Z_add_writer�_write_readyZ_maybe_pause_protocol)rr1�nrFrrrr�s6


z_UnixWritePipeTransport.writec
Cszt�|j|j�}Wn�ttfk
r,Yn�ttfk
rD�Yn�tk
r�}z6|j�	�|j
d7_
|j�|j�|�
|d�W5d}~XYnfX|t|j�kr�|j�	�|j�|j�|��|jr�|j�|j�|�d�dS|dkr�|jd|�=dS)Nrr�r)rwrr�r�r�r�rarbrcr-r�r��_remove_writerr�r�Z_maybe_resume_protocolr�r�r�)rrrFrrrr�s*


z$_UnixWritePipeTransport._write_readycCsdSr�rr�rrr�
can_write_eof�sz%_UnixWritePipeTransport.can_write_eofcCs8|jr
dSd|_|js4|j�|j�|j�|jd�dSr�)r�r�r�r�r�r�r�r�rrr�	write_eof�sz!_UnixWritePipeTransport.write_eofcCs
||_dSrr�r�rrrr��sz$_UnixWritePipeTransport.set_protocolcCs|jSrr�r�rrrr��sz$_UnixWritePipeTransport.get_protocolcCs|jSrr�r�rrrr��sz"_UnixWritePipeTransport.is_closingcCs|jdk	r|js|��dSr)r�r�rr�rrrr%�sz_UnixWritePipeTransport.closecCs,|jdk	r(|d|��t|d�|j��dSr�r�r�rrrr��s
z_UnixWritePipeTransport.__del__cCs|�d�dSr)r�r�rrr�abort�sz_UnixWritePipeTransport.abortr�cCsNt|t�r(|j��r@tjd||dd�n|j�||||jd��|�|�dSr�)	rOr=r�r�r
r�r�r�r�r�rrrr��s

�z$_UnixWritePipeTransport._fatal_errorcCsFd|_|jr|j�|j�|j��|j�|j�|j�|j|�dSr�)	r�r�r�rr�r-r�r�r�r�rrrr��s
z_UnixWritePipeTransport._closecCs4z|j�|�W5|j��d|_d|_d|_XdSrr�r�rrrr��s
z-_UnixWritePipeTransport._call_connection_lost)NN)r�)N)r�r�r�rr�r�r�rrrrr�r�r�r%r*r+r�rr�r�r�r�rrr!rrY<s"%	#	

rYc@seZdZdd�ZdS)r^c		Ks�d}|tjkrt��\}}zPtj|f||||d|d�|��|_|dk	rh|��t|��d|d�|j_	d}W5|dk	r�|��|��XdS)NF)rdrerfrgZuniversal_newlinesrh�wb)�	buffering)
�
subprocess�PIPEryZ
socketpairr%�Popen�_procr��detachre)	rrErdrerfrgrhriZstdin_wrrr�_starts.
���z_UnixSubprocessTransport._startN)r�r�r�rrrrrr^	sr^c@sDeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)rcGs
t��dSr��NotImplementedError�rrnrDrErrrr_9s	z&AbstractChildWatcher.add_child_handlercCs
t��dSrr�rrnrrr�remove_child_handlerDsz)AbstractChildWatcher.remove_child_handlercCs
t��dSrr�rr�rrr�attach_loopLsz AbstractChildWatcher.attach_loopcCs
t��dSrrr�rrrr%VszAbstractChildWatcher.closecCs
t��dSrrr�rrrr\]szAbstractChildWatcher.is_activecCs
t��dSrrr�rrr�	__enter__fszAbstractChildWatcher.__enter__cCs
t��dSrr�r�a�b�crrr�__exit__lszAbstractChildWatcher.__exit__N)
r�r�r�r_rrr%r\rrrrrrr"s
	rcCs2t�|�rt�|�St�|�r*t�|�S|SdSr)rw�WIFSIGNALED�WTERMSIG�	WIFEXITED�WEXITSTATUS)�statusrrr�_compute_returncodeqs



r#c@sDeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�BaseChildWatchercCsd|_i|_dSr)r��
_callbacksr�rrrr�szBaseChildWatcher.__init__cCs|�d�dSr)rr�rrrr%�szBaseChildWatcher.closecCs|jdk	o|j��Sr)r�Z
is_runningr�rrrr\�szBaseChildWatcher.is_activecCs
t��dSrr)r�expected_pidrrr�_do_waitpid�szBaseChildWatcher._do_waitpidcCs
t��dSrrr�rrr�_do_waitpid_all�sz BaseChildWatcher._do_waitpid_allcCsf|jdk	r$|dkr$|jr$t�dt�|jdk	r<|j�tj�||_|dk	rb|�tj|j	�|�
�dS)NzCA loop is being detached from a child watcher with pending handlers)r�r%r*r+�RuntimeWarningr)r9�SIGCHLDrH�	_sig_chldr(rrrrr�s�
zBaseChildWatcher.attach_loopc
Cs^z|��WnLttfk
r&�Yn4tk
rX}z|j�d|d��W5d}~XYnXdS)N�$Unknown exception in SIGCHLD handler)r�r�)r(rarbrcr�r�r�rrrr+�s�zBaseChildWatcher._sig_chldN)
r�r�r�rr%r\r'r(rr+rrrrr$sr$csLeZdZ�fdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	�Z
S)rcs|j��t���dSr)r%r-rr%r�r!rrr%�s
zSafeChildWatcher.closecCs|Srrr�rrrr�szSafeChildWatcher.__enter__cCsdSrrrrrrr�szSafeChildWatcher.__exit__cGs||f|j|<|�|�dSr)r%r'rrrrr_�sz"SafeChildWatcher.add_child_handlercCs*z|j|=WdStk
r$YdSXdS�NTF�r%rJrrrrr�s
z%SafeChildWatcher.remove_child_handlercCst|j�D]}|�|�q
dSr�r(r%r'rrrrr(�sz SafeChildWatcher._do_waitpid_allcCs�zt�|tj�\}}Wn(tk
r>|}d}t�d|�Yn.X|dkrLdSt|�}|j��rlt�	d||�z|j
�|�\}}Wn.tk
r�|j��r�tjd|dd�YnX|||f|��dS)N��8Unknown child process pid %d, will report returncode 255r�$process %s exited with returncode %s�'Child watcher got an unexpected pid: %rTr�)
rw�waitpid�WNOHANG�ChildProcessErrorr
rr#r�r�r�r%�poprJ)rr&rnr"rorDrErrrr'�s4�

�
�zSafeChildWatcher._do_waitpid)r�r�r�r%rrr_rr(r'r�rrr!rr�srcsPeZdZ�fdd�Z�fdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	�Z
S)rcs$t���t��|_i|_d|_dSr�)rr�	threadingZLock�_lock�_zombies�_forksr�r!rrrs

zFastChildWatcher.__init__cs"|j��|j��t���dSr)r%r-r:rr%r�r!rrr%s

zFastChildWatcher.closec
Cs0|j� |jd7_|W5QR�SQRXdS)Nr)r9r;r�rrrrszFastChildWatcher.__enter__c	Cs^|j�B|jd8_|js"|js0W5QR�dSt|j�}|j��W5QRXt�d|�dS)Nrz5Caught subprocesses termination from unknown pids: %s)r9r;r:r?r-r
r)rrrrZcollateral_victimsrrrrs
�zFastChildWatcher.__exit__c	Gsf|j�Fz|j�|�}Wn.tk
rF||f|j|<YW5QR�dSXW5QRX|||f|��dSr)r9r:r7rJr%)rrnrDrErorrrr_'sz"FastChildWatcher.add_child_handlercCs*z|j|=WdStk
r$YdSXdSr-r.rrrrr5s
z%FastChildWatcher.remove_child_handlerc	Cs�zt�dtj�\}}Wntk
r,YdSX|dkr:dSt|�}|j��z|j�|�\}}WnNtk
r�|j	r�||j
|<|j��r�t
�d||�YW5QR�qd}YnX|j��r�t
�d||�W5QRX|dkr�t
�d||�q|||f|��qdS)Nr3rz,unknown process %s exited with returncode %sr2z8Caught subprocess termination from unknown pid: %d -> %d)rwr4r5r6r#r9r%r7rJr;r:r�r�r
r�r)rrnr"rorDrErrrr(<s@

�

��z FastChildWatcher._do_waitpid_all)r�r�r�rr%rrr_rr(r�rrr!rr�s
rc@sdeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dS)rcCsi|_d|_dSr)r%�_saved_sighandlerr�rrrrzszMultiLoopChildWatcher.__init__cCs
|jdk	Sr)r<r�rrrr\~szMultiLoopChildWatcher.is_activecCsT|j��|jdkrdSt�tj�}||jkr:t�d�nt�tj|j�d|_dS)Nz+SIGCHLD handler was changed by outside code)	r%r-r<r9�	getsignalr*r+r
r)rrNrrrr%�s


zMultiLoopChildWatcher.closecCs|Srrr�rrrr�szMultiLoopChildWatcher.__enter__cCsdSrr�r�exc_typeZexc_valZexc_tbrrrr�szMultiLoopChildWatcher.__exit__cGs&t��}|||f|j|<|�|�dSr)r�get_running_loopr%r')rrnrDrEr�rrrr_�sz'MultiLoopChildWatcher.add_child_handlercCs*z|j|=WdStk
r$YdSXdSr-r.rrrrr�s
z*MultiLoopChildWatcher.remove_child_handlercCsN|jdk	rdSt�tj|j�|_|jdkr<t�d�tj|_t�tjd�dS)NzaPrevious SIGCHLD handler was set by non-Python code, restore to default handler on watcher close.F)r<r9r*r+r
rrMr@rrrrr�s


z!MultiLoopChildWatcher.attach_loopcCst|j�D]}|�|�q
dSrr/rrrrr(�sz%MultiLoopChildWatcher._do_waitpid_allc	Cs�zt�|tj�\}}Wn,tk
rB|}d}t�d|�d}YnX|dkrPdSt|�}d}z|j�|�\}}}Wn$t	k
r�tjd|dd�YnHX|�
�r�t�d||�n.|r�|��r�t�d	||�|j
|||f|��dS)
Nr0r1FrTr3r��%Loop %r that handles pid %r is closedr2)rwr4r5r6r
rr#r%r7rJ�	is_closedr�r�rm)	rr&rnr"roZ	debug_logr�rDrErrrr'�s:�
��z!MultiLoopChildWatcher._do_waitpidc	CsLz|��Wn:ttfk
r&�Yn"tk
rFtjddd�YnXdS)Nr,Tr�)r(rarbrcr
r)rrrrrrr+�szMultiLoopChildWatcher._sig_chldN)r�r�r�rr\r%rrr_rrr(r'r+rrrrrgs%rc@sjeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Ze	j
fd
d�Zdd�Zdd�Z
dd�Zdd�ZdS)rcCst�d�|_i|_dSr�)�	itertoolsr��_pid_counter�_threadsr�rrrr�szThreadedChildWatcher.__init__cCsdSr�rr�rrrr\�szThreadedChildWatcher.is_activecCs|��dSr)�
_join_threadsr�rrrr%�szThreadedChildWatcher.closecCs.dd�t|j���D�}|D]}|��qdS)NcSsg|]}|��r|js|�qSr)�is_alive�daemon��.0�threadrrr�
<listcomp>�s�z6ThreadedChildWatcher._join_threads.<locals>.<listcomp>)r(rE�valuesr�)r�threadsrKrrrrF�sz"ThreadedChildWatcher._join_threadscCs|Srrr�rrrrszThreadedChildWatcher.__enter__cCsdSrrr>rrrrszThreadedChildWatcher.__exit__cCs6dd�t|j���D�}|r2||j�d�t|d�dS)NcSsg|]}|��r|�qSr)rGrIrrrrL	s�z0ThreadedChildWatcher.__del__.<locals>.<listcomp>z0 has registered but not finished child processesr#)r(rErMr"r,)rr�rNrrrr�s�zThreadedChildWatcher.__del__cGsFt��}tj|jdt|j���||||fdd�}||j|<|��dS)Nzwaitpid-T)�target�namerErH)	rr@r8ZThreadr'�nextrDrE�start)rrnrDrEr�rKrrrr_s
�
z&ThreadedChildWatcher.add_child_handlercCsdSr�rrrrrrsz)ThreadedChildWatcher.remove_child_handlercCsdSrrrrrrrsz ThreadedChildWatcher.attach_loopcCs�zt�|d�\}}Wn(tk
r<|}d}t�d|�Yn Xt|�}|��r\t�d||�|��rtt�d||�n|j	|||f|��|j
�|�dS)Nrr0r1r2rA)rwr4r6r
rr#r�r�rBrmrEr7)rr�r&rDrErnr"rorrrr'"s&�
�z ThreadedChildWatcher._do_waitpidN)r�r�r�rr\r%rFrrr*r+r�r_rrr'rrrrr�s
	rcsDeZdZeZ�fdd�Zdd�Z�fdd�Zdd�Zd	d
�Z	�Z
S)�_UnixDefaultEventLoopPolicycst���d|_dSr)rr�_watcherr�r!rrrAs
z$_UnixDefaultEventLoopPolicy.__init__c	CsHtj�8|jdkr:t�|_tt��tj�r:|j�|j	j
�W5QRXdSr)rr9rTrrOr8�current_thread�_MainThreadr�_localr�r�rrr�
_init_watcherEs
�z)_UnixDefaultEventLoopPolicy._init_watchercs6t��|�|jdk	r2tt��tj�r2|j�|�dSr)r�set_event_looprTrOr8rUrVrrr!rrrYMs

�z*_UnixDefaultEventLoopPolicy.set_event_loopcCs|jdkr|��|jSr)rTrXr�rrrr[[s
z-_UnixDefaultEventLoopPolicy.get_child_watchercCs|jdk	r|j��||_dSr)rTr%)rrjrrr�set_child_watcheres

z-_UnixDefaultEventLoopPolicy.set_child_watcher)r�r�r�rZ
_loop_factoryrrXrYr[rZr�rrr!rrS=s
rS)1rBr�rCrwr�r9ryr�rr&r8r*�rrrrrrr	r
rr�logr
�__all__r��ImportErrorrZBaseSelectorEventLooprZ
ReadTransportrRZ_FlowControlMixinZWriteTransportrYZBaseSubprocessTransportr^rr#r$rrrrZBaseDefaultEventLoopPolicyrSrrrrrr�<module>s^	
	�NO5Ji}Y3asyncio/__pycache__/format_helpers.cpython-38.pyc000064400000004436151153537520016101 0ustar00U

e5dd	�@sdddlZddlZddlZddlZddlZddlmZdd�Zdd�Zdd	�Z	ddd�Z
dd
d�ZdS)�N�)�	constantscCsVt�|�}t�|�r&|j}|j|jfSt|tj�r<t	|j
�St|tj�rRt	|j
�SdS�N)�inspectZunwrapZ
isfunction�__code__�co_filename�co_firstlineno�
isinstance�	functools�partial�_get_function_source�func�
partialmethod)r
�code�r�./usr/lib64/python3.8/asyncio/format_helpers.pyr
s



rcCs8t||d�}t|�}|r4|d|d�d|d��7}|S)Nz at r�:r)�_format_callbackr)r
�args�	func_repr�sourcerrr�_format_callback_sources
rcCsHg}|r|�dd�|D��|r8|�dd�|��D��d�d�|��S)z�Format function arguments and keyword arguments.

    Special case for a single parameter: ('hello',) is formatted as ('hello').
    css|]}t�|�VqdSr��reprlib�repr)�.0�argrrr�	<genexpr>&sz*_format_args_and_kwargs.<locals>.<genexpr>css&|]\}}|�dt�|���VqdS)�=Nr)r�k�vrrrr(sz({})z, )�extend�items�format�join)r�kwargsr"rrr�_format_args_and_kwargssr&�cCs�t|tj�r.t||�|}t|j|j|j|�St|d�rF|j	rF|j	}n t|d�r^|j
r^|j
}nt|�}|t||�7}|r�||7}|S)N�__qualname__�__name__)r	r
rr&rr
r�keywords�hasattrr(r)r)r
rr%�suffixrrrrr,srcCsD|dkrt��j}|dkr tj}tjjt�|�|dd�}|�	�|S)zlReplacement for traceback.extract_stack() that only does the
    necessary work for asyncio debug mode.
    NF)�limit�lookup_lines)
�sys�	_getframe�f_backrZDEBUG_STACK_DEPTH�	traceback�StackSummary�extract�
walk_stack�reverse)�fr-�stackrrr�
extract_stack>s
�r9)r')NN)r
rrr/r2r'rrrr&rr9rrrr�<module>s
asyncio/__pycache__/queues.cpython-38.opt-1.pyc000064400000020277151153537520015336 0ustar00U

e5d �@s�dZddlZddlZddlZddlmZddlmZGdd�de�ZGdd	�d	e�Z	Gd
d�d�Z
Gdd
�d
e
�ZGdd�de
�ZdS))�Queue�
PriorityQueue�	LifoQueue�	QueueFull�
QueueEmpty�N�)�events)�locksc@seZdZdZdS)rz;Raised when Queue.get_nowait() is called on an empty Queue.N��__name__�
__module__�__qualname__�__doc__�rr�&/usr/lib64/python3.8/asyncio/queues.pyrsrc@seZdZdZdS)rzDRaised when the Queue.put_nowait() method is called on a full Queue.Nr
rrrrrsrc@s�eZdZdZd)dd�dd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Ze
dd��Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�ZdS)*raA queue, useful for coordinating producer and consumer coroutines.

    If maxsize is less than or equal to zero, the queue size is infinite. If it
    is an integer greater than 0, then "await put()" will block when the
    queue reaches maxsize, until an item is removed by get().

    Unlike the standard library Queue, you can reliably know this Queue's size
    with qsize(), since your single-threaded asyncio application won't be
    interrupted between calling qsize() and doing an operation on the Queue.
    rN��loopcCsp|dkrt��|_n||_tjdtdd�||_t��|_	t��|_
d|_tj
|d�|_|j��|�|�dS)Nz[The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.�)�
stacklevelrr)rZget_event_loop�_loop�warnings�warn�DeprecationWarning�_maxsize�collections�deque�_getters�_putters�_unfinished_tasksr	ZEvent�	_finished�set�_init)�self�maxsizerrrr�__init__!s�


zQueue.__init__cCst��|_dS�N)rr�_queue�r"r#rrrr!6szQueue._initcCs
|j��Sr%)r&�popleft�r"rrr�_get9sz
Queue._getcCs|j�|�dSr%�r&�append�r"�itemrrr�_put<sz
Queue._putcCs&|r"|��}|��s|�d�q"qdSr%)r(ZdoneZ
set_result)r"�waitersZwaiterrrr�_wakeup_nextAs

zQueue._wakeup_nextcCs(dt|�j�dt|�d�d|���d�S)N�<z at z#x� �>)�typer�id�_formatr)rrr�__repr__IszQueue.__repr__cCsdt|�j�d|���d�S)Nr2r3r4)r5rr7r)rrr�__str__Lsz
Queue.__str__cCs~d|j��}t|dd�r,|dt|j���7}|jrH|dt|j��d�7}|jrd|dt|j��d�7}|jrz|d|j��7}|S)Nzmaxsize=r&z _queue=z
 _getters[�]z
 _putters[z tasks=)r�getattr�listr&r�lenrr)r"�resultrrrr7Osz
Queue._formatcCs
t|j�S)zNumber of items in the queue.)r=r&r)rrr�qsize[szQueue.qsizecCs|jS)z%Number of items allowed in the queue.)rr)rrrr#_sz
Queue.maxsizecCs|jS)z3Return True if the queue is empty, False otherwise.�r&r)rrr�emptydszQueue.emptycCs |jdkrdS|��|jkSdS)z�Return True if there are maxsize items in the queue.

        Note: if the Queue was initialized with maxsize=0 (the default),
        then full() is never True.
        rFN)rr?r)rrr�fullhs
z
Queue.fullc�s�|��r�|j��}|j�|�z|IdHWq|��z|j�|�Wntk
r`YnX|��s~|��s~|�	|j��YqXq|�
|�S)z�Put an item into the queue.

        Put an item into the queue. If the queue is full, wait until a free
        slot is available before adding item.
        N)rBr�
create_futurerr,�cancel�remove�
ValueError�	cancelledr1�
put_nowait)r"r.Zputterrrr�putss

z	Queue.putcCs>|��rt�|�|�|jd7_|j��|�|j�dS)zyPut an item into the queue without blocking.

        If no free slot is immediately available, raise QueueFull.
        rN)rBrr/rr�clearr1rr-rrrrH�s

zQueue.put_nowaitc�s�|��r�|j��}|j�|�z|IdHWq|��z|j�|�Wntk
r`YnX|��s~|��s~|�	|j��YqXq|�
�S)zoRemove and return an item from the queue.

        If queue is empty, wait until an item is available.
        N)rArrCrr,rDrErFrGr1�
get_nowait)r"�getterrrr�get�s

z	Queue.getcCs$|��rt�|��}|�|j�|S)z�Remove and return an item from the queue.

        Return an item if one is immediately available, else raise QueueEmpty.
        )rArr*r1rr-rrrrK�s
zQueue.get_nowaitcCs8|jdkrtd��|jd8_|jdkr4|j��dS)a$Indicate that a formerly enqueued task is complete.

        Used by queue consumers. For each get() used to fetch a task,
        a subsequent call to task_done() tells the queue that the processing
        on the task is complete.

        If a join() is currently blocking, it will resume when all items have
        been processed (meaning that a task_done() call was received for every
        item that had been put() into the queue).

        Raises ValueError if called more times than there were items placed in
        the queue.
        rz!task_done() called too many timesrN)rrFrr r)rrr�	task_done�s


zQueue.task_donec�s|jdkr|j��IdHdS)aBlock until all items in the queue have been gotten and processed.

        The count of unfinished tasks goes up whenever an item is added to the
        queue. The count goes down whenever a consumer calls task_done() to
        indicate that the item was retrieved and all work on it is complete.
        When the count of unfinished tasks drops to zero, join() unblocks.
        rN)rr�waitr)rrr�join�s
z
Queue.join)r)rrr
rr$r!r*r/r1r8r9r7r?�propertyr#rArBrIrHrMrKrNrPrrrrrs(
rc@s4eZdZdZdd�Zejfdd�Zejfdd�Z	dS)	rz�A subclass of Queue; retrieves entries in priority order (lowest first).

    Entries are typically tuples of the form: (priority number, data).
    cCs
g|_dSr%r@r'rrrr!�szPriorityQueue._initcCs||j|�dSr%r@)r"r.�heappushrrrr/�szPriorityQueue._putcCs
||j�Sr%r@)r"�heappoprrrr*�szPriorityQueue._getN)
rrr
rr!�heapqrRr/rSr*rrrrr�src@s(eZdZdZdd�Zdd�Zdd�ZdS)	rzEA subclass of Queue that retrieves most recently added entries first.cCs
g|_dSr%r@r'rrrr!�szLifoQueue._initcCs|j�|�dSr%r+r-rrrr/�szLifoQueue._putcCs
|j��Sr%)r&�popr)rrrr*�szLifoQueue._getN)rrr
rr!r/r*rrrrr�sr)
�__all__rrTr�rr	�	Exceptionrrrrrrrrr�<module>sKasyncio/__pycache__/base_subprocess.cpython-38.pyc000064400000022312151153537520016242 0ustar00U

e5d�"�@sxddlZddlZddlZddlmZddlmZddlmZGdd�dej�Z	Gdd	�d	ej
�ZGd
d�deej�Z
dS)�N�)�	protocols)�
transports)�loggercs�eZdZd0�fdd�	Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	e
jfdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Z�ZS)1�BaseSubprocessTransportNc
	s&t��|
�d|_||_||_d|_d|_d|_g|_t	�
�|_i|_d|_
|tjkr`d|jd<|tjkrtd|jd<|tjkr�d|jd<z"|jf||||||d�|��Wn|���YnX|jj|_|j|jd<|j���rt|ttf�r�|}n|d}t�d||j�|j�|�|	��dS)NFrr�)�args�shell�stdin�stdout�stderr�bufsize�
subprocesszprocess %r created: pid %s)�super�__init__�_closed�	_protocol�_loop�_proc�_pid�_returncode�
_exit_waiters�collections�deque�_pending_calls�_pipes�	_finishedr�PIPE�_start�close�pidZ_extra�	get_debug�
isinstance�bytes�strr�debugZcreate_task�_connect_pipes)
�self�loop�protocolrr	r
rrr
�waiterZextra�kwargsZprogram��	__class__��//usr/lib64/python3.8/asyncio/base_subprocess.pyrsL






��

�z BaseSubprocessTransport.__init__cCs|jjg}|jr|�d�|jdk	r6|�d|j���|jdk	rT|�d|j���n |jdk	rj|�d�n
|�d�|j�d�}|dk	r�|�d|j���|j�d�}|j�d	�}|dk	r�||kr�|�d
|j���n6|dk	r�|�d|j���|dk	�r|�d|j���d
�	d�
|��S)N�closedzpid=zreturncode=Zrunningznot startedrzstdin=rrzstdout=stderr=zstdout=zstderr=z<{}>� )r-�__name__r�appendrrr�get�pipe�format�join)r'�infor
rrr.r.r/�__repr__7s,






z BaseSubprocessTransport.__repr__cKst�dS�N)�NotImplementedError)r'rr	r
rrr
r+r.r.r/rTszBaseSubprocessTransport._startcCs
||_dSr:�r)r'r)r.r.r/�set_protocolWsz$BaseSubprocessTransport.set_protocolcCs|jSr:r<�r'r.r.r/�get_protocolZsz$BaseSubprocessTransport.get_protocolcCs|jSr:)rr>r.r.r/�
is_closing]sz"BaseSubprocessTransport.is_closingcCs�|jr
dSd|_|j��D]}|dkr(q|j��q|jdk	r�|jdkr�|j��dkr�|j�	�rlt
�d|�z|j��Wnt
k
r�YnXdS)NTz$Close running child process: kill %r)rr�valuesr5rrrZpollrr!rZwarning�kill�ProcessLookupError)r'�protor.r.r/r`s$
��
zBaseSubprocessTransport.closecCs&|js"|d|��t|d�|��dS)Nzunclosed transport )�source)r�ResourceWarningr)r'Z_warnr.r.r/�__del__{szBaseSubprocessTransport.__del__cCs|jSr:)rr>r.r.r/�get_pid�szBaseSubprocessTransport.get_pidcCs|jSr:)rr>r.r.r/�get_returncode�sz&BaseSubprocessTransport.get_returncodecCs||jkr|j|jSdSdSr:)rr5)r'�fdr.r.r/�get_pipe_transport�s
z*BaseSubprocessTransport.get_pipe_transportcCs|jdkrt��dSr:)rrCr>r.r.r/�_check_proc�s
z#BaseSubprocessTransport._check_proccCs|��|j�|�dSr:)rLr�send_signal)r'�signalr.r.r/rM�sz#BaseSubprocessTransport.send_signalcCs|��|j��dSr:)rLr�	terminater>r.r.r/rO�sz!BaseSubprocessTransport.terminatecCs|��|j��dSr:)rLrrBr>r.r.r/rB�szBaseSubprocessTransport.killc	
�spz�j}�j}|jdk	rB|��fdd�|j�IdH\}}|�jd<|jdk	rv|��fdd�|j�IdH\}}|�jd<|jdk	r�|��fdd�|j�IdH\}}|�jd<�jdk	s�t	�|�
�jj���jD]\}}|j
|f|��q�d�_Wn\t
tfk
�r�Yn`tk
�rL}z"|dk	�r<|���s<|�|�W5d}~XYn X|dk	�rl|���sl|�d�dS)Ncs
t�d�S)Nr)�WriteSubprocessPipeProtor.r>r.r/�<lambda>��z8BaseSubprocessTransport._connect_pipes.<locals>.<lambda>rcs
t�d�S)Nr��ReadSubprocessPipeProtor.r>r.r/rQ�rRrcs
t�d�S)NrrSr.r>r.r/rQ�rRr)rrr
Zconnect_write_piperrZconnect_read_piperr�AssertionError�	call_soonr�connection_made�
SystemExit�KeyboardInterrupt�
BaseException�	cancelledZ
set_exception�
set_result)	r'r*�procr(�_r5�callback�data�excr.r>r/r&�sB

�


�


�

z&BaseSubprocessTransport._connect_pipescGs2|jdk	r|j�||f�n|jj|f|��dSr:)rr3rrV)r'�cbr`r.r.r/�_call�s
zBaseSubprocessTransport._callcCs|�|jj||�|��dSr:)rcrZpipe_connection_lost�_try_finish)r'rJrar.r.r/�_pipe_connection_lost�sz-BaseSubprocessTransport._pipe_connection_lostcCs|�|jj||�dSr:)rcrZpipe_data_received)r'rJr`r.r.r/�_pipe_data_received�sz+BaseSubprocessTransport._pipe_data_receivedcCs�|dk	st|��|jdks$t|j��|j��r<t�d||�||_|jjdkrV||j_|�|j	j
�|��|jD]}|�
�sr|�|�qrd|_dS)Nz%r exited with return code %r)rUrrr!rr8r�
returncodercrZprocess_exitedrdrr[r\)r'rgr*r.r.r/�_process_exited�s

z'BaseSubprocessTransport._process_exitedc�s0|jdk	r|jS|j��}|j�|�|IdHS)zdWait until the process exit and return the process return code.

        This method is a coroutine.N)rrZ
create_futurerr3)r'r*r.r.r/�_wait�s


zBaseSubprocessTransport._waitcCsH|jr
t�|jdkrdStdd�|j��D��rDd|_|�|jd�dS)Ncss|]}|dk	o|jVqdSr:)�disconnected)�.0�pr.r.r/�	<genexpr>�s�z6BaseSubprocessTransport._try_finish.<locals>.<genexpr>T)rrUr�allrrArc�_call_connection_lostr>r.r.r/rd�s

�z#BaseSubprocessTransport._try_finishcCs*z|j�|�W5d|_d|_d|_XdSr:)rrr�connection_lost�r'rar.r.r/ro�s
z-BaseSubprocessTransport._call_connection_lost)NN)r2�
__module__�__qualname__rr9rr=r?r@r�warnings�warnrGrHrIrKrLrMrOrBr&rcrerfrhrirdro�
__classcell__r.r.r,r/r
s2�+&	rc@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)rPcCs||_||_d|_d|_dS)NF)r]rJr5rj)r'r]rJr.r.r/rsz!WriteSubprocessPipeProto.__init__cCs
||_dSr:)r5)r'Z	transportr.r.r/rWsz(WriteSubprocessPipeProto.connection_madecCs d|jj�d|j�d|j�d�S)N�<z fd=z pipe=�>)r-r2rJr5r>r.r.r/r9
sz!WriteSubprocessPipeProto.__repr__cCs d|_|j�|j|�d|_dS)NT)rjr]rerJrqr.r.r/rp
sz(WriteSubprocessPipeProto.connection_lostcCs|jj��dSr:)r]r�
pause_writingr>r.r.r/rysz&WriteSubprocessPipeProto.pause_writingcCs|jj��dSr:)r]r�resume_writingr>r.r.r/rzsz'WriteSubprocessPipeProto.resume_writingN)	r2rrrsrrWr9rpryrzr.r.r.r/rP�srPc@seZdZdd�ZdS)rTcCs|j�|j|�dSr:)r]rfrJ)r'r`r.r.r/�
data_receivedsz%ReadSubprocessPipeProto.data_receivedN)r2rrrsr{r.r.r.r/rTsrT)rrrt�rr�logrZSubprocessTransportrZBaseProtocolrPZProtocolrTr.r.r.r/�<module>sv�asyncio/__pycache__/locks.cpython-38.opt-2.pyc000064400000023050151153537520015133 0ustar00U

e5d|C�@s�dZddlZddlZddlZddlmZddlmZddlmZddlmZGdd	�d	�Z	Gd
d�d�Z
Gdd
�d
e
�ZGdd�d�ZGdd�de
�Z
Gdd�de
�ZGdd�de�ZdS))�Lock�Event�	Condition�	Semaphore�BoundedSemaphore�N�)�events)�futures)�
exceptions)�
coroutinesc@s$eZdZdd�Zdd�Zdd�ZdS)�_ContextManagercCs
||_dS�N)�_lock)�self�lock�r�%/usr/lib64/python3.8/asyncio/locks.py�__init__"sz_ContextManager.__init__cCsdSr
r�rrrr�	__enter__%sz_ContextManager.__enter__cGsz|j��W5d|_XdSr
)r�release�r�argsrrr�__exit__*sz_ContextManager.__exit__N)�__name__�
__module__�__qualname__rrrrrrrrsrc@sReZdZdd�Zdd�Zejdd��Zej	e_	dd�Z
d	d
�Zdd�Zd
d�Z
dS)�_ContextManagerMixincCstd��dS)Nz9"yield from" should be used as context manager expression)�RuntimeErrorrrrrr2s�z_ContextManagerMixin.__enter__cGsdSr
rrrrrr6sz_ContextManagerMixin.__exit__ccs&tjdtdd�|��EdHt|�S)NzD'with (yield from lock)' is deprecated use 'async with lock' instead���
stacklevel)�warnings�warn�DeprecationWarning�acquirerrrrr�__iter__;s�z_ContextManagerMixin.__iter__c�s|��IdHt|�Sr
)r%rrrrrZ
__acquire_ctxUsz"_ContextManagerMixin.__acquire_ctxcCstjdtdd�|����S)Nz='with await lock' is deprecated use 'async with lock' insteadrr )r"r#r$�!_ContextManagerMixin__acquire_ctx�	__await__rrrrr(Ys
�z_ContextManagerMixin.__await__c�s|��IdHdSr
)r%rrrr�
__aenter__`sz_ContextManagerMixin.__aenter__c�s|��dSr
)r)r�exc_type�exc�tbrrr�	__aexit__fsz_ContextManagerMixin.__aexit__N)rrrrr�types�	coroutiner&rZ
_is_coroutiner'r(r)r-rrrrr1s
rcsJeZdZdd�dd�Z�fdd�Zdd�Zd	d
�Zdd�Zd
d�Z�Z	S)rN��loopcCs:d|_d|_|dkr t��|_n||_tjdtdd�dS�NF�[The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.rr )�_waiters�_lockedr�get_event_loop�_loopr"r#r$�rr1rrrr�s�z
Lock.__init__csLt���}|jrdnd}|jr2|�dt|j���}d|dd��d|�d�S�	N�lockedZunlocked�
, waiters:�<r���� [�]>)�super�__repr__r5r4�len�r�resZextra��	__class__rrrA�s

z
Lock.__repr__cCs|jSr
)r5rrrrr:�szLock.lockedc	�s�|js.|jdks$tdd�|jD��r.d|_dS|jdkrBt��|_|j��}|j�|�z"z|IdHW5|j�|�XWn&t	j
k
r�|js�|���YnXd|_dS)Ncss|]}|��VqdSr
)�	cancelled)�.0�wrrr�	<genexpr>�szLock.acquire.<locals>.<genexpr>T)r5r4�all�collections�dequer7�
create_future�append�remover
�CancelledError�_wake_up_first�r�futrrrr%�s&�


zLock.acquirecCs"|jrd|_|��ntd��dS)NFzLock is not acquired.)r5rRrrrrrr�s
zLock.releasecCsJ|js
dSztt|j��}Wntk
r2YdSX|��sF|�d�dS�NT)r4�next�iter�
StopIteration�done�
set_resultrSrrrrR�szLock._wake_up_first)
rrrrrAr:r%rrR�
__classcell__rrrErrjs6 rcsJeZdZdd�dd�Z�fdd�Zdd�Zd	d
�Zdd�Zd
d�Z�Z	S)rNr0cCs>t��|_d|_|dkr$t��|_n||_tjdt	dd�dSr2)
rLrMr4�_valuerr6r7r"r#r$r8rrrrs
�zEvent.__init__csLt���}|jrdnd}|jr2|�dt|j���}d|dd��d|�d�S)	N�setZunsetr;r<rr=r>r?)r@rAr\r4rBrCrErrrAs

zEvent.__repr__cCs|jSr
�r\rrrr�is_setszEvent.is_setcCs.|js*d|_|jD]}|��s|�d�qdSrU)r\r4rYrZrSrrrr]s

z	Event.setcCs
d|_dS)NFr^rrrr�clear"szEvent.clearc	�sF|jr
dS|j��}|j�|�z|IdHW�dS|j�|�XdSrU)r\r7rNr4rOrPrSrrr�wait(s

z
Event.wait)
rrrrrAr_r]r`rar[rrrErr�s	rcsNeZdZddd�dd�Z�fdd�Zdd�Zd	d
�Zddd
�Zdd�Z�Z	S)rNr0cCs~|dkrt��|_n||_tjdtdd�|dkr>t|d�}n|j|jk	rRtd��||_|j	|_	|j
|_
|j|_t�
�|_dS)Nr3rr r0z"loop argument must agree with lock)rr6r7r"r#r$r�
ValueErrorrr:r%rrLrMr4)rrr1rrrrEs �zCondition.__init__csNt���}|��rdnd}|jr4|�dt|j���}d|dd��d|�d�Sr9)r@rAr:r4rBrCrErrrA[s

zCondition.__repr__c�s�|��std��|��z@|j��}|j�	|�z|IdHW�W�dS|j�
|�XW5d}z|��IdHWq�Wq^tjk
r�d}Yq^Xq^|r�tj�XdS)Nzcannot wait on un-acquired lockFT)r:rrr%r
rQr7rNr4rOrP)rrGrTrrrrabs$

zCondition.waitc�s$|�}|s |��IdH|�}q|Sr
)ra)rZ	predicate�resultrrr�wait_for�s
zCondition.wait_forrcCsJ|��std��d}|jD]*}||kr*qF|��s|d7}|�d�qdS)Nz!cannot notify on un-acquired lockrrF)r:rr4rYrZ)r�n�idxrTrrr�notify�s
zCondition.notifycCs|�t|j��dSr
)rgrBr4rrrr�
notify_all�szCondition.notify_all)N)r)
rrrrrArardrgrhr[rrrErr;s
%
rcsLeZdZddd�dd�Z�fdd�Zdd	�Zd
d�Zdd
�Zdd�Z�Z	S)rrNr0cCsN|dkrtd��||_t��|_|dkr4t��|_n||_tj	dt
dd�dS)Nrz$Semaphore initial value must be >= 0r3rr )rbr\rLrMr4rr6r7r"r#r$�r�valuer1rrrr�s
�zSemaphore.__init__csVt���}|��rdn
d|j��}|jr<|�dt|j���}d|dd��d|�d�S)	Nr:zunlocked, value:r;r<rr=r>r?)r@rAr:r\r4rBrCrErrrA�s

zSemaphore.__repr__cCs,|jr(|j��}|��s|�d�dSqdSr
)r4�popleftrYrZ)rZwaiterrrr�
_wake_up_next�s


zSemaphore._wake_up_nextcCs
|jdkS)Nrr^rrrrr:�szSemaphore.lockedc�st|jdkrb|j��}|j�|�z|IdHWq|��|jdkrX|��sX|���YqXq|jd8_dS)NrrT)r\r7rNr4rOZcancelrGrlrSrrrr%�s	


zSemaphore.acquirecCs|jd7_|��dS)Nr)r\rlrrrrr�szSemaphore.release)r)
rrrrrArlr:r%rr[rrrErr�s
rcs0eZdZddd��fdd�Z�fdd�Z�ZS)	rrNr0cs.|rtjdtdd�||_t�j||d�dS)Nr3rr r0)r"r#r$�_bound_valuer@rrirErrr
s�zBoundedSemaphore.__init__cs"|j|jkrtd��t���dS)Nz(BoundedSemaphore released too many times)r\rmrbr@rrrErrrszBoundedSemaphore.release)r)rrrrrr[rrrErrs	r)�__all__rLr.r"�rr	r
rrrrrrrrrrrr�<module>s"9DzNasyncio/__pycache__/coroutines.cpython-38.opt-2.pyc000064400000014303151153537520016213 0ustar00U

e5d]"�@s�dZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddl
mZddl
m
Z
ddlmZdd	�Ze�ZGd
d�d�Zdd
�Ze�Zdd�ZejejejjefZe�Zdd�Zdd�ZdS))�	coroutine�iscoroutinefunction�iscoroutine�N�)�base_futures)�	constants)�format_helpers)�loggercCs"tjjp tjjo ttj�d��S)NZPYTHONASYNCIODEBUG)�sys�flags�dev_mode�ignore_environment�bool�os�environ�get�rr�*/usr/lib64/python3.8/asyncio/coroutines.py�_is_debug_modes�rc@s�eZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zddd
�Zdd�Z	e
dd��Ze
dd��Ze
dd��Z
dd�Ze
dd��Zdd�ZdS)�CoroWrapperNcCs>||_||_t�t�d��|_t|dd�|_t|dd�|_	dS)Nr�__name__�__qualname__)
�gen�funcr�
extract_stackr
�	_getframe�_source_traceback�getattrrr)�selfrrrrr�__init__'s
zCoroWrapper.__init__cCsJt|�}|jr4|jd}|d|d�d|d��7}d|jj�d|�d�S)	N���z
, created at r�:r�<� �>)�_format_coroutiner�	__class__r)r�	coro_repr�framerrr�__repr__/s

zCoroWrapper.__repr__cCs|S�Nr�rrrr�__iter__7szCoroWrapper.__iter__cCs|j�d�Sr*�r�sendr+rrr�__next__:szCoroWrapper.__next__cCs|j�|�Sr*r-)r�valuerrrr.=szCoroWrapper.sendcCs|j�|||�Sr*)r�throw)r�typer0�	tracebackrrrr1@szCoroWrapper.throwcCs
|j��Sr*)r�closer+rrrr4CszCoroWrapper.closecCs|jjSr*)r�gi_framer+rrrr5FszCoroWrapper.gi_framecCs|jjSr*)r�
gi_runningr+rrrr6JszCoroWrapper.gi_runningcCs|jjSr*)r�gi_coder+rrrr7NszCoroWrapper.gi_codecCs|Sr*rr+rrr�	__await__RszCoroWrapper.__await__cCs|jjSr*)r�gi_yieldfromr+rrrr9UszCoroWrapper.gi_yieldfromcCs�t|dd�}t|dd�}|dk	r||jdkr||�d�}t|dd�}|rrd�t�|��}|dtj�d	�7}||��7}t�	|�dS)
Nrr5r z was never yielded fromrr�zB
Coroutine object created at (most recent call last, truncated to z last lines):
)
r�f_lasti�joinr3�format_listrZDEBUG_STACK_DEPTH�rstripr	�error)rrr(�msg�tbrrr�__del__Ys
zCoroWrapper.__del__)N)NN)r�
__module__rrr)r,r/r.r1r4�propertyr5r6r7r8r9rBrrrrr$s"





rcsztjdtdd�t���r�St���r.��nt����fdd���t�	���t
sX�}nt�����fdd��}t|_|S)NzN"@coroutine" decorator is deprecated since Python 3.8, use "async def" instead�)�
stacklevelc?sr�||�}t�|�s(t�|�s(t|t�r4|EdH}n:z
|j}Wntk
rRYnXt|tj	j
�rn|�EdH}|Sr*)rZisfuture�inspectZisgenerator�
isinstancerr8�AttributeError�collections�abc�	Awaitable)�args�kw�resZ
await_meth�rrr�corozs
�
zcoroutine.<locals>.corocs@t�||��d�}|jr |jd=t�dd�|_t�dd�|_|S)NrPr rr)rrrrr)rM�kwds�w�rQrrr�wrapper�szcoroutine.<locals>.wrapper)�warnings�warn�DeprecationWarningrGr�isgeneratorfunction�	functools�wraps�typesr�_DEBUG�
_is_coroutine)rrUrrTrris"�


rcCst�|�pt|dd�tkS)Nr^)rGrrr^rPrrrr�s
�rcCs@t|�tkrdSt|t�r8tt�dkr4t�t|��dSdSdS)NT�dF)r2�_iscoroutine_typecacherH�_COROUTINE_TYPES�len�add)�objrrrr�s
rc
sht|t���fdd�}dd�}d}t|d�r:|jr:|j}nt|d�rP|jrP|j}||�}|sr||�rn|�d�S|Sd}t|d�r�|jr�|j}nt|d	�r�|jr�|j}|jp�d
}d}��r$|jdk	�r$t	�
|j��s$t�|j�}|dk	r�|\}}|dk�r|�d|�d
|��}	n|�d|�d
|��}	n@|dk	�rJ|j
}|�d|�d
|��}	n|j}|�d|�d
|��}	|	S)Ncs`�rt�|jdi�St|d�r,|jr,|j}n*t|d�rD|jrD|j}ndt|�j�d�}|�d�S)Nrrrr"z without __name__>z())rZ_format_callbackr�hasattrrrr2)rQ�	coro_name�Zis_corowrapperrr�get_name�sz#_format_coroutine.<locals>.get_namecSsHz|jWStk
rBz|jWYStk
r<YYdSXYnXdS)NF)�
cr_runningrIr6)rQrrr�
is_running�sz%_format_coroutine.<locals>.is_running�cr_coder7z runningr5�cr_framez<empty co_filename>rz done, defined at r!z running, defined at z running at )rHrrerkr7r5rl�co_filenamerrGrYrZ_get_function_source�f_lineno�co_firstlineno)
rQrhrjZ	coro_coderfZ
coro_frame�filename�lineno�sourcer'rrgrr%�sJ
	

�
�

r%) �__all__Zcollections.abcrJrZrGrr
r3r\rVr:rrr�logr	rr]rr�objectr^r�
CoroutineType�
GeneratorTyperK�	Coroutinera�setr`rr%rrrr�<module>s2E8�asyncio/__pycache__/events.cpython-38.opt-2.pyc000064400000044723151153537520015336 0ustar00U

e5d4f�@sxdZddlZddlZddlZddlZddlZddlZddlmZddlm	Z	Gdd�d�Z
Gdd	�d	e
�ZGd
d�d�ZGdd
�d
�Z
Gdd�d�ZGdd�de�Zdae��ZGdd�dej�Ze�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Z eZ!eZ"eZ#eZ$zdd*l%mZmZmZmZWne&k
�rbYnXeZ'eZ(eZ)eZ*dS)+)�AbstractEventLoopPolicy�AbstractEventLoop�AbstractServer�Handle�TimerHandle�get_event_loop_policy�set_event_loop_policy�get_event_loop�set_event_loop�new_event_loop�get_child_watcher�set_child_watcher�_set_running_loop�get_running_loop�_get_running_loop�N�)�format_helpers)�
exceptionsc@sBeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)r)�	_callback�_args�
_cancelled�_loop�_source_traceback�_repr�__weakref__�_contextNcCs\|dkrt��}||_||_||_||_d|_d|_|j��rRt	�
t�d��|_
nd|_
dS)NFr)�contextvarsZcopy_contextrrrrrr�	get_debugr�
extract_stack�sys�	_getframer)�self�callback�args�loop�context�r&�&/usr/lib64/python3.8/asyncio/events.py�__init__ s
�zHandle.__init__cCsl|jjg}|jr|�d�|jdk	r:|�t�|j|j��|jrh|jd}|�d|d�d|d���|S)N�	cancelled���zcreated at r�:r)	�	__class__�__name__r�appendrr�_format_callback_sourcerr)r!�info�framer&r&r'�
_repr_info/s


�
zHandle._repr_infocCs(|jdk	r|jS|��}d�d�|��S)Nz<{}>� )rr2�format�join)r!r0r&r&r'�__repr__;s
zHandle.__repr__cCs0|js,d|_|j��r t|�|_d|_d|_dS�NT)rrr�reprrrr�r!r&r&r'�cancelAs

z
Handle.cancelcCs|jS�N)rr9r&r&r'r)LszHandle.cancelledc
Cs�z|jj|jf|j��Wn|ttfk
r4�Yndtk
r�}zFt�|j|j�}d|��}|||d�}|j	rz|j	|d<|j
�|�W5d}~XYnXd}dS)NzException in callback )�messageZ	exception�handleZsource_traceback)r�runrr�
SystemExit�KeyboardInterrupt�
BaseExceptionrr/rr�call_exception_handler)r!�exc�cb�msgr%r&r&r'�_runOs$�
�
zHandle._run)N)
r-�
__module__�__qualname__�	__slots__r(r2r6r:r)rFr&r&r&r'rs
rcs~eZdZddgZd�fdd�	Z�fdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Z�fdd�Z
dd�Z�ZS)r�
_scheduled�_whenNcs0t��||||�|jr |jd=||_d|_dS)Nr*F)�superr(rrKrJ)r!�whenr"r#r$r%�r,r&r'r(hs
zTimerHandle.__init__cs0t���}|jrdnd}|�|d|j���|S)N�rzwhen=)rLr2r�insertrK)r!r0�posrNr&r'r2ps
zTimerHandle._repr_infocCs
t|j�Sr;)�hashrKr9r&r&r'�__hash__vszTimerHandle.__hash__cCs|j|jkSr;�rK�r!�otherr&r&r'�__lt__yszTimerHandle.__lt__cCs|j|jkrdS|�|�Sr7�rK�__eq__rUr&r&r'�__le__|szTimerHandle.__le__cCs|j|jkSr;rTrUr&r&r'�__gt__�szTimerHandle.__gt__cCs|j|jkrdS|�|�Sr7rXrUr&r&r'�__ge__�szTimerHandle.__ge__cCs>t|t�r:|j|jko8|j|jko8|j|jko8|j|jkStSr;)�
isinstancerrKrrr�NotImplementedrUr&r&r'rY�s

�
�
�zTimerHandle.__eq__cCs|�|�}|tkrtS|Sr;)rYr^)r!rVZequalr&r&r'�__ne__�s
zTimerHandle.__ne__cs |js|j�|�t���dSr;)rr�_timer_handle_cancelledrLr:r9rNr&r'r:�szTimerHandle.cancelcCs|jSr;rTr9r&r&r'rM�szTimerHandle.when)N)r-rGrHrIr(r2rSrWrZr[r\rYr_r:rM�
__classcell__r&r&rNr'rcsrc@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)rcCst�dSr;��NotImplementedErrorr9r&r&r'�close�szAbstractServer.closecCst�dSr;rbr9r&r&r'�get_loop�szAbstractServer.get_loopcCst�dSr;rbr9r&r&r'�
is_serving�szAbstractServer.is_servingc�st�dSr;rbr9r&r&r'�
start_serving�szAbstractServer.start_servingc�st�dSr;rbr9r&r&r'�
serve_forever�szAbstractServer.serve_foreverc�st�dSr;rbr9r&r&r'�wait_closed�szAbstractServer.wait_closedc�s|Sr;r&r9r&r&r'�
__aenter__�szAbstractServer.__aenter__c�s|��|��IdHdSr;)rdri)r!rCr&r&r'�	__aexit__�szAbstractServer.__aexit__N)r-rGrHrdrerfrgrhrirjrkr&r&r&r'r�src@sReZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�dd�Zdd �Zd!d"�Zd#d$�Zd%d%d%d%d&�d'd(�Zdtd)d*�Zdudd%d%d%ddddddd+�
d,d-�Zdvejejdd.ddddd/d0�	d1d2�Zdwd/d3�d4d5�Zd6ddd7�d8d9�Zdxddddd:�d;d<�Zdydd.ddd/d=�d>d?�Zdzd%d%d%ddddd@�dAdB�ZdCdD�Z dEdF�Z!e"j#e"j#e"j#dG�dHdI�Z$e"j#e"j#e"j#dG�dJdK�Z%dLdM�Z&dNdO�Z'dPdQ�Z(dRdS�Z)dTdU�Z*dVdW�Z+dXdY�Z,dZd[�Z-d\d]�Z.d{dd3�d^d_�Z/d`da�Z0dbdc�Z1ddde�Z2dfdg�Z3dhdi�Z4djdk�Z5dldm�Z6dndo�Z7dpdq�Z8drds�Z9dS)|rcCst�dSr;rbr9r&r&r'�run_forever�szAbstractEventLoop.run_forevercCst�dSr;rb)r!Zfuturer&r&r'�run_until_complete�sz$AbstractEventLoop.run_until_completecCst�dSr;rbr9r&r&r'�stop�szAbstractEventLoop.stopcCst�dSr;rbr9r&r&r'�
is_running�szAbstractEventLoop.is_runningcCst�dSr;rbr9r&r&r'�	is_closed�szAbstractEventLoop.is_closedcCst�dSr;rbr9r&r&r'rd�s	zAbstractEventLoop.closec�st�dSr;rbr9r&r&r'�shutdown_asyncgens�sz$AbstractEventLoop.shutdown_asyncgenscCst�dSr;rb)r!r=r&r&r'r`�sz)AbstractEventLoop._timer_handle_cancelledcGs|jd|f|��S)Nr)�
call_later�r!r"r#r&r&r'�	call_soonszAbstractEventLoop.call_sooncGst�dSr;rb)r!Zdelayr"r#r&r&r'rrszAbstractEventLoop.call_latercGst�dSr;rb)r!rMr"r#r&r&r'�call_atszAbstractEventLoop.call_atcCst�dSr;rbr9r&r&r'�timeszAbstractEventLoop.timecCst�dSr;rbr9r&r&r'�
create_futureszAbstractEventLoop.create_futureN)�namecCst�dSr;rb)r!�cororxr&r&r'�create_taskszAbstractEventLoop.create_taskcGst�dSr;rbrsr&r&r'�call_soon_threadsafesz&AbstractEventLoop.call_soon_threadsafecGst�dSr;rb)r!�executor�funcr#r&r&r'�run_in_executorsz!AbstractEventLoop.run_in_executorcCst�dSr;rb)r!r|r&r&r'�set_default_executorsz&AbstractEventLoop.set_default_executorr)�family�type�proto�flagsc�st�dSr;rb)r!�host�portr�r�r�r�r&r&r'�getaddrinfo#szAbstractEventLoop.getaddrinfoc�st�dSr;rb)r!Zsockaddrr�r&r&r'�getnameinfo'szAbstractEventLoop.getnameinfo)
�sslr�r�r��sock�
local_addr�server_hostname�ssl_handshake_timeout�happy_eyeballs_delay�
interleavec
�st�dSr;rb)r!�protocol_factoryr�r�r�r�r�r�r�r�r�r�r�r�r&r&r'�create_connection*sz#AbstractEventLoop.create_connection�dT)	r�r�r��backlogr��
reuse_address�
reuse_portr�rgc	
�st�dSr;rb)
r!r�r�r�r�r�r�r�r�r�r�r�rgr&r&r'�
create_server3s3zAbstractEventLoop.create_server)�fallbackc�st�dSr;rb)r!�	transport�file�offset�countr�r&r&r'�sendfilehszAbstractEventLoop.sendfileF)�server_sider�r�c�st�dSr;rb)r!r�ZprotocolZ
sslcontextr�r�r�r&r&r'�	start_tlsps	zAbstractEventLoop.start_tls)r�r�r�r�c�st�dSr;rb)r!r��pathr�r�r�r�r&r&r'�create_unix_connection{sz(AbstractEventLoop.create_unix_connection)r�r�r�r�rgc�st�dSr;rb)r!r�r�r�r�r�r�rgr&r&r'�create_unix_server�sz$AbstractEventLoop.create_unix_server)r�r�r�r�r��allow_broadcastr�c�st�dSr;rb)r!r�r�Zremote_addrr�r�r�r�r�r�r�r&r&r'�create_datagram_endpoint�s!z*AbstractEventLoop.create_datagram_endpointc�st�dSr;rb�r!r��piper&r&r'�connect_read_pipe�sz#AbstractEventLoop.connect_read_pipec�st�dSr;rbr�r&r&r'�connect_write_pipe�sz$AbstractEventLoop.connect_write_pipe)�stdin�stdout�stderrc�st�dSr;rb)r!r��cmdr�r�r��kwargsr&r&r'�subprocess_shell�sz"AbstractEventLoop.subprocess_shellc�st�dSr;rb)r!r�r�r�r�r#r�r&r&r'�subprocess_exec�sz!AbstractEventLoop.subprocess_execcGst�dSr;rb�r!�fdr"r#r&r&r'�
add_reader�szAbstractEventLoop.add_readercCst�dSr;rb�r!r�r&r&r'�
remove_reader�szAbstractEventLoop.remove_readercGst�dSr;rbr�r&r&r'�
add_writer�szAbstractEventLoop.add_writercCst�dSr;rbr�r&r&r'�
remove_writer�szAbstractEventLoop.remove_writerc�st�dSr;rb)r!r��nbytesr&r&r'�	sock_recvszAbstractEventLoop.sock_recvc�st�dSr;rb)r!r�Zbufr&r&r'�sock_recv_intosz AbstractEventLoop.sock_recv_intoc�st�dSr;rb)r!r��datar&r&r'�sock_sendallszAbstractEventLoop.sock_sendallc�st�dSr;rb)r!r�Zaddressr&r&r'�sock_connectszAbstractEventLoop.sock_connectc�st�dSr;rb)r!r�r&r&r'�sock_acceptszAbstractEventLoop.sock_acceptc�st�dSr;rb)r!r�r�r�r�r�r&r&r'�
sock_sendfileszAbstractEventLoop.sock_sendfilecGst�dSr;rb)r!�sigr"r#r&r&r'�add_signal_handlersz$AbstractEventLoop.add_signal_handlercCst�dSr;rb)r!r�r&r&r'�remove_signal_handlersz'AbstractEventLoop.remove_signal_handlercCst�dSr;rb)r!�factoryr&r&r'�set_task_factorysz"AbstractEventLoop.set_task_factorycCst�dSr;rbr9r&r&r'�get_task_factory"sz"AbstractEventLoop.get_task_factorycCst�dSr;rbr9r&r&r'�get_exception_handler'sz'AbstractEventLoop.get_exception_handlercCst�dSr;rb)r!Zhandlerr&r&r'�set_exception_handler*sz'AbstractEventLoop.set_exception_handlercCst�dSr;rb�r!r%r&r&r'�default_exception_handler-sz+AbstractEventLoop.default_exception_handlercCst�dSr;rbr�r&r&r'rB0sz(AbstractEventLoop.call_exception_handlercCst�dSr;rbr9r&r&r'r5szAbstractEventLoop.get_debugcCst�dSr;rb)r!Zenabledr&r&r'�	set_debug8szAbstractEventLoop.set_debug)r)NN)NN)rN)N)N)NN)rN):r-rGrHrlrmrnrorprdrqr`rtrrrurvrwrzr{r~rr�r�r��socketZ	AF_UNSPECZ
AI_PASSIVEr�r�r�r�r�r�r�r��
subprocess�PIPEr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rBrr�r&r&r&r'r�s��
��
��5�	�����!��%
���rc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)rcCst�dSr;rbr9r&r&r'r?sz&AbstractEventLoopPolicy.get_event_loopcCst�dSr;rb�r!r$r&r&r'r	Isz&AbstractEventLoopPolicy.set_event_loopcCst�dSr;rbr9r&r&r'r
Msz&AbstractEventLoopPolicy.new_event_loopcCst�dSr;rbr9r&r&r'rUsz)AbstractEventLoopPolicy.get_child_watchercCst�dSr;rb)r!�watcherr&r&r'rYsz)AbstractEventLoopPolicy.set_child_watcherN)r-rGrHrr	r
rrr&r&r&r'r<s

rc@sBeZdZdZGdd�dej�Zdd�Zdd�Zdd	�Z	d
d�Z
dS)�BaseDefaultEventLoopPolicyNc@seZdZdZdZdS)z!BaseDefaultEventLoopPolicy._LocalNF)r-rGrHr�_set_calledr&r&r&r'�_Localmsr�cCs|��|_dSr;)r��_localr9r&r&r'r(qsz#BaseDefaultEventLoopPolicy.__init__cCsX|jjdkr2|jjs2tt��tj�r2|�|���|jjdkrPt	dt��j
��|jjS)Nz,There is no current event loop in thread %r.)r�rr�r]�	threadingZcurrent_threadZ_MainThreadr	r
�RuntimeErrorrxr9r&r&r'rts���z)BaseDefaultEventLoopPolicy.get_event_loopcCsd|j_||j_dSr7)r�r�rr�r&r&r'r	�sz)BaseDefaultEventLoopPolicy.set_event_loopcCs|��Sr;)�
_loop_factoryr9r&r&r'r
�sz)BaseDefaultEventLoopPolicy.new_event_loop)r-rGrHr�r��localr�r(rr	r
r&r&r&r'r�^s
r�c@seZdZdZdS)�_RunningLoop)NNN)r-rGrH�loop_pidr&r&r&r'r��sr�cCst�}|dkrtd��|S)Nzno running event loop)rr��r$r&r&r'r�srcCs&tj\}}|dk	r"|t��kr"|SdSr;)�
_running_loopr��os�getpid)Zrunning_loop�pidr&r&r'r�s
rcCs|t��ft_dSr;)r�r�r�r�r�r&r&r'r
�sr
c	Cs.t� tdkr ddlm}|�aW5QRXdS)Nr��DefaultEventLoopPolicy)�_lock�_event_loop_policy�r�r�r&r&r'�_init_event_loop_policy�sr�cCstdkrt�tSr;)r�r�r&r&r&r'r�srcCs|adSr;)r�)Zpolicyr&r&r'r�srcCst�}|dk	r|St���Sr;)rrr)Zcurrent_loopr&r&r'r�s
rcCst��|�dSr;)rr	r�r&r&r'r	�sr	cCs
t���Sr;)rr
r&r&r&r'r
�sr
cCs
t���Sr;)rrr&r&r&r'r�srcCst��|�Sr;)rr)r�r&r&r'r�sr)rr
rr)+�__all__rr�r�r�rr�r�rrrrrrrr�r�ZLockr�r�r�r�rrr
r�rrrr	r
rrZ_py__get_running_loopZ_py__set_running_loopZ_py_get_running_loopZ_py_get_event_loopZ_asyncio�ImportErrorZ_c__get_running_loopZ_c__set_running_loopZ_c_get_running_loopZ_c_get_event_loopr&r&r&r'�<module>sVJ@*q"9
	asyncio/__pycache__/trsock.cpython-38.opt-2.pyc000064400000020045151153537520015326 0ustar00U

e5d��@s"ddlZddlZGdd�d�ZdS)�Nc@s�eZdZdZejd�dd�Zdd�Zedd��Zed	d
��Z	edd��Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Z d9d:�Z!d;d<�Z"d=d>�Z#d?d@�Z$dAdB�Z%dCdD�Z&dEdF�Z'dGdH�Z(dIdJ�Z)dKdL�Z*dMdN�Z+dOdP�Z,dQdR�Z-dSdT�Z.dUdV�Z/dWdX�Z0dYdZ�Z1d[S)\�TransportSocket��_sock)�sockcCs
||_dS�Nr)�selfr�r�&/usr/lib64/python3.8/asyncio/trsock.py�__init__szTransportSocket.__init__cCstjd|�d�t|d�dS)NzUsing z� on sockets returned from get_extra_info('socket') will be prohibited in asyncio 3.9. Please report your use case to bugs.python.org.)�source)�warnings�warn�DeprecationWarning)rZwhatrrr	�_nas

�zTransportSocket._nacCs|jjSr)r�family�rrrr	rszTransportSocket.familycCs|jjSr)r�typerrrr	rszTransportSocket.typecCs|jjSr)r�protorrrr	r"szTransportSocket.protocCs�d|���d|j�d|j�d|j��}|��dkr�z|��}|rN|�d|��}Wntjk
rfYnXz|��}|r�|�d|��}Wntjk
r�YnX|�d�S)	Nz<asyncio.TransportSocket fd=z	, family=z, type=z, proto=���z, laddr=z, raddr=�>)�filenorrr�getsockname�socket�error�getpeername)r�sZladdrZraddrrrr	�__repr__&s $�zTransportSocket.__repr__cCstd��dS)Nz/Cannot serialize asyncio.TransportSocket object)�	TypeErrorrrrr	�__getstate__=szTransportSocket.__getstate__cCs
|j��Sr)rrrrrr	r@szTransportSocket.filenocCs
|j��Sr)r�duprrrr	rCszTransportSocket.dupcCs
|j��Sr)r�get_inheritablerrrr	r FszTransportSocket.get_inheritablecCs|j�|�dSr)r�shutdown)rZhowrrr	r!IszTransportSocket.shutdowncOs|jj||�Sr)r�
getsockopt�r�args�kwargsrrr	r"NszTransportSocket.getsockoptcOs|jj||�dSr)r�
setsockoptr#rrr	r&QszTransportSocket.setsockoptcCs
|j��Sr)rrrrrr	rTszTransportSocket.getpeernamecCs
|j��Sr)rrrrrr	rWszTransportSocket.getsocknamecCs
|j��Sr)r�
getsockbynamerrrr	r'ZszTransportSocket.getsockbynamecCs|�d�|j��S)Nzaccept() method)rr�acceptrrrr	r(]s
zTransportSocket.acceptcOs|�d�|jj||�S)Nzconnect() method)rr�connectr#rrr	r)as
zTransportSocket.connectcOs|�d�|jj||�S)Nzconnect_ex() method)rr�
connect_exr#rrr	r*es
zTransportSocket.connect_excOs|�d�|jj||�S)Nz
bind() method)rr�bindr#rrr	r+is
zTransportSocket.bindcOs|�d�|jj||�S)Nzioctl() method)rr�ioctlr#rrr	r,ms
zTransportSocket.ioctlcOs|�d�|jj||�S)Nzlisten() method)rr�listenr#rrr	r-qs
zTransportSocket.listencCs|�d�|j��S)Nzmakefile() method)rr�makefilerrrr	r.us
zTransportSocket.makefilecOs|�d�|jj||�S)Nzsendfile() method)rr�sendfiler#rrr	r/ys
zTransportSocket.sendfilecCs|�d�|j��S)Nzclose() method)rr�closerrrr	r0}s
zTransportSocket.closecCs|�d�|j��S)Nzdetach() method)rr�detachrrrr	r1�s
zTransportSocket.detachcOs|�d�|jj||�S)Nzsendmsg_afalg() method)rr�
sendmsg_afalgr#rrr	r2�s
zTransportSocket.sendmsg_afalgcOs|�d�|jj||�S)Nzsendmsg() method)rr�sendmsgr#rrr	r3�s
zTransportSocket.sendmsgcOs|�d�|jj||�S)Nzsendto() method)rr�sendtor#rrr	r4�s
zTransportSocket.sendtocOs|�d�|jj||�S)Nz
send() method)rr�sendr#rrr	r5�s
zTransportSocket.sendcOs|�d�|jj||�S)Nzsendall() method)rr�sendallr#rrr	r6�s
zTransportSocket.sendallcOs|�d�|jj||�S)Nzset_inheritable() method)rr�set_inheritabler#rrr	r7�s
zTransportSocket.set_inheritablecCs|�d�|j�|�S)Nzshare() method)rr�share)rZ
process_idrrr	r8�s
zTransportSocket.sharecOs|�d�|jj||�S)Nzrecv_into() method)rr�	recv_intor#rrr	r9�s
zTransportSocket.recv_intocOs|�d�|jj||�S)Nzrecvfrom_into() method)rr�
recvfrom_intor#rrr	r:�s
zTransportSocket.recvfrom_intocOs|�d�|jj||�S)Nzrecvmsg_into() method)rr�recvmsg_intor#rrr	r;�s
zTransportSocket.recvmsg_intocOs|�d�|jj||�S)Nzrecvmsg() method)rr�recvmsgr#rrr	r<�s
zTransportSocket.recvmsgcOs|�d�|jj||�S)Nzrecvfrom() method)rr�recvfromr#rrr	r=�s
zTransportSocket.recvfromcOs|�d�|jj||�S)Nz
recv() method)rr�recvr#rrr	r>�s
zTransportSocket.recvcCs|dkrdStd��dS)Nrz<settimeout(): only 0 timeout is allowed on transport sockets��
ValueError)r�valuerrr	�
settimeout�s
�zTransportSocket.settimeoutcCsdS)Nrrrrrr	�
gettimeout�szTransportSocket.gettimeoutcCs|sdStd��dS)Nz3setblocking(): transport sockets cannot be blockingr?)r�flagrrr	�setblocking�s
�zTransportSocket.setblockingcCs|�d�|j��S�Nzcontext manager protocol)rr�	__enter__rrrr	rG�s
zTransportSocket.__enter__cGs|�d�|jj|�SrF)rr�__exit__)r�errrrr	rH�s
zTransportSocket.__exit__N)2�__name__�
__module__�__qualname__�	__slots__rr
r�propertyrrrrrrrr r!r"r&rrr'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>rBrCrErGrHrrrr	rs`	


r)rrrrrrr	�<module>sasyncio/__pycache__/exceptions.cpython-38.pyc000064400000004767151153537520015257 0ustar00U

e5da�@sldZdZGdd�de�ZGdd�de�ZGdd�de�ZGdd	�d	e�ZGd
d�de	�Z
Gdd
�d
e�ZdS)zasyncio exceptions.)�CancelledError�InvalidStateError�TimeoutError�IncompleteReadError�LimitOverrunError�SendfileNotAvailableErrorc@seZdZdZdS)rz!The Future or Task was cancelled.N��__name__�
__module__�__qualname__�__doc__�rr�*/usr/lib64/python3.8/asyncio/exceptions.pyr	src@seZdZdZdS)rz*The operation exceeded the given deadline.Nrrrrr
r
src@seZdZdZdS)rz+The operation is not allowed in this state.Nrrrrr
rsrc@seZdZdZdS)rz~Sendfile syscall is not available.

    Raised if OS does not support sendfile syscall for given socket or
    file type.
    Nrrrrr
rsrcs(eZdZdZ�fdd�Zdd�Z�ZS)rz�
    Incomplete read error. Attributes:

    - partial: read bytes string before the end of stream was reached
    - expected: total number of expected bytes (or None if unknown)
    cs@|dkrdnt|�}t��t|��d|�d��||_||_dS)NZ	undefinedz bytes read on a total of z expected bytes)�repr�super�__init__�len�partial�expected)�selfrrZ
r_expected��	__class__rr
r$szIncompleteReadError.__init__cCst|�|j|jffS�N)�typerr�rrrr
�
__reduce__+szIncompleteReadError.__reduce__�rr	r
rrr�
__classcell__rrrr
rsrcs(eZdZdZ�fdd�Zdd�Z�ZS)rz�Reached the buffer limit while looking for a separator.

    Attributes:
    - consumed: total number of to be consumed bytes.
    cst��|�||_dSr)rr�consumed)r�messagerrrr
r5szLimitOverrunError.__init__cCst|�|jd|jffS)N�)r�argsrrrrr
r9szLimitOverrunError.__reduce__rrrrr
r/srN)r�__all__�
BaseExceptionr�	Exceptionrr�RuntimeErrorr�EOFErrorrrrrrr
�<module>sasyncio/__pycache__/base_events.cpython-38.opt-2.pyc000064400000121527151153537520016326 0ustar00U

e5d��@s�ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZzddlZWnek
r�dZYnXddlmZddlmZddlmZddlmZddlmZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZddlm Z dZ!dZ"dZ#e$ed�Z%dZ&e'�Z(dd�Z)dd�Z*dd�Z+d*dd�Z,d+dd�Z-dd�Z.e$ed ��r�d!d"�Z/nd#d"�Z/Gd$d%�d%ej0�Z1Gd&d'�d'ej2�Z3Gd(d)�d)ej4�Z5dS),�N�)�	constants)�
coroutines)�events)�
exceptions)�futures)�	protocols)�sslproto)�	staggered)�tasks)�
transports)�trsock)�logger)�
BaseEventLoop�dg�?�AF_INET6i�QcCs0|j}tt|dd�tj�r$t|j�St|�SdS)N�__self__)Z	_callback�
isinstance�getattrr�Task�reprr�str)�handle�cb�r�+/usr/lib64/python3.8/asyncio/base_events.py�_format_handleJs
rcCs(|tjkrdS|tjkrdSt|�SdS)Nz<pipe>z<stdout>)�
subprocess�PIPE�STDOUTr)�fdrrr�_format_pipeSs


r!cCsLttd�std��n4z|�tjtjd�Wntk
rFtd��YnXdS)N�SO_REUSEPORTz)reuse_port not supported by socket modulerzTreuse_port not supported by socket module, SO_REUSEPORT defined but not implemented.)�hasattr�socket�
ValueError�
setsockopt�
SOL_SOCKETr"�OSError��sockrrr�_set_reuseport\s

r+c		Cs�ttd�sdS|dtjtjhks(|dkr,dS|tjkr>tj}n|tjkrPtj}ndS|dkrbd}nXt|t�rz|dkrzd}n@t|t�r�|dkr�d}n(zt	|�}Wnt
tfk
r�YdSX|tjkr�tj
g}tr�|�tj�n|g}t|t�r�|�d�}d|k�rdS|D]t}zVt�||�t�rJ|tjk�rJ|||d||||ffWS|||d||ffWSWntk
�rzYnX�q
dS)N�	inet_ptonr��Zidna�%)r#r$�IPPROTO_TCPZIPPROTO_UDP�SOCK_STREAM�
SOCK_DGRAMr�bytesr�int�	TypeErrorr%�	AF_UNSPEC�AF_INET�	_HAS_IPv6�appendr�decoder,r()	�host�port�family�type�protoZflowinfoZscopeidZafs�afrrr�_ipaddr_infogsN
�






rAcCs�t��}|D]*}|d}||kr(g||<||�|�qt|���}g}|dkr||�|dd|d��|dd|d�=|�dd�tj�tj	|��D��|S)Nrrcss|]}|dk	r|VqdS�Nr)�.0�arrr�	<genexpr>�s�z(_interleave_addrinfos.<locals>.<genexpr>)
�collections�OrderedDictr9�list�values�extend�	itertools�chain�
from_iterable�zip_longest)Z	addrinfosZfirst_address_family_countZaddrinfos_by_family�addrr=Zaddrinfos_listsZ	reorderedrrr�_interleave_addrinfos�s"
��rPcCs4|��s"|��}t|ttf�r"dSt�|���dSrB)�	cancelled�	exceptionr�
SystemExit�KeyboardInterruptrZ	_get_loop�stop)�fut�excrrr�_run_until_complete_cb�s
rX�TCP_NODELAYcCs@|jtjtjhkr<|jtjkr<|jtjkr<|�tjtj	d�dS�Nr)
r=r$r7rr>r1r?r0r&rYr)rrr�_set_nodelay�s
�
�r[cCsdSrBrr)rrrr[�sc@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�_SendfileFallbackProtocolcCsht|tj�std��||_|��|_|��|_|j	|_
|��|�|�|j
r^|jj
��|_nd|_dS)Nz.transport should be _FlowControlMixin instance)rrZ_FlowControlMixinr5�
_transportZget_protocol�_protoZ
is_reading�_should_resume_readingZ_protocol_paused�_should_resume_writing�
pause_reading�set_protocol�_loop�
create_future�_write_ready_fut)�self�transprrr�__init__�s


z"_SendfileFallbackProtocol.__init__c�s2|j��rtd��|j}|dkr$dS|IdHdS)NzConnection closed by peer)r]�
is_closing�ConnectionErrorre)rfrVrrr�drain�s
z_SendfileFallbackProtocol.draincCstd��dS)Nz?Invalid state: connection should have been established already.��RuntimeError)rf�	transportrrr�connection_made�sz)_SendfileFallbackProtocol.connection_madecCs@|jdk	r0|dkr$|j�td��n|j�|�|j�|�dS)NzConnection is closed by peer)reZ
set_exceptionrjr^�connection_lost)rfrWrrrrp�s
�z)_SendfileFallbackProtocol.connection_lostcCs |jdk	rdS|jj��|_dSrB)rer]rcrd�rfrrr�
pause_writing�s
z'_SendfileFallbackProtocol.pause_writingcCs$|jdkrdS|j�d�d|_dS)NF)re�
set_resultrqrrr�resume_writing�s
z(_SendfileFallbackProtocol.resume_writingcCstd��dS�Nz'Invalid state: reading should be pausedrl)rf�datarrr�
data_received�sz'_SendfileFallbackProtocol.data_receivedcCstd��dSrurlrqrrr�eof_receivedsz&_SendfileFallbackProtocol.eof_receivedc�sF|j�|j�|jr|j��|jdk	r2|j��|jrB|j��dSrB)	r]rbr^r_�resume_readingre�cancelr`rtrqrrr�restores


z!_SendfileFallbackProtocol.restoreN)�__name__�
__module__�__qualname__rhrkrorprrrtrwrxr{rrrrr\�sr\c@sxeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
edd��Zdd�Z
dd�Zdd�Zdd�ZdS)�ServercCs@||_||_d|_g|_||_||_||_||_d|_d|_	dS)NrF)
rc�_sockets�
_active_count�_waiters�_protocol_factory�_backlog�_ssl_context�_ssl_handshake_timeout�_serving�_serving_forever_fut)rf�loop�sockets�protocol_factoryZssl_context�backlog�ssl_handshake_timeoutrrrrhszServer.__init__cCsd|jj�d|j�d�S)N�<z	 sockets=�>)�	__class__r|r�rqrrr�__repr__ szServer.__repr__cCs|jd7_dSrZ)r�rqrrr�_attach#szServer._attachcCs.|jd8_|jdkr*|jdkr*|��dS)Nrr)r�r��_wakeuprqrrr�_detach'szServer._detachcCs,|j}d|_|D]}|��s|�|�qdSrB)r��doners)rf�waiters�waiterrrrr�-s
zServer._wakeupc	CsJ|jr
dSd|_|jD].}|�|j�|j�|j||j||j|j�qdS�NT)	r�r�Zlistenr�rc�_start_servingr�r�r�)rfr*rrrr�4s
�zServer._start_servingcCs|jSrB)rcrqrrr�get_loop>szServer.get_loopcCs|jSrB)r�rqrrr�
is_servingAszServer.is_servingcCs"|jdkrdStdd�|jD��S)Nrcss|]}t�|�VqdSrB)r
ZTransportSocket)rC�srrrrEHsz!Server.sockets.<locals>.<genexpr>)r��tuplerqrrrr�Ds
zServer.socketscCsn|j}|dkrdSd|_|D]}|j�|�qd|_|jdk	rX|j��sX|j��d|_|jdkrj|��dS)NFr)	r�rcZ
_stop_servingr�r�r�rzr�r�)rfr�r*rrr�closeJs
�

zServer.closec�s"|��tjd|jd�IdHdS)Nr�r�)r�r�sleeprcrqrrr�
start_serving]szServer.start_servingc	�s�|jdk	rtd|�d���|jdkr4td|�d���|��|j��|_zLz|jIdHWn6tjk
r�z|��|�	�IdHW5�XYnXW5d|_XdS)Nzserver z, is already being awaited on serve_forever()z
 is closed)
r�rmr�r�rcrdrZCancelledErrorr��wait_closedrqrrr�
serve_forevercs 

�
zServer.serve_foreverc�s<|jdks|jdkrdS|j��}|j�|�|IdHdSrB)r�r�rcrdr9)rfr�rrrr�xs

zServer.wait_closedN)r|r}r~rhr�r�r�r�r�r�r��propertyr�r�r�r�r�rrrrrs


rc@sPeZdZdd�Zdd�Zdd�Zdd�d	d
�Zdd�Zd
d�Zd�ddd�dd�Z	d�ddddddd�dd�Z
d�dd�Zd�dd�Zd�dd�Z
d�dd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zejfd7d8�Zd9d:�Zd;d<�Zdd=�d>d?�Z dd=�d@dA�Z!dd=�dBdC�Z"dDdE�Z#dFdG�Z$dHdI�Z%dd=�dJdK�Z&dLdM�Z'dNdO�Z(dPdQ�Z)dRdRdRdRdS�dTdU�Z*d�dVdW�Z+d�ddX�dYdZ�Z,d[d\�Z-d]d^�Z.d_d`�Z/d�dadb�Z0d�ddRdRdRdddddddc�
ddde�Z1d�dfdg�Z2d�ddX�dhdi�Z3djdk�Z4dldm�Z5ddddn�dodp�Z6d�dRdRdRe7ddddq�drds�Z8dRe9j:dRdRdS�dtdu�Z;dvdw�Z<d�e9j=e9j>ddxddddddy�	dzd{�Z?ddd|�d}d~�Z@dd��ZAd�d��ZBd�d��ZCeDjEeDjEeDjEdddRdddd��	d�d��ZFeDjEeDjEeDjEdddRdddd��	d�d��ZGd�d��ZHd�d��ZId�d��ZJd�d��ZKd�d��ZLd�d��ZMd�d��ZNd�d��ZOd�d��ZPd�d��ZQd�d��ZRdS)�rcCs�d|_d|_d|_t��|_g|_d|_d|_d|_	t
�d�j|_
d|_|�t���d|_d|_d|_d|_d|_t��|_d|_dS)NrF�	monotonicg�������?)�_timer_cancelled_count�_closed�	_stoppingrF�deque�_ready�
_scheduled�_default_executorZ
_internal_fds�
_thread_id�time�get_clock_infoZ
resolution�_clock_resolution�_exception_handler�	set_debugrZ_is_debug_mode�slow_callback_duration�_current_handle�
_task_factory�"_coroutine_origin_tracking_enabled�&_coroutine_origin_tracking_saved_depth�weakrefZWeakSet�
_asyncgens�_asyncgens_shutdown_calledrqrrrrh�s$

zBaseEventLoop.__init__c	Cs.d|jj�d|���d|���d|���d�	S)Nr�z	 running=z closed=z debug=r�)r�r|�
is_running�	is_closed�	get_debugrqrrrr��s,�zBaseEventLoop.__repr__cCstj|d�S)Nr�)rZFuturerqrrrrd�szBaseEventLoop.create_futureN)�namecCsN|��|jdkr2tj|||d�}|jrJ|jd=n|�||�}t�||�|S)N)r�r����)�
_check_closedr�rr�_source_tracebackZ_set_task_name)rf�coror�Ztaskrrr�create_task�s

zBaseEventLoop.create_taskcCs"|dk	rt|�std��||_dS)Nz'task factory must be a callable or None)�callabler5r�)rf�factoryrrr�set_task_factory�s
zBaseEventLoop.set_task_factorycCs|jSrB)r�rqrrr�get_task_factory�szBaseEventLoop.get_task_factory)�extra�servercCst�dSrB��NotImplementedError)rfr*�protocolr�r�r�rrr�_make_socket_transport�sz$BaseEventLoop._make_socket_transportFT)�server_side�server_hostnamer�r�r��call_connection_madecCst�dSrBr�)rfZrawsockr��
sslcontextr�r�r�r�r�r�r�rrr�_make_ssl_transport�sz!BaseEventLoop._make_ssl_transportcCst�dSrBr�)rfr*r��addressr�r�rrr�_make_datagram_transport�sz&BaseEventLoop._make_datagram_transportcCst�dSrBr��rf�piper�r�r�rrr�_make_read_pipe_transport�sz'BaseEventLoop._make_read_pipe_transportcCst�dSrBr�r�rrr�_make_write_pipe_transport�sz(BaseEventLoop._make_write_pipe_transportc	
�st�dSrBr�)
rfr��args�shell�stdin�stdout�stderr�bufsizer��kwargsrrr�_make_subprocess_transport�sz(BaseEventLoop._make_subprocess_transportcCst�dSrBr�rqrrr�_write_to_self�szBaseEventLoop._write_to_selfcCst�dSrBr�)rf�
event_listrrr�_process_events�szBaseEventLoop._process_eventscCs|jrtd��dS)NzEvent loop is closed)r�rmrqrrrr��szBaseEventLoop._check_closedcCs*|j�|�|��s&|�|j|���dSrB)r��discardr��call_soon_threadsafer��aclose�rf�agenrrr�_asyncgen_finalizer_hook�sz&BaseEventLoop._asyncgen_finalizer_hookcCs.|jrtjd|�d�t|d�|j�|�dS)Nzasynchronous generator z3 was scheduled after loop.shutdown_asyncgens() call��source)r��warnings�warn�ResourceWarningr��addr�rrr�_asyncgen_firstiter_hooks
�z&BaseEventLoop._asyncgen_firstiter_hookc�s�d|_t|j�sdSt|j�}|j��tjdd�|D�d|d��IdH}t||�D]*\}}t|t	�rT|�
d|��||d��qTdS)NTcSsg|]}|���qSr)r�)rCZagrrr�
<listcomp>sz4BaseEventLoop.shutdown_asyncgens.<locals>.<listcomp>)Zreturn_exceptionsr�z;an error occurred during closing of asynchronous generator )�messagerRZasyncgen)r��lenr�rH�clearr�gather�zipr�	Exception�call_exception_handler)rfZ
closing_agensZresults�resultr�rrr�shutdown_asyncgenss"


�
�z BaseEventLoop.shutdown_asyncgenscCs(|��rtd��t��dk	r$td��dS)Nz"This event loop is already runningz7Cannot run the event loop while another loop is running)r�rmrZ_get_running_looprqrrr�_check_running&s�zBaseEventLoop._check_runningc	Cs�|��|��|�|j�t��|_t��}tj	|j
|jd�z t
�|�|��|jrLq^qLW5d|_d|_t
�d�|�d�tj	|�XdS)N)�	firstiter�	finalizerF)r�r��_set_coroutine_origin_tracking�_debug�	threading�	get_identr��sys�get_asyncgen_hooks�set_asyncgen_hooksr�r�r�rZ_set_running_loop�	_run_once)rfZold_agen_hooksrrr�run_forever-s$
�


zBaseEventLoop.run_foreverc	Cs�|��|��t�|�}tj||d�}|r4d|_|�t�z<z|�
�Wn*|rp|��rp|��sp|�
��YnXW5|�	t�X|��s�td��|��S)Nr�Fz+Event loop stopped before Future completed.)r�r�rZisfuturerZ
ensure_futureZ_log_destroy_pendingZadd_done_callbackrXZremove_done_callbackrr�rQrRrmr�)rfZfutureZnew_taskrrr�run_until_completeDs"
z BaseEventLoop.run_until_completecCs
d|_dSr�)r�rqrrrrUjszBaseEventLoop.stopcCsj|��rtd��|jrdS|jr,t�d|�d|_|j��|j��|j	}|dk	rfd|_	|j
dd�dS)Nz!Cannot close a running event loopzClose %rTF)�wait)r�rmr�r�r�debugr�r�r�r�Zshutdown�rf�executorrrrr�rs

zBaseEventLoop.closecCs|jSrB)r�rqrrrr��szBaseEventLoop.is_closedcCs0|��s,|d|��t|d�|��s,|��dS)Nzunclosed event loop r�)r�r�r�r�)rfZ_warnrrr�__del__�szBaseEventLoop.__del__cCs
|jdk	SrB)r�rqrrrr��szBaseEventLoop.is_runningcCst��SrB)r�r�rqrrrr��szBaseEventLoop.time)�contextcGs2|j|��||f|�d|i�}|jr.|jd=|S)Nr
r�)�call_atr�r�)rfZdelay�callbackr
r��timerrrr�
call_later�s�zBaseEventLoop.call_latercGsZ|��|jr"|��|�|d�t�|||||�}|jrB|jd=t�|j	|�d|_	|S)Nrr�T)
r�r��
_check_thread�_check_callbackrZTimerHandler��heapq�heappushr�)rf�whenrr
r�rrrrr�szBaseEventLoop.call_atcGsB|��|jr"|��|�|d�|�|||�}|jr>|jd=|S)N�	call_soonr�)r�r�rr�
_call_soonr��rfrr
r�rrrrr�s
zBaseEventLoop.call_sooncCsDt�|�st�|�r$td|�d���t|�s@td|�d|����dS)Nzcoroutines cannot be used with z()z"a callable object was expected by z(), got )rZiscoroutineZiscoroutinefunctionr5r�)rfr�methodrrrr�s
�
��zBaseEventLoop._check_callbackcCs.t�||||�}|jr|jd=|j�|�|S)Nr�)rZHandler�r�r9)rfrr�r
rrrrr�s
zBaseEventLoop._call_sooncCs,|jdkrdSt��}||jkr(td��dS)NzMNon-thread-safe operation invoked on an event loop other than the current one)r�rrrm)rfZ	thread_idrrrr�s	

�zBaseEventLoop._check_threadcGsB|��|jr|�|d�|�|||�}|jr6|jd=|��|S)Nr�r�)r�r�rrr�r�rrrrr��sz"BaseEventLoop.call_soon_threadsafecGsZ|��|jr|�|d�|dkr@|j}|dkr@tj��}||_tj|j|f|��|d�S)N�run_in_executorr�)	r�r�rr��
concurrentr�ThreadPoolExecutorZwrap_futureZsubmit)rfr�funcr�rrrrs
�zBaseEventLoop.run_in_executorcCs&t|tjj�st�dtd�||_dS)Nz{Using the default executor that is not an instance of ThreadPoolExecutor is deprecated and will be prohibited in Python 3.9�)rrrrr�r��DeprecationWarningr�r
rrr�set_default_executors�z"BaseEventLoop.set_default_executorcCs�|�d|��g}|r$|�d|���|r8|�d|���|rL|�d|���|r`|�d|���d�|�}t�d|�|��}t�||||||�}	|��|}
d|�d	|
d
d�d|	��}|
|jkr�t�|�n
t�|�|	S)
N�:zfamily=ztype=zproto=zflags=�, zGet address info %szGetting address info z took g@�@z.3fzms: )	r9�joinrr	r�r$�getaddrinfor��info)rfr;r<r=r>r?�flags�msg�t0�addrinfo�dtrrr�_getaddrinfo_debugs&


z BaseEventLoop._getaddrinfo_debugr�r=r>r?r'c
�s2|jr|j}ntj}|�d|||||||�IdHSrB)r�r,r$r%r)rfr;r<r=r>r?r'Zgetaddr_funcrrrr%2s�zBaseEventLoop.getaddrinfoc�s|�dtj||�IdHSrB)rr$�getnameinfo)rfZsockaddrr'rrrr.<s�zBaseEventLoop.getnameinfo)�fallbackc
�s�|jr|��dkrtd��|�||||�z|�||||�IdHWStjk
rl}z
|s\�W5d}~XYnX|�||||�IdHS)Nrzthe socket must be non-blocking)r�Z
gettimeoutr%�_check_sendfile_params�_sock_sendfile_nativer�SendfileNotAvailableError�_sock_sendfile_fallback)rfr*�file�offset�countr/rWrrr�
sock_sendfile@s��zBaseEventLoop.sock_sendfilec�st�d|�d���dS)Nz-syscall sendfile is not available for socket z and file {file!r} combination�rr2�rfr*r4r5r6rrrr1Ns
�z#BaseEventLoop._sock_sendfile_nativec

�s�|r|�|�|rt|tj�ntj}t|�}d}zt|rNt|||�}|dkrNq�t|�d|�}|�d|j|�IdH}	|	szq�|�	||d|	��IdH||	7}q2|W�S|dkr�t|d�r�|�||�XdS)Nr�seek)
r:�minrZ!SENDFILE_FALLBACK_READBUFFER_SIZE�	bytearrayr#�
memoryviewr�readintoZsock_sendall)
rfr*r4r5r6�	blocksize�buf�
total_sent�view�readrrrr3Us,
��
z%BaseEventLoop._sock_sendfile_fallbackcCs�dt|dd�krtd��|jtjks,td��|dk	rbt|t�sLtd�|���|dkrbtd�|���t|t�sztd�|���|dkr�td�|���dS)N�b�modez$file should be opened in binary modez+only SOCK_STREAM type sockets are supportedz+count must be a positive integer (got {!r})rz0offset must be a non-negative integer (got {!r}))	rr%r>r$r1rr4r5�formatr9rrrr0os2
��
����z$BaseEventLoop._check_sendfile_paramsc�s@g}|�|�|\}}}}}	d}
z�tj|||d�}
|
�d�|dk	r�|D]r\}}}}}z|
�|�Wq�WqHtk
r�}z0d|�d|j����}
t|j|
�}|�|�W5d}~XYqHXqH|���|�	|
|	�IdH|
WStk
�r}z"|�|�|
dk	�r
|
�
��W5d}~XYn |
dk	�r4|
�
��YnXdS)N�r=r>r?Fz*error while attempting to bind on address �: )r9r$�setblocking�bindr(�strerror�lower�errno�pop�sock_connectr�)rfrZ	addr_infoZlocal_addr_infosZ
my_exceptionsr=Ztype_r?�_r�r*ZladdrrWr(rrr�
_connect_sock�s:



�


zBaseEventLoop._connect_sock)
�sslr=r?r'r*�
local_addrr�r��happy_eyeballs_delay�
interleavec
	�sl|
dk	r|std��|
dkr0|r0|s,td��|}
|dk	rD|sDtd��|dk	rX|
dkrXd}
|dk	sj|dk	�r�|dk	rztd���j||f|tj||�d�IdH}|s�td��|	dk	r܈j|	|tj||�d�IdH��s�td��nd�|
r�t||
�}g�|dk�rH|D]D}z ���|��IdH}W�qvWntk
�r@Y�qYnX�qn.tj���fdd	�|D�|�d
�IdH\}}}|dk�r dd��D��t	��dk�r��d
�nJt
�d
��t�fdd	��D���r҈d
�td�d�
dd	��D�����n.|dk�rtd��|jtjk�r td|�����j||||
|d�IdH\}}�j�rd|�d�}t�d|||||�||fS)Nz+server_hostname is only meaningful with sslz:You must set server_hostname when using ssl without a host�1ssl_handshake_timeout is only meaningful with sslr�8host/port and sock can not be specified at the same time�r=r>r?r'r��!getaddrinfo() returned empty listc3s |]}t��j�|��VqdSrB)�	functools�partialrQ)rCr*)r�laddr_infosrfrrrE�s��z2BaseEventLoop.create_connection.<locals>.<genexpr>r�cSsg|]}|D]}|�qqSrr)rC�subrWrrrr��sz3BaseEventLoop.create_connection.<locals>.<listcomp>rc3s|]}t|��kVqdSrB�r�rCrW)�modelrrrEszMultiple exceptions: {}r#css|]}t|�VqdSrBr^r_rrrrE
sz5host and port was not specified and no sock specified�"A Stream Socket was expected, got )r�r$z%r connected to %s:%r: (%r, %r))r%�_ensure_resolvedr$r1r(rPrQr
Zstaggered_racer�r�allrFr$r>�_create_connection_transportr��get_extra_inforr	)rfr�r;r<rRr=r?r'r*rSr�r�rTrU�infosr*rPrnr�r)rr\r`rfr�create_connection�s�����


�
��

�
���
�zBaseEventLoop.create_connectionc	�s�|�d�|�}|��}|rHt|t�r*dn|}	|j|||	||||d�}
n|�|||�}
z|IdHWn|
���YnX|
|fS)NF�r�r�r�)rIrdr�boolr�r�r�)rfr*r�rRr�r�r�r�r�r�rnrrrrd%s*
�z*BaseEventLoop._create_connection_transportc
�s�|��rtd��t|dtjj�}|tjjkr:td|����|tjjkr�z|�||||�IdHWStj	k
r�}z
|sx�W5d}~XYnX|s�td|����|�
||||�IdHS)NzTransport is closingZ_sendfile_compatiblez(sendfile is not supported for transport zHfallback is disabled and native sendfile is not supported for transport )rirmrrZ
_SendfileModeZUNSUPPORTEDZ
TRY_NATIVE�_sendfile_nativerr2�_sendfile_fallback)rfrnr4r5r6r/rErWrrr�sendfile?s4�����zBaseEventLoop.sendfilec�st�d��dS)Nz!sendfile syscall is not supportedr8)rfrgr4r5r6rrrrjns�zBaseEventLoop._sendfile_nativec
�s�|r|�|�|rt|d�nd}t|�}d}t|�}z�|rXt|||�}|dkrX|W�bSt|�d|�}	|�d|j|	�IdH}
|
s�|W�0S|�	�IdH|�
|	d|
��||
7}q6W5|dkr�t|d�r�|�||�|��IdHXdS)Ni@rr:)r:r;r<r\r#r{r=rr>rk�write)rfrgr4r5r6r?r@rAr?rBrCrrrrkrs*
z BaseEventLoop._sendfile_fallbackrhc
�s�tdkrtd��t|tj�s*td|����t|dd�sFtd|�d���|��}tj|||||||dd�}|�	�|�
|�|�|j|�}	|�|j
�}
z|IdHWn.tk
r�|��|	��|
���YnX|jS)Nz"Python ssl module is not availablez@sslcontext is expected to be an instance of ssl.SSLContext, got Z_start_tls_compatibleFz
transport z  is not supported by start_tls())r�r�)rRrmrZ
SSLContextr5rrdr	ZSSLProtocolrarbrrory�
BaseExceptionr�rzZ_app_transport)rfrnr�r�r�r�r�r�Zssl_protocolZ
conmade_cbZ	resume_cbrrr�	start_tls�sB	�
��
zBaseEventLoop.start_tls)r=r?r'�
reuse_address�
reuse_port�allow_broadcastr*c �s�|
dk	r�|
jtjkr"td|
�����s>�s>|s>|s>|s>|s>|	r~t��||||||	d�}d�dd�|��D��}td|�d���|
�d�d}
�n�s��s�|d	kr�td
��||fdff}�n�ttd��r�|tj	k�r���fD]}|dk	r�t
|t�s�td
��qڈ�rx�d	dk�rxz"t
�t�
��j��r.t���WnFtk
�rFYn2tk
�rv}zt�d�|�W5d}~XYnX||f��fff}n�i}d	�fd�ffD]�\}}|dk	�r�|j||tj|||d�IdH}|�s�td��|D]:\}}}}}||f}||k�rddg||<||||<�q�q���fdd�|��D�}|�sHtd��g}|tk	�rv|�rftd��ntjdtdd�|D]�\\}}\}}d}
d}
zxtj|tj|d�}
|�r�t|
�|	�r�|
�tjtjd�|
�d���r�|
�|���r|	�s|� |
|�IdH|}
Wn^tk
�rJ}z |
dk	�r0|
�!�|�"|�W5d}~XYn&|
dk	�rb|
�!��YnX�q|�qz|d	�|�}|�#�}|�$|
||
|�}|j%�r̈�r�t�&d��||�nt�'d�||�z|IdHWn|�!��YnX||fS)NzA UDP Socket was expected, got )rS�remote_addrr=r?r'rprqrrr#css$|]\}}|r|�d|��VqdS)�=Nr)rC�k�vrrrrE�sz9BaseEventLoop.create_datagram_endpoint.<locals>.<genexpr>zKsocket modifier keyword arguments can not be used when sock is specified. (�)Frzunexpected address family)NN�AF_UNIXzstring is expected)r�z2Unable to check or remove stale UNIX socket %r: %rrrXrYcs8g|]0\}}�r|ddks�r,|ddks||f�qS)rNrr)rC�keyZ	addr_pair�rSrsrrr��s�z:BaseEventLoop.create_datagram_endpoint.<locals>.<listcomp>zcan not get address informationz~Passing `reuse_address=True` is no longer supported, as the usage of SO_REUSEPORT in UDP poses a significant security concern.zdThe *reuse_address* parameter has been deprecated as of 3.5.10 and is scheduled for removal in 3.11.r)�
stacklevelrGz@Datagram endpoint local_addr=%r remote_addr=%r created: (%r, %r)z2Datagram endpoint remote_addr=%r created: (%r, %r))(r>r$r2r%�dictr$�itemsrIr#rxrrr5�stat�S_ISSOCK�os�st_mode�remove�FileNotFoundErrorr(r�errorrb�_unsetr�r�r r+r&r'ZSO_BROADCASTrJrOr�r9rdr�r�r&r	) rfr�rSrsr=r?r'rprqrrr*ZoptsZproblemsZr_addrZaddr_pairs_inforO�errZ
addr_infos�idxrfZfamrPZpror�rzrZ
local_addressZremote_addressrWr�r�rnrr{r�create_datagram_endpoint�s$�������
�

��
�
�

����




���z&BaseEventLoop.create_datagram_endpointc
�s\|dd�\}}t|||||f|dd���}	|	dk	r<|	gS|j||||||d�IdHSdS)Nrr-)rAr%)
rfr�r=r>r?r'r�r;r<r&rrrrbLs�zBaseEventLoop._ensure_resolvedc�s8|j||f|tj||d�IdH}|s4td|�d���|S)N)r=r>r'r�zgetaddrinfo(z) returned empty list)rbr$r1r()rfr;r<r=r'rfrrr�_create_server_getaddrinfoXs�z(BaseEventLoop._create_server_getaddrinfor)	r=r'r*r�rRrprqr�r�c	�s�t|t�rtd��|dk	r*|dkr*td��|dk	s<�dk	�r"|dk	rLtd��|	dkrhtjdkoftjdk}	g}
|dkr|dg}n$t|t�s�t|t	j
j�s�|g}n|}����fdd�|D�}tj
|d	�i�IdH}ttj�|��}d
}�z|D�]}|\}}}}}zt�|||�}Wn8tjk
�rH�j�r@tjd|||dd
�Yq�YnX|
�|�|	�rl|�tjtjd�|
�rzt|�t�r�|tjk�r�ttd��r�|�tj tj!d�z|�"|�Wq�t#k
�r�}z t#|j$d||j%�&�f�d�W5d}~XYq�Xq�d}W5|�s|
D]}|���qXn4|dk�r4td��|j'tj(k�rPtd|����|g}
|
D]}|�)d
��qZt*�|
||||�}|�r�|�+�tj,d�d�IdH�j�r�t�-d|�|S)Nz*ssl argument must be an SSLContext or NonerVrW�posix�cygwinr.csg|]}�j|���d��qS))r=r')r�)rCr;�r=r'r<rfrrr��s�
�z/BaseEventLoop.create_server.<locals>.<listcomp>r�Fz:create_server() failed to create socket.socket(%r, %r, %r)T��exc_info�IPPROTO_IPV6z0error while attempting to bind on address %r: %sz)Neither host/port nor sock were specifiedrarr�z
%r is serving).rrir5r%r�r�r�platformrrF�abc�Iterablerr��setrKrLrMr�r$r�r�r�warningr9r&r'ZSO_REUSEADDRr+r8rr#r�ZIPV6_V6ONLYrJr(rMrKrLr>r1rIrr�r�r&)rfr�r;r<r=r'r*r�rRrprqr�r�r�ZhostsZfsrfZ	completed�resr@Zsocktyper?Z	canonnameZsar�r�rr�r�
create_server`s�
��
��
�

������
�zBaseEventLoop.create_server)rRr�c�sv|jtjkrtd|����|dk	r.|s.td��|j|||dd|d�IdH\}}|jrn|�d�}t�d|||�||fS)NrarVr.T)r�r�r$z%r handled: (%r, %r))	r>r$r1r%rdr�rerr	)rfr�r*rRr�rnr�rrr�connect_accepted_socket�s$��
z%BaseEventLoop.connect_accepted_socketc�sd|�}|��}|�|||�}z|IdHWn|���YnX|jr\t�d|��||�||fS)Nz Read pipe %r connected: (%r, %r))rdr�r�r�rr	�fileno�rfr�r�r�r�rnrrr�connect_read_pipe�s�zBaseEventLoop.connect_read_pipec�sd|�}|��}|�|||�}z|IdHWn|���YnX|jr\t�d|��||�||fS)Nz!Write pipe %r connected: (%r, %r))rdr�r�r�rr	r�r�rrr�connect_write_pipes�z BaseEventLoop.connect_write_pipecCs�|g}|dk	r"|�dt|����|dk	rJ|tjkrJ|�dt|����n8|dk	rf|�dt|����|dk	r�|�dt|����t�d�|��dS)Nzstdin=zstdout=stderr=zstdout=zstderr=� )r9r!rrrr	r$)rfr(r�r�r�r&rrr�_log_subprocessszBaseEventLoop._log_subprocess)	r�r�r��universal_newlinesr�r��encoding�errors�textc	�s�t|ttf�std��|r"td��|s.td��|dkr>td��|rJtd��|	dk	rZtd��|
dk	rjtd��|�}
d}|jr�d	|}|�||||�|j|
|d
||||f|�IdH}|jr�|dk	r�t�d||�||
fS)Nzcmd must be a string� universal_newlines must be Falsezshell must be Truer�bufsize must be 0�text must be False�encoding must be None�errors must be Nonezrun shell command %rT�%s: %r)	rr3rr%r�r�r�rr&)rfr��cmdr�r�r�r�r�r�r�r�r�r�r��	debug_logrnrrr�subprocess_shellsB��
zBaseEventLoop.subprocess_shellc	�s�|rtd��|rtd��|dkr(td��|r4td��|	dk	rDtd��|
dk	rTtd��|f|}|�}d}|jr�d|��}|�||||�|j||d	||||f|
�IdH}|jr�|dk	r�t�d
||�||fS)Nr�zshell must be Falserr�r�r�r�zexecute program Fr�)r%r�r�r�rr&)rfr�Zprogramr�r�r�r�r�r�r�r�r�r�r�Z
popen_argsr�r�rnrrr�subprocess_execCs@

��
zBaseEventLoop.subprocess_execcCs|jSrB)r�rqrrr�get_exception_handleresz#BaseEventLoop.get_exception_handlercCs(|dk	rt|�std|����||_dS)Nz+A callable object or None is expected, got )r�r5r�)rfZhandlerrrr�set_exception_handlerjsz#BaseEventLoop.set_exception_handlerc	Cs|�d�}|sd}|�d�}|dk	r6t|�||jf}nd}d|kr`|jdk	r`|jjr`|jj|d<|g}t|�D]�}|dkr|qn||}|dkr�d�t�|��}d	}||�	�7}n2|dkr�d�t�|��}d
}||�	�7}nt
|�}|�|�d|���qntj
d�|�|d
�dS)Nr�z!Unhandled exception in event looprRFZsource_tracebackZhandle_traceback>r�rRr.z+Object created at (most recent call last):
z+Handle created at (most recent call last):
rH�
r�)�getr>�
__traceback__r�r��sortedr$�	traceback�format_list�rstriprr9rr�)	rfr
r�rRr�Z	log_linesrz�value�tbrrr�default_exception_handler{s<

���z'BaseEventLoop.default_exception_handlercCs�|jdkrVz|�|�Wq�ttfk
r2�Yq�tk
rRtjddd�Yq�Xn�z|�||�Wn�ttfk
r��Ynttk
r�}zVz|�d||d��Wn:ttfk
r��Yn"tk
r�tjddd�YnXW5d}~XYnXdS)Nz&Exception in default exception handlerTr�z$Unhandled error in exception handler)r�rRr
zeException in default exception handler while handling an unexpected error in custom exception handler)r�r�rSrTrnrr�)rfr
rWrrrr��s4
���z$BaseEventLoop.call_exception_handlercCs|jr
dS|j�|�dSrB)�
_cancelledr�r9�rfrrrr�
_add_callback�szBaseEventLoop._add_callbackcCs|�|�|��dSrB)r�r�r�rrr�_add_callback_signalsafe�s
z&BaseEventLoop._add_callback_signalsafecCs|jr|jd7_dSrZ)r�r�r�rrr�_timer_handle_cancelled�sz%BaseEventLoop._timer_handle_cancelledc	Cs�t|j�}|tkr`|j|tkr`g}|jD]}|jr<d|_q*|�|�q*t�|�||_d|_n4|jr�|jdjr�|jd8_t�	|j�}d|_q`d}|j
s�|jr�d}n*|jr�|jdj}t
td||���t�}|j�|�}|�|�|��|j}|j�r:|jd}|j|k�r�q:t�	|j�}d|_|j
�|�q�t|j
�}t|�D]|}	|j
��}|j�rf�qL|j�r�zD||_|��}
|��|��|
}||jk�r�t�dt|�|�W5d|_Xn|���qLd}dS)NFrrzExecuting %s took %.3f seconds)r�r��_MIN_SCHEDULED_TIMER_HANDLESr��%_MIN_CANCELLED_TIMER_HANDLES_FRACTIONr�r9r�heapify�heappopr�r�Z_whenr;�maxr��MAXIMUM_SELECT_TIMEOUTZ	_selectorZselectr�r��range�popleftr�r�Z_runr�rr�r)rfZsched_countZ
new_scheduledrZtimeoutrr�Zend_timeZntodo�ir)r+rrrr�sj
��





�
zBaseEventLoop._run_oncecCsHt|�t|j�krdS|r2t��|_t�tj�nt�|j�||_dSrB)rir�r�#get_coroutine_origin_tracking_depthr��#set_coroutine_origin_tracking_depthrZDEBUG_STACK_DEPTH�rfZenabledrrrr�Fs���z,BaseEventLoop._set_coroutine_origin_trackingcCs|jSrB)r�rqrrrr�UszBaseEventLoop.get_debugcCs ||_|��r|�|j|�dSrB)r�r�r�r�r�rrrr�XszBaseEventLoop.set_debug)N)N)NNN)NN)NN)N)r)rN)N)NN)FN)rN)NN)NN)Sr|r}r~rhr�rdr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrUr�r�r�r�rr�r�rrrrrrr�rr!r,r%r.r7r1r3r0rQrgrdrlrjrkror�r�r$r1rbr�r6Z
AI_PASSIVEr�r�r�r�r�rrr�r�r�r�r�r�r�r�r�rr�r�r�rrrrr�sF���
�
�
�
�
		&	
	�

�
%���
�/�/���	��w��%�"29Nr)rr)r)6rFZcollections.abcZconcurrent.futuresrrZrrKr�r$rrrr�r�rr�r�rR�ImportErrorr.rrrrrrr	r
rrr
�logr�__all__r�r�r#r8r��objectr�rr!r+rArPrXr[ZProtocolr\ZAbstractServerrZAbstractEventLooprrrrr�<module>sb

		
;


Doasyncio/__pycache__/queues.cpython-38.pyc000064400000020277151153537520014377 0ustar00U

e5d �@s�dZddlZddlZddlZddlmZddlmZGdd�de�ZGdd	�d	e�Z	Gd
d�d�Z
Gdd
�d
e
�ZGdd�de
�ZdS))�Queue�
PriorityQueue�	LifoQueue�	QueueFull�
QueueEmpty�N�)�events)�locksc@seZdZdZdS)rz;Raised when Queue.get_nowait() is called on an empty Queue.N��__name__�
__module__�__qualname__�__doc__�rr�&/usr/lib64/python3.8/asyncio/queues.pyrsrc@seZdZdZdS)rzDRaised when the Queue.put_nowait() method is called on a full Queue.Nr
rrrrrsrc@s�eZdZdZd)dd�dd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Ze
dd��Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�ZdS)*raA queue, useful for coordinating producer and consumer coroutines.

    If maxsize is less than or equal to zero, the queue size is infinite. If it
    is an integer greater than 0, then "await put()" will block when the
    queue reaches maxsize, until an item is removed by get().

    Unlike the standard library Queue, you can reliably know this Queue's size
    with qsize(), since your single-threaded asyncio application won't be
    interrupted between calling qsize() and doing an operation on the Queue.
    rN��loopcCsp|dkrt��|_n||_tjdtdd�||_t��|_	t��|_
d|_tj
|d�|_|j��|�|�dS)Nz[The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.�)�
stacklevelrr)rZget_event_loop�_loop�warnings�warn�DeprecationWarning�_maxsize�collections�deque�_getters�_putters�_unfinished_tasksr	ZEvent�	_finished�set�_init)�self�maxsizerrrr�__init__!s�


zQueue.__init__cCst��|_dS�N)rr�_queue�r"r#rrrr!6szQueue._initcCs
|j��Sr%)r&�popleft�r"rrr�_get9sz
Queue._getcCs|j�|�dSr%�r&�append�r"�itemrrr�_put<sz
Queue._putcCs&|r"|��}|��s|�d�q"qdSr%)r(ZdoneZ
set_result)r"�waitersZwaiterrrr�_wakeup_nextAs

zQueue._wakeup_nextcCs(dt|�j�dt|�d�d|���d�S)N�<z at z#x� �>)�typer�id�_formatr)rrr�__repr__IszQueue.__repr__cCsdt|�j�d|���d�S)Nr2r3r4)r5rr7r)rrr�__str__Lsz
Queue.__str__cCs~d|j��}t|dd�r,|dt|j���7}|jrH|dt|j��d�7}|jrd|dt|j��d�7}|jrz|d|j��7}|S)Nzmaxsize=r&z _queue=z
 _getters[�]z
 _putters[z tasks=)r�getattr�listr&r�lenrr)r"�resultrrrr7Osz
Queue._formatcCs
t|j�S)zNumber of items in the queue.)r=r&r)rrr�qsize[szQueue.qsizecCs|jS)z%Number of items allowed in the queue.)rr)rrrr#_sz
Queue.maxsizecCs|jS)z3Return True if the queue is empty, False otherwise.�r&r)rrr�emptydszQueue.emptycCs |jdkrdS|��|jkSdS)z�Return True if there are maxsize items in the queue.

        Note: if the Queue was initialized with maxsize=0 (the default),
        then full() is never True.
        rFN)rr?r)rrr�fullhs
z
Queue.fullc�s�|��r�|j��}|j�|�z|IdHWq|��z|j�|�Wntk
r`YnX|��s~|��s~|�	|j��YqXq|�
|�S)z�Put an item into the queue.

        Put an item into the queue. If the queue is full, wait until a free
        slot is available before adding item.
        N)rBr�
create_futurerr,�cancel�remove�
ValueError�	cancelledr1�
put_nowait)r"r.Zputterrrr�putss

z	Queue.putcCs>|��rt�|�|�|jd7_|j��|�|j�dS)zyPut an item into the queue without blocking.

        If no free slot is immediately available, raise QueueFull.
        rN)rBrr/rr�clearr1rr-rrrrH�s

zQueue.put_nowaitc�s�|��r�|j��}|j�|�z|IdHWq|��z|j�|�Wntk
r`YnX|��s~|��s~|�	|j��YqXq|�
�S)zoRemove and return an item from the queue.

        If queue is empty, wait until an item is available.
        N)rArrCrr,rDrErFrGr1�
get_nowait)r"�getterrrr�get�s

z	Queue.getcCs$|��rt�|��}|�|j�|S)z�Remove and return an item from the queue.

        Return an item if one is immediately available, else raise QueueEmpty.
        )rArr*r1rr-rrrrK�s
zQueue.get_nowaitcCs8|jdkrtd��|jd8_|jdkr4|j��dS)a$Indicate that a formerly enqueued task is complete.

        Used by queue consumers. For each get() used to fetch a task,
        a subsequent call to task_done() tells the queue that the processing
        on the task is complete.

        If a join() is currently blocking, it will resume when all items have
        been processed (meaning that a task_done() call was received for every
        item that had been put() into the queue).

        Raises ValueError if called more times than there were items placed in
        the queue.
        rz!task_done() called too many timesrN)rrFrr r)rrr�	task_done�s


zQueue.task_donec�s|jdkr|j��IdHdS)aBlock until all items in the queue have been gotten and processed.

        The count of unfinished tasks goes up whenever an item is added to the
        queue. The count goes down whenever a consumer calls task_done() to
        indicate that the item was retrieved and all work on it is complete.
        When the count of unfinished tasks drops to zero, join() unblocks.
        rN)rr�waitr)rrr�join�s
z
Queue.join)r)rrr
rr$r!r*r/r1r8r9r7r?�propertyr#rArBrIrHrMrKrNrPrrrrrs(
rc@s4eZdZdZdd�Zejfdd�Zejfdd�Z	dS)	rz�A subclass of Queue; retrieves entries in priority order (lowest first).

    Entries are typically tuples of the form: (priority number, data).
    cCs
g|_dSr%r@r'rrrr!�szPriorityQueue._initcCs||j|�dSr%r@)r"r.�heappushrrrr/�szPriorityQueue._putcCs
||j�Sr%r@)r"�heappoprrrr*�szPriorityQueue._getN)
rrr
rr!�heapqrRr/rSr*rrrrr�src@s(eZdZdZdd�Zdd�Zdd�ZdS)	rzEA subclass of Queue that retrieves most recently added entries first.cCs
g|_dSr%r@r'rrrr!�szLifoQueue._initcCs|j�|�dSr%r+r-rrrr/�szLifoQueue._putcCs
|j��Sr%)r&�popr)rrrr*�szLifoQueue._getN)rrr
rr!r/r*rrrrr�sr)
�__all__rrTr�rr	�	Exceptionrrrrrrrrr�<module>sKasyncio/__pycache__/futures.cpython-38.opt-2.pyc000064400000017040151153537520015517 0ustar00U

e5db3�@s�dZddlZddlZddlZddlZddlmZddlmZddlm	Z	ddlm
Z
ejZejZej
Z
ejZejdZGdd	�d	�ZeZd
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Zdd�dd�ZzddlZWnek
r�YnXejZZdS))�Future�wrap_future�isfuture�N�)�base_futures)�events)�
exceptions)�format_helpersc@s�eZdZeZdZdZdZdZdZ	dZ
dd�dd�Zej
Zdd�Zdd	�Zed
d��Zejdd��Zd
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�dd�Zdd�Zd d!�Zd"d#�Zd$d%�ZeZ dS)&rNF��loopcCs@|dkrt��|_n||_g|_|j��r<t�t�d��|_	dS)Nr)
r�get_event_loop�_loop�
_callbacksZ	get_debugr	�
extract_stack�sys�	_getframe�_source_traceback��selfr�r�'/usr/lib64/python3.8/asyncio/futures.py�__init__Ds
�zFuture.__init__cCsd�|jjd�|����S)Nz<{} {}>� )�format�	__class__�__name__�join�
_repr_info�rrrr�__repr__Vs
�zFuture.__repr__cCsF|js
dS|j}|jj�d�||d�}|jr6|j|d<|j�|�dS)Nz exception was never retrieved)�message�	exception�futureZsource_traceback)�_Future__log_traceback�
_exceptionrrrr
Zcall_exception_handler)r�exc�contextrrr�__del__Zs�
zFuture.__del__cCs|jS�N)r#rrrr�_log_tracebackjszFuture._log_tracebackcCst|�rtd��d|_dS)Nz'_log_traceback can only be set to FalseF)�bool�
ValueErrorr#)r�valrrrr)nscCs|j}|dkrtd��|S)Nz!Future object is not initialized.)r
�RuntimeErrorrrrr�get_looptszFuture.get_loopcCs&d|_|jtkrdSt|_|��dS)NFT)r#�_state�_PENDING�
_CANCELLED�_Future__schedule_callbacksrrrr�cancel{s
z
Future.cancelcCsH|jdd�}|sdSg|jdd�<|D]\}}|jj|||d�q(dS�N�r&)rr
�	call_soon)rZ	callbacks�callback�ctxrrrZ__schedule_callbacks�szFuture.__schedule_callbackscCs
|jtkSr()r/r1rrrr�	cancelled�szFuture.cancelledcCs
|jtkSr()r/r0rrrr�done�szFuture.donecCs@|jtkrtj�|jtkr$t�d��d|_|jdk	r:|j�|jS)NzResult is not ready.F)	r/r1r�CancelledError�	_FINISHED�InvalidStateErrorr#r$�_resultrrrr�result�s



z
Future.resultcCs0|jtkrtj�|jtkr$t�d��d|_|jS)NzException is not set.F)r/r1rr;r<r=r#r$rrrrr!�s


zFuture.exceptionr5cCsB|jtkr|jj|||d�n |dkr.t��}|j�||f�dSr4)r/r0r
r6�contextvarsZcopy_contextr�append)r�fnr&rrr�add_done_callback�s

zFuture.add_done_callbackcs<�fdd�|jD�}t|j�t|�}|r8||jdd�<|S)Ncs g|]\}}|�kr||f�qSrr)�.0�fr8�rBrr�
<listcomp>�s�z/Future.remove_done_callback.<locals>.<listcomp>)r�len)rrBZfiltered_callbacksZ
removed_countrrFr�remove_done_callback�s
�zFuture.remove_done_callbackcCs8|jtkr t�|j�d|����||_t|_|��dS)N�: )r/r0rr=r>r<r2)rr?rrr�
set_result�s

zFuture.set_resultcCsb|jtkr t�|j�d|����t|t�r0|�}t|�tkrDtd��||_t	|_|�
�d|_dS)NrJzPStopIteration interacts badly with generators and cannot be raised into a FutureT)r/r0rr=�
isinstance�type�
StopIteration�	TypeErrorr$r<r2r#)rr!rrr�
set_exception�s

zFuture.set_exceptionccs,|��sd|_|V|��s$td��|��S)NTzawait wasn't used with future)r:�_asyncio_future_blockingr-r?rrrr�	__await__szFuture.__await__)!r�
__module__�__qualname__r0r/r>r$r
rrQr#rrZ_future_repr_inforrr'�propertyr)�setterr.r3r2r9r:r?r!rCrIrKrPrR�__iter__rrrrrs8

rcCs,z
|j}Wntk
rYnX|�S|jSr()r.�AttributeErrorr
)�futr.rrr�	_get_loops
rZcCs|��rdS|�|�dSr()r9rK)rYr?rrr�_set_result_unless_cancelledsr[cCsXt|�}|tjjkr tj|j�S|tjjkr8tj|j�S|tjjkrPtj|j�S|SdSr()rM�
concurrent�futuresr;r�args�TimeoutErrorr=)r%Z	exc_classrrr�_convert_future_exc#sr`cCsR|��r|��|��sdS|��}|dk	r<|�t|��n|��}|�|�dSr()r9r3Zset_running_or_notify_cancelr!rPr`r?rK)r\�sourcer!r?rrr�_set_concurrent_future_state/srbcCsT|��rdS|��r|��n2|��}|dk	r>|�t|��n|��}|�|�dSr()r9r3r!rPr`r?rK)ra�destr!r?rrr�_copy_future_state>s
rdcs�t��st�tjj�std��t��s<t�tjj�s<td��t��rLt��nd�t��r`t��nd�dd�����fdd�}����fdd�}��|���|�dS)	Nz(A future is required for source argumentz-A future is required for destination argumentcSs"t|�rt||�n
t||�dSr()rrdrb)r"�otherrrr�
_set_statebsz!_chain_future.<locals>._set_statecs2|��r.�dks��kr"���n���j�dSr()r9r3�call_soon_threadsafe)�destination)�	dest_loopra�source_looprr�_call_check_cancelhs
z)_chain_future.<locals>._call_check_cancelcsJ���r�dk	r���rdS�dks,��kr8��|�n����|�dSr()r9Z	is_closedrg)ra)rfrirhrjrr�_call_set_stateos��z&_chain_future.<locals>._call_set_state)rrLr\r]rrOrZrC)rarhrkrlr)rfrirhrarjr�
_chain_futureRs��	
rmr
cCs2t|�r|S|dkrt��}|��}t||�|Sr()rrrZ
create_futurerm)r"rZ
new_futurerrrr|s
r)�__all__Zconcurrent.futuresr\r@Zloggingr�rrrr	rr0r1r<�DEBUGZSTACK_DEBUGrZ	_PyFuturerZr[r`rbrdrmrZ_asyncio�ImportErrorZ_CFuturerrrr�<module>s8
q*
asyncio/__pycache__/format_helpers.cpython-38.opt-1.pyc000064400000004436151153537520017040 0ustar00U

e5dd	�@sdddlZddlZddlZddlZddlZddlmZdd�Zdd�Zdd	�Z	ddd�Z
dd
d�ZdS)�N�)�	constantscCsVt�|�}t�|�r&|j}|j|jfSt|tj�r<t	|j
�St|tj�rRt	|j
�SdS�N)�inspectZunwrapZ
isfunction�__code__�co_filename�co_firstlineno�
isinstance�	functools�partial�_get_function_source�func�
partialmethod)r
�code�r�./usr/lib64/python3.8/asyncio/format_helpers.pyr
s



rcCs8t||d�}t|�}|r4|d|d�d|d��7}|S)Nz at r�:r)�_format_callbackr)r
�args�	func_repr�sourcerrr�_format_callback_sources
rcCsHg}|r|�dd�|D��|r8|�dd�|��D��d�d�|��S)z�Format function arguments and keyword arguments.

    Special case for a single parameter: ('hello',) is formatted as ('hello').
    css|]}t�|�VqdSr��reprlib�repr)�.0�argrrr�	<genexpr>&sz*_format_args_and_kwargs.<locals>.<genexpr>css&|]\}}|�dt�|���VqdS)�=Nr)r�k�vrrrr(sz({})z, )�extend�items�format�join)r�kwargsr"rrr�_format_args_and_kwargssr&�cCs�t|tj�r.t||�|}t|j|j|j|�St|d�rF|j	rF|j	}n t|d�r^|j
r^|j
}nt|�}|t||�7}|r�||7}|S)N�__qualname__�__name__)r	r
rr&rr
r�keywords�hasattrr(r)r)r
rr%�suffixrrrrr,srcCsD|dkrt��j}|dkr tj}tjjt�|�|dd�}|�	�|S)zlReplacement for traceback.extract_stack() that only does the
    necessary work for asyncio debug mode.
    NF)�limit�lookup_lines)
�sys�	_getframe�f_backrZDEBUG_STACK_DEPTH�	traceback�StackSummary�extract�
walk_stack�reverse)�fr-�stackrrr�
extract_stack>s
�r9)r')NN)r
rrr/r2r'rrrr&rr9rrrr�<module>s
asyncio/__pycache__/__init__.cpython-38.pyc000064400000001360151153537520014617 0ustar00U

e5d��@sdZddlZddlTddlTddlTddlTddlTddlTddlTddl	Tddl
TddlTddlTddl
TddlTddl
mZejejejejejejeje	je
jejeje
jejZejdkr�ddlTeej7ZnddlTeej7ZdS)z'The asyncio package, tracking PEP 3156.�N�)�*)�_all_tasks_compatZwin32)�__doc__�sysZbase_eventsZ
coroutinesZevents�
exceptionsZfuturesZlocksZ	protocolsZrunnersZqueuesZstreams�
subprocessZtasksZ
transportsr�__all__�platformZwindows_eventsZunix_events�rr�(/usr/lib64/python3.8/asyncio/__init__.py�<module>sZ��������	�
���
asyncio/__pycache__/__main__.cpython-38.pyc000064400000006102151153537520014577 0ustar00U

e5d
�@sJddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZGdd�dej�Z
Gdd�dej�Zedk�rFe��Ze�e�d	eiZd
D]Ze�eee<q�e
ee�ZdadazddlZWnek
r�YnXe�Zde_e��ze��Wn6e k
�r>t�r6t�!��s6t�"�daYq�Yq�X�qFq�dS)
�N�)�futurescs$eZdZ�fdd�Zdd�Z�ZS)�AsyncIOInteractiveConsolecs*t��|�|jjjtjO_||_dS)N)�super�__init__�compileZcompiler�flags�astZPyCF_ALLOW_TOP_LEVEL_AWAIT�loop)�self�localsr
��	__class__��(/usr/lib64/python3.8/asyncio/__main__.pyrsz"AsyncIOInteractiveConsole.__init__csttj������fdd�}t�|�z
���WStk
rD�Yn,tk
rntrb��	d�n��
�YnXdS)Nc
sdadat���j�}z
|�}Wnztk
r6�Ynftk
rj}zda��|�WY�dSd}~XYn2tk
r�}z��|�WY�dSd}~XYnXt	�
|�s���|�dSz�j�
|�at�t��Wn.tk
�r�}z��|�W5d}~XYnXdS)NFT)�repl_future�repl_future_interrupted�types�FunctionTyper�
SystemExit�KeyboardInterruptZ
set_exception�
BaseException�inspectZiscoroutineZ
set_resultr
Zcreate_taskrZ
_chain_future)�func�coroZex�exc��codeZfuturerrr�callbacks,




z3AsyncIOInteractiveConsole.runcode.<locals>.callbackz
KeyboardInterrupt
)�
concurrentrZFuturer
�call_soon_threadsafe�resultrrr�writeZ
showtraceback)rrrrrr�runcodes


z!AsyncIOInteractiveConsole.runcode)�__name__�
__module__�__qualname__rr#�
__classcell__rrr
rrsrc@seZdZdd�ZdS)�
REPLThreadcCsZz6dtj�dtj�dt	tdd��d	�}t
j|d
d�W5tjddtd�t�tj�XdS)N�ignorez ^coroutine .* was never awaited$)�message�categoryz
asyncio REPL z on zy
Use "await" directly instead of "asyncio.run()".
Type "help", "copyright", "credits" or "license" for more information.
Zps1z>>> zimport asynciozexiting asyncio REPL...)�bannerZexitmsg)�warnings�filterwarnings�RuntimeWarningr
r �stop�sys�version�platform�getattr�consoleZinteract)rr,rrr�runFs"��
�zREPLThread.runN)r$r%r&r6rrrrr(Dsr(�__main__�asyncio>�__builtins__�__spec__r$�__file__�
__loader__�__package__FT)#r	r8rZconcurrent.futuresrrr1Z	threadingrr-�rZInteractiveConsolerZThreadr(r$Znew_event_loopr
Zset_event_loopZrepl_locals�keyrr5rr�readline�ImportErrorZrepl_threadZdaemon�startZrun_foreverrZdoneZcancelrrrr�<module>sF6



asyncio/__pycache__/transports.cpython-38.opt-2.pyc000064400000015261151153537520016244 0ustar00U

e5d�(�@sxdZGdd�d�ZGdd�de�ZGdd�de�ZGdd�dee�ZGd	d
�d
e�ZGdd�de�ZGd
d�de�ZdS))�
BaseTransport�
ReadTransport�WriteTransport�	Transport�DatagramTransport�SubprocessTransportc@sDeZdZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)r��_extraNcCs|dkri}||_dS�Nr)�self�extra�r�*/usr/lib64/python3.8/asyncio/transports.py�__init__szBaseTransport.__init__cCs|j�||�Sr	)r�get)r
�name�defaultrrr
�get_extra_infoszBaseTransport.get_extra_infocCst�dSr	��NotImplementedError�r
rrr
�
is_closingszBaseTransport.is_closingcCst�dSr	rrrrr
�closeszBaseTransport.closecCst�dSr	r)r
�protocolrrr
�set_protocol%szBaseTransport.set_protocolcCst�dSr	rrrrr
�get_protocol)szBaseTransport.get_protocol)N)N)
�__name__�
__module__�__qualname__�	__slots__rrrrrrrrrr
r	s


rc@s(eZdZdZdd�Zdd�Zdd�ZdS)	rrcCst�dSr	rrrrr
�
is_reading3szReadTransport.is_readingcCst�dSr	rrrrr
�
pause_reading7szReadTransport.pause_readingcCst�dSr	rrrrr
�resume_reading?szReadTransport.resume_readingN)rrrrrr r!rrrr
r.src@sJeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)rrNcCst�dSr	r�r
�high�lowrrr
�set_write_buffer_limitsMsz&WriteTransport.set_write_buffer_limitscCst�dSr	rrrrr
�get_write_buffer_sizebsz$WriteTransport.get_write_buffer_sizecCst�dSr	r)r
�datarrr
�writefszWriteTransport.writecCsd�|�}|�|�dS)N�)�joinr()r
Zlist_of_datar'rrr
�
writelinesns
zWriteTransport.writelinescCst�dSr	rrrrr
�	write_eofwszWriteTransport.write_eofcCst�dSr	rrrrr
�
can_write_eof�szWriteTransport.can_write_eofcCst�dSr	rrrrr
�abort�szWriteTransport.abort)NN)rrrrr%r&r(r+r,r-r.rrrr
rHs
		rc@seZdZdZdS)rrN)rrrrrrrr
r�src@s"eZdZdZddd�Zdd�ZdS)rrNcCst�dSr	r)r
r'Zaddrrrr
�sendto�szDatagramTransport.sendtocCst�dSr	rrrrr
r.�szDatagramTransport.abort)N)rrrrr/r.rrrr
r�s

rc@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)rrcCst�dSr	rrrrr
�get_pid�szSubprocessTransport.get_pidcCst�dSr	rrrrr
�get_returncode�sz"SubprocessTransport.get_returncodecCst�dSr	r)r
�fdrrr
�get_pipe_transport�sz&SubprocessTransport.get_pipe_transportcCst�dSr	r)r
�signalrrr
�send_signal�szSubprocessTransport.send_signalcCst�dSr	rrrrr
�	terminate�szSubprocessTransport.terminatecCst�dSr	rrrrr
�kill�s	zSubprocessTransport.killN)
rrrrr0r1r3r5r6r7rrrr
r�srcsVeZdZdZd�fdd�	Zdd�Zdd�Zd	d
�Zddd�Zdd
d�Z	dd�Z
�ZS)�_FlowControlMixin)�_loop�_protocol_paused�_high_water�
_low_waterNcs$t��|�||_d|_|��dS)NF)�superrr9r:�_set_write_buffer_limits)r
rZloop��	__class__rr
rsz_FlowControlMixin.__init__c
Cs�|��}||jkrdS|js�d|_z|j��WnRttfk
rJ�Yn:tk
r�}z|j�	d|||jd��W5d}~XYnXdS)NTzprotocol.pause_writing() failed��messageZ	exceptionZ	transportr)
r&r;r:�	_protocolZ
pause_writing�
SystemExit�KeyboardInterrupt�
BaseExceptionr9�call_exception_handler)r
�size�excrrr
�_maybe_pause_protocols 
�z'_FlowControlMixin._maybe_pause_protocolc
Cs�|jr||��|jkr|d|_z|j��WnRttfk
rB�Yn:tk
rz}z|j�	d|||jd��W5d}~XYnXdS)NFz protocol.resume_writing() failedrA)
r:r&r<rCZresume_writingrDrErFr9rG)r
rIrrr
�_maybe_resume_protocol!s��z(_FlowControlMixin._maybe_resume_protocolcCs|j|jfSr	)r<r;rrrr
�get_write_buffer_limits1sz)_FlowControlMixin.get_write_buffer_limitscCsj|dkr|dkrd}nd|}|dkr.|d}||krBdksZntd|�d|�d���||_||_dS)Ni��zhigh (z) must be >= low (z) must be >= 0)�
ValueErrorr;r<r"rrr
r>4s�z*_FlowControlMixin._set_write_buffer_limitscCs|j||d�|��dS)N)r#r$)r>rJr"rrr
r%Dsz)_FlowControlMixin.set_write_buffer_limitscCst�dSr	rrrrr
r&Hsz'_FlowControlMixin.get_write_buffer_size)NN)NN)NN)rrrrrrJrKrLr>r%r&�
__classcell__rrr?r
r8�s

r8N)�__all__rrrrrrr8rrrr
�<module>s%F6asyncio/__pycache__/events.cpython-38.pyc000064400000066633151153537520014402 0ustar00U

e5d4f�@s|dZdZddlZddlZddlZddlZddlZddlZddlm	Z	ddlm
Z
Gdd�d�ZGd	d
�d
e�ZGdd�d�Z
Gd
d�d�ZGdd�d�ZGdd�de�Zdae��ZGdd�dej�Ze�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Z d)d*�Z!eZ"eZ#eZ$eZ%zdd+l&mZmZmZmZWne'k
�rfYnXeZ(eZ)eZ*eZ+dS),z!Event loop and event loop policy.)�AbstractEventLoopPolicy�AbstractEventLoop�AbstractServer�Handle�TimerHandle�get_event_loop_policy�set_event_loop_policy�get_event_loop�set_event_loop�new_event_loop�get_child_watcher�set_child_watcher�_set_running_loop�get_running_loop�_get_running_loop�N�)�format_helpers)�
exceptionsc@sFeZdZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)rz1Object returned by callback registration methods.)�	_callback�_args�
_cancelled�_loop�_source_traceback�_repr�__weakref__�_contextNcCs\|dkrt��}||_||_||_||_d|_d|_|j��rRt	�
t�d��|_
nd|_
dS)NFr)�contextvarsZcopy_contextrrrrrr�	get_debugr�
extract_stack�sys�	_getframer)�self�callback�args�loop�context�r&�&/usr/lib64/python3.8/asyncio/events.py�__init__ s
�zHandle.__init__cCsl|jjg}|jr|�d�|jdk	r:|�t�|j|j��|jrh|jd}|�d|d�d|d���|S)N�	cancelled���zcreated at r�:r)	�	__class__�__name__r�appendrr�_format_callback_sourcerr)r!�info�framer&r&r'�
_repr_info/s


�
zHandle._repr_infocCs(|jdk	r|jS|��}d�d�|��S)Nz<{}>� )rr2�format�join)r!r0r&r&r'�__repr__;s
zHandle.__repr__cCs0|js,d|_|j��r t|�|_d|_d|_dS�NT)rrr�reprrrr�r!r&r&r'�cancelAs

z
Handle.cancelcCs|jS�N)rr9r&r&r'r)LszHandle.cancelledc
Cs�z|jj|jf|j��Wn|ttfk
r4�Yndtk
r�}zFt�|j|j�}d|��}|||d�}|j	rz|j	|d<|j
�|�W5d}~XYnXd}dS)NzException in callback )�messageZ	exception�handleZsource_traceback)r�runrr�
SystemExit�KeyboardInterrupt�
BaseExceptionrr/rr�call_exception_handler)r!�exc�cb�msgr%r&r&r'�_runOs$�
�
zHandle._run)N)r-�
__module__�__qualname__�__doc__�	__slots__r(r2r6r:r)rFr&r&r&r'rs
rcs�eZdZdZddgZd�fdd�	Z�fdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
�fdd�Zdd�Z�ZS)rz7Object returned by timed callback registration methods.�
_scheduled�_whenNcs<|dk	st�t��||||�|jr,|jd=||_d|_dS)Nr*F)�AssertionError�superr(rrLrK)r!�whenr"r#r$r%�r,r&r'r(hszTimerHandle.__init__cs0t���}|jrdnd}|�|d|j���|S)N�rzwhen=)rNr2r�insertrL)r!r0�posrPr&r'r2ps
zTimerHandle._repr_infocCs
t|j�Sr;)�hashrLr9r&r&r'�__hash__vszTimerHandle.__hash__cCs|j|jkSr;�rL�r!�otherr&r&r'�__lt__yszTimerHandle.__lt__cCs|j|jkrdS|�|�Sr7�rL�__eq__rWr&r&r'�__le__|szTimerHandle.__le__cCs|j|jkSr;rVrWr&r&r'�__gt__�szTimerHandle.__gt__cCs|j|jkrdS|�|�Sr7rZrWr&r&r'�__ge__�szTimerHandle.__ge__cCs>t|t�r:|j|jko8|j|jko8|j|jko8|j|jkStSr;)�
isinstancerrLrrr�NotImplementedrWr&r&r'r[�s

�
�
�zTimerHandle.__eq__cCs|�|�}|tkrtS|Sr;)r[r`)r!rXZequalr&r&r'�__ne__�s
zTimerHandle.__ne__cs |js|j�|�t���dSr;)rr�_timer_handle_cancelledrNr:r9rPr&r'r:�szTimerHandle.cancelcCs|jS)z�Return a scheduled callback time.

        The time is an absolute timestamp, using the same time
        reference as loop.time().
        rVr9r&r&r'rO�szTimerHandle.when)N)r-rGrHrIrJr(r2rUrYr\r]r^r[rar:rO�
__classcell__r&r&rPr'rcsrc@sPeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�ZdS)rz,Abstract server returned by create_server().cCst�dS)z5Stop serving.  This leaves existing connections open.N��NotImplementedErrorr9r&r&r'�close�szAbstractServer.closecCst�dS)z4Get the event loop the Server object is attached to.Nrdr9r&r&r'�get_loop�szAbstractServer.get_loopcCst�dS)z3Return True if the server is accepting connections.Nrdr9r&r&r'�
is_serving�szAbstractServer.is_servingc�st�dS)z�Start accepting connections.

        This method is idempotent, so it can be called when
        the server is already being serving.
        Nrdr9r&r&r'�
start_serving�szAbstractServer.start_servingc�st�dS)z�Start accepting connections until the coroutine is cancelled.

        The server is closed when the coroutine is cancelled.
        Nrdr9r&r&r'�
serve_forever�szAbstractServer.serve_foreverc�st�dS)z*Coroutine to wait until service is closed.Nrdr9r&r&r'�wait_closed�szAbstractServer.wait_closedc�s|Sr;r&r9r&r&r'�
__aenter__�szAbstractServer.__aenter__c�s|��|��IdHdSr;)rfrk)r!rCr&r&r'�	__aexit__�szAbstractServer.__aexit__N)r-rGrHrIrfrgrhrirjrkrlrmr&r&r&r'r�src@sVeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�dd�Zd d!�Zd"d#�Zd$d%�Zd&d&d&d&d'�d(d)�Zdud*d+�Zdvdd&d&d&ddddddd,�
d-d.�Zdwejejdd/ddddd0d1�	d2d3�Zdxd0d4�d5d6�Zd7ddd8�d9d:�Zdyddddd;�d<d=�Zdzdd/ddd0d>�d?d@�Zd{d&d&d&dddddA�dBdC�Z dDdE�Z!dFdG�Z"e#j$e#j$e#j$dH�dIdJ�Z%e#j$e#j$e#j$dH�dKdL�Z&dMdN�Z'dOdP�Z(dQdR�Z)dSdT�Z*dUdV�Z+dWdX�Z,dYdZ�Z-d[d\�Z.d]d^�Z/d|dd4�d_d`�Z0dadb�Z1dcdd�Z2dedf�Z3dgdh�Z4didj�Z5dkdl�Z6dmdn�Z7dodp�Z8dqdr�Z9dsdt�Z:dS)}rzAbstract event loop.cCst�dS)z*Run the event loop until stop() is called.Nrdr9r&r&r'�run_forever�szAbstractEventLoop.run_forevercCst�dS)zpRun the event loop until a Future is done.

        Return the Future's result, or raise its exception.
        Nrd)r!Zfuturer&r&r'�run_until_complete�sz$AbstractEventLoop.run_until_completecCst�dS)z�Stop the event loop as soon as reasonable.

        Exactly how soon that is may depend on the implementation, but
        no more I/O callbacks should be scheduled.
        Nrdr9r&r&r'�stop�szAbstractEventLoop.stopcCst�dS)z3Return whether the event loop is currently running.Nrdr9r&r&r'�
is_running�szAbstractEventLoop.is_runningcCst�dS)z*Returns True if the event loop was closed.Nrdr9r&r&r'�	is_closed�szAbstractEventLoop.is_closedcCst�dS)z�Close the loop.

        The loop should not be running.

        This is idempotent and irreversible.

        No other methods should be called after this one.
        Nrdr9r&r&r'rf�s	zAbstractEventLoop.closec�st�dS)z,Shutdown all active asynchronous generators.Nrdr9r&r&r'�shutdown_asyncgens�sz$AbstractEventLoop.shutdown_asyncgenscCst�dS)z3Notification that a TimerHandle has been cancelled.Nrd)r!r=r&r&r'rb�sz)AbstractEventLoop._timer_handle_cancelledcGs|jd|f|��S)Nr)�
call_later�r!r"r#r&r&r'�	call_soonszAbstractEventLoop.call_sooncGst�dSr;rd)r!Zdelayr"r#r&r&r'rtszAbstractEventLoop.call_latercGst�dSr;rd)r!rOr"r#r&r&r'�call_atszAbstractEventLoop.call_atcCst�dSr;rdr9r&r&r'�timeszAbstractEventLoop.timecCst�dSr;rdr9r&r&r'�
create_futureszAbstractEventLoop.create_futureN)�namecCst�dSr;rd)r!�cororzr&r&r'�create_taskszAbstractEventLoop.create_taskcGst�dSr;rdrur&r&r'�call_soon_threadsafesz&AbstractEventLoop.call_soon_threadsafecGst�dSr;rd)r!�executor�funcr#r&r&r'�run_in_executorsz!AbstractEventLoop.run_in_executorcCst�dSr;rd)r!r~r&r&r'�set_default_executorsz&AbstractEventLoop.set_default_executorr)�family�type�proto�flagsc�st�dSr;rd)r!�host�portr�r�r�r�r&r&r'�getaddrinfo#szAbstractEventLoop.getaddrinfoc�st�dSr;rd)r!Zsockaddrr�r&r&r'�getnameinfo'szAbstractEventLoop.getnameinfo)
�sslr�r�r��sock�
local_addr�server_hostname�ssl_handshake_timeout�happy_eyeballs_delay�
interleavec
�st�dSr;rd)r!�protocol_factoryr�r�r�r�r�r�r�r�r�r�r�r�r&r&r'�create_connection*sz#AbstractEventLoop.create_connection�dT)	r�r�r��backlogr��
reuse_address�
reuse_portr�ric	
�st�dS)adA coroutine which creates a TCP server bound to host and port.

        The return value is a Server object which can be used to stop
        the service.

        If host is an empty string or None all interfaces are assumed
        and a list of multiple sockets will be returned (most likely
        one for IPv4 and another one for IPv6). The host parameter can also be
        a sequence (e.g. list) of hosts to bind to.

        family can be set to either AF_INET or AF_INET6 to force the
        socket to use IPv4 or IPv6. If not set it will be determined
        from host (defaults to AF_UNSPEC).

        flags is a bitmask for getaddrinfo().

        sock can optionally be specified in order to use a preexisting
        socket object.

        backlog is the maximum number of queued connections passed to
        listen() (defaults to 100).

        ssl can be set to an SSLContext to enable SSL over the
        accepted connections.

        reuse_address tells the kernel to reuse a local socket in
        TIME_WAIT state, without waiting for its natural timeout to
        expire. If not specified will automatically be set to True on
        UNIX.

        reuse_port tells the kernel to allow this endpoint to be bound to
        the same port as other existing endpoints are bound to, so long as
        they all set this flag when being created. This option is not
        supported on Windows.

        ssl_handshake_timeout is the time in seconds that an SSL server
        will wait for completion of the SSL handshake before aborting the
        connection. Default is 60s.

        start_serving set to True (default) causes the created server
        to start accepting connections immediately.  When set to False,
        the user should await Server.start_serving() or Server.serve_forever()
        to make the server to start accepting connections.
        Nrd)
r!r�r�r�r�r�r�r�r�r�r�r�rir&r&r'�
create_server3s3zAbstractEventLoop.create_server)�fallbackc�st�dS)zRSend a file through a transport.

        Return an amount of sent bytes.
        Nrd)r!�	transport�file�offset�countr�r&r&r'�sendfilehszAbstractEventLoop.sendfileF)�server_sider�r�c�st�dS)z|Upgrade a transport to TLS.

        Return a new transport that *protocol* should start using
        immediately.
        Nrd)r!r�ZprotocolZ
sslcontextr�r�r�r&r&r'�	start_tlsps	zAbstractEventLoop.start_tls)r�r�r�r�c�st�dSr;rd)r!r��pathr�r�r�r�r&r&r'�create_unix_connection{sz(AbstractEventLoop.create_unix_connection)r�r�r�r�ric�st�dS)a�A coroutine which creates a UNIX Domain Socket server.

        The return value is a Server object, which can be used to stop
        the service.

        path is a str, representing a file systsem path to bind the
        server socket to.

        sock can optionally be specified in order to use a preexisting
        socket object.

        backlog is the maximum number of queued connections passed to
        listen() (defaults to 100).

        ssl can be set to an SSLContext to enable SSL over the
        accepted connections.

        ssl_handshake_timeout is the time in seconds that an SSL server
        will wait for the SSL handshake to complete (defaults to 60s).

        start_serving set to True (default) causes the created server
        to start accepting connections immediately.  When set to False,
        the user should await Server.start_serving() or Server.serve_forever()
        to make the server to start accepting connections.
        Nrd)r!r�r�r�r�r�r�rir&r&r'�create_unix_server�sz$AbstractEventLoop.create_unix_server)r�r�r�r�r��allow_broadcastr�c�st�dS)a�A coroutine which creates a datagram endpoint.

        This method will try to establish the endpoint in the background.
        When successful, the coroutine returns a (transport, protocol) pair.

        protocol_factory must be a callable returning a protocol instance.

        socket family AF_INET, socket.AF_INET6 or socket.AF_UNIX depending on
        host (or family if specified), socket type SOCK_DGRAM.

        reuse_address tells the kernel to reuse a local socket in
        TIME_WAIT state, without waiting for its natural timeout to
        expire. If not specified it will automatically be set to True on
        UNIX.

        reuse_port tells the kernel to allow this endpoint to be bound to
        the same port as other existing endpoints are bound to, so long as
        they all set this flag when being created. This option is not
        supported on Windows and some UNIX's. If the
        :py:data:`~socket.SO_REUSEPORT` constant is not defined then this
        capability is unsupported.

        allow_broadcast tells the kernel to allow this endpoint to send
        messages to the broadcast address.

        sock can optionally be specified in order to use a preexisting
        socket object.
        Nrd)r!r�r�Zremote_addrr�r�r�r�r�r�r�r&r&r'�create_datagram_endpoint�s!z*AbstractEventLoop.create_datagram_endpointc�st�dS)aRegister read pipe in event loop. Set the pipe to non-blocking mode.

        protocol_factory should instantiate object with Protocol interface.
        pipe is a file-like object.
        Return pair (transport, protocol), where transport supports the
        ReadTransport interface.Nrd�r!r��piper&r&r'�connect_read_pipe�sz#AbstractEventLoop.connect_read_pipec�st�dS)aRegister write pipe in event loop.

        protocol_factory should instantiate object with BaseProtocol interface.
        Pipe is file-like object already switched to nonblocking.
        Return pair (transport, protocol), where transport support
        WriteTransport interface.Nrdr�r&r&r'�connect_write_pipe�sz$AbstractEventLoop.connect_write_pipe)�stdin�stdout�stderrc�st�dSr;rd)r!r��cmdr�r�r��kwargsr&r&r'�subprocess_shell�sz"AbstractEventLoop.subprocess_shellc�st�dSr;rd)r!r�r�r�r�r#r�r&r&r'�subprocess_exec�sz!AbstractEventLoop.subprocess_execcGst�dSr;rd�r!�fdr"r#r&r&r'�
add_reader�szAbstractEventLoop.add_readercCst�dSr;rd�r!r�r&r&r'�
remove_reader�szAbstractEventLoop.remove_readercGst�dSr;rdr�r&r&r'�
add_writer�szAbstractEventLoop.add_writercCst�dSr;rdr�r&r&r'�
remove_writer�szAbstractEventLoop.remove_writerc�st�dSr;rd)r!r��nbytesr&r&r'�	sock_recvszAbstractEventLoop.sock_recvc�st�dSr;rd)r!r�Zbufr&r&r'�sock_recv_intosz AbstractEventLoop.sock_recv_intoc�st�dSr;rd)r!r��datar&r&r'�sock_sendallszAbstractEventLoop.sock_sendallc�st�dSr;rd)r!r�Zaddressr&r&r'�sock_connectszAbstractEventLoop.sock_connectc�st�dSr;rd)r!r�r&r&r'�sock_acceptszAbstractEventLoop.sock_acceptc�st�dSr;rd)r!r�r�r�r�r�r&r&r'�
sock_sendfileszAbstractEventLoop.sock_sendfilecGst�dSr;rd)r!�sigr"r#r&r&r'�add_signal_handlersz$AbstractEventLoop.add_signal_handlercCst�dSr;rd)r!r�r&r&r'�remove_signal_handlersz'AbstractEventLoop.remove_signal_handlercCst�dSr;rd)r!�factoryr&r&r'�set_task_factorysz"AbstractEventLoop.set_task_factorycCst�dSr;rdr9r&r&r'�get_task_factory"sz"AbstractEventLoop.get_task_factorycCst�dSr;rdr9r&r&r'�get_exception_handler'sz'AbstractEventLoop.get_exception_handlercCst�dSr;rd)r!Zhandlerr&r&r'�set_exception_handler*sz'AbstractEventLoop.set_exception_handlercCst�dSr;rd�r!r%r&r&r'�default_exception_handler-sz+AbstractEventLoop.default_exception_handlercCst�dSr;rdr�r&r&r'rB0sz(AbstractEventLoop.call_exception_handlercCst�dSr;rdr9r&r&r'r5szAbstractEventLoop.get_debugcCst�dSr;rd)r!Zenabledr&r&r'�	set_debug8szAbstractEventLoop.set_debug)r)NN)NN)rN)N)N)NN)rN);r-rGrHrIrnrorprqrrrfrsrbrvrtrwrxryr|r}r�r�r�r�r��socketZ	AF_UNSPECZ
AI_PASSIVEr�r�r�r�r�r�r�r��
subprocess�PIPEr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rBrr�r&r&r&r'r�s��
��
��5�	�����!��%
���rc@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
rz-Abstract policy for accessing the event loop.cCst�dS)a:Get the event loop for the current context.

        Returns an event loop object implementing the BaseEventLoop interface,
        or raises an exception in case no event loop has been set for the
        current context and the current policy does not specify to create one.

        It should never return None.Nrdr9r&r&r'r?sz&AbstractEventLoopPolicy.get_event_loopcCst�dS)z3Set the event loop for the current context to loop.Nrd�r!r$r&r&r'r	Isz&AbstractEventLoopPolicy.set_event_loopcCst�dS)z�Create and return a new event loop object according to this
        policy's rules. If there's need to set this loop as the event loop for
        the current context, set_event_loop must be called explicitly.Nrdr9r&r&r'r
Msz&AbstractEventLoopPolicy.new_event_loopcCst�dS)z$Get the watcher for child processes.Nrdr9r&r&r'rUsz)AbstractEventLoopPolicy.get_child_watchercCst�dS)z$Set the watcher for child processes.Nrd)r!�watcherr&r&r'rYsz)AbstractEventLoopPolicy.set_child_watcherN)	r-rGrHrIrr	r
rrr&r&r&r'r<s
rc@sFeZdZdZdZGdd�dej�Zdd�Zdd�Z	d	d
�Z
dd�ZdS)
�BaseDefaultEventLoopPolicya�Default policy implementation for accessing the event loop.

    In this policy, each thread has its own event loop.  However, we
    only automatically create an event loop by default for the main
    thread; other threads by default have no event loop.

    Other policies may have different rules (e.g. a single global
    event loop, or automatically creating an event loop per thread, or
    using some other notion of context to which an event loop is
    associated).
    Nc@seZdZdZdZdS)z!BaseDefaultEventLoopPolicy._LocalNF)r-rGrHr�_set_calledr&r&r&r'�_Localmsr�cCs|��|_dSr;)r��_localr9r&r&r'r(qsz#BaseDefaultEventLoopPolicy.__init__cCsX|jjdkr2|jjs2tt��tj�r2|�|���|jjdkrPt	dt��j
��|jjS)zvGet the event loop for the current context.

        Returns an instance of EventLoop or raises an exception.
        Nz,There is no current event loop in thread %r.)r�rr�r_�	threadingZcurrent_threadZ_MainThreadr	r
�RuntimeErrorrzr9r&r&r'rts���z)BaseDefaultEventLoopPolicy.get_event_loopcCs*d|j_|dkst|t�st�||j_dS)zSet the event loop.TN)r�r�r_rrMrr�r&r&r'r	�sz)BaseDefaultEventLoopPolicy.set_event_loopcCs|��S)zvCreate a new event loop.

        You must call set_event_loop() to make this the current event
        loop.
        )�
_loop_factoryr9r&r&r'r
�sz)BaseDefaultEventLoopPolicy.new_event_loop)r-rGrHrIr�r��localr�r(rr	r
r&r&r&r'r�^sr�c@seZdZdZdS)�_RunningLoop)NNN)r-rGrH�loop_pidr&r&r&r'r��sr�cCst�}|dkrtd��|S)zrReturn the running event loop.  Raise a RuntimeError if there is none.

    This function is thread-specific.
    Nzno running event loop)rr��r$r&r&r'r�srcCs&tj\}}|dk	r"|t��kr"|SdS)z�Return the running event loop or None.

    This is a low-level function intended to be used by event loops.
    This function is thread-specific.
    N)�
_running_loopr��os�getpid)Zrunning_loop�pidr&r&r'r�s
rcCs|t��ft_dS)z�Set the running event loop.

    This is a low-level function intended to be used by event loops.
    This function is thread-specific.
    N)r�r�r�r�r�r&r&r'r
�sr
c	Cs.t� tdkr ddlm}|�aW5QRXdS)Nr��DefaultEventLoopPolicy)�_lock�_event_loop_policy�r�r�r&r&r'�_init_event_loop_policy�sr�cCstdkrt�tS)z"Get the current event loop policy.N)r�r�r&r&r&r'r�srcCs|dkst|t�st�|adS)zZSet the current event loop policy.

    If policy is None, the default policy is restored.N)r_rrMr�)Zpolicyr&r&r'r�srcCst�}|dk	r|St���S)aGReturn an asyncio event loop.

    When called from a coroutine or a callback (e.g. scheduled with call_soon
    or similar API), this function will always return the running event loop.

    If there is no running event loop set, the function will return
    the result of `get_event_loop_policy().get_event_loop()` call.
    N)rrr)Zcurrent_loopr&r&r'r�s
rcCst��|�dS)zCEquivalent to calling get_event_loop_policy().set_event_loop(loop).N)rr	r�r&r&r'r	�sr	cCs
t���S)z?Equivalent to calling get_event_loop_policy().new_event_loop().)rr
r&r&r&r'r
�sr
cCs
t���S)zBEquivalent to calling get_event_loop_policy().get_child_watcher().)rrr&r&r&r'r�srcCst��|�S)zMEquivalent to calling
    get_event_loop_policy().set_child_watcher(watcher).)rr)r�r&r&r'r�sr)rr
rr),rI�__all__rr�r�r�rr�r�rrrrrrrr�r�ZLockr�r�r�r�rrr
r�rrrr	r
rrZ_py__get_running_loopZ_py__set_running_loopZ_py_get_running_loopZ_py_get_event_loopZ_asyncio�ImportErrorZ_c__get_running_loopZ_c__set_running_loopZ_c_get_running_loopZ_c_get_event_loopr&r&r&r'�<module>sXJ@*q"9
	asyncio/__pycache__/staggered.cpython-38.opt-1.pyc000064400000007553151153537520015776 0ustar00U

e5dh�
@s�dZdZddlZddlZddlmZddlmZddlmZddlm	Z	dd	�ej
ejgejfej
eejejejej
eejej
efd
�dd�ZdS)
zFSupport for running coroutines in parallel with staggered start times.)�staggered_race�N�)�events)�
exceptions)�locks)�tasks)�loop)�coro_fns�delayr�returnc	�s��p
t���t|��d�d�g�g�tjtjdd���������fdd�����d��}��|�z<d}|t
��kr�t���IdH\}}t
|�}ql���fW�S�D]}|�	�q�XdS)a�Run coroutines with staggered start times and take the first to finish.

    This method takes an iterable of coroutine functions. The first one is
    started immediately. From then on, whenever the immediately preceding one
    fails (raises an exception), or when *delay* seconds has passed, the next
    coroutine is started. This continues until one of the coroutines complete
    successfully, in which case all others are cancelled, or until all
    coroutines fail.

    The coroutines provided should be well-behaved in the following way:

    * They should only ``return`` if completed successfully.

    * They should always raise an exception if they did not complete
      successfully. In particular, if they handle cancellation, they should
      probably reraise, like this::

        try:
            # do work
        except asyncio.CancelledError:
            # undo partially completed work
            raise

    Args:
        coro_fns: an iterable of coroutine functions, i.e. callables that
            return a coroutine object when called. Use ``functools.partial`` or
            lambdas to pass arguments.

        delay: amount of time, in seconds, between starting coroutines. If
            ``None``, the coroutines will run sequentially.

        loop: the event loop to use.

    Returns:
        tuple *(winner_result, winner_index, exceptions)* where

        - *winner_result*: the result of the winning coroutine, or ``None``
          if no coroutines won.

        - *winner_index*: the index of the winning coroutine in
          ``coro_fns``, or ``None`` if no coroutines won. If the winning
          coroutine may return None on success, *winner_index* can be used
          to definitively determine whether any coroutine won.

        - *exceptions*: list of exceptions returned by the coroutines.
          ``len(exceptions)`` is equal to the number of coroutines actually
          started, and the order is the same as in ``coro_fns``. The winning
          coroutine's entry is ``None``.

    N)�previous_failedrc	
�s|dk	r6t�tj��t�|����IdHW5QRXzt��\}}Wntk
r\YdSXt	�
�}���|��}��|���d�z|�IdH}WnJt
tfk
r��Yn\tk
r�}z|�|<|��W5d}~XYn,X|�|�t��D]\}}||kr�|��q�dS)N)�
contextlib�suppress�exceptions_mod�TimeoutErrorrZwait_for�wait�next�
StopIterationr�Event�create_task�append�
SystemExit�KeyboardInterrupt�
BaseException�set�	enumerate�cancel)	rZ
this_indexZcoro_fnZthis_failedZ	next_task�result�e�i�t�r
Z
enum_coro_fnsrr�run_one_coroZ
running_tasksZwinner_indexZ
winner_result��)/usr/lib64/python3.8/asyncio/staggered.pyr"Rs. 

z$staggered_race.<locals>.run_one_coror)
rZget_running_loopr�typing�Optionalrrrrr�lenrr)r	r
rZ
first_taskr Z
done_countZdone�_r#r!r$rs(=
�0
r)�__doc__�__all__r
r%�rrrrr�Iterable�Callable�	Awaitabler&�floatZAbstractEventLoopZTupleZAny�intZList�	Exceptionrr#r#r#r$�<module>s&����asyncio/tasks.py000064400000102203151153537520007715 0ustar00"""Support for tasks, coroutines and the scheduler."""

__all__ = (
    'Task', 'create_task',
    'FIRST_COMPLETED', 'FIRST_EXCEPTION', 'ALL_COMPLETED',
    'wait', 'wait_for', 'as_completed', 'sleep',
    'gather', 'shield', 'ensure_future', 'run_coroutine_threadsafe',
    'current_task', 'all_tasks',
    '_register_task', '_unregister_task', '_enter_task', '_leave_task',
)

import concurrent.futures
import contextvars
import functools
import inspect
import itertools
import types
import warnings
import weakref

from . import base_tasks
from . import coroutines
from . import events
from . import exceptions
from . import futures
from .coroutines import _is_coroutine

# Helper to generate new task names
# This uses itertools.count() instead of a "+= 1" operation because the latter
# is not thread safe. See bpo-11866 for a longer explanation.
_task_name_counter = itertools.count(1).__next__


def current_task(loop=None):
    """Return a currently executed task."""
    if loop is None:
        loop = events.get_running_loop()
    return _current_tasks.get(loop)


def all_tasks(loop=None):
    """Return a set of all tasks for the loop."""
    if loop is None:
        loop = events.get_running_loop()
    # Looping over a WeakSet (_all_tasks) isn't safe as it can be updated from another
    # thread while we do so. Therefore we cast it to list prior to filtering. The list
    # cast itself requires iteration, so we repeat it several times ignoring
    # RuntimeErrors (which are not very likely to occur). See issues 34970 and 36607 for
    # details.
    i = 0
    while True:
        try:
            tasks = list(_all_tasks)
        except RuntimeError:
            i += 1
            if i >= 1000:
                raise
        else:
            break
    return {t for t in tasks
            if futures._get_loop(t) is loop and not t.done()}


def _all_tasks_compat(loop=None):
    # Different from "all_task()" by returning *all* Tasks, including
    # the completed ones.  Used to implement deprecated "Tasks.all_task()"
    # method.
    if loop is None:
        loop = events.get_event_loop()
    # Looping over a WeakSet (_all_tasks) isn't safe as it can be updated from another
    # thread while we do so. Therefore we cast it to list prior to filtering. The list
    # cast itself requires iteration, so we repeat it several times ignoring
    # RuntimeErrors (which are not very likely to occur). See issues 34970 and 36607 for
    # details.
    i = 0
    while True:
        try:
            tasks = list(_all_tasks)
        except RuntimeError:
            i += 1
            if i >= 1000:
                raise
        else:
            break
    return {t for t in tasks if futures._get_loop(t) is loop}


def _set_task_name(task, name):
    if name is not None:
        try:
            set_name = task.set_name
        except AttributeError:
            pass
        else:
            set_name(name)


class Task(futures._PyFuture):  # Inherit Python Task implementation
                                # from a Python Future implementation.

    """A coroutine wrapped in a Future."""

    # An important invariant maintained while a Task not done:
    #
    # - Either _fut_waiter is None, and _step() is scheduled;
    # - or _fut_waiter is some Future, and _step() is *not* scheduled.
    #
    # The only transition from the latter to the former is through
    # _wakeup().  When _fut_waiter is not None, one of its callbacks
    # must be _wakeup().

    # If False, don't log a message if the task is destroyed whereas its
    # status is still pending
    _log_destroy_pending = True

    @classmethod
    def current_task(cls, loop=None):
        """Return the currently running task in an event loop or None.

        By default the current task for the current event loop is returned.

        None is returned when called not in the context of a Task.
        """
        warnings.warn("Task.current_task() is deprecated since Python 3.7, "
                      "use asyncio.current_task() instead",
                      DeprecationWarning,
                      stacklevel=2)
        if loop is None:
            loop = events.get_event_loop()
        return current_task(loop)

    @classmethod
    def all_tasks(cls, loop=None):
        """Return a set of all tasks for an event loop.

        By default all tasks for the current event loop are returned.
        """
        warnings.warn("Task.all_tasks() is deprecated since Python 3.7, "
                      "use asyncio.all_tasks() instead",
                      DeprecationWarning,
                      stacklevel=2)
        return _all_tasks_compat(loop)

    def __init__(self, coro, *, loop=None, name=None):
        super().__init__(loop=loop)
        if self._source_traceback:
            del self._source_traceback[-1]
        if not coroutines.iscoroutine(coro):
            # raise after Future.__init__(), attrs are required for __del__
            # prevent logging for pending task in __del__
            self._log_destroy_pending = False
            raise TypeError(f"a coroutine was expected, got {coro!r}")

        if name is None:
            self._name = f'Task-{_task_name_counter()}'
        else:
            self._name = str(name)

        self._must_cancel = False
        self._fut_waiter = None
        self._coro = coro
        self._context = contextvars.copy_context()

        self._loop.call_soon(self.__step, context=self._context)
        _register_task(self)

    def __del__(self):
        if self._state == futures._PENDING and self._log_destroy_pending:
            context = {
                'task': self,
                'message': 'Task was destroyed but it is pending!',
            }
            if self._source_traceback:
                context['source_traceback'] = self._source_traceback
            self._loop.call_exception_handler(context)
        super().__del__()

    def _repr_info(self):
        return base_tasks._task_repr_info(self)

    def get_coro(self):
        return self._coro

    def get_name(self):
        return self._name

    def set_name(self, value):
        self._name = str(value)

    def set_result(self, result):
        raise RuntimeError('Task does not support set_result operation')

    def set_exception(self, exception):
        raise RuntimeError('Task does not support set_exception operation')

    def get_stack(self, *, limit=None):
        """Return the list of stack frames for this task's coroutine.

        If the coroutine is not done, this returns the stack where it is
        suspended.  If the coroutine has completed successfully or was
        cancelled, this returns an empty list.  If the coroutine was
        terminated by an exception, this returns the list of traceback
        frames.

        The frames are always ordered from oldest to newest.

        The optional limit gives the maximum number of frames to
        return; by default all available frames are returned.  Its
        meaning differs depending on whether a stack or a traceback is
        returned: the newest frames of a stack are returned, but the
        oldest frames of a traceback are returned.  (This matches the
        behavior of the traceback module.)

        For reasons beyond our control, only one stack frame is
        returned for a suspended coroutine.
        """
        return base_tasks._task_get_stack(self, limit)

    def print_stack(self, *, limit=None, file=None):
        """Print the stack or traceback for this task's coroutine.

        This produces output similar to that of the traceback module,
        for the frames retrieved by get_stack().  The limit argument
        is passed to get_stack().  The file argument is an I/O stream
        to which the output is written; by default output is written
        to sys.stderr.
        """
        return base_tasks._task_print_stack(self, limit, file)

    def cancel(self):
        """Request that this task cancel itself.

        This arranges for a CancelledError to be thrown into the
        wrapped coroutine on the next cycle through the event loop.
        The coroutine then has a chance to clean up or even deny
        the request using try/except/finally.

        Unlike Future.cancel, this does not guarantee that the
        task will be cancelled: the exception might be caught and
        acted upon, delaying cancellation of the task or preventing
        cancellation completely.  The task may also return a value or
        raise a different exception.

        Immediately after this method is called, Task.cancelled() will
        not return True (unless the task was already cancelled).  A
        task will be marked as cancelled when the wrapped coroutine
        terminates with a CancelledError exception (even if cancel()
        was not called).
        """
        self._log_traceback = False
        if self.done():
            return False
        if self._fut_waiter is not None:
            if self._fut_waiter.cancel():
                # Leave self._fut_waiter; it may be a Task that
                # catches and ignores the cancellation so we may have
                # to cancel it again later.
                return True
        # It must be the case that self.__step is already scheduled.
        self._must_cancel = True
        return True

    def __step(self, exc=None):
        if self.done():
            raise exceptions.InvalidStateError(
                f'_step(): already done: {self!r}, {exc!r}')
        if self._must_cancel:
            if not isinstance(exc, exceptions.CancelledError):
                exc = exceptions.CancelledError()
            self._must_cancel = False
        coro = self._coro
        self._fut_waiter = None

        _enter_task(self._loop, self)
        # Call either coro.throw(exc) or coro.send(None).
        try:
            if exc is None:
                # We use the `send` method directly, because coroutines
                # don't have `__iter__` and `__next__` methods.
                result = coro.send(None)
            else:
                result = coro.throw(exc)
        except StopIteration as exc:
            if self._must_cancel:
                # Task is cancelled right before coro stops.
                self._must_cancel = False
                super().cancel()
            else:
                super().set_result(exc.value)
        except exceptions.CancelledError:
            super().cancel()  # I.e., Future.cancel(self).
        except (KeyboardInterrupt, SystemExit) as exc:
            super().set_exception(exc)
            raise
        except BaseException as exc:
            super().set_exception(exc)
        else:
            blocking = getattr(result, '_asyncio_future_blocking', None)
            if blocking is not None:
                # Yielded Future must come from Future.__iter__().
                if futures._get_loop(result) is not self._loop:
                    new_exc = RuntimeError(
                        f'Task {self!r} got Future '
                        f'{result!r} attached to a different loop')
                    self._loop.call_soon(
                        self.__step, new_exc, context=self._context)
                elif blocking:
                    if result is self:
                        new_exc = RuntimeError(
                            f'Task cannot await on itself: {self!r}')
                        self._loop.call_soon(
                            self.__step, new_exc, context=self._context)
                    else:
                        result._asyncio_future_blocking = False
                        result.add_done_callback(
                            self.__wakeup, context=self._context)
                        self._fut_waiter = result
                        if self._must_cancel:
                            if self._fut_waiter.cancel():
                                self._must_cancel = False
                else:
                    new_exc = RuntimeError(
                        f'yield was used instead of yield from '
                        f'in task {self!r} with {result!r}')
                    self._loop.call_soon(
                        self.__step, new_exc, context=self._context)

            elif result is None:
                # Bare yield relinquishes control for one event loop iteration.
                self._loop.call_soon(self.__step, context=self._context)
            elif inspect.isgenerator(result):
                # Yielding a generator is just wrong.
                new_exc = RuntimeError(
                    f'yield was used instead of yield from for '
                    f'generator in task {self!r} with {result!r}')
                self._loop.call_soon(
                    self.__step, new_exc, context=self._context)
            else:
                # Yielding something else is an error.
                new_exc = RuntimeError(f'Task got bad yield: {result!r}')
                self._loop.call_soon(
                    self.__step, new_exc, context=self._context)
        finally:
            _leave_task(self._loop, self)
            self = None  # Needed to break cycles when an exception occurs.

    def __wakeup(self, future):
        try:
            future.result()
        except BaseException as exc:
            # This may also be a cancellation.
            self.__step(exc)
        else:
            # Don't pass the value of `future.result()` explicitly,
            # as `Future.__iter__` and `Future.__await__` don't need it.
            # If we call `_step(value, None)` instead of `_step()`,
            # Python eval loop would use `.send(value)` method call,
            # instead of `__next__()`, which is slower for futures
            # that return non-generator iterators from their `__iter__`.
            self.__step()
        self = None  # Needed to break cycles when an exception occurs.


_PyTask = Task


try:
    import _asyncio
except ImportError:
    pass
else:
    # _CTask is needed for tests.
    Task = _CTask = _asyncio.Task


def create_task(coro, *, name=None):
    """Schedule the execution of a coroutine object in a spawn task.

    Return a Task object.
    """
    loop = events.get_running_loop()
    task = loop.create_task(coro)
    _set_task_name(task, name)
    return task


# wait() and as_completed() similar to those in PEP 3148.

FIRST_COMPLETED = concurrent.futures.FIRST_COMPLETED
FIRST_EXCEPTION = concurrent.futures.FIRST_EXCEPTION
ALL_COMPLETED = concurrent.futures.ALL_COMPLETED


async def wait(fs, *, loop=None, timeout=None, return_when=ALL_COMPLETED):
    """Wait for the Futures and coroutines given by fs to complete.

    The fs iterable must not be empty.

    Coroutines will be wrapped in Tasks.

    Returns two sets of Future: (done, pending).

    Usage:

        done, pending = await asyncio.wait(fs)

    Note: This does not raise TimeoutError! Futures that aren't done
    when the timeout occurs are returned in the second set.
    """
    if futures.isfuture(fs) or coroutines.iscoroutine(fs):
        raise TypeError(f"expect a list of futures, not {type(fs).__name__}")
    if not fs:
        raise ValueError('Set of coroutines/Futures is empty.')
    if return_when not in (FIRST_COMPLETED, FIRST_EXCEPTION, ALL_COMPLETED):
        raise ValueError(f'Invalid return_when value: {return_when}')

    if loop is None:
        loop = events.get_running_loop()
    else:
        warnings.warn("The loop argument is deprecated since Python 3.8, "
                      "and scheduled for removal in Python 3.10.",
                      DeprecationWarning, stacklevel=2)

    fs = {ensure_future(f, loop=loop) for f in set(fs)}

    return await _wait(fs, timeout, return_when, loop)


def _release_waiter(waiter, *args):
    if not waiter.done():
        waiter.set_result(None)


async def wait_for(fut, timeout, *, loop=None):
    """Wait for the single Future or coroutine to complete, with timeout.

    Coroutine will be wrapped in Task.

    Returns result of the Future or coroutine.  When a timeout occurs,
    it cancels the task and raises TimeoutError.  To avoid the task
    cancellation, wrap it in shield().

    If the wait is cancelled, the task is also cancelled.

    This function is a coroutine.
    """
    if loop is None:
        loop = events.get_running_loop()
    else:
        warnings.warn("The loop argument is deprecated since Python 3.8, "
                      "and scheduled for removal in Python 3.10.",
                      DeprecationWarning, stacklevel=2)

    if timeout is None:
        return await fut

    if timeout <= 0:
        fut = ensure_future(fut, loop=loop)

        if fut.done():
            return fut.result()

        await _cancel_and_wait(fut, loop=loop)
        try:
            fut.result()
        except exceptions.CancelledError as exc:
            raise exceptions.TimeoutError() from exc
        else:
            raise exceptions.TimeoutError()

    waiter = loop.create_future()
    timeout_handle = loop.call_later(timeout, _release_waiter, waiter)
    cb = functools.partial(_release_waiter, waiter)

    fut = ensure_future(fut, loop=loop)
    fut.add_done_callback(cb)

    try:
        # wait until the future completes or the timeout
        try:
            await waiter
        except exceptions.CancelledError:
            if fut.done():
                return fut.result()
            else:
                fut.remove_done_callback(cb)
                # We must ensure that the task is not running
                # after wait_for() returns.
                # See https://bugs.python.org/issue32751
                await _cancel_and_wait(fut, loop=loop)
                raise

        if fut.done():
            return fut.result()
        else:
            fut.remove_done_callback(cb)
            # We must ensure that the task is not running
            # after wait_for() returns.
            # See https://bugs.python.org/issue32751
            await _cancel_and_wait(fut, loop=loop)
            raise exceptions.TimeoutError()
    finally:
        timeout_handle.cancel()


async def _wait(fs, timeout, return_when, loop):
    """Internal helper for wait().

    The fs argument must be a collection of Futures.
    """
    assert fs, 'Set of Futures is empty.'
    waiter = loop.create_future()
    timeout_handle = None
    if timeout is not None:
        timeout_handle = loop.call_later(timeout, _release_waiter, waiter)
    counter = len(fs)

    def _on_completion(f):
        nonlocal counter
        counter -= 1
        if (counter <= 0 or
            return_when == FIRST_COMPLETED or
            return_when == FIRST_EXCEPTION and (not f.cancelled() and
                                                f.exception() is not None)):
            if timeout_handle is not None:
                timeout_handle.cancel()
            if not waiter.done():
                waiter.set_result(None)

    for f in fs:
        f.add_done_callback(_on_completion)

    try:
        await waiter
    finally:
        if timeout_handle is not None:
            timeout_handle.cancel()
        for f in fs:
            f.remove_done_callback(_on_completion)

    done, pending = set(), set()
    for f in fs:
        if f.done():
            done.add(f)
        else:
            pending.add(f)
    return done, pending


async def _cancel_and_wait(fut, loop):
    """Cancel the *fut* future or task and wait until it completes."""

    waiter = loop.create_future()
    cb = functools.partial(_release_waiter, waiter)
    fut.add_done_callback(cb)

    try:
        fut.cancel()
        # We cannot wait on *fut* directly to make
        # sure _cancel_and_wait itself is reliably cancellable.
        await waiter
    finally:
        fut.remove_done_callback(cb)


# This is *not* a @coroutine!  It is just an iterator (yielding Futures).
def as_completed(fs, *, loop=None, timeout=None):
    """Return an iterator whose values are coroutines.

    When waiting for the yielded coroutines you'll get the results (or
    exceptions!) of the original Futures (or coroutines), in the order
    in which and as soon as they complete.

    This differs from PEP 3148; the proper way to use this is:

        for f in as_completed(fs):
            result = await f  # The 'await' may raise.
            # Use result.

    If a timeout is specified, the 'await' will raise
    TimeoutError when the timeout occurs before all Futures are done.

    Note: The futures 'f' are not necessarily members of fs.
    """
    if futures.isfuture(fs) or coroutines.iscoroutine(fs):
        raise TypeError(f"expect an iterable of futures, not {type(fs).__name__}")

    from .queues import Queue  # Import here to avoid circular import problem.
    done = Queue(loop=loop)

    if loop is None:
        loop = events.get_event_loop()
    else:
        warnings.warn("The loop argument is deprecated since Python 3.8, "
                      "and scheduled for removal in Python 3.10.",
                      DeprecationWarning, stacklevel=2)
    todo = {ensure_future(f, loop=loop) for f in set(fs)}
    timeout_handle = None

    def _on_timeout():
        for f in todo:
            f.remove_done_callback(_on_completion)
            done.put_nowait(None)  # Queue a dummy value for _wait_for_one().
        todo.clear()  # Can't do todo.remove(f) in the loop.

    def _on_completion(f):
        if not todo:
            return  # _on_timeout() was here first.
        todo.remove(f)
        done.put_nowait(f)
        if not todo and timeout_handle is not None:
            timeout_handle.cancel()

    async def _wait_for_one():
        f = await done.get()
        if f is None:
            # Dummy value from _on_timeout().
            raise exceptions.TimeoutError
        return f.result()  # May raise f.exception().

    for f in todo:
        f.add_done_callback(_on_completion)
    if todo and timeout is not None:
        timeout_handle = loop.call_later(timeout, _on_timeout)
    for _ in range(len(todo)):
        yield _wait_for_one()


@types.coroutine
def __sleep0():
    """Skip one event loop run cycle.

    This is a private helper for 'asyncio.sleep()', used
    when the 'delay' is set to 0.  It uses a bare 'yield'
    expression (which Task.__step knows how to handle)
    instead of creating a Future object.
    """
    yield


async def sleep(delay, result=None, *, loop=None):
    """Coroutine that completes after a given time (in seconds)."""
    if delay <= 0:
        await __sleep0()
        return result

    if loop is None:
        loop = events.get_running_loop()
    else:
        warnings.warn("The loop argument is deprecated since Python 3.8, "
                      "and scheduled for removal in Python 3.10.",
                      DeprecationWarning, stacklevel=2)

    future = loop.create_future()
    h = loop.call_later(delay,
                        futures._set_result_unless_cancelled,
                        future, result)
    try:
        return await future
    finally:
        h.cancel()


def ensure_future(coro_or_future, *, loop=None):
    """Wrap a coroutine or an awaitable in a future.

    If the argument is a Future, it is returned directly.
    """
    if coroutines.iscoroutine(coro_or_future):
        if loop is None:
            loop = events.get_event_loop()
        task = loop.create_task(coro_or_future)
        if task._source_traceback:
            del task._source_traceback[-1]
        return task
    elif futures.isfuture(coro_or_future):
        if loop is not None and loop is not futures._get_loop(coro_or_future):
            raise ValueError('The future belongs to a different loop than '
                             'the one specified as the loop argument')
        return coro_or_future
    elif inspect.isawaitable(coro_or_future):
        return ensure_future(_wrap_awaitable(coro_or_future), loop=loop)
    else:
        raise TypeError('An asyncio.Future, a coroutine or an awaitable is '
                        'required')


@types.coroutine
def _wrap_awaitable(awaitable):
    """Helper for asyncio.ensure_future().

    Wraps awaitable (an object with __await__) into a coroutine
    that will later be wrapped in a Task by ensure_future().
    """
    return (yield from awaitable.__await__())

_wrap_awaitable._is_coroutine = _is_coroutine


class _GatheringFuture(futures.Future):
    """Helper for gather().

    This overrides cancel() to cancel all the children and act more
    like Task.cancel(), which doesn't immediately mark itself as
    cancelled.
    """

    def __init__(self, children, *, loop=None):
        super().__init__(loop=loop)
        self._children = children
        self._cancel_requested = False

    def cancel(self):
        if self.done():
            return False
        ret = False
        for child in self._children:
            if child.cancel():
                ret = True
        if ret:
            # If any child tasks were actually cancelled, we should
            # propagate the cancellation request regardless of
            # *return_exceptions* argument.  See issue 32684.
            self._cancel_requested = True
        return ret


def gather(*coros_or_futures, loop=None, return_exceptions=False):
    """Return a future aggregating results from the given coroutines/futures.

    Coroutines will be wrapped in a future and scheduled in the event
    loop. They will not necessarily be scheduled in the same order as
    passed in.

    All futures must share the same event loop.  If all the tasks are
    done successfully, the returned future's result is the list of
    results (in the order of the original sequence, not necessarily
    the order of results arrival).  If *return_exceptions* is True,
    exceptions in the tasks are treated the same as successful
    results, and gathered in the result list; otherwise, the first
    raised exception will be immediately propagated to the returned
    future.

    Cancellation: if the outer Future is cancelled, all children (that
    have not completed yet) are also cancelled.  If any child is
    cancelled, this is treated as if it raised CancelledError --
    the outer Future is *not* cancelled in this case.  (This is to
    prevent the cancellation of one child to cause other children to
    be cancelled.)

    If *return_exceptions* is False, cancelling gather() after it
    has been marked done won't cancel any submitted awaitables.
    For instance, gather can be marked done after propagating an
    exception to the caller, therefore, calling ``gather.cancel()``
    after catching an exception (raised by one of the awaitables) from
    gather won't cancel any other awaitables.
    """
    if not coros_or_futures:
        if loop is None:
            loop = events.get_event_loop()
        else:
            warnings.warn("The loop argument is deprecated since Python 3.8, "
                          "and scheduled for removal in Python 3.10.",
                          DeprecationWarning, stacklevel=2)
        outer = loop.create_future()
        outer.set_result([])
        return outer

    def _done_callback(fut):
        nonlocal nfinished
        nfinished += 1

        if outer.done():
            if not fut.cancelled():
                # Mark exception retrieved.
                fut.exception()
            return

        if not return_exceptions:
            if fut.cancelled():
                # Check if 'fut' is cancelled first, as
                # 'fut.exception()' will *raise* a CancelledError
                # instead of returning it.
                exc = exceptions.CancelledError()
                outer.set_exception(exc)
                return
            else:
                exc = fut.exception()
                if exc is not None:
                    outer.set_exception(exc)
                    return

        if nfinished == nfuts:
            # All futures are done; create a list of results
            # and set it to the 'outer' future.
            results = []

            for fut in children:
                if fut.cancelled():
                    # Check if 'fut' is cancelled first, as
                    # 'fut.exception()' will *raise* a CancelledError
                    # instead of returning it.
                    res = exceptions.CancelledError()
                else:
                    res = fut.exception()
                    if res is None:
                        res = fut.result()
                results.append(res)

            if outer._cancel_requested:
                # If gather is being cancelled we must propagate the
                # cancellation regardless of *return_exceptions* argument.
                # See issue 32684.
                outer.set_exception(exceptions.CancelledError())
            else:
                outer.set_result(results)

    arg_to_fut = {}
    children = []
    nfuts = 0
    nfinished = 0
    for arg in coros_or_futures:
        if arg not in arg_to_fut:
            fut = ensure_future(arg, loop=loop)
            if loop is None:
                loop = futures._get_loop(fut)
            if fut is not arg:
                # 'arg' was not a Future, therefore, 'fut' is a new
                # Future created specifically for 'arg'.  Since the caller
                # can't control it, disable the "destroy pending task"
                # warning.
                fut._log_destroy_pending = False

            nfuts += 1
            arg_to_fut[arg] = fut
            fut.add_done_callback(_done_callback)

        else:
            # There's a duplicate Future object in coros_or_futures.
            fut = arg_to_fut[arg]

        children.append(fut)

    outer = _GatheringFuture(children, loop=loop)
    return outer


def shield(arg, *, loop=None):
    """Wait for a future, shielding it from cancellation.

    The statement

        res = await shield(something())

    is exactly equivalent to the statement

        res = await something()

    *except* that if the coroutine containing it is cancelled, the
    task running in something() is not cancelled.  From the POV of
    something(), the cancellation did not happen.  But its caller is
    still cancelled, so the yield-from expression still raises
    CancelledError.  Note: If something() is cancelled by other means
    this will still cancel shield().

    If you want to completely ignore cancellation (not recommended)
    you can combine shield() with a try/except clause, as follows:

        try:
            res = await shield(something())
        except CancelledError:
            res = None
    """
    if loop is not None:
        warnings.warn("The loop argument is deprecated since Python 3.8, "
                      "and scheduled for removal in Python 3.10.",
                      DeprecationWarning, stacklevel=2)
    inner = ensure_future(arg, loop=loop)
    if inner.done():
        # Shortcut.
        return inner
    loop = futures._get_loop(inner)
    outer = loop.create_future()

    def _inner_done_callback(inner):
        if outer.cancelled():
            if not inner.cancelled():
                # Mark inner's result as retrieved.
                inner.exception()
            return

        if inner.cancelled():
            outer.cancel()
        else:
            exc = inner.exception()
            if exc is not None:
                outer.set_exception(exc)
            else:
                outer.set_result(inner.result())


    def _outer_done_callback(outer):
        if not inner.done():
            inner.remove_done_callback(_inner_done_callback)

    inner.add_done_callback(_inner_done_callback)
    outer.add_done_callback(_outer_done_callback)
    return outer


def run_coroutine_threadsafe(coro, loop):
    """Submit a coroutine object to a given event loop.

    Return a concurrent.futures.Future to access the result.
    """
    if not coroutines.iscoroutine(coro):
        raise TypeError('A coroutine object is required')
    future = concurrent.futures.Future()

    def callback():
        try:
            futures._chain_future(ensure_future(coro, loop=loop), future)
        except (SystemExit, KeyboardInterrupt):
            raise
        except BaseException as exc:
            if future.set_running_or_notify_cancel():
                future.set_exception(exc)
            raise

    loop.call_soon_threadsafe(callback)
    return future


# WeakSet containing all alive tasks.
_all_tasks = weakref.WeakSet()

# Dictionary containing tasks that are currently active in
# all running event loops.  {EventLoop: Task}
_current_tasks = {}


def _register_task(task):
    """Register a new task in asyncio as executed by loop."""
    _all_tasks.add(task)


def _enter_task(loop, task):
    current_task = _current_tasks.get(loop)
    if current_task is not None:
        raise RuntimeError(f"Cannot enter into task {task!r} while another "
                           f"task {current_task!r} is being executed.")
    _current_tasks[loop] = task


def _leave_task(loop, task):
    current_task = _current_tasks.get(loop)
    if current_task is not task:
        raise RuntimeError(f"Leaving task {task!r} does not match "
                           f"the current task {current_task!r}.")
    del _current_tasks[loop]


def _unregister_task(task):
    """Unregister a task."""
    _all_tasks.discard(task)


_py_register_task = _register_task
_py_unregister_task = _unregister_task
_py_enter_task = _enter_task
_py_leave_task = _leave_task


try:
    from _asyncio import (_register_task, _unregister_task,
                          _enter_task, _leave_task,
                          _all_tasks, _current_tasks)
except ImportError:
    pass
else:
    _c_register_task = _register_task
    _c_unregister_task = _unregister_task
    _c_enter_task = _enter_task
    _c_leave_task = _leave_task
asyncio/events.py000064400000063064151153537520010107 0ustar00"""Event loop and event loop policy."""

__all__ = (
    'AbstractEventLoopPolicy',
    'AbstractEventLoop', 'AbstractServer',
    'Handle', 'TimerHandle',
    'get_event_loop_policy', 'set_event_loop_policy',
    'get_event_loop', 'set_event_loop', 'new_event_loop',
    'get_child_watcher', 'set_child_watcher',
    '_set_running_loop', 'get_running_loop',
    '_get_running_loop',
)

import contextvars
import os
import socket
import subprocess
import sys
import threading

from . import format_helpers
from . import exceptions


class Handle:
    """Object returned by callback registration methods."""

    __slots__ = ('_callback', '_args', '_cancelled', '_loop',
                 '_source_traceback', '_repr', '__weakref__',
                 '_context')

    def __init__(self, callback, args, loop, context=None):
        if context is None:
            context = contextvars.copy_context()
        self._context = context
        self._loop = loop
        self._callback = callback
        self._args = args
        self._cancelled = False
        self._repr = None
        if self._loop.get_debug():
            self._source_traceback = format_helpers.extract_stack(
                sys._getframe(1))
        else:
            self._source_traceback = None

    def _repr_info(self):
        info = [self.__class__.__name__]
        if self._cancelled:
            info.append('cancelled')
        if self._callback is not None:
            info.append(format_helpers._format_callback_source(
                self._callback, self._args))
        if self._source_traceback:
            frame = self._source_traceback[-1]
            info.append(f'created at {frame[0]}:{frame[1]}')
        return info

    def __repr__(self):
        if self._repr is not None:
            return self._repr
        info = self._repr_info()
        return '<{}>'.format(' '.join(info))

    def cancel(self):
        if not self._cancelled:
            self._cancelled = True
            if self._loop.get_debug():
                # Keep a representation in debug mode to keep callback and
                # parameters. For example, to log the warning
                # "Executing <Handle...> took 2.5 second"
                self._repr = repr(self)
            self._callback = None
            self._args = None

    def cancelled(self):
        return self._cancelled

    def _run(self):
        try:
            self._context.run(self._callback, *self._args)
        except (SystemExit, KeyboardInterrupt):
            raise
        except BaseException as exc:
            cb = format_helpers._format_callback_source(
                self._callback, self._args)
            msg = f'Exception in callback {cb}'
            context = {
                'message': msg,
                'exception': exc,
                'handle': self,
            }
            if self._source_traceback:
                context['source_traceback'] = self._source_traceback
            self._loop.call_exception_handler(context)
        self = None  # Needed to break cycles when an exception occurs.


class TimerHandle(Handle):
    """Object returned by timed callback registration methods."""

    __slots__ = ['_scheduled', '_when']

    def __init__(self, when, callback, args, loop, context=None):
        assert when is not None
        super().__init__(callback, args, loop, context)
        if self._source_traceback:
            del self._source_traceback[-1]
        self._when = when
        self._scheduled = False

    def _repr_info(self):
        info = super()._repr_info()
        pos = 2 if self._cancelled else 1
        info.insert(pos, f'when={self._when}')
        return info

    def __hash__(self):
        return hash(self._when)

    def __lt__(self, other):
        return self._when < other._when

    def __le__(self, other):
        if self._when < other._when:
            return True
        return self.__eq__(other)

    def __gt__(self, other):
        return self._when > other._when

    def __ge__(self, other):
        if self._when > other._when:
            return True
        return self.__eq__(other)

    def __eq__(self, other):
        if isinstance(other, TimerHandle):
            return (self._when == other._when and
                    self._callback == other._callback and
                    self._args == other._args and
                    self._cancelled == other._cancelled)
        return NotImplemented

    def __ne__(self, other):
        equal = self.__eq__(other)
        return NotImplemented if equal is NotImplemented else not equal

    def cancel(self):
        if not self._cancelled:
            self._loop._timer_handle_cancelled(self)
        super().cancel()

    def when(self):
        """Return a scheduled callback time.

        The time is an absolute timestamp, using the same time
        reference as loop.time().
        """
        return self._when


class AbstractServer:
    """Abstract server returned by create_server()."""

    def close(self):
        """Stop serving.  This leaves existing connections open."""
        raise NotImplementedError

    def get_loop(self):
        """Get the event loop the Server object is attached to."""
        raise NotImplementedError

    def is_serving(self):
        """Return True if the server is accepting connections."""
        raise NotImplementedError

    async def start_serving(self):
        """Start accepting connections.

        This method is idempotent, so it can be called when
        the server is already being serving.
        """
        raise NotImplementedError

    async def serve_forever(self):
        """Start accepting connections until the coroutine is cancelled.

        The server is closed when the coroutine is cancelled.
        """
        raise NotImplementedError

    async def wait_closed(self):
        """Coroutine to wait until service is closed."""
        raise NotImplementedError

    async def __aenter__(self):
        return self

    async def __aexit__(self, *exc):
        self.close()
        await self.wait_closed()


class AbstractEventLoop:
    """Abstract event loop."""

    # Running and stopping the event loop.

    def run_forever(self):
        """Run the event loop until stop() is called."""
        raise NotImplementedError

    def run_until_complete(self, future):
        """Run the event loop until a Future is done.

        Return the Future's result, or raise its exception.
        """
        raise NotImplementedError

    def stop(self):
        """Stop the event loop as soon as reasonable.

        Exactly how soon that is may depend on the implementation, but
        no more I/O callbacks should be scheduled.
        """
        raise NotImplementedError

    def is_running(self):
        """Return whether the event loop is currently running."""
        raise NotImplementedError

    def is_closed(self):
        """Returns True if the event loop was closed."""
        raise NotImplementedError

    def close(self):
        """Close the loop.

        The loop should not be running.

        This is idempotent and irreversible.

        No other methods should be called after this one.
        """
        raise NotImplementedError

    async def shutdown_asyncgens(self):
        """Shutdown all active asynchronous generators."""
        raise NotImplementedError

    # Methods scheduling callbacks.  All these return Handles.

    def _timer_handle_cancelled(self, handle):
        """Notification that a TimerHandle has been cancelled."""
        raise NotImplementedError

    def call_soon(self, callback, *args):
        return self.call_later(0, callback, *args)

    def call_later(self, delay, callback, *args):
        raise NotImplementedError

    def call_at(self, when, callback, *args):
        raise NotImplementedError

    def time(self):
        raise NotImplementedError

    def create_future(self):
        raise NotImplementedError

    # Method scheduling a coroutine object: create a task.

    def create_task(self, coro, *, name=None):
        raise NotImplementedError

    # Methods for interacting with threads.

    def call_soon_threadsafe(self, callback, *args):
        raise NotImplementedError

    def run_in_executor(self, executor, func, *args):
        raise NotImplementedError

    def set_default_executor(self, executor):
        raise NotImplementedError

    # Network I/O methods returning Futures.

    async def getaddrinfo(self, host, port, *,
                          family=0, type=0, proto=0, flags=0):
        raise NotImplementedError

    async def getnameinfo(self, sockaddr, flags=0):
        raise NotImplementedError

    async def create_connection(
            self, protocol_factory, host=None, port=None,
            *, ssl=None, family=0, proto=0,
            flags=0, sock=None, local_addr=None,
            server_hostname=None,
            ssl_handshake_timeout=None,
            happy_eyeballs_delay=None, interleave=None):
        raise NotImplementedError

    async def create_server(
            self, protocol_factory, host=None, port=None,
            *, family=socket.AF_UNSPEC,
            flags=socket.AI_PASSIVE, sock=None, backlog=100,
            ssl=None, reuse_address=None, reuse_port=None,
            ssl_handshake_timeout=None,
            start_serving=True):
        """A coroutine which creates a TCP server bound to host and port.

        The return value is a Server object which can be used to stop
        the service.

        If host is an empty string or None all interfaces are assumed
        and a list of multiple sockets will be returned (most likely
        one for IPv4 and another one for IPv6). The host parameter can also be
        a sequence (e.g. list) of hosts to bind to.

        family can be set to either AF_INET or AF_INET6 to force the
        socket to use IPv4 or IPv6. If not set it will be determined
        from host (defaults to AF_UNSPEC).

        flags is a bitmask for getaddrinfo().

        sock can optionally be specified in order to use a preexisting
        socket object.

        backlog is the maximum number of queued connections passed to
        listen() (defaults to 100).

        ssl can be set to an SSLContext to enable SSL over the
        accepted connections.

        reuse_address tells the kernel to reuse a local socket in
        TIME_WAIT state, without waiting for its natural timeout to
        expire. If not specified will automatically be set to True on
        UNIX.

        reuse_port tells the kernel to allow this endpoint to be bound to
        the same port as other existing endpoints are bound to, so long as
        they all set this flag when being created. This option is not
        supported on Windows.

        ssl_handshake_timeout is the time in seconds that an SSL server
        will wait for completion of the SSL handshake before aborting the
        connection. Default is 60s.

        start_serving set to True (default) causes the created server
        to start accepting connections immediately.  When set to False,
        the user should await Server.start_serving() or Server.serve_forever()
        to make the server to start accepting connections.
        """
        raise NotImplementedError

    async def sendfile(self, transport, file, offset=0, count=None,
                       *, fallback=True):
        """Send a file through a transport.

        Return an amount of sent bytes.
        """
        raise NotImplementedError

    async def start_tls(self, transport, protocol, sslcontext, *,
                        server_side=False,
                        server_hostname=None,
                        ssl_handshake_timeout=None):
        """Upgrade a transport to TLS.

        Return a new transport that *protocol* should start using
        immediately.
        """
        raise NotImplementedError

    async def create_unix_connection(
            self, protocol_factory, path=None, *,
            ssl=None, sock=None,
            server_hostname=None,
            ssl_handshake_timeout=None):
        raise NotImplementedError

    async def create_unix_server(
            self, protocol_factory, path=None, *,
            sock=None, backlog=100, ssl=None,
            ssl_handshake_timeout=None,
            start_serving=True):
        """A coroutine which creates a UNIX Domain Socket server.

        The return value is a Server object, which can be used to stop
        the service.

        path is a str, representing a file systsem path to bind the
        server socket to.

        sock can optionally be specified in order to use a preexisting
        socket object.

        backlog is the maximum number of queued connections passed to
        listen() (defaults to 100).

        ssl can be set to an SSLContext to enable SSL over the
        accepted connections.

        ssl_handshake_timeout is the time in seconds that an SSL server
        will wait for the SSL handshake to complete (defaults to 60s).

        start_serving set to True (default) causes the created server
        to start accepting connections immediately.  When set to False,
        the user should await Server.start_serving() or Server.serve_forever()
        to make the server to start accepting connections.
        """
        raise NotImplementedError

    async def create_datagram_endpoint(self, protocol_factory,
                                       local_addr=None, remote_addr=None, *,
                                       family=0, proto=0, flags=0,
                                       reuse_address=None, reuse_port=None,
                                       allow_broadcast=None, sock=None):
        """A coroutine which creates a datagram endpoint.

        This method will try to establish the endpoint in the background.
        When successful, the coroutine returns a (transport, protocol) pair.

        protocol_factory must be a callable returning a protocol instance.

        socket family AF_INET, socket.AF_INET6 or socket.AF_UNIX depending on
        host (or family if specified), socket type SOCK_DGRAM.

        reuse_address tells the kernel to reuse a local socket in
        TIME_WAIT state, without waiting for its natural timeout to
        expire. If not specified it will automatically be set to True on
        UNIX.

        reuse_port tells the kernel to allow this endpoint to be bound to
        the same port as other existing endpoints are bound to, so long as
        they all set this flag when being created. This option is not
        supported on Windows and some UNIX's. If the
        :py:data:`~socket.SO_REUSEPORT` constant is not defined then this
        capability is unsupported.

        allow_broadcast tells the kernel to allow this endpoint to send
        messages to the broadcast address.

        sock can optionally be specified in order to use a preexisting
        socket object.
        """
        raise NotImplementedError

    # Pipes and subprocesses.

    async def connect_read_pipe(self, protocol_factory, pipe):
        """Register read pipe in event loop. Set the pipe to non-blocking mode.

        protocol_factory should instantiate object with Protocol interface.
        pipe is a file-like object.
        Return pair (transport, protocol), where transport supports the
        ReadTransport interface."""
        # The reason to accept file-like object instead of just file descriptor
        # is: we need to own pipe and close it at transport finishing
        # Can got complicated errors if pass f.fileno(),
        # close fd in pipe transport then close f and vise versa.
        raise NotImplementedError

    async def connect_write_pipe(self, protocol_factory, pipe):
        """Register write pipe in event loop.

        protocol_factory should instantiate object with BaseProtocol interface.
        Pipe is file-like object already switched to nonblocking.
        Return pair (transport, protocol), where transport support
        WriteTransport interface."""
        # The reason to accept file-like object instead of just file descriptor
        # is: we need to own pipe and close it at transport finishing
        # Can got complicated errors if pass f.fileno(),
        # close fd in pipe transport then close f and vise versa.
        raise NotImplementedError

    async def subprocess_shell(self, protocol_factory, cmd, *,
                               stdin=subprocess.PIPE,
                               stdout=subprocess.PIPE,
                               stderr=subprocess.PIPE,
                               **kwargs):
        raise NotImplementedError

    async def subprocess_exec(self, protocol_factory, *args,
                              stdin=subprocess.PIPE,
                              stdout=subprocess.PIPE,
                              stderr=subprocess.PIPE,
                              **kwargs):
        raise NotImplementedError

    # Ready-based callback registration methods.
    # The add_*() methods return None.
    # The remove_*() methods return True if something was removed,
    # False if there was nothing to delete.

    def add_reader(self, fd, callback, *args):
        raise NotImplementedError

    def remove_reader(self, fd):
        raise NotImplementedError

    def add_writer(self, fd, callback, *args):
        raise NotImplementedError

    def remove_writer(self, fd):
        raise NotImplementedError

    # Completion based I/O methods returning Futures.

    async def sock_recv(self, sock, nbytes):
        raise NotImplementedError

    async def sock_recv_into(self, sock, buf):
        raise NotImplementedError

    async def sock_sendall(self, sock, data):
        raise NotImplementedError

    async def sock_connect(self, sock, address):
        raise NotImplementedError

    async def sock_accept(self, sock):
        raise NotImplementedError

    async def sock_sendfile(self, sock, file, offset=0, count=None,
                            *, fallback=None):
        raise NotImplementedError

    # Signal handling.

    def add_signal_handler(self, sig, callback, *args):
        raise NotImplementedError

    def remove_signal_handler(self, sig):
        raise NotImplementedError

    # Task factory.

    def set_task_factory(self, factory):
        raise NotImplementedError

    def get_task_factory(self):
        raise NotImplementedError

    # Error handlers.

    def get_exception_handler(self):
        raise NotImplementedError

    def set_exception_handler(self, handler):
        raise NotImplementedError

    def default_exception_handler(self, context):
        raise NotImplementedError

    def call_exception_handler(self, context):
        raise NotImplementedError

    # Debug flag management.

    def get_debug(self):
        raise NotImplementedError

    def set_debug(self, enabled):
        raise NotImplementedError


class AbstractEventLoopPolicy:
    """Abstract policy for accessing the event loop."""

    def get_event_loop(self):
        """Get the event loop for the current context.

        Returns an event loop object implementing the BaseEventLoop interface,
        or raises an exception in case no event loop has been set for the
        current context and the current policy does not specify to create one.

        It should never return None."""
        raise NotImplementedError

    def set_event_loop(self, loop):
        """Set the event loop for the current context to loop."""
        raise NotImplementedError

    def new_event_loop(self):
        """Create and return a new event loop object according to this
        policy's rules. If there's need to set this loop as the event loop for
        the current context, set_event_loop must be called explicitly."""
        raise NotImplementedError

    # Child processes handling (Unix only).

    def get_child_watcher(self):
        "Get the watcher for child processes."
        raise NotImplementedError

    def set_child_watcher(self, watcher):
        """Set the watcher for child processes."""
        raise NotImplementedError


class BaseDefaultEventLoopPolicy(AbstractEventLoopPolicy):
    """Default policy implementation for accessing the event loop.

    In this policy, each thread has its own event loop.  However, we
    only automatically create an event loop by default for the main
    thread; other threads by default have no event loop.

    Other policies may have different rules (e.g. a single global
    event loop, or automatically creating an event loop per thread, or
    using some other notion of context to which an event loop is
    associated).
    """

    _loop_factory = None

    class _Local(threading.local):
        _loop = None
        _set_called = False

    def __init__(self):
        self._local = self._Local()

    def get_event_loop(self):
        """Get the event loop for the current context.

        Returns an instance of EventLoop or raises an exception.
        """
        if (self._local._loop is None and
                not self._local._set_called and
                isinstance(threading.current_thread(), threading._MainThread)):
            self.set_event_loop(self.new_event_loop())

        if self._local._loop is None:
            raise RuntimeError('There is no current event loop in thread %r.'
                               % threading.current_thread().name)

        return self._local._loop

    def set_event_loop(self, loop):
        """Set the event loop."""
        self._local._set_called = True
        assert loop is None or isinstance(loop, AbstractEventLoop)
        self._local._loop = loop

    def new_event_loop(self):
        """Create a new event loop.

        You must call set_event_loop() to make this the current event
        loop.
        """
        return self._loop_factory()


# Event loop policy.  The policy itself is always global, even if the
# policy's rules say that there is an event loop per thread (or other
# notion of context).  The default policy is installed by the first
# call to get_event_loop_policy().
_event_loop_policy = None

# Lock for protecting the on-the-fly creation of the event loop policy.
_lock = threading.Lock()


# A TLS for the running event loop, used by _get_running_loop.
class _RunningLoop(threading.local):
    loop_pid = (None, None)


_running_loop = _RunningLoop()


def get_running_loop():
    """Return the running event loop.  Raise a RuntimeError if there is none.

    This function is thread-specific.
    """
    # NOTE: this function is implemented in C (see _asynciomodule.c)
    loop = _get_running_loop()
    if loop is None:
        raise RuntimeError('no running event loop')
    return loop


def _get_running_loop():
    """Return the running event loop or None.

    This is a low-level function intended to be used by event loops.
    This function is thread-specific.
    """
    # NOTE: this function is implemented in C (see _asynciomodule.c)
    running_loop, pid = _running_loop.loop_pid
    if running_loop is not None and pid == os.getpid():
        return running_loop


def _set_running_loop(loop):
    """Set the running event loop.

    This is a low-level function intended to be used by event loops.
    This function is thread-specific.
    """
    # NOTE: this function is implemented in C (see _asynciomodule.c)
    _running_loop.loop_pid = (loop, os.getpid())


def _init_event_loop_policy():
    global _event_loop_policy
    with _lock:
        if _event_loop_policy is None:  # pragma: no branch
            from . import DefaultEventLoopPolicy
            _event_loop_policy = DefaultEventLoopPolicy()


def get_event_loop_policy():
    """Get the current event loop policy."""
    if _event_loop_policy is None:
        _init_event_loop_policy()
    return _event_loop_policy


def set_event_loop_policy(policy):
    """Set the current event loop policy.

    If policy is None, the default policy is restored."""
    global _event_loop_policy
    assert policy is None or isinstance(policy, AbstractEventLoopPolicy)
    _event_loop_policy = policy


def get_event_loop():
    """Return an asyncio event loop.

    When called from a coroutine or a callback (e.g. scheduled with call_soon
    or similar API), this function will always return the running event loop.

    If there is no running event loop set, the function will return
    the result of `get_event_loop_policy().get_event_loop()` call.
    """
    # NOTE: this function is implemented in C (see _asynciomodule.c)
    current_loop = _get_running_loop()
    if current_loop is not None:
        return current_loop
    return get_event_loop_policy().get_event_loop()


def set_event_loop(loop):
    """Equivalent to calling get_event_loop_policy().set_event_loop(loop)."""
    get_event_loop_policy().set_event_loop(loop)


def new_event_loop():
    """Equivalent to calling get_event_loop_policy().new_event_loop()."""
    return get_event_loop_policy().new_event_loop()


def get_child_watcher():
    """Equivalent to calling get_event_loop_policy().get_child_watcher()."""
    return get_event_loop_policy().get_child_watcher()


def set_child_watcher(watcher):
    """Equivalent to calling
    get_event_loop_policy().set_child_watcher(watcher)."""
    return get_event_loop_policy().set_child_watcher(watcher)


# Alias pure-Python implementations for testing purposes.
_py__get_running_loop = _get_running_loop
_py__set_running_loop = _set_running_loop
_py_get_running_loop = get_running_loop
_py_get_event_loop = get_event_loop


try:
    # get_event_loop() is one of the most frequently called
    # functions in asyncio.  Pure Python implementation is
    # about 4 times slower than C-accelerated.
    from _asyncio import (_get_running_loop, _set_running_loop,
                          get_running_loop, get_event_loop)
except ImportError:
    pass
else:
    # Alias C implementations for testing purposes.
    _c__get_running_loop = _get_running_loop
    _c__set_running_loop = _set_running_loop
    _c_get_running_loop = get_running_loop
    _c_get_event_loop = get_event_loop
asyncio/streams.py000064400000064040151153537530010255 0ustar00__all__ = (
    'StreamReader', 'StreamWriter', 'StreamReaderProtocol',
    'open_connection', 'start_server')

import socket
import sys
import warnings
import weakref

if hasattr(socket, 'AF_UNIX'):
    __all__ += ('open_unix_connection', 'start_unix_server')

from . import coroutines
from . import events
from . import exceptions
from . import format_helpers
from . import protocols
from .log import logger
from .tasks import sleep


_DEFAULT_LIMIT = 2 ** 16  # 64 KiB


async def open_connection(host=None, port=None, *,
                          loop=None, limit=_DEFAULT_LIMIT, **kwds):
    """A wrapper for create_connection() returning a (reader, writer) pair.

    The reader returned is a StreamReader instance; the writer is a
    StreamWriter instance.

    The arguments are all the usual arguments to create_connection()
    except protocol_factory; most common are positional host and port,
    with various optional keyword arguments following.

    Additional optional keyword arguments are loop (to set the event loop
    instance to use) and limit (to set the buffer limit passed to the
    StreamReader).

    (If you want to customize the StreamReader and/or
    StreamReaderProtocol classes, just copy the code -- there's
    really nothing special here except some convenience.)
    """
    if loop is None:
        loop = events.get_event_loop()
    else:
        warnings.warn("The loop argument is deprecated since Python 3.8, "
                      "and scheduled for removal in Python 3.10.",
                      DeprecationWarning, stacklevel=2)
    reader = StreamReader(limit=limit, loop=loop)
    protocol = StreamReaderProtocol(reader, loop=loop)
    transport, _ = await loop.create_connection(
        lambda: protocol, host, port, **kwds)
    writer = StreamWriter(transport, protocol, reader, loop)
    return reader, writer


async def start_server(client_connected_cb, host=None, port=None, *,
                       loop=None, limit=_DEFAULT_LIMIT, **kwds):
    """Start a socket server, call back for each client connected.

    The first parameter, `client_connected_cb`, takes two parameters:
    client_reader, client_writer.  client_reader is a StreamReader
    object, while client_writer is a StreamWriter object.  This
    parameter can either be a plain callback function or a coroutine;
    if it is a coroutine, it will be automatically converted into a
    Task.

    The rest of the arguments are all the usual arguments to
    loop.create_server() except protocol_factory; most common are
    positional host and port, with various optional keyword arguments
    following.  The return value is the same as loop.create_server().

    Additional optional keyword arguments are loop (to set the event loop
    instance to use) and limit (to set the buffer limit passed to the
    StreamReader).

    The return value is the same as loop.create_server(), i.e. a
    Server object which can be used to stop the service.
    """
    if loop is None:
        loop = events.get_event_loop()
    else:
        warnings.warn("The loop argument is deprecated since Python 3.8, "
                      "and scheduled for removal in Python 3.10.",
                      DeprecationWarning, stacklevel=2)

    def factory():
        reader = StreamReader(limit=limit, loop=loop)
        protocol = StreamReaderProtocol(reader, client_connected_cb,
                                        loop=loop)
        return protocol

    return await loop.create_server(factory, host, port, **kwds)


if hasattr(socket, 'AF_UNIX'):
    # UNIX Domain Sockets are supported on this platform

    async def open_unix_connection(path=None, *,
                                   loop=None, limit=_DEFAULT_LIMIT, **kwds):
        """Similar to `open_connection` but works with UNIX Domain Sockets."""
        if loop is None:
            loop = events.get_event_loop()
        else:
            warnings.warn("The loop argument is deprecated since Python 3.8, "
                          "and scheduled for removal in Python 3.10.",
                          DeprecationWarning, stacklevel=2)
        reader = StreamReader(limit=limit, loop=loop)
        protocol = StreamReaderProtocol(reader, loop=loop)
        transport, _ = await loop.create_unix_connection(
            lambda: protocol, path, **kwds)
        writer = StreamWriter(transport, protocol, reader, loop)
        return reader, writer

    async def start_unix_server(client_connected_cb, path=None, *,
                                loop=None, limit=_DEFAULT_LIMIT, **kwds):
        """Similar to `start_server` but works with UNIX Domain Sockets."""
        if loop is None:
            loop = events.get_event_loop()
        else:
            warnings.warn("The loop argument is deprecated since Python 3.8, "
                          "and scheduled for removal in Python 3.10.",
                          DeprecationWarning, stacklevel=2)

        def factory():
            reader = StreamReader(limit=limit, loop=loop)
            protocol = StreamReaderProtocol(reader, client_connected_cb,
                                            loop=loop)
            return protocol

        return await loop.create_unix_server(factory, path, **kwds)


class FlowControlMixin(protocols.Protocol):
    """Reusable flow control logic for StreamWriter.drain().

    This implements the protocol methods pause_writing(),
    resume_writing() and connection_lost().  If the subclass overrides
    these it must call the super methods.

    StreamWriter.drain() must wait for _drain_helper() coroutine.
    """

    def __init__(self, loop=None):
        if loop is None:
            self._loop = events.get_event_loop()
        else:
            self._loop = loop
        self._paused = False
        self._drain_waiter = None
        self._connection_lost = False

    def pause_writing(self):
        assert not self._paused
        self._paused = True
        if self._loop.get_debug():
            logger.debug("%r pauses writing", self)

    def resume_writing(self):
        assert self._paused
        self._paused = False
        if self._loop.get_debug():
            logger.debug("%r resumes writing", self)

        waiter = self._drain_waiter
        if waiter is not None:
            self._drain_waiter = None
            if not waiter.done():
                waiter.set_result(None)

    def connection_lost(self, exc):
        self._connection_lost = True
        # Wake up the writer if currently paused.
        if not self._paused:
            return
        waiter = self._drain_waiter
        if waiter is None:
            return
        self._drain_waiter = None
        if waiter.done():
            return
        if exc is None:
            waiter.set_result(None)
        else:
            waiter.set_exception(exc)

    async def _drain_helper(self):
        if self._connection_lost:
            raise ConnectionResetError('Connection lost')
        if not self._paused:
            return
        waiter = self._drain_waiter
        assert waiter is None or waiter.cancelled()
        waiter = self._loop.create_future()
        self._drain_waiter = waiter
        await waiter

    def _get_close_waiter(self, stream):
        raise NotImplementedError


class StreamReaderProtocol(FlowControlMixin, protocols.Protocol):
    """Helper class to adapt between Protocol and StreamReader.

    (This is a helper class instead of making StreamReader itself a
    Protocol subclass, because the StreamReader has other potential
    uses, and to prevent the user of the StreamReader to accidentally
    call inappropriate methods of the protocol.)
    """

    _source_traceback = None

    def __init__(self, stream_reader, client_connected_cb=None, loop=None):
        super().__init__(loop=loop)
        if stream_reader is not None:
            self._stream_reader_wr = weakref.ref(stream_reader)
            self._source_traceback = stream_reader._source_traceback
        else:
            self._stream_reader_wr = None
        if client_connected_cb is not None:
            # This is a stream created by the `create_server()` function.
            # Keep a strong reference to the reader until a connection
            # is established.
            self._strong_reader = stream_reader
        self._reject_connection = False
        self._stream_writer = None
        self._transport = None
        self._client_connected_cb = client_connected_cb
        self._over_ssl = False
        self._closed = self._loop.create_future()

    @property
    def _stream_reader(self):
        if self._stream_reader_wr is None:
            return None
        return self._stream_reader_wr()

    def connection_made(self, transport):
        if self._reject_connection:
            context = {
                'message': ('An open stream was garbage collected prior to '
                            'establishing network connection; '
                            'call "stream.close()" explicitly.')
            }
            if self._source_traceback:
                context['source_traceback'] = self._source_traceback
            self._loop.call_exception_handler(context)
            transport.abort()
            return
        self._transport = transport
        reader = self._stream_reader
        if reader is not None:
            reader.set_transport(transport)
        self._over_ssl = transport.get_extra_info('sslcontext') is not None
        if self._client_connected_cb is not None:
            self._stream_writer = StreamWriter(transport, self,
                                               reader,
                                               self._loop)
            res = self._client_connected_cb(reader,
                                            self._stream_writer)
            if coroutines.iscoroutine(res):
                self._loop.create_task(res)
            self._strong_reader = None

    def connection_lost(self, exc):
        reader = self._stream_reader
        if reader is not None:
            if exc is None:
                reader.feed_eof()
            else:
                reader.set_exception(exc)
        if not self._closed.done():
            if exc is None:
                self._closed.set_result(None)
            else:
                self._closed.set_exception(exc)
        super().connection_lost(exc)
        self._stream_reader_wr = None
        self._stream_writer = None
        self._transport = None

    def data_received(self, data):
        reader = self._stream_reader
        if reader is not None:
            reader.feed_data(data)

    def eof_received(self):
        reader = self._stream_reader
        if reader is not None:
            reader.feed_eof()
        if self._over_ssl:
            # Prevent a warning in SSLProtocol.eof_received:
            # "returning true from eof_received()
            # has no effect when using ssl"
            return False
        return True

    def _get_close_waiter(self, stream):
        return self._closed

    def __del__(self):
        # Prevent reports about unhandled exceptions.
        # Better than self._closed._log_traceback = False hack
        closed = self._closed
        if closed.done() and not closed.cancelled():
            closed.exception()


class StreamWriter:
    """Wraps a Transport.

    This exposes write(), writelines(), [can_]write_eof(),
    get_extra_info() and close().  It adds drain() which returns an
    optional Future on which you can wait for flow control.  It also
    adds a transport property which references the Transport
    directly.
    """

    def __init__(self, transport, protocol, reader, loop):
        self._transport = transport
        self._protocol = protocol
        # drain() expects that the reader has an exception() method
        assert reader is None or isinstance(reader, StreamReader)
        self._reader = reader
        self._loop = loop
        self._complete_fut = self._loop.create_future()
        self._complete_fut.set_result(None)

    def __repr__(self):
        info = [self.__class__.__name__, f'transport={self._transport!r}']
        if self._reader is not None:
            info.append(f'reader={self._reader!r}')
        return '<{}>'.format(' '.join(info))

    @property
    def transport(self):
        return self._transport

    def write(self, data):
        self._transport.write(data)

    def writelines(self, data):
        self._transport.writelines(data)

    def write_eof(self):
        return self._transport.write_eof()

    def can_write_eof(self):
        return self._transport.can_write_eof()

    def close(self):
        return self._transport.close()

    def is_closing(self):
        return self._transport.is_closing()

    async def wait_closed(self):
        await self._protocol._get_close_waiter(self)

    def get_extra_info(self, name, default=None):
        return self._transport.get_extra_info(name, default)

    async def drain(self):
        """Flush the write buffer.

        The intended use is to write

          w.write(data)
          await w.drain()
        """
        if self._reader is not None:
            exc = self._reader.exception()
            if exc is not None:
                raise exc
        if self._transport.is_closing():
            # Wait for protocol.connection_lost() call
            # Raise connection closing error if any,
            # ConnectionResetError otherwise
            # Yield to the event loop so connection_lost() may be
            # called.  Without this, _drain_helper() would return
            # immediately, and code that calls
            #     write(...); await drain()
            # in a loop would never call connection_lost(), so it
            # would not see an error when the socket is closed.
            await sleep(0)
        await self._protocol._drain_helper()


class StreamReader:

    _source_traceback = None

    def __init__(self, limit=_DEFAULT_LIMIT, loop=None):
        # The line length limit is  a security feature;
        # it also doubles as half the buffer limit.

        if limit <= 0:
            raise ValueError('Limit cannot be <= 0')

        self._limit = limit
        if loop is None:
            self._loop = events.get_event_loop()
        else:
            self._loop = loop
        self._buffer = bytearray()
        self._eof = False    # Whether we're done.
        self._waiter = None  # A future used by _wait_for_data()
        self._exception = None
        self._transport = None
        self._paused = False
        if self._loop.get_debug():
            self._source_traceback = format_helpers.extract_stack(
                sys._getframe(1))

    def __repr__(self):
        info = ['StreamReader']
        if self._buffer:
            info.append(f'{len(self._buffer)} bytes')
        if self._eof:
            info.append('eof')
        if self._limit != _DEFAULT_LIMIT:
            info.append(f'limit={self._limit}')
        if self._waiter:
            info.append(f'waiter={self._waiter!r}')
        if self._exception:
            info.append(f'exception={self._exception!r}')
        if self._transport:
            info.append(f'transport={self._transport!r}')
        if self._paused:
            info.append('paused')
        return '<{}>'.format(' '.join(info))

    def exception(self):
        return self._exception

    def set_exception(self, exc):
        self._exception = exc

        waiter = self._waiter
        if waiter is not None:
            self._waiter = None
            if not waiter.cancelled():
                waiter.set_exception(exc)

    def _wakeup_waiter(self):
        """Wakeup read*() functions waiting for data or EOF."""
        waiter = self._waiter
        if waiter is not None:
            self._waiter = None
            if not waiter.cancelled():
                waiter.set_result(None)

    def set_transport(self, transport):
        assert self._transport is None, 'Transport already set'
        self._transport = transport

    def _maybe_resume_transport(self):
        if self._paused and len(self._buffer) <= self._limit:
            self._paused = False
            self._transport.resume_reading()

    def feed_eof(self):
        self._eof = True
        self._wakeup_waiter()

    def at_eof(self):
        """Return True if the buffer is empty and 'feed_eof' was called."""
        return self._eof and not self._buffer

    def feed_data(self, data):
        assert not self._eof, 'feed_data after feed_eof'

        if not data:
            return

        self._buffer.extend(data)
        self._wakeup_waiter()

        if (self._transport is not None and
                not self._paused and
                len(self._buffer) > 2 * self._limit):
            try:
                self._transport.pause_reading()
            except NotImplementedError:
                # The transport can't be paused.
                # We'll just have to buffer all data.
                # Forget the transport so we don't keep trying.
                self._transport = None
            else:
                self._paused = True

    async def _wait_for_data(self, func_name):
        """Wait until feed_data() or feed_eof() is called.

        If stream was paused, automatically resume it.
        """
        # StreamReader uses a future to link the protocol feed_data() method
        # to a read coroutine. Running two read coroutines at the same time
        # would have an unexpected behaviour. It would not possible to know
        # which coroutine would get the next data.
        if self._waiter is not None:
            raise RuntimeError(
                f'{func_name}() called while another coroutine is '
                f'already waiting for incoming data')

        assert not self._eof, '_wait_for_data after EOF'

        # Waiting for data while paused will make deadlock, so prevent it.
        # This is essential for readexactly(n) for case when n > self._limit.
        if self._paused:
            self._paused = False
            self._transport.resume_reading()

        self._waiter = self._loop.create_future()
        try:
            await self._waiter
        finally:
            self._waiter = None

    async def readline(self):
        """Read chunk of data from the stream until newline (b'\n') is found.

        On success, return chunk that ends with newline. If only partial
        line can be read due to EOF, return incomplete line without
        terminating newline. When EOF was reached while no bytes read, empty
        bytes object is returned.

        If limit is reached, ValueError will be raised. In that case, if
        newline was found, complete line including newline will be removed
        from internal buffer. Else, internal buffer will be cleared. Limit is
        compared against part of the line without newline.

        If stream was paused, this function will automatically resume it if
        needed.
        """
        sep = b'\n'
        seplen = len(sep)
        try:
            line = await self.readuntil(sep)
        except exceptions.IncompleteReadError as e:
            return e.partial
        except exceptions.LimitOverrunError as e:
            if self._buffer.startswith(sep, e.consumed):
                del self._buffer[:e.consumed + seplen]
            else:
                self._buffer.clear()
            self._maybe_resume_transport()
            raise ValueError(e.args[0])
        return line

    async def readuntil(self, separator=b'\n'):
        """Read data from the stream until ``separator`` is found.

        On success, the data and separator will be removed from the
        internal buffer (consumed). Returned data will include the
        separator at the end.

        Configured stream limit is used to check result. Limit sets the
        maximal length of data that can be returned, not counting the
        separator.

        If an EOF occurs and the complete separator is still not found,
        an IncompleteReadError exception will be raised, and the internal
        buffer will be reset.  The IncompleteReadError.partial attribute
        may contain the separator partially.

        If the data cannot be read because of over limit, a
        LimitOverrunError exception  will be raised, and the data
        will be left in the internal buffer, so it can be read again.
        """
        seplen = len(separator)
        if seplen == 0:
            raise ValueError('Separator should be at least one-byte string')

        if self._exception is not None:
            raise self._exception

        # Consume whole buffer except last bytes, which length is
        # one less than seplen. Let's check corner cases with
        # separator='SEPARATOR':
        # * we have received almost complete separator (without last
        #   byte). i.e buffer='some textSEPARATO'. In this case we
        #   can safely consume len(separator) - 1 bytes.
        # * last byte of buffer is first byte of separator, i.e.
        #   buffer='abcdefghijklmnopqrS'. We may safely consume
        #   everything except that last byte, but this require to
        #   analyze bytes of buffer that match partial separator.
        #   This is slow and/or require FSM. For this case our
        #   implementation is not optimal, since require rescanning
        #   of data that is known to not belong to separator. In
        #   real world, separator will not be so long to notice
        #   performance problems. Even when reading MIME-encoded
        #   messages :)

        # `offset` is the number of bytes from the beginning of the buffer
        # where there is no occurrence of `separator`.
        offset = 0

        # Loop until we find `separator` in the buffer, exceed the buffer size,
        # or an EOF has happened.
        while True:
            buflen = len(self._buffer)

            # Check if we now have enough data in the buffer for `separator` to
            # fit.
            if buflen - offset >= seplen:
                isep = self._buffer.find(separator, offset)

                if isep != -1:
                    # `separator` is in the buffer. `isep` will be used later
                    # to retrieve the data.
                    break

                # see upper comment for explanation.
                offset = buflen + 1 - seplen
                if offset > self._limit:
                    raise exceptions.LimitOverrunError(
                        'Separator is not found, and chunk exceed the limit',
                        offset)

            # Complete message (with full separator) may be present in buffer
            # even when EOF flag is set. This may happen when the last chunk
            # adds data which makes separator be found. That's why we check for
            # EOF *ater* inspecting the buffer.
            if self._eof:
                chunk = bytes(self._buffer)
                self._buffer.clear()
                raise exceptions.IncompleteReadError(chunk, None)

            # _wait_for_data() will resume reading if stream was paused.
            await self._wait_for_data('readuntil')

        if isep > self._limit:
            raise exceptions.LimitOverrunError(
                'Separator is found, but chunk is longer than limit', isep)

        chunk = self._buffer[:isep + seplen]
        del self._buffer[:isep + seplen]
        self._maybe_resume_transport()
        return bytes(chunk)

    async def read(self, n=-1):
        """Read up to `n` bytes from the stream.

        If n is not provided, or set to -1, read until EOF and return all read
        bytes. If the EOF was received and the internal buffer is empty, return
        an empty bytes object.

        If n is zero, return empty bytes object immediately.

        If n is positive, this function try to read `n` bytes, and may return
        less or equal bytes than requested, but at least one byte. If EOF was
        received before any byte is read, this function returns empty byte
        object.

        Returned value is not limited with limit, configured at stream
        creation.

        If stream was paused, this function will automatically resume it if
        needed.
        """

        if self._exception is not None:
            raise self._exception

        if n == 0:
            return b''

        if n < 0:
            # This used to just loop creating a new waiter hoping to
            # collect everything in self._buffer, but that would
            # deadlock if the subprocess sends more than self.limit
            # bytes.  So just call self.read(self._limit) until EOF.
            blocks = []
            while True:
                block = await self.read(self._limit)
                if not block:
                    break
                blocks.append(block)
            return b''.join(blocks)

        if not self._buffer and not self._eof:
            await self._wait_for_data('read')

        # This will work right even if buffer is less than n bytes
        data = bytes(self._buffer[:n])
        del self._buffer[:n]

        self._maybe_resume_transport()
        return data

    async def readexactly(self, n):
        """Read exactly `n` bytes.

        Raise an IncompleteReadError if EOF is reached before `n` bytes can be
        read. The IncompleteReadError.partial attribute of the exception will
        contain the partial read bytes.

        if n is zero, return empty bytes object.

        Returned value is not limited with limit, configured at stream
        creation.

        If stream was paused, this function will automatically resume it if
        needed.
        """
        if n < 0:
            raise ValueError('readexactly size can not be less than zero')

        if self._exception is not None:
            raise self._exception

        if n == 0:
            return b''

        while len(self._buffer) < n:
            if self._eof:
                incomplete = bytes(self._buffer)
                self._buffer.clear()
                raise exceptions.IncompleteReadError(incomplete, n)

            await self._wait_for_data('readexactly')

        if len(self._buffer) == n:
            data = bytes(self._buffer)
            self._buffer.clear()
        else:
            data = bytes(self._buffer[:n])
            del self._buffer[:n]
        self._maybe_resume_transport()
        return data

    def __aiter__(self):
        return self

    async def __anext__(self):
        val = await self.readline()
        if val == b'':
            raise StopAsyncIteration
        return val
asyncio/unix_events.py000064400000137733151153537530011160 0ustar00"""Selector event loop for Unix with signal handling."""

import errno
import io
import itertools
import os
import selectors
import signal
import socket
import stat
import subprocess
import sys
import threading
import warnings

from . import base_events
from . import base_subprocess
from . import constants
from . import coroutines
from . import events
from . import exceptions
from . import futures
from . import selector_events
from . import tasks
from . import transports
from .log import logger


__all__ = (
    'SelectorEventLoop',
    'AbstractChildWatcher', 'SafeChildWatcher',
    'FastChildWatcher',
    'MultiLoopChildWatcher', 'ThreadedChildWatcher',
    'DefaultEventLoopPolicy',
)


if sys.platform == 'win32':  # pragma: no cover
    raise ImportError('Signals are not really supported on Windows')


def _sighandler_noop(signum, frame):
    """Dummy signal handler."""
    pass


class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
    """Unix event loop.

    Adds signal handling and UNIX Domain Socket support to SelectorEventLoop.
    """

    def __init__(self, selector=None):
        super().__init__(selector)
        self._signal_handlers = {}

    def close(self):
        super().close()
        if not sys.is_finalizing():
            for sig in list(self._signal_handlers):
                self.remove_signal_handler(sig)
        else:
            if self._signal_handlers:
                warnings.warn(f"Closing the loop {self!r} "
                              f"on interpreter shutdown "
                              f"stage, skipping signal handlers removal",
                              ResourceWarning,
                              source=self)
                self._signal_handlers.clear()

    def _process_self_data(self, data):
        for signum in data:
            if not signum:
                # ignore null bytes written by _write_to_self()
                continue
            self._handle_signal(signum)

    def add_signal_handler(self, sig, callback, *args):
        """Add a handler for a signal.  UNIX only.

        Raise ValueError if the signal number is invalid or uncatchable.
        Raise RuntimeError if there is a problem setting up the handler.
        """
        if (coroutines.iscoroutine(callback) or
                coroutines.iscoroutinefunction(callback)):
            raise TypeError("coroutines cannot be used "
                            "with add_signal_handler()")
        self._check_signal(sig)
        self._check_closed()
        try:
            # set_wakeup_fd() raises ValueError if this is not the
            # main thread.  By calling it early we ensure that an
            # event loop running in another thread cannot add a signal
            # handler.
            signal.set_wakeup_fd(self._csock.fileno())
        except (ValueError, OSError) as exc:
            raise RuntimeError(str(exc))

        handle = events.Handle(callback, args, self, None)
        self._signal_handlers[sig] = handle

        try:
            # Register a dummy signal handler to ask Python to write the signal
            # number in the wakeup file descriptor. _process_self_data() will
            # read signal numbers from this file descriptor to handle signals.
            signal.signal(sig, _sighandler_noop)

            # Set SA_RESTART to limit EINTR occurrences.
            signal.siginterrupt(sig, False)
        except OSError as exc:
            del self._signal_handlers[sig]
            if not self._signal_handlers:
                try:
                    signal.set_wakeup_fd(-1)
                except (ValueError, OSError) as nexc:
                    logger.info('set_wakeup_fd(-1) failed: %s', nexc)

            if exc.errno == errno.EINVAL:
                raise RuntimeError(f'sig {sig} cannot be caught')
            else:
                raise

    def _handle_signal(self, sig):
        """Internal helper that is the actual signal handler."""
        handle = self._signal_handlers.get(sig)
        if handle is None:
            return  # Assume it's some race condition.
        if handle._cancelled:
            self.remove_signal_handler(sig)  # Remove it properly.
        else:
            self._add_callback_signalsafe(handle)

    def remove_signal_handler(self, sig):
        """Remove a handler for a signal.  UNIX only.

        Return True if a signal handler was removed, False if not.
        """
        self._check_signal(sig)
        try:
            del self._signal_handlers[sig]
        except KeyError:
            return False

        if sig == signal.SIGINT:
            handler = signal.default_int_handler
        else:
            handler = signal.SIG_DFL

        try:
            signal.signal(sig, handler)
        except OSError as exc:
            if exc.errno == errno.EINVAL:
                raise RuntimeError(f'sig {sig} cannot be caught')
            else:
                raise

        if not self._signal_handlers:
            try:
                signal.set_wakeup_fd(-1)
            except (ValueError, OSError) as exc:
                logger.info('set_wakeup_fd(-1) failed: %s', exc)

        return True

    def _check_signal(self, sig):
        """Internal helper to validate a signal.

        Raise ValueError if the signal number is invalid or uncatchable.
        Raise RuntimeError if there is a problem setting up the handler.
        """
        if not isinstance(sig, int):
            raise TypeError(f'sig must be an int, not {sig!r}')

        if sig not in signal.valid_signals():
            raise ValueError(f'invalid signal number {sig}')

    def _make_read_pipe_transport(self, pipe, protocol, waiter=None,
                                  extra=None):
        return _UnixReadPipeTransport(self, pipe, protocol, waiter, extra)

    def _make_write_pipe_transport(self, pipe, protocol, waiter=None,
                                   extra=None):
        return _UnixWritePipeTransport(self, pipe, protocol, waiter, extra)

    async def _make_subprocess_transport(self, protocol, args, shell,
                                         stdin, stdout, stderr, bufsize,
                                         extra=None, **kwargs):
        with events.get_child_watcher() as watcher:
            if not watcher.is_active():
                # Check early.
                # Raising exception before process creation
                # prevents subprocess execution if the watcher
                # is not ready to handle it.
                raise RuntimeError("asyncio.get_child_watcher() is not activated, "
                                   "subprocess support is not installed.")
            waiter = self.create_future()
            transp = _UnixSubprocessTransport(self, protocol, args, shell,
                                              stdin, stdout, stderr, bufsize,
                                              waiter=waiter, extra=extra,
                                              **kwargs)

            watcher.add_child_handler(transp.get_pid(),
                                      self._child_watcher_callback, transp)
            try:
                await waiter
            except (SystemExit, KeyboardInterrupt):
                raise
            except BaseException:
                transp.close()
                await transp._wait()
                raise

        return transp

    def _child_watcher_callback(self, pid, returncode, transp):
        self.call_soon_threadsafe(transp._process_exited, returncode)

    async def create_unix_connection(
            self, protocol_factory, path=None, *,
            ssl=None, sock=None,
            server_hostname=None,
            ssl_handshake_timeout=None):
        assert server_hostname is None or isinstance(server_hostname, str)
        if ssl:
            if server_hostname is None:
                raise ValueError(
                    'you have to pass server_hostname when using ssl')
        else:
            if server_hostname is not None:
                raise ValueError('server_hostname is only meaningful with ssl')
            if ssl_handshake_timeout is not None:
                raise ValueError(
                    'ssl_handshake_timeout is only meaningful with ssl')

        if path is not None:
            if sock is not None:
                raise ValueError(
                    'path and sock can not be specified at the same time')

            path = os.fspath(path)
            sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM, 0)
            try:
                sock.setblocking(False)
                await self.sock_connect(sock, path)
            except:
                sock.close()
                raise

        else:
            if sock is None:
                raise ValueError('no path and sock were specified')
            if (sock.family != socket.AF_UNIX or
                    sock.type != socket.SOCK_STREAM):
                raise ValueError(
                    f'A UNIX Domain Stream Socket was expected, got {sock!r}')
            sock.setblocking(False)

        transport, protocol = await self._create_connection_transport(
            sock, protocol_factory, ssl, server_hostname,
            ssl_handshake_timeout=ssl_handshake_timeout)
        return transport, protocol

    async def create_unix_server(
            self, protocol_factory, path=None, *,
            sock=None, backlog=100, ssl=None,
            ssl_handshake_timeout=None,
            start_serving=True):
        if isinstance(ssl, bool):
            raise TypeError('ssl argument must be an SSLContext or None')

        if ssl_handshake_timeout is not None and not ssl:
            raise ValueError(
                'ssl_handshake_timeout is only meaningful with ssl')

        if path is not None:
            if sock is not None:
                raise ValueError(
                    'path and sock can not be specified at the same time')

            path = os.fspath(path)
            sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)

            # Check for abstract socket. `str` and `bytes` paths are supported.
            if path[0] not in (0, '\x00'):
                try:
                    if stat.S_ISSOCK(os.stat(path).st_mode):
                        os.remove(path)
                except FileNotFoundError:
                    pass
                except OSError as err:
                    # Directory may have permissions only to create socket.
                    logger.error('Unable to check or remove stale UNIX socket '
                                 '%r: %r', path, err)

            try:
                sock.bind(path)
            except OSError as exc:
                sock.close()
                if exc.errno == errno.EADDRINUSE:
                    # Let's improve the error message by adding
                    # with what exact address it occurs.
                    msg = f'Address {path!r} is already in use'
                    raise OSError(errno.EADDRINUSE, msg) from None
                else:
                    raise
            except:
                sock.close()
                raise
        else:
            if sock is None:
                raise ValueError(
                    'path was not specified, and no sock specified')

            if (sock.family != socket.AF_UNIX or
                    sock.type != socket.SOCK_STREAM):
                raise ValueError(
                    f'A UNIX Domain Stream Socket was expected, got {sock!r}')

        sock.setblocking(False)
        server = base_events.Server(self, [sock], protocol_factory,
                                    ssl, backlog, ssl_handshake_timeout)
        if start_serving:
            server._start_serving()
            # Skip one loop iteration so that all 'loop.add_reader'
            # go through.
            await tasks.sleep(0, loop=self)

        return server

    async def _sock_sendfile_native(self, sock, file, offset, count):
        try:
            os.sendfile
        except AttributeError as exc:
            raise exceptions.SendfileNotAvailableError(
                "os.sendfile() is not available")
        try:
            fileno = file.fileno()
        except (AttributeError, io.UnsupportedOperation) as err:
            raise exceptions.SendfileNotAvailableError("not a regular file")
        try:
            fsize = os.fstat(fileno).st_size
        except OSError as err:
            raise exceptions.SendfileNotAvailableError("not a regular file")
        blocksize = count if count else fsize
        if not blocksize:
            return 0  # empty file

        fut = self.create_future()
        self._sock_sendfile_native_impl(fut, None, sock, fileno,
                                        offset, count, blocksize, 0)
        return await fut

    def _sock_sendfile_native_impl(self, fut, registered_fd, sock, fileno,
                                   offset, count, blocksize, total_sent):
        fd = sock.fileno()
        if registered_fd is not None:
            # Remove the callback early.  It should be rare that the
            # selector says the fd is ready but the call still returns
            # EAGAIN, and I am willing to take a hit in that case in
            # order to simplify the common case.
            self.remove_writer(registered_fd)
        if fut.cancelled():
            self._sock_sendfile_update_filepos(fileno, offset, total_sent)
            return
        if count:
            blocksize = count - total_sent
            if blocksize <= 0:
                self._sock_sendfile_update_filepos(fileno, offset, total_sent)
                fut.set_result(total_sent)
                return

        try:
            sent = os.sendfile(fd, fileno, offset, blocksize)
        except (BlockingIOError, InterruptedError):
            if registered_fd is None:
                self._sock_add_cancellation_callback(fut, sock)
            self.add_writer(fd, self._sock_sendfile_native_impl, fut,
                            fd, sock, fileno,
                            offset, count, blocksize, total_sent)
        except OSError as exc:
            if (registered_fd is not None and
                    exc.errno == errno.ENOTCONN and
                    type(exc) is not ConnectionError):
                # If we have an ENOTCONN and this isn't a first call to
                # sendfile(), i.e. the connection was closed in the middle
                # of the operation, normalize the error to ConnectionError
                # to make it consistent across all Posix systems.
                new_exc = ConnectionError(
                    "socket is not connected", errno.ENOTCONN)
                new_exc.__cause__ = exc
                exc = new_exc
            if total_sent == 0:
                # We can get here for different reasons, the main
                # one being 'file' is not a regular mmap(2)-like
                # file, in which case we'll fall back on using
                # plain send().
                err = exceptions.SendfileNotAvailableError(
                    "os.sendfile call failed")
                self._sock_sendfile_update_filepos(fileno, offset, total_sent)
                fut.set_exception(err)
            else:
                self._sock_sendfile_update_filepos(fileno, offset, total_sent)
                fut.set_exception(exc)
        except (SystemExit, KeyboardInterrupt):
            raise
        except BaseException as exc:
            self._sock_sendfile_update_filepos(fileno, offset, total_sent)
            fut.set_exception(exc)
        else:
            if sent == 0:
                # EOF
                self._sock_sendfile_update_filepos(fileno, offset, total_sent)
                fut.set_result(total_sent)
            else:
                offset += sent
                total_sent += sent
                if registered_fd is None:
                    self._sock_add_cancellation_callback(fut, sock)
                self.add_writer(fd, self._sock_sendfile_native_impl, fut,
                                fd, sock, fileno,
                                offset, count, blocksize, total_sent)

    def _sock_sendfile_update_filepos(self, fileno, offset, total_sent):
        if total_sent > 0:
            os.lseek(fileno, offset, os.SEEK_SET)

    def _sock_add_cancellation_callback(self, fut, sock):
        def cb(fut):
            if fut.cancelled():
                fd = sock.fileno()
                if fd != -1:
                    self.remove_writer(fd)
        fut.add_done_callback(cb)


class _UnixReadPipeTransport(transports.ReadTransport):

    max_size = 256 * 1024  # max bytes we read in one event loop iteration

    def __init__(self, loop, pipe, protocol, waiter=None, extra=None):
        super().__init__(extra)
        self._extra['pipe'] = pipe
        self._loop = loop
        self._pipe = pipe
        self._fileno = pipe.fileno()
        self._protocol = protocol
        self._closing = False
        self._paused = False

        mode = os.fstat(self._fileno).st_mode
        if not (stat.S_ISFIFO(mode) or
                stat.S_ISSOCK(mode) or
                stat.S_ISCHR(mode)):
            self._pipe = None
            self._fileno = None
            self._protocol = None
            raise ValueError("Pipe transport is for pipes/sockets only.")

        os.set_blocking(self._fileno, False)

        self._loop.call_soon(self._protocol.connection_made, self)
        # only start reading when connection_made() has been called
        self._loop.call_soon(self._loop._add_reader,
                             self._fileno, self._read_ready)
        if waiter is not None:
            # only wake up the waiter when connection_made() has been called
            self._loop.call_soon(futures._set_result_unless_cancelled,
                                 waiter, None)

    def __repr__(self):
        info = [self.__class__.__name__]
        if self._pipe is None:
            info.append('closed')
        elif self._closing:
            info.append('closing')
        info.append(f'fd={self._fileno}')
        selector = getattr(self._loop, '_selector', None)
        if self._pipe is not None and selector is not None:
            polling = selector_events._test_selector_event(
                selector, self._fileno, selectors.EVENT_READ)
            if polling:
                info.append('polling')
            else:
                info.append('idle')
        elif self._pipe is not None:
            info.append('open')
        else:
            info.append('closed')
        return '<{}>'.format(' '.join(info))

    def _read_ready(self):
        try:
            data = os.read(self._fileno, self.max_size)
        except (BlockingIOError, InterruptedError):
            pass
        except OSError as exc:
            self._fatal_error(exc, 'Fatal read error on pipe transport')
        else:
            if data:
                self._protocol.data_received(data)
            else:
                if self._loop.get_debug():
                    logger.info("%r was closed by peer", self)
                self._closing = True
                self._loop._remove_reader(self._fileno)
                self._loop.call_soon(self._protocol.eof_received)
                self._loop.call_soon(self._call_connection_lost, None)

    def pause_reading(self):
        if self._closing or self._paused:
            return
        self._paused = True
        self._loop._remove_reader(self._fileno)
        if self._loop.get_debug():
            logger.debug("%r pauses reading", self)

    def resume_reading(self):
        if self._closing or not self._paused:
            return
        self._paused = False
        self._loop._add_reader(self._fileno, self._read_ready)
        if self._loop.get_debug():
            logger.debug("%r resumes reading", self)

    def set_protocol(self, protocol):
        self._protocol = protocol

    def get_protocol(self):
        return self._protocol

    def is_closing(self):
        return self._closing

    def close(self):
        if not self._closing:
            self._close(None)

    def __del__(self, _warn=warnings.warn):
        if self._pipe is not None:
            _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
            self._pipe.close()

    def _fatal_error(self, exc, message='Fatal error on pipe transport'):
        # should be called by exception handler only
        if (isinstance(exc, OSError) and exc.errno == errno.EIO):
            if self._loop.get_debug():
                logger.debug("%r: %s", self, message, exc_info=True)
        else:
            self._loop.call_exception_handler({
                'message': message,
                'exception': exc,
                'transport': self,
                'protocol': self._protocol,
            })
        self._close(exc)

    def _close(self, exc):
        self._closing = True
        self._loop._remove_reader(self._fileno)
        self._loop.call_soon(self._call_connection_lost, exc)

    def _call_connection_lost(self, exc):
        try:
            self._protocol.connection_lost(exc)
        finally:
            self._pipe.close()
            self._pipe = None
            self._protocol = None
            self._loop = None


class _UnixWritePipeTransport(transports._FlowControlMixin,
                              transports.WriteTransport):

    def __init__(self, loop, pipe, protocol, waiter=None, extra=None):
        super().__init__(extra, loop)
        self._extra['pipe'] = pipe
        self._pipe = pipe
        self._fileno = pipe.fileno()
        self._protocol = protocol
        self._buffer = bytearray()
        self._conn_lost = 0
        self._closing = False  # Set when close() or write_eof() called.

        mode = os.fstat(self._fileno).st_mode
        is_char = stat.S_ISCHR(mode)
        is_fifo = stat.S_ISFIFO(mode)
        is_socket = stat.S_ISSOCK(mode)
        if not (is_char or is_fifo or is_socket):
            self._pipe = None
            self._fileno = None
            self._protocol = None
            raise ValueError("Pipe transport is only for "
                             "pipes, sockets and character devices")

        os.set_blocking(self._fileno, False)
        self._loop.call_soon(self._protocol.connection_made, self)

        # On AIX, the reader trick (to be notified when the read end of the
        # socket is closed) only works for sockets. On other platforms it
        # works for pipes and sockets. (Exception: OS X 10.4?  Issue #19294.)
        if is_socket or (is_fifo and not sys.platform.startswith("aix")):
            # only start reading when connection_made() has been called
            self._loop.call_soon(self._loop._add_reader,
                                 self._fileno, self._read_ready)

        if waiter is not None:
            # only wake up the waiter when connection_made() has been called
            self._loop.call_soon(futures._set_result_unless_cancelled,
                                 waiter, None)

    def __repr__(self):
        info = [self.__class__.__name__]
        if self._pipe is None:
            info.append('closed')
        elif self._closing:
            info.append('closing')
        info.append(f'fd={self._fileno}')
        selector = getattr(self._loop, '_selector', None)
        if self._pipe is not None and selector is not None:
            polling = selector_events._test_selector_event(
                selector, self._fileno, selectors.EVENT_WRITE)
            if polling:
                info.append('polling')
            else:
                info.append('idle')

            bufsize = self.get_write_buffer_size()
            info.append(f'bufsize={bufsize}')
        elif self._pipe is not None:
            info.append('open')
        else:
            info.append('closed')
        return '<{}>'.format(' '.join(info))

    def get_write_buffer_size(self):
        return len(self._buffer)

    def _read_ready(self):
        # Pipe was closed by peer.
        if self._loop.get_debug():
            logger.info("%r was closed by peer", self)
        if self._buffer:
            self._close(BrokenPipeError())
        else:
            self._close()

    def write(self, data):
        assert isinstance(data, (bytes, bytearray, memoryview)), repr(data)
        if isinstance(data, bytearray):
            data = memoryview(data)
        if not data:
            return

        if self._conn_lost or self._closing:
            if self._conn_lost >= constants.LOG_THRESHOLD_FOR_CONNLOST_WRITES:
                logger.warning('pipe closed by peer or '
                               'os.write(pipe, data) raised exception.')
            self._conn_lost += 1
            return

        if not self._buffer:
            # Attempt to send it right away first.
            try:
                n = os.write(self._fileno, data)
            except (BlockingIOError, InterruptedError):
                n = 0
            except (SystemExit, KeyboardInterrupt):
                raise
            except BaseException as exc:
                self._conn_lost += 1
                self._fatal_error(exc, 'Fatal write error on pipe transport')
                return
            if n == len(data):
                return
            elif n > 0:
                data = memoryview(data)[n:]
            self._loop._add_writer(self._fileno, self._write_ready)

        self._buffer += data
        self._maybe_pause_protocol()

    def _write_ready(self):
        assert self._buffer, 'Data should not be empty'

        try:
            n = os.write(self._fileno, self._buffer)
        except (BlockingIOError, InterruptedError):
            pass
        except (SystemExit, KeyboardInterrupt):
            raise
        except BaseException as exc:
            self._buffer.clear()
            self._conn_lost += 1
            # Remove writer here, _fatal_error() doesn't it
            # because _buffer is empty.
            self._loop._remove_writer(self._fileno)
            self._fatal_error(exc, 'Fatal write error on pipe transport')
        else:
            if n == len(self._buffer):
                self._buffer.clear()
                self._loop._remove_writer(self._fileno)
                self._maybe_resume_protocol()  # May append to buffer.
                if self._closing:
                    self._loop._remove_reader(self._fileno)
                    self._call_connection_lost(None)
                return
            elif n > 0:
                del self._buffer[:n]

    def can_write_eof(self):
        return True

    def write_eof(self):
        if self._closing:
            return
        assert self._pipe
        self._closing = True
        if not self._buffer:
            self._loop._remove_reader(self._fileno)
            self._loop.call_soon(self._call_connection_lost, None)

    def set_protocol(self, protocol):
        self._protocol = protocol

    def get_protocol(self):
        return self._protocol

    def is_closing(self):
        return self._closing

    def close(self):
        if self._pipe is not None and not self._closing:
            # write_eof is all what we needed to close the write pipe
            self.write_eof()

    def __del__(self, _warn=warnings.warn):
        if self._pipe is not None:
            _warn(f"unclosed transport {self!r}", ResourceWarning, source=self)
            self._pipe.close()

    def abort(self):
        self._close(None)

    def _fatal_error(self, exc, message='Fatal error on pipe transport'):
        # should be called by exception handler only
        if isinstance(exc, OSError):
            if self._loop.get_debug():
                logger.debug("%r: %s", self, message, exc_info=True)
        else:
            self._loop.call_exception_handler({
                'message': message,
                'exception': exc,
                'transport': self,
                'protocol': self._protocol,
            })
        self._close(exc)

    def _close(self, exc=None):
        self._closing = True
        if self._buffer:
            self._loop._remove_writer(self._fileno)
        self._buffer.clear()
        self._loop._remove_reader(self._fileno)
        self._loop.call_soon(self._call_connection_lost, exc)

    def _call_connection_lost(self, exc):
        try:
            self._protocol.connection_lost(exc)
        finally:
            self._pipe.close()
            self._pipe = None
            self._protocol = None
            self._loop = None


class _UnixSubprocessTransport(base_subprocess.BaseSubprocessTransport):

    def _start(self, args, shell, stdin, stdout, stderr, bufsize, **kwargs):
        stdin_w = None
        if stdin == subprocess.PIPE:
            # Use a socket pair for stdin, since not all platforms
            # support selecting read events on the write end of a
            # socket (which we use in order to detect closing of the
            # other end).  Notably this is needed on AIX, and works
            # just fine on other platforms.
            stdin, stdin_w = socket.socketpair()
        try:
            self._proc = subprocess.Popen(
                args, shell=shell, stdin=stdin, stdout=stdout, stderr=stderr,
                universal_newlines=False, bufsize=bufsize, **kwargs)
            if stdin_w is not None:
                stdin.close()
                self._proc.stdin = open(stdin_w.detach(), 'wb', buffering=bufsize)
                stdin_w = None
        finally:
            if stdin_w is not None:
                stdin.close()
                stdin_w.close()


class AbstractChildWatcher:
    """Abstract base class for monitoring child processes.

    Objects derived from this class monitor a collection of subprocesses and
    report their termination or interruption by a signal.

    New callbacks are registered with .add_child_handler(). Starting a new
    process must be done within a 'with' block to allow the watcher to suspend
    its activity until the new process if fully registered (this is needed to
    prevent a race condition in some implementations).

    Example:
        with watcher:
            proc = subprocess.Popen("sleep 1")
            watcher.add_child_handler(proc.pid, callback)

    Notes:
        Implementations of this class must be thread-safe.

        Since child watcher objects may catch the SIGCHLD signal and call
        waitpid(-1), there should be only one active object per process.
    """

    def add_child_handler(self, pid, callback, *args):
        """Register a new child handler.

        Arrange for callback(pid, returncode, *args) to be called when
        process 'pid' terminates. Specifying another callback for the same
        process replaces the previous handler.

        Note: callback() must be thread-safe.
        """
        raise NotImplementedError()

    def remove_child_handler(self, pid):
        """Removes the handler for process 'pid'.

        The function returns True if the handler was successfully removed,
        False if there was nothing to remove."""

        raise NotImplementedError()

    def attach_loop(self, loop):
        """Attach the watcher to an event loop.

        If the watcher was previously attached to an event loop, then it is
        first detached before attaching to the new loop.

        Note: loop may be None.
        """
        raise NotImplementedError()

    def close(self):
        """Close the watcher.

        This must be called to make sure that any underlying resource is freed.
        """
        raise NotImplementedError()

    def is_active(self):
        """Return ``True`` if the watcher is active and is used by the event loop.

        Return True if the watcher is installed and ready to handle process exit
        notifications.

        """
        raise NotImplementedError()

    def __enter__(self):
        """Enter the watcher's context and allow starting new processes

        This function must return self"""
        raise NotImplementedError()

    def __exit__(self, a, b, c):
        """Exit the watcher's context"""
        raise NotImplementedError()


def _compute_returncode(status):
    if os.WIFSIGNALED(status):
        # The child process died because of a signal.
        return -os.WTERMSIG(status)
    elif os.WIFEXITED(status):
        # The child process exited (e.g sys.exit()).
        return os.WEXITSTATUS(status)
    else:
        # The child exited, but we don't understand its status.
        # This shouldn't happen, but if it does, let's just
        # return that status; perhaps that helps debug it.
        return status


class BaseChildWatcher(AbstractChildWatcher):

    def __init__(self):
        self._loop = None
        self._callbacks = {}

    def close(self):
        self.attach_loop(None)

    def is_active(self):
        return self._loop is not None and self._loop.is_running()

    def _do_waitpid(self, expected_pid):
        raise NotImplementedError()

    def _do_waitpid_all(self):
        raise NotImplementedError()

    def attach_loop(self, loop):
        assert loop is None or isinstance(loop, events.AbstractEventLoop)

        if self._loop is not None and loop is None and self._callbacks:
            warnings.warn(
                'A loop is being detached '
                'from a child watcher with pending handlers',
                RuntimeWarning)

        if self._loop is not None:
            self._loop.remove_signal_handler(signal.SIGCHLD)

        self._loop = loop
        if loop is not None:
            loop.add_signal_handler(signal.SIGCHLD, self._sig_chld)

            # Prevent a race condition in case a child terminated
            # during the switch.
            self._do_waitpid_all()

    def _sig_chld(self):
        try:
            self._do_waitpid_all()
        except (SystemExit, KeyboardInterrupt):
            raise
        except BaseException as exc:
            # self._loop should always be available here
            # as '_sig_chld' is added as a signal handler
            # in 'attach_loop'
            self._loop.call_exception_handler({
                'message': 'Unknown exception in SIGCHLD handler',
                'exception': exc,
            })


class SafeChildWatcher(BaseChildWatcher):
    """'Safe' child watcher implementation.

    This implementation avoids disrupting other code spawning processes by
    polling explicitly each process in the SIGCHLD handler instead of calling
    os.waitpid(-1).

    This is a safe solution but it has a significant overhead when handling a
    big number of children (O(n) each time SIGCHLD is raised)
    """

    def close(self):
        self._callbacks.clear()
        super().close()

    def __enter__(self):
        return self

    def __exit__(self, a, b, c):
        pass

    def add_child_handler(self, pid, callback, *args):
        self._callbacks[pid] = (callback, args)

        # Prevent a race condition in case the child is already terminated.
        self._do_waitpid(pid)

    def remove_child_handler(self, pid):
        try:
            del self._callbacks[pid]
            return True
        except KeyError:
            return False

    def _do_waitpid_all(self):

        for pid in list(self._callbacks):
            self._do_waitpid(pid)

    def _do_waitpid(self, expected_pid):
        assert expected_pid > 0

        try:
            pid, status = os.waitpid(expected_pid, os.WNOHANG)
        except ChildProcessError:
            # The child process is already reaped
            # (may happen if waitpid() is called elsewhere).
            pid = expected_pid
            returncode = 255
            logger.warning(
                "Unknown child process pid %d, will report returncode 255",
                pid)
        else:
            if pid == 0:
                # The child process is still alive.
                return

            returncode = _compute_returncode(status)
            if self._loop.get_debug():
                logger.debug('process %s exited with returncode %s',
                             expected_pid, returncode)

        try:
            callback, args = self._callbacks.pop(pid)
        except KeyError:  # pragma: no cover
            # May happen if .remove_child_handler() is called
            # after os.waitpid() returns.
            if self._loop.get_debug():
                logger.warning("Child watcher got an unexpected pid: %r",
                               pid, exc_info=True)
        else:
            callback(pid, returncode, *args)


class FastChildWatcher(BaseChildWatcher):
    """'Fast' child watcher implementation.

    This implementation reaps every terminated processes by calling
    os.waitpid(-1) directly, possibly breaking other code spawning processes
    and waiting for their termination.

    There is no noticeable overhead when handling a big number of children
    (O(1) each time a child terminates).
    """
    def __init__(self):
        super().__init__()
        self._lock = threading.Lock()
        self._zombies = {}
        self._forks = 0

    def close(self):
        self._callbacks.clear()
        self._zombies.clear()
        super().close()

    def __enter__(self):
        with self._lock:
            self._forks += 1

            return self

    def __exit__(self, a, b, c):
        with self._lock:
            self._forks -= 1

            if self._forks or not self._zombies:
                return

            collateral_victims = str(self._zombies)
            self._zombies.clear()

        logger.warning(
            "Caught subprocesses termination from unknown pids: %s",
            collateral_victims)

    def add_child_handler(self, pid, callback, *args):
        assert self._forks, "Must use the context manager"

        with self._lock:
            try:
                returncode = self._zombies.pop(pid)
            except KeyError:
                # The child is running.
                self._callbacks[pid] = callback, args
                return

        # The child is dead already. We can fire the callback.
        callback(pid, returncode, *args)

    def remove_child_handler(self, pid):
        try:
            del self._callbacks[pid]
            return True
        except KeyError:
            return False

    def _do_waitpid_all(self):
        # Because of signal coalescing, we must keep calling waitpid() as
        # long as we're able to reap a child.
        while True:
            try:
                pid, status = os.waitpid(-1, os.WNOHANG)
            except ChildProcessError:
                # No more child processes exist.
                return
            else:
                if pid == 0:
                    # A child process is still alive.
                    return

                returncode = _compute_returncode(status)

            with self._lock:
                try:
                    callback, args = self._callbacks.pop(pid)
                except KeyError:
                    # unknown child
                    if self._forks:
                        # It may not be registered yet.
                        self._zombies[pid] = returncode
                        if self._loop.get_debug():
                            logger.debug('unknown process %s exited '
                                         'with returncode %s',
                                         pid, returncode)
                        continue
                    callback = None
                else:
                    if self._loop.get_debug():
                        logger.debug('process %s exited with returncode %s',
                                     pid, returncode)

            if callback is None:
                logger.warning(
                    "Caught subprocess termination from unknown pid: "
                    "%d -> %d", pid, returncode)
            else:
                callback(pid, returncode, *args)


class MultiLoopChildWatcher(AbstractChildWatcher):
    """A watcher that doesn't require running loop in the main thread.

    This implementation registers a SIGCHLD signal handler on
    instantiation (which may conflict with other code that
    install own handler for this signal).

    The solution is safe but it has a significant overhead when
    handling a big number of processes (*O(n)* each time a
    SIGCHLD is received).
    """

    # Implementation note:
    # The class keeps compatibility with AbstractChildWatcher ABC
    # To achieve this it has empty attach_loop() method
    # and doesn't accept explicit loop argument
    # for add_child_handler()/remove_child_handler()
    # but retrieves the current loop by get_running_loop()

    def __init__(self):
        self._callbacks = {}
        self._saved_sighandler = None

    def is_active(self):
        return self._saved_sighandler is not None

    def close(self):
        self._callbacks.clear()
        if self._saved_sighandler is None:
            return

        handler = signal.getsignal(signal.SIGCHLD)
        if handler != self._sig_chld:
            logger.warning("SIGCHLD handler was changed by outside code")
        else:
            signal.signal(signal.SIGCHLD, self._saved_sighandler)
        self._saved_sighandler = None

    def __enter__(self):
        return self

    def __exit__(self, exc_type, exc_val, exc_tb):
        pass

    def add_child_handler(self, pid, callback, *args):
        loop = events.get_running_loop()
        self._callbacks[pid] = (loop, callback, args)

        # Prevent a race condition in case the child is already terminated.
        self._do_waitpid(pid)

    def remove_child_handler(self, pid):
        try:
            del self._callbacks[pid]
            return True
        except KeyError:
            return False

    def attach_loop(self, loop):
        # Don't save the loop but initialize itself if called first time
        # The reason to do it here is that attach_loop() is called from
        # unix policy only for the main thread.
        # Main thread is required for subscription on SIGCHLD signal
        if self._saved_sighandler is not None:
            return

        self._saved_sighandler = signal.signal(signal.SIGCHLD, self._sig_chld)
        if self._saved_sighandler is None:
            logger.warning("Previous SIGCHLD handler was set by non-Python code, "
                           "restore to default handler on watcher close.")
            self._saved_sighandler = signal.SIG_DFL

        # Set SA_RESTART to limit EINTR occurrences.
        signal.siginterrupt(signal.SIGCHLD, False)

    def _do_waitpid_all(self):
        for pid in list(self._callbacks):
            self._do_waitpid(pid)

    def _do_waitpid(self, expected_pid):
        assert expected_pid > 0

        try:
            pid, status = os.waitpid(expected_pid, os.WNOHANG)
        except ChildProcessError:
            # The child process is already reaped
            # (may happen if waitpid() is called elsewhere).
            pid = expected_pid
            returncode = 255
            logger.warning(
                "Unknown child process pid %d, will report returncode 255",
                pid)
            debug_log = False
        else:
            if pid == 0:
                # The child process is still alive.
                return

            returncode = _compute_returncode(status)
            debug_log = True
        try:
            loop, callback, args = self._callbacks.pop(pid)
        except KeyError:  # pragma: no cover
            # May happen if .remove_child_handler() is called
            # after os.waitpid() returns.
            logger.warning("Child watcher got an unexpected pid: %r",
                           pid, exc_info=True)
        else:
            if loop.is_closed():
                logger.warning("Loop %r that handles pid %r is closed", loop, pid)
            else:
                if debug_log and loop.get_debug():
                    logger.debug('process %s exited with returncode %s',
                                 expected_pid, returncode)
                loop.call_soon_threadsafe(callback, pid, returncode, *args)

    def _sig_chld(self, signum, frame):
        try:
            self._do_waitpid_all()
        except (SystemExit, KeyboardInterrupt):
            raise
        except BaseException:
            logger.warning('Unknown exception in SIGCHLD handler', exc_info=True)


class ThreadedChildWatcher(AbstractChildWatcher):
    """Threaded child watcher implementation.

    The watcher uses a thread per process
    for waiting for the process finish.

    It doesn't require subscription on POSIX signal
    but a thread creation is not free.

    The watcher has O(1) complexity, its performance doesn't depend
    on amount of spawn processes.
    """

    def __init__(self):
        self._pid_counter = itertools.count(0)
        self._threads = {}

    def is_active(self):
        return True

    def close(self):
        self._join_threads()

    def _join_threads(self):
        """Internal: Join all non-daemon threads"""
        threads = [thread for thread in list(self._threads.values())
                   if thread.is_alive() and not thread.daemon]
        for thread in threads:
            thread.join()

    def __enter__(self):
        return self

    def __exit__(self, exc_type, exc_val, exc_tb):
        pass

    def __del__(self, _warn=warnings.warn):
        threads = [thread for thread in list(self._threads.values())
                   if thread.is_alive()]
        if threads:
            _warn(f"{self.__class__} has registered but not finished child processes",
                  ResourceWarning,
                  source=self)

    def add_child_handler(self, pid, callback, *args):
        loop = events.get_running_loop()
        thread = threading.Thread(target=self._do_waitpid,
                                  name=f"waitpid-{next(self._pid_counter)}",
                                  args=(loop, pid, callback, args),
                                  daemon=True)
        self._threads[pid] = thread
        thread.start()

    def remove_child_handler(self, pid):
        # asyncio never calls remove_child_handler() !!!
        # The method is no-op but is implemented because
        # abstract base classe requires it
        return True

    def attach_loop(self, loop):
        pass

    def _do_waitpid(self, loop, expected_pid, callback, args):
        assert expected_pid > 0

        try:
            pid, status = os.waitpid(expected_pid, 0)
        except ChildProcessError:
            # The child process is already reaped
            # (may happen if waitpid() is called elsewhere).
            pid = expected_pid
            returncode = 255
            logger.warning(
                "Unknown child process pid %d, will report returncode 255",
                pid)
        else:
            returncode = _compute_returncode(status)
            if loop.get_debug():
                logger.debug('process %s exited with returncode %s',
                             expected_pid, returncode)

        if loop.is_closed():
            logger.warning("Loop %r that handles pid %r is closed", loop, pid)
        else:
            loop.call_soon_threadsafe(callback, pid, returncode, *args)

        self._threads.pop(expected_pid)


class _UnixDefaultEventLoopPolicy(events.BaseDefaultEventLoopPolicy):
    """UNIX event loop policy with a watcher for child processes."""
    _loop_factory = _UnixSelectorEventLoop

    def __init__(self):
        super().__init__()
        self._watcher = None

    def _init_watcher(self):
        with events._lock:
            if self._watcher is None:  # pragma: no branch
                self._watcher = ThreadedChildWatcher()
                if isinstance(threading.current_thread(),
                              threading._MainThread):
                    self._watcher.attach_loop(self._local._loop)

    def set_event_loop(self, loop):
        """Set the event loop.

        As a side effect, if a child watcher was set before, then calling
        .set_event_loop() from the main thread will call .attach_loop(loop) on
        the child watcher.
        """

        super().set_event_loop(loop)

        if (self._watcher is not None and
                isinstance(threading.current_thread(), threading._MainThread)):
            self._watcher.attach_loop(loop)

    def get_child_watcher(self):
        """Get the watcher for child processes.

        If not yet set, a ThreadedChildWatcher object is automatically created.
        """
        if self._watcher is None:
            self._init_watcher()

        return self._watcher

    def set_child_watcher(self, watcher):
        """Set the watcher for child processes."""

        assert watcher is None or isinstance(watcher, AbstractChildWatcher)

        if self._watcher is not None:
            self._watcher.close()

        self._watcher = watcher


SelectorEventLoop = _UnixSelectorEventLoop
DefaultEventLoopPolicy = _UnixDefaultEventLoopPolicy
asyncio/windows_events.py000064400000100151151153537530011647 0ustar00"""Selector and proactor event loops for Windows."""

import _overlapped
import _winapi
import errno
import math
import msvcrt
import socket
import struct
import time
import weakref

from . import events
from . import base_subprocess
from . import futures
from . import exceptions
from . import proactor_events
from . import selector_events
from . import tasks
from . import windows_utils
from .log import logger


__all__ = (
    'SelectorEventLoop', 'ProactorEventLoop', 'IocpProactor',
    'DefaultEventLoopPolicy', 'WindowsSelectorEventLoopPolicy',
    'WindowsProactorEventLoopPolicy',
)


NULL = 0
INFINITE = 0xffffffff
ERROR_CONNECTION_REFUSED = 1225
ERROR_CONNECTION_ABORTED = 1236

# Initial delay in seconds for connect_pipe() before retrying to connect
CONNECT_PIPE_INIT_DELAY = 0.001

# Maximum delay in seconds for connect_pipe() before retrying to connect
CONNECT_PIPE_MAX_DELAY = 0.100


class _OverlappedFuture(futures.Future):
    """Subclass of Future which represents an overlapped operation.

    Cancelling it will immediately cancel the overlapped operation.
    """

    def __init__(self, ov, *, loop=None):
        super().__init__(loop=loop)
        if self._source_traceback:
            del self._source_traceback[-1]
        self._ov = ov

    def _repr_info(self):
        info = super()._repr_info()
        if self._ov is not None:
            state = 'pending' if self._ov.pending else 'completed'
            info.insert(1, f'overlapped=<{state}, {self._ov.address:#x}>')
        return info

    def _cancel_overlapped(self):
        if self._ov is None:
            return
        try:
            self._ov.cancel()
        except OSError as exc:
            context = {
                'message': 'Cancelling an overlapped future failed',
                'exception': exc,
                'future': self,
            }
            if self._source_traceback:
                context['source_traceback'] = self._source_traceback
            self._loop.call_exception_handler(context)
        self._ov = None

    def cancel(self):
        self._cancel_overlapped()
        return super().cancel()

    def set_exception(self, exception):
        super().set_exception(exception)
        self._cancel_overlapped()

    def set_result(self, result):
        super().set_result(result)
        self._ov = None


class _BaseWaitHandleFuture(futures.Future):
    """Subclass of Future which represents a wait handle."""

    def __init__(self, ov, handle, wait_handle, *, loop=None):
        super().__init__(loop=loop)
        if self._source_traceback:
            del self._source_traceback[-1]
        # Keep a reference to the Overlapped object to keep it alive until the
        # wait is unregistered
        self._ov = ov
        self._handle = handle
        self._wait_handle = wait_handle

        # Should we call UnregisterWaitEx() if the wait completes
        # or is cancelled?
        self._registered = True

    def _poll(self):
        # non-blocking wait: use a timeout of 0 millisecond
        return (_winapi.WaitForSingleObject(self._handle, 0) ==
                _winapi.WAIT_OBJECT_0)

    def _repr_info(self):
        info = super()._repr_info()
        info.append(f'handle={self._handle:#x}')
        if self._handle is not None:
            state = 'signaled' if self._poll() else 'waiting'
            info.append(state)
        if self._wait_handle is not None:
            info.append(f'wait_handle={self._wait_handle:#x}')
        return info

    def _unregister_wait_cb(self, fut):
        # The wait was unregistered: it's not safe to destroy the Overlapped
        # object
        self._ov = None

    def _unregister_wait(self):
        if not self._registered:
            return
        self._registered = False

        wait_handle = self._wait_handle
        self._wait_handle = None
        try:
            _overlapped.UnregisterWait(wait_handle)
        except OSError as exc:
            if exc.winerror != _overlapped.ERROR_IO_PENDING:
                context = {
                    'message': 'Failed to unregister the wait handle',
                    'exception': exc,
                    'future': self,
                }
                if self._source_traceback:
                    context['source_traceback'] = self._source_traceback
                self._loop.call_exception_handler(context)
                return
            # ERROR_IO_PENDING means that the unregister is pending

        self._unregister_wait_cb(None)

    def cancel(self):
        self._unregister_wait()
        return super().cancel()

    def set_exception(self, exception):
        self._unregister_wait()
        super().set_exception(exception)

    def set_result(self, result):
        self._unregister_wait()
        super().set_result(result)


class _WaitCancelFuture(_BaseWaitHandleFuture):
    """Subclass of Future which represents a wait for the cancellation of a
    _WaitHandleFuture using an event.
    """

    def __init__(self, ov, event, wait_handle, *, loop=None):
        super().__init__(ov, event, wait_handle, loop=loop)

        self._done_callback = None

    def cancel(self):
        raise RuntimeError("_WaitCancelFuture must not be cancelled")

    def set_result(self, result):
        super().set_result(result)
        if self._done_callback is not None:
            self._done_callback(self)

    def set_exception(self, exception):
        super().set_exception(exception)
        if self._done_callback is not None:
            self._done_callback(self)


class _WaitHandleFuture(_BaseWaitHandleFuture):
    def __init__(self, ov, handle, wait_handle, proactor, *, loop=None):
        super().__init__(ov, handle, wait_handle, loop=loop)
        self._proactor = proactor
        self._unregister_proactor = True
        self._event = _overlapped.CreateEvent(None, True, False, None)
        self._event_fut = None

    def _unregister_wait_cb(self, fut):
        if self._event is not None:
            _winapi.CloseHandle(self._event)
            self._event = None
            self._event_fut = None

        # If the wait was cancelled, the wait may never be signalled, so
        # it's required to unregister it. Otherwise, IocpProactor.close() will
        # wait forever for an event which will never come.
        #
        # If the IocpProactor already received the event, it's safe to call
        # _unregister() because we kept a reference to the Overlapped object
        # which is used as a unique key.
        self._proactor._unregister(self._ov)
        self._proactor = None

        super()._unregister_wait_cb(fut)

    def _unregister_wait(self):
        if not self._registered:
            return
        self._registered = False

        wait_handle = self._wait_handle
        self._wait_handle = None
        try:
            _overlapped.UnregisterWaitEx(wait_handle, self._event)
        except OSError as exc:
            if exc.winerror != _overlapped.ERROR_IO_PENDING:
                context = {
                    'message': 'Failed to unregister the wait handle',
                    'exception': exc,
                    'future': self,
                }
                if self._source_traceback:
                    context['source_traceback'] = self._source_traceback
                self._loop.call_exception_handler(context)
                return
            # ERROR_IO_PENDING is not an error, the wait was unregistered

        self._event_fut = self._proactor._wait_cancel(self._event,
                                                      self._unregister_wait_cb)


class PipeServer(object):
    """Class representing a pipe server.

    This is much like a bound, listening socket.
    """
    def __init__(self, address):
        self._address = address
        self._free_instances = weakref.WeakSet()
        # initialize the pipe attribute before calling _server_pipe_handle()
        # because this function can raise an exception and the destructor calls
        # the close() method
        self._pipe = None
        self._accept_pipe_future = None
        self._pipe = self._server_pipe_handle(True)

    def _get_unconnected_pipe(self):
        # Create new instance and return previous one.  This ensures
        # that (until the server is closed) there is always at least
        # one pipe handle for address.  Therefore if a client attempt
        # to connect it will not fail with FileNotFoundError.
        tmp, self._pipe = self._pipe, self._server_pipe_handle(False)
        return tmp

    def _server_pipe_handle(self, first):
        # Return a wrapper for a new pipe handle.
        if self.closed():
            return None
        flags = _winapi.PIPE_ACCESS_DUPLEX | _winapi.FILE_FLAG_OVERLAPPED
        if first:
            flags |= _winapi.FILE_FLAG_FIRST_PIPE_INSTANCE
        h = _winapi.CreateNamedPipe(
            self._address, flags,
            _winapi.PIPE_TYPE_MESSAGE | _winapi.PIPE_READMODE_MESSAGE |
            _winapi.PIPE_WAIT,
            _winapi.PIPE_UNLIMITED_INSTANCES,
            windows_utils.BUFSIZE, windows_utils.BUFSIZE,
            _winapi.NMPWAIT_WAIT_FOREVER, _winapi.NULL)
        pipe = windows_utils.PipeHandle(h)
        self._free_instances.add(pipe)
        return pipe

    def closed(self):
        return (self._address is None)

    def close(self):
        if self._accept_pipe_future is not None:
            self._accept_pipe_future.cancel()
            self._accept_pipe_future = None
        # Close all instances which have not been connected to by a client.
        if self._address is not None:
            for pipe in self._free_instances:
                pipe.close()
            self._pipe = None
            self._address = None
            self._free_instances.clear()

    __del__ = close


class _WindowsSelectorEventLoop(selector_events.BaseSelectorEventLoop):
    """Windows version of selector event loop."""


class ProactorEventLoop(proactor_events.BaseProactorEventLoop):
    """Windows version of proactor event loop using IOCP."""

    def __init__(self, proactor=None):
        if proactor is None:
            proactor = IocpProactor()
        super().__init__(proactor)

    def run_forever(self):
        try:
            assert self._self_reading_future is None
            self.call_soon(self._loop_self_reading)
            super().run_forever()
        finally:
            if self._self_reading_future is not None:
                ov = self._self_reading_future._ov
                self._self_reading_future.cancel()
                # self_reading_future was just cancelled so if it hasn't been
                # finished yet, it never will be (it's possible that it has
                # already finished and its callback is waiting in the queue,
                # where it could still happen if the event loop is restarted).
                # Unregister it otherwise IocpProactor.close will wait for it
                # forever
                if ov is not None:
                    self._proactor._unregister(ov)
                self._self_reading_future = None

    async def create_pipe_connection(self, protocol_factory, address):
        f = self._proactor.connect_pipe(address)
        pipe = await f
        protocol = protocol_factory()
        trans = self._make_duplex_pipe_transport(pipe, protocol,
                                                 extra={'addr': address})
        return trans, protocol

    async def start_serving_pipe(self, protocol_factory, address):
        server = PipeServer(address)

        def loop_accept_pipe(f=None):
            pipe = None
            try:
                if f:
                    pipe = f.result()
                    server._free_instances.discard(pipe)

                    if server.closed():
                        # A client connected before the server was closed:
                        # drop the client (close the pipe) and exit
                        pipe.close()
                        return

                    protocol = protocol_factory()
                    self._make_duplex_pipe_transport(
                        pipe, protocol, extra={'addr': address})

                pipe = server._get_unconnected_pipe()
                if pipe is None:
                    return

                f = self._proactor.accept_pipe(pipe)
            except OSError as exc:
                if pipe and pipe.fileno() != -1:
                    self.call_exception_handler({
                        'message': 'Pipe accept failed',
                        'exception': exc,
                        'pipe': pipe,
                    })
                    pipe.close()
                elif self._debug:
                    logger.warning("Accept pipe failed on pipe %r",
                                   pipe, exc_info=True)
            except exceptions.CancelledError:
                if pipe:
                    pipe.close()
            else:
                server._accept_pipe_future = f
                f.add_done_callback(loop_accept_pipe)

        self.call_soon(loop_accept_pipe)
        return [server]

    async def _make_subprocess_transport(self, protocol, args, shell,
                                         stdin, stdout, stderr, bufsize,
                                         extra=None, **kwargs):
        waiter = self.create_future()
        transp = _WindowsSubprocessTransport(self, protocol, args, shell,
                                             stdin, stdout, stderr, bufsize,
                                             waiter=waiter, extra=extra,
                                             **kwargs)
        try:
            await waiter
        except (SystemExit, KeyboardInterrupt):
            raise
        except BaseException:
            transp.close()
            await transp._wait()
            raise

        return transp


class IocpProactor:
    """Proactor implementation using IOCP."""

    def __init__(self, concurrency=0xffffffff):
        self._loop = None
        self._results = []
        self._iocp = _overlapped.CreateIoCompletionPort(
            _overlapped.INVALID_HANDLE_VALUE, NULL, 0, concurrency)
        self._cache = {}
        self._registered = weakref.WeakSet()
        self._unregistered = []
        self._stopped_serving = weakref.WeakSet()

    def _check_closed(self):
        if self._iocp is None:
            raise RuntimeError('IocpProactor is closed')

    def __repr__(self):
        info = ['overlapped#=%s' % len(self._cache),
                'result#=%s' % len(self._results)]
        if self._iocp is None:
            info.append('closed')
        return '<%s %s>' % (self.__class__.__name__, " ".join(info))

    def set_loop(self, loop):
        self._loop = loop

    def select(self, timeout=None):
        if not self._results:
            self._poll(timeout)
        tmp = self._results
        self._results = []
        return tmp

    def _result(self, value):
        fut = self._loop.create_future()
        fut.set_result(value)
        return fut

    def recv(self, conn, nbytes, flags=0):
        self._register_with_iocp(conn)
        ov = _overlapped.Overlapped(NULL)
        try:
            if isinstance(conn, socket.socket):
                ov.WSARecv(conn.fileno(), nbytes, flags)
            else:
                ov.ReadFile(conn.fileno(), nbytes)
        except BrokenPipeError:
            return self._result(b'')

        def finish_recv(trans, key, ov):
            try:
                return ov.getresult()
            except OSError as exc:
                if exc.winerror in (_overlapped.ERROR_NETNAME_DELETED,
                                    _overlapped.ERROR_OPERATION_ABORTED):
                    raise ConnectionResetError(*exc.args)
                else:
                    raise

        return self._register(ov, conn, finish_recv)

    def recv_into(self, conn, buf, flags=0):
        self._register_with_iocp(conn)
        ov = _overlapped.Overlapped(NULL)
        try:
            if isinstance(conn, socket.socket):
                ov.WSARecvInto(conn.fileno(), buf, flags)
            else:
                ov.ReadFileInto(conn.fileno(), buf)
        except BrokenPipeError:
            return self._result(0)

        def finish_recv(trans, key, ov):
            try:
                return ov.getresult()
            except OSError as exc:
                if exc.winerror in (_overlapped.ERROR_NETNAME_DELETED,
                                    _overlapped.ERROR_OPERATION_ABORTED):
                    raise ConnectionResetError(*exc.args)
                else:
                    raise

        return self._register(ov, conn, finish_recv)

    def recvfrom(self, conn, nbytes, flags=0):
        self._register_with_iocp(conn)
        ov = _overlapped.Overlapped(NULL)
        try:
            ov.WSARecvFrom(conn.fileno(), nbytes, flags)
        except BrokenPipeError:
            return self._result((b'', None))

        def finish_recv(trans, key, ov):
            try:
                return ov.getresult()
            except OSError as exc:
                if exc.winerror in (_overlapped.ERROR_NETNAME_DELETED,
                                    _overlapped.ERROR_OPERATION_ABORTED):
                    raise ConnectionResetError(*exc.args)
                else:
                    raise

        return self._register(ov, conn, finish_recv)

    def sendto(self, conn, buf, flags=0, addr=None):
        self._register_with_iocp(conn)
        ov = _overlapped.Overlapped(NULL)

        ov.WSASendTo(conn.fileno(), buf, flags, addr)

        def finish_send(trans, key, ov):
            try:
                return ov.getresult()
            except OSError as exc:
                if exc.winerror in (_overlapped.ERROR_NETNAME_DELETED,
                                    _overlapped.ERROR_OPERATION_ABORTED):
                    raise ConnectionResetError(*exc.args)
                else:
                    raise

        return self._register(ov, conn, finish_send)

    def send(self, conn, buf, flags=0):
        self._register_with_iocp(conn)
        ov = _overlapped.Overlapped(NULL)
        if isinstance(conn, socket.socket):
            ov.WSASend(conn.fileno(), buf, flags)
        else:
            ov.WriteFile(conn.fileno(), buf)

        def finish_send(trans, key, ov):
            try:
                return ov.getresult()
            except OSError as exc:
                if exc.winerror in (_overlapped.ERROR_NETNAME_DELETED,
                                    _overlapped.ERROR_OPERATION_ABORTED):
                    raise ConnectionResetError(*exc.args)
                else:
                    raise

        return self._register(ov, conn, finish_send)

    def accept(self, listener):
        self._register_with_iocp(listener)
        conn = self._get_accept_socket(listener.family)
        ov = _overlapped.Overlapped(NULL)
        ov.AcceptEx(listener.fileno(), conn.fileno())

        def finish_accept(trans, key, ov):
            ov.getresult()
            # Use SO_UPDATE_ACCEPT_CONTEXT so getsockname() etc work.
            buf = struct.pack('@P', listener.fileno())
            conn.setsockopt(socket.SOL_SOCKET,
                            _overlapped.SO_UPDATE_ACCEPT_CONTEXT, buf)
            conn.settimeout(listener.gettimeout())
            return conn, conn.getpeername()

        async def accept_coro(future, conn):
            # Coroutine closing the accept socket if the future is cancelled
            try:
                await future
            except exceptions.CancelledError:
                conn.close()
                raise

        future = self._register(ov, listener, finish_accept)
        coro = accept_coro(future, conn)
        tasks.ensure_future(coro, loop=self._loop)
        return future

    def connect(self, conn, address):
        if conn.type == socket.SOCK_DGRAM:
            # WSAConnect will complete immediately for UDP sockets so we don't
            # need to register any IOCP operation
            _overlapped.WSAConnect(conn.fileno(), address)
            fut = self._loop.create_future()
            fut.set_result(None)
            return fut

        self._register_with_iocp(conn)
        # The socket needs to be locally bound before we call ConnectEx().
        try:
            _overlapped.BindLocal(conn.fileno(), conn.family)
        except OSError as e:
            if e.winerror != errno.WSAEINVAL:
                raise
            # Probably already locally bound; check using getsockname().
            if conn.getsockname()[1] == 0:
                raise
        ov = _overlapped.Overlapped(NULL)
        ov.ConnectEx(conn.fileno(), address)

        def finish_connect(trans, key, ov):
            ov.getresult()
            # Use SO_UPDATE_CONNECT_CONTEXT so getsockname() etc work.
            conn.setsockopt(socket.SOL_SOCKET,
                            _overlapped.SO_UPDATE_CONNECT_CONTEXT, 0)
            return conn

        return self._register(ov, conn, finish_connect)

    def sendfile(self, sock, file, offset, count):
        self._register_with_iocp(sock)
        ov = _overlapped.Overlapped(NULL)
        offset_low = offset & 0xffff_ffff
        offset_high = (offset >> 32) & 0xffff_ffff
        ov.TransmitFile(sock.fileno(),
                        msvcrt.get_osfhandle(file.fileno()),
                        offset_low, offset_high,
                        count, 0, 0)

        def finish_sendfile(trans, key, ov):
            try:
                return ov.getresult()
            except OSError as exc:
                if exc.winerror in (_overlapped.ERROR_NETNAME_DELETED,
                                    _overlapped.ERROR_OPERATION_ABORTED):
                    raise ConnectionResetError(*exc.args)
                else:
                    raise
        return self._register(ov, sock, finish_sendfile)

    def accept_pipe(self, pipe):
        self._register_with_iocp(pipe)
        ov = _overlapped.Overlapped(NULL)
        connected = ov.ConnectNamedPipe(pipe.fileno())

        if connected:
            # ConnectNamePipe() failed with ERROR_PIPE_CONNECTED which means
            # that the pipe is connected. There is no need to wait for the
            # completion of the connection.
            return self._result(pipe)

        def finish_accept_pipe(trans, key, ov):
            ov.getresult()
            return pipe

        return self._register(ov, pipe, finish_accept_pipe)

    async def connect_pipe(self, address):
        delay = CONNECT_PIPE_INIT_DELAY
        while True:
            # Unfortunately there is no way to do an overlapped connect to
            # a pipe.  Call CreateFile() in a loop until it doesn't fail with
            # ERROR_PIPE_BUSY.
            try:
                handle = _overlapped.ConnectPipe(address)
                break
            except OSError as exc:
                if exc.winerror != _overlapped.ERROR_PIPE_BUSY:
                    raise

            # ConnectPipe() failed with ERROR_PIPE_BUSY: retry later
            delay = min(delay * 2, CONNECT_PIPE_MAX_DELAY)
            await tasks.sleep(delay)

        return windows_utils.PipeHandle(handle)

    def wait_for_handle(self, handle, timeout=None):
        """Wait for a handle.

        Return a Future object. The result of the future is True if the wait
        completed, or False if the wait did not complete (on timeout).
        """
        return self._wait_for_handle(handle, timeout, False)

    def _wait_cancel(self, event, done_callback):
        fut = self._wait_for_handle(event, None, True)
        # add_done_callback() cannot be used because the wait may only complete
        # in IocpProactor.close(), while the event loop is not running.
        fut._done_callback = done_callback
        return fut

    def _wait_for_handle(self, handle, timeout, _is_cancel):
        self._check_closed()

        if timeout is None:
            ms = _winapi.INFINITE
        else:
            # RegisterWaitForSingleObject() has a resolution of 1 millisecond,
            # round away from zero to wait *at least* timeout seconds.
            ms = math.ceil(timeout * 1e3)

        # We only create ov so we can use ov.address as a key for the cache.
        ov = _overlapped.Overlapped(NULL)
        wait_handle = _overlapped.RegisterWaitWithQueue(
            handle, self._iocp, ov.address, ms)
        if _is_cancel:
            f = _WaitCancelFuture(ov, handle, wait_handle, loop=self._loop)
        else:
            f = _WaitHandleFuture(ov, handle, wait_handle, self,
                                  loop=self._loop)
        if f._source_traceback:
            del f._source_traceback[-1]

        def finish_wait_for_handle(trans, key, ov):
            # Note that this second wait means that we should only use
            # this with handles types where a successful wait has no
            # effect.  So events or processes are all right, but locks
            # or semaphores are not.  Also note if the handle is
            # signalled and then quickly reset, then we may return
            # False even though we have not timed out.
            return f._poll()

        self._cache[ov.address] = (f, ov, 0, finish_wait_for_handle)
        return f

    def _register_with_iocp(self, obj):
        # To get notifications of finished ops on this objects sent to the
        # completion port, were must register the handle.
        if obj not in self._registered:
            self._registered.add(obj)
            _overlapped.CreateIoCompletionPort(obj.fileno(), self._iocp, 0, 0)
            # XXX We could also use SetFileCompletionNotificationModes()
            # to avoid sending notifications to completion port of ops
            # that succeed immediately.

    def _register(self, ov, obj, callback):
        self._check_closed()

        # Return a future which will be set with the result of the
        # operation when it completes.  The future's value is actually
        # the value returned by callback().
        f = _OverlappedFuture(ov, loop=self._loop)
        if f._source_traceback:
            del f._source_traceback[-1]
        if not ov.pending:
            # The operation has completed, so no need to postpone the
            # work.  We cannot take this short cut if we need the
            # NumberOfBytes, CompletionKey values returned by
            # PostQueuedCompletionStatus().
            try:
                value = callback(None, None, ov)
            except OSError as e:
                f.set_exception(e)
            else:
                f.set_result(value)
            # Even if GetOverlappedResult() was called, we have to wait for the
            # notification of the completion in GetQueuedCompletionStatus().
            # Register the overlapped operation to keep a reference to the
            # OVERLAPPED object, otherwise the memory is freed and Windows may
            # read uninitialized memory.

        # Register the overlapped operation for later.  Note that
        # we only store obj to prevent it from being garbage
        # collected too early.
        self._cache[ov.address] = (f, ov, obj, callback)
        return f

    def _unregister(self, ov):
        """Unregister an overlapped object.

        Call this method when its future has been cancelled. The event can
        already be signalled (pending in the proactor event queue). It is also
        safe if the event is never signalled (because it was cancelled).
        """
        self._check_closed()
        self._unregistered.append(ov)

    def _get_accept_socket(self, family):
        s = socket.socket(family)
        s.settimeout(0)
        return s

    def _poll(self, timeout=None):
        if timeout is None:
            ms = INFINITE
        elif timeout < 0:
            raise ValueError("negative timeout")
        else:
            # GetQueuedCompletionStatus() has a resolution of 1 millisecond,
            # round away from zero to wait *at least* timeout seconds.
            ms = math.ceil(timeout * 1e3)
            if ms >= INFINITE:
                raise ValueError("timeout too big")

        while True:
            status = _overlapped.GetQueuedCompletionStatus(self._iocp, ms)
            if status is None:
                break
            ms = 0

            err, transferred, key, address = status
            try:
                f, ov, obj, callback = self._cache.pop(address)
            except KeyError:
                if self._loop.get_debug():
                    self._loop.call_exception_handler({
                        'message': ('GetQueuedCompletionStatus() returned an '
                                    'unexpected event'),
                        'status': ('err=%s transferred=%s key=%#x address=%#x'
                                   % (err, transferred, key, address)),
                    })

                # key is either zero, or it is used to return a pipe
                # handle which should be closed to avoid a leak.
                if key not in (0, _overlapped.INVALID_HANDLE_VALUE):
                    _winapi.CloseHandle(key)
                continue

            if obj in self._stopped_serving:
                f.cancel()
            # Don't call the callback if _register() already read the result or
            # if the overlapped has been cancelled
            elif not f.done():
                try:
                    value = callback(transferred, key, ov)
                except OSError as e:
                    f.set_exception(e)
                    self._results.append(f)
                else:
                    f.set_result(value)
                    self._results.append(f)

        # Remove unregistered futures
        for ov in self._unregistered:
            self._cache.pop(ov.address, None)
        self._unregistered.clear()

    def _stop_serving(self, obj):
        # obj is a socket or pipe handle.  It will be closed in
        # BaseProactorEventLoop._stop_serving() which will make any
        # pending operations fail quickly.
        self._stopped_serving.add(obj)

    def close(self):
        if self._iocp is None:
            # already closed
            return

        # Cancel remaining registered operations.
        for address, (fut, ov, obj, callback) in list(self._cache.items()):
            if fut.cancelled():
                # Nothing to do with cancelled futures
                pass
            elif isinstance(fut, _WaitCancelFuture):
                # _WaitCancelFuture must not be cancelled
                pass
            else:
                try:
                    fut.cancel()
                except OSError as exc:
                    if self._loop is not None:
                        context = {
                            'message': 'Cancelling a future failed',
                            'exception': exc,
                            'future': fut,
                        }
                        if fut._source_traceback:
                            context['source_traceback'] = fut._source_traceback
                        self._loop.call_exception_handler(context)

        # Wait until all cancelled overlapped complete: don't exit with running
        # overlapped to prevent a crash. Display progress every second if the
        # loop is still running.
        msg_update = 1.0
        start_time = time.monotonic()
        next_msg = start_time + msg_update
        while self._cache:
            if next_msg <= time.monotonic():
                logger.debug('%r is running after closing for %.1f seconds',
                             self, time.monotonic() - start_time)
                next_msg = time.monotonic() + msg_update

            # handle a few events, or timeout
            self._poll(msg_update)

        self._results = []

        _winapi.CloseHandle(self._iocp)
        self._iocp = None

    def __del__(self):
        self.close()


class _WindowsSubprocessTransport(base_subprocess.BaseSubprocessTransport):

    def _start(self, args, shell, stdin, stdout, stderr, bufsize, **kwargs):
        self._proc = windows_utils.Popen(
            args, shell=shell, stdin=stdin, stdout=stdout, stderr=stderr,
            bufsize=bufsize, **kwargs)

        def callback(f):
            returncode = self._proc.poll()
            self._process_exited(returncode)

        f = self._loop._proactor.wait_for_handle(int(self._proc._handle))
        f.add_done_callback(callback)


SelectorEventLoop = _WindowsSelectorEventLoop


class WindowsSelectorEventLoopPolicy(events.BaseDefaultEventLoopPolicy):
    _loop_factory = SelectorEventLoop


class WindowsProactorEventLoopPolicy(events.BaseDefaultEventLoopPolicy):
    _loop_factory = ProactorEventLoop


DefaultEventLoopPolicy = WindowsProactorEventLoopPolicy
asyncio/windows_utils.py000064400000011704151153537530011510 0ustar00"""Various Windows specific bits and pieces."""

import sys

if sys.platform != 'win32':  # pragma: no cover
    raise ImportError('win32 only')

import _winapi
import itertools
import msvcrt
import os
import subprocess
import tempfile
import warnings


__all__ = 'pipe', 'Popen', 'PIPE', 'PipeHandle'


# Constants/globals


BUFSIZE = 8192
PIPE = subprocess.PIPE
STDOUT = subprocess.STDOUT
_mmap_counter = itertools.count()


# Replacement for os.pipe() using handles instead of fds


def pipe(*, duplex=False, overlapped=(True, True), bufsize=BUFSIZE):
    """Like os.pipe() but with overlapped support and using handles not fds."""
    address = tempfile.mktemp(
        prefix=r'\\.\pipe\python-pipe-{:d}-{:d}-'.format(
            os.getpid(), next(_mmap_counter)))

    if duplex:
        openmode = _winapi.PIPE_ACCESS_DUPLEX
        access = _winapi.GENERIC_READ | _winapi.GENERIC_WRITE
        obsize, ibsize = bufsize, bufsize
    else:
        openmode = _winapi.PIPE_ACCESS_INBOUND
        access = _winapi.GENERIC_WRITE
        obsize, ibsize = 0, bufsize

    openmode |= _winapi.FILE_FLAG_FIRST_PIPE_INSTANCE

    if overlapped[0]:
        openmode |= _winapi.FILE_FLAG_OVERLAPPED

    if overlapped[1]:
        flags_and_attribs = _winapi.FILE_FLAG_OVERLAPPED
    else:
        flags_and_attribs = 0

    h1 = h2 = None
    try:
        h1 = _winapi.CreateNamedPipe(
            address, openmode, _winapi.PIPE_WAIT,
            1, obsize, ibsize, _winapi.NMPWAIT_WAIT_FOREVER, _winapi.NULL)

        h2 = _winapi.CreateFile(
            address, access, 0, _winapi.NULL, _winapi.OPEN_EXISTING,
            flags_and_attribs, _winapi.NULL)

        ov = _winapi.ConnectNamedPipe(h1, overlapped=True)
        ov.GetOverlappedResult(True)
        return h1, h2
    except:
        if h1 is not None:
            _winapi.CloseHandle(h1)
        if h2 is not None:
            _winapi.CloseHandle(h2)
        raise


# Wrapper for a pipe handle


class PipeHandle:
    """Wrapper for an overlapped pipe handle which is vaguely file-object like.

    The IOCP event loop can use these instead of socket objects.
    """
    def __init__(self, handle):
        self._handle = handle

    def __repr__(self):
        if self._handle is not None:
            handle = f'handle={self._handle!r}'
        else:
            handle = 'closed'
        return f'<{self.__class__.__name__} {handle}>'

    @property
    def handle(self):
        return self._handle

    def fileno(self):
        if self._handle is None:
            raise ValueError("I/O operation on closed pipe")
        return self._handle

    def close(self, *, CloseHandle=_winapi.CloseHandle):
        if self._handle is not None:
            CloseHandle(self._handle)
            self._handle = None

    def __del__(self, _warn=warnings.warn):
        if self._handle is not None:
            _warn(f"unclosed {self!r}", ResourceWarning, source=self)
            self.close()

    def __enter__(self):
        return self

    def __exit__(self, t, v, tb):
        self.close()


# Replacement for subprocess.Popen using overlapped pipe handles


class Popen(subprocess.Popen):
    """Replacement for subprocess.Popen using overlapped pipe handles.

    The stdin, stdout, stderr are None or instances of PipeHandle.
    """
    def __init__(self, args, stdin=None, stdout=None, stderr=None, **kwds):
        assert not kwds.get('universal_newlines')
        assert kwds.get('bufsize', 0) == 0
        stdin_rfd = stdout_wfd = stderr_wfd = None
        stdin_wh = stdout_rh = stderr_rh = None
        if stdin == PIPE:
            stdin_rh, stdin_wh = pipe(overlapped=(False, True), duplex=True)
            stdin_rfd = msvcrt.open_osfhandle(stdin_rh, os.O_RDONLY)
        else:
            stdin_rfd = stdin
        if stdout == PIPE:
            stdout_rh, stdout_wh = pipe(overlapped=(True, False))
            stdout_wfd = msvcrt.open_osfhandle(stdout_wh, 0)
        else:
            stdout_wfd = stdout
        if stderr == PIPE:
            stderr_rh, stderr_wh = pipe(overlapped=(True, False))
            stderr_wfd = msvcrt.open_osfhandle(stderr_wh, 0)
        elif stderr == STDOUT:
            stderr_wfd = stdout_wfd
        else:
            stderr_wfd = stderr
        try:
            super().__init__(args, stdin=stdin_rfd, stdout=stdout_wfd,
                             stderr=stderr_wfd, **kwds)
        except:
            for h in (stdin_wh, stdout_rh, stderr_rh):
                if h is not None:
                    _winapi.CloseHandle(h)
            raise
        else:
            if stdin_wh is not None:
                self.stdin = PipeHandle(stdin_wh)
            if stdout_rh is not None:
                self.stdout = PipeHandle(stdout_rh)
            if stderr_rh is not None:
                self.stderr = PipeHandle(stderr_rh)
        finally:
            if stdin == PIPE:
                os.close(stdin_rfd)
            if stdout == PIPE:
                os.close(stdout_wfd)
            if stderr == PIPE:
                os.close(stderr_wfd)
asyncio/futures.py000064400000031542151153537530010275 0ustar00"""A Future class similar to the one in PEP 3148."""

__all__ = (
    'Future', 'wrap_future', 'isfuture',
)

import concurrent.futures
import contextvars
import logging
import sys

from . import base_futures
from . import events
from . import exceptions
from . import format_helpers


isfuture = base_futures.isfuture


_PENDING = base_futures._PENDING
_CANCELLED = base_futures._CANCELLED
_FINISHED = base_futures._FINISHED


STACK_DEBUG = logging.DEBUG - 1  # heavy-duty debugging


class Future:
    """This class is *almost* compatible with concurrent.futures.Future.

    Differences:

    - This class is not thread-safe.

    - result() and exception() do not take a timeout argument and
      raise an exception when the future isn't done yet.

    - Callbacks registered with add_done_callback() are always called
      via the event loop's call_soon().

    - This class is not compatible with the wait() and as_completed()
      methods in the concurrent.futures package.

    (In Python 3.4 or later we may be able to unify the implementations.)
    """

    # Class variables serving as defaults for instance variables.
    _state = _PENDING
    _result = None
    _exception = None
    _loop = None
    _source_traceback = None

    # This field is used for a dual purpose:
    # - Its presence is a marker to declare that a class implements
    #   the Future protocol (i.e. is intended to be duck-type compatible).
    #   The value must also be not-None, to enable a subclass to declare
    #   that it is not compatible by setting this to None.
    # - It is set by __iter__() below so that Task._step() can tell
    #   the difference between
    #   `await Future()` or`yield from Future()` (correct) vs.
    #   `yield Future()` (incorrect).
    _asyncio_future_blocking = False

    __log_traceback = False

    def __init__(self, *, loop=None):
        """Initialize the future.

        The optional event_loop argument allows explicitly setting the event
        loop object used by the future. If it's not provided, the future uses
        the default event loop.
        """
        if loop is None:
            self._loop = events.get_event_loop()
        else:
            self._loop = loop
        self._callbacks = []
        if self._loop.get_debug():
            self._source_traceback = format_helpers.extract_stack(
                sys._getframe(1))

    _repr_info = base_futures._future_repr_info

    def __repr__(self):
        return '<{} {}>'.format(self.__class__.__name__,
                                ' '.join(self._repr_info()))

    def __del__(self):
        if not self.__log_traceback:
            # set_exception() was not called, or result() or exception()
            # has consumed the exception
            return
        exc = self._exception
        context = {
            'message':
                f'{self.__class__.__name__} exception was never retrieved',
            'exception': exc,
            'future': self,
        }
        if self._source_traceback:
            context['source_traceback'] = self._source_traceback
        self._loop.call_exception_handler(context)

    @property
    def _log_traceback(self):
        return self.__log_traceback

    @_log_traceback.setter
    def _log_traceback(self, val):
        if bool(val):
            raise ValueError('_log_traceback can only be set to False')
        self.__log_traceback = False

    def get_loop(self):
        """Return the event loop the Future is bound to."""
        loop = self._loop
        if loop is None:
            raise RuntimeError("Future object is not initialized.")
        return loop

    def cancel(self):
        """Cancel the future and schedule callbacks.

        If the future is already done or cancelled, return False.  Otherwise,
        change the future's state to cancelled, schedule the callbacks and
        return True.
        """
        self.__log_traceback = False
        if self._state != _PENDING:
            return False
        self._state = _CANCELLED
        self.__schedule_callbacks()
        return True

    def __schedule_callbacks(self):
        """Internal: Ask the event loop to call all callbacks.

        The callbacks are scheduled to be called as soon as possible. Also
        clears the callback list.
        """
        callbacks = self._callbacks[:]
        if not callbacks:
            return

        self._callbacks[:] = []
        for callback, ctx in callbacks:
            self._loop.call_soon(callback, self, context=ctx)

    def cancelled(self):
        """Return True if the future was cancelled."""
        return self._state == _CANCELLED

    # Don't implement running(); see http://bugs.python.org/issue18699

    def done(self):
        """Return True if the future is done.

        Done means either that a result / exception are available, or that the
        future was cancelled.
        """
        return self._state != _PENDING

    def result(self):
        """Return the result this future represents.

        If the future has been cancelled, raises CancelledError.  If the
        future's result isn't yet available, raises InvalidStateError.  If
        the future is done and has an exception set, this exception is raised.
        """
        if self._state == _CANCELLED:
            raise exceptions.CancelledError
        if self._state != _FINISHED:
            raise exceptions.InvalidStateError('Result is not ready.')
        self.__log_traceback = False
        if self._exception is not None:
            raise self._exception
        return self._result

    def exception(self):
        """Return the exception that was set on this future.

        The exception (or None if no exception was set) is returned only if
        the future is done.  If the future has been cancelled, raises
        CancelledError.  If the future isn't done yet, raises
        InvalidStateError.
        """
        if self._state == _CANCELLED:
            raise exceptions.CancelledError
        if self._state != _FINISHED:
            raise exceptions.InvalidStateError('Exception is not set.')
        self.__log_traceback = False
        return self._exception

    def add_done_callback(self, fn, *, context=None):
        """Add a callback to be run when the future becomes done.

        The callback is called with a single argument - the future object. If
        the future is already done when this is called, the callback is
        scheduled with call_soon.
        """
        if self._state != _PENDING:
            self._loop.call_soon(fn, self, context=context)
        else:
            if context is None:
                context = contextvars.copy_context()
            self._callbacks.append((fn, context))

    # New method not in PEP 3148.

    def remove_done_callback(self, fn):
        """Remove all instances of a callback from the "call when done" list.

        Returns the number of callbacks removed.
        """
        filtered_callbacks = [(f, ctx)
                              for (f, ctx) in self._callbacks
                              if f != fn]
        removed_count = len(self._callbacks) - len(filtered_callbacks)
        if removed_count:
            self._callbacks[:] = filtered_callbacks
        return removed_count

    # So-called internal methods (note: no set_running_or_notify_cancel()).

    def set_result(self, result):
        """Mark the future done and set its result.

        If the future is already done when this method is called, raises
        InvalidStateError.
        """
        if self._state != _PENDING:
            raise exceptions.InvalidStateError(f'{self._state}: {self!r}')
        self._result = result
        self._state = _FINISHED
        self.__schedule_callbacks()

    def set_exception(self, exception):
        """Mark the future done and set an exception.

        If the future is already done when this method is called, raises
        InvalidStateError.
        """
        if self._state != _PENDING:
            raise exceptions.InvalidStateError(f'{self._state}: {self!r}')
        if isinstance(exception, type):
            exception = exception()
        if type(exception) is StopIteration:
            raise TypeError("StopIteration interacts badly with generators "
                            "and cannot be raised into a Future")
        self._exception = exception
        self._state = _FINISHED
        self.__schedule_callbacks()
        self.__log_traceback = True

    def __await__(self):
        if not self.done():
            self._asyncio_future_blocking = True
            yield self  # This tells Task to wait for completion.
        if not self.done():
            raise RuntimeError("await wasn't used with future")
        return self.result()  # May raise too.

    __iter__ = __await__  # make compatible with 'yield from'.


# Needed for testing purposes.
_PyFuture = Future


def _get_loop(fut):
    # Tries to call Future.get_loop() if it's available.
    # Otherwise fallbacks to using the old '_loop' property.
    try:
        get_loop = fut.get_loop
    except AttributeError:
        pass
    else:
        return get_loop()
    return fut._loop


def _set_result_unless_cancelled(fut, result):
    """Helper setting the result only if the future was not cancelled."""
    if fut.cancelled():
        return
    fut.set_result(result)


def _convert_future_exc(exc):
    exc_class = type(exc)
    if exc_class is concurrent.futures.CancelledError:
        return exceptions.CancelledError(*exc.args)
    elif exc_class is concurrent.futures.TimeoutError:
        return exceptions.TimeoutError(*exc.args)
    elif exc_class is concurrent.futures.InvalidStateError:
        return exceptions.InvalidStateError(*exc.args)
    else:
        return exc


def _set_concurrent_future_state(concurrent, source):
    """Copy state from a future to a concurrent.futures.Future."""
    assert source.done()
    if source.cancelled():
        concurrent.cancel()
    if not concurrent.set_running_or_notify_cancel():
        return
    exception = source.exception()
    if exception is not None:
        concurrent.set_exception(_convert_future_exc(exception))
    else:
        result = source.result()
        concurrent.set_result(result)


def _copy_future_state(source, dest):
    """Internal helper to copy state from another Future.

    The other Future may be a concurrent.futures.Future.
    """
    assert source.done()
    if dest.cancelled():
        return
    assert not dest.done()
    if source.cancelled():
        dest.cancel()
    else:
        exception = source.exception()
        if exception is not None:
            dest.set_exception(_convert_future_exc(exception))
        else:
            result = source.result()
            dest.set_result(result)


def _chain_future(source, destination):
    """Chain two futures so that when one completes, so does the other.

    The result (or exception) of source will be copied to destination.
    If destination is cancelled, source gets cancelled too.
    Compatible with both asyncio.Future and concurrent.futures.Future.
    """
    if not isfuture(source) and not isinstance(source,
                                               concurrent.futures.Future):
        raise TypeError('A future is required for source argument')
    if not isfuture(destination) and not isinstance(destination,
                                                    concurrent.futures.Future):
        raise TypeError('A future is required for destination argument')
    source_loop = _get_loop(source) if isfuture(source) else None
    dest_loop = _get_loop(destination) if isfuture(destination) else None

    def _set_state(future, other):
        if isfuture(future):
            _copy_future_state(other, future)
        else:
            _set_concurrent_future_state(future, other)

    def _call_check_cancel(destination):
        if destination.cancelled():
            if source_loop is None or source_loop is dest_loop:
                source.cancel()
            else:
                source_loop.call_soon_threadsafe(source.cancel)

    def _call_set_state(source):
        if (destination.cancelled() and
                dest_loop is not None and dest_loop.is_closed()):
            return
        if dest_loop is None or dest_loop is source_loop:
            _set_state(destination, source)
        else:
            dest_loop.call_soon_threadsafe(_set_state, destination, source)

    destination.add_done_callback(_call_check_cancel)
    source.add_done_callback(_call_set_state)


def wrap_future(future, *, loop=None):
    """Wrap concurrent.futures.Future object."""
    if isfuture(future):
        return future
    assert isinstance(future, concurrent.futures.Future), \
        f'concurrent.futures.Future is expected, got {future!r}'
    if loop is None:
        loop = events.get_event_loop()
    new_future = loop.create_future()
    _chain_future(future, new_future)
    return new_future


try:
    import _asyncio
except ImportError:
    pass
else:
    # _CFuture is needed for tests.
    Future = _CFuture = _asyncio.Future
asyncio/coroutines.py000064400000021135151153537530010767 0ustar00__all__ = 'coroutine', 'iscoroutinefunction', 'iscoroutine'

import collections.abc
import functools
import inspect
import os
import sys
import traceback
import types
import warnings

from . import base_futures
from . import constants
from . import format_helpers
from .log import logger


def _is_debug_mode():
    # If you set _DEBUG to true, @coroutine will wrap the resulting
    # generator objects in a CoroWrapper instance (defined below).  That
    # instance will log a message when the generator is never iterated
    # over, which may happen when you forget to use "await" or "yield from"
    # with a coroutine call.
    # Note that the value of the _DEBUG flag is taken
    # when the decorator is used, so to be of any use it must be set
    # before you define your coroutines.  A downside of using this feature
    # is that tracebacks show entries for the CoroWrapper.__next__ method
    # when _DEBUG is true.
    return sys.flags.dev_mode or (not sys.flags.ignore_environment and
                                  bool(os.environ.get('PYTHONASYNCIODEBUG')))


_DEBUG = _is_debug_mode()


class CoroWrapper:
    # Wrapper for coroutine object in _DEBUG mode.

    def __init__(self, gen, func=None):
        assert inspect.isgenerator(gen) or inspect.iscoroutine(gen), gen
        self.gen = gen
        self.func = func  # Used to unwrap @coroutine decorator
        self._source_traceback = format_helpers.extract_stack(sys._getframe(1))
        self.__name__ = getattr(gen, '__name__', None)
        self.__qualname__ = getattr(gen, '__qualname__', None)

    def __repr__(self):
        coro_repr = _format_coroutine(self)
        if self._source_traceback:
            frame = self._source_traceback[-1]
            coro_repr += f', created at {frame[0]}:{frame[1]}'

        return f'<{self.__class__.__name__} {coro_repr}>'

    def __iter__(self):
        return self

    def __next__(self):
        return self.gen.send(None)

    def send(self, value):
        return self.gen.send(value)

    def throw(self, type, value=None, traceback=None):
        return self.gen.throw(type, value, traceback)

    def close(self):
        return self.gen.close()

    @property
    def gi_frame(self):
        return self.gen.gi_frame

    @property
    def gi_running(self):
        return self.gen.gi_running

    @property
    def gi_code(self):
        return self.gen.gi_code

    def __await__(self):
        return self

    @property
    def gi_yieldfrom(self):
        return self.gen.gi_yieldfrom

    def __del__(self):
        # Be careful accessing self.gen.frame -- self.gen might not exist.
        gen = getattr(self, 'gen', None)
        frame = getattr(gen, 'gi_frame', None)
        if frame is not None and frame.f_lasti == -1:
            msg = f'{self!r} was never yielded from'
            tb = getattr(self, '_source_traceback', ())
            if tb:
                tb = ''.join(traceback.format_list(tb))
                msg += (f'\nCoroutine object created at '
                        f'(most recent call last, truncated to '
                        f'{constants.DEBUG_STACK_DEPTH} last lines):\n')
                msg += tb.rstrip()
            logger.error(msg)


def coroutine(func):
    """Decorator to mark coroutines.

    If the coroutine is not yielded from before it is destroyed,
    an error message is logged.
    """
    warnings.warn('"@coroutine" decorator is deprecated since Python 3.8, use "async def" instead',
                  DeprecationWarning,
                  stacklevel=2)
    if inspect.iscoroutinefunction(func):
        # In Python 3.5 that's all we need to do for coroutines
        # defined with "async def".
        return func

    if inspect.isgeneratorfunction(func):
        coro = func
    else:
        @functools.wraps(func)
        def coro(*args, **kw):
            res = func(*args, **kw)
            if (base_futures.isfuture(res) or inspect.isgenerator(res) or
                    isinstance(res, CoroWrapper)):
                res = yield from res
            else:
                # If 'res' is an awaitable, run it.
                try:
                    await_meth = res.__await__
                except AttributeError:
                    pass
                else:
                    if isinstance(res, collections.abc.Awaitable):
                        res = yield from await_meth()
            return res

    coro = types.coroutine(coro)
    if not _DEBUG:
        wrapper = coro
    else:
        @functools.wraps(func)
        def wrapper(*args, **kwds):
            w = CoroWrapper(coro(*args, **kwds), func=func)
            if w._source_traceback:
                del w._source_traceback[-1]
            # Python < 3.5 does not implement __qualname__
            # on generator objects, so we set it manually.
            # We use getattr as some callables (such as
            # functools.partial may lack __qualname__).
            w.__name__ = getattr(func, '__name__', None)
            w.__qualname__ = getattr(func, '__qualname__', None)
            return w

    wrapper._is_coroutine = _is_coroutine  # For iscoroutinefunction().
    return wrapper


# A marker for iscoroutinefunction.
_is_coroutine = object()


def iscoroutinefunction(func):
    """Return True if func is a decorated coroutine function."""
    return (inspect.iscoroutinefunction(func) or
            getattr(func, '_is_coroutine', None) is _is_coroutine)


# Prioritize native coroutine check to speed-up
# asyncio.iscoroutine.
_COROUTINE_TYPES = (types.CoroutineType, types.GeneratorType,
                    collections.abc.Coroutine, CoroWrapper)
_iscoroutine_typecache = set()


def iscoroutine(obj):
    """Return True if obj is a coroutine object."""
    if type(obj) in _iscoroutine_typecache:
        return True

    if isinstance(obj, _COROUTINE_TYPES):
        # Just in case we don't want to cache more than 100
        # positive types.  That shouldn't ever happen, unless
        # someone stressing the system on purpose.
        if len(_iscoroutine_typecache) < 100:
            _iscoroutine_typecache.add(type(obj))
        return True
    else:
        return False


def _format_coroutine(coro):
    assert iscoroutine(coro)

    is_corowrapper = isinstance(coro, CoroWrapper)

    def get_name(coro):
        # Coroutines compiled with Cython sometimes don't have
        # proper __qualname__ or __name__.  While that is a bug
        # in Cython, asyncio shouldn't crash with an AttributeError
        # in its __repr__ functions.
        if is_corowrapper:
            return format_helpers._format_callback(coro.func, (), {})

        if hasattr(coro, '__qualname__') and coro.__qualname__:
            coro_name = coro.__qualname__
        elif hasattr(coro, '__name__') and coro.__name__:
            coro_name = coro.__name__
        else:
            # Stop masking Cython bugs, expose them in a friendly way.
            coro_name = f'<{type(coro).__name__} without __name__>'
        return f'{coro_name}()'

    def is_running(coro):
        try:
            return coro.cr_running
        except AttributeError:
            try:
                return coro.gi_running
            except AttributeError:
                return False

    coro_code = None
    if hasattr(coro, 'cr_code') and coro.cr_code:
        coro_code = coro.cr_code
    elif hasattr(coro, 'gi_code') and coro.gi_code:
        coro_code = coro.gi_code

    coro_name = get_name(coro)

    if not coro_code:
        # Built-in types might not have __qualname__ or __name__.
        if is_running(coro):
            return f'{coro_name} running'
        else:
            return coro_name

    coro_frame = None
    if hasattr(coro, 'gi_frame') and coro.gi_frame:
        coro_frame = coro.gi_frame
    elif hasattr(coro, 'cr_frame') and coro.cr_frame:
        coro_frame = coro.cr_frame

    # If Cython's coroutine has a fake code object without proper
    # co_filename -- expose that.
    filename = coro_code.co_filename or '<empty co_filename>'

    lineno = 0
    if (is_corowrapper and
            coro.func is not None and
            not inspect.isgeneratorfunction(coro.func)):
        source = format_helpers._get_function_source(coro.func)
        if source is not None:
            filename, lineno = source
        if coro_frame is None:
            coro_repr = f'{coro_name} done, defined at {filename}:{lineno}'
        else:
            coro_repr = f'{coro_name} running, defined at {filename}:{lineno}'

    elif coro_frame is not None:
        lineno = coro_frame.f_lineno
        coro_repr = f'{coro_name} running at {filename}:{lineno}'

    else:
        lineno = coro_code.co_firstlineno
        coro_repr = f'{coro_name} done, defined at {filename}:{lineno}'

    return coro_repr
asyncio/log.py000064400000000174151153537530007356 0ustar00"""Logging configuration."""

import logging


# Name the logger after the package.
logger = logging.getLogger(__package__)
codecs.py000064400000107473151153537530006402 0ustar00""" codecs -- Python Codec Registry, API and helpers.


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

"""

import builtins
import sys

### Registry and builtin stateless codec functions

try:
    from _codecs import *
except ImportError as why:
    raise SystemError('Failed to load the builtin codecs: %s' % why)

__all__ = ["register", "lookup", "open", "EncodedFile", "BOM", "BOM_BE",
           "BOM_LE", "BOM32_BE", "BOM32_LE", "BOM64_BE", "BOM64_LE",
           "BOM_UTF8", "BOM_UTF16", "BOM_UTF16_LE", "BOM_UTF16_BE",
           "BOM_UTF32", "BOM_UTF32_LE", "BOM_UTF32_BE",
           "CodecInfo", "Codec", "IncrementalEncoder", "IncrementalDecoder",
           "StreamReader", "StreamWriter",
           "StreamReaderWriter", "StreamRecoder",
           "getencoder", "getdecoder", "getincrementalencoder",
           "getincrementaldecoder", "getreader", "getwriter",
           "encode", "decode", "iterencode", "iterdecode",
           "strict_errors", "ignore_errors", "replace_errors",
           "xmlcharrefreplace_errors",
           "backslashreplace_errors", "namereplace_errors",
           "register_error", "lookup_error"]

### Constants

#
# Byte Order Mark (BOM = ZERO WIDTH NO-BREAK SPACE = U+FEFF)
# and its possible byte string values
# for UTF8/UTF16/UTF32 output and little/big endian machines
#

# UTF-8
BOM_UTF8 = b'\xef\xbb\xbf'

# UTF-16, little endian
BOM_LE = BOM_UTF16_LE = b'\xff\xfe'

# UTF-16, big endian
BOM_BE = BOM_UTF16_BE = b'\xfe\xff'

# UTF-32, little endian
BOM_UTF32_LE = b'\xff\xfe\x00\x00'

# UTF-32, big endian
BOM_UTF32_BE = b'\x00\x00\xfe\xff'

if sys.byteorder == 'little':

    # UTF-16, native endianness
    BOM = BOM_UTF16 = BOM_UTF16_LE

    # UTF-32, native endianness
    BOM_UTF32 = BOM_UTF32_LE

else:

    # UTF-16, native endianness
    BOM = BOM_UTF16 = BOM_UTF16_BE

    # UTF-32, native endianness
    BOM_UTF32 = BOM_UTF32_BE

# Old broken names (don't use in new code)
BOM32_LE = BOM_UTF16_LE
BOM32_BE = BOM_UTF16_BE
BOM64_LE = BOM_UTF32_LE
BOM64_BE = BOM_UTF32_BE


### Codec base classes (defining the API)

class CodecInfo(tuple):
    """Codec details when looking up the codec registry"""

    # Private API to allow Python 3.4 to blacklist the known non-Unicode
    # codecs in the standard library. A more general mechanism to
    # reliably distinguish test encodings from other codecs will hopefully
    # be defined for Python 3.5
    #
    # See http://bugs.python.org/issue19619
    _is_text_encoding = True # Assume codecs are text encodings by default

    def __new__(cls, encode, decode, streamreader=None, streamwriter=None,
        incrementalencoder=None, incrementaldecoder=None, name=None,
        *, _is_text_encoding=None):
        self = tuple.__new__(cls, (encode, decode, streamreader, streamwriter))
        self.name = name
        self.encode = encode
        self.decode = decode
        self.incrementalencoder = incrementalencoder
        self.incrementaldecoder = incrementaldecoder
        self.streamwriter = streamwriter
        self.streamreader = streamreader
        if _is_text_encoding is not None:
            self._is_text_encoding = _is_text_encoding
        return self

    def __repr__(self):
        return "<%s.%s object for encoding %s at %#x>" % \
                (self.__class__.__module__, self.__class__.__qualname__,
                 self.name, id(self))

class Codec:

    """ Defines the interface for stateless encoders/decoders.

        The .encode()/.decode() methods may use different error
        handling schemes by providing the errors argument. These
        string values are predefined:

         'strict' - raise a ValueError error (or a subclass)
         'ignore' - ignore the character and continue with the next
         'replace' - replace with a suitable replacement character;
                    Python will use the official U+FFFD REPLACEMENT
                    CHARACTER for the builtin Unicode codecs on
                    decoding and '?' on encoding.
         'surrogateescape' - replace with private code points U+DCnn.
         'xmlcharrefreplace' - Replace with the appropriate XML
                               character reference (only for encoding).
         'backslashreplace'  - Replace with backslashed escape sequences.
         'namereplace'       - Replace with \\N{...} escape sequences
                               (only for encoding).

        The set of allowed values can be extended via register_error.

    """
    def encode(self, input, errors='strict'):

        """ Encodes the object input and returns a tuple (output
            object, length consumed).

            errors defines the error handling to apply. It defaults to
            'strict' handling.

            The method may not store state in the Codec instance. Use
            StreamWriter for codecs which have to keep state in order to
            make encoding efficient.

            The encoder must be able to handle zero length input and
            return an empty object of the output object type in this
            situation.

        """
        raise NotImplementedError

    def decode(self, input, errors='strict'):

        """ Decodes the object input and returns a tuple (output
            object, length consumed).

            input must be an object which provides the bf_getreadbuf
            buffer slot. Python strings, buffer objects and memory
            mapped files are examples of objects providing this slot.

            errors defines the error handling to apply. It defaults to
            'strict' handling.

            The method may not store state in the Codec instance. Use
            StreamReader for codecs which have to keep state in order to
            make decoding efficient.

            The decoder must be able to handle zero length input and
            return an empty object of the output object type in this
            situation.

        """
        raise NotImplementedError

class IncrementalEncoder(object):
    """
    An IncrementalEncoder encodes an input in multiple steps. The input can
    be passed piece by piece to the encode() method. The IncrementalEncoder
    remembers the state of the encoding process between calls to encode().
    """
    def __init__(self, errors='strict'):
        """
        Creates an IncrementalEncoder instance.

        The IncrementalEncoder may use different error handling schemes by
        providing the errors keyword argument. See the module docstring
        for a list of possible values.
        """
        self.errors = errors
        self.buffer = ""

    def encode(self, input, final=False):
        """
        Encodes input and returns the resulting object.
        """
        raise NotImplementedError

    def reset(self):
        """
        Resets the encoder to the initial state.
        """

    def getstate(self):
        """
        Return the current state of the encoder.
        """
        return 0

    def setstate(self, state):
        """
        Set the current state of the encoder. state must have been
        returned by getstate().
        """

class BufferedIncrementalEncoder(IncrementalEncoder):
    """
    This subclass of IncrementalEncoder can be used as the baseclass for an
    incremental encoder if the encoder must keep some of the output in a
    buffer between calls to encode().
    """
    def __init__(self, errors='strict'):
        IncrementalEncoder.__init__(self, errors)
        # unencoded input that is kept between calls to encode()
        self.buffer = ""

    def _buffer_encode(self, input, errors, final):
        # Overwrite this method in subclasses: It must encode input
        # and return an (output, length consumed) tuple
        raise NotImplementedError

    def encode(self, input, final=False):
        # encode input (taking the buffer into account)
        data = self.buffer + input
        (result, consumed) = self._buffer_encode(data, self.errors, final)
        # keep unencoded input until the next call
        self.buffer = data[consumed:]
        return result

    def reset(self):
        IncrementalEncoder.reset(self)
        self.buffer = ""

    def getstate(self):
        return self.buffer or 0

    def setstate(self, state):
        self.buffer = state or ""

class IncrementalDecoder(object):
    """
    An IncrementalDecoder decodes an input in multiple steps. The input can
    be passed piece by piece to the decode() method. The IncrementalDecoder
    remembers the state of the decoding process between calls to decode().
    """
    def __init__(self, errors='strict'):
        """
        Create an IncrementalDecoder instance.

        The IncrementalDecoder may use different error handling schemes by
        providing the errors keyword argument. See the module docstring
        for a list of possible values.
        """
        self.errors = errors

    def decode(self, input, final=False):
        """
        Decode input and returns the resulting object.
        """
        raise NotImplementedError

    def reset(self):
        """
        Reset the decoder to the initial state.
        """

    def getstate(self):
        """
        Return the current state of the decoder.

        This must be a (buffered_input, additional_state_info) tuple.
        buffered_input must be a bytes object containing bytes that
        were passed to decode() that have not yet been converted.
        additional_state_info must be a non-negative integer
        representing the state of the decoder WITHOUT yet having
        processed the contents of buffered_input.  In the initial state
        and after reset(), getstate() must return (b"", 0).
        """
        return (b"", 0)

    def setstate(self, state):
        """
        Set the current state of the decoder.

        state must have been returned by getstate().  The effect of
        setstate((b"", 0)) must be equivalent to reset().
        """

class BufferedIncrementalDecoder(IncrementalDecoder):
    """
    This subclass of IncrementalDecoder can be used as the baseclass for an
    incremental decoder if the decoder must be able to handle incomplete
    byte sequences.
    """
    def __init__(self, errors='strict'):
        IncrementalDecoder.__init__(self, errors)
        # undecoded input that is kept between calls to decode()
        self.buffer = b""

    def _buffer_decode(self, input, errors, final):
        # Overwrite this method in subclasses: It must decode input
        # and return an (output, length consumed) tuple
        raise NotImplementedError

    def decode(self, input, final=False):
        # decode input (taking the buffer into account)
        data = self.buffer + input
        (result, consumed) = self._buffer_decode(data, self.errors, final)
        # keep undecoded input until the next call
        self.buffer = data[consumed:]
        return result

    def reset(self):
        IncrementalDecoder.reset(self)
        self.buffer = b""

    def getstate(self):
        # additional state info is always 0
        return (self.buffer, 0)

    def setstate(self, state):
        # ignore additional state info
        self.buffer = state[0]

#
# The StreamWriter and StreamReader class provide generic working
# interfaces which can be used to implement new encoding submodules
# very easily. See encodings/utf_8.py for an example on how this is
# done.
#

class StreamWriter(Codec):

    def __init__(self, stream, errors='strict'):

        """ Creates a StreamWriter instance.

            stream must be a file-like object open for writing.

            The StreamWriter may use different error handling
            schemes by providing the errors keyword argument. These
            parameters are predefined:

             'strict' - raise a ValueError (or a subclass)
             'ignore' - ignore the character and continue with the next
             'replace'- replace with a suitable replacement character
             'xmlcharrefreplace' - Replace with the appropriate XML
                                   character reference.
             'backslashreplace'  - Replace with backslashed escape
                                   sequences.
             'namereplace'       - Replace with \\N{...} escape sequences.

            The set of allowed parameter values can be extended via
            register_error.
        """
        self.stream = stream
        self.errors = errors

    def write(self, object):

        """ Writes the object's contents encoded to self.stream.
        """
        data, consumed = self.encode(object, self.errors)
        self.stream.write(data)

    def writelines(self, list):

        """ Writes the concatenated list of strings to the stream
            using .write().
        """
        self.write(''.join(list))

    def reset(self):

        """ Flushes and resets the codec buffers used for keeping state.

            Calling this method should ensure that the data on the
            output is put into a clean state, that allows appending
            of new fresh data without having to rescan the whole
            stream to recover state.

        """
        pass

    def seek(self, offset, whence=0):
        self.stream.seek(offset, whence)
        if whence == 0 and offset == 0:
            self.reset()

    def __getattr__(self, name,
                    getattr=getattr):

        """ Inherit all other methods from the underlying stream.
        """
        return getattr(self.stream, name)

    def __enter__(self):
        return self

    def __exit__(self, type, value, tb):
        self.stream.close()

###

class StreamReader(Codec):

    charbuffertype = str

    def __init__(self, stream, errors='strict'):

        """ Creates a StreamReader instance.

            stream must be a file-like object open for reading.

            The StreamReader may use different error handling
            schemes by providing the errors keyword argument. These
            parameters are predefined:

             'strict' - raise a ValueError (or a subclass)
             'ignore' - ignore the character and continue with the next
             'replace'- replace with a suitable replacement character
             'backslashreplace' - Replace with backslashed escape sequences;

            The set of allowed parameter values can be extended via
            register_error.
        """
        self.stream = stream
        self.errors = errors
        self.bytebuffer = b""
        self._empty_charbuffer = self.charbuffertype()
        self.charbuffer = self._empty_charbuffer
        self.linebuffer = None

    def decode(self, input, errors='strict'):
        raise NotImplementedError

    def read(self, size=-1, chars=-1, firstline=False):

        """ Decodes data from the stream self.stream and returns the
            resulting object.

            chars indicates the number of decoded code points or bytes to
            return. read() will never return more data than requested,
            but it might return less, if there is not enough available.

            size indicates the approximate maximum number of decoded
            bytes or code points to read for decoding. The decoder
            can modify this setting as appropriate. The default value
            -1 indicates to read and decode as much as possible.  size
            is intended to prevent having to decode huge files in one
            step.

            If firstline is true, and a UnicodeDecodeError happens
            after the first line terminator in the input only the first line
            will be returned, the rest of the input will be kept until the
            next call to read().

            The method should use a greedy read strategy, meaning that
            it should read as much data as is allowed within the
            definition of the encoding and the given size, e.g.  if
            optional encoding endings or state markers are available
            on the stream, these should be read too.
        """
        # If we have lines cached, first merge them back into characters
        if self.linebuffer:
            self.charbuffer = self._empty_charbuffer.join(self.linebuffer)
            self.linebuffer = None

        if chars < 0:
            # For compatibility with other read() methods that take a
            # single argument
            chars = size

        # read until we get the required number of characters (if available)
        while True:
            # can the request be satisfied from the character buffer?
            if chars >= 0:
                if len(self.charbuffer) >= chars:
                    break
            # we need more data
            if size < 0:
                newdata = self.stream.read()
            else:
                newdata = self.stream.read(size)
            # decode bytes (those remaining from the last call included)
            data = self.bytebuffer + newdata
            if not data:
                break
            try:
                newchars, decodedbytes = self.decode(data, self.errors)
            except UnicodeDecodeError as exc:
                if firstline:
                    newchars, decodedbytes = \
                        self.decode(data[:exc.start], self.errors)
                    lines = newchars.splitlines(keepends=True)
                    if len(lines)<=1:
                        raise
                else:
                    raise
            # keep undecoded bytes until the next call
            self.bytebuffer = data[decodedbytes:]
            # put new characters in the character buffer
            self.charbuffer += newchars
            # there was no data available
            if not newdata:
                break
        if chars < 0:
            # Return everything we've got
            result = self.charbuffer
            self.charbuffer = self._empty_charbuffer
        else:
            # Return the first chars characters
            result = self.charbuffer[:chars]
            self.charbuffer = self.charbuffer[chars:]
        return result

    def readline(self, size=None, keepends=True):

        """ Read one line from the input stream and return the
            decoded data.

            size, if given, is passed as size argument to the
            read() method.

        """
        # If we have lines cached from an earlier read, return
        # them unconditionally
        if self.linebuffer:
            line = self.linebuffer[0]
            del self.linebuffer[0]
            if len(self.linebuffer) == 1:
                # revert to charbuffer mode; we might need more data
                # next time
                self.charbuffer = self.linebuffer[0]
                self.linebuffer = None
            if not keepends:
                line = line.splitlines(keepends=False)[0]
            return line

        readsize = size or 72
        line = self._empty_charbuffer
        # If size is given, we call read() only once
        while True:
            data = self.read(readsize, firstline=True)
            if data:
                # If we're at a "\r" read one extra character (which might
                # be a "\n") to get a proper line ending. If the stream is
                # temporarily exhausted we return the wrong line ending.
                if (isinstance(data, str) and data.endswith("\r")) or \
                   (isinstance(data, bytes) and data.endswith(b"\r")):
                    data += self.read(size=1, chars=1)

            line += data
            lines = line.splitlines(keepends=True)
            if lines:
                if len(lines) > 1:
                    # More than one line result; the first line is a full line
                    # to return
                    line = lines[0]
                    del lines[0]
                    if len(lines) > 1:
                        # cache the remaining lines
                        lines[-1] += self.charbuffer
                        self.linebuffer = lines
                        self.charbuffer = None
                    else:
                        # only one remaining line, put it back into charbuffer
                        self.charbuffer = lines[0] + self.charbuffer
                    if not keepends:
                        line = line.splitlines(keepends=False)[0]
                    break
                line0withend = lines[0]
                line0withoutend = lines[0].splitlines(keepends=False)[0]
                if line0withend != line0withoutend: # We really have a line end
                    # Put the rest back together and keep it until the next call
                    self.charbuffer = self._empty_charbuffer.join(lines[1:]) + \
                                      self.charbuffer
                    if keepends:
                        line = line0withend
                    else:
                        line = line0withoutend
                    break
            # we didn't get anything or this was our only try
            if not data or size is not None:
                if line and not keepends:
                    line = line.splitlines(keepends=False)[0]
                break
            if readsize < 8000:
                readsize *= 2
        return line

    def readlines(self, sizehint=None, keepends=True):

        """ Read all lines available on the input stream
            and return them as a list.

            Line breaks are implemented using the codec's decoder
            method and are included in the list entries.

            sizehint, if given, is ignored since there is no efficient
            way to finding the true end-of-line.

        """
        data = self.read()
        return data.splitlines(keepends)

    def reset(self):

        """ Resets the codec buffers used for keeping state.

            Note that no stream repositioning should take place.
            This method is primarily intended to be able to recover
            from decoding errors.

        """
        self.bytebuffer = b""
        self.charbuffer = self._empty_charbuffer
        self.linebuffer = None

    def seek(self, offset, whence=0):
        """ Set the input stream's current position.

            Resets the codec buffers used for keeping state.
        """
        self.stream.seek(offset, whence)
        self.reset()

    def __next__(self):

        """ Return the next decoded line from the input stream."""
        line = self.readline()
        if line:
            return line
        raise StopIteration

    def __iter__(self):
        return self

    def __getattr__(self, name,
                    getattr=getattr):

        """ Inherit all other methods from the underlying stream.
        """
        return getattr(self.stream, name)

    def __enter__(self):
        return self

    def __exit__(self, type, value, tb):
        self.stream.close()

###

class StreamReaderWriter:

    """ StreamReaderWriter instances allow wrapping streams which
        work in both read and write modes.

        The design is such that one can use the factory functions
        returned by the codec.lookup() function to construct the
        instance.

    """
    # Optional attributes set by the file wrappers below
    encoding = 'unknown'

    def __init__(self, stream, Reader, Writer, errors='strict'):

        """ Creates a StreamReaderWriter instance.

            stream must be a Stream-like object.

            Reader, Writer must be factory functions or classes
            providing the StreamReader, StreamWriter interface resp.

            Error handling is done in the same way as defined for the
            StreamWriter/Readers.

        """
        self.stream = stream
        self.reader = Reader(stream, errors)
        self.writer = Writer(stream, errors)
        self.errors = errors

    def read(self, size=-1):

        return self.reader.read(size)

    def readline(self, size=None):

        return self.reader.readline(size)

    def readlines(self, sizehint=None):

        return self.reader.readlines(sizehint)

    def __next__(self):

        """ Return the next decoded line from the input stream."""
        return next(self.reader)

    def __iter__(self):
        return self

    def write(self, data):

        return self.writer.write(data)

    def writelines(self, list):

        return self.writer.writelines(list)

    def reset(self):

        self.reader.reset()
        self.writer.reset()

    def seek(self, offset, whence=0):
        self.stream.seek(offset, whence)
        self.reader.reset()
        if whence == 0 and offset == 0:
            self.writer.reset()

    def __getattr__(self, name,
                    getattr=getattr):

        """ Inherit all other methods from the underlying stream.
        """
        return getattr(self.stream, name)

    # these are needed to make "with StreamReaderWriter(...)" work properly

    def __enter__(self):
        return self

    def __exit__(self, type, value, tb):
        self.stream.close()

###

class StreamRecoder:

    """ StreamRecoder instances translate data from one encoding to another.

        They use the complete set of APIs returned by the
        codecs.lookup() function to implement their task.

        Data written to the StreamRecoder is first decoded into an
        intermediate format (depending on the "decode" codec) and then
        written to the underlying stream using an instance of the provided
        Writer class.

        In the other direction, data is read from the underlying stream using
        a Reader instance and then encoded and returned to the caller.

    """
    # Optional attributes set by the file wrappers below
    data_encoding = 'unknown'
    file_encoding = 'unknown'

    def __init__(self, stream, encode, decode, Reader, Writer,
                 errors='strict'):

        """ Creates a StreamRecoder instance which implements a two-way
            conversion: encode and decode work on the frontend (the
            data visible to .read() and .write()) while Reader and Writer
            work on the backend (the data in stream).

            You can use these objects to do transparent
            transcodings from e.g. latin-1 to utf-8 and back.

            stream must be a file-like object.

            encode and decode must adhere to the Codec interface; Reader and
            Writer must be factory functions or classes providing the
            StreamReader and StreamWriter interfaces resp.

            Error handling is done in the same way as defined for the
            StreamWriter/Readers.

        """
        self.stream = stream
        self.encode = encode
        self.decode = decode
        self.reader = Reader(stream, errors)
        self.writer = Writer(stream, errors)
        self.errors = errors

    def read(self, size=-1):

        data = self.reader.read(size)
        data, bytesencoded = self.encode(data, self.errors)
        return data

    def readline(self, size=None):

        if size is None:
            data = self.reader.readline()
        else:
            data = self.reader.readline(size)
        data, bytesencoded = self.encode(data, self.errors)
        return data

    def readlines(self, sizehint=None):

        data = self.reader.read()
        data, bytesencoded = self.encode(data, self.errors)
        return data.splitlines(keepends=True)

    def __next__(self):

        """ Return the next decoded line from the input stream."""
        data = next(self.reader)
        data, bytesencoded = self.encode(data, self.errors)
        return data

    def __iter__(self):
        return self

    def write(self, data):

        data, bytesdecoded = self.decode(data, self.errors)
        return self.writer.write(data)

    def writelines(self, list):

        data = b''.join(list)
        data, bytesdecoded = self.decode(data, self.errors)
        return self.writer.write(data)

    def reset(self):

        self.reader.reset()
        self.writer.reset()

    def seek(self, offset, whence=0):
        # Seeks must be propagated to both the readers and writers
        # as they might need to reset their internal buffers.
        self.reader.seek(offset, whence)
        self.writer.seek(offset, whence)

    def __getattr__(self, name,
                    getattr=getattr):

        """ Inherit all other methods from the underlying stream.
        """
        return getattr(self.stream, name)

    def __enter__(self):
        return self

    def __exit__(self, type, value, tb):
        self.stream.close()

### Shortcuts

def open(filename, mode='r', encoding=None, errors='strict', buffering=-1):

    """ Open an encoded file using the given mode and return
        a wrapped version providing transparent encoding/decoding.

        Note: The wrapped version will only accept the object format
        defined by the codecs, i.e. Unicode objects for most builtin
        codecs. Output is also codec dependent and will usually be
        Unicode as well.

        Underlying encoded files are always opened in binary mode.
        The default file mode is 'r', meaning to open the file in read mode.

        encoding specifies the encoding which is to be used for the
        file.

        errors may be given to define the error handling. It defaults
        to 'strict' which causes ValueErrors to be raised in case an
        encoding error occurs.

        buffering has the same meaning as for the builtin open() API.
        It defaults to -1 which means that the default buffer size will
        be used.

        The returned wrapped file object provides an extra attribute
        .encoding which allows querying the used encoding. This
        attribute is only available if an encoding was specified as
        parameter.

    """
    if encoding is not None and \
       'b' not in mode:
        # Force opening of the file in binary mode
        mode = mode + 'b'
    file = builtins.open(filename, mode, buffering)
    if encoding is None:
        return file

    try:
        info = lookup(encoding)
        srw = StreamReaderWriter(file, info.streamreader, info.streamwriter, errors)
        # Add attributes to simplify introspection
        srw.encoding = encoding
        return srw
    except:
        file.close()
        raise

def EncodedFile(file, data_encoding, file_encoding=None, errors='strict'):

    """ Return a wrapped version of file which provides transparent
        encoding translation.

        Data written to the wrapped file is decoded according
        to the given data_encoding and then encoded to the underlying
        file using file_encoding. The intermediate data type
        will usually be Unicode but depends on the specified codecs.

        Bytes read from the file are decoded using file_encoding and then
        passed back to the caller encoded using data_encoding.

        If file_encoding is not given, it defaults to data_encoding.

        errors may be given to define the error handling. It defaults
        to 'strict' which causes ValueErrors to be raised in case an
        encoding error occurs.

        The returned wrapped file object provides two extra attributes
        .data_encoding and .file_encoding which reflect the given
        parameters of the same name. The attributes can be used for
        introspection by Python programs.

    """
    if file_encoding is None:
        file_encoding = data_encoding
    data_info = lookup(data_encoding)
    file_info = lookup(file_encoding)
    sr = StreamRecoder(file, data_info.encode, data_info.decode,
                       file_info.streamreader, file_info.streamwriter, errors)
    # Add attributes to simplify introspection
    sr.data_encoding = data_encoding
    sr.file_encoding = file_encoding
    return sr

### Helpers for codec lookup

def getencoder(encoding):

    """ Lookup up the codec for the given encoding and return
        its encoder function.

        Raises a LookupError in case the encoding cannot be found.

    """
    return lookup(encoding).encode

def getdecoder(encoding):

    """ Lookup up the codec for the given encoding and return
        its decoder function.

        Raises a LookupError in case the encoding cannot be found.

    """
    return lookup(encoding).decode

def getincrementalencoder(encoding):

    """ Lookup up the codec for the given encoding and return
        its IncrementalEncoder class or factory function.

        Raises a LookupError in case the encoding cannot be found
        or the codecs doesn't provide an incremental encoder.

    """
    encoder = lookup(encoding).incrementalencoder
    if encoder is None:
        raise LookupError(encoding)
    return encoder

def getincrementaldecoder(encoding):

    """ Lookup up the codec for the given encoding and return
        its IncrementalDecoder class or factory function.

        Raises a LookupError in case the encoding cannot be found
        or the codecs doesn't provide an incremental decoder.

    """
    decoder = lookup(encoding).incrementaldecoder
    if decoder is None:
        raise LookupError(encoding)
    return decoder

def getreader(encoding):

    """ Lookup up the codec for the given encoding and return
        its StreamReader class or factory function.

        Raises a LookupError in case the encoding cannot be found.

    """
    return lookup(encoding).streamreader

def getwriter(encoding):

    """ Lookup up the codec for the given encoding and return
        its StreamWriter class or factory function.

        Raises a LookupError in case the encoding cannot be found.

    """
    return lookup(encoding).streamwriter

def iterencode(iterator, encoding, errors='strict', **kwargs):
    """
    Encoding iterator.

    Encodes the input strings from the iterator using an IncrementalEncoder.

    errors and kwargs are passed through to the IncrementalEncoder
    constructor.
    """
    encoder = getincrementalencoder(encoding)(errors, **kwargs)
    for input in iterator:
        output = encoder.encode(input)
        if output:
            yield output
    output = encoder.encode("", True)
    if output:
        yield output

def iterdecode(iterator, encoding, errors='strict', **kwargs):
    """
    Decoding iterator.

    Decodes the input strings from the iterator using an IncrementalDecoder.

    errors and kwargs are passed through to the IncrementalDecoder
    constructor.
    """
    decoder = getincrementaldecoder(encoding)(errors, **kwargs)
    for input in iterator:
        output = decoder.decode(input)
        if output:
            yield output
    output = decoder.decode(b"", True)
    if output:
        yield output

### Helpers for charmap-based codecs

def make_identity_dict(rng):

    """ make_identity_dict(rng) -> dict

        Return a dictionary where elements of the rng sequence are
        mapped to themselves.

    """
    return {i:i for i in rng}

def make_encoding_map(decoding_map):

    """ Creates an encoding map from a decoding map.

        If a target mapping in the decoding map occurs multiple
        times, then that target is mapped to None (undefined mapping),
        causing an exception when encountered by the charmap codec
        during translation.

        One example where this happens is cp875.py which decodes
        multiple character to \\u001a.

    """
    m = {}
    for k,v in decoding_map.items():
        if not v in m:
            m[v] = k
        else:
            m[v] = None
    return m

### error handlers

try:
    strict_errors = lookup_error("strict")
    ignore_errors = lookup_error("ignore")
    replace_errors = lookup_error("replace")
    xmlcharrefreplace_errors = lookup_error("xmlcharrefreplace")
    backslashreplace_errors = lookup_error("backslashreplace")
    namereplace_errors = lookup_error("namereplace")
except LookupError:
    # In --disable-unicode builds, these error handler are missing
    strict_errors = None
    ignore_errors = None
    replace_errors = None
    xmlcharrefreplace_errors = None
    backslashreplace_errors = None
    namereplace_errors = None

# Tell modulefinder that using codecs probably needs the encodings
# package
_false = 0
if _false:
    import encodings

### Tests

if __name__ == '__main__':

    # Make stdout translate Latin-1 output into UTF-8 output
    sys.stdout = EncodedFile(sys.stdout, 'latin-1', 'utf-8')

    # Have stdin translate Latin-1 input into UTF-8 input
    sys.stdin = EncodedFile(sys.stdin, 'utf-8', 'latin-1')
textwrap.py000064400000045717151153537530007022 0ustar00"""Text wrapping and filling.
"""

# Copyright (C) 1999-2001 Gregory P. Ward.
# Copyright (C) 2002, 2003 Python Software Foundation.
# Written by Greg Ward <gward@python.net>

import re

__all__ = ['TextWrapper', 'wrap', 'fill', 'dedent', 'indent', 'shorten']

# Hardcode the recognized whitespace characters to the US-ASCII
# whitespace characters.  The main reason for doing this is that
# some Unicode spaces (like \u00a0) are non-breaking whitespaces.
_whitespace = '\t\n\x0b\x0c\r '

class TextWrapper:
    """
    Object for wrapping/filling text.  The public interface consists of
    the wrap() and fill() methods; the other methods are just there for
    subclasses to override in order to tweak the default behaviour.
    If you want to completely replace the main wrapping algorithm,
    you'll probably have to override _wrap_chunks().

    Several instance attributes control various aspects of wrapping:
      width (default: 70)
        the maximum width of wrapped lines (unless break_long_words
        is false)
      initial_indent (default: "")
        string that will be prepended to the first line of wrapped
        output.  Counts towards the line's width.
      subsequent_indent (default: "")
        string that will be prepended to all lines save the first
        of wrapped output; also counts towards each line's width.
      expand_tabs (default: true)
        Expand tabs in input text to spaces before further processing.
        Each tab will become 0 .. 'tabsize' spaces, depending on its position
        in its line.  If false, each tab is treated as a single character.
      tabsize (default: 8)
        Expand tabs in input text to 0 .. 'tabsize' spaces, unless
        'expand_tabs' is false.
      replace_whitespace (default: true)
        Replace all whitespace characters in the input text by spaces
        after tab expansion.  Note that if expand_tabs is false and
        replace_whitespace is true, every tab will be converted to a
        single space!
      fix_sentence_endings (default: false)
        Ensure that sentence-ending punctuation is always followed
        by two spaces.  Off by default because the algorithm is
        (unavoidably) imperfect.
      break_long_words (default: true)
        Break words longer than 'width'.  If false, those words will not
        be broken, and some lines might be longer than 'width'.
      break_on_hyphens (default: true)
        Allow breaking hyphenated words. If true, wrapping will occur
        preferably on whitespaces and right after hyphens part of
        compound words.
      drop_whitespace (default: true)
        Drop leading and trailing whitespace from lines.
      max_lines (default: None)
        Truncate wrapped lines.
      placeholder (default: ' [...]')
        Append to the last line of truncated text.
    """

    unicode_whitespace_trans = {}
    uspace = ord(' ')
    for x in _whitespace:
        unicode_whitespace_trans[ord(x)] = uspace

    # This funky little regex is just the trick for splitting
    # text up into word-wrappable chunks.  E.g.
    #   "Hello there -- you goof-ball, use the -b option!"
    # splits into
    #   Hello/ /there/ /--/ /you/ /goof-/ball,/ /use/ /the/ /-b/ /option!
    # (after stripping out empty strings).
    word_punct = r'[\w!"\'&.,?]'
    letter = r'[^\d\W]'
    whitespace = r'[%s]' % re.escape(_whitespace)
    nowhitespace = '[^' + whitespace[1:]
    wordsep_re = re.compile(r'''
        ( # any whitespace
          %(ws)s+
        | # em-dash between words
          (?<=%(wp)s) -{2,} (?=\w)
        | # word, possibly hyphenated
          %(nws)s+? (?:
            # hyphenated word
              -(?: (?<=%(lt)s{2}-) | (?<=%(lt)s-%(lt)s-))
              (?= %(lt)s -? %(lt)s)
            | # end of word
              (?=%(ws)s|\Z)
            | # em-dash
              (?<=%(wp)s) (?=-{2,}\w)
            )
        )''' % {'wp': word_punct, 'lt': letter,
                'ws': whitespace, 'nws': nowhitespace},
        re.VERBOSE)
    del word_punct, letter, nowhitespace

    # This less funky little regex just split on recognized spaces. E.g.
    #   "Hello there -- you goof-ball, use the -b option!"
    # splits into
    #   Hello/ /there/ /--/ /you/ /goof-ball,/ /use/ /the/ /-b/ /option!/
    wordsep_simple_re = re.compile(r'(%s+)' % whitespace)
    del whitespace

    # XXX this is not locale- or charset-aware -- string.lowercase
    # is US-ASCII only (and therefore English-only)
    sentence_end_re = re.compile(r'[a-z]'             # lowercase letter
                                 r'[\.\!\?]'          # sentence-ending punct.
                                 r'[\"\']?'           # optional end-of-quote
                                 r'\Z')               # end of chunk

    def __init__(self,
                 width=70,
                 initial_indent="",
                 subsequent_indent="",
                 expand_tabs=True,
                 replace_whitespace=True,
                 fix_sentence_endings=False,
                 break_long_words=True,
                 drop_whitespace=True,
                 break_on_hyphens=True,
                 tabsize=8,
                 *,
                 max_lines=None,
                 placeholder=' [...]'):
        self.width = width
        self.initial_indent = initial_indent
        self.subsequent_indent = subsequent_indent
        self.expand_tabs = expand_tabs
        self.replace_whitespace = replace_whitespace
        self.fix_sentence_endings = fix_sentence_endings
        self.break_long_words = break_long_words
        self.drop_whitespace = drop_whitespace
        self.break_on_hyphens = break_on_hyphens
        self.tabsize = tabsize
        self.max_lines = max_lines
        self.placeholder = placeholder


    # -- Private methods -----------------------------------------------
    # (possibly useful for subclasses to override)

    def _munge_whitespace(self, text):
        """_munge_whitespace(text : string) -> string

        Munge whitespace in text: expand tabs and convert all other
        whitespace characters to spaces.  Eg. " foo\\tbar\\n\\nbaz"
        becomes " foo    bar  baz".
        """
        if self.expand_tabs:
            text = text.expandtabs(self.tabsize)
        if self.replace_whitespace:
            text = text.translate(self.unicode_whitespace_trans)
        return text


    def _split(self, text):
        """_split(text : string) -> [string]

        Split the text to wrap into indivisible chunks.  Chunks are
        not quite the same as words; see _wrap_chunks() for full
        details.  As an example, the text
          Look, goof-ball -- use the -b option!
        breaks into the following chunks:
          'Look,', ' ', 'goof-', 'ball', ' ', '--', ' ',
          'use', ' ', 'the', ' ', '-b', ' ', 'option!'
        if break_on_hyphens is True, or in:
          'Look,', ' ', 'goof-ball', ' ', '--', ' ',
          'use', ' ', 'the', ' ', '-b', ' ', option!'
        otherwise.
        """
        if self.break_on_hyphens is True:
            chunks = self.wordsep_re.split(text)
        else:
            chunks = self.wordsep_simple_re.split(text)
        chunks = [c for c in chunks if c]
        return chunks

    def _fix_sentence_endings(self, chunks):
        """_fix_sentence_endings(chunks : [string])

        Correct for sentence endings buried in 'chunks'.  Eg. when the
        original text contains "... foo.\\nBar ...", munge_whitespace()
        and split() will convert that to [..., "foo.", " ", "Bar", ...]
        which has one too few spaces; this method simply changes the one
        space to two.
        """
        i = 0
        patsearch = self.sentence_end_re.search
        while i < len(chunks)-1:
            if chunks[i+1] == " " and patsearch(chunks[i]):
                chunks[i+1] = "  "
                i += 2
            else:
                i += 1

    def _handle_long_word(self, reversed_chunks, cur_line, cur_len, width):
        """_handle_long_word(chunks : [string],
                             cur_line : [string],
                             cur_len : int, width : int)

        Handle a chunk of text (most likely a word, not whitespace) that
        is too long to fit in any line.
        """
        # Figure out when indent is larger than the specified width, and make
        # sure at least one character is stripped off on every pass
        if width < 1:
            space_left = 1
        else:
            space_left = width - cur_len

        # If we're allowed to break long words, then do so: put as much
        # of the next chunk onto the current line as will fit.
        if self.break_long_words:
            cur_line.append(reversed_chunks[-1][:space_left])
            reversed_chunks[-1] = reversed_chunks[-1][space_left:]

        # Otherwise, we have to preserve the long word intact.  Only add
        # it to the current line if there's nothing already there --
        # that minimizes how much we violate the width constraint.
        elif not cur_line:
            cur_line.append(reversed_chunks.pop())

        # If we're not allowed to break long words, and there's already
        # text on the current line, do nothing.  Next time through the
        # main loop of _wrap_chunks(), we'll wind up here again, but
        # cur_len will be zero, so the next line will be entirely
        # devoted to the long word that we can't handle right now.

    def _wrap_chunks(self, chunks):
        """_wrap_chunks(chunks : [string]) -> [string]

        Wrap a sequence of text chunks and return a list of lines of
        length 'self.width' or less.  (If 'break_long_words' is false,
        some lines may be longer than this.)  Chunks correspond roughly
        to words and the whitespace between them: each chunk is
        indivisible (modulo 'break_long_words'), but a line break can
        come between any two chunks.  Chunks should not have internal
        whitespace; ie. a chunk is either all whitespace or a "word".
        Whitespace chunks will be removed from the beginning and end of
        lines, but apart from that whitespace is preserved.
        """
        lines = []
        if self.width <= 0:
            raise ValueError("invalid width %r (must be > 0)" % self.width)
        if self.max_lines is not None:
            if self.max_lines > 1:
                indent = self.subsequent_indent
            else:
                indent = self.initial_indent
            if len(indent) + len(self.placeholder.lstrip()) > self.width:
                raise ValueError("placeholder too large for max width")

        # Arrange in reverse order so items can be efficiently popped
        # from a stack of chucks.
        chunks.reverse()

        while chunks:

            # Start the list of chunks that will make up the current line.
            # cur_len is just the length of all the chunks in cur_line.
            cur_line = []
            cur_len = 0

            # Figure out which static string will prefix this line.
            if lines:
                indent = self.subsequent_indent
            else:
                indent = self.initial_indent

            # Maximum width for this line.
            width = self.width - len(indent)

            # First chunk on line is whitespace -- drop it, unless this
            # is the very beginning of the text (ie. no lines started yet).
            if self.drop_whitespace and chunks[-1].strip() == '' and lines:
                del chunks[-1]

            while chunks:
                l = len(chunks[-1])

                # Can at least squeeze this chunk onto the current line.
                if cur_len + l <= width:
                    cur_line.append(chunks.pop())
                    cur_len += l

                # Nope, this line is full.
                else:
                    break

            # The current line is full, and the next chunk is too big to
            # fit on *any* line (not just this one).
            if chunks and len(chunks[-1]) > width:
                self._handle_long_word(chunks, cur_line, cur_len, width)
                cur_len = sum(map(len, cur_line))

            # If the last chunk on this line is all whitespace, drop it.
            if self.drop_whitespace and cur_line and cur_line[-1].strip() == '':
                cur_len -= len(cur_line[-1])
                del cur_line[-1]

            if cur_line:
                if (self.max_lines is None or
                    len(lines) + 1 < self.max_lines or
                    (not chunks or
                     self.drop_whitespace and
                     len(chunks) == 1 and
                     not chunks[0].strip()) and cur_len <= width):
                    # Convert current line back to a string and store it in
                    # list of all lines (return value).
                    lines.append(indent + ''.join(cur_line))
                else:
                    while cur_line:
                        if (cur_line[-1].strip() and
                            cur_len + len(self.placeholder) <= width):
                            cur_line.append(self.placeholder)
                            lines.append(indent + ''.join(cur_line))
                            break
                        cur_len -= len(cur_line[-1])
                        del cur_line[-1]
                    else:
                        if lines:
                            prev_line = lines[-1].rstrip()
                            if (len(prev_line) + len(self.placeholder) <=
                                    self.width):
                                lines[-1] = prev_line + self.placeholder
                                break
                        lines.append(indent + self.placeholder.lstrip())
                    break

        return lines

    def _split_chunks(self, text):
        text = self._munge_whitespace(text)
        return self._split(text)

    # -- Public interface ----------------------------------------------

    def wrap(self, text):
        """wrap(text : string) -> [string]

        Reformat the single paragraph in 'text' so it fits in lines of
        no more than 'self.width' columns, and return a list of wrapped
        lines.  Tabs in 'text' are expanded with string.expandtabs(),
        and all other whitespace characters (including newline) are
        converted to space.
        """
        chunks = self._split_chunks(text)
        if self.fix_sentence_endings:
            self._fix_sentence_endings(chunks)
        return self._wrap_chunks(chunks)

    def fill(self, text):
        """fill(text : string) -> string

        Reformat the single paragraph in 'text' to fit in lines of no
        more than 'self.width' columns, and return a new string
        containing the entire wrapped paragraph.
        """
        return "\n".join(self.wrap(text))


# -- Convenience interface ---------------------------------------------

def wrap(text, width=70, **kwargs):
    """Wrap a single paragraph of text, returning a list of wrapped lines.

    Reformat the single paragraph in 'text' so it fits in lines of no
    more than 'width' columns, and return a list of wrapped lines.  By
    default, tabs in 'text' are expanded with string.expandtabs(), and
    all other whitespace characters (including newline) are converted to
    space.  See TextWrapper class for available keyword args to customize
    wrapping behaviour.
    """
    w = TextWrapper(width=width, **kwargs)
    return w.wrap(text)

def fill(text, width=70, **kwargs):
    """Fill a single paragraph of text, returning a new string.

    Reformat the single paragraph in 'text' to fit in lines of no more
    than 'width' columns, and return a new string containing the entire
    wrapped paragraph.  As with wrap(), tabs are expanded and other
    whitespace characters converted to space.  See TextWrapper class for
    available keyword args to customize wrapping behaviour.
    """
    w = TextWrapper(width=width, **kwargs)
    return w.fill(text)

def shorten(text, width, **kwargs):
    """Collapse and truncate the given text to fit in the given width.

    The text first has its whitespace collapsed.  If it then fits in
    the *width*, it is returned as is.  Otherwise, as many words
    as possible are joined and then the placeholder is appended::

        >>> textwrap.shorten("Hello  world!", width=12)
        'Hello world!'
        >>> textwrap.shorten("Hello  world!", width=11)
        'Hello [...]'
    """
    w = TextWrapper(width=width, max_lines=1, **kwargs)
    return w.fill(' '.join(text.strip().split()))


# -- Loosely related functionality -------------------------------------

_whitespace_only_re = re.compile('^[ \t]+$', re.MULTILINE)
_leading_whitespace_re = re.compile('(^[ \t]*)(?:[^ \t\n])', re.MULTILINE)

def dedent(text):
    """Remove any common leading whitespace from every line in `text`.

    This can be used to make triple-quoted strings line up with the left
    edge of the display, while still presenting them in the source code
    in indented form.

    Note that tabs and spaces are both treated as whitespace, but they
    are not equal: the lines "  hello" and "\\thello" are
    considered to have no common leading whitespace.

    Entirely blank lines are normalized to a newline character.
    """
    # Look for the longest leading string of spaces and tabs common to
    # all lines.
    margin = None
    text = _whitespace_only_re.sub('', text)
    indents = _leading_whitespace_re.findall(text)
    for indent in indents:
        if margin is None:
            margin = indent

        # Current line more deeply indented than previous winner:
        # no change (previous winner is still on top).
        elif indent.startswith(margin):
            pass

        # Current line consistent with and no deeper than previous winner:
        # it's the new winner.
        elif margin.startswith(indent):
            margin = indent

        # Find the largest common whitespace between current line and previous
        # winner.
        else:
            for i, (x, y) in enumerate(zip(margin, indent)):
                if x != y:
                    margin = margin[:i]
                    break

    # sanity check (testing/debugging only)
    if 0 and margin:
        for line in text.split("\n"):
            assert not line or line.startswith(margin), \
                   "line = %r, margin = %r" % (line, margin)

    if margin:
        text = re.sub(r'(?m)^' + margin, '', text)
    return text


def indent(text, prefix, predicate=None):
    """Adds 'prefix' to the beginning of selected lines in 'text'.

    If 'predicate' is provided, 'prefix' will only be added to the lines
    where 'predicate(line)' is True. If 'predicate' is not provided,
    it will default to adding 'prefix' to all non-empty lines that do not
    consist solely of whitespace characters.
    """
    if predicate is None:
        def predicate(line):
            return line.strip()

    def prefixed_lines():
        for line in text.splitlines(True):
            yield (prefix + line if predicate(line) else line)
    return ''.join(prefixed_lines())


if __name__ == "__main__":
    #print dedent("\tfoo\n\tbar")
    #print dedent("  \thello there\n  \t  how are you?")
    print(dedent("Hello there.\n  This is indented."))
_collections_abc.py000064400000062764151153537530010427 0ustar00# Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Abstract Base Classes (ABCs) for collections, according to PEP 3119.

Unit tests are in test_collections.
"""

from abc import ABCMeta, abstractmethod
import sys

__all__ = ["Awaitable", "Coroutine",
           "AsyncIterable", "AsyncIterator", "AsyncGenerator",
           "Hashable", "Iterable", "Iterator", "Generator", "Reversible",
           "Sized", "Container", "Callable", "Collection",
           "Set", "MutableSet",
           "Mapping", "MutableMapping",
           "MappingView", "KeysView", "ItemsView", "ValuesView",
           "Sequence", "MutableSequence",
           "ByteString",
           ]

# This module has been renamed from collections.abc to _collections_abc to
# speed up interpreter startup. Some of the types such as MutableMapping are
# required early but collections module imports a lot of other modules.
# See issue #19218
__name__ = "collections.abc"

# Private list of types that we want to register with the various ABCs
# so that they will pass tests like:
#       it = iter(somebytearray)
#       assert isinstance(it, Iterable)
# Note:  in other implementations, these types might not be distinct
# and they may have their own implementation specific types that
# are not included on this list.
bytes_iterator = type(iter(b''))
bytearray_iterator = type(iter(bytearray()))
#callable_iterator = ???
dict_keyiterator = type(iter({}.keys()))
dict_valueiterator = type(iter({}.values()))
dict_itemiterator = type(iter({}.items()))
list_iterator = type(iter([]))
list_reverseiterator = type(iter(reversed([])))
range_iterator = type(iter(range(0)))
longrange_iterator = type(iter(range(1 << 1000)))
set_iterator = type(iter(set()))
str_iterator = type(iter(""))
tuple_iterator = type(iter(()))
zip_iterator = type(iter(zip()))
## views ##
dict_keys = type({}.keys())
dict_values = type({}.values())
dict_items = type({}.items())
## misc ##
mappingproxy = type(type.__dict__)
generator = type((lambda: (yield))())
## coroutine ##
async def _coro(): pass
_coro = _coro()
coroutine = type(_coro)
_coro.close()  # Prevent ResourceWarning
del _coro
## asynchronous generator ##
async def _ag(): yield
_ag = _ag()
async_generator = type(_ag)
del _ag


### ONE-TRICK PONIES ###

def _check_methods(C, *methods):
    mro = C.__mro__
    for method in methods:
        for B in mro:
            if method in B.__dict__:
                if B.__dict__[method] is None:
                    return NotImplemented
                break
        else:
            return NotImplemented
    return True

class Hashable(metaclass=ABCMeta):

    __slots__ = ()

    @abstractmethod
    def __hash__(self):
        return 0

    @classmethod
    def __subclasshook__(cls, C):
        if cls is Hashable:
            return _check_methods(C, "__hash__")
        return NotImplemented


class Awaitable(metaclass=ABCMeta):

    __slots__ = ()

    @abstractmethod
    def __await__(self):
        yield

    @classmethod
    def __subclasshook__(cls, C):
        if cls is Awaitable:
            return _check_methods(C, "__await__")
        return NotImplemented


class Coroutine(Awaitable):

    __slots__ = ()

    @abstractmethod
    def send(self, value):
        """Send a value into the coroutine.
        Return next yielded value or raise StopIteration.
        """
        raise StopIteration

    @abstractmethod
    def throw(self, typ, val=None, tb=None):
        """Raise an exception in the coroutine.
        Return next yielded value or raise StopIteration.
        """
        if val is None:
            if tb is None:
                raise typ
            val = typ()
        if tb is not None:
            val = val.with_traceback(tb)
        raise val

    def close(self):
        """Raise GeneratorExit inside coroutine.
        """
        try:
            self.throw(GeneratorExit)
        except (GeneratorExit, StopIteration):
            pass
        else:
            raise RuntimeError("coroutine ignored GeneratorExit")

    @classmethod
    def __subclasshook__(cls, C):
        if cls is Coroutine:
            return _check_methods(C, '__await__', 'send', 'throw', 'close')
        return NotImplemented


Coroutine.register(coroutine)


class AsyncIterable(metaclass=ABCMeta):

    __slots__ = ()

    @abstractmethod
    def __aiter__(self):
        return AsyncIterator()

    @classmethod
    def __subclasshook__(cls, C):
        if cls is AsyncIterable:
            return _check_methods(C, "__aiter__")
        return NotImplemented


class AsyncIterator(AsyncIterable):

    __slots__ = ()

    @abstractmethod
    async def __anext__(self):
        """Return the next item or raise StopAsyncIteration when exhausted."""
        raise StopAsyncIteration

    def __aiter__(self):
        return self

    @classmethod
    def __subclasshook__(cls, C):
        if cls is AsyncIterator:
            return _check_methods(C, "__anext__", "__aiter__")
        return NotImplemented


class AsyncGenerator(AsyncIterator):

    __slots__ = ()

    async def __anext__(self):
        """Return the next item from the asynchronous generator.
        When exhausted, raise StopAsyncIteration.
        """
        return await self.asend(None)

    @abstractmethod
    async def asend(self, value):
        """Send a value into the asynchronous generator.
        Return next yielded value or raise StopAsyncIteration.
        """
        raise StopAsyncIteration

    @abstractmethod
    async def athrow(self, typ, val=None, tb=None):
        """Raise an exception in the asynchronous generator.
        Return next yielded value or raise StopAsyncIteration.
        """
        if val is None:
            if tb is None:
                raise typ
            val = typ()
        if tb is not None:
            val = val.with_traceback(tb)
        raise val

    async def aclose(self):
        """Raise GeneratorExit inside coroutine.
        """
        try:
            await self.athrow(GeneratorExit)
        except (GeneratorExit, StopAsyncIteration):
            pass
        else:
            raise RuntimeError("asynchronous generator ignored GeneratorExit")

    @classmethod
    def __subclasshook__(cls, C):
        if cls is AsyncGenerator:
            return _check_methods(C, '__aiter__', '__anext__',
                                  'asend', 'athrow', 'aclose')
        return NotImplemented


AsyncGenerator.register(async_generator)


class Iterable(metaclass=ABCMeta):

    __slots__ = ()

    @abstractmethod
    def __iter__(self):
        while False:
            yield None

    @classmethod
    def __subclasshook__(cls, C):
        if cls is Iterable:
            return _check_methods(C, "__iter__")
        return NotImplemented


class Iterator(Iterable):

    __slots__ = ()

    @abstractmethod
    def __next__(self):
        'Return the next item from the iterator. When exhausted, raise StopIteration'
        raise StopIteration

    def __iter__(self):
        return self

    @classmethod
    def __subclasshook__(cls, C):
        if cls is Iterator:
            return _check_methods(C, '__iter__', '__next__')
        return NotImplemented

Iterator.register(bytes_iterator)
Iterator.register(bytearray_iterator)
#Iterator.register(callable_iterator)
Iterator.register(dict_keyiterator)
Iterator.register(dict_valueiterator)
Iterator.register(dict_itemiterator)
Iterator.register(list_iterator)
Iterator.register(list_reverseiterator)
Iterator.register(range_iterator)
Iterator.register(longrange_iterator)
Iterator.register(set_iterator)
Iterator.register(str_iterator)
Iterator.register(tuple_iterator)
Iterator.register(zip_iterator)


class Reversible(Iterable):

    __slots__ = ()

    @abstractmethod
    def __reversed__(self):
        while False:
            yield None

    @classmethod
    def __subclasshook__(cls, C):
        if cls is Reversible:
            return _check_methods(C, "__reversed__", "__iter__")
        return NotImplemented


class Generator(Iterator):

    __slots__ = ()

    def __next__(self):
        """Return the next item from the generator.
        When exhausted, raise StopIteration.
        """
        return self.send(None)

    @abstractmethod
    def send(self, value):
        """Send a value into the generator.
        Return next yielded value or raise StopIteration.
        """
        raise StopIteration

    @abstractmethod
    def throw(self, typ, val=None, tb=None):
        """Raise an exception in the generator.
        Return next yielded value or raise StopIteration.
        """
        if val is None:
            if tb is None:
                raise typ
            val = typ()
        if tb is not None:
            val = val.with_traceback(tb)
        raise val

    def close(self):
        """Raise GeneratorExit inside generator.
        """
        try:
            self.throw(GeneratorExit)
        except (GeneratorExit, StopIteration):
            pass
        else:
            raise RuntimeError("generator ignored GeneratorExit")

    @classmethod
    def __subclasshook__(cls, C):
        if cls is Generator:
            return _check_methods(C, '__iter__', '__next__',
                                  'send', 'throw', 'close')
        return NotImplemented

Generator.register(generator)


class Sized(metaclass=ABCMeta):

    __slots__ = ()

    @abstractmethod
    def __len__(self):
        return 0

    @classmethod
    def __subclasshook__(cls, C):
        if cls is Sized:
            return _check_methods(C, "__len__")
        return NotImplemented


class Container(metaclass=ABCMeta):

    __slots__ = ()

    @abstractmethod
    def __contains__(self, x):
        return False

    @classmethod
    def __subclasshook__(cls, C):
        if cls is Container:
            return _check_methods(C, "__contains__")
        return NotImplemented

class Collection(Sized, Iterable, Container):

    __slots__ = ()

    @classmethod
    def __subclasshook__(cls, C):
        if cls is Collection:
            return _check_methods(C,  "__len__", "__iter__", "__contains__")
        return NotImplemented

class Callable(metaclass=ABCMeta):

    __slots__ = ()

    @abstractmethod
    def __call__(self, *args, **kwds):
        return False

    @classmethod
    def __subclasshook__(cls, C):
        if cls is Callable:
            return _check_methods(C, "__call__")
        return NotImplemented


### SETS ###


class Set(Collection):

    """A set is a finite, iterable container.

    This class provides concrete generic implementations of all
    methods except for __contains__, __iter__ and __len__.

    To override the comparisons (presumably for speed, as the
    semantics are fixed), redefine __le__ and __ge__,
    then the other operations will automatically follow suit.
    """

    __slots__ = ()

    def __le__(self, other):
        if not isinstance(other, Set):
            return NotImplemented
        if len(self) > len(other):
            return False
        for elem in self:
            if elem not in other:
                return False
        return True

    def __lt__(self, other):
        if not isinstance(other, Set):
            return NotImplemented
        return len(self) < len(other) and self.__le__(other)

    def __gt__(self, other):
        if not isinstance(other, Set):
            return NotImplemented
        return len(self) > len(other) and self.__ge__(other)

    def __ge__(self, other):
        if not isinstance(other, Set):
            return NotImplemented
        if len(self) < len(other):
            return False
        for elem in other:
            if elem not in self:
                return False
        return True

    def __eq__(self, other):
        if not isinstance(other, Set):
            return NotImplemented
        return len(self) == len(other) and self.__le__(other)

    @classmethod
    def _from_iterable(cls, it):
        '''Construct an instance of the class from any iterable input.

        Must override this method if the class constructor signature
        does not accept an iterable for an input.
        '''
        return cls(it)

    def __and__(self, other):
        if not isinstance(other, Iterable):
            return NotImplemented
        return self._from_iterable(value for value in other if value in self)

    __rand__ = __and__

    def isdisjoint(self, other):
        'Return True if two sets have a null intersection.'
        for value in other:
            if value in self:
                return False
        return True

    def __or__(self, other):
        if not isinstance(other, Iterable):
            return NotImplemented
        chain = (e for s in (self, other) for e in s)
        return self._from_iterable(chain)

    __ror__ = __or__

    def __sub__(self, other):
        if not isinstance(other, Set):
            if not isinstance(other, Iterable):
                return NotImplemented
            other = self._from_iterable(other)
        return self._from_iterable(value for value in self
                                   if value not in other)

    def __rsub__(self, other):
        if not isinstance(other, Set):
            if not isinstance(other, Iterable):
                return NotImplemented
            other = self._from_iterable(other)
        return self._from_iterable(value for value in other
                                   if value not in self)

    def __xor__(self, other):
        if not isinstance(other, Set):
            if not isinstance(other, Iterable):
                return NotImplemented
            other = self._from_iterable(other)
        return (self - other) | (other - self)

    __rxor__ = __xor__

    def _hash(self):
        """Compute the hash value of a set.

        Note that we don't define __hash__: not all sets are hashable.
        But if you define a hashable set type, its __hash__ should
        call this function.

        This must be compatible __eq__.

        All sets ought to compare equal if they contain the same
        elements, regardless of how they are implemented, and
        regardless of the order of the elements; so there's not much
        freedom for __eq__ or __hash__.  We match the algorithm used
        by the built-in frozenset type.
        """
        MAX = sys.maxsize
        MASK = 2 * MAX + 1
        n = len(self)
        h = 1927868237 * (n + 1)
        h &= MASK
        for x in self:
            hx = hash(x)
            h ^= (hx ^ (hx << 16) ^ 89869747)  * 3644798167
            h &= MASK
        h = h * 69069 + 907133923
        h &= MASK
        if h > MAX:
            h -= MASK + 1
        if h == -1:
            h = 590923713
        return h

Set.register(frozenset)


class MutableSet(Set):
    """A mutable set is a finite, iterable container.

    This class provides concrete generic implementations of all
    methods except for __contains__, __iter__, __len__,
    add(), and discard().

    To override the comparisons (presumably for speed, as the
    semantics are fixed), all you have to do is redefine __le__ and
    then the other operations will automatically follow suit.
    """

    __slots__ = ()

    @abstractmethod
    def add(self, value):
        """Add an element."""
        raise NotImplementedError

    @abstractmethod
    def discard(self, value):
        """Remove an element.  Do not raise an exception if absent."""
        raise NotImplementedError

    def remove(self, value):
        """Remove an element. If not a member, raise a KeyError."""
        if value not in self:
            raise KeyError(value)
        self.discard(value)

    def pop(self):
        """Return the popped value.  Raise KeyError if empty."""
        it = iter(self)
        try:
            value = next(it)
        except StopIteration:
            raise KeyError from None
        self.discard(value)
        return value

    def clear(self):
        """This is slow (creates N new iterators!) but effective."""
        try:
            while True:
                self.pop()
        except KeyError:
            pass

    def __ior__(self, it):
        for value in it:
            self.add(value)
        return self

    def __iand__(self, it):
        for value in (self - it):
            self.discard(value)
        return self

    def __ixor__(self, it):
        if it is self:
            self.clear()
        else:
            if not isinstance(it, Set):
                it = self._from_iterable(it)
            for value in it:
                if value in self:
                    self.discard(value)
                else:
                    self.add(value)
        return self

    def __isub__(self, it):
        if it is self:
            self.clear()
        else:
            for value in it:
                self.discard(value)
        return self

MutableSet.register(set)


### MAPPINGS ###


class Mapping(Collection):

    __slots__ = ()

    """A Mapping is a generic container for associating key/value
    pairs.

    This class provides concrete generic implementations of all
    methods except for __getitem__, __iter__, and __len__.

    """

    @abstractmethod
    def __getitem__(self, key):
        raise KeyError

    def get(self, key, default=None):
        'D.get(k[,d]) -> D[k] if k in D, else d.  d defaults to None.'
        try:
            return self[key]
        except KeyError:
            return default

    def __contains__(self, key):
        try:
            self[key]
        except KeyError:
            return False
        else:
            return True

    def keys(self):
        "D.keys() -> a set-like object providing a view on D's keys"
        return KeysView(self)

    def items(self):
        "D.items() -> a set-like object providing a view on D's items"
        return ItemsView(self)

    def values(self):
        "D.values() -> an object providing a view on D's values"
        return ValuesView(self)

    def __eq__(self, other):
        if not isinstance(other, Mapping):
            return NotImplemented
        return dict(self.items()) == dict(other.items())

    __reversed__ = None

Mapping.register(mappingproxy)


class MappingView(Sized):

    __slots__ = '_mapping',

    def __init__(self, mapping):
        self._mapping = mapping

    def __len__(self):
        return len(self._mapping)

    def __repr__(self):
        return '{0.__class__.__name__}({0._mapping!r})'.format(self)


class KeysView(MappingView, Set):

    __slots__ = ()

    @classmethod
    def _from_iterable(self, it):
        return set(it)

    def __contains__(self, key):
        return key in self._mapping

    def __iter__(self):
        yield from self._mapping

KeysView.register(dict_keys)


class ItemsView(MappingView, Set):

    __slots__ = ()

    @classmethod
    def _from_iterable(self, it):
        return set(it)

    def __contains__(self, item):
        key, value = item
        try:
            v = self._mapping[key]
        except KeyError:
            return False
        else:
            return v is value or v == value

    def __iter__(self):
        for key in self._mapping:
            yield (key, self._mapping[key])

ItemsView.register(dict_items)


class ValuesView(MappingView, Collection):

    __slots__ = ()

    def __contains__(self, value):
        for key in self._mapping:
            v = self._mapping[key]
            if v is value or v == value:
                return True
        return False

    def __iter__(self):
        for key in self._mapping:
            yield self._mapping[key]

ValuesView.register(dict_values)


class MutableMapping(Mapping):

    __slots__ = ()

    """A MutableMapping is a generic container for associating
    key/value pairs.

    This class provides concrete generic implementations of all
    methods except for __getitem__, __setitem__, __delitem__,
    __iter__, and __len__.

    """

    @abstractmethod
    def __setitem__(self, key, value):
        raise KeyError

    @abstractmethod
    def __delitem__(self, key):
        raise KeyError

    __marker = object()

    def pop(self, key, default=__marker):
        '''D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
          If key is not found, d is returned if given, otherwise KeyError is raised.
        '''
        try:
            value = self[key]
        except KeyError:
            if default is self.__marker:
                raise
            return default
        else:
            del self[key]
            return value

    def popitem(self):
        '''D.popitem() -> (k, v), remove and return some (key, value) pair
           as a 2-tuple; but raise KeyError if D is empty.
        '''
        try:
            key = next(iter(self))
        except StopIteration:
            raise KeyError from None
        value = self[key]
        del self[key]
        return key, value

    def clear(self):
        'D.clear() -> None.  Remove all items from D.'
        try:
            while True:
                self.popitem()
        except KeyError:
            pass

    def update(self, other=(), /, **kwds):
        ''' D.update([E, ]**F) -> None.  Update D from mapping/iterable E and F.
            If E present and has a .keys() method, does:     for k in E: D[k] = E[k]
            If E present and lacks .keys() method, does:     for (k, v) in E: D[k] = v
            In either case, this is followed by: for k, v in F.items(): D[k] = v
        '''
        if isinstance(other, Mapping):
            for key in other:
                self[key] = other[key]
        elif hasattr(other, "keys"):
            for key in other.keys():
                self[key] = other[key]
        else:
            for key, value in other:
                self[key] = value
        for key, value in kwds.items():
            self[key] = value

    def setdefault(self, key, default=None):
        'D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D'
        try:
            return self[key]
        except KeyError:
            self[key] = default
        return default

MutableMapping.register(dict)


### SEQUENCES ###


class Sequence(Reversible, Collection):

    """All the operations on a read-only sequence.

    Concrete subclasses must override __new__ or __init__,
    __getitem__, and __len__.
    """

    __slots__ = ()

    @abstractmethod
    def __getitem__(self, index):
        raise IndexError

    def __iter__(self):
        i = 0
        try:
            while True:
                v = self[i]
                yield v
                i += 1
        except IndexError:
            return

    def __contains__(self, value):
        for v in self:
            if v is value or v == value:
                return True
        return False

    def __reversed__(self):
        for i in reversed(range(len(self))):
            yield self[i]

    def index(self, value, start=0, stop=None):
        '''S.index(value, [start, [stop]]) -> integer -- return first index of value.
           Raises ValueError if the value is not present.

           Supporting start and stop arguments is optional, but
           recommended.
        '''
        if start is not None and start < 0:
            start = max(len(self) + start, 0)
        if stop is not None and stop < 0:
            stop += len(self)

        i = start
        while stop is None or i < stop:
            try:
                v = self[i]
                if v is value or v == value:
                    return i
            except IndexError:
                break
            i += 1
        raise ValueError

    def count(self, value):
        'S.count(value) -> integer -- return number of occurrences of value'
        return sum(1 for v in self if v is value or v == value)

Sequence.register(tuple)
Sequence.register(str)
Sequence.register(range)
Sequence.register(memoryview)


class ByteString(Sequence):

    """This unifies bytes and bytearray.

    XXX Should add all their methods.
    """

    __slots__ = ()

ByteString.register(bytes)
ByteString.register(bytearray)


class MutableSequence(Sequence):

    __slots__ = ()

    """All the operations on a read-write sequence.

    Concrete subclasses must provide __new__ or __init__,
    __getitem__, __setitem__, __delitem__, __len__, and insert().

    """

    @abstractmethod
    def __setitem__(self, index, value):
        raise IndexError

    @abstractmethod
    def __delitem__(self, index):
        raise IndexError

    @abstractmethod
    def insert(self, index, value):
        'S.insert(index, value) -- insert value before index'
        raise IndexError

    def append(self, value):
        'S.append(value) -- append value to the end of the sequence'
        self.insert(len(self), value)

    def clear(self):
        'S.clear() -> None -- remove all items from S'
        try:
            while True:
                self.pop()
        except IndexError:
            pass

    def reverse(self):
        'S.reverse() -- reverse *IN PLACE*'
        n = len(self)
        for i in range(n//2):
            self[i], self[n-i-1] = self[n-i-1], self[i]

    def extend(self, values):
        'S.extend(iterable) -- extend sequence by appending elements from the iterable'
        if values is self:
            values = list(values)
        for v in values:
            self.append(v)

    def pop(self, index=-1):
        '''S.pop([index]) -> item -- remove and return item at index (default last).
           Raise IndexError if list is empty or index is out of range.
        '''
        v = self[index]
        del self[index]
        return v

    def remove(self, value):
        '''S.remove(value) -- remove first occurrence of value.
           Raise ValueError if the value is not present.
        '''
        del self[self.index(value)]

    def __iadd__(self, values):
        self.extend(values)
        return self

MutableSequence.register(list)
MutableSequence.register(bytearray)  # Multiply inheriting, see ByteString
tkinter/messagebox.py000064400000007175151153537530010755 0ustar00# tk common message boxes
#
# this module provides an interface to the native message boxes
# available in Tk 4.2 and newer.
#
# written by Fredrik Lundh, May 1997
#

#
# options (all have default values):
#
# - default: which button to make default (one of the reply codes)
#
# - icon: which icon to display (see below)
#
# - message: the message to display
#
# - parent: which window to place the dialog on top of
#
# - title: dialog title
#
# - type: dialog type; that is, which buttons to display (see below)
#

from tkinter.commondialog import Dialog

#
# constants

# icons
ERROR = "error"
INFO = "info"
QUESTION = "question"
WARNING = "warning"

# types
ABORTRETRYIGNORE = "abortretryignore"
OK = "ok"
OKCANCEL = "okcancel"
RETRYCANCEL = "retrycancel"
YESNO = "yesno"
YESNOCANCEL = "yesnocancel"

# replies
ABORT = "abort"
RETRY = "retry"
IGNORE = "ignore"
OK = "ok"
CANCEL = "cancel"
YES = "yes"
NO = "no"


#
# message dialog class

class Message(Dialog):
    "A message box"

    command  = "tk_messageBox"


#
# convenience stuff

# Rename _icon and _type options to allow overriding them in options
def _show(title=None, message=None, _icon=None, _type=None, **options):
    if _icon and "icon" not in options:    options["icon"] = _icon
    if _type and "type" not in options:    options["type"] = _type
    if title:   options["title"] = title
    if message: options["message"] = message
    res = Message(**options).show()
    # In some Tcl installations, yes/no is converted into a boolean.
    if isinstance(res, bool):
        if res:
            return YES
        return NO
    # In others we get a Tcl_Obj.
    return str(res)


def showinfo(title=None, message=None, **options):
    "Show an info message"
    return _show(title, message, INFO, OK, **options)


def showwarning(title=None, message=None, **options):
    "Show a warning message"
    return _show(title, message, WARNING, OK, **options)


def showerror(title=None, message=None, **options):
    "Show an error message"
    return _show(title, message, ERROR, OK, **options)


def askquestion(title=None, message=None, **options):
    "Ask a question"
    return _show(title, message, QUESTION, YESNO, **options)


def askokcancel(title=None, message=None, **options):
    "Ask if operation should proceed; return true if the answer is ok"
    s = _show(title, message, QUESTION, OKCANCEL, **options)
    return s == OK


def askyesno(title=None, message=None, **options):
    "Ask a question; return true if the answer is yes"
    s = _show(title, message, QUESTION, YESNO, **options)
    return s == YES


def askyesnocancel(title=None, message=None, **options):
    "Ask a question; return true if the answer is yes, None if cancelled."
    s = _show(title, message, QUESTION, YESNOCANCEL, **options)
    # s might be a Tcl index object, so convert it to a string
    s = str(s)
    if s == CANCEL:
        return None
    return s == YES


def askretrycancel(title=None, message=None, **options):
    "Ask if operation should be retried; return true if the answer is yes"
    s = _show(title, message, WARNING, RETRYCANCEL, **options)
    return s == RETRY


# --------------------------------------------------------------------
# test stuff

if __name__ == "__main__":

    print("info", showinfo("Spam", "Egg Information"))
    print("warning", showwarning("Spam", "Egg Warning"))
    print("error", showerror("Spam", "Egg Alert"))
    print("question", askquestion("Spam", "Question?"))
    print("proceed", askokcancel("Spam", "Proceed?"))
    print("yes/no", askyesno("Spam", "Got it?"))
    print("yes/no/cancel", askyesnocancel("Spam", "Want it?"))
    print("try again", askretrycancel("Spam", "Try again?"))
tkinter/filedialog.py000064400000034371151153537530010715 0ustar00"""File selection dialog classes.

Classes:

- FileDialog
- LoadFileDialog
- SaveFileDialog

This module also presents tk common file dialogues, it provides interfaces
to the native file dialogues available in Tk 4.2 and newer, and the
directory dialogue available in Tk 8.3 and newer.
These interfaces were written by Fredrik Lundh, May 1997.
"""

from tkinter import *
from tkinter.dialog import Dialog
from tkinter import commondialog
from tkinter.simpledialog import _setup_dialog

import os
import fnmatch


dialogstates = {}


class FileDialog:

    """Standard file selection dialog -- no checks on selected file.

    Usage:

        d = FileDialog(master)
        fname = d.go(dir_or_file, pattern, default, key)
        if fname is None: ...canceled...
        else: ...open file...

    All arguments to go() are optional.

    The 'key' argument specifies a key in the global dictionary
    'dialogstates', which keeps track of the values for the directory
    and pattern arguments, overriding the values passed in (it does
    not keep track of the default argument!).  If no key is specified,
    the dialog keeps no memory of previous state.  Note that memory is
    kept even when the dialog is canceled.  (All this emulates the
    behavior of the Macintosh file selection dialogs.)

    """

    title = "File Selection Dialog"

    def __init__(self, master, title=None):
        if title is None: title = self.title
        self.master = master
        self.directory = None

        self.top = Toplevel(master)
        self.top.title(title)
        self.top.iconname(title)
        _setup_dialog(self.top)

        self.botframe = Frame(self.top)
        self.botframe.pack(side=BOTTOM, fill=X)

        self.selection = Entry(self.top)
        self.selection.pack(side=BOTTOM, fill=X)
        self.selection.bind('<Return>', self.ok_event)

        self.filter = Entry(self.top)
        self.filter.pack(side=TOP, fill=X)
        self.filter.bind('<Return>', self.filter_command)

        self.midframe = Frame(self.top)
        self.midframe.pack(expand=YES, fill=BOTH)

        self.filesbar = Scrollbar(self.midframe)
        self.filesbar.pack(side=RIGHT, fill=Y)
        self.files = Listbox(self.midframe, exportselection=0,
                             yscrollcommand=(self.filesbar, 'set'))
        self.files.pack(side=RIGHT, expand=YES, fill=BOTH)
        btags = self.files.bindtags()
        self.files.bindtags(btags[1:] + btags[:1])
        self.files.bind('<ButtonRelease-1>', self.files_select_event)
        self.files.bind('<Double-ButtonRelease-1>', self.files_double_event)
        self.filesbar.config(command=(self.files, 'yview'))

        self.dirsbar = Scrollbar(self.midframe)
        self.dirsbar.pack(side=LEFT, fill=Y)
        self.dirs = Listbox(self.midframe, exportselection=0,
                            yscrollcommand=(self.dirsbar, 'set'))
        self.dirs.pack(side=LEFT, expand=YES, fill=BOTH)
        self.dirsbar.config(command=(self.dirs, 'yview'))
        btags = self.dirs.bindtags()
        self.dirs.bindtags(btags[1:] + btags[:1])
        self.dirs.bind('<ButtonRelease-1>', self.dirs_select_event)
        self.dirs.bind('<Double-ButtonRelease-1>', self.dirs_double_event)

        self.ok_button = Button(self.botframe,
                                 text="OK",
                                 command=self.ok_command)
        self.ok_button.pack(side=LEFT)
        self.filter_button = Button(self.botframe,
                                    text="Filter",
                                    command=self.filter_command)
        self.filter_button.pack(side=LEFT, expand=YES)
        self.cancel_button = Button(self.botframe,
                                    text="Cancel",
                                    command=self.cancel_command)
        self.cancel_button.pack(side=RIGHT)

        self.top.protocol('WM_DELETE_WINDOW', self.cancel_command)
        # XXX Are the following okay for a general audience?
        self.top.bind('<Alt-w>', self.cancel_command)
        self.top.bind('<Alt-W>', self.cancel_command)

    def go(self, dir_or_file=os.curdir, pattern="*", default="", key=None):
        if key and key in dialogstates:
            self.directory, pattern = dialogstates[key]
        else:
            dir_or_file = os.path.expanduser(dir_or_file)
            if os.path.isdir(dir_or_file):
                self.directory = dir_or_file
            else:
                self.directory, default = os.path.split(dir_or_file)
        self.set_filter(self.directory, pattern)
        self.set_selection(default)
        self.filter_command()
        self.selection.focus_set()
        self.top.wait_visibility() # window needs to be visible for the grab
        self.top.grab_set()
        self.how = None
        self.master.mainloop()          # Exited by self.quit(how)
        if key:
            directory, pattern = self.get_filter()
            if self.how:
                directory = os.path.dirname(self.how)
            dialogstates[key] = directory, pattern
        self.top.destroy()
        return self.how

    def quit(self, how=None):
        self.how = how
        self.master.quit()              # Exit mainloop()

    def dirs_double_event(self, event):
        self.filter_command()

    def dirs_select_event(self, event):
        dir, pat = self.get_filter()
        subdir = self.dirs.get('active')
        dir = os.path.normpath(os.path.join(self.directory, subdir))
        self.set_filter(dir, pat)

    def files_double_event(self, event):
        self.ok_command()

    def files_select_event(self, event):
        file = self.files.get('active')
        self.set_selection(file)

    def ok_event(self, event):
        self.ok_command()

    def ok_command(self):
        self.quit(self.get_selection())

    def filter_command(self, event=None):
        dir, pat = self.get_filter()
        try:
            names = os.listdir(dir)
        except OSError:
            self.master.bell()
            return
        self.directory = dir
        self.set_filter(dir, pat)
        names.sort()
        subdirs = [os.pardir]
        matchingfiles = []
        for name in names:
            fullname = os.path.join(dir, name)
            if os.path.isdir(fullname):
                subdirs.append(name)
            elif fnmatch.fnmatch(name, pat):
                matchingfiles.append(name)
        self.dirs.delete(0, END)
        for name in subdirs:
            self.dirs.insert(END, name)
        self.files.delete(0, END)
        for name in matchingfiles:
            self.files.insert(END, name)
        head, tail = os.path.split(self.get_selection())
        if tail == os.curdir: tail = ''
        self.set_selection(tail)

    def get_filter(self):
        filter = self.filter.get()
        filter = os.path.expanduser(filter)
        if filter[-1:] == os.sep or os.path.isdir(filter):
            filter = os.path.join(filter, "*")
        return os.path.split(filter)

    def get_selection(self):
        file = self.selection.get()
        file = os.path.expanduser(file)
        return file

    def cancel_command(self, event=None):
        self.quit()

    def set_filter(self, dir, pat):
        if not os.path.isabs(dir):
            try:
                pwd = os.getcwd()
            except OSError:
                pwd = None
            if pwd:
                dir = os.path.join(pwd, dir)
                dir = os.path.normpath(dir)
        self.filter.delete(0, END)
        self.filter.insert(END, os.path.join(dir or os.curdir, pat or "*"))

    def set_selection(self, file):
        self.selection.delete(0, END)
        self.selection.insert(END, os.path.join(self.directory, file))


class LoadFileDialog(FileDialog):

    """File selection dialog which checks that the file exists."""

    title = "Load File Selection Dialog"

    def ok_command(self):
        file = self.get_selection()
        if not os.path.isfile(file):
            self.master.bell()
        else:
            self.quit(file)


class SaveFileDialog(FileDialog):

    """File selection dialog which checks that the file may be created."""

    title = "Save File Selection Dialog"

    def ok_command(self):
        file = self.get_selection()
        if os.path.exists(file):
            if os.path.isdir(file):
                self.master.bell()
                return
            d = Dialog(self.top,
                       title="Overwrite Existing File Question",
                       text="Overwrite existing file %r?" % (file,),
                       bitmap='questhead',
                       default=1,
                       strings=("Yes", "Cancel"))
            if d.num != 0:
                return
        else:
            head, tail = os.path.split(file)
            if not os.path.isdir(head):
                self.master.bell()
                return
        self.quit(file)


# For the following classes and modules:
#
# options (all have default values):
#
# - defaultextension: added to filename if not explicitly given
#
# - filetypes: sequence of (label, pattern) tuples.  the same pattern
#   may occur with several patterns.  use "*" as pattern to indicate
#   all files.
#
# - initialdir: initial directory.  preserved by dialog instance.
#
# - initialfile: initial file (ignored by the open dialog).  preserved
#   by dialog instance.
#
# - parent: which window to place the dialog on top of
#
# - title: dialog title
#
# - multiple: if true user may select more than one file
#
# options for the directory chooser:
#
# - initialdir, parent, title: see above
#
# - mustexist: if true, user must pick an existing directory
#


class _Dialog(commondialog.Dialog):

    def _fixoptions(self):
        try:
            # make sure "filetypes" is a tuple
            self.options["filetypes"] = tuple(self.options["filetypes"])
        except KeyError:
            pass

    def _fixresult(self, widget, result):
        if result:
            # keep directory and filename until next time
            # convert Tcl path objects to strings
            try:
                result = result.string
            except AttributeError:
                # it already is a string
                pass
            path, file = os.path.split(result)
            self.options["initialdir"] = path
            self.options["initialfile"] = file
        self.filename = result # compatibility
        return result


#
# file dialogs

class Open(_Dialog):
    "Ask for a filename to open"

    command = "tk_getOpenFile"

    def _fixresult(self, widget, result):
        if isinstance(result, tuple):
            # multiple results:
            result = tuple([getattr(r, "string", r) for r in result])
            if result:
                path, file = os.path.split(result[0])
                self.options["initialdir"] = path
                # don't set initialfile or filename, as we have multiple of these
            return result
        if not widget.tk.wantobjects() and "multiple" in self.options:
            # Need to split result explicitly
            return self._fixresult(widget, widget.tk.splitlist(result))
        return _Dialog._fixresult(self, widget, result)


class SaveAs(_Dialog):
    "Ask for a filename to save as"

    command = "tk_getSaveFile"


# the directory dialog has its own _fix routines.
class Directory(commondialog.Dialog):
    "Ask for a directory"

    command = "tk_chooseDirectory"

    def _fixresult(self, widget, result):
        if result:
            # convert Tcl path objects to strings
            try:
                result = result.string
            except AttributeError:
                # it already is a string
                pass
            # keep directory until next time
            self.options["initialdir"] = result
        self.directory = result # compatibility
        return result

#
# convenience stuff


def askopenfilename(**options):
    "Ask for a filename to open"

    return Open(**options).show()


def asksaveasfilename(**options):
    "Ask for a filename to save as"

    return SaveAs(**options).show()


def askopenfilenames(**options):
    """Ask for multiple filenames to open

    Returns a list of filenames or empty list if
    cancel button selected
    """
    options["multiple"]=1
    return Open(**options).show()

# FIXME: are the following  perhaps a bit too convenient?


def askopenfile(mode = "r", **options):
    "Ask for a filename to open, and returned the opened file"

    filename = Open(**options).show()
    if filename:
        return open(filename, mode)
    return None


def askopenfiles(mode = "r", **options):
    """Ask for multiple filenames and return the open file
    objects

    returns a list of open file objects or an empty list if
    cancel selected
    """

    files = askopenfilenames(**options)
    if files:
        ofiles=[]
        for filename in files:
            ofiles.append(open(filename, mode))
        files=ofiles
    return files


def asksaveasfile(mode = "w", **options):
    "Ask for a filename to save as, and returned the opened file"

    filename = SaveAs(**options).show()
    if filename:
        return open(filename, mode)
    return None


def askdirectory (**options):
    "Ask for a directory, and return the file name"
    return Directory(**options).show()


# --------------------------------------------------------------------
# test stuff

def test():
    """Simple test program."""
    root = Tk()
    root.withdraw()
    fd = LoadFileDialog(root)
    loadfile = fd.go(key="test")
    fd = SaveFileDialog(root)
    savefile = fd.go(key="test")
    print(loadfile, savefile)

    # Since the file name may contain non-ASCII characters, we need
    # to find an encoding that likely supports the file name, and
    # displays correctly on the terminal.

    # Start off with UTF-8
    enc = "utf-8"
    import sys

    # See whether CODESET is defined
    try:
        import locale
        locale.setlocale(locale.LC_ALL,'')
        enc = locale.nl_langinfo(locale.CODESET)
    except (ImportError, AttributeError):
        pass

    # dialog for opening files

    openfilename=askopenfilename(filetypes=[("all files", "*")])
    try:
        fp=open(openfilename,"r")
        fp.close()
    except:
        print("Could not open File: ")
        print(sys.exc_info()[1])

    print("open", openfilename.encode(enc))

    # dialog for saving files

    saveasfilename=asksaveasfilename()
    print("saveas", saveasfilename.encode(enc))


if __name__ == '__main__':
    test()
tkinter/dnd.py000064400000026342151153537530007362 0ustar00"""Drag-and-drop support for Tkinter.

This is very preliminary.  I currently only support dnd *within* one
application, between different windows (or within the same window).

I am trying to make this as generic as possible -- not dependent on
the use of a particular widget or icon type, etc.  I also hope that
this will work with Pmw.

To enable an object to be dragged, you must create an event binding
for it that starts the drag-and-drop process. Typically, you should
bind <ButtonPress> to a callback function that you write. The function
should call Tkdnd.dnd_start(source, event), where 'source' is the
object to be dragged, and 'event' is the event that invoked the call
(the argument to your callback function).  Even though this is a class
instantiation, the returned instance should not be stored -- it will
be kept alive automatically for the duration of the drag-and-drop.

When a drag-and-drop is already in process for the Tk interpreter, the
call is *ignored*; this normally averts starting multiple simultaneous
dnd processes, e.g. because different button callbacks all
dnd_start().

The object is *not* necessarily a widget -- it can be any
application-specific object that is meaningful to potential
drag-and-drop targets.

Potential drag-and-drop targets are discovered as follows.  Whenever
the mouse moves, and at the start and end of a drag-and-drop move, the
Tk widget directly under the mouse is inspected.  This is the target
widget (not to be confused with the target object, yet to be
determined).  If there is no target widget, there is no dnd target
object.  If there is a target widget, and it has an attribute
dnd_accept, this should be a function (or any callable object).  The
function is called as dnd_accept(source, event), where 'source' is the
object being dragged (the object passed to dnd_start() above), and
'event' is the most recent event object (generally a <Motion> event;
it can also be <ButtonPress> or <ButtonRelease>).  If the dnd_accept()
function returns something other than None, this is the new dnd target
object.  If dnd_accept() returns None, or if the target widget has no
dnd_accept attribute, the target widget's parent is considered as the
target widget, and the search for a target object is repeated from
there.  If necessary, the search is repeated all the way up to the
root widget.  If none of the target widgets can produce a target
object, there is no target object (the target object is None).

The target object thus produced, if any, is called the new target
object.  It is compared with the old target object (or None, if there
was no old target widget).  There are several cases ('source' is the
source object, and 'event' is the most recent event object):

- Both the old and new target objects are None.  Nothing happens.

- The old and new target objects are the same object.  Its method
dnd_motion(source, event) is called.

- The old target object was None, and the new target object is not
None.  The new target object's method dnd_enter(source, event) is
called.

- The new target object is None, and the old target object is not
None.  The old target object's method dnd_leave(source, event) is
called.

- The old and new target objects differ and neither is None.  The old
target object's method dnd_leave(source, event), and then the new
target object's method dnd_enter(source, event) is called.

Once this is done, the new target object replaces the old one, and the
Tk mainloop proceeds.  The return value of the methods mentioned above
is ignored; if they raise an exception, the normal exception handling
mechanisms take over.

The drag-and-drop processes can end in two ways: a final target object
is selected, or no final target object is selected.  When a final
target object is selected, it will always have been notified of the
potential drop by a call to its dnd_enter() method, as described
above, and possibly one or more calls to its dnd_motion() method; its
dnd_leave() method has not been called since the last call to
dnd_enter().  The target is notified of the drop by a call to its
method dnd_commit(source, event).

If no final target object is selected, and there was an old target
object, its dnd_leave(source, event) method is called to complete the
dnd sequence.

Finally, the source object is notified that the drag-and-drop process
is over, by a call to source.dnd_end(target, event), specifying either
the selected target object, or None if no target object was selected.
The source object can use this to implement the commit action; this is
sometimes simpler than to do it in the target's dnd_commit().  The
target's dnd_commit() method could then simply be aliased to
dnd_leave().

At any time during a dnd sequence, the application can cancel the
sequence by calling the cancel() method on the object returned by
dnd_start().  This will call dnd_leave() if a target is currently
active; it will never call dnd_commit().

"""


import tkinter


# The factory function

def dnd_start(source, event):
    h = DndHandler(source, event)
    if h.root:
        return h
    else:
        return None


# The class that does the work

class DndHandler:

    root = None

    def __init__(self, source, event):
        if event.num > 5:
            return
        root = event.widget._root()
        try:
            root.__dnd
            return # Don't start recursive dnd
        except AttributeError:
            root.__dnd = self
            self.root = root
        self.source = source
        self.target = None
        self.initial_button = button = event.num
        self.initial_widget = widget = event.widget
        self.release_pattern = "<B%d-ButtonRelease-%d>" % (button, button)
        self.save_cursor = widget['cursor'] or ""
        widget.bind(self.release_pattern, self.on_release)
        widget.bind("<Motion>", self.on_motion)
        widget['cursor'] = "hand2"

    def __del__(self):
        root = self.root
        self.root = None
        if root:
            try:
                del root.__dnd
            except AttributeError:
                pass

    def on_motion(self, event):
        x, y = event.x_root, event.y_root
        target_widget = self.initial_widget.winfo_containing(x, y)
        source = self.source
        new_target = None
        while target_widget:
            try:
                attr = target_widget.dnd_accept
            except AttributeError:
                pass
            else:
                new_target = attr(source, event)
                if new_target:
                    break
            target_widget = target_widget.master
        old_target = self.target
        if old_target is new_target:
            if old_target:
                old_target.dnd_motion(source, event)
        else:
            if old_target:
                self.target = None
                old_target.dnd_leave(source, event)
            if new_target:
                new_target.dnd_enter(source, event)
                self.target = new_target

    def on_release(self, event):
        self.finish(event, 1)

    def cancel(self, event=None):
        self.finish(event, 0)

    def finish(self, event, commit=0):
        target = self.target
        source = self.source
        widget = self.initial_widget
        root = self.root
        try:
            del root.__dnd
            self.initial_widget.unbind(self.release_pattern)
            self.initial_widget.unbind("<Motion>")
            widget['cursor'] = self.save_cursor
            self.target = self.source = self.initial_widget = self.root = None
            if target:
                if commit:
                    target.dnd_commit(source, event)
                else:
                    target.dnd_leave(source, event)
        finally:
            source.dnd_end(target, event)


# ----------------------------------------------------------------------
# The rest is here for testing and demonstration purposes only!

class Icon:

    def __init__(self, name):
        self.name = name
        self.canvas = self.label = self.id = None

    def attach(self, canvas, x=10, y=10):
        if canvas is self.canvas:
            self.canvas.coords(self.id, x, y)
            return
        if self.canvas:
            self.detach()
        if not canvas:
            return
        label = tkinter.Label(canvas, text=self.name,
                              borderwidth=2, relief="raised")
        id = canvas.create_window(x, y, window=label, anchor="nw")
        self.canvas = canvas
        self.label = label
        self.id = id
        label.bind("<ButtonPress>", self.press)

    def detach(self):
        canvas = self.canvas
        if not canvas:
            return
        id = self.id
        label = self.label
        self.canvas = self.label = self.id = None
        canvas.delete(id)
        label.destroy()

    def press(self, event):
        if dnd_start(self, event):
            # where the pointer is relative to the label widget:
            self.x_off = event.x
            self.y_off = event.y
            # where the widget is relative to the canvas:
            self.x_orig, self.y_orig = self.canvas.coords(self.id)

    def move(self, event):
        x, y = self.where(self.canvas, event)
        self.canvas.coords(self.id, x, y)

    def putback(self):
        self.canvas.coords(self.id, self.x_orig, self.y_orig)

    def where(self, canvas, event):
        # where the corner of the canvas is relative to the screen:
        x_org = canvas.winfo_rootx()
        y_org = canvas.winfo_rooty()
        # where the pointer is relative to the canvas widget:
        x = event.x_root - x_org
        y = event.y_root - y_org
        # compensate for initial pointer offset
        return x - self.x_off, y - self.y_off

    def dnd_end(self, target, event):
        pass


class Tester:

    def __init__(self, root):
        self.top = tkinter.Toplevel(root)
        self.canvas = tkinter.Canvas(self.top, width=100, height=100)
        self.canvas.pack(fill="both", expand=1)
        self.canvas.dnd_accept = self.dnd_accept

    def dnd_accept(self, source, event):
        return self

    def dnd_enter(self, source, event):
        self.canvas.focus_set() # Show highlight border
        x, y = source.where(self.canvas, event)
        x1, y1, x2, y2 = source.canvas.bbox(source.id)
        dx, dy = x2-x1, y2-y1
        self.dndid = self.canvas.create_rectangle(x, y, x+dx, y+dy)
        self.dnd_motion(source, event)

    def dnd_motion(self, source, event):
        x, y = source.where(self.canvas, event)
        x1, y1, x2, y2 = self.canvas.bbox(self.dndid)
        self.canvas.move(self.dndid, x-x1, y-y1)

    def dnd_leave(self, source, event):
        self.top.focus_set() # Hide highlight border
        self.canvas.delete(self.dndid)
        self.dndid = None

    def dnd_commit(self, source, event):
        self.dnd_leave(source, event)
        x, y = source.where(self.canvas, event)
        source.attach(self.canvas, x, y)


def test():
    root = tkinter.Tk()
    root.geometry("+1+1")
    tkinter.Button(command=root.quit, text="Quit").pack()
    t1 = Tester(root)
    t1.top.geometry("+1+60")
    t2 = Tester(root)
    t2.top.geometry("+120+60")
    t3 = Tester(root)
    t3.top.geometry("+240+60")
    i1 = Icon("ICON1")
    i2 = Icon("ICON2")
    i3 = Icon("ICON3")
    i1.attach(t1.canvas)
    i2.attach(t2.canvas)
    i3.attach(t3.canvas)
    root.mainloop()


if __name__ == '__main__':
    test()
tkinter/commondialog.py000064400000002304151153537530011255 0ustar00# base class for tk common dialogues
#
# this module provides a base class for accessing the common
# dialogues available in Tk 4.2 and newer.  use filedialog,
# colorchooser, and messagebox to access the individual
# dialogs.
#
# written by Fredrik Lundh, May 1997
#

from tkinter import *


class Dialog:

    command  = None

    def __init__(self, master=None, **options):
        if not master:
            master = options.get('parent')
        self.master = master
        self.options = options

    def _fixoptions(self):
        pass # hook

    def _fixresult(self, widget, result):
        return result # hook

    def show(self, **options):

        # update instance options
        for k, v in options.items():
            self.options[k] = v

        self._fixoptions()

        # we need a dummy widget to properly process the options
        # (at least as long as we use Tkinter 1.63)
        w = Frame(self.master)

        try:

            s = w.tk.call(self.command, *w._options(self.options))

            s = self._fixresult(w, s)

        finally:

            try:
                # get rid of the widget
                w.destroy()
            except:
                pass

        return s
tkinter/constants.py000064400000002725151153537530010630 0ustar00# Symbolic constants for Tk

# Booleans
NO=FALSE=OFF=0
YES=TRUE=ON=1

# -anchor and -sticky
N='n'
S='s'
W='w'
E='e'
NW='nw'
SW='sw'
NE='ne'
SE='se'
NS='ns'
EW='ew'
NSEW='nsew'
CENTER='center'

# -fill
NONE='none'
X='x'
Y='y'
BOTH='both'

# -side
LEFT='left'
TOP='top'
RIGHT='right'
BOTTOM='bottom'

# -relief
RAISED='raised'
SUNKEN='sunken'
FLAT='flat'
RIDGE='ridge'
GROOVE='groove'
SOLID = 'solid'

# -orient
HORIZONTAL='horizontal'
VERTICAL='vertical'

# -tabs
NUMERIC='numeric'

# -wrap
CHAR='char'
WORD='word'

# -align
BASELINE='baseline'

# -bordermode
INSIDE='inside'
OUTSIDE='outside'

# Special tags, marks and insert positions
SEL='sel'
SEL_FIRST='sel.first'
SEL_LAST='sel.last'
END='end'
INSERT='insert'
CURRENT='current'
ANCHOR='anchor'
ALL='all' # e.g. Canvas.delete(ALL)

# Text widget and button states
NORMAL='normal'
DISABLED='disabled'
ACTIVE='active'
# Canvas state
HIDDEN='hidden'

# Menu item types
CASCADE='cascade'
CHECKBUTTON='checkbutton'
COMMAND='command'
RADIOBUTTON='radiobutton'
SEPARATOR='separator'

# Selection modes for list boxes
SINGLE='single'
BROWSE='browse'
MULTIPLE='multiple'
EXTENDED='extended'

# Activestyle for list boxes
# NONE='none' is also valid
DOTBOX='dotbox'
UNDERLINE='underline'

# Various canvas styles
PIESLICE='pieslice'
CHORD='chord'
ARC='arc'
FIRST='first'
LAST='last'
BUTT='butt'
PROJECTING='projecting'
ROUND='round'
BEVEL='bevel'
MITER='miter'

# Arguments to xview/yview
MOVETO='moveto'
SCROLL='scroll'
UNITS='units'
PAGES='pages'
tkinter/__main__.py000064400000000224151153537530010324 0ustar00"""Main entry point"""

import sys
if sys.argv[0].endswith("__main__.py"):
    sys.argv[0] = "python -m tkinter"
from . import _test as main
main()
tkinter/dialog.py000064400000002747151153537530010057 0ustar00# dialog.py -- Tkinter interface to the tk_dialog script.

from tkinter import *
from tkinter import _cnfmerge

DIALOG_ICON = 'questhead'


class Dialog(Widget):
    def __init__(self, master=None, cnf={}, **kw):
        cnf = _cnfmerge((cnf, kw))
        self.widgetName = '__dialog__'
        Widget._setup(self, master, cnf)
        self.num = self.tk.getint(
                self.tk.call(
                      'tk_dialog', self._w,
                      cnf['title'], cnf['text'],
                      cnf['bitmap'], cnf['default'],
                      *cnf['strings']))
        try: Widget.destroy(self)
        except TclError: pass

    def destroy(self): pass


def _test():
    d = Dialog(None, {'title': 'File Modified',
                      'text':
                      'File "Python.h" has been modified'
                      ' since the last time it was saved.'
                      ' Do you want to save it before'
                      ' exiting the application.',
                      'bitmap': DIALOG_ICON,
                      'default': 0,
                      'strings': ('Save File',
                                  'Discard Changes',
                                  'Return to Editor')})
    print(d.num)


if __name__ == '__main__':
    t = Button(None, {'text': 'Test',
                      'command': _test,
                      Pack: {}})
    q = Button(None, {'text': 'Quit',
                      'command': t.quit,
                      Pack: {}})
    t.mainloop()
tkinter/simpledialog.py000064400000026755151153537530011276 0ustar00#
# An Introduction to Tkinter
#
# Copyright (c) 1997 by Fredrik Lundh
#
# This copyright applies to Dialog, askinteger, askfloat and asktring
#
# fredrik@pythonware.com
# http://www.pythonware.com
#
"""This modules handles dialog boxes.

It contains the following public symbols:

SimpleDialog -- A simple but flexible modal dialog box

Dialog -- a base class for dialogs

askinteger -- get an integer from the user

askfloat -- get a float from the user

askstring -- get a string from the user
"""

from tkinter import *
from tkinter import messagebox, _get_default_root


class SimpleDialog:

    def __init__(self, master,
                 text='', buttons=[], default=None, cancel=None,
                 title=None, class_=None):
        if class_:
            self.root = Toplevel(master, class_=class_)
        else:
            self.root = Toplevel(master)
        if title:
            self.root.title(title)
            self.root.iconname(title)

        _setup_dialog(self.root)

        self.message = Message(self.root, text=text, aspect=400)
        self.message.pack(expand=1, fill=BOTH)
        self.frame = Frame(self.root)
        self.frame.pack()
        self.num = default
        self.cancel = cancel
        self.default = default
        self.root.bind('<Return>', self.return_event)
        for num in range(len(buttons)):
            s = buttons[num]
            b = Button(self.frame, text=s,
                       command=(lambda self=self, num=num: self.done(num)))
            if num == default:
                b.config(relief=RIDGE, borderwidth=8)
            b.pack(side=LEFT, fill=BOTH, expand=1)
        self.root.protocol('WM_DELETE_WINDOW', self.wm_delete_window)
        self._set_transient(master)

    def _set_transient(self, master, relx=0.5, rely=0.3):
        widget = self.root
        widget.withdraw() # Remain invisible while we figure out the geometry
        widget.transient(master)
        widget.update_idletasks() # Actualize geometry information
        if master.winfo_ismapped():
            m_width = master.winfo_width()
            m_height = master.winfo_height()
            m_x = master.winfo_rootx()
            m_y = master.winfo_rooty()
        else:
            m_width = master.winfo_screenwidth()
            m_height = master.winfo_screenheight()
            m_x = m_y = 0
        w_width = widget.winfo_reqwidth()
        w_height = widget.winfo_reqheight()
        x = m_x + (m_width - w_width) * relx
        y = m_y + (m_height - w_height) * rely
        if x+w_width > master.winfo_screenwidth():
            x = master.winfo_screenwidth() - w_width
        elif x < 0:
            x = 0
        if y+w_height > master.winfo_screenheight():
            y = master.winfo_screenheight() - w_height
        elif y < 0:
            y = 0
        widget.geometry("+%d+%d" % (x, y))
        widget.deiconify() # Become visible at the desired location

    def go(self):
        self.root.wait_visibility()
        self.root.grab_set()
        self.root.mainloop()
        self.root.destroy()
        return self.num

    def return_event(self, event):
        if self.default is None:
            self.root.bell()
        else:
            self.done(self.default)

    def wm_delete_window(self):
        if self.cancel is None:
            self.root.bell()
        else:
            self.done(self.cancel)

    def done(self, num):
        self.num = num
        self.root.quit()


class Dialog(Toplevel):

    '''Class to open dialogs.

    This class is intended as a base class for custom dialogs
    '''

    def __init__(self, parent, title = None):
        '''Initialize a dialog.

        Arguments:

            parent -- a parent window (the application window)

            title -- the dialog title
        '''
        master = parent
        if not master:
            master = _get_default_root('create dialog window')

        Toplevel.__init__(self, master)

        self.withdraw() # remain invisible for now
        # If the parent is not viewable, don't
        # make the child transient, or else it
        # would be opened withdrawn
        if parent is not None and parent.winfo_viewable():
            self.transient(parent)

        if title:
            self.title(title)

        _setup_dialog(self)

        self.parent = parent

        self.result = None

        body = Frame(self)
        self.initial_focus = self.body(body)
        body.pack(padx=5, pady=5)

        self.buttonbox()

        if not self.initial_focus:
            self.initial_focus = self

        self.protocol("WM_DELETE_WINDOW", self.cancel)

        if parent is not None:
            self.geometry("+%d+%d" % (parent.winfo_rootx()+50,
                                      parent.winfo_rooty()+50))

        self.deiconify() # become visible now

        self.initial_focus.focus_set()

        # wait for window to appear on screen before calling grab_set
        self.wait_visibility()
        self.grab_set()
        self.wait_window(self)

    def destroy(self):
        '''Destroy the window'''
        self.initial_focus = None
        Toplevel.destroy(self)

    #
    # construction hooks

    def body(self, master):
        '''create dialog body.

        return widget that should have initial focus.
        This method should be overridden, and is called
        by the __init__ method.
        '''
        pass

    def buttonbox(self):
        '''add standard button box.

        override if you do not want the standard buttons
        '''

        box = Frame(self)

        w = Button(box, text="OK", width=10, command=self.ok, default=ACTIVE)
        w.pack(side=LEFT, padx=5, pady=5)
        w = Button(box, text="Cancel", width=10, command=self.cancel)
        w.pack(side=LEFT, padx=5, pady=5)

        self.bind("<Return>", self.ok)
        self.bind("<Escape>", self.cancel)

        box.pack()

    #
    # standard button semantics

    def ok(self, event=None):

        if not self.validate():
            self.initial_focus.focus_set() # put focus back
            return

        self.withdraw()
        self.update_idletasks()

        try:
            self.apply()
        finally:
            self.cancel()

    def cancel(self, event=None):

        # put focus back to the parent window
        if self.parent is not None:
            self.parent.focus_set()
        self.destroy()

    #
    # command hooks

    def validate(self):
        '''validate the data

        This method is called automatically to validate the data before the
        dialog is destroyed. By default, it always validates OK.
        '''

        return 1 # override

    def apply(self):
        '''process the data

        This method is called automatically to process the data, *after*
        the dialog is destroyed. By default, it does nothing.
        '''

        pass # override


def _setup_dialog(w):
    if w._windowingsystem == "aqua":
        w.tk.call("::tk::unsupported::MacWindowStyle", "style",
                  w, "moveableModal", "")
    elif w._windowingsystem == "x11":
        w.wm_attributes("-type", "dialog")

# --------------------------------------------------------------------
# convenience dialogues

class _QueryDialog(Dialog):

    def __init__(self, title, prompt,
                 initialvalue=None,
                 minvalue = None, maxvalue = None,
                 parent = None):

        self.prompt   = prompt
        self.minvalue = minvalue
        self.maxvalue = maxvalue

        self.initialvalue = initialvalue

        Dialog.__init__(self, parent, title)

    def destroy(self):
        self.entry = None
        Dialog.destroy(self)

    def body(self, master):

        w = Label(master, text=self.prompt, justify=LEFT)
        w.grid(row=0, padx=5, sticky=W)

        self.entry = Entry(master, name="entry")
        self.entry.grid(row=1, padx=5, sticky=W+E)

        if self.initialvalue is not None:
            self.entry.insert(0, self.initialvalue)
            self.entry.select_range(0, END)

        return self.entry

    def validate(self):
        try:
            result = self.getresult()
        except ValueError:
            messagebox.showwarning(
                "Illegal value",
                self.errormessage + "\nPlease try again",
                parent = self
            )
            return 0

        if self.minvalue is not None and result < self.minvalue:
            messagebox.showwarning(
                "Too small",
                "The allowed minimum value is %s. "
                "Please try again." % self.minvalue,
                parent = self
            )
            return 0

        if self.maxvalue is not None and result > self.maxvalue:
            messagebox.showwarning(
                "Too large",
                "The allowed maximum value is %s. "
                "Please try again." % self.maxvalue,
                parent = self
            )
            return 0

        self.result = result

        return 1


class _QueryInteger(_QueryDialog):
    errormessage = "Not an integer."

    def getresult(self):
        return self.getint(self.entry.get())


def askinteger(title, prompt, **kw):
    '''get an integer from the user

    Arguments:

        title -- the dialog title
        prompt -- the label text
        **kw -- see SimpleDialog class

    Return value is an integer
    '''
    d = _QueryInteger(title, prompt, **kw)
    return d.result


class _QueryFloat(_QueryDialog):
    errormessage = "Not a floating point value."

    def getresult(self):
        return self.getdouble(self.entry.get())


def askfloat(title, prompt, **kw):
    '''get a float from the user

    Arguments:

        title -- the dialog title
        prompt -- the label text
        **kw -- see SimpleDialog class

    Return value is a float
    '''
    d = _QueryFloat(title, prompt, **kw)
    return d.result


class _QueryString(_QueryDialog):
    def __init__(self, *args, **kw):
        if "show" in kw:
            self.__show = kw["show"]
            del kw["show"]
        else:
            self.__show = None
        _QueryDialog.__init__(self, *args, **kw)

    def body(self, master):
        entry = _QueryDialog.body(self, master)
        if self.__show is not None:
            entry.configure(show=self.__show)
        return entry

    def getresult(self):
        return self.entry.get()


def askstring(title, prompt, **kw):
    '''get a string from the user

    Arguments:

        title -- the dialog title
        prompt -- the label text
        **kw -- see SimpleDialog class

    Return value is a string
    '''
    d = _QueryString(title, prompt, **kw)
    return d.result


if __name__ == '__main__':

    def test():
        root = Tk()
        def doit(root=root):
            d = SimpleDialog(root,
                         text="This is a test dialog.  "
                              "Would this have been an actual dialog, "
                              "the buttons below would have been glowing "
                              "in soft pink light.\n"
                              "Do you believe this?",
                         buttons=["Yes", "No", "Cancel"],
                         default=0,
                         cancel=2,
                         title="Test Dialog")
            print(d.go())
            print(askinteger("Spam", "Egg count", initialvalue=12*12))
            print(askfloat("Spam", "Egg weight\n(in tons)", minvalue=1,
                           maxvalue=100))
            print(askstring("Spam", "Egg label"))
        t = Button(root, text='Test', command=doit)
        t.pack()
        q = Button(root, text='Quit', command=t.quit)
        q.pack()
        t.mainloop()

    test()
tkinter/__init__.py000064400000512715151153537530010360 0ustar00"""Wrapper functions for Tcl/Tk.

Tkinter provides classes which allow the display, positioning and
control of widgets. Toplevel widgets are Tk and Toplevel. Other
widgets are Frame, Label, Entry, Text, Canvas, Button, Radiobutton,
Checkbutton, Scale, Listbox, Scrollbar, OptionMenu, Spinbox
LabelFrame and PanedWindow.

Properties of the widgets are specified with keyword arguments.
Keyword arguments have the same name as the corresponding resource
under Tk.

Widgets are positioned with one of the geometry managers Place, Pack
or Grid. These managers can be called with methods place, pack, grid
available in every Widget.

Actions are bound to events by resources (e.g. keyword argument
command) or with the method bind.

Example (Hello, World):
import tkinter
from tkinter.constants import *
tk = tkinter.Tk()
frame = tkinter.Frame(tk, relief=RIDGE, borderwidth=2)
frame.pack(fill=BOTH,expand=1)
label = tkinter.Label(frame, text="Hello, World")
label.pack(fill=X, expand=1)
button = tkinter.Button(frame,text="Exit",command=tk.destroy)
button.pack(side=BOTTOM)
tk.mainloop()
"""

import enum
import sys

import _tkinter # If this fails your Python may not be configured for Tk
TclError = _tkinter.TclError
from tkinter.constants import *
import re


wantobjects = 1

TkVersion = float(_tkinter.TK_VERSION)
TclVersion = float(_tkinter.TCL_VERSION)

READABLE = _tkinter.READABLE
WRITABLE = _tkinter.WRITABLE
EXCEPTION = _tkinter.EXCEPTION


_magic_re = re.compile(r'([\\{}])')
_space_re = re.compile(r'([\s])', re.ASCII)


def _join(value):
    """Internal function."""
    return ' '.join(map(_stringify, value))


def _stringify(value):
    """Internal function."""
    if isinstance(value, (list, tuple)):
        if len(value) == 1:
            value = _stringify(value[0])
            if _magic_re.search(value):
                value = '{%s}' % value
        else:
            value = '{%s}' % _join(value)
    else:
        value = str(value)
        if not value:
            value = '{}'
        elif _magic_re.search(value):
            # add '\' before special characters and spaces
            value = _magic_re.sub(r'\\\1', value)
            value = value.replace('\n', r'\n')
            value = _space_re.sub(r'\\\1', value)
            if value[0] == '"':
                value = '\\' + value
        elif value[0] == '"' or _space_re.search(value):
            value = '{%s}' % value
    return value


def _flatten(seq):
    """Internal function."""
    res = ()
    for item in seq:
        if isinstance(item, (tuple, list)):
            res = res + _flatten(item)
        elif item is not None:
            res = res + (item,)
    return res


try: _flatten = _tkinter._flatten
except AttributeError: pass


def _cnfmerge(cnfs):
    """Internal function."""
    if isinstance(cnfs, dict):
        return cnfs
    elif isinstance(cnfs, (type(None), str)):
        return cnfs
    else:
        cnf = {}
        for c in _flatten(cnfs):
            try:
                cnf.update(c)
            except (AttributeError, TypeError) as msg:
                print("_cnfmerge: fallback due to:", msg)
                for k, v in c.items():
                    cnf[k] = v
        return cnf


try: _cnfmerge = _tkinter._cnfmerge
except AttributeError: pass


def _splitdict(tk, v, cut_minus=True, conv=None):
    """Return a properly formatted dict built from Tcl list pairs.

    If cut_minus is True, the supposed '-' prefix will be removed from
    keys. If conv is specified, it is used to convert values.

    Tcl list is expected to contain an even number of elements.
    """
    t = tk.splitlist(v)
    if len(t) % 2:
        raise RuntimeError('Tcl list representing a dict is expected '
                           'to contain an even number of elements')
    it = iter(t)
    dict = {}
    for key, value in zip(it, it):
        key = str(key)
        if cut_minus and key[0] == '-':
            key = key[1:]
        if conv:
            value = conv(value)
        dict[key] = value
    return dict


class EventType(str, enum.Enum):
    KeyPress = '2'
    Key = KeyPress
    KeyRelease = '3'
    ButtonPress = '4'
    Button = ButtonPress
    ButtonRelease = '5'
    Motion = '6'
    Enter = '7'
    Leave = '8'
    FocusIn = '9'
    FocusOut = '10'
    Keymap = '11'           # undocumented
    Expose = '12'
    GraphicsExpose = '13'   # undocumented
    NoExpose = '14'         # undocumented
    Visibility = '15'
    Create = '16'
    Destroy = '17'
    Unmap = '18'
    Map = '19'
    MapRequest = '20'
    Reparent = '21'
    Configure = '22'
    ConfigureRequest = '23'
    Gravity = '24'
    ResizeRequest = '25'
    Circulate = '26'
    CirculateRequest = '27'
    Property = '28'
    SelectionClear = '29'   # undocumented
    SelectionRequest = '30' # undocumented
    Selection = '31'        # undocumented
    Colormap = '32'
    ClientMessage = '33'    # undocumented
    Mapping = '34'          # undocumented
    VirtualEvent = '35'     # undocumented
    Activate = '36'
    Deactivate = '37'
    MouseWheel = '38'

    __str__ = str.__str__


class Event:
    """Container for the properties of an event.

    Instances of this type are generated if one of the following events occurs:

    KeyPress, KeyRelease - for keyboard events
    ButtonPress, ButtonRelease, Motion, Enter, Leave, MouseWheel - for mouse events
    Visibility, Unmap, Map, Expose, FocusIn, FocusOut, Circulate,
    Colormap, Gravity, Reparent, Property, Destroy, Activate,
    Deactivate - for window events.

    If a callback function for one of these events is registered
    using bind, bind_all, bind_class, or tag_bind, the callback is
    called with an Event as first argument. It will have the
    following attributes (in braces are the event types for which
    the attribute is valid):

        serial - serial number of event
    num - mouse button pressed (ButtonPress, ButtonRelease)
    focus - whether the window has the focus (Enter, Leave)
    height - height of the exposed window (Configure, Expose)
    width - width of the exposed window (Configure, Expose)
    keycode - keycode of the pressed key (KeyPress, KeyRelease)
    state - state of the event as a number (ButtonPress, ButtonRelease,
                            Enter, KeyPress, KeyRelease,
                            Leave, Motion)
    state - state as a string (Visibility)
    time - when the event occurred
    x - x-position of the mouse
    y - y-position of the mouse
    x_root - x-position of the mouse on the screen
             (ButtonPress, ButtonRelease, KeyPress, KeyRelease, Motion)
    y_root - y-position of the mouse on the screen
             (ButtonPress, ButtonRelease, KeyPress, KeyRelease, Motion)
    char - pressed character (KeyPress, KeyRelease)
    send_event - see X/Windows documentation
    keysym - keysym of the event as a string (KeyPress, KeyRelease)
    keysym_num - keysym of the event as a number (KeyPress, KeyRelease)
    type - type of the event as a number
    widget - widget in which the event occurred
    delta - delta of wheel movement (MouseWheel)
    """

    def __repr__(self):
        attrs = {k: v for k, v in self.__dict__.items() if v != '??'}
        if not self.char:
            del attrs['char']
        elif self.char != '??':
            attrs['char'] = repr(self.char)
        if not getattr(self, 'send_event', True):
            del attrs['send_event']
        if self.state == 0:
            del attrs['state']
        elif isinstance(self.state, int):
            state = self.state
            mods = ('Shift', 'Lock', 'Control',
                    'Mod1', 'Mod2', 'Mod3', 'Mod4', 'Mod5',
                    'Button1', 'Button2', 'Button3', 'Button4', 'Button5')
            s = []
            for i, n in enumerate(mods):
                if state & (1 << i):
                    s.append(n)
            state = state & ~((1<< len(mods)) - 1)
            if state or not s:
                s.append(hex(state))
            attrs['state'] = '|'.join(s)
        if self.delta == 0:
            del attrs['delta']
        # widget usually is known
        # serial and time are not very interesting
        # keysym_num duplicates keysym
        # x_root and y_root mostly duplicate x and y
        keys = ('send_event',
                'state', 'keysym', 'keycode', 'char',
                'num', 'delta', 'focus',
                'x', 'y', 'width', 'height')
        return '<%s event%s>' % (
            getattr(self.type, 'name', self.type),
            ''.join(' %s=%s' % (k, attrs[k]) for k in keys if k in attrs)
        )


_support_default_root = True
_default_root = None


def NoDefaultRoot():
    """Inhibit setting of default root window.

    Call this function to inhibit that the first instance of
    Tk is used for windows without an explicit parent window.
    """
    global _support_default_root, _default_root
    _support_default_root = False
    # Delete, so any use of _default_root will immediately raise an exception.
    # Rebind before deletion, so repeated calls will not fail.
    _default_root = None
    del _default_root


def _get_default_root(what=None):
    if not _support_default_root:
        raise RuntimeError("No master specified and tkinter is "
                           "configured to not support default root")
    if not _default_root:
        if what:
            raise RuntimeError(f"Too early to {what}: no default root window")
        root = Tk()
        assert _default_root is root
    return _default_root


def _tkerror(err):
    """Internal function."""
    pass


def _exit(code=0):
    """Internal function. Calling it will raise the exception SystemExit."""
    try:
        code = int(code)
    except ValueError:
        pass
    raise SystemExit(code)


_varnum = 0


class Variable:
    """Class to define value holders for e.g. buttons.

    Subclasses StringVar, IntVar, DoubleVar, BooleanVar are specializations
    that constrain the type of the value returned from get()."""
    _default = ""
    _tk = None
    _tclCommands = None

    def __init__(self, master=None, value=None, name=None):
        """Construct a variable

        MASTER can be given as master widget.
        VALUE is an optional value (defaults to "")
        NAME is an optional Tcl name (defaults to PY_VARnum).

        If NAME matches an existing variable and VALUE is omitted
        then the existing value is retained.
        """
        # check for type of NAME parameter to override weird error message
        # raised from Modules/_tkinter.c:SetVar like:
        # TypeError: setvar() takes exactly 3 arguments (2 given)
        if name is not None and not isinstance(name, str):
            raise TypeError("name must be a string")
        global _varnum
        if not master:
            master = _get_default_root('create variable')
        self._root = master._root()
        self._tk = master.tk
        if name:
            self._name = name
        else:
            self._name = 'PY_VAR' + repr(_varnum)
            _varnum += 1
        if value is not None:
            self.initialize(value)
        elif not self._tk.getboolean(self._tk.call("info", "exists", self._name)):
            self.initialize(self._default)

    def __del__(self):
        """Unset the variable in Tcl."""
        if self._tk is None:
            return
        if self._tk.getboolean(self._tk.call("info", "exists", self._name)):
            self._tk.globalunsetvar(self._name)
        if self._tclCommands is not None:
            for name in self._tclCommands:
                #print '- Tkinter: deleted command', name
                self._tk.deletecommand(name)
            self._tclCommands = None

    def __str__(self):
        """Return the name of the variable in Tcl."""
        return self._name

    def set(self, value):
        """Set the variable to VALUE."""
        return self._tk.globalsetvar(self._name, value)

    initialize = set

    def get(self):
        """Return value of variable."""
        return self._tk.globalgetvar(self._name)

    def _register(self, callback):
        f = CallWrapper(callback, None, self._root).__call__
        cbname = repr(id(f))
        try:
            callback = callback.__func__
        except AttributeError:
            pass
        try:
            cbname = cbname + callback.__name__
        except AttributeError:
            pass
        self._tk.createcommand(cbname, f)
        if self._tclCommands is None:
            self._tclCommands = []
        self._tclCommands.append(cbname)
        return cbname

    def trace_add(self, mode, callback):
        """Define a trace callback for the variable.

        Mode is one of "read", "write", "unset", or a list or tuple of
        such strings.
        Callback must be a function which is called when the variable is
        read, written or unset.

        Return the name of the callback.
        """
        cbname = self._register(callback)
        self._tk.call('trace', 'add', 'variable',
                      self._name, mode, (cbname,))
        return cbname

    def trace_remove(self, mode, cbname):
        """Delete the trace callback for a variable.

        Mode is one of "read", "write", "unset" or a list or tuple of
        such strings.  Must be same as were specified in trace_add().
        cbname is the name of the callback returned from trace_add().
        """
        self._tk.call('trace', 'remove', 'variable',
                      self._name, mode, cbname)
        for m, ca in self.trace_info():
            if self._tk.splitlist(ca)[0] == cbname:
                break
        else:
            self._tk.deletecommand(cbname)
            try:
                self._tclCommands.remove(cbname)
            except ValueError:
                pass

    def trace_info(self):
        """Return all trace callback information."""
        splitlist = self._tk.splitlist
        return [(splitlist(k), v) for k, v in map(splitlist,
            splitlist(self._tk.call('trace', 'info', 'variable', self._name)))]

    def trace_variable(self, mode, callback):
        """Define a trace callback for the variable.

        MODE is one of "r", "w", "u" for read, write, undefine.
        CALLBACK must be a function which is called when
        the variable is read, written or undefined.

        Return the name of the callback.

        This deprecated method wraps a deprecated Tcl method that will
        likely be removed in the future.  Use trace_add() instead.
        """
        # TODO: Add deprecation warning
        cbname = self._register(callback)
        self._tk.call("trace", "variable", self._name, mode, cbname)
        return cbname

    trace = trace_variable

    def trace_vdelete(self, mode, cbname):
        """Delete the trace callback for a variable.

        MODE is one of "r", "w", "u" for read, write, undefine.
        CBNAME is the name of the callback returned from trace_variable or trace.

        This deprecated method wraps a deprecated Tcl method that will
        likely be removed in the future.  Use trace_remove() instead.
        """
        # TODO: Add deprecation warning
        self._tk.call("trace", "vdelete", self._name, mode, cbname)
        cbname = self._tk.splitlist(cbname)[0]
        for m, ca in self.trace_info():
            if self._tk.splitlist(ca)[0] == cbname:
                break
        else:
            self._tk.deletecommand(cbname)
            try:
                self._tclCommands.remove(cbname)
            except ValueError:
                pass

    def trace_vinfo(self):
        """Return all trace callback information.

        This deprecated method wraps a deprecated Tcl method that will
        likely be removed in the future.  Use trace_info() instead.
        """
        # TODO: Add deprecation warning
        return [self._tk.splitlist(x) for x in self._tk.splitlist(
            self._tk.call("trace", "vinfo", self._name))]

    def __eq__(self, other):
        if not isinstance(other, Variable):
            return NotImplemented
        return (self._name == other._name
                and self.__class__.__name__ == other.__class__.__name__
                and self._tk == other._tk)


class StringVar(Variable):
    """Value holder for strings variables."""
    _default = ""

    def __init__(self, master=None, value=None, name=None):
        """Construct a string variable.

        MASTER can be given as master widget.
        VALUE is an optional value (defaults to "")
        NAME is an optional Tcl name (defaults to PY_VARnum).

        If NAME matches an existing variable and VALUE is omitted
        then the existing value is retained.
        """
        Variable.__init__(self, master, value, name)

    def get(self):
        """Return value of variable as string."""
        value = self._tk.globalgetvar(self._name)
        if isinstance(value, str):
            return value
        return str(value)


class IntVar(Variable):
    """Value holder for integer variables."""
    _default = 0

    def __init__(self, master=None, value=None, name=None):
        """Construct an integer variable.

        MASTER can be given as master widget.
        VALUE is an optional value (defaults to 0)
        NAME is an optional Tcl name (defaults to PY_VARnum).

        If NAME matches an existing variable and VALUE is omitted
        then the existing value is retained.
        """
        Variable.__init__(self, master, value, name)

    def get(self):
        """Return the value of the variable as an integer."""
        value = self._tk.globalgetvar(self._name)
        try:
            return self._tk.getint(value)
        except (TypeError, TclError):
            return int(self._tk.getdouble(value))


class DoubleVar(Variable):
    """Value holder for float variables."""
    _default = 0.0

    def __init__(self, master=None, value=None, name=None):
        """Construct a float variable.

        MASTER can be given as master widget.
        VALUE is an optional value (defaults to 0.0)
        NAME is an optional Tcl name (defaults to PY_VARnum).

        If NAME matches an existing variable and VALUE is omitted
        then the existing value is retained.
        """
        Variable.__init__(self, master, value, name)

    def get(self):
        """Return the value of the variable as a float."""
        return self._tk.getdouble(self._tk.globalgetvar(self._name))


class BooleanVar(Variable):
    """Value holder for boolean variables."""
    _default = False

    def __init__(self, master=None, value=None, name=None):
        """Construct a boolean variable.

        MASTER can be given as master widget.
        VALUE is an optional value (defaults to False)
        NAME is an optional Tcl name (defaults to PY_VARnum).

        If NAME matches an existing variable and VALUE is omitted
        then the existing value is retained.
        """
        Variable.__init__(self, master, value, name)

    def set(self, value):
        """Set the variable to VALUE."""
        return self._tk.globalsetvar(self._name, self._tk.getboolean(value))

    initialize = set

    def get(self):
        """Return the value of the variable as a bool."""
        try:
            return self._tk.getboolean(self._tk.globalgetvar(self._name))
        except TclError:
            raise ValueError("invalid literal for getboolean()")


def mainloop(n=0):
    """Run the main loop of Tcl."""
    _get_default_root('run the main loop').tk.mainloop(n)


getint = int

getdouble = float


def getboolean(s):
    """Convert Tcl object to True or False."""
    try:
        return _get_default_root('use getboolean()').tk.getboolean(s)
    except TclError:
        raise ValueError("invalid literal for getboolean()")


# Methods defined on both toplevel and interior widgets

class Misc:
    """Internal class.

    Base class which defines methods common for interior widgets."""

    # used for generating child widget names
    _last_child_ids = None

    # XXX font command?
    _tclCommands = None

    def destroy(self):
        """Internal function.

        Delete all Tcl commands created for
        this widget in the Tcl interpreter."""
        if self._tclCommands is not None:
            for name in self._tclCommands:
                #print '- Tkinter: deleted command', name
                self.tk.deletecommand(name)
            self._tclCommands = None

    def deletecommand(self, name):
        """Internal function.

        Delete the Tcl command provided in NAME."""
        #print '- Tkinter: deleted command', name
        self.tk.deletecommand(name)
        try:
            self._tclCommands.remove(name)
        except ValueError:
            pass

    def tk_strictMotif(self, boolean=None):
        """Set Tcl internal variable, whether the look and feel
        should adhere to Motif.

        A parameter of 1 means adhere to Motif (e.g. no color
        change if mouse passes over slider).
        Returns the set value."""
        return self.tk.getboolean(self.tk.call(
            'set', 'tk_strictMotif', boolean))

    def tk_bisque(self):
        """Change the color scheme to light brown as used in Tk 3.6 and before."""
        self.tk.call('tk_bisque')

    def tk_setPalette(self, *args, **kw):
        """Set a new color scheme for all widget elements.

        A single color as argument will cause that all colors of Tk
        widget elements are derived from this.
        Alternatively several keyword parameters and its associated
        colors can be given. The following keywords are valid:
        activeBackground, foreground, selectColor,
        activeForeground, highlightBackground, selectBackground,
        background, highlightColor, selectForeground,
        disabledForeground, insertBackground, troughColor."""
        self.tk.call(('tk_setPalette',)
              + _flatten(args) + _flatten(list(kw.items())))

    def wait_variable(self, name='PY_VAR'):
        """Wait until the variable is modified.

        A parameter of type IntVar, StringVar, DoubleVar or
        BooleanVar must be given."""
        self.tk.call('tkwait', 'variable', name)
    waitvar = wait_variable # XXX b/w compat

    def wait_window(self, window=None):
        """Wait until a WIDGET is destroyed.

        If no parameter is given self is used."""
        if window is None:
            window = self
        self.tk.call('tkwait', 'window', window._w)

    def wait_visibility(self, window=None):
        """Wait until the visibility of a WIDGET changes
        (e.g. it appears).

        If no parameter is given self is used."""
        if window is None:
            window = self
        self.tk.call('tkwait', 'visibility', window._w)

    def setvar(self, name='PY_VAR', value='1'):
        """Set Tcl variable NAME to VALUE."""
        self.tk.setvar(name, value)

    def getvar(self, name='PY_VAR'):
        """Return value of Tcl variable NAME."""
        return self.tk.getvar(name)

    def getint(self, s):
        try:
            return self.tk.getint(s)
        except TclError as exc:
            raise ValueError(str(exc))

    def getdouble(self, s):
        try:
            return self.tk.getdouble(s)
        except TclError as exc:
            raise ValueError(str(exc))

    def getboolean(self, s):
        """Return a boolean value for Tcl boolean values true and false given as parameter."""
        try:
            return self.tk.getboolean(s)
        except TclError:
            raise ValueError("invalid literal for getboolean()")

    def focus_set(self):
        """Direct input focus to this widget.

        If the application currently does not have the focus
        this widget will get the focus if the application gets
        the focus through the window manager."""
        self.tk.call('focus', self._w)
    focus = focus_set # XXX b/w compat?

    def focus_force(self):
        """Direct input focus to this widget even if the
        application does not have the focus. Use with
        caution!"""
        self.tk.call('focus', '-force', self._w)

    def focus_get(self):
        """Return the widget which has currently the focus in the
        application.

        Use focus_displayof to allow working with several
        displays. Return None if application does not have
        the focus."""
        name = self.tk.call('focus')
        if name == 'none' or not name: return None
        return self._nametowidget(name)

    def focus_displayof(self):
        """Return the widget which has currently the focus on the
        display where this widget is located.

        Return None if the application does not have the focus."""
        name = self.tk.call('focus', '-displayof', self._w)
        if name == 'none' or not name: return None
        return self._nametowidget(name)

    def focus_lastfor(self):
        """Return the widget which would have the focus if top level
        for this widget gets the focus from the window manager."""
        name = self.tk.call('focus', '-lastfor', self._w)
        if name == 'none' or not name: return None
        return self._nametowidget(name)

    def tk_focusFollowsMouse(self):
        """The widget under mouse will get automatically focus. Can not
        be disabled easily."""
        self.tk.call('tk_focusFollowsMouse')

    def tk_focusNext(self):
        """Return the next widget in the focus order which follows
        widget which has currently the focus.

        The focus order first goes to the next child, then to
        the children of the child recursively and then to the
        next sibling which is higher in the stacking order.  A
        widget is omitted if it has the takefocus resource set
        to 0."""
        name = self.tk.call('tk_focusNext', self._w)
        if not name: return None
        return self._nametowidget(name)

    def tk_focusPrev(self):
        """Return previous widget in the focus order. See tk_focusNext for details."""
        name = self.tk.call('tk_focusPrev', self._w)
        if not name: return None
        return self._nametowidget(name)

    def after(self, ms, func=None, *args):
        """Call function once after given time.

        MS specifies the time in milliseconds. FUNC gives the
        function which shall be called. Additional parameters
        are given as parameters to the function call.  Return
        identifier to cancel scheduling with after_cancel."""
        if not func:
            # I'd rather use time.sleep(ms*0.001)
            self.tk.call('after', ms)
            return None
        else:
            def callit():
                try:
                    func(*args)
                finally:
                    try:
                        self.deletecommand(name)
                    except TclError:
                        pass
            callit.__name__ = func.__name__
            name = self._register(callit)
            return self.tk.call('after', ms, name)

    def after_idle(self, func, *args):
        """Call FUNC once if the Tcl main loop has no event to
        process.

        Return an identifier to cancel the scheduling with
        after_cancel."""
        return self.after('idle', func, *args)

    def after_cancel(self, id):
        """Cancel scheduling of function identified with ID.

        Identifier returned by after or after_idle must be
        given as first parameter.
        """
        if not id:
            raise ValueError('id must be a valid identifier returned from '
                             'after or after_idle')
        try:
            data = self.tk.call('after', 'info', id)
            script = self.tk.splitlist(data)[0]
            self.deletecommand(script)
        except TclError:
            pass
        self.tk.call('after', 'cancel', id)

    def bell(self, displayof=0):
        """Ring a display's bell."""
        self.tk.call(('bell',) + self._displayof(displayof))

    # Clipboard handling:
    def clipboard_get(self, **kw):
        """Retrieve data from the clipboard on window's display.

        The window keyword defaults to the root window of the Tkinter
        application.

        The type keyword specifies the form in which the data is
        to be returned and should be an atom name such as STRING
        or FILE_NAME.  Type defaults to STRING, except on X11, where the default
        is to try UTF8_STRING and fall back to STRING.

        This command is equivalent to:

        selection_get(CLIPBOARD)
        """
        if 'type' not in kw and self._windowingsystem == 'x11':
            try:
                kw['type'] = 'UTF8_STRING'
                return self.tk.call(('clipboard', 'get') + self._options(kw))
            except TclError:
                del kw['type']
        return self.tk.call(('clipboard', 'get') + self._options(kw))

    def clipboard_clear(self, **kw):
        """Clear the data in the Tk clipboard.

        A widget specified for the optional displayof keyword
        argument specifies the target display."""
        if 'displayof' not in kw: kw['displayof'] = self._w
        self.tk.call(('clipboard', 'clear') + self._options(kw))

    def clipboard_append(self, string, **kw):
        """Append STRING to the Tk clipboard.

        A widget specified at the optional displayof keyword
        argument specifies the target display. The clipboard
        can be retrieved with selection_get."""
        if 'displayof' not in kw: kw['displayof'] = self._w
        self.tk.call(('clipboard', 'append') + self._options(kw)
              + ('--', string))
    # XXX grab current w/o window argument

    def grab_current(self):
        """Return widget which has currently the grab in this application
        or None."""
        name = self.tk.call('grab', 'current', self._w)
        if not name: return None
        return self._nametowidget(name)

    def grab_release(self):
        """Release grab for this widget if currently set."""
        self.tk.call('grab', 'release', self._w)

    def grab_set(self):
        """Set grab for this widget.

        A grab directs all events to this and descendant
        widgets in the application."""
        self.tk.call('grab', 'set', self._w)

    def grab_set_global(self):
        """Set global grab for this widget.

        A global grab directs all events to this and
        descendant widgets on the display. Use with caution -
        other applications do not get events anymore."""
        self.tk.call('grab', 'set', '-global', self._w)

    def grab_status(self):
        """Return None, "local" or "global" if this widget has
        no, a local or a global grab."""
        status = self.tk.call('grab', 'status', self._w)
        if status == 'none': status = None
        return status

    def option_add(self, pattern, value, priority = None):
        """Set a VALUE (second parameter) for an option
        PATTERN (first parameter).

        An optional third parameter gives the numeric priority
        (defaults to 80)."""
        self.tk.call('option', 'add', pattern, value, priority)

    def option_clear(self):
        """Clear the option database.

        It will be reloaded if option_add is called."""
        self.tk.call('option', 'clear')

    def option_get(self, name, className):
        """Return the value for an option NAME for this widget
        with CLASSNAME.

        Values with higher priority override lower values."""
        return self.tk.call('option', 'get', self._w, name, className)

    def option_readfile(self, fileName, priority = None):
        """Read file FILENAME into the option database.

        An optional second parameter gives the numeric
        priority."""
        self.tk.call('option', 'readfile', fileName, priority)

    def selection_clear(self, **kw):
        """Clear the current X selection."""
        if 'displayof' not in kw: kw['displayof'] = self._w
        self.tk.call(('selection', 'clear') + self._options(kw))

    def selection_get(self, **kw):
        """Return the contents of the current X selection.

        A keyword parameter selection specifies the name of
        the selection and defaults to PRIMARY.  A keyword
        parameter displayof specifies a widget on the display
        to use. A keyword parameter type specifies the form of data to be
        fetched, defaulting to STRING except on X11, where UTF8_STRING is tried
        before STRING."""
        if 'displayof' not in kw: kw['displayof'] = self._w
        if 'type' not in kw and self._windowingsystem == 'x11':
            try:
                kw['type'] = 'UTF8_STRING'
                return self.tk.call(('selection', 'get') + self._options(kw))
            except TclError:
                del kw['type']
        return self.tk.call(('selection', 'get') + self._options(kw))

    def selection_handle(self, command, **kw):
        """Specify a function COMMAND to call if the X
        selection owned by this widget is queried by another
        application.

        This function must return the contents of the
        selection. The function will be called with the
        arguments OFFSET and LENGTH which allows the chunking
        of very long selections. The following keyword
        parameters can be provided:
        selection - name of the selection (default PRIMARY),
        type - type of the selection (e.g. STRING, FILE_NAME)."""
        name = self._register(command)
        self.tk.call(('selection', 'handle') + self._options(kw)
              + (self._w, name))

    def selection_own(self, **kw):
        """Become owner of X selection.

        A keyword parameter selection specifies the name of
        the selection (default PRIMARY)."""
        self.tk.call(('selection', 'own') +
                 self._options(kw) + (self._w,))

    def selection_own_get(self, **kw):
        """Return owner of X selection.

        The following keyword parameter can
        be provided:
        selection - name of the selection (default PRIMARY),
        type - type of the selection (e.g. STRING, FILE_NAME)."""
        if 'displayof' not in kw: kw['displayof'] = self._w
        name = self.tk.call(('selection', 'own') + self._options(kw))
        if not name: return None
        return self._nametowidget(name)

    def send(self, interp, cmd, *args):
        """Send Tcl command CMD to different interpreter INTERP to be executed."""
        return self.tk.call(('send', interp, cmd) + args)

    def lower(self, belowThis=None):
        """Lower this widget in the stacking order."""
        self.tk.call('lower', self._w, belowThis)

    def tkraise(self, aboveThis=None):
        """Raise this widget in the stacking order."""
        self.tk.call('raise', self._w, aboveThis)

    lift = tkraise

    def winfo_atom(self, name, displayof=0):
        """Return integer which represents atom NAME."""
        args = ('winfo', 'atom') + self._displayof(displayof) + (name,)
        return self.tk.getint(self.tk.call(args))

    def winfo_atomname(self, id, displayof=0):
        """Return name of atom with identifier ID."""
        args = ('winfo', 'atomname') \
               + self._displayof(displayof) + (id,)
        return self.tk.call(args)

    def winfo_cells(self):
        """Return number of cells in the colormap for this widget."""
        return self.tk.getint(
            self.tk.call('winfo', 'cells', self._w))

    def winfo_children(self):
        """Return a list of all widgets which are children of this widget."""
        result = []
        for child in self.tk.splitlist(
            self.tk.call('winfo', 'children', self._w)):
            try:
                # Tcl sometimes returns extra windows, e.g. for
                # menus; those need to be skipped
                result.append(self._nametowidget(child))
            except KeyError:
                pass
        return result

    def winfo_class(self):
        """Return window class name of this widget."""
        return self.tk.call('winfo', 'class', self._w)

    def winfo_colormapfull(self):
        """Return True if at the last color request the colormap was full."""
        return self.tk.getboolean(
            self.tk.call('winfo', 'colormapfull', self._w))

    def winfo_containing(self, rootX, rootY, displayof=0):
        """Return the widget which is at the root coordinates ROOTX, ROOTY."""
        args = ('winfo', 'containing') \
               + self._displayof(displayof) + (rootX, rootY)
        name = self.tk.call(args)
        if not name: return None
        return self._nametowidget(name)

    def winfo_depth(self):
        """Return the number of bits per pixel."""
        return self.tk.getint(self.tk.call('winfo', 'depth', self._w))

    def winfo_exists(self):
        """Return true if this widget exists."""
        return self.tk.getint(
            self.tk.call('winfo', 'exists', self._w))

    def winfo_fpixels(self, number):
        """Return the number of pixels for the given distance NUMBER
        (e.g. "3c") as float."""
        return self.tk.getdouble(self.tk.call(
            'winfo', 'fpixels', self._w, number))

    def winfo_geometry(self):
        """Return geometry string for this widget in the form "widthxheight+X+Y"."""
        return self.tk.call('winfo', 'geometry', self._w)

    def winfo_height(self):
        """Return height of this widget."""
        return self.tk.getint(
            self.tk.call('winfo', 'height', self._w))

    def winfo_id(self):
        """Return identifier ID for this widget."""
        return int(self.tk.call('winfo', 'id', self._w), 0)

    def winfo_interps(self, displayof=0):
        """Return the name of all Tcl interpreters for this display."""
        args = ('winfo', 'interps') + self._displayof(displayof)
        return self.tk.splitlist(self.tk.call(args))

    def winfo_ismapped(self):
        """Return true if this widget is mapped."""
        return self.tk.getint(
            self.tk.call('winfo', 'ismapped', self._w))

    def winfo_manager(self):
        """Return the window manager name for this widget."""
        return self.tk.call('winfo', 'manager', self._w)

    def winfo_name(self):
        """Return the name of this widget."""
        return self.tk.call('winfo', 'name', self._w)

    def winfo_parent(self):
        """Return the name of the parent of this widget."""
        return self.tk.call('winfo', 'parent', self._w)

    def winfo_pathname(self, id, displayof=0):
        """Return the pathname of the widget given by ID."""
        args = ('winfo', 'pathname') \
               + self._displayof(displayof) + (id,)
        return self.tk.call(args)

    def winfo_pixels(self, number):
        """Rounded integer value of winfo_fpixels."""
        return self.tk.getint(
            self.tk.call('winfo', 'pixels', self._w, number))

    def winfo_pointerx(self):
        """Return the x coordinate of the pointer on the root window."""
        return self.tk.getint(
            self.tk.call('winfo', 'pointerx', self._w))

    def winfo_pointerxy(self):
        """Return a tuple of x and y coordinates of the pointer on the root window."""
        return self._getints(
            self.tk.call('winfo', 'pointerxy', self._w))

    def winfo_pointery(self):
        """Return the y coordinate of the pointer on the root window."""
        return self.tk.getint(
            self.tk.call('winfo', 'pointery', self._w))

    def winfo_reqheight(self):
        """Return requested height of this widget."""
        return self.tk.getint(
            self.tk.call('winfo', 'reqheight', self._w))

    def winfo_reqwidth(self):
        """Return requested width of this widget."""
        return self.tk.getint(
            self.tk.call('winfo', 'reqwidth', self._w))

    def winfo_rgb(self, color):
        """Return a tuple of integer RGB values in range(65536) for color in this widget."""
        return self._getints(
            self.tk.call('winfo', 'rgb', self._w, color))

    def winfo_rootx(self):
        """Return x coordinate of upper left corner of this widget on the
        root window."""
        return self.tk.getint(
            self.tk.call('winfo', 'rootx', self._w))

    def winfo_rooty(self):
        """Return y coordinate of upper left corner of this widget on the
        root window."""
        return self.tk.getint(
            self.tk.call('winfo', 'rooty', self._w))

    def winfo_screen(self):
        """Return the screen name of this widget."""
        return self.tk.call('winfo', 'screen', self._w)

    def winfo_screencells(self):
        """Return the number of the cells in the colormap of the screen
        of this widget."""
        return self.tk.getint(
            self.tk.call('winfo', 'screencells', self._w))

    def winfo_screendepth(self):
        """Return the number of bits per pixel of the root window of the
        screen of this widget."""
        return self.tk.getint(
            self.tk.call('winfo', 'screendepth', self._w))

    def winfo_screenheight(self):
        """Return the number of pixels of the height of the screen of this widget
        in pixel."""
        return self.tk.getint(
            self.tk.call('winfo', 'screenheight', self._w))

    def winfo_screenmmheight(self):
        """Return the number of pixels of the height of the screen of
        this widget in mm."""
        return self.tk.getint(
            self.tk.call('winfo', 'screenmmheight', self._w))

    def winfo_screenmmwidth(self):
        """Return the number of pixels of the width of the screen of
        this widget in mm."""
        return self.tk.getint(
            self.tk.call('winfo', 'screenmmwidth', self._w))

    def winfo_screenvisual(self):
        """Return one of the strings directcolor, grayscale, pseudocolor,
        staticcolor, staticgray, or truecolor for the default
        colormodel of this screen."""
        return self.tk.call('winfo', 'screenvisual', self._w)

    def winfo_screenwidth(self):
        """Return the number of pixels of the width of the screen of
        this widget in pixel."""
        return self.tk.getint(
            self.tk.call('winfo', 'screenwidth', self._w))

    def winfo_server(self):
        """Return information of the X-Server of the screen of this widget in
        the form "XmajorRminor vendor vendorVersion"."""
        return self.tk.call('winfo', 'server', self._w)

    def winfo_toplevel(self):
        """Return the toplevel widget of this widget."""
        return self._nametowidget(self.tk.call(
            'winfo', 'toplevel', self._w))

    def winfo_viewable(self):
        """Return true if the widget and all its higher ancestors are mapped."""
        return self.tk.getint(
            self.tk.call('winfo', 'viewable', self._w))

    def winfo_visual(self):
        """Return one of the strings directcolor, grayscale, pseudocolor,
        staticcolor, staticgray, or truecolor for the
        colormodel of this widget."""
        return self.tk.call('winfo', 'visual', self._w)

    def winfo_visualid(self):
        """Return the X identifier for the visual for this widget."""
        return self.tk.call('winfo', 'visualid', self._w)

    def winfo_visualsavailable(self, includeids=False):
        """Return a list of all visuals available for the screen
        of this widget.

        Each item in the list consists of a visual name (see winfo_visual), a
        depth and if includeids is true is given also the X identifier."""
        data = self.tk.call('winfo', 'visualsavailable', self._w,
                            'includeids' if includeids else None)
        data = [self.tk.splitlist(x) for x in self.tk.splitlist(data)]
        return [self.__winfo_parseitem(x) for x in data]

    def __winfo_parseitem(self, t):
        """Internal function."""
        return t[:1] + tuple(map(self.__winfo_getint, t[1:]))

    def __winfo_getint(self, x):
        """Internal function."""
        return int(x, 0)

    def winfo_vrootheight(self):
        """Return the height of the virtual root window associated with this
        widget in pixels. If there is no virtual root window return the
        height of the screen."""
        return self.tk.getint(
            self.tk.call('winfo', 'vrootheight', self._w))

    def winfo_vrootwidth(self):
        """Return the width of the virtual root window associated with this
        widget in pixel. If there is no virtual root window return the
        width of the screen."""
        return self.tk.getint(
            self.tk.call('winfo', 'vrootwidth', self._w))

    def winfo_vrootx(self):
        """Return the x offset of the virtual root relative to the root
        window of the screen of this widget."""
        return self.tk.getint(
            self.tk.call('winfo', 'vrootx', self._w))

    def winfo_vrooty(self):
        """Return the y offset of the virtual root relative to the root
        window of the screen of this widget."""
        return self.tk.getint(
            self.tk.call('winfo', 'vrooty', self._w))

    def winfo_width(self):
        """Return the width of this widget."""
        return self.tk.getint(
            self.tk.call('winfo', 'width', self._w))

    def winfo_x(self):
        """Return the x coordinate of the upper left corner of this widget
        in the parent."""
        return self.tk.getint(
            self.tk.call('winfo', 'x', self._w))

    def winfo_y(self):
        """Return the y coordinate of the upper left corner of this widget
        in the parent."""
        return self.tk.getint(
            self.tk.call('winfo', 'y', self._w))

    def update(self):
        """Enter event loop until all pending events have been processed by Tcl."""
        self.tk.call('update')

    def update_idletasks(self):
        """Enter event loop until all idle callbacks have been called. This
        will update the display of windows but not process events caused by
        the user."""
        self.tk.call('update', 'idletasks')

    def bindtags(self, tagList=None):
        """Set or get the list of bindtags for this widget.

        With no argument return the list of all bindtags associated with
        this widget. With a list of strings as argument the bindtags are
        set to this list. The bindtags determine in which order events are
        processed (see bind)."""
        if tagList is None:
            return self.tk.splitlist(
                self.tk.call('bindtags', self._w))
        else:
            self.tk.call('bindtags', self._w, tagList)

    def _bind(self, what, sequence, func, add, needcleanup=1):
        """Internal function."""
        if isinstance(func, str):
            self.tk.call(what + (sequence, func))
        elif func:
            funcid = self._register(func, self._substitute,
                        needcleanup)
            cmd = ('%sif {"[%s %s]" == "break"} break\n'
                   %
                   (add and '+' or '',
                funcid, self._subst_format_str))
            self.tk.call(what + (sequence, cmd))
            return funcid
        elif sequence:
            return self.tk.call(what + (sequence,))
        else:
            return self.tk.splitlist(self.tk.call(what))

    def bind(self, sequence=None, func=None, add=None):
        """Bind to this widget at event SEQUENCE a call to function FUNC.

        SEQUENCE is a string of concatenated event
        patterns. An event pattern is of the form
        <MODIFIER-MODIFIER-TYPE-DETAIL> where MODIFIER is one
        of Control, Mod2, M2, Shift, Mod3, M3, Lock, Mod4, M4,
        Button1, B1, Mod5, M5 Button2, B2, Meta, M, Button3,
        B3, Alt, Button4, B4, Double, Button5, B5 Triple,
        Mod1, M1. TYPE is one of Activate, Enter, Map,
        ButtonPress, Button, Expose, Motion, ButtonRelease
        FocusIn, MouseWheel, Circulate, FocusOut, Property,
        Colormap, Gravity Reparent, Configure, KeyPress, Key,
        Unmap, Deactivate, KeyRelease Visibility, Destroy,
        Leave and DETAIL is the button number for ButtonPress,
        ButtonRelease and DETAIL is the Keysym for KeyPress and
        KeyRelease. Examples are
        <Control-Button-1> for pressing Control and mouse button 1 or
        <Alt-A> for pressing A and the Alt key (KeyPress can be omitted).
        An event pattern can also be a virtual event of the form
        <<AString>> where AString can be arbitrary. This
        event can be generated by event_generate.
        If events are concatenated they must appear shortly
        after each other.

        FUNC will be called if the event sequence occurs with an
        instance of Event as argument. If the return value of FUNC is
        "break" no further bound function is invoked.

        An additional boolean parameter ADD specifies whether FUNC will
        be called additionally to the other bound function or whether
        it will replace the previous function.

        Bind will return an identifier to allow deletion of the bound function with
        unbind without memory leak.

        If FUNC or SEQUENCE is omitted the bound function or list
        of bound events are returned."""

        return self._bind(('bind', self._w), sequence, func, add)

    def unbind(self, sequence, funcid=None):
        """Unbind for this widget for event SEQUENCE  the
        function identified with FUNCID."""
        self.tk.call('bind', self._w, sequence, '')
        if funcid:
            self.deletecommand(funcid)

    def bind_all(self, sequence=None, func=None, add=None):
        """Bind to all widgets at an event SEQUENCE a call to function FUNC.
        An additional boolean parameter ADD specifies whether FUNC will
        be called additionally to the other bound function or whether
        it will replace the previous function. See bind for the return value."""
        return self._bind(('bind', 'all'), sequence, func, add, 0)

    def unbind_all(self, sequence):
        """Unbind for all widgets for event SEQUENCE all functions."""
        self.tk.call('bind', 'all' , sequence, '')

    def bind_class(self, className, sequence=None, func=None, add=None):
        """Bind to widgets with bindtag CLASSNAME at event
        SEQUENCE a call of function FUNC. An additional
        boolean parameter ADD specifies whether FUNC will be
        called additionally to the other bound function or
        whether it will replace the previous function. See bind for
        the return value."""

        return self._bind(('bind', className), sequence, func, add, 0)

    def unbind_class(self, className, sequence):
        """Unbind for all widgets with bindtag CLASSNAME for event SEQUENCE
        all functions."""
        self.tk.call('bind', className , sequence, '')

    def mainloop(self, n=0):
        """Call the mainloop of Tk."""
        self.tk.mainloop(n)

    def quit(self):
        """Quit the Tcl interpreter. All widgets will be destroyed."""
        self.tk.quit()

    def _getints(self, string):
        """Internal function."""
        if string:
            return tuple(map(self.tk.getint, self.tk.splitlist(string)))

    def _getdoubles(self, string):
        """Internal function."""
        if string:
            return tuple(map(self.tk.getdouble, self.tk.splitlist(string)))

    def _getboolean(self, string):
        """Internal function."""
        if string:
            return self.tk.getboolean(string)

    def _displayof(self, displayof):
        """Internal function."""
        if displayof:
            return ('-displayof', displayof)
        if displayof is None:
            return ('-displayof', self._w)
        return ()

    @property
    def _windowingsystem(self):
        """Internal function."""
        try:
            return self._root()._windowingsystem_cached
        except AttributeError:
            ws = self._root()._windowingsystem_cached = \
                        self.tk.call('tk', 'windowingsystem')
            return ws

    def _options(self, cnf, kw = None):
        """Internal function."""
        if kw:
            cnf = _cnfmerge((cnf, kw))
        else:
            cnf = _cnfmerge(cnf)
        res = ()
        for k, v in cnf.items():
            if v is not None:
                if k[-1] == '_': k = k[:-1]
                if callable(v):
                    v = self._register(v)
                elif isinstance(v, (tuple, list)):
                    nv = []
                    for item in v:
                        if isinstance(item, int):
                            nv.append(str(item))
                        elif isinstance(item, str):
                            nv.append(_stringify(item))
                        else:
                            break
                    else:
                        v = ' '.join(nv)
                res = res + ('-'+k, v)
        return res

    def nametowidget(self, name):
        """Return the Tkinter instance of a widget identified by
        its Tcl name NAME."""
        name = str(name).split('.')
        w = self

        if not name[0]:
            w = w._root()
            name = name[1:]

        for n in name:
            if not n:
                break
            w = w.children[n]

        return w

    _nametowidget = nametowidget

    def _register(self, func, subst=None, needcleanup=1):
        """Return a newly created Tcl function. If this
        function is called, the Python function FUNC will
        be executed. An optional function SUBST can
        be given which will be executed before FUNC."""
        f = CallWrapper(func, subst, self).__call__
        name = repr(id(f))
        try:
            func = func.__func__
        except AttributeError:
            pass
        try:
            name = name + func.__name__
        except AttributeError:
            pass
        self.tk.createcommand(name, f)
        if needcleanup:
            if self._tclCommands is None:
                self._tclCommands = []
            self._tclCommands.append(name)
        return name

    register = _register

    def _root(self):
        """Internal function."""
        w = self
        while w.master: w = w.master
        return w
    _subst_format = ('%#', '%b', '%f', '%h', '%k',
             '%s', '%t', '%w', '%x', '%y',
             '%A', '%E', '%K', '%N', '%W', '%T', '%X', '%Y', '%D')
    _subst_format_str = " ".join(_subst_format)

    def _substitute(self, *args):
        """Internal function."""
        if len(args) != len(self._subst_format): return args
        getboolean = self.tk.getboolean

        getint = self.tk.getint
        def getint_event(s):
            """Tk changed behavior in 8.4.2, returning "??" rather more often."""
            try:
                return getint(s)
            except (ValueError, TclError):
                return s

        nsign, b, f, h, k, s, t, w, x, y, A, E, K, N, W, T, X, Y, D = args
        # Missing: (a, c, d, m, o, v, B, R)
        e = Event()
        # serial field: valid for all events
        # number of button: ButtonPress and ButtonRelease events only
        # height field: Configure, ConfigureRequest, Create,
        # ResizeRequest, and Expose events only
        # keycode field: KeyPress and KeyRelease events only
        # time field: "valid for events that contain a time field"
        # width field: Configure, ConfigureRequest, Create, ResizeRequest,
        # and Expose events only
        # x field: "valid for events that contain an x field"
        # y field: "valid for events that contain a y field"
        # keysym as decimal: KeyPress and KeyRelease events only
        # x_root, y_root fields: ButtonPress, ButtonRelease, KeyPress,
        # KeyRelease, and Motion events
        e.serial = getint(nsign)
        e.num = getint_event(b)
        try: e.focus = getboolean(f)
        except TclError: pass
        e.height = getint_event(h)
        e.keycode = getint_event(k)
        e.state = getint_event(s)
        e.time = getint_event(t)
        e.width = getint_event(w)
        e.x = getint_event(x)
        e.y = getint_event(y)
        e.char = A
        try: e.send_event = getboolean(E)
        except TclError: pass
        e.keysym = K
        e.keysym_num = getint_event(N)
        try:
            e.type = EventType(T)
        except ValueError:
            e.type = T
        try:
            e.widget = self._nametowidget(W)
        except KeyError:
            e.widget = W
        e.x_root = getint_event(X)
        e.y_root = getint_event(Y)
        try:
            e.delta = getint(D)
        except (ValueError, TclError):
            e.delta = 0
        return (e,)

    def _report_exception(self):
        """Internal function."""
        exc, val, tb = sys.exc_info()
        root = self._root()
        root.report_callback_exception(exc, val, tb)

    def _getconfigure(self, *args):
        """Call Tcl configure command and return the result as a dict."""
        cnf = {}
        for x in self.tk.splitlist(self.tk.call(*args)):
            x = self.tk.splitlist(x)
            cnf[x[0][1:]] = (x[0][1:],) + x[1:]
        return cnf

    def _getconfigure1(self, *args):
        x = self.tk.splitlist(self.tk.call(*args))
        return (x[0][1:],) + x[1:]

    def _configure(self, cmd, cnf, kw):
        """Internal function."""
        if kw:
            cnf = _cnfmerge((cnf, kw))
        elif cnf:
            cnf = _cnfmerge(cnf)
        if cnf is None:
            return self._getconfigure(_flatten((self._w, cmd)))
        if isinstance(cnf, str):
            return self._getconfigure1(_flatten((self._w, cmd, '-'+cnf)))
        self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
    # These used to be defined in Widget:

    def configure(self, cnf=None, **kw):
        """Configure resources of a widget.

        The values for resources are specified as keyword
        arguments. To get an overview about
        the allowed keyword arguments call the method keys.
        """
        return self._configure('configure', cnf, kw)

    config = configure

    def cget(self, key):
        """Return the resource value for a KEY given as string."""
        return self.tk.call(self._w, 'cget', '-' + key)

    __getitem__ = cget

    def __setitem__(self, key, value):
        self.configure({key: value})

    def keys(self):
        """Return a list of all resource names of this widget."""
        splitlist = self.tk.splitlist
        return [splitlist(x)[0][1:] for x in
                splitlist(self.tk.call(self._w, 'configure'))]

    def __str__(self):
        """Return the window path name of this widget."""
        return self._w

    def __repr__(self):
        return '<%s.%s object %s>' % (
            self.__class__.__module__, self.__class__.__qualname__, self._w)

    # Pack methods that apply to the master
    _noarg_ = ['_noarg_']

    def pack_propagate(self, flag=_noarg_):
        """Set or get the status for propagation of geometry information.

        A boolean argument specifies whether the geometry information
        of the slaves will determine the size of this widget. If no argument
        is given the current setting will be returned.
        """
        if flag is Misc._noarg_:
            return self._getboolean(self.tk.call(
                'pack', 'propagate', self._w))
        else:
            self.tk.call('pack', 'propagate', self._w, flag)

    propagate = pack_propagate

    def pack_slaves(self):
        """Return a list of all slaves of this widget
        in its packing order."""
        return [self._nametowidget(x) for x in
                self.tk.splitlist(
                   self.tk.call('pack', 'slaves', self._w))]

    slaves = pack_slaves

    # Place method that applies to the master
    def place_slaves(self):
        """Return a list of all slaves of this widget
        in its packing order."""
        return [self._nametowidget(x) for x in
                self.tk.splitlist(
                   self.tk.call(
                       'place', 'slaves', self._w))]

    # Grid methods that apply to the master

    def grid_anchor(self, anchor=None): # new in Tk 8.5
        """The anchor value controls how to place the grid within the
        master when no row/column has any weight.

        The default anchor is nw."""
        self.tk.call('grid', 'anchor', self._w, anchor)

    anchor = grid_anchor

    def grid_bbox(self, column=None, row=None, col2=None, row2=None):
        """Return a tuple of integer coordinates for the bounding
        box of this widget controlled by the geometry manager grid.

        If COLUMN, ROW is given the bounding box applies from
        the cell with row and column 0 to the specified
        cell. If COL2 and ROW2 are given the bounding box
        starts at that cell.

        The returned integers specify the offset of the upper left
        corner in the master widget and the width and height.
        """
        args = ('grid', 'bbox', self._w)
        if column is not None and row is not None:
            args = args + (column, row)
        if col2 is not None and row2 is not None:
            args = args + (col2, row2)
        return self._getints(self.tk.call(*args)) or None

    bbox = grid_bbox

    def _gridconvvalue(self, value):
        if isinstance(value, (str, _tkinter.Tcl_Obj)):
            try:
                svalue = str(value)
                if not svalue:
                    return None
                elif '.' in svalue:
                    return self.tk.getdouble(svalue)
                else:
                    return self.tk.getint(svalue)
            except (ValueError, TclError):
                pass
        return value

    def _grid_configure(self, command, index, cnf, kw):
        """Internal function."""
        if isinstance(cnf, str) and not kw:
            if cnf[-1:] == '_':
                cnf = cnf[:-1]
            if cnf[:1] != '-':
                cnf = '-'+cnf
            options = (cnf,)
        else:
            options = self._options(cnf, kw)
        if not options:
            return _splitdict(
                self.tk,
                self.tk.call('grid', command, self._w, index),
                conv=self._gridconvvalue)
        res = self.tk.call(
                  ('grid', command, self._w, index)
                  + options)
        if len(options) == 1:
            return self._gridconvvalue(res)

    def grid_columnconfigure(self, index, cnf={}, **kw):
        """Configure column INDEX of a grid.

        Valid resources are minsize (minimum size of the column),
        weight (how much does additional space propagate to this column)
        and pad (how much space to let additionally)."""
        return self._grid_configure('columnconfigure', index, cnf, kw)

    columnconfigure = grid_columnconfigure

    def grid_location(self, x, y):
        """Return a tuple of column and row which identify the cell
        at which the pixel at position X and Y inside the master
        widget is located."""
        return self._getints(
            self.tk.call(
                'grid', 'location', self._w, x, y)) or None

    def grid_propagate(self, flag=_noarg_):
        """Set or get the status for propagation of geometry information.

        A boolean argument specifies whether the geometry information
        of the slaves will determine the size of this widget. If no argument
        is given, the current setting will be returned.
        """
        if flag is Misc._noarg_:
            return self._getboolean(self.tk.call(
                'grid', 'propagate', self._w))
        else:
            self.tk.call('grid', 'propagate', self._w, flag)

    def grid_rowconfigure(self, index, cnf={}, **kw):
        """Configure row INDEX of a grid.

        Valid resources are minsize (minimum size of the row),
        weight (how much does additional space propagate to this row)
        and pad (how much space to let additionally)."""
        return self._grid_configure('rowconfigure', index, cnf, kw)

    rowconfigure = grid_rowconfigure

    def grid_size(self):
        """Return a tuple of the number of column and rows in the grid."""
        return self._getints(
            self.tk.call('grid', 'size', self._w)) or None

    size = grid_size

    def grid_slaves(self, row=None, column=None):
        """Return a list of all slaves of this widget
        in its packing order."""
        args = ()
        if row is not None:
            args = args + ('-row', row)
        if column is not None:
            args = args + ('-column', column)
        return [self._nametowidget(x) for x in
                self.tk.splitlist(self.tk.call(
                   ('grid', 'slaves', self._w) + args))]

    # Support for the "event" command, new in Tk 4.2.
    # By Case Roole.

    def event_add(self, virtual, *sequences):
        """Bind a virtual event VIRTUAL (of the form <<Name>>)
        to an event SEQUENCE such that the virtual event is triggered
        whenever SEQUENCE occurs."""
        args = ('event', 'add', virtual) + sequences
        self.tk.call(args)

    def event_delete(self, virtual, *sequences):
        """Unbind a virtual event VIRTUAL from SEQUENCE."""
        args = ('event', 'delete', virtual) + sequences
        self.tk.call(args)

    def event_generate(self, sequence, **kw):
        """Generate an event SEQUENCE. Additional
        keyword arguments specify parameter of the event
        (e.g. x, y, rootx, rooty)."""
        args = ('event', 'generate', self._w, sequence)
        for k, v in kw.items():
            args = args + ('-%s' % k, str(v))
        self.tk.call(args)

    def event_info(self, virtual=None):
        """Return a list of all virtual events or the information
        about the SEQUENCE bound to the virtual event VIRTUAL."""
        return self.tk.splitlist(
            self.tk.call('event', 'info', virtual))

    # Image related commands

    def image_names(self):
        """Return a list of all existing image names."""
        return self.tk.splitlist(self.tk.call('image', 'names'))

    def image_types(self):
        """Return a list of all available image types (e.g. photo bitmap)."""
        return self.tk.splitlist(self.tk.call('image', 'types'))


class CallWrapper:
    """Internal class. Stores function to call when some user
    defined Tcl function is called e.g. after an event occurred."""

    def __init__(self, func, subst, widget):
        """Store FUNC, SUBST and WIDGET as members."""
        self.func = func
        self.subst = subst
        self.widget = widget

    def __call__(self, *args):
        """Apply first function SUBST to arguments, than FUNC."""
        try:
            if self.subst:
                args = self.subst(*args)
            return self.func(*args)
        except SystemExit:
            raise
        except:
            self.widget._report_exception()


class XView:
    """Mix-in class for querying and changing the horizontal position
    of a widget's window."""

    def xview(self, *args):
        """Query and change the horizontal position of the view."""
        res = self.tk.call(self._w, 'xview', *args)
        if not args:
            return self._getdoubles(res)

    def xview_moveto(self, fraction):
        """Adjusts the view in the window so that FRACTION of the
        total width of the canvas is off-screen to the left."""
        self.tk.call(self._w, 'xview', 'moveto', fraction)

    def xview_scroll(self, number, what):
        """Shift the x-view according to NUMBER which is measured in "units"
        or "pages" (WHAT)."""
        self.tk.call(self._w, 'xview', 'scroll', number, what)


class YView:
    """Mix-in class for querying and changing the vertical position
    of a widget's window."""

    def yview(self, *args):
        """Query and change the vertical position of the view."""
        res = self.tk.call(self._w, 'yview', *args)
        if not args:
            return self._getdoubles(res)

    def yview_moveto(self, fraction):
        """Adjusts the view in the window so that FRACTION of the
        total height of the canvas is off-screen to the top."""
        self.tk.call(self._w, 'yview', 'moveto', fraction)

    def yview_scroll(self, number, what):
        """Shift the y-view according to NUMBER which is measured in
        "units" or "pages" (WHAT)."""
        self.tk.call(self._w, 'yview', 'scroll', number, what)


class Wm:
    """Provides functions for the communication with the window manager."""

    def wm_aspect(self,
              minNumer=None, minDenom=None,
              maxNumer=None, maxDenom=None):
        """Instruct the window manager to set the aspect ratio (width/height)
        of this widget to be between MINNUMER/MINDENOM and MAXNUMER/MAXDENOM. Return a tuple
        of the actual values if no argument is given."""
        return self._getints(
            self.tk.call('wm', 'aspect', self._w,
                     minNumer, minDenom,
                     maxNumer, maxDenom))

    aspect = wm_aspect

    def wm_attributes(self, *args):
        """This subcommand returns or sets platform specific attributes

        The first form returns a list of the platform specific flags and
        their values. The second form returns the value for the specific
        option. The third form sets one or more of the values. The values
        are as follows:

        On Windows, -disabled gets or sets whether the window is in a
        disabled state. -toolwindow gets or sets the style of the window
        to toolwindow (as defined in the MSDN). -topmost gets or sets
        whether this is a topmost window (displays above all other
        windows).

        On Macintosh, XXXXX

        On Unix, there are currently no special attribute values.
        """
        args = ('wm', 'attributes', self._w) + args
        return self.tk.call(args)

    attributes = wm_attributes

    def wm_client(self, name=None):
        """Store NAME in WM_CLIENT_MACHINE property of this widget. Return
        current value."""
        return self.tk.call('wm', 'client', self._w, name)

    client = wm_client

    def wm_colormapwindows(self, *wlist):
        """Store list of window names (WLIST) into WM_COLORMAPWINDOWS property
        of this widget. This list contains windows whose colormaps differ from their
        parents. Return current list of widgets if WLIST is empty."""
        if len(wlist) > 1:
            wlist = (wlist,) # Tk needs a list of windows here
        args = ('wm', 'colormapwindows', self._w) + wlist
        if wlist:
            self.tk.call(args)
        else:
            return [self._nametowidget(x)
                    for x in self.tk.splitlist(self.tk.call(args))]

    colormapwindows = wm_colormapwindows

    def wm_command(self, value=None):
        """Store VALUE in WM_COMMAND property. It is the command
        which shall be used to invoke the application. Return current
        command if VALUE is None."""
        return self.tk.call('wm', 'command', self._w, value)

    command = wm_command

    def wm_deiconify(self):
        """Deiconify this widget. If it was never mapped it will not be mapped.
        On Windows it will raise this widget and give it the focus."""
        return self.tk.call('wm', 'deiconify', self._w)

    deiconify = wm_deiconify

    def wm_focusmodel(self, model=None):
        """Set focus model to MODEL. "active" means that this widget will claim
        the focus itself, "passive" means that the window manager shall give
        the focus. Return current focus model if MODEL is None."""
        return self.tk.call('wm', 'focusmodel', self._w, model)

    focusmodel = wm_focusmodel

    def wm_forget(self, window): # new in Tk 8.5
        """The window will be unmapped from the screen and will no longer
        be managed by wm. toplevel windows will be treated like frame
        windows once they are no longer managed by wm, however, the menu
        option configuration will be remembered and the menus will return
        once the widget is managed again."""
        self.tk.call('wm', 'forget', window)

    forget = wm_forget

    def wm_frame(self):
        """Return identifier for decorative frame of this widget if present."""
        return self.tk.call('wm', 'frame', self._w)

    frame = wm_frame

    def wm_geometry(self, newGeometry=None):
        """Set geometry to NEWGEOMETRY of the form =widthxheight+x+y. Return
        current value if None is given."""
        return self.tk.call('wm', 'geometry', self._w, newGeometry)

    geometry = wm_geometry

    def wm_grid(self,
         baseWidth=None, baseHeight=None,
         widthInc=None, heightInc=None):
        """Instruct the window manager that this widget shall only be
        resized on grid boundaries. WIDTHINC and HEIGHTINC are the width and
        height of a grid unit in pixels. BASEWIDTH and BASEHEIGHT are the
        number of grid units requested in Tk_GeometryRequest."""
        return self._getints(self.tk.call(
            'wm', 'grid', self._w,
            baseWidth, baseHeight, widthInc, heightInc))

    grid = wm_grid

    def wm_group(self, pathName=None):
        """Set the group leader widgets for related widgets to PATHNAME. Return
        the group leader of this widget if None is given."""
        return self.tk.call('wm', 'group', self._w, pathName)

    group = wm_group

    def wm_iconbitmap(self, bitmap=None, default=None):
        """Set bitmap for the iconified widget to BITMAP. Return
        the bitmap if None is given.

        Under Windows, the DEFAULT parameter can be used to set the icon
        for the widget and any descendents that don't have an icon set
        explicitly.  DEFAULT can be the relative path to a .ico file
        (example: root.iconbitmap(default='myicon.ico') ).  See Tk
        documentation for more information."""
        if default:
            return self.tk.call('wm', 'iconbitmap', self._w, '-default', default)
        else:
            return self.tk.call('wm', 'iconbitmap', self._w, bitmap)

    iconbitmap = wm_iconbitmap

    def wm_iconify(self):
        """Display widget as icon."""
        return self.tk.call('wm', 'iconify', self._w)

    iconify = wm_iconify

    def wm_iconmask(self, bitmap=None):
        """Set mask for the icon bitmap of this widget. Return the
        mask if None is given."""
        return self.tk.call('wm', 'iconmask', self._w, bitmap)

    iconmask = wm_iconmask

    def wm_iconname(self, newName=None):
        """Set the name of the icon for this widget. Return the name if
        None is given."""
        return self.tk.call('wm', 'iconname', self._w, newName)

    iconname = wm_iconname

    def wm_iconphoto(self, default=False, *args): # new in Tk 8.5
        """Sets the titlebar icon for this window based on the named photo
        images passed through args. If default is True, this is applied to
        all future created toplevels as well.

        The data in the images is taken as a snapshot at the time of
        invocation. If the images are later changed, this is not reflected
        to the titlebar icons. Multiple images are accepted to allow
        different images sizes to be provided. The window manager may scale
        provided icons to an appropriate size.

        On Windows, the images are packed into a Windows icon structure.
        This will override an icon specified to wm_iconbitmap, and vice
        versa.

        On X, the images are arranged into the _NET_WM_ICON X property,
        which most modern window managers support. An icon specified by
        wm_iconbitmap may exist simultaneously.

        On Macintosh, this currently does nothing."""
        if default:
            self.tk.call('wm', 'iconphoto', self._w, "-default", *args)
        else:
            self.tk.call('wm', 'iconphoto', self._w, *args)

    iconphoto = wm_iconphoto

    def wm_iconposition(self, x=None, y=None):
        """Set the position of the icon of this widget to X and Y. Return
        a tuple of the current values of X and X if None is given."""
        return self._getints(self.tk.call(
            'wm', 'iconposition', self._w, x, y))

    iconposition = wm_iconposition

    def wm_iconwindow(self, pathName=None):
        """Set widget PATHNAME to be displayed instead of icon. Return the current
        value if None is given."""
        return self.tk.call('wm', 'iconwindow', self._w, pathName)

    iconwindow = wm_iconwindow

    def wm_manage(self, widget): # new in Tk 8.5
        """The widget specified will become a stand alone top-level window.
        The window will be decorated with the window managers title bar,
        etc."""
        self.tk.call('wm', 'manage', widget)

    manage = wm_manage

    def wm_maxsize(self, width=None, height=None):
        """Set max WIDTH and HEIGHT for this widget. If the window is gridded
        the values are given in grid units. Return the current values if None
        is given."""
        return self._getints(self.tk.call(
            'wm', 'maxsize', self._w, width, height))

    maxsize = wm_maxsize

    def wm_minsize(self, width=None, height=None):
        """Set min WIDTH and HEIGHT for this widget. If the window is gridded
        the values are given in grid units. Return the current values if None
        is given."""
        return self._getints(self.tk.call(
            'wm', 'minsize', self._w, width, height))

    minsize = wm_minsize

    def wm_overrideredirect(self, boolean=None):
        """Instruct the window manager to ignore this widget
        if BOOLEAN is given with 1. Return the current value if None
        is given."""
        return self._getboolean(self.tk.call(
            'wm', 'overrideredirect', self._w, boolean))

    overrideredirect = wm_overrideredirect

    def wm_positionfrom(self, who=None):
        """Instruct the window manager that the position of this widget shall
        be defined by the user if WHO is "user", and by its own policy if WHO is
        "program"."""
        return self.tk.call('wm', 'positionfrom', self._w, who)

    positionfrom = wm_positionfrom

    def wm_protocol(self, name=None, func=None):
        """Bind function FUNC to command NAME for this widget.
        Return the function bound to NAME if None is given. NAME could be
        e.g. "WM_SAVE_YOURSELF" or "WM_DELETE_WINDOW"."""
        if callable(func):
            command = self._register(func)
        else:
            command = func
        return self.tk.call(
            'wm', 'protocol', self._w, name, command)

    protocol = wm_protocol

    def wm_resizable(self, width=None, height=None):
        """Instruct the window manager whether this width can be resized
        in WIDTH or HEIGHT. Both values are boolean values."""
        return self.tk.call('wm', 'resizable', self._w, width, height)

    resizable = wm_resizable

    def wm_sizefrom(self, who=None):
        """Instruct the window manager that the size of this widget shall
        be defined by the user if WHO is "user", and by its own policy if WHO is
        "program"."""
        return self.tk.call('wm', 'sizefrom', self._w, who)

    sizefrom = wm_sizefrom

    def wm_state(self, newstate=None):
        """Query or set the state of this widget as one of normal, icon,
        iconic (see wm_iconwindow), withdrawn, or zoomed (Windows only)."""
        return self.tk.call('wm', 'state', self._w, newstate)

    state = wm_state

    def wm_title(self, string=None):
        """Set the title of this widget."""
        return self.tk.call('wm', 'title', self._w, string)

    title = wm_title

    def wm_transient(self, master=None):
        """Instruct the window manager that this widget is transient
        with regard to widget MASTER."""
        return self.tk.call('wm', 'transient', self._w, master)

    transient = wm_transient

    def wm_withdraw(self):
        """Withdraw this widget from the screen such that it is unmapped
        and forgotten by the window manager. Re-draw it with wm_deiconify."""
        return self.tk.call('wm', 'withdraw', self._w)

    withdraw = wm_withdraw


class Tk(Misc, Wm):
    """Toplevel widget of Tk which represents mostly the main window
    of an application. It has an associated Tcl interpreter."""
    _w = '.'

    def __init__(self, screenName=None, baseName=None, className='Tk',
                 useTk=1, sync=0, use=None):
        """Return a new Toplevel widget on screen SCREENNAME. A new Tcl interpreter will
        be created. BASENAME will be used for the identification of the profile file (see
        readprofile).
        It is constructed from sys.argv[0] without extensions if None is given. CLASSNAME
        is the name of the widget class."""
        self.master = None
        self.children = {}
        self._tkloaded = False
        # to avoid recursions in the getattr code in case of failure, we
        # ensure that self.tk is always _something_.
        self.tk = None
        if baseName is None:
            import os
            baseName = os.path.basename(sys.argv[0])
            baseName, ext = os.path.splitext(baseName)
            if ext not in ('.py', '.pyc'):
                baseName = baseName + ext
        interactive = 0
        self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
        if useTk:
            self._loadtk()
        if not sys.flags.ignore_environment:
            # Issue #16248: Honor the -E flag to avoid code injection.
            self.readprofile(baseName, className)

    def loadtk(self):
        if not self._tkloaded:
            self.tk.loadtk()
            self._loadtk()

    def _loadtk(self):
        self._tkloaded = True
        global _default_root
        # Version sanity checks
        tk_version = self.tk.getvar('tk_version')
        if tk_version != _tkinter.TK_VERSION:
            raise RuntimeError("tk.h version (%s) doesn't match libtk.a version (%s)"
                               % (_tkinter.TK_VERSION, tk_version))
        # Under unknown circumstances, tcl_version gets coerced to float
        tcl_version = str(self.tk.getvar('tcl_version'))
        if tcl_version != _tkinter.TCL_VERSION:
            raise RuntimeError("tcl.h version (%s) doesn't match libtcl.a version (%s)" \
                               % (_tkinter.TCL_VERSION, tcl_version))
        # Create and register the tkerror and exit commands
        # We need to inline parts of _register here, _ register
        # would register differently-named commands.
        if self._tclCommands is None:
            self._tclCommands = []
        self.tk.createcommand('tkerror', _tkerror)
        self.tk.createcommand('exit', _exit)
        self._tclCommands.append('tkerror')
        self._tclCommands.append('exit')
        if _support_default_root and not _default_root:
            _default_root = self
        self.protocol("WM_DELETE_WINDOW", self.destroy)

    def destroy(self):
        """Destroy this and all descendants widgets. This will
        end the application of this Tcl interpreter."""
        for c in list(self.children.values()): c.destroy()
        self.tk.call('destroy', self._w)
        Misc.destroy(self)
        global _default_root
        if _support_default_root and _default_root is self:
            _default_root = None

    def readprofile(self, baseName, className):
        """Internal function. It reads BASENAME.tcl and CLASSNAME.tcl into
        the Tcl Interpreter and calls exec on the contents of BASENAME.py and
        CLASSNAME.py if such a file exists in the home directory."""
        import os
        if 'HOME' in os.environ: home = os.environ['HOME']
        else: home = os.curdir
        class_tcl = os.path.join(home, '.%s.tcl' % className)
        class_py = os.path.join(home, '.%s.py' % className)
        base_tcl = os.path.join(home, '.%s.tcl' % baseName)
        base_py = os.path.join(home, '.%s.py' % baseName)
        dir = {'self': self}
        exec('from tkinter import *', dir)
        if os.path.isfile(class_tcl):
            self.tk.call('source', class_tcl)
        if os.path.isfile(class_py):
            exec(open(class_py).read(), dir)
        if os.path.isfile(base_tcl):
            self.tk.call('source', base_tcl)
        if os.path.isfile(base_py):
            exec(open(base_py).read(), dir)

    def report_callback_exception(self, exc, val, tb):
        """Report callback exception on sys.stderr.

        Applications may want to override this internal function, and
        should when sys.stderr is None."""
        import traceback
        print("Exception in Tkinter callback", file=sys.stderr)
        sys.last_type = exc
        sys.last_value = val
        sys.last_traceback = tb
        traceback.print_exception(exc, val, tb)

    def __getattr__(self, attr):
        "Delegate attribute access to the interpreter object"
        return getattr(self.tk, attr)

# Ideally, the classes Pack, Place and Grid disappear, the
# pack/place/grid methods are defined on the Widget class, and
# everybody uses w.pack_whatever(...) instead of Pack.whatever(w,
# ...), with pack(), place() and grid() being short for
# pack_configure(), place_configure() and grid_columnconfigure(), and
# forget() being short for pack_forget().  As a practical matter, I'm
# afraid that there is too much code out there that may be using the
# Pack, Place or Grid class, so I leave them intact -- but only as
# backwards compatibility features.  Also note that those methods that
# take a master as argument (e.g. pack_propagate) have been moved to
# the Misc class (which now incorporates all methods common between
# toplevel and interior widgets).  Again, for compatibility, these are
# copied into the Pack, Place or Grid class.


def Tcl(screenName=None, baseName=None, className='Tk', useTk=0):
    return Tk(screenName, baseName, className, useTk)


class Pack:
    """Geometry manager Pack.

    Base class to use the methods pack_* in every widget."""

    def pack_configure(self, cnf={}, **kw):
        """Pack a widget in the parent widget. Use as options:
        after=widget - pack it after you have packed widget
        anchor=NSEW (or subset) - position widget according to
                                  given direction
        before=widget - pack it before you will pack widget
        expand=bool - expand widget if parent size grows
        fill=NONE or X or Y or BOTH - fill widget if widget grows
        in=master - use master to contain this widget
        in_=master - see 'in' option description
        ipadx=amount - add internal padding in x direction
        ipady=amount - add internal padding in y direction
        padx=amount - add padding in x direction
        pady=amount - add padding in y direction
        side=TOP or BOTTOM or LEFT or RIGHT -  where to add this widget.
        """
        self.tk.call(
              ('pack', 'configure', self._w)
              + self._options(cnf, kw))

    pack = configure = config = pack_configure

    def pack_forget(self):
        """Unmap this widget and do not use it for the packing order."""
        self.tk.call('pack', 'forget', self._w)

    forget = pack_forget

    def pack_info(self):
        """Return information about the packing options
        for this widget."""
        d = _splitdict(self.tk, self.tk.call('pack', 'info', self._w))
        if 'in' in d:
            d['in'] = self.nametowidget(d['in'])
        return d

    info = pack_info
    propagate = pack_propagate = Misc.pack_propagate
    slaves = pack_slaves = Misc.pack_slaves


class Place:
    """Geometry manager Place.

    Base class to use the methods place_* in every widget."""

    def place_configure(self, cnf={}, **kw):
        """Place a widget in the parent widget. Use as options:
        in=master - master relative to which the widget is placed
        in_=master - see 'in' option description
        x=amount - locate anchor of this widget at position x of master
        y=amount - locate anchor of this widget at position y of master
        relx=amount - locate anchor of this widget between 0.0 and 1.0
                      relative to width of master (1.0 is right edge)
        rely=amount - locate anchor of this widget between 0.0 and 1.0
                      relative to height of master (1.0 is bottom edge)
        anchor=NSEW (or subset) - position anchor according to given direction
        width=amount - width of this widget in pixel
        height=amount - height of this widget in pixel
        relwidth=amount - width of this widget between 0.0 and 1.0
                          relative to width of master (1.0 is the same width
                          as the master)
        relheight=amount - height of this widget between 0.0 and 1.0
                           relative to height of master (1.0 is the same
                           height as the master)
        bordermode="inside" or "outside" - whether to take border width of
                                           master widget into account
        """
        self.tk.call(
              ('place', 'configure', self._w)
              + self._options(cnf, kw))

    place = configure = config = place_configure

    def place_forget(self):
        """Unmap this widget."""
        self.tk.call('place', 'forget', self._w)

    forget = place_forget

    def place_info(self):
        """Return information about the placing options
        for this widget."""
        d = _splitdict(self.tk, self.tk.call('place', 'info', self._w))
        if 'in' in d:
            d['in'] = self.nametowidget(d['in'])
        return d

    info = place_info
    slaves = place_slaves = Misc.place_slaves


class Grid:
    """Geometry manager Grid.

    Base class to use the methods grid_* in every widget."""
    # Thanks to Masazumi Yoshikawa (yosikawa@isi.edu)

    def grid_configure(self, cnf={}, **kw):
        """Position a widget in the parent widget in a grid. Use as options:
        column=number - use cell identified with given column (starting with 0)
        columnspan=number - this widget will span several columns
        in=master - use master to contain this widget
        in_=master - see 'in' option description
        ipadx=amount - add internal padding in x direction
        ipady=amount - add internal padding in y direction
        padx=amount - add padding in x direction
        pady=amount - add padding in y direction
        row=number - use cell identified with given row (starting with 0)
        rowspan=number - this widget will span several rows
        sticky=NSEW - if cell is larger on which sides will this
                      widget stick to the cell boundary
        """
        self.tk.call(
              ('grid', 'configure', self._w)
              + self._options(cnf, kw))

    grid = configure = config = grid_configure
    bbox = grid_bbox = Misc.grid_bbox
    columnconfigure = grid_columnconfigure = Misc.grid_columnconfigure

    def grid_forget(self):
        """Unmap this widget."""
        self.tk.call('grid', 'forget', self._w)

    forget = grid_forget

    def grid_remove(self):
        """Unmap this widget but remember the grid options."""
        self.tk.call('grid', 'remove', self._w)

    def grid_info(self):
        """Return information about the options
        for positioning this widget in a grid."""
        d = _splitdict(self.tk, self.tk.call('grid', 'info', self._w))
        if 'in' in d:
            d['in'] = self.nametowidget(d['in'])
        return d

    info = grid_info
    location = grid_location = Misc.grid_location
    propagate = grid_propagate = Misc.grid_propagate
    rowconfigure = grid_rowconfigure = Misc.grid_rowconfigure
    size = grid_size = Misc.grid_size
    slaves = grid_slaves = Misc.grid_slaves


class BaseWidget(Misc):
    """Internal class."""

    def _setup(self, master, cnf):
        """Internal function. Sets up information about children."""
        if not master:
            master = _get_default_root()
        self.master = master
        self.tk = master.tk
        name = None
        if 'name' in cnf:
            name = cnf['name']
            del cnf['name']
        if not name:
            name = self.__class__.__name__.lower()
            if master._last_child_ids is None:
                master._last_child_ids = {}
            count = master._last_child_ids.get(name, 0) + 1
            master._last_child_ids[name] = count
            if count == 1:
                name = '!%s' % (name,)
            else:
                name = '!%s%d' % (name, count)
        self._name = name
        if master._w=='.':
            self._w = '.' + name
        else:
            self._w = master._w + '.' + name
        self.children = {}
        if self._name in self.master.children:
            self.master.children[self._name].destroy()
        self.master.children[self._name] = self

    def __init__(self, master, widgetName, cnf={}, kw={}, extra=()):
        """Construct a widget with the parent widget MASTER, a name WIDGETNAME
        and appropriate options."""
        if kw:
            cnf = _cnfmerge((cnf, kw))
        self.widgetName = widgetName
        BaseWidget._setup(self, master, cnf)
        if self._tclCommands is None:
            self._tclCommands = []
        classes = [(k, v) for k, v in cnf.items() if isinstance(k, type)]
        for k, v in classes:
            del cnf[k]
        self.tk.call(
            (widgetName, self._w) + extra + self._options(cnf))
        for k, v in classes:
            k.configure(self, v)

    def destroy(self):
        """Destroy this and all descendants widgets."""
        for c in list(self.children.values()): c.destroy()
        self.tk.call('destroy', self._w)
        if self._name in self.master.children:
            del self.master.children[self._name]
        Misc.destroy(self)

    def _do(self, name, args=()):
        # XXX Obsolete -- better use self.tk.call directly!
        return self.tk.call((self._w, name) + args)


class Widget(BaseWidget, Pack, Place, Grid):
    """Internal class.

    Base class for a widget which can be positioned with the geometry managers
    Pack, Place or Grid."""
    pass


class Toplevel(BaseWidget, Wm):
    """Toplevel widget, e.g. for dialogs."""

    def __init__(self, master=None, cnf={}, **kw):
        """Construct a toplevel widget with the parent MASTER.

        Valid resource names: background, bd, bg, borderwidth, class,
        colormap, container, cursor, height, highlightbackground,
        highlightcolor, highlightthickness, menu, relief, screen, takefocus,
        use, visual, width."""
        if kw:
            cnf = _cnfmerge((cnf, kw))
        extra = ()
        for wmkey in ['screen', 'class_', 'class', 'visual',
                  'colormap']:
            if wmkey in cnf:
                val = cnf[wmkey]
                # TBD: a hack needed because some keys
                # are not valid as keyword arguments
                if wmkey[-1] == '_': opt = '-'+wmkey[:-1]
                else: opt = '-'+wmkey
                extra = extra + (opt, val)
                del cnf[wmkey]
        BaseWidget.__init__(self, master, 'toplevel', cnf, {}, extra)
        root = self._root()
        self.iconname(root.iconname())
        self.title(root.title())
        self.protocol("WM_DELETE_WINDOW", self.destroy)


class Button(Widget):
    """Button widget."""

    def __init__(self, master=None, cnf={}, **kw):
        """Construct a button widget with the parent MASTER.

        STANDARD OPTIONS

            activebackground, activeforeground, anchor,
            background, bitmap, borderwidth, cursor,
            disabledforeground, font, foreground
            highlightbackground, highlightcolor,
            highlightthickness, image, justify,
            padx, pady, relief, repeatdelay,
            repeatinterval, takefocus, text,
            textvariable, underline, wraplength

        WIDGET-SPECIFIC OPTIONS

            command, compound, default, height,
            overrelief, state, width
        """
        Widget.__init__(self, master, 'button', cnf, kw)

    def flash(self):
        """Flash the button.

        This is accomplished by redisplaying
        the button several times, alternating between active and
        normal colors. At the end of the flash the button is left
        in the same normal/active state as when the command was
        invoked. This command is ignored if the button's state is
        disabled.
        """
        self.tk.call(self._w, 'flash')

    def invoke(self):
        """Invoke the command associated with the button.

        The return value is the return value from the command,
        or an empty string if there is no command associated with
        the button. This command is ignored if the button's state
        is disabled.
        """
        return self.tk.call(self._w, 'invoke')


class Canvas(Widget, XView, YView):
    """Canvas widget to display graphical elements like lines or text."""

    def __init__(self, master=None, cnf={}, **kw):
        """Construct a canvas widget with the parent MASTER.

        Valid resource names: background, bd, bg, borderwidth, closeenough,
        confine, cursor, height, highlightbackground, highlightcolor,
        highlightthickness, insertbackground, insertborderwidth,
        insertofftime, insertontime, insertwidth, offset, relief,
        scrollregion, selectbackground, selectborderwidth, selectforeground,
        state, takefocus, width, xscrollcommand, xscrollincrement,
        yscrollcommand, yscrollincrement."""
        Widget.__init__(self, master, 'canvas', cnf, kw)

    def addtag(self, *args):
        """Internal function."""
        self.tk.call((self._w, 'addtag') + args)

    def addtag_above(self, newtag, tagOrId):
        """Add tag NEWTAG to all items above TAGORID."""
        self.addtag(newtag, 'above', tagOrId)

    def addtag_all(self, newtag):
        """Add tag NEWTAG to all items."""
        self.addtag(newtag, 'all')

    def addtag_below(self, newtag, tagOrId):
        """Add tag NEWTAG to all items below TAGORID."""
        self.addtag(newtag, 'below', tagOrId)

    def addtag_closest(self, newtag, x, y, halo=None, start=None):
        """Add tag NEWTAG to item which is closest to pixel at X, Y.
        If several match take the top-most.
        All items closer than HALO are considered overlapping (all are
        closests). If START is specified the next below this tag is taken."""
        self.addtag(newtag, 'closest', x, y, halo, start)

    def addtag_enclosed(self, newtag, x1, y1, x2, y2):
        """Add tag NEWTAG to all items in the rectangle defined
        by X1,Y1,X2,Y2."""
        self.addtag(newtag, 'enclosed', x1, y1, x2, y2)

    def addtag_overlapping(self, newtag, x1, y1, x2, y2):
        """Add tag NEWTAG to all items which overlap the rectangle
        defined by X1,Y1,X2,Y2."""
        self.addtag(newtag, 'overlapping', x1, y1, x2, y2)

    def addtag_withtag(self, newtag, tagOrId):
        """Add tag NEWTAG to all items with TAGORID."""
        self.addtag(newtag, 'withtag', tagOrId)

    def bbox(self, *args):
        """Return a tuple of X1,Y1,X2,Y2 coordinates for a rectangle
        which encloses all items with tags specified as arguments."""
        return self._getints(
            self.tk.call((self._w, 'bbox') + args)) or None

    def tag_unbind(self, tagOrId, sequence, funcid=None):
        """Unbind for all items with TAGORID for event SEQUENCE  the
        function identified with FUNCID."""
        self.tk.call(self._w, 'bind', tagOrId, sequence, '')
        if funcid:
            self.deletecommand(funcid)

    def tag_bind(self, tagOrId, sequence=None, func=None, add=None):
        """Bind to all items with TAGORID at event SEQUENCE a call to function FUNC.

        An additional boolean parameter ADD specifies whether FUNC will be
        called additionally to the other bound function or whether it will
        replace the previous function. See bind for the return value."""
        return self._bind((self._w, 'bind', tagOrId),
                  sequence, func, add)

    def canvasx(self, screenx, gridspacing=None):
        """Return the canvas x coordinate of pixel position SCREENX rounded
        to nearest multiple of GRIDSPACING units."""
        return self.tk.getdouble(self.tk.call(
            self._w, 'canvasx', screenx, gridspacing))

    def canvasy(self, screeny, gridspacing=None):
        """Return the canvas y coordinate of pixel position SCREENY rounded
        to nearest multiple of GRIDSPACING units."""
        return self.tk.getdouble(self.tk.call(
            self._w, 'canvasy', screeny, gridspacing))

    def coords(self, *args):
        """Return a list of coordinates for the item given in ARGS."""
        # XXX Should use _flatten on args
        return [self.tk.getdouble(x) for x in
                           self.tk.splitlist(
                   self.tk.call((self._w, 'coords') + args))]

    def _create(self, itemType, args, kw): # Args: (val, val, ..., cnf={})
        """Internal function."""
        args = _flatten(args)
        cnf = args[-1]
        if isinstance(cnf, (dict, tuple)):
            args = args[:-1]
        else:
            cnf = {}
        return self.tk.getint(self.tk.call(
            self._w, 'create', itemType,
            *(args + self._options(cnf, kw))))

    def create_arc(self, *args, **kw):
        """Create arc shaped region with coordinates x1,y1,x2,y2."""
        return self._create('arc', args, kw)

    def create_bitmap(self, *args, **kw):
        """Create bitmap with coordinates x1,y1."""
        return self._create('bitmap', args, kw)

    def create_image(self, *args, **kw):
        """Create image item with coordinates x1,y1."""
        return self._create('image', args, kw)

    def create_line(self, *args, **kw):
        """Create line with coordinates x1,y1,...,xn,yn."""
        return self._create('line', args, kw)

    def create_oval(self, *args, **kw):
        """Create oval with coordinates x1,y1,x2,y2."""
        return self._create('oval', args, kw)

    def create_polygon(self, *args, **kw):
        """Create polygon with coordinates x1,y1,...,xn,yn."""
        return self._create('polygon', args, kw)

    def create_rectangle(self, *args, **kw):
        """Create rectangle with coordinates x1,y1,x2,y2."""
        return self._create('rectangle', args, kw)

    def create_text(self, *args, **kw):
        """Create text with coordinates x1,y1."""
        return self._create('text', args, kw)

    def create_window(self, *args, **kw):
        """Create window with coordinates x1,y1,x2,y2."""
        return self._create('window', args, kw)

    def dchars(self, *args):
        """Delete characters of text items identified by tag or id in ARGS (possibly
        several times) from FIRST to LAST character (including)."""
        self.tk.call((self._w, 'dchars') + args)

    def delete(self, *args):
        """Delete items identified by all tag or ids contained in ARGS."""
        self.tk.call((self._w, 'delete') + args)

    def dtag(self, *args):
        """Delete tag or id given as last arguments in ARGS from items
        identified by first argument in ARGS."""
        self.tk.call((self._w, 'dtag') + args)

    def find(self, *args):
        """Internal function."""
        return self._getints(
            self.tk.call((self._w, 'find') + args)) or ()

    def find_above(self, tagOrId):
        """Return items above TAGORID."""
        return self.find('above', tagOrId)

    def find_all(self):
        """Return all items."""
        return self.find('all')

    def find_below(self, tagOrId):
        """Return all items below TAGORID."""
        return self.find('below', tagOrId)

    def find_closest(self, x, y, halo=None, start=None):
        """Return item which is closest to pixel at X, Y.
        If several match take the top-most.
        All items closer than HALO are considered overlapping (all are
        closest). If START is specified the next below this tag is taken."""
        return self.find('closest', x, y, halo, start)

    def find_enclosed(self, x1, y1, x2, y2):
        """Return all items in rectangle defined
        by X1,Y1,X2,Y2."""
        return self.find('enclosed', x1, y1, x2, y2)

    def find_overlapping(self, x1, y1, x2, y2):
        """Return all items which overlap the rectangle
        defined by X1,Y1,X2,Y2."""
        return self.find('overlapping', x1, y1, x2, y2)

    def find_withtag(self, tagOrId):
        """Return all items with TAGORID."""
        return self.find('withtag', tagOrId)

    def focus(self, *args):
        """Set focus to the first item specified in ARGS."""
        return self.tk.call((self._w, 'focus') + args)

    def gettags(self, *args):
        """Return tags associated with the first item specified in ARGS."""
        return self.tk.splitlist(
            self.tk.call((self._w, 'gettags') + args))

    def icursor(self, *args):
        """Set cursor at position POS in the item identified by TAGORID.
        In ARGS TAGORID must be first."""
        self.tk.call((self._w, 'icursor') + args)

    def index(self, *args):
        """Return position of cursor as integer in item specified in ARGS."""
        return self.tk.getint(self.tk.call((self._w, 'index') + args))

    def insert(self, *args):
        """Insert TEXT in item TAGORID at position POS. ARGS must
        be TAGORID POS TEXT."""
        self.tk.call((self._w, 'insert') + args)

    def itemcget(self, tagOrId, option):
        """Return the resource value for an OPTION for item TAGORID."""
        return self.tk.call(
            (self._w, 'itemcget') + (tagOrId, '-'+option))

    def itemconfigure(self, tagOrId, cnf=None, **kw):
        """Configure resources of an item TAGORID.

        The values for resources are specified as keyword
        arguments. To get an overview about
        the allowed keyword arguments call the method without arguments.
        """
        return self._configure(('itemconfigure', tagOrId), cnf, kw)

    itemconfig = itemconfigure

    # lower, tkraise/lift hide Misc.lower, Misc.tkraise/lift,
    # so the preferred name for them is tag_lower, tag_raise
    # (similar to tag_bind, and similar to the Text widget);
    # unfortunately can't delete the old ones yet (maybe in 1.6)
    def tag_lower(self, *args):
        """Lower an item TAGORID given in ARGS
        (optional below another item)."""
        self.tk.call((self._w, 'lower') + args)

    lower = tag_lower

    def move(self, *args):
        """Move an item TAGORID given in ARGS."""
        self.tk.call((self._w, 'move') + args)

    def moveto(self, tagOrId, x='', y=''):
        """Move the items given by TAGORID in the canvas coordinate
        space so that the first coordinate pair of the bottommost
        item with tag TAGORID is located at position (X,Y).
        X and Y may be the empty string, in which case the
        corresponding coordinate will be unchanged. All items matching
        TAGORID remain in the same positions relative to each other."""
        self.tk.call(self._w, 'moveto', tagOrId, x, y)

    def postscript(self, cnf={}, **kw):
        """Print the contents of the canvas to a postscript
        file. Valid options: colormap, colormode, file, fontmap,
        height, pageanchor, pageheight, pagewidth, pagex, pagey,
        rotate, width, x, y."""
        return self.tk.call((self._w, 'postscript') +
                    self._options(cnf, kw))

    def tag_raise(self, *args):
        """Raise an item TAGORID given in ARGS
        (optional above another item)."""
        self.tk.call((self._w, 'raise') + args)

    lift = tkraise = tag_raise

    def scale(self, *args):
        """Scale item TAGORID with XORIGIN, YORIGIN, XSCALE, YSCALE."""
        self.tk.call((self._w, 'scale') + args)

    def scan_mark(self, x, y):
        """Remember the current X, Y coordinates."""
        self.tk.call(self._w, 'scan', 'mark', x, y)

    def scan_dragto(self, x, y, gain=10):
        """Adjust the view of the canvas to GAIN times the
        difference between X and Y and the coordinates given in
        scan_mark."""
        self.tk.call(self._w, 'scan', 'dragto', x, y, gain)

    def select_adjust(self, tagOrId, index):
        """Adjust the end of the selection near the cursor of an item TAGORID to index."""
        self.tk.call(self._w, 'select', 'adjust', tagOrId, index)

    def select_clear(self):
        """Clear the selection if it is in this widget."""
        self.tk.call(self._w, 'select', 'clear')

    def select_from(self, tagOrId, index):
        """Set the fixed end of a selection in item TAGORID to INDEX."""
        self.tk.call(self._w, 'select', 'from', tagOrId, index)

    def select_item(self):
        """Return the item which has the selection."""
        return self.tk.call(self._w, 'select', 'item') or None

    def select_to(self, tagOrId, index):
        """Set the variable end of a selection in item TAGORID to INDEX."""
        self.tk.call(self._w, 'select', 'to', tagOrId, index)

    def type(self, tagOrId):
        """Return the type of the item TAGORID."""
        return self.tk.call(self._w, 'type', tagOrId) or None


class Checkbutton(Widget):
    """Checkbutton widget which is either in on- or off-state."""

    def __init__(self, master=None, cnf={}, **kw):
        """Construct a checkbutton widget with the parent MASTER.

        Valid resource names: activebackground, activeforeground, anchor,
        background, bd, bg, bitmap, borderwidth, command, cursor,
        disabledforeground, fg, font, foreground, height,
        highlightbackground, highlightcolor, highlightthickness, image,
        indicatoron, justify, offvalue, onvalue, padx, pady, relief,
        selectcolor, selectimage, state, takefocus, text, textvariable,
        underline, variable, width, wraplength."""
        Widget.__init__(self, master, 'checkbutton', cnf, kw)

    def deselect(self):
        """Put the button in off-state."""
        self.tk.call(self._w, 'deselect')

    def flash(self):
        """Flash the button."""
        self.tk.call(self._w, 'flash')

    def invoke(self):
        """Toggle the button and invoke a command if given as resource."""
        return self.tk.call(self._w, 'invoke')

    def select(self):
        """Put the button in on-state."""
        self.tk.call(self._w, 'select')

    def toggle(self):
        """Toggle the button."""
        self.tk.call(self._w, 'toggle')


class Entry(Widget, XView):
    """Entry widget which allows displaying simple text."""

    def __init__(self, master=None, cnf={}, **kw):
        """Construct an entry widget with the parent MASTER.

        Valid resource names: background, bd, bg, borderwidth, cursor,
        exportselection, fg, font, foreground, highlightbackground,
        highlightcolor, highlightthickness, insertbackground,
        insertborderwidth, insertofftime, insertontime, insertwidth,
        invalidcommand, invcmd, justify, relief, selectbackground,
        selectborderwidth, selectforeground, show, state, takefocus,
        textvariable, validate, validatecommand, vcmd, width,
        xscrollcommand."""
        Widget.__init__(self, master, 'entry', cnf, kw)

    def delete(self, first, last=None):
        """Delete text from FIRST to LAST (not included)."""
        self.tk.call(self._w, 'delete', first, last)

    def get(self):
        """Return the text."""
        return self.tk.call(self._w, 'get')

    def icursor(self, index):
        """Insert cursor at INDEX."""
        self.tk.call(self._w, 'icursor', index)

    def index(self, index):
        """Return position of cursor."""
        return self.tk.getint(self.tk.call(
            self._w, 'index', index))

    def insert(self, index, string):
        """Insert STRING at INDEX."""
        self.tk.call(self._w, 'insert', index, string)

    def scan_mark(self, x):
        """Remember the current X, Y coordinates."""
        self.tk.call(self._w, 'scan', 'mark', x)

    def scan_dragto(self, x):
        """Adjust the view of the canvas to 10 times the
        difference between X and Y and the coordinates given in
        scan_mark."""
        self.tk.call(self._w, 'scan', 'dragto', x)

    def selection_adjust(self, index):
        """Adjust the end of the selection near the cursor to INDEX."""
        self.tk.call(self._w, 'selection', 'adjust', index)

    select_adjust = selection_adjust

    def selection_clear(self):
        """Clear the selection if it is in this widget."""
        self.tk.call(self._w, 'selection', 'clear')

    select_clear = selection_clear

    def selection_from(self, index):
        """Set the fixed end of a selection to INDEX."""
        self.tk.call(self._w, 'selection', 'from', index)

    select_from = selection_from

    def selection_present(self):
        """Return True if there are characters selected in the entry, False
        otherwise."""
        return self.tk.getboolean(
            self.tk.call(self._w, 'selection', 'present'))

    select_present = selection_present

    def selection_range(self, start, end):
        """Set the selection from START to END (not included)."""
        self.tk.call(self._w, 'selection', 'range', start, end)

    select_range = selection_range

    def selection_to(self, index):
        """Set the variable end of a selection to INDEX."""
        self.tk.call(self._w, 'selection', 'to', index)

    select_to = selection_to


class Frame(Widget):
    """Frame widget which may contain other widgets and can have a 3D border."""

    def __init__(self, master=None, cnf={}, **kw):
        """Construct a frame widget with the parent MASTER.

        Valid resource names: background, bd, bg, borderwidth, class,
        colormap, container, cursor, height, highlightbackground,
        highlightcolor, highlightthickness, relief, takefocus, visual, width."""
        cnf = _cnfmerge((cnf, kw))
        extra = ()
        if 'class_' in cnf:
            extra = ('-class', cnf['class_'])
            del cnf['class_']
        elif 'class' in cnf:
            extra = ('-class', cnf['class'])
            del cnf['class']
        Widget.__init__(self, master, 'frame', cnf, {}, extra)


class Label(Widget):
    """Label widget which can display text and bitmaps."""

    def __init__(self, master=None, cnf={}, **kw):
        """Construct a label widget with the parent MASTER.

        STANDARD OPTIONS

            activebackground, activeforeground, anchor,
            background, bitmap, borderwidth, cursor,
            disabledforeground, font, foreground,
            highlightbackground, highlightcolor,
            highlightthickness, image, justify,
            padx, pady, relief, takefocus, text,
            textvariable, underline, wraplength

        WIDGET-SPECIFIC OPTIONS

            height, state, width

        """
        Widget.__init__(self, master, 'label', cnf, kw)


class Listbox(Widget, XView, YView):
    """Listbox widget which can display a list of strings."""

    def __init__(self, master=None, cnf={}, **kw):
        """Construct a listbox widget with the parent MASTER.

        Valid resource names: background, bd, bg, borderwidth, cursor,
        exportselection, fg, font, foreground, height, highlightbackground,
        highlightcolor, highlightthickness, relief, selectbackground,
        selectborderwidth, selectforeground, selectmode, setgrid, takefocus,
        width, xscrollcommand, yscrollcommand, listvariable."""
        Widget.__init__(self, master, 'listbox', cnf, kw)

    def activate(self, index):
        """Activate item identified by INDEX."""
        self.tk.call(self._w, 'activate', index)

    def bbox(self, index):
        """Return a tuple of X1,Y1,X2,Y2 coordinates for a rectangle
        which encloses the item identified by the given index."""
        return self._getints(self.tk.call(self._w, 'bbox', index)) or None

    def curselection(self):
        """Return the indices of currently selected item."""
        return self._getints(self.tk.call(self._w, 'curselection')) or ()

    def delete(self, first, last=None):
        """Delete items from FIRST to LAST (included)."""
        self.tk.call(self._w, 'delete', first, last)

    def get(self, first, last=None):
        """Get list of items from FIRST to LAST (included)."""
        if last is not None:
            return self.tk.splitlist(self.tk.call(
                self._w, 'get', first, last))
        else:
            return self.tk.call(self._w, 'get', first)

    def index(self, index):
        """Return index of item identified with INDEX."""
        i = self.tk.call(self._w, 'index', index)
        if i == 'none': return None
        return self.tk.getint(i)

    def insert(self, index, *elements):
        """Insert ELEMENTS at INDEX."""
        self.tk.call((self._w, 'insert', index) + elements)

    def nearest(self, y):
        """Get index of item which is nearest to y coordinate Y."""
        return self.tk.getint(self.tk.call(
            self._w, 'nearest', y))

    def scan_mark(self, x, y):
        """Remember the current X, Y coordinates."""
        self.tk.call(self._w, 'scan', 'mark', x, y)

    def scan_dragto(self, x, y):
        """Adjust the view of the listbox to 10 times the
        difference between X and Y and the coordinates given in
        scan_mark."""
        self.tk.call(self._w, 'scan', 'dragto', x, y)

    def see(self, index):
        """Scroll such that INDEX is visible."""
        self.tk.call(self._w, 'see', index)

    def selection_anchor(self, index):
        """Set the fixed end oft the selection to INDEX."""
        self.tk.call(self._w, 'selection', 'anchor', index)

    select_anchor = selection_anchor

    def selection_clear(self, first, last=None):
        """Clear the selection from FIRST to LAST (included)."""
        self.tk.call(self._w,
                 'selection', 'clear', first, last)

    select_clear = selection_clear

    def selection_includes(self, index):
        """Return True if INDEX is part of the selection."""
        return self.tk.getboolean(self.tk.call(
            self._w, 'selection', 'includes', index))

    select_includes = selection_includes

    def selection_set(self, first, last=None):
        """Set the selection from FIRST to LAST (included) without
        changing the currently selected elements."""
        self.tk.call(self._w, 'selection', 'set', first, last)

    select_set = selection_set

    def size(self):
        """Return the number of elements in the listbox."""
        return self.tk.getint(self.tk.call(self._w, 'size'))

    def itemcget(self, index, option):
        """Return the resource value for an ITEM and an OPTION."""
        return self.tk.call(
            (self._w, 'itemcget') + (index, '-'+option))

    def itemconfigure(self, index, cnf=None, **kw):
        """Configure resources of an ITEM.

        The values for resources are specified as keyword arguments.
        To get an overview about the allowed keyword arguments
        call the method without arguments.
        Valid resource names: background, bg, foreground, fg,
        selectbackground, selectforeground."""
        return self._configure(('itemconfigure', index), cnf, kw)

    itemconfig = itemconfigure


class Menu(Widget):
    """Menu widget which allows displaying menu bars, pull-down menus and pop-up menus."""

    def __init__(self, master=None, cnf={}, **kw):
        """Construct menu widget with the parent MASTER.

        Valid resource names: activebackground, activeborderwidth,
        activeforeground, background, bd, bg, borderwidth, cursor,
        disabledforeground, fg, font, foreground, postcommand, relief,
        selectcolor, takefocus, tearoff, tearoffcommand, title, type."""
        Widget.__init__(self, master, 'menu', cnf, kw)

    def tk_popup(self, x, y, entry=""):
        """Post the menu at position X,Y with entry ENTRY."""
        self.tk.call('tk_popup', self._w, x, y, entry)

    def activate(self, index):
        """Activate entry at INDEX."""
        self.tk.call(self._w, 'activate', index)

    def add(self, itemType, cnf={}, **kw):
        """Internal function."""
        self.tk.call((self._w, 'add', itemType) +
                 self._options(cnf, kw))

    def add_cascade(self, cnf={}, **kw):
        """Add hierarchical menu item."""
        self.add('cascade', cnf or kw)

    def add_checkbutton(self, cnf={}, **kw):
        """Add checkbutton menu item."""
        self.add('checkbutton', cnf or kw)

    def add_command(self, cnf={}, **kw):
        """Add command menu item."""
        self.add('command', cnf or kw)

    def add_radiobutton(self, cnf={}, **kw):
        """Addd radio menu item."""
        self.add('radiobutton', cnf or kw)

    def add_separator(self, cnf={}, **kw):
        """Add separator."""
        self.add('separator', cnf or kw)

    def insert(self, index, itemType, cnf={}, **kw):
        """Internal function."""
        self.tk.call((self._w, 'insert', index, itemType) +
                 self._options(cnf, kw))

    def insert_cascade(self, index, cnf={}, **kw):
        """Add hierarchical menu item at INDEX."""
        self.insert(index, 'cascade', cnf or kw)

    def insert_checkbutton(self, index, cnf={}, **kw):
        """Add checkbutton menu item at INDEX."""
        self.insert(index, 'checkbutton', cnf or kw)

    def insert_command(self, index, cnf={}, **kw):
        """Add command menu item at INDEX."""
        self.insert(index, 'command', cnf or kw)

    def insert_radiobutton(self, index, cnf={}, **kw):
        """Addd radio menu item at INDEX."""
        self.insert(index, 'radiobutton', cnf or kw)

    def insert_separator(self, index, cnf={}, **kw):
        """Add separator at INDEX."""
        self.insert(index, 'separator', cnf or kw)

    def delete(self, index1, index2=None):
        """Delete menu items between INDEX1 and INDEX2 (included)."""
        if index2 is None:
            index2 = index1

        num_index1, num_index2 = self.index(index1), self.index(index2)
        if (num_index1 is None) or (num_index2 is None):
            num_index1, num_index2 = 0, -1

        for i in range(num_index1, num_index2 + 1):
            if 'command' in self.entryconfig(i):
                c = str(self.entrycget(i, 'command'))
                if c:
                    self.deletecommand(c)
        self.tk.call(self._w, 'delete', index1, index2)

    def entrycget(self, index, option):
        """Return the resource value of a menu item for OPTION at INDEX."""
        return self.tk.call(self._w, 'entrycget', index, '-' + option)

    def entryconfigure(self, index, cnf=None, **kw):
        """Configure a menu item at INDEX."""
        return self._configure(('entryconfigure', index), cnf, kw)

    entryconfig = entryconfigure

    def index(self, index):
        """Return the index of a menu item identified by INDEX."""
        i = self.tk.call(self._w, 'index', index)
        if i == 'none': return None
        return self.tk.getint(i)

    def invoke(self, index):
        """Invoke a menu item identified by INDEX and execute
        the associated command."""
        return self.tk.call(self._w, 'invoke', index)

    def post(self, x, y):
        """Display a menu at position X,Y."""
        self.tk.call(self._w, 'post', x, y)

    def type(self, index):
        """Return the type of the menu item at INDEX."""
        return self.tk.call(self._w, 'type', index)

    def unpost(self):
        """Unmap a menu."""
        self.tk.call(self._w, 'unpost')

    def xposition(self, index): # new in Tk 8.5
        """Return the x-position of the leftmost pixel of the menu item
        at INDEX."""
        return self.tk.getint(self.tk.call(self._w, 'xposition', index))

    def yposition(self, index):
        """Return the y-position of the topmost pixel of the menu item at INDEX."""
        return self.tk.getint(self.tk.call(
            self._w, 'yposition', index))


class Menubutton(Widget):
    """Menubutton widget, obsolete since Tk8.0."""

    def __init__(self, master=None, cnf={}, **kw):
        Widget.__init__(self, master, 'menubutton', cnf, kw)


class Message(Widget):
    """Message widget to display multiline text. Obsolete since Label does it too."""

    def __init__(self, master=None, cnf={}, **kw):
        Widget.__init__(self, master, 'message', cnf, kw)


class Radiobutton(Widget):
    """Radiobutton widget which shows only one of several buttons in on-state."""

    def __init__(self, master=None, cnf={}, **kw):
        """Construct a radiobutton widget with the parent MASTER.

        Valid resource names: activebackground, activeforeground, anchor,
        background, bd, bg, bitmap, borderwidth, command, cursor,
        disabledforeground, fg, font, foreground, height,
        highlightbackground, highlightcolor, highlightthickness, image,
        indicatoron, justify, padx, pady, relief, selectcolor, selectimage,
        state, takefocus, text, textvariable, underline, value, variable,
        width, wraplength."""
        Widget.__init__(self, master, 'radiobutton', cnf, kw)

    def deselect(self):
        """Put the button in off-state."""

        self.tk.call(self._w, 'deselect')

    def flash(self):
        """Flash the button."""
        self.tk.call(self._w, 'flash')

    def invoke(self):
        """Toggle the button and invoke a command if given as resource."""
        return self.tk.call(self._w, 'invoke')

    def select(self):
        """Put the button in on-state."""
        self.tk.call(self._w, 'select')


class Scale(Widget):
    """Scale widget which can display a numerical scale."""

    def __init__(self, master=None, cnf={}, **kw):
        """Construct a scale widget with the parent MASTER.

        Valid resource names: activebackground, background, bigincrement, bd,
        bg, borderwidth, command, cursor, digits, fg, font, foreground, from,
        highlightbackground, highlightcolor, highlightthickness, label,
        length, orient, relief, repeatdelay, repeatinterval, resolution,
        showvalue, sliderlength, sliderrelief, state, takefocus,
        tickinterval, to, troughcolor, variable, width."""
        Widget.__init__(self, master, 'scale', cnf, kw)

    def get(self):
        """Get the current value as integer or float."""
        value = self.tk.call(self._w, 'get')
        try:
            return self.tk.getint(value)
        except (ValueError, TypeError, TclError):
            return self.tk.getdouble(value)

    def set(self, value):
        """Set the value to VALUE."""
        self.tk.call(self._w, 'set', value)

    def coords(self, value=None):
        """Return a tuple (X,Y) of the point along the centerline of the
        trough that corresponds to VALUE or the current value if None is
        given."""

        return self._getints(self.tk.call(self._w, 'coords', value))

    def identify(self, x, y):
        """Return where the point X,Y lies. Valid return values are "slider",
        "though1" and "though2"."""
        return self.tk.call(self._w, 'identify', x, y)


class Scrollbar(Widget):
    """Scrollbar widget which displays a slider at a certain position."""

    def __init__(self, master=None, cnf={}, **kw):
        """Construct a scrollbar widget with the parent MASTER.

        Valid resource names: activebackground, activerelief,
        background, bd, bg, borderwidth, command, cursor,
        elementborderwidth, highlightbackground,
        highlightcolor, highlightthickness, jump, orient,
        relief, repeatdelay, repeatinterval, takefocus,
        troughcolor, width."""
        Widget.__init__(self, master, 'scrollbar', cnf, kw)

    def activate(self, index=None):
        """Marks the element indicated by index as active.
        The only index values understood by this method are "arrow1",
        "slider", or "arrow2".  If any other value is specified then no
        element of the scrollbar will be active.  If index is not specified,
        the method returns the name of the element that is currently active,
        or None if no element is active."""
        return self.tk.call(self._w, 'activate', index) or None

    def delta(self, deltax, deltay):
        """Return the fractional change of the scrollbar setting if it
        would be moved by DELTAX or DELTAY pixels."""
        return self.tk.getdouble(
            self.tk.call(self._w, 'delta', deltax, deltay))

    def fraction(self, x, y):
        """Return the fractional value which corresponds to a slider
        position of X,Y."""
        return self.tk.getdouble(self.tk.call(self._w, 'fraction', x, y))

    def identify(self, x, y):
        """Return the element under position X,Y as one of
        "arrow1","slider","arrow2" or ""."""
        return self.tk.call(self._w, 'identify', x, y)

    def get(self):
        """Return the current fractional values (upper and lower end)
        of the slider position."""
        return self._getdoubles(self.tk.call(self._w, 'get'))

    def set(self, first, last):
        """Set the fractional values of the slider position (upper and
        lower ends as value between 0 and 1)."""
        self.tk.call(self._w, 'set', first, last)


class Text(Widget, XView, YView):
    """Text widget which can display text in various forms."""

    def __init__(self, master=None, cnf={}, **kw):
        """Construct a text widget with the parent MASTER.

        STANDARD OPTIONS

            background, borderwidth, cursor,
            exportselection, font, foreground,
            highlightbackground, highlightcolor,
            highlightthickness, insertbackground,
            insertborderwidth, insertofftime,
            insertontime, insertwidth, padx, pady,
            relief, selectbackground,
            selectborderwidth, selectforeground,
            setgrid, takefocus,
            xscrollcommand, yscrollcommand,

        WIDGET-SPECIFIC OPTIONS

            autoseparators, height, maxundo,
            spacing1, spacing2, spacing3,
            state, tabs, undo, width, wrap,

        """
        Widget.__init__(self, master, 'text', cnf, kw)

    def bbox(self, index):
        """Return a tuple of (x,y,width,height) which gives the bounding
        box of the visible part of the character at the given index."""
        return self._getints(
                self.tk.call(self._w, 'bbox', index)) or None

    def compare(self, index1, op, index2):
        """Return whether between index INDEX1 and index INDEX2 the
        relation OP is satisfied. OP is one of <, <=, ==, >=, >, or !=."""
        return self.tk.getboolean(self.tk.call(
            self._w, 'compare', index1, op, index2))

    def count(self, index1, index2, *args): # new in Tk 8.5
        """Counts the number of relevant things between the two indices.
        If index1 is after index2, the result will be a negative number
        (and this holds for each of the possible options).

        The actual items which are counted depends on the options given by
        args. The result is a list of integers, one for the result of each
        counting option given. Valid counting options are "chars",
        "displaychars", "displayindices", "displaylines", "indices",
        "lines", "xpixels" and "ypixels". There is an additional possible
        option "update", which if given then all subsequent options ensure
        that any possible out of date information is recalculated."""
        args = ['-%s' % arg for arg in args if not arg.startswith('-')]
        args += [index1, index2]
        res = self.tk.call(self._w, 'count', *args) or None
        if res is not None and len(args) <= 3:
            return (res, )
        else:
            return res

    def debug(self, boolean=None):
        """Turn on the internal consistency checks of the B-Tree inside the text
        widget according to BOOLEAN."""
        if boolean is None:
            return self.tk.getboolean(self.tk.call(self._w, 'debug'))
        self.tk.call(self._w, 'debug', boolean)

    def delete(self, index1, index2=None):
        """Delete the characters between INDEX1 and INDEX2 (not included)."""
        self.tk.call(self._w, 'delete', index1, index2)

    def dlineinfo(self, index):
        """Return tuple (x,y,width,height,baseline) giving the bounding box
        and baseline position of the visible part of the line containing
        the character at INDEX."""
        return self._getints(self.tk.call(self._w, 'dlineinfo', index))

    def dump(self, index1, index2=None, command=None, **kw):
        """Return the contents of the widget between index1 and index2.

        The type of contents returned in filtered based on the keyword
        parameters; if 'all', 'image', 'mark', 'tag', 'text', or 'window' are
        given and true, then the corresponding items are returned. The result
        is a list of triples of the form (key, value, index). If none of the
        keywords are true then 'all' is used by default.

        If the 'command' argument is given, it is called once for each element
        of the list of triples, with the values of each triple serving as the
        arguments to the function. In this case the list is not returned."""
        args = []
        func_name = None
        result = None
        if not command:
            # Never call the dump command without the -command flag, since the
            # output could involve Tcl quoting and would be a pain to parse
            # right. Instead just set the command to build a list of triples
            # as if we had done the parsing.
            result = []
            def append_triple(key, value, index, result=result):
                result.append((key, value, index))
            command = append_triple
        try:
            if not isinstance(command, str):
                func_name = command = self._register(command)
            args += ["-command", command]
            for key in kw:
                if kw[key]: args.append("-" + key)
            args.append(index1)
            if index2:
                args.append(index2)
            self.tk.call(self._w, "dump", *args)
            return result
        finally:
            if func_name:
                self.deletecommand(func_name)

    ## new in tk8.4
    def edit(self, *args):
        """Internal method

        This method controls the undo mechanism and
        the modified flag. The exact behavior of the
        command depends on the option argument that
        follows the edit argument. The following forms
        of the command are currently supported:

        edit_modified, edit_redo, edit_reset, edit_separator
        and edit_undo

        """
        return self.tk.call(self._w, 'edit', *args)

    def edit_modified(self, arg=None):
        """Get or Set the modified flag

        If arg is not specified, returns the modified
        flag of the widget. The insert, delete, edit undo and
        edit redo commands or the user can set or clear the
        modified flag. If boolean is specified, sets the
        modified flag of the widget to arg.
        """
        return self.edit("modified", arg)

    def edit_redo(self):
        """Redo the last undone edit

        When the undo option is true, reapplies the last
        undone edits provided no other edits were done since
        then. Generates an error when the redo stack is empty.
        Does nothing when the undo option is false.
        """
        return self.edit("redo")

    def edit_reset(self):
        """Clears the undo and redo stacks
        """
        return self.edit("reset")

    def edit_separator(self):
        """Inserts a separator (boundary) on the undo stack.

        Does nothing when the undo option is false
        """
        return self.edit("separator")

    def edit_undo(self):
        """Undoes the last edit action

        If the undo option is true. An edit action is defined
        as all the insert and delete commands that are recorded
        on the undo stack in between two separators. Generates
        an error when the undo stack is empty. Does nothing
        when the undo option is false
        """
        return self.edit("undo")

    def get(self, index1, index2=None):
        """Return the text from INDEX1 to INDEX2 (not included)."""
        return self.tk.call(self._w, 'get', index1, index2)
    # (Image commands are new in 8.0)

    def image_cget(self, index, option):
        """Return the value of OPTION of an embedded image at INDEX."""
        if option[:1] != "-":
            option = "-" + option
        if option[-1:] == "_":
            option = option[:-1]
        return self.tk.call(self._w, "image", "cget", index, option)

    def image_configure(self, index, cnf=None, **kw):
        """Configure an embedded image at INDEX."""
        return self._configure(('image', 'configure', index), cnf, kw)

    def image_create(self, index, cnf={}, **kw):
        """Create an embedded image at INDEX."""
        return self.tk.call(
                 self._w, "image", "create", index,
                 *self._options(cnf, kw))

    def image_names(self):
        """Return all names of embedded images in this widget."""
        return self.tk.call(self._w, "image", "names")

    def index(self, index):
        """Return the index in the form line.char for INDEX."""
        return str(self.tk.call(self._w, 'index', index))

    def insert(self, index, chars, *args):
        """Insert CHARS before the characters at INDEX. An additional
        tag can be given in ARGS. Additional CHARS and tags can follow in ARGS."""
        self.tk.call((self._w, 'insert', index, chars) + args)

    def mark_gravity(self, markName, direction=None):
        """Change the gravity of a mark MARKNAME to DIRECTION (LEFT or RIGHT).
        Return the current value if None is given for DIRECTION."""
        return self.tk.call(
            (self._w, 'mark', 'gravity', markName, direction))

    def mark_names(self):
        """Return all mark names."""
        return self.tk.splitlist(self.tk.call(
            self._w, 'mark', 'names'))

    def mark_set(self, markName, index):
        """Set mark MARKNAME before the character at INDEX."""
        self.tk.call(self._w, 'mark', 'set', markName, index)

    def mark_unset(self, *markNames):
        """Delete all marks in MARKNAMES."""
        self.tk.call((self._w, 'mark', 'unset') + markNames)

    def mark_next(self, index):
        """Return the name of the next mark after INDEX."""
        return self.tk.call(self._w, 'mark', 'next', index) or None

    def mark_previous(self, index):
        """Return the name of the previous mark before INDEX."""
        return self.tk.call(self._w, 'mark', 'previous', index) or None

    def peer_create(self, newPathName, cnf={}, **kw): # new in Tk 8.5
        """Creates a peer text widget with the given newPathName, and any
        optional standard configuration options. By default the peer will
        have the same start and end line as the parent widget, but
        these can be overridden with the standard configuration options."""
        self.tk.call(self._w, 'peer', 'create', newPathName,
            *self._options(cnf, kw))

    def peer_names(self): # new in Tk 8.5
        """Returns a list of peers of this widget (this does not include
        the widget itself)."""
        return self.tk.splitlist(self.tk.call(self._w, 'peer', 'names'))

    def replace(self, index1, index2, chars, *args): # new in Tk 8.5
        """Replaces the range of characters between index1 and index2 with
        the given characters and tags specified by args.

        See the method insert for some more information about args, and the
        method delete for information about the indices."""
        self.tk.call(self._w, 'replace', index1, index2, chars, *args)

    def scan_mark(self, x, y):
        """Remember the current X, Y coordinates."""
        self.tk.call(self._w, 'scan', 'mark', x, y)

    def scan_dragto(self, x, y):
        """Adjust the view of the text to 10 times the
        difference between X and Y and the coordinates given in
        scan_mark."""
        self.tk.call(self._w, 'scan', 'dragto', x, y)

    def search(self, pattern, index, stopindex=None,
           forwards=None, backwards=None, exact=None,
           regexp=None, nocase=None, count=None, elide=None):
        """Search PATTERN beginning from INDEX until STOPINDEX.
        Return the index of the first character of a match or an
        empty string."""
        args = [self._w, 'search']
        if forwards: args.append('-forwards')
        if backwards: args.append('-backwards')
        if exact: args.append('-exact')
        if regexp: args.append('-regexp')
        if nocase: args.append('-nocase')
        if elide: args.append('-elide')
        if count: args.append('-count'); args.append(count)
        if pattern and pattern[0] == '-': args.append('--')
        args.append(pattern)
        args.append(index)
        if stopindex: args.append(stopindex)
        return str(self.tk.call(tuple(args)))

    def see(self, index):
        """Scroll such that the character at INDEX is visible."""
        self.tk.call(self._w, 'see', index)

    def tag_add(self, tagName, index1, *args):
        """Add tag TAGNAME to all characters between INDEX1 and index2 in ARGS.
        Additional pairs of indices may follow in ARGS."""
        self.tk.call(
            (self._w, 'tag', 'add', tagName, index1) + args)

    def tag_unbind(self, tagName, sequence, funcid=None):
        """Unbind for all characters with TAGNAME for event SEQUENCE  the
        function identified with FUNCID."""
        self.tk.call(self._w, 'tag', 'bind', tagName, sequence, '')
        if funcid:
            self.deletecommand(funcid)

    def tag_bind(self, tagName, sequence, func, add=None):
        """Bind to all characters with TAGNAME at event SEQUENCE a call to function FUNC.

        An additional boolean parameter ADD specifies whether FUNC will be
        called additionally to the other bound function or whether it will
        replace the previous function. See bind for the return value."""
        return self._bind((self._w, 'tag', 'bind', tagName),
                  sequence, func, add)

    def tag_cget(self, tagName, option):
        """Return the value of OPTION for tag TAGNAME."""
        if option[:1] != '-':
            option = '-' + option
        if option[-1:] == '_':
            option = option[:-1]
        return self.tk.call(self._w, 'tag', 'cget', tagName, option)

    def tag_configure(self, tagName, cnf=None, **kw):
        """Configure a tag TAGNAME."""
        return self._configure(('tag', 'configure', tagName), cnf, kw)

    tag_config = tag_configure

    def tag_delete(self, *tagNames):
        """Delete all tags in TAGNAMES."""
        self.tk.call((self._w, 'tag', 'delete') + tagNames)

    def tag_lower(self, tagName, belowThis=None):
        """Change the priority of tag TAGNAME such that it is lower
        than the priority of BELOWTHIS."""
        self.tk.call(self._w, 'tag', 'lower', tagName, belowThis)

    def tag_names(self, index=None):
        """Return a list of all tag names."""
        return self.tk.splitlist(
            self.tk.call(self._w, 'tag', 'names', index))

    def tag_nextrange(self, tagName, index1, index2=None):
        """Return a list of start and end index for the first sequence of
        characters between INDEX1 and INDEX2 which all have tag TAGNAME.
        The text is searched forward from INDEX1."""
        return self.tk.splitlist(self.tk.call(
            self._w, 'tag', 'nextrange', tagName, index1, index2))

    def tag_prevrange(self, tagName, index1, index2=None):
        """Return a list of start and end index for the first sequence of
        characters between INDEX1 and INDEX2 which all have tag TAGNAME.
        The text is searched backwards from INDEX1."""
        return self.tk.splitlist(self.tk.call(
            self._w, 'tag', 'prevrange', tagName, index1, index2))

    def tag_raise(self, tagName, aboveThis=None):
        """Change the priority of tag TAGNAME such that it is higher
        than the priority of ABOVETHIS."""
        self.tk.call(
            self._w, 'tag', 'raise', tagName, aboveThis)

    def tag_ranges(self, tagName):
        """Return a list of ranges of text which have tag TAGNAME."""
        return self.tk.splitlist(self.tk.call(
            self._w, 'tag', 'ranges', tagName))

    def tag_remove(self, tagName, index1, index2=None):
        """Remove tag TAGNAME from all characters between INDEX1 and INDEX2."""
        self.tk.call(
            self._w, 'tag', 'remove', tagName, index1, index2)

    def window_cget(self, index, option):
        """Return the value of OPTION of an embedded window at INDEX."""
        if option[:1] != '-':
            option = '-' + option
        if option[-1:] == '_':
            option = option[:-1]
        return self.tk.call(self._w, 'window', 'cget', index, option)

    def window_configure(self, index, cnf=None, **kw):
        """Configure an embedded window at INDEX."""
        return self._configure(('window', 'configure', index), cnf, kw)

    window_config = window_configure

    def window_create(self, index, cnf={}, **kw):
        """Create a window at INDEX."""
        self.tk.call(
              (self._w, 'window', 'create', index)
              + self._options(cnf, kw))

    def window_names(self):
        """Return all names of embedded windows in this widget."""
        return self.tk.splitlist(
            self.tk.call(self._w, 'window', 'names'))

    def yview_pickplace(self, *what):
        """Obsolete function, use see."""
        self.tk.call((self._w, 'yview', '-pickplace') + what)


class _setit:
    """Internal class. It wraps the command in the widget OptionMenu."""

    def __init__(self, var, value, callback=None):
        self.__value = value
        self.__var = var
        self.__callback = callback

    def __call__(self, *args):
        self.__var.set(self.__value)
        if self.__callback:
            self.__callback(self.__value, *args)


class OptionMenu(Menubutton):
    """OptionMenu which allows the user to select a value from a menu."""

    def __init__(self, master, variable, value, *values, **kwargs):
        """Construct an optionmenu widget with the parent MASTER, with
        the resource textvariable set to VARIABLE, the initially selected
        value VALUE, the other menu values VALUES and an additional
        keyword argument command."""
        kw = {"borderwidth": 2, "textvariable": variable,
              "indicatoron": 1, "relief": RAISED, "anchor": "c",
              "highlightthickness": 2}
        Widget.__init__(self, master, "menubutton", kw)
        self.widgetName = 'tk_optionMenu'
        menu = self.__menu = Menu(self, name="menu", tearoff=0)
        self.menuname = menu._w
        # 'command' is the only supported keyword
        callback = kwargs.get('command')
        if 'command' in kwargs:
            del kwargs['command']
        if kwargs:
            raise TclError('unknown option -'+next(iter(kwargs)))
        menu.add_command(label=value,
                 command=_setit(variable, value, callback))
        for v in values:
            menu.add_command(label=v,
                     command=_setit(variable, v, callback))
        self["menu"] = menu

    def __getitem__(self, name):
        if name == 'menu':
            return self.__menu
        return Widget.__getitem__(self, name)

    def destroy(self):
        """Destroy this widget and the associated menu."""
        Menubutton.destroy(self)
        self.__menu = None


class Image:
    """Base class for images."""
    _last_id = 0

    def __init__(self, imgtype, name=None, cnf={}, master=None, **kw):
        self.name = None
        if not master:
            master = _get_default_root('create image')
        self.tk = getattr(master, 'tk', master)
        if not name:
            Image._last_id += 1
            name = "pyimage%r" % (Image._last_id,) # tk itself would use image<x>
        if kw and cnf: cnf = _cnfmerge((cnf, kw))
        elif kw: cnf = kw
        options = ()
        for k, v in cnf.items():
            if callable(v):
                v = self._register(v)
            options = options + ('-'+k, v)
        self.tk.call(('image', 'create', imgtype, name,) + options)
        self.name = name

    def __str__(self): return self.name

    def __del__(self):
        if self.name:
            try:
                self.tk.call('image', 'delete', self.name)
            except TclError:
                # May happen if the root was destroyed
                pass

    def __setitem__(self, key, value):
        self.tk.call(self.name, 'configure', '-'+key, value)

    def __getitem__(self, key):
        return self.tk.call(self.name, 'configure', '-'+key)

    def configure(self, **kw):
        """Configure the image."""
        res = ()
        for k, v in _cnfmerge(kw).items():
            if v is not None:
                if k[-1] == '_': k = k[:-1]
                if callable(v):
                    v = self._register(v)
                res = res + ('-'+k, v)
        self.tk.call((self.name, 'config') + res)

    config = configure

    def height(self):
        """Return the height of the image."""
        return self.tk.getint(
            self.tk.call('image', 'height', self.name))

    def type(self):
        """Return the type of the image, e.g. "photo" or "bitmap"."""
        return self.tk.call('image', 'type', self.name)

    def width(self):
        """Return the width of the image."""
        return self.tk.getint(
            self.tk.call('image', 'width', self.name))


class PhotoImage(Image):
    """Widget which can display images in PGM, PPM, GIF, PNG format."""

    def __init__(self, name=None, cnf={}, master=None, **kw):
        """Create an image with NAME.

        Valid resource names: data, format, file, gamma, height, palette,
        width."""
        Image.__init__(self, 'photo', name, cnf, master, **kw)

    def blank(self):
        """Display a transparent image."""
        self.tk.call(self.name, 'blank')

    def cget(self, option):
        """Return the value of OPTION."""
        return self.tk.call(self.name, 'cget', '-' + option)
    # XXX config

    def __getitem__(self, key):
        return self.tk.call(self.name, 'cget', '-' + key)
    # XXX copy -from, -to, ...?

    def copy(self):
        """Return a new PhotoImage with the same image as this widget."""
        destImage = PhotoImage(master=self.tk)
        self.tk.call(destImage, 'copy', self.name)
        return destImage

    def zoom(self, x, y=''):
        """Return a new PhotoImage with the same image as this widget
        but zoom it with a factor of x in the X direction and y in the Y
        direction.  If y is not given, the default value is the same as x.
        """
        destImage = PhotoImage(master=self.tk)
        if y=='': y=x
        self.tk.call(destImage, 'copy', self.name, '-zoom',x,y)
        return destImage

    def subsample(self, x, y=''):
        """Return a new PhotoImage based on the same image as this widget
        but use only every Xth or Yth pixel.  If y is not given, the
        default value is the same as x.
        """
        destImage = PhotoImage(master=self.tk)
        if y=='': y=x
        self.tk.call(destImage, 'copy', self.name, '-subsample',x,y)
        return destImage

    def get(self, x, y):
        """Return the color (red, green, blue) of the pixel at X,Y."""
        return self.tk.call(self.name, 'get', x, y)

    def put(self, data, to=None):
        """Put row formatted colors to image starting from
        position TO, e.g. image.put("{red green} {blue yellow}", to=(4,6))"""
        args = (self.name, 'put', data)
        if to:
            if to[0] == '-to':
                to = to[1:]
            args = args + ('-to',) + tuple(to)
        self.tk.call(args)
    # XXX read

    def write(self, filename, format=None, from_coords=None):
        """Write image to file FILENAME in FORMAT starting from
        position FROM_COORDS."""
        args = (self.name, 'write', filename)
        if format:
            args = args + ('-format', format)
        if from_coords:
            args = args + ('-from',) + tuple(from_coords)
        self.tk.call(args)

    def transparency_get(self, x, y):
        """Return True if the pixel at x,y is transparent."""
        return self.tk.getboolean(self.tk.call(
            self.name, 'transparency', 'get', x, y))

    def transparency_set(self, x, y, boolean):
        """Set the transparency of the pixel at x,y."""
        self.tk.call(self.name, 'transparency', 'set', x, y, boolean)


class BitmapImage(Image):
    """Widget which can display images in XBM format."""

    def __init__(self, name=None, cnf={}, master=None, **kw):
        """Create a bitmap with NAME.

        Valid resource names: background, data, file, foreground, maskdata, maskfile."""
        Image.__init__(self, 'bitmap', name, cnf, master, **kw)


def image_names():
    tk = _get_default_root('use image_names()').tk
    return tk.splitlist(tk.call('image', 'names'))


def image_types():
    tk = _get_default_root('use image_types()').tk
    return tk.splitlist(tk.call('image', 'types'))


class Spinbox(Widget, XView):
    """spinbox widget."""

    def __init__(self, master=None, cnf={}, **kw):
        """Construct a spinbox widget with the parent MASTER.

        STANDARD OPTIONS

            activebackground, background, borderwidth,
            cursor, exportselection, font, foreground,
            highlightbackground, highlightcolor,
            highlightthickness, insertbackground,
            insertborderwidth, insertofftime,
            insertontime, insertwidth, justify, relief,
            repeatdelay, repeatinterval,
            selectbackground, selectborderwidth
            selectforeground, takefocus, textvariable
            xscrollcommand.

        WIDGET-SPECIFIC OPTIONS

            buttonbackground, buttoncursor,
            buttondownrelief, buttonuprelief,
            command, disabledbackground,
            disabledforeground, format, from,
            invalidcommand, increment,
            readonlybackground, state, to,
            validate, validatecommand values,
            width, wrap,
        """
        Widget.__init__(self, master, 'spinbox', cnf, kw)

    def bbox(self, index):
        """Return a tuple of X1,Y1,X2,Y2 coordinates for a
        rectangle which encloses the character given by index.

        The first two elements of the list give the x and y
        coordinates of the upper-left corner of the screen
        area covered by the character (in pixels relative
        to the widget) and the last two elements give the
        width and height of the character, in pixels. The
        bounding box may refer to a region outside the
        visible area of the window.
        """
        return self._getints(self.tk.call(self._w, 'bbox', index)) or None

    def delete(self, first, last=None):
        """Delete one or more elements of the spinbox.

        First is the index of the first character to delete,
        and last is the index of the character just after
        the last one to delete. If last isn't specified it
        defaults to first+1, i.e. a single character is
        deleted.  This command returns an empty string.
        """
        return self.tk.call(self._w, 'delete', first, last)

    def get(self):
        """Returns the spinbox's string"""
        return self.tk.call(self._w, 'get')

    def icursor(self, index):
        """Alter the position of the insertion cursor.

        The insertion cursor will be displayed just before
        the character given by index. Returns an empty string
        """
        return self.tk.call(self._w, 'icursor', index)

    def identify(self, x, y):
        """Returns the name of the widget at position x, y

        Return value is one of: none, buttondown, buttonup, entry
        """
        return self.tk.call(self._w, 'identify', x, y)

    def index(self, index):
        """Returns the numerical index corresponding to index
        """
        return self.tk.call(self._w, 'index', index)

    def insert(self, index, s):
        """Insert string s at index

         Returns an empty string.
        """
        return self.tk.call(self._w, 'insert', index, s)

    def invoke(self, element):
        """Causes the specified element to be invoked

        The element could be buttondown or buttonup
        triggering the action associated with it.
        """
        return self.tk.call(self._w, 'invoke', element)

    def scan(self, *args):
        """Internal function."""
        return self._getints(
            self.tk.call((self._w, 'scan') + args)) or ()

    def scan_mark(self, x):
        """Records x and the current view in the spinbox window;

        used in conjunction with later scan dragto commands.
        Typically this command is associated with a mouse button
        press in the widget. It returns an empty string.
        """
        return self.scan("mark", x)

    def scan_dragto(self, x):
        """Compute the difference between the given x argument
        and the x argument to the last scan mark command

        It then adjusts the view left or right by 10 times the
        difference in x-coordinates. This command is typically
        associated with mouse motion events in the widget, to
        produce the effect of dragging the spinbox at high speed
        through the window. The return value is an empty string.
        """
        return self.scan("dragto", x)

    def selection(self, *args):
        """Internal function."""
        return self._getints(
            self.tk.call((self._w, 'selection') + args)) or ()

    def selection_adjust(self, index):
        """Locate the end of the selection nearest to the character
        given by index,

        Then adjust that end of the selection to be at index
        (i.e including but not going beyond index). The other
        end of the selection is made the anchor point for future
        select to commands. If the selection isn't currently in
        the spinbox, then a new selection is created to include
        the characters between index and the most recent selection
        anchor point, inclusive.
        """
        return self.selection("adjust", index)

    def selection_clear(self):
        """Clear the selection

        If the selection isn't in this widget then the
        command has no effect.
        """
        return self.selection("clear")

    def selection_element(self, element=None):
        """Sets or gets the currently selected element.

        If a spinbutton element is specified, it will be
        displayed depressed.
        """
        return self.tk.call(self._w, 'selection', 'element', element)

    def selection_from(self, index):
        """Set the fixed end of a selection to INDEX."""
        self.selection('from', index)

    def selection_present(self):
        """Return True if there are characters selected in the spinbox, False
        otherwise."""
        return self.tk.getboolean(
            self.tk.call(self._w, 'selection', 'present'))

    def selection_range(self, start, end):
        """Set the selection from START to END (not included)."""
        self.selection('range', start, end)

    def selection_to(self, index):
        """Set the variable end of a selection to INDEX."""
        self.selection('to', index)

###########################################################################


class LabelFrame(Widget):
    """labelframe widget."""

    def __init__(self, master=None, cnf={}, **kw):
        """Construct a labelframe widget with the parent MASTER.

        STANDARD OPTIONS

            borderwidth, cursor, font, foreground,
            highlightbackground, highlightcolor,
            highlightthickness, padx, pady, relief,
            takefocus, text

        WIDGET-SPECIFIC OPTIONS

            background, class, colormap, container,
            height, labelanchor, labelwidget,
            visual, width
        """
        Widget.__init__(self, master, 'labelframe', cnf, kw)

########################################################################


class PanedWindow(Widget):
    """panedwindow widget."""

    def __init__(self, master=None, cnf={}, **kw):
        """Construct a panedwindow widget with the parent MASTER.

        STANDARD OPTIONS

            background, borderwidth, cursor, height,
            orient, relief, width

        WIDGET-SPECIFIC OPTIONS

            handlepad, handlesize, opaqueresize,
            sashcursor, sashpad, sashrelief,
            sashwidth, showhandle,
        """
        Widget.__init__(self, master, 'panedwindow', cnf, kw)

    def add(self, child, **kw):
        """Add a child widget to the panedwindow in a new pane.

        The child argument is the name of the child widget
        followed by pairs of arguments that specify how to
        manage the windows. The possible options and values
        are the ones accepted by the paneconfigure method.
        """
        self.tk.call((self._w, 'add', child) + self._options(kw))

    def remove(self, child):
        """Remove the pane containing child from the panedwindow

        All geometry management options for child will be forgotten.
        """
        self.tk.call(self._w, 'forget', child)

    forget = remove

    def identify(self, x, y):
        """Identify the panedwindow component at point x, y

        If the point is over a sash or a sash handle, the result
        is a two element list containing the index of the sash or
        handle, and a word indicating whether it is over a sash
        or a handle, such as {0 sash} or {2 handle}. If the point
        is over any other part of the panedwindow, the result is
        an empty list.
        """
        return self.tk.call(self._w, 'identify', x, y)

    def proxy(self, *args):
        """Internal function."""
        return self._getints(
            self.tk.call((self._w, 'proxy') + args)) or ()

    def proxy_coord(self):
        """Return the x and y pair of the most recent proxy location
        """
        return self.proxy("coord")

    def proxy_forget(self):
        """Remove the proxy from the display.
        """
        return self.proxy("forget")

    def proxy_place(self, x, y):
        """Place the proxy at the given x and y coordinates.
        """
        return self.proxy("place", x, y)

    def sash(self, *args):
        """Internal function."""
        return self._getints(
            self.tk.call((self._w, 'sash') + args)) or ()

    def sash_coord(self, index):
        """Return the current x and y pair for the sash given by index.

        Index must be an integer between 0 and 1 less than the
        number of panes in the panedwindow. The coordinates given are
        those of the top left corner of the region containing the sash.
        pathName sash dragto index x y This command computes the
        difference between the given coordinates and the coordinates
        given to the last sash coord command for the given sash. It then
        moves that sash the computed difference. The return value is the
        empty string.
        """
        return self.sash("coord", index)

    def sash_mark(self, index):
        """Records x and y for the sash given by index;

        Used in conjunction with later dragto commands to move the sash.
        """
        return self.sash("mark", index)

    def sash_place(self, index, x, y):
        """Place the sash given by index at the given coordinates
        """
        return self.sash("place", index, x, y)

    def panecget(self, child, option):
        """Query a management option for window.

        Option may be any value allowed by the paneconfigure subcommand
        """
        return self.tk.call(
            (self._w, 'panecget') + (child, '-'+option))

    def paneconfigure(self, tagOrId, cnf=None, **kw):
        """Query or modify the management options for window.

        If no option is specified, returns a list describing all
        of the available options for pathName.  If option is
        specified with no value, then the command returns a list
        describing the one named option (this list will be identical
        to the corresponding sublist of the value returned if no
        option is specified). If one or more option-value pairs are
        specified, then the command modifies the given widget
        option(s) to have the given value(s); in this case the
        command returns an empty string. The following options
        are supported:

        after window
            Insert the window after the window specified. window
            should be the name of a window already managed by pathName.
        before window
            Insert the window before the window specified. window
            should be the name of a window already managed by pathName.
        height size
            Specify a height for the window. The height will be the
            outer dimension of the window including its border, if
            any. If size is an empty string, or if -height is not
            specified, then the height requested internally by the
            window will be used initially; the height may later be
            adjusted by the movement of sashes in the panedwindow.
            Size may be any value accepted by Tk_GetPixels.
        minsize n
            Specifies that the size of the window cannot be made
            less than n. This constraint only affects the size of
            the widget in the paned dimension -- the x dimension
            for horizontal panedwindows, the y dimension for
            vertical panedwindows. May be any value accepted by
            Tk_GetPixels.
        padx n
            Specifies a non-negative value indicating how much
            extra space to leave on each side of the window in
            the X-direction. The value may have any of the forms
            accepted by Tk_GetPixels.
        pady n
            Specifies a non-negative value indicating how much
            extra space to leave on each side of the window in
            the Y-direction. The value may have any of the forms
            accepted by Tk_GetPixels.
        sticky style
            If a window's pane is larger than the requested
            dimensions of the window, this option may be used
            to position (or stretch) the window within its pane.
            Style is a string that contains zero or more of the
            characters n, s, e or w. The string can optionally
            contains spaces or commas, but they are ignored. Each
            letter refers to a side (north, south, east, or west)
            that the window will "stick" to. If both n and s
            (or e and w) are specified, the window will be
            stretched to fill the entire height (or width) of
            its cavity.
        width size
            Specify a width for the window. The width will be
            the outer dimension of the window including its
            border, if any. If size is an empty string, or
            if -width is not specified, then the width requested
            internally by the window will be used initially; the
            width may later be adjusted by the movement of sashes
            in the panedwindow. Size may be any value accepted by
            Tk_GetPixels.

        """
        if cnf is None and not kw:
            return self._getconfigure(self._w, 'paneconfigure', tagOrId)
        if isinstance(cnf, str) and not kw:
            return self._getconfigure1(
                self._w, 'paneconfigure', tagOrId, '-'+cnf)
        self.tk.call((self._w, 'paneconfigure', tagOrId) +
                 self._options(cnf, kw))

    paneconfig = paneconfigure

    def panes(self):
        """Returns an ordered list of the child panes."""
        return self.tk.splitlist(self.tk.call(self._w, 'panes'))

# Test:


def _test():
    root = Tk()
    text = "This is Tcl/Tk version %s" % TclVersion
    text += "\nThis should be a cedilla: \xe7"
    label = Label(root, text=text)
    label.pack()
    test = Button(root, text="Click me!",
              command=lambda root=root: root.test.configure(
                  text="[%s]" % root.test['text']))
    test.pack()
    root.test = test
    quit = Button(root, text="QUIT", command=root.destroy)
    quit.pack()
    # The following three commands are needed so the window pops
    # up on top on Windows...
    root.iconify()
    root.update()
    root.deiconify()
    root.mainloop()


if __name__ == '__main__':
    _test()
tkinter/tix.py000064400000226055151153537530007424 0ustar00# Tix.py -- Tix widget wrappers.
#
#       For Tix, see http://tix.sourceforge.net
#
#       - Sudhir Shenoy (sshenoy@gol.com), Dec. 1995.
#         based on an idea of Jean-Marc Lugrin (lugrin@ms.com)
#
# NOTE: In order to minimize changes to Tkinter.py, some of the code here
#       (TixWidget.__init__) has been taken from Tkinter (Widget.__init__)
#       and will break if there are major changes in Tkinter.
#
# The Tix widgets are represented by a class hierarchy in python with proper
# inheritance of base classes.
#
# As a result after creating a 'w = StdButtonBox', I can write
#              w.ok['text'] = 'Who Cares'
#    or              w.ok['bg'] = w['bg']
# or even       w.ok.invoke()
# etc.
#
# Compare the demo tixwidgets.py to the original Tcl program and you will
# appreciate the advantages.
#

import os
import tkinter
from tkinter import *
from tkinter import _cnfmerge

import _tkinter # If this fails your Python may not be configured for Tk

# Some more constants (for consistency with Tkinter)
WINDOW = 'window'
TEXT = 'text'
STATUS = 'status'
IMMEDIATE = 'immediate'
IMAGE = 'image'
IMAGETEXT = 'imagetext'
BALLOON = 'balloon'
AUTO = 'auto'
ACROSSTOP = 'acrosstop'

# A few useful constants for the Grid widget
ASCII = 'ascii'
CELL = 'cell'
COLUMN = 'column'
DECREASING = 'decreasing'
INCREASING = 'increasing'
INTEGER = 'integer'
MAIN = 'main'
MAX = 'max'
REAL = 'real'
ROW = 'row'
S_REGION = 's-region'
X_REGION = 'x-region'
Y_REGION = 'y-region'

# Some constants used by Tkinter dooneevent()
TCL_DONT_WAIT     = 1 << 1
TCL_WINDOW_EVENTS = 1 << 2
TCL_FILE_EVENTS   = 1 << 3
TCL_TIMER_EVENTS  = 1 << 4
TCL_IDLE_EVENTS   = 1 << 5
TCL_ALL_EVENTS    = 0

# BEWARE - this is implemented by copying some code from the Widget class
#          in Tkinter (to override Widget initialization) and is therefore
#          liable to break.

# Could probably add this to Tkinter.Misc
class tixCommand:
    """The tix commands provide access to miscellaneous  elements
    of  Tix's  internal state and the Tix application context.
    Most of the information manipulated by these  commands pertains
    to  the  application  as a whole, or to a screen or
    display, rather than to a particular window.

    This is a mixin class, assumed to be mixed to Tkinter.Tk
    that supports the self.tk.call method.
    """

    def tix_addbitmapdir(self, directory):
        """Tix maintains a list of directories under which
        the  tix_getimage  and tix_getbitmap commands will
        search for image files. The standard bitmap  directory
        is $TIX_LIBRARY/bitmaps. The addbitmapdir command
        adds directory into this list. By  using  this
        command, the  image  files  of an applications can
        also be located using the tix_getimage or tix_getbitmap
        command.
        """
        return self.tk.call('tix', 'addbitmapdir', directory)

    def tix_cget(self, option):
        """Returns  the  current  value  of the configuration
        option given by option. Option may be  any  of  the
        options described in the CONFIGURATION OPTIONS section.
        """
        return self.tk.call('tix', 'cget', option)

    def tix_configure(self, cnf=None, **kw):
        """Query or modify the configuration options of the Tix application
        context. If no option is specified, returns a dictionary all of the
        available options.  If option is specified with no value, then the
        command returns a list describing the one named option (this list
        will be identical to the corresponding sublist of the value
        returned if no option is specified).  If one or more option-value
        pairs are specified, then the command modifies the given option(s)
        to have the given value(s); in this case the command returns an
        empty string. Option may be any of the configuration options.
        """
        # Copied from Tkinter.py
        if kw:
            cnf = _cnfmerge((cnf, kw))
        elif cnf:
            cnf = _cnfmerge(cnf)
        if cnf is None:
            return self._getconfigure('tix', 'configure')
        if isinstance(cnf, str):
            return self._getconfigure1('tix', 'configure', '-'+cnf)
        return self.tk.call(('tix', 'configure') + self._options(cnf))

    def tix_filedialog(self, dlgclass=None):
        """Returns the file selection dialog that may be shared among
        different calls from this application.  This command will create a
        file selection dialog widget when it is called the first time. This
        dialog will be returned by all subsequent calls to tix_filedialog.
        An optional dlgclass parameter can be passed to specified what type
        of file selection dialog widget is desired. Possible options are
        tix FileSelectDialog or tixExFileSelectDialog.
        """
        if dlgclass is not None:
            return self.tk.call('tix', 'filedialog', dlgclass)
        else:
            return self.tk.call('tix', 'filedialog')

    def tix_getbitmap(self, name):
        """Locates a bitmap file of the name name.xpm or name in one of the
        bitmap directories (see the tix_addbitmapdir command above).  By
        using tix_getbitmap, you can avoid hard coding the pathnames of the
        bitmap files in your application. When successful, it returns the
        complete pathname of the bitmap file, prefixed with the character
        '@'.  The returned value can be used to configure the -bitmap
        option of the TK and Tix widgets.
        """
        return self.tk.call('tix', 'getbitmap', name)

    def tix_getimage(self, name):
        """Locates an image file of the name name.xpm, name.xbm or name.ppm
        in one of the bitmap directories (see the addbitmapdir command
        above). If more than one file with the same name (but different
        extensions) exist, then the image type is chosen according to the
        depth of the X display: xbm images are chosen on monochrome
        displays and color images are chosen on color displays. By using
        tix_ getimage, you can avoid hard coding the pathnames of the
        image files in your application. When successful, this command
        returns the name of the newly created image, which can be used to
        configure the -image option of the Tk and Tix widgets.
        """
        return self.tk.call('tix', 'getimage', name)

    def tix_option_get(self, name):
        """Gets  the options  maintained  by  the  Tix
        scheme mechanism. Available options include:

            active_bg       active_fg      bg
            bold_font       dark1_bg       dark1_fg
            dark2_bg        dark2_fg       disabled_fg
            fg              fixed_font     font
            inactive_bg     inactive_fg    input1_bg
            input2_bg       italic_font    light1_bg
            light1_fg       light2_bg      light2_fg
            menu_font       output1_bg     output2_bg
            select_bg       select_fg      selector
            """
        # could use self.tk.globalgetvar('tixOption', name)
        return self.tk.call('tix', 'option', 'get', name)

    def tix_resetoptions(self, newScheme, newFontSet, newScmPrio=None):
        """Resets the scheme and fontset of the Tix application to
        newScheme and newFontSet, respectively.  This affects only those
        widgets created after this call. Therefore, it is best to call the
        resetoptions command before the creation of any widgets in a Tix
        application.

        The optional parameter newScmPrio can be given to reset the
        priority level of the Tk options set by the Tix schemes.

        Because of the way Tk handles the X option database, after Tix has
        been has imported and inited, it is not possible to reset the color
        schemes and font sets using the tix config command.  Instead, the
        tix_resetoptions command must be used.
        """
        if newScmPrio is not None:
            return self.tk.call('tix', 'resetoptions', newScheme, newFontSet, newScmPrio)
        else:
            return self.tk.call('tix', 'resetoptions', newScheme, newFontSet)

class Tk(tkinter.Tk, tixCommand):
    """Toplevel widget of Tix which represents mostly the main window
    of an application. It has an associated Tcl interpreter."""
    def __init__(self, screenName=None, baseName=None, className='Tix'):
        tkinter.Tk.__init__(self, screenName, baseName, className)
        tixlib = os.environ.get('TIX_LIBRARY')
        self.tk.eval('global auto_path; lappend auto_path [file dir [info nameof]]')
        if tixlib is not None:
            self.tk.eval('global auto_path; lappend auto_path {%s}' % tixlib)
            self.tk.eval('global tcl_pkgPath; lappend tcl_pkgPath {%s}' % tixlib)
        # Load Tix - this should work dynamically or statically
        # If it's static, tcl/tix8.1/pkgIndex.tcl should have
        #               'load {} Tix'
        # If it's dynamic under Unix, tcl/tix8.1/pkgIndex.tcl should have
        #               'load libtix8.1.8.3.so Tix'
        self.tk.eval('package require Tix')

    def destroy(self):
        # For safety, remove the delete_window binding before destroy
        self.protocol("WM_DELETE_WINDOW", "")
        tkinter.Tk.destroy(self)

# The Tix 'tixForm' geometry manager
class Form:
    """The Tix Form geometry manager

    Widgets can be arranged by specifying attachments to other widgets.
    See Tix documentation for complete details"""

    def config(self, cnf={}, **kw):
        self.tk.call('tixForm', self._w, *self._options(cnf, kw))

    form = config

    def __setitem__(self, key, value):
        Form.form(self, {key: value})

    def check(self):
        return self.tk.call('tixForm', 'check', self._w)

    def forget(self):
        self.tk.call('tixForm', 'forget', self._w)

    def grid(self, xsize=0, ysize=0):
        if (not xsize) and (not ysize):
            x = self.tk.call('tixForm', 'grid', self._w)
            y = self.tk.splitlist(x)
            z = ()
            for x in y:
                z = z + (self.tk.getint(x),)
            return z
        return self.tk.call('tixForm', 'grid', self._w, xsize, ysize)

    def info(self, option=None):
        if not option:
            return self.tk.call('tixForm', 'info', self._w)
        if option[0] != '-':
            option = '-' + option
        return self.tk.call('tixForm', 'info', self._w, option)

    def slaves(self):
        return [self._nametowidget(x) for x in
                self.tk.splitlist(
                       self.tk.call(
                       'tixForm', 'slaves', self._w))]



tkinter.Widget.__bases__ = tkinter.Widget.__bases__ + (Form,)

class TixWidget(tkinter.Widget):
    """A TixWidget class is used to package all (or most) Tix widgets.

    Widget initialization is extended in two ways:
       1) It is possible to give a list of options which must be part of
       the creation command (so called Tix 'static' options). These cannot be
       given as a 'config' command later.
       2) It is possible to give the name of an existing TK widget. These are
       child widgets created automatically by a Tix mega-widget. The Tk call
       to create these widgets is therefore bypassed in TixWidget.__init__

    Both options are for use by subclasses only.
    """
    def __init__ (self, master=None, widgetName=None,
                static_options=None, cnf={}, kw={}):
        # Merge keywords and dictionary arguments
        if kw:
            cnf = _cnfmerge((cnf, kw))
        else:
            cnf = _cnfmerge(cnf)

        # Move static options into extra. static_options must be
        # a list of keywords (or None).
        extra=()

        # 'options' is always a static option
        if static_options:
            static_options.append('options')
        else:
            static_options = ['options']

        for k,v in list(cnf.items()):
            if k in static_options:
                extra = extra + ('-' + k, v)
                del cnf[k]

        self.widgetName = widgetName
        Widget._setup(self, master, cnf)

        # If widgetName is None, this is a dummy creation call where the
        # corresponding Tk widget has already been created by Tix
        if widgetName:
            self.tk.call(widgetName, self._w, *extra)

        # Non-static options - to be done via a 'config' command
        if cnf:
            Widget.config(self, cnf)

        # Dictionary to hold subwidget names for easier access. We can't
        # use the children list because the public Tix names may not be the
        # same as the pathname component
        self.subwidget_list = {}

    # We set up an attribute access function so that it is possible to
    # do w.ok['text'] = 'Hello' rather than w.subwidget('ok')['text'] = 'Hello'
    # when w is a StdButtonBox.
    # We can even do w.ok.invoke() because w.ok is subclassed from the
    # Button class if you go through the proper constructors
    def __getattr__(self, name):
        if name in self.subwidget_list:
            return self.subwidget_list[name]
        raise AttributeError(name)

    def set_silent(self, value):
        """Set a variable without calling its action routine"""
        self.tk.call('tixSetSilent', self._w, value)

    def subwidget(self, name):
        """Return the named subwidget (which must have been created by
        the sub-class)."""
        n = self._subwidget_name(name)
        if not n:
            raise TclError("Subwidget " + name + " not child of " + self._name)
        # Remove header of name and leading dot
        n = n[len(self._w)+1:]
        return self._nametowidget(n)

    def subwidgets_all(self):
        """Return all subwidgets."""
        names = self._subwidget_names()
        if not names:
            return []
        retlist = []
        for name in names:
            name = name[len(self._w)+1:]
            try:
                retlist.append(self._nametowidget(name))
            except:
                # some of the widgets are unknown e.g. border in LabelFrame
                pass
        return retlist

    def _subwidget_name(self,name):
        """Get a subwidget name (returns a String, not a Widget !)"""
        try:
            return self.tk.call(self._w, 'subwidget', name)
        except TclError:
            return None

    def _subwidget_names(self):
        """Return the name of all subwidgets."""
        try:
            x = self.tk.call(self._w, 'subwidgets', '-all')
            return self.tk.splitlist(x)
        except TclError:
            return None

    def config_all(self, option, value):
        """Set configuration options for all subwidgets (and self)."""
        if option == '':
            return
        elif not isinstance(option, str):
            option = repr(option)
        if not isinstance(value, str):
            value = repr(value)
        names = self._subwidget_names()
        for name in names:
            self.tk.call(name, 'configure', '-' + option, value)
    # These are missing from Tkinter
    def image_create(self, imgtype, cnf={}, master=None, **kw):
        if not master:
            master = self
        if kw and cnf: cnf = _cnfmerge((cnf, kw))
        elif kw: cnf = kw
        options = ()
        for k, v in cnf.items():
            if callable(v):
                v = self._register(v)
            options = options + ('-'+k, v)
        return master.tk.call(('image', 'create', imgtype,) + options)
    def image_delete(self, imgname):
        try:
            self.tk.call('image', 'delete', imgname)
        except TclError:
            # May happen if the root was destroyed
            pass

# Subwidgets are child widgets created automatically by mega-widgets.
# In python, we have to create these subwidgets manually to mirror their
# existence in Tk/Tix.
class TixSubWidget(TixWidget):
    """Subwidget class.

    This is used to mirror child widgets automatically created
    by Tix/Tk as part of a mega-widget in Python (which is not informed
    of this)"""

    def __init__(self, master, name,
               destroy_physically=1, check_intermediate=1):
        if check_intermediate:
            path = master._subwidget_name(name)
            try:
                path = path[len(master._w)+1:]
                plist = path.split('.')
            except:
                plist = []

        if not check_intermediate:
            # immediate descendant
            TixWidget.__init__(self, master, None, None, {'name' : name})
        else:
            # Ensure that the intermediate widgets exist
            parent = master
            for i in range(len(plist) - 1):
                n = '.'.join(plist[:i+1])
                try:
                    w = master._nametowidget(n)
                    parent = w
                except KeyError:
                    # Create the intermediate widget
                    parent = TixSubWidget(parent, plist[i],
                                          destroy_physically=0,
                                          check_intermediate=0)
            # The Tk widget name is in plist, not in name
            if plist:
                name = plist[-1]
            TixWidget.__init__(self, parent, None, None, {'name' : name})
        self.destroy_physically = destroy_physically

    def destroy(self):
        # For some widgets e.g., a NoteBook, when we call destructors,
        # we must be careful not to destroy the frame widget since this
        # also destroys the parent NoteBook thus leading to an exception
        # in Tkinter when it finally calls Tcl to destroy the NoteBook
        for c in list(self.children.values()): c.destroy()
        if self._name in self.master.children:
            del self.master.children[self._name]
        if self._name in self.master.subwidget_list:
            del self.master.subwidget_list[self._name]
        if self.destroy_physically:
            # This is bypassed only for a few widgets
            self.tk.call('destroy', self._w)


# Useful class to create a display style - later shared by many items.
# Contributed by Steffen Kremser
class DisplayStyle:
    """DisplayStyle - handle configuration options shared by
    (multiple) Display Items"""

    def __init__(self, itemtype, cnf={}, *, master=None, **kw):
        if not master:
            if 'refwindow' in kw:
                master = kw['refwindow']
            elif 'refwindow' in cnf:
                master = cnf['refwindow']
            else:
                master = tkinter._get_default_root('create display style')
        self.tk = master.tk
        self.stylename = self.tk.call('tixDisplayStyle', itemtype,
                            *self._options(cnf,kw) )

    def __str__(self):
        return self.stylename

    def _options(self, cnf, kw):
        if kw and cnf:
            cnf = _cnfmerge((cnf, kw))
        elif kw:
            cnf = kw
        opts = ()
        for k, v in cnf.items():
            opts = opts + ('-'+k, v)
        return opts

    def delete(self):
        self.tk.call(self.stylename, 'delete')

    def __setitem__(self,key,value):
        self.tk.call(self.stylename, 'configure', '-%s'%key, value)

    def config(self, cnf={}, **kw):
        return self._getconfigure(
            self.stylename, 'configure', *self._options(cnf,kw))

    def __getitem__(self,key):
        return self.tk.call(self.stylename, 'cget', '-%s'%key)


######################################################
### The Tix Widget classes - in alphabetical order ###
######################################################

class Balloon(TixWidget):
    """Balloon help widget.

    Subwidget       Class
    ---------       -----
    label           Label
    message         Message"""

    # FIXME: It should inherit -superclass tixShell
    def __init__(self, master=None, cnf={}, **kw):
        # static seem to be -installcolormap -initwait -statusbar -cursor
        static = ['options', 'installcolormap', 'initwait', 'statusbar',
                  'cursor']
        TixWidget.__init__(self, master, 'tixBalloon', static, cnf, kw)
        self.subwidget_list['label'] = _dummyLabel(self, 'label',
                                                   destroy_physically=0)
        self.subwidget_list['message'] = _dummyLabel(self, 'message',
                                                     destroy_physically=0)

    def bind_widget(self, widget, cnf={}, **kw):
        """Bind balloon widget to another.
        One balloon widget may be bound to several widgets at the same time"""
        self.tk.call(self._w, 'bind', widget._w, *self._options(cnf, kw))

    def unbind_widget(self, widget):
        self.tk.call(self._w, 'unbind', widget._w)

class ButtonBox(TixWidget):
    """ButtonBox - A container for pushbuttons.
    Subwidgets are the buttons added with the add method.
    """
    def __init__(self, master=None, cnf={}, **kw):
        TixWidget.__init__(self, master, 'tixButtonBox',
                           ['orientation', 'options'], cnf, kw)

    def add(self, name, cnf={}, **kw):
        """Add a button with given name to box."""

        btn = self.tk.call(self._w, 'add', name, *self._options(cnf, kw))
        self.subwidget_list[name] = _dummyButton(self, name)
        return btn

    def invoke(self, name):
        if name in self.subwidget_list:
            self.tk.call(self._w, 'invoke', name)

class ComboBox(TixWidget):
    """ComboBox - an Entry field with a dropdown menu. The user can select a
    choice by either typing in the entry subwidget or selecting from the
    listbox subwidget.

    Subwidget       Class
    ---------       -----
    entry       Entry
    arrow       Button
    slistbox    ScrolledListBox
    tick        Button
    cross       Button : present if created with the fancy option"""

    # FIXME: It should inherit -superclass tixLabelWidget
    def __init__ (self, master=None, cnf={}, **kw):
        TixWidget.__init__(self, master, 'tixComboBox',
                           ['editable', 'dropdown', 'fancy', 'options'],
                           cnf, kw)
        self.subwidget_list['label'] = _dummyLabel(self, 'label')
        self.subwidget_list['entry'] = _dummyEntry(self, 'entry')
        self.subwidget_list['arrow'] = _dummyButton(self, 'arrow')
        self.subwidget_list['slistbox'] = _dummyScrolledListBox(self,
                                                                'slistbox')
        try:
            self.subwidget_list['tick'] = _dummyButton(self, 'tick')
            self.subwidget_list['cross'] = _dummyButton(self, 'cross')
        except TypeError:
            # unavailable when -fancy not specified
            pass

    # align

    def add_history(self, str):
        self.tk.call(self._w, 'addhistory', str)

    def append_history(self, str):
        self.tk.call(self._w, 'appendhistory', str)

    def insert(self, index, str):
        self.tk.call(self._w, 'insert', index, str)

    def pick(self, index):
        self.tk.call(self._w, 'pick', index)

class Control(TixWidget):
    """Control - An entry field with value change arrows.  The user can
    adjust the value by pressing the two arrow buttons or by entering
    the value directly into the entry. The new value will be checked
    against the user-defined upper and lower limits.

    Subwidget       Class
    ---------       -----
    incr       Button
    decr       Button
    entry       Entry
    label       Label"""

    # FIXME: It should inherit -superclass tixLabelWidget
    def __init__ (self, master=None, cnf={}, **kw):
        TixWidget.__init__(self, master, 'tixControl', ['options'], cnf, kw)
        self.subwidget_list['incr'] = _dummyButton(self, 'incr')
        self.subwidget_list['decr'] = _dummyButton(self, 'decr')
        self.subwidget_list['label'] = _dummyLabel(self, 'label')
        self.subwidget_list['entry'] = _dummyEntry(self, 'entry')

    def decrement(self):
        self.tk.call(self._w, 'decr')

    def increment(self):
        self.tk.call(self._w, 'incr')

    def invoke(self):
        self.tk.call(self._w, 'invoke')

    def update(self):
        self.tk.call(self._w, 'update')

class DirList(TixWidget):
    """DirList - displays a list view of a directory, its previous
    directories and its sub-directories. The user can choose one of
    the directories displayed in the list or change to another directory.

    Subwidget       Class
    ---------       -----
    hlist       HList
    hsb              Scrollbar
    vsb              Scrollbar"""

    # FIXME: It should inherit -superclass tixScrolledHList
    def __init__(self, master, cnf={}, **kw):
        TixWidget.__init__(self, master, 'tixDirList', ['options'], cnf, kw)
        self.subwidget_list['hlist'] = _dummyHList(self, 'hlist')
        self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb')
        self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb')

    def chdir(self, dir):
        self.tk.call(self._w, 'chdir', dir)

class DirTree(TixWidget):
    """DirTree - Directory Listing in a hierarchical view.
    Displays a tree view of a directory, its previous directories and its
    sub-directories. The user can choose one of the directories displayed
    in the list or change to another directory.

    Subwidget       Class
    ---------       -----
    hlist           HList
    hsb             Scrollbar
    vsb             Scrollbar"""

    # FIXME: It should inherit -superclass tixScrolledHList
    def __init__(self, master, cnf={}, **kw):
        TixWidget.__init__(self, master, 'tixDirTree', ['options'], cnf, kw)
        self.subwidget_list['hlist'] = _dummyHList(self, 'hlist')
        self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb')
        self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb')

    def chdir(self, dir):
        self.tk.call(self._w, 'chdir', dir)

class DirSelectBox(TixWidget):
    """DirSelectBox - Motif style file select box.
    It is generally used for
    the user to choose a file. FileSelectBox stores the files mostly
    recently selected into a ComboBox widget so that they can be quickly
    selected again.

    Subwidget       Class
    ---------       -----
    selection       ComboBox
    filter          ComboBox
    dirlist         ScrolledListBox
    filelist        ScrolledListBox"""

    def __init__(self, master, cnf={}, **kw):
        TixWidget.__init__(self, master, 'tixDirSelectBox', ['options'], cnf, kw)
        self.subwidget_list['dirlist'] = _dummyDirList(self, 'dirlist')
        self.subwidget_list['dircbx'] = _dummyFileComboBox(self, 'dircbx')

class ExFileSelectBox(TixWidget):
    """ExFileSelectBox - MS Windows style file select box.
    It provides a convenient method for the user to select files.

    Subwidget       Class
    ---------       -----
    cancel       Button
    ok              Button
    hidden       Checkbutton
    types       ComboBox
    dir              ComboBox
    file       ComboBox
    dirlist       ScrolledListBox
    filelist       ScrolledListBox"""

    def __init__(self, master, cnf={}, **kw):
        TixWidget.__init__(self, master, 'tixExFileSelectBox', ['options'], cnf, kw)
        self.subwidget_list['cancel'] = _dummyButton(self, 'cancel')
        self.subwidget_list['ok'] = _dummyButton(self, 'ok')
        self.subwidget_list['hidden'] = _dummyCheckbutton(self, 'hidden')
        self.subwidget_list['types'] = _dummyComboBox(self, 'types')
        self.subwidget_list['dir'] = _dummyComboBox(self, 'dir')
        self.subwidget_list['dirlist'] = _dummyDirList(self, 'dirlist')
        self.subwidget_list['file'] = _dummyComboBox(self, 'file')
        self.subwidget_list['filelist'] = _dummyScrolledListBox(self, 'filelist')

    def filter(self):
        self.tk.call(self._w, 'filter')

    def invoke(self):
        self.tk.call(self._w, 'invoke')


# Should inherit from a Dialog class
class DirSelectDialog(TixWidget):
    """The DirSelectDialog widget presents the directories in the file
    system in a dialog window. The user can use this dialog window to
    navigate through the file system to select the desired directory.

    Subwidgets       Class
    ----------       -----
    dirbox       DirSelectDialog"""

    # FIXME: It should inherit -superclass tixDialogShell
    def __init__(self, master, cnf={}, **kw):
        TixWidget.__init__(self, master, 'tixDirSelectDialog',
                           ['options'], cnf, kw)
        self.subwidget_list['dirbox'] = _dummyDirSelectBox(self, 'dirbox')
        # cancel and ok buttons are missing

    def popup(self):
        self.tk.call(self._w, 'popup')

    def popdown(self):
        self.tk.call(self._w, 'popdown')


# Should inherit from a Dialog class
class ExFileSelectDialog(TixWidget):
    """ExFileSelectDialog - MS Windows style file select dialog.
    It provides a convenient method for the user to select files.

    Subwidgets       Class
    ----------       -----
    fsbox       ExFileSelectBox"""

    # FIXME: It should inherit -superclass tixDialogShell
    def __init__(self, master, cnf={}, **kw):
        TixWidget.__init__(self, master, 'tixExFileSelectDialog',
                           ['options'], cnf, kw)
        self.subwidget_list['fsbox'] = _dummyExFileSelectBox(self, 'fsbox')

    def popup(self):
        self.tk.call(self._w, 'popup')

    def popdown(self):
        self.tk.call(self._w, 'popdown')

class FileSelectBox(TixWidget):
    """ExFileSelectBox - Motif style file select box.
    It is generally used for
    the user to choose a file. FileSelectBox stores the files mostly
    recently selected into a ComboBox widget so that they can be quickly
    selected again.

    Subwidget       Class
    ---------       -----
    selection       ComboBox
    filter          ComboBox
    dirlist         ScrolledListBox
    filelist        ScrolledListBox"""

    def __init__(self, master, cnf={}, **kw):
        TixWidget.__init__(self, master, 'tixFileSelectBox', ['options'], cnf, kw)
        self.subwidget_list['dirlist'] = _dummyScrolledListBox(self, 'dirlist')
        self.subwidget_list['filelist'] = _dummyScrolledListBox(self, 'filelist')
        self.subwidget_list['filter'] = _dummyComboBox(self, 'filter')
        self.subwidget_list['selection'] = _dummyComboBox(self, 'selection')

    def apply_filter(self):              # name of subwidget is same as command
        self.tk.call(self._w, 'filter')

    def invoke(self):
        self.tk.call(self._w, 'invoke')

# Should inherit from a Dialog class
class FileSelectDialog(TixWidget):
    """FileSelectDialog - Motif style file select dialog.

    Subwidgets       Class
    ----------       -----
    btns       StdButtonBox
    fsbox       FileSelectBox"""

    # FIXME: It should inherit -superclass tixStdDialogShell
    def __init__(self, master, cnf={}, **kw):
        TixWidget.__init__(self, master, 'tixFileSelectDialog',
                           ['options'], cnf, kw)
        self.subwidget_list['btns'] = _dummyStdButtonBox(self, 'btns')
        self.subwidget_list['fsbox'] = _dummyFileSelectBox(self, 'fsbox')

    def popup(self):
        self.tk.call(self._w, 'popup')

    def popdown(self):
        self.tk.call(self._w, 'popdown')

class FileEntry(TixWidget):
    """FileEntry - Entry field with button that invokes a FileSelectDialog.
    The user can type in the filename manually. Alternatively, the user can
    press the button widget that sits next to the entry, which will bring
    up a file selection dialog.

    Subwidgets       Class
    ----------       -----
    button       Button
    entry       Entry"""

    # FIXME: It should inherit -superclass tixLabelWidget
    def __init__(self, master, cnf={}, **kw):
        TixWidget.__init__(self, master, 'tixFileEntry',
                           ['dialogtype', 'options'], cnf, kw)
        self.subwidget_list['button'] = _dummyButton(self, 'button')
        self.subwidget_list['entry'] = _dummyEntry(self, 'entry')

    def invoke(self):
        self.tk.call(self._w, 'invoke')

    def file_dialog(self):
        # FIXME: return python object
        pass

class HList(TixWidget, XView, YView):
    """HList - Hierarchy display  widget can be used to display any data
    that have a hierarchical structure, for example, file system directory
    trees. The list entries are indented and connected by branch lines
    according to their places in the hierarchy.

    Subwidgets - None"""

    def __init__ (self,master=None,cnf={}, **kw):
        TixWidget.__init__(self, master, 'tixHList',
                           ['columns', 'options'], cnf, kw)

    def add(self, entry, cnf={}, **kw):
        return self.tk.call(self._w, 'add', entry, *self._options(cnf, kw))

    def add_child(self, parent=None, cnf={}, **kw):
        if not parent:
            parent = ''
        return self.tk.call(
                     self._w, 'addchild', parent, *self._options(cnf, kw))

    def anchor_set(self, entry):
        self.tk.call(self._w, 'anchor', 'set', entry)

    def anchor_clear(self):
        self.tk.call(self._w, 'anchor', 'clear')

    def column_width(self, col=0, width=None, chars=None):
        if not chars:
            return self.tk.call(self._w, 'column', 'width', col, width)
        else:
            return self.tk.call(self._w, 'column', 'width', col,
                                '-char', chars)

    def delete_all(self):
        self.tk.call(self._w, 'delete', 'all')

    def delete_entry(self, entry):
        self.tk.call(self._w, 'delete', 'entry', entry)

    def delete_offsprings(self, entry):
        self.tk.call(self._w, 'delete', 'offsprings', entry)

    def delete_siblings(self, entry):
        self.tk.call(self._w, 'delete', 'siblings', entry)

    def dragsite_set(self, index):
        self.tk.call(self._w, 'dragsite', 'set', index)

    def dragsite_clear(self):
        self.tk.call(self._w, 'dragsite', 'clear')

    def dropsite_set(self, index):
        self.tk.call(self._w, 'dropsite', 'set', index)

    def dropsite_clear(self):
        self.tk.call(self._w, 'dropsite', 'clear')

    def header_create(self, col, cnf={}, **kw):
        self.tk.call(self._w, 'header', 'create', col, *self._options(cnf, kw))

    def header_configure(self, col, cnf={}, **kw):
        if cnf is None:
            return self._getconfigure(self._w, 'header', 'configure', col)
        self.tk.call(self._w, 'header', 'configure', col,
                     *self._options(cnf, kw))

    def header_cget(self,  col, opt):
        return self.tk.call(self._w, 'header', 'cget', col, opt)

    def header_exists(self,  col):
        # A workaround to Tix library bug (issue #25464).
        # The documented command is "exists", but only erroneous "exist" is
        # accepted.
        return self.tk.getboolean(self.tk.call(self._w, 'header', 'exist', col))
    header_exist = header_exists

    def header_delete(self, col):
        self.tk.call(self._w, 'header', 'delete', col)

    def header_size(self, col):
        return self.tk.call(self._w, 'header', 'size', col)

    def hide_entry(self, entry):
        self.tk.call(self._w, 'hide', 'entry', entry)

    def indicator_create(self, entry, cnf={}, **kw):
        self.tk.call(
              self._w, 'indicator', 'create', entry, *self._options(cnf, kw))

    def indicator_configure(self, entry, cnf={}, **kw):
        if cnf is None:
            return self._getconfigure(
                self._w, 'indicator', 'configure', entry)
        self.tk.call(
              self._w, 'indicator', 'configure', entry, *self._options(cnf, kw))

    def indicator_cget(self,  entry, opt):
        return self.tk.call(self._w, 'indicator', 'cget', entry, opt)

    def indicator_exists(self,  entry):
        return self.tk.call (self._w, 'indicator', 'exists', entry)

    def indicator_delete(self, entry):
        self.tk.call(self._w, 'indicator', 'delete', entry)

    def indicator_size(self, entry):
        return self.tk.call(self._w, 'indicator', 'size', entry)

    def info_anchor(self):
        return self.tk.call(self._w, 'info', 'anchor')

    def info_bbox(self, entry):
        return self._getints(
                self.tk.call(self._w, 'info', 'bbox', entry)) or None

    def info_children(self, entry=None):
        c = self.tk.call(self._w, 'info', 'children', entry)
        return self.tk.splitlist(c)

    def info_data(self, entry):
        return self.tk.call(self._w, 'info', 'data', entry)

    def info_dragsite(self):
        return self.tk.call(self._w, 'info', 'dragsite')

    def info_dropsite(self):
        return self.tk.call(self._w, 'info', 'dropsite')

    def info_exists(self, entry):
        return self.tk.call(self._w, 'info', 'exists', entry)

    def info_hidden(self, entry):
        return self.tk.call(self._w, 'info', 'hidden', entry)

    def info_next(self, entry):
        return self.tk.call(self._w, 'info', 'next', entry)

    def info_parent(self, entry):
        return self.tk.call(self._w, 'info', 'parent', entry)

    def info_prev(self, entry):
        return self.tk.call(self._w, 'info', 'prev', entry)

    def info_selection(self):
        c = self.tk.call(self._w, 'info', 'selection')
        return self.tk.splitlist(c)

    def item_cget(self, entry, col, opt):
        return self.tk.call(self._w, 'item', 'cget', entry, col, opt)

    def item_configure(self, entry, col, cnf={}, **kw):
        if cnf is None:
            return self._getconfigure(self._w, 'item', 'configure', entry, col)
        self.tk.call(self._w, 'item', 'configure', entry, col,
              *self._options(cnf, kw))

    def item_create(self, entry, col, cnf={}, **kw):
        self.tk.call(
              self._w, 'item', 'create', entry, col, *self._options(cnf, kw))

    def item_exists(self, entry, col):
        return self.tk.call(self._w, 'item', 'exists', entry, col)

    def item_delete(self, entry, col):
        self.tk.call(self._w, 'item', 'delete', entry, col)

    def entrycget(self, entry, opt):
        return self.tk.call(self._w, 'entrycget', entry, opt)

    def entryconfigure(self, entry, cnf={}, **kw):
        if cnf is None:
            return self._getconfigure(self._w, 'entryconfigure', entry)
        self.tk.call(self._w, 'entryconfigure', entry,
              *self._options(cnf, kw))

    def nearest(self, y):
        return self.tk.call(self._w, 'nearest', y)

    def see(self, entry):
        self.tk.call(self._w, 'see', entry)

    def selection_clear(self, cnf={}, **kw):
        self.tk.call(self._w, 'selection', 'clear', *self._options(cnf, kw))

    def selection_includes(self, entry):
        return self.tk.call(self._w, 'selection', 'includes', entry)

    def selection_set(self, first, last=None):
        self.tk.call(self._w, 'selection', 'set', first, last)

    def show_entry(self, entry):
        return self.tk.call(self._w, 'show', 'entry', entry)

class InputOnly(TixWidget):
    """InputOnly - Invisible widget. Unix only.

    Subwidgets - None"""

    def __init__ (self,master=None,cnf={}, **kw):
        TixWidget.__init__(self, master, 'tixInputOnly', None, cnf, kw)

class LabelEntry(TixWidget):
    """LabelEntry - Entry field with label. Packages an entry widget
    and a label into one mega widget. It can be used to simplify the creation
    of ``entry-form'' type of interface.

    Subwidgets       Class
    ----------       -----
    label       Label
    entry       Entry"""

    def __init__ (self,master=None,cnf={}, **kw):
        TixWidget.__init__(self, master, 'tixLabelEntry',
                           ['labelside','options'], cnf, kw)
        self.subwidget_list['label'] = _dummyLabel(self, 'label')
        self.subwidget_list['entry'] = _dummyEntry(self, 'entry')

class LabelFrame(TixWidget):
    """LabelFrame - Labelled Frame container. Packages a frame widget
    and a label into one mega widget. To create widgets inside a
    LabelFrame widget, one creates the new widgets relative to the
    frame subwidget and manage them inside the frame subwidget.

    Subwidgets       Class
    ----------       -----
    label       Label
    frame       Frame"""

    def __init__ (self,master=None,cnf={}, **kw):
        TixWidget.__init__(self, master, 'tixLabelFrame',
                           ['labelside','options'], cnf, kw)
        self.subwidget_list['label'] = _dummyLabel(self, 'label')
        self.subwidget_list['frame'] = _dummyFrame(self, 'frame')


class ListNoteBook(TixWidget):
    """A ListNoteBook widget is very similar to the TixNoteBook widget:
    it can be used to display many windows in a limited space using a
    notebook metaphor. The notebook is divided into a stack of pages
    (windows). At one time only one of these pages can be shown.
    The user can navigate through these pages by
    choosing the name of the desired page in the hlist subwidget."""

    def __init__(self, master, cnf={}, **kw):
        TixWidget.__init__(self, master, 'tixListNoteBook', ['options'], cnf, kw)
        # Is this necessary? It's not an exposed subwidget in Tix.
        self.subwidget_list['pane'] = _dummyPanedWindow(self, 'pane',
                                                        destroy_physically=0)
        self.subwidget_list['hlist'] = _dummyHList(self, 'hlist')
        self.subwidget_list['shlist'] = _dummyScrolledHList(self, 'shlist')

    def add(self, name, cnf={}, **kw):
        self.tk.call(self._w, 'add', name, *self._options(cnf, kw))
        self.subwidget_list[name] = TixSubWidget(self, name)
        return self.subwidget_list[name]

    def page(self, name):
        return self.subwidget(name)

    def pages(self):
        # Can't call subwidgets_all directly because we don't want .nbframe
        names = self.tk.splitlist(self.tk.call(self._w, 'pages'))
        ret = []
        for x in names:
            ret.append(self.subwidget(x))
        return ret

    def raise_page(self, name):              # raise is a python keyword
        self.tk.call(self._w, 'raise', name)

class Meter(TixWidget):
    """The Meter widget can be used to show the progress of a background
    job which may take a long time to execute.
    """

    def __init__(self, master=None, cnf={}, **kw):
        TixWidget.__init__(self, master, 'tixMeter',
                           ['options'], cnf, kw)

class NoteBook(TixWidget):
    """NoteBook - Multi-page container widget (tabbed notebook metaphor).

    Subwidgets       Class
    ----------       -----
    nbframe       NoteBookFrame
    <pages>       page widgets added dynamically with the add method"""

    def __init__ (self,master=None,cnf={}, **kw):
        TixWidget.__init__(self,master,'tixNoteBook', ['options'], cnf, kw)
        self.subwidget_list['nbframe'] = TixSubWidget(self, 'nbframe',
                                                      destroy_physically=0)

    def add(self, name, cnf={}, **kw):
        self.tk.call(self._w, 'add', name, *self._options(cnf, kw))
        self.subwidget_list[name] = TixSubWidget(self, name)
        return self.subwidget_list[name]

    def delete(self, name):
        self.tk.call(self._w, 'delete', name)
        self.subwidget_list[name].destroy()
        del self.subwidget_list[name]

    def page(self, name):
        return self.subwidget(name)

    def pages(self):
        # Can't call subwidgets_all directly because we don't want .nbframe
        names = self.tk.splitlist(self.tk.call(self._w, 'pages'))
        ret = []
        for x in names:
            ret.append(self.subwidget(x))
        return ret

    def raise_page(self, name):              # raise is a python keyword
        self.tk.call(self._w, 'raise', name)

    def raised(self):
        return self.tk.call(self._w, 'raised')

class NoteBookFrame(TixWidget):
    # FIXME: This is dangerous to expose to be called on its own.
    pass

class OptionMenu(TixWidget):
    """OptionMenu - creates a menu button of options.

    Subwidget       Class
    ---------       -----
    menubutton      Menubutton
    menu            Menu"""

    def __init__(self, master, cnf={}, **kw):
        TixWidget.__init__(self, master, 'tixOptionMenu', ['options'], cnf, kw)
        self.subwidget_list['menubutton'] = _dummyMenubutton(self, 'menubutton')
        self.subwidget_list['menu'] = _dummyMenu(self, 'menu')

    def add_command(self, name, cnf={}, **kw):
        self.tk.call(self._w, 'add', 'command', name, *self._options(cnf, kw))

    def add_separator(self, name, cnf={}, **kw):
        self.tk.call(self._w, 'add', 'separator', name, *self._options(cnf, kw))

    def delete(self, name):
        self.tk.call(self._w, 'delete', name)

    def disable(self, name):
        self.tk.call(self._w, 'disable', name)

    def enable(self, name):
        self.tk.call(self._w, 'enable', name)

class PanedWindow(TixWidget):
    """PanedWindow - Multi-pane container widget
    allows the user to interactively manipulate the sizes of several
    panes. The panes can be arranged either vertically or horizontally.The
    user changes the sizes of the panes by dragging the resize handle
    between two panes.

    Subwidgets       Class
    ----------       -----
    <panes>       g/p widgets added dynamically with the add method."""

    def __init__(self, master, cnf={}, **kw):
        TixWidget.__init__(self, master, 'tixPanedWindow', ['orientation', 'options'], cnf, kw)

    # add delete forget panecget paneconfigure panes setsize
    def add(self, name, cnf={}, **kw):
        self.tk.call(self._w, 'add', name, *self._options(cnf, kw))
        self.subwidget_list[name] = TixSubWidget(self, name,
                                                 check_intermediate=0)
        return self.subwidget_list[name]

    def delete(self, name):
        self.tk.call(self._w, 'delete', name)
        self.subwidget_list[name].destroy()
        del self.subwidget_list[name]

    def forget(self, name):
        self.tk.call(self._w, 'forget', name)

    def panecget(self,  entry, opt):
        return self.tk.call(self._w, 'panecget', entry, opt)

    def paneconfigure(self, entry, cnf={}, **kw):
        if cnf is None:
            return self._getconfigure(self._w, 'paneconfigure', entry)
        self.tk.call(self._w, 'paneconfigure', entry, *self._options(cnf, kw))

    def panes(self):
        names = self.tk.splitlist(self.tk.call(self._w, 'panes'))
        return [self.subwidget(x) for x in names]

class PopupMenu(TixWidget):
    """PopupMenu widget can be used as a replacement of the tk_popup command.
    The advantage of the Tix PopupMenu widget is it requires less application
    code to manipulate.


    Subwidgets       Class
    ----------       -----
    menubutton       Menubutton
    menu       Menu"""

    # FIXME: It should inherit -superclass tixShell
    def __init__(self, master, cnf={}, **kw):
        TixWidget.__init__(self, master, 'tixPopupMenu', ['options'], cnf, kw)
        self.subwidget_list['menubutton'] = _dummyMenubutton(self, 'menubutton')
        self.subwidget_list['menu'] = _dummyMenu(self, 'menu')

    def bind_widget(self, widget):
        self.tk.call(self._w, 'bind', widget._w)

    def unbind_widget(self, widget):
        self.tk.call(self._w, 'unbind', widget._w)

    def post_widget(self, widget, x, y):
        self.tk.call(self._w, 'post', widget._w, x, y)

class ResizeHandle(TixWidget):
    """Internal widget to draw resize handles on Scrolled widgets."""
    def __init__(self, master, cnf={}, **kw):
        # There seems to be a Tix bug rejecting the configure method
        # Let's try making the flags -static
        flags = ['options', 'command', 'cursorfg', 'cursorbg',
                 'handlesize', 'hintcolor', 'hintwidth',
                 'x', 'y']
        # In fact, x y height width are configurable
        TixWidget.__init__(self, master, 'tixResizeHandle',
                           flags, cnf, kw)

    def attach_widget(self, widget):
        self.tk.call(self._w, 'attachwidget', widget._w)

    def detach_widget(self, widget):
        self.tk.call(self._w, 'detachwidget', widget._w)

    def hide(self, widget):
        self.tk.call(self._w, 'hide', widget._w)

    def show(self, widget):
        self.tk.call(self._w, 'show', widget._w)

class ScrolledHList(TixWidget):
    """ScrolledHList - HList with automatic scrollbars."""

    # FIXME: It should inherit -superclass tixScrolledWidget
    def __init__(self, master, cnf={}, **kw):
        TixWidget.__init__(self, master, 'tixScrolledHList', ['options'],
                           cnf, kw)
        self.subwidget_list['hlist'] = _dummyHList(self, 'hlist')
        self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb')
        self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb')

class ScrolledListBox(TixWidget):
    """ScrolledListBox - Listbox with automatic scrollbars."""

    # FIXME: It should inherit -superclass tixScrolledWidget
    def __init__(self, master, cnf={}, **kw):
        TixWidget.__init__(self, master, 'tixScrolledListBox', ['options'], cnf, kw)
        self.subwidget_list['listbox'] = _dummyListbox(self, 'listbox')
        self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb')
        self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb')

class ScrolledText(TixWidget):
    """ScrolledText - Text with automatic scrollbars."""

    # FIXME: It should inherit -superclass tixScrolledWidget
    def __init__(self, master, cnf={}, **kw):
        TixWidget.__init__(self, master, 'tixScrolledText', ['options'], cnf, kw)
        self.subwidget_list['text'] = _dummyText(self, 'text')
        self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb')
        self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb')

class ScrolledTList(TixWidget):
    """ScrolledTList - TList with automatic scrollbars."""

    # FIXME: It should inherit -superclass tixScrolledWidget
    def __init__(self, master, cnf={}, **kw):
        TixWidget.__init__(self, master, 'tixScrolledTList', ['options'],
                           cnf, kw)
        self.subwidget_list['tlist'] = _dummyTList(self, 'tlist')
        self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb')
        self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb')

class ScrolledWindow(TixWidget):
    """ScrolledWindow - Window with automatic scrollbars."""

    # FIXME: It should inherit -superclass tixScrolledWidget
    def __init__(self, master, cnf={}, **kw):
        TixWidget.__init__(self, master, 'tixScrolledWindow', ['options'], cnf, kw)
        self.subwidget_list['window'] = _dummyFrame(self, 'window')
        self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb')
        self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb')

class Select(TixWidget):
    """Select - Container of button subwidgets. It can be used to provide
    radio-box or check-box style of selection options for the user.

    Subwidgets are buttons added dynamically using the add method."""

    # FIXME: It should inherit -superclass tixLabelWidget
    def __init__(self, master, cnf={}, **kw):
        TixWidget.__init__(self, master, 'tixSelect',
                           ['allowzero', 'radio', 'orientation', 'labelside',
                            'options'],
                           cnf, kw)
        self.subwidget_list['label'] = _dummyLabel(self, 'label')

    def add(self, name, cnf={}, **kw):
        self.tk.call(self._w, 'add', name, *self._options(cnf, kw))
        self.subwidget_list[name] = _dummyButton(self, name)
        return self.subwidget_list[name]

    def invoke(self, name):
        self.tk.call(self._w, 'invoke', name)

class Shell(TixWidget):
    """Toplevel window.

    Subwidgets - None"""

    def __init__ (self,master=None,cnf={}, **kw):
        TixWidget.__init__(self, master, 'tixShell', ['options', 'title'], cnf, kw)

class DialogShell(TixWidget):
    """Toplevel window, with popup popdown and center methods.
    It tells the window manager that it is a dialog window and should be
    treated specially. The exact treatment depends on the treatment of
    the window manager.

    Subwidgets - None"""

    # FIXME: It should inherit from  Shell
    def __init__ (self,master=None,cnf={}, **kw):
        TixWidget.__init__(self, master,
                           'tixDialogShell',
                           ['options', 'title', 'mapped',
                            'minheight', 'minwidth',
                            'parent', 'transient'], cnf, kw)

    def popdown(self):
        self.tk.call(self._w, 'popdown')

    def popup(self):
        self.tk.call(self._w, 'popup')

    def center(self):
        self.tk.call(self._w, 'center')

class StdButtonBox(TixWidget):
    """StdButtonBox - Standard Button Box (OK, Apply, Cancel and Help) """

    def __init__(self, master=None, cnf={}, **kw):
        TixWidget.__init__(self, master, 'tixStdButtonBox',
                           ['orientation', 'options'], cnf, kw)
        self.subwidget_list['ok'] = _dummyButton(self, 'ok')
        self.subwidget_list['apply'] = _dummyButton(self, 'apply')
        self.subwidget_list['cancel'] = _dummyButton(self, 'cancel')
        self.subwidget_list['help'] = _dummyButton(self, 'help')

    def invoke(self, name):
        if name in self.subwidget_list:
            self.tk.call(self._w, 'invoke', name)

class TList(TixWidget, XView, YView):
    """TList - Hierarchy display widget which can be
    used to display data in a tabular format. The list entries of a TList
    widget are similar to the entries in the Tk listbox widget. The main
    differences are (1) the TList widget can display the list entries in a
    two dimensional format and (2) you can use graphical images as well as
    multiple colors and fonts for the list entries.

    Subwidgets - None"""

    def __init__ (self,master=None,cnf={}, **kw):
        TixWidget.__init__(self, master, 'tixTList', ['options'], cnf, kw)

    def active_set(self, index):
        self.tk.call(self._w, 'active', 'set', index)

    def active_clear(self):
        self.tk.call(self._w, 'active', 'clear')

    def anchor_set(self, index):
        self.tk.call(self._w, 'anchor', 'set', index)

    def anchor_clear(self):
        self.tk.call(self._w, 'anchor', 'clear')

    def delete(self, from_, to=None):
        self.tk.call(self._w, 'delete', from_, to)

    def dragsite_set(self, index):
        self.tk.call(self._w, 'dragsite', 'set', index)

    def dragsite_clear(self):
        self.tk.call(self._w, 'dragsite', 'clear')

    def dropsite_set(self, index):
        self.tk.call(self._w, 'dropsite', 'set', index)

    def dropsite_clear(self):
        self.tk.call(self._w, 'dropsite', 'clear')

    def insert(self, index, cnf={}, **kw):
        self.tk.call(self._w, 'insert', index, *self._options(cnf, kw))

    def info_active(self):
        return self.tk.call(self._w, 'info', 'active')

    def info_anchor(self):
        return self.tk.call(self._w, 'info', 'anchor')

    def info_down(self, index):
        return self.tk.call(self._w, 'info', 'down', index)

    def info_left(self, index):
        return self.tk.call(self._w, 'info', 'left', index)

    def info_right(self, index):
        return self.tk.call(self._w, 'info', 'right', index)

    def info_selection(self):
        c = self.tk.call(self._w, 'info', 'selection')
        return self.tk.splitlist(c)

    def info_size(self):
        return self.tk.call(self._w, 'info', 'size')

    def info_up(self, index):
        return self.tk.call(self._w, 'info', 'up', index)

    def nearest(self, x, y):
        return self.tk.call(self._w, 'nearest', x, y)

    def see(self, index):
        self.tk.call(self._w, 'see', index)

    def selection_clear(self, cnf={}, **kw):
        self.tk.call(self._w, 'selection', 'clear', *self._options(cnf, kw))

    def selection_includes(self, index):
        return self.tk.call(self._w, 'selection', 'includes', index)

    def selection_set(self, first, last=None):
        self.tk.call(self._w, 'selection', 'set', first, last)

class Tree(TixWidget):
    """Tree - The tixTree widget can be used to display hierarchical
    data in a tree form. The user can adjust
    the view of the tree by opening or closing parts of the tree."""

    # FIXME: It should inherit -superclass tixScrolledWidget
    def __init__(self, master=None, cnf={}, **kw):
        TixWidget.__init__(self, master, 'tixTree',
                           ['options'], cnf, kw)
        self.subwidget_list['hlist'] = _dummyHList(self, 'hlist')
        self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb')
        self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb')

    def autosetmode(self):
        '''This command calls the setmode method for all the entries in this
     Tree widget: if an entry has no child entries, its mode is set to
     none. Otherwise, if the entry has any hidden child entries, its mode is
     set to open; otherwise its mode is set to close.'''
        self.tk.call(self._w, 'autosetmode')

    def close(self, entrypath):
        '''Close the entry given by entryPath if its mode is close.'''
        self.tk.call(self._w, 'close', entrypath)

    def getmode(self, entrypath):
        '''Returns the current mode of the entry given by entryPath.'''
        return self.tk.call(self._w, 'getmode', entrypath)

    def open(self, entrypath):
        '''Open the entry given by entryPath if its mode is open.'''
        self.tk.call(self._w, 'open', entrypath)

    def setmode(self, entrypath, mode='none'):
        '''This command is used to indicate whether the entry given by
     entryPath has children entries and whether the children are visible. mode
     must be one of open, close or none. If mode is set to open, a (+)
     indicator is drawn next the entry. If mode is set to close, a (-)
     indicator is drawn next the entry. If mode is set to none, no
     indicators will be drawn for this entry. The default mode is none. The
     open mode indicates the entry has hidden children and this entry can be
     opened by the user. The close mode indicates that all the children of the
     entry are now visible and the entry can be closed by the user.'''
        self.tk.call(self._w, 'setmode', entrypath, mode)


# Could try subclassing Tree for CheckList - would need another arg to init
class CheckList(TixWidget):
    """The CheckList widget
    displays a list of items to be selected by the user. CheckList acts
    similarly to the Tk checkbutton or radiobutton widgets, except it is
    capable of handling many more items than checkbuttons or radiobuttons.
    """
    # FIXME: It should inherit -superclass tixTree
    def __init__(self, master=None, cnf={}, **kw):
        TixWidget.__init__(self, master, 'tixCheckList',
                           ['options', 'radio'], cnf, kw)
        self.subwidget_list['hlist'] = _dummyHList(self, 'hlist')
        self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb')
        self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb')

    def autosetmode(self):
        '''This command calls the setmode method for all the entries in this
     Tree widget: if an entry has no child entries, its mode is set to
     none. Otherwise, if the entry has any hidden child entries, its mode is
     set to open; otherwise its mode is set to close.'''
        self.tk.call(self._w, 'autosetmode')

    def close(self, entrypath):
        '''Close the entry given by entryPath if its mode is close.'''
        self.tk.call(self._w, 'close', entrypath)

    def getmode(self, entrypath):
        '''Returns the current mode of the entry given by entryPath.'''
        return self.tk.call(self._w, 'getmode', entrypath)

    def open(self, entrypath):
        '''Open the entry given by entryPath if its mode is open.'''
        self.tk.call(self._w, 'open', entrypath)

    def getselection(self, mode='on'):
        '''Returns a list of items whose status matches status. If status is
     not specified, the list of items in the "on" status will be returned.
     Mode can be on, off, default'''
        return self.tk.splitlist(self.tk.call(self._w, 'getselection', mode))

    def getstatus(self, entrypath):
        '''Returns the current status of entryPath.'''
        return self.tk.call(self._w, 'getstatus', entrypath)

    def setstatus(self, entrypath, mode='on'):
        '''Sets the status of entryPath to be status. A bitmap will be
     displayed next to the entry its status is on, off or default.'''
        self.tk.call(self._w, 'setstatus', entrypath, mode)


###########################################################################
### The subclassing below is used to instantiate the subwidgets in each ###
### mega widget. This allows us to access their methods directly.       ###
###########################################################################

class _dummyButton(Button, TixSubWidget):
    def __init__(self, master, name, destroy_physically=1):
        TixSubWidget.__init__(self, master, name, destroy_physically)

class _dummyCheckbutton(Checkbutton, TixSubWidget):
    def __init__(self, master, name, destroy_physically=1):
        TixSubWidget.__init__(self, master, name, destroy_physically)

class _dummyEntry(Entry, TixSubWidget):
    def __init__(self, master, name, destroy_physically=1):
        TixSubWidget.__init__(self, master, name, destroy_physically)

class _dummyFrame(Frame, TixSubWidget):
    def __init__(self, master, name, destroy_physically=1):
        TixSubWidget.__init__(self, master, name, destroy_physically)

class _dummyLabel(Label, TixSubWidget):
    def __init__(self, master, name, destroy_physically=1):
        TixSubWidget.__init__(self, master, name, destroy_physically)

class _dummyListbox(Listbox, TixSubWidget):
    def __init__(self, master, name, destroy_physically=1):
        TixSubWidget.__init__(self, master, name, destroy_physically)

class _dummyMenu(Menu, TixSubWidget):
    def __init__(self, master, name, destroy_physically=1):
        TixSubWidget.__init__(self, master, name, destroy_physically)

class _dummyMenubutton(Menubutton, TixSubWidget):
    def __init__(self, master, name, destroy_physically=1):
        TixSubWidget.__init__(self, master, name, destroy_physically)

class _dummyScrollbar(Scrollbar, TixSubWidget):
    def __init__(self, master, name, destroy_physically=1):
        TixSubWidget.__init__(self, master, name, destroy_physically)

class _dummyText(Text, TixSubWidget):
    def __init__(self, master, name, destroy_physically=1):
        TixSubWidget.__init__(self, master, name, destroy_physically)

class _dummyScrolledListBox(ScrolledListBox, TixSubWidget):
    def __init__(self, master, name, destroy_physically=1):
        TixSubWidget.__init__(self, master, name, destroy_physically)
        self.subwidget_list['listbox'] = _dummyListbox(self, 'listbox')
        self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb')
        self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb')

class _dummyHList(HList, TixSubWidget):
    def __init__(self, master, name, destroy_physically=1):
        TixSubWidget.__init__(self, master, name, destroy_physically)

class _dummyScrolledHList(ScrolledHList, TixSubWidget):
    def __init__(self, master, name, destroy_physically=1):
        TixSubWidget.__init__(self, master, name, destroy_physically)
        self.subwidget_list['hlist'] = _dummyHList(self, 'hlist')
        self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb')
        self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb')

class _dummyTList(TList, TixSubWidget):
    def __init__(self, master, name, destroy_physically=1):
        TixSubWidget.__init__(self, master, name, destroy_physically)

class _dummyComboBox(ComboBox, TixSubWidget):
    def __init__(self, master, name, destroy_physically=1):
        TixSubWidget.__init__(self, master, name, ['fancy',destroy_physically])
        self.subwidget_list['label'] = _dummyLabel(self, 'label')
        self.subwidget_list['entry'] = _dummyEntry(self, 'entry')
        self.subwidget_list['arrow'] = _dummyButton(self, 'arrow')

        self.subwidget_list['slistbox'] = _dummyScrolledListBox(self,
                                                                'slistbox')
        try:
            self.subwidget_list['tick'] = _dummyButton(self, 'tick')
            #cross Button : present if created with the fancy option
            self.subwidget_list['cross'] = _dummyButton(self, 'cross')
        except TypeError:
            # unavailable when -fancy not specified
            pass

class _dummyDirList(DirList, TixSubWidget):
    def __init__(self, master, name, destroy_physically=1):
        TixSubWidget.__init__(self, master, name, destroy_physically)
        self.subwidget_list['hlist'] = _dummyHList(self, 'hlist')
        self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb')
        self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb')

class _dummyDirSelectBox(DirSelectBox, TixSubWidget):
    def __init__(self, master, name, destroy_physically=1):
        TixSubWidget.__init__(self, master, name, destroy_physically)
        self.subwidget_list['dirlist'] = _dummyDirList(self, 'dirlist')
        self.subwidget_list['dircbx'] = _dummyFileComboBox(self, 'dircbx')

class _dummyExFileSelectBox(ExFileSelectBox, TixSubWidget):
    def __init__(self, master, name, destroy_physically=1):
        TixSubWidget.__init__(self, master, name, destroy_physically)
        self.subwidget_list['cancel'] = _dummyButton(self, 'cancel')
        self.subwidget_list['ok'] = _dummyButton(self, 'ok')
        self.subwidget_list['hidden'] = _dummyCheckbutton(self, 'hidden')
        self.subwidget_list['types'] = _dummyComboBox(self, 'types')
        self.subwidget_list['dir'] = _dummyComboBox(self, 'dir')
        self.subwidget_list['dirlist'] = _dummyScrolledListBox(self, 'dirlist')
        self.subwidget_list['file'] = _dummyComboBox(self, 'file')
        self.subwidget_list['filelist'] = _dummyScrolledListBox(self, 'filelist')

class _dummyFileSelectBox(FileSelectBox, TixSubWidget):
    def __init__(self, master, name, destroy_physically=1):
        TixSubWidget.__init__(self, master, name, destroy_physically)
        self.subwidget_list['dirlist'] = _dummyScrolledListBox(self, 'dirlist')
        self.subwidget_list['filelist'] = _dummyScrolledListBox(self, 'filelist')
        self.subwidget_list['filter'] = _dummyComboBox(self, 'filter')
        self.subwidget_list['selection'] = _dummyComboBox(self, 'selection')

class _dummyFileComboBox(ComboBox, TixSubWidget):
    def __init__(self, master, name, destroy_physically=1):
        TixSubWidget.__init__(self, master, name, destroy_physically)
        self.subwidget_list['dircbx'] = _dummyComboBox(self, 'dircbx')

class _dummyStdButtonBox(StdButtonBox, TixSubWidget):
    def __init__(self, master, name, destroy_physically=1):
        TixSubWidget.__init__(self, master, name, destroy_physically)
        self.subwidget_list['ok'] = _dummyButton(self, 'ok')
        self.subwidget_list['apply'] = _dummyButton(self, 'apply')
        self.subwidget_list['cancel'] = _dummyButton(self, 'cancel')
        self.subwidget_list['help'] = _dummyButton(self, 'help')

class _dummyNoteBookFrame(NoteBookFrame, TixSubWidget):
    def __init__(self, master, name, destroy_physically=0):
        TixSubWidget.__init__(self, master, name, destroy_physically)

class _dummyPanedWindow(PanedWindow, TixSubWidget):
    def __init__(self, master, name, destroy_physically=1):
        TixSubWidget.__init__(self, master, name, destroy_physically)

########################
### Utility Routines ###
########################

#mike Should tixDestroy be exposed as a wrapper? - but not for widgets.

def OptionName(widget):
    '''Returns the qualified path name for the widget. Normally used to set
    default options for subwidgets. See tixwidgets.py'''
    return widget.tk.call('tixOptionName', widget._w)

# Called with a dictionary argument of the form
# {'*.c':'C source files', '*.txt':'Text Files', '*':'All files'}
# returns a string which can be used to configure the fsbox file types
# in an ExFileSelectBox. i.e.,
# '{{*} {* - All files}} {{*.c} {*.c - C source files}} {{*.txt} {*.txt - Text Files}}'
def FileTypeList(dict):
    s = ''
    for type in dict.keys():
        s = s + '{{' + type + '} {' + type + ' - ' + dict[type] + '}} '
    return s

# Still to be done:
# tixIconView
class CObjView(TixWidget):
    """This file implements the Canvas Object View widget. This is a base
    class of IconView. It implements automatic placement/adjustment of the
    scrollbars according to the canvas objects inside the canvas subwidget.
    The scrollbars are adjusted so that the canvas is just large enough
    to see all the objects.
    """
    # FIXME: It should inherit -superclass tixScrolledWidget
    pass


class Grid(TixWidget, XView, YView):
    '''The Tix Grid command creates a new window  and makes it into a
    tixGrid widget. Additional options, may be specified on the command
    line or in the option database to configure aspects such as its cursor
    and relief.

    A Grid widget displays its contents in a two dimensional grid of cells.
    Each cell may contain one Tix display item, which may be in text,
    graphics or other formats. See the DisplayStyle class for more information
    about Tix display items. Individual cells, or groups of cells, can be
    formatted with a wide range of attributes, such as its color, relief and
    border.

    Subwidgets - None'''
    # valid specific resources as of Tk 8.4
    # editdonecmd, editnotifycmd, floatingcols, floatingrows, formatcmd,
    # highlightbackground, highlightcolor, leftmargin, itemtype, selectmode,
    # selectunit, topmargin,
    def __init__(self, master=None, cnf={}, **kw):
        static= []
        self.cnf= cnf
        TixWidget.__init__(self, master, 'tixGrid', static, cnf, kw)

    # valid options as of Tk 8.4
    # anchor, bdtype, cget, configure, delete, dragsite, dropsite, entrycget,
    # edit, entryconfigure, format, geometryinfo, info, index, move, nearest,
    # selection, set, size, unset, xview, yview
    def anchor_clear(self):
        """Removes the selection anchor."""
        self.tk.call(self, 'anchor', 'clear')

    def anchor_get(self):
        "Get the (x,y) coordinate of the current anchor cell"
        return self._getints(self.tk.call(self, 'anchor', 'get'))

    def anchor_set(self, x, y):
        """Set the selection anchor to the cell at (x, y)."""
        self.tk.call(self, 'anchor', 'set', x, y)

    def delete_row(self, from_, to=None):
        """Delete rows between from_ and to inclusive.
        If to is not provided,  delete only row at from_"""
        if to is None:
            self.tk.call(self, 'delete', 'row', from_)
        else:
            self.tk.call(self, 'delete', 'row', from_, to)

    def delete_column(self, from_, to=None):
        """Delete columns between from_ and to inclusive.
        If to is not provided,  delete only column at from_"""
        if to is None:
            self.tk.call(self, 'delete', 'column', from_)
        else:
            self.tk.call(self, 'delete', 'column', from_, to)

    def edit_apply(self):
        """If any cell is being edited, de-highlight the cell  and  applies
        the changes."""
        self.tk.call(self, 'edit', 'apply')

    def edit_set(self, x, y):
        """Highlights  the  cell  at  (x, y) for editing, if the -editnotify
        command returns True for this cell."""
        self.tk.call(self, 'edit', 'set', x, y)

    def entrycget(self, x, y, option):
        "Get the option value for cell at (x,y)"
        if option and option[0] != '-':
            option = '-' + option
        return self.tk.call(self, 'entrycget', x, y, option)

    def entryconfigure(self, x, y, cnf=None, **kw):
        return self._configure(('entryconfigure', x, y), cnf, kw)

    # def format
    # def index

    def info_exists(self, x, y):
        "Return True if display item exists at (x,y)"
        return self._getboolean(self.tk.call(self, 'info', 'exists', x, y))

    def info_bbox(self, x, y):
        # This seems to always return '', at least for 'text' displayitems
        return self.tk.call(self, 'info', 'bbox', x, y)

    def move_column(self, from_, to, offset):
        """Moves the range of columns from position FROM through TO by
        the distance indicated by OFFSET. For example, move_column(2, 4, 1)
        moves the columns 2,3,4 to columns 3,4,5."""
        self.tk.call(self, 'move', 'column', from_, to, offset)

    def move_row(self, from_, to, offset):
        """Moves the range of rows from position FROM through TO by
        the distance indicated by OFFSET.
        For example, move_row(2, 4, 1) moves the rows 2,3,4 to rows 3,4,5."""
        self.tk.call(self, 'move', 'row', from_, to, offset)

    def nearest(self, x, y):
        "Return coordinate of cell nearest pixel coordinate (x,y)"
        return self._getints(self.tk.call(self, 'nearest', x, y))

    # def selection adjust
    # def selection clear
    # def selection includes
    # def selection set
    # def selection toggle

    def set(self, x, y, itemtype=None, **kw):
        args= self._options(self.cnf, kw)
        if itemtype is not None:
            args= ('-itemtype', itemtype) + args
        self.tk.call(self, 'set', x, y, *args)

    def size_column(self, index, **kw):
        """Queries or sets the size of the column given by
        INDEX.  INDEX may be any non-negative
        integer that gives the position of a given column.
        INDEX can also be the string "default"; in this case, this command
        queries or sets the default size of all columns.
        When no option-value pair is given, this command returns a tuple
        containing the current size setting of the given column.  When
        option-value pairs are given, the corresponding options of the
        size setting of the given column are changed. Options may be one
        of the following:
              pad0 pixels
                     Specifies the paddings to the left of a column.
              pad1 pixels
                     Specifies the paddings to the right of a column.
              size val
                     Specifies the width of a column.  Val may be:
                     "auto" -- the width of the column is set to the
                     width of the widest cell in the column;
                     a valid Tk screen distance unit;
                     or a real number following by the word chars
                     (e.g. 3.4chars) that sets the width of the column to the
                     given number of characters."""
        return self.tk.splitlist(self.tk.call(self._w, 'size', 'column', index,
                             *self._options({}, kw)))

    def size_row(self, index, **kw):
        """Queries or sets the size of the row given by
        INDEX. INDEX may be any non-negative
        integer that gives the position of a given row .
        INDEX can also be the string "default"; in this case, this command
        queries or sets the default size of all rows.
        When no option-value pair is given, this command returns a list con-
        taining the current size setting of the given row . When option-value
        pairs are given, the corresponding options of the size setting of the
        given row are changed. Options may be one of the following:
              pad0 pixels
                     Specifies the paddings to the top of a row.
              pad1 pixels
                     Specifies the paddings to the bottom of a row.
              size val
                     Specifies the height of a row.  Val may be:
                     "auto" -- the height of the row is set to the
                     height of the highest cell in the row;
                     a valid Tk screen distance unit;
                     or a real number following by the word chars
                     (e.g. 3.4chars) that sets the height of the row to the
                     given number of characters."""
        return self.tk.splitlist(self.tk.call(
                    self, 'size', 'row', index, *self._options({}, kw)))

    def unset(self, x, y):
        """Clears the cell at (x, y) by removing its display item."""
        self.tk.call(self._w, 'unset', x, y)


class ScrolledGrid(Grid):
    '''Scrolled Grid widgets'''

    # FIXME: It should inherit -superclass tixScrolledWidget
    def __init__(self, master=None, cnf={}, **kw):
        static= []
        self.cnf= cnf
        TixWidget.__init__(self, master, 'tixScrolledGrid', static, cnf, kw)
tkinter/colorchooser.py000064400000005101151153537530011304 0ustar00# tk common color chooser dialogue
#
# this module provides an interface to the native color dialogue
# available in Tk 4.2 and newer.
#
# written by Fredrik Lundh, May 1997
#
# fixed initialcolor handling in August 1998
#


from tkinter.commondialog import Dialog


class Chooser(Dialog):
    """Create a dialog for the tk_chooseColor command.

    Args:
        master: The master widget for this dialog.  If not provided,
            defaults to options['parent'] (if defined).
        options: Dictionary of options for the tk_chooseColor call.
            initialcolor: Specifies the selected color when the
                dialog is first displayed.  This can be a tk color
                string or a 3-tuple of ints in the range (0, 255)
                for an RGB triplet.
            parent: The parent window of the color dialog.  The
                color dialog is displayed on top of this.
            title: A string for the title of the dialog box.
    """

    command = "tk_chooseColor"

    def _fixoptions(self):
        """Ensure initialcolor is a tk color string.

        Convert initialcolor from a RGB triplet to a color string.
        """
        try:
            color = self.options["initialcolor"]
            if isinstance(color, tuple):
                # Assume an RGB triplet.
                self.options["initialcolor"] = "#%02x%02x%02x" % color
        except KeyError:
            pass

    def _fixresult(self, widget, result):
        """Adjust result returned from call to tk_chooseColor.

        Return both an RGB tuple of ints in the range (0, 255) and the
        tk color string in the form #rrggbb.
        """
        # Result can be many things: an empty tuple, an empty string, or
        # a _tkinter.Tcl_Obj, so this somewhat weird check handles that.
        if not result or not str(result):
            return None, None  # canceled

        # To simplify application code, the color chooser returns
        # an RGB tuple together with the Tk color string.
        r, g, b = widget.winfo_rgb(result)
        return (r//256, g//256, b//256), str(result)


#
# convenience stuff

def askcolor(color=None, **options):
    """Display dialog window for selection of a color.

    Convenience wrapper for the Chooser class.  Displays the color
    chooser dialog with color as the initial value.
    """

    if color:
        options = options.copy()
        options["initialcolor"] = color

    return Chooser(**options).show()


# --------------------------------------------------------------------
# test stuff

if __name__ == "__main__":
    print("color", askcolor())
tkinter/ttk.py000064400000157343151153537530007425 0ustar00"""Ttk wrapper.

This module provides classes to allow using Tk themed widget set.

Ttk is based on a revised and enhanced version of
TIP #48 (http://tip.tcl.tk/48) specified style engine.

Its basic idea is to separate, to the extent possible, the code
implementing a widget's behavior from the code implementing its
appearance. Widget class bindings are primarily responsible for
maintaining the widget state and invoking callbacks, all aspects
of the widgets appearance lies at Themes.
"""

__version__ = "0.3.1"

__author__ = "Guilherme Polo <ggpolo@gmail.com>"

__all__ = ["Button", "Checkbutton", "Combobox", "Entry", "Frame", "Label",
           "Labelframe", "LabelFrame", "Menubutton", "Notebook", "Panedwindow",
           "PanedWindow", "Progressbar", "Radiobutton", "Scale", "Scrollbar",
           "Separator", "Sizegrip", "Spinbox", "Style", "Treeview",
           # Extensions
           "LabeledScale", "OptionMenu",
           # functions
           "tclobjs_to_py", "setup_master"]

import tkinter
from tkinter import _flatten, _join, _stringify, _splitdict

# Verify if Tk is new enough to not need the Tile package
_REQUIRE_TILE = True if tkinter.TkVersion < 8.5 else False

def _load_tile(master):
    if _REQUIRE_TILE:
        import os
        tilelib = os.environ.get('TILE_LIBRARY')
        if tilelib:
            # append custom tile path to the list of directories that
            # Tcl uses when attempting to resolve packages with the package
            # command
            master.tk.eval(
                    'global auto_path; '
                    'lappend auto_path {%s}' % tilelib)

        master.tk.eval('package require tile') # TclError may be raised here
        master._tile_loaded = True

def _format_optvalue(value, script=False):
    """Internal function."""
    if script:
        # if caller passes a Tcl script to tk.call, all the values need to
        # be grouped into words (arguments to a command in Tcl dialect)
        value = _stringify(value)
    elif isinstance(value, (list, tuple)):
        value = _join(value)
    return value

def _format_optdict(optdict, script=False, ignore=None):
    """Formats optdict to a tuple to pass it to tk.call.

    E.g. (script=False):
      {'foreground': 'blue', 'padding': [1, 2, 3, 4]} returns:
      ('-foreground', 'blue', '-padding', '1 2 3 4')"""

    opts = []
    for opt, value in optdict.items():
        if not ignore or opt not in ignore:
            opts.append("-%s" % opt)
            if value is not None:
                opts.append(_format_optvalue(value, script))

    return _flatten(opts)

def _mapdict_values(items):
    # each value in mapdict is expected to be a sequence, where each item
    # is another sequence containing a state (or several) and a value
    # E.g. (script=False):
    #   [('active', 'selected', 'grey'), ('focus', [1, 2, 3, 4])]
    #   returns:
    #   ['active selected', 'grey', 'focus', [1, 2, 3, 4]]
    opt_val = []
    for *state, val in items:
        if len(state) == 1:
            # if it is empty (something that evaluates to False), then
            # format it to Tcl code to denote the "normal" state
            state = state[0] or ''
        else:
            # group multiple states
            state = ' '.join(state) # raise TypeError if not str
        opt_val.append(state)
        if val is not None:
            opt_val.append(val)
    return opt_val

def _format_mapdict(mapdict, script=False):
    """Formats mapdict to pass it to tk.call.

    E.g. (script=False):
      {'expand': [('active', 'selected', 'grey'), ('focus', [1, 2, 3, 4])]}

      returns:

      ('-expand', '{active selected} grey focus {1, 2, 3, 4}')"""

    opts = []
    for opt, value in mapdict.items():
        opts.extend(("-%s" % opt,
                     _format_optvalue(_mapdict_values(value), script)))

    return _flatten(opts)

def _format_elemcreate(etype, script=False, *args, **kw):
    """Formats args and kw according to the given element factory etype."""
    spec = None
    opts = ()
    if etype in ("image", "vsapi"):
        if etype == "image": # define an element based on an image
            # first arg should be the default image name
            iname = args[0]
            # next args, if any, are statespec/value pairs which is almost
            # a mapdict, but we just need the value
            imagespec = _join(_mapdict_values(args[1:]))
            spec = "%s %s" % (iname, imagespec)

        else:
            # define an element whose visual appearance is drawn using the
            # Microsoft Visual Styles API which is responsible for the
            # themed styles on Windows XP and Vista.
            # Availability: Tk 8.6, Windows XP and Vista.
            class_name, part_id = args[:2]
            statemap = _join(_mapdict_values(args[2:]))
            spec = "%s %s %s" % (class_name, part_id, statemap)

        opts = _format_optdict(kw, script)

    elif etype == "from": # clone an element
        # it expects a themename and optionally an element to clone from,
        # otherwise it will clone {} (empty element)
        spec = args[0] # theme name
        if len(args) > 1: # elementfrom specified
            opts = (_format_optvalue(args[1], script),)

    if script:
        spec = '{%s}' % spec
        opts = ' '.join(opts)

    return spec, opts

def _format_layoutlist(layout, indent=0, indent_size=2):
    """Formats a layout list so we can pass the result to ttk::style
    layout and ttk::style settings. Note that the layout doesn't have to
    be a list necessarily.

    E.g.:
      [("Menubutton.background", None),
       ("Menubutton.button", {"children":
           [("Menubutton.focus", {"children":
               [("Menubutton.padding", {"children":
                [("Menubutton.label", {"side": "left", "expand": 1})]
               })]
           })]
       }),
       ("Menubutton.indicator", {"side": "right"})
      ]

      returns:

      Menubutton.background
      Menubutton.button -children {
        Menubutton.focus -children {
          Menubutton.padding -children {
            Menubutton.label -side left -expand 1
          }
        }
      }
      Menubutton.indicator -side right"""
    script = []

    for layout_elem in layout:
        elem, opts = layout_elem
        opts = opts or {}
        fopts = ' '.join(_format_optdict(opts, True, ("children",)))
        head = "%s%s%s" % (' ' * indent, elem, (" %s" % fopts) if fopts else '')

        if "children" in opts:
            script.append(head + " -children {")
            indent += indent_size
            newscript, indent = _format_layoutlist(opts['children'], indent,
                indent_size)
            script.append(newscript)
            indent -= indent_size
            script.append('%s}' % (' ' * indent))
        else:
            script.append(head)

    return '\n'.join(script), indent

def _script_from_settings(settings):
    """Returns an appropriate script, based on settings, according to
    theme_settings definition to be used by theme_settings and
    theme_create."""
    script = []
    # a script will be generated according to settings passed, which
    # will then be evaluated by Tcl
    for name, opts in settings.items():
        # will format specific keys according to Tcl code
        if opts.get('configure'): # format 'configure'
            s = ' '.join(_format_optdict(opts['configure'], True))
            script.append("ttk::style configure %s %s;" % (name, s))

        if opts.get('map'): # format 'map'
            s = ' '.join(_format_mapdict(opts['map'], True))
            script.append("ttk::style map %s %s;" % (name, s))

        if 'layout' in opts: # format 'layout' which may be empty
            if not opts['layout']:
                s = 'null' # could be any other word, but this one makes sense
            else:
                s, _ = _format_layoutlist(opts['layout'])
            script.append("ttk::style layout %s {\n%s\n}" % (name, s))

        if opts.get('element create'): # format 'element create'
            eopts = opts['element create']
            etype = eopts[0]

            # find where args end, and where kwargs start
            argc = 1 # etype was the first one
            while argc < len(eopts) and not hasattr(eopts[argc], 'items'):
                argc += 1

            elemargs = eopts[1:argc]
            elemkw = eopts[argc] if argc < len(eopts) and eopts[argc] else {}
            spec, opts = _format_elemcreate(etype, True, *elemargs, **elemkw)

            script.append("ttk::style element create %s %s %s %s" % (
                name, etype, spec, opts))

    return '\n'.join(script)

def _list_from_statespec(stuple):
    """Construct a list from the given statespec tuple according to the
    accepted statespec accepted by _format_mapdict."""
    if isinstance(stuple, str):
        return stuple
    result = []
    it = iter(stuple)
    for state, val in zip(it, it):
        if hasattr(state, 'typename'):  # this is a Tcl object
            state = str(state).split()
        elif isinstance(state, str):
            state = state.split()
        elif not isinstance(state, (tuple, list)):
            state = (state,)
        if hasattr(val, 'typename'):
            val = str(val)
        result.append((*state, val))

    return result

def _list_from_layouttuple(tk, ltuple):
    """Construct a list from the tuple returned by ttk::layout, this is
    somewhat the reverse of _format_layoutlist."""
    ltuple = tk.splitlist(ltuple)
    res = []

    indx = 0
    while indx < len(ltuple):
        name = ltuple[indx]
        opts = {}
        res.append((name, opts))
        indx += 1

        while indx < len(ltuple): # grab name's options
            opt, val = ltuple[indx:indx + 2]
            if not opt.startswith('-'): # found next name
                break

            opt = opt[1:] # remove the '-' from the option
            indx += 2

            if opt == 'children':
                val = _list_from_layouttuple(tk, val)

            opts[opt] = val

    return res

def _val_or_dict(tk, options, *args):
    """Format options then call Tk command with args and options and return
    the appropriate result.

    If no option is specified, a dict is returned. If an option is
    specified with the None value, the value for that option is returned.
    Otherwise, the function just sets the passed options and the caller
    shouldn't be expecting a return value anyway."""
    options = _format_optdict(options)
    res = tk.call(*(args + options))

    if len(options) % 2: # option specified without a value, return its value
        return res

    return _splitdict(tk, res, conv=_tclobj_to_py)

def _convert_stringval(value):
    """Converts a value to, hopefully, a more appropriate Python object."""
    value = str(value)
    try:
        value = int(value)
    except (ValueError, TypeError):
        pass

    return value

def _to_number(x):
    if isinstance(x, str):
        if '.' in x:
            x = float(x)
        else:
            x = int(x)
    return x

def _tclobj_to_py(val):
    """Return value converted from Tcl object to Python object."""
    if val and hasattr(val, '__len__') and not isinstance(val, str):
        if getattr(val[0], 'typename', None) == 'StateSpec':
            val = _list_from_statespec(val)
        else:
            val = list(map(_convert_stringval, val))

    elif hasattr(val, 'typename'): # some other (single) Tcl object
        val = _convert_stringval(val)

    return val

def tclobjs_to_py(adict):
    """Returns adict with its values converted from Tcl objects to Python
    objects."""
    for opt, val in adict.items():
        adict[opt] = _tclobj_to_py(val)

    return adict

def setup_master(master=None):
    """If master is not None, itself is returned. If master is None,
    the default master is returned if there is one, otherwise a new
    master is created and returned.

    If it is not allowed to use the default root and master is None,
    RuntimeError is raised."""
    if master is None:
        master = tkinter._get_default_root()
    return master


class Style(object):
    """Manipulate style database."""

    _name = "ttk::style"

    def __init__(self, master=None):
        master = setup_master(master)

        if not getattr(master, '_tile_loaded', False):
            # Load tile now, if needed
            _load_tile(master)

        self.master = master
        self.tk = self.master.tk


    def configure(self, style, query_opt=None, **kw):
        """Query or sets the default value of the specified option(s) in
        style.

        Each key in kw is an option and each value is either a string or
        a sequence identifying the value for that option."""
        if query_opt is not None:
            kw[query_opt] = None
        result = _val_or_dict(self.tk, kw, self._name, "configure", style)
        if result or query_opt:
            return result


    def map(self, style, query_opt=None, **kw):
        """Query or sets dynamic values of the specified option(s) in
        style.

        Each key in kw is an option and each value should be a list or a
        tuple (usually) containing statespecs grouped in tuples, or list,
        or something else of your preference. A statespec is compound of
        one or more states and then a value."""
        if query_opt is not None:
            result = self.tk.call(self._name, "map", style, '-%s' % query_opt)
            return _list_from_statespec(self.tk.splitlist(result))

        result = self.tk.call(self._name, "map", style, *_format_mapdict(kw))
        return {k: _list_from_statespec(self.tk.splitlist(v))
                for k, v in _splitdict(self.tk, result).items()}


    def lookup(self, style, option, state=None, default=None):
        """Returns the value specified for option in style.

        If state is specified it is expected to be a sequence of one
        or more states. If the default argument is set, it is used as
        a fallback value in case no specification for option is found."""
        state = ' '.join(state) if state else ''

        return self.tk.call(self._name, "lookup", style, '-%s' % option,
            state, default)


    def layout(self, style, layoutspec=None):
        """Define the widget layout for given style. If layoutspec is
        omitted, return the layout specification for given style.

        layoutspec is expected to be a list or an object different than
        None that evaluates to False if you want to "turn off" that style.
        If it is a list (or tuple, or something else), each item should be
        a tuple where the first item is the layout name and the second item
        should have the format described below:

        LAYOUTS

            A layout can contain the value None, if takes no options, or
            a dict of options specifying how to arrange the element.
            The layout mechanism uses a simplified version of the pack
            geometry manager: given an initial cavity, each element is
            allocated a parcel. Valid options/values are:

                side: whichside
                    Specifies which side of the cavity to place the
                    element; one of top, right, bottom or left. If
                    omitted, the element occupies the entire cavity.

                sticky: nswe
                    Specifies where the element is placed inside its
                    allocated parcel.

                children: [sublayout... ]
                    Specifies a list of elements to place inside the
                    element. Each element is a tuple (or other sequence)
                    where the first item is the layout name, and the other
                    is a LAYOUT."""
        lspec = None
        if layoutspec:
            lspec = _format_layoutlist(layoutspec)[0]
        elif layoutspec is not None: # will disable the layout ({}, '', etc)
            lspec = "null" # could be any other word, but this may make sense
                           # when calling layout(style) later

        return _list_from_layouttuple(self.tk,
            self.tk.call(self._name, "layout", style, lspec))


    def element_create(self, elementname, etype, *args, **kw):
        """Create a new element in the current theme of given etype."""
        spec, opts = _format_elemcreate(etype, False, *args, **kw)
        self.tk.call(self._name, "element", "create", elementname, etype,
            spec, *opts)


    def element_names(self):
        """Returns the list of elements defined in the current theme."""
        return tuple(n.lstrip('-') for n in self.tk.splitlist(
            self.tk.call(self._name, "element", "names")))


    def element_options(self, elementname):
        """Return the list of elementname's options."""
        return tuple(o.lstrip('-') for o in self.tk.splitlist(
            self.tk.call(self._name, "element", "options", elementname)))


    def theme_create(self, themename, parent=None, settings=None):
        """Creates a new theme.

        It is an error if themename already exists. If parent is
        specified, the new theme will inherit styles, elements and
        layouts from the specified parent theme. If settings are present,
        they are expected to have the same syntax used for theme_settings."""
        script = _script_from_settings(settings) if settings else ''

        if parent:
            self.tk.call(self._name, "theme", "create", themename,
                "-parent", parent, "-settings", script)
        else:
            self.tk.call(self._name, "theme", "create", themename,
                "-settings", script)


    def theme_settings(self, themename, settings):
        """Temporarily sets the current theme to themename, apply specified
        settings and then restore the previous theme.

        Each key in settings is a style and each value may contain the
        keys 'configure', 'map', 'layout' and 'element create' and they
        are expected to have the same format as specified by the methods
        configure, map, layout and element_create respectively."""
        script = _script_from_settings(settings)
        self.tk.call(self._name, "theme", "settings", themename, script)


    def theme_names(self):
        """Returns a list of all known themes."""
        return self.tk.splitlist(self.tk.call(self._name, "theme", "names"))


    def theme_use(self, themename=None):
        """If themename is None, returns the theme in use, otherwise, set
        the current theme to themename, refreshes all widgets and emits
        a <<ThemeChanged>> event."""
        if themename is None:
            # Starting on Tk 8.6, checking this global is no longer needed
            # since it allows doing self.tk.call(self._name, "theme", "use")
            return self.tk.eval("return $ttk::currentTheme")

        # using "ttk::setTheme" instead of "ttk::style theme use" causes
        # the variable currentTheme to be updated, also, ttk::setTheme calls
        # "ttk::style theme use" in order to change theme.
        self.tk.call("ttk::setTheme", themename)


class Widget(tkinter.Widget):
    """Base class for Tk themed widgets."""

    def __init__(self, master, widgetname, kw=None):
        """Constructs a Ttk Widget with the parent master.

        STANDARD OPTIONS

            class, cursor, takefocus, style

        SCROLLABLE WIDGET OPTIONS

            xscrollcommand, yscrollcommand

        LABEL WIDGET OPTIONS

            text, textvariable, underline, image, compound, width

        WIDGET STATES

            active, disabled, focus, pressed, selected, background,
            readonly, alternate, invalid
        """
        master = setup_master(master)
        if not getattr(master, '_tile_loaded', False):
            # Load tile now, if needed
            _load_tile(master)
        tkinter.Widget.__init__(self, master, widgetname, kw=kw)


    def identify(self, x, y):
        """Returns the name of the element at position x, y, or the empty
        string if the point does not lie within any element.

        x and y are pixel coordinates relative to the widget."""
        return self.tk.call(self._w, "identify", x, y)


    def instate(self, statespec, callback=None, *args, **kw):
        """Test the widget's state.

        If callback is not specified, returns True if the widget state
        matches statespec and False otherwise. If callback is specified,
        then it will be invoked with *args, **kw if the widget state
        matches statespec. statespec is expected to be a sequence."""
        ret = self.tk.getboolean(
                self.tk.call(self._w, "instate", ' '.join(statespec)))
        if ret and callback:
            return callback(*args, **kw)

        return ret


    def state(self, statespec=None):
        """Modify or inquire widget state.

        Widget state is returned if statespec is None, otherwise it is
        set according to the statespec flags and then a new state spec
        is returned indicating which flags were changed. statespec is
        expected to be a sequence."""
        if statespec is not None:
            statespec = ' '.join(statespec)

        return self.tk.splitlist(str(self.tk.call(self._w, "state", statespec)))


class Button(Widget):
    """Ttk Button widget, displays a textual label and/or image, and
    evaluates a command when pressed."""

    def __init__(self, master=None, **kw):
        """Construct a Ttk Button widget with the parent master.

        STANDARD OPTIONS

            class, compound, cursor, image, state, style, takefocus,
            text, textvariable, underline, width

        WIDGET-SPECIFIC OPTIONS

            command, default, width
        """
        Widget.__init__(self, master, "ttk::button", kw)


    def invoke(self):
        """Invokes the command associated with the button."""
        return self.tk.call(self._w, "invoke")


class Checkbutton(Widget):
    """Ttk Checkbutton widget which is either in on- or off-state."""

    def __init__(self, master=None, **kw):
        """Construct a Ttk Checkbutton widget with the parent master.

        STANDARD OPTIONS

            class, compound, cursor, image, state, style, takefocus,
            text, textvariable, underline, width

        WIDGET-SPECIFIC OPTIONS

            command, offvalue, onvalue, variable
        """
        Widget.__init__(self, master, "ttk::checkbutton", kw)


    def invoke(self):
        """Toggles between the selected and deselected states and
        invokes the associated command. If the widget is currently
        selected, sets the option variable to the offvalue option
        and deselects the widget; otherwise, sets the option variable
        to the option onvalue.

        Returns the result of the associated command."""
        return self.tk.call(self._w, "invoke")


class Entry(Widget, tkinter.Entry):
    """Ttk Entry widget displays a one-line text string and allows that
    string to be edited by the user."""

    def __init__(self, master=None, widget=None, **kw):
        """Constructs a Ttk Entry widget with the parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus, xscrollcommand

        WIDGET-SPECIFIC OPTIONS

            exportselection, invalidcommand, justify, show, state,
            textvariable, validate, validatecommand, width

        VALIDATION MODES

            none, key, focus, focusin, focusout, all
        """
        Widget.__init__(self, master, widget or "ttk::entry", kw)


    def bbox(self, index):
        """Return a tuple of (x, y, width, height) which describes the
        bounding box of the character given by index."""
        return self._getints(self.tk.call(self._w, "bbox", index))


    def identify(self, x, y):
        """Returns the name of the element at position x, y, or the
        empty string if the coordinates are outside the window."""
        return self.tk.call(self._w, "identify", x, y)


    def validate(self):
        """Force revalidation, independent of the conditions specified
        by the validate option. Returns False if validation fails, True
        if it succeeds. Sets or clears the invalid state accordingly."""
        return self.tk.getboolean(self.tk.call(self._w, "validate"))


class Combobox(Entry):
    """Ttk Combobox widget combines a text field with a pop-down list of
    values."""

    def __init__(self, master=None, **kw):
        """Construct a Ttk Combobox widget with the parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS

            exportselection, justify, height, postcommand, state,
            textvariable, values, width
        """
        Entry.__init__(self, master, "ttk::combobox", **kw)


    def current(self, newindex=None):
        """If newindex is supplied, sets the combobox value to the
        element at position newindex in the list of values. Otherwise,
        returns the index of the current value in the list of values
        or -1 if the current value does not appear in the list."""
        if newindex is None:
            return self.tk.getint(self.tk.call(self._w, "current"))
        return self.tk.call(self._w, "current", newindex)


    def set(self, value):
        """Sets the value of the combobox to value."""
        self.tk.call(self._w, "set", value)


class Frame(Widget):
    """Ttk Frame widget is a container, used to group other widgets
    together."""

    def __init__(self, master=None, **kw):
        """Construct a Ttk Frame with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS

            borderwidth, relief, padding, width, height
        """
        Widget.__init__(self, master, "ttk::frame", kw)


class Label(Widget):
    """Ttk Label widget displays a textual label and/or image."""

    def __init__(self, master=None, **kw):
        """Construct a Ttk Label with parent master.

        STANDARD OPTIONS

            class, compound, cursor, image, style, takefocus, text,
            textvariable, underline, width

        WIDGET-SPECIFIC OPTIONS

            anchor, background, font, foreground, justify, padding,
            relief, text, wraplength
        """
        Widget.__init__(self, master, "ttk::label", kw)


class Labelframe(Widget):
    """Ttk Labelframe widget is a container used to group other widgets
    together. It has an optional label, which may be a plain text string
    or another widget."""

    def __init__(self, master=None, **kw):
        """Construct a Ttk Labelframe with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS
            labelanchor, text, underline, padding, labelwidget, width,
            height
        """
        Widget.__init__(self, master, "ttk::labelframe", kw)

LabelFrame = Labelframe # tkinter name compatibility


class Menubutton(Widget):
    """Ttk Menubutton widget displays a textual label and/or image, and
    displays a menu when pressed."""

    def __init__(self, master=None, **kw):
        """Construct a Ttk Menubutton with parent master.

        STANDARD OPTIONS

            class, compound, cursor, image, state, style, takefocus,
            text, textvariable, underline, width

        WIDGET-SPECIFIC OPTIONS

            direction, menu
        """
        Widget.__init__(self, master, "ttk::menubutton", kw)


class Notebook(Widget):
    """Ttk Notebook widget manages a collection of windows and displays
    a single one at a time. Each child window is associated with a tab,
    which the user may select to change the currently-displayed window."""

    def __init__(self, master=None, **kw):
        """Construct a Ttk Notebook with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS

            height, padding, width

        TAB OPTIONS

            state, sticky, padding, text, image, compound, underline

        TAB IDENTIFIERS (tab_id)

            The tab_id argument found in several methods may take any of
            the following forms:

                * An integer between zero and the number of tabs
                * The name of a child window
                * A positional specification of the form "@x,y", which
                  defines the tab
                * The string "current", which identifies the
                  currently-selected tab
                * The string "end", which returns the number of tabs (only
                  valid for method index)
        """
        Widget.__init__(self, master, "ttk::notebook", kw)


    def add(self, child, **kw):
        """Adds a new tab to the notebook.

        If window is currently managed by the notebook but hidden, it is
        restored to its previous position."""
        self.tk.call(self._w, "add", child, *(_format_optdict(kw)))


    def forget(self, tab_id):
        """Removes the tab specified by tab_id, unmaps and unmanages the
        associated window."""
        self.tk.call(self._w, "forget", tab_id)


    def hide(self, tab_id):
        """Hides the tab specified by tab_id.

        The tab will not be displayed, but the associated window remains
        managed by the notebook and its configuration remembered. Hidden
        tabs may be restored with the add command."""
        self.tk.call(self._w, "hide", tab_id)


    def identify(self, x, y):
        """Returns the name of the tab element at position x, y, or the
        empty string if none."""
        return self.tk.call(self._w, "identify", x, y)


    def index(self, tab_id):
        """Returns the numeric index of the tab specified by tab_id, or
        the total number of tabs if tab_id is the string "end"."""
        return self.tk.getint(self.tk.call(self._w, "index", tab_id))


    def insert(self, pos, child, **kw):
        """Inserts a pane at the specified position.

        pos is either the string end, an integer index, or the name of
        a managed child. If child is already managed by the notebook,
        moves it to the specified position."""
        self.tk.call(self._w, "insert", pos, child, *(_format_optdict(kw)))


    def select(self, tab_id=None):
        """Selects the specified tab.

        The associated child window will be displayed, and the
        previously-selected window (if different) is unmapped. If tab_id
        is omitted, returns the widget name of the currently selected
        pane."""
        return self.tk.call(self._w, "select", tab_id)


    def tab(self, tab_id, option=None, **kw):
        """Query or modify the options of the specific tab_id.

        If kw is not given, returns a dict of the tab option values. If option
        is specified, returns the value of that option. Otherwise, sets the
        options to the corresponding values."""
        if option is not None:
            kw[option] = None
        return _val_or_dict(self.tk, kw, self._w, "tab", tab_id)


    def tabs(self):
        """Returns a list of windows managed by the notebook."""
        return self.tk.splitlist(self.tk.call(self._w, "tabs") or ())


    def enable_traversal(self):
        """Enable keyboard traversal for a toplevel window containing
        this notebook.

        This will extend the bindings for the toplevel window containing
        this notebook as follows:

            Control-Tab: selects the tab following the currently selected
                         one

            Shift-Control-Tab: selects the tab preceding the currently
                               selected one

            Alt-K: where K is the mnemonic (underlined) character of any
                   tab, will select that tab.

        Multiple notebooks in a single toplevel may be enabled for
        traversal, including nested notebooks. However, notebook traversal
        only works properly if all panes are direct children of the
        notebook."""
        # The only, and good, difference I see is about mnemonics, which works
        # after calling this method. Control-Tab and Shift-Control-Tab always
        # works (here at least).
        self.tk.call("ttk::notebook::enableTraversal", self._w)


class Panedwindow(Widget, tkinter.PanedWindow):
    """Ttk Panedwindow widget displays a number of subwindows, stacked
    either vertically or horizontally."""

    def __init__(self, master=None, **kw):
        """Construct a Ttk Panedwindow with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS

            orient, width, height

        PANE OPTIONS

            weight
        """
        Widget.__init__(self, master, "ttk::panedwindow", kw)


    forget = tkinter.PanedWindow.forget # overrides Pack.forget


    def insert(self, pos, child, **kw):
        """Inserts a pane at the specified positions.

        pos is either the string end, and integer index, or the name
        of a child. If child is already managed by the paned window,
        moves it to the specified position."""
        self.tk.call(self._w, "insert", pos, child, *(_format_optdict(kw)))


    def pane(self, pane, option=None, **kw):
        """Query or modify the options of the specified pane.

        pane is either an integer index or the name of a managed subwindow.
        If kw is not given, returns a dict of the pane option values. If
        option is specified then the value for that option is returned.
        Otherwise, sets the options to the corresponding values."""
        if option is not None:
            kw[option] = None
        return _val_or_dict(self.tk, kw, self._w, "pane", pane)


    def sashpos(self, index, newpos=None):
        """If newpos is specified, sets the position of sash number index.

        May adjust the positions of adjacent sashes to ensure that
        positions are monotonically increasing. Sash positions are further
        constrained to be between 0 and the total size of the widget.

        Returns the new position of sash number index."""
        return self.tk.getint(self.tk.call(self._w, "sashpos", index, newpos))

PanedWindow = Panedwindow # tkinter name compatibility


class Progressbar(Widget):
    """Ttk Progressbar widget shows the status of a long-running
    operation. They can operate in two modes: determinate mode shows the
    amount completed relative to the total amount of work to be done, and
    indeterminate mode provides an animated display to let the user know
    that something is happening."""

    def __init__(self, master=None, **kw):
        """Construct a Ttk Progressbar with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS

            orient, length, mode, maximum, value, variable, phase
        """
        Widget.__init__(self, master, "ttk::progressbar", kw)


    def start(self, interval=None):
        """Begin autoincrement mode: schedules a recurring timer event
        that calls method step every interval milliseconds.

        interval defaults to 50 milliseconds (20 steps/second) if omitted."""
        self.tk.call(self._w, "start", interval)


    def step(self, amount=None):
        """Increments the value option by amount.

        amount defaults to 1.0 if omitted."""
        self.tk.call(self._w, "step", amount)


    def stop(self):
        """Stop autoincrement mode: cancels any recurring timer event
        initiated by start."""
        self.tk.call(self._w, "stop")


class Radiobutton(Widget):
    """Ttk Radiobutton widgets are used in groups to show or change a
    set of mutually-exclusive options."""

    def __init__(self, master=None, **kw):
        """Construct a Ttk Radiobutton with parent master.

        STANDARD OPTIONS

            class, compound, cursor, image, state, style, takefocus,
            text, textvariable, underline, width

        WIDGET-SPECIFIC OPTIONS

            command, value, variable
        """
        Widget.__init__(self, master, "ttk::radiobutton", kw)


    def invoke(self):
        """Sets the option variable to the option value, selects the
        widget, and invokes the associated command.

        Returns the result of the command, or an empty string if
        no command is specified."""
        return self.tk.call(self._w, "invoke")


class Scale(Widget, tkinter.Scale):
    """Ttk Scale widget is typically used to control the numeric value of
    a linked variable that varies uniformly over some range."""

    def __init__(self, master=None, **kw):
        """Construct a Ttk Scale with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS

            command, from, length, orient, to, value, variable
        """
        Widget.__init__(self, master, "ttk::scale", kw)


    def configure(self, cnf=None, **kw):
        """Modify or query scale options.

        Setting a value for any of the "from", "from_" or "to" options
        generates a <<RangeChanged>> event."""
        retval = Widget.configure(self, cnf, **kw)
        if not isinstance(cnf, (type(None), str)):
            kw.update(cnf)
        if any(['from' in kw, 'from_' in kw, 'to' in kw]):
            self.event_generate('<<RangeChanged>>')
        return retval


    def get(self, x=None, y=None):
        """Get the current value of the value option, or the value
        corresponding to the coordinates x, y if they are specified.

        x and y are pixel coordinates relative to the scale widget
        origin."""
        return self.tk.call(self._w, 'get', x, y)


class Scrollbar(Widget, tkinter.Scrollbar):
    """Ttk Scrollbar controls the viewport of a scrollable widget."""

    def __init__(self, master=None, **kw):
        """Construct a Ttk Scrollbar with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS

            command, orient
        """
        Widget.__init__(self, master, "ttk::scrollbar", kw)


class Separator(Widget):
    """Ttk Separator widget displays a horizontal or vertical separator
    bar."""

    def __init__(self, master=None, **kw):
        """Construct a Ttk Separator with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS

            orient
        """
        Widget.__init__(self, master, "ttk::separator", kw)


class Sizegrip(Widget):
    """Ttk Sizegrip allows the user to resize the containing toplevel
    window by pressing and dragging the grip."""

    def __init__(self, master=None, **kw):
        """Construct a Ttk Sizegrip with parent master.

        STANDARD OPTIONS

            class, cursor, state, style, takefocus
        """
        Widget.__init__(self, master, "ttk::sizegrip", kw)


class Spinbox(Entry):
    """Ttk Spinbox is an Entry with increment and decrement arrows

    It is commonly used for number entry or to select from a list of
    string values.
    """

    def __init__(self, master=None, **kw):
        """Construct a Ttk Spinbox widget with the parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus, validate,
            validatecommand, xscrollcommand, invalidcommand

        WIDGET-SPECIFIC OPTIONS

            to, from_, increment, values, wrap, format, command
        """
        Entry.__init__(self, master, "ttk::spinbox", **kw)


    def set(self, value):
        """Sets the value of the Spinbox to value."""
        self.tk.call(self._w, "set", value)


class Treeview(Widget, tkinter.XView, tkinter.YView):
    """Ttk Treeview widget displays a hierarchical collection of items.

    Each item has a textual label, an optional image, and an optional list
    of data values. The data values are displayed in successive columns
    after the tree label."""

    def __init__(self, master=None, **kw):
        """Construct a Ttk Treeview with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus, xscrollcommand,
            yscrollcommand

        WIDGET-SPECIFIC OPTIONS

            columns, displaycolumns, height, padding, selectmode, show

        ITEM OPTIONS

            text, image, values, open, tags

        TAG OPTIONS

            foreground, background, font, image
        """
        Widget.__init__(self, master, "ttk::treeview", kw)


    def bbox(self, item, column=None):
        """Returns the bounding box (relative to the treeview widget's
        window) of the specified item in the form x y width height.

        If column is specified, returns the bounding box of that cell.
        If the item is not visible (i.e., if it is a descendant of a
        closed item or is scrolled offscreen), returns an empty string."""
        return self._getints(self.tk.call(self._w, "bbox", item, column)) or ''


    def get_children(self, item=None):
        """Returns a tuple of children belonging to item.

        If item is not specified, returns root children."""
        return self.tk.splitlist(
                self.tk.call(self._w, "children", item or '') or ())


    def set_children(self, item, *newchildren):
        """Replaces item's child with newchildren.

        Children present in item that are not present in newchildren
        are detached from tree. No items in newchildren may be an
        ancestor of item."""
        self.tk.call(self._w, "children", item, newchildren)


    def column(self, column, option=None, **kw):
        """Query or modify the options for the specified column.

        If kw is not given, returns a dict of the column option values. If
        option is specified then the value for that option is returned.
        Otherwise, sets the options to the corresponding values."""
        if option is not None:
            kw[option] = None
        return _val_or_dict(self.tk, kw, self._w, "column", column)


    def delete(self, *items):
        """Delete all specified items and all their descendants. The root
        item may not be deleted."""
        self.tk.call(self._w, "delete", items)


    def detach(self, *items):
        """Unlinks all of the specified items from the tree.

        The items and all of their descendants are still present, and may
        be reinserted at another point in the tree, but will not be
        displayed. The root item may not be detached."""
        self.tk.call(self._w, "detach", items)


    def exists(self, item):
        """Returns True if the specified item is present in the tree,
        False otherwise."""
        return self.tk.getboolean(self.tk.call(self._w, "exists", item))


    def focus(self, item=None):
        """If item is specified, sets the focus item to item. Otherwise,
        returns the current focus item, or '' if there is none."""
        return self.tk.call(self._w, "focus", item)


    def heading(self, column, option=None, **kw):
        """Query or modify the heading options for the specified column.

        If kw is not given, returns a dict of the heading option values. If
        option is specified then the value for that option is returned.
        Otherwise, sets the options to the corresponding values.

        Valid options/values are:
            text: text
                The text to display in the column heading
            image: image_name
                Specifies an image to display to the right of the column
                heading
            anchor: anchor
                Specifies how the heading text should be aligned. One of
                the standard Tk anchor values
            command: callback
                A callback to be invoked when the heading label is
                pressed.

        To configure the tree column heading, call this with column = "#0" """
        cmd = kw.get('command')
        if cmd and not isinstance(cmd, str):
            # callback not registered yet, do it now
            kw['command'] = self.master.register(cmd, self._substitute)

        if option is not None:
            kw[option] = None

        return _val_or_dict(self.tk, kw, self._w, 'heading', column)


    def identify(self, component, x, y):
        """Returns a description of the specified component under the
        point given by x and y, or the empty string if no such component
        is present at that position."""
        return self.tk.call(self._w, "identify", component, x, y)


    def identify_row(self, y):
        """Returns the item ID of the item at position y."""
        return self.identify("row", 0, y)


    def identify_column(self, x):
        """Returns the data column identifier of the cell at position x.

        The tree column has ID #0."""
        return self.identify("column", x, 0)


    def identify_region(self, x, y):
        """Returns one of:

        heading: Tree heading area.
        separator: Space between two columns headings;
        tree: The tree area.
        cell: A data cell.

        * Availability: Tk 8.6"""
        return self.identify("region", x, y)


    def identify_element(self, x, y):
        """Returns the element at position x, y.

        * Availability: Tk 8.6"""
        return self.identify("element", x, y)


    def index(self, item):
        """Returns the integer index of item within its parent's list
        of children."""
        return self.tk.getint(self.tk.call(self._w, "index", item))


    def insert(self, parent, index, iid=None, **kw):
        """Creates a new item and return the item identifier of the newly
        created item.

        parent is the item ID of the parent item, or the empty string
        to create a new top-level item. index is an integer, or the value
        end, specifying where in the list of parent's children to insert
        the new item. If index is less than or equal to zero, the new node
        is inserted at the beginning, if index is greater than or equal to
        the current number of children, it is inserted at the end. If iid
        is specified, it is used as the item identifier, iid must not
        already exist in the tree. Otherwise, a new unique identifier
        is generated."""
        opts = _format_optdict(kw)
        if iid is not None:
            res = self.tk.call(self._w, "insert", parent, index,
                "-id", iid, *opts)
        else:
            res = self.tk.call(self._w, "insert", parent, index, *opts)

        return res


    def item(self, item, option=None, **kw):
        """Query or modify the options for the specified item.

        If no options are given, a dict with options/values for the item
        is returned. If option is specified then the value for that option
        is returned. Otherwise, sets the options to the corresponding
        values as given by kw."""
        if option is not None:
            kw[option] = None
        return _val_or_dict(self.tk, kw, self._w, "item", item)


    def move(self, item, parent, index):
        """Moves item to position index in parent's list of children.

        It is illegal to move an item under one of its descendants. If
        index is less than or equal to zero, item is moved to the
        beginning, if greater than or equal to the number of children,
        it is moved to the end. If item was detached it is reattached."""
        self.tk.call(self._w, "move", item, parent, index)

    reattach = move # A sensible method name for reattaching detached items


    def next(self, item):
        """Returns the identifier of item's next sibling, or '' if item
        is the last child of its parent."""
        return self.tk.call(self._w, "next", item)


    def parent(self, item):
        """Returns the ID of the parent of item, or '' if item is at the
        top level of the hierarchy."""
        return self.tk.call(self._w, "parent", item)


    def prev(self, item):
        """Returns the identifier of item's previous sibling, or '' if
        item is the first child of its parent."""
        return self.tk.call(self._w, "prev", item)


    def see(self, item):
        """Ensure that item is visible.

        Sets all of item's ancestors open option to True, and scrolls
        the widget if necessary so that item is within the visible
        portion of the tree."""
        self.tk.call(self._w, "see", item)


    def selection(self):
        """Returns the tuple of selected items."""
        return self.tk.splitlist(self.tk.call(self._w, "selection"))


    def _selection(self, selop, items):
        if len(items) == 1 and isinstance(items[0], (tuple, list)):
            items = items[0]

        self.tk.call(self._w, "selection", selop, items)


    def selection_set(self, *items):
        """The specified items becomes the new selection."""
        self._selection("set", items)


    def selection_add(self, *items):
        """Add all of the specified items to the selection."""
        self._selection("add", items)


    def selection_remove(self, *items):
        """Remove all of the specified items from the selection."""
        self._selection("remove", items)


    def selection_toggle(self, *items):
        """Toggle the selection state of each specified item."""
        self._selection("toggle", items)


    def set(self, item, column=None, value=None):
        """Query or set the value of given item.

        With one argument, return a dictionary of column/value pairs
        for the specified item. With two arguments, return the current
        value of the specified column. With three arguments, set the
        value of given column in given item to the specified value."""
        res = self.tk.call(self._w, "set", item, column, value)
        if column is None and value is None:
            return _splitdict(self.tk, res,
                              cut_minus=False, conv=_tclobj_to_py)
        else:
            return res


    def tag_bind(self, tagname, sequence=None, callback=None):
        """Bind a callback for the given event sequence to the tag tagname.
        When an event is delivered to an item, the callbacks for each
        of the item's tags option are called."""
        self._bind((self._w, "tag", "bind", tagname), sequence, callback, add=0)


    def tag_configure(self, tagname, option=None, **kw):
        """Query or modify the options for the specified tagname.

        If kw is not given, returns a dict of the option settings for tagname.
        If option is specified, returns the value for that option for the
        specified tagname. Otherwise, sets the options to the corresponding
        values for the given tagname."""
        if option is not None:
            kw[option] = None
        return _val_or_dict(self.tk, kw, self._w, "tag", "configure",
            tagname)


    def tag_has(self, tagname, item=None):
        """If item is specified, returns 1 or 0 depending on whether the
        specified item has the given tagname. Otherwise, returns a list of
        all items which have the specified tag.

        * Availability: Tk 8.6"""
        if item is None:
            return self.tk.splitlist(
                self.tk.call(self._w, "tag", "has", tagname))
        else:
            return self.tk.getboolean(
                self.tk.call(self._w, "tag", "has", tagname, item))


# Extensions

class LabeledScale(Frame):
    """A Ttk Scale widget with a Ttk Label widget indicating its
    current value.

    The Ttk Scale can be accessed through instance.scale, and Ttk Label
    can be accessed through instance.label"""

    def __init__(self, master=None, variable=None, from_=0, to=10, **kw):
        """Construct a horizontal LabeledScale with parent master, a
        variable to be associated with the Ttk Scale widget and its range.
        If variable is not specified, a tkinter.IntVar is created.

        WIDGET-SPECIFIC OPTIONS

            compound: 'top' or 'bottom'
                Specifies how to display the label relative to the scale.
                Defaults to 'top'.
        """
        self._label_top = kw.pop('compound', 'top') == 'top'

        Frame.__init__(self, master, **kw)
        self._variable = variable or tkinter.IntVar(master)
        self._variable.set(from_)
        self._last_valid = from_

        self.label = Label(self)
        self.scale = Scale(self, variable=self._variable, from_=from_, to=to)
        self.scale.bind('<<RangeChanged>>', self._adjust)

        # position scale and label according to the compound option
        scale_side = 'bottom' if self._label_top else 'top'
        label_side = 'top' if scale_side == 'bottom' else 'bottom'
        self.scale.pack(side=scale_side, fill='x')
        # Dummy required to make frame correct height
        dummy = Label(self)
        dummy.pack(side=label_side)
        dummy.lower()
        self.label.place(anchor='n' if label_side == 'top' else 's')

        # update the label as scale or variable changes
        self.__tracecb = self._variable.trace_variable('w', self._adjust)
        self.bind('<Configure>', self._adjust)
        self.bind('<Map>', self._adjust)


    def destroy(self):
        """Destroy this widget and possibly its associated variable."""
        try:
            self._variable.trace_vdelete('w', self.__tracecb)
        except AttributeError:
            pass
        else:
            del self._variable
        super().destroy()
        self.label = None
        self.scale = None


    def _adjust(self, *args):
        """Adjust the label position according to the scale."""
        def adjust_label():
            self.update_idletasks() # "force" scale redraw

            x, y = self.scale.coords()
            if self._label_top:
                y = self.scale.winfo_y() - self.label.winfo_reqheight()
            else:
                y = self.scale.winfo_reqheight() + self.label.winfo_reqheight()

            self.label.place_configure(x=x, y=y)

        from_ = _to_number(self.scale['from'])
        to = _to_number(self.scale['to'])
        if to < from_:
            from_, to = to, from_
        newval = self._variable.get()
        if not from_ <= newval <= to:
            # value outside range, set value back to the last valid one
            self.value = self._last_valid
            return

        self._last_valid = newval
        self.label['text'] = newval
        self.after_idle(adjust_label)

    @property
    def value(self):
        """Return current scale value."""
        return self._variable.get()

    @value.setter
    def value(self, val):
        """Set new scale value."""
        self._variable.set(val)


class OptionMenu(Menubutton):
    """Themed OptionMenu, based after tkinter's OptionMenu, which allows
    the user to select a value from a menu."""

    def __init__(self, master, variable, default=None, *values, **kwargs):
        """Construct a themed OptionMenu widget with master as the parent,
        the resource textvariable set to variable, the initially selected
        value specified by the default parameter, the menu values given by
        *values and additional keywords.

        WIDGET-SPECIFIC OPTIONS

            style: stylename
                Menubutton style.
            direction: 'above', 'below', 'left', 'right', or 'flush'
                Menubutton direction.
            command: callback
                A callback that will be invoked after selecting an item.
        """
        kw = {'textvariable': variable, 'style': kwargs.pop('style', None),
              'direction': kwargs.pop('direction', None)}
        Menubutton.__init__(self, master, **kw)
        self['menu'] = tkinter.Menu(self, tearoff=False)

        self._variable = variable
        self._callback = kwargs.pop('command', None)
        if kwargs:
            raise tkinter.TclError('unknown option -%s' % (
                next(iter(kwargs.keys()))))

        self.set_menu(default, *values)


    def __getitem__(self, item):
        if item == 'menu':
            return self.nametowidget(Menubutton.__getitem__(self, item))

        return Menubutton.__getitem__(self, item)


    def set_menu(self, default=None, *values):
        """Build a new menu of radiobuttons with *values and optionally
        a default value."""
        menu = self['menu']
        menu.delete(0, 'end')
        for val in values:
            menu.add_radiobutton(label=val,
                command=tkinter._setit(self._variable, val, self._callback),
                variable=self._variable)

        if default:
            self._variable.set(default)


    def destroy(self):
        """Destroy this widget and its associated variable."""
        try:
            del self._variable
        except AttributeError:
            pass
        super().destroy()
tkinter/font.py000064400000015100151153537530007551 0ustar00# Tkinter font wrapper
#
# written by Fredrik Lundh, February 1998
#

__version__ = "0.9"

import itertools
import tkinter


# weight/slant
NORMAL = "normal"
ROMAN = "roman"
BOLD   = "bold"
ITALIC = "italic"


def nametofont(name):
    """Given the name of a tk named font, returns a Font representation.
    """
    return Font(name=name, exists=True)


class Font:
    """Represents a named font.

    Constructor options are:

    font -- font specifier (name, system font, or (family, size, style)-tuple)
    name -- name to use for this font configuration (defaults to a unique name)
    exists -- does a named font by this name already exist?
       Creates a new named font if False, points to the existing font if True.
       Raises _tkinter.TclError if the assertion is false.

       the following are ignored if font is specified:

    family -- font 'family', e.g. Courier, Times, Helvetica
    size -- font size in points
    weight -- font thickness: NORMAL, BOLD
    slant -- font slant: ROMAN, ITALIC
    underline -- font underlining: false (0), true (1)
    overstrike -- font strikeout: false (0), true (1)

    """

    counter = itertools.count(1)

    def _set(self, kw):
        options = []
        for k, v in kw.items():
            options.append("-"+k)
            options.append(str(v))
        return tuple(options)

    def _get(self, args):
        options = []
        for k in args:
            options.append("-"+k)
        return tuple(options)

    def _mkdict(self, args):
        options = {}
        for i in range(0, len(args), 2):
            options[args[i][1:]] = args[i+1]
        return options

    def __init__(self, root=None, font=None, name=None, exists=False,
                 **options):
        if not root:
            root = tkinter._get_default_root('use font')
        tk = getattr(root, 'tk', root)
        if font:
            # get actual settings corresponding to the given font
            font = tk.splitlist(tk.call("font", "actual", font))
        else:
            font = self._set(options)
        if not name:
            name = "font" + str(next(self.counter))
        self.name = name

        if exists:
            self.delete_font = False
            # confirm font exists
            if self.name not in tk.splitlist(tk.call("font", "names")):
                raise tkinter._tkinter.TclError(
                    "named font %s does not already exist" % (self.name,))
            # if font config info supplied, apply it
            if font:
                tk.call("font", "configure", self.name, *font)
        else:
            # create new font (raises TclError if the font exists)
            tk.call("font", "create", self.name, *font)
            self.delete_font = True
        self._tk = tk
        self._split = tk.splitlist
        self._call  = tk.call

    def __str__(self):
        return self.name

    def __eq__(self, other):
        if not isinstance(other, Font):
            return NotImplemented
        return self.name == other.name and self._tk == other._tk

    def __getitem__(self, key):
        return self.cget(key)

    def __setitem__(self, key, value):
        self.configure(**{key: value})

    def __del__(self):
        try:
            if self.delete_font:
                self._call("font", "delete", self.name)
        except Exception:
            pass

    def copy(self):
        "Return a distinct copy of the current font"
        return Font(self._tk, **self.actual())

    def actual(self, option=None, displayof=None):
        "Return actual font attributes"
        args = ()
        if displayof:
            args = ('-displayof', displayof)
        if option:
            args = args + ('-' + option, )
            return self._call("font", "actual", self.name, *args)
        else:
            return self._mkdict(
                self._split(self._call("font", "actual", self.name, *args)))

    def cget(self, option):
        "Get font attribute"
        return self._call("font", "config", self.name, "-"+option)

    def config(self, **options):
        "Modify font attributes"
        if options:
            self._call("font", "config", self.name,
                  *self._set(options))
        else:
            return self._mkdict(
                self._split(self._call("font", "config", self.name)))

    configure = config

    def measure(self, text, displayof=None):
        "Return text width"
        args = (text,)
        if displayof:
            args = ('-displayof', displayof, text)
        return self._tk.getint(self._call("font", "measure", self.name, *args))

    def metrics(self, *options, **kw):
        """Return font metrics.

        For best performance, create a dummy widget
        using this font before calling this method."""
        args = ()
        displayof = kw.pop('displayof', None)
        if displayof:
            args = ('-displayof', displayof)
        if options:
            args = args + self._get(options)
            return self._tk.getint(
                self._call("font", "metrics", self.name, *args))
        else:
            res = self._split(self._call("font", "metrics", self.name, *args))
            options = {}
            for i in range(0, len(res), 2):
                options[res[i][1:]] = self._tk.getint(res[i+1])
            return options


def families(root=None, displayof=None):
    "Get font families (as a tuple)"
    if not root:
        root = tkinter._get_default_root('use font.families()')
    args = ()
    if displayof:
        args = ('-displayof', displayof)
    return root.tk.splitlist(root.tk.call("font", "families", *args))


def names(root=None):
    "Get names of defined fonts (as a tuple)"
    if not root:
        root = tkinter._get_default_root('use font.names()')
    return root.tk.splitlist(root.tk.call("font", "names"))


# --------------------------------------------------------------------
# test stuff

if __name__ == "__main__":

    root = tkinter.Tk()

    # create a font
    f = Font(family="times", size=30, weight=NORMAL)

    print(f.actual())
    print(f.actual("family"))
    print(f.actual("weight"))

    print(f.config())
    print(f.cget("family"))
    print(f.cget("weight"))

    print(names())

    print(f.measure("hello"), f.metrics("linespace"))

    print(f.metrics(displayof=root))

    f = Font(font=("Courier", 20, "bold"))
    print(f.measure("hello"), f.metrics("linespace", displayof=root))

    w = tkinter.Label(root, text="Hello, world", font=f)
    w.pack()

    w = tkinter.Button(root, text="Quit!", command=root.destroy)
    w.pack()

    fb = Font(font=w["font"]).copy()
    fb.config(weight=BOLD)

    w.config(font=fb)

    tkinter.mainloop()
tkinter/__pycache__/ttk.cpython-38.pyc000064400000156574151153537530013720 0ustar00U

e5d���@s�dZdZdZddddddd	d
ddd
ddddddddddddddgZddlZddlmZmZmZmZej	dkrpd nd!Z
d"d#�ZdXd$d%�ZdYd&d'�Z
d(d)�ZdZd*d+�Zd[d,d-�Zd\d/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Zd=d>�Zd?d�Zd]d@d�ZGdAd�de�ZGdBdC�dCej�ZGdDd�de�ZGdEd�de�ZGdFd�deej �Z GdGd�de �Z!GdHd�de�Z"GdId�de�Z#GdJd	�d	e�Z$e$Z%GdKd�de�Z&GdLd�de�Z'GdMd
�d
eej(�Z)e)Z(GdNd�de�Z*GdOd�de�Z+GdPd�deej,�Z,GdQd�deej-�Z-GdRd�de�Z.GdSd�de�Z/GdTd�de �Z0GdUd�deej1ej2�Z3GdVd�de"�Z4GdWd�de&�Z5dS)^a�Ttk wrapper.

This module provides classes to allow using Tk themed widget set.

Ttk is based on a revised and enhanced version of
TIP #48 (http://tip.tcl.tk/48) specified style engine.

Its basic idea is to separate, to the extent possible, the code
implementing a widget's behavior from the code implementing its
appearance. Widget class bindings are primarily responsible for
maintaining the widget state and invoking callbacks, all aspects
of the widgets appearance lies at Themes.
z0.3.1z!Guilherme Polo <ggpolo@gmail.com>�Button�Checkbutton�Combobox�Entry�Frame�Label�
Labelframe�
LabelFrame�
Menubutton�Notebook�Panedwindow�PanedWindow�Progressbar�Radiobutton�Scale�	Scrollbar�	Separator�Sizegrip�Spinbox�Style�Treeview�LabeledScale�
OptionMenu�
tclobjs_to_py�setup_master�N)�_flatten�_join�
_stringify�
_splitdictg!@TFcCsBtr>ddl}|j�d�}|r,|j�d|�|j�d�d|_dS)NrZTILE_LIBRARYz(global auto_path; lappend auto_path {%s}zpackage require tileT)�
_REQUIRE_TILE�os�environ�get�tk�eval�_tile_loaded)�masterr Ztilelib�r'�#/usr/lib64/python3.8/tkinter/ttk.py�
_load_tile"s��r)cCs(|rt|�}nt|ttf�r$t|�}|S)zInternal function.)r�
isinstance�list�tupler)�value�scriptr'r'r(�_format_optvalue1s

r/cCsPg}|��D]:\}}|r ||kr|�d|�|dk	r|�t||��qt|�S)z�Formats optdict to a tuple to pass it to tk.call.

    E.g. (script=False):
      {'foreground': 'blue', 'padding': [1, 2, 3, 4]} returns:
      ('-foreground', 'blue', '-padding', '1 2 3 4')�-%sN)�items�appendr/r)Zoptdictr.�ignore�opts�optr-r'r'r(�_format_optdict;sr6cCsXg}|D]J�^}}t|�dkr,|dp(d}n
d�|�}|�|�|dk	r|�|�q|S)N�r�� )�len�joinr2)r1Zopt_val�state�valr'r'r(�_mapdict_valuesKs

r>cCs:g}|��D]$\}}|�d|tt|�|�f�qt|�S)z�Formats mapdict to pass it to tk.call.

    E.g. (script=False):
      {'expand': [('active', 'selected', 'grey'), ('focus', [1, 2, 3, 4])]}

      returns:

      ('-expand', '{active selected} grey focus {1, 2, 3, 4}')r0)r1�extendr/r>r)Zmapdictr.r4r5r-r'r'r(�_format_mapdict`s

�r@cOs�d}d}|dkr�|dkrB|d}tt|dd���}d||f}n2|dd�\}}	tt|dd���}
d	||	|
f}t||�}n,|d
kr�|d}t|�dkr�t|d|�f}|r�d|}d�|�}||fS)
zAFormats args and kw according to the given element factory etype.Nr')�imageZvsapirArr7z%s %s�z%s %s %s�fromz{%s}r9)rr>r6r:r/r;)�etyper.�args�kw�specr4ZinameZ	imagespec�
class_nameZpart_idZstatemapr'r'r(�_format_elemcreateqs&
rIrBc
Cs�g}|D]�}|\}}|pi}d�t|dd��}dd|||rDd|ndf}d|kr�|�|d�||7}t|d||�\}	}|�|	�||8}|�d	d|�q|�|�qd
�|�|fS)a$Formats a layout list so we can pass the result to ttk::style
    layout and ttk::style settings. Note that the layout doesn't have to
    be a list necessarily.

    E.g.:
      [("Menubutton.background", None),
       ("Menubutton.button", {"children":
           [("Menubutton.focus", {"children":
               [("Menubutton.padding", {"children":
                [("Menubutton.label", {"side": "left", "expand": 1})]
               })]
           })]
       }),
       ("Menubutton.indicator", {"side": "right"})
      ]

      returns:

      Menubutton.background
      Menubutton.button -children {
        Menubutton.focus -children {
          Menubutton.padding -children {
            Menubutton.label -side left -expand 1
          }
        }
      }
      Menubutton.indicator -side rightr9T)�childrenz%s%s%sz %sr8rJz -children {z%s}�
)r;r6r2�_format_layoutlist)
�layout�indentZindent_sizer.Zlayout_elem�elemr4Zfopts�headZ	newscriptr'r'r(rL�s"
�
rLcCsXg}|��D�]>\}}|�d�rFd�t|dd��}|�d||f�|�d�rvd�t|dd��}|�d||f�d|kr�|ds�d}nt|d�\}}|�d	||f�|�d
�r|d
}|d}d}|t|�kr�t||d
�s�|d7}q�|d|�}	|t|�k�r||�r||ni}
t	|df|	�|
�\}}|�d||||f�qd�|�S)z�Returns an appropriate script, based on settings, according to
    theme_settings definition to be used by theme_settings and
    theme_create.�	configurer9Tzttk::style configure %s %s;�mapzttk::style map %s %s;rM�nullzttk::style layout %s {
%s
}zelement createrr7r1z%ttk::style element create %s %s %s %srK)
r1r"r;r6r2r@rLr:�hasattrrI)�settingsr.�namer4�s�_ZeoptsrDZargcZelemargsZelemkwrGr'r'r(�_script_from_settings�s:



$�
rYcCs�t|t�r|Sg}t|�}t||�D]j\}}t|d�rDt|���}n(t|t�rX|��}nt|ttf�sl|f}t|d�r~t|�}|�||f��q$|S)ztConstruct a list from the given statespec tuple according to the
    accepted statespec accepted by _format_mapdict.�typename)	r*�str�iter�ziprT�splitr,r+r2)Zstuple�result�itr<r=r'r'r(�_list_from_statespec�s




racCs�|�|�}g}d}|t|�kr�||}i}|�||f�|d7}|t|�kr|||d�\}}|�d�slq|dd�}|d7}|dkr�t||�}|||<q@q|S)zpConstruct a list from the tuple returned by ttk::layout, this is
    somewhat the reverse of _format_layoutlist.rr7rB�-NrJ)�	splitlistr:r2�
startswith�_list_from_layouttuple)r#Zltuple�resZindxrVr4r5r=r'r'r(res$


recGs4t|�}|j||�}t|�dr&|St||td�S)ahFormat options then call Tk command with args and options and return
    the appropriate result.

    If no option is specified, a dict is returned. If an option is
    specified with the None value, the value for that option is returned.
    Otherwise, the function just sets the passed options and the caller
    shouldn't be expecting a return value anyway.rB)�conv)r6�callr:r�
_tclobj_to_py)r#�optionsrErfr'r'r(�_val_or_dict!s
rkc	Cs2t|�}zt|�}Wnttfk
r,YnX|S)zAConverts a value to, hopefully, a more appropriate Python object.)r[�int�
ValueError�	TypeError)r-r'r'r(�_convert_stringval1srocCs(t|t�r$d|krt|�}nt|�}|S)N�.)r*r[�floatrl)�xr'r'r(�
_to_number;s


rscCs\|rFt|d�rFt|t�sFt|ddd�dkr6t|�}qXttt|��}nt|d�rXt|�}|S)z8Return value converted from Tcl object to Python object.�__len__rrZNZ	StateSpec)rTr*r[�getattrrar+rRro)r=r'r'r(riCs

ricCs"|��D]\}}t|�||<q|S)zOReturns adict with its values converted from Tcl objects to Python
    objects.)r1ri)Zadictr5r=r'r'r(rPscCs|dkrt��}|S)aIf master is not None, itself is returned. If master is None,
    the default master is returned if there is one, otherwise a new
    master is created and returned.

    If it is not allowed to use the default root and master is None,
    RuntimeError is raised.N)�tkinterZ_get_default_root)r&r'r'r(rXsc@s�eZdZdZdZddd�Zddd�Zddd	�Zdd
d�Zd dd
�Z	dd�Z
dd�Zdd�Zd!dd�Z
dd�Zdd�Zd"dd�ZdS)#rzManipulate style database.z
ttk::styleNcCs0t|�}t|dd�st|�||_|jj|_dS)Nr%F)rrur)r&r#)�selfr&r'r'r(�__init__is
zStyle.__init__cKs4|dk	rd||<t|j||jd|�}|s,|r0|SdS)z�Query or sets the default value of the specified option(s) in
        style.

        Each key in kw is an option and each value is either a string or
        a sequence identifying the value for that option.NrQ)rkr#�_name�rw�styleZ	query_optrFr_r'r'r(rQts
zStyle.configurecsj|dk	r0�j��jd|d|�}t�j�|��S�jj�jd|ft|���}�fdd�t�j|���D�S)aSQuery or sets dynamic values of the specified option(s) in
        style.

        Each key in kw is an option and each value should be a list or a
        tuple (usually) containing statespecs grouped in tuples, or list,
        or something else of your preference. A statespec is compound of
        one or more states and then a value.NrRr0cs"i|]\}}|t�j�|���qSr')rar#rc)�.0�k�v�rwr'r(�
<dictcomp>�s�zStyle.map.<locals>.<dictcomp>)r#rhryrarcr@rr1rzr'rr(rR�s
�z	Style.mapcCs.|rd�|�nd}|j�|jd|d|||�S)aReturns the value specified for option in style.

        If state is specified it is expected to be a sequence of one
        or more states. If the default argument is set, it is used as
        a fallback value in case no specification for option is found.r9r8�lookupr0)r;r#rhry)rwr{�optionr<�defaultr'r'r(r��s
�zStyle.lookupcCs>d}|rt|�d}n|dk	r"d}t|j|j�|jd||��S)a�Define the widget layout for given style. If layoutspec is
        omitted, return the layout specification for given style.

        layoutspec is expected to be a list or an object different than
        None that evaluates to False if you want to "turn off" that style.
        If it is a list (or tuple, or something else), each item should be
        a tuple where the first item is the layout name and the second item
        should have the format described below:

        LAYOUTS

            A layout can contain the value None, if takes no options, or
            a dict of options specifying how to arrange the element.
            The layout mechanism uses a simplified version of the pack
            geometry manager: given an initial cavity, each element is
            allocated a parcel. Valid options/values are:

                side: whichside
                    Specifies which side of the cavity to place the
                    element; one of top, right, bottom or left. If
                    omitted, the element occupies the entire cavity.

                sticky: nswe
                    Specifies where the element is placed inside its
                    allocated parcel.

                children: [sublayout... ]
                    Specifies a list of elements to place inside the
                    element. Each element is a tuple (or other sequence)
                    where the first item is the layout name, and the other
                    is a LAYOUT.NrrSrM)rLrer#rhry)rwr{Z
layoutspecZlspecr'r'r(rM�s �zStyle.layoutcOs8t|df|�|�\}}|jj|jdd|||f|��dS)z9Create a new element in the current theme of given etype.F�element�createN)rIr#rhry)rw�elementnamerDrErFrGr4r'r'r(�element_create�s��zStyle.element_createc	Cs(tdd�|j�|j�|jdd��D��S)z:Returns the list of elements defined in the current theme.css|]}|�d�VqdS�rbN��lstrip)r|�nr'r'r(�	<genexpr>�sz&Style.element_names.<locals>.<genexpr>r��names�r,r#rcrhryrr'r'r(�
element_names�s�zStyle.element_namesc
Cs*tdd�|j�|j�|jdd|��D��S)z)Return the list of elementname's options.css|]}|�d�VqdSr�r�)r|�or'r'r(r��sz(Style.element_options.<locals>.<genexpr>r�rjr�)rwr�r'r'r(�element_options�s�zStyle.element_optionsc
CsN|rt|�nd}|r2|j�|jdd|d|d|�n|j�|jdd|d|�dS)a.Creates a new theme.

        It is an error if themename already exists. If parent is
        specified, the new theme will inherit styles, elements and
        layouts from the specified parent theme. If settings are present,
        they are expected to have the same syntax used for theme_settings.r8�themer�z-parentz	-settingsN�rYr#rhry)rw�	themename�parentrUr.r'r'r(�theme_create�s��zStyle.theme_createcCs"t|�}|j�|jdd||�dS)a�Temporarily sets the current theme to themename, apply specified
        settings and then restore the previous theme.

        Each key in settings is a style and each value may contain the
        keys 'configure', 'map', 'layout' and 'element create' and they
        are expected to have the same format as specified by the methods
        configure, map, layout and element_create respectively.r�rUNr�)rwr�rUr.r'r'r(�theme_settings�szStyle.theme_settingscCs|j�|j�|jdd��S)z#Returns a list of all known themes.r�r�)r#rcrhryrr'r'r(�theme_names�szStyle.theme_namescCs&|dkr|j�d�S|j�d|�dS)z�If themename is None, returns the theme in use, otherwise, set
        the current theme to themename, refreshes all widgets and emits
        a <<ThemeChanged>> event.Nzreturn $ttk::currentThemez
ttk::setTheme)r#r$rh)rwr�r'r'r(�	theme_use�szStyle.theme_use)N)N)N)NN)N)NN)N)�__name__�
__module__�__qualname__�__doc__ryrxrQrRr�rMr�r�r�r�r�r�r�r'r'r'r(rds




+
c@s6eZdZdZddd�Zdd�Zddd�Zd
d	d
�ZdS)�Widgetz!Base class for Tk themed widgets.NcCs4t|�}t|dd�st|�tjj||||d�dS)a�Constructs a Ttk Widget with the parent master.

        STANDARD OPTIONS

            class, cursor, takefocus, style

        SCROLLABLE WIDGET OPTIONS

            xscrollcommand, yscrollcommand

        LABEL WIDGET OPTIONS

            text, textvariable, underline, image, compound, width

        WIDGET STATES

            active, disabled, focus, pressed, selected, background,
            readonly, alternate, invalid
        r%F)rFN)rrur)rvr�rx)rwr&Z
widgetnamerFr'r'r(rxszWidget.__init__cCs|j�|jd||�S)z�Returns the name of the element at position x, y, or the empty
        string if the point does not lie within any element.

        x and y are pixel coordinates relative to the widget.�identify�r#rh�_w�rwrr�yr'r'r(r�+szWidget.identifyc	Os6|j�|j�|jdd�|���}|r2|r2|||�S|S)a1Test the widget's state.

        If callback is not specified, returns True if the widget state
        matches statespec and False otherwise. If callback is specified,
        then it will be invoked with *args, **kw if the widget state
        matches statespec. statespec is expected to be a sequence.�instater9)r#�
getbooleanrhr�r;)rw�	statespec�callbackrErFZretr'r'r(r�3s�
zWidget.instatecCs0|dk	rd�|�}|j�t|j�|jd|���S)aModify or inquire widget state.

        Widget state is returned if statespec is None, otherwise it is
        set according to the statespec flags and then a new state spec
        is returned indicating which flags were changed. statespec is
        expected to be a sequence.Nr9r<)r;r#rcr[rhr�)rwr�r'r'r(r<Bs
zWidget.state)N)N)N)r�r�r�r�rxr�r�r<r'r'r'r(r�
s


r�c@s"eZdZdZddd�Zdd�ZdS)rzcTtk Button widget, displays a textual label and/or image, and
    evaluates a command when pressed.NcKst�||d|�dS)aConstruct a Ttk Button widget with the parent master.

        STANDARD OPTIONS

            class, compound, cursor, image, state, style, takefocus,
            text, textvariable, underline, width

        WIDGET-SPECIFIC OPTIONS

            command, default, width
        zttk::buttonN�r�rx�rwr&rFr'r'r(rxSszButton.__init__cCs|j�|jd�S)z/Invokes the command associated with the button.�invoker�rr'r'r(r�bsz
Button.invoke)N�r�r�r�r�rxr�r'r'r'r(rOs
c@s"eZdZdZddd�Zdd�ZdS)rz;Ttk Checkbutton widget which is either in on- or off-state.NcKst�||d|�dS)a'Construct a Ttk Checkbutton widget with the parent master.

        STANDARD OPTIONS

            class, compound, cursor, image, state, style, takefocus,
            text, textvariable, underline, width

        WIDGET-SPECIFIC OPTIONS

            command, offvalue, onvalue, variable
        zttk::checkbuttonNr�r�r'r'r(rxjszCheckbutton.__init__cCs|j�|jd�S)aWToggles between the selected and deselected states and
        invokes the associated command. If the widget is currently
        selected, sets the option variable to the offvalue option
        and deselects the widget; otherwise, sets the option variable
        to the option onvalue.

        Returns the result of the associated command.r�r�rr'r'r(r�yszCheckbutton.invoke)Nr�r'r'r'r(rgs
c@s2eZdZdZddd�Zdd�Zdd�Zd	d
�ZdS)rzeTtk Entry widget displays a one-line text string and allows that
    string to be edited by the user.NcKst�|||pd|�dS)a�Constructs a Ttk Entry widget with the parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus, xscrollcommand

        WIDGET-SPECIFIC OPTIONS

            exportselection, invalidcommand, justify, show, state,
            textvariable, validate, validatecommand, width

        VALIDATION MODES

            none, key, focus, focusin, focusout, all
        z
ttk::entryNr�)rwr&ZwidgetrFr'r'r(rx�szEntry.__init__cCs|�|j�|jd|��S)zqReturn a tuple of (x, y, width, height) which describes the
        bounding box of the character given by index.�bbox�Z_getintsr#rhr�)rw�indexr'r'r(r��sz
Entry.bboxcCs|j�|jd||�S)zxReturns the name of the element at position x, y, or the
        empty string if the coordinates are outside the window.r�r�r�r'r'r(r��szEntry.identifycCs|j�|j�|jd��S)z�Force revalidation, independent of the conditions specified
        by the validate option. Returns False if validation fails, True
        if it succeeds. Sets or clears the invalid state accordingly.�validate�r#r�rhr�rr'r'r(r��szEntry.validate)NN)r�r�r�r�rxr�r�r�r'r'r'r(r�s

c@s,eZdZdZd	dd�Zd
dd�Zdd�ZdS)rzMTtk Combobox widget combines a text field with a pop-down list of
    values.NcKstj||df|�dS)aConstruct a Ttk Combobox widget with the parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS

            exportselection, justify, height, postcommand, state,
            textvariable, values, width
        z
ttk::comboboxN�rrxr�r'r'r(rx�szCombobox.__init__cCs2|dkr |j�|j�|jd��S|j�|jd|�S)aIf newindex is supplied, sets the combobox value to the
        element at position newindex in the list of values. Otherwise,
        returns the index of the current value in the list of values
        or -1 if the current value does not appear in the list.N�current�r#Zgetintrhr�)rwZnewindexr'r'r(r��szCombobox.currentcCs|j�|jd|�dS)z(Sets the value of the combobox to value.�setNr��rwr-r'r'r(r��szCombobox.set)N)N)r�r�r�r�rxr�r�r'r'r'r(r�s


c@seZdZdZddd�ZdS)rzJTtk Frame widget is a container, used to group other widgets
    together.NcKst�||d|�dS)z�Construct a Ttk Frame with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS

            borderwidth, relief, padding, width, height
        z
ttk::frameNr�r�r'r'r(rx�szFrame.__init__)N�r�r�r�r�rxr'r'r'r(r�sc@seZdZdZddd�ZdS)rz7Ttk Label widget displays a textual label and/or image.NcKst�||d|�dS)aGConstruct a Ttk Label with parent master.

        STANDARD OPTIONS

            class, compound, cursor, image, style, takefocus, text,
            textvariable, underline, width

        WIDGET-SPECIFIC OPTIONS

            anchor, background, font, foreground, justify, padding,
            relief, text, wraplength
        z
ttk::labelNr�r�r'r'r(rx�s
zLabel.__init__)Nr�r'r'r'r(r�sc@seZdZdZddd�ZdS)rz�Ttk Labelframe widget is a container used to group other widgets
    together. It has an optional label, which may be a plain text string
    or another widget.NcKst�||d|�dS)z�Construct a Ttk Labelframe with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS
            labelanchor, text, underline, padding, labelwidget, width,
            height
        zttk::labelframeNr�r�r'r'r(rx�szLabelframe.__init__)Nr�r'r'r'r(r�sc@seZdZdZddd�ZdS)r	zbTtk Menubutton widget displays a textual label and/or image, and
    displays a menu when pressed.NcKst�||d|�dS)aConstruct a Ttk Menubutton with parent master.

        STANDARD OPTIONS

            class, compound, cursor, image, state, style, takefocus,
            text, textvariable, underline, width

        WIDGET-SPECIFIC OPTIONS

            direction, menu
        zttk::menubuttonNr�r�r'r'r(rxszMenubutton.__init__)Nr�r'r'r'r(r	
sc@sneZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
ddd�Zddd�Zdd�Z
dd�ZdS)r
z�Ttk Notebook widget manages a collection of windows and displays
    a single one at a time. Each child window is associated with a tab,
    which the user may select to change the currently-displayed window.NcKst�||d|�dS)a\Construct a Ttk Notebook with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS

            height, padding, width

        TAB OPTIONS

            state, sticky, padding, text, image, compound, underline

        TAB IDENTIFIERS (tab_id)

            The tab_id argument found in several methods may take any of
            the following forms:

                * An integer between zero and the number of tabs
                * The name of a child window
                * A positional specification of the form "@x,y", which
                  defines the tab
                * The string "current", which identifies the
                  currently-selected tab
                * The string "end", which returns the number of tabs (only
                  valid for method index)
        z
ttk::notebookNr�r�r'r'r(rx"szNotebook.__init__cKs |jj|jd|ft|���dS)z�Adds a new tab to the notebook.

        If window is currently managed by the notebook but hidden, it is
        restored to its previous position.�addN�r#rhr�r6)rw�childrFr'r'r(r�BszNotebook.addcCs|j�|jd|�dS)zXRemoves the tab specified by tab_id, unmaps and unmanages the
        associated window.�forgetNr��rw�tab_idr'r'r(r�JszNotebook.forgetcCs|j�|jd|�dS)z�Hides the tab specified by tab_id.

        The tab will not be displayed, but the associated window remains
        managed by the notebook and its configuration remembered. Hidden
        tabs may be restored with the add command.�hideNr�r�r'r'r(r�Psz
Notebook.hidecCs|j�|jd||�S)zZReturns the name of the tab element at position x, y, or the
        empty string if none.r�r�r�r'r'r(r�YszNotebook.identifycCs|j�|j�|jd|��S)z|Returns the numeric index of the tab specified by tab_id, or
        the total number of tabs if tab_id is the string "end".r�r�r�r'r'r(r�_szNotebook.indexcKs"|jj|jd||ft|���dS)z�Inserts a pane at the specified position.

        pos is either the string end, an integer index, or the name of
        a managed child. If child is already managed by the notebook,
        moves it to the specified position.�insertNr��rw�posr�rFr'r'r(r�eszNotebook.insertcCs|j�|jd|�S)z�Selects the specified tab.

        The associated child window will be displayed, and the
        previously-selected window (if different) is unmapped. If tab_id
        is omitted, returns the widget name of the currently selected
        pane.�selectr�r�r'r'r(r�nszNotebook.selectcKs$|dk	rd||<t|j||jd|�S)z�Query or modify the options of the specific tab_id.

        If kw is not given, returns a dict of the tab option values. If option
        is specified, returns the value of that option. Otherwise, sets the
        options to the corresponding values.N�tab�rkr#r�)rwr�r�rFr'r'r(r�xszNotebook.tabcCs|j�|j�|jd�pd�S)z2Returns a list of windows managed by the notebook.�tabsr'�r#rcrhr�rr'r'r(r��sz
Notebook.tabscCs|j�d|j�dS)a�Enable keyboard traversal for a toplevel window containing
        this notebook.

        This will extend the bindings for the toplevel window containing
        this notebook as follows:

            Control-Tab: selects the tab following the currently selected
                         one

            Shift-Control-Tab: selects the tab preceding the currently
                               selected one

            Alt-K: where K is the mnemonic (underlined) character of any
                   tab, will select that tab.

        Multiple notebooks in a single toplevel may be enabled for
        traversal, including nested notebooks. However, notebook traversal
        only works properly if all panes are direct children of the
        notebook.zttk::notebook::enableTraversalNr�rr'r'r(�enable_traversal�szNotebook.enable_traversal)N)N)N)r�r�r�r�rxr�r�r�r�r�r�r�r�r�r�r'r'r'r(r
s
 		


c@s>eZdZdZddd�ZejjZdd�Zddd�Z	d
d	d
�Z
dS)rzfTtk Panedwindow widget displays a number of subwindows, stacked
    either vertically or horizontally.NcKst�||d|�dS)z�Construct a Ttk Panedwindow with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS

            orient, width, height

        PANE OPTIONS

            weight
        zttk::panedwindowNr�r�r'r'r(rx�szPanedwindow.__init__cKs"|jj|jd||ft|���dS)z�Inserts a pane at the specified positions.

        pos is either the string end, and integer index, or the name
        of a child. If child is already managed by the paned window,
        moves it to the specified position.r�Nr�r�r'r'r(r��szPanedwindow.insertcKs$|dk	rd||<t|j||jd|�S)aQQuery or modify the options of the specified pane.

        pane is either an integer index or the name of a managed subwindow.
        If kw is not given, returns a dict of the pane option values. If
        option is specified then the value for that option is returned.
        Otherwise, sets the options to the corresponding values.N�paner�)rwr�r�rFr'r'r(r��szPanedwindow.panecCs|j�|j�|jd||��S)aLIf newpos is specified, sets the position of sash number index.

        May adjust the positions of adjacent sashes to ensure that
        positions are monotonically increasing. Sash positions are further
        constrained to be between 0 and the total size of the widget.

        Returns the new position of sash number index.�sashposr�)rwr�Znewposr'r'r(r��szPanedwindow.sashpos)N)N)N)r�r�r�r�rxrvrr�r�r�r�r'r'r'r(r�s
	
c@s6eZdZdZddd�Zddd�Zd
dd�Zd	d
�ZdS)r
a6Ttk Progressbar widget shows the status of a long-running
    operation. They can operate in two modes: determinate mode shows the
    amount completed relative to the total amount of work to be done, and
    indeterminate mode provides an animated display to let the user know
    that something is happening.NcKst�||d|�dS)z�Construct a Ttk Progressbar with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS

            orient, length, mode, maximum, value, variable, phase
        zttk::progressbarNr�r�r'r'r(rx�szProgressbar.__init__cCs|j�|jd|�dS)z�Begin autoincrement mode: schedules a recurring timer event
        that calls method step every interval milliseconds.

        interval defaults to 50 milliseconds (20 steps/second) if omitted.�startNr�)rwZintervalr'r'r(r��szProgressbar.startcCs|j�|jd|�dS)zRIncrements the value option by amount.

        amount defaults to 1.0 if omitted.�stepNr�)rwZamountr'r'r(r��szProgressbar.stepcCs|j�|jd�dS)zVStop autoincrement mode: cancels any recurring timer event
        initiated by start.�stopNr�rr'r'r(r�szProgressbar.stop)N)N)N)r�r�r�r�rxr�r�r�r'r'r'r(r
�s



c@s"eZdZdZddd�Zdd�ZdS)rzeTtk Radiobutton widgets are used in groups to show or change a
    set of mutually-exclusive options.NcKst�||d|�dS)aConstruct a Ttk Radiobutton with parent master.

        STANDARD OPTIONS

            class, compound, cursor, image, state, style, takefocus,
            text, textvariable, underline, width

        WIDGET-SPECIFIC OPTIONS

            command, value, variable
        zttk::radiobuttonNr�r�r'r'r(rxszRadiobutton.__init__cCs|j�|jd�S)z�Sets the option variable to the option value, selects the
        widget, and invokes the associated command.

        Returns the result of the command, or an empty string if
        no command is specified.r�r�rr'r'r(r�szRadiobutton.invoke)Nr�r'r'r'r(rs
c@s.eZdZdZd	dd�Zd
dd�Zddd�ZdS)rzTtk Scale widget is typically used to control the numeric value of
    a linked variable that varies uniformly over some range.NcKst�||d|�dS)z�Construct a Ttk Scale with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS

            command, from, length, orient, to, value, variable
        z
ttk::scaleNr�r�r'r'r(rx'szScale.__init__cKsTtj||f|�}t|td�tf�s,|�|�td|kd|kd|kg�rP|�d�|S)z�Modify or query scale options.

        Setting a value for any of the "from", "from_" or "to" options
        generates a <<RangeChanged>> event.NrC�from_�to�<<RangeChanged>>)r�rQr*�typer[�update�anyZevent_generate)rwZcnfrFZretvalr'r'r(rQ5s

zScale.configurecCs|j�|jd||�S)z�Get the current value of the value option, or the value
        corresponding to the coordinates x, y if they are specified.

        x and y are pixel coordinates relative to the scale widget
        origin.r"r�r�r'r'r(r"Bsz	Scale.get)N)N)NN)r�r�r�r�rxrQr"r'r'r'r(r#s


c@seZdZdZddd�ZdS)rz;Ttk Scrollbar controls the viewport of a scrollable widget.NcKst�||d|�dS)z�Construct a Ttk Scrollbar with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS

            command, orient
        zttk::scrollbarNr�r�r'r'r(rxNszScrollbar.__init__)Nr�r'r'r'r(rKsc@seZdZdZddd�ZdS)rzITtk Separator widget displays a horizontal or vertical separator
    bar.NcKst�||d|�dS)z�Construct a Ttk Separator with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS

            orient
        zttk::separatorNr�r�r'r'r(rx`szSeparator.__init__)Nr�r'r'r'r(r\sc@seZdZdZddd�ZdS)rzlTtk Sizegrip allows the user to resize the containing toplevel
    window by pressing and dragging the grip.NcKst�||d|�dS)z�Construct a Ttk Sizegrip with parent master.

        STANDARD OPTIONS

            class, cursor, state, style, takefocus
        z
ttk::sizegripNr�r�r'r'r(rxrszSizegrip.__init__)Nr�r'r'r'r(rnsc@s"eZdZdZddd�Zdd�ZdS)rz�Ttk Spinbox is an Entry with increment and decrement arrows

    It is commonly used for number entry or to select from a list of
    string values.
    NcKstj||df|�dS)a/Construct a Ttk Spinbox widget with the parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus, validate,
            validatecommand, xscrollcommand, invalidcommand

        WIDGET-SPECIFIC OPTIONS

            to, from_, increment, values, wrap, format, command
        zttk::spinboxNr�r�r'r'r(rx�szSpinbox.__init__cCs|j�|jd|�dS)z'Sets the value of the Spinbox to value.r�Nr�r�r'r'r(r��szSpinbox.set)N)r�r�r�r�rxr�r'r'r'r(r|s
c@s4eZdZdZdEdd�ZdFdd�ZdGdd�Zd	d
�ZdHdd�Zd
d�Z	dd�Z
dd�ZdIdd�ZdJdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�ZdKd#d$�ZdLd%d&�Zd'd(�ZeZd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Z d;d<�Z!dMd=d>�Z"dNd?d@�Z#dOdAdB�Z$dPdCdD�Z%dS)Qrz�Ttk Treeview widget displays a hierarchical collection of items.

    Each item has a textual label, an optional image, and an optional list
    of data values. The data values are displayed in successive columns
    after the tree label.NcKst�||d|�dS)a�Construct a Ttk Treeview with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus, xscrollcommand,
            yscrollcommand

        WIDGET-SPECIFIC OPTIONS

            columns, displaycolumns, height, padding, selectmode, show

        ITEM OPTIONS

            text, image, values, open, tags

        TAG OPTIONS

            foreground, background, font, image
        z
ttk::treeviewNr�r�r'r'r(rx�szTreeview.__init__cCs|�|j�|jd||��pdS)aTReturns the bounding box (relative to the treeview widget's
        window) of the specified item in the form x y width height.

        If column is specified, returns the bounding box of that cell.
        If the item is not visible (i.e., if it is a descendant of a
        closed item or is scrolled offscreen), returns an empty string.r�r8r�)rw�item�columnr'r'r(r��sz
Treeview.bboxcCs"|j�|j�|jd|pd�pd�S)zhReturns a tuple of children belonging to item.

        If item is not specified, returns root children.rJr8r'r��rwr�r'r'r(�get_children�s�zTreeview.get_childrencGs|j�|jd||�dS)z�Replaces item's child with newchildren.

        Children present in item that are not present in newchildren
        are detached from tree. No items in newchildren may be an
        ancestor of item.rJNr�)rwr�Znewchildrenr'r'r(�set_children�szTreeview.set_childrencKs$|dk	rd||<t|j||jd|�S)a
Query or modify the options for the specified column.

        If kw is not given, returns a dict of the column option values. If
        option is specified then the value for that option is returned.
        Otherwise, sets the options to the corresponding values.Nr�r�)rwr�r�rFr'r'r(r��szTreeview.columncGs|j�|jd|�dS)z_Delete all specified items and all their descendants. The root
        item may not be deleted.�deleteNr��rwr1r'r'r(r��szTreeview.deletecGs|j�|jd|�dS)z�Unlinks all of the specified items from the tree.

        The items and all of their descendants are still present, and may
        be reinserted at another point in the tree, but will not be
        displayed. The root item may not be detached.�detachNr�r�r'r'r(r��szTreeview.detachcCs|j�|j�|jd|��S)zSReturns True if the specified item is present in the tree,
        False otherwise.�existsr�r�r'r'r(r��szTreeview.existscCs|j�|jd|�S)z}If item is specified, sets the focus item to item. Otherwise,
        returns the current focus item, or '' if there is none.�focusr�r�r'r'r(r��szTreeview.focuscKsP|�d�}|r,t|t�s,|j�||j�|d<|dk	r<d||<t|j||jd|�S)a_Query or modify the heading options for the specified column.

        If kw is not given, returns a dict of the heading option values. If
        option is specified then the value for that option is returned.
        Otherwise, sets the options to the corresponding values.

        Valid options/values are:
            text: text
                The text to display in the column heading
            image: image_name
                Specifies an image to display to the right of the column
                heading
            anchor: anchor
                Specifies how the heading text should be aligned. One of
                the standard Tk anchor values
            command: callback
                A callback to be invoked when the heading label is
                pressed.

        To configure the tree column heading, call this with column = "#0" �commandN�heading)	r"r*r[r&�registerZ_substituterkr#r�)rwr�r�rF�cmdr'r'r(r��s
zTreeview.headingcCs|j�|jd|||�S)z�Returns a description of the specified component under the
        point given by x and y, or the empty string if no such component
        is present at that position.r�r�)rwZ	componentrrr�r'r'r(r�szTreeview.identifycCs|�dd|�S)z.Returns the item ID of the item at position y.�rowr�r�)rwr�r'r'r(�identify_rowszTreeview.identify_rowcCs|�d|d�S)zaReturns the data column identifier of the cell at position x.

        The tree column has ID #0.r�rr�)rwrrr'r'r(�identify_column"szTreeview.identify_columncCs|�d||�S)z�Returns one of:

        heading: Tree heading area.
        separator: Space between two columns headings;
        tree: The tree area.
        cell: A data cell.

        * Availability: Tk 8.6Zregionr�r�r'r'r(�identify_region)s	zTreeview.identify_regioncCs|�d||�S)zEReturns the element at position x, y.

        * Availability: Tk 8.6r�r�r�r'r'r(�identify_element5szTreeview.identify_elementcCs|j�|j�|jd|��S)zOReturns the integer index of item within its parent's list
        of children.r�r�r�r'r'r(r�<szTreeview.indexcKsNt|�}|dk	r0|jj|jd||d|f|��}n|jj|jd||f|��}|S)a�Creates a new item and return the item identifier of the newly
        created item.

        parent is the item ID of the parent item, or the empty string
        to create a new top-level item. index is an integer, or the value
        end, specifying where in the list of parent's children to insert
        the new item. If index is less than or equal to zero, the new node
        is inserted at the beginning, if index is greater than or equal to
        the current number of children, it is inserted at the end. If iid
        is specified, it is used as the item identifier, iid must not
        already exist in the tree. Otherwise, a new unique identifier
        is generated.Nr�z-id)r6r#rhr�)rwr�r�ZiidrFr4rfr'r'r(r�Bs
��zTreeview.insertcKs$|dk	rd||<t|j||jd|�S)a-Query or modify the options for the specified item.

        If no options are given, a dict with options/values for the item
        is returned. If option is specified then the value for that option
        is returned. Otherwise, sets the options to the corresponding
        values as given by kw.Nr�r�)rwr�r�rFr'r'r(r�Ysz
Treeview.itemcCs|j�|jd|||�dS)aRMoves item to position index in parent's list of children.

        It is illegal to move an item under one of its descendants. If
        index is less than or equal to zero, item is moved to the
        beginning, if greater than or equal to the number of children,
        it is moved to the end. If item was detached it is reattached.�moveNr�)rwr�r�r�r'r'r(r�esz
Treeview.movecCs|j�|jd|�S)zeReturns the identifier of item's next sibling, or '' if item
        is the last child of its parent.�nextr�r�r'r'r(r�qsz
Treeview.nextcCs|j�|jd|�S)zaReturns the ID of the parent of item, or '' if item is at the
        top level of the hierarchy.r�r�r�r'r'r(r�wszTreeview.parentcCs|j�|jd|�S)zjReturns the identifier of item's previous sibling, or '' if
        item is the first child of its parent.�prevr�r�r'r'r(r�}sz
Treeview.prevcCs|j�|jd|�dS)z�Ensure that item is visible.

        Sets all of item's ancestors open option to True, and scrolls
        the widget if necessary so that item is within the visible
        portion of the tree.�seeNr�r�r'r'r(r��szTreeview.seecCs|j�|j�|jd��S)z$Returns the tuple of selected items.�	selectionr�rr'r'r(r��szTreeview.selectioncCs>t|�dkr&t|dttf�r&|d}|j�|jd||�dS)Nr7rr�)r:r*r,r+r#rhr�)rwZselopr1r'r'r(�
_selection�szTreeview._selectioncGs|�d|�dS)z.The specified items becomes the new selection.r�N�r�r�r'r'r(�
selection_set�szTreeview.selection_setcGs|�d|�dS)z0Add all of the specified items to the selection.r�Nr�r�r'r'r(�
selection_add�szTreeview.selection_addcGs|�d|�dS)z5Remove all of the specified items from the selection.�removeNr�r�r'r'r(�selection_remove�szTreeview.selection_removecGs|�d|�dS)z2Toggle the selection state of each specified item.ZtoggleNr�r�r'r'r(�selection_toggle�szTreeview.selection_togglecCs@|j�|jd|||�}|dkr8|dkr8t|j|dtd�S|SdS)a;Query or set the value of given item.

        With one argument, return a dictionary of column/value pairs
        for the specified item. With two arguments, return the current
        value of the specified column. With three arguments, set the
        value of given column in given item to the specified value.r�NF)Z	cut_minusrg)r#rhr�rri)rwr�r�r-rfr'r'r(r��s�zTreeview.setcCs |j|jdd|f||dd�dS)z�Bind a callback for the given event sequence to the tag tagname.
        When an event is delivered to an item, the callbacks for each
        of the item's tags option are called.�tag�bindr)r�N)Z_bindr�)rw�tagnameZsequencer�r'r'r(�tag_bind�szTreeview.tag_bindcKs&|dk	rd||<t|j||jdd|�S)aBQuery or modify the options for the specified tagname.

        If kw is not given, returns a dict of the option settings for tagname.
        If option is specified, returns the value for that option for the
        specified tagname. Otherwise, sets the options to the corresponding
        values for the given tagname.Nr�rQr�)rwr�r�rFr'r'r(�
tag_configure�s
�zTreeview.tag_configurec	CsF|dkr$|j�|j�|jdd|��S|j�|j�|jdd||��SdS)z�If item is specified, returns 1 or 0 depending on whether the
        specified item has the given tagname. Otherwise, returns a list of
        all items which have the specified tag.

        * Availability: Tk 8.6Nr�Zhas)r#rcrhr�r�)rwr�r�r'r'r(�tag_has�s��zTreeview.tag_has)N)N)N)N)N)N)N)N)NN)NN)N)N)&r�r�r�r�rxr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�Zreattachr�r�r�r�r�r�r�r�r�r�r�r�r�r�r'r'r'r(r�sF



	
	

 

		



csLeZdZdZddd�Z�fdd�Zd	d
�Zedd��Zej	d
d��Z�Z
S)rz�A Ttk Scale widget with a Ttk Label widget indicating its
    current value.

    The Ttk Scale can be accessed through instance.scale, and Ttk Label
    can be accessed through instance.labelNr�
c	Ks|�dd�dk|_tj||f|�|p.t�|�|_|j�|�||_t	|�|_
t||j||d�|_|j�
d|j�|jr|dnd}|dkr�dnd}|jj|dd�t	|�}|j|d�|��|j
j|dkr�d	nd
d�|j�d|j�|_|�
d
|j�|�
d|j�dS)a�Construct a horizontal LabeledScale with parent master, a
        variable to be associated with the Ttk Scale widget and its range.
        If variable is not specified, a tkinter.IntVar is created.

        WIDGET-SPECIFIC OPTIONS

            compound: 'top' or 'bottom'
                Specifies how to display the label relative to the scale.
                Defaults to 'top'.
        Zcompound�top)�variabler�r�r�Zbottomrr)�sideZfill)r�r�rW)Zanchor�wz<Configure>z<Map>N)�pop�
_label_toprrxrvZIntVar�	_variabler��_last_validr�labelr�scaler��_adjustZpack�lowerZplaceZtrace_variable�_LabeledScale__tracecb)	rwr&r�r�r�rFZ
scale_sideZ
label_sideZdummyr'r'r(rx�s$
zLabeledScale.__init__csHz|j�d|j�Wntk
r(YnX|`t���d|_d|_dS)z9Destroy this widget and possibly its associated variable.r�N)r�Z
trace_vdeleter�AttributeError�super�destroyrrr��	__class__r'r(rs
zLabeledScale.destroycs��fdd�}t�jd�}t�jd�}||kr:||}}�j��}||krX|ksfn�j�_dS|�_|�jd<��|�dS)z1Adjust the label position according to the scale.csZ����j��\}}�jr2�j���j��}n�j���j��}�jj||d�dS)N�rrr�)Zupdate_idletasksrZcoordsr�Zwinfo_yrZwinfo_reqheightZplace_configurerrr'r(�adjust_labelsz*LabeledScale._adjust.<locals>.adjust_labelrCr�N�text)rsrr�r"rr-rZ
after_idle)rwrErr�r�Znewvalr'rr(rs


zLabeledScale._adjustcCs
|j��S)zReturn current scale value.)r�r"rr'r'r(r-4szLabeledScale.valuecCs|j�|�dS)zSet new scale value.N)r�r�)rwr=r'r'r(r-9s)NNrr�)r�r�r�r�rxrr�propertyr-�setter�
__classcell__r'r'r	r(r�s
&

cs<eZdZdZddd�Zdd�Zddd�Z�fd	d
�Z�ZS)
rzmThemed OptionMenu, based after tkinter's OptionMenu, which allows
    the user to select a value from a menu.NcOs�||�dd�|�dd�d�}tj||f|�tj|dd�|d<||_|�dd�|_|rpt�d	tt	|�
�����|j|f|��dS)
a9Construct a themed OptionMenu widget with master as the parent,
        the resource textvariable set to variable, the initially selected
        value specified by the default parameter, the menu values given by
        *values and additional keywords.

        WIDGET-SPECIFIC OPTIONS

            style: stylename
                Menubutton style.
            direction: 'above', 'below', 'left', 'right', or 'flush'
                Menubutton direction.
            command: callback
                A callback that will be invoked after selecting an item.
        r{N�	direction)Ztextvariabler{rF)Ztearoff�menur�zunknown option -%s)r�r	rxrvZMenur��	_callbackZTclErrorr�r\�keys�set_menu)rwr&r�r��values�kwargsrFr'r'r(rxCs
��zOptionMenu.__init__cCs&|dkr|�t�||��St�||�S)Nr)Znametowidgetr	�__getitem__r�r'r'r(r`szOptionMenu.__getitem__cGsR|d}|�dd�|D]$}|j|t�|j||j�|jd�q|rN|j�|�dS)zUBuild a new menu of radiobuttons with *values and optionally
        a default value.rr�end)rr�r�N)r�Zadd_radiobuttonrvZ_setitr�rr�)rwr�rrr=r'r'r(rgs�zOptionMenu.set_menucs,z|`Wntk
rYnXt���dS)z0Destroy this widget and its associated variable.N)r�rrrrr	r'r(rus
zOptionMenu.destroy)N)N)	r�r�r�r�rxrrrrr'r'r	r(r?s


)F)FN)F)F)rrB)N)6r��__version__�
__author__�__all__rvrrrrZ	TkVersionrr)r/r6r>r@rIrLrYrarerkrorsrirr�objectrr�rrrrrrrrr	r
rrr
rrrrrrZXViewZYViewrrrr'r'r'r(�<module>s��	




%
1*


*B*"8*(J`tkinter/__pycache__/tix.cpython-38.opt-1.pyc000064400000233061151153537530014644 0ustar00U

e5d-,�@sLddlZddlZddlTddlmZddlZdZdZdZdZdZd	Z	d
Z
dZdZd
Z
dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZGdd �d �Z Gd!d"�d"ej!e �Z!Gd#d$�d$�Z"ej#j$e"fej#_$Gd%d&�d&ej#�Z%Gd'd(�d(e%�Z&Gd)d*�d*�Z'Gd+d,�d,e%�Z(Gd-d.�d.e%�Z)Gd/d0�d0e%�Z*Gd1d2�d2e%�Z+Gd3d4�d4e%�Z,Gd5d6�d6e%�Z-Gd7d8�d8e%�Z.Gd9d:�d:e%�Z/Gd;d<�d<e%�Z0Gd=d>�d>e%�Z1Gd?d@�d@e%�Z2GdAdB�dBe%�Z3GdCdD�dDe%�Z4GdEdF�dFe%e5e6�Z7GdGdH�dHe%�Z8GdIdJ�dJe%�Z9GdKdL�dLe%�Z:GdMdN�dNe%�Z;GdOdP�dPe%�Z<GdQdR�dRe%�Z=GdSdT�dTe%�Z>GdUdV�dVe%�Z?GdWdX�dXe%�Z@GdYdZ�dZe%�ZAGd[d\�d\e%�ZBGd]d^�d^e%�ZCGd_d`�d`e%�ZDGdadb�dbe%�ZEGdcdd�dde%�ZFGdedf�dfe%�ZGGdgdh�dhe%�ZHGdidj�dje%�ZIGdkdl�dle%�ZJGdmdn�dne%�ZKGdodp�dpe%e5e6�ZLGdqdr�dre%�ZMGdsdt�dte%�ZNGdudv�dveOe&�ZPGdwdx�dxeQe&�ZRGdydz�dzeSe&�ZTGd{d|�d|eUe&�ZVGd}d~�d~eWe&�ZXGdd��d�eYe&�ZZGd�d��d�e[e&�Z\Gd�d��d�e]e&�Z^Gd�d��d�e_e&�Z`Gd�d��d�eae&�ZbGd�d��d�eDe&�ZcGd�d��d�e7e&�ZdGd�d��d�eCe&�ZeGd�d��d�eLe&�ZfGd�d��d�e*e&�ZgGd�d��d�e,e&�ZhGd�d��d�e.e&�ZiGd�d��d�e/e&�ZjGd�d��d�e2e&�ZkGd�d��d�e*e&�ZlGd�d��d�eKe&�ZmGd�d��d�e>e&�ZnGd�d��d�e@e&�Zod�d��Zpd�d��ZqGd�d��d�e%�ZrGd�d��d�e%e5e6�ZsGd�d��d�es�ZtdS)��N)�*)�	_cnfmerge�window�textZstatusZ	immediate�imageZ	imagetextZballoon�autoZ	acrosstop�asciiZcell�columnZ
decreasingZ
increasingZinteger�main�max�real�rowzs-regionzx-regionzy-region����� c@sVeZdZdZdd�Zdd�Zddd�Zdd	d
�Zdd�Zd
d�Z	dd�Z
ddd�ZdS)�
tixCommanda�The tix commands provide access to miscellaneous  elements
    of  Tix's  internal state and the Tix application context.
    Most of the information manipulated by these  commands pertains
    to  the  application  as a whole, or to a screen or
    display, rather than to a particular window.

    This is a mixin class, assumed to be mixed to Tkinter.Tk
    that supports the self.tk.call method.
    cCs|j�dd|�S)a�Tix maintains a list of directories under which
        the  tix_getimage  and tix_getbitmap commands will
        search for image files. The standard bitmap  directory
        is $TIX_LIBRARY/bitmaps. The addbitmapdir command
        adds directory into this list. By  using  this
        command, the  image  files  of an applications can
        also be located using the tix_getimage or tix_getbitmap
        command.
        �tixZaddbitmapdir��tk�call)�selfZ	directory�r�#/usr/lib64/python3.8/tkinter/tix.py�tix_addbitmapdirRs
ztixCommand.tix_addbitmapdircCs|j�dd|�S)z�Returns  the  current  value  of the configuration
        option given by option. Option may be  any  of  the
        options described in the CONFIGURATION OPTIONS section.
        r�cgetr�r�optionrrr�tix_cget^sztixCommand.tix_cgetNcKsd|rt||f�}n|rt|�}|dkr2|�dd�St|t�rN|�ddd|�S|j�d|�|��S)a�Query or modify the configuration options of the Tix application
        context. If no option is specified, returns a dictionary all of the
        available options.  If option is specified with no value, then the
        command returns a list describing the one named option (this list
        will be identical to the corresponding sublist of the value
        returned if no option is specified).  If one or more option-value
        pairs are specified, then the command modifies the given option(s)
        to have the given value(s); in this case the command returns an
        empty string. Option may be any of the configuration options.
        Nr�	configure�-)rr )r�
_getconfigure�
isinstance�strZ_getconfigure1rr�_options�r�cnf�kwrrr�
tix_configurees
ztixCommand.tix_configurecCs*|dk	r|j�dd|�S|j�dd�SdS)a�Returns the file selection dialog that may be shared among
        different calls from this application.  This command will create a
        file selection dialog widget when it is called the first time. This
        dialog will be returned by all subsequent calls to tix_filedialog.
        An optional dlgclass parameter can be passed to specified what type
        of file selection dialog widget is desired. Possible options are
        tix FileSelectDialog or tixExFileSelectDialog.
        NrZ
filedialogr)rZdlgclassrrr�tix_filedialog{s	ztixCommand.tix_filedialogcCs|j�dd|�S)a�Locates a bitmap file of the name name.xpm or name in one of the
        bitmap directories (see the tix_addbitmapdir command above).  By
        using tix_getbitmap, you can avoid hard coding the pathnames of the
        bitmap files in your application. When successful, it returns the
        complete pathname of the bitmap file, prefixed with the character
        '@'.  The returned value can be used to configure the -bitmap
        option of the TK and Tix widgets.
        rZ	getbitmapr�r�namerrr�
tix_getbitmap�s	ztixCommand.tix_getbitmapcCs|j�dd|�S)a�Locates an image file of the name name.xpm, name.xbm or name.ppm
        in one of the bitmap directories (see the addbitmapdir command
        above). If more than one file with the same name (but different
        extensions) exist, then the image type is chosen according to the
        depth of the X display: xbm images are chosen on monochrome
        displays and color images are chosen on color displays. By using
        tix_ getimage, you can avoid hard coding the pathnames of the
        image files in your application. When successful, this command
        returns the name of the newly created image, which can be used to
        configure the -image option of the Tk and Tix widgets.
        rZgetimagerr+rrr�tix_getimage�sztixCommand.tix_getimagecCs|j�ddd|�S)a@Gets  the options  maintained  by  the  Tix
        scheme mechanism. Available options include:

            active_bg       active_fg      bg
            bold_font       dark1_bg       dark1_fg
            dark2_bg        dark2_fg       disabled_fg
            fg              fixed_font     font
            inactive_bg     inactive_fg    input1_bg
            input2_bg       italic_font    light1_bg
            light1_fg       light2_bg      light2_fg
            menu_font       output1_bg     output2_bg
            select_bg       select_fg      selector
            rr�getrr+rrr�tix_option_get�sztixCommand.tix_option_getcCs2|dk	r|j�dd|||�S|j�dd||�SdS)a�Resets the scheme and fontset of the Tix application to
        newScheme and newFontSet, respectively.  This affects only those
        widgets created after this call. Therefore, it is best to call the
        resetoptions command before the creation of any widgets in a Tix
        application.

        The optional parameter newScmPrio can be given to reset the
        priority level of the Tk options set by the Tix schemes.

        Because of the way Tk handles the X option database, after Tix has
        been has imported and inited, it is not possible to reset the color
        schemes and font sets using the tix config command.  Instead, the
        tix_resetoptions command must be used.
        NrZresetoptionsr)rZ	newSchemeZ
newFontSetZ
newScmPriorrr�tix_resetoptions�sztixCommand.tix_resetoptions)N)N)N)�__name__�
__module__�__qualname__�__doc__rrr)r*r-r.r0r1rrrrrGs


rc@s"eZdZdZddd�Zdd�ZdS)	�Tkz{Toplevel widget of Tix which represents mostly the main window
    of an application. It has an associated Tcl interpreter.N�TixcCsbtj�||||�tj�d�}|j�d�|dk	rR|j�d|�|j�d|�|j�d�dS)NZTIX_LIBRARYz<global auto_path; lappend auto_path [file dir [info nameof]]z(global auto_path; lappend auto_path {%s}z,global tcl_pkgPath; lappend tcl_pkgPath {%s}zpackage require Tix)�tkinterr6�__init__�os�environr/r�eval)rZ
screenNameZbaseNameZ	classNameZtixlibrrrr9�szTk.__init__cCs|�dd�tj�|�dS)NZWM_DELETE_WINDOW�)Zprotocolr8r6�destroy�rrrrr>�sz
Tk.destroy)NNr7�r2r3r4r5r9r>rrrrr6�s
r6c@sTeZdZdZifdd�ZeZdd�Zdd�Zdd	�Zddd�Z	ddd�Z
dd�Zd
S)�Formz�The Tix Form geometry manager

    Widgets can be arranged by specifying attachments to other widgets.
    See Tix documentation for complete detailscKs"|jjd|jf|�||���dS)N�tixForm�rr�_wr%r&rrr�config�szForm.configcCst�|||i�dS�N)rA�form�r�key�valuerrr�__setitem__�szForm.__setitem__cCs|j�dd|j�S)NrB�check�rrrDr?rrrrL�sz
Form.checkcCs|j�dd|j�dS)NrB�forgetrMr?rrrrN�szForm.forgetrcCs`|sJ|sJ|j�dd|j�}|j�|�}d}|D]}||j�|�f}q.|S|j�dd|j||�S)NrB�gridr)rrrD�	splitlistZgetint)rZxsizeZysize�x�y�zrrrrO�sz	Form.gridNcCs>|s|j�dd|j�S|ddkr*d|}|j�dd|j|�S)NrB�inforr!rMrrrrrT�s
z	Form.infocs(�fdd��j��j�dd�j��D�S)Ncsg|]}��|��qSr)�
_nametowidget��.0rQr?rr�
<listcomp>szForm.slaves.<locals>.<listcomp>rB�slaves�rrPrrDr?rr?rrYs
���zForm.slaves)rr)N)r2r3r4r5rErGrKrLrNrOrTrYrrrrrA�s


rAc@sreZdZdZdddiifdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zidfdd�Zdd�Z
dS)�	TixWidgetaQA TixWidget class is used to package all (or most) Tix widgets.

    Widget initialization is extended in two ways:
       1) It is possible to give a list of options which must be part of
       the creation command (so called Tix 'static' options). These cannot be
       given as a 'config' command later.
       2) It is possible to give the name of an existing TK widget. These are
       child widgets created automatically by a Tix mega-widget. The Tk call
       to create these widgets is therefore bypassed in TixWidget.__init__

    Both options are for use by subclasses only.
    Nc	Cs�|rt||f�}nt|�}d}|r.|�d�ndg}t|���D]&\}}||kr@|d||f}||=q@||_t�|||�|r�|jj||j	f|��|r�t�
||�i|_dS)Nr�optionsr!)r�append�list�items�
widgetName�Widget�_setuprrrDrE�subwidget_list)	r�masterr`Zstatic_optionsr'r(Zextra�k�vrrrr9s$zTixWidget.__init__cCs ||jkr|j|St|��dSrF)rc�AttributeErrorr+rrr�__getattr__Gs

zTixWidget.__getattr__cCs|j�d|j|�dS)z1Set a variable without calling its action routineZtixSetSilentNrM)rrJrrr�
set_silentLszTixWidget.set_silentcCsD|�|�}|s$td|d|j��|t|j�dd�}|�|�S)zSReturn the named subwidget (which must have been created by
        the sub-class).z
Subwidget z not child of �N)�_subwidget_name�TclError�_name�lenrDrU)rr,�nrrr�	subwidgetPs

zTixWidget.subwidgetcCsZ|��}|sgSg}|D]<}|t|j�dd�}z|�|�|��WqYqXq|S)zReturn all subwidgets.rjN)�_subwidget_namesrnrDr]rU)r�namesZretlistr,rrr�subwidgets_allZszTixWidget.subwidgets_allcCs0z|j�|jd|�WStk
r*YdSXdS)z7Get a subwidget name (returns a String, not a Widget !)rpN)rrrDrlr+rrrrkiszTixWidget._subwidget_namecCs<z |j�|jdd�}|j�|�WStk
r6YdSXdS)z"Return the name of all subwidgets.Z
subwidgetsz-allN)rrrDrPrl)rrQrrrrqps
zTixWidget._subwidget_namescCs\|dkrdSt|t�st|�}t|t�s0t|�}|��}|D]}|j�|dd||�q<dS)z8Set configuration options for all subwidgets (and self).r=Nr r!)r#r$�reprrqrr)rrrJrrr,rrr�
config_allxs

zTixWidget.config_allcKst|s|}|r|rt||f�}n|r&|}d}|��D]*\}}t|�rL|�|�}|d||f}q2|j�dd|f|�S)Nrr!r�create)rr_�callable�	_registerrr)rZimgtyper'rdr(r\rerfrrr�image_create�s
zTixWidget.image_createcCs.z|j�dd|�Wntk
r(YnXdS)Nr�delete)rrrl)rZimgnamerrr�image_delete�szTixWidget.image_delete)r2r3r4r5r9rhrirprsrkrqruryr{rrrrr[
s�
-
r[c@s"eZdZdZddd�Zdd�ZdS)	�TixSubWidgetz�Subwidget class.

    This is used to mirror child widgets automatically created
    by Tix/Tk as part of a mega-widget in Python (which is not informed
    of this)rjc
Cs�|rD|�|�}z$|t|j�dd�}|�d�}Wng}YnX|s`t�||ddd|i�n�|}tt|�d�D]V}d�|d|d��}	z|�|	�}
|
}Wqtt	k
r�t
|||ddd�}YqtXqt|r�|d}t�||ddd|i�||_dS)Nrj�.r,r)�destroy_physically�check_intermediate���)rkrnrD�splitr[r9�range�joinrU�KeyErrorr|r~)rrdr,r~r�pathZplist�parent�iro�wrrrr9�s0



�zTixSubWidget.__init__cCsjt|j���D]}|��q|j|jjkr6|jj|j=|j|jjkrP|jj|j=|jrf|j�	d|j
�dS)Nr>)r^�children�valuesr>rmrdrcr~rrrD�r�crrrr>�s
zTixSubWidget.destroyN)rjrjr@rrrrr|�s
�
 r|c@sVeZdZdZifdd�dd�Zdd�Zdd	�Zd
d�Zdd
�Zifdd�Z	dd�Z
dS)�DisplayStylezRDisplayStyle - handle configuration options shared by
    (multiple) Display ItemsN)rdcKs\|s2d|kr|d}nd|kr(|d}n
t�d�}|j|_|jjd|f|�||���|_dS)NZ	refwindowzcreate display styleZtixDisplayStyle)r8Z_get_default_rootrrr%�	stylename)r�itemtyper'rdr(rrrr9�s



�zDisplayStyle.__init__cCs|jSrF)r�r?rrr�__str__�szDisplayStyle.__str__cCsH|r|rt||f�}n|r|}d}|��D]\}}|d||f}q*|S)Nrr!)rr_)rr'r(Zoptsrerfrrrr%�szDisplayStyle._optionscCs|j�|jd�dS�Nrz�rrr�r?rrrrz�szDisplayStyle.deletecCs|j�|jdd||�dS)Nr �-%sr�rHrrrrK�szDisplayStyle.__setitem__cKs|j|jdf|�||���S)Nr )r"r�r%r&rrrrE�s�
�zDisplayStyle.configcCs|j�|jdd|�S)Nrr�r�)rrIrrr�__getitem__�szDisplayStyle.__getitem__)r2r3r4r5r9r�r%rzrKrEr�rrrrr��s
r�c@s2eZdZdZdifdd�Zifdd�Zdd�ZdS)	�BalloonzBalloon help widget.

    Subwidget       Class
    ---------       -----
    label           Label
    message         MessageNcKsNdddddg}t�||d|||�t|ddd	�|jd<t|d
dd	�|jd
<dS)Nr\ZinstallcolormapZinitwaitZ	statusbarZcursorZ
tixBalloon�labelr�r~�message�r[r9�_dummyLabelrc�rrdr'r(Zstaticrrrr9	s���zBalloon.__init__cKs&|jj|jd|jf|�||���dS)zkBind balloon widget to another.
        One balloon widget may be bound to several widgets at the same time�bindNrC)r�widgetr'r(rrr�bind_widgetszBalloon.bind_widgetcCs|j�|jd|j�dS�NZunbindrM�rr�rrr�
unbind_widgetszBalloon.unbind_widget)r2r3r4r5r9r�r�rrrrr�s
r�c@s2eZdZdZdifdd�Zifdd�Zdd�ZdS)	�	ButtonBoxzgButtonBox - A container for pushbuttons.
    Subwidgets are the buttons added with the add method.
    NcKst�||dddg||�dS)NZtixButtonBox�orientationr\�r[r9�rrdr'r(rrrr9s

�zButtonBox.__init__cKs4|jj|jd|f|�||���}t||�|j|<|S)z$Add a button with given name to box.�add�rrrDr%�_dummyButtonrc)rr,r'r(Zbtnrrrr�#s z
ButtonBox.addcCs ||jkr|j�|jd|�dS�N�invoke�rcrrrDr+rrrr�*s
zButtonBox.invoke�r2r3r4r5r9r�r�rrrrr�sr�c@s>eZdZdZdifdd�Zdd�Zdd�Zd	d
�Zdd�ZdS)
�ComboBoxa�ComboBox - an Entry field with a dropdown menu. The user can select a
    choice by either typing in the entry subwidget or selecting from the
    listbox subwidget.

    Subwidget       Class
    ---------       -----
    entry       Entry
    arrow       Button
    slistbox    ScrolledListBox
    tick        Button
    cross       Button : present if created with the fancy optionNc	Ks�t�||dddddg||�t|d�|jd<t|d�|jd<t|d�|jd<t|d	�|jd	<z$t|d
�|jd
<t|d�|jd<Wntk
r�YnXdS)NZtixComboBoxZeditableZdropdown�fancyr\r��entry�arrow�slistbox�tick�cross)r[r9r�rc�_dummyEntryr��_dummyScrolledListBox�	TypeErrorr�rrrr9<s 

��
zComboBox.__init__cCs|j�|jd|�dS)NZ
addhistoryrM�rr$rrr�add_historyNszComboBox.add_historycCs|j�|jd|�dS)NZ
appendhistoryrMr�rrr�append_historyQszComboBox.append_historycCs|j�|jd||�dS�N�insertrM)r�indexr$rrrr�TszComboBox.insertcCs|j�|jd|�dS)N�pickrM�rr�rrrr�Wsz
ComboBox.pick)	r2r3r4r5r9r�r�r�r�rrrrr�.s
r�c@s>eZdZdZdifdd�Zdd�Zdd�Zd	d
�Zdd�ZdS)
�Controla�Control - An entry field with value change arrows.  The user can
    adjust the value by pressing the two arrow buttons or by entering
    the value directly into the entry. The new value will be checked
    against the user-defined upper and lower limits.

    Subwidget       Class
    ---------       -----
    incr       Button
    decr       Button
    entry       Entry
    label       LabelNcKsZt�||ddg||�t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<dS)NZ
tixControlr\�incr�decrr�r�)r[r9r�rcr�r�r�rrrr9hs
zControl.__init__cCs|j�|jd�dS)Nr�rMr?rrr�	decrementoszControl.decrementcCs|j�|jd�dS)Nr�rMr?rrr�	incrementrszControl.incrementcCs|j�|jd�dSr�rMr?rrrr�uszControl.invokecCs|j�|jd�dS)N�updaterMr?rrrr�xszControl.update)	r2r3r4r5r9r�r�r�r�rrrrr�Zs
r�c@s$eZdZdZifdd�Zdd�ZdS)�DirListaRDirList - displays a list view of a directory, its previous
    directories and its sub-directories. The user can choose one of
    the directories displayed in the list or change to another directory.

    Subwidget       Class
    ---------       -----
    hlist       HList
    hsb              Scrollbar
    vsb              ScrollbarcKsJt�||ddg||�t|d�|jd<t|d�|jd<t|d�|jd<dS)NZ
tixDirListr\�hlist�vsb�hsb�r[r9�_dummyHListrc�_dummyScrollbarr�rrrr9�szDirList.__init__cCs|j�|jd|�dS�N�chdirrM�r�dirrrrr��sz
DirList.chdirN�r2r3r4r5r9r�rrrrr�{sr�c@s$eZdZdZifdd�Zdd�ZdS)�DirTreea�DirTree - Directory Listing in a hierarchical view.
    Displays a tree view of a directory, its previous directories and its
    sub-directories. The user can choose one of the directories displayed
    in the list or change to another directory.

    Subwidget       Class
    ---------       -----
    hlist           HList
    hsb             Scrollbar
    vsb             ScrollbarcKsJt�||ddg||�t|d�|jd<t|d�|jd<t|d�|jd<dS)NZ
tixDirTreer\r�r�r�r�r�rrrr9�szDirTree.__init__cCs|j�|jd|�dSr�rMr�rrrr��sz
DirTree.chdirNr�rrrrr��sr�c@seZdZdZifdd�ZdS)�DirSelectBoxa�DirSelectBox - Motif style file select box.
    It is generally used for
    the user to choose a file. FileSelectBox stores the files mostly
    recently selected into a ComboBox widget so that they can be quickly
    selected again.

    Subwidget       Class
    ---------       -----
    selection       ComboBox
    filter          ComboBox
    dirlist         ScrolledListBox
    filelist        ScrolledListBoxcKs:t�||ddg||�t|d�|jd<t|d�|jd<dS)NZtixDirSelectBoxr\�dirlist�dircbx)r[r9�
_dummyDirListrc�_dummyFileComboBoxr�rrrr9�szDirSelectBox.__init__N�r2r3r4r5r9rrrrr��s
r�c@s,eZdZdZifdd�Zdd�Zdd�ZdS)	�ExFileSelectBoxa�ExFileSelectBox - MS Windows style file select box.
    It provides a convenient method for the user to select files.

    Subwidget       Class
    ---------       -----
    cancel       Button
    ok              Button
    hidden       Checkbutton
    types       ComboBox
    dir              ComboBox
    file       ComboBox
    dirlist       ScrolledListBox
    filelist       ScrolledListBoxcKs�t�||ddg||�t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<t|d	�|jd	<t|d
�|jd
<dS)NZtixExFileSelectBoxr\�cancel�ok�hidden�typesr�r��file�filelist)r[r9r�rc�_dummyCheckbutton�_dummyComboBoxr�r�r�rrrr9�szExFileSelectBox.__init__cCs|j�|jd�dS�N�filterrMr?rrrr��szExFileSelectBox.filtercCs|j�|jd�dSr�rMr?rrrr��szExFileSelectBox.invokeN)r2r3r4r5r9r�r�rrrrr��sr�c@s,eZdZdZifdd�Zdd�Zdd�ZdS)	�DirSelectDialoga#The DirSelectDialog widget presents the directories in the file
    system in a dialog window. The user can use this dialog window to
    navigate through the file system to select the desired directory.

    Subwidgets       Class
    ----------       -----
    dirbox       DirSelectDialogcKs*t�||ddg||�t|d�|jd<dS)NZtixDirSelectDialogr\Zdirbox)r[r9�_dummyDirSelectBoxrcr�rrrr9�s
�zDirSelectDialog.__init__cCs|j�|jd�dS�N�popuprMr?rrrr��szDirSelectDialog.popupcCs|j�|jd�dS�N�popdownrMr?rrrr��szDirSelectDialog.popdownN�r2r3r4r5r9r�r�rrrrr��s	r�c@s,eZdZdZifdd�Zdd�Zdd�ZdS)	�ExFileSelectDialogz�ExFileSelectDialog - MS Windows style file select dialog.
    It provides a convenient method for the user to select files.

    Subwidgets       Class
    ----------       -----
    fsbox       ExFileSelectBoxcKs*t�||ddg||�t|d�|jd<dS)NZtixExFileSelectDialogr\�fsbox)r[r9�_dummyExFileSelectBoxrcr�rrrr9�s
�zExFileSelectDialog.__init__cCs|j�|jd�dSr�rMr?rrrr�szExFileSelectDialog.popupcCs|j�|jd�dSr�rMr?rrrr�szExFileSelectDialog.popdownNr�rrrrr��sr�c@s,eZdZdZifdd�Zdd�Zdd�ZdS)	�
FileSelectBoxa�ExFileSelectBox - Motif style file select box.
    It is generally used for
    the user to choose a file. FileSelectBox stores the files mostly
    recently selected into a ComboBox widget so that they can be quickly
    selected again.

    Subwidget       Class
    ---------       -----
    selection       ComboBox
    filter          ComboBox
    dirlist         ScrolledListBox
    filelist        ScrolledListBoxcKsZt�||ddg||�t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<dS)NZtixFileSelectBoxr\r�r�r��	selection)r[r9r�rcr�r�rrrr9s
zFileSelectBox.__init__cCs|j�|jd�dSr�rMr?rrr�apply_filterszFileSelectBox.apply_filtercCs|j�|jd�dSr�rMr?rrrr�szFileSelectBox.invokeN)r2r3r4r5r9r�r�rrrrr�s
r�c@s,eZdZdZifdd�Zdd�Zdd�ZdS)	�FileSelectDialogz�FileSelectDialog - Motif style file select dialog.

    Subwidgets       Class
    ----------       -----
    btns       StdButtonBox
    fsbox       FileSelectBoxcKs:t�||ddg||�t|d�|jd<t|d�|jd<dS)NZtixFileSelectDialogr\Zbtnsr�)r[r9�_dummyStdButtonBoxrc�_dummyFileSelectBoxr�rrrr9,s
�zFileSelectDialog.__init__cCs|j�|jd�dSr�rMr?rrrr�2szFileSelectDialog.popupcCs|j�|jd�dSr�rMr?rrrr�5szFileSelectDialog.popdownNr�rrrrr�#sr�c@s,eZdZdZifdd�Zdd�Zdd�ZdS)	�	FileEntrya_FileEntry - Entry field with button that invokes a FileSelectDialog.
    The user can type in the filename manually. Alternatively, the user can
    press the button widget that sits next to the entry, which will bring
    up a file selection dialog.

    Subwidgets       Class
    ----------       -----
    button       Button
    entry       EntrycKs<t�||dddg||�t|d�|jd<t|d�|jd<dS)NZtixFileEntryZ
dialogtyper\Zbuttonr�)r[r9r�rcr�r�rrrr9Ds
�zFileEntry.__init__cCs|j�|jd�dSr�rMr?rrrr�JszFileEntry.invokecCsdSrFrr?rrr�file_dialogMszFileEntry.file_dialogN)r2r3r4r5r9r�r�rrrrr�8sr�c@s�eZdZdZdifdd�Zifdd�Zdifdd�Zd	d
�Zdd�Zdldd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zifd d!�Zifd"d#�Zd$d%�Zd&d'�ZeZd(d)�Zd*d+�Zd,d-�Zifd.d/�Zifd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Z d<d=�Z!dmd>d?�Z"d@dA�Z#dBdC�Z$dDdE�Z%dFdG�Z&dHdI�Z'dJdK�Z(dLdM�Z)dNdO�Z*dPdQ�Z+dRdS�Z,ifdTdU�Z-ifdVdW�Z.dXdY�Z/dZd[�Z0d\d]�Z1ifd^d_�Z2d`da�Z3dbdc�Z4ifddde�Z5dfdg�Z6dndhdi�Z7djdk�Z8dS)o�HListaHList - Hierarchy display  widget can be used to display any data
    that have a hierarchical structure, for example, file system directory
    trees. The list entries are indented and connected by branch lines
    according to their places in the hierarchy.

    Subwidgets - NoneNcKst�||dddg||�dS)NZtixHList�columnsr\r�r�rrrr9Ys

�zHList.__init__cKs |jj|jd|f|�||���S�Nr�rC�rr�r'r(rrrr�]sz	HList.addcKs(|sd}|jj|jd|f|�||���S)Nr=ZaddchildrC)rr�r'r(rrr�	add_child`s�
�zHList.add_childcCs|j�|jdd|�dS�N�anchor�setrM�rr�rrr�
anchor_setfszHList.anchor_setcCs|j�|jdd�dS�Nr��clearrMr?rrr�anchor_cleariszHList.anchor_clearrcCs6|s|j�|jdd||�S|j�|jdd|d|�SdS)Nr	�widthz-charrM)r�colr�charsrrr�column_widthls�zHList.column_widthcCs|j�|jdd�dS)Nrz�allrMr?rrr�
delete_allsszHList.delete_allcCs|j�|jdd|�dS)Nrzr�rMr�rrr�delete_entryvszHList.delete_entrycCs|j�|jdd|�dS)NrzZ
offspringsrMr�rrr�delete_offspringsyszHList.delete_offspringscCs|j�|jdd|�dS)NrzZsiblingsrMr�rrr�delete_siblings|szHList.delete_siblingscCs|j�|jdd|�dS�N�dragsiter�rMr�rrr�dragsite_setszHList.dragsite_setcCs|j�|jdd�dS�NrrrMr?rrr�dragsite_clear�szHList.dragsite_clearcCs|j�|jdd|�dS�N�dropsiter�rMr�rrr�dropsite_set�szHList.dropsite_setcCs|j�|jdd�dS�NrrrMr?rrr�dropsite_clear�szHList.dropsite_clearcKs&|jj|jdd|f|�||���dS)N�headerrvrC�rrr'r(rrr�
header_create�szHList.header_createcKs@|dkr|�|jdd|�S|jj|jdd|f|�||���dS)Nrr �r"rDrrr%rrrr�header_configure�s

�zHList.header_configurecCs|j�|jdd||�S)NrrrM)rr�optrrr�header_cget�szHList.header_cgetcCs|j�|j�|jdd|��S)NrZexist)rZ
getbooleanrrD�rrrrr�
header_exists�szHList.header_existscCs|j�|jdd|�dS)NrrzrMrrrr�
header_delete�szHList.header_deletecCs|j�|jdd|�S)Nr�sizerMrrrr�header_size�szHList.header_sizecCs|j�|jdd|�dS)N�hider�rMr�rrr�
hide_entry�szHList.hide_entrycKs&|jj|jdd|f|�||���dS)N�	indicatorrvrCr�rrr�indicator_create�s�
�zHList.indicator_createcKs@|dkr|�|jdd|�S|jj|jdd|f|�||���dS)Nr#r rr�rrr�indicator_configure�s��
�zHList.indicator_configurecCs|j�|jdd||�S)Nr#rrM�rr�rrrr�indicator_cget�szHList.indicator_cgetcCs|j�|jdd|�S)Nr#�existsrMr�rrr�indicator_exists�szHList.indicator_existscCs|j�|jdd|�dS)Nr#rzrMr�rrr�indicator_delete�szHList.indicator_deletecCs|j�|jdd|�S)Nr#rrMr�rrr�indicator_size�szHList.indicator_sizecCs|j�|jdd�S�NrTr�rMr?rrr�info_anchor�szHList.info_anchorcCs|�|j�|jdd|��pdS�NrTZbbox)�_getintsrrrDr�rrr�	info_bbox�s
��zHList.info_bboxcCs |j�|jdd|�}|j�|�S)NrTr��rrrDrP)rr�r�rrr�
info_children�szHList.info_childrencCs|j�|jdd|�S)NrT�datarMr�rrr�	info_data�szHList.info_datacCs|j�|jdd�S)NrTrrMr?rrr�
info_dragsite�szHList.info_dragsitecCs|j�|jdd�S)NrTrrMr?rrr�
info_dropsite�szHList.info_dropsitecCs|j�|jdd|�S)NrTr(rMr�rrr�info_exists�szHList.info_existscCs|j�|jdd|�S)NrTr�rMr�rrr�info_hidden�szHList.info_hiddencCs|j�|jdd|�S)NrT�nextrMr�rrr�	info_next�szHList.info_nextcCs|j�|jdd|�S)NrTr�rMr�rrr�info_parent�szHList.info_parentcCs|j�|jdd|�S)NrT�prevrMr�rrr�	info_prev�szHList.info_prevcCs|j�|jdd�}|j�|�S�NrTr�r1r�rrr�info_selection�szHList.info_selectioncCs|j�|jdd|||�S)N�itemrrM)rr�rrrrr�	item_cget�szHList.item_cgetcKsD|dkr|�|jdd||�S|jj|jdd||f|�||���dS)Nr@r r�rr�rr'r(rrr�item_configure�s

�zHList.item_configurecKs(|jj|jdd||f|�||���dS)Nr@rvrCrBrrr�item_create�s�
�zHList.item_createcCs|j�|jdd||�S)Nr@r(rM�rr�rrrr�item_exists�szHList.item_existscCs|j�|jdd||�dS)Nr@rzrMrErrr�item_delete�szHList.item_deletecCs|j�|jd||�S)N�	entrycgetrMr&rrrrH�szHList.entrycgetcKs<|dkr|�|jd|�S|jj|jd|f|�||���dS�N�entryconfigurerr�rrrrJ�s

�zHList.entryconfigurecCs|j�|jd|�S�N�nearestrM)rrRrrrrLsz
HList.nearestcCs|j�|jd|�dS�N�seerMr�rrrrNsz	HList.seecKs$|jj|jddf|�||���dS�Nr�rrCr&rrr�selection_clearszHList.selection_clearcCs|j�|jdd|�S�Nr�ZincludesrMr�rrr�selection_includes
szHList.selection_includescCs|j�|jdd||�dS�Nr�r�rM�r�firstZlastrrr�
selection_set
szHList.selection_setcCs|j�|jdd|�S)N�showr�rMr�rrr�
show_entryszHList.show_entry)rNN)N)N)9r2r3r4r5r9r�r�r�rrrrr	r
r
rrrrrrrZheader_existrr r"r$r%r'r)r*r+r-r0r2r4r5r6r7r8r:r;r=r?rArCrDrFrGrHrJrLrNrPrRrVrXrrrrr�Qsl


r�c@seZdZdZdifdd�ZdS)�	InputOnlyz?InputOnly - Invisible widget. Unix only.

    Subwidgets - NoneNcKst�||dd||�dS)NZtixInputOnlyr�r�rrrr9szInputOnly.__init__r�rrrrrYsrYc@seZdZdZdifdd�ZdS)�
LabelEntryaLabelEntry - Entry field with label. Packages an entry widget
    and a label into one mega widget. It can be used to simplify the creation
    of ``entry-form'' type of interface.

    Subwidgets       Class
    ----------       -----
    label       Label
    entry       EntryNcKs<t�||dddg||�t|d�|jd<t|d�|jd<dS)NZ
tixLabelEntry�	labelsider\r�r�)r[r9r�rcr�r�rrrr9%s
�zLabelEntry.__init__r�rrrrrZs	rZc@seZdZdZdifdd�ZdS)�
LabelFrameaeLabelFrame - Labelled Frame container. Packages a frame widget
    and a label into one mega widget. To create widgets inside a
    LabelFrame widget, one creates the new widgets relative to the
    frame subwidget and manage them inside the frame subwidget.

    Subwidgets       Class
    ----------       -----
    label       Label
    frame       FrameNcKs<t�||dddg||�t|d�|jd<t|d�|jd<dS)NZ
tixLabelFramer[r\r��frame)r[r9r�rc�_dummyFramer�rrrr96s
�zLabelFrame.__init__r�rrrrr\+s
r\c@s@eZdZdZifdd�Zifdd�Zdd�Zdd	�Zd
d�ZdS)
�ListNoteBookaA ListNoteBook widget is very similar to the TixNoteBook widget:
    it can be used to display many windows in a limited space using a
    notebook metaphor. The notebook is divided into a stack of pages
    (windows). At one time only one of these pages can be shown.
    The user can navigate through these pages by
    choosing the name of the desired page in the hlist subwidget.cKsNt�||ddg||�t|ddd�|jd<t|d�|jd<t|d�|jd<dS)NZtixListNoteBookr\Zpanerr�r�Zshlist)r[r9�_dummyPanedWindowrcr��_dummyScrolledHListr�rrrr9Es�zListNoteBook.__init__cKs:|jj|jd|f|�||���t||�|j|<|j|Sr��rrrDr%r|rc�rr,r'r(rrrr�Ms zListNoteBook.addcCs
|�|�SrF�rpr+rrr�pageRszListNoteBook.pagecCs:|j�|j�|jd��}g}|D]}|�|�|��q |S�N�pages�rrPrrDr]rp�rrrZretrQrrrrgUs
zListNoteBook.pagescCs|j�|jd|�dS�N�raiserMr+rrr�
raise_page]szListNoteBook.raise_pageN)	r2r3r4r5r9r�rergrlrrrrr_=sr_c@seZdZdZdifdd�ZdS)�MeterzuThe Meter widget can be used to show the progress of a background
    job which may take a long time to execute.
    NcKst�||ddg||�dS)NZtixMeterr\r�r�rrrr9es

�zMeter.__init__r�rrrrrm`srmc@sReZdZdZdifdd�Zifdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�NoteBookz�NoteBook - Multi-page container widget (tabbed notebook metaphor).

    Subwidgets       Class
    ----------       -----
    nbframe       NoteBookFrame
    <pages>       page widgets added dynamically with the add methodNcKs.t�||ddg||�t|ddd�|jd<dS)NZtixNoteBookr\Znbframerr�)r[r9r|rcr�rrrr9qs�zNoteBook.__init__cKs:|jj|jd|f|�||���t||�|j|<|j|Sr�rbrcrrrr�vs zNoteBook.addcCs,|j�|jd|�|j|��|j|=dSr��rrrDrcr>r+rrrrz{szNoteBook.deletecCs
|�|�SrFrdr+rrrre�sz
NoteBook.pagecCs:|j�|j�|jd��}g}|D]}|�|�|��q |Srfrhrirrrrg�s
zNoteBook.pagescCs|j�|jd|�dSrjrMr+rrrrl�szNoteBook.raise_pagecCs|j�|jd�S)N�raisedrMr?rrrrp�szNoteBook.raised)r2r3r4r5r9r�rzrergrlrprrrrrnisrnc@seZdZdS)�
NoteBookFrameN)r2r3r4rrrrrq�srqc@sLeZdZdZifdd�Zifdd�Zifdd�Zdd	�Zd
d�Zdd
�Z	dS)�
OptionMenuz�OptionMenu - creates a menu button of options.

    Subwidget       Class
    ---------       -----
    menubutton      Menubutton
    menu            MenucKs:t�||ddg||�t|d�|jd<t|d�|jd<dS)NZ
tixOptionMenur\�
menubutton�menu�r[r9�_dummyMenubuttonrc�
_dummyMenur�rrrr9�szOptionMenu.__init__cKs&|jj|jdd|f|�||���dS)Nr��commandrCrcrrr�add_command�szOptionMenu.add_commandcKs&|jj|jdd|f|�||���dS)Nr�Z	separatorrCrcrrr�
add_separator�szOptionMenu.add_separatorcCs|j�|jd|�dSr�rMr+rrrrz�szOptionMenu.deletecCs|j�|jd|�dS)N�disablerMr+rrrr{�szOptionMenu.disablecCs|j�|jd|�dS)N�enablerMr+rrrr|�szOptionMenu.enableN)
r2r3r4r5r9ryrzrzr{r|rrrrrr�srrc@sTeZdZdZifdd�Zifdd�Zdd�Zdd	�Zd
d�Zifdd
�Z	dd�Z
dS)�PanedWindowa�PanedWindow - Multi-pane container widget
    allows the user to interactively manipulate the sizes of several
    panes. The panes can be arranged either vertically or horizontally.The
    user changes the sizes of the panes by dragging the resize handle
    between two panes.

    Subwidgets       Class
    ----------       -----
    <panes>       g/p widgets added dynamically with the add method.cKst�||dddg||�dS)NZtixPanedWindowr�r\r�r�rrrr9�szPanedWindow.__init__cKs>|jj|jd|f|�||���t||dd�|j|<|j|S)Nr�r)rrbrcrrrr��s
 �zPanedWindow.addcCs,|j�|jd|�|j|��|j|=dSr�ror+rrrrz�szPanedWindow.deletecCs|j�|jd|�dS)NrNrMr+rrrrN�szPanedWindow.forgetcCs|j�|jd||�S)N�panecgetrMr&rrrr~�szPanedWindow.panecgetcKs<|dkr|�|jd|�S|jj|jd|f|�||���dS)N�
paneconfigurerr�rrrr�szPanedWindow.paneconfigurecs*�j��j��jd��}�fdd�|D�S)N�panescsg|]}��|��qSrrdrVr?rrrX�sz%PanedWindow.panes.<locals>.<listcomp>rZ)rrrrr?rr��szPanedWindow.panesN)r2r3r4r5r9r�rzrNr~rr�rrrrr}�s
r}c@s4eZdZdZifdd�Zdd�Zdd�Zdd	�Zd
S)�	PopupMenuaPopupMenu widget can be used as a replacement of the tk_popup command.
    The advantage of the Tix PopupMenu widget is it requires less application
    code to manipulate.


    Subwidgets       Class
    ----------       -----
    menubutton       Menubutton
    menu       MenucKs:t�||ddg||�t|d�|jd<t|d�|jd<dS)NZtixPopupMenur\rsrtrur�rrrr9�szPopupMenu.__init__cCs|j�|jd|j�dS)Nr�rMr�rrrr��szPopupMenu.bind_widgetcCs|j�|jd|j�dSr�rMr�rrrr��szPopupMenu.unbind_widgetcCs|j�|jd|j||�dS)NZpostrM)rr�rQrRrrr�post_widget�szPopupMenu.post_widgetN)r2r3r4r5r9r�r�r�rrrrr��s
r�c@s<eZdZdZifdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�ResizeHandlez;Internal widget to draw resize handles on Scrolled widgets.c	Ks.ddddddddd	g	}t�||d
|||�dS)Nr\rxZcursorfgZcursorbgZ
handlesizeZ	hintcolorZ	hintwidthrQrRZtixResizeHandler�)rrdr'r(�flagsrrrr9�s�
�zResizeHandle.__init__cCs|j�|jd|j�dS)NZattachwidgetrMr�rrr�
attach_widgetszResizeHandle.attach_widgetcCs|j�|jd|j�dS)NZdetachwidgetrMr�rrr�
detach_widgetszResizeHandle.detach_widgetcCs|j�|jd|j�dS)Nr!rMr�rrrr!szResizeHandle.hidecCs|j�|jd|j�dS)NrWrMr�rrrrW	szResizeHandle.showN)	r2r3r4r5r9r�r�r!rWrrrrr��s
r�c@seZdZdZifdd�ZdS)�
ScrolledHListz0ScrolledHList - HList with automatic scrollbars.cKsJt�||ddg||�t|d�|jd<t|d�|jd<t|d�|jd<dS)NZtixScrolledHListr\r�r�r�r�r�rrrr9s�zScrolledHList.__init__Nr�rrrrr�sr�c@seZdZdZifdd�ZdS)�ScrolledListBoxz4ScrolledListBox - Listbox with automatic scrollbars.cKsJt�||ddg||�t|d�|jd<t|d�|jd<t|d�|jd<dS)NZtixScrolledListBoxr\�listboxr�r�)r[r9�
_dummyListboxrcr�r�rrrr9szScrolledListBox.__init__Nr�rrrrr�sr�c@seZdZdZifdd�ZdS)�ScrolledTextz.ScrolledText - Text with automatic scrollbars.cKsJt�||ddg||�t|d�|jd<t|d�|jd<t|d�|jd<dS)NZtixScrolledTextr\rr�r�)r[r9�
_dummyTextrcr�r�rrrr9%szScrolledText.__init__Nr�rrrrr�!sr�c@seZdZdZifdd�ZdS)�
ScrolledTListz0ScrolledTList - TList with automatic scrollbars.cKsJt�||ddg||�t|d�|jd<t|d�|jd<t|d�|jd<dS)NZtixScrolledTListr\Ztlistr�r�)r[r9�_dummyTListrcr�r�rrrr9/s�zScrolledTList.__init__Nr�rrrrr�+sr�c@seZdZdZifdd�ZdS)�ScrolledWindowz2ScrolledWindow - Window with automatic scrollbars.cKsJt�||ddg||�t|d�|jd<t|d�|jd<t|d�|jd<dS)NZtixScrolledWindowr\rr�r�)r[r9r^rcr�r�rrrr9:szScrolledWindow.__init__Nr�rrrrr�6sr�c@s0eZdZdZifdd�Zifdd�Zdd�ZdS)	�Selectz�Select - Container of button subwidgets. It can be used to provide
    radio-box or check-box style of selection options for the user.

    Subwidgets are buttons added dynamically using the add method.c
Ks2t�||ddddddg||�t|d�|jd<dS)NZ	tixSelectZ	allowzero�radior�r[r\r�r�r�rrrr9Gs
��zSelect.__init__cKs:|jj|jd|f|�||���t||�|j|<|j|Sr�r�rcrrrr�Ns z
Select.addcCs|j�|jd|�dSr�rMr+rrrr�Ssz
Select.invokeNr�rrrrr�@sr�c@seZdZdZdifdd�ZdS)�Shellz'Toplevel window.

    Subwidgets - NoneNcKst�||dddg||�dS)NZtixShellr\�titler�r�rrrr9[szShell.__init__r�rrrrr�Vsr�c@s6eZdZdZdifdd�Zdd�Zdd�Zd	d
�ZdS)�DialogShellz�Toplevel window, with popup popdown and center methods.
    It tells the window manager that it is a dialog window and should be
    treated specially. The exact treatment depends on the treatment of
    the window manager.

    Subwidgets - NoneNcKs&t�||ddddddddg||�dS)	NZtixDialogShellr\r�ZmappedZ	minheightZminwidthr�Z	transientr�r�rrrr9gs��zDialogShell.__init__cCs|j�|jd�dSr�rMr?rrrr�nszDialogShell.popdowncCs|j�|jd�dSr�rMr?rrrr�qszDialogShell.popupcCs|j�|jd�dS)N�centerrMr?rrrr�tszDialogShell.center)r2r3r4r5r9r�r�r�rrrrr�^s
r�c@s&eZdZdZdifdd�Zdd�ZdS)�StdButtonBoxz@StdButtonBox - Standard Button Box (OK, Apply, Cancel and Help) NcKs\t�||dddg||�t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<dS)NZtixStdButtonBoxr�r\r��applyr��help)r[r9r�rcr�rrrr9zs
�zStdButtonBox.__init__cCs ||jkr|j�|jd|�dSr�r�r+rrrr��s
zStdButtonBox.invoke)r2r3r4r5r9r�rrrrr�wsr�c@s�eZdZdZdifdd�Zdd�Zdd�Zd	d
�Zdd�Zd3d
d�Z	dd�Z
dd�Zdd�Zdd�Z
ifdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zifd-d.�Zd/d0�Zd4d1d2�ZdS)5�TLista�TList - Hierarchy display widget which can be
    used to display data in a tabular format. The list entries of a TList
    widget are similar to the entries in the Tk listbox widget. The main
    differences are (1) the TList widget can display the list entries in a
    two dimensional format and (2) you can use graphical images as well as
    multiple colors and fonts for the list entries.

    Subwidgets - NoneNcKst�||ddg||�dS)NZtixTListr\r�r�rrrr9�szTList.__init__cCs|j�|jdd|�dS)N�activer�rMr�rrr�
active_set�szTList.active_setcCs|j�|jdd�dS)Nr�rrMr?rrr�active_clear�szTList.active_clearcCs|j�|jdd|�dSr�rMr�rrrr��szTList.anchor_setcCs|j�|jdd�dSr�rMr?rrrr�szTList.anchor_clearcCs|j�|jd||�dSr�rM�r�from_�torrrrz�szTList.deletecCs|j�|jdd|�dSrrMr�rrrr
�szTList.dragsite_setcCs|j�|jdd�dSrrMr?rrrr�szTList.dragsite_clearcCs|j�|jdd|�dSrrMr�rrrr�szTList.dropsite_setcCs|j�|jdd�dSrrMr?rrrr�szTList.dropsite_clearcKs$|jj|jd|f|�||���dSr�rC)rr�r'r(rrrr��szTList.insertcCs|j�|jdd�S)NrTr�rMr?rrr�info_active�szTList.info_activecCs|j�|jdd�Sr,rMr?rrrr-�szTList.info_anchorcCs|j�|jdd|�S)NrTZdownrMr�rrr�	info_down�szTList.info_downcCs|j�|jdd|�S)NrT�leftrMr�rrr�	info_left�szTList.info_leftcCs|j�|jdd|�S)NrT�rightrMr�rrr�
info_right�szTList.info_rightcCs|j�|jdd�}|j�|�Sr>r1r�rrrr?�szTList.info_selectioncCs|j�|jdd�S)NrTrrMr?rrr�	info_size�szTList.info_sizecCs|j�|jdd|�S)NrTZuprMr�rrr�info_up�sz
TList.info_upcCs|j�|jd||�SrKrM�rrQrRrrrrL�sz
TList.nearestcCs|j�|jd|�dSrMrMr�rrrrN�sz	TList.seecKs$|jj|jddf|�||���dSrOrCr&rrrrP�szTList.selection_clearcCs|j�|jdd|�SrQrMr�rrrrR�szTList.selection_includescCs|j�|jdd||�dSrSrMrTrrrrV�szTList.selection_set)N)N)r2r3r4r5r9r�r�r�rrzr
rrrr�r�r-r�r�r�r?r�r�rLrNrPrRrVrrrrr��s2	
r�c@sHeZdZdZdifdd�Zdd�Zdd�Zd	d
�Zdd�Zddd�Z	dS)�Treez�Tree - The tixTree widget can be used to display hierarchical
    data in a tree form. The user can adjust
    the view of the tree by opening or closing parts of the tree.NcKsJt�||ddg||�t|d�|jd<t|d�|jd<t|d�|jd<dS)NZtixTreer\r�r�r�r�r�rrrr9�s
�z
Tree.__init__cCs|j�|jd�dS�aThis command calls the setmode method for all the entries in this
     Tree widget: if an entry has no child entries, its mode is set to
     none. Otherwise, if the entry has any hidden child entries, its mode is
     set to open; otherwise its mode is set to close.�autosetmodeNrMr?rrrr��szTree.autosetmodecCs|j�|jd|�dS�z8Close the entry given by entryPath if its mode is close.�closeNrM�r�	entrypathrrrr��sz
Tree.closecCs|j�|jd|�S�z9Returns the current mode of the entry given by entryPath.�getmoderMr�rrrr��szTree.getmodecCs|j�|jd|�dS�z6Open the entry given by entryPath if its mode is open.�openNrMr�rrrr��sz	Tree.open�nonecCs|j�|jd||�dS)a�This command is used to indicate whether the entry given by
     entryPath has children entries and whether the children are visible. mode
     must be one of open, close or none. If mode is set to open, a (+)
     indicator is drawn next the entry. If mode is set to close, a (-)
     indicator is drawn next the entry. If mode is set to none, no
     indicators will be drawn for this entry. The default mode is none. The
     open mode indicates the entry has hidden children and this entry can be
     opened by the user. The close mode indicates that all the children of the
     entry are now visible and the entry can be closed by the user.�setmodeNrM�rr��moderrrr��s
zTree.setmode)r�)
r2r3r4r5r9r�r�r�r�r�rrrrr��sr�c@sZeZdZdZdifdd�Zdd�Zdd�Zd	d
�Zdd�Zddd�Z	dd�Z
ddd�ZdS)�	CheckListz�The CheckList widget
    displays a list of items to be selected by the user. CheckList acts
    similarly to the Tk checkbutton or radiobutton widgets, except it is
    capable of handling many more items than checkbuttons or radiobuttons.
    NcKsLt�||dddg||�t|d�|jd<t|d�|jd<t|d�|jd<dS)NZtixCheckListr\r�r�r�r�r�r�rrrr9s
�zCheckList.__init__cCs|j�|jd�dSr�rMr?rrrr�szCheckList.autosetmodecCs|j�|jd|�dSr�rMr�rrrr�szCheckList.closecCs|j�|jd|�Sr�rMr�rrrr� szCheckList.getmodecCs|j�|jd|�dSr�rMr�rrrr�$szCheckList.open�oncCs|j�|j�|jd|��S)z�Returns a list of items whose status matches status. If status is
     not specified, the list of items in the "on" status will be returned.
     Mode can be on, off, default�getselectionrZ)rr�rrrr�(szCheckList.getselectioncCs|j�|jd|�S)z(Returns the current status of entryPath.�	getstatusrMr�rrrr�.szCheckList.getstatuscCs|j�|jd||�dS)z~Sets the status of entryPath to be status. A bitmap will be
     displayed next to the entry its status is on, off or default.�	setstatusNrMr�rrrr�2szCheckList.setstatus)r�)r�)r2r3r4r5r9r�r�r�r�r�r�r�rrrrr�s
r�c@seZdZddd�ZdS)r�rjcCst�||||�dSrF�r|r9�rrdr,r~rrrr9>sz_dummyButton.__init__N)rj�r2r3r4r9rrrrr�=sr�c@seZdZddd�ZdS)r�rjcCst�||||�dSrFr�r�rrrr9Bsz_dummyCheckbutton.__init__N)rjr�rrrrr�Asr�c@seZdZddd�ZdS)r�rjcCst�||||�dSrFr�r�rrrr9Fsz_dummyEntry.__init__N)rjr�rrrrr�Esr�c@seZdZddd�ZdS)r^rjcCst�||||�dSrFr�r�rrrr9Jsz_dummyFrame.__init__N)rjr�rrrrr^Isr^c@seZdZddd�ZdS)r�rjcCst�||||�dSrFr�r�rrrr9Nsz_dummyLabel.__init__N)rjr�rrrrr�Msr�c@seZdZddd�ZdS)r�rjcCst�||||�dSrFr�r�rrrr9Rsz_dummyListbox.__init__N)rjr�rrrrr�Qsr�c@seZdZddd�ZdS)rwrjcCst�||||�dSrFr�r�rrrr9Vsz_dummyMenu.__init__N)rjr�rrrrrwUsrwc@seZdZddd�ZdS)rvrjcCst�||||�dSrFr�r�rrrr9Zsz_dummyMenubutton.__init__N)rjr�rrrrrvYsrvc@seZdZddd�ZdS)r�rjcCst�||||�dSrFr�r�rrrr9^sz_dummyScrollbar.__init__N)rjr�rrrrr�]sr�c@seZdZddd�ZdS)r�rjcCst�||||�dSrFr�r�rrrr9bsz_dummyText.__init__N)rjr�rrrrr�asr�c@seZdZddd�ZdS)r�rjcCsDt�||||�t|d�|jd<t|d�|jd<t|d�|jd<dS)Nr�r�r�)r|r9r�rcr�r�rrrr9fsz_dummyScrolledListBox.__init__N)rjr�rrrrr�esr�c@seZdZddd�ZdS)r�rjcCst�||||�dSrFr�r�rrrr9msz_dummyHList.__init__N)rjr�rrrrr�lsr�c@seZdZddd�ZdS)rarjcCsDt�||||�t|d�|jd<t|d�|jd<t|d�|jd<dS�Nr�r�r��r|r9r�rcr�r�rrrr9qsz_dummyScrolledHList.__init__N)rjr�rrrrrapsrac@seZdZddd�ZdS)r�rjcCst�||||�dSrFr�r�rrrr9xsz_dummyTList.__init__N)rjr�rrrrr�wsr�c@seZdZddd�ZdS)r�rjcCs�t�|||d|g�t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<z$t|d�|jd<t|d�|jd<Wntk
r�YnXdS)Nr�r�r�r�r�r�r�)r|r9r�rcr�r�r�r�r�rrrr9|s�
z_dummyComboBox.__init__N)rjr�rrrrr�{sr�c@seZdZddd�ZdS)r�rjcCsDt�||||�t|d�|jd<t|d�|jd<t|d�|jd<dSr�r�r�rrrr9�sz_dummyDirList.__init__N)rjr�rrrrr��sr�c@seZdZddd�ZdS)r�rjcCs4t�||||�t|d�|jd<t|d�|jd<dS)Nr�r�)r|r9r�rcr�r�rrrr9�sz_dummyDirSelectBox.__init__N)rjr�rrrrr��sr�c@seZdZddd�ZdS)r�rjcCs�t�||||�t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<dS)	Nr�r�r�r�r�r�r�r�)r|r9r�rcr�r�r�r�rrrr9�sz_dummyExFileSelectBox.__init__N)rjr�rrrrr��sr�c@seZdZddd�ZdS)r�rjcCsTt�||||�t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<dS)Nr�r�r�r�)r|r9r�rcr�r�rrrr9�s
z_dummyFileSelectBox.__init__N)rjr�rrrrr��sr�c@seZdZddd�ZdS)r�rjcCs$t�||||�t|d�|jd<dS)Nr�)r|r9r�rcr�rrrr9�sz_dummyFileComboBox.__init__N)rjr�rrrrr��sr�c@seZdZddd�ZdS)r�rjcCsTt�||||�t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<dS)Nr�r�r�r�)r|r9r�rcr�rrrr9�s
z_dummyStdButtonBox.__init__N)rjr�rrrrr��sr�c@seZdZddd�ZdS)�_dummyNoteBookFramercCst�||||�dSrFr�r�rrrr9�sz_dummyNoteBookFrame.__init__N)rr�rrrrr��sr�c@seZdZddd�ZdS)r`rjcCst�||||�dSrFr�r�rrrr9�sz_dummyPanedWindow.__init__N)rjr�rrrrr`�sr`cCs|j�d|j�S)zzReturns the qualified path name for the widget. Normally used to set
    default options for subwidgets. See tixwidgets.pyZ
tixOptionNamerM)r�rrr�
OptionName�sr�cCs:d}|��D](}|d|d|d||d}q|S)Nr=z{{z} {z - z}} )�keys)�dict�s�typerrr�FileTypeList�s&r�c@seZdZdZdS)�CObjViewaBThis file implements the Canvas Object View widget. This is a base
    class of IconView. It implements automatic placement/adjustment of the
    scrollbars according to the canvas objects inside the canvas subwidget.
    The scrollbars are adjusted so that the canvas is just large enough
    to see all the objects.
    N)r2r3r4r5rrrrr��sr�c@s�eZdZdZdifdd�Zdd�Zdd�Zd	d
�Zd)dd�Zd*d
d�Z	dd�Z
dd�Zdd�Zd+dd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd,d!d"�Zd#d$�Zd%d&�Zd'd(�ZdS)-�Grida}The Tix Grid command creates a new window  and makes it into a
    tixGrid widget. Additional options, may be specified on the command
    line or in the option database to configure aspects such as its cursor
    and relief.

    A Grid widget displays its contents in a two dimensional grid of cells.
    Each cell may contain one Tix display item, which may be in text,
    graphics or other formats. See the DisplayStyle class for more information
    about Tix display items. Individual cells, or groups of cells, can be
    formatted with a wide range of attributes, such as its color, relief and
    border.

    Subwidgets - NoneNcKs"g}||_t�||d|||�dS)NZtixGrid�r'r[r9r�rrrr9�sz
Grid.__init__cCs|j�|dd�dS)zRemoves the selection anchor.r�rNrr?rrrrszGrid.anchor_clearcCs|�|j�|dd��S)z3Get the (x,y) coordinate of the current anchor cellr�r/�r/rrr?rrr�
anchor_getszGrid.anchor_getcCs|j�|dd||�dS)z/Set the selection anchor to the cell at (x, y).r�r�Nrr�rrrr�szGrid.anchor_setcCs4|dkr|j�|dd|�n|j�|dd||�dS)zdDelete rows between from_ and to inclusive.
        If to is not provided,  delete only row at from_Nrzr
rr�rrr�
delete_rowszGrid.delete_rowcCs4|dkr|j�|dd|�n|j�|dd||�dS)zjDelete columns between from_ and to inclusive.
        If to is not provided,  delete only column at from_Nrzr	rr�rrr�
delete_columnszGrid.delete_columncCs|j�|dd�dS)zUIf any cell is being edited, de-highlight the cell  and  applies
        the changes.�editr�Nrr?rrr�
edit_applyszGrid.edit_applycCs|j�|dd||�dS)zmHighlights  the  cell  at  (x, y) for editing, if the -editnotify
        command returns True for this cell.r�r�Nrr�rrr�edit_set!sz
Grid.edit_setcCs,|r|ddkrd|}|j�|d|||�S)z&Get the option value for cell at (x,y)rr!rHr)rrQrRrrrrrH&szGrid.entrycgetcKs|�d||f||�SrI)Z
_configure)rrQrRr'r(rrrrJ,szGrid.entryconfigurec	Cs|�|j�|dd||��S)z+Return True if display item exists at (x,y)rTr()Z_getbooleanrrr�rrrr72szGrid.info_existscCs|j�|dd||�Sr.rr�rrrr06szGrid.info_bboxcCs|j�|dd|||�dS)z�Moves the range of columns from position FROM through TO by
        the distance indicated by OFFSET. For example, move_column(2, 4, 1)
        moves the columns 2,3,4 to columns 3,4,5.�mover	Nr�rr�r��offsetrrr�move_column:szGrid.move_columncCs|j�|dd|||�dS)z�Moves the range of rows from position FROM through TO by
        the distance indicated by OFFSET.
        For example, move_row(2, 4, 1) moves the rows 2,3,4 to rows 3,4,5.r�r
Nrr�rrr�move_row@sz
Grid.move_rowcCs|�|j�|d||��S)z8Return coordinate of cell nearest pixel coordinate (x,y)rLr�r�rrrrLFszGrid.nearestcKs>|�|j|�}|dk	r"d|f|}|jj|d||f|��dS)Nz	-itemtyper�)r%r'rr)rrQrRr�r(�argsrrrr�PszGrid.setcKs*|j�|jj|jdd|f|�i|����S)a�Queries or sets the size of the column given by
        INDEX.  INDEX may be any non-negative
        integer that gives the position of a given column.
        INDEX can also be the string "default"; in this case, this command
        queries or sets the default size of all columns.
        When no option-value pair is given, this command returns a tuple
        containing the current size setting of the given column.  When
        option-value pairs are given, the corresponding options of the
        size setting of the given column are changed. Options may be one
        of the following:
              pad0 pixels
                     Specifies the paddings to the left of a column.
              pad1 pixels
                     Specifies the paddings to the right of a column.
              size val
                     Specifies the width of a column.  Val may be:
                     "auto" -- the width of the column is set to the
                     width of the widest cell in the column;
                     a valid Tk screen distance unit;
                     or a real number following by the word chars
                     (e.g. 3.4chars) that sets the width of the column to the
                     given number of characters.rr	)rrPrrDr%�rr�r(rrr�size_columnVs
�zGrid.size_columncKs(|j�|jj|dd|f|�i|����S)a�Queries or sets the size of the row given by
        INDEX. INDEX may be any non-negative
        integer that gives the position of a given row .
        INDEX can also be the string "default"; in this case, this command
        queries or sets the default size of all rows.
        When no option-value pair is given, this command returns a list con-
        taining the current size setting of the given row . When option-value
        pairs are given, the corresponding options of the size setting of the
        given row are changed. Options may be one of the following:
              pad0 pixels
                     Specifies the paddings to the top of a row.
              pad1 pixels
                     Specifies the paddings to the bottom of a row.
              size val
                     Specifies the height of a row.  Val may be:
                     "auto" -- the height of the row is set to the
                     height of the highest cell in the row;
                     a valid Tk screen distance unit;
                     or a real number following by the word chars
                     (e.g. 3.4chars) that sets the height of the row to the
                     given number of characters.rr
)rrPrr%r�rrr�size_rowps�
�z
Grid.size_rowcCs|j�|jd||�dS)z7Clears the cell at (x, y) by removing its display item.�unsetNrMr�rrrr��sz
Grid.unset)N)N)N)N)r2r3r4r5r9rr�r�r�r�r�r�rHrJr7r0r�r�rLr�r�r�r�rrrrr��s(	




r�c@seZdZdZdifdd�ZdS)�ScrolledGridzScrolled Grid widgetsNcKs"g}||_t�||d|||�dS)NZtixScrolledGridr�r�rrrr9�szScrolledGrid.__init__r�rrrrr��sr�)ur:r8rZ_tkinterZWINDOWZTEXTZSTATUSZ	IMMEDIATEZIMAGEZ	IMAGETEXTZBALLOONZAUTOZ	ACROSSTOP�ASCIIZCELLZCOLUMNZ
DECREASINGZ
INCREASINGZINTEGERZMAIN�MAXZREALZROWZS_REGIONZX_REGIONZY_REGIONZ
TCL_DONT_WAITZTCL_WINDOW_EVENTSZTCL_FILE_EVENTSZTCL_TIMER_EVENTSZTCL_IDLE_EVENTSZTCL_ALL_EVENTSrr6rAra�	__bases__r[r|r�r�r�r�r�r�r�r�r�r�r�r�r�r�ZXViewZYViewr�rYrZr\r_rmrnrqrrr}r�r�r�r�r�r�r�r�r�r�r�r�r�r�ZButtonr�ZCheckbuttonr�ZEntryr�ZFramer^ZLabelr�ZListboxr�ZMenurwZ
MenubuttonrvZ	Scrollbarr�ZTextr�r�r�rar�r�r�r�r�r�r�r�r�r`r�r�r�r�r�rrrr�<module>s�-
8/,!"C#	()


S.6

*tkinter/__pycache__/commondialog.cpython-38.opt-1.pyc000064400000002132151153537530016501 0ustar00U

e5d��@sddlTGdd�d�ZdS)�)�*c@s2eZdZdZd
dd�Zdd�Zdd�Zdd	�ZdS)�DialogNcKs|s|�d�}||_||_dS)N�parent)�get�master�options)�selfrr�r	�,/usr/lib64/python3.8/tkinter/commondialog.py�__init__s
zDialog.__init__cCsdS�Nr	)rr	r	r
�_fixoptionsszDialog._fixoptionscCs|Srr	)rZwidget�resultr	r	r
�
_fixresultszDialog._fixresultcKs||��D]\}}||j|<q|��t|j�}z,|jj|jf|�	|j���}|�
||�}W5z|��WnYnXX|Sr)�itemsrr
ZFramerZdestroyZtkZcall�commandZ_optionsr)rr�k�v�w�sr	r	r
�shows
zDialog.show)N)�__name__�
__module__�__qualname__rrr
rrr	r	r	r
rs

rN)Ztkinterrr	r	r	r
�<module>stkinter/__pycache__/colorchooser.cpython-38.opt-1.pyc000064400000004316151153537530016540 0ustar00U

e5dA
�@s>ddlmZGdd�de�Zd	dd�Zedkr:ede��dS)
�)�Dialogc@s$eZdZdZdZdd�Zdd�ZdS)�Choosera�Create a dialog for the tk_chooseColor command.

    Args:
        master: The master widget for this dialog.  If not provided,
            defaults to options['parent'] (if defined).
        options: Dictionary of options for the tk_chooseColor call.
            initialcolor: Specifies the selected color when the
                dialog is first displayed.  This can be a tk color
                string or a 3-tuple of ints in the range (0, 255)
                for an RGB triplet.
            parent: The parent window of the color dialog.  The
                color dialog is displayed on top of this.
            title: A string for the title of the dialog box.
    Ztk_chooseColorcCs@z&|jd}t|t�r$d||jd<Wntk
r:YnXdS)zvEnsure initialcolor is a tk color string.

        Convert initialcolor from a RGB triplet to a color string.
        �initialcolorz
#%02x%02x%02xN)�options�
isinstance�tuple�KeyError)�self�color�r�,/usr/lib64/python3.8/tkinter/colorchooser.py�_fixoptions!s

zChooser._fixoptionscCs>|rt|�sdS|�|�\}}}|d|d|dft|�fS)z�Adjust result returned from call to tk_chooseColor.

        Return both an RGB tuple of ints in the range (0, 255) and the
        tk color string in the form #rrggbb.
        )NN�)�strZ	winfo_rgb)r	Zwidget�result�r�g�brrr�
_fixresult.szChooser._fixresultN)�__name__�
__module__�__qualname__�__doc__Zcommandr
rrrrrrs
rNcKs"|r|��}||d<tf|���S)z�Display dialog window for selection of a color.

    Convenience wrapper for the Chooser class.  Displays the color
    chooser dialog with color as the initial value.
    r)�copyrZshow)r
rrrr�askcolorBsr�__main__r
)N)Ztkinter.commondialogrrrr�printrrrr�<module>s3
tkinter/__pycache__/messagebox.cpython-38.opt-1.pyc000064400000005661151153537530016200 0ustar00U

e5d}�@sHddlmZdZdZdZdZdZdZdZd	Z	d
Z
dZdZd
Z
dZdZdZdZdZGdd�de�Zd5dd�Zd6dd�Zd7dd�Zd8dd�Zd9dd�Zd:dd �Zd;d!d"�Zd<d#d$�Zd=d%d&�Zed'k�rDeded(d)��eded(d*��eded(d+��eded(d,��ed-ed(d.��ed/ed(d0��ed1ed(d2��ed3ed(d4��dS)>�)�Dialog�error�infoZquestionZwarningZabortretryignore�okZokcancelZretrycancelZyesnoZyesnocancel�abortZretry�ignoreZcancelZyesZnoc@seZdZdZdZdS)�Messagez
A message boxZ
tk_messageBoxN)�__name__�
__module__�__qualname__�__doc__Zcommand�r
r
�*/usr/lib64/python3.8/tkinter/messagebox.pyr9srNcKsl|rd|kr||d<|r(d|kr(||d<|r4||d<|r@||d<tf|���}t|t�rd|r`tStSt|�S)NZicon�type�title�message)rZshow�
isinstance�bool�YES�NO�str)rrZ_iconZ_type�options�resr
r
r�_showCs
rcKst||ttf|�S)zShow an info message)r�INFO�OK�rrrr
r
r�showinfoRsrcKst||ttf|�S)zShow a warning message)r�WARNINGrrr
r
r�showwarningWsrcKst||ttf|�S)zShow an error message)r�ERRORrrr
r
r�	showerror\sr!cKst||ttf|�S)zAsk a question)r�QUESTION�YESNOrr
r
r�askquestionasr$cKst||ttf|�}|tkS)z@Ask if operation should proceed; return true if the answer is ok)rr"�OKCANCELr�rrr�sr
r
r�askokcancelfsr(cKst||ttf|�}|tkS)z0Ask a question; return true if the answer is yes)rr"r#rr&r
r
r�askyesnolsr)cKs.t||ttf|�}t|�}|tkr&dS|tkS)zDAsk a question; return true if the answer is yes, None if cancelled.N)rr"�YESNOCANCELr�CANCELrr&r
r
r�askyesnocancelrs
r,cKst||ttf|�}|tkS)zDAsk if operation should be retried; return true if the answer is yes)rr�RETRYCANCEL�RETRYr&r
r
r�askretrycancel|sr/�__main__ZSpamzEgg InformationzEgg Warningz	Egg Alertz	Question?ZproceedzProceed?zyes/nozGot it?z
yes/no/cancelzWant it?z	try againz
Try again?)NNNN)NN)NN)NN)NN)NN)NN)NN)NN)Ztkinter.commondialogrr rr"rZABORTRETRYIGNORErr%r-r#r*ZABORTr.ZIGNOREr+rrrrrrr!r$r(r)r,r/r	�printr
r
r
r�<module>sH










	
tkinter/__pycache__/ttk.cpython-38.opt-1.pyc000064400000156574151153537530014657 0ustar00U

e5d���@s�dZdZdZddddddd	d
ddd
ddddddddddddddgZddlZddlmZmZmZmZej	dkrpd nd!Z
d"d#�ZdXd$d%�ZdYd&d'�Z
d(d)�ZdZd*d+�Zd[d,d-�Zd\d/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Zd=d>�Zd?d�Zd]d@d�ZGdAd�de�ZGdBdC�dCej�ZGdDd�de�ZGdEd�de�ZGdFd�deej �Z GdGd�de �Z!GdHd�de�Z"GdId�de�Z#GdJd	�d	e�Z$e$Z%GdKd�de�Z&GdLd�de�Z'GdMd
�d
eej(�Z)e)Z(GdNd�de�Z*GdOd�de�Z+GdPd�deej,�Z,GdQd�deej-�Z-GdRd�de�Z.GdSd�de�Z/GdTd�de �Z0GdUd�deej1ej2�Z3GdVd�de"�Z4GdWd�de&�Z5dS)^a�Ttk wrapper.

This module provides classes to allow using Tk themed widget set.

Ttk is based on a revised and enhanced version of
TIP #48 (http://tip.tcl.tk/48) specified style engine.

Its basic idea is to separate, to the extent possible, the code
implementing a widget's behavior from the code implementing its
appearance. Widget class bindings are primarily responsible for
maintaining the widget state and invoking callbacks, all aspects
of the widgets appearance lies at Themes.
z0.3.1z!Guilherme Polo <ggpolo@gmail.com>�Button�Checkbutton�Combobox�Entry�Frame�Label�
Labelframe�
LabelFrame�
Menubutton�Notebook�Panedwindow�PanedWindow�Progressbar�Radiobutton�Scale�	Scrollbar�	Separator�Sizegrip�Spinbox�Style�Treeview�LabeledScale�
OptionMenu�
tclobjs_to_py�setup_master�N)�_flatten�_join�
_stringify�
_splitdictg!@TFcCsBtr>ddl}|j�d�}|r,|j�d|�|j�d�d|_dS)NrZTILE_LIBRARYz(global auto_path; lappend auto_path {%s}zpackage require tileT)�
_REQUIRE_TILE�os�environ�get�tk�eval�_tile_loaded)�masterr Ztilelib�r'�#/usr/lib64/python3.8/tkinter/ttk.py�
_load_tile"s��r)cCs(|rt|�}nt|ttf�r$t|�}|S)zInternal function.)r�
isinstance�list�tupler)�value�scriptr'r'r(�_format_optvalue1s

r/cCsPg}|��D]:\}}|r ||kr|�d|�|dk	r|�t||��qt|�S)z�Formats optdict to a tuple to pass it to tk.call.

    E.g. (script=False):
      {'foreground': 'blue', 'padding': [1, 2, 3, 4]} returns:
      ('-foreground', 'blue', '-padding', '1 2 3 4')�-%sN)�items�appendr/r)Zoptdictr.�ignore�opts�optr-r'r'r(�_format_optdict;sr6cCsXg}|D]J�^}}t|�dkr,|dp(d}n
d�|�}|�|�|dk	r|�|�q|S)N�r�� )�len�joinr2)r1Zopt_val�state�valr'r'r(�_mapdict_valuesKs

r>cCs:g}|��D]$\}}|�d|tt|�|�f�qt|�S)z�Formats mapdict to pass it to tk.call.

    E.g. (script=False):
      {'expand': [('active', 'selected', 'grey'), ('focus', [1, 2, 3, 4])]}

      returns:

      ('-expand', '{active selected} grey focus {1, 2, 3, 4}')r0)r1�extendr/r>r)Zmapdictr.r4r5r-r'r'r(�_format_mapdict`s

�r@cOs�d}d}|dkr�|dkrB|d}tt|dd���}d||f}n2|dd�\}}	tt|dd���}
d	||	|
f}t||�}n,|d
kr�|d}t|�dkr�t|d|�f}|r�d|}d�|�}||fS)
zAFormats args and kw according to the given element factory etype.Nr')�imageZvsapirArr7z%s %s�z%s %s %s�fromz{%s}r9)rr>r6r:r/r;)�etyper.�args�kw�specr4ZinameZ	imagespec�
class_nameZpart_idZstatemapr'r'r(�_format_elemcreateqs&
rIrBc
Cs�g}|D]�}|\}}|pi}d�t|dd��}dd|||rDd|ndf}d|kr�|�|d�||7}t|d||�\}	}|�|	�||8}|�d	d|�q|�|�qd
�|�|fS)a$Formats a layout list so we can pass the result to ttk::style
    layout and ttk::style settings. Note that the layout doesn't have to
    be a list necessarily.

    E.g.:
      [("Menubutton.background", None),
       ("Menubutton.button", {"children":
           [("Menubutton.focus", {"children":
               [("Menubutton.padding", {"children":
                [("Menubutton.label", {"side": "left", "expand": 1})]
               })]
           })]
       }),
       ("Menubutton.indicator", {"side": "right"})
      ]

      returns:

      Menubutton.background
      Menubutton.button -children {
        Menubutton.focus -children {
          Menubutton.padding -children {
            Menubutton.label -side left -expand 1
          }
        }
      }
      Menubutton.indicator -side rightr9T)�childrenz%s%s%sz %sr8rJz -children {z%s}�
)r;r6r2�_format_layoutlist)
�layout�indentZindent_sizer.Zlayout_elem�elemr4Zfopts�headZ	newscriptr'r'r(rL�s"
�
rLcCsXg}|��D�]>\}}|�d�rFd�t|dd��}|�d||f�|�d�rvd�t|dd��}|�d||f�d|kr�|ds�d}nt|d�\}}|�d	||f�|�d
�r|d
}|d}d}|t|�kr�t||d
�s�|d7}q�|d|�}	|t|�k�r||�r||ni}
t	|df|	�|
�\}}|�d||||f�qd�|�S)z�Returns an appropriate script, based on settings, according to
    theme_settings definition to be used by theme_settings and
    theme_create.�	configurer9Tzttk::style configure %s %s;�mapzttk::style map %s %s;rM�nullzttk::style layout %s {
%s
}zelement createrr7r1z%ttk::style element create %s %s %s %srK)
r1r"r;r6r2r@rLr:�hasattrrI)�settingsr.�namer4�s�_ZeoptsrDZargcZelemargsZelemkwrGr'r'r(�_script_from_settings�s:



$�
rYcCs�t|t�r|Sg}t|�}t||�D]j\}}t|d�rDt|���}n(t|t�rX|��}nt|ttf�sl|f}t|d�r~t|�}|�||f��q$|S)ztConstruct a list from the given statespec tuple according to the
    accepted statespec accepted by _format_mapdict.�typename)	r*�str�iter�ziprT�splitr,r+r2)Zstuple�result�itr<r=r'r'r(�_list_from_statespec�s




racCs�|�|�}g}d}|t|�kr�||}i}|�||f�|d7}|t|�kr|||d�\}}|�d�slq|dd�}|d7}|dkr�t||�}|||<q@q|S)zpConstruct a list from the tuple returned by ttk::layout, this is
    somewhat the reverse of _format_layoutlist.rr7rB�-NrJ)�	splitlistr:r2�
startswith�_list_from_layouttuple)r#Zltuple�resZindxrVr4r5r=r'r'r(res$


recGs4t|�}|j||�}t|�dr&|St||td�S)ahFormat options then call Tk command with args and options and return
    the appropriate result.

    If no option is specified, a dict is returned. If an option is
    specified with the None value, the value for that option is returned.
    Otherwise, the function just sets the passed options and the caller
    shouldn't be expecting a return value anyway.rB)�conv)r6�callr:r�
_tclobj_to_py)r#�optionsrErfr'r'r(�_val_or_dict!s
rkc	Cs2t|�}zt|�}Wnttfk
r,YnX|S)zAConverts a value to, hopefully, a more appropriate Python object.)r[�int�
ValueError�	TypeError)r-r'r'r(�_convert_stringval1srocCs(t|t�r$d|krt|�}nt|�}|S)N�.)r*r[�floatrl)�xr'r'r(�
_to_number;s


rscCs\|rFt|d�rFt|t�sFt|ddd�dkr6t|�}qXttt|��}nt|d�rXt|�}|S)z8Return value converted from Tcl object to Python object.�__len__rrZNZ	StateSpec)rTr*r[�getattrrar+rRro)r=r'r'r(riCs

ricCs"|��D]\}}t|�||<q|S)zOReturns adict with its values converted from Tcl objects to Python
    objects.)r1ri)Zadictr5r=r'r'r(rPscCs|dkrt��}|S)aIf master is not None, itself is returned. If master is None,
    the default master is returned if there is one, otherwise a new
    master is created and returned.

    If it is not allowed to use the default root and master is None,
    RuntimeError is raised.N)�tkinterZ_get_default_root)r&r'r'r(rXsc@s�eZdZdZdZddd�Zddd�Zddd	�Zdd
d�Zd dd
�Z	dd�Z
dd�Zdd�Zd!dd�Z
dd�Zdd�Zd"dd�ZdS)#rzManipulate style database.z
ttk::styleNcCs0t|�}t|dd�st|�||_|jj|_dS)Nr%F)rrur)r&r#)�selfr&r'r'r(�__init__is
zStyle.__init__cKs4|dk	rd||<t|j||jd|�}|s,|r0|SdS)z�Query or sets the default value of the specified option(s) in
        style.

        Each key in kw is an option and each value is either a string or
        a sequence identifying the value for that option.NrQ)rkr#�_name�rw�styleZ	query_optrFr_r'r'r(rQts
zStyle.configurecsj|dk	r0�j��jd|d|�}t�j�|��S�jj�jd|ft|���}�fdd�t�j|���D�S)aSQuery or sets dynamic values of the specified option(s) in
        style.

        Each key in kw is an option and each value should be a list or a
        tuple (usually) containing statespecs grouped in tuples, or list,
        or something else of your preference. A statespec is compound of
        one or more states and then a value.NrRr0cs"i|]\}}|t�j�|���qSr')rar#rc)�.0�k�v�rwr'r(�
<dictcomp>�s�zStyle.map.<locals>.<dictcomp>)r#rhryrarcr@rr1rzr'rr(rR�s
�z	Style.mapcCs.|rd�|�nd}|j�|jd|d|||�S)aReturns the value specified for option in style.

        If state is specified it is expected to be a sequence of one
        or more states. If the default argument is set, it is used as
        a fallback value in case no specification for option is found.r9r8�lookupr0)r;r#rhry)rwr{�optionr<�defaultr'r'r(r��s
�zStyle.lookupcCs>d}|rt|�d}n|dk	r"d}t|j|j�|jd||��S)a�Define the widget layout for given style. If layoutspec is
        omitted, return the layout specification for given style.

        layoutspec is expected to be a list or an object different than
        None that evaluates to False if you want to "turn off" that style.
        If it is a list (or tuple, or something else), each item should be
        a tuple where the first item is the layout name and the second item
        should have the format described below:

        LAYOUTS

            A layout can contain the value None, if takes no options, or
            a dict of options specifying how to arrange the element.
            The layout mechanism uses a simplified version of the pack
            geometry manager: given an initial cavity, each element is
            allocated a parcel. Valid options/values are:

                side: whichside
                    Specifies which side of the cavity to place the
                    element; one of top, right, bottom or left. If
                    omitted, the element occupies the entire cavity.

                sticky: nswe
                    Specifies where the element is placed inside its
                    allocated parcel.

                children: [sublayout... ]
                    Specifies a list of elements to place inside the
                    element. Each element is a tuple (or other sequence)
                    where the first item is the layout name, and the other
                    is a LAYOUT.NrrSrM)rLrer#rhry)rwr{Z
layoutspecZlspecr'r'r(rM�s �zStyle.layoutcOs8t|df|�|�\}}|jj|jdd|||f|��dS)z9Create a new element in the current theme of given etype.F�element�createN)rIr#rhry)rw�elementnamerDrErFrGr4r'r'r(�element_create�s��zStyle.element_createc	Cs(tdd�|j�|j�|jdd��D��S)z:Returns the list of elements defined in the current theme.css|]}|�d�VqdS�rbN��lstrip)r|�nr'r'r(�	<genexpr>�sz&Style.element_names.<locals>.<genexpr>r��names�r,r#rcrhryrr'r'r(�
element_names�s�zStyle.element_namesc
Cs*tdd�|j�|j�|jdd|��D��S)z)Return the list of elementname's options.css|]}|�d�VqdSr�r�)r|�or'r'r(r��sz(Style.element_options.<locals>.<genexpr>r�rjr�)rwr�r'r'r(�element_options�s�zStyle.element_optionsc
CsN|rt|�nd}|r2|j�|jdd|d|d|�n|j�|jdd|d|�dS)a.Creates a new theme.

        It is an error if themename already exists. If parent is
        specified, the new theme will inherit styles, elements and
        layouts from the specified parent theme. If settings are present,
        they are expected to have the same syntax used for theme_settings.r8�themer�z-parentz	-settingsN�rYr#rhry)rw�	themename�parentrUr.r'r'r(�theme_create�s��zStyle.theme_createcCs"t|�}|j�|jdd||�dS)a�Temporarily sets the current theme to themename, apply specified
        settings and then restore the previous theme.

        Each key in settings is a style and each value may contain the
        keys 'configure', 'map', 'layout' and 'element create' and they
        are expected to have the same format as specified by the methods
        configure, map, layout and element_create respectively.r�rUNr�)rwr�rUr.r'r'r(�theme_settings�szStyle.theme_settingscCs|j�|j�|jdd��S)z#Returns a list of all known themes.r�r�)r#rcrhryrr'r'r(�theme_names�szStyle.theme_namescCs&|dkr|j�d�S|j�d|�dS)z�If themename is None, returns the theme in use, otherwise, set
        the current theme to themename, refreshes all widgets and emits
        a <<ThemeChanged>> event.Nzreturn $ttk::currentThemez
ttk::setTheme)r#r$rh)rwr�r'r'r(�	theme_use�szStyle.theme_use)N)N)N)NN)N)NN)N)�__name__�
__module__�__qualname__�__doc__ryrxrQrRr�rMr�r�r�r�r�r�r�r'r'r'r(rds




+
c@s6eZdZdZddd�Zdd�Zddd�Zd
d	d
�ZdS)�Widgetz!Base class for Tk themed widgets.NcCs4t|�}t|dd�st|�tjj||||d�dS)a�Constructs a Ttk Widget with the parent master.

        STANDARD OPTIONS

            class, cursor, takefocus, style

        SCROLLABLE WIDGET OPTIONS

            xscrollcommand, yscrollcommand

        LABEL WIDGET OPTIONS

            text, textvariable, underline, image, compound, width

        WIDGET STATES

            active, disabled, focus, pressed, selected, background,
            readonly, alternate, invalid
        r%F)rFN)rrur)rvr�rx)rwr&Z
widgetnamerFr'r'r(rxszWidget.__init__cCs|j�|jd||�S)z�Returns the name of the element at position x, y, or the empty
        string if the point does not lie within any element.

        x and y are pixel coordinates relative to the widget.�identify�r#rh�_w�rwrr�yr'r'r(r�+szWidget.identifyc	Os6|j�|j�|jdd�|���}|r2|r2|||�S|S)a1Test the widget's state.

        If callback is not specified, returns True if the widget state
        matches statespec and False otherwise. If callback is specified,
        then it will be invoked with *args, **kw if the widget state
        matches statespec. statespec is expected to be a sequence.�instater9)r#�
getbooleanrhr�r;)rw�	statespec�callbackrErFZretr'r'r(r�3s�
zWidget.instatecCs0|dk	rd�|�}|j�t|j�|jd|���S)aModify or inquire widget state.

        Widget state is returned if statespec is None, otherwise it is
        set according to the statespec flags and then a new state spec
        is returned indicating which flags were changed. statespec is
        expected to be a sequence.Nr9r<)r;r#rcr[rhr�)rwr�r'r'r(r<Bs
zWidget.state)N)N)N)r�r�r�r�rxr�r�r<r'r'r'r(r�
s


r�c@s"eZdZdZddd�Zdd�ZdS)rzcTtk Button widget, displays a textual label and/or image, and
    evaluates a command when pressed.NcKst�||d|�dS)aConstruct a Ttk Button widget with the parent master.

        STANDARD OPTIONS

            class, compound, cursor, image, state, style, takefocus,
            text, textvariable, underline, width

        WIDGET-SPECIFIC OPTIONS

            command, default, width
        zttk::buttonN�r�rx�rwr&rFr'r'r(rxSszButton.__init__cCs|j�|jd�S)z/Invokes the command associated with the button.�invoker�rr'r'r(r�bsz
Button.invoke)N�r�r�r�r�rxr�r'r'r'r(rOs
c@s"eZdZdZddd�Zdd�ZdS)rz;Ttk Checkbutton widget which is either in on- or off-state.NcKst�||d|�dS)a'Construct a Ttk Checkbutton widget with the parent master.

        STANDARD OPTIONS

            class, compound, cursor, image, state, style, takefocus,
            text, textvariable, underline, width

        WIDGET-SPECIFIC OPTIONS

            command, offvalue, onvalue, variable
        zttk::checkbuttonNr�r�r'r'r(rxjszCheckbutton.__init__cCs|j�|jd�S)aWToggles between the selected and deselected states and
        invokes the associated command. If the widget is currently
        selected, sets the option variable to the offvalue option
        and deselects the widget; otherwise, sets the option variable
        to the option onvalue.

        Returns the result of the associated command.r�r�rr'r'r(r�yszCheckbutton.invoke)Nr�r'r'r'r(rgs
c@s2eZdZdZddd�Zdd�Zdd�Zd	d
�ZdS)rzeTtk Entry widget displays a one-line text string and allows that
    string to be edited by the user.NcKst�|||pd|�dS)a�Constructs a Ttk Entry widget with the parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus, xscrollcommand

        WIDGET-SPECIFIC OPTIONS

            exportselection, invalidcommand, justify, show, state,
            textvariable, validate, validatecommand, width

        VALIDATION MODES

            none, key, focus, focusin, focusout, all
        z
ttk::entryNr�)rwr&ZwidgetrFr'r'r(rx�szEntry.__init__cCs|�|j�|jd|��S)zqReturn a tuple of (x, y, width, height) which describes the
        bounding box of the character given by index.�bbox�Z_getintsr#rhr�)rw�indexr'r'r(r��sz
Entry.bboxcCs|j�|jd||�S)zxReturns the name of the element at position x, y, or the
        empty string if the coordinates are outside the window.r�r�r�r'r'r(r��szEntry.identifycCs|j�|j�|jd��S)z�Force revalidation, independent of the conditions specified
        by the validate option. Returns False if validation fails, True
        if it succeeds. Sets or clears the invalid state accordingly.�validate�r#r�rhr�rr'r'r(r��szEntry.validate)NN)r�r�r�r�rxr�r�r�r'r'r'r(r�s

c@s,eZdZdZd	dd�Zd
dd�Zdd�ZdS)rzMTtk Combobox widget combines a text field with a pop-down list of
    values.NcKstj||df|�dS)aConstruct a Ttk Combobox widget with the parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS

            exportselection, justify, height, postcommand, state,
            textvariable, values, width
        z
ttk::comboboxN�rrxr�r'r'r(rx�szCombobox.__init__cCs2|dkr |j�|j�|jd��S|j�|jd|�S)aIf newindex is supplied, sets the combobox value to the
        element at position newindex in the list of values. Otherwise,
        returns the index of the current value in the list of values
        or -1 if the current value does not appear in the list.N�current�r#Zgetintrhr�)rwZnewindexr'r'r(r��szCombobox.currentcCs|j�|jd|�dS)z(Sets the value of the combobox to value.�setNr��rwr-r'r'r(r��szCombobox.set)N)N)r�r�r�r�rxr�r�r'r'r'r(r�s


c@seZdZdZddd�ZdS)rzJTtk Frame widget is a container, used to group other widgets
    together.NcKst�||d|�dS)z�Construct a Ttk Frame with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS

            borderwidth, relief, padding, width, height
        z
ttk::frameNr�r�r'r'r(rx�szFrame.__init__)N�r�r�r�r�rxr'r'r'r(r�sc@seZdZdZddd�ZdS)rz7Ttk Label widget displays a textual label and/or image.NcKst�||d|�dS)aGConstruct a Ttk Label with parent master.

        STANDARD OPTIONS

            class, compound, cursor, image, style, takefocus, text,
            textvariable, underline, width

        WIDGET-SPECIFIC OPTIONS

            anchor, background, font, foreground, justify, padding,
            relief, text, wraplength
        z
ttk::labelNr�r�r'r'r(rx�s
zLabel.__init__)Nr�r'r'r'r(r�sc@seZdZdZddd�ZdS)rz�Ttk Labelframe widget is a container used to group other widgets
    together. It has an optional label, which may be a plain text string
    or another widget.NcKst�||d|�dS)z�Construct a Ttk Labelframe with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS
            labelanchor, text, underline, padding, labelwidget, width,
            height
        zttk::labelframeNr�r�r'r'r(rx�szLabelframe.__init__)Nr�r'r'r'r(r�sc@seZdZdZddd�ZdS)r	zbTtk Menubutton widget displays a textual label and/or image, and
    displays a menu when pressed.NcKst�||d|�dS)aConstruct a Ttk Menubutton with parent master.

        STANDARD OPTIONS

            class, compound, cursor, image, state, style, takefocus,
            text, textvariable, underline, width

        WIDGET-SPECIFIC OPTIONS

            direction, menu
        zttk::menubuttonNr�r�r'r'r(rxszMenubutton.__init__)Nr�r'r'r'r(r	
sc@sneZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
ddd�Zddd�Zdd�Z
dd�ZdS)r
z�Ttk Notebook widget manages a collection of windows and displays
    a single one at a time. Each child window is associated with a tab,
    which the user may select to change the currently-displayed window.NcKst�||d|�dS)a\Construct a Ttk Notebook with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS

            height, padding, width

        TAB OPTIONS

            state, sticky, padding, text, image, compound, underline

        TAB IDENTIFIERS (tab_id)

            The tab_id argument found in several methods may take any of
            the following forms:

                * An integer between zero and the number of tabs
                * The name of a child window
                * A positional specification of the form "@x,y", which
                  defines the tab
                * The string "current", which identifies the
                  currently-selected tab
                * The string "end", which returns the number of tabs (only
                  valid for method index)
        z
ttk::notebookNr�r�r'r'r(rx"szNotebook.__init__cKs |jj|jd|ft|���dS)z�Adds a new tab to the notebook.

        If window is currently managed by the notebook but hidden, it is
        restored to its previous position.�addN�r#rhr�r6)rw�childrFr'r'r(r�BszNotebook.addcCs|j�|jd|�dS)zXRemoves the tab specified by tab_id, unmaps and unmanages the
        associated window.�forgetNr��rw�tab_idr'r'r(r�JszNotebook.forgetcCs|j�|jd|�dS)z�Hides the tab specified by tab_id.

        The tab will not be displayed, but the associated window remains
        managed by the notebook and its configuration remembered. Hidden
        tabs may be restored with the add command.�hideNr�r�r'r'r(r�Psz
Notebook.hidecCs|j�|jd||�S)zZReturns the name of the tab element at position x, y, or the
        empty string if none.r�r�r�r'r'r(r�YszNotebook.identifycCs|j�|j�|jd|��S)z|Returns the numeric index of the tab specified by tab_id, or
        the total number of tabs if tab_id is the string "end".r�r�r�r'r'r(r�_szNotebook.indexcKs"|jj|jd||ft|���dS)z�Inserts a pane at the specified position.

        pos is either the string end, an integer index, or the name of
        a managed child. If child is already managed by the notebook,
        moves it to the specified position.�insertNr��rw�posr�rFr'r'r(r�eszNotebook.insertcCs|j�|jd|�S)z�Selects the specified tab.

        The associated child window will be displayed, and the
        previously-selected window (if different) is unmapped. If tab_id
        is omitted, returns the widget name of the currently selected
        pane.�selectr�r�r'r'r(r�nszNotebook.selectcKs$|dk	rd||<t|j||jd|�S)z�Query or modify the options of the specific tab_id.

        If kw is not given, returns a dict of the tab option values. If option
        is specified, returns the value of that option. Otherwise, sets the
        options to the corresponding values.N�tab�rkr#r�)rwr�r�rFr'r'r(r�xszNotebook.tabcCs|j�|j�|jd�pd�S)z2Returns a list of windows managed by the notebook.�tabsr'�r#rcrhr�rr'r'r(r��sz
Notebook.tabscCs|j�d|j�dS)a�Enable keyboard traversal for a toplevel window containing
        this notebook.

        This will extend the bindings for the toplevel window containing
        this notebook as follows:

            Control-Tab: selects the tab following the currently selected
                         one

            Shift-Control-Tab: selects the tab preceding the currently
                               selected one

            Alt-K: where K is the mnemonic (underlined) character of any
                   tab, will select that tab.

        Multiple notebooks in a single toplevel may be enabled for
        traversal, including nested notebooks. However, notebook traversal
        only works properly if all panes are direct children of the
        notebook.zttk::notebook::enableTraversalNr�rr'r'r(�enable_traversal�szNotebook.enable_traversal)N)N)N)r�r�r�r�rxr�r�r�r�r�r�r�r�r�r�r'r'r'r(r
s
 		


c@s>eZdZdZddd�ZejjZdd�Zddd�Z	d
d	d
�Z
dS)rzfTtk Panedwindow widget displays a number of subwindows, stacked
    either vertically or horizontally.NcKst�||d|�dS)z�Construct a Ttk Panedwindow with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS

            orient, width, height

        PANE OPTIONS

            weight
        zttk::panedwindowNr�r�r'r'r(rx�szPanedwindow.__init__cKs"|jj|jd||ft|���dS)z�Inserts a pane at the specified positions.

        pos is either the string end, and integer index, or the name
        of a child. If child is already managed by the paned window,
        moves it to the specified position.r�Nr�r�r'r'r(r��szPanedwindow.insertcKs$|dk	rd||<t|j||jd|�S)aQQuery or modify the options of the specified pane.

        pane is either an integer index or the name of a managed subwindow.
        If kw is not given, returns a dict of the pane option values. If
        option is specified then the value for that option is returned.
        Otherwise, sets the options to the corresponding values.N�paner�)rwr�r�rFr'r'r(r��szPanedwindow.panecCs|j�|j�|jd||��S)aLIf newpos is specified, sets the position of sash number index.

        May adjust the positions of adjacent sashes to ensure that
        positions are monotonically increasing. Sash positions are further
        constrained to be between 0 and the total size of the widget.

        Returns the new position of sash number index.�sashposr�)rwr�Znewposr'r'r(r��szPanedwindow.sashpos)N)N)N)r�r�r�r�rxrvrr�r�r�r�r'r'r'r(r�s
	
c@s6eZdZdZddd�Zddd�Zd
dd�Zd	d
�ZdS)r
a6Ttk Progressbar widget shows the status of a long-running
    operation. They can operate in two modes: determinate mode shows the
    amount completed relative to the total amount of work to be done, and
    indeterminate mode provides an animated display to let the user know
    that something is happening.NcKst�||d|�dS)z�Construct a Ttk Progressbar with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS

            orient, length, mode, maximum, value, variable, phase
        zttk::progressbarNr�r�r'r'r(rx�szProgressbar.__init__cCs|j�|jd|�dS)z�Begin autoincrement mode: schedules a recurring timer event
        that calls method step every interval milliseconds.

        interval defaults to 50 milliseconds (20 steps/second) if omitted.�startNr�)rwZintervalr'r'r(r��szProgressbar.startcCs|j�|jd|�dS)zRIncrements the value option by amount.

        amount defaults to 1.0 if omitted.�stepNr�)rwZamountr'r'r(r��szProgressbar.stepcCs|j�|jd�dS)zVStop autoincrement mode: cancels any recurring timer event
        initiated by start.�stopNr�rr'r'r(r�szProgressbar.stop)N)N)N)r�r�r�r�rxr�r�r�r'r'r'r(r
�s



c@s"eZdZdZddd�Zdd�ZdS)rzeTtk Radiobutton widgets are used in groups to show or change a
    set of mutually-exclusive options.NcKst�||d|�dS)aConstruct a Ttk Radiobutton with parent master.

        STANDARD OPTIONS

            class, compound, cursor, image, state, style, takefocus,
            text, textvariable, underline, width

        WIDGET-SPECIFIC OPTIONS

            command, value, variable
        zttk::radiobuttonNr�r�r'r'r(rxszRadiobutton.__init__cCs|j�|jd�S)z�Sets the option variable to the option value, selects the
        widget, and invokes the associated command.

        Returns the result of the command, or an empty string if
        no command is specified.r�r�rr'r'r(r�szRadiobutton.invoke)Nr�r'r'r'r(rs
c@s.eZdZdZd	dd�Zd
dd�Zddd�ZdS)rzTtk Scale widget is typically used to control the numeric value of
    a linked variable that varies uniformly over some range.NcKst�||d|�dS)z�Construct a Ttk Scale with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS

            command, from, length, orient, to, value, variable
        z
ttk::scaleNr�r�r'r'r(rx'szScale.__init__cKsTtj||f|�}t|td�tf�s,|�|�td|kd|kd|kg�rP|�d�|S)z�Modify or query scale options.

        Setting a value for any of the "from", "from_" or "to" options
        generates a <<RangeChanged>> event.NrC�from_�to�<<RangeChanged>>)r�rQr*�typer[�update�anyZevent_generate)rwZcnfrFZretvalr'r'r(rQ5s

zScale.configurecCs|j�|jd||�S)z�Get the current value of the value option, or the value
        corresponding to the coordinates x, y if they are specified.

        x and y are pixel coordinates relative to the scale widget
        origin.r"r�r�r'r'r(r"Bsz	Scale.get)N)N)NN)r�r�r�r�rxrQr"r'r'r'r(r#s


c@seZdZdZddd�ZdS)rz;Ttk Scrollbar controls the viewport of a scrollable widget.NcKst�||d|�dS)z�Construct a Ttk Scrollbar with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS

            command, orient
        zttk::scrollbarNr�r�r'r'r(rxNszScrollbar.__init__)Nr�r'r'r'r(rKsc@seZdZdZddd�ZdS)rzITtk Separator widget displays a horizontal or vertical separator
    bar.NcKst�||d|�dS)z�Construct a Ttk Separator with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus

        WIDGET-SPECIFIC OPTIONS

            orient
        zttk::separatorNr�r�r'r'r(rx`szSeparator.__init__)Nr�r'r'r'r(r\sc@seZdZdZddd�ZdS)rzlTtk Sizegrip allows the user to resize the containing toplevel
    window by pressing and dragging the grip.NcKst�||d|�dS)z�Construct a Ttk Sizegrip with parent master.

        STANDARD OPTIONS

            class, cursor, state, style, takefocus
        z
ttk::sizegripNr�r�r'r'r(rxrszSizegrip.__init__)Nr�r'r'r'r(rnsc@s"eZdZdZddd�Zdd�ZdS)rz�Ttk Spinbox is an Entry with increment and decrement arrows

    It is commonly used for number entry or to select from a list of
    string values.
    NcKstj||df|�dS)a/Construct a Ttk Spinbox widget with the parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus, validate,
            validatecommand, xscrollcommand, invalidcommand

        WIDGET-SPECIFIC OPTIONS

            to, from_, increment, values, wrap, format, command
        zttk::spinboxNr�r�r'r'r(rx�szSpinbox.__init__cCs|j�|jd|�dS)z'Sets the value of the Spinbox to value.r�Nr�r�r'r'r(r��szSpinbox.set)N)r�r�r�r�rxr�r'r'r'r(r|s
c@s4eZdZdZdEdd�ZdFdd�ZdGdd�Zd	d
�ZdHdd�Zd
d�Z	dd�Z
dd�ZdIdd�ZdJdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�ZdKd#d$�ZdLd%d&�Zd'd(�ZeZd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Z d;d<�Z!dMd=d>�Z"dNd?d@�Z#dOdAdB�Z$dPdCdD�Z%dS)Qrz�Ttk Treeview widget displays a hierarchical collection of items.

    Each item has a textual label, an optional image, and an optional list
    of data values. The data values are displayed in successive columns
    after the tree label.NcKst�||d|�dS)a�Construct a Ttk Treeview with parent master.

        STANDARD OPTIONS

            class, cursor, style, takefocus, xscrollcommand,
            yscrollcommand

        WIDGET-SPECIFIC OPTIONS

            columns, displaycolumns, height, padding, selectmode, show

        ITEM OPTIONS

            text, image, values, open, tags

        TAG OPTIONS

            foreground, background, font, image
        z
ttk::treeviewNr�r�r'r'r(rx�szTreeview.__init__cCs|�|j�|jd||��pdS)aTReturns the bounding box (relative to the treeview widget's
        window) of the specified item in the form x y width height.

        If column is specified, returns the bounding box of that cell.
        If the item is not visible (i.e., if it is a descendant of a
        closed item or is scrolled offscreen), returns an empty string.r�r8r�)rw�item�columnr'r'r(r��sz
Treeview.bboxcCs"|j�|j�|jd|pd�pd�S)zhReturns a tuple of children belonging to item.

        If item is not specified, returns root children.rJr8r'r��rwr�r'r'r(�get_children�s�zTreeview.get_childrencGs|j�|jd||�dS)z�Replaces item's child with newchildren.

        Children present in item that are not present in newchildren
        are detached from tree. No items in newchildren may be an
        ancestor of item.rJNr�)rwr�Znewchildrenr'r'r(�set_children�szTreeview.set_childrencKs$|dk	rd||<t|j||jd|�S)a
Query or modify the options for the specified column.

        If kw is not given, returns a dict of the column option values. If
        option is specified then the value for that option is returned.
        Otherwise, sets the options to the corresponding values.Nr�r�)rwr�r�rFr'r'r(r��szTreeview.columncGs|j�|jd|�dS)z_Delete all specified items and all their descendants. The root
        item may not be deleted.�deleteNr��rwr1r'r'r(r��szTreeview.deletecGs|j�|jd|�dS)z�Unlinks all of the specified items from the tree.

        The items and all of their descendants are still present, and may
        be reinserted at another point in the tree, but will not be
        displayed. The root item may not be detached.�detachNr�r�r'r'r(r��szTreeview.detachcCs|j�|j�|jd|��S)zSReturns True if the specified item is present in the tree,
        False otherwise.�existsr�r�r'r'r(r��szTreeview.existscCs|j�|jd|�S)z}If item is specified, sets the focus item to item. Otherwise,
        returns the current focus item, or '' if there is none.�focusr�r�r'r'r(r��szTreeview.focuscKsP|�d�}|r,t|t�s,|j�||j�|d<|dk	r<d||<t|j||jd|�S)a_Query or modify the heading options for the specified column.

        If kw is not given, returns a dict of the heading option values. If
        option is specified then the value for that option is returned.
        Otherwise, sets the options to the corresponding values.

        Valid options/values are:
            text: text
                The text to display in the column heading
            image: image_name
                Specifies an image to display to the right of the column
                heading
            anchor: anchor
                Specifies how the heading text should be aligned. One of
                the standard Tk anchor values
            command: callback
                A callback to be invoked when the heading label is
                pressed.

        To configure the tree column heading, call this with column = "#0" �commandN�heading)	r"r*r[r&�registerZ_substituterkr#r�)rwr�r�rF�cmdr'r'r(r��s
zTreeview.headingcCs|j�|jd|||�S)z�Returns a description of the specified component under the
        point given by x and y, or the empty string if no such component
        is present at that position.r�r�)rwZ	componentrrr�r'r'r(r�szTreeview.identifycCs|�dd|�S)z.Returns the item ID of the item at position y.�rowr�r�)rwr�r'r'r(�identify_rowszTreeview.identify_rowcCs|�d|d�S)zaReturns the data column identifier of the cell at position x.

        The tree column has ID #0.r�rr�)rwrrr'r'r(�identify_column"szTreeview.identify_columncCs|�d||�S)z�Returns one of:

        heading: Tree heading area.
        separator: Space between two columns headings;
        tree: The tree area.
        cell: A data cell.

        * Availability: Tk 8.6Zregionr�r�r'r'r(�identify_region)s	zTreeview.identify_regioncCs|�d||�S)zEReturns the element at position x, y.

        * Availability: Tk 8.6r�r�r�r'r'r(�identify_element5szTreeview.identify_elementcCs|j�|j�|jd|��S)zOReturns the integer index of item within its parent's list
        of children.r�r�r�r'r'r(r�<szTreeview.indexcKsNt|�}|dk	r0|jj|jd||d|f|��}n|jj|jd||f|��}|S)a�Creates a new item and return the item identifier of the newly
        created item.

        parent is the item ID of the parent item, or the empty string
        to create a new top-level item. index is an integer, or the value
        end, specifying where in the list of parent's children to insert
        the new item. If index is less than or equal to zero, the new node
        is inserted at the beginning, if index is greater than or equal to
        the current number of children, it is inserted at the end. If iid
        is specified, it is used as the item identifier, iid must not
        already exist in the tree. Otherwise, a new unique identifier
        is generated.Nr�z-id)r6r#rhr�)rwr�r�ZiidrFr4rfr'r'r(r�Bs
��zTreeview.insertcKs$|dk	rd||<t|j||jd|�S)a-Query or modify the options for the specified item.

        If no options are given, a dict with options/values for the item
        is returned. If option is specified then the value for that option
        is returned. Otherwise, sets the options to the corresponding
        values as given by kw.Nr�r�)rwr�r�rFr'r'r(r�Ysz
Treeview.itemcCs|j�|jd|||�dS)aRMoves item to position index in parent's list of children.

        It is illegal to move an item under one of its descendants. If
        index is less than or equal to zero, item is moved to the
        beginning, if greater than or equal to the number of children,
        it is moved to the end. If item was detached it is reattached.�moveNr�)rwr�r�r�r'r'r(r�esz
Treeview.movecCs|j�|jd|�S)zeReturns the identifier of item's next sibling, or '' if item
        is the last child of its parent.�nextr�r�r'r'r(r�qsz
Treeview.nextcCs|j�|jd|�S)zaReturns the ID of the parent of item, or '' if item is at the
        top level of the hierarchy.r�r�r�r'r'r(r�wszTreeview.parentcCs|j�|jd|�S)zjReturns the identifier of item's previous sibling, or '' if
        item is the first child of its parent.�prevr�r�r'r'r(r�}sz
Treeview.prevcCs|j�|jd|�dS)z�Ensure that item is visible.

        Sets all of item's ancestors open option to True, and scrolls
        the widget if necessary so that item is within the visible
        portion of the tree.�seeNr�r�r'r'r(r��szTreeview.seecCs|j�|j�|jd��S)z$Returns the tuple of selected items.�	selectionr�rr'r'r(r��szTreeview.selectioncCs>t|�dkr&t|dttf�r&|d}|j�|jd||�dS)Nr7rr�)r:r*r,r+r#rhr�)rwZselopr1r'r'r(�
_selection�szTreeview._selectioncGs|�d|�dS)z.The specified items becomes the new selection.r�N�r�r�r'r'r(�
selection_set�szTreeview.selection_setcGs|�d|�dS)z0Add all of the specified items to the selection.r�Nr�r�r'r'r(�
selection_add�szTreeview.selection_addcGs|�d|�dS)z5Remove all of the specified items from the selection.�removeNr�r�r'r'r(�selection_remove�szTreeview.selection_removecGs|�d|�dS)z2Toggle the selection state of each specified item.ZtoggleNr�r�r'r'r(�selection_toggle�szTreeview.selection_togglecCs@|j�|jd|||�}|dkr8|dkr8t|j|dtd�S|SdS)a;Query or set the value of given item.

        With one argument, return a dictionary of column/value pairs
        for the specified item. With two arguments, return the current
        value of the specified column. With three arguments, set the
        value of given column in given item to the specified value.r�NF)Z	cut_minusrg)r#rhr�rri)rwr�r�r-rfr'r'r(r��s�zTreeview.setcCs |j|jdd|f||dd�dS)z�Bind a callback for the given event sequence to the tag tagname.
        When an event is delivered to an item, the callbacks for each
        of the item's tags option are called.�tag�bindr)r�N)Z_bindr�)rw�tagnameZsequencer�r'r'r(�tag_bind�szTreeview.tag_bindcKs&|dk	rd||<t|j||jdd|�S)aBQuery or modify the options for the specified tagname.

        If kw is not given, returns a dict of the option settings for tagname.
        If option is specified, returns the value for that option for the
        specified tagname. Otherwise, sets the options to the corresponding
        values for the given tagname.Nr�rQr�)rwr�r�rFr'r'r(�
tag_configure�s
�zTreeview.tag_configurec	CsF|dkr$|j�|j�|jdd|��S|j�|j�|jdd||��SdS)z�If item is specified, returns 1 or 0 depending on whether the
        specified item has the given tagname. Otherwise, returns a list of
        all items which have the specified tag.

        * Availability: Tk 8.6Nr�Zhas)r#rcrhr�r�)rwr�r�r'r'r(�tag_has�s��zTreeview.tag_has)N)N)N)N)N)N)N)N)NN)NN)N)N)&r�r�r�r�rxr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�Zreattachr�r�r�r�r�r�r�r�r�r�r�r�r�r�r'r'r'r(r�sF



	
	

 

		



csLeZdZdZddd�Z�fdd�Zd	d
�Zedd��Zej	d
d��Z�Z
S)rz�A Ttk Scale widget with a Ttk Label widget indicating its
    current value.

    The Ttk Scale can be accessed through instance.scale, and Ttk Label
    can be accessed through instance.labelNr�
c	Ks|�dd�dk|_tj||f|�|p.t�|�|_|j�|�||_t	|�|_
t||j||d�|_|j�
d|j�|jr|dnd}|dkr�dnd}|jj|dd�t	|�}|j|d�|��|j
j|dkr�d	nd
d�|j�d|j�|_|�
d
|j�|�
d|j�dS)a�Construct a horizontal LabeledScale with parent master, a
        variable to be associated with the Ttk Scale widget and its range.
        If variable is not specified, a tkinter.IntVar is created.

        WIDGET-SPECIFIC OPTIONS

            compound: 'top' or 'bottom'
                Specifies how to display the label relative to the scale.
                Defaults to 'top'.
        Zcompound�top)�variabler�r�r�Zbottomrr)�sideZfill)r�r�rW)Zanchor�wz<Configure>z<Map>N)�pop�
_label_toprrxrvZIntVar�	_variabler��_last_validr�labelr�scaler��_adjustZpack�lowerZplaceZtrace_variable�_LabeledScale__tracecb)	rwr&r�r�r�rFZ
scale_sideZ
label_sideZdummyr'r'r(rx�s$
zLabeledScale.__init__csHz|j�d|j�Wntk
r(YnX|`t���d|_d|_dS)z9Destroy this widget and possibly its associated variable.r�N)r�Z
trace_vdeleter�AttributeError�super�destroyrrr��	__class__r'r(rs
zLabeledScale.destroycs��fdd�}t�jd�}t�jd�}||kr:||}}�j��}||krX|ksfn�j�_dS|�_|�jd<��|�dS)z1Adjust the label position according to the scale.csZ����j��\}}�jr2�j���j��}n�j���j��}�jj||d�dS)N�rrr�)Zupdate_idletasksrZcoordsr�Zwinfo_yrZwinfo_reqheightZplace_configurerrr'r(�adjust_labelsz*LabeledScale._adjust.<locals>.adjust_labelrCr�N�text)rsrr�r"rr-rZ
after_idle)rwrErr�r�Znewvalr'rr(rs


zLabeledScale._adjustcCs
|j��S)zReturn current scale value.)r�r"rr'r'r(r-4szLabeledScale.valuecCs|j�|�dS)zSet new scale value.N)r�r�)rwr=r'r'r(r-9s)NNrr�)r�r�r�r�rxrr�propertyr-�setter�
__classcell__r'r'r	r(r�s
&

cs<eZdZdZddd�Zdd�Zddd�Z�fd	d
�Z�ZS)
rzmThemed OptionMenu, based after tkinter's OptionMenu, which allows
    the user to select a value from a menu.NcOs�||�dd�|�dd�d�}tj||f|�tj|dd�|d<||_|�dd�|_|rpt�d	tt	|�
�����|j|f|��dS)
a9Construct a themed OptionMenu widget with master as the parent,
        the resource textvariable set to variable, the initially selected
        value specified by the default parameter, the menu values given by
        *values and additional keywords.

        WIDGET-SPECIFIC OPTIONS

            style: stylename
                Menubutton style.
            direction: 'above', 'below', 'left', 'right', or 'flush'
                Menubutton direction.
            command: callback
                A callback that will be invoked after selecting an item.
        r{N�	direction)Ztextvariabler{rF)Ztearoff�menur�zunknown option -%s)r�r	rxrvZMenur��	_callbackZTclErrorr�r\�keys�set_menu)rwr&r�r��values�kwargsrFr'r'r(rxCs
��zOptionMenu.__init__cCs&|dkr|�t�||��St�||�S)Nr)Znametowidgetr	�__getitem__r�r'r'r(r`szOptionMenu.__getitem__cGsR|d}|�dd�|D]$}|j|t�|j||j�|jd�q|rN|j�|�dS)zUBuild a new menu of radiobuttons with *values and optionally
        a default value.rr�end)rr�r�N)r�Zadd_radiobuttonrvZ_setitr�rr�)rwr�rrr=r'r'r(rgs�zOptionMenu.set_menucs,z|`Wntk
rYnXt���dS)z0Destroy this widget and its associated variable.N)r�rrrrr	r'r(rus
zOptionMenu.destroy)N)N)	r�r�r�r�rxrrrrr'r'r	r(r?s


)F)FN)F)F)rrB)N)6r��__version__�
__author__�__all__rvrrrrZ	TkVersionrr)r/r6r>r@rIrLrYrarerkrorsrirr�objectrr�rrrrrrrrr	r
rrr
rrrrrrZXViewZYViewrrrr'r'r'r(�<module>s��	




%
1*


*B*"8*(J`tkinter/__pycache__/tix.cpython-38.opt-2.pyc000064400000161511151153537530014645 0ustar00U

e5d-,�@sLddlZddlZddlTddlmZddlZdZdZdZdZdZd	Z	d
Z
dZdZd
Z
dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZGdd �d �Z Gd!d"�d"ej!e �Z!Gd#d$�d$�Z"ej#j$e"fej#_$Gd%d&�d&ej#�Z%Gd'd(�d(e%�Z&Gd)d*�d*�Z'Gd+d,�d,e%�Z(Gd-d.�d.e%�Z)Gd/d0�d0e%�Z*Gd1d2�d2e%�Z+Gd3d4�d4e%�Z,Gd5d6�d6e%�Z-Gd7d8�d8e%�Z.Gd9d:�d:e%�Z/Gd;d<�d<e%�Z0Gd=d>�d>e%�Z1Gd?d@�d@e%�Z2GdAdB�dBe%�Z3GdCdD�dDe%�Z4GdEdF�dFe%e5e6�Z7GdGdH�dHe%�Z8GdIdJ�dJe%�Z9GdKdL�dLe%�Z:GdMdN�dNe%�Z;GdOdP�dPe%�Z<GdQdR�dRe%�Z=GdSdT�dTe%�Z>GdUdV�dVe%�Z?GdWdX�dXe%�Z@GdYdZ�dZe%�ZAGd[d\�d\e%�ZBGd]d^�d^e%�ZCGd_d`�d`e%�ZDGdadb�dbe%�ZEGdcdd�dde%�ZFGdedf�dfe%�ZGGdgdh�dhe%�ZHGdidj�dje%�ZIGdkdl�dle%�ZJGdmdn�dne%�ZKGdodp�dpe%e5e6�ZLGdqdr�dre%�ZMGdsdt�dte%�ZNGdudv�dveOe&�ZPGdwdx�dxeQe&�ZRGdydz�dzeSe&�ZTGd{d|�d|eUe&�ZVGd}d~�d~eWe&�ZXGdd��d�eYe&�ZZGd�d��d�e[e&�Z\Gd�d��d�e]e&�Z^Gd�d��d�e_e&�Z`Gd�d��d�eae&�ZbGd�d��d�eDe&�ZcGd�d��d�e7e&�ZdGd�d��d�eCe&�ZeGd�d��d�eLe&�ZfGd�d��d�e*e&�ZgGd�d��d�e,e&�ZhGd�d��d�e.e&�ZiGd�d��d�e/e&�ZjGd�d��d�e2e&�ZkGd�d��d�e*e&�ZlGd�d��d�eKe&�ZmGd�d��d�e>e&�ZnGd�d��d�e@e&�Zod�d��Zpd�d��ZqGd�d��d�e%�ZrGd�d��d�e%e5e6�ZsGd�d��d�es�ZtdS)��N)�*)�	_cnfmerge�window�textZstatusZ	immediate�imageZ	imagetextZballoon�autoZ	acrosstop�asciiZcell�columnZ
decreasingZ
increasingZinteger�main�max�real�rowzs-regionzx-regionzy-region����� c@sReZdZdd�Zdd�Zddd�Zddd	�Zd
d�Zdd
�Zdd�Z	ddd�Z
dS)�
tixCommandcCs|j�dd|�S)N�tixZaddbitmapdir��tk�call)�selfZ	directory�r�#/usr/lib64/python3.8/tkinter/tix.py�tix_addbitmapdirRs
ztixCommand.tix_addbitmapdircCs|j�dd|�S)Nr�cgetr�r�optionrrr�tix_cget^sztixCommand.tix_cgetNcKsd|rt||f�}n|rt|�}|dkr2|�dd�St|t�rN|�ddd|�S|j�d|�|��S)Nr�	configure�-)rr )r�
_getconfigure�
isinstance�strZ_getconfigure1rr�_options�r�cnf�kwrrr�
tix_configurees
ztixCommand.tix_configurecCs*|dk	r|j�dd|�S|j�dd�SdS)NrZ
filedialogr)rZdlgclassrrr�tix_filedialog{s	ztixCommand.tix_filedialogcCs|j�dd|�S)NrZ	getbitmapr�r�namerrr�
tix_getbitmap�s	ztixCommand.tix_getbitmapcCs|j�dd|�S)NrZgetimagerr+rrr�tix_getimage�sztixCommand.tix_getimagecCs|j�ddd|�S)Nrr�getrr+rrr�tix_option_get�sztixCommand.tix_option_getcCs2|dk	r|j�dd|||�S|j�dd||�SdS)NrZresetoptionsr)rZ	newSchemeZ
newFontSetZ
newScmPriorrr�tix_resetoptions�sztixCommand.tix_resetoptions)N)N)N)�__name__�
__module__�__qualname__rrr)r*r-r.r0r1rrrrrGs

rc@seZdZddd�Zdd�ZdS)�TkN�TixcCsbtj�||||�tj�d�}|j�d�|dk	rR|j�d|�|j�d|�|j�d�dS)NZTIX_LIBRARYz<global auto_path; lappend auto_path [file dir [info nameof]]z(global auto_path; lappend auto_path {%s}z,global tcl_pkgPath; lappend tcl_pkgPath {%s}zpackage require Tix)�tkinterr5�__init__�os�environr/r�eval)rZ
screenNameZbaseNameZ	classNameZtixlibrrrr8�szTk.__init__cCs|�dd�tj�|�dS)NZWM_DELETE_WINDOW�)Zprotocolr7r5�destroy�rrrrr=�sz
Tk.destroy)NNr6�r2r3r4r8r=rrrrr5�s
r5c@sPeZdZifdd�ZeZdd�Zdd�Zdd�Zdd
d�Zdd
d�Z	dd�Z
dS)�FormcKs"|jjd|jf|�||���dS)N�tixForm�rr�_wr%r&rrr�config�szForm.configcCst�|||i�dS�N)r@�form�r�key�valuerrr�__setitem__�szForm.__setitem__cCs|j�dd|j�S)NrA�check�rrrCr>rrrrK�sz
Form.checkcCs|j�dd|j�dS)NrA�forgetrLr>rrrrM�szForm.forgetrcCs`|sJ|sJ|j�dd|j�}|j�|�}d}|D]}||j�|�f}q.|S|j�dd|j||�S)NrA�gridr)rrrC�	splitlistZgetint)rZxsizeZysize�x�y�zrrrrN�sz	Form.gridNcCs>|s|j�dd|j�S|ddkr*d|}|j�dd|j|�S)NrA�inforr!rLrrrrrS�s
z	Form.infocs(�fdd��j��j�dd�j��D�S)Ncsg|]}��|��qSr)�
_nametowidget��.0rPr>rr�
<listcomp>szForm.slaves.<locals>.<listcomp>rA�slaves�rrOrrCr>rr>rrXs
���zForm.slaves)rr)N)r2r3r4rDrFrJrKrMrNrSrXrrrrr@�s


r@c@sneZdZdddiifdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
idfdd�Zdd�ZdS)�	TixWidgetNc	Cs�|rt||f�}nt|�}d}|r.|�d�ndg}t|���D]&\}}||kr@|d||f}||=q@||_t�|||�|r�|jj||j	f|��|r�t�
||�i|_dS)Nr�optionsr!)r�append�list�items�
widgetName�Widget�_setuprrrCrD�subwidget_list)	r�masterr_Zstatic_optionsr'r(Zextra�k�vrrrr8s$zTixWidget.__init__cCs ||jkr|j|St|��dSrE)rb�AttributeErrorr+rrr�__getattr__Gs

zTixWidget.__getattr__cCs|j�d|j|�dS)NZtixSetSilentrL)rrIrrr�
set_silentLszTixWidget.set_silentcCsD|�|�}|s$td|d|j��|t|j�dd�}|�|�S)Nz
Subwidget z not child of �)�_subwidget_name�TclError�_name�lenrCrT)rr,�nrrr�	subwidgetPs

zTixWidget.subwidgetcCsZ|��}|sgSg}|D]<}|t|j�dd�}z|�|�|��WqYqXq|S)Nri)�_subwidget_namesrmrCr\rT)r�namesZretlistr,rrr�subwidgets_allZszTixWidget.subwidgets_allcCs0z|j�|jd|�WStk
r*YdSXdS)Nro)rrrCrkr+rrrrjiszTixWidget._subwidget_namecCs<z |j�|jdd�}|j�|�WStk
r6YdSXdS)NZ
subwidgetsz-all)rrrCrOrk)rrPrrrrpps
zTixWidget._subwidget_namescCs\|dkrdSt|t�st|�}t|t�s0t|�}|��}|D]}|j�|dd||�q<dS)Nr<r r!)r#r$�reprrprr)rrrIrqr,rrr�
config_allxs

zTixWidget.config_allcKst|s|}|r|rt||f�}n|r&|}d}|��D]*\}}t|�rL|�|�}|d||f}q2|j�dd|f|�S)Nrr!r�create)rr^�callable�	_registerrr)rZimgtyper'rcr(r[rdrerrr�image_create�s
zTixWidget.image_createcCs.z|j�dd|�Wntk
r(YnXdS)Nr�delete)rrrk)rZimgnamerrr�image_delete�szTixWidget.image_delete)
r2r3r4r8rgrhrorrrjrprtrxrzrrrrrZ
s
�
-
rZc@seZdZddd�Zdd�ZdS)�TixSubWidgetric
Cs�|rD|�|�}z$|t|j�dd�}|�d�}Wng}YnX|s`t�||ddd|i�n�|}tt|�d�D]V}d�|d|d��}	z|�|	�}
|
}Wqtt	k
r�t
|||ddd�}YqtXqt|r�|d}t�||ddd|i�||_dS)Nri�.r,r)�destroy_physically�check_intermediate���)rjrmrC�splitrZr8�range�joinrT�KeyErrorr{r})rrcr,r}r~�pathZplist�parent�irn�wrrrr8�s0



�zTixSubWidget.__init__cCsjt|j���D]}|��q|j|jjkr6|jj|j=|j|jjkrP|jj|j=|jrf|j�	d|j
�dS)Nr=)r]�children�valuesr=rlrcrbr}rrrC�r�crrrr=�s
zTixSubWidget.destroyN)ririr?rrrrr{�s�
 r{c@sReZdZifdd�dd�Zdd�Zdd�Zd	d
�Zdd�Zifd
d�Zdd�Z	dS)�DisplayStyleN)rccKs\|s2d|kr|d}nd|kr(|d}n
t�d�}|j|_|jjd|f|�||���|_dS)NZ	refwindowzcreate display styleZtixDisplayStyle)r7Z_get_default_rootrrr%�	stylename)r�itemtyper'rcr(rrrr8�s



�zDisplayStyle.__init__cCs|jSrE)r�r>rrr�__str__�szDisplayStyle.__str__cCsH|r|rt||f�}n|r|}d}|��D]\}}|d||f}q*|S)Nrr!)rr^)rr'r(Zoptsrdrerrrr%�szDisplayStyle._optionscCs|j�|jd�dS�Nry�rrr�r>rrrry�szDisplayStyle.deletecCs|j�|jdd||�dS)Nr �-%sr�rGrrrrJ�szDisplayStyle.__setitem__cKs|j|jdf|�||���S)Nr )r"r�r%r&rrrrD�s�
�zDisplayStyle.configcCs|j�|jdd|�S)Nrr�r�)rrHrrr�__getitem__�szDisplayStyle.__getitem__)
r2r3r4r8r�r%ryrJrDr�rrrrr��s
r�c@s.eZdZdifdd�Zifdd�Zdd�ZdS)�BalloonNcKsNdddddg}t�||d|||�t|ddd	�|jd<t|d
dd	�|jd
<dS)Nr[ZinstallcolormapZinitwaitZ	statusbarZcursorZ
tixBalloon�labelr�r}�message�rZr8�_dummyLabelrb�rrcr'r(Zstaticrrrr8	s���zBalloon.__init__cKs&|jj|jd|jf|�||���dS�NZbindrB)r�widgetr'r(rrr�bind_widgetszBalloon.bind_widgetcCs|j�|jd|j�dS�NZunbindrL�rr�rrr�
unbind_widgetszBalloon.unbind_widget)r2r3r4r8r�r�rrrrr�s	
r�c@s.eZdZdifdd�Zifdd�Zdd�ZdS)�	ButtonBoxNcKst�||dddg||�dS)NZtixButtonBox�orientationr[�rZr8�rrcr'r(rrrr8s

�zButtonBox.__init__cKs4|jj|jd|f|�||���}t||�|j|<|S�N�add�rrrCr%�_dummyButtonrb)rr,r'r(Zbtnrrrr�#s z
ButtonBox.addcCs ||jkr|j�|jd|�dS�N�invoke�rbrrrCr+rrrr�*s
zButtonBox.invoke�r2r3r4r8r�r�rrrrr�sr�c@s:eZdZdifdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)�ComboBoxNc	Ks�t�||dddddg||�t|d�|jd<t|d�|jd<t|d�|jd<t|d	�|jd	<z$t|d
�|jd
<t|d�|jd<Wntk
r�YnXdS)NZtixComboBoxZeditableZdropdown�fancyr[r��entry�arrow�slistbox�tick�cross)rZr8r�rb�_dummyEntryr��_dummyScrolledListBox�	TypeErrorr�rrrr8<s 

��
zComboBox.__init__cCs|j�|jd|�dS)NZ
addhistoryrL�rr$rrr�add_historyNszComboBox.add_historycCs|j�|jd|�dS)NZ
appendhistoryrLr�rrr�append_historyQszComboBox.append_historycCs|j�|jd||�dS�N�insertrL)r�indexr$rrrr�TszComboBox.insertcCs|j�|jd|�dS)N�pickrL�rr�rrrr�Wsz
ComboBox.pick)r2r3r4r8r�r�r�r�rrrrr�.s
r�c@s:eZdZdifdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)�ControlNcKsZt�||ddg||�t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<dS)NZ
tixControlr[�incr�decrr�r�)rZr8r�rbr�r�r�rrrr8hs
zControl.__init__cCs|j�|jd�dS)Nr�rLr>rrr�	decrementoszControl.decrementcCs|j�|jd�dS)Nr�rLr>rrr�	incrementrszControl.incrementcCs|j�|jd�dSr�rLr>rrrr�uszControl.invokecCs|j�|jd�dS)N�updaterLr>rrrr�xszControl.update)r2r3r4r8r�r�r�r�rrrrr�Zs
r�c@s eZdZifdd�Zdd�ZdS)�DirListcKsJt�||ddg||�t|d�|jd<t|d�|jd<t|d�|jd<dS)NZ
tixDirListr[�hlist�vsb�hsb�rZr8�_dummyHListrb�_dummyScrollbarr�rrrr8�szDirList.__init__cCs|j�|jd|�dS�N�chdirrL�r�dirrrrr��sz
DirList.chdirN�r2r3r4r8r�rrrrr�{sr�c@s eZdZifdd�Zdd�ZdS)�DirTreecKsJt�||ddg||�t|d�|jd<t|d�|jd<t|d�|jd<dS)NZ
tixDirTreer[r�r�r�r�r�rrrr8�szDirTree.__init__cCs|j�|jd|�dSr�rLr�rrrr��sz
DirTree.chdirNr�rrrrr��s
r�c@seZdZifdd�ZdS)�DirSelectBoxcKs:t�||ddg||�t|d�|jd<t|d�|jd<dS)NZtixDirSelectBoxr[�dirlist�dircbx)rZr8�
_dummyDirListrb�_dummyFileComboBoxr�rrrr8�szDirSelectBox.__init__N�r2r3r4r8rrrrr��sr�c@s(eZdZifdd�Zdd�Zdd�ZdS)�ExFileSelectBoxcKs�t�||ddg||�t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<t|d	�|jd	<t|d
�|jd
<dS)NZtixExFileSelectBoxr[�cancel�ok�hidden�typesr�r��file�filelist)rZr8r�rb�_dummyCheckbutton�_dummyComboBoxr�r�r�rrrr8�szExFileSelectBox.__init__cCs|j�|jd�dS�N�filterrLr>rrrr��szExFileSelectBox.filtercCs|j�|jd�dSr�rLr>rrrr��szExFileSelectBox.invokeN)r2r3r4r8r�r�rrrrr��sr�c@s(eZdZifdd�Zdd�Zdd�ZdS)�DirSelectDialogcKs*t�||ddg||�t|d�|jd<dS)NZtixDirSelectDialogr[Zdirbox)rZr8�_dummyDirSelectBoxrbr�rrrr8�s
�zDirSelectDialog.__init__cCs|j�|jd�dS�N�popuprLr>rrrr��szDirSelectDialog.popupcCs|j�|jd�dS�N�popdownrLr>rrrr��szDirSelectDialog.popdownN�r2r3r4r8r�r�rrrrr��s
r�c@s(eZdZifdd�Zdd�Zdd�ZdS)�ExFileSelectDialogcKs*t�||ddg||�t|d�|jd<dS)NZtixExFileSelectDialogr[�fsbox)rZr8�_dummyExFileSelectBoxrbr�rrrr8�s
�zExFileSelectDialog.__init__cCs|j�|jd�dSr�rLr>rrrr�szExFileSelectDialog.popupcCs|j�|jd�dSr�rLr>rrrr�szExFileSelectDialog.popdownNr�rrrrr��s	r�c@s(eZdZifdd�Zdd�Zdd�ZdS)�
FileSelectBoxcKsZt�||ddg||�t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<dS)NZtixFileSelectBoxr[r�r�r��	selection)rZr8r�rbr�r�rrrr8s
zFileSelectBox.__init__cCs|j�|jd�dSr�rLr>rrr�apply_filterszFileSelectBox.apply_filtercCs|j�|jd�dSr�rLr>rrrr�szFileSelectBox.invokeN)r2r3r4r8r�r�rrrrr�sr�c@s(eZdZifdd�Zdd�Zdd�ZdS)�FileSelectDialogcKs:t�||ddg||�t|d�|jd<t|d�|jd<dS)NZtixFileSelectDialogr[Zbtnsr�)rZr8�_dummyStdButtonBoxrb�_dummyFileSelectBoxr�rrrr8,s
�zFileSelectDialog.__init__cCs|j�|jd�dSr�rLr>rrrr�2szFileSelectDialog.popupcCs|j�|jd�dSr�rLr>rrrr�5szFileSelectDialog.popdownNr�rrrrr�#s	r�c@s(eZdZifdd�Zdd�Zdd�ZdS)�	FileEntrycKs<t�||dddg||�t|d�|jd<t|d�|jd<dS)NZtixFileEntryZ
dialogtyper[Zbuttonr�)rZr8r�rbr�r�rrrr8Ds
�zFileEntry.__init__cCs|j�|jd�dSr�rLr>rrrr�JszFileEntry.invokecCsdSrErr>rrr�file_dialogMszFileEntry.file_dialogN)r2r3r4r8r�r�rrrrr�8sr�c@s�eZdZdifdd�Zifdd�Zdifdd�Zdd	�Zd
d�Zdkd
d�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zifdd �Zifd!d"�Zd#d$�Zd%d&�ZeZd'd(�Zd)d*�Zd+d,�Zifd-d.�Zifd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z dld=d>�Z!d?d@�Z"dAdB�Z#dCdD�Z$dEdF�Z%dGdH�Z&dIdJ�Z'dKdL�Z(dMdN�Z)dOdP�Z*dQdR�Z+ifdSdT�Z,ifdUdV�Z-dWdX�Z.dYdZ�Z/d[d\�Z0ifd]d^�Z1d_d`�Z2dadb�Z3ifdcdd�Z4dedf�Z5dmdgdh�Z6didj�Z7dS)n�HListNcKst�||dddg||�dS)NZtixHList�columnsr[r�r�rrrr8Ys

�zHList.__init__cKs |jj|jd|f|�||���Sr�rB�rr�r'r(rrrr�]sz	HList.addcKs(|sd}|jj|jd|f|�||���S)Nr<ZaddchildrB)rr�r'r(rrr�	add_child`s�
�zHList.add_childcCs|j�|jdd|�dS�N�anchor�setrL�rr�rrr�
anchor_setfszHList.anchor_setcCs|j�|jdd�dS�Nr��clearrLr>rrr�anchor_cleariszHList.anchor_clearrcCs6|s|j�|jdd||�S|j�|jdd|d|�SdS)Nr	�widthz-charrL)r�colr�charsrrr�column_widthls�zHList.column_widthcCs|j�|jdd�dS)Nry�allrLr>rrr�
delete_allsszHList.delete_allcCs|j�|jdd|�dS)Nryr�rLr�rrr�delete_entryvszHList.delete_entrycCs|j�|jdd|�dS)NryZ
offspringsrLr�rrr�delete_offspringsyszHList.delete_offspringscCs|j�|jdd|�dS)NryZsiblingsrLr�rrr�delete_siblings|szHList.delete_siblingscCs|j�|jdd|�dS�N�dragsiter�rLr�rrr�dragsite_setszHList.dragsite_setcCs|j�|jdd�dS�Nrr�rLr>rrr�dragsite_clear�szHList.dragsite_clearcCs|j�|jdd|�dS�N�dropsiter�rLr�rrr�dropsite_set�szHList.dropsite_setcCs|j�|jdd�dS�Nrr�rLr>rrr�dropsite_clear�szHList.dropsite_clearcKs&|jj|jdd|f|�||���dS)N�headerrurB�rrr'r(rrr�
header_create�szHList.header_createcKs@|dkr|�|jdd|�S|jj|jdd|f|�||���dS)Nrr �r"rCrrr%rrrr�header_configure�s

�zHList.header_configurecCs|j�|jdd||�S)NrrrL)rr�optrrr�header_cget�szHList.header_cgetcCs|j�|j�|jdd|��S)NrZexist)rZ
getbooleanrrC�rrrrr�
header_exists�szHList.header_existscCs|j�|jdd|�dS)NrryrLrrrr�
header_delete�szHList.header_deletecCs|j�|jdd|�S)Nr�sizerLrrrr�header_size�szHList.header_sizecCs|j�|jdd|�dS)N�hider�rLr�rrr�
hide_entry�szHList.hide_entrycKs&|jj|jdd|f|�||���dS)N�	indicatorrurBr�rrr�indicator_create�s�
�zHList.indicator_createcKs@|dkr|�|jdd|�S|jj|jdd|f|�||���dS)Nr"r rr�rrr�indicator_configure�s��
�zHList.indicator_configurecCs|j�|jdd||�S)Nr"rrL�rr�rrrr�indicator_cget�szHList.indicator_cgetcCs|j�|jdd|�S)Nr"�existsrLr�rrr�indicator_exists�szHList.indicator_existscCs|j�|jdd|�dS)Nr"ryrLr�rrr�indicator_delete�szHList.indicator_deletecCs|j�|jdd|�S)Nr"rrLr�rrr�indicator_size�szHList.indicator_sizecCs|j�|jdd�S�NrSr�rLr>rrr�info_anchor�szHList.info_anchorcCs|�|j�|jdd|��pdS�NrSZbbox)�_getintsrrrCr�rrr�	info_bbox�s
��zHList.info_bboxcCs |j�|jdd|�}|j�|�S)NrSr��rrrCrO)rr�r�rrr�
info_children�szHList.info_childrencCs|j�|jdd|�S)NrS�datarLr�rrr�	info_data�szHList.info_datacCs|j�|jdd�S)NrSrrLr>rrr�
info_dragsite�szHList.info_dragsitecCs|j�|jdd�S)NrSrrLr>rrr�
info_dropsite�szHList.info_dropsitecCs|j�|jdd|�S�NrSr'rLr�rrr�info_exists�szHList.info_existscCs|j�|jdd|�S)NrSr�rLr�rrr�info_hidden�szHList.info_hiddencCs|j�|jdd|�S)NrS�nextrLr�rrr�	info_next�szHList.info_nextcCs|j�|jdd|�S)NrSr�rLr�rrr�info_parent�szHList.info_parentcCs|j�|jdd|�S)NrS�prevrLr�rrr�	info_prev�szHList.info_prevcCs|j�|jdd�}|j�|�S�NrSr�r0r�rrr�info_selection�szHList.info_selectioncCs|j�|jdd|||�S)N�itemrrL)rr�rrrrr�	item_cget�szHList.item_cgetcKsD|dkr|�|jdd||�S|jj|jdd||f|�||���dS)Nr@r r�rr�rr'r(rrr�item_configure�s

�zHList.item_configurecKs(|jj|jdd||f|�||���dS)Nr@rurBrBrrr�item_create�s�
�zHList.item_createcCs|j�|jdd||�S)Nr@r'rL�rr�rrrr�item_exists�szHList.item_existscCs|j�|jdd||�dS)Nr@ryrLrErrr�item_delete�szHList.item_deletecCs|j�|jd||�S)N�	entrycgetrLr%rrrrH�szHList.entrycgetcKs<|dkr|�|jd|�S|jj|jd|f|�||���dS�N�entryconfigurerr�rrrrJ�s

�zHList.entryconfigurecCs|j�|jd|�S�N�nearestrL)rrQrrrrLsz
HList.nearestcCs|j�|jd|�dS�N�seerLr�rrrrNsz	HList.seecKs$|jj|jddf|�||���dS�Nr�r�rBr&rrr�selection_clearszHList.selection_clearcCs|j�|jdd|�S�Nr�ZincludesrLr�rrr�selection_includes
szHList.selection_includescCs|j�|jdd||�dS�Nr�r�rL�r�firstZlastrrr�
selection_set
szHList.selection_setcCs|j�|jdd|�S)N�showr�rLr�rrr�
show_entryszHList.show_entry)rNN)N)N)8r2r3r4r8r�r�r�rrrrrr	rrrrrrrrZheader_existrrr!r#r$r&r(r)r*r,r/r1r3r4r5r7r8r:r;r=r?rArCrDrFrGrHrJrLrNrPrRrVrXrrrrr�Qsj


r�c@seZdZdifdd�ZdS)�	InputOnlyNcKst�||dd||�dS)NZtixInputOnlyr�r�rrrr8szInputOnly.__init__r�rrrrrYsrYc@seZdZdifdd�ZdS)�
LabelEntryNcKs<t�||dddg||�t|d�|jd<t|d�|jd<dS)NZ
tixLabelEntry�	labelsider[r�r�)rZr8r�rbr�r�rrrr8%s
�zLabelEntry.__init__r�rrrrrZs
rZc@seZdZdifdd�ZdS)�
LabelFrameNcKs<t�||dddg||�t|d�|jd<t|d�|jd<dS)NZ
tixLabelFramer[r[r��frame)rZr8r�rb�_dummyFramer�rrrr86s
�zLabelFrame.__init__r�rrrrr\+sr\c@s<eZdZifdd�Zifdd�Zdd�Zdd�Zd	d
�ZdS)�ListNoteBookcKsNt�||ddg||�t|ddd�|jd<t|d�|jd<t|d�|jd<dS)NZtixListNoteBookr[Zpanerr�r�Zshlist)rZr8�_dummyPanedWindowrbr��_dummyScrolledHListr�rrrr8Es�zListNoteBook.__init__cKs:|jj|jd|f|�||���t||�|j|<|j|Sr��rrrCr%r{rb�rr,r'r(rrrr�Ms zListNoteBook.addcCs
|�|�SrE�ror+rrr�pageRszListNoteBook.pagecCs:|j�|j�|jd��}g}|D]}|�|�|��q |S�N�pages�rrOrrCr\ro�rrqZretrPrrrrgUs
zListNoteBook.pagescCs|j�|jd|�dS�N�raiserLr+rrr�
raise_page]szListNoteBook.raise_pageN)r2r3r4r8r�rergrlrrrrr_=s
r_c@seZdZdifdd�ZdS)�MeterNcKst�||ddg||�dS)NZtixMeterr[r�r�rrrr8es

�zMeter.__init__r�rrrrrm`srmc@sNeZdZdifdd�Zifdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dS)�NoteBookNcKs.t�||ddg||�t|ddd�|jd<dS)NZtixNoteBookr[Znbframerr�)rZr8r{rbr�rrrr8qs�zNoteBook.__init__cKs:|jj|jd|f|�||���t||�|j|<|j|Sr�rbrcrrrr�vs zNoteBook.addcCs,|j�|jd|�|j|��|j|=dSr��rrrCrbr=r+rrrry{szNoteBook.deletecCs
|�|�SrErdr+rrrre�sz
NoteBook.pagecCs:|j�|j�|jd��}g}|D]}|�|�|��q |Srfrhrirrrrg�s
zNoteBook.pagescCs|j�|jd|�dSrjrLr+rrrrl�szNoteBook.raise_pagecCs|j�|jd�S)N�raisedrLr>rrrrp�szNoteBook.raised)
r2r3r4r8r�ryrergrlrprrrrrnisrnc@seZdZdS)�
NoteBookFrameN�r2r3r4rrrrrq�srqc@sHeZdZifdd�Zifdd�Zifdd�Zdd�Zd	d
�Zdd�Zd
S)�
OptionMenucKs:t�||ddg||�t|d�|jd<t|d�|jd<dS)NZ
tixOptionMenur[�
menubutton�menu�rZr8�_dummyMenubuttonrb�
_dummyMenur�rrrr8�szOptionMenu.__init__cKs&|jj|jdd|f|�||���dS)Nr��commandrBrcrrr�add_command�szOptionMenu.add_commandcKs&|jj|jdd|f|�||���dS)Nr�Z	separatorrBrcrrr�
add_separator�szOptionMenu.add_separatorcCs|j�|jd|�dSr�rLr+rrrry�szOptionMenu.deletecCs|j�|jd|�dS)N�disablerLr+rrrr|�szOptionMenu.disablecCs|j�|jd|�dS)N�enablerLr+rrrr}�szOptionMenu.enableN)	r2r3r4r8rzr{ryr|r}rrrrrs�srsc@sPeZdZifdd�Zifdd�Zdd�Zdd�Zd	d
�Zifdd�Zd
d�Z	dS)�PanedWindowcKst�||dddg||�dS)NZtixPanedWindowr�r[r�r�rrrr8�szPanedWindow.__init__cKs>|jj|jd|f|�||���t||dd�|j|<|j|S)Nr�r)r~rbrcrrrr��s
 �zPanedWindow.addcCs,|j�|jd|�|j|��|j|=dSr�ror+rrrry�szPanedWindow.deletecCs|j�|jd|�dS)NrMrLr+rrrrM�szPanedWindow.forgetcCs|j�|jd||�S)N�panecgetrLr%rrrr�szPanedWindow.panecgetcKs<|dkr|�|jd|�S|jj|jd|f|�||���dS)N�
paneconfigurerr�rrrr��szPanedWindow.paneconfigurecs*�j��j��jd��}�fdd�|D�S)N�panescsg|]}��|��qSrrdrUr>rrrW�sz%PanedWindow.panes.<locals>.<listcomp>rY)rrqrr>rr��szPanedWindow.panesN)
r2r3r4r8r�ryrMrr�r�rrrrr~�sr~c@s0eZdZifdd�Zdd�Zdd�Zdd�Zd	S)
�	PopupMenucKs:t�||ddg||�t|d�|jd<t|d�|jd<dS)NZtixPopupMenur[rtrurvr�rrrr8�szPopupMenu.__init__cCs|j�|jd|j�dSr�rLr�rrrr��szPopupMenu.bind_widgetcCs|j�|jd|j�dSr�rLr�rrrr��szPopupMenu.unbind_widgetcCs|j�|jd|j||�dS)NZpostrL)rr�rPrQrrr�post_widget�szPopupMenu.post_widgetN)r2r3r4r8r�r�r�rrrrr��sr�c@s8eZdZifdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�ResizeHandlec	Ks.ddddddddd	g	}t�||d
|||�dS)Nr[ryZcursorfgZcursorbgZ
handlesizeZ	hintcolorZ	hintwidthrPrQZtixResizeHandler�)rrcr'r(�flagsrrrr8�s�
�zResizeHandle.__init__cCs|j�|jd|j�dS)NZattachwidgetrLr�rrr�
attach_widgetszResizeHandle.attach_widgetcCs|j�|jd|j�dS)NZdetachwidgetrLr�rrr�
detach_widgetszResizeHandle.detach_widgetcCs|j�|jd|j�dS)Nr rLr�rrrr szResizeHandle.hidecCs|j�|jd|j�dS)NrWrLr�rrrrW	szResizeHandle.showN)r2r3r4r8r�r�r rWrrrrr��s

r�c@seZdZifdd�ZdS)�
ScrolledHListcKsJt�||ddg||�t|d�|jd<t|d�|jd<t|d�|jd<dS)NZtixScrolledHListr[r�r�r�r�r�rrrr8s�zScrolledHList.__init__Nr�rrrrr�sr�c@seZdZifdd�ZdS)�ScrolledListBoxcKsJt�||ddg||�t|d�|jd<t|d�|jd<t|d�|jd<dS)NZtixScrolledListBoxr[�listboxr�r�)rZr8�
_dummyListboxrbr�r�rrrr8szScrolledListBox.__init__Nr�rrrrr�sr�c@seZdZifdd�ZdS)�ScrolledTextcKsJt�||ddg||�t|d�|jd<t|d�|jd<t|d�|jd<dS)NZtixScrolledTextr[rr�r�)rZr8�
_dummyTextrbr�r�rrrr8%szScrolledText.__init__Nr�rrrrr�!sr�c@seZdZifdd�ZdS)�
ScrolledTListcKsJt�||ddg||�t|d�|jd<t|d�|jd<t|d�|jd<dS)NZtixScrolledTListr[Ztlistr�r�)rZr8�_dummyTListrbr�r�rrrr8/s�zScrolledTList.__init__Nr�rrrrr�+sr�c@seZdZifdd�ZdS)�ScrolledWindowcKsJt�||ddg||�t|d�|jd<t|d�|jd<t|d�|jd<dS)NZtixScrolledWindowr[rr�r�)rZr8r^rbr�r�rrrr8:szScrolledWindow.__init__Nr�rrrrr�6sr�c@s,eZdZifdd�Zifdd�Zdd�ZdS)�Selectc
Ks2t�||ddddddg||�t|d�|jd<dS)NZ	tixSelectZ	allowzero�radior�r[r[r�r�r�rrrr8Gs
��zSelect.__init__cKs:|jj|jd|f|�||���t||�|j|<|j|Sr�r�rcrrrr�Ns z
Select.addcCs|j�|jd|�dSr�rLr+rrrr�Ssz
Select.invokeNr�rrrrr�@sr�c@seZdZdifdd�ZdS)�ShellNcKst�||dddg||�dS)NZtixShellr[�titler�r�rrrr8[szShell.__init__r�rrrrr�Vsr�c@s2eZdZdifdd�Zdd�Zdd�Zdd	�ZdS)
�DialogShellNcKs&t�||ddddddddg||�dS)	NZtixDialogShellr[r�ZmappedZ	minheightZminwidthr�Z	transientr�r�rrrr8gs��zDialogShell.__init__cCs|j�|jd�dSr�rLr>rrrr�nszDialogShell.popdowncCs|j�|jd�dSr�rLr>rrrr�qszDialogShell.popupcCs|j�|jd�dS)N�centerrLr>rrrr�tszDialogShell.center)r2r3r4r8r�r�r�rrrrr�^s	r�c@s"eZdZdifdd�Zdd�ZdS)�StdButtonBoxNcKs\t�||dddg||�t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<dS)NZtixStdButtonBoxr�r[r��applyr��help)rZr8r�rbr�rrrr8zs
�zStdButtonBox.__init__cCs ||jkr|j�|jd|�dSr�r�r+rrrr��s
zStdButtonBox.invoke)r2r3r4r8r�rrrrr�wsr�c@s�eZdZdifdd�Zdd�Zdd�Zdd	�Zd
d�Zd2dd
�Zdd�Z	dd�Z
dd�Zdd�Zifdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zifd,d-�Zd.d/�Zd3d0d1�ZdS)4�TListNcKst�||ddg||�dS)NZtixTListr[r�r�rrrr8�szTList.__init__cCs|j�|jdd|�dS)N�activer�rLr�rrr�
active_set�szTList.active_setcCs|j�|jdd�dS)Nr�r�rLr>rrr�active_clear�szTList.active_clearcCs|j�|jdd|�dSr�rLr�rrrr��szTList.anchor_setcCs|j�|jdd�dSr�rLr>rrrr�szTList.anchor_clearcCs|j�|jd||�dSr�rL�r�from_�torrrry�szTList.deletecCs|j�|jdd|�dSr
rLr�rrrr�szTList.dragsite_setcCs|j�|jdd�dSr
rLr>rrrr�szTList.dragsite_clearcCs|j�|jdd|�dSrrLr�rrrr�szTList.dropsite_setcCs|j�|jdd�dSrrLr>rrrr�szTList.dropsite_clearcKs$|jj|jd|f|�||���dSr�rB)rr�r'r(rrrr��szTList.insertcCs|j�|jdd�S)NrSr�rLr>rrr�info_active�szTList.info_activecCs|j�|jdd�Sr+rLr>rrrr,�szTList.info_anchorcCs|j�|jdd|�S)NrSZdownrLr�rrr�	info_down�szTList.info_downcCs|j�|jdd|�S)NrS�leftrLr�rrr�	info_left�szTList.info_leftcCs|j�|jdd|�S)NrS�rightrLr�rrr�
info_right�szTList.info_rightcCs|j�|jdd�}|j�|�Sr>r0r�rrrr?�szTList.info_selectioncCs|j�|jdd�S)NrSrrLr>rrr�	info_size�szTList.info_sizecCs|j�|jdd|�S)NrSZuprLr�rrr�info_up�sz
TList.info_upcCs|j�|jd||�SrKrL�rrPrQrrrrL�sz
TList.nearestcCs|j�|jd|�dSrMrLr�rrrrN�sz	TList.seecKs$|jj|jddf|�||���dSrOrBr&rrrrP�szTList.selection_clearcCs|j�|jdd|�SrQrLr�rrrrR�szTList.selection_includescCs|j�|jdd||�dSrSrLrTrrrrV�szTList.selection_set)N)N)r2r3r4r8r�r�r�rryrrrrr�r�r,r�r�r�r?r�r�rLrNrPrRrVrrrrr��s0

r�c@sDeZdZdifdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
d�ZdS)�TreeNcKsJt�||ddg||�t|d�|jd<t|d�|jd<t|d�|jd<dS)NZtixTreer[r�r�r�r�r�rrrr8�s
�z
Tree.__init__cCs|j�|jd�dS�N�autosetmoderLr>rrrr��szTree.autosetmodecCs|j�|jd|�dS�N�closerL�r�	entrypathrrrr��sz
Tree.closecCs|j�|jd|�S�N�getmoderLr�rrrr��szTree.getmodecCs|j�|jd|�dS�N�openrLr�rrrr��sz	Tree.open�nonecCs|j�|jd||�dS)N�setmoderL�rr��moderrrr��s
zTree.setmode)r�)	r2r3r4r8r�r�r�r�r�rrrrr��sr�c@sVeZdZdifdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
d�Zdd�Z	ddd�Z
dS)�	CheckListNcKsLt�||dddg||�t|d�|jd<t|d�|jd<t|d�|jd<dS)NZtixCheckListr[r�r�r�r�r�r�rrrr8s
�zCheckList.__init__cCs|j�|jd�dSr�rLr>rrrr�szCheckList.autosetmodecCs|j�|jd|�dSr�rLr�rrrr�szCheckList.closecCs|j�|jd|�Sr�rLr�rrrr� szCheckList.getmodecCs|j�|jd|�dSr�rLr�rrrr�$szCheckList.open�oncCs|j�|j�|jd|��S)N�getselectionrY)rr�rrrr�(szCheckList.getselectioncCs|j�|jd|�S)N�	getstatusrLr�rrrr�.szCheckList.getstatuscCs|j�|jd||�dS)N�	setstatusrLr�rrrr�2szCheckList.setstatus)r�)r�)r2r3r4r8r�r�r�r�r�r�r�rrrrr�s
r�c@seZdZddd�ZdS)r�ricCst�||||�dSrE�r{r8�rrcr,r}rrrr8>sz_dummyButton.__init__N)rir�rrrrr�=sr�c@seZdZddd�ZdS)r�ricCst�||||�dSrEr�r�rrrr8Bsz_dummyCheckbutton.__init__N)rir�rrrrr�Asr�c@seZdZddd�ZdS)r�ricCst�||||�dSrEr�r�rrrr8Fsz_dummyEntry.__init__N)rir�rrrrr�Esr�c@seZdZddd�ZdS)r^ricCst�||||�dSrEr�r�rrrr8Jsz_dummyFrame.__init__N)rir�rrrrr^Isr^c@seZdZddd�ZdS)r�ricCst�||||�dSrEr�r�rrrr8Nsz_dummyLabel.__init__N)rir�rrrrr�Msr�c@seZdZddd�ZdS)r�ricCst�||||�dSrEr�r�rrrr8Rsz_dummyListbox.__init__N)rir�rrrrr�Qsr�c@seZdZddd�ZdS)rxricCst�||||�dSrEr�r�rrrr8Vsz_dummyMenu.__init__N)rir�rrrrrxUsrxc@seZdZddd�ZdS)rwricCst�||||�dSrEr�r�rrrr8Zsz_dummyMenubutton.__init__N)rir�rrrrrwYsrwc@seZdZddd�ZdS)r�ricCst�||||�dSrEr�r�rrrr8^sz_dummyScrollbar.__init__N)rir�rrrrr�]sr�c@seZdZddd�ZdS)r�ricCst�||||�dSrEr�r�rrrr8bsz_dummyText.__init__N)rir�rrrrr�asr�c@seZdZddd�ZdS)r�ricCsDt�||||�t|d�|jd<t|d�|jd<t|d�|jd<dS)Nr�r�r�)r{r8r�rbr�r�rrrr8fsz_dummyScrolledListBox.__init__N)rir�rrrrr�esr�c@seZdZddd�ZdS)r�ricCst�||||�dSrEr�r�rrrr8msz_dummyHList.__init__N)rir�rrrrr�lsr�c@seZdZddd�ZdS)raricCsDt�||||�t|d�|jd<t|d�|jd<t|d�|jd<dS�Nr�r�r��r{r8r�rbr�r�rrrr8qsz_dummyScrolledHList.__init__N)rir�rrrrrapsrac@seZdZddd�ZdS)r�ricCst�||||�dSrEr�r�rrrr8xsz_dummyTList.__init__N)rir�rrrrr�wsr�c@seZdZddd�ZdS)r�ricCs�t�|||d|g�t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<z$t|d�|jd<t|d�|jd<Wntk
r�YnXdS)Nr�r�r�r�r�r�r�)r{r8r�rbr�r�r�r�r�rrrr8|s�
z_dummyComboBox.__init__N)rir�rrrrr�{sr�c@seZdZddd�ZdS)r�ricCsDt�||||�t|d�|jd<t|d�|jd<t|d�|jd<dSr�r�r�rrrr8�sz_dummyDirList.__init__N)rir�rrrrr��sr�c@seZdZddd�ZdS)r�ricCs4t�||||�t|d�|jd<t|d�|jd<dS)Nr�r�)r{r8r�rbr�r�rrrr8�sz_dummyDirSelectBox.__init__N)rir�rrrrr��sr�c@seZdZddd�ZdS)r�ricCs�t�||||�t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<dS)	Nr�r�r�r�r�r�r�r�)r{r8r�rbr�r�r�r�rrrr8�sz_dummyExFileSelectBox.__init__N)rir�rrrrr��sr�c@seZdZddd�ZdS)r�ricCsTt�||||�t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<dS)Nr�r�r�r�)r{r8r�rbr�r�rrrr8�s
z_dummyFileSelectBox.__init__N)rir�rrrrr��sr�c@seZdZddd�ZdS)r�ricCs$t�||||�t|d�|jd<dS)Nr�)r{r8r�rbr�rrrr8�sz_dummyFileComboBox.__init__N)rir�rrrrr��sr�c@seZdZddd�ZdS)r�ricCsTt�||||�t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<dS)Nr�r�r�r�)r{r8r�rbr�rrrr8�s
z_dummyStdButtonBox.__init__N)rir�rrrrr��sr�c@seZdZddd�ZdS)�_dummyNoteBookFramercCst�||||�dSrEr�r�rrrr8�sz_dummyNoteBookFrame.__init__N)rr�rrrrr��sr�c@seZdZddd�ZdS)r`ricCst�||||�dSrEr�r�rrrr8�sz_dummyPanedWindow.__init__N)rir�rrrrr`�sr`cCs|j�d|j�S)NZ
tixOptionNamerL)r�rrr�
OptionName�sr�cCs:d}|��D](}|d|d|d||d}q|S)Nr<z{{z} {z - z}} )�keys)�dict�s�typerrr�FileTypeList�s&r�c@seZdZdS)�CObjViewNrrrrrrr��sr�c@s�eZdZdifdd�Zdd�Zdd�Zdd	�Zd(d
d�Zd)dd
�Zdd�Z	dd�Z
dd�Zd*dd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd+d d!�Zd"d#�Zd$d%�Zd&d'�ZdS),�GridNcKs"g}||_t�||d|||�dS)NZtixGrid�r'rZr8r�rrrr8�sz
Grid.__init__cCs|j�|dd�dSr�rr>rrrrszGrid.anchor_clearcCs|�|j�|dd��S)Nr�r/�r.rrr>rrr�
anchor_getszGrid.anchor_getcCs|j�|dd||�dSr�rr�rrrr�szGrid.anchor_setcCs4|dkr|j�|dd|�n|j�|dd||�dS)Nryr
rr�rrr�
delete_rowszGrid.delete_rowcCs4|dkr|j�|dd|�n|j�|dd||�dS)Nryr	rr�rrr�
delete_columnszGrid.delete_columncCs|j�|dd�dS)N�editr�rr>rrr�
edit_applyszGrid.edit_applycCs|j�|dd||�dS)Nr�r�rr�rrr�edit_set!sz
Grid.edit_setcCs,|r|ddkrd|}|j�|d|||�S)Nrr!rHr)rrPrQrrrrrH&szGrid.entrycgetcKs|�d||f||�SrI)Z
_configure)rrPrQr'r(rrrrJ,szGrid.entryconfigurec	Cs|�|j�|dd||��Sr6)Z_getbooleanrrr�rrrr72szGrid.info_existscCs|j�|dd||�Sr-rr�rrrr/6szGrid.info_bboxcCs|j�|dd|||�dS)N�mover	r�rr�r��offsetrrr�move_column:szGrid.move_columncCs|j�|dd|||�dS)Nr�r
rr�rrr�move_row@sz
Grid.move_rowcCs|�|j�|d||��SrKr�r�rrrrLFszGrid.nearestcKs>|�|j|�}|dk	r"d|f|}|jj|d||f|��dS)Nz	-itemtyper�)r%r'rr)rrPrQr�r(�argsrrrr�PszGrid.setcKs*|j�|jj|jdd|f|�i|����S)Nrr	)rrOrrCr%�rr�r(rrr�size_columnVs
�zGrid.size_columncKs(|j�|jj|dd|f|�i|����S)Nrr
)rrOrr%r�rrr�size_rowps�
�z
Grid.size_rowcCs|j�|jd||�dS)N�unsetrLr�rrrr��sz
Grid.unset)N)N)N)N)r2r3r4r8rr�r�r�r�r�r�rHrJr7r/r�r�rLr�r�r�r�rrrrr��s&	




r�c@seZdZdifdd�ZdS)�ScrolledGridNcKs"g}||_t�||d|||�dS)NZtixScrolledGridr�r�rrrr8�szScrolledGrid.__init__r�rrrrr��sr�)ur9r7rZ_tkinterZWINDOWZTEXTZSTATUSZ	IMMEDIATEZIMAGEZ	IMAGETEXTZBALLOONZAUTOZ	ACROSSTOP�ASCIIZCELLZCOLUMNZ
DECREASINGZ
INCREASINGZINTEGERZMAIN�MAXZREALZROWZS_REGIONZX_REGIONZY_REGIONZ
TCL_DONT_WAITZTCL_WINDOW_EVENTSZTCL_FILE_EVENTSZTCL_TIMER_EVENTSZTCL_IDLE_EVENTSZTCL_ALL_EVENTSrr5r@r`�	__bases__rZr{r�r�r�r�r�r�r�r�r�r�r�r�r�r�ZXViewZYViewr�rYrZr\r_rmrnrqrsr~r�r�r�r�r�r�r�r�r�r�r�r�r�r�ZButtonr�ZCheckbuttonr�ZEntryr�ZFramer^ZLabelr�ZListboxr�ZMenurxZ
MenubuttonrwZ	Scrollbarr�ZTextr�r�r�rar�r�r�r�r�r�r�r�r�r`r�r�r�r�r�rrrr�<module>s�-
8/,!"C#	()


S.6

*tkinter/__pycache__/filedialog.cpython-38.opt-1.pyc000064400000030021151153537530016126 0ustar00U

e5d�8�@sdZddlTddlmZddlmZddlmZddlZddlZiZ	Gdd�d�Z
Gd	d
�d
e
�ZGdd�de
�ZGd
d�dej�Z
Gdd�de
�ZGdd�de
�ZGdd�dej�Zdd�Zdd�Zdd�Zd(dd�Zd)dd�Zd*d!d"�Zd#d$�Zd%d&�Zed'k�re�dS)+aUFile selection dialog classes.

Classes:

- FileDialog
- LoadFileDialog
- SaveFileDialog

This module also presents tk common file dialogues, it provides interfaces
to the native file dialogues available in Tk 4.2 and newer, and the
directory dialogue available in Tk 8.3 and newer.
These interfaces were written by Fredrik Lundh, May 1997.
�)�*)�Dialog)�commondialog)�
_setup_dialogNc@s�eZdZdZdZd$dd�Zejdddfdd	�Zd%d
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zd&dd�Zdd�Zdd�Zd'dd�Zd d!�Zd"d#�ZdS)(�
FileDialoga�Standard file selection dialog -- no checks on selected file.

    Usage:

        d = FileDialog(master)
        fname = d.go(dir_or_file, pattern, default, key)
        if fname is None: ...canceled...
        else: ...open file...

    All arguments to go() are optional.

    The 'key' argument specifies a key in the global dictionary
    'dialogstates', which keeps track of the values for the directory
    and pattern arguments, overriding the values passed in (it does
    not keep track of the default argument!).  If no key is specified,
    the dialog keeps no memory of previous state.  Note that memory is
    kept even when the dialog is canceled.  (All this emulates the
    behavior of the Macintosh file selection dialogs.)

    zFile Selection DialogNcCs�|dkr|j}||_d|_t|�|_|j�|�|j�|�t|j�t|j�|_|jj	t
td�t|j�|_
|j
j	t
td�|j
�d|j�t|j�|_|jj	ttd�|j�d|j�t|j�|_|jj	ttd�t|j�|_|jj	ttd�t|jd|jdfd�|_|jj	tttd�|j��}|j�|dd�|dd��|j�d	|j�|j�d
|j�|jj|jdfd�t|j�|_ |j j	t!td�t|jd|j dfd�|_"|j"j	t!ttd�|j j|j"dfd�|j"��}|j"�|dd�|dd��|j"�d	|j#�|j"�d
|j$�t%|jd
|j&d�|_'|j'j	t!d�t%|jd|jd�|_(|j(j	t!td�t%|jd|j)d�|_*|j*j	td�|j�+d|j)�|j�d|j)�|j�d|j)�dS)N)�side�fillz<Return>)�expandrr�set)ZexportselectionZyscrollcommand)rr	r�z<ButtonRelease-1>z<Double-ButtonRelease-1>Zyview)�commandZOK)�textr)rZFilter)rr	�CancelZWM_DELETE_WINDOWz<Alt-w>z<Alt-W>),�title�master�	directoryZToplevel�topZiconnamerZFrameZbotframeZpackZBOTTOM�XZEntry�	selectionZbind�ok_event�filterZTOP�filter_commandZmidframeZYESZBOTHZ	ScrollbarZfilesbarZRIGHT�YZListbox�filesZbindtags�files_select_event�files_double_eventZconfigZdirsbarZLEFT�dirs�dirs_select_event�dirs_double_eventZButton�
ok_commandZ	ok_buttonZ
filter_button�cancel_commandZ
cancel_buttonZprotocol)�selfrrZbtags�r"�*/usr/lib64/python3.8/tkinter/filedialog.py�__init__4st

�
 �
 ���zFileDialog.__init__r�cCs�|r|tkrt|\|_}n2tj�|�}tj�|�r<||_ntj�|�\|_}|�|j|�|�|�|�	�|j
��|j�
�|j��d|_|j��|r�|��\}}|jr�tj�|j�}||ft|<|j��|jS�N)�dialogstatesr�os�path�
expanduser�isdir�split�
set_filter�
set_selectionrrZ	focus_setrZwait_visibilityZgrab_set�howrZmainloop�
get_filter�dirnameZdestroy)r!Zdir_or_file�pattern�default�keyrr"r"r#�gots*





z
FileDialog.gocCs||_|j��dSr&)r/r�quit)r!r/r"r"r#r6�szFileDialog.quitcCs|��dSr&)r�r!�eventr"r"r#r�szFileDialog.dirs_double_eventcCs@|��\}}|j�d�}tj�tj�|j|��}|�||�dS�NZactive)	r0r�getr(r)�normpath�joinrr-)r!r8�dir�patZsubdirr"r"r#r�szFileDialog.dirs_select_eventcCs|��dSr&�rr7r"r"r#r�szFileDialog.files_double_eventcCs|j�d�}|�|�dSr9)rr:r.)r!r8�filer"r"r#r�szFileDialog.files_select_eventcCs|��dSr&r?r7r"r"r#r�szFileDialog.ok_eventcCs|�|���dSr&)r6�
get_selection�r!r"r"r#r�szFileDialog.ok_commandcCs&|��\}}zt�|�}Wn tk
r:|j��YdSX||_|�||�|��tj	g}g}|D]@}tj
�||�}tj
�|�r�|�
|�qft�||�rf|�
|�qf|j�dt�|D]}|j�t|�q�|j�dt�|D]}|j�t|�q�tj
�|���\}	}
|
tjk�rd}
|�|
�dS)Nrr%)r0r(�listdir�OSErrorr�bellrr-�sort�pardirr)r<r+�append�fnmatchr�delete�END�insertrr,rA�curdirr.)r!r8r=r>�namesZsubdirsZ
matchingfiles�name�fullname�head�tailr"r"r#r�s6
zFileDialog.filter_commandcCsN|j��}tj�|�}|dd�tjks4tj�|�rBtj�|d�}tj�|�S)N���r)	rr:r(r)r*�sepr+r<r,)r!rr"r"r#r0�s

zFileDialog.get_filtercCs|j��}tj�|�}|Sr&)rr:r(r)r*�r!r@r"r"r#rA�s
zFileDialog.get_selectioncCs|��dSr&)r6r7r"r"r#r �szFileDialog.cancel_commandcCs�tj�|�sPzt��}Wntk
r0d}YnX|rPtj�||�}tj�|�}|j�dt	�|j�
t	tj�|pttj|pzd��dS)Nrr)r(r)�isabs�getcwdrDr<r;rrJrKrLrM)r!r=r>�pwdr"r"r#r-�s
zFileDialog.set_filtercCs,|j�dt�|j�ttj�|j|��dS)Nr)rrJrKrLr(r)r<rrUr"r"r#r.�szFileDialog.set_selection)N)N)N)N)�__name__�
__module__�__qualname__�__doc__rr$r(rMr5r6rrrrrrrr0rAr r-r.r"r"r"r#rs"
@


rc@seZdZdZdZdd�ZdS)�LoadFileDialogz8File selection dialog which checks that the file exists.zLoad File Selection DialogcCs.|��}tj�|�s |j��n
|�|�dSr&)rAr(r)�isfilerrEr6rUr"r"r#r�szLoadFileDialog.ok_commandN�rYrZr[r\rrr"r"r"r#r]�sr]c@seZdZdZdZdd�ZdS)�SaveFileDialogz@File selection dialog which checks that the file may be created.zSave File Selection DialogcCs�|��}tj�|�rZtj�|�r.|j��dSt|jdd|fdddd�}|j	dkr�dSn*tj�
|�\}}tj�|�s�|j��dS|�|�dS)Nz Overwrite Existing File QuestionzOverwrite existing file %r?Z	questheadr)ZYesr)rr
Zbitmapr3Zstringsr)rAr(r)�existsr+rrErrZnumr,r6)r!r@�drQrRr"r"r#r�s&
�

zSaveFileDialog.ok_commandNr_r"r"r"r#r`�sr`c@seZdZdd�Zdd�ZdS)�_DialogcCs2zt|jd�|jd<Wntk
r,YnXdS)N�	filetypes)�tuple�options�KeyErrorrBr"r"r#�_fixoptions,sz_Dialog._fixoptionscCsR|rHz
|j}Wntk
r"YnXtj�|�\}}||jd<||jd<||_|S)N�
initialdirZinitialfile)�string�AttributeErrorr(r)r,rf�filename�r!�widget�resultr)r@r"r"r#�
_fixresult3s


z_Dialog._fixresultN)rYrZr[rhrpr"r"r"r#rc*srcc@seZdZdZdZdd�ZdS)�Open�Ask for a filename to openZtk_getOpenFilecCsxt|t�rBtdd�|D��}|r>tj�|d�\}}||jd<|S|j��sjd|jkrj|�||j�	|��St
�|||�S)NcSsg|]}t|d|��qS)rj)�getattr)�.0�rr"r"r#�
<listcomp>Nsz#Open._fixresult.<locals>.<listcomp>rri�multiple)�
isinstancerer(r)r,rfZtkZwantobjectsrpZ	splitlistrcrmr"r"r#rpKs

zOpen._fixresultN�rYrZr[r\rrpr"r"r"r#rqFsrqc@seZdZdZdZdS)�SaveAs�Ask for a filename to save asZtk_getSaveFileN)rYrZr[r\rr"r"r"r#rzZsrzc@seZdZdZdZdd�ZdS)�	DirectoryzAsk for a directoryZtk_chooseDirectorycCs8|r.z
|j}Wntk
r"YnX||jd<||_|S)Nri)rjrkrfr)r!rnror"r"r#rpfs

zDirectory._fixresultNryr"r"r"r#r|asr|cKstf|���S)rr�rq�show�rfr"r"r#�askopenfilenamewsr�cKstf|���S)r{)rzr~rr"r"r#�asksaveasfilename}sr�cKsd|d<tf|���S)ztAsk for multiple filenames to open

    Returns a list of filenames or empty list if
    cancel button selected
    rrwr}rr"r"r#�askopenfilenames�sr�rucKs tf|���}|rt||�SdS)z8Ask for a filename to open, and returned the opened fileN)rqr~�open��moderfrlr"r"r#�askopenfile�s
r�cKs4tf|�}|r0g}|D]}|�t||��q|}|S)z�Ask for multiple filenames and return the open file
    objects

    returns a list of open file objects or an empty list if
    cancel selected
    )r�rHr�)r�rfrZofilesrlr"r"r#�askopenfiles�s
r��wcKs tf|���}|rt||�SdS)z;Ask for a filename to save as, and returned the opened fileN)rzr~r�r�r"r"r#�
asksaveasfile�s
r�cKstf|���S)z-Ask for a directory, and return the file name)r|r~rr"r"r#�askdirectory�sr�c
	Cs�t�}|��t|�}|jdd�}t|�}|jdd�}t||�d}ddl}z&ddl}|�|j	d�|�
|j�}Wntt
fk
r�YnXtdgd�}zt|d	�}|��Wn$td
�t|��d�YnXtd|�|��t�}	td
|	�|��dS)zSimple test program.�test)r4zutf-8rNr%)z	all filesr)rdruzCould not open File: rr�Zsaveas)ZTkZwithdrawr]r5r`�print�sys�locale�	setlocale�LC_ALL�nl_langinfo�CODESET�ImportErrorrkr�r��close�exc_info�encoder�)
�root�fdZloadfileZsavefile�encr�r�Zopenfilename�fpZsaveasfilenamer"r"r#r��s2

r��__main__)ru)ru)r�)r\ZtkinterZtkinter.dialogrrZtkinter.simpledialogrr(rIr'rr]r`rcrqrzr|r�r�r�r�r�r�r�r�rYr"r"r"r#�<module>s2I9
	

	,
tkinter/__pycache__/commondialog.cpython-38.opt-2.pyc000064400000002132151153537530016502 0ustar00U

e5d��@sddlTGdd�d�ZdS)�)�*c@s2eZdZdZd
dd�Zdd�Zdd�Zdd	�ZdS)�DialogNcKs|s|�d�}||_||_dS)N�parent)�get�master�options)�selfrr�r	�,/usr/lib64/python3.8/tkinter/commondialog.py�__init__s
zDialog.__init__cCsdS�Nr	)rr	r	r
�_fixoptionsszDialog._fixoptionscCs|Srr	)rZwidget�resultr	r	r
�
_fixresultszDialog._fixresultcKs||��D]\}}||j|<q|��t|j�}z,|jj|jf|�	|j���}|�
||�}W5z|��WnYnXX|Sr)�itemsrr
ZFramerZdestroyZtkZcall�commandZ_optionsr)rr�k�v�w�sr	r	r
�shows
zDialog.show)N)�__name__�
__module__�__qualname__rrr
rrr	r	r	r
rs

rN)Ztkinterrr	r	r	r
�<module>stkinter/__pycache__/dialog.cpython-38.pyc000064400000002702151153537530014334 0ustar00U

e5d��@srddlTddlmZdZGdd�de�Zdd�Zedkrned	d
ddeeii�Z	ed	d
d
de	j
eii�Ze	��d	S)�)�*)�	_cnfmergeZ	questheadc@s"eZdZdifdd�Zdd�ZdS)�DialogNc
Ks�t||f�}d|_t�|||�|j�|jjd|j|d|d|d|df|d���|_zt�	|�Wnt
k
r~YnXdS)NZ
__dialog__Z	tk_dialog�title�text�bitmap�default�strings)rZ
widgetName�Widget�_setupZtkZgetintZcallZ_w�num�destroyZTclError)�selfZmasterZcnf�kw�r�&/usr/lib64/python3.8/tkinter/dialog.py�__init__
s&���zDialog.__init__cCsdS)Nr)rrrrr
�zDialog.destroy)�__name__�
__module__�__qualname__rr
rrrrr	s
rcCs$tdddtddd��}t|j�dS)Nz
File ModifiedzzFile "Python.h" has been modified since the last time it was saved. Do you want to save it before exiting the application.r)z	Save FilezDiscard ChangeszReturn to Editor)rrrrr	)r�DIALOG_ICON�printr)�drrr�_tests�r�__main__NrZTestZcommandZQuit)
Ztkinterrrr
rrrZButtonZPack�t�quit�qZmainlooprrrr�<module>s$��tkinter/__pycache__/messagebox.cpython-38.pyc000064400000005661151153537530015241 0ustar00U

e5d}�@sHddlmZdZdZdZdZdZdZdZd	Z	d
Z
dZdZd
Z
dZdZdZdZdZGdd�de�Zd5dd�Zd6dd�Zd7dd�Zd8dd�Zd9dd�Zd:dd �Zd;d!d"�Zd<d#d$�Zd=d%d&�Zed'k�rDeded(d)��eded(d*��eded(d+��eded(d,��ed-ed(d.��ed/ed(d0��ed1ed(d2��ed3ed(d4��dS)>�)�Dialog�error�infoZquestionZwarningZabortretryignore�okZokcancelZretrycancelZyesnoZyesnocancel�abortZretry�ignoreZcancelZyesZnoc@seZdZdZdZdS)�Messagez
A message boxZ
tk_messageBoxN)�__name__�
__module__�__qualname__�__doc__Zcommand�r
r
�*/usr/lib64/python3.8/tkinter/messagebox.pyr9srNcKsl|rd|kr||d<|r(d|kr(||d<|r4||d<|r@||d<tf|���}t|t�rd|r`tStSt|�S)NZicon�type�title�message)rZshow�
isinstance�bool�YES�NO�str)rrZ_iconZ_type�options�resr
r
r�_showCs
rcKst||ttf|�S)zShow an info message)r�INFO�OK�rrrr
r
r�showinfoRsrcKst||ttf|�S)zShow a warning message)r�WARNINGrrr
r
r�showwarningWsrcKst||ttf|�S)zShow an error message)r�ERRORrrr
r
r�	showerror\sr!cKst||ttf|�S)zAsk a question)r�QUESTION�YESNOrr
r
r�askquestionasr$cKst||ttf|�}|tkS)z@Ask if operation should proceed; return true if the answer is ok)rr"�OKCANCELr�rrr�sr
r
r�askokcancelfsr(cKst||ttf|�}|tkS)z0Ask a question; return true if the answer is yes)rr"r#rr&r
r
r�askyesnolsr)cKs.t||ttf|�}t|�}|tkr&dS|tkS)zDAsk a question; return true if the answer is yes, None if cancelled.N)rr"�YESNOCANCELr�CANCELrr&r
r
r�askyesnocancelrs
r,cKst||ttf|�}|tkS)zDAsk if operation should be retried; return true if the answer is yes)rr�RETRYCANCEL�RETRYr&r
r
r�askretrycancel|sr/�__main__ZSpamzEgg InformationzEgg Warningz	Egg Alertz	Question?ZproceedzProceed?zyes/nozGot it?z
yes/no/cancelzWant it?z	try againz
Try again?)NNNN)NN)NN)NN)NN)NN)NN)NN)NN)Ztkinter.commondialogrr rr"rZABORTRETRYIGNORErr%r-r#r*ZABORTr.ZIGNOREr+rrrrrrr!r$r(r)r,r/r	�printr
r
r
r�<module>sH










	
tkinter/__pycache__/constants.cpython-38.opt-2.pyc000064400000003170151153537530016051 0ustar00U

e5d��@s8dZZZdZZZdZdZdZdZ	dZ
dZdZd	Z
d
ZdZdZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#d Z$d!Z%d"Z&d#Z'd$Z(d%Z)d&Z*d'Z+d(Z,d)Z-d*Z.d+Z/d,Z0d-Z1d.Z2d/Z3d0Z4d1Z5d2Z6d3Z7d4Z8d5Z9d6Z:d7Z;d8Z<d9Z=d:Z>d;Z?d<Z@d=ZAd>ZBd?ZCd@ZDdAZEdBZFdCZGdDZHdEZIdFZJdGZKdHZLdIS)J���n�s�w�eZnw�sw�neZse�nsZewZnsew�centerZnone�x�yZboth�left�top�rightZbottomZraisedZsunkenZflatZridgeZgrooveZsolidZ
horizontalZvertical�numeric�charZwordZbaselineZinsideZoutsideZselz	sel.firstzsel.last�end�insertZcurrentZanchor�allZnormalZdisabledZactiveZhiddenZcascadeZcheckbuttonZcommandZradiobuttonZ	separatorZsingleZbrowseZmultipleZextendedZdotboxZ	underlineZpiesliceZchordZarc�firstZlastZbuttZ
projecting�roundZbevelZmiterZmovetoZscrollZunitsZpagesN)MZNOZFALSEZOFFZYESZTRUEZON�N�S�W�EZNWZSWZNEZSEZNSZEWZNSEWZCENTERZNONE�X�YZBOTHZLEFTZTOPZRIGHTZBOTTOMZRAISEDZSUNKENZFLATZRIDGEZGROOVEZSOLIDZ
HORIZONTALZVERTICALZNUMERICZCHARZWORDZBASELINEZINSIDEZOUTSIDEZSELZ	SEL_FIRSTZSEL_LASTZENDZINSERTZCURRENTZANCHORZALLZNORMALZDISABLEDZACTIVEZHIDDENZCASCADEZCHECKBUTTONZCOMMANDZRADIOBUTTONZ	SEPARATORZSINGLEZBROWSEZMULTIPLEZEXTENDEDZDOTBOXZ	UNDERLINEZPIESLICEZCHORDZARCZFIRSTZLASTZBUTTZ
PROJECTINGZROUNDZBEVELZMITERZMOVETOZSCROLLZUNITSZPAGES�rr�)/usr/lib64/python3.8/tkinter/constants.py�<module>s�tkinter/__pycache__/__init__.cpython-38.opt-1.pyc000064400000530063151153537530015601 0ustar00U

e5d͕�@s�dZddlZddlZddlZejZddlTddlZdZeej	�Z
eej�Zej
Z
ejZejZe�d�Ze�dej�Zdd�Zd	d
�Zdd�Zz
ejZWnek
r�YnXd
d�Zz
ejZWnek
r�YnXdydd�ZGdd�deej�ZGdd�d�Zdadadd�Z dzdd�Z!dd�Z"d{dd�Z#da$Gdd�d�Z%Gd d!�d!e%�Z&Gd"d#�d#e%�Z'Gd$d%�d%e%�Z(Gd&d'�d'e%�Z)d|d(d)�Z*e+Z,eZ-d*d+�Z.Gd,d-�d-�Z/Gd.d/�d/�Z0Gd0d1�d1�Z1Gd2d3�d3�Z2Gd4d5�d5�Z3Gd6d7�d7e/e3�Z4d}d8d9�Z5Gd:d;�d;�Z6Gd<d=�d=�Z7Gd>d?�d?�Z8Gd@dA�dAe/�Z9GdBdC�dCe9e6e7e8�Z:GdDdE�dEe9e3�Z;GdFdG�dGe:�Z<GdHdI�dIe:e1e2�Z=GdJdK�dKe:�Z>GdLdM�dMe:e1�Z?GdNdO�dOe:�Z@GdPdQ�dQe:�ZAGdRdS�dSe:e1e2�ZBGdTdU�dUe:�ZCGdVdW�dWe:�ZDGdXdY�dYe:�ZEGdZd[�d[e:�ZFGd\d]�d]e:�ZGGd^d_�d_e:�ZHGd`da�dae:e1e2�ZIGdbdc�dc�ZJGddde�deeD�ZKGdfdg�dg�ZLGdhdi�dieL�ZMGdjdk�dkeL�ZNdldm�ZOdndo�ZPGdpdq�dqe:e1�ZQGdrds�dse:�ZRGdtdu�due:�ZSdvdw�ZTeUdxk�r�eT�dS)~a8Wrapper functions for Tcl/Tk.

Tkinter provides classes which allow the display, positioning and
control of widgets. Toplevel widgets are Tk and Toplevel. Other
widgets are Frame, Label, Entry, Text, Canvas, Button, Radiobutton,
Checkbutton, Scale, Listbox, Scrollbar, OptionMenu, Spinbox
LabelFrame and PanedWindow.

Properties of the widgets are specified with keyword arguments.
Keyword arguments have the same name as the corresponding resource
under Tk.

Widgets are positioned with one of the geometry managers Place, Pack
or Grid. These managers can be called with methods place, pack, grid
available in every Widget.

Actions are bound to events by resources (e.g. keyword argument
command) or with the method bind.

Example (Hello, World):
import tkinter
from tkinter.constants import *
tk = tkinter.Tk()
frame = tkinter.Frame(tk, relief=RIDGE, borderwidth=2)
frame.pack(fill=BOTH,expand=1)
label = tkinter.Label(frame, text="Hello, World")
label.pack(fill=X, expand=1)
button = tkinter.Button(frame,text="Exit",command=tk.destroy)
button.pack(side=BOTTOM)
tk.mainloop()
�N)�*�z([\\{}])z([\s])cCsd�tt|��S)�Internal function.� )�join�map�
_stringify��value�r�(/usr/lib64/python3.8/tkinter/__init__.py�_join8sr
cCs�t|ttf�rHt|�dkr:t|d�}t�|�rFd|}q�dt|�}ntt|�}|sZd}nbt�|�r�t�	d|�}|�
dd�}t�	d|�}|ddkr�d	|}n|ddks�t�|�r�d|}|S)
rrrz{%s}z{}z\\\1�
z\n�"�\)�
isinstance�list�tuple�lenr�	_magic_re�searchr
�str�sub�replace�	_space_rer	rrrr=s$



rcCs@d}|D]2}t|ttf�r(|t|�}q|dk	r||f}q|S)rrN)rrr�_flatten)�seq�res�itemrrrrVsrcCs�t|t�r|St|td�tf�r$|Si}t|�D]^}z|�|�Wq0ttfk
r�}z(td|�|�	�D]\}}|||<qjW5d}~XYq0Xq0|SdS)rNz_cnfmerge: fallback due to:)
r�dict�typerr�update�AttributeError�	TypeError�print�items)Zcnfs�cnf�c�msg�k�vrrr�	_cnfmergees

r+Tc	Csz|�|�}t|�drtd��t|�}i}t||�D]@\}}t|�}|r`|ddkr`|dd�}|rl||�}|||<q4|S)aReturn a properly formatted dict built from Tcl list pairs.

    If cut_minus is True, the supposed '-' prefix will be removed from
    keys. If conv is specified, it is used to convert values.

    Tcl list is expected to contain an even number of elements.
    �zNTcl list representing a dict is expected to contain an even number of elementsr�-rN)�	splitlistr�RuntimeError�iter�zipr)	�tkr*Z	cut_minus�conv�t�itr�keyr
rrr�
_splitdict{s

r7c@s�eZdZdZeZdZdZeZdZdZ	dZ
dZdZd	Z
d
ZdZdZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#d Z$d!Z%d"Z&d#Z'd$Z(d%Z)e*j+Z+d&S)'�	EventType�2�3�4�5�6�7�8�9Z10Z11Z12Z13Z14Z15Z16Z17Z18Z19Z20Z21Z22Z23Z24Z25Z26Z27Z28Z29Z30Z31Z32Z33Z34Z35Z36Z37Z38N),�__name__�
__module__�__qualname__ZKeyPressZKeyZ
KeyReleaseZButtonPress�ButtonZ
ButtonReleaseZMotionZEnterZLeaveZFocusInZFocusOutZKeymapZExposeZGraphicsExposeZNoExposeZ
VisibilityZCreateZDestroyZUnmapZMapZ
MapRequestZReparentZ	ConfigureZConfigureRequestZGravityZ
ResizeRequestZ	CirculateZCirculateRequestZPropertyZSelectionClearZSelectionRequestZ	SelectionZColormapZ
ClientMessage�MappingZVirtualEventZActivateZ
DeactivateZ
MouseWheelr�__str__rrrrr8�sPr8c@seZdZdZdd�ZdS)�Eventa�Container for the properties of an event.

    Instances of this type are generated if one of the following events occurs:

    KeyPress, KeyRelease - for keyboard events
    ButtonPress, ButtonRelease, Motion, Enter, Leave, MouseWheel - for mouse events
    Visibility, Unmap, Map, Expose, FocusIn, FocusOut, Circulate,
    Colormap, Gravity, Reparent, Property, Destroy, Activate,
    Deactivate - for window events.

    If a callback function for one of these events is registered
    using bind, bind_all, bind_class, or tag_bind, the callback is
    called with an Event as first argument. It will have the
    following attributes (in braces are the event types for which
    the attribute is valid):

        serial - serial number of event
    num - mouse button pressed (ButtonPress, ButtonRelease)
    focus - whether the window has the focus (Enter, Leave)
    height - height of the exposed window (Configure, Expose)
    width - width of the exposed window (Configure, Expose)
    keycode - keycode of the pressed key (KeyPress, KeyRelease)
    state - state of the event as a number (ButtonPress, ButtonRelease,
                            Enter, KeyPress, KeyRelease,
                            Leave, Motion)
    state - state as a string (Visibility)
    time - when the event occurred
    x - x-position of the mouse
    y - y-position of the mouse
    x_root - x-position of the mouse on the screen
             (ButtonPress, ButtonRelease, KeyPress, KeyRelease, Motion)
    y_root - y-position of the mouse on the screen
             (ButtonPress, ButtonRelease, KeyPress, KeyRelease, Motion)
    char - pressed character (KeyPress, KeyRelease)
    send_event - see X/Windows documentation
    keysym - keysym of the event as a string (KeyPress, KeyRelease)
    keysym_num - keysym of the event as a number (KeyPress, KeyRelease)
    type - type of the event as a number
    widget - widget in which the event occurred
    delta - delta of wheel movement (MouseWheel)
    csdd�|j��D��|js"�d=n|jdkr:t|j��d<t|dd�sL�d=|jdkr^�d=n|t|jt�r�|j}d	}g}t|�D]\}}|d
|>@r�|�	|�q�|d
t
|�>d
@}|s�|s�|�	t|��d�|��d<|j
dkr�d=d
}dt|jd|j�d��fdd�|D��fS)NcSsi|]\}}|dkr||�qS)�??r��.0r)r*rrr�
<dictcomp>�sz"Event.__repr__.<locals>.<dictcomp>�charrH�
send_eventTr�state)
ZShiftZLockZControlZMod1ZMod2ZMod3ZMod4ZMod5ZButton1ZButton2ZButton3ZButton4ZButton5r�|�delta)rMrN�keysym�keycoderL�numrP�focus�x�y�width�heightz<%s event%s>�name�c3s&|]}|�krd|�|fVqdS)z %s=%sNr)rJr)��attrsrr�	<genexpr>
sz!Event.__repr__.<locals>.<genexpr>)�__dict__r%rL�repr�getattrrNr�int�	enumerate�appendr�hexrrPr )�selfrNZmods�s�i�n�keysrr[r�__repr__�s6


�zEvent.__repr__N)rArBrC�__doc__rjrrrrrG�s*rGcCsdadabdS)z�Inhibit setting of default root window.

    Call this function to inhibit that the first instance of
    Tk is used for windows without an explicit parent window.
    FN)�_support_default_root�
_default_rootrrrr�
NoDefaultRootsrncCs.tstd��ts*|r$td|�d���t�}tS)NzINo master specified and tkinter is configured to not support default rootz
Too early to z: no default root window)rlr/rm�Tk)�what�rootrrr�_get_default_root#srrcCsdS�rNr)�errrrr�_tkerror/srucCs.zt|�}Wntk
r YnXt|��dS)zBInternal function. Calling it will raise the exception SystemExit.N)ra�
ValueError�
SystemExit)�coderrr�_exit4s
ryc@s�eZdZdZdZdZdZddd�Zdd�Zdd	�Z	d
d�Z
e
Zdd
�Zdd�Z
dd�Zdd�Zdd�Zdd�ZeZdd�Zdd�Zdd�ZdS)�Variablez�Class to define value holders for e.g. buttons.

    Subclasses StringVar, IntVar, DoubleVar, BooleanVar are specializations
    that constrain the type of the value returned from get().rZNcCs�|dk	rt|t�std��|s&td�}|��|_|j|_|rD||_ndtt	�|_t	d7a	|dk	rn|�
|�n&|j�|j�dd|j��s�|�
|j
�dS)a.Construct a variable

        MASTER can be given as master widget.
        VALUE is an optional value (defaults to "")
        NAME is an optional Tcl name (defaults to PY_VARnum).

        If NAME matches an existing variable and VALUE is omitted
        then the existing value is retained.
        Nzname must be a stringzcreate variable�PY_VARr�info�exists)rrr#rr�_rootr2�_tk�_namer_�_varnum�
initialize�
getboolean�call�_default�re�masterr
rYrrr�__init__Is

zVariable.__init__cCsb|jdkrdS|j�|j�dd|j��r6|j�|j�|jdk	r^|jD]}|j�|�qFd|_dS)zUnset the variable in Tcl.Nr|r})rr�r�r�Zglobalunsetvar�_tclCommands�
deletecommand�rerYrrr�__del__gs


zVariable.__del__cCs|jS)z'Return the name of the variable in Tcl.)r��rerrrrFsszVariable.__str__cCs|j�|j|�S�zSet the variable to VALUE.)r�globalsetvarr��rer
rrr�setwszVariable.setcCs|j�|j�S)zReturn value of variable.)r�globalgetvarr�r�rrr�get}szVariable.getcCs�t|d|j�j}tt|��}z
|j}Wntk
r:YnXz||j}Wntk
r^YnX|j�	||�|j
dkr~g|_
|j
�|�|S�N)�CallWrapperr~�__call__r_�id�__func__r"rAr�
createcommandr�rc)re�callback�f�cbnamerrr�	_register�s

zVariable._registercCs(|�|�}|j�ddd|j||f�|S)a#Define a trace callback for the variable.

        Mode is one of "read", "write", "unset", or a list or tuple of
        such strings.
        Callback must be a function which is called when the variable is
        read, written or unset.

        Return the name of the callback.
        �trace�add�variable�r�rr�r��re�moder�r�rrr�	trace_add�s

�zVariable.trace_addcCsx|j�ddd|j||�|��D] \}}|j�|�d|kr qtq |j�|�z|j�|�Wntk
rrYnXdS)aDelete the trace callback for a variable.

        Mode is one of "read", "write", "unset" or a list or tuple of
        such strings.  Must be same as were specified in trace_add().
        cbname is the name of the callback returned from trace_add().
        r��remover�rN)	rr�r��
trace_infor.r�r�r�rv�rer�r��mZcarrr�trace_remove�s�zVariable.trace_removec
s4|jj��fdd�t��|j�ddd|j���D�S)z&Return all trace callback information.csg|]\}}�|�|f�qSrrrI�r.rr�
<listcomp>�sz'Variable.trace_info.<locals>.<listcomp>r�r|r�)rr.rr�r�r�rr�rr��s�zVariable.trace_infocCs$|�|�}|j�dd|j||�|S)a�Define a trace callback for the variable.

        MODE is one of "r", "w", "u" for read, write, undefine.
        CALLBACK must be a function which is called when
        the variable is read, written or undefined.

        Return the name of the callback.

        This deprecated method wraps a deprecated Tcl method that will
        likely be removed in the future.  Use trace_add() instead.
        r�r�r�r�rrr�trace_variable�s
zVariable.trace_variablecCs�|j�dd|j||�|j�|�d}|��D] \}}|j�|�d|kr.q�q.|j�|�z|j�|�Wntk
r�YnXdS)aSDelete the trace callback for a variable.

        MODE is one of "r", "w", "u" for read, write, undefine.
        CBNAME is the name of the callback returned from trace_variable or trace.

        This deprecated method wraps a deprecated Tcl method that will
        likely be removed in the future.  Use trace_remove() instead.
        r�ZvdeleterN)	rr�r�r.r�r�r�r�rvr�rrr�
trace_vdelete�s
zVariable.trace_vdeletecs(�fdd��j��j�dd�j��D�S)z�Return all trace callback information.

        This deprecated method wraps a deprecated Tcl method that will
        likely be removed in the future.  Use trace_info() instead.
        csg|]}�j�|��qSr)rr.�rJrUr�rrr��sz(Variable.trace_vinfo.<locals>.<listcomp>r�Zvinfo)rr.r�r�r�rr�r�trace_vinfo�s�zVariable.trace_vinfocCs6t|t�stS|j|jko4|jj|jjko4|j|jkSr�)rrz�NotImplementedr��	__class__rAr)re�otherrrr�__eq__�s
�
�zVariable.__eq__)NNN)rArBrCrkr�rr�r�r�rFr�r�r�r�r�r�r�r�r�r�r�r�rrrrrz@s&

rzc@s&eZdZdZdZddd�Zdd�ZdS)	�	StringVarz#Value holder for strings variables.rZNcCst�||||�dS)a6Construct a string variable.

        MASTER can be given as master widget.
        VALUE is an optional value (defaults to "")
        NAME is an optional Tcl name (defaults to PY_VARnum).

        If NAME matches an existing variable and VALUE is omitted
        then the existing value is retained.
        N�rzr�r�rrrr��s
zStringVar.__init__cCs$|j�|j�}t|t�r|St|�S)z#Return value of variable as string.)rr�r�rrr�rrrr�s
z
StringVar.get)NNN�rArBrCrkr�r�r�rrrrr��s
r�c@s&eZdZdZdZddd�Zdd�ZdS)	�IntVarz#Value holder for integer variables.rNcCst�||||�dS)a7Construct an integer variable.

        MASTER can be given as master widget.
        VALUE is an optional value (defaults to 0)
        NAME is an optional Tcl name (defaults to PY_VARnum).

        If NAME matches an existing variable and VALUE is omitted
        then the existing value is retained.
        Nr�r�rrrr�s
zIntVar.__init__c	CsJ|j�|j�}z|j�|�WSttfk
rDt|j�|��YSXdS)z/Return the value of the variable as an integer.N)rr�r��getintr#�TclErrorra�	getdoubler�rrrr�s
z
IntVar.get)NNNr�rrrrr�
s
r�c@s&eZdZdZdZddd�Zdd�ZdS)	�	DoubleVarz!Value holder for float variables.gNcCst�||||�dS)a6Construct a float variable.

        MASTER can be given as master widget.
        VALUE is an optional value (defaults to 0.0)
        NAME is an optional Tcl name (defaults to PY_VARnum).

        If NAME matches an existing variable and VALUE is omitted
        then the existing value is retained.
        Nr�r�rrrr�*s
zDoubleVar.__init__cCs|j�|j�|j��S)z,Return the value of the variable as a float.)rr�r�r�r�rrrr�6sz
DoubleVar.get)NNNr�rrrrr�&s
r�c@s2eZdZdZdZd
dd�Zdd�ZeZdd	�ZdS)�
BooleanVarz#Value holder for boolean variables.FNcCst�||||�dS)a:Construct a boolean variable.

        MASTER can be given as master widget.
        VALUE is an optional value (defaults to False)
        NAME is an optional Tcl name (defaults to PY_VARnum).

        If NAME matches an existing variable and VALUE is omitted
        then the existing value is retained.
        Nr�r�rrrr�?s
zBooleanVar.__init__cCs|j�|j|j�|��Sr�)rr�r�r�r�rrrr�KszBooleanVar.setcCs:z|j�|j�|j��WStk
r4td��YnXdS)z+Return the value of the variable as a bool.� invalid literal for getboolean()N)rr�r�r�r�rvr�rrrr�QszBooleanVar.get)NNN)	rArBrCrkr�r�r�r�r�rrrrr�;s
r�cCstd�j�|�dS)zRun the main loop of Tcl.zrun the main loopN)rrr2�mainloop)rhrrrr�Ysr�cCs4ztd�j�|�WStk
r.td��YnXdS)z$Convert Tcl object to True or False.zuse getboolean()r�N)rrr2r�r�rv�rfrrrr�csr�c@s�eZdZdZdZdZdd�Zdd�Z�d1dd�Zd	d
�Z	dd�Z
�d2dd�ZeZ�d3dd�Z
�d4dd�Z�d5dd�Z�d6dd�Zdd�Zdd�Zdd�Zdd �ZeZd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Z�d7d/d0�Zd1d2�Zd3d4�Z�d8d6d7�Z d8d9�Z!d:d;�Z"d<d=�Z#d>d?�Z$d@dA�Z%dBdC�Z&dDdE�Z'dFdG�Z(�d9dHdI�Z)dJdK�Z*dLdM�Z+�d:dNdO�Z,dPdQ�Z-dRdS�Z.dTdU�Z/dVdW�Z0dXdY�Z1dZd[�Z2�d;d\d]�Z3�d<d^d_�Z4e4Z5�d=d`da�Z6�d>dbdc�Z7ddde�Z8dfdg�Z9dhdi�Z:djdk�Z;�d?dldm�Z<dndo�Z=dpdq�Z>drds�Z?dtdu�Z@dvdw�ZAdxdy�ZB�d@dzd{�ZCd|d}�ZDd~d�ZEd�d��ZFd�d��ZG�dAd�d��ZHd�d��ZId�d��ZJd�d��ZKd�d��ZLd�d��ZMd�d��ZNd�d��ZOd�d��ZPd�d��ZQd�d��ZRd�d��ZSd�d��ZTd�d��ZUd�d��ZVd�d��ZWd�d��ZXd�d��ZYd�d��ZZd�d��Z[d�d��Z\d�d��Z]d�d��Z^�dBd�d��Z_d�d��Z`d�d��Zad�d��Zbd�d��Zcd�d��Zdd�d��Zed�d„Zfd�dĄZgd�dƄZhd�dȄZid�dʄZj�dCd�d̄Zk�dDd�dτZl�dEd�dфZm�dFd�dӄZn�dGd�dՄZod�dׄZp�dHd�dلZqd�dۄZr�dId�d݄Zsd�d߄Ztd�d�Zud�d�Zvd�d�Zwd�d�Zxeyd�d��Zz�dJd�d�Z{d�d�Z|e|Z}�dKd�d�Z~e~Zd�d�Z�d�Z�d�e��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z��dLd�d��Z�e�Z��d�d�Z�e�Z��d�d�Z��d�d�Z��d�d�Z��d�d	�Z��d
gZ�e�f�d�d�Z�e�Z��d
�d�Z�e�Z��d�d�Z��dM�d�d�Z�e�Z��dN�d�d�Z�e�Z��d�d�Z��d�d�Z�if�d�d�Z�e�Z��d�d�Z�e�f�d�d�Z�if�d�d �Z�e�Z��d!�d"�Z�e�Z��dO�d#�d$�Z��d%�d&�Z��d'�d(�Z��d)�d*�Z��dP�d+�d,�Z��d-�d.�Z��d/�d0�Z�dS(Q�MisczRInternal class.

    Base class which defines methods common for interior widgets.NcCs,|jdk	r(|jD]}|j�|�qd|_dS)zkInternal function.

        Delete all Tcl commands created for
        this widget in the Tcl interpreter.N)r�r2r�r�rrr�destroyxs

zMisc.destroycCs6|j�|�z|j�|�Wntk
r0YnXdS)zDInternal function.

        Delete the Tcl command provided in NAME.N)r2r�r�r�rvr�rrrr��s
zMisc.deletecommandcCs|j�|j�dd|��S)z�Set Tcl internal variable, whether the look and feel
        should adhere to Motif.

        A parameter of 1 means adhere to Motif (e.g. no color
        change if mouse passes over slider).
        Returns the set value.r��tk_strictMotif)r2r�r��re�booleanrrrr��s
�zMisc.tk_strictMotifcCs|j�d�dS)zDChange the color scheme to light brown as used in Tk 3.6 and before.�	tk_bisqueN�r2r�r�rrrr��szMisc.tk_bisquecOs(|j�dt|�tt|�����dS)aSet a new color scheme for all widget elements.

        A single color as argument will cause that all colors of Tk
        widget elements are derived from this.
        Alternatively several keyword parameters and its associated
        colors can be given. The following keywords are valid:
        activeBackground, foreground, selectColor,
        activeForeground, highlightBackground, selectBackground,
        background, highlightColor, selectForeground,
        disabledForeground, insertBackground, troughColor.)�
tk_setPaletteN)r2r�rrr%�re�args�kwrrrr��s
��zMisc.tk_setPaletter{cCs|j�dd|�dS)z�Wait until the variable is modified.

        A parameter of type IntVar, StringVar, DoubleVar or
        BooleanVar must be given.�tkwaitr�Nr�r�rrr�
wait_variable�szMisc.wait_variablecCs"|dkr|}|j�dd|j�dS)zQWait until a WIDGET is destroyed.

        If no parameter is given self is used.Nr��window�r2r��_w�rer�rrr�wait_window�szMisc.wait_windowcCs"|dkr|}|j�dd|j�dS)zxWait until the visibility of a WIDGET changes
        (e.g. it appears).

        If no parameter is given self is used.Nr�Z
visibilityr�r�rrr�wait_visibility�szMisc.wait_visibility�1cCs|j�||�dS)zSet Tcl variable NAME to VALUE.N)r2�setvar)rerYr
rrrr��szMisc.setvarcCs|j�|�S)z"Return value of Tcl variable NAME.)r2�getvarr�rrrr��szMisc.getvarc
CsBz|j�|�WStk
r<}ztt|���W5d}~XYnXdSr�)r2r�r�rvr�rerf�excrrrr��szMisc.getintc
CsBz|j�|�WStk
r<}ztt|���W5d}~XYnXdSr�)r2r�r�rvrr�rrrr��szMisc.getdoublecCs0z|j�|�WStk
r*td��YnXdS)zPReturn a boolean value for Tcl boolean values true and false given as parameter.r�N)r2r�r�rv)rerfrrrr��szMisc.getbooleancCs|j�d|j�dS)z�Direct input focus to this widget.

        If the application currently does not have the focus
        this widget will get the focus if the application gets
        the focus through the window manager.rTNr�r�rrr�	focus_set�szMisc.focus_setcCs|j�dd|j�dS)ztDirect input focus to this widget even if the
        application does not have the focus. Use with
        caution!rTz-forceNr�r�rrr�focus_force�szMisc.focus_forcecCs&|j�d�}|dks|sdS|�|�S)z�Return the widget which has currently the focus in the
        application.

        Use focus_displayof to allow working with several
        displays. Return None if application does not have
        the focus.rT�noneN)r2r��
_nametowidgetr�rrr�	focus_get�szMisc.focus_getcCs,|j�dd|j�}|dks|s"dS|�|�S)z�Return the widget which has currently the focus on the
        display where this widget is located.

        Return None if the application does not have the focus.rT�
-displayofr�N�r2r�r�r�r�rrr�focus_displayof�szMisc.focus_displayofcCs,|j�dd|j�}|dks|s"dS|�|�S)zyReturn the widget which would have the focus if top level
        for this widget gets the focus from the window manager.rTz-lastforr�Nr�r�rrr�
focus_lastforszMisc.focus_lastforcCs|j�d�dS)zXThe widget under mouse will get automatically focus. Can not
        be disabled easily.�tk_focusFollowsMouseNr�r�rrrr�szMisc.tk_focusFollowsMousecCs"|j�d|j�}|sdS|�|�S)anReturn the next widget in the focus order which follows
        widget which has currently the focus.

        The focus order first goes to the next child, then to
        the children of the child recursively and then to the
        next sibling which is higher in the stacking order.  A
        widget is omitted if it has the takefocus resource set
        to 0.�tk_focusNextNr�r�rrrr�
s	zMisc.tk_focusNextcCs"|j�d|j�}|sdS|�|�S)zHReturn previous widget in the focus order. See tk_focusNext for details.�tk_focusPrevNr�r�rrrr�szMisc.tk_focusPrevcsN�s�j�d|�dS����fdd�}�j|_��|���j�d|��SdS)aCall function once after given time.

        MS specifies the time in milliseconds. FUNC gives the
        function which shall be called. Additional parameters
        are given as parameters to the function call.  Return
        identifier to cancel scheduling with after_cancel.�afterNcs8z���W5z����Wntk
r0YnXXdSr�)r�r�r�r��funcrYrerr�callit,szMisc.after.<locals>.callit)r2r�rAr�)reZmsr�r�r�rr�rr� s
z
Misc.aftercGs|jd|f|��S)z�Call FUNC once if the Tcl main loop has no event to
        process.

        Return an identifier to cancel the scheduling with
        after_cancel.Zidle)r�)rer�r�rrr�
after_idle8szMisc.after_idlecCsd|std��z.|j�dd|�}|j�|�d}|�|�Wntk
rNYnX|j�dd|�dS)z�Cancel scheduling of function identified with ID.

        Identifier returned by after or after_idle must be
        given as first parameter.
        z?id must be a valid identifier returned from after or after_idler�r|rZcancelN)rvr2r�r.r�r�)rer��dataZscriptrrr�after_cancel@szMisc.after_cancelrcCs|j�d|�|��dS)zRing a display's bell.)�bellN)r2r��
_displayof�re�	displayofrrrr�Qsz	Misc.bellcKsdd|krN|jdkrNz d|d<|j�d|�|��WStk
rL|d=YnX|j�d|�|��S)a�Retrieve data from the clipboard on window's display.

        The window keyword defaults to the root window of the Tkinter
        application.

        The type keyword specifies the form in which the data is
        to be returned and should be an atom name such as STRING
        or FILE_NAME.  Type defaults to STRING, except on X11, where the default
        is to try UTF8_STRING and fall back to STRING.

        This command is equivalent to:

        selection_get(CLIPBOARD)
        r �x11�UTF8_STRING)�	clipboardr�)�_windowingsystemr2r��_optionsr��rer�rrr�
clipboard_getVszMisc.clipboard_getcKs,d|kr|j|d<|j�d|�|��dS)z�Clear the data in the Tk clipboard.

        A widget specified for the optional displayof keyword
        argument specifies the target display.r�)r��clearN�r�r2r�r�r�rrr�clipboard_clearms
zMisc.clipboard_clearcKs4d|kr|j|d<|j�d|�|�d|f�dS)z�Append STRING to the Tk clipboard.

        A widget specified at the optional displayof keyword
        argument specifies the target display. The clipboard
        can be retrieved with selection_get.r�)r�rc�--Nr�)re�stringr�rrr�clipboard_appendus

�zMisc.clipboard_appendcCs$|j�dd|j�}|sdS|�|�S)zOReturn widget which has currently the grab in this application
        or None.�grabZcurrentNr�r�rrr�grab_current�szMisc.grab_currentcCs|j�dd|j�dS)z.Release grab for this widget if currently set.r��releaseNr�r�rrr�grab_release�szMisc.grab_releasecCs|j�dd|j�dS)zwSet grab for this widget.

        A grab directs all events to this and descendant
        widgets in the application.r�r�Nr�r�rrr�grab_set�sz
Misc.grab_setcCs|j�ddd|j�dS)z�Set global grab for this widget.

        A global grab directs all events to this and
        descendant widgets on the display. Use with caution -
        other applications do not get events anymore.r�r�z-globalNr�r�rrr�grab_set_global�szMisc.grab_set_globalcCs"|j�dd|j�}|dkrd}|S)zYReturn None, "local" or "global" if this widget has
        no, a local or a global grab.r��statusr�Nr�)rerrrr�grab_status�szMisc.grab_statuscCs|j�dd|||�dS)z�Set a VALUE (second parameter) for an option
        PATTERN (first parameter).

        An optional third parameter gives the numeric priority
        (defaults to 80).�optionr�Nr�)re�patternr
�priorityrrr�
option_add�szMisc.option_addcCs|j�dd�dS)zPClear the option database.

        It will be reloaded if option_add is called.rr�Nr�r�rrr�option_clear�szMisc.option_clearcCs|j�dd|j||�S)z�Return the value for an option NAME for this widget
        with CLASSNAME.

        Values with higher priority override lower values.rr�r�)rerY�	classNamerrr�
option_get�szMisc.option_getcCs|j�dd||�dS)zvRead file FILENAME into the option database.

        An optional second parameter gives the numeric
        priority.rZreadfileNr�)reZfileNamerrrr�option_readfile�szMisc.option_readfilecKs,d|kr|j|d<|j�d|�|��dS)zClear the current X selection.r�)�	selectionr�Nr�r�rrr�selection_clear�s
zMisc.selection_clearcKsvd|kr|j|d<d|kr`|jdkr`z d|d<|j�d|�|��WStk
r^|d=YnX|j�d|�|��S)a�Return the contents of the current X selection.

        A keyword parameter selection specifies the name of
        the selection and defaults to PRIMARY.  A keyword
        parameter displayof specifies a widget on the display
        to use. A keyword parameter type specifies the form of data to be
        fetched, defaulting to STRING except on X11, where UTF8_STRING is tried
        before STRING.r�r r�r�)rr�)r�r�r2r�r�r�r�rrr�
selection_get�s	
zMisc.selection_getcKs.|�|�}|j�d|�|�|j|f�dS)aSpecify a function COMMAND to call if the X
        selection owned by this widget is queried by another
        application.

        This function must return the contents of the
        selection. The function will be called with the
        arguments OFFSET and LENGTH which allows the chunking
        of very long selections. The following keyword
        parameters can be provided:
        selection - name of the selection (default PRIMARY),
        type - type of the selection (e.g. STRING, FILE_NAME).)rZhandleN)r�r2r�r�r�)re�commandr�rYrrr�selection_handle�s
�zMisc.selection_handlecKs"|j�d|�|�|jf�dS)z�Become owner of X selection.

        A keyword parameter selection specifies the name of
        the selection (default PRIMARY).�rZownN)r2r�r�r�r�rrr�
selection_own�s
��zMisc.selection_owncKs:d|kr|j|d<|j�d|�|��}|s0dS|�|�S)z�Return owner of X selection.

        The following keyword parameter can
        be provided:
        selection - name of the selection (default PRIMARY),
        type - type of the selection (e.g. STRING, FILE_NAME).r�rN)r�r2r�r�r�)rer�rYrrr�selection_own_get�s
zMisc.selection_own_getcGs|j�d||f|�S)zDSend Tcl command CMD to different interpreter INTERP to be executed.�sendr�)reZinterp�cmdr�rrrr�sz	Misc.sendcCs|j�d|j|�dS)z(Lower this widget in the stacking order.�lowerNr�)re�	belowThisrrrr�sz
Misc.lowercCs|j�d|j|�dS)z(Raise this widget in the stacking order.�raiseNr�)re�	aboveThisrrr�tkraiseszMisc.tkraisecCs(d|�|�|f}|j�|j�|��S)z*Return integer which represents atom NAME.)�winfoZatom)r�r2r�r�)rerYr�r�rrr�
winfo_atomszMisc.winfo_atomcCs d|�|�|f}|j�|�S)z'Return name of atom with identifier ID.)rZatomname�r�r2r��rer�r�r�rrr�winfo_atomnames��zMisc.winfo_atomnamecCs|j�|j�dd|j��S)z7Return number of cells in the colormap for this widget.rZcells�r2r�r�r�r�rrr�winfo_cellss�zMisc.winfo_cellsc	CsRg}|j�|j�dd|j��D].}z|�|�|��Wqtk
rJYqXq|S)z?Return a list of all widgets which are children of this widget.r�children)r2r.r�r�rcr��KeyError)re�result�childrrr�winfo_childrens�zMisc.winfo_childrencCs|j�dd|j�S)z(Return window class name of this widget.r�classr�r�rrr�winfo_class#szMisc.winfo_classcCs|j�|j�dd|j��S)z?Return True if at the last color request the colormap was full.rZcolormapfull�r2r�r�r�r�rrr�winfo_colormapfull's�zMisc.winfo_colormapfullcCs4d|�|�||f}|j�|�}|s*dS|�|�S)z@Return the widget which is at the root coordinates ROOTX, ROOTY.)rZ
containingN)r�r2r�r�)reZrootXZrootYr�r�rYrrr�winfo_containing,s��zMisc.winfo_containingcCs|j�|j�dd|j��S)z$Return the number of bits per pixel.rZdepthr r�rrr�winfo_depth4szMisc.winfo_depthcCs|j�|j�dd|j��S)z"Return true if this widget exists.rr}r r�rrr�winfo_exists8s�zMisc.winfo_existscCs|j�|j�dd|j|��S)zWReturn the number of pixels for the given distance NUMBER
        (e.g. "3c") as float.rZfpixels�r2r�r�r��re�numberrrr�
winfo_fpixels=s�zMisc.winfo_fpixelscCs|j�dd|j�S)zFReturn geometry string for this widget in the form "widthxheight+X+Y".r�geometryr�r�rrr�winfo_geometryCszMisc.winfo_geometrycCs|j�|j�dd|j��S)zReturn height of this widget.rrXr r�rrr�winfo_heightGs�zMisc.winfo_heightcCst|j�dd|j�d�S)z%Return identifier ID for this widget.rr�r)rar2r�r�r�rrr�winfo_idLsz
Misc.winfo_idcCs"d|�|�}|j�|j�|��S)z9Return the name of all Tcl interpreters for this display.)rZinterps)r�r2r.r�)rer�r�rrr�
winfo_interpsPszMisc.winfo_interpscCs|j�|j�dd|j��S)z%Return true if this widget is mapped.rZismappedr r�rrr�winfo_ismappedUs�zMisc.winfo_ismappedcCs|j�dd|j�S)z/Return the window manager name for this widget.rZmanagerr�r�rrr�
winfo_managerZszMisc.winfo_managercCs|j�dd|j�S)zReturn the name of this widget.rrYr�r�rrr�
winfo_name^szMisc.winfo_namecCs|j�dd|j�S)z-Return the name of the parent of this widget.r�parentr�r�rrr�winfo_parentbszMisc.winfo_parentcCs d|�|�|f}|j�|�S)z.Return the pathname of the widget given by ID.)r�pathnamerrrrr�winfo_pathnamefs��zMisc.winfo_pathnamecCs|j�|j�dd|j|��S)z'Rounded integer value of winfo_fpixels.rZpixelsr r/rrr�winfo_pixelsls�zMisc.winfo_pixelscCs|j�|j�dd|j��S)z:Return the x coordinate of the pointer on the root window.rZpointerxr r�rrr�winfo_pointerxqs�zMisc.winfo_pointerxcCs|�|j�dd|j��S)zHReturn a tuple of x and y coordinates of the pointer on the root window.rZ	pointerxy��_getintsr2r�r�r�rrr�winfo_pointerxyvs�zMisc.winfo_pointerxycCs|j�|j�dd|j��S)z:Return the y coordinate of the pointer on the root window.rZpointeryr r�rrr�winfo_pointery{s�zMisc.winfo_pointerycCs|j�|j�dd|j��S)z'Return requested height of this widget.rZ	reqheightr r�rrr�winfo_reqheight�s�zMisc.winfo_reqheightcCs|j�|j�dd|j��S)z&Return requested width of this widget.rZreqwidthr r�rrr�winfo_reqwidth�s�zMisc.winfo_reqwidthcCs|�|j�dd|j|��S)zNReturn a tuple of integer RGB values in range(65536) for color in this widget.rZrgbr@)reZcolorrrr�	winfo_rgb�s�zMisc.winfo_rgbcCs|j�|j�dd|j��S)zSReturn x coordinate of upper left corner of this widget on the
        root window.rZrootxr r�rrr�winfo_rootx�s�zMisc.winfo_rootxcCs|j�|j�dd|j��S)zSReturn y coordinate of upper left corner of this widget on the
        root window.rZrootyr r�rrr�winfo_rooty�s�zMisc.winfo_rootycCs|j�dd|j�S)z&Return the screen name of this widget.r�screenr�r�rrr�winfo_screen�szMisc.winfo_screencCs|j�|j�dd|j��S)zTReturn the number of the cells in the colormap of the screen
        of this widget.rZscreencellsr r�rrr�winfo_screencells�s�zMisc.winfo_screencellscCs|j�|j�dd|j��S)z\Return the number of bits per pixel of the root window of the
        screen of this widget.rZscreendepthr r�rrr�winfo_screendepth�s�zMisc.winfo_screendepthcCs|j�|j�dd|j��S)zXReturn the number of pixels of the height of the screen of this widget
        in pixel.rZscreenheightr r�rrr�winfo_screenheight�s�zMisc.winfo_screenheightcCs|j�|j�dd|j��S)zUReturn the number of pixels of the height of the screen of
        this widget in mm.rZscreenmmheightr r�rrr�winfo_screenmmheight�s�zMisc.winfo_screenmmheightcCs|j�|j�dd|j��S)zTReturn the number of pixels of the width of the screen of
        this widget in mm.rZ
screenmmwidthr r�rrr�winfo_screenmmwidth�s�zMisc.winfo_screenmmwidthcCs|j�dd|j�S)z�Return one of the strings directcolor, grayscale, pseudocolor,
        staticcolor, staticgray, or truecolor for the default
        colormodel of this screen.rZscreenvisualr�r�rrr�winfo_screenvisual�szMisc.winfo_screenvisualcCs|j�|j�dd|j��S)zWReturn the number of pixels of the width of the screen of
        this widget in pixel.rZscreenwidthr r�rrr�winfo_screenwidth�s�zMisc.winfo_screenwidthcCs|j�dd|j�S)zxReturn information of the X-Server of the screen of this widget in
        the form "XmajorRminor vendor vendorVersion".rZserverr�r�rrr�winfo_server�szMisc.winfo_servercCs|�|j�dd|j��S)z*Return the toplevel widget of this widget.r�toplevel)r�r2r�r�r�rrr�winfo_toplevel�s

�zMisc.winfo_toplevelcCs|j�|j�dd|j��S)zBReturn true if the widget and all its higher ancestors are mapped.rZviewabler r�rrr�winfo_viewable�s�zMisc.winfo_viewablecCs|j�dd|j�S)z�Return one of the strings directcolor, grayscale, pseudocolor,
        staticcolor, staticgray, or truecolor for the
        colormodel of this widget.r�visualr�r�rrr�winfo_visual�szMisc.winfo_visualcCs|j�dd|j�S)z7Return the X identifier for the visual for this widget.rZvisualidr�r�rrr�winfo_visualid�szMisc.winfo_visualidFcsH�j�dd�j|rdnd�}�fdd��j�|�D�}�fdd�|D�S)z�Return a list of all visuals available for the screen
        of this widget.

        Each item in the list consists of a visual name (see winfo_visual), a
        depth and if includeids is true is given also the X identifier.rZvisualsavailable�
includeidsNcsg|]}�j�|��qSr)r2r.r�r�rrr��sz/Misc.winfo_visualsavailable.<locals>.<listcomp>csg|]}��|��qSr)�_Misc__winfo_parseitemr�r�rrr��s)r2r�r�r.)rerYr�rr�r�winfo_visualsavailable�s

�zMisc.winfo_visualsavailablecCs$|dd�tt|j|dd���S)rNr)rr�_Misc__winfo_getint)rer4rrrZ__winfo_parseitem�szMisc.__winfo_parseitemcCs
t|d�S)rr)ra�rerUrrrZ__winfo_getint�szMisc.__winfo_getintcCs|j�|j�dd|j��S)z�Return the height of the virtual root window associated with this
        widget in pixels. If there is no virtual root window return the
        height of the screen.rZvrootheightr r�rrr�winfo_vrootheight�s�zMisc.winfo_vrootheightcCs|j�|j�dd|j��S)z�Return the width of the virtual root window associated with this
        widget in pixel. If there is no virtual root window return the
        width of the screen.rZ
vrootwidthr r�rrr�winfo_vrootwidth�s�zMisc.winfo_vrootwidthcCs|j�|j�dd|j��S)ziReturn the x offset of the virtual root relative to the root
        window of the screen of this widget.rZvrootxr r�rrr�winfo_vrootxs�zMisc.winfo_vrootxcCs|j�|j�dd|j��S)ziReturn the y offset of the virtual root relative to the root
        window of the screen of this widget.rZvrootyr r�rrr�winfo_vrooty	s�zMisc.winfo_vrootycCs|j�|j�dd|j��S)z Return the width of this widget.rrWr r�rrr�winfo_widths�zMisc.winfo_widthcCs|j�|j�dd|j��S)zVReturn the x coordinate of the upper left corner of this widget
        in the parent.rrUr r�rrr�winfo_xs�zMisc.winfo_xcCs|j�|j�dd|j��S)zVReturn the y coordinate of the upper left corner of this widget
        in the parent.rrVr r�rrr�winfo_ys�zMisc.winfo_ycCs|j�d�dS)zEEnter event loop until all pending events have been processed by Tcl.r!Nr�r�rrrr! szMisc.updatecCs|j�dd�dS)z�Enter event loop until all idle callbacks have been called. This
        will update the display of windows but not process events caused by
        the user.r!Z	idletasksNr�r�rrr�update_idletasks$szMisc.update_idletaskscCs6|dkr |j�|j�d|j��S|j�d|j|�dS)a,Set or get the list of bindtags for this widget.

        With no argument return the list of all bindtags associated with
        this widget. With a list of strings as argument the bindtags are
        set to this list. The bindtags determine in which order events are
        processed (see bind).N�bindtags�r2r.r�r�)reZtagListrrrrf*s
�z
Misc.bindtagsrcCs�t|t�r |j�|||f�nn|rd|�||j|�}d|r>dp@d||jf}|j�|||f�|S|rz|j�||f�S|j�|j�|��SdS)rz"%sif {"[%s %s]" == "break"} break
�+rZN)rrr2r�r��_substitute�_subst_format_strr.)rerp�sequencer�r��needcleanup�funcidrrrr�_bind7s"

�
��z
Misc._bindcCs|�d|jf|||�S)aOBind to this widget at event SEQUENCE a call to function FUNC.

        SEQUENCE is a string of concatenated event
        patterns. An event pattern is of the form
        <MODIFIER-MODIFIER-TYPE-DETAIL> where MODIFIER is one
        of Control, Mod2, M2, Shift, Mod3, M3, Lock, Mod4, M4,
        Button1, B1, Mod5, M5 Button2, B2, Meta, M, Button3,
        B3, Alt, Button4, B4, Double, Button5, B5 Triple,
        Mod1, M1. TYPE is one of Activate, Enter, Map,
        ButtonPress, Button, Expose, Motion, ButtonRelease
        FocusIn, MouseWheel, Circulate, FocusOut, Property,
        Colormap, Gravity Reparent, Configure, KeyPress, Key,
        Unmap, Deactivate, KeyRelease Visibility, Destroy,
        Leave and DETAIL is the button number for ButtonPress,
        ButtonRelease and DETAIL is the Keysym for KeyPress and
        KeyRelease. Examples are
        <Control-Button-1> for pressing Control and mouse button 1 or
        <Alt-A> for pressing A and the Alt key (KeyPress can be omitted).
        An event pattern can also be a virtual event of the form
        <<AString>> where AString can be arbitrary. This
        event can be generated by event_generate.
        If events are concatenated they must appear shortly
        after each other.

        FUNC will be called if the event sequence occurs with an
        instance of Event as argument. If the return value of FUNC is
        "break" no further bound function is invoked.

        An additional boolean parameter ADD specifies whether FUNC will
        be called additionally to the other bound function or whether
        it will replace the previous function.

        Bind will return an identifier to allow deletion of the bound function with
        unbind without memory leak.

        If FUNC or SEQUENCE is omitted the bound function or list
        of bound events are returned.�bind�rnr��rerkr�r�rrrroIs'z	Misc.bindcCs&|j�d|j|d�|r"|�|�dS)zWUnbind for this widget for event SEQUENCE  the
        function identified with FUNCID.rorZN�r2r�r�r�)rerkrmrrr�unbindrszMisc.unbindcCs|�d|||d�S)aBind to all widgets at an event SEQUENCE a call to function FUNC.
        An additional boolean parameter ADD specifies whether FUNC will
        be called additionally to the other bound function or whether
        it will replace the previous function. See bind for the return value.)ro�allr�rnrqrrr�bind_allysz
Misc.bind_allcCs|j�dd|d�dS)z8Unbind for all widgets for event SEQUENCE all functions.rortrZNr�)rerkrrr�
unbind_all�szMisc.unbind_allcCs|�d|f|||d�S)a=Bind to widgets with bindtag CLASSNAME at event
        SEQUENCE a call of function FUNC. An additional
        boolean parameter ADD specifies whether FUNC will be
        called additionally to the other bound function or
        whether it will replace the previous function. See bind for
        the return value.rorru)rer	rkr�r�rrr�
bind_class�szMisc.bind_classcCs|j�d||d�dS)zWUnbind for all widgets with bindtag CLASSNAME for event SEQUENCE
        all functions.rorZNr�)rer	rkrrr�unbind_class�szMisc.unbind_classcCs|j�|�dS)zCall the mainloop of Tk.N)r2r�)rerhrrrr��sz
Misc.mainloopcCs|j��dS)z8Quit the Tcl interpreter. All widgets will be destroyed.N)r2�quitr�rrrrz�sz	Misc.quitcCs"|rtt|jj|j�|���SdSrs)rrr2r�r.�rer�rrrrA�sz
Misc._getintscCs"|rtt|jj|j�|���SdSrs)rrr2r�r.r{rrr�_getdoubles�szMisc._getdoublescCs|r|j�|�SdSrs)r2r�r{rrr�_getboolean�szMisc._getbooleancCs"|rd|fS|dkrd|jfSdS)rr�Nr�r�r�rrrr��s

zMisc._displayofcCsBz|��jWStk
r<|j�dd�}|��_|YSXdS)rr2ZwindowingsystemN)r~Z_windowingsystem_cachedr"r2r�)reZwsrrrr��s�zMisc._windowingsystemcCs�|rt||f�}nt|�}d}|��D]�\}}|dk	r&|ddkrN|dd�}t|�rb|�|�}n^t|ttf�r�g}|D]<}t|t�r�|�t	|��qxt|t	�r�|�t
|��qxq�qxd�|�}|d||f}q&|S)rrN����_rr-)r+r%�callabler�rrrrarcrrr)rer&r�rr)r*Znvrrrrr��s*


z
Misc._optionscCsNt|��d�}|}|ds.|��}|dd�}|D]}|s>qJ|j|}q2|S)zPReturn the Tkinter instance of a widget identified by
        its Tcl name NAME.�.rrN)r�splitr~r")rerY�wrhrrr�nametowidget�szMisc.nametowidgetcCs�t|||�j}tt|��}z
|j}Wntk
r8YnXz||j}Wntk
r\YnX|j�||�|r�|j	dkr�g|_	|j	�
|�|S)z�Return a newly created Tcl function. If this
        function is called, the Python function FUNC will
        be executed. An optional function SUBST can
        be given which will be executed before FUNC.N)r�r�r_r�r�r"rAr2r�r�rc)rer��substrlr�rYrrrr��s 

zMisc._registercCs|}|jr|j}q|S)r�r�)rer�rrrr~sz
Misc._root)z%#z%bz%fz%hz%kz%sz%tz%wz%xz%yz%Az%Ez%Kz%Nz%Wz%Tz%Xz%Yz%Drcs�t|�t|j�kr|S|jj}|jj��fdd�}|\}}}}}}	}
}}}
}}}}}}}}}t�}�|�|_||�|_z||�|_Wnt	k
r�YnX||�|_
||�|_||	�|_||
�|_
||�|_||�|_||
�|_||_z||�|_Wnt	k
�r
YnX||_||�|_zt|�|_Wntk
�rF||_YnXz|�|�|_Wntk
�rt||_YnX||�|_||�|_z�|�|_Wn tt	fk
�r�d|_YnX|fS)rc	s,z
�|�WSttfk
r&|YSXdS)z?Tk changed behavior in 8.4.2, returning "??" rather more often.N)rvr�r��r�rr�getint_events
z&Misc._substitute.<locals>.getint_eventr)r�
_subst_formatr2r�r�rG�serialrSrTr�rXrRrN�timerWrUrVrLrMrQZ
keysym_numr8r rvr��widgetr#Zx_rootZy_rootrP)rer�r�r�Znsign�br��hr)rfr4r�rUrV�A�E�K�N�W�T�X�Y�D�err�rrisT*











zMisc._substitutecCs(t��\}}}|��}|�|||�dSrs)�sys�exc_infor~�report_callback_exception)rer��val�tbrqrrr�_report_exceptionHszMisc._report_exceptioncGs\i}|j�|jj|��D]>}|j�|�}|ddd�f|dd�||ddd�<q|S)z;Call Tcl configure command and return the result as a dict.rrN�r2r.r�)rer�r&rUrrr�
_getconfigureNs
0zMisc._getconfigurecGs2|j�|jj|��}|ddd�f|dd�S)Nrrr�)rer�rUrrr�_getconfigure1VszMisc._getconfigure1cCs�|rt||f�}n|rt|�}|dkr:|�t|j|f��St|t�r^|�t|j|d|f��S|j�t|j|f�|�	|��dS)rNr-)
r+r�rr�rrr�r2r�r�)rerr&r�rrr�
_configureZs
zMisc._configurecKs|�d||�S)z�Configure resources of a widget.

        The values for resources are specified as keyword
        arguments. To get an overview about
        the allowed keyword arguments call the method keys.
        �	configure�r��rer&r�rrrr�gszMisc.configurecCs|j�|jdd|�S)z4Return the resource value for a KEY given as string.�cgetr-r��rer6rrrr�rsz	Misc.cgetcCs|�||i�dSr�)r��rer6r
rrr�__setitem__xszMisc.__setitem__cs*|jj��fdd��|j�|jd��D�S)z3Return a list of all resource names of this widget.cs g|]}�|�ddd��qS)rrNrr�r�rrr�~szMisc.keys.<locals>.<listcomp>r�rgr�rr�rri{s
�z	Misc.keyscCs|jS)z+Return the window path name of this widget.r~r�rrrrF�szMisc.__str__cCsd|jj|jj|jfS)Nz<%s.%s object %s>)r�rBrCr�r�rrrrj�s
�z
Misc.__repr__�_noarg_cCs:|tjkr"|�|j�dd|j��S|j�dd|j|�dS)aSet or get the status for propagation of geometry information.

        A boolean argument specifies whether the geometry information
        of the slaves will determine the size of this widget. If no argument
        is given the current setting will be returned.
        �pack�	propagateN�r�r�r}r2r�r��re�flagrrr�pack_propagate�s

�zMisc.pack_propagatecs(�fdd��j��j�dd�j��D�S)�HReturn a list of all slaves of this widget
        in its packing order.csg|]}��|��qSr�r�r�r�rrr��sz$Misc.pack_slaves.<locals>.<listcomp>r��slavesrgr�rr�r�pack_slaves�s

��zMisc.pack_slavescs(�fdd��j��j�dd�j��D�S)r�csg|]}��|��qSrr�r�r�rrr��sz%Misc.place_slaves.<locals>.<listcomp>�placer�rgr�rr�r�place_slaves�s
���zMisc.place_slavescCs|j�dd|j|�dS)z�The anchor value controls how to place the grid within the
        master when no row/column has any weight.

        The default anchor is nw.�grid�anchorNr�)rer�rrr�grid_anchor�szMisc.grid_anchorcCsZdd|jf}|dk	r(|dk	r(|||f}|dk	rD|dk	rD|||f}|�|jj|��pXdS)a�Return a tuple of integer coordinates for the bounding
        box of this widget controlled by the geometry manager grid.

        If COLUMN, ROW is given the bounding box applies from
        the cell with row and column 0 to the specified
        cell. If COL2 and ROW2 are given the bounding box
        starts at that cell.

        The returned integers specify the offset of the upper left
        corner in the master widget and the width and height.
        r��bboxN)r�rAr2r�)re�column�rowZcol2Zrow2r�rrr�	grid_bbox�szMisc.grid_bboxc	Csht|ttjf�rdz:t|�}|s$WdSd|kr:|j�|�WS|j�|�WSWnttfk
rbYnX|S)Nr�)	rr�_tkinterZTcl_Objr2r�r�rvr�)rer
Zsvaluerrr�_gridconvvalue�szMisc._gridconvvaluecCs�t|t�rJ|sJ|dd�dkr*|dd�}|dd�dkrBd|}|f}n|�||�}|s|t|j|j�d||j|�|jd�S|j�d||j|f|�}t|�dkr�|�|�SdS)rrNr�rr-r�)r3)	rrr�r7r2r�r�r�r)rer�indexr&r��optionsrrrr�_grid_configure�s(���zMisc._grid_configurecKs|�d|||�S)z�Configure column INDEX of a grid.

        Valid resources are minsize (minimum size of the column),
        weight (how much does additional space propagate to this column)
        and pad (how much space to let additionally).�columnconfigure�r��rer�r&r�rrr�grid_columnconfigure�szMisc.grid_columnconfigurec	Cs |�|j�dd|j||��pdS)z�Return a tuple of column and row which identify the cell
        at which the pixel at position X and Y inside the master
        widget is located.r��locationNr@�rerUrVrrr�
grid_location�s���zMisc.grid_locationcCs:|tjkr"|�|j�dd|j��S|j�dd|j|�dS)aSet or get the status for propagation of geometry information.

        A boolean argument specifies whether the geometry information
        of the slaves will determine the size of this widget. If no argument
        is given, the current setting will be returned.
        r�r�Nr�r�rrr�grid_propagates

�zMisc.grid_propagatecKs|�d|||�S)z�Configure row INDEX of a grid.

        Valid resources are minsize (minimum size of the row),
        weight (how much does additional space propagate to this row)
        and pad (how much space to let additionally).�rowconfigurer�r�rrr�grid_rowconfigureszMisc.grid_rowconfigurecCs|�|j�dd|j��pdS)z<Return a tuple of the number of column and rows in the grid.r��sizeNr@r�rrr�	grid_sizes
��zMisc.grid_sizecsZd}|dk	r|d|f}|dk	r,|d|f}�fdd��j��j�dd�jf|��D�S)	r�rNz-rowz-columncsg|]}��|��qSrr�r�r�rrr�(sz$Misc.grid_slaves.<locals>.<listcomp>r�r�rg)rer�r�r�rr�r�grid_slaves s
��zMisc.grid_slavescGsdd|f|}|j�|�dS)z�Bind a virtual event VIRTUAL (of the form <<Name>>)
        to an event SEQUENCE such that the virtual event is triggered
        whenever SEQUENCE occurs.�eventr�Nr��re�virtual�	sequencesr�rrr�	event_add/szMisc.event_addcGsdd|f|}|j�|�dS)z-Unbind a virtual event VIRTUAL from SEQUENCE.r��deleteNr�r�rrr�event_delete6szMisc.event_deletecKsDdd|j|f}|��D]\}}|d|t|�f}q|j�|�dS)z�Generate an event SEQUENCE. Additional
        keyword arguments specify parameter of the event
        (e.g. x, y, rootx, rooty).r�Zgenerate�-%sN)r�r%rr2r�)rerkr�r�r)r*rrr�event_generate;szMisc.event_generatecCs|j�|j�dd|��S)zuReturn a list of all virtual events or the information
        about the SEQUENCE bound to the virtual event VIRTUAL.r�r|r�)rer�rrr�
event_infoDs�zMisc.event_infocCs|j�|j�dd��S)z*Return a list of all existing image names.�image�namesr�r�rrr�image_namesLszMisc.image_namescCs|j�|j�dd��S)z?Return a list of all available image types (e.g. photo bitmap).r��typesr�r�rrr�image_typesPszMisc.image_types)N)r{)N)N)r{r�)r{)N)r)N)N)N)N)r)r)r)r)r)F)N)r)NNN)N)NNN)NNN)r)N)Nr)N)N)NNNN)NN)N)�rArBrCrk�_last_child_idsr�r�r�r�r�r�r�Zwaitvarr�r�r�r�r�r�r�r�rTr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrr
rr
rrrrrrr�liftrrr!r&r(r*r+r,r-r1r3r4r5r6r7r8r9r;r=r>r?rBrCrDrErFrGrHrJrKrLrMrNrOrPrQrRrTrUrWrXr[rZr\r^r_r`rarbrcrdr!rerfrnrorsrvrwrxryr�rzrAr|r}r��propertyr�r�r�r�r��registerr~r�rrjrir�r�r�r�r��configr��__getitem__r�rirFrjr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr�msP
		


)

	
=
	


	r�c@s eZdZdZdd�Zdd�ZdS)r�zwInternal class. Stores function to call when some user
    defined Tcl function is called e.g. after an event occurred.cCs||_||_||_dS)z(Store FUNC, SUBST and WIDGET as members.N)r�r�r�)rer�r�r�rrrr�YszCallWrapper.__init__cGsLz|jr|j|�}|j|�WStk
r2�Yn|j��YnXdS)z3Apply first function SUBST to arguments, than FUNC.N)r�r�rwr�r��rer�rrrr�_s
zCallWrapper.__call__N�rArBrCrkr�r�rrrrr�Usr�c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�XViewzXMix-in class for querying and changing the horizontal position
    of a widget's window.cGs(|jj|jdf|��}|s$|�|�SdS)z5Query and change the horizontal position of the view.�xviewN�r2r�r�r|�rer�rrrrr�oszXView.xviewcCs|j�|jdd|�dS)zsAdjusts the view in the window so that FRACTION of the
        total width of the canvas is off-screen to the left.r��movetoNr��re�fractionrrr�xview_movetouszXView.xview_movetocCs|j�|jdd||�dS)z\Shift the x-view according to NUMBER which is measured in "units"
        or "pages" (WHAT).r��scrollNr��rer0rprrr�xview_scrollzszXView.xview_scrollN)rArBrCrkr�r�r�rrrrr�ksr�c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�YViewzVMix-in class for querying and changing the vertical position
    of a widget's window.cGs(|jj|jdf|��}|s$|�|�SdS)z3Query and change the vertical position of the view.�yviewNr�r�rrrr��szYView.yviewcCs|j�|jdd|�dS)zsAdjusts the view in the window so that FRACTION of the
        total height of the canvas is off-screen to the top.r�r�Nr�r�rrr�yview_moveto�szYView.yview_movetocCs|j�|jdd||�dS)z\Shift the y-view according to NUMBER which is measured in
        "units" or "pages" (WHAT).r�r�Nr�r�rrr�yview_scroll�szYView.yview_scrollN)rArBrCrkr�r�r�rrrrr��sr�c@s�eZdZdZdBdd�ZeZdd�ZeZdCdd�ZeZ	d	d
�Z
e
ZdDdd�ZeZ
d
d�ZeZdEdd�ZeZdd�ZeZdd�ZeZdFdd�ZeZdGdd�ZeZdHdd�ZeZdIdd�ZeZdd�ZeZdJdd �Z e Z!dKd!d"�Z"e"Z#dLd$d%�Z$e$Z%dMd&d'�Z&e&Z'dNd(d)�Z(e(Z)d*d+�Z*e*Z+dOd,d-�Z,e,Z-dPd.d/�Z.e.Z/dQd0d1�Z0e0Z1dRd2d3�Z2e2Z3dSd4d5�Z4e4Z5dTd6d7�Z6e6Z7dUd8d9�Z8e8Z9dVd:d;�Z:e:Z;dWd<d=�Z<e<Z=dXd>d?�Z>e>Z?d@dA�Z@e@ZAdS)Y�WmzAProvides functions for the communication with the window manager.NcCs |�|j�dd|j||||��S)z�Instruct the window manager to set the aspect ratio (width/height)
        of this widget to be between MINNUMER/MINDENOM and MAXNUMER/MAXDENOM. Return a tuple
        of the actual values if no argument is given.�wm�aspectr@)reZminNumerZminDenomZmaxNumerZmaxDenomrrr�	wm_aspect�s��zWm.wm_aspectcGsdd|jf|}|j�|�S)a�This subcommand returns or sets platform specific attributes

        The first form returns a list of the platform specific flags and
        their values. The second form returns the value for the specific
        option. The third form sets one or more of the values. The values
        are as follows:

        On Windows, -disabled gets or sets whether the window is in a
        disabled state. -toolwindow gets or sets the style of the window
        to toolwindow (as defined in the MSDN). -topmost gets or sets
        whether this is a topmost window (displays above all other
        windows).

        On Macintosh, XXXXX

        On Unix, there are currently no special attribute values.
        r��
attributes)r�r2r�r�rrr�
wm_attributes�szWm.wm_attributescCs|j�dd|j|�S)zVStore NAME in WM_CLIENT_MACHINE property of this widget. Return
        current value.r��clientr�r�rrr�	wm_client�szWm.wm_clientcsZt|�dkr|f}dd�jf|}|r4�j�|�n"�fdd��j��j�|��D�SdS)z�Store list of window names (WLIST) into WM_COLORMAPWINDOWS property
        of this widget. This list contains windows whose colormaps differ from their
        parents. Return current list of widgets if WLIST is empty.rr��colormapwindowscsg|]}��|��qSrr�r�r�rrr��s�z)Wm.wm_colormapwindows.<locals>.<listcomp>N)rr�r2r�r.)reZwlistr�rr�r�wm_colormapwindows�s
�zWm.wm_colormapwindowscCs|j�dd|j|�S)z�Store VALUE in WM_COMMAND property. It is the command
        which shall be used to invoke the application. Return current
        command if VALUE is None.r�rr�r�rrr�
wm_command�sz
Wm.wm_commandcCs|j�dd|j�S)z�Deiconify this widget. If it was never mapped it will not be mapped.
        On Windows it will raise this widget and give it the focus.r��	deiconifyr�r�rrr�wm_deiconify�szWm.wm_deiconifycCs|j�dd|j|�S)z�Set focus model to MODEL. "active" means that this widget will claim
        the focus itself, "passive" means that the window manager shall give
        the focus. Return current focus model if MODEL is None.r��
focusmodelr�)reZmodelrrr�
wm_focusmodel�szWm.wm_focusmodelcCs|j�dd|�dS)aAThe window will be unmapped from the screen and will no longer
        be managed by wm. toplevel windows will be treated like frame
        windows once they are no longer managed by wm, however, the menu
        option configuration will be remembered and the menus will return
        once the widget is managed again.r��forgetNr�r�rrr�	wm_forget�szWm.wm_forgetcCs|j�dd|j�S)zAReturn identifier for decorative frame of this widget if present.r��framer�r�rrr�wm_frame�szWm.wm_framecCs|j�dd|j|�S)ziSet geometry to NEWGEOMETRY of the form =widthxheight+x+y. Return
        current value if None is given.r�r2r�)reZnewGeometryrrr�wm_geometry�szWm.wm_geometrycCs |�|j�dd|j||||��S)aInstruct the window manager that this widget shall only be
        resized on grid boundaries. WIDTHINC and HEIGHTINC are the width and
        height of a grid unit in pixels. BASEWIDTH and BASEHEIGHT are the
        number of grid units requested in Tk_GeometryRequest.r�r�r@)reZ	baseWidthZ
baseHeightZwidthIncZ	heightIncrrr�wm_grids
�z
Wm.wm_gridcCs|j�dd|j|�S)z~Set the group leader widgets for related widgets to PATHNAME. Return
        the group leader of this widget if None is given.r��groupr��reZpathNamerrr�wm_group
szWm.wm_groupcCs2|r|j�dd|jd|�S|j�dd|j|�SdS)a�Set bitmap for the iconified widget to BITMAP. Return
        the bitmap if None is given.

        Under Windows, the DEFAULT parameter can be used to set the icon
        for the widget and any descendents that don't have an icon set
        explicitly.  DEFAULT can be the relative path to a .ico file
        (example: root.iconbitmap(default='myicon.ico') ).  See Tk
        documentation for more information.r��
iconbitmap�-defaultNr�)re�bitmap�defaultrrr�
wm_iconbitmaps	zWm.wm_iconbitmapcCs|j�dd|j�S)zDisplay widget as icon.r��iconifyr�r�rrr�
wm_iconify$sz
Wm.wm_iconifycCs|j�dd|j|�S)zVSet mask for the icon bitmap of this widget. Return the
        mask if None is given.r��iconmaskr�)rerrrr�wm_iconmask*szWm.wm_iconmaskcCs|j�dd|j|�S)zSSet the name of the icon for this widget. Return the name if
        None is given.r��iconnamer�)reZnewNamerrr�wm_iconname1szWm.wm_iconnameFcGs<|r |jjdd|jdf|��n|jjdd|jf|��dS)a�Sets the titlebar icon for this window based on the named photo
        images passed through args. If default is True, this is applied to
        all future created toplevels as well.

        The data in the images is taken as a snapshot at the time of
        invocation. If the images are later changed, this is not reflected
        to the titlebar icons. Multiple images are accepted to allow
        different images sizes to be provided. The window manager may scale
        provided icons to an appropriate size.

        On Windows, the images are packed into a Windows icon structure.
        This will override an icon specified to wm_iconbitmap, and vice
        versa.

        On X, the images are arranged into the _NET_WM_ICON X property,
        which most modern window managers support. An icon specified by
        wm_iconbitmap may exist simultaneously.

        On Macintosh, this currently does nothing.r��	iconphotorNr�)rerr�rrr�wm_iconphoto8szWm.wm_iconphotoc	Cs|�|j�dd|j||��S)z�Set the position of the icon of this widget to X and Y. Return
        a tuple of the current values of X and X if None is given.r��iconpositionr@r�rrr�wm_iconpositionSs
�zWm.wm_iconpositioncCs|j�dd|j|�S)zgSet widget PATHNAME to be displayed instead of icon. Return the current
        value if None is given.r��
iconwindowr�r
rrr�
wm_iconwindow[szWm.wm_iconwindowcCs|j�dd|�dS)z�The widget specified will become a stand alone top-level window.
        The window will be decorated with the window managers title bar,
        etc.r��manageNr�)rer�rrr�	wm_managebszWm.wm_managec	Cs|�|j�dd|j||��S)z�Set max WIDTH and HEIGHT for this widget. If the window is gridded
        the values are given in grid units. Return the current values if None
        is given.r��maxsizer@�rerWrXrrr�
wm_maxsizejs
�z
Wm.wm_maxsizec	Cs|�|j�dd|j||��S)z�Set min WIDTH and HEIGHT for this widget. If the window is gridded
        the values are given in grid units. Return the current values if None
        is given.r��minsizer@r#rrr�
wm_minsizess
�z
Wm.wm_minsizecCs|�|j�dd|j|��S)z�Instruct the window manager to ignore this widget
        if BOOLEAN is given with 1. Return the current value if None
        is given.r��overrideredirect)r}r2r�r�r�rrr�wm_overrideredirect|s
�zWm.wm_overrideredirectcCs|j�dd|j|�S)z�Instruct the window manager that the position of this widget shall
        be defined by the user if WHO is "user", and by its own policy if WHO is
        "program".r��positionfromr��reZwhorrr�wm_positionfrom�szWm.wm_positionfromcCs.t|�r|�|�}n|}|j�dd|j||�S)z�Bind function FUNC to command NAME for this widget.
        Return the function bound to NAME if None is given. NAME could be
        e.g. "WM_SAVE_YOURSELF" or "WM_DELETE_WINDOW".r��protocol)r�r�r2r�r�)rerYr�rrrr�wm_protocol�s�zWm.wm_protocolcCs|j�dd|j||�S)zyInstruct the window manager whether this width can be resized
        in WIDTH or HEIGHT. Both values are boolean values.r��	resizabler�r#rrr�wm_resizable�szWm.wm_resizablecCs|j�dd|j|�S)z�Instruct the window manager that the size of this widget shall
        be defined by the user if WHO is "user", and by its own policy if WHO is
        "program".r��sizefromr�r*rrr�wm_sizefrom�szWm.wm_sizefromcCs|j�dd|j|�S)z�Query or set the state of this widget as one of normal, icon,
        iconic (see wm_iconwindow), withdrawn, or zoomed (Windows only).r�rNr�)reZnewstaterrr�wm_state�szWm.wm_statecCs|j�dd|j|�S)zSet the title of this widget.r��titler�r{rrr�wm_title�szWm.wm_titlecCs|j�dd|j|�S)z_Instruct the window manager that this widget is transient
        with regard to widget MASTER.r��	transientr�)rer�rrr�wm_transient�szWm.wm_transientcCs|j�dd|j�S)z�Withdraw this widget from the screen such that it is unmapped
        and forgotten by the window manager. Re-draw it with wm_deiconify.r��withdrawr�r�rrr�wm_withdraw�szWm.wm_withdraw)NNNN)N)N)N)N)NNNN)N)NN)N)N)F)NN)N)NN)NN)N)N)NN)NN)N)N)N)N)BrArBrCrkr�r�r�r�r�r�rr�rrrrrrrrr	rr
r2rr�rrrrrrrrrrrrrrrrr!r r$r"r&r%r(r'r+r)r-r,r/r.r1r0r2rNr4r3r6r5r8r7rrrrr��s��





�

















r�c@sNeZdZdZdZddd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�ZdS)rozzToplevel widget of Tk which represents mostly the main window
    of an application. It has an associated Tcl interpreter.r�Nrrc

Cs�d|_i|_d|_d|_|dkrZddl}|j�tjd�}|j�	|�\}}|dkrZ||}d}	t
�||||	t|||�|_|r�|�
�tjjs�|�||�dS)a@Return a new Toplevel widget on screen SCREENNAME. A new Tcl interpreter will
        be created. BASENAME will be used for the identification of the profile file (see
        readprofile).
        It is constructed from sys.argv[0] without extensions if None is given. CLASSNAME
        is the name of the widget class.NFr)z.pyz.pyc)r�r"�	_tkloadedr2�os�path�basenamer��argv�splitextr��create�wantobjects�_loadtk�flags�ignore_environment�readprofile)
re�
screenName�baseNamer	�useTk�syncZuser:Zext�interactiverrrr��s zTk.__init__cCs|js|j��|��dSr�)r9r2�loadtkrAr�rrrrJ�s
z	Tk.loadtkcCs�d|_|j�d�}|tjkr.tdtj|f��t|j�d��}|tjkrZtdtj|f��|jdkrjg|_|j�	dt
�|j�	dt�|j�d�|j�d�t
r�ts�|a|�d|j�dS)	NT�
tk_versionz4tk.h version (%s) doesn't match libtk.a version (%s)�tcl_versionz6tcl.h version (%s) doesn't match libtcl.a version (%s)Ztkerror�exit�WM_DELETE_WINDOW)r9r2r�r��
TK_VERSIONr/r�TCL_VERSIONr�r�ruryrcrlrmr,r�)rerKrLrrrrA�s(
�
�
z
Tk._loadtkcCsJt|j���D]}|��q|j�d|j�t�|�trFt	|krFda	dS)zhDestroy this and all descendants widgets. This will
        end the application of this Tcl interpreter.r�N)
rr"�valuesr�r2r�r�r�rlrm�rer'rrrr�	s

z
Tk.destroyc
Cs�ddl}d|jkr|jd}n|j}|j�|d|�}|j�|d|�}|j�|d|�}|j�|d|�}d|i}	td|	�|j�|�r�|j�d|�|j�|�r�tt	|��
�|	�|j�|�r�|j�d|�|j�|�r�tt	|��
�|	�dS)	z�Internal function. It reads BASENAME.tcl and CLASSNAME.tcl into
        the Tcl Interpreter and calls exec on the contents of BASENAME.py and
        CLASSNAME.py if such a file exists in the home directory.rN�HOMEz.%s.tclz.%s.pyrezfrom tkinter import *�source)r:�environ�curdirr;r�exec�isfiler2r��open�read)
rerFr	r:�homeZ	class_tclZclass_pyZbase_tclZbase_py�dirrrrrD	s$

zTk.readprofilecCs:ddl}tdtjd�|t_|t_|t_|�|||�dS)z�Report callback exception on sys.stderr.

        Applications may want to override this internal function, and
        should when sys.stderr is None.rNzException in Tkinter callback)�file)�	tracebackr$r��stderr�	last_type�
last_value�last_traceback�print_exception)rer�r�r�r^rrrr�$	szTk.report_callback_exceptioncCst|j|�S)z3Delegate attribute access to the interpreter object)r`r2)re�attrrrr�__getattr__0	szTk.__getattr__)NNrorrN)rArBrCrkr�r�rJrAr�rDr�rerrrrro�s�

rocCst||||�Sr�)ro)rErFr	rGrrr�TclC	srfc@sTeZdZdZifdd�ZeZZZdd�ZeZ	dd�Z
e
Zej
ZZ
ejZZdS)	�PackzQGeometry manager Pack.

    Base class to use the methods pack_* in every widget.cKs$|j�dd|jf|�||��dS)a(Pack a widget in the parent widget. Use as options:
        after=widget - pack it after you have packed widget
        anchor=NSEW (or subset) - position widget according to
                                  given direction
        before=widget - pack it before you will pack widget
        expand=bool - expand widget if parent size grows
        fill=NONE or X or Y or BOTH - fill widget if widget grows
        in=master - use master to contain this widget
        in_=master - see 'in' option description
        ipadx=amount - add internal padding in x direction
        ipady=amount - add internal padding in y direction
        padx=amount - add padding in x direction
        pady=amount - add padding in y direction
        side=TOP or BOTTOM or LEFT or RIGHT -  where to add this widget.
        r�r�N�r2r�r�r�r�rrr�pack_configureL	s


��zPack.pack_configurecCs|j�dd|j�dS)z:Unmap this widget and do not use it for the packing order.r�rNr�r�rrr�pack_forgetb	szPack.pack_forgetcCs8t|j|j�dd|j��}d|kr4|�|d�|d<|S)zEReturn information about the packing options
        for this widget.r�r|�in�r7r2r�r�r��re�drrr�	pack_infoh	szPack.pack_infoN)rArBrCrkrir�r�r�rjrror|r�r�r�r�r�rrrrrgG	s
rgc@sJeZdZdZifdd�ZeZZZdd�ZeZ	dd�Z
e
Zej
ZZ
dS)	�PlacezSGeometry manager Place.

    Base class to use the methods place_* in every widget.cKs$|j�dd|jf|�||��dS)a Place a widget in the parent widget. Use as options:
        in=master - master relative to which the widget is placed
        in_=master - see 'in' option description
        x=amount - locate anchor of this widget at position x of master
        y=amount - locate anchor of this widget at position y of master
        relx=amount - locate anchor of this widget between 0.0 and 1.0
                      relative to width of master (1.0 is right edge)
        rely=amount - locate anchor of this widget between 0.0 and 1.0
                      relative to height of master (1.0 is bottom edge)
        anchor=NSEW (or subset) - position anchor according to given direction
        width=amount - width of this widget in pixel
        height=amount - height of this widget in pixel
        relwidth=amount - width of this widget between 0.0 and 1.0
                          relative to width of master (1.0 is the same width
                          as the master)
        relheight=amount - height of this widget between 0.0 and 1.0
                           relative to height of master (1.0 is the same
                           height as the master)
        bordermode="inside" or "outside" - whether to take border width of
                                           master widget into account
        r�r�Nrhr�rrr�place_configurez	s


��zPlace.place_configurecCs|j�dd|j�dS)�Unmap this widget.r�rNr�r�rrr�place_forget�	szPlace.place_forgetcCs8t|j|j�dd|j��}d|kr4|�|d�|d<|S)zEReturn information about the placing options
        for this widget.r�r|rkrlrmrrr�
place_info�	szPlace.place_infoN)rArBrCrkrqr�r�r�rsrrtr|r�r�r�rrrrrpu	srpc@s�eZdZdZifdd�ZeZZZej	Z
Z	ejZZdd�Z
e
Zdd�Zdd	�ZeZejZZejZZejZZejZZejZZd
S)�GridzQGeometry manager Grid.

    Base class to use the methods grid_* in every widget.cKs$|j�dd|jf|�||��dS)aPosition a widget in the parent widget in a grid. Use as options:
        column=number - use cell identified with given column (starting with 0)
        columnspan=number - this widget will span several columns
        in=master - use master to contain this widget
        in_=master - see 'in' option description
        ipadx=amount - add internal padding in x direction
        ipady=amount - add internal padding in y direction
        padx=amount - add padding in x direction
        pady=amount - add padding in y direction
        row=number - use cell identified with given row (starting with 0)
        rowspan=number - this widget will span several rows
        sticky=NSEW - if cell is larger on which sides will this
                      widget stick to the cell boundary
        r�r�Nrhr�rrr�grid_configure�	s


��zGrid.grid_configurecCs|j�dd|j�dS)rrr�rNr�r�rrr�grid_forget�	szGrid.grid_forgetcCs|j�dd|j�dS)z0Unmap this widget but remember the grid options.r�r�Nr�r�rrr�grid_remove�	szGrid.grid_removecCs8t|j|j�dd|j��}d|kr4|�|d�|d<|S)zSReturn information about the options
        for positioning this widget in a grid.r�r|rkrlrmrrr�	grid_info�	szGrid.grid_infoN)rArBrCrkrvr�r�r�r�r�r�r�r�rwrrxryr|r�r�r�r�r�r�r�r�r�r�rrrrru�	s





ruc@s:eZdZdZdd�Ziidfdd�Zdd�Zdd	d
�ZdS)
�
BaseWidgetzInternal class.cCs�|s
t�}||_|j|_d}d|kr2|d}|d=|s�|jj��}|jdkrRi|_|j�|d�d}||j|<|dkr�d|f}nd||f}||_|j	dkr�d||_	n|j	d||_	i|_
|j|jj
kr�|jj
|j��||jj
|j<dS)z6Internal function. Sets up information about children.NrYrrz!%sz!%s%dr�)rrr�r2r�rArr�r�r�r�r"r�)rer�r&rY�countrrr�_setup�	s2


zBaseWidget._setuprc	Cs�|rt||f�}||_t�|||�|jdkr4g|_dd�|��D�}|D]\}}||=qJ|j�||jf||�	|��|D]\}}|�
||�q~dS)zdConstruct a widget with the parent widget MASTER, a name WIDGETNAME
        and appropriate options.NcSs"g|]\}}t|t�r||f�qSr)rr rIrrrr�	
s
z'BaseWidget.__init__.<locals>.<listcomp>)r+�
widgetNamerzr|r�r%r2r�r�r�r�)	rer�r}r&r��extra�classesr)r*rrrr�
s
�zBaseWidget.__init__cCsTt|j���D]}|��q|j�d|j�|j|jjkrF|jj|j=t	�|�dS)z)Destroy this and all descendants widgets.r�N)
rr"rQr�r2r�r�r�r�r�rRrrrr�
s
zBaseWidget.destroycCs|j�|j|f|�Sr�r�)rerYr�rrr�_do
szBaseWidget._doN)r)rArBrCrkr|r�r�r�rrrrrz�	s
rzc@seZdZdZdS)�WidgetzxInternal class.

    Base class for a widget which can be positioned with the geometry managers
    Pack, Place or Grid.N)rArBrCrkrrrrr�
sr�c@seZdZdZdifdd�ZdS)�Toplevelz"Toplevel widget, e.g. for dialogs.Nc	Ks�|rt||f�}d}dD]L}||kr||}|ddkrJd|dd�}nd|}|||f}||=qt�||d|i|�|��}|�|���|�|���|�d|j�dS)	a%Construct a toplevel widget with the parent MASTER.

        Valid resource names: background, bd, bg, borderwidth, class,
        colormap, container, cursor, height, highlightbackground,
        highlightcolor, highlightthickness, menu, relief, screen, takefocus,
        use, visual, width.r)rI�class_r'rVZcolormaprr�r-NrSrN)r+rzr�r~rr3r,r�)	rer�r&r�r~Zwmkeyr��optrqrrrr�)
s zToplevel.__init__�rArBrCrkr�rrrrr�&
sr�c@s.eZdZdZdifdd�Zdd�Zdd�ZdS)	rDzButton widget.NcKst�||d||�dS)aUConstruct a button widget with the parent MASTER.

        STANDARD OPTIONS

            activebackground, activeforeground, anchor,
            background, bitmap, borderwidth, cursor,
            disabledforeground, font, foreground
            highlightbackground, highlightcolor,
            highlightthickness, image, justify,
            padx, pady, relief, repeatdelay,
            repeatinterval, takefocus, text,
            textvariable, underline, wraplength

        WIDGET-SPECIFIC OPTIONS

            command, compound, default, height,
            overrelief, state, width
        ZbuttonN�r�r��rer�r&r�rrrr�G
szButton.__init__cCs|j�|jd�dS)a_Flash the button.

        This is accomplished by redisplaying
        the button several times, alternating between active and
        normal colors. At the end of the flash the button is left
        in the same normal/active state as when the command was
        invoked. This command is ignored if the button's state is
        disabled.
        �flashNr�r�rrrr�\
s
zButton.flashcCs|j�|jd�S)aInvoke the command associated with the button.

        The return value is the return value from the command,
        or an empty string if there is no command associated with
        the button. This command is ignored if the button's state
        is disabled.
        �invoker�r�rrrr�h
sz
Button.invoke)rArBrCrkr�r�r�rrrrrDD
srDc@seZdZdZdifdd�Zdd�Zdd�Zd	d
�Zdd�Zdwd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dxdd�Zdydd�Zdzdd�Zd{dd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dAdB�Z#d|dCdD�Z$dEdF�Z%dGdH�Z&dIdJ�Z'dKdL�Z(dMdN�Z)dOdP�Z*dQdR�Z+dSdT�Z,dUdV�Z-d}dWdX�Z.e.Z/dYdZ�Z0e0Z1d[d\�Z2d~d^d_�Z3ifd`da�Z4dbdc�Z5e5Z6Z7ddde�Z8dfdg�Z9ddidj�Z:dkdl�Z;dmdn�Z<dodp�Z=dqdr�Z>dsdt�Z?dudv�Z@dS)��Canvasz?Canvas widget to display graphical elements like lines or text.NcKst�||d||�dS)aConstruct a canvas widget with the parent MASTER.

        Valid resource names: background, bd, bg, borderwidth, closeenough,
        confine, cursor, height, highlightbackground, highlightcolor,
        highlightthickness, insertbackground, insertborderwidth,
        insertofftime, insertontime, insertwidth, offset, relief,
        scrollregion, selectbackground, selectborderwidth, selectforeground,
        state, takefocus, width, xscrollcommand, xscrollincrement,
        yscrollcommand, yscrollincrement.ZcanvasNr�r�rrrr�v
s
zCanvas.__init__cGs|j�|jdf|�dS)r�addtagNr�r�rrrr��
sz
Canvas.addtagcCs|�|d|�dS)z*Add tag NEWTAG to all items above TAGORID.�aboveN�r��re�newtag�tagOrIdrrr�addtag_above�
szCanvas.addtag_abovecCs|�|d�dS)zAdd tag NEWTAG to all items.rtNr�)rer�rrr�
addtag_all�
szCanvas.addtag_allcCs|�|d|�dS)z*Add tag NEWTAG to all items below TAGORID.�belowNr�r�rrr�addtag_below�
szCanvas.addtag_belowcCs|�|d||||�dS)z�Add tag NEWTAG to item which is closest to pixel at X, Y.
        If several match take the top-most.
        All items closer than HALO are considered overlapping (all are
        closests). If START is specified the next below this tag is taken.�closestNr�)rer�rUrV�halo�startrrr�addtag_closest�
szCanvas.addtag_closestcCs|�|d||||�dS)zLAdd tag NEWTAG to all items in the rectangle defined
        by X1,Y1,X2,Y2.�enclosedNr��rer��x1�y1�x2�y2rrr�addtag_enclosed�
szCanvas.addtag_enclosedcCs|�|d||||�dS)zWAdd tag NEWTAG to all items which overlap the rectangle
        defined by X1,Y1,X2,Y2.�overlappingNr�r�rrr�addtag_overlapping�
szCanvas.addtag_overlappingcCs|�|d|�dS)z)Add tag NEWTAG to all items with TAGORID.�withtagNr�r�rrr�addtag_withtag�
szCanvas.addtag_withtagcGs |�|j�|jdf|��pdS)z|Return a tuple of X1,Y1,X2,Y2 coordinates for a rectangle
        which encloses all items with tags specified as arguments.r�Nr@r�rrrr��
s
��zCanvas.bboxcCs(|j�|jd||d�|r$|�|�dS)zbUnbind for all items with TAGORID for event SEQUENCE  the
        function identified with FUNCID.rorZNrr)rer�rkrmrrr�
tag_unbind�
szCanvas.tag_unbindcCs|�|jd|f|||�S)a&Bind to all items with TAGORID at event SEQUENCE a call to function FUNC.

        An additional boolean parameter ADD specifies whether FUNC will be
        called additionally to the other bound function or whether it will
        replace the previous function. See bind for the return value.rorp)rer�rkr�r�rrr�tag_bind�
s
�zCanvas.tag_bindcCs|j�|j�|jd||��S)zrReturn the canvas x coordinate of pixel position SCREENX rounded
        to nearest multiple of GRIDSPACING units.�canvasxr.)reZscreenx�gridspacingrrrr��
s�zCanvas.canvasxcCs|j�|j�|jd||��S)zrReturn the canvas y coordinate of pixel position SCREENY rounded
        to nearest multiple of GRIDSPACING units.�canvasyr.)reZscreenyr�rrrr��
s�zCanvas.canvasycs,�fdd��j��j��jdf|��D�S)z8Return a list of coordinates for the item given in ARGS.csg|]}�j�|��qSr)r2r�r�r�rrr��
sz!Canvas.coords.<locals>.<listcomp>�coordsrgr�rr�rr��
s

��z
Canvas.coordsc	Cs\t|�}|d}t|ttf�r,|dd�}ni}|j�|jj|jd|f||�||����S)rrNr?)	rrrrr2r�r�r�r�)re�itemTyper�r�r&rrr�_create�
s��zCanvas._createcOs|�d||�S)z6Create arc shaped region with coordinates x1,y1,x2,y2.Zarc�r�r�rrr�
create_arc�
szCanvas.create_arccOs|�d||�S)z%Create bitmap with coordinates x1,y1.rr�r�rrr�
create_bitmap�
szCanvas.create_bitmapcOs|�d||�S)z)Create image item with coordinates x1,y1.r�r�r�rrr�create_image�
szCanvas.create_imagecOs|�d||�S)z-Create line with coordinates x1,y1,...,xn,yn.�liner�r�rrr�create_line�
szCanvas.create_linecOs|�d||�S)z)Create oval with coordinates x1,y1,x2,y2.Zovalr�r�rrr�create_oval�
szCanvas.create_ovalcOs|�d||�S)z0Create polygon with coordinates x1,y1,...,xn,yn.Zpolygonr�r�rrr�create_polygon�
szCanvas.create_polygoncOs|�d||�S)z.Create rectangle with coordinates x1,y1,x2,y2.Z	rectangler�r�rrr�create_rectangle�
szCanvas.create_rectanglecOs|�d||�S)z#Create text with coordinates x1,y1.�textr�r�rrr�create_text�
szCanvas.create_textcOs|�d||�S)z+Create window with coordinates x1,y1,x2,y2.r�r�r�rrr�
create_window�
szCanvas.create_windowcGs|j�|jdf|�dS)z�Delete characters of text items identified by tag or id in ARGS (possibly
        several times) from FIRST to LAST character (including).�dcharsNr�r�rrrr�sz
Canvas.dcharscGs|j�|jdf|�dS)z<Delete items identified by all tag or ids contained in ARGS.r�Nr�r�rrrr�sz
Canvas.deletecGs|j�|jdf|�dS)ziDelete tag or id given as last arguments in ARGS from items
        identified by first argument in ARGS.�dtagNr�r�rrrr�	szCanvas.dtagcGs |�|j�|jdf|��pdS)r�findrr@r�rrrr�s
��zCanvas.findcCs|�d|�S)zReturn items above TAGORID.r��r��rer�rrr�
find_aboveszCanvas.find_abovecCs
|�d�S)zReturn all items.rtr�r�rrr�find_allszCanvas.find_allcCs|�d|�S)zReturn all items below TAGORID.r�r�r�rrr�
find_belowszCanvas.find_belowcCs|�d||||�S)z�Return item which is closest to pixel at X, Y.
        If several match take the top-most.
        All items closer than HALO are considered overlapping (all are
        closest). If START is specified the next below this tag is taken.r�r�)rerUrVr�r�rrr�find_closestszCanvas.find_closestcCs|�d||||�S)z=Return all items in rectangle defined
        by X1,Y1,X2,Y2.r�r��rer�r�r�r�rrr�
find_enclosed&szCanvas.find_enclosedcCs|�d||||�S)zLReturn all items which overlap the rectangle
        defined by X1,Y1,X2,Y2.r�r�r�rrr�find_overlapping+szCanvas.find_overlappingcCs|�d|�S)zReturn all items with TAGORID.r�r�r�rrr�find_withtag0szCanvas.find_withtagcGs|j�|jdf|�S)z.Set focus to the first item specified in ARGS.rTr�r�rrrrT4szCanvas.focuscGs|j�|j�|jdf|��S)z=Return tags associated with the first item specified in ARGS.�gettagsrgr�rrrr�8s�zCanvas.gettagscGs|j�|jdf|�dS)zdSet cursor at position POS in the item identified by TAGORID.
        In ARGS TAGORID must be first.�icursorNr�r�rrrr�=szCanvas.icursorcGs|j�|j�|jdf|��S)z?Return position of cursor as integer in item specified in ARGS.r�r r�rrrr�BszCanvas.indexcGs|j�|jdf|�dS)zSInsert TEXT in item TAGORID at position POS. ARGS must
        be TAGORID POS TEXT.�insertNr�r�rrrr�Fsz
Canvas.insertcCs|j�|jdf|d|f�S)z9Return the resource value for an OPTION for item TAGORID.�itemcgetr-r�)rer�rrrrr�Ks�zCanvas.itemcgetcKs|�d|f||�S)z�Configure resources of an item TAGORID.

        The values for resources are specified as keyword
        arguments. To get an overview about
        the allowed keyword arguments call the method without arguments.
        �
itemconfigurer��rer�r&r�rrrr�PszCanvas.itemconfigurecGs|j�|jdf|�dS)zJLower an item TAGORID given in ARGS
        (optional below another item).rNr�r�rrr�	tag_lower_szCanvas.tag_lowercGs|j�|jdf|�dS)z#Move an item TAGORID given in ARGS.�moveNr�r�rrrr�fszCanvas.moverZcCs|j�|jd|||�dS)a}Move the items given by TAGORID in the canvas coordinate
        space so that the first coordinate pair of the bottommost
        item with tag TAGORID is located at position (X,Y).
        X and Y may be the empty string, in which case the
        corresponding coordinate will be unchanged. All items matching
        TAGORID remain in the same positions relative to each other.r�Nr�)rer�rUrVrrrr�jsz
Canvas.movetocKs|j�|jdf|�||��S)z�Print the contents of the canvas to a postscript
        file. Valid options: colormap, colormode, file, fontmap,
        height, pageanchor, pageheight, pagewidth, pagex, pagey,
        rotate, width, x, y.�
postscriptrhr�rrrr�ss
�zCanvas.postscriptcGs|j�|jdf|�dS)zJRaise an item TAGORID given in ARGS
        (optional above another item).rNr�r�rrr�	tag_raise{szCanvas.tag_raisecGs|j�|jdf|�dS)z9Scale item TAGORID with XORIGIN, YORIGIN, XSCALE, YSCALE.�scaleNr�r�rrrr��szCanvas.scalecCs|j�|jdd||�dS�z&Remember the current X, Y coordinates.�scan�markNr�r�rrr�	scan_mark�szCanvas.scan_mark�
cCs|j�|jdd|||�dS)z�Adjust the view of the canvas to GAIN times the
        difference between X and Y and the coordinates given in
        scan_mark.r��dragtoNr�)rerUrVZgainrrr�scan_dragto�szCanvas.scan_dragtocCs|j�|jdd||�dS)zLAdjust the end of the selection near the cursor of an item TAGORID to index.�select�adjustNr��rer�r�rrr�
select_adjust�szCanvas.select_adjustcCs|j�|jdd�dS)�,Clear the selection if it is in this widget.r�r�Nr�r�rrr�select_clear�szCanvas.select_clearcCs|j�|jdd||�dS)z:Set the fixed end of a selection in item TAGORID to INDEX.r��fromNr�r�rrr�select_from�szCanvas.select_fromcCs|j�|jdd�pdS)z(Return the item which has the selection.r�rNr�r�rrr�select_item�szCanvas.select_itemcCs|j�|jdd||�dS)z=Set the variable end of a selection in item TAGORID to INDEX.r��toNr�r�rrr�	select_to�szCanvas.select_tocCs|j�|jd|�pdS)z$Return the type of the item TAGORID.r Nr�r�rrrr �szCanvas.type)NN)N)NNN)N)N)NN)N)rZrZ)r�)ArArBrCrkr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rTr�r�r�r�r�r��
itemconfigr�rr�r�r�r�r�rr�r�r�r�r�r�r�r�r rrrrr�s
sz


	



	
	
r�c@sFeZdZdZdifdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�Checkbuttonz7Checkbutton widget which is either in on- or off-state.NcKst�||d||�dS)aConstruct a checkbutton widget with the parent MASTER.

        Valid resource names: activebackground, activeforeground, anchor,
        background, bd, bg, bitmap, borderwidth, command, cursor,
        disabledforeground, fg, font, foreground, height,
        highlightbackground, highlightcolor, highlightthickness, image,
        indicatoron, justify, offvalue, onvalue, padx, pady, relief,
        selectcolor, selectimage, state, takefocus, text, textvariable,
        underline, variable, width, wraplength.�checkbuttonNr�r�rrrr��s
zCheckbutton.__init__cCs|j�|jd�dS�zPut the button in off-state.�deselectNr�r�rrrr��szCheckbutton.deselectcCs|j�|jd�dS�zFlash the button.r�Nr�r�rrrr��szCheckbutton.flashcCs|j�|jd�S�z<Toggle the button and invoke a command if given as resource.r�r�r�rrrr��szCheckbutton.invokecCs|j�|jd�dS�zPut the button in on-state.r�Nr�r�rrrr��szCheckbutton.selectcCs|j�|jd�dS)zToggle the button.�toggleNr�r�rrrr��szCheckbutton.toggle)
rArBrCrkr�r�r�r�r�r�rrrrr��sr�c@s�eZdZdZdifdd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZeZ
dd�ZeZdd�ZeZdd�ZeZdd�ZeZdd�ZeZdS) �Entryz1Entry widget which allows displaying simple text.NcKst�||d||�dS)aConstruct an entry widget with the parent MASTER.

        Valid resource names: background, bd, bg, borderwidth, cursor,
        exportselection, fg, font, foreground, highlightbackground,
        highlightcolor, highlightthickness, insertbackground,
        insertborderwidth, insertofftime, insertontime, insertwidth,
        invalidcommand, invcmd, justify, relief, selectbackground,
        selectborderwidth, selectforeground, show, state, takefocus,
        textvariable, validate, validatecommand, vcmd, width,
        xscrollcommand.�entryNr�r�rrrr��szEntry.__init__cCs|j�|jd||�dS)z.Delete text from FIRST to LAST (not included).r�Nr��re�firstZlastrrrr��szEntry.deletecCs|j�|jd�S)zReturn the text.r�r�r�rrrr��sz	Entry.getcCs|j�|jd|�dS)zInsert cursor at INDEX.r�Nr��rer�rrrr��sz
Entry.icursorcCs|j�|j�|jd|��S)zReturn position of cursor.r�r r�rrrr��s
�zEntry.indexcCs|j�|jd||�dS)zInsert STRING at INDEX.r�Nr�)rer�r�rrrr��szEntry.insertcCs|j�|jdd|�dSr�r�r]rrrr��szEntry.scan_markcCs|j�|jdd|�dS)z�Adjust the view of the canvas to 10 times the
        difference between X and Y and the coordinates given in
        scan_mark.r�r�Nr�r]rrrr��szEntry.scan_dragtocCs|j�|jdd|�dS)z9Adjust the end of the selection near the cursor to INDEX.rr�Nr�r�rrr�selection_adjust�szEntry.selection_adjustcCs|j�|jdd�dS)r�rr�Nr�r�rrrr
szEntry.selection_clearcCs|j�|jdd|�dS)�*Set the fixed end of a selection to INDEX.rr�Nr�r�rrr�selection_fromszEntry.selection_fromcCs|j�|j�|jdd��S)zSReturn True if there are characters selected in the entry, False
        otherwise.r�presentr)r�rrr�selection_presents�zEntry.selection_presentcCs|j�|jdd||�dS)�3Set the selection from START to END (not included).r�rangeNr��rer��endrrr�selection_rangeszEntry.selection_rangecCs|j�|jdd|�dS)�-Set the variable end of a selection to INDEX.rr�Nr�r�rrr�selection_toszEntry.selection_to)N)rArBrCrkr�r�r�r�r�r�r�r�r�r�r
r�r�r�r�Zselect_presentr�Zselect_ranger�r�rrrrr��s*
r�c@seZdZdZdifdd�ZdS)�FramezFFrame widget which may contain other widgets and can have a 3D border.NcKs^t||f�}d}d|kr,d|df}|d=nd|krFd|df}|d=t�||d|i|�dS)aConstruct a frame widget with the parent MASTER.

        Valid resource names: background, bd, bg, borderwidth, class,
        colormap, container, cursor, height, highlightbackground,
        highlightcolor, highlightthickness, relief, takefocus, visual, width.rr�z-classr'rN)r+r�r�)rer�r&r�r~rrrr�&szFrame.__init__r�rrrrr�#sr�c@seZdZdZdifdd�ZdS)�Labelz0Label widget which can display text and bitmaps.NcKst�||d||�dS)a�Construct a label widget with the parent MASTER.

        STANDARD OPTIONS

            activebackground, activeforeground, anchor,
            background, bitmap, borderwidth, cursor,
            disabledforeground, font, foreground,
            highlightbackground, highlightcolor,
            highlightthickness, image, justify,
            padx, pady, relief, takefocus, text,
            textvariable, underline, wraplength

        WIDGET-SPECIFIC OPTIONS

            height, state, width

        �labelNr�r�rrrr�:szLabel.__init__r�rrrrr�7sr�c@s�eZdZdZdifdd�Zdd�Zdd�Zd	d
�Zd)dd�Zd*d
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZeZd+dd�ZeZdd �ZeZd,d!d"�ZeZd#d$�Zd%d&�Zd-d'd(�ZeZdS).�Listboxz3Listbox widget which can display a list of strings.NcKst�||d||�dS)a�Construct a listbox widget with the parent MASTER.

        Valid resource names: background, bd, bg, borderwidth, cursor,
        exportselection, fg, font, foreground, height, highlightbackground,
        highlightcolor, highlightthickness, relief, selectbackground,
        selectborderwidth, selectforeground, selectmode, setgrid, takefocus,
        width, xscrollcommand, yscrollcommand, listvariable.ZlistboxNr�r�rrrr�RszListbox.__init__cCs|j�|jd|�dS)z"Activate item identified by INDEX.�activateNr�r�rrrr\szListbox.activatecCs|�|j�|jd|��pdS)zxReturn a tuple of X1,Y1,X2,Y2 coordinates for a rectangle
        which encloses the item identified by the given index.r�Nr@r�rrrr�`szListbox.bboxcCs|�|j�|jd��pdS)z.Return the indices of currently selected item.�curselectionrr@r�rrrreszListbox.curselectioncCs|j�|jd||�dS)z+Delete items from FIRST to LAST (included).r�Nr�r�rrrr�iszListbox.deletecCs:|dk	r$|j�|j�|jd||��S|j�|jd|�SdS)z0Get list of items from FIRST to LAST (included).Nr�rgr�rrrr�ms�zListbox.getcCs*|j�|jd|�}|dkrdS|j�|�S)z+Return index of item identified with INDEX.r�r�N�r2r�r�r��rer�rgrrrr�usz
Listbox.indexcGs|j�|jd|f|�dS)zInsert ELEMENTS at INDEX.r�Nr�)rer��elementsrrrr�{szListbox.insertcCs|j�|j�|jd|��S)z5Get index of item which is nearest to y coordinate Y.�nearestr )rerVrrrrs
�zListbox.nearestcCs|j�|jdd||�dSr�r�r�rrrr��szListbox.scan_markcCs|j�|jdd||�dS)z�Adjust the view of the listbox to 10 times the
        difference between X and Y and the coordinates given in
        scan_mark.r�r�Nr�r�rrrr��szListbox.scan_dragtocCs|j�|jd|�dS)z"Scroll such that INDEX is visible.�seeNr�r�rrrr�szListbox.seecCs|j�|jdd|�dS)z-Set the fixed end oft the selection to INDEX.rr�Nr�r�rrr�selection_anchor�szListbox.selection_anchorcCs|j�|jdd||�dS)z2Clear the selection from FIRST to LAST (included).rr�Nr�r�rrrr
�s
�zListbox.selection_clearcCs|j�|j�|jdd|��S)z.Return True if INDEX is part of the selection.rZincludesr)r�rrr�selection_includes�s�zListbox.selection_includescCs|j�|jdd||�dS)ziSet the selection from FIRST to LAST (included) without
        changing the currently selected elements.rr�Nr�r�rrr�
selection_set�szListbox.selection_setcCs|j�|j�|jd��S)z-Return the number of elements in the listbox.r�r r�rrrr��szListbox.sizecCs|j�|jdf|d|f�S)z4Return the resource value for an ITEM and an OPTION.r�r-r��rer�rrrrr��s�zListbox.itemcgetcKs|�d|f||�S)a9Configure resources of an ITEM.

        The values for resources are specified as keyword arguments.
        To get an overview about the allowed keyword arguments
        call the method without arguments.
        Valid resource names: background, bg, foreground, fg,
        selectbackground, selectforeground.r�r�r�rrrr��szListbox.itemconfigure)N)N)N)N)N)rArBrCrkr�rr�rr�r�r�r�rr�r�rrZ
select_anchorr
r�rZselect_includesr	Z
select_setr�r�r�r�rrrrr�Os2






r�c@seZdZdZdifdd�Zd6dd�Zdd	�Zifd
d�Zifdd
�Zifdd�Z	ifdd�Z
ifdd�Zifdd�Zifdd�Z
ifdd�Zifdd�Zifdd�Zifdd�Zifd d!�Zd7d"d#�Zd$d%�Zd8d&d'�ZeZd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�ZdS)9�MenuzPMenu widget which allows displaying menu bars, pull-down menus and pop-up menus.NcKst�||d||�dS)aAConstruct menu widget with the parent MASTER.

        Valid resource names: activebackground, activeborderwidth,
        activeforeground, background, bd, bg, borderwidth, cursor,
        disabledforeground, fg, font, foreground, postcommand, relief,
        selectcolor, takefocus, tearoff, tearoffcommand, title, type.�menuNr�r�rrrr��sz
Menu.__init__rZcCs|j�d|j|||�dS)z/Post the menu at position X,Y with entry ENTRY.�tk_popupNr�)rerUrVr�rrrr
�sz
Menu.tk_popupcCs|j�|jd|�dS)zActivate entry at INDEX.rNr�r�rrrr�sz
Menu.activatecKs$|j�|jd|f|�||��dS)rr�Nrh)rer�r&r�rrrr��s
�zMenu.addcKs|�d|p|�dS)zAdd hierarchical menu item.�cascadeN�r�r�rrr�add_cascade�szMenu.add_cascadecKs|�d|p|�dS)zAdd checkbutton menu item.r�Nrr�rrr�add_checkbutton�szMenu.add_checkbuttoncKs|�d|p|�dS)zAdd command menu item.rNrr�rrr�add_command�szMenu.add_commandcKs|�d|p|�dS)zAddd radio menu item.�radiobuttonNrr�rrr�add_radiobutton�szMenu.add_radiobuttoncKs|�d|p|�dS)zAdd separator.�	separatorNrr�rrr�
add_separator�szMenu.add_separatorcKs&|j�|jd||f|�||��dS)rr�Nrh)rer�r�r&r�rrrr��s
�zMenu.insertcKs|�|d|p|�dS)z$Add hierarchical menu item at INDEX.rN�r�r�rrr�insert_cascade�szMenu.insert_cascadecKs|�|d|p|�dS)z#Add checkbutton menu item at INDEX.r�Nrr�rrr�insert_checkbutton�szMenu.insert_checkbuttoncKs|�|d|p|�dS)zAdd command menu item at INDEX.rNrr�rrr�insert_command�szMenu.insert_commandcKs|�|d|p|�dS)zAddd radio menu item at INDEX.rNrr�rrr�insert_radiobutton
szMenu.insert_radiobuttoncKs|�|d|p|�dS)zAdd separator at INDEX.rNrr�rrr�insert_separator
szMenu.insert_separatorcCs�|dkr|}|�|�|�|�}}|dks2|dkr:d\}}t||d�D]0}d|�|�krHt|�|d��}|rH|�|�qH|j�|jd||�dS)z7Delete menu items between INDEX1 and INDEX2 (included).N)rrrrr�)	r�r��entryconfigr�	entrycgetr�r2r�r�)re�index1�index2Z
num_index1Z
num_index2rgr'rrrr�	
szMenu.deletecCs|j�|jd|d|�S)z=Return the resource value of a menu item for OPTION at INDEX.rr-r�r
rrrr
szMenu.entrycgetcKs|�d|f||�S)zConfigure a menu item at INDEX.�entryconfigurer�r�rrrr!
szMenu.entryconfigurecCs*|j�|jd|�}|dkrdS|j�|�S)z4Return the index of a menu item identified by INDEX.r�r�Nrrrrrr�#
sz
Menu.indexcCs|j�|jd|�S)zRInvoke a menu item identified by INDEX and execute
        the associated command.r�r�r�rrrr�)
szMenu.invokecCs|j�|jd||�dS)zDisplay a menu at position X,Y.�postNr�r�rrrr".
sz	Menu.postcCs|j�|jd|�S)z*Return the type of the menu item at INDEX.r r�r�rrrr 2
sz	Menu.typecCs|j�|jd�dS)z
Unmap a menu.�unpostNr�r�rrrr#6
szMenu.unpostcCs|j�|j�|jd|��S)zNReturn the x-position of the leftmost pixel of the menu item
        at INDEX.�	xpositionr r�rrrr$:
szMenu.xpositioncCs|j�|j�|jd|��S)zEReturn the y-position of the topmost pixel of the menu item at INDEX.�	ypositionr r�rrrr%?
s
�zMenu.yposition)rZ)N)N)rArBrCrkr�r
rr�rrrrrr�rrrrrr�rr!rr�r�r"r r#r$r%rrrrr�s6	


rc@seZdZdZdifdd�ZdS)�
Menubuttonz(Menubutton widget, obsolete since Tk8.0.NcKst�||d||�dS)N�
menubuttonr�r�rrrr�H
szMenubutton.__init__r�rrrrr&E
sr&c@seZdZdZdifdd�ZdS)�MessagezKMessage widget to display multiline text. Obsolete since Label does it too.NcKst�||d||�dS)N�messager�r�rrrr�O
szMessage.__init__r�rrrrr(L
sr(c@s>eZdZdZdifdd�Zdd�Zdd�Zd	d
�Zdd�ZdS)
�RadiobuttonzGRadiobutton widget which shows only one of several buttons in on-state.NcKst�||d||�dS)a�Construct a radiobutton widget with the parent MASTER.

        Valid resource names: activebackground, activeforeground, anchor,
        background, bd, bg, bitmap, borderwidth, command, cursor,
        disabledforeground, fg, font, foreground, height,
        highlightbackground, highlightcolor, highlightthickness, image,
        indicatoron, justify, padx, pady, relief, selectcolor, selectimage,
        state, takefocus, text, textvariable, underline, value, variable,
        width, wraplength.rNr�r�rrrr�V
s
zRadiobutton.__init__cCs|j�|jd�dSr�r�r�rrrr�b
szRadiobutton.deselectcCs|j�|jd�dSr�r�r�rrrr�g
szRadiobutton.flashcCs|j�|jd�Sr�r�r�rrrr�k
szRadiobutton.invokecCs|j�|jd�dSr�r�r�rrrr�o
szRadiobutton.select)	rArBrCrkr�r�r�r�r�rrrrr*S
sr*c@s@eZdZdZdifdd�Zdd�Zdd�Zd
d	d
�Zdd�ZdS)�Scalez1Scale widget which can display a numerical scale.NcKst�||d||�dS)a�Construct a scale widget with the parent MASTER.

        Valid resource names: activebackground, background, bigincrement, bd,
        bg, borderwidth, command, cursor, digits, fg, font, foreground, from,
        highlightbackground, highlightcolor, highlightthickness, label,
        length, orient, relief, repeatdelay, repeatinterval, resolution,
        showvalue, sliderlength, sliderrelief, state, takefocus,
        tickinterval, to, troughcolor, variable, width.r�Nr�r�rrrr�w
s	zScale.__init__c
CsJ|j�|jd�}z|j�|�WStttfk
rD|j�|�YSXdS)z*Get the current value as integer or float.r�N)r2r�r�r�rvr#r�r�r�rrrr��
s
z	Scale.getcCs|j�|jd|�dS)zSet the value to VALUE.r�Nr�r�rrrr��
sz	Scale.setcCs|�|j�|jd|��S)z�Return a tuple (X,Y) of the point along the centerline of the
        trough that corresponds to VALUE or the current value if None is
        given.r�r@r�rrrr��
szScale.coordscCs|j�|jd||�S)zcReturn where the point X,Y lies. Valid return values are "slider",
        "though1" and "though2".�identifyr�r�rrrr,�
szScale.identify)N)	rArBrCrkr�r�r�r�r,rrrrr+t
s
r+c@sPeZdZdZdifdd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�	Scrollbarz?Scrollbar widget which displays a slider at a certain position.NcKst�||d||�dS)alConstruct a scrollbar widget with the parent MASTER.

        Valid resource names: activebackground, activerelief,
        background, bd, bg, borderwidth, command, cursor,
        elementborderwidth, highlightbackground,
        highlightcolor, highlightthickness, jump, orient,
        relief, repeatdelay, repeatinterval, takefocus,
        troughcolor, width.Z	scrollbarNr�r�rrrr��
s	zScrollbar.__init__cCs|j�|jd|�pdS)a�Marks the element indicated by index as active.
        The only index values understood by this method are "arrow1",
        "slider", or "arrow2".  If any other value is specified then no
        element of the scrollbar will be active.  If index is not specified,
        the method returns the name of the element that is currently active,
        or None if no element is active.rNr�r�rrrr�
szScrollbar.activatecCs|j�|j�|jd||��S)znReturn the fractional change of the scrollbar setting if it
        would be moved by DELTAX or DELTAY pixels.rPr.)reZdeltaxZdeltayrrrrP�
s�zScrollbar.deltacCs|j�|j�|jd||��S)zRReturn the fractional value which corresponds to a slider
        position of X,Y.r�r.r�rrrr��
szScrollbar.fractioncCs|j�|jd||�S)zYReturn the element under position X,Y as one of
        "arrow1","slider","arrow2" or "".r,r�r�rrrr,�
szScrollbar.identifycCs|�|j�|jd��S)zZReturn the current fractional values (upper and lower end)
        of the slider position.r�)r|r2r�r�r�rrrr��
sz
Scrollbar.getcCs|j�|jd||�dS)ziSet the fractional values of the slider position (upper and
        lower ends as value between 0 and 1).r�Nr�r�rrrr��
sz
Scrollbar.set)N)rArBrCrkr�rrPr�r,r�r�rrrrr-�
s
	r-c@s�eZdZdZdifdd�Zdd�Zdd�Zd	d
�Zdkdd�Zdld
d�Z	dd�Z
dmdd�Zdd�Zdndd�Z
dd�Zdd�Zdd�Zdd�Zdodd �Zd!d"�Zdpd#d$�Zifd%d&�Zd'd(�Zd)d*�Zd+d,�Zdqd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zifd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dAdB�Z#drdCdD�Z$dEdF�Z%dGdH�Z&dsdIdJ�Z'dtdKdL�Z(dMdN�Z)dudOdP�Z*e*Z+dQdR�Z,dvdSdT�Z-dwdUdV�Z.dxdWdX�Z/dydYdZ�Z0dzd[d\�Z1d]d^�Z2d{d_d`�Z3dadb�Z4d|dcdd�Z5e5Z6ifdedf�Z7dgdh�Z8didj�Z9dS)}�Textz4Text widget which can display text in various forms.NcKst�||d||�dS)a�Construct a text widget with the parent MASTER.

        STANDARD OPTIONS

            background, borderwidth, cursor,
            exportselection, font, foreground,
            highlightbackground, highlightcolor,
            highlightthickness, insertbackground,
            insertborderwidth, insertofftime,
            insertontime, insertwidth, padx, pady,
            relief, selectbackground,
            selectborderwidth, selectforeground,
            setgrid, takefocus,
            xscrollcommand, yscrollcommand,

        WIDGET-SPECIFIC OPTIONS

            autoseparators, height, maxundo,
            spacing1, spacing2, spacing3,
            state, tabs, undo, width, wrap,

        r�Nr�r�rrrr��
sz
Text.__init__cCs|�|j�|jd|��pdS)z�Return a tuple of (x,y,width,height) which gives the bounding
        box of the visible part of the character at the given index.r�Nr@r�rrrr��
s
��z	Text.bboxc	Cs|j�|j�|jd|||��S)z�Return whether between index INDEX1 and index INDEX2 the
        relation OP is satisfied. OP is one of <, <=, ==, >=, >, or !=.�comparer))rer�opr rrrr/�
s�zText.comparecGsVdd�|D�}|||g7}|jj|jdf|��p2d}|dk	rNt|�dkrN|fS|SdS)a�Counts the number of relevant things between the two indices.
        If index1 is after index2, the result will be a negative number
        (and this holds for each of the possible options).

        The actual items which are counted depends on the options given by
        args. The result is a list of integers, one for the result of each
        counting option given. Valid counting options are "chars",
        "displaychars", "displayindices", "displaylines", "indices",
        "lines", "xpixels" and "ypixels". There is an additional possible
        option "update", which if given then all subsequent options ensure
        that any possible out of date information is recalculated.cSsg|]}|�d�sd|�qS)r-r�)�
startswith)rJ�argrrrr�s
zText.count.<locals>.<listcomp>r{N�)r2r�r�r)rerr r�rrrrr{�
sz
Text.countcCs6|dkr |j�|j�|jd��S|j�|jd|�dS)zjTurn on the internal consistency checks of the B-Tree inside the text
        widget according to BOOLEAN.N�debugr)r�rrrr4	sz
Text.debugcCs|j�|jd||�dS)z?Delete the characters between INDEX1 and INDEX2 (not included).r�Nr��rerr rrrr�szText.deletecCs|�|j�|jd|��S)z�Return tuple (x,y,width,height,baseline) giving the bounding box
        and baseline position of the visible part of the line containing
        the character at INDEX.�	dlineinfor@r�rrrr6szText.dlineinfoc
	Ks�g}d}d}|s$g}|fdd�}|}zzt|t�s>|�|�}}|d|g7}|D]}	||	rN|�d|	�qN|�|�|r�|�|�|jj|jdf|��|W�S|r�|�|�XdS)a�Return the contents of the widget between index1 and index2.

        The type of contents returned in filtered based on the keyword
        parameters; if 'all', 'image', 'mark', 'tag', 'text', or 'window' are
        given and true, then the corresponding items are returned. The result
        is a list of triples of the form (key, value, index). If none of the
        keywords are true then 'all' is used by default.

        If the 'command' argument is given, it is called once for each element
        of the list of triples, with the values of each triple serving as the
        arguments to the function. In this case the list is not returned.NcSs|�|||f�dSr�)rc)r6r
r�r$rrr�
append_triple/sz Text.dump.<locals>.append_triplez-commandr-�dump)r�rrr�rcr2r�r�)
rerr rr�r�Z	func_namer$r7r6rrrr8s*


z	Text.dumpcGs|jj|jdf|��S)arInternal method

        This method controls the undo mechanism and
        the modified flag. The exact behavior of the
        command depends on the option argument that
        follows the edit argument. The following forms
        of the command are currently supported:

        edit_modified, edit_redo, edit_reset, edit_separator
        and edit_undo

        �editr�r�rrrr9Bs
z	Text.editcCs|�d|�S)a;Get or Set the modified flag

        If arg is not specified, returns the modified
        flag of the widget. The insert, delete, edit undo and
        edit redo commands or the user can set or clear the
        modified flag. If boolean is specified, sets the
        modified flag of the widget to arg.
        Zmodified�r9)rer2rrr�
edit_modifiedQs	zText.edit_modifiedcCs
|�d�S)aRedo the last undone edit

        When the undo option is true, reapplies the last
        undone edits provided no other edits were done since
        then. Generates an error when the redo stack is empty.
        Does nothing when the undo option is false.
        Zredor:r�rrr�	edit_redo\szText.edit_redocCs
|�d�S)z(Clears the undo and redo stacks
        �resetr:r�rrr�
edit_resetfszText.edit_resetcCs
|�d�S)znInserts a separator (boundary) on the undo stack.

        Does nothing when the undo option is false
        rr:r�rrr�edit_separatorkszText.edit_separatorcCs
|�d�S)aDUndoes the last edit action

        If the undo option is true. An edit action is defined
        as all the insert and delete commands that are recorded
        on the undo stack in between two separators. Generates
        an error when the undo stack is empty. Does nothing
        when the undo option is false
        Zundor:r�rrr�	edit_undors	zText.edit_undocCs|j�|jd||�S)z5Return the text from INDEX1 to INDEX2 (not included).r�r�r5rrrr�}szText.getcCsJ|dd�dkrd|}|dd�dkr4|dd�}|j�|jdd||�S)z9Return the value of OPTION of an embedded image at INDEX.Nrr-rr�r�r�r�r
rrr�
image_cget�s
zText.image_cgetcKs|�dd|f||�S)z%Configure an embedded image at INDEX.r�r�r�r�rrr�image_configure�szText.image_configurecKs"|jj|jdd|f|�||���S)z"Create an embedded image at INDEX.r�r?rhr�rrr�image_create�s�
�zText.image_createcCs|j�|jdd�S)z3Return all names of embedded images in this widget.r�r�r�r�rrrr��szText.image_namescCst|j�|jd|��S)z1Return the index in the form line.char for INDEX.r�)rr2r�r�r�rrrr��sz
Text.indexcGs|j�|jd||f|�dS)z�Insert CHARS before the characters at INDEX. An additional
        tag can be given in ARGS. Additional CHARS and tags can follow in ARGS.r�Nr�)rer��charsr�rrrr��szText.insertcCs|j�|jdd||f�S)z�Change the gravity of a mark MARKNAME to DIRECTION (LEFT or RIGHT).
        Return the current value if None is given for DIRECTION.r�Zgravityr�)re�markName�	directionrrr�mark_gravity�s�zText.mark_gravitycCs|j�|j�|jdd��S)zReturn all mark names.r�r�rgr�rrr�
mark_names�s
�zText.mark_namescCs|j�|jdd||�dS)z0Set mark MARKNAME before the character at INDEX.r�r�Nr�)rerEr�rrr�mark_set�sz
Text.mark_setcGs|j�|jddf|�dS)zDelete all marks in MARKNAMES.r�ZunsetNr�)reZ	markNamesrrr�
mark_unset�szText.mark_unsetcCs|j�|jdd|�pdS)z-Return the name of the next mark after INDEX.r��nextNr�r�rrr�	mark_next�szText.mark_nextcCs|j�|jdd|�pdS)z2Return the name of the previous mark before INDEX.r�ZpreviousNr�r�rrr�
mark_previous�szText.mark_previouscKs&|jj|jdd|f|�||���dS)aCreates a peer text widget with the given newPathName, and any
        optional standard configuration options. By default the peer will
        have the same start and end line as the parent widget, but
        these can be overridden with the standard configuration options.�peerr?Nrh)reZnewPathNamer&r�rrr�peer_create�s
�zText.peer_createcCs|j�|j�|jdd��S)zYReturns a list of peers of this widget (this does not include
        the widget itself).rNr�rgr�rrr�
peer_names�szText.peer_namescGs |jj|jd|||f|��dS)z�Replaces the range of characters between index1 and index2 with
        the given characters and tags specified by args.

        See the method insert for some more information about args, and the
        method delete for information about the indices.rNr�)rerr rDr�rrrr�szText.replacecCs|j�|jdd||�dSr�r�r�rrrr��szText.scan_markcCs|j�|jdd||�dS)z~Adjust the view of the text to 10 times the
        difference between X and Y and the coordinates given in
        scan_mark.r�r�Nr�r�rrrr��szText.scan_dragtocCs�|jdg}|r|�d�|r&|�d�|r4|�d�|rB|�d�|rP|�d�|
r^|�d�|	rv|�d�|�|	�|r�|d	d
kr�|�d�|�|�|�|�|r�|�|�t|j�t|���S)z�Search PATTERN beginning from INDEX until STOPINDEX.
        Return the index of the first character of a match or an
        empty string.rz	-forwardsz
-backwardsz-exactz-regexpz-nocasez-elidez-countrr-r�)r�rcrr2r�r)rerr�Z	stopindexZforwardsZ	backwards�exactZregexpZnocaser{Zelider�rrrr�s.












zText.searchcCs|j�|jd|�dS)z3Scroll such that the character at INDEX is visible.rNr�r�rrrr�szText.seecGs |j�|jdd||f|�dS)z|Add tag TAGNAME to all characters between INDEX1 and index2 in ARGS.
        Additional pairs of indices may follow in ARGS.�tagr�Nr�)re�tagNamerr�rrr�tag_add�s�zText.tag_addcCs*|j�|jdd||d�|r&|�|�dS)zgUnbind for all characters with TAGNAME for event SEQUENCE  the
        function identified with FUNCID.rRrorZNrr)rerSrkrmrrrr��szText.tag_unbindcCs|�|jdd|f|||�S)a+Bind to all characters with TAGNAME at event SEQUENCE a call to function FUNC.

        An additional boolean parameter ADD specifies whether FUNC will be
        called additionally to the other bound function or whether it will
        replace the previous function. See bind for the return value.rRrorp)rerSrkr�r�rrrr�s
�z
Text.tag_bindcCsJ|dd�dkrd|}|dd�dkr4|dd�}|j�|jdd||�S)z+Return the value of OPTION for tag TAGNAME.Nrr-rr�rRr�r�)rerSrrrr�tag_cget	s
z
Text.tag_cgetcKs|�dd|f||�S)zConfigure a tag TAGNAME.rRr�r�)rerSr&r�rrr�
tag_configureszText.tag_configurecGs|j�|jddf|�dS)zDelete all tags in TAGNAMES.rRr�Nr�)reZtagNamesrrr�
tag_deleteszText.tag_deletecCs|j�|jdd||�dS)z`Change the priority of tag TAGNAME such that it is lower
        than the priority of BELOWTHIS.rRrNr�)rerSrrrrr�szText.tag_lowercCs|j�|j�|jdd|��S)zReturn a list of all tag names.rRr�rgr�rrr�	tag_names s�zText.tag_namesc
Cs |j�|j�|jdd|||��S)z�Return a list of start and end index for the first sequence of
        characters between INDEX1 and INDEX2 which all have tag TAGNAME.
        The text is searched forward from INDEX1.rRZ	nextrangerg�rerSrr rrr�
tag_nextrange%s�zText.tag_nextrangec
Cs |j�|j�|jdd|||��S)z�Return a list of start and end index for the first sequence of
        characters between INDEX1 and INDEX2 which all have tag TAGNAME.
        The text is searched backwards from INDEX1.rRZ	prevrangergrYrrr�
tag_prevrange,s�zText.tag_prevrangecCs|j�|jdd||�dS)zaChange the priority of tag TAGNAME such that it is higher
        than the priority of ABOVETHIS.rRrNr�)rerSrrrrr�3s�zText.tag_raisecCs|j�|j�|jdd|��S)z7Return a list of ranges of text which have tag TAGNAME.rRZrangesrg)rerSrrr�
tag_ranges9s�zText.tag_rangescCs|j�|jdd|||�dS)zARemove tag TAGNAME from all characters between INDEX1 and INDEX2.rRr�Nr�rYrrr�
tag_remove>s�zText.tag_removecCsJ|dd�dkrd|}|dd�dkr4|dd�}|j�|jdd||�S)z:Return the value of OPTION of an embedded window at INDEX.Nrr-rr�r�r�r�r
rrr�window_cgetCs
zText.window_cgetcKs|�dd|f||�S)z&Configure an embedded window at INDEX.r�r�r�r�rrr�window_configureKszText.window_configurecKs&|j�|jdd|f|�||��dS)zCreate a window at INDEX.r�r?Nrhr�rrr�
window_createQs

��zText.window_createcCs|j�|j�|jdd��S)z4Return all names of embedded windows in this widget.r�r�rgr�rrr�window_namesWs�zText.window_namescGs|j�|jddf|�dS)zObsolete function, use see.r�z
-pickplaceNr�)rerprrr�yview_pickplace\szText.yview_pickplace)N)N)NN)N)N)N)N)NNNNNNNN)N)N)N)N)N)N)N)N)N)N):rArBrCrkr�r�r/r{r4r�r6r8r9r;r<r>r?r@r�rArBrCr�r�r�rGrHrIrJrLrMrOrPrr�r�rrrTr�r�rUrVZ
tag_configrWr�rXrZr[r�r\r]r^r_Z
window_configr`rarbrrrrr.�
s~


(




�


	







r.c@s"eZdZdZddd�Zdd�ZdS)�_setitz>Internal class. It wraps the command in the widget OptionMenu.NcCs||_||_||_dSr�)�
_setit__value�_setit__var�_setit__callback)re�varr
r�rrrr�dsz_setit.__init__cGs*|j�|j�|jr&|j|jf|��dSr�)rer�rdrfr�rrrr�isz_setit.__call__)Nr�rrrrrcas
rcc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�
OptionMenuz?OptionMenu which allows the user to select a value from a menu.c
Os�d|dtddd�}t�||d|�d|_t|ddd	�}|_|j|_|�d
�}d
|kr\|d
=|rtt	dt
t|����|j|t
|||�d�|D]}	|j|	t
||	|�d�q�||d<d
S)z�Construct an optionmenu widget with the parent MASTER, with
        the resource textvariable set to VARIABLE, the initially selected
        value VALUE, the other menu values VALUES and an additional
        keyword argument command.r,rr')ZborderwidthZtextvariableZindicatoronZreliefr�Zhighlightthicknessr'Z
tk_optionMenurr)rYZtearoffrzunknown option -)r�rN)ZRAISEDr�r�r}r�_OptionMenu__menur�Zmenunamer�r�rKr0rrc)
rer�r�r
rQ�kwargsr�rr�r*rrrr�rs.�

�
�zOptionMenu.__init__cCs|dkr|jSt�||�S)Nr)rir�r�r�rrrr��szOptionMenu.__getitem__cCst�|�d|_dS)z,Destroy this widget and the associated menu.N)r&r�rir�rrrr��s
zOptionMenu.destroyN)rArBrCrkr�r�r�rrrrrhosrhc@sheZdZdZdZdidfdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
e
Zdd�Zdd�Z
dd�ZdS)�ImagezBase class for images.rNc	Ks�d|_|std�}t|d|�|_|s>tjd7_dtjf}|rT|rTt||f�}n|r\|}d}|��D]*\}}t|�r�|�	|�}|d||f}qh|j�
dd||f|�||_dS)	Nzcreate imager2rz	pyimage%rrr-r�r?)rYrrr`r2rk�_last_idr+r%r�r�r�)	reZimgtyperYr&r�r�r�r)r*rrrr��s$
zImage.__init__cCs|jSr�)rYr�rrrrF��z
Image.__str__cCs6|jr2z|j�dd|j�Wntk
r0YnXdS)Nr�r�)rYr2r�r�r�rrrr��s
z
Image.__del__cCs|j�|jdd||�dS�Nr�r-�r2r�rYr�rrrr��szImage.__setitem__cCs|j�|jdd|�Srnror�rrrr��szImage.__getitem__cKsvd}t|���D]J\}}|dk	r|ddkr8|dd�}t|�rJ|�|�}|d||f}q|j�|jdf|�dS)zConfigure the image.rNrr�r-r�)r+r%r�r�r2r�rY)rer�rr)r*rrrr��s
zImage.configurecCs|j�|j�dd|j��S)zReturn the height of the image.r�rX�r2r�r�rYr�rrrrX�s�zImage.heightcCs|j�dd|j�S)z7Return the type of the image, e.g. "photo" or "bitmap".r�r ror�rrrr �sz
Image.typecCs|j�|j�dd|j��S)zReturn the width of the image.r�rWrpr�rrrrW�s�zImage.width)rArBrCrkrlr�rFr�r�r�r�r�rXr rWrrrrrk�srkc@s�eZdZdZdidfdd�Zdd�Zdd�Zd	d
�Zdd�Zddd�Z	ddd�Z
dd�Zddd�Zddd�Z
dd�Zdd�ZdS) �
PhotoImagez=Widget which can display images in PGM, PPM, GIF, PNG format.NcKstj|d|||f|�dS)ztCreate an image with NAME.

        Valid resource names: data, format, file, gamma, height, palette,
        width.ZphotoN�rkr��rerYr&r�r�rrrr��szPhotoImage.__init__cCs|j�|jd�dS)zDisplay a transparent image.�blankNror�rrrrt�szPhotoImage.blankcCs|j�|jdd|�S)zReturn the value of OPTION.r�r-ro)rerrrrr��szPhotoImage.cgetcCs|j�|jdd|�S)Nr�r-ror�rrrr��szPhotoImage.__getitem__cCs"t|jd�}|j�|d|j�|S)z;Return a new PhotoImage with the same image as this widget.r��copy�rqr2r�rY)re�	destImagerrrru�szPhotoImage.copyrZcCs4t|jd�}|dkr|}|j�|d|jd||�|S)z�Return a new PhotoImage with the same image as this widget
        but zoom it with a factor of x in the X direction and y in the Y
        direction.  If y is not given, the default value is the same as x.
        r�rZruz-zoomrv�rerUrVrwrrr�zoom�s
zPhotoImage.zoomcCs4t|jd�}|dkr|}|j�|d|jd||�|S)z�Return a new PhotoImage based on the same image as this widget
        but use only every Xth or Yth pixel.  If y is not given, the
        default value is the same as x.
        r�rZruz
-subsamplervrxrrr�	subsample�s
zPhotoImage.subsamplecCs|j�|jd||�S)z8Return the color (red, green, blue) of the pixel at X,Y.r�ror�rrrr�	szPhotoImage.getcCsH|jd|f}|r8|ddkr(|dd�}|dt|�}|j�|�dS)zzPut row formatted colors to image starting from
        position TO, e.g. image.put("{red green} {blue yellow}", to=(4,6))�putr�-torN)r|�rYrr2r�)rer�r�r�rrrr{
szPhotoImage.putcCs@|jd|f}|r|d|f}|r0|dt|�}|j�|�dS)zRWrite image to file FILENAME in FORMAT starting from
        position FROM_COORDS.�writez-format)z-fromNr})re�filename�formatZfrom_coordsr�rrrr~szPhotoImage.writec	Cs|j�|j�|jdd||��S)z/Return True if the pixel at x,y is transparent.�transparencyr�)r2r�r�rYr�rrr�transparency_get"s�zPhotoImage.transparency_getcCs|j�|jdd|||�dS)z)Set the transparency of the pixel at x,y.r�r�Nro)rerUrVr�rrr�transparency_set'szPhotoImage.transparency_set)rZ)rZ)N)NN)rArBrCrkr�rtr�r�ruryrzr�r{r~r�r�rrrrrq�s






rqc@s eZdZdZdidfdd�ZdS)�BitmapImagez.Widget which can display images in XBM format.NcKstj|d|||f|�dS)zqCreate a bitmap with NAME.

        Valid resource names: background, data, file, foreground, maskdata, maskfile.rNrrrsrrrr�/szBitmapImage.__init__r�rrrrr�,sr�cCstd�j}|�|�dd��S)Nzuse image_names()r�r��rrr2r.r��r2rrrr�6s
r�cCstd�j}|�|�dd��S)Nzuse image_types()r�r�r�r�rrrr�;s
r�c@s�eZdZdZdifdd�Zdd�Zd+dd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd,d!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�ZdS)-�Spinboxzspinbox widget.NcKst�||d||�dS)a�Construct a spinbox widget with the parent MASTER.

        STANDARD OPTIONS

            activebackground, background, borderwidth,
            cursor, exportselection, font, foreground,
            highlightbackground, highlightcolor,
            highlightthickness, insertbackground,
            insertborderwidth, insertofftime,
            insertontime, insertwidth, justify, relief,
            repeatdelay, repeatinterval,
            selectbackground, selectborderwidth
            selectforeground, takefocus, textvariable
            xscrollcommand.

        WIDGET-SPECIFIC OPTIONS

            buttonbackground, buttoncursor,
            buttondownrelief, buttonuprelief,
            command, disabledbackground,
            disabledforeground, format, from,
            invalidcommand, increment,
            readonlybackground, state, to,
            validate, validatecommand values,
            width, wrap,
        ZspinboxNr�r�rrrr�CszSpinbox.__init__cCs|�|j�|jd|��pdS)a�Return a tuple of X1,Y1,X2,Y2 coordinates for a
        rectangle which encloses the character given by index.

        The first two elements of the list give the x and y
        coordinates of the upper-left corner of the screen
        area covered by the character (in pixels relative
        to the widget) and the last two elements give the
        width and height of the character, in pixels. The
        bounding box may refer to a region outside the
        visible area of the window.
        r�Nr@r�rrrr�`szSpinbox.bboxcCs|j�|jd||�S)aWDelete one or more elements of the spinbox.

        First is the index of the first character to delete,
        and last is the index of the character just after
        the last one to delete. If last isn't specified it
        defaults to first+1, i.e. a single character is
        deleted.  This command returns an empty string.
        r�r�r�rrrr�ns	zSpinbox.deletecCs|j�|jd�S)zReturns the spinbox's stringr�r�r�rrrr�yszSpinbox.getcCs|j�|jd|�S)z�Alter the position of the insertion cursor.

        The insertion cursor will be displayed just before
        the character given by index. Returns an empty string
        r�r�r�rrrr�}szSpinbox.icursorcCs|j�|jd||�S)z{Returns the name of the widget at position x, y

        Return value is one of: none, buttondown, buttonup, entry
        r,r�r�rrrr,�szSpinbox.identifycCs|j�|jd|�S)z;Returns the numerical index corresponding to index
        r�r�r�rrrr��sz
Spinbox.indexcCs|j�|jd||�S)zDInsert string s at index

         Returns an empty string.
        r�r�)rer�rfrrrr��szSpinbox.insertcCs|j�|jd|�S)z�Causes the specified element to be invoked

        The element could be buttondown or buttonup
        triggering the action associated with it.
        r�r��re�elementrrrr��szSpinbox.invokecGs |�|j�|jdf|��pdS)rr�rr@r�rrrr��s
��zSpinbox.scancCs|�d|�S)z�Records x and the current view in the spinbox window;

        used in conjunction with later scan dragto commands.
        Typically this command is associated with a mouse button
        press in the widget. It returns an empty string.
        r��r�r]rrrr��szSpinbox.scan_markcCs|�d|�S)a�Compute the difference between the given x argument
        and the x argument to the last scan mark command

        It then adjusts the view left or right by 10 times the
        difference in x-coordinates. This command is typically
        associated with mouse motion events in the widget, to
        produce the effect of dragging the spinbox at high speed
        through the window. The return value is an empty string.
        r�r�r]rrrr��s
zSpinbox.scan_dragtocGs |�|j�|jdf|��pdS)rrrr@r�rrrr�s
��zSpinbox.selectioncCs|�d|�S)a�Locate the end of the selection nearest to the character
        given by index,

        Then adjust that end of the selection to be at index
        (i.e including but not going beyond index). The other
        end of the selection is made the anchor point for future
        select to commands. If the selection isn't currently in
        the spinbox, then a new selection is created to include
        the characters between index and the most recent selection
        anchor point, inclusive.
        r��rr�rrrr��szSpinbox.selection_adjustcCs
|�d�S)zsClear the selection

        If the selection isn't in this widget then the
        command has no effect.
        r�r�r�rrrr
�szSpinbox.selection_clearcCs|j�|jdd|�S)z�Sets or gets the currently selected element.

        If a spinbutton element is specified, it will be
        displayed depressed.
        rr�r�r�rrr�selection_element�szSpinbox.selection_elementcCs|�d|�dS)r�r�Nr�r�rrrr��szSpinbox.selection_fromcCs|j�|j�|jdd��S)zUReturn True if there are characters selected in the spinbox, False
        otherwise.rr�r)r�rrrr��s�zSpinbox.selection_presentcCs|�d||�dS)r�r�Nr�r�rrrr��szSpinbox.selection_rangecCs|�d|�dS)r�r�Nr�r�rrrr��szSpinbox.selection_to)N)N)rArBrCrkr�r�r�r�r�r,r�r�r�r�r�r�rr�r
r�r�r�r�r�rrrrr�@s*
	
r�c@seZdZdZdifdd�ZdS)�
LabelFramezlabelframe widget.NcKst�||d||�dS)a�Construct a labelframe widget with the parent MASTER.

        STANDARD OPTIONS

            borderwidth, cursor, font, foreground,
            highlightbackground, highlightcolor,
            highlightthickness, padx, pady, relief,
            takefocus, text

        WIDGET-SPECIFIC OPTIONS

            background, class, colormap, container,
            height, labelanchor, labelwidget,
            visual, width
        Z
labelframeNr�r�rrrr��szLabelFrame.__init__r�rrrrr��sr�c@s�eZdZdZdifdd�Zdd�Zdd�ZeZd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd!dd�ZeZdd �ZdS)"�PanedWindowzpanedwindow widget.NcKst�||d||�dS)aTConstruct a panedwindow widget with the parent MASTER.

        STANDARD OPTIONS

            background, borderwidth, cursor, height,
            orient, relief, width

        WIDGET-SPECIFIC OPTIONS

            handlepad, handlesize, opaqueresize,
            sashcursor, sashpad, sashrelief,
            sashwidth, showhandle,
        ZpanedwindowNr�r�rrrr�
szPanedWindow.__init__cKs"|j�|jd|f|�|��dS)a+Add a child widget to the panedwindow in a new pane.

        The child argument is the name of the child widget
        followed by pairs of arguments that specify how to
        manage the windows. The possible options and values
        are the ones accepted by the paneconfigure method.
        r�Nrh)rer%r�rrrr�szPanedWindow.addcCs|j�|jd|�dS)z�Remove the pane containing child from the panedwindow

        All geometry management options for child will be forgotten.
        rNr�)rer%rrrr�'szPanedWindow.removecCs|j�|jd||�S)a�Identify the panedwindow component at point x, y

        If the point is over a sash or a sash handle, the result
        is a two element list containing the index of the sash or
        handle, and a word indicating whether it is over a sash
        or a handle, such as {0 sash} or {2 handle}. If the point
        is over any other part of the panedwindow, the result is
        an empty list.
        r,r�r�rrrr,0s
zPanedWindow.identifycGs |�|j�|jdf|��pdS)r�proxyrr@r�rrrr�<s
��zPanedWindow.proxycCs
|�d�S)zBReturn the x and y pair of the most recent proxy location
        �coord�r�r�rrr�proxy_coordAszPanedWindow.proxy_coordcCs
|�d�S)z+Remove the proxy from the display.
        rr�r�rrr�proxy_forgetFszPanedWindow.proxy_forgetcCs|�d||�S)z:Place the proxy at the given x and y coordinates.
        r�r�r�rrr�proxy_placeKszPanedWindow.proxy_placecGs |�|j�|jdf|��pdS)r�sashrr@r�rrrr�Ps
��zPanedWindow.sashcCs|�d|�S)aAReturn the current x and y pair for the sash given by index.

        Index must be an integer between 0 and 1 less than the
        number of panes in the panedwindow. The coordinates given are
        those of the top left corner of the region containing the sash.
        pathName sash dragto index x y This command computes the
        difference between the given coordinates and the coordinates
        given to the last sash coord command for the given sash. It then
        moves that sash the computed difference. The return value is the
        empty string.
        r��r�r�rrr�
sash_coordUszPanedWindow.sash_coordcCs|�d|�S)zRecords x and y for the sash given by index;

        Used in conjunction with later dragto commands to move the sash.
        r�r�r�rrr�	sash_markcszPanedWindow.sash_markcCs|�d|||�S)z?Place the sash given by index at the given coordinates
        r�r�)rer�rUrVrrr�
sash_placejszPanedWindow.sash_placecCs|j�|jdf|d|f�S)zwQuery a management option for window.

        Option may be any value allowed by the paneconfigure subcommand
        �panecgetr-r�)rer%rrrrr�os�zPanedWindow.panecgetcKsd|dkr|s|�|jd|�St|t�r@|s@|�|jd|d|�S|j�|jd|f|�||��dS)a�
Query or modify the management options for window.

        If no option is specified, returns a list describing all
        of the available options for pathName.  If option is
        specified with no value, then the command returns a list
        describing the one named option (this list will be identical
        to the corresponding sublist of the value returned if no
        option is specified). If one or more option-value pairs are
        specified, then the command modifies the given widget
        option(s) to have the given value(s); in this case the
        command returns an empty string. The following options
        are supported:

        after window
            Insert the window after the window specified. window
            should be the name of a window already managed by pathName.
        before window
            Insert the window before the window specified. window
            should be the name of a window already managed by pathName.
        height size
            Specify a height for the window. The height will be the
            outer dimension of the window including its border, if
            any. If size is an empty string, or if -height is not
            specified, then the height requested internally by the
            window will be used initially; the height may later be
            adjusted by the movement of sashes in the panedwindow.
            Size may be any value accepted by Tk_GetPixels.
        minsize n
            Specifies that the size of the window cannot be made
            less than n. This constraint only affects the size of
            the widget in the paned dimension -- the x dimension
            for horizontal panedwindows, the y dimension for
            vertical panedwindows. May be any value accepted by
            Tk_GetPixels.
        padx n
            Specifies a non-negative value indicating how much
            extra space to leave on each side of the window in
            the X-direction. The value may have any of the forms
            accepted by Tk_GetPixels.
        pady n
            Specifies a non-negative value indicating how much
            extra space to leave on each side of the window in
            the Y-direction. The value may have any of the forms
            accepted by Tk_GetPixels.
        sticky style
            If a window's pane is larger than the requested
            dimensions of the window, this option may be used
            to position (or stretch) the window within its pane.
            Style is a string that contains zero or more of the
            characters n, s, e or w. The string can optionally
            contains spaces or commas, but they are ignored. Each
            letter refers to a side (north, south, east, or west)
            that the window will "stick" to. If both n and s
            (or e and w) are specified, the window will be
            stretched to fill the entire height (or width) of
            its cavity.
        width size
            Specify a width for the window. The width will be
            the outer dimension of the window including its
            border, if any. If size is an empty string, or
            if -width is not specified, then the width requested
            internally by the window will be used initially; the
            width may later be adjusted by the movement of sashes
            in the panedwindow. Size may be any value accepted by
            Tk_GetPixels.

        N�
paneconfigurer-)r�r�rrr�r2r�r�r�rrrr�wsD�
�zPanedWindow.paneconfigurecCs|j�|j�|jd��S)z+Returns an ordered list of the child panes.�panesrgr�rrrr��szPanedWindow.panes)N)rArBrCrkr�r�r�rr,r�r�r�r�r�r�r�r�r�r�Z
paneconfigr�rrrrr�
s$

Lr�cCs�t�}dt}|d7}t||d�}|��t|d|fdd�d�}|��||_t|d|jd�}|��|��|��|�	�|�
�dS)	NzThis is Tcl/Tk version %su
This should be a cedilla: ç�r�z	Click me!cSs|jjd|jdd�S)Nz[%s]r�r�)�testr�)rqrrr�<lambda>�s�z_test.<locals>.<lambda>)r�rZQUIT)ro�
TclVersionr�r�rDr�r�rr!rr�)rqr�r�r�rzrrr�_test�s 
�r��__main__)TN)N)r)r)NNror)Vrk�enumr�r�r�Ztkinter.constants�rer@�floatrOZ	TkVersionrPr�ZREADABLEZWRITABLEZ	EXCEPTION�compiler�ASCIIrr
rrr"r+r7r�Enumr8rGrlrmrnrrruryr�rzr�r�r�r�r�rar�r�r�r�r�r�r�r�rorfrgrprurzr�r�rDr�r�r�r�r�r�rr&r(r*r+r-r.rcrhrkrqr�r�r�r�r�r�r�rArrrr�<module>s� 





,R

	6

q2~
.37?/8$Vt!'2'BT
3C
tkinter/__pycache__/tix.cpython-38.pyc000064400000233061151153537530013705 0ustar00U

e5d-,�@sLddlZddlZddlTddlmZddlZdZdZdZdZdZd	Z	d
Z
dZdZd
Z
dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZGdd �d �Z Gd!d"�d"ej!e �Z!Gd#d$�d$�Z"ej#j$e"fej#_$Gd%d&�d&ej#�Z%Gd'd(�d(e%�Z&Gd)d*�d*�Z'Gd+d,�d,e%�Z(Gd-d.�d.e%�Z)Gd/d0�d0e%�Z*Gd1d2�d2e%�Z+Gd3d4�d4e%�Z,Gd5d6�d6e%�Z-Gd7d8�d8e%�Z.Gd9d:�d:e%�Z/Gd;d<�d<e%�Z0Gd=d>�d>e%�Z1Gd?d@�d@e%�Z2GdAdB�dBe%�Z3GdCdD�dDe%�Z4GdEdF�dFe%e5e6�Z7GdGdH�dHe%�Z8GdIdJ�dJe%�Z9GdKdL�dLe%�Z:GdMdN�dNe%�Z;GdOdP�dPe%�Z<GdQdR�dRe%�Z=GdSdT�dTe%�Z>GdUdV�dVe%�Z?GdWdX�dXe%�Z@GdYdZ�dZe%�ZAGd[d\�d\e%�ZBGd]d^�d^e%�ZCGd_d`�d`e%�ZDGdadb�dbe%�ZEGdcdd�dde%�ZFGdedf�dfe%�ZGGdgdh�dhe%�ZHGdidj�dje%�ZIGdkdl�dle%�ZJGdmdn�dne%�ZKGdodp�dpe%e5e6�ZLGdqdr�dre%�ZMGdsdt�dte%�ZNGdudv�dveOe&�ZPGdwdx�dxeQe&�ZRGdydz�dzeSe&�ZTGd{d|�d|eUe&�ZVGd}d~�d~eWe&�ZXGdd��d�eYe&�ZZGd�d��d�e[e&�Z\Gd�d��d�e]e&�Z^Gd�d��d�e_e&�Z`Gd�d��d�eae&�ZbGd�d��d�eDe&�ZcGd�d��d�e7e&�ZdGd�d��d�eCe&�ZeGd�d��d�eLe&�ZfGd�d��d�e*e&�ZgGd�d��d�e,e&�ZhGd�d��d�e.e&�ZiGd�d��d�e/e&�ZjGd�d��d�e2e&�ZkGd�d��d�e*e&�ZlGd�d��d�eKe&�ZmGd�d��d�e>e&�ZnGd�d��d�e@e&�Zod�d��Zpd�d��ZqGd�d��d�e%�ZrGd�d��d�e%e5e6�ZsGd�d��d�es�ZtdS)��N)�*)�	_cnfmerge�window�textZstatusZ	immediate�imageZ	imagetextZballoon�autoZ	acrosstop�asciiZcell�columnZ
decreasingZ
increasingZinteger�main�max�real�rowzs-regionzx-regionzy-region����� c@sVeZdZdZdd�Zdd�Zddd�Zdd	d
�Zdd�Zd
d�Z	dd�Z
ddd�ZdS)�
tixCommanda�The tix commands provide access to miscellaneous  elements
    of  Tix's  internal state and the Tix application context.
    Most of the information manipulated by these  commands pertains
    to  the  application  as a whole, or to a screen or
    display, rather than to a particular window.

    This is a mixin class, assumed to be mixed to Tkinter.Tk
    that supports the self.tk.call method.
    cCs|j�dd|�S)a�Tix maintains a list of directories under which
        the  tix_getimage  and tix_getbitmap commands will
        search for image files. The standard bitmap  directory
        is $TIX_LIBRARY/bitmaps. The addbitmapdir command
        adds directory into this list. By  using  this
        command, the  image  files  of an applications can
        also be located using the tix_getimage or tix_getbitmap
        command.
        �tixZaddbitmapdir��tk�call)�selfZ	directory�r�#/usr/lib64/python3.8/tkinter/tix.py�tix_addbitmapdirRs
ztixCommand.tix_addbitmapdircCs|j�dd|�S)z�Returns  the  current  value  of the configuration
        option given by option. Option may be  any  of  the
        options described in the CONFIGURATION OPTIONS section.
        r�cgetr�r�optionrrr�tix_cget^sztixCommand.tix_cgetNcKsd|rt||f�}n|rt|�}|dkr2|�dd�St|t�rN|�ddd|�S|j�d|�|��S)a�Query or modify the configuration options of the Tix application
        context. If no option is specified, returns a dictionary all of the
        available options.  If option is specified with no value, then the
        command returns a list describing the one named option (this list
        will be identical to the corresponding sublist of the value
        returned if no option is specified).  If one or more option-value
        pairs are specified, then the command modifies the given option(s)
        to have the given value(s); in this case the command returns an
        empty string. Option may be any of the configuration options.
        Nr�	configure�-)rr )r�
_getconfigure�
isinstance�strZ_getconfigure1rr�_options�r�cnf�kwrrr�
tix_configurees
ztixCommand.tix_configurecCs*|dk	r|j�dd|�S|j�dd�SdS)a�Returns the file selection dialog that may be shared among
        different calls from this application.  This command will create a
        file selection dialog widget when it is called the first time. This
        dialog will be returned by all subsequent calls to tix_filedialog.
        An optional dlgclass parameter can be passed to specified what type
        of file selection dialog widget is desired. Possible options are
        tix FileSelectDialog or tixExFileSelectDialog.
        NrZ
filedialogr)rZdlgclassrrr�tix_filedialog{s	ztixCommand.tix_filedialogcCs|j�dd|�S)a�Locates a bitmap file of the name name.xpm or name in one of the
        bitmap directories (see the tix_addbitmapdir command above).  By
        using tix_getbitmap, you can avoid hard coding the pathnames of the
        bitmap files in your application. When successful, it returns the
        complete pathname of the bitmap file, prefixed with the character
        '@'.  The returned value can be used to configure the -bitmap
        option of the TK and Tix widgets.
        rZ	getbitmapr�r�namerrr�
tix_getbitmap�s	ztixCommand.tix_getbitmapcCs|j�dd|�S)a�Locates an image file of the name name.xpm, name.xbm or name.ppm
        in one of the bitmap directories (see the addbitmapdir command
        above). If more than one file with the same name (but different
        extensions) exist, then the image type is chosen according to the
        depth of the X display: xbm images are chosen on monochrome
        displays and color images are chosen on color displays. By using
        tix_ getimage, you can avoid hard coding the pathnames of the
        image files in your application. When successful, this command
        returns the name of the newly created image, which can be used to
        configure the -image option of the Tk and Tix widgets.
        rZgetimagerr+rrr�tix_getimage�sztixCommand.tix_getimagecCs|j�ddd|�S)a@Gets  the options  maintained  by  the  Tix
        scheme mechanism. Available options include:

            active_bg       active_fg      bg
            bold_font       dark1_bg       dark1_fg
            dark2_bg        dark2_fg       disabled_fg
            fg              fixed_font     font
            inactive_bg     inactive_fg    input1_bg
            input2_bg       italic_font    light1_bg
            light1_fg       light2_bg      light2_fg
            menu_font       output1_bg     output2_bg
            select_bg       select_fg      selector
            rr�getrr+rrr�tix_option_get�sztixCommand.tix_option_getcCs2|dk	r|j�dd|||�S|j�dd||�SdS)a�Resets the scheme and fontset of the Tix application to
        newScheme and newFontSet, respectively.  This affects only those
        widgets created after this call. Therefore, it is best to call the
        resetoptions command before the creation of any widgets in a Tix
        application.

        The optional parameter newScmPrio can be given to reset the
        priority level of the Tk options set by the Tix schemes.

        Because of the way Tk handles the X option database, after Tix has
        been has imported and inited, it is not possible to reset the color
        schemes and font sets using the tix config command.  Instead, the
        tix_resetoptions command must be used.
        NrZresetoptionsr)rZ	newSchemeZ
newFontSetZ
newScmPriorrr�tix_resetoptions�sztixCommand.tix_resetoptions)N)N)N)�__name__�
__module__�__qualname__�__doc__rrr)r*r-r.r0r1rrrrrGs


rc@s"eZdZdZddd�Zdd�ZdS)	�Tkz{Toplevel widget of Tix which represents mostly the main window
    of an application. It has an associated Tcl interpreter.N�TixcCsbtj�||||�tj�d�}|j�d�|dk	rR|j�d|�|j�d|�|j�d�dS)NZTIX_LIBRARYz<global auto_path; lappend auto_path [file dir [info nameof]]z(global auto_path; lappend auto_path {%s}z,global tcl_pkgPath; lappend tcl_pkgPath {%s}zpackage require Tix)�tkinterr6�__init__�os�environr/r�eval)rZ
screenNameZbaseNameZ	classNameZtixlibrrrr9�szTk.__init__cCs|�dd�tj�|�dS)NZWM_DELETE_WINDOW�)Zprotocolr8r6�destroy�rrrrr>�sz
Tk.destroy)NNr7�r2r3r4r5r9r>rrrrr6�s
r6c@sTeZdZdZifdd�ZeZdd�Zdd�Zdd	�Zddd�Z	ddd�Z
dd�Zd
S)�Formz�The Tix Form geometry manager

    Widgets can be arranged by specifying attachments to other widgets.
    See Tix documentation for complete detailscKs"|jjd|jf|�||���dS)N�tixForm�rr�_wr%r&rrr�config�szForm.configcCst�|||i�dS�N)rA�form�r�key�valuerrr�__setitem__�szForm.__setitem__cCs|j�dd|j�S)NrB�check�rrrDr?rrrrL�sz
Form.checkcCs|j�dd|j�dS)NrB�forgetrMr?rrrrN�szForm.forgetrcCs`|sJ|sJ|j�dd|j�}|j�|�}d}|D]}||j�|�f}q.|S|j�dd|j||�S)NrB�gridr)rrrD�	splitlistZgetint)rZxsizeZysize�x�y�zrrrrO�sz	Form.gridNcCs>|s|j�dd|j�S|ddkr*d|}|j�dd|j|�S)NrB�inforr!rMrrrrrT�s
z	Form.infocs(�fdd��j��j�dd�j��D�S)Ncsg|]}��|��qSr)�
_nametowidget��.0rQr?rr�
<listcomp>szForm.slaves.<locals>.<listcomp>rB�slaves�rrPrrDr?rr?rrYs
���zForm.slaves)rr)N)r2r3r4r5rErGrKrLrNrOrTrYrrrrrA�s


rAc@sreZdZdZdddiifdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zidfdd�Zdd�Z
dS)�	TixWidgetaQA TixWidget class is used to package all (or most) Tix widgets.

    Widget initialization is extended in two ways:
       1) It is possible to give a list of options which must be part of
       the creation command (so called Tix 'static' options). These cannot be
       given as a 'config' command later.
       2) It is possible to give the name of an existing TK widget. These are
       child widgets created automatically by a Tix mega-widget. The Tk call
       to create these widgets is therefore bypassed in TixWidget.__init__

    Both options are for use by subclasses only.
    Nc	Cs�|rt||f�}nt|�}d}|r.|�d�ndg}t|���D]&\}}||kr@|d||f}||=q@||_t�|||�|r�|jj||j	f|��|r�t�
||�i|_dS)Nr�optionsr!)r�append�list�items�
widgetName�Widget�_setuprrrDrE�subwidget_list)	r�masterr`Zstatic_optionsr'r(Zextra�k�vrrrr9s$zTixWidget.__init__cCs ||jkr|j|St|��dSrF)rc�AttributeErrorr+rrr�__getattr__Gs

zTixWidget.__getattr__cCs|j�d|j|�dS)z1Set a variable without calling its action routineZtixSetSilentNrM)rrJrrr�
set_silentLszTixWidget.set_silentcCsD|�|�}|s$td|d|j��|t|j�dd�}|�|�S)zSReturn the named subwidget (which must have been created by
        the sub-class).z
Subwidget z not child of �N)�_subwidget_name�TclError�_name�lenrDrU)rr,�nrrr�	subwidgetPs

zTixWidget.subwidgetcCsZ|��}|sgSg}|D]<}|t|j�dd�}z|�|�|��WqYqXq|S)zReturn all subwidgets.rjN)�_subwidget_namesrnrDr]rU)r�namesZretlistr,rrr�subwidgets_allZszTixWidget.subwidgets_allcCs0z|j�|jd|�WStk
r*YdSXdS)z7Get a subwidget name (returns a String, not a Widget !)rpN)rrrDrlr+rrrrkiszTixWidget._subwidget_namecCs<z |j�|jdd�}|j�|�WStk
r6YdSXdS)z"Return the name of all subwidgets.Z
subwidgetsz-allN)rrrDrPrl)rrQrrrrqps
zTixWidget._subwidget_namescCs\|dkrdSt|t�st|�}t|t�s0t|�}|��}|D]}|j�|dd||�q<dS)z8Set configuration options for all subwidgets (and self).r=Nr r!)r#r$�reprrqrr)rrrJrrr,rrr�
config_allxs

zTixWidget.config_allcKst|s|}|r|rt||f�}n|r&|}d}|��D]*\}}t|�rL|�|�}|d||f}q2|j�dd|f|�S)Nrr!r�create)rr_�callable�	_registerrr)rZimgtyper'rdr(r\rerfrrr�image_create�s
zTixWidget.image_createcCs.z|j�dd|�Wntk
r(YnXdS)Nr�delete)rrrl)rZimgnamerrr�image_delete�szTixWidget.image_delete)r2r3r4r5r9rhrirprsrkrqruryr{rrrrr[
s�
-
r[c@s"eZdZdZddd�Zdd�ZdS)	�TixSubWidgetz�Subwidget class.

    This is used to mirror child widgets automatically created
    by Tix/Tk as part of a mega-widget in Python (which is not informed
    of this)rjc
Cs�|rD|�|�}z$|t|j�dd�}|�d�}Wng}YnX|s`t�||ddd|i�n�|}tt|�d�D]V}d�|d|d��}	z|�|	�}
|
}Wqtt	k
r�t
|||ddd�}YqtXqt|r�|d}t�||ddd|i�||_dS)Nrj�.r,r)�destroy_physically�check_intermediate���)rkrnrD�splitr[r9�range�joinrU�KeyErrorr|r~)rrdr,r~r�pathZplist�parent�iro�wrrrr9�s0



�zTixSubWidget.__init__cCsjt|j���D]}|��q|j|jjkr6|jj|j=|j|jjkrP|jj|j=|jrf|j�	d|j
�dS)Nr>)r^�children�valuesr>rmrdrcr~rrrD�r�crrrr>�s
zTixSubWidget.destroyN)rjrjr@rrrrr|�s
�
 r|c@sVeZdZdZifdd�dd�Zdd�Zdd	�Zd
d�Zdd
�Zifdd�Z	dd�Z
dS)�DisplayStylezRDisplayStyle - handle configuration options shared by
    (multiple) Display ItemsN)rdcKs\|s2d|kr|d}nd|kr(|d}n
t�d�}|j|_|jjd|f|�||���|_dS)NZ	refwindowzcreate display styleZtixDisplayStyle)r8Z_get_default_rootrrr%�	stylename)r�itemtyper'rdr(rrrr9�s



�zDisplayStyle.__init__cCs|jSrF)r�r?rrr�__str__�szDisplayStyle.__str__cCsH|r|rt||f�}n|r|}d}|��D]\}}|d||f}q*|S)Nrr!)rr_)rr'r(Zoptsrerfrrrr%�szDisplayStyle._optionscCs|j�|jd�dS�Nrz�rrr�r?rrrrz�szDisplayStyle.deletecCs|j�|jdd||�dS)Nr �-%sr�rHrrrrK�szDisplayStyle.__setitem__cKs|j|jdf|�||���S)Nr )r"r�r%r&rrrrE�s�
�zDisplayStyle.configcCs|j�|jdd|�S)Nrr�r�)rrIrrr�__getitem__�szDisplayStyle.__getitem__)r2r3r4r5r9r�r%rzrKrEr�rrrrr��s
r�c@s2eZdZdZdifdd�Zifdd�Zdd�ZdS)	�BalloonzBalloon help widget.

    Subwidget       Class
    ---------       -----
    label           Label
    message         MessageNcKsNdddddg}t�||d|||�t|ddd	�|jd<t|d
dd	�|jd
<dS)Nr\ZinstallcolormapZinitwaitZ	statusbarZcursorZ
tixBalloon�labelr�r~�message�r[r9�_dummyLabelrc�rrdr'r(Zstaticrrrr9	s���zBalloon.__init__cKs&|jj|jd|jf|�||���dS)zkBind balloon widget to another.
        One balloon widget may be bound to several widgets at the same time�bindNrC)r�widgetr'r(rrr�bind_widgetszBalloon.bind_widgetcCs|j�|jd|j�dS�NZunbindrM�rr�rrr�
unbind_widgetszBalloon.unbind_widget)r2r3r4r5r9r�r�rrrrr�s
r�c@s2eZdZdZdifdd�Zifdd�Zdd�ZdS)	�	ButtonBoxzgButtonBox - A container for pushbuttons.
    Subwidgets are the buttons added with the add method.
    NcKst�||dddg||�dS)NZtixButtonBox�orientationr\�r[r9�rrdr'r(rrrr9s

�zButtonBox.__init__cKs4|jj|jd|f|�||���}t||�|j|<|S)z$Add a button with given name to box.�add�rrrDr%�_dummyButtonrc)rr,r'r(Zbtnrrrr�#s z
ButtonBox.addcCs ||jkr|j�|jd|�dS�N�invoke�rcrrrDr+rrrr�*s
zButtonBox.invoke�r2r3r4r5r9r�r�rrrrr�sr�c@s>eZdZdZdifdd�Zdd�Zdd�Zd	d
�Zdd�ZdS)
�ComboBoxa�ComboBox - an Entry field with a dropdown menu. The user can select a
    choice by either typing in the entry subwidget or selecting from the
    listbox subwidget.

    Subwidget       Class
    ---------       -----
    entry       Entry
    arrow       Button
    slistbox    ScrolledListBox
    tick        Button
    cross       Button : present if created with the fancy optionNc	Ks�t�||dddddg||�t|d�|jd<t|d�|jd<t|d�|jd<t|d	�|jd	<z$t|d
�|jd
<t|d�|jd<Wntk
r�YnXdS)NZtixComboBoxZeditableZdropdown�fancyr\r��entry�arrow�slistbox�tick�cross)r[r9r�rc�_dummyEntryr��_dummyScrolledListBox�	TypeErrorr�rrrr9<s 

��
zComboBox.__init__cCs|j�|jd|�dS)NZ
addhistoryrM�rr$rrr�add_historyNszComboBox.add_historycCs|j�|jd|�dS)NZ
appendhistoryrMr�rrr�append_historyQszComboBox.append_historycCs|j�|jd||�dS�N�insertrM)r�indexr$rrrr�TszComboBox.insertcCs|j�|jd|�dS)N�pickrM�rr�rrrr�Wsz
ComboBox.pick)	r2r3r4r5r9r�r�r�r�rrrrr�.s
r�c@s>eZdZdZdifdd�Zdd�Zdd�Zd	d
�Zdd�ZdS)
�Controla�Control - An entry field with value change arrows.  The user can
    adjust the value by pressing the two arrow buttons or by entering
    the value directly into the entry. The new value will be checked
    against the user-defined upper and lower limits.

    Subwidget       Class
    ---------       -----
    incr       Button
    decr       Button
    entry       Entry
    label       LabelNcKsZt�||ddg||�t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<dS)NZ
tixControlr\�incr�decrr�r�)r[r9r�rcr�r�r�rrrr9hs
zControl.__init__cCs|j�|jd�dS)Nr�rMr?rrr�	decrementoszControl.decrementcCs|j�|jd�dS)Nr�rMr?rrr�	incrementrszControl.incrementcCs|j�|jd�dSr�rMr?rrrr�uszControl.invokecCs|j�|jd�dS)N�updaterMr?rrrr�xszControl.update)	r2r3r4r5r9r�r�r�r�rrrrr�Zs
r�c@s$eZdZdZifdd�Zdd�ZdS)�DirListaRDirList - displays a list view of a directory, its previous
    directories and its sub-directories. The user can choose one of
    the directories displayed in the list or change to another directory.

    Subwidget       Class
    ---------       -----
    hlist       HList
    hsb              Scrollbar
    vsb              ScrollbarcKsJt�||ddg||�t|d�|jd<t|d�|jd<t|d�|jd<dS)NZ
tixDirListr\�hlist�vsb�hsb�r[r9�_dummyHListrc�_dummyScrollbarr�rrrr9�szDirList.__init__cCs|j�|jd|�dS�N�chdirrM�r�dirrrrr��sz
DirList.chdirN�r2r3r4r5r9r�rrrrr�{sr�c@s$eZdZdZifdd�Zdd�ZdS)�DirTreea�DirTree - Directory Listing in a hierarchical view.
    Displays a tree view of a directory, its previous directories and its
    sub-directories. The user can choose one of the directories displayed
    in the list or change to another directory.

    Subwidget       Class
    ---------       -----
    hlist           HList
    hsb             Scrollbar
    vsb             ScrollbarcKsJt�||ddg||�t|d�|jd<t|d�|jd<t|d�|jd<dS)NZ
tixDirTreer\r�r�r�r�r�rrrr9�szDirTree.__init__cCs|j�|jd|�dSr�rMr�rrrr��sz
DirTree.chdirNr�rrrrr��sr�c@seZdZdZifdd�ZdS)�DirSelectBoxa�DirSelectBox - Motif style file select box.
    It is generally used for
    the user to choose a file. FileSelectBox stores the files mostly
    recently selected into a ComboBox widget so that they can be quickly
    selected again.

    Subwidget       Class
    ---------       -----
    selection       ComboBox
    filter          ComboBox
    dirlist         ScrolledListBox
    filelist        ScrolledListBoxcKs:t�||ddg||�t|d�|jd<t|d�|jd<dS)NZtixDirSelectBoxr\�dirlist�dircbx)r[r9�
_dummyDirListrc�_dummyFileComboBoxr�rrrr9�szDirSelectBox.__init__N�r2r3r4r5r9rrrrr��s
r�c@s,eZdZdZifdd�Zdd�Zdd�ZdS)	�ExFileSelectBoxa�ExFileSelectBox - MS Windows style file select box.
    It provides a convenient method for the user to select files.

    Subwidget       Class
    ---------       -----
    cancel       Button
    ok              Button
    hidden       Checkbutton
    types       ComboBox
    dir              ComboBox
    file       ComboBox
    dirlist       ScrolledListBox
    filelist       ScrolledListBoxcKs�t�||ddg||�t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<t|d	�|jd	<t|d
�|jd
<dS)NZtixExFileSelectBoxr\�cancel�ok�hidden�typesr�r��file�filelist)r[r9r�rc�_dummyCheckbutton�_dummyComboBoxr�r�r�rrrr9�szExFileSelectBox.__init__cCs|j�|jd�dS�N�filterrMr?rrrr��szExFileSelectBox.filtercCs|j�|jd�dSr�rMr?rrrr��szExFileSelectBox.invokeN)r2r3r4r5r9r�r�rrrrr��sr�c@s,eZdZdZifdd�Zdd�Zdd�ZdS)	�DirSelectDialoga#The DirSelectDialog widget presents the directories in the file
    system in a dialog window. The user can use this dialog window to
    navigate through the file system to select the desired directory.

    Subwidgets       Class
    ----------       -----
    dirbox       DirSelectDialogcKs*t�||ddg||�t|d�|jd<dS)NZtixDirSelectDialogr\Zdirbox)r[r9�_dummyDirSelectBoxrcr�rrrr9�s
�zDirSelectDialog.__init__cCs|j�|jd�dS�N�popuprMr?rrrr��szDirSelectDialog.popupcCs|j�|jd�dS�N�popdownrMr?rrrr��szDirSelectDialog.popdownN�r2r3r4r5r9r�r�rrrrr��s	r�c@s,eZdZdZifdd�Zdd�Zdd�ZdS)	�ExFileSelectDialogz�ExFileSelectDialog - MS Windows style file select dialog.
    It provides a convenient method for the user to select files.

    Subwidgets       Class
    ----------       -----
    fsbox       ExFileSelectBoxcKs*t�||ddg||�t|d�|jd<dS)NZtixExFileSelectDialogr\�fsbox)r[r9�_dummyExFileSelectBoxrcr�rrrr9�s
�zExFileSelectDialog.__init__cCs|j�|jd�dSr�rMr?rrrr�szExFileSelectDialog.popupcCs|j�|jd�dSr�rMr?rrrr�szExFileSelectDialog.popdownNr�rrrrr��sr�c@s,eZdZdZifdd�Zdd�Zdd�ZdS)	�
FileSelectBoxa�ExFileSelectBox - Motif style file select box.
    It is generally used for
    the user to choose a file. FileSelectBox stores the files mostly
    recently selected into a ComboBox widget so that they can be quickly
    selected again.

    Subwidget       Class
    ---------       -----
    selection       ComboBox
    filter          ComboBox
    dirlist         ScrolledListBox
    filelist        ScrolledListBoxcKsZt�||ddg||�t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<dS)NZtixFileSelectBoxr\r�r�r��	selection)r[r9r�rcr�r�rrrr9s
zFileSelectBox.__init__cCs|j�|jd�dSr�rMr?rrr�apply_filterszFileSelectBox.apply_filtercCs|j�|jd�dSr�rMr?rrrr�szFileSelectBox.invokeN)r2r3r4r5r9r�r�rrrrr�s
r�c@s,eZdZdZifdd�Zdd�Zdd�ZdS)	�FileSelectDialogz�FileSelectDialog - Motif style file select dialog.

    Subwidgets       Class
    ----------       -----
    btns       StdButtonBox
    fsbox       FileSelectBoxcKs:t�||ddg||�t|d�|jd<t|d�|jd<dS)NZtixFileSelectDialogr\Zbtnsr�)r[r9�_dummyStdButtonBoxrc�_dummyFileSelectBoxr�rrrr9,s
�zFileSelectDialog.__init__cCs|j�|jd�dSr�rMr?rrrr�2szFileSelectDialog.popupcCs|j�|jd�dSr�rMr?rrrr�5szFileSelectDialog.popdownNr�rrrrr�#sr�c@s,eZdZdZifdd�Zdd�Zdd�ZdS)	�	FileEntrya_FileEntry - Entry field with button that invokes a FileSelectDialog.
    The user can type in the filename manually. Alternatively, the user can
    press the button widget that sits next to the entry, which will bring
    up a file selection dialog.

    Subwidgets       Class
    ----------       -----
    button       Button
    entry       EntrycKs<t�||dddg||�t|d�|jd<t|d�|jd<dS)NZtixFileEntryZ
dialogtyper\Zbuttonr�)r[r9r�rcr�r�rrrr9Ds
�zFileEntry.__init__cCs|j�|jd�dSr�rMr?rrrr�JszFileEntry.invokecCsdSrFrr?rrr�file_dialogMszFileEntry.file_dialogN)r2r3r4r5r9r�r�rrrrr�8sr�c@s�eZdZdZdifdd�Zifdd�Zdifdd�Zd	d
�Zdd�Zdldd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zifd d!�Zifd"d#�Zd$d%�Zd&d'�ZeZd(d)�Zd*d+�Zd,d-�Zifd.d/�Zifd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Z d<d=�Z!dmd>d?�Z"d@dA�Z#dBdC�Z$dDdE�Z%dFdG�Z&dHdI�Z'dJdK�Z(dLdM�Z)dNdO�Z*dPdQ�Z+dRdS�Z,ifdTdU�Z-ifdVdW�Z.dXdY�Z/dZd[�Z0d\d]�Z1ifd^d_�Z2d`da�Z3dbdc�Z4ifddde�Z5dfdg�Z6dndhdi�Z7djdk�Z8dS)o�HListaHList - Hierarchy display  widget can be used to display any data
    that have a hierarchical structure, for example, file system directory
    trees. The list entries are indented and connected by branch lines
    according to their places in the hierarchy.

    Subwidgets - NoneNcKst�||dddg||�dS)NZtixHList�columnsr\r�r�rrrr9Ys

�zHList.__init__cKs |jj|jd|f|�||���S�Nr�rC�rr�r'r(rrrr�]sz	HList.addcKs(|sd}|jj|jd|f|�||���S)Nr=ZaddchildrC)rr�r'r(rrr�	add_child`s�
�zHList.add_childcCs|j�|jdd|�dS�N�anchor�setrM�rr�rrr�
anchor_setfszHList.anchor_setcCs|j�|jdd�dS�Nr��clearrMr?rrr�anchor_cleariszHList.anchor_clearrcCs6|s|j�|jdd||�S|j�|jdd|d|�SdS)Nr	�widthz-charrM)r�colr�charsrrr�column_widthls�zHList.column_widthcCs|j�|jdd�dS)Nrz�allrMr?rrr�
delete_allsszHList.delete_allcCs|j�|jdd|�dS)Nrzr�rMr�rrr�delete_entryvszHList.delete_entrycCs|j�|jdd|�dS)NrzZ
offspringsrMr�rrr�delete_offspringsyszHList.delete_offspringscCs|j�|jdd|�dS)NrzZsiblingsrMr�rrr�delete_siblings|szHList.delete_siblingscCs|j�|jdd|�dS�N�dragsiter�rMr�rrr�dragsite_setszHList.dragsite_setcCs|j�|jdd�dS�NrrrMr?rrr�dragsite_clear�szHList.dragsite_clearcCs|j�|jdd|�dS�N�dropsiter�rMr�rrr�dropsite_set�szHList.dropsite_setcCs|j�|jdd�dS�NrrrMr?rrr�dropsite_clear�szHList.dropsite_clearcKs&|jj|jdd|f|�||���dS)N�headerrvrC�rrr'r(rrr�
header_create�szHList.header_createcKs@|dkr|�|jdd|�S|jj|jdd|f|�||���dS)Nrr �r"rDrrr%rrrr�header_configure�s

�zHList.header_configurecCs|j�|jdd||�S)NrrrM)rr�optrrr�header_cget�szHList.header_cgetcCs|j�|j�|jdd|��S)NrZexist)rZ
getbooleanrrD�rrrrr�
header_exists�szHList.header_existscCs|j�|jdd|�dS)NrrzrMrrrr�
header_delete�szHList.header_deletecCs|j�|jdd|�S)Nr�sizerMrrrr�header_size�szHList.header_sizecCs|j�|jdd|�dS)N�hider�rMr�rrr�
hide_entry�szHList.hide_entrycKs&|jj|jdd|f|�||���dS)N�	indicatorrvrCr�rrr�indicator_create�s�
�zHList.indicator_createcKs@|dkr|�|jdd|�S|jj|jdd|f|�||���dS)Nr#r rr�rrr�indicator_configure�s��
�zHList.indicator_configurecCs|j�|jdd||�S)Nr#rrM�rr�rrrr�indicator_cget�szHList.indicator_cgetcCs|j�|jdd|�S)Nr#�existsrMr�rrr�indicator_exists�szHList.indicator_existscCs|j�|jdd|�dS)Nr#rzrMr�rrr�indicator_delete�szHList.indicator_deletecCs|j�|jdd|�S)Nr#rrMr�rrr�indicator_size�szHList.indicator_sizecCs|j�|jdd�S�NrTr�rMr?rrr�info_anchor�szHList.info_anchorcCs|�|j�|jdd|��pdS�NrTZbbox)�_getintsrrrDr�rrr�	info_bbox�s
��zHList.info_bboxcCs |j�|jdd|�}|j�|�S)NrTr��rrrDrP)rr�r�rrr�
info_children�szHList.info_childrencCs|j�|jdd|�S)NrT�datarMr�rrr�	info_data�szHList.info_datacCs|j�|jdd�S)NrTrrMr?rrr�
info_dragsite�szHList.info_dragsitecCs|j�|jdd�S)NrTrrMr?rrr�
info_dropsite�szHList.info_dropsitecCs|j�|jdd|�S)NrTr(rMr�rrr�info_exists�szHList.info_existscCs|j�|jdd|�S)NrTr�rMr�rrr�info_hidden�szHList.info_hiddencCs|j�|jdd|�S)NrT�nextrMr�rrr�	info_next�szHList.info_nextcCs|j�|jdd|�S)NrTr�rMr�rrr�info_parent�szHList.info_parentcCs|j�|jdd|�S)NrT�prevrMr�rrr�	info_prev�szHList.info_prevcCs|j�|jdd�}|j�|�S�NrTr�r1r�rrr�info_selection�szHList.info_selectioncCs|j�|jdd|||�S)N�itemrrM)rr�rrrrr�	item_cget�szHList.item_cgetcKsD|dkr|�|jdd||�S|jj|jdd||f|�||���dS)Nr@r r�rr�rr'r(rrr�item_configure�s

�zHList.item_configurecKs(|jj|jdd||f|�||���dS)Nr@rvrCrBrrr�item_create�s�
�zHList.item_createcCs|j�|jdd||�S)Nr@r(rM�rr�rrrr�item_exists�szHList.item_existscCs|j�|jdd||�dS)Nr@rzrMrErrr�item_delete�szHList.item_deletecCs|j�|jd||�S)N�	entrycgetrMr&rrrrH�szHList.entrycgetcKs<|dkr|�|jd|�S|jj|jd|f|�||���dS�N�entryconfigurerr�rrrrJ�s

�zHList.entryconfigurecCs|j�|jd|�S�N�nearestrM)rrRrrrrLsz
HList.nearestcCs|j�|jd|�dS�N�seerMr�rrrrNsz	HList.seecKs$|jj|jddf|�||���dS�Nr�rrCr&rrr�selection_clearszHList.selection_clearcCs|j�|jdd|�S�Nr�ZincludesrMr�rrr�selection_includes
szHList.selection_includescCs|j�|jdd||�dS�Nr�r�rM�r�firstZlastrrr�
selection_set
szHList.selection_setcCs|j�|jdd|�S)N�showr�rMr�rrr�
show_entryszHList.show_entry)rNN)N)N)9r2r3r4r5r9r�r�r�rrrrr	r
r
rrrrrrrZheader_existrr r"r$r%r'r)r*r+r-r0r2r4r5r6r7r8r:r;r=r?rArCrDrFrGrHrJrLrNrPrRrVrXrrrrr�Qsl


r�c@seZdZdZdifdd�ZdS)�	InputOnlyz?InputOnly - Invisible widget. Unix only.

    Subwidgets - NoneNcKst�||dd||�dS)NZtixInputOnlyr�r�rrrr9szInputOnly.__init__r�rrrrrYsrYc@seZdZdZdifdd�ZdS)�
LabelEntryaLabelEntry - Entry field with label. Packages an entry widget
    and a label into one mega widget. It can be used to simplify the creation
    of ``entry-form'' type of interface.

    Subwidgets       Class
    ----------       -----
    label       Label
    entry       EntryNcKs<t�||dddg||�t|d�|jd<t|d�|jd<dS)NZ
tixLabelEntry�	labelsider\r�r�)r[r9r�rcr�r�rrrr9%s
�zLabelEntry.__init__r�rrrrrZs	rZc@seZdZdZdifdd�ZdS)�
LabelFrameaeLabelFrame - Labelled Frame container. Packages a frame widget
    and a label into one mega widget. To create widgets inside a
    LabelFrame widget, one creates the new widgets relative to the
    frame subwidget and manage them inside the frame subwidget.

    Subwidgets       Class
    ----------       -----
    label       Label
    frame       FrameNcKs<t�||dddg||�t|d�|jd<t|d�|jd<dS)NZ
tixLabelFramer[r\r��frame)r[r9r�rc�_dummyFramer�rrrr96s
�zLabelFrame.__init__r�rrrrr\+s
r\c@s@eZdZdZifdd�Zifdd�Zdd�Zdd	�Zd
d�ZdS)
�ListNoteBookaA ListNoteBook widget is very similar to the TixNoteBook widget:
    it can be used to display many windows in a limited space using a
    notebook metaphor. The notebook is divided into a stack of pages
    (windows). At one time only one of these pages can be shown.
    The user can navigate through these pages by
    choosing the name of the desired page in the hlist subwidget.cKsNt�||ddg||�t|ddd�|jd<t|d�|jd<t|d�|jd<dS)NZtixListNoteBookr\Zpanerr�r�Zshlist)r[r9�_dummyPanedWindowrcr��_dummyScrolledHListr�rrrr9Es�zListNoteBook.__init__cKs:|jj|jd|f|�||���t||�|j|<|j|Sr��rrrDr%r|rc�rr,r'r(rrrr�Ms zListNoteBook.addcCs
|�|�SrF�rpr+rrr�pageRszListNoteBook.pagecCs:|j�|j�|jd��}g}|D]}|�|�|��q |S�N�pages�rrPrrDr]rp�rrrZretrQrrrrgUs
zListNoteBook.pagescCs|j�|jd|�dS�N�raiserMr+rrr�
raise_page]szListNoteBook.raise_pageN)	r2r3r4r5r9r�rergrlrrrrr_=sr_c@seZdZdZdifdd�ZdS)�MeterzuThe Meter widget can be used to show the progress of a background
    job which may take a long time to execute.
    NcKst�||ddg||�dS)NZtixMeterr\r�r�rrrr9es

�zMeter.__init__r�rrrrrm`srmc@sReZdZdZdifdd�Zifdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�NoteBookz�NoteBook - Multi-page container widget (tabbed notebook metaphor).

    Subwidgets       Class
    ----------       -----
    nbframe       NoteBookFrame
    <pages>       page widgets added dynamically with the add methodNcKs.t�||ddg||�t|ddd�|jd<dS)NZtixNoteBookr\Znbframerr�)r[r9r|rcr�rrrr9qs�zNoteBook.__init__cKs:|jj|jd|f|�||���t||�|j|<|j|Sr�rbrcrrrr�vs zNoteBook.addcCs,|j�|jd|�|j|��|j|=dSr��rrrDrcr>r+rrrrz{szNoteBook.deletecCs
|�|�SrFrdr+rrrre�sz
NoteBook.pagecCs:|j�|j�|jd��}g}|D]}|�|�|��q |Srfrhrirrrrg�s
zNoteBook.pagescCs|j�|jd|�dSrjrMr+rrrrl�szNoteBook.raise_pagecCs|j�|jd�S)N�raisedrMr?rrrrp�szNoteBook.raised)r2r3r4r5r9r�rzrergrlrprrrrrnisrnc@seZdZdS)�
NoteBookFrameN)r2r3r4rrrrrq�srqc@sLeZdZdZifdd�Zifdd�Zifdd�Zdd	�Zd
d�Zdd
�Z	dS)�
OptionMenuz�OptionMenu - creates a menu button of options.

    Subwidget       Class
    ---------       -----
    menubutton      Menubutton
    menu            MenucKs:t�||ddg||�t|d�|jd<t|d�|jd<dS)NZ
tixOptionMenur\�
menubutton�menu�r[r9�_dummyMenubuttonrc�
_dummyMenur�rrrr9�szOptionMenu.__init__cKs&|jj|jdd|f|�||���dS)Nr��commandrCrcrrr�add_command�szOptionMenu.add_commandcKs&|jj|jdd|f|�||���dS)Nr�Z	separatorrCrcrrr�
add_separator�szOptionMenu.add_separatorcCs|j�|jd|�dSr�rMr+rrrrz�szOptionMenu.deletecCs|j�|jd|�dS)N�disablerMr+rrrr{�szOptionMenu.disablecCs|j�|jd|�dS)N�enablerMr+rrrr|�szOptionMenu.enableN)
r2r3r4r5r9ryrzrzr{r|rrrrrr�srrc@sTeZdZdZifdd�Zifdd�Zdd�Zdd	�Zd
d�Zifdd
�Z	dd�Z
dS)�PanedWindowa�PanedWindow - Multi-pane container widget
    allows the user to interactively manipulate the sizes of several
    panes. The panes can be arranged either vertically or horizontally.The
    user changes the sizes of the panes by dragging the resize handle
    between two panes.

    Subwidgets       Class
    ----------       -----
    <panes>       g/p widgets added dynamically with the add method.cKst�||dddg||�dS)NZtixPanedWindowr�r\r�r�rrrr9�szPanedWindow.__init__cKs>|jj|jd|f|�||���t||dd�|j|<|j|S)Nr�r)rrbrcrrrr��s
 �zPanedWindow.addcCs,|j�|jd|�|j|��|j|=dSr�ror+rrrrz�szPanedWindow.deletecCs|j�|jd|�dS)NrNrMr+rrrrN�szPanedWindow.forgetcCs|j�|jd||�S)N�panecgetrMr&rrrr~�szPanedWindow.panecgetcKs<|dkr|�|jd|�S|jj|jd|f|�||���dS)N�
paneconfigurerr�rrrr�szPanedWindow.paneconfigurecs*�j��j��jd��}�fdd�|D�S)N�panescsg|]}��|��qSrrdrVr?rrrX�sz%PanedWindow.panes.<locals>.<listcomp>rZ)rrrrr?rr��szPanedWindow.panesN)r2r3r4r5r9r�rzrNr~rr�rrrrr}�s
r}c@s4eZdZdZifdd�Zdd�Zdd�Zdd	�Zd
S)�	PopupMenuaPopupMenu widget can be used as a replacement of the tk_popup command.
    The advantage of the Tix PopupMenu widget is it requires less application
    code to manipulate.


    Subwidgets       Class
    ----------       -----
    menubutton       Menubutton
    menu       MenucKs:t�||ddg||�t|d�|jd<t|d�|jd<dS)NZtixPopupMenur\rsrtrur�rrrr9�szPopupMenu.__init__cCs|j�|jd|j�dS)Nr�rMr�rrrr��szPopupMenu.bind_widgetcCs|j�|jd|j�dSr�rMr�rrrr��szPopupMenu.unbind_widgetcCs|j�|jd|j||�dS)NZpostrM)rr�rQrRrrr�post_widget�szPopupMenu.post_widgetN)r2r3r4r5r9r�r�r�rrrrr��s
r�c@s<eZdZdZifdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�ResizeHandlez;Internal widget to draw resize handles on Scrolled widgets.c	Ks.ddddddddd	g	}t�||d
|||�dS)Nr\rxZcursorfgZcursorbgZ
handlesizeZ	hintcolorZ	hintwidthrQrRZtixResizeHandler�)rrdr'r(�flagsrrrr9�s�
�zResizeHandle.__init__cCs|j�|jd|j�dS)NZattachwidgetrMr�rrr�
attach_widgetszResizeHandle.attach_widgetcCs|j�|jd|j�dS)NZdetachwidgetrMr�rrr�
detach_widgetszResizeHandle.detach_widgetcCs|j�|jd|j�dS)Nr!rMr�rrrr!szResizeHandle.hidecCs|j�|jd|j�dS)NrWrMr�rrrrW	szResizeHandle.showN)	r2r3r4r5r9r�r�r!rWrrrrr��s
r�c@seZdZdZifdd�ZdS)�
ScrolledHListz0ScrolledHList - HList with automatic scrollbars.cKsJt�||ddg||�t|d�|jd<t|d�|jd<t|d�|jd<dS)NZtixScrolledHListr\r�r�r�r�r�rrrr9s�zScrolledHList.__init__Nr�rrrrr�sr�c@seZdZdZifdd�ZdS)�ScrolledListBoxz4ScrolledListBox - Listbox with automatic scrollbars.cKsJt�||ddg||�t|d�|jd<t|d�|jd<t|d�|jd<dS)NZtixScrolledListBoxr\�listboxr�r�)r[r9�
_dummyListboxrcr�r�rrrr9szScrolledListBox.__init__Nr�rrrrr�sr�c@seZdZdZifdd�ZdS)�ScrolledTextz.ScrolledText - Text with automatic scrollbars.cKsJt�||ddg||�t|d�|jd<t|d�|jd<t|d�|jd<dS)NZtixScrolledTextr\rr�r�)r[r9�
_dummyTextrcr�r�rrrr9%szScrolledText.__init__Nr�rrrrr�!sr�c@seZdZdZifdd�ZdS)�
ScrolledTListz0ScrolledTList - TList with automatic scrollbars.cKsJt�||ddg||�t|d�|jd<t|d�|jd<t|d�|jd<dS)NZtixScrolledTListr\Ztlistr�r�)r[r9�_dummyTListrcr�r�rrrr9/s�zScrolledTList.__init__Nr�rrrrr�+sr�c@seZdZdZifdd�ZdS)�ScrolledWindowz2ScrolledWindow - Window with automatic scrollbars.cKsJt�||ddg||�t|d�|jd<t|d�|jd<t|d�|jd<dS)NZtixScrolledWindowr\rr�r�)r[r9r^rcr�r�rrrr9:szScrolledWindow.__init__Nr�rrrrr�6sr�c@s0eZdZdZifdd�Zifdd�Zdd�ZdS)	�Selectz�Select - Container of button subwidgets. It can be used to provide
    radio-box or check-box style of selection options for the user.

    Subwidgets are buttons added dynamically using the add method.c
Ks2t�||ddddddg||�t|d�|jd<dS)NZ	tixSelectZ	allowzero�radior�r[r\r�r�r�rrrr9Gs
��zSelect.__init__cKs:|jj|jd|f|�||���t||�|j|<|j|Sr�r�rcrrrr�Ns z
Select.addcCs|j�|jd|�dSr�rMr+rrrr�Ssz
Select.invokeNr�rrrrr�@sr�c@seZdZdZdifdd�ZdS)�Shellz'Toplevel window.

    Subwidgets - NoneNcKst�||dddg||�dS)NZtixShellr\�titler�r�rrrr9[szShell.__init__r�rrrrr�Vsr�c@s6eZdZdZdifdd�Zdd�Zdd�Zd	d
�ZdS)�DialogShellz�Toplevel window, with popup popdown and center methods.
    It tells the window manager that it is a dialog window and should be
    treated specially. The exact treatment depends on the treatment of
    the window manager.

    Subwidgets - NoneNcKs&t�||ddddddddg||�dS)	NZtixDialogShellr\r�ZmappedZ	minheightZminwidthr�Z	transientr�r�rrrr9gs��zDialogShell.__init__cCs|j�|jd�dSr�rMr?rrrr�nszDialogShell.popdowncCs|j�|jd�dSr�rMr?rrrr�qszDialogShell.popupcCs|j�|jd�dS)N�centerrMr?rrrr�tszDialogShell.center)r2r3r4r5r9r�r�r�rrrrr�^s
r�c@s&eZdZdZdifdd�Zdd�ZdS)�StdButtonBoxz@StdButtonBox - Standard Button Box (OK, Apply, Cancel and Help) NcKs\t�||dddg||�t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<dS)NZtixStdButtonBoxr�r\r��applyr��help)r[r9r�rcr�rrrr9zs
�zStdButtonBox.__init__cCs ||jkr|j�|jd|�dSr�r�r+rrrr��s
zStdButtonBox.invoke)r2r3r4r5r9r�rrrrr�wsr�c@s�eZdZdZdifdd�Zdd�Zdd�Zd	d
�Zdd�Zd3d
d�Z	dd�Z
dd�Zdd�Zdd�Z
ifdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zifd-d.�Zd/d0�Zd4d1d2�ZdS)5�TLista�TList - Hierarchy display widget which can be
    used to display data in a tabular format. The list entries of a TList
    widget are similar to the entries in the Tk listbox widget. The main
    differences are (1) the TList widget can display the list entries in a
    two dimensional format and (2) you can use graphical images as well as
    multiple colors and fonts for the list entries.

    Subwidgets - NoneNcKst�||ddg||�dS)NZtixTListr\r�r�rrrr9�szTList.__init__cCs|j�|jdd|�dS)N�activer�rMr�rrr�
active_set�szTList.active_setcCs|j�|jdd�dS)Nr�rrMr?rrr�active_clear�szTList.active_clearcCs|j�|jdd|�dSr�rMr�rrrr��szTList.anchor_setcCs|j�|jdd�dSr�rMr?rrrr�szTList.anchor_clearcCs|j�|jd||�dSr�rM�r�from_�torrrrz�szTList.deletecCs|j�|jdd|�dSrrMr�rrrr
�szTList.dragsite_setcCs|j�|jdd�dSrrMr?rrrr�szTList.dragsite_clearcCs|j�|jdd|�dSrrMr�rrrr�szTList.dropsite_setcCs|j�|jdd�dSrrMr?rrrr�szTList.dropsite_clearcKs$|jj|jd|f|�||���dSr�rC)rr�r'r(rrrr��szTList.insertcCs|j�|jdd�S)NrTr�rMr?rrr�info_active�szTList.info_activecCs|j�|jdd�Sr,rMr?rrrr-�szTList.info_anchorcCs|j�|jdd|�S)NrTZdownrMr�rrr�	info_down�szTList.info_downcCs|j�|jdd|�S)NrT�leftrMr�rrr�	info_left�szTList.info_leftcCs|j�|jdd|�S)NrT�rightrMr�rrr�
info_right�szTList.info_rightcCs|j�|jdd�}|j�|�Sr>r1r�rrrr?�szTList.info_selectioncCs|j�|jdd�S)NrTrrMr?rrr�	info_size�szTList.info_sizecCs|j�|jdd|�S)NrTZuprMr�rrr�info_up�sz
TList.info_upcCs|j�|jd||�SrKrM�rrQrRrrrrL�sz
TList.nearestcCs|j�|jd|�dSrMrMr�rrrrN�sz	TList.seecKs$|jj|jddf|�||���dSrOrCr&rrrrP�szTList.selection_clearcCs|j�|jdd|�SrQrMr�rrrrR�szTList.selection_includescCs|j�|jdd||�dSrSrMrTrrrrV�szTList.selection_set)N)N)r2r3r4r5r9r�r�r�rrzr
rrrr�r�r-r�r�r�r?r�r�rLrNrPrRrVrrrrr��s2	
r�c@sHeZdZdZdifdd�Zdd�Zdd�Zd	d
�Zdd�Zddd�Z	dS)�Treez�Tree - The tixTree widget can be used to display hierarchical
    data in a tree form. The user can adjust
    the view of the tree by opening or closing parts of the tree.NcKsJt�||ddg||�t|d�|jd<t|d�|jd<t|d�|jd<dS)NZtixTreer\r�r�r�r�r�rrrr9�s
�z
Tree.__init__cCs|j�|jd�dS�aThis command calls the setmode method for all the entries in this
     Tree widget: if an entry has no child entries, its mode is set to
     none. Otherwise, if the entry has any hidden child entries, its mode is
     set to open; otherwise its mode is set to close.�autosetmodeNrMr?rrrr��szTree.autosetmodecCs|j�|jd|�dS�z8Close the entry given by entryPath if its mode is close.�closeNrM�r�	entrypathrrrr��sz
Tree.closecCs|j�|jd|�S�z9Returns the current mode of the entry given by entryPath.�getmoderMr�rrrr��szTree.getmodecCs|j�|jd|�dS�z6Open the entry given by entryPath if its mode is open.�openNrMr�rrrr��sz	Tree.open�nonecCs|j�|jd||�dS)a�This command is used to indicate whether the entry given by
     entryPath has children entries and whether the children are visible. mode
     must be one of open, close or none. If mode is set to open, a (+)
     indicator is drawn next the entry. If mode is set to close, a (-)
     indicator is drawn next the entry. If mode is set to none, no
     indicators will be drawn for this entry. The default mode is none. The
     open mode indicates the entry has hidden children and this entry can be
     opened by the user. The close mode indicates that all the children of the
     entry are now visible and the entry can be closed by the user.�setmodeNrM�rr��moderrrr��s
zTree.setmode)r�)
r2r3r4r5r9r�r�r�r�r�rrrrr��sr�c@sZeZdZdZdifdd�Zdd�Zdd�Zd	d
�Zdd�Zddd�Z	dd�Z
ddd�ZdS)�	CheckListz�The CheckList widget
    displays a list of items to be selected by the user. CheckList acts
    similarly to the Tk checkbutton or radiobutton widgets, except it is
    capable of handling many more items than checkbuttons or radiobuttons.
    NcKsLt�||dddg||�t|d�|jd<t|d�|jd<t|d�|jd<dS)NZtixCheckListr\r�r�r�r�r�r�rrrr9s
�zCheckList.__init__cCs|j�|jd�dSr�rMr?rrrr�szCheckList.autosetmodecCs|j�|jd|�dSr�rMr�rrrr�szCheckList.closecCs|j�|jd|�Sr�rMr�rrrr� szCheckList.getmodecCs|j�|jd|�dSr�rMr�rrrr�$szCheckList.open�oncCs|j�|j�|jd|��S)z�Returns a list of items whose status matches status. If status is
     not specified, the list of items in the "on" status will be returned.
     Mode can be on, off, default�getselectionrZ)rr�rrrr�(szCheckList.getselectioncCs|j�|jd|�S)z(Returns the current status of entryPath.�	getstatusrMr�rrrr�.szCheckList.getstatuscCs|j�|jd||�dS)z~Sets the status of entryPath to be status. A bitmap will be
     displayed next to the entry its status is on, off or default.�	setstatusNrMr�rrrr�2szCheckList.setstatus)r�)r�)r2r3r4r5r9r�r�r�r�r�r�r�rrrrr�s
r�c@seZdZddd�ZdS)r�rjcCst�||||�dSrF�r|r9�rrdr,r~rrrr9>sz_dummyButton.__init__N)rj�r2r3r4r9rrrrr�=sr�c@seZdZddd�ZdS)r�rjcCst�||||�dSrFr�r�rrrr9Bsz_dummyCheckbutton.__init__N)rjr�rrrrr�Asr�c@seZdZddd�ZdS)r�rjcCst�||||�dSrFr�r�rrrr9Fsz_dummyEntry.__init__N)rjr�rrrrr�Esr�c@seZdZddd�ZdS)r^rjcCst�||||�dSrFr�r�rrrr9Jsz_dummyFrame.__init__N)rjr�rrrrr^Isr^c@seZdZddd�ZdS)r�rjcCst�||||�dSrFr�r�rrrr9Nsz_dummyLabel.__init__N)rjr�rrrrr�Msr�c@seZdZddd�ZdS)r�rjcCst�||||�dSrFr�r�rrrr9Rsz_dummyListbox.__init__N)rjr�rrrrr�Qsr�c@seZdZddd�ZdS)rwrjcCst�||||�dSrFr�r�rrrr9Vsz_dummyMenu.__init__N)rjr�rrrrrwUsrwc@seZdZddd�ZdS)rvrjcCst�||||�dSrFr�r�rrrr9Zsz_dummyMenubutton.__init__N)rjr�rrrrrvYsrvc@seZdZddd�ZdS)r�rjcCst�||||�dSrFr�r�rrrr9^sz_dummyScrollbar.__init__N)rjr�rrrrr�]sr�c@seZdZddd�ZdS)r�rjcCst�||||�dSrFr�r�rrrr9bsz_dummyText.__init__N)rjr�rrrrr�asr�c@seZdZddd�ZdS)r�rjcCsDt�||||�t|d�|jd<t|d�|jd<t|d�|jd<dS)Nr�r�r�)r|r9r�rcr�r�rrrr9fsz_dummyScrolledListBox.__init__N)rjr�rrrrr�esr�c@seZdZddd�ZdS)r�rjcCst�||||�dSrFr�r�rrrr9msz_dummyHList.__init__N)rjr�rrrrr�lsr�c@seZdZddd�ZdS)rarjcCsDt�||||�t|d�|jd<t|d�|jd<t|d�|jd<dS�Nr�r�r��r|r9r�rcr�r�rrrr9qsz_dummyScrolledHList.__init__N)rjr�rrrrrapsrac@seZdZddd�ZdS)r�rjcCst�||||�dSrFr�r�rrrr9xsz_dummyTList.__init__N)rjr�rrrrr�wsr�c@seZdZddd�ZdS)r�rjcCs�t�|||d|g�t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<z$t|d�|jd<t|d�|jd<Wntk
r�YnXdS)Nr�r�r�r�r�r�r�)r|r9r�rcr�r�r�r�r�rrrr9|s�
z_dummyComboBox.__init__N)rjr�rrrrr�{sr�c@seZdZddd�ZdS)r�rjcCsDt�||||�t|d�|jd<t|d�|jd<t|d�|jd<dSr�r�r�rrrr9�sz_dummyDirList.__init__N)rjr�rrrrr��sr�c@seZdZddd�ZdS)r�rjcCs4t�||||�t|d�|jd<t|d�|jd<dS)Nr�r�)r|r9r�rcr�r�rrrr9�sz_dummyDirSelectBox.__init__N)rjr�rrrrr��sr�c@seZdZddd�ZdS)r�rjcCs�t�||||�t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<dS)	Nr�r�r�r�r�r�r�r�)r|r9r�rcr�r�r�r�rrrr9�sz_dummyExFileSelectBox.__init__N)rjr�rrrrr��sr�c@seZdZddd�ZdS)r�rjcCsTt�||||�t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<dS)Nr�r�r�r�)r|r9r�rcr�r�rrrr9�s
z_dummyFileSelectBox.__init__N)rjr�rrrrr��sr�c@seZdZddd�ZdS)r�rjcCs$t�||||�t|d�|jd<dS)Nr�)r|r9r�rcr�rrrr9�sz_dummyFileComboBox.__init__N)rjr�rrrrr��sr�c@seZdZddd�ZdS)r�rjcCsTt�||||�t|d�|jd<t|d�|jd<t|d�|jd<t|d�|jd<dS)Nr�r�r�r�)r|r9r�rcr�rrrr9�s
z_dummyStdButtonBox.__init__N)rjr�rrrrr��sr�c@seZdZddd�ZdS)�_dummyNoteBookFramercCst�||||�dSrFr�r�rrrr9�sz_dummyNoteBookFrame.__init__N)rr�rrrrr��sr�c@seZdZddd�ZdS)r`rjcCst�||||�dSrFr�r�rrrr9�sz_dummyPanedWindow.__init__N)rjr�rrrrr`�sr`cCs|j�d|j�S)zzReturns the qualified path name for the widget. Normally used to set
    default options for subwidgets. See tixwidgets.pyZ
tixOptionNamerM)r�rrr�
OptionName�sr�cCs:d}|��D](}|d|d|d||d}q|S)Nr=z{{z} {z - z}} )�keys)�dict�s�typerrr�FileTypeList�s&r�c@seZdZdZdS)�CObjViewaBThis file implements the Canvas Object View widget. This is a base
    class of IconView. It implements automatic placement/adjustment of the
    scrollbars according to the canvas objects inside the canvas subwidget.
    The scrollbars are adjusted so that the canvas is just large enough
    to see all the objects.
    N)r2r3r4r5rrrrr��sr�c@s�eZdZdZdifdd�Zdd�Zdd�Zd	d
�Zd)dd�Zd*d
d�Z	dd�Z
dd�Zdd�Zd+dd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd,d!d"�Zd#d$�Zd%d&�Zd'd(�ZdS)-�Grida}The Tix Grid command creates a new window  and makes it into a
    tixGrid widget. Additional options, may be specified on the command
    line or in the option database to configure aspects such as its cursor
    and relief.

    A Grid widget displays its contents in a two dimensional grid of cells.
    Each cell may contain one Tix display item, which may be in text,
    graphics or other formats. See the DisplayStyle class for more information
    about Tix display items. Individual cells, or groups of cells, can be
    formatted with a wide range of attributes, such as its color, relief and
    border.

    Subwidgets - NoneNcKs"g}||_t�||d|||�dS)NZtixGrid�r'r[r9r�rrrr9�sz
Grid.__init__cCs|j�|dd�dS)zRemoves the selection anchor.r�rNrr?rrrrszGrid.anchor_clearcCs|�|j�|dd��S)z3Get the (x,y) coordinate of the current anchor cellr�r/�r/rrr?rrr�
anchor_getszGrid.anchor_getcCs|j�|dd||�dS)z/Set the selection anchor to the cell at (x, y).r�r�Nrr�rrrr�szGrid.anchor_setcCs4|dkr|j�|dd|�n|j�|dd||�dS)zdDelete rows between from_ and to inclusive.
        If to is not provided,  delete only row at from_Nrzr
rr�rrr�
delete_rowszGrid.delete_rowcCs4|dkr|j�|dd|�n|j�|dd||�dS)zjDelete columns between from_ and to inclusive.
        If to is not provided,  delete only column at from_Nrzr	rr�rrr�
delete_columnszGrid.delete_columncCs|j�|dd�dS)zUIf any cell is being edited, de-highlight the cell  and  applies
        the changes.�editr�Nrr?rrr�
edit_applyszGrid.edit_applycCs|j�|dd||�dS)zmHighlights  the  cell  at  (x, y) for editing, if the -editnotify
        command returns True for this cell.r�r�Nrr�rrr�edit_set!sz
Grid.edit_setcCs,|r|ddkrd|}|j�|d|||�S)z&Get the option value for cell at (x,y)rr!rHr)rrQrRrrrrrH&szGrid.entrycgetcKs|�d||f||�SrI)Z
_configure)rrQrRr'r(rrrrJ,szGrid.entryconfigurec	Cs|�|j�|dd||��S)z+Return True if display item exists at (x,y)rTr()Z_getbooleanrrr�rrrr72szGrid.info_existscCs|j�|dd||�Sr.rr�rrrr06szGrid.info_bboxcCs|j�|dd|||�dS)z�Moves the range of columns from position FROM through TO by
        the distance indicated by OFFSET. For example, move_column(2, 4, 1)
        moves the columns 2,3,4 to columns 3,4,5.�mover	Nr�rr�r��offsetrrr�move_column:szGrid.move_columncCs|j�|dd|||�dS)z�Moves the range of rows from position FROM through TO by
        the distance indicated by OFFSET.
        For example, move_row(2, 4, 1) moves the rows 2,3,4 to rows 3,4,5.r�r
Nrr�rrr�move_row@sz
Grid.move_rowcCs|�|j�|d||��S)z8Return coordinate of cell nearest pixel coordinate (x,y)rLr�r�rrrrLFszGrid.nearestcKs>|�|j|�}|dk	r"d|f|}|jj|d||f|��dS)Nz	-itemtyper�)r%r'rr)rrQrRr�r(�argsrrrr�PszGrid.setcKs*|j�|jj|jdd|f|�i|����S)a�Queries or sets the size of the column given by
        INDEX.  INDEX may be any non-negative
        integer that gives the position of a given column.
        INDEX can also be the string "default"; in this case, this command
        queries or sets the default size of all columns.
        When no option-value pair is given, this command returns a tuple
        containing the current size setting of the given column.  When
        option-value pairs are given, the corresponding options of the
        size setting of the given column are changed. Options may be one
        of the following:
              pad0 pixels
                     Specifies the paddings to the left of a column.
              pad1 pixels
                     Specifies the paddings to the right of a column.
              size val
                     Specifies the width of a column.  Val may be:
                     "auto" -- the width of the column is set to the
                     width of the widest cell in the column;
                     a valid Tk screen distance unit;
                     or a real number following by the word chars
                     (e.g. 3.4chars) that sets the width of the column to the
                     given number of characters.rr	)rrPrrDr%�rr�r(rrr�size_columnVs
�zGrid.size_columncKs(|j�|jj|dd|f|�i|����S)a�Queries or sets the size of the row given by
        INDEX. INDEX may be any non-negative
        integer that gives the position of a given row .
        INDEX can also be the string "default"; in this case, this command
        queries or sets the default size of all rows.
        When no option-value pair is given, this command returns a list con-
        taining the current size setting of the given row . When option-value
        pairs are given, the corresponding options of the size setting of the
        given row are changed. Options may be one of the following:
              pad0 pixels
                     Specifies the paddings to the top of a row.
              pad1 pixels
                     Specifies the paddings to the bottom of a row.
              size val
                     Specifies the height of a row.  Val may be:
                     "auto" -- the height of the row is set to the
                     height of the highest cell in the row;
                     a valid Tk screen distance unit;
                     or a real number following by the word chars
                     (e.g. 3.4chars) that sets the height of the row to the
                     given number of characters.rr
)rrPrr%r�rrr�size_rowps�
�z
Grid.size_rowcCs|j�|jd||�dS)z7Clears the cell at (x, y) by removing its display item.�unsetNrMr�rrrr��sz
Grid.unset)N)N)N)N)r2r3r4r5r9rr�r�r�r�r�r�rHrJr7r0r�r�rLr�r�r�r�rrrrr��s(	




r�c@seZdZdZdifdd�ZdS)�ScrolledGridzScrolled Grid widgetsNcKs"g}||_t�||d|||�dS)NZtixScrolledGridr�r�rrrr9�szScrolledGrid.__init__r�rrrrr��sr�)ur:r8rZ_tkinterZWINDOWZTEXTZSTATUSZ	IMMEDIATEZIMAGEZ	IMAGETEXTZBALLOONZAUTOZ	ACROSSTOP�ASCIIZCELLZCOLUMNZ
DECREASINGZ
INCREASINGZINTEGERZMAIN�MAXZREALZROWZS_REGIONZX_REGIONZY_REGIONZ
TCL_DONT_WAITZTCL_WINDOW_EVENTSZTCL_FILE_EVENTSZTCL_TIMER_EVENTSZTCL_IDLE_EVENTSZTCL_ALL_EVENTSrr6rAra�	__bases__r[r|r�r�r�r�r�r�r�r�r�r�r�r�r�r�ZXViewZYViewr�rYrZr\r_rmrnrqrrr}r�r�r�r�r�r�r�r�r�r�r�r�r�r�ZButtonr�ZCheckbuttonr�ZEntryr�ZFramer^ZLabelr�ZListboxr�ZMenurwZ
MenubuttonrvZ	Scrollbarr�ZTextr�r�r�rar�r�r�r�r�r�r�r�r�r`r�r�r�r�r�rrrr�<module>s�-
8/,!"C#	()


S.6

*tkinter/__pycache__/scrolledtext.cpython-38.opt-2.pyc000064400000003126151153537530016552 0ustar00U

e5d�@shdgZddlmZmZmZmZmZmZddlm	Z	m
Z
mZmZGdd�de�Z
dd�Zedkrde�dS)	�ScrolledText�)�Frame�Text�	Scrollbar�Pack�Grid�Place)�RIGHT�LEFT�Y�BOTHc@seZdZddd�Zdd�ZdS)rNcKs�t|�|_t|j�|_|jjttd�|�d|jji�t	j
||jf|�|jttdd�|j
|jd<tt	���}tt���tt���Btt���B}|�|�}|D]4}|ddkr�|dkr�|d	kr�t||t|j|��q�dS)
N)�side�fillZyscrollcommandT)r
r�expandZcommandr�_ZconfigZ	configure)r�framerZvbar�packr	r�update�setr�__init__r
rZyview�vars�keysrrr�
difference�setattr�getattr)�selfZmaster�kwZ
text_meths�methods�m�r�,/usr/lib64/python3.8/tkinter/scrolledtext.pyrs
$
zScrolledText.__init__cCs
t|j�S)N)�strr)rrrr �__str__)szScrolledText.__str__)N)�__name__�
__module__�__qualname__rr"rrrr rs
cCsHddlm}tddd�}|�|t�|jttdd�|��|�	�dS)Nr)�ENDZwhite�
)ZbgZheightT)rr
r)
�tkinter.constantsr&r�insert�__doc__rrr
Z	focus_setZmainloop)r&Zstextrrr �example-sr+�__main__N)�__all__Ztkinterrrrrrrr(r	r
rrrr+r#rrrr �<module>s 
tkinter/__pycache__/__main__.cpython-38.opt-2.pyc000064400000000421151153537530015551 0ustar00U

e5d��@s8ddlZejd�d�r"dejd<ddlmZe�dS)�Nz__main__.pyzpython -m tkinter�)�_test)�sys�argv�endswith�r�main�r	r	�(/usr/lib64/python3.8/tkinter/__main__.py�<module>s
tkinter/__pycache__/dialog.cpython-38.opt-1.pyc000064400000002702151153537530015273 0ustar00U

e5d��@srddlTddlmZdZGdd�de�Zdd�Zedkrned	d
ddeeii�Z	ed	d
d
de	j
eii�Ze	��d	S)�)�*)�	_cnfmergeZ	questheadc@s"eZdZdifdd�Zdd�ZdS)�DialogNc
Ks�t||f�}d|_t�|||�|j�|jjd|j|d|d|d|df|d���|_zt�	|�Wnt
k
r~YnXdS)NZ
__dialog__Z	tk_dialog�title�text�bitmap�default�strings)rZ
widgetName�Widget�_setupZtkZgetintZcallZ_w�num�destroyZTclError)�selfZmasterZcnf�kw�r�&/usr/lib64/python3.8/tkinter/dialog.py�__init__
s&���zDialog.__init__cCsdS)Nr)rrrrr
�zDialog.destroy)�__name__�
__module__�__qualname__rr
rrrrr	s
rcCs$tdddtddd��}t|j�dS)Nz
File ModifiedzzFile "Python.h" has been modified since the last time it was saved. Do you want to save it before exiting the application.r)z	Save FilezDiscard ChangeszReturn to Editor)rrrrr	)r�DIALOG_ICON�printr)�drrr�_tests�r�__main__NrZTestZcommandZQuit)
Ztkinterrrr
rrrZButtonZPack�t�quit�qZmainlooprrrr�<module>s$��tkinter/__pycache__/ttk.cpython-38.opt-2.pyc000064400000067035151153537530014651 0ustar00U

e5d���@s�dZdZdddddddd	d
ddd
dddddddddddddgZddlZddlmZmZmZmZejdkrldnd Z	d!d"�Z
dWd#d$�ZdXd%d&�Zd'd(�Z
dYd)d*�ZdZd+d,�Zd[d.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Zd<d=�Zd>d�Zd\d?d�ZGd@d�de�ZGdAdB�dBej�ZGdCd�de�ZGdDd�de�ZGdEd�deej�ZGdFd�de�Z GdGd�de�Z!GdHd�de�Z"GdId�de�Z#e#Z$GdJd
�d
e�Z%GdKd�de�Z&GdLd�deej'�Z(e(Z'GdMd�de�Z)GdNd�de�Z*GdOd�deej+�Z+GdPd�deej,�Z,GdQd�de�Z-GdRd�de�Z.GdSd�de�Z/GdTd�deej0ej1�Z2GdUd�de!�Z3GdVd�de%�Z4dS)]z0.3.1z!Guilherme Polo <ggpolo@gmail.com>�Button�Checkbutton�Combobox�Entry�Frame�Label�
Labelframe�
LabelFrame�
Menubutton�Notebook�Panedwindow�PanedWindow�Progressbar�Radiobutton�Scale�	Scrollbar�	Separator�Sizegrip�Spinbox�Style�Treeview�LabeledScale�
OptionMenu�
tclobjs_to_py�setup_master�N)�_flatten�_join�
_stringify�
_splitdictg!@TFcCsBtr>ddl}|j�d�}|r,|j�d|�|j�d�d|_dS)NrZTILE_LIBRARYz(global auto_path; lappend auto_path {%s}zpackage require tileT)�
_REQUIRE_TILE�os�environ�get�tk�eval�_tile_loaded)�masterr Ztilelib�r'�#/usr/lib64/python3.8/tkinter/ttk.py�
_load_tile"s��r)cCs(|rt|�}nt|ttf�r$t|�}|S�N)r�
isinstance�list�tupler)�value�scriptr'r'r(�_format_optvalue1s

r0cCsPg}|��D]:\}}|r ||kr|�d|�|dk	r|�t||��qt|�S�N�-%s)�items�appendr0r)Zoptdictr/�ignore�opts�optr.r'r'r(�_format_optdict;sr8cCsXg}|D]J�^}}t|�dkr,|dp(d}n
d�|�}|�|�|dk	r|�|�q|S)N�r�� )�len�joinr4)r3Zopt_val�state�valr'r'r(�_mapdict_valuesKs

r@cCs:g}|��D]$\}}|�d|tt|�|�f�qt|�Sr1)r3�extendr0r@r)Zmapdictr/r6r7r.r'r'r(�_format_mapdict`s

�rBcOs�d}d}|dkr�|dkrB|d}tt|dd���}d||f}n2|dd�\}}	tt|dd���}
d||	|
f}t||�}n,|d	kr�|d}t|�dkr�t|d|�f}|r�d
|}d�|�}||fS)Nr')�imageZvsapirCrr9z%s %s�z%s %s %s�fromz{%s}r;)rr@r8r<r0r=)�etyper/�args�kw�specr6ZinameZ	imagespec�
class_nameZpart_idZstatemapr'r'r(�_format_elemcreateqs&
rKrDc
Cs�g}|D]�}|\}}|pi}d�t|dd��}dd|||rDd|ndf}d|kr�|�|d�||7}t|d||�\}	}|�|	�||8}|�d	d|�q|�|�qd
�|�|fS)Nr;T)�childrenz%s%s%sz %sr:rLz -children {z%s}�
)r=r8r4�_format_layoutlist)
�layout�indentZindent_sizer/Zlayout_elem�elemr6Zfopts�headZ	newscriptr'r'r(rN�s"
�
rNcCsXg}|��D�]>\}}|�d�rFd�t|dd��}|�d||f�|�d�rvd�t|dd��}|�d||f�d|kr�|ds�d}nt|d�\}}|�d	||f�|�d
�r|d
}|d}d}|t|�kr�t||d
�s�|d7}q�|d|�}	|t|�k�r||�r||ni}
t	|df|	�|
�\}}|�d||||f�qd�|�S)N�	configurer;Tzttk::style configure %s %s;�mapzttk::style map %s %s;rO�nullzttk::style layout %s {
%s
}zelement createrr9r3z%ttk::style element create %s %s %s %srM)
r3r"r=r8r4rBrNr<�hasattrrK)�settingsr/�namer6�s�_ZeoptsrFZargcZelemargsZelemkwrIr'r'r(�_script_from_settings�s:



$�
r[cCs�t|t�r|Sg}t|�}t||�D]j\}}t|d�rDt|���}n(t|t�rX|��}nt|ttf�sl|f}t|d�r~t|�}|�||f��q$|S)N�typename)	r+�str�iter�ziprV�splitr-r,r4)Zstuple�result�itr>r?r'r'r(�_list_from_statespec�s




rccCs�|�|�}g}d}|t|�kr�||}i}|�||f�|d7}|t|�kr|||d�\}}|�d�slq|dd�}|d7}|dkr�t||�}|||<q@q|S)Nrr9rD�-rL)�	splitlistr<r4�
startswith�_list_from_layouttuple)r#Zltuple�resZindxrXr6r7r?r'r'r(rgs$


rgcGs4t|�}|j||�}t|�dr&|St||td�S)NrD)�conv)r8�callr<r�
_tclobj_to_py)r#�optionsrGrhr'r'r(�_val_or_dict!s
rmc	Cs2t|�}zt|�}Wnttfk
r,YnX|Sr*)r]�int�
ValueError�	TypeError)r.r'r'r(�_convert_stringval1srqcCs(t|t�r$d|krt|�}nt|�}|S)N�.)r+r]�floatrn)�xr'r'r(�
_to_number;s


rucCs\|rFt|d�rFt|t�sFt|ddd�dkr6t|�}qXttt|��}nt|d�rXt|�}|S)N�__len__rr\Z	StateSpec)rVr+r]�getattrrcr,rTrq)r?r'r'r(rkCs

rkcCs"|��D]\}}t|�||<q|Sr*)r3rk)Zadictr7r?r'r'r(rPscCs|dkrt��}|Sr*)�tkinterZ_get_default_root)r&r'r'r(rXsc@s~eZdZdZddd�Zddd�Zddd�Zdd	d
�Zddd�Zd
d�Z	dd�Z
dd�Zd dd�Zdd�Z
dd�Zd!dd�ZdS)"rz
ttk::styleNcCs0t|�}t|dd�st|�||_|jj|_dS)Nr%F)rrwr)r&r#)�selfr&r'r'r(�__init__is
zStyle.__init__cKs4|dk	rd||<t|j||jd|�}|s,|r0|SdS)NrS)rmr#�_name�ry�styleZ	query_optrHrar'r'r(rSts
zStyle.configurecsj|dk	r0�j��jd|d|�}t�j�|��S�jj�jd|ft|���}�fdd�t�j|���D�S)NrTr2cs"i|]\}}|t�j�|���qSr')rcr#re)�.0�k�v�ryr'r(�
<dictcomp>�s�zStyle.map.<locals>.<dictcomp>)r#rjr{rcrerBrr3r|r'r�r(rT�s
�z	Style.mapcCs.|rd�|�nd}|j�|jd|d|||�S)Nr;r:�lookupr2)r=r#rjr{)ryr}�optionr>�defaultr'r'r(r��s
�zStyle.lookupcCs>d}|rt|�d}n|dk	r"d}t|j|j�|jd||��S)NrrUrO)rNrgr#rjr{)ryr}Z
layoutspecZlspecr'r'r(rO�s �zStyle.layoutcOs8t|df|�|�\}}|jj|jdd|||f|��dS)NF�element�create)rKr#rjr{)ry�elementnamerFrGrHrIr6r'r'r(�element_create�s��zStyle.element_createc	Cs(tdd�|j�|j�|jdd��D��S)Ncss|]}|�d�VqdS�rdN��lstrip)r~�nr'r'r(�	<genexpr>�sz&Style.element_names.<locals>.<genexpr>r��names�r-r#rerjr{r�r'r'r(�
element_names�s�zStyle.element_namesc
Cs*tdd�|j�|j�|jdd|��D��S)Ncss|]}|�d�VqdSr�r�)r~�or'r'r(r��sz(Style.element_options.<locals>.<genexpr>r�rlr�)ryr�r'r'r(�element_options�s�zStyle.element_optionsc
CsN|rt|�nd}|r2|j�|jdd|d|d|�n|j�|jdd|d|�dS)Nr:�themer�z-parentz	-settings�r[r#rjr{)ry�	themename�parentrWr/r'r'r(�theme_create�s��zStyle.theme_createcCs"t|�}|j�|jdd||�dS)Nr�rWr�)ryr�rWr/r'r'r(�theme_settings�szStyle.theme_settingscCs|j�|j�|jdd��S)Nr�r�)r#rerjr{r�r'r'r(�theme_names�szStyle.theme_namescCs&|dkr|j�d�S|j�d|�dS)Nzreturn $ttk::currentThemez
ttk::setTheme)r#r$rj)ryr�r'r'r(�	theme_use�szStyle.theme_use)N)N)N)NN)N)NN)N)�__name__�
__module__�__qualname__r{rzrSrTr�rOr�r�r�r�r�r�r�r'r'r'r(rds




+
c@s2eZdZd
dd�Zdd�Zddd�Zddd	�ZdS)
�WidgetNcCs4t|�}t|dd�st|�tjj||||d�dS)Nr%F)rH)rrwr)rxr�rz)ryr&Z
widgetnamerHr'r'r(rzszWidget.__init__cCs|j�|jd||�S�N�identify�r#rj�_w�ryrt�yr'r'r(r�+szWidget.identifyc	Os6|j�|j�|jdd�|���}|r2|r2|||�S|S)N�instater;)r#�
getbooleanrjr�r=)ry�	statespec�callbackrGrHZretr'r'r(r�3s�
zWidget.instatecCs0|dk	rd�|�}|j�t|j�|jd|���S)Nr;r>)r=r#rer]rjr�)ryr�r'r'r(r>Bs
zWidget.state)N)N)N)r�r�r�rzr�r�r>r'r'r'r(r�
s

r�c@seZdZddd�Zdd�ZdS)rNcKst�||d|�dS)Nzttk::button�r�rz�ryr&rHr'r'r(rzSszButton.__init__cCs|j�|jd�S�N�invoker�r�r'r'r(r�bsz
Button.invoke)N�r�r�r�rzr�r'r'r'r(rOs
c@seZdZddd�Zdd�ZdS)rNcKst�||d|�dS)Nzttk::checkbuttonr�r�r'r'r(rzjszCheckbutton.__init__cCs|j�|jd�Sr�r�r�r'r'r(r�yszCheckbutton.invoke)Nr�r'r'r'r(rgs
c@s.eZdZd
dd�Zdd�Zdd�Zdd	�ZdS)rNcKst�|||pd|�dS)Nz
ttk::entryr�)ryr&ZwidgetrHr'r'r(rz�szEntry.__init__cCs|�|j�|jd|��S)N�bbox�Z_getintsr#rjr�)ry�indexr'r'r(r��sz
Entry.bboxcCs|j�|jd||�Sr�r�r�r'r'r(r��szEntry.identifycCs|j�|j�|jd��S)N�validate�r#r�rjr�r�r'r'r(r��szEntry.validate)NN)r�r�r�rzr�r�r�r'r'r'r(r�s
c@s(eZdZddd�Zd	dd�Zdd�ZdS)
rNcKstj||df|�dS)Nz
ttk::combobox�rrzr�r'r'r(rz�szCombobox.__init__cCs2|dkr |j�|j�|jd��S|j�|jd|�S)N�current�r#Zgetintrjr�)ryZnewindexr'r'r(r��szCombobox.currentcCs|j�|jd|�dS�N�setr��ryr.r'r'r(r��szCombobox.set)N)N)r�r�r�rzr�r�r'r'r'r(r�s


c@seZdZddd�ZdS)rNcKst�||d|�dS)Nz
ttk::framer�r�r'r'r(rz�szFrame.__init__)N�r�r�r�rzr'r'r'r(r�sc@seZdZddd�ZdS)rNcKst�||d|�dS)Nz
ttk::labelr�r�r'r'r(rz�s
zLabel.__init__)Nr�r'r'r'r(r�sc@seZdZddd�ZdS)rNcKst�||d|�dS)Nzttk::labelframer�r�r'r'r(rz�szLabelframe.__init__)Nr�r'r'r'r(r�sc@seZdZddd�ZdS)r	NcKst�||d|�dS)Nzttk::menubuttonr�r�r'r'r(rzszMenubutton.__init__)Nr�r'r'r'r(r	
sc@sjeZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	ddd�Z
ddd�Zdd�Zdd�Z
dS)r
NcKst�||d|�dS)Nz
ttk::notebookr�r�r'r'r(rz"szNotebook.__init__cKs |jj|jd|ft|���dS�N�add�r#rjr�r8)ry�childrHr'r'r(r�BszNotebook.addcCs|j�|jd|�dS)N�forgetr��ry�tab_idr'r'r(r�JszNotebook.forgetcCs|j�|jd|�dS)N�hider�r�r'r'r(r�Psz
Notebook.hidecCs|j�|jd||�Sr�r�r�r'r'r(r�YszNotebook.identifycCs|j�|j�|jd|��S�Nr�r�r�r'r'r(r�_szNotebook.indexcKs"|jj|jd||ft|���dS�N�insertr��ry�posr�rHr'r'r(r�eszNotebook.insertcCs|j�|jd|�S)N�selectr�r�r'r'r(r�nszNotebook.selectcKs$|dk	rd||<t|j||jd|�S)N�tab�rmr#r�)ryr�r�rHr'r'r(r�xszNotebook.tabcCs|j�|j�|jd�pd�S)N�tabsr'�r#rerjr�r�r'r'r(r��sz
Notebook.tabscCs|j�d|j�dS)Nzttk::notebook::enableTraversalr�r�r'r'r(�enable_traversal�szNotebook.enable_traversal)N)N)N)r�r�r�rzr�r�r�r�r�r�r�r�r�r�r'r'r'r(r
s
 		


c@s:eZdZd
dd�ZejjZdd�Zddd�Zddd	�Z	dS)
rNcKst�||d|�dS)Nzttk::panedwindowr�r�r'r'r(rz�szPanedwindow.__init__cKs"|jj|jd||ft|���dSr�r�r�r'r'r(r��szPanedwindow.insertcKs$|dk	rd||<t|j||jd|�S)N�paner�)ryr�r�rHr'r'r(r��szPanedwindow.panecCs|j�|j�|jd||��S)N�sashposr�)ryr�Znewposr'r'r(r��szPanedwindow.sashpos)N)N)N)
r�r�r�rzrxrr�r�r�r�r'r'r'r(r�s

	
c@s2eZdZd
dd�Zddd�Zddd�Zdd	�ZdS)
r
NcKst�||d|�dS)Nzttk::progressbarr�r�r'r'r(rz�szProgressbar.__init__cCs|j�|jd|�dS)N�startr�)ryZintervalr'r'r(r��szProgressbar.startcCs|j�|jd|�dS)N�stepr�)ryZamountr'r'r(r��szProgressbar.stepcCs|j�|jd�dS)N�stopr�r�r'r'r(r�szProgressbar.stop)N)N)N)r�r�r�rzr�r�r�r'r'r'r(r
�s


c@seZdZddd�Zdd�ZdS)rNcKst�||d|�dS)Nzttk::radiobuttonr�r�r'r'r(rzszRadiobutton.__init__cCs|j�|jd�Sr�r�r�r'r'r(r�szRadiobutton.invoke)Nr�r'r'r'r(rs
c@s*eZdZddd�Zd	dd�Zd
dd�ZdS)rNcKst�||d|�dS)Nz
ttk::scaler�r�r'r'r(rz'szScale.__init__cKsTtj||f|�}t|td�tf�s,|�|�td|kd|kd|kg�rP|�d�|S)NrE�from_�to�<<RangeChanged>>)r�rSr+�typer]�update�anyZevent_generate)ryZcnfrHZretvalr'r'r(rS5s

zScale.configurecCs|j�|jd||�S)Nr"r�r�r'r'r(r"Bsz	Scale.get)N)N)NN)r�r�r�rzrSr"r'r'r'r(r#s


c@seZdZddd�ZdS)rNcKst�||d|�dS)Nzttk::scrollbarr�r�r'r'r(rzNszScrollbar.__init__)Nr�r'r'r'r(rKsc@seZdZddd�ZdS)rNcKst�||d|�dS)Nzttk::separatorr�r�r'r'r(rz`szSeparator.__init__)Nr�r'r'r'r(r\sc@seZdZddd�ZdS)rNcKst�||d|�dS)Nz
ttk::sizegripr�r�r'r'r(rzrszSizegrip.__init__)Nr�r'r'r'r(rnsc@seZdZddd�Zdd�ZdS)rNcKstj||df|�dS)Nzttk::spinboxr�r�r'r'r(rz�szSpinbox.__init__cCs|j�|jd|�dSr�r�r�r'r'r(r��szSpinbox.set)N)r�r�r�rzr�r'r'r'r(r|s
c@s0eZdZdDdd�ZdEdd�ZdFdd�Zdd	�ZdGd
d�Zdd
�Zdd�Z	dd�Z
dHdd�ZdIdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�ZdJd"d#�ZdKd$d%�Zd&d'�ZeZd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Z dLd<d=�Z!dMd>d?�Z"dNd@dA�Z#dOdBdC�Z$dS)PrNcKst�||d|�dS)Nz
ttk::treeviewr�r�r'r'r(rz�szTreeview.__init__cCs|�|j�|jd||��pdS)Nr�r:r�)ry�item�columnr'r'r(r��sz
Treeview.bboxcCs"|j�|j�|jd|pd�pd�S)NrLr:r'r��ryr�r'r'r(�get_children�s�zTreeview.get_childrencGs|j�|jd||�dS)NrLr�)ryr�Znewchildrenr'r'r(�set_children�szTreeview.set_childrencKs$|dk	rd||<t|j||jd|�S)Nr�r�)ryr�r�rHr'r'r(r��szTreeview.columncGs|j�|jd|�dS)N�deleter��ryr3r'r'r(r��szTreeview.deletecGs|j�|jd|�dS)N�detachr�r�r'r'r(r��szTreeview.detachcCs|j�|j�|jd|��S)N�existsr�r�r'r'r(r��szTreeview.existscCs|j�|jd|�S)N�focusr�r�r'r'r(r��szTreeview.focuscKsP|�d�}|r,t|t�s,|j�||j�|d<|dk	r<d||<t|j||jd|�S)N�command�heading)	r"r+r]r&�registerZ_substitutermr#r�)ryr�r�rH�cmdr'r'r(r��s
zTreeview.headingcCs|j�|jd|||�Sr�r�)ryZ	componentrtr�r'r'r(r�szTreeview.identifycCs|�dd|�S)N�rowr�r�)ryr�r'r'r(�identify_rowszTreeview.identify_rowcCs|�d|d�S)Nr�rr�)ryrtr'r'r(�identify_column"szTreeview.identify_columncCs|�d||�S)NZregionr�r�r'r'r(�identify_region)s	zTreeview.identify_regioncCs|�d||�S)Nr�r�r�r'r'r(�identify_element5szTreeview.identify_elementcCs|j�|j�|jd|��Sr�r�r�r'r'r(r�<szTreeview.indexcKsNt|�}|dk	r0|jj|jd||d|f|��}n|jj|jd||f|��}|S)Nr�z-id)r8r#rjr�)ryr�r�ZiidrHr6rhr'r'r(r�Bs
��zTreeview.insertcKs$|dk	rd||<t|j||jd|�S)Nr�r�)ryr�r�rHr'r'r(r�Ysz
Treeview.itemcCs|j�|jd|||�dS)N�mover�)ryr�r�r�r'r'r(r�esz
Treeview.movecCs|j�|jd|�S)N�nextr�r�r'r'r(r�qsz
Treeview.nextcCs|j�|jd|�S)Nr�r�r�r'r'r(r�wszTreeview.parentcCs|j�|jd|�S)N�prevr�r�r'r'r(r�}sz
Treeview.prevcCs|j�|jd|�dS)N�seer�r�r'r'r(r��szTreeview.seecCs|j�|j�|jd��S)N�	selectionr�r�r'r'r(r��szTreeview.selectioncCs>t|�dkr&t|dttf�r&|d}|j�|jd||�dS)Nr9rr�)r<r+r-r,r#rjr�)ryZselopr3r'r'r(�
_selection�szTreeview._selectioncGs|�d|�dSr��r�r�r'r'r(�
selection_set�szTreeview.selection_setcGs|�d|�dSr�r�r�r'r'r(�
selection_add�szTreeview.selection_addcGs|�d|�dS)N�remover�r�r'r'r(�selection_remove�szTreeview.selection_removecGs|�d|�dS)NZtoggler�r�r'r'r(�selection_toggle�szTreeview.selection_togglecCs@|j�|jd|||�}|dkr8|dkr8t|j|dtd�S|SdS)Nr�F)Z	cut_minusri)r#rjr�rrk)ryr�r�r.rhr'r'r(r��s�zTreeview.setcCs |j|jdd|f||dd�dS)N�tag�bindr)r�)Z_bindr�)ry�tagnameZsequencer�r'r'r(�tag_bind�szTreeview.tag_bindcKs&|dk	rd||<t|j||jdd|�S)Nr�rSr�)ryr�r�rHr'r'r(�
tag_configure�s
�zTreeview.tag_configurec	CsF|dkr$|j�|j�|jdd|��S|j�|j�|jdd||��SdS)Nr�Zhas)r#rerjr�r�)ryr�r�r'r'r(�tag_has�s��zTreeview.tag_has)N)N)N)N)N)N)N)N)NN)NN)N)N)%r�r�r�rzr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�Zreattachr�r�r�r�r�r�r�r�r�r�r�r�r�r�r'r'r'r(r�sD



	
	

 

		



csHeZdZd
dd�Z�fdd�Zdd	�Zed
d��Zejdd��Z�Z	S)rNr�
c	Ks|�dd�dk|_tj||f|�|p.t�|�|_|j�|�||_t	|�|_
t||j||d�|_|j�
d|j�|jr|dnd}|dkr�dnd}|jj|dd�t	|�}|j|d�|��|j
j|dkr�d	nd
d�|j�d|j�|_|�
d
|j�|�
d|j�dS)NZcompound�top)�variabler�r�r�Zbottomrt)�sideZfill)rr�rY)Zanchor�wz<Configure>z<Map>)�pop�
_label_toprrzrxZIntVar�	_variabler��_last_validr�labelr�scaler��_adjustZpack�lowerZplaceZtrace_variable�_LabeledScale__tracecb)	ryr&rr�r�rHZ
scale_sideZ
label_sideZdummyr'r'r(rz�s$
zLabeledScale.__init__csHz|j�d|j�Wntk
r(YnX|`t���d|_d|_dS)Nr)rZ
trace_vdeleter�AttributeError�super�destroyrr	r���	__class__r'r(rs
zLabeledScale.destroycs��fdd�}t�jd�}t�jd�}||kr:||}}�j��}||krX|ksfn�j�_dS|�_|�jd<��|�dS)NcsZ����j��\}}�jr2�j���j��}n�j���j��}�jj||d�dS)N�rtr�)Zupdate_idletasksr	ZcoordsrZwinfo_yrZwinfo_reqheightZplace_configurerr�r'r(�adjust_labelsz*LabeledScale._adjust.<locals>.adjust_labelrEr��text)rur	rr"rr.rZ
after_idle)ryrGrr�r�Znewvalr'r�r(r
s


zLabeledScale._adjustcCs
|j��Sr*)rr"r�r'r'r(r.4szLabeledScale.valuecCs|j�|�dSr*)rr�)ryr?r'r'r(r.9s)NNrr�)
r�r�r�rzrr
�propertyr.�setter�
__classcell__r'r'rr(r�s
&

cs8eZdZd
dd�Zdd�Zddd�Z�fdd	�Z�ZS)rNcOs�||�dd�|�dd�d�}tj||f|�tj|dd�|d<||_|�dd�|_|rpt�dtt	|�
�����|j|f|��dS)	Nr}�	direction)Ztextvariabler}rF)Ztearoff�menur�zunknown option -%s)rr	rzrxZMenur�	_callbackZTclErrorr�r^�keys�set_menu)ryr&rr��values�kwargsrHr'r'r(rzCs
��zOptionMenu.__init__cCs&|dkr|�t�||��St�||�S)Nr)Znametowidgetr	�__getitem__r�r'r'r(r`szOptionMenu.__getitem__cGsR|d}|�dd�|D]$}|j|t�|j||j�|jd�q|rN|j�|�dS)Nrr�end)rr�r)r�Zadd_radiobuttonrxZ_setitrrr�)ryr�rrr?r'r'r(rgs�zOptionMenu.set_menucs,z|`Wntk
rYnXt���dSr*)rr
rrr�rr'r(rus
zOptionMenu.destroy)N)N)r�r�r�rzrrrrr'r'rr(r?s

)F)FN)F)F)rrD)N)5�__version__�
__author__�__all__rxrrrrZ	TkVersionrr)r0r8r@rBrKrNr[rcrgrmrqrurkrr�objectrr�rrrrrrrrr	r
rrr
rrrrrrZXViewZYViewrrrr'r'r'r(�<module>s��	




%
1*


*B*"8*(J`tkinter/__pycache__/simpledialog.cpython-38.opt-1.pyc000064400000025370151153537530016513 0ustar00U

e5d�-�@s�dZddlTddlmZmZGdd�d�ZGdd�de�Zdd	�ZGd
d�de�ZGdd
�d
e�Z	dd�Z
Gdd�de�Zdd�ZGdd�de�Z
dd�Zedkr�dd�Ze�dS)a&This modules handles dialog boxes.

It contains the following public symbols:

SimpleDialog -- A simple but flexible modal dialog box

Dialog -- a base class for dialogs

askinteger -- get an integer from the user

askfloat -- get a float from the user

askstring -- get a string from the user
�)�*)�
messagebox�_get_default_rootc@sLeZdZdgddddfdd�Zddd�Zd	d
�Zdd�Zd
d�Zdd�ZdS)�SimpleDialog�NcCs|rt||d�|_n
t|�|_|r:|j�|�|j�|�t|j�t|j|dd�|_|jjdtd�t	|j�|_
|j
��||_||_||_
|j�d|j�tt|��D]L}||}	t|j
|	||fdd�d	�}
||kr�|
jtd
d�|
jttdd�q�|j�d
|j�|�|�dS)N)�class_i�)�textZaspect�)�expand�fill�<Return>cSs
|�|�S�N)�done��self�num�r�,/usr/lib64/python3.8/tkinter/simpledialog.py�<lambda>8�z'SimpleDialog.__init__.<locals>.<lambda>�r�command�)ZreliefZborderwidth)�siderr
�WM_DELETE_WINDOW)�Toplevel�root�titleZiconname�
_setup_dialogZMessage�message�packZBOTH�Frame�framer�cancel�default�bind�return_event�range�len�ButtonZconfigZRIDGE�LEFT�protocol�wm_delete_window�_set_transient)r�masterr�buttonsr$r#rrr�s�brrr�__init__ s2


�zSimpleDialog.__init__��?�333333�?c
Cs|j}|��|�|�|��|��rJ|��}|��}|��}|��}n|�	�}|�
�}d}}|��}	|��}
|||	|}|||
|}||	|�	�kr�|�	�|	}n|dkr�d}||
|�
�kr�|�
�|
}n|dkr�d}|�
d||f�|��dS)Nr�+%d+%d)r�withdraw�	transient�update_idletasksZwinfo_ismappedZwinfo_widthZwinfo_height�winfo_rootx�winfo_rootyZwinfo_screenwidthZwinfo_screenheightZwinfo_reqwidthZwinfo_reqheight�geometry�	deiconify)
rr.ZrelxZrelyZwidgetZm_widthZm_heightZm_xZm_yZw_widthZw_height�x�yrrrr-?s4

zSimpleDialog._set_transientcCs.|j��|j��|j��|j��|jSr
)r�wait_visibility�grab_set�mainloop�destroyr�rrrr�go\s




zSimpleDialog.gocCs&|jdkr|j��n|�|j�dSr
)r$r�bellr�rZeventrrrr&cs
zSimpleDialog.return_eventcCs&|jdkr|j��n|�|j�dSr
)r#rrErrCrrrr,is
zSimpleDialog.wm_delete_windowcCs||_|j��dSr
)rr�quitrrrrroszSimpleDialog.done)r3r4)	�__name__�
__module__�__qualname__r2r-rDr&r,rrrrrrs�

rc@sVeZdZdZddd�Zdd�Zdd�Zd	d
�Zddd�Zdd
d�Z	dd�Z
dd�ZdS)�DialogzZClass to open dialogs.

    This class is intended as a base class for custom dialogs
    NcCs�|}|std�}t�||�|��|dk	r>|��r>|�|�|rL|�|�t|�||_d|_	t
|�}|�|�|_|j
ddd�|��|js�||_|�d|j�|dk	r�|�d|��d|��df�|��|j��|��|��|�|�dS)z�Initialize a dialog.

        Arguments:

            parent -- a parent window (the application window)

            title -- the dialog title
        zcreate dialog windowN�)�padx�padyrr5�2)rrr2r6Zwinfo_viewabler7rr�parent�resultr!�body�
initial_focusr �	buttonboxr+r#r;r9r:r<�	focus_setr?r@Zwait_window)rrPrr.rRrrrr2{s8	


�
zDialog.__init__cCsd|_t�|�dS)zDestroy the windowN)rSrrBrCrrrrB�szDialog.destroycCsdS)z�create dialog body.

        return widget that should have initial focus.
        This method should be overridden, and is called
        by the __init__ method.
        Nr)rr.rrrrR�szDialog.bodycCsvt|�}t|dd|jtd�}|jtddd�t|dd|jd�}|jtddd�|�d|j�|�d	|j�|��d
S)z[add standard button box.

        override if you do not want the standard buttons
        ZOK�
)r�widthrr$rL)rrMrN�Cancel)rrWrrz<Escape>N)r!r)�okZACTIVEr r*r#r%)rZbox�wrrrrT�szDialog.buttonboxcCsB|��s|j��dS|��|��z|��W5|��XdSr
)�validaterSrUr6r8r#�applyrFrrrrY�s
z	Dialog.okcCs |jdk	r|j��|��dSr
)rPrUrBrFrrrr#�s

z
Dialog.cancelcCsdS)z�validate the data

        This method is called automatically to validate the data before the
        dialog is destroyed. By default, it always validates OK.
        r	rrCrrrr[�szDialog.validatecCsdS)z�process the data

        This method is called automatically to process the data, *after*
        the dialog is destroyed. By default, it does nothing.
        NrrCrrrr\�szDialog.apply)N)N)N)rHrIrJ�__doc__r2rBrRrTrYr#r[r\rrrrrKts
7	


	rKcCs:|jdkr |j�dd|dd�n|jdkr6|�dd�dS)	NZaquaz!::tk::unsupported::MacWindowStyleZstyleZ
moveableModalrZx11z-typeZdialog)Z_windowingsystemZtkZcallZ
wm_attributes)rZrrrrs

�
rc@s.eZdZd
dd�Zdd�Zdd�Zdd	�ZdS)�_QueryDialogNcCs*||_||_||_||_t�|||�dSr
)�prompt�minvalue�maxvalue�initialvaluerKr2)rrr_rbr`rarPrrrr2s
z_QueryDialog.__init__cCsd|_t�|�dSr
)�entryrKrBrCrrrrBsz_QueryDialog.destroycCsrt||jtd�}|jddtd�t|dd�|_|jjddttd�|jdk	rl|j�	d|j�|j�
dt�|jS)N)rZjustifyrrL)�rowrMZstickyrc)�namer	)ZLabelr_r*Zgrid�WZEntryrc�Erb�insertZselect_rangeZEND)rr.rZrrrrR s
z_QueryDialog.bodycCs�z|��}Wn,tk
r8tjd|jd|d�YdSX|jdk	rh||jkrhtjdd|j|d�dS|jdk	r�||jkr�tjdd|j|d�dS||_d	S)
Nz
Illegal valuez
Please try again)rPrz	Too smallz2The allowed minimum value is %s. Please try again.z	Too largez2The allowed maximum value is %s. Please try again.r	)�	getresult�
ValueErrorr�showwarning�errormessager`rarQ)rrQrrrr[.s:�����z_QueryDialog.validate)NNNN)rHrIrJr2rBrRr[rrrrr^
s�

r^c@seZdZdZdd�ZdS)�
_QueryIntegerzNot an integer.cCs|�|j���Sr
)Zgetintrc�getrCrrrriSsz_QueryInteger.getresultN�rHrIrJrlrirrrrrmPsrmcKst||f|�}|jS)z�get an integer from the user

    Arguments:

        title -- the dialog title
        prompt -- the label text
        **kw -- see SimpleDialog class

    Return value is an integer
    )rmrQ�rr_�kw�drrr�
askintegerWsrsc@seZdZdZdd�ZdS)�_QueryFloatzNot a floating point value.cCs|�|j���Sr
)Z	getdoublercrnrCrrrriisz_QueryFloat.getresultNrorrrrrtfsrtcKst||f|�}|jS)z�get a float from the user

    Arguments:

        title -- the dialog title
        prompt -- the label text
        **kw -- see SimpleDialog class

    Return value is a float
    )rtrQrprrr�askfloatmsruc@s$eZdZdd�Zdd�Zdd�ZdS)�_QueryStringcOs6d|kr|d|_|d=nd|_tj|f|�|�dS)N�show)�_QueryString__showr^r2)r�argsrqrrrr2}s

z_QueryString.__init__cCs(t�||�}|jdk	r$|j|jd�|S)N)rw)r^rRrxZ	configure)rr.rcrrrrR�s
z_QueryString.bodycCs
|j��Sr
)rcrnrCrrrri�sz_QueryString.getresultN)rHrIrJr2rRrirrrrrv|srvcKst||f|�}|jS)z�get a string from the user

    Arguments:

        title -- the dialog title
        prompt -- the label text
        **kw -- see SimpleDialog class

    Return value is a string
    )rvrQrprrr�	askstring�srz�__main__cCsLt�}|fdd�}t|d|d�}|��t|d|jd�}|��|��dS)NcSs^t|ddddgdddd�}t|���ttd	d
dd��ttd	d
ddd��ttd	d��dS)Nz�This is a test dialog.  Would this have been an actual dialog, the buttons below would have been glowing in soft pink light.
Do you believe this?ZYesZNorXr�zTest Dialog)rr/r$r#rZSpamz	Egg count�)rbzEgg weight
(in tons)r	�d)r`raz	Egg label)r�printrDrsrurz)rrrrrr�doit�s�

�ztest.<locals>.doitZTestrZQuit)ZTkr)r rGrA)rr��t�qrrr�test�sr�N)r]ZtkinterrrrrrKrr^rmrsrtrurvrzrHr�rrrr�<module>s V
Ctkinter/__pycache__/simpledialog.cpython-38.opt-2.pyc000064400000022062151153537530016507 0ustar00U

e5d�-�@s�ddlTddlmZmZGdd�d�ZGdd�de�Zdd�ZGd	d
�d
e�ZGdd�de�Zd
d�Z	Gdd�de�Z
dd�ZGdd�de�Zdd�Z
edkr�dd�Ze�dS)�)�*)�
messagebox�_get_default_rootc@sLeZdZdgddddfdd�Zddd�Zd	d
�Zdd�Zd
d�Zdd�ZdS)�SimpleDialog�NcCs|rt||d�|_n
t|�|_|r:|j�|�|j�|�t|j�t|j|dd�|_|jjdtd�t	|j�|_
|j
��||_||_||_
|j�d|j�tt|��D]L}||}	t|j
|	||fdd�d	�}
||kr�|
jtd
d�|
jttdd�q�|j�d
|j�|�|�dS)N)�class_i�)�textZaspect�)�expand�fill�<Return>cSs
|�|�S�N)�done��self�num�r�,/usr/lib64/python3.8/tkinter/simpledialog.py�<lambda>8�z'SimpleDialog.__init__.<locals>.<lambda>�r�command�)ZreliefZborderwidth)�siderr
�WM_DELETE_WINDOW)�Toplevel�root�titleZiconname�
_setup_dialogZMessage�message�packZBOTH�Frame�framer�cancel�default�bind�return_event�range�len�ButtonZconfigZRIDGE�LEFT�protocol�wm_delete_window�_set_transient)r�masterr�buttonsr$r#rrr�s�brrr�__init__ s2


�zSimpleDialog.__init__��?�333333�?c
Cs|j}|��|�|�|��|��rJ|��}|��}|��}|��}n|�	�}|�
�}d}}|��}	|��}
|||	|}|||
|}||	|�	�kr�|�	�|	}n|dkr�d}||
|�
�kr�|�
�|
}n|dkr�d}|�
d||f�|��dS)Nr�+%d+%d)r�withdraw�	transient�update_idletasksZwinfo_ismappedZwinfo_widthZwinfo_height�winfo_rootx�winfo_rootyZwinfo_screenwidthZwinfo_screenheightZwinfo_reqwidthZwinfo_reqheight�geometry�	deiconify)
rr.ZrelxZrelyZwidgetZm_widthZm_heightZm_xZm_yZw_widthZw_height�x�yrrrr-?s4

zSimpleDialog._set_transientcCs.|j��|j��|j��|j��|jSr
)r�wait_visibility�grab_set�mainloop�destroyr�rrrr�go\s




zSimpleDialog.gocCs&|jdkr|j��n|�|j�dSr
)r$r�bellr�rZeventrrrr&cs
zSimpleDialog.return_eventcCs&|jdkr|j��n|�|j�dSr
)r#rrErrCrrrr,is
zSimpleDialog.wm_delete_windowcCs||_|j��dSr
)rr�quitrrrrroszSimpleDialog.done)r3r4)	�__name__�
__module__�__qualname__r2r-rDr&r,rrrrrrs�

rc@sReZdZddd�Zdd�Zdd�Zdd	�Zdd
d�Zddd
�Zdd�Z	dd�Z
dS)�DialogNcCs�|}|std�}t�||�|��|dk	r>|��r>|�|�|rL|�|�t|�||_d|_	t
|�}|�|�|_|j
ddd�|��|js�||_|�d|j�|dk	r�|�d|��d|��df�|��|j��|��|��|�|�dS)Nzcreate dialog window�)�padx�padyrr5�2)rrr2r6Zwinfo_viewabler7rr�parent�resultr!�body�
initial_focusr �	buttonboxr+r#r;r9r:r<�	focus_setr?r@Zwait_window)rrPrr.rRrrrr2{s8	


�
zDialog.__init__cCsd|_t�|�dSr
)rSrrBrCrrrrB�szDialog.destroycCsdSr
r)rr.rrrrR�szDialog.bodycCsvt|�}t|dd|jtd�}|jtddd�t|dd|jd�}|jtddd�|�d|j�|�d	|j�|��dS)
NZOK�
)r�widthrr$rL)rrMrN�Cancel)rrWrrz<Escape>)r!r)�okZACTIVEr r*r#r%)rZbox�wrrrrT�szDialog.buttonboxcCsB|��s|j��dS|��|��z|��W5|��XdSr
)�validaterSrUr6r8r#�applyrFrrrrY�s
z	Dialog.okcCs |jdk	r|j��|��dSr
)rPrUrBrFrrrr#�s

z
Dialog.cancelcCsdS)Nr	rrCrrrr[�szDialog.validatecCsdSr
rrCrrrr\�szDialog.apply)N)N)N)rHrIrJr2rBrRrTrYr#r[r\rrrrrKts
7	


	rKcCs:|jdkr |j�dd|dd�n|jdkr6|�dd�dS)	NZaquaz!::tk::unsupported::MacWindowStyleZstyleZ
moveableModalrZx11z-typeZdialog)Z_windowingsystemZtkZcallZ
wm_attributes)rZrrrrs

�
rc@s.eZdZd
dd�Zdd�Zdd�Zdd	�ZdS)�_QueryDialogNcCs*||_||_||_||_t�|||�dSr
)�prompt�minvalue�maxvalue�initialvaluerKr2)rrr^rar_r`rPrrrr2s
z_QueryDialog.__init__cCsd|_t�|�dSr
)�entryrKrBrCrrrrBsz_QueryDialog.destroycCsrt||jtd�}|jddtd�t|dd�|_|jjddttd�|jdk	rl|j�	d|j�|j�
dt�|jS)N)rZjustifyrrL)�rowrMZstickyrb)�namer	)ZLabelr^r*Zgrid�WZEntryrb�Era�insertZselect_rangeZEND)rr.rZrrrrR s
z_QueryDialog.bodycCs�z|��}Wn,tk
r8tjd|jd|d�YdSX|jdk	rh||jkrhtjdd|j|d�dS|jdk	r�||jkr�tjdd|j|d�dS||_d	S)
Nz
Illegal valuez
Please try again)rPrz	Too smallz2The allowed minimum value is %s. Please try again.z	Too largez2The allowed maximum value is %s. Please try again.r	)�	getresult�
ValueErrorr�showwarning�errormessager_r`rQ)rrQrrrr[.s:�����z_QueryDialog.validate)NNNN)rHrIrJr2rBrRr[rrrrr]
s�

r]c@seZdZdZdd�ZdS)�
_QueryIntegerzNot an integer.cCs|�|j���Sr
)Zgetintrb�getrCrrrrhSsz_QueryInteger.getresultN�rHrIrJrkrhrrrrrlPsrlcKst||f|�}|jSr
)rlrQ�rr^�kw�drrr�
askintegerWsrrc@seZdZdZdd�ZdS)�_QueryFloatzNot a floating point value.cCs|�|j���Sr
)Z	getdoublerbrmrCrrrrhisz_QueryFloat.getresultNrnrrrrrsfsrscKst||f|�}|jSr
)rsrQrorrr�askfloatmsrtc@s$eZdZdd�Zdd�Zdd�ZdS)�_QueryStringcOs6d|kr|d|_|d=nd|_tj|f|�|�dS)N�show)�_QueryString__showr]r2)r�argsrprrrr2}s

z_QueryString.__init__cCs(t�||�}|jdk	r$|j|jd�|S)N)rv)r]rRrwZ	configure)rr.rbrrrrR�s
z_QueryString.bodycCs
|j��Sr
)rbrmrCrrrrh�sz_QueryString.getresultN)rHrIrJr2rRrhrrrrru|srucKst||f|�}|jSr
)rurQrorrr�	askstring�sry�__main__cCsLt�}|fdd�}t|d|d�}|��t|d|jd�}|��|��dS)NcSs^t|ddddgdddd�}t|���ttd	d
dd��ttd	d
ddd��ttd	d��dS)Nz�This is a test dialog.  Would this have been an actual dialog, the buttons below would have been glowing in soft pink light.
Do you believe this?ZYesZNorXr�zTest Dialog)rr/r$r#rZSpamz	Egg count�)razEgg weight
(in tons)r	�d)r_r`z	Egg label)r�printrDrrrtry)rrqrrr�doit�s�

�ztest.<locals>.doitZTestrZQuit)ZTkr)r rGrA)rr�t�qrrr�test�sr�N)ZtkinterrrrrrKrr]rlrrrsrtruryrHr�rrrr�<module>sV
Ctkinter/__pycache__/constants.cpython-38.pyc000064400000003170151153537530015111 0ustar00U

e5d��@s8dZZZdZZZdZdZdZdZ	dZ
dZdZd	Z
d
ZdZdZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#d Z$d!Z%d"Z&d#Z'd$Z(d%Z)d&Z*d'Z+d(Z,d)Z-d*Z.d+Z/d,Z0d-Z1d.Z2d/Z3d0Z4d1Z5d2Z6d3Z7d4Z8d5Z9d6Z:d7Z;d8Z<d9Z=d:Z>d;Z?d<Z@d=ZAd>ZBd?ZCd@ZDdAZEdBZFdCZGdDZHdEZIdFZJdGZKdHZLdIS)J���n�s�w�eZnw�sw�neZse�nsZewZnsew�centerZnone�x�yZboth�left�top�rightZbottomZraisedZsunkenZflatZridgeZgrooveZsolidZ
horizontalZverticalZnumeric�charZwordZbaselineZinsideZoutsideZselz	sel.firstzsel.last�end�insertZcurrentZanchor�allZnormalZdisabledZactiveZhiddenZcascadeZcheckbuttonZcommandZradiobuttonZ	separatorZsingleZbrowseZmultipleZextendedZdotboxZ	underlineZpiesliceZchordZarc�firstZlastZbuttZ
projecting�roundZbevelZmiterZmovetoZscrollZunitsZpagesN)MZNOZFALSEZOFFZYESZTRUEZON�N�S�W�EZNWZSWZNEZSEZNSZEWZNSEWZCENTERZNONE�X�YZBOTHZLEFTZTOPZRIGHTZBOTTOMZRAISEDZSUNKENZFLATZRIDGEZGROOVEZSOLIDZ
HORIZONTALZVERTICALZNUMERICZCHARZWORDZBASELINEZINSIDEZOUTSIDEZSELZ	SEL_FIRSTZSEL_LASTZENDZINSERTZCURRENTZANCHORZALLZNORMALZDISABLEDZACTIVEZHIDDENZCASCADEZCHECKBUTTONZCOMMANDZRADIOBUTTONZ	SEPARATORZSINGLEZBROWSEZMULTIPLEZEXTENDEDZDOTBOXZ	UNDERLINEZPIESLICEZCHORDZARCZFIRSTZLASTZBUTTZ
PROJECTINGZROUNDZBEVELZMITERZMOVETOZSCROLLZUNITSZPAGES�rr�)/usr/lib64/python3.8/tkinter/constants.py�<module>s�tkinter/__pycache__/constants.cpython-38.opt-1.pyc000064400000003170151153537530016050 0ustar00U

e5d��@s8dZZZdZZZdZdZdZdZ	dZ
dZdZd	Z
d
ZdZdZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#d Z$d!Z%d"Z&d#Z'd$Z(d%Z)d&Z*d'Z+d(Z,d)Z-d*Z.d+Z/d,Z0d-Z1d.Z2d/Z3d0Z4d1Z5d2Z6d3Z7d4Z8d5Z9d6Z:d7Z;d8Z<d9Z=d:Z>d;Z?d<Z@d=ZAd>ZBd?ZCd@ZDdAZEdBZFdCZGdDZHdEZIdFZJdGZKdHZLdIS)J���n�s�w�eZnw�sw�neZse�nsZewZnsew�centerZnone�x�yZboth�left�top�rightZbottomZraisedZsunkenZflatZridgeZgrooveZsolidZ
horizontalZvertical�numeric�charZwordZbaselineZinsideZoutsideZselz	sel.firstzsel.last�end�insertZcurrentZanchor�allZnormalZdisabledZactiveZhiddenZcascadeZcheckbuttonZcommandZradiobuttonZ	separatorZsingleZbrowseZmultipleZextendedZdotboxZ	underlineZpiesliceZchordZarc�firstZlastZbuttZ
projecting�roundZbevelZmiterZmovetoZscrollZunitsZpagesN)MZNOZFALSEZOFFZYESZTRUEZON�N�S�W�EZNWZSWZNEZSEZNSZEWZNSEWZCENTERZNONE�X�YZBOTHZLEFTZTOPZRIGHTZBOTTOMZRAISEDZSUNKENZFLATZRIDGEZGROOVEZSOLIDZ
HORIZONTALZVERTICALZNUMERICZCHARZWORDZBASELINEZINSIDEZOUTSIDEZSELZ	SEL_FIRSTZSEL_LASTZENDZINSERTZCURRENTZANCHORZALLZNORMALZDISABLEDZACTIVEZHIDDENZCASCADEZCHECKBUTTONZCOMMANDZRADIOBUTTONZ	SEPARATORZSINGLEZBROWSEZMULTIPLEZEXTENDEDZDOTBOXZ	UNDERLINEZPIESLICEZCHORDZARCZFIRSTZLASTZBUTTZ
PROJECTINGZROUNDZBEVELZMITERZMOVETOZSCROLLZUNITSZPAGES�rr�)/usr/lib64/python3.8/tkinter/constants.py�<module>s�tkinter/__pycache__/messagebox.cpython-38.opt-2.pyc000064400000005123151153537530016172 0ustar00U

e5d}�@sHddlmZdZdZdZdZdZdZdZd	Z	d
Z
dZdZd
Z
dZdZdZdZdZGdd�de�Zd5dd�Zd6dd�Zd7dd�Zd8dd�Zd9dd�Zd:dd �Zd;d!d"�Zd<d#d$�Zd=d%d&�Zed'k�rDeded(d)��eded(d*��eded(d+��eded(d,��ed-ed(d.��ed/ed(d0��ed1ed(d2��ed3ed(d4��dS)>�)�Dialog�error�infoZquestionZwarningZabortretryignore�okZokcancelZretrycancelZyesnoZyesnocancel�abortZretry�ignoreZcancelZyesZnoc@seZdZdZdS)�MessageZ
tk_messageBoxN)�__name__�
__module__�__qualname__Zcommand�rr�*/usr/lib64/python3.8/tkinter/messagebox.pyr9srNcKsl|rd|kr||d<|r(d|kr(||d<|r4||d<|r@||d<tf|���}t|t�rd|r`tStSt|�S)NZicon�type�title�message)rZshow�
isinstance�bool�YES�NO�str)rrZ_iconZ_type�options�resrrr
�_showCs
rcKst||ttf|�S�N)r�INFO�OK�rrrrrr
�showinfoRsrcKst||ttf|�Sr)r�WARNINGrrrrr
�showwarningWsrcKst||ttf|�Sr)r�ERRORrrrrr
�	showerror\sr!cKst||ttf|�Sr)r�QUESTION�YESNOrrrr
�askquestionasr$cKst||ttf|�}|tkSr)rr"�OKCANCELr�rrr�srrr
�askokcancelfsr(cKst||ttf|�}|tkSr)rr"r#rr&rrr
�askyesnolsr)cKs.t||ttf|�}t|�}|tkr&dS|tkSr)rr"�YESNOCANCELr�CANCELrr&rrr
�askyesnocancelrs
r,cKst||ttf|�}|tkSr)rr�RETRYCANCEL�RETRYr&rrr
�askretrycancel|sr/�__main__ZSpamzEgg InformationzEgg Warningz	Egg Alertz	Question?ZproceedzProceed?zyes/nozGot it?z
yes/no/cancelzWant it?z	try againz
Try again?)NNNN)NN)NN)NN)NN)NN)NN)NN)NN)Ztkinter.commondialogrr rr"rZABORTRETRYIGNORErr%r-r#r*ZABORTr.ZIGNOREr+rrrrrrr!r$r(r)r,r/r	�printrrrr
�<module>sH










	
tkinter/__pycache__/filedialog.cpython-38.opt-2.pyc000064400000024362151153537530016142 0ustar00U

e5d�8�@sddlTddlmZddlmZddlmZddlZddlZiZGdd�d�Z	Gdd	�d	e	�Z
Gd
d�de	�ZGdd
�d
ej�ZGdd�de�Z
Gdd�de�ZGdd�dej�Zdd�Zdd�Zdd�Zd'dd�Zd(dd�Zd)d d!�Zd"d#�Zd$d%�Zed&k�re�dS)*�)�*)�Dialog)�commondialog)�
_setup_dialogNc@s�eZdZdZd#dd�Zejdddfdd�Zd$d	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zd%dd�Zdd�Zdd�Zd&dd�Zdd �Zd!d"�ZdS)'�
FileDialogzFile Selection DialogNcCs�|dkr|j}||_d|_t|�|_|j�|�|j�|�t|j�t|j�|_|jj	t
td�t|j�|_
|j
j	t
td�|j
�d|j�t|j�|_|jj	ttd�|j�d|j�t|j�|_|jj	ttd�t|j�|_|jj	ttd�t|jd|jdfd�|_|jj	tttd�|j��}|j�|dd�|dd��|j�d	|j�|j�d
|j�|jj|jdfd�t|j�|_ |j j	t!td�t|jd|j dfd�|_"|j"j	t!ttd�|j j|j"dfd�|j"��}|j"�|dd�|dd��|j"�d	|j#�|j"�d
|j$�t%|jd
|j&d�|_'|j'j	t!d�t%|jd|jd�|_(|j(j	t!td�t%|jd|j)d�|_*|j*j	td�|j�+d|j)�|j�d|j)�|j�d|j)�dS)N)�side�fillz<Return>)�expandrr�set)ZexportselectionZyscrollcommand)rr	r�z<ButtonRelease-1>z<Double-ButtonRelease-1>Zyview)�commandZOK)�textr)rZFilter)rr	�CancelZWM_DELETE_WINDOWz<Alt-w>z<Alt-W>),�title�master�	directoryZToplevel�topZiconnamerZFrameZbotframeZpackZBOTTOM�XZEntry�	selectionZbind�ok_event�filterZTOP�filter_commandZmidframeZYESZBOTHZ	ScrollbarZfilesbarZRIGHT�YZListbox�filesZbindtags�files_select_event�files_double_eventZconfigZdirsbarZLEFT�dirs�dirs_select_event�dirs_double_eventZButton�
ok_commandZ	ok_buttonZ
filter_button�cancel_commandZ
cancel_buttonZprotocol)�selfrrZbtags�r"�*/usr/lib64/python3.8/tkinter/filedialog.py�__init__4st

�
 �
 ���zFileDialog.__init__r�cCs�|r|tkrt|\|_}n2tj�|�}tj�|�r<||_ntj�|�\|_}|�|j|�|�|�|�	�|j
��|j�
�|j��d|_|j��|r�|��\}}|jr�tj�|j�}||ft|<|j��|jS�N)�dialogstatesr�os�path�
expanduser�isdir�split�
set_filter�
set_selectionrrZ	focus_setrZwait_visibilityZgrab_set�howrZmainloop�
get_filter�dirnameZdestroy)r!Zdir_or_file�pattern�default�keyrr"r"r#�gots*





z
FileDialog.gocCs||_|j��dSr&)r/r�quit)r!r/r"r"r#r6�szFileDialog.quitcCs|��dSr&)r�r!�eventr"r"r#r�szFileDialog.dirs_double_eventcCs@|��\}}|j�d�}tj�tj�|j|��}|�||�dS�NZactive)	r0r�getr(r)�normpath�joinrr-)r!r8�dir�patZsubdirr"r"r#r�szFileDialog.dirs_select_eventcCs|��dSr&�rr7r"r"r#r�szFileDialog.files_double_eventcCs|j�d�}|�|�dSr9)rr:r.)r!r8�filer"r"r#r�szFileDialog.files_select_eventcCs|��dSr&r?r7r"r"r#r�szFileDialog.ok_eventcCs|�|���dSr&)r6�
get_selection�r!r"r"r#r�szFileDialog.ok_commandcCs&|��\}}zt�|�}Wn tk
r:|j��YdSX||_|�||�|��tj	g}g}|D]@}tj
�||�}tj
�|�r�|�
|�qft�||�rf|�
|�qf|j�dt�|D]}|j�t|�q�|j�dt�|D]}|j�t|�q�tj
�|���\}	}
|
tjk�rd}
|�|
�dS)Nrr%)r0r(�listdir�OSErrorr�bellrr-�sort�pardirr)r<r+�append�fnmatchr�delete�END�insertrr,rA�curdirr.)r!r8r=r>�namesZsubdirsZ
matchingfiles�name�fullname�head�tailr"r"r#r�s6
zFileDialog.filter_commandcCsN|j��}tj�|�}|dd�tjks4tj�|�rBtj�|d�}tj�|�S)N���r)	rr:r(r)r*�sepr+r<r,)r!rr"r"r#r0�s

zFileDialog.get_filtercCs|j��}tj�|�}|Sr&)rr:r(r)r*�r!r@r"r"r#rA�s
zFileDialog.get_selectioncCs|��dSr&)r6r7r"r"r#r �szFileDialog.cancel_commandcCs�tj�|�sPzt��}Wntk
r0d}YnX|rPtj�||�}tj�|�}|j�dt	�|j�
t	tj�|pttj|pzd��dS)Nrr)r(r)�isabs�getcwdrDr<r;rrJrKrLrM)r!r=r>�pwdr"r"r#r-�s
zFileDialog.set_filtercCs,|j�dt�|j�ttj�|j|��dS)Nr)rrJrKrLr(r)r<rrUr"r"r#r.�szFileDialog.set_selection)N)N)N)N)�__name__�
__module__�__qualname__rr$r(rMr5r6rrrrrrrr0rAr r-r.r"r"r"r#rs 
@


rc@seZdZdZdd�ZdS)�LoadFileDialogzLoad File Selection DialogcCs.|��}tj�|�s |j��n
|�|�dSr&)rAr(r)�isfilerrEr6rUr"r"r#r�szLoadFileDialog.ok_commandN�rYrZr[rrr"r"r"r#r\�sr\c@seZdZdZdd�ZdS)�SaveFileDialogzSave File Selection DialogcCs�|��}tj�|�rZtj�|�r.|j��dSt|jdd|fdddd�}|j	dkr�dSn*tj�
|�\}}tj�|�s�|j��dS|�|�dS)Nz Overwrite Existing File QuestionzOverwrite existing file %r?Z	questheadr)ZYesr)rr
Zbitmapr3Zstringsr)rAr(r)�existsr+rrErrZnumr,r6)r!r@�drQrRr"r"r#r�s&
�

zSaveFileDialog.ok_commandNr^r"r"r"r#r_�sr_c@seZdZdd�Zdd�ZdS)�_DialogcCs2zt|jd�|jd<Wntk
r,YnXdS)N�	filetypes)�tuple�options�KeyErrorrBr"r"r#�_fixoptions,sz_Dialog._fixoptionscCsR|rHz
|j}Wntk
r"YnXtj�|�\}}||jd<||jd<||_|S)N�
initialdirZinitialfile)�string�AttributeErrorr(r)r,re�filename�r!�widget�resultr)r@r"r"r#�
_fixresult3s


z_Dialog._fixresultN)rYrZr[rgror"r"r"r#rb*srbc@seZdZdZdd�ZdS)�OpenZtk_getOpenFilecCsxt|t�rBtdd�|D��}|r>tj�|d�\}}||jd<|S|j��sjd|jkrj|�||j�	|��St
�|||�S)NcSsg|]}t|d|��qS)ri)�getattr)�.0�rr"r"r#�
<listcomp>Nsz#Open._fixresult.<locals>.<listcomp>rrh�multiple)�
isinstancerdr(r)r,reZtkZwantobjectsroZ	splitlistrbrlr"r"r#roKs

zOpen._fixresultN�rYrZr[rror"r"r"r#rpFsrpc@seZdZdZdS)�SaveAsZtk_getSaveFileN)rYrZr[rr"r"r"r#rxZsrxc@seZdZdZdd�ZdS)�	DirectoryZtk_chooseDirectorycCs8|r.z
|j}Wntk
r"YnX||jd<||_|S)Nrh)rirjrer)r!rmrnr"r"r#rofs

zDirectory._fixresultNrwr"r"r"r#ryasrycKstf|���Sr&�rp�show�rer"r"r#�askopenfilenamewsr}cKstf|���Sr&)rxr{r|r"r"r#�asksaveasfilename}sr~cKsd|d<tf|���S)Nrrurzr|r"r"r#�askopenfilenames�srrscKs tf|���}|rt||�SdSr&)rpr{�open��modererkr"r"r#�askopenfile�s
r�cKs4tf|�}|r0g}|D]}|�t||��q|}|Sr&)rrHr�)r�rerZofilesrkr"r"r#�askopenfiles�s
r��wcKs tf|���}|rt||�SdSr&)rxr{r�r�r"r"r#�
asksaveasfile�s
r�cKstf|���Sr&)ryr{r|r"r"r#�askdirectory�sr�c
	Cs�t�}|��t|�}|jdd�}t|�}|jdd�}t||�d}ddl}z&ddl}|�|j	d�|�
|j�}Wntt
fk
r�YnXtdgd�}zt|d�}|��Wn$td	�t|��d
�YnXtd|�|��t�}	td|	�|��dS)
N�test)r4zutf-8rr%)z	all filesr)rcrszCould not open File: rr�Zsaveas)ZTkZwithdrawr\r5r_�print�sys�locale�	setlocale�LC_ALL�nl_langinfo�CODESET�ImportErrorrjr}r��close�exc_info�encoder~)
�root�fdZloadfileZsavefile�encr�r�Zopenfilename�fpZsaveasfilenamer"r"r#r��s2

r��__main__)rs)rs)r�)ZtkinterZtkinter.dialogrrZtkinter.simpledialogrr(rIr'rr\r_rbrprxryr}r~rr�r�r�r�r�rYr"r"r"r#�<module>s0I9
	

	,
tkinter/__pycache__/dnd.cpython-38.opt-2.pyc000064400000014246151153537530014610 0ustar00U

e5d�,�@sTddlZdd�ZGdd�d�ZGdd�d�ZGdd	�d	�Zd
d�ZedkrPe�dS)
�NcCst||�}|jr|SdSdS�N)�
DndHandler�root)�source�event�h�r�#/usr/lib64/python3.8/tkinter/dnd.py�	dnd_startls
r
c@sDeZdZdZdd�Zdd�Zdd�Zdd	�Zdd
d�Zdd
d�Z	dS)rNcCs�|jdkrdS|j��}z|jWdStk
rD||_||_YnX||_d|_|j|_}|j|_	}d||f|_
|dp�d|_|�|j
|j
�|�d|j�d|d<dS)N�z<B%d-ButtonRelease-%d>�cursor��<Motion>Zhand2)Znum�widgetZ_root�_DndHandler__dnd�AttributeErrorrr�targetZinitial_button�initial_widget�release_pattern�save_cursor�bind�
on_release�	on_motion)�selfrrrZbuttonrrrr	�__init__zs$

zDndHandler.__init__cCs2|j}d|_|r.z|`Wntk
r,YnXdSr)rrr�rrrrr	�__del__�szDndHandler.__del__c	Cs�|j|j}}|j�||�}|j}d}|rbz
|j}Wntk
rHYnX|||�}|rZqb|j}q&|j}||kr�|r�|�	||�n,|r�d|_|�
||�|r�|�||�||_dSr)�x_root�y_rootrZwinfo_containingr�
dnd_acceptrZmasterr�
dnd_motion�	dnd_leave�	dnd_enter)	rr�x�yZ
target_widgetr�
new_target�attrZ
old_targetrrr	r�s.

zDndHandler.on_motioncCs|�|d�dS)N���finish�rrrrr	r�szDndHandler.on_releasecCs|�|d�dS)Nrr(r*rrr	�cancel�szDndHandler.cancelrc
Cs�|j}|j}|j}|j}zf|`|j�|j�|j�d�|j|d<d|_|_|_|_|r||rp|�	||�n|�
||�W5|�||�XdS)Nrr)rrrr�dnd_endrZunbindrr�
dnd_commitr!)rrZcommitrrrrrrr	r)�s
zDndHandler.finish)N)r)
�__name__�
__module__�__qualname__rrrrrr+r)rrrr	rvs	
rc@sNeZdZdd�Zddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dS)�IconcCs||_d|_|_|_dSr)�name�canvas�label�id)rr2rrr	r�sz
Icon.__init__�
cCs�||jkr |j�|j||�dS|jr.|��|s6dStj||jddd�}|j|||dd�}||_||_||_|�	d|j
�dS)N�Zraised)�textZborderwidthZreliefZnw)ZwindowZanchorz
<ButtonPress>)r3�coordsr5�detach�tkinterZLabelr2Z
create_windowr4r�press)rr3r#r$r4r5rrr	�attach�s 

�zIcon.attachcCsB|j}|sdS|j}|j}d|_|_|_|�|�|��dSr)r3r5r4�deleteZdestroy)rr3r5r4rrr	r:�s
zIcon.detachcCs4t||�r0|j|_|j|_|j�|j�\|_|_	dSr)
r
r#�x_offr$�y_offr3r9r5�x_orig�y_origr*rrr	r<�s
z
Icon.presscCs(|�|j|�\}}|j�|j||�dSr)�wherer3r9r5)rrr#r$rrr	�move�sz	Icon.movecCs|j�|j|j|j�dSr)r3r9r5rArB)rrrr	�putback�szIcon.putbackcCs8|��}|��}|j|}|j|}||j||jfSr)Zwinfo_rootxZwinfo_rootyrrr?r@)rr3rZx_orgZy_orgr#r$rrr	rC�s


z
Icon.wherecCsdSrr)rrrrrr	r,szIcon.dnd_endN)r6r6)r.r/r0rr=r:r<rDrErCr,rrrr	r1�s


r1c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�TestercCs>t�|�|_tj|jddd�|_|jjddd�|j|j_dS)N�d)�widthZheightZbothr')Zfill�expand)r;ZToplevel�topZCanvasr3�packrrrrr	rszTester.__init__cCs|Srr�rrrrrr	rszTester.dnd_acceptcCsp|j��|�|j|�\}}|j�|j�\}}}}||||}	}
|j�||||	||
�|_|�||�dSr)r3�	focus_setrC�bboxr5Zcreate_rectangle�dndidr )rrrr#r$�x1�y1�x2�y2ZdxZdyrrr	r"s
zTester.dnd_enterc	CsF|�|j|�\}}|j�|j�\}}}}|j�|j||||�dSr)rCr3rNrOrD)	rrrr#r$rPrQrRrSrrr	r szTester.dnd_motioncCs"|j��|j�|j�d|_dSr)rJrMr3r>rOrLrrr	r!$s
zTester.dnd_leavecCs2|�||�|�|j|�\}}|�|j||�dSr)r!rCr3r=)rrrr#r$rrr	r-)szTester.dnd_commitN)	r.r/r0rrr"r r!r-rrrr	rFsrFcCs�t��}|�d�tj|jdd���t|�}|j�d�t|�}|j�d�t|�}|j�d�td�}td�}td	�}|�	|j
�|�	|j
�|�	|j
�|��dS)
Nz+1+1ZQuit)Zcommandr8z+1+60z+120+60z+240+60ZICON1ZICON2ZICON3)r;ZTkZgeometryZButton�quitrKrFrJr1r=r3Zmainloop)r�t1�t2Zt3Zi1Zi2Zi3rrr	�test/s 
rW�__main__)r;r
rr1rFrWr.rrrr	�<module>gs
Y=#tkinter/__pycache__/__main__.cpython-38.opt-1.pyc000064400000000462151153537530015555 0ustar00U

e5d��@s<dZddlZejd�d�r&dejd<ddlmZe�dS)zMain entry point�Nz__main__.pyzpython -m tkinter�)�_test)�__doc__�sys�argv�endswith�r�main�r
r
�(/usr/lib64/python3.8/tkinter/__main__.py�<module>s

tkinter/__pycache__/scrolledtext.cpython-38.pyc000064400000004203151153537530015607 0ustar00U

e5d�@sldZdgZddlmZmZmZmZmZmZddl	m
Z
mZmZm
Z
Gdd�de�Zdd�Zedkrhe�d	S)
aA ScrolledText widget feels like a text widget but also has a
vertical scroll bar on its right.  (Later, options may be added to
add a horizontal bar as well, to make the bars disappear
automatically when not needed, to move them to the other side of the
window, etc.)

Configuration options are passed to the Text widget.
A Frame widget is inserted between the master and the text, to hold
the Scrollbar widget.
Most methods calls are inherited from the Text widget; Pack, Grid and
Place methods are redirected to the Frame widget however.
�ScrolledText�)�Frame�Text�	Scrollbar�Pack�Grid�Place)�RIGHT�LEFT�Y�BOTHc@seZdZddd�Zdd�ZdS)rNcKs�t|�|_t|j�|_|jjttd�|�d|jji�t	j
||jf|�|jttdd�|j
|jd<tt	���}tt���tt���Btt���B}|�|�}|D]4}|ddkr�|dkr�|d	kr�t||t|j|��q�dS)
N)�side�fillZyscrollcommandT)r
r�expandZcommandr�_ZconfigZ	configure)r�framerZvbar�packr	r�update�setr�__init__r
rZyview�vars�keysrrr�
difference�setattr�getattr)�selfZmaster�kwZ
text_meths�methods�m�r�,/usr/lib64/python3.8/tkinter/scrolledtext.pyrs
$
zScrolledText.__init__cCs
t|j�S)N)�strr)rrrr �__str__)szScrolledText.__str__)N)�__name__�
__module__�__qualname__rr"rrrr rs
cCsHddlm}tddd�}|�|t�|jttdd�|��|�	�dS)Nr)�ENDZwhite�
)ZbgZheightT)rr
r)
�tkinter.constantsr&r�insert�__doc__rrr
Z	focus_setZmainloop)r&Zstextrrr �example-sr+�__main__N)r*�__all__Ztkinterrrrrrrr(r	r
rrrr+r#rrrr �<module>s
 
tkinter/__pycache__/simpledialog.cpython-38.pyc000064400000025370151153537530015554 0ustar00U

e5d�-�@s�dZddlTddlmZmZGdd�d�ZGdd�de�Zdd	�ZGd
d�de�ZGdd
�d
e�Z	dd�Z
Gdd�de�Zdd�ZGdd�de�Z
dd�Zedkr�dd�Ze�dS)a&This modules handles dialog boxes.

It contains the following public symbols:

SimpleDialog -- A simple but flexible modal dialog box

Dialog -- a base class for dialogs

askinteger -- get an integer from the user

askfloat -- get a float from the user

askstring -- get a string from the user
�)�*)�
messagebox�_get_default_rootc@sLeZdZdgddddfdd�Zddd�Zd	d
�Zdd�Zd
d�Zdd�ZdS)�SimpleDialog�NcCs|rt||d�|_n
t|�|_|r:|j�|�|j�|�t|j�t|j|dd�|_|jjdtd�t	|j�|_
|j
��||_||_||_
|j�d|j�tt|��D]L}||}	t|j
|	||fdd�d	�}
||kr�|
jtd
d�|
jttdd�q�|j�d
|j�|�|�dS)N)�class_i�)�textZaspect�)�expand�fill�<Return>cSs
|�|�S�N)�done��self�num�r�,/usr/lib64/python3.8/tkinter/simpledialog.py�<lambda>8�z'SimpleDialog.__init__.<locals>.<lambda>�r�command�)ZreliefZborderwidth)�siderr
�WM_DELETE_WINDOW)�Toplevel�root�titleZiconname�
_setup_dialogZMessage�message�packZBOTH�Frame�framer�cancel�default�bind�return_event�range�len�ButtonZconfigZRIDGE�LEFT�protocol�wm_delete_window�_set_transient)r�masterr�buttonsr$r#rrr�s�brrr�__init__ s2


�zSimpleDialog.__init__��?�333333�?c
Cs|j}|��|�|�|��|��rJ|��}|��}|��}|��}n|�	�}|�
�}d}}|��}	|��}
|||	|}|||
|}||	|�	�kr�|�	�|	}n|dkr�d}||
|�
�kr�|�
�|
}n|dkr�d}|�
d||f�|��dS)Nr�+%d+%d)r�withdraw�	transient�update_idletasksZwinfo_ismappedZwinfo_widthZwinfo_height�winfo_rootx�winfo_rootyZwinfo_screenwidthZwinfo_screenheightZwinfo_reqwidthZwinfo_reqheight�geometry�	deiconify)
rr.ZrelxZrelyZwidgetZm_widthZm_heightZm_xZm_yZw_widthZw_height�x�yrrrr-?s4

zSimpleDialog._set_transientcCs.|j��|j��|j��|j��|jSr
)r�wait_visibility�grab_set�mainloop�destroyr�rrrr�go\s




zSimpleDialog.gocCs&|jdkr|j��n|�|j�dSr
)r$r�bellr�rZeventrrrr&cs
zSimpleDialog.return_eventcCs&|jdkr|j��n|�|j�dSr
)r#rrErrCrrrr,is
zSimpleDialog.wm_delete_windowcCs||_|j��dSr
)rr�quitrrrrroszSimpleDialog.done)r3r4)	�__name__�
__module__�__qualname__r2r-rDr&r,rrrrrrs�

rc@sVeZdZdZddd�Zdd�Zdd�Zd	d
�Zddd�Zdd
d�Z	dd�Z
dd�ZdS)�DialogzZClass to open dialogs.

    This class is intended as a base class for custom dialogs
    NcCs�|}|std�}t�||�|��|dk	r>|��r>|�|�|rL|�|�t|�||_d|_	t
|�}|�|�|_|j
ddd�|��|js�||_|�d|j�|dk	r�|�d|��d|��df�|��|j��|��|��|�|�dS)z�Initialize a dialog.

        Arguments:

            parent -- a parent window (the application window)

            title -- the dialog title
        zcreate dialog windowN�)�padx�padyrr5�2)rrr2r6Zwinfo_viewabler7rr�parent�resultr!�body�
initial_focusr �	buttonboxr+r#r;r9r:r<�	focus_setr?r@Zwait_window)rrPrr.rRrrrr2{s8	


�
zDialog.__init__cCsd|_t�|�dS)zDestroy the windowN)rSrrBrCrrrrB�szDialog.destroycCsdS)z�create dialog body.

        return widget that should have initial focus.
        This method should be overridden, and is called
        by the __init__ method.
        Nr)rr.rrrrR�szDialog.bodycCsvt|�}t|dd|jtd�}|jtddd�t|dd|jd�}|jtddd�|�d|j�|�d	|j�|��d
S)z[add standard button box.

        override if you do not want the standard buttons
        ZOK�
)r�widthrr$rL)rrMrN�Cancel)rrWrrz<Escape>N)r!r)�okZACTIVEr r*r#r%)rZbox�wrrrrT�szDialog.buttonboxcCsB|��s|j��dS|��|��z|��W5|��XdSr
)�validaterSrUr6r8r#�applyrFrrrrY�s
z	Dialog.okcCs |jdk	r|j��|��dSr
)rPrUrBrFrrrr#�s

z
Dialog.cancelcCsdS)z�validate the data

        This method is called automatically to validate the data before the
        dialog is destroyed. By default, it always validates OK.
        r	rrCrrrr[�szDialog.validatecCsdS)z�process the data

        This method is called automatically to process the data, *after*
        the dialog is destroyed. By default, it does nothing.
        NrrCrrrr\�szDialog.apply)N)N)N)rHrIrJ�__doc__r2rBrRrTrYr#r[r\rrrrrKts
7	


	rKcCs:|jdkr |j�dd|dd�n|jdkr6|�dd�dS)	NZaquaz!::tk::unsupported::MacWindowStyleZstyleZ
moveableModalrZx11z-typeZdialog)Z_windowingsystemZtkZcallZ
wm_attributes)rZrrrrs

�
rc@s.eZdZd
dd�Zdd�Zdd�Zdd	�ZdS)�_QueryDialogNcCs*||_||_||_||_t�|||�dSr
)�prompt�minvalue�maxvalue�initialvaluerKr2)rrr_rbr`rarPrrrr2s
z_QueryDialog.__init__cCsd|_t�|�dSr
)�entryrKrBrCrrrrBsz_QueryDialog.destroycCsrt||jtd�}|jddtd�t|dd�|_|jjddttd�|jdk	rl|j�	d|j�|j�
dt�|jS)N)rZjustifyrrL)�rowrMZstickyrc)�namer	)ZLabelr_r*Zgrid�WZEntryrc�Erb�insertZselect_rangeZEND)rr.rZrrrrR s
z_QueryDialog.bodycCs�z|��}Wn,tk
r8tjd|jd|d�YdSX|jdk	rh||jkrhtjdd|j|d�dS|jdk	r�||jkr�tjdd|j|d�dS||_d	S)
Nz
Illegal valuez
Please try again)rPrz	Too smallz2The allowed minimum value is %s. Please try again.z	Too largez2The allowed maximum value is %s. Please try again.r	)�	getresult�
ValueErrorr�showwarning�errormessager`rarQ)rrQrrrr[.s:�����z_QueryDialog.validate)NNNN)rHrIrJr2rBrRr[rrrrr^
s�

r^c@seZdZdZdd�ZdS)�
_QueryIntegerzNot an integer.cCs|�|j���Sr
)Zgetintrc�getrCrrrriSsz_QueryInteger.getresultN�rHrIrJrlrirrrrrmPsrmcKst||f|�}|jS)z�get an integer from the user

    Arguments:

        title -- the dialog title
        prompt -- the label text
        **kw -- see SimpleDialog class

    Return value is an integer
    )rmrQ�rr_�kw�drrr�
askintegerWsrsc@seZdZdZdd�ZdS)�_QueryFloatzNot a floating point value.cCs|�|j���Sr
)Z	getdoublercrnrCrrrriisz_QueryFloat.getresultNrorrrrrtfsrtcKst||f|�}|jS)z�get a float from the user

    Arguments:

        title -- the dialog title
        prompt -- the label text
        **kw -- see SimpleDialog class

    Return value is a float
    )rtrQrprrr�askfloatmsruc@s$eZdZdd�Zdd�Zdd�ZdS)�_QueryStringcOs6d|kr|d|_|d=nd|_tj|f|�|�dS)N�show)�_QueryString__showr^r2)r�argsrqrrrr2}s

z_QueryString.__init__cCs(t�||�}|jdk	r$|j|jd�|S)N)rw)r^rRrxZ	configure)rr.rcrrrrR�s
z_QueryString.bodycCs
|j��Sr
)rcrnrCrrrri�sz_QueryString.getresultN)rHrIrJr2rRrirrrrrv|srvcKst||f|�}|jS)z�get a string from the user

    Arguments:

        title -- the dialog title
        prompt -- the label text
        **kw -- see SimpleDialog class

    Return value is a string
    )rvrQrprrr�	askstring�srz�__main__cCsLt�}|fdd�}t|d|d�}|��t|d|jd�}|��|��dS)NcSs^t|ddddgdddd�}t|���ttd	d
dd��ttd	d
ddd��ttd	d��dS)Nz�This is a test dialog.  Would this have been an actual dialog, the buttons below would have been glowing in soft pink light.
Do you believe this?ZYesZNorXr�zTest Dialog)rr/r$r#rZSpamz	Egg count�)rbzEgg weight
(in tons)r	�d)r`raz	Egg label)r�printrDrsrurz)rrrrrr�doit�s�

�ztest.<locals>.doitZTestrZQuit)ZTkr)r rGrA)rr��t�qrrr�test�sr�N)r]ZtkinterrrrrrKrr^rmrsrtrurvrzrHr�rrrr�<module>s V
Ctkinter/__pycache__/font.cpython-38.opt-1.pyc000064400000014241151153537530015003 0ustar00U

e5d@�@szdZddlZddlZdZdZdZdZdd�ZGd	d
�d
�Zd dd�Z	d!d
d�Z
edk�rve��Z
edded�Zee���ee�d��ee�d��ee���ee�d��ee�d��ee
��ee�d�e�d��eeje
d��edd�Zee�d�ejde
d��eje
ded�Ze��eje
de
jd�Ze��eedd���Zejed�ejed�e��dS)"z0.9�NZnormalZroman�boldZitaliccCst|dd�S)zFGiven the name of a tk named font, returns a Font representation.
    T)�name�exists)�Font�r�r�$/usr/lib64/python3.8/tkinter/font.py�
nametofontsr	c@s�eZdZdZe�d�Zdd�Zdd�Zdd�Z	d#dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd$dd�Zdd�Zdd�ZeZd%dd �Zd!d"�Zd	S)&ra�Represents a named font.

    Constructor options are:

    font -- font specifier (name, system font, or (family, size, style)-tuple)
    name -- name to use for this font configuration (defaults to a unique name)
    exists -- does a named font by this name already exist?
       Creates a new named font if False, points to the existing font if True.
       Raises _tkinter.TclError if the assertion is false.

       the following are ignored if font is specified:

    family -- font 'family', e.g. Courier, Times, Helvetica
    size -- font size in points
    weight -- font thickness: NORMAL, BOLD
    slant -- font slant: ROMAN, ITALIC
    underline -- font underlining: false (0), true (1)
    overstrike -- font strikeout: false (0), true (1)

    �cCs:g}|��D]$\}}|�d|�|�t|��qt|�S�N�-)�items�append�str�tuple)�self�kw�options�k�vrrr�_set1s
z	Font._setcCs$g}|D]}|�d|�qt|�Sr)rr)r�argsrrrrr�_get8sz	Font._getcCs:i}tdt|�d�D] }||d|||dd�<q|S)Nr�r
)�range�len)rrr�irrr�_mkdict>szFont._mkdictNFcKs�|st�d�}t|d|�}|r4|�|�dd|��}n
|�|�}|sTdtt|j��}||_	|r�d|_
|j	|�|�dd��kr�tj�d|j	f��|r�|jdd|j	f|��n|jdd	|j	f|��d
|_
||_
|j|_|j|_dS)Nzuse font�tk�font�actualF�namesz$named font %s does not already exist�	configureZcreateT)�tkinter�_get_default_root�getattr�	splitlist�callrr�next�counterr�delete_fontZ_tkinterZTclError�_tk�_split�_call)r�rootrrrrrrrr�__init__Ds,


�z
Font.__init__cCs|jS�Nr�rrrr�__str__cszFont.__str__cCs&t|t�stS|j|jko$|j|jkSr0)�
isinstancer�NotImplementedrr+)r�otherrrr�__eq__fs
zFont.__eq__cCs
|�|�Sr0)�cget)r�keyrrr�__getitem__kszFont.__getitem__cCs|jf||i�dSr0)r")rr8�valuerrr�__setitem__nszFont.__setitem__cCs4z|jr|�dd|j�Wntk
r.YnXdS)Nr�delete)r*r-r�	Exceptionr1rrr�__del__qs
zFont.__del__cCst|jf|���S)z*Return a distinct copy of the current font)rr+r r1rrr�copyxsz	Font.copycCs^d}|rd|f}|r8|d|f}|jdd|jf|��S|�|�|jdd|jf|����SdS)zReturn actual font attributesr�
-displayofrrr N)r-rrr,)r�option�	displayofrrrrr |s�zFont.actualcCs|�dd|jd|�S)zGet font attributer�configr)r-r)rrArrrr7�sz	Font.cgetc	KsB|r"|jdd|jf|�|���n|�|�|�dd|j���SdS)zModify font attributesrrCN)r-rrrr,)rrrrrrC�s��zFont.configcCs2|f}|rd||f}|j�|jdd|jf|���S)zReturn text widthr@r�measure)r+�getintr-r)r�textrBrrrrrD�s
zFont.measurecOs�d}|�dd�}|rd|f}|rL||�|�}|j�|jdd|jf|���S|�|jdd|jf|���}i}tdt|�d�D](}|j�||d	�|||d	d�<q||SdS)
z}Return font metrics.

        For best performance, create a dummy widget
        using this font before calling this method.rrBNr@r�metricsrrr
)	�poprr+rEr-rr,rr)rrrrrB�resrrrrrG�s�&zFont.metrics)NNNF)NN)N)�__name__�
__module__�__qualname__�__doc__�	itertools�countr)rrrr/r2r6r9r;r>r?r r7rCr"rDrGrrrrrs$


	
rcCs6|st�d�}d}|rd|f}|j�|jjd|���S)zGet font families (as a tuple)zuse font.families()rr@r�families)rrP�r#r$rr&r')r.rBrrrrrP�s
rPcCs$|st�d�}|j�|j�dd��S)z'Get names of defined fonts (as a tuple)zuse font.names()rr!rQ)r.rrrr!�s
r!�__main__�times�)�family�size�weightrUrWZhelloZ	linespace)rB)ZCourier�r)rzHello, world)rFrzQuit!)rFZcommandr)rW)NN)N)�__version__rNr#ZNORMALZROMANZBOLDZITALICr	rrPr!rJZTkr.�f�printr rCr7rDrGZLabel�wZpackZButtonZdestroyr?ZfbZmainlooprrrr�<module>sB






tkinter/__pycache__/filedialog.cpython-38.pyc000064400000030021151153537530015167 0ustar00U

e5d�8�@sdZddlTddlmZddlmZddlmZddlZddlZiZ	Gdd�d�Z
Gd	d
�d
e
�ZGdd�de
�ZGd
d�dej�Z
Gdd�de
�ZGdd�de
�ZGdd�dej�Zdd�Zdd�Zdd�Zd(dd�Zd)dd�Zd*d!d"�Zd#d$�Zd%d&�Zed'k�re�dS)+aUFile selection dialog classes.

Classes:

- FileDialog
- LoadFileDialog
- SaveFileDialog

This module also presents tk common file dialogues, it provides interfaces
to the native file dialogues available in Tk 4.2 and newer, and the
directory dialogue available in Tk 8.3 and newer.
These interfaces were written by Fredrik Lundh, May 1997.
�)�*)�Dialog)�commondialog)�
_setup_dialogNc@s�eZdZdZdZd$dd�Zejdddfdd	�Zd%d
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zd&dd�Zdd�Zdd�Zd'dd�Zd d!�Zd"d#�ZdS)(�
FileDialoga�Standard file selection dialog -- no checks on selected file.

    Usage:

        d = FileDialog(master)
        fname = d.go(dir_or_file, pattern, default, key)
        if fname is None: ...canceled...
        else: ...open file...

    All arguments to go() are optional.

    The 'key' argument specifies a key in the global dictionary
    'dialogstates', which keeps track of the values for the directory
    and pattern arguments, overriding the values passed in (it does
    not keep track of the default argument!).  If no key is specified,
    the dialog keeps no memory of previous state.  Note that memory is
    kept even when the dialog is canceled.  (All this emulates the
    behavior of the Macintosh file selection dialogs.)

    zFile Selection DialogNcCs�|dkr|j}||_d|_t|�|_|j�|�|j�|�t|j�t|j�|_|jj	t
td�t|j�|_
|j
j	t
td�|j
�d|j�t|j�|_|jj	ttd�|j�d|j�t|j�|_|jj	ttd�t|j�|_|jj	ttd�t|jd|jdfd�|_|jj	tttd�|j��}|j�|dd�|dd��|j�d	|j�|j�d
|j�|jj|jdfd�t|j�|_ |j j	t!td�t|jd|j dfd�|_"|j"j	t!ttd�|j j|j"dfd�|j"��}|j"�|dd�|dd��|j"�d	|j#�|j"�d
|j$�t%|jd
|j&d�|_'|j'j	t!d�t%|jd|jd�|_(|j(j	t!td�t%|jd|j)d�|_*|j*j	td�|j�+d|j)�|j�d|j)�|j�d|j)�dS)N)�side�fillz<Return>)�expandrr�set)ZexportselectionZyscrollcommand)rr	r�z<ButtonRelease-1>z<Double-ButtonRelease-1>Zyview)�commandZOK)�textr)rZFilter)rr	�CancelZWM_DELETE_WINDOWz<Alt-w>z<Alt-W>),�title�master�	directoryZToplevel�topZiconnamerZFrameZbotframeZpackZBOTTOM�XZEntry�	selectionZbind�ok_event�filterZTOP�filter_commandZmidframeZYESZBOTHZ	ScrollbarZfilesbarZRIGHT�YZListbox�filesZbindtags�files_select_event�files_double_eventZconfigZdirsbarZLEFT�dirs�dirs_select_event�dirs_double_eventZButton�
ok_commandZ	ok_buttonZ
filter_button�cancel_commandZ
cancel_buttonZprotocol)�selfrrZbtags�r"�*/usr/lib64/python3.8/tkinter/filedialog.py�__init__4st

�
 �
 ���zFileDialog.__init__r�cCs�|r|tkrt|\|_}n2tj�|�}tj�|�r<||_ntj�|�\|_}|�|j|�|�|�|�	�|j
��|j�
�|j��d|_|j��|r�|��\}}|jr�tj�|j�}||ft|<|j��|jS�N)�dialogstatesr�os�path�
expanduser�isdir�split�
set_filter�
set_selectionrrZ	focus_setrZwait_visibilityZgrab_set�howrZmainloop�
get_filter�dirnameZdestroy)r!Zdir_or_file�pattern�default�keyrr"r"r#�gots*





z
FileDialog.gocCs||_|j��dSr&)r/r�quit)r!r/r"r"r#r6�szFileDialog.quitcCs|��dSr&)r�r!�eventr"r"r#r�szFileDialog.dirs_double_eventcCs@|��\}}|j�d�}tj�tj�|j|��}|�||�dS�NZactive)	r0r�getr(r)�normpath�joinrr-)r!r8�dir�patZsubdirr"r"r#r�szFileDialog.dirs_select_eventcCs|��dSr&�rr7r"r"r#r�szFileDialog.files_double_eventcCs|j�d�}|�|�dSr9)rr:r.)r!r8�filer"r"r#r�szFileDialog.files_select_eventcCs|��dSr&r?r7r"r"r#r�szFileDialog.ok_eventcCs|�|���dSr&)r6�
get_selection�r!r"r"r#r�szFileDialog.ok_commandcCs&|��\}}zt�|�}Wn tk
r:|j��YdSX||_|�||�|��tj	g}g}|D]@}tj
�||�}tj
�|�r�|�
|�qft�||�rf|�
|�qf|j�dt�|D]}|j�t|�q�|j�dt�|D]}|j�t|�q�tj
�|���\}	}
|
tjk�rd}
|�|
�dS)Nrr%)r0r(�listdir�OSErrorr�bellrr-�sort�pardirr)r<r+�append�fnmatchr�delete�END�insertrr,rA�curdirr.)r!r8r=r>�namesZsubdirsZ
matchingfiles�name�fullname�head�tailr"r"r#r�s6
zFileDialog.filter_commandcCsN|j��}tj�|�}|dd�tjks4tj�|�rBtj�|d�}tj�|�S)N���r)	rr:r(r)r*�sepr+r<r,)r!rr"r"r#r0�s

zFileDialog.get_filtercCs|j��}tj�|�}|Sr&)rr:r(r)r*�r!r@r"r"r#rA�s
zFileDialog.get_selectioncCs|��dSr&)r6r7r"r"r#r �szFileDialog.cancel_commandcCs�tj�|�sPzt��}Wntk
r0d}YnX|rPtj�||�}tj�|�}|j�dt	�|j�
t	tj�|pttj|pzd��dS)Nrr)r(r)�isabs�getcwdrDr<r;rrJrKrLrM)r!r=r>�pwdr"r"r#r-�s
zFileDialog.set_filtercCs,|j�dt�|j�ttj�|j|��dS)Nr)rrJrKrLr(r)r<rrUr"r"r#r.�szFileDialog.set_selection)N)N)N)N)�__name__�
__module__�__qualname__�__doc__rr$r(rMr5r6rrrrrrrr0rAr r-r.r"r"r"r#rs"
@


rc@seZdZdZdZdd�ZdS)�LoadFileDialogz8File selection dialog which checks that the file exists.zLoad File Selection DialogcCs.|��}tj�|�s |j��n
|�|�dSr&)rAr(r)�isfilerrEr6rUr"r"r#r�szLoadFileDialog.ok_commandN�rYrZr[r\rrr"r"r"r#r]�sr]c@seZdZdZdZdd�ZdS)�SaveFileDialogz@File selection dialog which checks that the file may be created.zSave File Selection DialogcCs�|��}tj�|�rZtj�|�r.|j��dSt|jdd|fdddd�}|j	dkr�dSn*tj�
|�\}}tj�|�s�|j��dS|�|�dS)Nz Overwrite Existing File QuestionzOverwrite existing file %r?Z	questheadr)ZYesr)rr
Zbitmapr3Zstringsr)rAr(r)�existsr+rrErrZnumr,r6)r!r@�drQrRr"r"r#r�s&
�

zSaveFileDialog.ok_commandNr_r"r"r"r#r`�sr`c@seZdZdd�Zdd�ZdS)�_DialogcCs2zt|jd�|jd<Wntk
r,YnXdS)N�	filetypes)�tuple�options�KeyErrorrBr"r"r#�_fixoptions,sz_Dialog._fixoptionscCsR|rHz
|j}Wntk
r"YnXtj�|�\}}||jd<||jd<||_|S)N�
initialdirZinitialfile)�string�AttributeErrorr(r)r,rf�filename�r!�widget�resultr)r@r"r"r#�
_fixresult3s


z_Dialog._fixresultN)rYrZr[rhrpr"r"r"r#rc*srcc@seZdZdZdZdd�ZdS)�Open�Ask for a filename to openZtk_getOpenFilecCsxt|t�rBtdd�|D��}|r>tj�|d�\}}||jd<|S|j��sjd|jkrj|�||j�	|��St
�|||�S)NcSsg|]}t|d|��qS)rj)�getattr)�.0�rr"r"r#�
<listcomp>Nsz#Open._fixresult.<locals>.<listcomp>rri�multiple)�
isinstancerer(r)r,rfZtkZwantobjectsrpZ	splitlistrcrmr"r"r#rpKs

zOpen._fixresultN�rYrZr[r\rrpr"r"r"r#rqFsrqc@seZdZdZdZdS)�SaveAs�Ask for a filename to save asZtk_getSaveFileN)rYrZr[r\rr"r"r"r#rzZsrzc@seZdZdZdZdd�ZdS)�	DirectoryzAsk for a directoryZtk_chooseDirectorycCs8|r.z
|j}Wntk
r"YnX||jd<||_|S)Nri)rjrkrfr)r!rnror"r"r#rpfs

zDirectory._fixresultNryr"r"r"r#r|asr|cKstf|���S)rr�rq�show�rfr"r"r#�askopenfilenamewsr�cKstf|���S)r{)rzr~rr"r"r#�asksaveasfilename}sr�cKsd|d<tf|���S)ztAsk for multiple filenames to open

    Returns a list of filenames or empty list if
    cancel button selected
    rrwr}rr"r"r#�askopenfilenames�sr�rucKs tf|���}|rt||�SdS)z8Ask for a filename to open, and returned the opened fileN)rqr~�open��moderfrlr"r"r#�askopenfile�s
r�cKs4tf|�}|r0g}|D]}|�t||��q|}|S)z�Ask for multiple filenames and return the open file
    objects

    returns a list of open file objects or an empty list if
    cancel selected
    )r�rHr�)r�rfrZofilesrlr"r"r#�askopenfiles�s
r��wcKs tf|���}|rt||�SdS)z;Ask for a filename to save as, and returned the opened fileN)rzr~r�r�r"r"r#�
asksaveasfile�s
r�cKstf|���S)z-Ask for a directory, and return the file name)r|r~rr"r"r#�askdirectory�sr�c
	Cs�t�}|��t|�}|jdd�}t|�}|jdd�}t||�d}ddl}z&ddl}|�|j	d�|�
|j�}Wntt
fk
r�YnXtdgd�}zt|d	�}|��Wn$td
�t|��d�YnXtd|�|��t�}	td
|	�|��dS)zSimple test program.�test)r4zutf-8rNr%)z	all filesr)rdruzCould not open File: rr�Zsaveas)ZTkZwithdrawr]r5r`�print�sys�locale�	setlocale�LC_ALL�nl_langinfo�CODESET�ImportErrorrkr�r��close�exc_info�encoder�)
�root�fdZloadfileZsavefile�encr�r�Zopenfilename�fpZsaveasfilenamer"r"r#r��s2

r��__main__)ru)ru)r�)r\ZtkinterZtkinter.dialogrrZtkinter.simpledialogrr(rIr'rr]r`rcrqrzr|r�r�r�r�r�r�r�r�rYr"r"r"r#�<module>s2I9
	

	,
tkinter/__pycache__/__init__.cpython-38.opt-2.pyc000064400000313170151153537530015600 0ustar00U

e5d͕�@s�ddlZddlZddlZejZddlTddlZdZeej�Z	eej
�ZejZej
Z
ejZe�d�Ze�dej�Zdd�Zdd	�Zd
d�Zz
ejZWnek
r�YnXdd
�Zz
ejZWnek
r�YnXdxdd�ZGdd�deej�ZGdd�d�Zdadadd�Zdydd�Z dd�Z!dzdd�Z"da#Gdd�d�Z$Gdd �d e$�Z%Gd!d"�d"e$�Z&Gd#d$�d$e$�Z'Gd%d&�d&e$�Z(d{d'd(�Z)e*Z+eZ,d)d*�Z-Gd+d,�d,�Z.Gd-d.�d.�Z/Gd/d0�d0�Z0Gd1d2�d2�Z1Gd3d4�d4�Z2Gd5d6�d6e.e2�Z3d|d7d8�Z4Gd9d:�d:�Z5Gd;d<�d<�Z6Gd=d>�d>�Z7Gd?d@�d@e.�Z8GdAdB�dBe8e5e6e7�Z9GdCdD�dDe8e2�Z:GdEdF�dFe9�Z;GdGdH�dHe9e0e1�Z<GdIdJ�dJe9�Z=GdKdL�dLe9e0�Z>GdMdN�dNe9�Z?GdOdP�dPe9�Z@GdQdR�dRe9e0e1�ZAGdSdT�dTe9�ZBGdUdV�dVe9�ZCGdWdX�dXe9�ZDGdYdZ�dZe9�ZEGd[d\�d\e9�ZFGd]d^�d^e9�ZGGd_d`�d`e9e0e1�ZHGdadb�db�ZIGdcdd�ddeC�ZJGdedf�df�ZKGdgdh�dheK�ZLGdidj�djeK�ZMdkdl�ZNdmdn�ZOGdodp�dpe9e0�ZPGdqdr�dre9�ZQGdsdt�dte9�ZRdudv�ZSeTdwk�r�eS�dS)}�N)�*�z([\\{}])z([\s])cCsd�tt|��S)N� )�join�map�
_stringify��value�r
�(/usr/lib64/python3.8/tkinter/__init__.py�_join8srcCs�t|ttf�rHt|�dkr:t|d�}t�|�rFd|}q�dt|�}ntt|�}|sZd}nbt�|�r�t�	d|�}|�
dd�}t�	d|�}|ddkr�d	|}n|ddks�t�|�r�d|}|S)
Nrrz{%s}z{}z\\\1�
z\n�"�\)�
isinstance�list�tuple�lenr�	_magic_re�searchr�str�sub�replace�	_space_rerr
r
rr=s$



rcCs@d}|D]2}t|ttf�r(|t|�}q|dk	r||f}q|S)Nr
)rrr�_flatten)�seq�res�itemr
r
rrVsrcCs�t|t�r|St|td�tf�r$|Si}t|�D]^}z|�|�Wq0ttfk
r�}z(td|�|�	�D]\}}|||<qjW5d}~XYq0Xq0|SdS)Nz_cnfmerge: fallback due to:)
r�dict�typerr�update�AttributeError�	TypeError�print�items)Zcnfs�cnf�c�msg�k�vr
r
r�	_cnfmergees

r*Tc	Csz|�|�}t|�drtd��t|�}i}t||�D]@\}}t|�}|r`|ddkr`|dd�}|rl||�}|||<q4|S)N�zNTcl list representing a dict is expected to contain an even number of elementsr�-r)�	splitlistr�RuntimeError�iter�zipr)	�tkr)Z	cut_minus�conv�t�itr�keyr	r
r
r�
_splitdict{s

r6c@s�eZdZdZeZdZdZeZdZdZ	dZ
dZdZd	Z
d
ZdZdZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#d Z$d!Z%d"Z&d#Z'd$Z(d%Z)e*j+Z+d&S)'�	EventType�2�3�4�5�6�7�8�9Z10Z11Z12Z13Z14Z15Z16Z17Z18Z19Z20Z21Z22Z23Z24Z25Z26Z27Z28Z29Z30Z31Z32Z33Z34Z35Z36Z37Z38N),�__name__�
__module__�__qualname__ZKeyPressZKeyZ
KeyReleaseZButtonPress�ButtonZ
ButtonReleaseZMotionZEnterZLeaveZFocusInZFocusOutZKeymapZExposeZGraphicsExposeZNoExposeZ
VisibilityZCreateZDestroyZUnmapZMapZ
MapRequestZReparentZ	ConfigureZConfigureRequestZGravityZ
ResizeRequestZ	CirculateZCirculateRequestZPropertyZSelectionClearZSelectionRequestZ	SelectionZColormapZ
ClientMessage�MappingZVirtualEventZActivateZ
DeactivateZ
MouseWheelr�__str__r
r
r
rr7�sPr7c@seZdZdd�ZdS)�Eventcsdd�|j��D��|js"�d=n|jdkr:t|j��d<t|dd�sL�d=|jdkr^�d=n|t|jt�r�|j}d	}g}t|�D]\}}|d
|>@r�|�	|�q�|d
t
|�>d
@}|s�|s�|�	t|��d�|��d<|j
dkr�d=d
}dt|jd|j�d��fdd�|D��fS)NcSsi|]\}}|dkr||�qS)�??r
��.0r(r)r
r
r�
<dictcomp>�sz"Event.__repr__.<locals>.<dictcomp>�charrG�
send_eventTr�state)
ZShiftZLockZControlZMod1ZMod2ZMod3ZMod4ZMod5ZButton1ZButton2ZButton3ZButton4ZButton5r�|�delta)rLrM�keysym�keycoderK�numrO�focus�x�y�width�heightz<%s event%s>�name�c3s&|]}|�krd|�|fVqdS)z %s=%sNr
)rIr(�Zattrsr
r�	<genexpr>
sz!Event.__repr__.<locals>.<genexpr>)�__dict__r$rK�repr�getattrrMr�int�	enumerate�appendr�hexrrOr)�selfrMZmods�s�i�n�keysr
rZr�__repr__�s6


�zEvent.__repr__N)r@rArBrhr
r
r
rrF�s+rFcCsdadabdS)NF)�_support_default_root�
_default_rootr
r
r
r�
NoDefaultRootsrkcCs.tstd��ts*|r$td|�d���t�}tS)NzINo master specified and tkinter is configured to not support default rootz
Too early to z: no default root window)rir.rj�Tk)�what�rootr
r
r�_get_default_root#srocCsdS�Nr
)�errr
r
r�_tkerror/srrcCs.zt|�}Wntk
r YnXt|��dSrp)r_�
ValueError�
SystemExit)�coder
r
r�_exit4s
rvc@s�eZdZdZdZdZddd�Zdd�Zdd�Zd	d
�Z	e	Z
dd�Zd
d�Zdd�Z
dd�Zdd�Zdd�ZeZdd�Zdd�Zdd�ZdS)�VariablerYNcCs�|dk	rt|t�std��|s&td�}|��|_|j|_|rD||_ndtt	�|_t	d7a	|dk	rn|�
|�n&|j�|j�dd|j��s�|�
|j
�dS)Nzname must be a stringzcreate variable�PY_VARr�info�exists)rrr"ro�_rootr1�_tk�_namer]�_varnum�
initialize�
getboolean�call�_default�rc�masterr	rXr
r
r�__init__Is

zVariable.__init__cCsb|jdkrdS|j�|j�dd|j��r6|j�|j�|jdk	r^|jD]}|j�|�qFd|_dS)Nryrz)r|r�r�r}Zglobalunsetvar�_tclCommands�
deletecommand�rcrXr
r
r�__del__gs


zVariable.__del__cCs|jSrp)r}�rcr
r
rrEsszVariable.__str__cCs|j�|j|�Srp)r|�globalsetvarr}�rcr	r
r
r�setwszVariable.setcCs|j�|j�Srp)r|�globalgetvarr}r�r
r
r�get}szVariable.getcCs�t|d|j�j}tt|��}z
|j}Wntk
r:YnXz||j}Wntk
r^YnX|j�	||�|j
dkr~g|_
|j
�|�|Srp)�CallWrapperr{�__call__r]�id�__func__r!r@r|�
createcommandr�ra)rc�callback�f�cbnamer
r
r�	_register�s

zVariable._registercCs(|�|�}|j�ddd|j||f�|S)N�trace�add�variable�r�r|r�r}�rc�moder�r�r
r
r�	trace_add�s

�zVariable.trace_addcCsx|j�ddd|j||�|��D] \}}|j�|�d|kr qtq |j�|�z|j�|�Wntk
rrYnXdS)Nr��remover�r)	r|r�r}�
trace_infor-r�r�r�rs�rcr�r��mZcar
r
r�trace_remove�s�zVariable.trace_removec
s4|jj��fdd�t��|j�ddd|j���D�S)Ncsg|]\}}�|�|f�qSr
r
rH�r-r
r�
<listcomp>�sz'Variable.trace_info.<locals>.<listcomp>r�ryr�)r|r-rr�r}r�r
r�rr��s�zVariable.trace_infocCs$|�|�}|j�dd|j||�|S)Nr�r�r�r�r
r
r�trace_variable�s
zVariable.trace_variablecCs�|j�dd|j||�|j�|�d}|��D] \}}|j�|�d|kr.q�q.|j�|�z|j�|�Wntk
r�YnXdS)Nr�Zvdeleter)	r|r�r}r-r�r�r�r�rsr�r
r
r�
trace_vdelete�s
zVariable.trace_vdeletecs(�fdd��j��j�dd�j��D�S)Ncsg|]}�j�|��qSr
)r|r-�rIrTr�r
rr��sz(Variable.trace_vinfo.<locals>.<listcomp>r�Zvinfo)r|r-r�r}r�r
r�r�trace_vinfo�s�zVariable.trace_vinfocCs6t|t�stS|j|jko4|jj|jjko4|j|jkSrp)rrw�NotImplementedr}�	__class__r@r|)rc�otherr
r
r�__eq__�s
�
�zVariable.__eq__)NNN)r@rArBr�r|r�r�r�rEr�rr�r�r�r�r�r�r�r�r�r�r
r
r
rrw@s$

rwc@s"eZdZdZddd�Zdd�ZdS)�	StringVarrYNcCst�||||�dSrp�rwr�r�r
r
rr��s
zStringVar.__init__cCs$|j�|j�}t|t�r|St|�Srp)r|r�r}rrr�r
r
rr�s
z
StringVar.get)NNN�r@rArBr�r�r�r
r
r
rr��s
r�c@s"eZdZdZddd�Zdd�ZdS)�IntVarrNcCst�||||�dSrpr�r�r
r
rr�s
zIntVar.__init__c	CsJ|j�|j�}z|j�|�WSttfk
rDt|j�|��YSXdSrp)r|r�r}�getintr"�TclErrorr_�	getdoubler�r
r
rr�s
z
IntVar.get)NNNr�r
r
r
rr�
s
r�c@s"eZdZdZddd�Zdd�ZdS)�	DoubleVargNcCst�||||�dSrpr�r�r
r
rr�*s
zDoubleVar.__init__cCs|j�|j�|j��Srp)r|r�r�r}r�r
r
rr�6sz
DoubleVar.get)NNNr�r
r
r
rr�&s
r�c@s.eZdZdZd	dd�Zdd�ZeZdd�ZdS)
�
BooleanVarFNcCst�||||�dSrpr�r�r
r
rr�?s
zBooleanVar.__init__cCs|j�|j|j�|��Srp)r|r�r}r�r�r
r
rr�KszBooleanVar.setcCs:z|j�|j�|j��WStk
r4td��YnXdS�N� invalid literal for getboolean())r|r�r�r}r�rsr�r
r
rr�QszBooleanVar.get)NNN)r@rArBr�r�r�rr�r
r
r
rr�;s

r�cCstd�j�|�dS)Nzrun the main loop)ror1�mainloop)rfr
r
rr�Ysr�cCs4ztd�j�|�WStk
r.td��YnXdS)Nzuse getboolean()r�)ror1r�r�rs�rdr
r
rr�csr�c@s�eZdZdZdZdd�Zdd�Z�d0dd�Zdd	�Zd
d�Z	�d1d
d�Z
e
Z�d2dd�Z�d3dd�Z
�d4dd�Z�d5dd�Zdd�Zdd�Zdd�Zdd�ZeZd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Z�d6d.d/�Zd0d1�Zd2d3�Z�d7d5d6�Zd7d8�Z d9d:�Z!d;d<�Z"d=d>�Z#d?d@�Z$dAdB�Z%dCdD�Z&dEdF�Z'�d8dGdH�Z(dIdJ�Z)dKdL�Z*�d9dMdN�Z+dOdP�Z,dQdR�Z-dSdT�Z.dUdV�Z/dWdX�Z0dYdZ�Z1�d:d[d\�Z2�d;d]d^�Z3e3Z4�d<d_d`�Z5�d=dadb�Z6dcdd�Z7dedf�Z8dgdh�Z9didj�Z:�d>dkdl�Z;dmdn�Z<dodp�Z=dqdr�Z>dsdt�Z?dudv�Z@dwdx�ZA�d?dydz�ZBd{d|�ZCd}d~�ZDdd��ZEd�d��ZF�d@d�d��ZGd�d��ZHd�d��ZId�d��ZJd�d��ZKd�d��ZLd�d��ZMd�d��ZNd�d��ZOd�d��ZPd�d��ZQd�d��ZRd�d��ZSd�d��ZTd�d��ZUd�d��ZVd�d��ZWd�d��ZXd�d��ZYd�d��ZZd�d��Z[d�d��Z\d�d��Z]�dAd�d��Z^d�d��Z_d�d��Z`d�d��Zad�d��Zbd�d��Zcd�d��Zdd�d��Zed�dÄZfd�dńZgd�dDŽZhd�dɄZi�dBd�d˄Zj�dCd�d΄Zk�dDd�dЄZl�dEd�d҄Zm�dFd�dԄZnd�dքZo�dGd�d؄Zpd�dڄZq�dHd�d܄Zrd�dބZsd�d�Ztd�d�Zud�d�Zvd�d�Zwexd�d��Zy�dId�d�Zzd�d�Z{e{Z|�dJd�d�Z}e}Z~d�d�Zd�Z�d�e��Z�d�d�Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z��dKd�d��Z�e�Z�d��d�Z�e�Z��d�d�Z��d�d�Z��d�d�Z��d�d�Z��d	gZ�e�f�d
�d�Z�e�Z��d�d
�Z�e�Z��d�d�Z��dL�d�d�Z�e�Z��dM�d�d�Z�e�Z��d�d�Z��d�d�Z�if�d�d�Z�e�Z��d�d�Z�e�f�d�d�Z�if�d�d�Z�e�Z��d �d!�Z�e�Z��dN�d"�d#�Z��d$�d%�Z��d&�d'�Z��d(�d)�Z��dO�d*�d+�Z��d,�d-�Z��d.�d/�Z�dS(P�MiscNcCs,|jdk	r(|jD]}|j�|�qd|_dSrp)r�r1r�r�r
r
r�destroyxs

zMisc.destroycCs6|j�|�z|j�|�Wntk
r0YnXdSrp)r1r�r�r�rsr�r
r
rr��s
zMisc.deletecommandcCs|j�|j�dd|��S)Nr��tk_strictMotif)r1r�r��rc�booleanr
r
rr��s
�zMisc.tk_strictMotifcCs|j�d�dS)N�	tk_bisque�r1r�r�r
r
rr��szMisc.tk_bisquecOs(|j�dt|�tt|�����dS)N)�
tk_setPalette)r1r�rrr$�rc�args�kwr
r
rr��s
��zMisc.tk_setPaletterxcCs|j�dd|�dS)N�tkwaitr�r�r�r
r
r�
wait_variable�szMisc.wait_variablecCs"|dkr|}|j�dd|j�dS)Nr��window�r1r��_w�rcr�r
r
r�wait_window�szMisc.wait_windowcCs"|dkr|}|j�dd|j�dS)Nr�Z
visibilityr�r�r
r
r�wait_visibility�szMisc.wait_visibility�1cCs|j�||�dSrp)r1�setvar)rcrXr	r
r
rr��szMisc.setvarcCs|j�|�Srp)r1�getvarr�r
r
rr��szMisc.getvarc
CsBz|j�|�WStk
r<}ztt|���W5d}~XYnXdSrp)r1r�r�rsr�rcrd�excr
r
rr��szMisc.getintc
CsBz|j�|�WStk
r<}ztt|���W5d}~XYnXdSrp)r1r�r�rsrr�r
r
rr��szMisc.getdoublecCs0z|j�|�WStk
r*td��YnXdSr�)r1r�r�rs)rcrdr
r
rr��szMisc.getbooleancCs|j�d|j�dS�NrSr�r�r
r
r�	focus_set�szMisc.focus_setcCs|j�dd|j�dS)NrSz-forcer�r�r
r
r�focus_force�szMisc.focus_forcecCs&|j�d�}|dks|sdS|�|�S)NrS�none)r1r��
_nametowidgetr�r
r
r�	focus_get�szMisc.focus_getcCs,|j�dd|j�}|dks|s"dS|�|�S)NrS�
-displayofr��r1r�r�r�r�r
r
r�focus_displayof�szMisc.focus_displayofcCs,|j�dd|j�}|dks|s"dS|�|�S)NrSz-lastforr�r�r�r
r
r�
focus_lastforszMisc.focus_lastforcCs|j�d�dS)N�tk_focusFollowsMouser�r�r
r
rr�szMisc.tk_focusFollowsMousecCs"|j�d|j�}|sdS|�|�S)N�tk_focusNextr�r�r
r
rr�
s	zMisc.tk_focusNextcCs"|j�d|j�}|sdS|�|�S)N�tk_focusPrevr�r�r
r
rr�szMisc.tk_focusPrevcsN�s�j�d|�dS����fdd�}�j|_��|���j�d|��SdS)N�aftercs8z���W5z����Wntk
r0YnXXdSrp)r�r�r
�r��funcrXrcr
r�callit,szMisc.after.<locals>.callit)r1r�r@r�)rcZmsr�r�r�r
r�rr� s
z
Misc.aftercGs|jd|f|��S)NZidle)r�)rcr�r�r
r
r�
after_idle8szMisc.after_idlecCsd|std��z.|j�dd|�}|j�|�d}|�|�Wntk
rNYnX|j�dd|�dS)Nz?id must be a valid identifier returned from after or after_idler�ryrZcancel)rsr1r�r-r�r�)rcr��dataZscriptr
r
r�after_cancel@szMisc.after_cancelrcCs|j�d|�|��dS)N)�bell)r1r��
_displayof�rc�	displayofr
r
rr�Qsz	Misc.bellcKsdd|krN|jdkrNz d|d<|j�d|�|��WStk
rL|d=YnX|j�d|�|��S)Nr�x11�UTF8_STRING)�	clipboardr�)�_windowingsystemr1r��_optionsr��rcr�r
r
r�
clipboard_getVszMisc.clipboard_getcKs,d|kr|j|d<|j�d|�|��dS)Nr�)r��clear�r�r1r�r�r�r
r
r�clipboard_clearms
zMisc.clipboard_clearcKs4d|kr|j|d<|j�d|�|�d|f�dS)Nr�)r�ra�--r�)rc�stringr�r
r
r�clipboard_appendus

�zMisc.clipboard_appendcCs$|j�dd|j�}|sdS|�|�S)N�grabZcurrentr�r�r
r
r�grab_current�szMisc.grab_currentcCs|j�dd|j�dS)Nr��releaser�r�r
r
r�grab_release�szMisc.grab_releasecCs|j�dd|j�dS)Nr�r�r�r�r
r
r�grab_set�sz
Misc.grab_setcCs|j�ddd|j�dS)Nr�r�z-globalr�r�r
r
r�grab_set_global�szMisc.grab_set_globalcCs"|j�dd|j�}|dkrd}|S)Nr��statusr�r�)rcr�r
r
r�grab_status�szMisc.grab_statuscCs|j�dd|||�dS)N�optionr�r�)rc�patternr	�priorityr
r
r�
option_add�szMisc.option_addcCs|j�dd�dS)Nrr�r�r�r
r
r�option_clear�szMisc.option_clearcCs|j�dd|j||�S)Nrr�r�)rcrX�	classNamer
r
r�
option_get�szMisc.option_getcCs|j�dd||�dS)NrZreadfiler�)rcZfileNamerr
r
r�option_readfile�szMisc.option_readfilecKs,d|kr|j|d<|j�d|�|��dS)Nr�)�	selectionr�r�r�r
r
r�selection_clear�s
zMisc.selection_clearcKsvd|kr|j|d<d|kr`|jdkr`z d|d<|j�d|�|��WStk
r^|d=YnX|j�d|�|��S)Nr�rr�r�)r	r�)r�r�r1r�r�r�r�r
r
r�
selection_get�s	
zMisc.selection_getcKs.|�|�}|j�d|�|�|j|f�dS)N)r	Zhandle)r�r1r�r�r�)rc�commandr�rXr
r
r�selection_handle�s
�zMisc.selection_handlecKs"|j�d|�|�|jf�dS)N�r	Zown)r1r�r�r�r�r
r
r�
selection_own�s
��zMisc.selection_owncKs:d|kr|j|d<|j�d|�|��}|s0dS|�|�S)Nr�r)r�r1r�r�r�)rcr�rXr
r
r�selection_own_get�s
zMisc.selection_own_getcGs|j�d||f|�S)N�sendr�)rcZinterp�cmdr�r
r
rr�sz	Misc.sendcCs|j�d|j|�dS�N�lowerr�)rc�	belowThisr
r
rr�sz
Misc.lowercCs|j�d|j|�dS�N�raiser�)rc�	aboveThisr
r
r�tkraiseszMisc.tkraisecCs(d|�|�|f}|j�|j�|��S)N)�winfoZatom)r�r1r�r�)rcrXr�r�r
r
r�
winfo_atomszMisc.winfo_atomcCs d|�|�|f}|j�|�S)N)rZatomname�r�r1r��rcr�r�r�r
r
r�winfo_atomnames��zMisc.winfo_atomnamecCs|j�|j�dd|j��S)NrZcells�r1r�r�r�r�r
r
r�winfo_cellss�zMisc.winfo_cellsc	CsRg}|j�|j�dd|j��D].}z|�|�|��Wqtk
rJYqXq|S)Nr�children)r1r-r�r�rar��KeyError)rc�result�childr
r
r�winfo_childrens�zMisc.winfo_childrencCs|j�dd|j�S)Nr�classr�r�r
r
r�winfo_class#szMisc.winfo_classcCs|j�|j�dd|j��S)NrZcolormapfull�r1r�r�r�r�r
r
r�winfo_colormapfull's�zMisc.winfo_colormapfullcCs4d|�|�||f}|j�|�}|s*dS|�|�S)N)rZ
containing)r�r1r�r�)rcZrootXZrootYr�r�rXr
r
r�winfo_containing,s��zMisc.winfo_containingcCs|j�|j�dd|j��S)NrZdepthrr�r
r
r�winfo_depth4szMisc.winfo_depthcCs|j�|j�dd|j��S)Nrrzrr�r
r
r�winfo_exists8s�zMisc.winfo_existscCs|j�|j�dd|j|��S)NrZfpixels�r1r�r�r��rc�numberr
r
r�
winfo_fpixels=s�zMisc.winfo_fpixelscCs|j�dd|j�S)Nr�geometryr�r�r
r
r�winfo_geometryCszMisc.winfo_geometrycCs|j�|j�dd|j��S)NrrWrr�r
r
r�winfo_heightGs�zMisc.winfo_heightcCst|j�dd|j�d�S)Nrr�r)r_r1r�r�r�r
r
r�winfo_idLsz
Misc.winfo_idcCs"d|�|�}|j�|j�|��S)N)rZinterps)r�r1r-r�)rcr�r�r
r
r�
winfo_interpsPszMisc.winfo_interpscCs|j�|j�dd|j��S)NrZismappedrr�r
r
r�winfo_ismappedUs�zMisc.winfo_ismappedcCs|j�dd|j�S)NrZmanagerr�r�r
r
r�
winfo_managerZszMisc.winfo_managercCs|j�dd|j�S)NrrXr�r�r
r
r�
winfo_name^szMisc.winfo_namecCs|j�dd|j�S)Nr�parentr�r�r
r
r�winfo_parentbszMisc.winfo_parentcCs d|�|�|f}|j�|�S)N)r�pathnamerrr
r
r�winfo_pathnamefs��zMisc.winfo_pathnamecCs|j�|j�dd|j|��S)NrZpixelsrr.r
r
r�winfo_pixelsls�zMisc.winfo_pixelscCs|j�|j�dd|j��S)NrZpointerxrr�r
r
r�winfo_pointerxqs�zMisc.winfo_pointerxcCs|�|j�dd|j��S)NrZ	pointerxy��_getintsr1r�r�r�r
r
r�winfo_pointerxyvs�zMisc.winfo_pointerxycCs|j�|j�dd|j��S)NrZpointeryrr�r
r
r�winfo_pointery{s�zMisc.winfo_pointerycCs|j�|j�dd|j��S)NrZ	reqheightrr�r
r
r�winfo_reqheight�s�zMisc.winfo_reqheightcCs|j�|j�dd|j��S)NrZreqwidthrr�r
r
r�winfo_reqwidth�s�zMisc.winfo_reqwidthcCs|�|j�dd|j|��S)NrZrgbr?)rcZcolorr
r
r�	winfo_rgb�s�zMisc.winfo_rgbcCs|j�|j�dd|j��S)NrZrootxrr�r
r
r�winfo_rootx�s�zMisc.winfo_rootxcCs|j�|j�dd|j��S)NrZrootyrr�r
r
r�winfo_rooty�s�zMisc.winfo_rootycCs|j�dd|j�S)Nr�screenr�r�r
r
r�winfo_screen�szMisc.winfo_screencCs|j�|j�dd|j��S)NrZscreencellsrr�r
r
r�winfo_screencells�s�zMisc.winfo_screencellscCs|j�|j�dd|j��S)NrZscreendepthrr�r
r
r�winfo_screendepth�s�zMisc.winfo_screendepthcCs|j�|j�dd|j��S)NrZscreenheightrr�r
r
r�winfo_screenheight�s�zMisc.winfo_screenheightcCs|j�|j�dd|j��S)NrZscreenmmheightrr�r
r
r�winfo_screenmmheight�s�zMisc.winfo_screenmmheightcCs|j�|j�dd|j��S)NrZ
screenmmwidthrr�r
r
r�winfo_screenmmwidth�s�zMisc.winfo_screenmmwidthcCs|j�dd|j�S)NrZscreenvisualr�r�r
r
r�winfo_screenvisual�szMisc.winfo_screenvisualcCs|j�|j�dd|j��S)NrZscreenwidthrr�r
r
r�winfo_screenwidth�s�zMisc.winfo_screenwidthcCs|j�dd|j�S)NrZserverr�r�r
r
r�winfo_server�szMisc.winfo_servercCs|�|j�dd|j��S)Nr�toplevel)r�r1r�r�r�r
r
r�winfo_toplevel�s

�zMisc.winfo_toplevelcCs|j�|j�dd|j��S)NrZviewablerr�r
r
r�winfo_viewable�s�zMisc.winfo_viewablecCs|j�dd|j�S)Nr�visualr�r�r
r
r�winfo_visual�szMisc.winfo_visualcCs|j�dd|j�S)NrZvisualidr�r�r
r
r�winfo_visualid�szMisc.winfo_visualidFcsH�j�dd�j|rdnd�}�fdd��j�|�D�}�fdd�|D�S)NrZvisualsavailable�
includeidscsg|]}�j�|��qSr
)r1r-r�r�r
rr��sz/Misc.winfo_visualsavailable.<locals>.<listcomp>csg|]}��|��qSr
)�_Misc__winfo_parseitemr�r�r
rr��s)r1r�r�r-)rcrXr�r
r�r�winfo_visualsavailable�s

�zMisc.winfo_visualsavailablecCs$|dd�tt|j|dd���S)Nr)rr�_Misc__winfo_getint)rcr3r
r
rZ__winfo_parseitem�szMisc.__winfo_parseitemcCs
t|d�S)Nr)r_�rcrTr
r
rZ__winfo_getint�szMisc.__winfo_getintcCs|j�|j�dd|j��S)NrZvrootheightrr�r
r
r�winfo_vrootheight�s�zMisc.winfo_vrootheightcCs|j�|j�dd|j��S)NrZ
vrootwidthrr�r
r
r�winfo_vrootwidth�s�zMisc.winfo_vrootwidthcCs|j�|j�dd|j��S)NrZvrootxrr�r
r
r�winfo_vrootxs�zMisc.winfo_vrootxcCs|j�|j�dd|j��S)NrZvrootyrr�r
r
r�winfo_vrooty	s�zMisc.winfo_vrootycCs|j�|j�dd|j��S)NrrVrr�r
r
r�winfo_widths�zMisc.winfo_widthcCs|j�|j�dd|j��S)NrrTrr�r
r
r�winfo_xs�zMisc.winfo_xcCs|j�|j�dd|j��S)NrrUrr�r
r
r�winfo_ys�zMisc.winfo_ycCs|j�d�dS)Nr r�r�r
r
rr  szMisc.updatecCs|j�dd�dS)Nr Z	idletasksr�r�r
r
r�update_idletasks$szMisc.update_idletaskscCs6|dkr |j�|j�d|j��S|j�d|j|�dS)N�bindtags�r1r-r�r�)rcZtagListr
r
rre*s
�z
Misc.bindtagsrcCs�t|t�r |j�|||f�nn|rd|�||j|�}d|r>dp@d||jf}|j�|||f�|S|rz|j�||f�S|j�|j�|��SdS)Nz"%sif {"[%s %s]" == "break"} break
�+rY)rrr1r�r��_substitute�_subst_format_strr-)rcrm�sequencer�r��needcleanup�funcidrr
r
r�_bind7s"

�
��z
Misc._bindcCs|�d|jf|||�S�N�bind�rmr��rcrjr�r�r
r
rroIs'z	Misc.bindcCs&|j�d|j|d�|r"|�|�dS�NrorY�r1r�r�r�)rcrjrlr
r
r�unbindrszMisc.unbindcCs|�d|||d�S)N)ro�allr�rmrqr
r
r�bind_allysz
Misc.bind_allcCs|j�dd|d�dS)NrorurYr�)rcrjr
r
r�
unbind_all�szMisc.unbind_allcCs|�d|f|||d�S)Nrorrv)rcrrjr�r�r
r
r�
bind_class�szMisc.bind_classcCs|j�d||d�dSrrr�)rcrrjr
r
r�unbind_class�szMisc.unbind_classcCs|j�|�dSrp)r1r�)rcrfr
r
rr��sz
Misc.mainloopcCs|j��dSrp)r1�quitr�r
r
rr{�sz	Misc.quitcCs"|rtt|jj|j�|���SdSrp)rrr1r�r-�rcr�r
r
rr@�sz
Misc._getintscCs"|rtt|jj|j�|���SdSrp)rrr1r�r-r|r
r
r�_getdoubles�szMisc._getdoublescCs|r|j�|�SdSrp)r1r�r|r
r
r�_getboolean�szMisc._getbooleancCs"|rd|fS|dkrd|jfSdS)Nr�r
�r�r�r
r
rr��s

zMisc._displayofcCsBz|��jWStk
r<|j�dd�}|��_|YSXdS)Nr1Zwindowingsystem)r{Z_windowingsystem_cachedr!r1r�)rcZwsr
r
rr��s�zMisc._windowingsystemcCs�|rt||f�}nt|�}d}|��D]�\}}|dk	r&|ddkrN|dd�}t|�rb|�|�}n^t|ttf�r�g}|D]<}t|t�r�|�t	|��qxt|t	�r�|�t
|��qxq�qxd�|�}|d||f}q&|S)Nr
����_rr,)r*r$�callabler�rrrr_rarrr)rcr%r�rr(r)Znvrr
r
rr��s*


z
Misc._optionscCsNt|��d�}|}|ds.|��}|dd�}|D]}|s>qJ|j|}q2|S)N�.rr)r�splitr{r!)rcrX�wrfr
r
r�nametowidget�szMisc.nametowidgetcCs�t|||�j}tt|��}z
|j}Wntk
r8YnXz||j}Wntk
r\YnX|j�||�|r�|j	dkr�g|_	|j	�
|�|Srp)r�r�r]r�r�r!r@r1r�r�ra)rcr��substrkr�rXr
r
rr��s 

zMisc._registercCs|}|jr|j}q|Srp�r�)rcr�r
r
rr{sz
Misc._root)z%#z%bz%fz%hz%kz%sz%tz%wz%xz%yz%Az%Ez%Kz%Nz%Wz%Tz%Xz%Yz%Drcs�t|�t|j�kr|S|jj}|jj��fdd�}|\}}}}}}	}
}}}
}}}}}}}}}t�}�|�|_||�|_z||�|_Wnt	k
r�YnX||�|_
||�|_||	�|_||
�|_
||�|_||�|_||
�|_||_z||�|_Wnt	k
�r
YnX||_||�|_zt|�|_Wntk
�rF||_YnXz|�|�|_Wntk
�rt||_YnX||�|_||�|_z�|�|_Wn tt	fk
�r�d|_YnX|fS)Nc	s,z
�|�WSttfk
r&|YSXdSrp)rsr�r��r�r
r�getint_events
z&Misc._substitute.<locals>.getint_eventr)r�
_subst_formatr1r�r�rF�serialrRrSr�rWrQrM�timerVrTrUrKrLrPZ
keysym_numr7rrsr��widgetr"Zx_rootZy_rootrO)rcr�r�r�Znsign�br��hr(rdr3r�rTrU�A�E�K�N�W�T�X�Y�D�er
r�rrhsT*











zMisc._substitutecCs(t��\}}}|��}|�|||�dSrp)�sys�exc_infor{�report_callback_exception)rcr��val�tbrnr
r
r�_report_exceptionHszMisc._report_exceptioncGs\i}|j�|jj|��D]>}|j�|�}|ddd�f|dd�||ddd�<q|S�Nrr�r1r-r�)rcr�r%rTr
r
r�
_getconfigureNs
0zMisc._getconfigurecGs2|j�|jj|��}|ddd�f|dd�Sr�r�)rcr�rTr
r
r�_getconfigure1VszMisc._getconfigure1cCs�|rt||f�}n|rt|�}|dkr:|�t|j|f��St|t�r^|�t|j|d|f��S|j�t|j|f�|�	|��dS)Nr,)
r*r�rr�rrr�r1r�r�)rcrr%r�r
r
r�
_configureZs
zMisc._configurecKs|�d||�S)N�	configure�r��rcr%r�r
r
rr�gszMisc.configurecCs|j�|jdd|�S�N�cgetr,r��rcr5r
r
rr�rsz	Misc.cgetcCs|�||i�dSrp)r��rcr5r	r
r
r�__setitem__xszMisc.__setitem__cs*|jj��fdd��|j�|jd��D�S)Ncs g|]}�|�ddd��qS)rrNr
r�r�r
rr�~szMisc.keys.<locals>.<listcomp>r�rfr�r
r�rrg{s
�z	Misc.keyscCs|jSrprr�r
r
rrE�szMisc.__str__cCsd|jj|jj|jfS)Nz<%s.%s object %s>)r�rArBr�r�r
r
rrh�s
�z
Misc.__repr__�_noarg_cCs:|tjkr"|�|j�dd|j��S|j�dd|j|�dS)N�pack�	propagate�r�r�r~r1r�r��rc�flagr
r
r�pack_propagate�s

�zMisc.pack_propagatecs(�fdd��j��j�dd�j��D�S)Ncsg|]}��|��qSr
�r�r�r�r
rr��sz$Misc.pack_slaves.<locals>.<listcomp>r��slavesrfr�r
r�r�pack_slaves�s

��zMisc.pack_slavescs(�fdd��j��j�dd�j��D�S)Ncsg|]}��|��qSr
r�r�r�r
rr��sz%Misc.place_slaves.<locals>.<listcomp>�placer�rfr�r
r�r�place_slaves�s
���zMisc.place_slavescCs|j�dd|j|�dS)N�grid�anchorr�)rcr�r
r
r�grid_anchor�szMisc.grid_anchorcCsZdd|jf}|dk	r(|dk	r(|||f}|dk	rD|dk	rD|||f}|�|jj|��pXdS)Nr��bbox)r�r@r1r�)rc�column�rowZcol2Zrow2r�r
r
r�	grid_bbox�szMisc.grid_bboxc	Csht|ttjf�rdz:t|�}|s$WdSd|kr:|j�|�WS|j�|�WSWnttfk
rbYnX|S)Nr�)	rr�_tkinterZTcl_Objr1r�r�rsr�)rcr	Zsvaluer
r
r�_gridconvvalue�szMisc._gridconvvaluecCs�t|t�rJ|sJ|dd�dkr*|dd�}|dd�dkrBd|}|f}n|�||�}|s|t|j|j�d||j|�|jd�S|j�d||j|f|�}t|�dkr�|�|�SdS)Nr�r�rr,r�)r2)	rrr�r6r1r�r�r�r)rcr�indexr%r��optionsrr
r
r�_grid_configure�s(���zMisc._grid_configurecKs|�d|||�S)N�columnconfigure�r��rcr�r%r�r
r
r�grid_columnconfigure�szMisc.grid_columnconfigurec	Cs |�|j�dd|j||��pdS)Nr��locationr?�rcrTrUr
r
r�
grid_location�s���zMisc.grid_locationcCs:|tjkr"|�|j�dd|j��S|j�dd|j|�dS)Nr�r�r�r�r
r
r�grid_propagates

�zMisc.grid_propagatecKs|�d|||�S)N�rowconfigurer�r�r
r
r�grid_rowconfigureszMisc.grid_rowconfigurecCs|�|j�dd|j��pdS)Nr��sizer?r�r
r
r�	grid_sizes
��zMisc.grid_sizecsZd}|dk	r|d|f}|dk	r,|d|f}�fdd��j��j�dd�jf|��D�S)Nr
z-rowz-columncsg|]}��|��qSr
r�r�r�r
rr�(sz$Misc.grid_slaves.<locals>.<listcomp>r�r�rf)rcr�r�r�r
r�r�grid_slaves s
��zMisc.grid_slavescGsdd|f|}|j�|�dS)N�eventr�r��rc�virtual�	sequencesr�r
r
r�	event_add/szMisc.event_addcGsdd|f|}|j�|�dS)Nr��deleter�r�r
r
r�event_delete6szMisc.event_deletecKsDdd|j|f}|��D]\}}|d|t|�f}q|j�|�dS)Nr�Zgenerate�-%s)r�r$rr1r�)rcrjr�r�r(r)r
r
r�event_generate;szMisc.event_generatecCs|j�|j�dd|��S)Nr�ryr�)rcr�r
r
r�
event_infoDs�zMisc.event_infocCs|j�|j�dd��S�N�image�namesr�r�r
r
r�image_namesLszMisc.image_namescCs|j�|j�dd��S)Nr��typesr�r�r
r
r�image_typesPszMisc.image_types)N)rx)N)N)rxr�)rx)N)r)N)N)N)N)r)r)r)r)r)F)N)r)NNN)N)NNN)NNN)r)N)Nr)N)N)NNNN)NN)N)�r@rArB�_last_child_idsr�r�r�r�r�r�r�Zwaitvarr�r�r�r�r�r�r�r�rSr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrr
rr
rrrrr�liftrrr r%r'r)r*r+r,r0r2r3r4r5r6r7r8r:r<r=r>rArBrCrDrErFrGrIrJrKrLrMrNrOrPrQrSrTrVrWrZrYr[r]r^r_r`rarbrcr rdrermrortrwrxryrzr�r{r@r}r~r��propertyr�r�r�r�r��registerr{r�rrirhr�r�r�r�r��configr��__getitem__r�rgrErhr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r
r
r
rr�msN
		


)

	
=
	



	r�c@seZdZdd�Zdd�ZdS)r�cCs||_||_||_dSrp)r�r�r�)rcr�r�r�r
r
rr�YszCallWrapper.__init__cGsLz|jr|j|�}|j|�WStk
r2�Yn|j��YnXdSrp)r�r�rtr�r��rcr�r
r
rr�_s
zCallWrapper.__call__N�r@rArBr�r�r
r
r
rr�Usr�c@s$eZdZdd�Zdd�Zdd�ZdS)�XViewcGs(|jj|jdf|��}|s$|�|�SdS)N�xview�r1r�r�r}�rcr�rr
r
rr�oszXView.xviewcCs|j�|jdd|�dS)Nr��movetor��rc�fractionr
r
r�xview_movetouszXView.xview_movetocCs|j�|jdd||�dS)Nr��scrollr��rcr/rmr
r
r�xview_scrollzszXView.xview_scrollN)r@rArBr�r�r�r
r
r
rr�ksr�c@s$eZdZdd�Zdd�Zdd�ZdS)�YViewcGs(|jj|jdf|��}|s$|�|�SdS)N�yviewr�r�r
r
rr��szYView.yviewcCs|j�|jdd|�dS)Nr�r�r�r�r
r
r�yview_moveto�szYView.yview_movetocCs|j�|jdd||�dS)Nr�r�r�r�r
r
r�yview_scroll�szYView.yview_scrollN)r@rArBr�r�r�r
r
r
rr��sr�c@s�eZdZdAdd�ZeZdd�ZeZdBdd�ZeZdd	�Z	e	Z
dCd
d�ZeZdd
�Z
e
ZdDdd�ZeZdd�ZeZdd�ZeZdEdd�ZeZdFdd�ZeZdGdd�ZeZdHdd�ZeZdd�ZeZdIdd�ZeZ dJd d!�Z!e!Z"dKd#d$�Z#e#Z$dLd%d&�Z%e%Z&dMd'd(�Z'e'Z(d)d*�Z)e)Z*dNd+d,�Z+e+Z,dOd-d.�Z-e-Z.dPd/d0�Z/e/Z0dQd1d2�Z1e1Z2dRd3d4�Z3e3Z4dSd5d6�Z5e5Z6dTd7d8�Z7e7Z8dUd9d:�Z9e9Z:dVd;d<�Z;e;Z<dWd=d>�Z=e=Z>d?d@�Z?e?Z@dS)X�WmNcCs |�|j�dd|j||||��S)N�wm�aspectr?)rcZminNumerZminDenomZmaxNumerZmaxDenomr
r
r�	wm_aspect�s��zWm.wm_aspectcGsdd|jf|}|j�|�S)Nr��
attributes)r�r1r�r�r
r
r�
wm_attributes�szWm.wm_attributescCs|j�dd|j|�S)Nr��clientr�r�r
r
r�	wm_client�szWm.wm_clientcsZt|�dkr|f}dd�jf|}|r4�j�|�n"�fdd��j��j�|��D�SdS)Nrr��colormapwindowscsg|]}��|��qSr
r�r�r�r
rr��s�z)Wm.wm_colormapwindows.<locals>.<listcomp>)rr�r1r�r-)rcZwlistr�r
r�r�wm_colormapwindows�s
�zWm.wm_colormapwindowscCs|j�dd|j|�S)Nr�rr�r�r
r
r�
wm_command�sz
Wm.wm_commandcCs|j�dd|j�S)Nr��	deiconifyr�r�r
r
r�wm_deiconify�szWm.wm_deiconifycCs|j�dd|j|�S)Nr��
focusmodelr�)rcZmodelr
r
r�
wm_focusmodel�szWm.wm_focusmodelcCs|j�dd|�dS)Nr��forgetr�r�r
r
r�	wm_forget�szWm.wm_forgetcCs|j�dd|j�S)Nr��framer�r�r
r
r�wm_frame�szWm.wm_framecCs|j�dd|j|�S)Nr�r1r�)rcZnewGeometryr
r
r�wm_geometry�szWm.wm_geometrycCs |�|j�dd|j||||��S)Nr�r�r?)rcZ	baseWidthZ
baseHeightZwidthIncZ	heightIncr
r
r�wm_grids
�z
Wm.wm_gridcCs|j�dd|j|�S)Nr��groupr��rcZpathNamer
r
r�wm_group
szWm.wm_groupcCs2|r|j�dd|jd|�S|j�dd|j|�SdS)Nr��
iconbitmap�-defaultr�)rc�bitmap�defaultr
r
r�
wm_iconbitmaps	zWm.wm_iconbitmapcCs|j�dd|j�S)Nr��iconifyr�r�r
r
r�
wm_iconify$sz
Wm.wm_iconifycCs|j�dd|j|�S)Nr��iconmaskr�)rcrr
r
r�wm_iconmask*szWm.wm_iconmaskcCs|j�dd|j|�S)Nr��iconnamer�)rcZnewNamer
r
r�wm_iconname1szWm.wm_iconnameFcGs<|r |jjdd|jdf|��n|jjdd|jf|��dS)Nr��	iconphotorr�)rcrr�r
r
r�wm_iconphoto8szWm.wm_iconphotoc	Cs|�|j�dd|j||��S)Nr��iconpositionr?r�r
r
r�wm_iconpositionSs
�zWm.wm_iconpositioncCs|j�dd|j|�S)Nr��
iconwindowr�rr
r
r�
wm_iconwindow[szWm.wm_iconwindowcCs|j�dd|�dS)Nr��manager�)rcr�r
r
r�	wm_managebszWm.wm_managec	Cs|�|j�dd|j||��S)Nr��maxsizer?�rcrVrWr
r
r�
wm_maxsizejs
�z
Wm.wm_maxsizec	Cs|�|j�dd|j||��S)Nr��minsizer?r&r
r
r�
wm_minsizess
�z
Wm.wm_minsizecCs|�|j�dd|j|��S)Nr��overrideredirect)r~r1r�r�r�r
r
r�wm_overrideredirect|s
�zWm.wm_overrideredirectcCs|j�dd|j|�S)Nr��positionfromr��rcZwhor
r
r�wm_positionfrom�szWm.wm_positionfromcCs.t|�r|�|�}n|}|j�dd|j||�S)Nr��protocol)r�r�r1r�r�)rcrXr�rr
r
r�wm_protocol�s�zWm.wm_protocolcCs|j�dd|j||�S)Nr��	resizabler�r&r
r
r�wm_resizable�szWm.wm_resizablecCs|j�dd|j|�S)Nr��sizefromr�r-r
r
r�wm_sizefrom�szWm.wm_sizefromcCs|j�dd|j|�S)Nr�rMr�)rcZnewstater
r
r�wm_state�szWm.wm_statecCs|j�dd|j|�S)Nr��titler�r|r
r
r�wm_title�szWm.wm_titlecCs|j�dd|j|�S)Nr��	transientr�)rcr�r
r
r�wm_transient�szWm.wm_transientcCs|j�dd|j�S)Nr��withdrawr�r�r
r
r�wm_withdraw�szWm.wm_withdraw)NNNN)N)N)N)N)NNNN)N)NN)N)N)F)NN)N)NN)NN)N)N)NN)NN)N)N)N)N)Ar@rArBr�r�r�r�rrrrrrrrrrr
r	rrr
r1rr�rrrrrrrrrrrrr rr"r!r$r#r'r%r)r(r+r*r.r,r0r/r2r1r4r3r5rMr7r6r9r8r;r:r
r
r
rr��s��





�

















r�c@sJeZdZdZddd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dS)rlr�Nrrc

Cs�d|_i|_d|_d|_|dkrZddl}|j�tjd�}|j�	|�\}}|dkrZ||}d}	t
�||||	t|||�|_|r�|�
�tjjs�|�||�dS)NFr)z.pyz.pyc)r�r!�	_tkloadedr1�os�path�basenamer��argv�splitextr��create�wantobjects�_loadtk�flags�ignore_environment�readprofile)
rc�
screenName�baseNamer�useTk�syncZuser=Zext�interactiver
r
rr��s zTk.__init__cCs|js|j��|��dSrp)r<r1�loadtkrDr�r
r
rrM�s
z	Tk.loadtkcCs�d|_|j�d�}|tjkr.tdtj|f��t|j�d��}|tjkrZtdtj|f��|jdkrjg|_|j�	dt
�|j�	dt�|j�d�|j�d�t
r�ts�|a|�d|j�dS)	NT�
tk_versionz4tk.h version (%s) doesn't match libtk.a version (%s)�tcl_versionz6tcl.h version (%s) doesn't match libtcl.a version (%s)Ztkerror�exit�WM_DELETE_WINDOW)r<r1r�r��
TK_VERSIONr.r�TCL_VERSIONr�r�rrrvrarirjr/r�)rcrNrOr
r
rrD�s(
�
�
z
Tk._loadtkcCsJt|j���D]}|��q|j�d|j�t�|�trFt	|krFda	dS�Nr�)
rr!�valuesr�r1r�r�r�rirj�rcr&r
r
rr�	s

z
Tk.destroyc
Cs�ddl}d|jkr|jd}n|j}|j�|d|�}|j�|d|�}|j�|d|�}|j�|d|�}d|i}	td|	�|j�|�r�|j�d|�|j�|�r�tt	|��
�|	�|j�|�r�|j�d|�|j�|�r�tt	|��
�|	�dS)Nr�HOMEz.%s.tclz.%s.pyrczfrom tkinter import *�source)r=�environ�curdirr>r�exec�isfiler1r��open�read)
rcrIrr=�homeZ	class_tclZclass_pyZbase_tclZbase_py�dirr
r
rrG	s$

zTk.readprofilecCs:ddl}tdtjd�|t_|t_|t_|�|||�dS)NrzException in Tkinter callback)�file)�	tracebackr#r��stderr�	last_type�
last_value�last_traceback�print_exception)rcr�r�r�rbr
r
rr�$	szTk.report_callback_exceptioncCst|j|�Srp)r^r1)rc�attrr
r
r�__getattr__0	szTk.__getattr__)NNrlrrN)r@rArBr�r�rMrDr�rGr�rir
r
r
rrl�s�

rlcCst||||�Srp)rl)rHrIrrJr
r
r�TclC	srjc@sPeZdZifdd�ZeZZZdd�ZeZdd�Z	e	Z
ejZ
ZejZZdS)�PackcKs$|j�dd|jf|�||��dS)Nr�r��r1r�r�r�r�r
r
r�pack_configureL	s


��zPack.pack_configurecCs|j�dd|j�dS)Nr�r	r�r�r
r
r�pack_forgetb	szPack.pack_forgetcCs8t|j|j�dd|j��}d|kr4|�|d�|d<|S)Nr�ry�in�r6r1r�r�r��rc�dr
r
r�	pack_infoh	szPack.pack_infoN)r@rArBrmr�r�r�rnr	rsryr�r�r�r�r�r
r
r
rrkG	s
rkc@sFeZdZifdd�ZeZZZdd�ZeZdd�Z	e	Z
ejZ
ZdS)�PlacecKs$|j�dd|jf|�||��dS)Nr�r�rlr�r
r
r�place_configurez	s


��zPlace.place_configurecCs|j�dd|j�dS)Nr�r	r�r�r
r
r�place_forget�	szPlace.place_forgetcCs8t|j|j�dd|j��}d|kr4|�|d�|d<|S)Nr�ryrorprqr
r
r�
place_info�	szPlace.place_infoN)r@rArBrur�r�r�rvr	rwryr�r�r�r
r
r
rrtu	srtc@s�eZdZifdd�ZeZZZejZ	Zej
ZZ
dd�ZeZ
dd�Zdd�ZeZejZZejZZejZZejZZejZZd	S)
�GridcKs$|j�dd|jf|�||��dS)Nr�r�rlr�r
r
r�grid_configure�	s


��zGrid.grid_configurecCs|j�dd|j�dS)Nr�r	r�r�r
r
r�grid_forget�	szGrid.grid_forgetcCs|j�dd|j�dS)Nr�r�r�r�r
r
r�grid_remove�	szGrid.grid_removecCs8t|j|j�dd|j��}d|kr4|�|d�|d<|S)Nr�ryrorprqr
r
r�	grid_info�	szGrid.grid_infoN)r@rArBryr�r�r�r�r�r�r�r�rzr	r{r|ryr�r�r�r�r�r�r�r�r�r�r
r
r
rrx�	s





rxc@s6eZdZdd�Ziidfdd�Zdd�Zddd	�Zd
S)�
BaseWidgetcCs�|s
t�}||_|j|_d}d|kr2|d}|d=|s�|jj��}|jdkrRi|_|j�|d�d}||j|<|dkr�d|f}nd||f}||_|j	dkr�d||_	n|j	d||_	i|_
|j|jj
kr�|jj
|j��||jj
|j<dS)NrXrrz!%sz!%s%dr�)ror�r1r�r@rr�r�r}r�r!r�)rcr�r%rX�countr
r
r�_setup�	s2


zBaseWidget._setupr
c	Cs�|rt||f�}||_t�|||�|jdkr4g|_dd�|��D�}|D]\}}||=qJ|j�||jf||�	|��|D]\}}|�
||�q~dS)NcSs"g|]\}}t|t�r||f�qSr
)rrrHr
r
rr�	
s
z'BaseWidget.__init__.<locals>.<listcomp>)r*�
widgetNamer}rr�r$r1r�r�r�r�)	rcr�r�r%r��extra�classesr(r)r
r
rr�
s
�zBaseWidget.__init__cCsTt|j���D]}|��q|j�d|j�|j|jjkrF|jj|j=t	�|�dSrT)
rr!rUr�r1r�r�r}r�r�rVr
r
rr�
s
zBaseWidget.destroycCs|j�|j|f|�Srpr�)rcrXr�r
r
r�_do
szBaseWidget._doN)r
)r@rArBrr�r�r�r
r
r
rr}�	sr}c@seZdZdS)�WidgetN)r@rArBr
r
r
rr�
sr�c@seZdZdifdd�ZdS)�ToplevelNc	Ks�|rt||f�}d}dD]L}||kr||}|ddkrJd|dd�}nd|}|||f}||=qt�||d|i|�|��}|�|���|�|���|�d|j�dS)Nr
)rH�class_r&rUZcolormapr�r�r,rRrQ)r*r}r�r{rr6r/r�)	rcr�r%r�r�Zwmkeyr��optrnr
r
rr�)
s zToplevel.__init__�r@rArBr�r
r
r
rr�&
sr�c@s*eZdZdifdd�Zdd�Zdd�ZdS)rCNcKst�||d||�dS)NZbutton�r�r��rcr�r%r�r
r
rr�G
szButton.__init__cCs|j�|jd�dS�N�flashr�r�r
r
rr�\
s
zButton.flashcCs|j�|jd�S�N�invoker�r�r
r
rr�h
sz
Button.invoke)r@rArBr�r�r�r
r
r
rrCD
srCc@seZdZdifdd�Zdd�Zdd�Zdd	�Zd
d�Zdvdd
�Zdd�Z	dd�Z
dd�Zdd�Zdwdd�Z
dxdd�Zdydd�Zdzdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Zd<d=�Z d>d?�Z!d@dA�Z"d{dBdC�Z#dDdE�Z$dFdG�Z%dHdI�Z&dJdK�Z'dLdM�Z(dNdO�Z)dPdQ�Z*dRdS�Z+dTdU�Z,d|dVdW�Z-e-Z.dXdY�Z/e/Z0dZd[�Z1d}d]d^�Z2ifd_d`�Z3dadb�Z4e4Z5Z6dcdd�Z7dedf�Z8d~dhdi�Z9djdk�Z:dldm�Z;dndo�Z<dpdq�Z=drds�Z>dtdu�Z?dS)�CanvasNcKst�||d||�dS)NZcanvasr�r�r
r
rr�v
s
zCanvas.__init__cGs|j�|jdf|�dS)N�addtagr�r�r
r
rr��
sz
Canvas.addtagcCs|�|d|�dS�NZabove�r��rc�newtag�tagOrIdr
r
r�addtag_above�
szCanvas.addtag_abovecCs|�|d�dS�Nrur�)rcr�r
r
r�
addtag_all�
szCanvas.addtag_allcCs|�|d|�dS�NZbelowr�r�r
r
r�addtag_below�
szCanvas.addtag_belowcCs|�|d||||�dS�NZclosestr�)rcr�rTrU�halo�startr
r
r�addtag_closest�
szCanvas.addtag_closestcCs|�|d||||�dS�NZenclosedr��rcr��x1�y1�x2�y2r
r
r�addtag_enclosed�
szCanvas.addtag_enclosedcCs|�|d||||�dS�NZoverlappingr�r�r
r
r�addtag_overlapping�
szCanvas.addtag_overlappingcCs|�|d|�dS�NZwithtagr�r�r
r
r�addtag_withtag�
szCanvas.addtag_withtagcGs |�|j�|jdf|��pdS�Nr�r?r�r
r
rr��
s
��zCanvas.bboxcCs(|j�|jd||d�|r$|�|�dSrrrs)rcr�rjrlr
r
r�
tag_unbind�
szCanvas.tag_unbindcCs|�|jd|f|||�Srnrp)rcr�rjr�r�r
r
r�tag_bind�
s
�zCanvas.tag_bindcCs|j�|j�|jd||��S)N�canvasxr-)rcZscreenx�gridspacingr
r
rr��
s�zCanvas.canvasxcCs|j�|j�|jd||��S)N�canvasyr-)rcZscreenyr�r
r
rr��
s�zCanvas.canvasycs,�fdd��j��j��jdf|��D�S)Ncsg|]}�j�|��qSr
)r1r�r�r�r
rr��
sz!Canvas.coords.<locals>.<listcomp>�coordsrfr�r
r�rr��
s

��z
Canvas.coordsc	Cs\t|�}|d}t|ttf�r,|dd�}ni}|j�|jj|jd|f||�||����S)Nr�rB)	rrrrr1r�r�r�r�)rc�itemTyper�r�r%r
r
r�_create�
s��zCanvas._createcOs|�d||�S)NZarc�r�r�r
r
r�
create_arc�
szCanvas.create_arccOs|�d||�S�Nrr�r�r
r
r�
create_bitmap�
szCanvas.create_bitmapcOs|�d||�S)Nr�r�r�r
r
r�create_image�
szCanvas.create_imagecOs|�d||�S)N�liner�r�r
r
r�create_line�
szCanvas.create_linecOs|�d||�S)NZovalr�r�r
r
r�create_oval�
szCanvas.create_ovalcOs|�d||�S)NZpolygonr�r�r
r
r�create_polygon�
szCanvas.create_polygoncOs|�d||�S)NZ	rectangler�r�r
r
r�create_rectangle�
szCanvas.create_rectanglecOs|�d||�S�N�textr�r�r
r
r�create_text�
szCanvas.create_textcOs|�d||�S)Nr�r�r�r
r
r�
create_window�
szCanvas.create_windowcGs|j�|jdf|�dS)N�dcharsr�r�r
r
rr�sz
Canvas.dcharscGs|j�|jdf|�dS�Nr�r�r�r
r
rr�sz
Canvas.deletecGs|j�|jdf|�dS)N�dtagr�r�r
r
rr�	szCanvas.dtagcGs |�|j�|jdf|��pdS)N�findr
r?r�r
r
rr�s
��zCanvas.findcCs|�d|�Sr��r��rcr�r
r
r�
find_aboveszCanvas.find_abovecCs
|�d�Sr�r�r�r
r
r�find_allszCanvas.find_allcCs|�d|�Sr�r�r�r
r
r�
find_belowszCanvas.find_belowcCs|�d||||�Sr�r�)rcrTrUr�r�r
r
r�find_closestszCanvas.find_closestcCs|�d||||�Sr�r��rcr�r�r�r�r
r
r�
find_enclosed&szCanvas.find_enclosedcCs|�d||||�Sr�r�r�r
r
r�find_overlapping+szCanvas.find_overlappingcCs|�d|�Sr�r�r�r
r
r�find_withtag0szCanvas.find_withtagcGs|j�|jdf|�Sr�r�r�r
r
rrS4szCanvas.focuscGs|j�|j�|jdf|��S)N�gettagsrfr�r
r
rr�8s�zCanvas.gettagscGs|j�|jdf|�dS�N�icursorr�r�r
r
rr�=szCanvas.icursorcGs|j�|j�|jdf|��S�Nr�rr�r
r
rr�BszCanvas.indexcGs|j�|jdf|�dS�N�insertr�r�r
r
rr�Fsz
Canvas.insertcCs|j�|jdf|d|f�S�N�itemcgetr,r�)rcr�rr
r
rr�Ks�zCanvas.itemcgetcKs|�d|f||�S�N�
itemconfigurer��rcr�r%r�r
r
rr�PszCanvas.itemconfigurecGs|j�|jdf|�dSrr�r�r
r
r�	tag_lower_szCanvas.tag_lowercGs|j�|jdf|�dS)N�mover�r�r
r
rr�fszCanvas.moverYcCs|j�|jd|||�dS)Nr�r�)rcr�rTrUr
r
rr�jsz
Canvas.movetocKs|j�|jdf|�||��S)N�
postscriptrlr�r
r
rr�ss
�zCanvas.postscriptcGs|j�|jdf|�dSrr�r�r
r
r�	tag_raise{szCanvas.tag_raisecGs|j�|jdf|�dS�N�scaler�r�r
r
rr��szCanvas.scalecCs|j�|jdd||�dS�N�scan�markr�r�r
r
r�	scan_mark�szCanvas.scan_mark�
cCs|j�|jdd|||�dS�Nr��dragtor�)rcrTrUZgainr
r
r�scan_dragto�szCanvas.scan_dragtocCs|j�|jdd||�dS)N�select�adjustr��rcr�r�r
r
r�
select_adjust�szCanvas.select_adjustcCs|j�|jdd�dS)Nr�r�r�r�r
r
r�select_clear�szCanvas.select_clearcCs|j�|jdd||�dS)Nr��fromr�r�r
r
r�select_from�szCanvas.select_fromcCs|j�|jdd�pdS)Nr�rr�r�r
r
r�select_item�szCanvas.select_itemcCs|j�|jdd||�dS)Nr��tor�r�r
r
r�	select_to�szCanvas.select_tocCs|j�|jd|�pdS�Nrr�r�r
r
rr�szCanvas.type)NN)N)NNN)N)N)NN)N)rYrY)r�)@r@rArBr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rSr�r�r�r�r�r��
itemconfigr�rr�r�r�r�r�rr�r�r�r�r�r�r�r�rr
r
r
rr�s
sx


	



	
	
r�c@sBeZdZdifdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�ZdS)�CheckbuttonNcKst�||d||�dS�NZcheckbuttonr�r�r
r
rr��s
zCheckbutton.__init__cCs|j�|jd�dS�N�deselectr�r�r
r
rr��szCheckbutton.deselectcCs|j�|jd�dSr�r�r�r
r
rr��szCheckbutton.flashcCs|j�|jd�Sr�r�r�r
r
rr��szCheckbutton.invokecCs|j�|jd�dS�Nr�r�r�r
r
rr��szCheckbutton.selectcCs|j�|jd�dS)N�toggler�r�r
r
rr��szCheckbutton.toggle)	r@rArBr�r�r�r�r�r�r
r
r
rr��sr�c@s�eZdZdifdd�Zddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�ZeZdd�Z
e
Zdd�ZeZdd�ZeZdd�ZeZdd�ZeZdS)�EntryNcKst�||d||�dS)N�entryr�r�r
r
rr��szEntry.__init__cCs|j�|jd||�dSr�r��rc�firstZlastr
r
rr��szEntry.deletecCs|j�|jd�S�Nr�r�r�r
r
rr��sz	Entry.getcCs|j�|jd|�dSr�r��rcr�r
r
rr��sz
Entry.icursorcCs|j�|j�|jd|��Sr�rr�r
r
rr��s
�zEntry.indexcCs|j�|jd||�dSr�r�)rcr�r�r
r
rr��szEntry.insertcCs|j�|jdd|�dSr�r�r\r
r
rr��szEntry.scan_markcCs|j�|jdd|�dSr�r�r\r
r
rr��szEntry.scan_dragtocCs|j�|jdd|�dS)Nr	r�r�r�r
r
r�selection_adjust�szEntry.selection_adjustcCs|j�|jdd�dS�Nr	r�r�r�r
r
rr
szEntry.selection_clearcCs|j�|jdd|�dS)Nr	r�r�r�r
r
r�selection_fromszEntry.selection_fromcCs|j�|j�|jdd��S�Nr	Zpresentr(r�r
r
r�selection_presents�zEntry.selection_presentcCs|j�|jdd||�dS)Nr	�ranger��rcr��endr
r
r�selection_rangeszEntry.selection_rangecCs|j�|jdd|�dS)Nr	r�r�r�r
r
r�selection_toszEntry.selection_to)N)r@rArBr�r�r�r�r�r�r�r�rr�r
r�rr�rZselect_presentrZselect_ranger	r�r
r
r
rr��s(
r�c@seZdZdifdd�ZdS)�FrameNcKs^t||f�}d}d|kr,d|df}|d=nd|krFd|df}|d=t�||d|i|�dS)Nr
r�z-classr&r)r*r�r�)rcr�r%r�r�r
r
rr�&szFrame.__init__r�r
r
r
rr
#sr
c@seZdZdifdd�ZdS)�LabelNcKst�||d||�dS)N�labelr�r�r
r
rr�:szLabel.__init__r�r
r
r
rr7src@s�eZdZdifdd�Zdd�Zdd�Zdd	�Zd(d
d�Zd)dd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZeZd*dd�ZeZdd�ZeZd+d d!�ZeZd"d#�Zd$d%�Zd,d&d'�ZeZdS)-�ListboxNcKst�||d||�dS)NZlistboxr�r�r
r
rr�RszListbox.__init__cCs|j�|jd|�dS�N�activater�r�r
r
rr\szListbox.activatecCs|�|j�|jd|��pdSr�r?r�r
r
rr�`szListbox.bboxcCs|�|j�|jd��pdS)N�curselectionr
r?r�r
r
rreszListbox.curselectioncCs|j�|jd||�dSr�r�r�r
r
rr�iszListbox.deletecCs:|dk	r$|j�|j�|jd||��S|j�|jd|�SdSr�rfr�r
r
rr�ms�zListbox.getcCs*|j�|jd|�}|dkrdS|j�|�S�Nr�r��r1r�r�r��rcr�rer
r
rr�usz
Listbox.indexcGs|j�|jd|f|�dSr�r�)rcr��elementsr
r
rr�{szListbox.insertcCs|j�|j�|jd|��S)N�nearestr)rcrUr
r
rrs
�zListbox.nearestcCs|j�|jdd||�dSr�r�r�r
r
rr��szListbox.scan_markcCs|j�|jdd||�dSr�r�r�r
r
rr��szListbox.scan_dragtocCs|j�|jd|�dS�N�seer�r�r
r
rr�szListbox.seecCs|j�|jdd|�dS)Nr	r�r�r�r
r
r�selection_anchor�szListbox.selection_anchorcCs|j�|jdd||�dSrr�r�r
r
rr
�s
�zListbox.selection_clearcCs|j�|j�|jdd|��S)Nr	Zincludesr(r�r
r
r�selection_includes�s�zListbox.selection_includescCs|j�|jdd||�dS)Nr	r�r�r�r
r
r�
selection_set�szListbox.selection_setcCs|j�|j�|jd��S)Nr�rr�r
r
rr��szListbox.sizecCs|j�|jdf|d|f�Sr�r��rcr�rr
r
rr��s�zListbox.itemcgetcKs|�d|f||�Sr�r�r�r
r
rr��szListbox.itemconfigure)N)N)N)N)N)r@rArBr�rr�rr�r�r�r�rr�r�rrZ
select_anchorr
r�rZselect_includesrZ
select_setr�r�r�r�r
r
r
rr
Os0






r
c@seZdZdifdd�Zd5dd�Zdd�Zifd	d
�Zifdd�Zifd
d�Zifdd�Z	ifdd�Z
ifdd�Zifdd�Zifdd�Z
ifdd�Zifdd�Zifdd�Zifdd �Zd6d!d"�Zd#d$�Zd7d%d&�ZeZd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�ZdS)8�MenuNcKst�||d||�dS�N�menur�r�r
r
rr��sz
Menu.__init__rYcCs|j�d|j|||�dS)N�tk_popupr�)rcrTrUr�r
r
rr�sz
Menu.tk_popupcCs|j�|jd|�dSrr�r�r
r
rr�sz
Menu.activatecKs$|j�|jd|f|�||��dS�Nr�rl)rcr�r%r�r
r
rr��s
�zMenu.addcKs|�d|p|�dS�NZcascade�r�r�r
r
r�add_cascade�szMenu.add_cascadecKs|�d|p|�dSr�r"r�r
r
r�add_checkbutton�szMenu.add_checkbuttoncKs|�d|p|�dS�Nrr"r�r
r
r�add_command�szMenu.add_commandcKs|�d|p|�dS�NZradiobuttonr"r�r
r
r�add_radiobutton�szMenu.add_radiobuttoncKs|�d|p|�dS�NZ	separatorr"r�r
r
r�
add_separator�szMenu.add_separatorcKs&|j�|jd||f|�||��dSr�rl)rcr�r�r%r�r
r
rr��s
�zMenu.insertcKs|�|d|p|�dSr!�r�r�r
r
r�insert_cascade�szMenu.insert_cascadecKs|�|d|p|�dSr�r+r�r
r
r�insert_checkbutton�szMenu.insert_checkbuttoncKs|�|d|p|�dSr%r+r�r
r
r�insert_command�szMenu.insert_commandcKs|�|d|p|�dSr'r+r�r
r
r�insert_radiobutton
szMenu.insert_radiobuttoncKs|�|d|p|�dSr)r+r�r
r
r�insert_separator
szMenu.insert_separatorcCs�|dkr|}|�|�|�|�}}|dks2|dkr:d\}}t||d�D]0}d|�|�krHt|�|d��}|rH|�|�qH|j�|jd||�dS)N)rr�rrr�)	r�r�entryconfigr�	entrycgetr�r1r�r�)rc�index1�index2Z
num_index1Z
num_index2rer&r
r
rr�	
szMenu.deletecCs|j�|jd|d|�S)Nr2r,r�rr
r
rr2
szMenu.entrycgetcKs|�d|f||�S)N�entryconfigurer�r�r
r
rr5
szMenu.entryconfigurecCs*|j�|jd|�}|dkrdS|j�|�Srrrr
r
rr�#
sz
Menu.indexcCs|j�|jd|�Sr�r�r�r
r
rr�)
szMenu.invokecCs|j�|jd||�dS)N�postr�r�r
r
rr6.
sz	Menu.postcCs|j�|jd|�Sr�r�r�r
r
rr2
sz	Menu.typecCs|j�|jd�dS)N�unpostr�r�r
r
rr76
szMenu.unpostcCs|j�|j�|jd|��S)N�	xpositionrr�r
r
rr8:
szMenu.xpositioncCs|j�|j�|jd|��S)N�	ypositionrr�r
r
rr9?
s
�zMenu.yposition)rY)N)N)r@rArBr�rrr�r#r$r&r(r*r�r,r-r.r/r0r�r2r5r1r�r�r6rr7r8r9r
r
r
rr�s4	


rc@seZdZdifdd�ZdS)�
MenubuttonNcKst�||d||�dS)N�
menubuttonr�r�r
r
rr�H
szMenubutton.__init__r�r
r
r
rr:E
sr:c@seZdZdifdd�ZdS)�MessageNcKst�||d||�dS)N�messager�r�r
r
rr�O
szMessage.__init__r�r
r
r
rr<L
sr<c@s:eZdZdifdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)�RadiobuttonNcKst�||d||�dSr'r�r�r
r
rr�V
s
zRadiobutton.__init__cCs|j�|jd�dSr�r�r�r
r
rr�b
szRadiobutton.deselectcCs|j�|jd�dSr�r�r�r
r
rr�g
szRadiobutton.flashcCs|j�|jd�Sr�r�r�r
r
rr�k
szRadiobutton.invokecCs|j�|jd�dSr�r�r�r
r
rr�o
szRadiobutton.select)r@rArBr�r�r�r�r�r
r
r
rr>S
s
r>c@s<eZdZdifdd�Zdd�Zdd�Zddd	�Zd
d�ZdS)
�ScaleNcKst�||d||�dSr�r�r�r
r
rr�w
s	zScale.__init__c
CsJ|j�|jd�}z|j�|�WStttfk
rD|j�|�YSXdSr�)r1r�r�r�rsr"r�r�r�r
r
rr��
s
z	Scale.getcCs|j�|jd|�dS�Nr�r�r�r
r
rr��
sz	Scale.setcCs|�|j�|jd|��S)Nr�r?r�r
r
rr��
szScale.coordscCs|j�|jd||�S�N�identifyr�r�r
r
rrB�
szScale.identify)N)r@rArBr�r�r�r�rBr
r
r
rr?t
s

r?c@sLeZdZdifdd�Zddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dS)�	ScrollbarNcKst�||d||�dS)NZ	scrollbarr�r�r
r
rr��
s	zScrollbar.__init__cCs|j�|jd|�pdSrr�r�r
r
rr�
szScrollbar.activatecCs|j�|j�|jd||��S)NrOr-)rcZdeltaxZdeltayr
r
rrO�
s�zScrollbar.deltacCs|j�|j�|jd||��S)Nr�r-r�r
r
rr��
szScrollbar.fractioncCs|j�|jd||�SrAr�r�r
r
rrB�
szScrollbar.identifycCs|�|j�|jd��Sr�)r}r1r�r�r�r
r
rr��
sz
Scrollbar.getcCs|j�|jd||�dSr@r�r�r
r
rr��
sz
Scrollbar.set)N)
r@rArBr�rrOr�rBr�r�r
r
r
rrC�
s
	rCc@s�eZdZdifdd�Zdd�Zdd�Zdd	�Zdjd
d�Zdkdd
�Zdd�Z	dldd�Z
dd�Zdmdd�Zdd�Z
dd�Zdd�Zdd�Zdndd�Zd d!�Zdod"d#�Zifd$d%�Zd&d'�Zd(d)�Zd*d+�Zdpd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zifd8d9�Zd:d;�Zd<d=�Z d>d?�Z!d@dA�Z"dqdBdC�Z#dDdE�Z$dFdG�Z%drdHdI�Z&dsdJdK�Z'dLdM�Z(dtdNdO�Z)e)Z*dPdQ�Z+dudRdS�Z,dvdTdU�Z-dwdVdW�Z.dxdXdY�Z/dydZd[�Z0d\d]�Z1dzd^d_�Z2d`da�Z3d{dbdc�Z4e4Z5ifddde�Z6dfdg�Z7dhdi�Z8dS)|�TextNcKst�||d||�dSr�r�r�r
r
rr��
sz
Text.__init__cCs|�|j�|jd|��pdSr�r?r�r
r
rr��
s
��z	Text.bboxc	Cs|j�|j�|jd|||��S)N�comparer()rcr3�opr4r
r
rrE�
s�zText.comparecGsVdd�|D�}|||g7}|jj|jdf|��p2d}|dk	rNt|�dkrN|fS|SdS)NcSsg|]}|�d�sd|�qS)r,r�)�
startswith)rI�argr
r
rr�s
zText.count.<locals>.<listcomp>r~�)r1r�r�r)rcr3r4r�rr
r
rr~�
sz
Text.countcCs6|dkr |j�|j�|jd��S|j�|jd|�dS)N�debugr(r�r
r
rrJ	sz
Text.debugcCs|j�|jd||�dSr�r��rcr3r4r
r
rr�szText.deletecCs|�|j�|jd|��S)N�	dlineinfor?r�r
r
rrLszText.dlineinfoc
	Ks�g}d}d}|s$g}|fdd�}|}zzt|t�s>|�|�}}|d|g7}|D]}	||	rN|�d|	�qN|�|�|r�|�|�|jj|jdf|��|W�S|r�|�|�XdS)NcSs|�|||f�dSrp)ra)r5r	r�r#r
r
r�
append_triple/sz Text.dump.<locals>.append_triplez-commandr,�dump)r�rrr�rar1r�r�)
rcr3r4rr�r�Z	func_namer#rMr5r
r
rrNs*


z	Text.dumpcGs|jj|jdf|��S)N�editr�r�r
r
rrOBs
z	Text.editcCs|�d|�S)NZmodified�rO)rcrHr
r
r�
edit_modifiedQs	zText.edit_modifiedcCs
|�d�S)NZredorPr�r
r
r�	edit_redo\szText.edit_redocCs
|�d�S)N�resetrPr�r
r
r�
edit_resetfszText.edit_resetcCs
|�d�Sr)rPr�r
r
r�edit_separatorkszText.edit_separatorcCs
|�d�S)NZundorPr�r
r
r�	edit_undors	zText.edit_undocCs|j�|jd||�Sr�r�rKr
r
rr�}szText.getcCsJ|dd�dkrd|}|dd�dkr4|dd�}|j�|jdd||�S)Nrr,r�r�r�r�r�rr
r
r�
image_cget�s
zText.image_cgetcKs|�dd|f||�S)Nr�r�r�r�r
r
r�image_configure�szText.image_configurecKs"|jj|jdd|f|�||���S)Nr�rBrlr�r
r
r�image_create�s�
�zText.image_createcCs|j�|jdd�Sr�r�r�r
r
rr��szText.image_namescCst|j�|jd|��Sr�)rr1r�r�r�r
r
rr��sz
Text.indexcGs|j�|jd||f|�dSr�r�)rcr��charsr�r
r
rr��szText.insertcCs|j�|jdd||f�S)Nr�Zgravityr�)rc�markName�	directionr
r
r�mark_gravity�s�zText.mark_gravitycCs|j�|j�|jdd��S)Nr�r�rfr�r
r
r�
mark_names�s
�zText.mark_namescCs|j�|jdd||�dS)Nr�r�r�)rcr[r�r
r
r�mark_set�sz
Text.mark_setcGs|j�|jddf|�dS)Nr�Zunsetr�)rcZ	markNamesr
r
r�
mark_unset�szText.mark_unsetcCs|j�|jdd|�pdS)Nr��nextr�r�r
r
r�	mark_next�szText.mark_nextcCs|j�|jdd|�pdS)Nr�Zpreviousr�r�r
r
r�
mark_previous�szText.mark_previouscKs&|jj|jdd|f|�||���dS)N�peerrBrl)rcZnewPathNamer%r�r
r
r�peer_create�s
�zText.peer_createcCs|j�|j�|jdd��S)Nrdr�rfr�r
r
r�
peer_names�szText.peer_namescGs |jj|jd|||f|��dS)Nrr�)rcr3r4rZr�r
r
rr�szText.replacecCs|j�|jdd||�dSr�r�r�r
r
rr��szText.scan_markcCs|j�|jdd||�dSr�r�r�r
r
rr��szText.scan_dragtocCs�|jdg}|r|�d�|r&|�d�|r4|�d�|rB|�d�|rP|�d�|
r^|�d�|	rv|�d�|�|	�|r�|d	d
kr�|�d�|�|�|�|�|r�|�|�t|j�t|���S)Nrz	-forwardsz
-backwardsz-exactz-regexpz-nocasez-elidez-countrr,r�)r�rarr1r�r)rcrr�Z	stopindexZforwardsZ	backwards�exactZregexpZnocaser~Zelider�r
r
rr�s.












zText.searchcCs|j�|jd|�dSrr�r�r
r
rr�szText.seecGs |j�|jdd||f|�dS)N�tagr�r�)rc�tagNamer3r�r
r
r�tag_add�s�zText.tag_addcCs*|j�|jdd||d�|r&|�|�dS)NrhrorYrs)rcrirjrlr
r
rr��szText.tag_unbindcCs|�|jdd|f|||�S)Nrhrorp)rcrirjr�r�r
r
rr�s
�z
Text.tag_bindcCsJ|dd�dkrd|}|dd�dkr4|dd�}|j�|jdd||�S)Nrr,r�r�rhr�r�)rcrirr
r
r�tag_cget	s
z
Text.tag_cgetcKs|�dd|f||�S)Nrhr�r�)rcrir%r�r
r
r�
tag_configureszText.tag_configurecGs|j�|jddf|�dS)Nrhr�r�)rcZtagNamesr
r
r�
tag_deleteszText.tag_deletecCs|j�|jdd||�dS)Nrhrr�)rcrirr
r
rr�szText.tag_lowercCs|j�|j�|jdd|��S)Nrhr�rfr�r
r
r�	tag_names s�zText.tag_namesc
Cs |j�|j�|jdd|||��S)NrhZ	nextrangerf�rcrir3r4r
r
r�
tag_nextrange%s�zText.tag_nextrangec
Cs |j�|j�|jdd|||��S)NrhZ	prevrangerfror
r
r�
tag_prevrange,s�zText.tag_prevrangecCs|j�|jdd||�dS)Nrhrr�)rcrirr
r
rr�3s�zText.tag_raisecCs|j�|j�|jdd|��S)NrhZrangesrf)rcrir
r
r�
tag_ranges9s�zText.tag_rangescCs|j�|jdd|||�dS)Nrhr�r�ror
r
r�
tag_remove>s�zText.tag_removecCsJ|dd�dkrd|}|dd�dkr4|dd�}|j�|jdd||�S)Nrr,r�r�r�r�r�rr
r
r�window_cgetCs
zText.window_cgetcKs|�dd|f||�S)Nr�r�r�r�r
r
r�window_configureKszText.window_configurecKs&|j�|jdd|f|�||��dS)Nr�rBrlr�r
r
r�
window_createQs

��zText.window_createcCs|j�|j�|jdd��S)Nr�r�rfr�r
r
r�window_namesWs�zText.window_namescGs|j�|jddf|�dS)Nr�z
-pickplacer�)rcrmr
r
r�yview_pickplace\szText.yview_pickplace)N)N)NN)N)N)N)N)NNNNNNNN)N)N)N)N)N)N)N)N)N)N)9r@rArBr�r�rEr~rJr�rLrNrOrQrRrTrUrVr�rWrXrYr�r�r�r]r^r_r`rbrcrerfrr�r�rrrjr�r�rkrlZ
tag_configrmr�rnrprqr�rrrsrtruZ
window_configrvrwrxr
r
r
rrD�
s|


(




�


	







rDc@seZdZddd�Zdd�ZdS)�_setitNcCs||_||_||_dSrp)�
_setit__value�_setit__var�_setit__callback)rc�varr	r�r
r
rr�dsz_setit.__init__cGs*|j�|j�|jr&|j|jf|��dSrp)r{r�rzr|r�r
r
rr�isz_setit.__call__)Nr�r
r
r
rryas
ryc@s$eZdZdd�Zdd�Zdd�ZdS)�
OptionMenuc
Os�d|dtddd�}t�||d|�d|_t|ddd	�}|_|j|_|�d
�}d
|kr\|d
=|rtt	dt
t|����|j|t
|||�d�|D]}	|j|	t
||	|�d�q�||d<dS)
Nr+rr&)ZborderwidthZtextvariableZindicatoronZreliefr�Zhighlightthicknessr;Z
tk_optionMenurr)rXZtearoffrzunknown option -)rr)ZRAISEDr�r�r�r�_OptionMenu__menur�Zmenunamer�r�rar/r&ry)
rcr�r�r	rU�kwargsr�rr�r)r
r
rr�rs.�

�
�zOptionMenu.__init__cCs|dkr|jSt�||�Sr)rr�r�r�r
r
rr��szOptionMenu.__getitem__cCst�|�d|_dSrp)r:r�rr�r
r
rr��s
zOptionMenu.destroyN)r@rArBr�r�r�r
r
r
rr~osr~c@sdeZdZdZdidfdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	e	Z
dd�Zdd�Zdd�Z
dS)�ImagerNc	Ks�d|_|std�}t|d|�|_|s>tjd7_dtjf}|rT|rTt||f�}n|r\|}d}|��D]*\}}t|�r�|�	|�}|d||f}qh|j�
dd||f|�||_dS)	Nzcreate imager1rz	pyimage%rr
r,r�rB)rXror^r1r��_last_idr*r$r�r�r�)	rcZimgtyperXr%r�r�r�r(r)r
r
rr��s$
zImage.__init__cCs|jSrp)rXr�r
r
rrE��z
Image.__str__cCs6|jr2z|j�dd|j�Wntk
r0YnXdS)Nr�r�)rXr1r�r�r�r
r
rr��s
z
Image.__del__cCs|j�|jdd||�dS�Nr�r,�r1r�rXr�r
r
rr��szImage.__setitem__cCs|j�|jdd|�Sr�r�r�r
r
rr��szImage.__getitem__cKsvd}t|���D]J\}}|dk	r|ddkr8|dd�}t|�rJ|�|�}|d||f}q|j�|jdf|�dS)Nr
r�r�r,r�)r*r$r�r�r1r�rX)rcr�rr(r)r
r
rr��s
zImage.configurecCs|j�|j�dd|j��S)Nr�rW�r1r�r�rXr�r
r
rrW�s�zImage.heightcCs|j�dd|j�S)Nr�rr�r�r
r
rr�sz
Image.typecCs|j�|j�dd|j��S)Nr�rVr�r�r
r
rrV�s�zImage.width)r@rArBr�r�rEr�r�r�r�r�rWrrVr
r
r
rr��sr�c@s|eZdZdidfdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
d�Zddd�Z	dd�Z
ddd�Zddd�Zdd�Z
dd�ZdS)�
PhotoImageNcKstj|d|||f|�dS)NZphoto�r�r��rcrXr%r�r�r
r
rr��szPhotoImage.__init__cCs|j�|jd�dS)N�blankr�r�r
r
rr��szPhotoImage.blankcCs|j�|jdd|�Sr�r�)rcrr
r
rr��szPhotoImage.cgetcCs|j�|jdd|�Sr�r�r�r
r
rr��szPhotoImage.__getitem__cCs"t|jd�}|j�|d|j�|S)Nr��copy�r�r1r�rX)rc�	destImager
r
rr��szPhotoImage.copyrYcCs4t|jd�}|dkr|}|j�|d|jd||�|S)Nr�rYr�z-zoomr��rcrTrUr�r
r
r�zoom�s
zPhotoImage.zoomcCs4t|jd�}|dkr|}|j�|d|jd||�|S)Nr�rYr�z
-subsampler�r�r
r
r�	subsample�s
zPhotoImage.subsamplecCs|j�|jd||�Sr�r�r�r
r
rr�	szPhotoImage.getcCsH|jd|f}|r8|ddkr(|dd�}|dt|�}|j�|�dS)N�putr�-tor)r��rXrr1r�)rcr�r�r�r
r
rr�
szPhotoImage.putcCs@|jd|f}|r|d|f}|r0|dt|�}|j�|�dS)N�writez-format)z-fromr�)rc�filename�formatZfrom_coordsr�r
r
rr�szPhotoImage.writec	Cs|j�|j�|jdd||��S)N�transparencyr�)r1r�r�rXr�r
r
r�transparency_get"s�zPhotoImage.transparency_getcCs|j�|jdd|||�dS)Nr�r�r�)rcrTrUr�r
r
r�transparency_set'szPhotoImage.transparency_set)rY)rY)N)NN)r@rArBr�r�r�r�r�r�r�r�r�r�r�r�r
r
r
rr��s






r�c@seZdZdidfdd�ZdS)�BitmapImageNcKstj|d|||f|�dSr�r�r�r
r
rr�/szBitmapImage.__init__r�r
r
r
rr�,sr�cCstd�j}|�|�dd��S)Nzuse image_names()r�r��ror1r-r��r1r
r
rr�6s
r�cCstd�j}|�|�dd��S)Nzuse image_types()r�r�r�r�r
r
rr�;s
r�c@s�eZdZdifdd�Zdd�Zd*dd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd+d d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�ZdS),�SpinboxNcKst�||d||�dS)NZspinboxr�r�r
r
rr�CszSpinbox.__init__cCs|�|j�|jd|��pdSr�r?r�r
r
rr�`szSpinbox.bboxcCs|j�|jd||�Sr�r�r�r
r
rr�ns	zSpinbox.deletecCs|j�|jd�Sr�r�r�r
r
rr�yszSpinbox.getcCs|j�|jd|�Sr�r�r�r
r
rr�}szSpinbox.icursorcCs|j�|jd||�SrAr�r�r
r
rrB�szSpinbox.identifycCs|j�|jd|�Sr�r�r�r
r
rr��sz
Spinbox.indexcCs|j�|jd||�Sr�r�)rcr�rdr
r
rr��szSpinbox.insertcCs|j�|jd|�Sr�r��rc�elementr
r
rr��szSpinbox.invokecGs |�|j�|jdf|��pdS)Nr�r
r?r�r
r
rr��s
��zSpinbox.scancCs|�d|�S�Nr��r�r\r
r
rr��szSpinbox.scan_markcCs|�d|�S)Nr�r�r\r
r
rr��s
zSpinbox.scan_dragtocGs |�|j�|jdf|��pdS)Nr	r
r?r�r
r
rr	�s
��zSpinbox.selectioncCs|�d|�S)Nr��r	r�r
r
rr�szSpinbox.selection_adjustcCs
|�d�S)Nr�r�r�r
r
rr
�szSpinbox.selection_clearcCs|j�|jdd|�S)Nr	r�r�r�r
r
r�selection_element�szSpinbox.selection_elementcCs|�d|�dS)Nr�r�r�r
r
rr�szSpinbox.selection_fromcCs|j�|j�|jdd��Srr(r�r
r
rr�s�zSpinbox.selection_presentcCs|�d||�dS)Nrr�rr
r
rr�szSpinbox.selection_rangecCs|�d|�dS)Nr�r�r�r
r
rr	�szSpinbox.selection_to)N)N)r@rArBr�r�r�r�r�rBr�r�r�r�r�r�r	rr
r�rrrr	r
r
r
rr�@s(
	
r�c@seZdZdifdd�ZdS)�
LabelFrameNcKst�||d||�dS)NZ
labelframer�r�r
r
rr��szLabelFrame.__init__r�r
r
r
rr��sr�c@s�eZdZdifdd�Zdd�Zdd�ZeZdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd dd�ZeZdd�ZdS)!�PanedWindowNcKst�||d||�dS)NZpanedwindowr�r�r
r
rr�
szPanedWindow.__init__cKs"|j�|jd|f|�|��dSr rl)rcr$r�r
r
rr�szPanedWindow.addcCs|j�|jd|�dS�Nr	r�)rcr$r
r
rr�'szPanedWindow.removecCs|j�|jd||�SrAr�r�r
r
rrB0s
zPanedWindow.identifycGs |�|j�|jdf|��pdS)N�proxyr
r?r�r
r
rr�<s
��zPanedWindow.proxycCs
|�d�S�NZcoord�r�r�r
r
r�proxy_coordAszPanedWindow.proxy_coordcCs
|�d�Sr�r�r�r
r
r�proxy_forgetFszPanedWindow.proxy_forgetcCs|�d||�S�Nr�r�r�r
r
r�proxy_placeKszPanedWindow.proxy_placecGs |�|j�|jdf|��pdS)N�sashr
r?r�r
r
rr�Ps
��zPanedWindow.sashcCs|�d|�Sr��r�r�r
r
r�
sash_coordUszPanedWindow.sash_coordcCs|�d|�Sr�r�r�r
r
r�	sash_markcszPanedWindow.sash_markcCs|�d|||�Sr�r�)rcr�rTrUr
r
r�
sash_placejszPanedWindow.sash_placecCs|j�|jdf|d|f�S)N�panecgetr,r�)rcr$rr
r
rr�os�zPanedWindow.panecgetcKsd|dkr|s|�|jd|�St|t�r@|s@|�|jd|d|�S|j�|jd|f|�||��dS)N�
paneconfigurer,)r�r�rrr�r1r�r�r�r
r
rr�wsD�
�zPanedWindow.paneconfigurecCs|j�|j�|jd��S)N�panesrfr�r
r
rr��szPanedWindow.panes)N)r@rArBr�r�r�r	rBr�r�r�r�r�r�r�r�r�r�Z
paneconfigr�r
r
r
rr�
s"

Lr�cCs�t�}dt}|d7}t||d�}|��t|d|fdd�d�}|��||_t|d|jd�}|��|��|��|�	�|�
�dS)	NzThis is Tcl/Tk version %su
This should be a cedilla: ç�r�z	Click me!cSs|jjd|jdd�S)Nz[%s]r�r�)�testr�)rnr
r
r�<lambda>�s�z_test.<locals>.<lambda>)r�rZQUIT)rl�
TclVersionrr�rCr�r�rr rr�)rnr�rr�r{r
r
r�_test�s 
�r��__main__)TN)N)r)r)NNrlr)U�enumr�r�r�Ztkinter.constants�rerC�floatrRZ	TkVersionrSr�ZREADABLEZWRITABLEZ	EXCEPTION�compiler�ASCIIrrrrr!r*r6r�Enumr7rFrirjrkrorrrvr~rwr�r�r�r�r�r_r�r�r�r�r�r�r�r�rlrjrkrtrxr}r�r�rCr�r�r�r
rr
rr:r<r>r?rCrDryr~r�r�r�r�r�r�r�r�r�r@r
r
r
r�<module>!s�





,R

	6

q2~
.37?/8$Vt!'2'BT
3C
tkinter/__pycache__/dnd.cpython-38.opt-1.pyc000064400000026000151153537530014576 0ustar00U

e5d�,�@sXdZddlZdd�ZGdd�d�ZGdd�d�ZGd	d
�d
�Zdd�Zed
krTe�dS)aFDrag-and-drop support for Tkinter.

This is very preliminary.  I currently only support dnd *within* one
application, between different windows (or within the same window).

I am trying to make this as generic as possible -- not dependent on
the use of a particular widget or icon type, etc.  I also hope that
this will work with Pmw.

To enable an object to be dragged, you must create an event binding
for it that starts the drag-and-drop process. Typically, you should
bind <ButtonPress> to a callback function that you write. The function
should call Tkdnd.dnd_start(source, event), where 'source' is the
object to be dragged, and 'event' is the event that invoked the call
(the argument to your callback function).  Even though this is a class
instantiation, the returned instance should not be stored -- it will
be kept alive automatically for the duration of the drag-and-drop.

When a drag-and-drop is already in process for the Tk interpreter, the
call is *ignored*; this normally averts starting multiple simultaneous
dnd processes, e.g. because different button callbacks all
dnd_start().

The object is *not* necessarily a widget -- it can be any
application-specific object that is meaningful to potential
drag-and-drop targets.

Potential drag-and-drop targets are discovered as follows.  Whenever
the mouse moves, and at the start and end of a drag-and-drop move, the
Tk widget directly under the mouse is inspected.  This is the target
widget (not to be confused with the target object, yet to be
determined).  If there is no target widget, there is no dnd target
object.  If there is a target widget, and it has an attribute
dnd_accept, this should be a function (or any callable object).  The
function is called as dnd_accept(source, event), where 'source' is the
object being dragged (the object passed to dnd_start() above), and
'event' is the most recent event object (generally a <Motion> event;
it can also be <ButtonPress> or <ButtonRelease>).  If the dnd_accept()
function returns something other than None, this is the new dnd target
object.  If dnd_accept() returns None, or if the target widget has no
dnd_accept attribute, the target widget's parent is considered as the
target widget, and the search for a target object is repeated from
there.  If necessary, the search is repeated all the way up to the
root widget.  If none of the target widgets can produce a target
object, there is no target object (the target object is None).

The target object thus produced, if any, is called the new target
object.  It is compared with the old target object (or None, if there
was no old target widget).  There are several cases ('source' is the
source object, and 'event' is the most recent event object):

- Both the old and new target objects are None.  Nothing happens.

- The old and new target objects are the same object.  Its method
dnd_motion(source, event) is called.

- The old target object was None, and the new target object is not
None.  The new target object's method dnd_enter(source, event) is
called.

- The new target object is None, and the old target object is not
None.  The old target object's method dnd_leave(source, event) is
called.

- The old and new target objects differ and neither is None.  The old
target object's method dnd_leave(source, event), and then the new
target object's method dnd_enter(source, event) is called.

Once this is done, the new target object replaces the old one, and the
Tk mainloop proceeds.  The return value of the methods mentioned above
is ignored; if they raise an exception, the normal exception handling
mechanisms take over.

The drag-and-drop processes can end in two ways: a final target object
is selected, or no final target object is selected.  When a final
target object is selected, it will always have been notified of the
potential drop by a call to its dnd_enter() method, as described
above, and possibly one or more calls to its dnd_motion() method; its
dnd_leave() method has not been called since the last call to
dnd_enter().  The target is notified of the drop by a call to its
method dnd_commit(source, event).

If no final target object is selected, and there was an old target
object, its dnd_leave(source, event) method is called to complete the
dnd sequence.

Finally, the source object is notified that the drag-and-drop process
is over, by a call to source.dnd_end(target, event), specifying either
the selected target object, or None if no target object was selected.
The source object can use this to implement the commit action; this is
sometimes simpler than to do it in the target's dnd_commit().  The
target's dnd_commit() method could then simply be aliased to
dnd_leave().

At any time during a dnd sequence, the application can cancel the
sequence by calling the cancel() method on the object returned by
dnd_start().  This will call dnd_leave() if a target is currently
active; it will never call dnd_commit().

�NcCst||�}|jr|SdSdS�N)�
DndHandler�root)�source�event�h�r�#/usr/lib64/python3.8/tkinter/dnd.py�	dnd_startls
r
c@sDeZdZdZdd�Zdd�Zdd�Zdd	�Zdd
d�Zdd
d�Z	dS)rNcCs�|jdkrdS|j��}z|jWdStk
rD||_||_YnX||_d|_|j|_}|j|_	}d||f|_
|dp�d|_|�|j
|j
�|�d|j�d|d<dS)N�z<B%d-ButtonRelease-%d>�cursor��<Motion>Zhand2)Znum�widgetZ_root�_DndHandler__dnd�AttributeErrorrr�targetZinitial_button�initial_widget�release_pattern�save_cursor�bind�
on_release�	on_motion)�selfrrrZbuttonrrrr	�__init__zs$

zDndHandler.__init__cCs2|j}d|_|r.z|`Wntk
r,YnXdSr)rrr�rrrrr	�__del__�szDndHandler.__del__c	Cs�|j|j}}|j�||�}|j}d}|rbz
|j}Wntk
rHYnX|||�}|rZqb|j}q&|j}||kr�|r�|�	||�n,|r�d|_|�
||�|r�|�||�||_dSr)�x_root�y_rootrZwinfo_containingr�
dnd_acceptrZmasterr�
dnd_motion�	dnd_leave�	dnd_enter)	rr�x�yZ
target_widgetr�
new_target�attrZ
old_targetrrr	r�s.

zDndHandler.on_motioncCs|�|d�dS)N���finish�rrrrr	r�szDndHandler.on_releasecCs|�|d�dS)Nrr(r*rrr	�cancel�szDndHandler.cancelrc
Cs�|j}|j}|j}|j}zf|`|j�|j�|j�d�|j|d<d|_|_|_|_|r||rp|�	||�n|�
||�W5|�||�XdS)Nrr)rrrr�dnd_endrZunbindrr�
dnd_commitr!)rrZcommitrrrrrrr	r)�s
zDndHandler.finish)N)r)
�__name__�
__module__�__qualname__rrrrrr+r)rrrr	rvs	
rc@sNeZdZdd�Zddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dS)�IconcCs||_d|_|_|_dSr)�name�canvas�label�id)rr2rrr	r�sz
Icon.__init__�
cCs�||jkr |j�|j||�dS|jr.|��|s6dStj||jddd�}|j|||dd�}||_||_||_|�	d|j
�dS)N�Zraised)�textZborderwidthZreliefZnw)ZwindowZanchorz
<ButtonPress>)r3�coordsr5�detach�tkinterZLabelr2Z
create_windowr4r�press)rr3r#r$r4r5rrr	�attach�s 

�zIcon.attachcCsB|j}|sdS|j}|j}d|_|_|_|�|�|��dSr)r3r5r4�deleteZdestroy)rr3r5r4rrr	r:�s
zIcon.detachcCs4t||�r0|j|_|j|_|j�|j�\|_|_	dSr)
r
r#�x_offr$�y_offr3r9r5�x_orig�y_origr*rrr	r<�s
z
Icon.presscCs(|�|j|�\}}|j�|j||�dSr)�wherer3r9r5)rrr#r$rrr	�move�sz	Icon.movecCs|j�|j|j|j�dSr)r3r9r5rArB)rrrr	�putback�szIcon.putbackcCs8|��}|��}|j|}|j|}||j||jfSr)Zwinfo_rootxZwinfo_rootyrrr?r@)rr3rZx_orgZy_orgr#r$rrr	rC�s


z
Icon.wherecCsdSrr)rrrrrr	r,szIcon.dnd_endN)r6r6)r.r/r0rr=r:r<rDrErCr,rrrr	r1�s


r1c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�TestercCs>t�|�|_tj|jddd�|_|jjddd�|j|j_dS)N�d)�widthZheightZbothr')Zfill�expand)r;ZToplevel�topZCanvasr3�packrrrrr	rszTester.__init__cCs|Srr�rrrrrr	rszTester.dnd_acceptcCsp|j��|�|j|�\}}|j�|j�\}}}}||||}	}
|j�||||	||
�|_|�||�dSr)r3�	focus_setrC�bboxr5Zcreate_rectangle�dndidr )rrrr#r$�x1�y1�x2�y2ZdxZdyrrr	r"s
zTester.dnd_enterc	CsF|�|j|�\}}|j�|j�\}}}}|j�|j||||�dSr)rCr3rNrOrD)	rrrr#r$rPrQrRrSrrr	r szTester.dnd_motioncCs"|j��|j�|j�d|_dSr)rJrMr3r>rOrLrrr	r!$s
zTester.dnd_leavecCs2|�||�|�|j|�\}}|�|j||�dSr)r!rCr3r=)rrrr#r$rrr	r-)szTester.dnd_commitN)	r.r/r0rrr"r r!r-rrrr	rFsrFcCs�t��}|�d�tj|jdd���t|�}|j�d�t|�}|j�d�t|�}|j�d�td�}td�}td	�}|�	|j
�|�	|j
�|�	|j
�|��dS)
Nz+1+1ZQuit)Zcommandr8z+1+60z+120+60z+240+60ZICON1ZICON2ZICON3)r;ZTkZgeometryZButton�quitrKrFrJr1r=r3Zmainloop)r�t1�t2Zt3Zi1Zi2Zi3rrr	�test/s 
rW�__main__)�__doc__r;r
rr1rFrWr.rrrr	�<module>sf
Y=#tkinter/__pycache__/commondialog.cpython-38.pyc000064400000002132151153537530015542 0ustar00U

e5d��@sddlTGdd�d�ZdS)�)�*c@s2eZdZdZd
dd�Zdd�Zdd�Zdd	�ZdS)�DialogNcKs|s|�d�}||_||_dS)N�parent)�get�master�options)�selfrr�r	�,/usr/lib64/python3.8/tkinter/commondialog.py�__init__s
zDialog.__init__cCsdS�Nr	)rr	r	r
�_fixoptionsszDialog._fixoptionscCs|Srr	)rZwidget�resultr	r	r
�
_fixresultszDialog._fixresultcKs||��D]\}}||j|<q|��t|j�}z,|jj|jf|�	|j���}|�
||�}W5z|��WnYnXX|Sr)�itemsrr
ZFramerZdestroyZtkZcall�commandZ_optionsr)rr�k�v�w�sr	r	r
�shows
zDialog.show)N)�__name__�
__module__�__qualname__rrr
rrr	r	r	r
rs

rN)Ztkinterrr	r	r	r
�<module>stkinter/__pycache__/font.cpython-38.pyc000064400000014241151153537530014044 0ustar00U

e5d@�@szdZddlZddlZdZdZdZdZdd�ZGd	d
�d
�Zd dd�Z	d!d
d�Z
edk�rve��Z
edded�Zee���ee�d��ee�d��ee���ee�d��ee�d��ee
��ee�d�e�d��eeje
d��edd�Zee�d�ejde
d��eje
ded�Ze��eje
de
jd�Ze��eedd���Zejed�ejed�e��dS)"z0.9�NZnormalZroman�boldZitaliccCst|dd�S)zFGiven the name of a tk named font, returns a Font representation.
    T)�name�exists)�Font�r�r�$/usr/lib64/python3.8/tkinter/font.py�
nametofontsr	c@s�eZdZdZe�d�Zdd�Zdd�Zdd�Z	d#dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd$dd�Zdd�Zdd�ZeZd%dd �Zd!d"�Zd	S)&ra�Represents a named font.

    Constructor options are:

    font -- font specifier (name, system font, or (family, size, style)-tuple)
    name -- name to use for this font configuration (defaults to a unique name)
    exists -- does a named font by this name already exist?
       Creates a new named font if False, points to the existing font if True.
       Raises _tkinter.TclError if the assertion is false.

       the following are ignored if font is specified:

    family -- font 'family', e.g. Courier, Times, Helvetica
    size -- font size in points
    weight -- font thickness: NORMAL, BOLD
    slant -- font slant: ROMAN, ITALIC
    underline -- font underlining: false (0), true (1)
    overstrike -- font strikeout: false (0), true (1)

    �cCs:g}|��D]$\}}|�d|�|�t|��qt|�S�N�-)�items�append�str�tuple)�self�kw�options�k�vrrr�_set1s
z	Font._setcCs$g}|D]}|�d|�qt|�Sr)rr)r�argsrrrrr�_get8sz	Font._getcCs:i}tdt|�d�D] }||d|||dd�<q|S)Nr�r
)�range�len)rrr�irrr�_mkdict>szFont._mkdictNFcKs�|st�d�}t|d|�}|r4|�|�dd|��}n
|�|�}|sTdtt|j��}||_	|r�d|_
|j	|�|�dd��kr�tj�d|j	f��|r�|jdd|j	f|��n|jdd	|j	f|��d
|_
||_
|j|_|j|_dS)Nzuse font�tk�font�actualF�namesz$named font %s does not already exist�	configureZcreateT)�tkinter�_get_default_root�getattr�	splitlist�callrr�next�counterr�delete_fontZ_tkinterZTclError�_tk�_split�_call)r�rootrrrrrrrr�__init__Ds,


�z
Font.__init__cCs|jS�Nr�rrrr�__str__cszFont.__str__cCs&t|t�stS|j|jko$|j|jkSr0)�
isinstancer�NotImplementedrr+)r�otherrrr�__eq__fs
zFont.__eq__cCs
|�|�Sr0)�cget)r�keyrrr�__getitem__kszFont.__getitem__cCs|jf||i�dSr0)r")rr8�valuerrr�__setitem__nszFont.__setitem__cCs4z|jr|�dd|j�Wntk
r.YnXdS)Nr�delete)r*r-r�	Exceptionr1rrr�__del__qs
zFont.__del__cCst|jf|���S)z*Return a distinct copy of the current font)rr+r r1rrr�copyxsz	Font.copycCs^d}|rd|f}|r8|d|f}|jdd|jf|��S|�|�|jdd|jf|����SdS)zReturn actual font attributesr�
-displayofrrr N)r-rrr,)r�option�	displayofrrrrr |s�zFont.actualcCs|�dd|jd|�S)zGet font attributer�configr)r-r)rrArrrr7�sz	Font.cgetc	KsB|r"|jdd|jf|�|���n|�|�|�dd|j���SdS)zModify font attributesrrCN)r-rrrr,)rrrrrrC�s��zFont.configcCs2|f}|rd||f}|j�|jdd|jf|���S)zReturn text widthr@r�measure)r+�getintr-r)r�textrBrrrrrD�s
zFont.measurecOs�d}|�dd�}|rd|f}|rL||�|�}|j�|jdd|jf|���S|�|jdd|jf|���}i}tdt|�d�D](}|j�||d	�|||d	d�<q||SdS)
z}Return font metrics.

        For best performance, create a dummy widget
        using this font before calling this method.rrBNr@r�metricsrrr
)	�poprr+rEr-rr,rr)rrrrrB�resrrrrrG�s�&zFont.metrics)NNNF)NN)N)�__name__�
__module__�__qualname__�__doc__�	itertools�countr)rrrr/r2r6r9r;r>r?r r7rCr"rDrGrrrrrs$


	
rcCs6|st�d�}d}|rd|f}|j�|jjd|���S)zGet font families (as a tuple)zuse font.families()rr@r�families)rrP�r#r$rr&r')r.rBrrrrrP�s
rPcCs$|st�d�}|j�|j�dd��S)z'Get names of defined fonts (as a tuple)zuse font.names()rr!rQ)r.rrrr!�s
r!�__main__�times�)�family�size�weightrUrWZhelloZ	linespace)rB)ZCourier�r)rzHello, world)rFrzQuit!)rFZcommandr)rW)NN)N)�__version__rNr#ZNORMALZROMANZBOLDZITALICr	rrPr!rJZTkr.�f�printr rCr7rDrGZLabel�wZpackZButtonZdestroyr?ZfbZmainlooprrrr�<module>sB






tkinter/__pycache__/scrolledtext.cpython-38.opt-1.pyc000064400000004203151153537530016546 0ustar00U

e5d�@sldZdgZddlmZmZmZmZmZmZddl	m
Z
mZmZm
Z
Gdd�de�Zdd�Zedkrhe�d	S)
aA ScrolledText widget feels like a text widget but also has a
vertical scroll bar on its right.  (Later, options may be added to
add a horizontal bar as well, to make the bars disappear
automatically when not needed, to move them to the other side of the
window, etc.)

Configuration options are passed to the Text widget.
A Frame widget is inserted between the master and the text, to hold
the Scrollbar widget.
Most methods calls are inherited from the Text widget; Pack, Grid and
Place methods are redirected to the Frame widget however.
�ScrolledText�)�Frame�Text�	Scrollbar�Pack�Grid�Place)�RIGHT�LEFT�Y�BOTHc@seZdZddd�Zdd�ZdS)rNcKs�t|�|_t|j�|_|jjttd�|�d|jji�t	j
||jf|�|jttdd�|j
|jd<tt	���}tt���tt���Btt���B}|�|�}|D]4}|ddkr�|dkr�|d	kr�t||t|j|��q�dS)
N)�side�fillZyscrollcommandT)r
r�expandZcommandr�_ZconfigZ	configure)r�framerZvbar�packr	r�update�setr�__init__r
rZyview�vars�keysrrr�
difference�setattr�getattr)�selfZmaster�kwZ
text_meths�methods�m�r�,/usr/lib64/python3.8/tkinter/scrolledtext.pyrs
$
zScrolledText.__init__cCs
t|j�S)N)�strr)rrrr �__str__)szScrolledText.__str__)N)�__name__�
__module__�__qualname__rr"rrrr rs
cCsHddlm}tddd�}|�|t�|jttdd�|��|�	�dS)Nr)�ENDZwhite�
)ZbgZheightT)rr
r)
�tkinter.constantsr&r�insert�__doc__rrr
Z	focus_setZmainloop)r&Zstextrrr �example-sr+�__main__N)r*�__all__Ztkinterrrrrrrr(r	r
rrrr+r#rrrr �<module>s
 
tkinter/__pycache__/dialog.cpython-38.opt-2.pyc000064400000002702151153537530015274 0ustar00U

e5d��@srddlTddlmZdZGdd�de�Zdd�Zedkrned	d
ddeeii�Z	ed	d
d
de	j
eii�Ze	��d	S)�)�*)�	_cnfmergeZ	questheadc@s"eZdZdifdd�Zdd�ZdS)�DialogNc
Ks�t||f�}d|_t�|||�|j�|jjd|j|d|d|d|df|d���|_zt�	|�Wnt
k
r~YnXdS)NZ
__dialog__Z	tk_dialog�title�text�bitmap�default�strings)rZ
widgetName�Widget�_setupZtkZgetintZcallZ_w�num�destroyZTclError)�selfZmasterZcnf�kw�r�&/usr/lib64/python3.8/tkinter/dialog.py�__init__
s&���zDialog.__init__cCsdS)Nr)rrrrr
�zDialog.destroy)�__name__�
__module__�__qualname__rr
rrrrr	s
rcCs$tdddtddd��}t|j�dS)Nz
File ModifiedzzFile "Python.h" has been modified since the last time it was saved. Do you want to save it before exiting the application.r)z	Save FilezDiscard ChangeszReturn to Editor)rrrrr	)r�DIALOG_ICON�printr)�drrr�_tests�r�__main__NrZTestZcommandZQuit)
Ztkinterrrr
rrrZButtonZPack�t�quit�qZmainlooprrrr�<module>s$��tkinter/__pycache__/dnd.cpython-38.pyc000064400000026000151153537530013637 0ustar00U

e5d�,�@sXdZddlZdd�ZGdd�d�ZGdd�d�ZGd	d
�d
�Zdd�Zed
krTe�dS)aFDrag-and-drop support for Tkinter.

This is very preliminary.  I currently only support dnd *within* one
application, between different windows (or within the same window).

I am trying to make this as generic as possible -- not dependent on
the use of a particular widget or icon type, etc.  I also hope that
this will work with Pmw.

To enable an object to be dragged, you must create an event binding
for it that starts the drag-and-drop process. Typically, you should
bind <ButtonPress> to a callback function that you write. The function
should call Tkdnd.dnd_start(source, event), where 'source' is the
object to be dragged, and 'event' is the event that invoked the call
(the argument to your callback function).  Even though this is a class
instantiation, the returned instance should not be stored -- it will
be kept alive automatically for the duration of the drag-and-drop.

When a drag-and-drop is already in process for the Tk interpreter, the
call is *ignored*; this normally averts starting multiple simultaneous
dnd processes, e.g. because different button callbacks all
dnd_start().

The object is *not* necessarily a widget -- it can be any
application-specific object that is meaningful to potential
drag-and-drop targets.

Potential drag-and-drop targets are discovered as follows.  Whenever
the mouse moves, and at the start and end of a drag-and-drop move, the
Tk widget directly under the mouse is inspected.  This is the target
widget (not to be confused with the target object, yet to be
determined).  If there is no target widget, there is no dnd target
object.  If there is a target widget, and it has an attribute
dnd_accept, this should be a function (or any callable object).  The
function is called as dnd_accept(source, event), where 'source' is the
object being dragged (the object passed to dnd_start() above), and
'event' is the most recent event object (generally a <Motion> event;
it can also be <ButtonPress> or <ButtonRelease>).  If the dnd_accept()
function returns something other than None, this is the new dnd target
object.  If dnd_accept() returns None, or if the target widget has no
dnd_accept attribute, the target widget's parent is considered as the
target widget, and the search for a target object is repeated from
there.  If necessary, the search is repeated all the way up to the
root widget.  If none of the target widgets can produce a target
object, there is no target object (the target object is None).

The target object thus produced, if any, is called the new target
object.  It is compared with the old target object (or None, if there
was no old target widget).  There are several cases ('source' is the
source object, and 'event' is the most recent event object):

- Both the old and new target objects are None.  Nothing happens.

- The old and new target objects are the same object.  Its method
dnd_motion(source, event) is called.

- The old target object was None, and the new target object is not
None.  The new target object's method dnd_enter(source, event) is
called.

- The new target object is None, and the old target object is not
None.  The old target object's method dnd_leave(source, event) is
called.

- The old and new target objects differ and neither is None.  The old
target object's method dnd_leave(source, event), and then the new
target object's method dnd_enter(source, event) is called.

Once this is done, the new target object replaces the old one, and the
Tk mainloop proceeds.  The return value of the methods mentioned above
is ignored; if they raise an exception, the normal exception handling
mechanisms take over.

The drag-and-drop processes can end in two ways: a final target object
is selected, or no final target object is selected.  When a final
target object is selected, it will always have been notified of the
potential drop by a call to its dnd_enter() method, as described
above, and possibly one or more calls to its dnd_motion() method; its
dnd_leave() method has not been called since the last call to
dnd_enter().  The target is notified of the drop by a call to its
method dnd_commit(source, event).

If no final target object is selected, and there was an old target
object, its dnd_leave(source, event) method is called to complete the
dnd sequence.

Finally, the source object is notified that the drag-and-drop process
is over, by a call to source.dnd_end(target, event), specifying either
the selected target object, or None if no target object was selected.
The source object can use this to implement the commit action; this is
sometimes simpler than to do it in the target's dnd_commit().  The
target's dnd_commit() method could then simply be aliased to
dnd_leave().

At any time during a dnd sequence, the application can cancel the
sequence by calling the cancel() method on the object returned by
dnd_start().  This will call dnd_leave() if a target is currently
active; it will never call dnd_commit().

�NcCst||�}|jr|SdSdS�N)�
DndHandler�root)�source�event�h�r�#/usr/lib64/python3.8/tkinter/dnd.py�	dnd_startls
r
c@sDeZdZdZdd�Zdd�Zdd�Zdd	�Zdd
d�Zdd
d�Z	dS)rNcCs�|jdkrdS|j��}z|jWdStk
rD||_||_YnX||_d|_|j|_}|j|_	}d||f|_
|dp�d|_|�|j
|j
�|�d|j�d|d<dS)N�z<B%d-ButtonRelease-%d>�cursor��<Motion>Zhand2)Znum�widgetZ_root�_DndHandler__dnd�AttributeErrorrr�targetZinitial_button�initial_widget�release_pattern�save_cursor�bind�
on_release�	on_motion)�selfrrrZbuttonrrrr	�__init__zs$

zDndHandler.__init__cCs2|j}d|_|r.z|`Wntk
r,YnXdSr)rrr�rrrrr	�__del__�szDndHandler.__del__c	Cs�|j|j}}|j�||�}|j}d}|rbz
|j}Wntk
rHYnX|||�}|rZqb|j}q&|j}||kr�|r�|�	||�n,|r�d|_|�
||�|r�|�||�||_dSr)�x_root�y_rootrZwinfo_containingr�
dnd_acceptrZmasterr�
dnd_motion�	dnd_leave�	dnd_enter)	rr�x�yZ
target_widgetr�
new_target�attrZ
old_targetrrr	r�s.

zDndHandler.on_motioncCs|�|d�dS)N���finish�rrrrr	r�szDndHandler.on_releasecCs|�|d�dS)Nrr(r*rrr	�cancel�szDndHandler.cancelrc
Cs�|j}|j}|j}|j}zf|`|j�|j�|j�d�|j|d<d|_|_|_|_|r||rp|�	||�n|�
||�W5|�||�XdS)Nrr)rrrr�dnd_endrZunbindrr�
dnd_commitr!)rrZcommitrrrrrrr	r)�s
zDndHandler.finish)N)r)
�__name__�
__module__�__qualname__rrrrrr+r)rrrr	rvs	
rc@sNeZdZdd�Zddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dS)�IconcCs||_d|_|_|_dSr)�name�canvas�label�id)rr2rrr	r�sz
Icon.__init__�
cCs�||jkr |j�|j||�dS|jr.|��|s6dStj||jddd�}|j|||dd�}||_||_||_|�	d|j
�dS)N�Zraised)�textZborderwidthZreliefZnw)ZwindowZanchorz
<ButtonPress>)r3�coordsr5�detach�tkinterZLabelr2Z
create_windowr4r�press)rr3r#r$r4r5rrr	�attach�s 

�zIcon.attachcCsB|j}|sdS|j}|j}d|_|_|_|�|�|��dSr)r3r5r4�deleteZdestroy)rr3r5r4rrr	r:�s
zIcon.detachcCs4t||�r0|j|_|j|_|j�|j�\|_|_	dSr)
r
r#�x_offr$�y_offr3r9r5�x_orig�y_origr*rrr	r<�s
z
Icon.presscCs(|�|j|�\}}|j�|j||�dSr)�wherer3r9r5)rrr#r$rrr	�move�sz	Icon.movecCs|j�|j|j|j�dSr)r3r9r5rArB)rrrr	�putback�szIcon.putbackcCs8|��}|��}|j|}|j|}||j||jfSr)Zwinfo_rootxZwinfo_rootyrrr?r@)rr3rZx_orgZy_orgr#r$rrr	rC�s


z
Icon.wherecCsdSrr)rrrrrr	r,szIcon.dnd_endN)r6r6)r.r/r0rr=r:r<rDrErCr,rrrr	r1�s


r1c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�TestercCs>t�|�|_tj|jddd�|_|jjddd�|j|j_dS)N�d)�widthZheightZbothr')Zfill�expand)r;ZToplevel�topZCanvasr3�packrrrrr	rszTester.__init__cCs|Srr�rrrrrr	rszTester.dnd_acceptcCsp|j��|�|j|�\}}|j�|j�\}}}}||||}	}
|j�||||	||
�|_|�||�dSr)r3�	focus_setrC�bboxr5Zcreate_rectangle�dndidr )rrrr#r$�x1�y1�x2�y2ZdxZdyrrr	r"s
zTester.dnd_enterc	CsF|�|j|�\}}|j�|j�\}}}}|j�|j||||�dSr)rCr3rNrOrD)	rrrr#r$rPrQrRrSrrr	r szTester.dnd_motioncCs"|j��|j�|j�d|_dSr)rJrMr3r>rOrLrrr	r!$s
zTester.dnd_leavecCs2|�||�|�|j|�\}}|�|j||�dSr)r!rCr3r=)rrrr#r$rrr	r-)szTester.dnd_commitN)	r.r/r0rrr"r r!r-rrrr	rFsrFcCs�t��}|�d�tj|jdd���t|�}|j�d�t|�}|j�d�t|�}|j�d�td�}td�}td	�}|�	|j
�|�	|j
�|�	|j
�|��dS)
Nz+1+1ZQuit)Zcommandr8z+1+60z+120+60z+240+60ZICON1ZICON2ZICON3)r;ZTkZgeometryZButton�quitrKrFrJr1r=r3Zmainloop)r�t1�t2Zt3Zi1Zi2Zi3rrr	�test/s 
rW�__main__)�__doc__r;r
rr1rFrWr.rrrr	�<module>sf
Y=#tkinter/__pycache__/__init__.cpython-38.pyc000064400000530121151153537530014635 0ustar00U

e5d͕�@s�dZddlZddlZddlZejZddlTddlZdZeej	�Z
eej�Zej
Z
ejZejZe�d�Ze�dej�Zdd�Zd	d
�Zdd�Zz
ejZWnek
r�YnXd
d�Zz
ejZWnek
r�YnXdydd�ZGdd�deej�ZGdd�d�Zdadadd�Z dzdd�Z!dd�Z"d{dd�Z#da$Gdd�d�Z%Gd d!�d!e%�Z&Gd"d#�d#e%�Z'Gd$d%�d%e%�Z(Gd&d'�d'e%�Z)d|d(d)�Z*e+Z,eZ-d*d+�Z.Gd,d-�d-�Z/Gd.d/�d/�Z0Gd0d1�d1�Z1Gd2d3�d3�Z2Gd4d5�d5�Z3Gd6d7�d7e/e3�Z4d}d8d9�Z5Gd:d;�d;�Z6Gd<d=�d=�Z7Gd>d?�d?�Z8Gd@dA�dAe/�Z9GdBdC�dCe9e6e7e8�Z:GdDdE�dEe9e3�Z;GdFdG�dGe:�Z<GdHdI�dIe:e1e2�Z=GdJdK�dKe:�Z>GdLdM�dMe:e1�Z?GdNdO�dOe:�Z@GdPdQ�dQe:�ZAGdRdS�dSe:e1e2�ZBGdTdU�dUe:�ZCGdVdW�dWe:�ZDGdXdY�dYe:�ZEGdZd[�d[e:�ZFGd\d]�d]e:�ZGGd^d_�d_e:�ZHGd`da�dae:e1e2�ZIGdbdc�dc�ZJGddde�deeD�ZKGdfdg�dg�ZLGdhdi�dieL�ZMGdjdk�dkeL�ZNdldm�ZOdndo�ZPGdpdq�dqe:e1�ZQGdrds�dse:�ZRGdtdu�due:�ZSdvdw�ZTeUdxk�r�eT�dS)~a8Wrapper functions for Tcl/Tk.

Tkinter provides classes which allow the display, positioning and
control of widgets. Toplevel widgets are Tk and Toplevel. Other
widgets are Frame, Label, Entry, Text, Canvas, Button, Radiobutton,
Checkbutton, Scale, Listbox, Scrollbar, OptionMenu, Spinbox
LabelFrame and PanedWindow.

Properties of the widgets are specified with keyword arguments.
Keyword arguments have the same name as the corresponding resource
under Tk.

Widgets are positioned with one of the geometry managers Place, Pack
or Grid. These managers can be called with methods place, pack, grid
available in every Widget.

Actions are bound to events by resources (e.g. keyword argument
command) or with the method bind.

Example (Hello, World):
import tkinter
from tkinter.constants import *
tk = tkinter.Tk()
frame = tkinter.Frame(tk, relief=RIDGE, borderwidth=2)
frame.pack(fill=BOTH,expand=1)
label = tkinter.Label(frame, text="Hello, World")
label.pack(fill=X, expand=1)
button = tkinter.Button(frame,text="Exit",command=tk.destroy)
button.pack(side=BOTTOM)
tk.mainloop()
�N)�*�z([\\{}])z([\s])cCsd�tt|��S)�Internal function.� )�join�map�
_stringify��value�r�(/usr/lib64/python3.8/tkinter/__init__.py�_join8sr
cCs�t|ttf�rHt|�dkr:t|d�}t�|�rFd|}q�dt|�}ntt|�}|sZd}nbt�|�r�t�	d|�}|�
dd�}t�	d|�}|ddkr�d	|}n|ddks�t�|�r�d|}|S)
rrrz{%s}z{}z\\\1�
z\n�"�\)�
isinstance�list�tuple�lenr�	_magic_re�searchr
�str�sub�replace�	_space_rer	rrrr=s$



rcCs@d}|D]2}t|ttf�r(|t|�}q|dk	r||f}q|S)rrN)rrr�_flatten)�seq�res�itemrrrrVsrcCs�t|t�r|St|td�tf�r$|Si}t|�D]^}z|�|�Wq0ttfk
r�}z(td|�|�	�D]\}}|||<qjW5d}~XYq0Xq0|SdS)rNz_cnfmerge: fallback due to:)
r�dict�typerr�update�AttributeError�	TypeError�print�items)Zcnfs�cnf�c�msg�k�vrrr�	_cnfmergees

r+Tc	Csz|�|�}t|�drtd��t|�}i}t||�D]@\}}t|�}|r`|ddkr`|dd�}|rl||�}|||<q4|S)aReturn a properly formatted dict built from Tcl list pairs.

    If cut_minus is True, the supposed '-' prefix will be removed from
    keys. If conv is specified, it is used to convert values.

    Tcl list is expected to contain an even number of elements.
    �zNTcl list representing a dict is expected to contain an even number of elementsr�-rN)�	splitlistr�RuntimeError�iter�zipr)	�tkr*Z	cut_minus�conv�t�itr�keyr
rrr�
_splitdict{s

r7c@s�eZdZdZeZdZdZeZdZdZ	dZ
dZdZd	Z
d
ZdZdZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#d Z$d!Z%d"Z&d#Z'd$Z(d%Z)e*j+Z+d&S)'�	EventType�2�3�4�5�6�7�8�9Z10Z11Z12Z13Z14Z15Z16Z17Z18Z19Z20Z21Z22Z23Z24Z25Z26Z27Z28Z29Z30Z31Z32Z33Z34Z35Z36Z37Z38N),�__name__�
__module__�__qualname__ZKeyPressZKeyZ
KeyReleaseZButtonPress�ButtonZ
ButtonReleaseZMotionZEnterZLeaveZFocusInZFocusOutZKeymapZExposeZGraphicsExposeZNoExposeZ
VisibilityZCreateZDestroyZUnmapZMapZ
MapRequestZReparentZ	ConfigureZConfigureRequestZGravityZ
ResizeRequestZ	CirculateZCirculateRequestZPropertyZSelectionClearZSelectionRequestZ	SelectionZColormapZ
ClientMessage�MappingZVirtualEventZActivateZ
DeactivateZ
MouseWheelr�__str__rrrrr8�sPr8c@seZdZdZdd�ZdS)�Eventa�Container for the properties of an event.

    Instances of this type are generated if one of the following events occurs:

    KeyPress, KeyRelease - for keyboard events
    ButtonPress, ButtonRelease, Motion, Enter, Leave, MouseWheel - for mouse events
    Visibility, Unmap, Map, Expose, FocusIn, FocusOut, Circulate,
    Colormap, Gravity, Reparent, Property, Destroy, Activate,
    Deactivate - for window events.

    If a callback function for one of these events is registered
    using bind, bind_all, bind_class, or tag_bind, the callback is
    called with an Event as first argument. It will have the
    following attributes (in braces are the event types for which
    the attribute is valid):

        serial - serial number of event
    num - mouse button pressed (ButtonPress, ButtonRelease)
    focus - whether the window has the focus (Enter, Leave)
    height - height of the exposed window (Configure, Expose)
    width - width of the exposed window (Configure, Expose)
    keycode - keycode of the pressed key (KeyPress, KeyRelease)
    state - state of the event as a number (ButtonPress, ButtonRelease,
                            Enter, KeyPress, KeyRelease,
                            Leave, Motion)
    state - state as a string (Visibility)
    time - when the event occurred
    x - x-position of the mouse
    y - y-position of the mouse
    x_root - x-position of the mouse on the screen
             (ButtonPress, ButtonRelease, KeyPress, KeyRelease, Motion)
    y_root - y-position of the mouse on the screen
             (ButtonPress, ButtonRelease, KeyPress, KeyRelease, Motion)
    char - pressed character (KeyPress, KeyRelease)
    send_event - see X/Windows documentation
    keysym - keysym of the event as a string (KeyPress, KeyRelease)
    keysym_num - keysym of the event as a number (KeyPress, KeyRelease)
    type - type of the event as a number
    widget - widget in which the event occurred
    delta - delta of wheel movement (MouseWheel)
    csdd�|j��D��|js"�d=n|jdkr:t|j��d<t|dd�sL�d=|jdkr^�d=n|t|jt�r�|j}d	}g}t|�D]\}}|d
|>@r�|�	|�q�|d
t
|�>d
@}|s�|s�|�	t|��d�|��d<|j
dkr�d=d
}dt|jd|j�d��fdd�|D��fS)NcSsi|]\}}|dkr||�qS)�??r��.0r)r*rrr�
<dictcomp>�sz"Event.__repr__.<locals>.<dictcomp>�charrH�
send_eventTr�state)
ZShiftZLockZControlZMod1ZMod2ZMod3ZMod4ZMod5ZButton1ZButton2ZButton3ZButton4ZButton5r�|�delta)rMrN�keysym�keycoderL�numrP�focus�x�y�width�heightz<%s event%s>�name�c3s&|]}|�krd|�|fVqdS)z %s=%sNr)rJr)��attrsrr�	<genexpr>
sz!Event.__repr__.<locals>.<genexpr>)�__dict__r%rL�repr�getattrrNr�int�	enumerate�appendr�hexrrPr )�selfrNZmods�s�i�n�keysrr[r�__repr__�s6


�zEvent.__repr__N)rArBrC�__doc__rjrrrrrG�s*rGcCsdadabdS)z�Inhibit setting of default root window.

    Call this function to inhibit that the first instance of
    Tk is used for windows without an explicit parent window.
    FN)�_support_default_root�
_default_rootrrrr�
NoDefaultRootsrncCs:tstd��ts6|r$td|�d���t�}t|ks6t�tS)NzINo master specified and tkinter is configured to not support default rootz
Too early to z: no default root window)rlr/rm�Tk�AssertionError)�what�rootrrr�_get_default_root#srscCsdS�rNr)�errrrr�_tkerror/srvcCs.zt|�}Wntk
r YnXt|��dS)zBInternal function. Calling it will raise the exception SystemExit.N)ra�
ValueError�
SystemExit)�coderrr�_exit4s
rzc@s�eZdZdZdZdZdZddd�Zdd�Zdd	�Z	d
d�Z
e
Zdd
�Zdd�Z
dd�Zdd�Zdd�Zdd�ZeZdd�Zdd�Zdd�ZdS)�Variablez�Class to define value holders for e.g. buttons.

    Subclasses StringVar, IntVar, DoubleVar, BooleanVar are specializations
    that constrain the type of the value returned from get().rZNcCs�|dk	rt|t�std��|s&td�}|��|_|j|_|rD||_ndtt	�|_t	d7a	|dk	rn|�
|�n&|j�|j�dd|j��s�|�
|j
�dS)a.Construct a variable

        MASTER can be given as master widget.
        VALUE is an optional value (defaults to "")
        NAME is an optional Tcl name (defaults to PY_VARnum).

        If NAME matches an existing variable and VALUE is omitted
        then the existing value is retained.
        Nzname must be a stringzcreate variable�PY_VARr�info�exists)rrr#rs�_rootr2�_tk�_namer_�_varnum�
initialize�
getboolean�call�_default�re�masterr
rYrrr�__init__Is

zVariable.__init__cCsb|jdkrdS|j�|j�dd|j��r6|j�|j�|jdk	r^|jD]}|j�|�qFd|_dS)zUnset the variable in Tcl.Nr}r~)r�r�r�r�Zglobalunsetvar�_tclCommands�
deletecommand�rerYrrr�__del__gs


zVariable.__del__cCs|jS)z'Return the name of the variable in Tcl.)r��rerrrrFsszVariable.__str__cCs|j�|j|�S�zSet the variable to VALUE.)r��globalsetvarr��rer
rrr�setwszVariable.setcCs|j�|j�S)zReturn value of variable.)r��globalgetvarr�r�rrr�get}szVariable.getcCs�t|d|j�j}tt|��}z
|j}Wntk
r:YnXz||j}Wntk
r^YnX|j�	||�|j
dkr~g|_
|j
�|�|S�N)�CallWrapperr�__call__r_�id�__func__r"rAr��
createcommandr�rc)re�callback�f�cbnamerrr�	_register�s

zVariable._registercCs(|�|�}|j�ddd|j||f�|S)a#Define a trace callback for the variable.

        Mode is one of "read", "write", "unset", or a list or tuple of
        such strings.
        Callback must be a function which is called when the variable is
        read, written or unset.

        Return the name of the callback.
        �trace�add�variable�r�r�r�r��re�moder�r�rrr�	trace_add�s

�zVariable.trace_addcCsx|j�ddd|j||�|��D] \}}|j�|�d|kr qtq |j�|�z|j�|�Wntk
rrYnXdS)aDelete the trace callback for a variable.

        Mode is one of "read", "write", "unset" or a list or tuple of
        such strings.  Must be same as were specified in trace_add().
        cbname is the name of the callback returned from trace_add().
        r��remover�rN)	r�r�r��
trace_infor.r�r�r�rw�rer�r��mZcarrr�trace_remove�s�zVariable.trace_removec
s4|jj��fdd�t��|j�ddd|j���D�S)z&Return all trace callback information.csg|]\}}�|�|f�qSrrrI�r.rr�
<listcomp>�sz'Variable.trace_info.<locals>.<listcomp>r�r}r�)r�r.rr�r�r�rr�rr��s�zVariable.trace_infocCs$|�|�}|j�dd|j||�|S)a�Define a trace callback for the variable.

        MODE is one of "r", "w", "u" for read, write, undefine.
        CALLBACK must be a function which is called when
        the variable is read, written or undefined.

        Return the name of the callback.

        This deprecated method wraps a deprecated Tcl method that will
        likely be removed in the future.  Use trace_add() instead.
        r�r�r�r�rrr�trace_variable�s
zVariable.trace_variablecCs�|j�dd|j||�|j�|�d}|��D] \}}|j�|�d|kr.q�q.|j�|�z|j�|�Wntk
r�YnXdS)aSDelete the trace callback for a variable.

        MODE is one of "r", "w", "u" for read, write, undefine.
        CBNAME is the name of the callback returned from trace_variable or trace.

        This deprecated method wraps a deprecated Tcl method that will
        likely be removed in the future.  Use trace_remove() instead.
        r�ZvdeleterN)	r�r�r�r.r�r�r�r�rwr�rrr�
trace_vdelete�s
zVariable.trace_vdeletecs(�fdd��j��j�dd�j��D�S)z�Return all trace callback information.

        This deprecated method wraps a deprecated Tcl method that will
        likely be removed in the future.  Use trace_info() instead.
        csg|]}�j�|��qSr)r�r.�rJrUr�rrr��sz(Variable.trace_vinfo.<locals>.<listcomp>r�Zvinfo)r�r.r�r�r�rr�r�trace_vinfo�s�zVariable.trace_vinfocCs6t|t�stS|j|jko4|jj|jjko4|j|jkSr�)rr{�NotImplementedr��	__class__rAr�)re�otherrrr�__eq__�s
�
�zVariable.__eq__)NNN)rArBrCrkr�r�r�r�r�rFr�r�r�r�r�r�r�r�r�r�r�r�rrrrr{@s&

r{c@s&eZdZdZdZddd�Zdd�ZdS)	�	StringVarz#Value holder for strings variables.rZNcCst�||||�dS)a6Construct a string variable.

        MASTER can be given as master widget.
        VALUE is an optional value (defaults to "")
        NAME is an optional Tcl name (defaults to PY_VARnum).

        If NAME matches an existing variable and VALUE is omitted
        then the existing value is retained.
        N�r{r�r�rrrr��s
zStringVar.__init__cCs$|j�|j�}t|t�r|St|�S)z#Return value of variable as string.)r�r�r�rrr�rrrr�s
z
StringVar.get)NNN�rArBrCrkr�r�r�rrrrr��s
r�c@s&eZdZdZdZddd�Zdd�ZdS)	�IntVarz#Value holder for integer variables.rNcCst�||||�dS)a7Construct an integer variable.

        MASTER can be given as master widget.
        VALUE is an optional value (defaults to 0)
        NAME is an optional Tcl name (defaults to PY_VARnum).

        If NAME matches an existing variable and VALUE is omitted
        then the existing value is retained.
        Nr�r�rrrr�s
zIntVar.__init__c	CsJ|j�|j�}z|j�|�WSttfk
rDt|j�|��YSXdS)z/Return the value of the variable as an integer.N)r�r�r��getintr#�TclErrorra�	getdoubler�rrrr�s
z
IntVar.get)NNNr�rrrrr�
s
r�c@s&eZdZdZdZddd�Zdd�ZdS)	�	DoubleVarz!Value holder for float variables.gNcCst�||||�dS)a6Construct a float variable.

        MASTER can be given as master widget.
        VALUE is an optional value (defaults to 0.0)
        NAME is an optional Tcl name (defaults to PY_VARnum).

        If NAME matches an existing variable and VALUE is omitted
        then the existing value is retained.
        Nr�r�rrrr�*s
zDoubleVar.__init__cCs|j�|j�|j��S)z,Return the value of the variable as a float.)r�r�r�r�r�rrrr�6sz
DoubleVar.get)NNNr�rrrrr�&s
r�c@s2eZdZdZdZd
dd�Zdd�ZeZdd	�ZdS)�
BooleanVarz#Value holder for boolean variables.FNcCst�||||�dS)a:Construct a boolean variable.

        MASTER can be given as master widget.
        VALUE is an optional value (defaults to False)
        NAME is an optional Tcl name (defaults to PY_VARnum).

        If NAME matches an existing variable and VALUE is omitted
        then the existing value is retained.
        Nr�r�rrrr�?s
zBooleanVar.__init__cCs|j�|j|j�|��Sr�)r�r�r�r�r�rrrr�KszBooleanVar.setcCs:z|j�|j�|j��WStk
r4td��YnXdS)z+Return the value of the variable as a bool.� invalid literal for getboolean()N)r�r�r�r�r�rwr�rrrr�QszBooleanVar.get)NNN)	rArBrCrkr�r�r�r�r�rrrrr�;s
r�cCstd�j�|�dS)zRun the main loop of Tcl.zrun the main loopN)rsr2�mainloop)rhrrrr�Ysr�cCs4ztd�j�|�WStk
r.td��YnXdS)z$Convert Tcl object to True or False.zuse getboolean()r�N)rsr2r�r�rw�rfrrrr�csr�c@s�eZdZdZdZdZdd�Zdd�Z�d1dd�Zd	d
�Z	dd�Z
�d2dd�ZeZ�d3dd�Z
�d4dd�Z�d5dd�Z�d6dd�Zdd�Zdd�Zdd�Zdd �ZeZd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Z�d7d/d0�Zd1d2�Zd3d4�Z�d8d6d7�Z d8d9�Z!d:d;�Z"d<d=�Z#d>d?�Z$d@dA�Z%dBdC�Z&dDdE�Z'dFdG�Z(�d9dHdI�Z)dJdK�Z*dLdM�Z+�d:dNdO�Z,dPdQ�Z-dRdS�Z.dTdU�Z/dVdW�Z0dXdY�Z1dZd[�Z2�d;d\d]�Z3�d<d^d_�Z4e4Z5�d=d`da�Z6�d>dbdc�Z7ddde�Z8dfdg�Z9dhdi�Z:djdk�Z;�d?dldm�Z<dndo�Z=dpdq�Z>drds�Z?dtdu�Z@dvdw�ZAdxdy�ZB�d@dzd{�ZCd|d}�ZDd~d�ZEd�d��ZFd�d��ZG�dAd�d��ZHd�d��ZId�d��ZJd�d��ZKd�d��ZLd�d��ZMd�d��ZNd�d��ZOd�d��ZPd�d��ZQd�d��ZRd�d��ZSd�d��ZTd�d��ZUd�d��ZVd�d��ZWd�d��ZXd�d��ZYd�d��ZZd�d��Z[d�d��Z\d�d��Z]d�d��Z^�dBd�d��Z_d�d��Z`d�d��Zad�d��Zbd�d��Zcd�d��Zdd�d��Zed�d„Zfd�dĄZgd�dƄZhd�dȄZid�dʄZj�dCd�d̄Zk�dDd�dτZl�dEd�dфZm�dFd�dӄZn�dGd�dՄZod�dׄZp�dHd�dلZqd�dۄZr�dId�d݄Zsd�d߄Ztd�d�Zud�d�Zvd�d�Zwd�d�Zxeyd�d��Zz�dJd�d�Z{d�d�Z|e|Z}�dKd�d�Z~e~Zd�d�Z�d�Z�d�e��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z�d�d��Z��dLd�d��Z�e�Z��d�d�Z�e�Z��d�d�Z��d�d�Z��d�d�Z��d�d	�Z��d
gZ�e�f�d�d�Z�e�Z��d
�d�Z�e�Z��d�d�Z��dM�d�d�Z�e�Z��dN�d�d�Z�e�Z��d�d�Z��d�d�Z�if�d�d�Z�e�Z��d�d�Z�e�f�d�d�Z�if�d�d �Z�e�Z��d!�d"�Z�e�Z��dO�d#�d$�Z��d%�d&�Z��d'�d(�Z��d)�d*�Z��dP�d+�d,�Z��d-�d.�Z��d/�d0�Z�dS(Q�MisczRInternal class.

    Base class which defines methods common for interior widgets.NcCs,|jdk	r(|jD]}|j�|�qd|_dS)zkInternal function.

        Delete all Tcl commands created for
        this widget in the Tcl interpreter.N)r�r2r�r�rrr�destroyxs

zMisc.destroycCs6|j�|�z|j�|�Wntk
r0YnXdS)zDInternal function.

        Delete the Tcl command provided in NAME.N)r2r�r�r�rwr�rrrr��s
zMisc.deletecommandcCs|j�|j�dd|��S)z�Set Tcl internal variable, whether the look and feel
        should adhere to Motif.

        A parameter of 1 means adhere to Motif (e.g. no color
        change if mouse passes over slider).
        Returns the set value.r��tk_strictMotif)r2r�r��re�booleanrrrr��s
�zMisc.tk_strictMotifcCs|j�d�dS)zDChange the color scheme to light brown as used in Tk 3.6 and before.�	tk_bisqueN�r2r�r�rrrr��szMisc.tk_bisquecOs(|j�dt|�tt|�����dS)aSet a new color scheme for all widget elements.

        A single color as argument will cause that all colors of Tk
        widget elements are derived from this.
        Alternatively several keyword parameters and its associated
        colors can be given. The following keywords are valid:
        activeBackground, foreground, selectColor,
        activeForeground, highlightBackground, selectBackground,
        background, highlightColor, selectForeground,
        disabledForeground, insertBackground, troughColor.)�
tk_setPaletteN)r2r�rrr%�re�args�kwrrrr��s
��zMisc.tk_setPaletter|cCs|j�dd|�dS)z�Wait until the variable is modified.

        A parameter of type IntVar, StringVar, DoubleVar or
        BooleanVar must be given.�tkwaitr�Nr�r�rrr�
wait_variable�szMisc.wait_variablecCs"|dkr|}|j�dd|j�dS)zQWait until a WIDGET is destroyed.

        If no parameter is given self is used.Nr��window�r2r��_w�rer�rrr�wait_window�szMisc.wait_windowcCs"|dkr|}|j�dd|j�dS)zxWait until the visibility of a WIDGET changes
        (e.g. it appears).

        If no parameter is given self is used.Nr�Z
visibilityr�r�rrr�wait_visibility�szMisc.wait_visibility�1cCs|j�||�dS)zSet Tcl variable NAME to VALUE.N)r2�setvar)rerYr
rrrr��szMisc.setvarcCs|j�|�S)z"Return value of Tcl variable NAME.)r2�getvarr�rrrr��szMisc.getvarc
CsBz|j�|�WStk
r<}ztt|���W5d}~XYnXdSr�)r2r�r�rwr�rerf�excrrrr��szMisc.getintc
CsBz|j�|�WStk
r<}ztt|���W5d}~XYnXdSr�)r2r�r�rwrr�rrrr��szMisc.getdoublecCs0z|j�|�WStk
r*td��YnXdS)zPReturn a boolean value for Tcl boolean values true and false given as parameter.r�N)r2r�r�rw)rerfrrrr��szMisc.getbooleancCs|j�d|j�dS)z�Direct input focus to this widget.

        If the application currently does not have the focus
        this widget will get the focus if the application gets
        the focus through the window manager.rTNr�r�rrr�	focus_set�szMisc.focus_setcCs|j�dd|j�dS)ztDirect input focus to this widget even if the
        application does not have the focus. Use with
        caution!rTz-forceNr�r�rrr�focus_force�szMisc.focus_forcecCs&|j�d�}|dks|sdS|�|�S)z�Return the widget which has currently the focus in the
        application.

        Use focus_displayof to allow working with several
        displays. Return None if application does not have
        the focus.rT�noneN)r2r��
_nametowidgetr�rrr�	focus_get�szMisc.focus_getcCs,|j�dd|j�}|dks|s"dS|�|�S)z�Return the widget which has currently the focus on the
        display where this widget is located.

        Return None if the application does not have the focus.rT�
-displayofr�N�r2r�r�r�r�rrr�focus_displayof�szMisc.focus_displayofcCs,|j�dd|j�}|dks|s"dS|�|�S)zyReturn the widget which would have the focus if top level
        for this widget gets the focus from the window manager.rTz-lastforr�Nr�r�rrr�
focus_lastforszMisc.focus_lastforcCs|j�d�dS)zXThe widget under mouse will get automatically focus. Can not
        be disabled easily.�tk_focusFollowsMouseNr�r�rrrr�szMisc.tk_focusFollowsMousecCs"|j�d|j�}|sdS|�|�S)anReturn the next widget in the focus order which follows
        widget which has currently the focus.

        The focus order first goes to the next child, then to
        the children of the child recursively and then to the
        next sibling which is higher in the stacking order.  A
        widget is omitted if it has the takefocus resource set
        to 0.�tk_focusNextNr�r�rrrr�
s	zMisc.tk_focusNextcCs"|j�d|j�}|sdS|�|�S)zHReturn previous widget in the focus order. See tk_focusNext for details.�tk_focusPrevNr�r�rrrr�szMisc.tk_focusPrevcsN�s�j�d|�dS����fdd�}�j|_��|���j�d|��SdS)aCall function once after given time.

        MS specifies the time in milliseconds. FUNC gives the
        function which shall be called. Additional parameters
        are given as parameters to the function call.  Return
        identifier to cancel scheduling with after_cancel.�afterNcs8z���W5z����Wntk
r0YnXXdSr�)r�r�r�r��funcrYrerr�callit,szMisc.after.<locals>.callit)r2r�rAr�)reZmsr�r�r�rr�rr� s
z
Misc.aftercGs|jd|f|��S)z�Call FUNC once if the Tcl main loop has no event to
        process.

        Return an identifier to cancel the scheduling with
        after_cancel.Zidle)r�)rer�r�rrr�
after_idle8szMisc.after_idlecCsd|std��z.|j�dd|�}|j�|�d}|�|�Wntk
rNYnX|j�dd|�dS)z�Cancel scheduling of function identified with ID.

        Identifier returned by after or after_idle must be
        given as first parameter.
        z?id must be a valid identifier returned from after or after_idler�r}rZcancelN)rwr2r�r.r�r�)rer��dataZscriptrrr�after_cancel@szMisc.after_cancelrcCs|j�d|�|��dS)zRing a display's bell.)�bellN)r2r��
_displayof�re�	displayofrrrr�Qsz	Misc.bellcKsdd|krN|jdkrNz d|d<|j�d|�|��WStk
rL|d=YnX|j�d|�|��S)a�Retrieve data from the clipboard on window's display.

        The window keyword defaults to the root window of the Tkinter
        application.

        The type keyword specifies the form in which the data is
        to be returned and should be an atom name such as STRING
        or FILE_NAME.  Type defaults to STRING, except on X11, where the default
        is to try UTF8_STRING and fall back to STRING.

        This command is equivalent to:

        selection_get(CLIPBOARD)
        r �x11�UTF8_STRING)�	clipboardr�)�_windowingsystemr2r��_optionsr��rer�rrr�
clipboard_getVszMisc.clipboard_getcKs,d|kr|j|d<|j�d|�|��dS)z�Clear the data in the Tk clipboard.

        A widget specified for the optional displayof keyword
        argument specifies the target display.r�)r��clearN�r�r2r�r�r�rrr�clipboard_clearms
zMisc.clipboard_clearcKs4d|kr|j|d<|j�d|�|�d|f�dS)z�Append STRING to the Tk clipboard.

        A widget specified at the optional displayof keyword
        argument specifies the target display. The clipboard
        can be retrieved with selection_get.r�)r�rc�--Nr�)re�stringr�rrr�clipboard_appendus

�zMisc.clipboard_appendcCs$|j�dd|j�}|sdS|�|�S)zOReturn widget which has currently the grab in this application
        or None.�grabZcurrentNr�r�rrr�grab_current�szMisc.grab_currentcCs|j�dd|j�dS)z.Release grab for this widget if currently set.r��releaseNr�r�rrr�grab_release�szMisc.grab_releasecCs|j�dd|j�dS)zwSet grab for this widget.

        A grab directs all events to this and descendant
        widgets in the application.r�r�Nr�r�rrr�grab_set�sz
Misc.grab_setcCs|j�ddd|j�dS)z�Set global grab for this widget.

        A global grab directs all events to this and
        descendant widgets on the display. Use with caution -
        other applications do not get events anymore.r�r�z-globalNr�r�rrr�grab_set_global�szMisc.grab_set_globalcCs"|j�dd|j�}|dkrd}|S)zYReturn None, "local" or "global" if this widget has
        no, a local or a global grab.r��statusr�Nr�)rerrrr�grab_status�szMisc.grab_statuscCs|j�dd|||�dS)z�Set a VALUE (second parameter) for an option
        PATTERN (first parameter).

        An optional third parameter gives the numeric priority
        (defaults to 80).�optionr�Nr�)re�patternr
�priorityrrr�
option_add�szMisc.option_addcCs|j�dd�dS)zPClear the option database.

        It will be reloaded if option_add is called.rr�Nr�r�rrr�option_clear�szMisc.option_clearcCs|j�dd|j||�S)z�Return the value for an option NAME for this widget
        with CLASSNAME.

        Values with higher priority override lower values.rr�r�)rerY�	classNamerrr�
option_get�szMisc.option_getcCs|j�dd||�dS)zvRead file FILENAME into the option database.

        An optional second parameter gives the numeric
        priority.rZreadfileNr�)reZfileNamerrrr�option_readfile�szMisc.option_readfilecKs,d|kr|j|d<|j�d|�|��dS)zClear the current X selection.r�)�	selectionr�Nr�r�rrr�selection_clear�s
zMisc.selection_clearcKsvd|kr|j|d<d|kr`|jdkr`z d|d<|j�d|�|��WStk
r^|d=YnX|j�d|�|��S)a�Return the contents of the current X selection.

        A keyword parameter selection specifies the name of
        the selection and defaults to PRIMARY.  A keyword
        parameter displayof specifies a widget on the display
        to use. A keyword parameter type specifies the form of data to be
        fetched, defaulting to STRING except on X11, where UTF8_STRING is tried
        before STRING.r�r r�r�)r
r�)r�r�r2r�r�r�r�rrr�
selection_get�s	
zMisc.selection_getcKs.|�|�}|j�d|�|�|j|f�dS)aSpecify a function COMMAND to call if the X
        selection owned by this widget is queried by another
        application.

        This function must return the contents of the
        selection. The function will be called with the
        arguments OFFSET and LENGTH which allows the chunking
        of very long selections. The following keyword
        parameters can be provided:
        selection - name of the selection (default PRIMARY),
        type - type of the selection (e.g. STRING, FILE_NAME).)r
ZhandleN)r�r2r�r�r�)re�commandr�rYrrr�selection_handle�s
�zMisc.selection_handlecKs"|j�d|�|�|jf�dS)z�Become owner of X selection.

        A keyword parameter selection specifies the name of
        the selection (default PRIMARY).�r
ZownN)r2r�r�r�r�rrr�
selection_own�s
��zMisc.selection_owncKs:d|kr|j|d<|j�d|�|��}|s0dS|�|�S)z�Return owner of X selection.

        The following keyword parameter can
        be provided:
        selection - name of the selection (default PRIMARY),
        type - type of the selection (e.g. STRING, FILE_NAME).r�rN)r�r2r�r�r�)rer�rYrrr�selection_own_get�s
zMisc.selection_own_getcGs|j�d||f|�S)zDSend Tcl command CMD to different interpreter INTERP to be executed.�sendr�)reZinterp�cmdr�rrrr�sz	Misc.sendcCs|j�d|j|�dS)z(Lower this widget in the stacking order.�lowerNr�)re�	belowThisrrrr�sz
Misc.lowercCs|j�d|j|�dS)z(Raise this widget in the stacking order.�raiseNr�)re�	aboveThisrrr�tkraiseszMisc.tkraisecCs(d|�|�|f}|j�|j�|��S)z*Return integer which represents atom NAME.)�winfoZatom)r�r2r�r�)rerYr�r�rrr�
winfo_atomszMisc.winfo_atomcCs d|�|�|f}|j�|�S)z'Return name of atom with identifier ID.)rZatomname�r�r2r��rer�r�r�rrr�winfo_atomnames��zMisc.winfo_atomnamecCs|j�|j�dd|j��S)z7Return number of cells in the colormap for this widget.rZcells�r2r�r�r�r�rrr�winfo_cellss�zMisc.winfo_cellsc	CsRg}|j�|j�dd|j��D].}z|�|�|��Wqtk
rJYqXq|S)z?Return a list of all widgets which are children of this widget.r�children)r2r.r�r�rcr��KeyError)re�result�childrrr�winfo_childrens�zMisc.winfo_childrencCs|j�dd|j�S)z(Return window class name of this widget.r�classr�r�rrr�winfo_class#szMisc.winfo_classcCs|j�|j�dd|j��S)z?Return True if at the last color request the colormap was full.rZcolormapfull�r2r�r�r�r�rrr�winfo_colormapfull's�zMisc.winfo_colormapfullcCs4d|�|�||f}|j�|�}|s*dS|�|�S)z@Return the widget which is at the root coordinates ROOTX, ROOTY.)rZ
containingN)r�r2r�r�)reZrootXZrootYr�r�rYrrr�winfo_containing,s��zMisc.winfo_containingcCs|j�|j�dd|j��S)z$Return the number of bits per pixel.rZdepthr!r�rrr�winfo_depth4szMisc.winfo_depthcCs|j�|j�dd|j��S)z"Return true if this widget exists.rr~r!r�rrr�winfo_exists8s�zMisc.winfo_existscCs|j�|j�dd|j|��S)zWReturn the number of pixels for the given distance NUMBER
        (e.g. "3c") as float.rZfpixels�r2r�r�r��re�numberrrr�
winfo_fpixels=s�zMisc.winfo_fpixelscCs|j�dd|j�S)zFReturn geometry string for this widget in the form "widthxheight+X+Y".r�geometryr�r�rrr�winfo_geometryCszMisc.winfo_geometrycCs|j�|j�dd|j��S)zReturn height of this widget.rrXr!r�rrr�winfo_heightGs�zMisc.winfo_heightcCst|j�dd|j�d�S)z%Return identifier ID for this widget.rr�r)rar2r�r�r�rrr�winfo_idLsz
Misc.winfo_idcCs"d|�|�}|j�|j�|��S)z9Return the name of all Tcl interpreters for this display.)rZinterps)r�r2r.r�)rer�r�rrr�
winfo_interpsPszMisc.winfo_interpscCs|j�|j�dd|j��S)z%Return true if this widget is mapped.rZismappedr!r�rrr�winfo_ismappedUs�zMisc.winfo_ismappedcCs|j�dd|j�S)z/Return the window manager name for this widget.rZmanagerr�r�rrr�
winfo_managerZszMisc.winfo_managercCs|j�dd|j�S)zReturn the name of this widget.rrYr�r�rrr�
winfo_name^szMisc.winfo_namecCs|j�dd|j�S)z-Return the name of the parent of this widget.r�parentr�r�rrr�winfo_parentbszMisc.winfo_parentcCs d|�|�|f}|j�|�S)z.Return the pathname of the widget given by ID.)r�pathnamerrrrr�winfo_pathnamefs��zMisc.winfo_pathnamecCs|j�|j�dd|j|��S)z'Rounded integer value of winfo_fpixels.rZpixelsr!r0rrr�winfo_pixelsls�zMisc.winfo_pixelscCs|j�|j�dd|j��S)z:Return the x coordinate of the pointer on the root window.rZpointerxr!r�rrr�winfo_pointerxqs�zMisc.winfo_pointerxcCs|�|j�dd|j��S)zHReturn a tuple of x and y coordinates of the pointer on the root window.rZ	pointerxy��_getintsr2r�r�r�rrr�winfo_pointerxyvs�zMisc.winfo_pointerxycCs|j�|j�dd|j��S)z:Return the y coordinate of the pointer on the root window.rZpointeryr!r�rrr�winfo_pointery{s�zMisc.winfo_pointerycCs|j�|j�dd|j��S)z'Return requested height of this widget.rZ	reqheightr!r�rrr�winfo_reqheight�s�zMisc.winfo_reqheightcCs|j�|j�dd|j��S)z&Return requested width of this widget.rZreqwidthr!r�rrr�winfo_reqwidth�s�zMisc.winfo_reqwidthcCs|�|j�dd|j|��S)zNReturn a tuple of integer RGB values in range(65536) for color in this widget.rZrgbrA)reZcolorrrr�	winfo_rgb�s�zMisc.winfo_rgbcCs|j�|j�dd|j��S)zSReturn x coordinate of upper left corner of this widget on the
        root window.rZrootxr!r�rrr�winfo_rootx�s�zMisc.winfo_rootxcCs|j�|j�dd|j��S)zSReturn y coordinate of upper left corner of this widget on the
        root window.rZrootyr!r�rrr�winfo_rooty�s�zMisc.winfo_rootycCs|j�dd|j�S)z&Return the screen name of this widget.r�screenr�r�rrr�winfo_screen�szMisc.winfo_screencCs|j�|j�dd|j��S)zTReturn the number of the cells in the colormap of the screen
        of this widget.rZscreencellsr!r�rrr�winfo_screencells�s�zMisc.winfo_screencellscCs|j�|j�dd|j��S)z\Return the number of bits per pixel of the root window of the
        screen of this widget.rZscreendepthr!r�rrr�winfo_screendepth�s�zMisc.winfo_screendepthcCs|j�|j�dd|j��S)zXReturn the number of pixels of the height of the screen of this widget
        in pixel.rZscreenheightr!r�rrr�winfo_screenheight�s�zMisc.winfo_screenheightcCs|j�|j�dd|j��S)zUReturn the number of pixels of the height of the screen of
        this widget in mm.rZscreenmmheightr!r�rrr�winfo_screenmmheight�s�zMisc.winfo_screenmmheightcCs|j�|j�dd|j��S)zTReturn the number of pixels of the width of the screen of
        this widget in mm.rZ
screenmmwidthr!r�rrr�winfo_screenmmwidth�s�zMisc.winfo_screenmmwidthcCs|j�dd|j�S)z�Return one of the strings directcolor, grayscale, pseudocolor,
        staticcolor, staticgray, or truecolor for the default
        colormodel of this screen.rZscreenvisualr�r�rrr�winfo_screenvisual�szMisc.winfo_screenvisualcCs|j�|j�dd|j��S)zWReturn the number of pixels of the width of the screen of
        this widget in pixel.rZscreenwidthr!r�rrr�winfo_screenwidth�s�zMisc.winfo_screenwidthcCs|j�dd|j�S)zxReturn information of the X-Server of the screen of this widget in
        the form "XmajorRminor vendor vendorVersion".rZserverr�r�rrr�winfo_server�szMisc.winfo_servercCs|�|j�dd|j��S)z*Return the toplevel widget of this widget.r�toplevel)r�r2r�r�r�rrr�winfo_toplevel�s

�zMisc.winfo_toplevelcCs|j�|j�dd|j��S)zBReturn true if the widget and all its higher ancestors are mapped.rZviewabler!r�rrr�winfo_viewable�s�zMisc.winfo_viewablecCs|j�dd|j�S)z�Return one of the strings directcolor, grayscale, pseudocolor,
        staticcolor, staticgray, or truecolor for the
        colormodel of this widget.r�visualr�r�rrr�winfo_visual�szMisc.winfo_visualcCs|j�dd|j�S)z7Return the X identifier for the visual for this widget.rZvisualidr�r�rrr�winfo_visualid�szMisc.winfo_visualidFcsH�j�dd�j|rdnd�}�fdd��j�|�D�}�fdd�|D�S)z�Return a list of all visuals available for the screen
        of this widget.

        Each item in the list consists of a visual name (see winfo_visual), a
        depth and if includeids is true is given also the X identifier.rZvisualsavailable�
includeidsNcsg|]}�j�|��qSr)r2r.r�r�rrr��sz/Misc.winfo_visualsavailable.<locals>.<listcomp>csg|]}��|��qSr)�_Misc__winfo_parseitemr�r�rrr��s)r2r�r�r.)rerZr�rr�r�winfo_visualsavailable�s

�zMisc.winfo_visualsavailablecCs$|dd�tt|j|dd���S)rNr)rr�_Misc__winfo_getint)rer4rrrZ__winfo_parseitem�szMisc.__winfo_parseitemcCs
t|d�S)rr)ra�rerUrrrZ__winfo_getint�szMisc.__winfo_getintcCs|j�|j�dd|j��S)z�Return the height of the virtual root window associated with this
        widget in pixels. If there is no virtual root window return the
        height of the screen.rZvrootheightr!r�rrr�winfo_vrootheight�s�zMisc.winfo_vrootheightcCs|j�|j�dd|j��S)z�Return the width of the virtual root window associated with this
        widget in pixel. If there is no virtual root window return the
        width of the screen.rZ
vrootwidthr!r�rrr�winfo_vrootwidth�s�zMisc.winfo_vrootwidthcCs|j�|j�dd|j��S)ziReturn the x offset of the virtual root relative to the root
        window of the screen of this widget.rZvrootxr!r�rrr�winfo_vrootxs�zMisc.winfo_vrootxcCs|j�|j�dd|j��S)ziReturn the y offset of the virtual root relative to the root
        window of the screen of this widget.rZvrootyr!r�rrr�winfo_vrooty	s�zMisc.winfo_vrootycCs|j�|j�dd|j��S)z Return the width of this widget.rrWr!r�rrr�winfo_widths�zMisc.winfo_widthcCs|j�|j�dd|j��S)zVReturn the x coordinate of the upper left corner of this widget
        in the parent.rrUr!r�rrr�winfo_xs�zMisc.winfo_xcCs|j�|j�dd|j��S)zVReturn the y coordinate of the upper left corner of this widget
        in the parent.rrVr!r�rrr�winfo_ys�zMisc.winfo_ycCs|j�d�dS)zEEnter event loop until all pending events have been processed by Tcl.r!Nr�r�rrrr! szMisc.updatecCs|j�dd�dS)z�Enter event loop until all idle callbacks have been called. This
        will update the display of windows but not process events caused by
        the user.r!Z	idletasksNr�r�rrr�update_idletasks$szMisc.update_idletaskscCs6|dkr |j�|j�d|j��S|j�d|j|�dS)a,Set or get the list of bindtags for this widget.

        With no argument return the list of all bindtags associated with
        this widget. With a list of strings as argument the bindtags are
        set to this list. The bindtags determine in which order events are
        processed (see bind).N�bindtags�r2r.r�r�)reZtagListrrrrg*s
�z
Misc.bindtagsrcCs�t|t�r |j�|||f�nn|rd|�||j|�}d|r>dp@d||jf}|j�|||f�|S|rz|j�||f�S|j�|j�|��SdS)rz"%sif {"[%s %s]" == "break"} break
�+rZN)rrr2r�r��_substitute�_subst_format_strr.)rerq�sequencer�r��needcleanup�funcidrrrr�_bind7s"

�
��z
Misc._bindcCs|�d|jf|||�S)aOBind to this widget at event SEQUENCE a call to function FUNC.

        SEQUENCE is a string of concatenated event
        patterns. An event pattern is of the form
        <MODIFIER-MODIFIER-TYPE-DETAIL> where MODIFIER is one
        of Control, Mod2, M2, Shift, Mod3, M3, Lock, Mod4, M4,
        Button1, B1, Mod5, M5 Button2, B2, Meta, M, Button3,
        B3, Alt, Button4, B4, Double, Button5, B5 Triple,
        Mod1, M1. TYPE is one of Activate, Enter, Map,
        ButtonPress, Button, Expose, Motion, ButtonRelease
        FocusIn, MouseWheel, Circulate, FocusOut, Property,
        Colormap, Gravity Reparent, Configure, KeyPress, Key,
        Unmap, Deactivate, KeyRelease Visibility, Destroy,
        Leave and DETAIL is the button number for ButtonPress,
        ButtonRelease and DETAIL is the Keysym for KeyPress and
        KeyRelease. Examples are
        <Control-Button-1> for pressing Control and mouse button 1 or
        <Alt-A> for pressing A and the Alt key (KeyPress can be omitted).
        An event pattern can also be a virtual event of the form
        <<AString>> where AString can be arbitrary. This
        event can be generated by event_generate.
        If events are concatenated they must appear shortly
        after each other.

        FUNC will be called if the event sequence occurs with an
        instance of Event as argument. If the return value of FUNC is
        "break" no further bound function is invoked.

        An additional boolean parameter ADD specifies whether FUNC will
        be called additionally to the other bound function or whether
        it will replace the previous function.

        Bind will return an identifier to allow deletion of the bound function with
        unbind without memory leak.

        If FUNC or SEQUENCE is omitted the bound function or list
        of bound events are returned.�bind�ror��rerlr�r�rrrrpIs'z	Misc.bindcCs&|j�d|j|d�|r"|�|�dS)zWUnbind for this widget for event SEQUENCE  the
        function identified with FUNCID.rprZN�r2r�r�r�)rerlrnrrr�unbindrszMisc.unbindcCs|�d|||d�S)aBind to all widgets at an event SEQUENCE a call to function FUNC.
        An additional boolean parameter ADD specifies whether FUNC will
        be called additionally to the other bound function or whether
        it will replace the previous function. See bind for the return value.)rp�allr�rorrrrr�bind_allysz
Misc.bind_allcCs|j�dd|d�dS)z8Unbind for all widgets for event SEQUENCE all functions.rprurZNr�)rerlrrr�
unbind_all�szMisc.unbind_allcCs|�d|f|||d�S)a=Bind to widgets with bindtag CLASSNAME at event
        SEQUENCE a call of function FUNC. An additional
        boolean parameter ADD specifies whether FUNC will be
        called additionally to the other bound function or
        whether it will replace the previous function. See bind for
        the return value.rprrv)rer
rlr�r�rrr�
bind_class�szMisc.bind_classcCs|j�d||d�dS)zWUnbind for all widgets with bindtag CLASSNAME for event SEQUENCE
        all functions.rprZNr�)rer
rlrrr�unbind_class�szMisc.unbind_classcCs|j�|�dS)zCall the mainloop of Tk.N)r2r�)rerhrrrr��sz
Misc.mainloopcCs|j��dS)z8Quit the Tcl interpreter. All widgets will be destroyed.N)r2�quitr�rrrr{�sz	Misc.quitcCs"|rtt|jj|j�|���SdSrt)rrr2r�r.�rer�rrrrB�sz
Misc._getintscCs"|rtt|jj|j�|���SdSrt)rrr2r�r.r|rrr�_getdoubles�szMisc._getdoublescCs|r|j�|�SdSrt)r2r�r|rrr�_getboolean�szMisc._getbooleancCs"|rd|fS|dkrd|jfSdS)rr�Nr�r�r�rrrr��s

zMisc._displayofcCsBz|��jWStk
r<|j�dd�}|��_|YSXdS)rr2ZwindowingsystemN)rZ_windowingsystem_cachedr"r2r�)reZwsrrrr��s�zMisc._windowingsystemcCs�|rt||f�}nt|�}d}|��D]�\}}|dk	r&|ddkrN|dd�}t|�rb|�|�}n^t|ttf�r�g}|D]<}t|t�r�|�t	|��qxt|t	�r�|�t
|��qxq�qxd�|�}|d||f}q&|S)rrN����_rr-)r+r%�callabler�rrrrarcrrr)rer&r�rr)r*Znvrrrrr��s*


z
Misc._optionscCsNt|��d�}|}|ds.|��}|dd�}|D]}|s>qJ|j|}q2|S)zPReturn the Tkinter instance of a widget identified by
        its Tcl name NAME.�.rrN)r�splitrr#)rerY�wrhrrr�nametowidget�szMisc.nametowidgetcCs�t|||�j}tt|��}z
|j}Wntk
r8YnXz||j}Wntk
r\YnX|j�||�|r�|j	dkr�g|_	|j	�
|�|S)z�Return a newly created Tcl function. If this
        function is called, the Python function FUNC will
        be executed. An optional function SUBST can
        be given which will be executed before FUNC.N)r�r�r_r�r�r"rAr2r�r�rc)rer��substrmr�rYrrrr��s 

zMisc._registercCs|}|jr|j}q|S)r�r�)rer�rrrrsz
Misc._root)z%#z%bz%fz%hz%kz%sz%tz%wz%xz%yz%Az%Ez%Kz%Nz%Wz%Tz%Xz%Yz%Drcs�t|�t|j�kr|S|jj}|jj��fdd�}|\}}}}}}	}
}}}
}}}}}}}}}t�}�|�|_||�|_z||�|_Wnt	k
r�YnX||�|_
||�|_||	�|_||
�|_
||�|_||�|_||
�|_||_z||�|_Wnt	k
�r
YnX||_||�|_zt|�|_Wntk
�rF||_YnXz|�|�|_Wntk
�rt||_YnX||�|_||�|_z�|�|_Wn tt	fk
�r�d|_YnX|fS)rc	s,z
�|�WSttfk
r&|YSXdS)z?Tk changed behavior in 8.4.2, returning "??" rather more often.N)rwr�r��r�rr�getint_events
z&Misc._substitute.<locals>.getint_eventr)r�
_subst_formatr2r�r�rG�serialrSrTr�rXrRrN�timerWrUrVrLrMrQZ
keysym_numr8r rwr��widgetr$Zx_rootZy_rootrP)rer�r�r�Znsign�br��hr)rfr4r�rUrV�A�E�K�N�W�T�X�Y�D�err�rrjsT*











zMisc._substitutecCs(t��\}}}|��}|�|||�dSrt)�sys�exc_infor�report_callback_exception)rer��val�tbrrrrr�_report_exceptionHszMisc._report_exceptioncGs\i}|j�|jj|��D]>}|j�|�}|ddd�f|dd�||ddd�<q|S)z;Call Tcl configure command and return the result as a dict.rrN�r2r.r�)rer�r&rUrrr�
_getconfigureNs
0zMisc._getconfigurecGs2|j�|jj|��}|ddd�f|dd�S)Nrrr�)rer�rUrrr�_getconfigure1VszMisc._getconfigure1cCs�|rt||f�}n|rt|�}|dkr:|�t|j|f��St|t�r^|�t|j|d|f��S|j�t|j|f�|�	|��dS)rNr-)
r+r�rr�rrr�r2r�r�)rerr&r�rrr�
_configureZs
zMisc._configurecKs|�d||�S)z�Configure resources of a widget.

        The values for resources are specified as keyword
        arguments. To get an overview about
        the allowed keyword arguments call the method keys.
        �	configure�r��rer&r�rrrr�gszMisc.configurecCs|j�|jdd|�S)z4Return the resource value for a KEY given as string.�cgetr-r��rer6rrrr�rsz	Misc.cgetcCs|�||i�dSr�)r��rer6r
rrr�__setitem__xszMisc.__setitem__cs*|jj��fdd��|j�|jd��D�S)z3Return a list of all resource names of this widget.cs g|]}�|�ddd��qS)rrNrr�r�rrr�~szMisc.keys.<locals>.<listcomp>r�rhr�rr�rri{s
�z	Misc.keyscCs|jS)z+Return the window path name of this widget.rr�rrrrF�szMisc.__str__cCsd|jj|jj|jfS)Nz<%s.%s object %s>)r�rBrCr�r�rrrrj�s
�z
Misc.__repr__�_noarg_cCs:|tjkr"|�|j�dd|j��S|j�dd|j|�dS)aSet or get the status for propagation of geometry information.

        A boolean argument specifies whether the geometry information
        of the slaves will determine the size of this widget. If no argument
        is given the current setting will be returned.
        �pack�	propagateN�r�r�r~r2r�r��re�flagrrr�pack_propagate�s

�zMisc.pack_propagatecs(�fdd��j��j�dd�j��D�S)�HReturn a list of all slaves of this widget
        in its packing order.csg|]}��|��qSr�r�r�r�rrr��sz$Misc.pack_slaves.<locals>.<listcomp>r��slavesrhr�rr�r�pack_slaves�s

��zMisc.pack_slavescs(�fdd��j��j�dd�j��D�S)r�csg|]}��|��qSrr�r�r�rrr��sz%Misc.place_slaves.<locals>.<listcomp>�placer�rhr�rr�r�place_slaves�s
���zMisc.place_slavescCs|j�dd|j|�dS)z�The anchor value controls how to place the grid within the
        master when no row/column has any weight.

        The default anchor is nw.�grid�anchorNr�)rer�rrr�grid_anchor�szMisc.grid_anchorcCsZdd|jf}|dk	r(|dk	r(|||f}|dk	rD|dk	rD|||f}|�|jj|��pXdS)a�Return a tuple of integer coordinates for the bounding
        box of this widget controlled by the geometry manager grid.

        If COLUMN, ROW is given the bounding box applies from
        the cell with row and column 0 to the specified
        cell. If COL2 and ROW2 are given the bounding box
        starts at that cell.

        The returned integers specify the offset of the upper left
        corner in the master widget and the width and height.
        r��bboxN)r�rBr2r�)re�column�rowZcol2Zrow2r�rrr�	grid_bbox�szMisc.grid_bboxc	Csht|ttjf�rdz:t|�}|s$WdSd|kr:|j�|�WS|j�|�WSWnttfk
rbYnX|S)Nr�)	rr�_tkinterZTcl_Objr2r�r�rwr�)rer
Zsvaluerrr�_gridconvvalue�szMisc._gridconvvaluecCs�t|t�rJ|sJ|dd�dkr*|dd�}|dd�dkrBd|}|f}n|�||�}|s|t|j|j�d||j|�|jd�S|j�d||j|f|�}t|�dkr�|�|�SdS)rr�Nr�rr-r�)r3)	rrr�r7r2r�r�r�r)rer�indexr&r��optionsrrrr�_grid_configure�s(���zMisc._grid_configurecKs|�d|||�S)z�Configure column INDEX of a grid.

        Valid resources are minsize (minimum size of the column),
        weight (how much does additional space propagate to this column)
        and pad (how much space to let additionally).�columnconfigure�r��rer�r&r�rrr�grid_columnconfigure�szMisc.grid_columnconfigurec	Cs |�|j�dd|j||��pdS)z�Return a tuple of column and row which identify the cell
        at which the pixel at position X and Y inside the master
        widget is located.r��locationNrA�rerUrVrrr�
grid_location�s���zMisc.grid_locationcCs:|tjkr"|�|j�dd|j��S|j�dd|j|�dS)aSet or get the status for propagation of geometry information.

        A boolean argument specifies whether the geometry information
        of the slaves will determine the size of this widget. If no argument
        is given, the current setting will be returned.
        r�r�Nr�r�rrr�grid_propagates

�zMisc.grid_propagatecKs|�d|||�S)z�Configure row INDEX of a grid.

        Valid resources are minsize (minimum size of the row),
        weight (how much does additional space propagate to this row)
        and pad (how much space to let additionally).�rowconfigurer�r�rrr�grid_rowconfigureszMisc.grid_rowconfigurecCs|�|j�dd|j��pdS)z<Return a tuple of the number of column and rows in the grid.r��sizeNrAr�rrr�	grid_sizes
��zMisc.grid_sizecsZd}|dk	r|d|f}|dk	r,|d|f}�fdd��j��j�dd�jf|��D�S)	r�rNz-rowz-columncsg|]}��|��qSrr�r�r�rrr�(sz$Misc.grid_slaves.<locals>.<listcomp>r�r�rh)rer�r�r�rr�r�grid_slaves s
��zMisc.grid_slavescGsdd|f|}|j�|�dS)z�Bind a virtual event VIRTUAL (of the form <<Name>>)
        to an event SEQUENCE such that the virtual event is triggered
        whenever SEQUENCE occurs.�eventr�Nr��re�virtual�	sequencesr�rrr�	event_add/szMisc.event_addcGsdd|f|}|j�|�dS)z-Unbind a virtual event VIRTUAL from SEQUENCE.r��deleteNr�r�rrr�event_delete6szMisc.event_deletecKsDdd|j|f}|��D]\}}|d|t|�f}q|j�|�dS)z�Generate an event SEQUENCE. Additional
        keyword arguments specify parameter of the event
        (e.g. x, y, rootx, rooty).r�Zgenerate�-%sN)r�r%rr2r�)rerlr�r�r)r*rrr�event_generate;szMisc.event_generatecCs|j�|j�dd|��S)zuReturn a list of all virtual events or the information
        about the SEQUENCE bound to the virtual event VIRTUAL.r�r}r�)rer�rrr�
event_infoDs�zMisc.event_infocCs|j�|j�dd��S)z*Return a list of all existing image names.�image�namesr�r�rrr�image_namesLszMisc.image_namescCs|j�|j�dd��S)z?Return a list of all available image types (e.g. photo bitmap).r��typesr�r�rrr�image_typesPszMisc.image_types)N)r|)N)N)r|r�)r|)N)r)N)N)N)N)r)r)r)r)r)F)N)r)NNN)N)NNN)NNN)r)N)Nr)N)N)NNNN)NN)N)�rArBrCrk�_last_child_idsr�r�r�r�r�r�r�Zwaitvarr�r�r�r�r�r�r�r�rTr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrr	rrrrrrrrrr�liftrr r"r'r)r+r,r-r.r2r4r5r6r7r8r9r:r<r>r?r@rCrDrErFrGrHrIrKrLrMrNrOrPrQrRrSrUrVrXrYr\r[r]r_r`rarbrcrdrer!rfrgrorprtrwrxryrzr�r{rBr}r~r��propertyr�r�r�r�r��registerrr�rrkrjr�r�r�r�r��configr��__getitem__r�rirFrjr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr�msP
		


)

	
=
	


	r�c@s eZdZdZdd�Zdd�ZdS)r�zwInternal class. Stores function to call when some user
    defined Tcl function is called e.g. after an event occurred.cCs||_||_||_dS)z(Store FUNC, SUBST and WIDGET as members.N)r�r�r�)rer�r�r�rrrr�YszCallWrapper.__init__cGsLz|jr|j|�}|j|�WStk
r2�Yn|j��YnXdS)z3Apply first function SUBST to arguments, than FUNC.N)r�r�rxr�r��rer�rrrr�_s
zCallWrapper.__call__N�rArBrCrkr�r�rrrrr�Usr�c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�XViewzXMix-in class for querying and changing the horizontal position
    of a widget's window.cGs(|jj|jdf|��}|s$|�|�SdS)z5Query and change the horizontal position of the view.�xviewN�r2r�r�r}�rer�rrrrr�oszXView.xviewcCs|j�|jdd|�dS)zsAdjusts the view in the window so that FRACTION of the
        total width of the canvas is off-screen to the left.r��movetoNr��re�fractionrrr�xview_movetouszXView.xview_movetocCs|j�|jdd||�dS)z\Shift the x-view according to NUMBER which is measured in "units"
        or "pages" (WHAT).r��scrollNr��rer1rqrrr�xview_scrollzszXView.xview_scrollN)rArBrCrkr�r�r�rrrrr�ksr�c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�YViewzVMix-in class for querying and changing the vertical position
    of a widget's window.cGs(|jj|jdf|��}|s$|�|�SdS)z3Query and change the vertical position of the view.�yviewNr�r�rrrr��szYView.yviewcCs|j�|jdd|�dS)zsAdjusts the view in the window so that FRACTION of the
        total height of the canvas is off-screen to the top.r�r�Nr�r�rrr�yview_moveto�szYView.yview_movetocCs|j�|jdd||�dS)z\Shift the y-view according to NUMBER which is measured in
        "units" or "pages" (WHAT).r�r�Nr�r�rrr�yview_scroll�szYView.yview_scrollN)rArBrCrkr�r�r�rrrrr��sr�c@s�eZdZdZdBdd�ZeZdd�ZeZdCdd�ZeZ	d	d
�Z
e
ZdDdd�ZeZ
d
d�ZeZdEdd�ZeZdd�ZeZdd�ZeZdFdd�ZeZdGdd�ZeZdHdd�ZeZdIdd�ZeZdd�ZeZdJdd �Z e Z!dKd!d"�Z"e"Z#dLd$d%�Z$e$Z%dMd&d'�Z&e&Z'dNd(d)�Z(e(Z)d*d+�Z*e*Z+dOd,d-�Z,e,Z-dPd.d/�Z.e.Z/dQd0d1�Z0e0Z1dRd2d3�Z2e2Z3dSd4d5�Z4e4Z5dTd6d7�Z6e6Z7dUd8d9�Z8e8Z9dVd:d;�Z:e:Z;dWd<d=�Z<e<Z=dXd>d?�Z>e>Z?d@dA�Z@e@ZAdS)Y�WmzAProvides functions for the communication with the window manager.NcCs |�|j�dd|j||||��S)z�Instruct the window manager to set the aspect ratio (width/height)
        of this widget to be between MINNUMER/MINDENOM and MAXNUMER/MAXDENOM. Return a tuple
        of the actual values if no argument is given.�wm�aspectrA)reZminNumerZminDenomZmaxNumerZmaxDenomrrr�	wm_aspect�s��zWm.wm_aspectcGsdd|jf|}|j�|�S)a�This subcommand returns or sets platform specific attributes

        The first form returns a list of the platform specific flags and
        their values. The second form returns the value for the specific
        option. The third form sets one or more of the values. The values
        are as follows:

        On Windows, -disabled gets or sets whether the window is in a
        disabled state. -toolwindow gets or sets the style of the window
        to toolwindow (as defined in the MSDN). -topmost gets or sets
        whether this is a topmost window (displays above all other
        windows).

        On Macintosh, XXXXX

        On Unix, there are currently no special attribute values.
        r��
attributes)r�r2r�r�rrr�
wm_attributes�szWm.wm_attributescCs|j�dd|j|�S)zVStore NAME in WM_CLIENT_MACHINE property of this widget. Return
        current value.r��clientr�r�rrr�	wm_client�szWm.wm_clientcsZt|�dkr|f}dd�jf|}|r4�j�|�n"�fdd��j��j�|��D�SdS)z�Store list of window names (WLIST) into WM_COLORMAPWINDOWS property
        of this widget. This list contains windows whose colormaps differ from their
        parents. Return current list of widgets if WLIST is empty.rr��colormapwindowscsg|]}��|��qSrr�r�r�rrr��s�z)Wm.wm_colormapwindows.<locals>.<listcomp>N)rr�r2r�r.)reZwlistr�rr�r�wm_colormapwindows�s
�zWm.wm_colormapwindowscCs|j�dd|j|�S)z�Store VALUE in WM_COMMAND property. It is the command
        which shall be used to invoke the application. Return current
        command if VALUE is None.r�rr�r�rrr�
wm_command�sz
Wm.wm_commandcCs|j�dd|j�S)z�Deiconify this widget. If it was never mapped it will not be mapped.
        On Windows it will raise this widget and give it the focus.r��	deiconifyr�r�rrr�wm_deiconify�szWm.wm_deiconifycCs|j�dd|j|�S)z�Set focus model to MODEL. "active" means that this widget will claim
        the focus itself, "passive" means that the window manager shall give
        the focus. Return current focus model if MODEL is None.r��
focusmodelr�)reZmodelrrr�
wm_focusmodel�szWm.wm_focusmodelcCs|j�dd|�dS)aAThe window will be unmapped from the screen and will no longer
        be managed by wm. toplevel windows will be treated like frame
        windows once they are no longer managed by wm, however, the menu
        option configuration will be remembered and the menus will return
        once the widget is managed again.r��forgetNr�r�rrr�	wm_forget�szWm.wm_forgetcCs|j�dd|j�S)zAReturn identifier for decorative frame of this widget if present.r��framer�r�rrr�wm_frame�szWm.wm_framecCs|j�dd|j|�S)ziSet geometry to NEWGEOMETRY of the form =widthxheight+x+y. Return
        current value if None is given.r�r3r�)reZnewGeometryrrr�wm_geometry�szWm.wm_geometrycCs |�|j�dd|j||||��S)aInstruct the window manager that this widget shall only be
        resized on grid boundaries. WIDTHINC and HEIGHTINC are the width and
        height of a grid unit in pixels. BASEWIDTH and BASEHEIGHT are the
        number of grid units requested in Tk_GeometryRequest.r�r�rA)reZ	baseWidthZ
baseHeightZwidthIncZ	heightIncrrr�wm_grids
�z
Wm.wm_gridcCs|j�dd|j|�S)z~Set the group leader widgets for related widgets to PATHNAME. Return
        the group leader of this widget if None is given.r��groupr��reZpathNamerrr�wm_group
szWm.wm_groupcCs2|r|j�dd|jd|�S|j�dd|j|�SdS)a�Set bitmap for the iconified widget to BITMAP. Return
        the bitmap if None is given.

        Under Windows, the DEFAULT parameter can be used to set the icon
        for the widget and any descendents that don't have an icon set
        explicitly.  DEFAULT can be the relative path to a .ico file
        (example: root.iconbitmap(default='myicon.ico') ).  See Tk
        documentation for more information.r��
iconbitmap�-defaultNr�)re�bitmap�defaultrrr�
wm_iconbitmaps	zWm.wm_iconbitmapcCs|j�dd|j�S)zDisplay widget as icon.r��iconifyr�r�rrr�
wm_iconify$sz
Wm.wm_iconifycCs|j�dd|j|�S)zVSet mask for the icon bitmap of this widget. Return the
        mask if None is given.r��iconmaskr�)rerrrr�wm_iconmask*szWm.wm_iconmaskcCs|j�dd|j|�S)zSSet the name of the icon for this widget. Return the name if
        None is given.r��iconnamer�)reZnewNamerrr�wm_iconname1szWm.wm_iconnameFcGs<|r |jjdd|jdf|��n|jjdd|jf|��dS)a�Sets the titlebar icon for this window based on the named photo
        images passed through args. If default is True, this is applied to
        all future created toplevels as well.

        The data in the images is taken as a snapshot at the time of
        invocation. If the images are later changed, this is not reflected
        to the titlebar icons. Multiple images are accepted to allow
        different images sizes to be provided. The window manager may scale
        provided icons to an appropriate size.

        On Windows, the images are packed into a Windows icon structure.
        This will override an icon specified to wm_iconbitmap, and vice
        versa.

        On X, the images are arranged into the _NET_WM_ICON X property,
        which most modern window managers support. An icon specified by
        wm_iconbitmap may exist simultaneously.

        On Macintosh, this currently does nothing.r��	iconphotorNr�)rerr�rrr�wm_iconphoto8szWm.wm_iconphotoc	Cs|�|j�dd|j||��S)z�Set the position of the icon of this widget to X and Y. Return
        a tuple of the current values of X and X if None is given.r��iconpositionrAr�rrr�wm_iconpositionSs
�zWm.wm_iconpositioncCs|j�dd|j|�S)zgSet widget PATHNAME to be displayed instead of icon. Return the current
        value if None is given.r��
iconwindowr�rrrr�
wm_iconwindow[szWm.wm_iconwindowcCs|j�dd|�dS)z�The widget specified will become a stand alone top-level window.
        The window will be decorated with the window managers title bar,
        etc.r��manageNr�)rer�rrr�	wm_managebszWm.wm_managec	Cs|�|j�dd|j||��S)z�Set max WIDTH and HEIGHT for this widget. If the window is gridded
        the values are given in grid units. Return the current values if None
        is given.r��maxsizerA�rerWrXrrr�
wm_maxsizejs
�z
Wm.wm_maxsizec	Cs|�|j�dd|j||��S)z�Set min WIDTH and HEIGHT for this widget. If the window is gridded
        the values are given in grid units. Return the current values if None
        is given.r��minsizerAr$rrr�
wm_minsizess
�z
Wm.wm_minsizecCs|�|j�dd|j|��S)z�Instruct the window manager to ignore this widget
        if BOOLEAN is given with 1. Return the current value if None
        is given.r��overrideredirect)r~r2r�r�r�rrr�wm_overrideredirect|s
�zWm.wm_overrideredirectcCs|j�dd|j|�S)z�Instruct the window manager that the position of this widget shall
        be defined by the user if WHO is "user", and by its own policy if WHO is
        "program".r��positionfromr��reZwhorrr�wm_positionfrom�szWm.wm_positionfromcCs.t|�r|�|�}n|}|j�dd|j||�S)z�Bind function FUNC to command NAME for this widget.
        Return the function bound to NAME if None is given. NAME could be
        e.g. "WM_SAVE_YOURSELF" or "WM_DELETE_WINDOW".r��protocol)r�r�r2r�r�)rerYr�rrrr�wm_protocol�s�zWm.wm_protocolcCs|j�dd|j||�S)zyInstruct the window manager whether this width can be resized
        in WIDTH or HEIGHT. Both values are boolean values.r��	resizabler�r$rrr�wm_resizable�szWm.wm_resizablecCs|j�dd|j|�S)z�Instruct the window manager that the size of this widget shall
        be defined by the user if WHO is "user", and by its own policy if WHO is
        "program".r��sizefromr�r+rrr�wm_sizefrom�szWm.wm_sizefromcCs|j�dd|j|�S)z�Query or set the state of this widget as one of normal, icon,
        iconic (see wm_iconwindow), withdrawn, or zoomed (Windows only).r�rNr�)reZnewstaterrr�wm_state�szWm.wm_statecCs|j�dd|j|�S)zSet the title of this widget.r��titler�r|rrr�wm_title�szWm.wm_titlecCs|j�dd|j|�S)z_Instruct the window manager that this widget is transient
        with regard to widget MASTER.r��	transientr�)rer�rrr�wm_transient�szWm.wm_transientcCs|j�dd|j�S)z�Withdraw this widget from the screen such that it is unmapped
        and forgotten by the window manager. Re-draw it with wm_deiconify.r��withdrawr�r�rrr�wm_withdraw�szWm.wm_withdraw)NNNN)N)N)N)N)NNNN)N)NN)N)N)F)NN)N)NN)NN)N)N)NN)NN)N)N)N)N)BrArBrCrkr�r�r�r�r�r�rrrrrrrrrrr
r	rr3rr�rr
rrrrrrrrrrrrr rr"r!r%r#r'r&r)r(r,r*r.r-r0r/r2r1r3rNr5r4r7r6r9r8rrrrr��s��





�

















r�c@sNeZdZdZdZddd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�ZdS)rozzToplevel widget of Tk which represents mostly the main window
    of an application. It has an associated Tcl interpreter.r�Nrrc

Cs�d|_i|_d|_d|_|dkrZddl}|j�tjd�}|j�	|�\}}|dkrZ||}d}	t
�||||	t|||�|_|r�|�
�tjjs�|�||�dS)a@Return a new Toplevel widget on screen SCREENNAME. A new Tcl interpreter will
        be created. BASENAME will be used for the identification of the profile file (see
        readprofile).
        It is constructed from sys.argv[0] without extensions if None is given. CLASSNAME
        is the name of the widget class.NFr)z.pyz.pyc)r�r#�	_tkloadedr2�os�path�basenamer��argv�splitextr��create�wantobjects�_loadtk�flags�ignore_environment�readprofile)
re�
screenName�baseNamer
�useTk�syncZuser;Zext�interactiverrrr��s zTk.__init__cCs|js|j��|��dSr�)r:r2�loadtkrBr�rrrrK�s
z	Tk.loadtkcCs�d|_|j�d�}|tjkr.tdtj|f��t|j�d��}|tjkrZtdtj|f��|jdkrjg|_|j�	dt
�|j�	dt�|j�d�|j�d�t
r�ts�|a|�d|j�dS)	NT�
tk_versionz4tk.h version (%s) doesn't match libtk.a version (%s)�tcl_versionz6tcl.h version (%s) doesn't match libtcl.a version (%s)Ztkerror�exit�WM_DELETE_WINDOW)r:r2r�r��
TK_VERSIONr/r�TCL_VERSIONr�r�rvrzrcrlrmr-r�)rerLrMrrrrB�s(
�
�
z
Tk._loadtkcCsJt|j���D]}|��q|j�d|j�t�|�trFt	|krFda	dS)zhDestroy this and all descendants widgets. This will
        end the application of this Tcl interpreter.r�N)
rr#�valuesr�r2r�r�r�rlrm�rer'rrrr�	s

z
Tk.destroyc
Cs�ddl}d|jkr|jd}n|j}|j�|d|�}|j�|d|�}|j�|d|�}|j�|d|�}d|i}	td|	�|j�|�r�|j�d|�|j�|�r�tt	|��
�|	�|j�|�r�|j�d|�|j�|�r�tt	|��
�|	�dS)	z�Internal function. It reads BASENAME.tcl and CLASSNAME.tcl into
        the Tcl Interpreter and calls exec on the contents of BASENAME.py and
        CLASSNAME.py if such a file exists in the home directory.rN�HOMEz.%s.tclz.%s.pyrezfrom tkinter import *�source)r;�environ�curdirr<r�exec�isfiler2r��open�read)
rerGr
r;�homeZ	class_tclZclass_pyZbase_tclZbase_py�dirrrrrE	s$

zTk.readprofilecCs:ddl}tdtjd�|t_|t_|t_|�|||�dS)z�Report callback exception on sys.stderr.

        Applications may want to override this internal function, and
        should when sys.stderr is None.rNzException in Tkinter callback)�file)�	tracebackr$r��stderr�	last_type�
last_value�last_traceback�print_exception)rer�r�r�r_rrrr�$	szTk.report_callback_exceptioncCst|j|�S)z3Delegate attribute access to the interpreter object)r`r2)re�attrrrr�__getattr__0	szTk.__getattr__)NNrorrN)rArBrCrkr�r�rKrBr�rEr�rfrrrrro�s�

rocCst||||�Sr�)ro)rFrGr
rHrrr�TclC	srgc@sTeZdZdZifdd�ZeZZZdd�ZeZ	dd�Z
e
Zej
ZZ
ejZZdS)	�PackzQGeometry manager Pack.

    Base class to use the methods pack_* in every widget.cKs$|j�dd|jf|�||��dS)a(Pack a widget in the parent widget. Use as options:
        after=widget - pack it after you have packed widget
        anchor=NSEW (or subset) - position widget according to
                                  given direction
        before=widget - pack it before you will pack widget
        expand=bool - expand widget if parent size grows
        fill=NONE or X or Y or BOTH - fill widget if widget grows
        in=master - use master to contain this widget
        in_=master - see 'in' option description
        ipadx=amount - add internal padding in x direction
        ipady=amount - add internal padding in y direction
        padx=amount - add padding in x direction
        pady=amount - add padding in y direction
        side=TOP or BOTTOM or LEFT or RIGHT -  where to add this widget.
        r�r�N�r2r�r�r�r�rrr�pack_configureL	s


��zPack.pack_configurecCs|j�dd|j�dS)z:Unmap this widget and do not use it for the packing order.r�rNr�r�rrr�pack_forgetb	szPack.pack_forgetcCs8t|j|j�dd|j��}d|kr4|�|d�|d<|S)zEReturn information about the packing options
        for this widget.r�r}�in�r7r2r�r�r��re�drrr�	pack_infoh	szPack.pack_infoN)rArBrCrkrjr�r�r�rkrrpr}r�r�r�r�r�rrrrrhG	s
rhc@sJeZdZdZifdd�ZeZZZdd�ZeZ	dd�Z
e
Zej
ZZ
dS)	�PlacezSGeometry manager Place.

    Base class to use the methods place_* in every widget.cKs$|j�dd|jf|�||��dS)a Place a widget in the parent widget. Use as options:
        in=master - master relative to which the widget is placed
        in_=master - see 'in' option description
        x=amount - locate anchor of this widget at position x of master
        y=amount - locate anchor of this widget at position y of master
        relx=amount - locate anchor of this widget between 0.0 and 1.0
                      relative to width of master (1.0 is right edge)
        rely=amount - locate anchor of this widget between 0.0 and 1.0
                      relative to height of master (1.0 is bottom edge)
        anchor=NSEW (or subset) - position anchor according to given direction
        width=amount - width of this widget in pixel
        height=amount - height of this widget in pixel
        relwidth=amount - width of this widget between 0.0 and 1.0
                          relative to width of master (1.0 is the same width
                          as the master)
        relheight=amount - height of this widget between 0.0 and 1.0
                           relative to height of master (1.0 is the same
                           height as the master)
        bordermode="inside" or "outside" - whether to take border width of
                                           master widget into account
        r�r�Nrir�rrr�place_configurez	s


��zPlace.place_configurecCs|j�dd|j�dS)�Unmap this widget.r�rNr�r�rrr�place_forget�	szPlace.place_forgetcCs8t|j|j�dd|j��}d|kr4|�|d�|d<|S)zEReturn information about the placing options
        for this widget.r�r}rlrmrnrrr�
place_info�	szPlace.place_infoN)rArBrCrkrrr�r�r�rtrrur}r�r�r�rrrrrqu	srqc@s�eZdZdZifdd�ZeZZZej	Z
Z	ejZZdd�Z
e
Zdd�Zdd	�ZeZejZZejZZejZZejZZejZZd
S)�GridzQGeometry manager Grid.

    Base class to use the methods grid_* in every widget.cKs$|j�dd|jf|�||��dS)aPosition a widget in the parent widget in a grid. Use as options:
        column=number - use cell identified with given column (starting with 0)
        columnspan=number - this widget will span several columns
        in=master - use master to contain this widget
        in_=master - see 'in' option description
        ipadx=amount - add internal padding in x direction
        ipady=amount - add internal padding in y direction
        padx=amount - add padding in x direction
        pady=amount - add padding in y direction
        row=number - use cell identified with given row (starting with 0)
        rowspan=number - this widget will span several rows
        sticky=NSEW - if cell is larger on which sides will this
                      widget stick to the cell boundary
        r�r�Nrir�rrr�grid_configure�	s


��zGrid.grid_configurecCs|j�dd|j�dS)rsr�rNr�r�rrr�grid_forget�	szGrid.grid_forgetcCs|j�dd|j�dS)z0Unmap this widget but remember the grid options.r�r�Nr�r�rrr�grid_remove�	szGrid.grid_removecCs8t|j|j�dd|j��}d|kr4|�|d�|d<|S)zSReturn information about the options
        for positioning this widget in a grid.r�r}rlrmrnrrr�	grid_info�	szGrid.grid_infoN)rArBrCrkrwr�r�r�r�r�r�r�r�rxrryrzr}r�r�r�r�r�r�r�r�r�r�rrrrrv�	s





rvc@s:eZdZdZdd�Ziidfdd�Zdd�Zdd	d
�ZdS)
�
BaseWidgetzInternal class.cCs�|s
t�}||_|j|_d}d|kr2|d}|d=|s�|jj��}|jdkrRi|_|j�|d�d}||j|<|dkr�d|f}nd||f}||_|j	dkr�d||_	n|j	d||_	i|_
|j|jj
kr�|jj
|j��||jj
|j<dS)z6Internal function. Sets up information about children.NrYrrz!%sz!%s%dr�)rsr�r2r�rArr�r�r�r�r#r�)rer�r&rY�countrrr�_setup�	s2


zBaseWidget._setuprc	Cs�|rt||f�}||_t�|||�|jdkr4g|_dd�|��D�}|D]\}}||=qJ|j�||jf||�	|��|D]\}}|�
||�q~dS)zdConstruct a widget with the parent widget MASTER, a name WIDGETNAME
        and appropriate options.NcSs"g|]\}}t|t�r||f�qSr)rr rIrrrr�	
s
z'BaseWidget.__init__.<locals>.<listcomp>)r+�
widgetNamer{r}r�r%r2r�r�r�r�)	rer�r~r&r��extra�classesr)r*rrrr�
s
�zBaseWidget.__init__cCsTt|j���D]}|��q|j�d|j�|j|jjkrF|jj|j=t	�|�dS)z)Destroy this and all descendants widgets.r�N)
rr#rRr�r2r�r�r�r�r�rSrrrr�
s
zBaseWidget.destroycCs|j�|j|f|�Sr�r�)rerYr�rrr�_do
szBaseWidget._doN)r)rArBrCrkr}r�r�r�rrrrr{�	s
r{c@seZdZdZdS)�WidgetzxInternal class.

    Base class for a widget which can be positioned with the geometry managers
    Pack, Place or Grid.N)rArBrCrkrrrrr�
sr�c@seZdZdZdifdd�ZdS)�Toplevelz"Toplevel widget, e.g. for dialogs.Nc	Ks�|rt||f�}d}dD]L}||kr||}|ddkrJd|dd�}nd|}|||f}||=qt�||d|i|�|��}|�|���|�|���|�d|j�dS)	a%Construct a toplevel widget with the parent MASTER.

        Valid resource names: background, bd, bg, borderwidth, class,
        colormap, container, cursor, height, highlightbackground,
        highlightcolor, highlightthickness, menu, relief, screen, takefocus,
        use, visual, width.r)rJ�class_r(rWZcolormapr�r�r-NrTrO)r+r{r�rrr4r-r�)	rer�r&r�rZwmkeyr��optrrrrrr�)
s zToplevel.__init__�rArBrCrkr�rrrrr�&
sr�c@s.eZdZdZdifdd�Zdd�Zdd�ZdS)	rDzButton widget.NcKst�||d||�dS)aUConstruct a button widget with the parent MASTER.

        STANDARD OPTIONS

            activebackground, activeforeground, anchor,
            background, bitmap, borderwidth, cursor,
            disabledforeground, font, foreground
            highlightbackground, highlightcolor,
            highlightthickness, image, justify,
            padx, pady, relief, repeatdelay,
            repeatinterval, takefocus, text,
            textvariable, underline, wraplength

        WIDGET-SPECIFIC OPTIONS

            command, compound, default, height,
            overrelief, state, width
        ZbuttonN�r�r��rer�r&r�rrrr�G
szButton.__init__cCs|j�|jd�dS)a_Flash the button.

        This is accomplished by redisplaying
        the button several times, alternating between active and
        normal colors. At the end of the flash the button is left
        in the same normal/active state as when the command was
        invoked. This command is ignored if the button's state is
        disabled.
        �flashNr�r�rrrr�\
s
zButton.flashcCs|j�|jd�S)aInvoke the command associated with the button.

        The return value is the return value from the command,
        or an empty string if there is no command associated with
        the button. This command is ignored if the button's state
        is disabled.
        �invoker�r�rrrr�h
sz
Button.invoke)rArBrCrkr�r�r�rrrrrDD
srDc@seZdZdZdifdd�Zdd�Zdd�Zd	d
�Zdd�Zdwd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dxdd�Zdydd�Zdzdd�Zd{dd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dAdB�Z#d|dCdD�Z$dEdF�Z%dGdH�Z&dIdJ�Z'dKdL�Z(dMdN�Z)dOdP�Z*dQdR�Z+dSdT�Z,dUdV�Z-d}dWdX�Z.e.Z/dYdZ�Z0e0Z1d[d\�Z2d~d^d_�Z3ifd`da�Z4dbdc�Z5e5Z6Z7ddde�Z8dfdg�Z9ddidj�Z:dkdl�Z;dmdn�Z<dodp�Z=dqdr�Z>dsdt�Z?dudv�Z@dS)��Canvasz?Canvas widget to display graphical elements like lines or text.NcKst�||d||�dS)aConstruct a canvas widget with the parent MASTER.

        Valid resource names: background, bd, bg, borderwidth, closeenough,
        confine, cursor, height, highlightbackground, highlightcolor,
        highlightthickness, insertbackground, insertborderwidth,
        insertofftime, insertontime, insertwidth, offset, relief,
        scrollregion, selectbackground, selectborderwidth, selectforeground,
        state, takefocus, width, xscrollcommand, xscrollincrement,
        yscrollcommand, yscrollincrement.ZcanvasNr�r�rrrr�v
s
zCanvas.__init__cGs|j�|jdf|�dS)r�addtagNr�r�rrrr��
sz
Canvas.addtagcCs|�|d|�dS)z*Add tag NEWTAG to all items above TAGORID.�aboveN�r��re�newtag�tagOrIdrrr�addtag_above�
szCanvas.addtag_abovecCs|�|d�dS)zAdd tag NEWTAG to all items.ruNr�)rer�rrr�
addtag_all�
szCanvas.addtag_allcCs|�|d|�dS)z*Add tag NEWTAG to all items below TAGORID.�belowNr�r�rrr�addtag_below�
szCanvas.addtag_belowcCs|�|d||||�dS)z�Add tag NEWTAG to item which is closest to pixel at X, Y.
        If several match take the top-most.
        All items closer than HALO are considered overlapping (all are
        closests). If START is specified the next below this tag is taken.�closestNr�)rer�rUrV�halo�startrrr�addtag_closest�
szCanvas.addtag_closestcCs|�|d||||�dS)zLAdd tag NEWTAG to all items in the rectangle defined
        by X1,Y1,X2,Y2.�enclosedNr��rer��x1�y1�x2�y2rrr�addtag_enclosed�
szCanvas.addtag_enclosedcCs|�|d||||�dS)zWAdd tag NEWTAG to all items which overlap the rectangle
        defined by X1,Y1,X2,Y2.�overlappingNr�r�rrr�addtag_overlapping�
szCanvas.addtag_overlappingcCs|�|d|�dS)z)Add tag NEWTAG to all items with TAGORID.�withtagNr�r�rrr�addtag_withtag�
szCanvas.addtag_withtagcGs |�|j�|jdf|��pdS)z|Return a tuple of X1,Y1,X2,Y2 coordinates for a rectangle
        which encloses all items with tags specified as arguments.r�NrAr�rrrr��
s
��zCanvas.bboxcCs(|j�|jd||d�|r$|�|�dS)zbUnbind for all items with TAGORID for event SEQUENCE  the
        function identified with FUNCID.rprZNrs)rer�rlrnrrr�
tag_unbind�
szCanvas.tag_unbindcCs|�|jd|f|||�S)a&Bind to all items with TAGORID at event SEQUENCE a call to function FUNC.

        An additional boolean parameter ADD specifies whether FUNC will be
        called additionally to the other bound function or whether it will
        replace the previous function. See bind for the return value.rprq)rer�rlr�r�rrr�tag_bind�
s
�zCanvas.tag_bindcCs|j�|j�|jd||��S)zrReturn the canvas x coordinate of pixel position SCREENX rounded
        to nearest multiple of GRIDSPACING units.�canvasxr/)reZscreenx�gridspacingrrrr��
s�zCanvas.canvasxcCs|j�|j�|jd||��S)zrReturn the canvas y coordinate of pixel position SCREENY rounded
        to nearest multiple of GRIDSPACING units.�canvasyr/)reZscreenyr�rrrr��
s�zCanvas.canvasycs,�fdd��j��j��jdf|��D�S)z8Return a list of coordinates for the item given in ARGS.csg|]}�j�|��qSr)r2r�r�r�rrr��
sz!Canvas.coords.<locals>.<listcomp>�coordsrhr�rr�rr��
s

��z
Canvas.coordsc	Cs\t|�}|d}t|ttf�r,|dd�}ni}|j�|jj|jd|f||�||����S)rr�Nr@)	rrrrr2r�r�r�r�)re�itemTyper�r�r&rrr�_create�
s��zCanvas._createcOs|�d||�S)z6Create arc shaped region with coordinates x1,y1,x2,y2.Zarc�r�r�rrr�
create_arc�
szCanvas.create_arccOs|�d||�S)z%Create bitmap with coordinates x1,y1.rr�r�rrr�
create_bitmap�
szCanvas.create_bitmapcOs|�d||�S)z)Create image item with coordinates x1,y1.r�r�r�rrr�create_image�
szCanvas.create_imagecOs|�d||�S)z-Create line with coordinates x1,y1,...,xn,yn.�liner�r�rrr�create_line�
szCanvas.create_linecOs|�d||�S)z)Create oval with coordinates x1,y1,x2,y2.Zovalr�r�rrr�create_oval�
szCanvas.create_ovalcOs|�d||�S)z0Create polygon with coordinates x1,y1,...,xn,yn.Zpolygonr�r�rrr�create_polygon�
szCanvas.create_polygoncOs|�d||�S)z.Create rectangle with coordinates x1,y1,x2,y2.Z	rectangler�r�rrr�create_rectangle�
szCanvas.create_rectanglecOs|�d||�S)z#Create text with coordinates x1,y1.�textr�r�rrr�create_text�
szCanvas.create_textcOs|�d||�S)z+Create window with coordinates x1,y1,x2,y2.r�r�r�rrr�
create_window�
szCanvas.create_windowcGs|j�|jdf|�dS)z�Delete characters of text items identified by tag or id in ARGS (possibly
        several times) from FIRST to LAST character (including).�dcharsNr�r�rrrr�sz
Canvas.dcharscGs|j�|jdf|�dS)z<Delete items identified by all tag or ids contained in ARGS.r�Nr�r�rrrr�sz
Canvas.deletecGs|j�|jdf|�dS)ziDelete tag or id given as last arguments in ARGS from items
        identified by first argument in ARGS.�dtagNr�r�rrrr�	szCanvas.dtagcGs |�|j�|jdf|��pdS)r�findrrAr�rrrr�s
��zCanvas.findcCs|�d|�S)zReturn items above TAGORID.r��r��rer�rrr�
find_aboveszCanvas.find_abovecCs
|�d�S)zReturn all items.rur�r�rrr�find_allszCanvas.find_allcCs|�d|�S)zReturn all items below TAGORID.r�r�r�rrr�
find_belowszCanvas.find_belowcCs|�d||||�S)z�Return item which is closest to pixel at X, Y.
        If several match take the top-most.
        All items closer than HALO are considered overlapping (all are
        closest). If START is specified the next below this tag is taken.r�r�)rerUrVr�r�rrr�find_closestszCanvas.find_closestcCs|�d||||�S)z=Return all items in rectangle defined
        by X1,Y1,X2,Y2.r�r��rer�r�r�r�rrr�
find_enclosed&szCanvas.find_enclosedcCs|�d||||�S)zLReturn all items which overlap the rectangle
        defined by X1,Y1,X2,Y2.r�r�r�rrr�find_overlapping+szCanvas.find_overlappingcCs|�d|�S)zReturn all items with TAGORID.r�r�r�rrr�find_withtag0szCanvas.find_withtagcGs|j�|jdf|�S)z.Set focus to the first item specified in ARGS.rTr�r�rrrrT4szCanvas.focuscGs|j�|j�|jdf|��S)z=Return tags associated with the first item specified in ARGS.�gettagsrhr�rrrr�8s�zCanvas.gettagscGs|j�|jdf|�dS)zdSet cursor at position POS in the item identified by TAGORID.
        In ARGS TAGORID must be first.�icursorNr�r�rrrr�=szCanvas.icursorcGs|j�|j�|jdf|��S)z?Return position of cursor as integer in item specified in ARGS.r�r!r�rrrr�BszCanvas.indexcGs|j�|jdf|�dS)zSInsert TEXT in item TAGORID at position POS. ARGS must
        be TAGORID POS TEXT.�insertNr�r�rrrr�Fsz
Canvas.insertcCs|j�|jdf|d|f�S)z9Return the resource value for an OPTION for item TAGORID.�itemcgetr-r�)rer�rrrrr�Ks�zCanvas.itemcgetcKs|�d|f||�S)z�Configure resources of an item TAGORID.

        The values for resources are specified as keyword
        arguments. To get an overview about
        the allowed keyword arguments call the method without arguments.
        �
itemconfigurer��rer�r&r�rrrr�PszCanvas.itemconfigurecGs|j�|jdf|�dS)zJLower an item TAGORID given in ARGS
        (optional below another item).rNr�r�rrr�	tag_lower_szCanvas.tag_lowercGs|j�|jdf|�dS)z#Move an item TAGORID given in ARGS.�moveNr�r�rrrr�fszCanvas.moverZcCs|j�|jd|||�dS)a}Move the items given by TAGORID in the canvas coordinate
        space so that the first coordinate pair of the bottommost
        item with tag TAGORID is located at position (X,Y).
        X and Y may be the empty string, in which case the
        corresponding coordinate will be unchanged. All items matching
        TAGORID remain in the same positions relative to each other.r�Nr�)rer�rUrVrrrr�jsz
Canvas.movetocKs|j�|jdf|�||��S)z�Print the contents of the canvas to a postscript
        file. Valid options: colormap, colormode, file, fontmap,
        height, pageanchor, pageheight, pagewidth, pagex, pagey,
        rotate, width, x, y.�
postscriptrir�rrrr�ss
�zCanvas.postscriptcGs|j�|jdf|�dS)zJRaise an item TAGORID given in ARGS
        (optional above another item).rNr�r�rrr�	tag_raise{szCanvas.tag_raisecGs|j�|jdf|�dS)z9Scale item TAGORID with XORIGIN, YORIGIN, XSCALE, YSCALE.�scaleNr�r�rrrr��szCanvas.scalecCs|j�|jdd||�dS�z&Remember the current X, Y coordinates.�scan�markNr�r�rrr�	scan_mark�szCanvas.scan_mark�
cCs|j�|jdd|||�dS)z�Adjust the view of the canvas to GAIN times the
        difference between X and Y and the coordinates given in
        scan_mark.r��dragtoNr�)rerUrVZgainrrr�scan_dragto�szCanvas.scan_dragtocCs|j�|jdd||�dS)zLAdjust the end of the selection near the cursor of an item TAGORID to index.�select�adjustNr��rer�r�rrr�
select_adjust�szCanvas.select_adjustcCs|j�|jdd�dS)�,Clear the selection if it is in this widget.r�r�Nr�r�rrr�select_clear�szCanvas.select_clearcCs|j�|jdd||�dS)z:Set the fixed end of a selection in item TAGORID to INDEX.r��fromNr�r�rrr�select_from�szCanvas.select_fromcCs|j�|jdd�pdS)z(Return the item which has the selection.r�rNr�r�rrr�select_item�szCanvas.select_itemcCs|j�|jdd||�dS)z=Set the variable end of a selection in item TAGORID to INDEX.r��toNr�r�rrr�	select_to�szCanvas.select_tocCs|j�|jd|�pdS)z$Return the type of the item TAGORID.r Nr�r�rrrr �szCanvas.type)NN)N)NNN)N)N)NN)N)rZrZ)r�)ArArBrCrkr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rTr�r�r�r�r�r��
itemconfigr�rr�r�r�r�r�rr�r�r�r�r�r�r�r�r rrrrr�s
sz


	



	
	
r�c@sFeZdZdZdifdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�Checkbuttonz7Checkbutton widget which is either in on- or off-state.NcKst�||d||�dS)aConstruct a checkbutton widget with the parent MASTER.

        Valid resource names: activebackground, activeforeground, anchor,
        background, bd, bg, bitmap, borderwidth, command, cursor,
        disabledforeground, fg, font, foreground, height,
        highlightbackground, highlightcolor, highlightthickness, image,
        indicatoron, justify, offvalue, onvalue, padx, pady, relief,
        selectcolor, selectimage, state, takefocus, text, textvariable,
        underline, variable, width, wraplength.�checkbuttonNr�r�rrrr��s
zCheckbutton.__init__cCs|j�|jd�dS�zPut the button in off-state.�deselectNr�r�rrrr��szCheckbutton.deselectcCs|j�|jd�dS�zFlash the button.r�Nr�r�rrrr��szCheckbutton.flashcCs|j�|jd�S�z<Toggle the button and invoke a command if given as resource.r�r�r�rrrr��szCheckbutton.invokecCs|j�|jd�dS�zPut the button in on-state.r�Nr�r�rrrr��szCheckbutton.selectcCs|j�|jd�dS)zToggle the button.�toggleNr�r�rrrr��szCheckbutton.toggle)
rArBrCrkr�r�r�r�r�r�rrrrr��sr�c@s�eZdZdZdifdd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZeZ
dd�ZeZdd�ZeZdd�ZeZdd�ZeZdd�ZeZdS) �Entryz1Entry widget which allows displaying simple text.NcKst�||d||�dS)aConstruct an entry widget with the parent MASTER.

        Valid resource names: background, bd, bg, borderwidth, cursor,
        exportselection, fg, font, foreground, highlightbackground,
        highlightcolor, highlightthickness, insertbackground,
        insertborderwidth, insertofftime, insertontime, insertwidth,
        invalidcommand, invcmd, justify, relief, selectbackground,
        selectborderwidth, selectforeground, show, state, takefocus,
        textvariable, validate, validatecommand, vcmd, width,
        xscrollcommand.�entryNr�r�rrrr��szEntry.__init__cCs|j�|jd||�dS)z.Delete text from FIRST to LAST (not included).r�Nr��re�firstZlastrrrr��szEntry.deletecCs|j�|jd�S)zReturn the text.r�r�r�rrrr��sz	Entry.getcCs|j�|jd|�dS)zInsert cursor at INDEX.r�Nr��rer�rrrr��sz
Entry.icursorcCs|j�|j�|jd|��S)zReturn position of cursor.r�r!r�rrrr��s
�zEntry.indexcCs|j�|jd||�dS)zInsert STRING at INDEX.r�Nr�)rer�r�rrrr��szEntry.insertcCs|j�|jdd|�dSr�r�r^rrrr��szEntry.scan_markcCs|j�|jdd|�dS)z�Adjust the view of the canvas to 10 times the
        difference between X and Y and the coordinates given in
        scan_mark.r�r�Nr�r^rrrr��szEntry.scan_dragtocCs|j�|jdd|�dS)z9Adjust the end of the selection near the cursor to INDEX.r
r�Nr�r�rrr�selection_adjust�szEntry.selection_adjustcCs|j�|jdd�dS)r�r
r�Nr�r�rrrrszEntry.selection_clearcCs|j�|jdd|�dS)�*Set the fixed end of a selection to INDEX.r
r�Nr�r�rrr�selection_fromszEntry.selection_fromcCs|j�|j�|jdd��S)zSReturn True if there are characters selected in the entry, False
        otherwise.r
�presentr*r�rrr�selection_presents�zEntry.selection_presentcCs|j�|jdd||�dS)�3Set the selection from START to END (not included).r
�rangeNr��rer��endrrr�selection_rangeszEntry.selection_rangecCs|j�|jdd|�dS)�-Set the variable end of a selection to INDEX.r
r�Nr�r�rrr�selection_toszEntry.selection_to)N)rArBrCrkr�r�r�r�r�r�r�r�r�r�rr�r�r�r�Zselect_presentr�Zselect_ranger�r�rrrrr��s*
r�c@seZdZdZdifdd�ZdS)�FramezFFrame widget which may contain other widgets and can have a 3D border.NcKs^t||f�}d}d|kr,d|df}|d=nd|krFd|df}|d=t�||d|i|�dS)aConstruct a frame widget with the parent MASTER.

        Valid resource names: background, bd, bg, borderwidth, class,
        colormap, container, cursor, height, highlightbackground,
        highlightcolor, highlightthickness, relief, takefocus, visual, width.rr�z-classr(r	N)r+r�r�)rer�r&r�rrrrr�&szFrame.__init__r�rrrrr�#sr�c@seZdZdZdifdd�ZdS)�Labelz0Label widget which can display text and bitmaps.NcKst�||d||�dS)a�Construct a label widget with the parent MASTER.

        STANDARD OPTIONS

            activebackground, activeforeground, anchor,
            background, bitmap, borderwidth, cursor,
            disabledforeground, font, foreground,
            highlightbackground, highlightcolor,
            highlightthickness, image, justify,
            padx, pady, relief, takefocus, text,
            textvariable, underline, wraplength

        WIDGET-SPECIFIC OPTIONS

            height, state, width

        �labelNr�r�rrrr�:szLabel.__init__r�rrrrr�7sr�c@s�eZdZdZdifdd�Zdd�Zdd�Zd	d
�Zd)dd�Zd*d
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZeZd+dd�ZeZdd �ZeZd,d!d"�ZeZd#d$�Zd%d&�Zd-d'd(�ZeZdS).�Listboxz3Listbox widget which can display a list of strings.NcKst�||d||�dS)a�Construct a listbox widget with the parent MASTER.

        Valid resource names: background, bd, bg, borderwidth, cursor,
        exportselection, fg, font, foreground, height, highlightbackground,
        highlightcolor, highlightthickness, relief, selectbackground,
        selectborderwidth, selectforeground, selectmode, setgrid, takefocus,
        width, xscrollcommand, yscrollcommand, listvariable.ZlistboxNr�r�rrrr�RszListbox.__init__cCs|j�|jd|�dS)z"Activate item identified by INDEX.�activateNr�r�rrrr\szListbox.activatecCs|�|j�|jd|��pdS)zxReturn a tuple of X1,Y1,X2,Y2 coordinates for a rectangle
        which encloses the item identified by the given index.r�NrAr�rrrr�`szListbox.bboxcCs|�|j�|jd��pdS)z.Return the indices of currently selected item.�curselectionrrAr�rrrreszListbox.curselectioncCs|j�|jd||�dS)z+Delete items from FIRST to LAST (included).r�Nr�r�rrrr�iszListbox.deletecCs:|dk	r$|j�|j�|jd||��S|j�|jd|�SdS)z0Get list of items from FIRST to LAST (included).Nr�rhr�rrrr�ms�zListbox.getcCs*|j�|jd|�}|dkrdS|j�|�S)z+Return index of item identified with INDEX.r�r�N�r2r�r�r��rer�rgrrrr�usz
Listbox.indexcGs|j�|jd|f|�dS)zInsert ELEMENTS at INDEX.r�Nr�)rer��elementsrrrr�{szListbox.insertcCs|j�|j�|jd|��S)z5Get index of item which is nearest to y coordinate Y.�nearestr!)rerVrrrrs
�zListbox.nearestcCs|j�|jdd||�dSr�r�r�rrrr��szListbox.scan_markcCs|j�|jdd||�dS)z�Adjust the view of the listbox to 10 times the
        difference between X and Y and the coordinates given in
        scan_mark.r�r�Nr�r�rrrr��szListbox.scan_dragtocCs|j�|jd|�dS)z"Scroll such that INDEX is visible.�seeNr�r�rrrr�szListbox.seecCs|j�|jdd|�dS)z-Set the fixed end oft the selection to INDEX.r
r�Nr�r�rrr�selection_anchor�szListbox.selection_anchorcCs|j�|jdd||�dS)z2Clear the selection from FIRST to LAST (included).r
r�Nr�r�rrrr�s
�zListbox.selection_clearcCs|j�|j�|jdd|��S)z.Return True if INDEX is part of the selection.r
Zincludesr*r�rrr�selection_includes�s�zListbox.selection_includescCs|j�|jdd||�dS)ziSet the selection from FIRST to LAST (included) without
        changing the currently selected elements.r
r�Nr�r�rrr�
selection_set�szListbox.selection_setcCs|j�|j�|jd��S)z-Return the number of elements in the listbox.r�r!r�rrrr��szListbox.sizecCs|j�|jdf|d|f�S)z4Return the resource value for an ITEM and an OPTION.r�r-r��rer�rrrrr��s�zListbox.itemcgetcKs|�d|f||�S)a9Configure resources of an ITEM.

        The values for resources are specified as keyword arguments.
        To get an overview about the allowed keyword arguments
        call the method without arguments.
        Valid resource names: background, bg, foreground, fg,
        selectbackground, selectforeground.r�r�r�rrrr��szListbox.itemconfigure)N)N)N)N)N)rArBrCrkr�rr�rr�r�r�r�rr�r�rrZ
select_anchorrr�r	Zselect_includesr
Z
select_setr�r�r�r�rrrrrOs2






rc@seZdZdZdifdd�Zd6dd�Zdd	�Zifd
d�Zifdd
�Zifdd�Z	ifdd�Z
ifdd�Zifdd�Zifdd�Z
ifdd�Zifdd�Zifdd�Zifdd�Zifd d!�Zd7d"d#�Zd$d%�Zd8d&d'�ZeZd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�ZdS)9�MenuzPMenu widget which allows displaying menu bars, pull-down menus and pop-up menus.NcKst�||d||�dS)aAConstruct menu widget with the parent MASTER.

        Valid resource names: activebackground, activeborderwidth,
        activeforeground, background, bd, bg, borderwidth, cursor,
        disabledforeground, fg, font, foreground, postcommand, relief,
        selectcolor, takefocus, tearoff, tearoffcommand, title, type.�menuNr�r�rrrr��sz
Menu.__init__rZcCs|j�d|j|||�dS)z/Post the menu at position X,Y with entry ENTRY.�tk_popupNr�)rerUrVr�rrrr�sz
Menu.tk_popupcCs|j�|jd|�dS)zActivate entry at INDEX.rNr�r�rrrr�sz
Menu.activatecKs$|j�|jd|f|�||��dS)rr�Nri)rer�r&r�rrrr��s
�zMenu.addcKs|�d|p|�dS)zAdd hierarchical menu item.�cascadeN�r�r�rrr�add_cascade�szMenu.add_cascadecKs|�d|p|�dS)zAdd checkbutton menu item.r�Nrr�rrr�add_checkbutton�szMenu.add_checkbuttoncKs|�d|p|�dS)zAdd command menu item.rNrr�rrr�add_command�szMenu.add_commandcKs|�d|p|�dS)zAddd radio menu item.�radiobuttonNrr�rrr�add_radiobutton�szMenu.add_radiobuttoncKs|�d|p|�dS)zAdd separator.�	separatorNrr�rrr�
add_separator�szMenu.add_separatorcKs&|j�|jd||f|�||��dS)rr�Nri)rer�r�r&r�rrrr��s
�zMenu.insertcKs|�|d|p|�dS)z$Add hierarchical menu item at INDEX.rN�r�r�rrr�insert_cascade�szMenu.insert_cascadecKs|�|d|p|�dS)z#Add checkbutton menu item at INDEX.r�Nrr�rrr�insert_checkbutton�szMenu.insert_checkbuttoncKs|�|d|p|�dS)zAdd command menu item at INDEX.rNrr�rrr�insert_command�szMenu.insert_commandcKs|�|d|p|�dS)zAddd radio menu item at INDEX.rNrr�rrr�insert_radiobutton
szMenu.insert_radiobuttoncKs|�|d|p|�dS)zAdd separator at INDEX.rNrr�rrr�insert_separator
szMenu.insert_separatorcCs�|dkr|}|�|�|�|�}}|dks2|dkr:d\}}t||d�D]0}d|�|�krHt|�|d��}|rH|�|�qH|j�|jd||�dS)z7Delete menu items between INDEX1 and INDEX2 (included).N)rr�rrr�)	r�r��entryconfigr�	entrycgetr�r2r�r�)re�index1�index2Z
num_index1Z
num_index2rgr'rrrr�	
szMenu.deletecCs|j�|jd|d|�S)z=Return the resource value of a menu item for OPTION at INDEX.rr-r�rrrrr
szMenu.entrycgetcKs|�d|f||�S)zConfigure a menu item at INDEX.�entryconfigurer�r�rrrr"
szMenu.entryconfigurecCs*|j�|jd|�}|dkrdS|j�|�S)z4Return the index of a menu item identified by INDEX.r�r�Nrrrrrr�#
sz
Menu.indexcCs|j�|jd|�S)zRInvoke a menu item identified by INDEX and execute
        the associated command.r�r�r�rrrr�)
szMenu.invokecCs|j�|jd||�dS)zDisplay a menu at position X,Y.�postNr�r�rrrr#.
sz	Menu.postcCs|j�|jd|�S)z*Return the type of the menu item at INDEX.r r�r�rrrr 2
sz	Menu.typecCs|j�|jd�dS)z
Unmap a menu.�unpostNr�r�rrrr$6
szMenu.unpostcCs|j�|j�|jd|��S)zNReturn the x-position of the leftmost pixel of the menu item
        at INDEX.�	xpositionr!r�rrrr%:
szMenu.xpositioncCs|j�|j�|jd|��S)zEReturn the y-position of the topmost pixel of the menu item at INDEX.�	ypositionr!r�rrrr&?
s
�zMenu.yposition)rZ)N)N)rArBrCrkr�rrr�rrrrrr�rrrrrr�rr"rr�r�r#r r$r%r&rrrrr�s6	


rc@seZdZdZdifdd�ZdS)�
Menubuttonz(Menubutton widget, obsolete since Tk8.0.NcKst�||d||�dS)N�
menubuttonr�r�rrrr�H
szMenubutton.__init__r�rrrrr'E
sr'c@seZdZdZdifdd�ZdS)�MessagezKMessage widget to display multiline text. Obsolete since Label does it too.NcKst�||d||�dS)N�messager�r�rrrr�O
szMessage.__init__r�rrrrr)L
sr)c@s>eZdZdZdifdd�Zdd�Zdd�Zd	d
�Zdd�ZdS)
�RadiobuttonzGRadiobutton widget which shows only one of several buttons in on-state.NcKst�||d||�dS)a�Construct a radiobutton widget with the parent MASTER.

        Valid resource names: activebackground, activeforeground, anchor,
        background, bd, bg, bitmap, borderwidth, command, cursor,
        disabledforeground, fg, font, foreground, height,
        highlightbackground, highlightcolor, highlightthickness, image,
        indicatoron, justify, padx, pady, relief, selectcolor, selectimage,
        state, takefocus, text, textvariable, underline, value, variable,
        width, wraplength.rNr�r�rrrr�V
s
zRadiobutton.__init__cCs|j�|jd�dSr�r�r�rrrr�b
szRadiobutton.deselectcCs|j�|jd�dSr�r�r�rrrr�g
szRadiobutton.flashcCs|j�|jd�Sr�r�r�rrrr�k
szRadiobutton.invokecCs|j�|jd�dSr�r�r�rrrr�o
szRadiobutton.select)	rArBrCrkr�r�r�r�r�rrrrr+S
sr+c@s@eZdZdZdifdd�Zdd�Zdd�Zd
d	d
�Zdd�ZdS)�Scalez1Scale widget which can display a numerical scale.NcKst�||d||�dS)a�Construct a scale widget with the parent MASTER.

        Valid resource names: activebackground, background, bigincrement, bd,
        bg, borderwidth, command, cursor, digits, fg, font, foreground, from,
        highlightbackground, highlightcolor, highlightthickness, label,
        length, orient, relief, repeatdelay, repeatinterval, resolution,
        showvalue, sliderlength, sliderrelief, state, takefocus,
        tickinterval, to, troughcolor, variable, width.r�Nr�r�rrrr�w
s	zScale.__init__c
CsJ|j�|jd�}z|j�|�WStttfk
rD|j�|�YSXdS)z*Get the current value as integer or float.r�N)r2r�r�r�rwr#r�r�r�rrrr��
s
z	Scale.getcCs|j�|jd|�dS)zSet the value to VALUE.r�Nr�r�rrrr��
sz	Scale.setcCs|�|j�|jd|��S)z�Return a tuple (X,Y) of the point along the centerline of the
        trough that corresponds to VALUE or the current value if None is
        given.r�rAr�rrrr��
szScale.coordscCs|j�|jd||�S)zcReturn where the point X,Y lies. Valid return values are "slider",
        "though1" and "though2".�identifyr�r�rrrr-�
szScale.identify)N)	rArBrCrkr�r�r�r�r-rrrrr,t
s
r,c@sPeZdZdZdifdd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�	Scrollbarz?Scrollbar widget which displays a slider at a certain position.NcKst�||d||�dS)alConstruct a scrollbar widget with the parent MASTER.

        Valid resource names: activebackground, activerelief,
        background, bd, bg, borderwidth, command, cursor,
        elementborderwidth, highlightbackground,
        highlightcolor, highlightthickness, jump, orient,
        relief, repeatdelay, repeatinterval, takefocus,
        troughcolor, width.Z	scrollbarNr�r�rrrr��
s	zScrollbar.__init__cCs|j�|jd|�pdS)a�Marks the element indicated by index as active.
        The only index values understood by this method are "arrow1",
        "slider", or "arrow2".  If any other value is specified then no
        element of the scrollbar will be active.  If index is not specified,
        the method returns the name of the element that is currently active,
        or None if no element is active.rNr�r�rrrr�
szScrollbar.activatecCs|j�|j�|jd||��S)znReturn the fractional change of the scrollbar setting if it
        would be moved by DELTAX or DELTAY pixels.rPr/)reZdeltaxZdeltayrrrrP�
s�zScrollbar.deltacCs|j�|j�|jd||��S)zRReturn the fractional value which corresponds to a slider
        position of X,Y.r�r/r�rrrr��
szScrollbar.fractioncCs|j�|jd||�S)zYReturn the element under position X,Y as one of
        "arrow1","slider","arrow2" or "".r-r�r�rrrr-�
szScrollbar.identifycCs|�|j�|jd��S)zZReturn the current fractional values (upper and lower end)
        of the slider position.r�)r}r2r�r�r�rrrr��
sz
Scrollbar.getcCs|j�|jd||�dS)ziSet the fractional values of the slider position (upper and
        lower ends as value between 0 and 1).r�Nr�r�rrrr��
sz
Scrollbar.set)N)rArBrCrkr�rrPr�r-r�r�rrrrr.�
s
	r.c@s�eZdZdZdifdd�Zdd�Zdd�Zd	d
�Zdkdd�Zdld
d�Z	dd�Z
dmdd�Zdd�Zdndd�Z
dd�Zdd�Zdd�Zdd�Zdodd �Zd!d"�Zdpd#d$�Zifd%d&�Zd'd(�Zd)d*�Zd+d,�Zdqd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zifd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dAdB�Z#drdCdD�Z$dEdF�Z%dGdH�Z&dsdIdJ�Z'dtdKdL�Z(dMdN�Z)dudOdP�Z*e*Z+dQdR�Z,dvdSdT�Z-dwdUdV�Z.dxdWdX�Z/dydYdZ�Z0dzd[d\�Z1d]d^�Z2d{d_d`�Z3dadb�Z4d|dcdd�Z5e5Z6ifdedf�Z7dgdh�Z8didj�Z9dS)}�Textz4Text widget which can display text in various forms.NcKst�||d||�dS)a�Construct a text widget with the parent MASTER.

        STANDARD OPTIONS

            background, borderwidth, cursor,
            exportselection, font, foreground,
            highlightbackground, highlightcolor,
            highlightthickness, insertbackground,
            insertborderwidth, insertofftime,
            insertontime, insertwidth, padx, pady,
            relief, selectbackground,
            selectborderwidth, selectforeground,
            setgrid, takefocus,
            xscrollcommand, yscrollcommand,

        WIDGET-SPECIFIC OPTIONS

            autoseparators, height, maxundo,
            spacing1, spacing2, spacing3,
            state, tabs, undo, width, wrap,

        r�Nr�r�rrrr��
sz
Text.__init__cCs|�|j�|jd|��pdS)z�Return a tuple of (x,y,width,height) which gives the bounding
        box of the visible part of the character at the given index.r�NrAr�rrrr��
s
��z	Text.bboxc	Cs|j�|j�|jd|||��S)z�Return whether between index INDEX1 and index INDEX2 the
        relation OP is satisfied. OP is one of <, <=, ==, >=, >, or !=.�comparer*)rer �opr!rrrr0�
s�zText.comparecGsVdd�|D�}|||g7}|jj|jdf|��p2d}|dk	rNt|�dkrN|fS|SdS)a�Counts the number of relevant things between the two indices.
        If index1 is after index2, the result will be a negative number
        (and this holds for each of the possible options).

        The actual items which are counted depends on the options given by
        args. The result is a list of integers, one for the result of each
        counting option given. Valid counting options are "chars",
        "displaychars", "displayindices", "displaylines", "indices",
        "lines", "xpixels" and "ypixels". There is an additional possible
        option "update", which if given then all subsequent options ensure
        that any possible out of date information is recalculated.cSsg|]}|�d�sd|�qS)r-r�)�
startswith)rJ�argrrrr�s
zText.count.<locals>.<listcomp>r|N�)r2r�r�r)rer r!r�rrrrr|�
sz
Text.countcCs6|dkr |j�|j�|jd��S|j�|jd|�dS)zjTurn on the internal consistency checks of the B-Tree inside the text
        widget according to BOOLEAN.N�debugr*r�rrrr5	sz
Text.debugcCs|j�|jd||�dS)z?Delete the characters between INDEX1 and INDEX2 (not included).r�Nr��rer r!rrrr�szText.deletecCs|�|j�|jd|��S)z�Return tuple (x,y,width,height,baseline) giving the bounding box
        and baseline position of the visible part of the line containing
        the character at INDEX.�	dlineinforAr�rrrr7szText.dlineinfoc
	Ks�g}d}d}|s$g}|fdd�}|}zzt|t�s>|�|�}}|d|g7}|D]}	||	rN|�d|	�qN|�|�|r�|�|�|jj|jdf|��|W�S|r�|�|�XdS)a�Return the contents of the widget between index1 and index2.

        The type of contents returned in filtered based on the keyword
        parameters; if 'all', 'image', 'mark', 'tag', 'text', or 'window' are
        given and true, then the corresponding items are returned. The result
        is a list of triples of the form (key, value, index). If none of the
        keywords are true then 'all' is used by default.

        If the 'command' argument is given, it is called once for each element
        of the list of triples, with the values of each triple serving as the
        arguments to the function. In this case the list is not returned.NcSs|�|||f�dSr�)rc)r6r
r�r%rrr�
append_triple/sz Text.dump.<locals>.append_triplez-commandr-�dump)r�rrr�rcr2r�r�)
rer r!rr�r�Z	func_namer%r8r6rrrr9s*


z	Text.dumpcGs|jj|jdf|��S)arInternal method

        This method controls the undo mechanism and
        the modified flag. The exact behavior of the
        command depends on the option argument that
        follows the edit argument. The following forms
        of the command are currently supported:

        edit_modified, edit_redo, edit_reset, edit_separator
        and edit_undo

        �editr�r�rrrr:Bs
z	Text.editcCs|�d|�S)a;Get or Set the modified flag

        If arg is not specified, returns the modified
        flag of the widget. The insert, delete, edit undo and
        edit redo commands or the user can set or clear the
        modified flag. If boolean is specified, sets the
        modified flag of the widget to arg.
        Zmodified�r:)rer3rrr�
edit_modifiedQs	zText.edit_modifiedcCs
|�d�S)aRedo the last undone edit

        When the undo option is true, reapplies the last
        undone edits provided no other edits were done since
        then. Generates an error when the redo stack is empty.
        Does nothing when the undo option is false.
        Zredor;r�rrr�	edit_redo\szText.edit_redocCs
|�d�S)z(Clears the undo and redo stacks
        �resetr;r�rrr�
edit_resetfszText.edit_resetcCs
|�d�S)znInserts a separator (boundary) on the undo stack.

        Does nothing when the undo option is false
        rr;r�rrr�edit_separatorkszText.edit_separatorcCs
|�d�S)aDUndoes the last edit action

        If the undo option is true. An edit action is defined
        as all the insert and delete commands that are recorded
        on the undo stack in between two separators. Generates
        an error when the undo stack is empty. Does nothing
        when the undo option is false
        Zundor;r�rrr�	edit_undors	zText.edit_undocCs|j�|jd||�S)z5Return the text from INDEX1 to INDEX2 (not included).r�r�r6rrrr�}szText.getcCsJ|dd�dkrd|}|dd�dkr4|dd�}|j�|jdd||�S)z9Return the value of OPTION of an embedded image at INDEX.Nrr-r�r�r�r�r�rrrr�
image_cget�s
zText.image_cgetcKs|�dd|f||�S)z%Configure an embedded image at INDEX.r�r�r�r�rrr�image_configure�szText.image_configurecKs"|jj|jdd|f|�||���S)z"Create an embedded image at INDEX.r�r@rir�rrr�image_create�s�
�zText.image_createcCs|j�|jdd�S)z3Return all names of embedded images in this widget.r�r�r�r�rrrr��szText.image_namescCst|j�|jd|��S)z1Return the index in the form line.char for INDEX.r�)rr2r�r�r�rrrr��sz
Text.indexcGs|j�|jd||f|�dS)z�Insert CHARS before the characters at INDEX. An additional
        tag can be given in ARGS. Additional CHARS and tags can follow in ARGS.r�Nr�)rer��charsr�rrrr��szText.insertcCs|j�|jdd||f�S)z�Change the gravity of a mark MARKNAME to DIRECTION (LEFT or RIGHT).
        Return the current value if None is given for DIRECTION.r�Zgravityr�)re�markName�	directionrrr�mark_gravity�s�zText.mark_gravitycCs|j�|j�|jdd��S)zReturn all mark names.r�r�rhr�rrr�
mark_names�s
�zText.mark_namescCs|j�|jdd||�dS)z0Set mark MARKNAME before the character at INDEX.r�r�Nr�)rerFr�rrr�mark_set�sz
Text.mark_setcGs|j�|jddf|�dS)zDelete all marks in MARKNAMES.r�ZunsetNr�)reZ	markNamesrrr�
mark_unset�szText.mark_unsetcCs|j�|jdd|�pdS)z-Return the name of the next mark after INDEX.r��nextNr�r�rrr�	mark_next�szText.mark_nextcCs|j�|jdd|�pdS)z2Return the name of the previous mark before INDEX.r�ZpreviousNr�r�rrr�
mark_previous�szText.mark_previouscKs&|jj|jdd|f|�||���dS)aCreates a peer text widget with the given newPathName, and any
        optional standard configuration options. By default the peer will
        have the same start and end line as the parent widget, but
        these can be overridden with the standard configuration options.�peerr@Nri)reZnewPathNamer&r�rrr�peer_create�s
�zText.peer_createcCs|j�|j�|jdd��S)zYReturns a list of peers of this widget (this does not include
        the widget itself).rOr�rhr�rrr�
peer_names�szText.peer_namescGs |jj|jd|||f|��dS)z�Replaces the range of characters between index1 and index2 with
        the given characters and tags specified by args.

        See the method insert for some more information about args, and the
        method delete for information about the indices.rNr�)rer r!rEr�rrrr�szText.replacecCs|j�|jdd||�dSr�r�r�rrrr��szText.scan_markcCs|j�|jdd||�dS)z~Adjust the view of the text to 10 times the
        difference between X and Y and the coordinates given in
        scan_mark.r�r�Nr�r�rrrr��szText.scan_dragtocCs�|jdg}|r|�d�|r&|�d�|r4|�d�|rB|�d�|rP|�d�|
r^|�d�|	rv|�d�|�|	�|r�|d	d
kr�|�d�|�|�|�|�|r�|�|�t|j�t|���S)z�Search PATTERN beginning from INDEX until STOPINDEX.
        Return the index of the first character of a match or an
        empty string.rz	-forwardsz
-backwardsz-exactz-regexpz-nocasez-elidez-countrr-r�)r�rcrr2r�r)rerr�Z	stopindexZforwardsZ	backwards�exactZregexpZnocaser|Zelider�rrrr�s.












zText.searchcCs|j�|jd|�dS)z3Scroll such that the character at INDEX is visible.rNr�r�rrrr�szText.seecGs |j�|jdd||f|�dS)z|Add tag TAGNAME to all characters between INDEX1 and index2 in ARGS.
        Additional pairs of indices may follow in ARGS.�tagr�Nr�)re�tagNamer r�rrr�tag_add�s�zText.tag_addcCs*|j�|jdd||d�|r&|�|�dS)zgUnbind for all characters with TAGNAME for event SEQUENCE  the
        function identified with FUNCID.rSrprZNrs)rerTrlrnrrrr��szText.tag_unbindcCs|�|jdd|f|||�S)a+Bind to all characters with TAGNAME at event SEQUENCE a call to function FUNC.

        An additional boolean parameter ADD specifies whether FUNC will be
        called additionally to the other bound function or whether it will
        replace the previous function. See bind for the return value.rSrprq)rerTrlr�r�rrrr�s
�z
Text.tag_bindcCsJ|dd�dkrd|}|dd�dkr4|dd�}|j�|jdd||�S)z+Return the value of OPTION for tag TAGNAME.Nrr-r�r�rSr�r�)rerTrrrr�tag_cget	s
z
Text.tag_cgetcKs|�dd|f||�S)zConfigure a tag TAGNAME.rSr�r�)rerTr&r�rrr�
tag_configureszText.tag_configurecGs|j�|jddf|�dS)zDelete all tags in TAGNAMES.rSr�Nr�)reZtagNamesrrr�
tag_deleteszText.tag_deletecCs|j�|jdd||�dS)z`Change the priority of tag TAGNAME such that it is lower
        than the priority of BELOWTHIS.rSrNr�)rerTrrrrr�szText.tag_lowercCs|j�|j�|jdd|��S)zReturn a list of all tag names.rSr�rhr�rrr�	tag_names s�zText.tag_namesc
Cs |j�|j�|jdd|||��S)z�Return a list of start and end index for the first sequence of
        characters between INDEX1 and INDEX2 which all have tag TAGNAME.
        The text is searched forward from INDEX1.rSZ	nextrangerh�rerTr r!rrr�
tag_nextrange%s�zText.tag_nextrangec
Cs |j�|j�|jdd|||��S)z�Return a list of start and end index for the first sequence of
        characters between INDEX1 and INDEX2 which all have tag TAGNAME.
        The text is searched backwards from INDEX1.rSZ	prevrangerhrZrrr�
tag_prevrange,s�zText.tag_prevrangecCs|j�|jdd||�dS)zaChange the priority of tag TAGNAME such that it is higher
        than the priority of ABOVETHIS.rSrNr�)rerTrrrrr�3s�zText.tag_raisecCs|j�|j�|jdd|��S)z7Return a list of ranges of text which have tag TAGNAME.rSZrangesrh)rerTrrr�
tag_ranges9s�zText.tag_rangescCs|j�|jdd|||�dS)zARemove tag TAGNAME from all characters between INDEX1 and INDEX2.rSr�Nr�rZrrr�
tag_remove>s�zText.tag_removecCsJ|dd�dkrd|}|dd�dkr4|dd�}|j�|jdd||�S)z:Return the value of OPTION of an embedded window at INDEX.Nrr-r�r�r�r�r�rrrr�window_cgetCs
zText.window_cgetcKs|�dd|f||�S)z&Configure an embedded window at INDEX.r�r�r�r�rrr�window_configureKszText.window_configurecKs&|j�|jdd|f|�||��dS)zCreate a window at INDEX.r�r@Nrir�rrr�
window_createQs

��zText.window_createcCs|j�|j�|jdd��S)z4Return all names of embedded windows in this widget.r�r�rhr�rrr�window_namesWs�zText.window_namescGs|j�|jddf|�dS)zObsolete function, use see.r�z
-pickplaceNr�)rerqrrr�yview_pickplace\szText.yview_pickplace)N)N)NN)N)N)N)N)NNNNNNNN)N)N)N)N)N)N)N)N)N)N):rArBrCrkr�r�r0r|r5r�r7r9r:r<r=r?r@rAr�rBrCrDr�r�r�rHrIrJrKrMrNrPrQrr�r�rrrUr�r�rVrWZ
tag_configrXr�rYr[r\r�r]r^r_r`Z
window_configrarbrcrrrrr/�
s~


(




�


	







r/c@s"eZdZdZddd�Zdd�ZdS)�_setitz>Internal class. It wraps the command in the widget OptionMenu.NcCs||_||_||_dSr�)�
_setit__value�_setit__var�_setit__callback)re�varr
r�rrrr�dsz_setit.__init__cGs*|j�|j�|jr&|j|jf|��dSr�)rfr�rergr�rrrr�isz_setit.__call__)Nr�rrrrrdas
rdc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�
OptionMenuz?OptionMenu which allows the user to select a value from a menu.c
Os�d|dtddd�}t�||d|�d|_t|ddd	�}|_|j|_|�d
�}d
|kr\|d
=|rtt	dt
t|����|j|t
|||�d�|D]}	|j|	t
||	|�d�q�||d<d
S)z�Construct an optionmenu widget with the parent MASTER, with
        the resource textvariable set to VARIABLE, the initially selected
        value VALUE, the other menu values VALUES and an additional
        keyword argument command.r,rr')ZborderwidthZtextvariableZindicatoronZreliefr�Zhighlightthicknessr(Z
tk_optionMenur
r)rYZtearoffrzunknown option -)r�rN)ZRAISEDr�r�r~r�_OptionMenu__menur�Zmenunamer�r�rLr0rrd)
rer�r�r
rR�kwargsr�r
r�r*rrrr�rs.�

�
�zOptionMenu.__init__cCs|dkr|jSt�||�S)Nr
)rjr�r�r�rrrr��szOptionMenu.__getitem__cCst�|�d|_dS)z,Destroy this widget and the associated menu.N)r'r�rjr�rrrr��s
zOptionMenu.destroyN)rArBrCrkr�r�r�rrrrriosric@sheZdZdZdZdidfdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
e
Zdd�Zdd�Z
dd�ZdS)�ImagezBase class for images.rNc	Ks�d|_|std�}t|d|�|_|s>tjd7_dtjf}|rT|rTt||f�}n|r\|}d}|��D]*\}}t|�r�|�	|�}|d||f}qh|j�
dd||f|�||_dS)	Nzcreate imager2rz	pyimage%rrr-r�r@)rYrsr`r2rl�_last_idr+r%r�r�r�)	reZimgtyperYr&r�r�r�r)r*rrrr��s$
zImage.__init__cCs|jSr�)rYr�rrrrF��z
Image.__str__cCs6|jr2z|j�dd|j�Wntk
r0YnXdS)Nr�r�)rYr2r�r�r�rrrr��s
z
Image.__del__cCs|j�|jdd||�dS�Nr�r-�r2r�rYr�rrrr��szImage.__setitem__cCs|j�|jdd|�Srorpr�rrrr��szImage.__getitem__cKsvd}t|���D]J\}}|dk	r|ddkr8|dd�}t|�rJ|�|�}|d||f}q|j�|jdf|�dS)zConfigure the image.rNr�r�r-r�)r+r%r�r�r2r�rY)rer�rr)r*rrrr��s
zImage.configurecCs|j�|j�dd|j��S)zReturn the height of the image.r�rX�r2r�r�rYr�rrrrX�s�zImage.heightcCs|j�dd|j�S)z7Return the type of the image, e.g. "photo" or "bitmap".r�r rpr�rrrr �sz
Image.typecCs|j�|j�dd|j��S)zReturn the width of the image.r�rWrqr�rrrrW�s�zImage.width)rArBrCrkrmr�rFr�r�r�r�r�rXr rWrrrrrl�srlc@s�eZdZdZdidfdd�Zdd�Zdd�Zd	d
�Zdd�Zddd�Z	ddd�Z
dd�Zddd�Zddd�Z
dd�Zdd�ZdS) �
PhotoImagez=Widget which can display images in PGM, PPM, GIF, PNG format.NcKstj|d|||f|�dS)ztCreate an image with NAME.

        Valid resource names: data, format, file, gamma, height, palette,
        width.ZphotoN�rlr��rerYr&r�r�rrrr��szPhotoImage.__init__cCs|j�|jd�dS)zDisplay a transparent image.�blankNrpr�rrrru�szPhotoImage.blankcCs|j�|jdd|�S)zReturn the value of OPTION.r�r-rp)rerrrrr��szPhotoImage.cgetcCs|j�|jdd|�S)Nr�r-rpr�rrrr��szPhotoImage.__getitem__cCs"t|jd�}|j�|d|j�|S)z;Return a new PhotoImage with the same image as this widget.r��copy�rrr2r�rY)re�	destImagerrrrv�szPhotoImage.copyrZcCs4t|jd�}|dkr|}|j�|d|jd||�|S)z�Return a new PhotoImage with the same image as this widget
        but zoom it with a factor of x in the X direction and y in the Y
        direction.  If y is not given, the default value is the same as x.
        r�rZrvz-zoomrw�rerUrVrxrrr�zoom�s
zPhotoImage.zoomcCs4t|jd�}|dkr|}|j�|d|jd||�|S)z�Return a new PhotoImage based on the same image as this widget
        but use only every Xth or Yth pixel.  If y is not given, the
        default value is the same as x.
        r�rZrvz
-subsamplerwryrrr�	subsample�s
zPhotoImage.subsamplecCs|j�|jd||�S)z8Return the color (red, green, blue) of the pixel at X,Y.r�rpr�rrrr�	szPhotoImage.getcCsH|jd|f}|r8|ddkr(|dd�}|dt|�}|j�|�dS)zzPut row formatted colors to image starting from
        position TO, e.g. image.put("{red green} {blue yellow}", to=(4,6))�putr�-torN)r}�rYrr2r�)rer�r�r�rrrr|
szPhotoImage.putcCs@|jd|f}|r|d|f}|r0|dt|�}|j�|�dS)zRWrite image to file FILENAME in FORMAT starting from
        position FROM_COORDS.�writez-format)z-fromNr~)re�filename�formatZfrom_coordsr�rrrrszPhotoImage.writec	Cs|j�|j�|jdd||��S)z/Return True if the pixel at x,y is transparent.�transparencyr�)r2r�r�rYr�rrr�transparency_get"s�zPhotoImage.transparency_getcCs|j�|jdd|||�dS)z)Set the transparency of the pixel at x,y.r�r�Nrp)rerUrVr�rrr�transparency_set'szPhotoImage.transparency_set)rZ)rZ)N)NN)rArBrCrkr�rur�r�rvrzr{r�r|rr�r�rrrrrr�s






rrc@s eZdZdZdidfdd�ZdS)�BitmapImagez.Widget which can display images in XBM format.NcKstj|d|||f|�dS)zqCreate a bitmap with NAME.

        Valid resource names: background, data, file, foreground, maskdata, maskfile.rNrsrtrrrr�/szBitmapImage.__init__r�rrrrr�,sr�cCstd�j}|�|�dd��S)Nzuse image_names()r�r��rsr2r.r��r2rrrr�6s
r�cCstd�j}|�|�dd��S)Nzuse image_types()r�r�r�r�rrrr�;s
r�c@s�eZdZdZdifdd�Zdd�Zd+dd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd,d!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�ZdS)-�Spinboxzspinbox widget.NcKst�||d||�dS)a�Construct a spinbox widget with the parent MASTER.

        STANDARD OPTIONS

            activebackground, background, borderwidth,
            cursor, exportselection, font, foreground,
            highlightbackground, highlightcolor,
            highlightthickness, insertbackground,
            insertborderwidth, insertofftime,
            insertontime, insertwidth, justify, relief,
            repeatdelay, repeatinterval,
            selectbackground, selectborderwidth
            selectforeground, takefocus, textvariable
            xscrollcommand.

        WIDGET-SPECIFIC OPTIONS

            buttonbackground, buttoncursor,
            buttondownrelief, buttonuprelief,
            command, disabledbackground,
            disabledforeground, format, from,
            invalidcommand, increment,
            readonlybackground, state, to,
            validate, validatecommand values,
            width, wrap,
        ZspinboxNr�r�rrrr�CszSpinbox.__init__cCs|�|j�|jd|��pdS)a�Return a tuple of X1,Y1,X2,Y2 coordinates for a
        rectangle which encloses the character given by index.

        The first two elements of the list give the x and y
        coordinates of the upper-left corner of the screen
        area covered by the character (in pixels relative
        to the widget) and the last two elements give the
        width and height of the character, in pixels. The
        bounding box may refer to a region outside the
        visible area of the window.
        r�NrAr�rrrr�`szSpinbox.bboxcCs|j�|jd||�S)aWDelete one or more elements of the spinbox.

        First is the index of the first character to delete,
        and last is the index of the character just after
        the last one to delete. If last isn't specified it
        defaults to first+1, i.e. a single character is
        deleted.  This command returns an empty string.
        r�r�r�rrrr�ns	zSpinbox.deletecCs|j�|jd�S)zReturns the spinbox's stringr�r�r�rrrr�yszSpinbox.getcCs|j�|jd|�S)z�Alter the position of the insertion cursor.

        The insertion cursor will be displayed just before
        the character given by index. Returns an empty string
        r�r�r�rrrr�}szSpinbox.icursorcCs|j�|jd||�S)z{Returns the name of the widget at position x, y

        Return value is one of: none, buttondown, buttonup, entry
        r-r�r�rrrr-�szSpinbox.identifycCs|j�|jd|�S)z;Returns the numerical index corresponding to index
        r�r�r�rrrr��sz
Spinbox.indexcCs|j�|jd||�S)zDInsert string s at index

         Returns an empty string.
        r�r�)rer�rfrrrr��szSpinbox.insertcCs|j�|jd|�S)z�Causes the specified element to be invoked

        The element could be buttondown or buttonup
        triggering the action associated with it.
        r�r��re�elementrrrr��szSpinbox.invokecGs |�|j�|jdf|��pdS)rr�rrAr�rrrr��s
��zSpinbox.scancCs|�d|�S)z�Records x and the current view in the spinbox window;

        used in conjunction with later scan dragto commands.
        Typically this command is associated with a mouse button
        press in the widget. It returns an empty string.
        r��r�r^rrrr��szSpinbox.scan_markcCs|�d|�S)a�Compute the difference between the given x argument
        and the x argument to the last scan mark command

        It then adjusts the view left or right by 10 times the
        difference in x-coordinates. This command is typically
        associated with mouse motion events in the widget, to
        produce the effect of dragging the spinbox at high speed
        through the window. The return value is an empty string.
        r�r�r^rrrr��s
zSpinbox.scan_dragtocGs |�|j�|jdf|��pdS)rr
rrAr�rrrr
�s
��zSpinbox.selectioncCs|�d|�S)a�Locate the end of the selection nearest to the character
        given by index,

        Then adjust that end of the selection to be at index
        (i.e including but not going beyond index). The other
        end of the selection is made the anchor point for future
        select to commands. If the selection isn't currently in
        the spinbox, then a new selection is created to include
        the characters between index and the most recent selection
        anchor point, inclusive.
        r��r
r�rrrr��szSpinbox.selection_adjustcCs
|�d�S)zsClear the selection

        If the selection isn't in this widget then the
        command has no effect.
        r�r�r�rrrr�szSpinbox.selection_clearcCs|j�|jdd|�S)z�Sets or gets the currently selected element.

        If a spinbutton element is specified, it will be
        displayed depressed.
        r
r�r�r�rrr�selection_element�szSpinbox.selection_elementcCs|�d|�dS)r�r�Nr�r�rrrr��szSpinbox.selection_fromcCs|j�|j�|jdd��S)zUReturn True if there are characters selected in the spinbox, False
        otherwise.r
r�r*r�rrrr��s�zSpinbox.selection_presentcCs|�d||�dS)r�r�Nr�r�rrrr��szSpinbox.selection_rangecCs|�d|�dS)r�r�Nr�r�rrrr��szSpinbox.selection_to)N)N)rArBrCrkr�r�r�r�r�r-r�r�r�r�r�r�r
r�rr�r�r�r�r�rrrrr�@s*
	
r�c@seZdZdZdifdd�ZdS)�
LabelFramezlabelframe widget.NcKst�||d||�dS)a�Construct a labelframe widget with the parent MASTER.

        STANDARD OPTIONS

            borderwidth, cursor, font, foreground,
            highlightbackground, highlightcolor,
            highlightthickness, padx, pady, relief,
            takefocus, text

        WIDGET-SPECIFIC OPTIONS

            background, class, colormap, container,
            height, labelanchor, labelwidget,
            visual, width
        Z
labelframeNr�r�rrrr��szLabelFrame.__init__r�rrrrr��sr�c@s�eZdZdZdifdd�Zdd�Zdd�ZeZd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd!dd�ZeZdd �ZdS)"�PanedWindowzpanedwindow widget.NcKst�||d||�dS)aTConstruct a panedwindow widget with the parent MASTER.

        STANDARD OPTIONS

            background, borderwidth, cursor, height,
            orient, relief, width

        WIDGET-SPECIFIC OPTIONS

            handlepad, handlesize, opaqueresize,
            sashcursor, sashpad, sashrelief,
            sashwidth, showhandle,
        ZpanedwindowNr�r�rrrr�
szPanedWindow.__init__cKs"|j�|jd|f|�|��dS)a+Add a child widget to the panedwindow in a new pane.

        The child argument is the name of the child widget
        followed by pairs of arguments that specify how to
        manage the windows. The possible options and values
        are the ones accepted by the paneconfigure method.
        r�Nri)rer&r�rrrr�szPanedWindow.addcCs|j�|jd|�dS)z�Remove the pane containing child from the panedwindow

        All geometry management options for child will be forgotten.
        rNr�)rer&rrrr�'szPanedWindow.removecCs|j�|jd||�S)a�Identify the panedwindow component at point x, y

        If the point is over a sash or a sash handle, the result
        is a two element list containing the index of the sash or
        handle, and a word indicating whether it is over a sash
        or a handle, such as {0 sash} or {2 handle}. If the point
        is over any other part of the panedwindow, the result is
        an empty list.
        r-r�r�rrrr-0s
zPanedWindow.identifycGs |�|j�|jdf|��pdS)r�proxyrrAr�rrrr�<s
��zPanedWindow.proxycCs
|�d�S)zBReturn the x and y pair of the most recent proxy location
        �coord�r�r�rrr�proxy_coordAszPanedWindow.proxy_coordcCs
|�d�S)z+Remove the proxy from the display.
        rr�r�rrr�proxy_forgetFszPanedWindow.proxy_forgetcCs|�d||�S)z:Place the proxy at the given x and y coordinates.
        r�r�r�rrr�proxy_placeKszPanedWindow.proxy_placecGs |�|j�|jdf|��pdS)r�sashrrAr�rrrr�Ps
��zPanedWindow.sashcCs|�d|�S)aAReturn the current x and y pair for the sash given by index.

        Index must be an integer between 0 and 1 less than the
        number of panes in the panedwindow. The coordinates given are
        those of the top left corner of the region containing the sash.
        pathName sash dragto index x y This command computes the
        difference between the given coordinates and the coordinates
        given to the last sash coord command for the given sash. It then
        moves that sash the computed difference. The return value is the
        empty string.
        r��r�r�rrr�
sash_coordUszPanedWindow.sash_coordcCs|�d|�S)zRecords x and y for the sash given by index;

        Used in conjunction with later dragto commands to move the sash.
        r�r�r�rrr�	sash_markcszPanedWindow.sash_markcCs|�d|||�S)z?Place the sash given by index at the given coordinates
        r�r�)rer�rUrVrrr�
sash_placejszPanedWindow.sash_placecCs|j�|jdf|d|f�S)zwQuery a management option for window.

        Option may be any value allowed by the paneconfigure subcommand
        �panecgetr-r�)rer&rrrrr�os�zPanedWindow.panecgetcKsd|dkr|s|�|jd|�St|t�r@|s@|�|jd|d|�S|j�|jd|f|�||��dS)a�
Query or modify the management options for window.

        If no option is specified, returns a list describing all
        of the available options for pathName.  If option is
        specified with no value, then the command returns a list
        describing the one named option (this list will be identical
        to the corresponding sublist of the value returned if no
        option is specified). If one or more option-value pairs are
        specified, then the command modifies the given widget
        option(s) to have the given value(s); in this case the
        command returns an empty string. The following options
        are supported:

        after window
            Insert the window after the window specified. window
            should be the name of a window already managed by pathName.
        before window
            Insert the window before the window specified. window
            should be the name of a window already managed by pathName.
        height size
            Specify a height for the window. The height will be the
            outer dimension of the window including its border, if
            any. If size is an empty string, or if -height is not
            specified, then the height requested internally by the
            window will be used initially; the height may later be
            adjusted by the movement of sashes in the panedwindow.
            Size may be any value accepted by Tk_GetPixels.
        minsize n
            Specifies that the size of the window cannot be made
            less than n. This constraint only affects the size of
            the widget in the paned dimension -- the x dimension
            for horizontal panedwindows, the y dimension for
            vertical panedwindows. May be any value accepted by
            Tk_GetPixels.
        padx n
            Specifies a non-negative value indicating how much
            extra space to leave on each side of the window in
            the X-direction. The value may have any of the forms
            accepted by Tk_GetPixels.
        pady n
            Specifies a non-negative value indicating how much
            extra space to leave on each side of the window in
            the Y-direction. The value may have any of the forms
            accepted by Tk_GetPixels.
        sticky style
            If a window's pane is larger than the requested
            dimensions of the window, this option may be used
            to position (or stretch) the window within its pane.
            Style is a string that contains zero or more of the
            characters n, s, e or w. The string can optionally
            contains spaces or commas, but they are ignored. Each
            letter refers to a side (north, south, east, or west)
            that the window will "stick" to. If both n and s
            (or e and w) are specified, the window will be
            stretched to fill the entire height (or width) of
            its cavity.
        width size
            Specify a width for the window. The width will be
            the outer dimension of the window including its
            border, if any. If size is an empty string, or
            if -width is not specified, then the width requested
            internally by the window will be used initially; the
            width may later be adjusted by the movement of sashes
            in the panedwindow. Size may be any value accepted by
            Tk_GetPixels.

        N�
paneconfigurer-)r�r�rrr�r2r�r�r�rrrr�wsD�
�zPanedWindow.paneconfigurecCs|j�|j�|jd��S)z+Returns an ordered list of the child panes.�panesrhr�rrrr��szPanedWindow.panes)N)rArBrCrkr�r�r�rr-r�r�r�r�r�r�r�r�r�r�Z
paneconfigr�rrrrr�
s$

Lr�cCs�t�}dt}|d7}t||d�}|��t|d|fdd�d�}|��||_t|d|jd�}|��|��|��|�	�|�
�dS)	NzThis is Tcl/Tk version %su
This should be a cedilla: ç�r�z	Click me!cSs|jjd|jdd�S)Nz[%s]r�r�)�testr�)rrrrr�<lambda>�s�z_test.<locals>.<lambda>)r�rZQUIT)ro�
TclVersionr�r�rDr�r�rr!rr�)rrr�r�r�r{rrr�_test�s 
�r��__main__)TN)N)r)r)NNror)Vrk�enumr�r�r�Ztkinter.constants�rerA�floatrPZ	TkVersionrQr�ZREADABLEZWRITABLEZ	EXCEPTION�compiler�ASCIIrr
rrr"r+r7r�Enumr8rGrlrmrnrsrvrzr�r{r�r�r�r�r�rar�r�r�r�r�r�r�r�rorgrhrqrvr{r�r�rDr�r�r�r�r�rrr'r)r+r,r.r/rdrirlrrr�r�r�r�r�r�r�rArrrr�<module>s� 





,R

	6

q2~
.37?/8$Vt!'2'BT
3C
tkinter/__pycache__/__main__.cpython-38.pyc000064400000000462151153537530014616 0ustar00U

e5d��@s<dZddlZejd�d�r&dejd<ddlmZe�dS)zMain entry point�Nz__main__.pyzpython -m tkinter�)�_test)�__doc__�sys�argv�endswith�r�main�r
r
�(/usr/lib64/python3.8/tkinter/__main__.py�<module>s

tkinter/__pycache__/colorchooser.cpython-38.opt-2.pyc000064400000002103151153537530016531 0ustar00U

e5dA
�@s>ddlmZGdd�de�Zd	dd�Zedkr:ede��dS)
�)�Dialogc@s eZdZdZdd�Zdd�ZdS)�ChooserZtk_chooseColorcCs@z&|jd}t|t�r$d||jd<Wntk
r:YnXdS)N�initialcolorz
#%02x%02x%02x)�options�
isinstance�tuple�KeyError)�self�color�r�,/usr/lib64/python3.8/tkinter/colorchooser.py�_fixoptions!s

zChooser._fixoptionscCs>|rt|�sdS|�|�\}}}|d|d|dft|�fS)N)NN�)�strZ	winfo_rgb)r	Zwidget�result�r�g�brrr�
_fixresult.szChooser._fixresultN)�__name__�
__module__�__qualname__Zcommandr
rrrrrrs
rNcKs"|r|��}||d<tf|���S)Nr)�copyrZshow)r
rrrr�askcolorBsr�__main__r
)N)Ztkinter.commondialogrrrr�printrrrr�<module>s3
tkinter/__pycache__/colorchooser.cpython-38.pyc000064400000004316151153537530015601 0ustar00U

e5dA
�@s>ddlmZGdd�de�Zd	dd�Zedkr:ede��dS)
�)�Dialogc@s$eZdZdZdZdd�Zdd�ZdS)�Choosera�Create a dialog for the tk_chooseColor command.

    Args:
        master: The master widget for this dialog.  If not provided,
            defaults to options['parent'] (if defined).
        options: Dictionary of options for the tk_chooseColor call.
            initialcolor: Specifies the selected color when the
                dialog is first displayed.  This can be a tk color
                string or a 3-tuple of ints in the range (0, 255)
                for an RGB triplet.
            parent: The parent window of the color dialog.  The
                color dialog is displayed on top of this.
            title: A string for the title of the dialog box.
    Ztk_chooseColorcCs@z&|jd}t|t�r$d||jd<Wntk
r:YnXdS)zvEnsure initialcolor is a tk color string.

        Convert initialcolor from a RGB triplet to a color string.
        �initialcolorz
#%02x%02x%02xN)�options�
isinstance�tuple�KeyError)�self�color�r�,/usr/lib64/python3.8/tkinter/colorchooser.py�_fixoptions!s

zChooser._fixoptionscCs>|rt|�sdS|�|�\}}}|d|d|dft|�fS)z�Adjust result returned from call to tk_chooseColor.

        Return both an RGB tuple of ints in the range (0, 255) and the
        tk color string in the form #rrggbb.
        )NN�)�strZ	winfo_rgb)r	Zwidget�result�r�g�brrr�
_fixresult.szChooser._fixresultN)�__name__�
__module__�__qualname__�__doc__Zcommandr
rrrrrrs
rNcKs"|r|��}||d<tf|���S)z�Display dialog window for selection of a color.

    Convenience wrapper for the Chooser class.  Displays the color
    chooser dialog with color as the initial value.
    r)�copyrZshow)r
rrrr�askcolorBsr�__main__r
)N)Ztkinter.commondialogrrrr�printrrrr�<module>s3
tkinter/__pycache__/font.cpython-38.opt-2.pyc000064400000012005151153537530015000 0ustar00U

e5d@�@szdZddlZddlZdZdZdZdZdd�ZGd	d
�d
�Zd dd�Z	d!d
d�Z
edk�rve��Z
edded�Zee���ee�d��ee�d��ee���ee�d��ee�d��ee
��ee�d�e�d��eeje
d��edd�Zee�d�ejde
d��eje
ded�Ze��eje
de
jd�Ze��eedd���Zejed�ejed�e��dS)"z0.9�NZnormalZroman�boldZitaliccCst|dd�S)NT)�name�exists)�Font�r�r�$/usr/lib64/python3.8/tkinter/font.py�
nametofontsr	c@s�eZdZe�d�Zdd�Zdd�Zdd�Zd"d
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zd#dd�Zdd�Zdd�ZeZd$dd�Zd d!�ZdS)%r�cCs:g}|��D]$\}}|�d|�|�t|��qt|�S�N�-)�items�append�str�tuple)�self�kw�options�k�vrrr�_set1s
z	Font._setcCs$g}|D]}|�d|�qt|�Sr)rr)r�argsrrrrr�_get8sz	Font._getcCs:i}tdt|�d�D] }||d|||dd�<q|S)Nr�r
)�range�len)rrr�irrr�_mkdict>szFont._mkdictNFcKs�|st�d�}t|d|�}|r4|�|�dd|��}n
|�|�}|sTdtt|j��}||_	|r�d|_
|j	|�|�dd��kr�tj�d|j	f��|r�|jdd|j	f|��n|jdd	|j	f|��d
|_
||_
|j|_|j|_dS)Nzuse font�tk�font�actualF�namesz$named font %s does not already exist�	configureZcreateT)�tkinter�_get_default_root�getattr�	splitlist�callrr�next�counterr�delete_fontZ_tkinterZTclError�_tk�_split�_call)r�rootrrrrrrrr�__init__Ds,


�z
Font.__init__cCs|jS�Nr�rrrr�__str__cszFont.__str__cCs&t|t�stS|j|jko$|j|jkSr0)�
isinstancer�NotImplementedrr+)r�otherrrr�__eq__fs
zFont.__eq__cCs
|�|�Sr0)�cget)r�keyrrr�__getitem__kszFont.__getitem__cCs|jf||i�dSr0)r")rr8�valuerrr�__setitem__nszFont.__setitem__cCs4z|jr|�dd|j�Wntk
r.YnXdS)Nr�delete)r*r-r�	Exceptionr1rrr�__del__qs
zFont.__del__cCst|jf|���Sr0)rr+r r1rrr�copyxsz	Font.copycCs^d}|rd|f}|r8|d|f}|jdd|jf|��S|�|�|jdd|jf|����SdS)Nr�
-displayofrrr )r-rrr,)r�option�	displayofrrrrr |s�zFont.actualcCs|�dd|jd|�S)Nr�configr)r-r)rrArrrr7�sz	Font.cgetc	KsB|r"|jdd|jf|�|���n|�|�|�dd|j���SdS)NrrC)r-rrrr,)rrrrrrC�s��zFont.configcCs2|f}|rd||f}|j�|jdd|jf|���S)Nr@r�measure)r+�getintr-r)r�textrBrrrrrD�s
zFont.measurecOs�d}|�dd�}|rd|f}|rL||�|�}|j�|jdd|jf|���S|�|jdd|jf|���}i}tdt|�d�D](}|j�||d�|||dd�<q||SdS)	NrrBr@r�metricsrrr
)	�poprr+rEr-rr,rr)rrrrrB�resrrrrrG�s�&zFont.metrics)NNNF)NN)N)�__name__�
__module__�__qualname__�	itertools�countr)rrrr/r2r6r9r;r>r?r r7rCr"rDrGrrrrrs"


	
rcCs6|st�d�}d}|rd|f}|j�|jjd|���S)Nzuse font.families()rr@r�families)rrO�r#r$rr&r')r.rBrrrrrO�s
rOcCs$|st�d�}|j�|j�dd��S)Nzuse font.names()rr!rP)r.rrrr!�s
r!�__main__�times�)�family�size�weightrTrVZhelloZ	linespace)rB)ZCourier�r)rzHello, world)rFrzQuit!)rFZcommandr)rV)NN)N)�__version__rMr#ZNORMALZROMANZBOLDZITALICr	rrOr!rJZTkr.�f�printr rCr7rDrGZLabel�wZpackZButtonZdestroyr?ZfbZmainlooprrrr�<module>sB






tkinter/scrolledtext.py000064400000003430151153537530011322 0ustar00"""A ScrolledText widget feels like a text widget but also has a
vertical scroll bar on its right.  (Later, options may be added to
add a horizontal bar as well, to make the bars disappear
automatically when not needed, to move them to the other side of the
window, etc.)

Configuration options are passed to the Text widget.
A Frame widget is inserted between the master and the text, to hold
the Scrollbar widget.
Most methods calls are inherited from the Text widget; Pack, Grid and
Place methods are redirected to the Frame widget however.
"""

__all__ = ['ScrolledText']

from tkinter import Frame, Text, Scrollbar, Pack, Grid, Place
from tkinter.constants import RIGHT, LEFT, Y, BOTH


class ScrolledText(Text):
    def __init__(self, master=None, **kw):
        self.frame = Frame(master)
        self.vbar = Scrollbar(self.frame)
        self.vbar.pack(side=RIGHT, fill=Y)

        kw.update({'yscrollcommand': self.vbar.set})
        Text.__init__(self, self.frame, **kw)
        self.pack(side=LEFT, fill=BOTH, expand=True)
        self.vbar['command'] = self.yview

        # Copy geometry methods of self.frame without overriding Text
        # methods -- hack!
        text_meths = vars(Text).keys()
        methods = vars(Pack).keys() | vars(Grid).keys() | vars(Place).keys()
        methods = methods.difference(text_meths)

        for m in methods:
            if m[0] != '_' and m != 'config' and m != 'configure':
                setattr(self, m, getattr(self.frame, m))

    def __str__(self):
        return str(self.frame)


def example():
    from tkinter.constants import END

    stext = ScrolledText(bg='white', height=10)
    stext.insert(END, __doc__)
    stext.pack(fill=BOTH, side=LEFT, expand=True)
    stext.focus_set()
    stext.mainloop()


if __name__ == "__main__":
    example()
_compat_pickle.py000064400000021055151153537530010102 0ustar00# This module is used to map the old Python 2 names to the new names used in
# Python 3 for the pickle module.  This needed to make pickle streams
# generated with Python 2 loadable by Python 3.

# This is a copy of lib2to3.fixes.fix_imports.MAPPING.  We cannot import
# lib2to3 and use the mapping defined there, because lib2to3 uses pickle.
# Thus, this could cause the module to be imported recursively.
IMPORT_MAPPING = {
    '__builtin__' : 'builtins',
    'copy_reg': 'copyreg',
    'Queue': 'queue',
    'SocketServer': 'socketserver',
    'ConfigParser': 'configparser',
    'repr': 'reprlib',
    'tkFileDialog': 'tkinter.filedialog',
    'tkSimpleDialog': 'tkinter.simpledialog',
    'tkColorChooser': 'tkinter.colorchooser',
    'tkCommonDialog': 'tkinter.commondialog',
    'Dialog': 'tkinter.dialog',
    'Tkdnd': 'tkinter.dnd',
    'tkFont': 'tkinter.font',
    'tkMessageBox': 'tkinter.messagebox',
    'ScrolledText': 'tkinter.scrolledtext',
    'Tkconstants': 'tkinter.constants',
    'Tix': 'tkinter.tix',
    'ttk': 'tkinter.ttk',
    'Tkinter': 'tkinter',
    'markupbase': '_markupbase',
    '_winreg': 'winreg',
    'thread': '_thread',
    'dummy_thread': '_dummy_thread',
    'dbhash': 'dbm.bsd',
    'dumbdbm': 'dbm.dumb',
    'dbm': 'dbm.ndbm',
    'gdbm': 'dbm.gnu',
    'xmlrpclib': 'xmlrpc.client',
    'SimpleXMLRPCServer': 'xmlrpc.server',
    'httplib': 'http.client',
    'htmlentitydefs' : 'html.entities',
    'HTMLParser' : 'html.parser',
    'Cookie': 'http.cookies',
    'cookielib': 'http.cookiejar',
    'BaseHTTPServer': 'http.server',
    'test.test_support': 'test.support',
    'commands': 'subprocess',
    'urlparse' : 'urllib.parse',
    'robotparser' : 'urllib.robotparser',
    'urllib2': 'urllib.request',
    'anydbm': 'dbm',
    '_abcoll' : 'collections.abc',
}


# This contains rename rules that are easy to handle.  We ignore the more
# complex stuff (e.g. mapping the names in the urllib and types modules).
# These rules should be run before import names are fixed.
NAME_MAPPING = {
    ('__builtin__', 'xrange'):     ('builtins', 'range'),
    ('__builtin__', 'reduce'):     ('functools', 'reduce'),
    ('__builtin__', 'intern'):     ('sys', 'intern'),
    ('__builtin__', 'unichr'):     ('builtins', 'chr'),
    ('__builtin__', 'unicode'):    ('builtins', 'str'),
    ('__builtin__', 'long'):       ('builtins', 'int'),
    ('itertools', 'izip'):         ('builtins', 'zip'),
    ('itertools', 'imap'):         ('builtins', 'map'),
    ('itertools', 'ifilter'):      ('builtins', 'filter'),
    ('itertools', 'ifilterfalse'): ('itertools', 'filterfalse'),
    ('itertools', 'izip_longest'): ('itertools', 'zip_longest'),
    ('UserDict', 'IterableUserDict'): ('collections', 'UserDict'),
    ('UserList', 'UserList'): ('collections', 'UserList'),
    ('UserString', 'UserString'): ('collections', 'UserString'),
    ('whichdb', 'whichdb'): ('dbm', 'whichdb'),
    ('_socket', 'fromfd'): ('socket', 'fromfd'),
    ('_multiprocessing', 'Connection'): ('multiprocessing.connection', 'Connection'),
    ('multiprocessing.process', 'Process'): ('multiprocessing.context', 'Process'),
    ('multiprocessing.forking', 'Popen'): ('multiprocessing.popen_fork', 'Popen'),
    ('urllib', 'ContentTooShortError'): ('urllib.error', 'ContentTooShortError'),
    ('urllib', 'getproxies'): ('urllib.request', 'getproxies'),
    ('urllib', 'pathname2url'): ('urllib.request', 'pathname2url'),
    ('urllib', 'quote_plus'): ('urllib.parse', 'quote_plus'),
    ('urllib', 'quote'): ('urllib.parse', 'quote'),
    ('urllib', 'unquote_plus'): ('urllib.parse', 'unquote_plus'),
    ('urllib', 'unquote'): ('urllib.parse', 'unquote'),
    ('urllib', 'url2pathname'): ('urllib.request', 'url2pathname'),
    ('urllib', 'urlcleanup'): ('urllib.request', 'urlcleanup'),
    ('urllib', 'urlencode'): ('urllib.parse', 'urlencode'),
    ('urllib', 'urlopen'): ('urllib.request', 'urlopen'),
    ('urllib', 'urlretrieve'): ('urllib.request', 'urlretrieve'),
    ('urllib2', 'HTTPError'): ('urllib.error', 'HTTPError'),
    ('urllib2', 'URLError'): ('urllib.error', 'URLError'),
}

PYTHON2_EXCEPTIONS = (
    "ArithmeticError",
    "AssertionError",
    "AttributeError",
    "BaseException",
    "BufferError",
    "BytesWarning",
    "DeprecationWarning",
    "EOFError",
    "EnvironmentError",
    "Exception",
    "FloatingPointError",
    "FutureWarning",
    "GeneratorExit",
    "IOError",
    "ImportError",
    "ImportWarning",
    "IndentationError",
    "IndexError",
    "KeyError",
    "KeyboardInterrupt",
    "LookupError",
    "MemoryError",
    "NameError",
    "NotImplementedError",
    "OSError",
    "OverflowError",
    "PendingDeprecationWarning",
    "ReferenceError",
    "RuntimeError",
    "RuntimeWarning",
    # StandardError is gone in Python 3, so we map it to Exception
    "StopIteration",
    "SyntaxError",
    "SyntaxWarning",
    "SystemError",
    "SystemExit",
    "TabError",
    "TypeError",
    "UnboundLocalError",
    "UnicodeDecodeError",
    "UnicodeEncodeError",
    "UnicodeError",
    "UnicodeTranslateError",
    "UnicodeWarning",
    "UserWarning",
    "ValueError",
    "Warning",
    "ZeroDivisionError",
)

try:
    WindowsError
except NameError:
    pass
else:
    PYTHON2_EXCEPTIONS += ("WindowsError",)

for excname in PYTHON2_EXCEPTIONS:
    NAME_MAPPING[("exceptions", excname)] = ("builtins", excname)

MULTIPROCESSING_EXCEPTIONS = (
    'AuthenticationError',
    'BufferTooShort',
    'ProcessError',
    'TimeoutError',
)

for excname in MULTIPROCESSING_EXCEPTIONS:
    NAME_MAPPING[("multiprocessing", excname)] = ("multiprocessing.context", excname)

# Same, but for 3.x to 2.x
REVERSE_IMPORT_MAPPING = dict((v, k) for (k, v) in IMPORT_MAPPING.items())
assert len(REVERSE_IMPORT_MAPPING) == len(IMPORT_MAPPING)
REVERSE_NAME_MAPPING = dict((v, k) for (k, v) in NAME_MAPPING.items())
assert len(REVERSE_NAME_MAPPING) == len(NAME_MAPPING)

# Non-mutual mappings.

IMPORT_MAPPING.update({
    'cPickle': 'pickle',
    '_elementtree': 'xml.etree.ElementTree',
    'FileDialog': 'tkinter.filedialog',
    'SimpleDialog': 'tkinter.simpledialog',
    'DocXMLRPCServer': 'xmlrpc.server',
    'SimpleHTTPServer': 'http.server',
    'CGIHTTPServer': 'http.server',
    # For compatibility with broken pickles saved in old Python 3 versions
    'UserDict': 'collections',
    'UserList': 'collections',
    'UserString': 'collections',
    'whichdb': 'dbm',
    'StringIO':  'io',
    'cStringIO': 'io',
})

REVERSE_IMPORT_MAPPING.update({
    '_bz2': 'bz2',
    '_dbm': 'dbm',
    '_functools': 'functools',
    '_gdbm': 'gdbm',
    '_pickle': 'pickle',
})

NAME_MAPPING.update({
    ('__builtin__', 'basestring'): ('builtins', 'str'),
    ('exceptions', 'StandardError'): ('builtins', 'Exception'),
    ('UserDict', 'UserDict'): ('collections', 'UserDict'),
    ('socket', '_socketobject'): ('socket', 'SocketType'),
})

REVERSE_NAME_MAPPING.update({
    ('_functools', 'reduce'): ('__builtin__', 'reduce'),
    ('tkinter.filedialog', 'FileDialog'): ('FileDialog', 'FileDialog'),
    ('tkinter.filedialog', 'LoadFileDialog'): ('FileDialog', 'LoadFileDialog'),
    ('tkinter.filedialog', 'SaveFileDialog'): ('FileDialog', 'SaveFileDialog'),
    ('tkinter.simpledialog', 'SimpleDialog'): ('SimpleDialog', 'SimpleDialog'),
    ('xmlrpc.server', 'ServerHTMLDoc'): ('DocXMLRPCServer', 'ServerHTMLDoc'),
    ('xmlrpc.server', 'XMLRPCDocGenerator'):
        ('DocXMLRPCServer', 'XMLRPCDocGenerator'),
    ('xmlrpc.server', 'DocXMLRPCRequestHandler'):
        ('DocXMLRPCServer', 'DocXMLRPCRequestHandler'),
    ('xmlrpc.server', 'DocXMLRPCServer'):
        ('DocXMLRPCServer', 'DocXMLRPCServer'),
    ('xmlrpc.server', 'DocCGIXMLRPCRequestHandler'):
        ('DocXMLRPCServer', 'DocCGIXMLRPCRequestHandler'),
    ('http.server', 'SimpleHTTPRequestHandler'):
        ('SimpleHTTPServer', 'SimpleHTTPRequestHandler'),
    ('http.server', 'CGIHTTPRequestHandler'):
        ('CGIHTTPServer', 'CGIHTTPRequestHandler'),
    ('_socket', 'socket'): ('socket', '_socketobject'),
})

PYTHON3_OSERROR_EXCEPTIONS = (
    'BrokenPipeError',
    'ChildProcessError',
    'ConnectionAbortedError',
    'ConnectionError',
    'ConnectionRefusedError',
    'ConnectionResetError',
    'FileExistsError',
    'FileNotFoundError',
    'InterruptedError',
    'IsADirectoryError',
    'NotADirectoryError',
    'PermissionError',
    'ProcessLookupError',
    'TimeoutError',
)

for excname in PYTHON3_OSERROR_EXCEPTIONS:
    REVERSE_NAME_MAPPING[('builtins', excname)] = ('exceptions', 'OSError')

PYTHON3_IMPORTERROR_EXCEPTIONS = (
    'ModuleNotFoundError',
)

for excname in PYTHON3_IMPORTERROR_EXCEPTIONS:
    REVERSE_NAME_MAPPING[('builtins', excname)] = ('exceptions', 'ImportError')
zipfile.py000064400000253260151153537530006600 0ustar00"""
Read and write ZIP files.

XXX references to utf-8 need further investigation.
"""
import binascii
import functools
import importlib.util
import io
import itertools
import os
import posixpath
import shutil
import stat
import struct
import sys
import threading
import time
import contextlib

try:
    import zlib # We may need its compression method
    crc32 = zlib.crc32
except ImportError:
    zlib = None
    crc32 = binascii.crc32

try:
    import bz2 # We may need its compression method
except ImportError:
    bz2 = None

try:
    import lzma # We may need its compression method
except ImportError:
    lzma = None

__all__ = ["BadZipFile", "BadZipfile", "error",
           "ZIP_STORED", "ZIP_DEFLATED", "ZIP_BZIP2", "ZIP_LZMA",
           "is_zipfile", "ZipInfo", "ZipFile", "PyZipFile", "LargeZipFile",
           "Path"]

class BadZipFile(Exception):
    pass


class LargeZipFile(Exception):
    """
    Raised when writing a zipfile, the zipfile requires ZIP64 extensions
    and those extensions are disabled.
    """

error = BadZipfile = BadZipFile      # Pre-3.2 compatibility names


ZIP64_LIMIT = (1 << 31) - 1
ZIP_FILECOUNT_LIMIT = (1 << 16) - 1
ZIP_MAX_COMMENT = (1 << 16) - 1

# constants for Zip file compression methods
ZIP_STORED = 0
ZIP_DEFLATED = 8
ZIP_BZIP2 = 12
ZIP_LZMA = 14
# Other ZIP compression methods not supported

DEFAULT_VERSION = 20
ZIP64_VERSION = 45
BZIP2_VERSION = 46
LZMA_VERSION = 63
# we recognize (but not necessarily support) all features up to that version
MAX_EXTRACT_VERSION = 63

# Below are some formats and associated data for reading/writing headers using
# the struct module.  The names and structures of headers/records are those used
# in the PKWARE description of the ZIP file format:
#     http://www.pkware.com/documents/casestudies/APPNOTE.TXT
# (URL valid as of January 2008)

# The "end of central directory" structure, magic number, size, and indices
# (section V.I in the format document)
structEndArchive = b"<4s4H2LH"
stringEndArchive = b"PK\005\006"
sizeEndCentDir = struct.calcsize(structEndArchive)

_ECD_SIGNATURE = 0
_ECD_DISK_NUMBER = 1
_ECD_DISK_START = 2
_ECD_ENTRIES_THIS_DISK = 3
_ECD_ENTRIES_TOTAL = 4
_ECD_SIZE = 5
_ECD_OFFSET = 6
_ECD_COMMENT_SIZE = 7
# These last two indices are not part of the structure as defined in the
# spec, but they are used internally by this module as a convenience
_ECD_COMMENT = 8
_ECD_LOCATION = 9

# The "central directory" structure, magic number, size, and indices
# of entries in the structure (section V.F in the format document)
structCentralDir = "<4s4B4HL2L5H2L"
stringCentralDir = b"PK\001\002"
sizeCentralDir = struct.calcsize(structCentralDir)

# indexes of entries in the central directory structure
_CD_SIGNATURE = 0
_CD_CREATE_VERSION = 1
_CD_CREATE_SYSTEM = 2
_CD_EXTRACT_VERSION = 3
_CD_EXTRACT_SYSTEM = 4
_CD_FLAG_BITS = 5
_CD_COMPRESS_TYPE = 6
_CD_TIME = 7
_CD_DATE = 8
_CD_CRC = 9
_CD_COMPRESSED_SIZE = 10
_CD_UNCOMPRESSED_SIZE = 11
_CD_FILENAME_LENGTH = 12
_CD_EXTRA_FIELD_LENGTH = 13
_CD_COMMENT_LENGTH = 14
_CD_DISK_NUMBER_START = 15
_CD_INTERNAL_FILE_ATTRIBUTES = 16
_CD_EXTERNAL_FILE_ATTRIBUTES = 17
_CD_LOCAL_HEADER_OFFSET = 18

# The "local file header" structure, magic number, size, and indices
# (section V.A in the format document)
structFileHeader = "<4s2B4HL2L2H"
stringFileHeader = b"PK\003\004"
sizeFileHeader = struct.calcsize(structFileHeader)

_FH_SIGNATURE = 0
_FH_EXTRACT_VERSION = 1
_FH_EXTRACT_SYSTEM = 2
_FH_GENERAL_PURPOSE_FLAG_BITS = 3
_FH_COMPRESSION_METHOD = 4
_FH_LAST_MOD_TIME = 5
_FH_LAST_MOD_DATE = 6
_FH_CRC = 7
_FH_COMPRESSED_SIZE = 8
_FH_UNCOMPRESSED_SIZE = 9
_FH_FILENAME_LENGTH = 10
_FH_EXTRA_FIELD_LENGTH = 11

# The "Zip64 end of central directory locator" structure, magic number, and size
structEndArchive64Locator = "<4sLQL"
stringEndArchive64Locator = b"PK\x06\x07"
sizeEndCentDir64Locator = struct.calcsize(structEndArchive64Locator)

# The "Zip64 end of central directory" record, magic number, size, and indices
# (section V.G in the format document)
structEndArchive64 = "<4sQ2H2L4Q"
stringEndArchive64 = b"PK\x06\x06"
sizeEndCentDir64 = struct.calcsize(structEndArchive64)

_CD64_SIGNATURE = 0
_CD64_DIRECTORY_RECSIZE = 1
_CD64_CREATE_VERSION = 2
_CD64_EXTRACT_VERSION = 3
_CD64_DISK_NUMBER = 4
_CD64_DISK_NUMBER_START = 5
_CD64_NUMBER_ENTRIES_THIS_DISK = 6
_CD64_NUMBER_ENTRIES_TOTAL = 7
_CD64_DIRECTORY_SIZE = 8
_CD64_OFFSET_START_CENTDIR = 9

_DD_SIGNATURE = 0x08074b50

_EXTRA_FIELD_STRUCT = struct.Struct('<HH')

def _strip_extra(extra, xids):
    # Remove Extra Fields with specified IDs.
    unpack = _EXTRA_FIELD_STRUCT.unpack
    modified = False
    buffer = []
    start = i = 0
    while i + 4 <= len(extra):
        xid, xlen = unpack(extra[i : i + 4])
        j = i + 4 + xlen
        if xid in xids:
            if i != start:
                buffer.append(extra[start : i])
            start = j
            modified = True
        i = j
    if not modified:
        return extra
    return b''.join(buffer)

def _check_zipfile(fp):
    try:
        if _EndRecData(fp):
            return True         # file has correct magic number
    except OSError:
        pass
    return False

def is_zipfile(filename):
    """Quickly see if a file is a ZIP file by checking the magic number.

    The filename argument may be a file or file-like object too.
    """
    result = False
    try:
        if hasattr(filename, "read"):
            result = _check_zipfile(fp=filename)
        else:
            with open(filename, "rb") as fp:
                result = _check_zipfile(fp)
    except OSError:
        pass
    return result

def _EndRecData64(fpin, offset, endrec):
    """
    Read the ZIP64 end-of-archive records and use that to update endrec
    """
    try:
        fpin.seek(offset - sizeEndCentDir64Locator, 2)
    except OSError:
        # If the seek fails, the file is not large enough to contain a ZIP64
        # end-of-archive record, so just return the end record we were given.
        return endrec

    data = fpin.read(sizeEndCentDir64Locator)
    if len(data) != sizeEndCentDir64Locator:
        return endrec
    sig, diskno, reloff, disks = struct.unpack(structEndArchive64Locator, data)
    if sig != stringEndArchive64Locator:
        return endrec

    if diskno != 0 or disks > 1:
        raise BadZipFile("zipfiles that span multiple disks are not supported")

    # Assume no 'zip64 extensible data'
    fpin.seek(offset - sizeEndCentDir64Locator - sizeEndCentDir64, 2)
    data = fpin.read(sizeEndCentDir64)
    if len(data) != sizeEndCentDir64:
        return endrec
    sig, sz, create_version, read_version, disk_num, disk_dir, \
        dircount, dircount2, dirsize, diroffset = \
        struct.unpack(structEndArchive64, data)
    if sig != stringEndArchive64:
        return endrec

    # Update the original endrec using data from the ZIP64 record
    endrec[_ECD_SIGNATURE] = sig
    endrec[_ECD_DISK_NUMBER] = disk_num
    endrec[_ECD_DISK_START] = disk_dir
    endrec[_ECD_ENTRIES_THIS_DISK] = dircount
    endrec[_ECD_ENTRIES_TOTAL] = dircount2
    endrec[_ECD_SIZE] = dirsize
    endrec[_ECD_OFFSET] = diroffset
    return endrec


def _EndRecData(fpin):
    """Return data from the "End of Central Directory" record, or None.

    The data is a list of the nine items in the ZIP "End of central dir"
    record followed by a tenth item, the file seek offset of this record."""

    # Determine file size
    fpin.seek(0, 2)
    filesize = fpin.tell()

    # Check to see if this is ZIP file with no archive comment (the
    # "end of central directory" structure should be the last item in the
    # file if this is the case).
    try:
        fpin.seek(-sizeEndCentDir, 2)
    except OSError:
        return None
    data = fpin.read()
    if (len(data) == sizeEndCentDir and
        data[0:4] == stringEndArchive and
        data[-2:] == b"\000\000"):
        # the signature is correct and there's no comment, unpack structure
        endrec = struct.unpack(structEndArchive, data)
        endrec=list(endrec)

        # Append a blank comment and record start offset
        endrec.append(b"")
        endrec.append(filesize - sizeEndCentDir)

        # Try to read the "Zip64 end of central directory" structure
        return _EndRecData64(fpin, -sizeEndCentDir, endrec)

    # Either this is not a ZIP file, or it is a ZIP file with an archive
    # comment.  Search the end of the file for the "end of central directory"
    # record signature. The comment is the last item in the ZIP file and may be
    # up to 64K long.  It is assumed that the "end of central directory" magic
    # number does not appear in the comment.
    maxCommentStart = max(filesize - (1 << 16) - sizeEndCentDir, 0)
    fpin.seek(maxCommentStart, 0)
    data = fpin.read()
    start = data.rfind(stringEndArchive)
    if start >= 0:
        # found the magic number; attempt to unpack and interpret
        recData = data[start:start+sizeEndCentDir]
        if len(recData) != sizeEndCentDir:
            # Zip file is corrupted.
            return None
        endrec = list(struct.unpack(structEndArchive, recData))
        commentSize = endrec[_ECD_COMMENT_SIZE] #as claimed by the zip file
        comment = data[start+sizeEndCentDir:start+sizeEndCentDir+commentSize]
        endrec.append(comment)
        endrec.append(maxCommentStart + start)

        # Try to read the "Zip64 end of central directory" structure
        return _EndRecData64(fpin, maxCommentStart + start - filesize,
                             endrec)

    # Unable to find a valid end of central directory structure
    return None


class ZipInfo (object):
    """Class with attributes describing each file in the ZIP archive."""

    __slots__ = (
        'orig_filename',
        'filename',
        'date_time',
        'compress_type',
        '_compresslevel',
        'comment',
        'extra',
        'create_system',
        'create_version',
        'extract_version',
        'reserved',
        'flag_bits',
        'volume',
        'internal_attr',
        'external_attr',
        'header_offset',
        'CRC',
        'compress_size',
        'file_size',
        '_raw_time',
    )

    def __init__(self, filename="NoName", date_time=(1980,1,1,0,0,0)):
        self.orig_filename = filename   # Original file name in archive

        # Terminate the file name at the first null byte.  Null bytes in file
        # names are used as tricks by viruses in archives.
        null_byte = filename.find(chr(0))
        if null_byte >= 0:
            filename = filename[0:null_byte]
        # This is used to ensure paths in generated ZIP files always use
        # forward slashes as the directory separator, as required by the
        # ZIP format specification.
        if os.sep != "/" and os.sep in filename:
            filename = filename.replace(os.sep, "/")

        self.filename = filename        # Normalized file name
        self.date_time = date_time      # year, month, day, hour, min, sec

        if date_time[0] < 1980:
            raise ValueError('ZIP does not support timestamps before 1980')

        # Standard values:
        self.compress_type = ZIP_STORED # Type of compression for the file
        self._compresslevel = None      # Level for the compressor
        self.comment = b""              # Comment for each file
        self.extra = b""                # ZIP extra data
        if sys.platform == 'win32':
            self.create_system = 0          # System which created ZIP archive
        else:
            # Assume everything else is unix-y
            self.create_system = 3          # System which created ZIP archive
        self.create_version = DEFAULT_VERSION  # Version which created ZIP archive
        self.extract_version = DEFAULT_VERSION # Version needed to extract archive
        self.reserved = 0               # Must be zero
        self.flag_bits = 0              # ZIP flag bits
        self.volume = 0                 # Volume number of file header
        self.internal_attr = 0          # Internal attributes
        self.external_attr = 0          # External file attributes
        # Other attributes are set by class ZipFile:
        # header_offset         Byte offset to the file header
        # CRC                   CRC-32 of the uncompressed file
        # compress_size         Size of the compressed file
        # file_size             Size of the uncompressed file

    def __repr__(self):
        result = ['<%s filename=%r' % (self.__class__.__name__, self.filename)]
        if self.compress_type != ZIP_STORED:
            result.append(' compress_type=%s' %
                          compressor_names.get(self.compress_type,
                                               self.compress_type))
        hi = self.external_attr >> 16
        lo = self.external_attr & 0xFFFF
        if hi:
            result.append(' filemode=%r' % stat.filemode(hi))
        if lo:
            result.append(' external_attr=%#x' % lo)
        isdir = self.is_dir()
        if not isdir or self.file_size:
            result.append(' file_size=%r' % self.file_size)
        if ((not isdir or self.compress_size) and
            (self.compress_type != ZIP_STORED or
             self.file_size != self.compress_size)):
            result.append(' compress_size=%r' % self.compress_size)
        result.append('>')
        return ''.join(result)

    def FileHeader(self, zip64=None):
        """Return the per-file header as a bytes object."""
        dt = self.date_time
        dosdate = (dt[0] - 1980) << 9 | dt[1] << 5 | dt[2]
        dostime = dt[3] << 11 | dt[4] << 5 | (dt[5] // 2)
        if self.flag_bits & 0x08:
            # Set these to zero because we write them after the file data
            CRC = compress_size = file_size = 0
        else:
            CRC = self.CRC
            compress_size = self.compress_size
            file_size = self.file_size

        extra = self.extra

        min_version = 0
        if zip64 is None:
            zip64 = file_size > ZIP64_LIMIT or compress_size > ZIP64_LIMIT
        if zip64:
            fmt = '<HHQQ'
            extra = extra + struct.pack(fmt,
                                        1, struct.calcsize(fmt)-4, file_size, compress_size)
        if file_size > ZIP64_LIMIT or compress_size > ZIP64_LIMIT:
            if not zip64:
                raise LargeZipFile("Filesize would require ZIP64 extensions")
            # File is larger than what fits into a 4 byte integer,
            # fall back to the ZIP64 extension
            file_size = 0xffffffff
            compress_size = 0xffffffff
            min_version = ZIP64_VERSION

        if self.compress_type == ZIP_BZIP2:
            min_version = max(BZIP2_VERSION, min_version)
        elif self.compress_type == ZIP_LZMA:
            min_version = max(LZMA_VERSION, min_version)

        self.extract_version = max(min_version, self.extract_version)
        self.create_version = max(min_version, self.create_version)
        filename, flag_bits = self._encodeFilenameFlags()
        header = struct.pack(structFileHeader, stringFileHeader,
                             self.extract_version, self.reserved, flag_bits,
                             self.compress_type, dostime, dosdate, CRC,
                             compress_size, file_size,
                             len(filename), len(extra))
        return header + filename + extra

    def _encodeFilenameFlags(self):
        try:
            return self.filename.encode('ascii'), self.flag_bits
        except UnicodeEncodeError:
            return self.filename.encode('utf-8'), self.flag_bits | 0x800

    def _decodeExtra(self):
        # Try to decode the extra field.
        extra = self.extra
        unpack = struct.unpack
        while len(extra) >= 4:
            tp, ln = unpack('<HH', extra[:4])
            if ln+4 > len(extra):
                raise BadZipFile("Corrupt extra field %04x (size=%d)" % (tp, ln))
            if tp == 0x0001:
                if ln >= 24:
                    counts = unpack('<QQQ', extra[4:28])
                elif ln == 16:
                    counts = unpack('<QQ', extra[4:20])
                elif ln == 8:
                    counts = unpack('<Q', extra[4:12])
                elif ln == 0:
                    counts = ()
                else:
                    raise BadZipFile("Corrupt extra field %04x (size=%d)" % (tp, ln))

                idx = 0

                # ZIP64 extension (large files and/or large archives)
                if self.file_size in (0xffffffffffffffff, 0xffffffff):
                    if len(counts) <= idx:
                        raise BadZipFile(
                            "Corrupt zip64 extra field. File size not found."
                        )
                    self.file_size = counts[idx]
                    idx += 1

                if self.compress_size == 0xFFFFFFFF:
                    if len(counts) <= idx:
                        raise BadZipFile(
                            "Corrupt zip64 extra field. Compress size not found."
                        )
                    self.compress_size = counts[idx]
                    idx += 1

                if self.header_offset == 0xffffffff:
                    if len(counts) <= idx:
                        raise BadZipFile(
                            "Corrupt zip64 extra field. Header offset not found."
                        )
                    old = self.header_offset
                    self.header_offset = counts[idx]
                    idx+=1

            extra = extra[ln+4:]

    @classmethod
    def from_file(cls, filename, arcname=None, *, strict_timestamps=True):
        """Construct an appropriate ZipInfo for a file on the filesystem.

        filename should be the path to a file or directory on the filesystem.

        arcname is the name which it will have within the archive (by default,
        this will be the same as filename, but without a drive letter and with
        leading path separators removed).
        """
        if isinstance(filename, os.PathLike):
            filename = os.fspath(filename)
        st = os.stat(filename)
        isdir = stat.S_ISDIR(st.st_mode)
        mtime = time.localtime(st.st_mtime)
        date_time = mtime[0:6]
        if not strict_timestamps and date_time[0] < 1980:
            date_time = (1980, 1, 1, 0, 0, 0)
        elif not strict_timestamps and date_time[0] > 2107:
            date_time = (2107, 12, 31, 23, 59, 59)
        # Create ZipInfo instance to store file information
        if arcname is None:
            arcname = filename
        arcname = os.path.normpath(os.path.splitdrive(arcname)[1])
        while arcname[0] in (os.sep, os.altsep):
            arcname = arcname[1:]
        if isdir:
            arcname += '/'
        zinfo = cls(arcname, date_time)
        zinfo.external_attr = (st.st_mode & 0xFFFF) << 16  # Unix attributes
        if isdir:
            zinfo.file_size = 0
            zinfo.external_attr |= 0x10  # MS-DOS directory flag
        else:
            zinfo.file_size = st.st_size

        return zinfo

    def is_dir(self):
        """Return True if this archive member is a directory."""
        return self.filename[-1] == '/'


# ZIP encryption uses the CRC32 one-byte primitive for scrambling some
# internal keys. We noticed that a direct implementation is faster than
# relying on binascii.crc32().

_crctable = None
def _gen_crc(crc):
    for j in range(8):
        if crc & 1:
            crc = (crc >> 1) ^ 0xEDB88320
        else:
            crc >>= 1
    return crc

# ZIP supports a password-based form of encryption. Even though known
# plaintext attacks have been found against it, it is still useful
# to be able to get data out of such a file.
#
# Usage:
#     zd = _ZipDecrypter(mypwd)
#     plain_bytes = zd(cypher_bytes)

def _ZipDecrypter(pwd):
    key0 = 305419896
    key1 = 591751049
    key2 = 878082192

    global _crctable
    if _crctable is None:
        _crctable = list(map(_gen_crc, range(256)))
    crctable = _crctable

    def crc32(ch, crc):
        """Compute the CRC32 primitive on one byte."""
        return (crc >> 8) ^ crctable[(crc ^ ch) & 0xFF]

    def update_keys(c):
        nonlocal key0, key1, key2
        key0 = crc32(c, key0)
        key1 = (key1 + (key0 & 0xFF)) & 0xFFFFFFFF
        key1 = (key1 * 134775813 + 1) & 0xFFFFFFFF
        key2 = crc32(key1 >> 24, key2)

    for p in pwd:
        update_keys(p)

    def decrypter(data):
        """Decrypt a bytes object."""
        result = bytearray()
        append = result.append
        for c in data:
            k = key2 | 2
            c ^= ((k * (k^1)) >> 8) & 0xFF
            update_keys(c)
            append(c)
        return bytes(result)

    return decrypter


class LZMACompressor:

    def __init__(self):
        self._comp = None

    def _init(self):
        props = lzma._encode_filter_properties({'id': lzma.FILTER_LZMA1})
        self._comp = lzma.LZMACompressor(lzma.FORMAT_RAW, filters=[
            lzma._decode_filter_properties(lzma.FILTER_LZMA1, props)
        ])
        return struct.pack('<BBH', 9, 4, len(props)) + props

    def compress(self, data):
        if self._comp is None:
            return self._init() + self._comp.compress(data)
        return self._comp.compress(data)

    def flush(self):
        if self._comp is None:
            return self._init() + self._comp.flush()
        return self._comp.flush()


class LZMADecompressor:

    def __init__(self):
        self._decomp = None
        self._unconsumed = b''
        self.eof = False

    def decompress(self, data):
        if self._decomp is None:
            self._unconsumed += data
            if len(self._unconsumed) <= 4:
                return b''
            psize, = struct.unpack('<H', self._unconsumed[2:4])
            if len(self._unconsumed) <= 4 + psize:
                return b''

            self._decomp = lzma.LZMADecompressor(lzma.FORMAT_RAW, filters=[
                lzma._decode_filter_properties(lzma.FILTER_LZMA1,
                                               self._unconsumed[4:4 + psize])
            ])
            data = self._unconsumed[4 + psize:]
            del self._unconsumed

        result = self._decomp.decompress(data)
        self.eof = self._decomp.eof
        return result


compressor_names = {
    0: 'store',
    1: 'shrink',
    2: 'reduce',
    3: 'reduce',
    4: 'reduce',
    5: 'reduce',
    6: 'implode',
    7: 'tokenize',
    8: 'deflate',
    9: 'deflate64',
    10: 'implode',
    12: 'bzip2',
    14: 'lzma',
    18: 'terse',
    19: 'lz77',
    97: 'wavpack',
    98: 'ppmd',
}

def _check_compression(compression):
    if compression == ZIP_STORED:
        pass
    elif compression == ZIP_DEFLATED:
        if not zlib:
            raise RuntimeError(
                "Compression requires the (missing) zlib module")
    elif compression == ZIP_BZIP2:
        if not bz2:
            raise RuntimeError(
                "Compression requires the (missing) bz2 module")
    elif compression == ZIP_LZMA:
        if not lzma:
            raise RuntimeError(
                "Compression requires the (missing) lzma module")
    else:
        raise NotImplementedError("That compression method is not supported")


def _get_compressor(compress_type, compresslevel=None):
    if compress_type == ZIP_DEFLATED:
        if compresslevel is not None:
            return zlib.compressobj(compresslevel, zlib.DEFLATED, -15)
        return zlib.compressobj(zlib.Z_DEFAULT_COMPRESSION, zlib.DEFLATED, -15)
    elif compress_type == ZIP_BZIP2:
        if compresslevel is not None:
            return bz2.BZ2Compressor(compresslevel)
        return bz2.BZ2Compressor()
    # compresslevel is ignored for ZIP_LZMA
    elif compress_type == ZIP_LZMA:
        return LZMACompressor()
    else:
        return None


def _get_decompressor(compress_type):
    _check_compression(compress_type)
    if compress_type == ZIP_STORED:
        return None
    elif compress_type == ZIP_DEFLATED:
        return zlib.decompressobj(-15)
    elif compress_type == ZIP_BZIP2:
        return bz2.BZ2Decompressor()
    elif compress_type == ZIP_LZMA:
        return LZMADecompressor()
    else:
        descr = compressor_names.get(compress_type)
        if descr:
            raise NotImplementedError("compression type %d (%s)" % (compress_type, descr))
        else:
            raise NotImplementedError("compression type %d" % (compress_type,))


class _SharedFile:
    def __init__(self, file, pos, close, lock, writing):
        self._file = file
        self._pos = pos
        self._close = close
        self._lock = lock
        self._writing = writing
        self.seekable = file.seekable
        self.tell = file.tell

    def seek(self, offset, whence=0):
        with self._lock:
            if self._writing():
                raise ValueError("Can't reposition in the ZIP file while "
                        "there is an open writing handle on it. "
                        "Close the writing handle before trying to read.")
            self._file.seek(offset, whence)
            self._pos = self._file.tell()
            return self._pos

    def read(self, n=-1):
        with self._lock:
            if self._writing():
                raise ValueError("Can't read from the ZIP file while there "
                        "is an open writing handle on it. "
                        "Close the writing handle before trying to read.")
            self._file.seek(self._pos)
            data = self._file.read(n)
            self._pos = self._file.tell()
            return data

    def close(self):
        if self._file is not None:
            fileobj = self._file
            self._file = None
            self._close(fileobj)

# Provide the tell method for unseekable stream
class _Tellable:
    def __init__(self, fp):
        self.fp = fp
        self.offset = 0

    def write(self, data):
        n = self.fp.write(data)
        self.offset += n
        return n

    def tell(self):
        return self.offset

    def flush(self):
        self.fp.flush()

    def close(self):
        self.fp.close()


class ZipExtFile(io.BufferedIOBase):
    """File-like object for reading an archive member.
       Is returned by ZipFile.open().
    """

    # Max size supported by decompressor.
    MAX_N = 1 << 31 - 1

    # Read from compressed files in 4k blocks.
    MIN_READ_SIZE = 4096

    # Chunk size to read during seek
    MAX_SEEK_READ = 1 << 24

    def __init__(self, fileobj, mode, zipinfo, pwd=None,
                 close_fileobj=False):
        self._fileobj = fileobj
        self._pwd = pwd
        self._close_fileobj = close_fileobj

        self._compress_type = zipinfo.compress_type
        self._compress_left = zipinfo.compress_size
        self._left = zipinfo.file_size

        self._decompressor = _get_decompressor(self._compress_type)

        self._eof = False
        self._readbuffer = b''
        self._offset = 0

        self.newlines = None

        self.mode = mode
        self.name = zipinfo.filename

        if hasattr(zipinfo, 'CRC'):
            self._expected_crc = zipinfo.CRC
            self._running_crc = crc32(b'')
        else:
            self._expected_crc = None

        self._seekable = False
        try:
            if fileobj.seekable():
                self._orig_compress_start = fileobj.tell()
                self._orig_compress_size = zipinfo.compress_size
                self._orig_file_size = zipinfo.file_size
                self._orig_start_crc = self._running_crc
                self._seekable = True
        except AttributeError:
            pass

        self._decrypter = None
        if pwd:
            if zipinfo.flag_bits & 0x8:
                # compare against the file type from extended local headers
                check_byte = (zipinfo._raw_time >> 8) & 0xff
            else:
                # compare against the CRC otherwise
                check_byte = (zipinfo.CRC >> 24) & 0xff
            h = self._init_decrypter()
            if h != check_byte:
                raise RuntimeError("Bad password for file %r" % zipinfo.orig_filename)


    def _init_decrypter(self):
        self._decrypter = _ZipDecrypter(self._pwd)
        # The first 12 bytes in the cypher stream is an encryption header
        #  used to strengthen the algorithm. The first 11 bytes are
        #  completely random, while the 12th contains the MSB of the CRC,
        #  or the MSB of the file time depending on the header type
        #  and is used to check the correctness of the password.
        header = self._fileobj.read(12)
        self._compress_left -= 12
        return self._decrypter(header)[11]

    def __repr__(self):
        result = ['<%s.%s' % (self.__class__.__module__,
                              self.__class__.__qualname__)]
        if not self.closed:
            result.append(' name=%r mode=%r' % (self.name, self.mode))
            if self._compress_type != ZIP_STORED:
                result.append(' compress_type=%s' %
                              compressor_names.get(self._compress_type,
                                                   self._compress_type))
        else:
            result.append(' [closed]')
        result.append('>')
        return ''.join(result)

    def readline(self, limit=-1):
        """Read and return a line from the stream.

        If limit is specified, at most limit bytes will be read.
        """

        if limit < 0:
            # Shortcut common case - newline found in buffer.
            i = self._readbuffer.find(b'\n', self._offset) + 1
            if i > 0:
                line = self._readbuffer[self._offset: i]
                self._offset = i
                return line

        return io.BufferedIOBase.readline(self, limit)

    def peek(self, n=1):
        """Returns buffered bytes without advancing the position."""
        if n > len(self._readbuffer) - self._offset:
            chunk = self.read(n)
            if len(chunk) > self._offset:
                self._readbuffer = chunk + self._readbuffer[self._offset:]
                self._offset = 0
            else:
                self._offset -= len(chunk)

        # Return up to 512 bytes to reduce allocation overhead for tight loops.
        return self._readbuffer[self._offset: self._offset + 512]

    def readable(self):
        return True

    def read(self, n=-1):
        """Read and return up to n bytes.
        If the argument is omitted, None, or negative, data is read and returned until EOF is reached.
        """
        if n is None or n < 0:
            buf = self._readbuffer[self._offset:]
            self._readbuffer = b''
            self._offset = 0
            while not self._eof:
                buf += self._read1(self.MAX_N)
            return buf

        end = n + self._offset
        if end < len(self._readbuffer):
            buf = self._readbuffer[self._offset:end]
            self._offset = end
            return buf

        n = end - len(self._readbuffer)
        buf = self._readbuffer[self._offset:]
        self._readbuffer = b''
        self._offset = 0
        while n > 0 and not self._eof:
            data = self._read1(n)
            if n < len(data):
                self._readbuffer = data
                self._offset = n
                buf += data[:n]
                break
            buf += data
            n -= len(data)
        return buf

    def _update_crc(self, newdata):
        # Update the CRC using the given data.
        if self._expected_crc is None:
            # No need to compute the CRC if we don't have a reference value
            return
        self._running_crc = crc32(newdata, self._running_crc)
        # Check the CRC if we're at the end of the file
        if self._eof and self._running_crc != self._expected_crc:
            raise BadZipFile("Bad CRC-32 for file %r" % self.name)

    def read1(self, n):
        """Read up to n bytes with at most one read() system call."""

        if n is None or n < 0:
            buf = self._readbuffer[self._offset:]
            self._readbuffer = b''
            self._offset = 0
            while not self._eof:
                data = self._read1(self.MAX_N)
                if data:
                    buf += data
                    break
            return buf

        end = n + self._offset
        if end < len(self._readbuffer):
            buf = self._readbuffer[self._offset:end]
            self._offset = end
            return buf

        n = end - len(self._readbuffer)
        buf = self._readbuffer[self._offset:]
        self._readbuffer = b''
        self._offset = 0
        if n > 0:
            while not self._eof:
                data = self._read1(n)
                if n < len(data):
                    self._readbuffer = data
                    self._offset = n
                    buf += data[:n]
                    break
                if data:
                    buf += data
                    break
        return buf

    def _read1(self, n):
        # Read up to n compressed bytes with at most one read() system call,
        # decrypt and decompress them.
        if self._eof or n <= 0:
            return b''

        # Read from file.
        if self._compress_type == ZIP_DEFLATED:
            ## Handle unconsumed data.
            data = self._decompressor.unconsumed_tail
            if n > len(data):
                data += self._read2(n - len(data))
        else:
            data = self._read2(n)

        if self._compress_type == ZIP_STORED:
            self._eof = self._compress_left <= 0
        elif self._compress_type == ZIP_DEFLATED:
            n = max(n, self.MIN_READ_SIZE)
            data = self._decompressor.decompress(data, n)
            self._eof = (self._decompressor.eof or
                         self._compress_left <= 0 and
                         not self._decompressor.unconsumed_tail)
            if self._eof:
                data += self._decompressor.flush()
        else:
            data = self._decompressor.decompress(data)
            self._eof = self._decompressor.eof or self._compress_left <= 0

        data = data[:self._left]
        self._left -= len(data)
        if self._left <= 0:
            self._eof = True
        self._update_crc(data)
        return data

    def _read2(self, n):
        if self._compress_left <= 0:
            return b''

        n = max(n, self.MIN_READ_SIZE)
        n = min(n, self._compress_left)

        data = self._fileobj.read(n)
        self._compress_left -= len(data)
        if not data:
            raise EOFError

        if self._decrypter is not None:
            data = self._decrypter(data)
        return data

    def close(self):
        try:
            if self._close_fileobj:
                self._fileobj.close()
        finally:
            super().close()

    def seekable(self):
        return self._seekable

    def seek(self, offset, whence=0):
        if not self._seekable:
            raise io.UnsupportedOperation("underlying stream is not seekable")
        curr_pos = self.tell()
        if whence == 0: # Seek from start of file
            new_pos = offset
        elif whence == 1: # Seek from current position
            new_pos = curr_pos + offset
        elif whence == 2: # Seek from EOF
            new_pos = self._orig_file_size + offset
        else:
            raise ValueError("whence must be os.SEEK_SET (0), "
                             "os.SEEK_CUR (1), or os.SEEK_END (2)")

        if new_pos > self._orig_file_size:
            new_pos = self._orig_file_size

        if new_pos < 0:
            new_pos = 0

        read_offset = new_pos - curr_pos
        buff_offset = read_offset + self._offset

        if buff_offset >= 0 and buff_offset < len(self._readbuffer):
            # Just move the _offset index if the new position is in the _readbuffer
            self._offset = buff_offset
            read_offset = 0
        elif read_offset < 0:
            # Position is before the current position. Reset the ZipExtFile
            self._fileobj.seek(self._orig_compress_start)
            self._running_crc = self._orig_start_crc
            self._compress_left = self._orig_compress_size
            self._left = self._orig_file_size
            self._readbuffer = b''
            self._offset = 0
            self._decompressor = _get_decompressor(self._compress_type)
            self._eof = False
            read_offset = new_pos
            if self._decrypter is not None:
                self._init_decrypter()

        while read_offset > 0:
            read_len = min(self.MAX_SEEK_READ, read_offset)
            self.read(read_len)
            read_offset -= read_len

        return self.tell()

    def tell(self):
        if not self._seekable:
            raise io.UnsupportedOperation("underlying stream is not seekable")
        filepos = self._orig_file_size - self._left - len(self._readbuffer) + self._offset
        return filepos


class _ZipWriteFile(io.BufferedIOBase):
    def __init__(self, zf, zinfo, zip64):
        self._zinfo = zinfo
        self._zip64 = zip64
        self._zipfile = zf
        self._compressor = _get_compressor(zinfo.compress_type,
                                           zinfo._compresslevel)
        self._file_size = 0
        self._compress_size = 0
        self._crc = 0

    @property
    def _fileobj(self):
        return self._zipfile.fp

    def writable(self):
        return True

    def write(self, data):
        if self.closed:
            raise ValueError('I/O operation on closed file.')
        nbytes = len(data)
        self._file_size += nbytes
        self._crc = crc32(data, self._crc)
        if self._compressor:
            data = self._compressor.compress(data)
            self._compress_size += len(data)
        self._fileobj.write(data)
        return nbytes

    def close(self):
        if self.closed:
            return
        try:
            super().close()
            # Flush any data from the compressor, and update header info
            if self._compressor:
                buf = self._compressor.flush()
                self._compress_size += len(buf)
                self._fileobj.write(buf)
                self._zinfo.compress_size = self._compress_size
            else:
                self._zinfo.compress_size = self._file_size
            self._zinfo.CRC = self._crc
            self._zinfo.file_size = self._file_size

            # Write updated header info
            if self._zinfo.flag_bits & 0x08:
                # Write CRC and file sizes after the file data
                fmt = '<LLQQ' if self._zip64 else '<LLLL'
                self._fileobj.write(struct.pack(fmt, _DD_SIGNATURE, self._zinfo.CRC,
                    self._zinfo.compress_size, self._zinfo.file_size))
                self._zipfile.start_dir = self._fileobj.tell()
            else:
                if not self._zip64:
                    if self._file_size > ZIP64_LIMIT:
                        raise RuntimeError(
                            'File size unexpectedly exceeded ZIP64 limit')
                    if self._compress_size > ZIP64_LIMIT:
                        raise RuntimeError(
                            'Compressed size unexpectedly exceeded ZIP64 limit')
                # Seek backwards and write file header (which will now include
                # correct CRC and file sizes)

                # Preserve current position in file
                self._zipfile.start_dir = self._fileobj.tell()
                self._fileobj.seek(self._zinfo.header_offset)
                self._fileobj.write(self._zinfo.FileHeader(self._zip64))
                self._fileobj.seek(self._zipfile.start_dir)

            # Successfully written: Add file to our caches
            self._zipfile.filelist.append(self._zinfo)
            self._zipfile.NameToInfo[self._zinfo.filename] = self._zinfo
        finally:
            self._zipfile._writing = False



class ZipFile:
    """ Class with methods to open, read, write, close, list zip files.

    z = ZipFile(file, mode="r", compression=ZIP_STORED, allowZip64=True,
                compresslevel=None)

    file: Either the path to the file, or a file-like object.
          If it is a path, the file will be opened and closed by ZipFile.
    mode: The mode can be either read 'r', write 'w', exclusive create 'x',
          or append 'a'.
    compression: ZIP_STORED (no compression), ZIP_DEFLATED (requires zlib),
                 ZIP_BZIP2 (requires bz2) or ZIP_LZMA (requires lzma).
    allowZip64: if True ZipFile will create files with ZIP64 extensions when
                needed, otherwise it will raise an exception when this would
                be necessary.
    compresslevel: None (default for the given compression type) or an integer
                   specifying the level to pass to the compressor.
                   When using ZIP_STORED or ZIP_LZMA this keyword has no effect.
                   When using ZIP_DEFLATED integers 0 through 9 are accepted.
                   When using ZIP_BZIP2 integers 1 through 9 are accepted.

    """

    fp = None                   # Set here since __del__ checks it
    _windows_illegal_name_trans_table = None

    def __init__(self, file, mode="r", compression=ZIP_STORED, allowZip64=True,
                 compresslevel=None, *, strict_timestamps=True):
        """Open the ZIP file with mode read 'r', write 'w', exclusive create 'x',
        or append 'a'."""
        if mode not in ('r', 'w', 'x', 'a'):
            raise ValueError("ZipFile requires mode 'r', 'w', 'x', or 'a'")

        _check_compression(compression)

        self._allowZip64 = allowZip64
        self._didModify = False
        self.debug = 0  # Level of printing: 0 through 3
        self.NameToInfo = {}    # Find file info given name
        self.filelist = []      # List of ZipInfo instances for archive
        self.compression = compression  # Method of compression
        self.compresslevel = compresslevel
        self.mode = mode
        self.pwd = None
        self._comment = b''
        self._strict_timestamps = strict_timestamps

        # Check if we were passed a file-like object
        if isinstance(file, os.PathLike):
            file = os.fspath(file)
        if isinstance(file, str):
            # No, it's a filename
            self._filePassed = 0
            self.filename = file
            modeDict = {'r' : 'rb', 'w': 'w+b', 'x': 'x+b', 'a' : 'r+b',
                        'r+b': 'w+b', 'w+b': 'wb', 'x+b': 'xb'}
            filemode = modeDict[mode]
            while True:
                try:
                    self.fp = io.open(file, filemode)
                except OSError:
                    if filemode in modeDict:
                        filemode = modeDict[filemode]
                        continue
                    raise
                break
        else:
            self._filePassed = 1
            self.fp = file
            self.filename = getattr(file, 'name', None)
        self._fileRefCnt = 1
        self._lock = threading.RLock()
        self._seekable = True
        self._writing = False

        try:
            if mode == 'r':
                self._RealGetContents()
            elif mode in ('w', 'x'):
                # set the modified flag so central directory gets written
                # even if no files are added to the archive
                self._didModify = True
                try:
                    self.start_dir = self.fp.tell()
                except (AttributeError, OSError):
                    self.fp = _Tellable(self.fp)
                    self.start_dir = 0
                    self._seekable = False
                else:
                    # Some file-like objects can provide tell() but not seek()
                    try:
                        self.fp.seek(self.start_dir)
                    except (AttributeError, OSError):
                        self._seekable = False
            elif mode == 'a':
                try:
                    # See if file is a zip file
                    self._RealGetContents()
                    # seek to start of directory and overwrite
                    self.fp.seek(self.start_dir)
                except BadZipFile:
                    # file is not a zip file, just append
                    self.fp.seek(0, 2)

                    # set the modified flag so central directory gets written
                    # even if no files are added to the archive
                    self._didModify = True
                    self.start_dir = self.fp.tell()
            else:
                raise ValueError("Mode must be 'r', 'w', 'x', or 'a'")
        except:
            fp = self.fp
            self.fp = None
            self._fpclose(fp)
            raise

    def __enter__(self):
        return self

    def __exit__(self, type, value, traceback):
        self.close()

    def __repr__(self):
        result = ['<%s.%s' % (self.__class__.__module__,
                              self.__class__.__qualname__)]
        if self.fp is not None:
            if self._filePassed:
                result.append(' file=%r' % self.fp)
            elif self.filename is not None:
                result.append(' filename=%r' % self.filename)
            result.append(' mode=%r' % self.mode)
        else:
            result.append(' [closed]')
        result.append('>')
        return ''.join(result)

    def _RealGetContents(self):
        """Read in the table of contents for the ZIP file."""
        fp = self.fp
        try:
            endrec = _EndRecData(fp)
        except OSError:
            raise BadZipFile("File is not a zip file")
        if not endrec:
            raise BadZipFile("File is not a zip file")
        if self.debug > 1:
            print(endrec)
        size_cd = endrec[_ECD_SIZE]             # bytes in central directory
        offset_cd = endrec[_ECD_OFFSET]         # offset of central directory
        self._comment = endrec[_ECD_COMMENT]    # archive comment

        # "concat" is zero, unless zip was concatenated to another file
        concat = endrec[_ECD_LOCATION] - size_cd - offset_cd
        if endrec[_ECD_SIGNATURE] == stringEndArchive64:
            # If Zip64 extension structures are present, account for them
            concat -= (sizeEndCentDir64 + sizeEndCentDir64Locator)

        if self.debug > 2:
            inferred = concat + offset_cd
            print("given, inferred, offset", offset_cd, inferred, concat)
        # self.start_dir:  Position of start of central directory
        self.start_dir = offset_cd + concat
        fp.seek(self.start_dir, 0)
        data = fp.read(size_cd)
        fp = io.BytesIO(data)
        total = 0
        while total < size_cd:
            centdir = fp.read(sizeCentralDir)
            if len(centdir) != sizeCentralDir:
                raise BadZipFile("Truncated central directory")
            centdir = struct.unpack(structCentralDir, centdir)
            if centdir[_CD_SIGNATURE] != stringCentralDir:
                raise BadZipFile("Bad magic number for central directory")
            if self.debug > 2:
                print(centdir)
            filename = fp.read(centdir[_CD_FILENAME_LENGTH])
            flags = centdir[5]
            if flags & 0x800:
                # UTF-8 file names extension
                filename = filename.decode('utf-8')
            else:
                # Historical ZIP filename encoding
                filename = filename.decode('cp437')
            # Create ZipInfo instance to store file information
            x = ZipInfo(filename)
            x.extra = fp.read(centdir[_CD_EXTRA_FIELD_LENGTH])
            x.comment = fp.read(centdir[_CD_COMMENT_LENGTH])
            x.header_offset = centdir[_CD_LOCAL_HEADER_OFFSET]
            (x.create_version, x.create_system, x.extract_version, x.reserved,
             x.flag_bits, x.compress_type, t, d,
             x.CRC, x.compress_size, x.file_size) = centdir[1:12]
            if x.extract_version > MAX_EXTRACT_VERSION:
                raise NotImplementedError("zip file version %.1f" %
                                          (x.extract_version / 10))
            x.volume, x.internal_attr, x.external_attr = centdir[15:18]
            # Convert date/time code to (year, month, day, hour, min, sec)
            x._raw_time = t
            x.date_time = ( (d>>9)+1980, (d>>5)&0xF, d&0x1F,
                            t>>11, (t>>5)&0x3F, (t&0x1F) * 2 )

            x._decodeExtra()
            x.header_offset = x.header_offset + concat
            self.filelist.append(x)
            self.NameToInfo[x.filename] = x

            # update total bytes read from central directory
            total = (total + sizeCentralDir + centdir[_CD_FILENAME_LENGTH]
                     + centdir[_CD_EXTRA_FIELD_LENGTH]
                     + centdir[_CD_COMMENT_LENGTH])

            if self.debug > 2:
                print("total", total)


    def namelist(self):
        """Return a list of file names in the archive."""
        return [data.filename for data in self.filelist]

    def infolist(self):
        """Return a list of class ZipInfo instances for files in the
        archive."""
        return self.filelist

    def printdir(self, file=None):
        """Print a table of contents for the zip file."""
        print("%-46s %19s %12s" % ("File Name", "Modified    ", "Size"),
              file=file)
        for zinfo in self.filelist:
            date = "%d-%02d-%02d %02d:%02d:%02d" % zinfo.date_time[:6]
            print("%-46s %s %12d" % (zinfo.filename, date, zinfo.file_size),
                  file=file)

    def testzip(self):
        """Read all the files and check the CRC."""
        chunk_size = 2 ** 20
        for zinfo in self.filelist:
            try:
                # Read by chunks, to avoid an OverflowError or a
                # MemoryError with very large embedded files.
                with self.open(zinfo.filename, "r") as f:
                    while f.read(chunk_size):     # Check CRC-32
                        pass
            except BadZipFile:
                return zinfo.filename

    def getinfo(self, name):
        """Return the instance of ZipInfo given 'name'."""
        info = self.NameToInfo.get(name)
        if info is None:
            raise KeyError(
                'There is no item named %r in the archive' % name)

        return info

    def setpassword(self, pwd):
        """Set default password for encrypted files."""
        if pwd and not isinstance(pwd, bytes):
            raise TypeError("pwd: expected bytes, got %s" % type(pwd).__name__)
        if pwd:
            self.pwd = pwd
        else:
            self.pwd = None

    @property
    def comment(self):
        """The comment text associated with the ZIP file."""
        return self._comment

    @comment.setter
    def comment(self, comment):
        if not isinstance(comment, bytes):
            raise TypeError("comment: expected bytes, got %s" % type(comment).__name__)
        # check for valid comment length
        if len(comment) > ZIP_MAX_COMMENT:
            import warnings
            warnings.warn('Archive comment is too long; truncating to %d bytes'
                          % ZIP_MAX_COMMENT, stacklevel=2)
            comment = comment[:ZIP_MAX_COMMENT]
        self._comment = comment
        self._didModify = True

    def read(self, name, pwd=None):
        """Return file bytes for name."""
        with self.open(name, "r", pwd) as fp:
            return fp.read()

    def open(self, name, mode="r", pwd=None, *, force_zip64=False):
        """Return file-like object for 'name'.

        name is a string for the file name within the ZIP file, or a ZipInfo
        object.

        mode should be 'r' to read a file already in the ZIP file, or 'w' to
        write to a file newly added to the archive.

        pwd is the password to decrypt files (only used for reading).

        When writing, if the file size is not known in advance but may exceed
        2 GiB, pass force_zip64 to use the ZIP64 format, which can handle large
        files.  If the size is known in advance, it is best to pass a ZipInfo
        instance for name, with zinfo.file_size set.
        """
        if mode not in {"r", "w"}:
            raise ValueError('open() requires mode "r" or "w"')
        if pwd and not isinstance(pwd, bytes):
            raise TypeError("pwd: expected bytes, got %s" % type(pwd).__name__)
        if pwd and (mode == "w"):
            raise ValueError("pwd is only supported for reading files")
        if not self.fp:
            raise ValueError(
                "Attempt to use ZIP archive that was already closed")

        # Make sure we have an info object
        if isinstance(name, ZipInfo):
            # 'name' is already an info object
            zinfo = name
        elif mode == 'w':
            zinfo = ZipInfo(name)
            zinfo.compress_type = self.compression
            zinfo._compresslevel = self.compresslevel
        else:
            # Get info object for name
            zinfo = self.getinfo(name)

        if mode == 'w':
            return self._open_to_write(zinfo, force_zip64=force_zip64)

        if self._writing:
            raise ValueError("Can't read from the ZIP file while there "
                    "is an open writing handle on it. "
                    "Close the writing handle before trying to read.")

        # Open for reading:
        self._fileRefCnt += 1
        zef_file = _SharedFile(self.fp, zinfo.header_offset,
                               self._fpclose, self._lock, lambda: self._writing)
        try:
            # Skip the file header:
            fheader = zef_file.read(sizeFileHeader)
            if len(fheader) != sizeFileHeader:
                raise BadZipFile("Truncated file header")
            fheader = struct.unpack(structFileHeader, fheader)
            if fheader[_FH_SIGNATURE] != stringFileHeader:
                raise BadZipFile("Bad magic number for file header")

            fname = zef_file.read(fheader[_FH_FILENAME_LENGTH])
            if fheader[_FH_EXTRA_FIELD_LENGTH]:
                zef_file.read(fheader[_FH_EXTRA_FIELD_LENGTH])

            if zinfo.flag_bits & 0x20:
                # Zip 2.7: compressed patched data
                raise NotImplementedError("compressed patched data (flag bit 5)")

            if zinfo.flag_bits & 0x40:
                # strong encryption
                raise NotImplementedError("strong encryption (flag bit 6)")

            if fheader[_FH_GENERAL_PURPOSE_FLAG_BITS] & 0x800:
                # UTF-8 filename
                fname_str = fname.decode("utf-8")
            else:
                fname_str = fname.decode("cp437")

            if fname_str != zinfo.orig_filename:
                raise BadZipFile(
                    'File name in directory %r and header %r differ.'
                    % (zinfo.orig_filename, fname))

            # check for encrypted flag & handle password
            is_encrypted = zinfo.flag_bits & 0x1
            if is_encrypted:
                if not pwd:
                    pwd = self.pwd
                if not pwd:
                    raise RuntimeError("File %r is encrypted, password "
                                       "required for extraction" % name)
            else:
                pwd = None

            return ZipExtFile(zef_file, mode, zinfo, pwd, True)
        except:
            zef_file.close()
            raise

    def _open_to_write(self, zinfo, force_zip64=False):
        if force_zip64 and not self._allowZip64:
            raise ValueError(
                "force_zip64 is True, but allowZip64 was False when opening "
                "the ZIP file."
            )
        if self._writing:
            raise ValueError("Can't write to the ZIP file while there is "
                             "another write handle open on it. "
                             "Close the first handle before opening another.")

        # Sizes and CRC are overwritten with correct data after processing the file
        if not hasattr(zinfo, 'file_size'):
            zinfo.file_size = 0
        zinfo.compress_size = 0
        zinfo.CRC = 0

        zinfo.flag_bits = 0x00
        if zinfo.compress_type == ZIP_LZMA:
            # Compressed data includes an end-of-stream (EOS) marker
            zinfo.flag_bits |= 0x02
        if not self._seekable:
            zinfo.flag_bits |= 0x08

        if not zinfo.external_attr:
            zinfo.external_attr = 0o600 << 16  # permissions: ?rw-------

        # Compressed size can be larger than uncompressed size
        zip64 = self._allowZip64 and \
                (force_zip64 or zinfo.file_size * 1.05 > ZIP64_LIMIT)

        if self._seekable:
            self.fp.seek(self.start_dir)
        zinfo.header_offset = self.fp.tell()

        self._writecheck(zinfo)
        self._didModify = True

        self.fp.write(zinfo.FileHeader(zip64))

        self._writing = True
        return _ZipWriteFile(self, zinfo, zip64)

    def extract(self, member, path=None, pwd=None):
        """Extract a member from the archive to the current working directory,
           using its full name. Its file information is extracted as accurately
           as possible. `member' may be a filename or a ZipInfo object. You can
           specify a different directory using `path'.
        """
        if path is None:
            path = os.getcwd()
        else:
            path = os.fspath(path)

        return self._extract_member(member, path, pwd)

    def extractall(self, path=None, members=None, pwd=None):
        """Extract all members from the archive to the current working
           directory. `path' specifies a different directory to extract to.
           `members' is optional and must be a subset of the list returned
           by namelist().
        """
        if members is None:
            members = self.namelist()

        if path is None:
            path = os.getcwd()
        else:
            path = os.fspath(path)

        for zipinfo in members:
            self._extract_member(zipinfo, path, pwd)

    @classmethod
    def _sanitize_windows_name(cls, arcname, pathsep):
        """Replace bad characters and remove trailing dots from parts."""
        table = cls._windows_illegal_name_trans_table
        if not table:
            illegal = ':<>|"?*'
            table = str.maketrans(illegal, '_' * len(illegal))
            cls._windows_illegal_name_trans_table = table
        arcname = arcname.translate(table)
        # remove trailing dots
        arcname = (x.rstrip('.') for x in arcname.split(pathsep))
        # rejoin, removing empty parts.
        arcname = pathsep.join(x for x in arcname if x)
        return arcname

    def _extract_member(self, member, targetpath, pwd):
        """Extract the ZipInfo object 'member' to a physical
           file on the path targetpath.
        """
        if not isinstance(member, ZipInfo):
            member = self.getinfo(member)

        # build the destination pathname, replacing
        # forward slashes to platform specific separators.
        arcname = member.filename.replace('/', os.path.sep)

        if os.path.altsep:
            arcname = arcname.replace(os.path.altsep, os.path.sep)
        # interpret absolute pathname as relative, remove drive letter or
        # UNC path, redundant separators, "." and ".." components.
        arcname = os.path.splitdrive(arcname)[1]
        invalid_path_parts = ('', os.path.curdir, os.path.pardir)
        arcname = os.path.sep.join(x for x in arcname.split(os.path.sep)
                                   if x not in invalid_path_parts)
        if os.path.sep == '\\':
            # filter illegal characters on Windows
            arcname = self._sanitize_windows_name(arcname, os.path.sep)

        targetpath = os.path.join(targetpath, arcname)
        targetpath = os.path.normpath(targetpath)

        # Create all upper directories if necessary.
        upperdirs = os.path.dirname(targetpath)
        if upperdirs and not os.path.exists(upperdirs):
            os.makedirs(upperdirs)

        if member.is_dir():
            if not os.path.isdir(targetpath):
                os.mkdir(targetpath)
            return targetpath

        with self.open(member, pwd=pwd) as source, \
             open(targetpath, "wb") as target:
            shutil.copyfileobj(source, target)

        return targetpath

    def _writecheck(self, zinfo):
        """Check for errors before writing a file to the archive."""
        if zinfo.filename in self.NameToInfo:
            import warnings
            warnings.warn('Duplicate name: %r' % zinfo.filename, stacklevel=3)
        if self.mode not in ('w', 'x', 'a'):
            raise ValueError("write() requires mode 'w', 'x', or 'a'")
        if not self.fp:
            raise ValueError(
                "Attempt to write ZIP archive that was already closed")
        _check_compression(zinfo.compress_type)
        if not self._allowZip64:
            requires_zip64 = None
            if len(self.filelist) >= ZIP_FILECOUNT_LIMIT:
                requires_zip64 = "Files count"
            elif zinfo.file_size > ZIP64_LIMIT:
                requires_zip64 = "Filesize"
            elif zinfo.header_offset > ZIP64_LIMIT:
                requires_zip64 = "Zipfile size"
            if requires_zip64:
                raise LargeZipFile(requires_zip64 +
                                   " would require ZIP64 extensions")

    def write(self, filename, arcname=None,
              compress_type=None, compresslevel=None):
        """Put the bytes from filename into the archive under the name
        arcname."""
        if not self.fp:
            raise ValueError(
                "Attempt to write to ZIP archive that was already closed")
        if self._writing:
            raise ValueError(
                "Can't write to ZIP archive while an open writing handle exists"
            )

        zinfo = ZipInfo.from_file(filename, arcname,
                                  strict_timestamps=self._strict_timestamps)

        if zinfo.is_dir():
            zinfo.compress_size = 0
            zinfo.CRC = 0
        else:
            if compress_type is not None:
                zinfo.compress_type = compress_type
            else:
                zinfo.compress_type = self.compression

            if compresslevel is not None:
                zinfo._compresslevel = compresslevel
            else:
                zinfo._compresslevel = self.compresslevel

        if zinfo.is_dir():
            with self._lock:
                if self._seekable:
                    self.fp.seek(self.start_dir)
                zinfo.header_offset = self.fp.tell()  # Start of header bytes
                if zinfo.compress_type == ZIP_LZMA:
                # Compressed data includes an end-of-stream (EOS) marker
                    zinfo.flag_bits |= 0x02

                self._writecheck(zinfo)
                self._didModify = True

                self.filelist.append(zinfo)
                self.NameToInfo[zinfo.filename] = zinfo
                self.fp.write(zinfo.FileHeader(False))
                self.start_dir = self.fp.tell()
        else:
            with open(filename, "rb") as src, self.open(zinfo, 'w') as dest:
                shutil.copyfileobj(src, dest, 1024*8)

    def writestr(self, zinfo_or_arcname, data,
                 compress_type=None, compresslevel=None):
        """Write a file into the archive.  The contents is 'data', which
        may be either a 'str' or a 'bytes' instance; if it is a 'str',
        it is encoded as UTF-8 first.
        'zinfo_or_arcname' is either a ZipInfo instance or
        the name of the file in the archive."""
        if isinstance(data, str):
            data = data.encode("utf-8")
        if not isinstance(zinfo_or_arcname, ZipInfo):
            zinfo = ZipInfo(filename=zinfo_or_arcname,
                            date_time=time.localtime(time.time())[:6])
            zinfo.compress_type = self.compression
            zinfo._compresslevel = self.compresslevel
            if zinfo.filename[-1] == '/':
                zinfo.external_attr = 0o40775 << 16   # drwxrwxr-x
                zinfo.external_attr |= 0x10           # MS-DOS directory flag
            else:
                zinfo.external_attr = 0o600 << 16     # ?rw-------
        else:
            zinfo = zinfo_or_arcname

        if not self.fp:
            raise ValueError(
                "Attempt to write to ZIP archive that was already closed")
        if self._writing:
            raise ValueError(
                "Can't write to ZIP archive while an open writing handle exists."
            )

        if compress_type is not None:
            zinfo.compress_type = compress_type

        if compresslevel is not None:
            zinfo._compresslevel = compresslevel

        zinfo.file_size = len(data)            # Uncompressed size
        with self._lock:
            with self.open(zinfo, mode='w') as dest:
                dest.write(data)

    def __del__(self):
        """Call the "close()" method in case the user forgot."""
        self.close()

    def close(self):
        """Close the file, and for mode 'w', 'x' and 'a' write the ending
        records."""
        if self.fp is None:
            return

        if self._writing:
            raise ValueError("Can't close the ZIP file while there is "
                             "an open writing handle on it. "
                             "Close the writing handle before closing the zip.")

        try:
            if self.mode in ('w', 'x', 'a') and self._didModify: # write ending records
                with self._lock:
                    if self._seekable:
                        self.fp.seek(self.start_dir)
                    self._write_end_record()
        finally:
            fp = self.fp
            self.fp = None
            self._fpclose(fp)

    def _write_end_record(self):
        for zinfo in self.filelist:         # write central directory
            dt = zinfo.date_time
            dosdate = (dt[0] - 1980) << 9 | dt[1] << 5 | dt[2]
            dostime = dt[3] << 11 | dt[4] << 5 | (dt[5] // 2)
            extra = []
            if zinfo.file_size > ZIP64_LIMIT \
               or zinfo.compress_size > ZIP64_LIMIT:
                extra.append(zinfo.file_size)
                extra.append(zinfo.compress_size)
                file_size = 0xffffffff
                compress_size = 0xffffffff
            else:
                file_size = zinfo.file_size
                compress_size = zinfo.compress_size

            if zinfo.header_offset > ZIP64_LIMIT:
                extra.append(zinfo.header_offset)
                header_offset = 0xffffffff
            else:
                header_offset = zinfo.header_offset

            extra_data = zinfo.extra
            min_version = 0
            if extra:
                # Append a ZIP64 field to the extra's
                extra_data = _strip_extra(extra_data, (1,))
                extra_data = struct.pack(
                    '<HH' + 'Q'*len(extra),
                    1, 8*len(extra), *extra) + extra_data

                min_version = ZIP64_VERSION

            if zinfo.compress_type == ZIP_BZIP2:
                min_version = max(BZIP2_VERSION, min_version)
            elif zinfo.compress_type == ZIP_LZMA:
                min_version = max(LZMA_VERSION, min_version)

            extract_version = max(min_version, zinfo.extract_version)
            create_version = max(min_version, zinfo.create_version)
            try:
                filename, flag_bits = zinfo._encodeFilenameFlags()
                centdir = struct.pack(structCentralDir,
                                      stringCentralDir, create_version,
                                      zinfo.create_system, extract_version, zinfo.reserved,
                                      flag_bits, zinfo.compress_type, dostime, dosdate,
                                      zinfo.CRC, compress_size, file_size,
                                      len(filename), len(extra_data), len(zinfo.comment),
                                      0, zinfo.internal_attr, zinfo.external_attr,
                                      header_offset)
            except DeprecationWarning:
                print((structCentralDir, stringCentralDir, create_version,
                       zinfo.create_system, extract_version, zinfo.reserved,
                       zinfo.flag_bits, zinfo.compress_type, dostime, dosdate,
                       zinfo.CRC, compress_size, file_size,
                       len(zinfo.filename), len(extra_data), len(zinfo.comment),
                       0, zinfo.internal_attr, zinfo.external_attr,
                       header_offset), file=sys.stderr)
                raise
            self.fp.write(centdir)
            self.fp.write(filename)
            self.fp.write(extra_data)
            self.fp.write(zinfo.comment)

        pos2 = self.fp.tell()
        # Write end-of-zip-archive record
        centDirCount = len(self.filelist)
        centDirSize = pos2 - self.start_dir
        centDirOffset = self.start_dir
        requires_zip64 = None
        if centDirCount > ZIP_FILECOUNT_LIMIT:
            requires_zip64 = "Files count"
        elif centDirOffset > ZIP64_LIMIT:
            requires_zip64 = "Central directory offset"
        elif centDirSize > ZIP64_LIMIT:
            requires_zip64 = "Central directory size"
        if requires_zip64:
            # Need to write the ZIP64 end-of-archive records
            if not self._allowZip64:
                raise LargeZipFile(requires_zip64 +
                                   " would require ZIP64 extensions")
            zip64endrec = struct.pack(
                structEndArchive64, stringEndArchive64,
                44, 45, 45, 0, 0, centDirCount, centDirCount,
                centDirSize, centDirOffset)
            self.fp.write(zip64endrec)

            zip64locrec = struct.pack(
                structEndArchive64Locator,
                stringEndArchive64Locator, 0, pos2, 1)
            self.fp.write(zip64locrec)
            centDirCount = min(centDirCount, 0xFFFF)
            centDirSize = min(centDirSize, 0xFFFFFFFF)
            centDirOffset = min(centDirOffset, 0xFFFFFFFF)

        endrec = struct.pack(structEndArchive, stringEndArchive,
                             0, 0, centDirCount, centDirCount,
                             centDirSize, centDirOffset, len(self._comment))
        self.fp.write(endrec)
        self.fp.write(self._comment)
        if self.mode == "a":
            self.fp.truncate()
        self.fp.flush()

    def _fpclose(self, fp):
        assert self._fileRefCnt > 0
        self._fileRefCnt -= 1
        if not self._fileRefCnt and not self._filePassed:
            fp.close()


class PyZipFile(ZipFile):
    """Class to create ZIP archives with Python library files and packages."""

    def __init__(self, file, mode="r", compression=ZIP_STORED,
                 allowZip64=True, optimize=-1):
        ZipFile.__init__(self, file, mode=mode, compression=compression,
                         allowZip64=allowZip64)
        self._optimize = optimize

    def writepy(self, pathname, basename="", filterfunc=None):
        """Add all files from "pathname" to the ZIP archive.

        If pathname is a package directory, search the directory and
        all package subdirectories recursively for all *.py and enter
        the modules into the archive.  If pathname is a plain
        directory, listdir *.py and enter all modules.  Else, pathname
        must be a Python *.py file and the module will be put into the
        archive.  Added modules are always module.pyc.
        This method will compile the module.py into module.pyc if
        necessary.
        If filterfunc(pathname) is given, it is called with every argument.
        When it is False, the file or directory is skipped.
        """
        pathname = os.fspath(pathname)
        if filterfunc and not filterfunc(pathname):
            if self.debug:
                label = 'path' if os.path.isdir(pathname) else 'file'
                print('%s %r skipped by filterfunc' % (label, pathname))
            return
        dir, name = os.path.split(pathname)
        if os.path.isdir(pathname):
            initname = os.path.join(pathname, "__init__.py")
            if os.path.isfile(initname):
                # This is a package directory, add it
                if basename:
                    basename = "%s/%s" % (basename, name)
                else:
                    basename = name
                if self.debug:
                    print("Adding package in", pathname, "as", basename)
                fname, arcname = self._get_codename(initname[0:-3], basename)
                if self.debug:
                    print("Adding", arcname)
                self.write(fname, arcname)
                dirlist = sorted(os.listdir(pathname))
                dirlist.remove("__init__.py")
                # Add all *.py files and package subdirectories
                for filename in dirlist:
                    path = os.path.join(pathname, filename)
                    root, ext = os.path.splitext(filename)
                    if os.path.isdir(path):
                        if os.path.isfile(os.path.join(path, "__init__.py")):
                            # This is a package directory, add it
                            self.writepy(path, basename,
                                         filterfunc=filterfunc)  # Recursive call
                    elif ext == ".py":
                        if filterfunc and not filterfunc(path):
                            if self.debug:
                                print('file %r skipped by filterfunc' % path)
                            continue
                        fname, arcname = self._get_codename(path[0:-3],
                                                            basename)
                        if self.debug:
                            print("Adding", arcname)
                        self.write(fname, arcname)
            else:
                # This is NOT a package directory, add its files at top level
                if self.debug:
                    print("Adding files from directory", pathname)
                for filename in sorted(os.listdir(pathname)):
                    path = os.path.join(pathname, filename)
                    root, ext = os.path.splitext(filename)
                    if ext == ".py":
                        if filterfunc and not filterfunc(path):
                            if self.debug:
                                print('file %r skipped by filterfunc' % path)
                            continue
                        fname, arcname = self._get_codename(path[0:-3],
                                                            basename)
                        if self.debug:
                            print("Adding", arcname)
                        self.write(fname, arcname)
        else:
            if pathname[-3:] != ".py":
                raise RuntimeError(
                    'Files added with writepy() must end with ".py"')
            fname, arcname = self._get_codename(pathname[0:-3], basename)
            if self.debug:
                print("Adding file", arcname)
            self.write(fname, arcname)

    def _get_codename(self, pathname, basename):
        """Return (filename, archivename) for the path.

        Given a module name path, return the correct file path and
        archive name, compiling if necessary.  For example, given
        /python/lib/string, return (/python/lib/string.pyc, string).
        """
        def _compile(file, optimize=-1):
            import py_compile
            if self.debug:
                print("Compiling", file)
            try:
                py_compile.compile(file, doraise=True, optimize=optimize)
            except py_compile.PyCompileError as err:
                print(err.msg)
                return False
            return True

        file_py  = pathname + ".py"
        file_pyc = pathname + ".pyc"
        pycache_opt0 = importlib.util.cache_from_source(file_py, optimization='')
        pycache_opt1 = importlib.util.cache_from_source(file_py, optimization=1)
        pycache_opt2 = importlib.util.cache_from_source(file_py, optimization=2)
        if self._optimize == -1:
            # legacy mode: use whatever file is present
            if (os.path.isfile(file_pyc) and
                  os.stat(file_pyc).st_mtime >= os.stat(file_py).st_mtime):
                # Use .pyc file.
                arcname = fname = file_pyc
            elif (os.path.isfile(pycache_opt0) and
                  os.stat(pycache_opt0).st_mtime >= os.stat(file_py).st_mtime):
                # Use the __pycache__/*.pyc file, but write it to the legacy pyc
                # file name in the archive.
                fname = pycache_opt0
                arcname = file_pyc
            elif (os.path.isfile(pycache_opt1) and
                  os.stat(pycache_opt1).st_mtime >= os.stat(file_py).st_mtime):
                # Use the __pycache__/*.pyc file, but write it to the legacy pyc
                # file name in the archive.
                fname = pycache_opt1
                arcname = file_pyc
            elif (os.path.isfile(pycache_opt2) and
                  os.stat(pycache_opt2).st_mtime >= os.stat(file_py).st_mtime):
                # Use the __pycache__/*.pyc file, but write it to the legacy pyc
                # file name in the archive.
                fname = pycache_opt2
                arcname = file_pyc
            else:
                # Compile py into PEP 3147 pyc file.
                if _compile(file_py):
                    if sys.flags.optimize == 0:
                        fname = pycache_opt0
                    elif sys.flags.optimize == 1:
                        fname = pycache_opt1
                    else:
                        fname = pycache_opt2
                    arcname = file_pyc
                else:
                    fname = arcname = file_py
        else:
            # new mode: use given optimization level
            if self._optimize == 0:
                fname = pycache_opt0
                arcname = file_pyc
            else:
                arcname = file_pyc
                if self._optimize == 1:
                    fname = pycache_opt1
                elif self._optimize == 2:
                    fname = pycache_opt2
                else:
                    msg = "invalid value for 'optimize': {!r}".format(self._optimize)
                    raise ValueError(msg)
            if not (os.path.isfile(fname) and
                    os.stat(fname).st_mtime >= os.stat(file_py).st_mtime):
                if not _compile(file_py, optimize=self._optimize):
                    fname = arcname = file_py
        archivename = os.path.split(arcname)[1]
        if basename:
            archivename = "%s/%s" % (basename, archivename)
        return (fname, archivename)


def _parents(path):
    """
    Given a path with elements separated by
    posixpath.sep, generate all parents of that path.

    >>> list(_parents('b/d'))
    ['b']
    >>> list(_parents('/b/d/'))
    ['/b']
    >>> list(_parents('b/d/f/'))
    ['b/d', 'b']
    >>> list(_parents('b'))
    []
    >>> list(_parents(''))
    []
    """
    return itertools.islice(_ancestry(path), 1, None)


def _ancestry(path):
    """
    Given a path with elements separated by
    posixpath.sep, generate all elements of that path

    >>> list(_ancestry('b/d'))
    ['b/d', 'b']
    >>> list(_ancestry('/b/d/'))
    ['/b/d', '/b']
    >>> list(_ancestry('b/d/f/'))
    ['b/d/f', 'b/d', 'b']
    >>> list(_ancestry('b'))
    ['b']
    >>> list(_ancestry(''))
    []
    """
    path = path.rstrip(posixpath.sep)
    while path and path != posixpath.sep:
        yield path
        path, tail = posixpath.split(path)


_dedupe = dict.fromkeys
"""Deduplicate an iterable in original order"""


def _difference(minuend, subtrahend):
    """
    Return items in minuend not in subtrahend, retaining order
    with O(1) lookup.
    """
    return itertools.filterfalse(set(subtrahend).__contains__, minuend)


class CompleteDirs(ZipFile):
    """
    A ZipFile subclass that ensures that implied directories
    are always included in the namelist.
    """

    @staticmethod
    def _implied_dirs(names):
        parents = itertools.chain.from_iterable(map(_parents, names))
        as_dirs = (p + posixpath.sep for p in parents)
        return _dedupe(_difference(as_dirs, names))

    def namelist(self):
        names = super(CompleteDirs, self).namelist()
        return names + list(self._implied_dirs(names))

    def _name_set(self):
        return set(self.namelist())

    def resolve_dir(self, name):
        """
        If the name represents a directory, return that name
        as a directory (with the trailing slash).
        """
        names = self._name_set()
        dirname = name + '/'
        dir_match = name not in names and dirname in names
        return dirname if dir_match else name

    @classmethod
    def make(cls, source):
        """
        Given a source (filename or zipfile), return an
        appropriate CompleteDirs subclass.
        """
        if isinstance(source, CompleteDirs):
            return source

        if not isinstance(source, ZipFile):
            return cls(source)

        # Only allow for FastPath when supplied zipfile is read-only
        if 'r' not in source.mode:
            cls = CompleteDirs

        res = cls.__new__(cls)
        vars(res).update(vars(source))
        return res


class FastLookup(CompleteDirs):
    """
    ZipFile subclass to ensure implicit
    dirs exist and are resolved rapidly.
    """
    def namelist(self):
        with contextlib.suppress(AttributeError):
            return self.__names
        self.__names = super(FastLookup, self).namelist()
        return self.__names

    def _name_set(self):
        with contextlib.suppress(AttributeError):
            return self.__lookup
        self.__lookup = super(FastLookup, self)._name_set()
        return self.__lookup


class Path:
    """
    A pathlib-compatible interface for zip files.

    Consider a zip file with this structure::

        .
        ├── a.txt
        └── b
            ├── c.txt
            └── d
                └── e.txt

    >>> data = io.BytesIO()
    >>> zf = ZipFile(data, 'w')
    >>> zf.writestr('a.txt', 'content of a')
    >>> zf.writestr('b/c.txt', 'content of c')
    >>> zf.writestr('b/d/e.txt', 'content of e')
    >>> zf.filename = 'abcde.zip'

    Path accepts the zipfile object itself or a filename

    >>> root = Path(zf)

    From there, several path operations are available.

    Directory iteration (including the zip file itself):

    >>> a, b = root.iterdir()
    >>> a
    Path('abcde.zip', 'a.txt')
    >>> b
    Path('abcde.zip', 'b/')

    name property:

    >>> b.name
    'b'

    join with divide operator:

    >>> c = b / 'c.txt'
    >>> c
    Path('abcde.zip', 'b/c.txt')
    >>> c.name
    'c.txt'

    Read text:

    >>> c.read_text()
    'content of c'

    existence:

    >>> c.exists()
    True
    >>> (b / 'missing.txt').exists()
    False

    Coercion to string:

    >>> str(c)
    'abcde.zip/b/c.txt'
    """

    __repr = "{self.__class__.__name__}({self.root.filename!r}, {self.at!r})"

    def __init__(self, root, at=""):
        self.root = FastLookup.make(root)
        self.at = at

    @property
    def open(self):
        return functools.partial(self.root.open, self.at)

    @property
    def name(self):
        return posixpath.basename(self.at.rstrip("/"))

    def read_text(self, *args, **kwargs):
        with self.open() as strm:
            return io.TextIOWrapper(strm, *args, **kwargs).read()

    def read_bytes(self):
        with self.open() as strm:
            return strm.read()

    def _is_child(self, path):
        return posixpath.dirname(path.at.rstrip("/")) == self.at.rstrip("/")

    def _next(self, at):
        return Path(self.root, at)

    def is_dir(self):
        return not self.at or self.at.endswith("/")

    def is_file(self):
        return not self.is_dir()

    def exists(self):
        return self.at in self.root._name_set()

    def iterdir(self):
        if not self.is_dir():
            raise ValueError("Can't listdir a file")
        subs = map(self._next, self.root.namelist())
        return filter(self._is_child, subs)

    def __str__(self):
        return posixpath.join(self.root.filename, self.at)

    def __repr__(self):
        return self.__repr.format(self=self)

    def joinpath(self, add):
        next = posixpath.join(self.at, add)
        return self._next(self.root.resolve_dir(next))

    __truediv__ = joinpath

    @property
    def parent(self):
        parent_at = posixpath.dirname(self.at.rstrip('/'))
        if parent_at:
            parent_at += '/'
        return self._next(parent_at)


def main(args=None):
    import argparse

    description = 'A simple command-line interface for zipfile module.'
    parser = argparse.ArgumentParser(description=description)
    group = parser.add_mutually_exclusive_group(required=True)
    group.add_argument('-l', '--list', metavar='<zipfile>',
                       help='Show listing of a zipfile')
    group.add_argument('-e', '--extract', nargs=2,
                       metavar=('<zipfile>', '<output_dir>'),
                       help='Extract zipfile into target dir')
    group.add_argument('-c', '--create', nargs='+',
                       metavar=('<name>', '<file>'),
                       help='Create zipfile from sources')
    group.add_argument('-t', '--test', metavar='<zipfile>',
                       help='Test if a zipfile is valid')
    args = parser.parse_args(args)

    if args.test is not None:
        src = args.test
        with ZipFile(src, 'r') as zf:
            badfile = zf.testzip()
        if badfile:
            print("The following enclosed file is corrupted: {!r}".format(badfile))
        print("Done testing")

    elif args.list is not None:
        src = args.list
        with ZipFile(src, 'r') as zf:
            zf.printdir()

    elif args.extract is not None:
        src, curdir = args.extract
        with ZipFile(src, 'r') as zf:
            zf.extractall(curdir)

    elif args.create is not None:
        zip_name = args.create.pop(0)
        files = args.create

        def addToZip(zf, path, zippath):
            if os.path.isfile(path):
                zf.write(path, zippath, ZIP_DEFLATED)
            elif os.path.isdir(path):
                if zippath:
                    zf.write(path, zippath)
                for nm in sorted(os.listdir(path)):
                    addToZip(zf,
                             os.path.join(path, nm), os.path.join(zippath, nm))
            # else: ignore

        with ZipFile(zip_name, 'w') as zf:
            for path in files:
                zippath = os.path.basename(path)
                if not zippath:
                    zippath = os.path.basename(os.path.dirname(path))
                if zippath in ('', os.curdir, os.pardir):
                    zippath = ''
                addToZip(zf, path, zippath)


if __name__ == "__main__":
    main()
imp.py000064400000024450151153537530005720 0ustar00"""This module provides the components needed to build your own __import__
function.  Undocumented functions are obsolete.

In most cases it is preferred you consider using the importlib module's
functionality over this module.

"""
# (Probably) need to stay in _imp
from _imp import (lock_held, acquire_lock, release_lock,
                  get_frozen_object, is_frozen_package,
                  init_frozen, is_builtin, is_frozen,
                  _fix_co_filename)
try:
    from _imp import create_dynamic
except ImportError:
    # Platform doesn't support dynamic loading.
    create_dynamic = None

from importlib._bootstrap import _ERR_MSG, _exec, _load, _builtin_from_name
from importlib._bootstrap_external import SourcelessFileLoader

from importlib import machinery
from importlib import util
import importlib
import os
import sys
import tokenize
import types
import warnings

warnings.warn("the imp module is deprecated in favour of importlib; "
              "see the module's documentation for alternative uses",
              DeprecationWarning, stacklevel=2)

# DEPRECATED
SEARCH_ERROR = 0
PY_SOURCE = 1
PY_COMPILED = 2
C_EXTENSION = 3
PY_RESOURCE = 4
PKG_DIRECTORY = 5
C_BUILTIN = 6
PY_FROZEN = 7
PY_CODERESOURCE = 8
IMP_HOOK = 9


def new_module(name):
    """**DEPRECATED**

    Create a new module.

    The module is not entered into sys.modules.

    """
    return types.ModuleType(name)


def get_magic():
    """**DEPRECATED**

    Return the magic number for .pyc files.
    """
    return util.MAGIC_NUMBER


def get_tag():
    """Return the magic tag for .pyc files."""
    return sys.implementation.cache_tag


def cache_from_source(path, debug_override=None):
    """**DEPRECATED**

    Given the path to a .py file, return the path to its .pyc file.

    The .py file does not need to exist; this simply returns the path to the
    .pyc file calculated as if the .py file were imported.

    If debug_override is not None, then it must be a boolean and is used in
    place of sys.flags.optimize.

    If sys.implementation.cache_tag is None then NotImplementedError is raised.

    """
    with warnings.catch_warnings():
        warnings.simplefilter('ignore')
        return util.cache_from_source(path, debug_override)


def source_from_cache(path):
    """**DEPRECATED**

    Given the path to a .pyc. file, return the path to its .py file.

    The .pyc file does not need to exist; this simply returns the path to
    the .py file calculated to correspond to the .pyc file.  If path does
    not conform to PEP 3147 format, ValueError will be raised. If
    sys.implementation.cache_tag is None then NotImplementedError is raised.

    """
    return util.source_from_cache(path)


def get_suffixes():
    """**DEPRECATED**"""
    extensions = [(s, 'rb', C_EXTENSION) for s in machinery.EXTENSION_SUFFIXES]
    source = [(s, 'r', PY_SOURCE) for s in machinery.SOURCE_SUFFIXES]
    bytecode = [(s, 'rb', PY_COMPILED) for s in machinery.BYTECODE_SUFFIXES]

    return extensions + source + bytecode


class NullImporter:

    """**DEPRECATED**

    Null import object.

    """

    def __init__(self, path):
        if path == '':
            raise ImportError('empty pathname', path='')
        elif os.path.isdir(path):
            raise ImportError('existing directory', path=path)

    def find_module(self, fullname):
        """Always returns None."""
        return None


class _HackedGetData:

    """Compatibility support for 'file' arguments of various load_*()
    functions."""

    def __init__(self, fullname, path, file=None):
        super().__init__(fullname, path)
        self.file = file

    def get_data(self, path):
        """Gross hack to contort loader to deal w/ load_*()'s bad API."""
        if self.file and path == self.path:
            # The contract of get_data() requires us to return bytes. Reopen the
            # file in binary mode if needed.
            if not self.file.closed:
                file = self.file
                if 'b' not in file.mode:
                    file.close()
            if self.file.closed:
                self.file = file = open(self.path, 'rb')

            with file:
                return file.read()
        else:
            return super().get_data(path)


class _LoadSourceCompatibility(_HackedGetData, machinery.SourceFileLoader):

    """Compatibility support for implementing load_source()."""


def load_source(name, pathname, file=None):
    loader = _LoadSourceCompatibility(name, pathname, file)
    spec = util.spec_from_file_location(name, pathname, loader=loader)
    if name in sys.modules:
        module = _exec(spec, sys.modules[name])
    else:
        module = _load(spec)
    # To allow reloading to potentially work, use a non-hacked loader which
    # won't rely on a now-closed file object.
    module.__loader__ = machinery.SourceFileLoader(name, pathname)
    module.__spec__.loader = module.__loader__
    return module


class _LoadCompiledCompatibility(_HackedGetData, SourcelessFileLoader):

    """Compatibility support for implementing load_compiled()."""


def load_compiled(name, pathname, file=None):
    """**DEPRECATED**"""
    loader = _LoadCompiledCompatibility(name, pathname, file)
    spec = util.spec_from_file_location(name, pathname, loader=loader)
    if name in sys.modules:
        module = _exec(spec, sys.modules[name])
    else:
        module = _load(spec)
    # To allow reloading to potentially work, use a non-hacked loader which
    # won't rely on a now-closed file object.
    module.__loader__ = SourcelessFileLoader(name, pathname)
    module.__spec__.loader = module.__loader__
    return module


def load_package(name, path):
    """**DEPRECATED**"""
    if os.path.isdir(path):
        extensions = (machinery.SOURCE_SUFFIXES[:] +
                      machinery.BYTECODE_SUFFIXES[:])
        for extension in extensions:
            init_path = os.path.join(path, '__init__' + extension)
            if os.path.exists(init_path):
                path = init_path
                break
        else:
            raise ValueError('{!r} is not a package'.format(path))
    spec = util.spec_from_file_location(name, path,
                                        submodule_search_locations=[])
    if name in sys.modules:
        return _exec(spec, sys.modules[name])
    else:
        return _load(spec)


def load_module(name, file, filename, details):
    """**DEPRECATED**

    Load a module, given information returned by find_module().

    The module name must include the full package name, if any.

    """
    suffix, mode, type_ = details
    if mode and (not mode.startswith(('r', 'U')) or '+' in mode):
        raise ValueError('invalid file open mode {!r}'.format(mode))
    elif file is None and type_ in {PY_SOURCE, PY_COMPILED}:
        msg = 'file object required for import (type code {})'.format(type_)
        raise ValueError(msg)
    elif type_ == PY_SOURCE:
        return load_source(name, filename, file)
    elif type_ == PY_COMPILED:
        return load_compiled(name, filename, file)
    elif type_ == C_EXTENSION and load_dynamic is not None:
        if file is None:
            with open(filename, 'rb') as opened_file:
                return load_dynamic(name, filename, opened_file)
        else:
            return load_dynamic(name, filename, file)
    elif type_ == PKG_DIRECTORY:
        return load_package(name, filename)
    elif type_ == C_BUILTIN:
        return init_builtin(name)
    elif type_ == PY_FROZEN:
        return init_frozen(name)
    else:
        msg =  "Don't know how to import {} (type code {})".format(name, type_)
        raise ImportError(msg, name=name)


def find_module(name, path=None):
    """**DEPRECATED**

    Search for a module.

    If path is omitted or None, search for a built-in, frozen or special
    module and continue search in sys.path. The module name cannot
    contain '.'; to search for a submodule of a package, pass the
    submodule name and the package's __path__.

    """
    if not isinstance(name, str):
        raise TypeError("'name' must be a str, not {}".format(type(name)))
    elif not isinstance(path, (type(None), list)):
        # Backwards-compatibility
        raise RuntimeError("'path' must be None or a list, "
                           "not {}".format(type(path)))

    if path is None:
        if is_builtin(name):
            return None, None, ('', '', C_BUILTIN)
        elif is_frozen(name):
            return None, None, ('', '', PY_FROZEN)
        else:
            path = sys.path

    for entry in path:
        package_directory = os.path.join(entry, name)
        for suffix in ['.py', machinery.BYTECODE_SUFFIXES[0]]:
            package_file_name = '__init__' + suffix
            file_path = os.path.join(package_directory, package_file_name)
            if os.path.isfile(file_path):
                return None, package_directory, ('', '', PKG_DIRECTORY)
        for suffix, mode, type_ in get_suffixes():
            file_name = name + suffix
            file_path = os.path.join(entry, file_name)
            if os.path.isfile(file_path):
                break
        else:
            continue
        break  # Break out of outer loop when breaking out of inner loop.
    else:
        raise ImportError(_ERR_MSG.format(name), name=name)

    encoding = None
    if 'b' not in mode:
        with open(file_path, 'rb') as file:
            encoding = tokenize.detect_encoding(file.readline)[0]
    file = open(file_path, mode, encoding=encoding)
    return file, file_path, (suffix, mode, type_)


def reload(module):
    """**DEPRECATED**

    Reload the module and return it.

    The module must have been successfully imported before.

    """
    return importlib.reload(module)


def init_builtin(name):
    """**DEPRECATED**

    Load and return a built-in module by name, or None is such module doesn't
    exist
    """
    try:
        return _builtin_from_name(name)
    except ImportError:
        return None


if create_dynamic:
    def load_dynamic(name, path, file=None):
        """**DEPRECATED**

        Load an extension module.
        """
        import importlib.machinery
        loader = importlib.machinery.ExtensionFileLoader(name, path)

        # Issue #24748: Skip the sys.modules check in _load_module_shim;
        # always load new extension
        spec = importlib.machinery.ModuleSpec(
            name=name, loader=loader, origin=path)
        return _load(spec)

else:
    load_dynamic = None
LICENSE.txt000064400000033161151153537530006403 0ustar00A. HISTORY OF THE SOFTWARE
==========================

Python was created in the early 1990s by Guido van Rossum at Stichting
Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands
as a successor of a language called ABC.  Guido remains Python's
principal author, although it includes many contributions from others.

In 1995, Guido continued his work on Python at the Corporation for
National Research Initiatives (CNRI, see http://www.cnri.reston.va.us)
in Reston, Virginia where he released several versions of the
software.

In May 2000, Guido and the Python core development team moved to
BeOpen.com to form the BeOpen PythonLabs team.  In October of the same
year, the PythonLabs team moved to Digital Creations, which became
Zope Corporation.  In 2001, the Python Software Foundation (PSF, see
https://www.python.org/psf/) was formed, a non-profit organization
created specifically to own Python-related Intellectual Property.
Zope Corporation was a sponsoring member of the PSF.

All Python releases are Open Source (see http://www.opensource.org for
the Open Source Definition).  Historically, most, but not all, Python
releases have also been GPL-compatible; the table below summarizes
the various releases.

    Release         Derived     Year        Owner       GPL-
                    from                                compatible? (1)

    0.9.0 thru 1.2              1991-1995   CWI         yes
    1.3 thru 1.5.2  1.2         1995-1999   CNRI        yes
    1.6             1.5.2       2000        CNRI        no
    2.0             1.6         2000        BeOpen.com  no
    1.6.1           1.6         2001        CNRI        yes (2)
    2.1             2.0+1.6.1   2001        PSF         no
    2.0.1           2.0+1.6.1   2001        PSF         yes
    2.1.1           2.1+2.0.1   2001        PSF         yes
    2.1.2           2.1.1       2002        PSF         yes
    2.1.3           2.1.2       2002        PSF         yes
    2.2 and above   2.1.1       2001-now    PSF         yes

Footnotes:

(1) GPL-compatible doesn't mean that we're distributing Python under
    the GPL.  All Python licenses, unlike the GPL, let you distribute
    a modified version without making your changes open source.  The
    GPL-compatible licenses make it possible to combine Python with
    other software that is released under the GPL; the others don't.

(2) According to Richard Stallman, 1.6.1 is not GPL-compatible,
    because its license has a choice of law clause.  According to
    CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1
    is "not incompatible" with the GPL.

Thanks to the many outside volunteers who have worked under Guido's
direction to make these releases possible.


B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON
===============================================================

Python software and documentation are licensed under the
Python Software Foundation License Version 2.

Starting with Python 3.8.6, examples, recipes, and other code in
the documentation are dual licensed under the PSF License Version 2
and the Zero-Clause BSD license.

Some software incorporated into Python is under different licenses.
The licenses are listed with code falling under that license.


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

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

2. Subject to the terms and conditions of this License Agreement, PSF hereby
grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
analyze, test, perform and/or display publicly, prepare derivative works,
distribute, and otherwise use Python alone or in any derivative version,
provided, however, that PSF's License Agreement and PSF's notice of copyright,
i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Python Software Foundation;
All Rights Reserved" are retained in Python alone or in any derivative version
prepared by Licensee.

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

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

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

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

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

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


BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0
-------------------------------------------

BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1

1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an
office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the
Individual or Organization ("Licensee") accessing and otherwise using
this software in source or binary form and its associated
documentation ("the Software").

2. Subject to the terms and conditions of this BeOpen Python License
Agreement, BeOpen hereby grants Licensee a non-exclusive,
royalty-free, world-wide license to reproduce, analyze, test, perform
and/or display publicly, prepare derivative works, distribute, and
otherwise use the Software alone or in any derivative version,
provided, however, that the BeOpen Python License is retained in the
Software, alone or in any derivative version prepared by Licensee.

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

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

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

6. This License Agreement shall be governed by and interpreted in all
respects by the law of the State of California, excluding conflict of
law provisions.  Nothing in this License Agreement shall be deemed to
create any relationship of agency, partnership, or joint venture
between BeOpen and Licensee.  This License Agreement does not grant
permission to use BeOpen trademarks or trade names in a trademark
sense to endorse or promote products or services of Licensee, or any
third party.  As an exception, the "BeOpen Python" logos available at
http://www.pythonlabs.com/logos.html may be used according to the
permissions granted on that web page.

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


CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1
---------------------------------------

1. This LICENSE AGREEMENT is between the Corporation for National
Research Initiatives, having an office at 1895 Preston White Drive,
Reston, VA 20191 ("CNRI"), and the Individual or Organization
("Licensee") accessing and otherwise using Python 1.6.1 software in
source or binary form and its associated documentation.

2. Subject to the terms and conditions of this License Agreement, CNRI
hereby grants Licensee a nonexclusive, royalty-free, world-wide
license to reproduce, analyze, test, perform and/or display publicly,
prepare derivative works, distribute, and otherwise use Python 1.6.1
alone or in any derivative version, provided, however, that CNRI's
License Agreement and CNRI's notice of copyright, i.e., "Copyright (c)
1995-2001 Corporation for National Research Initiatives; All Rights
Reserved" are retained in Python 1.6.1 alone or in any derivative
version prepared by Licensee.  Alternately, in lieu of CNRI's License
Agreement, Licensee may substitute the following text (omitting the
quotes): "Python 1.6.1 is made available subject to the terms and
conditions in CNRI's License Agreement.  This Agreement together with
Python 1.6.1 may be located on the Internet using the following
unique, persistent identifier (known as a handle): 1895.22/1013.  This
Agreement may also be obtained from a proxy server on the Internet
using the following URL: http://hdl.handle.net/1895.22/1013".

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

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

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

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

7. This License Agreement shall be governed by the federal
intellectual property law of the United States, including without
limitation the federal copyright law, and, to the extent such
U.S. federal law does not apply, by the law of the Commonwealth of
Virginia, excluding Virginia's conflict of law provisions.
Notwithstanding the foregoing, with regard to derivative works based
on Python 1.6.1 that incorporate non-separable material that was
previously distributed under the GNU General Public License (GPL), the
law of the Commonwealth of Virginia shall govern this License
Agreement only as to issues arising under or with respect to
Paragraphs 4, 5, and 7 of this License Agreement.  Nothing in this
License Agreement shall be deemed to create any relationship of
agency, partnership, or joint venture between CNRI and Licensee.  This
License Agreement does not grant permission to use CNRI trademarks or
trade name in a trademark sense to endorse or promote products or
services of Licensee, or any third party.

8. By clicking on the "ACCEPT" button where indicated, or by copying,
installing or otherwise using Python 1.6.1, Licensee agrees to be
bound by the terms and conditions of this License Agreement.

        ACCEPT


CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2
--------------------------------------------------

Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam,
The Netherlands.  All rights reserved.

Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Stichting Mathematisch
Centrum or CWI not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior
permission.

STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

ZERO-CLAUSE BSD LICENSE FOR CODE IN THE PYTHON DOCUMENTATION
----------------------------------------------------------------------

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
base64.py000075500000047636151153537530006235 0ustar00#! /usr/bin/python3.8

"""Base16, Base32, Base64 (RFC 3548), Base85 and Ascii85 data encodings"""

# Modified 04-Oct-1995 by Jack Jansen to use binascii module
# Modified 30-Dec-2003 by Barry Warsaw to add full RFC 3548 support
# Modified 22-May-2007 by Guido van Rossum to use bytes everywhere

import re
import struct
import binascii


__all__ = [
    # Legacy interface exports traditional RFC 2045 Base64 encodings
    'encode', 'decode', 'encodebytes', 'decodebytes',
    # Generalized interface for other encodings
    'b64encode', 'b64decode', 'b32encode', 'b32decode',
    'b16encode', 'b16decode',
    # Base85 and Ascii85 encodings
    'b85encode', 'b85decode', 'a85encode', 'a85decode',
    # Standard Base64 encoding
    'standard_b64encode', 'standard_b64decode',
    # Some common Base64 alternatives.  As referenced by RFC 3458, see thread
    # starting at:
    #
    # http://zgp.org/pipermail/p2p-hackers/2001-September/000316.html
    'urlsafe_b64encode', 'urlsafe_b64decode',
    ]


bytes_types = (bytes, bytearray)  # Types acceptable as binary data

def _bytes_from_decode_data(s):
    if isinstance(s, str):
        try:
            return s.encode('ascii')
        except UnicodeEncodeError:
            raise ValueError('string argument should contain only ASCII characters')
    if isinstance(s, bytes_types):
        return s
    try:
        return memoryview(s).tobytes()
    except TypeError:
        raise TypeError("argument should be a bytes-like object or ASCII "
                        "string, not %r" % s.__class__.__name__) from None


# Base64 encoding/decoding uses binascii

def b64encode(s, altchars=None):
    """Encode the bytes-like object s using Base64 and return a bytes object.

    Optional altchars should be a byte string of length 2 which specifies an
    alternative alphabet for the '+' and '/' characters.  This allows an
    application to e.g. generate url or filesystem safe Base64 strings.
    """
    encoded = binascii.b2a_base64(s, newline=False)
    if altchars is not None:
        assert len(altchars) == 2, repr(altchars)
        return encoded.translate(bytes.maketrans(b'+/', altchars))
    return encoded


def b64decode(s, altchars=None, validate=False):
    """Decode the Base64 encoded bytes-like object or ASCII string s.

    Optional altchars must be a bytes-like object or ASCII string of length 2
    which specifies the alternative alphabet used instead of the '+' and '/'
    characters.

    The result is returned as a bytes object.  A binascii.Error is raised if
    s is incorrectly padded.

    If validate is False (the default), characters that are neither in the
    normal base-64 alphabet nor the alternative alphabet are discarded prior
    to the padding check.  If validate is True, these non-alphabet characters
    in the input result in a binascii.Error.
    """
    s = _bytes_from_decode_data(s)
    if altchars is not None:
        altchars = _bytes_from_decode_data(altchars)
        assert len(altchars) == 2, repr(altchars)
        s = s.translate(bytes.maketrans(altchars, b'+/'))
    if validate and not re.fullmatch(b'[A-Za-z0-9+/]*={0,2}', s):
        raise binascii.Error('Non-base64 digit found')
    return binascii.a2b_base64(s)


def standard_b64encode(s):
    """Encode bytes-like object s using the standard Base64 alphabet.

    The result is returned as a bytes object.
    """
    return b64encode(s)

def standard_b64decode(s):
    """Decode bytes encoded with the standard Base64 alphabet.

    Argument s is a bytes-like object or ASCII string to decode.  The result
    is returned as a bytes object.  A binascii.Error is raised if the input
    is incorrectly padded.  Characters that are not in the standard alphabet
    are discarded prior to the padding check.
    """
    return b64decode(s)


_urlsafe_encode_translation = bytes.maketrans(b'+/', b'-_')
_urlsafe_decode_translation = bytes.maketrans(b'-_', b'+/')

def urlsafe_b64encode(s):
    """Encode bytes using the URL- and filesystem-safe Base64 alphabet.

    Argument s is a bytes-like object to encode.  The result is returned as a
    bytes object.  The alphabet uses '-' instead of '+' and '_' instead of
    '/'.
    """
    return b64encode(s).translate(_urlsafe_encode_translation)

def urlsafe_b64decode(s):
    """Decode bytes using the URL- and filesystem-safe Base64 alphabet.

    Argument s is a bytes-like object or ASCII string to decode.  The result
    is returned as a bytes object.  A binascii.Error is raised if the input
    is incorrectly padded.  Characters that are not in the URL-safe base-64
    alphabet, and are not a plus '+' or slash '/', are discarded prior to the
    padding check.

    The alphabet uses '-' instead of '+' and '_' instead of '/'.
    """
    s = _bytes_from_decode_data(s)
    s = s.translate(_urlsafe_decode_translation)
    return b64decode(s)



# Base32 encoding/decoding must be done in Python
_b32alphabet = b'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'
_b32tab2 = None
_b32rev = None

def b32encode(s):
    """Encode the bytes-like object s using Base32 and return a bytes object.
    """
    global _b32tab2
    # Delay the initialization of the table to not waste memory
    # if the function is never called
    if _b32tab2 is None:
        b32tab = [bytes((i,)) for i in _b32alphabet]
        _b32tab2 = [a + b for a in b32tab for b in b32tab]
        b32tab = None

    if not isinstance(s, bytes_types):
        s = memoryview(s).tobytes()
    leftover = len(s) % 5
    # Pad the last quantum with zero bits if necessary
    if leftover:
        s = s + b'\0' * (5 - leftover)  # Don't use += !
    encoded = bytearray()
    from_bytes = int.from_bytes
    b32tab2 = _b32tab2
    for i in range(0, len(s), 5):
        c = from_bytes(s[i: i + 5], 'big')
        encoded += (b32tab2[c >> 30] +           # bits 1 - 10
                    b32tab2[(c >> 20) & 0x3ff] + # bits 11 - 20
                    b32tab2[(c >> 10) & 0x3ff] + # bits 21 - 30
                    b32tab2[c & 0x3ff]           # bits 31 - 40
                   )
    # Adjust for any leftover partial quanta
    if leftover == 1:
        encoded[-6:] = b'======'
    elif leftover == 2:
        encoded[-4:] = b'===='
    elif leftover == 3:
        encoded[-3:] = b'==='
    elif leftover == 4:
        encoded[-1:] = b'='
    return bytes(encoded)

def b32decode(s, casefold=False, map01=None):
    """Decode the Base32 encoded bytes-like object or ASCII string s.

    Optional casefold is a flag specifying whether a lowercase alphabet is
    acceptable as input.  For security purposes, the default is False.

    RFC 3548 allows for optional mapping of the digit 0 (zero) to the
    letter O (oh), and for optional mapping of the digit 1 (one) to
    either the letter I (eye) or letter L (el).  The optional argument
    map01 when not None, specifies which letter the digit 1 should be
    mapped to (when map01 is not None, the digit 0 is always mapped to
    the letter O).  For security purposes the default is None, so that
    0 and 1 are not allowed in the input.

    The result is returned as a bytes object.  A binascii.Error is raised if
    the input is incorrectly padded or if there are non-alphabet
    characters present in the input.
    """
    global _b32rev
    # Delay the initialization of the table to not waste memory
    # if the function is never called
    if _b32rev is None:
        _b32rev = {v: k for k, v in enumerate(_b32alphabet)}
    s = _bytes_from_decode_data(s)
    if len(s) % 8:
        raise binascii.Error('Incorrect padding')
    # Handle section 2.4 zero and one mapping.  The flag map01 will be either
    # False, or the character to map the digit 1 (one) to.  It should be
    # either L (el) or I (eye).
    if map01 is not None:
        map01 = _bytes_from_decode_data(map01)
        assert len(map01) == 1, repr(map01)
        s = s.translate(bytes.maketrans(b'01', b'O' + map01))
    if casefold:
        s = s.upper()
    # Strip off pad characters from the right.  We need to count the pad
    # characters because this will tell us how many null bytes to remove from
    # the end of the decoded string.
    l = len(s)
    s = s.rstrip(b'=')
    padchars = l - len(s)
    # Now decode the full quanta
    decoded = bytearray()
    b32rev = _b32rev
    for i in range(0, len(s), 8):
        quanta = s[i: i + 8]
        acc = 0
        try:
            for c in quanta:
                acc = (acc << 5) + b32rev[c]
        except KeyError:
            raise binascii.Error('Non-base32 digit found') from None
        decoded += acc.to_bytes(5, 'big')
    # Process the last, partial quanta
    if l % 8 or padchars not in {0, 1, 3, 4, 6}:
        raise binascii.Error('Incorrect padding')
    if padchars and decoded:
        acc <<= 5 * padchars
        last = acc.to_bytes(5, 'big')
        leftover = (43 - 5 * padchars) // 8  # 1: 4, 3: 3, 4: 2, 6: 1
        decoded[-5:] = last[:leftover]
    return bytes(decoded)


# RFC 3548, Base 16 Alphabet specifies uppercase, but hexlify() returns
# lowercase.  The RFC also recommends against accepting input case
# insensitively.
def b16encode(s):
    """Encode the bytes-like object s using Base16 and return a bytes object.
    """
    return binascii.hexlify(s).upper()


def b16decode(s, casefold=False):
    """Decode the Base16 encoded bytes-like object or ASCII string s.

    Optional casefold is a flag specifying whether a lowercase alphabet is
    acceptable as input.  For security purposes, the default is False.

    The result is returned as a bytes object.  A binascii.Error is raised if
    s is incorrectly padded or if there are non-alphabet characters present
    in the input.
    """
    s = _bytes_from_decode_data(s)
    if casefold:
        s = s.upper()
    if re.search(b'[^0-9A-F]', s):
        raise binascii.Error('Non-base16 digit found')
    return binascii.unhexlify(s)

#
# Ascii85 encoding/decoding
#

_a85chars = None
_a85chars2 = None
_A85START = b"<~"
_A85END = b"~>"

def _85encode(b, chars, chars2, pad=False, foldnuls=False, foldspaces=False):
    # Helper function for a85encode and b85encode
    if not isinstance(b, bytes_types):
        b = memoryview(b).tobytes()

    padding = (-len(b)) % 4
    if padding:
        b = b + b'\0' * padding
    words = struct.Struct('!%dI' % (len(b) // 4)).unpack(b)

    chunks = [b'z' if foldnuls and not word else
              b'y' if foldspaces and word == 0x20202020 else
              (chars2[word // 614125] +
               chars2[word // 85 % 7225] +
               chars[word % 85])
              for word in words]

    if padding and not pad:
        if chunks[-1] == b'z':
            chunks[-1] = chars[0] * 5
        chunks[-1] = chunks[-1][:-padding]

    return b''.join(chunks)

def a85encode(b, *, foldspaces=False, wrapcol=0, pad=False, adobe=False):
    """Encode bytes-like object b using Ascii85 and return a bytes object.

    foldspaces is an optional flag that uses the special short sequence 'y'
    instead of 4 consecutive spaces (ASCII 0x20) as supported by 'btoa'. This
    feature is not supported by the "standard" Adobe encoding.

    wrapcol controls whether the output should have newline (b'\\n') characters
    added to it. If this is non-zero, each output line will be at most this
    many characters long.

    pad controls whether the input is padded to a multiple of 4 before
    encoding. Note that the btoa implementation always pads.

    adobe controls whether the encoded byte sequence is framed with <~ and ~>,
    which is used by the Adobe implementation.
    """
    global _a85chars, _a85chars2
    # Delay the initialization of tables to not waste memory
    # if the function is never called
    if _a85chars2 is None:
        _a85chars = [bytes((i,)) for i in range(33, 118)]
        _a85chars2 = [(a + b) for a in _a85chars for b in _a85chars]

    result = _85encode(b, _a85chars, _a85chars2, pad, True, foldspaces)

    if adobe:
        result = _A85START + result
    if wrapcol:
        wrapcol = max(2 if adobe else 1, wrapcol)
        chunks = [result[i: i + wrapcol]
                  for i in range(0, len(result), wrapcol)]
        if adobe:
            if len(chunks[-1]) + 2 > wrapcol:
                chunks.append(b'')
        result = b'\n'.join(chunks)
    if adobe:
        result += _A85END

    return result

def a85decode(b, *, foldspaces=False, adobe=False, ignorechars=b' \t\n\r\v'):
    """Decode the Ascii85 encoded bytes-like object or ASCII string b.

    foldspaces is a flag that specifies whether the 'y' short sequence should be
    accepted as shorthand for 4 consecutive spaces (ASCII 0x20). This feature is
    not supported by the "standard" Adobe encoding.

    adobe controls whether the input sequence is in Adobe Ascii85 format (i.e.
    is framed with <~ and ~>).

    ignorechars should be a byte string containing characters to ignore from the
    input. This should only contain whitespace characters, and by default
    contains all whitespace characters in ASCII.

    The result is returned as a bytes object.
    """
    b = _bytes_from_decode_data(b)
    if adobe:
        if not b.endswith(_A85END):
            raise ValueError(
                "Ascii85 encoded byte sequences must end "
                "with {!r}".format(_A85END)
                )
        if b.startswith(_A85START):
            b = b[2:-2]  # Strip off start/end markers
        else:
            b = b[:-2]
    #
    # We have to go through this stepwise, so as to ignore spaces and handle
    # special short sequences
    #
    packI = struct.Struct('!I').pack
    decoded = []
    decoded_append = decoded.append
    curr = []
    curr_append = curr.append
    curr_clear = curr.clear
    for x in b + b'u' * 4:
        if b'!'[0] <= x <= b'u'[0]:
            curr_append(x)
            if len(curr) == 5:
                acc = 0
                for x in curr:
                    acc = 85 * acc + (x - 33)
                try:
                    decoded_append(packI(acc))
                except struct.error:
                    raise ValueError('Ascii85 overflow') from None
                curr_clear()
        elif x == b'z'[0]:
            if curr:
                raise ValueError('z inside Ascii85 5-tuple')
            decoded_append(b'\0\0\0\0')
        elif foldspaces and x == b'y'[0]:
            if curr:
                raise ValueError('y inside Ascii85 5-tuple')
            decoded_append(b'\x20\x20\x20\x20')
        elif x in ignorechars:
            # Skip whitespace
            continue
        else:
            raise ValueError('Non-Ascii85 digit found: %c' % x)

    result = b''.join(decoded)
    padding = 4 - len(curr)
    if padding:
        # Throw away the extra padding
        result = result[:-padding]
    return result

# The following code is originally taken (with permission) from Mercurial

_b85alphabet = (b"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
                b"abcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~")
_b85chars = None
_b85chars2 = None
_b85dec = None

def b85encode(b, pad=False):
    """Encode bytes-like object b in base85 format and return a bytes object.

    If pad is true, the input is padded with b'\\0' so its length is a multiple of
    4 bytes before encoding.
    """
    global _b85chars, _b85chars2
    # Delay the initialization of tables to not waste memory
    # if the function is never called
    if _b85chars2 is None:
        _b85chars = [bytes((i,)) for i in _b85alphabet]
        _b85chars2 = [(a + b) for a in _b85chars for b in _b85chars]
    return _85encode(b, _b85chars, _b85chars2, pad)

def b85decode(b):
    """Decode the base85-encoded bytes-like object or ASCII string b

    The result is returned as a bytes object.
    """
    global _b85dec
    # Delay the initialization of tables to not waste memory
    # if the function is never called
    if _b85dec is None:
        _b85dec = [None] * 256
        for i, c in enumerate(_b85alphabet):
            _b85dec[c] = i

    b = _bytes_from_decode_data(b)
    padding = (-len(b)) % 5
    b = b + b'~' * padding
    out = []
    packI = struct.Struct('!I').pack
    for i in range(0, len(b), 5):
        chunk = b[i:i + 5]
        acc = 0
        try:
            for c in chunk:
                acc = acc * 85 + _b85dec[c]
        except TypeError:
            for j, c in enumerate(chunk):
                if _b85dec[c] is None:
                    raise ValueError('bad base85 character at position %d'
                                    % (i + j)) from None
            raise
        try:
            out.append(packI(acc))
        except struct.error:
            raise ValueError('base85 overflow in hunk starting at byte %d'
                             % i) from None

    result = b''.join(out)
    if padding:
        result = result[:-padding]
    return result

# Legacy interface.  This code could be cleaned up since I don't believe
# binascii has any line length limitations.  It just doesn't seem worth it
# though.  The files should be opened in binary mode.

MAXLINESIZE = 76 # Excluding the CRLF
MAXBINSIZE = (MAXLINESIZE//4)*3

def encode(input, output):
    """Encode a file; input and output are binary files."""
    while True:
        s = input.read(MAXBINSIZE)
        if not s:
            break
        while len(s) < MAXBINSIZE:
            ns = input.read(MAXBINSIZE-len(s))
            if not ns:
                break
            s += ns
        line = binascii.b2a_base64(s)
        output.write(line)


def decode(input, output):
    """Decode a file; input and output are binary files."""
    while True:
        line = input.readline()
        if not line:
            break
        s = binascii.a2b_base64(line)
        output.write(s)

def _input_type_check(s):
    try:
        m = memoryview(s)
    except TypeError as err:
        msg = "expected bytes-like object, not %s" % s.__class__.__name__
        raise TypeError(msg) from err
    if m.format not in ('c', 'b', 'B'):
        msg = ("expected single byte elements, not %r from %s" %
                                          (m.format, s.__class__.__name__))
        raise TypeError(msg)
    if m.ndim != 1:
        msg = ("expected 1-D data, not %d-D data from %s" %
                                          (m.ndim, s.__class__.__name__))
        raise TypeError(msg)


def encodebytes(s):
    """Encode a bytestring into a bytes object containing multiple lines
    of base-64 data."""
    _input_type_check(s)
    pieces = []
    for i in range(0, len(s), MAXBINSIZE):
        chunk = s[i : i + MAXBINSIZE]
        pieces.append(binascii.b2a_base64(chunk))
    return b"".join(pieces)

def encodestring(s):
    """Legacy alias of encodebytes()."""
    import warnings
    warnings.warn("encodestring() is a deprecated alias since 3.1, "
                  "use encodebytes()",
                  DeprecationWarning, 2)
    return encodebytes(s)


def decodebytes(s):
    """Decode a bytestring of base-64 data into a bytes object."""
    _input_type_check(s)
    return binascii.a2b_base64(s)

def decodestring(s):
    """Legacy alias of decodebytes()."""
    import warnings
    warnings.warn("decodestring() is a deprecated alias since Python 3.1, "
                  "use decodebytes()",
                  DeprecationWarning, 2)
    return decodebytes(s)


# Usable as a script...
def main():
    """Small main program"""
    import sys, getopt
    try:
        opts, args = getopt.getopt(sys.argv[1:], 'deut')
    except getopt.error as msg:
        sys.stdout = sys.stderr
        print(msg)
        print("""usage: %s [-d|-e|-u|-t] [file|-]
        -d, -u: decode
        -e: encode (default)
        -t: encode and decode string 'Aladdin:open sesame'"""%sys.argv[0])
        sys.exit(2)
    func = encode
    for o, a in opts:
        if o == '-e': func = encode
        if o == '-d': func = decode
        if o == '-u': func = decode
        if o == '-t': test(); return
    if args and args[0] != '-':
        with open(args[0], 'rb') as f:
            func(f, sys.stdout.buffer)
    else:
        func(sys.stdin.buffer, sys.stdout.buffer)


def test():
    s0 = b"Aladdin:open sesame"
    print(repr(s0))
    s1 = encodebytes(s0)
    print(repr(s1))
    s2 = decodebytes(s1)
    print(repr(s2))
    assert s0 == s2


if __name__ == '__main__':
    main()
profile.py000075500000055772151153537530006611 0ustar00#! /usr/bin/python3.8
#
# Class for profiling python code. rev 1.0  6/2/94
#
# Written by James Roskind
# Based on prior profile module by Sjoerd Mullender...
#   which was hacked somewhat by: Guido van Rossum

"""Class for profiling Python code."""

# Copyright Disney Enterprises, Inc.  All Rights Reserved.
# Licensed to PSF under a Contributor Agreement
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
# either express or implied.  See the License for the specific language
# governing permissions and limitations under the License.


import io
import sys
import time
import marshal

__all__ = ["run", "runctx", "Profile"]

# Sample timer for use with
#i_count = 0
#def integer_timer():
#       global i_count
#       i_count = i_count + 1
#       return i_count
#itimes = integer_timer # replace with C coded timer returning integers

class _Utils:
    """Support class for utility functions which are shared by
    profile.py and cProfile.py modules.
    Not supposed to be used directly.
    """

    def __init__(self, profiler):
        self.profiler = profiler

    def run(self, statement, filename, sort):
        prof = self.profiler()
        try:
            prof.run(statement)
        except SystemExit:
            pass
        finally:
            self._show(prof, filename, sort)

    def runctx(self, statement, globals, locals, filename, sort):
        prof = self.profiler()
        try:
            prof.runctx(statement, globals, locals)
        except SystemExit:
            pass
        finally:
            self._show(prof, filename, sort)

    def _show(self, prof, filename, sort):
        if filename is not None:
            prof.dump_stats(filename)
        else:
            prof.print_stats(sort)


#**************************************************************************
# The following are the static member functions for the profiler class
# Note that an instance of Profile() is *not* needed to call them.
#**************************************************************************

def run(statement, filename=None, sort=-1):
    """Run statement under profiler optionally saving results in filename

    This function takes a single argument that can be passed to the
    "exec" statement, and an optional file name.  In all cases this
    routine attempts to "exec" its first argument and gather profiling
    statistics from the execution. If no file name is present, then this
    function automatically prints a simple profiling report, sorted by the
    standard name string (file/line/function-name) that is presented in
    each line.
    """
    return _Utils(Profile).run(statement, filename, sort)

def runctx(statement, globals, locals, filename=None, sort=-1):
    """Run statement under profiler, supplying your own globals and locals,
    optionally saving results in filename.

    statement and filename have the same semantics as profile.run
    """
    return _Utils(Profile).runctx(statement, globals, locals, filename, sort)


class Profile:
    """Profiler class.

    self.cur is always a tuple.  Each such tuple corresponds to a stack
    frame that is currently active (self.cur[-2]).  The following are the
    definitions of its members.  We use this external "parallel stack" to
    avoid contaminating the program that we are profiling. (old profiler
    used to write into the frames local dictionary!!) Derived classes
    can change the definition of some entries, as long as they leave
    [-2:] intact (frame and previous tuple).  In case an internal error is
    detected, the -3 element is used as the function name.

    [ 0] = Time that needs to be charged to the parent frame's function.
           It is used so that a function call will not have to access the
           timing data for the parent frame.
    [ 1] = Total time spent in this frame's function, excluding time in
           subfunctions (this latter is tallied in cur[2]).
    [ 2] = Total time spent in subfunctions, excluding time executing the
           frame's function (this latter is tallied in cur[1]).
    [-3] = Name of the function that corresponds to this frame.
    [-2] = Actual frame that we correspond to (used to sync exception handling).
    [-1] = Our parent 6-tuple (corresponds to frame.f_back).

    Timing data for each function is stored as a 5-tuple in the dictionary
    self.timings[].  The index is always the name stored in self.cur[-3].
    The following are the definitions of the members:

    [0] = The number of times this function was called, not counting direct
          or indirect recursion,
    [1] = Number of times this function appears on the stack, minus one
    [2] = Total time spent internal to this function
    [3] = Cumulative time that this function was present on the stack.  In
          non-recursive functions, this is the total execution time from start
          to finish of each invocation of a function, including time spent in
          all subfunctions.
    [4] = A dictionary indicating for each function name, the number of times
          it was called by us.
    """

    bias = 0  # calibration constant

    def __init__(self, timer=None, bias=None):
        self.timings = {}
        self.cur = None
        self.cmd = ""
        self.c_func_name = ""

        if bias is None:
            bias = self.bias
        self.bias = bias     # Materialize in local dict for lookup speed.

        if not timer:
            self.timer = self.get_time = time.process_time
            self.dispatcher = self.trace_dispatch_i
        else:
            self.timer = timer
            t = self.timer() # test out timer function
            try:
                length = len(t)
            except TypeError:
                self.get_time = timer
                self.dispatcher = self.trace_dispatch_i
            else:
                if length == 2:
                    self.dispatcher = self.trace_dispatch
                else:
                    self.dispatcher = self.trace_dispatch_l
                # This get_time() implementation needs to be defined
                # here to capture the passed-in timer in the parameter
                # list (for performance).  Note that we can't assume
                # the timer() result contains two values in all
                # cases.
                def get_time_timer(timer=timer, sum=sum):
                    return sum(timer())
                self.get_time = get_time_timer
        self.t = self.get_time()
        self.simulate_call('profiler')

    # Heavily optimized dispatch routine for time.process_time() timer

    def trace_dispatch(self, frame, event, arg):
        timer = self.timer
        t = timer()
        t = t[0] + t[1] - self.t - self.bias

        if event == "c_call":
            self.c_func_name = arg.__name__

        if self.dispatch[event](self, frame,t):
            t = timer()
            self.t = t[0] + t[1]
        else:
            r = timer()
            self.t = r[0] + r[1] - t # put back unrecorded delta

    # Dispatch routine for best timer program (return = scalar, fastest if
    # an integer but float works too -- and time.process_time() relies on that).

    def trace_dispatch_i(self, frame, event, arg):
        timer = self.timer
        t = timer() - self.t - self.bias

        if event == "c_call":
            self.c_func_name = arg.__name__

        if self.dispatch[event](self, frame, t):
            self.t = timer()
        else:
            self.t = timer() - t  # put back unrecorded delta

    # Dispatch routine for macintosh (timer returns time in ticks of
    # 1/60th second)

    def trace_dispatch_mac(self, frame, event, arg):
        timer = self.timer
        t = timer()/60.0 - self.t - self.bias

        if event == "c_call":
            self.c_func_name = arg.__name__

        if self.dispatch[event](self, frame, t):
            self.t = timer()/60.0
        else:
            self.t = timer()/60.0 - t  # put back unrecorded delta

    # SLOW generic dispatch routine for timer returning lists of numbers

    def trace_dispatch_l(self, frame, event, arg):
        get_time = self.get_time
        t = get_time() - self.t - self.bias

        if event == "c_call":
            self.c_func_name = arg.__name__

        if self.dispatch[event](self, frame, t):
            self.t = get_time()
        else:
            self.t = get_time() - t # put back unrecorded delta

    # In the event handlers, the first 3 elements of self.cur are unpacked
    # into vrbls w/ 3-letter names.  The last two characters are meant to be
    # mnemonic:
    #     _pt  self.cur[0] "parent time"   time to be charged to parent frame
    #     _it  self.cur[1] "internal time" time spent directly in the function
    #     _et  self.cur[2] "external time" time spent in subfunctions

    def trace_dispatch_exception(self, frame, t):
        rpt, rit, ret, rfn, rframe, rcur = self.cur
        if (rframe is not frame) and rcur:
            return self.trace_dispatch_return(rframe, t)
        self.cur = rpt, rit+t, ret, rfn, rframe, rcur
        return 1


    def trace_dispatch_call(self, frame, t):
        if self.cur and frame.f_back is not self.cur[-2]:
            rpt, rit, ret, rfn, rframe, rcur = self.cur
            if not isinstance(rframe, Profile.fake_frame):
                assert rframe.f_back is frame.f_back, ("Bad call", rfn,
                                                       rframe, rframe.f_back,
                                                       frame, frame.f_back)
                self.trace_dispatch_return(rframe, 0)
                assert (self.cur is None or \
                        frame.f_back is self.cur[-2]), ("Bad call",
                                                        self.cur[-3])
        fcode = frame.f_code
        fn = (fcode.co_filename, fcode.co_firstlineno, fcode.co_name)
        self.cur = (t, 0, 0, fn, frame, self.cur)
        timings = self.timings
        if fn in timings:
            cc, ns, tt, ct, callers = timings[fn]
            timings[fn] = cc, ns + 1, tt, ct, callers
        else:
            timings[fn] = 0, 0, 0, 0, {}
        return 1

    def trace_dispatch_c_call (self, frame, t):
        fn = ("", 0, self.c_func_name)
        self.cur = (t, 0, 0, fn, frame, self.cur)
        timings = self.timings
        if fn in timings:
            cc, ns, tt, ct, callers = timings[fn]
            timings[fn] = cc, ns+1, tt, ct, callers
        else:
            timings[fn] = 0, 0, 0, 0, {}
        return 1

    def trace_dispatch_return(self, frame, t):
        if frame is not self.cur[-2]:
            assert frame is self.cur[-2].f_back, ("Bad return", self.cur[-3])
            self.trace_dispatch_return(self.cur[-2], 0)

        # Prefix "r" means part of the Returning or exiting frame.
        # Prefix "p" means part of the Previous or Parent or older frame.

        rpt, rit, ret, rfn, frame, rcur = self.cur
        rit = rit + t
        frame_total = rit + ret

        ppt, pit, pet, pfn, pframe, pcur = rcur
        self.cur = ppt, pit + rpt, pet + frame_total, pfn, pframe, pcur

        timings = self.timings
        cc, ns, tt, ct, callers = timings[rfn]
        if not ns:
            # This is the only occurrence of the function on the stack.
            # Else this is a (directly or indirectly) recursive call, and
            # its cumulative time will get updated when the topmost call to
            # it returns.
            ct = ct + frame_total
            cc = cc + 1

        if pfn in callers:
            callers[pfn] = callers[pfn] + 1  # hack: gather more
            # stats such as the amount of time added to ct courtesy
            # of this specific call, and the contribution to cc
            # courtesy of this call.
        else:
            callers[pfn] = 1

        timings[rfn] = cc, ns - 1, tt + rit, ct, callers

        return 1


    dispatch = {
        "call": trace_dispatch_call,
        "exception": trace_dispatch_exception,
        "return": trace_dispatch_return,
        "c_call": trace_dispatch_c_call,
        "c_exception": trace_dispatch_return,  # the C function returned
        "c_return": trace_dispatch_return,
        }


    # The next few functions play with self.cmd. By carefully preloading
    # our parallel stack, we can force the profiled result to include
    # an arbitrary string as the name of the calling function.
    # We use self.cmd as that string, and the resulting stats look
    # very nice :-).

    def set_cmd(self, cmd):
        if self.cur[-1]: return   # already set
        self.cmd = cmd
        self.simulate_call(cmd)

    class fake_code:
        def __init__(self, filename, line, name):
            self.co_filename = filename
            self.co_line = line
            self.co_name = name
            self.co_firstlineno = 0

        def __repr__(self):
            return repr((self.co_filename, self.co_line, self.co_name))

    class fake_frame:
        def __init__(self, code, prior):
            self.f_code = code
            self.f_back = prior

    def simulate_call(self, name):
        code = self.fake_code('profile', 0, name)
        if self.cur:
            pframe = self.cur[-2]
        else:
            pframe = None
        frame = self.fake_frame(code, pframe)
        self.dispatch['call'](self, frame, 0)

    # collect stats from pending stack, including getting final
    # timings for self.cmd frame.

    def simulate_cmd_complete(self):
        get_time = self.get_time
        t = get_time() - self.t
        while self.cur[-1]:
            # We *can* cause assertion errors here if
            # dispatch_trace_return checks for a frame match!
            self.dispatch['return'](self, self.cur[-2], t)
            t = 0
        self.t = get_time() - t


    def print_stats(self, sort=-1):
        import pstats
        pstats.Stats(self).strip_dirs().sort_stats(sort). \
                  print_stats()

    def dump_stats(self, file):
        with open(file, 'wb') as f:
            self.create_stats()
            marshal.dump(self.stats, f)

    def create_stats(self):
        self.simulate_cmd_complete()
        self.snapshot_stats()

    def snapshot_stats(self):
        self.stats = {}
        for func, (cc, ns, tt, ct, callers) in self.timings.items():
            callers = callers.copy()
            nc = 0
            for callcnt in callers.values():
                nc += callcnt
            self.stats[func] = cc, nc, tt, ct, callers


    # The following two methods can be called by clients to use
    # a profiler to profile a statement, given as a string.

    def run(self, cmd):
        import __main__
        dict = __main__.__dict__
        return self.runctx(cmd, dict, dict)

    def runctx(self, cmd, globals, locals):
        self.set_cmd(cmd)
        sys.setprofile(self.dispatcher)
        try:
            exec(cmd, globals, locals)
        finally:
            sys.setprofile(None)
        return self

    # This method is more useful to profile a single function call.
    def runcall(*args, **kw):
        if len(args) >= 2:
            self, func, *args = args
        elif not args:
            raise TypeError("descriptor 'runcall' of 'Profile' object "
                            "needs an argument")
        elif 'func' in kw:
            func = kw.pop('func')
            self, *args = args
            import warnings
            warnings.warn("Passing 'func' as keyword argument is deprecated",
                          DeprecationWarning, stacklevel=2)
        else:
            raise TypeError('runcall expected at least 1 positional argument, '
                            'got %d' % (len(args)-1))

        self.set_cmd(repr(func))
        sys.setprofile(self.dispatcher)
        try:
            return func(*args, **kw)
        finally:
            sys.setprofile(None)
    runcall.__text_signature__ = '($self, func, /, *args, **kw)'


    #******************************************************************
    # The following calculates the overhead for using a profiler.  The
    # problem is that it takes a fair amount of time for the profiler
    # to stop the stopwatch (from the time it receives an event).
    # Similarly, there is a delay from the time that the profiler
    # re-starts the stopwatch before the user's code really gets to
    # continue.  The following code tries to measure the difference on
    # a per-event basis.
    #
    # Note that this difference is only significant if there are a lot of
    # events, and relatively little user code per event.  For example,
    # code with small functions will typically benefit from having the
    # profiler calibrated for the current platform.  This *could* be
    # done on the fly during init() time, but it is not worth the
    # effort.  Also note that if too large a value specified, then
    # execution time on some functions will actually appear as a
    # negative number.  It is *normal* for some functions (with very
    # low call counts) to have such negative stats, even if the
    # calibration figure is "correct."
    #
    # One alternative to profile-time calibration adjustments (i.e.,
    # adding in the magic little delta during each event) is to track
    # more carefully the number of events (and cumulatively, the number
    # of events during sub functions) that are seen.  If this were
    # done, then the arithmetic could be done after the fact (i.e., at
    # display time).  Currently, we track only call/return events.
    # These values can be deduced by examining the callees and callers
    # vectors for each functions.  Hence we *can* almost correct the
    # internal time figure at print time (note that we currently don't
    # track exception event processing counts).  Unfortunately, there
    # is currently no similar information for cumulative sub-function
    # time.  It would not be hard to "get all this info" at profiler
    # time.  Specifically, we would have to extend the tuples to keep
    # counts of this in each frame, and then extend the defs of timing
    # tuples to include the significant two figures. I'm a bit fearful
    # that this additional feature will slow the heavily optimized
    # event/time ratio (i.e., the profiler would run slower, fur a very
    # low "value added" feature.)
    #**************************************************************

    def calibrate(self, m, verbose=0):
        if self.__class__ is not Profile:
            raise TypeError("Subclasses must override .calibrate().")

        saved_bias = self.bias
        self.bias = 0
        try:
            return self._calibrate_inner(m, verbose)
        finally:
            self.bias = saved_bias

    def _calibrate_inner(self, m, verbose):
        get_time = self.get_time

        # Set up a test case to be run with and without profiling.  Include
        # lots of calls, because we're trying to quantify stopwatch overhead.
        # Do not raise any exceptions, though, because we want to know
        # exactly how many profile events are generated (one call event, +
        # one return event, per Python-level call).

        def f1(n):
            for i in range(n):
                x = 1

        def f(m, f1=f1):
            for i in range(m):
                f1(100)

        f(m)    # warm up the cache

        # elapsed_noprofile <- time f(m) takes without profiling.
        t0 = get_time()
        f(m)
        t1 = get_time()
        elapsed_noprofile = t1 - t0
        if verbose:
            print("elapsed time without profiling =", elapsed_noprofile)

        # elapsed_profile <- time f(m) takes with profiling.  The difference
        # is profiling overhead, only some of which the profiler subtracts
        # out on its own.
        p = Profile()
        t0 = get_time()
        p.runctx('f(m)', globals(), locals())
        t1 = get_time()
        elapsed_profile = t1 - t0
        if verbose:
            print("elapsed time with profiling =", elapsed_profile)

        # reported_time <- "CPU seconds" the profiler charged to f and f1.
        total_calls = 0.0
        reported_time = 0.0
        for (filename, line, funcname), (cc, ns, tt, ct, callers) in \
                p.timings.items():
            if funcname in ("f", "f1"):
                total_calls += cc
                reported_time += tt

        if verbose:
            print("'CPU seconds' profiler reported =", reported_time)
            print("total # calls =", total_calls)
        if total_calls != m + 1:
            raise ValueError("internal error: total calls = %d" % total_calls)

        # reported_time - elapsed_noprofile = overhead the profiler wasn't
        # able to measure.  Divide by twice the number of calls (since there
        # are two profiler events per call in this test) to get the hidden
        # overhead per event.
        mean = (reported_time - elapsed_noprofile) / 2.0 / total_calls
        if verbose:
            print("mean stopwatch overhead per profile event =", mean)
        return mean

#****************************************************************************

def main():
    import os
    from optparse import OptionParser

    usage = "profile.py [-o output_file_path] [-s sort] [-m module | scriptfile] [arg] ..."
    parser = OptionParser(usage=usage)
    parser.allow_interspersed_args = False
    parser.add_option('-o', '--outfile', dest="outfile",
        help="Save stats to <outfile>", default=None)
    parser.add_option('-m', dest="module", action="store_true",
        help="Profile a library module.", default=False)
    parser.add_option('-s', '--sort', dest="sort",
        help="Sort order when printing to stdout, based on pstats.Stats class",
        default=-1)

    if not sys.argv[1:]:
        parser.print_usage()
        sys.exit(2)

    (options, args) = parser.parse_args()
    sys.argv[:] = args

    # The script that we're profiling may chdir, so capture the absolute path
    # to the output file at startup.
    if options.outfile is not None:
        options.outfile = os.path.abspath(options.outfile)

    if len(args) > 0:
        if options.module:
            import runpy
            code = "run_module(modname, run_name='__main__')"
            globs = {
                'run_module': runpy.run_module,
                'modname': args[0]
            }
        else:
            progname = args[0]
            sys.path.insert(0, os.path.dirname(progname))
            with io.open_code(progname) as fp:
                code = compile(fp.read(), progname, 'exec')
            globs = {
                '__file__': progname,
                '__name__': '__main__',
                '__package__': None,
                '__cached__': None,
            }
        try:
            runctx(code, globs, None, options.outfile, options.sort)
        except BrokenPipeError as exc:
            # Prevent "Exception ignored" during interpreter shutdown.
            sys.stdout = None
            sys.exit(exc.errno)
    else:
        parser.print_usage()
    return parser

# When invoked as main program, invoke the profiler on a script
if __name__ == '__main__':
    main()
html/__init__.py000064400000011224151153537530007631 0ustar00"""
General functions for HTML manipulation.
"""

import re as _re
from html.entities import html5 as _html5


__all__ = ['escape', 'unescape']


def escape(s, quote=True):
    """
    Replace special characters "&", "<" and ">" to HTML-safe sequences.
    If the optional flag quote is true (the default), the quotation mark
    characters, both double quote (") and single quote (') characters are also
    translated.
    """
    s = s.replace("&", "&amp;") # Must be done first!
    s = s.replace("<", "&lt;")
    s = s.replace(">", "&gt;")
    if quote:
        s = s.replace('"', "&quot;")
        s = s.replace('\'', "&#x27;")
    return s


# see http://www.w3.org/TR/html5/syntax.html#tokenizing-character-references

_invalid_charrefs = {
    0x00: '\ufffd',  # REPLACEMENT CHARACTER
    0x0d: '\r',      # CARRIAGE RETURN
    0x80: '\u20ac',  # EURO SIGN
    0x81: '\x81',    # <control>
    0x82: '\u201a',  # SINGLE LOW-9 QUOTATION MARK
    0x83: '\u0192',  # LATIN SMALL LETTER F WITH HOOK
    0x84: '\u201e',  # DOUBLE LOW-9 QUOTATION MARK
    0x85: '\u2026',  # HORIZONTAL ELLIPSIS
    0x86: '\u2020',  # DAGGER
    0x87: '\u2021',  # DOUBLE DAGGER
    0x88: '\u02c6',  # MODIFIER LETTER CIRCUMFLEX ACCENT
    0x89: '\u2030',  # PER MILLE SIGN
    0x8a: '\u0160',  # LATIN CAPITAL LETTER S WITH CARON
    0x8b: '\u2039',  # SINGLE LEFT-POINTING ANGLE QUOTATION MARK
    0x8c: '\u0152',  # LATIN CAPITAL LIGATURE OE
    0x8d: '\x8d',    # <control>
    0x8e: '\u017d',  # LATIN CAPITAL LETTER Z WITH CARON
    0x8f: '\x8f',    # <control>
    0x90: '\x90',    # <control>
    0x91: '\u2018',  # LEFT SINGLE QUOTATION MARK
    0x92: '\u2019',  # RIGHT SINGLE QUOTATION MARK
    0x93: '\u201c',  # LEFT DOUBLE QUOTATION MARK
    0x94: '\u201d',  # RIGHT DOUBLE QUOTATION MARK
    0x95: '\u2022',  # BULLET
    0x96: '\u2013',  # EN DASH
    0x97: '\u2014',  # EM DASH
    0x98: '\u02dc',  # SMALL TILDE
    0x99: '\u2122',  # TRADE MARK SIGN
    0x9a: '\u0161',  # LATIN SMALL LETTER S WITH CARON
    0x9b: '\u203a',  # SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
    0x9c: '\u0153',  # LATIN SMALL LIGATURE OE
    0x9d: '\x9d',    # <control>
    0x9e: '\u017e',  # LATIN SMALL LETTER Z WITH CARON
    0x9f: '\u0178',  # LATIN CAPITAL LETTER Y WITH DIAERESIS
}

_invalid_codepoints = {
    # 0x0001 to 0x0008
    0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8,
    # 0x000E to 0x001F
    0xe, 0xf, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19,
    0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
    # 0x007F to 0x009F
    0x7f, 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a,
    0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
    0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
    # 0xFDD0 to 0xFDEF
    0xfdd0, 0xfdd1, 0xfdd2, 0xfdd3, 0xfdd4, 0xfdd5, 0xfdd6, 0xfdd7, 0xfdd8,
    0xfdd9, 0xfdda, 0xfddb, 0xfddc, 0xfddd, 0xfdde, 0xfddf, 0xfde0, 0xfde1,
    0xfde2, 0xfde3, 0xfde4, 0xfde5, 0xfde6, 0xfde7, 0xfde8, 0xfde9, 0xfdea,
    0xfdeb, 0xfdec, 0xfded, 0xfdee, 0xfdef,
    # others
    0xb, 0xfffe, 0xffff, 0x1fffe, 0x1ffff, 0x2fffe, 0x2ffff, 0x3fffe, 0x3ffff,
    0x4fffe, 0x4ffff, 0x5fffe, 0x5ffff, 0x6fffe, 0x6ffff, 0x7fffe, 0x7ffff,
    0x8fffe, 0x8ffff, 0x9fffe, 0x9ffff, 0xafffe, 0xaffff, 0xbfffe, 0xbffff,
    0xcfffe, 0xcffff, 0xdfffe, 0xdffff, 0xefffe, 0xeffff, 0xffffe, 0xfffff,
    0x10fffe, 0x10ffff
}


def _replace_charref(s):
    s = s.group(1)
    if s[0] == '#':
        # numeric charref
        if s[1] in 'xX':
            num = int(s[2:].rstrip(';'), 16)
        else:
            num = int(s[1:].rstrip(';'))
        if num in _invalid_charrefs:
            return _invalid_charrefs[num]
        if 0xD800 <= num <= 0xDFFF or num > 0x10FFFF:
            return '\uFFFD'
        if num in _invalid_codepoints:
            return ''
        return chr(num)
    else:
        # named charref
        if s in _html5:
            return _html5[s]
        # find the longest matching name (as defined by the standard)
        for x in range(len(s)-1, 1, -1):
            if s[:x] in _html5:
                return _html5[s[:x]] + s[x:]
        else:
            return '&' + s


_charref = _re.compile(r'&(#[0-9]+;?'
                       r'|#[xX][0-9a-fA-F]+;?'
                       r'|[^\t\n\f <&#;]{1,32};?)')

def unescape(s):
    """
    Convert all named and numeric character references (e.g. &gt;, &#62;,
    &x3e;) in the string s to the corresponding unicode characters.
    This function uses the rules defined by the HTML 5 standard
    for both valid and invalid character references, and the list of
    HTML 5 named character references defined in html.entities.html5.
    """
    if '&' not in s:
        return s
    return _charref.sub(_replace_charref, s)
html/entities.py000064400000223063151153537530007724 0ustar00"""HTML character entity references."""

__all__ = ['html5', 'name2codepoint', 'codepoint2name', 'entitydefs']


# maps the HTML entity name to the Unicode code point
name2codepoint = {
    'AElig':    0x00c6, # latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1
    'Aacute':   0x00c1, # latin capital letter A with acute, U+00C1 ISOlat1
    'Acirc':    0x00c2, # latin capital letter A with circumflex, U+00C2 ISOlat1
    'Agrave':   0x00c0, # latin capital letter A with grave = latin capital letter A grave, U+00C0 ISOlat1
    'Alpha':    0x0391, # greek capital letter alpha, U+0391
    'Aring':    0x00c5, # latin capital letter A with ring above = latin capital letter A ring, U+00C5 ISOlat1
    'Atilde':   0x00c3, # latin capital letter A with tilde, U+00C3 ISOlat1
    'Auml':     0x00c4, # latin capital letter A with diaeresis, U+00C4 ISOlat1
    'Beta':     0x0392, # greek capital letter beta, U+0392
    'Ccedil':   0x00c7, # latin capital letter C with cedilla, U+00C7 ISOlat1
    'Chi':      0x03a7, # greek capital letter chi, U+03A7
    'Dagger':   0x2021, # double dagger, U+2021 ISOpub
    'Delta':    0x0394, # greek capital letter delta, U+0394 ISOgrk3
    'ETH':      0x00d0, # latin capital letter ETH, U+00D0 ISOlat1
    'Eacute':   0x00c9, # latin capital letter E with acute, U+00C9 ISOlat1
    'Ecirc':    0x00ca, # latin capital letter E with circumflex, U+00CA ISOlat1
    'Egrave':   0x00c8, # latin capital letter E with grave, U+00C8 ISOlat1
    'Epsilon':  0x0395, # greek capital letter epsilon, U+0395
    'Eta':      0x0397, # greek capital letter eta, U+0397
    'Euml':     0x00cb, # latin capital letter E with diaeresis, U+00CB ISOlat1
    'Gamma':    0x0393, # greek capital letter gamma, U+0393 ISOgrk3
    'Iacute':   0x00cd, # latin capital letter I with acute, U+00CD ISOlat1
    'Icirc':    0x00ce, # latin capital letter I with circumflex, U+00CE ISOlat1
    'Igrave':   0x00cc, # latin capital letter I with grave, U+00CC ISOlat1
    'Iota':     0x0399, # greek capital letter iota, U+0399
    'Iuml':     0x00cf, # latin capital letter I with diaeresis, U+00CF ISOlat1
    'Kappa':    0x039a, # greek capital letter kappa, U+039A
    'Lambda':   0x039b, # greek capital letter lambda, U+039B ISOgrk3
    'Mu':       0x039c, # greek capital letter mu, U+039C
    'Ntilde':   0x00d1, # latin capital letter N with tilde, U+00D1 ISOlat1
    'Nu':       0x039d, # greek capital letter nu, U+039D
    'OElig':    0x0152, # latin capital ligature OE, U+0152 ISOlat2
    'Oacute':   0x00d3, # latin capital letter O with acute, U+00D3 ISOlat1
    'Ocirc':    0x00d4, # latin capital letter O with circumflex, U+00D4 ISOlat1
    'Ograve':   0x00d2, # latin capital letter O with grave, U+00D2 ISOlat1
    'Omega':    0x03a9, # greek capital letter omega, U+03A9 ISOgrk3
    'Omicron':  0x039f, # greek capital letter omicron, U+039F
    'Oslash':   0x00d8, # latin capital letter O with stroke = latin capital letter O slash, U+00D8 ISOlat1
    'Otilde':   0x00d5, # latin capital letter O with tilde, U+00D5 ISOlat1
    'Ouml':     0x00d6, # latin capital letter O with diaeresis, U+00D6 ISOlat1
    'Phi':      0x03a6, # greek capital letter phi, U+03A6 ISOgrk3
    'Pi':       0x03a0, # greek capital letter pi, U+03A0 ISOgrk3
    'Prime':    0x2033, # double prime = seconds = inches, U+2033 ISOtech
    'Psi':      0x03a8, # greek capital letter psi, U+03A8 ISOgrk3
    'Rho':      0x03a1, # greek capital letter rho, U+03A1
    'Scaron':   0x0160, # latin capital letter S with caron, U+0160 ISOlat2
    'Sigma':    0x03a3, # greek capital letter sigma, U+03A3 ISOgrk3
    'THORN':    0x00de, # latin capital letter THORN, U+00DE ISOlat1
    'Tau':      0x03a4, # greek capital letter tau, U+03A4
    'Theta':    0x0398, # greek capital letter theta, U+0398 ISOgrk3
    'Uacute':   0x00da, # latin capital letter U with acute, U+00DA ISOlat1
    'Ucirc':    0x00db, # latin capital letter U with circumflex, U+00DB ISOlat1
    'Ugrave':   0x00d9, # latin capital letter U with grave, U+00D9 ISOlat1
    'Upsilon':  0x03a5, # greek capital letter upsilon, U+03A5 ISOgrk3
    'Uuml':     0x00dc, # latin capital letter U with diaeresis, U+00DC ISOlat1
    'Xi':       0x039e, # greek capital letter xi, U+039E ISOgrk3
    'Yacute':   0x00dd, # latin capital letter Y with acute, U+00DD ISOlat1
    'Yuml':     0x0178, # latin capital letter Y with diaeresis, U+0178 ISOlat2
    'Zeta':     0x0396, # greek capital letter zeta, U+0396
    'aacute':   0x00e1, # latin small letter a with acute, U+00E1 ISOlat1
    'acirc':    0x00e2, # latin small letter a with circumflex, U+00E2 ISOlat1
    'acute':    0x00b4, # acute accent = spacing acute, U+00B4 ISOdia
    'aelig':    0x00e6, # latin small letter ae = latin small ligature ae, U+00E6 ISOlat1
    'agrave':   0x00e0, # latin small letter a with grave = latin small letter a grave, U+00E0 ISOlat1
    'alefsym':  0x2135, # alef symbol = first transfinite cardinal, U+2135 NEW
    'alpha':    0x03b1, # greek small letter alpha, U+03B1 ISOgrk3
    'amp':      0x0026, # ampersand, U+0026 ISOnum
    'and':      0x2227, # logical and = wedge, U+2227 ISOtech
    'ang':      0x2220, # angle, U+2220 ISOamso
    'aring':    0x00e5, # latin small letter a with ring above = latin small letter a ring, U+00E5 ISOlat1
    'asymp':    0x2248, # almost equal to = asymptotic to, U+2248 ISOamsr
    'atilde':   0x00e3, # latin small letter a with tilde, U+00E3 ISOlat1
    'auml':     0x00e4, # latin small letter a with diaeresis, U+00E4 ISOlat1
    'bdquo':    0x201e, # double low-9 quotation mark, U+201E NEW
    'beta':     0x03b2, # greek small letter beta, U+03B2 ISOgrk3
    'brvbar':   0x00a6, # broken bar = broken vertical bar, U+00A6 ISOnum
    'bull':     0x2022, # bullet = black small circle, U+2022 ISOpub
    'cap':      0x2229, # intersection = cap, U+2229 ISOtech
    'ccedil':   0x00e7, # latin small letter c with cedilla, U+00E7 ISOlat1
    'cedil':    0x00b8, # cedilla = spacing cedilla, U+00B8 ISOdia
    'cent':     0x00a2, # cent sign, U+00A2 ISOnum
    'chi':      0x03c7, # greek small letter chi, U+03C7 ISOgrk3
    'circ':     0x02c6, # modifier letter circumflex accent, U+02C6 ISOpub
    'clubs':    0x2663, # black club suit = shamrock, U+2663 ISOpub
    'cong':     0x2245, # approximately equal to, U+2245 ISOtech
    'copy':     0x00a9, # copyright sign, U+00A9 ISOnum
    'crarr':    0x21b5, # downwards arrow with corner leftwards = carriage return, U+21B5 NEW
    'cup':      0x222a, # union = cup, U+222A ISOtech
    'curren':   0x00a4, # currency sign, U+00A4 ISOnum
    'dArr':     0x21d3, # downwards double arrow, U+21D3 ISOamsa
    'dagger':   0x2020, # dagger, U+2020 ISOpub
    'darr':     0x2193, # downwards arrow, U+2193 ISOnum
    'deg':      0x00b0, # degree sign, U+00B0 ISOnum
    'delta':    0x03b4, # greek small letter delta, U+03B4 ISOgrk3
    'diams':    0x2666, # black diamond suit, U+2666 ISOpub
    'divide':   0x00f7, # division sign, U+00F7 ISOnum
    'eacute':   0x00e9, # latin small letter e with acute, U+00E9 ISOlat1
    'ecirc':    0x00ea, # latin small letter e with circumflex, U+00EA ISOlat1
    'egrave':   0x00e8, # latin small letter e with grave, U+00E8 ISOlat1
    'empty':    0x2205, # empty set = null set = diameter, U+2205 ISOamso
    'emsp':     0x2003, # em space, U+2003 ISOpub
    'ensp':     0x2002, # en space, U+2002 ISOpub
    'epsilon':  0x03b5, # greek small letter epsilon, U+03B5 ISOgrk3
    'equiv':    0x2261, # identical to, U+2261 ISOtech
    'eta':      0x03b7, # greek small letter eta, U+03B7 ISOgrk3
    'eth':      0x00f0, # latin small letter eth, U+00F0 ISOlat1
    'euml':     0x00eb, # latin small letter e with diaeresis, U+00EB ISOlat1
    'euro':     0x20ac, # euro sign, U+20AC NEW
    'exist':    0x2203, # there exists, U+2203 ISOtech
    'fnof':     0x0192, # latin small f with hook = function = florin, U+0192 ISOtech
    'forall':   0x2200, # for all, U+2200 ISOtech
    'frac12':   0x00bd, # vulgar fraction one half = fraction one half, U+00BD ISOnum
    'frac14':   0x00bc, # vulgar fraction one quarter = fraction one quarter, U+00BC ISOnum
    'frac34':   0x00be, # vulgar fraction three quarters = fraction three quarters, U+00BE ISOnum
    'frasl':    0x2044, # fraction slash, U+2044 NEW
    'gamma':    0x03b3, # greek small letter gamma, U+03B3 ISOgrk3
    'ge':       0x2265, # greater-than or equal to, U+2265 ISOtech
    'gt':       0x003e, # greater-than sign, U+003E ISOnum
    'hArr':     0x21d4, # left right double arrow, U+21D4 ISOamsa
    'harr':     0x2194, # left right arrow, U+2194 ISOamsa
    'hearts':   0x2665, # black heart suit = valentine, U+2665 ISOpub
    'hellip':   0x2026, # horizontal ellipsis = three dot leader, U+2026 ISOpub
    'iacute':   0x00ed, # latin small letter i with acute, U+00ED ISOlat1
    'icirc':    0x00ee, # latin small letter i with circumflex, U+00EE ISOlat1
    'iexcl':    0x00a1, # inverted exclamation mark, U+00A1 ISOnum
    'igrave':   0x00ec, # latin small letter i with grave, U+00EC ISOlat1
    'image':    0x2111, # blackletter capital I = imaginary part, U+2111 ISOamso
    'infin':    0x221e, # infinity, U+221E ISOtech
    'int':      0x222b, # integral, U+222B ISOtech
    'iota':     0x03b9, # greek small letter iota, U+03B9 ISOgrk3
    'iquest':   0x00bf, # inverted question mark = turned question mark, U+00BF ISOnum
    'isin':     0x2208, # element of, U+2208 ISOtech
    'iuml':     0x00ef, # latin small letter i with diaeresis, U+00EF ISOlat1
    'kappa':    0x03ba, # greek small letter kappa, U+03BA ISOgrk3
    'lArr':     0x21d0, # leftwards double arrow, U+21D0 ISOtech
    'lambda':   0x03bb, # greek small letter lambda, U+03BB ISOgrk3
    'lang':     0x2329, # left-pointing angle bracket = bra, U+2329 ISOtech
    'laquo':    0x00ab, # left-pointing double angle quotation mark = left pointing guillemet, U+00AB ISOnum
    'larr':     0x2190, # leftwards arrow, U+2190 ISOnum
    'lceil':    0x2308, # left ceiling = apl upstile, U+2308 ISOamsc
    'ldquo':    0x201c, # left double quotation mark, U+201C ISOnum
    'le':       0x2264, # less-than or equal to, U+2264 ISOtech
    'lfloor':   0x230a, # left floor = apl downstile, U+230A ISOamsc
    'lowast':   0x2217, # asterisk operator, U+2217 ISOtech
    'loz':      0x25ca, # lozenge, U+25CA ISOpub
    'lrm':      0x200e, # left-to-right mark, U+200E NEW RFC 2070
    'lsaquo':   0x2039, # single left-pointing angle quotation mark, U+2039 ISO proposed
    'lsquo':    0x2018, # left single quotation mark, U+2018 ISOnum
    'lt':       0x003c, # less-than sign, U+003C ISOnum
    'macr':     0x00af, # macron = spacing macron = overline = APL overbar, U+00AF ISOdia
    'mdash':    0x2014, # em dash, U+2014 ISOpub
    'micro':    0x00b5, # micro sign, U+00B5 ISOnum
    'middot':   0x00b7, # middle dot = Georgian comma = Greek middle dot, U+00B7 ISOnum
    'minus':    0x2212, # minus sign, U+2212 ISOtech
    'mu':       0x03bc, # greek small letter mu, U+03BC ISOgrk3
    'nabla':    0x2207, # nabla = backward difference, U+2207 ISOtech
    'nbsp':     0x00a0, # no-break space = non-breaking space, U+00A0 ISOnum
    'ndash':    0x2013, # en dash, U+2013 ISOpub
    'ne':       0x2260, # not equal to, U+2260 ISOtech
    'ni':       0x220b, # contains as member, U+220B ISOtech
    'not':      0x00ac, # not sign, U+00AC ISOnum
    'notin':    0x2209, # not an element of, U+2209 ISOtech
    'nsub':     0x2284, # not a subset of, U+2284 ISOamsn
    'ntilde':   0x00f1, # latin small letter n with tilde, U+00F1 ISOlat1
    'nu':       0x03bd, # greek small letter nu, U+03BD ISOgrk3
    'oacute':   0x00f3, # latin small letter o with acute, U+00F3 ISOlat1
    'ocirc':    0x00f4, # latin small letter o with circumflex, U+00F4 ISOlat1
    'oelig':    0x0153, # latin small ligature oe, U+0153 ISOlat2
    'ograve':   0x00f2, # latin small letter o with grave, U+00F2 ISOlat1
    'oline':    0x203e, # overline = spacing overscore, U+203E NEW
    'omega':    0x03c9, # greek small letter omega, U+03C9 ISOgrk3
    'omicron':  0x03bf, # greek small letter omicron, U+03BF NEW
    'oplus':    0x2295, # circled plus = direct sum, U+2295 ISOamsb
    'or':       0x2228, # logical or = vee, U+2228 ISOtech
    'ordf':     0x00aa, # feminine ordinal indicator, U+00AA ISOnum
    'ordm':     0x00ba, # masculine ordinal indicator, U+00BA ISOnum
    'oslash':   0x00f8, # latin small letter o with stroke, = latin small letter o slash, U+00F8 ISOlat1
    'otilde':   0x00f5, # latin small letter o with tilde, U+00F5 ISOlat1
    'otimes':   0x2297, # circled times = vector product, U+2297 ISOamsb
    'ouml':     0x00f6, # latin small letter o with diaeresis, U+00F6 ISOlat1
    'para':     0x00b6, # pilcrow sign = paragraph sign, U+00B6 ISOnum
    'part':     0x2202, # partial differential, U+2202 ISOtech
    'permil':   0x2030, # per mille sign, U+2030 ISOtech
    'perp':     0x22a5, # up tack = orthogonal to = perpendicular, U+22A5 ISOtech
    'phi':      0x03c6, # greek small letter phi, U+03C6 ISOgrk3
    'pi':       0x03c0, # greek small letter pi, U+03C0 ISOgrk3
    'piv':      0x03d6, # greek pi symbol, U+03D6 ISOgrk3
    'plusmn':   0x00b1, # plus-minus sign = plus-or-minus sign, U+00B1 ISOnum
    'pound':    0x00a3, # pound sign, U+00A3 ISOnum
    'prime':    0x2032, # prime = minutes = feet, U+2032 ISOtech
    'prod':     0x220f, # n-ary product = product sign, U+220F ISOamsb
    'prop':     0x221d, # proportional to, U+221D ISOtech
    'psi':      0x03c8, # greek small letter psi, U+03C8 ISOgrk3
    'quot':     0x0022, # quotation mark = APL quote, U+0022 ISOnum
    'rArr':     0x21d2, # rightwards double arrow, U+21D2 ISOtech
    'radic':    0x221a, # square root = radical sign, U+221A ISOtech
    'rang':     0x232a, # right-pointing angle bracket = ket, U+232A ISOtech
    'raquo':    0x00bb, # right-pointing double angle quotation mark = right pointing guillemet, U+00BB ISOnum
    'rarr':     0x2192, # rightwards arrow, U+2192 ISOnum
    'rceil':    0x2309, # right ceiling, U+2309 ISOamsc
    'rdquo':    0x201d, # right double quotation mark, U+201D ISOnum
    'real':     0x211c, # blackletter capital R = real part symbol, U+211C ISOamso
    'reg':      0x00ae, # registered sign = registered trade mark sign, U+00AE ISOnum
    'rfloor':   0x230b, # right floor, U+230B ISOamsc
    'rho':      0x03c1, # greek small letter rho, U+03C1 ISOgrk3
    'rlm':      0x200f, # right-to-left mark, U+200F NEW RFC 2070
    'rsaquo':   0x203a, # single right-pointing angle quotation mark, U+203A ISO proposed
    'rsquo':    0x2019, # right single quotation mark, U+2019 ISOnum
    'sbquo':    0x201a, # single low-9 quotation mark, U+201A NEW
    'scaron':   0x0161, # latin small letter s with caron, U+0161 ISOlat2
    'sdot':     0x22c5, # dot operator, U+22C5 ISOamsb
    'sect':     0x00a7, # section sign, U+00A7 ISOnum
    'shy':      0x00ad, # soft hyphen = discretionary hyphen, U+00AD ISOnum
    'sigma':    0x03c3, # greek small letter sigma, U+03C3 ISOgrk3
    'sigmaf':   0x03c2, # greek small letter final sigma, U+03C2 ISOgrk3
    'sim':      0x223c, # tilde operator = varies with = similar to, U+223C ISOtech
    'spades':   0x2660, # black spade suit, U+2660 ISOpub
    'sub':      0x2282, # subset of, U+2282 ISOtech
    'sube':     0x2286, # subset of or equal to, U+2286 ISOtech
    'sum':      0x2211, # n-ary summation, U+2211 ISOamsb
    'sup':      0x2283, # superset of, U+2283 ISOtech
    'sup1':     0x00b9, # superscript one = superscript digit one, U+00B9 ISOnum
    'sup2':     0x00b2, # superscript two = superscript digit two = squared, U+00B2 ISOnum
    'sup3':     0x00b3, # superscript three = superscript digit three = cubed, U+00B3 ISOnum
    'supe':     0x2287, # superset of or equal to, U+2287 ISOtech
    'szlig':    0x00df, # latin small letter sharp s = ess-zed, U+00DF ISOlat1
    'tau':      0x03c4, # greek small letter tau, U+03C4 ISOgrk3
    'there4':   0x2234, # therefore, U+2234 ISOtech
    'theta':    0x03b8, # greek small letter theta, U+03B8 ISOgrk3
    'thetasym': 0x03d1, # greek small letter theta symbol, U+03D1 NEW
    'thinsp':   0x2009, # thin space, U+2009 ISOpub
    'thorn':    0x00fe, # latin small letter thorn with, U+00FE ISOlat1
    'tilde':    0x02dc, # small tilde, U+02DC ISOdia
    'times':    0x00d7, # multiplication sign, U+00D7 ISOnum
    'trade':    0x2122, # trade mark sign, U+2122 ISOnum
    'uArr':     0x21d1, # upwards double arrow, U+21D1 ISOamsa
    'uacute':   0x00fa, # latin small letter u with acute, U+00FA ISOlat1
    'uarr':     0x2191, # upwards arrow, U+2191 ISOnum
    'ucirc':    0x00fb, # latin small letter u with circumflex, U+00FB ISOlat1
    'ugrave':   0x00f9, # latin small letter u with grave, U+00F9 ISOlat1
    'uml':      0x00a8, # diaeresis = spacing diaeresis, U+00A8 ISOdia
    'upsih':    0x03d2, # greek upsilon with hook symbol, U+03D2 NEW
    'upsilon':  0x03c5, # greek small letter upsilon, U+03C5 ISOgrk3
    'uuml':     0x00fc, # latin small letter u with diaeresis, U+00FC ISOlat1
    'weierp':   0x2118, # script capital P = power set = Weierstrass p, U+2118 ISOamso
    'xi':       0x03be, # greek small letter xi, U+03BE ISOgrk3
    'yacute':   0x00fd, # latin small letter y with acute, U+00FD ISOlat1
    'yen':      0x00a5, # yen sign = yuan sign, U+00A5 ISOnum
    'yuml':     0x00ff, # latin small letter y with diaeresis, U+00FF ISOlat1
    'zeta':     0x03b6, # greek small letter zeta, U+03B6 ISOgrk3
    'zwj':      0x200d, # zero width joiner, U+200D NEW RFC 2070
    'zwnj':     0x200c, # zero width non-joiner, U+200C NEW RFC 2070
}


# maps the HTML5 named character references to the equivalent Unicode character(s)
html5 = {
    'Aacute': '\xc1',
    'aacute': '\xe1',
    'Aacute;': '\xc1',
    'aacute;': '\xe1',
    'Abreve;': '\u0102',
    'abreve;': '\u0103',
    'ac;': '\u223e',
    'acd;': '\u223f',
    'acE;': '\u223e\u0333',
    'Acirc': '\xc2',
    'acirc': '\xe2',
    'Acirc;': '\xc2',
    'acirc;': '\xe2',
    'acute': '\xb4',
    'acute;': '\xb4',
    'Acy;': '\u0410',
    'acy;': '\u0430',
    'AElig': '\xc6',
    'aelig': '\xe6',
    'AElig;': '\xc6',
    'aelig;': '\xe6',
    'af;': '\u2061',
    'Afr;': '\U0001d504',
    'afr;': '\U0001d51e',
    'Agrave': '\xc0',
    'agrave': '\xe0',
    'Agrave;': '\xc0',
    'agrave;': '\xe0',
    'alefsym;': '\u2135',
    'aleph;': '\u2135',
    'Alpha;': '\u0391',
    'alpha;': '\u03b1',
    'Amacr;': '\u0100',
    'amacr;': '\u0101',
    'amalg;': '\u2a3f',
    'AMP': '&',
    'amp': '&',
    'AMP;': '&',
    'amp;': '&',
    'And;': '\u2a53',
    'and;': '\u2227',
    'andand;': '\u2a55',
    'andd;': '\u2a5c',
    'andslope;': '\u2a58',
    'andv;': '\u2a5a',
    'ang;': '\u2220',
    'ange;': '\u29a4',
    'angle;': '\u2220',
    'angmsd;': '\u2221',
    'angmsdaa;': '\u29a8',
    'angmsdab;': '\u29a9',
    'angmsdac;': '\u29aa',
    'angmsdad;': '\u29ab',
    'angmsdae;': '\u29ac',
    'angmsdaf;': '\u29ad',
    'angmsdag;': '\u29ae',
    'angmsdah;': '\u29af',
    'angrt;': '\u221f',
    'angrtvb;': '\u22be',
    'angrtvbd;': '\u299d',
    'angsph;': '\u2222',
    'angst;': '\xc5',
    'angzarr;': '\u237c',
    'Aogon;': '\u0104',
    'aogon;': '\u0105',
    'Aopf;': '\U0001d538',
    'aopf;': '\U0001d552',
    'ap;': '\u2248',
    'apacir;': '\u2a6f',
    'apE;': '\u2a70',
    'ape;': '\u224a',
    'apid;': '\u224b',
    'apos;': "'",
    'ApplyFunction;': '\u2061',
    'approx;': '\u2248',
    'approxeq;': '\u224a',
    'Aring': '\xc5',
    'aring': '\xe5',
    'Aring;': '\xc5',
    'aring;': '\xe5',
    'Ascr;': '\U0001d49c',
    'ascr;': '\U0001d4b6',
    'Assign;': '\u2254',
    'ast;': '*',
    'asymp;': '\u2248',
    'asympeq;': '\u224d',
    'Atilde': '\xc3',
    'atilde': '\xe3',
    'Atilde;': '\xc3',
    'atilde;': '\xe3',
    'Auml': '\xc4',
    'auml': '\xe4',
    'Auml;': '\xc4',
    'auml;': '\xe4',
    'awconint;': '\u2233',
    'awint;': '\u2a11',
    'backcong;': '\u224c',
    'backepsilon;': '\u03f6',
    'backprime;': '\u2035',
    'backsim;': '\u223d',
    'backsimeq;': '\u22cd',
    'Backslash;': '\u2216',
    'Barv;': '\u2ae7',
    'barvee;': '\u22bd',
    'Barwed;': '\u2306',
    'barwed;': '\u2305',
    'barwedge;': '\u2305',
    'bbrk;': '\u23b5',
    'bbrktbrk;': '\u23b6',
    'bcong;': '\u224c',
    'Bcy;': '\u0411',
    'bcy;': '\u0431',
    'bdquo;': '\u201e',
    'becaus;': '\u2235',
    'Because;': '\u2235',
    'because;': '\u2235',
    'bemptyv;': '\u29b0',
    'bepsi;': '\u03f6',
    'bernou;': '\u212c',
    'Bernoullis;': '\u212c',
    'Beta;': '\u0392',
    'beta;': '\u03b2',
    'beth;': '\u2136',
    'between;': '\u226c',
    'Bfr;': '\U0001d505',
    'bfr;': '\U0001d51f',
    'bigcap;': '\u22c2',
    'bigcirc;': '\u25ef',
    'bigcup;': '\u22c3',
    'bigodot;': '\u2a00',
    'bigoplus;': '\u2a01',
    'bigotimes;': '\u2a02',
    'bigsqcup;': '\u2a06',
    'bigstar;': '\u2605',
    'bigtriangledown;': '\u25bd',
    'bigtriangleup;': '\u25b3',
    'biguplus;': '\u2a04',
    'bigvee;': '\u22c1',
    'bigwedge;': '\u22c0',
    'bkarow;': '\u290d',
    'blacklozenge;': '\u29eb',
    'blacksquare;': '\u25aa',
    'blacktriangle;': '\u25b4',
    'blacktriangledown;': '\u25be',
    'blacktriangleleft;': '\u25c2',
    'blacktriangleright;': '\u25b8',
    'blank;': '\u2423',
    'blk12;': '\u2592',
    'blk14;': '\u2591',
    'blk34;': '\u2593',
    'block;': '\u2588',
    'bne;': '=\u20e5',
    'bnequiv;': '\u2261\u20e5',
    'bNot;': '\u2aed',
    'bnot;': '\u2310',
    'Bopf;': '\U0001d539',
    'bopf;': '\U0001d553',
    'bot;': '\u22a5',
    'bottom;': '\u22a5',
    'bowtie;': '\u22c8',
    'boxbox;': '\u29c9',
    'boxDL;': '\u2557',
    'boxDl;': '\u2556',
    'boxdL;': '\u2555',
    'boxdl;': '\u2510',
    'boxDR;': '\u2554',
    'boxDr;': '\u2553',
    'boxdR;': '\u2552',
    'boxdr;': '\u250c',
    'boxH;': '\u2550',
    'boxh;': '\u2500',
    'boxHD;': '\u2566',
    'boxHd;': '\u2564',
    'boxhD;': '\u2565',
    'boxhd;': '\u252c',
    'boxHU;': '\u2569',
    'boxHu;': '\u2567',
    'boxhU;': '\u2568',
    'boxhu;': '\u2534',
    'boxminus;': '\u229f',
    'boxplus;': '\u229e',
    'boxtimes;': '\u22a0',
    'boxUL;': '\u255d',
    'boxUl;': '\u255c',
    'boxuL;': '\u255b',
    'boxul;': '\u2518',
    'boxUR;': '\u255a',
    'boxUr;': '\u2559',
    'boxuR;': '\u2558',
    'boxur;': '\u2514',
    'boxV;': '\u2551',
    'boxv;': '\u2502',
    'boxVH;': '\u256c',
    'boxVh;': '\u256b',
    'boxvH;': '\u256a',
    'boxvh;': '\u253c',
    'boxVL;': '\u2563',
    'boxVl;': '\u2562',
    'boxvL;': '\u2561',
    'boxvl;': '\u2524',
    'boxVR;': '\u2560',
    'boxVr;': '\u255f',
    'boxvR;': '\u255e',
    'boxvr;': '\u251c',
    'bprime;': '\u2035',
    'Breve;': '\u02d8',
    'breve;': '\u02d8',
    'brvbar': '\xa6',
    'brvbar;': '\xa6',
    'Bscr;': '\u212c',
    'bscr;': '\U0001d4b7',
    'bsemi;': '\u204f',
    'bsim;': '\u223d',
    'bsime;': '\u22cd',
    'bsol;': '\\',
    'bsolb;': '\u29c5',
    'bsolhsub;': '\u27c8',
    'bull;': '\u2022',
    'bullet;': '\u2022',
    'bump;': '\u224e',
    'bumpE;': '\u2aae',
    'bumpe;': '\u224f',
    'Bumpeq;': '\u224e',
    'bumpeq;': '\u224f',
    'Cacute;': '\u0106',
    'cacute;': '\u0107',
    'Cap;': '\u22d2',
    'cap;': '\u2229',
    'capand;': '\u2a44',
    'capbrcup;': '\u2a49',
    'capcap;': '\u2a4b',
    'capcup;': '\u2a47',
    'capdot;': '\u2a40',
    'CapitalDifferentialD;': '\u2145',
    'caps;': '\u2229\ufe00',
    'caret;': '\u2041',
    'caron;': '\u02c7',
    'Cayleys;': '\u212d',
    'ccaps;': '\u2a4d',
    'Ccaron;': '\u010c',
    'ccaron;': '\u010d',
    'Ccedil': '\xc7',
    'ccedil': '\xe7',
    'Ccedil;': '\xc7',
    'ccedil;': '\xe7',
    'Ccirc;': '\u0108',
    'ccirc;': '\u0109',
    'Cconint;': '\u2230',
    'ccups;': '\u2a4c',
    'ccupssm;': '\u2a50',
    'Cdot;': '\u010a',
    'cdot;': '\u010b',
    'cedil': '\xb8',
    'cedil;': '\xb8',
    'Cedilla;': '\xb8',
    'cemptyv;': '\u29b2',
    'cent': '\xa2',
    'cent;': '\xa2',
    'CenterDot;': '\xb7',
    'centerdot;': '\xb7',
    'Cfr;': '\u212d',
    'cfr;': '\U0001d520',
    'CHcy;': '\u0427',
    'chcy;': '\u0447',
    'check;': '\u2713',
    'checkmark;': '\u2713',
    'Chi;': '\u03a7',
    'chi;': '\u03c7',
    'cir;': '\u25cb',
    'circ;': '\u02c6',
    'circeq;': '\u2257',
    'circlearrowleft;': '\u21ba',
    'circlearrowright;': '\u21bb',
    'circledast;': '\u229b',
    'circledcirc;': '\u229a',
    'circleddash;': '\u229d',
    'CircleDot;': '\u2299',
    'circledR;': '\xae',
    'circledS;': '\u24c8',
    'CircleMinus;': '\u2296',
    'CirclePlus;': '\u2295',
    'CircleTimes;': '\u2297',
    'cirE;': '\u29c3',
    'cire;': '\u2257',
    'cirfnint;': '\u2a10',
    'cirmid;': '\u2aef',
    'cirscir;': '\u29c2',
    'ClockwiseContourIntegral;': '\u2232',
    'CloseCurlyDoubleQuote;': '\u201d',
    'CloseCurlyQuote;': '\u2019',
    'clubs;': '\u2663',
    'clubsuit;': '\u2663',
    'Colon;': '\u2237',
    'colon;': ':',
    'Colone;': '\u2a74',
    'colone;': '\u2254',
    'coloneq;': '\u2254',
    'comma;': ',',
    'commat;': '@',
    'comp;': '\u2201',
    'compfn;': '\u2218',
    'complement;': '\u2201',
    'complexes;': '\u2102',
    'cong;': '\u2245',
    'congdot;': '\u2a6d',
    'Congruent;': '\u2261',
    'Conint;': '\u222f',
    'conint;': '\u222e',
    'ContourIntegral;': '\u222e',
    'Copf;': '\u2102',
    'copf;': '\U0001d554',
    'coprod;': '\u2210',
    'Coproduct;': '\u2210',
    'COPY': '\xa9',
    'copy': '\xa9',
    'COPY;': '\xa9',
    'copy;': '\xa9',
    'copysr;': '\u2117',
    'CounterClockwiseContourIntegral;': '\u2233',
    'crarr;': '\u21b5',
    'Cross;': '\u2a2f',
    'cross;': '\u2717',
    'Cscr;': '\U0001d49e',
    'cscr;': '\U0001d4b8',
    'csub;': '\u2acf',
    'csube;': '\u2ad1',
    'csup;': '\u2ad0',
    'csupe;': '\u2ad2',
    'ctdot;': '\u22ef',
    'cudarrl;': '\u2938',
    'cudarrr;': '\u2935',
    'cuepr;': '\u22de',
    'cuesc;': '\u22df',
    'cularr;': '\u21b6',
    'cularrp;': '\u293d',
    'Cup;': '\u22d3',
    'cup;': '\u222a',
    'cupbrcap;': '\u2a48',
    'CupCap;': '\u224d',
    'cupcap;': '\u2a46',
    'cupcup;': '\u2a4a',
    'cupdot;': '\u228d',
    'cupor;': '\u2a45',
    'cups;': '\u222a\ufe00',
    'curarr;': '\u21b7',
    'curarrm;': '\u293c',
    'curlyeqprec;': '\u22de',
    'curlyeqsucc;': '\u22df',
    'curlyvee;': '\u22ce',
    'curlywedge;': '\u22cf',
    'curren': '\xa4',
    'curren;': '\xa4',
    'curvearrowleft;': '\u21b6',
    'curvearrowright;': '\u21b7',
    'cuvee;': '\u22ce',
    'cuwed;': '\u22cf',
    'cwconint;': '\u2232',
    'cwint;': '\u2231',
    'cylcty;': '\u232d',
    'Dagger;': '\u2021',
    'dagger;': '\u2020',
    'daleth;': '\u2138',
    'Darr;': '\u21a1',
    'dArr;': '\u21d3',
    'darr;': '\u2193',
    'dash;': '\u2010',
    'Dashv;': '\u2ae4',
    'dashv;': '\u22a3',
    'dbkarow;': '\u290f',
    'dblac;': '\u02dd',
    'Dcaron;': '\u010e',
    'dcaron;': '\u010f',
    'Dcy;': '\u0414',
    'dcy;': '\u0434',
    'DD;': '\u2145',
    'dd;': '\u2146',
    'ddagger;': '\u2021',
    'ddarr;': '\u21ca',
    'DDotrahd;': '\u2911',
    'ddotseq;': '\u2a77',
    'deg': '\xb0',
    'deg;': '\xb0',
    'Del;': '\u2207',
    'Delta;': '\u0394',
    'delta;': '\u03b4',
    'demptyv;': '\u29b1',
    'dfisht;': '\u297f',
    'Dfr;': '\U0001d507',
    'dfr;': '\U0001d521',
    'dHar;': '\u2965',
    'dharl;': '\u21c3',
    'dharr;': '\u21c2',
    'DiacriticalAcute;': '\xb4',
    'DiacriticalDot;': '\u02d9',
    'DiacriticalDoubleAcute;': '\u02dd',
    'DiacriticalGrave;': '`',
    'DiacriticalTilde;': '\u02dc',
    'diam;': '\u22c4',
    'Diamond;': '\u22c4',
    'diamond;': '\u22c4',
    'diamondsuit;': '\u2666',
    'diams;': '\u2666',
    'die;': '\xa8',
    'DifferentialD;': '\u2146',
    'digamma;': '\u03dd',
    'disin;': '\u22f2',
    'div;': '\xf7',
    'divide': '\xf7',
    'divide;': '\xf7',
    'divideontimes;': '\u22c7',
    'divonx;': '\u22c7',
    'DJcy;': '\u0402',
    'djcy;': '\u0452',
    'dlcorn;': '\u231e',
    'dlcrop;': '\u230d',
    'dollar;': '$',
    'Dopf;': '\U0001d53b',
    'dopf;': '\U0001d555',
    'Dot;': '\xa8',
    'dot;': '\u02d9',
    'DotDot;': '\u20dc',
    'doteq;': '\u2250',
    'doteqdot;': '\u2251',
    'DotEqual;': '\u2250',
    'dotminus;': '\u2238',
    'dotplus;': '\u2214',
    'dotsquare;': '\u22a1',
    'doublebarwedge;': '\u2306',
    'DoubleContourIntegral;': '\u222f',
    'DoubleDot;': '\xa8',
    'DoubleDownArrow;': '\u21d3',
    'DoubleLeftArrow;': '\u21d0',
    'DoubleLeftRightArrow;': '\u21d4',
    'DoubleLeftTee;': '\u2ae4',
    'DoubleLongLeftArrow;': '\u27f8',
    'DoubleLongLeftRightArrow;': '\u27fa',
    'DoubleLongRightArrow;': '\u27f9',
    'DoubleRightArrow;': '\u21d2',
    'DoubleRightTee;': '\u22a8',
    'DoubleUpArrow;': '\u21d1',
    'DoubleUpDownArrow;': '\u21d5',
    'DoubleVerticalBar;': '\u2225',
    'DownArrow;': '\u2193',
    'Downarrow;': '\u21d3',
    'downarrow;': '\u2193',
    'DownArrowBar;': '\u2913',
    'DownArrowUpArrow;': '\u21f5',
    'DownBreve;': '\u0311',
    'downdownarrows;': '\u21ca',
    'downharpoonleft;': '\u21c3',
    'downharpoonright;': '\u21c2',
    'DownLeftRightVector;': '\u2950',
    'DownLeftTeeVector;': '\u295e',
    'DownLeftVector;': '\u21bd',
    'DownLeftVectorBar;': '\u2956',
    'DownRightTeeVector;': '\u295f',
    'DownRightVector;': '\u21c1',
    'DownRightVectorBar;': '\u2957',
    'DownTee;': '\u22a4',
    'DownTeeArrow;': '\u21a7',
    'drbkarow;': '\u2910',
    'drcorn;': '\u231f',
    'drcrop;': '\u230c',
    'Dscr;': '\U0001d49f',
    'dscr;': '\U0001d4b9',
    'DScy;': '\u0405',
    'dscy;': '\u0455',
    'dsol;': '\u29f6',
    'Dstrok;': '\u0110',
    'dstrok;': '\u0111',
    'dtdot;': '\u22f1',
    'dtri;': '\u25bf',
    'dtrif;': '\u25be',
    'duarr;': '\u21f5',
    'duhar;': '\u296f',
    'dwangle;': '\u29a6',
    'DZcy;': '\u040f',
    'dzcy;': '\u045f',
    'dzigrarr;': '\u27ff',
    'Eacute': '\xc9',
    'eacute': '\xe9',
    'Eacute;': '\xc9',
    'eacute;': '\xe9',
    'easter;': '\u2a6e',
    'Ecaron;': '\u011a',
    'ecaron;': '\u011b',
    'ecir;': '\u2256',
    'Ecirc': '\xca',
    'ecirc': '\xea',
    'Ecirc;': '\xca',
    'ecirc;': '\xea',
    'ecolon;': '\u2255',
    'Ecy;': '\u042d',
    'ecy;': '\u044d',
    'eDDot;': '\u2a77',
    'Edot;': '\u0116',
    'eDot;': '\u2251',
    'edot;': '\u0117',
    'ee;': '\u2147',
    'efDot;': '\u2252',
    'Efr;': '\U0001d508',
    'efr;': '\U0001d522',
    'eg;': '\u2a9a',
    'Egrave': '\xc8',
    'egrave': '\xe8',
    'Egrave;': '\xc8',
    'egrave;': '\xe8',
    'egs;': '\u2a96',
    'egsdot;': '\u2a98',
    'el;': '\u2a99',
    'Element;': '\u2208',
    'elinters;': '\u23e7',
    'ell;': '\u2113',
    'els;': '\u2a95',
    'elsdot;': '\u2a97',
    'Emacr;': '\u0112',
    'emacr;': '\u0113',
    'empty;': '\u2205',
    'emptyset;': '\u2205',
    'EmptySmallSquare;': '\u25fb',
    'emptyv;': '\u2205',
    'EmptyVerySmallSquare;': '\u25ab',
    'emsp13;': '\u2004',
    'emsp14;': '\u2005',
    'emsp;': '\u2003',
    'ENG;': '\u014a',
    'eng;': '\u014b',
    'ensp;': '\u2002',
    'Eogon;': '\u0118',
    'eogon;': '\u0119',
    'Eopf;': '\U0001d53c',
    'eopf;': '\U0001d556',
    'epar;': '\u22d5',
    'eparsl;': '\u29e3',
    'eplus;': '\u2a71',
    'epsi;': '\u03b5',
    'Epsilon;': '\u0395',
    'epsilon;': '\u03b5',
    'epsiv;': '\u03f5',
    'eqcirc;': '\u2256',
    'eqcolon;': '\u2255',
    'eqsim;': '\u2242',
    'eqslantgtr;': '\u2a96',
    'eqslantless;': '\u2a95',
    'Equal;': '\u2a75',
    'equals;': '=',
    'EqualTilde;': '\u2242',
    'equest;': '\u225f',
    'Equilibrium;': '\u21cc',
    'equiv;': '\u2261',
    'equivDD;': '\u2a78',
    'eqvparsl;': '\u29e5',
    'erarr;': '\u2971',
    'erDot;': '\u2253',
    'Escr;': '\u2130',
    'escr;': '\u212f',
    'esdot;': '\u2250',
    'Esim;': '\u2a73',
    'esim;': '\u2242',
    'Eta;': '\u0397',
    'eta;': '\u03b7',
    'ETH': '\xd0',
    'eth': '\xf0',
    'ETH;': '\xd0',
    'eth;': '\xf0',
    'Euml': '\xcb',
    'euml': '\xeb',
    'Euml;': '\xcb',
    'euml;': '\xeb',
    'euro;': '\u20ac',
    'excl;': '!',
    'exist;': '\u2203',
    'Exists;': '\u2203',
    'expectation;': '\u2130',
    'ExponentialE;': '\u2147',
    'exponentiale;': '\u2147',
    'fallingdotseq;': '\u2252',
    'Fcy;': '\u0424',
    'fcy;': '\u0444',
    'female;': '\u2640',
    'ffilig;': '\ufb03',
    'fflig;': '\ufb00',
    'ffllig;': '\ufb04',
    'Ffr;': '\U0001d509',
    'ffr;': '\U0001d523',
    'filig;': '\ufb01',
    'FilledSmallSquare;': '\u25fc',
    'FilledVerySmallSquare;': '\u25aa',
    'fjlig;': 'fj',
    'flat;': '\u266d',
    'fllig;': '\ufb02',
    'fltns;': '\u25b1',
    'fnof;': '\u0192',
    'Fopf;': '\U0001d53d',
    'fopf;': '\U0001d557',
    'ForAll;': '\u2200',
    'forall;': '\u2200',
    'fork;': '\u22d4',
    'forkv;': '\u2ad9',
    'Fouriertrf;': '\u2131',
    'fpartint;': '\u2a0d',
    'frac12': '\xbd',
    'frac12;': '\xbd',
    'frac13;': '\u2153',
    'frac14': '\xbc',
    'frac14;': '\xbc',
    'frac15;': '\u2155',
    'frac16;': '\u2159',
    'frac18;': '\u215b',
    'frac23;': '\u2154',
    'frac25;': '\u2156',
    'frac34': '\xbe',
    'frac34;': '\xbe',
    'frac35;': '\u2157',
    'frac38;': '\u215c',
    'frac45;': '\u2158',
    'frac56;': '\u215a',
    'frac58;': '\u215d',
    'frac78;': '\u215e',
    'frasl;': '\u2044',
    'frown;': '\u2322',
    'Fscr;': '\u2131',
    'fscr;': '\U0001d4bb',
    'gacute;': '\u01f5',
    'Gamma;': '\u0393',
    'gamma;': '\u03b3',
    'Gammad;': '\u03dc',
    'gammad;': '\u03dd',
    'gap;': '\u2a86',
    'Gbreve;': '\u011e',
    'gbreve;': '\u011f',
    'Gcedil;': '\u0122',
    'Gcirc;': '\u011c',
    'gcirc;': '\u011d',
    'Gcy;': '\u0413',
    'gcy;': '\u0433',
    'Gdot;': '\u0120',
    'gdot;': '\u0121',
    'gE;': '\u2267',
    'ge;': '\u2265',
    'gEl;': '\u2a8c',
    'gel;': '\u22db',
    'geq;': '\u2265',
    'geqq;': '\u2267',
    'geqslant;': '\u2a7e',
    'ges;': '\u2a7e',
    'gescc;': '\u2aa9',
    'gesdot;': '\u2a80',
    'gesdoto;': '\u2a82',
    'gesdotol;': '\u2a84',
    'gesl;': '\u22db\ufe00',
    'gesles;': '\u2a94',
    'Gfr;': '\U0001d50a',
    'gfr;': '\U0001d524',
    'Gg;': '\u22d9',
    'gg;': '\u226b',
    'ggg;': '\u22d9',
    'gimel;': '\u2137',
    'GJcy;': '\u0403',
    'gjcy;': '\u0453',
    'gl;': '\u2277',
    'gla;': '\u2aa5',
    'glE;': '\u2a92',
    'glj;': '\u2aa4',
    'gnap;': '\u2a8a',
    'gnapprox;': '\u2a8a',
    'gnE;': '\u2269',
    'gne;': '\u2a88',
    'gneq;': '\u2a88',
    'gneqq;': '\u2269',
    'gnsim;': '\u22e7',
    'Gopf;': '\U0001d53e',
    'gopf;': '\U0001d558',
    'grave;': '`',
    'GreaterEqual;': '\u2265',
    'GreaterEqualLess;': '\u22db',
    'GreaterFullEqual;': '\u2267',
    'GreaterGreater;': '\u2aa2',
    'GreaterLess;': '\u2277',
    'GreaterSlantEqual;': '\u2a7e',
    'GreaterTilde;': '\u2273',
    'Gscr;': '\U0001d4a2',
    'gscr;': '\u210a',
    'gsim;': '\u2273',
    'gsime;': '\u2a8e',
    'gsiml;': '\u2a90',
    'GT': '>',
    'gt': '>',
    'GT;': '>',
    'Gt;': '\u226b',
    'gt;': '>',
    'gtcc;': '\u2aa7',
    'gtcir;': '\u2a7a',
    'gtdot;': '\u22d7',
    'gtlPar;': '\u2995',
    'gtquest;': '\u2a7c',
    'gtrapprox;': '\u2a86',
    'gtrarr;': '\u2978',
    'gtrdot;': '\u22d7',
    'gtreqless;': '\u22db',
    'gtreqqless;': '\u2a8c',
    'gtrless;': '\u2277',
    'gtrsim;': '\u2273',
    'gvertneqq;': '\u2269\ufe00',
    'gvnE;': '\u2269\ufe00',
    'Hacek;': '\u02c7',
    'hairsp;': '\u200a',
    'half;': '\xbd',
    'hamilt;': '\u210b',
    'HARDcy;': '\u042a',
    'hardcy;': '\u044a',
    'hArr;': '\u21d4',
    'harr;': '\u2194',
    'harrcir;': '\u2948',
    'harrw;': '\u21ad',
    'Hat;': '^',
    'hbar;': '\u210f',
    'Hcirc;': '\u0124',
    'hcirc;': '\u0125',
    'hearts;': '\u2665',
    'heartsuit;': '\u2665',
    'hellip;': '\u2026',
    'hercon;': '\u22b9',
    'Hfr;': '\u210c',
    'hfr;': '\U0001d525',
    'HilbertSpace;': '\u210b',
    'hksearow;': '\u2925',
    'hkswarow;': '\u2926',
    'hoarr;': '\u21ff',
    'homtht;': '\u223b',
    'hookleftarrow;': '\u21a9',
    'hookrightarrow;': '\u21aa',
    'Hopf;': '\u210d',
    'hopf;': '\U0001d559',
    'horbar;': '\u2015',
    'HorizontalLine;': '\u2500',
    'Hscr;': '\u210b',
    'hscr;': '\U0001d4bd',
    'hslash;': '\u210f',
    'Hstrok;': '\u0126',
    'hstrok;': '\u0127',
    'HumpDownHump;': '\u224e',
    'HumpEqual;': '\u224f',
    'hybull;': '\u2043',
    'hyphen;': '\u2010',
    'Iacute': '\xcd',
    'iacute': '\xed',
    'Iacute;': '\xcd',
    'iacute;': '\xed',
    'ic;': '\u2063',
    'Icirc': '\xce',
    'icirc': '\xee',
    'Icirc;': '\xce',
    'icirc;': '\xee',
    'Icy;': '\u0418',
    'icy;': '\u0438',
    'Idot;': '\u0130',
    'IEcy;': '\u0415',
    'iecy;': '\u0435',
    'iexcl': '\xa1',
    'iexcl;': '\xa1',
    'iff;': '\u21d4',
    'Ifr;': '\u2111',
    'ifr;': '\U0001d526',
    'Igrave': '\xcc',
    'igrave': '\xec',
    'Igrave;': '\xcc',
    'igrave;': '\xec',
    'ii;': '\u2148',
    'iiiint;': '\u2a0c',
    'iiint;': '\u222d',
    'iinfin;': '\u29dc',
    'iiota;': '\u2129',
    'IJlig;': '\u0132',
    'ijlig;': '\u0133',
    'Im;': '\u2111',
    'Imacr;': '\u012a',
    'imacr;': '\u012b',
    'image;': '\u2111',
    'ImaginaryI;': '\u2148',
    'imagline;': '\u2110',
    'imagpart;': '\u2111',
    'imath;': '\u0131',
    'imof;': '\u22b7',
    'imped;': '\u01b5',
    'Implies;': '\u21d2',
    'in;': '\u2208',
    'incare;': '\u2105',
    'infin;': '\u221e',
    'infintie;': '\u29dd',
    'inodot;': '\u0131',
    'Int;': '\u222c',
    'int;': '\u222b',
    'intcal;': '\u22ba',
    'integers;': '\u2124',
    'Integral;': '\u222b',
    'intercal;': '\u22ba',
    'Intersection;': '\u22c2',
    'intlarhk;': '\u2a17',
    'intprod;': '\u2a3c',
    'InvisibleComma;': '\u2063',
    'InvisibleTimes;': '\u2062',
    'IOcy;': '\u0401',
    'iocy;': '\u0451',
    'Iogon;': '\u012e',
    'iogon;': '\u012f',
    'Iopf;': '\U0001d540',
    'iopf;': '\U0001d55a',
    'Iota;': '\u0399',
    'iota;': '\u03b9',
    'iprod;': '\u2a3c',
    'iquest': '\xbf',
    'iquest;': '\xbf',
    'Iscr;': '\u2110',
    'iscr;': '\U0001d4be',
    'isin;': '\u2208',
    'isindot;': '\u22f5',
    'isinE;': '\u22f9',
    'isins;': '\u22f4',
    'isinsv;': '\u22f3',
    'isinv;': '\u2208',
    'it;': '\u2062',
    'Itilde;': '\u0128',
    'itilde;': '\u0129',
    'Iukcy;': '\u0406',
    'iukcy;': '\u0456',
    'Iuml': '\xcf',
    'iuml': '\xef',
    'Iuml;': '\xcf',
    'iuml;': '\xef',
    'Jcirc;': '\u0134',
    'jcirc;': '\u0135',
    'Jcy;': '\u0419',
    'jcy;': '\u0439',
    'Jfr;': '\U0001d50d',
    'jfr;': '\U0001d527',
    'jmath;': '\u0237',
    'Jopf;': '\U0001d541',
    'jopf;': '\U0001d55b',
    'Jscr;': '\U0001d4a5',
    'jscr;': '\U0001d4bf',
    'Jsercy;': '\u0408',
    'jsercy;': '\u0458',
    'Jukcy;': '\u0404',
    'jukcy;': '\u0454',
    'Kappa;': '\u039a',
    'kappa;': '\u03ba',
    'kappav;': '\u03f0',
    'Kcedil;': '\u0136',
    'kcedil;': '\u0137',
    'Kcy;': '\u041a',
    'kcy;': '\u043a',
    'Kfr;': '\U0001d50e',
    'kfr;': '\U0001d528',
    'kgreen;': '\u0138',
    'KHcy;': '\u0425',
    'khcy;': '\u0445',
    'KJcy;': '\u040c',
    'kjcy;': '\u045c',
    'Kopf;': '\U0001d542',
    'kopf;': '\U0001d55c',
    'Kscr;': '\U0001d4a6',
    'kscr;': '\U0001d4c0',
    'lAarr;': '\u21da',
    'Lacute;': '\u0139',
    'lacute;': '\u013a',
    'laemptyv;': '\u29b4',
    'lagran;': '\u2112',
    'Lambda;': '\u039b',
    'lambda;': '\u03bb',
    'Lang;': '\u27ea',
    'lang;': '\u27e8',
    'langd;': '\u2991',
    'langle;': '\u27e8',
    'lap;': '\u2a85',
    'Laplacetrf;': '\u2112',
    'laquo': '\xab',
    'laquo;': '\xab',
    'Larr;': '\u219e',
    'lArr;': '\u21d0',
    'larr;': '\u2190',
    'larrb;': '\u21e4',
    'larrbfs;': '\u291f',
    'larrfs;': '\u291d',
    'larrhk;': '\u21a9',
    'larrlp;': '\u21ab',
    'larrpl;': '\u2939',
    'larrsim;': '\u2973',
    'larrtl;': '\u21a2',
    'lat;': '\u2aab',
    'lAtail;': '\u291b',
    'latail;': '\u2919',
    'late;': '\u2aad',
    'lates;': '\u2aad\ufe00',
    'lBarr;': '\u290e',
    'lbarr;': '\u290c',
    'lbbrk;': '\u2772',
    'lbrace;': '{',
    'lbrack;': '[',
    'lbrke;': '\u298b',
    'lbrksld;': '\u298f',
    'lbrkslu;': '\u298d',
    'Lcaron;': '\u013d',
    'lcaron;': '\u013e',
    'Lcedil;': '\u013b',
    'lcedil;': '\u013c',
    'lceil;': '\u2308',
    'lcub;': '{',
    'Lcy;': '\u041b',
    'lcy;': '\u043b',
    'ldca;': '\u2936',
    'ldquo;': '\u201c',
    'ldquor;': '\u201e',
    'ldrdhar;': '\u2967',
    'ldrushar;': '\u294b',
    'ldsh;': '\u21b2',
    'lE;': '\u2266',
    'le;': '\u2264',
    'LeftAngleBracket;': '\u27e8',
    'LeftArrow;': '\u2190',
    'Leftarrow;': '\u21d0',
    'leftarrow;': '\u2190',
    'LeftArrowBar;': '\u21e4',
    'LeftArrowRightArrow;': '\u21c6',
    'leftarrowtail;': '\u21a2',
    'LeftCeiling;': '\u2308',
    'LeftDoubleBracket;': '\u27e6',
    'LeftDownTeeVector;': '\u2961',
    'LeftDownVector;': '\u21c3',
    'LeftDownVectorBar;': '\u2959',
    'LeftFloor;': '\u230a',
    'leftharpoondown;': '\u21bd',
    'leftharpoonup;': '\u21bc',
    'leftleftarrows;': '\u21c7',
    'LeftRightArrow;': '\u2194',
    'Leftrightarrow;': '\u21d4',
    'leftrightarrow;': '\u2194',
    'leftrightarrows;': '\u21c6',
    'leftrightharpoons;': '\u21cb',
    'leftrightsquigarrow;': '\u21ad',
    'LeftRightVector;': '\u294e',
    'LeftTee;': '\u22a3',
    'LeftTeeArrow;': '\u21a4',
    'LeftTeeVector;': '\u295a',
    'leftthreetimes;': '\u22cb',
    'LeftTriangle;': '\u22b2',
    'LeftTriangleBar;': '\u29cf',
    'LeftTriangleEqual;': '\u22b4',
    'LeftUpDownVector;': '\u2951',
    'LeftUpTeeVector;': '\u2960',
    'LeftUpVector;': '\u21bf',
    'LeftUpVectorBar;': '\u2958',
    'LeftVector;': '\u21bc',
    'LeftVectorBar;': '\u2952',
    'lEg;': '\u2a8b',
    'leg;': '\u22da',
    'leq;': '\u2264',
    'leqq;': '\u2266',
    'leqslant;': '\u2a7d',
    'les;': '\u2a7d',
    'lescc;': '\u2aa8',
    'lesdot;': '\u2a7f',
    'lesdoto;': '\u2a81',
    'lesdotor;': '\u2a83',
    'lesg;': '\u22da\ufe00',
    'lesges;': '\u2a93',
    'lessapprox;': '\u2a85',
    'lessdot;': '\u22d6',
    'lesseqgtr;': '\u22da',
    'lesseqqgtr;': '\u2a8b',
    'LessEqualGreater;': '\u22da',
    'LessFullEqual;': '\u2266',
    'LessGreater;': '\u2276',
    'lessgtr;': '\u2276',
    'LessLess;': '\u2aa1',
    'lesssim;': '\u2272',
    'LessSlantEqual;': '\u2a7d',
    'LessTilde;': '\u2272',
    'lfisht;': '\u297c',
    'lfloor;': '\u230a',
    'Lfr;': '\U0001d50f',
    'lfr;': '\U0001d529',
    'lg;': '\u2276',
    'lgE;': '\u2a91',
    'lHar;': '\u2962',
    'lhard;': '\u21bd',
    'lharu;': '\u21bc',
    'lharul;': '\u296a',
    'lhblk;': '\u2584',
    'LJcy;': '\u0409',
    'ljcy;': '\u0459',
    'Ll;': '\u22d8',
    'll;': '\u226a',
    'llarr;': '\u21c7',
    'llcorner;': '\u231e',
    'Lleftarrow;': '\u21da',
    'llhard;': '\u296b',
    'lltri;': '\u25fa',
    'Lmidot;': '\u013f',
    'lmidot;': '\u0140',
    'lmoust;': '\u23b0',
    'lmoustache;': '\u23b0',
    'lnap;': '\u2a89',
    'lnapprox;': '\u2a89',
    'lnE;': '\u2268',
    'lne;': '\u2a87',
    'lneq;': '\u2a87',
    'lneqq;': '\u2268',
    'lnsim;': '\u22e6',
    'loang;': '\u27ec',
    'loarr;': '\u21fd',
    'lobrk;': '\u27e6',
    'LongLeftArrow;': '\u27f5',
    'Longleftarrow;': '\u27f8',
    'longleftarrow;': '\u27f5',
    'LongLeftRightArrow;': '\u27f7',
    'Longleftrightarrow;': '\u27fa',
    'longleftrightarrow;': '\u27f7',
    'longmapsto;': '\u27fc',
    'LongRightArrow;': '\u27f6',
    'Longrightarrow;': '\u27f9',
    'longrightarrow;': '\u27f6',
    'looparrowleft;': '\u21ab',
    'looparrowright;': '\u21ac',
    'lopar;': '\u2985',
    'Lopf;': '\U0001d543',
    'lopf;': '\U0001d55d',
    'loplus;': '\u2a2d',
    'lotimes;': '\u2a34',
    'lowast;': '\u2217',
    'lowbar;': '_',
    'LowerLeftArrow;': '\u2199',
    'LowerRightArrow;': '\u2198',
    'loz;': '\u25ca',
    'lozenge;': '\u25ca',
    'lozf;': '\u29eb',
    'lpar;': '(',
    'lparlt;': '\u2993',
    'lrarr;': '\u21c6',
    'lrcorner;': '\u231f',
    'lrhar;': '\u21cb',
    'lrhard;': '\u296d',
    'lrm;': '\u200e',
    'lrtri;': '\u22bf',
    'lsaquo;': '\u2039',
    'Lscr;': '\u2112',
    'lscr;': '\U0001d4c1',
    'Lsh;': '\u21b0',
    'lsh;': '\u21b0',
    'lsim;': '\u2272',
    'lsime;': '\u2a8d',
    'lsimg;': '\u2a8f',
    'lsqb;': '[',
    'lsquo;': '\u2018',
    'lsquor;': '\u201a',
    'Lstrok;': '\u0141',
    'lstrok;': '\u0142',
    'LT': '<',
    'lt': '<',
    'LT;': '<',
    'Lt;': '\u226a',
    'lt;': '<',
    'ltcc;': '\u2aa6',
    'ltcir;': '\u2a79',
    'ltdot;': '\u22d6',
    'lthree;': '\u22cb',
    'ltimes;': '\u22c9',
    'ltlarr;': '\u2976',
    'ltquest;': '\u2a7b',
    'ltri;': '\u25c3',
    'ltrie;': '\u22b4',
    'ltrif;': '\u25c2',
    'ltrPar;': '\u2996',
    'lurdshar;': '\u294a',
    'luruhar;': '\u2966',
    'lvertneqq;': '\u2268\ufe00',
    'lvnE;': '\u2268\ufe00',
    'macr': '\xaf',
    'macr;': '\xaf',
    'male;': '\u2642',
    'malt;': '\u2720',
    'maltese;': '\u2720',
    'Map;': '\u2905',
    'map;': '\u21a6',
    'mapsto;': '\u21a6',
    'mapstodown;': '\u21a7',
    'mapstoleft;': '\u21a4',
    'mapstoup;': '\u21a5',
    'marker;': '\u25ae',
    'mcomma;': '\u2a29',
    'Mcy;': '\u041c',
    'mcy;': '\u043c',
    'mdash;': '\u2014',
    'mDDot;': '\u223a',
    'measuredangle;': '\u2221',
    'MediumSpace;': '\u205f',
    'Mellintrf;': '\u2133',
    'Mfr;': '\U0001d510',
    'mfr;': '\U0001d52a',
    'mho;': '\u2127',
    'micro': '\xb5',
    'micro;': '\xb5',
    'mid;': '\u2223',
    'midast;': '*',
    'midcir;': '\u2af0',
    'middot': '\xb7',
    'middot;': '\xb7',
    'minus;': '\u2212',
    'minusb;': '\u229f',
    'minusd;': '\u2238',
    'minusdu;': '\u2a2a',
    'MinusPlus;': '\u2213',
    'mlcp;': '\u2adb',
    'mldr;': '\u2026',
    'mnplus;': '\u2213',
    'models;': '\u22a7',
    'Mopf;': '\U0001d544',
    'mopf;': '\U0001d55e',
    'mp;': '\u2213',
    'Mscr;': '\u2133',
    'mscr;': '\U0001d4c2',
    'mstpos;': '\u223e',
    'Mu;': '\u039c',
    'mu;': '\u03bc',
    'multimap;': '\u22b8',
    'mumap;': '\u22b8',
    'nabla;': '\u2207',
    'Nacute;': '\u0143',
    'nacute;': '\u0144',
    'nang;': '\u2220\u20d2',
    'nap;': '\u2249',
    'napE;': '\u2a70\u0338',
    'napid;': '\u224b\u0338',
    'napos;': '\u0149',
    'napprox;': '\u2249',
    'natur;': '\u266e',
    'natural;': '\u266e',
    'naturals;': '\u2115',
    'nbsp': '\xa0',
    'nbsp;': '\xa0',
    'nbump;': '\u224e\u0338',
    'nbumpe;': '\u224f\u0338',
    'ncap;': '\u2a43',
    'Ncaron;': '\u0147',
    'ncaron;': '\u0148',
    'Ncedil;': '\u0145',
    'ncedil;': '\u0146',
    'ncong;': '\u2247',
    'ncongdot;': '\u2a6d\u0338',
    'ncup;': '\u2a42',
    'Ncy;': '\u041d',
    'ncy;': '\u043d',
    'ndash;': '\u2013',
    'ne;': '\u2260',
    'nearhk;': '\u2924',
    'neArr;': '\u21d7',
    'nearr;': '\u2197',
    'nearrow;': '\u2197',
    'nedot;': '\u2250\u0338',
    'NegativeMediumSpace;': '\u200b',
    'NegativeThickSpace;': '\u200b',
    'NegativeThinSpace;': '\u200b',
    'NegativeVeryThinSpace;': '\u200b',
    'nequiv;': '\u2262',
    'nesear;': '\u2928',
    'nesim;': '\u2242\u0338',
    'NestedGreaterGreater;': '\u226b',
    'NestedLessLess;': '\u226a',
    'NewLine;': '\n',
    'nexist;': '\u2204',
    'nexists;': '\u2204',
    'Nfr;': '\U0001d511',
    'nfr;': '\U0001d52b',
    'ngE;': '\u2267\u0338',
    'nge;': '\u2271',
    'ngeq;': '\u2271',
    'ngeqq;': '\u2267\u0338',
    'ngeqslant;': '\u2a7e\u0338',
    'nges;': '\u2a7e\u0338',
    'nGg;': '\u22d9\u0338',
    'ngsim;': '\u2275',
    'nGt;': '\u226b\u20d2',
    'ngt;': '\u226f',
    'ngtr;': '\u226f',
    'nGtv;': '\u226b\u0338',
    'nhArr;': '\u21ce',
    'nharr;': '\u21ae',
    'nhpar;': '\u2af2',
    'ni;': '\u220b',
    'nis;': '\u22fc',
    'nisd;': '\u22fa',
    'niv;': '\u220b',
    'NJcy;': '\u040a',
    'njcy;': '\u045a',
    'nlArr;': '\u21cd',
    'nlarr;': '\u219a',
    'nldr;': '\u2025',
    'nlE;': '\u2266\u0338',
    'nle;': '\u2270',
    'nLeftarrow;': '\u21cd',
    'nleftarrow;': '\u219a',
    'nLeftrightarrow;': '\u21ce',
    'nleftrightarrow;': '\u21ae',
    'nleq;': '\u2270',
    'nleqq;': '\u2266\u0338',
    'nleqslant;': '\u2a7d\u0338',
    'nles;': '\u2a7d\u0338',
    'nless;': '\u226e',
    'nLl;': '\u22d8\u0338',
    'nlsim;': '\u2274',
    'nLt;': '\u226a\u20d2',
    'nlt;': '\u226e',
    'nltri;': '\u22ea',
    'nltrie;': '\u22ec',
    'nLtv;': '\u226a\u0338',
    'nmid;': '\u2224',
    'NoBreak;': '\u2060',
    'NonBreakingSpace;': '\xa0',
    'Nopf;': '\u2115',
    'nopf;': '\U0001d55f',
    'not': '\xac',
    'Not;': '\u2aec',
    'not;': '\xac',
    'NotCongruent;': '\u2262',
    'NotCupCap;': '\u226d',
    'NotDoubleVerticalBar;': '\u2226',
    'NotElement;': '\u2209',
    'NotEqual;': '\u2260',
    'NotEqualTilde;': '\u2242\u0338',
    'NotExists;': '\u2204',
    'NotGreater;': '\u226f',
    'NotGreaterEqual;': '\u2271',
    'NotGreaterFullEqual;': '\u2267\u0338',
    'NotGreaterGreater;': '\u226b\u0338',
    'NotGreaterLess;': '\u2279',
    'NotGreaterSlantEqual;': '\u2a7e\u0338',
    'NotGreaterTilde;': '\u2275',
    'NotHumpDownHump;': '\u224e\u0338',
    'NotHumpEqual;': '\u224f\u0338',
    'notin;': '\u2209',
    'notindot;': '\u22f5\u0338',
    'notinE;': '\u22f9\u0338',
    'notinva;': '\u2209',
    'notinvb;': '\u22f7',
    'notinvc;': '\u22f6',
    'NotLeftTriangle;': '\u22ea',
    'NotLeftTriangleBar;': '\u29cf\u0338',
    'NotLeftTriangleEqual;': '\u22ec',
    'NotLess;': '\u226e',
    'NotLessEqual;': '\u2270',
    'NotLessGreater;': '\u2278',
    'NotLessLess;': '\u226a\u0338',
    'NotLessSlantEqual;': '\u2a7d\u0338',
    'NotLessTilde;': '\u2274',
    'NotNestedGreaterGreater;': '\u2aa2\u0338',
    'NotNestedLessLess;': '\u2aa1\u0338',
    'notni;': '\u220c',
    'notniva;': '\u220c',
    'notnivb;': '\u22fe',
    'notnivc;': '\u22fd',
    'NotPrecedes;': '\u2280',
    'NotPrecedesEqual;': '\u2aaf\u0338',
    'NotPrecedesSlantEqual;': '\u22e0',
    'NotReverseElement;': '\u220c',
    'NotRightTriangle;': '\u22eb',
    'NotRightTriangleBar;': '\u29d0\u0338',
    'NotRightTriangleEqual;': '\u22ed',
    'NotSquareSubset;': '\u228f\u0338',
    'NotSquareSubsetEqual;': '\u22e2',
    'NotSquareSuperset;': '\u2290\u0338',
    'NotSquareSupersetEqual;': '\u22e3',
    'NotSubset;': '\u2282\u20d2',
    'NotSubsetEqual;': '\u2288',
    'NotSucceeds;': '\u2281',
    'NotSucceedsEqual;': '\u2ab0\u0338',
    'NotSucceedsSlantEqual;': '\u22e1',
    'NotSucceedsTilde;': '\u227f\u0338',
    'NotSuperset;': '\u2283\u20d2',
    'NotSupersetEqual;': '\u2289',
    'NotTilde;': '\u2241',
    'NotTildeEqual;': '\u2244',
    'NotTildeFullEqual;': '\u2247',
    'NotTildeTilde;': '\u2249',
    'NotVerticalBar;': '\u2224',
    'npar;': '\u2226',
    'nparallel;': '\u2226',
    'nparsl;': '\u2afd\u20e5',
    'npart;': '\u2202\u0338',
    'npolint;': '\u2a14',
    'npr;': '\u2280',
    'nprcue;': '\u22e0',
    'npre;': '\u2aaf\u0338',
    'nprec;': '\u2280',
    'npreceq;': '\u2aaf\u0338',
    'nrArr;': '\u21cf',
    'nrarr;': '\u219b',
    'nrarrc;': '\u2933\u0338',
    'nrarrw;': '\u219d\u0338',
    'nRightarrow;': '\u21cf',
    'nrightarrow;': '\u219b',
    'nrtri;': '\u22eb',
    'nrtrie;': '\u22ed',
    'nsc;': '\u2281',
    'nsccue;': '\u22e1',
    'nsce;': '\u2ab0\u0338',
    'Nscr;': '\U0001d4a9',
    'nscr;': '\U0001d4c3',
    'nshortmid;': '\u2224',
    'nshortparallel;': '\u2226',
    'nsim;': '\u2241',
    'nsime;': '\u2244',
    'nsimeq;': '\u2244',
    'nsmid;': '\u2224',
    'nspar;': '\u2226',
    'nsqsube;': '\u22e2',
    'nsqsupe;': '\u22e3',
    'nsub;': '\u2284',
    'nsubE;': '\u2ac5\u0338',
    'nsube;': '\u2288',
    'nsubset;': '\u2282\u20d2',
    'nsubseteq;': '\u2288',
    'nsubseteqq;': '\u2ac5\u0338',
    'nsucc;': '\u2281',
    'nsucceq;': '\u2ab0\u0338',
    'nsup;': '\u2285',
    'nsupE;': '\u2ac6\u0338',
    'nsupe;': '\u2289',
    'nsupset;': '\u2283\u20d2',
    'nsupseteq;': '\u2289',
    'nsupseteqq;': '\u2ac6\u0338',
    'ntgl;': '\u2279',
    'Ntilde': '\xd1',
    'ntilde': '\xf1',
    'Ntilde;': '\xd1',
    'ntilde;': '\xf1',
    'ntlg;': '\u2278',
    'ntriangleleft;': '\u22ea',
    'ntrianglelefteq;': '\u22ec',
    'ntriangleright;': '\u22eb',
    'ntrianglerighteq;': '\u22ed',
    'Nu;': '\u039d',
    'nu;': '\u03bd',
    'num;': '#',
    'numero;': '\u2116',
    'numsp;': '\u2007',
    'nvap;': '\u224d\u20d2',
    'nVDash;': '\u22af',
    'nVdash;': '\u22ae',
    'nvDash;': '\u22ad',
    'nvdash;': '\u22ac',
    'nvge;': '\u2265\u20d2',
    'nvgt;': '>\u20d2',
    'nvHarr;': '\u2904',
    'nvinfin;': '\u29de',
    'nvlArr;': '\u2902',
    'nvle;': '\u2264\u20d2',
    'nvlt;': '<\u20d2',
    'nvltrie;': '\u22b4\u20d2',
    'nvrArr;': '\u2903',
    'nvrtrie;': '\u22b5\u20d2',
    'nvsim;': '\u223c\u20d2',
    'nwarhk;': '\u2923',
    'nwArr;': '\u21d6',
    'nwarr;': '\u2196',
    'nwarrow;': '\u2196',
    'nwnear;': '\u2927',
    'Oacute': '\xd3',
    'oacute': '\xf3',
    'Oacute;': '\xd3',
    'oacute;': '\xf3',
    'oast;': '\u229b',
    'ocir;': '\u229a',
    'Ocirc': '\xd4',
    'ocirc': '\xf4',
    'Ocirc;': '\xd4',
    'ocirc;': '\xf4',
    'Ocy;': '\u041e',
    'ocy;': '\u043e',
    'odash;': '\u229d',
    'Odblac;': '\u0150',
    'odblac;': '\u0151',
    'odiv;': '\u2a38',
    'odot;': '\u2299',
    'odsold;': '\u29bc',
    'OElig;': '\u0152',
    'oelig;': '\u0153',
    'ofcir;': '\u29bf',
    'Ofr;': '\U0001d512',
    'ofr;': '\U0001d52c',
    'ogon;': '\u02db',
    'Ograve': '\xd2',
    'ograve': '\xf2',
    'Ograve;': '\xd2',
    'ograve;': '\xf2',
    'ogt;': '\u29c1',
    'ohbar;': '\u29b5',
    'ohm;': '\u03a9',
    'oint;': '\u222e',
    'olarr;': '\u21ba',
    'olcir;': '\u29be',
    'olcross;': '\u29bb',
    'oline;': '\u203e',
    'olt;': '\u29c0',
    'Omacr;': '\u014c',
    'omacr;': '\u014d',
    'Omega;': '\u03a9',
    'omega;': '\u03c9',
    'Omicron;': '\u039f',
    'omicron;': '\u03bf',
    'omid;': '\u29b6',
    'ominus;': '\u2296',
    'Oopf;': '\U0001d546',
    'oopf;': '\U0001d560',
    'opar;': '\u29b7',
    'OpenCurlyDoubleQuote;': '\u201c',
    'OpenCurlyQuote;': '\u2018',
    'operp;': '\u29b9',
    'oplus;': '\u2295',
    'Or;': '\u2a54',
    'or;': '\u2228',
    'orarr;': '\u21bb',
    'ord;': '\u2a5d',
    'order;': '\u2134',
    'orderof;': '\u2134',
    'ordf': '\xaa',
    'ordf;': '\xaa',
    'ordm': '\xba',
    'ordm;': '\xba',
    'origof;': '\u22b6',
    'oror;': '\u2a56',
    'orslope;': '\u2a57',
    'orv;': '\u2a5b',
    'oS;': '\u24c8',
    'Oscr;': '\U0001d4aa',
    'oscr;': '\u2134',
    'Oslash': '\xd8',
    'oslash': '\xf8',
    'Oslash;': '\xd8',
    'oslash;': '\xf8',
    'osol;': '\u2298',
    'Otilde': '\xd5',
    'otilde': '\xf5',
    'Otilde;': '\xd5',
    'otilde;': '\xf5',
    'Otimes;': '\u2a37',
    'otimes;': '\u2297',
    'otimesas;': '\u2a36',
    'Ouml': '\xd6',
    'ouml': '\xf6',
    'Ouml;': '\xd6',
    'ouml;': '\xf6',
    'ovbar;': '\u233d',
    'OverBar;': '\u203e',
    'OverBrace;': '\u23de',
    'OverBracket;': '\u23b4',
    'OverParenthesis;': '\u23dc',
    'par;': '\u2225',
    'para': '\xb6',
    'para;': '\xb6',
    'parallel;': '\u2225',
    'parsim;': '\u2af3',
    'parsl;': '\u2afd',
    'part;': '\u2202',
    'PartialD;': '\u2202',
    'Pcy;': '\u041f',
    'pcy;': '\u043f',
    'percnt;': '%',
    'period;': '.',
    'permil;': '\u2030',
    'perp;': '\u22a5',
    'pertenk;': '\u2031',
    'Pfr;': '\U0001d513',
    'pfr;': '\U0001d52d',
    'Phi;': '\u03a6',
    'phi;': '\u03c6',
    'phiv;': '\u03d5',
    'phmmat;': '\u2133',
    'phone;': '\u260e',
    'Pi;': '\u03a0',
    'pi;': '\u03c0',
    'pitchfork;': '\u22d4',
    'piv;': '\u03d6',
    'planck;': '\u210f',
    'planckh;': '\u210e',
    'plankv;': '\u210f',
    'plus;': '+',
    'plusacir;': '\u2a23',
    'plusb;': '\u229e',
    'pluscir;': '\u2a22',
    'plusdo;': '\u2214',
    'plusdu;': '\u2a25',
    'pluse;': '\u2a72',
    'PlusMinus;': '\xb1',
    'plusmn': '\xb1',
    'plusmn;': '\xb1',
    'plussim;': '\u2a26',
    'plustwo;': '\u2a27',
    'pm;': '\xb1',
    'Poincareplane;': '\u210c',
    'pointint;': '\u2a15',
    'Popf;': '\u2119',
    'popf;': '\U0001d561',
    'pound': '\xa3',
    'pound;': '\xa3',
    'Pr;': '\u2abb',
    'pr;': '\u227a',
    'prap;': '\u2ab7',
    'prcue;': '\u227c',
    'prE;': '\u2ab3',
    'pre;': '\u2aaf',
    'prec;': '\u227a',
    'precapprox;': '\u2ab7',
    'preccurlyeq;': '\u227c',
    'Precedes;': '\u227a',
    'PrecedesEqual;': '\u2aaf',
    'PrecedesSlantEqual;': '\u227c',
    'PrecedesTilde;': '\u227e',
    'preceq;': '\u2aaf',
    'precnapprox;': '\u2ab9',
    'precneqq;': '\u2ab5',
    'precnsim;': '\u22e8',
    'precsim;': '\u227e',
    'Prime;': '\u2033',
    'prime;': '\u2032',
    'primes;': '\u2119',
    'prnap;': '\u2ab9',
    'prnE;': '\u2ab5',
    'prnsim;': '\u22e8',
    'prod;': '\u220f',
    'Product;': '\u220f',
    'profalar;': '\u232e',
    'profline;': '\u2312',
    'profsurf;': '\u2313',
    'prop;': '\u221d',
    'Proportion;': '\u2237',
    'Proportional;': '\u221d',
    'propto;': '\u221d',
    'prsim;': '\u227e',
    'prurel;': '\u22b0',
    'Pscr;': '\U0001d4ab',
    'pscr;': '\U0001d4c5',
    'Psi;': '\u03a8',
    'psi;': '\u03c8',
    'puncsp;': '\u2008',
    'Qfr;': '\U0001d514',
    'qfr;': '\U0001d52e',
    'qint;': '\u2a0c',
    'Qopf;': '\u211a',
    'qopf;': '\U0001d562',
    'qprime;': '\u2057',
    'Qscr;': '\U0001d4ac',
    'qscr;': '\U0001d4c6',
    'quaternions;': '\u210d',
    'quatint;': '\u2a16',
    'quest;': '?',
    'questeq;': '\u225f',
    'QUOT': '"',
    'quot': '"',
    'QUOT;': '"',
    'quot;': '"',
    'rAarr;': '\u21db',
    'race;': '\u223d\u0331',
    'Racute;': '\u0154',
    'racute;': '\u0155',
    'radic;': '\u221a',
    'raemptyv;': '\u29b3',
    'Rang;': '\u27eb',
    'rang;': '\u27e9',
    'rangd;': '\u2992',
    'range;': '\u29a5',
    'rangle;': '\u27e9',
    'raquo': '\xbb',
    'raquo;': '\xbb',
    'Rarr;': '\u21a0',
    'rArr;': '\u21d2',
    'rarr;': '\u2192',
    'rarrap;': '\u2975',
    'rarrb;': '\u21e5',
    'rarrbfs;': '\u2920',
    'rarrc;': '\u2933',
    'rarrfs;': '\u291e',
    'rarrhk;': '\u21aa',
    'rarrlp;': '\u21ac',
    'rarrpl;': '\u2945',
    'rarrsim;': '\u2974',
    'Rarrtl;': '\u2916',
    'rarrtl;': '\u21a3',
    'rarrw;': '\u219d',
    'rAtail;': '\u291c',
    'ratail;': '\u291a',
    'ratio;': '\u2236',
    'rationals;': '\u211a',
    'RBarr;': '\u2910',
    'rBarr;': '\u290f',
    'rbarr;': '\u290d',
    'rbbrk;': '\u2773',
    'rbrace;': '}',
    'rbrack;': ']',
    'rbrke;': '\u298c',
    'rbrksld;': '\u298e',
    'rbrkslu;': '\u2990',
    'Rcaron;': '\u0158',
    'rcaron;': '\u0159',
    'Rcedil;': '\u0156',
    'rcedil;': '\u0157',
    'rceil;': '\u2309',
    'rcub;': '}',
    'Rcy;': '\u0420',
    'rcy;': '\u0440',
    'rdca;': '\u2937',
    'rdldhar;': '\u2969',
    'rdquo;': '\u201d',
    'rdquor;': '\u201d',
    'rdsh;': '\u21b3',
    'Re;': '\u211c',
    'real;': '\u211c',
    'realine;': '\u211b',
    'realpart;': '\u211c',
    'reals;': '\u211d',
    'rect;': '\u25ad',
    'REG': '\xae',
    'reg': '\xae',
    'REG;': '\xae',
    'reg;': '\xae',
    'ReverseElement;': '\u220b',
    'ReverseEquilibrium;': '\u21cb',
    'ReverseUpEquilibrium;': '\u296f',
    'rfisht;': '\u297d',
    'rfloor;': '\u230b',
    'Rfr;': '\u211c',
    'rfr;': '\U0001d52f',
    'rHar;': '\u2964',
    'rhard;': '\u21c1',
    'rharu;': '\u21c0',
    'rharul;': '\u296c',
    'Rho;': '\u03a1',
    'rho;': '\u03c1',
    'rhov;': '\u03f1',
    'RightAngleBracket;': '\u27e9',
    'RightArrow;': '\u2192',
    'Rightarrow;': '\u21d2',
    'rightarrow;': '\u2192',
    'RightArrowBar;': '\u21e5',
    'RightArrowLeftArrow;': '\u21c4',
    'rightarrowtail;': '\u21a3',
    'RightCeiling;': '\u2309',
    'RightDoubleBracket;': '\u27e7',
    'RightDownTeeVector;': '\u295d',
    'RightDownVector;': '\u21c2',
    'RightDownVectorBar;': '\u2955',
    'RightFloor;': '\u230b',
    'rightharpoondown;': '\u21c1',
    'rightharpoonup;': '\u21c0',
    'rightleftarrows;': '\u21c4',
    'rightleftharpoons;': '\u21cc',
    'rightrightarrows;': '\u21c9',
    'rightsquigarrow;': '\u219d',
    'RightTee;': '\u22a2',
    'RightTeeArrow;': '\u21a6',
    'RightTeeVector;': '\u295b',
    'rightthreetimes;': '\u22cc',
    'RightTriangle;': '\u22b3',
    'RightTriangleBar;': '\u29d0',
    'RightTriangleEqual;': '\u22b5',
    'RightUpDownVector;': '\u294f',
    'RightUpTeeVector;': '\u295c',
    'RightUpVector;': '\u21be',
    'RightUpVectorBar;': '\u2954',
    'RightVector;': '\u21c0',
    'RightVectorBar;': '\u2953',
    'ring;': '\u02da',
    'risingdotseq;': '\u2253',
    'rlarr;': '\u21c4',
    'rlhar;': '\u21cc',
    'rlm;': '\u200f',
    'rmoust;': '\u23b1',
    'rmoustache;': '\u23b1',
    'rnmid;': '\u2aee',
    'roang;': '\u27ed',
    'roarr;': '\u21fe',
    'robrk;': '\u27e7',
    'ropar;': '\u2986',
    'Ropf;': '\u211d',
    'ropf;': '\U0001d563',
    'roplus;': '\u2a2e',
    'rotimes;': '\u2a35',
    'RoundImplies;': '\u2970',
    'rpar;': ')',
    'rpargt;': '\u2994',
    'rppolint;': '\u2a12',
    'rrarr;': '\u21c9',
    'Rrightarrow;': '\u21db',
    'rsaquo;': '\u203a',
    'Rscr;': '\u211b',
    'rscr;': '\U0001d4c7',
    'Rsh;': '\u21b1',
    'rsh;': '\u21b1',
    'rsqb;': ']',
    'rsquo;': '\u2019',
    'rsquor;': '\u2019',
    'rthree;': '\u22cc',
    'rtimes;': '\u22ca',
    'rtri;': '\u25b9',
    'rtrie;': '\u22b5',
    'rtrif;': '\u25b8',
    'rtriltri;': '\u29ce',
    'RuleDelayed;': '\u29f4',
    'ruluhar;': '\u2968',
    'rx;': '\u211e',
    'Sacute;': '\u015a',
    'sacute;': '\u015b',
    'sbquo;': '\u201a',
    'Sc;': '\u2abc',
    'sc;': '\u227b',
    'scap;': '\u2ab8',
    'Scaron;': '\u0160',
    'scaron;': '\u0161',
    'sccue;': '\u227d',
    'scE;': '\u2ab4',
    'sce;': '\u2ab0',
    'Scedil;': '\u015e',
    'scedil;': '\u015f',
    'Scirc;': '\u015c',
    'scirc;': '\u015d',
    'scnap;': '\u2aba',
    'scnE;': '\u2ab6',
    'scnsim;': '\u22e9',
    'scpolint;': '\u2a13',
    'scsim;': '\u227f',
    'Scy;': '\u0421',
    'scy;': '\u0441',
    'sdot;': '\u22c5',
    'sdotb;': '\u22a1',
    'sdote;': '\u2a66',
    'searhk;': '\u2925',
    'seArr;': '\u21d8',
    'searr;': '\u2198',
    'searrow;': '\u2198',
    'sect': '\xa7',
    'sect;': '\xa7',
    'semi;': ';',
    'seswar;': '\u2929',
    'setminus;': '\u2216',
    'setmn;': '\u2216',
    'sext;': '\u2736',
    'Sfr;': '\U0001d516',
    'sfr;': '\U0001d530',
    'sfrown;': '\u2322',
    'sharp;': '\u266f',
    'SHCHcy;': '\u0429',
    'shchcy;': '\u0449',
    'SHcy;': '\u0428',
    'shcy;': '\u0448',
    'ShortDownArrow;': '\u2193',
    'ShortLeftArrow;': '\u2190',
    'shortmid;': '\u2223',
    'shortparallel;': '\u2225',
    'ShortRightArrow;': '\u2192',
    'ShortUpArrow;': '\u2191',
    'shy': '\xad',
    'shy;': '\xad',
    'Sigma;': '\u03a3',
    'sigma;': '\u03c3',
    'sigmaf;': '\u03c2',
    'sigmav;': '\u03c2',
    'sim;': '\u223c',
    'simdot;': '\u2a6a',
    'sime;': '\u2243',
    'simeq;': '\u2243',
    'simg;': '\u2a9e',
    'simgE;': '\u2aa0',
    'siml;': '\u2a9d',
    'simlE;': '\u2a9f',
    'simne;': '\u2246',
    'simplus;': '\u2a24',
    'simrarr;': '\u2972',
    'slarr;': '\u2190',
    'SmallCircle;': '\u2218',
    'smallsetminus;': '\u2216',
    'smashp;': '\u2a33',
    'smeparsl;': '\u29e4',
    'smid;': '\u2223',
    'smile;': '\u2323',
    'smt;': '\u2aaa',
    'smte;': '\u2aac',
    'smtes;': '\u2aac\ufe00',
    'SOFTcy;': '\u042c',
    'softcy;': '\u044c',
    'sol;': '/',
    'solb;': '\u29c4',
    'solbar;': '\u233f',
    'Sopf;': '\U0001d54a',
    'sopf;': '\U0001d564',
    'spades;': '\u2660',
    'spadesuit;': '\u2660',
    'spar;': '\u2225',
    'sqcap;': '\u2293',
    'sqcaps;': '\u2293\ufe00',
    'sqcup;': '\u2294',
    'sqcups;': '\u2294\ufe00',
    'Sqrt;': '\u221a',
    'sqsub;': '\u228f',
    'sqsube;': '\u2291',
    'sqsubset;': '\u228f',
    'sqsubseteq;': '\u2291',
    'sqsup;': '\u2290',
    'sqsupe;': '\u2292',
    'sqsupset;': '\u2290',
    'sqsupseteq;': '\u2292',
    'squ;': '\u25a1',
    'Square;': '\u25a1',
    'square;': '\u25a1',
    'SquareIntersection;': '\u2293',
    'SquareSubset;': '\u228f',
    'SquareSubsetEqual;': '\u2291',
    'SquareSuperset;': '\u2290',
    'SquareSupersetEqual;': '\u2292',
    'SquareUnion;': '\u2294',
    'squarf;': '\u25aa',
    'squf;': '\u25aa',
    'srarr;': '\u2192',
    'Sscr;': '\U0001d4ae',
    'sscr;': '\U0001d4c8',
    'ssetmn;': '\u2216',
    'ssmile;': '\u2323',
    'sstarf;': '\u22c6',
    'Star;': '\u22c6',
    'star;': '\u2606',
    'starf;': '\u2605',
    'straightepsilon;': '\u03f5',
    'straightphi;': '\u03d5',
    'strns;': '\xaf',
    'Sub;': '\u22d0',
    'sub;': '\u2282',
    'subdot;': '\u2abd',
    'subE;': '\u2ac5',
    'sube;': '\u2286',
    'subedot;': '\u2ac3',
    'submult;': '\u2ac1',
    'subnE;': '\u2acb',
    'subne;': '\u228a',
    'subplus;': '\u2abf',
    'subrarr;': '\u2979',
    'Subset;': '\u22d0',
    'subset;': '\u2282',
    'subseteq;': '\u2286',
    'subseteqq;': '\u2ac5',
    'SubsetEqual;': '\u2286',
    'subsetneq;': '\u228a',
    'subsetneqq;': '\u2acb',
    'subsim;': '\u2ac7',
    'subsub;': '\u2ad5',
    'subsup;': '\u2ad3',
    'succ;': '\u227b',
    'succapprox;': '\u2ab8',
    'succcurlyeq;': '\u227d',
    'Succeeds;': '\u227b',
    'SucceedsEqual;': '\u2ab0',
    'SucceedsSlantEqual;': '\u227d',
    'SucceedsTilde;': '\u227f',
    'succeq;': '\u2ab0',
    'succnapprox;': '\u2aba',
    'succneqq;': '\u2ab6',
    'succnsim;': '\u22e9',
    'succsim;': '\u227f',
    'SuchThat;': '\u220b',
    'Sum;': '\u2211',
    'sum;': '\u2211',
    'sung;': '\u266a',
    'sup1': '\xb9',
    'sup1;': '\xb9',
    'sup2': '\xb2',
    'sup2;': '\xb2',
    'sup3': '\xb3',
    'sup3;': '\xb3',
    'Sup;': '\u22d1',
    'sup;': '\u2283',
    'supdot;': '\u2abe',
    'supdsub;': '\u2ad8',
    'supE;': '\u2ac6',
    'supe;': '\u2287',
    'supedot;': '\u2ac4',
    'Superset;': '\u2283',
    'SupersetEqual;': '\u2287',
    'suphsol;': '\u27c9',
    'suphsub;': '\u2ad7',
    'suplarr;': '\u297b',
    'supmult;': '\u2ac2',
    'supnE;': '\u2acc',
    'supne;': '\u228b',
    'supplus;': '\u2ac0',
    'Supset;': '\u22d1',
    'supset;': '\u2283',
    'supseteq;': '\u2287',
    'supseteqq;': '\u2ac6',
    'supsetneq;': '\u228b',
    'supsetneqq;': '\u2acc',
    'supsim;': '\u2ac8',
    'supsub;': '\u2ad4',
    'supsup;': '\u2ad6',
    'swarhk;': '\u2926',
    'swArr;': '\u21d9',
    'swarr;': '\u2199',
    'swarrow;': '\u2199',
    'swnwar;': '\u292a',
    'szlig': '\xdf',
    'szlig;': '\xdf',
    'Tab;': '\t',
    'target;': '\u2316',
    'Tau;': '\u03a4',
    'tau;': '\u03c4',
    'tbrk;': '\u23b4',
    'Tcaron;': '\u0164',
    'tcaron;': '\u0165',
    'Tcedil;': '\u0162',
    'tcedil;': '\u0163',
    'Tcy;': '\u0422',
    'tcy;': '\u0442',
    'tdot;': '\u20db',
    'telrec;': '\u2315',
    'Tfr;': '\U0001d517',
    'tfr;': '\U0001d531',
    'there4;': '\u2234',
    'Therefore;': '\u2234',
    'therefore;': '\u2234',
    'Theta;': '\u0398',
    'theta;': '\u03b8',
    'thetasym;': '\u03d1',
    'thetav;': '\u03d1',
    'thickapprox;': '\u2248',
    'thicksim;': '\u223c',
    'ThickSpace;': '\u205f\u200a',
    'thinsp;': '\u2009',
    'ThinSpace;': '\u2009',
    'thkap;': '\u2248',
    'thksim;': '\u223c',
    'THORN': '\xde',
    'thorn': '\xfe',
    'THORN;': '\xde',
    'thorn;': '\xfe',
    'Tilde;': '\u223c',
    'tilde;': '\u02dc',
    'TildeEqual;': '\u2243',
    'TildeFullEqual;': '\u2245',
    'TildeTilde;': '\u2248',
    'times': '\xd7',
    'times;': '\xd7',
    'timesb;': '\u22a0',
    'timesbar;': '\u2a31',
    'timesd;': '\u2a30',
    'tint;': '\u222d',
    'toea;': '\u2928',
    'top;': '\u22a4',
    'topbot;': '\u2336',
    'topcir;': '\u2af1',
    'Topf;': '\U0001d54b',
    'topf;': '\U0001d565',
    'topfork;': '\u2ada',
    'tosa;': '\u2929',
    'tprime;': '\u2034',
    'TRADE;': '\u2122',
    'trade;': '\u2122',
    'triangle;': '\u25b5',
    'triangledown;': '\u25bf',
    'triangleleft;': '\u25c3',
    'trianglelefteq;': '\u22b4',
    'triangleq;': '\u225c',
    'triangleright;': '\u25b9',
    'trianglerighteq;': '\u22b5',
    'tridot;': '\u25ec',
    'trie;': '\u225c',
    'triminus;': '\u2a3a',
    'TripleDot;': '\u20db',
    'triplus;': '\u2a39',
    'trisb;': '\u29cd',
    'tritime;': '\u2a3b',
    'trpezium;': '\u23e2',
    'Tscr;': '\U0001d4af',
    'tscr;': '\U0001d4c9',
    'TScy;': '\u0426',
    'tscy;': '\u0446',
    'TSHcy;': '\u040b',
    'tshcy;': '\u045b',
    'Tstrok;': '\u0166',
    'tstrok;': '\u0167',
    'twixt;': '\u226c',
    'twoheadleftarrow;': '\u219e',
    'twoheadrightarrow;': '\u21a0',
    'Uacute': '\xda',
    'uacute': '\xfa',
    'Uacute;': '\xda',
    'uacute;': '\xfa',
    'Uarr;': '\u219f',
    'uArr;': '\u21d1',
    'uarr;': '\u2191',
    'Uarrocir;': '\u2949',
    'Ubrcy;': '\u040e',
    'ubrcy;': '\u045e',
    'Ubreve;': '\u016c',
    'ubreve;': '\u016d',
    'Ucirc': '\xdb',
    'ucirc': '\xfb',
    'Ucirc;': '\xdb',
    'ucirc;': '\xfb',
    'Ucy;': '\u0423',
    'ucy;': '\u0443',
    'udarr;': '\u21c5',
    'Udblac;': '\u0170',
    'udblac;': '\u0171',
    'udhar;': '\u296e',
    'ufisht;': '\u297e',
    'Ufr;': '\U0001d518',
    'ufr;': '\U0001d532',
    'Ugrave': '\xd9',
    'ugrave': '\xf9',
    'Ugrave;': '\xd9',
    'ugrave;': '\xf9',
    'uHar;': '\u2963',
    'uharl;': '\u21bf',
    'uharr;': '\u21be',
    'uhblk;': '\u2580',
    'ulcorn;': '\u231c',
    'ulcorner;': '\u231c',
    'ulcrop;': '\u230f',
    'ultri;': '\u25f8',
    'Umacr;': '\u016a',
    'umacr;': '\u016b',
    'uml': '\xa8',
    'uml;': '\xa8',
    'UnderBar;': '_',
    'UnderBrace;': '\u23df',
    'UnderBracket;': '\u23b5',
    'UnderParenthesis;': '\u23dd',
    'Union;': '\u22c3',
    'UnionPlus;': '\u228e',
    'Uogon;': '\u0172',
    'uogon;': '\u0173',
    'Uopf;': '\U0001d54c',
    'uopf;': '\U0001d566',
    'UpArrow;': '\u2191',
    'Uparrow;': '\u21d1',
    'uparrow;': '\u2191',
    'UpArrowBar;': '\u2912',
    'UpArrowDownArrow;': '\u21c5',
    'UpDownArrow;': '\u2195',
    'Updownarrow;': '\u21d5',
    'updownarrow;': '\u2195',
    'UpEquilibrium;': '\u296e',
    'upharpoonleft;': '\u21bf',
    'upharpoonright;': '\u21be',
    'uplus;': '\u228e',
    'UpperLeftArrow;': '\u2196',
    'UpperRightArrow;': '\u2197',
    'Upsi;': '\u03d2',
    'upsi;': '\u03c5',
    'upsih;': '\u03d2',
    'Upsilon;': '\u03a5',
    'upsilon;': '\u03c5',
    'UpTee;': '\u22a5',
    'UpTeeArrow;': '\u21a5',
    'upuparrows;': '\u21c8',
    'urcorn;': '\u231d',
    'urcorner;': '\u231d',
    'urcrop;': '\u230e',
    'Uring;': '\u016e',
    'uring;': '\u016f',
    'urtri;': '\u25f9',
    'Uscr;': '\U0001d4b0',
    'uscr;': '\U0001d4ca',
    'utdot;': '\u22f0',
    'Utilde;': '\u0168',
    'utilde;': '\u0169',
    'utri;': '\u25b5',
    'utrif;': '\u25b4',
    'uuarr;': '\u21c8',
    'Uuml': '\xdc',
    'uuml': '\xfc',
    'Uuml;': '\xdc',
    'uuml;': '\xfc',
    'uwangle;': '\u29a7',
    'vangrt;': '\u299c',
    'varepsilon;': '\u03f5',
    'varkappa;': '\u03f0',
    'varnothing;': '\u2205',
    'varphi;': '\u03d5',
    'varpi;': '\u03d6',
    'varpropto;': '\u221d',
    'vArr;': '\u21d5',
    'varr;': '\u2195',
    'varrho;': '\u03f1',
    'varsigma;': '\u03c2',
    'varsubsetneq;': '\u228a\ufe00',
    'varsubsetneqq;': '\u2acb\ufe00',
    'varsupsetneq;': '\u228b\ufe00',
    'varsupsetneqq;': '\u2acc\ufe00',
    'vartheta;': '\u03d1',
    'vartriangleleft;': '\u22b2',
    'vartriangleright;': '\u22b3',
    'Vbar;': '\u2aeb',
    'vBar;': '\u2ae8',
    'vBarv;': '\u2ae9',
    'Vcy;': '\u0412',
    'vcy;': '\u0432',
    'VDash;': '\u22ab',
    'Vdash;': '\u22a9',
    'vDash;': '\u22a8',
    'vdash;': '\u22a2',
    'Vdashl;': '\u2ae6',
    'Vee;': '\u22c1',
    'vee;': '\u2228',
    'veebar;': '\u22bb',
    'veeeq;': '\u225a',
    'vellip;': '\u22ee',
    'Verbar;': '\u2016',
    'verbar;': '|',
    'Vert;': '\u2016',
    'vert;': '|',
    'VerticalBar;': '\u2223',
    'VerticalLine;': '|',
    'VerticalSeparator;': '\u2758',
    'VerticalTilde;': '\u2240',
    'VeryThinSpace;': '\u200a',
    'Vfr;': '\U0001d519',
    'vfr;': '\U0001d533',
    'vltri;': '\u22b2',
    'vnsub;': '\u2282\u20d2',
    'vnsup;': '\u2283\u20d2',
    'Vopf;': '\U0001d54d',
    'vopf;': '\U0001d567',
    'vprop;': '\u221d',
    'vrtri;': '\u22b3',
    'Vscr;': '\U0001d4b1',
    'vscr;': '\U0001d4cb',
    'vsubnE;': '\u2acb\ufe00',
    'vsubne;': '\u228a\ufe00',
    'vsupnE;': '\u2acc\ufe00',
    'vsupne;': '\u228b\ufe00',
    'Vvdash;': '\u22aa',
    'vzigzag;': '\u299a',
    'Wcirc;': '\u0174',
    'wcirc;': '\u0175',
    'wedbar;': '\u2a5f',
    'Wedge;': '\u22c0',
    'wedge;': '\u2227',
    'wedgeq;': '\u2259',
    'weierp;': '\u2118',
    'Wfr;': '\U0001d51a',
    'wfr;': '\U0001d534',
    'Wopf;': '\U0001d54e',
    'wopf;': '\U0001d568',
    'wp;': '\u2118',
    'wr;': '\u2240',
    'wreath;': '\u2240',
    'Wscr;': '\U0001d4b2',
    'wscr;': '\U0001d4cc',
    'xcap;': '\u22c2',
    'xcirc;': '\u25ef',
    'xcup;': '\u22c3',
    'xdtri;': '\u25bd',
    'Xfr;': '\U0001d51b',
    'xfr;': '\U0001d535',
    'xhArr;': '\u27fa',
    'xharr;': '\u27f7',
    'Xi;': '\u039e',
    'xi;': '\u03be',
    'xlArr;': '\u27f8',
    'xlarr;': '\u27f5',
    'xmap;': '\u27fc',
    'xnis;': '\u22fb',
    'xodot;': '\u2a00',
    'Xopf;': '\U0001d54f',
    'xopf;': '\U0001d569',
    'xoplus;': '\u2a01',
    'xotime;': '\u2a02',
    'xrArr;': '\u27f9',
    'xrarr;': '\u27f6',
    'Xscr;': '\U0001d4b3',
    'xscr;': '\U0001d4cd',
    'xsqcup;': '\u2a06',
    'xuplus;': '\u2a04',
    'xutri;': '\u25b3',
    'xvee;': '\u22c1',
    'xwedge;': '\u22c0',
    'Yacute': '\xdd',
    'yacute': '\xfd',
    'Yacute;': '\xdd',
    'yacute;': '\xfd',
    'YAcy;': '\u042f',
    'yacy;': '\u044f',
    'Ycirc;': '\u0176',
    'ycirc;': '\u0177',
    'Ycy;': '\u042b',
    'ycy;': '\u044b',
    'yen': '\xa5',
    'yen;': '\xa5',
    'Yfr;': '\U0001d51c',
    'yfr;': '\U0001d536',
    'YIcy;': '\u0407',
    'yicy;': '\u0457',
    'Yopf;': '\U0001d550',
    'yopf;': '\U0001d56a',
    'Yscr;': '\U0001d4b4',
    'yscr;': '\U0001d4ce',
    'YUcy;': '\u042e',
    'yucy;': '\u044e',
    'yuml': '\xff',
    'Yuml;': '\u0178',
    'yuml;': '\xff',
    'Zacute;': '\u0179',
    'zacute;': '\u017a',
    'Zcaron;': '\u017d',
    'zcaron;': '\u017e',
    'Zcy;': '\u0417',
    'zcy;': '\u0437',
    'Zdot;': '\u017b',
    'zdot;': '\u017c',
    'zeetrf;': '\u2128',
    'ZeroWidthSpace;': '\u200b',
    'Zeta;': '\u0396',
    'zeta;': '\u03b6',
    'Zfr;': '\u2128',
    'zfr;': '\U0001d537',
    'ZHcy;': '\u0416',
    'zhcy;': '\u0436',
    'zigrarr;': '\u21dd',
    'Zopf;': '\u2124',
    'zopf;': '\U0001d56b',
    'Zscr;': '\U0001d4b5',
    'zscr;': '\U0001d4cf',
    'zwj;': '\u200d',
    'zwnj;': '\u200c',
}

# maps the Unicode code point to the HTML entity name
codepoint2name = {}

# maps the HTML entity name to the character
# (or a character reference if the character is outside the Latin-1 range)
entitydefs = {}

for (name, codepoint) in name2codepoint.items():
    codepoint2name[codepoint] = name
    entitydefs[name] = chr(codepoint)

del name, codepoint
html/parser.py000064400000042471151153537530007376 0ustar00"""A parser for HTML and XHTML."""

# This file is based on sgmllib.py, but the API is slightly different.

# XXX There should be a way to distinguish between PCDATA (parsed
# character data -- the normal case), RCDATA (replaceable character
# data -- only char and entity references and end tags are special)
# and CDATA (character data -- only end tags are special).


import re
import warnings
import _markupbase

from html import unescape


__all__ = ['HTMLParser']

# Regular expressions used for parsing

interesting_normal = re.compile('[&<]')
incomplete = re.compile('&[a-zA-Z#]')

entityref = re.compile('&([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]')
charref = re.compile('&#(?:[0-9]+|[xX][0-9a-fA-F]+)[^0-9a-fA-F]')

starttagopen = re.compile('<[a-zA-Z]')
piclose = re.compile('>')
commentclose = re.compile(r'--\s*>')
# Note:
#  1) if you change tagfind/attrfind remember to update locatestarttagend too;
#  2) if you change tagfind/attrfind and/or locatestarttagend the parser will
#     explode, so don't do it.
# see http://www.w3.org/TR/html5/tokenization.html#tag-open-state
# and http://www.w3.org/TR/html5/tokenization.html#tag-name-state
tagfind_tolerant = re.compile(r'([a-zA-Z][^\t\n\r\f />\x00]*)(?:\s|/(?!>))*')
attrfind_tolerant = re.compile(
    r'((?<=[\'"\s/])[^\s/>][^\s/=>]*)(\s*=+\s*'
    r'(\'[^\']*\'|"[^"]*"|(?![\'"])[^>\s]*))?(?:\s|/(?!>))*')
locatestarttagend_tolerant = re.compile(r"""
  <[a-zA-Z][^\t\n\r\f />\x00]*       # tag name
  (?:[\s/]*                          # optional whitespace before attribute name
    (?:(?<=['"\s/])[^\s/>][^\s/=>]*  # attribute name
      (?:\s*=+\s*                    # value indicator
        (?:'[^']*'                   # LITA-enclosed value
          |"[^"]*"                   # LIT-enclosed value
          |(?!['"])[^>\s]*           # bare value
         )
        \s*                          # possibly followed by a space
       )?(?:\s|/(?!>))*
     )*
   )?
  \s*                                # trailing whitespace
""", re.VERBOSE)
endendtag = re.compile('>')
# the HTML 5 spec, section 8.1.2.2, doesn't allow spaces between
# </ and the tag name, so maybe this should be fixed
endtagfind = re.compile(r'</\s*([a-zA-Z][-.a-zA-Z0-9:_]*)\s*>')



class HTMLParser(_markupbase.ParserBase):
    """Find tags and other markup and call handler functions.

    Usage:
        p = HTMLParser()
        p.feed(data)
        ...
        p.close()

    Start tags are handled by calling self.handle_starttag() or
    self.handle_startendtag(); end tags by self.handle_endtag().  The
    data between tags is passed from the parser to the derived class
    by calling self.handle_data() with the data as argument (the data
    may be split up in arbitrary chunks).  If convert_charrefs is
    True the character references are converted automatically to the
    corresponding Unicode character (and self.handle_data() is no
    longer split in chunks), otherwise they are passed by calling
    self.handle_entityref() or self.handle_charref() with the string
    containing respectively the named or numeric reference as the
    argument.
    """

    CDATA_CONTENT_ELEMENTS = ("script", "style")

    def __init__(self, *, convert_charrefs=True):
        """Initialize and reset this instance.

        If convert_charrefs is True (the default), all character references
        are automatically converted to the corresponding Unicode characters.
        """
        self.convert_charrefs = convert_charrefs
        self.reset()

    def reset(self):
        """Reset this instance.  Loses all unprocessed data."""
        self.rawdata = ''
        self.lasttag = '???'
        self.interesting = interesting_normal
        self.cdata_elem = None
        _markupbase.ParserBase.reset(self)

    def feed(self, data):
        r"""Feed data to the parser.

        Call this as often as you want, with as little or as much text
        as you want (may include '\n').
        """
        self.rawdata = self.rawdata + data
        self.goahead(0)

    def close(self):
        """Handle any buffered data."""
        self.goahead(1)

    __starttag_text = None

    def get_starttag_text(self):
        """Return full source of start tag: '<...>'."""
        return self.__starttag_text

    def set_cdata_mode(self, elem):
        self.cdata_elem = elem.lower()
        self.interesting = re.compile(r'</\s*%s\s*>' % self.cdata_elem, re.I)

    def clear_cdata_mode(self):
        self.interesting = interesting_normal
        self.cdata_elem = None

    # Internal -- handle data as far as reasonable.  May leave state
    # and data to be processed by a subsequent call.  If 'end' is
    # true, force handling all data as if followed by EOF marker.
    def goahead(self, end):
        rawdata = self.rawdata
        i = 0
        n = len(rawdata)
        while i < n:
            if self.convert_charrefs and not self.cdata_elem:
                j = rawdata.find('<', i)
                if j < 0:
                    # if we can't find the next <, either we are at the end
                    # or there's more text incoming.  If the latter is True,
                    # we can't pass the text to handle_data in case we have
                    # a charref cut in half at end.  Try to determine if
                    # this is the case before proceeding by looking for an
                    # & near the end and see if it's followed by a space or ;.
                    amppos = rawdata.rfind('&', max(i, n-34))
                    if (amppos >= 0 and
                        not re.compile(r'[\s;]').search(rawdata, amppos)):
                        break  # wait till we get all the text
                    j = n
            else:
                match = self.interesting.search(rawdata, i)  # < or &
                if match:
                    j = match.start()
                else:
                    if self.cdata_elem:
                        break
                    j = n
            if i < j:
                if self.convert_charrefs and not self.cdata_elem:
                    self.handle_data(unescape(rawdata[i:j]))
                else:
                    self.handle_data(rawdata[i:j])
            i = self.updatepos(i, j)
            if i == n: break
            startswith = rawdata.startswith
            if startswith('<', i):
                if starttagopen.match(rawdata, i): # < + letter
                    k = self.parse_starttag(i)
                elif startswith("</", i):
                    k = self.parse_endtag(i)
                elif startswith("<!--", i):
                    k = self.parse_comment(i)
                elif startswith("<?", i):
                    k = self.parse_pi(i)
                elif startswith("<!", i):
                    k = self.parse_html_declaration(i)
                elif (i + 1) < n:
                    self.handle_data("<")
                    k = i + 1
                else:
                    break
                if k < 0:
                    if not end:
                        break
                    k = rawdata.find('>', i + 1)
                    if k < 0:
                        k = rawdata.find('<', i + 1)
                        if k < 0:
                            k = i + 1
                    else:
                        k += 1
                    if self.convert_charrefs and not self.cdata_elem:
                        self.handle_data(unescape(rawdata[i:k]))
                    else:
                        self.handle_data(rawdata[i:k])
                i = self.updatepos(i, k)
            elif startswith("&#", i):
                match = charref.match(rawdata, i)
                if match:
                    name = match.group()[2:-1]
                    self.handle_charref(name)
                    k = match.end()
                    if not startswith(';', k-1):
                        k = k - 1
                    i = self.updatepos(i, k)
                    continue
                else:
                    if ";" in rawdata[i:]:  # bail by consuming &#
                        self.handle_data(rawdata[i:i+2])
                        i = self.updatepos(i, i+2)
                    break
            elif startswith('&', i):
                match = entityref.match(rawdata, i)
                if match:
                    name = match.group(1)
                    self.handle_entityref(name)
                    k = match.end()
                    if not startswith(';', k-1):
                        k = k - 1
                    i = self.updatepos(i, k)
                    continue
                match = incomplete.match(rawdata, i)
                if match:
                    # match.group() will contain at least 2 chars
                    if end and match.group() == rawdata[i:]:
                        k = match.end()
                        if k <= i:
                            k = n
                        i = self.updatepos(i, i + 1)
                    # incomplete
                    break
                elif (i + 1) < n:
                    # not the end of the buffer, and can't be confused
                    # with some other construct
                    self.handle_data("&")
                    i = self.updatepos(i, i + 1)
                else:
                    break
            else:
                assert 0, "interesting.search() lied"
        # end while
        if end and i < n and not self.cdata_elem:
            if self.convert_charrefs and not self.cdata_elem:
                self.handle_data(unescape(rawdata[i:n]))
            else:
                self.handle_data(rawdata[i:n])
            i = self.updatepos(i, n)
        self.rawdata = rawdata[i:]

    # Internal -- parse html declarations, return length or -1 if not terminated
    # See w3.org/TR/html5/tokenization.html#markup-declaration-open-state
    # See also parse_declaration in _markupbase
    def parse_html_declaration(self, i):
        rawdata = self.rawdata
        assert rawdata[i:i+2] == '<!', ('unexpected call to '
                                        'parse_html_declaration()')
        if rawdata[i:i+4] == '<!--':
            # this case is actually already handled in goahead()
            return self.parse_comment(i)
        elif rawdata[i:i+3] == '<![':
            return self.parse_marked_section(i)
        elif rawdata[i:i+9].lower() == '<!doctype':
            # find the closing >
            gtpos = rawdata.find('>', i+9)
            if gtpos == -1:
                return -1
            self.handle_decl(rawdata[i+2:gtpos])
            return gtpos+1
        else:
            return self.parse_bogus_comment(i)

    # Internal -- parse bogus comment, return length or -1 if not terminated
    # see http://www.w3.org/TR/html5/tokenization.html#bogus-comment-state
    def parse_bogus_comment(self, i, report=1):
        rawdata = self.rawdata
        assert rawdata[i:i+2] in ('<!', '</'), ('unexpected call to '
                                                'parse_comment()')
        pos = rawdata.find('>', i+2)
        if pos == -1:
            return -1
        if report:
            self.handle_comment(rawdata[i+2:pos])
        return pos + 1

    # Internal -- parse processing instr, return end or -1 if not terminated
    def parse_pi(self, i):
        rawdata = self.rawdata
        assert rawdata[i:i+2] == '<?', 'unexpected call to parse_pi()'
        match = piclose.search(rawdata, i+2) # >
        if not match:
            return -1
        j = match.start()
        self.handle_pi(rawdata[i+2: j])
        j = match.end()
        return j

    # Internal -- handle starttag, return end or -1 if not terminated
    def parse_starttag(self, i):
        self.__starttag_text = None
        endpos = self.check_for_whole_start_tag(i)
        if endpos < 0:
            return endpos
        rawdata = self.rawdata
        self.__starttag_text = rawdata[i:endpos]

        # Now parse the data between i+1 and j into a tag and attrs
        attrs = []
        match = tagfind_tolerant.match(rawdata, i+1)
        assert match, 'unexpected call to parse_starttag()'
        k = match.end()
        self.lasttag = tag = match.group(1).lower()
        while k < endpos:
            m = attrfind_tolerant.match(rawdata, k)
            if not m:
                break
            attrname, rest, attrvalue = m.group(1, 2, 3)
            if not rest:
                attrvalue = None
            elif attrvalue[:1] == '\'' == attrvalue[-1:] or \
                 attrvalue[:1] == '"' == attrvalue[-1:]:
                attrvalue = attrvalue[1:-1]
            if attrvalue:
                attrvalue = unescape(attrvalue)
            attrs.append((attrname.lower(), attrvalue))
            k = m.end()

        end = rawdata[k:endpos].strip()
        if end not in (">", "/>"):
            lineno, offset = self.getpos()
            if "\n" in self.__starttag_text:
                lineno = lineno + self.__starttag_text.count("\n")
                offset = len(self.__starttag_text) \
                         - self.__starttag_text.rfind("\n")
            else:
                offset = offset + len(self.__starttag_text)
            self.handle_data(rawdata[i:endpos])
            return endpos
        if end.endswith('/>'):
            # XHTML-style empty tag: <span attr="value" />
            self.handle_startendtag(tag, attrs)
        else:
            self.handle_starttag(tag, attrs)
            if tag in self.CDATA_CONTENT_ELEMENTS:
                self.set_cdata_mode(tag)
        return endpos

    # Internal -- check to see if we have a complete starttag; return end
    # or -1 if incomplete.
    def check_for_whole_start_tag(self, i):
        rawdata = self.rawdata
        m = locatestarttagend_tolerant.match(rawdata, i)
        if m:
            j = m.end()
            next = rawdata[j:j+1]
            if next == ">":
                return j + 1
            if next == "/":
                if rawdata.startswith("/>", j):
                    return j + 2
                if rawdata.startswith("/", j):
                    # buffer boundary
                    return -1
                # else bogus input
                if j > i:
                    return j
                else:
                    return i + 1
            if next == "":
                # end of input
                return -1
            if next in ("abcdefghijklmnopqrstuvwxyz=/"
                        "ABCDEFGHIJKLMNOPQRSTUVWXYZ"):
                # end of input in or before attribute value, or we have the
                # '/' from a '/>' ending
                return -1
            if j > i:
                return j
            else:
                return i + 1
        raise AssertionError("we should not get here!")

    # Internal -- parse endtag, return end or -1 if incomplete
    def parse_endtag(self, i):
        rawdata = self.rawdata
        assert rawdata[i:i+2] == "</", "unexpected call to parse_endtag"
        match = endendtag.search(rawdata, i+1) # >
        if not match:
            return -1
        gtpos = match.end()
        match = endtagfind.match(rawdata, i) # </ + tag + >
        if not match:
            if self.cdata_elem is not None:
                self.handle_data(rawdata[i:gtpos])
                return gtpos
            # find the name: w3.org/TR/html5/tokenization.html#tag-name-state
            namematch = tagfind_tolerant.match(rawdata, i+2)
            if not namematch:
                # w3.org/TR/html5/tokenization.html#end-tag-open-state
                if rawdata[i:i+3] == '</>':
                    return i+3
                else:
                    return self.parse_bogus_comment(i)
            tagname = namematch.group(1).lower()
            # consume and ignore other stuff between the name and the >
            # Note: this is not 100% correct, since we might have things like
            # </tag attr=">">, but looking for > after tha name should cover
            # most of the cases and is much simpler
            gtpos = rawdata.find('>', namematch.end())
            self.handle_endtag(tagname)
            return gtpos+1

        elem = match.group(1).lower() # script or style
        if self.cdata_elem is not None:
            if elem != self.cdata_elem:
                self.handle_data(rawdata[i:gtpos])
                return gtpos

        self.handle_endtag(elem)
        self.clear_cdata_mode()
        return gtpos

    # Overridable -- finish processing of start+end tag: <tag.../>
    def handle_startendtag(self, tag, attrs):
        self.handle_starttag(tag, attrs)
        self.handle_endtag(tag)

    # Overridable -- handle start tag
    def handle_starttag(self, tag, attrs):
        pass

    # Overridable -- handle end tag
    def handle_endtag(self, tag):
        pass

    # Overridable -- handle character reference
    def handle_charref(self, name):
        pass

    # Overridable -- handle entity reference
    def handle_entityref(self, name):
        pass

    # Overridable -- handle data
    def handle_data(self, data):
        pass

    # Overridable -- handle comment
    def handle_comment(self, data):
        pass

    # Overridable -- handle declaration
    def handle_decl(self, decl):
        pass

    # Overridable -- handle processing instruction
    def handle_pi(self, data):
        pass

    def unknown_decl(self, data):
        pass

    # Internal -- helper to remove special character quoting
    def unescape(self, s):
        warnings.warn('The unescape method is deprecated and will be removed '
                      'in 3.5, use html.unescape() instead.',
                      DeprecationWarning, stacklevel=2)
        return unescape(s)
html/__pycache__/parser.cpython-38.pyc000064400000025700151153537530013660 0ustar00U

e5d9E�@s�dZddlZddlZddlZddlmZdgZe�d�Ze�d�Z	e�d�Z
e�d�Ze�d	�Ze�d
�Z
e�d�Ze�d�Ze�d
�Ze�dej�Ze�d
�Ze�d�ZGdd�dej�ZdS)zA parser for HTML and XHTML.�N)�unescape�
HTMLParserz[&<]z
&[a-zA-Z#]z%&([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]z)&#(?:[0-9]+|[xX][0-9a-fA-F]+)[^0-9a-fA-F]z	<[a-zA-Z]�>z--\s*>z+([a-zA-Z][^\t\n\r\f />\x00]*)(?:\s|/(?!>))*z]((?<=[\'"\s/])[^\s/>][^\s/=>]*)(\s*=+\s*(\'[^\']*\'|"[^"]*"|(?![\'"])[^>\s]*))?(?:\s|/(?!>))*aF
  <[a-zA-Z][^\t\n\r\f />\x00]*       # tag name
  (?:[\s/]*                          # optional whitespace before attribute name
    (?:(?<=['"\s/])[^\s/>][^\s/=>]*  # attribute name
      (?:\s*=+\s*                    # value indicator
        (?:'[^']*'                   # LITA-enclosed value
          |"[^"]*"                   # LIT-enclosed value
          |(?!['"])[^>\s]*           # bare value
         )
        \s*                          # possibly followed by a space
       )?(?:\s|/(?!>))*
     )*
   )?
  \s*                                # trailing whitespace
z#</\s*([a-zA-Z][-.a-zA-Z0-9:_]*)\s*>c@s�eZdZdZdZdd�dd�Zdd�Zd	d
�Zdd�Zd
Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zd9dd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd
S):raEFind tags and other markup and call handler functions.

    Usage:
        p = HTMLParser()
        p.feed(data)
        ...
        p.close()

    Start tags are handled by calling self.handle_starttag() or
    self.handle_startendtag(); end tags by self.handle_endtag().  The
    data between tags is passed from the parser to the derived class
    by calling self.handle_data() with the data as argument (the data
    may be split up in arbitrary chunks).  If convert_charrefs is
    True the character references are converted automatically to the
    corresponding Unicode character (and self.handle_data() is no
    longer split in chunks), otherwise they are passed by calling
    self.handle_entityref() or self.handle_charref() with the string
    containing respectively the named or numeric reference as the
    argument.
    )ZscriptZstyleT)�convert_charrefscCs||_|��dS)z�Initialize and reset this instance.

        If convert_charrefs is True (the default), all character references
        are automatically converted to the corresponding Unicode characters.
        N)r�reset)�selfr�r�#/usr/lib64/python3.8/html/parser.py�__init__WszHTMLParser.__init__cCs(d|_d|_t|_d|_tj�|�dS)z1Reset this instance.  Loses all unprocessed data.�z???N)�rawdata�lasttag�interesting_normal�interesting�
cdata_elem�_markupbase�
ParserBaser�rrrr	r`s
zHTMLParser.resetcCs|j||_|�d�dS)z�Feed data to the parser.

        Call this as often as you want, with as little or as much text
        as you want (may include '\n').
        rN)r�goahead�r�datarrr	�feedhszHTMLParser.feedcCs|�d�dS)zHandle any buffered data.�N)rrrrr	�closeqszHTMLParser.closeNcCs|jS)z)Return full source of start tag: '<...>'.)�_HTMLParser__starttag_textrrrr	�get_starttag_textwszHTMLParser.get_starttag_textcCs$|��|_t�d|jtj�|_dS)Nz</\s*%s\s*>)�lowerr�re�compile�Ir)r�elemrrr	�set_cdata_mode{s
zHTMLParser.set_cdata_modecCst|_d|_dS�N)rrrrrrr	�clear_cdata_modeszHTMLParser.clear_cdata_modecCsX|j}d}t|�}||k�r�|jrv|jsv|�d|�}|dkr�|�dt||d��}|dkrpt�d��	||�sp�q�|}n*|j
�	||�}|r�|��}n|jr��q�|}||kr�|jr�|js�|�t
|||���n|�|||��|�||�}||kr��q�|j}|d|��rJt�||��r"|�|�}	n�|d|��r:|�|�}	nn|d|��rR|�|�}	nV|d|��rj|�|�}	n>|d	|��r�|�|�}	n&|d
|k�r�|�d�|d
}	n�q�|	dk�r<|�s��q�|�d|d
�}	|	dk�r�|�d|d
�}	|	dk�r|d
}	n|	d
7}	|j�r*|j�s*|�t
|||	���n|�|||	��|�||	�}q|d|��r�t�||�}|�r�|��d
d�}
|�|
�|��}	|d|	d
��s�|	d
}	|�||	�}qn<d||d�k�r�|�|||d
��|�||d
�}�q�q|d|��r�t�||�}|�rP|�d
�}
|�|
�|��}	|d|	d
��sB|	d
}	|�||	�}qt�||�}|�r�|�r�|��||d�k�r�|��}	|	|k�r�|}	|�||d
�}�q�n.|d
|k�r�|�d�|�||d
�}n�q�qdstd��q|�rF||k�rF|j�sF|j�r(|j�s(|�t
|||���n|�|||��|�||�}||d�|_dS)Nr�<�&�"z[\s;]�</�<!--�<?�<!rrz&#�����;zinteresting.search() lied)r�lenrr�find�rfind�maxrr�searchr�start�handle_datarZ	updatepos�
startswith�starttagopen�match�parse_starttag�parse_endtag�
parse_comment�parse_pi�parse_html_declaration�charref�group�handle_charref�end�	entityref�handle_entityref�
incomplete�AssertionError)rr@r�i�n�jZampposr7r5�k�namerrr	r�s�
�











zHTMLParser.goaheadcCs�|j}|||d�dks"td��|||d�dkr@|�|�S|||d�dkr^|�|�S|||d���d	kr�|�d
|d�}|dkr�dS|�||d|��|dS|�|�SdS)
Nr+r*z+unexpected call to parse_html_declaration()�r(�z<![�	z	<!doctyperr,r)rrDr:Zparse_marked_sectionrr/�handle_decl�parse_bogus_comment)rrEr�gtposrrr	r<s

z!HTMLParser.parse_html_declarationrcCs`|j}|||d�dks"td��|�d|d�}|dkr>dS|rX|�||d|��|dS)Nr+)r*r'z"unexpected call to parse_comment()rr,r)rrDr/�handle_comment)rrEZreportr�posrrr	rNszHTMLParser.parse_bogus_commentcCsd|j}|||d�dks"td��t�||d�}|s:dS|��}|�||d|��|��}|S)Nr+r)zunexpected call to parse_pi()r,)rrD�picloser2r3�	handle_pir@)rrErr7rGrrr	r;!szHTMLParser.parse_picCs�d|_|�|�}|dkr|S|j}|||�|_g}t�||d�}|sPtd��|��}|�d���|_	}||k�r.t
�||�}|s��q.|�ddd�\}	}
}|
s�d}n\|dd�dkr�|dd�ks�n|dd�dkr�|dd�k�rnn|dd�}|�rt|�}|�|	��|f�|��}ql|||��
�}|d	k�r�|��\}
}d
|jk�r�|
|j�d
�}
t|j�|j�d
�}n|t|j�}|�|||��|S|�d��r�|�||�n"|�||�||jk�r�|�|�|S)Nrrz#unexpected call to parse_starttag()r+rK�'r,�")r�/>�
rV)r�check_for_whole_start_tagr�tagfind_tolerantr7rDr@r>rr
�attrfind_tolerantr�append�stripZgetpos�countr.r0r4�endswith�handle_startendtag�handle_starttag�CDATA_CONTENT_ELEMENTSr!)rrE�endposr�attrsr7rH�tag�m�attrname�restZ	attrvaluer@�lineno�offsetrrr	r8-s\

&
�
�


�
zHTMLParser.parse_starttagcCs�|j}t�||�}|r�|��}|||d�}|dkr>|dS|dkr~|�d|�rZ|dS|�d|�rjdS||krv|S|dS|dkr�dS|dkr�dS||kr�|S|dStd	��dS)
Nrr�/rVr+r,rz6abcdefghijklmnopqrstuvwxyz=/ABCDEFGHIJKLMNOPQRSTUVWXYZzwe should not get here!)r�locatestarttagend_tolerantr7r@r5rD)rrErrerG�nextrrr	rX`s.z$HTMLParser.check_for_whole_start_tagcCs.|j}|||d�dks"td��t�||d�}|s:dS|��}t�||�}|s�|jdk	rr|�|||��|St	�||d�}|s�|||d�dkr�|dS|�
|�S|�d���}|�
d|���}|�|�|dS|�d���}|jdk	�r||jk�r|�|||��|S|�|�|��|S)	Nr+r'zunexpected call to parse_endtagrr,rKz</>r)rrD�	endendtagr2r@�
endtagfindr7rr4rYrNr>rr/�
handle_endtagr#)rrErr7rOZ	namematchZtagnamer rrr	r9�s8



zHTMLParser.parse_endtagcCs|�||�|�|�dSr")r`ro�rrdrcrrr	r_�szHTMLParser.handle_startendtagcCsdSr"rrprrr	r`�szHTMLParser.handle_starttagcCsdSr"r)rrdrrr	ro�szHTMLParser.handle_endtagcCsdSr"r�rrIrrr	r?�szHTMLParser.handle_charrefcCsdSr"rrqrrr	rB�szHTMLParser.handle_entityrefcCsdSr"rrrrr	r4�szHTMLParser.handle_datacCsdSr"rrrrr	rP�szHTMLParser.handle_commentcCsdSr"r)rZdeclrrr	rM�szHTMLParser.handle_declcCsdSr"rrrrr	rS�szHTMLParser.handle_picCsdSr"rrrrr	�unknown_decl�szHTMLParser.unknown_declcCstjdtdd�t|�S)NzZThe unescape method is deprecated and will be removed in 3.5, use html.unescape() instead.r+)�
stacklevel)�warnings�warn�DeprecationWarningr)r�srrr	r�s
�zHTMLParser.unescape)r)�__name__�
__module__�__qualname__�__doc__rar
rrrrrr!r#rr<rNr;r8rXr9r_r`ror?rBr4rPrMrSrrrrrrr	r?s8		z
3"()r{rrtrZhtmlr�__all__rrrCrAr=r6rRZcommentcloserYrZ�VERBOSErkrmrnrrrrrr	�<module>s,








��

html/__pycache__/parser.cpython-38.opt-2.pyc000064400000022313151153537530014615 0ustar00U

e5d9E�@s�ddlZddlZddlZddlmZdgZe�d�Ze�d�Ze�d�Z	e�d�Z
e�d�Ze�d	�Ze�d
�Z
e�d�Ze�d�Ze�d
ej�Ze�d	�Ze�d�ZGdd�dej�ZdS)�N)�unescape�
HTMLParserz[&<]z
&[a-zA-Z#]z%&([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]z)&#(?:[0-9]+|[xX][0-9a-fA-F]+)[^0-9a-fA-F]z	<[a-zA-Z]�>z--\s*>z+([a-zA-Z][^\t\n\r\f />\x00]*)(?:\s|/(?!>))*z]((?<=[\'"\s/])[^\s/>][^\s/=>]*)(\s*=+\s*(\'[^\']*\'|"[^"]*"|(?![\'"])[^>\s]*))?(?:\s|/(?!>))*aF
  <[a-zA-Z][^\t\n\r\f />\x00]*       # tag name
  (?:[\s/]*                          # optional whitespace before attribute name
    (?:(?<=['"\s/])[^\s/>][^\s/=>]*  # attribute name
      (?:\s*=+\s*                    # value indicator
        (?:'[^']*'                   # LITA-enclosed value
          |"[^"]*"                   # LIT-enclosed value
          |(?!['"])[^>\s]*           # bare value
         )
        \s*                          # possibly followed by a space
       )?(?:\s|/(?!>))*
     )*
   )?
  \s*                                # trailing whitespace
z#</\s*([a-zA-Z][-.a-zA-Z0-9:_]*)\s*>c@s�eZdZdZdd�dd�Zdd�Zdd	�Zd
d�ZdZd
d�Z	dd�Z
dd�Zdd�Zdd�Z
d8dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�ZdS)9r)ZscriptZstyleT)�convert_charrefscCs||_|��dS�N)r�reset)�selfr�r	�#/usr/lib64/python3.8/html/parser.py�__init__WszHTMLParser.__init__cCs(d|_d|_t|_d|_tj�|�dS)N�z???)�rawdata�lasttag�interesting_normal�interesting�
cdata_elem�_markupbase�
ParserBaser�rr	r	r
r`s
zHTMLParser.resetcCs|j||_|�d�dS)Nr)r
�goahead�r�datar	r	r
�feedhszHTMLParser.feedcCs|�d�dS)N�)rrr	r	r
�closeqszHTMLParser.closeNcCs|jSr)�_HTMLParser__starttag_textrr	r	r
�get_starttag_textwszHTMLParser.get_starttag_textcCs$|��|_t�d|jtj�|_dS)Nz</\s*%s\s*>)�lowerr�re�compile�Ir)r�elemr	r	r
�set_cdata_mode{s
zHTMLParser.set_cdata_modecCst|_d|_dSr)rrrrr	r	r
�clear_cdata_modeszHTMLParser.clear_cdata_modecCsJ|j}d}t|�}||k�r�|jrv|jsv|�d|�}|dkr�|�dt||d��}|dkrpt�d��	||�sp�q�|}n*|j
�	||�}|r�|��}n|jr��q�|}||kr�|jr�|js�|�t
|||���n|�|||��|�||�}||kr��q�|j}|d|��rJt�||��r"|�|�}	n�|d|��r:|�|�}	nn|d|��rR|�|�}	nV|d|��rj|�|�}	n>|d	|��r�|�|�}	n&|d
|k�r�|�d�|d
}	n�q�|	dk�r<|�s��q�|�d|d
�}	|	dk�r�|�d|d
�}	|	dk�r|d
}	n|	d
7}	|j�r*|j�s*|�t
|||	���n|�|||	��|�||	�}q|d|��r�t�||�}|�r�|��d
d�}
|�|
�|��}	|d|	d
��s�|	d
}	|�||	�}qn<d||d�k�r�|�|||d
��|�||d
�}�q�q|d|�rt�||�}|�rN|�d
�}
|�|
�|��}	|d|	d
��s@|	d
}	|�||	�}qt�||�}|�r�|�r�|��||d�k�r�|��}	|	|k�r�|}	|�||d
�}�q�n.|d
|k�r�|�d�|�||d
�}n�q�qq|�r8||k�r8|j�s8|j�r|j�s|�t
|||���n|�|||��|�||�}||d�|_dS)Nr�<�&�"z[\s;]z</�<!--z<?z<!rrz&#�����;)r
�lenrr�find�rfind�maxrr�searchr�start�handle_datarZ	updatepos�
startswith�starttagopen�match�parse_starttag�parse_endtag�
parse_comment�parse_pi�parse_html_declaration�charref�group�handle_charref�end�	entityref�handle_entityref�
incomplete)rr=r
�i�n�jZampposr4r2�k�namer	r	r
r�s�
�












zHTMLParser.goaheadcCs�|j}|||d�dkr$|�|�S|||d�dkrB|�|�S|||d���dkr�|�d|d�}|dkrvdS|�||d	|��|d
S|�|�SdS)N�r'�z<![�	z	<!doctyperr)r(r)r
r7Zparse_marked_sectionrr,�handle_decl�parse_bogus_comment)rrAr
�gtposr	r	r
r9s

z!HTMLParser.parse_html_declarationrcCsD|j}|�d|d�}|dkr"dS|r<|�||d|��|dS)Nrr(r)r)r
r,�handle_comment)rrAZreportr
�posr	r	r
rJszHTMLParser.parse_bogus_commentcCsH|j}t�||d�}|sdS|��}|�||d|��|��}|S)Nr(r))r
�picloser/r0�	handle_pir=)rrAr
r4rCr	r	r
r8!szHTMLParser.parse_picCs�d|_|�|�}|dkr|S|j}|||�|_g}t�||d�}|��}|�d���|_}||k�r t	�||�}|s~�q |�ddd�\}	}
}|
s�d}nZ|dd�dkr�|dd�ks�n|dd�dkr�|dd�kr�nn|dd�}|�rt
|�}|�|	��|f�|��}q`|||���}|dk�r�|�
�\}
}d	|jk�rz|
|j�d	�}
t|j�|j�d	�}n|t|j�}|�|||��|S|�d
��r�|�||�n"|�||�||jk�r�|�|�|S)Nrrr(rG�'r)�")r�/>�
rR)r�check_for_whole_start_tagr
�tagfind_tolerantr4r=r;rr�attrfind_tolerantr�append�stripZgetpos�countr+r-r1�endswith�handle_startendtag�handle_starttag�CDATA_CONTENT_ELEMENTSr")rrA�endposr
�attrsr4rD�tag�m�attrname�restZ	attrvaluer=�lineno�offsetr	r	r
r5-sZ

&
�
�



�
zHTMLParser.parse_starttagcCs�|j}t�||�}|r�|��}|||d�}|dkr>|dS|dkr~|�d|�rZ|dS|�d|�rjdS||krv|S|dS|dkr�dS|dkr�dS||kr�|S|dStd	��dS)
Nrr�/rRr(r)rz6abcdefghijklmnopqrstuvwxyz=/ABCDEFGHIJKLMNOPQRSTUVWXYZzwe should not get here!)r
�locatestarttagend_tolerantr4r=r2�AssertionError)rrAr
rarC�nextr	r	r
rT`s.z$HTMLParser.check_for_whole_start_tagcCs|j}t�||d�}|sdS|��}t�||�}|s�|jdk	rV|�|||��|St�||d�}|s�|||d�dkr�|dS|�	|�S|�
d���}|�d|���}|�
|�|dS|�
d���}|jdk	r�||jkr�|�|||��|S|�
|�|��|S)Nrr)r(rGz</>r)r
�	endendtagr/r=�
endtagfindr4rr1rUrJr;rr,�
handle_endtagr#)rrAr
r4rKZ	namematchZtagnamer!r	r	r
r6�s6





zHTMLParser.parse_endtagcCs|�||�|�|�dSr)r\rl�rr`r_r	r	r
r[�szHTMLParser.handle_startendtagcCsdSrr	rmr	r	r
r\�szHTMLParser.handle_starttagcCsdSrr	)rr`r	r	r
rl�szHTMLParser.handle_endtagcCsdSrr	�rrEr	r	r
r<�szHTMLParser.handle_charrefcCsdSrr	rnr	r	r
r?�szHTMLParser.handle_entityrefcCsdSrr	rr	r	r
r1�szHTMLParser.handle_datacCsdSrr	rr	r	r
rL�szHTMLParser.handle_commentcCsdSrr	)rZdeclr	r	r
rI�szHTMLParser.handle_declcCsdSrr	rr	r	r
rO�szHTMLParser.handle_picCsdSrr	rr	r	r
�unknown_decl�szHTMLParser.unknown_declcCstjdtdd�t|�S)NzZThe unescape method is deprecated and will be removed in 3.5, use html.unescape() instead.r()�
stacklevel)�warnings�warn�DeprecationWarningr)r�sr	r	r
r�s
�zHTMLParser.unescape)r)�__name__�
__module__�__qualname__r]rrrrrrr"r#rr9rJr8r5rTr6r[r\rlr<r?r1rLrIrOrorr	r	r	r
r?s6		z
3"()rrqrZhtmlr�__all__rrr@r>r:r3rNZcommentcloserUrV�VERBOSErgrjrkrrr	r	r	r
�<module>s*







��

html/__pycache__/__init__.cpython-38.opt-1.pyc000064400000007044151153537530015063 0ustar00U

e5d��~@s�dZddlZddlmZddgZd�dd�Zdd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*�"Zd+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�h~Z	d�d��Z
e�d��Zd�d�Z
dS)�z*
General functions for HTML manipulation.
�N)�html5�escape�unescapeTcCsD|�dd�}|�dd�}|�dd�}|r@|�dd�}|�d	d
�}|S)z�
    Replace special characters "&", "<" and ">" to HTML-safe sequences.
    If the optional flag quote is true (the default), the quotation mark
    characters, both double quote (") and single quote (') characters are also
    translated.
    �&z&amp;�<z&lt;�>z&gt;�"z&quot;�'z&#x27;)�replace)�sZquote�r�%/usr/lib64/python3.8/html/__init__.pyrs���
u€�u‚uƒu„u…u†u‡uˆu‰uŠu‹uŒ�uŽ��u‘u’u“u”u•u–u—u˜u™ušu›uœ�užuŸ)"r�
�����������������������������������������������������������rrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��	i��	i��
i��
i��i��i��i��i��
i��
i��i��i��i��i���cCs�|�d�}|ddkr�|ddkr<t|dd��d�d�}nt|dd��d��}|tkrbt|Sd|krvd	ks�n|d
kr�dS|tkr�dSt|�S|tkr�t|Stt|�ddd
�D]4}|d|�tkr�t|d|�||d�Sq�d|SdS)Nr6r�#ZxXr7�;r@i�i��rRr����r)	�group�int�rstrip�_invalid_charrefs�_invalid_codepoints�chr�_html5�range�len)rZnum�xrrr
�_replace_charref[s$
"raz7&(#[0-9]+;?|#[xX][0-9a-fA-F]+;?|[^\t\n\f <&#;]{1,32};?)cCsd|kr|St�t|�S)a^
    Convert all named and numeric character references (e.g. &gt;, &#62;,
    &x3e;) in the string s to the corresponding unicode characters.
    This function uses the rules defined by the HTML 5 standard
    for both valid and invalid character references, and the list of
    HTML 5 named character references defined in html.entities.html5.
    r)�_charref�subra)rrrr
rzs)T)�__doc__�reZ_reZ
html.entitiesrr]�__all__rrZr[ra�compilerbrrrrr
�<module>sR
�'�
html/__pycache__/entities.cpython-38.opt-2.pyc000064400000142457151153537530015161 0ustar00U

e5d3&��@s,%ddddgZdddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d��Z�d�d�d�d�d�d�d�d�d�d�d	�d�d	�d
�d
�d�d�d
�d�d
�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d �d!�d"�d!�d#�d$�d%�d&�d'�d(�d)�d*�d+�d,�d-�d.�d/�d0�d1�d2�d3�d4�d5�d6�d7�d8�d9�d:�d;�d�d6�d9�d0�d<�d0�d<�d=�d>�d?�d@�d6�dA�dB�dC�dB�dC�dD�dE�dD�dE�dF�dG�dH�dI�dJ�dK�dL�dM�dN�dO�dP�dQ�dQ�dR�dS�dH�dT�dU�dV�dW�dW�dW�dX�dI�dY�dY�dZ�d[�d\�d]�d^�d_�d`�da�db�dc�dd�de�df�dg�dh�di�dj�dk�dl�dm�dn�do�dp�dq�dr�ds�dt�du�dv�dw�dx�dy�dz�d{�d|�d}�d~�d�d�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��dJ�d��d��d��d��dY�d��d��dK�dL�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��ddÐdĐdŐdƐdǐdȐdɐdʐdɐdʐdːd̐d͐dΐdϐdАdѐdҐdҐdҐdӐdԐdԐdՐdՐdŐd֐dאdؐdِdِdڐdېdܐdݐdސdߐd�d�d�d�d�d�d�d�d�d�d�dސd�d�d�d�d�d�d�d�d�d�d�d?�d?�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d�d�d�d�d�d�d�dF�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�dA�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d �d!�d"�d#�d$�d%�d&�d'�d(�d)�d*�d+�d,�d-�d.�d/�d0�d��d1�d"�d2�d3�d4�d5�d5�d6�d7�d8�d9�d:�d;�d<�d=�d>�d?�d
�d@�d,�dA�dB�dC�dC�dC�dD�dD�dE�d1�dF�dG�dH�dH�dH�dI�dI�dJ�dK�dL�dM�dN�dO�dP�dE�d@�dQ�dR�dS�dR�dT�dU�dV�dP�d��dE�d&�dW�dX�d)�dY�dZ�d[�d\�d]�d^�d_�d`�d'�d&�d'�da�db�dc�d2�d>�d?�dd�de�df�dg�dh�di�dj�dk�dl�dm�dn�do�dp�dq�dr�ds�dt�du�dv�dw�dx�dq�db�dy�dz�d{�d|�d}�d~�d�d~�d�d��d��d��d��d��d��d��d��d��d��d��d4�d��dS�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��dR�d��d��d��d��d��d��d��d��d��d��d��d��d��ddÐdÐd��d��d��d��dĐdŐdƐdǐdȐdɐdʐdːd̐d͐do�dΐdϐdАdѐdҐdӐdԐdՐdՐd֐dאdؐdِdڐdڐdېdܐdܐdݐdސdߐd�d�d�d�d�d�d�d�d�d�d�d�dؐd�d�d�d�d�dF�d�d�d�d�d�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d�d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�d�d�d�dA�d��d��d��d�d�d��d�d�d�d�d�d�d�d�d�d�d�d�d�d�d �d!�d�d"�d�d��d��d�d�d#�d#�dĐd$�dڐd%�d&�d'�dX�d(�d)�d*�d+�d,�d-�d.�d/�d/�d0�d1�d2�d3�d%�d4�d5�d6�d7�d8�d9�d:�d;�d<�d��d%�d=�d,�d>�d?�d��d��d@�d(�dA�dB�dA�dB�dC�dD�dE�dD�dE�dF�dG�dH�dI�dJ�dK�dK�dX�dL�dM�dN�dO�dN�dO�dP�dQ�dR�dS�dT�dU�dV�dL�dW�dX�dL�dP�dY�dL�dZ�d[�d\�d\�d��d]�d^�d_�dZ�d`�da�db�dc�da�db�d`�dd�de�dC�df�dg�dh�di�dj�dk�dl�dm�dn�de�do�do�dY�dp�d��dq�dr�ds�dt�d��df�du�dv�dw�dx�dy�dz�dy�dz�d{�d|�d}�d~�d�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��dW�d��d��d��d��d8�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��dd��dÐdĐdŐdƐdV�dǐdȐdɐdʐdːd��d��dW�d��d��d̐d��dd͐dΐd>�dϐdАdf�dѐdҐd(�dX�d(�d̐dӐd*�dԐd*�dՐd֐dאdؐdِdڐdېdܐdݐdސdѐdߐd�d�dːdʐd�d�d�d�d�d�d�d�d��d�d�d�d�dʐd�d�d�d�d�d�d�dАd�d�d�d�d�df�dѐd�d�d�d��d��d��dҐdL�d��d��d��d��d��d��d��d��d��d��d��d��d��d�d�d�d͐d�dY�d�d�dZ�d�d�d�d[�d�d��d�d�d	�d
�d�d�d
�d�d�d�d�d�dn�d�d�d̐dn�dӐd�d�d�d�d��d�d�d�d�d�d�d��d�d�d�d�d �d �d �d��d �d!�d"�d�dאd#�d$�d%�d&�dڐdr�d'�d(�d)�d*�d*�d+�d+�d,�d-�d-�d.�d/�d/�dl�dՐd0�d1�d2�d3�d4�d5�d6�d#�d7�d8�d9�d:�d;�d<�d<�d=�d@�d>�dՐdՐd?�d��dT�d@�dA�dB�d0�dA�dC�dD�dE�dA�d8�dF�d�dG�dH�dI�dI�d6�dJ�dK�dL�dM�dN�dO�dP�dM�dQ�dQ�dR�dS�dS�dT�dU�dV�dW�dX�dY�dZ�d[�d\�d]�d^�d_�d`�da�db�dc�dd�dd�de�df�df�df�df�dg�dh�di�d�d��dj�dk�dk�dl�dm�dn�do�do�dn�dp�dp�dq�dr�ds�dt�dt�du�dv�dw�dx�dy�dz�d{�dy�d|�d}�d~�d�d��d��d��d~�d�dv�dw�d��d��d��d��d��d��d��d��d��d��d��d��d��d��dS�dR�d��d��d��d��dg�d��d��d��da�di�dk�dt�do�dn�du�d��dp�dr�dT�dU�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d[�dM�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��ddÐdĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐dאdؐdِdِdڐdېdܐdېdܐd�d�dݐdސdݐdސdߐd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��dߐd�d�d�d�d�d��d�d��d��d��d��d�d��d��d��dƐd�d��d�d��d��d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d	�d
�d	�d
�d�d�d
�d�d
�d�d�d�d�d�d�d�d�d�d�d�d�d`�d�d�d`�d�d�d�d�d�d�d�d�d�d�d�d �d!�d"�d#�d$�d8�d%�d&�d'�d֐d(�d,�d)�d,�d*�d+�d��d,�dU�d-�d.�d/�d/�d/�d0�d1�d/�d2�d2�d3�d4�d5�d5�d6�d7�d8�d9�d:�d;�d7�d8�d9�d7�d;�d9�d<�d;�d=�d>�d?�d<�d@�dA�d3�d=�d>�d?�dB�dB�dC�dD�dE�dF�d�dF�dF�d<�dG�dH�dI�dJ�dK�dL�dM�dN�dQ�dO�dP�dQ�dR�dS�d:�dT�dU�d��dV�dV�dV�dV�dW�dX�dY�dZ�d[�d\�d]�d^�d_�d`�d^�da�da�db�d\�dc�dd�de�df�dg�dh�d9�d�di�dj�dk�dl�dm�dn�do�dp�dO�dm�d+�dm�dq�dr�ds�dt�du�dv�dw�dx�dy�dz�d{�dr�d|�d}�d~�d�d�d�d��d��d��d��d��d��d��d�d�d�d�dy�dӐdy�d��d��d��d��d��di�d��d��d��d��d��d^�dc�d\�dc�de�d��dl�d{�d��d��d?�d��d��di�d��d��d��d��dm�d��d/�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��dW�d��d��d��d��d��ds�d�d�d��d��d��d��ds�d��d��d��d��d��d��d�d��d��d��d��d��d��d��d��d��d��d��ddÐdĐdŐdƐdǐdȐdɐdʐdV�dːd4�d̐d�d�d͐d͐dΐdϐdM�dM�dАdѐdҐd�dӐdԐdՐd֐dאd'�d��d=�d`�dc�dؐdِdِdڐdېdܐdܐdݐdސdߐdߐd�d�d�d�d�d�d�d��d��dM�d�d�d=�d�d�d�d�d�d�d�d�d�d�d�d�d�d`�d��d��d��d��d[�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��do�do�dc�d��d��dM�d�d�d�d�dg�d��d$�d+�d�d�d�d�d�d�d�d	�d
�d�d�d�d�d�d�d�d
�d	�d
�d�d�d��d��d��d��d��d��dǐd��dÐdĐdŐdǐdy�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d �d!�d"�d�d�d�d�d!�d �d#�d$�d%�d5�d&�d�d�d'�d(�d(�d)�d*�d+�d,�d�d-�d.�d/�d0�d1�d2�d3�d4�d5�d6�d7�d7�d7�d8�d9�d:�d:�d6�dݐd;�d<�d<�d6�dݐd=�d>�d=�d>�dݐdB�dߐd��d6�d?�d?�d��d@�dA�dR�dh�dk�dB�dC�dD�dE�dF�dϐdG�dH�dH�dI�dx�d&�dڐdJ�d��d��dK�dJ�dL�d3�dM�dN�dO�dP�dQ�dR�dS�dT�dU�dV�dW�dX�d]�d��db�dY�dZ�dY�dZ�d[�d^�dؐd\�d]�d^�d_�d`�da�db�da�db�dc�dd�de�df�dg�dh�di�dj�dk�dl�dm�dl�dm�dn�dݐd��do�dp�dp�dq�dr�ds�dt�dE�dE�d�du�dR�dv�db�dw�dx�dy�dz�d{�dؐd^�dؐd|�de�d}�d_�d}�dh�dݐd��dw�dِdd�d~�d�d~�d��d�d�d0�d��d��d��d��d��d��d��d��d��d��d��d��dI�dp�d��d��d��d��d��d��d��d��d��d��d$�d(�dF�d_�d}�d��dܐd��d��d��d��d:�dؐd��d��d��d��d��d��d��d��d]�d��d��dk�d��d��d��d��d��d��d��d��d=�d��d��d��d$�d��d��dؐd��d��d��d��dF�d��d��d��d��d��d��d��d��d��d��d��d��dl�d�d��d��d��d��d��d��d��d��d��d��d��d`�da�db�dh�d��d��dZ�d�d��d��dY�d�d�d��dc�d��d��dd�de�d[�d�d��d��df�dj�di�dk�dl�d��d��d��d��d��ddÐdĐdŐdƐdǐdǐdȐdɐdʐdːd̐d͐dΐdϐdАdѐdҐdӐdҐdԐdՐd֐dאdؐdِdڐdېdܐdf�dݐdސdܐdߐd�d�d�dc�d�d�d�d�d�d���ZiZiZe��D]\ZZeee<ee�ee<�%q[[�d�S(��html5�name2codepoint�codepoint2name�
entitydefs������i�������i���i�i! i���������i�i���i�������i���i�i�i���i�iR������i�i�������i�i�i3 i�i�i`i���i�i�������i���i���ixi����������i5!i��&i'"i "��iH"����i i��i" i)"����i�i�ic&iE"�i�!i*"�i�!i  i�!�i�if&�������i"i i i�ia"i�����i� i"i�i"���iD i�ie"�>i�!i�!ie&i& �������i!i"i+"i��i"��i�i�!i�i)#�i�!i#i id"i
#i"i�%i i9 i �<�i ��i"i�i"�i i`"i"�i	"i�"��i�����iS��i> i�i�i�"i("����i�"��i"i0 i�"i�i�i���i2 i"i"i��"i�!i"i*#�i�!i	#i i!�i#i�i i: i i iai�"��i�i�i<"i`&i�"i�"i"i�"���i�"��i�i4"i�i�i	 �i���i"!i�!�i�!���i�i��i!i����i�i
 i )��AElig�Aacute�Acirc�AgraveZAlpha�Aring�Atilde�AumlZBeta�CcedilZChiZDaggerZDelta�ETH�Eacute�Ecirc�EgraveZEpsilonZEta�EumlZGamma�Iacute�Icirc�IgraveZIota�IumlZKappaZLambdaZMu�NtildeZNuZOElig�Oacute�Ocirc�OgraveZOmegaZOmicron�Oslash�Otilde�OumlZPhiZPiZPrimeZPsiZRhoZScaronZSigma�THORNZTauZTheta�Uacute�Ucirc�UgraveZUpsilon�UumlZXi�YacuteZYumlZZeta�aacute�acirc�acute�aelig�agraveZalefsymZalpha�amp�andZang�aringZasymp�atilde�aumlZbdquoZbeta�brvbarZbullZcap�ccedil�cedil�centZchiZcircZclubsZcong�copyZcrarrZcup�currenZdArrZdaggerZdarr�degZdeltaZdiams�divide�eacute�ecirc�egrave�emptyZemspZensp�epsilonZequivZeta�eth�eumlZeuroZexistZfnofZforall�frac12�frac14�frac34ZfraslZgamma�ge�gtZhArrZharrZheartsZhellip�iacute�icirc�iexcl�igraveZimageZinfin�intZiota�iquestZisin�iumlZkappaZlArr�lambdaZlang�laquoZlarrZlceilZldquo�leZlfloorZlowastZlozZlrmZlsaquoZlsquo�lt�macrZmdash�micro�middotZminusZmuZnabla�nbspZndash�neZni�notZnotinZnsub�ntildeZnu�oacute�ocircZoelig�ograveZolineZomegaZomicronZoplus�or�ordf�ordm�oslash�otildeZotimes�ouml�para�partZpermilZperpZphiZpiZpiv�plusmn�poundZprimeZprodZpropZpsi�quotZrArrZradicZrang�raquoZrarrZrceilZrdquo�real�regZrfloorZrhoZrlmZrsaquoZrsquoZsbquoZscaronZsdot�sect�shyZsigmaZsigmafZsimZspades�subZsube�sumZsup�sup1�sup2�sup3Zsupe�szligZtauZthere4ZthetaZthetasymZthinsp�thorn�tilde�timesZtradeZuArr�uacuteZuarr�ucirc�ugrave�umlZupsihZupsilon�uumlZweierpZxi�yacute�yen�yumlZzetaZzwjZzwnj�Á�áuĂuău∾u∿u∾̳�Â�â�´uАuа�Æ�æu⁡u𝔄u𝔞�À�àuℵuΑuαuĀuāu⨿�&u⩓u∧u⩕u⩜u⩘u⩚u∠u⦤u∡u⦨u⦩u⦪u⦫u⦬u⦭u⦮u⦯u∟u⊾u⦝u∢�Åu⍼uĄuąu𝔸u𝕒u≈u⩯u⩰u≊u≋�'�åu𝒜u𝒶u≔�*u≍�Ã�ã�Ä�äu∳u⨑u≌u϶u‵u∽u⋍u∖u⫧u⊽u⌆u⌅u⎵u⎶uБuбu„u∵u⦰uℬuΒuβuℶu≬u𝔅u𝔟u⋂u◯u⋃u⨀u⨁u⨂u⨆u★u▽u△u⨄u⋁u⋀u⤍u⧫u▪u▴u▾u◂u▸u␣u▒u░u▓u█u=⃥u≡⃥u⫭u⌐u𝔹u𝕓u⊥u⋈u⧉u╗u╖u╕u┐u╔u╓u╒u┌u═u─u╦u╤u╥u┬u╩u╧u╨u┴u⊟u⊞u⊠u╝u╜u╛u┘u╚u╙u╘u└u║u│u╬u╫u╪u┼u╣u╢u╡u┤u╠u╟u╞u├u˘�¦u𝒷u⁏�\u⧅u⟈u•u≎u⪮u≏uĆuću⋒u∩u⩄u⩉u⩋u⩇u⩀uⅅu∩︀u⁁uˇuℭu⩍uČuč�Ç�çuĈuĉu∰u⩌u⩐uĊuċ�¸u⦲�¢�·u𝔠uЧuчu✓uΧuχu○uˆu≗u↺u↻u⊛u⊚u⊝u⊙�®uⓈu⊖u⊕u⊗u⧃u⨐u⫯u⧂u∲u”u’u♣u∷�:u⩴�,�@u∁u∘uℂu≅u⩭u≡u∯u∮u𝕔u∐�©u℗u↵u⨯u✗u𝒞u𝒸u⫏u⫑u⫐u⫒u⋯u⤸u⤵u⋞u⋟u↶u⤽u⋓u∪u⩈u⩆u⩊u⊍u⩅u∪︀u↷u⤼u⋎u⋏�¤u∱u⌭u‡u†uℸu↡u⇓u↓u‐u⫤u⊣u⤏u˝uĎuďuДuдuⅆu⇊u⤑u⩷�°u∇uΔuδu⦱u⥿u𝔇u𝔡u⥥u⇃u⇂u˙�`u˜u⋄u♦�¨uϝu⋲�÷u⋇uЂuђu⌞u⌍�$u𝔻u𝕕u⃜u≐u≑u∸u∔u⊡u⇐u⇔u⟸u⟺u⟹u⇒u⊨u⇑u⇕u∥u⤓u⇵ȗu⥐u⥞u↽u⥖u⥟u⇁u⥗u⊤u↧u⤐u⌟u⌌u𝒟u𝒹uЅuѕu⧶uĐuđu⋱u▿u⥯u⦦uЏuџu⟿�É�éu⩮uĚuěu≖�Ê�êu≕uЭuэuĖuėuⅇu≒u𝔈u𝔢u⪚�È�èu⪖u⪘u⪙u∈u⏧uℓu⪕u⪗uĒuēu∅u◻u▫u u u uŊuŋu uĘuęu𝔼u𝕖u⋕u⧣u⩱uεuΕuϵu≂u⩵�=u≟u⇌u⩸u⧥u⥱u≓uℰuℯu⩳uΗuη�Ð�ð�Ë�ëu€�!u∃uФuфu♀uffiuffufflu𝔉u𝔣ufiu◼Zfju♭uflu▱uƒu𝔽u𝕗u∀u⋔u⫙uℱu⨍�½u⅓�¼u⅕u⅙u⅛u⅔u⅖�¾u⅗u⅜u⅘u⅚u⅝u⅞u⁄u⌢u𝒻uǵuΓuγuϜu⪆uĞuğuĢuĜuĝuГuгuĠuġu≧u≥u⪌u⋛u⩾u⪩u⪀u⪂u⪄u⋛︀u⪔u𝔊u𝔤u⋙u≫uℷuЃuѓu≷u⪥u⪒u⪤u⪊u≩u⪈u⋧u𝔾u𝕘u⪢u≳u𝒢uℊu⪎u⪐�>u⪧u⩺u⋗u⦕u⩼u⥸u≩︀u uℋuЪuъu↔u⥈u↭�^uℏuĤuĥu♥u…u⊹uℌu𝔥u⤥u⤦u⇿u∻u↩u↪uℍu𝕙u―u𝒽uĦuħu⁃�Í�íu⁣�Î�îuИuиuİuЕuе�¡uℑu𝔦�Ì�ìuⅈu⨌u∭u⧜u℩uIJuijuĪuīuℐuıu⊷uƵu℅u∞u⧝u∬u∫u⊺uℤu⨗u⨼u⁢uЁuёuĮuįu𝕀u𝕚uΙuι�¿u𝒾u⋵u⋹u⋴u⋳uĨuĩuІuі�Ï�ïuĴuĵuЙuйu𝔍u𝔧uȷu𝕁u𝕛u𝒥u𝒿uЈuјuЄuєuΚuκuϰuĶuķuКuкu𝔎u𝔨uĸuХuхuЌuќu𝕂u𝕜u𝒦u𝓀u⇚uĹuĺu⦴uℒuΛuλu⟪u⟨u⦑u⪅�«u↞u←u⇤u⤟u⤝u↫u⤹u⥳u↢u⪫u⤛u⤙u⪭u⪭︀u⤎u⤌u❲�{�[u⦋u⦏u⦍uĽuľuĻuļu⌈uЛuлu⤶u“u⥧u⥋u↲u≦u≤u⇆u⟦u⥡u⥙u⌊u↼u⇇u⇋u⥎u↤u⥚u⋋u⊲u⧏u⊴u⥑u⥠u↿u⥘u⥒u⪋u⋚u⩽u⪨u⩿u⪁u⪃u⋚︀u⪓u⋖u≶u⪡u≲u⥼u𝔏u𝔩u⪑u⥢u⥪u▄uЉuљu⋘u≪u⥫u◺uĿuŀu⎰u⪉u≨u⪇u⋦u⟬u⇽u⟵u⟷u⟼u⟶u↬u⦅u𝕃u𝕝u⨭u⨴u∗�_u↙u↘u◊�(u⦓u⥭u‎u⊿u‹u𝓁u↰u⪍u⪏u‘u‚uŁuł�<u⪦u⩹u⋉u⥶u⩻u◃u⦖u⥊u⥦u≨︀�¯u♂u✠u⤅u↦u↥u▮u⨩uМuмu—u∺u uℳu𝔐u𝔪u℧�µu∣u⫰u−u⨪u∓u⫛u⊧u𝕄u𝕞u𝓂uΜuμu⊸uŃuńu∠⃒u≉u⩰̸u≋̸uʼnu♮uℕ� u≎̸u≏̸u⩃uŇuňuŅuņu≇u⩭̸u⩂uНuнu–u≠u⤤u⇗u↗u≐̸u​u≢u⤨u≂̸�
u∄u𝔑u𝔫u≧̸u≱u⩾̸u⋙̸u≵u≫⃒u≯u≫̸u⇎u↮u⫲u∋u⋼u⋺uЊuњu⇍u↚u‥u≦̸u≰u⩽̸u≮u⋘̸u≴u≪⃒u⋪u⋬u≪̸u∤u⁠u𝕟�¬u⫬u≭u∦u∉u≹u⋵̸u⋹̸u⋷u⋶u⧏̸u≸u⪢̸u⪡̸u∌u⋾u⋽u⊀u⪯̸u⋠u⋫u⧐̸u⋭u⊏̸u⋢u⊐̸u⋣u⊂⃒u⊈u⊁u⪰̸u⋡u≿̸u⊃⃒u⊉u≁u≄u⫽⃥u∂̸u⨔u⇏u↛u⤳̸u↝̸u𝒩u𝓃u⊄u⫅̸u⊅u⫆̸�Ñ�ñuΝuν�#u№u u≍⃒u⊯u⊮u⊭u⊬u≥⃒u>⃒u⤄u⧞u⤂u≤⃒u<⃒u⊴⃒u⤃u⊵⃒u∼⃒u⤣u⇖u↖u⤧�Ó�ó�Ô�ôuОuоuŐuőu⨸u⦼uŒuœu⦿u𝔒u𝔬u˛�Ò�òu⧁u⦵uΩu⦾u⦻u‾u⧀uŌuōuωuΟuοu⦶u𝕆u𝕠u⦷u⦹u⩔u∨u⩝uℴ�ª�ºu⊶u⩖u⩗u⩛u𝒪�Ø�øu⊘�Õ�õu⨷u⨶�Ö�öu⌽u⏞u⎴u⏜�¶u⫳u⫽u∂uПuп�%�.u‰u‱u𝔓u𝔭uΦuφuϕu☎uΠuπuϖuℎ�+u⨣u⨢u⨥u⩲�±u⨦u⨧u⨕uℙu𝕡�£u⪻u≺u⪷u≼u⪳u⪯u≾u⪹u⪵u⋨u″u′u∏u⌮u⌒u⌓u∝u⊰u𝒫u𝓅uΨuψu u𝔔u𝔮uℚu𝕢u⁗u𝒬u𝓆u⨖�?�"u⇛u∽̱uŔuŕu√u⦳u⟫u⟩u⦒u⦥�»u↠u→u⥵u⇥u⤠u⤳u⤞u⥅u⥴u⤖u↣u↝u⤜u⤚u∶u❳�}�]u⦌u⦎u⦐uŘuřuŖuŗu⌉uРuрu⤷u⥩u↳uℜuℛuℝu▭u⥽u⌋u𝔯u⥤u⇀u⥬uΡuρuϱu⇄u⟧u⥝u⥕u⇉u⊢u⥛u⋌u⊳u⧐u⊵u⥏u⥜u↾u⥔u⥓u˚u‏u⎱u⫮u⟭u⇾u⦆u𝕣u⨮u⨵u⥰�)u⦔u⨒u›u𝓇u↱u⋊u▹u⧎u⧴u⥨u℞uŚuśu⪼u≻u⪸uŠušu≽u⪴u⪰uŞuşuŜuŝu⪺u⪶u⋩u⨓u≿uСuсu⋅u⩦u⇘�§�;u⤩u✶u𝔖u𝔰u♯uЩuщuШuшu↑�­uΣuσuςu∼u⩪u≃u⪞u⪠u⪝u⪟u≆u⨤u⥲u⨳u⧤u⌣u⪪u⪬u⪬︀uЬuь�/u⧄u⌿u𝕊u𝕤u♠u⊓u⊓︀u⊔u⊔︀u⊏u⊑u⊐u⊒u□u𝒮u𝓈u⋆u☆u⋐u⊂u⪽u⫅u⊆u⫃u⫁u⫋u⊊u⪿u⥹u⫇u⫕u⫓u∑u♪�¹�²�³u⋑u⊃u⪾u⫘u⫆u⊇u⫄u⟉u⫗u⥻u⫂u⫌u⊋u⫀u⫈u⫔u⫖u⇙u⤪�ß�	u⌖uΤuτuŤuťuŢuţuТuтu⃛u⌕u𝔗u𝔱u∴uΘuθuϑu  u �Þ�þ�×u⨱u⨰u⌶u⫱u𝕋u𝕥u⫚u‴u™u▵u≜u◬u⨺u⨹u⧍u⨻u⏢u𝒯u𝓉uЦuцuЋuћuŦuŧ�Ú�úu↟u⥉uЎuўuŬuŭ�Û�ûuУuуu⇅uŰuűu⥮u⥾u𝔘u𝔲�Ù�ùu⥣u▀u⌜u⌏u◸uŪuūu⏟u⏝u⊎uŲuųu𝕌u𝕦u⤒u↕uϒuυuΥu⇈u⌝u⌎uŮuůu◹u𝒰u𝓊u⋰uŨuũ�Ü�üu⦧u⦜u⊊︀u⫋︀u⊋︀u⫌︀u⫫u⫨u⫩uВuвu⊫u⊩u⫦u⊻u≚u⋮u‖�|u❘u≀u𝔙u𝔳u𝕍u𝕧u𝒱u𝓋u⊪u⦚uŴuŵu⩟u≙u℘u𝔚u𝔴u𝕎u𝕨u𝒲u𝓌u𝔛u𝔵uΞuξu⋻u𝕏u𝕩u𝒳u𝓍�Ý�ýuЯuяuŶuŷuЫuы�¥u𝔜u𝔶uЇuїu𝕐u𝕪u𝒴u𝓎uЮuю�ÿuŸuŹuźuŽužuЗuзuŻużuℨuΖuζu𝔷uЖuжu⇝u𝕫u𝒵u𝓏u‍u‌(�rjr�zAacute;zaacute;zAbreve;zabreve;zac;zacd;zacE;rkr�zAcirc;zacirc;r�zacute;zAcy;zacy;rir�zAElig;zaelig;zaf;zAfr;zafr;rlr�zAgrave;zagrave;zalefsym;zaleph;zAlpha;zalpha;zAmacr;zamacr;zamalg;ZAMPr�zAMP;zamp;zAnd;zand;zandand;zandd;z	andslope;zandv;zang;zange;zangle;zangmsd;z	angmsdaa;z	angmsdab;z	angmsdac;z	angmsdad;z	angmsdae;z	angmsdaf;z	angmsdag;z	angmsdah;zangrt;zangrtvb;z	angrtvbd;zangsph;zangst;zangzarr;zAogon;zaogon;zAopf;zaopf;zap;zapacir;zapE;zape;zapid;zapos;zApplyFunction;zapprox;z	approxeq;rmr�zAring;zaring;zAscr;zascr;zAssign;zast;zasymp;zasympeq;rnr�zAtilde;zatilde;ror�zAuml;zauml;z	awconint;zawint;z	backcong;zbackepsilon;z
backprime;zbacksim;z
backsimeq;z
Backslash;zBarv;zbarvee;zBarwed;zbarwed;z	barwedge;zbbrk;z	bbrktbrk;zbcong;zBcy;zbcy;zbdquo;zbecaus;zBecause;zbecause;zbemptyv;zbepsi;zbernou;zBernoullis;zBeta;zbeta;zbeth;zbetween;zBfr;zbfr;zbigcap;zbigcirc;zbigcup;zbigodot;z	bigoplus;z
bigotimes;z	bigsqcup;zbigstar;zbigtriangledown;zbigtriangleup;z	biguplus;zbigvee;z	bigwedge;zbkarow;z
blacklozenge;zblacksquare;zblacktriangle;zblacktriangledown;zblacktriangleleft;zblacktriangleright;zblank;zblk12;zblk14;zblk34;zblock;zbne;zbnequiv;zbNot;zbnot;zBopf;zbopf;zbot;zbottom;zbowtie;zboxbox;zboxDL;zboxDl;zboxdL;zboxdl;zboxDR;zboxDr;zboxdR;zboxdr;zboxH;zboxh;zboxHD;zboxHd;zboxhD;zboxhd;zboxHU;zboxHu;zboxhU;zboxhu;z	boxminus;zboxplus;z	boxtimes;zboxUL;zboxUl;zboxuL;zboxul;zboxUR;zboxUr;zboxuR;zboxur;zboxV;zboxv;zboxVH;zboxVh;zboxvH;zboxvh;zboxVL;zboxVl;zboxvL;zboxvl;zboxVR;zboxVr;zboxvR;zboxvr;zbprime;zBreve;zbreve;r�zbrvbar;zBscr;zbscr;zbsemi;zbsim;zbsime;zbsol;zbsolb;z	bsolhsub;zbull;zbullet;zbump;zbumpE;zbumpe;zBumpeq;zbumpeq;zCacute;zcacute;zCap;zcap;zcapand;z	capbrcup;zcapcap;zcapcup;zcapdot;zCapitalDifferentialD;zcaps;zcaret;zcaron;zCayleys;zccaps;zCcaron;zccaron;rpr�zCcedil;zccedil;zCcirc;zccirc;zCconint;zccups;zccupssm;zCdot;zcdot;r�zcedil;zCedilla;zcemptyv;r�zcent;z
CenterDot;z
centerdot;zCfr;zcfr;zCHcy;zchcy;zcheck;z
checkmark;zChi;zchi;zcir;zcirc;zcirceq;zcirclearrowleft;zcirclearrowright;zcircledast;zcircledcirc;zcircleddash;z
CircleDot;z	circledR;z	circledS;zCircleMinus;zCirclePlus;zCircleTimes;zcirE;zcire;z	cirfnint;zcirmid;zcirscir;zClockwiseContourIntegral;zCloseCurlyDoubleQuote;zCloseCurlyQuote;zclubs;z	clubsuit;zColon;zcolon;zColone;zcolone;zcoloneq;zcomma;zcommat;zcomp;zcompfn;zcomplement;z
complexes;zcong;zcongdot;z
Congruent;zConint;zconint;zContourIntegral;zCopf;zcopf;zcoprod;z
Coproduct;ZCOPYr�zCOPY;zcopy;zcopysr;z CounterClockwiseContourIntegral;zcrarr;zCross;zcross;zCscr;zcscr;zcsub;zcsube;zcsup;zcsupe;zctdot;zcudarrl;zcudarrr;zcuepr;zcuesc;zcularr;zcularrp;zCup;zcup;z	cupbrcap;zCupCap;zcupcap;zcupcup;zcupdot;zcupor;zcups;zcurarr;zcurarrm;zcurlyeqprec;zcurlyeqsucc;z	curlyvee;zcurlywedge;r�zcurren;zcurvearrowleft;zcurvearrowright;zcuvee;zcuwed;z	cwconint;zcwint;zcylcty;zDagger;zdagger;zdaleth;zDarr;zdArr;zdarr;zdash;zDashv;zdashv;zdbkarow;zdblac;zDcaron;zdcaron;zDcy;zdcy;zDD;zdd;zddagger;zddarr;z	DDotrahd;zddotseq;r�zdeg;zDel;zDelta;zdelta;zdemptyv;zdfisht;zDfr;zdfr;zdHar;zdharl;zdharr;zDiacriticalAcute;zDiacriticalDot;zDiacriticalDoubleAcute;zDiacriticalGrave;zDiacriticalTilde;zdiam;zDiamond;zdiamond;zdiamondsuit;zdiams;zdie;zDifferentialD;zdigamma;zdisin;zdiv;r�zdivide;zdivideontimes;zdivonx;zDJcy;zdjcy;zdlcorn;zdlcrop;zdollar;zDopf;zdopf;zDot;zdot;zDotDot;zdoteq;z	doteqdot;z	DotEqual;z	dotminus;zdotplus;z
dotsquare;zdoublebarwedge;zDoubleContourIntegral;z
DoubleDot;zDoubleDownArrow;zDoubleLeftArrow;zDoubleLeftRightArrow;zDoubleLeftTee;zDoubleLongLeftArrow;zDoubleLongLeftRightArrow;zDoubleLongRightArrow;zDoubleRightArrow;zDoubleRightTee;zDoubleUpArrow;zDoubleUpDownArrow;zDoubleVerticalBar;z
DownArrow;z
Downarrow;z
downarrow;z
DownArrowBar;zDownArrowUpArrow;z
DownBreve;zdowndownarrows;zdownharpoonleft;zdownharpoonright;zDownLeftRightVector;zDownLeftTeeVector;zDownLeftVector;zDownLeftVectorBar;zDownRightTeeVector;zDownRightVector;zDownRightVectorBar;zDownTee;z
DownTeeArrow;z	drbkarow;zdrcorn;zdrcrop;zDscr;zdscr;zDScy;zdscy;zdsol;zDstrok;zdstrok;zdtdot;zdtri;zdtrif;zduarr;zduhar;zdwangle;zDZcy;zdzcy;z	dzigrarr;rrr�zEacute;zeacute;zeaster;zEcaron;zecaron;zecir;rsr�zEcirc;zecirc;zecolon;zEcy;zecy;zeDDot;zEdot;zeDot;zedot;zee;zefDot;zEfr;zefr;zeg;rtr�zEgrave;zegrave;zegs;zegsdot;zel;zElement;z	elinters;zell;zels;zelsdot;zEmacr;zemacr;zempty;z	emptyset;zEmptySmallSquare;zemptyv;zEmptyVerySmallSquare;zemsp13;zemsp14;zemsp;zENG;zeng;zensp;zEogon;zeogon;zEopf;zeopf;zepar;zeparsl;zeplus;zepsi;zEpsilon;zepsilon;zepsiv;zeqcirc;zeqcolon;zeqsim;zeqslantgtr;zeqslantless;zEqual;zequals;zEqualTilde;zequest;zEquilibrium;zequiv;zequivDD;z	eqvparsl;zerarr;zerDot;zEscr;zescr;zesdot;zEsim;zesim;zEta;zeta;rqr�zETH;zeth;rur�zEuml;zeuml;zeuro;zexcl;zexist;zExists;zexpectation;z
ExponentialE;z
exponentiale;zfallingdotseq;zFcy;zfcy;zfemale;zffilig;zfflig;zffllig;zFfr;zffr;zfilig;zFilledSmallSquare;zFilledVerySmallSquare;zfjlig;zflat;zfllig;zfltns;zfnof;zFopf;zfopf;zForAll;zforall;zfork;zforkv;zFouriertrf;z	fpartint;r�zfrac12;zfrac13;r�zfrac14;zfrac15;zfrac16;zfrac18;zfrac23;zfrac25;r�zfrac34;zfrac35;zfrac38;zfrac45;zfrac56;zfrac58;zfrac78;zfrasl;zfrown;zFscr;zfscr;zgacute;zGamma;zgamma;zGammad;zgammad;zgap;zGbreve;zgbreve;zGcedil;zGcirc;zgcirc;zGcy;zgcy;zGdot;zgdot;zgE;zge;zgEl;zgel;zgeq;zgeqq;z	geqslant;zges;zgescc;zgesdot;zgesdoto;z	gesdotol;zgesl;zgesles;zGfr;zgfr;zGg;zgg;zggg;zgimel;zGJcy;zgjcy;zgl;zgla;zglE;zglj;zgnap;z	gnapprox;zgnE;zgne;zgneq;zgneqq;zgnsim;zGopf;zgopf;zgrave;z
GreaterEqual;zGreaterEqualLess;zGreaterFullEqual;zGreaterGreater;zGreaterLess;zGreaterSlantEqual;z
GreaterTilde;zGscr;zgscr;zgsim;zgsime;zgsiml;ZGTr�zGT;zGt;zgt;zgtcc;zgtcir;zgtdot;zgtlPar;zgtquest;z
gtrapprox;zgtrarr;zgtrdot;z
gtreqless;zgtreqqless;zgtrless;zgtrsim;z
gvertneqq;zgvnE;zHacek;zhairsp;zhalf;zhamilt;zHARDcy;zhardcy;zhArr;zharr;zharrcir;zharrw;zHat;zhbar;zHcirc;zhcirc;zhearts;z
heartsuit;zhellip;zhercon;zHfr;zhfr;z
HilbertSpace;z	hksearow;z	hkswarow;zhoarr;zhomtht;zhookleftarrow;zhookrightarrow;zHopf;zhopf;zhorbar;zHorizontalLine;zHscr;zhscr;zhslash;zHstrok;zhstrok;z
HumpDownHump;z
HumpEqual;zhybull;zhyphen;rvr�zIacute;ziacute;zic;rwr�zIcirc;zicirc;zIcy;zicy;zIdot;zIEcy;ziecy;r�ziexcl;ziff;zIfr;zifr;rxr�zIgrave;zigrave;zii;ziiiint;ziiint;ziinfin;ziiota;zIJlig;zijlig;zIm;zImacr;zimacr;zimage;zImaginaryI;z	imagline;z	imagpart;zimath;zimof;zimped;zImplies;zin;zincare;zinfin;z	infintie;zinodot;zInt;zint;zintcal;z	integers;z	Integral;z	intercal;z
Intersection;z	intlarhk;zintprod;zInvisibleComma;zInvisibleTimes;zIOcy;ziocy;zIogon;ziogon;zIopf;ziopf;zIota;ziota;ziprod;r�ziquest;zIscr;ziscr;zisin;zisindot;zisinE;zisins;zisinsv;zisinv;zit;zItilde;zitilde;zIukcy;ziukcy;ryr�zIuml;ziuml;zJcirc;zjcirc;zJcy;zjcy;zJfr;zjfr;zjmath;zJopf;zjopf;zJscr;zjscr;zJsercy;zjsercy;zJukcy;zjukcy;zKappa;zkappa;zkappav;zKcedil;zkcedil;zKcy;zkcy;zKfr;zkfr;zkgreen;zKHcy;zkhcy;zKJcy;zkjcy;zKopf;zkopf;zKscr;zkscr;zlAarr;zLacute;zlacute;z	laemptyv;zlagran;zLambda;zlambda;zLang;zlang;zlangd;zlangle;zlap;zLaplacetrf;r�zlaquo;zLarr;zlArr;zlarr;zlarrb;zlarrbfs;zlarrfs;zlarrhk;zlarrlp;zlarrpl;zlarrsim;zlarrtl;zlat;zlAtail;zlatail;zlate;zlates;zlBarr;zlbarr;zlbbrk;zlbrace;zlbrack;zlbrke;zlbrksld;zlbrkslu;zLcaron;zlcaron;zLcedil;zlcedil;zlceil;zlcub;zLcy;zlcy;zldca;zldquo;zldquor;zldrdhar;z	ldrushar;zldsh;zlE;zle;zLeftAngleBracket;z
LeftArrow;z
Leftarrow;z
leftarrow;z
LeftArrowBar;zLeftArrowRightArrow;zleftarrowtail;zLeftCeiling;zLeftDoubleBracket;zLeftDownTeeVector;zLeftDownVector;zLeftDownVectorBar;z
LeftFloor;zleftharpoondown;zleftharpoonup;zleftleftarrows;zLeftRightArrow;zLeftrightarrow;zleftrightarrow;zleftrightarrows;zleftrightharpoons;zleftrightsquigarrow;zLeftRightVector;zLeftTee;z
LeftTeeArrow;zLeftTeeVector;zleftthreetimes;z
LeftTriangle;zLeftTriangleBar;zLeftTriangleEqual;zLeftUpDownVector;zLeftUpTeeVector;z
LeftUpVector;zLeftUpVectorBar;zLeftVector;zLeftVectorBar;zlEg;zleg;zleq;zleqq;z	leqslant;zles;zlescc;zlesdot;zlesdoto;z	lesdotor;zlesg;zlesges;zlessapprox;zlessdot;z
lesseqgtr;zlesseqqgtr;zLessEqualGreater;zLessFullEqual;zLessGreater;zlessgtr;z	LessLess;zlesssim;zLessSlantEqual;z
LessTilde;zlfisht;zlfloor;zLfr;zlfr;zlg;zlgE;zlHar;zlhard;zlharu;zlharul;zlhblk;zLJcy;zljcy;zLl;zll;zllarr;z	llcorner;zLleftarrow;zllhard;zlltri;zLmidot;zlmidot;zlmoust;zlmoustache;zlnap;z	lnapprox;zlnE;zlne;zlneq;zlneqq;zlnsim;zloang;zloarr;zlobrk;zLongLeftArrow;zLongleftarrow;zlongleftarrow;zLongLeftRightArrow;zLongleftrightarrow;zlongleftrightarrow;zlongmapsto;zLongRightArrow;zLongrightarrow;zlongrightarrow;zlooparrowleft;zlooparrowright;zlopar;zLopf;zlopf;zloplus;zlotimes;zlowast;zlowbar;zLowerLeftArrow;zLowerRightArrow;zloz;zlozenge;zlozf;zlpar;zlparlt;zlrarr;z	lrcorner;zlrhar;zlrhard;zlrm;zlrtri;zlsaquo;zLscr;zlscr;zLsh;zlsh;zlsim;zlsime;zlsimg;zlsqb;zlsquo;zlsquor;zLstrok;zlstrok;ZLTr�zLT;zLt;zlt;zltcc;zltcir;zltdot;zlthree;zltimes;zltlarr;zltquest;zltri;zltrie;zltrif;zltrPar;z	lurdshar;zluruhar;z
lvertneqq;zlvnE;r�zmacr;zmale;zmalt;zmaltese;zMap;zmap;zmapsto;zmapstodown;zmapstoleft;z	mapstoup;zmarker;zmcomma;zMcy;zmcy;zmdash;zmDDot;zmeasuredangle;zMediumSpace;z
Mellintrf;zMfr;zmfr;zmho;r�zmicro;zmid;zmidast;zmidcir;r�zmiddot;zminus;zminusb;zminusd;zminusdu;z
MinusPlus;zmlcp;zmldr;zmnplus;zmodels;zMopf;zmopf;zmp;zMscr;zmscr;zmstpos;zMu;zmu;z	multimap;zmumap;znabla;zNacute;znacute;znang;znap;znapE;znapid;znapos;znapprox;znatur;znatural;z	naturals;r�znbsp;znbump;znbumpe;zncap;zNcaron;zncaron;zNcedil;zncedil;zncong;z	ncongdot;zncup;zNcy;zncy;zndash;zne;znearhk;zneArr;znearr;znearrow;znedot;zNegativeMediumSpace;zNegativeThickSpace;zNegativeThinSpace;zNegativeVeryThinSpace;znequiv;znesear;znesim;zNestedGreaterGreater;zNestedLessLess;zNewLine;znexist;znexists;zNfr;znfr;zngE;znge;zngeq;zngeqq;z
ngeqslant;znges;znGg;zngsim;znGt;zngt;zngtr;znGtv;znhArr;znharr;znhpar;zni;znis;znisd;zniv;zNJcy;znjcy;znlArr;znlarr;znldr;znlE;znle;znLeftarrow;znleftarrow;znLeftrightarrow;znleftrightarrow;znleq;znleqq;z
nleqslant;znles;znless;znLl;znlsim;znLt;znlt;znltri;znltrie;znLtv;znmid;zNoBreak;zNonBreakingSpace;zNopf;znopf;r�zNot;znot;z
NotCongruent;z
NotCupCap;zNotDoubleVerticalBar;zNotElement;z	NotEqual;zNotEqualTilde;z
NotExists;zNotGreater;zNotGreaterEqual;zNotGreaterFullEqual;zNotGreaterGreater;zNotGreaterLess;zNotGreaterSlantEqual;zNotGreaterTilde;zNotHumpDownHump;z
NotHumpEqual;znotin;z	notindot;znotinE;znotinva;znotinvb;znotinvc;zNotLeftTriangle;zNotLeftTriangleBar;zNotLeftTriangleEqual;zNotLess;z
NotLessEqual;zNotLessGreater;zNotLessLess;zNotLessSlantEqual;z
NotLessTilde;zNotNestedGreaterGreater;zNotNestedLessLess;znotni;znotniva;znotnivb;znotnivc;zNotPrecedes;zNotPrecedesEqual;zNotPrecedesSlantEqual;zNotReverseElement;zNotRightTriangle;zNotRightTriangleBar;zNotRightTriangleEqual;zNotSquareSubset;zNotSquareSubsetEqual;zNotSquareSuperset;zNotSquareSupersetEqual;z
NotSubset;zNotSubsetEqual;zNotSucceeds;zNotSucceedsEqual;zNotSucceedsSlantEqual;zNotSucceedsTilde;zNotSuperset;zNotSupersetEqual;z	NotTilde;zNotTildeEqual;zNotTildeFullEqual;zNotTildeTilde;zNotVerticalBar;znpar;z
nparallel;znparsl;znpart;znpolint;znpr;znprcue;znpre;znprec;znpreceq;znrArr;znrarr;znrarrc;znrarrw;znRightarrow;znrightarrow;znrtri;znrtrie;znsc;znsccue;znsce;zNscr;znscr;z
nshortmid;znshortparallel;znsim;znsime;znsimeq;znsmid;znspar;znsqsube;znsqsupe;znsub;znsubE;znsube;znsubset;z
nsubseteq;znsubseteqq;znsucc;znsucceq;znsup;znsupE;znsupe;znsupset;z
nsupseteq;znsupseteqq;zntgl;rzr�zNtilde;zntilde;zntlg;zntriangleleft;zntrianglelefteq;zntriangleright;zntrianglerighteq;zNu;znu;znum;znumero;znumsp;znvap;znVDash;znVdash;znvDash;znvdash;znvge;znvgt;znvHarr;znvinfin;znvlArr;znvle;znvlt;znvltrie;znvrArr;znvrtrie;znvsim;znwarhk;znwArr;znwarr;znwarrow;znwnear;r{r�zOacute;zoacute;zoast;zocir;r|r�zOcirc;zocirc;zOcy;zocy;zodash;zOdblac;zodblac;zodiv;zodot;zodsold;zOElig;zoelig;zofcir;zOfr;zofr;zogon;r}r�zOgrave;zograve;zogt;zohbar;zohm;zoint;zolarr;zolcir;zolcross;zoline;zolt;zOmacr;zomacr;zOmega;zomega;zOmicron;zomicron;zomid;zominus;zOopf;zoopf;zopar;zOpenCurlyDoubleQuote;zOpenCurlyQuote;zoperp;zoplus;zOr;zor;zorarr;zord;zorder;zorderof;r�zordf;r�zordm;zorigof;zoror;zorslope;zorv;zoS;zOscr;zoscr;r~r�zOslash;zoslash;zosol;rr�zOtilde;zotilde;zOtimes;zotimes;z	otimesas;r�r�zOuml;zouml;zovbar;zOverBar;z
OverBrace;zOverBracket;zOverParenthesis;zpar;r�zpara;z	parallel;zparsim;zparsl;zpart;z	PartialD;zPcy;zpcy;zpercnt;zperiod;zpermil;zperp;zpertenk;zPfr;zpfr;zPhi;zphi;zphiv;zphmmat;zphone;zPi;zpi;z
pitchfork;zpiv;zplanck;zplanckh;zplankv;zplus;z	plusacir;zplusb;zpluscir;zplusdo;zplusdu;zpluse;z
PlusMinus;r�zplusmn;zplussim;zplustwo;zpm;zPoincareplane;z	pointint;zPopf;zpopf;r�zpound;zPr;zpr;zprap;zprcue;zprE;zpre;zprec;zprecapprox;zpreccurlyeq;z	Precedes;zPrecedesEqual;zPrecedesSlantEqual;zPrecedesTilde;zpreceq;zprecnapprox;z	precneqq;z	precnsim;zprecsim;zPrime;zprime;zprimes;zprnap;zprnE;zprnsim;zprod;zProduct;z	profalar;z	profline;z	profsurf;zprop;zProportion;z
Proportional;zpropto;zprsim;zprurel;zPscr;zpscr;zPsi;zpsi;zpuncsp;zQfr;zqfr;zqint;zQopf;zqopf;zqprime;zQscr;zqscr;zquaternions;zquatint;zquest;zquesteq;ZQUOTr�zQUOT;zquot;zrAarr;zrace;zRacute;zracute;zradic;z	raemptyv;zRang;zrang;zrangd;zrange;zrangle;r�zraquo;zRarr;zrArr;zrarr;zrarrap;zrarrb;zrarrbfs;zrarrc;zrarrfs;zrarrhk;zrarrlp;zrarrpl;zrarrsim;zRarrtl;zrarrtl;zrarrw;zrAtail;zratail;zratio;z
rationals;zRBarr;zrBarr;zrbarr;zrbbrk;zrbrace;zrbrack;zrbrke;zrbrksld;zrbrkslu;zRcaron;zrcaron;zRcedil;zrcedil;zrceil;zrcub;zRcy;zrcy;zrdca;zrdldhar;zrdquo;zrdquor;zrdsh;zRe;zreal;zrealine;z	realpart;zreals;zrect;ZREGr�zREG;zreg;zReverseElement;zReverseEquilibrium;zReverseUpEquilibrium;zrfisht;zrfloor;zRfr;zrfr;zrHar;zrhard;zrharu;zrharul;zRho;zrho;zrhov;zRightAngleBracket;zRightArrow;zRightarrow;zrightarrow;zRightArrowBar;zRightArrowLeftArrow;zrightarrowtail;z
RightCeiling;zRightDoubleBracket;zRightDownTeeVector;zRightDownVector;zRightDownVectorBar;zRightFloor;zrightharpoondown;zrightharpoonup;zrightleftarrows;zrightleftharpoons;zrightrightarrows;zrightsquigarrow;z	RightTee;zRightTeeArrow;zRightTeeVector;zrightthreetimes;zRightTriangle;zRightTriangleBar;zRightTriangleEqual;zRightUpDownVector;zRightUpTeeVector;zRightUpVector;zRightUpVectorBar;zRightVector;zRightVectorBar;zring;z
risingdotseq;zrlarr;zrlhar;zrlm;zrmoust;zrmoustache;zrnmid;zroang;zroarr;zrobrk;zropar;zRopf;zropf;zroplus;zrotimes;z
RoundImplies;zrpar;zrpargt;z	rppolint;zrrarr;zRrightarrow;zrsaquo;zRscr;zrscr;zRsh;zrsh;zrsqb;zrsquo;zrsquor;zrthree;zrtimes;zrtri;zrtrie;zrtrif;z	rtriltri;zRuleDelayed;zruluhar;zrx;zSacute;zsacute;zsbquo;zSc;zsc;zscap;zScaron;zscaron;zsccue;zscE;zsce;zScedil;zscedil;zScirc;zscirc;zscnap;zscnE;zscnsim;z	scpolint;zscsim;zScy;zscy;zsdot;zsdotb;zsdote;zsearhk;zseArr;zsearr;zsearrow;r�zsect;zsemi;zseswar;z	setminus;zsetmn;zsext;zSfr;zsfr;zsfrown;zsharp;zSHCHcy;zshchcy;zSHcy;zshcy;zShortDownArrow;zShortLeftArrow;z	shortmid;zshortparallel;zShortRightArrow;z
ShortUpArrow;r�zshy;zSigma;zsigma;zsigmaf;zsigmav;zsim;zsimdot;zsime;zsimeq;zsimg;zsimgE;zsiml;zsimlE;zsimne;zsimplus;zsimrarr;zslarr;zSmallCircle;zsmallsetminus;zsmashp;z	smeparsl;zsmid;zsmile;zsmt;zsmte;zsmtes;zSOFTcy;zsoftcy;zsol;zsolb;zsolbar;zSopf;zsopf;zspades;z
spadesuit;zspar;zsqcap;zsqcaps;zsqcup;zsqcups;zSqrt;zsqsub;zsqsube;z	sqsubset;zsqsubseteq;zsqsup;zsqsupe;z	sqsupset;zsqsupseteq;zsqu;zSquare;zsquare;zSquareIntersection;z
SquareSubset;zSquareSubsetEqual;zSquareSuperset;zSquareSupersetEqual;zSquareUnion;zsquarf;zsquf;zsrarr;zSscr;zsscr;zssetmn;zssmile;zsstarf;zStar;zstar;zstarf;zstraightepsilon;zstraightphi;zstrns;zSub;zsub;zsubdot;zsubE;zsube;zsubedot;zsubmult;zsubnE;zsubne;zsubplus;zsubrarr;zSubset;zsubset;z	subseteq;z
subseteqq;zSubsetEqual;z
subsetneq;zsubsetneqq;zsubsim;zsubsub;zsubsup;zsucc;zsuccapprox;zsucccurlyeq;z	Succeeds;zSucceedsEqual;zSucceedsSlantEqual;zSucceedsTilde;zsucceq;zsuccnapprox;z	succneqq;z	succnsim;zsuccsim;z	SuchThat;zSum;zsum;zsung;r�zsup1;r�zsup2;r�zsup3;zSup;zsup;zsupdot;zsupdsub;zsupE;zsupe;zsupedot;z	Superset;zSupersetEqual;zsuphsol;zsuphsub;zsuplarr;zsupmult;zsupnE;zsupne;zsupplus;zSupset;zsupset;z	supseteq;z
supseteqq;z
supsetneq;zsupsetneqq;zsupsim;zsupsub;zsupsup;zswarhk;zswArr;zswarr;zswarrow;zswnwar;r�zszlig;zTab;ztarget;zTau;ztau;ztbrk;zTcaron;ztcaron;zTcedil;ztcedil;zTcy;ztcy;ztdot;ztelrec;zTfr;ztfr;zthere4;z
Therefore;z
therefore;zTheta;ztheta;z	thetasym;zthetav;zthickapprox;z	thicksim;zThickSpace;zthinsp;z
ThinSpace;zthkap;zthksim;r�r�zTHORN;zthorn;zTilde;ztilde;zTildeEqual;zTildeFullEqual;zTildeTilde;r�ztimes;ztimesb;z	timesbar;ztimesd;ztint;ztoea;ztop;ztopbot;ztopcir;zTopf;ztopf;ztopfork;ztosa;ztprime;zTRADE;ztrade;z	triangle;z
triangledown;z
triangleleft;ztrianglelefteq;z
triangleq;ztriangleright;ztrianglerighteq;ztridot;ztrie;z	triminus;z
TripleDot;ztriplus;ztrisb;ztritime;z	trpezium;zTscr;ztscr;zTScy;ztscy;zTSHcy;ztshcy;zTstrok;ztstrok;ztwixt;ztwoheadleftarrow;ztwoheadrightarrow;r�r�zUacute;zuacute;zUarr;zuArr;zuarr;z	Uarrocir;zUbrcy;zubrcy;zUbreve;zubreve;r�r�zUcirc;zucirc;zUcy;zucy;zudarr;zUdblac;zudblac;zudhar;zufisht;zUfr;zufr;r�r�zUgrave;zugrave;zuHar;zuharl;zuharr;zuhblk;zulcorn;z	ulcorner;zulcrop;zultri;zUmacr;zumacr;r�zuml;z	UnderBar;zUnderBrace;z
UnderBracket;zUnderParenthesis;zUnion;z
UnionPlus;zUogon;zuogon;zUopf;zuopf;zUpArrow;zUparrow;zuparrow;zUpArrowBar;zUpArrowDownArrow;zUpDownArrow;zUpdownarrow;zupdownarrow;zUpEquilibrium;zupharpoonleft;zupharpoonright;zuplus;zUpperLeftArrow;zUpperRightArrow;zUpsi;zupsi;zupsih;zUpsilon;zupsilon;zUpTee;zUpTeeArrow;zupuparrows;zurcorn;z	urcorner;zurcrop;zUring;zuring;zurtri;zUscr;zuscr;zutdot;zUtilde;zutilde;zutri;zutrif;zuuarr;r�r�zUuml;zuuml;zuwangle;zvangrt;zvarepsilon;z	varkappa;zvarnothing;zvarphi;zvarpi;z
varpropto;zvArr;zvarr;zvarrho;z	varsigma;z
varsubsetneq;zvarsubsetneqq;z
varsupsetneq;zvarsupsetneqq;z	vartheta;zvartriangleleft;zvartriangleright;zVbar;zvBar;zvBarv;zVcy;zvcy;zVDash;zVdash;zvDash;zvdash;zVdashl;zVee;zvee;zveebar;zveeeq;zvellip;zVerbar;zverbar;zVert;zvert;zVerticalBar;z
VerticalLine;zVerticalSeparator;zVerticalTilde;zVeryThinSpace;zVfr;zvfr;zvltri;zvnsub;zvnsup;zVopf;zvopf;zvprop;zvrtri;zVscr;zvscr;zvsubnE;zvsubne;zvsupnE;zvsupne;zVvdash;zvzigzag;zWcirc;zwcirc;zwedbar;zWedge;zwedge;zwedgeq;zweierp;zWfr;zwfr;zWopf;zwopf;zwp;zwr;zwreath;zWscr;zwscr;zxcap;zxcirc;zxcup;zxdtri;zXfr;zxfr;zxhArr;zxharr;zXi;zxi;zxlArr;zxlarr;zxmap;zxnis;zxodot;zXopf;zxopf;zxoplus;zxotime;zxrArr;zxrarr;zXscr;zxscr;zxsqcup;zxuplus;zxutri;zxvee;zxwedge;r�r�zYacute;zyacute;zYAcy;zyacy;zYcirc;zycirc;zYcy;zycy;r�zyen;zYfr;zyfr;zYIcy;zyicy;zYopf;zyopf;zYscr;zyscr;zYUcy;zyucy;r�zYuml;zyuml;zZacute;zzacute;zZcaron;zzcaron;zZcy;zzcy;zZdot;zzdot;zzeetrf;zZeroWidthSpace;zZeta;zzeta;zZfr;zzfr;zZHcy;zzhcy;zzigrarr;zZopf;zzopf;zZscr;zzscr;zzwj;zzwnj;N)	�__all__rrrr�items�nameZ	codepoint�chr�r_r_�%/usr/lib64/python3.8/html/entities.py�<module>s���������������������
Lhtml/__pycache__/parser.cpython-38.opt-1.pyc000064400000025034151153537530014617 0ustar00U

e5d9E�@s�dZddlZddlZddlZddlmZdgZe�d�Ze�d�Z	e�d�Z
e�d�Ze�d	�Ze�d
�Z
e�d�Ze�d�Ze�d
�Ze�dej�Ze�d
�Ze�d�ZGdd�dej�ZdS)zA parser for HTML and XHTML.�N)�unescape�
HTMLParserz[&<]z
&[a-zA-Z#]z%&([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]z)&#(?:[0-9]+|[xX][0-9a-fA-F]+)[^0-9a-fA-F]z	<[a-zA-Z]�>z--\s*>z+([a-zA-Z][^\t\n\r\f />\x00]*)(?:\s|/(?!>))*z]((?<=[\'"\s/])[^\s/>][^\s/=>]*)(\s*=+\s*(\'[^\']*\'|"[^"]*"|(?![\'"])[^>\s]*))?(?:\s|/(?!>))*aF
  <[a-zA-Z][^\t\n\r\f />\x00]*       # tag name
  (?:[\s/]*                          # optional whitespace before attribute name
    (?:(?<=['"\s/])[^\s/>][^\s/=>]*  # attribute name
      (?:\s*=+\s*                    # value indicator
        (?:'[^']*'                   # LITA-enclosed value
          |"[^"]*"                   # LIT-enclosed value
          |(?!['"])[^>\s]*           # bare value
         )
        \s*                          # possibly followed by a space
       )?(?:\s|/(?!>))*
     )*
   )?
  \s*                                # trailing whitespace
z#</\s*([a-zA-Z][-.a-zA-Z0-9:_]*)\s*>c@s�eZdZdZdZdd�dd�Zdd�Zd	d
�Zdd�Zd
Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zd9dd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd
S):raEFind tags and other markup and call handler functions.

    Usage:
        p = HTMLParser()
        p.feed(data)
        ...
        p.close()

    Start tags are handled by calling self.handle_starttag() or
    self.handle_startendtag(); end tags by self.handle_endtag().  The
    data between tags is passed from the parser to the derived class
    by calling self.handle_data() with the data as argument (the data
    may be split up in arbitrary chunks).  If convert_charrefs is
    True the character references are converted automatically to the
    corresponding Unicode character (and self.handle_data() is no
    longer split in chunks), otherwise they are passed by calling
    self.handle_entityref() or self.handle_charref() with the string
    containing respectively the named or numeric reference as the
    argument.
    )ZscriptZstyleT)�convert_charrefscCs||_|��dS)z�Initialize and reset this instance.

        If convert_charrefs is True (the default), all character references
        are automatically converted to the corresponding Unicode characters.
        N)r�reset)�selfr�r�#/usr/lib64/python3.8/html/parser.py�__init__WszHTMLParser.__init__cCs(d|_d|_t|_d|_tj�|�dS)z1Reset this instance.  Loses all unprocessed data.�z???N)�rawdata�lasttag�interesting_normal�interesting�
cdata_elem�_markupbase�
ParserBaser�rrrr	r`s
zHTMLParser.resetcCs|j||_|�d�dS)z�Feed data to the parser.

        Call this as often as you want, with as little or as much text
        as you want (may include '\n').
        rN)r�goahead�r�datarrr	�feedhszHTMLParser.feedcCs|�d�dS)zHandle any buffered data.�N)rrrrr	�closeqszHTMLParser.closeNcCs|jS)z)Return full source of start tag: '<...>'.)�_HTMLParser__starttag_textrrrr	�get_starttag_textwszHTMLParser.get_starttag_textcCs$|��|_t�d|jtj�|_dS)Nz</\s*%s\s*>)�lowerr�re�compile�Ir)r�elemrrr	�set_cdata_mode{s
zHTMLParser.set_cdata_modecCst|_d|_dS�N)rrrrrrr	�clear_cdata_modeszHTMLParser.clear_cdata_modecCsJ|j}d}t|�}||k�r�|jrv|jsv|�d|�}|dkr�|�dt||d��}|dkrpt�d��	||�sp�q�|}n*|j
�	||�}|r�|��}n|jr��q�|}||kr�|jr�|js�|�t
|||���n|�|||��|�||�}||kr��q�|j}|d|��rJt�||��r"|�|�}	n�|d|��r:|�|�}	nn|d|��rR|�|�}	nV|d|��rj|�|�}	n>|d	|��r�|�|�}	n&|d
|k�r�|�d�|d
}	n�q�|	dk�r<|�s��q�|�d|d
�}	|	dk�r�|�d|d
�}	|	dk�r|d
}	n|	d
7}	|j�r*|j�s*|�t
|||	���n|�|||	��|�||	�}q|d|��r�t�||�}|�r�|��d
d�}
|�|
�|��}	|d|	d
��s�|	d
}	|�||	�}qn<d||d�k�r�|�|||d
��|�||d
�}�q�q|d|�rt�||�}|�rN|�d
�}
|�|
�|��}	|d|	d
��s@|	d
}	|�||	�}qt�||�}|�r�|�r�|��||d�k�r�|��}	|	|k�r�|}	|�||d
�}�q�n.|d
|k�r�|�d�|�||d
�}n�q�qq|�r8||k�r8|j�s8|j�r|j�s|�t
|||���n|�|||��|�||�}||d�|_dS)Nr�<�&�"z[\s;]z</�<!--z<?z<!rrz&#�����;)r�lenrr�find�rfind�maxrr�searchr�start�handle_datarZ	updatepos�
startswith�starttagopen�match�parse_starttag�parse_endtag�
parse_comment�parse_pi�parse_html_declaration�charref�group�handle_charref�end�	entityref�handle_entityref�
incomplete)rr=r�i�n�jZampposr4r2�k�namerrr	r�s�
�












zHTMLParser.goaheadcCs�|j}|||d�dkr$|�|�S|||d�dkrB|�|�S|||d���dkr�|�d|d�}|dkrvdS|�||d	|��|d
S|�|�SdS)N�r'�z<![�	z	<!doctyperr)r(r)rr7Zparse_marked_sectionrr,�handle_decl�parse_bogus_comment)rrAr�gtposrrr	r9s

z!HTMLParser.parse_html_declarationrcCsD|j}|�d|d�}|dkr"dS|r<|�||d|��|dS)Nrr(r)r)rr,�handle_comment)rrAZreportr�posrrr	rJszHTMLParser.parse_bogus_commentcCsH|j}t�||d�}|sdS|��}|�||d|��|��}|S)Nr(r))r�picloser/r0�	handle_pir=)rrArr4rCrrr	r8!szHTMLParser.parse_picCs�d|_|�|�}|dkr|S|j}|||�|_g}t�||d�}|��}|�d���|_}||k�r t	�||�}|s~�q |�ddd�\}	}
}|
s�d}nZ|dd�dkr�|dd�ks�n|dd�dkr�|dd�kr�nn|dd�}|�rt
|�}|�|	��|f�|��}q`|||���}|dk�r�|�
�\}
}d	|jk�rz|
|j�d	�}
t|j�|j�d	�}n|t|j�}|�|||��|S|�d
��r�|�||�n"|�||�||jk�r�|�|�|S)Nrrr(rG�'r)�")r�/>�
rR)r�check_for_whole_start_tagr�tagfind_tolerantr4r=r;rr
�attrfind_tolerantr�append�stripZgetpos�countr+r-r1�endswith�handle_startendtag�handle_starttag�CDATA_CONTENT_ELEMENTSr!)rrA�endposr�attrsr4rD�tag�m�attrname�restZ	attrvaluer=�lineno�offsetrrr	r5-sZ

&
�
�



�
zHTMLParser.parse_starttagcCs�|j}t�||�}|r�|��}|||d�}|dkr>|dS|dkr~|�d|�rZ|dS|�d|�rjdS||krv|S|dS|dkr�dS|dkr�dS||kr�|S|dStd	��dS)
Nrr�/rRr(r)rz6abcdefghijklmnopqrstuvwxyz=/ABCDEFGHIJKLMNOPQRSTUVWXYZzwe should not get here!)r�locatestarttagend_tolerantr4r=r2�AssertionError)rrArrarC�nextrrr	rT`s.z$HTMLParser.check_for_whole_start_tagcCs|j}t�||d�}|sdS|��}t�||�}|s�|jdk	rV|�|||��|St�||d�}|s�|||d�dkr�|dS|�	|�S|�
d���}|�d|���}|�
|�|dS|�
d���}|jdk	r�||jkr�|�|||��|S|�
|�|��|S)Nrr)r(rGz</>r)r�	endendtagr/r=�
endtagfindr4rr1rUrJr;rr,�
handle_endtagr#)rrArr4rKZ	namematchZtagnamer rrr	r6�s6





zHTMLParser.parse_endtagcCs|�||�|�|�dSr")r\rl�rr`r_rrr	r[�szHTMLParser.handle_startendtagcCsdSr"rrmrrr	r\�szHTMLParser.handle_starttagcCsdSr"r)rr`rrr	rl�szHTMLParser.handle_endtagcCsdSr"r�rrErrr	r<�szHTMLParser.handle_charrefcCsdSr"rrnrrr	r?�szHTMLParser.handle_entityrefcCsdSr"rrrrr	r1�szHTMLParser.handle_datacCsdSr"rrrrr	rL�szHTMLParser.handle_commentcCsdSr"r)rZdeclrrr	rI�szHTMLParser.handle_declcCsdSr"rrrrr	rO�szHTMLParser.handle_picCsdSr"rrrrr	�unknown_decl�szHTMLParser.unknown_declcCstjdtdd�t|�S)NzZThe unescape method is deprecated and will be removed in 3.5, use html.unescape() instead.r()�
stacklevel)�warnings�warn�DeprecationWarningr)r�srrr	r�s
�zHTMLParser.unescape)r)�__name__�
__module__�__qualname__�__doc__r]r
rrrrrr!r#rr9rJr8r5rTr6r[r\rlr<r?r1rLrIrOrorrrrr	r?s8		z
3"()rxrrqrZhtmlr�__all__rrr@r>r:r3rNZcommentcloserUrV�VERBOSErgrjrkrrrrrr	�<module>s,








��

html/__pycache__/entities.cpython-38.opt-1.pyc000064400000142543151153537530015154 0ustar00U

e5d3&��@s2%dZddddgZddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d��Z�d�d�d�d�d�d�d�d�d�d	�d
�d	�d
�d�d�d�d
�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d �d!�d"�d#�d"�d$�d%�d&�d'�d(�d)�d*�d+�d,�d-�d.�d/�d0�d1�d2�d3�d4�d5�d6�d7�d8�d9�d:�d;�d<�d�d7�d:�d1�d=�d1�d=�d>�d?�d@�dA�d7�dB�dC�dD�dC�dD�dE�dF�dE�dF�dG�dH�dI�dJ�dK�dL�dM�dN�dO�dP�dQ�dR�dR�dS�dT�dI�dU�dV�dW�dX�dX�dX�dY�dJ�dZ�dZ�d[�d\�d]�d^�d_�d`�da�db�dc�dd�de�df�dg�dh�di�dj�dk�dl�dm�dn�do�dp�dq�dr�ds�dt�du�dv�dw�dx�dy�dz�d{�d|�d}�d~�d�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��dK�d��d��d��d��dZ�d��d��dL�dM�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��ddÐdĐdŐdƐdǐdȐdɐdʐdːdʐdːd̐d͐dΐdϐdАdѐdҐdӐdӐdӐdԐdՐdՐd֐d֐dƐdאdؐdِdڐdڐdېdܐdݐdސdߐd�d�d�d�d�d�d�d�d�d�d�d�dߐd�d�d�d�d�d�d�d�d�d�d��d@�d@�d��d��d��d��d��d��d��d��d��d��d��d��d��d�d�d�d�d�d�d�d�dG�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�d�dB�d�d�d�d�d�d�d�d�d�d�d�d �d �d�d�d�d�d�d!�d"�d#�d$�d%�d&�d'�d(�d)�d*�d+�d,�d-�d.�d/�d0�d1�dd2�d#�d3�d4�d5�d6�d6�d7�d8�d9�d:�d;�d<�d=�d>�d?�d@�d�dA�d-�dB�dC�dD�dD�dD�dE�dE�dF�d2�dG�dH�dI�dI�dI�dJ�dJ�dK�dL�dM�dN�dO�dP�dQ�dF�dA�dR�dS�dT�dS�dU�dV�dW�dQ�d��dF�d'�dX�dY�d*�dZ�d[�d\�d]�d^�d_�d`�da�d(�d'�d(�db�dc�dd�d3�d?�d@�de�df�dg�dh�di�dj�dk�dl�dm�dn�do�dp�dq�dr�ds�dt�du�dv�dw�dx�dy�dr�dc�dz�d{�d|�d}�d~�d�d��d�d��d��d��d��d��d��d��d��d��d��d��d��d5�d��dT�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��dS�d��d��d��d��d��d��d��d��d��d��d��d��ddÐdĐdĐd��d��d��d��dŐdƐdǐdȐdɐdʐdːd̐d͐dΐdp�dϐdАdѐdҐdӐdԐdՐd֐d֐dאdؐdِdڐdېdېdܐdݐdݐdސdߐd�d�d�d�d�d�d�d�d�d�d�d�d�dِd�d�d�d�d�dG�d�d�d�d�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d�d�d�d�d�d�d�d�d�d	�d�d
�d�d�d
�d�d�d�d�d�d�d�d�d�d�d�d�dB�d��d��d��d�d
�d��d�d�d�d�d�d�d�d�d�d	�d�d�d�d �d!�d"�d�d#�d �d��d��d
�d�d$�d$�dŐd%�dېd&�d'�d(�dY�d)�d*�d+�d,�d-�d.�d/�d0�d0�d1�d2�d3�d4�d&�d5�d6�d7�d8�d9�d:�d;�d<�d=�d��d&�d>�d-�d?�d@�d��d��dA�d)�dB�dC�dB�dC�dD�dE�dF�dE�dF�dG�dH�dI�dJ�dK�dL�dL�dY�dM�dN�dO�dP�dO�dP�dQ�dR�dS�dT�dU�dV�dW�dM�dX�dY�dM�dQ�dZ�dM�d[�d\�d]�d]�d��d^�d_�d`�d[�da�db�dc�dd�db�dc�da�de�df�dD�dg�dh�di�dj�dk�dl�dm�dn�do�df�dp�dp�dZ�dq�d��dr�ds�dt�du�d��dg�dv�dw�dx�dy�dz�d{�dz�d{�d|�d}�d~�d�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��dX�d��d��d��d��d9�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��ddÐd��dĐdŐdƐdǐdW�dȐdɐdʐdːd̐d��d��dX�d��d��d͐d��dÐdΐdϐd?�dАdѐdg�dҐdӐd)�dY�d)�d͐dԐd+�dՐd+�d֐dאdؐdِdڐdېdܐdݐdސdߐdҐd�d�d�d̐dːd�d�d�d�d�d�d�d�d��d�d�d�d�dːd�d�d�d�d�d�d�dѐd�d�d�d�d�dg�dҐd�d�d��d��d��d��dӐdM�d��d��d��d��d��d��d��d��d��d��d�d�d��d�d�d�dΐd�dZ�d�d�d[�d�d�d�d\�d�d��d�d	�d
�d�d�d
�d�d�d�d�d�d�do�d�d�d͐do�dԐd�d�d�d�d��d�d�d�d�d�d�d��d�d�d�d �d!�d!�d!�d��d!�d"�d#�d�dؐd$�d%�d&�d'�dېds�d(�d)�d*�d+�d+�d,�d,�d-�d.�d.�d/�d0�d0�dm�d֐d1�d2�d3�d4�d5�d6�d7�d$�d8�d9�d:�d;�d<�d=�d=�d>�dA�d?�d֐d֐d@�d��dU�dA�dB�dC�d1�dB�dD�dE�dF�dB�d9�dG�d�dH�dI�dJ�dJ�d7�dK�dL�dM�dN�dO�dP�dQ�dN�dR�dR�dS�dT�dT�dU�dV�dW�dX�dY�dZ�d[�d\�d]�d^�d_�d`�da�db�dc�dd�de�de�df�dg�dg�dg�dg�dh�di�dj�d	�d��dk�dl�dl�dm�dn�do�dp�dp�do�dq�dq�dr�ds�dt�du�du�dv�dw�dx�dy�dz�d{�d|�dz�d}�d~�d�d��d��d��d��d�d��dw�dx�d��d��d��d��d��d��d��d��d��d��d��d��d��d��dT�dS�d��d��d��d��dh�d��d��d��db�dj�dl�du�dp�do�dv�d��dq�ds�dU�dV�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d\�dN�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��dd��dd��d��d��d��d��dÐdĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐dאdؐdِdڐdڐdېdܐdݐdܐdݐd�d�dސdߐdސdߐd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d��d��d�d��d��d��d��d�d��d��d��dǐd�d��d�d��d�d�d�d�d�d�d�d�d�d�d�d�d�d�d	�d�d
�d�d
�d�d�d
�d�d
�d�d�d�d�d�d�d�d�d�d�d�d�d�da�d�d�da�d�d�d�d�d�d�d�d�d�d��d �d!�d"�d#�d$�d%�d9�d&�d'�d(�dאd)�d-�d*�d-�d+�d,�d��d-�dV�d.�d/�d0�d0�d0�d1�d2�d0�d3�d3�d4�d5�d6�d6�d7�d8�d9�d:�d;�d<�d8�d9�d:�d8�d<�d:�d=�d<�d>�d?�d@�d=�dA�dB�d4�d>�d?�d@�dC�dC�dD�dE�dF�dG�d�dG�dG�d=�dH�dI�dJ�dK�dL�dM�dN�dO�dR�dP�dQ�dR�dS�dT�d;�dU�dV�d��dW�dW�dW�dW�dX�dY�dZ�d[�d\�d]�d^�d_�d`�da�d_�db�db�dc�d]�dd�de�df�dg�dh�di�d:�d�dj�dk�dl�dm�dn�do�dp�dq�dP�dn�d,�dn�dr�ds�dt�du�dv�dw�dx�dy�dz�d{�d|�ds�d}�d~�d�d��d�d�d��d��d��d��d��d��d��d�d�d�d�dz�dԐdz�d��d��d��d��d��dj�d��d��d��d��d��d_�dd�d]�dd�df�d��dm�d|�d��d��d@�d��d��dj�d��d��d��d��dn�d��d0�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��dX�d��d��d��d��d��dt�d�d�d��d��d��d��dt�d��d��d��d��d��d��d�d��d��d��d��d��d��d��d��d��d��ddÐdĐdŐdƐdǐdȐdɐdʐdːdW�d̐d5�d͐d�d�dΐdΐdϐdАdN�dN�dѐdҐdӐd�dԐdՐd֐dאdؐd(�d��d>�da�dd�dِdڐdڐdېdܐdݐdݐdސdߐd�d�d�d�d�d�d�d�d�d��d��dN�d�d�d>�d�d�d�d�d�d�d�d�d�d�d�d��d��da�d��d��d��d��d\�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��dp�dp�dd�d��d�dN�d�d�d�d�dh�d��d%�d,�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d
�d�d�d�d��d��d��d��d��d��dȐd��dĐdŐdƐdȐdz�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d �d!�d"�d#�d�d�d�d�d"�d!�d$�d%�d&�d6�d'�d�d�d(�d)�d)�d*�d+�d,�d-�d�d.�d/�d0�d1�d2�d3�d4�d5�d6�d7�d8�d8�d8�d9�d:�d;�d;�d7�dސd<�d=�d=�d7�dސd>�d?�d>�d?�dސdC�d�d��d7�d@�d@�d��dA�dB�dS�di�dl�dC�dD�dE�dF�dG�dАdH�dI�dI�dJ�dy�d'�dېdK�d��d��dL�dK�dM�d4�dN�dO�dP�dQ�dR�dS�dT�dU�dV�dW�dX�dY�d^�d��dc�dZ�d[�dZ�d[�d\�d_�dِd]�d^�d_�d`�da�db�dc�db�dc�dd�de�df�dg�dh�di�dj�dk�dl�dm�dn�dm�dn�do�dސd��dp�dq�dq�dr�ds�dt�du�dF�dF�d�dv�dS�dw�dc�dx�dy�dz�d{�d|�dِd_�dِd}�df�d~�d`�d~�di�dސd��dx�dڐde�d�d��d�d��d��d��d1�d��d��d��d��d��d��d��d��d��d��d��d��dJ�dq�d��d��d��d��d��d��d��d��d��d��d%�d)�dG�d`�d~�d��dݐd��d��d��d��d;�dِd��d��d��d��d��d��d��d��d^�d��d��dl�d�d��d��d��d��d��d��d��d>�d��d��d��d%�d��d��dِd��d��d��d��dG�d��d��d��d��d��d��d��d��d��d��d��d��dm�d�d��d��d��d��d��d��d��d��d��d��d��da�db�dc�di�d��d��d[�d�d��d��dZ�d�d�d��dd�d��d��de�df�d\�d�d��d��dg�dk�dj�dl�dm�d��d��d��d��ddÐdĐdŐdƐdǐdȐdȐdɐdʐdːd̐d͐dΐdϐdАdѐdҐdӐdԐdӐdՐd֐dאdؐdِdڐdېdܐdݐdg�dސdߐdݐd�d�d�d�dd�d�d�d�d�d�d���ZiZiZe��D]\ZZeee<e	e�ee<�%q[[�d�S(�z!HTML character entity references.�html5�name2codepoint�codepoint2name�
entitydefs������i�������i���i�i! i���������i�i���i�������i���i�i�i���i�iR������i�i�������i�i�i3 i�i�i`i���i�i�������i���i���ixi����������i5!i��&i'"i "��iH"����i i��i" i)"����i�i�ic&iE"�i�!i*"�i�!i  i�!�i�if&�������i"i i i�ia"i�����i� i"i�i"���iD i�ie"�>i�!i�!ie&i& �������i!i"i+"i��i"��i�i�!i�i)#�i�!i#i id"i
#i"i�%i i9 i �<�i ��i"i�i"�i i`"i"�i	"i�"��i�����iS��i> i�i�i�"i("����i�"��i"i0 i�"i�i�i���i2 i"i"i��"i�!i"i*#�i�!i	#i i!�i#i�i i: i i iai�"��i�i�i<"i`&i�"i�"i"i�"���i�"��i�i4"i�i�i	 �i���i"!i�!�i�!���i�i��i!i����i�i
 i )��AElig�Aacute�Acirc�AgraveZAlpha�Aring�Atilde�AumlZBeta�CcedilZChiZDaggerZDelta�ETH�Eacute�Ecirc�EgraveZEpsilonZEta�EumlZGamma�Iacute�Icirc�IgraveZIota�IumlZKappaZLambdaZMu�NtildeZNuZOElig�Oacute�Ocirc�OgraveZOmegaZOmicron�Oslash�Otilde�OumlZPhiZPiZPrimeZPsiZRhoZScaronZSigma�THORNZTauZTheta�Uacute�Ucirc�UgraveZUpsilon�UumlZXi�YacuteZYumlZZeta�aacute�acirc�acute�aelig�agraveZalefsymZalpha�amp�andZang�aringZasymp�atilde�aumlZbdquoZbeta�brvbarZbullZcap�ccedil�cedil�centZchiZcircZclubsZcong�copyZcrarrZcup�currenZdArrZdaggerZdarr�degZdeltaZdiams�divide�eacute�ecirc�egrave�emptyZemspZensp�epsilonZequivZeta�eth�eumlZeuroZexistZfnofZforall�frac12�frac14�frac34ZfraslZgamma�ge�gtZhArrZharrZheartsZhellip�iacute�icirc�iexcl�igraveZimageZinfin�intZiota�iquestZisin�iumlZkappaZlArr�lambdaZlang�laquoZlarrZlceilZldquo�leZlfloorZlowastZlozZlrmZlsaquoZlsquo�lt�macrZmdash�micro�middotZminusZmuZnabla�nbspZndash�neZni�notZnotinZnsub�ntildeZnu�oacute�ocircZoelig�ograveZolineZomegaZomicronZoplus�or�ordf�ordm�oslash�otildeZotimes�ouml�para�partZpermilZperpZphiZpiZpiv�plusmn�poundZprimeZprodZpropZpsi�quotZrArrZradicZrang�raquoZrarrZrceilZrdquo�real�regZrfloorZrhoZrlmZrsaquoZrsquoZsbquoZscaronZsdot�sect�shyZsigmaZsigmafZsimZspades�subZsube�sumZsup�sup1�sup2�sup3Zsupe�szligZtauZthere4ZthetaZthetasymZthinsp�thorn�tilde�timesZtradeZuArr�uacuteZuarr�ucirc�ugrave�umlZupsihZupsilon�uumlZweierpZxi�yacute�yen�yumlZzetaZzwjZzwnj�Á�áuĂuău∾u∿u∾̳�Â�â�´uАuа�Æ�æu⁡u𝔄u𝔞�À�àuℵuΑuαuĀuāu⨿�&u⩓u∧u⩕u⩜u⩘u⩚u∠u⦤u∡u⦨u⦩u⦪u⦫u⦬u⦭u⦮u⦯u∟u⊾u⦝u∢�Åu⍼uĄuąu𝔸u𝕒u≈u⩯u⩰u≊u≋�'�åu𝒜u𝒶u≔�*u≍�Ã�ã�Ä�äu∳u⨑u≌u϶u‵u∽u⋍u∖u⫧u⊽u⌆u⌅u⎵u⎶uБuбu„u∵u⦰uℬuΒuβuℶu≬u𝔅u𝔟u⋂u◯u⋃u⨀u⨁u⨂u⨆u★u▽u△u⨄u⋁u⋀u⤍u⧫u▪u▴u▾u◂u▸u␣u▒u░u▓u█u=⃥u≡⃥u⫭u⌐u𝔹u𝕓u⊥u⋈u⧉u╗u╖u╕u┐u╔u╓u╒u┌u═u─u╦u╤u╥u┬u╩u╧u╨u┴u⊟u⊞u⊠u╝u╜u╛u┘u╚u╙u╘u└u║u│u╬u╫u╪u┼u╣u╢u╡u┤u╠u╟u╞u├u˘�¦u𝒷u⁏�\u⧅u⟈u•u≎u⪮u≏uĆuću⋒u∩u⩄u⩉u⩋u⩇u⩀uⅅu∩︀u⁁uˇuℭu⩍uČuč�Ç�çuĈuĉu∰u⩌u⩐uĊuċ�¸u⦲�¢�·u𝔠uЧuчu✓uΧuχu○uˆu≗u↺u↻u⊛u⊚u⊝u⊙�®uⓈu⊖u⊕u⊗u⧃u⨐u⫯u⧂u∲u”u’u♣u∷�:u⩴�,�@u∁u∘uℂu≅u⩭u≡u∯u∮u𝕔u∐�©u℗u↵u⨯u✗u𝒞u𝒸u⫏u⫑u⫐u⫒u⋯u⤸u⤵u⋞u⋟u↶u⤽u⋓u∪u⩈u⩆u⩊u⊍u⩅u∪︀u↷u⤼u⋎u⋏�¤u∱u⌭u‡u†uℸu↡u⇓u↓u‐u⫤u⊣u⤏u˝uĎuďuДuдuⅆu⇊u⤑u⩷�°u∇uΔuδu⦱u⥿u𝔇u𝔡u⥥u⇃u⇂u˙�`u˜u⋄u♦�¨uϝu⋲�÷u⋇uЂuђu⌞u⌍�$u𝔻u𝕕u⃜u≐u≑u∸u∔u⊡u⇐u⇔u⟸u⟺u⟹u⇒u⊨u⇑u⇕u∥u⤓u⇵ȗu⥐u⥞u↽u⥖u⥟u⇁u⥗u⊤u↧u⤐u⌟u⌌u𝒟u𝒹uЅuѕu⧶uĐuđu⋱u▿u⥯u⦦uЏuџu⟿�É�éu⩮uĚuěu≖�Ê�êu≕uЭuэuĖuėuⅇu≒u𝔈u𝔢u⪚�È�èu⪖u⪘u⪙u∈u⏧uℓu⪕u⪗uĒuēu∅u◻u▫u u u uŊuŋu uĘuęu𝔼u𝕖u⋕u⧣u⩱uεuΕuϵu≂u⩵�=u≟u⇌u⩸u⧥u⥱u≓uℰuℯu⩳uΗuη�Ð�ð�Ë�ëu€�!u∃uФuфu♀uffiuffufflu𝔉u𝔣ufiu◼Zfju♭uflu▱uƒu𝔽u𝕗u∀u⋔u⫙uℱu⨍�½u⅓�¼u⅕u⅙u⅛u⅔u⅖�¾u⅗u⅜u⅘u⅚u⅝u⅞u⁄u⌢u𝒻uǵuΓuγuϜu⪆uĞuğuĢuĜuĝuГuгuĠuġu≧u≥u⪌u⋛u⩾u⪩u⪀u⪂u⪄u⋛︀u⪔u𝔊u𝔤u⋙u≫uℷuЃuѓu≷u⪥u⪒u⪤u⪊u≩u⪈u⋧u𝔾u𝕘u⪢u≳u𝒢uℊu⪎u⪐�>u⪧u⩺u⋗u⦕u⩼u⥸u≩︀u uℋuЪuъu↔u⥈u↭�^uℏuĤuĥu♥u…u⊹uℌu𝔥u⤥u⤦u⇿u∻u↩u↪uℍu𝕙u―u𝒽uĦuħu⁃�Í�íu⁣�Î�îuИuиuİuЕuе�¡uℑu𝔦�Ì�ìuⅈu⨌u∭u⧜u℩uIJuijuĪuīuℐuıu⊷uƵu℅u∞u⧝u∬u∫u⊺uℤu⨗u⨼u⁢uЁuёuĮuįu𝕀u𝕚uΙuι�¿u𝒾u⋵u⋹u⋴u⋳uĨuĩuІuі�Ï�ïuĴuĵuЙuйu𝔍u𝔧uȷu𝕁u𝕛u𝒥u𝒿uЈuјuЄuєuΚuκuϰuĶuķuКuкu𝔎u𝔨uĸuХuхuЌuќu𝕂u𝕜u𝒦u𝓀u⇚uĹuĺu⦴uℒuΛuλu⟪u⟨u⦑u⪅�«u↞u←u⇤u⤟u⤝u↫u⤹u⥳u↢u⪫u⤛u⤙u⪭u⪭︀u⤎u⤌u❲�{�[u⦋u⦏u⦍uĽuľuĻuļu⌈uЛuлu⤶u“u⥧u⥋u↲u≦u≤u⇆u⟦u⥡u⥙u⌊u↼u⇇u⇋u⥎u↤u⥚u⋋u⊲u⧏u⊴u⥑u⥠u↿u⥘u⥒u⪋u⋚u⩽u⪨u⩿u⪁u⪃u⋚︀u⪓u⋖u≶u⪡u≲u⥼u𝔏u𝔩u⪑u⥢u⥪u▄uЉuљu⋘u≪u⥫u◺uĿuŀu⎰u⪉u≨u⪇u⋦u⟬u⇽u⟵u⟷u⟼u⟶u↬u⦅u𝕃u𝕝u⨭u⨴u∗�_u↙u↘u◊�(u⦓u⥭u‎u⊿u‹u𝓁u↰u⪍u⪏u‘u‚uŁuł�<u⪦u⩹u⋉u⥶u⩻u◃u⦖u⥊u⥦u≨︀�¯u♂u✠u⤅u↦u↥u▮u⨩uМuмu—u∺u uℳu𝔐u𝔪u℧�µu∣u⫰u−u⨪u∓u⫛u⊧u𝕄u𝕞u𝓂uΜuμu⊸uŃuńu∠⃒u≉u⩰̸u≋̸uʼnu♮uℕ� u≎̸u≏̸u⩃uŇuňuŅuņu≇u⩭̸u⩂uНuнu–u≠u⤤u⇗u↗u≐̸u​u≢u⤨u≂̸�
u∄u𝔑u𝔫u≧̸u≱u⩾̸u⋙̸u≵u≫⃒u≯u≫̸u⇎u↮u⫲u∋u⋼u⋺uЊuњu⇍u↚u‥u≦̸u≰u⩽̸u≮u⋘̸u≴u≪⃒u⋪u⋬u≪̸u∤u⁠u𝕟�¬u⫬u≭u∦u∉u≹u⋵̸u⋹̸u⋷u⋶u⧏̸u≸u⪢̸u⪡̸u∌u⋾u⋽u⊀u⪯̸u⋠u⋫u⧐̸u⋭u⊏̸u⋢u⊐̸u⋣u⊂⃒u⊈u⊁u⪰̸u⋡u≿̸u⊃⃒u⊉u≁u≄u⫽⃥u∂̸u⨔u⇏u↛u⤳̸u↝̸u𝒩u𝓃u⊄u⫅̸u⊅u⫆̸�Ñ�ñuΝuν�#u№u u≍⃒u⊯u⊮u⊭u⊬u≥⃒u>⃒u⤄u⧞u⤂u≤⃒u<⃒u⊴⃒u⤃u⊵⃒u∼⃒u⤣u⇖u↖u⤧�Ó�ó�Ô�ôuОuоuŐuőu⨸u⦼uŒuœu⦿u𝔒u𝔬u˛�Ò�òu⧁u⦵uΩu⦾u⦻u‾u⧀uŌuōuωuΟuοu⦶u𝕆u𝕠u⦷u⦹u⩔u∨u⩝uℴ�ª�ºu⊶u⩖u⩗u⩛u𝒪�Ø�øu⊘�Õ�õu⨷u⨶�Ö�öu⌽u⏞u⎴u⏜�¶u⫳u⫽u∂uПuп�%�.u‰u‱u𝔓u𝔭uΦuφuϕu☎uΠuπuϖuℎ�+u⨣u⨢u⨥u⩲�±u⨦u⨧u⨕uℙu𝕡�£u⪻u≺u⪷u≼u⪳u⪯u≾u⪹u⪵u⋨u″u′u∏u⌮u⌒u⌓u∝u⊰u𝒫u𝓅uΨuψu u𝔔u𝔮uℚu𝕢u⁗u𝒬u𝓆u⨖�?�"u⇛u∽̱uŔuŕu√u⦳u⟫u⟩u⦒u⦥�»u↠u→u⥵u⇥u⤠u⤳u⤞u⥅u⥴u⤖u↣u↝u⤜u⤚u∶u❳�}�]u⦌u⦎u⦐uŘuřuŖuŗu⌉uРuрu⤷u⥩u↳uℜuℛuℝu▭u⥽u⌋u𝔯u⥤u⇀u⥬uΡuρuϱu⇄u⟧u⥝u⥕u⇉u⊢u⥛u⋌u⊳u⧐u⊵u⥏u⥜u↾u⥔u⥓u˚u‏u⎱u⫮u⟭u⇾u⦆u𝕣u⨮u⨵u⥰�)u⦔u⨒u›u𝓇u↱u⋊u▹u⧎u⧴u⥨u℞uŚuśu⪼u≻u⪸uŠušu≽u⪴u⪰uŞuşuŜuŝu⪺u⪶u⋩u⨓u≿uСuсu⋅u⩦u⇘�§�;u⤩u✶u𝔖u𝔰u♯uЩuщuШuшu↑�­uΣuσuςu∼u⩪u≃u⪞u⪠u⪝u⪟u≆u⨤u⥲u⨳u⧤u⌣u⪪u⪬u⪬︀uЬuь�/u⧄u⌿u𝕊u𝕤u♠u⊓u⊓︀u⊔u⊔︀u⊏u⊑u⊐u⊒u□u𝒮u𝓈u⋆u☆u⋐u⊂u⪽u⫅u⊆u⫃u⫁u⫋u⊊u⪿u⥹u⫇u⫕u⫓u∑u♪�¹�²�³u⋑u⊃u⪾u⫘u⫆u⊇u⫄u⟉u⫗u⥻u⫂u⫌u⊋u⫀u⫈u⫔u⫖u⇙u⤪�ß�	u⌖uΤuτuŤuťuŢuţuТuтu⃛u⌕u𝔗u𝔱u∴uΘuθuϑu  u �Þ�þ�×u⨱u⨰u⌶u⫱u𝕋u𝕥u⫚u‴u™u▵u≜u◬u⨺u⨹u⧍u⨻u⏢u𝒯u𝓉uЦuцuЋuћuŦuŧ�Ú�úu↟u⥉uЎuўuŬuŭ�Û�ûuУuуu⇅uŰuűu⥮u⥾u𝔘u𝔲�Ù�ùu⥣u▀u⌜u⌏u◸uŪuūu⏟u⏝u⊎uŲuųu𝕌u𝕦u⤒u↕uϒuυuΥu⇈u⌝u⌎uŮuůu◹u𝒰u𝓊u⋰uŨuũ�Ü�üu⦧u⦜u⊊︀u⫋︀u⊋︀u⫌︀u⫫u⫨u⫩uВuвu⊫u⊩u⫦u⊻u≚u⋮u‖�|u❘u≀u𝔙u𝔳u𝕍u𝕧u𝒱u𝓋u⊪u⦚uŴuŵu⩟u≙u℘u𝔚u𝔴u𝕎u𝕨u𝒲u𝓌u𝔛u𝔵uΞuξu⋻u𝕏u𝕩u𝒳u𝓍�Ý�ýuЯuяuŶuŷuЫuы�¥u𝔜u𝔶uЇuїu𝕐u𝕪u𝒴u𝓎uЮuю�ÿuŸuŹuźuŽužuЗuзuŻużuℨuΖuζu𝔷uЖuжu⇝u𝕫u𝒵u𝓏u‍u‌(�rjr�zAacute;zaacute;zAbreve;zabreve;zac;zacd;zacE;rkr�zAcirc;zacirc;r�zacute;zAcy;zacy;rir�zAElig;zaelig;zaf;zAfr;zafr;rlr�zAgrave;zagrave;zalefsym;zaleph;zAlpha;zalpha;zAmacr;zamacr;zamalg;ZAMPr�zAMP;zamp;zAnd;zand;zandand;zandd;z	andslope;zandv;zang;zange;zangle;zangmsd;z	angmsdaa;z	angmsdab;z	angmsdac;z	angmsdad;z	angmsdae;z	angmsdaf;z	angmsdag;z	angmsdah;zangrt;zangrtvb;z	angrtvbd;zangsph;zangst;zangzarr;zAogon;zaogon;zAopf;zaopf;zap;zapacir;zapE;zape;zapid;zapos;zApplyFunction;zapprox;z	approxeq;rmr�zAring;zaring;zAscr;zascr;zAssign;zast;zasymp;zasympeq;rnr�zAtilde;zatilde;ror�zAuml;zauml;z	awconint;zawint;z	backcong;zbackepsilon;z
backprime;zbacksim;z
backsimeq;z
Backslash;zBarv;zbarvee;zBarwed;zbarwed;z	barwedge;zbbrk;z	bbrktbrk;zbcong;zBcy;zbcy;zbdquo;zbecaus;zBecause;zbecause;zbemptyv;zbepsi;zbernou;zBernoullis;zBeta;zbeta;zbeth;zbetween;zBfr;zbfr;zbigcap;zbigcirc;zbigcup;zbigodot;z	bigoplus;z
bigotimes;z	bigsqcup;zbigstar;zbigtriangledown;zbigtriangleup;z	biguplus;zbigvee;z	bigwedge;zbkarow;z
blacklozenge;zblacksquare;zblacktriangle;zblacktriangledown;zblacktriangleleft;zblacktriangleright;zblank;zblk12;zblk14;zblk34;zblock;zbne;zbnequiv;zbNot;zbnot;zBopf;zbopf;zbot;zbottom;zbowtie;zboxbox;zboxDL;zboxDl;zboxdL;zboxdl;zboxDR;zboxDr;zboxdR;zboxdr;zboxH;zboxh;zboxHD;zboxHd;zboxhD;zboxhd;zboxHU;zboxHu;zboxhU;zboxhu;z	boxminus;zboxplus;z	boxtimes;zboxUL;zboxUl;zboxuL;zboxul;zboxUR;zboxUr;zboxuR;zboxur;zboxV;zboxv;zboxVH;zboxVh;zboxvH;zboxvh;zboxVL;zboxVl;zboxvL;zboxvl;zboxVR;zboxVr;zboxvR;zboxvr;zbprime;zBreve;zbreve;r�zbrvbar;zBscr;zbscr;zbsemi;zbsim;zbsime;zbsol;zbsolb;z	bsolhsub;zbull;zbullet;zbump;zbumpE;zbumpe;zBumpeq;zbumpeq;zCacute;zcacute;zCap;zcap;zcapand;z	capbrcup;zcapcap;zcapcup;zcapdot;zCapitalDifferentialD;zcaps;zcaret;zcaron;zCayleys;zccaps;zCcaron;zccaron;rpr�zCcedil;zccedil;zCcirc;zccirc;zCconint;zccups;zccupssm;zCdot;zcdot;r�zcedil;zCedilla;zcemptyv;r�zcent;z
CenterDot;z
centerdot;zCfr;zcfr;zCHcy;zchcy;zcheck;z
checkmark;zChi;zchi;zcir;zcirc;zcirceq;zcirclearrowleft;zcirclearrowright;zcircledast;zcircledcirc;zcircleddash;z
CircleDot;z	circledR;z	circledS;zCircleMinus;zCirclePlus;zCircleTimes;zcirE;zcire;z	cirfnint;zcirmid;zcirscir;zClockwiseContourIntegral;zCloseCurlyDoubleQuote;zCloseCurlyQuote;zclubs;z	clubsuit;zColon;zcolon;zColone;zcolone;zcoloneq;zcomma;zcommat;zcomp;zcompfn;zcomplement;z
complexes;zcong;zcongdot;z
Congruent;zConint;zconint;zContourIntegral;zCopf;zcopf;zcoprod;z
Coproduct;ZCOPYr�zCOPY;zcopy;zcopysr;z CounterClockwiseContourIntegral;zcrarr;zCross;zcross;zCscr;zcscr;zcsub;zcsube;zcsup;zcsupe;zctdot;zcudarrl;zcudarrr;zcuepr;zcuesc;zcularr;zcularrp;zCup;zcup;z	cupbrcap;zCupCap;zcupcap;zcupcup;zcupdot;zcupor;zcups;zcurarr;zcurarrm;zcurlyeqprec;zcurlyeqsucc;z	curlyvee;zcurlywedge;r�zcurren;zcurvearrowleft;zcurvearrowright;zcuvee;zcuwed;z	cwconint;zcwint;zcylcty;zDagger;zdagger;zdaleth;zDarr;zdArr;zdarr;zdash;zDashv;zdashv;zdbkarow;zdblac;zDcaron;zdcaron;zDcy;zdcy;zDD;zdd;zddagger;zddarr;z	DDotrahd;zddotseq;r�zdeg;zDel;zDelta;zdelta;zdemptyv;zdfisht;zDfr;zdfr;zdHar;zdharl;zdharr;zDiacriticalAcute;zDiacriticalDot;zDiacriticalDoubleAcute;zDiacriticalGrave;zDiacriticalTilde;zdiam;zDiamond;zdiamond;zdiamondsuit;zdiams;zdie;zDifferentialD;zdigamma;zdisin;zdiv;r�zdivide;zdivideontimes;zdivonx;zDJcy;zdjcy;zdlcorn;zdlcrop;zdollar;zDopf;zdopf;zDot;zdot;zDotDot;zdoteq;z	doteqdot;z	DotEqual;z	dotminus;zdotplus;z
dotsquare;zdoublebarwedge;zDoubleContourIntegral;z
DoubleDot;zDoubleDownArrow;zDoubleLeftArrow;zDoubleLeftRightArrow;zDoubleLeftTee;zDoubleLongLeftArrow;zDoubleLongLeftRightArrow;zDoubleLongRightArrow;zDoubleRightArrow;zDoubleRightTee;zDoubleUpArrow;zDoubleUpDownArrow;zDoubleVerticalBar;z
DownArrow;z
Downarrow;z
downarrow;z
DownArrowBar;zDownArrowUpArrow;z
DownBreve;zdowndownarrows;zdownharpoonleft;zdownharpoonright;zDownLeftRightVector;zDownLeftTeeVector;zDownLeftVector;zDownLeftVectorBar;zDownRightTeeVector;zDownRightVector;zDownRightVectorBar;zDownTee;z
DownTeeArrow;z	drbkarow;zdrcorn;zdrcrop;zDscr;zdscr;zDScy;zdscy;zdsol;zDstrok;zdstrok;zdtdot;zdtri;zdtrif;zduarr;zduhar;zdwangle;zDZcy;zdzcy;z	dzigrarr;rrr�zEacute;zeacute;zeaster;zEcaron;zecaron;zecir;rsr�zEcirc;zecirc;zecolon;zEcy;zecy;zeDDot;zEdot;zeDot;zedot;zee;zefDot;zEfr;zefr;zeg;rtr�zEgrave;zegrave;zegs;zegsdot;zel;zElement;z	elinters;zell;zels;zelsdot;zEmacr;zemacr;zempty;z	emptyset;zEmptySmallSquare;zemptyv;zEmptyVerySmallSquare;zemsp13;zemsp14;zemsp;zENG;zeng;zensp;zEogon;zeogon;zEopf;zeopf;zepar;zeparsl;zeplus;zepsi;zEpsilon;zepsilon;zepsiv;zeqcirc;zeqcolon;zeqsim;zeqslantgtr;zeqslantless;zEqual;zequals;zEqualTilde;zequest;zEquilibrium;zequiv;zequivDD;z	eqvparsl;zerarr;zerDot;zEscr;zescr;zesdot;zEsim;zesim;zEta;zeta;rqr�zETH;zeth;rur�zEuml;zeuml;zeuro;zexcl;zexist;zExists;zexpectation;z
ExponentialE;z
exponentiale;zfallingdotseq;zFcy;zfcy;zfemale;zffilig;zfflig;zffllig;zFfr;zffr;zfilig;zFilledSmallSquare;zFilledVerySmallSquare;zfjlig;zflat;zfllig;zfltns;zfnof;zFopf;zfopf;zForAll;zforall;zfork;zforkv;zFouriertrf;z	fpartint;r�zfrac12;zfrac13;r�zfrac14;zfrac15;zfrac16;zfrac18;zfrac23;zfrac25;r�zfrac34;zfrac35;zfrac38;zfrac45;zfrac56;zfrac58;zfrac78;zfrasl;zfrown;zFscr;zfscr;zgacute;zGamma;zgamma;zGammad;zgammad;zgap;zGbreve;zgbreve;zGcedil;zGcirc;zgcirc;zGcy;zgcy;zGdot;zgdot;zgE;zge;zgEl;zgel;zgeq;zgeqq;z	geqslant;zges;zgescc;zgesdot;zgesdoto;z	gesdotol;zgesl;zgesles;zGfr;zgfr;zGg;zgg;zggg;zgimel;zGJcy;zgjcy;zgl;zgla;zglE;zglj;zgnap;z	gnapprox;zgnE;zgne;zgneq;zgneqq;zgnsim;zGopf;zgopf;zgrave;z
GreaterEqual;zGreaterEqualLess;zGreaterFullEqual;zGreaterGreater;zGreaterLess;zGreaterSlantEqual;z
GreaterTilde;zGscr;zgscr;zgsim;zgsime;zgsiml;ZGTr�zGT;zGt;zgt;zgtcc;zgtcir;zgtdot;zgtlPar;zgtquest;z
gtrapprox;zgtrarr;zgtrdot;z
gtreqless;zgtreqqless;zgtrless;zgtrsim;z
gvertneqq;zgvnE;zHacek;zhairsp;zhalf;zhamilt;zHARDcy;zhardcy;zhArr;zharr;zharrcir;zharrw;zHat;zhbar;zHcirc;zhcirc;zhearts;z
heartsuit;zhellip;zhercon;zHfr;zhfr;z
HilbertSpace;z	hksearow;z	hkswarow;zhoarr;zhomtht;zhookleftarrow;zhookrightarrow;zHopf;zhopf;zhorbar;zHorizontalLine;zHscr;zhscr;zhslash;zHstrok;zhstrok;z
HumpDownHump;z
HumpEqual;zhybull;zhyphen;rvr�zIacute;ziacute;zic;rwr�zIcirc;zicirc;zIcy;zicy;zIdot;zIEcy;ziecy;r�ziexcl;ziff;zIfr;zifr;rxr�zIgrave;zigrave;zii;ziiiint;ziiint;ziinfin;ziiota;zIJlig;zijlig;zIm;zImacr;zimacr;zimage;zImaginaryI;z	imagline;z	imagpart;zimath;zimof;zimped;zImplies;zin;zincare;zinfin;z	infintie;zinodot;zInt;zint;zintcal;z	integers;z	Integral;z	intercal;z
Intersection;z	intlarhk;zintprod;zInvisibleComma;zInvisibleTimes;zIOcy;ziocy;zIogon;ziogon;zIopf;ziopf;zIota;ziota;ziprod;r�ziquest;zIscr;ziscr;zisin;zisindot;zisinE;zisins;zisinsv;zisinv;zit;zItilde;zitilde;zIukcy;ziukcy;ryr�zIuml;ziuml;zJcirc;zjcirc;zJcy;zjcy;zJfr;zjfr;zjmath;zJopf;zjopf;zJscr;zjscr;zJsercy;zjsercy;zJukcy;zjukcy;zKappa;zkappa;zkappav;zKcedil;zkcedil;zKcy;zkcy;zKfr;zkfr;zkgreen;zKHcy;zkhcy;zKJcy;zkjcy;zKopf;zkopf;zKscr;zkscr;zlAarr;zLacute;zlacute;z	laemptyv;zlagran;zLambda;zlambda;zLang;zlang;zlangd;zlangle;zlap;zLaplacetrf;r�zlaquo;zLarr;zlArr;zlarr;zlarrb;zlarrbfs;zlarrfs;zlarrhk;zlarrlp;zlarrpl;zlarrsim;zlarrtl;zlat;zlAtail;zlatail;zlate;zlates;zlBarr;zlbarr;zlbbrk;zlbrace;zlbrack;zlbrke;zlbrksld;zlbrkslu;zLcaron;zlcaron;zLcedil;zlcedil;zlceil;zlcub;zLcy;zlcy;zldca;zldquo;zldquor;zldrdhar;z	ldrushar;zldsh;zlE;zle;zLeftAngleBracket;z
LeftArrow;z
Leftarrow;z
leftarrow;z
LeftArrowBar;zLeftArrowRightArrow;zleftarrowtail;zLeftCeiling;zLeftDoubleBracket;zLeftDownTeeVector;zLeftDownVector;zLeftDownVectorBar;z
LeftFloor;zleftharpoondown;zleftharpoonup;zleftleftarrows;zLeftRightArrow;zLeftrightarrow;zleftrightarrow;zleftrightarrows;zleftrightharpoons;zleftrightsquigarrow;zLeftRightVector;zLeftTee;z
LeftTeeArrow;zLeftTeeVector;zleftthreetimes;z
LeftTriangle;zLeftTriangleBar;zLeftTriangleEqual;zLeftUpDownVector;zLeftUpTeeVector;z
LeftUpVector;zLeftUpVectorBar;zLeftVector;zLeftVectorBar;zlEg;zleg;zleq;zleqq;z	leqslant;zles;zlescc;zlesdot;zlesdoto;z	lesdotor;zlesg;zlesges;zlessapprox;zlessdot;z
lesseqgtr;zlesseqqgtr;zLessEqualGreater;zLessFullEqual;zLessGreater;zlessgtr;z	LessLess;zlesssim;zLessSlantEqual;z
LessTilde;zlfisht;zlfloor;zLfr;zlfr;zlg;zlgE;zlHar;zlhard;zlharu;zlharul;zlhblk;zLJcy;zljcy;zLl;zll;zllarr;z	llcorner;zLleftarrow;zllhard;zlltri;zLmidot;zlmidot;zlmoust;zlmoustache;zlnap;z	lnapprox;zlnE;zlne;zlneq;zlneqq;zlnsim;zloang;zloarr;zlobrk;zLongLeftArrow;zLongleftarrow;zlongleftarrow;zLongLeftRightArrow;zLongleftrightarrow;zlongleftrightarrow;zlongmapsto;zLongRightArrow;zLongrightarrow;zlongrightarrow;zlooparrowleft;zlooparrowright;zlopar;zLopf;zlopf;zloplus;zlotimes;zlowast;zlowbar;zLowerLeftArrow;zLowerRightArrow;zloz;zlozenge;zlozf;zlpar;zlparlt;zlrarr;z	lrcorner;zlrhar;zlrhard;zlrm;zlrtri;zlsaquo;zLscr;zlscr;zLsh;zlsh;zlsim;zlsime;zlsimg;zlsqb;zlsquo;zlsquor;zLstrok;zlstrok;ZLTr�zLT;zLt;zlt;zltcc;zltcir;zltdot;zlthree;zltimes;zltlarr;zltquest;zltri;zltrie;zltrif;zltrPar;z	lurdshar;zluruhar;z
lvertneqq;zlvnE;r�zmacr;zmale;zmalt;zmaltese;zMap;zmap;zmapsto;zmapstodown;zmapstoleft;z	mapstoup;zmarker;zmcomma;zMcy;zmcy;zmdash;zmDDot;zmeasuredangle;zMediumSpace;z
Mellintrf;zMfr;zmfr;zmho;r�zmicro;zmid;zmidast;zmidcir;r�zmiddot;zminus;zminusb;zminusd;zminusdu;z
MinusPlus;zmlcp;zmldr;zmnplus;zmodels;zMopf;zmopf;zmp;zMscr;zmscr;zmstpos;zMu;zmu;z	multimap;zmumap;znabla;zNacute;znacute;znang;znap;znapE;znapid;znapos;znapprox;znatur;znatural;z	naturals;r�znbsp;znbump;znbumpe;zncap;zNcaron;zncaron;zNcedil;zncedil;zncong;z	ncongdot;zncup;zNcy;zncy;zndash;zne;znearhk;zneArr;znearr;znearrow;znedot;zNegativeMediumSpace;zNegativeThickSpace;zNegativeThinSpace;zNegativeVeryThinSpace;znequiv;znesear;znesim;zNestedGreaterGreater;zNestedLessLess;zNewLine;znexist;znexists;zNfr;znfr;zngE;znge;zngeq;zngeqq;z
ngeqslant;znges;znGg;zngsim;znGt;zngt;zngtr;znGtv;znhArr;znharr;znhpar;zni;znis;znisd;zniv;zNJcy;znjcy;znlArr;znlarr;znldr;znlE;znle;znLeftarrow;znleftarrow;znLeftrightarrow;znleftrightarrow;znleq;znleqq;z
nleqslant;znles;znless;znLl;znlsim;znLt;znlt;znltri;znltrie;znLtv;znmid;zNoBreak;zNonBreakingSpace;zNopf;znopf;r�zNot;znot;z
NotCongruent;z
NotCupCap;zNotDoubleVerticalBar;zNotElement;z	NotEqual;zNotEqualTilde;z
NotExists;zNotGreater;zNotGreaterEqual;zNotGreaterFullEqual;zNotGreaterGreater;zNotGreaterLess;zNotGreaterSlantEqual;zNotGreaterTilde;zNotHumpDownHump;z
NotHumpEqual;znotin;z	notindot;znotinE;znotinva;znotinvb;znotinvc;zNotLeftTriangle;zNotLeftTriangleBar;zNotLeftTriangleEqual;zNotLess;z
NotLessEqual;zNotLessGreater;zNotLessLess;zNotLessSlantEqual;z
NotLessTilde;zNotNestedGreaterGreater;zNotNestedLessLess;znotni;znotniva;znotnivb;znotnivc;zNotPrecedes;zNotPrecedesEqual;zNotPrecedesSlantEqual;zNotReverseElement;zNotRightTriangle;zNotRightTriangleBar;zNotRightTriangleEqual;zNotSquareSubset;zNotSquareSubsetEqual;zNotSquareSuperset;zNotSquareSupersetEqual;z
NotSubset;zNotSubsetEqual;zNotSucceeds;zNotSucceedsEqual;zNotSucceedsSlantEqual;zNotSucceedsTilde;zNotSuperset;zNotSupersetEqual;z	NotTilde;zNotTildeEqual;zNotTildeFullEqual;zNotTildeTilde;zNotVerticalBar;znpar;z
nparallel;znparsl;znpart;znpolint;znpr;znprcue;znpre;znprec;znpreceq;znrArr;znrarr;znrarrc;znrarrw;znRightarrow;znrightarrow;znrtri;znrtrie;znsc;znsccue;znsce;zNscr;znscr;z
nshortmid;znshortparallel;znsim;znsime;znsimeq;znsmid;znspar;znsqsube;znsqsupe;znsub;znsubE;znsube;znsubset;z
nsubseteq;znsubseteqq;znsucc;znsucceq;znsup;znsupE;znsupe;znsupset;z
nsupseteq;znsupseteqq;zntgl;rzr�zNtilde;zntilde;zntlg;zntriangleleft;zntrianglelefteq;zntriangleright;zntrianglerighteq;zNu;znu;znum;znumero;znumsp;znvap;znVDash;znVdash;znvDash;znvdash;znvge;znvgt;znvHarr;znvinfin;znvlArr;znvle;znvlt;znvltrie;znvrArr;znvrtrie;znvsim;znwarhk;znwArr;znwarr;znwarrow;znwnear;r{r�zOacute;zoacute;zoast;zocir;r|r�zOcirc;zocirc;zOcy;zocy;zodash;zOdblac;zodblac;zodiv;zodot;zodsold;zOElig;zoelig;zofcir;zOfr;zofr;zogon;r}r�zOgrave;zograve;zogt;zohbar;zohm;zoint;zolarr;zolcir;zolcross;zoline;zolt;zOmacr;zomacr;zOmega;zomega;zOmicron;zomicron;zomid;zominus;zOopf;zoopf;zopar;zOpenCurlyDoubleQuote;zOpenCurlyQuote;zoperp;zoplus;zOr;zor;zorarr;zord;zorder;zorderof;r�zordf;r�zordm;zorigof;zoror;zorslope;zorv;zoS;zOscr;zoscr;r~r�zOslash;zoslash;zosol;rr�zOtilde;zotilde;zOtimes;zotimes;z	otimesas;r�r�zOuml;zouml;zovbar;zOverBar;z
OverBrace;zOverBracket;zOverParenthesis;zpar;r�zpara;z	parallel;zparsim;zparsl;zpart;z	PartialD;zPcy;zpcy;zpercnt;zperiod;zpermil;zperp;zpertenk;zPfr;zpfr;zPhi;zphi;zphiv;zphmmat;zphone;zPi;zpi;z
pitchfork;zpiv;zplanck;zplanckh;zplankv;zplus;z	plusacir;zplusb;zpluscir;zplusdo;zplusdu;zpluse;z
PlusMinus;r�zplusmn;zplussim;zplustwo;zpm;zPoincareplane;z	pointint;zPopf;zpopf;r�zpound;zPr;zpr;zprap;zprcue;zprE;zpre;zprec;zprecapprox;zpreccurlyeq;z	Precedes;zPrecedesEqual;zPrecedesSlantEqual;zPrecedesTilde;zpreceq;zprecnapprox;z	precneqq;z	precnsim;zprecsim;zPrime;zprime;zprimes;zprnap;zprnE;zprnsim;zprod;zProduct;z	profalar;z	profline;z	profsurf;zprop;zProportion;z
Proportional;zpropto;zprsim;zprurel;zPscr;zpscr;zPsi;zpsi;zpuncsp;zQfr;zqfr;zqint;zQopf;zqopf;zqprime;zQscr;zqscr;zquaternions;zquatint;zquest;zquesteq;ZQUOTr�zQUOT;zquot;zrAarr;zrace;zRacute;zracute;zradic;z	raemptyv;zRang;zrang;zrangd;zrange;zrangle;r�zraquo;zRarr;zrArr;zrarr;zrarrap;zrarrb;zrarrbfs;zrarrc;zrarrfs;zrarrhk;zrarrlp;zrarrpl;zrarrsim;zRarrtl;zrarrtl;zrarrw;zrAtail;zratail;zratio;z
rationals;zRBarr;zrBarr;zrbarr;zrbbrk;zrbrace;zrbrack;zrbrke;zrbrksld;zrbrkslu;zRcaron;zrcaron;zRcedil;zrcedil;zrceil;zrcub;zRcy;zrcy;zrdca;zrdldhar;zrdquo;zrdquor;zrdsh;zRe;zreal;zrealine;z	realpart;zreals;zrect;ZREGr�zREG;zreg;zReverseElement;zReverseEquilibrium;zReverseUpEquilibrium;zrfisht;zrfloor;zRfr;zrfr;zrHar;zrhard;zrharu;zrharul;zRho;zrho;zrhov;zRightAngleBracket;zRightArrow;zRightarrow;zrightarrow;zRightArrowBar;zRightArrowLeftArrow;zrightarrowtail;z
RightCeiling;zRightDoubleBracket;zRightDownTeeVector;zRightDownVector;zRightDownVectorBar;zRightFloor;zrightharpoondown;zrightharpoonup;zrightleftarrows;zrightleftharpoons;zrightrightarrows;zrightsquigarrow;z	RightTee;zRightTeeArrow;zRightTeeVector;zrightthreetimes;zRightTriangle;zRightTriangleBar;zRightTriangleEqual;zRightUpDownVector;zRightUpTeeVector;zRightUpVector;zRightUpVectorBar;zRightVector;zRightVectorBar;zring;z
risingdotseq;zrlarr;zrlhar;zrlm;zrmoust;zrmoustache;zrnmid;zroang;zroarr;zrobrk;zropar;zRopf;zropf;zroplus;zrotimes;z
RoundImplies;zrpar;zrpargt;z	rppolint;zrrarr;zRrightarrow;zrsaquo;zRscr;zrscr;zRsh;zrsh;zrsqb;zrsquo;zrsquor;zrthree;zrtimes;zrtri;zrtrie;zrtrif;z	rtriltri;zRuleDelayed;zruluhar;zrx;zSacute;zsacute;zsbquo;zSc;zsc;zscap;zScaron;zscaron;zsccue;zscE;zsce;zScedil;zscedil;zScirc;zscirc;zscnap;zscnE;zscnsim;z	scpolint;zscsim;zScy;zscy;zsdot;zsdotb;zsdote;zsearhk;zseArr;zsearr;zsearrow;r�zsect;zsemi;zseswar;z	setminus;zsetmn;zsext;zSfr;zsfr;zsfrown;zsharp;zSHCHcy;zshchcy;zSHcy;zshcy;zShortDownArrow;zShortLeftArrow;z	shortmid;zshortparallel;zShortRightArrow;z
ShortUpArrow;r�zshy;zSigma;zsigma;zsigmaf;zsigmav;zsim;zsimdot;zsime;zsimeq;zsimg;zsimgE;zsiml;zsimlE;zsimne;zsimplus;zsimrarr;zslarr;zSmallCircle;zsmallsetminus;zsmashp;z	smeparsl;zsmid;zsmile;zsmt;zsmte;zsmtes;zSOFTcy;zsoftcy;zsol;zsolb;zsolbar;zSopf;zsopf;zspades;z
spadesuit;zspar;zsqcap;zsqcaps;zsqcup;zsqcups;zSqrt;zsqsub;zsqsube;z	sqsubset;zsqsubseteq;zsqsup;zsqsupe;z	sqsupset;zsqsupseteq;zsqu;zSquare;zsquare;zSquareIntersection;z
SquareSubset;zSquareSubsetEqual;zSquareSuperset;zSquareSupersetEqual;zSquareUnion;zsquarf;zsquf;zsrarr;zSscr;zsscr;zssetmn;zssmile;zsstarf;zStar;zstar;zstarf;zstraightepsilon;zstraightphi;zstrns;zSub;zsub;zsubdot;zsubE;zsube;zsubedot;zsubmult;zsubnE;zsubne;zsubplus;zsubrarr;zSubset;zsubset;z	subseteq;z
subseteqq;zSubsetEqual;z
subsetneq;zsubsetneqq;zsubsim;zsubsub;zsubsup;zsucc;zsuccapprox;zsucccurlyeq;z	Succeeds;zSucceedsEqual;zSucceedsSlantEqual;zSucceedsTilde;zsucceq;zsuccnapprox;z	succneqq;z	succnsim;zsuccsim;z	SuchThat;zSum;zsum;zsung;r�zsup1;r�zsup2;r�zsup3;zSup;zsup;zsupdot;zsupdsub;zsupE;zsupe;zsupedot;z	Superset;zSupersetEqual;zsuphsol;zsuphsub;zsuplarr;zsupmult;zsupnE;zsupne;zsupplus;zSupset;zsupset;z	supseteq;z
supseteqq;z
supsetneq;zsupsetneqq;zsupsim;zsupsub;zsupsup;zswarhk;zswArr;zswarr;zswarrow;zswnwar;r�zszlig;zTab;ztarget;zTau;ztau;ztbrk;zTcaron;ztcaron;zTcedil;ztcedil;zTcy;ztcy;ztdot;ztelrec;zTfr;ztfr;zthere4;z
Therefore;z
therefore;zTheta;ztheta;z	thetasym;zthetav;zthickapprox;z	thicksim;zThickSpace;zthinsp;z
ThinSpace;zthkap;zthksim;r�r�zTHORN;zthorn;zTilde;ztilde;zTildeEqual;zTildeFullEqual;zTildeTilde;r�ztimes;ztimesb;z	timesbar;ztimesd;ztint;ztoea;ztop;ztopbot;ztopcir;zTopf;ztopf;ztopfork;ztosa;ztprime;zTRADE;ztrade;z	triangle;z
triangledown;z
triangleleft;ztrianglelefteq;z
triangleq;ztriangleright;ztrianglerighteq;ztridot;ztrie;z	triminus;z
TripleDot;ztriplus;ztrisb;ztritime;z	trpezium;zTscr;ztscr;zTScy;ztscy;zTSHcy;ztshcy;zTstrok;ztstrok;ztwixt;ztwoheadleftarrow;ztwoheadrightarrow;r�r�zUacute;zuacute;zUarr;zuArr;zuarr;z	Uarrocir;zUbrcy;zubrcy;zUbreve;zubreve;r�r�zUcirc;zucirc;zUcy;zucy;zudarr;zUdblac;zudblac;zudhar;zufisht;zUfr;zufr;r�r�zUgrave;zugrave;zuHar;zuharl;zuharr;zuhblk;zulcorn;z	ulcorner;zulcrop;zultri;zUmacr;zumacr;r�zuml;z	UnderBar;zUnderBrace;z
UnderBracket;zUnderParenthesis;zUnion;z
UnionPlus;zUogon;zuogon;zUopf;zuopf;zUpArrow;zUparrow;zuparrow;zUpArrowBar;zUpArrowDownArrow;zUpDownArrow;zUpdownarrow;zupdownarrow;zUpEquilibrium;zupharpoonleft;zupharpoonright;zuplus;zUpperLeftArrow;zUpperRightArrow;zUpsi;zupsi;zupsih;zUpsilon;zupsilon;zUpTee;zUpTeeArrow;zupuparrows;zurcorn;z	urcorner;zurcrop;zUring;zuring;zurtri;zUscr;zuscr;zutdot;zUtilde;zutilde;zutri;zutrif;zuuarr;r�r�zUuml;zuuml;zuwangle;zvangrt;zvarepsilon;z	varkappa;zvarnothing;zvarphi;zvarpi;z
varpropto;zvArr;zvarr;zvarrho;z	varsigma;z
varsubsetneq;zvarsubsetneqq;z
varsupsetneq;zvarsupsetneqq;z	vartheta;zvartriangleleft;zvartriangleright;zVbar;zvBar;zvBarv;zVcy;zvcy;zVDash;zVdash;zvDash;zvdash;zVdashl;zVee;zvee;zveebar;zveeeq;zvellip;zVerbar;zverbar;zVert;zvert;zVerticalBar;z
VerticalLine;zVerticalSeparator;zVerticalTilde;zVeryThinSpace;zVfr;zvfr;zvltri;zvnsub;zvnsup;zVopf;zvopf;zvprop;zvrtri;zVscr;zvscr;zvsubnE;zvsubne;zvsupnE;zvsupne;zVvdash;zvzigzag;zWcirc;zwcirc;zwedbar;zWedge;zwedge;zwedgeq;zweierp;zWfr;zwfr;zWopf;zwopf;zwp;zwr;zwreath;zWscr;zwscr;zxcap;zxcirc;zxcup;zxdtri;zXfr;zxfr;zxhArr;zxharr;zXi;zxi;zxlArr;zxlarr;zxmap;zxnis;zxodot;zXopf;zxopf;zxoplus;zxotime;zxrArr;zxrarr;zXscr;zxscr;zxsqcup;zxuplus;zxutri;zxvee;zxwedge;r�r�zYacute;zyacute;zYAcy;zyacy;zYcirc;zycirc;zYcy;zycy;r�zyen;zYfr;zyfr;zYIcy;zyicy;zYopf;zyopf;zYscr;zyscr;zYUcy;zyucy;r�zYuml;zyuml;zZacute;zzacute;zZcaron;zzcaron;zZcy;zzcy;zZdot;zzdot;zzeetrf;zZeroWidthSpace;zZeta;zzeta;zZfr;zzfr;zZHcy;zzhcy;zzigrarr;zZopf;zzopf;zZscr;zzscr;zzwj;zzwnj;N)
�__doc__�__all__rrrr�items�nameZ	codepoint�chr�r`r`�%/usr/lib64/python3.8/html/entities.py�<module>s���������������������
Lhtml/__pycache__/entities.cpython-38.pyc000064400000142543151153537530014215 0ustar00U

e5d3&��@s2%dZddddgZddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d��Z�d�d�d�d�d�d�d�d�d�d	�d
�d	�d
�d�d�d�d
�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d �d!�d"�d#�d"�d$�d%�d&�d'�d(�d)�d*�d+�d,�d-�d.�d/�d0�d1�d2�d3�d4�d5�d6�d7�d8�d9�d:�d;�d<�d�d7�d:�d1�d=�d1�d=�d>�d?�d@�dA�d7�dB�dC�dD�dC�dD�dE�dF�dE�dF�dG�dH�dI�dJ�dK�dL�dM�dN�dO�dP�dQ�dR�dR�dS�dT�dI�dU�dV�dW�dX�dX�dX�dY�dJ�dZ�dZ�d[�d\�d]�d^�d_�d`�da�db�dc�dd�de�df�dg�dh�di�dj�dk�dl�dm�dn�do�dp�dq�dr�ds�dt�du�dv�dw�dx�dy�dz�d{�d|�d}�d~�d�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��dK�d��d��d��d��dZ�d��d��dL�dM�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��ddÐdĐdŐdƐdǐdȐdɐdʐdːdʐdːd̐d͐dΐdϐdАdѐdҐdӐdӐdӐdԐdՐdՐd֐d֐dƐdאdؐdِdڐdڐdېdܐdݐdސdߐd�d�d�d�d�d�d�d�d�d�d�d�dߐd�d�d�d�d�d�d�d�d�d�d��d@�d@�d��d��d��d��d��d��d��d��d��d��d��d��d��d�d�d�d�d�d�d�d�dG�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�d�dB�d�d�d�d�d�d�d�d�d�d�d�d �d �d�d�d�d�d�d!�d"�d#�d$�d%�d&�d'�d(�d)�d*�d+�d,�d-�d.�d/�d0�d1�dd2�d#�d3�d4�d5�d6�d6�d7�d8�d9�d:�d;�d<�d=�d>�d?�d@�d�dA�d-�dB�dC�dD�dD�dD�dE�dE�dF�d2�dG�dH�dI�dI�dI�dJ�dJ�dK�dL�dM�dN�dO�dP�dQ�dF�dA�dR�dS�dT�dS�dU�dV�dW�dQ�d��dF�d'�dX�dY�d*�dZ�d[�d\�d]�d^�d_�d`�da�d(�d'�d(�db�dc�dd�d3�d?�d@�de�df�dg�dh�di�dj�dk�dl�dm�dn�do�dp�dq�dr�ds�dt�du�dv�dw�dx�dy�dr�dc�dz�d{�d|�d}�d~�d�d��d�d��d��d��d��d��d��d��d��d��d��d��d��d5�d��dT�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��dS�d��d��d��d��d��d��d��d��d��d��d��d��ddÐdĐdĐd��d��d��d��dŐdƐdǐdȐdɐdʐdːd̐d͐dΐdp�dϐdАdѐdҐdӐdԐdՐd֐d֐dאdؐdِdڐdېdېdܐdݐdݐdސdߐd�d�d�d�d�d�d�d�d�d�d�d�d�dِd�d�d�d�d�dG�d�d�d�d�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d�d�d�d�d�d�d�d�d�d	�d�d
�d�d�d
�d�d�d�d�d�d�d�d�d�d�d�d�dB�d��d��d��d�d
�d��d�d�d�d�d�d�d�d�d�d	�d�d�d�d �d!�d"�d�d#�d �d��d��d
�d�d$�d$�dŐd%�dېd&�d'�d(�dY�d)�d*�d+�d,�d-�d.�d/�d0�d0�d1�d2�d3�d4�d&�d5�d6�d7�d8�d9�d:�d;�d<�d=�d��d&�d>�d-�d?�d@�d��d��dA�d)�dB�dC�dB�dC�dD�dE�dF�dE�dF�dG�dH�dI�dJ�dK�dL�dL�dY�dM�dN�dO�dP�dO�dP�dQ�dR�dS�dT�dU�dV�dW�dM�dX�dY�dM�dQ�dZ�dM�d[�d\�d]�d]�d��d^�d_�d`�d[�da�db�dc�dd�db�dc�da�de�df�dD�dg�dh�di�dj�dk�dl�dm�dn�do�df�dp�dp�dZ�dq�d��dr�ds�dt�du�d��dg�dv�dw�dx�dy�dz�d{�dz�d{�d|�d}�d~�d�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��dX�d��d��d��d��d9�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��ddÐd��dĐdŐdƐdǐdW�dȐdɐdʐdːd̐d��d��dX�d��d��d͐d��dÐdΐdϐd?�dАdѐdg�dҐdӐd)�dY�d)�d͐dԐd+�dՐd+�d֐dאdؐdِdڐdېdܐdݐdސdߐdҐd�d�d�d̐dːd�d�d�d�d�d�d�d�d��d�d�d�d�dːd�d�d�d�d�d�d�dѐd�d�d�d�d�dg�dҐd�d�d��d��d��d��dӐdM�d��d��d��d��d��d��d��d��d��d��d�d�d��d�d�d�dΐd�dZ�d�d�d[�d�d�d�d\�d�d��d�d	�d
�d�d�d
�d�d�d�d�d�d�do�d�d�d͐do�dԐd�d�d�d�d��d�d�d�d�d�d�d��d�d�d�d �d!�d!�d!�d��d!�d"�d#�d�dؐd$�d%�d&�d'�dېds�d(�d)�d*�d+�d+�d,�d,�d-�d.�d.�d/�d0�d0�dm�d֐d1�d2�d3�d4�d5�d6�d7�d$�d8�d9�d:�d;�d<�d=�d=�d>�dA�d?�d֐d֐d@�d��dU�dA�dB�dC�d1�dB�dD�dE�dF�dB�d9�dG�d�dH�dI�dJ�dJ�d7�dK�dL�dM�dN�dO�dP�dQ�dN�dR�dR�dS�dT�dT�dU�dV�dW�dX�dY�dZ�d[�d\�d]�d^�d_�d`�da�db�dc�dd�de�de�df�dg�dg�dg�dg�dh�di�dj�d	�d��dk�dl�dl�dm�dn�do�dp�dp�do�dq�dq�dr�ds�dt�du�du�dv�dw�dx�dy�dz�d{�d|�dz�d}�d~�d�d��d��d��d��d�d��dw�dx�d��d��d��d��d��d��d��d��d��d��d��d��d��d��dT�dS�d��d��d��d��dh�d��d��d��db�dj�dl�du�dp�do�dv�d��dq�ds�dU�dV�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d\�dN�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��dd��dd��d��d��d��d��dÐdĐdŐdƐdǐdȐdɐdʐdːd̐d͐dΐdϐdАdѐdҐdӐdԐdՐd֐dאdؐdِdڐdڐdېdܐdݐdܐdݐd�d�dސdߐdސdߐd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d��d��d�d��d��d��d��d�d��d��d��dǐd�d��d�d��d�d�d�d�d�d�d�d�d�d�d�d�d�d�d	�d�d
�d�d
�d�d�d
�d�d
�d�d�d�d�d�d�d�d�d�d�d�d�d�da�d�d�da�d�d�d�d�d�d�d�d�d�d��d �d!�d"�d#�d$�d%�d9�d&�d'�d(�dאd)�d-�d*�d-�d+�d,�d��d-�dV�d.�d/�d0�d0�d0�d1�d2�d0�d3�d3�d4�d5�d6�d6�d7�d8�d9�d:�d;�d<�d8�d9�d:�d8�d<�d:�d=�d<�d>�d?�d@�d=�dA�dB�d4�d>�d?�d@�dC�dC�dD�dE�dF�dG�d�dG�dG�d=�dH�dI�dJ�dK�dL�dM�dN�dO�dR�dP�dQ�dR�dS�dT�d;�dU�dV�d��dW�dW�dW�dW�dX�dY�dZ�d[�d\�d]�d^�d_�d`�da�d_�db�db�dc�d]�dd�de�df�dg�dh�di�d:�d�dj�dk�dl�dm�dn�do�dp�dq�dP�dn�d,�dn�dr�ds�dt�du�dv�dw�dx�dy�dz�d{�d|�ds�d}�d~�d�d��d�d�d��d��d��d��d��d��d��d�d�d�d�dz�dԐdz�d��d��d��d��d��dj�d��d��d��d��d��d_�dd�d]�dd�df�d��dm�d|�d��d��d@�d��d��dj�d��d��d��d��dn�d��d0�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��dX�d��d��d��d��d��dt�d�d�d��d��d��d��dt�d��d��d��d��d��d��d�d��d��d��d��d��d��d��d��d��d��ddÐdĐdŐdƐdǐdȐdɐdʐdːdW�d̐d5�d͐d�d�dΐdΐdϐdАdN�dN�dѐdҐdӐd�dԐdՐd֐dאdؐd(�d��d>�da�dd�dِdڐdڐdېdܐdݐdݐdސdߐd�d�d�d�d�d�d�d�d�d��d��dN�d�d�d>�d�d�d�d�d�d�d�d�d�d�d�d��d��da�d��d��d��d��d\�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��dp�dp�dd�d��d�dN�d�d�d�d�dh�d��d%�d,�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d
�d�d�d�d��d��d��d��d��d��dȐd��dĐdŐdƐdȐdz�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d �d!�d"�d#�d�d�d�d�d"�d!�d$�d%�d&�d6�d'�d�d�d(�d)�d)�d*�d+�d,�d-�d�d.�d/�d0�d1�d2�d3�d4�d5�d6�d7�d8�d8�d8�d9�d:�d;�d;�d7�dސd<�d=�d=�d7�dސd>�d?�d>�d?�dސdC�d�d��d7�d@�d@�d��dA�dB�dS�di�dl�dC�dD�dE�dF�dG�dАdH�dI�dI�dJ�dy�d'�dېdK�d��d��dL�dK�dM�d4�dN�dO�dP�dQ�dR�dS�dT�dU�dV�dW�dX�dY�d^�d��dc�dZ�d[�dZ�d[�d\�d_�dِd]�d^�d_�d`�da�db�dc�db�dc�dd�de�df�dg�dh�di�dj�dk�dl�dm�dn�dm�dn�do�dސd��dp�dq�dq�dr�ds�dt�du�dF�dF�d�dv�dS�dw�dc�dx�dy�dz�d{�d|�dِd_�dِd}�df�d~�d`�d~�di�dސd��dx�dڐde�d�d��d�d��d��d��d1�d��d��d��d��d��d��d��d��d��d��d��d��dJ�dq�d��d��d��d��d��d��d��d��d��d��d%�d)�dG�d`�d~�d��dݐd��d��d��d��d;�dِd��d��d��d��d��d��d��d��d^�d��d��dl�d�d��d��d��d��d��d��d��d>�d��d��d��d%�d��d��dِd��d��d��d��dG�d��d��d��d��d��d��d��d��d��d��d��d��dm�d�d��d��d��d��d��d��d��d��d��d��d��da�db�dc�di�d��d��d[�d�d��d��dZ�d�d�d��dd�d��d��de�df�d\�d�d��d��dg�dk�dj�dl�dm�d��d��d��d��ddÐdĐdŐdƐdǐdȐdȐdɐdʐdːd̐d͐dΐdϐdАdѐdҐdӐdԐdӐdՐd֐dאdؐdِdڐdېdܐdݐdg�dސdߐdݐd�d�d�d�dd�d�d�d�d�d�d���ZiZiZe��D]\ZZeee<e	e�ee<�%q[[�d�S(�z!HTML character entity references.�html5�name2codepoint�codepoint2name�
entitydefs������i�������i���i�i! i���������i�i���i�������i���i�i�i���i�iR������i�i�������i�i�i3 i�i�i`i���i�i�������i���i���ixi����������i5!i��&i'"i "��iH"����i i��i" i)"����i�i�ic&iE"�i�!i*"�i�!i  i�!�i�if&�������i"i i i�ia"i�����i� i"i�i"���iD i�ie"�>i�!i�!ie&i& �������i!i"i+"i��i"��i�i�!i�i)#�i�!i#i id"i
#i"i�%i i9 i �<�i ��i"i�i"�i i`"i"�i	"i�"��i�����iS��i> i�i�i�"i("����i�"��i"i0 i�"i�i�i���i2 i"i"i��"i�!i"i*#�i�!i	#i i!�i#i�i i: i i iai�"��i�i�i<"i`&i�"i�"i"i�"���i�"��i�i4"i�i�i	 �i���i"!i�!�i�!���i�i��i!i����i�i
 i )��AElig�Aacute�Acirc�AgraveZAlpha�Aring�Atilde�AumlZBeta�CcedilZChiZDaggerZDelta�ETH�Eacute�Ecirc�EgraveZEpsilonZEta�EumlZGamma�Iacute�Icirc�IgraveZIota�IumlZKappaZLambdaZMu�NtildeZNuZOElig�Oacute�Ocirc�OgraveZOmegaZOmicron�Oslash�Otilde�OumlZPhiZPiZPrimeZPsiZRhoZScaronZSigma�THORNZTauZTheta�Uacute�Ucirc�UgraveZUpsilon�UumlZXi�YacuteZYumlZZeta�aacute�acirc�acute�aelig�agraveZalefsymZalpha�amp�andZang�aringZasymp�atilde�aumlZbdquoZbeta�brvbarZbullZcap�ccedil�cedil�centZchiZcircZclubsZcong�copyZcrarrZcup�currenZdArrZdaggerZdarr�degZdeltaZdiams�divide�eacute�ecirc�egrave�emptyZemspZensp�epsilonZequivZeta�eth�eumlZeuroZexistZfnofZforall�frac12�frac14�frac34ZfraslZgamma�ge�gtZhArrZharrZheartsZhellip�iacute�icirc�iexcl�igraveZimageZinfin�intZiota�iquestZisin�iumlZkappaZlArr�lambdaZlang�laquoZlarrZlceilZldquo�leZlfloorZlowastZlozZlrmZlsaquoZlsquo�lt�macrZmdash�micro�middotZminusZmuZnabla�nbspZndash�neZni�notZnotinZnsub�ntildeZnu�oacute�ocircZoelig�ograveZolineZomegaZomicronZoplus�or�ordf�ordm�oslash�otildeZotimes�ouml�para�partZpermilZperpZphiZpiZpiv�plusmn�poundZprimeZprodZpropZpsi�quotZrArrZradicZrang�raquoZrarrZrceilZrdquo�real�regZrfloorZrhoZrlmZrsaquoZrsquoZsbquoZscaronZsdot�sect�shyZsigmaZsigmafZsimZspades�subZsube�sumZsup�sup1�sup2�sup3Zsupe�szligZtauZthere4ZthetaZthetasymZthinsp�thorn�tilde�timesZtradeZuArr�uacuteZuarr�ucirc�ugrave�umlZupsihZupsilon�uumlZweierpZxi�yacute�yen�yumlZzetaZzwjZzwnj�Á�áuĂuău∾u∿u∾̳�Â�â�´uАuа�Æ�æu⁡u𝔄u𝔞�À�àuℵuΑuαuĀuāu⨿�&u⩓u∧u⩕u⩜u⩘u⩚u∠u⦤u∡u⦨u⦩u⦪u⦫u⦬u⦭u⦮u⦯u∟u⊾u⦝u∢�Åu⍼uĄuąu𝔸u𝕒u≈u⩯u⩰u≊u≋�'�åu𝒜u𝒶u≔�*u≍�Ã�ã�Ä�äu∳u⨑u≌u϶u‵u∽u⋍u∖u⫧u⊽u⌆u⌅u⎵u⎶uБuбu„u∵u⦰uℬuΒuβuℶu≬u𝔅u𝔟u⋂u◯u⋃u⨀u⨁u⨂u⨆u★u▽u△u⨄u⋁u⋀u⤍u⧫u▪u▴u▾u◂u▸u␣u▒u░u▓u█u=⃥u≡⃥u⫭u⌐u𝔹u𝕓u⊥u⋈u⧉u╗u╖u╕u┐u╔u╓u╒u┌u═u─u╦u╤u╥u┬u╩u╧u╨u┴u⊟u⊞u⊠u╝u╜u╛u┘u╚u╙u╘u└u║u│u╬u╫u╪u┼u╣u╢u╡u┤u╠u╟u╞u├u˘�¦u𝒷u⁏�\u⧅u⟈u•u≎u⪮u≏uĆuću⋒u∩u⩄u⩉u⩋u⩇u⩀uⅅu∩︀u⁁uˇuℭu⩍uČuč�Ç�çuĈuĉu∰u⩌u⩐uĊuċ�¸u⦲�¢�·u𝔠uЧuчu✓uΧuχu○uˆu≗u↺u↻u⊛u⊚u⊝u⊙�®uⓈu⊖u⊕u⊗u⧃u⨐u⫯u⧂u∲u”u’u♣u∷�:u⩴�,�@u∁u∘uℂu≅u⩭u≡u∯u∮u𝕔u∐�©u℗u↵u⨯u✗u𝒞u𝒸u⫏u⫑u⫐u⫒u⋯u⤸u⤵u⋞u⋟u↶u⤽u⋓u∪u⩈u⩆u⩊u⊍u⩅u∪︀u↷u⤼u⋎u⋏�¤u∱u⌭u‡u†uℸu↡u⇓u↓u‐u⫤u⊣u⤏u˝uĎuďuДuдuⅆu⇊u⤑u⩷�°u∇uΔuδu⦱u⥿u𝔇u𝔡u⥥u⇃u⇂u˙�`u˜u⋄u♦�¨uϝu⋲�÷u⋇uЂuђu⌞u⌍�$u𝔻u𝕕u⃜u≐u≑u∸u∔u⊡u⇐u⇔u⟸u⟺u⟹u⇒u⊨u⇑u⇕u∥u⤓u⇵ȗu⥐u⥞u↽u⥖u⥟u⇁u⥗u⊤u↧u⤐u⌟u⌌u𝒟u𝒹uЅuѕu⧶uĐuđu⋱u▿u⥯u⦦uЏuџu⟿�É�éu⩮uĚuěu≖�Ê�êu≕uЭuэuĖuėuⅇu≒u𝔈u𝔢u⪚�È�èu⪖u⪘u⪙u∈u⏧uℓu⪕u⪗uĒuēu∅u◻u▫u u u uŊuŋu uĘuęu𝔼u𝕖u⋕u⧣u⩱uεuΕuϵu≂u⩵�=u≟u⇌u⩸u⧥u⥱u≓uℰuℯu⩳uΗuη�Ð�ð�Ë�ëu€�!u∃uФuфu♀uffiuffufflu𝔉u𝔣ufiu◼Zfju♭uflu▱uƒu𝔽u𝕗u∀u⋔u⫙uℱu⨍�½u⅓�¼u⅕u⅙u⅛u⅔u⅖�¾u⅗u⅜u⅘u⅚u⅝u⅞u⁄u⌢u𝒻uǵuΓuγuϜu⪆uĞuğuĢuĜuĝuГuгuĠuġu≧u≥u⪌u⋛u⩾u⪩u⪀u⪂u⪄u⋛︀u⪔u𝔊u𝔤u⋙u≫uℷuЃuѓu≷u⪥u⪒u⪤u⪊u≩u⪈u⋧u𝔾u𝕘u⪢u≳u𝒢uℊu⪎u⪐�>u⪧u⩺u⋗u⦕u⩼u⥸u≩︀u uℋuЪuъu↔u⥈u↭�^uℏuĤuĥu♥u…u⊹uℌu𝔥u⤥u⤦u⇿u∻u↩u↪uℍu𝕙u―u𝒽uĦuħu⁃�Í�íu⁣�Î�îuИuиuİuЕuе�¡uℑu𝔦�Ì�ìuⅈu⨌u∭u⧜u℩uIJuijuĪuīuℐuıu⊷uƵu℅u∞u⧝u∬u∫u⊺uℤu⨗u⨼u⁢uЁuёuĮuįu𝕀u𝕚uΙuι�¿u𝒾u⋵u⋹u⋴u⋳uĨuĩuІuі�Ï�ïuĴuĵuЙuйu𝔍u𝔧uȷu𝕁u𝕛u𝒥u𝒿uЈuјuЄuєuΚuκuϰuĶuķuКuкu𝔎u𝔨uĸuХuхuЌuќu𝕂u𝕜u𝒦u𝓀u⇚uĹuĺu⦴uℒuΛuλu⟪u⟨u⦑u⪅�«u↞u←u⇤u⤟u⤝u↫u⤹u⥳u↢u⪫u⤛u⤙u⪭u⪭︀u⤎u⤌u❲�{�[u⦋u⦏u⦍uĽuľuĻuļu⌈uЛuлu⤶u“u⥧u⥋u↲u≦u≤u⇆u⟦u⥡u⥙u⌊u↼u⇇u⇋u⥎u↤u⥚u⋋u⊲u⧏u⊴u⥑u⥠u↿u⥘u⥒u⪋u⋚u⩽u⪨u⩿u⪁u⪃u⋚︀u⪓u⋖u≶u⪡u≲u⥼u𝔏u𝔩u⪑u⥢u⥪u▄uЉuљu⋘u≪u⥫u◺uĿuŀu⎰u⪉u≨u⪇u⋦u⟬u⇽u⟵u⟷u⟼u⟶u↬u⦅u𝕃u𝕝u⨭u⨴u∗�_u↙u↘u◊�(u⦓u⥭u‎u⊿u‹u𝓁u↰u⪍u⪏u‘u‚uŁuł�<u⪦u⩹u⋉u⥶u⩻u◃u⦖u⥊u⥦u≨︀�¯u♂u✠u⤅u↦u↥u▮u⨩uМuмu—u∺u uℳu𝔐u𝔪u℧�µu∣u⫰u−u⨪u∓u⫛u⊧u𝕄u𝕞u𝓂uΜuμu⊸uŃuńu∠⃒u≉u⩰̸u≋̸uʼnu♮uℕ� u≎̸u≏̸u⩃uŇuňuŅuņu≇u⩭̸u⩂uНuнu–u≠u⤤u⇗u↗u≐̸u​u≢u⤨u≂̸�
u∄u𝔑u𝔫u≧̸u≱u⩾̸u⋙̸u≵u≫⃒u≯u≫̸u⇎u↮u⫲u∋u⋼u⋺uЊuњu⇍u↚u‥u≦̸u≰u⩽̸u≮u⋘̸u≴u≪⃒u⋪u⋬u≪̸u∤u⁠u𝕟�¬u⫬u≭u∦u∉u≹u⋵̸u⋹̸u⋷u⋶u⧏̸u≸u⪢̸u⪡̸u∌u⋾u⋽u⊀u⪯̸u⋠u⋫u⧐̸u⋭u⊏̸u⋢u⊐̸u⋣u⊂⃒u⊈u⊁u⪰̸u⋡u≿̸u⊃⃒u⊉u≁u≄u⫽⃥u∂̸u⨔u⇏u↛u⤳̸u↝̸u𝒩u𝓃u⊄u⫅̸u⊅u⫆̸�Ñ�ñuΝuν�#u№u u≍⃒u⊯u⊮u⊭u⊬u≥⃒u>⃒u⤄u⧞u⤂u≤⃒u<⃒u⊴⃒u⤃u⊵⃒u∼⃒u⤣u⇖u↖u⤧�Ó�ó�Ô�ôuОuоuŐuőu⨸u⦼uŒuœu⦿u𝔒u𝔬u˛�Ò�òu⧁u⦵uΩu⦾u⦻u‾u⧀uŌuōuωuΟuοu⦶u𝕆u𝕠u⦷u⦹u⩔u∨u⩝uℴ�ª�ºu⊶u⩖u⩗u⩛u𝒪�Ø�øu⊘�Õ�õu⨷u⨶�Ö�öu⌽u⏞u⎴u⏜�¶u⫳u⫽u∂uПuп�%�.u‰u‱u𝔓u𝔭uΦuφuϕu☎uΠuπuϖuℎ�+u⨣u⨢u⨥u⩲�±u⨦u⨧u⨕uℙu𝕡�£u⪻u≺u⪷u≼u⪳u⪯u≾u⪹u⪵u⋨u″u′u∏u⌮u⌒u⌓u∝u⊰u𝒫u𝓅uΨuψu u𝔔u𝔮uℚu𝕢u⁗u𝒬u𝓆u⨖�?�"u⇛u∽̱uŔuŕu√u⦳u⟫u⟩u⦒u⦥�»u↠u→u⥵u⇥u⤠u⤳u⤞u⥅u⥴u⤖u↣u↝u⤜u⤚u∶u❳�}�]u⦌u⦎u⦐uŘuřuŖuŗu⌉uРuрu⤷u⥩u↳uℜuℛuℝu▭u⥽u⌋u𝔯u⥤u⇀u⥬uΡuρuϱu⇄u⟧u⥝u⥕u⇉u⊢u⥛u⋌u⊳u⧐u⊵u⥏u⥜u↾u⥔u⥓u˚u‏u⎱u⫮u⟭u⇾u⦆u𝕣u⨮u⨵u⥰�)u⦔u⨒u›u𝓇u↱u⋊u▹u⧎u⧴u⥨u℞uŚuśu⪼u≻u⪸uŠušu≽u⪴u⪰uŞuşuŜuŝu⪺u⪶u⋩u⨓u≿uСuсu⋅u⩦u⇘�§�;u⤩u✶u𝔖u𝔰u♯uЩuщuШuшu↑�­uΣuσuςu∼u⩪u≃u⪞u⪠u⪝u⪟u≆u⨤u⥲u⨳u⧤u⌣u⪪u⪬u⪬︀uЬuь�/u⧄u⌿u𝕊u𝕤u♠u⊓u⊓︀u⊔u⊔︀u⊏u⊑u⊐u⊒u□u𝒮u𝓈u⋆u☆u⋐u⊂u⪽u⫅u⊆u⫃u⫁u⫋u⊊u⪿u⥹u⫇u⫕u⫓u∑u♪�¹�²�³u⋑u⊃u⪾u⫘u⫆u⊇u⫄u⟉u⫗u⥻u⫂u⫌u⊋u⫀u⫈u⫔u⫖u⇙u⤪�ß�	u⌖uΤuτuŤuťuŢuţuТuтu⃛u⌕u𝔗u𝔱u∴uΘuθuϑu  u �Þ�þ�×u⨱u⨰u⌶u⫱u𝕋u𝕥u⫚u‴u™u▵u≜u◬u⨺u⨹u⧍u⨻u⏢u𝒯u𝓉uЦuцuЋuћuŦuŧ�Ú�úu↟u⥉uЎuўuŬuŭ�Û�ûuУuуu⇅uŰuűu⥮u⥾u𝔘u𝔲�Ù�ùu⥣u▀u⌜u⌏u◸uŪuūu⏟u⏝u⊎uŲuųu𝕌u𝕦u⤒u↕uϒuυuΥu⇈u⌝u⌎uŮuůu◹u𝒰u𝓊u⋰uŨuũ�Ü�üu⦧u⦜u⊊︀u⫋︀u⊋︀u⫌︀u⫫u⫨u⫩uВuвu⊫u⊩u⫦u⊻u≚u⋮u‖�|u❘u≀u𝔙u𝔳u𝕍u𝕧u𝒱u𝓋u⊪u⦚uŴuŵu⩟u≙u℘u𝔚u𝔴u𝕎u𝕨u𝒲u𝓌u𝔛u𝔵uΞuξu⋻u𝕏u𝕩u𝒳u𝓍�Ý�ýuЯuяuŶuŷuЫuы�¥u𝔜u𝔶uЇuїu𝕐u𝕪u𝒴u𝓎uЮuю�ÿuŸuŹuźuŽužuЗuзuŻużuℨuΖuζu𝔷uЖuжu⇝u𝕫u𝒵u𝓏u‍u‌(�rjr�zAacute;zaacute;zAbreve;zabreve;zac;zacd;zacE;rkr�zAcirc;zacirc;r�zacute;zAcy;zacy;rir�zAElig;zaelig;zaf;zAfr;zafr;rlr�zAgrave;zagrave;zalefsym;zaleph;zAlpha;zalpha;zAmacr;zamacr;zamalg;ZAMPr�zAMP;zamp;zAnd;zand;zandand;zandd;z	andslope;zandv;zang;zange;zangle;zangmsd;z	angmsdaa;z	angmsdab;z	angmsdac;z	angmsdad;z	angmsdae;z	angmsdaf;z	angmsdag;z	angmsdah;zangrt;zangrtvb;z	angrtvbd;zangsph;zangst;zangzarr;zAogon;zaogon;zAopf;zaopf;zap;zapacir;zapE;zape;zapid;zapos;zApplyFunction;zapprox;z	approxeq;rmr�zAring;zaring;zAscr;zascr;zAssign;zast;zasymp;zasympeq;rnr�zAtilde;zatilde;ror�zAuml;zauml;z	awconint;zawint;z	backcong;zbackepsilon;z
backprime;zbacksim;z
backsimeq;z
Backslash;zBarv;zbarvee;zBarwed;zbarwed;z	barwedge;zbbrk;z	bbrktbrk;zbcong;zBcy;zbcy;zbdquo;zbecaus;zBecause;zbecause;zbemptyv;zbepsi;zbernou;zBernoullis;zBeta;zbeta;zbeth;zbetween;zBfr;zbfr;zbigcap;zbigcirc;zbigcup;zbigodot;z	bigoplus;z
bigotimes;z	bigsqcup;zbigstar;zbigtriangledown;zbigtriangleup;z	biguplus;zbigvee;z	bigwedge;zbkarow;z
blacklozenge;zblacksquare;zblacktriangle;zblacktriangledown;zblacktriangleleft;zblacktriangleright;zblank;zblk12;zblk14;zblk34;zblock;zbne;zbnequiv;zbNot;zbnot;zBopf;zbopf;zbot;zbottom;zbowtie;zboxbox;zboxDL;zboxDl;zboxdL;zboxdl;zboxDR;zboxDr;zboxdR;zboxdr;zboxH;zboxh;zboxHD;zboxHd;zboxhD;zboxhd;zboxHU;zboxHu;zboxhU;zboxhu;z	boxminus;zboxplus;z	boxtimes;zboxUL;zboxUl;zboxuL;zboxul;zboxUR;zboxUr;zboxuR;zboxur;zboxV;zboxv;zboxVH;zboxVh;zboxvH;zboxvh;zboxVL;zboxVl;zboxvL;zboxvl;zboxVR;zboxVr;zboxvR;zboxvr;zbprime;zBreve;zbreve;r�zbrvbar;zBscr;zbscr;zbsemi;zbsim;zbsime;zbsol;zbsolb;z	bsolhsub;zbull;zbullet;zbump;zbumpE;zbumpe;zBumpeq;zbumpeq;zCacute;zcacute;zCap;zcap;zcapand;z	capbrcup;zcapcap;zcapcup;zcapdot;zCapitalDifferentialD;zcaps;zcaret;zcaron;zCayleys;zccaps;zCcaron;zccaron;rpr�zCcedil;zccedil;zCcirc;zccirc;zCconint;zccups;zccupssm;zCdot;zcdot;r�zcedil;zCedilla;zcemptyv;r�zcent;z
CenterDot;z
centerdot;zCfr;zcfr;zCHcy;zchcy;zcheck;z
checkmark;zChi;zchi;zcir;zcirc;zcirceq;zcirclearrowleft;zcirclearrowright;zcircledast;zcircledcirc;zcircleddash;z
CircleDot;z	circledR;z	circledS;zCircleMinus;zCirclePlus;zCircleTimes;zcirE;zcire;z	cirfnint;zcirmid;zcirscir;zClockwiseContourIntegral;zCloseCurlyDoubleQuote;zCloseCurlyQuote;zclubs;z	clubsuit;zColon;zcolon;zColone;zcolone;zcoloneq;zcomma;zcommat;zcomp;zcompfn;zcomplement;z
complexes;zcong;zcongdot;z
Congruent;zConint;zconint;zContourIntegral;zCopf;zcopf;zcoprod;z
Coproduct;ZCOPYr�zCOPY;zcopy;zcopysr;z CounterClockwiseContourIntegral;zcrarr;zCross;zcross;zCscr;zcscr;zcsub;zcsube;zcsup;zcsupe;zctdot;zcudarrl;zcudarrr;zcuepr;zcuesc;zcularr;zcularrp;zCup;zcup;z	cupbrcap;zCupCap;zcupcap;zcupcup;zcupdot;zcupor;zcups;zcurarr;zcurarrm;zcurlyeqprec;zcurlyeqsucc;z	curlyvee;zcurlywedge;r�zcurren;zcurvearrowleft;zcurvearrowright;zcuvee;zcuwed;z	cwconint;zcwint;zcylcty;zDagger;zdagger;zdaleth;zDarr;zdArr;zdarr;zdash;zDashv;zdashv;zdbkarow;zdblac;zDcaron;zdcaron;zDcy;zdcy;zDD;zdd;zddagger;zddarr;z	DDotrahd;zddotseq;r�zdeg;zDel;zDelta;zdelta;zdemptyv;zdfisht;zDfr;zdfr;zdHar;zdharl;zdharr;zDiacriticalAcute;zDiacriticalDot;zDiacriticalDoubleAcute;zDiacriticalGrave;zDiacriticalTilde;zdiam;zDiamond;zdiamond;zdiamondsuit;zdiams;zdie;zDifferentialD;zdigamma;zdisin;zdiv;r�zdivide;zdivideontimes;zdivonx;zDJcy;zdjcy;zdlcorn;zdlcrop;zdollar;zDopf;zdopf;zDot;zdot;zDotDot;zdoteq;z	doteqdot;z	DotEqual;z	dotminus;zdotplus;z
dotsquare;zdoublebarwedge;zDoubleContourIntegral;z
DoubleDot;zDoubleDownArrow;zDoubleLeftArrow;zDoubleLeftRightArrow;zDoubleLeftTee;zDoubleLongLeftArrow;zDoubleLongLeftRightArrow;zDoubleLongRightArrow;zDoubleRightArrow;zDoubleRightTee;zDoubleUpArrow;zDoubleUpDownArrow;zDoubleVerticalBar;z
DownArrow;z
Downarrow;z
downarrow;z
DownArrowBar;zDownArrowUpArrow;z
DownBreve;zdowndownarrows;zdownharpoonleft;zdownharpoonright;zDownLeftRightVector;zDownLeftTeeVector;zDownLeftVector;zDownLeftVectorBar;zDownRightTeeVector;zDownRightVector;zDownRightVectorBar;zDownTee;z
DownTeeArrow;z	drbkarow;zdrcorn;zdrcrop;zDscr;zdscr;zDScy;zdscy;zdsol;zDstrok;zdstrok;zdtdot;zdtri;zdtrif;zduarr;zduhar;zdwangle;zDZcy;zdzcy;z	dzigrarr;rrr�zEacute;zeacute;zeaster;zEcaron;zecaron;zecir;rsr�zEcirc;zecirc;zecolon;zEcy;zecy;zeDDot;zEdot;zeDot;zedot;zee;zefDot;zEfr;zefr;zeg;rtr�zEgrave;zegrave;zegs;zegsdot;zel;zElement;z	elinters;zell;zels;zelsdot;zEmacr;zemacr;zempty;z	emptyset;zEmptySmallSquare;zemptyv;zEmptyVerySmallSquare;zemsp13;zemsp14;zemsp;zENG;zeng;zensp;zEogon;zeogon;zEopf;zeopf;zepar;zeparsl;zeplus;zepsi;zEpsilon;zepsilon;zepsiv;zeqcirc;zeqcolon;zeqsim;zeqslantgtr;zeqslantless;zEqual;zequals;zEqualTilde;zequest;zEquilibrium;zequiv;zequivDD;z	eqvparsl;zerarr;zerDot;zEscr;zescr;zesdot;zEsim;zesim;zEta;zeta;rqr�zETH;zeth;rur�zEuml;zeuml;zeuro;zexcl;zexist;zExists;zexpectation;z
ExponentialE;z
exponentiale;zfallingdotseq;zFcy;zfcy;zfemale;zffilig;zfflig;zffllig;zFfr;zffr;zfilig;zFilledSmallSquare;zFilledVerySmallSquare;zfjlig;zflat;zfllig;zfltns;zfnof;zFopf;zfopf;zForAll;zforall;zfork;zforkv;zFouriertrf;z	fpartint;r�zfrac12;zfrac13;r�zfrac14;zfrac15;zfrac16;zfrac18;zfrac23;zfrac25;r�zfrac34;zfrac35;zfrac38;zfrac45;zfrac56;zfrac58;zfrac78;zfrasl;zfrown;zFscr;zfscr;zgacute;zGamma;zgamma;zGammad;zgammad;zgap;zGbreve;zgbreve;zGcedil;zGcirc;zgcirc;zGcy;zgcy;zGdot;zgdot;zgE;zge;zgEl;zgel;zgeq;zgeqq;z	geqslant;zges;zgescc;zgesdot;zgesdoto;z	gesdotol;zgesl;zgesles;zGfr;zgfr;zGg;zgg;zggg;zgimel;zGJcy;zgjcy;zgl;zgla;zglE;zglj;zgnap;z	gnapprox;zgnE;zgne;zgneq;zgneqq;zgnsim;zGopf;zgopf;zgrave;z
GreaterEqual;zGreaterEqualLess;zGreaterFullEqual;zGreaterGreater;zGreaterLess;zGreaterSlantEqual;z
GreaterTilde;zGscr;zgscr;zgsim;zgsime;zgsiml;ZGTr�zGT;zGt;zgt;zgtcc;zgtcir;zgtdot;zgtlPar;zgtquest;z
gtrapprox;zgtrarr;zgtrdot;z
gtreqless;zgtreqqless;zgtrless;zgtrsim;z
gvertneqq;zgvnE;zHacek;zhairsp;zhalf;zhamilt;zHARDcy;zhardcy;zhArr;zharr;zharrcir;zharrw;zHat;zhbar;zHcirc;zhcirc;zhearts;z
heartsuit;zhellip;zhercon;zHfr;zhfr;z
HilbertSpace;z	hksearow;z	hkswarow;zhoarr;zhomtht;zhookleftarrow;zhookrightarrow;zHopf;zhopf;zhorbar;zHorizontalLine;zHscr;zhscr;zhslash;zHstrok;zhstrok;z
HumpDownHump;z
HumpEqual;zhybull;zhyphen;rvr�zIacute;ziacute;zic;rwr�zIcirc;zicirc;zIcy;zicy;zIdot;zIEcy;ziecy;r�ziexcl;ziff;zIfr;zifr;rxr�zIgrave;zigrave;zii;ziiiint;ziiint;ziinfin;ziiota;zIJlig;zijlig;zIm;zImacr;zimacr;zimage;zImaginaryI;z	imagline;z	imagpart;zimath;zimof;zimped;zImplies;zin;zincare;zinfin;z	infintie;zinodot;zInt;zint;zintcal;z	integers;z	Integral;z	intercal;z
Intersection;z	intlarhk;zintprod;zInvisibleComma;zInvisibleTimes;zIOcy;ziocy;zIogon;ziogon;zIopf;ziopf;zIota;ziota;ziprod;r�ziquest;zIscr;ziscr;zisin;zisindot;zisinE;zisins;zisinsv;zisinv;zit;zItilde;zitilde;zIukcy;ziukcy;ryr�zIuml;ziuml;zJcirc;zjcirc;zJcy;zjcy;zJfr;zjfr;zjmath;zJopf;zjopf;zJscr;zjscr;zJsercy;zjsercy;zJukcy;zjukcy;zKappa;zkappa;zkappav;zKcedil;zkcedil;zKcy;zkcy;zKfr;zkfr;zkgreen;zKHcy;zkhcy;zKJcy;zkjcy;zKopf;zkopf;zKscr;zkscr;zlAarr;zLacute;zlacute;z	laemptyv;zlagran;zLambda;zlambda;zLang;zlang;zlangd;zlangle;zlap;zLaplacetrf;r�zlaquo;zLarr;zlArr;zlarr;zlarrb;zlarrbfs;zlarrfs;zlarrhk;zlarrlp;zlarrpl;zlarrsim;zlarrtl;zlat;zlAtail;zlatail;zlate;zlates;zlBarr;zlbarr;zlbbrk;zlbrace;zlbrack;zlbrke;zlbrksld;zlbrkslu;zLcaron;zlcaron;zLcedil;zlcedil;zlceil;zlcub;zLcy;zlcy;zldca;zldquo;zldquor;zldrdhar;z	ldrushar;zldsh;zlE;zle;zLeftAngleBracket;z
LeftArrow;z
Leftarrow;z
leftarrow;z
LeftArrowBar;zLeftArrowRightArrow;zleftarrowtail;zLeftCeiling;zLeftDoubleBracket;zLeftDownTeeVector;zLeftDownVector;zLeftDownVectorBar;z
LeftFloor;zleftharpoondown;zleftharpoonup;zleftleftarrows;zLeftRightArrow;zLeftrightarrow;zleftrightarrow;zleftrightarrows;zleftrightharpoons;zleftrightsquigarrow;zLeftRightVector;zLeftTee;z
LeftTeeArrow;zLeftTeeVector;zleftthreetimes;z
LeftTriangle;zLeftTriangleBar;zLeftTriangleEqual;zLeftUpDownVector;zLeftUpTeeVector;z
LeftUpVector;zLeftUpVectorBar;zLeftVector;zLeftVectorBar;zlEg;zleg;zleq;zleqq;z	leqslant;zles;zlescc;zlesdot;zlesdoto;z	lesdotor;zlesg;zlesges;zlessapprox;zlessdot;z
lesseqgtr;zlesseqqgtr;zLessEqualGreater;zLessFullEqual;zLessGreater;zlessgtr;z	LessLess;zlesssim;zLessSlantEqual;z
LessTilde;zlfisht;zlfloor;zLfr;zlfr;zlg;zlgE;zlHar;zlhard;zlharu;zlharul;zlhblk;zLJcy;zljcy;zLl;zll;zllarr;z	llcorner;zLleftarrow;zllhard;zlltri;zLmidot;zlmidot;zlmoust;zlmoustache;zlnap;z	lnapprox;zlnE;zlne;zlneq;zlneqq;zlnsim;zloang;zloarr;zlobrk;zLongLeftArrow;zLongleftarrow;zlongleftarrow;zLongLeftRightArrow;zLongleftrightarrow;zlongleftrightarrow;zlongmapsto;zLongRightArrow;zLongrightarrow;zlongrightarrow;zlooparrowleft;zlooparrowright;zlopar;zLopf;zlopf;zloplus;zlotimes;zlowast;zlowbar;zLowerLeftArrow;zLowerRightArrow;zloz;zlozenge;zlozf;zlpar;zlparlt;zlrarr;z	lrcorner;zlrhar;zlrhard;zlrm;zlrtri;zlsaquo;zLscr;zlscr;zLsh;zlsh;zlsim;zlsime;zlsimg;zlsqb;zlsquo;zlsquor;zLstrok;zlstrok;ZLTr�zLT;zLt;zlt;zltcc;zltcir;zltdot;zlthree;zltimes;zltlarr;zltquest;zltri;zltrie;zltrif;zltrPar;z	lurdshar;zluruhar;z
lvertneqq;zlvnE;r�zmacr;zmale;zmalt;zmaltese;zMap;zmap;zmapsto;zmapstodown;zmapstoleft;z	mapstoup;zmarker;zmcomma;zMcy;zmcy;zmdash;zmDDot;zmeasuredangle;zMediumSpace;z
Mellintrf;zMfr;zmfr;zmho;r�zmicro;zmid;zmidast;zmidcir;r�zmiddot;zminus;zminusb;zminusd;zminusdu;z
MinusPlus;zmlcp;zmldr;zmnplus;zmodels;zMopf;zmopf;zmp;zMscr;zmscr;zmstpos;zMu;zmu;z	multimap;zmumap;znabla;zNacute;znacute;znang;znap;znapE;znapid;znapos;znapprox;znatur;znatural;z	naturals;r�znbsp;znbump;znbumpe;zncap;zNcaron;zncaron;zNcedil;zncedil;zncong;z	ncongdot;zncup;zNcy;zncy;zndash;zne;znearhk;zneArr;znearr;znearrow;znedot;zNegativeMediumSpace;zNegativeThickSpace;zNegativeThinSpace;zNegativeVeryThinSpace;znequiv;znesear;znesim;zNestedGreaterGreater;zNestedLessLess;zNewLine;znexist;znexists;zNfr;znfr;zngE;znge;zngeq;zngeqq;z
ngeqslant;znges;znGg;zngsim;znGt;zngt;zngtr;znGtv;znhArr;znharr;znhpar;zni;znis;znisd;zniv;zNJcy;znjcy;znlArr;znlarr;znldr;znlE;znle;znLeftarrow;znleftarrow;znLeftrightarrow;znleftrightarrow;znleq;znleqq;z
nleqslant;znles;znless;znLl;znlsim;znLt;znlt;znltri;znltrie;znLtv;znmid;zNoBreak;zNonBreakingSpace;zNopf;znopf;r�zNot;znot;z
NotCongruent;z
NotCupCap;zNotDoubleVerticalBar;zNotElement;z	NotEqual;zNotEqualTilde;z
NotExists;zNotGreater;zNotGreaterEqual;zNotGreaterFullEqual;zNotGreaterGreater;zNotGreaterLess;zNotGreaterSlantEqual;zNotGreaterTilde;zNotHumpDownHump;z
NotHumpEqual;znotin;z	notindot;znotinE;znotinva;znotinvb;znotinvc;zNotLeftTriangle;zNotLeftTriangleBar;zNotLeftTriangleEqual;zNotLess;z
NotLessEqual;zNotLessGreater;zNotLessLess;zNotLessSlantEqual;z
NotLessTilde;zNotNestedGreaterGreater;zNotNestedLessLess;znotni;znotniva;znotnivb;znotnivc;zNotPrecedes;zNotPrecedesEqual;zNotPrecedesSlantEqual;zNotReverseElement;zNotRightTriangle;zNotRightTriangleBar;zNotRightTriangleEqual;zNotSquareSubset;zNotSquareSubsetEqual;zNotSquareSuperset;zNotSquareSupersetEqual;z
NotSubset;zNotSubsetEqual;zNotSucceeds;zNotSucceedsEqual;zNotSucceedsSlantEqual;zNotSucceedsTilde;zNotSuperset;zNotSupersetEqual;z	NotTilde;zNotTildeEqual;zNotTildeFullEqual;zNotTildeTilde;zNotVerticalBar;znpar;z
nparallel;znparsl;znpart;znpolint;znpr;znprcue;znpre;znprec;znpreceq;znrArr;znrarr;znrarrc;znrarrw;znRightarrow;znrightarrow;znrtri;znrtrie;znsc;znsccue;znsce;zNscr;znscr;z
nshortmid;znshortparallel;znsim;znsime;znsimeq;znsmid;znspar;znsqsube;znsqsupe;znsub;znsubE;znsube;znsubset;z
nsubseteq;znsubseteqq;znsucc;znsucceq;znsup;znsupE;znsupe;znsupset;z
nsupseteq;znsupseteqq;zntgl;rzr�zNtilde;zntilde;zntlg;zntriangleleft;zntrianglelefteq;zntriangleright;zntrianglerighteq;zNu;znu;znum;znumero;znumsp;znvap;znVDash;znVdash;znvDash;znvdash;znvge;znvgt;znvHarr;znvinfin;znvlArr;znvle;znvlt;znvltrie;znvrArr;znvrtrie;znvsim;znwarhk;znwArr;znwarr;znwarrow;znwnear;r{r�zOacute;zoacute;zoast;zocir;r|r�zOcirc;zocirc;zOcy;zocy;zodash;zOdblac;zodblac;zodiv;zodot;zodsold;zOElig;zoelig;zofcir;zOfr;zofr;zogon;r}r�zOgrave;zograve;zogt;zohbar;zohm;zoint;zolarr;zolcir;zolcross;zoline;zolt;zOmacr;zomacr;zOmega;zomega;zOmicron;zomicron;zomid;zominus;zOopf;zoopf;zopar;zOpenCurlyDoubleQuote;zOpenCurlyQuote;zoperp;zoplus;zOr;zor;zorarr;zord;zorder;zorderof;r�zordf;r�zordm;zorigof;zoror;zorslope;zorv;zoS;zOscr;zoscr;r~r�zOslash;zoslash;zosol;rr�zOtilde;zotilde;zOtimes;zotimes;z	otimesas;r�r�zOuml;zouml;zovbar;zOverBar;z
OverBrace;zOverBracket;zOverParenthesis;zpar;r�zpara;z	parallel;zparsim;zparsl;zpart;z	PartialD;zPcy;zpcy;zpercnt;zperiod;zpermil;zperp;zpertenk;zPfr;zpfr;zPhi;zphi;zphiv;zphmmat;zphone;zPi;zpi;z
pitchfork;zpiv;zplanck;zplanckh;zplankv;zplus;z	plusacir;zplusb;zpluscir;zplusdo;zplusdu;zpluse;z
PlusMinus;r�zplusmn;zplussim;zplustwo;zpm;zPoincareplane;z	pointint;zPopf;zpopf;r�zpound;zPr;zpr;zprap;zprcue;zprE;zpre;zprec;zprecapprox;zpreccurlyeq;z	Precedes;zPrecedesEqual;zPrecedesSlantEqual;zPrecedesTilde;zpreceq;zprecnapprox;z	precneqq;z	precnsim;zprecsim;zPrime;zprime;zprimes;zprnap;zprnE;zprnsim;zprod;zProduct;z	profalar;z	profline;z	profsurf;zprop;zProportion;z
Proportional;zpropto;zprsim;zprurel;zPscr;zpscr;zPsi;zpsi;zpuncsp;zQfr;zqfr;zqint;zQopf;zqopf;zqprime;zQscr;zqscr;zquaternions;zquatint;zquest;zquesteq;ZQUOTr�zQUOT;zquot;zrAarr;zrace;zRacute;zracute;zradic;z	raemptyv;zRang;zrang;zrangd;zrange;zrangle;r�zraquo;zRarr;zrArr;zrarr;zrarrap;zrarrb;zrarrbfs;zrarrc;zrarrfs;zrarrhk;zrarrlp;zrarrpl;zrarrsim;zRarrtl;zrarrtl;zrarrw;zrAtail;zratail;zratio;z
rationals;zRBarr;zrBarr;zrbarr;zrbbrk;zrbrace;zrbrack;zrbrke;zrbrksld;zrbrkslu;zRcaron;zrcaron;zRcedil;zrcedil;zrceil;zrcub;zRcy;zrcy;zrdca;zrdldhar;zrdquo;zrdquor;zrdsh;zRe;zreal;zrealine;z	realpart;zreals;zrect;ZREGr�zREG;zreg;zReverseElement;zReverseEquilibrium;zReverseUpEquilibrium;zrfisht;zrfloor;zRfr;zrfr;zrHar;zrhard;zrharu;zrharul;zRho;zrho;zrhov;zRightAngleBracket;zRightArrow;zRightarrow;zrightarrow;zRightArrowBar;zRightArrowLeftArrow;zrightarrowtail;z
RightCeiling;zRightDoubleBracket;zRightDownTeeVector;zRightDownVector;zRightDownVectorBar;zRightFloor;zrightharpoondown;zrightharpoonup;zrightleftarrows;zrightleftharpoons;zrightrightarrows;zrightsquigarrow;z	RightTee;zRightTeeArrow;zRightTeeVector;zrightthreetimes;zRightTriangle;zRightTriangleBar;zRightTriangleEqual;zRightUpDownVector;zRightUpTeeVector;zRightUpVector;zRightUpVectorBar;zRightVector;zRightVectorBar;zring;z
risingdotseq;zrlarr;zrlhar;zrlm;zrmoust;zrmoustache;zrnmid;zroang;zroarr;zrobrk;zropar;zRopf;zropf;zroplus;zrotimes;z
RoundImplies;zrpar;zrpargt;z	rppolint;zrrarr;zRrightarrow;zrsaquo;zRscr;zrscr;zRsh;zrsh;zrsqb;zrsquo;zrsquor;zrthree;zrtimes;zrtri;zrtrie;zrtrif;z	rtriltri;zRuleDelayed;zruluhar;zrx;zSacute;zsacute;zsbquo;zSc;zsc;zscap;zScaron;zscaron;zsccue;zscE;zsce;zScedil;zscedil;zScirc;zscirc;zscnap;zscnE;zscnsim;z	scpolint;zscsim;zScy;zscy;zsdot;zsdotb;zsdote;zsearhk;zseArr;zsearr;zsearrow;r�zsect;zsemi;zseswar;z	setminus;zsetmn;zsext;zSfr;zsfr;zsfrown;zsharp;zSHCHcy;zshchcy;zSHcy;zshcy;zShortDownArrow;zShortLeftArrow;z	shortmid;zshortparallel;zShortRightArrow;z
ShortUpArrow;r�zshy;zSigma;zsigma;zsigmaf;zsigmav;zsim;zsimdot;zsime;zsimeq;zsimg;zsimgE;zsiml;zsimlE;zsimne;zsimplus;zsimrarr;zslarr;zSmallCircle;zsmallsetminus;zsmashp;z	smeparsl;zsmid;zsmile;zsmt;zsmte;zsmtes;zSOFTcy;zsoftcy;zsol;zsolb;zsolbar;zSopf;zsopf;zspades;z
spadesuit;zspar;zsqcap;zsqcaps;zsqcup;zsqcups;zSqrt;zsqsub;zsqsube;z	sqsubset;zsqsubseteq;zsqsup;zsqsupe;z	sqsupset;zsqsupseteq;zsqu;zSquare;zsquare;zSquareIntersection;z
SquareSubset;zSquareSubsetEqual;zSquareSuperset;zSquareSupersetEqual;zSquareUnion;zsquarf;zsquf;zsrarr;zSscr;zsscr;zssetmn;zssmile;zsstarf;zStar;zstar;zstarf;zstraightepsilon;zstraightphi;zstrns;zSub;zsub;zsubdot;zsubE;zsube;zsubedot;zsubmult;zsubnE;zsubne;zsubplus;zsubrarr;zSubset;zsubset;z	subseteq;z
subseteqq;zSubsetEqual;z
subsetneq;zsubsetneqq;zsubsim;zsubsub;zsubsup;zsucc;zsuccapprox;zsucccurlyeq;z	Succeeds;zSucceedsEqual;zSucceedsSlantEqual;zSucceedsTilde;zsucceq;zsuccnapprox;z	succneqq;z	succnsim;zsuccsim;z	SuchThat;zSum;zsum;zsung;r�zsup1;r�zsup2;r�zsup3;zSup;zsup;zsupdot;zsupdsub;zsupE;zsupe;zsupedot;z	Superset;zSupersetEqual;zsuphsol;zsuphsub;zsuplarr;zsupmult;zsupnE;zsupne;zsupplus;zSupset;zsupset;z	supseteq;z
supseteqq;z
supsetneq;zsupsetneqq;zsupsim;zsupsub;zsupsup;zswarhk;zswArr;zswarr;zswarrow;zswnwar;r�zszlig;zTab;ztarget;zTau;ztau;ztbrk;zTcaron;ztcaron;zTcedil;ztcedil;zTcy;ztcy;ztdot;ztelrec;zTfr;ztfr;zthere4;z
Therefore;z
therefore;zTheta;ztheta;z	thetasym;zthetav;zthickapprox;z	thicksim;zThickSpace;zthinsp;z
ThinSpace;zthkap;zthksim;r�r�zTHORN;zthorn;zTilde;ztilde;zTildeEqual;zTildeFullEqual;zTildeTilde;r�ztimes;ztimesb;z	timesbar;ztimesd;ztint;ztoea;ztop;ztopbot;ztopcir;zTopf;ztopf;ztopfork;ztosa;ztprime;zTRADE;ztrade;z	triangle;z
triangledown;z
triangleleft;ztrianglelefteq;z
triangleq;ztriangleright;ztrianglerighteq;ztridot;ztrie;z	triminus;z
TripleDot;ztriplus;ztrisb;ztritime;z	trpezium;zTscr;ztscr;zTScy;ztscy;zTSHcy;ztshcy;zTstrok;ztstrok;ztwixt;ztwoheadleftarrow;ztwoheadrightarrow;r�r�zUacute;zuacute;zUarr;zuArr;zuarr;z	Uarrocir;zUbrcy;zubrcy;zUbreve;zubreve;r�r�zUcirc;zucirc;zUcy;zucy;zudarr;zUdblac;zudblac;zudhar;zufisht;zUfr;zufr;r�r�zUgrave;zugrave;zuHar;zuharl;zuharr;zuhblk;zulcorn;z	ulcorner;zulcrop;zultri;zUmacr;zumacr;r�zuml;z	UnderBar;zUnderBrace;z
UnderBracket;zUnderParenthesis;zUnion;z
UnionPlus;zUogon;zuogon;zUopf;zuopf;zUpArrow;zUparrow;zuparrow;zUpArrowBar;zUpArrowDownArrow;zUpDownArrow;zUpdownarrow;zupdownarrow;zUpEquilibrium;zupharpoonleft;zupharpoonright;zuplus;zUpperLeftArrow;zUpperRightArrow;zUpsi;zupsi;zupsih;zUpsilon;zupsilon;zUpTee;zUpTeeArrow;zupuparrows;zurcorn;z	urcorner;zurcrop;zUring;zuring;zurtri;zUscr;zuscr;zutdot;zUtilde;zutilde;zutri;zutrif;zuuarr;r�r�zUuml;zuuml;zuwangle;zvangrt;zvarepsilon;z	varkappa;zvarnothing;zvarphi;zvarpi;z
varpropto;zvArr;zvarr;zvarrho;z	varsigma;z
varsubsetneq;zvarsubsetneqq;z
varsupsetneq;zvarsupsetneqq;z	vartheta;zvartriangleleft;zvartriangleright;zVbar;zvBar;zvBarv;zVcy;zvcy;zVDash;zVdash;zvDash;zvdash;zVdashl;zVee;zvee;zveebar;zveeeq;zvellip;zVerbar;zverbar;zVert;zvert;zVerticalBar;z
VerticalLine;zVerticalSeparator;zVerticalTilde;zVeryThinSpace;zVfr;zvfr;zvltri;zvnsub;zvnsup;zVopf;zvopf;zvprop;zvrtri;zVscr;zvscr;zvsubnE;zvsubne;zvsupnE;zvsupne;zVvdash;zvzigzag;zWcirc;zwcirc;zwedbar;zWedge;zwedge;zwedgeq;zweierp;zWfr;zwfr;zWopf;zwopf;zwp;zwr;zwreath;zWscr;zwscr;zxcap;zxcirc;zxcup;zxdtri;zXfr;zxfr;zxhArr;zxharr;zXi;zxi;zxlArr;zxlarr;zxmap;zxnis;zxodot;zXopf;zxopf;zxoplus;zxotime;zxrArr;zxrarr;zXscr;zxscr;zxsqcup;zxuplus;zxutri;zxvee;zxwedge;r�r�zYacute;zyacute;zYAcy;zyacy;zYcirc;zycirc;zYcy;zycy;r�zyen;zYfr;zyfr;zYIcy;zyicy;zYopf;zyopf;zYscr;zyscr;zYUcy;zyucy;r�zYuml;zyuml;zZacute;zzacute;zZcaron;zzcaron;zZcy;zzcy;zZdot;zzdot;zzeetrf;zZeroWidthSpace;zZeta;zzeta;zZfr;zzfr;zZHcy;zzhcy;zzigrarr;zZopf;zzopf;zZscr;zzscr;zzwj;zzwnj;N)
�__doc__�__all__rrrr�items�nameZ	codepoint�chr�r`r`�%/usr/lib64/python3.8/html/entities.py�<module>s���������������������
Lhtml/__pycache__/__init__.cpython-38.opt-2.pyc000064400000005621151153537530015063 0ustar00U

e5d��~@s�ddlZddlmZddgZd�dd�Zddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)�"Zd*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�h~Zd�d��Z	e�
d��Zd�d�ZdS)��N)�html5�escape�unescapeTcCsD|�dd�}|�dd�}|�dd�}|r@|�dd�}|�d	d
�}|S)N�&z&amp;�<z&lt;�>z&gt;�"z&quot;�'z&#x27;)�replace)�sZquote�r�%/usr/lib64/python3.8/html/__init__.pyrs���
u€�u‚uƒu„u…u†u‡uˆu‰uŠu‹uŒ�uŽ��u‘u’u“u”u•u–u—u˜u™ušu›uœ�užuŸ)"r�
�����������������������������������������������������������rrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��	i��	i��
i��
i��i��i��i��i��
i��
i��i��i��i��i���cCs�|�d�}|ddkr�|ddkr<t|dd��d�d�}nt|dd��d��}|tkrbt|Sd|krvd	ks�n|d
kr�dS|tkr�dSt|�S|tkr�t|Stt|�ddd
�D]4}|d|�tkr�t|d|�||d�Sq�d|SdS)Nr6r�#ZxXr7�;r@i�i��rRr����r)	�group�int�rstrip�_invalid_charrefs�_invalid_codepoints�chr�_html5�range�len)rZnum�xrrr
�_replace_charref[s$
"raz7&(#[0-9]+;?|#[xX][0-9a-fA-F]+;?|[^\t\n\f <&#;]{1,32};?)cCsd|kr|St�t|�S)Nr)�_charref�subra)rrrr
rzs)T)
�reZ_reZ
html.entitiesrr]�__all__rrZr[ra�compilerbrrrrr
�<module>sP
�'�
html/__pycache__/__init__.cpython-38.pyc000064400000007044151153537530014124 0ustar00U

e5d��~@s�dZddlZddlmZddgZd�dd�Zdd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*�"Zd+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�h~Z	d�d��Z
e�d��Zd�d�Z
dS)�z*
General functions for HTML manipulation.
�N)�html5�escape�unescapeTcCsD|�dd�}|�dd�}|�dd�}|r@|�dd�}|�d	d
�}|S)z�
    Replace special characters "&", "<" and ">" to HTML-safe sequences.
    If the optional flag quote is true (the default), the quotation mark
    characters, both double quote (") and single quote (') characters are also
    translated.
    �&z&amp;�<z&lt;�>z&gt;�"z&quot;�'z&#x27;)�replace)�sZquote�r�%/usr/lib64/python3.8/html/__init__.pyrs���
u€�u‚uƒu„u…u†u‡uˆu‰uŠu‹uŒ�uŽ��u‘u’u“u”u•u–u—u˜u™ušu›uœ�užuŸ)"r�
�����������������������������������������������������������rrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��	i��	i��
i��
i��i��i��i��i��
i��
i��i��i��i��i���cCs�|�d�}|ddkr�|ddkr<t|dd��d�d�}nt|dd��d��}|tkrbt|Sd|krvd	ks�n|d
kr�dS|tkr�dSt|�S|tkr�t|Stt|�ddd
�D]4}|d|�tkr�t|d|�||d�Sq�d|SdS)Nr6r�#ZxXr7�;r@i�i��rRr����r)	�group�int�rstrip�_invalid_charrefs�_invalid_codepoints�chr�_html5�range�len)rZnum�xrrr
�_replace_charref[s$
"raz7&(#[0-9]+;?|#[xX][0-9a-fA-F]+;?|[^\t\n\f <&#;]{1,32};?)cCsd|kr|St�t|�S)a^
    Convert all named and numeric character references (e.g. &gt;, &#62;,
    &x3e;) in the string s to the corresponding unicode characters.
    This function uses the rules defined by the HTML 5 standard
    for both valid and invalid character references, and the list of
    HTML 5 named character references defined in html.entities.html5.
    r)�_charref�subra)rrrr
rzs)T)�__doc__�reZ_reZ
html.entitiesrr]�__all__rrZr[ra�compilerbrrrrr
�<module>sR
�'�
_strptime.py000064400000061264151153537530007145 0ustar00"""Strptime-related classes and functions.

CLASSES:
    LocaleTime -- Discovers and stores locale-specific time information
    TimeRE -- Creates regexes for pattern matching a string of text containing
                time information

FUNCTIONS:
    _getlang -- Figure out what language is being used for the locale
    strptime -- Calculates the time struct represented by the passed-in string

"""
import time
import locale
import calendar
from re import compile as re_compile
from re import IGNORECASE
from re import escape as re_escape
from datetime import (date as datetime_date,
                      timedelta as datetime_timedelta,
                      timezone as datetime_timezone)
from _thread import allocate_lock as _thread_allocate_lock

__all__ = []

def _getlang():
    # Figure out what the current language is set to.
    return locale.getlocale(locale.LC_TIME)

class LocaleTime(object):
    """Stores and handles locale-specific information related to time.

    ATTRIBUTES:
        f_weekday -- full weekday names (7-item list)
        a_weekday -- abbreviated weekday names (7-item list)
        f_month -- full month names (13-item list; dummy value in [0], which
                    is added by code)
        a_month -- abbreviated month names (13-item list, dummy value in
                    [0], which is added by code)
        am_pm -- AM/PM representation (2-item list)
        LC_date_time -- format string for date/time representation (string)
        LC_date -- format string for date representation (string)
        LC_time -- format string for time representation (string)
        timezone -- daylight- and non-daylight-savings timezone representation
                    (2-item list of sets)
        lang -- Language used by instance (2-item tuple)
    """

    def __init__(self):
        """Set all attributes.

        Order of methods called matters for dependency reasons.

        The locale language is set at the offset and then checked again before
        exiting.  This is to make sure that the attributes were not set with a
        mix of information from more than one locale.  This would most likely
        happen when using threads where one thread calls a locale-dependent
        function while another thread changes the locale while the function in
        the other thread is still running.  Proper coding would call for
        locks to prevent changing the locale while locale-dependent code is
        running.  The check here is done in case someone does not think about
        doing this.

        Only other possible issue is if someone changed the timezone and did
        not call tz.tzset .  That is an issue for the programmer, though,
        since changing the timezone is worthless without that call.

        """
        self.lang = _getlang()
        self.__calc_weekday()
        self.__calc_month()
        self.__calc_am_pm()
        self.__calc_timezone()
        self.__calc_date_time()
        if _getlang() != self.lang:
            raise ValueError("locale changed during initialization")
        if time.tzname != self.tzname or time.daylight != self.daylight:
            raise ValueError("timezone changed during initialization")

    def __calc_weekday(self):
        # Set self.a_weekday and self.f_weekday using the calendar
        # module.
        a_weekday = [calendar.day_abbr[i].lower() for i in range(7)]
        f_weekday = [calendar.day_name[i].lower() for i in range(7)]
        self.a_weekday = a_weekday
        self.f_weekday = f_weekday

    def __calc_month(self):
        # Set self.f_month and self.a_month using the calendar module.
        a_month = [calendar.month_abbr[i].lower() for i in range(13)]
        f_month = [calendar.month_name[i].lower() for i in range(13)]
        self.a_month = a_month
        self.f_month = f_month

    def __calc_am_pm(self):
        # Set self.am_pm by using time.strftime().

        # The magic date (1999,3,17,hour,44,55,2,76,0) is not really that
        # magical; just happened to have used it everywhere else where a
        # static date was needed.
        am_pm = []
        for hour in (1, 22):
            time_tuple = time.struct_time((1999,3,17,hour,44,55,2,76,0))
            am_pm.append(time.strftime("%p", time_tuple).lower())
        self.am_pm = am_pm

    def __calc_date_time(self):
        # Set self.date_time, self.date, & self.time by using
        # time.strftime().

        # Use (1999,3,17,22,44,55,2,76,0) for magic date because the amount of
        # overloaded numbers is minimized.  The order in which searches for
        # values within the format string is very important; it eliminates
        # possible ambiguity for what something represents.
        time_tuple = time.struct_time((1999,3,17,22,44,55,2,76,0))
        date_time = [None, None, None]
        date_time[0] = time.strftime("%c", time_tuple).lower()
        date_time[1] = time.strftime("%x", time_tuple).lower()
        date_time[2] = time.strftime("%X", time_tuple).lower()
        replacement_pairs = [('%', '%%'), (self.f_weekday[2], '%A'),
                    (self.f_month[3], '%B'), (self.a_weekday[2], '%a'),
                    (self.a_month[3], '%b'), (self.am_pm[1], '%p'),
                    ('1999', '%Y'), ('99', '%y'), ('22', '%H'),
                    ('44', '%M'), ('55', '%S'), ('76', '%j'),
                    ('17', '%d'), ('03', '%m'), ('3', '%m'),
                    # '3' needed for when no leading zero.
                    ('2', '%w'), ('10', '%I')]
        replacement_pairs.extend([(tz, "%Z") for tz_values in self.timezone
                                                for tz in tz_values])
        for offset,directive in ((0,'%c'), (1,'%x'), (2,'%X')):
            current_format = date_time[offset]
            for old, new in replacement_pairs:
                # Must deal with possible lack of locale info
                # manifesting itself as the empty string (e.g., Swedish's
                # lack of AM/PM info) or a platform returning a tuple of empty
                # strings (e.g., MacOS 9 having timezone as ('','')).
                if old:
                    current_format = current_format.replace(old, new)
            # If %W is used, then Sunday, 2005-01-03 will fall on week 0 since
            # 2005-01-03 occurs before the first Monday of the year.  Otherwise
            # %U is used.
            time_tuple = time.struct_time((1999,1,3,1,1,1,6,3,0))
            if '00' in time.strftime(directive, time_tuple):
                U_W = '%W'
            else:
                U_W = '%U'
            date_time[offset] = current_format.replace('11', U_W)
        self.LC_date_time = date_time[0]
        self.LC_date = date_time[1]
        self.LC_time = date_time[2]

    def __calc_timezone(self):
        # Set self.timezone by using time.tzname.
        # Do not worry about possibility of time.tzname[0] == time.tzname[1]
        # and time.daylight; handle that in strptime.
        try:
            time.tzset()
        except AttributeError:
            pass
        self.tzname = time.tzname
        self.daylight = time.daylight
        no_saving = frozenset({"utc", "gmt", self.tzname[0].lower()})
        if self.daylight:
            has_saving = frozenset({self.tzname[1].lower()})
        else:
            has_saving = frozenset()
        self.timezone = (no_saving, has_saving)


class TimeRE(dict):
    """Handle conversion from format directives to regexes."""

    def __init__(self, locale_time=None):
        """Create keys/values.

        Order of execution is important for dependency reasons.

        """
        if locale_time:
            self.locale_time = locale_time
        else:
            self.locale_time = LocaleTime()
        base = super()
        base.__init__({
            # The " \d" part of the regex is to make %c from ANSI C work
            'd': r"(?P<d>3[0-1]|[1-2]\d|0[1-9]|[1-9]| [1-9])",
            'f': r"(?P<f>[0-9]{1,6})",
            'H': r"(?P<H>2[0-3]|[0-1]\d|\d)",
            'I': r"(?P<I>1[0-2]|0[1-9]|[1-9])",
            'G': r"(?P<G>\d\d\d\d)",
            'j': r"(?P<j>36[0-6]|3[0-5]\d|[1-2]\d\d|0[1-9]\d|00[1-9]|[1-9]\d|0[1-9]|[1-9])",
            'm': r"(?P<m>1[0-2]|0[1-9]|[1-9])",
            'M': r"(?P<M>[0-5]\d|\d)",
            'S': r"(?P<S>6[0-1]|[0-5]\d|\d)",
            'U': r"(?P<U>5[0-3]|[0-4]\d|\d)",
            'w': r"(?P<w>[0-6])",
            'u': r"(?P<u>[1-7])",
            'V': r"(?P<V>5[0-3]|0[1-9]|[1-4]\d|\d)",
            # W is set below by using 'U'
            'y': r"(?P<y>\d\d)",
            #XXX: Does 'Y' need to worry about having less or more than
            #     4 digits?
            'Y': r"(?P<Y>\d\d\d\d)",
            'z': r"(?P<z>[+-]\d\d:?[0-5]\d(:?[0-5]\d(\.\d{1,6})?)?|Z)",
            'A': self.__seqToRE(self.locale_time.f_weekday, 'A'),
            'a': self.__seqToRE(self.locale_time.a_weekday, 'a'),
            'B': self.__seqToRE(self.locale_time.f_month[1:], 'B'),
            'b': self.__seqToRE(self.locale_time.a_month[1:], 'b'),
            'p': self.__seqToRE(self.locale_time.am_pm, 'p'),
            'Z': self.__seqToRE((tz for tz_names in self.locale_time.timezone
                                        for tz in tz_names),
                                'Z'),
            '%': '%'})
        base.__setitem__('W', base.__getitem__('U').replace('U', 'W'))
        base.__setitem__('c', self.pattern(self.locale_time.LC_date_time))
        base.__setitem__('x', self.pattern(self.locale_time.LC_date))
        base.__setitem__('X', self.pattern(self.locale_time.LC_time))

    def __seqToRE(self, to_convert, directive):
        """Convert a list to a regex string for matching a directive.

        Want possible matching values to be from longest to shortest.  This
        prevents the possibility of a match occurring for a value that also
        a substring of a larger value that should have matched (e.g., 'abc'
        matching when 'abcdef' should have been the match).

        """
        to_convert = sorted(to_convert, key=len, reverse=True)
        for value in to_convert:
            if value != '':
                break
        else:
            return ''
        regex = '|'.join(re_escape(stuff) for stuff in to_convert)
        regex = '(?P<%s>%s' % (directive, regex)
        return '%s)' % regex

    def pattern(self, format):
        """Return regex pattern for the format string.

        Need to make sure that any characters that might be interpreted as
        regex syntax are escaped.

        """
        processed_format = ''
        # The sub() call escapes all characters that might be misconstrued
        # as regex syntax.  Cannot use re.escape since we have to deal with
        # format directives (%m, etc.).
        regex_chars = re_compile(r"([\\.^$*+?\(\){}\[\]|])")
        format = regex_chars.sub(r"\\\1", format)
        whitespace_replacement = re_compile(r'\s+')
        format = whitespace_replacement.sub(r'\\s+', format)
        while '%' in format:
            directive_index = format.index('%')+1
            processed_format = "%s%s%s" % (processed_format,
                                           format[:directive_index-1],
                                           self[format[directive_index]])
            format = format[directive_index+1:]
        return "%s%s" % (processed_format, format)

    def compile(self, format):
        """Return a compiled re object for the format string."""
        return re_compile(self.pattern(format), IGNORECASE)

_cache_lock = _thread_allocate_lock()
# DO NOT modify _TimeRE_cache or _regex_cache without acquiring the cache lock
# first!
_TimeRE_cache = TimeRE()
_CACHE_MAX_SIZE = 5 # Max number of regexes stored in _regex_cache
_regex_cache = {}

def _calc_julian_from_U_or_W(year, week_of_year, day_of_week, week_starts_Mon):
    """Calculate the Julian day based on the year, week of the year, and day of
    the week, with week_start_day representing whether the week of the year
    assumes the week starts on Sunday or Monday (6 or 0)."""
    first_weekday = datetime_date(year, 1, 1).weekday()
    # If we are dealing with the %U directive (week starts on Sunday), it's
    # easier to just shift the view to Sunday being the first day of the
    # week.
    if not week_starts_Mon:
        first_weekday = (first_weekday + 1) % 7
        day_of_week = (day_of_week + 1) % 7
    # Need to watch out for a week 0 (when the first day of the year is not
    # the same as that specified by %U or %W).
    week_0_length = (7 - first_weekday) % 7
    if week_of_year == 0:
        return 1 + day_of_week - first_weekday
    else:
        days_to_week = week_0_length + (7 * (week_of_year - 1))
        return 1 + days_to_week + day_of_week


def _calc_julian_from_V(iso_year, iso_week, iso_weekday):
    """Calculate the Julian day based on the ISO 8601 year, week, and weekday.
    ISO weeks start on Mondays, with week 01 being the week containing 4 Jan.
    ISO week days range from 1 (Monday) to 7 (Sunday).
    """
    correction = datetime_date(iso_year, 1, 4).isoweekday() + 3
    ordinal = (iso_week * 7) + iso_weekday - correction
    # ordinal may be negative or 0 now, which means the date is in the previous
    # calendar year
    if ordinal < 1:
        ordinal += datetime_date(iso_year, 1, 1).toordinal()
        iso_year -= 1
        ordinal -= datetime_date(iso_year, 1, 1).toordinal()
    return iso_year, ordinal


def _strptime(data_string, format="%a %b %d %H:%M:%S %Y"):
    """Return a 2-tuple consisting of a time struct and an int containing
    the number of microseconds based on the input string and the
    format string."""

    for index, arg in enumerate([data_string, format]):
        if not isinstance(arg, str):
            msg = "strptime() argument {} must be str, not {}"
            raise TypeError(msg.format(index, type(arg)))

    global _TimeRE_cache, _regex_cache
    with _cache_lock:
        locale_time = _TimeRE_cache.locale_time
        if (_getlang() != locale_time.lang or
            time.tzname != locale_time.tzname or
            time.daylight != locale_time.daylight):
            _TimeRE_cache = TimeRE()
            _regex_cache.clear()
            locale_time = _TimeRE_cache.locale_time
        if len(_regex_cache) > _CACHE_MAX_SIZE:
            _regex_cache.clear()
        format_regex = _regex_cache.get(format)
        if not format_regex:
            try:
                format_regex = _TimeRE_cache.compile(format)
            # KeyError raised when a bad format is found; can be specified as
            # \\, in which case it was a stray % but with a space after it
            except KeyError as err:
                bad_directive = err.args[0]
                if bad_directive == "\\":
                    bad_directive = "%"
                del err
                raise ValueError("'%s' is a bad directive in format '%s'" %
                                    (bad_directive, format)) from None
            # IndexError only occurs when the format string is "%"
            except IndexError:
                raise ValueError("stray %% in format '%s'" % format) from None
            _regex_cache[format] = format_regex
    found = format_regex.match(data_string)
    if not found:
        raise ValueError("time data %r does not match format %r" %
                         (data_string, format))
    if len(data_string) != found.end():
        raise ValueError("unconverted data remains: %s" %
                          data_string[found.end():])

    iso_year = year = None
    month = day = 1
    hour = minute = second = fraction = 0
    tz = -1
    gmtoff = None
    gmtoff_fraction = 0
    # Default to -1 to signify that values not known; not critical to have,
    # though
    iso_week = week_of_year = None
    week_of_year_start = None
    # weekday and julian defaulted to None so as to signal need to calculate
    # values
    weekday = julian = None
    found_dict = found.groupdict()
    for group_key in found_dict.keys():
        # Directives not explicitly handled below:
        #   c, x, X
        #      handled by making out of other directives
        #   U, W
        #      worthless without day of the week
        if group_key == 'y':
            year = int(found_dict['y'])
            # Open Group specification for strptime() states that a %y
            #value in the range of [00, 68] is in the century 2000, while
            #[69,99] is in the century 1900
            if year <= 68:
                year += 2000
            else:
                year += 1900
        elif group_key == 'Y':
            year = int(found_dict['Y'])
        elif group_key == 'G':
            iso_year = int(found_dict['G'])
        elif group_key == 'm':
            month = int(found_dict['m'])
        elif group_key == 'B':
            month = locale_time.f_month.index(found_dict['B'].lower())
        elif group_key == 'b':
            month = locale_time.a_month.index(found_dict['b'].lower())
        elif group_key == 'd':
            day = int(found_dict['d'])
        elif group_key == 'H':
            hour = int(found_dict['H'])
        elif group_key == 'I':
            hour = int(found_dict['I'])
            ampm = found_dict.get('p', '').lower()
            # If there was no AM/PM indicator, we'll treat this like AM
            if ampm in ('', locale_time.am_pm[0]):
                # We're in AM so the hour is correct unless we're
                # looking at 12 midnight.
                # 12 midnight == 12 AM == hour 0
                if hour == 12:
                    hour = 0
            elif ampm == locale_time.am_pm[1]:
                # We're in PM so we need to add 12 to the hour unless
                # we're looking at 12 noon.
                # 12 noon == 12 PM == hour 12
                if hour != 12:
                    hour += 12
        elif group_key == 'M':
            minute = int(found_dict['M'])
        elif group_key == 'S':
            second = int(found_dict['S'])
        elif group_key == 'f':
            s = found_dict['f']
            # Pad to always return microseconds.
            s += "0" * (6 - len(s))
            fraction = int(s)
        elif group_key == 'A':
            weekday = locale_time.f_weekday.index(found_dict['A'].lower())
        elif group_key == 'a':
            weekday = locale_time.a_weekday.index(found_dict['a'].lower())
        elif group_key == 'w':
            weekday = int(found_dict['w'])
            if weekday == 0:
                weekday = 6
            else:
                weekday -= 1
        elif group_key == 'u':
            weekday = int(found_dict['u'])
            weekday -= 1
        elif group_key == 'j':
            julian = int(found_dict['j'])
        elif group_key in ('U', 'W'):
            week_of_year = int(found_dict[group_key])
            if group_key == 'U':
                # U starts week on Sunday.
                week_of_year_start = 6
            else:
                # W starts week on Monday.
                week_of_year_start = 0
        elif group_key == 'V':
            iso_week = int(found_dict['V'])
        elif group_key == 'z':
            z = found_dict['z']
            if z == 'Z':
                gmtoff = 0
            else:
                if z[3] == ':':
                    z = z[:3] + z[4:]
                    if len(z) > 5:
                        if z[5] != ':':
                            msg = f"Inconsistent use of : in {found_dict['z']}"
                            raise ValueError(msg)
                        z = z[:5] + z[6:]
                hours = int(z[1:3])
                minutes = int(z[3:5])
                seconds = int(z[5:7] or 0)
                gmtoff = (hours * 60 * 60) + (minutes * 60) + seconds
                gmtoff_remainder = z[8:]
                # Pad to always return microseconds.
                gmtoff_remainder_padding = "0" * (6 - len(gmtoff_remainder))
                gmtoff_fraction = int(gmtoff_remainder + gmtoff_remainder_padding)
                if z.startswith("-"):
                    gmtoff = -gmtoff
                    gmtoff_fraction = -gmtoff_fraction
        elif group_key == 'Z':
            # Since -1 is default value only need to worry about setting tz if
            # it can be something other than -1.
            found_zone = found_dict['Z'].lower()
            for value, tz_values in enumerate(locale_time.timezone):
                if found_zone in tz_values:
                    # Deal with bad locale setup where timezone names are the
                    # same and yet time.daylight is true; too ambiguous to
                    # be able to tell what timezone has daylight savings
                    if (time.tzname[0] == time.tzname[1] and
                       time.daylight and found_zone not in ("utc", "gmt")):
                        break
                    else:
                        tz = value
                        break
    # Deal with the cases where ambiguities arize
    # don't assume default values for ISO week/year
    if year is None and iso_year is not None:
        if iso_week is None or weekday is None:
            raise ValueError("ISO year directive '%G' must be used with "
                             "the ISO week directive '%V' and a weekday "
                             "directive ('%A', '%a', '%w', or '%u').")
        if julian is not None:
            raise ValueError("Day of the year directive '%j' is not "
                             "compatible with ISO year directive '%G'. "
                             "Use '%Y' instead.")
    elif week_of_year is None and iso_week is not None:
        if weekday is None:
            raise ValueError("ISO week directive '%V' must be used with "
                             "the ISO year directive '%G' and a weekday "
                             "directive ('%A', '%a', '%w', or '%u').")
        else:
            raise ValueError("ISO week directive '%V' is incompatible with "
                             "the year directive '%Y'. Use the ISO year '%G' "
                             "instead.")

    leap_year_fix = False
    if year is None and month == 2 and day == 29:
        year = 1904  # 1904 is first leap year of 20th century
        leap_year_fix = True
    elif year is None:
        year = 1900


    # If we know the week of the year and what day of that week, we can figure
    # out the Julian day of the year.
    if julian is None and weekday is not None:
        if week_of_year is not None:
            week_starts_Mon = True if week_of_year_start == 0 else False
            julian = _calc_julian_from_U_or_W(year, week_of_year, weekday,
                                                week_starts_Mon)
        elif iso_year is not None and iso_week is not None:
            year, julian = _calc_julian_from_V(iso_year, iso_week, weekday + 1)
        if julian is not None and julian <= 0:
            year -= 1
            yday = 366 if calendar.isleap(year) else 365
            julian += yday

    if julian is None:
        # Cannot pre-calculate datetime_date() since can change in Julian
        # calculation and thus could have different value for the day of
        # the week calculation.
        # Need to add 1 to result since first day of the year is 1, not 0.
        julian = datetime_date(year, month, day).toordinal() - \
                  datetime_date(year, 1, 1).toordinal() + 1
    else:  # Assume that if they bothered to include Julian day (or if it was
           # calculated above with year/week/weekday) it will be accurate.
        datetime_result = datetime_date.fromordinal(
                            (julian - 1) +
                            datetime_date(year, 1, 1).toordinal())
        year = datetime_result.year
        month = datetime_result.month
        day = datetime_result.day
    if weekday is None:
        weekday = datetime_date(year, month, day).weekday()
    # Add timezone info
    tzname = found_dict.get("Z")

    if leap_year_fix:
        # the caller didn't supply a year but asked for Feb 29th. We couldn't
        # use the default of 1900 for computations. We set it back to ensure
        # that February 29th is smaller than March 1st.
        year = 1900

    return (year, month, day,
            hour, minute, second,
            weekday, julian, tz, tzname, gmtoff), fraction, gmtoff_fraction

def _strptime_time(data_string, format="%a %b %d %H:%M:%S %Y"):
    """Return a time struct based on the input string and the
    format string."""
    tt = _strptime(data_string, format)[0]
    return time.struct_time(tt[:time._STRUCT_TM_ITEMS])

def _strptime_datetime(cls, data_string, format="%a %b %d %H:%M:%S %Y"):
    """Return a class cls instance based on the input string and the
    format string."""
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
    tzname, gmtoff = tt[-2:]
    args = tt[:6] + (fraction,)
    if gmtoff is not None:
        tzdelta = datetime_timedelta(seconds=gmtoff, microseconds=gmtoff_fraction)
        if tzname:
            tz = datetime_timezone(tzdelta, tzname)
        else:
            tz = datetime_timezone(tzdelta)
        args += (tz,)

    return cls(*args)
symbol.py000064400000004075151153537530006441 0ustar00"""Non-terminal symbols of Python grammar (from "graminit.h")."""

#  This file is automatically generated; please don't muck it up!
#
#  To update the symbols in this file, 'cd' to the top directory of
#  the python source tree after building the interpreter and run:
#
#    python3 Tools/scripts/generate_symbol_py.py Include/graminit.h Lib/symbol.py
#
# or just
#
#    make regen-symbol

#--start constants--
single_input = 256
file_input = 257
eval_input = 258
decorator = 259
decorators = 260
decorated = 261
async_funcdef = 262
funcdef = 263
parameters = 264
typedargslist = 265
tfpdef = 266
varargslist = 267
vfpdef = 268
stmt = 269
simple_stmt = 270
small_stmt = 271
expr_stmt = 272
annassign = 273
testlist_star_expr = 274
augassign = 275
del_stmt = 276
pass_stmt = 277
flow_stmt = 278
break_stmt = 279
continue_stmt = 280
return_stmt = 281
yield_stmt = 282
raise_stmt = 283
import_stmt = 284
import_name = 285
import_from = 286
import_as_name = 287
dotted_as_name = 288
import_as_names = 289
dotted_as_names = 290
dotted_name = 291
global_stmt = 292
nonlocal_stmt = 293
assert_stmt = 294
compound_stmt = 295
async_stmt = 296
if_stmt = 297
while_stmt = 298
for_stmt = 299
try_stmt = 300
with_stmt = 301
with_item = 302
except_clause = 303
suite = 304
namedexpr_test = 305
test = 306
test_nocond = 307
lambdef = 308
lambdef_nocond = 309
or_test = 310
and_test = 311
not_test = 312
comparison = 313
comp_op = 314
star_expr = 315
expr = 316
xor_expr = 317
and_expr = 318
shift_expr = 319
arith_expr = 320
term = 321
factor = 322
power = 323
atom_expr = 324
atom = 325
testlist_comp = 326
trailer = 327
subscriptlist = 328
subscript = 329
sliceop = 330
exprlist = 331
testlist = 332
dictorsetmaker = 333
classdef = 334
arglist = 335
argument = 336
comp_iter = 337
sync_comp_for = 338
comp_for = 339
comp_if = 340
encoding_decl = 341
yield_expr = 342
yield_arg = 343
func_body_suite = 344
func_type_input = 345
func_type = 346
typelist = 347
#--end constants--

sym_name = {}
for _name, _value in list(globals().items()):
    if type(_value) is type(0):
        sym_name[_value] = _name
del _name, _value
types.py000064400000022761151153537530006302 0ustar00"""
Define names for built-in types that aren't directly accessible as a builtin.
"""
import sys

# Iterators in Python aren't a matter of type but of protocol.  A large
# and changing number of builtin types implement *some* flavor of
# iterator.  Don't check the type!  Use hasattr to check for both
# "__iter__" and "__next__" attributes instead.

def _f(): pass
FunctionType = type(_f)
LambdaType = type(lambda: None)         # Same as FunctionType
CodeType = type(_f.__code__)
MappingProxyType = type(type.__dict__)
SimpleNamespace = type(sys.implementation)

def _cell_factory():
    a = 1
    def f():
        nonlocal a
    return f.__closure__[0]
CellType = type(_cell_factory())

def _g():
    yield 1
GeneratorType = type(_g())

async def _c(): pass
_c = _c()
CoroutineType = type(_c)
_c.close()  # Prevent ResourceWarning

async def _ag():
    yield
_ag = _ag()
AsyncGeneratorType = type(_ag)

class _C:
    def _m(self): pass
MethodType = type(_C()._m)

BuiltinFunctionType = type(len)
BuiltinMethodType = type([].append)     # Same as BuiltinFunctionType

WrapperDescriptorType = type(object.__init__)
MethodWrapperType = type(object().__str__)
MethodDescriptorType = type(str.join)
ClassMethodDescriptorType = type(dict.__dict__['fromkeys'])

ModuleType = type(sys)

try:
    raise TypeError
except TypeError:
    tb = sys.exc_info()[2]
    TracebackType = type(tb)
    FrameType = type(tb.tb_frame)
    tb = None; del tb

# For Jython, the following two types are identical
GetSetDescriptorType = type(FunctionType.__code__)
MemberDescriptorType = type(FunctionType.__globals__)

del sys, _f, _g, _C, _c, _ag  # Not for export


# Provide a PEP 3115 compliant mechanism for class creation
def new_class(name, bases=(), kwds=None, exec_body=None):
    """Create a class object dynamically using the appropriate metaclass."""
    resolved_bases = resolve_bases(bases)
    meta, ns, kwds = prepare_class(name, resolved_bases, kwds)
    if exec_body is not None:
        exec_body(ns)
    if resolved_bases is not bases:
        ns['__orig_bases__'] = bases
    return meta(name, resolved_bases, ns, **kwds)

def resolve_bases(bases):
    """Resolve MRO entries dynamically as specified by PEP 560."""
    new_bases = list(bases)
    updated = False
    shift = 0
    for i, base in enumerate(bases):
        if isinstance(base, type):
            continue
        if not hasattr(base, "__mro_entries__"):
            continue
        new_base = base.__mro_entries__(bases)
        updated = True
        if not isinstance(new_base, tuple):
            raise TypeError("__mro_entries__ must return a tuple")
        else:
            new_bases[i+shift:i+shift+1] = new_base
            shift += len(new_base) - 1
    if not updated:
        return bases
    return tuple(new_bases)

def prepare_class(name, bases=(), kwds=None):
    """Call the __prepare__ method of the appropriate metaclass.

    Returns (metaclass, namespace, kwds) as a 3-tuple

    *metaclass* is the appropriate metaclass
    *namespace* is the prepared class namespace
    *kwds* is an updated copy of the passed in kwds argument with any
    'metaclass' entry removed. If no kwds argument is passed in, this will
    be an empty dict.
    """
    if kwds is None:
        kwds = {}
    else:
        kwds = dict(kwds) # Don't alter the provided mapping
    if 'metaclass' in kwds:
        meta = kwds.pop('metaclass')
    else:
        if bases:
            meta = type(bases[0])
        else:
            meta = type
    if isinstance(meta, type):
        # when meta is a type, we first determine the most-derived metaclass
        # instead of invoking the initial candidate directly
        meta = _calculate_meta(meta, bases)
    if hasattr(meta, '__prepare__'):
        ns = meta.__prepare__(name, bases, **kwds)
    else:
        ns = {}
    return meta, ns, kwds

def _calculate_meta(meta, bases):
    """Calculate the most derived metaclass."""
    winner = meta
    for base in bases:
        base_meta = type(base)
        if issubclass(winner, base_meta):
            continue
        if issubclass(base_meta, winner):
            winner = base_meta
            continue
        # else:
        raise TypeError("metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases")
    return winner

class DynamicClassAttribute:
    """Route attribute access on a class to __getattr__.

    This is a descriptor, used to define attributes that act differently when
    accessed through an instance and through a class.  Instance access remains
    normal, but access to an attribute through a class will be routed to the
    class's __getattr__ method; this is done by raising AttributeError.

    This allows one to have properties active on an instance, and have virtual
    attributes on the class with the same name (see Enum for an example).

    """
    def __init__(self, fget=None, fset=None, fdel=None, doc=None):
        self.fget = fget
        self.fset = fset
        self.fdel = fdel
        # next two lines make DynamicClassAttribute act the same as property
        self.__doc__ = doc or fget.__doc__
        self.overwrite_doc = doc is None
        # support for abstract methods
        self.__isabstractmethod__ = bool(getattr(fget, '__isabstractmethod__', False))

    def __get__(self, instance, ownerclass=None):
        if instance is None:
            if self.__isabstractmethod__:
                return self
            raise AttributeError()
        elif self.fget is None:
            raise AttributeError("unreadable attribute")
        return self.fget(instance)

    def __set__(self, instance, value):
        if self.fset is None:
            raise AttributeError("can't set attribute")
        self.fset(instance, value)

    def __delete__(self, instance):
        if self.fdel is None:
            raise AttributeError("can't delete attribute")
        self.fdel(instance)

    def getter(self, fget):
        fdoc = fget.__doc__ if self.overwrite_doc else None
        result = type(self)(fget, self.fset, self.fdel, fdoc or self.__doc__)
        result.overwrite_doc = self.overwrite_doc
        return result

    def setter(self, fset):
        result = type(self)(self.fget, fset, self.fdel, self.__doc__)
        result.overwrite_doc = self.overwrite_doc
        return result

    def deleter(self, fdel):
        result = type(self)(self.fget, self.fset, fdel, self.__doc__)
        result.overwrite_doc = self.overwrite_doc
        return result


class _GeneratorWrapper:
    # TODO: Implement this in C.
    def __init__(self, gen):
        self.__wrapped = gen
        self.__isgen = gen.__class__ is GeneratorType
        self.__name__ = getattr(gen, '__name__', None)
        self.__qualname__ = getattr(gen, '__qualname__', None)
    def send(self, val):
        return self.__wrapped.send(val)
    def throw(self, tp, *rest):
        return self.__wrapped.throw(tp, *rest)
    def close(self):
        return self.__wrapped.close()
    @property
    def gi_code(self):
        return self.__wrapped.gi_code
    @property
    def gi_frame(self):
        return self.__wrapped.gi_frame
    @property
    def gi_running(self):
        return self.__wrapped.gi_running
    @property
    def gi_yieldfrom(self):
        return self.__wrapped.gi_yieldfrom
    cr_code = gi_code
    cr_frame = gi_frame
    cr_running = gi_running
    cr_await = gi_yieldfrom
    def __next__(self):
        return next(self.__wrapped)
    def __iter__(self):
        if self.__isgen:
            return self.__wrapped
        return self
    __await__ = __iter__

def coroutine(func):
    """Convert regular generator function to a coroutine."""

    if not callable(func):
        raise TypeError('types.coroutine() expects a callable')

    if (func.__class__ is FunctionType and
        getattr(func, '__code__', None).__class__ is CodeType):

        co_flags = func.__code__.co_flags

        # Check if 'func' is a coroutine function.
        # (0x180 == CO_COROUTINE | CO_ITERABLE_COROUTINE)
        if co_flags & 0x180:
            return func

        # Check if 'func' is a generator function.
        # (0x20 == CO_GENERATOR)
        if co_flags & 0x20:
            # TODO: Implement this in C.
            co = func.__code__
            # 0x100 == CO_ITERABLE_COROUTINE
            func.__code__ = co.replace(co_flags=co.co_flags | 0x100)
            return func

    # The following code is primarily to support functions that
    # return generator-like objects (for instance generators
    # compiled with Cython).

    # Delay functools and _collections_abc import for speeding up types import.
    import functools
    import _collections_abc
    @functools.wraps(func)
    def wrapped(*args, **kwargs):
        coro = func(*args, **kwargs)
        if (coro.__class__ is CoroutineType or
            coro.__class__ is GeneratorType and coro.gi_code.co_flags & 0x100):
            # 'coro' is a native coroutine object or an iterable coroutine
            return coro
        if (isinstance(coro, _collections_abc.Generator) and
            not isinstance(coro, _collections_abc.Coroutine)):
            # 'coro' is either a pure Python generator iterator, or it
            # implements collections.abc.Generator (and does not implement
            # collections.abc.Coroutine).
            return _GeneratorWrapper(coro)
        # 'coro' is either an instance of collections.abc.Coroutine or
        # some other object -- pass it through.
        return coro

    return wrapped


__all__ = [n for n in globals() if n[:1] != '_']
urllib/response.py000064400000004373151153537530010264 0ustar00"""Response classes used by urllib.

The base class, addbase, defines a minimal file-like interface,
including read() and readline().  The typical response object is an
addinfourl instance, which defines an info() method that returns
headers and a geturl() method that returns the url.
"""

import tempfile

__all__ = ['addbase', 'addclosehook', 'addinfo', 'addinfourl']


class addbase(tempfile._TemporaryFileWrapper):
    """Base class for addinfo and addclosehook. Is a good idea for garbage collection."""

    # XXX Add a method to expose the timeout on the underlying socket?

    def __init__(self, fp):
        super(addbase,  self).__init__(fp, '<urllib response>', delete=False)
        # Keep reference around as this was part of the original API.
        self.fp = fp

    def __repr__(self):
        return '<%s at %r whose fp = %r>' % (self.__class__.__name__,
                                             id(self), self.file)

    def __enter__(self):
        if self.fp.closed:
            raise ValueError("I/O operation on closed file")
        return self

    def __exit__(self, type, value, traceback):
        self.close()


class addclosehook(addbase):
    """Class to add a close hook to an open file."""

    def __init__(self, fp, closehook, *hookargs):
        super(addclosehook, self).__init__(fp)
        self.closehook = closehook
        self.hookargs = hookargs

    def close(self):
        try:
            closehook = self.closehook
            hookargs = self.hookargs
            if closehook:
                self.closehook = None
                self.hookargs = None
                closehook(*hookargs)
        finally:
            super(addclosehook, self).close()


class addinfo(addbase):
    """class to add an info() method to an open file."""

    def __init__(self, fp, headers):
        super(addinfo, self).__init__(fp)
        self.headers = headers

    def info(self):
        return self.headers


class addinfourl(addinfo):
    """class to add info() and geturl() methods to an open file."""

    def __init__(self, fp, headers, url, code=None):
        super(addinfourl, self).__init__(fp, headers)
        self.url = url
        self.code = code

    def getcode(self):
        return self.code

    def geturl(self):
        return self.url
urllib/__init__.py000064400000000000151153537530010144 0ustar00urllib/robotparser.py000064400000022320151153537530010760 0ustar00""" robotparser.py

    Copyright (C) 2000  Bastian Kleineidam

    You can choose between two licenses when using this package:
    1) GNU GPLv2
    2) PSF license for Python 2.2

    The robots.txt Exclusion Protocol is implemented as specified in
    http://www.robotstxt.org/norobots-rfc.txt
"""

import collections
import urllib.parse
import urllib.request

__all__ = ["RobotFileParser"]

RequestRate = collections.namedtuple("RequestRate", "requests seconds")


class RobotFileParser:
    """ This class provides a set of methods to read, parse and answer
    questions about a single robots.txt file.

    """

    def __init__(self, url=''):
        self.entries = []
        self.sitemaps = []
        self.default_entry = None
        self.disallow_all = False
        self.allow_all = False
        self.set_url(url)
        self.last_checked = 0

    def mtime(self):
        """Returns the time the robots.txt file was last fetched.

        This is useful for long-running web spiders that need to
        check for new robots.txt files periodically.

        """
        return self.last_checked

    def modified(self):
        """Sets the time the robots.txt file was last fetched to the
        current time.

        """
        import time
        self.last_checked = time.time()

    def set_url(self, url):
        """Sets the URL referring to a robots.txt file."""
        self.url = url
        self.host, self.path = urllib.parse.urlparse(url)[1:3]

    def read(self):
        """Reads the robots.txt URL and feeds it to the parser."""
        try:
            f = urllib.request.urlopen(self.url)
        except urllib.error.HTTPError as err:
            if err.code in (401, 403):
                self.disallow_all = True
            elif err.code >= 400 and err.code < 500:
                self.allow_all = True
        else:
            raw = f.read()
            self.parse(raw.decode("utf-8").splitlines())

    def _add_entry(self, entry):
        if "*" in entry.useragents:
            # the default entry is considered last
            if self.default_entry is None:
                # the first default entry wins
                self.default_entry = entry
        else:
            self.entries.append(entry)

    def parse(self, lines):
        """Parse the input lines from a robots.txt file.

        We allow that a user-agent: line is not preceded by
        one or more blank lines.
        """
        # states:
        #   0: start state
        #   1: saw user-agent line
        #   2: saw an allow or disallow line
        state = 0
        entry = Entry()

        self.modified()
        for line in lines:
            if not line:
                if state == 1:
                    entry = Entry()
                    state = 0
                elif state == 2:
                    self._add_entry(entry)
                    entry = Entry()
                    state = 0
            # remove optional comment and strip line
            i = line.find('#')
            if i >= 0:
                line = line[:i]
            line = line.strip()
            if not line:
                continue
            line = line.split(':', 1)
            if len(line) == 2:
                line[0] = line[0].strip().lower()
                line[1] = urllib.parse.unquote(line[1].strip())
                if line[0] == "user-agent":
                    if state == 2:
                        self._add_entry(entry)
                        entry = Entry()
                    entry.useragents.append(line[1])
                    state = 1
                elif line[0] == "disallow":
                    if state != 0:
                        entry.rulelines.append(RuleLine(line[1], False))
                        state = 2
                elif line[0] == "allow":
                    if state != 0:
                        entry.rulelines.append(RuleLine(line[1], True))
                        state = 2
                elif line[0] == "crawl-delay":
                    if state != 0:
                        # before trying to convert to int we need to make
                        # sure that robots.txt has valid syntax otherwise
                        # it will crash
                        if line[1].strip().isdigit():
                            entry.delay = int(line[1])
                        state = 2
                elif line[0] == "request-rate":
                    if state != 0:
                        numbers = line[1].split('/')
                        # check if all values are sane
                        if (len(numbers) == 2 and numbers[0].strip().isdigit()
                            and numbers[1].strip().isdigit()):
                            entry.req_rate = RequestRate(int(numbers[0]), int(numbers[1]))
                        state = 2
                elif line[0] == "sitemap":
                    # According to http://www.sitemaps.org/protocol.html
                    # "This directive is independent of the user-agent line,
                    #  so it doesn't matter where you place it in your file."
                    # Therefore we do not change the state of the parser.
                    self.sitemaps.append(line[1])
        if state == 2:
            self._add_entry(entry)

    def can_fetch(self, useragent, url):
        """using the parsed robots.txt decide if useragent can fetch url"""
        if self.disallow_all:
            return False
        if self.allow_all:
            return True
        # Until the robots.txt file has been read or found not
        # to exist, we must assume that no url is allowable.
        # This prevents false positives when a user erroneously
        # calls can_fetch() before calling read().
        if not self.last_checked:
            return False
        # search for given user agent matches
        # the first match counts
        parsed_url = urllib.parse.urlparse(urllib.parse.unquote(url))
        url = urllib.parse.urlunparse(('','',parsed_url.path,
            parsed_url.params,parsed_url.query, parsed_url.fragment))
        url = urllib.parse.quote(url)
        if not url:
            url = "/"
        for entry in self.entries:
            if entry.applies_to(useragent):
                return entry.allowance(url)
        # try the default entry last
        if self.default_entry:
            return self.default_entry.allowance(url)
        # agent not found ==> access granted
        return True

    def crawl_delay(self, useragent):
        if not self.mtime():
            return None
        for entry in self.entries:
            if entry.applies_to(useragent):
                return entry.delay
        if self.default_entry:
            return self.default_entry.delay
        return None

    def request_rate(self, useragent):
        if not self.mtime():
            return None
        for entry in self.entries:
            if entry.applies_to(useragent):
                return entry.req_rate
        if self.default_entry:
            return self.default_entry.req_rate
        return None

    def site_maps(self):
        if not self.sitemaps:
            return None
        return self.sitemaps

    def __str__(self):
        entries = self.entries
        if self.default_entry is not None:
            entries = entries + [self.default_entry]
        return '\n\n'.join(map(str, entries))


class RuleLine:
    """A rule line is a single "Allow:" (allowance==True) or "Disallow:"
       (allowance==False) followed by a path."""
    def __init__(self, path, allowance):
        if path == '' and not allowance:
            # an empty value means allow all
            allowance = True
        path = urllib.parse.urlunparse(urllib.parse.urlparse(path))
        self.path = urllib.parse.quote(path)
        self.allowance = allowance

    def applies_to(self, filename):
        return self.path == "*" or filename.startswith(self.path)

    def __str__(self):
        return ("Allow" if self.allowance else "Disallow") + ": " + self.path


class Entry:
    """An entry has one or more user-agents and zero or more rulelines"""
    def __init__(self):
        self.useragents = []
        self.rulelines = []
        self.delay = None
        self.req_rate = None

    def __str__(self):
        ret = []
        for agent in self.useragents:
            ret.append(f"User-agent: {agent}")
        if self.delay is not None:
            ret.append(f"Crawl-delay: {self.delay}")
        if self.req_rate is not None:
            rate = self.req_rate
            ret.append(f"Request-rate: {rate.requests}/{rate.seconds}")
        ret.extend(map(str, self.rulelines))
        return '\n'.join(ret)

    def applies_to(self, useragent):
        """check if this entry applies to the specified agent"""
        # split the name token and make it lower case
        useragent = useragent.split("/")[0].lower()
        for agent in self.useragents:
            if agent == '*':
                # we have the catch-all agent
                return True
            agent = agent.lower()
            if agent in useragent:
                return True
        return False

    def allowance(self, filename):
        """Preconditions:
        - our agent applies to this entry
        - filename is URL decoded"""
        for line in self.rulelines:
            if line.applies_to(filename):
                return line.allowance
        return True
urllib/error.py000064400000005110151153537530007545 0ustar00"""Exception classes raised by urllib.

The base exception class is URLError, which inherits from OSError.  It
doesn't define any behavior of its own, but is the base class for all
exceptions defined in this package.

HTTPError is an exception class that is also a valid HTTP response
instance.  It behaves this way because HTTP protocol errors are valid
responses, with a status code, headers, and a body.  In some contexts,
an application may want to handle an exception like a regular
response.
"""

import urllib.response

__all__ = ['URLError', 'HTTPError', 'ContentTooShortError']


class URLError(OSError):
    # URLError is a sub-type of OSError, but it doesn't share any of
    # the implementation.  need to override __init__ and __str__.
    # It sets self.args for compatibility with other OSError
    # subclasses, but args doesn't have the typical format with errno in
    # slot 0 and strerror in slot 1.  This may be better than nothing.
    def __init__(self, reason, filename=None):
        self.args = reason,
        self.reason = reason
        if filename is not None:
            self.filename = filename

    def __str__(self):
        return '<urlopen error %s>' % self.reason


class HTTPError(URLError, urllib.response.addinfourl):
    """Raised when HTTP error occurs, but also acts like non-error return"""
    __super_init = urllib.response.addinfourl.__init__

    def __init__(self, url, code, msg, hdrs, fp):
        self.code = code
        self.msg = msg
        self.hdrs = hdrs
        self.fp = fp
        self.filename = url
        # The addinfourl classes depend on fp being a valid file
        # object.  In some cases, the HTTPError may not have a valid
        # file object.  If this happens, the simplest workaround is to
        # not initialize the base classes.
        if fp is not None:
            self.__super_init(fp, hdrs, url, code)

    def __str__(self):
        return 'HTTP Error %s: %s' % (self.code, self.msg)

    def __repr__(self):
        return '<HTTPError %s: %r>' % (self.code, self.msg)

    # since URLError specifies a .reason attribute, HTTPError should also
    #  provide this attribute. See issue13211 for discussion.
    @property
    def reason(self):
        return self.msg

    @property
    def headers(self):
        return self.hdrs

    @headers.setter
    def headers(self, headers):
        self.hdrs = headers


class ContentTooShortError(URLError):
    """Exception raised when downloaded size does not match content-length."""
    def __init__(self, message, content):
        URLError.__init__(self, message)
        self.content = content
urllib/__pycache__/error.cpython-38.pyc000064400000005373151153537530014046 0ustar00U

e5dH
�@sPdZddlZdddgZGdd�de�ZGdd�deejj�ZGdd�de�Z	dS)	a�Exception classes raised by urllib.

The base exception class is URLError, which inherits from OSError.  It
doesn't define any behavior of its own, but is the base class for all
exceptions defined in this package.

HTTPError is an exception class that is also a valid HTTP response
instance.  It behaves this way because HTTP protocol errors are valid
responses, with a status code, headers, and a body.  In some contexts,
an application may want to handle an exception like a regular
response.
�N�URLError�	HTTPError�ContentTooShortErrorc@seZdZddd�Zdd�ZdS)rNcCs |f|_||_|dk	r||_dS�N)�args�reason�filename)�selfrr�r
�$/usr/lib64/python3.8/urllib/error.py�__init__szURLError.__init__cCs
d|jS)Nz<urlopen error %s>)r�r	r
r
r�__str__szURLError.__str__)N)�__name__�
__module__�__qualname__rrr
r
r
rrs
c@sXeZdZdZejjjZdd�Zdd�Z	dd�Z
edd	��Zed
d��Z
e
jdd��Z
d
S)rzBRaised when HTTP error occurs, but also acts like non-error returncCs:||_||_||_||_||_|dk	r6|�||||�dSr)�code�msg�hdrs�fpr�_HTTPError__super_init)r	Zurlrrrrr
r
rr'szHTTPError.__init__cCsd|j|jfS)NzHTTP Error %s: %s�rrr
r
r
rr4szHTTPError.__str__cCsd|j|jfS)Nz<HTTPError %s: %r>rr
r
r
r�__repr__7szHTTPError.__repr__cCs|jSr)rr
r
r
rr<szHTTPError.reasoncCs|jSr�rr
r
r
r�headers@szHTTPError.headerscCs
||_dSrr)r	rr
r
rrDsN)rrr�__doc__�urllib�response�
addinfourlrrrr�propertyrr�setterr
r
r
rr#s



c@seZdZdZdd�ZdS)rzDException raised when downloaded size does not match content-length.cCst�||�||_dSr)rr�content)r	�messager!r
r
rrKszContentTooShortError.__init__N)rrrrrr
r
r
rrIs)
rZurllib.responser�__all__�OSErrorrrrrrr
r
r
r�<module>s


&urllib/__pycache__/parse.cpython-38.opt-2.pyc000064400000063741151153537530014772 0ustar00U

&�.e���@s�ddlZddlZddlZddlZddlZdddddddd	d
ddd
dddddddddgZdddddddddd d!d"d#d$d%d&d'd(d)gZdddddd*dddd!dd d+d"d#d$d,d&d'd%d-d.d/d(d)gZddd0d"dddd d#d$d1d2d!d%d3gZdd0d4d5d*ddd+d1d2g
Z	dddddd d!dd#d$d1d2gZ
ddd0ddd5dddd d+dd"g
Zd6Zd7Z
d8d9d:gZd;ZiZd<d=�Zd>Zd?Zd@dA�ZeefdBdC�ZeefdDdE�ZdFdG�ZGdHdI�dIe�ZGdJdK�dKe�ZGdLdM�dMe�ZGdNdO�dOee�ZGdPdQ�dQee�ZddRlmZeddS�ZeddT�Z eddU�Z!dVe_"dWej#_"dXej$_"dYe _"dZe j%_"d[e j&_"d\e j'_"d]e j(_"d^e j$_"d_e!_"e j%j"e!j%_"e j&j"e!j&_"e j'j"e!j'_"d`e!j)_"e j(j"e!j(_"e j$j"e!j$_"eZ*Gdad�dee�Z+Gdbd�de e�Z,Gdcd�de!e�Z-Gddd�dee�Z.Gded�de e�Z/Gdfd�de!e�Z0dgdh�Z1e1�[1d�djd�Z2dkdl�Z3d�dmdn�Z4dodp�Z5dqdr�Z6d�dsd�Z7dtd�Z8dud�Z9d�dvd�Z:dwd�Z;dxZ<da=dyd�Z>e�?dz�Z@d�d}d�ZAd�dd	�ZBGd�d��d�eC�ZDd�ZEdaFd�d�d
�ZGd�d�d�ZHeId��ZJeKeJ�ZLiZMGd�d��d�ejN�ZOd�d�d�ZPd�d�d�ZQd�d�d
�ZRd~dddeQfd�d�ZSd�d��ZTd�d��ZUd�d��ZVd�d��ZWdaXd�d��ZYd�d��ZZda[d�d��Z\d�d��Z]d�d��Z^d�d��Z_d�d��Z`d�d��Zadabd�d��Zcd�d�d��Zdd�d�d��Zed�d��Zfd�d��Zgd�d��Zhd�d��Zid�d��Zjd�d��Zkd�d��Zld�d��ZmdS)��N�urlparse�
urlunparse�urljoin�	urldefrag�urlsplit�
urlunsplit�	urlencode�parse_qs�	parse_qsl�quote�
quote_plus�quote_from_bytes�unquote�unquote_plus�unquote_to_bytes�DefragResult�ParseResult�SplitResult�DefragResultBytes�ParseResultBytes�SplitResultBytes�Zftp�httpZgopherZnntpZimapZwais�fileZhttpsZshttpZmmsZprosperoZrtspZrtspuZsftpZsvnzsvn+sshZwsZwssZtelnetZsnewsZrsyncZnfsZgitzgit+sshZhdlZsipZsipsZtelZmailtoZnewszAabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-.z!	

 �	�
�
�cCst��t��dS�N)�_parse_cache�clear�
_safe_quoters�r"r"�$/usr/lib64/python3.8/urllib/parse.py�clear_cache`sr$�ascii�strictcCs|Srr")�objr"r"r#�_nooposr(cCs|�||�Sr��encode)r'�encoding�errorsr"r"r#�_encode_resultrsr-cst��fdd�|D��S)Nc3s"|]}|r|����ndVqdS)rN��decode��.0�x�r+r,r"r#�	<genexpr>xsz_decode_args.<locals>.<genexpr>)�tuple)�argsr+r,r"r3r#�_decode_argsvsr7cGsVt|dt�}|dd�D]}|rt|t�|krtd��q|rH|tfSt|�tfS)Nr�z$Cannot mix str and non-str arguments)�
isinstance�str�	TypeErrorr(r7r-)r6Z	str_input�argr"r"r#�_coerce_argszs

r=c@seZdZdZddd�ZdS)�_ResultMixinStrr"r%r&cs|j��fdd�|D��S)Nc3s|]}|����VqdSrr)r0r3r"r#r4�sz)_ResultMixinStr.encode.<locals>.<genexpr>)�_encoded_counterpart��selfr+r,r"r3r#r*�sz_ResultMixinStr.encodeN)r%r&)�__name__�
__module__�__qualname__�	__slots__r*r"r"r"r#r>�sr>c@seZdZdZddd�ZdS)�_ResultMixinBytesr"r%r&cs|j��fdd�|D��S)Nc3s|]}|����VqdSrr.r0r3r"r#r4�sz+_ResultMixinBytes.decode.<locals>.<genexpr>)�_decoded_counterpartr@r"r3r#r/�sz_ResultMixinBytes.decodeN)r%r&)rBrCrDrEr/r"r"r"r#rF�srFc@s@eZdZdZedd��Zedd��Zedd��Zedd	��Zd
S)�_NetlocResultMixinBaser"cCs
|jdS)Nr��	_userinfo�rAr"r"r#�username�sz_NetlocResultMixinBase.usernamecCs
|jdS)Nr8rIrKr"r"r#�password�sz_NetlocResultMixinBase.passwordcCsD|jd}|sdSt|t�r dnd}|�|�\}}}|��||S)Nr�%�%)�	_hostinfor9r:�	partition�lower)rA�hostname�	separatorZpercentZzoner"r"r#rS�s
z_NetlocResultMixinBase.hostnamecCsl|jd}|dk	rhzt|d�}Wn(tk
rHd|��}t|�d�YnXd|kr^dkshntd��|S)Nr8�
z+Port could not be cast to integer value as ri��zPort out of range 0-65535)rP�int�
ValueError)rA�port�messager"r"r#rX�s

z_NetlocResultMixinBase.portN)	rBrCrDrE�propertyrLrMrSrXr"r"r"r#rH�s



rHc@s(eZdZdZedd��Zedd��ZdS)�_NetlocResultMixinStrr"cCsD|j}|�d�\}}}|r4|�d�\}}}|s<d}nd}}||fS)N�@�:��netloc�
rpartitionrQ�rAr_ZuserinfoZ	have_info�hostinforLZ
have_passwordrMr"r"r#rJ�sz_NetlocResultMixinStr._userinfocCsl|j}|�d�\}}}|�d�\}}}|rL|�d�\}}}|�d�\}}}n|�d�\}}}|sdd}||fS)Nr\�[�]r]r^�rAr_�_rbZhave_open_brZ	bracketedrSrXr"r"r#rP�sz_NetlocResultMixinStr._hostinfoN�rBrCrDrErZrJrPr"r"r"r#r[�s

r[c@s(eZdZdZedd��Zedd��ZdS)�_NetlocResultMixinBytesr"cCsD|j}|�d�\}}}|r4|�d�\}}}|s<d}nd}}||fS)N�@�:r^rar"r"r#rJ�sz!_NetlocResultMixinBytes._userinfocCsl|j}|�d�\}}}|�d�\}}}|rL|�d�\}}}|�d�\}}}n|�d�\}}}|sdd}||fS)Nri�[�]rjr^rer"r"r#rP�sz!_NetlocResultMixinBytes._hostinfoNrgr"r"r"r#rh�s

rh)�
namedtuplezurl fragmentz!scheme netloc path query fragmentz(scheme netloc path params query fragmentz�
DefragResult(url, fragment)

A 2-tuple that contains the url without fragment identifier and the fragment
identifier as a separate argument.
z$The URL with no fragment identifier.z�
Fragment identifier separated from URL, that allows indirect identification of a
secondary resource by reference to a primary resource and additional identifying
information.
z�
SplitResult(scheme, netloc, path, query, fragment)

A 5-tuple that contains the different components of a URL. Similar to
ParseResult, but does not split params.
z%Specifies URL scheme for the request.z0
Network location where the request is made to.
z@
The hierarchical path, such as the path to a file to download.
z�
The query component, that contains non-hierarchical data, that along with data
in path component, identifies a resource in the scope of URI's scheme and
network location.
z�
Fragment identifier, that allows indirect identification of a secondary resource
by reference to a primary resource and additional identifying information.
zq
ParseResult(scheme, netloc, path, params, query, fragment)

A 6-tuple that contains components of a parsed URL.
z�
Parameters for last path element used to dereference the URI in order to provide
access to perform some operation on the resource.
c@seZdZdZdd�ZdS)rr"cCs |jr|jd|jS|jSdS�N�#��fragment�urlrKr"r"r#�geturlIszDefragResult.geturlN�rBrCrDrErsr"r"r"r#rGsc@seZdZdZdd�ZdS)rr"cCst|�Sr�rrKr"r"r#rsQszSplitResult.geturlNrtr"r"r"r#rOsc@seZdZdZdd�ZdS)rr"cCst|�Sr�rrKr"r"r#rsVszParseResult.geturlNrtr"r"r"r#rTsc@seZdZdZdd�ZdS)rr"cCs |jr|jd|jS|jSdS)N�#rprKr"r"r#rs\szDefragResultBytes.geturlNrtr"r"r"r#rZsc@seZdZdZdd�ZdS)rr"cCst|�SrrurKr"r"r#rsdszSplitResultBytes.geturlNrtr"r"r"r#rbsc@seZdZdZdd�ZdS)rr"cCst|�SrrvrKr"r"r#rsiszParseResultBytes.geturlNrtr"r"r"r#rgscCs4ttfttfttff}|D]\}}||_||_qdSr)rrrrrrr?rG)Z
_result_pairsZ_decodedZ_encodedr"r"r#�_fix_result_transcodingms�rxTc
Csft||�\}}}t|||�}|\}}}}}|tkrHd|krHt|�\}}nd}t||||||�}	||	�S)N�;r)r=r�uses_params�_splitparamsr)
rr�scheme�allow_fragments�_coerce_resultZsplitresultr_�queryrq�params�resultr"r"r#rzscCsRd|kr,|�d|�d��}|dkr6|dfSn
|�d�}|d|�||dd�fS)N�/ryrrr8)�find�rfind)rr�ir"r"r#r{�s

r{cCsHt|�}dD]"}|�||�}|dkrt||�}q|||�||d�fS)Nz/?#r)�lenr��min)rr�start�delim�cZwdelimr"r"r#�_splitnetloc�sr�cCs�|r|��rdSddl}|�dd�}|�dd�}|�dd�}|�dd�}|�d|�}||kr`dSdD] }||krdtd	|d
d��qddS)Nrr\rr]ro�?�NFKCz/?#@:znetloc 'z' contains invalid z#characters under NFKC normalization)�isascii�unicodedata�replace�	normalizerW)r_r��nZnetloc2r�r"r"r#�_checknetloc�s�r�cCstD]}|�|d�}q|S)Nr)�_UNSAFE_URL_BYTES_TO_REMOVEr�)rr�br"r"r#�_remove_unsafe_bytes_from_url�sr�c
Cs�t||�\}}}t|�}t|�}|�t�}|�t�}t|�}|||t|�t|�f}t�|d�}|rj||�St	t�t
kr|t�d}}}|�d�}	|	dk�r�|d|	�dk�rn||	dd�}|dd�dk�rt
|d�\}}d|kr�d	|k�sd	|k�rd|k�rtd
��|�r,d|k�r,|�dd�\}}d|k�rF|�dd�\}}t|�td||||�}
|
t|<||
�S|d|	�D]}|tk�rz�qҐqz||	dd�}|�r�td
d�|D���r�|d|	���|}}|dd�dk�r"t
|d�\}}d|k�rd	|k�sd	|k�r"d|k�r"td
��|�rBd|k�rB|�dd�\}}d|k�r\|�dd�\}}t|�t|||||�}
|
t|<||
�S)Nrr]rrr8��//rcrdzInvalid IPv6 URLror�css|]}|dkVqdS)�
0123456789Nr"�r1r�r"r"r#r4�szurlsplit.<locals>.<genexpr>)r=r��lstrip�_WHATWG_C0_CONTROL_OR_SPACE�strip�bool�typer�getr��MAX_CACHE_SIZEr$r�r�rW�splitr�r�scheme_chars�anyrR)
rrr|r}r~�key�cachedr_rrqr��vr��restr"r"r#r�sn



��


��
cCs<t|�\}}}}}}}|r&d||f}|t|||||f��S)Nz%s;%s)r=r)�
componentsr|r_rrr�rrqr~r"r"r#r�s
�cCs�t|�\}}}}}}|s4|r`|tkr`|dd�dkr`|rP|dd�dkrPd|}d|pXd|}|rp|d|}|r�|d|}|r�|d|}||�S)	Nr�r�r8r�rr]r�ro)r=�uses_netloc)r�r|r_rrrrqr~r"r"r#r�s� c	Cs�|s|S|s|St||�\}}}t|d|�\}}}}}}	t|||�\}
}}}
}}|
|ks`|
tkrh||�S|
tkr�|r�|t|
|||
||f��S|}|s�|
s�|}|}
|s�|}|t|
|||
||f��S|�d�}|ddkr�|d=|dd�dkr�|�d�}n(||�d�}td|dd��|dd�<g}|D]P}|dk�r\z|��Wntk
�rXYnXn|dk�rl�q(n
|�	|��q(|ddk�r�|�	d�|t|
|d�
|��p�d|
||f��S)Nrr����r8�..�.)r�r�)r=r�
uses_relativer�rr��filter�pop�
IndexError�append�join)�baserrr}r~ZbschemeZbnetlocZbpathZbparamsZbqueryZ	bfragmentr|r_�pathr�rrqZ
base_partsZsegmentsZ
resolved_pathZsegr"r"r#rsp
�
�
�
�



��c	CsTt|�\}}d|kr>t|�\}}}}}}t|||||df�}nd}|}|t||��S)Nror)r=rrr)	rrr~�sr��p�a�qZfragZdefragr"r"r#rTsZ0123456789ABCDEFabcdefc	Cs�|s|jdSt|t�r"|�d�}|�d�}t|�dkr<|S|dg}|j}tdkrbdd�tD�a|dd�D]R}z(|t|dd��||dd��Wqntk
r�|d�||�YqnXqnd�	|�S)	N��utf-8rOr8rcSs.i|]&}tD]}||��t�||��qqSr")�_hexdigr*�bytes�fromhex)r1r�r�r"r"r#�
<dictcomp>zs
�
z$unquote_to_bytes.<locals>.<dictcomp>r�)
r�r9r:r*r�r��
_hextobyter��KeyErrorr�)�string�bits�resr��itemr"r"r#rgs,



�z([-]+)r�r�cCs�t|t�rtd��d|kr$|j|S|dkr0d}|dkr<d}t�|�}|dg}|j}tdt|�d�D],}|t||��	||��|||d�qfd�
|�S)	NzExpected str, got bytesrNr�r�rr8r�r)r9r�r;r��_asciirer��ranger�rr/r�)r�r+r,r�r�r�r�r"r"r#r�s 



Fc	CsNi}t|||||||d�}|D]*\}	}
|	|kr>||	�|
�q|
g||	<q|S)N)r+r,�max_num_fieldsrT)r
r�)�qs�keep_blank_values�strict_parsingr+r,r�rTZ
parsed_result�pairs�name�valuer"r"r#r	�s�c@seZdZdS)�_QueryStringSeparatorWarningN)rBrCrDr"r"r"r#r��sr�z/etc/python/urllib.cfgc	Cs�t|�\}}t|t�r |�d�}|r2t|ttf�sB|dk	rBtd��t�}|dk�rRt}d}	|dkrrtj	�
|	�}d}
|dkr�ztt�}Wnt
k
r�YnJX|�:ddl}|jddd�}
|
�|�|
j
d|	dd	�}|aW5QRXt}
|dk�rd
|k�rddlm}|dtd
d�d}n:|dk�r(|}n*t|�dk�rRt|	�d|
�d�dd��|dk	�r�||k�r�d|�d�|�d
�}nd|�|�}||k�r�td��||k�r�dd�|�d�D�}ndd�|�|�D�}g}|D]�}|�s�|�s�q�|�dd�}t|�d
k�r4|�rtd|f��|�r�|�d�n�q�t|d��sH|�r�|d�dd�}t|||d�}||�}|d�dd�}t|||d�}||�}|�||f��q�|S) Nr%z*Separator must be of type string or bytes.ZPYTHON_URLLIB_QS_SEPARATORzenvironment variabler)ro)Z
interpolationZcomment_prefixesr	)Zfallbackry)�warnaThe default separator of urllib.parse.parse_qsl and parse_qs was changed to '&' to avoid a web cache poisoning issue (CVE-2021-23336). By default, semicolons no longer act as query field separators. See https://access.redhat.com/articles/5860431 for more details.r���
stacklevel�&Zlegacyr8z (from z) must contain z1 character, or "legacy". See z<https://access.redhat.com/articles/5860431 for more details.zMax number of fields exceededcSs g|]}|�d�D]}|�qqS)ry�r�)r1�s1�s2r"r"r#�
<listcomp>7szparse_qsl.<locals>.<listcomp>cSsg|]}|�qSr"r")r1r�r"r"r#r�9s�=zbad query field: %rr�+� r3)r=r9r�r/r:rW�object�_default_qs_separator�os�environr��open�_QS_SEPARATOR_CONFIG_FILENAME�FileNotFoundError�configparserZConfigParserZ	read_file�warningsr�r�r��countr�r�r�r)r�r�r�r+r,r�rTr~Z_legacyZenvvar_nameZ
config_sourcerr�Zconfigr��
num_fieldsr��rZ
name_valueZnvr�r�r"r"r#r
�s�


�


�
���	



cCs|�dd�}t|||�S)Nr�r�)r�r)r�r+r,r"r"r#rQssBABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.-~c@s$eZdZdd�Zdd�Zdd�ZdS)�QuotercCst�|�|_dSr)�_ALWAYS_SAFE�union�safe)rAr�r"r"r#�__init__iszQuoter.__init__cCsd|jjt|�fS)Nz<%s %r>)�	__class__rB�dictrKr"r"r#�__repr__mszQuoter.__repr__cCs(||jkrt|�nd�|�}|||<|S)Nz%{:02X})r��chr�format)rAr�r�r"r"r#�__missing__qszQuoter.__missing__N)rBrCrDr�r�r�r"r"r"r#r�asr�r�cCsbt|t�r8|s|S|dkrd}|dkr*d}|�||�}n |dk	rHtd��|dk	rXtd��t||�S)Nr�r&z,quote() doesn't support 'encoding' for bytesz*quote() doesn't support 'errors' for bytes)r9r:r*r;r
)r�r�r+r,r"r"r#rws'
cCsdt|t�rd|ks$t|t�r2d|kr2t||||�St|t�rBd}nd}t|||||�}|�dd�S)Nr�� r�)r9r:r�rr�)r�r�r+r,Zspacer"r"r#r�s��
cs�t|ttf�std��|sdSt|t�r6|�dd�}ntdd�|D��}|�t|�s^|��Szt	|�Wn&t
k
r�t|�jt	|<�YnXd�
�fdd�|D��S)Nz!quote_from_bytes() expected bytesrr%�ignorecSsg|]}|dkr|�qS)�r"r�r"r"r#r��sz$quote_from_bytes.<locals>.<listcomp>csg|]}�|��qSr"r")r1�char�Zquoterr"r#r��s)r9r��	bytearrayr;r:r*�rstrip�_ALWAYS_SAFE_BYTESr/r!r�r��__getitem__r�)Zbsr�r"r�r#r
�s
c	Cst|d�r|��}nPzt|�r0t|dt�s0t�Wn0tk
rbt��\}}}td��|��YnXg}	|s�|D]j\}
}t|
t	�r�||
|�}
n|t
|
�|||�}
t|t	�r�|||�}n|t
|�|||�}|	�|
d|�qp�n"|D�]\}
}t|
t	��r||
|�}
n|t
|
�|||�}
t|t	��rB|||�}|	�|
d|�q�t|t
��rp|||||�}|	�|
d|�q�zt|�}Wn:tk
�r�|t
|�|||�}|	�|
d|�Yq�X|D]B}
t|
t	��r�||
|�}
n|t
|
�|||�}
|	�|
d|
��q�q�d�|	�S)N�itemsrz1not a valid non-string sequence or mapping objectr�r�)
�hasattrr�r�r9r5r;�sys�exc_info�with_tracebackr�r:r�r�)rZdoseqr�r+r,Z	quote_viaZtyZva�tb�l�kr�r2Zeltr"r"r#r�sR

�



cCstjdtdd�t|�S)Nz/urllib.parse.to_bytes() is deprecated as of 3.8r�r�)r�r��DeprecationWarning�	_to_bytes�rrr"r"r#�to_bytes%s
�rcCsJt|t�rFz|�d���}Wn(tk
rDtdt|�d��YnX|S)N�ASCIIzURL z contains non-ASCII characters)r9r:r*r/�UnicodeError�reprrr"r"r#r+s
�rcCs`t|���}|dd�dkr<|dd�dkr<|dd���}|dd�dkr\|dd���}|S)Nr8�<r��>�zURL:)r:r�rr"r"r#�unwrap9s r
cCstjdtdd�t|�S)NzUurllib.parse.splittype() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r�
_splittyperr"r"r#�	splittypeFs
�rcCsDtdkrt�dtj�at�|�}|r<|��\}}|��|fSd|fS)Nz
([^/:]+):(.*))�	_typeprog�re�compile�DOTALL�match�groupsrR)rrrr|�datar"r"r#rNs
rcCstjdtdd�t|�S)NzUurllib.parse.splithost() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r�
_splithostrr"r"r#�	splithost[s
�rcCsXtdkrt�dtj�at�|�}|rP|��\}}|rH|ddkrHd|}||fSd|fS)Nz//([^/#?]*)(.*)rr�)�	_hostprogrrrrr)rrrZ	host_portr�r"r"r#rcs
rcCstjdtdd�t|�S)NzUurllib.parse.splituser() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r�
_splituser��hostr"r"r#�	splituserrs
�rcCs |�d�\}}}|r|nd|fS)Nr\�r`)r�userr�r"r"r#rysrcCstjdtdd�t|�S)NzWurllib.parse.splitpasswd() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r�_splitpasswd)rr"r"r#�splitpasswds
�r!cCs |�d�\}}}||r|ndfS�Nr]�rQ)rr�Zpasswdr"r"r#r �sr cCstjdtdd�t|�S)NzUurllib.parse.splitport() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r�
_splitportrr"r"r#�	splitport�s
�r%cCsDtdkrt�dtj�at�|�}|r<|��\}}|r<||fS|dfS)Nz
(.*):([0-9]*))�	_portprogrrr�	fullmatchr)rrrXr"r"r#r$�s
r$r�cCstjdtdd�t||�S)NzVurllib.parse.splitnport() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r�_splitnport)r�defportr"r"r#�
splitnport�s
�r*cCsT|�d�\}}}|s|}n2|rLzt|�}Wntk
rBd}YnX||fS||fSr")r`rVrW)rr)r�rXZnportr"r"r#r(�s
r(cCstjdtdd�t|�S)NzVurllib.parse.splitquery() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r�_splitqueryrr"r"r#�
splitquery�s
�r,cCs$|�d�\}}}|r||fS|dfS)Nr�r)rrr�r�rr"r"r#r+�sr+cCstjdtdd�t|�S)NzTurllib.parse.splittag() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r�	_splittagrr"r"r#�splittag�s
�r.cCs$|�d�\}}}|r||fS|dfSrnr)rrr�r��tagr"r"r#r-�sr-cCstjdtdd�t|�S)NzUurllib.parse.splitattr() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r�
_splitattrrr"r"r#�	splitattr�s
�r1cCs|�d�}|d|dd�fS)Nryrr8r�)rrZwordsr"r"r#r0�s
r0cCstjdtdd�t|�S)NzWurllib.parse.splitvalue() is deprecated as of 3.8, use urllib.parse.parse_qsl() insteadr�r�)r�r�r�_splitvalue)�attrr"r"r#�
splitvalue�s
�r4cCs |�d�\}}}||r|ndfS)Nr�r#)r3r�r�r"r"r#r2�sr2)rT)r)rT)T)r�r�)FFr�r�NN)FFr�r�NN)r�r�)r�NN)rNN)r�)r�)r�)nrr�r��collectionsr��__all__r�r�rzZnon_hierarchicalZ
uses_queryZ
uses_fragmentr�r�r�r�rr$Z_implicit_encodingZ_implicit_errorsr(r-r7r=r�r>rFrHr[rhrmZ_DefragResultBaseZ_SplitResultBaseZ_ParseResultBase�__doc__rrrqr|r_r�rr�Z
ResultBaserrrrrrrxrr{r�r�r�rrrrrr�r�rrr�rr	�RuntimeWarningr�r�r�r
r�	frozensetr�r�r�r!�defaultdictr�rrr
rrrr
rrrrrrrrr!r r%r&r$r*r(r,r+r.r-r1r0r4r2r"r"r"r#�<module>"s��������
�
�
%
��

	

?
E

�
)�
}
	
6

�
Q



urllib/__pycache__/request.cpython-38.pyc000064400000215633151153537530014407 0ustar00U

e5d���!@s�dZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlmZmZmZddlmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(ddl)m*Z*m+Z+zddl,Z,Wne-k
�rdZ.YnXdZ.dd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(g!Z/d)e
j0dd*�Z1da2dej3fddddd+�d,d�Z4d-d �Z5gZ6d~d.d%�Z7d/d&�Z8e
�9d0e
j:�Z;d1d2�Z<Gd3d�d�Z=Gd4d	�d	�Z>d5d!�Z?Gd6d
�d
�Z@Gd7d�de@�ZAGd8d�de@�ZBGd9d�de@�ZCd:d;�ZDGd<d�de@�ZEGd=d�d�ZFGd>d�deF�ZGGd?d�deG�ZHGd@d�d�ZIGdAd�deIe@�ZJGdBd�deIe@�ZKejLZMGdCd�d�ZNGdDd�de@eN�ZOGdEd�de@eN�ZPGdFdG�dGe@�ZQGdHd�deQ�ZReSejTdI��r*GdJdK�dKeQ�ZUe/�VdK�GdLd
�d
e@�ZWGdMd�de@�ZXdNdO�ZYdPdQ�ZZGdRd�de@�Z[dSdT�Z\GdUd�de@�Z]GdVd�de]�Z^GdWd�de@�Z_dXZ`ejadYk�r�ddZlbmcZcmdZdnd[d#�Zcd\d"�ZdiZeGd]d'�d'�ZfGd^d(�d(ef�Zgdahd_d`�Zidajdadb�Zkdaldcdd�Zmdandedf�ZoGdgdh�dh�Zpdidj�Zqddkdl�Zrdmdn�Zse
jtdok�r�ddplumvZvmwZwdqdr�Zxdsdt�Zydudv�Zzdwd$�Z{n6ejadYk�r�dxdy�Z|dzd$�Z{d{d|�Z}d}dv�ZzneqZ{erZzdS)�a�
An extensible library for opening URLs using a variety of protocols

The simplest way to use this module is to call the urlopen function,
which accepts a string containing a URL or a Request object (described
below).  It opens the URL and returns the results as file-like
object; the returned object has some extra methods described below.

The OpenerDirector manages a collection of Handler objects that do
all the actual work.  Each Handler implements a particular protocol or
option.  The OpenerDirector is a composite object that invokes the
Handlers needed to open the requested URL.  For example, the
HTTPHandler performs HTTP GET and POST requests and deals with
non-error returns.  The HTTPRedirectHandler automatically deals with
HTTP 301, 302, 303 and 307 redirect errors, and the HTTPDigestAuthHandler
deals with digest authentication.

urlopen(url, data=None) -- Basic usage is the same as original
urllib.  pass the url and optionally data to post to an HTTP URL, and
get a file-like object back.  One difference is that you can also pass
a Request instance instead of URL.  Raises a URLError (subclass of
OSError); for HTTP errors, raises an HTTPError, which can also be
treated as a valid response.

build_opener -- Function that creates a new OpenerDirector instance.
Will install the default handlers.  Accepts one or more Handlers as
arguments, either instances or Handler classes that it will
instantiate.  If one of the argument is a subclass of the default
handler, the argument will be installed instead of the default.

install_opener -- Installs a new opener as the default opener.

objects of interest:

OpenerDirector -- Sets up the User Agent as the Python-urllib client and manages
the Handler classes, while dealing with requests and responses.

Request -- An object that encapsulates the state of a request.  The
state can be as simple as the URL.  It can also include extra HTTP
headers, e.g. a User-Agent.

BaseHandler --

internals:
BaseHandler and parent
_call_chain conventions

Example usage:

import urllib.request

# set up authentication info
authinfo = urllib.request.HTTPBasicAuthHandler()
authinfo.add_password(realm='PDQ Application',
                      uri='https://mahler:8092/site-updates.py',
                      user='klem',
                      passwd='geheim$parole')

proxy_support = urllib.request.ProxyHandler({"http" : "http://ahad-haam:3128"})

# build a new opener that adds authentication and caching FTP handlers
opener = urllib.request.build_opener(proxy_support, authinfo,
                                     urllib.request.CacheFTPHandler)

# install it
urllib.request.install_opener(opener)

f = urllib.request.urlopen('http://www.python.org/')
�N)�URLError�	HTTPError�ContentTooShortError)�urlparse�urlsplit�urljoin�unwrap�quote�unquote�
_splittype�
_splithost�
_splitport�
_splituser�_splitpasswd�
_splitattr�_splitquery�_splitvalue�	_splittag�	_to_bytes�unquote_to_bytes�
urlunparse)�
addinfourl�addclosehookFT�Request�OpenerDirector�BaseHandler�HTTPDefaultErrorHandler�HTTPRedirectHandler�HTTPCookieProcessor�ProxyHandler�HTTPPasswordMgr�HTTPPasswordMgrWithDefaultRealm�HTTPPasswordMgrWithPriorAuth�AbstractBasicAuthHandler�HTTPBasicAuthHandler�ProxyBasicAuthHandler�AbstractDigestAuthHandler�HTTPDigestAuthHandler�ProxyDigestAuthHandler�HTTPHandler�FileHandler�
FTPHandler�CacheFTPHandler�DataHandler�UnknownHandler�HTTPErrorProcessor�urlopen�install_opener�build_opener�pathname2url�url2pathname�
getproxies�urlretrieve�
urlcleanup�	URLopener�FancyURLopenerz%d.%d�)�cafile�capath�	cadefault�contextc
Cs�|s|s|rfddl}|�dtd�|dk	r2td��ts>td��tjtjj||d�}t	|d�}t
|�}	n0|r~t	|d�}t
|�}	ntdkr�t
�a}	nt}	|	�|||�S)	a$
Open the URL url, which can be either a string or a Request object.

    *data* must be an object specifying additional data to be sent to
    the server, or None if no such data is needed.  See Request for
    details.

    urllib.request module uses HTTP/1.1 and includes a "Connection:close"
    header in its HTTP requests.

    The optional *timeout* parameter specifies a timeout in seconds for
    blocking operations like the connection attempt (if not specified, the
    global default timeout setting will be used). This only works for HTTP,
    HTTPS and FTP connections.

    If *context* is specified, it must be a ssl.SSLContext instance describing
    the various SSL options. See HTTPSConnection for more details.

    The optional *cafile* and *capath* parameters specify a set of trusted CA
    certificates for HTTPS requests. cafile should point to a single file
    containing a bundle of CA certificates, whereas capath should point to a
    directory of hashed certificate files. More information can be found in
    ssl.SSLContext.load_verify_locations().

    The *cadefault* parameter is ignored.

    This function always returns an object which can work as a context
    manager and has methods such as

    * geturl() - return the URL of the resource retrieved, commonly used to
      determine if a redirect was followed

    * info() - return the meta-information of the page, such as headers, in the
      form of an email.message_from_string() instance (see Quick Reference to
      HTTP Headers)

    * getcode() - return the HTTP status code of the response.  Raises URLError
      on errors.

    For HTTP and HTTPS URLs, this function returns a http.client.HTTPResponse
    object slightly modified. In addition to the three new methods above, the
    msg attribute contains the same information as the reason attribute ---
    the reason phrase returned by the server --- instead of the response
    headers as it is specified in the documentation for HTTPResponse.

    For FTP, file, and data URLs and requests explicitly handled by legacy
    URLopener and FancyURLopener classes, this function returns a
    urllib.response.addinfourl object.

    Note that None may be returned if no handler handles the request (though
    the default installed global OpenerDirector uses UnknownHandler to ensure
    this never happens).

    In addition, if proxy settings are detected (for example, when a *_proxy
    environment variable like http_proxy is set), ProxyHandler is default
    installed and makes sure the requests are handled through the proxy.

    rNzJcafile, capath and cadefault are deprecated, use a custom context instead.r:zDYou can't pass both context and any of cafile, capath, and cadefaultzSSL support not available)r;r<)r>)
�warnings�warn�DeprecationWarning�
ValueError�	_have_ssl�sslZcreate_default_contextZPurposeZSERVER_AUTH�HTTPSHandlerr2�_opener�open)
�url�data�timeoutr;r<r=r>r?Z
https_handler�opener�rL�&/usr/lib64/python3.8/urllib/request.pyr0�s2<��
�



cCs|adS�N)rF)rKrLrLrMr1�sc
Cs:t|�\}}t�t||����}|��}|dkrN|sNtj�|�|fW5QR�S|r^t|d�}nt	j
dd�}|j}t�
|�|��||f}	d}
d}d}d}
d|kr�t|d	�}|r�||
|
|�|�|
�}|s�q�|t|�7}|�|�|
d
7}
|r�||
|
|�q�W5QRXW5QRX|dk�r6||k�r6td||f|	��|	S)aW
    Retrieve a URL into a temporary location on disk.

    Requires a URL argument. If a filename is passed, it is used as
    the temporary file location. The reporthook argument should be
    a callable that accepts a block number, a read size, and the
    total file size of the URL target. The data argument should be
    valid URL encoded data.

    If a filename is passed and the URL points to a local resource,
    the result is a copy from local file to new file.

    Returns a tuple containing the path to the newly created
    data file as well as the resulting HTTPMessage object.
    �file�wbF)�delete� ���r�content-length�Content-Length��1retrieval incomplete: got only %i out of %i bytes)r�
contextlib�closingr0�info�os�path�normpathrG�tempfileZNamedTemporaryFile�name�_url_tempfiles�append�int�read�len�writer)rH�filename�
reporthookrIZurl_typer\�fp�headers�tfp�result�bs�sizerc�blocknum�blockrLrLrMr6�sH


"��c	CsDtD](}zt�|�Wqtk
r*YqXqtdd�=tr@dadS)z0Clean up temporary files from urlretrieve calls.N)r`r[�unlink�OSErrorrF)Z	temp_filerLrLrMr7$s
z:\d+$cCs<|j}t|�d}|dkr&|�dd�}t�d|d�}|��S)z�Return request-host, as defined by RFC 2965.

    Variation from RFC: returned value is lowercased, for convenient
    comparison.

    rV��Host)�full_urlr�
get_header�_cut_port_re�sub�lower)�requestrH�hostrLrLrM�request_host3sr{c@s�eZdZdidddfdd�Zedd��Zejdd��Zejdd��Zed	d
��Zejdd
��Zejdd
��Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd#dd�Zdd �Zd!d"�ZdS)$rNFc	Csl||_i|_i|_d|_||_d|_|��D]\}}|�||�q,|dkrRt|�}||_	||_
|rh||_dSrN)rtri�unredirected_hdrs�_datarI�_tunnel_host�items�
add_headerr{�origin_req_host�unverifiable�method)	�selfrHrIrir�r�r��key�valuerLrLrM�__init__EszRequest.__init__cCs|jrd�|j|j�S|jS)Nz{}#{})�fragment�format�	_full_url�r�rLrLrMrtWszRequest.full_urlcCs(t|�|_t|j�\|_|_|��dSrN)rr�rr��_parse�r�rHrLrLrMrt]s
cCsd|_d|_d|_dS)Nrr)r�r��selectorr�rLrLrMrtdscCs|jSrN)r}r�rLrLrMrIjszRequest.datacCs(||jkr$||_|�d�r$|�d�dS)N�Content-length)r}�
has_header�
remove_header)r�rIrLrLrMrIns

cCs
d|_dSrN)rIr�rLrLrMrIxscCsNt|j�\|_}|jdkr(td|j��t|�\|_|_|jrJt|j�|_dS)Nzunknown url type: %r)	rr��typerBrtrrzr�r
)r��restrLrLrMr�|s
zRequest._parsecCs|jdk	rdnd}t|d|�S)z3Return a string indicating the HTTP request method.N�POST�GETr�)rI�getattr)r�Zdefault_methodrLrLrM�
get_method�szRequest.get_methodcCs|jSrN)rtr�rLrLrM�get_full_url�szRequest.get_full_urlcCs2|jdkr|js|j|_n||_|j|_||_dS)N�https)r�r~rzrtr�)r�rzr�rLrLrM�	set_proxy�s

zRequest.set_proxycCs|j|jkSrN)r�rtr�rLrLrM�	has_proxy�szRequest.has_proxycCs||j|��<dSrN)ri�
capitalize�r�r��valrLrLrMr��szRequest.add_headercCs||j|��<dSrN)r|r�r�rLrLrM�add_unredirected_header�szRequest.add_unredirected_headercCs||jkp||jkSrN)rir|�r��header_namerLrLrMr��s
�zRequest.has_headercCs|j�||j�||��SrN)ri�getr|)r�r��defaultrLrLrMru�s�zRequest.get_headercCs |j�|d�|j�|d�dSrN)ri�popr|r�rLrLrMr��szRequest.remove_headercCs|j|j�}t|���SrN)r|ri�listr)r��hdrsrLrLrM�header_items�szRequest.header_items)N)�__name__�
__module__�__qualname__r��propertyrt�setter�deleterrIr�r�r�r�r�r�r�r�rur�r�rLrLrLrMrCs8�





	

c@sNeZdZdd�Zdd�Zdd�Zdd�Zd	ejfd
d�Z	ddd
�Z
dd�Zd	S)rcCs6dt}d|fg|_g|_i|_i|_i|_i|_dS)N�Python-urllib/%sz
User-agent)�__version__�
addheaders�handlers�handle_open�handle_error�process_response�process_request)r�Zclient_versionrLrLrMr��szOpenerDirector.__init__c	CsTt|d�stdt|���d}t|�D�]}|dkr6q&|�d�}|d|�}||dd�}|�d�r�|�d�|d}||dd�}zt|�}Wntk
r�YnX|j�	|i�}	|	|j|<n>|dkr�|}|j
}	n*|d	kr�|}|j}	n|d
kr&|}|j}	nq&|	�
|g�}
|
�r"t�|
|�n
|
�|�d}q&|�rPt�|j|�|�|�dS)N�
add_parentz%expected BaseHandler instance, got %rF)�redirect_request�do_open�
proxy_open�_rV�errorrG�responseryT)�hasattr�	TypeErrorr��dir�find�
startswithrbrBr�r�r�r�r��
setdefault�bisectZinsortrar�r�)r��handlerZadded�meth�i�protocolZ	condition�j�kind�lookupr�rLrLrM�add_handler�sL
�


zOpenerDirector.add_handlercCsdSrNrLr�rLrLrM�close�szOpenerDirector.closec	Gs<|�|d�}|D]&}t||�}||�}|dk	r|SqdS)NrL)r�r�)	r��chainr��	meth_name�argsr�r��funcrkrLrLrM�_call_chain�s
zOpenerDirector._call_chainNc
Cs�t|t�rt||�}n|}|dk	r(||_||_|j}|d}|j�|g�D]}t||�}||�}qJt	�
d|j|j|j|�
��|�||�}	|d}|j�|g�D]}t||�}|||	�}	q�|	S)NZ_requestzurllib.RequestZ	_response)�
isinstance�strrrIrJr�r�r�r��sys�auditrtrir��_openr�)
r��fullurlrIrJ�reqr�r�Z	processorr�r�rLrLrMrG�s$



zOpenerDirector.opencCsP|�|jdd|�}|r|S|j}|�|j||d|�}|r>|S|�|jdd|�S)Nr�Zdefault_openr��unknown�unknown_open)r�r�r�)r�r�rIrkr�rLrLrMr�s$
���
�zOpenerDirector._opencGs~|dkr,|jd}|d}d|}d}|}n|j}|d}d}|||f|}|j|�}|r^|S|rz|dd	f|}|j|�SdS)
N��httpr�r�r:z
http_error_%srVZ_errorrr��http_error_default)r�r�)r��protor��dictr�Zhttp_errZ	orig_argsrkrLrLrMr�&s 

zOpenerDirector.error)N)r�r�r�r�r�r�r��socket�_GLOBAL_DEFAULT_TIMEOUTrGr�r�rLrLrLrMr�s/
c	Gs�t�}ttttttttt	g	}t
tjd�r2|�
t�t�}|D]B}|D]8}t|t�rht||�r||�|�qDt||�rD|�|�qDq<|D]}|�|�q�|D]}|�|��q�|D]}t|t�r�|�}|�|�q�|S)a*Create an opener object from a list of handlers.

    The opener will use several default handlers, including support
    for HTTP, FTP and when applicable HTTPS.

    If any of the handlers passed as arguments are subclasses of the
    default handlers, the default handlers will not be used.
    �HTTPSConnection)rrr.r)rrr+r*r/r-r�r��clientrarE�setr�r��
issubclass�add�remover�)r�rKZdefault_classes�skip�klassZcheck�hrLrLrMr2?s8	�




c@s(eZdZdZdd�Zdd�Zdd�ZdS)	r��cCs
||_dSrN)�parent)r�r�rLrLrMr�fszBaseHandler.add_parentcCsdSrNrLr�rLrLrMr�iszBaseHandler.closecCst|d�sdS|j|jkS)N�
handler_orderT)r�r�)r��otherrLrLrM�__lt__ms
zBaseHandler.__lt__N)r�r�r�r�r�r�r�rLrLrLrMrcsc@s eZdZdZdZdd�ZeZdS)r/zProcess HTTP error responses.i�cCsH|j|j|��}}}d|kr,dksDn|j�d|||||�}|S)N���,r�)�code�msgrZr�r�)r�ryr�r�r�r�rLrLrM�
http_responsezs�z HTTPErrorProcessor.http_responseN)r�r�r��__doc__r�r��https_responserLrLrLrMr/vsc@seZdZdd�ZdS)rcCst|j||||��dSrN)rrt)r�r�rhr�r�r�rLrLrMr��sz*HTTPDefaultErrorHandler.http_error_defaultN)r�r�r�r�rLrLrLrMr�sc@s4eZdZdZdZdd�Zdd�ZeZZZ	dZ
dS)	r��
c	st|��}|dkr|dks:|dkr(|dks:t|j||||��|�dd�}d��fdd	�|j��D�}t|||jd
d�S)a�Return a Request or None in response to a redirect.

        This is called by the http_error_30x methods when a
        redirection response is received.  If a redirection should
        take place, return a new Request to allow http_error_30x to
        perform the redirect.  Otherwise, raise HTTPError if no-one
        else should try to handle this url.  Return None if you can't
        but another Handler might.
        )�-�.�/i3)r�ZHEAD)r�r�r�r�� z%20)rTzcontent-typecs"i|]\}}|���kr||�qSrL)rx��.0�k�v�ZCONTENT_HEADERSrLrM�
<dictcomp>�s�z8HTTPRedirectHandler.redirect_request.<locals>.<dictcomp>T)rir�r�)r�rrt�replacerirrr�)	r�r�rhr�r�ri�newurl�mZ
newheadersrLrrMr��s
���z$HTTPRedirectHandler.redirect_requestc
CsLd|kr|d}nd|kr$|d}ndSt|�}|jdkrRt||d||f||��|jsn|jrnt|�}d|d<t|�}t|dtj	d�}t
|j|�}|�||||||�}|dkr�dSt
|d	��r|j}	|_|	�|d
�|jks�t|	�|jk�rt|j||j|||��ni}	|_|_|	�|d
�d|	|<|��|��|jj||jd�S)
N�location�uri�r�r��ftprrz+%s - Redirection to url '%s' is not allowed�/r:z
iso-8859-1)�encoding�safe�
redirect_dictrrV�rJ)r�schemerr\Znetlocr�rr	�stringZpunctuationrrtr�r�r
r��max_repeatsrd�max_redirections�inf_msgrcr�r�rGrJ)
r�r�rhr�r�rir�urlparts�newZvisitedrLrLrM�http_error_302�sT



����z"HTTPRedirectHandler.http_error_302zoThe HTTP server returned a redirect error that would lead to an infinite loop.
The last 30x error message was:
N)r�r�r�rrr�r�http_error_301�http_error_303�http_error_307rrLrLrLrMr�s&<c
Cs�t|�\}}|�d�s d}|}nZ|�d�s6td|��d|krV|�d�}|�d|�}n|�dd�}|dkrnd}|d|�}t|�\}}|dk	r�t|�\}}	nd}}	|||	|fS)aReturn (scheme, user, password, host/port) given a URL or an authority.

    If a URL is supplied, it must have an authority (host:port) component.
    According to RFC 3986, having an authority component means the URL must
    have two slashes after the scheme.
    r
N�//zproxy URL with no authority: %r�@r:rS)rr�rBr�rr)
�proxyrZr_scheme�	authorityZhost_separator�endZuserinfo�hostport�user�passwordrLrLrM�_parse_proxy�s$


r"c@s"eZdZdZddd�Zdd�ZdS)r�dNcCsb|dkrt�}t|d�s td��||_|��D].\}}|��}t|d||||jfdd��q.dS)N�keys�proxies must be a mappingz%s_opencSs||||�SrNrL)�rrr�r�rLrLrM�<lambda>)sz'ProxyHandler.__init__.<locals>.<lambda>)r5r��AssertionError�proxiesrrx�setattrr�)r�r)r�rHrLrLrMr�!s
�zProxyHandler.__init__cCs�|j}t|�\}}}}|dkr"|}|jr6t|j�r6dS|rv|rvdt|�t|�f}	t�|	����d�}
|�	dd|
�t|�}|�
||�||ks�|dkr�dS|jj||j
d�SdS)N�%s:%s�ascii�Proxy-authorization�Basic r�r)r�r"rz�proxy_bypassr
�base64�	b64encode�encode�decoder�r�r�rGrJ)r�r�rr�Z	orig_typeZ
proxy_typer r!rZ	user_passZcredsrLrLrMr�,s"�zProxyHandler.proxy_open)N)r�r�r�r�r�r�rLrLrLrMrs
c@s6eZdZdd�Zdd�Zdd�Zd
dd	�Zd
d�ZdS)r cCs
i|_dSrN)�passwdr�rLrLrMr�JszHTTPPasswordMgr.__init__cs\t|t�r|g}|�jkr$i�j|<dD].�t��fdd�|D��}||f�j||<q(dS)N�TFc3s|]}��|��VqdSrN)�
reduce_uri)r��u��default_portr�rLrM�	<genexpr>Tsz/HTTPPasswordMgr.add_password.<locals>.<genexpr>)r�r�r4�tuple)r��realmrr r4�reduced_urirLr8rM�add_passwordMs


�zHTTPPasswordMgr.add_passwordc	Cs`|j�|i�}dD]H}|�||�}|��D].\}}|D] }|�||�r6|Sq6q*qdS)Nr5�NN)r4r�r6r�	is_suburi)	r�r<�authuriZdomainsr9�reduced_authuriZurisZauthinforrLrLrM�find_user_passwordXsz"HTTPPasswordMgr.find_user_passwordTc
Cs�t|�}|dr.|d}|d}|dp*d}nd}|}d}t|�\}}|r~|dkr~|dk	r~ddd��|�}	|	dk	r~d	||	f}||fS)
z@Accept authority or URI and extract only the authority and path.rVrr:r
N�Pi�r�z%s:%d)rr
r�)
r�rr9�partsrrr\rz�portZdportrLrLrMr6bs$��zHTTPPasswordMgr.reduce_uricCsN||krdS|d|dkr dS|d}|dd�dkr@|d7}|d�|�S)zcCheck if test is below base in a URI tree

        Both args must be URIs in reduced form.
        TrFrVrSNr
)r�)r��base�test�prefixrLrLrMr@yszHTTPPasswordMgr.is_suburiN)T)r�r�r�r�r>rCr6r@rLrLrLrMr Hs


c@seZdZdd�ZdS)r!cCs0t�|||�\}}|dk	r"||fSt�|d|�SrN)r rC)r�r<rAr r!rLrLrMrC�s�z2HTTPPasswordMgrWithDefaultRealm.find_user_passwordN)r�r�r�rCrLrLrLrMr!�scs<eZdZ�fdd�Zd
�fdd�	Zddd�Zdd	�Z�ZS)r"csi|_t�j||�dSrN)�
authenticated�superr��r�r��kwargs��	__class__rLrMr��sz%HTTPPasswordMgrWithPriorAuth.__init__Fcs<|�||�|dk	r&t��d|||�t��||||�dSrN)�update_authenticatedrKr>)r�r<rr r4�is_authenticatedrNrLrMr>�sz)HTTPPasswordMgrWithPriorAuth.add_passwordcCs>t|t�r|g}dD]$}|D]}|�||�}||j|<qqdS�Nr5)r�r�r6rJ)r�rrQr9r7r=rLrLrMrP�s
z1HTTPPasswordMgrWithPriorAuth.update_authenticatedcCsDdD]:}|�||�}|jD]"}|�||�r|j|SqqdSrR)r6rJr@)r�rAr9rBrrLrLrMrQ�s

z-HTTPPasswordMgrWithPriorAuth.is_authenticated)F)F)r�r�r�r�r>rPrQ�
__classcell__rLrLrNrMr"�s

c@sTeZdZe�dej�Zddd�Zdd�Zdd�Z	d	d
�Z
dd�Zd
d�ZeZ
eZdS)r#z1(?:^|,)[ 	]*([^ 	,]+)[ 	]+realm=(["']?)([^"']*)\2NcCs"|dkrt�}||_|jj|_dSrN)r r4r>)r�Zpassword_mgrrLrLrMr��sz!AbstractBasicAuthHandler.__init__ccspd}tj�|�D]6}|��\}}}|dkr8t�dtd�||fVd}q|sl|r^|��d}nd}|dfVdS)NF)�"�'zBasic Auth Realm was unquoted�Trrr)r#�rx�finditer�groupsr?r@�UserWarning�split)r��headerZfound_challengeZmorr	r<rLrLrM�_parse_realm�s�
z%AbstractBasicAuthHandler._parse_realmc	Cs~|�|�}|sdSd}|D]H}|�|�D]8\}}|��dkrB|}q(|dk	r(|�|||�Sq(q|dk	rztd|f��dS)N�basiczBAbstractBasicAuthHandler does not support the following scheme: %r)Zget_allr]rx�retry_http_basic_authrB)	r��authreqrzr�riZunsupportedr\rr<rLrLrM�http_error_auth_reqed�s
�z.AbstractBasicAuthHandler.http_error_auth_reqedcCs||j�||�\}}|dk	rtd||f}dt�|����d�}|�|jd�|krTdS|�|j|�|j	j
||jd�SdSdS)Nr+r.r,r)r4rCr0r1r2r3ru�auth_headerr�r�rGrJ)r�rzr�r<r �pw�raw�authrLrLrMr_�sz.AbstractBasicAuthHandler.retry_http_basic_authcCstt|jd�r|j�|j�s|S|�d�sp|j�d|j�\}}d�||���}t�	|��
�}|�dd�|����|S)NrQ�
Authorizationz{0}:{1}zBasic {})
r�r4rQrtr�rCr�r2r0Zstandard_b64encoder3r��strip)r�r�r r4ZcredentialsZauth_strrLrLrM�http_requests�
�z%AbstractBasicAuthHandler.http_requestcCsLt|jd�rHd|jkr"dkr8nn|j�|jd�n|j�|jd�|S)NrQr�r�TF)r�r4r�rPrt)r�r�r�rLrLrMr�s
z&AbstractBasicAuthHandler.http_response)N)r�r�r��re�compile�IrWr�r]rar_rhr��
https_requestr�rLrLrLrMr#�s�

c@seZdZdZdd�ZdS)r$rfcCs|j}|�d|||�}|S)N�www-authenticate)rtra)r�r�rhr�r�rirHr�rLrLrM�http_error_401$s�z#HTTPBasicAuthHandler.http_error_401N)r�r�r�rbrnrLrLrLrMr$ sc@seZdZdZdd�ZdS)r%r-cCs|j}|�d|||�}|S�N�proxy-authenticate)rzra)r�r�rhr�r�rirr�rLrLrM�http_error_407/s�z$ProxyBasicAuthHandler.http_error_407N)r�r�r�rbrqrLrLrLrMr%+sc@sNeZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dS)r&NcCs4|dkrt�}||_|jj|_d|_d|_d|_dS�Nr)r r4r>�retried�nonce_count�
last_nonce)r�r4rLrLrMr�Is
z"AbstractDigestAuthHandler.__init__cCs
d|_dSrr)rsr�rLrLrM�reset_retry_countRsz+AbstractDigestAuthHandler.reset_retry_countcCs||�|d�}|jdkr*t|jdd|d��n|jd7_|rx|��d}|��dkr`|�||�S|��dkrxtd|��dS)	N�i�zdigest auth failedrVrZdigestr^zEAbstractDigestAuthHandler does not support the following scheme: '%s')r�rsrrtr[rx�retry_http_digest_authrB)r�rbrzr�rir`rrLrLrMraUs

��z/AbstractDigestAuthHandler.http_error_auth_reqedcCsz|�dd�\}}ttdt|���}|�||�}|rvd|}|j�|jd�|krRdS|�|j|�|j	j
||jd�}|SdS)Nr�rVz	Digest %sr)r[�parse_keqv_list�filter�parse_http_list�get_authorizationrir�rbr�r�rGrJ)r�r�re�tokenZ	challenge�chalZauth_valZresprLrLrMrxisz0AbstractDigestAuthHandler.retry_http_digest_authcCs@d|j|t��f}|�d�td�}t�|���}|dd�S)Nz	%s:%s:%s:r,��)rt�time�ctimer2�_randombytes�hashlib�sha1�	hexdigest)r��nonce�s�b�digrLrLrM�
get_cnonceusz$AbstractDigestAuthHandler.get_cnoncecCs�z6|d}|d}|�d�}|�dd�}|�dd�}Wntk
rLYdSX|�|�\}}	|dkrhdS|j�||j�\}
}|
dkr�dS|jdk	r�|�|j|�}nd}d|
||f}
d|��|j	f}|dkr�|	||
�d|||�f�}n~d	|�
d
�k�r\||jk�r|jd7_nd|_||_d|j}|�
|�}d
|||d	||�f}|	||
�|�}ntd|��d|
|||j	|f}|�r�|d|7}|�r�|d|7}|d|7}|�r�|d||f7}|S)Nr<r��qop�	algorithm�MD5�opaquez%s:%s:%sr+re�,rVz%08xz%s:%s:%s:%s:%szqop '%s' is not supported.z>username="%s", realm="%s", nonce="%s", uri="%s", response="%s"z
, opaque="%s"z
, digest="%s"z, algorithm="%s"z, qop=auth, nc=%s, cnonce="%s")r��KeyError�get_algorithm_implsr4rCrtrI�get_entity_digestr�r�r[rurtr�r)r�r�r~r<r�r�r�r��H�KDr rcZentdigZA1ZA2ZrespdigZncvalueZcnonceZnoncebitrGrLrLrMr|�s\

�


��z+AbstractDigestAuthHandler.get_authorizationcsD|dkrdd��n|dkr$dd��ntd|���fdd�}�|fS)Nr�cSst�|�d����S�Nr,)r�Zmd5r2r���xrLrLrMr'��z?AbstractDigestAuthHandler.get_algorithm_impls.<locals>.<lambda>ZSHAcSst�|�d����Sr�)r�r�r2r�r�rLrLrMr'�r�z.Unsupported digest authentication algorithm %rcs�d||f�S)Nr+rL)r��d�r�rLrMr'�r�)rB)r�r�r�rLr�rMr��s

�z-AbstractDigestAuthHandler.get_algorithm_implscCsdSrNrL)r�rIr~rLrLrMr��sz+AbstractDigestAuthHandler.get_entity_digest)N)r�r�r�r�rvrarxr�r|r�r�rLrLrLrMr&>s
	>
c@s eZdZdZdZdZdd�ZdS)r'z�An authentication protocol defined by RFC 2069

    Digest authentication improves on basic authentication because it
    does not transmit passwords in the clear.
    rf��cCs*t|j�d}|�d|||�}|��|S)NrVrm)rrtrarv�r�r�rhr�r�rirz�retryrLrLrMrn�s�z$HTTPDigestAuthHandler.http_error_401N)r�r�r�r�rbr�rnrLrLrLrMr'�sc@seZdZdZdZdd�ZdS)r(�Proxy-Authorizationr�cCs"|j}|�d|||�}|��|Sro)rzrarvr�rLrLrMrq�s�z%ProxyDigestAuthHandler.http_error_407N)r�r�r�rbr�rqrLrLrLrMr(�sc@s6eZdZd
dd�Zdd�Zdd�Zdd	�Zd
d�ZdS)�AbstractHTTPHandlerrcCs
||_dSrN��_debuglevel)r��
debuglevelrLrLrMr��szAbstractHTTPHandler.__init__cCs
||_dSrNr�)r��levelrLrLrM�set_http_debuglevel�sz'AbstractHTTPHandler.set_http_debuglevelcCstjj�|j|���SrN)r�r��HTTPConnection�_get_content_lengthrIr��r�ryrLrLrMr��s�z'AbstractHTTPHandler._get_content_lengthcCs|j}|std��|jdk	r�|j}t|t�r8d}t|��|�d�sN|�dd�|�d�s�|�d�s�|�|�}|dk	r�|�dt|��n|�dd�|}|�	�r�t
|j�\}}t|�\}}	|�d�s�|�d|�|j
jD]&\}
}|
��}
|�|
�s�|�|
|�q�|S)	N�
no host givenz\POST data should be bytes, an iterable of bytes, or a file object. It cannot be of type str.zContent-type�!application/x-www-form-urlencodedr��Transfer-encodingZchunkedrs)rzrrIr�r�r�r�r�r�r�rr�rr�r�r�)r�ryrzrIr�Zcontent_lengthZsel_hostrZselZsel_pathr_r�rLrLrM�do_request_�sJ


�
�
��

zAbstractHTTPHandler.do_request_c

sT|j}|std��||fd|ji|��}|�|j�t|j�����fdd�|j�	�D��d�d<dd���	�D��|j
r�i}d}|�kr��|||<�|=|j|j
|d	�z`z&|j|�
�|j|j�|�d
�d�Wn,tk
�r}zt|��W5d}~XYnX|��}	Wn|���YnX|j�r>|j��d|_|��|	_|	j|	_|	S)
z�Return an HTTPResponse object for the request, using http_class.

        http_class must implement the HTTPConnection API from http.client.
        r�rJcsi|]\}}|�kr||�qSrLrLr��rirLrMr/s�z/AbstractHTTPHandler.do_open.<locals>.<dictcomp>r��
ConnectioncSsi|]\}}|��|�qSrL)�title)r�r_r�rLrLrMr<sr�r�r�)Zencode_chunkedN)rzrrJZset_debuglevelr�r�r|�updaterirr~Z
set_tunnelryr�r�rIr�rq�getresponser�Zsockr�rH�reasonr�)
r�Z
http_classr�Zhttp_conn_argsrzr�Ztunnel_headersZproxy_auth_hdr�errr&rLr�rMr�!sB
�


zAbstractHTTPHandler.do_openN)r)r�r�r�r�r�r�r�r�rLrLrLrMr��s

&r�c@seZdZdd�ZejZdS)r)cCs|�tjj|�SrN)r�r�r�r��r�r�rLrLrM�	http_openfszHTTPHandler.http_openN)r�r�r�r�r�r�rhrLrLrLrMr)dsr�c@s$eZdZddd�Zdd�ZejZdS)rErNcCst�||�||_||_dSrN)r�r��_context�_check_hostname)r�r�r>�check_hostnamerLrLrMr�oszHTTPSHandler.__init__cCs|jtjj||j|jd�S)N)r>r�)r�r�r�r�r�r�r�rLrLrM�
https_opents�zHTTPSHandler.https_open)rNN)r�r�r�r�r�r�r�rlrLrLrLrMrEms
rEc@s.eZdZddd�Zdd�Zdd�ZeZeZdS)	rNcCs$ddl}|dkr|j��}||_dSrr)Zhttp.cookiejar�	cookiejarZ	CookieJar)r�r�r�rLrLrMr�}s
zHTTPCookieProcessor.__init__cCs|j�|�|SrN)r�Zadd_cookie_headerr�rLrLrMrh�sz HTTPCookieProcessor.http_requestcCs|j�||�|SrN)r�Zextract_cookies)r�ryr�rLrLrMr��sz!HTTPCookieProcessor.http_response)N)r�r�r�r�rhr�rlr�rLrLrLrMr|s

c@seZdZdd�ZdS)r.cCs|j}td|��dS)Nzunknown url type: %s)r�r)r�r�r�rLrLrMr��szUnknownHandler.unknown_openN)r�r�r�r�rLrLrLrMr.�scCsNi}|D]@}|�dd�\}}|ddkr@|ddkr@|dd�}|||<q|S)z>Parse list of key=value strings where keys are not duplicated.�=rVrrTrS)r[)�lZparsedZeltr�rrLrLrMry�s
rycCs�g}d}d}}|D]l}|r*||7}d}q|rT|dkr>d}qn|dkrJd}||7}q|dkrl|�|�d}q|dkrxd}||7}q|r�|�|�dd�|D�S)	apParse lists as described by RFC 2068 Section 2.

    In particular, parse comma-separated lists where the elements of
    the list may include quoted-strings.  A quoted-string could
    contain a comma.  A non-quoted string could have quotes in the
    middle.  Neither commas nor quotes count if they are escaped.
    Only double-quotes count, not single-quotes.
    rrF�\TrTr�cSsg|]}|���qSrL)rg)r��partrLrLrM�
<listcomp>�sz#parse_http_list.<locals>.<listcomp>)ra)r��resr��escaper	ZcurrLrLrMr{�s4	


r{c@s(eZdZdd�ZdZdd�Zdd�ZdS)r*cCs\|j}|dd�dkrN|dd�dkrN|jrN|jdkrN|j|��krXtd��n
|�|�SdS)Nr:rrVr
�	localhost�-file:// scheme is supported only on localhost)r�rz�	get_namesr�open_local_file)r�r�rHrLrLrM�	file_open�s&�
zFileHandler.file_openNcCs`tjdkrZz*tt�d�dt�t���d�t_Wn$tjk
rXt�d�ft_YnXtjS)Nr�r:)r*�namesr;r��gethostbyname_ex�gethostname�gaierror�
gethostbynamer�rLrLrMr��s
��
zFileHandler.get_namesc
Cs�ddl}ddl}|j}|j}t|�}z�t�|�}|j}|jj	|j
dd�}	|�|�d}
|�d|
pbd||	f�}|r~t
|�\}}|r�|s�t|�|��kr�|r�d||}
nd|}
tt|d�||
�WSWn*tk
r�}zt|��W5d}~XYnXtd��dS)	NrT�Zusegmtz6Content-type: %s
Content-length: %d
Last-modified: %s
�
text/plain�file://�rbzfile not on local host)�email.utils�	mimetypesrzr�r4r[�stat�st_size�utils�
formatdate�st_mtime�
guess_type�message_from_stringr
�_safe_gethostbynamer�rrGrqr)r�r��emailr�rzrfZ	localfile�statsrm�modified�mtyperirFZorigurl�exprLrLrMr��s:
����zFileHandler.open_local_file)r�r�r�r�r�r�r�rLrLrLrMr*�s
cCs*zt�|�WStjk
r$YdSXdSrN)r�r�r�)rzrLrLrMr��sr�c@seZdZdd�Zdd�ZdS)r+c
Cs*ddl}ddl}|j}|s"td��t|�\}}|dkr>|j}nt|�}t|�\}}|rdt|�\}}nd}t	|�}|pvd}|p~d}zt
�|�}Wn*tk
r�}zt|��W5d}~XYnXt
|j�\}	}
|	�d�}ttt	|��}|dd�|d}}|�r|d�s|dd�}z�|�||||||j�}
|�r6d�p8d}|
D]2}t|�\}}|��d	k�r>|d
k�r>|��}�q>|
�||�\}}d}|�|j�d}|�r�|d|7}|dk	�r�|dk�r�|d|7}t�|�}t|||j�WS|jk
�r$}z"td
|�}|�t� �d��W5d}~XYnXdS)Nr�ftp error: no host givenrrr
rSrVrk�Dr���a�Ar�rkr�r�zContent-type: %s
zContent-length: %d
�
ftp error: %rr:)!�ftplibr�rzrr
�FTP_PORTrbrrr
r�r�rqrr�r[r��map�connect_ftprJrrx�upper�retrfiler�rtr�r�r�
all_errors�with_tracebackr��exc_info)r�r�r�r�rzrFr r4r�r\�attrs�dirsrO�fwr��attrr�rh�retrlenrir�r��excrLrLrM�ftp_opens^
�
zFTPHandler.ftp_openc	Cst||||||dd�S)NF)�
persistent)�
ftpwrapper)r�r r4rzrFr�rJrLrLrMr�7s�zFTPHandler.connect_ftpN)r�r�r�r�r�rLrLrLrMr+s5c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)r,cCs"i|_i|_d|_d|_d|_dS)Nr�<r�)�cacherJ�soonest�delay�	max_connsr�rLrLrMr�>s
zCacheFTPHandler.__init__cCs
||_dSrN)r�)r��trLrLrM�
setTimeoutEszCacheFTPHandler.setTimeoutcCs
||_dSrN)r�)r�rrLrLrM�setMaxConnsHszCacheFTPHandler.setMaxConnscCsr|||d�|�|f}||jkr4t��|j|j|<n,t||||||�|j|<t��|j|j|<|��|j|S)Nr
)�joinr�r�r�rJr��check_cache)r�r r4rzrFr�rJr�rLrLrMr�Ks

�
zCacheFTPHandler.connect_ftpcCs�t��}|j|krPt|j���D].\}}||kr |j|��|j|=|j|=q tt|j����|_t	|j�|j
kr�t|j���D]&\}}||jkr�|j|=|j|=q�q�tt|j����|_dSrN)r�r�r�rJrr�r��min�valuesrdr�)r�r�r�rrLrLrMrVs


zCacheFTPHandler.check_cachecCs0|j��D]}|��q
|j��|j��dSrN)r�rr��clearrJ)r��connrLrLrM�clear_cachejs

zCacheFTPHandler.clear_cacheN)	r�r�r�r�r�r�r�rrrLrLrLrMr,;sc@seZdZdd�ZdS)r-cCs~|j}|�dd�\}}|�dd�\}}t|�}|�d�rNt�|�}|dd�}|sVd}t�d|t|�f�}t	t
�|�||�S)N�:rVr�z;base64i�����text/plain;charset=US-ASCIIz$Content-type: %s
Content-length: %d
)rtr[r�endswithr0�decodebytesr�r�rdr�io�BytesIO)r�r�rHrrIZ	mediatyperirLrLrM�	data_openqs



�zDataHandler.data_openN)r�r�r�rrLrLrLrMr-psr��nt)r4r3cCst|�S)zOS-specific conversion from a relative URL of the 'file' scheme
        to a file system path; not recommended for general use.)r
��pathnamerLrLrMr4�scCst|�S)zOS-specific conversion from a file system path to a relative URL
        of the 'file' scheme; not recommended for general use.)r	rrLrLrMr3�sc@s�eZdZdZdZdeZd*dd�Zdd�Zdd	�Z	d
d�Z
dd
�Zd+dd�Zd,dd�Z
d-dd�Zd.dd�Zdd�Zd/dd�Zd0dd�Zdd�Zer�dd�Zd1d d!�Zd"d#�Zd$d%�Zd&d'�Zd2d(d)�ZdS)3r8a,Class to open URLs.
    This is a class rather than just a subroutine because we may need
    more than one set of global protocol-specific options.
    Note -- this is a base class for those who don't want the
    automatic handling of errors type 302 (relocated) and 401
    (authorization needed).Nr�cKs�dd|jji}tj|tdd�|dkr.t�}t|d�s@td��||_|�	d�|_
|�	d�|_d	|jfd
g|_
g|_tj|_d|_t|_dS)NzW%(class)s style of invoking requests is deprecated. Use newer urlopen functions/methods�classrV)�
stacklevelr$r%�key_file�	cert_filez
User-Agent)ZAcceptz*/*)rOr�r?r@rAr5r�r(r)r�rr�versionr��_URLopener__tempfilesr[rp�_URLopener__unlink�	tempcache�ftpcache)r�r)Zx509r�rLrLrMr��s
�zURLopener.__init__cCs|��dSrN)r�r�rLrLrM�__del__�szURLopener.__del__cCs|��dSrN)�cleanupr�rLrLrMr��szURLopener.closec	CsV|jrB|jD](}z|�|�Wqtk
r2YqXq|jdd�=|jrR|j��dSrN)rrrqrr)r�rOrLrLrMr�s
zURLopener.cleanupcGs|j�|�dS)zdAdd a header to be used by the HTTP interface only
        e.g. u.addheader('Accept', 'sound/basic')N)r�ra)r�r�rLrLrM�	addheader�szURLopener.addheaderc
Csptt|��}t|dd�}|jrL||jkrL|j|\}}t|d�}t|||�St|�\}}|s`d}||jkr�|j|}t|�\}}	t|	�\}
}|
|f}nd}d|}||_	|�
dd�}t||�r�|d	kr�|r�|�|||�S|�
||�Sz0|dk�rt||�|�WSt||�||�WSWnVttfk
�r0�Yn<tk
�rj}
ztd
|
��t��d��W5d}
~
XYnXdS)z6Use URLopener().open(file) instead of open(file, 'r').z%/:=&?~#+!$,;'@()*[]|�rr�rONZopen_�-r�r�zsocket errorr:)rrr	rrGrrr)rr�rr��open_unknown_proxy�open_unknownr�rrrqr�r�r�)r�r�rIrfrirh�urltyperHr�	proxyhostrzr�r_r�rLrLrMrG�s<




zURLopener.opencCst|�\}}tdd|��dS)�/Overridable interface to open unknown URL type.�	url errorzunknown url typeN�rrq)r�r�rIr�rHrLrLrMr
szURLopener.open_unknowncCs t|�\}}tdd||��dS)r"r#zinvalid proxy for %sNr$)r�rr�rIr�rHrLrLrMrszURLopener.open_unknown_proxyc
Cstt|��}|jr&||jkr&|j|St|�\}}|dkr�|rF|dkr�z0|�|�}|��}|��tt|�d�|fWSt	k
r�}	zW5d}	~	XYnX|�
||�}�z<|��}
|r�t
|d�}nrt|�\}}
t|
p�d�\}}
t|
p�d�\}
}t|
p�d�\}
}t
j�|
�d}t�|�\}}|j�|�t
�|d�}z�||
f}|jdk	�rT||j|<d}d}d}d}d	|
k�rzt|
d
�}|�r�||||�|�|�}|�s��q�|t|�7}|�|�|d7}|�r�||||��q�W5|��XW5|��X|dk�r||k�rtd||f|��|S)ztretrieve(url) returns (filename, headers) for a local object
        or (tempfilename, headers) for a remote object.NrOrVrPrrrRrSrrTrUrW)rrrrr�rZr�r4rrqrGrrr[r\�splitextr^Zmkstemprra�fdopenrbrcrdrer)r�rHrfrgrIr�Zurl1rhr�r�rirjZgarbager\�suffix�fdrkrlrmrcrnrorLrLrM�retrievesn






��zURLopener.retrievecCs$d}d}t|t�r<t|�\}}|r6t|�\}}t|�}|}nt|\}}t|�\}}t|�\}	}
|
}d}|	��dkrvd}n:t|
�\}}
|r�t|�\}}|r�d|	||
f}t|�r�|}|s�tdd��|r�t|�}t	�
|����d�}nd}|�rt|�}t	�
|����d�}nd}||�}
i}|�r*d||d<|�r<d||d	<|�rJ||d
<d|d<|j
D]\}}|||<�qX|dk	�r�d
|d<|
�d|||�n|
jd||d�z|
��}Wn"tjjk
�r�td��YnXd|jk�r�dk�rnnt||jd||j�S|�||j|j|j|j|�SdS)a�Make an HTTP connection using connection_class.

        This is an internal method that should be called from
        open_http() or open_https().

        Arguments:
        - connection_factory should take a host name and return an
          HTTPConnection instance.
        - url is the url to retrieval or a host, relative-path pair.
        - data is payload for a POST request or None.
        Nr�z	%s://%s%sz
http errorr�r,zBasic %sr�rfrsr�r�r�zContent-Typer�r�r�z$http protocol error: bad status liner�r��http:)r�r�rrr
rrxr/rqr0r1r2r3r�ryr�r�r�Z
BadStatusLinerZstatusrr��
http_errorrhr�)r�Zconnection_factoryrHrIZuser_passwdZproxy_passwdrzr�Zrealhostr r�Z
proxy_authreZ	http_connrir\r�r�rLrLrM�_open_generic_httpVs~



��zURLopener._open_generic_httpcCs|�tjj||�S)zUse HTTP protocol.)r,r�r�r��r�rHrIrLrLrM�	open_http�szURLopener.open_httpc
Csbd|}t||�rPt||�}|dkr6||||||�}	n|||||||�}	|	rP|	S|�|||||�S)z�Handle http errors.

        Derived class can override this, or provide specific handlers
        named http_error_DDD where DDD is the 3-digit error code.z
http_error_%dN)r�r�r�)
r�rHrh�errcode�errmsgrirIr_r�rkrLrLrMr+�s

zURLopener.http_errorcCs|��t||||d��dS)z>Default error handler: close the connection and raise OSError.N)r�r�r�rHrhr/r0rirLrLrMr��szURLopener.http_error_defaultcCstjj||j|jd�S)N)rr)r�r�r�rr)r�rzrLrLrM�_https_connection�s�zURLopener._https_connectioncCs|�|j||�S)zUse HTTPS protocol.)r,r2r-rLrLrM�
open_https�szURLopener.open_httpscCs^t|t�std��|dd�dkrP|dd�dkrP|dd���dkrPtd	��n
|�|�SdS)
z/Use local file or FTP depending on form of URL.zEfile error: proxy support for file protocol currently not implementedNr:rrVr
�z
localhost/r�)r�r�rrxrBr�r�rLrLrM�	open_file�s

4
zURLopener.open_filec
Cs\ddl}ddl}t|�\}}t|�}zt�|�}Wn0tk
rb}zt|j|j	��W5d}~XYnX|j
}	|jj|j
dd�}
|�|�d}|�d|p�d|	|
f�}|s�|}
|dd�dkr�d	|}
tt|d
�||
�St|�\}}|�sPt�|�t�ft�k�rP|}
|dd�dk�r d	|}
n|dd�dk�r>td
|��tt|d
�||
�Std��dS)zUse local file.rNTr�z6Content-Type: %s
Content-Length: %d
Last-modified: %s
r�rVr
r�r�r:z./zAlocal file url may start with / or file:. Unknown url of type: %sz#local file error: not on local host)r�r�rr4r[r�rqr�strerrorrfr�r�r�r�r�r�rrGr
r�r�r��thishostrB)r�rHr�r�rzrOZ	localnamer��ermr�r�riZurlfilerFrLrLrMr��s@ ���
zURLopener.open_local_filec
Cs�t|t�std��ddl}t|�\}}|s2td��t|�\}}t|�\}}|r\t|�\}}nd}t|�}t|ppd�}t|p|d�}t	�
|�}|s�ddl}|j}nt
|�}t|�\}}	t|�}|�d�}
|
dd�|
d}
}|
r�|
ds�|
dd�}
|
�r
|
d�s
d|
d<|||d�|
�f}t|j�tk�rbt|j�D]*}
|
|k�r6|j|
}|j|
=|���q6z�||jk�r�t|||||
�|j|<|�s�d	}nd
}|	D]2}t|�\}}|��dk�r�|dk�r�|��}�q�|j|�||�\}}|�d
|�d}d}|�r|d|7}|dk	�r,|dk�r,|d|7}t�|�}t||d
|�WSt�k
�r�}ztd|�� t!�"�d��W5d}~XYnXdS)zUse FTP protocol.zCftp error: proxy support for ftp protocol currently not implementedrNr�rrr
rSrVr�rkr�r�zftp:zContent-Type: %s
zContent-Length: %d
zftp error %rr:)#r�r�rr�rr
rrr
r�r�r�r�rbrr[r�rdr�MAXFTPCACHEr�r�r�rrxr�r�r�r�r�r�	ftperrorsr�r�r�)r�rHr�rzr\rFr r4r�r�r�rOr�r�rr�r�r�rhr�r�rir�rLrLrM�open_ftp�st




��
zURLopener.open_ftpc	
Cs<t|t�std��z|�dd�\}}Wntk
rDtdd��YnX|sNd}|�d�}|dkr�d	||d
�kr�||dd
�}|d
|�}nd}g}|�dt�	d
t�
t�����|�d|�|dkr�t�|�
d���d�}nt|�}|�dt|��|�d�|�|�d�|�}t�|�}t�|�}t|||�S)zUse "data" URL.zEdata error: proxy support for data protocol currently not implementedr�rVz
data errorzbad data URLr�;rr�NrrzDate: %sz%a, %d %b %Y %H:%M:%S GMTzContent-type: %sr0r,zlatin-1zContent-Length: %d�
)r�r�rr[rBrq�rfindrar��strftime�gmtimer0r	r2r3r
rdr�r�r�r
�StringIOr)	r�rHrIr�Zsemirr�ri�frLrLrM�	open_data8s8

�




zURLopener.open_data)N)N)N)N)NNN)N)N)N)N)r�r�r�r�rr�rr�rr�rrrGrrr)r,r.r+r�rCr2r3r5r�r;rCrLrLrLrMr8�s.

$


A\


	 :c@s�eZdZdZdd�Zdd�Zd#dd�Zd	d
�Zd$dd�Zd%d
d�Z	d&dd�Z
d'dd�Zd(dd�Zd)dd�Z
d*dd�Zd+dd�Zd,dd�Zd-dd �Zd!d"�ZdS).r9z?Derived class with handlers for errors we can handle (perhaps).cOs(tj|f|�|�i|_d|_d|_dS)Nrr�)r8r��
auth_cache�tries�maxtriesrLrLrLrMr�eszFancyURLopener.__init__cCst||d||�S)z3Default error handling -- don't raise an exception.r*)rr1rLrLrMr�ksz!FancyURLopener.http_error_defaultNc	Csv|jd7_zZ|jrN|j|jkrNt|d�r4|j}n|j}|||dd|�W�S|�||||||�}|W�Sd|_XdS)z%Error 302 -- relocated (temporarily).rVr�http_error_500r�z)Internal Server Error: Redirect RecursionN)rErFr�rGr��redirect_internal)	r�rHrhr/r0rirIr�rkrLrLrMros 
��zFancyURLopener.http_error_302c	Csxd|kr|d}nd|kr$|d}ndS|��t|jd||�}t|�}|jdkrnt|||d|||��|�|�S)Nrrrrz( Redirection to url '%s' is not allowed.)r�rr�rrrrG)	r�rHrhr/r0rirIrrrLrLrMrH�s"


��z FancyURLopener.redirect_internalcCs|�||||||�S)z*Error 301 -- also relocated (permanently).�r�r�rHrhr/r0rirIrLrLrMr�szFancyURLopener.http_error_301cCs|�||||||�S)z;Error 303 -- also relocated (essentially identical to 302).rIrJrLrLrMr�szFancyURLopener.http_error_303cCs2|dkr|�||||||�S|�|||||�SdS)z1Error 307 -- relocated, but turn POST into error.N)rr�rJrLrLrMr�szFancyURLopener.http_error_307Fc
Cs�d|krt�||||||�|d}t�d|�}	|	sHt�||||||�|	��\}
}|
��dkrtt�||||||�|s�t�||||||�d|jd}|dkr�t||�||�St||�|||�SdS)z_Error 401 -- authentication required.
        This function supports Basic authentication only.rm�![ 	]*([^ 	]+)[ 	]+realm="([^"]*)"r^Zretry_�_basic_authN�r8r�ri�matchrYrxr�r��
r�rHrhr/r0rirIr�ZstuffrNrr<r_rLrLrMrn�s:
�
�
��zFancyURLopener.http_error_401c
Cs�d|krt�||||||�|d}t�d|�}	|	sHt�||||||�|	��\}
}|
��dkrtt�||||||�|s�t�||||||�d|jd}|dkr�t||�||�St||�|||�SdS)zeError 407 -- proxy authentication required.
        This function supports Basic authentication only.rprKr^Zretry_proxy_rLNrMrOrLrLrMrq�s:
�
�
��zFancyURLopener.http_error_407cCs�t|�\}}d||}|jd}t|�\}}	t|	�\}	}
|	�d�d}|	|d�}	|�|	||�\}}
|sr|
srdSdt|dd�t|
dd�|	f}	d|	|
|jd<|dkr�|�|�S|�||�SdS)N�http://r�rrV�%s:%s@%srrr�rr)rr��get_user_passwdr	rG�r�rHr<rIrzr�rrr r!Z
proxyselectorr�r r4rLrLrM�retry_proxy_http_basic_auth�s$

�
z*FancyURLopener.retry_proxy_http_basic_authcCs�t|�\}}d||}|jd}t|�\}}	t|	�\}	}
|	�d�d}|	|d�}	|�|	||�\}}
|sr|
srdSdt|dd�t|
dd�|	f}	d|	|
|jd<|dkr�|�|�S|�||�SdS)N�https://r�rrVrQrrrrRrTrLrLrM�retry_proxy_https_basic_auth�s$

�
z+FancyURLopener.retry_proxy_https_basic_authc
Cs�t|�\}}|�d�d}||d�}|�|||�\}}|sD|sDdSdt|dd�t|dd�|f}d||}	|dkr�|�|	�S|�|	|�SdS)NrrVrQrrrrP�rr�rSr	rG�
r�rHr<rIrzr�r�r r4rrLrLrMr_	s
�
z$FancyURLopener.retry_http_basic_authc
Cs�t|�\}}|�d�d}||d�}|�|||�\}}|sD|sDdSdt|dd�t|dd�|f}d||}	|dkr�|�|	�S|�|	|�SdS)NrrVrQrrrrVrXrYrLrLrM�retry_https_basic_auth	s
�
z%FancyURLopener.retry_https_basic_authrcCs`|d|��}||jkr2|r(|j|=n
|j|S|�||�\}}|sJ|rX||f|j|<||fS)Nr)rxrD�prompt_user_passwd)r�rzr<rr�r r4rLrLrMrS	s


zFancyURLopener.get_user_passwdcCsXddl}z.td||f�}|�d|||f�}||fWStk
rRt�YdSXdS)z#Override this in a GUI environment!rNzEnter username for %s at %s: z#Enter password for %s in %s at %s: r?)�getpass�input�KeyboardInterrupt�print)r�rzr<r\r r4rLrLrMr[)	s�
z!FancyURLopener.prompt_user_passwd)N)N)N)N)NF)NF)N)N)N)N)r)r�r�r�r�r�r�rrHrrrrnrqrUrWr_rZrSr[rLrLrLrMr9bs(



�
�





cCstdkrt�d�atS)z8Return the IP address of the magic hostname 'localhost'.Nr�)�
_localhostr�r�rLrLrLrMr�9	s
r�cCsPtdkrLztt�t���d�aWn(tjk
rJtt�d�d�aYnXtS)z,Return the IP addresses of the current host.Nr:r�)�	_thishostr;r�r�r�r�rLrLrLrMr7A	sr7cCstdkrddl}|jatS)z1Return the set of errors raised by the FTP class.Nr)�
_ftperrorsr�r�)r�rLrLrMr:L	sr:cCstdkrt�d�atS)z%Return an empty email Message object.Nrr)�
_noheadersr�r�rLrLrLrM�	noheadersU	s
rdc@sJeZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dS)r�z;Class used by open_ftp() for cache of open FTP connections.NTcCsX||_||_||_||_||_||_d|_||_z|��Wn|�	��YnXdSrr)
r r4rzrFr�rJ�refcount�	keepalive�initr�)r�r r4rzrFr�rJr�rLrLrMr�b	szftpwrapper.__init__cCs\ddl}d|_|��|_|j�|j|j|j�|j�|j	|j
�d�|j�}|j�
|�dS)Nrr
)r��busyZFTPr	ZconnectrzrFrJZloginr r4r�r��cwd)r�r�Z_targetrLrLrMrgr	s
zftpwrapper.initc
Cs�ddl}|��|dkr"d}d}nd|}d}z|j�|�Wn*|jk
rh|��|j�|�YnXd}|r�|s�zd|}|j�|�\}}WnR|jk
r�}z2t|�dd�dkr�t	d	|��
t��d
��W5d}~XYnX|�s�|j�d�|�rl|j�
�}	zJz|j�|�Wn4|jk
�rN}zt	d	|�|�W5d}~XYnXW5|j�|	�Xd|}nd}|j�|�\}}d|_t|�d
�|j�}
|jd7_|��|
|fS)Nr)r�r�zTYPE ArVzTYPE zRETR rVZ550r�r:zLIST ZLISTr�)r��endtransferr	Zvoidcmdr�rgZntransfercmdZ
error_permr�rr�r�r��pwdrirhrZmakefile�
file_closerer�)r�rOr�r��cmd�isdirrr�r�rkZftpobjrLrLrMr�{	sP
�
$
zftpwrapper.retrfilecCs
d|_dSrr)rhr�rLrLrMrj�	szftpwrapper.endtransfercCsd|_|jdkr|��dS)NFr)rfre�
real_closer�rLrLrMr��	s
zftpwrapper.closecCs2|��|jd8_|jdkr.|js.|��dS)NrVr)rjrerfror�rLrLrMrl�	szftpwrapper.file_closecCs2|��z|j��Wnt�k
r,YnXdSrN)rjr	r�r:r�rLrLrMro�	s
zftpwrapper.real_close)NT)r�r�r�r�r�rgr�rjr�rlrorLrLrLrMr�_	s�
	-r�cCs�i}tj��D]4\}}|��}|r|dd�dkr|||dd�<qdtjkrZ|�dd�tj��D]J\}}|dd�dkrd|��}|r�|||dd�<qd|�|dd�d�qd|S)aReturn a dictionary of scheme -> proxy server URL mappings.

    Scan the environment for variables named <scheme>_proxy;
    this seems to be the standard convention.  If you need a
    different way, you can pass a proxies dictionary to the
    [Fancy]URLopener constructor.

    i����N�_proxyZREQUEST_METHODr�)r[�environrrxr�)r)r_r�rLrLrM�getproxies_environment�	s	
rrcCs�|dkrt�}z|d}Wntk
r0YdSX|dkr>dS|��}t|�\}}|�d�D]Z}|��}|r\|�d�}|��}||ks�||kr�dSd|}|�|�s�|�|�r\dSq\dS)z�Test if proxies should not be used for a particular host.

    Checks the proxy dict for the value of no_proxy, which should
    be a list of comma separated DNS suffixes, or '*' for all hosts.

    NZnoF�*Tr��.)rrr�rxr
r[rg�lstripr)rzr)Zno_proxy�hostonlyrFr_rLrLrM�proxy_bypass_environment�	s*
rwc	Cs0ddlm}t|�\}}dd�}d|kr4|dr4dSd}|�d	d
�D]�}|sNqDt�d|�}|dk	�r|dkr�zt�|�}||�}Wntk
r�YqDYnX||�d��}	|�d
�}
|
dkr�d|�d��	d�d}
nt
|
dd��}
|
dksD|
dkr�qDd|
}
||
?|	|
?k�r*dSqD|||�rDdSqDdS)aj
    Return True iff this host shouldn't be accessed using a proxy

    This function uses the MacOSX framework SystemConfiguration
    to fetch the proxy information.

    proxy_settings come from _scproxy._get_proxy_settings or get mocked ie:
    { 'exclude_simple': bool,
      'exceptions': ['foo.bar', '*.bar.com', '127.0.0.1', '10.1', '10.0/16']
    }
    r)�fnmatchcSsh|�d�}ttt|��}t|�dkr<|ddddgdd�}|dd>|dd>B|dd>B|d	BS)
Nrtr�r�rVr�r:rrV)r[r�r�rbrd)ZipAddrrErLrLrM�ip2num
s

z,_proxy_bypass_macosx_sysconf.<locals>.ip2numrtZexclude_simpleTN�
exceptionsrLz(\d+(?:\.\d+)*)(/\d+)?rVr:r� F)rxr
r�rirNr�r�rq�group�countrb)rz�proxy_settingsrxrvrFrzZhostIPr�rrG�maskrLrLrM�_proxy_bypass_macosx_sysconf
s>




r��darwin)�_get_proxy_settings�_get_proxiescCst�}t||�SrN)r�r�)rzrrLrLrM�proxy_bypass_macosx_sysconfF
sr�cCst�S)z�Return a dictionary of scheme -> proxy server URL mappings.

        This function uses the MacOSX framework SystemConfiguration
        to fetch the proxy information.
        )r�rLrLrLrM�getproxies_macosx_sysconfJ
sr�cCs t�}|rt||�St|�SdS)z�Return True, if host should be bypassed.

        Checks proxy settings gathered from the environment, if specified,
        or from the MacOSX framework SystemConfiguration.

        N)rrrwr��rzr)rLrLrMr/T
s
r/cCst�p
t�SrN)rrr�rLrLrLrMr5a
sc
Csi}zddl}Wntk
r(|YSXz�|�|jd�}|�|d�d}|r�t|�|d�d�}d|kr�|�d�D]4}|�dd�\}}t�d	|�s�d
||f}|||<qtn>|dd�dkr�||d
<n$d||d
<d||d<d||d<|�	�Wnt
ttfk
�rYnX|S)zxReturn a dictionary of scheme -> proxy server URL mappings.

        Win32 uses the registry to store proxies.

        rN�;Software\Microsoft\Windows\CurrentVersion\Internet Settings�ProxyEnableZProxyServerr�r<rVz
(?:[^/:]+)://z%s://%srwr*r�z	http://%sz
https://%sr�zftp://%sr	)
�winreg�ImportError�OpenKey�HKEY_CURRENT_USER�QueryValueExr�r[rirNZCloserqrBr�)r)r��internetSettings�proxyEnableZproxyServer�pr�ZaddressrLrLrM�getproxies_registryf
sF
�����
r�cCst�p
t�S)z�Return a dictionary of scheme -> proxy server URL mappings.

        Returns settings gathered from the environment, if specified,
        or the registry.

        )rrr�rLrLrLrMr5�
scCs|zddl}Wntk
r"YdSXz6|�|jd�}|�|d�d}t|�|d�d�}Wntk
rpYdSX|rz|s~dSt|�\}}|g}z t�	|�}||kr�|�
|�Wntk
r�YnXz t�|�}||kr�|�
|�Wntk
�r�YnX|�d�}|D]j}	|	dk�r*d|k�r*dS|	�
dd	�}	|	�
d
d�}	|	�
dd�}	|D] }
t�|	|
tj��rRdS�qR�qdS)
Nrr�r�Z
ProxyOverrider<z<local>rtrVz\.rsz.*�?)r�r�r�r�r�r�rqr
r�r�raZgetfqdnr[rrirNrk)rzr�r�r�Z
proxyOverrideZrawHostrFZaddrZfqdnrHr�rLrLrM�proxy_bypass_registry�
s`�����





r�cCs t�}|rt||�St|�SdS)z�Return True, if host should be bypassed.

        Checks proxy settings gathered from the environment, if specified,
        or the registry.

        N)rrrwr�r�rLrLrMr/�
s
)NNN)N)~r�r0r�r�r�Zhttp.clientr�r
r[�	posixpathrir�rr�r�r^rXr?Zurllib.errorrrrZurllib.parserrrrr	r
rrr
rrrrrrrrrZurllib.responserrrDr�rC�__all__�version_infor�rFr�r0r1r`r6r7rj�ASCIIrvr{rrr2rr/rrr"rr r!r"r#r$r%�urandomr�r&r'r(r�r)r�r�rErarr.ryr{r*r�r+r,r-r9r_Z
nturl2pathr4r3rr8r9r`r�rar7rbr:rcrdr�rrrwr��platformZ_scproxyr�r�r�r�r/r5r�r�rLrLrLrM�<module>s SP
��U
?m$q!+@
ov

+3:5!@W

_
%A

-	2
urllib/__pycache__/request.cpython-38.opt-2.pyc000064400000165443151153537540015353 0ustar00U

e5d���!@s�ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlmZmZmZddlmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'ddl(m)Z)m*Z*zddl+Z+Wne,k
�rdZ-YnXdZ-ddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'g!Z.d(ej/dd)�Z0da1de
j2fddddd*�d+d�Z3d,d�Z4gZ5d}d-d$�Z6d.d%�Z7e	�8d/e	j9�Z:d0d1�Z;Gd2d�d�Z<Gd3d�d�Z=d4d �Z>Gd5d	�d	�Z?Gd6d�de?�Z@Gd7d
�d
e?�ZAGd8d�de?�ZBd9d:�ZCGd;d
�d
e?�ZDGd<d�d�ZEGd=d�deE�ZFGd>d�deF�ZGGd?d�d�ZHGd@d�deHe?�ZIGdAd�deHe?�ZJejKZLGdBd�d�ZMGdCd�de?eM�ZNGdDd�de?eM�ZOGdEdF�dFe?�ZPGdGd�deP�ZQeRejSdH��r&GdIdJ�dJeP�ZTe.�UdJ�GdKd�de?�ZVGdLd�de?�ZWdMdN�ZXdOdP�ZYGdQd�de?�ZZdRdS�Z[GdTd�de?�Z\GdUd�de\�Z]GdVd�de?�Z^dWZ_ej`dXk�r�ddYlambZbmcZcndZd"�Zbd[d!�ZciZdGd\d&�d&�ZeGd]d'�d'ee�Zfdagd^d_�Zhdaid`da�Zjdakdbdc�Zldamddde�ZnGdfdg�dg�Zodhdi�Zpd~djdk�Zqdldm�Zrejsdnk�r�ddoltmuZumvZvdpdq�Zwdrds�Zxdtdu�Zydvd#�Zzn6ej`dXk�r�dwdx�Z{dyd#�Zzdzd{�Z|d|du�ZynepZzeqZydS)�N)�URLError�	HTTPError�ContentTooShortError)�urlparse�urlsplit�urljoin�unwrap�quote�unquote�
_splittype�
_splithost�
_splitport�
_splituser�_splitpasswd�
_splitattr�_splitquery�_splitvalue�	_splittag�	_to_bytes�unquote_to_bytes�
urlunparse)�
addinfourl�addclosehookFT�Request�OpenerDirector�BaseHandler�HTTPDefaultErrorHandler�HTTPRedirectHandler�HTTPCookieProcessor�ProxyHandler�HTTPPasswordMgr�HTTPPasswordMgrWithDefaultRealm�HTTPPasswordMgrWithPriorAuth�AbstractBasicAuthHandler�HTTPBasicAuthHandler�ProxyBasicAuthHandler�AbstractDigestAuthHandler�HTTPDigestAuthHandler�ProxyDigestAuthHandler�HTTPHandler�FileHandler�
FTPHandler�CacheFTPHandler�DataHandler�UnknownHandler�HTTPErrorProcessor�urlopen�install_opener�build_opener�pathname2url�url2pathname�
getproxies�urlretrieve�
urlcleanup�	URLopener�FancyURLopenerz%d.%d�)�cafile�capath�	cadefault�contextc
Cs�|s|s|rfddl}|�dtd�|dk	r2td��ts>td��tjtjj||d�}t	|d�}t
|�}	n0|r~t	|d�}t
|�}	ntdkr�t
�a}	nt}	|	�|||�S)NrzJcafile, capath and cadefault are deprecated, use a custom context instead.r:zDYou can't pass both context and any of cafile, capath, and cadefaultzSSL support not available)r;r<)r>)
�warnings�warn�DeprecationWarning�
ValueError�	_have_ssl�sslZcreate_default_contextZPurposeZSERVER_AUTH�HTTPSHandlerr2�_opener�open)
�url�data�timeoutr;r<r=r>r?Z
https_handler�opener�rL�&/usr/lib64/python3.8/urllib/request.pyr0�s2<��
�



cCs|adS�N)rF)rKrLrLrMr1�sc
Cs:t|�\}}t�t||����}|��}|dkrN|sNtj�|�|fW5QR�S|r^t|d�}nt	j
dd�}|j}t�
|�|��||f}	d}
d}d}d}
d|kr�t|d	�}|r�||
|
|�|�|
�}|s�q�|t|�7}|�|�|
d
7}
|r�||
|
|�q�W5QRXW5QRX|dk�r6||k�r6td||f|	��|	S)N�file�wbF)�delete� ���r�content-length�Content-Length��1retrieval incomplete: got only %i out of %i bytes)r�
contextlib�closingr0�info�os�path�normpathrG�tempfileZNamedTemporaryFile�name�_url_tempfiles�append�int�read�len�writer)rH�filename�
reporthookrIZurl_typer\�fp�headers�tfp�result�bs�sizerc�blocknum�blockrLrLrMr6�sH


"��c	CsDtD](}zt�|�Wqtk
r*YqXqtdd�=tr@dadSrN)r`r[�unlink�OSErrorrF)Z	temp_filerLrLrMr7$s
z:\d+$cCs<|j}t|�d}|dkr&|�dd�}t�d|d�}|��S)NrV��Host)�full_urlr�
get_header�_cut_port_re�sub�lower)�requestrH�hostrLrLrM�request_host3sr{c@s�eZdZdidddfdd�Zedd��Zejdd��Zejdd��Zed	d
��Zejdd
��Zejdd
��Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd#dd�Zdd �Zd!d"�ZdS)$rNFc	Csl||_i|_i|_d|_||_d|_|��D]\}}|�||�q,|dkrRt|�}||_	||_
|rh||_dSrN)rtri�unredirected_hdrs�_datarI�_tunnel_host�items�
add_headerr{�origin_req_host�unverifiable�method)	�selfrHrIrir�r�r��key�valuerLrLrM�__init__EszRequest.__init__cCs|jrd�|j|j�S|jS)Nz{}#{})�fragment�format�	_full_url�r�rLrLrMrtWszRequest.full_urlcCs(t|�|_t|j�\|_|_|��dSrN)rr�rr��_parse�r�rHrLrLrMrt]s
cCsd|_d|_d|_dS�Nrr)r�r��selectorr�rLrLrMrtdscCs|jSrN)r}r�rLrLrMrIjszRequest.datacCs(||jkr$||_|�d�r$|�d�dS)N�Content-length)r}�
has_header�
remove_header)r�rIrLrLrMrIns

cCs
d|_dSrN)rIr�rLrLrMrIxscCsNt|j�\|_}|jdkr(td|j��t|�\|_|_|jrJt|j�|_dS)Nzunknown url type: %r)	rr��typerBrtrrzr�r
)r��restrLrLrMr�|s
zRequest._parsecCs|jdk	rdnd}t|d|�S)N�POST�GETr�)rI�getattr)r�Zdefault_methodrLrLrM�
get_method�szRequest.get_methodcCs|jSrN)rtr�rLrLrM�get_full_url�szRequest.get_full_urlcCs2|jdkr|js|j|_n||_|j|_||_dS)N�https)r�r~rzrtr�)r�rzr�rLrLrM�	set_proxy�s

zRequest.set_proxycCs|j|jkSrN)r�rtr�rLrLrM�	has_proxy�szRequest.has_proxycCs||j|��<dSrN)ri�
capitalize�r�r��valrLrLrMr��szRequest.add_headercCs||j|��<dSrN)r|r�r�rLrLrM�add_unredirected_header�szRequest.add_unredirected_headercCs||jkp||jkSrN)rir|�r��header_namerLrLrMr��s
�zRequest.has_headercCs|j�||j�||��SrN)ri�getr|)r�r��defaultrLrLrMru�s�zRequest.get_headercCs |j�|d�|j�|d�dSrN)ri�popr|r�rLrLrMr��szRequest.remove_headercCs|j|j�}t|���SrN)r|ri�listr)r��hdrsrLrLrM�header_items�szRequest.header_items)N)�__name__�
__module__�__qualname__r��propertyrt�setter�deleterrIr�r�r�r�r�r�r�r�rur�r�rLrLrLrMrCs8�





	

c@sNeZdZdd�Zdd�Zdd�Zdd�Zd	ejfd
d�Z	ddd
�Z
dd�Zd	S)rcCs6dt}d|fg|_g|_i|_i|_i|_i|_dS)N�Python-urllib/%sz
User-agent)�__version__�
addheaders�handlers�handle_open�handle_error�process_response�process_request)r�Zclient_versionrLrLrMr��szOpenerDirector.__init__c	CsTt|d�stdt|���d}t|�D�]}|dkr6q&|�d�}|d|�}||dd�}|�d�r�|�d�|d}||dd�}zt|�}Wntk
r�YnX|j�	|i�}	|	|j|<n>|dkr�|}|j
}	n*|d	kr�|}|j}	n|d
kr&|}|j}	nq&|	�
|g�}
|
�r"t�|
|�n
|
�|�d}q&|�rPt�|j|�|�|�dS)N�
add_parentz%expected BaseHandler instance, got %rF)�redirect_request�do_open�
proxy_open�_rV�errorrG�responseryT)�hasattr�	TypeErrorr��dir�find�
startswithrbrBr�r�r�r�r��
setdefault�bisectZinsortrar�r�)r��handlerZadded�meth�i�protocolZ	condition�j�kind�lookupr�rLrLrM�add_handler�sL
�


zOpenerDirector.add_handlercCsdSrNrLr�rLrLrM�close�szOpenerDirector.closec	Gs<|�|d�}|D]&}t||�}||�}|dk	r|SqdS)NrL)r�r�)	r��chainr��	meth_name�argsr�r��funcrkrLrLrM�_call_chain�s
zOpenerDirector._call_chainNc
Cs�t|t�rt||�}n|}|dk	r(||_||_|j}|d}|j�|g�D]}t||�}||�}qJt	�
d|j|j|j|�
��|�||�}	|d}|j�|g�D]}t||�}|||	�}	q�|	S)NZ_requestzurllib.RequestZ	_response)�
isinstance�strrrIrJr�r�r�r��sys�auditrtrir��_openr�)
r��fullurlrIrJ�reqr�r�Z	processorr�r�rLrLrMrG�s$



zOpenerDirector.opencCsP|�|jdd|�}|r|S|j}|�|j||d|�}|r>|S|�|jdd|�S)Nr�Zdefault_openr��unknown�unknown_open)r�r�r�)r�r�rIrkr�rLrLrMr�s$
���
�zOpenerDirector._opencGs~|dkr,|jd}|d}d|}d}|}n|j}|d}d}|||f|}|j|�}|r^|S|rz|dd	f|}|j|�SdS)
N��httpr�r�r:z
http_error_%srVZ_errorrr��http_error_default)r�r�)r��protor��dictr�Zhttp_errZ	orig_argsrkrLrLrMr�&s 

zOpenerDirector.error)N)r�r�r�r�r�r�r��socket�_GLOBAL_DEFAULT_TIMEOUTrGr�r�rLrLrLrMr�s/
c	Gs�t�}ttttttttt	g	}t
tjd�r2|�
t�t�}|D]B}|D]8}t|t�rht||�r||�|�qDt||�rD|�|�qDq<|D]}|�|�q�|D]}|�|��q�|D]}t|t�r�|�}|�|�q�|S)N�HTTPSConnection)rrr.r)rrr+r*r/r-r�r��clientrarE�setr�r��
issubclass�add�remover�)r�rKZdefault_classes�skip�klassZcheck�hrLrLrMr2?s8	�




c@s(eZdZdZdd�Zdd�Zdd�ZdS)	r��cCs
||_dSrN)�parent)r�r�rLrLrMr�fszBaseHandler.add_parentcCsdSrNrLr�rLrLrMr�iszBaseHandler.closecCst|d�sdS|j|jkS)N�
handler_orderT)r�r�)r��otherrLrLrM�__lt__ms
zBaseHandler.__lt__N)r�r�r�r�r�r�r�rLrLrLrMrcsc@seZdZdZdd�ZeZdS)r/i�cCsH|j|j|��}}}d|kr,dksDn|j�d|||||�}|S)N���,r�)�code�msgrZr�r�)r�ryr�r�r�r�rLrLrM�
http_responsezs�z HTTPErrorProcessor.http_responseN)r�r�r�r�r��https_responserLrLrLrMr/vsc@seZdZdd�ZdS)rcCst|j||||��dSrN)rrt)r�r�rhr�r�r�rLrLrMr��sz*HTTPDefaultErrorHandler.http_error_defaultN)r�r�r�r�rLrLrLrMr�sc@s4eZdZdZdZdd�Zdd�ZeZZZ	dZ
dS)	r��
c	st|��}|dkr|dks:|dkr(|dks:t|j||||��|�dd�}d��fdd	�|j��D�}t|||jd
d�S)N)�-�.�/i3)r�ZHEAD)r�r�r�r�� z%20)rTzcontent-typecs"i|]\}}|���kr||�qSrL)rx��.0�k�v�ZCONTENT_HEADERSrLrM�
<dictcomp>�s�z8HTTPRedirectHandler.redirect_request.<locals>.<dictcomp>T)rir�r�)r�rrt�replacerirrr�)	r�r�rhr�r�ri�newurl�mZ
newheadersrLrrMr��s
���z$HTTPRedirectHandler.redirect_requestc
CsLd|kr|d}nd|kr$|d}ndSt|�}|jdkrRt||d||f||��|jsn|jrnt|�}d|d<t|�}t|dtj	d�}t
|j|�}|�||||||�}|dkr�dSt
|d	��r|j}	|_|	�|d
�|jks�t|	�|jk�rt|j||j|||��ni}	|_|_|	�|d
�d|	|<|��|��|jj||jd�S)
N�location�uri�r�r��ftprrz+%s - Redirection to url '%s' is not allowed�/r:z
iso-8859-1)�encoding�safe�
redirect_dictrrV�rJ)r�schemerr\Znetlocr�rr	�stringZpunctuationrrtr�r�r
r��max_repeatsrd�max_redirections�inf_msgrcr�r�rGrJ)
r�r�rhr�r�rir�urlparts�newZvisitedrLrLrM�http_error_302�sT



����z"HTTPRedirectHandler.http_error_302zoThe HTTP server returned a redirect error that would lead to an infinite loop.
The last 30x error message was:
N)r�r�r�rrr�r�http_error_301�http_error_303�http_error_307rrLrLrLrMr�s&<c
Cs�t|�\}}|�d�s d}|}nZ|�d�s6td|��d|krV|�d�}|�d|�}n|�dd�}|dkrnd}|d|�}t|�\}}|dk	r�t|�\}}	nd}}	|||	|fS)Nr
�//zproxy URL with no authority: %r�@r:rS)rr�rBr�rr)
�proxyrZr_scheme�	authorityZhost_separator�endZuserinfo�hostport�user�passwordrLrLrM�_parse_proxy�s$


r"c@s"eZdZdZddd�Zdd�ZdS)r�dNcCsP|dkrt�}||_|��D].\}}|��}t|d||||jfdd��qdS)Nz%s_opencSs||||�SrNrL)�rrr�r�rLrLrM�<lambda>)sz'ProxyHandler.__init__.<locals>.<lambda>)r5�proxiesrrx�setattrr�)r�r&r�rHrLrLrMr�!s
�zProxyHandler.__init__cCs�|j}t|�\}}}}|dkr"|}|jr6t|j�r6dS|rv|rvdt|�t|�f}	t�|	����d�}
|�	dd|
�t|�}|�
||�||ks�|dkr�dS|jj||j
d�SdS)N�%s:%s�ascii�Proxy-authorization�Basic r�r)r�r"rz�proxy_bypassr
�base64�	b64encode�encode�decoder�r�r�rGrJ)r�r�rr�Z	orig_typeZ
proxy_typer r!rZ	user_passZcredsrLrLrMr�,s"�zProxyHandler.proxy_open)N)r�r�r�r�r�r�rLrLrLrMrs
c@s6eZdZdd�Zdd�Zdd�Zd
dd	�Zd
d�ZdS)r cCs
i|_dSrN)�passwdr�rLrLrMr�JszHTTPPasswordMgr.__init__cs\t|t�r|g}|�jkr$i�j|<dD].�t��fdd�|D��}||f�j||<q(dS)N�TFc3s|]}��|��VqdSrN)�
reduce_uri)r��u��default_portr�rLrM�	<genexpr>Tsz/HTTPPasswordMgr.add_password.<locals>.<genexpr>)r�r�r1�tuple)r��realmrr r1�reduced_urirLr5rM�add_passwordMs


�zHTTPPasswordMgr.add_passwordc	Cs`|j�|i�}dD]H}|�||�}|��D].\}}|D] }|�||�r6|Sq6q*qdS)Nr2�NN)r1r�r3r�	is_suburi)	r�r9�authuriZdomainsr6�reduced_authuriZurisZauthinforrLrLrM�find_user_passwordXsz"HTTPPasswordMgr.find_user_passwordTc
Cs�t|�}|dr.|d}|d}|dp*d}nd}|}d}t|�\}}|r~|dkr~|dk	r~ddd��|�}	|	dk	r~d||	f}||fS)	NrVrr:r
�Pi�r�z%s:%d)rr
r�)
r�rr6�partsrrr\rz�portZdportrLrLrMr3bs$��zHTTPPasswordMgr.reduce_uricCsN||krdS|d|dkr dS|d}|dd�dkr@|d7}|d�|�S)NTrFrVrSr
)r�)r��base�test�prefixrLrLrMr=yszHTTPPasswordMgr.is_suburiN)T)r�r�r�r�r;r@r3r=rLrLrLrMr Hs


c@seZdZdd�ZdS)r!cCs0t�|||�\}}|dk	r"||fSt�|d|�SrN)r r@)r�r9r>r r!rLrLrMr@�s�z2HTTPPasswordMgrWithDefaultRealm.find_user_passwordN)r�r�r�r@rLrLrLrMr!�scs<eZdZ�fdd�Zd
�fdd�	Zddd�Zdd	�Z�ZS)r"csi|_t�j||�dSrN)�
authenticated�superr��r�r��kwargs��	__class__rLrMr��sz%HTTPPasswordMgrWithPriorAuth.__init__Fcs<|�||�|dk	r&t��d|||�t��||||�dSrN)�update_authenticatedrHr;)r�r9rr r1�is_authenticatedrKrLrMr;�sz)HTTPPasswordMgrWithPriorAuth.add_passwordcCs>t|t�r|g}dD]$}|D]}|�||�}||j|<qqdS�Nr2)r�r�r3rG)r�rrNr6r4r:rLrLrMrM�s
z1HTTPPasswordMgrWithPriorAuth.update_authenticatedcCsDdD]:}|�||�}|jD]"}|�||�r|j|SqqdSrO)r3rGr=)r�r>r6r?rrLrLrMrN�s

z-HTTPPasswordMgrWithPriorAuth.is_authenticated)F)F)r�r�r�r�r;rMrN�
__classcell__rLrLrKrMr"�s

c@sTeZdZe�dej�Zddd�Zdd�Zdd�Z	d	d
�Z
dd�Zd
d�ZeZ
eZdS)r#z1(?:^|,)[ 	]*([^ 	,]+)[ 	]+realm=(["']?)([^"']*)\2NcCs"|dkrt�}||_|jj|_dSrN)r r1r;)r�Zpassword_mgrrLrLrMr��sz!AbstractBasicAuthHandler.__init__ccspd}tj�|�D]6}|��\}}}|dkr8t�dtd�||fVd}q|sl|r^|��d}nd}|dfVdS)NF)�"�'zBasic Auth Realm was unquoted�Trrr)r#�rx�finditer�groupsr?r@�UserWarning�split)r��headerZfound_challengeZmorr	r9rLrLrM�_parse_realm�s�
z%AbstractBasicAuthHandler._parse_realmc	Cs~|�|�}|sdSd}|D]H}|�|�D]8\}}|��dkrB|}q(|dk	r(|�|||�Sq(q|dk	rztd|f��dS)N�basiczBAbstractBasicAuthHandler does not support the following scheme: %r)Zget_allrZrx�retry_http_basic_authrB)	r��authreqrzr�riZunsupportedrYrr9rLrLrM�http_error_auth_reqed�s
�z.AbstractBasicAuthHandler.http_error_auth_reqedcCs||j�||�\}}|dk	rtd||f}dt�|����d�}|�|jd�|krTdS|�|j|�|j	j
||jd�SdSdS)Nr(r+r)r)r1r@r-r.r/r0ru�auth_headerr�r�rGrJ)r�rzr�r9r �pw�raw�authrLrLrMr\�sz.AbstractBasicAuthHandler.retry_http_basic_authcCstt|jd�r|j�|j�s|S|�d�sp|j�d|j�\}}d�||���}t�	|��
�}|�dd�|����|S)NrN�
Authorizationz{0}:{1}zBasic {})
r�r1rNrtr�r@r�r/r-Zstandard_b64encoder0r��strip)r�r�r r1ZcredentialsZauth_strrLrLrM�http_requests�
�z%AbstractBasicAuthHandler.http_requestcCsLt|jd�rHd|jkr"dkr8nn|j�|jd�n|j�|jd�|S)NrNr�r�TF)r�r1r�rMrt)r�r�r�rLrLrMr�s
z&AbstractBasicAuthHandler.http_response)N)r�r�r��re�compile�IrTr�rZr^r\rer��
https_requestr�rLrLrLrMr#�s�

c@seZdZdZdd�ZdS)r$rccCs|j}|�d|||�}|S)N�www-authenticate)rtr^)r�r�rhr�r�rirHr�rLrLrM�http_error_401$s�z#HTTPBasicAuthHandler.http_error_401N)r�r�r�r_rkrLrLrLrMr$ sc@seZdZdZdd�ZdS)r%r*cCs|j}|�d|||�}|S�N�proxy-authenticate)rzr^)r�r�rhr�r�rirr�rLrLrM�http_error_407/s�z$ProxyBasicAuthHandler.http_error_407N)r�r�r�r_rnrLrLrLrMr%+sc@sNeZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dS)r&NcCs4|dkrt�}||_|jj|_d|_d|_d|_dS�Nr)r r1r;�retried�nonce_count�
last_nonce)r�r1rLrLrMr�Is
z"AbstractDigestAuthHandler.__init__cCs
d|_dSro)rpr�rLrLrM�reset_retry_countRsz+AbstractDigestAuthHandler.reset_retry_countcCs||�|d�}|jdkr*t|jdd|d��n|jd7_|rx|��d}|��dkr`|�||�S|��dkrxtd|��dS)	N�i�zdigest auth failedrVrZdigestr[zEAbstractDigestAuthHandler does not support the following scheme: '%s')r�rprrtrXrx�retry_http_digest_authrB)r�r_rzr�rir]rrLrLrMr^Us

��z/AbstractDigestAuthHandler.http_error_auth_reqedcCsz|�dd�\}}ttdt|���}|�||�}|rvd|}|j�|jd�|krRdS|�|j|�|j	j
||jd�}|SdS)Nr�rVz	Digest %sr)rX�parse_keqv_list�filter�parse_http_list�get_authorizationrir�r_r�r�rGrJ)r�r�rb�tokenZ	challenge�chalZauth_valZresprLrLrMruisz0AbstractDigestAuthHandler.retry_http_digest_authcCs@d|j|t��f}|�d�td�}t�|���}|dd�S)Nz	%s:%s:%s:r)��)rq�time�ctimer/�_randombytes�hashlib�sha1�	hexdigest)r��nonce�s�b�digrLrLrM�
get_cnonceusz$AbstractDigestAuthHandler.get_cnoncecCs�z6|d}|d}|�d�}|�dd�}|�dd�}Wntk
rLYdSX|�|�\}}	|dkrhdS|j�||j�\}
}|
dkr�dS|jdk	r�|�|j|�}nd}d|
||f}
d|��|j	f}|dkr�|	||
�d|||�f�}n~d	|�
d
�k�r\||jk�r|jd7_nd|_||_d|j}|�
|�}d
|||d	||�f}|	||
�|�}ntd|��d|
|||j	|f}|�r�|d|7}|�r�|d|7}|d|7}|�r�|d||f7}|S)Nr9r��qop�	algorithm�MD5�opaquez%s:%s:%sr(rb�,rVz%08xz%s:%s:%s:%s:%szqop '%s' is not supported.z>username="%s", realm="%s", nonce="%s", uri="%s", response="%s"z
, opaque="%s"z
, digest="%s"z, algorithm="%s"z, qop=auth, nc=%s, cnonce="%s")r��KeyError�get_algorithm_implsr1r@rtrI�get_entity_digestr�r�rXrrrqr�r)r�r�r{r9r�r�r�r��H�KDr r`ZentdigZA1ZA2ZrespdigZncvalueZcnonceZnoncebitrDrLrLrMry�s\

�


��z+AbstractDigestAuthHandler.get_authorizationcsD|dkrdd��n|dkr$dd��ntd|���fdd�}�|fS)Nr�cSst�|�d����S�Nr))r�Zmd5r/r���xrLrLrMr%��z?AbstractDigestAuthHandler.get_algorithm_impls.<locals>.<lambda>ZSHAcSst�|�d����Sr�)r�r�r/r�r�rLrLrMr%�r�z.Unsupported digest authentication algorithm %rcs�d||f�S)Nr(rL)r��d�r�rLrMr%�r�)rB)r�r�r�rLr�rMr��s

�z-AbstractDigestAuthHandler.get_algorithm_implscCsdSrNrL)r�rIr{rLrLrMr��sz+AbstractDigestAuthHandler.get_entity_digest)N)r�r�r�r�rsr^rur�ryr�r�rLrLrLrMr&>s
	>
c@seZdZdZdZdd�ZdS)r'rc��cCs*t|j�d}|�d|||�}|��|S)NrVrj)rrtr^rs�r�r�rhr�r�rirz�retryrLrLrMrk�s�z$HTTPDigestAuthHandler.http_error_401N)r�r�r�r_r�rkrLrLrLrMr'�sc@seZdZdZdZdd�ZdS)r(�Proxy-Authorizationr�cCs"|j}|�d|||�}|��|Srl)rzr^rsr�rLrLrMrn�s�z%ProxyDigestAuthHandler.http_error_407N)r�r�r�r_r�rnrLrLrLrMr(�sc@s6eZdZd
dd�Zdd�Zdd�Zdd	�Zd
d�ZdS)�AbstractHTTPHandlerrcCs
||_dSrN��_debuglevel)r��
debuglevelrLrLrMr��szAbstractHTTPHandler.__init__cCs
||_dSrNr�)r��levelrLrLrM�set_http_debuglevel�sz'AbstractHTTPHandler.set_http_debuglevelcCstjj�|j|���SrN)r�r��HTTPConnection�_get_content_lengthrIr��r�ryrLrLrMr��s�z'AbstractHTTPHandler._get_content_lengthcCs|j}|std��|jdk	r�|j}t|t�r8d}t|��|�d�sN|�dd�|�d�s�|�d�s�|�|�}|dk	r�|�dt|��n|�dd�|}|�	�r�t
|j�\}}t|�\}}	|�d�s�|�d|�|j
jD]&\}
}|
��}
|�|
�s�|�|
|�q�|S)	N�
no host givenz\POST data should be bytes, an iterable of bytes, or a file object. It cannot be of type str.zContent-type�!application/x-www-form-urlencodedr��Transfer-encodingZchunkedrs)rzrrIr�r�r�r�r�r�r�rr�rr�r�r�)r�ryrzrIr�Zcontent_lengthZsel_hostrZselZsel_pathr_r�rLrLrM�do_request_�sJ


�
�
��

zAbstractHTTPHandler.do_request_c

sT|j}|std��||fd|ji|��}|�|j�t|j�����fdd�|j�	�D��d�d<dd���	�D��|j
r�i}d}|�kr��|||<�|=|j|j
|d	�z`z&|j|�
�|j|j�|�d
�d�Wn,tk
�r}zt|��W5d}~XYnX|��}	Wn|���YnX|j�r>|j��d|_|��|	_|	j|	_|	S)Nr�rJcsi|]\}}|�kr||�qSrLrLr��rirLrMr/s�z/AbstractHTTPHandler.do_open.<locals>.<dictcomp>r��
ConnectioncSsi|]\}}|��|�qSrL)�title)r�r_r�rLrLrMr<sr�r�r�)Zencode_chunked)rzrrJZset_debuglevelr�r�r|�updaterirr~Z
set_tunnelryr�r�rIr�rq�getresponser�Zsockr�rH�reasonr�)
r�Z
http_classr�Zhttp_conn_argsrzr�Ztunnel_headersZproxy_auth_hdr�errr$rLr�rMr�!sB
�


zAbstractHTTPHandler.do_openN)r)r�r�r�r�r�r�r�r�rLrLrLrMr��s

&r�c@seZdZdd�ZejZdS)r)cCs|�tjj|�SrN)r�r�r�r��r�r�rLrLrM�	http_openfszHTTPHandler.http_openN)r�r�r�r�r�r�rerLrLrLrMr)dsr�c@s$eZdZddd�Zdd�ZejZdS)rErNcCst�||�||_||_dSrN)r�r��_context�_check_hostname)r�r�r>�check_hostnamerLrLrMr�oszHTTPSHandler.__init__cCs|jtjj||j|jd�S)N)r>r�)r�r�r�r�r�r�r�rLrLrM�
https_opents�zHTTPSHandler.https_open)rNN)r�r�r�r�r�r�r�rirLrLrLrMrEms
rEc@s.eZdZddd�Zdd�Zdd�ZeZeZdS)	rNcCs$ddl}|dkr|j��}||_dSro)Zhttp.cookiejar�	cookiejarZ	CookieJar)r�r�r�rLrLrMr�}s
zHTTPCookieProcessor.__init__cCs|j�|�|SrN)r�Zadd_cookie_headerr�rLrLrMre�sz HTTPCookieProcessor.http_requestcCs|j�||�|SrN)r�Zextract_cookies)r�ryr�rLrLrMr��sz!HTTPCookieProcessor.http_response)N)r�r�r�r�rer�rir�rLrLrLrMr|s

c@seZdZdd�ZdS)r.cCs|j}td|��dS)Nzunknown url type: %s)r�r)r�r�r�rLrLrMr��szUnknownHandler.unknown_openN)r�r�r�r�rLrLrLrMr.�scCsNi}|D]@}|�dd�\}}|ddkr@|ddkr@|dd�}|||<q|S)N�=rVrrQrS)rX)�lZparsedZeltr�rrLrLrMrv�s
rvcCs�g}d}d}}|D]l}|r*||7}d}q|rT|dkr>d}qn|dkrJd}||7}q|dkrl|�|�d}q|dkrxd}||7}q|r�|�|�dd�|D�S)	NrrF�\TrQr�cSsg|]}|���qSrL)rd)r��partrLrLrM�
<listcomp>�sz#parse_http_list.<locals>.<listcomp>)ra)r��resr��escaper	ZcurrLrLrMrx�s4	


rxc@s(eZdZdd�ZdZdd�Zdd�ZdS)r*cCs\|j}|dd�dkrN|dd�dkrN|jrN|jdkrN|j|��krXtd��n
|�|�SdS)Nr:rrSr
�	localhost�-file:// scheme is supported only on localhost)r�rz�	get_namesr�open_local_file)r�r�rHrLrLrM�	file_open�s&�
zFileHandler.file_openNcCs`tjdkrZz*tt�d�dt�t���d�t_Wn$tjk
rXt�d�ft_YnXtjS)Nr�r:)r*�namesr8r��gethostbyname_ex�gethostname�gaierror�
gethostbynamer�rLrLrMr��s
��
zFileHandler.get_namesc
Cs�ddl}ddl}|j}|j}t|�}z�t�|�}|j}|jj	|j
dd�}	|�|�d}
|�d|
pbd||	f�}|r~t
|�\}}|r�|s�t|�|��kr�|r�d||}
nd|}
tt|d�||
�WSWn*tk
r�}zt|��W5d}~XYnXtd��dS)	NrT�Zusegmtz6Content-type: %s
Content-length: %d
Last-modified: %s
�
text/plain�file://�rbzfile not on local host)�email.utils�	mimetypesrzr�r4r[�stat�st_size�utils�
formatdate�st_mtime�
guess_type�message_from_stringr
�_safe_gethostbynamer�rrGrqr)r�r��emailr�rzrfZ	localfile�statsrm�modified�mtyperirCZorigurl�exprLrLrMr��s:
����zFileHandler.open_local_file)r�r�r�r�r�r�r�rLrLrLrMr*�s
cCs*zt�|�WStjk
r$YdSXdSrN)r�r�r�)rzrLrLrMr��sr�c@seZdZdd�Zdd�ZdS)r+c
Cs*ddl}ddl}|j}|s"td��t|�\}}|dkr>|j}nt|�}t|�\}}|rdt|�\}}nd}t	|�}|pvd}|p~d}zt
�|�}Wn*tk
r�}zt|��W5d}~XYnXt
|j�\}	}
|	�d�}ttt	|��}|dd�|d}}|�r|d�s|dd�}z�|�||||||j�}
|�r6d�p8d}|
D]2}t|�\}}|��d	k�r>|d
k�r>|��}�q>|
�||�\}}d}|�|j�d}|�r�|d|7}|dk	�r�|dk�r�|d|7}t�|�}t|||j�WS|jk
�r$}z"td
|�}|�t� �d��W5d}~XYnXdS)Nr�ftp error: no host givenrrr
rSrVrh�Dr���a�Ar�rhr�r�zContent-type: %s
zContent-length: %d
�
ftp error: %rr:)!�ftplibr�rzrr
�FTP_PORTrbrrr
r�r�rqrr�rXr��map�connect_ftprJrrx�upper�retrfiler�rtr�r�r�
all_errors�with_tracebackr��exc_info)r�r�r�r�rzrCr r1r�r\�attrs�dirsrO�fwr��attrr�rh�retrlenrir�r��excrLrLrM�ftp_opens^
�
zFTPHandler.ftp_openc	Cst||||||dd�S)NF)�
persistent)�
ftpwrapper)r�r r1rzrCr�rJrLrLrMr�7s�zFTPHandler.connect_ftpN)r�r�r�r�r�rLrLrLrMr+s5c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)r,cCs"i|_i|_d|_d|_d|_dS)Nr�<r})�cacherJ�soonest�delay�	max_connsr�rLrLrMr�>s
zCacheFTPHandler.__init__cCs
||_dSrN)r�)r��trLrLrM�
setTimeoutEszCacheFTPHandler.setTimeoutcCs
||_dSrN)r�)r�rrLrLrM�setMaxConnsHszCacheFTPHandler.setMaxConnscCsr|||d�|�|f}||jkr4t��|j|j|<n,t||||||�|j|<t��|j|j|<|��|j|S)Nr
)�joinr�r~r�rJr��check_cache)r�r r1rzrCr�rJr�rLrLrMr�Ks

�
zCacheFTPHandler.connect_ftpcCs�t��}|j|krPt|j���D].\}}||kr |j|��|j|=|j|=q tt|j����|_t	|j�|j
kr�t|j���D]&\}}||jkr�|j|=|j|=q�q�tt|j����|_dSrN)r~r�r�rJrr�r��min�valuesrdr�)r�r�r�rrLrLrMr�Vs


zCacheFTPHandler.check_cachecCs0|j��D]}|��q
|j��|j��dSrN)r�r�r��clearrJ)r��connrLrLrM�clear_cachejs

zCacheFTPHandler.clear_cacheN)	r�r�r�r�r�r�r�r�rrLrLrLrMr,;sc@seZdZdd�ZdS)r-cCs~|j}|�dd�\}}|�dd�\}}t|�}|�d�rNt�|�}|dd�}|sVd}t�d|t|�f�}t	t
�|�||�S)N�:rVr�z;base64i�����text/plain;charset=US-ASCIIz$Content-type: %s
Content-length: %d
)rtrXr�endswithr-�decodebytesr�r�rdr�io�BytesIO)r�r�rHrrIZ	mediatyperirLrLrM�	data_openqs



�zDataHandler.data_openN)r�r�r�r	rLrLrLrMr-psr��nt)r4r3cCst|�SrN)r
��pathnamerLrLrMr4�scCst|�SrN)r	rrLrLrMr3�sc@s�eZdZdZdeZd)dd�Zdd�Zdd�Zd	d
�Z	dd�Z
d*d
d�Zd+dd�Zd,dd�Z
d-dd�Zdd�Zd.dd�Zd/dd�Zdd�Zer�dd�Zd0dd �Zd!d"�Zd#d$�Zd%d&�Zd1d'd(�ZdS)2r8Nr�cKszdd|jji}tj|tdd�|dkr.t�}||_|�d�|_|�d�|_	d|j
fdg|_g|_t
j|_d|_t|_dS)	NzW%(class)s style of invoking requests is deprecated. Use newer urlopen functions/methods�classrS)�
stacklevel�key_file�	cert_filez
User-Agent)ZAcceptz*/*)rLr�r?r@rAr5r&r�rr�versionr��_URLopener__tempfilesr[rp�_URLopener__unlink�	tempcache�ftpcache)r�r&Zx509r�rLrLrMr��s
�zURLopener.__init__cCs|��dSrN)r�r�rLrLrM�__del__�szURLopener.__del__cCs|��dSrN)�cleanupr�rLrLrMr��szURLopener.closec	CsV|jrB|jD](}z|�|�Wqtk
r2YqXq|jdd�=|jrR|j��dSrN)rrrqrr)r�rOrLrLrMr�s
zURLopener.cleanupcGs|j�|�dSrN)r�ra)r�r�rLrLrM�	addheader�szURLopener.addheaderc
Csptt|��}t|dd�}|jrL||jkrL|j|\}}t|d�}t|||�St|�\}}|s`d}||jkr�|j|}t|�\}}	t|	�\}
}|
|f}nd}d|}||_	|�
dd�}t||�r�|dkr�|r�|�|||�S|�
||�Sz0|dk�rt||�|�WSt||�||�WSWnVttfk
�r0�Yn<tk
�rj}
ztd	|
��t��d
��W5d}
~
XYnXdS)Nz%/:=&?~#+!$,;'@()*[]|�rr�rOZopen_�-r�r�zsocket errorr:)rrr	rrGrrr&rr�rr��open_unknown_proxy�open_unknownr�rrrqr�r�r�)r�r�rIrfrirh�urltyperHr�	proxyhostrzr�r_r�rLrLrMrG�s<




zURLopener.opencCst|�\}}tdd|��dS)N�	url errorzunknown url type�rrq)r�r�rIr�rHrLrLrMr
szURLopener.open_unknowncCs t|�\}}tdd||��dS)Nrzinvalid proxy for %sr )r�rr�rIr�rHrLrLrMrszURLopener.open_unknown_proxyc
Cstt|��}|jr&||jkr&|j|St|�\}}|dkr�|rF|dkr�z0|�|�}|��}|��tt|�d�|fWSt	k
r�}	zW5d}	~	XYnX|�
||�}�z<|��}
|r�t
|d�}nrt|�\}}
t|
p�d�\}}
t|
p�d�\}
}t|
p�d�\}
}t
j�|
�d}t�|�\}}|j�|�t
�|d�}z�||
f}|jdk	�rT||j|<d}d}d}d}d|
k�rzt|
d	�}|�r�||||�|�|�}|�s��q�|t|�7}|�|�|d7}|�r�||||��q�W5|��XW5|��X|dk�r||k�rtd
||f|��|S)NrOrVrPrrrRrSrrTrUrW)rrrrr�rZr�r4rrqrGrrr[r\�splitextr^Zmkstemprra�fdopenrbrcrdrer)r�rHrfrgrIr�Zurl1rhr�r�rirjZgarbager\�suffix�fdrkrlrmrcrnrorLrLrM�retrievesn






��zURLopener.retrievecCs$d}d}t|t�r<t|�\}}|r6t|�\}}t|�}|}nt|\}}t|�\}}t|�\}	}
|
}d}|	��dkrvd}n:t|
�\}}
|r�t|�\}}|r�d|	||
f}t|�r�|}|s�tdd��|r�t|�}t	�
|����d�}nd}|�rt|�}t	�
|����d�}nd}||�}
i}|�r*d||d<|�r<d||d<|�rJ||d	<d
|d<|j
D]\}}|||<�qX|dk	�r�d|d
<|
�d|||�n|
jd||d�z|
��}Wn"tjjk
�r�td��YnXd|jk�r�dk�rnnt||jd||j�S|�||j|j|j|j|�SdS)Nr�z	%s://%s%sz
http errorr�r)zBasic %sr�rcrsr�r�r�zContent-Typer�r�r�z$http protocol error: bad status liner�r��http:)r�r�rrr
rrxr,rqr-r.r/r0r�ryr�r�r�Z
BadStatusLinerZstatusrr��
http_errorrhr�)r�Zconnection_factoryrHrIZuser_passwdZproxy_passwdrzr�Zrealhostrr�Z
proxy_authrbZ	http_connrirYr�r�rLrLrM�_open_generic_httpVs~



��zURLopener._open_generic_httpcCs|�tjj||�SrN)r(r�r�r��r�rHrIrLrLrM�	open_http�szURLopener.open_httpc
Csbd|}t||�rPt||�}|dkr6||||||�}	n|||||||�}	|	rP|	S|�|||||�S)Nz
http_error_%d)r�r�r�)
r�rHrh�errcode�errmsgrirIr_r�rkrLrLrMr'�s

zURLopener.http_errorcCs|��t||||d��dSrN)r�r�r�rHrhr+r,rirLrLrMr��szURLopener.http_error_defaultcCstjj||j|jd�S)N)rr)r�r�r�rr)r�rzrLrLrM�_https_connection�s�zURLopener._https_connectioncCs|�|j||�SrN)r(r.r)rLrLrM�
open_https�szURLopener.open_httpscCs^t|t�std��|dd�dkrP|dd�dkrP|dd���dkrPtd��n
|�|�SdS)	NzEfile error: proxy support for file protocol currently not implementedr:rrSr
�z
localhost/r�)r�r�rrxrBr�r�rLrLrM�	open_file�s

4
zURLopener.open_filec
Cs\ddl}ddl}t|�\}}t|�}zt�|�}Wn0tk
rb}zt|j|j	��W5d}~XYnX|j
}	|jj|j
dd�}
|�|�d}|�d|p�d|	|
f�}|s�|}
|dd�dkr�d|}
tt|d	�||
�St|�\}}|�sPt�|�t�ft�k�rP|}
|dd�dk�r d|}
n|dd
�dk�r>td|��tt|d	�||
�Std
��dS)NrTr�z6Content-Type: %s
Content-Length: %d
Last-modified: %s
r�rVr
r�r�r:z./zAlocal file url may start with / or file:. Unknown url of type: %sz#local file error: not on local host)r�r�rr4r[r�rqr�strerrorrfr�r�r�r�r�r�rrGr
r�r�r��thishostrB)r�rHr�r�rzrOZ	localnamer��ermr�r�riZurlfilerCrLrLrMr��s@ ���
zURLopener.open_local_filec
Cs�t|t�std��ddl}t|�\}}|s2td��t|�\}}t|�\}}|r\t|�\}}nd}t|�}t|ppd�}t|p|d�}t	�
|�}|s�ddl}|j}nt
|�}t|�\}}	t|�}|�d�}
|
dd�|
d}
}|
r�|
ds�|
dd�}
|
�r
|
d�s
d|
d<|||d�|
�f}t|j�tk�rbt|j�D]*}
|
|k�r6|j|
}|j|
=|���q6z�||jk�r�t|||||
�|j|<|�s�d}nd	}|	D]2}t|�\}}|��d
k�r�|dk�r�|��}�q�|j|�||�\}}|�d|�d}d}|�r|d
|7}|dk	�r,|dk�r,|d|7}t�|�}t||d|�WSt�k
�r�}ztd|�� t!�"�d��W5d}~XYnXdS)NzCftp error: proxy support for ftp protocol currently not implementedrr�rrr
rSrVr�rhr�r�zftp:zContent-Type: %s
zContent-Length: %d
zftp error %rr:)#r�r�rr�rr
rrr
r�r�r�r�rbrrXr�rdr�MAXFTPCACHEr�r�r�rrxr�r�r�r�r�r�	ftperrorsr�r�r�)r�rHr�rzr\rCr r1r�r�r�rOr�r�rr�r�r�rhr�r�rir�rLrLrM�open_ftp�st




��
zURLopener.open_ftpc	
Cs<t|t�std��z|�dd�\}}Wntk
rDtdd��YnX|sNd}|�d�}|dkr�d	||d�kr�||dd�}|d|�}nd
}g}|�dt�	dt�
t�����|�d
|�|dkr�t�|�
d���d�}nt|�}|�dt|��|�d
�|�|�d�|�}t�|�}t�|�}t|||�S)NzEdata error: proxy support for data protocol currently not implementedr�rVz
data errorzbad data URLr�;rr�rrzDate: %sz%a, %d %b %Y %H:%M:%S GMTzContent-type: %sr-r)zlatin-1zContent-Length: %d�
)r�r�rrXrBrq�rfindrar~�strftime�gmtimer-rr/r0r
rdr�r�r�r�StringIOr)	r�rHrIr�Zsemirr�ri�frLrLrM�	open_data8s8

�




zURLopener.open_data)N)N)N)N)NNN)N)N)N)N)r�r�r�rr�rr�rr�rrrGrrr%r(r*r'r�rCr.r/r1r�r7r?rLrLrLrMr8�s,

$


A\


	 :c@s�eZdZdd�Zdd�Zd"dd�Zdd	�Zd#d
d�Zd$dd
�Zd%dd�Z	d&dd�Z
d'dd�Zd(dd�Zd)dd�Z
d*dd�Zd+dd�Zd,dd�Zd d!�ZdS)-r9cOs(tj|f|�|�i|_d|_d|_dS)Nrr�)r8r��
auth_cache�tries�maxtriesrIrLrLrMr�eszFancyURLopener.__init__cCst||d||�S)Nr&)rr-rLrLrMr�ksz!FancyURLopener.http_error_defaultNc	Csv|jd7_zZ|jrN|j|jkrNt|d�r4|j}n|j}|||dd|�W�S|�||||||�}|W�Sd|_XdS)NrVr�http_error_500r�z)Internal Server Error: Redirect Recursion)rArBr�rCr��redirect_internal)	r�rHrhr+r,rirIr�rkrLrLrMros 
��zFancyURLopener.http_error_302c	Csxd|kr|d}nd|kr$|d}ndS|��t|jd||�}t|�}|jdkrnt|||d|||��|�|�S)Nrrrrz( Redirection to url '%s' is not allowed.)r�rr�rrrrG)	r�rHrhr+r,rirIrrrLrLrMrD�s"


��z FancyURLopener.redirect_internalcCs|�||||||�SrN�r�r�rHrhr+r,rirIrLrLrMr�szFancyURLopener.http_error_301cCs|�||||||�SrNrErFrLrLrMr�szFancyURLopener.http_error_303cCs2|dkr|�||||||�S|�|||||�SdSrN)rr�rFrLrLrMr�szFancyURLopener.http_error_307Fc
Cs�d|krt�||||||�|d}t�d|�}	|	sHt�||||||�|	��\}
}|
��dkrtt�||||||�|s�t�||||||�d|jd}|dkr�t||�||�St||�|||�SdS)Nrj�![ 	]*([^ 	]+)[ 	]+realm="([^"]*)"r[Zretry_�_basic_auth�r8r�rf�matchrVrxr�r��
r�rHrhr+r,rirIr�ZstuffrJrr9r_rLrLrMrk�s:
�
�
��zFancyURLopener.http_error_401c
Cs�d|krt�||||||�|d}t�d|�}	|	sHt�||||||�|	��\}
}|
��dkrtt�||||||�|s�t�||||||�d|jd}|dkr�t||�||�St||�|||�SdS)NrmrGr[Zretry_proxy_rHrIrKrLrLrMrn�s:
�
�
��zFancyURLopener.http_error_407cCs�t|�\}}d||}|jd}t|�\}}	t|	�\}	}
|	�d�d}|	|d�}	|�|	||�\}}
|sr|
srdSdt|dd�t|
dd�|	f}	d|	|
|jd<|dkr�|�|�S|�||�SdS)N�http://r�rrV�%s:%s@%srrr�rr&rr��get_user_passwdr	rG�r�rHr9rIrzr�rrrrZ
proxyselectorr�r r1rLrLrM�retry_proxy_http_basic_auth�s$

�
z*FancyURLopener.retry_proxy_http_basic_authcCs�t|�\}}d||}|jd}t|�\}}	t|	�\}	}
|	�d�d}|	|d�}	|�|	||�\}}
|sr|
srdSdt|dd�t|
dd�|	f}	d|	|
|jd<|dkr�|�|�S|�||�SdS)N�https://r�rrVrMrrrrNrPrLrLrM�retry_proxy_https_basic_auth�s$

�
z+FancyURLopener.retry_proxy_https_basic_authc
Cs�t|�\}}|�d�d}||d�}|�|||�\}}|sD|sDdSdt|dd�t|dd�|f}d||}	|dkr�|�|	�S|�|	|�SdS)NrrVrMrrrrL�rr�rOr	rG�
r�rHr9rIrzr�r�r r1rrLrLrMr\	s
�
z$FancyURLopener.retry_http_basic_authc
Cs�t|�\}}|�d�d}||d�}|�|||�\}}|sD|sDdSdt|dd�t|dd�|f}d||}	|dkr�|�|	�S|�|	|�SdS)NrrVrMrrrrRrTrUrLrLrM�retry_https_basic_auth	s
�
z%FancyURLopener.retry_https_basic_authrcCs`|d|��}||jkr2|r(|j|=n
|j|S|�||�\}}|sJ|rX||f|j|<||fS)Nr)rxr@�prompt_user_passwd)r�rzr9rr�r r1rLrLrMrO	s


zFancyURLopener.get_user_passwdcCsXddl}z.td||f�}|�d|||f�}||fWStk
rRt�YdSXdS)NrzEnter username for %s at %s: z#Enter password for %s in %s at %s: r<)�getpass�input�KeyboardInterrupt�print)r�rzr9rXr r1rLrLrMrW)	s�
z!FancyURLopener.prompt_user_passwd)N)N)N)N)NF)NF)N)N)N)N)r)r�r�r�r�r�rrDrrrrkrnrQrSr\rVrOrWrLrLrLrMr9bs&



�
�





cCstdkrt�d�atS)Nr�)�
_localhostr�r�rLrLrLrMr�9	s
r�cCsPtdkrLztt�t���d�aWn(tjk
rJtt�d�d�aYnXtS)Nr:r�)�	_thishostr8r�r�r�r�rLrLrLrMr3A	sr3cCstdkrddl}|jatSro)�
_ftperrorsr�r�)r�rLrLrMr6L	sr6cCstdkrt�d�atSr�)�
_noheadersr�r�rLrLrLrM�	noheadersU	s
r`c@sFeZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dS)r�NTcCsX||_||_||_||_||_||_d|_||_z|��Wn|�	��YnXdSro)
r r1rzrCr�rJ�refcount�	keepalive�initr�)r�r r1rzrCr�rJr�rLrLrMr�b	szftpwrapper.__init__cCs\ddl}d|_|��|_|j�|j|j|j�|j�|j	|j
�d�|j�}|j�
|�dS)Nrr
)r��busyZFTPr	ZconnectrzrCrJZloginr r1r�r��cwd)r�r�Z_targetrLrLrMrcr	s
zftpwrapper.initc
Cs�ddl}|��|dkr"d}d}nd|}d}z|j�|�Wn*|jk
rh|��|j�|�YnXd}|r�|s�zd|}|j�|�\}}WnR|jk
r�}z2t|�dd�dkr�t	d	|��
t��d
��W5d}~XYnX|�s�|j�d�|�rl|j�
�}	zJz|j�|�Wn4|jk
�rN}zt	d	|�|�W5d}~XYnXW5|j�|	�Xd|}nd}|j�|�\}}d|_t|�d
�|j�}
|jd7_|��|
|fS)Nr)r�r�zTYPE ArVzTYPE zRETR rSZ550r�r:zLIST ZLISTr�)r��endtransferr	Zvoidcmdr�rcZntransfercmdZ
error_permr�rr�r�r��pwdrerdrZmakefile�
file_closerar�)r�rOr�r��cmd�isdirrr�r�rgZftpobjrLrLrMr�{	sP
�
$
zftpwrapper.retrfilecCs
d|_dSro)rdr�rLrLrMrf�	szftpwrapper.endtransfercCsd|_|jdkr|��dS)NFr)rbra�
real_closer�rLrLrMr��	s
zftpwrapper.closecCs2|��|jd8_|jdkr.|js.|��dS)NrVr)rfrarbrkr�rLrLrMrh�	szftpwrapper.file_closecCs2|��z|j��Wnt�k
r,YnXdSrN)rfr	r�r6r�rLrLrMrk�	s
zftpwrapper.real_close)NT)
r�r�r�r�rcr�rfr�rhrkrLrLrLrMr�_	s�
	-r�cCs�i}tj��D]4\}}|��}|r|dd�dkr|||dd�<qdtjkrZ|�dd�tj��D]J\}}|dd�dkrd|��}|r�|||dd�<qd|�|dd�d�qd|S)Ni�����_proxyZREQUEST_METHODr�)r[�environrrxr�)r&r_r�rLrLrM�getproxies_environment�	s	
rncCs�|dkrt�}z|d}Wntk
r0YdSX|dkr>dS|��}t|�\}}|�d�D]Z}|��}|r\|�d�}|��}||ks�||kr�dSd|}|�|�s�|�|�r\dSq\dS)NZnoF�*Tr��.)rnr�rxr
rXrd�lstripr)rzr&Zno_proxy�hostonlyrCr_rLrLrM�proxy_bypass_environment�	s*
rsc	Cs0ddlm}t|�\}}dd�}d|kr4|dr4dSd}|�dd	�D]�}|sNqDt�d
|�}|dk	�r|dkr�zt�|�}||�}Wntk
r�YqDYnX||�d��}	|�d�}
|
dkr�d
|�d��	d�d}
nt
|
dd��}
|
dksD|
dkr�qDd|
}
||
?|	|
?k�r*dSqD|||�rDdSqDdS)Nr)�fnmatchcSsh|�d�}ttt|��}t|�dkr<|ddddgdd�}|dd>|dd>B|dd>B|d	BS)
Nrpr�r�rVr}r:r|rS)rXr�r�rbrd)ZipAddrrBrLrLrM�ip2num
s

z,_proxy_bypass_macosx_sysconf.<locals>.ip2numrpZexclude_simpleT�
exceptionsrLz(\d+(?:\.\d+)*)(/\d+)?rVr:r|� F)rtr
r�rfrJr�r�rq�group�countrb)rz�proxy_settingsrtrrrCrvZhostIPr�rrD�maskrLrLrM�_proxy_bypass_macosx_sysconf
s>




r}�darwin)�_get_proxy_settings�_get_proxiescCst�}t||�SrN)rr})rzr{rLrLrM�proxy_bypass_macosx_sysconfF
sr�cCst�SrN)r�rLrLrLrM�getproxies_macosx_sysconfJ
sr�cCs t�}|rt||�St|�SdSrN)rnrsr��rzr&rLrLrMr,T
s
r,cCst�p
t�SrN)rnr�rLrLrLrMr5a
sc
Csi}zddl}Wntk
r(|YSXz�|�|jd�}|�|d�d}|r�t|�|d�d�}d|kr�|�d�D]4}|�dd�\}}t�d|�s�d	||f}|||<qtn>|dd
�dkr�||d<n$d
||d<d||d<d||d<|�	�Wnt
ttfk
�rYnX|S)Nr�;Software\Microsoft\Windows\CurrentVersion\Internet Settings�ProxyEnableZProxyServerr�r8rVz
(?:[^/:]+)://z%s://%srtr&r�z	http://%sz
https://%sr�zftp://%sr	)
�winreg�ImportError�OpenKey�HKEY_CURRENT_USER�QueryValueExr�rXrfrJZCloserqrBr�)r&r��internetSettings�proxyEnableZproxyServer�pr�ZaddressrLrLrM�getproxies_registryf
sF
�����
r�cCst�p
t�SrN)rnr�rLrLrLrMr5�
scCs|zddl}Wntk
r"YdSXz6|�|jd�}|�|d�d}t|�|d�d�}Wntk
rpYdSX|rz|s~dSt|�\}}|g}z t�	|�}||kr�|�
|�Wntk
r�YnXz t�|�}||kr�|�
|�Wntk
�r�YnX|�d�}|D]j}	|	dk�r*d|k�r*dS|	�
dd	�}	|	�
d
d�}	|	�
dd�}	|D] }
t�|	|
tj��rRdS�qR�qdS)
Nrr�r�Z
ProxyOverrider8z<local>rprVz\.roz.*�?)r�r�r�r�r�r�rqr
r�r�raZgetfqdnrXrrfrJrh)rzr�r�r�Z
proxyOverrideZrawHostrCZaddrZfqdnrEr�rLrLrM�proxy_bypass_registry�
s`�����





r�cCs t�}|rt||�St|�SdSrN)rnrsr�r�rLrLrMr,�
s
)NNN)N)}r-r�r�r�Zhttp.clientr�rr[�	posixpathrfr�rr�r~r^rXr?Zurllib.errorrrrZurllib.parserrrrr	r
rrr
rrrrrrrrrZurllib.responserrrDr�rC�__all__�version_infor�rFr�r0r1r`r6r7rg�ASCIIrvr{rrr2rr/rrr"rr r!r"r#r$r%�urandomr�r&r'r(r�r)r�r�rErarr.rvrxr*r�r+r,r-r5r_Z
nturl2pathr4r3rr8r9r\r�r]r3r^r6r_r`r�rnrsr}�platformZ_scproxyrr�r�r�r,r5r�r�rLrLrLrM�<module>TsP
��U
?m$q!+@
ov

+3:5!@W

_
%A

-	2
urllib/__pycache__/__init__.cpython-38.opt-1.pyc000064400000000202151153537540015376 0ustar00U

��.e�@sdS)N�rrr�'/usr/lib64/python3.8/urllib/__init__.py�<module>�urllib/__pycache__/robotparser.cpython-38.opt-2.pyc000064400000013511151153537540016211 0ustar00U

e5d�$�@sXddlZddlZddlZdgZe�dd�ZGdd�d�ZGdd�d�ZGdd	�d	�Z	dS)
�N�RobotFileParser�RequestRatezrequests secondsc@sneZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)r�cCs2g|_g|_d|_d|_d|_|�|�d|_dS)NFr)�entries�sitemaps�
default_entry�disallow_all�	allow_all�set_url�last_checked��self�url�r�*/usr/lib64/python3.8/urllib/robotparser.py�__init__s
zRobotFileParser.__init__cCs|jS�N)r�r
rrr�mtime%szRobotFileParser.mtimecCsddl}|��|_dS)Nr)�timer)r
rrrr�modified.szRobotFileParser.modifiedcCs&||_tj�|�dd�\|_|_dS)N��)r�urllib�parse�urlparseZhost�pathrrrrr
6szRobotFileParser.set_urlc
Cs�ztj�|j�}WnRtjjk
rd}z0|jdkr:d|_n|jdkrT|jdkrTd|_W5d}~XYnX|�	�}|�
|�d����dS)N)i�i�Ti�i�zutf-8)
rZrequestZurlopenr�errorZ	HTTPError�coderr	�readr�decode�
splitlines)r
�f�err�rawrrrr;s
zRobotFileParser.readcCs,d|jkr|jdkr(||_n|j�|�dS�N�*)�
useragentsrr�append)r
�entryrrr�
_add_entryHs

zRobotFileParser._add_entrycCsPd}t�}|��|D�]}|sP|dkr4t�}d}n|dkrP|�|�t�}d}|�d�}|dkrn|d|�}|��}|s|q|�dd�}t|�dkr|d����|d<tj	�
|d���|d<|ddkr�|dkr�|�|�t�}|j�|d�d}q|ddk�r.|dk�r6|j
�t|dd��d}q|dd	k�rb|dk�r6|j
�t|dd
��d}q|ddk�r�|dk�r6|d�����r�t|d�|_d}q|ddk�r|dk�r6|d�d
�}t|�dk�r|d�����r|d�����rtt|d�t|d��|_d}q|ddkr|j�|d�q|dk�rL|�|�dS)Nrr��#�:z
user-agentZdisallowFZallowTzcrawl-delayzrequest-rate�/Zsitemap)�Entryrr*�find�strip�split�len�lowerrr�unquoter'r(�	rulelines�RuleLine�isdigit�int�delayr�req_rater)r
�lines�stater)�line�iZnumbersrrrrQsj








 �
zRobotFileParser.parsecCs�|jr
dS|jrdS|jsdStj�tj�|��}tj�dd|j|j	|j
|jf�}tj�|�}|sfd}|j
D]}|�|�rl|�|�Sql|jr�|j�|�SdS)NFTrr.)rr	rrrrr5�
urlunparserZparamsZqueryZfragment�quoter�
applies_to�	allowancer)r
�	useragentrZ
parsed_urlr)rrr�	can_fetch�s*�

zRobotFileParser.can_fetchcCs>|��sdS|jD]}|�|�r|jSq|jr:|jjSdSr)rrrBr:r�r
rDr)rrr�crawl_delay�s

zRobotFileParser.crawl_delaycCs>|��sdS|jD]}|�|�r|jSq|jr:|jjSdSr)rrrBr;rrFrrr�request_rate�s

zRobotFileParser.request_ratecCs|js
dS|jSr)rrrrr�	site_maps�szRobotFileParser.site_mapscCs,|j}|jdk	r||jg}d�tt|��S)Nz

)rr�join�map�str)r
rrrr�__str__�s
zRobotFileParser.__str__N)r)�__name__�
__module__�__qualname__rrrr
rr*rrErGrHrIrMrrrrrs
		
	I

c@s$eZdZdd�Zdd�Zdd�ZdS)r7cCs<|dkr|sd}tj�tj�|��}tj�|�|_||_dS)NrT)rrr@rrArrC)r
rrCrrrr�s
zRuleLine.__init__cCs|jdkp|�|j�Sr%)r�
startswith)r
�filenamerrrrB�szRuleLine.applies_tocCs|jr
dndd|jS)NZAllowZDisallowz: )rCrrrrrrM�szRuleLine.__str__N)rNrOrPrrBrMrrrrr7�sr7c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
r/cCsg|_g|_d|_d|_dSr)r'r6r:r;rrrrr�szEntry.__init__cCs�g}|jD]}|�d|���q
|jdk	r<|�d|j���|jdk	rf|j}|�d|j�d|j���|�tt|j	��d�
|�S)NzUser-agent: z
Crawl-delay: zRequest-rate: r.�
)r'r(r:r;ZrequestsZseconds�extendrKrLr6rJ)r
Zret�agentZraterrrrM�s


z
Entry.__str__cCsF|�d�d��}|jD](}|dkr*dS|��}||krdSqdS)Nr.rr&TF)r2r4r')r
rDrUrrrrB�s
zEntry.applies_tocCs$|jD]}|�|�r|jSqdS)NT)r6rBrC)r
rRr>rrrrC
s

zEntry.allowanceN)rNrOrPrrMrBrCrrrrr/�s
r/)
�collectionsZurllib.parserZurllib.request�__all__�
namedtuplerrr7r/rrrr�<module>
sBurllib/__pycache__/response.cpython-38.pyc000064400000006333151153537540014551 0ustar00U

e5d��@s^dZddlZddddgZGdd�dej�ZGdd�de�ZGd	d�de�ZGd
d�de�ZdS)aResponse classes used by urllib.

The base class, addbase, defines a minimal file-like interface,
including read() and readline().  The typical response object is an
addinfourl instance, which defines an info() method that returns
headers and a geturl() method that returns the url.
�N�addbase�addclosehook�addinfo�
addinfourlcs8eZdZdZ�fdd�Zdd�Zdd�Zdd	�Z�ZS)
rzOBase class for addinfo and addclosehook. Is a good idea for garbage collection.cs tt|�j|ddd�||_dS)Nz<urllib response>F)�delete)�superr�__init__�fp)�selfr	��	__class__��'/usr/lib64/python3.8/urllib/response.pyrszaddbase.__init__cCsd|jjt|�|jfS)Nz<%s at %r whose fp = %r>)r�__name__�id�file�r
r
r
r�__repr__s�zaddbase.__repr__cCs|jjrtd��|S)NzI/O operation on closed file)r	�closed�
ValueErrorrr
r
r�	__enter__szaddbase.__enter__cCs|��dS�N)�close)r
�type�value�	tracebackr
r
r�__exit__!szaddbase.__exit__)	r�
__module__�__qualname__�__doc__rrrr�
__classcell__r
r
rrrs
cs,eZdZdZ�fdd�Z�fdd�Z�ZS)rz*Class to add a close hook to an open file.cs tt|��|�||_||_dSr)rrr�	closehook�hookargs)r
r	r!r"rr
rr(szaddclosehook.__init__c	s>z(|j}|j}|r&d|_d|_||�W5tt|���XdSr)rrrr!r")r
r!r"rr
rr-szaddclosehook.close)rrrrrrr r
r
rrr%scs(eZdZdZ�fdd�Zdd�Z�ZS)rz.class to add an info() method to an open file.cstt|��|�||_dSr)rrr�headers)r
r	r#rr
rr<szaddinfo.__init__cCs|jSr)r#rr
r
r�info@szaddinfo.info)rrrrrr$r r
r
rrr9scs2eZdZdZd	�fdd�	Zdd�Zdd�Z�ZS)
rz9class to add info() and geturl() methods to an open file.Ncs"tt|��||�||_||_dSr)rrr�url�code)r
r	r#r%r&rr
rrGszaddinfourl.__init__cCs|jSr)r&rr
r
r�getcodeLszaddinfourl.getcodecCs|jSr)r%rr
r
r�geturlOszaddinfourl.geturl)N)rrrrrr'r(r r
r
rrrDs)rZtempfile�__all__Z_TemporaryFileWrapperrrrrr
r
r
r�<module>surllib/__pycache__/robotparser.cpython-38.opt-1.pyc000064400000016241151153537540016213 0ustar00U

e5d�$�@s\dZddlZddlZddlZdgZe�dd�ZGdd�d�ZGdd�d�Z	Gd	d
�d
�Z
dS)a% robotparser.py

    Copyright (C) 2000  Bastian Kleineidam

    You can choose between two licenses when using this package:
    1) GNU GPLv2
    2) PSF license for Python 2.2

    The robots.txt Exclusion Protocol is implemented as specified in
    http://www.robotstxt.org/norobots-rfc.txt
�N�RobotFileParser�RequestRatezrequests secondsc@sreZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)rzs This class provides a set of methods to read, parse and answer
    questions about a single robots.txt file.

    �cCs2g|_g|_d|_d|_d|_|�|�d|_dS)NFr)�entries�sitemaps�
default_entry�disallow_all�	allow_all�set_url�last_checked��self�url�r�*/usr/lib64/python3.8/urllib/robotparser.py�__init__s
zRobotFileParser.__init__cCs|jS)z�Returns the time the robots.txt file was last fetched.

        This is useful for long-running web spiders that need to
        check for new robots.txt files periodically.

        )r�r
rrr�mtime%szRobotFileParser.mtimecCsddl}|��|_dS)zYSets the time the robots.txt file was last fetched to the
        current time.

        rN)�timer)r
rrrr�modified.szRobotFileParser.modifiedcCs&||_tj�|�dd�\|_|_dS)z,Sets the URL referring to a robots.txt file.��N)r�urllib�parse�urlparseZhost�pathrrrrr
6szRobotFileParser.set_urlc
Cs�ztj�|j�}WnRtjjk
rd}z0|jdkr:d|_n|jdkrT|jdkrTd|_W5d}~XYnX|�	�}|�
|�d����dS)z4Reads the robots.txt URL and feeds it to the parser.)i�i�Ti�i�Nzutf-8)
rZrequestZurlopenr�errorZ	HTTPError�coderr	�readr�decode�
splitlines)r
�f�err�rawrrrr;s
zRobotFileParser.readcCs,d|jkr|jdkr(||_n|j�|�dS�N�*)�
useragentsrr�append)r
�entryrrr�
_add_entryHs

zRobotFileParser._add_entrycCsPd}t�}|��|D�]}|sP|dkr4t�}d}n|dkrP|�|�t�}d}|�d�}|dkrn|d|�}|��}|s|q|�dd�}t|�dkr|d����|d<tj	�
|d���|d<|ddkr�|dkr�|�|�t�}|j�|d�d}q|ddk�r.|dk�r6|j
�t|dd	��d}q|dd
k�rb|dk�r6|j
�t|dd��d}q|ddk�r�|dk�r6|d�����r�t|d�|_d}q|dd
k�r|dk�r6|d�d�}t|�dk�r|d�����r|d�����rtt|d�t|d��|_d}q|ddkr|j�|d�q|dk�rL|�|�dS)z�Parse the input lines from a robots.txt file.

        We allow that a user-agent: line is not preceded by
        one or more blank lines.
        rr��#N�:z
user-agentZdisallowFZallowTzcrawl-delayzrequest-rate�/Zsitemap)�Entryrr)�find�strip�split�len�lowerrr�unquoter&r'�	rulelines�RuleLine�isdigit�int�delayr�req_rater)r
�lines�stater(�line�iZnumbersrrrrQsj








 �
zRobotFileParser.parsecCs�|jr
dS|jrdS|jsdStj�tj�|��}tj�dd|j|j	|j
|jf�}tj�|�}|sfd}|j
D]}|�|�rl|�|�Sql|jr�|j�|�SdS)z=using the parsed robots.txt decide if useragent can fetch urlFTrr-)rr	rrrrr4�
urlunparserZparamsZqueryZfragment�quoter�
applies_to�	allowancer)r
�	useragentrZ
parsed_urlr(rrr�	can_fetch�s*�

zRobotFileParser.can_fetchcCs>|��sdS|jD]}|�|�r|jSq|jr:|jjSdS�N)rrrAr9r�r
rCr(rrr�crawl_delay�s

zRobotFileParser.crawl_delaycCs>|��sdS|jD]}|�|�r|jSq|jr:|jjSdSrE)rrrAr:rrFrrr�request_rate�s

zRobotFileParser.request_ratecCs|js
dS|jSrE)rrrrr�	site_maps�szRobotFileParser.site_mapscCs,|j}|jdk	r||jg}d�tt|��S)Nz

)rr�join�map�str)r
rrrr�__str__�s
zRobotFileParser.__str__N)r)�__name__�
__module__�__qualname__�__doc__rrrr
rr)rrDrGrHrIrMrrrrrs
		
	I

c@s(eZdZdZdd�Zdd�Zdd�ZdS)	r6zoA rule line is a single "Allow:" (allowance==True) or "Disallow:"
       (allowance==False) followed by a path.cCs<|dkr|sd}tj�tj�|��}tj�|�|_||_dS)NrT)rrr?rr@rrB)r
rrBrrrr�s
zRuleLine.__init__cCs|jdkp|�|j�Sr$)r�
startswith)r
�filenamerrrrA�szRuleLine.applies_tocCs|jr
dndd|jS)NZAllowZDisallowz: )rBrrrrrrM�szRuleLine.__str__N)rNrOrPrQrrArMrrrrr6�sr6c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r.z?An entry has one or more user-agents and zero or more rulelinescCsg|_g|_d|_d|_dSrE)r&r5r9r:rrrrr�szEntry.__init__cCs�g}|jD]}|�d|���q
|jdk	r<|�d|j���|jdk	rf|j}|�d|j�d|j���|�tt|j	��d�
|�S)NzUser-agent: z
Crawl-delay: zRequest-rate: r-�
)r&r'r9r:ZrequestsZseconds�extendrKrLr5rJ)r
Zret�agentZraterrrrM�s


z
Entry.__str__cCsF|�d�d��}|jD](}|dkr*dS|��}||krdSqdS)z2check if this entry applies to the specified agentr-rr%TF)r1r3r&)r
rCrVrrrrA�s
zEntry.applies_tocCs$|jD]}|�|�r|jSqdS)zZPreconditions:
        - our agent applies to this entry
        - filename is URL decodedT)r5rArB)r
rSr=rrrrB
s

zEntry.allowanceN)rNrOrPrQrrMrArBrrrrr.�s

r.)rQ�collectionsZurllib.parserZurllib.request�__all__�
namedtuplerrr6r.rrrr�<module>sBurllib/__pycache__/response.cpython-38.opt-1.pyc000064400000006333151153537540015510 0ustar00U

e5d��@s^dZddlZddddgZGdd�dej�ZGdd�de�ZGd	d�de�ZGd
d�de�ZdS)aResponse classes used by urllib.

The base class, addbase, defines a minimal file-like interface,
including read() and readline().  The typical response object is an
addinfourl instance, which defines an info() method that returns
headers and a geturl() method that returns the url.
�N�addbase�addclosehook�addinfo�
addinfourlcs8eZdZdZ�fdd�Zdd�Zdd�Zdd	�Z�ZS)
rzOBase class for addinfo and addclosehook. Is a good idea for garbage collection.cs tt|�j|ddd�||_dS)Nz<urllib response>F)�delete)�superr�__init__�fp)�selfr	��	__class__��'/usr/lib64/python3.8/urllib/response.pyrszaddbase.__init__cCsd|jjt|�|jfS)Nz<%s at %r whose fp = %r>)r�__name__�id�file�r
r
r
r�__repr__s�zaddbase.__repr__cCs|jjrtd��|S)NzI/O operation on closed file)r	�closed�
ValueErrorrr
r
r�	__enter__szaddbase.__enter__cCs|��dS�N)�close)r
�type�value�	tracebackr
r
r�__exit__!szaddbase.__exit__)	r�
__module__�__qualname__�__doc__rrrr�
__classcell__r
r
rrrs
cs,eZdZdZ�fdd�Z�fdd�Z�ZS)rz*Class to add a close hook to an open file.cs tt|��|�||_||_dSr)rrr�	closehook�hookargs)r
r	r!r"rr
rr(szaddclosehook.__init__c	s>z(|j}|j}|r&d|_d|_||�W5tt|���XdSr)rrrr!r")r
r!r"rr
rr-szaddclosehook.close)rrrrrrr r
r
rrr%scs(eZdZdZ�fdd�Zdd�Z�ZS)rz.class to add an info() method to an open file.cstt|��|�||_dSr)rrr�headers)r
r	r#rr
rr<szaddinfo.__init__cCs|jSr)r#rr
r
r�info@szaddinfo.info)rrrrrr$r r
r
rrr9scs2eZdZdZd	�fdd�	Zdd�Zdd�Z�ZS)
rz9class to add info() and geturl() methods to an open file.Ncs"tt|��||�||_||_dSr)rrr�url�code)r
r	r#r%r&rr
rrGszaddinfourl.__init__cCs|jSr)r&rr
r
r�getcodeLszaddinfourl.getcodecCs|jSr)r%rr
r
r�geturlOszaddinfourl.geturl)N)rrrrrr'r(r r
r
rrrDs)rZtempfile�__all__Z_TemporaryFileWrapperrrrrr
r
r
r�<module>surllib/__pycache__/response.cpython-38.opt-2.pyc000064400000005230151153537540015504 0ustar00U

e5d��@sZddlZddddgZGdd�dej�ZGdd�de�ZGdd�de�ZGd	d�de�ZdS)
�N�addbase�addclosehook�addinfo�
addinfourlcs4eZdZ�fdd�Zdd�Zdd�Zdd�Z�ZS)	rcs tt|�j|ddd�||_dS)Nz<urllib response>F)�delete)�superr�__init__�fp)�selfr	��	__class__��'/usr/lib64/python3.8/urllib/response.pyrszaddbase.__init__cCsd|jjt|�|jfS)Nz<%s at %r whose fp = %r>)r�__name__�id�file�r
r
r
r�__repr__s�zaddbase.__repr__cCs|jjrtd��|S)NzI/O operation on closed file)r	�closed�
ValueErrorrr
r
r�	__enter__szaddbase.__enter__cCs|��dS�N)�close)r
�type�value�	tracebackr
r
r�__exit__!szaddbase.__exit__)r�
__module__�__qualname__rrrr�
__classcell__r
r
rrrscs(eZdZ�fdd�Z�fdd�Z�ZS)rcs tt|��|�||_||_dSr)rrr�	closehook�hookargs)r
r	r r!rr
rr(szaddclosehook.__init__c	s>z(|j}|j}|r&d|_d|_||�W5tt|���XdSr)rrrr r!)r
r r!rr
rr-szaddclosehook.close)rrrrrrr
r
rrr%scs$eZdZ�fdd�Zdd�Z�ZS)rcstt|��|�||_dSr)rrr�headers)r
r	r"rr
rr<szaddinfo.__init__cCs|jSr)r"rr
r
r�info@szaddinfo.info)rrrrr#rr
r
rrr9scs.eZdZd�fdd�	Zdd�Zdd�Z�ZS)	rNcs"tt|��||�||_||_dSr)rrr�url�code)r
r	r"r$r%rr
rrGszaddinfourl.__init__cCs|jSr)r%rr
r
r�getcodeLszaddinfourl.getcodecCs|jSr)r$rr
r
r�geturlOszaddinfourl.geturl)N)rrrrr&r'rr
r
rrrDs)Ztempfile�__all__Z_TemporaryFileWrapperrrrrr
r
r
r�<module>	s
urllib/__pycache__/request.cpython-38.opt-1.pyc000064400000215451151153537540015345 0ustar00U

e5d���!@s�dZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlmZmZmZddlmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(ddl)m*Z*m+Z+zddl,Z,Wne-k
�rdZ.YnXdZ.dd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(g!Z/d)e
j0dd*�Z1da2dej3fddddd+�d,d�Z4d-d �Z5gZ6d~d.d%�Z7d/d&�Z8e
�9d0e
j:�Z;d1d2�Z<Gd3d�d�Z=Gd4d	�d	�Z>d5d!�Z?Gd6d
�d
�Z@Gd7d�de@�ZAGd8d�de@�ZBGd9d�de@�ZCd:d;�ZDGd<d�de@�ZEGd=d�d�ZFGd>d�deF�ZGGd?d�deG�ZHGd@d�d�ZIGdAd�deIe@�ZJGdBd�deIe@�ZKejLZMGdCd�d�ZNGdDd�de@eN�ZOGdEd�de@eN�ZPGdFdG�dGe@�ZQGdHd�deQ�ZReSejTdI��r*GdJdK�dKeQ�ZUe/�VdK�GdLd
�d
e@�ZWGdMd�de@�ZXdNdO�ZYdPdQ�ZZGdRd�de@�Z[dSdT�Z\GdUd�de@�Z]GdVd�de]�Z^GdWd�de@�Z_dXZ`ejadYk�r�ddZlbmcZcmdZdnd[d#�Zcd\d"�ZdiZeGd]d'�d'�ZfGd^d(�d(ef�Zgdahd_d`�Zidajdadb�Zkdaldcdd�Zmdandedf�ZoGdgdh�dh�Zpdidj�Zqddkdl�Zrdmdn�Zse
jtdok�r�ddplumvZvmwZwdqdr�Zxdsdt�Zydudv�Zzdwd$�Z{n6ejadYk�r�dxdy�Z|dzd$�Z{d{d|�Z}d}dv�ZzneqZ{erZzdS)�a�
An extensible library for opening URLs using a variety of protocols

The simplest way to use this module is to call the urlopen function,
which accepts a string containing a URL or a Request object (described
below).  It opens the URL and returns the results as file-like
object; the returned object has some extra methods described below.

The OpenerDirector manages a collection of Handler objects that do
all the actual work.  Each Handler implements a particular protocol or
option.  The OpenerDirector is a composite object that invokes the
Handlers needed to open the requested URL.  For example, the
HTTPHandler performs HTTP GET and POST requests and deals with
non-error returns.  The HTTPRedirectHandler automatically deals with
HTTP 301, 302, 303 and 307 redirect errors, and the HTTPDigestAuthHandler
deals with digest authentication.

urlopen(url, data=None) -- Basic usage is the same as original
urllib.  pass the url and optionally data to post to an HTTP URL, and
get a file-like object back.  One difference is that you can also pass
a Request instance instead of URL.  Raises a URLError (subclass of
OSError); for HTTP errors, raises an HTTPError, which can also be
treated as a valid response.

build_opener -- Function that creates a new OpenerDirector instance.
Will install the default handlers.  Accepts one or more Handlers as
arguments, either instances or Handler classes that it will
instantiate.  If one of the argument is a subclass of the default
handler, the argument will be installed instead of the default.

install_opener -- Installs a new opener as the default opener.

objects of interest:

OpenerDirector -- Sets up the User Agent as the Python-urllib client and manages
the Handler classes, while dealing with requests and responses.

Request -- An object that encapsulates the state of a request.  The
state can be as simple as the URL.  It can also include extra HTTP
headers, e.g. a User-Agent.

BaseHandler --

internals:
BaseHandler and parent
_call_chain conventions

Example usage:

import urllib.request

# set up authentication info
authinfo = urllib.request.HTTPBasicAuthHandler()
authinfo.add_password(realm='PDQ Application',
                      uri='https://mahler:8092/site-updates.py',
                      user='klem',
                      passwd='geheim$parole')

proxy_support = urllib.request.ProxyHandler({"http" : "http://ahad-haam:3128"})

# build a new opener that adds authentication and caching FTP handlers
opener = urllib.request.build_opener(proxy_support, authinfo,
                                     urllib.request.CacheFTPHandler)

# install it
urllib.request.install_opener(opener)

f = urllib.request.urlopen('http://www.python.org/')
�N)�URLError�	HTTPError�ContentTooShortError)�urlparse�urlsplit�urljoin�unwrap�quote�unquote�
_splittype�
_splithost�
_splitport�
_splituser�_splitpasswd�
_splitattr�_splitquery�_splitvalue�	_splittag�	_to_bytes�unquote_to_bytes�
urlunparse)�
addinfourl�addclosehookFT�Request�OpenerDirector�BaseHandler�HTTPDefaultErrorHandler�HTTPRedirectHandler�HTTPCookieProcessor�ProxyHandler�HTTPPasswordMgr�HTTPPasswordMgrWithDefaultRealm�HTTPPasswordMgrWithPriorAuth�AbstractBasicAuthHandler�HTTPBasicAuthHandler�ProxyBasicAuthHandler�AbstractDigestAuthHandler�HTTPDigestAuthHandler�ProxyDigestAuthHandler�HTTPHandler�FileHandler�
FTPHandler�CacheFTPHandler�DataHandler�UnknownHandler�HTTPErrorProcessor�urlopen�install_opener�build_opener�pathname2url�url2pathname�
getproxies�urlretrieve�
urlcleanup�	URLopener�FancyURLopenerz%d.%d�)�cafile�capath�	cadefault�contextc
Cs�|s|s|rfddl}|�dtd�|dk	r2td��ts>td��tjtjj||d�}t	|d�}t
|�}	n0|r~t	|d�}t
|�}	ntdkr�t
�a}	nt}	|	�|||�S)	a$
Open the URL url, which can be either a string or a Request object.

    *data* must be an object specifying additional data to be sent to
    the server, or None if no such data is needed.  See Request for
    details.

    urllib.request module uses HTTP/1.1 and includes a "Connection:close"
    header in its HTTP requests.

    The optional *timeout* parameter specifies a timeout in seconds for
    blocking operations like the connection attempt (if not specified, the
    global default timeout setting will be used). This only works for HTTP,
    HTTPS and FTP connections.

    If *context* is specified, it must be a ssl.SSLContext instance describing
    the various SSL options. See HTTPSConnection for more details.

    The optional *cafile* and *capath* parameters specify a set of trusted CA
    certificates for HTTPS requests. cafile should point to a single file
    containing a bundle of CA certificates, whereas capath should point to a
    directory of hashed certificate files. More information can be found in
    ssl.SSLContext.load_verify_locations().

    The *cadefault* parameter is ignored.

    This function always returns an object which can work as a context
    manager and has methods such as

    * geturl() - return the URL of the resource retrieved, commonly used to
      determine if a redirect was followed

    * info() - return the meta-information of the page, such as headers, in the
      form of an email.message_from_string() instance (see Quick Reference to
      HTTP Headers)

    * getcode() - return the HTTP status code of the response.  Raises URLError
      on errors.

    For HTTP and HTTPS URLs, this function returns a http.client.HTTPResponse
    object slightly modified. In addition to the three new methods above, the
    msg attribute contains the same information as the reason attribute ---
    the reason phrase returned by the server --- instead of the response
    headers as it is specified in the documentation for HTTPResponse.

    For FTP, file, and data URLs and requests explicitly handled by legacy
    URLopener and FancyURLopener classes, this function returns a
    urllib.response.addinfourl object.

    Note that None may be returned if no handler handles the request (though
    the default installed global OpenerDirector uses UnknownHandler to ensure
    this never happens).

    In addition, if proxy settings are detected (for example, when a *_proxy
    environment variable like http_proxy is set), ProxyHandler is default
    installed and makes sure the requests are handled through the proxy.

    rNzJcafile, capath and cadefault are deprecated, use a custom context instead.r:zDYou can't pass both context and any of cafile, capath, and cadefaultzSSL support not available)r;r<)r>)
�warnings�warn�DeprecationWarning�
ValueError�	_have_ssl�sslZcreate_default_contextZPurposeZSERVER_AUTH�HTTPSHandlerr2�_opener�open)
�url�data�timeoutr;r<r=r>r?Z
https_handler�opener�rL�&/usr/lib64/python3.8/urllib/request.pyr0�s2<��
�



cCs|adS�N)rF)rKrLrLrMr1�sc
Cs:t|�\}}t�t||����}|��}|dkrN|sNtj�|�|fW5QR�S|r^t|d�}nt	j
dd�}|j}t�
|�|��||f}	d}
d}d}d}
d|kr�t|d	�}|r�||
|
|�|�|
�}|s�q�|t|�7}|�|�|
d
7}
|r�||
|
|�q�W5QRXW5QRX|dk�r6||k�r6td||f|	��|	S)aW
    Retrieve a URL into a temporary location on disk.

    Requires a URL argument. If a filename is passed, it is used as
    the temporary file location. The reporthook argument should be
    a callable that accepts a block number, a read size, and the
    total file size of the URL target. The data argument should be
    valid URL encoded data.

    If a filename is passed and the URL points to a local resource,
    the result is a copy from local file to new file.

    Returns a tuple containing the path to the newly created
    data file as well as the resulting HTTPMessage object.
    �file�wbF)�delete� ���r�content-length�Content-Length��1retrieval incomplete: got only %i out of %i bytes)r�
contextlib�closingr0�info�os�path�normpathrG�tempfileZNamedTemporaryFile�name�_url_tempfiles�append�int�read�len�writer)rH�filename�
reporthookrIZurl_typer\�fp�headers�tfp�result�bs�sizerc�blocknum�blockrLrLrMr6�sH


"��c	CsDtD](}zt�|�Wqtk
r*YqXqtdd�=tr@dadS)z0Clean up temporary files from urlretrieve calls.N)r`r[�unlink�OSErrorrF)Z	temp_filerLrLrMr7$s
z:\d+$cCs<|j}t|�d}|dkr&|�dd�}t�d|d�}|��S)z�Return request-host, as defined by RFC 2965.

    Variation from RFC: returned value is lowercased, for convenient
    comparison.

    rV��Host)�full_urlr�
get_header�_cut_port_re�sub�lower)�requestrH�hostrLrLrM�request_host3sr{c@s�eZdZdidddfdd�Zedd��Zejdd��Zejdd��Zed	d
��Zejdd
��Zejdd
��Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd#dd�Zdd �Zd!d"�ZdS)$rNFc	Csl||_i|_i|_d|_||_d|_|��D]\}}|�||�q,|dkrRt|�}||_	||_
|rh||_dSrN)rtri�unredirected_hdrs�_datarI�_tunnel_host�items�
add_headerr{�origin_req_host�unverifiable�method)	�selfrHrIrir�r�r��key�valuerLrLrM�__init__EszRequest.__init__cCs|jrd�|j|j�S|jS)Nz{}#{})�fragment�format�	_full_url�r�rLrLrMrtWszRequest.full_urlcCs(t|�|_t|j�\|_|_|��dSrN)rr�rr��_parse�r�rHrLrLrMrt]s
cCsd|_d|_d|_dS)Nrr)r�r��selectorr�rLrLrMrtdscCs|jSrN)r}r�rLrLrMrIjszRequest.datacCs(||jkr$||_|�d�r$|�d�dS)N�Content-length)r}�
has_header�
remove_header)r�rIrLrLrMrIns

cCs
d|_dSrN)rIr�rLrLrMrIxscCsNt|j�\|_}|jdkr(td|j��t|�\|_|_|jrJt|j�|_dS)Nzunknown url type: %r)	rr��typerBrtrrzr�r
)r��restrLrLrMr�|s
zRequest._parsecCs|jdk	rdnd}t|d|�S)z3Return a string indicating the HTTP request method.N�POST�GETr�)rI�getattr)r�Zdefault_methodrLrLrM�
get_method�szRequest.get_methodcCs|jSrN)rtr�rLrLrM�get_full_url�szRequest.get_full_urlcCs2|jdkr|js|j|_n||_|j|_||_dS)N�https)r�r~rzrtr�)r�rzr�rLrLrM�	set_proxy�s

zRequest.set_proxycCs|j|jkSrN)r�rtr�rLrLrM�	has_proxy�szRequest.has_proxycCs||j|��<dSrN)ri�
capitalize�r�r��valrLrLrMr��szRequest.add_headercCs||j|��<dSrN)r|r�r�rLrLrM�add_unredirected_header�szRequest.add_unredirected_headercCs||jkp||jkSrN)rir|�r��header_namerLrLrMr��s
�zRequest.has_headercCs|j�||j�||��SrN)ri�getr|)r�r��defaultrLrLrMru�s�zRequest.get_headercCs |j�|d�|j�|d�dSrN)ri�popr|r�rLrLrMr��szRequest.remove_headercCs|j|j�}t|���SrN)r|ri�listr)r��hdrsrLrLrM�header_items�szRequest.header_items)N)�__name__�
__module__�__qualname__r��propertyrt�setter�deleterrIr�r�r�r�r�r�r�r�rur�r�rLrLrLrMrCs8�





	

c@sNeZdZdd�Zdd�Zdd�Zdd�Zd	ejfd
d�Z	ddd
�Z
dd�Zd	S)rcCs6dt}d|fg|_g|_i|_i|_i|_i|_dS)N�Python-urllib/%sz
User-agent)�__version__�
addheaders�handlers�handle_open�handle_error�process_response�process_request)r�Zclient_versionrLrLrMr��szOpenerDirector.__init__c	CsTt|d�stdt|���d}t|�D�]}|dkr6q&|�d�}|d|�}||dd�}|�d�r�|�d�|d}||dd�}zt|�}Wntk
r�YnX|j�	|i�}	|	|j|<n>|dkr�|}|j
}	n*|d	kr�|}|j}	n|d
kr&|}|j}	nq&|	�
|g�}
|
�r"t�|
|�n
|
�|�d}q&|�rPt�|j|�|�|�dS)N�
add_parentz%expected BaseHandler instance, got %rF)�redirect_request�do_open�
proxy_open�_rV�errorrG�responseryT)�hasattr�	TypeErrorr��dir�find�
startswithrbrBr�r�r�r�r��
setdefault�bisectZinsortrar�r�)r��handlerZadded�meth�i�protocolZ	condition�j�kind�lookupr�rLrLrM�add_handler�sL
�


zOpenerDirector.add_handlercCsdSrNrLr�rLrLrM�close�szOpenerDirector.closec	Gs<|�|d�}|D]&}t||�}||�}|dk	r|SqdS)NrL)r�r�)	r��chainr��	meth_name�argsr�r��funcrkrLrLrM�_call_chain�s
zOpenerDirector._call_chainNc
Cs�t|t�rt||�}n|}|dk	r(||_||_|j}|d}|j�|g�D]}t||�}||�}qJt	�
d|j|j|j|�
��|�||�}	|d}|j�|g�D]}t||�}|||	�}	q�|	S)NZ_requestzurllib.RequestZ	_response)�
isinstance�strrrIrJr�r�r�r��sys�auditrtrir��_openr�)
r��fullurlrIrJ�reqr�r�Z	processorr�r�rLrLrMrG�s$



zOpenerDirector.opencCsP|�|jdd|�}|r|S|j}|�|j||d|�}|r>|S|�|jdd|�S)Nr�Zdefault_openr��unknown�unknown_open)r�r�r�)r�r�rIrkr�rLrLrMr�s$
���
�zOpenerDirector._opencGs~|dkr,|jd}|d}d|}d}|}n|j}|d}d}|||f|}|j|�}|r^|S|rz|dd	f|}|j|�SdS)
N��httpr�r�r:z
http_error_%srVZ_errorrr��http_error_default)r�r�)r��protor��dictr�Zhttp_errZ	orig_argsrkrLrLrMr�&s 

zOpenerDirector.error)N)r�r�r�r�r�r�r��socket�_GLOBAL_DEFAULT_TIMEOUTrGr�r�rLrLrLrMr�s/
c	Gs�t�}ttttttttt	g	}t
tjd�r2|�
t�t�}|D]B}|D]8}t|t�rht||�r||�|�qDt||�rD|�|�qDq<|D]}|�|�q�|D]}|�|��q�|D]}t|t�r�|�}|�|�q�|S)a*Create an opener object from a list of handlers.

    The opener will use several default handlers, including support
    for HTTP, FTP and when applicable HTTPS.

    If any of the handlers passed as arguments are subclasses of the
    default handlers, the default handlers will not be used.
    �HTTPSConnection)rrr.r)rrr+r*r/r-r�r��clientrarE�setr�r��
issubclass�add�remover�)r�rKZdefault_classes�skip�klassZcheck�hrLrLrMr2?s8	�




c@s(eZdZdZdd�Zdd�Zdd�ZdS)	r��cCs
||_dSrN)�parent)r�r�rLrLrMr�fszBaseHandler.add_parentcCsdSrNrLr�rLrLrMr�iszBaseHandler.closecCst|d�sdS|j|jkS)N�
handler_orderT)r�r�)r��otherrLrLrM�__lt__ms
zBaseHandler.__lt__N)r�r�r�r�r�r�r�rLrLrLrMrcsc@s eZdZdZdZdd�ZeZdS)r/zProcess HTTP error responses.i�cCsH|j|j|��}}}d|kr,dksDn|j�d|||||�}|S)N���,r�)�code�msgrZr�r�)r�ryr�r�r�r�rLrLrM�
http_responsezs�z HTTPErrorProcessor.http_responseN)r�r�r��__doc__r�r��https_responserLrLrLrMr/vsc@seZdZdd�ZdS)rcCst|j||||��dSrN)rrt)r�r�rhr�r�r�rLrLrMr��sz*HTTPDefaultErrorHandler.http_error_defaultN)r�r�r�r�rLrLrLrMr�sc@s4eZdZdZdZdd�Zdd�ZeZZZ	dZ
dS)	r��
c	st|��}|dkr|dks:|dkr(|dks:t|j||||��|�dd�}d��fdd	�|j��D�}t|||jd
d�S)a�Return a Request or None in response to a redirect.

        This is called by the http_error_30x methods when a
        redirection response is received.  If a redirection should
        take place, return a new Request to allow http_error_30x to
        perform the redirect.  Otherwise, raise HTTPError if no-one
        else should try to handle this url.  Return None if you can't
        but another Handler might.
        )�-�.�/i3)r�ZHEAD)r�r�r�r�� z%20)rTzcontent-typecs"i|]\}}|���kr||�qSrL)rx��.0�k�v�ZCONTENT_HEADERSrLrM�
<dictcomp>�s�z8HTTPRedirectHandler.redirect_request.<locals>.<dictcomp>T)rir�r�)r�rrt�replacerirrr�)	r�r�rhr�r�ri�newurl�mZ
newheadersrLrrMr��s
���z$HTTPRedirectHandler.redirect_requestc
CsLd|kr|d}nd|kr$|d}ndSt|�}|jdkrRt||d||f||��|jsn|jrnt|�}d|d<t|�}t|dtj	d�}t
|j|�}|�||||||�}|dkr�dSt
|d	��r|j}	|_|	�|d
�|jks�t|	�|jk�rt|j||j|||��ni}	|_|_|	�|d
�d|	|<|��|��|jj||jd�S)
N�location�uri�r�r��ftprrz+%s - Redirection to url '%s' is not allowed�/r:z
iso-8859-1)�encoding�safe�
redirect_dictrrV�rJ)r�schemerr\Znetlocr�rr	�stringZpunctuationrrtr�r�r
r��max_repeatsrd�max_redirections�inf_msgrcr�r�rGrJ)
r�r�rhr�r�rir�urlparts�newZvisitedrLrLrM�http_error_302�sT



����z"HTTPRedirectHandler.http_error_302zoThe HTTP server returned a redirect error that would lead to an infinite loop.
The last 30x error message was:
N)r�r�r�rrr�r�http_error_301�http_error_303�http_error_307rrLrLrLrMr�s&<c
Cs�t|�\}}|�d�s d}|}nZ|�d�s6td|��d|krV|�d�}|�d|�}n|�dd�}|dkrnd}|d|�}t|�\}}|dk	r�t|�\}}	nd}}	|||	|fS)aReturn (scheme, user, password, host/port) given a URL or an authority.

    If a URL is supplied, it must have an authority (host:port) component.
    According to RFC 3986, having an authority component means the URL must
    have two slashes after the scheme.
    r
N�//zproxy URL with no authority: %r�@r:rS)rr�rBr�rr)
�proxyrZr_scheme�	authorityZhost_separator�endZuserinfo�hostport�user�passwordrLrLrM�_parse_proxy�s$


r"c@s"eZdZdZddd�Zdd�ZdS)r�dNcCsP|dkrt�}||_|��D].\}}|��}t|d||||jfdd��qdS)Nz%s_opencSs||||�SrNrL)�rrr�r�rLrLrM�<lambda>)sz'ProxyHandler.__init__.<locals>.<lambda>)r5�proxiesrrx�setattrr�)r�r&r�rHrLrLrMr�!s
�zProxyHandler.__init__cCs�|j}t|�\}}}}|dkr"|}|jr6t|j�r6dS|rv|rvdt|�t|�f}	t�|	����d�}
|�	dd|
�t|�}|�
||�||ks�|dkr�dS|jj||j
d�SdS)N�%s:%s�ascii�Proxy-authorization�Basic r�r)r�r"rz�proxy_bypassr
�base64�	b64encode�encode�decoder�r�r�rGrJ)r�r�rr�Z	orig_typeZ
proxy_typer r!rZ	user_passZcredsrLrLrMr�,s"�zProxyHandler.proxy_open)N)r�r�r�r�r�r�rLrLrLrMrs
c@s6eZdZdd�Zdd�Zdd�Zd
dd	�Zd
d�ZdS)r cCs
i|_dSrN)�passwdr�rLrLrMr�JszHTTPPasswordMgr.__init__cs\t|t�r|g}|�jkr$i�j|<dD].�t��fdd�|D��}||f�j||<q(dS)N�TFc3s|]}��|��VqdSrN)�
reduce_uri)r��u��default_portr�rLrM�	<genexpr>Tsz/HTTPPasswordMgr.add_password.<locals>.<genexpr>)r�r�r1�tuple)r��realmrr r1�reduced_urirLr5rM�add_passwordMs


�zHTTPPasswordMgr.add_passwordc	Cs`|j�|i�}dD]H}|�||�}|��D].\}}|D] }|�||�r6|Sq6q*qdS)Nr2�NN)r1r�r3r�	is_suburi)	r�r9�authuriZdomainsr6�reduced_authuriZurisZauthinforrLrLrM�find_user_passwordXsz"HTTPPasswordMgr.find_user_passwordTc
Cs�t|�}|dr.|d}|d}|dp*d}nd}|}d}t|�\}}|r~|dkr~|dk	r~ddd��|�}	|	dk	r~d	||	f}||fS)
z@Accept authority or URI and extract only the authority and path.rVrr:r
N�Pi�r�z%s:%d)rr
r�)
r�rr6�partsrrr\rz�portZdportrLrLrMr3bs$��zHTTPPasswordMgr.reduce_uricCsN||krdS|d|dkr dS|d}|dd�dkr@|d7}|d�|�S)zcCheck if test is below base in a URI tree

        Both args must be URIs in reduced form.
        TrFrVrSNr
)r�)r��base�test�prefixrLrLrMr=yszHTTPPasswordMgr.is_suburiN)T)r�r�r�r�r;r@r3r=rLrLrLrMr Hs


c@seZdZdd�ZdS)r!cCs0t�|||�\}}|dk	r"||fSt�|d|�SrN)r r@)r�r9r>r r!rLrLrMr@�s�z2HTTPPasswordMgrWithDefaultRealm.find_user_passwordN)r�r�r�r@rLrLrLrMr!�scs<eZdZ�fdd�Zd
�fdd�	Zddd�Zdd	�Z�ZS)r"csi|_t�j||�dSrN)�
authenticated�superr��r�r��kwargs��	__class__rLrMr��sz%HTTPPasswordMgrWithPriorAuth.__init__Fcs<|�||�|dk	r&t��d|||�t��||||�dSrN)�update_authenticatedrHr;)r�r9rr r1�is_authenticatedrKrLrMr;�sz)HTTPPasswordMgrWithPriorAuth.add_passwordcCs>t|t�r|g}dD]$}|D]}|�||�}||j|<qqdS�Nr2)r�r�r3rG)r�rrNr6r4r:rLrLrMrM�s
z1HTTPPasswordMgrWithPriorAuth.update_authenticatedcCsDdD]:}|�||�}|jD]"}|�||�r|j|SqqdSrO)r3rGr=)r�r>r6r?rrLrLrMrN�s

z-HTTPPasswordMgrWithPriorAuth.is_authenticated)F)F)r�r�r�r�r;rMrN�
__classcell__rLrLrKrMr"�s

c@sTeZdZe�dej�Zddd�Zdd�Zdd�Z	d	d
�Z
dd�Zd
d�ZeZ
eZdS)r#z1(?:^|,)[ 	]*([^ 	,]+)[ 	]+realm=(["']?)([^"']*)\2NcCs"|dkrt�}||_|jj|_dSrN)r r1r;)r�Zpassword_mgrrLrLrMr��sz!AbstractBasicAuthHandler.__init__ccspd}tj�|�D]6}|��\}}}|dkr8t�dtd�||fVd}q|sl|r^|��d}nd}|dfVdS)NF)�"�'zBasic Auth Realm was unquoted�Trrr)r#�rx�finditer�groupsr?r@�UserWarning�split)r��headerZfound_challengeZmorr	r9rLrLrM�_parse_realm�s�
z%AbstractBasicAuthHandler._parse_realmc	Cs~|�|�}|sdSd}|D]H}|�|�D]8\}}|��dkrB|}q(|dk	r(|�|||�Sq(q|dk	rztd|f��dS)N�basiczBAbstractBasicAuthHandler does not support the following scheme: %r)Zget_allrZrx�retry_http_basic_authrB)	r��authreqrzr�riZunsupportedrYrr9rLrLrM�http_error_auth_reqed�s
�z.AbstractBasicAuthHandler.http_error_auth_reqedcCs||j�||�\}}|dk	rtd||f}dt�|����d�}|�|jd�|krTdS|�|j|�|j	j
||jd�SdSdS)Nr(r+r)r)r1r@r-r.r/r0ru�auth_headerr�r�rGrJ)r�rzr�r9r �pw�raw�authrLrLrMr\�sz.AbstractBasicAuthHandler.retry_http_basic_authcCstt|jd�r|j�|j�s|S|�d�sp|j�d|j�\}}d�||���}t�	|��
�}|�dd�|����|S)NrN�
Authorizationz{0}:{1}zBasic {})
r�r1rNrtr�r@r�r/r-Zstandard_b64encoder0r��strip)r�r�r r1ZcredentialsZauth_strrLrLrM�http_requests�
�z%AbstractBasicAuthHandler.http_requestcCsLt|jd�rHd|jkr"dkr8nn|j�|jd�n|j�|jd�|S)NrNr�r�TF)r�r1r�rMrt)r�r�r�rLrLrMr�s
z&AbstractBasicAuthHandler.http_response)N)r�r�r��re�compile�IrTr�rZr^r\rer��
https_requestr�rLrLrLrMr#�s�

c@seZdZdZdd�ZdS)r$rccCs|j}|�d|||�}|S)N�www-authenticate)rtr^)r�r�rhr�r�rirHr�rLrLrM�http_error_401$s�z#HTTPBasicAuthHandler.http_error_401N)r�r�r�r_rkrLrLrLrMr$ sc@seZdZdZdd�ZdS)r%r*cCs|j}|�d|||�}|S�N�proxy-authenticate)rzr^)r�r�rhr�r�rirr�rLrLrM�http_error_407/s�z$ProxyBasicAuthHandler.http_error_407N)r�r�r�r_rnrLrLrLrMr%+sc@sNeZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dS)r&NcCs4|dkrt�}||_|jj|_d|_d|_d|_dS�Nr)r r1r;�retried�nonce_count�
last_nonce)r�r1rLrLrMr�Is
z"AbstractDigestAuthHandler.__init__cCs
d|_dSro)rpr�rLrLrM�reset_retry_countRsz+AbstractDigestAuthHandler.reset_retry_countcCs||�|d�}|jdkr*t|jdd|d��n|jd7_|rx|��d}|��dkr`|�||�S|��dkrxtd|��dS)	N�i�zdigest auth failedrVrZdigestr[zEAbstractDigestAuthHandler does not support the following scheme: '%s')r�rprrtrXrx�retry_http_digest_authrB)r�r_rzr�rir]rrLrLrMr^Us

��z/AbstractDigestAuthHandler.http_error_auth_reqedcCsz|�dd�\}}ttdt|���}|�||�}|rvd|}|j�|jd�|krRdS|�|j|�|j	j
||jd�}|SdS)Nr�rVz	Digest %sr)rX�parse_keqv_list�filter�parse_http_list�get_authorizationrir�r_r�r�rGrJ)r�r�rb�tokenZ	challenge�chalZauth_valZresprLrLrMruisz0AbstractDigestAuthHandler.retry_http_digest_authcCs@d|j|t��f}|�d�td�}t�|���}|dd�S)Nz	%s:%s:%s:r)��)rq�time�ctimer/�_randombytes�hashlib�sha1�	hexdigest)r��nonce�s�b�digrLrLrM�
get_cnonceusz$AbstractDigestAuthHandler.get_cnoncecCs�z6|d}|d}|�d�}|�dd�}|�dd�}Wntk
rLYdSX|�|�\}}	|dkrhdS|j�||j�\}
}|
dkr�dS|jdk	r�|�|j|�}nd}d|
||f}
d|��|j	f}|dkr�|	||
�d|||�f�}n~d	|�
d
�k�r\||jk�r|jd7_nd|_||_d|j}|�
|�}d
|||d	||�f}|	||
�|�}ntd|��d|
|||j	|f}|�r�|d|7}|�r�|d|7}|d|7}|�r�|d||f7}|S)Nr9r��qop�	algorithm�MD5�opaquez%s:%s:%sr(rb�,rVz%08xz%s:%s:%s:%s:%szqop '%s' is not supported.z>username="%s", realm="%s", nonce="%s", uri="%s", response="%s"z
, opaque="%s"z
, digest="%s"z, algorithm="%s"z, qop=auth, nc=%s, cnonce="%s")r��KeyError�get_algorithm_implsr1r@rtrI�get_entity_digestr�r�rXrrrqr�r)r�r�r{r9r�r�r�r��H�KDr r`ZentdigZA1ZA2ZrespdigZncvalueZcnonceZnoncebitrDrLrLrMry�s\

�


��z+AbstractDigestAuthHandler.get_authorizationcsD|dkrdd��n|dkr$dd��ntd|���fdd�}�|fS)Nr�cSst�|�d����S�Nr))r�Zmd5r/r���xrLrLrMr%��z?AbstractDigestAuthHandler.get_algorithm_impls.<locals>.<lambda>ZSHAcSst�|�d����Sr�)r�r�r/r�r�rLrLrMr%�r�z.Unsupported digest authentication algorithm %rcs�d||f�S)Nr(rL)r��d�r�rLrMr%�r�)rB)r�r�r�rLr�rMr��s

�z-AbstractDigestAuthHandler.get_algorithm_implscCsdSrNrL)r�rIr{rLrLrMr��sz+AbstractDigestAuthHandler.get_entity_digest)N)r�r�r�r�rsr^rur�ryr�r�rLrLrLrMr&>s
	>
c@s eZdZdZdZdZdd�ZdS)r'z�An authentication protocol defined by RFC 2069

    Digest authentication improves on basic authentication because it
    does not transmit passwords in the clear.
    rc��cCs*t|j�d}|�d|||�}|��|S)NrVrj)rrtr^rs�r�r�rhr�r�rirz�retryrLrLrMrk�s�z$HTTPDigestAuthHandler.http_error_401N)r�r�r�r�r_r�rkrLrLrLrMr'�sc@seZdZdZdZdd�ZdS)r(�Proxy-Authorizationr�cCs"|j}|�d|||�}|��|Srl)rzr^rsr�rLrLrMrn�s�z%ProxyDigestAuthHandler.http_error_407N)r�r�r�r_r�rnrLrLrLrMr(�sc@s6eZdZd
dd�Zdd�Zdd�Zdd	�Zd
d�ZdS)�AbstractHTTPHandlerrcCs
||_dSrN��_debuglevel)r��
debuglevelrLrLrMr��szAbstractHTTPHandler.__init__cCs
||_dSrNr�)r��levelrLrLrM�set_http_debuglevel�sz'AbstractHTTPHandler.set_http_debuglevelcCstjj�|j|���SrN)r�r��HTTPConnection�_get_content_lengthrIr��r�ryrLrLrMr��s�z'AbstractHTTPHandler._get_content_lengthcCs|j}|std��|jdk	r�|j}t|t�r8d}t|��|�d�sN|�dd�|�d�s�|�d�s�|�|�}|dk	r�|�dt|��n|�dd�|}|�	�r�t
|j�\}}t|�\}}	|�d�s�|�d|�|j
jD]&\}
}|
��}
|�|
�s�|�|
|�q�|S)	N�
no host givenz\POST data should be bytes, an iterable of bytes, or a file object. It cannot be of type str.zContent-type�!application/x-www-form-urlencodedr��Transfer-encodingZchunkedrs)rzrrIr�r�r�r�r�r�r�rr�rr�r�r�)r�ryrzrIr�Zcontent_lengthZsel_hostrZselZsel_pathr_r�rLrLrM�do_request_�sJ


�
�
��

zAbstractHTTPHandler.do_request_c

sT|j}|std��||fd|ji|��}|�|j�t|j�����fdd�|j�	�D��d�d<dd���	�D��|j
r�i}d}|�kr��|||<�|=|j|j
|d	�z`z&|j|�
�|j|j�|�d
�d�Wn,tk
�r}zt|��W5d}~XYnX|��}	Wn|���YnX|j�r>|j��d|_|��|	_|	j|	_|	S)
z�Return an HTTPResponse object for the request, using http_class.

        http_class must implement the HTTPConnection API from http.client.
        r�rJcsi|]\}}|�kr||�qSrLrLr��rirLrMr/s�z/AbstractHTTPHandler.do_open.<locals>.<dictcomp>r��
ConnectioncSsi|]\}}|��|�qSrL)�title)r�r_r�rLrLrMr<sr�r�r�)Zencode_chunkedN)rzrrJZset_debuglevelr�r�r|�updaterirr~Z
set_tunnelryr�r�rIr�rq�getresponser�Zsockr�rH�reasonr�)
r�Z
http_classr�Zhttp_conn_argsrzr�Ztunnel_headersZproxy_auth_hdr�errr$rLr�rMr�!sB
�


zAbstractHTTPHandler.do_openN)r)r�r�r�r�r�r�r�r�rLrLrLrMr��s

&r�c@seZdZdd�ZejZdS)r)cCs|�tjj|�SrN)r�r�r�r��r�r�rLrLrM�	http_openfszHTTPHandler.http_openN)r�r�r�r�r�r�rerLrLrLrMr)dsr�c@s$eZdZddd�Zdd�ZejZdS)rErNcCst�||�||_||_dSrN)r�r��_context�_check_hostname)r�r�r>�check_hostnamerLrLrMr�oszHTTPSHandler.__init__cCs|jtjj||j|jd�S)N)r>r�)r�r�r�r�r�r�r�rLrLrM�
https_opents�zHTTPSHandler.https_open)rNN)r�r�r�r�r�r�r�rirLrLrLrMrEms
rEc@s.eZdZddd�Zdd�Zdd�ZeZeZdS)	rNcCs$ddl}|dkr|j��}||_dSro)Zhttp.cookiejar�	cookiejarZ	CookieJar)r�r�r�rLrLrMr�}s
zHTTPCookieProcessor.__init__cCs|j�|�|SrN)r�Zadd_cookie_headerr�rLrLrMre�sz HTTPCookieProcessor.http_requestcCs|j�||�|SrN)r�Zextract_cookies)r�ryr�rLrLrMr��sz!HTTPCookieProcessor.http_response)N)r�r�r�r�rer�rir�rLrLrLrMr|s

c@seZdZdd�ZdS)r.cCs|j}td|��dS)Nzunknown url type: %s)r�r)r�r�r�rLrLrMr��szUnknownHandler.unknown_openN)r�r�r�r�rLrLrLrMr.�scCsNi}|D]@}|�dd�\}}|ddkr@|ddkr@|dd�}|||<q|S)z>Parse list of key=value strings where keys are not duplicated.�=rVrrQrS)rX)�lZparsedZeltr�rrLrLrMrv�s
rvcCs�g}d}d}}|D]l}|r*||7}d}q|rT|dkr>d}qn|dkrJd}||7}q|dkrl|�|�d}q|dkrxd}||7}q|r�|�|�dd�|D�S)	apParse lists as described by RFC 2068 Section 2.

    In particular, parse comma-separated lists where the elements of
    the list may include quoted-strings.  A quoted-string could
    contain a comma.  A non-quoted string could have quotes in the
    middle.  Neither commas nor quotes count if they are escaped.
    Only double-quotes count, not single-quotes.
    rrF�\TrQr�cSsg|]}|���qSrL)rd)r��partrLrLrM�
<listcomp>�sz#parse_http_list.<locals>.<listcomp>)ra)r��resr��escaper	ZcurrLrLrMrx�s4	


rxc@s(eZdZdd�ZdZdd�Zdd�ZdS)r*cCs\|j}|dd�dkrN|dd�dkrN|jrN|jdkrN|j|��krXtd��n
|�|�SdS)Nr:rrSr
�	localhost�-file:// scheme is supported only on localhost)r�rz�	get_namesr�open_local_file)r�r�rHrLrLrM�	file_open�s&�
zFileHandler.file_openNcCs`tjdkrZz*tt�d�dt�t���d�t_Wn$tjk
rXt�d�ft_YnXtjS)Nr�r:)r*�namesr8r��gethostbyname_ex�gethostname�gaierror�
gethostbynamer�rLrLrMr��s
��
zFileHandler.get_namesc
Cs�ddl}ddl}|j}|j}t|�}z�t�|�}|j}|jj	|j
dd�}	|�|�d}
|�d|
pbd||	f�}|r~t
|�\}}|r�|s�t|�|��kr�|r�d||}
nd|}
tt|d�||
�WSWn*tk
r�}zt|��W5d}~XYnXtd��dS)	NrT�Zusegmtz6Content-type: %s
Content-length: %d
Last-modified: %s
�
text/plain�file://�rbzfile not on local host)�email.utils�	mimetypesrzr�r4r[�stat�st_size�utils�
formatdate�st_mtime�
guess_type�message_from_stringr
�_safe_gethostbynamer�rrGrqr)r�r��emailr�rzrfZ	localfile�statsrm�modified�mtyperirCZorigurl�exprLrLrMr��s:
����zFileHandler.open_local_file)r�r�r�r�r�r�r�rLrLrLrMr*�s
cCs*zt�|�WStjk
r$YdSXdSrN)r�r�r�)rzrLrLrMr��sr�c@seZdZdd�Zdd�ZdS)r+c
Cs*ddl}ddl}|j}|s"td��t|�\}}|dkr>|j}nt|�}t|�\}}|rdt|�\}}nd}t	|�}|pvd}|p~d}zt
�|�}Wn*tk
r�}zt|��W5d}~XYnXt
|j�\}	}
|	�d�}ttt	|��}|dd�|d}}|�r|d�s|dd�}z�|�||||||j�}
|�r6d�p8d}|
D]2}t|�\}}|��d	k�r>|d
k�r>|��}�q>|
�||�\}}d}|�|j�d}|�r�|d|7}|dk	�r�|dk�r�|d|7}t�|�}t|||j�WS|jk
�r$}z"td
|�}|�t� �d��W5d}~XYnXdS)Nr�ftp error: no host givenrrr
rSrVrh�Dr���a�Ar�rhr�r�zContent-type: %s
zContent-length: %d
�
ftp error: %rr:)!�ftplibr�rzrr
�FTP_PORTrbrrr
r�r�rqrr�rXr��map�connect_ftprJrrx�upper�retrfiler�rtr�r�r�
all_errors�with_tracebackr��exc_info)r�r�r�r�rzrCr r1r�r\�attrs�dirsrO�fwr��attrr�rh�retrlenrir�r��excrLrLrM�ftp_opens^
�
zFTPHandler.ftp_openc	Cst||||||dd�S)NF)�
persistent)�
ftpwrapper)r�r r1rzrCr�rJrLrLrMr�7s�zFTPHandler.connect_ftpN)r�r�r�r�r�rLrLrLrMr+s5c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)r,cCs"i|_i|_d|_d|_d|_dS)Nr�<r})�cacherJ�soonest�delay�	max_connsr�rLrLrMr�>s
zCacheFTPHandler.__init__cCs
||_dSrN)r�)r��trLrLrM�
setTimeoutEszCacheFTPHandler.setTimeoutcCs
||_dSrN)r�)r�rrLrLrM�setMaxConnsHszCacheFTPHandler.setMaxConnscCsr|||d�|�|f}||jkr4t��|j|j|<n,t||||||�|j|<t��|j|j|<|��|j|S)Nr
)�joinr�r~r�rJr��check_cache)r�r r1rzrCr�rJr�rLrLrMr�Ks

�
zCacheFTPHandler.connect_ftpcCs�t��}|j|krPt|j���D].\}}||kr |j|��|j|=|j|=q tt|j����|_t	|j�|j
kr�t|j���D]&\}}||jkr�|j|=|j|=q�q�tt|j����|_dSrN)r~r�r�rJrr�r��min�valuesrdr�)r�r�r�rrLrLrMr�Vs


zCacheFTPHandler.check_cachecCs0|j��D]}|��q
|j��|j��dSrN)r�r�r��clearrJ)r��connrLrLrM�clear_cachejs

zCacheFTPHandler.clear_cacheN)	r�r�r�r�r�r�r�r�rrLrLrLrMr,;sc@seZdZdd�ZdS)r-cCs~|j}|�dd�\}}|�dd�\}}t|�}|�d�rNt�|�}|dd�}|sVd}t�d|t|�f�}t	t
�|�||�S)N�:rVr�z;base64i�����text/plain;charset=US-ASCIIz$Content-type: %s
Content-length: %d
)rtrXr�endswithr-�decodebytesr�r�rdr�io�BytesIO)r�r�rHrrIZ	mediatyperirLrLrM�	data_openqs



�zDataHandler.data_openN)r�r�r�r	rLrLrLrMr-psr��nt)r4r3cCst|�S)zOS-specific conversion from a relative URL of the 'file' scheme
        to a file system path; not recommended for general use.)r
��pathnamerLrLrMr4�scCst|�S)zOS-specific conversion from a file system path to a relative URL
        of the 'file' scheme; not recommended for general use.)r	rrLrLrMr3�sc@s�eZdZdZdZdeZd*dd�Zdd�Zdd	�Z	d
d�Z
dd
�Zd+dd�Zd,dd�Z
d-dd�Zd.dd�Zdd�Zd/dd�Zd0dd�Zdd�Zer�dd�Zd1d d!�Zd"d#�Zd$d%�Zd&d'�Zd2d(d)�ZdS)3r8a,Class to open URLs.
    This is a class rather than just a subroutine because we may need
    more than one set of global protocol-specific options.
    Note -- this is a base class for those who don't want the
    automatic handling of errors type 302 (relocated) and 401
    (authorization needed).Nr�cKszdd|jji}tj|tdd�|dkr.t�}||_|�d�|_|�d�|_	d|j
fdg|_g|_t
j|_d|_t|_dS)	NzW%(class)s style of invoking requests is deprecated. Use newer urlopen functions/methods�classrS)�
stacklevel�key_file�	cert_filez
User-Agent)ZAcceptz*/*)rLr�r?r@rAr5r&r�rr�versionr��_URLopener__tempfilesr[rp�_URLopener__unlink�	tempcache�ftpcache)r�r&Zx509r�rLrLrMr��s
�zURLopener.__init__cCs|��dSrN)r�r�rLrLrM�__del__�szURLopener.__del__cCs|��dSrN)�cleanupr�rLrLrMr��szURLopener.closec	CsV|jrB|jD](}z|�|�Wqtk
r2YqXq|jdd�=|jrR|j��dSrN)rrrqrr)r�rOrLrLrMr�s
zURLopener.cleanupcGs|j�|�dS)zdAdd a header to be used by the HTTP interface only
        e.g. u.addheader('Accept', 'sound/basic')N)r�ra)r�r�rLrLrM�	addheader�szURLopener.addheaderc
Csptt|��}t|dd�}|jrL||jkrL|j|\}}t|d�}t|||�St|�\}}|s`d}||jkr�|j|}t|�\}}	t|	�\}
}|
|f}nd}d|}||_	|�
dd�}t||�r�|d	kr�|r�|�|||�S|�
||�Sz0|dk�rt||�|�WSt||�||�WSWnVttfk
�r0�Yn<tk
�rj}
ztd
|
��t��d��W5d}
~
XYnXdS)z6Use URLopener().open(file) instead of open(file, 'r').z%/:=&?~#+!$,;'@()*[]|�rr�rONZopen_�-r�r�zsocket errorr:)rrr	rrGrrr&rr�rr��open_unknown_proxy�open_unknownr�rrrqr�r�r�)r�r�rIrfrirh�urltyperHr�	proxyhostrzr�r_r�rLrLrMrG�s<




zURLopener.opencCst|�\}}tdd|��dS)�/Overridable interface to open unknown URL type.�	url errorzunknown url typeN�rrq)r�r�rIr�rHrLrLrMr
szURLopener.open_unknowncCs t|�\}}tdd||��dS)rr zinvalid proxy for %sNr!)r�rr�rIr�rHrLrLrMrszURLopener.open_unknown_proxyc
Cstt|��}|jr&||jkr&|j|St|�\}}|dkr�|rF|dkr�z0|�|�}|��}|��tt|�d�|fWSt	k
r�}	zW5d}	~	XYnX|�
||�}�z<|��}
|r�t
|d�}nrt|�\}}
t|
p�d�\}}
t|
p�d�\}
}t|
p�d�\}
}t
j�|
�d}t�|�\}}|j�|�t
�|d�}z�||
f}|jdk	�rT||j|<d}d}d}d}d	|
k�rzt|
d
�}|�r�||||�|�|�}|�s��q�|t|�7}|�|�|d7}|�r�||||��q�W5|��XW5|��X|dk�r||k�rtd||f|��|S)ztretrieve(url) returns (filename, headers) for a local object
        or (tempfilename, headers) for a remote object.NrOrVrPrrrRrSrrTrUrW)rrrrr�rZr�r4rrqrGrrr[r\�splitextr^Zmkstemprra�fdopenrbrcrdrer)r�rHrfrgrIr�Zurl1rhr�r�rirjZgarbager\�suffix�fdrkrlrmrcrnrorLrLrM�retrievesn






��zURLopener.retrievecCs$d}d}t|t�r<t|�\}}|r6t|�\}}t|�}|}nt|\}}t|�\}}t|�\}	}
|
}d}|	��dkrvd}n:t|
�\}}
|r�t|�\}}|r�d|	||
f}t|�r�|}|s�tdd��|r�t|�}t	�
|����d�}nd}|�rt|�}t	�
|����d�}nd}||�}
i}|�r*d||d<|�r<d||d	<|�rJ||d
<d|d<|j
D]\}}|||<�qX|dk	�r�d
|d<|
�d|||�n|
jd||d�z|
��}Wn"tjjk
�r�td��YnXd|jk�r�dk�rnnt||jd||j�S|�||j|j|j|j|�SdS)a�Make an HTTP connection using connection_class.

        This is an internal method that should be called from
        open_http() or open_https().

        Arguments:
        - connection_factory should take a host name and return an
          HTTPConnection instance.
        - url is the url to retrieval or a host, relative-path pair.
        - data is payload for a POST request or None.
        Nr�z	%s://%s%sz
http errorr�r)zBasic %sr�rcrsr�r�r�zContent-Typer�r�r�z$http protocol error: bad status liner�r��http:)r�r�rrr
rrxr,rqr-r.r/r0r�ryr�r�r�Z
BadStatusLinerZstatusrr��
http_errorrhr�)r�Zconnection_factoryrHrIZuser_passwdZproxy_passwdrzr�Zrealhostrr�Z
proxy_authrbZ	http_connrirYr�r�rLrLrM�_open_generic_httpVs~



��zURLopener._open_generic_httpcCs|�tjj||�S)zUse HTTP protocol.)r)r�r�r��r�rHrIrLrLrM�	open_http�szURLopener.open_httpc
Csbd|}t||�rPt||�}|dkr6||||||�}	n|||||||�}	|	rP|	S|�|||||�S)z�Handle http errors.

        Derived class can override this, or provide specific handlers
        named http_error_DDD where DDD is the 3-digit error code.z
http_error_%dN)r�r�r�)
r�rHrh�errcode�errmsgrirIr_r�rkrLrLrMr(�s

zURLopener.http_errorcCs|��t||||d��dS)z>Default error handler: close the connection and raise OSError.N)r�r�r�rHrhr,r-rirLrLrMr��szURLopener.http_error_defaultcCstjj||j|jd�S)N)rr)r�r�r�rr)r�rzrLrLrM�_https_connection�s�zURLopener._https_connectioncCs|�|j||�S)zUse HTTPS protocol.)r)r/r*rLrLrM�
open_https�szURLopener.open_httpscCs^t|t�std��|dd�dkrP|dd�dkrP|dd���dkrPtd	��n
|�|�SdS)
z/Use local file or FTP depending on form of URL.zEfile error: proxy support for file protocol currently not implementedNr:rrSr
�z
localhost/r�)r�r�rrxrBr�r�rLrLrM�	open_file�s

4
zURLopener.open_filec
Cs\ddl}ddl}t|�\}}t|�}zt�|�}Wn0tk
rb}zt|j|j	��W5d}~XYnX|j
}	|jj|j
dd�}
|�|�d}|�d|p�d|	|
f�}|s�|}
|dd�dkr�d	|}
tt|d
�||
�St|�\}}|�sPt�|�t�ft�k�rP|}
|dd�dk�r d	|}
n|dd�dk�r>td
|��tt|d
�||
�Std��dS)zUse local file.rNTr�z6Content-Type: %s
Content-Length: %d
Last-modified: %s
r�rVr
r�r�r:z./zAlocal file url may start with / or file:. Unknown url of type: %sz#local file error: not on local host)r�r�rr4r[r�rqr�strerrorrfr�r�r�r�r�r�rrGr
r�r�r��thishostrB)r�rHr�r�rzrOZ	localnamer��ermr�r�riZurlfilerCrLrLrMr��s@ ���
zURLopener.open_local_filec
Cs�t|t�std��ddl}t|�\}}|s2td��t|�\}}t|�\}}|r\t|�\}}nd}t|�}t|ppd�}t|p|d�}t	�
|�}|s�ddl}|j}nt
|�}t|�\}}	t|�}|�d�}
|
dd�|
d}
}|
r�|
ds�|
dd�}
|
�r
|
d�s
d|
d<|||d�|
�f}t|j�tk�rbt|j�D]*}
|
|k�r6|j|
}|j|
=|���q6z�||jk�r�t|||||
�|j|<|�s�d	}nd
}|	D]2}t|�\}}|��dk�r�|dk�r�|��}�q�|j|�||�\}}|�d
|�d}d}|�r|d|7}|dk	�r,|dk�r,|d|7}t�|�}t||d
|�WSt�k
�r�}ztd|�� t!�"�d��W5d}~XYnXdS)zUse FTP protocol.zCftp error: proxy support for ftp protocol currently not implementedrNr�rrr
rSrVr�rhr�r�zftp:zContent-Type: %s
zContent-Length: %d
zftp error %rr:)#r�r�rr�rr
rrr
r�r�r�r�rbrrXr�rdr�MAXFTPCACHEr�r�r�rrxr�r�r�r�r�r�	ftperrorsr�r�r�)r�rHr�rzr\rCr r1r�r�r�rOr�r�rr�r�r�rhr�r�rir�rLrLrM�open_ftp�st




��
zURLopener.open_ftpc	
Cs<t|t�std��z|�dd�\}}Wntk
rDtdd��YnX|sNd}|�d�}|dkr�d	||d
�kr�||dd
�}|d
|�}nd}g}|�dt�	d
t�
t�����|�d|�|dkr�t�|�
d���d�}nt|�}|�dt|��|�d�|�|�d�|�}t�|�}t�|�}t|||�S)zUse "data" URL.zEdata error: proxy support for data protocol currently not implementedr�rVz
data errorzbad data URLr�;rr�NrrzDate: %sz%a, %d %b %Y %H:%M:%S GMTzContent-type: %sr-r)zlatin-1zContent-Length: %d�
)r�r�rrXrBrq�rfindrar~�strftime�gmtimer-rr/r0r
rdr�r�r�r�StringIOr)	r�rHrIr�Zsemirr�ri�frLrLrM�	open_data8s8

�




zURLopener.open_data)N)N)N)N)NNN)N)N)N)N)r�r�r�r�rr�rr�rr�rrrGrrr&r)r+r(r�rCr/r0r2r�r8r@rLrLrLrMr8�s.

$


A\


	 :c@s�eZdZdZdd�Zdd�Zd#dd�Zd	d
�Zd$dd�Zd%d
d�Z	d&dd�Z
d'dd�Zd(dd�Zd)dd�Z
d*dd�Zd+dd�Zd,dd�Zd-dd �Zd!d"�ZdS).r9z?Derived class with handlers for errors we can handle (perhaps).cOs(tj|f|�|�i|_d|_d|_dS)Nrr�)r8r��
auth_cache�tries�maxtriesrIrLrLrMr�eszFancyURLopener.__init__cCst||d||�S)z3Default error handling -- don't raise an exception.r')rr.rLrLrMr�ksz!FancyURLopener.http_error_defaultNc	Csv|jd7_zZ|jrN|j|jkrNt|d�r4|j}n|j}|||dd|�W�S|�||||||�}|W�Sd|_XdS)z%Error 302 -- relocated (temporarily).rVr�http_error_500r�z)Internal Server Error: Redirect RecursionN)rBrCr�rDr��redirect_internal)	r�rHrhr,r-rirIr�rkrLrLrMros 
��zFancyURLopener.http_error_302c	Csxd|kr|d}nd|kr$|d}ndS|��t|jd||�}t|�}|jdkrnt|||d|||��|�|�S)Nrrrrz( Redirection to url '%s' is not allowed.)r�rr�rrrrG)	r�rHrhr,r-rirIrrrLrLrMrE�s"


��z FancyURLopener.redirect_internalcCs|�||||||�S)z*Error 301 -- also relocated (permanently).�r�r�rHrhr,r-rirIrLrLrMr�szFancyURLopener.http_error_301cCs|�||||||�S)z;Error 303 -- also relocated (essentially identical to 302).rFrGrLrLrMr�szFancyURLopener.http_error_303cCs2|dkr|�||||||�S|�|||||�SdS)z1Error 307 -- relocated, but turn POST into error.N)rr�rGrLrLrMr�szFancyURLopener.http_error_307Fc
Cs�d|krt�||||||�|d}t�d|�}	|	sHt�||||||�|	��\}
}|
��dkrtt�||||||�|s�t�||||||�d|jd}|dkr�t||�||�St||�|||�SdS)z_Error 401 -- authentication required.
        This function supports Basic authentication only.rj�![ 	]*([^ 	]+)[ 	]+realm="([^"]*)"r[Zretry_�_basic_authN�r8r�rf�matchrVrxr�r��
r�rHrhr,r-rirIr�ZstuffrKrr9r_rLrLrMrk�s:
�
�
��zFancyURLopener.http_error_401c
Cs�d|krt�||||||�|d}t�d|�}	|	sHt�||||||�|	��\}
}|
��dkrtt�||||||�|s�t�||||||�d|jd}|dkr�t||�||�St||�|||�SdS)zeError 407 -- proxy authentication required.
        This function supports Basic authentication only.rmrHr[Zretry_proxy_rINrJrLrLrLrMrn�s:
�
�
��zFancyURLopener.http_error_407cCs�t|�\}}d||}|jd}t|�\}}	t|	�\}	}
|	�d�d}|	|d�}	|�|	||�\}}
|sr|
srdSdt|dd�t|
dd�|	f}	d|	|
|jd<|dkr�|�|�S|�||�SdS)N�http://r�rrV�%s:%s@%srrr�rr&rr��get_user_passwdr	rG�r�rHr9rIrzr�rrrrZ
proxyselectorr�r r1rLrLrM�retry_proxy_http_basic_auth�s$

�
z*FancyURLopener.retry_proxy_http_basic_authcCs�t|�\}}d||}|jd}t|�\}}	t|	�\}	}
|	�d�d}|	|d�}	|�|	||�\}}
|sr|
srdSdt|dd�t|
dd�|	f}	d|	|
|jd<|dkr�|�|�S|�||�SdS)N�https://r�rrVrNrrrrOrQrLrLrM�retry_proxy_https_basic_auth�s$

�
z+FancyURLopener.retry_proxy_https_basic_authc
Cs�t|�\}}|�d�d}||d�}|�|||�\}}|sD|sDdSdt|dd�t|dd�|f}d||}	|dkr�|�|	�S|�|	|�SdS)NrrVrNrrrrM�rr�rPr	rG�
r�rHr9rIrzr�r�r r1rrLrLrMr\	s
�
z$FancyURLopener.retry_http_basic_authc
Cs�t|�\}}|�d�d}||d�}|�|||�\}}|sD|sDdSdt|dd�t|dd�|f}d||}	|dkr�|�|	�S|�|	|�SdS)NrrVrNrrrrSrUrVrLrLrM�retry_https_basic_auth	s
�
z%FancyURLopener.retry_https_basic_authrcCs`|d|��}||jkr2|r(|j|=n
|j|S|�||�\}}|sJ|rX||f|j|<||fS)Nr)rxrA�prompt_user_passwd)r�rzr9rr�r r1rLrLrMrP	s


zFancyURLopener.get_user_passwdcCsXddl}z.td||f�}|�d|||f�}||fWStk
rRt�YdSXdS)z#Override this in a GUI environment!rNzEnter username for %s at %s: z#Enter password for %s in %s at %s: r<)�getpass�input�KeyboardInterrupt�print)r�rzr9rYr r1rLrLrMrX)	s�
z!FancyURLopener.prompt_user_passwd)N)N)N)N)NF)NF)N)N)N)N)r)r�r�r�r�r�r�rrErrrrkrnrRrTr\rWrPrXrLrLrLrMr9bs(



�
�





cCstdkrt�d�atS)z8Return the IP address of the magic hostname 'localhost'.Nr�)�
_localhostr�r�rLrLrLrMr�9	s
r�cCsPtdkrLztt�t���d�aWn(tjk
rJtt�d�d�aYnXtS)z,Return the IP addresses of the current host.Nr:r�)�	_thishostr8r�r�r�r�rLrLrLrMr4A	sr4cCstdkrddl}|jatS)z1Return the set of errors raised by the FTP class.Nr)�
_ftperrorsr�r�)r�rLrLrMr7L	sr7cCstdkrt�d�atS)z%Return an empty email Message object.Nrr)�
_noheadersr�r�rLrLrLrM�	noheadersU	s
rac@sJeZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dS)r�z;Class used by open_ftp() for cache of open FTP connections.NTcCsX||_||_||_||_||_||_d|_||_z|��Wn|�	��YnXdSro)
r r1rzrCr�rJ�refcount�	keepalive�initr�)r�r r1rzrCr�rJr�rLrLrMr�b	szftpwrapper.__init__cCs\ddl}d|_|��|_|j�|j|j|j�|j�|j	|j
�d�|j�}|j�
|�dS)Nrr
)r��busyZFTPr	ZconnectrzrCrJZloginr r1r�r��cwd)r�r�Z_targetrLrLrMrdr	s
zftpwrapper.initc
Cs�ddl}|��|dkr"d}d}nd|}d}z|j�|�Wn*|jk
rh|��|j�|�YnXd}|r�|s�zd|}|j�|�\}}WnR|jk
r�}z2t|�dd�dkr�t	d	|��
t��d
��W5d}~XYnX|�s�|j�d�|�rl|j�
�}	zJz|j�|�Wn4|jk
�rN}zt	d	|�|�W5d}~XYnXW5|j�|	�Xd|}nd}|j�|�\}}d|_t|�d
�|j�}
|jd7_|��|
|fS)Nr)r�r�zTYPE ArVzTYPE zRETR rSZ550r�r:zLIST ZLISTr�)r��endtransferr	Zvoidcmdr�rdZntransfercmdZ
error_permr�rr�r�r��pwdrfrerZmakefile�
file_closerbr�)r�rOr�r��cmd�isdirrr�r�rhZftpobjrLrLrMr�{	sP
�
$
zftpwrapper.retrfilecCs
d|_dSro)rer�rLrLrMrg�	szftpwrapper.endtransfercCsd|_|jdkr|��dS)NFr)rcrb�
real_closer�rLrLrMr��	s
zftpwrapper.closecCs2|��|jd8_|jdkr.|js.|��dS)NrVr)rgrbrcrlr�rLrLrMri�	szftpwrapper.file_closecCs2|��z|j��Wnt�k
r,YnXdSrN)rgr	r�r7r�rLrLrMrl�	s
zftpwrapper.real_close)NT)r�r�r�r�r�rdr�rgr�rirlrLrLrLrMr�_	s�
	-r�cCs�i}tj��D]4\}}|��}|r|dd�dkr|||dd�<qdtjkrZ|�dd�tj��D]J\}}|dd�dkrd|��}|r�|||dd�<qd|�|dd�d�qd|S)aReturn a dictionary of scheme -> proxy server URL mappings.

    Scan the environment for variables named <scheme>_proxy;
    this seems to be the standard convention.  If you need a
    different way, you can pass a proxies dictionary to the
    [Fancy]URLopener constructor.

    i����N�_proxyZREQUEST_METHODr�)r[�environrrxr�)r&r_r�rLrLrM�getproxies_environment�	s	
rocCs�|dkrt�}z|d}Wntk
r0YdSX|dkr>dS|��}t|�\}}|�d�D]Z}|��}|r\|�d�}|��}||ks�||kr�dSd|}|�|�s�|�|�r\dSq\dS)z�Test if proxies should not be used for a particular host.

    Checks the proxy dict for the value of no_proxy, which should
    be a list of comma separated DNS suffixes, or '*' for all hosts.

    NZnoF�*Tr��.)ror�rxr
rXrd�lstripr)rzr&Zno_proxy�hostonlyrCr_rLrLrM�proxy_bypass_environment�	s*
rtc	Cs0ddlm}t|�\}}dd�}d|kr4|dr4dSd}|�d	d
�D]�}|sNqDt�d|�}|dk	�r|dkr�zt�|�}||�}Wntk
r�YqDYnX||�d��}	|�d
�}
|
dkr�d|�d��	d�d}
nt
|
dd��}
|
dksD|
dkr�qDd|
}
||
?|	|
?k�r*dSqD|||�rDdSqDdS)aj
    Return True iff this host shouldn't be accessed using a proxy

    This function uses the MacOSX framework SystemConfiguration
    to fetch the proxy information.

    proxy_settings come from _scproxy._get_proxy_settings or get mocked ie:
    { 'exclude_simple': bool,
      'exceptions': ['foo.bar', '*.bar.com', '127.0.0.1', '10.1', '10.0/16']
    }
    r)�fnmatchcSsh|�d�}ttt|��}t|�dkr<|ddddgdd�}|dd>|dd>B|dd>B|d	BS)
Nrqr�r�rVr}r:r|rS)rXr�r�rbrd)ZipAddrrBrLrLrM�ip2num
s

z,_proxy_bypass_macosx_sysconf.<locals>.ip2numrqZexclude_simpleTN�
exceptionsrLz(\d+(?:\.\d+)*)(/\d+)?rVr:r|� F)rur
r�rfrKr�r�rq�group�countrb)rz�proxy_settingsrursrCrwZhostIPr�rrD�maskrLrLrM�_proxy_bypass_macosx_sysconf
s>




r~�darwin)�_get_proxy_settings�_get_proxiescCst�}t||�SrN)r�r~)rzr|rLrLrM�proxy_bypass_macosx_sysconfF
sr�cCst�S)z�Return a dictionary of scheme -> proxy server URL mappings.

        This function uses the MacOSX framework SystemConfiguration
        to fetch the proxy information.
        )r�rLrLrLrM�getproxies_macosx_sysconfJ
sr�cCs t�}|rt||�St|�SdS)z�Return True, if host should be bypassed.

        Checks proxy settings gathered from the environment, if specified,
        or from the MacOSX framework SystemConfiguration.

        N)rortr��rzr&rLrLrMr,T
s
r,cCst�p
t�SrN)ror�rLrLrLrMr5a
sc
Csi}zddl}Wntk
r(|YSXz�|�|jd�}|�|d�d}|r�t|�|d�d�}d|kr�|�d�D]4}|�dd�\}}t�d	|�s�d
||f}|||<qtn>|dd�dkr�||d
<n$d||d
<d||d<d||d<|�	�Wnt
ttfk
�rYnX|S)zxReturn a dictionary of scheme -> proxy server URL mappings.

        Win32 uses the registry to store proxies.

        rN�;Software\Microsoft\Windows\CurrentVersion\Internet Settings�ProxyEnableZProxyServerr�r9rVz
(?:[^/:]+)://z%s://%srtr'r�z	http://%sz
https://%sr�zftp://%sr	)
�winreg�ImportError�OpenKey�HKEY_CURRENT_USER�QueryValueExr�rXrfrKZCloserqrBr�)r&r��internetSettings�proxyEnableZproxyServer�pr�ZaddressrLrLrM�getproxies_registryf
sF
�����
r�cCst�p
t�S)z�Return a dictionary of scheme -> proxy server URL mappings.

        Returns settings gathered from the environment, if specified,
        or the registry.

        )ror�rLrLrLrMr5�
scCs|zddl}Wntk
r"YdSXz6|�|jd�}|�|d�d}t|�|d�d�}Wntk
rpYdSX|rz|s~dSt|�\}}|g}z t�	|�}||kr�|�
|�Wntk
r�YnXz t�|�}||kr�|�
|�Wntk
�r�YnX|�d�}|D]j}	|	dk�r*d|k�r*dS|	�
dd	�}	|	�
d
d�}	|	�
dd�}	|D] }
t�|	|
tj��rRdS�qR�qdS)
Nrr�r�Z
ProxyOverrider9z<local>rqrVz\.rpz.*�?)r�r�r�r�r�r�rqr
r�r�raZgetfqdnrXrrfrKrh)rzr�r�r�Z
proxyOverrideZrawHostrCZaddrZfqdnrEr�rLrLrM�proxy_bypass_registry�
s`�����





r�cCs t�}|rt||�St|�SdS)z�Return True, if host should be bypassed.

        Checks proxy settings gathered from the environment, if specified,
        or the registry.

        N)rortr�r�rLrLrMr,�
s
)NNN)N)~r�r-r�r�r�Zhttp.clientr�rr[�	posixpathrfr�rr�r~r^rXr?Zurllib.errorrrrZurllib.parserrrrr	r
rrr
rrrrrrrrrZurllib.responserrrDr�rC�__all__�version_infor�rFr�r0r1r`r6r7rg�ASCIIrvr{rrr2rr/rrr"rr r!r"r#r$r%�urandomr�r&r'r(r�r)r�r�rErarr.rvrxr*r�r+r,r-r6r_Z
nturl2pathr4r3rr8r9r]r�r^r4r_r7r`rar�rortr~�platformZ_scproxyr�r�r�r�r,r5r�r�rLrLrLrM�<module>s SP
��U
?m$q!+@
ov

+3:5!@W

_
%A

-	2
urllib/__pycache__/parse.cpython-38.opt-1.pyc000064400000107252151153537540014766 0ustar00U

&�.e���@s�dZddlZddlZddlZddlZddlZddddddd	d
ddd
ddddddddddgZddddddddd d!d"d#d$d%d&d'd(d)d*gZdddddd+dddd"d d!d,d#d$d%d-d'd(d&d.d/d0d)d*gZddd1d#ddd d!d$d%d2d3d"d&d4gZ	dd1d5d6d+ddd,d2d3g
Z
ddddd d!d"dd$d%d2d3gZddd1ddd6ddd d!d,dd#g
Zd7Z
d8Zd9d:d;gZd<ZiZd=d>�Zd?Zd@ZdAdB�ZeefdCdD�ZeefdEdF�ZdGdH�ZGdIdJ�dJe�ZGdKdL�dLe�ZGdMdN�dNe�ZGdOdP�dPee�ZGdQdR�dRee�ZddSlmZeddT�Z eddU�Z!eddV�Z"dWe _dXe j#_dYe j$_dZe!_d[e!j%_d\e!j&_d]e!j'_d^e!j(_d_e!j$_d`e"_e!j%je"j%_e!j&je"j&_e!j'je"j'_dae"j)_e!j(je"j(_e!j$je"j$_eZ*Gdbd�de e�Z+Gdcd�de!e�Z,Gddd�de"e�Z-Gded�de e�Z.Gdfd�de!e�Z/Gdgd�de"e�Z0dhdi�Z1e1�[1d�dkd�Z2dldm�Z3d�dndo�Z4dpdq�Z5drds�Z6d�dtd�Z7dud�Z8dvd�Z9d�dwd�Z:dxd�Z;dyZ<da=dzd�Z>e�?d{�Z@d�d~d�ZAd�d�d
�ZBGd�d��d�eC�ZDd�ZEdaFd�d�d�ZGd�d�d�ZHeId��ZJeKeJ�ZLiZMGd�d��d�ejN�ZOd�d�d�ZPd�d�d
�ZQd�d�d�ZRddddeQfd�d	�ZSd�d��ZTd�d��ZUd�d��ZVd�d��ZWdaXd�d��ZYd�d��ZZda[d�d��Z\d�d��Z]d�d��Z^d�d��Z_d�d��Z`d�d��Zadabd�d��Zcd�d�d��Zdd�d�d��Zed�d��Zfd�d��Zgd�d��Zhd�d��Zid�d��Zjd�d��Zkd�d��Zld�d��ZmdS)�a3Parse (absolute and relative) URLs.

urlparse module is based upon the following RFC specifications.

RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding
and L.  Masinter, January 2005.

RFC 2732 : "Format for Literal IPv6 Addresses in URL's by R.Hinden, B.Carpenter
and L.Masinter, December 1999.

RFC 2396:  "Uniform Resource Identifiers (URI)": Generic Syntax by T.
Berners-Lee, R. Fielding, and L. Masinter, August 1998.

RFC 2368: "The mailto URL scheme", by P.Hoffman , L Masinter, J. Zawinski, July 1998.

RFC 1808: "Relative Uniform Resource Locators", by R. Fielding, UC Irvine, June
1995.

RFC 1738: "Uniform Resource Locators (URL)" by T. Berners-Lee, L. Masinter, M.
McCahill, December 1994

RFC 3986 is considered the current standard and any future changes to
urlparse module should conform with it.  The urlparse module is
currently not entirely compliant with this RFC due to defacto
scenarios for parsing, and for backward compatibility purposes, some
parsing quirks from older RFCs are retained. The testcases in
test_urlparse.py provides a good indicator of parsing behavior.

The WHATWG URL Parser spec should also be considered.  We are not compliant with
it either due to existing user code API behavior expectations (Hyrum's Law).
It serves as a useful guide when making changes.
�N�urlparse�
urlunparse�urljoin�	urldefrag�urlsplit�
urlunsplit�	urlencode�parse_qs�	parse_qsl�quote�
quote_plus�quote_from_bytes�unquote�unquote_plus�unquote_to_bytes�DefragResult�ParseResult�SplitResult�DefragResultBytes�ParseResultBytes�SplitResultBytes�Zftp�httpZgopherZnntpZimapZwais�fileZhttpsZshttpZmmsZprosperoZrtspZrtspuZsftpZsvnzsvn+sshZwsZwssZtelnetZsnewsZrsyncZnfsZgitzgit+sshZhdlZsipZsipsZtelZmailtoZnewszAabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-.z!	

 �	�
�
�cCst��t��dS)z,Clear the parse cache and the quoters cache.N)�_parse_cache�clear�
_safe_quoters�r!r!�$/usr/lib64/python3.8/urllib/parse.py�clear_cache`sr#�ascii�strictcCs|S�Nr!)�objr!r!r"�_nooposr(cCs|�||�Sr&��encode)r'�encoding�errorsr!r!r"�_encode_resultrsr-cst��fdd�|D��S)Nc3s"|]}|r|����ndVqdS)rN��decode��.0�x�r+r,r!r"�	<genexpr>xsz_decode_args.<locals>.<genexpr>)�tuple)�argsr+r,r!r3r"�_decode_argsvsr7cGsVt|dt�}|dd�D]}|rt|t�|krtd��q|rH|tfSt|�tfS)Nr�z$Cannot mix str and non-str arguments)�
isinstance�str�	TypeErrorr(r7r-)r6Z	str_input�argr!r!r"�_coerce_argszs

r=c@seZdZdZdZddd�ZdS)	�_ResultMixinStrz>Standard approach to encoding parsed results from str to bytesr!r$r%cs|j��fdd�|D��S)Nc3s|]}|����VqdSr&r)r0r3r!r"r4�sz)_ResultMixinStr.encode.<locals>.<genexpr>)�_encoded_counterpart��selfr+r,r!r3r"r*�sz_ResultMixinStr.encodeN)r$r%)�__name__�
__module__�__qualname__�__doc__�	__slots__r*r!r!r!r"r>�sr>c@seZdZdZdZddd�ZdS)	�_ResultMixinBytesz>Standard approach to decoding parsed results from bytes to strr!r$r%cs|j��fdd�|D��S)Nc3s|]}|����VqdSr&r.r0r3r!r"r4�sz+_ResultMixinBytes.decode.<locals>.<genexpr>)�_decoded_counterpartr@r!r3r"r/�sz_ResultMixinBytes.decodeN)r$r%)rBrCrDrErFr/r!r!r!r"rG�srGc@sDeZdZdZdZedd��Zedd��Zedd��Zed	d
��Z	dS)�_NetlocResultMixinBasezHShared methods for the parsed result objects containing a netloc elementr!cCs
|jdS)Nr��	_userinfo�rAr!r!r"�username�sz_NetlocResultMixinBase.usernamecCs
|jdS)Nr8rJrLr!r!r"�password�sz_NetlocResultMixinBase.passwordcCsD|jd}|sdSt|t�r dnd}|�|�\}}}|��||S)Nr�%�%)�	_hostinfor9r:�	partition�lower)rA�hostname�	separatorZpercentZzoner!r!r"rT�s
z_NetlocResultMixinBase.hostnamecCsl|jd}|dk	rhzt|d�}Wn(tk
rHd|��}t|�d�YnXd|kr^dkshntd��|S)Nr8�
z+Port could not be cast to integer value as ri��zPort out of range 0-65535)rQ�int�
ValueError)rA�port�messager!r!r"rY�s

z_NetlocResultMixinBase.portN)
rBrCrDrErF�propertyrMrNrTrYr!r!r!r"rI�s



rIc@s(eZdZdZedd��Zedd��ZdS)�_NetlocResultMixinStrr!cCsD|j}|�d�\}}}|r4|�d�\}}}|s<d}nd}}||fS)N�@�:��netloc�
rpartitionrR�rAr`ZuserinfoZ	have_info�hostinforMZ
have_passwordrNr!r!r"rK�sz_NetlocResultMixinStr._userinfocCsl|j}|�d�\}}}|�d�\}}}|rL|�d�\}}}|�d�\}}}n|�d�\}}}|sdd}||fS)Nr]�[�]r^r_�rAr`�_rcZhave_open_brZ	bracketedrTrYr!r!r"rQ�sz_NetlocResultMixinStr._hostinfoN�rBrCrDrFr[rKrQr!r!r!r"r\�s

r\c@s(eZdZdZedd��Zedd��ZdS)�_NetlocResultMixinBytesr!cCsD|j}|�d�\}}}|r4|�d�\}}}|s<d}nd}}||fS)N�@�:r_rbr!r!r"rK�sz!_NetlocResultMixinBytes._userinfocCsl|j}|�d�\}}}|�d�\}}}|rL|�d�\}}}|�d�\}}}n|�d�\}}}|sdd}||fS)Nrj�[�]rkr_rfr!r!r"rQ�sz!_NetlocResultMixinBytes._hostinfoNrhr!r!r!r"ri�s

ri)�
namedtuplezurl fragmentz!scheme netloc path query fragmentz(scheme netloc path params query fragmentz�
DefragResult(url, fragment)

A 2-tuple that contains the url without fragment identifier and the fragment
identifier as a separate argument.
z$The URL with no fragment identifier.z�
Fragment identifier separated from URL, that allows indirect identification of a
secondary resource by reference to a primary resource and additional identifying
information.
z�
SplitResult(scheme, netloc, path, query, fragment)

A 5-tuple that contains the different components of a URL. Similar to
ParseResult, but does not split params.
z%Specifies URL scheme for the request.z0
Network location where the request is made to.
z@
The hierarchical path, such as the path to a file to download.
z�
The query component, that contains non-hierarchical data, that along with data
in path component, identifies a resource in the scope of URI's scheme and
network location.
z�
Fragment identifier, that allows indirect identification of a secondary resource
by reference to a primary resource and additional identifying information.
zq
ParseResult(scheme, netloc, path, params, query, fragment)

A 6-tuple that contains components of a parsed URL.
z�
Parameters for last path element used to dereference the URI in order to provide
access to perform some operation on the resource.
c@seZdZdZdd�ZdS)rr!cCs |jr|jd|jS|jSdS)N�#��fragment�urlrLr!r!r"�geturlIszDefragResult.geturlN�rBrCrDrFrsr!r!r!r"rGsc@seZdZdZdd�ZdS)rr!cCst|�Sr&�rrLr!r!r"rsQszSplitResult.geturlNrtr!r!r!r"rOsc@seZdZdZdd�ZdS)rr!cCst|�Sr&�rrLr!r!r"rsVszParseResult.geturlNrtr!r!r!r"rTsc@seZdZdZdd�ZdS)rr!cCs |jr|jd|jS|jSdS)N�#rprLr!r!r"rs\szDefragResultBytes.geturlNrtr!r!r!r"rZsc@seZdZdZdd�ZdS)rr!cCst|�Sr&rurLr!r!r"rsdszSplitResultBytes.geturlNrtr!r!r!r"rbsc@seZdZdZdd�ZdS)rr!cCst|�Sr&rvrLr!r!r"rsiszParseResultBytes.geturlNrtr!r!r!r"rgscCs4ttfttfttff}|D]\}}||_||_qdSr&)rrrrrrr?rH)Z
_result_pairsZ_decodedZ_encodedr!r!r"�_fix_result_transcodingms�rxTc
Csft||�\}}}t|||�}|\}}}}}|tkrHd|krHt|�\}}nd}t||||||�}	||	�S)a#Parse a URL into 6 components:
    <scheme>://<netloc>/<path>;<params>?<query>#<fragment>
    Return a 6-tuple: (scheme, netloc, path, params, query, fragment).
    Note that we don't break the components up in smaller bits
    (e.g. netloc is a single string) and we don't expand % escapes.�;r)r=r�uses_params�_splitparamsr)
rr�scheme�allow_fragments�_coerce_resultZsplitresultr`�queryrq�params�resultr!r!r"rzscCsRd|kr,|�d|�d��}|dkr6|dfSn
|�d�}|d|�||dd�fS)N�/ryrrr8)�find�rfind)rr�ir!r!r"r{�s

r{cCsHt|�}dD]"}|�||�}|dkrt||�}q|||�||d�fS)Nz/?#r)�lenr��min)rr�start�delim�cZwdelimr!r!r"�_splitnetloc�sr�cCs�|r|��rdSddl}|�dd�}|�dd�}|�dd�}|�dd�}|�d|�}||kr`dSdD] }||krdtd	|d
d��qddS)Nrr]rr^ro�?�NFKCz/?#@:znetloc 'z' contains invalid z#characters under NFKC normalization)�isascii�unicodedata�replace�	normalizerX)r`r��nZnetloc2r�r!r!r"�_checknetloc�s�r�cCstD]}|�|d�}q|S)Nr)�_UNSAFE_URL_BYTES_TO_REMOVEr�)rr�br!r!r"�_remove_unsafe_bytes_from_url�sr�c
Cs�t||�\}}}t|�}t|�}|�t�}|�t�}t|�}|||t|�t|�f}t�|d�}|rj||�St	t�t
kr|t�d}}}|�d�}	|	dk�r�|d|	�dk�rn||	dd�}|dd�dk�rt
|d�\}}d	|kr�d
|k�sd
|k�rd	|k�rtd��|�r,d|k�r,|�dd�\}}d
|k�rF|�d
d�\}}t|�td||||�}
|
t|<||
�S|d|	�D]}|tk�rz�qҐqz||	dd�}|�r�tdd�|D���r�|d|	���|}}|dd�dk�r"t
|d�\}}d	|k�rd
|k�sd
|k�r"d	|k�r"td��|�rBd|k�rB|�dd�\}}d
|k�r\|�d
d�\}}t|�t|||||�}
|
t|<||
�S)aParse a URL into 5 components:
    <scheme>://<netloc>/<path>?<query>#<fragment>
    Return a 5-tuple: (scheme, netloc, path, query, fragment).
    Note that we don't break the components up in smaller bits
    (e.g. netloc is a single string) and we don't expand % escapes.Nrr^rrr8��//rdrezInvalid IPv6 URLror�css|]}|dkVqdS)�
0123456789Nr!�r1r�r!r!r"r4�szurlsplit.<locals>.<genexpr>)r=r��lstrip�_WHATWG_C0_CONTROL_OR_SPACE�strip�bool�typer�getr��MAX_CACHE_SIZEr#r�r�rX�splitr�r�scheme_chars�anyrS)
rrr|r}r~�key�cachedr`rrqr��vr��restr!r!r"r�sn



��


��
cCs<t|�\}}}}}}}|r&d||f}|t|||||f��S)z�Put a parsed URL back together again.  This may result in a
    slightly different, but equivalent URL, if the URL that was parsed
    originally had redundant delimiters, e.g. a ? with an empty query
    (the draft states that these are equivalent).z%s;%s)r=r)�
componentsr|r`rrr�rrqr~r!r!r"r�s
�cCs�t|�\}}}}}}|s4|r`|tkr`|dd�dkr`|rP|dd�dkrPd|}d|pXd|}|rp|d|}|r�|d|}|r�|d	|}||�S)
akCombine the elements of a tuple as returned by urlsplit() into a
    complete URL as a string. The data argument can be any five-item iterable.
    This may result in a slightly different, but equivalent URL, if the URL that
    was parsed originally had unnecessary delimiters (for example, a ? with an
    empty query; the RFC states that these are equivalent).Nr�r�r8r�rr^r�ro)r=�uses_netloc)r�r|r`rrrrqr~r!r!r"r�s� c	Cs�|s|S|s|St||�\}}}t|d|�\}}}}}}	t|||�\}
}}}
}}|
|ks`|
tkrh||�S|
tkr�|r�|t|
|||
||f��S|}|s�|
s�|}|}
|s�|}|t|
|||
||f��S|�d�}|ddkr�|d=|dd�dkr�|�d�}n(||�d�}td|dd��|dd�<g}|D]P}|dk�r\z|��Wntk
�rXYnXn|dk�rl�q(n
|�	|��q(|ddk�r�|�	d�|t|
|d�
|��p�d|
||f��S)	zaJoin a base URL and a possibly relative URL to form an absolute
    interpretation of the latter.rr����Nr8�..�.)r�r�)r=r�
uses_relativer�rr��filter�pop�
IndexError�append�join)�baserrr}r~ZbschemeZbnetlocZbpathZbparamsZbqueryZ	bfragmentr|r`�pathr�rrqZ
base_partsZsegmentsZ
resolved_pathZsegr!r!r"rsp
�
�
�
�



��c	CsTt|�\}}d|kr>t|�\}}}}}}t|||||df�}nd}|}|t||��S)z�Removes any existing fragment from URL.

    Returns a tuple of the defragmented URL and the fragment.  If
    the URL contained no fragments, the second element is the
    empty string.
    ror)r=rrr)	rrr~�sr��p�a�qZfragZdefragr!r!r"rTsZ0123456789ABCDEFabcdefc	Cs�|s|jdSt|t�r"|�d�}|�d�}t|�dkr<|S|dg}|j}tdkrbdd�tD�a|dd�D]R}z(|t|dd	��||d	d��Wqntk
r�|d�||�YqnXqnd�	|�S)
z,unquote_to_bytes('abc%20def') -> b'abc def'.��utf-8rPr8rNcSs.i|]&}tD]}||��t�||��qqSr!)�_hexdigr*�bytes�fromhex)r1r�r�r!r!r"�
<dictcomp>zs
�
z$unquote_to_bytes.<locals>.<dictcomp>r�)
r�r9r:r*r�r��
_hextobyter��KeyErrorr�)�string�bits�resr��itemr!r!r"rgs,



�z([-]+)r�r�cCs�t|t�rtd��d|kr$|j|S|dkr0d}|dkr<d}t�|�}|dg}|j}tdt|�d�D],}|t||��	||��|||d�qfd	�
|�S)
a�Replace %xx escapes by their single-character equivalent. The optional
    encoding and errors parameters specify how to decode percent-encoded
    sequences into Unicode characters, as accepted by the bytes.decode()
    method.
    By default, percent-encoded sequences are decoded with UTF-8, and invalid
    sequences are replaced by a placeholder character.

    unquote('abc%20def') -> 'abc def'.
    zExpected str, got bytesrONr�r�rr8r�r)r9r�r;r��_asciirer��ranger�rr/r�)r�r+r,r�r�r�r�r!r!r"r�s 



Fc	CsNi}t|||||||d�}|D]*\}	}
|	|kr>||	�|
�q|
g||	<q|S)aXParse a query given as a string argument.

        Arguments:

        qs: percent-encoded query string to be parsed

        keep_blank_values: flag indicating whether blank values in
            percent-encoded queries should be treated as blank strings.
            A true value indicates that blanks should be retained as
            blank strings.  The default false value indicates that
            blank values are to be ignored and treated as if they were
            not included.

        strict_parsing: flag indicating what to do with parsing errors.
            If false (the default), errors are silently ignored.
            If true, errors raise a ValueError exception.

        encoding and errors: specify how to decode percent-encoded sequences
            into Unicode characters, as accepted by the bytes.decode() method.

        max_num_fields: int. If set, then throws a ValueError if there
            are more than n fields read by parse_qsl().

        separator: str. The symbol to use for separating the query arguments.
            Defaults to &.

        Returns a dictionary.
    )r+r,�max_num_fieldsrU)r
r�)�qs�keep_blank_values�strict_parsingr+r,r�rUZ
parsed_result�pairs�name�valuer!r!r"r	�s�c@seZdZdZdS)�_QueryStringSeparatorWarningz>Warning for using default `separator` in parse_qs or parse_qslN)rBrCrDrEr!r!r!r"r��sr�z/etc/python/urllib.cfgc	Cs�t|�\}}t|t�r |�d�}|r2t|ttf�sB|dk	rBtd��t�}|dk�rRt}d}	|dkrrtj	�
|	�}d}
|dkr�ztt�}Wnt
k
r�YnJX|�:ddl}|jddd�}
|
�|�|
j
d	|	dd
�}|aW5QRXt}
|dk�rd|k�rddlm}|d
tdd�d}n:|dk�r(|}n*t|�dk�rRt|	�d|
�d�dd��|dk	�r�||k�r�d|�d�|�d�}nd|�|�}||k�r�td��||k�r�dd�|�d�D�}ndd�|�|�D�}g}|D]�}|�s�|�s�q�|�dd�}t|�dk�r4|�rtd|f��|�r�|�d�n�q�t|d��sH|�r�|d�dd�}t|||d �}||�}|d�dd�}t|||d �}||�}|�||f��q�|S)!aXParse a query given as a string argument.

        Arguments:

        qs: percent-encoded query string to be parsed

        keep_blank_values: flag indicating whether blank values in
            percent-encoded queries should be treated as blank strings.
            A true value indicates that blanks should be retained as blank
            strings.  The default false value indicates that blank values
            are to be ignored and treated as if they were  not included.

        strict_parsing: flag indicating what to do with parsing errors. If
            false (the default), errors are silently ignored. If true,
            errors raise a ValueError exception.

        encoding and errors: specify how to decode percent-encoded sequences
            into Unicode characters, as accepted by the bytes.decode() method.

        max_num_fields: int. If set, then throws a ValueError
            if there are more than n fields read by parse_qsl().

        separator: str. The symbol to use for separating the query arguments.
            Defaults to &.

        Returns a list, as G-d intended.
    r$Nz*Separator must be of type string or bytes.ZPYTHON_URLLIB_QS_SEPARATORzenvironment variabler)ro)Z
interpolationZcomment_prefixesr	)Zfallbackry)�warnaThe default separator of urllib.parse.parse_qsl and parse_qs was changed to '&' to avoid a web cache poisoning issue (CVE-2021-23336). By default, semicolons no longer act as query field separators. See https://access.redhat.com/articles/5860431 for more details.r���
stacklevel�&Zlegacyr8z (from z) must contain z1 character, or "legacy". See z<https://access.redhat.com/articles/5860431 for more details.zMax number of fields exceededcSs g|]}|�d�D]}|�qqS)ry�r�)r1�s1�s2r!r!r"�
<listcomp>7szparse_qsl.<locals>.<listcomp>cSsg|]}|�qSr!r!)r1r�r!r!r"r�9s�=zbad query field: %rr�+� r3)r=r9r�r/r:rX�object�_default_qs_separator�os�environr��open�_QS_SEPARATOR_CONFIG_FILENAME�FileNotFoundError�configparserZConfigParserZ	read_file�warningsr�r�r��countr�r�r�r)r�r�r�r+r,r�rUr~Z_legacyZenvvar_nameZ
config_sourcerr�Zconfigr��
num_fieldsr��rZ
name_valueZnvr�r�r!r!r"r
�s�


�


�
���	



cCs|�dd�}t|||�S)z�Like unquote(), but also replace plus signs by spaces, as required for
    unquoting HTML form values.

    unquote_plus('%7e/abc+def') -> '~/abc def'
    r�r�)r�r)r�r+r,r!r!r"rQssBABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.-~c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�Quoterz�A mapping from bytes (in range(0,256)) to strings.

    String values are percent-encoded byte values, unless the key < 128, and
    in the "safe" set (either the specified safe set, or default set).
    cCst�|�|_dS)zsafe: bytes object.N)�_ALWAYS_SAFE�union�safe)rAr�r!r!r"�__init__iszQuoter.__init__cCsd|jjt|�fS)Nz<%s %r>)�	__class__rB�dictrLr!r!r"�__repr__mszQuoter.__repr__cCs(||jkrt|�nd�|�}|||<|S)Nz%{:02X})r��chr�format)rAr�r�r!r!r"�__missing__qszQuoter.__missing__N)rBrCrDrEr�r�r�r!r!r!r"r�asr�r�cCsbt|t�r8|s|S|dkrd}|dkr*d}|�||�}n |dk	rHtd��|dk	rXtd��t||�S)a�quote('abc def') -> 'abc%20def'

    Each part of a URL, e.g. the path info, the query, etc., has a
    different set of reserved characters that must be quoted. The
    quote function offers a cautious (not minimal) way to quote a
    string for most of these parts.

    RFC 3986 Uniform Resource Identifier (URI): Generic Syntax lists
    the following (un)reserved characters.

    unreserved    = ALPHA / DIGIT / "-" / "." / "_" / "~"
    reserved      = gen-delims / sub-delims
    gen-delims    = ":" / "/" / "?" / "#" / "[" / "]" / "@"
    sub-delims    = "!" / "$" / "&" / "'" / "(" / ")"
                  / "*" / "+" / "," / ";" / "="

    Each of the reserved characters is reserved in some component of a URL,
    but not necessarily in all of them.

    The quote function %-escapes all characters that are neither in the
    unreserved chars ("always safe") nor the additional chars set via the
    safe arg.

    The default for the safe arg is '/'. The character is reserved, but in
    typical usage the quote function is being called on a path where the
    existing slash characters are to be preserved.

    Python 3.7 updates from using RFC 2396 to RFC 3986 to quote URL strings.
    Now, "~" is included in the set of unreserved characters.

    string and safe may be either str or bytes objects. encoding and errors
    must not be specified if string is a bytes object.

    The optional encoding and errors parameters specify how to deal with
    non-ASCII characters, as accepted by the str.encode method.
    By default, encoding='utf-8' (characters are encoded with UTF-8), and
    errors='strict' (unsupported characters raise a UnicodeEncodeError).
    Nr�r%z,quote() doesn't support 'encoding' for bytesz*quote() doesn't support 'errors' for bytes)r9r:r*r;r
)r�r�r+r,r!r!r"rws'
cCsdt|t�rd|ks$t|t�r2d|kr2t||||�St|t�rBd}nd}t|||||�}|�dd�S)z�Like quote(), but also replace ' ' with '+', as required for quoting
    HTML form values. Plus signs in the original string are escaped unless
    they are included in safe. It also does not have safe default to '/'.
    r�� r�)r9r:r�rr�)r�r�r+r,Zspacer!r!r"r�s��
cs�t|ttf�std��|sdSt|t�r6|�dd�}ntdd�|D��}|�t|�s^|��Szt	|�Wn&t
k
r�t|�jt	|<�YnXd�
�fdd�|D��S)z�Like quote(), but accepts a bytes object rather than a str, and does
    not perform string-to-bytes encoding.  It always returns an ASCII string.
    quote_from_bytes(b'abc def?') -> 'abc%20def%3f'
    z!quote_from_bytes() expected bytesrr$�ignorecSsg|]}|dkr|�qS)�r!r�r!r!r"r��sz$quote_from_bytes.<locals>.<listcomp>csg|]}�|��qSr!r!)r1�char�Zquoterr!r"r��s)r9r��	bytearrayr;r:r*�rstrip�_ALWAYS_SAFE_BYTESr/r r�r��__getitem__r�)Zbsr�r!r�r"r
�s
c	Cst|d�r|��}nPzt|�r0t|dt�s0t�Wn0tk
rbt��\}}}td��|��YnXg}	|s�|D]j\}
}t|
t	�r�||
|�}
n|t
|
�|||�}
t|t	�r�|||�}n|t
|�|||�}|	�|
d|�qp�n"|D�]\}
}t|
t	��r||
|�}
n|t
|
�|||�}
t|t	��rB|||�}|	�|
d|�q�t|t
��rp|||||�}|	�|
d|�q�zt|�}Wn:tk
�r�|t
|�|||�}|	�|
d|�Yq�X|D]B}
t|
t	��r�||
|�}
n|t
|
�|||�}
|	�|
d|
��q�q�d�|	�S)a^Encode a dict or sequence of two-element tuples into a URL query string.

    If any values in the query arg are sequences and doseq is true, each
    sequence element is converted to a separate parameter.

    If the query arg is a sequence of two-element tuples, the order of the
    parameters in the output will match the order of parameters in the
    input.

    The components of a query arg may each be either a string or a bytes type.

    The safe, encoding, and errors parameters are passed down to the function
    specified by quote_via (encoding and errors only if a component is a str).
    �itemsrz1not a valid non-string sequence or mapping objectr�r�)
�hasattrr�r�r9r5r;�sys�exc_info�with_tracebackr�r:r�r�)rZdoseqr�r+r,Z	quote_viaZtyZva�tb�l�kr�r2Zeltr!r!r"r�sR

�



cCstjdtdd�t|�S)Nz/urllib.parse.to_bytes() is deprecated as of 3.8r�r�)r�r��DeprecationWarning�	_to_bytes�rrr!r!r"�to_bytes%s
�rcCsJt|t�rFz|�d���}Wn(tk
rDtdt|�d��YnX|S)zto_bytes(u"URL") --> 'URL'.�ASCIIzURL z contains non-ASCII characters)r9r:r*r/�UnicodeError�reprrr!r!r"r+s
�rcCs`t|���}|dd�dkr<|dd�dkr<|dd���}|dd�dkr\|dd���}|S)z�Transform a string like '<URL:scheme://host/path>' into 'scheme://host/path'.

    The string is returned unchanged if it's not a wrapped URL.
    Nr8�<r��>�zURL:)r:r�rr!r!r"�unwrap9s r
cCstjdtdd�t|�S)NzUurllib.parse.splittype() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r�
_splittyperr!r!r"�	splittypeFs
�rcCsDtdkrt�dtj�at�|�}|r<|��\}}|��|fSd|fS)z:splittype('type:opaquestring') --> 'type', 'opaquestring'.Nz
([^/:]+):(.*))�	_typeprog�re�compile�DOTALL�match�groupsrS)rrrr|�datar!r!r"rNs
rcCstjdtdd�t|�S)NzUurllib.parse.splithost() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r�
_splithostrr!r!r"�	splithost[s
�rcCsXtdkrt�dtj�at�|�}|rP|��\}}|rH|ddkrHd|}||fSd|fS)z;splithost('//host[:port]/path') --> 'host[:port]', '/path'.Nz//([^/#?]*)(.*)rr�)�	_hostprogrrrrr)rrrZ	host_portr�r!r!r"rcs
rcCstjdtdd�t|�S)NzUurllib.parse.splituser() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r�
_splituser��hostr!r!r"�	splituserrs
�rcCs |�d�\}}}|r|nd|fS)zJsplituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.r]N�ra)r�userr�r!r!r"rysrcCstjdtdd�t|�S)NzWurllib.parse.splitpasswd() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r�_splitpasswd)rr!r!r"�splitpasswds
�r!cCs |�d�\}}}||r|ndfS)z/splitpasswd('user:passwd') -> 'user', 'passwd'.r^N�rR)rr�Zpasswdr!r!r"r �sr cCstjdtdd�t|�S)NzUurllib.parse.splitport() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r�
_splitportrr!r!r"�	splitport�s
�r$cCsDtdkrt�dtj�at�|�}|r<|��\}}|r<||fS|dfS)z*splitport('host:port') --> 'host', 'port'.Nz
(.*):([0-9]*))�	_portprogrrr�	fullmatchr)rrrYr!r!r"r#�s
r#r�cCstjdtdd�t||�S)NzVurllib.parse.splitnport() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r�_splitnport)r�defportr!r!r"�
splitnport�s
�r)cCsT|�d�\}}}|s|}n2|rLzt|�}Wntk
rBd}YnX||fS||fS)z�Split host and port, returning numeric port.
    Return given default port if no ':' found; defaults to -1.
    Return numerical port if a valid number are found after ':'.
    Return None if ':' but not a valid number.r^N)rarWrX)rr(r�rYZnportr!r!r"r'�s
r'cCstjdtdd�t|�S)NzVurllib.parse.splitquery() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r�_splitqueryrr!r!r"�
splitquery�s
�r+cCs$|�d�\}}}|r||fS|dfS)z/splitquery('/path?query') --> '/path', 'query'.r�Nr)rrr�r�rr!r!r"r*�sr*cCstjdtdd�t|�S)NzTurllib.parse.splittag() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r�	_splittagrr!r!r"�splittag�s
�r-cCs$|�d�\}}}|r||fS|dfS)z)splittag('/path#tag') --> '/path', 'tag'.roNr)rrr�r��tagr!r!r"r,�sr,cCstjdtdd�t|�S)NzUurllib.parse.splitattr() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r�
_splitattrrr!r!r"�	splitattr�s
�r0cCs|�d�}|d|dd�fS)zksplitattr('/path;attr1=value1;attr2=value2;...') ->
        '/path', ['attr1=value1', 'attr2=value2', ...].ryrr8Nr�)rrZwordsr!r!r"r/�s
r/cCstjdtdd�t|�S)NzWurllib.parse.splitvalue() is deprecated as of 3.8, use urllib.parse.parse_qsl() insteadr�r�)r�r�r�_splitvalue)�attrr!r!r"�
splitvalue�s
�r3cCs |�d�\}}}||r|ndfS)z-splitvalue('attr=value') --> 'attr', 'value'.r�Nr")r2r�r�r!r!r"r1�sr1)rT)r)rT)T)r�r�)FFr�r�NN)FFr�r�NN)r�r�)r�NN)rNN)r�)r�)r�)nrErr�r��collectionsr��__all__r�r�rzZnon_hierarchicalZ
uses_queryZ
uses_fragmentr�r�r�r�rr#Z_implicit_encodingZ_implicit_errorsr(r-r7r=r�r>rGrIr\rirnZ_DefragResultBaseZ_SplitResultBaseZ_ParseResultBaserrrqr|r`r�rr�Z
ResultBaserrrrrrrxrr{r�r�r�rrrrrr�r�rrr�rr	�RuntimeWarningr�r�r�r
r�	frozensetr�r�r�r �defaultdictr�rrr
rrrr
rrrrrrrrr!r r$r%r#r)r'r+r*r-r,r0r/r3r1r!r!r!r"�<module>s�!�������
�
�
%
��

	

?
E

�
)�
}
	
6

�
Q



urllib/__pycache__/parse.cpython-38.pyc000064400000107252151153537540014027 0ustar00U

&�.e���@s�dZddlZddlZddlZddlZddlZddddddd	d
ddd
ddddddddddgZddddddddd d!d"d#d$d%d&d'd(d)d*gZdddddd+dddd"d d!d,d#d$d%d-d'd(d&d.d/d0d)d*gZddd1d#ddd d!d$d%d2d3d"d&d4gZ	dd1d5d6d+ddd,d2d3g
Z
ddddd d!d"dd$d%d2d3gZddd1ddd6ddd d!d,dd#g
Zd7Z
d8Zd9d:d;gZd<ZiZd=d>�Zd?Zd@ZdAdB�ZeefdCdD�ZeefdEdF�ZdGdH�ZGdIdJ�dJe�ZGdKdL�dLe�ZGdMdN�dNe�ZGdOdP�dPee�ZGdQdR�dRee�ZddSlmZeddT�Z eddU�Z!eddV�Z"dWe _dXe j#_dYe j$_dZe!_d[e!j%_d\e!j&_d]e!j'_d^e!j(_d_e!j$_d`e"_e!j%je"j%_e!j&je"j&_e!j'je"j'_dae"j)_e!j(je"j(_e!j$je"j$_eZ*Gdbd�de e�Z+Gdcd�de!e�Z,Gddd�de"e�Z-Gded�de e�Z.Gdfd�de!e�Z/Gdgd�de"e�Z0dhdi�Z1e1�[1d�dkd�Z2dldm�Z3d�dndo�Z4dpdq�Z5drds�Z6d�dtd�Z7dud�Z8dvd�Z9d�dwd�Z:dxd�Z;dyZ<da=dzd�Z>e�?d{�Z@d�d~d�ZAd�d�d
�ZBGd�d��d�eC�ZDd�ZEdaFd�d�d�ZGd�d�d�ZHeId��ZJeKeJ�ZLiZMGd�d��d�ejN�ZOd�d�d�ZPd�d�d
�ZQd�d�d�ZRddddeQfd�d	�ZSd�d��ZTd�d��ZUd�d��ZVd�d��ZWdaXd�d��ZYd�d��ZZda[d�d��Z\d�d��Z]d�d��Z^d�d��Z_d�d��Z`d�d��Zadabd�d��Zcd�d�d��Zdd�d�d��Zed�d��Zfd�d��Zgd�d��Zhd�d��Zid�d��Zjd�d��Zkd�d��Zld�d��ZmdS)�a3Parse (absolute and relative) URLs.

urlparse module is based upon the following RFC specifications.

RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding
and L.  Masinter, January 2005.

RFC 2732 : "Format for Literal IPv6 Addresses in URL's by R.Hinden, B.Carpenter
and L.Masinter, December 1999.

RFC 2396:  "Uniform Resource Identifiers (URI)": Generic Syntax by T.
Berners-Lee, R. Fielding, and L. Masinter, August 1998.

RFC 2368: "The mailto URL scheme", by P.Hoffman , L Masinter, J. Zawinski, July 1998.

RFC 1808: "Relative Uniform Resource Locators", by R. Fielding, UC Irvine, June
1995.

RFC 1738: "Uniform Resource Locators (URL)" by T. Berners-Lee, L. Masinter, M.
McCahill, December 1994

RFC 3986 is considered the current standard and any future changes to
urlparse module should conform with it.  The urlparse module is
currently not entirely compliant with this RFC due to defacto
scenarios for parsing, and for backward compatibility purposes, some
parsing quirks from older RFCs are retained. The testcases in
test_urlparse.py provides a good indicator of parsing behavior.

The WHATWG URL Parser spec should also be considered.  We are not compliant with
it either due to existing user code API behavior expectations (Hyrum's Law).
It serves as a useful guide when making changes.
�N�urlparse�
urlunparse�urljoin�	urldefrag�urlsplit�
urlunsplit�	urlencode�parse_qs�	parse_qsl�quote�
quote_plus�quote_from_bytes�unquote�unquote_plus�unquote_to_bytes�DefragResult�ParseResult�SplitResult�DefragResultBytes�ParseResultBytes�SplitResultBytes�Zftp�httpZgopherZnntpZimapZwais�fileZhttpsZshttpZmmsZprosperoZrtspZrtspuZsftpZsvnzsvn+sshZwsZwssZtelnetZsnewsZrsyncZnfsZgitzgit+sshZhdlZsipZsipsZtelZmailtoZnewszAabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+-.z!	

 �	�
�
�cCst��t��dS)z,Clear the parse cache and the quoters cache.N)�_parse_cache�clear�
_safe_quoters�r!r!�$/usr/lib64/python3.8/urllib/parse.py�clear_cache`sr#�ascii�strictcCs|S�Nr!)�objr!r!r"�_nooposr(cCs|�||�Sr&��encode)r'�encoding�errorsr!r!r"�_encode_resultrsr-cst��fdd�|D��S)Nc3s"|]}|r|����ndVqdS)rN��decode��.0�x�r+r,r!r"�	<genexpr>xsz_decode_args.<locals>.<genexpr>)�tuple)�argsr+r,r!r3r"�_decode_argsvsr7cGsVt|dt�}|dd�D]}|rt|t�|krtd��q|rH|tfSt|�tfS)Nr�z$Cannot mix str and non-str arguments)�
isinstance�str�	TypeErrorr(r7r-)r6Z	str_input�argr!r!r"�_coerce_argszs

r=c@seZdZdZdZddd�ZdS)	�_ResultMixinStrz>Standard approach to encoding parsed results from str to bytesr!r$r%cs|j��fdd�|D��S)Nc3s|]}|����VqdSr&r)r0r3r!r"r4�sz)_ResultMixinStr.encode.<locals>.<genexpr>)�_encoded_counterpart��selfr+r,r!r3r"r*�sz_ResultMixinStr.encodeN)r$r%)�__name__�
__module__�__qualname__�__doc__�	__slots__r*r!r!r!r"r>�sr>c@seZdZdZdZddd�ZdS)	�_ResultMixinBytesz>Standard approach to decoding parsed results from bytes to strr!r$r%cs|j��fdd�|D��S)Nc3s|]}|����VqdSr&r.r0r3r!r"r4�sz+_ResultMixinBytes.decode.<locals>.<genexpr>)�_decoded_counterpartr@r!r3r"r/�sz_ResultMixinBytes.decodeN)r$r%)rBrCrDrErFr/r!r!r!r"rG�srGc@sDeZdZdZdZedd��Zedd��Zedd��Zed	d
��Z	dS)�_NetlocResultMixinBasezHShared methods for the parsed result objects containing a netloc elementr!cCs
|jdS)Nr��	_userinfo�rAr!r!r"�username�sz_NetlocResultMixinBase.usernamecCs
|jdS)Nr8rJrLr!r!r"�password�sz_NetlocResultMixinBase.passwordcCsD|jd}|sdSt|t�r dnd}|�|�\}}}|��||S)Nr�%�%)�	_hostinfor9r:�	partition�lower)rA�hostname�	separatorZpercentZzoner!r!r"rT�s
z_NetlocResultMixinBase.hostnamecCsl|jd}|dk	rhzt|d�}Wn(tk
rHd|��}t|�d�YnXd|kr^dkshntd��|S)Nr8�
z+Port could not be cast to integer value as ri��zPort out of range 0-65535)rQ�int�
ValueError)rA�port�messager!r!r"rY�s

z_NetlocResultMixinBase.portN)
rBrCrDrErF�propertyrMrNrTrYr!r!r!r"rI�s



rIc@s(eZdZdZedd��Zedd��ZdS)�_NetlocResultMixinStrr!cCsD|j}|�d�\}}}|r4|�d�\}}}|s<d}nd}}||fS)N�@�:��netloc�
rpartitionrR�rAr`ZuserinfoZ	have_info�hostinforMZ
have_passwordrNr!r!r"rK�sz_NetlocResultMixinStr._userinfocCsl|j}|�d�\}}}|�d�\}}}|rL|�d�\}}}|�d�\}}}n|�d�\}}}|sdd}||fS)Nr]�[�]r^r_�rAr`�_rcZhave_open_brZ	bracketedrTrYr!r!r"rQ�sz_NetlocResultMixinStr._hostinfoN�rBrCrDrFr[rKrQr!r!r!r"r\�s

r\c@s(eZdZdZedd��Zedd��ZdS)�_NetlocResultMixinBytesr!cCsD|j}|�d�\}}}|r4|�d�\}}}|s<d}nd}}||fS)N�@�:r_rbr!r!r"rK�sz!_NetlocResultMixinBytes._userinfocCsl|j}|�d�\}}}|�d�\}}}|rL|�d�\}}}|�d�\}}}n|�d�\}}}|sdd}||fS)Nrj�[�]rkr_rfr!r!r"rQ�sz!_NetlocResultMixinBytes._hostinfoNrhr!r!r!r"ri�s

ri)�
namedtuplezurl fragmentz!scheme netloc path query fragmentz(scheme netloc path params query fragmentz�
DefragResult(url, fragment)

A 2-tuple that contains the url without fragment identifier and the fragment
identifier as a separate argument.
z$The URL with no fragment identifier.z�
Fragment identifier separated from URL, that allows indirect identification of a
secondary resource by reference to a primary resource and additional identifying
information.
z�
SplitResult(scheme, netloc, path, query, fragment)

A 5-tuple that contains the different components of a URL. Similar to
ParseResult, but does not split params.
z%Specifies URL scheme for the request.z0
Network location where the request is made to.
z@
The hierarchical path, such as the path to a file to download.
z�
The query component, that contains non-hierarchical data, that along with data
in path component, identifies a resource in the scope of URI's scheme and
network location.
z�
Fragment identifier, that allows indirect identification of a secondary resource
by reference to a primary resource and additional identifying information.
zq
ParseResult(scheme, netloc, path, params, query, fragment)

A 6-tuple that contains components of a parsed URL.
z�
Parameters for last path element used to dereference the URI in order to provide
access to perform some operation on the resource.
c@seZdZdZdd�ZdS)rr!cCs |jr|jd|jS|jSdS)N�#��fragment�urlrLr!r!r"�geturlIszDefragResult.geturlN�rBrCrDrFrsr!r!r!r"rGsc@seZdZdZdd�ZdS)rr!cCst|�Sr&�rrLr!r!r"rsQszSplitResult.geturlNrtr!r!r!r"rOsc@seZdZdZdd�ZdS)rr!cCst|�Sr&�rrLr!r!r"rsVszParseResult.geturlNrtr!r!r!r"rTsc@seZdZdZdd�ZdS)rr!cCs |jr|jd|jS|jSdS)N�#rprLr!r!r"rs\szDefragResultBytes.geturlNrtr!r!r!r"rZsc@seZdZdZdd�ZdS)rr!cCst|�Sr&rurLr!r!r"rsdszSplitResultBytes.geturlNrtr!r!r!r"rbsc@seZdZdZdd�ZdS)rr!cCst|�Sr&rvrLr!r!r"rsiszParseResultBytes.geturlNrtr!r!r!r"rgscCs4ttfttfttff}|D]\}}||_||_qdSr&)rrrrrrr?rH)Z
_result_pairsZ_decodedZ_encodedr!r!r"�_fix_result_transcodingms�rxTc
Csft||�\}}}t|||�}|\}}}}}|tkrHd|krHt|�\}}nd}t||||||�}	||	�S)a#Parse a URL into 6 components:
    <scheme>://<netloc>/<path>;<params>?<query>#<fragment>
    Return a 6-tuple: (scheme, netloc, path, params, query, fragment).
    Note that we don't break the components up in smaller bits
    (e.g. netloc is a single string) and we don't expand % escapes.�;r)r=r�uses_params�_splitparamsr)
rr�scheme�allow_fragments�_coerce_resultZsplitresultr`�queryrq�params�resultr!r!r"rzscCsRd|kr,|�d|�d��}|dkr6|dfSn
|�d�}|d|�||dd�fS)N�/ryrrr8)�find�rfind)rr�ir!r!r"r{�s

r{cCsHt|�}dD]"}|�||�}|dkrt||�}q|||�||d�fS)Nz/?#r)�lenr��min)rr�start�delim�cZwdelimr!r!r"�_splitnetloc�sr�cCs�|r|��rdSddl}|�dd�}|�dd�}|�dd�}|�dd�}|�d|�}||kr`dSdD] }||krdtd	|d
d��qddS)Nrr]rr^ro�?�NFKCz/?#@:znetloc 'z' contains invalid z#characters under NFKC normalization)�isascii�unicodedata�replace�	normalizerX)r`r��nZnetloc2r�r!r!r"�_checknetloc�s�r�cCstD]}|�|d�}q|S)Nr)�_UNSAFE_URL_BYTES_TO_REMOVEr�)rr�br!r!r"�_remove_unsafe_bytes_from_url�sr�c
Cs�t||�\}}}t|�}t|�}|�t�}|�t�}t|�}|||t|�t|�f}t�|d�}|rj||�St	t�t
kr|t�d}}}|�d�}	|	dk�r�|d|	�dk�rn||	dd�}|dd�dk�rt
|d�\}}d	|kr�d
|k�sd
|k�rd	|k�rtd��|�r,d|k�r,|�dd�\}}d
|k�rF|�d
d�\}}t|�td||||�}
|
t|<||
�S|d|	�D]}|tk�rz�qҐqz||	dd�}|�r�tdd�|D���r�|d|	���|}}|dd�dk�r"t
|d�\}}d	|k�rd
|k�sd
|k�r"d	|k�r"td��|�rBd|k�rB|�dd�\}}d
|k�r\|�d
d�\}}t|�t|||||�}
|
t|<||
�S)aParse a URL into 5 components:
    <scheme>://<netloc>/<path>?<query>#<fragment>
    Return a 5-tuple: (scheme, netloc, path, query, fragment).
    Note that we don't break the components up in smaller bits
    (e.g. netloc is a single string) and we don't expand % escapes.Nrr^rrr8��//rdrezInvalid IPv6 URLror�css|]}|dkVqdS)�
0123456789Nr!�r1r�r!r!r"r4�szurlsplit.<locals>.<genexpr>)r=r��lstrip�_WHATWG_C0_CONTROL_OR_SPACE�strip�bool�typer�getr��MAX_CACHE_SIZEr#r�r�rX�splitr�r�scheme_chars�anyrS)
rrr|r}r~�key�cachedr`rrqr��vr��restr!r!r"r�sn



��


��
cCs<t|�\}}}}}}}|r&d||f}|t|||||f��S)z�Put a parsed URL back together again.  This may result in a
    slightly different, but equivalent URL, if the URL that was parsed
    originally had redundant delimiters, e.g. a ? with an empty query
    (the draft states that these are equivalent).z%s;%s)r=r)�
componentsr|r`rrr�rrqr~r!r!r"r�s
�cCs�t|�\}}}}}}|s4|r`|tkr`|dd�dkr`|rP|dd�dkrPd|}d|pXd|}|rp|d|}|r�|d|}|r�|d	|}||�S)
akCombine the elements of a tuple as returned by urlsplit() into a
    complete URL as a string. The data argument can be any five-item iterable.
    This may result in a slightly different, but equivalent URL, if the URL that
    was parsed originally had unnecessary delimiters (for example, a ? with an
    empty query; the RFC states that these are equivalent).Nr�r�r8r�rr^r�ro)r=�uses_netloc)r�r|r`rrrrqr~r!r!r"r�s� c	Cs�|s|S|s|St||�\}}}t|d|�\}}}}}}	t|||�\}
}}}
}}|
|ks`|
tkrh||�S|
tkr�|r�|t|
|||
||f��S|}|s�|
s�|}|}
|s�|}|t|
|||
||f��S|�d�}|ddkr�|d=|dd�dkr�|�d�}n(||�d�}td|dd��|dd�<g}|D]P}|dk�r\z|��Wntk
�rXYnXn|dk�rl�q(n
|�	|��q(|ddk�r�|�	d�|t|
|d�
|��p�d|
||f��S)	zaJoin a base URL and a possibly relative URL to form an absolute
    interpretation of the latter.rr����Nr8�..�.)r�r�)r=r�
uses_relativer�rr��filter�pop�
IndexError�append�join)�baserrr}r~ZbschemeZbnetlocZbpathZbparamsZbqueryZ	bfragmentr|r`�pathr�rrqZ
base_partsZsegmentsZ
resolved_pathZsegr!r!r"rsp
�
�
�
�



��c	CsTt|�\}}d|kr>t|�\}}}}}}t|||||df�}nd}|}|t||��S)z�Removes any existing fragment from URL.

    Returns a tuple of the defragmented URL and the fragment.  If
    the URL contained no fragments, the second element is the
    empty string.
    ror)r=rrr)	rrr~�sr��p�a�qZfragZdefragr!r!r"rTsZ0123456789ABCDEFabcdefc	Cs�|s|jdSt|t�r"|�d�}|�d�}t|�dkr<|S|dg}|j}tdkrbdd�tD�a|dd�D]R}z(|t|dd	��||d	d��Wqntk
r�|d�||�YqnXqnd�	|�S)
z,unquote_to_bytes('abc%20def') -> b'abc def'.��utf-8rPr8rNcSs.i|]&}tD]}||��t�||��qqSr!)�_hexdigr*�bytes�fromhex)r1r�r�r!r!r"�
<dictcomp>zs
�
z$unquote_to_bytes.<locals>.<dictcomp>r�)
r�r9r:r*r�r��
_hextobyter��KeyErrorr�)�string�bits�resr��itemr!r!r"rgs,



�z([-]+)r�r�cCs�t|t�rtd��d|kr$|j|S|dkr0d}|dkr<d}t�|�}|dg}|j}tdt|�d�D],}|t||��	||��|||d�qfd	�
|�S)
a�Replace %xx escapes by their single-character equivalent. The optional
    encoding and errors parameters specify how to decode percent-encoded
    sequences into Unicode characters, as accepted by the bytes.decode()
    method.
    By default, percent-encoded sequences are decoded with UTF-8, and invalid
    sequences are replaced by a placeholder character.

    unquote('abc%20def') -> 'abc def'.
    zExpected str, got bytesrONr�r�rr8r�r)r9r�r;r��_asciirer��ranger�rr/r�)r�r+r,r�r�r�r�r!r!r"r�s 



Fc	CsNi}t|||||||d�}|D]*\}	}
|	|kr>||	�|
�q|
g||	<q|S)aXParse a query given as a string argument.

        Arguments:

        qs: percent-encoded query string to be parsed

        keep_blank_values: flag indicating whether blank values in
            percent-encoded queries should be treated as blank strings.
            A true value indicates that blanks should be retained as
            blank strings.  The default false value indicates that
            blank values are to be ignored and treated as if they were
            not included.

        strict_parsing: flag indicating what to do with parsing errors.
            If false (the default), errors are silently ignored.
            If true, errors raise a ValueError exception.

        encoding and errors: specify how to decode percent-encoded sequences
            into Unicode characters, as accepted by the bytes.decode() method.

        max_num_fields: int. If set, then throws a ValueError if there
            are more than n fields read by parse_qsl().

        separator: str. The symbol to use for separating the query arguments.
            Defaults to &.

        Returns a dictionary.
    )r+r,�max_num_fieldsrU)r
r�)�qs�keep_blank_values�strict_parsingr+r,r�rUZ
parsed_result�pairs�name�valuer!r!r"r	�s�c@seZdZdZdS)�_QueryStringSeparatorWarningz>Warning for using default `separator` in parse_qs or parse_qslN)rBrCrDrEr!r!r!r"r��sr�z/etc/python/urllib.cfgc	Cs�t|�\}}t|t�r |�d�}|r2t|ttf�sB|dk	rBtd��t�}|dk�rRt}d}	|dkrrtj	�
|	�}d}
|dkr�ztt�}Wnt
k
r�YnJX|�:ddl}|jddd�}
|
�|�|
j
d	|	dd
�}|aW5QRXt}
|dk�rd|k�rddlm}|d
tdd�d}n:|dk�r(|}n*t|�dk�rRt|	�d|
�d�dd��|dk	�r�||k�r�d|�d�|�d�}nd|�|�}||k�r�td��||k�r�dd�|�d�D�}ndd�|�|�D�}g}|D]�}|�s�|�s�q�|�dd�}t|�dk�r4|�rtd|f��|�r�|�d�n�q�t|d��sH|�r�|d�dd�}t|||d �}||�}|d�dd�}t|||d �}||�}|�||f��q�|S)!aXParse a query given as a string argument.

        Arguments:

        qs: percent-encoded query string to be parsed

        keep_blank_values: flag indicating whether blank values in
            percent-encoded queries should be treated as blank strings.
            A true value indicates that blanks should be retained as blank
            strings.  The default false value indicates that blank values
            are to be ignored and treated as if they were  not included.

        strict_parsing: flag indicating what to do with parsing errors. If
            false (the default), errors are silently ignored. If true,
            errors raise a ValueError exception.

        encoding and errors: specify how to decode percent-encoded sequences
            into Unicode characters, as accepted by the bytes.decode() method.

        max_num_fields: int. If set, then throws a ValueError
            if there are more than n fields read by parse_qsl().

        separator: str. The symbol to use for separating the query arguments.
            Defaults to &.

        Returns a list, as G-d intended.
    r$Nz*Separator must be of type string or bytes.ZPYTHON_URLLIB_QS_SEPARATORzenvironment variabler)ro)Z
interpolationZcomment_prefixesr	)Zfallbackry)�warnaThe default separator of urllib.parse.parse_qsl and parse_qs was changed to '&' to avoid a web cache poisoning issue (CVE-2021-23336). By default, semicolons no longer act as query field separators. See https://access.redhat.com/articles/5860431 for more details.r���
stacklevel�&Zlegacyr8z (from z) must contain z1 character, or "legacy". See z<https://access.redhat.com/articles/5860431 for more details.zMax number of fields exceededcSs g|]}|�d�D]}|�qqS)ry�r�)r1�s1�s2r!r!r"�
<listcomp>7szparse_qsl.<locals>.<listcomp>cSsg|]}|�qSr!r!)r1r�r!r!r"r�9s�=zbad query field: %rr�+� r3)r=r9r�r/r:rX�object�_default_qs_separator�os�environr��open�_QS_SEPARATOR_CONFIG_FILENAME�FileNotFoundError�configparserZConfigParserZ	read_file�warningsr�r�r��countr�r�r�r)r�r�r�r+r,r�rUr~Z_legacyZenvvar_nameZ
config_sourcerr�Zconfigr��
num_fieldsr��rZ
name_valueZnvr�r�r!r!r"r
�s�


�


�
���	



cCs|�dd�}t|||�S)z�Like unquote(), but also replace plus signs by spaces, as required for
    unquoting HTML form values.

    unquote_plus('%7e/abc+def') -> '~/abc def'
    r�r�)r�r)r�r+r,r!r!r"rQssBABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_.-~c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�Quoterz�A mapping from bytes (in range(0,256)) to strings.

    String values are percent-encoded byte values, unless the key < 128, and
    in the "safe" set (either the specified safe set, or default set).
    cCst�|�|_dS)zsafe: bytes object.N)�_ALWAYS_SAFE�union�safe)rAr�r!r!r"�__init__iszQuoter.__init__cCsd|jjt|�fS)Nz<%s %r>)�	__class__rB�dictrLr!r!r"�__repr__mszQuoter.__repr__cCs(||jkrt|�nd�|�}|||<|S)Nz%{:02X})r��chr�format)rAr�r�r!r!r"�__missing__qszQuoter.__missing__N)rBrCrDrEr�r�r�r!r!r!r"r�asr�r�cCsbt|t�r8|s|S|dkrd}|dkr*d}|�||�}n |dk	rHtd��|dk	rXtd��t||�S)a�quote('abc def') -> 'abc%20def'

    Each part of a URL, e.g. the path info, the query, etc., has a
    different set of reserved characters that must be quoted. The
    quote function offers a cautious (not minimal) way to quote a
    string for most of these parts.

    RFC 3986 Uniform Resource Identifier (URI): Generic Syntax lists
    the following (un)reserved characters.

    unreserved    = ALPHA / DIGIT / "-" / "." / "_" / "~"
    reserved      = gen-delims / sub-delims
    gen-delims    = ":" / "/" / "?" / "#" / "[" / "]" / "@"
    sub-delims    = "!" / "$" / "&" / "'" / "(" / ")"
                  / "*" / "+" / "," / ";" / "="

    Each of the reserved characters is reserved in some component of a URL,
    but not necessarily in all of them.

    The quote function %-escapes all characters that are neither in the
    unreserved chars ("always safe") nor the additional chars set via the
    safe arg.

    The default for the safe arg is '/'. The character is reserved, but in
    typical usage the quote function is being called on a path where the
    existing slash characters are to be preserved.

    Python 3.7 updates from using RFC 2396 to RFC 3986 to quote URL strings.
    Now, "~" is included in the set of unreserved characters.

    string and safe may be either str or bytes objects. encoding and errors
    must not be specified if string is a bytes object.

    The optional encoding and errors parameters specify how to deal with
    non-ASCII characters, as accepted by the str.encode method.
    By default, encoding='utf-8' (characters are encoded with UTF-8), and
    errors='strict' (unsupported characters raise a UnicodeEncodeError).
    Nr�r%z,quote() doesn't support 'encoding' for bytesz*quote() doesn't support 'errors' for bytes)r9r:r*r;r
)r�r�r+r,r!r!r"rws'
cCsdt|t�rd|ks$t|t�r2d|kr2t||||�St|t�rBd}nd}t|||||�}|�dd�S)z�Like quote(), but also replace ' ' with '+', as required for quoting
    HTML form values. Plus signs in the original string are escaped unless
    they are included in safe. It also does not have safe default to '/'.
    r�� r�)r9r:r�rr�)r�r�r+r,Zspacer!r!r"r�s��
cs�t|ttf�std��|sdSt|t�r6|�dd�}ntdd�|D��}|�t|�s^|��Szt	|�Wn&t
k
r�t|�jt	|<�YnXd�
�fdd�|D��S)z�Like quote(), but accepts a bytes object rather than a str, and does
    not perform string-to-bytes encoding.  It always returns an ASCII string.
    quote_from_bytes(b'abc def?') -> 'abc%20def%3f'
    z!quote_from_bytes() expected bytesrr$�ignorecSsg|]}|dkr|�qS)�r!r�r!r!r"r��sz$quote_from_bytes.<locals>.<listcomp>csg|]}�|��qSr!r!)r1�char�Zquoterr!r"r��s)r9r��	bytearrayr;r:r*�rstrip�_ALWAYS_SAFE_BYTESr/r r�r��__getitem__r�)Zbsr�r!r�r"r
�s
c	Cst|d�r|��}nPzt|�r0t|dt�s0t�Wn0tk
rbt��\}}}td��|��YnXg}	|s�|D]j\}
}t|
t	�r�||
|�}
n|t
|
�|||�}
t|t	�r�|||�}n|t
|�|||�}|	�|
d|�qp�n"|D�]\}
}t|
t	��r||
|�}
n|t
|
�|||�}
t|t	��rB|||�}|	�|
d|�q�t|t
��rp|||||�}|	�|
d|�q�zt|�}Wn:tk
�r�|t
|�|||�}|	�|
d|�Yq�X|D]B}
t|
t	��r�||
|�}
n|t
|
�|||�}
|	�|
d|
��q�q�d�|	�S)a^Encode a dict or sequence of two-element tuples into a URL query string.

    If any values in the query arg are sequences and doseq is true, each
    sequence element is converted to a separate parameter.

    If the query arg is a sequence of two-element tuples, the order of the
    parameters in the output will match the order of parameters in the
    input.

    The components of a query arg may each be either a string or a bytes type.

    The safe, encoding, and errors parameters are passed down to the function
    specified by quote_via (encoding and errors only if a component is a str).
    �itemsrz1not a valid non-string sequence or mapping objectr�r�)
�hasattrr�r�r9r5r;�sys�exc_info�with_tracebackr�r:r�r�)rZdoseqr�r+r,Z	quote_viaZtyZva�tb�l�kr�r2Zeltr!r!r"r�sR

�



cCstjdtdd�t|�S)Nz/urllib.parse.to_bytes() is deprecated as of 3.8r�r�)r�r��DeprecationWarning�	_to_bytes�rrr!r!r"�to_bytes%s
�rcCsJt|t�rFz|�d���}Wn(tk
rDtdt|�d��YnX|S)zto_bytes(u"URL") --> 'URL'.�ASCIIzURL z contains non-ASCII characters)r9r:r*r/�UnicodeError�reprrr!r!r"r+s
�rcCs`t|���}|dd�dkr<|dd�dkr<|dd���}|dd�dkr\|dd���}|S)z�Transform a string like '<URL:scheme://host/path>' into 'scheme://host/path'.

    The string is returned unchanged if it's not a wrapped URL.
    Nr8�<r��>�zURL:)r:r�rr!r!r"�unwrap9s r
cCstjdtdd�t|�S)NzUurllib.parse.splittype() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r�
_splittyperr!r!r"�	splittypeFs
�rcCsDtdkrt�dtj�at�|�}|r<|��\}}|��|fSd|fS)z:splittype('type:opaquestring') --> 'type', 'opaquestring'.Nz
([^/:]+):(.*))�	_typeprog�re�compile�DOTALL�match�groupsrS)rrrr|�datar!r!r"rNs
rcCstjdtdd�t|�S)NzUurllib.parse.splithost() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r�
_splithostrr!r!r"�	splithost[s
�rcCsXtdkrt�dtj�at�|�}|rP|��\}}|rH|ddkrHd|}||fSd|fS)z;splithost('//host[:port]/path') --> 'host[:port]', '/path'.Nz//([^/#?]*)(.*)rr�)�	_hostprogrrrrr)rrrZ	host_portr�r!r!r"rcs
rcCstjdtdd�t|�S)NzUurllib.parse.splituser() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r�
_splituser��hostr!r!r"�	splituserrs
�rcCs |�d�\}}}|r|nd|fS)zJsplituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.r]N�ra)r�userr�r!r!r"rysrcCstjdtdd�t|�S)NzWurllib.parse.splitpasswd() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r�_splitpasswd)rr!r!r"�splitpasswds
�r!cCs |�d�\}}}||r|ndfS)z/splitpasswd('user:passwd') -> 'user', 'passwd'.r^N�rR)rr�Zpasswdr!r!r"r �sr cCstjdtdd�t|�S)NzUurllib.parse.splitport() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r�
_splitportrr!r!r"�	splitport�s
�r$cCsDtdkrt�dtj�at�|�}|r<|��\}}|r<||fS|dfS)z*splitport('host:port') --> 'host', 'port'.Nz
(.*):([0-9]*))�	_portprogrrr�	fullmatchr)rrrYr!r!r"r#�s
r#r�cCstjdtdd�t||�S)NzVurllib.parse.splitnport() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r�_splitnport)r�defportr!r!r"�
splitnport�s
�r)cCsT|�d�\}}}|s|}n2|rLzt|�}Wntk
rBd}YnX||fS||fS)z�Split host and port, returning numeric port.
    Return given default port if no ':' found; defaults to -1.
    Return numerical port if a valid number are found after ':'.
    Return None if ':' but not a valid number.r^N)rarWrX)rr(r�rYZnportr!r!r"r'�s
r'cCstjdtdd�t|�S)NzVurllib.parse.splitquery() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r�_splitqueryrr!r!r"�
splitquery�s
�r+cCs$|�d�\}}}|r||fS|dfS)z/splitquery('/path?query') --> '/path', 'query'.r�Nr)rrr�r�rr!r!r"r*�sr*cCstjdtdd�t|�S)NzTurllib.parse.splittag() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r�	_splittagrr!r!r"�splittag�s
�r-cCs$|�d�\}}}|r||fS|dfS)z)splittag('/path#tag') --> '/path', 'tag'.roNr)rrr�r��tagr!r!r"r,�sr,cCstjdtdd�t|�S)NzUurllib.parse.splitattr() is deprecated as of 3.8, use urllib.parse.urlparse() insteadr�r�)r�r�r�
_splitattrrr!r!r"�	splitattr�s
�r0cCs|�d�}|d|dd�fS)zksplitattr('/path;attr1=value1;attr2=value2;...') ->
        '/path', ['attr1=value1', 'attr2=value2', ...].ryrr8Nr�)rrZwordsr!r!r"r/�s
r/cCstjdtdd�t|�S)NzWurllib.parse.splitvalue() is deprecated as of 3.8, use urllib.parse.parse_qsl() insteadr�r�)r�r�r�_splitvalue)�attrr!r!r"�
splitvalue�s
�r3cCs |�d�\}}}||r|ndfS)z-splitvalue('attr=value') --> 'attr', 'value'.r�Nr")r2r�r�r!r!r"r1�sr1)rT)r)rT)T)r�r�)FFr�r�NN)FFr�r�NN)r�r�)r�NN)rNN)r�)r�)r�)nrErr�r��collectionsr��__all__r�r�rzZnon_hierarchicalZ
uses_queryZ
uses_fragmentr�r�r�r�rr#Z_implicit_encodingZ_implicit_errorsr(r-r7r=r�r>rGrIr\rirnZ_DefragResultBaseZ_SplitResultBaseZ_ParseResultBaserrrqr|r`r�rr�Z
ResultBaserrrrrrrxrr{r�r�r�rrrrrr�r�rrr�rr	�RuntimeWarningr�r�r�r
r�	frozensetr�r�r�r �defaultdictr�rrr
rrrr
rrrrrrrrr!r r$r%r#r)r'r+r*r-r,r0r/r3r1r!r!r!r"�<module>s�!�������
�
�
%
��

	

?
E

�
)�
}
	
6

�
Q



urllib/__pycache__/__init__.cpython-38.opt-2.pyc000064400000000202151153537540015377 0ustar00U

��.e�@sdS)N�rrr�'/usr/lib64/python3.8/urllib/__init__.py�<module>�urllib/__pycache__/robotparser.cpython-38.pyc000064400000016241151153537540015254 0ustar00U

e5d�$�@s\dZddlZddlZddlZdgZe�dd�ZGdd�d�ZGdd�d�Z	Gd	d
�d
�Z
dS)a% robotparser.py

    Copyright (C) 2000  Bastian Kleineidam

    You can choose between two licenses when using this package:
    1) GNU GPLv2
    2) PSF license for Python 2.2

    The robots.txt Exclusion Protocol is implemented as specified in
    http://www.robotstxt.org/norobots-rfc.txt
�N�RobotFileParser�RequestRatezrequests secondsc@sreZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)rzs This class provides a set of methods to read, parse and answer
    questions about a single robots.txt file.

    �cCs2g|_g|_d|_d|_d|_|�|�d|_dS)NFr)�entries�sitemaps�
default_entry�disallow_all�	allow_all�set_url�last_checked��self�url�r�*/usr/lib64/python3.8/urllib/robotparser.py�__init__s
zRobotFileParser.__init__cCs|jS)z�Returns the time the robots.txt file was last fetched.

        This is useful for long-running web spiders that need to
        check for new robots.txt files periodically.

        )r�r
rrr�mtime%szRobotFileParser.mtimecCsddl}|��|_dS)zYSets the time the robots.txt file was last fetched to the
        current time.

        rN)�timer)r
rrrr�modified.szRobotFileParser.modifiedcCs&||_tj�|�dd�\|_|_dS)z,Sets the URL referring to a robots.txt file.��N)r�urllib�parse�urlparseZhost�pathrrrrr
6szRobotFileParser.set_urlc
Cs�ztj�|j�}WnRtjjk
rd}z0|jdkr:d|_n|jdkrT|jdkrTd|_W5d}~XYnX|�	�}|�
|�d����dS)z4Reads the robots.txt URL and feeds it to the parser.)i�i�Ti�i�Nzutf-8)
rZrequestZurlopenr�errorZ	HTTPError�coderr	�readr�decode�
splitlines)r
�f�err�rawrrrr;s
zRobotFileParser.readcCs,d|jkr|jdkr(||_n|j�|�dS�N�*)�
useragentsrr�append)r
�entryrrr�
_add_entryHs

zRobotFileParser._add_entrycCsPd}t�}|��|D�]}|sP|dkr4t�}d}n|dkrP|�|�t�}d}|�d�}|dkrn|d|�}|��}|s|q|�dd�}t|�dkr|d����|d<tj	�
|d���|d<|ddkr�|dkr�|�|�t�}|j�|d�d}q|ddk�r.|dk�r6|j
�t|dd	��d}q|dd
k�rb|dk�r6|j
�t|dd��d}q|ddk�r�|dk�r6|d�����r�t|d�|_d}q|dd
k�r|dk�r6|d�d�}t|�dk�r|d�����r|d�����rtt|d�t|d��|_d}q|ddkr|j�|d�q|dk�rL|�|�dS)z�Parse the input lines from a robots.txt file.

        We allow that a user-agent: line is not preceded by
        one or more blank lines.
        rr��#N�:z
user-agentZdisallowFZallowTzcrawl-delayzrequest-rate�/Zsitemap)�Entryrr)�find�strip�split�len�lowerrr�unquoter&r'�	rulelines�RuleLine�isdigit�int�delayr�req_rater)r
�lines�stater(�line�iZnumbersrrrrQsj








 �
zRobotFileParser.parsecCs�|jr
dS|jrdS|jsdStj�tj�|��}tj�dd|j|j	|j
|jf�}tj�|�}|sfd}|j
D]}|�|�rl|�|�Sql|jr�|j�|�SdS)z=using the parsed robots.txt decide if useragent can fetch urlFTrr-)rr	rrrrr4�
urlunparserZparamsZqueryZfragment�quoter�
applies_to�	allowancer)r
�	useragentrZ
parsed_urlr(rrr�	can_fetch�s*�

zRobotFileParser.can_fetchcCs>|��sdS|jD]}|�|�r|jSq|jr:|jjSdS�N)rrrAr9r�r
rCr(rrr�crawl_delay�s

zRobotFileParser.crawl_delaycCs>|��sdS|jD]}|�|�r|jSq|jr:|jjSdSrE)rrrAr:rrFrrr�request_rate�s

zRobotFileParser.request_ratecCs|js
dS|jSrE)rrrrr�	site_maps�szRobotFileParser.site_mapscCs,|j}|jdk	r||jg}d�tt|��S)Nz

)rr�join�map�str)r
rrrr�__str__�s
zRobotFileParser.__str__N)r)�__name__�
__module__�__qualname__�__doc__rrrr
rr)rrDrGrHrIrMrrrrrs
		
	I

c@s(eZdZdZdd�Zdd�Zdd�ZdS)	r6zoA rule line is a single "Allow:" (allowance==True) or "Disallow:"
       (allowance==False) followed by a path.cCs<|dkr|sd}tj�tj�|��}tj�|�|_||_dS)NrT)rrr?rr@rrB)r
rrBrrrr�s
zRuleLine.__init__cCs|jdkp|�|j�Sr$)r�
startswith)r
�filenamerrrrA�szRuleLine.applies_tocCs|jr
dndd|jS)NZAllowZDisallowz: )rBrrrrrrM�szRuleLine.__str__N)rNrOrPrQrrArMrrrrr6�sr6c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r.z?An entry has one or more user-agents and zero or more rulelinescCsg|_g|_d|_d|_dSrE)r&r5r9r:rrrrr�szEntry.__init__cCs�g}|jD]}|�d|���q
|jdk	r<|�d|j���|jdk	rf|j}|�d|j�d|j���|�tt|j	��d�
|�S)NzUser-agent: z
Crawl-delay: zRequest-rate: r-�
)r&r'r9r:ZrequestsZseconds�extendrKrLr5rJ)r
Zret�agentZraterrrrM�s


z
Entry.__str__cCsF|�d�d��}|jD](}|dkr*dS|��}||krdSqdS)z2check if this entry applies to the specified agentr-rr%TF)r1r3r&)r
rCrVrrrrA�s
zEntry.applies_tocCs$|jD]}|�|�r|jSqdS)zZPreconditions:
        - our agent applies to this entry
        - filename is URL decodedT)r5rArB)r
rSr=rrrrB
s

zEntry.allowanceN)rNrOrPrQrrMrArBrrrrr.�s

r.)rQ�collectionsZurllib.parserZurllib.request�__all__�
namedtuplerrr6r.rrrr�<module>sBurllib/__pycache__/error.cpython-38.opt-1.pyc000064400000005373151153537540015006 0ustar00U

e5dH
�@sPdZddlZdddgZGdd�de�ZGdd�deejj�ZGdd�de�Z	dS)	a�Exception classes raised by urllib.

The base exception class is URLError, which inherits from OSError.  It
doesn't define any behavior of its own, but is the base class for all
exceptions defined in this package.

HTTPError is an exception class that is also a valid HTTP response
instance.  It behaves this way because HTTP protocol errors are valid
responses, with a status code, headers, and a body.  In some contexts,
an application may want to handle an exception like a regular
response.
�N�URLError�	HTTPError�ContentTooShortErrorc@seZdZddd�Zdd�ZdS)rNcCs |f|_||_|dk	r||_dS�N)�args�reason�filename)�selfrr�r
�$/usr/lib64/python3.8/urllib/error.py�__init__szURLError.__init__cCs
d|jS)Nz<urlopen error %s>)r�r	r
r
r�__str__szURLError.__str__)N)�__name__�
__module__�__qualname__rrr
r
r
rrs
c@sXeZdZdZejjjZdd�Zdd�Z	dd�Z
edd	��Zed
d��Z
e
jdd��Z
d
S)rzBRaised when HTTP error occurs, but also acts like non-error returncCs:||_||_||_||_||_|dk	r6|�||||�dSr)�code�msg�hdrs�fpr�_HTTPError__super_init)r	Zurlrrrrr
r
rr'szHTTPError.__init__cCsd|j|jfS)NzHTTP Error %s: %s�rrr
r
r
rr4szHTTPError.__str__cCsd|j|jfS)Nz<HTTPError %s: %r>rr
r
r
r�__repr__7szHTTPError.__repr__cCs|jSr)rr
r
r
rr<szHTTPError.reasoncCs|jSr�rr
r
r
r�headers@szHTTPError.headerscCs
||_dSrr)r	rr
r
rrDsN)rrr�__doc__�urllib�response�
addinfourlrrrr�propertyrr�setterr
r
r
rr#s



c@seZdZdZdd�ZdS)rzDException raised when downloaded size does not match content-length.cCst�||�||_dSr)rr�content)r	�messager!r
r
rrKszContentTooShortError.__init__N)rrrrrr
r
r
rrIs)
rZurllib.responser�__all__�OSErrorrrrrrr
r
r
r�<module>s


&urllib/__pycache__/error.cpython-38.opt-2.pyc000064400000004130151153537540014775 0ustar00U

e5dH
�@sLddlZdddgZGdd�de�ZGdd�deejj�ZGdd�de�ZdS)�N�URLError�	HTTPError�ContentTooShortErrorc@seZdZddd�Zdd�ZdS)rNcCs |f|_||_|dk	r||_dS�N)�args�reason�filename)�selfrr�r
�$/usr/lib64/python3.8/urllib/error.py�__init__szURLError.__init__cCs
d|jS)Nz<urlopen error %s>)r�r	r
r
r�__str__szURLError.__str__)N)�__name__�
__module__�__qualname__rrr
r
r
rrs
c@sTeZdZejjjZdd�Zdd�Zdd�Z	e
dd��Ze
d	d
��Zej
dd
��ZdS)
rcCs:||_||_||_||_||_|dk	r6|�||||�dSr)�code�msg�hdrs�fpr�_HTTPError__super_init)r	Zurlrrrrr
r
rr'szHTTPError.__init__cCsd|j|jfS)NzHTTP Error %s: %s�rrr
r
r
rr4szHTTPError.__str__cCsd|j|jfS)Nz<HTTPError %s: %r>rr
r
r
r�__repr__7szHTTPError.__repr__cCs|jSr)rr
r
r
rr<szHTTPError.reasoncCs|jSr�rr
r
r
r�headers@szHTTPError.headerscCs
||_dSrr)r	rr
r
rrDsN)rrr�urllib�response�
addinfourlrrrr�propertyrr�setterr
r
r
rr#s



c@seZdZdd�ZdS)rcCst�||�||_dSr)rr�content)r	�messager r
r
rrKszContentTooShortError.__init__N)rrrrr
r
r
rrIs)	Zurllib.responser�__all__�OSErrorrrrrrr
r
r
r�<module>s
&urllib/__pycache__/__init__.cpython-38.pyc000064400000000202151153537540014437 0ustar00U

��.e�@sdS)N�rrr�'/usr/lib64/python3.8/urllib/__init__.py�<module>�urllib/parse.py000064400000131675151153537540007547 0ustar00"""Parse (absolute and relative) URLs.

urlparse module is based upon the following RFC specifications.

RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding
and L.  Masinter, January 2005.

RFC 2732 : "Format for Literal IPv6 Addresses in URL's by R.Hinden, B.Carpenter
and L.Masinter, December 1999.

RFC 2396:  "Uniform Resource Identifiers (URI)": Generic Syntax by T.
Berners-Lee, R. Fielding, and L. Masinter, August 1998.

RFC 2368: "The mailto URL scheme", by P.Hoffman , L Masinter, J. Zawinski, July 1998.

RFC 1808: "Relative Uniform Resource Locators", by R. Fielding, UC Irvine, June
1995.

RFC 1738: "Uniform Resource Locators (URL)" by T. Berners-Lee, L. Masinter, M.
McCahill, December 1994

RFC 3986 is considered the current standard and any future changes to
urlparse module should conform with it.  The urlparse module is
currently not entirely compliant with this RFC due to defacto
scenarios for parsing, and for backward compatibility purposes, some
parsing quirks from older RFCs are retained. The testcases in
test_urlparse.py provides a good indicator of parsing behavior.

The WHATWG URL Parser spec should also be considered.  We are not compliant with
it either due to existing user code API behavior expectations (Hyrum's Law).
It serves as a useful guide when making changes.
"""

import re
import os
import sys
import collections
import warnings

__all__ = ["urlparse", "urlunparse", "urljoin", "urldefrag",
           "urlsplit", "urlunsplit", "urlencode", "parse_qs",
           "parse_qsl", "quote", "quote_plus", "quote_from_bytes",
           "unquote", "unquote_plus", "unquote_to_bytes",
           "DefragResult", "ParseResult", "SplitResult",
           "DefragResultBytes", "ParseResultBytes", "SplitResultBytes"]

# A classification of schemes.
# The empty string classifies URLs with no scheme specified,
# being the default value returned by “urlsplit” and “urlparse”.

uses_relative = ['', 'ftp', 'http', 'gopher', 'nntp', 'imap',
                 'wais', 'file', 'https', 'shttp', 'mms',
                 'prospero', 'rtsp', 'rtspu', 'sftp',
                 'svn', 'svn+ssh', 'ws', 'wss']

uses_netloc = ['', 'ftp', 'http', 'gopher', 'nntp', 'telnet',
               'imap', 'wais', 'file', 'mms', 'https', 'shttp',
               'snews', 'prospero', 'rtsp', 'rtspu', 'rsync',
               'svn', 'svn+ssh', 'sftp', 'nfs', 'git', 'git+ssh',
               'ws', 'wss']

uses_params = ['', 'ftp', 'hdl', 'prospero', 'http', 'imap',
               'https', 'shttp', 'rtsp', 'rtspu', 'sip', 'sips',
               'mms', 'sftp', 'tel']

# These are not actually used anymore, but should stay for backwards
# compatibility.  (They are undocumented, but have a public-looking name.)

non_hierarchical = ['gopher', 'hdl', 'mailto', 'news',
                    'telnet', 'wais', 'imap', 'snews', 'sip', 'sips']

uses_query = ['', 'http', 'wais', 'imap', 'https', 'shttp', 'mms',
              'gopher', 'rtsp', 'rtspu', 'sip', 'sips']

uses_fragment = ['', 'ftp', 'hdl', 'http', 'gopher', 'news',
                 'nntp', 'wais', 'https', 'shttp', 'snews',
                 'file', 'prospero']

# Characters valid in scheme names
scheme_chars = ('abcdefghijklmnopqrstuvwxyz'
                'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
                '0123456789'
                '+-.')

# Leading and trailing C0 control and space to be stripped per WHATWG spec.
# == "".join([chr(i) for i in range(0, 0x20 + 1)])
_WHATWG_C0_CONTROL_OR_SPACE = '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f '

# Unsafe bytes to be removed per WHATWG spec
_UNSAFE_URL_BYTES_TO_REMOVE = ['\t', '\r', '\n']

# XXX: Consider replacing with functools.lru_cache
MAX_CACHE_SIZE = 20
_parse_cache = {}

def clear_cache():
    """Clear the parse cache and the quoters cache."""
    _parse_cache.clear()
    _safe_quoters.clear()


# Helpers for bytes handling
# For 3.2, we deliberately require applications that
# handle improperly quoted URLs to do their own
# decoding and encoding. If valid use cases are
# presented, we may relax this by using latin-1
# decoding internally for 3.3
_implicit_encoding = 'ascii'
_implicit_errors = 'strict'

def _noop(obj):
    return obj

def _encode_result(obj, encoding=_implicit_encoding,
                        errors=_implicit_errors):
    return obj.encode(encoding, errors)

def _decode_args(args, encoding=_implicit_encoding,
                       errors=_implicit_errors):
    return tuple(x.decode(encoding, errors) if x else '' for x in args)

def _coerce_args(*args):
    # Invokes decode if necessary to create str args
    # and returns the coerced inputs along with
    # an appropriate result coercion function
    #   - noop for str inputs
    #   - encoding function otherwise
    str_input = isinstance(args[0], str)
    for arg in args[1:]:
        # We special-case the empty string to support the
        # "scheme=''" default argument to some functions
        if arg and isinstance(arg, str) != str_input:
            raise TypeError("Cannot mix str and non-str arguments")
    if str_input:
        return args + (_noop,)
    return _decode_args(args) + (_encode_result,)

# Result objects are more helpful than simple tuples
class _ResultMixinStr(object):
    """Standard approach to encoding parsed results from str to bytes"""
    __slots__ = ()

    def encode(self, encoding='ascii', errors='strict'):
        return self._encoded_counterpart(*(x.encode(encoding, errors) for x in self))


class _ResultMixinBytes(object):
    """Standard approach to decoding parsed results from bytes to str"""
    __slots__ = ()

    def decode(self, encoding='ascii', errors='strict'):
        return self._decoded_counterpart(*(x.decode(encoding, errors) for x in self))


class _NetlocResultMixinBase(object):
    """Shared methods for the parsed result objects containing a netloc element"""
    __slots__ = ()

    @property
    def username(self):
        return self._userinfo[0]

    @property
    def password(self):
        return self._userinfo[1]

    @property
    def hostname(self):
        hostname = self._hostinfo[0]
        if not hostname:
            return None
        # Scoped IPv6 address may have zone info, which must not be lowercased
        # like http://[fe80::822a:a8ff:fe49:470c%tESt]:1234/keys
        separator = '%' if isinstance(hostname, str) else b'%'
        hostname, percent, zone = hostname.partition(separator)
        return hostname.lower() + percent + zone

    @property
    def port(self):
        port = self._hostinfo[1]
        if port is not None:
            try:
                port = int(port, 10)
            except ValueError:
                message = f'Port could not be cast to integer value as {port!r}'
                raise ValueError(message) from None
            if not ( 0 <= port <= 65535):
                raise ValueError("Port out of range 0-65535")
        return port


class _NetlocResultMixinStr(_NetlocResultMixinBase, _ResultMixinStr):
    __slots__ = ()

    @property
    def _userinfo(self):
        netloc = self.netloc
        userinfo, have_info, hostinfo = netloc.rpartition('@')
        if have_info:
            username, have_password, password = userinfo.partition(':')
            if not have_password:
                password = None
        else:
            username = password = None
        return username, password

    @property
    def _hostinfo(self):
        netloc = self.netloc
        _, _, hostinfo = netloc.rpartition('@')
        _, have_open_br, bracketed = hostinfo.partition('[')
        if have_open_br:
            hostname, _, port = bracketed.partition(']')
            _, _, port = port.partition(':')
        else:
            hostname, _, port = hostinfo.partition(':')
        if not port:
            port = None
        return hostname, port


class _NetlocResultMixinBytes(_NetlocResultMixinBase, _ResultMixinBytes):
    __slots__ = ()

    @property
    def _userinfo(self):
        netloc = self.netloc
        userinfo, have_info, hostinfo = netloc.rpartition(b'@')
        if have_info:
            username, have_password, password = userinfo.partition(b':')
            if not have_password:
                password = None
        else:
            username = password = None
        return username, password

    @property
    def _hostinfo(self):
        netloc = self.netloc
        _, _, hostinfo = netloc.rpartition(b'@')
        _, have_open_br, bracketed = hostinfo.partition(b'[')
        if have_open_br:
            hostname, _, port = bracketed.partition(b']')
            _, _, port = port.partition(b':')
        else:
            hostname, _, port = hostinfo.partition(b':')
        if not port:
            port = None
        return hostname, port


from collections import namedtuple

_DefragResultBase = namedtuple('DefragResult', 'url fragment')
_SplitResultBase = namedtuple(
    'SplitResult', 'scheme netloc path query fragment')
_ParseResultBase = namedtuple(
    'ParseResult', 'scheme netloc path params query fragment')

_DefragResultBase.__doc__ = """
DefragResult(url, fragment)

A 2-tuple that contains the url without fragment identifier and the fragment
identifier as a separate argument.
"""

_DefragResultBase.url.__doc__ = """The URL with no fragment identifier."""

_DefragResultBase.fragment.__doc__ = """
Fragment identifier separated from URL, that allows indirect identification of a
secondary resource by reference to a primary resource and additional identifying
information.
"""

_SplitResultBase.__doc__ = """
SplitResult(scheme, netloc, path, query, fragment)

A 5-tuple that contains the different components of a URL. Similar to
ParseResult, but does not split params.
"""

_SplitResultBase.scheme.__doc__ = """Specifies URL scheme for the request."""

_SplitResultBase.netloc.__doc__ = """
Network location where the request is made to.
"""

_SplitResultBase.path.__doc__ = """
The hierarchical path, such as the path to a file to download.
"""

_SplitResultBase.query.__doc__ = """
The query component, that contains non-hierarchical data, that along with data
in path component, identifies a resource in the scope of URI's scheme and
network location.
"""

_SplitResultBase.fragment.__doc__ = """
Fragment identifier, that allows indirect identification of a secondary resource
by reference to a primary resource and additional identifying information.
"""

_ParseResultBase.__doc__ = """
ParseResult(scheme, netloc, path, params, query, fragment)

A 6-tuple that contains components of a parsed URL.
"""

_ParseResultBase.scheme.__doc__ = _SplitResultBase.scheme.__doc__
_ParseResultBase.netloc.__doc__ = _SplitResultBase.netloc.__doc__
_ParseResultBase.path.__doc__ = _SplitResultBase.path.__doc__
_ParseResultBase.params.__doc__ = """
Parameters for last path element used to dereference the URI in order to provide
access to perform some operation on the resource.
"""

_ParseResultBase.query.__doc__ = _SplitResultBase.query.__doc__
_ParseResultBase.fragment.__doc__ = _SplitResultBase.fragment.__doc__


# For backwards compatibility, alias _NetlocResultMixinStr
# ResultBase is no longer part of the documented API, but it is
# retained since deprecating it isn't worth the hassle
ResultBase = _NetlocResultMixinStr

# Structured result objects for string data
class DefragResult(_DefragResultBase, _ResultMixinStr):
    __slots__ = ()
    def geturl(self):
        if self.fragment:
            return self.url + '#' + self.fragment
        else:
            return self.url

class SplitResult(_SplitResultBase, _NetlocResultMixinStr):
    __slots__ = ()
    def geturl(self):
        return urlunsplit(self)

class ParseResult(_ParseResultBase, _NetlocResultMixinStr):
    __slots__ = ()
    def geturl(self):
        return urlunparse(self)

# Structured result objects for bytes data
class DefragResultBytes(_DefragResultBase, _ResultMixinBytes):
    __slots__ = ()
    def geturl(self):
        if self.fragment:
            return self.url + b'#' + self.fragment
        else:
            return self.url

class SplitResultBytes(_SplitResultBase, _NetlocResultMixinBytes):
    __slots__ = ()
    def geturl(self):
        return urlunsplit(self)

class ParseResultBytes(_ParseResultBase, _NetlocResultMixinBytes):
    __slots__ = ()
    def geturl(self):
        return urlunparse(self)

# Set up the encode/decode result pairs
def _fix_result_transcoding():
    _result_pairs = (
        (DefragResult, DefragResultBytes),
        (SplitResult, SplitResultBytes),
        (ParseResult, ParseResultBytes),
    )
    for _decoded, _encoded in _result_pairs:
        _decoded._encoded_counterpart = _encoded
        _encoded._decoded_counterpart = _decoded

_fix_result_transcoding()
del _fix_result_transcoding

def urlparse(url, scheme='', allow_fragments=True):
    """Parse a URL into 6 components:
    <scheme>://<netloc>/<path>;<params>?<query>#<fragment>
    Return a 6-tuple: (scheme, netloc, path, params, query, fragment).
    Note that we don't break the components up in smaller bits
    (e.g. netloc is a single string) and we don't expand % escapes."""
    url, scheme, _coerce_result = _coerce_args(url, scheme)
    splitresult = urlsplit(url, scheme, allow_fragments)
    scheme, netloc, url, query, fragment = splitresult
    if scheme in uses_params and ';' in url:
        url, params = _splitparams(url)
    else:
        params = ''
    result = ParseResult(scheme, netloc, url, params, query, fragment)
    return _coerce_result(result)

def _splitparams(url):
    if '/'  in url:
        i = url.find(';', url.rfind('/'))
        if i < 0:
            return url, ''
    else:
        i = url.find(';')
    return url[:i], url[i+1:]

def _splitnetloc(url, start=0):
    delim = len(url)   # position of end of domain part of url, default is end
    for c in '/?#':    # look for delimiters; the order is NOT important
        wdelim = url.find(c, start)        # find first of this delim
        if wdelim >= 0:                    # if found
            delim = min(delim, wdelim)     # use earliest delim position
    return url[start:delim], url[delim:]   # return (domain, rest)

def _checknetloc(netloc):
    if not netloc or netloc.isascii():
        return
    # looking for characters like \u2100 that expand to 'a/c'
    # IDNA uses NFKC equivalence, so normalize for this check
    import unicodedata
    n = netloc.replace('@', '')   # ignore characters already included
    n = n.replace(':', '')        # but not the surrounding text
    n = n.replace('#', '')
    n = n.replace('?', '')
    netloc2 = unicodedata.normalize('NFKC', n)
    if n == netloc2:
        return
    for c in '/?#@:':
        if c in netloc2:
            raise ValueError("netloc '" + netloc + "' contains invalid " +
                             "characters under NFKC normalization")

def _remove_unsafe_bytes_from_url(url):
    for b in _UNSAFE_URL_BYTES_TO_REMOVE:
        url = url.replace(b, "")
    return url

def urlsplit(url, scheme='', allow_fragments=True):
    """Parse a URL into 5 components:
    <scheme>://<netloc>/<path>?<query>#<fragment>
    Return a 5-tuple: (scheme, netloc, path, query, fragment).
    Note that we don't break the components up in smaller bits
    (e.g. netloc is a single string) and we don't expand % escapes."""
    url, scheme, _coerce_result = _coerce_args(url, scheme)
    url = _remove_unsafe_bytes_from_url(url)
    scheme = _remove_unsafe_bytes_from_url(scheme)
    # Only lstrip url as some applications rely on preserving trailing space.
    # (https://url.spec.whatwg.org/#concept-basic-url-parser would strip both)
    url = url.lstrip(_WHATWG_C0_CONTROL_OR_SPACE)
    scheme = scheme.strip(_WHATWG_C0_CONTROL_OR_SPACE)
    allow_fragments = bool(allow_fragments)
    key = url, scheme, allow_fragments, type(url), type(scheme)
    cached = _parse_cache.get(key, None)
    if cached:
        return _coerce_result(cached)
    if len(_parse_cache) >= MAX_CACHE_SIZE: # avoid runaway growth
        clear_cache()
    netloc = query = fragment = ''
    i = url.find(':')
    if i > 0:
        if url[:i] == 'http': # optimize the common case
            url = url[i+1:]
            if url[:2] == '//':
                netloc, url = _splitnetloc(url, 2)
                if (('[' in netloc and ']' not in netloc) or
                        (']' in netloc and '[' not in netloc)):
                    raise ValueError("Invalid IPv6 URL")
            if allow_fragments and '#' in url:
                url, fragment = url.split('#', 1)
            if '?' in url:
                url, query = url.split('?', 1)
            _checknetloc(netloc)
            v = SplitResult('http', netloc, url, query, fragment)
            _parse_cache[key] = v
            return _coerce_result(v)
        for c in url[:i]:
            if c not in scheme_chars:
                break
        else:
            # make sure "url" is not actually a port number (in which case
            # "scheme" is really part of the path)
            rest = url[i+1:]
            if not rest or any(c not in '0123456789' for c in rest):
                # not a port number
                scheme, url = url[:i].lower(), rest

    if url[:2] == '//':
        netloc, url = _splitnetloc(url, 2)
        if (('[' in netloc and ']' not in netloc) or
                (']' in netloc and '[' not in netloc)):
            raise ValueError("Invalid IPv6 URL")
    if allow_fragments and '#' in url:
        url, fragment = url.split('#', 1)
    if '?' in url:
        url, query = url.split('?', 1)
    _checknetloc(netloc)
    v = SplitResult(scheme, netloc, url, query, fragment)
    _parse_cache[key] = v
    return _coerce_result(v)

def urlunparse(components):
    """Put a parsed URL back together again.  This may result in a
    slightly different, but equivalent URL, if the URL that was parsed
    originally had redundant delimiters, e.g. a ? with an empty query
    (the draft states that these are equivalent)."""
    scheme, netloc, url, params, query, fragment, _coerce_result = (
                                                  _coerce_args(*components))
    if params:
        url = "%s;%s" % (url, params)
    return _coerce_result(urlunsplit((scheme, netloc, url, query, fragment)))

def urlunsplit(components):
    """Combine the elements of a tuple as returned by urlsplit() into a
    complete URL as a string. The data argument can be any five-item iterable.
    This may result in a slightly different, but equivalent URL, if the URL that
    was parsed originally had unnecessary delimiters (for example, a ? with an
    empty query; the RFC states that these are equivalent)."""
    scheme, netloc, url, query, fragment, _coerce_result = (
                                          _coerce_args(*components))
    if netloc or (scheme and scheme in uses_netloc and url[:2] != '//'):
        if url and url[:1] != '/': url = '/' + url
        url = '//' + (netloc or '') + url
    if scheme:
        url = scheme + ':' + url
    if query:
        url = url + '?' + query
    if fragment:
        url = url + '#' + fragment
    return _coerce_result(url)

def urljoin(base, url, allow_fragments=True):
    """Join a base URL and a possibly relative URL to form an absolute
    interpretation of the latter."""
    if not base:
        return url
    if not url:
        return base

    base, url, _coerce_result = _coerce_args(base, url)
    bscheme, bnetloc, bpath, bparams, bquery, bfragment = \
            urlparse(base, '', allow_fragments)
    scheme, netloc, path, params, query, fragment = \
            urlparse(url, bscheme, allow_fragments)

    if scheme != bscheme or scheme not in uses_relative:
        return _coerce_result(url)
    if scheme in uses_netloc:
        if netloc:
            return _coerce_result(urlunparse((scheme, netloc, path,
                                              params, query, fragment)))
        netloc = bnetloc

    if not path and not params:
        path = bpath
        params = bparams
        if not query:
            query = bquery
        return _coerce_result(urlunparse((scheme, netloc, path,
                                          params, query, fragment)))

    base_parts = bpath.split('/')
    if base_parts[-1] != '':
        # the last item is not a directory, so will not be taken into account
        # in resolving the relative path
        del base_parts[-1]

    # for rfc3986, ignore all base path should the first character be root.
    if path[:1] == '/':
        segments = path.split('/')
    else:
        segments = base_parts + path.split('/')
        # filter out elements that would cause redundant slashes on re-joining
        # the resolved_path
        segments[1:-1] = filter(None, segments[1:-1])

    resolved_path = []

    for seg in segments:
        if seg == '..':
            try:
                resolved_path.pop()
            except IndexError:
                # ignore any .. segments that would otherwise cause an IndexError
                # when popped from resolved_path if resolving for rfc3986
                pass
        elif seg == '.':
            continue
        else:
            resolved_path.append(seg)

    if segments[-1] in ('.', '..'):
        # do some post-processing here. if the last segment was a relative dir,
        # then we need to append the trailing '/'
        resolved_path.append('')

    return _coerce_result(urlunparse((scheme, netloc, '/'.join(
        resolved_path) or '/', params, query, fragment)))


def urldefrag(url):
    """Removes any existing fragment from URL.

    Returns a tuple of the defragmented URL and the fragment.  If
    the URL contained no fragments, the second element is the
    empty string.
    """
    url, _coerce_result = _coerce_args(url)
    if '#' in url:
        s, n, p, a, q, frag = urlparse(url)
        defrag = urlunparse((s, n, p, a, q, ''))
    else:
        frag = ''
        defrag = url
    return _coerce_result(DefragResult(defrag, frag))

_hexdig = '0123456789ABCDEFabcdef'
_hextobyte = None

def unquote_to_bytes(string):
    """unquote_to_bytes('abc%20def') -> b'abc def'."""
    # Note: strings are encoded as UTF-8. This is only an issue if it contains
    # unescaped non-ASCII characters, which URIs should not.
    if not string:
        # Is it a string-like object?
        string.split
        return b''
    if isinstance(string, str):
        string = string.encode('utf-8')
    bits = string.split(b'%')
    if len(bits) == 1:
        return string
    res = [bits[0]]
    append = res.append
    # Delay the initialization of the table to not waste memory
    # if the function is never called
    global _hextobyte
    if _hextobyte is None:
        _hextobyte = {(a + b).encode(): bytes.fromhex(a + b)
                      for a in _hexdig for b in _hexdig}
    for item in bits[1:]:
        try:
            append(_hextobyte[item[:2]])
            append(item[2:])
        except KeyError:
            append(b'%')
            append(item)
    return b''.join(res)

_asciire = re.compile('([\x00-\x7f]+)')

def unquote(string, encoding='utf-8', errors='replace'):
    """Replace %xx escapes by their single-character equivalent. The optional
    encoding and errors parameters specify how to decode percent-encoded
    sequences into Unicode characters, as accepted by the bytes.decode()
    method.
    By default, percent-encoded sequences are decoded with UTF-8, and invalid
    sequences are replaced by a placeholder character.

    unquote('abc%20def') -> 'abc def'.
    """
    if isinstance(string, bytes):
        raise TypeError('Expected str, got bytes')
    if '%' not in string:
        string.split
        return string
    if encoding is None:
        encoding = 'utf-8'
    if errors is None:
        errors = 'replace'
    bits = _asciire.split(string)
    res = [bits[0]]
    append = res.append
    for i in range(1, len(bits), 2):
        append(unquote_to_bytes(bits[i]).decode(encoding, errors))
        append(bits[i + 1])
    return ''.join(res)


def parse_qs(qs, keep_blank_values=False, strict_parsing=False,
             encoding='utf-8', errors='replace', max_num_fields=None, separator=None):
    """Parse a query given as a string argument.

        Arguments:

        qs: percent-encoded query string to be parsed

        keep_blank_values: flag indicating whether blank values in
            percent-encoded queries should be treated as blank strings.
            A true value indicates that blanks should be retained as
            blank strings.  The default false value indicates that
            blank values are to be ignored and treated as if they were
            not included.

        strict_parsing: flag indicating what to do with parsing errors.
            If false (the default), errors are silently ignored.
            If true, errors raise a ValueError exception.

        encoding and errors: specify how to decode percent-encoded sequences
            into Unicode characters, as accepted by the bytes.decode() method.

        max_num_fields: int. If set, then throws a ValueError if there
            are more than n fields read by parse_qsl().

        separator: str. The symbol to use for separating the query arguments.
            Defaults to &.

        Returns a dictionary.
    """
    parsed_result = {}
    pairs = parse_qsl(qs, keep_blank_values, strict_parsing,
                      encoding=encoding, errors=errors,
                      max_num_fields=max_num_fields, separator=separator)
    for name, value in pairs:
        if name in parsed_result:
            parsed_result[name].append(value)
        else:
            parsed_result[name] = [value]
    return parsed_result

class _QueryStringSeparatorWarning(RuntimeWarning):
    """Warning for using default `separator` in parse_qs or parse_qsl"""

# The default "separator" for parse_qsl can be specified in a config file.
# It's cached after first read.
_QS_SEPARATOR_CONFIG_FILENAME = '/etc/python/urllib.cfg'
_default_qs_separator = None

def parse_qsl(qs, keep_blank_values=False, strict_parsing=False,
              encoding='utf-8', errors='replace', max_num_fields=None, separator=None):
    """Parse a query given as a string argument.

        Arguments:

        qs: percent-encoded query string to be parsed

        keep_blank_values: flag indicating whether blank values in
            percent-encoded queries should be treated as blank strings.
            A true value indicates that blanks should be retained as blank
            strings.  The default false value indicates that blank values
            are to be ignored and treated as if they were  not included.

        strict_parsing: flag indicating what to do with parsing errors. If
            false (the default), errors are silently ignored. If true,
            errors raise a ValueError exception.

        encoding and errors: specify how to decode percent-encoded sequences
            into Unicode characters, as accepted by the bytes.decode() method.

        max_num_fields: int. If set, then throws a ValueError
            if there are more than n fields read by parse_qsl().

        separator: str. The symbol to use for separating the query arguments.
            Defaults to &.

        Returns a list, as G-d intended.
    """
    qs, _coerce_result = _coerce_args(qs)

    if isinstance(separator, bytes):
        separator = separator.decode('ascii')

    if (not separator or (not isinstance(separator, (str, bytes)))) and separator is not None:
        raise ValueError("Separator must be of type string or bytes.")

    # Used when both "&" and ";" act as separators. (Need a non-string value.)
    _legacy = object()

    if separator is None:
        global _default_qs_separator
        separator = _default_qs_separator
        envvar_name = 'PYTHON_URLLIB_QS_SEPARATOR'
        if separator is None:
            # Set default separator from environment variable
            separator = os.environ.get(envvar_name)
            config_source = 'environment variable'
        if separator is None:
            # Set default separator from the configuration file
            try:
                file = open(_QS_SEPARATOR_CONFIG_FILENAME)
            except FileNotFoundError:
                pass
            else:
                with file:
                    import configparser
                    config = configparser.ConfigParser(
                        interpolation=None,
                        comment_prefixes=('#', ),
                    )
                    config.read_file(file)
                    separator = config.get('parse_qs', envvar_name, fallback=None)
                    _default_qs_separator = separator
                config_source = _QS_SEPARATOR_CONFIG_FILENAME
        if separator is None:
            # The default is '&', but warn if not specified explicitly
            if ';' in qs:
                from warnings import warn
                warn("The default separator of urllib.parse.parse_qsl and "
                    + "parse_qs was changed to '&' to avoid a web cache "
                    + "poisoning issue (CVE-2021-23336). "
                    + "By default, semicolons no longer act as query field "
                    + "separators. "
                    + "See https://access.redhat.com/articles/5860431 for "
                    + "more details.",
                    _QueryStringSeparatorWarning, stacklevel=2)
            separator = '&'
        elif separator == 'legacy':
            separator = _legacy
        elif len(separator) != 1:
            raise ValueError(
                f'{envvar_name} (from {config_source}) must contain '
                + '1 character, or "legacy". See '
                + 'https://access.redhat.com/articles/5860431 for more details.'
            )

    # If max_num_fields is defined then check that the number of fields
    # is less than max_num_fields. This prevents a memory exhaustion DOS
    # attack via post bodies with many fields.
    if max_num_fields is not None:
        if separator is _legacy:
            num_fields = 1 + qs.count('&') + qs.count(';')
        else:
            num_fields = 1 + qs.count(separator)
        if max_num_fields < num_fields:
            raise ValueError('Max number of fields exceeded')

    if separator is _legacy:
        pairs = [s2 for s1 in qs.split('&') for s2 in s1.split(';')]
    else:
        pairs = [s1 for s1 in qs.split(separator)]
    r = []
    for name_value in pairs:
        if not name_value and not strict_parsing:
            continue
        nv = name_value.split('=', 1)
        if len(nv) != 2:
            if strict_parsing:
                raise ValueError("bad query field: %r" % (name_value,))
            # Handle case of a control-name with no equal sign
            if keep_blank_values:
                nv.append('')
            else:
                continue
        if len(nv[1]) or keep_blank_values:
            name = nv[0].replace('+', ' ')
            name = unquote(name, encoding=encoding, errors=errors)
            name = _coerce_result(name)
            value = nv[1].replace('+', ' ')
            value = unquote(value, encoding=encoding, errors=errors)
            value = _coerce_result(value)
            r.append((name, value))
    return r

def unquote_plus(string, encoding='utf-8', errors='replace'):
    """Like unquote(), but also replace plus signs by spaces, as required for
    unquoting HTML form values.

    unquote_plus('%7e/abc+def') -> '~/abc def'
    """
    string = string.replace('+', ' ')
    return unquote(string, encoding, errors)

_ALWAYS_SAFE = frozenset(b'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
                         b'abcdefghijklmnopqrstuvwxyz'
                         b'0123456789'
                         b'_.-~')
_ALWAYS_SAFE_BYTES = bytes(_ALWAYS_SAFE)
_safe_quoters = {}

class Quoter(collections.defaultdict):
    """A mapping from bytes (in range(0,256)) to strings.

    String values are percent-encoded byte values, unless the key < 128, and
    in the "safe" set (either the specified safe set, or default set).
    """
    # Keeps a cache internally, using defaultdict, for efficiency (lookups
    # of cached keys don't call Python code at all).
    def __init__(self, safe):
        """safe: bytes object."""
        self.safe = _ALWAYS_SAFE.union(safe)

    def __repr__(self):
        # Without this, will just display as a defaultdict
        return "<%s %r>" % (self.__class__.__name__, dict(self))

    def __missing__(self, b):
        # Handle a cache miss. Store quoted string in cache and return.
        res = chr(b) if b in self.safe else '%{:02X}'.format(b)
        self[b] = res
        return res

def quote(string, safe='/', encoding=None, errors=None):
    """quote('abc def') -> 'abc%20def'

    Each part of a URL, e.g. the path info, the query, etc., has a
    different set of reserved characters that must be quoted. The
    quote function offers a cautious (not minimal) way to quote a
    string for most of these parts.

    RFC 3986 Uniform Resource Identifier (URI): Generic Syntax lists
    the following (un)reserved characters.

    unreserved    = ALPHA / DIGIT / "-" / "." / "_" / "~"
    reserved      = gen-delims / sub-delims
    gen-delims    = ":" / "/" / "?" / "#" / "[" / "]" / "@"
    sub-delims    = "!" / "$" / "&" / "'" / "(" / ")"
                  / "*" / "+" / "," / ";" / "="

    Each of the reserved characters is reserved in some component of a URL,
    but not necessarily in all of them.

    The quote function %-escapes all characters that are neither in the
    unreserved chars ("always safe") nor the additional chars set via the
    safe arg.

    The default for the safe arg is '/'. The character is reserved, but in
    typical usage the quote function is being called on a path where the
    existing slash characters are to be preserved.

    Python 3.7 updates from using RFC 2396 to RFC 3986 to quote URL strings.
    Now, "~" is included in the set of unreserved characters.

    string and safe may be either str or bytes objects. encoding and errors
    must not be specified if string is a bytes object.

    The optional encoding and errors parameters specify how to deal with
    non-ASCII characters, as accepted by the str.encode method.
    By default, encoding='utf-8' (characters are encoded with UTF-8), and
    errors='strict' (unsupported characters raise a UnicodeEncodeError).
    """
    if isinstance(string, str):
        if not string:
            return string
        if encoding is None:
            encoding = 'utf-8'
        if errors is None:
            errors = 'strict'
        string = string.encode(encoding, errors)
    else:
        if encoding is not None:
            raise TypeError("quote() doesn't support 'encoding' for bytes")
        if errors is not None:
            raise TypeError("quote() doesn't support 'errors' for bytes")
    return quote_from_bytes(string, safe)

def quote_plus(string, safe='', encoding=None, errors=None):
    """Like quote(), but also replace ' ' with '+', as required for quoting
    HTML form values. Plus signs in the original string are escaped unless
    they are included in safe. It also does not have safe default to '/'.
    """
    # Check if ' ' in string, where string may either be a str or bytes.  If
    # there are no spaces, the regular quote will produce the right answer.
    if ((isinstance(string, str) and ' ' not in string) or
        (isinstance(string, bytes) and b' ' not in string)):
        return quote(string, safe, encoding, errors)
    if isinstance(safe, str):
        space = ' '
    else:
        space = b' '
    string = quote(string, safe + space, encoding, errors)
    return string.replace(' ', '+')

def quote_from_bytes(bs, safe='/'):
    """Like quote(), but accepts a bytes object rather than a str, and does
    not perform string-to-bytes encoding.  It always returns an ASCII string.
    quote_from_bytes(b'abc def\x3f') -> 'abc%20def%3f'
    """
    if not isinstance(bs, (bytes, bytearray)):
        raise TypeError("quote_from_bytes() expected bytes")
    if not bs:
        return ''
    if isinstance(safe, str):
        # Normalize 'safe' by converting to bytes and removing non-ASCII chars
        safe = safe.encode('ascii', 'ignore')
    else:
        safe = bytes([c for c in safe if c < 128])
    if not bs.rstrip(_ALWAYS_SAFE_BYTES + safe):
        return bs.decode()
    try:
        quoter = _safe_quoters[safe]
    except KeyError:
        _safe_quoters[safe] = quoter = Quoter(safe).__getitem__
    return ''.join([quoter(char) for char in bs])

def urlencode(query, doseq=False, safe='', encoding=None, errors=None,
              quote_via=quote_plus):
    """Encode a dict or sequence of two-element tuples into a URL query string.

    If any values in the query arg are sequences and doseq is true, each
    sequence element is converted to a separate parameter.

    If the query arg is a sequence of two-element tuples, the order of the
    parameters in the output will match the order of parameters in the
    input.

    The components of a query arg may each be either a string or a bytes type.

    The safe, encoding, and errors parameters are passed down to the function
    specified by quote_via (encoding and errors only if a component is a str).
    """

    if hasattr(query, "items"):
        query = query.items()
    else:
        # It's a bother at times that strings and string-like objects are
        # sequences.
        try:
            # non-sequence items should not work with len()
            # non-empty strings will fail this
            if len(query) and not isinstance(query[0], tuple):
                raise TypeError
            # Zero-length sequences of all types will get here and succeed,
            # but that's a minor nit.  Since the original implementation
            # allowed empty dicts that type of behavior probably should be
            # preserved for consistency
        except TypeError:
            ty, va, tb = sys.exc_info()
            raise TypeError("not a valid non-string sequence "
                            "or mapping object").with_traceback(tb)

    l = []
    if not doseq:
        for k, v in query:
            if isinstance(k, bytes):
                k = quote_via(k, safe)
            else:
                k = quote_via(str(k), safe, encoding, errors)

            if isinstance(v, bytes):
                v = quote_via(v, safe)
            else:
                v = quote_via(str(v), safe, encoding, errors)
            l.append(k + '=' + v)
    else:
        for k, v in query:
            if isinstance(k, bytes):
                k = quote_via(k, safe)
            else:
                k = quote_via(str(k), safe, encoding, errors)

            if isinstance(v, bytes):
                v = quote_via(v, safe)
                l.append(k + '=' + v)
            elif isinstance(v, str):
                v = quote_via(v, safe, encoding, errors)
                l.append(k + '=' + v)
            else:
                try:
                    # Is this a sufficient test for sequence-ness?
                    x = len(v)
                except TypeError:
                    # not a sequence
                    v = quote_via(str(v), safe, encoding, errors)
                    l.append(k + '=' + v)
                else:
                    # loop over the sequence
                    for elt in v:
                        if isinstance(elt, bytes):
                            elt = quote_via(elt, safe)
                        else:
                            elt = quote_via(str(elt), safe, encoding, errors)
                        l.append(k + '=' + elt)
    return '&'.join(l)


def to_bytes(url):
    warnings.warn("urllib.parse.to_bytes() is deprecated as of 3.8",
                  DeprecationWarning, stacklevel=2)
    return _to_bytes(url)


def _to_bytes(url):
    """to_bytes(u"URL") --> 'URL'."""
    # Most URL schemes require ASCII. If that changes, the conversion
    # can be relaxed.
    # XXX get rid of to_bytes()
    if isinstance(url, str):
        try:
            url = url.encode("ASCII").decode()
        except UnicodeError:
            raise UnicodeError("URL " + repr(url) +
                               " contains non-ASCII characters")
    return url


def unwrap(url):
    """Transform a string like '<URL:scheme://host/path>' into 'scheme://host/path'.

    The string is returned unchanged if it's not a wrapped URL.
    """
    url = str(url).strip()
    if url[:1] == '<' and url[-1:] == '>':
        url = url[1:-1].strip()
    if url[:4] == 'URL:':
        url = url[4:].strip()
    return url


def splittype(url):
    warnings.warn("urllib.parse.splittype() is deprecated as of 3.8, "
                  "use urllib.parse.urlparse() instead",
                  DeprecationWarning, stacklevel=2)
    return _splittype(url)


_typeprog = None
def _splittype(url):
    """splittype('type:opaquestring') --> 'type', 'opaquestring'."""
    global _typeprog
    if _typeprog is None:
        _typeprog = re.compile('([^/:]+):(.*)', re.DOTALL)

    match = _typeprog.match(url)
    if match:
        scheme, data = match.groups()
        return scheme.lower(), data
    return None, url


def splithost(url):
    warnings.warn("urllib.parse.splithost() is deprecated as of 3.8, "
                  "use urllib.parse.urlparse() instead",
                  DeprecationWarning, stacklevel=2)
    return _splithost(url)


_hostprog = None
def _splithost(url):
    """splithost('//host[:port]/path') --> 'host[:port]', '/path'."""
    global _hostprog
    if _hostprog is None:
        _hostprog = re.compile('//([^/#?]*)(.*)', re.DOTALL)

    match = _hostprog.match(url)
    if match:
        host_port, path = match.groups()
        if path and path[0] != '/':
            path = '/' + path
        return host_port, path
    return None, url


def splituser(host):
    warnings.warn("urllib.parse.splituser() is deprecated as of 3.8, "
                  "use urllib.parse.urlparse() instead",
                  DeprecationWarning, stacklevel=2)
    return _splituser(host)


def _splituser(host):
    """splituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'."""
    user, delim, host = host.rpartition('@')
    return (user if delim else None), host


def splitpasswd(user):
    warnings.warn("urllib.parse.splitpasswd() is deprecated as of 3.8, "
                  "use urllib.parse.urlparse() instead",
                  DeprecationWarning, stacklevel=2)
    return _splitpasswd(user)


def _splitpasswd(user):
    """splitpasswd('user:passwd') -> 'user', 'passwd'."""
    user, delim, passwd = user.partition(':')
    return user, (passwd if delim else None)


def splitport(host):
    warnings.warn("urllib.parse.splitport() is deprecated as of 3.8, "
                  "use urllib.parse.urlparse() instead",
                  DeprecationWarning, stacklevel=2)
    return _splitport(host)


# splittag('/path#tag') --> '/path', 'tag'
_portprog = None
def _splitport(host):
    """splitport('host:port') --> 'host', 'port'."""
    global _portprog
    if _portprog is None:
        _portprog = re.compile('(.*):([0-9]*)', re.DOTALL)

    match = _portprog.fullmatch(host)
    if match:
        host, port = match.groups()
        if port:
            return host, port
    return host, None


def splitnport(host, defport=-1):
    warnings.warn("urllib.parse.splitnport() is deprecated as of 3.8, "
                  "use urllib.parse.urlparse() instead",
                  DeprecationWarning, stacklevel=2)
    return _splitnport(host, defport)


def _splitnport(host, defport=-1):
    """Split host and port, returning numeric port.
    Return given default port if no ':' found; defaults to -1.
    Return numerical port if a valid number are found after ':'.
    Return None if ':' but not a valid number."""
    host, delim, port = host.rpartition(':')
    if not delim:
        host = port
    elif port:
        try:
            nport = int(port)
        except ValueError:
            nport = None
        return host, nport
    return host, defport


def splitquery(url):
    warnings.warn("urllib.parse.splitquery() is deprecated as of 3.8, "
                  "use urllib.parse.urlparse() instead",
                  DeprecationWarning, stacklevel=2)
    return _splitquery(url)


def _splitquery(url):
    """splitquery('/path?query') --> '/path', 'query'."""
    path, delim, query = url.rpartition('?')
    if delim:
        return path, query
    return url, None


def splittag(url):
    warnings.warn("urllib.parse.splittag() is deprecated as of 3.8, "
                  "use urllib.parse.urlparse() instead",
                  DeprecationWarning, stacklevel=2)
    return _splittag(url)


def _splittag(url):
    """splittag('/path#tag') --> '/path', 'tag'."""
    path, delim, tag = url.rpartition('#')
    if delim:
        return path, tag
    return url, None


def splitattr(url):
    warnings.warn("urllib.parse.splitattr() is deprecated as of 3.8, "
                  "use urllib.parse.urlparse() instead",
                  DeprecationWarning, stacklevel=2)
    return _splitattr(url)


def _splitattr(url):
    """splitattr('/path;attr1=value1;attr2=value2;...') ->
        '/path', ['attr1=value1', 'attr2=value2', ...]."""
    words = url.split(';')
    return words[0], words[1:]


def splitvalue(attr):
    warnings.warn("urllib.parse.splitvalue() is deprecated as of 3.8, "
                  "use urllib.parse.parse_qsl() instead",
                  DeprecationWarning, stacklevel=2)
    return _splitvalue(attr)


def _splitvalue(attr):
    """splitvalue('attr=value') --> 'attr', 'value'."""
    attr, delim, value = attr.partition('=')
    return attr, (value if delim else None)
urllib/request.py000064400000306275151153537540010125 0ustar00"""An extensible library for opening URLs using a variety of protocols

The simplest way to use this module is to call the urlopen function,
which accepts a string containing a URL or a Request object (described
below).  It opens the URL and returns the results as file-like
object; the returned object has some extra methods described below.

The OpenerDirector manages a collection of Handler objects that do
all the actual work.  Each Handler implements a particular protocol or
option.  The OpenerDirector is a composite object that invokes the
Handlers needed to open the requested URL.  For example, the
HTTPHandler performs HTTP GET and POST requests and deals with
non-error returns.  The HTTPRedirectHandler automatically deals with
HTTP 301, 302, 303 and 307 redirect errors, and the HTTPDigestAuthHandler
deals with digest authentication.

urlopen(url, data=None) -- Basic usage is the same as original
urllib.  pass the url and optionally data to post to an HTTP URL, and
get a file-like object back.  One difference is that you can also pass
a Request instance instead of URL.  Raises a URLError (subclass of
OSError); for HTTP errors, raises an HTTPError, which can also be
treated as a valid response.

build_opener -- Function that creates a new OpenerDirector instance.
Will install the default handlers.  Accepts one or more Handlers as
arguments, either instances or Handler classes that it will
instantiate.  If one of the argument is a subclass of the default
handler, the argument will be installed instead of the default.

install_opener -- Installs a new opener as the default opener.

objects of interest:

OpenerDirector -- Sets up the User Agent as the Python-urllib client and manages
the Handler classes, while dealing with requests and responses.

Request -- An object that encapsulates the state of a request.  The
state can be as simple as the URL.  It can also include extra HTTP
headers, e.g. a User-Agent.

BaseHandler --

internals:
BaseHandler and parent
_call_chain conventions

Example usage:

import urllib.request

# set up authentication info
authinfo = urllib.request.HTTPBasicAuthHandler()
authinfo.add_password(realm='PDQ Application',
                      uri='https://mahler:8092/site-updates.py',
                      user='klem',
                      passwd='geheim$parole')

proxy_support = urllib.request.ProxyHandler({"http" : "http://ahad-haam:3128"})

# build a new opener that adds authentication and caching FTP handlers
opener = urllib.request.build_opener(proxy_support, authinfo,
                                     urllib.request.CacheFTPHandler)

# install it
urllib.request.install_opener(opener)

f = urllib.request.urlopen('http://www.python.org/')
"""

# XXX issues:
# If an authentication error handler that tries to perform
# authentication for some reason but fails, how should the error be
# signalled?  The client needs to know the HTTP error code.  But if
# the handler knows that the problem was, e.g., that it didn't know
# that hash algo that requested in the challenge, it would be good to
# pass that information along to the client, too.
# ftp errors aren't handled cleanly
# check digest against correct (i.e. non-apache) implementation

# Possible extensions:
# complex proxies  XXX not sure what exactly was meant by this
# abstract factory for opener

import base64
import bisect
import email
import hashlib
import http.client
import io
import os
import posixpath
import re
import socket
import string
import sys
import time
import tempfile
import contextlib
import warnings


from urllib.error import URLError, HTTPError, ContentTooShortError
from urllib.parse import (
    urlparse, urlsplit, urljoin, unwrap, quote, unquote,
    _splittype, _splithost, _splitport, _splituser, _splitpasswd,
    _splitattr, _splitquery, _splitvalue, _splittag, _to_bytes,
    unquote_to_bytes, urlunparse)
from urllib.response import addinfourl, addclosehook

# check for SSL
try:
    import ssl
except ImportError:
    _have_ssl = False
else:
    _have_ssl = True

__all__ = [
    # Classes
    'Request', 'OpenerDirector', 'BaseHandler', 'HTTPDefaultErrorHandler',
    'HTTPRedirectHandler', 'HTTPCookieProcessor', 'ProxyHandler',
    'HTTPPasswordMgr', 'HTTPPasswordMgrWithDefaultRealm',
    'HTTPPasswordMgrWithPriorAuth', 'AbstractBasicAuthHandler',
    'HTTPBasicAuthHandler', 'ProxyBasicAuthHandler', 'AbstractDigestAuthHandler',
    'HTTPDigestAuthHandler', 'ProxyDigestAuthHandler', 'HTTPHandler',
    'FileHandler', 'FTPHandler', 'CacheFTPHandler', 'DataHandler',
    'UnknownHandler', 'HTTPErrorProcessor',
    # Functions
    'urlopen', 'install_opener', 'build_opener',
    'pathname2url', 'url2pathname', 'getproxies',
    # Legacy interface
    'urlretrieve', 'urlcleanup', 'URLopener', 'FancyURLopener',
]

# used in User-Agent header sent
__version__ = '%d.%d' % sys.version_info[:2]

_opener = None
def urlopen(url, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
            *, cafile=None, capath=None, cadefault=False, context=None):
    '''Open the URL url, which can be either a string or a Request object.

    *data* must be an object specifying additional data to be sent to
    the server, or None if no such data is needed.  See Request for
    details.

    urllib.request module uses HTTP/1.1 and includes a "Connection:close"
    header in its HTTP requests.

    The optional *timeout* parameter specifies a timeout in seconds for
    blocking operations like the connection attempt (if not specified, the
    global default timeout setting will be used). This only works for HTTP,
    HTTPS and FTP connections.

    If *context* is specified, it must be a ssl.SSLContext instance describing
    the various SSL options. See HTTPSConnection for more details.

    The optional *cafile* and *capath* parameters specify a set of trusted CA
    certificates for HTTPS requests. cafile should point to a single file
    containing a bundle of CA certificates, whereas capath should point to a
    directory of hashed certificate files. More information can be found in
    ssl.SSLContext.load_verify_locations().

    The *cadefault* parameter is ignored.

    This function always returns an object which can work as a context
    manager and has methods such as

    * geturl() - return the URL of the resource retrieved, commonly used to
      determine if a redirect was followed

    * info() - return the meta-information of the page, such as headers, in the
      form of an email.message_from_string() instance (see Quick Reference to
      HTTP Headers)

    * getcode() - return the HTTP status code of the response.  Raises URLError
      on errors.

    For HTTP and HTTPS URLs, this function returns a http.client.HTTPResponse
    object slightly modified. In addition to the three new methods above, the
    msg attribute contains the same information as the reason attribute ---
    the reason phrase returned by the server --- instead of the response
    headers as it is specified in the documentation for HTTPResponse.

    For FTP, file, and data URLs and requests explicitly handled by legacy
    URLopener and FancyURLopener classes, this function returns a
    urllib.response.addinfourl object.

    Note that None may be returned if no handler handles the request (though
    the default installed global OpenerDirector uses UnknownHandler to ensure
    this never happens).

    In addition, if proxy settings are detected (for example, when a *_proxy
    environment variable like http_proxy is set), ProxyHandler is default
    installed and makes sure the requests are handled through the proxy.

    '''
    global _opener
    if cafile or capath or cadefault:
        import warnings
        warnings.warn("cafile, capath and cadefault are deprecated, use a "
                      "custom context instead.", DeprecationWarning, 2)
        if context is not None:
            raise ValueError(
                "You can't pass both context and any of cafile, capath, and "
                "cadefault"
            )
        if not _have_ssl:
            raise ValueError('SSL support not available')
        context = ssl.create_default_context(ssl.Purpose.SERVER_AUTH,
                                             cafile=cafile,
                                             capath=capath)
        https_handler = HTTPSHandler(context=context)
        opener = build_opener(https_handler)
    elif context:
        https_handler = HTTPSHandler(context=context)
        opener = build_opener(https_handler)
    elif _opener is None:
        _opener = opener = build_opener()
    else:
        opener = _opener
    return opener.open(url, data, timeout)

def install_opener(opener):
    global _opener
    _opener = opener

_url_tempfiles = []
def urlretrieve(url, filename=None, reporthook=None, data=None):
    """
    Retrieve a URL into a temporary location on disk.

    Requires a URL argument. If a filename is passed, it is used as
    the temporary file location. The reporthook argument should be
    a callable that accepts a block number, a read size, and the
    total file size of the URL target. The data argument should be
    valid URL encoded data.

    If a filename is passed and the URL points to a local resource,
    the result is a copy from local file to new file.

    Returns a tuple containing the path to the newly created
    data file as well as the resulting HTTPMessage object.
    """
    url_type, path = _splittype(url)

    with contextlib.closing(urlopen(url, data)) as fp:
        headers = fp.info()

        # Just return the local path and the "headers" for file://
        # URLs. No sense in performing a copy unless requested.
        if url_type == "file" and not filename:
            return os.path.normpath(path), headers

        # Handle temporary file setup.
        if filename:
            tfp = open(filename, 'wb')
        else:
            tfp = tempfile.NamedTemporaryFile(delete=False)
            filename = tfp.name
            _url_tempfiles.append(filename)

        with tfp:
            result = filename, headers
            bs = 1024*8
            size = -1
            read = 0
            blocknum = 0
            if "content-length" in headers:
                size = int(headers["Content-Length"])

            if reporthook:
                reporthook(blocknum, bs, size)

            while True:
                block = fp.read(bs)
                if not block:
                    break
                read += len(block)
                tfp.write(block)
                blocknum += 1
                if reporthook:
                    reporthook(blocknum, bs, size)

    if size >= 0 and read < size:
        raise ContentTooShortError(
            "retrieval incomplete: got only %i out of %i bytes"
            % (read, size), result)

    return result

def urlcleanup():
    """Clean up temporary files from urlretrieve calls."""
    for temp_file in _url_tempfiles:
        try:
            os.unlink(temp_file)
        except OSError:
            pass

    del _url_tempfiles[:]
    global _opener
    if _opener:
        _opener = None

# copied from cookielib.py
_cut_port_re = re.compile(r":\d+$", re.ASCII)
def request_host(request):
    """Return request-host, as defined by RFC 2965.

    Variation from RFC: returned value is lowercased, for convenient
    comparison.

    """
    url = request.full_url
    host = urlparse(url)[1]
    if host == "":
        host = request.get_header("Host", "")

    # remove port, if present
    host = _cut_port_re.sub("", host, 1)
    return host.lower()

class Request:

    def __init__(self, url, data=None, headers={},
                 origin_req_host=None, unverifiable=False,
                 method=None):
        self.full_url = url
        self.headers = {}
        self.unredirected_hdrs = {}
        self._data = None
        self.data = data
        self._tunnel_host = None
        for key, value in headers.items():
            self.add_header(key, value)
        if origin_req_host is None:
            origin_req_host = request_host(self)
        self.origin_req_host = origin_req_host
        self.unverifiable = unverifiable
        if method:
            self.method = method

    @property
    def full_url(self):
        if self.fragment:
            return '{}#{}'.format(self._full_url, self.fragment)
        return self._full_url

    @full_url.setter
    def full_url(self, url):
        # unwrap('<URL:type://host/path>') --> 'type://host/path'
        self._full_url = unwrap(url)
        self._full_url, self.fragment = _splittag(self._full_url)
        self._parse()

    @full_url.deleter
    def full_url(self):
        self._full_url = None
        self.fragment = None
        self.selector = ''

    @property
    def data(self):
        return self._data

    @data.setter
    def data(self, data):
        if data != self._data:
            self._data = data
            # issue 16464
            # if we change data we need to remove content-length header
            # (cause it's most probably calculated for previous value)
            if self.has_header("Content-length"):
                self.remove_header("Content-length")

    @data.deleter
    def data(self):
        self.data = None

    def _parse(self):
        self.type, rest = _splittype(self._full_url)
        if self.type is None:
            raise ValueError("unknown url type: %r" % self.full_url)
        self.host, self.selector = _splithost(rest)
        if self.host:
            self.host = unquote(self.host)

    def get_method(self):
        """Return a string indicating the HTTP request method."""
        default_method = "POST" if self.data is not None else "GET"
        return getattr(self, 'method', default_method)

    def get_full_url(self):
        return self.full_url

    def set_proxy(self, host, type):
        if self.type == 'https' and not self._tunnel_host:
            self._tunnel_host = self.host
        else:
            self.type= type
            self.selector = self.full_url
        self.host = host

    def has_proxy(self):
        return self.selector == self.full_url

    def add_header(self, key, val):
        # useful for something like authentication
        self.headers[key.capitalize()] = val

    def add_unredirected_header(self, key, val):
        # will not be added to a redirected request
        self.unredirected_hdrs[key.capitalize()] = val

    def has_header(self, header_name):
        return (header_name in self.headers or
                header_name in self.unredirected_hdrs)

    def get_header(self, header_name, default=None):
        return self.headers.get(
            header_name,
            self.unredirected_hdrs.get(header_name, default))

    def remove_header(self, header_name):
        self.headers.pop(header_name, None)
        self.unredirected_hdrs.pop(header_name, None)

    def header_items(self):
        hdrs = {**self.unredirected_hdrs, **self.headers}
        return list(hdrs.items())

class OpenerDirector:
    def __init__(self):
        client_version = "Python-urllib/%s" % __version__
        self.addheaders = [('User-agent', client_version)]
        # self.handlers is retained only for backward compatibility
        self.handlers = []
        # manage the individual handlers
        self.handle_open = {}
        self.handle_error = {}
        self.process_response = {}
        self.process_request = {}

    def add_handler(self, handler):
        if not hasattr(handler, "add_parent"):
            raise TypeError("expected BaseHandler instance, got %r" %
                            type(handler))

        added = False
        for meth in dir(handler):
            if meth in ["redirect_request", "do_open", "proxy_open"]:
                # oops, coincidental match
                continue

            i = meth.find("_")
            protocol = meth[:i]
            condition = meth[i+1:]

            if condition.startswith("error"):
                j = condition.find("_") + i + 1
                kind = meth[j+1:]
                try:
                    kind = int(kind)
                except ValueError:
                    pass
                lookup = self.handle_error.get(protocol, {})
                self.handle_error[protocol] = lookup
            elif condition == "open":
                kind = protocol
                lookup = self.handle_open
            elif condition == "response":
                kind = protocol
                lookup = self.process_response
            elif condition == "request":
                kind = protocol
                lookup = self.process_request
            else:
                continue

            handlers = lookup.setdefault(kind, [])
            if handlers:
                bisect.insort(handlers, handler)
            else:
                handlers.append(handler)
            added = True

        if added:
            bisect.insort(self.handlers, handler)
            handler.add_parent(self)

    def close(self):
        # Only exists for backwards compatibility.
        pass

    def _call_chain(self, chain, kind, meth_name, *args):
        # Handlers raise an exception if no one else should try to handle
        # the request, or return None if they can't but another handler
        # could.  Otherwise, they return the response.
        handlers = chain.get(kind, ())
        for handler in handlers:
            func = getattr(handler, meth_name)
            result = func(*args)
            if result is not None:
                return result

    def open(self, fullurl, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
        # accept a URL or a Request object
        if isinstance(fullurl, str):
            req = Request(fullurl, data)
        else:
            req = fullurl
            if data is not None:
                req.data = data

        req.timeout = timeout
        protocol = req.type

        # pre-process request
        meth_name = protocol+"_request"
        for processor in self.process_request.get(protocol, []):
            meth = getattr(processor, meth_name)
            req = meth(req)

        sys.audit('urllib.Request', req.full_url, req.data, req.headers, req.get_method())
        response = self._open(req, data)

        # post-process response
        meth_name = protocol+"_response"
        for processor in self.process_response.get(protocol, []):
            meth = getattr(processor, meth_name)
            response = meth(req, response)

        return response

    def _open(self, req, data=None):
        result = self._call_chain(self.handle_open, 'default',
                                  'default_open', req)
        if result:
            return result

        protocol = req.type
        result = self._call_chain(self.handle_open, protocol, protocol +
                                  '_open', req)
        if result:
            return result

        return self._call_chain(self.handle_open, 'unknown',
                                'unknown_open', req)

    def error(self, proto, *args):
        if proto in ('http', 'https'):
            # XXX http[s] protocols are special-cased
            dict = self.handle_error['http'] # https is not different than http
            proto = args[2]  # YUCK!
            meth_name = 'http_error_%s' % proto
            http_err = 1
            orig_args = args
        else:
            dict = self.handle_error
            meth_name = proto + '_error'
            http_err = 0
        args = (dict, proto, meth_name) + args
        result = self._call_chain(*args)
        if result:
            return result

        if http_err:
            args = (dict, 'default', 'http_error_default') + orig_args
            return self._call_chain(*args)

# XXX probably also want an abstract factory that knows when it makes
# sense to skip a superclass in favor of a subclass and when it might
# make sense to include both

def build_opener(*handlers):
    """Create an opener object from a list of handlers.

    The opener will use several default handlers, including support
    for HTTP, FTP and when applicable HTTPS.

    If any of the handlers passed as arguments are subclasses of the
    default handlers, the default handlers will not be used.
    """
    opener = OpenerDirector()
    default_classes = [ProxyHandler, UnknownHandler, HTTPHandler,
                       HTTPDefaultErrorHandler, HTTPRedirectHandler,
                       FTPHandler, FileHandler, HTTPErrorProcessor,
                       DataHandler]
    if hasattr(http.client, "HTTPSConnection"):
        default_classes.append(HTTPSHandler)
    skip = set()
    for klass in default_classes:
        for check in handlers:
            if isinstance(check, type):
                if issubclass(check, klass):
                    skip.add(klass)
            elif isinstance(check, klass):
                skip.add(klass)
    for klass in skip:
        default_classes.remove(klass)

    for klass in default_classes:
        opener.add_handler(klass())

    for h in handlers:
        if isinstance(h, type):
            h = h()
        opener.add_handler(h)
    return opener

class BaseHandler:
    handler_order = 500

    def add_parent(self, parent):
        self.parent = parent

    def close(self):
        # Only exists for backwards compatibility
        pass

    def __lt__(self, other):
        if not hasattr(other, "handler_order"):
            # Try to preserve the old behavior of having custom classes
            # inserted after default ones (works only for custom user
            # classes which are not aware of handler_order).
            return True
        return self.handler_order < other.handler_order


class HTTPErrorProcessor(BaseHandler):
    """Process HTTP error responses."""
    handler_order = 1000  # after all other processing

    def http_response(self, request, response):
        code, msg, hdrs = response.code, response.msg, response.info()

        # According to RFC 2616, "2xx" code indicates that the client's
        # request was successfully received, understood, and accepted.
        if not (200 <= code < 300):
            response = self.parent.error(
                'http', request, response, code, msg, hdrs)

        return response

    https_response = http_response

class HTTPDefaultErrorHandler(BaseHandler):
    def http_error_default(self, req, fp, code, msg, hdrs):
        raise HTTPError(req.full_url, code, msg, hdrs, fp)

class HTTPRedirectHandler(BaseHandler):
    # maximum number of redirections to any single URL
    # this is needed because of the state that cookies introduce
    max_repeats = 4
    # maximum total number of redirections (regardless of URL) before
    # assuming we're in a loop
    max_redirections = 10

    def redirect_request(self, req, fp, code, msg, headers, newurl):
        """Return a Request or None in response to a redirect.

        This is called by the http_error_30x methods when a
        redirection response is received.  If a redirection should
        take place, return a new Request to allow http_error_30x to
        perform the redirect.  Otherwise, raise HTTPError if no-one
        else should try to handle this url.  Return None if you can't
        but another Handler might.
        """
        m = req.get_method()
        if (not (code in (301, 302, 303, 307) and m in ("GET", "HEAD")
            or code in (301, 302, 303) and m == "POST")):
            raise HTTPError(req.full_url, code, msg, headers, fp)

        # Strictly (according to RFC 2616), 301 or 302 in response to
        # a POST MUST NOT cause a redirection without confirmation
        # from the user (of urllib.request, in this case).  In practice,
        # essentially all clients do redirect in this case, so we do
        # the same.

        # Be conciliant with URIs containing a space.  This is mainly
        # redundant with the more complete encoding done in http_error_302(),
        # but it is kept for compatibility with other callers.
        newurl = newurl.replace(' ', '%20')

        CONTENT_HEADERS = ("content-length", "content-type")
        newheaders = {k: v for k, v in req.headers.items()
                      if k.lower() not in CONTENT_HEADERS}
        return Request(newurl,
                       headers=newheaders,
                       origin_req_host=req.origin_req_host,
                       unverifiable=True)

    # Implementation note: To avoid the server sending us into an
    # infinite loop, the request object needs to track what URLs we
    # have already seen.  Do this by adding a handler-specific
    # attribute to the Request object.
    def http_error_302(self, req, fp, code, msg, headers):
        # Some servers (incorrectly) return multiple Location headers
        # (so probably same goes for URI).  Use first header.
        if "location" in headers:
            newurl = headers["location"]
        elif "uri" in headers:
            newurl = headers["uri"]
        else:
            return

        # fix a possible malformed URL
        urlparts = urlparse(newurl)

        # For security reasons we don't allow redirection to anything other
        # than http, https or ftp.

        if urlparts.scheme not in ('http', 'https', 'ftp', ''):
            raise HTTPError(
                newurl, code,
                "%s - Redirection to url '%s' is not allowed" % (msg, newurl),
                headers, fp)

        if not urlparts.path and urlparts.netloc:
            urlparts = list(urlparts)
            urlparts[2] = "/"
        newurl = urlunparse(urlparts)

        # http.client.parse_headers() decodes as ISO-8859-1.  Recover the
        # original bytes and percent-encode non-ASCII bytes, and any special
        # characters such as the space.
        newurl = quote(
            newurl, encoding="iso-8859-1", safe=string.punctuation)
        newurl = urljoin(req.full_url, newurl)

        # XXX Probably want to forget about the state of the current
        # request, although that might interact poorly with other
        # handlers that also use handler-specific request attributes
        new = self.redirect_request(req, fp, code, msg, headers, newurl)
        if new is None:
            return

        # loop detection
        # .redirect_dict has a key url if url was previously visited.
        if hasattr(req, 'redirect_dict'):
            visited = new.redirect_dict = req.redirect_dict
            if (visited.get(newurl, 0) >= self.max_repeats or
                len(visited) >= self.max_redirections):
                raise HTTPError(req.full_url, code,
                                self.inf_msg + msg, headers, fp)
        else:
            visited = new.redirect_dict = req.redirect_dict = {}
        visited[newurl] = visited.get(newurl, 0) + 1

        # Don't close the fp until we are sure that we won't use it
        # with HTTPError.
        fp.read()
        fp.close()

        return self.parent.open(new, timeout=req.timeout)

    http_error_301 = http_error_303 = http_error_307 = http_error_302

    inf_msg = "The HTTP server returned a redirect error that would " \
              "lead to an infinite loop.\n" \
              "The last 30x error message was:\n"


def _parse_proxy(proxy):
    """Return (scheme, user, password, host/port) given a URL or an authority.

    If a URL is supplied, it must have an authority (host:port) component.
    According to RFC 3986, having an authority component means the URL must
    have two slashes after the scheme.
    """
    scheme, r_scheme = _splittype(proxy)
    if not r_scheme.startswith("/"):
        # authority
        scheme = None
        authority = proxy
    else:
        # URL
        if not r_scheme.startswith("//"):
            raise ValueError("proxy URL with no authority: %r" % proxy)
        # We have an authority, so for RFC 3986-compliant URLs (by ss 3.
        # and 3.3.), path is empty or starts with '/'
        if '@' in r_scheme:
            host_separator = r_scheme.find('@')
            end = r_scheme.find("/", host_separator)
        else:
            end = r_scheme.find("/", 2)
        if end == -1:
            end = None
        authority = r_scheme[2:end]
    userinfo, hostport = _splituser(authority)
    if userinfo is not None:
        user, password = _splitpasswd(userinfo)
    else:
        user = password = None
    return scheme, user, password, hostport

class ProxyHandler(BaseHandler):
    # Proxies must be in front
    handler_order = 100

    def __init__(self, proxies=None):
        if proxies is None:
            proxies = getproxies()
        assert hasattr(proxies, 'keys'), "proxies must be a mapping"
        self.proxies = proxies
        for type, url in proxies.items():
            type = type.lower()
            setattr(self, '%s_open' % type,
                    lambda r, proxy=url, type=type, meth=self.proxy_open:
                        meth(r, proxy, type))

    def proxy_open(self, req, proxy, type):
        orig_type = req.type
        proxy_type, user, password, hostport = _parse_proxy(proxy)
        if proxy_type is None:
            proxy_type = orig_type

        if req.host and proxy_bypass(req.host):
            return None

        if user and password:
            user_pass = '%s:%s' % (unquote(user),
                                   unquote(password))
            creds = base64.b64encode(user_pass.encode()).decode("ascii")
            req.add_header('Proxy-authorization', 'Basic ' + creds)
        hostport = unquote(hostport)
        req.set_proxy(hostport, proxy_type)
        if orig_type == proxy_type or orig_type == 'https':
            # let other handlers take care of it
            return None
        else:
            # need to start over, because the other handlers don't
            # grok the proxy's URL type
            # e.g. if we have a constructor arg proxies like so:
            # {'http': 'ftp://proxy.example.com'}, we may end up turning
            # a request for http://acme.example.com/a into one for
            # ftp://proxy.example.com/a
            return self.parent.open(req, timeout=req.timeout)

class HTTPPasswordMgr:

    def __init__(self):
        self.passwd = {}

    def add_password(self, realm, uri, user, passwd):
        # uri could be a single URI or a sequence
        if isinstance(uri, str):
            uri = [uri]
        if realm not in self.passwd:
            self.passwd[realm] = {}
        for default_port in True, False:
            reduced_uri = tuple(
                self.reduce_uri(u, default_port) for u in uri)
            self.passwd[realm][reduced_uri] = (user, passwd)

    def find_user_password(self, realm, authuri):
        domains = self.passwd.get(realm, {})
        for default_port in True, False:
            reduced_authuri = self.reduce_uri(authuri, default_port)
            for uris, authinfo in domains.items():
                for uri in uris:
                    if self.is_suburi(uri, reduced_authuri):
                        return authinfo
        return None, None

    def reduce_uri(self, uri, default_port=True):
        """Accept authority or URI and extract only the authority and path."""
        # note HTTP URLs do not have a userinfo component
        parts = urlsplit(uri)
        if parts[1]:
            # URI
            scheme = parts[0]
            authority = parts[1]
            path = parts[2] or '/'
        else:
            # host or host:port
            scheme = None
            authority = uri
            path = '/'
        host, port = _splitport(authority)
        if default_port and port is None and scheme is not None:
            dport = {"http": 80,
                     "https": 443,
                     }.get(scheme)
            if dport is not None:
                authority = "%s:%d" % (host, dport)
        return authority, path

    def is_suburi(self, base, test):
        """Check if test is below base in a URI tree

        Both args must be URIs in reduced form.
        """
        if base == test:
            return True
        if base[0] != test[0]:
            return False
        prefix = base[1]
        if prefix[-1:] != '/':
            prefix += '/'
        return test[1].startswith(prefix)


class HTTPPasswordMgrWithDefaultRealm(HTTPPasswordMgr):

    def find_user_password(self, realm, authuri):
        user, password = HTTPPasswordMgr.find_user_password(self, realm,
                                                            authuri)
        if user is not None:
            return user, password
        return HTTPPasswordMgr.find_user_password(self, None, authuri)


class HTTPPasswordMgrWithPriorAuth(HTTPPasswordMgrWithDefaultRealm):

    def __init__(self, *args, **kwargs):
        self.authenticated = {}
        super().__init__(*args, **kwargs)

    def add_password(self, realm, uri, user, passwd, is_authenticated=False):
        self.update_authenticated(uri, is_authenticated)
        # Add a default for prior auth requests
        if realm is not None:
            super().add_password(None, uri, user, passwd)
        super().add_password(realm, uri, user, passwd)

    def update_authenticated(self, uri, is_authenticated=False):
        # uri could be a single URI or a sequence
        if isinstance(uri, str):
            uri = [uri]

        for default_port in True, False:
            for u in uri:
                reduced_uri = self.reduce_uri(u, default_port)
                self.authenticated[reduced_uri] = is_authenticated

    def is_authenticated(self, authuri):
        for default_port in True, False:
            reduced_authuri = self.reduce_uri(authuri, default_port)
            for uri in self.authenticated:
                if self.is_suburi(uri, reduced_authuri):
                    return self.authenticated[uri]


class AbstractBasicAuthHandler:

    # XXX this allows for multiple auth-schemes, but will stupidly pick
    # the last one with a realm specified.

    # allow for double- and single-quoted realm values
    # (single quotes are a violation of the RFC, but appear in the wild)
    rx = re.compile('(?:^|,)'   # start of the string or ','
                    '[ \t]*'    # optional whitespaces
                    '([^ \t,]+)' # scheme like "Basic"
                    '[ \t]+'    # mandatory whitespaces
                    # realm=xxx
                    # realm='xxx'
                    # realm="xxx"
                    'realm=(["\']?)([^"\']*)\\2',
                    re.I)

    # XXX could pre-emptively send auth info already accepted (RFC 2617,
    # end of section 2, and section 1.2 immediately after "credentials"
    # production).

    def __init__(self, password_mgr=None):
        if password_mgr is None:
            password_mgr = HTTPPasswordMgr()
        self.passwd = password_mgr
        self.add_password = self.passwd.add_password

    def _parse_realm(self, header):
        # parse WWW-Authenticate header: accept multiple challenges per header
        found_challenge = False
        for mo in AbstractBasicAuthHandler.rx.finditer(header):
            scheme, quote, realm = mo.groups()
            if quote not in ['"', "'"]:
                warnings.warn("Basic Auth Realm was unquoted",
                              UserWarning, 3)

            yield (scheme, realm)

            found_challenge = True

        if not found_challenge:
            if header:
                scheme = header.split()[0]
            else:
                scheme = ''
            yield (scheme, None)

    def http_error_auth_reqed(self, authreq, host, req, headers):
        # host may be an authority (without userinfo) or a URL with an
        # authority
        headers = headers.get_all(authreq)
        if not headers:
            # no header found
            return

        unsupported = None
        for header in headers:
            for scheme, realm in self._parse_realm(header):
                if scheme.lower() != 'basic':
                    unsupported = scheme
                    continue

                if realm is not None:
                    # Use the first matching Basic challenge.
                    # Ignore following challenges even if they use the Basic
                    # scheme.
                    return self.retry_http_basic_auth(host, req, realm)

        if unsupported is not None:
            raise ValueError("AbstractBasicAuthHandler does not "
                             "support the following scheme: %r"
                             % (scheme,))

    def retry_http_basic_auth(self, host, req, realm):
        user, pw = self.passwd.find_user_password(realm, host)
        if pw is not None:
            raw = "%s:%s" % (user, pw)
            auth = "Basic " + base64.b64encode(raw.encode()).decode("ascii")
            if req.get_header(self.auth_header, None) == auth:
                return None
            req.add_unredirected_header(self.auth_header, auth)
            return self.parent.open(req, timeout=req.timeout)
        else:
            return None

    def http_request(self, req):
        if (not hasattr(self.passwd, 'is_authenticated') or
           not self.passwd.is_authenticated(req.full_url)):
            return req

        if not req.has_header('Authorization'):
            user, passwd = self.passwd.find_user_password(None, req.full_url)
            credentials = '{0}:{1}'.format(user, passwd).encode()
            auth_str = base64.standard_b64encode(credentials).decode()
            req.add_unredirected_header('Authorization',
                                        'Basic {}'.format(auth_str.strip()))
        return req

    def http_response(self, req, response):
        if hasattr(self.passwd, 'is_authenticated'):
            if 200 <= response.code < 300:
                self.passwd.update_authenticated(req.full_url, True)
            else:
                self.passwd.update_authenticated(req.full_url, False)
        return response

    https_request = http_request
    https_response = http_response



class HTTPBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler):

    auth_header = 'Authorization'

    def http_error_401(self, req, fp, code, msg, headers):
        url = req.full_url
        response = self.http_error_auth_reqed('www-authenticate',
                                          url, req, headers)
        return response


class ProxyBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler):

    auth_header = 'Proxy-authorization'

    def http_error_407(self, req, fp, code, msg, headers):
        # http_error_auth_reqed requires that there is no userinfo component in
        # authority.  Assume there isn't one, since urllib.request does not (and
        # should not, RFC 3986 s. 3.2.1) support requests for URLs containing
        # userinfo.
        authority = req.host
        response = self.http_error_auth_reqed('proxy-authenticate',
                                          authority, req, headers)
        return response


# Return n random bytes.
_randombytes = os.urandom


class AbstractDigestAuthHandler:
    # Digest authentication is specified in RFC 2617.

    # XXX The client does not inspect the Authentication-Info header
    # in a successful response.

    # XXX It should be possible to test this implementation against
    # a mock server that just generates a static set of challenges.

    # XXX qop="auth-int" supports is shaky

    def __init__(self, passwd=None):
        if passwd is None:
            passwd = HTTPPasswordMgr()
        self.passwd = passwd
        self.add_password = self.passwd.add_password
        self.retried = 0
        self.nonce_count = 0
        self.last_nonce = None

    def reset_retry_count(self):
        self.retried = 0

    def http_error_auth_reqed(self, auth_header, host, req, headers):
        authreq = headers.get(auth_header, None)
        if self.retried > 5:
            # Don't fail endlessly - if we failed once, we'll probably
            # fail a second time. Hm. Unless the Password Manager is
            # prompting for the information. Crap. This isn't great
            # but it's better than the current 'repeat until recursion
            # depth exceeded' approach <wink>
            raise HTTPError(req.full_url, 401, "digest auth failed",
                            headers, None)
        else:
            self.retried += 1
        if authreq:
            scheme = authreq.split()[0]
            if scheme.lower() == 'digest':
                return self.retry_http_digest_auth(req, authreq)
            elif scheme.lower() != 'basic':
                raise ValueError("AbstractDigestAuthHandler does not support"
                                 " the following scheme: '%s'" % scheme)

    def retry_http_digest_auth(self, req, auth):
        token, challenge = auth.split(' ', 1)
        chal = parse_keqv_list(filter(None, parse_http_list(challenge)))
        auth = self.get_authorization(req, chal)
        if auth:
            auth_val = 'Digest %s' % auth
            if req.headers.get(self.auth_header, None) == auth_val:
                return None
            req.add_unredirected_header(self.auth_header, auth_val)
            resp = self.parent.open(req, timeout=req.timeout)
            return resp

    def get_cnonce(self, nonce):
        # The cnonce-value is an opaque
        # quoted string value provided by the client and used by both client
        # and server to avoid chosen plaintext attacks, to provide mutual
        # authentication, and to provide some message integrity protection.
        # This isn't a fabulous effort, but it's probably Good Enough.
        s = "%s:%s:%s:" % (self.nonce_count, nonce, time.ctime())
        b = s.encode("ascii") + _randombytes(8)
        dig = hashlib.sha1(b).hexdigest()
        return dig[:16]

    def get_authorization(self, req, chal):
        try:
            realm = chal['realm']
            nonce = chal['nonce']
            qop = chal.get('qop')
            algorithm = chal.get('algorithm', 'MD5')
            # mod_digest doesn't send an opaque, even though it isn't
            # supposed to be optional
            opaque = chal.get('opaque', None)
        except KeyError:
            return None

        H, KD = self.get_algorithm_impls(algorithm)
        if H is None:
            return None

        user, pw = self.passwd.find_user_password(realm, req.full_url)
        if user is None:
            return None

        # XXX not implemented yet
        if req.data is not None:
            entdig = self.get_entity_digest(req.data, chal)
        else:
            entdig = None

        A1 = "%s:%s:%s" % (user, realm, pw)
        A2 = "%s:%s" % (req.get_method(),
                        # XXX selector: what about proxies and full urls
                        req.selector)
        # NOTE: As per  RFC 2617, when server sends "auth,auth-int", the client could use either `auth`
        #     or `auth-int` to the response back. we use `auth` to send the response back.
        if qop is None:
            respdig = KD(H(A1), "%s:%s" % (nonce, H(A2)))
        elif 'auth' in qop.split(','):
            if nonce == self.last_nonce:
                self.nonce_count += 1
            else:
                self.nonce_count = 1
                self.last_nonce = nonce
            ncvalue = '%08x' % self.nonce_count
            cnonce = self.get_cnonce(nonce)
            noncebit = "%s:%s:%s:%s:%s" % (nonce, ncvalue, cnonce, 'auth', H(A2))
            respdig = KD(H(A1), noncebit)
        else:
            # XXX handle auth-int.
            raise URLError("qop '%s' is not supported." % qop)

        # XXX should the partial digests be encoded too?

        base = 'username="%s", realm="%s", nonce="%s", uri="%s", ' \
               'response="%s"' % (user, realm, nonce, req.selector,
                                  respdig)
        if opaque:
            base += ', opaque="%s"' % opaque
        if entdig:
            base += ', digest="%s"' % entdig
        base += ', algorithm="%s"' % algorithm
        if qop:
            base += ', qop=auth, nc=%s, cnonce="%s"' % (ncvalue, cnonce)
        return base

    def get_algorithm_impls(self, algorithm):
        # lambdas assume digest modules are imported at the top level
        if algorithm == 'MD5':
            H = lambda x: hashlib.md5(x.encode("ascii")).hexdigest()
        elif algorithm == 'SHA':
            H = lambda x: hashlib.sha1(x.encode("ascii")).hexdigest()
        # XXX MD5-sess
        else:
            raise ValueError("Unsupported digest authentication "
                             "algorithm %r" % algorithm)
        KD = lambda s, d: H("%s:%s" % (s, d))
        return H, KD

    def get_entity_digest(self, data, chal):
        # XXX not implemented yet
        return None


class HTTPDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler):
    """An authentication protocol defined by RFC 2069

    Digest authentication improves on basic authentication because it
    does not transmit passwords in the clear.
    """

    auth_header = 'Authorization'
    handler_order = 490  # before Basic auth

    def http_error_401(self, req, fp, code, msg, headers):
        host = urlparse(req.full_url)[1]
        retry = self.http_error_auth_reqed('www-authenticate',
                                           host, req, headers)
        self.reset_retry_count()
        return retry


class ProxyDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler):

    auth_header = 'Proxy-Authorization'
    handler_order = 490  # before Basic auth

    def http_error_407(self, req, fp, code, msg, headers):
        host = req.host
        retry = self.http_error_auth_reqed('proxy-authenticate',
                                           host, req, headers)
        self.reset_retry_count()
        return retry

class AbstractHTTPHandler(BaseHandler):

    def __init__(self, debuglevel=0):
        self._debuglevel = debuglevel

    def set_http_debuglevel(self, level):
        self._debuglevel = level

    def _get_content_length(self, request):
        return http.client.HTTPConnection._get_content_length(
            request.data,
            request.get_method())

    def do_request_(self, request):
        host = request.host
        if not host:
            raise URLError('no host given')

        if request.data is not None:  # POST
            data = request.data
            if isinstance(data, str):
                msg = "POST data should be bytes, an iterable of bytes, " \
                      "or a file object. It cannot be of type str."
                raise TypeError(msg)
            if not request.has_header('Content-type'):
                request.add_unredirected_header(
                    'Content-type',
                    'application/x-www-form-urlencoded')
            if (not request.has_header('Content-length')
                    and not request.has_header('Transfer-encoding')):
                content_length = self._get_content_length(request)
                if content_length is not None:
                    request.add_unredirected_header(
                            'Content-length', str(content_length))
                else:
                    request.add_unredirected_header(
                            'Transfer-encoding', 'chunked')

        sel_host = host
        if request.has_proxy():
            scheme, sel = _splittype(request.selector)
            sel_host, sel_path = _splithost(sel)
        if not request.has_header('Host'):
            request.add_unredirected_header('Host', sel_host)
        for name, value in self.parent.addheaders:
            name = name.capitalize()
            if not request.has_header(name):
                request.add_unredirected_header(name, value)

        return request

    def do_open(self, http_class, req, **http_conn_args):
        """Return an HTTPResponse object for the request, using http_class.

        http_class must implement the HTTPConnection API from http.client.
        """
        host = req.host
        if not host:
            raise URLError('no host given')

        # will parse host:port
        h = http_class(host, timeout=req.timeout, **http_conn_args)
        h.set_debuglevel(self._debuglevel)

        headers = dict(req.unredirected_hdrs)
        headers.update({k: v for k, v in req.headers.items()
                        if k not in headers})

        # TODO(jhylton): Should this be redesigned to handle
        # persistent connections?

        # We want to make an HTTP/1.1 request, but the addinfourl
        # class isn't prepared to deal with a persistent connection.
        # It will try to read all remaining data from the socket,
        # which will block while the server waits for the next request.
        # So make sure the connection gets closed after the (only)
        # request.
        headers["Connection"] = "close"
        headers = {name.title(): val for name, val in headers.items()}

        if req._tunnel_host:
            tunnel_headers = {}
            proxy_auth_hdr = "Proxy-Authorization"
            if proxy_auth_hdr in headers:
                tunnel_headers[proxy_auth_hdr] = headers[proxy_auth_hdr]
                # Proxy-Authorization should not be sent to origin
                # server.
                del headers[proxy_auth_hdr]
            h.set_tunnel(req._tunnel_host, headers=tunnel_headers)

        try:
            try:
                h.request(req.get_method(), req.selector, req.data, headers,
                          encode_chunked=req.has_header('Transfer-encoding'))
            except OSError as err: # timeout error
                raise URLError(err)
            r = h.getresponse()
        except:
            h.close()
            raise

        # If the server does not send us a 'Connection: close' header,
        # HTTPConnection assumes the socket should be left open. Manually
        # mark the socket to be closed when this response object goes away.
        if h.sock:
            h.sock.close()
            h.sock = None

        r.url = req.get_full_url()
        # This line replaces the .msg attribute of the HTTPResponse
        # with .headers, because urllib clients expect the response to
        # have the reason in .msg.  It would be good to mark this
        # attribute is deprecated and get then to use info() or
        # .headers.
        r.msg = r.reason
        return r


class HTTPHandler(AbstractHTTPHandler):

    def http_open(self, req):
        return self.do_open(http.client.HTTPConnection, req)

    http_request = AbstractHTTPHandler.do_request_

if hasattr(http.client, 'HTTPSConnection'):

    class HTTPSHandler(AbstractHTTPHandler):

        def __init__(self, debuglevel=0, context=None, check_hostname=None):
            AbstractHTTPHandler.__init__(self, debuglevel)
            self._context = context
            self._check_hostname = check_hostname

        def https_open(self, req):
            return self.do_open(http.client.HTTPSConnection, req,
                context=self._context, check_hostname=self._check_hostname)

        https_request = AbstractHTTPHandler.do_request_

    __all__.append('HTTPSHandler')

class HTTPCookieProcessor(BaseHandler):
    def __init__(self, cookiejar=None):
        import http.cookiejar
        if cookiejar is None:
            cookiejar = http.cookiejar.CookieJar()
        self.cookiejar = cookiejar

    def http_request(self, request):
        self.cookiejar.add_cookie_header(request)
        return request

    def http_response(self, request, response):
        self.cookiejar.extract_cookies(response, request)
        return response

    https_request = http_request
    https_response = http_response

class UnknownHandler(BaseHandler):
    def unknown_open(self, req):
        type = req.type
        raise URLError('unknown url type: %s' % type)

def parse_keqv_list(l):
    """Parse list of key=value strings where keys are not duplicated."""
    parsed = {}
    for elt in l:
        k, v = elt.split('=', 1)
        if v[0] == '"' and v[-1] == '"':
            v = v[1:-1]
        parsed[k] = v
    return parsed

def parse_http_list(s):
    """Parse lists as described by RFC 2068 Section 2.

    In particular, parse comma-separated lists where the elements of
    the list may include quoted-strings.  A quoted-string could
    contain a comma.  A non-quoted string could have quotes in the
    middle.  Neither commas nor quotes count if they are escaped.
    Only double-quotes count, not single-quotes.
    """
    res = []
    part = ''

    escape = quote = False
    for cur in s:
        if escape:
            part += cur
            escape = False
            continue
        if quote:
            if cur == '\\':
                escape = True
                continue
            elif cur == '"':
                quote = False
            part += cur
            continue

        if cur == ',':
            res.append(part)
            part = ''
            continue

        if cur == '"':
            quote = True

        part += cur

    # append last part
    if part:
        res.append(part)

    return [part.strip() for part in res]

class FileHandler(BaseHandler):
    # Use local file or FTP depending on form of URL
    def file_open(self, req):
        url = req.selector
        if url[:2] == '//' and url[2:3] != '/' and (req.host and
                req.host != 'localhost'):
            if not req.host in self.get_names():
                raise URLError("file:// scheme is supported only on localhost")
        else:
            return self.open_local_file(req)

    # names for the localhost
    names = None
    def get_names(self):
        if FileHandler.names is None:
            try:
                FileHandler.names = tuple(
                    socket.gethostbyname_ex('localhost')[2] +
                    socket.gethostbyname_ex(socket.gethostname())[2])
            except socket.gaierror:
                FileHandler.names = (socket.gethostbyname('localhost'),)
        return FileHandler.names

    # not entirely sure what the rules are here
    def open_local_file(self, req):
        import email.utils
        import mimetypes
        host = req.host
        filename = req.selector
        localfile = url2pathname(filename)
        try:
            stats = os.stat(localfile)
            size = stats.st_size
            modified = email.utils.formatdate(stats.st_mtime, usegmt=True)
            mtype = mimetypes.guess_type(filename)[0]
            headers = email.message_from_string(
                'Content-type: %s\nContent-length: %d\nLast-modified: %s\n' %
                (mtype or 'text/plain', size, modified))
            if host:
                host, port = _splitport(host)
            if not host or \
                (not port and _safe_gethostbyname(host) in self.get_names()):
                if host:
                    origurl = 'file://' + host + filename
                else:
                    origurl = 'file://' + filename
                return addinfourl(open(localfile, 'rb'), headers, origurl)
        except OSError as exp:
            raise URLError(exp)
        raise URLError('file not on local host')

def _safe_gethostbyname(host):
    try:
        return socket.gethostbyname(host)
    except socket.gaierror:
        return None

class FTPHandler(BaseHandler):
    def ftp_open(self, req):
        import ftplib
        import mimetypes
        host = req.host
        if not host:
            raise URLError('ftp error: no host given')
        host, port = _splitport(host)
        if port is None:
            port = ftplib.FTP_PORT
        else:
            port = int(port)

        # username/password handling
        user, host = _splituser(host)
        if user:
            user, passwd = _splitpasswd(user)
        else:
            passwd = None
        host = unquote(host)
        user = user or ''
        passwd = passwd or ''

        try:
            host = socket.gethostbyname(host)
        except OSError as msg:
            raise URLError(msg)
        path, attrs = _splitattr(req.selector)
        dirs = path.split('/')
        dirs = list(map(unquote, dirs))
        dirs, file = dirs[:-1], dirs[-1]
        if dirs and not dirs[0]:
            dirs = dirs[1:]
        try:
            fw = self.connect_ftp(user, passwd, host, port, dirs, req.timeout)
            type = file and 'I' or 'D'
            for attr in attrs:
                attr, value = _splitvalue(attr)
                if attr.lower() == 'type' and \
                   value in ('a', 'A', 'i', 'I', 'd', 'D'):
                    type = value.upper()
            fp, retrlen = fw.retrfile(file, type)
            headers = ""
            mtype = mimetypes.guess_type(req.full_url)[0]
            if mtype:
                headers += "Content-type: %s\n" % mtype
            if retrlen is not None and retrlen >= 0:
                headers += "Content-length: %d\n" % retrlen
            headers = email.message_from_string(headers)
            return addinfourl(fp, headers, req.full_url)
        except ftplib.all_errors as exp:
            exc = URLError('ftp error: %r' % exp)
            raise exc.with_traceback(sys.exc_info()[2])

    def connect_ftp(self, user, passwd, host, port, dirs, timeout):
        return ftpwrapper(user, passwd, host, port, dirs, timeout,
                          persistent=False)

class CacheFTPHandler(FTPHandler):
    # XXX would be nice to have pluggable cache strategies
    # XXX this stuff is definitely not thread safe
    def __init__(self):
        self.cache = {}
        self.timeout = {}
        self.soonest = 0
        self.delay = 60
        self.max_conns = 16

    def setTimeout(self, t):
        self.delay = t

    def setMaxConns(self, m):
        self.max_conns = m

    def connect_ftp(self, user, passwd, host, port, dirs, timeout):
        key = user, host, port, '/'.join(dirs), timeout
        if key in self.cache:
            self.timeout[key] = time.time() + self.delay
        else:
            self.cache[key] = ftpwrapper(user, passwd, host, port,
                                         dirs, timeout)
            self.timeout[key] = time.time() + self.delay
        self.check_cache()
        return self.cache[key]

    def check_cache(self):
        # first check for old ones
        t = time.time()
        if self.soonest <= t:
            for k, v in list(self.timeout.items()):
                if v < t:
                    self.cache[k].close()
                    del self.cache[k]
                    del self.timeout[k]
        self.soonest = min(list(self.timeout.values()))

        # then check the size
        if len(self.cache) == self.max_conns:
            for k, v in list(self.timeout.items()):
                if v == self.soonest:
                    del self.cache[k]
                    del self.timeout[k]
                    break
            self.soonest = min(list(self.timeout.values()))

    def clear_cache(self):
        for conn in self.cache.values():
            conn.close()
        self.cache.clear()
        self.timeout.clear()

class DataHandler(BaseHandler):
    def data_open(self, req):
        # data URLs as specified in RFC 2397.
        #
        # ignores POSTed data
        #
        # syntax:
        # dataurl   := "data:" [ mediatype ] [ ";base64" ] "," data
        # mediatype := [ type "/" subtype ] *( ";" parameter )
        # data      := *urlchar
        # parameter := attribute "=" value
        url = req.full_url

        scheme, data = url.split(":",1)
        mediatype, data = data.split(",",1)

        # even base64 encoded data URLs might be quoted so unquote in any case:
        data = unquote_to_bytes(data)
        if mediatype.endswith(";base64"):
            data = base64.decodebytes(data)
            mediatype = mediatype[:-7]

        if not mediatype:
            mediatype = "text/plain;charset=US-ASCII"

        headers = email.message_from_string("Content-type: %s\nContent-length: %d\n" %
            (mediatype, len(data)))

        return addinfourl(io.BytesIO(data), headers, url)


# Code move from the old urllib module

MAXFTPCACHE = 10        # Trim the ftp cache beyond this size

# Helper for non-unix systems
if os.name == 'nt':
    from nturl2path import url2pathname, pathname2url
else:
    def url2pathname(pathname):
        """OS-specific conversion from a relative URL of the 'file' scheme
        to a file system path; not recommended for general use."""
        return unquote(pathname)

    def pathname2url(pathname):
        """OS-specific conversion from a file system path to a relative URL
        of the 'file' scheme; not recommended for general use."""
        return quote(pathname)


ftpcache = {}


class URLopener:
    """Class to open URLs.
    This is a class rather than just a subroutine because we may need
    more than one set of global protocol-specific options.
    Note -- this is a base class for those who don't want the
    automatic handling of errors type 302 (relocated) and 401
    (authorization needed)."""

    __tempfiles = None

    version = "Python-urllib/%s" % __version__

    # Constructor
    def __init__(self, proxies=None, **x509):
        msg = "%(class)s style of invoking requests is deprecated. " \
              "Use newer urlopen functions/methods" % {'class': self.__class__.__name__}
        warnings.warn(msg, DeprecationWarning, stacklevel=3)
        if proxies is None:
            proxies = getproxies()
        assert hasattr(proxies, 'keys'), "proxies must be a mapping"
        self.proxies = proxies
        self.key_file = x509.get('key_file')
        self.cert_file = x509.get('cert_file')
        self.addheaders = [('User-Agent', self.version), ('Accept', '*/*')]
        self.__tempfiles = []
        self.__unlink = os.unlink # See cleanup()
        self.tempcache = None
        # Undocumented feature: if you assign {} to tempcache,
        # it is used to cache files retrieved with
        # self.retrieve().  This is not enabled by default
        # since it does not work for changing documents (and I
        # haven't got the logic to check expiration headers
        # yet).
        self.ftpcache = ftpcache
        # Undocumented feature: you can use a different
        # ftp cache by assigning to the .ftpcache member;
        # in case you want logically independent URL openers
        # XXX This is not threadsafe.  Bah.

    def __del__(self):
        self.close()

    def close(self):
        self.cleanup()

    def cleanup(self):
        # This code sometimes runs when the rest of this module
        # has already been deleted, so it can't use any globals
        # or import anything.
        if self.__tempfiles:
            for file in self.__tempfiles:
                try:
                    self.__unlink(file)
                except OSError:
                    pass
            del self.__tempfiles[:]
        if self.tempcache:
            self.tempcache.clear()

    def addheader(self, *args):
        """Add a header to be used by the HTTP interface only
        e.g. u.addheader('Accept', 'sound/basic')"""
        self.addheaders.append(args)

    # External interface
    def open(self, fullurl, data=None):
        """Use URLopener().open(file) instead of open(file, 'r')."""
        fullurl = unwrap(_to_bytes(fullurl))
        fullurl = quote(fullurl, safe="%/:=&?~#+!$,;'@()*[]|")
        if self.tempcache and fullurl in self.tempcache:
            filename, headers = self.tempcache[fullurl]
            fp = open(filename, 'rb')
            return addinfourl(fp, headers, fullurl)
        urltype, url = _splittype(fullurl)
        if not urltype:
            urltype = 'file'
        if urltype in self.proxies:
            proxy = self.proxies[urltype]
            urltype, proxyhost = _splittype(proxy)
            host, selector = _splithost(proxyhost)
            url = (host, fullurl) # Signal special case to open_*()
        else:
            proxy = None
        name = 'open_' + urltype
        self.type = urltype
        name = name.replace('-', '_')
        if not hasattr(self, name) or name == 'open_local_file':
            if proxy:
                return self.open_unknown_proxy(proxy, fullurl, data)
            else:
                return self.open_unknown(fullurl, data)
        try:
            if data is None:
                return getattr(self, name)(url)
            else:
                return getattr(self, name)(url, data)
        except (HTTPError, URLError):
            raise
        except OSError as msg:
            raise OSError('socket error', msg).with_traceback(sys.exc_info()[2])

    def open_unknown(self, fullurl, data=None):
        """Overridable interface to open unknown URL type."""
        type, url = _splittype(fullurl)
        raise OSError('url error', 'unknown url type', type)

    def open_unknown_proxy(self, proxy, fullurl, data=None):
        """Overridable interface to open unknown URL type."""
        type, url = _splittype(fullurl)
        raise OSError('url error', 'invalid proxy for %s' % type, proxy)

    # External interface
    def retrieve(self, url, filename=None, reporthook=None, data=None):
        """retrieve(url) returns (filename, headers) for a local object
        or (tempfilename, headers) for a remote object."""
        url = unwrap(_to_bytes(url))
        if self.tempcache and url in self.tempcache:
            return self.tempcache[url]
        type, url1 = _splittype(url)
        if filename is None and (not type or type == 'file'):
            try:
                fp = self.open_local_file(url1)
                hdrs = fp.info()
                fp.close()
                return url2pathname(_splithost(url1)[1]), hdrs
            except OSError as msg:
                pass
        fp = self.open(url, data)
        try:
            headers = fp.info()
            if filename:
                tfp = open(filename, 'wb')
            else:
                garbage, path = _splittype(url)
                garbage, path = _splithost(path or "")
                path, garbage = _splitquery(path or "")
                path, garbage = _splitattr(path or "")
                suffix = os.path.splitext(path)[1]
                (fd, filename) = tempfile.mkstemp(suffix)
                self.__tempfiles.append(filename)
                tfp = os.fdopen(fd, 'wb')
            try:
                result = filename, headers
                if self.tempcache is not None:
                    self.tempcache[url] = result
                bs = 1024*8
                size = -1
                read = 0
                blocknum = 0
                if "content-length" in headers:
                    size = int(headers["Content-Length"])
                if reporthook:
                    reporthook(blocknum, bs, size)
                while 1:
                    block = fp.read(bs)
                    if not block:
                        break
                    read += len(block)
                    tfp.write(block)
                    blocknum += 1
                    if reporthook:
                        reporthook(blocknum, bs, size)
            finally:
                tfp.close()
        finally:
            fp.close()

        # raise exception if actual size does not match content-length header
        if size >= 0 and read < size:
            raise ContentTooShortError(
                "retrieval incomplete: got only %i out of %i bytes"
                % (read, size), result)

        return result

    # Each method named open_<type> knows how to open that type of URL

    def _open_generic_http(self, connection_factory, url, data):
        """Make an HTTP connection using connection_class.

        This is an internal method that should be called from
        open_http() or open_https().

        Arguments:
        - connection_factory should take a host name and return an
          HTTPConnection instance.
        - url is the url to retrieval or a host, relative-path pair.
        - data is payload for a POST request or None.
        """

        user_passwd = None
        proxy_passwd= None
        if isinstance(url, str):
            host, selector = _splithost(url)
            if host:
                user_passwd, host = _splituser(host)
                host = unquote(host)
            realhost = host
        else:
            host, selector = url
            # check whether the proxy contains authorization information
            proxy_passwd, host = _splituser(host)
            # now we proceed with the url we want to obtain
            urltype, rest = _splittype(selector)
            url = rest
            user_passwd = None
            if urltype.lower() != 'http':
                realhost = None
            else:
                realhost, rest = _splithost(rest)
                if realhost:
                    user_passwd, realhost = _splituser(realhost)
                if user_passwd:
                    selector = "%s://%s%s" % (urltype, realhost, rest)
                if proxy_bypass(realhost):
                    host = realhost

        if not host: raise OSError('http error', 'no host given')

        if proxy_passwd:
            proxy_passwd = unquote(proxy_passwd)
            proxy_auth = base64.b64encode(proxy_passwd.encode()).decode('ascii')
        else:
            proxy_auth = None

        if user_passwd:
            user_passwd = unquote(user_passwd)
            auth = base64.b64encode(user_passwd.encode()).decode('ascii')
        else:
            auth = None
        http_conn = connection_factory(host)
        headers = {}
        if proxy_auth:
            headers["Proxy-Authorization"] = "Basic %s" % proxy_auth
        if auth:
            headers["Authorization"] =  "Basic %s" % auth
        if realhost:
            headers["Host"] = realhost

        # Add Connection:close as we don't support persistent connections yet.
        # This helps in closing the socket and avoiding ResourceWarning

        headers["Connection"] = "close"

        for header, value in self.addheaders:
            headers[header] = value

        if data is not None:
            headers["Content-Type"] = "application/x-www-form-urlencoded"
            http_conn.request("POST", selector, data, headers)
        else:
            http_conn.request("GET", selector, headers=headers)

        try:
            response = http_conn.getresponse()
        except http.client.BadStatusLine:
            # something went wrong with the HTTP status line
            raise URLError("http protocol error: bad status line")

        # According to RFC 2616, "2xx" code indicates that the client's
        # request was successfully received, understood, and accepted.
        if 200 <= response.status < 300:
            return addinfourl(response, response.msg, "http:" + url,
                              response.status)
        else:
            return self.http_error(
                url, response.fp,
                response.status, response.reason, response.msg, data)

    def open_http(self, url, data=None):
        """Use HTTP protocol."""
        return self._open_generic_http(http.client.HTTPConnection, url, data)

    def http_error(self, url, fp, errcode, errmsg, headers, data=None):
        """Handle http errors.

        Derived class can override this, or provide specific handlers
        named http_error_DDD where DDD is the 3-digit error code."""
        # First check if there's a specific handler for this error
        name = 'http_error_%d' % errcode
        if hasattr(self, name):
            method = getattr(self, name)
            if data is None:
                result = method(url, fp, errcode, errmsg, headers)
            else:
                result = method(url, fp, errcode, errmsg, headers, data)
            if result: return result
        return self.http_error_default(url, fp, errcode, errmsg, headers)

    def http_error_default(self, url, fp, errcode, errmsg, headers):
        """Default error handler: close the connection and raise OSError."""
        fp.close()
        raise HTTPError(url, errcode, errmsg, headers, None)

    if _have_ssl:
        def _https_connection(self, host):
            return http.client.HTTPSConnection(host,
                                           key_file=self.key_file,
                                           cert_file=self.cert_file)

        def open_https(self, url, data=None):
            """Use HTTPS protocol."""
            return self._open_generic_http(self._https_connection, url, data)

    def open_file(self, url):
        """Use local file or FTP depending on form of URL."""
        if not isinstance(url, str):
            raise URLError('file error: proxy support for file protocol currently not implemented')
        if url[:2] == '//' and url[2:3] != '/' and url[2:12].lower() != 'localhost/':
            raise ValueError("file:// scheme is supported only on localhost")
        else:
            return self.open_local_file(url)

    def open_local_file(self, url):
        """Use local file."""
        import email.utils
        import mimetypes
        host, file = _splithost(url)
        localname = url2pathname(file)
        try:
            stats = os.stat(localname)
        except OSError as e:
            raise URLError(e.strerror, e.filename)
        size = stats.st_size
        modified = email.utils.formatdate(stats.st_mtime, usegmt=True)
        mtype = mimetypes.guess_type(url)[0]
        headers = email.message_from_string(
            'Content-Type: %s\nContent-Length: %d\nLast-modified: %s\n' %
            (mtype or 'text/plain', size, modified))
        if not host:
            urlfile = file
            if file[:1] == '/':
                urlfile = 'file://' + file
            return addinfourl(open(localname, 'rb'), headers, urlfile)
        host, port = _splitport(host)
        if (not port
           and socket.gethostbyname(host) in ((localhost(),) + thishost())):
            urlfile = file
            if file[:1] == '/':
                urlfile = 'file://' + file
            elif file[:2] == './':
                raise ValueError("local file url may start with / or file:. Unknown url of type: %s" % url)
            return addinfourl(open(localname, 'rb'), headers, urlfile)
        raise URLError('local file error: not on local host')

    def open_ftp(self, url):
        """Use FTP protocol."""
        if not isinstance(url, str):
            raise URLError('ftp error: proxy support for ftp protocol currently not implemented')
        import mimetypes
        host, path = _splithost(url)
        if not host: raise URLError('ftp error: no host given')
        host, port = _splitport(host)
        user, host = _splituser(host)
        if user: user, passwd = _splitpasswd(user)
        else: passwd = None
        host = unquote(host)
        user = unquote(user or '')
        passwd = unquote(passwd or '')
        host = socket.gethostbyname(host)
        if not port:
            import ftplib
            port = ftplib.FTP_PORT
        else:
            port = int(port)
        path, attrs = _splitattr(path)
        path = unquote(path)
        dirs = path.split('/')
        dirs, file = dirs[:-1], dirs[-1]
        if dirs and not dirs[0]: dirs = dirs[1:]
        if dirs and not dirs[0]: dirs[0] = '/'
        key = user, host, port, '/'.join(dirs)
        # XXX thread unsafe!
        if len(self.ftpcache) > MAXFTPCACHE:
            # Prune the cache, rather arbitrarily
            for k in list(self.ftpcache):
                if k != key:
                    v = self.ftpcache[k]
                    del self.ftpcache[k]
                    v.close()
        try:
            if key not in self.ftpcache:
                self.ftpcache[key] = \
                    ftpwrapper(user, passwd, host, port, dirs)
            if not file: type = 'D'
            else: type = 'I'
            for attr in attrs:
                attr, value = _splitvalue(attr)
                if attr.lower() == 'type' and \
                   value in ('a', 'A', 'i', 'I', 'd', 'D'):
                    type = value.upper()
            (fp, retrlen) = self.ftpcache[key].retrfile(file, type)
            mtype = mimetypes.guess_type("ftp:" + url)[0]
            headers = ""
            if mtype:
                headers += "Content-Type: %s\n" % mtype
            if retrlen is not None and retrlen >= 0:
                headers += "Content-Length: %d\n" % retrlen
            headers = email.message_from_string(headers)
            return addinfourl(fp, headers, "ftp:" + url)
        except ftperrors() as exp:
            raise URLError('ftp error %r' % exp).with_traceback(sys.exc_info()[2])

    def open_data(self, url, data=None):
        """Use "data" URL."""
        if not isinstance(url, str):
            raise URLError('data error: proxy support for data protocol currently not implemented')
        # ignore POSTed data
        #
        # syntax of data URLs:
        # dataurl   := "data:" [ mediatype ] [ ";base64" ] "," data
        # mediatype := [ type "/" subtype ] *( ";" parameter )
        # data      := *urlchar
        # parameter := attribute "=" value
        try:
            [type, data] = url.split(',', 1)
        except ValueError:
            raise OSError('data error', 'bad data URL')
        if not type:
            type = 'text/plain;charset=US-ASCII'
        semi = type.rfind(';')
        if semi >= 0 and '=' not in type[semi:]:
            encoding = type[semi+1:]
            type = type[:semi]
        else:
            encoding = ''
        msg = []
        msg.append('Date: %s'%time.strftime('%a, %d %b %Y %H:%M:%S GMT',
                                            time.gmtime(time.time())))
        msg.append('Content-type: %s' % type)
        if encoding == 'base64':
            # XXX is this encoding/decoding ok?
            data = base64.decodebytes(data.encode('ascii')).decode('latin-1')
        else:
            data = unquote(data)
        msg.append('Content-Length: %d' % len(data))
        msg.append('')
        msg.append(data)
        msg = '\n'.join(msg)
        headers = email.message_from_string(msg)
        f = io.StringIO(msg)
        #f.fileno = None     # needed for addinfourl
        return addinfourl(f, headers, url)


class FancyURLopener(URLopener):
    """Derived class with handlers for errors we can handle (perhaps)."""

    def __init__(self, *args, **kwargs):
        URLopener.__init__(self, *args, **kwargs)
        self.auth_cache = {}
        self.tries = 0
        self.maxtries = 10

    def http_error_default(self, url, fp, errcode, errmsg, headers):
        """Default error handling -- don't raise an exception."""
        return addinfourl(fp, headers, "http:" + url, errcode)

    def http_error_302(self, url, fp, errcode, errmsg, headers, data=None):
        """Error 302 -- relocated (temporarily)."""
        self.tries += 1
        try:
            if self.maxtries and self.tries >= self.maxtries:
                if hasattr(self, "http_error_500"):
                    meth = self.http_error_500
                else:
                    meth = self.http_error_default
                return meth(url, fp, 500,
                            "Internal Server Error: Redirect Recursion",
                            headers)
            result = self.redirect_internal(url, fp, errcode, errmsg,
                                            headers, data)
            return result
        finally:
            self.tries = 0

    def redirect_internal(self, url, fp, errcode, errmsg, headers, data):
        if 'location' in headers:
            newurl = headers['location']
        elif 'uri' in headers:
            newurl = headers['uri']
        else:
            return
        fp.close()

        # In case the server sent a relative URL, join with original:
        newurl = urljoin(self.type + ":" + url, newurl)

        urlparts = urlparse(newurl)

        # For security reasons, we don't allow redirection to anything other
        # than http, https and ftp.

        # We are using newer HTTPError with older redirect_internal method
        # This older method will get deprecated in 3.3

        if urlparts.scheme not in ('http', 'https', 'ftp', ''):
            raise HTTPError(newurl, errcode,
                            errmsg +
                            " Redirection to url '%s' is not allowed." % newurl,
                            headers, fp)

        return self.open(newurl)

    def http_error_301(self, url, fp, errcode, errmsg, headers, data=None):
        """Error 301 -- also relocated (permanently)."""
        return self.http_error_302(url, fp, errcode, errmsg, headers, data)

    def http_error_303(self, url, fp, errcode, errmsg, headers, data=None):
        """Error 303 -- also relocated (essentially identical to 302)."""
        return self.http_error_302(url, fp, errcode, errmsg, headers, data)

    def http_error_307(self, url, fp, errcode, errmsg, headers, data=None):
        """Error 307 -- relocated, but turn POST into error."""
        if data is None:
            return self.http_error_302(url, fp, errcode, errmsg, headers, data)
        else:
            return self.http_error_default(url, fp, errcode, errmsg, headers)

    def http_error_401(self, url, fp, errcode, errmsg, headers, data=None,
            retry=False):
        """Error 401 -- authentication required.
        This function supports Basic authentication only."""
        if 'www-authenticate' not in headers:
            URLopener.http_error_default(self, url, fp,
                                         errcode, errmsg, headers)
        stuff = headers['www-authenticate']
        match = re.match('[ \t]*([^ \t]+)[ \t]+realm="([^"]*)"', stuff)
        if not match:
            URLopener.http_error_default(self, url, fp,
                                         errcode, errmsg, headers)
        scheme, realm = match.groups()
        if scheme.lower() != 'basic':
            URLopener.http_error_default(self, url, fp,
                                         errcode, errmsg, headers)
        if not retry:
            URLopener.http_error_default(self, url, fp, errcode, errmsg,
                    headers)
        name = 'retry_' + self.type + '_basic_auth'
        if data is None:
            return getattr(self,name)(url, realm)
        else:
            return getattr(self,name)(url, realm, data)

    def http_error_407(self, url, fp, errcode, errmsg, headers, data=None,
            retry=False):
        """Error 407 -- proxy authentication required.
        This function supports Basic authentication only."""
        if 'proxy-authenticate' not in headers:
            URLopener.http_error_default(self, url, fp,
                                         errcode, errmsg, headers)
        stuff = headers['proxy-authenticate']
        match = re.match('[ \t]*([^ \t]+)[ \t]+realm="([^"]*)"', stuff)
        if not match:
            URLopener.http_error_default(self, url, fp,
                                         errcode, errmsg, headers)
        scheme, realm = match.groups()
        if scheme.lower() != 'basic':
            URLopener.http_error_default(self, url, fp,
                                         errcode, errmsg, headers)
        if not retry:
            URLopener.http_error_default(self, url, fp, errcode, errmsg,
                    headers)
        name = 'retry_proxy_' + self.type + '_basic_auth'
        if data is None:
            return getattr(self,name)(url, realm)
        else:
            return getattr(self,name)(url, realm, data)

    def retry_proxy_http_basic_auth(self, url, realm, data=None):
        host, selector = _splithost(url)
        newurl = 'http://' + host + selector
        proxy = self.proxies['http']
        urltype, proxyhost = _splittype(proxy)
        proxyhost, proxyselector = _splithost(proxyhost)
        i = proxyhost.find('@') + 1
        proxyhost = proxyhost[i:]
        user, passwd = self.get_user_passwd(proxyhost, realm, i)
        if not (user or passwd): return None
        proxyhost = "%s:%s@%s" % (quote(user, safe=''),
                                  quote(passwd, safe=''), proxyhost)
        self.proxies['http'] = 'http://' + proxyhost + proxyselector
        if data is None:
            return self.open(newurl)
        else:
            return self.open(newurl, data)

    def retry_proxy_https_basic_auth(self, url, realm, data=None):
        host, selector = _splithost(url)
        newurl = 'https://' + host + selector
        proxy = self.proxies['https']
        urltype, proxyhost = _splittype(proxy)
        proxyhost, proxyselector = _splithost(proxyhost)
        i = proxyhost.find('@') + 1
        proxyhost = proxyhost[i:]
        user, passwd = self.get_user_passwd(proxyhost, realm, i)
        if not (user or passwd): return None
        proxyhost = "%s:%s@%s" % (quote(user, safe=''),
                                  quote(passwd, safe=''), proxyhost)
        self.proxies['https'] = 'https://' + proxyhost + proxyselector
        if data is None:
            return self.open(newurl)
        else:
            return self.open(newurl, data)

    def retry_http_basic_auth(self, url, realm, data=None):
        host, selector = _splithost(url)
        i = host.find('@') + 1
        host = host[i:]
        user, passwd = self.get_user_passwd(host, realm, i)
        if not (user or passwd): return None
        host = "%s:%s@%s" % (quote(user, safe=''),
                             quote(passwd, safe=''), host)
        newurl = 'http://' + host + selector
        if data is None:
            return self.open(newurl)
        else:
            return self.open(newurl, data)

    def retry_https_basic_auth(self, url, realm, data=None):
        host, selector = _splithost(url)
        i = host.find('@') + 1
        host = host[i:]
        user, passwd = self.get_user_passwd(host, realm, i)
        if not (user or passwd): return None
        host = "%s:%s@%s" % (quote(user, safe=''),
                             quote(passwd, safe=''), host)
        newurl = 'https://' + host + selector
        if data is None:
            return self.open(newurl)
        else:
            return self.open(newurl, data)

    def get_user_passwd(self, host, realm, clear_cache=0):
        key = realm + '@' + host.lower()
        if key in self.auth_cache:
            if clear_cache:
                del self.auth_cache[key]
            else:
                return self.auth_cache[key]
        user, passwd = self.prompt_user_passwd(host, realm)
        if user or passwd: self.auth_cache[key] = (user, passwd)
        return user, passwd

    def prompt_user_passwd(self, host, realm):
        """Override this in a GUI environment!"""
        import getpass
        try:
            user = input("Enter username for %s at %s: " % (realm, host))
            passwd = getpass.getpass("Enter password for %s in %s at %s: " %
                (user, realm, host))
            return user, passwd
        except KeyboardInterrupt:
            print()
            return None, None


# Utility functions

_localhost = None
def localhost():
    """Return the IP address of the magic hostname 'localhost'."""
    global _localhost
    if _localhost is None:
        _localhost = socket.gethostbyname('localhost')
    return _localhost

_thishost = None
def thishost():
    """Return the IP addresses of the current host."""
    global _thishost
    if _thishost is None:
        try:
            _thishost = tuple(socket.gethostbyname_ex(socket.gethostname())[2])
        except socket.gaierror:
            _thishost = tuple(socket.gethostbyname_ex('localhost')[2])
    return _thishost

_ftperrors = None
def ftperrors():
    """Return the set of errors raised by the FTP class."""
    global _ftperrors
    if _ftperrors is None:
        import ftplib
        _ftperrors = ftplib.all_errors
    return _ftperrors

_noheaders = None
def noheaders():
    """Return an empty email Message object."""
    global _noheaders
    if _noheaders is None:
        _noheaders = email.message_from_string("")
    return _noheaders


# Utility classes

class ftpwrapper:
    """Class used by open_ftp() for cache of open FTP connections."""

    def __init__(self, user, passwd, host, port, dirs, timeout=None,
                 persistent=True):
        self.user = user
        self.passwd = passwd
        self.host = host
        self.port = port
        self.dirs = dirs
        self.timeout = timeout
        self.refcount = 0
        self.keepalive = persistent
        try:
            self.init()
        except:
            self.close()
            raise

    def init(self):
        import ftplib
        self.busy = 0
        self.ftp = ftplib.FTP()
        self.ftp.connect(self.host, self.port, self.timeout)
        self.ftp.login(self.user, self.passwd)
        _target = '/'.join(self.dirs)
        self.ftp.cwd(_target)

    def retrfile(self, file, type):
        import ftplib
        self.endtransfer()
        if type in ('d', 'D'): cmd = 'TYPE A'; isdir = 1
        else: cmd = 'TYPE ' + type; isdir = 0
        try:
            self.ftp.voidcmd(cmd)
        except ftplib.all_errors:
            self.init()
            self.ftp.voidcmd(cmd)
        conn = None
        if file and not isdir:
            # Try to retrieve as a file
            try:
                cmd = 'RETR ' + file
                conn, retrlen = self.ftp.ntransfercmd(cmd)
            except ftplib.error_perm as reason:
                if str(reason)[:3] != '550':
                    raise URLError('ftp error: %r' % reason).with_traceback(
                        sys.exc_info()[2])
        if not conn:
            # Set transfer mode to ASCII!
            self.ftp.voidcmd('TYPE A')
            # Try a directory listing. Verify that directory exists.
            if file:
                pwd = self.ftp.pwd()
                try:
                    try:
                        self.ftp.cwd(file)
                    except ftplib.error_perm as reason:
                        raise URLError('ftp error: %r' % reason) from reason
                finally:
                    self.ftp.cwd(pwd)
                cmd = 'LIST ' + file
            else:
                cmd = 'LIST'
            conn, retrlen = self.ftp.ntransfercmd(cmd)
        self.busy = 1

        ftpobj = addclosehook(conn.makefile('rb'), self.file_close)
        self.refcount += 1
        conn.close()
        # Pass back both a suitably decorated object and a retrieval length
        return (ftpobj, retrlen)

    def endtransfer(self):
        self.busy = 0

    def close(self):
        self.keepalive = False
        if self.refcount <= 0:
            self.real_close()

    def file_close(self):
        self.endtransfer()
        self.refcount -= 1
        if self.refcount <= 0 and not self.keepalive:
            self.real_close()

    def real_close(self):
        self.endtransfer()
        try:
            self.ftp.close()
        except ftperrors():
            pass

# Proxy handling
def getproxies_environment():
    """Return a dictionary of scheme -> proxy server URL mappings.

    Scan the environment for variables named <scheme>_proxy;
    this seems to be the standard convention.  If you need a
    different way, you can pass a proxies dictionary to the
    [Fancy]URLopener constructor.

    """
    proxies = {}
    # in order to prefer lowercase variables, process environment in
    # two passes: first matches any, second pass matches lowercase only
    for name, value in os.environ.items():
        name = name.lower()
        if value and name[-6:] == '_proxy':
            proxies[name[:-6]] = value
    # CVE-2016-1000110 - If we are running as CGI script, forget HTTP_PROXY
    # (non-all-lowercase) as it may be set from the web server by a "Proxy:"
    # header from the client
    # If "proxy" is lowercase, it will still be used thanks to the next block
    if 'REQUEST_METHOD' in os.environ:
        proxies.pop('http', None)
    for name, value in os.environ.items():
        if name[-6:] == '_proxy':
            name = name.lower()
            if value:
                proxies[name[:-6]] = value
            else:
                proxies.pop(name[:-6], None)
    return proxies

def proxy_bypass_environment(host, proxies=None):
    """Test if proxies should not be used for a particular host.

    Checks the proxy dict for the value of no_proxy, which should
    be a list of comma separated DNS suffixes, or '*' for all hosts.

    """
    if proxies is None:
        proxies = getproxies_environment()
    # don't bypass, if no_proxy isn't specified
    try:
        no_proxy = proxies['no']
    except KeyError:
        return False
    # '*' is special case for always bypass
    if no_proxy == '*':
        return True
    host = host.lower()
    # strip port off host
    hostonly, port = _splitport(host)
    # check if the host ends with any of the DNS suffixes
    for name in no_proxy.split(','):
        name = name.strip()
        if name:
            name = name.lstrip('.')  # ignore leading dots
            name = name.lower()
            if hostonly == name or host == name:
                return True
            name = '.' + name
            if hostonly.endswith(name) or host.endswith(name):
                return True
    # otherwise, don't bypass
    return False


# This code tests an OSX specific data structure but is testable on all
# platforms
def _proxy_bypass_macosx_sysconf(host, proxy_settings):
    """
    Return True iff this host shouldn't be accessed using a proxy

    This function uses the MacOSX framework SystemConfiguration
    to fetch the proxy information.

    proxy_settings come from _scproxy._get_proxy_settings or get mocked ie:
    { 'exclude_simple': bool,
      'exceptions': ['foo.bar', '*.bar.com', '127.0.0.1', '10.1', '10.0/16']
    }
    """
    from fnmatch import fnmatch

    hostonly, port = _splitport(host)

    def ip2num(ipAddr):
        parts = ipAddr.split('.')
        parts = list(map(int, parts))
        if len(parts) != 4:
            parts = (parts + [0, 0, 0, 0])[:4]
        return (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8) | parts[3]

    # Check for simple host names:
    if '.' not in host:
        if proxy_settings['exclude_simple']:
            return True

    hostIP = None

    for value in proxy_settings.get('exceptions', ()):
        # Items in the list are strings like these: *.local, 169.254/16
        if not value: continue

        m = re.match(r"(\d+(?:\.\d+)*)(/\d+)?", value)
        if m is not None:
            if hostIP is None:
                try:
                    hostIP = socket.gethostbyname(hostonly)
                    hostIP = ip2num(hostIP)
                except OSError:
                    continue

            base = ip2num(m.group(1))
            mask = m.group(2)
            if mask is None:
                mask = 8 * (m.group(1).count('.') + 1)
            else:
                mask = int(mask[1:])

            if mask < 0 or mask > 32:
                # System libraries ignore invalid prefix lengths
                continue

            mask = 32 - mask

            if (hostIP >> mask) == (base >> mask):
                return True

        elif fnmatch(host, value):
            return True

    return False


if sys.platform == 'darwin':
    from _scproxy import _get_proxy_settings, _get_proxies

    def proxy_bypass_macosx_sysconf(host):
        proxy_settings = _get_proxy_settings()
        return _proxy_bypass_macosx_sysconf(host, proxy_settings)

    def getproxies_macosx_sysconf():
        """Return a dictionary of scheme -> proxy server URL mappings.

        This function uses the MacOSX framework SystemConfiguration
        to fetch the proxy information.
        """
        return _get_proxies()



    def proxy_bypass(host):
        """Return True, if host should be bypassed.

        Checks proxy settings gathered from the environment, if specified,
        or from the MacOSX framework SystemConfiguration.

        """
        proxies = getproxies_environment()
        if proxies:
            return proxy_bypass_environment(host, proxies)
        else:
            return proxy_bypass_macosx_sysconf(host)

    def getproxies():
        return getproxies_environment() or getproxies_macosx_sysconf()


elif os.name == 'nt':
    def getproxies_registry():
        """Return a dictionary of scheme -> proxy server URL mappings.

        Win32 uses the registry to store proxies.

        """
        proxies = {}
        try:
            import winreg
        except ImportError:
            # Std module, so should be around - but you never know!
            return proxies
        try:
            internetSettings = winreg.OpenKey(winreg.HKEY_CURRENT_USER,
                r'Software\Microsoft\Windows\CurrentVersion\Internet Settings')
            proxyEnable = winreg.QueryValueEx(internetSettings,
                                               'ProxyEnable')[0]
            if proxyEnable:
                # Returned as Unicode but problems if not converted to ASCII
                proxyServer = str(winreg.QueryValueEx(internetSettings,
                                                       'ProxyServer')[0])
                if '=' in proxyServer:
                    # Per-protocol settings
                    for p in proxyServer.split(';'):
                        protocol, address = p.split('=', 1)
                        # See if address has a type:// prefix
                        if not re.match('(?:[^/:]+)://', address):
                            address = '%s://%s' % (protocol, address)
                        proxies[protocol] = address
                else:
                    # Use one setting for all protocols
                    if proxyServer[:5] == 'http:':
                        proxies['http'] = proxyServer
                    else:
                        proxies['http'] = 'http://%s' % proxyServer
                        proxies['https'] = 'https://%s' % proxyServer
                        proxies['ftp'] = 'ftp://%s' % proxyServer
            internetSettings.Close()
        except (OSError, ValueError, TypeError):
            # Either registry key not found etc, or the value in an
            # unexpected format.
            # proxies already set up to be empty so nothing to do
            pass
        return proxies

    def getproxies():
        """Return a dictionary of scheme -> proxy server URL mappings.

        Returns settings gathered from the environment, if specified,
        or the registry.

        """
        return getproxies_environment() or getproxies_registry()

    def proxy_bypass_registry(host):
        try:
            import winreg
        except ImportError:
            # Std modules, so should be around - but you never know!
            return 0
        try:
            internetSettings = winreg.OpenKey(winreg.HKEY_CURRENT_USER,
                r'Software\Microsoft\Windows\CurrentVersion\Internet Settings')
            proxyEnable = winreg.QueryValueEx(internetSettings,
                                               'ProxyEnable')[0]
            proxyOverride = str(winreg.QueryValueEx(internetSettings,
                                                     'ProxyOverride')[0])
            # ^^^^ Returned as Unicode but problems if not converted to ASCII
        except OSError:
            return 0
        if not proxyEnable or not proxyOverride:
            return 0
        # try to make a host list from name and IP address.
        rawHost, port = _splitport(host)
        host = [rawHost]
        try:
            addr = socket.gethostbyname(rawHost)
            if addr != rawHost:
                host.append(addr)
        except OSError:
            pass
        try:
            fqdn = socket.getfqdn(rawHost)
            if fqdn != rawHost:
                host.append(fqdn)
        except OSError:
            pass
        # make a check value list from the registry entry: replace the
        # '<local>' string by the localhost entry and the corresponding
        # canonical entry.
        proxyOverride = proxyOverride.split(';')
        # now check if we match one of the registry values.
        for test in proxyOverride:
            if test == '<local>':
                if '.' not in rawHost:
                    return 1
            test = test.replace(".", r"\.")     # mask dots
            test = test.replace("*", r".*")     # change glob sequence
            test = test.replace("?", r".")      # change glob char
            for val in host:
                if re.match(test, val, re.I):
                    return 1
        return 0

    def proxy_bypass(host):
        """Return True, if host should be bypassed.

        Checks proxy settings gathered from the environment, if specified,
        or the registry.

        """
        proxies = getproxies_environment()
        if proxies:
            return proxy_bypass_environment(host, proxies)
        else:
            return proxy_bypass_registry(host)

else:
    # By default use environment variables
    getproxies = getproxies_environment
    proxy_bypass = proxy_bypass_environment
ctypes/_endian.py000064400000003720151153537540010035 0ustar00import sys
from ctypes import *

_array_type = type(Array)

def _other_endian(typ):
    """Return the type with the 'other' byte order.  Simple types like
    c_int and so on already have __ctype_be__ and __ctype_le__
    attributes which contain the types, for more complicated types
    arrays and structures are supported.
    """
    # check _OTHER_ENDIAN attribute (present if typ is primitive type)
    if hasattr(typ, _OTHER_ENDIAN):
        return getattr(typ, _OTHER_ENDIAN)
    # if typ is array
    if isinstance(typ, _array_type):
        return _other_endian(typ._type_) * typ._length_
    # if typ is structure
    if issubclass(typ, Structure):
        return typ
    raise TypeError("This type does not support other endian: %s" % typ)

class _swapped_meta(type(Structure)):
    def __setattr__(self, attrname, value):
        if attrname == "_fields_":
            fields = []
            for desc in value:
                name = desc[0]
                typ = desc[1]
                rest = desc[2:]
                fields.append((name, _other_endian(typ)) + rest)
            value = fields
        super().__setattr__(attrname, value)

################################################################

# Note: The Structure metaclass checks for the *presence* (not the
# value!) of a _swapped_bytes_ attribute to determine the bit order in
# structures containing bit fields.

if sys.byteorder == "little":
    _OTHER_ENDIAN = "__ctype_be__"

    LittleEndianStructure = Structure

    class BigEndianStructure(Structure, metaclass=_swapped_meta):
        """Structure with big endian byte order"""
        __slots__ = ()
        _swappedbytes_ = None

elif sys.byteorder == "big":
    _OTHER_ENDIAN = "__ctype_le__"

    BigEndianStructure = Structure
    class LittleEndianStructure(Structure, metaclass=_swapped_meta):
        """Structure with little endian byte order"""
        __slots__ = ()
        _swappedbytes_ = None

else:
    raise RuntimeError("Invalid byteorder")
ctypes/util.py000064400000033067151153537540007424 0ustar00import os
import shutil
import subprocess
import sys

# find_library(name) returns the pathname of a library, or None.
if os.name == "nt":

    def _get_build_version():
        """Return the version of MSVC that was used to build Python.

        For Python 2.3 and up, the version number is included in
        sys.version.  For earlier versions, assume the compiler is MSVC 6.
        """
        # This function was copied from Lib/distutils/msvccompiler.py
        prefix = "MSC v."
        i = sys.version.find(prefix)
        if i == -1:
            return 6
        i = i + len(prefix)
        s, rest = sys.version[i:].split(" ", 1)
        majorVersion = int(s[:-2]) - 6
        if majorVersion >= 13:
            majorVersion += 1
        minorVersion = int(s[2:3]) / 10.0
        # I don't think paths are affected by minor version in version 6
        if majorVersion == 6:
            minorVersion = 0
        if majorVersion >= 6:
            return majorVersion + minorVersion
        # else we don't know what version of the compiler this is
        return None

    def find_msvcrt():
        """Return the name of the VC runtime dll"""
        version = _get_build_version()
        if version is None:
            # better be safe than sorry
            return None
        if version <= 6:
            clibname = 'msvcrt'
        elif version <= 13:
            clibname = 'msvcr%d' % (version * 10)
        else:
            # CRT is no longer directly loadable. See issue23606 for the
            # discussion about alternative approaches.
            return None

        # If python was built with in debug mode
        import importlib.machinery
        if '_d.pyd' in importlib.machinery.EXTENSION_SUFFIXES:
            clibname += 'd'
        return clibname+'.dll'

    def find_library(name):
        if name in ('c', 'm'):
            return find_msvcrt()
        # See MSDN for the REAL search order.
        for directory in os.environ['PATH'].split(os.pathsep):
            fname = os.path.join(directory, name)
            if os.path.isfile(fname):
                return fname
            if fname.lower().endswith(".dll"):
                continue
            fname = fname + ".dll"
            if os.path.isfile(fname):
                return fname
        return None

elif os.name == "posix" and sys.platform == "darwin":
    from ctypes.macholib.dyld import dyld_find as _dyld_find
    def find_library(name):
        possible = ['lib%s.dylib' % name,
                    '%s.dylib' % name,
                    '%s.framework/%s' % (name, name)]
        for name in possible:
            try:
                return _dyld_find(name)
            except ValueError:
                continue
        return None

elif sys.platform.startswith("aix"):
    # AIX has two styles of storing shared libraries
    # GNU auto_tools refer to these as svr4 and aix
    # svr4 (System V Release 4) is a regular file, often with .so as suffix
    # AIX style uses an archive (suffix .a) with members (e.g., shr.o, libssl.so)
    # see issue#26439 and _aix.py for more details

    from ctypes._aix import find_library

elif os.name == "posix":
    # Andreas Degert's find functions, using gcc, /sbin/ldconfig, objdump
    import re, tempfile

    def _is_elf(filename):
        "Return True if the given file is an ELF file"
        elf_header = b'\x7fELF'
        with open(filename, 'br') as thefile:
            return thefile.read(4) == elf_header

    def _findLib_gcc(name):
        # Run GCC's linker with the -t (aka --trace) option and examine the
        # library name it prints out. The GCC command will fail because we
        # haven't supplied a proper program with main(), but that does not
        # matter.
        expr = os.fsencode(r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name))

        c_compiler = shutil.which('gcc')
        if not c_compiler:
            c_compiler = shutil.which('cc')
        if not c_compiler:
            # No C compiler available, give up
            return None

        temp = tempfile.NamedTemporaryFile()
        try:
            args = [c_compiler, '-Wl,-t', '-o', temp.name, '-l' + name]

            env = dict(os.environ)
            env['LC_ALL'] = 'C'
            env['LANG'] = 'C'
            try:
                proc = subprocess.Popen(args,
                                        stdout=subprocess.PIPE,
                                        stderr=subprocess.STDOUT,
                                        env=env)
            except OSError:  # E.g. bad executable
                return None
            with proc:
                trace = proc.stdout.read()
        finally:
            try:
                temp.close()
            except FileNotFoundError:
                # Raised if the file was already removed, which is the normal
                # behaviour of GCC if linking fails
                pass
        res = re.findall(expr, trace)
        if not res:
            return None

        for file in res:
            # Check if the given file is an elf file: gcc can report
            # some files that are linker scripts and not actual
            # shared objects. See bpo-41976 for more details
            if not _is_elf(file):
                continue
            return os.fsdecode(file)


    if sys.platform == "sunos5":
        # use /usr/ccs/bin/dump on solaris
        def _get_soname(f):
            if not f:
                return None

            try:
                proc = subprocess.Popen(("/usr/ccs/bin/dump", "-Lpv", f),
                                        stdout=subprocess.PIPE,
                                        stderr=subprocess.DEVNULL)
            except OSError:  # E.g. command not found
                return None
            with proc:
                data = proc.stdout.read()
            res = re.search(br'\[.*\]\sSONAME\s+([^\s]+)', data)
            if not res:
                return None
            return os.fsdecode(res.group(1))
    else:
        def _get_soname(f):
            # assuming GNU binutils / ELF
            if not f:
                return None
            objdump = shutil.which('objdump')
            if not objdump:
                # objdump is not available, give up
                return None

            try:
                proc = subprocess.Popen((objdump, '-p', '-j', '.dynamic', f),
                                        stdout=subprocess.PIPE,
                                        stderr=subprocess.DEVNULL)
            except OSError:  # E.g. bad executable
                return None
            with proc:
                dump = proc.stdout.read()
            res = re.search(br'\sSONAME\s+([^\s]+)', dump)
            if not res:
                return None
            return os.fsdecode(res.group(1))

    if sys.platform.startswith(("freebsd", "openbsd", "dragonfly")):

        def _num_version(libname):
            # "libxyz.so.MAJOR.MINOR" => [ MAJOR, MINOR ]
            parts = libname.split(b".")
            nums = []
            try:
                while parts:
                    nums.insert(0, int(parts.pop()))
            except ValueError:
                pass
            return nums or [sys.maxsize]

        def find_library(name):
            ename = re.escape(name)
            expr = r':-l%s\.\S+ => \S*/(lib%s\.\S+)' % (ename, ename)
            expr = os.fsencode(expr)

            try:
                proc = subprocess.Popen(('/sbin/ldconfig', '-r'),
                                        stdout=subprocess.PIPE,
                                        stderr=subprocess.DEVNULL)
            except OSError:  # E.g. command not found
                data = b''
            else:
                with proc:
                    data = proc.stdout.read()

            res = re.findall(expr, data)
            if not res:
                return _get_soname(_findLib_gcc(name))
            res.sort(key=_num_version)
            return os.fsdecode(res[-1])

    elif sys.platform == "sunos5":

        def _findLib_crle(name, is64):
            if not os.path.exists('/usr/bin/crle'):
                return None

            env = dict(os.environ)
            env['LC_ALL'] = 'C'

            if is64:
                args = ('/usr/bin/crle', '-64')
            else:
                args = ('/usr/bin/crle',)

            paths = None
            try:
                proc = subprocess.Popen(args,
                                        stdout=subprocess.PIPE,
                                        stderr=subprocess.DEVNULL,
                                        env=env)
            except OSError:  # E.g. bad executable
                return None
            with proc:
                for line in proc.stdout:
                    line = line.strip()
                    if line.startswith(b'Default Library Path (ELF):'):
                        paths = os.fsdecode(line).split()[4]

            if not paths:
                return None

            for dir in paths.split(":"):
                libfile = os.path.join(dir, "lib%s.so" % name)
                if os.path.exists(libfile):
                    return libfile

            return None

        def find_library(name, is64 = False):
            return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name))

    else:

        def _findSoname_ldconfig(name):
            import struct
            if struct.calcsize('l') == 4:
                machine = os.uname().machine + '-32'
            else:
                machine = os.uname().machine + '-64'
            mach_map = {
                'x86_64-64': 'libc6,x86-64',
                'ppc64-64': 'libc6,64bit',
                'sparc64-64': 'libc6,64bit',
                's390x-64': 'libc6,64bit',
                'ia64-64': 'libc6,IA-64',
                }
            abi_type = mach_map.get(machine, 'libc6')

            # XXX assuming GLIBC's ldconfig (with option -p)
            regex = r'\s+(lib%s\.[^\s]+)\s+\(%s'
            regex = os.fsencode(regex % (re.escape(name), abi_type))
            try:
                with subprocess.Popen(['/sbin/ldconfig', '-p'],
                                      stdin=subprocess.DEVNULL,
                                      stderr=subprocess.DEVNULL,
                                      stdout=subprocess.PIPE,
                                      env={'LC_ALL': 'C', 'LANG': 'C'}) as p:
                    res = re.search(regex, p.stdout.read())
                    if res:
                        return os.fsdecode(res.group(1))
            except OSError:
                pass

        def _findLib_ld(name):
            # See issue #9998 for why this is needed
            expr = r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name)
            cmd = ['ld', '-t']
            libpath = os.environ.get('LD_LIBRARY_PATH')
            if libpath:
                for d in libpath.split(':'):
                    cmd.extend(['-L', d])
            cmd.extend(['-o', os.devnull, '-l%s' % name])
            result = None
            try:
                p = subprocess.Popen(cmd, stdout=subprocess.PIPE,
                                     stderr=subprocess.PIPE,
                                     universal_newlines=True)
                out, _ = p.communicate()
                res = re.findall(expr, os.fsdecode(out))
                for file in res:
                    # Check if the given file is an elf file: gcc can report
                    # some files that are linker scripts and not actual
                    # shared objects. See bpo-41976 for more details
                    if not _is_elf(file):
                        continue
                    return os.fsdecode(file)
            except Exception:
                pass  # result will be None
            return result

        def find_library(name):
            # See issue #9998
            return _findSoname_ldconfig(name) or \
                   _get_soname(_findLib_gcc(name)) or _get_soname(_findLib_ld(name))

################################################################
# test code

def test():
    from ctypes import cdll
    if os.name == "nt":
        print(cdll.msvcrt)
        print(cdll.load("msvcrt"))
        print(find_library("msvcrt"))

    if os.name == "posix":
        # find and load_version
        print(find_library("m"))
        print(find_library("c"))
        print(find_library("bz2"))

        # load
        if sys.platform == "darwin":
            print(cdll.LoadLibrary("libm.dylib"))
            print(cdll.LoadLibrary("libcrypto.dylib"))
            print(cdll.LoadLibrary("libSystem.dylib"))
            print(cdll.LoadLibrary("System.framework/System"))
        # issue-26439 - fix broken test call for AIX
        elif sys.platform.startswith("aix"):
            from ctypes import CDLL
            if sys.maxsize < 2**32:
                print(f"Using CDLL(name, os.RTLD_MEMBER): {CDLL('libc.a(shr.o)', os.RTLD_MEMBER)}")
                print(f"Using cdll.LoadLibrary(): {cdll.LoadLibrary('libc.a(shr.o)')}")
                # librpm.so is only available as 32-bit shared library
                print(find_library("rpm"))
                print(cdll.LoadLibrary("librpm.so"))
            else:
                print(f"Using CDLL(name, os.RTLD_MEMBER): {CDLL('libc.a(shr_64.o)', os.RTLD_MEMBER)}")
                print(f"Using cdll.LoadLibrary(): {cdll.LoadLibrary('libc.a(shr_64.o)')}")
            print(f"crypt\t:: {find_library('crypt')}")
            print(f"crypt\t:: {cdll.LoadLibrary(find_library('crypt'))}")
            print(f"crypto\t:: {find_library('crypto')}")
            print(f"crypto\t:: {cdll.LoadLibrary(find_library('crypto'))}")
        else:
            print(cdll.LoadLibrary("libm.so"))
            print(cdll.LoadLibrary("libcrypt.so"))
            print(find_library("crypt"))

if __name__ == "__main__":
    test()
ctypes/__init__.py000064400000042763151153537540010211 0ustar00"""create and manipulate C data types in Python"""

import os as _os, sys as _sys

__version__ = "1.1.0"

from _ctypes import Union, Structure, Array
from _ctypes import _Pointer
from _ctypes import CFuncPtr as _CFuncPtr
from _ctypes import __version__ as _ctypes_version
from _ctypes import RTLD_LOCAL, RTLD_GLOBAL
from _ctypes import ArgumentError

from struct import calcsize as _calcsize

if __version__ != _ctypes_version:
    raise Exception("Version number mismatch", __version__, _ctypes_version)

if _os.name == "nt":
    from _ctypes import FormatError

DEFAULT_MODE = RTLD_LOCAL
if _os.name == "posix" and _sys.platform == "darwin":
    # On OS X 10.3, we use RTLD_GLOBAL as default mode
    # because RTLD_LOCAL does not work at least on some
    # libraries.  OS X 10.3 is Darwin 7, so we check for
    # that.

    if int(_os.uname().release.split('.')[0]) < 8:
        DEFAULT_MODE = RTLD_GLOBAL

from _ctypes import FUNCFLAG_CDECL as _FUNCFLAG_CDECL, \
     FUNCFLAG_PYTHONAPI as _FUNCFLAG_PYTHONAPI, \
     FUNCFLAG_USE_ERRNO as _FUNCFLAG_USE_ERRNO, \
     FUNCFLAG_USE_LASTERROR as _FUNCFLAG_USE_LASTERROR

# WINOLEAPI -> HRESULT
# WINOLEAPI_(type)
#
# STDMETHODCALLTYPE
#
# STDMETHOD(name)
# STDMETHOD_(type, name)
#
# STDAPICALLTYPE

def create_string_buffer(init, size=None):
    """create_string_buffer(aBytes) -> character array
    create_string_buffer(anInteger) -> character array
    create_string_buffer(aBytes, anInteger) -> character array
    """
    if isinstance(init, bytes):
        if size is None:
            size = len(init)+1
        _sys.audit("ctypes.create_string_buffer", init, size)
        buftype = c_char * size
        buf = buftype()
        buf.value = init
        return buf
    elif isinstance(init, int):
        _sys.audit("ctypes.create_string_buffer", None, init)
        buftype = c_char * init
        buf = buftype()
        return buf
    raise TypeError(init)

def c_buffer(init, size=None):
##    "deprecated, use create_string_buffer instead"
##    import warnings
##    warnings.warn("c_buffer is deprecated, use create_string_buffer instead",
##                  DeprecationWarning, stacklevel=2)
    return create_string_buffer(init, size)

_c_functype_cache = {}
def CFUNCTYPE(restype, *argtypes, **kw):
    """CFUNCTYPE(restype, *argtypes,
                 use_errno=False, use_last_error=False) -> function prototype.

    restype: the result type
    argtypes: a sequence specifying the argument types

    The function prototype can be called in different ways to create a
    callable object:

    prototype(integer address) -> foreign function
    prototype(callable) -> create and return a C callable function from callable
    prototype(integer index, method name[, paramflags]) -> foreign function calling a COM method
    prototype((ordinal number, dll object)[, paramflags]) -> foreign function exported by ordinal
    prototype((function name, dll object)[, paramflags]) -> foreign function exported by name
    """
    flags = _FUNCFLAG_CDECL
    if kw.pop("use_errno", False):
        flags |= _FUNCFLAG_USE_ERRNO
    if kw.pop("use_last_error", False):
        flags |= _FUNCFLAG_USE_LASTERROR
    if kw:
        raise ValueError("unexpected keyword argument(s) %s" % kw.keys())
    try:
        return _c_functype_cache[(restype, argtypes, flags)]
    except KeyError:
        class CFunctionType(_CFuncPtr):
            _argtypes_ = argtypes
            _restype_ = restype
            _flags_ = flags
        _c_functype_cache[(restype, argtypes, flags)] = CFunctionType
        return CFunctionType

if _os.name == "nt":
    from _ctypes import LoadLibrary as _dlopen
    from _ctypes import FUNCFLAG_STDCALL as _FUNCFLAG_STDCALL

    _win_functype_cache = {}
    def WINFUNCTYPE(restype, *argtypes, **kw):
        # docstring set later (very similar to CFUNCTYPE.__doc__)
        flags = _FUNCFLAG_STDCALL
        if kw.pop("use_errno", False):
            flags |= _FUNCFLAG_USE_ERRNO
        if kw.pop("use_last_error", False):
            flags |= _FUNCFLAG_USE_LASTERROR
        if kw:
            raise ValueError("unexpected keyword argument(s) %s" % kw.keys())
        try:
            return _win_functype_cache[(restype, argtypes, flags)]
        except KeyError:
            class WinFunctionType(_CFuncPtr):
                _argtypes_ = argtypes
                _restype_ = restype
                _flags_ = flags
            _win_functype_cache[(restype, argtypes, flags)] = WinFunctionType
            return WinFunctionType
    if WINFUNCTYPE.__doc__:
        WINFUNCTYPE.__doc__ = CFUNCTYPE.__doc__.replace("CFUNCTYPE", "WINFUNCTYPE")

elif _os.name == "posix":
    from _ctypes import dlopen as _dlopen

from _ctypes import sizeof, byref, addressof, alignment, resize
from _ctypes import get_errno, set_errno
from _ctypes import _SimpleCData

def _check_size(typ, typecode=None):
    # Check if sizeof(ctypes_type) against struct.calcsize.  This
    # should protect somewhat against a misconfigured libffi.
    from struct import calcsize
    if typecode is None:
        # Most _type_ codes are the same as used in struct
        typecode = typ._type_
    actual, required = sizeof(typ), calcsize(typecode)
    if actual != required:
        raise SystemError("sizeof(%s) wrong: %d instead of %d" % \
                          (typ, actual, required))

class py_object(_SimpleCData):
    _type_ = "O"
    def __repr__(self):
        try:
            return super().__repr__()
        except ValueError:
            return "%s(<NULL>)" % type(self).__name__
_check_size(py_object, "P")

class c_short(_SimpleCData):
    _type_ = "h"
_check_size(c_short)

class c_ushort(_SimpleCData):
    _type_ = "H"
_check_size(c_ushort)

class c_long(_SimpleCData):
    _type_ = "l"
_check_size(c_long)

class c_ulong(_SimpleCData):
    _type_ = "L"
_check_size(c_ulong)

if _calcsize("i") == _calcsize("l"):
    # if int and long have the same size, make c_int an alias for c_long
    c_int = c_long
    c_uint = c_ulong
else:
    class c_int(_SimpleCData):
        _type_ = "i"
    _check_size(c_int)

    class c_uint(_SimpleCData):
        _type_ = "I"
    _check_size(c_uint)

class c_float(_SimpleCData):
    _type_ = "f"
_check_size(c_float)

class c_double(_SimpleCData):
    _type_ = "d"
_check_size(c_double)

class c_longdouble(_SimpleCData):
    _type_ = "g"
if sizeof(c_longdouble) == sizeof(c_double):
    c_longdouble = c_double

if _calcsize("l") == _calcsize("q"):
    # if long and long long have the same size, make c_longlong an alias for c_long
    c_longlong = c_long
    c_ulonglong = c_ulong
else:
    class c_longlong(_SimpleCData):
        _type_ = "q"
    _check_size(c_longlong)

    class c_ulonglong(_SimpleCData):
        _type_ = "Q"
    ##    def from_param(cls, val):
    ##        return ('d', float(val), val)
    ##    from_param = classmethod(from_param)
    _check_size(c_ulonglong)

class c_ubyte(_SimpleCData):
    _type_ = "B"
c_ubyte.__ctype_le__ = c_ubyte.__ctype_be__ = c_ubyte
# backward compatibility:
##c_uchar = c_ubyte
_check_size(c_ubyte)

class c_byte(_SimpleCData):
    _type_ = "b"
c_byte.__ctype_le__ = c_byte.__ctype_be__ = c_byte
_check_size(c_byte)

class c_char(_SimpleCData):
    _type_ = "c"
c_char.__ctype_le__ = c_char.__ctype_be__ = c_char
_check_size(c_char)

class c_char_p(_SimpleCData):
    _type_ = "z"
    def __repr__(self):
        return "%s(%s)" % (self.__class__.__name__, c_void_p.from_buffer(self).value)
_check_size(c_char_p, "P")

class c_void_p(_SimpleCData):
    _type_ = "P"
c_voidp = c_void_p # backwards compatibility (to a bug)
_check_size(c_void_p)

class c_bool(_SimpleCData):
    _type_ = "?"

from _ctypes import POINTER, pointer, _pointer_type_cache

class c_wchar_p(_SimpleCData):
    _type_ = "Z"
    def __repr__(self):
        return "%s(%s)" % (self.__class__.__name__, c_void_p.from_buffer(self).value)

class c_wchar(_SimpleCData):
    _type_ = "u"

def _reset_cache():
    _pointer_type_cache.clear()
    _c_functype_cache.clear()
    if _os.name == "nt":
        _win_functype_cache.clear()
    # _SimpleCData.c_wchar_p_from_param
    POINTER(c_wchar).from_param = c_wchar_p.from_param
    # _SimpleCData.c_char_p_from_param
    POINTER(c_char).from_param = c_char_p.from_param
    _pointer_type_cache[None] = c_void_p

def create_unicode_buffer(init, size=None):
    """create_unicode_buffer(aString) -> character array
    create_unicode_buffer(anInteger) -> character array
    create_unicode_buffer(aString, anInteger) -> character array
    """
    if isinstance(init, str):
        if size is None:
            if sizeof(c_wchar) == 2:
                # UTF-16 requires a surrogate pair (2 wchar_t) for non-BMP
                # characters (outside [U+0000; U+FFFF] range). +1 for trailing
                # NUL character.
                size = sum(2 if ord(c) > 0xFFFF else 1 for c in init) + 1
            else:
                # 32-bit wchar_t (1 wchar_t per Unicode character). +1 for
                # trailing NUL character.
                size = len(init) + 1
        _sys.audit("ctypes.create_unicode_buffer", init, size)
        buftype = c_wchar * size
        buf = buftype()
        buf.value = init
        return buf
    elif isinstance(init, int):
        _sys.audit("ctypes.create_unicode_buffer", None, init)
        buftype = c_wchar * init
        buf = buftype()
        return buf
    raise TypeError(init)


# XXX Deprecated
def SetPointerType(pointer, cls):
    if _pointer_type_cache.get(cls, None) is not None:
        raise RuntimeError("This type already exists in the cache")
    if id(pointer) not in _pointer_type_cache:
        raise RuntimeError("What's this???")
    pointer.set_type(cls)
    _pointer_type_cache[cls] = pointer
    del _pointer_type_cache[id(pointer)]

# XXX Deprecated
def ARRAY(typ, len):
    return typ * len

################################################################


class CDLL(object):
    """An instance of this class represents a loaded dll/shared
    library, exporting functions using the standard C calling
    convention (named 'cdecl' on Windows).

    The exported functions can be accessed as attributes, or by
    indexing with the function name.  Examples:

    <obj>.qsort -> callable object
    <obj>['qsort'] -> callable object

    Calling the functions releases the Python GIL during the call and
    reacquires it afterwards.
    """
    _func_flags_ = _FUNCFLAG_CDECL
    _func_restype_ = c_int
    # default values for repr
    _name = '<uninitialized>'
    _handle = 0
    _FuncPtr = None

    def __init__(self, name, mode=DEFAULT_MODE, handle=None,
                 use_errno=False,
                 use_last_error=False,
                 winmode=None):
        self._name = name
        flags = self._func_flags_
        if use_errno:
            flags |= _FUNCFLAG_USE_ERRNO
        if use_last_error:
            flags |= _FUNCFLAG_USE_LASTERROR
        if _sys.platform.startswith("aix"):
            """When the name contains ".a(" and ends with ")",
               e.g., "libFOO.a(libFOO.so)" - this is taken to be an
               archive(member) syntax for dlopen(), and the mode is adjusted.
               Otherwise, name is presented to dlopen() as a file argument.
            """
            if name and name.endswith(")") and ".a(" in name:
                mode |= ( _os.RTLD_MEMBER | _os.RTLD_NOW )
        if _os.name == "nt":
            if winmode is not None:
                mode = winmode
            else:
                import nt
                mode = nt._LOAD_LIBRARY_SEARCH_DEFAULT_DIRS
                if '/' in name or '\\' in name:
                    self._name = nt._getfullpathname(self._name)
                    mode |= nt._LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR

        class _FuncPtr(_CFuncPtr):
            _flags_ = flags
            _restype_ = self._func_restype_
        self._FuncPtr = _FuncPtr

        if handle is None:
            self._handle = _dlopen(self._name, mode)
        else:
            self._handle = handle

    def __repr__(self):
        return "<%s '%s', handle %x at %#x>" % \
               (self.__class__.__name__, self._name,
                (self._handle & (_sys.maxsize*2 + 1)),
                id(self) & (_sys.maxsize*2 + 1))

    def __getattr__(self, name):
        if name.startswith('__') and name.endswith('__'):
            raise AttributeError(name)
        func = self.__getitem__(name)
        setattr(self, name, func)
        return func

    def __getitem__(self, name_or_ordinal):
        func = self._FuncPtr((name_or_ordinal, self))
        if not isinstance(name_or_ordinal, int):
            func.__name__ = name_or_ordinal
        return func

class PyDLL(CDLL):
    """This class represents the Python library itself.  It allows
    accessing Python API functions.  The GIL is not released, and
    Python exceptions are handled correctly.
    """
    _func_flags_ = _FUNCFLAG_CDECL | _FUNCFLAG_PYTHONAPI

if _os.name == "nt":

    class WinDLL(CDLL):
        """This class represents a dll exporting functions using the
        Windows stdcall calling convention.
        """
        _func_flags_ = _FUNCFLAG_STDCALL

    # XXX Hm, what about HRESULT as normal parameter?
    # Mustn't it derive from c_long then?
    from _ctypes import _check_HRESULT, _SimpleCData
    class HRESULT(_SimpleCData):
        _type_ = "l"
        # _check_retval_ is called with the function's result when it
        # is used as restype.  It checks for the FAILED bit, and
        # raises an OSError if it is set.
        #
        # The _check_retval_ method is implemented in C, so that the
        # method definition itself is not included in the traceback
        # when it raises an error - that is what we want (and Python
        # doesn't have a way to raise an exception in the caller's
        # frame).
        _check_retval_ = _check_HRESULT

    class OleDLL(CDLL):
        """This class represents a dll exporting functions using the
        Windows stdcall calling convention, and returning HRESULT.
        HRESULT error values are automatically raised as OSError
        exceptions.
        """
        _func_flags_ = _FUNCFLAG_STDCALL
        _func_restype_ = HRESULT

class LibraryLoader(object):
    def __init__(self, dlltype):
        self._dlltype = dlltype

    def __getattr__(self, name):
        if name[0] == '_':
            raise AttributeError(name)
        dll = self._dlltype(name)
        setattr(self, name, dll)
        return dll

    def __getitem__(self, name):
        return getattr(self, name)

    def LoadLibrary(self, name):
        return self._dlltype(name)

cdll = LibraryLoader(CDLL)
pydll = LibraryLoader(PyDLL)

if _os.name == "nt":
    pythonapi = PyDLL("python dll", None, _sys.dllhandle)
elif _sys.platform == "cygwin":
    pythonapi = PyDLL("libpython%d.%d.dll" % _sys.version_info[:2])
else:
    pythonapi = PyDLL(None)


if _os.name == "nt":
    windll = LibraryLoader(WinDLL)
    oledll = LibraryLoader(OleDLL)

    GetLastError = windll.kernel32.GetLastError
    from _ctypes import get_last_error, set_last_error

    def WinError(code=None, descr=None):
        if code is None:
            code = GetLastError()
        if descr is None:
            descr = FormatError(code).strip()
        return OSError(None, descr, None, code)

if sizeof(c_uint) == sizeof(c_void_p):
    c_size_t = c_uint
    c_ssize_t = c_int
elif sizeof(c_ulong) == sizeof(c_void_p):
    c_size_t = c_ulong
    c_ssize_t = c_long
elif sizeof(c_ulonglong) == sizeof(c_void_p):
    c_size_t = c_ulonglong
    c_ssize_t = c_longlong

# functions

from _ctypes import _memmove_addr, _memset_addr, _string_at_addr, _cast_addr

## void *memmove(void *, const void *, size_t);
memmove = CFUNCTYPE(c_void_p, c_void_p, c_void_p, c_size_t)(_memmove_addr)

## void *memset(void *, int, size_t)
memset = CFUNCTYPE(c_void_p, c_void_p, c_int, c_size_t)(_memset_addr)

def PYFUNCTYPE(restype, *argtypes):
    class CFunctionType(_CFuncPtr):
        _argtypes_ = argtypes
        _restype_ = restype
        _flags_ = _FUNCFLAG_CDECL | _FUNCFLAG_PYTHONAPI
    return CFunctionType

_cast = PYFUNCTYPE(py_object, c_void_p, py_object, py_object)(_cast_addr)
def cast(obj, typ):
    return _cast(obj, obj, typ)

_string_at = PYFUNCTYPE(py_object, c_void_p, c_int)(_string_at_addr)
def string_at(ptr, size=-1):
    """string_at(addr[, size]) -> string

    Return the string at addr."""
    return _string_at(ptr, size)

try:
    from _ctypes import _wstring_at_addr
except ImportError:
    pass
else:
    _wstring_at = PYFUNCTYPE(py_object, c_void_p, c_int)(_wstring_at_addr)
    def wstring_at(ptr, size=-1):
        """wstring_at(addr[, size]) -> string

        Return the string at addr."""
        return _wstring_at(ptr, size)


if _os.name == "nt": # COM stuff
    def DllGetClassObject(rclsid, riid, ppv):
        try:
            ccom = __import__("comtypes.server.inprocserver", globals(), locals(), ['*'])
        except ImportError:
            return -2147221231 # CLASS_E_CLASSNOTAVAILABLE
        else:
            return ccom.DllGetClassObject(rclsid, riid, ppv)

    def DllCanUnloadNow():
        try:
            ccom = __import__("comtypes.server.inprocserver", globals(), locals(), ['*'])
        except ImportError:
            return 0 # S_OK
        return ccom.DllCanUnloadNow()

from ctypes._endian import BigEndianStructure, LittleEndianStructure

# Fill in specifically-sized types
c_int8 = c_byte
c_uint8 = c_ubyte
for kind in [c_short, c_int, c_long, c_longlong]:
    if sizeof(kind) == 2: c_int16 = kind
    elif sizeof(kind) == 4: c_int32 = kind
    elif sizeof(kind) == 8: c_int64 = kind
for kind in [c_ushort, c_uint, c_ulong, c_ulonglong]:
    if sizeof(kind) == 2: c_uint16 = kind
    elif sizeof(kind) == 4: c_uint32 = kind
    elif sizeof(kind) == 8: c_uint64 = kind
del(kind)

_reset_cache()
ctypes/macholib/__init__.py000064400000000232151153537540011750 0ustar00"""
Enough Mach-O to make your head spin.

See the relevant header files in /usr/include/mach-o

And also Apple's documentation.
"""

__version__ = '1.0'
ctypes/macholib/README.ctypes000064400000000450151153537540012027 0ustar00Files in this directory come from Bob Ippolito's py2app.

License: Any components of the py2app suite may be distributed under
the MIT or PSF open source licenses.

This is version 1.0, SVN revision 789, from 2006/01/25.
The main repository is http://svn.red-bean.com/bob/macholib/trunk/macholib/ctypes/macholib/dyld.py000064400000012243151153537540011152 0ustar00"""
dyld emulation
"""

import os
from ctypes.macholib.framework import framework_info
from ctypes.macholib.dylib import dylib_info
from itertools import *
try:
    from _ctypes import _dyld_shared_cache_contains_path
except ImportError:
    def _dyld_shared_cache_contains_path(*args):
        raise NotImplementedError

__all__ = [
    'dyld_find', 'framework_find',
    'framework_info', 'dylib_info',
]

# These are the defaults as per man dyld(1)
#
DEFAULT_FRAMEWORK_FALLBACK = [
    os.path.expanduser("~/Library/Frameworks"),
    "/Library/Frameworks",
    "/Network/Library/Frameworks",
    "/System/Library/Frameworks",
]

DEFAULT_LIBRARY_FALLBACK = [
    os.path.expanduser("~/lib"),
    "/usr/local/lib",
    "/lib",
    "/usr/lib",
]

def dyld_env(env, var):
    if env is None:
        env = os.environ
    rval = env.get(var)
    if rval is None:
        return []
    return rval.split(':')

def dyld_image_suffix(env=None):
    if env is None:
        env = os.environ
    return env.get('DYLD_IMAGE_SUFFIX')

def dyld_framework_path(env=None):
    return dyld_env(env, 'DYLD_FRAMEWORK_PATH')

def dyld_library_path(env=None):
    return dyld_env(env, 'DYLD_LIBRARY_PATH')

def dyld_fallback_framework_path(env=None):
    return dyld_env(env, 'DYLD_FALLBACK_FRAMEWORK_PATH')

def dyld_fallback_library_path(env=None):
    return dyld_env(env, 'DYLD_FALLBACK_LIBRARY_PATH')

def dyld_image_suffix_search(iterator, env=None):
    """For a potential path iterator, add DYLD_IMAGE_SUFFIX semantics"""
    suffix = dyld_image_suffix(env)
    if suffix is None:
        return iterator
    def _inject(iterator=iterator, suffix=suffix):
        for path in iterator:
            if path.endswith('.dylib'):
                yield path[:-len('.dylib')] + suffix + '.dylib'
            else:
                yield path + suffix
            yield path
    return _inject()

def dyld_override_search(name, env=None):
    # If DYLD_FRAMEWORK_PATH is set and this dylib_name is a
    # framework name, use the first file that exists in the framework
    # path if any.  If there is none go on to search the DYLD_LIBRARY_PATH
    # if any.

    framework = framework_info(name)

    if framework is not None:
        for path in dyld_framework_path(env):
            yield os.path.join(path, framework['name'])

    # If DYLD_LIBRARY_PATH is set then use the first file that exists
    # in the path.  If none use the original name.
    for path in dyld_library_path(env):
        yield os.path.join(path, os.path.basename(name))

def dyld_executable_path_search(name, executable_path=None):
    # If we haven't done any searching and found a library and the
    # dylib_name starts with "@executable_path/" then construct the
    # library name.
    if name.startswith('@executable_path/') and executable_path is not None:
        yield os.path.join(executable_path, name[len('@executable_path/'):])

def dyld_default_search(name, env=None):
    yield name

    framework = framework_info(name)

    if framework is not None:
        fallback_framework_path = dyld_fallback_framework_path(env)
        for path in fallback_framework_path:
            yield os.path.join(path, framework['name'])

    fallback_library_path = dyld_fallback_library_path(env)
    for path in fallback_library_path:
        yield os.path.join(path, os.path.basename(name))

    if framework is not None and not fallback_framework_path:
        for path in DEFAULT_FRAMEWORK_FALLBACK:
            yield os.path.join(path, framework['name'])

    if not fallback_library_path:
        for path in DEFAULT_LIBRARY_FALLBACK:
            yield os.path.join(path, os.path.basename(name))

def dyld_find(name, executable_path=None, env=None):
    """
    Find a library or framework using dyld semantics
    """
    for path in dyld_image_suffix_search(chain(
                dyld_override_search(name, env),
                dyld_executable_path_search(name, executable_path),
                dyld_default_search(name, env),
            ), env):

        if os.path.isfile(path):
            return path
        try:
            if _dyld_shared_cache_contains_path(path):
                return path
        except NotImplementedError:
            pass

    raise ValueError("dylib %s could not be found" % (name,))

def framework_find(fn, executable_path=None, env=None):
    """
    Find a framework using dyld semantics in a very loose manner.

    Will take input such as:
        Python
        Python.framework
        Python.framework/Versions/Current
    """
    error = None
    try:
        return dyld_find(fn, executable_path=executable_path, env=env)
    except ValueError as e:
        error = e
    fmwk_index = fn.rfind('.framework')
    if fmwk_index == -1:
        fmwk_index = len(fn)
        fn += '.framework'
    fn = os.path.join(fn, os.path.basename(fn[:fmwk_index]))
    try:
        return dyld_find(fn, executable_path=executable_path, env=env)
    except ValueError:
        raise error
    finally:
        error = None

def test_dyld_find():
    env = {}
    assert dyld_find('libSystem.dylib') == '/usr/lib/libSystem.dylib'
    assert dyld_find('System.framework/System') == '/System/Library/Frameworks/System.framework/System'

if __name__ == '__main__':
    test_dyld_find()
ctypes/macholib/framework.py000064400000004231151153537540012211 0ustar00"""
Generic framework path manipulation
"""

import re

__all__ = ['framework_info']

STRICT_FRAMEWORK_RE = re.compile(r"""(?x)
(?P<location>^.*)(?:^|/)
(?P<name>
    (?P<shortname>\w+).framework/
    (?:Versions/(?P<version>[^/]+)/)?
    (?P=shortname)
    (?:_(?P<suffix>[^_]+))?
)$
""")

def framework_info(filename):
    """
    A framework name can take one of the following four forms:
        Location/Name.framework/Versions/SomeVersion/Name_Suffix
        Location/Name.framework/Versions/SomeVersion/Name
        Location/Name.framework/Name_Suffix
        Location/Name.framework/Name

    returns None if not found, or a mapping equivalent to:
        dict(
            location='Location',
            name='Name.framework/Versions/SomeVersion/Name_Suffix',
            shortname='Name',
            version='SomeVersion',
            suffix='Suffix',
        )

    Note that SomeVersion and Suffix are optional and may be None
    if not present
    """
    is_framework = STRICT_FRAMEWORK_RE.match(filename)
    if not is_framework:
        return None
    return is_framework.groupdict()

def test_framework_info():
    def d(location=None, name=None, shortname=None, version=None, suffix=None):
        return dict(
            location=location,
            name=name,
            shortname=shortname,
            version=version,
            suffix=suffix
        )
    assert framework_info('completely/invalid') is None
    assert framework_info('completely/invalid/_debug') is None
    assert framework_info('P/F.framework') is None
    assert framework_info('P/F.framework/_debug') is None
    assert framework_info('P/F.framework/F') == d('P', 'F.framework/F', 'F')
    assert framework_info('P/F.framework/F_debug') == d('P', 'F.framework/F_debug', 'F', suffix='debug')
    assert framework_info('P/F.framework/Versions') is None
    assert framework_info('P/F.framework/Versions/A') is None
    assert framework_info('P/F.framework/Versions/A/F') == d('P', 'F.framework/Versions/A/F', 'F', 'A')
    assert framework_info('P/F.framework/Versions/A/F_debug') == d('P', 'F.framework/Versions/A/F_debug', 'F', 'A', 'debug')

if __name__ == '__main__':
    test_framework_info()
ctypes/macholib/dylib.py000064400000003444151153537540011324 0ustar00"""
Generic dylib path manipulation
"""

import re

__all__ = ['dylib_info']

DYLIB_RE = re.compile(r"""(?x)
(?P<location>^.*)(?:^|/)
(?P<name>
    (?P<shortname>\w+?)
    (?:\.(?P<version>[^._]+))?
    (?:_(?P<suffix>[^._]+))?
    \.dylib$
)
""")

def dylib_info(filename):
    """
    A dylib name can take one of the following four forms:
        Location/Name.SomeVersion_Suffix.dylib
        Location/Name.SomeVersion.dylib
        Location/Name_Suffix.dylib
        Location/Name.dylib

    returns None if not found or a mapping equivalent to:
        dict(
            location='Location',
            name='Name.SomeVersion_Suffix.dylib',
            shortname='Name',
            version='SomeVersion',
            suffix='Suffix',
        )

    Note that SomeVersion and Suffix are optional and may be None
    if not present.
    """
    is_dylib = DYLIB_RE.match(filename)
    if not is_dylib:
        return None
    return is_dylib.groupdict()


def test_dylib_info():
    def d(location=None, name=None, shortname=None, version=None, suffix=None):
        return dict(
            location=location,
            name=name,
            shortname=shortname,
            version=version,
            suffix=suffix
        )
    assert dylib_info('completely/invalid') is None
    assert dylib_info('completely/invalide_debug') is None
    assert dylib_info('P/Foo.dylib') == d('P', 'Foo.dylib', 'Foo')
    assert dylib_info('P/Foo_debug.dylib') == d('P', 'Foo_debug.dylib', 'Foo', suffix='debug')
    assert dylib_info('P/Foo.A.dylib') == d('P', 'Foo.A.dylib', 'Foo', 'A')
    assert dylib_info('P/Foo_debug.A.dylib') == d('P', 'Foo_debug.A.dylib', 'Foo_debug', 'A')
    assert dylib_info('P/Foo.A_debug.dylib') == d('P', 'Foo.A_debug.dylib', 'Foo', 'A', 'debug')

if __name__ == '__main__':
    test_dylib_info()
ctypes/macholib/__pycache__/dylib.cpython-38.opt-2.pyc000064400000001531151153537540016545 0ustar00U

e5d$�@s:ddlZdgZe�d�Zdd�Zdd�Zedkr6e�dS)�N�
dylib_infoz�(?x)
(?P<location>^.*)(?:^|/)
(?P<name>
    (?P<shortname>\w+?)
    (?:\.(?P<version>[^._]+))?
    (?:_(?P<suffix>[^._]+))?
    \.dylib$
)
cCst�|�}|sdS|��S)N)�DYLIB_RE�match�	groupdict)�filenameZis_dylib�r�-/usr/lib64/python3.8/ctypes/macholib/dylib.pyrs
cCsddd�}dS)NcSst|||||d�S)N��location�nameZ	shortname�version�suffix)�dictr	rrr�d.s�ztest_dylib_info.<locals>.d)NNNNNr)rrrr�test_dylib_info-s
r�__main__)�re�__all__�compilerrr�__name__rrrr�<module>s

ctypes/macholib/__pycache__/framework.cpython-38.pyc000064400000004226151153537540016503 0ustar00U

e5d��@s>dZddlZdgZe�d�Zdd�Zdd�Zedkr:e�dS)	z%
Generic framework path manipulation
�N�framework_infoz�(?x)
(?P<location>^.*)(?:^|/)
(?P<name>
    (?P<shortname>\w+).framework/
    (?:Versions/(?P<version>[^/]+)/)?
    (?P=shortname)
    (?:_(?P<suffix>[^_]+))?
)$
cCst�|�}|sdS|��S)a}
    A framework name can take one of the following four forms:
        Location/Name.framework/Versions/SomeVersion/Name_Suffix
        Location/Name.framework/Versions/SomeVersion/Name
        Location/Name.framework/Name_Suffix
        Location/Name.framework/Name

    returns None if not found, or a mapping equivalent to:
        dict(
            location='Location',
            name='Name.framework/Versions/SomeVersion/Name_Suffix',
            shortname='Name',
            version='SomeVersion',
            suffix='Suffix',
        )

    Note that SomeVersion and Suffix are optional and may be None
    if not present
    N)�STRICT_FRAMEWORK_RE�match�	groupdict)�filenameZis_framework�r�1/usr/lib64/python3.8/ctypes/macholib/framework.pyrs
cCs�ddd�}td�dkst�td�dks*t�td�dks:t�td�dksJt�td�|dd	d
�ksbt�td�|ddd
d
d�ks~t�td�dks�t�td�dks�t�td�|ddd
d�ks�t�td�|ddd
dd
�ks�t�dS)NcSst|||||d�S)N��location�nameZ	shortname�version�suffix)�dictr	rrr�d-s�ztest_framework_info.<locals>.dzcompletely/invalidzcompletely/invalid/_debugz
P/F.frameworkzP/F.framework/_debugzP/F.framework/F�Pz
F.framework/F�FzP/F.framework/F_debugzF.framework/F_debug�debug)r
zP/F.framework/VersionszP/F.framework/Versions/AzP/F.framework/Versions/A/FzF.framework/Versions/A/F�Az P/F.framework/Versions/A/F_debugzF.framework/Versions/A/F_debug)NNNNN)r�AssertionError)rrrr�test_framework_info,s
r�__main__)�__doc__�re�__all__�compilerrr�__name__rrrr�<module>s

ctypes/macholib/__pycache__/dyld.cpython-38.pyc000064400000011074151153537540015441 0ustar00U

e5d��@s dZddlZddlmZddlmZddlTzddlmZWne	k
rXdd�ZYnXd	d
ddgZ
ej�d
�dddgZ
ej�d�dddgZdd�Zd.dd�Zd/dd�Zd0dd�Zd1dd�Zd2dd �Zd3d!d"�Zd4d#d$�Zd5d%d&�Zd6d'd(�Zd7d)d	�Zd8d*d
�Zd+d,�Zed-k�re�dS)9z
dyld emulation
�N)�framework_info)�
dylib_info)�*)� _dyld_shared_cache_contains_pathcGst�dS)N)�NotImplementedError)�args�r�,/usr/lib64/python3.8/ctypes/macholib/dyld.pyrsr�	dyld_find�framework_findrrz~/Library/Frameworksz/Library/Frameworksz/Network/Library/Frameworksz/System/Library/Frameworksz~/libz/usr/local/libz/libz/usr/libcCs.|dkrtj}|�|�}|dkr$gS|�d�S)N�:)�os�environ�get�split)�env�varZrvalrrr	�dyld_env$s
rcCs|dkrtj}|�d�S)NZDYLD_IMAGE_SUFFIX)r
rr�rrrr	�dyld_image_suffix,srcCs
t|d�S)NZDYLD_FRAMEWORK_PATH�rrrrr	�dyld_framework_path1srcCs
t|d�S)NZDYLD_LIBRARY_PATHrrrrr	�dyld_library_path4srcCs
t|d�S)NZDYLD_FALLBACK_FRAMEWORK_PATHrrrrr	�dyld_fallback_framework_path7srcCs
t|d�S)NZDYLD_FALLBACK_LIBRARY_PATHrrrrr	�dyld_fallback_library_path:srcCs(t|�}|dkr|S||fdd�}|�S)z>For a potential path iterator, add DYLD_IMAGE_SUFFIX semanticsNcssF|D]<}|�d�r0|dtd��|dVn
||V|VqdS)Nz.dylib)�endswith�len)�iterator�suffix�pathrrr	�_injectBs


z)dyld_image_suffix_search.<locals>._inject)r)rrrr rrr	�dyld_image_suffix_search=s
r!ccs\t|�}|dk	r2t|�D]}tj�||d�Vqt|�D]}tj�|tj�|��Vq:dS�N�name)rrr
r�joinr�basename)r#r�	frameworkrrrr	�dyld_override_searchKsr'ccs2|�d�r.|dk	r.tj�||td�d��VdS)Nz@executable_path/)�
startswithr
rr$r)r#�executable_pathrrr	�dyld_executable_path_search\sr*ccs�|Vt|�}|dk	r<t|�}|D]}tj�||d�Vq"t|�}|D]}tj�|tj�|��VqH|dk	r�|s�tD]}tj�||d�Vqv|s�tD]}tj�|tj�|��Vq�dSr")	rrr
rr$rr%�DEFAULT_FRAMEWORK_FALLBACK�DEFAULT_LIBRARY_FALLBACK)r#rr&Zfallback_framework_pathrZfallback_library_pathrrr	�dyld_default_searchcsr-c	Cs|ttt||�t||�t||��|�D]D}tj�|�r<|Szt|�rP|WSWq$t	k
rfYq$Xq$t
d|f��dS)z:
    Find a library or framework using dyld semantics
    zdylib %s could not be foundN)r!�chainr'r*r-r
r�isfilerr�
ValueError)r#r)rrrrr	r
ys��c
Cs�d}zt|||d�WStk
r:}z|}W5d}~XYnX|�d�}|dkr^t|�}|d7}tj�|tj�|d|���}z2zt|||d�WW�Stk
r�|�YnXW5d}XdS)z�
    Find a framework using dyld semantics in a very loose manner.

    Will take input such as:
        Python
        Python.framework
        Python.framework/Versions/Current
    N)r)rz
.framework���)r
r0�rfindrr
rr$r%)�fnr)r�error�eZ
fmwk_indexrrr	r�s	
cCs(i}td�dkst�td�dks$t�dS)NzlibSystem.dylibz/usr/lib/libSystem.dylibzSystem.framework/Systemz2/System/Library/Frameworks/System.framework/System)r
�AssertionErrorrrrr	�test_dyld_find�sr7�__main__)N)N)N)N)N)N)N)N)N)NN)NN)�__doc__r
Zctypes.macholib.frameworkrZctypes.macholib.dylibr�	itertoolsZ_ctypesr�ImportError�__all__r�
expanduserr+r,rrrrrrr!r'r*r-r
rr7�__name__rrrr	�<module>sL�
�
�











ctypes/macholib/__pycache__/framework.cpython-38.opt-1.pyc000064400000003107151153537540017437 0ustar00U

e5d��@s>dZddlZdgZe�d�Zdd�Zdd�Zedkr:e�dS)	z%
Generic framework path manipulation
�N�framework_infoz�(?x)
(?P<location>^.*)(?:^|/)
(?P<name>
    (?P<shortname>\w+).framework/
    (?:Versions/(?P<version>[^/]+)/)?
    (?P=shortname)
    (?:_(?P<suffix>[^_]+))?
)$
cCst�|�}|sdS|��S)a}
    A framework name can take one of the following four forms:
        Location/Name.framework/Versions/SomeVersion/Name_Suffix
        Location/Name.framework/Versions/SomeVersion/Name
        Location/Name.framework/Name_Suffix
        Location/Name.framework/Name

    returns None if not found, or a mapping equivalent to:
        dict(
            location='Location',
            name='Name.framework/Versions/SomeVersion/Name_Suffix',
            shortname='Name',
            version='SomeVersion',
            suffix='Suffix',
        )

    Note that SomeVersion and Suffix are optional and may be None
    if not present
    N)�STRICT_FRAMEWORK_RE�match�	groupdict)�filenameZis_framework�r�1/usr/lib64/python3.8/ctypes/macholib/framework.pyrs
cCsddd�}dS)NcSst|||||d�S)N��location�nameZ	shortname�version�suffix)�dictr	rrr�d-s�ztest_framework_info.<locals>.d)NNNNNr)rrrr�test_framework_info,s
r�__main__)�__doc__�re�__all__�compilerrr�__name__rrrr�<module>s

ctypes/macholib/__pycache__/__init__.cpython-38.opt-1.pyc000064400000000455151153537540017204 0ustar00U

e5d��@sdZdZdS)z~
Enough Mach-O to make your head spin.

See the relevant header files in /usr/include/mach-o

And also Apple's documentation.
z1.0N)�__doc__�__version__�rr�0/usr/lib64/python3.8/ctypes/macholib/__init__.py�<module>sctypes/macholib/__pycache__/framework.cpython-38.opt-2.pyc000064400000001617151153537540017444 0ustar00U

e5d��@s:ddlZdgZe�d�Zdd�Zdd�Zedkr6e�dS)�N�framework_infoz�(?x)
(?P<location>^.*)(?:^|/)
(?P<name>
    (?P<shortname>\w+).framework/
    (?:Versions/(?P<version>[^/]+)/)?
    (?P=shortname)
    (?:_(?P<suffix>[^_]+))?
)$
cCst�|�}|sdS|��S)N)�STRICT_FRAMEWORK_RE�match�	groupdict)�filenameZis_framework�r�1/usr/lib64/python3.8/ctypes/macholib/framework.pyrs
cCsddd�}dS)NcSst|||||d�S)N��location�nameZ	shortname�version�suffix)�dictr	rrr�d-s�ztest_framework_info.<locals>.d)NNNNNr)rrrr�test_framework_info,s
r�__main__)�re�__all__�compilerrr�__name__rrrr�<module>s

ctypes/macholib/__pycache__/dylib.cpython-38.pyc000064400000003576151153537540015620 0ustar00U

e5d$�@s>dZddlZdgZe�d�Zdd�Zdd�Zedkr:e�dS)	z!
Generic dylib path manipulation
�N�
dylib_infoz�(?x)
(?P<location>^.*)(?:^|/)
(?P<name>
    (?P<shortname>\w+?)
    (?:\.(?P<version>[^._]+))?
    (?:_(?P<suffix>[^._]+))?
    \.dylib$
)
cCst�|�}|sdS|��S)a1
    A dylib name can take one of the following four forms:
        Location/Name.SomeVersion_Suffix.dylib
        Location/Name.SomeVersion.dylib
        Location/Name_Suffix.dylib
        Location/Name.dylib

    returns None if not found or a mapping equivalent to:
        dict(
            location='Location',
            name='Name.SomeVersion_Suffix.dylib',
            shortname='Name',
            version='SomeVersion',
            suffix='Suffix',
        )

    Note that SomeVersion and Suffix are optional and may be None
    if not present.
    N)�DYLIB_RE�match�	groupdict)�filenameZis_dylib�r�-/usr/lib64/python3.8/ctypes/macholib/dylib.pyrs
cCs�ddd�}td�dkst�td�dks*t�td�|ddd�ksBt�td	�|dd
ddd�ks^t�td
�|dddd�ksxt�td�|dddd�ks�t�td�|ddddd�ks�t�dS)NcSst|||||d�S)N��location�nameZ	shortname�version�suffix)�dictr	rrr�d.s�ztest_dylib_info.<locals>.dzcompletely/invalidzcompletely/invalide_debugzP/Foo.dylib�Pz	Foo.dylibZFoozP/Foo_debug.dylibzFoo_debug.dylib�debug)r
z
P/Foo.A.dylibzFoo.A.dylib�AzP/Foo_debug.A.dylibzFoo_debug.A.dylibZ	Foo_debugzP/Foo.A_debug.dylibzFoo.A_debug.dylib)NNNNN)r�AssertionError)rrrr�test_dylib_info-s
r�__main__)�__doc__�re�__all__�compilerrr�__name__rrrr�<module>s

ctypes/macholib/__pycache__/dylib.cpython-38.opt-1.pyc000064400000002701151153537540016544 0ustar00U

e5d$�@s>dZddlZdgZe�d�Zdd�Zdd�Zedkr:e�dS)	z!
Generic dylib path manipulation
�N�
dylib_infoz�(?x)
(?P<location>^.*)(?:^|/)
(?P<name>
    (?P<shortname>\w+?)
    (?:\.(?P<version>[^._]+))?
    (?:_(?P<suffix>[^._]+))?
    \.dylib$
)
cCst�|�}|sdS|��S)a1
    A dylib name can take one of the following four forms:
        Location/Name.SomeVersion_Suffix.dylib
        Location/Name.SomeVersion.dylib
        Location/Name_Suffix.dylib
        Location/Name.dylib

    returns None if not found or a mapping equivalent to:
        dict(
            location='Location',
            name='Name.SomeVersion_Suffix.dylib',
            shortname='Name',
            version='SomeVersion',
            suffix='Suffix',
        )

    Note that SomeVersion and Suffix are optional and may be None
    if not present.
    N)�DYLIB_RE�match�	groupdict)�filenameZis_dylib�r�-/usr/lib64/python3.8/ctypes/macholib/dylib.pyrs
cCsddd�}dS)NcSst|||||d�S)N��location�nameZ	shortname�version�suffix)�dictr	rrr�d.s�ztest_dylib_info.<locals>.d)NNNNNr)rrrr�test_dylib_info-s
r�__main__)�__doc__�re�__all__�compilerrr�__name__rrrr�<module>s

ctypes/macholib/__pycache__/__init__.cpython-38.opt-2.pyc000064400000000236151153537540017202 0ustar00U

e5d��@sdZdS)z1.0N)�__version__�rr�0/usr/lib64/python3.8/ctypes/macholib/__init__.py�<module>	�ctypes/macholib/__pycache__/__init__.cpython-38.pyc000064400000000455151153537540016245 0ustar00U

e5d��@sdZdZdS)z~
Enough Mach-O to make your head spin.

See the relevant header files in /usr/include/mach-o

And also Apple's documentation.
z1.0N)�__doc__�__version__�rr�0/usr/lib64/python3.8/ctypes/macholib/__init__.py�<module>sctypes/macholib/__pycache__/dyld.cpython-38.opt-1.pyc000064400000010622151153537540016376 0ustar00U

e5d��@s dZddlZddlmZddlmZddlTzddlmZWne	k
rXdd�ZYnXd	d
ddgZ
ej�d
�dddgZ
ej�d�dddgZdd�Zd.dd�Zd/dd�Zd0dd�Zd1dd�Zd2dd �Zd3d!d"�Zd4d#d$�Zd5d%d&�Zd6d'd(�Zd7d)d	�Zd8d*d
�Zd+d,�Zed-k�re�dS)9z
dyld emulation
�N)�framework_info)�
dylib_info)�*)� _dyld_shared_cache_contains_pathcGst�dS�N)�NotImplementedError)�args�r	�,/usr/lib64/python3.8/ctypes/macholib/dyld.pyrsr�	dyld_find�framework_findrrz~/Library/Frameworksz/Library/Frameworksz/Network/Library/Frameworksz/System/Library/Frameworksz~/libz/usr/local/libz/libz/usr/libcCs.|dkrtj}|�|�}|dkr$gS|�d�S)N�:)�os�environ�get�split)�env�varZrvalr	r	r
�dyld_env$s
rcCs|dkrtj}|�d�S)NZDYLD_IMAGE_SUFFIX)rrr�rr	r	r
�dyld_image_suffix,srcCs
t|d�S)NZDYLD_FRAMEWORK_PATH�rrr	r	r
�dyld_framework_path1srcCs
t|d�S)NZDYLD_LIBRARY_PATHrrr	r	r
�dyld_library_path4srcCs
t|d�S)NZDYLD_FALLBACK_FRAMEWORK_PATHrrr	r	r
�dyld_fallback_framework_path7srcCs
t|d�S)NZDYLD_FALLBACK_LIBRARY_PATHrrr	r	r
�dyld_fallback_library_path:srcCs(t|�}|dkr|S||fdd�}|�S)z>For a potential path iterator, add DYLD_IMAGE_SUFFIX semanticsNcssF|D]<}|�d�r0|dtd��|dVn
||V|VqdS)Nz.dylib)�endswith�len)�iterator�suffix�pathr	r	r
�_injectBs


z)dyld_image_suffix_search.<locals>._inject)r)rrrr!r	r	r
�dyld_image_suffix_search=s
r"ccs\t|�}|dk	r2t|�D]}tj�||d�Vqt|�D]}tj�|tj�|��Vq:dS�N�name)rrrr �joinr�basename)r$r�	frameworkr r	r	r
�dyld_override_searchKsr(ccs2|�d�r.|dk	r.tj�||td�d��VdS)Nz@executable_path/)�
startswithrr r%r)r$�executable_pathr	r	r
�dyld_executable_path_search\sr+ccs�|Vt|�}|dk	r<t|�}|D]}tj�||d�Vq"t|�}|D]}tj�|tj�|��VqH|dk	r�|s�tD]}tj�||d�Vqv|s�tD]}tj�|tj�|��Vq�dSr#)	rrrr r%rr&�DEFAULT_FRAMEWORK_FALLBACK�DEFAULT_LIBRARY_FALLBACK)r$rr'Zfallback_framework_pathr Zfallback_library_pathr	r	r
�dyld_default_searchcsr.c	Cs|ttt||�t||�t||��|�D]D}tj�|�r<|Szt|�rP|WSWq$t	k
rfYq$Xq$t
d|f��dS)z:
    Find a library or framework using dyld semantics
    zdylib %s could not be foundN)r"�chainr(r+r.rr �isfilerr�
ValueError)r$r*rr r	r	r
rys��c
Cs�d}zt|||d�WStk
r:}z|}W5d}~XYnX|�d�}|dkr^t|�}|d7}tj�|tj�|d|���}z2zt|||d�WW�Stk
r�|�YnXW5d}XdS)z�
    Find a framework using dyld semantics in a very loose manner.

    Will take input such as:
        Python
        Python.framework
        Python.framework/Versions/Current
    N)r*rz
.framework���)rr1�rfindrrr r%r&)�fnr*r�error�eZ
fmwk_indexr	r	r
r�s	
cCsi}dSrr	rr	r	r
�test_dyld_find�sr7�__main__)N)N)N)N)N)N)N)N)N)NN)NN)�__doc__rZctypes.macholib.frameworkrZctypes.macholib.dylibr�	itertoolsZ_ctypesr�ImportError�__all__r �
expanduserr,r-rrrrrrr"r(r+r.rrr7�__name__r	r	r	r
�<module>sL�
�
�











ctypes/macholib/__pycache__/dyld.cpython-38.opt-2.pyc000064400000010074151153537540016400 0ustar00U

e5d��@sddlZddlmZddlmZddlTzddlmZWnek
rTdd�ZYnXdd	d
dgZ	ej
�d�d
ddgZej
�d�dddgZ
dd�Zd-dd�Zd.dd�Zd/dd�Zd0dd�Zd1dd�Zd2d d!�Zd3d"d#�Zd4d$d%�Zd5d&d'�Zd6d(d�Zd7d)d	�Zd*d+�Zed,k�re�dS)8�N)�framework_info)�
dylib_info)�*)� _dyld_shared_cache_contains_pathcGst�dS�N)�NotImplementedError)�args�r	�,/usr/lib64/python3.8/ctypes/macholib/dyld.pyrsr�	dyld_find�framework_findrrz~/Library/Frameworksz/Library/Frameworksz/Network/Library/Frameworksz/System/Library/Frameworksz~/libz/usr/local/libz/libz/usr/libcCs.|dkrtj}|�|�}|dkr$gS|�d�S)N�:)�os�environ�get�split)�env�varZrvalr	r	r
�dyld_env$s
rcCs|dkrtj}|�d�S)NZDYLD_IMAGE_SUFFIX)rrr�rr	r	r
�dyld_image_suffix,srcCs
t|d�S)NZDYLD_FRAMEWORK_PATH�rrr	r	r
�dyld_framework_path1srcCs
t|d�S)NZDYLD_LIBRARY_PATHrrr	r	r
�dyld_library_path4srcCs
t|d�S)NZDYLD_FALLBACK_FRAMEWORK_PATHrrr	r	r
�dyld_fallback_framework_path7srcCs
t|d�S)NZDYLD_FALLBACK_LIBRARY_PATHrrr	r	r
�dyld_fallback_library_path:srcCs(t|�}|dkr|S||fdd�}|�S)NcssF|D]<}|�d�r0|dtd��|dVn
||V|VqdS)Nz.dylib)�endswith�len)�iterator�suffix�pathr	r	r
�_injectBs


z)dyld_image_suffix_search.<locals>._inject)r)rrrr!r	r	r
�dyld_image_suffix_search=s
r"ccs\t|�}|dk	r2t|�D]}tj�||d�Vqt|�D]}tj�|tj�|��Vq:dS�N�name)rrrr �joinr�basename)r$r�	frameworkr r	r	r
�dyld_override_searchKsr(ccs2|�d�r.|dk	r.tj�||td�d��VdS)Nz@executable_path/)�
startswithrr r%r)r$�executable_pathr	r	r
�dyld_executable_path_search\sr+ccs�|Vt|�}|dk	r<t|�}|D]}tj�||d�Vq"t|�}|D]}tj�|tj�|��VqH|dk	r�|s�tD]}tj�||d�Vqv|s�tD]}tj�|tj�|��Vq�dSr#)	rrrr r%rr&�DEFAULT_FRAMEWORK_FALLBACK�DEFAULT_LIBRARY_FALLBACK)r$rr'Zfallback_framework_pathr Zfallback_library_pathr	r	r
�dyld_default_searchcsr.c	Cs|ttt||�t||�t||��|�D]D}tj�|�r<|Szt|�rP|WSWq$t	k
rfYq$Xq$t
d|f��dS)Nzdylib %s could not be found)r"�chainr(r+r.rr �isfilerr�
ValueError)r$r*rr r	r	r
rys��c
Cs�d}zt|||d�WStk
r:}z|}W5d}~XYnX|�d�}|dkr^t|�}|d7}tj�|tj�|d|���}z2zt|||d�WW�Stk
r�|�YnXW5d}XdS)N)r*rz
.framework���)rr1�rfindrrr r%r&)�fnr*r�error�eZ
fmwk_indexr	r	r
r�s	
cCsi}dSrr	rr	r	r
�test_dyld_find�sr7�__main__)N)N)N)N)N)N)N)N)N)NN)NN)rZctypes.macholib.frameworkrZctypes.macholib.dylibr�	itertoolsZ_ctypesr�ImportError�__all__r �
expanduserr,r-rrrrrrr"r(r+r.rrr7�__name__r	r	r	r
�<module>sJ�
�
�











ctypes/macholib/fetch_macholib000075500000000124151153537540012514 0ustar00#!/bin/sh
svn export --force http://svn.red-bean.com/bob/macholib/trunk/macholib/ .
ctypes/wintypes.py000064400000012774151153537540010333 0ustar00# The most useful windows datatypes
import ctypes

BYTE = ctypes.c_byte
WORD = ctypes.c_ushort
DWORD = ctypes.c_ulong

#UCHAR = ctypes.c_uchar
CHAR = ctypes.c_char
WCHAR = ctypes.c_wchar
UINT = ctypes.c_uint
INT = ctypes.c_int

DOUBLE = ctypes.c_double
FLOAT = ctypes.c_float

BOOLEAN = BYTE
BOOL = ctypes.c_long

class VARIANT_BOOL(ctypes._SimpleCData):
    _type_ = "v"
    def __repr__(self):
        return "%s(%r)" % (self.__class__.__name__, self.value)

ULONG = ctypes.c_ulong
LONG = ctypes.c_long

USHORT = ctypes.c_ushort
SHORT = ctypes.c_short

# in the windows header files, these are structures.
_LARGE_INTEGER = LARGE_INTEGER = ctypes.c_longlong
_ULARGE_INTEGER = ULARGE_INTEGER = ctypes.c_ulonglong

LPCOLESTR = LPOLESTR = OLESTR = ctypes.c_wchar_p
LPCWSTR = LPWSTR = ctypes.c_wchar_p
LPCSTR = LPSTR = ctypes.c_char_p
LPCVOID = LPVOID = ctypes.c_void_p

# WPARAM is defined as UINT_PTR (unsigned type)
# LPARAM is defined as LONG_PTR (signed type)
if ctypes.sizeof(ctypes.c_long) == ctypes.sizeof(ctypes.c_void_p):
    WPARAM = ctypes.c_ulong
    LPARAM = ctypes.c_long
elif ctypes.sizeof(ctypes.c_longlong) == ctypes.sizeof(ctypes.c_void_p):
    WPARAM = ctypes.c_ulonglong
    LPARAM = ctypes.c_longlong

ATOM = WORD
LANGID = WORD

COLORREF = DWORD
LGRPID = DWORD
LCTYPE = DWORD

LCID = DWORD

################################################################
# HANDLE types
HANDLE = ctypes.c_void_p # in the header files: void *

HACCEL = HANDLE
HBITMAP = HANDLE
HBRUSH = HANDLE
HCOLORSPACE = HANDLE
HDC = HANDLE
HDESK = HANDLE
HDWP = HANDLE
HENHMETAFILE = HANDLE
HFONT = HANDLE
HGDIOBJ = HANDLE
HGLOBAL = HANDLE
HHOOK = HANDLE
HICON = HANDLE
HINSTANCE = HANDLE
HKEY = HANDLE
HKL = HANDLE
HLOCAL = HANDLE
HMENU = HANDLE
HMETAFILE = HANDLE
HMODULE = HANDLE
HMONITOR = HANDLE
HPALETTE = HANDLE
HPEN = HANDLE
HRGN = HANDLE
HRSRC = HANDLE
HSTR = HANDLE
HTASK = HANDLE
HWINSTA = HANDLE
HWND = HANDLE
SC_HANDLE = HANDLE
SERVICE_STATUS_HANDLE = HANDLE

################################################################
# Some important structure definitions

class RECT(ctypes.Structure):
    _fields_ = [("left", LONG),
                ("top", LONG),
                ("right", LONG),
                ("bottom", LONG)]
tagRECT = _RECTL = RECTL = RECT

class _SMALL_RECT(ctypes.Structure):
    _fields_ = [('Left', SHORT),
                ('Top', SHORT),
                ('Right', SHORT),
                ('Bottom', SHORT)]
SMALL_RECT = _SMALL_RECT

class _COORD(ctypes.Structure):
    _fields_ = [('X', SHORT),
                ('Y', SHORT)]

class POINT(ctypes.Structure):
    _fields_ = [("x", LONG),
                ("y", LONG)]
tagPOINT = _POINTL = POINTL = POINT

class SIZE(ctypes.Structure):
    _fields_ = [("cx", LONG),
                ("cy", LONG)]
tagSIZE = SIZEL = SIZE

def RGB(red, green, blue):
    return red + (green << 8) + (blue << 16)

class FILETIME(ctypes.Structure):
    _fields_ = [("dwLowDateTime", DWORD),
                ("dwHighDateTime", DWORD)]
_FILETIME = FILETIME

class MSG(ctypes.Structure):
    _fields_ = [("hWnd", HWND),
                ("message", UINT),
                ("wParam", WPARAM),
                ("lParam", LPARAM),
                ("time", DWORD),
                ("pt", POINT)]
tagMSG = MSG
MAX_PATH = 260

class WIN32_FIND_DATAA(ctypes.Structure):
    _fields_ = [("dwFileAttributes", DWORD),
                ("ftCreationTime", FILETIME),
                ("ftLastAccessTime", FILETIME),
                ("ftLastWriteTime", FILETIME),
                ("nFileSizeHigh", DWORD),
                ("nFileSizeLow", DWORD),
                ("dwReserved0", DWORD),
                ("dwReserved1", DWORD),
                ("cFileName", CHAR * MAX_PATH),
                ("cAlternateFileName", CHAR * 14)]

class WIN32_FIND_DATAW(ctypes.Structure):
    _fields_ = [("dwFileAttributes", DWORD),
                ("ftCreationTime", FILETIME),
                ("ftLastAccessTime", FILETIME),
                ("ftLastWriteTime", FILETIME),
                ("nFileSizeHigh", DWORD),
                ("nFileSizeLow", DWORD),
                ("dwReserved0", DWORD),
                ("dwReserved1", DWORD),
                ("cFileName", WCHAR * MAX_PATH),
                ("cAlternateFileName", WCHAR * 14)]

################################################################
# Pointer types

LPBOOL = PBOOL = ctypes.POINTER(BOOL)
PBOOLEAN = ctypes.POINTER(BOOLEAN)
LPBYTE = PBYTE = ctypes.POINTER(BYTE)
PCHAR = ctypes.POINTER(CHAR)
LPCOLORREF = ctypes.POINTER(COLORREF)
LPDWORD = PDWORD = ctypes.POINTER(DWORD)
LPFILETIME = PFILETIME = ctypes.POINTER(FILETIME)
PFLOAT = ctypes.POINTER(FLOAT)
LPHANDLE = PHANDLE = ctypes.POINTER(HANDLE)
PHKEY = ctypes.POINTER(HKEY)
LPHKL = ctypes.POINTER(HKL)
LPINT = PINT = ctypes.POINTER(INT)
PLARGE_INTEGER = ctypes.POINTER(LARGE_INTEGER)
PLCID = ctypes.POINTER(LCID)
LPLONG = PLONG = ctypes.POINTER(LONG)
LPMSG = PMSG = ctypes.POINTER(MSG)
LPPOINT = PPOINT = ctypes.POINTER(POINT)
PPOINTL = ctypes.POINTER(POINTL)
LPRECT = PRECT = ctypes.POINTER(RECT)
LPRECTL = PRECTL = ctypes.POINTER(RECTL)
LPSC_HANDLE = ctypes.POINTER(SC_HANDLE)
PSHORT = ctypes.POINTER(SHORT)
LPSIZE = PSIZE = ctypes.POINTER(SIZE)
LPSIZEL = PSIZEL = ctypes.POINTER(SIZEL)
PSMALL_RECT = ctypes.POINTER(SMALL_RECT)
LPUINT = PUINT = ctypes.POINTER(UINT)
PULARGE_INTEGER = ctypes.POINTER(ULARGE_INTEGER)
PULONG = ctypes.POINTER(ULONG)
PUSHORT = ctypes.POINTER(USHORT)
PWCHAR = ctypes.POINTER(WCHAR)
LPWIN32_FIND_DATAA = PWIN32_FIND_DATAA = ctypes.POINTER(WIN32_FIND_DATAA)
LPWIN32_FIND_DATAW = PWIN32_FIND_DATAW = ctypes.POINTER(WIN32_FIND_DATAW)
LPWORD = PWORD = ctypes.POINTER(WORD)
ctypes/__pycache__/wintypes.cpython-38.opt-2.pyc000064400000011761151153537540015554 0ustar00U

e5d��@sddlZejZejZejZejZej	Z
ejZej
ZejZejZeZejZGdd�dej�ZejZejZejZejZejZZej Z!Z"ej#Z$Z%Z&ej#Z'Z(ej)Z*Z+ej,Z-Z.e�/ej�e�/ej,�kr�ejZ0ejZ1n$e�/ej�e�/ej,�kr�ej Z0ejZ1eZ2eZ3eZ4eZ5eZ6eZ7ej,Z8e8Z9e8Z:e8Z;e8Z<e8Z=e8Z>e8Z?e8Z@e8ZAe8ZBe8ZCe8ZDe8ZEe8ZFe8ZGe8ZHe8ZIe8ZJe8ZKe8ZLe8ZMe8ZNe8ZOe8ZPe8ZQe8ZRe8ZSe8ZTe8ZUe8ZVe8ZWGdd�dejX�ZYeYZZZ[Z\Gdd�dejX�Z]e]Z^Gdd	�d	ejX�Z_Gd
d�dejX�Z`e`ZaZbZcGdd
�d
ejX�ZdedZeZfdd�ZgGdd�dejX�ZhehZiGdd�dejX�ZjejZkdZlGdd�dejX�ZmGdd�dejX�Zne�oe�ZpZqe�oe�Zre�oe�ZsZte�oe�Zue�oe4�Zve�oe�ZwZxe�oeh�ZyZze�oe�Z{e�oe8�Z|Z}e�oeG�Z~e�oeH�Ze�oe�Z�Z�e�oe�Z�e�oe7�Z�e�oe�Z�Z�e�oej�Z�Z�e�oe`�Z�Z�e�oec�Z�e�oeY�Z�Z�e�oe\�Z�Z�e�oeV�Z�e�oe�Z�e�oed�Z�Z�e�oef�Z�Z�e�oe^�Z�e�oe�Z�Z�e�oe"�Z�e�oe�Z�e�oe�Z�e�oe
�Z�e�oem�Z�Z�e�oen�Z�Z�e�oe�Z�Z�dS)�Nc@seZdZdZdd�ZdS)�VARIANT_BOOL�vcCsd|jj|jfS)Nz%s(%r))�	__class__�__name__�value)�self�r�'/usr/lib64/python3.8/ctypes/wintypes.py�__repr__szVARIANT_BOOL.__repr__N)r�
__module__�__qualname__Z_type_r
rrrr	rsrc@s(eZdZdefdefdefdefgZdS)�RECT�left�top�rightZbottomN�rrr�LONG�_fields_rrrr	r
as
�r
c@s(eZdZdefdefdefdefgZdS)�_SMALL_RECTZLeftZTopZRightZBottomN�rrr�SHORTrrrrr	rhs
�rc@seZdZdefdefgZdS)�_COORD�X�YNrrrrr	ros�rc@seZdZdefdefgZdS)�POINT�x�yNrrrrr	rss�rc@seZdZdefdefgZdS)�SIZEZcxZcyNrrrrr	rxs�rcCs||d>|d>S)N��r)ZredZgreenZbluerrr	�RGB}sr c@seZdZdefdefgZdS)�FILETIMEZ
dwLowDateTimeZdwHighDateTimeN)rrr�DWORDrrrrr	r!�s�r!c@s4eZdZdefdefdefdefdefdefgZ	dS)�MSGZhWnd�messageZwParamZlParam�timeZptN)
rrr�HWND�UINT�WPARAM�LPARAMr"rrrrrr	r#�s�r#ic@sTeZdZdefdefdefdefdefdefdefdefd	eefd
edfg
ZdS)
�WIN32_FIND_DATAA�dwFileAttributes�ftCreationTime�ftLastAccessTime�ftLastWriteTime�
nFileSizeHigh�nFileSizeLow�dwReserved0�dwReserved1�	cFileName�cAlternateFileName�N)rrrr"r!�CHAR�MAX_PATHrrrrr	r*�s

�r*c@sTeZdZdefdefdefdefdefdefdefdefd	eefd
edfg
ZdS)
�WIN32_FIND_DATAWr+r,r-r.r/r0r1r2r3r4r5N)rrrr"r!�WCHARr7rrrrr	r8�s

�r8)�ZctypesZc_byteZBYTEZc_ushortZWORDZc_ulongr"Zc_charr6Zc_wcharr9Zc_uintr'Zc_intZINTZc_doubleZDOUBLEZc_floatZFLOATZBOOLEANZc_longZBOOLZ_SimpleCDatarZULONGrZUSHORTZc_shortrZ
c_longlongZ_LARGE_INTEGERZ
LARGE_INTEGERZc_ulonglongZ_ULARGE_INTEGERZULARGE_INTEGERZ	c_wchar_pZ	LPCOLESTRZLPOLESTRZOLESTRZLPCWSTRZLPWSTRZc_char_pZLPCSTRZLPSTRZc_void_pZLPCVOIDZLPVOIDZsizeofr(r)ZATOMZLANGIDZCOLORREFZLGRPIDZLCTYPEZLCIDZHANDLEZHACCELZHBITMAPZHBRUSHZHCOLORSPACEZHDCZHDESKZHDWPZHENHMETAFILEZHFONTZHGDIOBJZHGLOBALZHHOOKZHICONZ	HINSTANCEZHKEYZHKLZHLOCALZHMENUZ	HMETAFILEZHMODULEZHMONITORZHPALETTEZHPENZHRGNZHRSRCZHSTRZHTASKZHWINSTAr&Z	SC_HANDLEZSERVICE_STATUS_HANDLEZ	Structurer
ZtagRECTZ_RECTLZRECTLrZ
SMALL_RECTrrZtagPOINTZ_POINTLZPOINTLrZtagSIZEZSIZELr r!Z	_FILETIMEr#ZtagMSGr7r*r8ZPOINTERZLPBOOLZPBOOLZPBOOLEANZLPBYTEZPBYTEZPCHARZ
LPCOLORREFZLPDWORDZPDWORDZ
LPFILETIMEZ	PFILETIMEZPFLOATZLPHANDLEZPHANDLEZPHKEYZLPHKLZLPINTZPINTZPLARGE_INTEGERZPLCIDZLPLONGZPLONGZLPMSGZPMSGZLPPOINTZPPOINTZPPOINTLZLPRECTZPRECTZLPRECTLZPRECTLZLPSC_HANDLEZPSHORTZLPSIZEZPSIZEZLPSIZELZPSIZELZPSMALL_RECTZLPUINTZPUINTZPULARGE_INTEGERZPULONGZPUSHORTZPWCHARZLPWIN32_FIND_DATAAZPWIN32_FIND_DATAAZLPWIN32_FIND_DATAWZPWIN32_FIND_DATAWZLPWORDZPWORDrrrr	�<module>s�




















ctypes/__pycache__/__init__.cpython-38.opt-1.pyc000064400000037766151153537540015445 0ustar00U

e5d�E�@s dZddlZddlZdZddlmZmZm	Z	ddlm
Z
ddlmZddlmZ
ddlmZmZdd	lmZdd
lmZee
kr�edee
��ejdkr�dd
lmZeZejdkr�ejdkr�ee��j�d�d�dkr�eZddlmZmZ m!Z"m#Z$d}dd�Z%d~dd�Z&iZ'dd�Z(ejdk�r\ddlm)Z*ddlm+Z,iZ-dd�Z.e.j�rte(j�/dd�e._nejdk�rtddlm0Z*ddlm1Z1m2Z2m3Z3m4Z4m5Z5ddlm6Z6m7Z7dd lm8Z8dd!d"�Z9Gd#d$�d$e8�Z:e9e:d%�Gd&d'�d'e8�Z;e9e;�Gd(d)�d)e8�Z<e9e<�Gd*d+�d+e8�Z=e9e=�Gd,d-�d-e8�Z>e9e>�ed.�ed/�k�rLe=Z?e>Z@n0Gd0d1�d1e8�Z?e9e?�Gd2d3�d3e8�Z@e9e@�Gd4d5�d5e8�ZAe9eA�Gd6d7�d7e8�ZBe9eB�Gd8d9�d9e8�ZCe1eC�e1eB�k�r�eBZCed/�ed:�k�r�e=ZDe>ZEn0Gd;d<�d<e8�ZDe9eD�Gd=d>�d>e8�ZEe9eE�Gd?d@�d@e8�ZFeFeF_GeF_He9eF�GdAdB�dBe8�ZIeIeI_GeI_He9eI�GdCdD�dDe8�ZJeJeJ_GeJ_He9eJ�GdEdF�dFe8�ZKe9eKd%�GdGdH�dHe8�ZLeLZMe9eL�GdIdJ�dJe8�ZNddKlmOZOmPZPmQZQGdLdM�dMe8�ZRGdNdO�dOe8�ZSdPdQ�ZTd�dRdS�ZUdTdU�ZVdVdW�ZWGdXdY�dYeX�ZYGdZd[�d[eY�ZZejdk�r�Gd\d]�d]eY�Z[dd^lm\Z\m8Z8Gd_d`�d`e8�Z]Gdadb�dbeY�Z^Gdcdd�ddeX�Z_e_eY�Z`e_eZ�Zaejdk�r�eZdedejb�Zcn,ejdfk�r�eZdgejdddh��ZcneZd�Zcejdk�r8e_e[�Zee_e^�ZfeejgjhZhddilmiZimjZjd�djdk�Zke1e@�e1eL�k�rTe@Zle?Zmn6e1e>�e1eL�k�rpe>Zle=Zmne1eE�e1eL�k�r�eEZleDZmddllmnZnmoZompZpmqZqe(eLeLeLel�en�Zre(eLeLe?el�eo�Zsdmdn�Ztete:eLe:e:�eq�Zudodp�Zvete:eLe?�ep�Zwd�drds�ZxzddtlmyZyWnezk
�r(YnXete:eLe?�ey�Z{d�dudv�Z|ejdk�r`dwdx�Z}dydz�Z~dd{lm�Z�m�Z�eIZ�eFZ�e;e?e=eDfD]@Z�e1e��dhk�r�e�Z�n&e1e��d|k�r�e�Z�ne1e��dk�r�e�Z��q�e<e@e>eEfD]@Z�e1e��dhk�r�e�Z�n&e1e��d|k�r�e�Z�ne1e��dk�r�e�Z��q�[�eT�dS)�z,create and manipulate C data types in Python�Nz1.1.0)�Union�	Structure�Array)�_Pointer)�CFuncPtr)�__version__)�
RTLD_LOCAL�RTLD_GLOBAL)�
ArgumentError��calcsizezVersion number mismatch�nt)�FormatError�posix�darwin�.�)�FUNCFLAG_CDECL�FUNCFLAG_PYTHONAPI�FUNCFLAG_USE_ERRNO�FUNCFLAG_USE_LASTERRORcCszt|t�rD|dkrt|�d}t�d||�t|}|�}||_|St|t�rnt�dd|�t|}|�}|St|��dS)z�create_string_buffer(aBytes) -> character array
    create_string_buffer(anInteger) -> character array
    create_string_buffer(aBytes, anInteger) -> character array
    N�zctypes.create_string_buffer)	�
isinstance�bytes�len�_sys�audit�c_char�value�int�	TypeError��init�sizeZbuftypeZbuf�r$�'/usr/lib64/python3.8/ctypes/__init__.py�create_string_buffer/s

r&cCs
t||�S�N)r&)r"r#r$r$r%�c_bufferCsr(cs�t�|�dd�r�tO�|�dd�r,�tO�|r@td|����zt���fWStk
r�G���fdd�dt�}|t���f<|YSXdS)a�CFUNCTYPE(restype, *argtypes,
                 use_errno=False, use_last_error=False) -> function prototype.

    restype: the result type
    argtypes: a sequence specifying the argument types

    The function prototype can be called in different ways to create a
    callable object:

    prototype(integer address) -> foreign function
    prototype(callable) -> create and return a C callable function from callable
    prototype(integer index, method name[, paramflags]) -> foreign function calling a COM method
    prototype((ordinal number, dll object)[, paramflags]) -> foreign function exported by ordinal
    prototype((function name, dll object)[, paramflags]) -> foreign function exported by name
    �	use_errnoF�use_last_error�!unexpected keyword argument(s) %scseZdZ�Z�Z�ZdS)z CFUNCTYPE.<locals>.CFunctionTypeN��__name__�
__module__�__qualname__�
_argtypes_�	_restype_�_flags_r$��argtypes�flags�restyper$r%�
CFunctionTypeesr7N)	�_FUNCFLAG_CDECL�pop�_FUNCFLAG_USE_ERRNO�_FUNCFLAG_USE_LASTERROR�
ValueError�keys�_c_functype_cache�KeyError�	_CFuncPtr)r6r4�kwr7r$r3r%�	CFUNCTYPEKsrB)�LoadLibrary)�FUNCFLAG_STDCALLcs�t�|�dd�r�tO�|�dd�r,�tO�|r@td|����zt���fWStk
r�G���fdd�dt�}|t���f<|YSXdS)Nr)Fr*r+cseZdZ�Z�Z�ZdS)z$WINFUNCTYPE.<locals>.WinFunctionTypeNr,r$r3r$r%�WinFunctionType}srE)	�_FUNCFLAG_STDCALLr9r:r;r<r=�_win_functype_cacher?r@)r6r4rArEr$r3r%�WINFUNCTYPEqsrH)�dlopen)�sizeof�byref�	addressof�	alignment�resize)�	get_errno�	set_errno)�_SimpleCDatacCsJddlm}|dkr|j}t|�||�}}||krFtd|||f��dS)Nrrz"sizeof(%s) wrong: %d instead of %d)�structr�_type_rJ�SystemError)�typ�typecoderZactualZrequiredr$r$r%�_check_size�s�rWcs eZdZdZ�fdd�Z�ZS)�	py_object�Ocs4zt���WStk
r.dt|�jYSXdS)Nz
%s(<NULL>))�super�__repr__r<�typer-��self��	__class__r$r%r[�szpy_object.__repr__)r-r.r/rSr[�
__classcell__r$r$r_r%rX�srX�Pc@seZdZdZdS)�c_short�hN�r-r.r/rSr$r$r$r%rc�srcc@seZdZdZdS)�c_ushort�HNrer$r$r$r%rf�srfc@seZdZdZdS)�c_long�lNrer$r$r$r%rh�srhc@seZdZdZdS)�c_ulong�LNrer$r$r$r%rj�srj�iric@seZdZdZdS)�c_intrlNrer$r$r$r%rm�srmc@seZdZdZdS)�c_uint�INrer$r$r$r%rn�srnc@seZdZdZdS)�c_float�fNrer$r$r$r%rp�srpc@seZdZdZdS)�c_double�dNrer$r$r$r%rr�srrc@seZdZdZdS)�c_longdouble�gNrer$r$r$r%rt�srt�qc@seZdZdZdS)�
c_longlongrvNrer$r$r$r%rw�srwc@seZdZdZdS)�c_ulonglong�QNrer$r$r$r%rx�srxc@seZdZdZdS)�c_ubyte�BNrer$r$r$r%rz�srzc@seZdZdZdS)�c_byte�bNrer$r$r$r%r|�sr|c@seZdZdZdS)r�cNrer$r$r$r%r�src@seZdZdZdd�ZdS)�c_char_p�zcCsd|jjt�|�jfS�Nz%s(%s)�r`r-�c_void_pZfrom_bufferrr]r$r$r%r[�szc_char_p.__repr__N�r-r.r/rSr[r$r$r$r%r�src@seZdZdZdS)r�rbNrer$r$r$r%r��sr�c@seZdZdZdS)�c_bool�?Nrer$r$r$r%r��sr�)�POINTER�pointer�_pointer_type_cachec@seZdZdZdd�ZdS)�	c_wchar_p�ZcCsd|jjt�|�jfSr�r�r]r$r$r%r[�szc_wchar_p.__repr__Nr�r$r$r$r%r��sr�c@seZdZdZdS)�c_wchar�uNrer$r$r$r%r�sr�cCsFt��t��tjdkr"t��tjtt	�_t
jtt�_ttd<dS)Nr
)
r��clearr>�_os�namerGr�Z
from_paramr�r�rrr�r$r$r$r%�_reset_caches
r�cCs�t|t�rh|dkrBtt�dkr6tdd�|D��d}nt|�d}t�d||�t|}|�}||_|St|t	�r�t�dd|�t|}|�}|St
|��dS)z�create_unicode_buffer(aString) -> character array
    create_unicode_buffer(anInteger) -> character array
    create_unicode_buffer(aString, anInteger) -> character array
    N�css"|]}t|�dkrdndVqdS)i��r�rN)�ord)�.0r~r$r$r%�	<genexpr>sz(create_unicode_buffer.<locals>.<genexpr>rzctypes.create_unicode_buffer)r�strrJr��sumrrrrrr r!r$r$r%�create_unicode_buffers 

r�cCsLt�|d�dk	rtd��t|�tkr,td��|�|�|t|<tt|�=dS)Nz%This type already exists in the cachezWhat's this???)r��get�RuntimeError�idZset_type)r��clsr$r$r%�SetPointerType.s
r�cCs||Sr'r$)rUrr$r$r%�ARRAY8sr�c@sPeZdZdZeZeZdZdZ	dZ
eddddfdd�Zdd	�Z
d
d�Zdd
�ZdS)�CDLLa�An instance of this class represents a loaded dll/shared
    library, exporting functions using the standard C calling
    convention (named 'cdecl' on Windows).

    The exported functions can be accessed as attributes, or by
    indexing with the function name.  Examples:

    <obj>.qsort -> callable object
    <obj>['qsort'] -> callable object

    Calling the functions releases the Python GIL during the call and
    reacquires it afterwards.
    z<uninitialized>rNFc	s�|�_�j�|r�tO�|r$�tO�tj�d�rV|rV|�d�rVd|krV|tj	tj
BO}tjdkr�|dk	rn|}n6ddl}|j
}d|ks�d|kr�|��j��_||jO}G��fdd	�d	t�}|�_|dkr�t�j|��_n|�_dS)
NZaix�)z.a(r
r�/�\cseZdZ�Z�jZdS)zCDLL.__init__.<locals>._FuncPtrN)r-r.r/r2�_func_restype_r1r$�r5r^r$r%�_FuncPtrosr�)�_name�_func_flags_r:r;r�platform�
startswith�endswithr�ZRTLD_MEMBER�RTLD_NOWr�r
Z!_LOAD_LIBRARY_SEARCH_DEFAULT_DIRSZ_getfullpathnameZ!_LOAD_LIBRARY_SEARCH_DLL_LOAD_DIRr@r��_dlopen�_handle)	r^r��modeZhandler)r*Zwinmoder
r�r$r�r%�__init__Ss,

z
CDLL.__init__cCs8d|jj|j|jtjdd@t|�tjdd@fS)Nz<%s '%s', handle %x at %#x>r�r)r`r-r�r�r�maxsizer�r]r$r$r%r[ys
��z
CDLL.__repr__cCs6|�d�r|�d�rt|��|�|�}t|||�|S)N�__)r�r��AttributeError�__getitem__�setattr)r^r��funcr$r$r%�__getattr__s

zCDLL.__getattr__cCs"|�||f�}t|t�s||_|Sr')r�rrr-)r^Zname_or_ordinalr�r$r$r%r��s
zCDLL.__getitem__)r-r.r/�__doc__r8r�rmr�r�r�r��DEFAULT_MODEr�r[r�r�r$r$r$r%r�>s
�
&r�c@seZdZdZeeBZdS)�PyDLLz�This class represents the Python library itself.  It allows
    accessing Python API functions.  The GIL is not released, and
    Python exceptions are handled correctly.
    N)r-r.r/r�r8�_FUNCFLAG_PYTHONAPIr�r$r$r$r%r��sr�c@seZdZdZeZdS)�WinDLLznThis class represents a dll exporting functions using the
        Windows stdcall calling convention.
        N)r-r.r/r�rFr�r$r$r$r%r��sr�)�_check_HRESULTrQc@seZdZdZeZdS)�HRESULTriN)r-r.r/rSr�Z_check_retval_r$r$r$r%r��s
r�c@seZdZdZeZeZdS)�OleDLLz�This class represents a dll exporting functions using the
        Windows stdcall calling convention, and returning HRESULT.
        HRESULT error values are automatically raised as OSError
        exceptions.
        N)r-r.r/r�rFr�r�r�r$r$r$r%r��sr�c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�
LibraryLoadercCs
||_dSr'��_dlltype)r^Zdlltyper$r$r%r��szLibraryLoader.__init__cCs.|ddkrt|��|�|�}t|||�|S)Nr�_)r�r�r�)r^r�Zdllr$r$r%r��s

zLibraryLoader.__getattr__cCs
t||�Sr')�getattr�r^r�r$r$r%r��szLibraryLoader.__getitem__cCs
|�|�Sr'r�r�r$r$r%rC�szLibraryLoader.LoadLibraryN)r-r.r/r�r�r�rCr$r$r$r%r��sr�z
python dll�cygwinzlibpython%d.%d.dllr�)�get_last_error�set_last_errorcCs0|dkrt�}|dkr"t|���}td|d|�Sr')�GetLastErrorr�strip�OSError)�codeZdescrr$r$r%�WinError�s
r�)�
_memmove_addr�_memset_addr�_string_at_addr�
_cast_addrcsG��fdd�dt�}|S)NcseZdZ�Z�ZeeBZdS)z!PYFUNCTYPE.<locals>.CFunctionTypeN)r-r.r/r0r1r8r�r2r$�r4r6r$r%r7�sr7)r@)r6r4r7r$r�r%�
PYFUNCTYPE�sr�cCst|||�Sr')�_cast)�objrUr$r$r%�cast�sr����cCs
t||�S)zAstring_at(addr[, size]) -> string

    Return the string at addr.)�
_string_at�Zptrr#r$r$r%�	string_at�sr�)�_wstring_at_addrcCs
t||�S)zFwstring_at(addr[, size]) -> string

        Return the string at addr.)�_wstring_atr�r$r$r%�
wstring_at
sr�cCsBztdt�t�dg�}Wntk
r.YdSX|�|||�SdS)N�comtypes.server.inprocserver�*i�)�
__import__�globals�locals�ImportError�DllGetClassObject)ZrclsidZriidZppv�ccomr$r$r%r�s
r�cCs8ztdt�t�dg�}Wntk
r.YdSX|��S)Nr�r�r)r�r�r�r��DllCanUnloadNow)r�r$r$r%r�s
r�)�BigEndianStructure�LittleEndianStructure�)N)N)N)N)NN)r�)r�)�r��osr��sysrrZ_ctypesrrrrrr@Z_ctypes_versionrr	r
rRrZ	_calcsize�	Exceptionr�rr�r�r�uname�release�splitrr8rr�rr:rr;r&r(r>rBrCr�rDrFrGrH�replacerIrJrKrLrMrNrOrPrQrWrXrcrfrhrjrmrnrprrrtrwrxrzZ__ctype_le__Z__ctype_be__r|rrr�Zc_voidpr�r�r�r�r�r�r�r�r�r��objectr�r�r�r�r�r�r�ZcdllZpydllZ	dllhandleZ	pythonapi�version_infoZwindllZoledllZkernel32r�r�r�r�Zc_size_tZ	c_ssize_tr�r�r�r�ZmemmoveZmemsetr�r�r�r�r�r�r�r�r�r�r�Zctypes._endianr�r�Zc_int8Zc_uint8ZkindZc_int16Zc_int32Zc_int64Zc_uint16Zc_uint32Zc_uint64r$r$r$r%�<module>s4


!




N
	


ctypes/__pycache__/util.cpython-38.opt-2.pyc000064400000017131151153537540014644 0ustar00U

e5d76�@sBddlZddlZddlZddlZejdkrDdd�Zdd�Zdd�Zn�ejd	krnejd
krnddl	m
Zdd�Zn�ej�d
�r�ddl
mZn�ejd	k�r&ddlZddlZdd�Zdd�Zejdkr�dd�Zndd�Zej�d�r�dd�Zdd�Zn8ejdk�rdd�Zd'dd�Zndd �Zd!d"�Zd#d�Zd$d%�Zed&k�r>e�dS)(�N�ntcCs�d}tj�|�}|dkrdS|t|�}tj|d��dd�\}}t|dd��d}|dkrf|d7}t|dd	��d
}|dkr�d}|dkr�||SdS)NzMSC v.����� �����
��g$@r)�sys�version�find�len�split�int)�prefix�i�s�restZmajorVersionZminorVersion�r�#/usr/lib64/python3.8/ctypes/util.py�_get_build_version	srcCs^t�}|dkrdS|dkr d}n|dkr6d|d}ndSddl}d|jjkrV|d7}|d	S)
Nr�msvcrtrzmsvcr%d�
rz_d.pyd�d�.dll)r�importlib.machinery�	machinery�EXTENSION_SUFFIXES)rZclibname�	importlibrrr�find_msvcrt"sr cCsx|dkrt�Stjd�tj�D]R}tj�||�}tj�|�rF|S|���	d�rVq |d}tj�|�r |Sq dS)N)�c�m�PATHr)
r �os�environr�pathsep�path�join�isfile�lower�endswith)�nameZ	directoryZfnamerrr�find_library7s
r-�posix�darwin)�	dyld_findc	CsPd|d|d||fg}|D],}zt|�WStk
rHYqYqXqdS)Nzlib%s.dylibz%s.dylibz%s.framework/%s)�
_dyld_find�
ValueError)r,�possiblerrrr-Hs
��aix)r-c
Cs4d}t|d��}|�d�|kW5QR�SQRXdS)NsELF�br�)�open�read)�filenameZ
elf_headerZthefilerrr�_is_elf`sr:c
Cs t�dt�|��}t�d�}|s,t�d�}|s4dSt��}z�|dd|j
d|g}ttj�}d|d<d|d	<zt
j|t
jt
j|d
�}Wntk
r�YW�$dSX|�|j��}W5QRXW5z|��Wnt	k
r�YnXXt�||�}|s�dS|D]}	t|	��s�q�t�|	�SdS)N�[^\(\)\s]*lib%s\.[^\(\)\s]*ZgccZccz-Wl,-t�-oz-l�C�LC_ALL�LANG��stdout�stderr�env)r$�fsencode�re�escape�shutil�which�tempfileZNamedTemporaryFile�close�FileNotFoundErrorr,�dictr%�
subprocess�Popen�PIPEZSTDOUT�OSErrorrAr8�findallr:�fsdecode)
r,�exprZ
c_compilerZtemp�argsrC�procZtrace�res�filerrr�_findLib_gccfsB


�

rXZsunos5c	Cs||sdSztjdd|ftjtjd�}Wntk
r<YdSX|�|j��}W5QRXt�d|�}|sldSt	�
|�d��S)Nz/usr/ccs/bin/dumpz-Lpv�rArBs\[.*\]\sSONAME\s+([^\s]+)r)rMrNrO�DEVNULLrPrAr8rE�searchr$rR�group)�frU�datarVrrr�_get_soname�s�
r_c	Cs�|sdSt�d�}|sdSz"tj|ddd|ftjtjd�}Wntk
rRYdSX|�|j��}W5QRXt	�
d|�}|s�dSt�|�
d��S)N�objdump�-pz-jz.dynamicrYs\sSONAME\s+([^\s]+)r)rGrHrMrNrOrZrPrAr8rEr[r$rRr\)r]r`rU�dumprVrrrr_�s$
�
)ZfreebsdZopenbsdZ	dragonflycCsN|�d�}g}z|r*|�dt|����qWntk
r@YnX|pLtjgS)N�.r)r�insertr�popr2r�maxsize)Zlibname�partsZnumsrrr�_num_version�s
rhc	Cs�t�|�}d||f}t�|�}ztjdtjtjd�}Wntk
rPd}YnX|�|j	�
�}W5QRXt�||�}|s�tt
|��S|jtd�t�|d�S)Nz:-l%s\.\S+ => \S*/(lib%s\.\S+))�/sbin/ldconfigz-rrY�)�keyr)rErFr$rDrMrNrOrZrPrAr8rQr_rX�sortrhrR)r,ZenamerSrUr^rVrrrr-�s"

�

c		Cs�tj�d�sdSttj�}d|d<|r,d}nd}d}ztj|tjtj|d�}Wnt	k
rdYdSX|�6|j
D](}|��}|�d�rrt�
|���d}qrW5QRX|s�dS|�d	�D]*}tj�|d
|�}tj�|�r�|Sq�dS)N�
/usr/bin/crler=r>)rm�-64)rmr@sDefault Library Path (ELF):r6�:zlib%s.so)r$r'�existsrLr%rMrNrOrZrPrA�strip�
startswithrRrr()	r,�is64rCrT�pathsrU�line�dirZlibfilerrr�
_findLib_crle�s8
�



rwFcCstt||�pt|��S�N)r_rwrX)r,rsrrrr-	sc
Cs�ddl}|�d�dkr&t��jd}nt��jd}dddddd	�}|�|d
�}d}t�|t�|�|f�}zht	j
dd
gt	jt	jt	jddd�d��:}t�
||j���}|r�t�|�d��W5QR�WSW5QRXWntk
r�YnXdS)Nr�lr6z-32rnzlibc6,x86-64zlibc6,64bitzlibc6,IA-64)z	x86_64-64zppc64-64z
sparc64-64zs390x-64zia64-64Zlibc6z\s+(lib%s\.[^\s]+)\s+\(%srirar=)r>r?)�stdinrBrArCr)�structZcalcsizer$�uname�machine�getrDrErFrMrNrZrOr[rAr8rRr\rP)r,r{r}Zmach_mapZabi_typeZregex�prVrrr�_findSoname_ldconfigs4�
�,r�cCs�dt�|�}ddg}tj�d�}|rD|�d�D]}|�d|g�q0|�dtjd|g�d}zZtj	|tj
tj
d	d
�}|��\}}t�|t�
|��}	|	D]}
t|
�s�q�t�
|
�WSWntk
r�YnX|S)Nr;Zldz-tZLD_LIBRARY_PATHroz-Lr<z-l%sT)rArBZuniversal_newlines)rErFr$r%r~r�extend�devnullrMrNrOZcommunicaterQrRr:�	Exception)r,rS�cmdZlibpathr�resultr�out�_rVrWrrr�_findLib_ld,s,
�r�cCs t|�ptt|��ptt|��Srx)r�r_rXr�)r,rrrr-Gs

�
�cCs�ddlm}tjdkr:t|j�t|�d��ttd��tjdk�r�ttd��ttd��ttd��tj	d	kr�t|�
d
��t|�
d��t|�
d��t|�
d
���ntj	�d��r�ddlm}tj
dk�rtd|dtj����td|�
d����ttd��t|�
d��n*td|dtj����td|�
d����tdtd����td|�
td�����tdtd����td|�
td�����n(t|�
d��t|�
d��ttd��dS)Nr)�cdllrrr.r"r!�bz2r/z
libm.dylibzlibcrypto.dylibzlibSystem.dylibzSystem.framework/Systemr4)�CDLLlz"Using CDLL(name, os.RTLD_MEMBER): z
libc.a(shr.o)zUsing cdll.LoadLibrary(): Zrpmz	librpm.sozlibc.a(shr_64.o)z	crypt	:: Zcryptz
crypto	:: Zcryptozlibm.sozlibcrypt.so)Zctypesr�r$r,�printr�loadr-r�platformZLoadLibraryrrr�rfZRTLD_MEMBER)r�r�rrr�testOs<


r��__main__)F)r$rGrMrr,rr r-r�Zctypes.macholib.dyldr0r1rrZctypes._aixrErIr:rXr_rhrwr�r�r��__name__rrrr�<module>s>


2


$(
ctypes/__pycache__/_aix.cpython-38.opt-1.pyc000064400000023166151153537540014613 0ustar00U

e5d1�@s�dZdZddlZddlmZmZddlmZddlm	Z	m
Z
ddlmZm
Z
mZe
e	�dZdd	lmZd
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�ZdS)"a�
Lib/ctypes.util.find_library() support for AIX
Similar approach as done for Darwin support by using separate files
but unlike Darwin - no extension such as ctypes.macholib.*

dlopen() is an interface to AIX initAndLoad() - primary documentation at:
https://www.ibm.com/support/knowledgecenter/en/ssw_aix_61/com.ibm.aix.basetrf1/dlopen.htm
https://www.ibm.com/support/knowledgecenter/en/ssw_aix_61/com.ibm.aix.basetrf1/load.htm

AIX supports two styles for dlopen(): svr4 (System V Release 4) which is common on posix
platforms, but also a BSD style - aka SVR3.

From AIX 5.3 Difference Addendum (December 2004)
2.9 SVR4 linking affinity
Nowadays, there are two major object file formats used by the operating systems:
XCOFF: The COFF enhanced by IBM and others. The original COFF (Common
Object File Format) was the base of SVR3 and BSD 4.2 systems.
ELF:   Executable and Linking Format that was developed by AT&T and is a
base for SVR4 UNIX.

While the shared library content is identical on AIX - one is located as a filepath name
(svr4 style) and the other is located as a member of an archive (and the archive
is located as a filepath name).

The key difference arises when supporting multiple abi formats (i.e., 32 and 64 bit).
For svr4 either only one ABI is supported, or there are two directories, or there
are different file names. The most common solution for multiple ABI is multiple
directories.

For the XCOFF (aka AIX) style - one directory (one archive file) is sufficient
as multiple shared libraries can be in the archive - even sharing the same name.
In documentation the archive is also referred to as the "base" and the shared
library object is referred to as the "member".

For dlopen() on AIX (read initAndLoad()) the calls are similar.
Default activity occurs when no path information is provided. When path
information is provided dlopen() does not search any other directories.

For SVR4 - the shared library name is the name of the file expected: libFOO.so
For AIX - the shared library is expressed as base(member). The search is for the
base (e.g., libFOO.a) and once the base is found the shared library - identified by
member (e.g., libFOO.so, or shr.o) is located and loaded.

The mode bit RTLD_MEMBER tells initAndLoad() that it needs to use the AIX (SVR3)
naming style.
z%Michael Felt <aixtools@felt.demon.nl>�N)�environ�path)�
executable)�c_void_p�sizeof)�Popen�PIPE�DEVNULL�)�maxsizecs�fdd�}tt|�|d�S)NcsL|���}g}z|r*|�dt|����qWntk
r@YnX|pJtgS)Nr)�split�insert�int�pop�
ValueErrorr)Zlibname�partsZnums��sep��#/usr/lib64/python3.8/ctypes/_aix.py�_num_version>s
z#_last_version.<locals>._num_version)�key)�max�reversed)Zlibnamesrrrrr�
_last_version=s
rcCs:d}|jD]*}|�d�r|}q
d|kr
|�d�Sq
dS)N)�/z./z../ZINDEX�
)�stdout�
startswith�rstrip)�p�	ld_header�linerrr�
get_ld_headerJs

r#cCs0g}|jD] }t�d|�r&|�|�q
q,q
|S)Nz[0-9])r�re�match�append)r �infor"rrr�get_ld_header_infoTs
r(cCs\g}tddt��d|gdttd�}t|�}|rF|�|t|�f�q"qFq"|j��|�	�|S)z�
    Parse the header of the loader section of executable and archives
    This function calls /usr/bin/dump -H as a subprocess
    and returns a list of (ld_header, ld_header_info) tuples.
    z
/usr/bin/dumpz-Xz-HT)Zuniversal_newlinesr�stderr)
r�AIX_ABIrr	r#r&r(r�close�wait)�fileZldr_headersr r!rrr�get_ld_headersas
�
r.cCs6g}|D](\}}d|kr|�||�d�d��q|S)z�
    extract the shareable objects from ld_headers
    character "[" is used to strip off the path information.
    Note: the "[" and "]" characters that are part of dump -H output
    are not removed here.
    �[���)r&�index)Z
ld_headersZsharedr"�_rrr�
get_sharedys
r3csJd��d��ttd�fdd�|D���}t|�dkrB|d�d�SdSdS)zy
    Must be only one match, otherwise result is None.
    When there is a match, strip leading "[" and trailing "]"
    z\[(z)\]Nc3s|]}t��|�VqdS)N)r$�search)�.0r"��exprrr�	<genexpr>�sz get_one_match.<locals>.<genexpr>�r)�list�filter�len�group)r7�linesZmatchesrr6r�
get_one_match�s
r?cCsJtdkr d}t||�}|rF|Sn&dD] }tt�|�|�}|r$|Sq$dS)z�
    This routine provides historical aka legacy naming schemes started
    in AIX4 shared library support for library members names.
    e.g., in /usr/lib/libc.a the member name shr.o for 32-bit binary and
    shr_64.o for 64-bit binary.
    �@zshr4?_?64\.o)zshr.ozshr4.oN)r*r?r$�escape)�membersr7�member�namerrr�
get_legacy�s

rEcCsfd|�d�d|�d�g}|D]D}g}|D]$}t�||�}|r(|�|�d��q(|rt|d�SqdS)a�
    Sort list of members and return highest numbered version - if it exists.
    This function is called when an unversioned libFOO.a(libFOO.so) has
    not been found.

    Versioning for the member name is expected to follow
    GNU LIBTOOL conventions: the highest version (x, then X.y, then X.Y.z)
     * find [libFoo.so.X]
     * find [libFoo.so.X.Y]
     * find [libFoo.so.X.Y.Z]

    Before the GNU convention became the standard scheme regardless of
    binary size AIX packagers used GNU convention "as-is" for 32-bit
    archive members but used an "distinguishing" name for 64-bit members.
    This scheme inserted either 64 or _64 between libFOO and .so
    - generally libFOO_64.so, but occasionally libFOO64.so
    �libz\.so\.[0-9]+[0-9.]*z_?64\.so\.[0-9]+[0-9.]*r�.N)r$r4r&r=r)rDrBZexprsr7Zversionsr"�mrrr�get_version�s

�rIcCsbd|�d�}t||�}|r|Stdkr<d|�d�}t||�}|rD|St||�}|rV|St|�SdS)ab
    Return an archive member matching the request in name.
    Name is the library name without any prefix like lib, suffix like .so,
    or version number.
    Given a list of members find and return the most appropriate result
    Priority is given to generic libXXX.so, then a versioned libXXX.so.a.b.c
    and finally, legacy AIX naming scheme.
    rFz\.sor@z64\.soN)r?r*rIrE)rDrBr7rCrrr�
get_member�s



rJcCs|t�d�}|dkrt�d�}|dkr*g}n
|�d�}tt�}|D]6\}}|D](}|��d}d|krL|�|�d��qLq@|S)a
    On AIX, the buildtime searchpath is stored in the executable.
    as "loader header information".
    The command /usr/bin/dump -H extracts this info.
    Prefix searched libraries with LD_LIBRARY_PATH (preferred),
    or LIBPATH if defined. These paths are appended to the paths
    to libraries the python executable is linked with.
    This mimics AIX dlopen() behavior.
    ZLD_LIBRARY_PATHNZLIBPATH�:r9r)r�getrr.r�extend)�libpathsZobjectsr2r>r"rrrr�get_libpaths�s



rOcCsp|D]f}|dkrqd|�d�}t�||�}t�|�rtt|��}tt�|�|�}|dkrd||fSdSqdS)a
    paths is a list of directories to search for an archive.
    name is the abbreviated name given to find_library().
    Process: search "paths" for archive, and if an archive is found
    return the result of get_member().
    If an archive is not found then return None
    �/librFz.aN)NN)r�join�existsr3r.rJr$rA)�pathsrD�dir�base�archiverBrCrrr�find_shared
s
rWcCsnt�}t||�\}}|dkr,|�d|�d�Sd|�d�}|D],}|dkrJq<t�||�}t�|�r<|Sq<dS)a�AIX implementation of ctypes.util.find_library()
    Find an archive member that will dlopen(). If not available,
    also search for a file (or link) with a .so suffix.

    AIX supports two types of schemes that can be used with dlopen().
    The so-called SystemV Release4 (svr4) format is commonly suffixed
    with .so while the (default) AIX scheme has the library (archive)
    ending with the suffix .a
    As an archive has multiple members (e.g., 32-bit and 64-bit) in one file
    the argument passed to dlopen must include both the library and
    the member names in a single string.

    find_library() looks first for an archive (.a) with a suitable member.
    If no archive+member pair is found, look for a .so file.
    N�(�)rFz.sorP)rOrWrrQrR)rDrNrUrCZsonamerTZshlibrrr�find_library#s

rZ)�__doc__�
__author__r$�osrr�sysrZctypesrr�
subprocessrrr	r*rrr#r(r.r3r?rErIrJrOrWrZrrrr�<module>s(.


&ctypes/__pycache__/_aix.cpython-38.opt-2.pyc000064400000010217151153537540014605 0ustar00U

e5d1�@s�dZddlZddlmZmZddlmZddlmZm	Z	ddl
mZmZm
Z
e	e�dZddlmZd	d
�Zdd�Zd
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �ZdS)!z%Michael Felt <aixtools@felt.demon.nl>�N)�environ�path)�
executable)�c_void_p�sizeof)�Popen�PIPE�DEVNULL�)�maxsizecs�fdd�}tt|�|d�S)NcsL|���}g}z|r*|�dt|����qWntk
r@YnX|pJtgS)Nr)�split�insert�int�pop�
ValueErrorr)Zlibname�partsZnums��sep��#/usr/lib64/python3.8/ctypes/_aix.py�_num_version>s
z#_last_version.<locals>._num_version)�key)�max�reversed)Zlibnamesrrrrr�
_last_version=s
rcCs:d}|jD]*}|�d�r|}q
d|kr
|�d�Sq
dS)N)�/z./z../ZINDEX�
)�stdout�
startswith�rstrip)�p�	ld_header�linerrr�
get_ld_headerJs

r#cCs0g}|jD] }t�d|�r&|�|�q
q,q
|S)Nz[0-9])r�re�match�append)r �infor"rrr�get_ld_header_infoTs
r(cCs\g}tddt��d|gdttd�}t|�}|rF|�|t|�f�q"qFq"|j��|�	�|S)Nz
/usr/bin/dumpz-Xz-HT)Zuniversal_newlinesr�stderr)
r�AIX_ABIrr	r#r&r(r�close�wait)�fileZldr_headersr r!rrr�get_ld_headersas
�
r.cCs6g}|D](\}}d|kr|�||�d�d��q|S)N�[���)r&�index)Z
ld_headersZsharedr"�_rrr�
get_sharedys
r3csJd��d��ttd�fdd�|D���}t|�dkrB|d�d�SdSdS)Nz\[(z)\]c3s|]}t��|�VqdS)N)r$�search)�.0r"��exprrr�	<genexpr>�sz get_one_match.<locals>.<genexpr>�r)�list�filter�len�group)r7�linesZmatchesrr6r�
get_one_match�s
r?cCsJtdkr d}t||�}|rF|Sn&dD] }tt�|�|�}|r$|Sq$dS)N�@zshr4?_?64\.o)zshr.ozshr4.o)r*r?r$�escape)�membersr7�member�namerrr�
get_legacy�s

rEcCsfd|�d�d|�d�g}|D]D}g}|D]$}t�||�}|r(|�|�d��q(|rt|d�SqdS)N�libz\.so\.[0-9]+[0-9.]*z_?64\.so\.[0-9]+[0-9.]*r�.)r$r4r&r=r)rDrBZexprsr7Zversionsr"�mrrr�get_version�s

�rIcCsbd|�d�}t||�}|r|Stdkr<d|�d�}t||�}|rD|St||�}|rV|St|�SdS)NrFz\.sor@z64\.so)r?r*rIrE)rDrBr7rCrrr�
get_member�s



rJcCs|t�d�}|dkrt�d�}|dkr*g}n
|�d�}tt�}|D]6\}}|D](}|��d}d|krL|�|�d��qLq@|S)NZLD_LIBRARY_PATHZLIBPATH�:r9r)r�getrr.r�extend)�libpathsZobjectsr2r>r"rrrr�get_libpaths�s



rOcCsp|D]f}|dkrqd|�d�}t�||�}t�|�rtt|��}tt�|�|�}|dkrd||fSdSqdS)N�/librFz.a)NN)r�join�existsr3r.rJr$rA)�pathsrD�dir�base�archiverBrCrrr�find_shared
s
rWcCsnt�}t||�\}}|dkr,|�d|�d�Sd|�d�}|D],}|dkrJq<t�||�}t�|�r<|Sq<dS)N�(�)rFz.sorP)rOrWrrQrR)rDrNrUrCZsonamerTZshlibrrr�find_library#s

rZ)�
__author__r$�osrr�sysrZctypesrr�
subprocessrrr	r*rrr#r(r.r3r?rErIrJrOrWrZrrrr�<module>/s&


&ctypes/__pycache__/_endian.cpython-38.opt-2.pyc000064400000003066151153537540015266 0ustar00U

e5d��@s�ddlZddlTee�Zdd�ZGdd�dee��Zejdkr\dZ	eZ
Gd	d
�d
eed�Zn0ejdkr�d
Z	eZGdd�deed�Z
ned��dS)�N)�*cCsLt|t�rt|t�St|t�r.t|j�|jSt|t	�r<|St
d|��dS)Nz+This type does not support other endian: %s)�hasattr�
_OTHER_ENDIAN�getattr�
isinstance�_array_type�
_other_endianZ_type_Z_length_�
issubclass�	Structure�	TypeError)�typ�r
�&/usr/lib64/python3.8/ctypes/_endian.pyrs



rcseZdZ�fdd�Z�ZS)�
_swapped_metacs^|dkrLg}|D]6}|d}|d}|dd�}|�|t|�f|�q|}t��||�dS)NZ_fields_r��)�appendr�super�__setattr__)�self�attrname�valueZfieldsZdesc�namer�rest��	__class__r
rrsz_swapped_meta.__setattr__)�__name__�
__module__�__qualname__r�
__classcell__r
r
rrrsr�littleZ__ctype_be__c@seZdZdZdZdS)�BigEndianStructurer
N�rrr�	__slots__Z_swappedbytes_r
r
r
rr!.sr!)�	metaclassZbigZ__ctype_le__c@seZdZdZdZdS)�LittleEndianStructurer
Nr"r
r
r
rr%7sr%zInvalid byteorder)
�sysZctypes�typeZArrayrrr
r�	byteorderrr%r!�RuntimeErrorr
r
r
r�<module>s

ctypes/__pycache__/_endian.cpython-38.opt-1.pyc000064400000003613151153537540015263 0ustar00U

e5d��@s�ddlZddlTee�Zdd�ZGdd�dee��Zejdkr\dZ	eZ
Gd	d
�d
eed�Zn0ejdkr�d
Z	eZGdd�deed�Z
ned��dS)�N)�*cCsLt|t�rt|t�St|t�r.t|j�|jSt|t	�r<|St
d|��dS)z�Return the type with the 'other' byte order.  Simple types like
    c_int and so on already have __ctype_be__ and __ctype_le__
    attributes which contain the types, for more complicated types
    arrays and structures are supported.
    z+This type does not support other endian: %sN)�hasattr�
_OTHER_ENDIAN�getattr�
isinstance�_array_type�
_other_endianZ_type_Z_length_�
issubclass�	Structure�	TypeError)�typ�r
�&/usr/lib64/python3.8/ctypes/_endian.pyrs



rcseZdZ�fdd�Z�ZS)�
_swapped_metacs^|dkrLg}|D]6}|d}|d}|dd�}|�|t|�f|�q|}t��||�dS)NZ_fields_r��)�appendr�super�__setattr__)�self�attrname�valueZfieldsZdesc�namer�rest��	__class__r
rrsz_swapped_meta.__setattr__)�__name__�
__module__�__qualname__r�
__classcell__r
r
rrrsr�littleZ__ctype_be__c@seZdZdZdZdZdS)�BigEndianStructurez$Structure with big endian byte orderr
N�rrr�__doc__�	__slots__Z_swappedbytes_r
r
r
rr!.sr!)�	metaclassZbigZ__ctype_le__c@seZdZdZdZdZdS)�LittleEndianStructurez'Structure with little endian byte orderr
Nr"r
r
r
rr&7sr&zInvalid byteorder)
�sysZctypes�typeZArrayrrr
r�	byteorderrr&r!�RuntimeErrorr
r
r
r�<module>s

ctypes/__pycache__/util.cpython-38.opt-1.pyc000064400000017577151153537540014661 0ustar00U

e5d76�@sBddlZddlZddlZddlZejdkrDdd�Zdd�Zdd�Zn�ejd	krnejd
krnddl	m
Zdd�Zn�ej�d
�r�ddl
mZn�ejd	k�r&ddlZddlZdd�Zdd�Zejdkr�dd�Zndd�Zej�d�r�dd�Zdd�Zn8ejdk�rdd�Zd'dd�Zndd �Zd!d"�Zd#d�Zd$d%�Zed&k�r>e�dS)(�N�ntcCs�d}tj�|�}|dkrdS|t|�}tj|d��dd�\}}t|dd��d}|dkrf|d7}t|d	d
��d}|dkr�d}|dkr�||SdS)
z�Return the version of MSVC that was used to build Python.

        For Python 2.3 and up, the version number is included in
        sys.version.  For earlier versions, assume the compiler is MSVC 6.
        zMSC v.����N� �����
��g$@r)�sys�version�find�len�split�int)�prefix�i�s�restZmajorVersionZminorVersion�r�#/usr/lib64/python3.8/ctypes/util.py�_get_build_version	srcCs^t�}|dkrdS|dkr d}n|dkr6d|d}ndSddl}d|jjkrV|d	7}|d
S)z%Return the name of the VC runtime dllNr�msvcrtrzmsvcr%d�
rz_d.pyd�d�.dll)r�importlib.machinery�	machinery�EXTENSION_SUFFIXES)rZclibname�	importlibrrr�find_msvcrt"sr cCsx|dkrt�Stjd�tj�D]R}tj�||�}tj�|�rF|S|���	d�rVq |d}tj�|�r |Sq dS)N)�c�m�PATHr)
r �os�environr�pathsep�path�join�isfile�lower�endswith)�nameZ	directoryZfnamerrr�find_library7s
r-�posix�darwin)�	dyld_findc	CsPd|d|d||fg}|D],}zt|�WStk
rHYqYqXqdS)Nzlib%s.dylibz%s.dylibz%s.framework/%s)�
_dyld_find�
ValueError)r,�possiblerrrr-Hs
��aix)r-c
Cs4d}t|d��}|�d�|kW5QR�SQRXdS)z,Return True if the given file is an ELF filesELF�br�N)�open�read)�filenameZ
elf_headerZthefilerrr�_is_elf`sr:c
Cs t�dt�|��}t�d�}|s,t�d�}|s4dSt��}z�|dd|j
d|g}ttj�}d|d<d|d	<zt
j|t
jt
j|d
�}Wntk
r�YW�$dSX|�|j��}W5QRXW5z|��Wnt	k
r�YnXXt�||�}|s�dS|D]}	t|	��s�q�t�|	�SdS)N�[^\(\)\s]*lib%s\.[^\(\)\s]*ZgccZccz-Wl,-t�-oz-l�C�LC_ALL�LANG��stdout�stderr�env)r$�fsencode�re�escape�shutil�which�tempfileZNamedTemporaryFile�close�FileNotFoundErrorr,�dictr%�
subprocess�Popen�PIPEZSTDOUT�OSErrorrAr8�findallr:�fsdecode)
r,�exprZ
c_compilerZtemp�argsrC�procZtrace�res�filerrr�_findLib_gccfsB


�

rXZsunos5c	Cs||sdSztjdd|ftjtjd�}Wntk
r<YdSX|�|j��}W5QRXt�d|�}|sldSt	�
|�d��S)Nz/usr/ccs/bin/dumpz-Lpv�rArBs\[.*\]\sSONAME\s+([^\s]+)r)rMrNrO�DEVNULLrPrAr8rE�searchr$rR�group)�frU�datarVrrr�_get_soname�s�
r_c	Cs�|sdSt�d�}|sdSz"tj|ddd|ftjtjd�}Wntk
rRYdSX|�|j��}W5QRXt	�
d|�}|s�dSt�|�
d��S)N�objdump�-pz-jz.dynamicrYs\sSONAME\s+([^\s]+)r)rGrHrMrNrOrZrPrAr8rEr[r$rRr\)r]r`rU�dumprVrrrr_�s$
�
)ZfreebsdZopenbsdZ	dragonflycCsN|�d�}g}z|r*|�dt|����qWntk
r@YnX|pLtjgS)N�.r)r�insertr�popr2r�maxsize)Zlibname�partsZnumsrrr�_num_version�s
rhc	Cs�t�|�}d||f}t�|�}ztjdtjtjd�}Wntk
rPd}YnX|�|j	�
�}W5QRXt�||�}|s�tt
|��S|jtd�t�|d�S)Nz:-l%s\.\S+ => \S*/(lib%s\.\S+))�/sbin/ldconfigz-rrY�)�keyr)rErFr$rDrMrNrOrZrPrAr8rQr_rX�sortrhrR)r,ZenamerSrUr^rVrrrr-�s"

�

c		Cs�tj�d�sdSttj�}d|d<|r,d}nd}d}ztj|tjtj|d�}Wnt	k
rdYdSX|�6|j
D](}|��}|�d�rrt�
|���d}qrW5QRX|s�dS|�d	�D]*}tj�|d
|�}tj�|�r�|Sq�dS)N�
/usr/bin/crler=r>)rm�-64)rmr@sDefault Library Path (ELF):r6�:zlib%s.so)r$r'�existsrLr%rMrNrOrZrPrA�strip�
startswithrRrr()	r,�is64rCrT�pathsrU�line�dirZlibfilerrr�
_findLib_crle�s8
�



rwFcCstt||�pt|��S�N)r_rwrX)r,rsrrrr-	sc
Cs�ddl}|�d�dkr&t��jd}nt��jd}dddddd	�}|�|d
�}d}t�|t�|�|f�}zht	j
dd
gt	jt	jt	jddd�d��:}t�
||j���}|r�t�|�d��W5QR�WSW5QRXWntk
r�YnXdS)Nr�lr6z-32rnzlibc6,x86-64zlibc6,64bitzlibc6,IA-64)z	x86_64-64zppc64-64z
sparc64-64zs390x-64zia64-64Zlibc6z\s+(lib%s\.[^\s]+)\s+\(%srirar=)r>r?)�stdinrBrArCr)�structZcalcsizer$�uname�machine�getrDrErFrMrNrZrOr[rAr8rRr\rP)r,r{r}Zmach_mapZabi_typeZregex�prVrrr�_findSoname_ldconfigs4�
�,r�cCs�dt�|�}ddg}tj�d�}|rD|�d�D]}|�d|g�q0|�dtjd|g�d}zZtj	|tj
tj
d	d
�}|��\}}t�|t�
|��}	|	D]}
t|
�s�q�t�
|
�WSWntk
r�YnX|S)Nr;Zldz-tZLD_LIBRARY_PATHroz-Lr<z-l%sT)rArBZuniversal_newlines)rErFr$r%r~r�extend�devnullrMrNrOZcommunicaterQrRr:�	Exception)r,rS�cmdZlibpathr�resultr�out�_rVrWrrr�_findLib_ld,s,
�r�cCs t|�ptt|��ptt|��Srx)r�r_rXr�)r,rrrr-Gs

�
�cCs�ddlm}tjdkr:t|j�t|�d��ttd��tjdk�r�ttd��ttd��ttd��tj	d	kr�t|�
d
��t|�
d��t|�
d��t|�
d
���ntj	�d��r�ddlm}tj
dk�rtd|dtj����td|�
d����ttd��t|�
d��n*td|dtj����td|�
d����tdtd����td|�
td�����tdtd����td|�
td�����n(t|�
d��t|�
d��ttd��dS)Nr)�cdllrrr.r"r!�bz2r/z
libm.dylibzlibcrypto.dylibzlibSystem.dylibzSystem.framework/Systemr4)�CDLLlz"Using CDLL(name, os.RTLD_MEMBER): z
libc.a(shr.o)zUsing cdll.LoadLibrary(): Zrpmz	librpm.sozlibc.a(shr_64.o)z	crypt	:: Zcryptz
crypto	:: Zcryptozlibm.sozlibcrypt.so)Zctypesr�r$r,�printr�loadr-r�platformZLoadLibraryrrr�rfZRTLD_MEMBER)r�r�rrr�testOs<


r��__main__)F)r$rGrMrr,rr r-r�Zctypes.macholib.dyldr0r1rrZctypes._aixrErIr:rXr_rhrwr�r�r��__name__rrrr�<module>s>


2


$(
ctypes/__pycache__/_endian.cpython-38.pyc000064400000003613151153537540014324 0ustar00U

e5d��@s�ddlZddlTee�Zdd�ZGdd�dee��Zejdkr\dZ	eZ
Gd	d
�d
eed�Zn0ejdkr�d
Z	eZGdd�deed�Z
ned��dS)�N)�*cCsLt|t�rt|t�St|t�r.t|j�|jSt|t	�r<|St
d|��dS)z�Return the type with the 'other' byte order.  Simple types like
    c_int and so on already have __ctype_be__ and __ctype_le__
    attributes which contain the types, for more complicated types
    arrays and structures are supported.
    z+This type does not support other endian: %sN)�hasattr�
_OTHER_ENDIAN�getattr�
isinstance�_array_type�
_other_endianZ_type_Z_length_�
issubclass�	Structure�	TypeError)�typ�r
�&/usr/lib64/python3.8/ctypes/_endian.pyrs



rcseZdZ�fdd�Z�ZS)�
_swapped_metacs^|dkrLg}|D]6}|d}|d}|dd�}|�|t|�f|�q|}t��||�dS)NZ_fields_r��)�appendr�super�__setattr__)�self�attrname�valueZfieldsZdesc�namer�rest��	__class__r
rrsz_swapped_meta.__setattr__)�__name__�
__module__�__qualname__r�
__classcell__r
r
rrrsr�littleZ__ctype_be__c@seZdZdZdZdZdS)�BigEndianStructurez$Structure with big endian byte orderr
N�rrr�__doc__�	__slots__Z_swappedbytes_r
r
r
rr!.sr!)�	metaclassZbigZ__ctype_le__c@seZdZdZdZdZdS)�LittleEndianStructurez'Structure with little endian byte orderr
Nr"r
r
r
rr&7sr&zInvalid byteorder)
�sysZctypes�typeZArrayrrr
r�	byteorderrr&r!�RuntimeErrorr
r
r
r�<module>s

ctypes/__pycache__/__init__.cpython-38.opt-2.pyc000064400000033436151153537540015434 0ustar00U

e5d�E�@sddlZddlZdZddlmZmZmZddlm	Z	ddlm
ZddlmZddlm
Z
mZddlmZdd	lmZeekr�ed
ee��ejdkr�ddlmZe
Zejd
kr�ejdkr�ee��j�d�d�dkr�eZddlmZmZm Z!m"Z#d|dd�Z$d}dd�Z%iZ&dd�Z'ejdk�rXddlm(Z)ddlm*Z+iZ,dd�Z-e-j.�rpe'j.�/dd�e-_.nejd
k�rpddlm0Z)ddlm1Z1m2Z2m3Z3m4Z4m5Z5ddlm6Z6m7Z7ddlm8Z8d~d d!�Z9Gd"d#�d#e8�Z:e9e:d$�Gd%d&�d&e8�Z;e9e;�Gd'd(�d(e8�Z<e9e<�Gd)d*�d*e8�Z=e9e=�Gd+d,�d,e8�Z>e9e>�ed-�ed.�k�rHe=Z?e>Z@n0Gd/d0�d0e8�Z?e9e?�Gd1d2�d2e8�Z@e9e@�Gd3d4�d4e8�ZAe9eA�Gd5d6�d6e8�ZBe9eB�Gd7d8�d8e8�ZCe1eC�e1eB�k�r�eBZCed.�ed9�k�r�e=ZDe>ZEn0Gd:d;�d;e8�ZDe9eD�Gd<d=�d=e8�ZEe9eE�Gd>d?�d?e8�ZFeFeF_GeF_He9eF�Gd@dA�dAe8�ZIeIeI_GeI_He9eI�GdBdC�dCe8�ZJeJeJ_GeJ_He9eJ�GdDdE�dEe8�ZKe9eKd$�GdFdG�dGe8�ZLeLZMe9eL�GdHdI�dIe8�ZNddJlmOZOmPZPmQZQGdKdL�dLe8�ZRGdMdN�dNe8�ZSdOdP�ZTddQdR�ZUdSdT�ZVdUdV�ZWGdWdX�dXeX�ZYGdYdZ�dZeY�ZZejdk�r�Gd[d\�d\eY�Z[dd]lm\Z\m8Z8Gd^d_�d_e8�Z]Gd`da�daeY�Z^Gdbdc�dceX�Z_e_eY�Z`e_eZ�Zaejdk�r�eZdddejb�Zcn,ejdek�r�eZdfejdddg��ZcneZd�Zcejdk�r4e_e[�Zee_e^�ZfeejgjhZhddhlmiZimjZjd�didj�Zke1e@�e1eL�k�rPe@Zle?Zmn6e1e>�e1eL�k�rle>Zle=Zmne1eE�e1eL�k�r�eEZleDZmddklmnZnmoZompZpmqZqe'eLeLeLel�en�Zre'eLeLe?el�eo�Zsdldm�Ztete:eLe:e:�eq�Zudndo�Zvete:eLe?�ep�Zwd�dqdr�ZxzddslmyZyWnezk
�r$YnXete:eLe?�ey�Z{d�dtdu�Z|ejdk�r\dvdw�Z}dxdy�Z~ddzlm�Z�m�Z�eIZ�eFZ�e;e?e=eDfD]@Z�e1e��dgk�r�e�Z�n&e1e��d{k�r�e�Z�ne1e��dk�r�e�Z��q�e<e@e>eEfD]@Z�e1e��dgk�r�e�Z�n&e1e��d{k�r�e�Z�ne1e��dk�r�e�Z��q�[�eT�dS)��Nz1.1.0)�Union�	Structure�Array)�_Pointer)�CFuncPtr)�__version__)�
RTLD_LOCAL�RTLD_GLOBAL)�
ArgumentError��calcsizezVersion number mismatch�nt)�FormatError�posix�darwin�.�)�FUNCFLAG_CDECL�FUNCFLAG_PYTHONAPI�FUNCFLAG_USE_ERRNO�FUNCFLAG_USE_LASTERRORcCszt|t�rD|dkrt|�d}t�d||�t|}|�}||_|St|t�rnt�dd|�t|}|�}|St|��dS)N�zctypes.create_string_buffer)	�
isinstance�bytes�len�_sys�audit�c_char�value�int�	TypeError��init�sizeZbuftypeZbuf�r$�'/usr/lib64/python3.8/ctypes/__init__.py�create_string_buffer/s

r&cCs
t||�S�N)r&)r"r#r$r$r%�c_bufferCsr(cs�t�|�dd�r�tO�|�dd�r,�tO�|r@td|����zt���fWStk
r�G���fdd�dt�}|t���f<|YSXdS)N�	use_errnoF�use_last_error�!unexpected keyword argument(s) %scseZdZ�Z�Z�ZdS)z CFUNCTYPE.<locals>.CFunctionTypeN��__name__�
__module__�__qualname__�
_argtypes_�	_restype_�_flags_r$��argtypes�flags�restyper$r%�
CFunctionTypeesr7)	�_FUNCFLAG_CDECL�pop�_FUNCFLAG_USE_ERRNO�_FUNCFLAG_USE_LASTERROR�
ValueError�keys�_c_functype_cache�KeyError�	_CFuncPtr)r6r4�kwr7r$r3r%�	CFUNCTYPEKsrB)�LoadLibrary)�FUNCFLAG_STDCALLcs�t�|�dd�r�tO�|�dd�r,�tO�|r@td|����zt���fWStk
r�G���fdd�dt�}|t���f<|YSXdS)Nr)Fr*r+cseZdZ�Z�Z�ZdS)z$WINFUNCTYPE.<locals>.WinFunctionTypeNr,r$r3r$r%�WinFunctionType}srE)	�_FUNCFLAG_STDCALLr9r:r;r<r=�_win_functype_cacher?r@)r6r4rArEr$r3r%�WINFUNCTYPEqsrH)�dlopen)�sizeof�byref�	addressof�	alignment�resize)�	get_errno�	set_errno)�_SimpleCDatacCsJddlm}|dkr|j}t|�||�}}||krFtd|||f��dS)Nrrz"sizeof(%s) wrong: %d instead of %d)�structr�_type_rJ�SystemError)�typ�typecoderZactualZrequiredr$r$r%�_check_size�s�rWcs eZdZdZ�fdd�Z�ZS)�	py_object�Ocs4zt���WStk
r.dt|�jYSXdS)Nz
%s(<NULL>))�super�__repr__r<�typer-��self��	__class__r$r%r[�szpy_object.__repr__)r-r.r/rSr[�
__classcell__r$r$r_r%rX�srX�Pc@seZdZdZdS)�c_short�hN�r-r.r/rSr$r$r$r%rc�srcc@seZdZdZdS)�c_ushort�HNrer$r$r$r%rf�srfc@seZdZdZdS)�c_long�lNrer$r$r$r%rh�srhc@seZdZdZdS)�c_ulong�LNrer$r$r$r%rj�srj�iric@seZdZdZdS)�c_intrlNrer$r$r$r%rm�srmc@seZdZdZdS)�c_uint�INrer$r$r$r%rn�srnc@seZdZdZdS)�c_float�fNrer$r$r$r%rp�srpc@seZdZdZdS)�c_double�dNrer$r$r$r%rr�srrc@seZdZdZdS)�c_longdouble�gNrer$r$r$r%rt�srt�qc@seZdZdZdS)�
c_longlongrvNrer$r$r$r%rw�srwc@seZdZdZdS)�c_ulonglong�QNrer$r$r$r%rx�srxc@seZdZdZdS)�c_ubyte�BNrer$r$r$r%rz�srzc@seZdZdZdS)�c_byte�bNrer$r$r$r%r|�sr|c@seZdZdZdS)r�cNrer$r$r$r%r�src@seZdZdZdd�ZdS)�c_char_p�zcCsd|jjt�|�jfS�Nz%s(%s)�r`r-�c_void_pZfrom_bufferrr]r$r$r%r[�szc_char_p.__repr__N�r-r.r/rSr[r$r$r$r%r�src@seZdZdZdS)r�rbNrer$r$r$r%r��sr�c@seZdZdZdS)�c_bool�?Nrer$r$r$r%r��sr�)�POINTER�pointer�_pointer_type_cachec@seZdZdZdd�ZdS)�	c_wchar_p�ZcCsd|jjt�|�jfSr�r�r]r$r$r%r[�szc_wchar_p.__repr__Nr�r$r$r$r%r��sr�c@seZdZdZdS)�c_wchar�uNrer$r$r$r%r�sr�cCsFt��t��tjdkr"t��tjtt	�_t
jtt�_ttd<dS)Nr
)
r��clearr>�_os�namerGr�Z
from_paramr�r�rrr�r$r$r$r%�_reset_caches
r�cCs�t|t�rh|dkrBtt�dkr6tdd�|D��d}nt|�d}t�d||�t|}|�}||_|St|t	�r�t�dd|�t|}|�}|St
|��dS)N�css"|]}t|�dkrdndVqdS)i��r�rN)�ord)�.0r~r$r$r%�	<genexpr>sz(create_unicode_buffer.<locals>.<genexpr>rzctypes.create_unicode_buffer)r�strrJr��sumrrrrrr r!r$r$r%�create_unicode_buffers 

r�cCsLt�|d�dk	rtd��t|�tkr,td��|�|�|t|<tt|�=dS)Nz%This type already exists in the cachezWhat's this???)r��get�RuntimeError�idZset_type)r��clsr$r$r%�SetPointerType.s
r�cCs||Sr'r$)rUrr$r$r%�ARRAY8sr�c@sLeZdZeZeZdZdZdZ	e
ddddfdd�Zdd�Zd	d
�Z
dd�ZdS)
�CDLLz<uninitialized>rNFc	s�|�_�j�|r�tO�|r$�tO�tj�d�rV|rV|�d�rVd|krV|tj	tj
BO}tjdkr�|dk	rn|}n6ddl}|j
}d|ks�d|kr�|��j��_||jO}G��fdd	�d	t�}|�_|dkr�t�j|��_n|�_dS)
NZaix�)z.a(r
r�/�\cseZdZ�Z�jZdS)zCDLL.__init__.<locals>._FuncPtrN)r-r.r/r2�_func_restype_r1r$�r5r^r$r%�_FuncPtrosr�)�_name�_func_flags_r:r;r�platform�
startswith�endswithr�ZRTLD_MEMBER�RTLD_NOWr�r
Z!_LOAD_LIBRARY_SEARCH_DEFAULT_DIRSZ_getfullpathnameZ!_LOAD_LIBRARY_SEARCH_DLL_LOAD_DIRr@r��_dlopen�_handle)	r^r��modeZhandler)r*Zwinmoder
r�r$r�r%�__init__Ss,

z
CDLL.__init__cCs8d|jj|j|jtjdd@t|�tjdd@fS)Nz<%s '%s', handle %x at %#x>r�r)r`r-r�r�r�maxsizer�r]r$r$r%r[ys
��z
CDLL.__repr__cCs6|�d�r|�d�rt|��|�|�}t|||�|S)N�__)r�r��AttributeError�__getitem__�setattr)r^r��funcr$r$r%�__getattr__s

zCDLL.__getattr__cCs"|�||f�}t|t�s||_|Sr')r�rrr-)r^Zname_or_ordinalr�r$r$r%r��s
zCDLL.__getitem__)r-r.r/r8r�rmr�r�r�r��DEFAULT_MODEr�r[r�r�r$r$r$r%r�>s�
&r�c@seZdZeeBZdS)�PyDLLN)r-r.r/r8�_FUNCFLAG_PYTHONAPIr�r$r$r$r%r��sr�c@seZdZeZdS)�WinDLLN)r-r.r/rFr�r$r$r$r%r��sr�)�_check_HRESULTrQc@seZdZdZeZdS)�HRESULTriN)r-r.r/rSr�Z_check_retval_r$r$r$r%r��s
r�c@seZdZeZeZdS)�OleDLLN)r-r.r/rFr�r�r�r$r$r$r%r��sr�c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�
LibraryLoadercCs
||_dSr'��_dlltype)r^Zdlltyper$r$r%r��szLibraryLoader.__init__cCs.|ddkrt|��|�|�}t|||�|S)Nr�_)r�r�r�)r^r�Zdllr$r$r%r��s

zLibraryLoader.__getattr__cCs
t||�Sr')�getattr�r^r�r$r$r%r��szLibraryLoader.__getitem__cCs
|�|�Sr'r�r�r$r$r%rC�szLibraryLoader.LoadLibraryN)r-r.r/r�r�r�rCr$r$r$r%r��sr�z
python dll�cygwinzlibpython%d.%d.dllr�)�get_last_error�set_last_errorcCs0|dkrt�}|dkr"t|���}td|d|�Sr')�GetLastErrorr�strip�OSError)�codeZdescrr$r$r%�WinError�s
r�)�
_memmove_addr�_memset_addr�_string_at_addr�
_cast_addrcsG��fdd�dt�}|S)NcseZdZ�Z�ZeeBZdS)z!PYFUNCTYPE.<locals>.CFunctionTypeN)r-r.r/r0r1r8r�r2r$�r4r6r$r%r7�sr7)r@)r6r4r7r$r�r%�
PYFUNCTYPE�sr�cCst|||�Sr')�_cast)�objrUr$r$r%�cast�sr����cCs
t||�Sr')�
_string_at�Zptrr#r$r$r%�	string_at�sr�)�_wstring_at_addrcCs
t||�Sr')�_wstring_atr�r$r$r%�
wstring_at
sr�cCsBztdt�t�dg�}Wntk
r.YdSX|�|||�SdS)N�comtypes.server.inprocserver�*i�)�
__import__�globals�locals�ImportError�DllGetClassObject)ZrclsidZriidZppv�ccomr$r$r%r�s
r�cCs8ztdt�t�dg�}Wntk
r.YdSX|��S)Nr�r�r)r�r�r�r��DllCanUnloadNow)r�r$r$r%r�s
r�)�BigEndianStructure�LittleEndianStructure�)N)N)N)N)NN)r�)r�)��osr��sysrrZ_ctypesrrrrrr@Z_ctypes_versionrr	r
rRrZ	_calcsize�	Exceptionr�rr�r�r�uname�release�splitrr8rr�rr:rr;r&r(r>rBrCr�rDrFrGrH�__doc__�replacerIrJrKrLrMrNrOrPrQrWrXrcrfrhrjrmrnrprrrtrwrxrzZ__ctype_le__Z__ctype_be__r|rrr�Zc_voidpr�r�r�r�r�r�r�r�r�r��objectr�r�r�r�r�r�r�ZcdllZpydllZ	dllhandleZ	pythonapi�version_infoZwindllZoledllZkernel32r�r�r�r�Zc_size_tZ	c_ssize_tr�r�r�r�ZmemmoveZmemsetr�r�r�r�r�r�r�r�r�r�r�Zctypes._endianr�r�Zc_int8Zc_uint8ZkindZc_int16Zc_int32Zc_int64Zc_uint16Zc_uint32Zc_uint64r$r$r$r%�<module>s2


!




N
	


ctypes/__pycache__/wintypes.cpython-38.pyc000064400000011761151153537540014614 0ustar00U

e5d��@sddlZejZejZejZejZej	Z
ejZej
ZejZejZeZejZGdd�dej�ZejZejZejZejZejZZej Z!Z"ej#Z$Z%Z&ej#Z'Z(ej)Z*Z+ej,Z-Z.e�/ej�e�/ej,�kr�ejZ0ejZ1n$e�/ej�e�/ej,�kr�ej Z0ejZ1eZ2eZ3eZ4eZ5eZ6eZ7ej,Z8e8Z9e8Z:e8Z;e8Z<e8Z=e8Z>e8Z?e8Z@e8ZAe8ZBe8ZCe8ZDe8ZEe8ZFe8ZGe8ZHe8ZIe8ZJe8ZKe8ZLe8ZMe8ZNe8ZOe8ZPe8ZQe8ZRe8ZSe8ZTe8ZUe8ZVe8ZWGdd�dejX�ZYeYZZZ[Z\Gdd�dejX�Z]e]Z^Gdd	�d	ejX�Z_Gd
d�dejX�Z`e`ZaZbZcGdd
�d
ejX�ZdedZeZfdd�ZgGdd�dejX�ZhehZiGdd�dejX�ZjejZkdZlGdd�dejX�ZmGdd�dejX�Zne�oe�ZpZqe�oe�Zre�oe�ZsZte�oe�Zue�oe4�Zve�oe�ZwZxe�oeh�ZyZze�oe�Z{e�oe8�Z|Z}e�oeG�Z~e�oeH�Ze�oe�Z�Z�e�oe�Z�e�oe7�Z�e�oe�Z�Z�e�oej�Z�Z�e�oe`�Z�Z�e�oec�Z�e�oeY�Z�Z�e�oe\�Z�Z�e�oeV�Z�e�oe�Z�e�oed�Z�Z�e�oef�Z�Z�e�oe^�Z�e�oe�Z�Z�e�oe"�Z�e�oe�Z�e�oe�Z�e�oe
�Z�e�oem�Z�Z�e�oen�Z�Z�e�oe�Z�Z�dS)�Nc@seZdZdZdd�ZdS)�VARIANT_BOOL�vcCsd|jj|jfS)Nz%s(%r))�	__class__�__name__�value)�self�r�'/usr/lib64/python3.8/ctypes/wintypes.py�__repr__szVARIANT_BOOL.__repr__N)r�
__module__�__qualname__Z_type_r
rrrr	rsrc@s(eZdZdefdefdefdefgZdS)�RECT�left�top�rightZbottomN�rrr�LONG�_fields_rrrr	r
as
�r
c@s(eZdZdefdefdefdefgZdS)�_SMALL_RECTZLeftZTopZRightZBottomN�rrr�SHORTrrrrr	rhs
�rc@seZdZdefdefgZdS)�_COORD�X�YNrrrrr	ros�rc@seZdZdefdefgZdS)�POINT�x�yNrrrrr	rss�rc@seZdZdefdefgZdS)�SIZEZcxZcyNrrrrr	rxs�rcCs||d>|d>S)N��r)ZredZgreenZbluerrr	�RGB}sr c@seZdZdefdefgZdS)�FILETIMEZ
dwLowDateTimeZdwHighDateTimeN)rrr�DWORDrrrrr	r!�s�r!c@s4eZdZdefdefdefdefdefdefgZ	dS)�MSGZhWnd�messageZwParamZlParam�timeZptN)
rrr�HWND�UINT�WPARAM�LPARAMr"rrrrrr	r#�s�r#ic@sTeZdZdefdefdefdefdefdefdefdefd	eefd
edfg
ZdS)
�WIN32_FIND_DATAA�dwFileAttributes�ftCreationTime�ftLastAccessTime�ftLastWriteTime�
nFileSizeHigh�nFileSizeLow�dwReserved0�dwReserved1�	cFileName�cAlternateFileName�N)rrrr"r!�CHAR�MAX_PATHrrrrr	r*�s

�r*c@sTeZdZdefdefdefdefdefdefdefdefd	eefd
edfg
ZdS)
�WIN32_FIND_DATAWr+r,r-r.r/r0r1r2r3r4r5N)rrrr"r!�WCHARr7rrrrr	r8�s

�r8)�ZctypesZc_byteZBYTEZc_ushortZWORDZc_ulongr"Zc_charr6Zc_wcharr9Zc_uintr'Zc_intZINTZc_doubleZDOUBLEZc_floatZFLOATZBOOLEANZc_longZBOOLZ_SimpleCDatarZULONGrZUSHORTZc_shortrZ
c_longlongZ_LARGE_INTEGERZ
LARGE_INTEGERZc_ulonglongZ_ULARGE_INTEGERZULARGE_INTEGERZ	c_wchar_pZ	LPCOLESTRZLPOLESTRZOLESTRZLPCWSTRZLPWSTRZc_char_pZLPCSTRZLPSTRZc_void_pZLPCVOIDZLPVOIDZsizeofr(r)ZATOMZLANGIDZCOLORREFZLGRPIDZLCTYPEZLCIDZHANDLEZHACCELZHBITMAPZHBRUSHZHCOLORSPACEZHDCZHDESKZHDWPZHENHMETAFILEZHFONTZHGDIOBJZHGLOBALZHHOOKZHICONZ	HINSTANCEZHKEYZHKLZHLOCALZHMENUZ	HMETAFILEZHMODULEZHMONITORZHPALETTEZHPENZHRGNZHRSRCZHSTRZHTASKZHWINSTAr&Z	SC_HANDLEZSERVICE_STATUS_HANDLEZ	Structurer
ZtagRECTZ_RECTLZRECTLrZ
SMALL_RECTrrZtagPOINTZ_POINTLZPOINTLrZtagSIZEZSIZELr r!Z	_FILETIMEr#ZtagMSGr7r*r8ZPOINTERZLPBOOLZPBOOLZPBOOLEANZLPBYTEZPBYTEZPCHARZ
LPCOLORREFZLPDWORDZPDWORDZ
LPFILETIMEZ	PFILETIMEZPFLOATZLPHANDLEZPHANDLEZPHKEYZLPHKLZLPINTZPINTZPLARGE_INTEGERZPLCIDZLPLONGZPLONGZLPMSGZPMSGZLPPOINTZPPOINTZPPOINTLZLPRECTZPRECTZLPRECTLZPRECTLZLPSC_HANDLEZPSHORTZLPSIZEZPSIZEZLPSIZELZPSIZELZPSMALL_RECTZLPUINTZPUINTZPULARGE_INTEGERZPULONGZPUSHORTZPWCHARZLPWIN32_FIND_DATAAZPWIN32_FIND_DATAAZLPWIN32_FIND_DATAWZPWIN32_FIND_DATAWZLPWORDZPWORDrrrr	�<module>s�




















ctypes/__pycache__/util.cpython-38.pyc000064400000017577151153537540013722 0ustar00U

e5d76�@sBddlZddlZddlZddlZejdkrDdd�Zdd�Zdd�Zn�ejd	krnejd
krnddl	m
Zdd�Zn�ej�d
�r�ddl
mZn�ejd	k�r&ddlZddlZdd�Zdd�Zejdkr�dd�Zndd�Zej�d�r�dd�Zdd�Zn8ejdk�rdd�Zd'dd�Zndd �Zd!d"�Zd#d�Zd$d%�Zed&k�r>e�dS)(�N�ntcCs�d}tj�|�}|dkrdS|t|�}tj|d��dd�\}}t|dd��d}|dkrf|d7}t|d	d
��d}|dkr�d}|dkr�||SdS)
z�Return the version of MSVC that was used to build Python.

        For Python 2.3 and up, the version number is included in
        sys.version.  For earlier versions, assume the compiler is MSVC 6.
        zMSC v.����N� �����
��g$@r)�sys�version�find�len�split�int)�prefix�i�s�restZmajorVersionZminorVersion�r�#/usr/lib64/python3.8/ctypes/util.py�_get_build_version	srcCs^t�}|dkrdS|dkr d}n|dkr6d|d}ndSddl}d|jjkrV|d	7}|d
S)z%Return the name of the VC runtime dllNr�msvcrtrzmsvcr%d�
rz_d.pyd�d�.dll)r�importlib.machinery�	machinery�EXTENSION_SUFFIXES)rZclibname�	importlibrrr�find_msvcrt"sr cCsx|dkrt�Stjd�tj�D]R}tj�||�}tj�|�rF|S|���	d�rVq |d}tj�|�r |Sq dS)N)�c�m�PATHr)
r �os�environr�pathsep�path�join�isfile�lower�endswith)�nameZ	directoryZfnamerrr�find_library7s
r-�posix�darwin)�	dyld_findc	CsPd|d|d||fg}|D],}zt|�WStk
rHYqYqXqdS)Nzlib%s.dylibz%s.dylibz%s.framework/%s)�
_dyld_find�
ValueError)r,�possiblerrrr-Hs
��aix)r-c
Cs4d}t|d��}|�d�|kW5QR�SQRXdS)z,Return True if the given file is an ELF filesELF�br�N)�open�read)�filenameZ
elf_headerZthefilerrr�_is_elf`sr:c
Cs t�dt�|��}t�d�}|s,t�d�}|s4dSt��}z�|dd|j
d|g}ttj�}d|d<d|d	<zt
j|t
jt
j|d
�}Wntk
r�YW�$dSX|�|j��}W5QRXW5z|��Wnt	k
r�YnXXt�||�}|s�dS|D]}	t|	��s�q�t�|	�SdS)N�[^\(\)\s]*lib%s\.[^\(\)\s]*ZgccZccz-Wl,-t�-oz-l�C�LC_ALL�LANG��stdout�stderr�env)r$�fsencode�re�escape�shutil�which�tempfileZNamedTemporaryFile�close�FileNotFoundErrorr,�dictr%�
subprocess�Popen�PIPEZSTDOUT�OSErrorrAr8�findallr:�fsdecode)
r,�exprZ
c_compilerZtemp�argsrC�procZtrace�res�filerrr�_findLib_gccfsB


�

rXZsunos5c	Cs||sdSztjdd|ftjtjd�}Wntk
r<YdSX|�|j��}W5QRXt�d|�}|sldSt	�
|�d��S)Nz/usr/ccs/bin/dumpz-Lpv�rArBs\[.*\]\sSONAME\s+([^\s]+)r)rMrNrO�DEVNULLrPrAr8rE�searchr$rR�group)�frU�datarVrrr�_get_soname�s�
r_c	Cs�|sdSt�d�}|sdSz"tj|ddd|ftjtjd�}Wntk
rRYdSX|�|j��}W5QRXt	�
d|�}|s�dSt�|�
d��S)N�objdump�-pz-jz.dynamicrYs\sSONAME\s+([^\s]+)r)rGrHrMrNrOrZrPrAr8rEr[r$rRr\)r]r`rU�dumprVrrrr_�s$
�
)ZfreebsdZopenbsdZ	dragonflycCsN|�d�}g}z|r*|�dt|����qWntk
r@YnX|pLtjgS)N�.r)r�insertr�popr2r�maxsize)Zlibname�partsZnumsrrr�_num_version�s
rhc	Cs�t�|�}d||f}t�|�}ztjdtjtjd�}Wntk
rPd}YnX|�|j	�
�}W5QRXt�||�}|s�tt
|��S|jtd�t�|d�S)Nz:-l%s\.\S+ => \S*/(lib%s\.\S+))�/sbin/ldconfigz-rrY�)�keyr)rErFr$rDrMrNrOrZrPrAr8rQr_rX�sortrhrR)r,ZenamerSrUr^rVrrrr-�s"

�

c		Cs�tj�d�sdSttj�}d|d<|r,d}nd}d}ztj|tjtj|d�}Wnt	k
rdYdSX|�6|j
D](}|��}|�d�rrt�
|���d}qrW5QRX|s�dS|�d	�D]*}tj�|d
|�}tj�|�r�|Sq�dS)N�
/usr/bin/crler=r>)rm�-64)rmr@sDefault Library Path (ELF):r6�:zlib%s.so)r$r'�existsrLr%rMrNrOrZrPrA�strip�
startswithrRrr()	r,�is64rCrT�pathsrU�line�dirZlibfilerrr�
_findLib_crle�s8
�



rwFcCstt||�pt|��S�N)r_rwrX)r,rsrrrr-	sc
Cs�ddl}|�d�dkr&t��jd}nt��jd}dddddd	�}|�|d
�}d}t�|t�|�|f�}zht	j
dd
gt	jt	jt	jddd�d��:}t�
||j���}|r�t�|�d��W5QR�WSW5QRXWntk
r�YnXdS)Nr�lr6z-32rnzlibc6,x86-64zlibc6,64bitzlibc6,IA-64)z	x86_64-64zppc64-64z
sparc64-64zs390x-64zia64-64Zlibc6z\s+(lib%s\.[^\s]+)\s+\(%srirar=)r>r?)�stdinrBrArCr)�structZcalcsizer$�uname�machine�getrDrErFrMrNrZrOr[rAr8rRr\rP)r,r{r}Zmach_mapZabi_typeZregex�prVrrr�_findSoname_ldconfigs4�
�,r�cCs�dt�|�}ddg}tj�d�}|rD|�d�D]}|�d|g�q0|�dtjd|g�d}zZtj	|tj
tj
d	d
�}|��\}}t�|t�
|��}	|	D]}
t|
�s�q�t�
|
�WSWntk
r�YnX|S)Nr;Zldz-tZLD_LIBRARY_PATHroz-Lr<z-l%sT)rArBZuniversal_newlines)rErFr$r%r~r�extend�devnullrMrNrOZcommunicaterQrRr:�	Exception)r,rS�cmdZlibpathr�resultr�out�_rVrWrrr�_findLib_ld,s,
�r�cCs t|�ptt|��ptt|��Srx)r�r_rXr�)r,rrrr-Gs

�
�cCs�ddlm}tjdkr:t|j�t|�d��ttd��tjdk�r�ttd��ttd��ttd��tj	d	kr�t|�
d
��t|�
d��t|�
d��t|�
d
���ntj	�d��r�ddlm}tj
dk�rtd|dtj����td|�
d����ttd��t|�
d��n*td|dtj����td|�
d����tdtd����td|�
td�����tdtd����td|�
td�����n(t|�
d��t|�
d��ttd��dS)Nr)�cdllrrr.r"r!�bz2r/z
libm.dylibzlibcrypto.dylibzlibSystem.dylibzSystem.framework/Systemr4)�CDLLlz"Using CDLL(name, os.RTLD_MEMBER): z
libc.a(shr.o)zUsing cdll.LoadLibrary(): Zrpmz	librpm.sozlibc.a(shr_64.o)z	crypt	:: Zcryptz
crypto	:: Zcryptozlibm.sozlibcrypt.so)Zctypesr�r$r,�printr�loadr-r�platformZLoadLibraryrrr�rfZRTLD_MEMBER)r�r�rrr�testOs<


r��__main__)F)r$rGrMrr,rr r-r�Zctypes.macholib.dyldr0r1rrZctypes._aixrErIr:rXr_rhrwr�r�r��__name__rrrr�<module>s>


2


$(
ctypes/__pycache__/_aix.cpython-38.pyc000064400000023166151153537540013654 0ustar00U

e5d1�@s�dZdZddlZddlmZmZddlmZddlm	Z	m
Z
ddlmZm
Z
mZe
e	�dZdd	lmZd
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�ZdS)"a�
Lib/ctypes.util.find_library() support for AIX
Similar approach as done for Darwin support by using separate files
but unlike Darwin - no extension such as ctypes.macholib.*

dlopen() is an interface to AIX initAndLoad() - primary documentation at:
https://www.ibm.com/support/knowledgecenter/en/ssw_aix_61/com.ibm.aix.basetrf1/dlopen.htm
https://www.ibm.com/support/knowledgecenter/en/ssw_aix_61/com.ibm.aix.basetrf1/load.htm

AIX supports two styles for dlopen(): svr4 (System V Release 4) which is common on posix
platforms, but also a BSD style - aka SVR3.

From AIX 5.3 Difference Addendum (December 2004)
2.9 SVR4 linking affinity
Nowadays, there are two major object file formats used by the operating systems:
XCOFF: The COFF enhanced by IBM and others. The original COFF (Common
Object File Format) was the base of SVR3 and BSD 4.2 systems.
ELF:   Executable and Linking Format that was developed by AT&T and is a
base for SVR4 UNIX.

While the shared library content is identical on AIX - one is located as a filepath name
(svr4 style) and the other is located as a member of an archive (and the archive
is located as a filepath name).

The key difference arises when supporting multiple abi formats (i.e., 32 and 64 bit).
For svr4 either only one ABI is supported, or there are two directories, or there
are different file names. The most common solution for multiple ABI is multiple
directories.

For the XCOFF (aka AIX) style - one directory (one archive file) is sufficient
as multiple shared libraries can be in the archive - even sharing the same name.
In documentation the archive is also referred to as the "base" and the shared
library object is referred to as the "member".

For dlopen() on AIX (read initAndLoad()) the calls are similar.
Default activity occurs when no path information is provided. When path
information is provided dlopen() does not search any other directories.

For SVR4 - the shared library name is the name of the file expected: libFOO.so
For AIX - the shared library is expressed as base(member). The search is for the
base (e.g., libFOO.a) and once the base is found the shared library - identified by
member (e.g., libFOO.so, or shr.o) is located and loaded.

The mode bit RTLD_MEMBER tells initAndLoad() that it needs to use the AIX (SVR3)
naming style.
z%Michael Felt <aixtools@felt.demon.nl>�N)�environ�path)�
executable)�c_void_p�sizeof)�Popen�PIPE�DEVNULL�)�maxsizecs�fdd�}tt|�|d�S)NcsL|���}g}z|r*|�dt|����qWntk
r@YnX|pJtgS)Nr)�split�insert�int�pop�
ValueErrorr)Zlibname�partsZnums��sep��#/usr/lib64/python3.8/ctypes/_aix.py�_num_version>s
z#_last_version.<locals>._num_version)�key)�max�reversed)Zlibnamesrrrrr�
_last_version=s
rcCs:d}|jD]*}|�d�r|}q
d|kr
|�d�Sq
dS)N)�/z./z../ZINDEX�
)�stdout�
startswith�rstrip)�p�	ld_header�linerrr�
get_ld_headerJs

r#cCs0g}|jD] }t�d|�r&|�|�q
q,q
|S)Nz[0-9])r�re�match�append)r �infor"rrr�get_ld_header_infoTs
r(cCs\g}tddt��d|gdttd�}t|�}|rF|�|t|�f�q"qFq"|j��|�	�|S)z�
    Parse the header of the loader section of executable and archives
    This function calls /usr/bin/dump -H as a subprocess
    and returns a list of (ld_header, ld_header_info) tuples.
    z
/usr/bin/dumpz-Xz-HT)Zuniversal_newlinesr�stderr)
r�AIX_ABIrr	r#r&r(r�close�wait)�fileZldr_headersr r!rrr�get_ld_headersas
�
r.cCs6g}|D](\}}d|kr|�||�d�d��q|S)z�
    extract the shareable objects from ld_headers
    character "[" is used to strip off the path information.
    Note: the "[" and "]" characters that are part of dump -H output
    are not removed here.
    �[���)r&�index)Z
ld_headersZsharedr"�_rrr�
get_sharedys
r3csJd��d��ttd�fdd�|D���}t|�dkrB|d�d�SdSdS)zy
    Must be only one match, otherwise result is None.
    When there is a match, strip leading "[" and trailing "]"
    z\[(z)\]Nc3s|]}t��|�VqdS)N)r$�search)�.0r"��exprrr�	<genexpr>�sz get_one_match.<locals>.<genexpr>�r)�list�filter�len�group)r7�linesZmatchesrr6r�
get_one_match�s
r?cCsJtdkr d}t||�}|rF|Sn&dD] }tt�|�|�}|r$|Sq$dS)z�
    This routine provides historical aka legacy naming schemes started
    in AIX4 shared library support for library members names.
    e.g., in /usr/lib/libc.a the member name shr.o for 32-bit binary and
    shr_64.o for 64-bit binary.
    �@zshr4?_?64\.o)zshr.ozshr4.oN)r*r?r$�escape)�membersr7�member�namerrr�
get_legacy�s

rEcCsfd|�d�d|�d�g}|D]D}g}|D]$}t�||�}|r(|�|�d��q(|rt|d�SqdS)a�
    Sort list of members and return highest numbered version - if it exists.
    This function is called when an unversioned libFOO.a(libFOO.so) has
    not been found.

    Versioning for the member name is expected to follow
    GNU LIBTOOL conventions: the highest version (x, then X.y, then X.Y.z)
     * find [libFoo.so.X]
     * find [libFoo.so.X.Y]
     * find [libFoo.so.X.Y.Z]

    Before the GNU convention became the standard scheme regardless of
    binary size AIX packagers used GNU convention "as-is" for 32-bit
    archive members but used an "distinguishing" name for 64-bit members.
    This scheme inserted either 64 or _64 between libFOO and .so
    - generally libFOO_64.so, but occasionally libFOO64.so
    �libz\.so\.[0-9]+[0-9.]*z_?64\.so\.[0-9]+[0-9.]*r�.N)r$r4r&r=r)rDrBZexprsr7Zversionsr"�mrrr�get_version�s

�rIcCsbd|�d�}t||�}|r|Stdkr<d|�d�}t||�}|rD|St||�}|rV|St|�SdS)ab
    Return an archive member matching the request in name.
    Name is the library name without any prefix like lib, suffix like .so,
    or version number.
    Given a list of members find and return the most appropriate result
    Priority is given to generic libXXX.so, then a versioned libXXX.so.a.b.c
    and finally, legacy AIX naming scheme.
    rFz\.sor@z64\.soN)r?r*rIrE)rDrBr7rCrrr�
get_member�s



rJcCs|t�d�}|dkrt�d�}|dkr*g}n
|�d�}tt�}|D]6\}}|D](}|��d}d|krL|�|�d��qLq@|S)a
    On AIX, the buildtime searchpath is stored in the executable.
    as "loader header information".
    The command /usr/bin/dump -H extracts this info.
    Prefix searched libraries with LD_LIBRARY_PATH (preferred),
    or LIBPATH if defined. These paths are appended to the paths
    to libraries the python executable is linked with.
    This mimics AIX dlopen() behavior.
    ZLD_LIBRARY_PATHNZLIBPATH�:r9r)r�getrr.r�extend)�libpathsZobjectsr2r>r"rrrr�get_libpaths�s



rOcCsp|D]f}|dkrqd|�d�}t�||�}t�|�rtt|��}tt�|�|�}|dkrd||fSdSqdS)a
    paths is a list of directories to search for an archive.
    name is the abbreviated name given to find_library().
    Process: search "paths" for archive, and if an archive is found
    return the result of get_member().
    If an archive is not found then return None
    �/librFz.aN)NN)r�join�existsr3r.rJr$rA)�pathsrD�dir�base�archiverBrCrrr�find_shared
s
rWcCsnt�}t||�\}}|dkr,|�d|�d�Sd|�d�}|D],}|dkrJq<t�||�}t�|�r<|Sq<dS)a�AIX implementation of ctypes.util.find_library()
    Find an archive member that will dlopen(). If not available,
    also search for a file (or link) with a .so suffix.

    AIX supports two types of schemes that can be used with dlopen().
    The so-called SystemV Release4 (svr4) format is commonly suffixed
    with .so while the (default) AIX scheme has the library (archive)
    ending with the suffix .a
    As an archive has multiple members (e.g., 32-bit and 64-bit) in one file
    the argument passed to dlopen must include both the library and
    the member names in a single string.

    find_library() looks first for an archive (.a) with a suitable member.
    If no archive+member pair is found, look for a .so file.
    N�(�)rFz.sorP)rOrWrrQrR)rDrNrUrCZsonamerTZshlibrrr�find_library#s

rZ)�__doc__�
__author__r$�osrr�sysrZctypesrr�
subprocessrrr	r*rrr#r(r.r3r?rErIrJrOrWrZrrrr�<module>s(.


&ctypes/__pycache__/__init__.cpython-38.pyc000064400000037766151153537540014506 0ustar00U

e5d�E�@s dZddlZddlZdZddlmZmZm	Z	ddlm
Z
ddlmZddlmZ
ddlmZmZdd	lmZdd
lmZee
kr�edee
��ejdkr�dd
lmZeZejdkr�ejdkr�ee��j�d�d�dkr�eZddlmZmZ m!Z"m#Z$d}dd�Z%d~dd�Z&iZ'dd�Z(ejdk�r\ddlm)Z*ddlm+Z,iZ-dd�Z.e.j�rte(j�/dd�e._nejdk�rtddlm0Z*ddlm1Z1m2Z2m3Z3m4Z4m5Z5ddlm6Z6m7Z7dd lm8Z8dd!d"�Z9Gd#d$�d$e8�Z:e9e:d%�Gd&d'�d'e8�Z;e9e;�Gd(d)�d)e8�Z<e9e<�Gd*d+�d+e8�Z=e9e=�Gd,d-�d-e8�Z>e9e>�ed.�ed/�k�rLe=Z?e>Z@n0Gd0d1�d1e8�Z?e9e?�Gd2d3�d3e8�Z@e9e@�Gd4d5�d5e8�ZAe9eA�Gd6d7�d7e8�ZBe9eB�Gd8d9�d9e8�ZCe1eC�e1eB�k�r�eBZCed/�ed:�k�r�e=ZDe>ZEn0Gd;d<�d<e8�ZDe9eD�Gd=d>�d>e8�ZEe9eE�Gd?d@�d@e8�ZFeFeF_GeF_He9eF�GdAdB�dBe8�ZIeIeI_GeI_He9eI�GdCdD�dDe8�ZJeJeJ_GeJ_He9eJ�GdEdF�dFe8�ZKe9eKd%�GdGdH�dHe8�ZLeLZMe9eL�GdIdJ�dJe8�ZNddKlmOZOmPZPmQZQGdLdM�dMe8�ZRGdNdO�dOe8�ZSdPdQ�ZTd�dRdS�ZUdTdU�ZVdVdW�ZWGdXdY�dYeX�ZYGdZd[�d[eY�ZZejdk�r�Gd\d]�d]eY�Z[dd^lm\Z\m8Z8Gd_d`�d`e8�Z]Gdadb�dbeY�Z^Gdcdd�ddeX�Z_e_eY�Z`e_eZ�Zaejdk�r�eZdedejb�Zcn,ejdfk�r�eZdgejdddh��ZcneZd�Zcejdk�r8e_e[�Zee_e^�ZfeejgjhZhddilmiZimjZjd�djdk�Zke1e@�e1eL�k�rTe@Zle?Zmn6e1e>�e1eL�k�rpe>Zle=Zmne1eE�e1eL�k�r�eEZleDZmddllmnZnmoZompZpmqZqe(eLeLeLel�en�Zre(eLeLe?el�eo�Zsdmdn�Ztete:eLe:e:�eq�Zudodp�Zvete:eLe?�ep�Zwd�drds�ZxzddtlmyZyWnezk
�r(YnXete:eLe?�ey�Z{d�dudv�Z|ejdk�r`dwdx�Z}dydz�Z~dd{lm�Z�m�Z�eIZ�eFZ�e;e?e=eDfD]@Z�e1e��dhk�r�e�Z�n&e1e��d|k�r�e�Z�ne1e��dk�r�e�Z��q�e<e@e>eEfD]@Z�e1e��dhk�r�e�Z�n&e1e��d|k�r�e�Z�ne1e��dk�r�e�Z��q�[�eT�dS)�z,create and manipulate C data types in Python�Nz1.1.0)�Union�	Structure�Array)�_Pointer)�CFuncPtr)�__version__)�
RTLD_LOCAL�RTLD_GLOBAL)�
ArgumentError��calcsizezVersion number mismatch�nt)�FormatError�posix�darwin�.�)�FUNCFLAG_CDECL�FUNCFLAG_PYTHONAPI�FUNCFLAG_USE_ERRNO�FUNCFLAG_USE_LASTERRORcCszt|t�rD|dkrt|�d}t�d||�t|}|�}||_|St|t�rnt�dd|�t|}|�}|St|��dS)z�create_string_buffer(aBytes) -> character array
    create_string_buffer(anInteger) -> character array
    create_string_buffer(aBytes, anInteger) -> character array
    N�zctypes.create_string_buffer)	�
isinstance�bytes�len�_sys�audit�c_char�value�int�	TypeError��init�sizeZbuftypeZbuf�r$�'/usr/lib64/python3.8/ctypes/__init__.py�create_string_buffer/s

r&cCs
t||�S�N)r&)r"r#r$r$r%�c_bufferCsr(cs�t�|�dd�r�tO�|�dd�r,�tO�|r@td|����zt���fWStk
r�G���fdd�dt�}|t���f<|YSXdS)a�CFUNCTYPE(restype, *argtypes,
                 use_errno=False, use_last_error=False) -> function prototype.

    restype: the result type
    argtypes: a sequence specifying the argument types

    The function prototype can be called in different ways to create a
    callable object:

    prototype(integer address) -> foreign function
    prototype(callable) -> create and return a C callable function from callable
    prototype(integer index, method name[, paramflags]) -> foreign function calling a COM method
    prototype((ordinal number, dll object)[, paramflags]) -> foreign function exported by ordinal
    prototype((function name, dll object)[, paramflags]) -> foreign function exported by name
    �	use_errnoF�use_last_error�!unexpected keyword argument(s) %scseZdZ�Z�Z�ZdS)z CFUNCTYPE.<locals>.CFunctionTypeN��__name__�
__module__�__qualname__�
_argtypes_�	_restype_�_flags_r$��argtypes�flags�restyper$r%�
CFunctionTypeesr7N)	�_FUNCFLAG_CDECL�pop�_FUNCFLAG_USE_ERRNO�_FUNCFLAG_USE_LASTERROR�
ValueError�keys�_c_functype_cache�KeyError�	_CFuncPtr)r6r4�kwr7r$r3r%�	CFUNCTYPEKsrB)�LoadLibrary)�FUNCFLAG_STDCALLcs�t�|�dd�r�tO�|�dd�r,�tO�|r@td|����zt���fWStk
r�G���fdd�dt�}|t���f<|YSXdS)Nr)Fr*r+cseZdZ�Z�Z�ZdS)z$WINFUNCTYPE.<locals>.WinFunctionTypeNr,r$r3r$r%�WinFunctionType}srE)	�_FUNCFLAG_STDCALLr9r:r;r<r=�_win_functype_cacher?r@)r6r4rArEr$r3r%�WINFUNCTYPEqsrH)�dlopen)�sizeof�byref�	addressof�	alignment�resize)�	get_errno�	set_errno)�_SimpleCDatacCsJddlm}|dkr|j}t|�||�}}||krFtd|||f��dS)Nrrz"sizeof(%s) wrong: %d instead of %d)�structr�_type_rJ�SystemError)�typ�typecoderZactualZrequiredr$r$r%�_check_size�s�rWcs eZdZdZ�fdd�Z�ZS)�	py_object�Ocs4zt���WStk
r.dt|�jYSXdS)Nz
%s(<NULL>))�super�__repr__r<�typer-��self��	__class__r$r%r[�szpy_object.__repr__)r-r.r/rSr[�
__classcell__r$r$r_r%rX�srX�Pc@seZdZdZdS)�c_short�hN�r-r.r/rSr$r$r$r%rc�srcc@seZdZdZdS)�c_ushort�HNrer$r$r$r%rf�srfc@seZdZdZdS)�c_long�lNrer$r$r$r%rh�srhc@seZdZdZdS)�c_ulong�LNrer$r$r$r%rj�srj�iric@seZdZdZdS)�c_intrlNrer$r$r$r%rm�srmc@seZdZdZdS)�c_uint�INrer$r$r$r%rn�srnc@seZdZdZdS)�c_float�fNrer$r$r$r%rp�srpc@seZdZdZdS)�c_double�dNrer$r$r$r%rr�srrc@seZdZdZdS)�c_longdouble�gNrer$r$r$r%rt�srt�qc@seZdZdZdS)�
c_longlongrvNrer$r$r$r%rw�srwc@seZdZdZdS)�c_ulonglong�QNrer$r$r$r%rx�srxc@seZdZdZdS)�c_ubyte�BNrer$r$r$r%rz�srzc@seZdZdZdS)�c_byte�bNrer$r$r$r%r|�sr|c@seZdZdZdS)r�cNrer$r$r$r%r�src@seZdZdZdd�ZdS)�c_char_p�zcCsd|jjt�|�jfS�Nz%s(%s)�r`r-�c_void_pZfrom_bufferrr]r$r$r%r[�szc_char_p.__repr__N�r-r.r/rSr[r$r$r$r%r�src@seZdZdZdS)r�rbNrer$r$r$r%r��sr�c@seZdZdZdS)�c_bool�?Nrer$r$r$r%r��sr�)�POINTER�pointer�_pointer_type_cachec@seZdZdZdd�ZdS)�	c_wchar_p�ZcCsd|jjt�|�jfSr�r�r]r$r$r%r[�szc_wchar_p.__repr__Nr�r$r$r$r%r��sr�c@seZdZdZdS)�c_wchar�uNrer$r$r$r%r�sr�cCsFt��t��tjdkr"t��tjtt	�_t
jtt�_ttd<dS)Nr
)
r��clearr>�_os�namerGr�Z
from_paramr�r�rrr�r$r$r$r%�_reset_caches
r�cCs�t|t�rh|dkrBtt�dkr6tdd�|D��d}nt|�d}t�d||�t|}|�}||_|St|t	�r�t�dd|�t|}|�}|St
|��dS)z�create_unicode_buffer(aString) -> character array
    create_unicode_buffer(anInteger) -> character array
    create_unicode_buffer(aString, anInteger) -> character array
    N�css"|]}t|�dkrdndVqdS)i��r�rN)�ord)�.0r~r$r$r%�	<genexpr>sz(create_unicode_buffer.<locals>.<genexpr>rzctypes.create_unicode_buffer)r�strrJr��sumrrrrrr r!r$r$r%�create_unicode_buffers 

r�cCsLt�|d�dk	rtd��t|�tkr,td��|�|�|t|<tt|�=dS)Nz%This type already exists in the cachezWhat's this???)r��get�RuntimeError�idZset_type)r��clsr$r$r%�SetPointerType.s
r�cCs||Sr'r$)rUrr$r$r%�ARRAY8sr�c@sPeZdZdZeZeZdZdZ	dZ
eddddfdd�Zdd	�Z
d
d�Zdd
�ZdS)�CDLLa�An instance of this class represents a loaded dll/shared
    library, exporting functions using the standard C calling
    convention (named 'cdecl' on Windows).

    The exported functions can be accessed as attributes, or by
    indexing with the function name.  Examples:

    <obj>.qsort -> callable object
    <obj>['qsort'] -> callable object

    Calling the functions releases the Python GIL during the call and
    reacquires it afterwards.
    z<uninitialized>rNFc	s�|�_�j�|r�tO�|r$�tO�tj�d�rV|rV|�d�rVd|krV|tj	tj
BO}tjdkr�|dk	rn|}n6ddl}|j
}d|ks�d|kr�|��j��_||jO}G��fdd	�d	t�}|�_|dkr�t�j|��_n|�_dS)
NZaix�)z.a(r
r�/�\cseZdZ�Z�jZdS)zCDLL.__init__.<locals>._FuncPtrN)r-r.r/r2�_func_restype_r1r$�r5r^r$r%�_FuncPtrosr�)�_name�_func_flags_r:r;r�platform�
startswith�endswithr�ZRTLD_MEMBER�RTLD_NOWr�r
Z!_LOAD_LIBRARY_SEARCH_DEFAULT_DIRSZ_getfullpathnameZ!_LOAD_LIBRARY_SEARCH_DLL_LOAD_DIRr@r��_dlopen�_handle)	r^r��modeZhandler)r*Zwinmoder
r�r$r�r%�__init__Ss,

z
CDLL.__init__cCs8d|jj|j|jtjdd@t|�tjdd@fS)Nz<%s '%s', handle %x at %#x>r�r)r`r-r�r�r�maxsizer�r]r$r$r%r[ys
��z
CDLL.__repr__cCs6|�d�r|�d�rt|��|�|�}t|||�|S)N�__)r�r��AttributeError�__getitem__�setattr)r^r��funcr$r$r%�__getattr__s

zCDLL.__getattr__cCs"|�||f�}t|t�s||_|Sr')r�rrr-)r^Zname_or_ordinalr�r$r$r%r��s
zCDLL.__getitem__)r-r.r/�__doc__r8r�rmr�r�r�r��DEFAULT_MODEr�r[r�r�r$r$r$r%r�>s
�
&r�c@seZdZdZeeBZdS)�PyDLLz�This class represents the Python library itself.  It allows
    accessing Python API functions.  The GIL is not released, and
    Python exceptions are handled correctly.
    N)r-r.r/r�r8�_FUNCFLAG_PYTHONAPIr�r$r$r$r%r��sr�c@seZdZdZeZdS)�WinDLLznThis class represents a dll exporting functions using the
        Windows stdcall calling convention.
        N)r-r.r/r�rFr�r$r$r$r%r��sr�)�_check_HRESULTrQc@seZdZdZeZdS)�HRESULTriN)r-r.r/rSr�Z_check_retval_r$r$r$r%r��s
r�c@seZdZdZeZeZdS)�OleDLLz�This class represents a dll exporting functions using the
        Windows stdcall calling convention, and returning HRESULT.
        HRESULT error values are automatically raised as OSError
        exceptions.
        N)r-r.r/r�rFr�r�r�r$r$r$r%r��sr�c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�
LibraryLoadercCs
||_dSr'��_dlltype)r^Zdlltyper$r$r%r��szLibraryLoader.__init__cCs.|ddkrt|��|�|�}t|||�|S)Nr�_)r�r�r�)r^r�Zdllr$r$r%r��s

zLibraryLoader.__getattr__cCs
t||�Sr')�getattr�r^r�r$r$r%r��szLibraryLoader.__getitem__cCs
|�|�Sr'r�r�r$r$r%rC�szLibraryLoader.LoadLibraryN)r-r.r/r�r�r�rCr$r$r$r%r��sr�z
python dll�cygwinzlibpython%d.%d.dllr�)�get_last_error�set_last_errorcCs0|dkrt�}|dkr"t|���}td|d|�Sr')�GetLastErrorr�strip�OSError)�codeZdescrr$r$r%�WinError�s
r�)�
_memmove_addr�_memset_addr�_string_at_addr�
_cast_addrcsG��fdd�dt�}|S)NcseZdZ�Z�ZeeBZdS)z!PYFUNCTYPE.<locals>.CFunctionTypeN)r-r.r/r0r1r8r�r2r$�r4r6r$r%r7�sr7)r@)r6r4r7r$r�r%�
PYFUNCTYPE�sr�cCst|||�Sr')�_cast)�objrUr$r$r%�cast�sr����cCs
t||�S)zAstring_at(addr[, size]) -> string

    Return the string at addr.)�
_string_at�Zptrr#r$r$r%�	string_at�sr�)�_wstring_at_addrcCs
t||�S)zFwstring_at(addr[, size]) -> string

        Return the string at addr.)�_wstring_atr�r$r$r%�
wstring_at
sr�cCsBztdt�t�dg�}Wntk
r.YdSX|�|||�SdS)N�comtypes.server.inprocserver�*i�)�
__import__�globals�locals�ImportError�DllGetClassObject)ZrclsidZriidZppv�ccomr$r$r%r�s
r�cCs8ztdt�t�dg�}Wntk
r.YdSX|��S)Nr�r�r)r�r�r�r��DllCanUnloadNow)r�r$r$r%r�s
r�)�BigEndianStructure�LittleEndianStructure�)N)N)N)N)NN)r�)r�)�r��osr��sysrrZ_ctypesrrrrrr@Z_ctypes_versionrr	r
rRrZ	_calcsize�	Exceptionr�rr�r�r�uname�release�splitrr8rr�rr:rr;r&r(r>rBrCr�rDrFrGrH�replacerIrJrKrLrMrNrOrPrQrWrXrcrfrhrjrmrnrprrrtrwrxrzZ__ctype_le__Z__ctype_be__r|rrr�Zc_voidpr�r�r�r�r�r�r�r�r�r��objectr�r�r�r�r�r�r�ZcdllZpydllZ	dllhandleZ	pythonapi�version_infoZwindllZoledllZkernel32r�r�r�r�Zc_size_tZ	c_ssize_tr�r�r�r�ZmemmoveZmemsetr�r�r�r�r�r�r�r�r�r�r�Zctypes._endianr�r�Zc_int8Zc_uint8ZkindZc_int16Zc_int32Zc_int64Zc_uint16Zc_uint32Zc_uint64r$r$r$r%�<module>s4


!




N
	


ctypes/__pycache__/wintypes.cpython-38.opt-1.pyc000064400000011761151153537540015553 0ustar00U

e5d��@sddlZejZejZejZejZej	Z
ejZej
ZejZejZeZejZGdd�dej�ZejZejZejZejZejZZej Z!Z"ej#Z$Z%Z&ej#Z'Z(ej)Z*Z+ej,Z-Z.e�/ej�e�/ej,�kr�ejZ0ejZ1n$e�/ej�e�/ej,�kr�ej Z0ejZ1eZ2eZ3eZ4eZ5eZ6eZ7ej,Z8e8Z9e8Z:e8Z;e8Z<e8Z=e8Z>e8Z?e8Z@e8ZAe8ZBe8ZCe8ZDe8ZEe8ZFe8ZGe8ZHe8ZIe8ZJe8ZKe8ZLe8ZMe8ZNe8ZOe8ZPe8ZQe8ZRe8ZSe8ZTe8ZUe8ZVe8ZWGdd�dejX�ZYeYZZZ[Z\Gdd�dejX�Z]e]Z^Gdd	�d	ejX�Z_Gd
d�dejX�Z`e`ZaZbZcGdd
�d
ejX�ZdedZeZfdd�ZgGdd�dejX�ZhehZiGdd�dejX�ZjejZkdZlGdd�dejX�ZmGdd�dejX�Zne�oe�ZpZqe�oe�Zre�oe�ZsZte�oe�Zue�oe4�Zve�oe�ZwZxe�oeh�ZyZze�oe�Z{e�oe8�Z|Z}e�oeG�Z~e�oeH�Ze�oe�Z�Z�e�oe�Z�e�oe7�Z�e�oe�Z�Z�e�oej�Z�Z�e�oe`�Z�Z�e�oec�Z�e�oeY�Z�Z�e�oe\�Z�Z�e�oeV�Z�e�oe�Z�e�oed�Z�Z�e�oef�Z�Z�e�oe^�Z�e�oe�Z�Z�e�oe"�Z�e�oe�Z�e�oe�Z�e�oe
�Z�e�oem�Z�Z�e�oen�Z�Z�e�oe�Z�Z�dS)�Nc@seZdZdZdd�ZdS)�VARIANT_BOOL�vcCsd|jj|jfS)Nz%s(%r))�	__class__�__name__�value)�self�r�'/usr/lib64/python3.8/ctypes/wintypes.py�__repr__szVARIANT_BOOL.__repr__N)r�
__module__�__qualname__Z_type_r
rrrr	rsrc@s(eZdZdefdefdefdefgZdS)�RECT�left�top�rightZbottomN�rrr�LONG�_fields_rrrr	r
as
�r
c@s(eZdZdefdefdefdefgZdS)�_SMALL_RECTZLeftZTopZRightZBottomN�rrr�SHORTrrrrr	rhs
�rc@seZdZdefdefgZdS)�_COORD�X�YNrrrrr	ros�rc@seZdZdefdefgZdS)�POINT�x�yNrrrrr	rss�rc@seZdZdefdefgZdS)�SIZEZcxZcyNrrrrr	rxs�rcCs||d>|d>S)N��r)ZredZgreenZbluerrr	�RGB}sr c@seZdZdefdefgZdS)�FILETIMEZ
dwLowDateTimeZdwHighDateTimeN)rrr�DWORDrrrrr	r!�s�r!c@s4eZdZdefdefdefdefdefdefgZ	dS)�MSGZhWnd�messageZwParamZlParam�timeZptN)
rrr�HWND�UINT�WPARAM�LPARAMr"rrrrrr	r#�s�r#ic@sTeZdZdefdefdefdefdefdefdefdefd	eefd
edfg
ZdS)
�WIN32_FIND_DATAA�dwFileAttributes�ftCreationTime�ftLastAccessTime�ftLastWriteTime�
nFileSizeHigh�nFileSizeLow�dwReserved0�dwReserved1�	cFileName�cAlternateFileName�N)rrrr"r!�CHAR�MAX_PATHrrrrr	r*�s

�r*c@sTeZdZdefdefdefdefdefdefdefdefd	eefd
edfg
ZdS)
�WIN32_FIND_DATAWr+r,r-r.r/r0r1r2r3r4r5N)rrrr"r!�WCHARr7rrrrr	r8�s

�r8)�ZctypesZc_byteZBYTEZc_ushortZWORDZc_ulongr"Zc_charr6Zc_wcharr9Zc_uintr'Zc_intZINTZc_doubleZDOUBLEZc_floatZFLOATZBOOLEANZc_longZBOOLZ_SimpleCDatarZULONGrZUSHORTZc_shortrZ
c_longlongZ_LARGE_INTEGERZ
LARGE_INTEGERZc_ulonglongZ_ULARGE_INTEGERZULARGE_INTEGERZ	c_wchar_pZ	LPCOLESTRZLPOLESTRZOLESTRZLPCWSTRZLPWSTRZc_char_pZLPCSTRZLPSTRZc_void_pZLPCVOIDZLPVOIDZsizeofr(r)ZATOMZLANGIDZCOLORREFZLGRPIDZLCTYPEZLCIDZHANDLEZHACCELZHBITMAPZHBRUSHZHCOLORSPACEZHDCZHDESKZHDWPZHENHMETAFILEZHFONTZHGDIOBJZHGLOBALZHHOOKZHICONZ	HINSTANCEZHKEYZHKLZHLOCALZHMENUZ	HMETAFILEZHMODULEZHMONITORZHPALETTEZHPENZHRGNZHRSRCZHSTRZHTASKZHWINSTAr&Z	SC_HANDLEZSERVICE_STATUS_HANDLEZ	Structurer
ZtagRECTZ_RECTLZRECTLrZ
SMALL_RECTrrZtagPOINTZ_POINTLZPOINTLrZtagSIZEZSIZELr r!Z	_FILETIMEr#ZtagMSGr7r*r8ZPOINTERZLPBOOLZPBOOLZPBOOLEANZLPBYTEZPBYTEZPCHARZ
LPCOLORREFZLPDWORDZPDWORDZ
LPFILETIMEZ	PFILETIMEZPFLOATZLPHANDLEZPHANDLEZPHKEYZLPHKLZLPINTZPINTZPLARGE_INTEGERZPLCIDZLPLONGZPLONGZLPMSGZPMSGZLPPOINTZPPOINTZPPOINTLZLPRECTZPRECTZLPRECTLZPRECTLZLPSC_HANDLEZPSHORTZLPSIZEZPSIZEZLPSIZELZPSIZELZPSMALL_RECTZLPUINTZPUINTZPULARGE_INTEGERZPULONGZPUSHORTZPWCHARZLPWIN32_FIND_DATAAZPWIN32_FIND_DATAAZLPWIN32_FIND_DATAWZPWIN32_FIND_DATAWZLPWORDZPWORDrrrr	�<module>s�




















ctypes/_aix.py000064400000030427151153537540007364 0ustar00"""
Lib/ctypes.util.find_library() support for AIX
Similar approach as done for Darwin support by using separate files
but unlike Darwin - no extension such as ctypes.macholib.*

dlopen() is an interface to AIX initAndLoad() - primary documentation at:
https://www.ibm.com/support/knowledgecenter/en/ssw_aix_61/com.ibm.aix.basetrf1/dlopen.htm
https://www.ibm.com/support/knowledgecenter/en/ssw_aix_61/com.ibm.aix.basetrf1/load.htm

AIX supports two styles for dlopen(): svr4 (System V Release 4) which is common on posix
platforms, but also a BSD style - aka SVR3.

From AIX 5.3 Difference Addendum (December 2004)
2.9 SVR4 linking affinity
Nowadays, there are two major object file formats used by the operating systems:
XCOFF: The COFF enhanced by IBM and others. The original COFF (Common
Object File Format) was the base of SVR3 and BSD 4.2 systems.
ELF:   Executable and Linking Format that was developed by AT&T and is a
base for SVR4 UNIX.

While the shared library content is identical on AIX - one is located as a filepath name
(svr4 style) and the other is located as a member of an archive (and the archive
is located as a filepath name).

The key difference arises when supporting multiple abi formats (i.e., 32 and 64 bit).
For svr4 either only one ABI is supported, or there are two directories, or there
are different file names. The most common solution for multiple ABI is multiple
directories.

For the XCOFF (aka AIX) style - one directory (one archive file) is sufficient
as multiple shared libraries can be in the archive - even sharing the same name.
In documentation the archive is also referred to as the "base" and the shared
library object is referred to as the "member".

For dlopen() on AIX (read initAndLoad()) the calls are similar.
Default activity occurs when no path information is provided. When path
information is provided dlopen() does not search any other directories.

For SVR4 - the shared library name is the name of the file expected: libFOO.so
For AIX - the shared library is expressed as base(member). The search is for the
base (e.g., libFOO.a) and once the base is found the shared library - identified by
member (e.g., libFOO.so, or shr.o) is located and loaded.

The mode bit RTLD_MEMBER tells initAndLoad() that it needs to use the AIX (SVR3)
naming style.
"""
__author__ = "Michael Felt <aixtools@felt.demon.nl>"

import re
from os import environ, path
from sys import executable
from ctypes import c_void_p, sizeof
from subprocess import Popen, PIPE, DEVNULL

# Executable bit size - 32 or 64
# Used to filter the search in an archive by size, e.g., -X64
AIX_ABI = sizeof(c_void_p) * 8


from sys import maxsize
def _last_version(libnames, sep):
    def _num_version(libname):
        # "libxyz.so.MAJOR.MINOR" => [MAJOR, MINOR]
        parts = libname.split(sep)
        nums = []
        try:
            while parts:
                nums.insert(0, int(parts.pop()))
        except ValueError:
            pass
        return nums or [maxsize]
    return max(reversed(libnames), key=_num_version)

def get_ld_header(p):
    # "nested-function, but placed at module level
    ld_header = None
    for line in p.stdout:
        if line.startswith(('/', './', '../')):
            ld_header = line
        elif "INDEX" in line:
            return ld_header.rstrip('\n')
    return None

def get_ld_header_info(p):
    # "nested-function, but placed at module level
    # as an ld_header was found, return known paths, archives and members
    # these lines start with a digit
    info = []
    for line in p.stdout:
        if re.match("[0-9]", line):
            info.append(line)
        else:
            # blank line (separator), consume line and end for loop
            break
    return info

def get_ld_headers(file):
    """
    Parse the header of the loader section of executable and archives
    This function calls /usr/bin/dump -H as a subprocess
    and returns a list of (ld_header, ld_header_info) tuples.
    """
    # get_ld_headers parsing:
    # 1. Find a line that starts with /, ./, or ../ - set as ld_header
    # 2. If "INDEX" in occurs in a following line - return ld_header
    # 3. get info (lines starting with [0-9])
    ldr_headers = []
    p = Popen(["/usr/bin/dump", f"-X{AIX_ABI}", "-H", file],
        universal_newlines=True, stdout=PIPE, stderr=DEVNULL)
    # be sure to read to the end-of-file - getting all entries
    while True:
        ld_header = get_ld_header(p)
        if ld_header:
            ldr_headers.append((ld_header, get_ld_header_info(p)))
        else:
            break
    p.stdout.close()
    p.wait()
    return ldr_headers

def get_shared(ld_headers):
    """
    extract the shareable objects from ld_headers
    character "[" is used to strip off the path information.
    Note: the "[" and "]" characters that are part of dump -H output
    are not removed here.
    """
    shared = []
    for (line, _) in ld_headers:
        # potential member lines contain "["
        # otherwise, no processing needed
        if "[" in line:
            # Strip off trailing colon (:)
            shared.append(line[line.index("["):-1])
    return shared

def get_one_match(expr, lines):
    """
    Must be only one match, otherwise result is None.
    When there is a match, strip leading "[" and trailing "]"
    """
    # member names in the ld_headers output are between square brackets
    expr = rf'\[({expr})\]'
    matches = list(filter(None, (re.search(expr, line) for line in lines)))
    if len(matches) == 1:
        return matches[0].group(1)
    else:
        return None

# additional processing to deal with AIX legacy names for 64-bit members
def get_legacy(members):
    """
    This routine provides historical aka legacy naming schemes started
    in AIX4 shared library support for library members names.
    e.g., in /usr/lib/libc.a the member name shr.o for 32-bit binary and
    shr_64.o for 64-bit binary.
    """
    if AIX_ABI == 64:
        # AIX 64-bit member is one of shr64.o, shr_64.o, or shr4_64.o
        expr = r'shr4?_?64\.o'
        member = get_one_match(expr, members)
        if member:
            return member
    else:
        # 32-bit legacy names - both shr.o and shr4.o exist.
        # shr.o is the preffered name so we look for shr.o first
        #  i.e., shr4.o is returned only when shr.o does not exist
        for name in ['shr.o', 'shr4.o']:
            member = get_one_match(re.escape(name), members)
            if member:
                return member
    return None

def get_version(name, members):
    """
    Sort list of members and return highest numbered version - if it exists.
    This function is called when an unversioned libFOO.a(libFOO.so) has
    not been found.

    Versioning for the member name is expected to follow
    GNU LIBTOOL conventions: the highest version (x, then X.y, then X.Y.z)
     * find [libFoo.so.X]
     * find [libFoo.so.X.Y]
     * find [libFoo.so.X.Y.Z]

    Before the GNU convention became the standard scheme regardless of
    binary size AIX packagers used GNU convention "as-is" for 32-bit
    archive members but used an "distinguishing" name for 64-bit members.
    This scheme inserted either 64 or _64 between libFOO and .so
    - generally libFOO_64.so, but occasionally libFOO64.so
    """
    # the expression ending for versions must start as
    # '.so.[0-9]', i.e., *.so.[at least one digit]
    # while multiple, more specific expressions could be specified
    # to search for .so.X, .so.X.Y and .so.X.Y.Z
    # after the first required 'dot' digit
    # any combination of additional 'dot' digits pairs are accepted
    # anything more than libFOO.so.digits.digits.digits
    # should be seen as a member name outside normal expectations
    exprs = [rf'lib{name}\.so\.[0-9]+[0-9.]*',
        rf'lib{name}_?64\.so\.[0-9]+[0-9.]*']
    for expr in exprs:
        versions = []
        for line in members:
            m = re.search(expr, line)
            if m:
                versions.append(m.group(0))
        if versions:
            return _last_version(versions, '.')
    return None

def get_member(name, members):
    """
    Return an archive member matching the request in name.
    Name is the library name without any prefix like lib, suffix like .so,
    or version number.
    Given a list of members find and return the most appropriate result
    Priority is given to generic libXXX.so, then a versioned libXXX.so.a.b.c
    and finally, legacy AIX naming scheme.
    """
    # look first for a generic match - prepend lib and append .so
    expr = rf'lib{name}\.so'
    member = get_one_match(expr, members)
    if member:
        return member
    elif AIX_ABI == 64:
        expr = rf'lib{name}64\.so'
        member = get_one_match(expr, members)
    if member:
        return member
    # since an exact match with .so as suffix was not found
    # look for a versioned name
    # If a versioned name is not found, look for AIX legacy member name
    member = get_version(name, members)
    if member:
        return member
    else:
        return get_legacy(members)

def get_libpaths():
    """
    On AIX, the buildtime searchpath is stored in the executable.
    as "loader header information".
    The command /usr/bin/dump -H extracts this info.
    Prefix searched libraries with LD_LIBRARY_PATH (preferred),
    or LIBPATH if defined. These paths are appended to the paths
    to libraries the python executable is linked with.
    This mimics AIX dlopen() behavior.
    """
    libpaths = environ.get("LD_LIBRARY_PATH")
    if libpaths is None:
        libpaths = environ.get("LIBPATH")
    if libpaths is None:
        libpaths = []
    else:
        libpaths = libpaths.split(":")
    objects = get_ld_headers(executable)
    for (_, lines) in objects:
        for line in lines:
            # the second (optional) argument is PATH if it includes a /
            path = line.split()[1]
            if "/" in path:
                libpaths.extend(path.split(":"))
    return libpaths

def find_shared(paths, name):
    """
    paths is a list of directories to search for an archive.
    name is the abbreviated name given to find_library().
    Process: search "paths" for archive, and if an archive is found
    return the result of get_member().
    If an archive is not found then return None
    """
    for dir in paths:
        # /lib is a symbolic link to /usr/lib, skip it
        if dir == "/lib":
            continue
        # "lib" is prefixed to emulate compiler name resolution,
        # e.g., -lc to libc
        base = f'lib{name}.a'
        archive = path.join(dir, base)
        if path.exists(archive):
            members = get_shared(get_ld_headers(archive))
            member = get_member(re.escape(name), members)
            if member != None:
                return (base, member)
            else:
                return (None, None)
    return (None, None)

def find_library(name):
    """AIX implementation of ctypes.util.find_library()
    Find an archive member that will dlopen(). If not available,
    also search for a file (or link) with a .so suffix.

    AIX supports two types of schemes that can be used with dlopen().
    The so-called SystemV Release4 (svr4) format is commonly suffixed
    with .so while the (default) AIX scheme has the library (archive)
    ending with the suffix .a
    As an archive has multiple members (e.g., 32-bit and 64-bit) in one file
    the argument passed to dlopen must include both the library and
    the member names in a single string.

    find_library() looks first for an archive (.a) with a suitable member.
    If no archive+member pair is found, look for a .so file.
    """

    libpaths = get_libpaths()
    (base, member) = find_shared(libpaths, name)
    if base != None:
        return f"{base}({member})"

    # To get here, a member in an archive has not been found
    # In other words, either:
    # a) a .a file was not found
    # b) a .a file did not have a suitable member
    # So, look for a .so file
    # Check libpaths for .so file
    # Note, the installation must prepare a link from a .so
    # to a versioned file
    # This is common practice by GNU libtool on other platforms
    soname = f"lib{name}.so"
    for dir in libpaths:
        # /lib is a symbolic link to /usr/lib, skip it
        if dir == "/lib":
            continue
        shlib = path.join(dir, soname)
        if path.exists(shlib):
            return soname
    # if we are here, we have not found anything plausible
    return None
modulefinder.py000064400000057556151153537540007626 0ustar00"""Find modules used by a script, using introspection."""

import dis
import importlib._bootstrap_external
import importlib.machinery
import marshal
import os
import io
import sys
import types
import warnings


LOAD_CONST = dis.opmap['LOAD_CONST']
IMPORT_NAME = dis.opmap['IMPORT_NAME']
STORE_NAME = dis.opmap['STORE_NAME']
STORE_GLOBAL = dis.opmap['STORE_GLOBAL']
STORE_OPS = STORE_NAME, STORE_GLOBAL
EXTENDED_ARG = dis.EXTENDED_ARG

# Old imp constants:

_SEARCH_ERROR = 0
_PY_SOURCE = 1
_PY_COMPILED = 2
_C_EXTENSION = 3
_PKG_DIRECTORY = 5
_C_BUILTIN = 6
_PY_FROZEN = 7

# Modulefinder does a good job at simulating Python's, but it can not
# handle __path__ modifications packages make at runtime.  Therefore there
# is a mechanism whereby you can register extra paths in this map for a
# package, and it will be honored.

# Note this is a mapping is lists of paths.
packagePathMap = {}

# A Public interface
def AddPackagePath(packagename, path):
    packagePathMap.setdefault(packagename, []).append(path)

replacePackageMap = {}

# This ReplacePackage mechanism allows modulefinder to work around
# situations in which a package injects itself under the name
# of another package into sys.modules at runtime by calling
# ReplacePackage("real_package_name", "faked_package_name")
# before running ModuleFinder.

def ReplacePackage(oldname, newname):
    replacePackageMap[oldname] = newname


def _find_module(name, path=None):
    """An importlib reimplementation of imp.find_module (for our purposes)."""

    # It's necessary to clear the caches for our Finder first, in case any
    # modules are being added/deleted/modified at runtime. In particular,
    # test_modulefinder.py changes file tree contents in a cache-breaking way:

    importlib.machinery.PathFinder.invalidate_caches()

    spec = importlib.machinery.PathFinder.find_spec(name, path)

    if spec is None:
        raise ImportError("No module named {name!r}".format(name=name), name=name)

    # Some special cases:

    if spec.loader is importlib.machinery.BuiltinImporter:
        return None, None, ("", "", _C_BUILTIN)

    if spec.loader is importlib.machinery.FrozenImporter:
        return None, None, ("", "", _PY_FROZEN)

    file_path = spec.origin

    if spec.loader.is_package(name):
        return None, os.path.dirname(file_path), ("", "", _PKG_DIRECTORY)

    if isinstance(spec.loader, importlib.machinery.SourceFileLoader):
        kind = _PY_SOURCE

    elif isinstance(spec.loader, importlib.machinery.ExtensionFileLoader):
        kind = _C_EXTENSION

    elif isinstance(spec.loader, importlib.machinery.SourcelessFileLoader):
        kind = _PY_COMPILED

    else:  # Should never happen.
        return None, None, ("", "", _SEARCH_ERROR)

    file = io.open_code(file_path)
    suffix = os.path.splitext(file_path)[-1]

    return file, file_path, (suffix, "rb", kind)


class Module:

    def __init__(self, name, file=None, path=None):
        self.__name__ = name
        self.__file__ = file
        self.__path__ = path
        self.__code__ = None
        # The set of global names that are assigned to in the module.
        # This includes those names imported through starimports of
        # Python modules.
        self.globalnames = {}
        # The set of starimports this module did that could not be
        # resolved, ie. a starimport from a non-Python module.
        self.starimports = {}

    def __repr__(self):
        s = "Module(%r" % (self.__name__,)
        if self.__file__ is not None:
            s = s + ", %r" % (self.__file__,)
        if self.__path__ is not None:
            s = s + ", %r" % (self.__path__,)
        s = s + ")"
        return s

class ModuleFinder:

    def __init__(self, path=None, debug=0, excludes=None, replace_paths=None):
        if path is None:
            path = sys.path
        self.path = path
        self.modules = {}
        self.badmodules = {}
        self.debug = debug
        self.indent = 0
        self.excludes = excludes if excludes is not None else []
        self.replace_paths = replace_paths if replace_paths is not None else []
        self.processed_paths = []   # Used in debugging only

    def msg(self, level, str, *args):
        if level <= self.debug:
            for i in range(self.indent):
                print("   ", end=' ')
            print(str, end=' ')
            for arg in args:
                print(repr(arg), end=' ')
            print()

    def msgin(self, *args):
        level = args[0]
        if level <= self.debug:
            self.indent = self.indent + 1
            self.msg(*args)

    def msgout(self, *args):
        level = args[0]
        if level <= self.debug:
            self.indent = self.indent - 1
            self.msg(*args)

    def run_script(self, pathname):
        self.msg(2, "run_script", pathname)
        with io.open_code(pathname) as fp:
            stuff = ("", "rb", _PY_SOURCE)
            self.load_module('__main__', fp, pathname, stuff)

    def load_file(self, pathname):
        dir, name = os.path.split(pathname)
        name, ext = os.path.splitext(name)
        with io.open_code(pathname) as fp:
            stuff = (ext, "rb", _PY_SOURCE)
            self.load_module(name, fp, pathname, stuff)

    def import_hook(self, name, caller=None, fromlist=None, level=-1):
        self.msg(3, "import_hook", name, caller, fromlist, level)
        parent = self.determine_parent(caller, level=level)
        q, tail = self.find_head_package(parent, name)
        m = self.load_tail(q, tail)
        if not fromlist:
            return q
        if m.__path__:
            self.ensure_fromlist(m, fromlist)
        return None

    def determine_parent(self, caller, level=-1):
        self.msgin(4, "determine_parent", caller, level)
        if not caller or level == 0:
            self.msgout(4, "determine_parent -> None")
            return None
        pname = caller.__name__
        if level >= 1: # relative import
            if caller.__path__:
                level -= 1
            if level == 0:
                parent = self.modules[pname]
                assert parent is caller
                self.msgout(4, "determine_parent ->", parent)
                return parent
            if pname.count(".") < level:
                raise ImportError("relative importpath too deep")
            pname = ".".join(pname.split(".")[:-level])
            parent = self.modules[pname]
            self.msgout(4, "determine_parent ->", parent)
            return parent
        if caller.__path__:
            parent = self.modules[pname]
            assert caller is parent
            self.msgout(4, "determine_parent ->", parent)
            return parent
        if '.' in pname:
            i = pname.rfind('.')
            pname = pname[:i]
            parent = self.modules[pname]
            assert parent.__name__ == pname
            self.msgout(4, "determine_parent ->", parent)
            return parent
        self.msgout(4, "determine_parent -> None")
        return None

    def find_head_package(self, parent, name):
        self.msgin(4, "find_head_package", parent, name)
        if '.' in name:
            i = name.find('.')
            head = name[:i]
            tail = name[i+1:]
        else:
            head = name
            tail = ""
        if parent:
            qname = "%s.%s" % (parent.__name__, head)
        else:
            qname = head
        q = self.import_module(head, qname, parent)
        if q:
            self.msgout(4, "find_head_package ->", (q, tail))
            return q, tail
        if parent:
            qname = head
            parent = None
            q = self.import_module(head, qname, parent)
            if q:
                self.msgout(4, "find_head_package ->", (q, tail))
                return q, tail
        self.msgout(4, "raise ImportError: No module named", qname)
        raise ImportError("No module named " + qname)

    def load_tail(self, q, tail):
        self.msgin(4, "load_tail", q, tail)
        m = q
        while tail:
            i = tail.find('.')
            if i < 0: i = len(tail)
            head, tail = tail[:i], tail[i+1:]
            mname = "%s.%s" % (m.__name__, head)
            m = self.import_module(head, mname, m)
            if not m:
                self.msgout(4, "raise ImportError: No module named", mname)
                raise ImportError("No module named " + mname)
        self.msgout(4, "load_tail ->", m)
        return m

    def ensure_fromlist(self, m, fromlist, recursive=0):
        self.msg(4, "ensure_fromlist", m, fromlist, recursive)
        for sub in fromlist:
            if sub == "*":
                if not recursive:
                    all = self.find_all_submodules(m)
                    if all:
                        self.ensure_fromlist(m, all, 1)
            elif not hasattr(m, sub):
                subname = "%s.%s" % (m.__name__, sub)
                submod = self.import_module(sub, subname, m)
                if not submod:
                    raise ImportError("No module named " + subname)

    def find_all_submodules(self, m):
        if not m.__path__:
            return
        modules = {}
        # 'suffixes' used to be a list hardcoded to [".py", ".pyc"].
        # But we must also collect Python extension modules - although
        # we cannot separate normal dlls from Python extensions.
        suffixes = []
        suffixes += importlib.machinery.EXTENSION_SUFFIXES[:]
        suffixes += importlib.machinery.SOURCE_SUFFIXES[:]
        suffixes += importlib.machinery.BYTECODE_SUFFIXES[:]
        for dir in m.__path__:
            try:
                names = os.listdir(dir)
            except OSError:
                self.msg(2, "can't list directory", dir)
                continue
            for name in names:
                mod = None
                for suff in suffixes:
                    n = len(suff)
                    if name[-n:] == suff:
                        mod = name[:-n]
                        break
                if mod and mod != "__init__":
                    modules[mod] = mod
        return modules.keys()

    def import_module(self, partname, fqname, parent):
        self.msgin(3, "import_module", partname, fqname, parent)
        try:
            m = self.modules[fqname]
        except KeyError:
            pass
        else:
            self.msgout(3, "import_module ->", m)
            return m
        if fqname in self.badmodules:
            self.msgout(3, "import_module -> None")
            return None
        if parent and parent.__path__ is None:
            self.msgout(3, "import_module -> None")
            return None
        try:
            fp, pathname, stuff = self.find_module(partname,
                                                   parent and parent.__path__, parent)
        except ImportError:
            self.msgout(3, "import_module ->", None)
            return None

        try:
            m = self.load_module(fqname, fp, pathname, stuff)
        finally:
            if fp:
                fp.close()
        if parent:
            setattr(parent, partname, m)
        self.msgout(3, "import_module ->", m)
        return m

    def load_module(self, fqname, fp, pathname, file_info):
        suffix, mode, type = file_info
        self.msgin(2, "load_module", fqname, fp and "fp", pathname)
        if type == _PKG_DIRECTORY:
            m = self.load_package(fqname, pathname)
            self.msgout(2, "load_module ->", m)
            return m
        if type == _PY_SOURCE:
            co = compile(fp.read(), pathname, 'exec')
        elif type == _PY_COMPILED:
            try:
                data = fp.read()
                importlib._bootstrap_external._classify_pyc(data, fqname, {})
            except ImportError as exc:
                self.msgout(2, "raise ImportError: " + str(exc), pathname)
                raise
            co = marshal.loads(memoryview(data)[16:])
        else:
            co = None
        m = self.add_module(fqname)
        m.__file__ = pathname
        if co:
            if self.replace_paths:
                co = self.replace_paths_in_code(co)
            m.__code__ = co
            self.scan_code(co, m)
        self.msgout(2, "load_module ->", m)
        return m

    def _add_badmodule(self, name, caller):
        if name not in self.badmodules:
            self.badmodules[name] = {}
        if caller:
            self.badmodules[name][caller.__name__] = 1
        else:
            self.badmodules[name]["-"] = 1

    def _safe_import_hook(self, name, caller, fromlist, level=-1):
        # wrapper for self.import_hook() that won't raise ImportError
        if name in self.badmodules:
            self._add_badmodule(name, caller)
            return
        try:
            self.import_hook(name, caller, level=level)
        except ImportError as msg:
            self.msg(2, "ImportError:", str(msg))
            self._add_badmodule(name, caller)
        except SyntaxError as msg:
            self.msg(2, "SyntaxError:", str(msg))
            self._add_badmodule(name, caller)
        else:
            if fromlist:
                for sub in fromlist:
                    fullname = name + "." + sub
                    if fullname in self.badmodules:
                        self._add_badmodule(fullname, caller)
                        continue
                    try:
                        self.import_hook(name, caller, [sub], level=level)
                    except ImportError as msg:
                        self.msg(2, "ImportError:", str(msg))
                        self._add_badmodule(fullname, caller)

    def scan_opcodes(self, co):
        # Scan the code, and yield 'interesting' opcode combinations
        code = co.co_code
        names = co.co_names
        consts = co.co_consts
        opargs = [(op, arg) for _, op, arg in dis._unpack_opargs(code)
                  if op != EXTENDED_ARG]
        for i, (op, oparg) in enumerate(opargs):
            if op in STORE_OPS:
                yield "store", (names[oparg],)
                continue
            if (op == IMPORT_NAME and i >= 2
                    and opargs[i-1][0] == opargs[i-2][0] == LOAD_CONST):
                level = consts[opargs[i-2][1]]
                fromlist = consts[opargs[i-1][1]]
                if level == 0: # absolute import
                    yield "absolute_import", (fromlist, names[oparg])
                else: # relative import
                    yield "relative_import", (level, fromlist, names[oparg])
                continue

    def scan_code(self, co, m):
        code = co.co_code
        scanner = self.scan_opcodes
        for what, args in scanner(co):
            if what == "store":
                name, = args
                m.globalnames[name] = 1
            elif what == "absolute_import":
                fromlist, name = args
                have_star = 0
                if fromlist is not None:
                    if "*" in fromlist:
                        have_star = 1
                    fromlist = [f for f in fromlist if f != "*"]
                self._safe_import_hook(name, m, fromlist, level=0)
                if have_star:
                    # We've encountered an "import *". If it is a Python module,
                    # the code has already been parsed and we can suck out the
                    # global names.
                    mm = None
                    if m.__path__:
                        # At this point we don't know whether 'name' is a
                        # submodule of 'm' or a global module. Let's just try
                        # the full name first.
                        mm = self.modules.get(m.__name__ + "." + name)
                    if mm is None:
                        mm = self.modules.get(name)
                    if mm is not None:
                        m.globalnames.update(mm.globalnames)
                        m.starimports.update(mm.starimports)
                        if mm.__code__ is None:
                            m.starimports[name] = 1
                    else:
                        m.starimports[name] = 1
            elif what == "relative_import":
                level, fromlist, name = args
                if name:
                    self._safe_import_hook(name, m, fromlist, level=level)
                else:
                    parent = self.determine_parent(m, level=level)
                    self._safe_import_hook(parent.__name__, None, fromlist, level=0)
            else:
                # We don't expect anything else from the generator.
                raise RuntimeError(what)

        for c in co.co_consts:
            if isinstance(c, type(co)):
                self.scan_code(c, m)

    def load_package(self, fqname, pathname):
        self.msgin(2, "load_package", fqname, pathname)
        newname = replacePackageMap.get(fqname)
        if newname:
            fqname = newname
        m = self.add_module(fqname)
        m.__file__ = pathname
        m.__path__ = [pathname]

        # As per comment at top of file, simulate runtime __path__ additions.
        m.__path__ = m.__path__ + packagePathMap.get(fqname, [])

        fp, buf, stuff = self.find_module("__init__", m.__path__)
        try:
            self.load_module(fqname, fp, buf, stuff)
            self.msgout(2, "load_package ->", m)
            return m
        finally:
            if fp:
                fp.close()

    def add_module(self, fqname):
        if fqname in self.modules:
            return self.modules[fqname]
        self.modules[fqname] = m = Module(fqname)
        return m

    def find_module(self, name, path, parent=None):
        if parent is not None:
            # assert path is not None
            fullname = parent.__name__+'.'+name
        else:
            fullname = name
        if fullname in self.excludes:
            self.msgout(3, "find_module -> Excluded", fullname)
            raise ImportError(name)

        if path is None:
            if name in sys.builtin_module_names:
                return (None, None, ("", "", _C_BUILTIN))

            path = self.path

        return _find_module(name, path)

    def report(self):
        """Print a report to stdout, listing the found modules with their
        paths, as well as modules that are missing, or seem to be missing.
        """
        print()
        print("  %-25s %s" % ("Name", "File"))
        print("  %-25s %s" % ("----", "----"))
        # Print modules found
        keys = sorted(self.modules.keys())
        for key in keys:
            m = self.modules[key]
            if m.__path__:
                print("P", end=' ')
            else:
                print("m", end=' ')
            print("%-25s" % key, m.__file__ or "")

        # Print missing modules
        missing, maybe = self.any_missing_maybe()
        if missing:
            print()
            print("Missing modules:")
            for name in missing:
                mods = sorted(self.badmodules[name].keys())
                print("?", name, "imported from", ', '.join(mods))
        # Print modules that may be missing, but then again, maybe not...
        if maybe:
            print()
            print("Submodules that appear to be missing, but could also be", end=' ')
            print("global names in the parent package:")
            for name in maybe:
                mods = sorted(self.badmodules[name].keys())
                print("?", name, "imported from", ', '.join(mods))

    def any_missing(self):
        """Return a list of modules that appear to be missing. Use
        any_missing_maybe() if you want to know which modules are
        certain to be missing, and which *may* be missing.
        """
        missing, maybe = self.any_missing_maybe()
        return missing + maybe

    def any_missing_maybe(self):
        """Return two lists, one with modules that are certainly missing
        and one with modules that *may* be missing. The latter names could
        either be submodules *or* just global names in the package.

        The reason it can't always be determined is that it's impossible to
        tell which names are imported when "from module import *" is done
        with an extension module, short of actually importing it.
        """
        missing = []
        maybe = []
        for name in self.badmodules:
            if name in self.excludes:
                continue
            i = name.rfind(".")
            if i < 0:
                missing.append(name)
                continue
            subname = name[i+1:]
            pkgname = name[:i]
            pkg = self.modules.get(pkgname)
            if pkg is not None:
                if pkgname in self.badmodules[name]:
                    # The package tried to import this module itself and
                    # failed. It's definitely missing.
                    missing.append(name)
                elif subname in pkg.globalnames:
                    # It's a global in the package: definitely not missing.
                    pass
                elif pkg.starimports:
                    # It could be missing, but the package did an "import *"
                    # from a non-Python module, so we simply can't be sure.
                    maybe.append(name)
                else:
                    # It's not a global in the package, the package didn't
                    # do funny star imports, it's very likely to be missing.
                    # The symbol could be inserted into the package from the
                    # outside, but since that's not good style we simply list
                    # it missing.
                    missing.append(name)
            else:
                missing.append(name)
        missing.sort()
        maybe.sort()
        return missing, maybe

    def replace_paths_in_code(self, co):
        new_filename = original_filename = os.path.normpath(co.co_filename)
        for f, r in self.replace_paths:
            if original_filename.startswith(f):
                new_filename = r + original_filename[len(f):]
                break

        if self.debug and original_filename not in self.processed_paths:
            if new_filename != original_filename:
                self.msgout(2, "co_filename %r changed to %r" \
                                    % (original_filename,new_filename,))
            else:
                self.msgout(2, "co_filename %r remains unchanged" \
                                    % (original_filename,))
            self.processed_paths.append(original_filename)

        consts = list(co.co_consts)
        for i in range(len(consts)):
            if isinstance(consts[i], type(co)):
                consts[i] = self.replace_paths_in_code(consts[i])

        return co.replace(co_consts=tuple(consts), co_filename=new_filename)


def test():
    # Parse command line
    import getopt
    try:
        opts, args = getopt.getopt(sys.argv[1:], "dmp:qx:")
    except getopt.error as msg:
        print(msg)
        return

    # Process options
    debug = 1
    domods = 0
    addpath = []
    exclude = []
    for o, a in opts:
        if o == '-d':
            debug = debug + 1
        if o == '-m':
            domods = 1
        if o == '-p':
            addpath = addpath + a.split(os.pathsep)
        if o == '-q':
            debug = 0
        if o == '-x':
            exclude.append(a)

    # Provide default arguments
    if not args:
        script = "hello.py"
    else:
        script = args[0]

    # Set the path based on sys.path and the script directory
    path = sys.path[:]
    path[0] = os.path.dirname(script)
    path = addpath + path
    if debug > 1:
        print("path:")
        for item in path:
            print("   ", repr(item))

    # Create the module finder and turn its crank
    mf = ModuleFinder(path, debug, exclude)
    for arg in args[1:]:
        if arg == '-m':
            domods = 1
            continue
        if domods:
            if arg[-2:] == '.*':
                mf.import_hook(arg[:-2], None, ["*"])
            else:
                mf.import_hook(arg)
        else:
            mf.load_file(arg)
    mf.run_script(script)
    mf.report()
    return mf  # for -i debugging


if __name__ == '__main__':
    try:
        mf = test()
    except KeyboardInterrupt:
        print("\n[interrupted]")
dataclasses.py000064400000141465151153537540007431 0ustar00import re
import sys
import copy
import types
import inspect
import keyword
import builtins
import functools
import _thread


__all__ = ['dataclass',
           'field',
           'Field',
           'FrozenInstanceError',
           'InitVar',
           'MISSING',

           # Helper functions.
           'fields',
           'asdict',
           'astuple',
           'make_dataclass',
           'replace',
           'is_dataclass',
           ]

# Conditions for adding methods.  The boxes indicate what action the
# dataclass decorator takes.  For all of these tables, when I talk
# about init=, repr=, eq=, order=, unsafe_hash=, or frozen=, I'm
# referring to the arguments to the @dataclass decorator.  When
# checking if a dunder method already exists, I mean check for an
# entry in the class's __dict__.  I never check to see if an attribute
# is defined in a base class.

# Key:
# +=========+=========================================+
# + Value   | Meaning                                 |
# +=========+=========================================+
# | <blank> | No action: no method is added.          |
# +---------+-----------------------------------------+
# | add     | Generated method is added.              |
# +---------+-----------------------------------------+
# | raise   | TypeError is raised.                    |
# +---------+-----------------------------------------+
# | None    | Attribute is set to None.               |
# +=========+=========================================+

# __init__
#
#   +--- init= parameter
#   |
#   v     |       |       |
#         |  no   |  yes  |  <--- class has __init__ in __dict__?
# +=======+=======+=======+
# | False |       |       |
# +-------+-------+-------+
# | True  | add   |       |  <- the default
# +=======+=======+=======+

# __repr__
#
#    +--- repr= parameter
#    |
#    v    |       |       |
#         |  no   |  yes  |  <--- class has __repr__ in __dict__?
# +=======+=======+=======+
# | False |       |       |
# +-------+-------+-------+
# | True  | add   |       |  <- the default
# +=======+=======+=======+


# __setattr__
# __delattr__
#
#    +--- frozen= parameter
#    |
#    v    |       |       |
#         |  no   |  yes  |  <--- class has __setattr__ or __delattr__ in __dict__?
# +=======+=======+=======+
# | False |       |       |  <- the default
# +-------+-------+-------+
# | True  | add   | raise |
# +=======+=======+=======+
# Raise because not adding these methods would break the "frozen-ness"
# of the class.

# __eq__
#
#    +--- eq= parameter
#    |
#    v    |       |       |
#         |  no   |  yes  |  <--- class has __eq__ in __dict__?
# +=======+=======+=======+
# | False |       |       |
# +-------+-------+-------+
# | True  | add   |       |  <- the default
# +=======+=======+=======+

# __lt__
# __le__
# __gt__
# __ge__
#
#    +--- order= parameter
#    |
#    v    |       |       |
#         |  no   |  yes  |  <--- class has any comparison method in __dict__?
# +=======+=======+=======+
# | False |       |       |  <- the default
# +-------+-------+-------+
# | True  | add   | raise |
# +=======+=======+=======+
# Raise because to allow this case would interfere with using
# functools.total_ordering.

# __hash__

#    +------------------- unsafe_hash= parameter
#    |       +----------- eq= parameter
#    |       |       +--- frozen= parameter
#    |       |       |
#    v       v       v    |        |        |
#                         |   no   |  yes   |  <--- class has explicitly defined __hash__
# +=======+=======+=======+========+========+
# | False | False | False |        |        | No __eq__, use the base class __hash__
# +-------+-------+-------+--------+--------+
# | False | False | True  |        |        | No __eq__, use the base class __hash__
# +-------+-------+-------+--------+--------+
# | False | True  | False | None   |        | <-- the default, not hashable
# +-------+-------+-------+--------+--------+
# | False | True  | True  | add    |        | Frozen, so hashable, allows override
# +-------+-------+-------+--------+--------+
# | True  | False | False | add    | raise  | Has no __eq__, but hashable
# +-------+-------+-------+--------+--------+
# | True  | False | True  | add    | raise  | Has no __eq__, but hashable
# +-------+-------+-------+--------+--------+
# | True  | True  | False | add    | raise  | Not frozen, but hashable
# +-------+-------+-------+--------+--------+
# | True  | True  | True  | add    | raise  | Frozen, so hashable
# +=======+=======+=======+========+========+
# For boxes that are blank, __hash__ is untouched and therefore
# inherited from the base class.  If the base is object, then
# id-based hashing is used.
#
# Note that a class may already have __hash__=None if it specified an
# __eq__ method in the class body (not one that was created by
# @dataclass).
#
# See _hash_action (below) for a coded version of this table.


# Raised when an attempt is made to modify a frozen class.
class FrozenInstanceError(AttributeError): pass

# A sentinel object for default values to signal that a default
# factory will be used.  This is given a nice repr() which will appear
# in the function signature of dataclasses' constructors.
class _HAS_DEFAULT_FACTORY_CLASS:
    def __repr__(self):
        return '<factory>'
_HAS_DEFAULT_FACTORY = _HAS_DEFAULT_FACTORY_CLASS()

# A sentinel object to detect if a parameter is supplied or not.  Use
# a class to give it a better repr.
class _MISSING_TYPE:
    pass
MISSING = _MISSING_TYPE()

# Since most per-field metadata will be unused, create an empty
# read-only proxy that can be shared among all fields.
_EMPTY_METADATA = types.MappingProxyType({})

# Markers for the various kinds of fields and pseudo-fields.
class _FIELD_BASE:
    def __init__(self, name):
        self.name = name
    def __repr__(self):
        return self.name
_FIELD = _FIELD_BASE('_FIELD')
_FIELD_CLASSVAR = _FIELD_BASE('_FIELD_CLASSVAR')
_FIELD_INITVAR = _FIELD_BASE('_FIELD_INITVAR')

# The name of an attribute on the class where we store the Field
# objects.  Also used to check if a class is a Data Class.
_FIELDS = '__dataclass_fields__'

# The name of an attribute on the class that stores the parameters to
# @dataclass.
_PARAMS = '__dataclass_params__'

# The name of the function, that if it exists, is called at the end of
# __init__.
_POST_INIT_NAME = '__post_init__'

# String regex that string annotations for ClassVar or InitVar must match.
# Allows "identifier.identifier[" or "identifier[".
# https://bugs.python.org/issue33453 for details.
_MODULE_IDENTIFIER_RE = re.compile(r'^(?:\s*(\w+)\s*\.)?\s*(\w+)')

class _InitVarMeta(type):
    def __getitem__(self, params):
        return InitVar(params)

class InitVar(metaclass=_InitVarMeta):
    __slots__ = ('type', )

    def __init__(self, type):
        self.type = type

    def __repr__(self):
        if isinstance(self.type, type):
            type_name = self.type.__name__
        else:
            # typing objects, e.g. List[int]
            type_name = repr(self.type)
        return f'dataclasses.InitVar[{type_name}]'


# Instances of Field are only ever created from within this module,
# and only from the field() function, although Field instances are
# exposed externally as (conceptually) read-only objects.
#
# name and type are filled in after the fact, not in __init__.
# They're not known at the time this class is instantiated, but it's
# convenient if they're available later.
#
# When cls._FIELDS is filled in with a list of Field objects, the name
# and type fields will have been populated.
class Field:
    __slots__ = ('name',
                 'type',
                 'default',
                 'default_factory',
                 'repr',
                 'hash',
                 'init',
                 'compare',
                 'metadata',
                 '_field_type',  # Private: not to be used by user code.
                 )

    def __init__(self, default, default_factory, init, repr, hash, compare,
                 metadata):
        self.name = None
        self.type = None
        self.default = default
        self.default_factory = default_factory
        self.init = init
        self.repr = repr
        self.hash = hash
        self.compare = compare
        self.metadata = (_EMPTY_METADATA
                         if metadata is None else
                         types.MappingProxyType(metadata))
        self._field_type = None

    def __repr__(self):
        return ('Field('
                f'name={self.name!r},'
                f'type={self.type!r},'
                f'default={self.default!r},'
                f'default_factory={self.default_factory!r},'
                f'init={self.init!r},'
                f'repr={self.repr!r},'
                f'hash={self.hash!r},'
                f'compare={self.compare!r},'
                f'metadata={self.metadata!r},'
                f'_field_type={self._field_type}'
                ')')

    # This is used to support the PEP 487 __set_name__ protocol in the
    # case where we're using a field that contains a descriptor as a
    # default value.  For details on __set_name__, see
    # https://www.python.org/dev/peps/pep-0487/#implementation-details.
    #
    # Note that in _process_class, this Field object is overwritten
    # with the default value, so the end result is a descriptor that
    # had __set_name__ called on it at the right time.
    def __set_name__(self, owner, name):
        func = getattr(type(self.default), '__set_name__', None)
        if func:
            # There is a __set_name__ method on the descriptor, call
            # it.
            func(self.default, owner, name)


class _DataclassParams:
    __slots__ = ('init',
                 'repr',
                 'eq',
                 'order',
                 'unsafe_hash',
                 'frozen',
                 )

    def __init__(self, init, repr, eq, order, unsafe_hash, frozen):
        self.init = init
        self.repr = repr
        self.eq = eq
        self.order = order
        self.unsafe_hash = unsafe_hash
        self.frozen = frozen

    def __repr__(self):
        return ('_DataclassParams('
                f'init={self.init!r},'
                f'repr={self.repr!r},'
                f'eq={self.eq!r},'
                f'order={self.order!r},'
                f'unsafe_hash={self.unsafe_hash!r},'
                f'frozen={self.frozen!r}'
                ')')


# This function is used instead of exposing Field creation directly,
# so that a type checker can be told (via overloads) that this is a
# function whose type depends on its parameters.
def field(*, default=MISSING, default_factory=MISSING, init=True, repr=True,
          hash=None, compare=True, metadata=None):
    """Return an object to identify dataclass fields.

    default is the default value of the field.  default_factory is a
    0-argument function called to initialize a field's value.  If init
    is True, the field will be a parameter to the class's __init__()
    function.  If repr is True, the field will be included in the
    object's repr().  If hash is True, the field will be included in
    the object's hash().  If compare is True, the field will be used
    in comparison functions.  metadata, if specified, must be a
    mapping which is stored but not otherwise examined by dataclass.

    It is an error to specify both default and default_factory.
    """

    if default is not MISSING and default_factory is not MISSING:
        raise ValueError('cannot specify both default and default_factory')
    return Field(default, default_factory, init, repr, hash, compare,
                 metadata)


def _tuple_str(obj_name, fields):
    # Return a string representing each field of obj_name as a tuple
    # member.  So, if fields is ['x', 'y'] and obj_name is "self",
    # return "(self.x,self.y)".

    # Special case for the 0-tuple.
    if not fields:
        return '()'
    # Note the trailing comma, needed if this turns out to be a 1-tuple.
    return f'({",".join([f"{obj_name}.{f.name}" for f in fields])},)'


# This function's logic is copied from "recursive_repr" function in
# reprlib module to avoid dependency.
def _recursive_repr(user_function):
    # Decorator to make a repr function return "..." for a recursive
    # call.
    repr_running = set()

    @functools.wraps(user_function)
    def wrapper(self):
        key = id(self), _thread.get_ident()
        if key in repr_running:
            return '...'
        repr_running.add(key)
        try:
            result = user_function(self)
        finally:
            repr_running.discard(key)
        return result
    return wrapper


def _create_fn(name, args, body, *, globals=None, locals=None,
               return_type=MISSING):
    # Note that we mutate locals when exec() is called.  Caller
    # beware!  The only callers are internal to this module, so no
    # worries about external callers.
    if locals is None:
        locals = {}
    if 'BUILTINS' not in locals:
        locals['BUILTINS'] = builtins
    return_annotation = ''
    if return_type is not MISSING:
        locals['_return_type'] = return_type
        return_annotation = '->_return_type'
    args = ','.join(args)
    body = '\n'.join(f'  {b}' for b in body)

    # Compute the text of the entire function.
    txt = f' def {name}({args}){return_annotation}:\n{body}'

    local_vars = ', '.join(locals.keys())
    txt = f"def __create_fn__({local_vars}):\n{txt}\n return {name}"

    ns = {}
    exec(txt, globals, ns)
    return ns['__create_fn__'](**locals)


def _field_assign(frozen, name, value, self_name):
    # If we're a frozen class, then assign to our fields in __init__
    # via object.__setattr__.  Otherwise, just use a simple
    # assignment.
    #
    # self_name is what "self" is called in this function: don't
    # hard-code "self", since that might be a field name.
    if frozen:
        return f'BUILTINS.object.__setattr__({self_name},{name!r},{value})'
    return f'{self_name}.{name}={value}'


def _field_init(f, frozen, globals, self_name):
    # Return the text of the line in the body of __init__ that will
    # initialize this field.

    default_name = f'_dflt_{f.name}'
    if f.default_factory is not MISSING:
        if f.init:
            # This field has a default factory.  If a parameter is
            # given, use it.  If not, call the factory.
            globals[default_name] = f.default_factory
            value = (f'{default_name}() '
                     f'if {f.name} is _HAS_DEFAULT_FACTORY '
                     f'else {f.name}')
        else:
            # This is a field that's not in the __init__ params, but
            # has a default factory function.  It needs to be
            # initialized here by calling the factory function,
            # because there's no other way to initialize it.

            # For a field initialized with a default=defaultvalue, the
            # class dict just has the default value
            # (cls.fieldname=defaultvalue).  But that won't work for a
            # default factory, the factory must be called in __init__
            # and we must assign that to self.fieldname.  We can't
            # fall back to the class dict's value, both because it's
            # not set, and because it might be different per-class
            # (which, after all, is why we have a factory function!).

            globals[default_name] = f.default_factory
            value = f'{default_name}()'
    else:
        # No default factory.
        if f.init:
            if f.default is MISSING:
                # There's no default, just do an assignment.
                value = f.name
            elif f.default is not MISSING:
                globals[default_name] = f.default
                value = f.name
        else:
            # This field does not need initialization.  Signify that
            # to the caller by returning None.
            return None

    # Only test this now, so that we can create variables for the
    # default.  However, return None to signify that we're not going
    # to actually do the assignment statement for InitVars.
    if f._field_type is _FIELD_INITVAR:
        return None

    # Now, actually generate the field assignment.
    return _field_assign(frozen, f.name, value, self_name)


def _init_param(f):
    # Return the __init__ parameter string for this field.  For
    # example, the equivalent of 'x:int=3' (except instead of 'int',
    # reference a variable set to int, and instead of '3', reference a
    # variable set to 3).
    if f.default is MISSING and f.default_factory is MISSING:
        # There's no default, and no default_factory, just output the
        # variable name and type.
        default = ''
    elif f.default is not MISSING:
        # There's a default, this will be the name that's used to look
        # it up.
        default = f'=_dflt_{f.name}'
    elif f.default_factory is not MISSING:
        # There's a factory function.  Set a marker.
        default = '=_HAS_DEFAULT_FACTORY'
    return f'{f.name}:_type_{f.name}{default}'


def _init_fn(fields, frozen, has_post_init, self_name, globals):
    # fields contains both real fields and InitVar pseudo-fields.

    # Make sure we don't have fields without defaults following fields
    # with defaults.  This actually would be caught when exec-ing the
    # function source code, but catching it here gives a better error
    # message, and future-proofs us in case we build up the function
    # using ast.
    seen_default = False
    for f in fields:
        # Only consider fields in the __init__ call.
        if f.init:
            if not (f.default is MISSING and f.default_factory is MISSING):
                seen_default = True
            elif seen_default:
                raise TypeError(f'non-default argument {f.name!r} '
                                'follows default argument')

    locals = {f'_type_{f.name}': f.type for f in fields}
    locals.update({
        'MISSING': MISSING,
        '_HAS_DEFAULT_FACTORY': _HAS_DEFAULT_FACTORY,
    })

    body_lines = []
    for f in fields:
        line = _field_init(f, frozen, locals, self_name)
        # line is None means that this field doesn't require
        # initialization (it's a pseudo-field).  Just skip it.
        if line:
            body_lines.append(line)

    # Does this class have a post-init function?
    if has_post_init:
        params_str = ','.join(f.name for f in fields
                              if f._field_type is _FIELD_INITVAR)
        body_lines.append(f'{self_name}.{_POST_INIT_NAME}({params_str})')

    # If no body lines, use 'pass'.
    if not body_lines:
        body_lines = ['pass']

    return _create_fn('__init__',
                      [self_name] + [_init_param(f) for f in fields if f.init],
                      body_lines,
                      locals=locals,
                      globals=globals,
                      return_type=None)


def _repr_fn(fields, globals):
    fn = _create_fn('__repr__',
                    ('self',),
                    ['return self.__class__.__qualname__ + f"(' +
                     ', '.join([f"{f.name}={{self.{f.name}!r}}"
                                for f in fields]) +
                     ')"'],
                     globals=globals)
    return _recursive_repr(fn)


def _frozen_get_del_attr(cls, fields, globals):
    locals = {'cls': cls,
              'FrozenInstanceError': FrozenInstanceError}
    if fields:
        fields_str = '(' + ','.join(repr(f.name) for f in fields) + ',)'
    else:
        # Special case for the zero-length tuple.
        fields_str = '()'
    return (_create_fn('__setattr__',
                      ('self', 'name', 'value'),
                      (f'if type(self) is cls or name in {fields_str}:',
                        ' raise FrozenInstanceError(f"cannot assign to field {name!r}")',
                       f'super(cls, self).__setattr__(name, value)'),
                       locals=locals,
                       globals=globals),
            _create_fn('__delattr__',
                      ('self', 'name'),
                      (f'if type(self) is cls or name in {fields_str}:',
                        ' raise FrozenInstanceError(f"cannot delete field {name!r}")',
                       f'super(cls, self).__delattr__(name)'),
                       locals=locals,
                       globals=globals),
            )


def _cmp_fn(name, op, self_tuple, other_tuple, globals):
    # Create a comparison function.  If the fields in the object are
    # named 'x' and 'y', then self_tuple is the string
    # '(self.x,self.y)' and other_tuple is the string
    # '(other.x,other.y)'.

    return _create_fn(name,
                      ('self', 'other'),
                      [ 'if other.__class__ is self.__class__:',
                       f' return {self_tuple}{op}{other_tuple}',
                        'return NotImplemented'],
                      globals=globals)


def _hash_fn(fields, globals):
    self_tuple = _tuple_str('self', fields)
    return _create_fn('__hash__',
                      ('self',),
                      [f'return hash({self_tuple})'],
                      globals=globals)


def _is_classvar(a_type, typing):
    # This test uses a typing internal class, but it's the best way to
    # test if this is a ClassVar.
    return (a_type is typing.ClassVar
            or (type(a_type) is typing._GenericAlias
                and a_type.__origin__ is typing.ClassVar))


def _is_initvar(a_type, dataclasses):
    # The module we're checking against is the module we're
    # currently in (dataclasses.py).
    return (a_type is dataclasses.InitVar
            or type(a_type) is dataclasses.InitVar)


def _is_type(annotation, cls, a_module, a_type, is_type_predicate):
    # Given a type annotation string, does it refer to a_type in
    # a_module?  For example, when checking that annotation denotes a
    # ClassVar, then a_module is typing, and a_type is
    # typing.ClassVar.

    # It's possible to look up a_module given a_type, but it involves
    # looking in sys.modules (again!), and seems like a waste since
    # the caller already knows a_module.

    # - annotation is a string type annotation
    # - cls is the class that this annotation was found in
    # - a_module is the module we want to match
    # - a_type is the type in that module we want to match
    # - is_type_predicate is a function called with (obj, a_module)
    #   that determines if obj is of the desired type.

    # Since this test does not do a local namespace lookup (and
    # instead only a module (global) lookup), there are some things it
    # gets wrong.

    # With string annotations, cv0 will be detected as a ClassVar:
    #   CV = ClassVar
    #   @dataclass
    #   class C0:
    #     cv0: CV

    # But in this example cv1 will not be detected as a ClassVar:
    #   @dataclass
    #   class C1:
    #     CV = ClassVar
    #     cv1: CV

    # In C1, the code in this function (_is_type) will look up "CV" in
    # the module and not find it, so it will not consider cv1 as a
    # ClassVar.  This is a fairly obscure corner case, and the best
    # way to fix it would be to eval() the string "CV" with the
    # correct global and local namespaces.  However that would involve
    # a eval() penalty for every single field of every dataclass
    # that's defined.  It was judged not worth it.

    match = _MODULE_IDENTIFIER_RE.match(annotation)
    if match:
        ns = None
        module_name = match.group(1)
        if not module_name:
            # No module name, assume the class's module did
            # "from dataclasses import InitVar".
            ns = sys.modules.get(cls.__module__).__dict__
        else:
            # Look up module_name in the class's module.
            module = sys.modules.get(cls.__module__)
            if module and module.__dict__.get(module_name) is a_module:
                ns = sys.modules.get(a_type.__module__).__dict__
        if ns and is_type_predicate(ns.get(match.group(2)), a_module):
            return True
    return False


def _get_field(cls, a_name, a_type):
    # Return a Field object for this field name and type.  ClassVars
    # and InitVars are also returned, but marked as such (see
    # f._field_type).

    # If the default value isn't derived from Field, then it's only a
    # normal default value.  Convert it to a Field().
    default = getattr(cls, a_name, MISSING)
    if isinstance(default, Field):
        f = default
    else:
        if isinstance(default, types.MemberDescriptorType):
            # This is a field in __slots__, so it has no default value.
            default = MISSING
        f = field(default=default)

    # Only at this point do we know the name and the type.  Set them.
    f.name = a_name
    f.type = a_type

    # Assume it's a normal field until proven otherwise.  We're next
    # going to decide if it's a ClassVar or InitVar, everything else
    # is just a normal field.
    f._field_type = _FIELD

    # In addition to checking for actual types here, also check for
    # string annotations.  get_type_hints() won't always work for us
    # (see https://github.com/python/typing/issues/508 for example),
    # plus it's expensive and would require an eval for every string
    # annotation.  So, make a best effort to see if this is a ClassVar
    # or InitVar using regex's and checking that the thing referenced
    # is actually of the correct type.

    # For the complete discussion, see https://bugs.python.org/issue33453

    # If typing has not been imported, then it's impossible for any
    # annotation to be a ClassVar.  So, only look for ClassVar if
    # typing has been imported by any module (not necessarily cls's
    # module).
    typing = sys.modules.get('typing')
    if typing:
        if (_is_classvar(a_type, typing)
            or (isinstance(f.type, str)
                and _is_type(f.type, cls, typing, typing.ClassVar,
                             _is_classvar))):
            f._field_type = _FIELD_CLASSVAR

    # If the type is InitVar, or if it's a matching string annotation,
    # then it's an InitVar.
    if f._field_type is _FIELD:
        # The module we're checking against is the module we're
        # currently in (dataclasses.py).
        dataclasses = sys.modules[__name__]
        if (_is_initvar(a_type, dataclasses)
            or (isinstance(f.type, str)
                and _is_type(f.type, cls, dataclasses, dataclasses.InitVar,
                             _is_initvar))):
            f._field_type = _FIELD_INITVAR

    # Validations for individual fields.  This is delayed until now,
    # instead of in the Field() constructor, since only here do we
    # know the field name, which allows for better error reporting.

    # Special restrictions for ClassVar and InitVar.
    if f._field_type in (_FIELD_CLASSVAR, _FIELD_INITVAR):
        if f.default_factory is not MISSING:
            raise TypeError(f'field {f.name} cannot have a '
                            'default factory')
        # Should I check for other field settings? default_factory
        # seems the most serious to check for.  Maybe add others.  For
        # example, how about init=False (or really,
        # init=<not-the-default-init-value>)?  It makes no sense for
        # ClassVar and InitVar to specify init=<anything>.

    # For real fields, disallow mutable defaults for known types.
    if f._field_type is _FIELD and isinstance(f.default, (list, dict, set)):
        raise ValueError(f'mutable default {type(f.default)} for field '
                         f'{f.name} is not allowed: use default_factory')

    return f


def _set_new_attribute(cls, name, value):
    # Never overwrites an existing attribute.  Returns True if the
    # attribute already exists.
    if name in cls.__dict__:
        return True
    setattr(cls, name, value)
    return False


# Decide if/how we're going to create a hash function.  Key is
# (unsafe_hash, eq, frozen, does-hash-exist).  Value is the action to
# take.  The common case is to do nothing, so instead of providing a
# function that is a no-op, use None to signify that.

def _hash_set_none(cls, fields, globals):
    return None

def _hash_add(cls, fields, globals):
    flds = [f for f in fields if (f.compare if f.hash is None else f.hash)]
    return _hash_fn(flds, globals)

def _hash_exception(cls, fields, globals):
    # Raise an exception.
    raise TypeError(f'Cannot overwrite attribute __hash__ '
                    f'in class {cls.__name__}')

#
#                +-------------------------------------- unsafe_hash?
#                |      +------------------------------- eq?
#                |      |      +------------------------ frozen?
#                |      |      |      +----------------  has-explicit-hash?
#                |      |      |      |
#                |      |      |      |        +-------  action
#                |      |      |      |        |
#                v      v      v      v        v
_hash_action = {(False, False, False, False): None,
                (False, False, False, True ): None,
                (False, False, True,  False): None,
                (False, False, True,  True ): None,
                (False, True,  False, False): _hash_set_none,
                (False, True,  False, True ): None,
                (False, True,  True,  False): _hash_add,
                (False, True,  True,  True ): None,
                (True,  False, False, False): _hash_add,
                (True,  False, False, True ): _hash_exception,
                (True,  False, True,  False): _hash_add,
                (True,  False, True,  True ): _hash_exception,
                (True,  True,  False, False): _hash_add,
                (True,  True,  False, True ): _hash_exception,
                (True,  True,  True,  False): _hash_add,
                (True,  True,  True,  True ): _hash_exception,
                }
# See https://bugs.python.org/issue32929#msg312829 for an if-statement
# version of this table.


def _process_class(cls, init, repr, eq, order, unsafe_hash, frozen):
    # Now that dicts retain insertion order, there's no reason to use
    # an ordered dict.  I am leveraging that ordering here, because
    # derived class fields overwrite base class fields, but the order
    # is defined by the base class, which is found first.
    fields = {}

    if cls.__module__ in sys.modules:
        globals = sys.modules[cls.__module__].__dict__
    else:
        # Theoretically this can happen if someone writes
        # a custom string to cls.__module__.  In which case
        # such dataclass won't be fully introspectable
        # (w.r.t. typing.get_type_hints) but will still function
        # correctly.
        globals = {}

    setattr(cls, _PARAMS, _DataclassParams(init, repr, eq, order,
                                           unsafe_hash, frozen))

    # Find our base classes in reverse MRO order, and exclude
    # ourselves.  In reversed order so that more derived classes
    # override earlier field definitions in base classes.  As long as
    # we're iterating over them, see if any are frozen.
    any_frozen_base = False
    has_dataclass_bases = False
    for b in cls.__mro__[-1:0:-1]:
        # Only process classes that have been processed by our
        # decorator.  That is, they have a _FIELDS attribute.
        base_fields = getattr(b, _FIELDS, None)
        if base_fields is not None:
            has_dataclass_bases = True
            for f in base_fields.values():
                fields[f.name] = f
            if getattr(b, _PARAMS).frozen:
                any_frozen_base = True

    # Annotations that are defined in this class (not in base
    # classes).  If __annotations__ isn't present, then this class
    # adds no new annotations.  We use this to compute fields that are
    # added by this class.
    #
    # Fields are found from cls_annotations, which is guaranteed to be
    # ordered.  Default values are from class attributes, if a field
    # has a default.  If the default value is a Field(), then it
    # contains additional info beyond (and possibly including) the
    # actual default value.  Pseudo-fields ClassVars and InitVars are
    # included, despite the fact that they're not real fields.  That's
    # dealt with later.
    cls_annotations = cls.__dict__.get('__annotations__', {})

    # Now find fields in our class.  While doing so, validate some
    # things, and set the default values (as class attributes) where
    # we can.
    cls_fields = [_get_field(cls, name, type)
                  for name, type in cls_annotations.items()]
    for f in cls_fields:
        fields[f.name] = f

        # If the class attribute (which is the default value for this
        # field) exists and is of type 'Field', replace it with the
        # real default.  This is so that normal class introspection
        # sees a real default value, not a Field.
        if isinstance(getattr(cls, f.name, None), Field):
            if f.default is MISSING:
                # If there's no default, delete the class attribute.
                # This happens if we specify field(repr=False), for
                # example (that is, we specified a field object, but
                # no default value).  Also if we're using a default
                # factory.  The class attribute should not be set at
                # all in the post-processed class.
                delattr(cls, f.name)
            else:
                setattr(cls, f.name, f.default)

    # Do we have any Field members that don't also have annotations?
    for name, value in cls.__dict__.items():
        if isinstance(value, Field) and not name in cls_annotations:
            raise TypeError(f'{name!r} is a field but has no type annotation')

    # Check rules that apply if we are derived from any dataclasses.
    if has_dataclass_bases:
        # Raise an exception if any of our bases are frozen, but we're not.
        if any_frozen_base and not frozen:
            raise TypeError('cannot inherit non-frozen dataclass from a '
                            'frozen one')

        # Raise an exception if we're frozen, but none of our bases are.
        if not any_frozen_base and frozen:
            raise TypeError('cannot inherit frozen dataclass from a '
                            'non-frozen one')

    # Remember all of the fields on our class (including bases).  This
    # also marks this class as being a dataclass.
    setattr(cls, _FIELDS, fields)

    # Was this class defined with an explicit __hash__?  Note that if
    # __eq__ is defined in this class, then python will automatically
    # set __hash__ to None.  This is a heuristic, as it's possible
    # that such a __hash__ == None was not auto-generated, but it
    # close enough.
    class_hash = cls.__dict__.get('__hash__', MISSING)
    has_explicit_hash = not (class_hash is MISSING or
                             (class_hash is None and '__eq__' in cls.__dict__))

    # If we're generating ordering methods, we must be generating the
    # eq methods.
    if order and not eq:
        raise ValueError('eq must be true if order is true')

    if init:
        # Does this class have a post-init function?
        has_post_init = hasattr(cls, _POST_INIT_NAME)

        # Include InitVars and regular fields (so, not ClassVars).
        flds = [f for f in fields.values()
                if f._field_type in (_FIELD, _FIELD_INITVAR)]
        _set_new_attribute(cls, '__init__',
                           _init_fn(flds,
                                    frozen,
                                    has_post_init,
                                    # The name to use for the "self"
                                    # param in __init__.  Use "self"
                                    # if possible.
                                    '__dataclass_self__' if 'self' in fields
                                            else 'self',
                                    globals,
                          ))

    # Get the fields as a list, and include only real fields.  This is
    # used in all of the following methods.
    field_list = [f for f in fields.values() if f._field_type is _FIELD]

    if repr:
        flds = [f for f in field_list if f.repr]
        _set_new_attribute(cls, '__repr__', _repr_fn(flds, globals))

    if eq:
        # Create _eq__ method.  There's no need for a __ne__ method,
        # since python will call __eq__ and negate it.
        flds = [f for f in field_list if f.compare]
        self_tuple = _tuple_str('self', flds)
        other_tuple = _tuple_str('other', flds)
        _set_new_attribute(cls, '__eq__',
                           _cmp_fn('__eq__', '==',
                                   self_tuple, other_tuple,
                                   globals=globals))

    if order:
        # Create and set the ordering methods.
        flds = [f for f in field_list if f.compare]
        self_tuple = _tuple_str('self', flds)
        other_tuple = _tuple_str('other', flds)
        for name, op in [('__lt__', '<'),
                         ('__le__', '<='),
                         ('__gt__', '>'),
                         ('__ge__', '>='),
                         ]:
            if _set_new_attribute(cls, name,
                                  _cmp_fn(name, op, self_tuple, other_tuple,
                                          globals=globals)):
                raise TypeError(f'Cannot overwrite attribute {name} '
                                f'in class {cls.__name__}. Consider using '
                                'functools.total_ordering')

    if frozen:
        for fn in _frozen_get_del_attr(cls, field_list, globals):
            if _set_new_attribute(cls, fn.__name__, fn):
                raise TypeError(f'Cannot overwrite attribute {fn.__name__} '
                                f'in class {cls.__name__}')

    # Decide if/how we're going to create a hash function.
    hash_action = _hash_action[bool(unsafe_hash),
                               bool(eq),
                               bool(frozen),
                               has_explicit_hash]
    if hash_action:
        # No need to call _set_new_attribute here, since by the time
        # we're here the overwriting is unconditional.
        cls.__hash__ = hash_action(cls, field_list, globals)

    if not getattr(cls, '__doc__'):
        # Create a class doc-string.
        cls.__doc__ = (cls.__name__ +
                       str(inspect.signature(cls)).replace(' -> None', ''))

    return cls


def dataclass(cls=None, /, *, init=True, repr=True, eq=True, order=False,
              unsafe_hash=False, frozen=False):
    """Returns the same class as was passed in, with dunder methods
    added based on the fields defined in the class.

    Examines PEP 526 __annotations__ to determine fields.

    If init is true, an __init__() method is added to the class. If
    repr is true, a __repr__() method is added. If order is true, rich
    comparison dunder methods are added. If unsafe_hash is true, a
    __hash__() method function is added. If frozen is true, fields may
    not be assigned to after instance creation.
    """

    def wrap(cls):
        return _process_class(cls, init, repr, eq, order, unsafe_hash, frozen)

    # See if we're being called as @dataclass or @dataclass().
    if cls is None:
        # We're called with parens.
        return wrap

    # We're called as @dataclass without parens.
    return wrap(cls)


def fields(class_or_instance):
    """Return a tuple describing the fields of this dataclass.

    Accepts a dataclass or an instance of one. Tuple elements are of
    type Field.
    """

    # Might it be worth caching this, per class?
    try:
        fields = getattr(class_or_instance, _FIELDS)
    except AttributeError:
        raise TypeError('must be called with a dataclass type or instance')

    # Exclude pseudo-fields.  Note that fields is sorted by insertion
    # order, so the order of the tuple is as the fields were defined.
    return tuple(f for f in fields.values() if f._field_type is _FIELD)


def _is_dataclass_instance(obj):
    """Returns True if obj is an instance of a dataclass."""
    return hasattr(type(obj), _FIELDS)


def is_dataclass(obj):
    """Returns True if obj is a dataclass or an instance of a
    dataclass."""
    cls = obj if isinstance(obj, type) else type(obj)
    return hasattr(cls, _FIELDS)


def asdict(obj, *, dict_factory=dict):
    """Return the fields of a dataclass instance as a new dictionary mapping
    field names to field values.

    Example usage:

      @dataclass
      class C:
          x: int
          y: int

      c = C(1, 2)
      assert asdict(c) == {'x': 1, 'y': 2}

    If given, 'dict_factory' will be used instead of built-in dict.
    The function applies recursively to field values that are
    dataclass instances. This will also look into built-in containers:
    tuples, lists, and dicts.
    """
    if not _is_dataclass_instance(obj):
        raise TypeError("asdict() should be called on dataclass instances")
    return _asdict_inner(obj, dict_factory)


def _asdict_inner(obj, dict_factory):
    if _is_dataclass_instance(obj):
        result = []
        for f in fields(obj):
            value = _asdict_inner(getattr(obj, f.name), dict_factory)
            result.append((f.name, value))
        return dict_factory(result)
    elif isinstance(obj, tuple) and hasattr(obj, '_fields'):
        # obj is a namedtuple.  Recurse into it, but the returned
        # object is another namedtuple of the same type.  This is
        # similar to how other list- or tuple-derived classes are
        # treated (see below), but we just need to create them
        # differently because a namedtuple's __init__ needs to be
        # called differently (see bpo-34363).

        # I'm not using namedtuple's _asdict()
        # method, because:
        # - it does not recurse in to the namedtuple fields and
        #   convert them to dicts (using dict_factory).
        # - I don't actually want to return a dict here.  The main
        #   use case here is json.dumps, and it handles converting
        #   namedtuples to lists.  Admittedly we're losing some
        #   information here when we produce a json list instead of a
        #   dict.  Note that if we returned dicts here instead of
        #   namedtuples, we could no longer call asdict() on a data
        #   structure where a namedtuple was used as a dict key.

        return type(obj)(*[_asdict_inner(v, dict_factory) for v in obj])
    elif isinstance(obj, (list, tuple)):
        # Assume we can create an object of this type by passing in a
        # generator (which is not true for namedtuples, handled
        # above).
        return type(obj)(_asdict_inner(v, dict_factory) for v in obj)
    elif isinstance(obj, dict):
        return type(obj)((_asdict_inner(k, dict_factory),
                          _asdict_inner(v, dict_factory))
                         for k, v in obj.items())
    else:
        return copy.deepcopy(obj)


def astuple(obj, *, tuple_factory=tuple):
    """Return the fields of a dataclass instance as a new tuple of field values.

    Example usage::

      @dataclass
      class C:
          x: int
          y: int

    c = C(1, 2)
    assert astuple(c) == (1, 2)

    If given, 'tuple_factory' will be used instead of built-in tuple.
    The function applies recursively to field values that are
    dataclass instances. This will also look into built-in containers:
    tuples, lists, and dicts.
    """

    if not _is_dataclass_instance(obj):
        raise TypeError("astuple() should be called on dataclass instances")
    return _astuple_inner(obj, tuple_factory)


def _astuple_inner(obj, tuple_factory):
    if _is_dataclass_instance(obj):
        result = []
        for f in fields(obj):
            value = _astuple_inner(getattr(obj, f.name), tuple_factory)
            result.append(value)
        return tuple_factory(result)
    elif isinstance(obj, tuple) and hasattr(obj, '_fields'):
        # obj is a namedtuple.  Recurse into it, but the returned
        # object is another namedtuple of the same type.  This is
        # similar to how other list- or tuple-derived classes are
        # treated (see below), but we just need to create them
        # differently because a namedtuple's __init__ needs to be
        # called differently (see bpo-34363).
        return type(obj)(*[_astuple_inner(v, tuple_factory) for v in obj])
    elif isinstance(obj, (list, tuple)):
        # Assume we can create an object of this type by passing in a
        # generator (which is not true for namedtuples, handled
        # above).
        return type(obj)(_astuple_inner(v, tuple_factory) for v in obj)
    elif isinstance(obj, dict):
        return type(obj)((_astuple_inner(k, tuple_factory), _astuple_inner(v, tuple_factory))
                          for k, v in obj.items())
    else:
        return copy.deepcopy(obj)


def make_dataclass(cls_name, fields, *, bases=(), namespace=None, init=True,
                   repr=True, eq=True, order=False, unsafe_hash=False,
                   frozen=False):
    """Return a new dynamically created dataclass.

    The dataclass name will be 'cls_name'.  'fields' is an iterable
    of either (name), (name, type) or (name, type, Field) objects. If type is
    omitted, use the string 'typing.Any'.  Field objects are created by
    the equivalent of calling 'field(name, type [, Field-info])'.

      C = make_dataclass('C', ['x', ('y', int), ('z', int, field(init=False))], bases=(Base,))

    is equivalent to:

      @dataclass
      class C(Base):
          x: 'typing.Any'
          y: int
          z: int = field(init=False)

    For the bases and namespace parameters, see the builtin type() function.

    The parameters init, repr, eq, order, unsafe_hash, and frozen are passed to
    dataclass().
    """

    if namespace is None:
        namespace = {}
    else:
        # Copy namespace since we're going to mutate it.
        namespace = namespace.copy()

    # While we're looking through the field names, validate that they
    # are identifiers, are not keywords, and not duplicates.
    seen = set()
    anns = {}
    for item in fields:
        if isinstance(item, str):
            name = item
            tp = 'typing.Any'
        elif len(item) == 2:
            name, tp, = item
        elif len(item) == 3:
            name, tp, spec = item
            namespace[name] = spec
        else:
            raise TypeError(f'Invalid field: {item!r}')

        if not isinstance(name, str) or not name.isidentifier():
            raise TypeError(f'Field names must be valid identifiers: {name!r}')
        if keyword.iskeyword(name):
            raise TypeError(f'Field names must not be keywords: {name!r}')
        if name in seen:
            raise TypeError(f'Field name duplicated: {name!r}')

        seen.add(name)
        anns[name] = tp

    namespace['__annotations__'] = anns
    # We use `types.new_class()` instead of simply `type()` to allow dynamic creation
    # of generic dataclassses.
    cls = types.new_class(cls_name, bases, {}, lambda ns: ns.update(namespace))
    return dataclass(cls, init=init, repr=repr, eq=eq, order=order,
                     unsafe_hash=unsafe_hash, frozen=frozen)


def replace(*args, **changes):
    """Return a new object replacing specified fields with new values.

    This is especially useful for frozen classes.  Example usage:

      @dataclass(frozen=True)
      class C:
          x: int
          y: int

      c = C(1, 2)
      c1 = replace(c, x=3)
      assert c1.x == 3 and c1.y == 2
      """
    if len(args) > 1:
        raise TypeError(f'replace() takes 1 positional argument but {len(args)} were given')
    if args:
        obj, = args
    elif 'obj' in changes:
        obj = changes.pop('obj')
        import warnings
        warnings.warn("Passing 'obj' as keyword argument is deprecated",
                      DeprecationWarning, stacklevel=2)
    else:
        raise TypeError("replace() missing 1 required positional argument: 'obj'")

    # We're going to mutate 'changes', but that's okay because it's a
    # new dict, even if called with 'replace(obj, **my_changes)'.

    if not _is_dataclass_instance(obj):
        raise TypeError("replace() should be called on dataclass instances")

    # It's an error to have init=False fields in 'changes'.
    # If a field is not in 'changes', read its value from the provided obj.

    for f in getattr(obj, _FIELDS).values():
        # Only consider normal fields or InitVars.
        if f._field_type is _FIELD_CLASSVAR:
            continue

        if not f.init:
            # Error if this field is specified in changes.
            if f.name in changes:
                raise ValueError(f'field {f.name} is declared with '
                                 'init=False, it cannot be specified with '
                                 'replace()')
            continue

        if f.name not in changes:
            if f._field_type is _FIELD_INITVAR and f.default is MISSING:
                raise ValueError(f"InitVar {f.name!r} "
                                 'must be specified with replace()')
            changes[f.name] = getattr(obj, f.name)

    # Create the new object, which calls __init__() and
    # __post_init__() (if defined), using all of the init fields we've
    # added and/or left in 'changes'.  If there are values supplied in
    # changes that aren't fields, this will correctly raise a
    # TypeError.
    return obj.__class__(**changes)
replace.__text_signature__ = '(obj, /, **kwargs)'
site-packages/README.txt000064400000000167151153537540010777 0ustar00This directory exists so that 3rd party packages can be installed
here.  Read the source for site.py for more details.
_weakrefset.py000064400000013147151153537540007434 0ustar00# Access WeakSet through the weakref module.
# This code is separated-out because it is needed
# by abc.py to load everything else at startup.

from _weakref import ref

__all__ = ['WeakSet']


class _IterationGuard:
    # This context manager registers itself in the current iterators of the
    # weak container, such as to delay all removals until the context manager
    # exits.
    # This technique should be relatively thread-safe (since sets are).

    def __init__(self, weakcontainer):
        # Don't create cycles
        self.weakcontainer = ref(weakcontainer)

    def __enter__(self):
        w = self.weakcontainer()
        if w is not None:
            w._iterating.add(self)
        return self

    def __exit__(self, e, t, b):
        w = self.weakcontainer()
        if w is not None:
            s = w._iterating
            s.remove(self)
            if not s:
                w._commit_removals()


class WeakSet:
    def __init__(self, data=None):
        self.data = set()
        def _remove(item, selfref=ref(self)):
            self = selfref()
            if self is not None:
                if self._iterating:
                    self._pending_removals.append(item)
                else:
                    self.data.discard(item)
        self._remove = _remove
        # A list of keys to be removed
        self._pending_removals = []
        self._iterating = set()
        if data is not None:
            self.update(data)

    def _commit_removals(self):
        l = self._pending_removals
        discard = self.data.discard
        while l:
            discard(l.pop())

    def __iter__(self):
        with _IterationGuard(self):
            for itemref in self.data:
                item = itemref()
                if item is not None:
                    # Caveat: the iterator will keep a strong reference to
                    # `item` until it is resumed or closed.
                    yield item

    def __len__(self):
        return len(self.data) - len(self._pending_removals)

    def __contains__(self, item):
        try:
            wr = ref(item)
        except TypeError:
            return False
        return wr in self.data

    def __reduce__(self):
        return (self.__class__, (list(self),),
                getattr(self, '__dict__', None))

    def add(self, item):
        if self._pending_removals:
            self._commit_removals()
        self.data.add(ref(item, self._remove))

    def clear(self):
        if self._pending_removals:
            self._commit_removals()
        self.data.clear()

    def copy(self):
        return self.__class__(self)

    def pop(self):
        if self._pending_removals:
            self._commit_removals()
        while True:
            try:
                itemref = self.data.pop()
            except KeyError:
                raise KeyError('pop from empty WeakSet') from None
            item = itemref()
            if item is not None:
                return item

    def remove(self, item):
        if self._pending_removals:
            self._commit_removals()
        self.data.remove(ref(item))

    def discard(self, item):
        if self._pending_removals:
            self._commit_removals()
        self.data.discard(ref(item))

    def update(self, other):
        if self._pending_removals:
            self._commit_removals()
        for element in other:
            self.add(element)

    def __ior__(self, other):
        self.update(other)
        return self

    def difference(self, other):
        newset = self.copy()
        newset.difference_update(other)
        return newset
    __sub__ = difference

    def difference_update(self, other):
        self.__isub__(other)
    def __isub__(self, other):
        if self._pending_removals:
            self._commit_removals()
        if self is other:
            self.data.clear()
        else:
            self.data.difference_update(ref(item) for item in other)
        return self

    def intersection(self, other):
        return self.__class__(item for item in other if item in self)
    __and__ = intersection

    def intersection_update(self, other):
        self.__iand__(other)
    def __iand__(self, other):
        if self._pending_removals:
            self._commit_removals()
        self.data.intersection_update(ref(item) for item in other)
        return self

    def issubset(self, other):
        return self.data.issubset(ref(item) for item in other)
    __le__ = issubset

    def __lt__(self, other):
        return self.data < set(map(ref, other))

    def issuperset(self, other):
        return self.data.issuperset(ref(item) for item in other)
    __ge__ = issuperset

    def __gt__(self, other):
        return self.data > set(map(ref, other))

    def __eq__(self, other):
        if not isinstance(other, self.__class__):
            return NotImplemented
        return self.data == set(map(ref, other))

    def symmetric_difference(self, other):
        newset = self.copy()
        newset.symmetric_difference_update(other)
        return newset
    __xor__ = symmetric_difference

    def symmetric_difference_update(self, other):
        self.__ixor__(other)
    def __ixor__(self, other):
        if self._pending_removals:
            self._commit_removals()
        if self is other:
            self.data.clear()
        else:
            self.data.symmetric_difference_update(ref(item, self._remove) for item in other)
        return self

    def union(self, other):
        return self.__class__(e for s in (self, other) for e in s)
    __or__ = union

    def isdisjoint(self, other):
        return len(self.intersection(other)) == 0

    def __repr__(self):
        return repr(self.data)
sunau.py000064400000043707151153537540006275 0ustar00"""Stuff to parse Sun and NeXT audio files.

An audio file consists of a header followed by the data.  The structure
of the header is as follows.

        +---------------+
        | magic word    |
        +---------------+
        | header size   |
        +---------------+
        | data size     |
        +---------------+
        | encoding      |
        +---------------+
        | sample rate   |
        +---------------+
        | # of channels |
        +---------------+
        | info          |
        |               |
        +---------------+

The magic word consists of the 4 characters '.snd'.  Apart from the
info field, all header fields are 4 bytes in size.  They are all
32-bit unsigned integers encoded in big-endian byte order.

The header size really gives the start of the data.
The data size is the physical size of the data.  From the other
parameters the number of frames can be calculated.
The encoding gives the way in which audio samples are encoded.
Possible values are listed below.
The info field currently consists of an ASCII string giving a
human-readable description of the audio file.  The info field is
padded with NUL bytes to the header size.

Usage.

Reading audio files:
        f = sunau.open(file, 'r')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods read(), seek(), and close().
When the setpos() and rewind() methods are not used, the seek()
method is not  necessary.

This returns an instance of a class with the following public methods:
        getnchannels()  -- returns number of audio channels (1 for
                           mono, 2 for stereo)
        getsampwidth()  -- returns sample width in bytes
        getframerate()  -- returns sampling frequency
        getnframes()    -- returns number of audio frames
        getcomptype()   -- returns compression type ('NONE' or 'ULAW')
        getcompname()   -- returns human-readable version of
                           compression type ('not compressed' matches 'NONE')
        getparams()     -- returns a namedtuple consisting of all of the
                           above in the above order
        getmarkers()    -- returns None (for compatibility with the
                           aifc module)
        getmark(id)     -- raises an error since the mark does not
                           exist (for compatibility with the aifc module)
        readframes(n)   -- returns at most n frames of audio
        rewind()        -- rewind to the beginning of the audio stream
        setpos(pos)     -- seek to the specified position
        tell()          -- return the current position
        close()         -- close the instance (make it unusable)
The position returned by tell() and the position given to setpos()
are compatible and have nothing to do with the actual position in the
file.
The close() method is called automatically when the class instance
is destroyed.

Writing audio files:
        f = sunau.open(file, 'w')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods write(), tell(), seek(), and
close().

This returns an instance of a class with the following public methods:
        setnchannels(n) -- set the number of channels
        setsampwidth(n) -- set the sample width
        setframerate(n) -- set the frame rate
        setnframes(n)   -- set the number of frames
        setcomptype(type, name)
                        -- set the compression type and the
                           human-readable compression type
        setparams(tuple)-- set all parameters at once
        tell()          -- return current position in output file
        writeframesraw(data)
                        -- write audio frames without pathing up the
                           file header
        writeframes(data)
                        -- write audio frames and patch up the file header
        close()         -- patch up the file header and close the
                           output file
You should set the parameters before the first writeframesraw or
writeframes.  The total number of frames does not need to be set,
but when it is set to the correct value, the header does not have to
be patched up.
It is best to first set all parameters, perhaps possibly the
compression type, and then write audio frames using writeframesraw.
When all frames have been written, either call writeframes(b'') or
close() to patch up the sizes in the header.
The close() method is called automatically when the class instance
is destroyed.
"""

from collections import namedtuple
import warnings

_sunau_params = namedtuple('_sunau_params',
                           'nchannels sampwidth framerate nframes comptype compname')

# from <multimedia/audio_filehdr.h>
AUDIO_FILE_MAGIC = 0x2e736e64
AUDIO_FILE_ENCODING_MULAW_8 = 1
AUDIO_FILE_ENCODING_LINEAR_8 = 2
AUDIO_FILE_ENCODING_LINEAR_16 = 3
AUDIO_FILE_ENCODING_LINEAR_24 = 4
AUDIO_FILE_ENCODING_LINEAR_32 = 5
AUDIO_FILE_ENCODING_FLOAT = 6
AUDIO_FILE_ENCODING_DOUBLE = 7
AUDIO_FILE_ENCODING_ADPCM_G721 = 23
AUDIO_FILE_ENCODING_ADPCM_G722 = 24
AUDIO_FILE_ENCODING_ADPCM_G723_3 = 25
AUDIO_FILE_ENCODING_ADPCM_G723_5 = 26
AUDIO_FILE_ENCODING_ALAW_8 = 27

# from <multimedia/audio_hdr.h>
AUDIO_UNKNOWN_SIZE = 0xFFFFFFFF        # ((unsigned)(~0))

_simple_encodings = [AUDIO_FILE_ENCODING_MULAW_8,
                     AUDIO_FILE_ENCODING_LINEAR_8,
                     AUDIO_FILE_ENCODING_LINEAR_16,
                     AUDIO_FILE_ENCODING_LINEAR_24,
                     AUDIO_FILE_ENCODING_LINEAR_32,
                     AUDIO_FILE_ENCODING_ALAW_8]

class Error(Exception):
    pass

def _read_u32(file):
    x = 0
    for i in range(4):
        byte = file.read(1)
        if not byte:
            raise EOFError
        x = x*256 + ord(byte)
    return x

def _write_u32(file, x):
    data = []
    for i in range(4):
        d, m = divmod(x, 256)
        data.insert(0, int(m))
        x = d
    file.write(bytes(data))

class Au_read:

    def __init__(self, f):
        if type(f) == type(''):
            import builtins
            f = builtins.open(f, 'rb')
            self._opened = True
        else:
            self._opened = False
        self.initfp(f)

    def __del__(self):
        if self._file:
            self.close()

    def __enter__(self):
        return self

    def __exit__(self, *args):
        self.close()

    def initfp(self, file):
        self._file = file
        self._soundpos = 0
        magic = int(_read_u32(file))
        if magic != AUDIO_FILE_MAGIC:
            raise Error('bad magic number')
        self._hdr_size = int(_read_u32(file))
        if self._hdr_size < 24:
            raise Error('header size too small')
        if self._hdr_size > 100:
            raise Error('header size ridiculously large')
        self._data_size = _read_u32(file)
        if self._data_size != AUDIO_UNKNOWN_SIZE:
            self._data_size = int(self._data_size)
        self._encoding = int(_read_u32(file))
        if self._encoding not in _simple_encodings:
            raise Error('encoding not (yet) supported')
        if self._encoding in (AUDIO_FILE_ENCODING_MULAW_8,
                  AUDIO_FILE_ENCODING_ALAW_8):
            self._sampwidth = 2
            self._framesize = 1
        elif self._encoding == AUDIO_FILE_ENCODING_LINEAR_8:
            self._framesize = self._sampwidth = 1
        elif self._encoding == AUDIO_FILE_ENCODING_LINEAR_16:
            self._framesize = self._sampwidth = 2
        elif self._encoding == AUDIO_FILE_ENCODING_LINEAR_24:
            self._framesize = self._sampwidth = 3
        elif self._encoding == AUDIO_FILE_ENCODING_LINEAR_32:
            self._framesize = self._sampwidth = 4
        else:
            raise Error('unknown encoding')
        self._framerate = int(_read_u32(file))
        self._nchannels = int(_read_u32(file))
        if not self._nchannels:
            raise Error('bad # of channels')
        self._framesize = self._framesize * self._nchannels
        if self._hdr_size > 24:
            self._info = file.read(self._hdr_size - 24)
            self._info, _, _ = self._info.partition(b'\0')
        else:
            self._info = b''
        try:
            self._data_pos = file.tell()
        except (AttributeError, OSError):
            self._data_pos = None

    def getfp(self):
        return self._file

    def getnchannels(self):
        return self._nchannels

    def getsampwidth(self):
        return self._sampwidth

    def getframerate(self):
        return self._framerate

    def getnframes(self):
        if self._data_size == AUDIO_UNKNOWN_SIZE:
            return AUDIO_UNKNOWN_SIZE
        if self._encoding in _simple_encodings:
            return self._data_size // self._framesize
        return 0                # XXX--must do some arithmetic here

    def getcomptype(self):
        if self._encoding == AUDIO_FILE_ENCODING_MULAW_8:
            return 'ULAW'
        elif self._encoding == AUDIO_FILE_ENCODING_ALAW_8:
            return 'ALAW'
        else:
            return 'NONE'

    def getcompname(self):
        if self._encoding == AUDIO_FILE_ENCODING_MULAW_8:
            return 'CCITT G.711 u-law'
        elif self._encoding == AUDIO_FILE_ENCODING_ALAW_8:
            return 'CCITT G.711 A-law'
        else:
            return 'not compressed'

    def getparams(self):
        return _sunau_params(self.getnchannels(), self.getsampwidth(),
                  self.getframerate(), self.getnframes(),
                  self.getcomptype(), self.getcompname())

    def getmarkers(self):
        return None

    def getmark(self, id):
        raise Error('no marks')

    def readframes(self, nframes):
        if self._encoding in _simple_encodings:
            if nframes == AUDIO_UNKNOWN_SIZE:
                data = self._file.read()
            else:
                data = self._file.read(nframes * self._framesize)
            self._soundpos += len(data) // self._framesize
            if self._encoding == AUDIO_FILE_ENCODING_MULAW_8:
                import audioop
                data = audioop.ulaw2lin(data, self._sampwidth)
            return data
        return None             # XXX--not implemented yet

    def rewind(self):
        if self._data_pos is None:
            raise OSError('cannot seek')
        self._file.seek(self._data_pos)
        self._soundpos = 0

    def tell(self):
        return self._soundpos

    def setpos(self, pos):
        if pos < 0 or pos > self.getnframes():
            raise Error('position not in range')
        if self._data_pos is None:
            raise OSError('cannot seek')
        self._file.seek(self._data_pos + pos * self._framesize)
        self._soundpos = pos

    def close(self):
        file = self._file
        if file:
            self._file = None
            if self._opened:
                file.close()

class Au_write:

    def __init__(self, f):
        if type(f) == type(''):
            import builtins
            f = builtins.open(f, 'wb')
            self._opened = True
        else:
            self._opened = False
        self.initfp(f)

    def __del__(self):
        if self._file:
            self.close()
        self._file = None

    def __enter__(self):
        return self

    def __exit__(self, *args):
        self.close()

    def initfp(self, file):
        self._file = file
        self._framerate = 0
        self._nchannels = 0
        self._sampwidth = 0
        self._framesize = 0
        self._nframes = AUDIO_UNKNOWN_SIZE
        self._nframeswritten = 0
        self._datawritten = 0
        self._datalength = 0
        self._info = b''
        self._comptype = 'ULAW' # default is U-law

    def setnchannels(self, nchannels):
        if self._nframeswritten:
            raise Error('cannot change parameters after starting to write')
        if nchannels not in (1, 2, 4):
            raise Error('only 1, 2, or 4 channels supported')
        self._nchannels = nchannels

    def getnchannels(self):
        if not self._nchannels:
            raise Error('number of channels not set')
        return self._nchannels

    def setsampwidth(self, sampwidth):
        if self._nframeswritten:
            raise Error('cannot change parameters after starting to write')
        if sampwidth not in (1, 2, 3, 4):
            raise Error('bad sample width')
        self._sampwidth = sampwidth

    def getsampwidth(self):
        if not self._framerate:
            raise Error('sample width not specified')
        return self._sampwidth

    def setframerate(self, framerate):
        if self._nframeswritten:
            raise Error('cannot change parameters after starting to write')
        self._framerate = framerate

    def getframerate(self):
        if not self._framerate:
            raise Error('frame rate not set')
        return self._framerate

    def setnframes(self, nframes):
        if self._nframeswritten:
            raise Error('cannot change parameters after starting to write')
        if nframes < 0:
            raise Error('# of frames cannot be negative')
        self._nframes = nframes

    def getnframes(self):
        return self._nframeswritten

    def setcomptype(self, type, name):
        if type in ('NONE', 'ULAW'):
            self._comptype = type
        else:
            raise Error('unknown compression type')

    def getcomptype(self):
        return self._comptype

    def getcompname(self):
        if self._comptype == 'ULAW':
            return 'CCITT G.711 u-law'
        elif self._comptype == 'ALAW':
            return 'CCITT G.711 A-law'
        else:
            return 'not compressed'

    def setparams(self, params):
        nchannels, sampwidth, framerate, nframes, comptype, compname = params
        self.setnchannels(nchannels)
        self.setsampwidth(sampwidth)
        self.setframerate(framerate)
        self.setnframes(nframes)
        self.setcomptype(comptype, compname)

    def getparams(self):
        return _sunau_params(self.getnchannels(), self.getsampwidth(),
                  self.getframerate(), self.getnframes(),
                  self.getcomptype(), self.getcompname())

    def tell(self):
        return self._nframeswritten

    def writeframesraw(self, data):
        if not isinstance(data, (bytes, bytearray)):
            data = memoryview(data).cast('B')
        self._ensure_header_written()
        if self._comptype == 'ULAW':
            import audioop
            data = audioop.lin2ulaw(data, self._sampwidth)
        nframes = len(data) // self._framesize
        self._file.write(data)
        self._nframeswritten = self._nframeswritten + nframes
        self._datawritten = self._datawritten + len(data)

    def writeframes(self, data):
        self.writeframesraw(data)
        if self._nframeswritten != self._nframes or \
                  self._datalength != self._datawritten:
            self._patchheader()

    def close(self):
        if self._file:
            try:
                self._ensure_header_written()
                if self._nframeswritten != self._nframes or \
                        self._datalength != self._datawritten:
                    self._patchheader()
                self._file.flush()
            finally:
                file = self._file
                self._file = None
                if self._opened:
                    file.close()

    #
    # private methods
    #

    def _ensure_header_written(self):
        if not self._nframeswritten:
            if not self._nchannels:
                raise Error('# of channels not specified')
            if not self._sampwidth:
                raise Error('sample width not specified')
            if not self._framerate:
                raise Error('frame rate not specified')
            self._write_header()

    def _write_header(self):
        if self._comptype == 'NONE':
            if self._sampwidth == 1:
                encoding = AUDIO_FILE_ENCODING_LINEAR_8
                self._framesize = 1
            elif self._sampwidth == 2:
                encoding = AUDIO_FILE_ENCODING_LINEAR_16
                self._framesize = 2
            elif self._sampwidth == 3:
                encoding = AUDIO_FILE_ENCODING_LINEAR_24
                self._framesize = 3
            elif self._sampwidth == 4:
                encoding = AUDIO_FILE_ENCODING_LINEAR_32
                self._framesize = 4
            else:
                raise Error('internal error')
        elif self._comptype == 'ULAW':
            encoding = AUDIO_FILE_ENCODING_MULAW_8
            self._framesize = 1
        else:
            raise Error('internal error')
        self._framesize = self._framesize * self._nchannels
        _write_u32(self._file, AUDIO_FILE_MAGIC)
        header_size = 25 + len(self._info)
        header_size = (header_size + 7) & ~7
        _write_u32(self._file, header_size)
        if self._nframes == AUDIO_UNKNOWN_SIZE:
            length = AUDIO_UNKNOWN_SIZE
        else:
            length = self._nframes * self._framesize
        try:
            self._form_length_pos = self._file.tell()
        except (AttributeError, OSError):
            self._form_length_pos = None
        _write_u32(self._file, length)
        self._datalength = length
        _write_u32(self._file, encoding)
        _write_u32(self._file, self._framerate)
        _write_u32(self._file, self._nchannels)
        self._file.write(self._info)
        self._file.write(b'\0'*(header_size - len(self._info) - 24))

    def _patchheader(self):
        if self._form_length_pos is None:
            raise OSError('cannot seek')
        self._file.seek(self._form_length_pos)
        _write_u32(self._file, self._datawritten)
        self._datalength = self._datawritten
        self._file.seek(0, 2)

def open(f, mode=None):
    if mode is None:
        if hasattr(f, 'mode'):
            mode = f.mode
        else:
            mode = 'rb'
    if mode in ('r', 'rb'):
        return Au_read(f)
    elif mode in ('w', 'wb'):
        return Au_write(f)
    else:
        raise Error("mode must be 'r', 'rb', 'w', or 'wb'")

def openfp(f, mode=None):
    warnings.warn("sunau.openfp is deprecated since Python 3.7. "
                  "Use sunau.open instead.", DeprecationWarning, stacklevel=2)
    return open(f, mode=mode)
_osx_support.py000064400000052416151153537540007703 0ustar00"""Shared OS X support functions."""

import os
import re
import sys

__all__ = [
    'compiler_fixup',
    'customize_config_vars',
    'customize_compiler',
    'get_platform_osx',
]

# configuration variables that may contain universal build flags,
# like "-arch" or "-isdkroot", that may need customization for
# the user environment
_UNIVERSAL_CONFIG_VARS = ('CFLAGS', 'LDFLAGS', 'CPPFLAGS', 'BASECFLAGS',
                            'BLDSHARED', 'LDSHARED', 'CC', 'CXX',
                            'PY_CFLAGS', 'PY_LDFLAGS', 'PY_CPPFLAGS',
                            'PY_CORE_CFLAGS', 'PY_CORE_LDFLAGS')

# configuration variables that may contain compiler calls
_COMPILER_CONFIG_VARS = ('BLDSHARED', 'LDSHARED', 'CC', 'CXX')

# prefix added to original configuration variable names
_INITPRE = '_OSX_SUPPORT_INITIAL_'


def _find_executable(executable, path=None):
    """Tries to find 'executable' in the directories listed in 'path'.

    A string listing directories separated by 'os.pathsep'; defaults to
    os.environ['PATH'].  Returns the complete filename or None if not found.
    """
    if path is None:
        path = os.environ['PATH']

    paths = path.split(os.pathsep)
    base, ext = os.path.splitext(executable)

    if (sys.platform == 'win32') and (ext != '.exe'):
        executable = executable + '.exe'

    if not os.path.isfile(executable):
        for p in paths:
            f = os.path.join(p, executable)
            if os.path.isfile(f):
                # the file exists, we have a shot at spawn working
                return f
        return None
    else:
        return executable


def _read_output(commandstring, capture_stderr=False):
    """Output from successful command execution or None"""
    # Similar to os.popen(commandstring, "r").read(),
    # but without actually using os.popen because that
    # function is not usable during python bootstrap.
    # tempfile is also not available then.
    import contextlib
    try:
        import tempfile
        fp = tempfile.NamedTemporaryFile()
    except ImportError:
        fp = open("/tmp/_osx_support.%s"%(
            os.getpid(),), "w+b")

    with contextlib.closing(fp) as fp:
        if capture_stderr:
            cmd = "%s >'%s' 2>&1" % (commandstring, fp.name)
        else:
            cmd = "%s 2>/dev/null >'%s'" % (commandstring, fp.name)
        return fp.read().decode('utf-8').strip() if not os.system(cmd) else None


def _find_build_tool(toolname):
    """Find a build tool on current path or using xcrun"""
    return (_find_executable(toolname)
                or _read_output("/usr/bin/xcrun -find %s" % (toolname,))
                or ''
            )

_SYSTEM_VERSION = None

def _get_system_version():
    """Return the OS X system version as a string"""
    # Reading this plist is a documented way to get the system
    # version (see the documentation for the Gestalt Manager)
    # We avoid using platform.mac_ver to avoid possible bootstrap issues during
    # the build of Python itself (distutils is used to build standard library
    # extensions).

    global _SYSTEM_VERSION

    if _SYSTEM_VERSION is None:
        _SYSTEM_VERSION = ''
        try:
            f = open('/System/Library/CoreServices/SystemVersion.plist')
        except OSError:
            # We're on a plain darwin box, fall back to the default
            # behaviour.
            pass
        else:
            try:
                m = re.search(r'<key>ProductUserVisibleVersion</key>\s*'
                              r'<string>(.*?)</string>', f.read())
            finally:
                f.close()
            if m is not None:
                _SYSTEM_VERSION = '.'.join(m.group(1).split('.')[:2])
            # else: fall back to the default behaviour

    return _SYSTEM_VERSION

_SYSTEM_VERSION_TUPLE = None
def _get_system_version_tuple():
    """
    Return the macOS system version as a tuple

    The return value is safe to use to compare
    two version numbers.
    """
    global _SYSTEM_VERSION_TUPLE
    if _SYSTEM_VERSION_TUPLE is None:
        osx_version = _get_system_version()
        if osx_version:
            try:
                _SYSTEM_VERSION_TUPLE = tuple(int(i) for i in osx_version.split('.'))
            except ValueError:
                _SYSTEM_VERSION_TUPLE = ()

    return _SYSTEM_VERSION_TUPLE


def _remove_original_values(_config_vars):
    """Remove original unmodified values for testing"""
    # This is needed for higher-level cross-platform tests of get_platform.
    for k in list(_config_vars):
        if k.startswith(_INITPRE):
            del _config_vars[k]

def _save_modified_value(_config_vars, cv, newvalue):
    """Save modified and original unmodified value of configuration var"""

    oldvalue = _config_vars.get(cv, '')
    if (oldvalue != newvalue) and (_INITPRE + cv not in _config_vars):
        _config_vars[_INITPRE + cv] = oldvalue
    _config_vars[cv] = newvalue


_cache_default_sysroot = None
def _default_sysroot(cc):
    """ Returns the root of the default SDK for this system, or '/' """
    global _cache_default_sysroot

    if _cache_default_sysroot is not None:
        return _cache_default_sysroot

    contents = _read_output('%s -c -E -v - </dev/null' % (cc,), True)
    in_incdirs = False
    for line in contents.splitlines():
        if line.startswith("#include <...>"):
            in_incdirs = True
        elif line.startswith("End of search list"):
            in_incdirs = False
        elif in_incdirs:
            line = line.strip()
            if line == '/usr/include':
                _cache_default_sysroot = '/'
            elif line.endswith(".sdk/usr/include"):
                _cache_default_sysroot = line[:-12]
    if _cache_default_sysroot is None:
        _cache_default_sysroot = '/'

    return _cache_default_sysroot

def _supports_universal_builds():
    """Returns True if universal builds are supported on this system"""
    # As an approximation, we assume that if we are running on 10.4 or above,
    # then we are running with an Xcode environment that supports universal
    # builds, in particular -isysroot and -arch arguments to the compiler. This
    # is in support of allowing 10.4 universal builds to run on 10.3.x systems.

    osx_version = _get_system_version_tuple()
    return bool(osx_version >= (10, 4)) if osx_version else False

def _supports_arm64_builds():
    """Returns True if arm64 builds are supported on this system"""
    # There are two sets of systems supporting macOS/arm64 builds:
    # 1. macOS 11 and later, unconditionally
    # 2. macOS 10.15 with Xcode 12.2 or later
    # For now the second category is ignored.
    osx_version = _get_system_version_tuple()
    return osx_version >= (11, 0) if osx_version else False


def _find_appropriate_compiler(_config_vars):
    """Find appropriate C compiler for extension module builds"""

    # Issue #13590:
    #    The OSX location for the compiler varies between OSX
    #    (or rather Xcode) releases.  With older releases (up-to 10.5)
    #    the compiler is in /usr/bin, with newer releases the compiler
    #    can only be found inside Xcode.app if the "Command Line Tools"
    #    are not installed.
    #
    #    Furthermore, the compiler that can be used varies between
    #    Xcode releases. Up to Xcode 4 it was possible to use 'gcc-4.2'
    #    as the compiler, after that 'clang' should be used because
    #    gcc-4.2 is either not present, or a copy of 'llvm-gcc' that
    #    miscompiles Python.

    # skip checks if the compiler was overridden with a CC env variable
    if 'CC' in os.environ:
        return _config_vars

    # The CC config var might contain additional arguments.
    # Ignore them while searching.
    cc = oldcc = _config_vars['CC'].split()[0]
    if not _find_executable(cc):
        # Compiler is not found on the shell search PATH.
        # Now search for clang, first on PATH (if the Command LIne
        # Tools have been installed in / or if the user has provided
        # another location via CC).  If not found, try using xcrun
        # to find an uninstalled clang (within a selected Xcode).

        # NOTE: Cannot use subprocess here because of bootstrap
        # issues when building Python itself (and os.popen is
        # implemented on top of subprocess and is therefore not
        # usable as well)

        cc = _find_build_tool('clang')

    elif os.path.basename(cc).startswith('gcc'):
        # Compiler is GCC, check if it is LLVM-GCC
        data = _read_output("'%s' --version"
                             % (cc.replace("'", "'\"'\"'"),))
        if data and 'llvm-gcc' in data:
            # Found LLVM-GCC, fall back to clang
            cc = _find_build_tool('clang')

    if not cc:
        raise SystemError(
               "Cannot locate working compiler")

    if cc != oldcc:
        # Found a replacement compiler.
        # Modify config vars using new compiler, if not already explicitly
        # overridden by an env variable, preserving additional arguments.
        for cv in _COMPILER_CONFIG_VARS:
            if cv in _config_vars and cv not in os.environ:
                cv_split = _config_vars[cv].split()
                cv_split[0] = cc if cv != 'CXX' else cc + '++'
                _save_modified_value(_config_vars, cv, ' '.join(cv_split))

    return _config_vars


def _remove_universal_flags(_config_vars):
    """Remove all universal build arguments from config vars"""

    for cv in _UNIVERSAL_CONFIG_VARS:
        # Do not alter a config var explicitly overridden by env var
        if cv in _config_vars and cv not in os.environ:
            flags = _config_vars[cv]
            flags = re.sub(r'-arch\s+\w+\s', ' ', flags, flags=re.ASCII)
            flags = re.sub(r'-isysroot\s*\S+', ' ', flags)
            _save_modified_value(_config_vars, cv, flags)

    return _config_vars


def _remove_unsupported_archs(_config_vars):
    """Remove any unsupported archs from config vars"""
    # Different Xcode releases support different sets for '-arch'
    # flags. In particular, Xcode 4.x no longer supports the
    # PPC architectures.
    #
    # This code automatically removes '-arch ppc' and '-arch ppc64'
    # when these are not supported. That makes it possible to
    # build extensions on OSX 10.7 and later with the prebuilt
    # 32-bit installer on the python.org website.

    # skip checks if the compiler was overridden with a CC env variable
    if 'CC' in os.environ:
        return _config_vars

    if re.search(r'-arch\s+ppc', _config_vars['CFLAGS']) is not None:
        # NOTE: Cannot use subprocess here because of bootstrap
        # issues when building Python itself
        status = os.system(
            """echo 'int main{};' | """
            """'%s' -c -arch ppc -x c -o /dev/null /dev/null 2>/dev/null"""
            %(_config_vars['CC'].replace("'", "'\"'\"'"),))
        if status:
            # The compile failed for some reason.  Because of differences
            # across Xcode and compiler versions, there is no reliable way
            # to be sure why it failed.  Assume here it was due to lack of
            # PPC support and remove the related '-arch' flags from each
            # config variables not explicitly overridden by an environment
            # variable.  If the error was for some other reason, we hope the
            # failure will show up again when trying to compile an extension
            # module.
            for cv in _UNIVERSAL_CONFIG_VARS:
                if cv in _config_vars and cv not in os.environ:
                    flags = _config_vars[cv]
                    flags = re.sub(r'-arch\s+ppc\w*\s', ' ', flags)
                    _save_modified_value(_config_vars, cv, flags)

    return _config_vars


def _override_all_archs(_config_vars):
    """Allow override of all archs with ARCHFLAGS env var"""
    # NOTE: This name was introduced by Apple in OSX 10.5 and
    # is used by several scripting languages distributed with
    # that OS release.
    if 'ARCHFLAGS' in os.environ:
        arch = os.environ['ARCHFLAGS']
        for cv in _UNIVERSAL_CONFIG_VARS:
            if cv in _config_vars and '-arch' in _config_vars[cv]:
                flags = _config_vars[cv]
                flags = re.sub(r'-arch\s+\w+\s', ' ', flags)
                flags = flags + ' ' + arch
                _save_modified_value(_config_vars, cv, flags)

    return _config_vars


def _check_for_unavailable_sdk(_config_vars):
    """Remove references to any SDKs not available"""
    # If we're on OSX 10.5 or later and the user tries to
    # compile an extension using an SDK that is not present
    # on the current machine it is better to not use an SDK
    # than to fail.  This is particularly important with
    # the standalone Command Line Tools alternative to a
    # full-blown Xcode install since the CLT packages do not
    # provide SDKs.  If the SDK is not present, it is assumed
    # that the header files and dev libs have been installed
    # to /usr and /System/Library by either a standalone CLT
    # package or the CLT component within Xcode.
    cflags = _config_vars.get('CFLAGS', '')
    m = re.search(r'-isysroot\s*(\S+)', cflags)
    if m is not None:
        sdk = m.group(1)
        if not os.path.exists(sdk):
            for cv in _UNIVERSAL_CONFIG_VARS:
                # Do not alter a config var explicitly overridden by env var
                if cv in _config_vars and cv not in os.environ:
                    flags = _config_vars[cv]
                    flags = re.sub(r'-isysroot\s*\S+(?:\s|$)', ' ', flags)
                    _save_modified_value(_config_vars, cv, flags)

    return _config_vars


def compiler_fixup(compiler_so, cc_args):
    """
    This function will strip '-isysroot PATH' and '-arch ARCH' from the
    compile flags if the user has specified one them in extra_compile_flags.

    This is needed because '-arch ARCH' adds another architecture to the
    build, without a way to remove an architecture. Furthermore GCC will
    barf if multiple '-isysroot' arguments are present.
    """
    stripArch = stripSysroot = False

    compiler_so = list(compiler_so)

    if not _supports_universal_builds():
        # OSX before 10.4.0, these don't support -arch and -isysroot at
        # all.
        stripArch = stripSysroot = True
    else:
        stripArch = '-arch' in cc_args
        stripSysroot = any(arg for arg in cc_args if arg.startswith('-isysroot'))

    if stripArch or 'ARCHFLAGS' in os.environ:
        while True:
            try:
                index = compiler_so.index('-arch')
                # Strip this argument and the next one:
                del compiler_so[index:index+2]
            except ValueError:
                break

    elif not _supports_arm64_builds():
        # Look for "-arch arm64" and drop that
        for idx in reversed(range(len(compiler_so))):
            if compiler_so[idx] == '-arch' and compiler_so[idx+1] == "arm64":
                del compiler_so[idx:idx+2]

    if 'ARCHFLAGS' in os.environ and not stripArch:
        # User specified different -arch flags in the environ,
        # see also distutils.sysconfig
        compiler_so = compiler_so + os.environ['ARCHFLAGS'].split()

    if stripSysroot:
        while True:
            indices = [i for i,x in enumerate(compiler_so) if x.startswith('-isysroot')]
            if not indices:
                break
            index = indices[0]
            if compiler_so[index] == '-isysroot':
                # Strip this argument and the next one:
                del compiler_so[index:index+2]
            else:
                # It's '-isysroot/some/path' in one arg
                del compiler_so[index:index+1]

    # Check if the SDK that is used during compilation actually exists,
    # the universal build requires the usage of a universal SDK and not all
    # users have that installed by default.
    sysroot = None
    argvar = cc_args
    indices = [i for i,x in enumerate(cc_args) if x.startswith('-isysroot')]
    if not indices:
        argvar = compiler_so
        indices = [i for i,x in enumerate(compiler_so) if x.startswith('-isysroot')]

    for idx in indices:
        if argvar[idx] == '-isysroot':
            sysroot = argvar[idx+1]
            break
        else:
            sysroot = argvar[idx][len('-isysroot'):]
            break

    if sysroot and not os.path.isdir(sysroot):
        from distutils import log
        log.warn("Compiling with an SDK that doesn't seem to exist: %s",
                sysroot)
        log.warn("Please check your Xcode installation")

    return compiler_so


def customize_config_vars(_config_vars):
    """Customize Python build configuration variables.

    Called internally from sysconfig with a mutable mapping
    containing name/value pairs parsed from the configured
    makefile used to build this interpreter.  Returns
    the mapping updated as needed to reflect the environment
    in which the interpreter is running; in the case of
    a Python from a binary installer, the installed
    environment may be very different from the build
    environment, i.e. different OS levels, different
    built tools, different available CPU architectures.

    This customization is performed whenever
    distutils.sysconfig.get_config_vars() is first
    called.  It may be used in environments where no
    compilers are present, i.e. when installing pure
    Python dists.  Customization of compiler paths
    and detection of unavailable archs is deferred
    until the first extension module build is
    requested (in distutils.sysconfig.customize_compiler).

    Currently called from distutils.sysconfig
    """

    if not _supports_universal_builds():
        # On Mac OS X before 10.4, check if -arch and -isysroot
        # are in CFLAGS or LDFLAGS and remove them if they are.
        # This is needed when building extensions on a 10.3 system
        # using a universal build of python.
        _remove_universal_flags(_config_vars)

    # Allow user to override all archs with ARCHFLAGS env var
    _override_all_archs(_config_vars)

    # Remove references to sdks that are not found
    _check_for_unavailable_sdk(_config_vars)

    return _config_vars


def customize_compiler(_config_vars):
    """Customize compiler path and configuration variables.

    This customization is performed when the first
    extension module build is requested
    in distutils.sysconfig.customize_compiler).
    """

    # Find a compiler to use for extension module builds
    _find_appropriate_compiler(_config_vars)

    # Remove ppc arch flags if not supported here
    _remove_unsupported_archs(_config_vars)

    # Allow user to override all archs with ARCHFLAGS env var
    _override_all_archs(_config_vars)

    return _config_vars


def get_platform_osx(_config_vars, osname, release, machine):
    """Filter values for get_platform()"""
    # called from get_platform() in sysconfig and distutils.util
    #
    # For our purposes, we'll assume that the system version from
    # distutils' perspective is what MACOSX_DEPLOYMENT_TARGET is set
    # to. This makes the compatibility story a bit more sane because the
    # machine is going to compile and link as if it were
    # MACOSX_DEPLOYMENT_TARGET.

    macver = _config_vars.get('MACOSX_DEPLOYMENT_TARGET', '')
    macrelease = _get_system_version() or macver
    macver = macver or macrelease

    if macver:
        release = macver
        osname = "macosx"

        # Use the original CFLAGS value, if available, so that we
        # return the same machine type for the platform string.
        # Otherwise, distutils may consider this a cross-compiling
        # case and disallow installs.
        cflags = _config_vars.get(_INITPRE+'CFLAGS',
                                    _config_vars.get('CFLAGS', ''))
        if macrelease:
            try:
                macrelease = tuple(int(i) for i in macrelease.split('.')[0:2])
            except ValueError:
                macrelease = (10, 0)
        else:
            # assume no universal support
            macrelease = (10, 0)

        if (macrelease >= (10, 4)) and '-arch' in cflags.strip():
            # The universal build will build fat binaries, but not on
            # systems before 10.4

            machine = 'fat'

            archs = re.findall(r'-arch\s+(\S+)', cflags)
            archs = tuple(sorted(set(archs)))

            if len(archs) == 1:
                machine = archs[0]
            elif archs == ('arm64', 'x86_64'):
                machine = 'universal2'
            elif archs == ('i386', 'ppc'):
                machine = 'fat'
            elif archs == ('i386', 'x86_64'):
                machine = 'intel'
            elif archs == ('i386', 'ppc', 'x86_64'):
                machine = 'fat3'
            elif archs == ('ppc64', 'x86_64'):
                machine = 'fat64'
            elif archs == ('i386', 'ppc', 'ppc64', 'x86_64'):
                machine = 'universal'
            else:
                raise ValueError(
                   "Don't know machine value for archs=%r" % (archs,))

        elif machine == 'i386':
            # On OSX the machine type returned by uname is always the
            # 32-bit variant, even if the executable architecture is
            # the 64-bit variant
            if sys.maxsize >= 2**32:
                machine = 'x86_64'

        elif machine in ('PowerPC', 'Power_Macintosh'):
            # Pick a sane name for the PPC architecture.
            # See 'i386' case
            if sys.maxsize >= 2**32:
                machine = 'ppc64'
            else:
                machine = 'ppc'

    return (osname, release, machine)
ensurepip/__main__.py000064400000000130151153537540010653 0ustar00import ensurepip
import sys

if __name__ == "__main__":
    sys.exit(ensurepip._main())
ensurepip/__init__.py000064400000016542151153537540010710 0ustar00import distutils.version
import glob
import os
import os.path
import sys
import runpy
import tempfile
import subprocess


__all__ = ["version", "bootstrap"]
_PACKAGE_NAMES = ('setuptools', 'pip')

_WHEEL_DIR = "/usr/share/python38-wheels/"

_wheels = {}

def _get_most_recent_wheel_version(pkg):
    prefix = os.path.join(_WHEEL_DIR, "{}-".format(pkg))
    _wheels[pkg] = {}
    for suffix in "-py2.py3-none-any.whl", "-py3-none-any.whl":
        pattern = "{}*{}".format(prefix, suffix)
        for path in glob.glob(pattern):
            version_str = path[len(prefix):-len(suffix)]
            _wheels[pkg][version_str] = os.path.basename(path)
    return str(max(_wheels[pkg], key=distutils.version.LooseVersion))


_SETUPTOOLS_VERSION = _get_most_recent_wheel_version("setuptools")

_PIP_VERSION = _get_most_recent_wheel_version("pip")

_PROJECTS = [
    ("setuptools", _SETUPTOOLS_VERSION, "py3"),
    ("pip", _PIP_VERSION, "py3"),
]


def _run_pip(args, additional_paths=None):
    # Run the bootstraping in a subprocess to avoid leaking any state that happens
    # after pip has executed. Particulary, this avoids the case when pip holds onto
    # the files in *additional_paths*, preventing us to remove them at the end of the
    # invocation.
    code = f"""
import runpy
import sys
sys.path = {additional_paths or []} + sys.path
sys.argv[1:] = {args}
runpy.run_module("pip", run_name="__main__", alter_sys=True)
"""

    cmd = [sys.executable, '-c', code]
    if sys.flags.isolated:
        # run code in isolated mode if currently running isolated
        cmd.insert(1, '-I')
    return subprocess.run(cmd, check=True).returncode


def version():
    """
    Returns a string specifying the bundled version of pip.
    """
    return _PIP_VERSION

def _disable_pip_configuration_settings():
    # We deliberately ignore all pip environment variables
    # when invoking pip
    # See http://bugs.python.org/issue19734 for details
    keys_to_remove = [k for k in os.environ if k.startswith("PIP_")]
    for k in keys_to_remove:
        del os.environ[k]
    # We also ignore the settings in the default pip configuration file
    # See http://bugs.python.org/issue20053 for details
    os.environ['PIP_CONFIG_FILE'] = os.devnull


def bootstrap(*, root=None, upgrade=False, user=False,
              altinstall=False, default_pip=False,
              verbosity=0):
    """
    Bootstrap pip into the current Python installation (or the given root
    directory).

    Note that calling this function will alter both sys.path and os.environ.
    """
    # Discard the return value
    _bootstrap(root=root, upgrade=upgrade, user=user,
               altinstall=altinstall, default_pip=default_pip,
               verbosity=verbosity)


def _bootstrap(*, root=None, upgrade=False, user=False,
              altinstall=False, default_pip=False,
              verbosity=0):
    """
    Bootstrap pip into the current Python installation (or the given root
    directory). Returns pip command status code.

    Note that calling this function will alter both sys.path and os.environ.
    """
    if altinstall and default_pip:
        raise ValueError("Cannot use altinstall and default_pip together")

    sys.audit("ensurepip.bootstrap", root)

    _disable_pip_configuration_settings()

    # By default, installing pip and setuptools installs all of the
    # following scripts (X.Y == running Python version):
    #
    #   pip, pipX, pipX.Y, easy_install, easy_install-X.Y
    #
    # pip 1.5+ allows ensurepip to request that some of those be left out
    if altinstall:
        # omit pip, pipX and easy_install
        os.environ["ENSUREPIP_OPTIONS"] = "altinstall"
    elif not default_pip:
        # omit pip and easy_install
        os.environ["ENSUREPIP_OPTIONS"] = "install"

    with tempfile.TemporaryDirectory() as tmpdir:
        # Put our bundled wheels into a temporary directory and construct the
        # additional paths that need added to sys.path
        additional_paths = []
        for project, version, py_tag in _PROJECTS:
            wheel_name = _wheels[project][version]
            with open(os.path.join(_WHEEL_DIR, wheel_name), "rb") as sfp:
                with open(os.path.join(tmpdir, wheel_name), "wb") as fp:
                    fp.write(sfp.read())

            additional_paths.append(os.path.join(tmpdir, wheel_name))

        # Construct the arguments to be passed to the pip command
        args = ["install", "--no-cache-dir", "--no-index", "--find-links", tmpdir]
        if root:
            args += ["--root", root]
        if upgrade:
            args += ["--upgrade"]
        if user:
            args += ["--user"]
        if verbosity:
            args += ["-" + "v" * verbosity]

        return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)

def _uninstall_helper(*, verbosity=0):
    """Helper to support a clean default uninstall process on Windows

    Note that calling this function may alter os.environ.
    """
    # Nothing to do if pip was never installed, or has been removed
    try:
        import pip
    except ImportError:
        return

    # If the pip version doesn't match the bundled one, leave it alone
    if pip.__version__ != _PIP_VERSION:
        msg = ("ensurepip will only uninstall a matching version "
               "({!r} installed, {!r} bundled)")
        print(msg.format(pip.__version__, _PIP_VERSION), file=sys.stderr)
        return

    _disable_pip_configuration_settings()

    # Construct the arguments to be passed to the pip command
    args = ["uninstall", "-y", "--disable-pip-version-check"]
    if verbosity:
        args += ["-" + "v" * verbosity]

    return _run_pip(args + [p[0] for p in reversed(_PROJECTS)])


def _main(argv=None):
    import argparse
    parser = argparse.ArgumentParser(prog="python -m ensurepip")
    parser.add_argument(
        "--version",
        action="version",
        version="pip {}".format(version()),
        help="Show the version of pip that is bundled with this Python.",
    )
    parser.add_argument(
        "-v", "--verbose",
        action="count",
        default=0,
        dest="verbosity",
        help=("Give more output. Option is additive, and can be used up to 3 "
              "times."),
    )
    parser.add_argument(
        "-U", "--upgrade",
        action="store_true",
        default=False,
        help="Upgrade pip and dependencies, even if already installed.",
    )
    parser.add_argument(
        "--user",
        action="store_true",
        default=False,
        help="Install using the user scheme.",
    )
    parser.add_argument(
        "--root",
        default=None,
        help="Install everything relative to this alternate root directory.",
    )
    parser.add_argument(
        "--altinstall",
        action="store_true",
        default=False,
        help=("Make an alternate install, installing only the X.Y versioned "
              "scripts (Default: pipX, pipX.Y, easy_install-X.Y)."),
    )
    parser.add_argument(
        "--default-pip",
        action="store_true",
        default=False,
        help=("Make a default pip install, installing the unqualified pip "
              "and easy_install in addition to the versioned scripts."),
    )

    args = parser.parse_args(argv)

    return _bootstrap(
        root=args.root,
        upgrade=args.upgrade,
        user=args.user,
        verbosity=args.verbosity,
        altinstall=args.altinstall,
        default_pip=args.default_pip,
    )
ensurepip/_uninstall.py000064400000001450151153537540011311 0ustar00"""Basic pip uninstallation support, helper for the Windows uninstaller"""

import argparse
import ensurepip
import sys


def _main(argv=None):
    parser = argparse.ArgumentParser(prog="python -m ensurepip._uninstall")
    parser.add_argument(
        "--version",
        action="version",
        version="pip {}".format(ensurepip.version()),
        help="Show the version of pip this will attempt to uninstall.",
    )
    parser.add_argument(
        "-v", "--verbose",
        action="count",
        default=0,
        dest="verbosity",
        help=("Give more output. Option is additive, and can be used up to 3 "
              "times."),
    )

    args = parser.parse_args(argv)

    return ensurepip._uninstall_helper(verbosity=args.verbosity)


if __name__ == "__main__":
    sys.exit(_main())
ensurepip/__pycache__/__init__.cpython-38.opt-1.pyc000064400000013166151153537540016134 0ustar00U

&�.eb�@s�ddlZddlZddlZddlZddlZddlZddlZddlZddgZ	dZ
dZiZdd�Z
e
d�Ze
d	�Zded
fd	ed
fgZddd�Zd
d�Zdd�Zddddddd�dd�Zddddddd�dd�Zdd�dd�Zddd�ZdS)�N�version�	bootstrap)�
setuptools�pipz/usr/share/python38-wheels/cCs�tj�td�|��}it|<dD]J}d�||�}t�|�D].}|t|�t|��}tj�|�t||<q:q t	t
t|tjj
d��S)Nz{}-)z-py2.py3-none-any.whlz-py3-none-any.whlz{}*{})�key)�os�path�join�
_WHEEL_DIR�format�_wheels�glob�len�basename�str�max�	distutilsrZLooseVersion)Zpkg�prefix�suffix�patternrZversion_str�r�*/usr/lib64/python3.8/ensurepip/__init__.py�_get_most_recent_wheel_versionsrrrZpy3cCsFd|pg�d|�d�}tjd|g}tjjr6|�dd�tj|dd�jS)	Nz$
import runpy
import sys
sys.path = z + sys.path
sys.argv[1:] = z>
runpy.run_module("pip", run_name="__main__", alter_sys=True)
z-c�z-IT)Zcheck)�sys�
executable�flags�isolated�insert�
subprocess�run�
returncode)�args�additional_paths�code�cmdrrr�_run_pip's��r&cCstS)zA
    Returns a string specifying the bundled version of pip.
    )�_PIP_VERSIONrrrrr;scCs2dd�tjD�}|D]}tj|=qtjtjd<dS)NcSsg|]}|�d�r|�qS)ZPIP_)�
startswith)�.0�krrr�
<listcomp>Es
z7_disable_pip_configuration_settings.<locals>.<listcomp>ZPIP_CONFIG_FILE)r�environ�devnull)Zkeys_to_remover*rrr�#_disable_pip_configuration_settingsAs
r.F��root�upgrade�user�
altinstall�default_pip�	verbositycCst||||||d�dS)z�
    Bootstrap pip into the current Python installation (or the given root
    directory).

    Note that calling this function will alter both sys.path and os.environ.
    r/N)�
_bootstrapr/rrrrMs

�cCsP|r|rtd��t�d|�t�|r2dtjd<n|s@dtjd<t�����}g}tD]x\}}	}
t	||	}t
tj�t
|�d��4}t
tj�||�d��}
|
�|���W5QRXW5QRX|�tj�||��qTddd	d
|g}|r�|d|g7}|r�|dg7}|�r
|d
g7}|�r"|dd|g7}t|dd�tD�|�W5QR�SQRXdS)z�
    Bootstrap pip into the current Python installation (or the given root
    directory). Returns pip command status code.

    Note that calling this function will alter both sys.path and os.environ.
    z.Cannot use altinstall and default_pip togetherzensurepip.bootstrapr3ZENSUREPIP_OPTIONSZinstall�rb�wbz--no-cache-dirz
--no-indexz--find-links�--root�	--upgrade�--user�-�vcSsg|]}|d�qS�rr�r)�prrrr+�sz_bootstrap.<locals>.<listcomp>N)�
ValueErrorr�auditr.rr,�tempfileZTemporaryDirectory�	_PROJECTSr�openrr	r
�write�read�appendr&)r0r1r2r3r4r5Ztmpdirr#ZprojectrZpy_tagZ
wheel_nameZsfp�fpr"rrrr6\s4	
"

r6)r5cCs�zddl}Wntk
r"YdSX|jtkrNd}t|�|jt�tjd�dSt�dddg}|rt|dd	|g7}t	|d
d�t
t�D��S)z~Helper to support a clean default uninstall process on Windows

    Note that calling this function may alter os.environ.
    rNzOensurepip will only uninstall a matching version ({!r} installed, {!r} bundled))�fileZ	uninstallz-yz--disable-pip-version-checkr<r=cSsg|]}|d�qSr>rr?rrrr+�sz%_uninstall_helper.<locals>.<listcomp>)r�ImportError�__version__r'�printrr�stderrr.r&�reversedrD)r5r�msgr"rrr�_uninstall_helper�s

rQcCs�ddl}|jdd�}|jddd�t��dd�|jd	d
dddd
d�|jdddddd�|jddddd�|jdddd�|jddddd�|jddddd�|�|�}t|j|j|j	|j
|j|jd�S)Nrzpython -m ensurepip)�progz	--versionrzpip {}z9Show the version of pip that is bundled with this Python.)�actionr�helpz-vz	--verbose�countr5zDGive more output. Option is additive, and can be used up to 3 times.)rS�default�destrTz-Ur:�
store_trueFz8Upgrade pip and dependencies, even if already installed.)rSrVrTr;zInstall using the user scheme.r9z=Install everything relative to this alternate root directory.)rVrTz--altinstallzoMake an alternate install, installing only the X.Y versioned scripts (Default: pipX, pipX.Y, easy_install-X.Y).z
--default-pipzqMake a default pip install, installing the unqualified pip and easy_install in addition to the versioned scripts.)r0r1r2r5r3r4)
�argparse�ArgumentParser�add_argumentrr�
parse_argsr6r0r1r2r5r3r4)�argvrY�parserr"rrr�_main�sn
�������
�r_)N)N)Zdistutils.versionrr
rZos.pathrZrunpyrCr�__all__Z_PACKAGE_NAMESr
rrZ_SETUPTOOLS_VERSIONr'rDr&rr.rr6rQr_rrrr�<module>s@�
��6ensurepip/__pycache__/__main__.cpython-38.opt-2.pyc000064400000000344151153537540016110 0ustar00U

e5dX�@s*ddlZddlZedkr&e�e���dS)�N�__main__)Z	ensurepip�sys�__name__�exitZ_main�rr�*/usr/lib64/python3.8/ensurepip/__main__.py�<module>sensurepip/__pycache__/_uninstall.cpython-38.pyc000064400000001650151153537540015601 0ustar00U

e5d(�@s>dZddlZddlZddlZddd�Zedkr:e�e��dS)zDBasic pip uninstallation support, helper for the Windows uninstaller�NcCsVtjdd�}|jddd�t���dd�|jdd	d
ddd
d�|�|�}tj|jd�S)Nzpython -m ensurepip._uninstall)�progz	--version�versionzpip {}z7Show the version of pip this will attempt to uninstall.)�actionr�helpz-vz	--verbose�countr�	verbosityzDGive more output. Option is additive, and can be used up to 3 times.)r�default�destr)r)	�argparse�ArgumentParser�add_argument�format�	ensurepipr�
parse_argsZ_uninstall_helperr)�argv�parser�args�r�,/usr/lib64/python3.8/ensurepip/_uninstall.py�_mains"��	
r�__main__)N)�__doc__r
r�sysr�__name__�exitrrrr�<module>s
ensurepip/__pycache__/__main__.cpython-38.opt-1.pyc000064400000000344151153537540016107 0ustar00U

e5dX�@s*ddlZddlZedkr&e�e���dS)�N�__main__)Z	ensurepip�sys�__name__�exitZ_main�rr�*/usr/lib64/python3.8/ensurepip/__main__.py�<module>sensurepip/__pycache__/__init__.cpython-38.opt-2.pyc000064400000012065151153537540016132 0ustar00U

&�.eb�@s�ddlZddlZddlZddlZddlZddlZddlZddlZddgZ	dZ
dZiZdd�Z
e
d�Ze
d	�Zded
fd	ed
fgZddd�Zd
d�Zdd�Zddddddd�dd�Zddddddd�dd�Zdd�dd�Zddd�ZdS)�N�version�	bootstrap)�
setuptools�pipz/usr/share/python38-wheels/cCs�tj�td�|��}it|<dD]J}d�||�}t�|�D].}|t|�t|��}tj�|�t||<q:q t	t
t|tjj
d��S)Nz{}-)z-py2.py3-none-any.whlz-py3-none-any.whlz{}*{})�key)�os�path�join�
_WHEEL_DIR�format�_wheels�glob�len�basename�str�max�	distutilsrZLooseVersion)Zpkg�prefix�suffix�patternrZversion_str�r�*/usr/lib64/python3.8/ensurepip/__init__.py�_get_most_recent_wheel_versionsrrrZpy3cCsFd|pg�d|�d�}tjd|g}tjjr6|�dd�tj|dd�jS)	Nz$
import runpy
import sys
sys.path = z + sys.path
sys.argv[1:] = z>
runpy.run_module("pip", run_name="__main__", alter_sys=True)
z-c�z-IT)Zcheck)�sys�
executable�flags�isolated�insert�
subprocess�run�
returncode)�args�additional_paths�code�cmdrrr�_run_pip's��r&cCstS)N)�_PIP_VERSIONrrrrr;scCs2dd�tjD�}|D]}tj|=qtjtjd<dS)NcSsg|]}|�d�r|�qS)ZPIP_)�
startswith)�.0�krrr�
<listcomp>Es
z7_disable_pip_configuration_settings.<locals>.<listcomp>ZPIP_CONFIG_FILE)r�environ�devnull)Zkeys_to_remover*rrr�#_disable_pip_configuration_settingsAs
r.F��root�upgrade�user�
altinstall�default_pip�	verbositycCst||||||d�dS)Nr/)�
_bootstrapr/rrrrMs

�cCsP|r|rtd��t�d|�t�|r2dtjd<n|s@dtjd<t�����}g}tD]x\}}	}
t	||	}t
tj�t
|�d��4}t
tj�||�d��}
|
�|���W5QRXW5QRX|�tj�||��qTddd	d
|g}|r�|d|g7}|r�|dg7}|�r
|d
g7}|�r"|dd|g7}t|dd�tD�|�W5QR�SQRXdS)Nz.Cannot use altinstall and default_pip togetherzensurepip.bootstrapr3ZENSUREPIP_OPTIONSZinstall�rb�wbz--no-cache-dirz
--no-indexz--find-links�--root�	--upgrade�--user�-�vcSsg|]}|d�qS�rr�r)�prrrr+�sz_bootstrap.<locals>.<listcomp>)�
ValueErrorr�auditr.rr,�tempfileZTemporaryDirectory�	_PROJECTSr�openrr	r
�write�read�appendr&)r0r1r2r3r4r5Ztmpdirr#ZprojectrZpy_tagZ
wheel_nameZsfp�fpr"rrrr6\s4	
"

r6)r5cCs�zddl}Wntk
r"YdSX|jtkrNd}t|�|jt�tjd�dSt�dddg}|rt|dd|g7}t	|d	d
�t
t�D��S)NrzOensurepip will only uninstall a matching version ({!r} installed, {!r} bundled))�fileZ	uninstallz-yz--disable-pip-version-checkr<r=cSsg|]}|d�qSr>rr?rrrr+�sz%_uninstall_helper.<locals>.<listcomp>)r�ImportError�__version__r'�printrr�stderrr.r&�reversedrD)r5r�msgr"rrr�_uninstall_helper�s

rQcCs�ddl}|jdd�}|jddd�t��dd�|jd	d
dddd
d�|jdddddd�|jddddd�|jdddd�|jddddd�|jddddd�|�|�}t|j|j|j	|j
|j|jd�S)Nrzpython -m ensurepip)�progz	--versionrzpip {}z9Show the version of pip that is bundled with this Python.)�actionr�helpz-vz	--verbose�countr5zDGive more output. Option is additive, and can be used up to 3 times.)rS�default�destrTz-Ur:�
store_trueFz8Upgrade pip and dependencies, even if already installed.)rSrVrTr;zInstall using the user scheme.r9z=Install everything relative to this alternate root directory.)rVrTz--altinstallzoMake an alternate install, installing only the X.Y versioned scripts (Default: pipX, pipX.Y, easy_install-X.Y).z
--default-pipzqMake a default pip install, installing the unqualified pip and easy_install in addition to the versioned scripts.)r0r1r2r5r3r4)
�argparse�ArgumentParser�add_argumentrr�
parse_argsr6r0r1r2r5r3r4)�argvrY�parserr"rrr�_main�sn
�������
�r_)N)N)Zdistutils.versionrr
rZos.pathrZrunpyrCr�__all__Z_PACKAGE_NAMESr
rrZ_SETUPTOOLS_VERSIONr'rDr&rr.rr6rQr_rrrr�<module>s@�
��6ensurepip/__pycache__/_uninstall.cpython-38.opt-2.pyc000064400000001523151153537540016540 0ustar00U

e5d(�@s:ddlZddlZddlZddd�Zedkr6e�e��dS)�NcCsVtjdd�}|jddd�t���dd�|jdd	d
ddd
d�|�|�}tj|jd�S)Nzpython -m ensurepip._uninstall)�progz	--version�versionzpip {}z7Show the version of pip this will attempt to uninstall.)�actionr�helpz-vz	--verbose�countr�	verbosityzDGive more output. Option is additive, and can be used up to 3 times.)r�default�destr)r)	�argparse�ArgumentParser�add_argument�format�	ensurepipr�
parse_argsZ_uninstall_helperr)�argv�parser�args�r�,/usr/lib64/python3.8/ensurepip/_uninstall.py�_mains"��	
r�__main__)N)r
r�sysr�__name__�exitrrrr�<module>s

ensurepip/__pycache__/_uninstall.cpython-38.opt-1.pyc000064400000001650151153537540016540 0ustar00U

e5d(�@s>dZddlZddlZddlZddd�Zedkr:e�e��dS)zDBasic pip uninstallation support, helper for the Windows uninstaller�NcCsVtjdd�}|jddd�t���dd�|jdd	d
ddd
d�|�|�}tj|jd�S)Nzpython -m ensurepip._uninstall)�progz	--version�versionzpip {}z7Show the version of pip this will attempt to uninstall.)�actionr�helpz-vz	--verbose�countr�	verbosityzDGive more output. Option is additive, and can be used up to 3 times.)r�default�destr)r)	�argparse�ArgumentParser�add_argument�format�	ensurepipr�
parse_argsZ_uninstall_helperr)�argv�parser�args�r�,/usr/lib64/python3.8/ensurepip/_uninstall.py�_mains"��	
r�__main__)N)�__doc__r
r�sysr�__name__�exitrrrr�<module>s
ensurepip/__pycache__/__init__.cpython-38.pyc000064400000013166151153537540015175 0ustar00U

&�.eb�@s�ddlZddlZddlZddlZddlZddlZddlZddlZddgZ	dZ
dZiZdd�Z
e
d�Ze
d	�Zded
fd	ed
fgZddd�Zd
d�Zdd�Zddddddd�dd�Zddddddd�dd�Zdd�dd�Zddd�ZdS)�N�version�	bootstrap)�
setuptools�pipz/usr/share/python38-wheels/cCs�tj�td�|��}it|<dD]J}d�||�}t�|�D].}|t|�t|��}tj�|�t||<q:q t	t
t|tjj
d��S)Nz{}-)z-py2.py3-none-any.whlz-py3-none-any.whlz{}*{})�key)�os�path�join�
_WHEEL_DIR�format�_wheels�glob�len�basename�str�max�	distutilsrZLooseVersion)Zpkg�prefix�suffix�patternrZversion_str�r�*/usr/lib64/python3.8/ensurepip/__init__.py�_get_most_recent_wheel_versionsrrrZpy3cCsFd|pg�d|�d�}tjd|g}tjjr6|�dd�tj|dd�jS)	Nz$
import runpy
import sys
sys.path = z + sys.path
sys.argv[1:] = z>
runpy.run_module("pip", run_name="__main__", alter_sys=True)
z-c�z-IT)Zcheck)�sys�
executable�flags�isolated�insert�
subprocess�run�
returncode)�args�additional_paths�code�cmdrrr�_run_pip's��r&cCstS)zA
    Returns a string specifying the bundled version of pip.
    )�_PIP_VERSIONrrrrr;scCs2dd�tjD�}|D]}tj|=qtjtjd<dS)NcSsg|]}|�d�r|�qS)ZPIP_)�
startswith)�.0�krrr�
<listcomp>Es
z7_disable_pip_configuration_settings.<locals>.<listcomp>ZPIP_CONFIG_FILE)r�environ�devnull)Zkeys_to_remover*rrr�#_disable_pip_configuration_settingsAs
r.F��root�upgrade�user�
altinstall�default_pip�	verbositycCst||||||d�dS)z�
    Bootstrap pip into the current Python installation (or the given root
    directory).

    Note that calling this function will alter both sys.path and os.environ.
    r/N)�
_bootstrapr/rrrrMs

�cCsP|r|rtd��t�d|�t�|r2dtjd<n|s@dtjd<t�����}g}tD]x\}}	}
t	||	}t
tj�t
|�d��4}t
tj�||�d��}
|
�|���W5QRXW5QRX|�tj�||��qTddd	d
|g}|r�|d|g7}|r�|dg7}|�r
|d
g7}|�r"|dd|g7}t|dd�tD�|�W5QR�SQRXdS)z�
    Bootstrap pip into the current Python installation (or the given root
    directory). Returns pip command status code.

    Note that calling this function will alter both sys.path and os.environ.
    z.Cannot use altinstall and default_pip togetherzensurepip.bootstrapr3ZENSUREPIP_OPTIONSZinstall�rb�wbz--no-cache-dirz
--no-indexz--find-links�--root�	--upgrade�--user�-�vcSsg|]}|d�qS�rr�r)�prrrr+�sz_bootstrap.<locals>.<listcomp>N)�
ValueErrorr�auditr.rr,�tempfileZTemporaryDirectory�	_PROJECTSr�openrr	r
�write�read�appendr&)r0r1r2r3r4r5Ztmpdirr#ZprojectrZpy_tagZ
wheel_nameZsfp�fpr"rrrr6\s4	
"

r6)r5cCs�zddl}Wntk
r"YdSX|jtkrNd}t|�|jt�tjd�dSt�dddg}|rt|dd	|g7}t	|d
d�t
t�D��S)z~Helper to support a clean default uninstall process on Windows

    Note that calling this function may alter os.environ.
    rNzOensurepip will only uninstall a matching version ({!r} installed, {!r} bundled))�fileZ	uninstallz-yz--disable-pip-version-checkr<r=cSsg|]}|d�qSr>rr?rrrr+�sz%_uninstall_helper.<locals>.<listcomp>)r�ImportError�__version__r'�printrr�stderrr.r&�reversedrD)r5r�msgr"rrr�_uninstall_helper�s

rQcCs�ddl}|jdd�}|jddd�t��dd�|jd	d
dddd
d�|jdddddd�|jddddd�|jdddd�|jddddd�|jddddd�|�|�}t|j|j|j	|j
|j|jd�S)Nrzpython -m ensurepip)�progz	--versionrzpip {}z9Show the version of pip that is bundled with this Python.)�actionr�helpz-vz	--verbose�countr5zDGive more output. Option is additive, and can be used up to 3 times.)rS�default�destrTz-Ur:�
store_trueFz8Upgrade pip and dependencies, even if already installed.)rSrVrTr;zInstall using the user scheme.r9z=Install everything relative to this alternate root directory.)rVrTz--altinstallzoMake an alternate install, installing only the X.Y versioned scripts (Default: pipX, pipX.Y, easy_install-X.Y).z
--default-pipzqMake a default pip install, installing the unqualified pip and easy_install in addition to the versioned scripts.)r0r1r2r5r3r4)
�argparse�ArgumentParser�add_argumentrr�
parse_argsr6r0r1r2r5r3r4)�argvrY�parserr"rrr�_main�sn
�������
�r_)N)N)Zdistutils.versionrr
rZos.pathrZrunpyrCr�__all__Z_PACKAGE_NAMESr
rrZ_SETUPTOOLS_VERSIONr'rDr&rr.rr6rQr_rrrr�<module>s@�
��6ensurepip/__pycache__/__main__.cpython-38.pyc000064400000000344151153537540015150 0ustar00U

e5dX�@s*ddlZddlZedkr&e�e���dS)�N�__main__)Z	ensurepip�sys�__name__�exitZ_main�rr�*/usr/lib64/python3.8/ensurepip/__main__.py�<module>soptparse.py000064400000165721151153537540007000 0ustar00"""A powerful, extensible, and easy-to-use option parser.

By Greg Ward <gward@python.net>

Originally distributed as Optik.

For support, use the optik-users@lists.sourceforge.net mailing list
(http://lists.sourceforge.net/lists/listinfo/optik-users).

Simple usage example:

   from optparse import OptionParser

   parser = OptionParser()
   parser.add_option("-f", "--file", dest="filename",
                     help="write report to FILE", metavar="FILE")
   parser.add_option("-q", "--quiet",
                     action="store_false", dest="verbose", default=True,
                     help="don't print status messages to stdout")

   (options, args) = parser.parse_args()
"""

__version__ = "1.5.3"

__all__ = ['Option',
           'make_option',
           'SUPPRESS_HELP',
           'SUPPRESS_USAGE',
           'Values',
           'OptionContainer',
           'OptionGroup',
           'OptionParser',
           'HelpFormatter',
           'IndentedHelpFormatter',
           'TitledHelpFormatter',
           'OptParseError',
           'OptionError',
           'OptionConflictError',
           'OptionValueError',
           'BadOptionError',
           'check_choice']

__copyright__ = """
Copyright (c) 2001-2006 Gregory P. Ward.  All rights reserved.
Copyright (c) 2002-2006 Python Software Foundation.  All rights reserved.

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

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

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

  * Neither the name of the author nor the names of its
    contributors may be used to endorse or promote products derived from
    this software without specific prior written permission.

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

import sys, os
import textwrap

def _repr(self):
    return "<%s at 0x%x: %s>" % (self.__class__.__name__, id(self), self)


# This file was generated from:
#   Id: option_parser.py 527 2006-07-23 15:21:30Z greg
#   Id: option.py 522 2006-06-11 16:22:03Z gward
#   Id: help.py 527 2006-07-23 15:21:30Z greg
#   Id: errors.py 509 2006-04-20 00:58:24Z gward

try:
    from gettext import gettext, ngettext
except ImportError:
    def gettext(message):
        return message

    def ngettext(singular, plural, n):
        if n == 1:
            return singular
        return plural

_ = gettext


class OptParseError (Exception):
    def __init__(self, msg):
        self.msg = msg

    def __str__(self):
        return self.msg


class OptionError (OptParseError):
    """
    Raised if an Option instance is created with invalid or
    inconsistent arguments.
    """

    def __init__(self, msg, option):
        self.msg = msg
        self.option_id = str(option)

    def __str__(self):
        if self.option_id:
            return "option %s: %s" % (self.option_id, self.msg)
        else:
            return self.msg

class OptionConflictError (OptionError):
    """
    Raised if conflicting options are added to an OptionParser.
    """

class OptionValueError (OptParseError):
    """
    Raised if an invalid option value is encountered on the command
    line.
    """

class BadOptionError (OptParseError):
    """
    Raised if an invalid option is seen on the command line.
    """
    def __init__(self, opt_str):
        self.opt_str = opt_str

    def __str__(self):
        return _("no such option: %s") % self.opt_str

class AmbiguousOptionError (BadOptionError):
    """
    Raised if an ambiguous option is seen on the command line.
    """
    def __init__(self, opt_str, possibilities):
        BadOptionError.__init__(self, opt_str)
        self.possibilities = possibilities

    def __str__(self):
        return (_("ambiguous option: %s (%s?)")
                % (self.opt_str, ", ".join(self.possibilities)))


class HelpFormatter:

    """
    Abstract base class for formatting option help.  OptionParser
    instances should use one of the HelpFormatter subclasses for
    formatting help; by default IndentedHelpFormatter is used.

    Instance attributes:
      parser : OptionParser
        the controlling OptionParser instance
      indent_increment : int
        the number of columns to indent per nesting level
      max_help_position : int
        the maximum starting column for option help text
      help_position : int
        the calculated starting column for option help text;
        initially the same as the maximum
      width : int
        total number of columns for output (pass None to constructor for
        this value to be taken from the $COLUMNS environment variable)
      level : int
        current indentation level
      current_indent : int
        current indentation level (in columns)
      help_width : int
        number of columns available for option help text (calculated)
      default_tag : str
        text to replace with each option's default value, "%default"
        by default.  Set to false value to disable default value expansion.
      option_strings : { Option : str }
        maps Option instances to the snippet of help text explaining
        the syntax of that option, e.g. "-h, --help" or
        "-fFILE, --file=FILE"
      _short_opt_fmt : str
        format string controlling how short options with values are
        printed in help text.  Must be either "%s%s" ("-fFILE") or
        "%s %s" ("-f FILE"), because those are the two syntaxes that
        Optik supports.
      _long_opt_fmt : str
        similar but for long options; must be either "%s %s" ("--file FILE")
        or "%s=%s" ("--file=FILE").
    """

    NO_DEFAULT_VALUE = "none"

    def __init__(self,
                 indent_increment,
                 max_help_position,
                 width,
                 short_first):
        self.parser = None
        self.indent_increment = indent_increment
        if width is None:
            try:
                width = int(os.environ['COLUMNS'])
            except (KeyError, ValueError):
                width = 80
            width -= 2
        self.width = width
        self.help_position = self.max_help_position = \
                min(max_help_position, max(width - 20, indent_increment * 2))
        self.current_indent = 0
        self.level = 0
        self.help_width = None          # computed later
        self.short_first = short_first
        self.default_tag = "%default"
        self.option_strings = {}
        self._short_opt_fmt = "%s %s"
        self._long_opt_fmt = "%s=%s"

    def set_parser(self, parser):
        self.parser = parser

    def set_short_opt_delimiter(self, delim):
        if delim not in ("", " "):
            raise ValueError(
                "invalid metavar delimiter for short options: %r" % delim)
        self._short_opt_fmt = "%s" + delim + "%s"

    def set_long_opt_delimiter(self, delim):
        if delim not in ("=", " "):
            raise ValueError(
                "invalid metavar delimiter for long options: %r" % delim)
        self._long_opt_fmt = "%s" + delim + "%s"

    def indent(self):
        self.current_indent += self.indent_increment
        self.level += 1

    def dedent(self):
        self.current_indent -= self.indent_increment
        assert self.current_indent >= 0, "Indent decreased below 0."
        self.level -= 1

    def format_usage(self, usage):
        raise NotImplementedError("subclasses must implement")

    def format_heading(self, heading):
        raise NotImplementedError("subclasses must implement")

    def _format_text(self, text):
        """
        Format a paragraph of free-form text for inclusion in the
        help output at the current indentation level.
        """
        text_width = max(self.width - self.current_indent, 11)
        indent = " "*self.current_indent
        return textwrap.fill(text,
                             text_width,
                             initial_indent=indent,
                             subsequent_indent=indent)

    def format_description(self, description):
        if description:
            return self._format_text(description) + "\n"
        else:
            return ""

    def format_epilog(self, epilog):
        if epilog:
            return "\n" + self._format_text(epilog) + "\n"
        else:
            return ""


    def expand_default(self, option):
        if self.parser is None or not self.default_tag:
            return option.help

        default_value = self.parser.defaults.get(option.dest)
        if default_value is NO_DEFAULT or default_value is None:
            default_value = self.NO_DEFAULT_VALUE

        return option.help.replace(self.default_tag, str(default_value))

    def format_option(self, option):
        # The help for each option consists of two parts:
        #   * the opt strings and metavars
        #     eg. ("-x", or "-fFILENAME, --file=FILENAME")
        #   * the user-supplied help string
        #     eg. ("turn on expert mode", "read data from FILENAME")
        #
        # If possible, we write both of these on the same line:
        #   -x      turn on expert mode
        #
        # But if the opt string list is too long, we put the help
        # string on a second line, indented to the same column it would
        # start in if it fit on the first line.
        #   -fFILENAME, --file=FILENAME
        #           read data from FILENAME
        result = []
        opts = self.option_strings[option]
        opt_width = self.help_position - self.current_indent - 2
        if len(opts) > opt_width:
            opts = "%*s%s\n" % (self.current_indent, "", opts)
            indent_first = self.help_position
        else:                       # start help on same line as opts
            opts = "%*s%-*s  " % (self.current_indent, "", opt_width, opts)
            indent_first = 0
        result.append(opts)
        if option.help:
            help_text = self.expand_default(option)
            help_lines = textwrap.wrap(help_text, self.help_width)
            result.append("%*s%s\n" % (indent_first, "", help_lines[0]))
            result.extend(["%*s%s\n" % (self.help_position, "", line)
                           for line in help_lines[1:]])
        elif opts[-1] != "\n":
            result.append("\n")
        return "".join(result)

    def store_option_strings(self, parser):
        self.indent()
        max_len = 0
        for opt in parser.option_list:
            strings = self.format_option_strings(opt)
            self.option_strings[opt] = strings
            max_len = max(max_len, len(strings) + self.current_indent)
        self.indent()
        for group in parser.option_groups:
            for opt in group.option_list:
                strings = self.format_option_strings(opt)
                self.option_strings[opt] = strings
                max_len = max(max_len, len(strings) + self.current_indent)
        self.dedent()
        self.dedent()
        self.help_position = min(max_len + 2, self.max_help_position)
        self.help_width = max(self.width - self.help_position, 11)

    def format_option_strings(self, option):
        """Return a comma-separated list of option strings & metavariables."""
        if option.takes_value():
            metavar = option.metavar or option.dest.upper()
            short_opts = [self._short_opt_fmt % (sopt, metavar)
                          for sopt in option._short_opts]
            long_opts = [self._long_opt_fmt % (lopt, metavar)
                         for lopt in option._long_opts]
        else:
            short_opts = option._short_opts
            long_opts = option._long_opts

        if self.short_first:
            opts = short_opts + long_opts
        else:
            opts = long_opts + short_opts

        return ", ".join(opts)

class IndentedHelpFormatter (HelpFormatter):
    """Format help with indented section bodies.
    """

    def __init__(self,
                 indent_increment=2,
                 max_help_position=24,
                 width=None,
                 short_first=1):
        HelpFormatter.__init__(
            self, indent_increment, max_help_position, width, short_first)

    def format_usage(self, usage):
        return _("Usage: %s\n") % usage

    def format_heading(self, heading):
        return "%*s%s:\n" % (self.current_indent, "", heading)


class TitledHelpFormatter (HelpFormatter):
    """Format help with underlined section headers.
    """

    def __init__(self,
                 indent_increment=0,
                 max_help_position=24,
                 width=None,
                 short_first=0):
        HelpFormatter.__init__ (
            self, indent_increment, max_help_position, width, short_first)

    def format_usage(self, usage):
        return "%s  %s\n" % (self.format_heading(_("Usage")), usage)

    def format_heading(self, heading):
        return "%s\n%s\n" % (heading, "=-"[self.level] * len(heading))


def _parse_num(val, type):
    if val[:2].lower() == "0x":         # hexadecimal
        radix = 16
    elif val[:2].lower() == "0b":       # binary
        radix = 2
        val = val[2:] or "0"            # have to remove "0b" prefix
    elif val[:1] == "0":                # octal
        radix = 8
    else:                               # decimal
        radix = 10

    return type(val, radix)

def _parse_int(val):
    return _parse_num(val, int)

_builtin_cvt = { "int" : (_parse_int, _("integer")),
                 "long" : (_parse_int, _("integer")),
                 "float" : (float, _("floating-point")),
                 "complex" : (complex, _("complex")) }

def check_builtin(option, opt, value):
    (cvt, what) = _builtin_cvt[option.type]
    try:
        return cvt(value)
    except ValueError:
        raise OptionValueError(
            _("option %s: invalid %s value: %r") % (opt, what, value))

def check_choice(option, opt, value):
    if value in option.choices:
        return value
    else:
        choices = ", ".join(map(repr, option.choices))
        raise OptionValueError(
            _("option %s: invalid choice: %r (choose from %s)")
            % (opt, value, choices))

# Not supplying a default is different from a default of None,
# so we need an explicit "not supplied" value.
NO_DEFAULT = ("NO", "DEFAULT")


class Option:
    """
    Instance attributes:
      _short_opts : [string]
      _long_opts : [string]

      action : string
      type : string
      dest : string
      default : any
      nargs : int
      const : any
      choices : [string]
      callback : function
      callback_args : (any*)
      callback_kwargs : { string : any }
      help : string
      metavar : string
    """

    # The list of instance attributes that may be set through
    # keyword args to the constructor.
    ATTRS = ['action',
             'type',
             'dest',
             'default',
             'nargs',
             'const',
             'choices',
             'callback',
             'callback_args',
             'callback_kwargs',
             'help',
             'metavar']

    # The set of actions allowed by option parsers.  Explicitly listed
    # here so the constructor can validate its arguments.
    ACTIONS = ("store",
               "store_const",
               "store_true",
               "store_false",
               "append",
               "append_const",
               "count",
               "callback",
               "help",
               "version")

    # The set of actions that involve storing a value somewhere;
    # also listed just for constructor argument validation.  (If
    # the action is one of these, there must be a destination.)
    STORE_ACTIONS = ("store",
                     "store_const",
                     "store_true",
                     "store_false",
                     "append",
                     "append_const",
                     "count")

    # The set of actions for which it makes sense to supply a value
    # type, ie. which may consume an argument from the command line.
    TYPED_ACTIONS = ("store",
                     "append",
                     "callback")

    # The set of actions which *require* a value type, ie. that
    # always consume an argument from the command line.
    ALWAYS_TYPED_ACTIONS = ("store",
                            "append")

    # The set of actions which take a 'const' attribute.
    CONST_ACTIONS = ("store_const",
                     "append_const")

    # The set of known types for option parsers.  Again, listed here for
    # constructor argument validation.
    TYPES = ("string", "int", "long", "float", "complex", "choice")

    # Dictionary of argument checking functions, which convert and
    # validate option arguments according to the option type.
    #
    # Signature of checking functions is:
    #   check(option : Option, opt : string, value : string) -> any
    # where
    #   option is the Option instance calling the checker
    #   opt is the actual option seen on the command-line
    #     (eg. "-a", "--file")
    #   value is the option argument seen on the command-line
    #
    # The return value should be in the appropriate Python type
    # for option.type -- eg. an integer if option.type == "int".
    #
    # If no checker is defined for a type, arguments will be
    # unchecked and remain strings.
    TYPE_CHECKER = { "int"    : check_builtin,
                     "long"   : check_builtin,
                     "float"  : check_builtin,
                     "complex": check_builtin,
                     "choice" : check_choice,
                   }


    # CHECK_METHODS is a list of unbound method objects; they are called
    # by the constructor, in order, after all attributes are
    # initialized.  The list is created and filled in later, after all
    # the methods are actually defined.  (I just put it here because I
    # like to define and document all class attributes in the same
    # place.)  Subclasses that add another _check_*() method should
    # define their own CHECK_METHODS list that adds their check method
    # to those from this class.
    CHECK_METHODS = None


    # -- Constructor/initialization methods ----------------------------

    def __init__(self, *opts, **attrs):
        # Set _short_opts, _long_opts attrs from 'opts' tuple.
        # Have to be set now, in case no option strings are supplied.
        self._short_opts = []
        self._long_opts = []
        opts = self._check_opt_strings(opts)
        self._set_opt_strings(opts)

        # Set all other attrs (action, type, etc.) from 'attrs' dict
        self._set_attrs(attrs)

        # Check all the attributes we just set.  There are lots of
        # complicated interdependencies, but luckily they can be farmed
        # out to the _check_*() methods listed in CHECK_METHODS -- which
        # could be handy for subclasses!  The one thing these all share
        # is that they raise OptionError if they discover a problem.
        for checker in self.CHECK_METHODS:
            checker(self)

    def _check_opt_strings(self, opts):
        # Filter out None because early versions of Optik had exactly
        # one short option and one long option, either of which
        # could be None.
        opts = [opt for opt in opts if opt]
        if not opts:
            raise TypeError("at least one option string must be supplied")
        return opts

    def _set_opt_strings(self, opts):
        for opt in opts:
            if len(opt) < 2:
                raise OptionError(
                    "invalid option string %r: "
                    "must be at least two characters long" % opt, self)
            elif len(opt) == 2:
                if not (opt[0] == "-" and opt[1] != "-"):
                    raise OptionError(
                        "invalid short option string %r: "
                        "must be of the form -x, (x any non-dash char)" % opt,
                        self)
                self._short_opts.append(opt)
            else:
                if not (opt[0:2] == "--" and opt[2] != "-"):
                    raise OptionError(
                        "invalid long option string %r: "
                        "must start with --, followed by non-dash" % opt,
                        self)
                self._long_opts.append(opt)

    def _set_attrs(self, attrs):
        for attr in self.ATTRS:
            if attr in attrs:
                setattr(self, attr, attrs[attr])
                del attrs[attr]
            else:
                if attr == 'default':
                    setattr(self, attr, NO_DEFAULT)
                else:
                    setattr(self, attr, None)
        if attrs:
            attrs = sorted(attrs.keys())
            raise OptionError(
                "invalid keyword arguments: %s" % ", ".join(attrs),
                self)


    # -- Constructor validation methods --------------------------------

    def _check_action(self):
        if self.action is None:
            self.action = "store"
        elif self.action not in self.ACTIONS:
            raise OptionError("invalid action: %r" % self.action, self)

    def _check_type(self):
        if self.type is None:
            if self.action in self.ALWAYS_TYPED_ACTIONS:
                if self.choices is not None:
                    # The "choices" attribute implies "choice" type.
                    self.type = "choice"
                else:
                    # No type given?  "string" is the most sensible default.
                    self.type = "string"
        else:
            # Allow type objects or builtin type conversion functions
            # (int, str, etc.) as an alternative to their names.
            if isinstance(self.type, type):
                self.type = self.type.__name__

            if self.type == "str":
                self.type = "string"

            if self.type not in self.TYPES:
                raise OptionError("invalid option type: %r" % self.type, self)
            if self.action not in self.TYPED_ACTIONS:
                raise OptionError(
                    "must not supply a type for action %r" % self.action, self)

    def _check_choice(self):
        if self.type == "choice":
            if self.choices is None:
                raise OptionError(
                    "must supply a list of choices for type 'choice'", self)
            elif not isinstance(self.choices, (tuple, list)):
                raise OptionError(
                    "choices must be a list of strings ('%s' supplied)"
                    % str(type(self.choices)).split("'")[1], self)
        elif self.choices is not None:
            raise OptionError(
                "must not supply choices for type %r" % self.type, self)

    def _check_dest(self):
        # No destination given, and we need one for this action.  The
        # self.type check is for callbacks that take a value.
        takes_value = (self.action in self.STORE_ACTIONS or
                       self.type is not None)
        if self.dest is None and takes_value:

            # Glean a destination from the first long option string,
            # or from the first short option string if no long options.
            if self._long_opts:
                # eg. "--foo-bar" -> "foo_bar"
                self.dest = self._long_opts[0][2:].replace('-', '_')
            else:
                self.dest = self._short_opts[0][1]

    def _check_const(self):
        if self.action not in self.CONST_ACTIONS and self.const is not None:
            raise OptionError(
                "'const' must not be supplied for action %r" % self.action,
                self)

    def _check_nargs(self):
        if self.action in self.TYPED_ACTIONS:
            if self.nargs is None:
                self.nargs = 1
        elif self.nargs is not None:
            raise OptionError(
                "'nargs' must not be supplied for action %r" % self.action,
                self)

    def _check_callback(self):
        if self.action == "callback":
            if not callable(self.callback):
                raise OptionError(
                    "callback not callable: %r" % self.callback, self)
            if (self.callback_args is not None and
                not isinstance(self.callback_args, tuple)):
                raise OptionError(
                    "callback_args, if supplied, must be a tuple: not %r"
                    % self.callback_args, self)
            if (self.callback_kwargs is not None and
                not isinstance(self.callback_kwargs, dict)):
                raise OptionError(
                    "callback_kwargs, if supplied, must be a dict: not %r"
                    % self.callback_kwargs, self)
        else:
            if self.callback is not None:
                raise OptionError(
                    "callback supplied (%r) for non-callback option"
                    % self.callback, self)
            if self.callback_args is not None:
                raise OptionError(
                    "callback_args supplied for non-callback option", self)
            if self.callback_kwargs is not None:
                raise OptionError(
                    "callback_kwargs supplied for non-callback option", self)


    CHECK_METHODS = [_check_action,
                     _check_type,
                     _check_choice,
                     _check_dest,
                     _check_const,
                     _check_nargs,
                     _check_callback]


    # -- Miscellaneous methods -----------------------------------------

    def __str__(self):
        return "/".join(self._short_opts + self._long_opts)

    __repr__ = _repr

    def takes_value(self):
        return self.type is not None

    def get_opt_string(self):
        if self._long_opts:
            return self._long_opts[0]
        else:
            return self._short_opts[0]


    # -- Processing methods --------------------------------------------

    def check_value(self, opt, value):
        checker = self.TYPE_CHECKER.get(self.type)
        if checker is None:
            return value
        else:
            return checker(self, opt, value)

    def convert_value(self, opt, value):
        if value is not None:
            if self.nargs == 1:
                return self.check_value(opt, value)
            else:
                return tuple([self.check_value(opt, v) for v in value])

    def process(self, opt, value, values, parser):

        # First, convert the value(s) to the right type.  Howl if any
        # value(s) are bogus.
        value = self.convert_value(opt, value)

        # And then take whatever action is expected of us.
        # This is a separate method to make life easier for
        # subclasses to add new actions.
        return self.take_action(
            self.action, self.dest, opt, value, values, parser)

    def take_action(self, action, dest, opt, value, values, parser):
        if action == "store":
            setattr(values, dest, value)
        elif action == "store_const":
            setattr(values, dest, self.const)
        elif action == "store_true":
            setattr(values, dest, True)
        elif action == "store_false":
            setattr(values, dest, False)
        elif action == "append":
            values.ensure_value(dest, []).append(value)
        elif action == "append_const":
            values.ensure_value(dest, []).append(self.const)
        elif action == "count":
            setattr(values, dest, values.ensure_value(dest, 0) + 1)
        elif action == "callback":
            args = self.callback_args or ()
            kwargs = self.callback_kwargs or {}
            self.callback(self, opt, value, parser, *args, **kwargs)
        elif action == "help":
            parser.print_help()
            parser.exit()
        elif action == "version":
            parser.print_version()
            parser.exit()
        else:
            raise ValueError("unknown action %r" % self.action)

        return 1

# class Option


SUPPRESS_HELP = "SUPPRESS"+"HELP"
SUPPRESS_USAGE = "SUPPRESS"+"USAGE"

class Values:

    def __init__(self, defaults=None):
        if defaults:
            for (attr, val) in defaults.items():
                setattr(self, attr, val)

    def __str__(self):
        return str(self.__dict__)

    __repr__ = _repr

    def __eq__(self, other):
        if isinstance(other, Values):
            return self.__dict__ == other.__dict__
        elif isinstance(other, dict):
            return self.__dict__ == other
        else:
            return NotImplemented

    def _update_careful(self, dict):
        """
        Update the option values from an arbitrary dictionary, but only
        use keys from dict that already have a corresponding attribute
        in self.  Any keys in dict without a corresponding attribute
        are silently ignored.
        """
        for attr in dir(self):
            if attr in dict:
                dval = dict[attr]
                if dval is not None:
                    setattr(self, attr, dval)

    def _update_loose(self, dict):
        """
        Update the option values from an arbitrary dictionary,
        using all keys from the dictionary regardless of whether
        they have a corresponding attribute in self or not.
        """
        self.__dict__.update(dict)

    def _update(self, dict, mode):
        if mode == "careful":
            self._update_careful(dict)
        elif mode == "loose":
            self._update_loose(dict)
        else:
            raise ValueError("invalid update mode: %r" % mode)

    def read_module(self, modname, mode="careful"):
        __import__(modname)
        mod = sys.modules[modname]
        self._update(vars(mod), mode)

    def read_file(self, filename, mode="careful"):
        vars = {}
        exec(open(filename).read(), vars)
        self._update(vars, mode)

    def ensure_value(self, attr, value):
        if not hasattr(self, attr) or getattr(self, attr) is None:
            setattr(self, attr, value)
        return getattr(self, attr)


class OptionContainer:

    """
    Abstract base class.

    Class attributes:
      standard_option_list : [Option]
        list of standard options that will be accepted by all instances
        of this parser class (intended to be overridden by subclasses).

    Instance attributes:
      option_list : [Option]
        the list of Option objects contained by this OptionContainer
      _short_opt : { string : Option }
        dictionary mapping short option strings, eg. "-f" or "-X",
        to the Option instances that implement them.  If an Option
        has multiple short option strings, it will appear in this
        dictionary multiple times. [1]
      _long_opt : { string : Option }
        dictionary mapping long option strings, eg. "--file" or
        "--exclude", to the Option instances that implement them.
        Again, a given Option can occur multiple times in this
        dictionary. [1]
      defaults : { string : any }
        dictionary mapping option destination names to default
        values for each destination [1]

    [1] These mappings are common to (shared by) all components of the
        controlling OptionParser, where they are initially created.

    """

    def __init__(self, option_class, conflict_handler, description):
        # Initialize the option list and related data structures.
        # This method must be provided by subclasses, and it must
        # initialize at least the following instance attributes:
        # option_list, _short_opt, _long_opt, defaults.
        self._create_option_list()

        self.option_class = option_class
        self.set_conflict_handler(conflict_handler)
        self.set_description(description)

    def _create_option_mappings(self):
        # For use by OptionParser constructor -- create the main
        # option mappings used by this OptionParser and all
        # OptionGroups that it owns.
        self._short_opt = {}            # single letter -> Option instance
        self._long_opt = {}             # long option -> Option instance
        self.defaults = {}              # maps option dest -> default value


    def _share_option_mappings(self, parser):
        # For use by OptionGroup constructor -- use shared option
        # mappings from the OptionParser that owns this OptionGroup.
        self._short_opt = parser._short_opt
        self._long_opt = parser._long_opt
        self.defaults = parser.defaults

    def set_conflict_handler(self, handler):
        if handler not in ("error", "resolve"):
            raise ValueError("invalid conflict_resolution value %r" % handler)
        self.conflict_handler = handler

    def set_description(self, description):
        self.description = description

    def get_description(self):
        return self.description


    def destroy(self):
        """see OptionParser.destroy()."""
        del self._short_opt
        del self._long_opt
        del self.defaults


    # -- Option-adding methods -----------------------------------------

    def _check_conflict(self, option):
        conflict_opts = []
        for opt in option._short_opts:
            if opt in self._short_opt:
                conflict_opts.append((opt, self._short_opt[opt]))
        for opt in option._long_opts:
            if opt in self._long_opt:
                conflict_opts.append((opt, self._long_opt[opt]))

        if conflict_opts:
            handler = self.conflict_handler
            if handler == "error":
                raise OptionConflictError(
                    "conflicting option string(s): %s"
                    % ", ".join([co[0] for co in conflict_opts]),
                    option)
            elif handler == "resolve":
                for (opt, c_option) in conflict_opts:
                    if opt.startswith("--"):
                        c_option._long_opts.remove(opt)
                        del self._long_opt[opt]
                    else:
                        c_option._short_opts.remove(opt)
                        del self._short_opt[opt]
                    if not (c_option._short_opts or c_option._long_opts):
                        c_option.container.option_list.remove(c_option)

    def add_option(self, *args, **kwargs):
        """add_option(Option)
           add_option(opt_str, ..., kwarg=val, ...)
        """
        if isinstance(args[0], str):
            option = self.option_class(*args, **kwargs)
        elif len(args) == 1 and not kwargs:
            option = args[0]
            if not isinstance(option, Option):
                raise TypeError("not an Option instance: %r" % option)
        else:
            raise TypeError("invalid arguments")

        self._check_conflict(option)

        self.option_list.append(option)
        option.container = self
        for opt in option._short_opts:
            self._short_opt[opt] = option
        for opt in option._long_opts:
            self._long_opt[opt] = option

        if option.dest is not None:     # option has a dest, we need a default
            if option.default is not NO_DEFAULT:
                self.defaults[option.dest] = option.default
            elif option.dest not in self.defaults:
                self.defaults[option.dest] = None

        return option

    def add_options(self, option_list):
        for option in option_list:
            self.add_option(option)

    # -- Option query/removal methods ----------------------------------

    def get_option(self, opt_str):
        return (self._short_opt.get(opt_str) or
                self._long_opt.get(opt_str))

    def has_option(self, opt_str):
        return (opt_str in self._short_opt or
                opt_str in self._long_opt)

    def remove_option(self, opt_str):
        option = self._short_opt.get(opt_str)
        if option is None:
            option = self._long_opt.get(opt_str)
        if option is None:
            raise ValueError("no such option %r" % opt_str)

        for opt in option._short_opts:
            del self._short_opt[opt]
        for opt in option._long_opts:
            del self._long_opt[opt]
        option.container.option_list.remove(option)


    # -- Help-formatting methods ---------------------------------------

    def format_option_help(self, formatter):
        if not self.option_list:
            return ""
        result = []
        for option in self.option_list:
            if not option.help is SUPPRESS_HELP:
                result.append(formatter.format_option(option))
        return "".join(result)

    def format_description(self, formatter):
        return formatter.format_description(self.get_description())

    def format_help(self, formatter):
        result = []
        if self.description:
            result.append(self.format_description(formatter))
        if self.option_list:
            result.append(self.format_option_help(formatter))
        return "\n".join(result)


class OptionGroup (OptionContainer):

    def __init__(self, parser, title, description=None):
        self.parser = parser
        OptionContainer.__init__(
            self, parser.option_class, parser.conflict_handler, description)
        self.title = title

    def _create_option_list(self):
        self.option_list = []
        self._share_option_mappings(self.parser)

    def set_title(self, title):
        self.title = title

    def destroy(self):
        """see OptionParser.destroy()."""
        OptionContainer.destroy(self)
        del self.option_list

    # -- Help-formatting methods ---------------------------------------

    def format_help(self, formatter):
        result = formatter.format_heading(self.title)
        formatter.indent()
        result += OptionContainer.format_help(self, formatter)
        formatter.dedent()
        return result


class OptionParser (OptionContainer):

    """
    Class attributes:
      standard_option_list : [Option]
        list of standard options that will be accepted by all instances
        of this parser class (intended to be overridden by subclasses).

    Instance attributes:
      usage : string
        a usage string for your program.  Before it is displayed
        to the user, "%prog" will be expanded to the name of
        your program (self.prog or os.path.basename(sys.argv[0])).
      prog : string
        the name of the current program (to override
        os.path.basename(sys.argv[0])).
      description : string
        A paragraph of text giving a brief overview of your program.
        optparse reformats this paragraph to fit the current terminal
        width and prints it when the user requests help (after usage,
        but before the list of options).
      epilog : string
        paragraph of help text to print after option help

      option_groups : [OptionGroup]
        list of option groups in this parser (option groups are
        irrelevant for parsing the command-line, but very useful
        for generating help)

      allow_interspersed_args : bool = true
        if true, positional arguments may be interspersed with options.
        Assuming -a and -b each take a single argument, the command-line
          -ablah foo bar -bboo baz
        will be interpreted the same as
          -ablah -bboo -- foo bar baz
        If this flag were false, that command line would be interpreted as
          -ablah -- foo bar -bboo baz
        -- ie. we stop processing options as soon as we see the first
        non-option argument.  (This is the tradition followed by
        Python's getopt module, Perl's Getopt::Std, and other argument-
        parsing libraries, but it is generally annoying to users.)

      process_default_values : bool = true
        if true, option default values are processed similarly to option
        values from the command line: that is, they are passed to the
        type-checking function for the option's type (as long as the
        default value is a string).  (This really only matters if you
        have defined custom types; see SF bug #955889.)  Set it to false
        to restore the behaviour of Optik 1.4.1 and earlier.

      rargs : [string]
        the argument list currently being parsed.  Only set when
        parse_args() is active, and continually trimmed down as
        we consume arguments.  Mainly there for the benefit of
        callback options.
      largs : [string]
        the list of leftover arguments that we have skipped while
        parsing options.  If allow_interspersed_args is false, this
        list is always empty.
      values : Values
        the set of option values currently being accumulated.  Only
        set when parse_args() is active.  Also mainly for callbacks.

    Because of the 'rargs', 'largs', and 'values' attributes,
    OptionParser is not thread-safe.  If, for some perverse reason, you
    need to parse command-line arguments simultaneously in different
    threads, use different OptionParser instances.

    """

    standard_option_list = []

    def __init__(self,
                 usage=None,
                 option_list=None,
                 option_class=Option,
                 version=None,
                 conflict_handler="error",
                 description=None,
                 formatter=None,
                 add_help_option=True,
                 prog=None,
                 epilog=None):
        OptionContainer.__init__(
            self, option_class, conflict_handler, description)
        self.set_usage(usage)
        self.prog = prog
        self.version = version
        self.allow_interspersed_args = True
        self.process_default_values = True
        if formatter is None:
            formatter = IndentedHelpFormatter()
        self.formatter = formatter
        self.formatter.set_parser(self)
        self.epilog = epilog

        # Populate the option list; initial sources are the
        # standard_option_list class attribute, the 'option_list'
        # argument, and (if applicable) the _add_version_option() and
        # _add_help_option() methods.
        self._populate_option_list(option_list,
                                   add_help=add_help_option)

        self._init_parsing_state()


    def destroy(self):
        """
        Declare that you are done with this OptionParser.  This cleans up
        reference cycles so the OptionParser (and all objects referenced by
        it) can be garbage-collected promptly.  After calling destroy(), the
        OptionParser is unusable.
        """
        OptionContainer.destroy(self)
        for group in self.option_groups:
            group.destroy()
        del self.option_list
        del self.option_groups
        del self.formatter


    # -- Private methods -----------------------------------------------
    # (used by our or OptionContainer's constructor)

    def _create_option_list(self):
        self.option_list = []
        self.option_groups = []
        self._create_option_mappings()

    def _add_help_option(self):
        self.add_option("-h", "--help",
                        action="help",
                        help=_("show this help message and exit"))

    def _add_version_option(self):
        self.add_option("--version",
                        action="version",
                        help=_("show program's version number and exit"))

    def _populate_option_list(self, option_list, add_help=True):
        if self.standard_option_list:
            self.add_options(self.standard_option_list)
        if option_list:
            self.add_options(option_list)
        if self.version:
            self._add_version_option()
        if add_help:
            self._add_help_option()

    def _init_parsing_state(self):
        # These are set in parse_args() for the convenience of callbacks.
        self.rargs = None
        self.largs = None
        self.values = None


    # -- Simple modifier methods ---------------------------------------

    def set_usage(self, usage):
        if usage is None:
            self.usage = _("%prog [options]")
        elif usage is SUPPRESS_USAGE:
            self.usage = None
        # For backwards compatibility with Optik 1.3 and earlier.
        elif usage.lower().startswith("usage: "):
            self.usage = usage[7:]
        else:
            self.usage = usage

    def enable_interspersed_args(self):
        """Set parsing to not stop on the first non-option, allowing
        interspersing switches with command arguments. This is the
        default behavior. See also disable_interspersed_args() and the
        class documentation description of the attribute
        allow_interspersed_args."""
        self.allow_interspersed_args = True

    def disable_interspersed_args(self):
        """Set parsing to stop on the first non-option. Use this if
        you have a command processor which runs another command that
        has options of its own and you want to make sure these options
        don't get confused.
        """
        self.allow_interspersed_args = False

    def set_process_default_values(self, process):
        self.process_default_values = process

    def set_default(self, dest, value):
        self.defaults[dest] = value

    def set_defaults(self, **kwargs):
        self.defaults.update(kwargs)

    def _get_all_options(self):
        options = self.option_list[:]
        for group in self.option_groups:
            options.extend(group.option_list)
        return options

    def get_default_values(self):
        if not self.process_default_values:
            # Old, pre-Optik 1.5 behaviour.
            return Values(self.defaults)

        defaults = self.defaults.copy()
        for option in self._get_all_options():
            default = defaults.get(option.dest)
            if isinstance(default, str):
                opt_str = option.get_opt_string()
                defaults[option.dest] = option.check_value(opt_str, default)

        return Values(defaults)


    # -- OptionGroup methods -------------------------------------------

    def add_option_group(self, *args, **kwargs):
        # XXX lots of overlap with OptionContainer.add_option()
        if isinstance(args[0], str):
            group = OptionGroup(self, *args, **kwargs)
        elif len(args) == 1 and not kwargs:
            group = args[0]
            if not isinstance(group, OptionGroup):
                raise TypeError("not an OptionGroup instance: %r" % group)
            if group.parser is not self:
                raise ValueError("invalid OptionGroup (wrong parser)")
        else:
            raise TypeError("invalid arguments")

        self.option_groups.append(group)
        return group

    def get_option_group(self, opt_str):
        option = (self._short_opt.get(opt_str) or
                  self._long_opt.get(opt_str))
        if option and option.container is not self:
            return option.container
        return None


    # -- Option-parsing methods ----------------------------------------

    def _get_args(self, args):
        if args is None:
            return sys.argv[1:]
        else:
            return args[:]              # don't modify caller's list

    def parse_args(self, args=None, values=None):
        """
        parse_args(args : [string] = sys.argv[1:],
                   values : Values = None)
        -> (values : Values, args : [string])

        Parse the command-line options found in 'args' (default:
        sys.argv[1:]).  Any errors result in a call to 'error()', which
        by default prints the usage message to stderr and calls
        sys.exit() with an error message.  On success returns a pair
        (values, args) where 'values' is a Values instance (with all
        your option values) and 'args' is the list of arguments left
        over after parsing options.
        """
        rargs = self._get_args(args)
        if values is None:
            values = self.get_default_values()

        # Store the halves of the argument list as attributes for the
        # convenience of callbacks:
        #   rargs
        #     the rest of the command-line (the "r" stands for
        #     "remaining" or "right-hand")
        #   largs
        #     the leftover arguments -- ie. what's left after removing
        #     options and their arguments (the "l" stands for "leftover"
        #     or "left-hand")
        self.rargs = rargs
        self.largs = largs = []
        self.values = values

        try:
            stop = self._process_args(largs, rargs, values)
        except (BadOptionError, OptionValueError) as err:
            self.error(str(err))

        args = largs + rargs
        return self.check_values(values, args)

    def check_values(self, values, args):
        """
        check_values(values : Values, args : [string])
        -> (values : Values, args : [string])

        Check that the supplied option values and leftover arguments are
        valid.  Returns the option values and leftover arguments
        (possibly adjusted, possibly completely new -- whatever you
        like).  Default implementation just returns the passed-in
        values; subclasses may override as desired.
        """
        return (values, args)

    def _process_args(self, largs, rargs, values):
        """_process_args(largs : [string],
                         rargs : [string],
                         values : Values)

        Process command-line arguments and populate 'values', consuming
        options and arguments from 'rargs'.  If 'allow_interspersed_args' is
        false, stop at the first non-option argument.  If true, accumulate any
        interspersed non-option arguments in 'largs'.
        """
        while rargs:
            arg = rargs[0]
            # We handle bare "--" explicitly, and bare "-" is handled by the
            # standard arg handler since the short arg case ensures that the
            # len of the opt string is greater than 1.
            if arg == "--":
                del rargs[0]
                return
            elif arg[0:2] == "--":
                # process a single long option (possibly with value(s))
                self._process_long_opt(rargs, values)
            elif arg[:1] == "-" and len(arg) > 1:
                # process a cluster of short options (possibly with
                # value(s) for the last one only)
                self._process_short_opts(rargs, values)
            elif self.allow_interspersed_args:
                largs.append(arg)
                del rargs[0]
            else:
                return                  # stop now, leave this arg in rargs

        # Say this is the original argument list:
        # [arg0, arg1, ..., arg(i-1), arg(i), arg(i+1), ..., arg(N-1)]
        #                            ^
        # (we are about to process arg(i)).
        #
        # Then rargs is [arg(i), ..., arg(N-1)] and largs is a *subset* of
        # [arg0, ..., arg(i-1)] (any options and their arguments will have
        # been removed from largs).
        #
        # The while loop will usually consume 1 or more arguments per pass.
        # If it consumes 1 (eg. arg is an option that takes no arguments),
        # then after _process_arg() is done the situation is:
        #
        #   largs = subset of [arg0, ..., arg(i)]
        #   rargs = [arg(i+1), ..., arg(N-1)]
        #
        # If allow_interspersed_args is false, largs will always be
        # *empty* -- still a subset of [arg0, ..., arg(i-1)], but
        # not a very interesting subset!

    def _match_long_opt(self, opt):
        """_match_long_opt(opt : string) -> string

        Determine which long option string 'opt' matches, ie. which one
        it is an unambiguous abbreviation for.  Raises BadOptionError if
        'opt' doesn't unambiguously match any long option string.
        """
        return _match_abbrev(opt, self._long_opt)

    def _process_long_opt(self, rargs, values):
        arg = rargs.pop(0)

        # Value explicitly attached to arg?  Pretend it's the next
        # argument.
        if "=" in arg:
            (opt, next_arg) = arg.split("=", 1)
            rargs.insert(0, next_arg)
            had_explicit_value = True
        else:
            opt = arg
            had_explicit_value = False

        opt = self._match_long_opt(opt)
        option = self._long_opt[opt]
        if option.takes_value():
            nargs = option.nargs
            if len(rargs) < nargs:
                self.error(ngettext(
                    "%(option)s option requires %(number)d argument",
                    "%(option)s option requires %(number)d arguments",
                    nargs) % {"option": opt, "number": nargs})
            elif nargs == 1:
                value = rargs.pop(0)
            else:
                value = tuple(rargs[0:nargs])
                del rargs[0:nargs]

        elif had_explicit_value:
            self.error(_("%s option does not take a value") % opt)

        else:
            value = None

        option.process(opt, value, values, self)

    def _process_short_opts(self, rargs, values):
        arg = rargs.pop(0)
        stop = False
        i = 1
        for ch in arg[1:]:
            opt = "-" + ch
            option = self._short_opt.get(opt)
            i += 1                      # we have consumed a character

            if not option:
                raise BadOptionError(opt)
            if option.takes_value():
                # Any characters left in arg?  Pretend they're the
                # next arg, and stop consuming characters of arg.
                if i < len(arg):
                    rargs.insert(0, arg[i:])
                    stop = True

                nargs = option.nargs
                if len(rargs) < nargs:
                    self.error(ngettext(
                        "%(option)s option requires %(number)d argument",
                        "%(option)s option requires %(number)d arguments",
                        nargs) % {"option": opt, "number": nargs})
                elif nargs == 1:
                    value = rargs.pop(0)
                else:
                    value = tuple(rargs[0:nargs])
                    del rargs[0:nargs]

            else:                       # option doesn't take a value
                value = None

            option.process(opt, value, values, self)

            if stop:
                break


    # -- Feedback methods ----------------------------------------------

    def get_prog_name(self):
        if self.prog is None:
            return os.path.basename(sys.argv[0])
        else:
            return self.prog

    def expand_prog_name(self, s):
        return s.replace("%prog", self.get_prog_name())

    def get_description(self):
        return self.expand_prog_name(self.description)

    def exit(self, status=0, msg=None):
        if msg:
            sys.stderr.write(msg)
        sys.exit(status)

    def error(self, msg):
        """error(msg : string)

        Print a usage message incorporating 'msg' to stderr and exit.
        If you override this in a subclass, it should not return -- it
        should either exit or raise an exception.
        """
        self.print_usage(sys.stderr)
        self.exit(2, "%s: error: %s\n" % (self.get_prog_name(), msg))

    def get_usage(self):
        if self.usage:
            return self.formatter.format_usage(
                self.expand_prog_name(self.usage))
        else:
            return ""

    def print_usage(self, file=None):
        """print_usage(file : file = stdout)

        Print the usage message for the current program (self.usage) to
        'file' (default stdout).  Any occurrence of the string "%prog" in
        self.usage is replaced with the name of the current program
        (basename of sys.argv[0]).  Does nothing if self.usage is empty
        or not defined.
        """
        if self.usage:
            print(self.get_usage(), file=file)

    def get_version(self):
        if self.version:
            return self.expand_prog_name(self.version)
        else:
            return ""

    def print_version(self, file=None):
        """print_version(file : file = stdout)

        Print the version message for this program (self.version) to
        'file' (default stdout).  As with print_usage(), any occurrence
        of "%prog" in self.version is replaced by the current program's
        name.  Does nothing if self.version is empty or undefined.
        """
        if self.version:
            print(self.get_version(), file=file)

    def format_option_help(self, formatter=None):
        if formatter is None:
            formatter = self.formatter
        formatter.store_option_strings(self)
        result = []
        result.append(formatter.format_heading(_("Options")))
        formatter.indent()
        if self.option_list:
            result.append(OptionContainer.format_option_help(self, formatter))
            result.append("\n")
        for group in self.option_groups:
            result.append(group.format_help(formatter))
            result.append("\n")
        formatter.dedent()
        # Drop the last "\n", or the header if no options or option groups:
        return "".join(result[:-1])

    def format_epilog(self, formatter):
        return formatter.format_epilog(self.epilog)

    def format_help(self, formatter=None):
        if formatter is None:
            formatter = self.formatter
        result = []
        if self.usage:
            result.append(self.get_usage() + "\n")
        if self.description:
            result.append(self.format_description(formatter) + "\n")
        result.append(self.format_option_help(formatter))
        result.append(self.format_epilog(formatter))
        return "".join(result)

    def print_help(self, file=None):
        """print_help(file : file = stdout)

        Print an extended help message, listing all options and any
        help text provided with them, to 'file' (default stdout).
        """
        if file is None:
            file = sys.stdout
        file.write(self.format_help())

# class OptionParser


def _match_abbrev(s, wordmap):
    """_match_abbrev(s : string, wordmap : {string : Option}) -> string

    Return the string key in 'wordmap' for which 's' is an unambiguous
    abbreviation.  If 's' is found to be ambiguous or doesn't match any of
    'words', raise BadOptionError.
    """
    # Is there an exact match?
    if s in wordmap:
        return s
    else:
        # Isolate all words with s as a prefix.
        possibilities = [word for word in wordmap.keys()
                         if word.startswith(s)]
        # No exact match, so there had better be just one possibility.
        if len(possibilities) == 1:
            return possibilities[0]
        elif not possibilities:
            raise BadOptionError(s)
        else:
            # More than one possible completion: ambiguous prefix.
            possibilities.sort()
            raise AmbiguousOptionError(s, possibilities)


# Some day, there might be many Option classes.  As of Optik 1.3, the
# preferred way to instantiate Options is indirectly, via make_option(),
# which will become a factory function when there are many Option
# classes.
make_option = Option
fnmatch.py000064400000007757151153537540006567 0ustar00"""Filename matching with shell patterns.

fnmatch(FILENAME, PATTERN) matches according to the local convention.
fnmatchcase(FILENAME, PATTERN) always takes case in account.

The functions operate by translating the pattern into a regular
expression.  They cache the compiled regular expressions for speed.

The function translate(PATTERN) returns a regular expression
corresponding to PATTERN.  (It does not compile it.)
"""
import os
import posixpath
import re
import functools

__all__ = ["filter", "fnmatch", "fnmatchcase", "translate"]

def fnmatch(name, pat):
    """Test whether FILENAME matches PATTERN.

    Patterns are Unix shell style:

    *       matches everything
    ?       matches any single character
    [seq]   matches any character in seq
    [!seq]  matches any char not in seq

    An initial period in FILENAME is not special.
    Both FILENAME and PATTERN are first case-normalized
    if the operating system requires it.
    If you don't want this, use fnmatchcase(FILENAME, PATTERN).
    """
    name = os.path.normcase(name)
    pat = os.path.normcase(pat)
    return fnmatchcase(name, pat)

@functools.lru_cache(maxsize=256, typed=True)
def _compile_pattern(pat):
    if isinstance(pat, bytes):
        pat_str = str(pat, 'ISO-8859-1')
        res_str = translate(pat_str)
        res = bytes(res_str, 'ISO-8859-1')
    else:
        res = translate(pat)
    return re.compile(res).match

def filter(names, pat):
    """Construct a list from those elements of the iterable NAMES that match PAT."""
    result = []
    pat = os.path.normcase(pat)
    match = _compile_pattern(pat)
    if os.path is posixpath:
        # normcase on posix is NOP. Optimize it away from the loop.
        for name in names:
            if match(name):
                result.append(name)
    else:
        for name in names:
            if match(os.path.normcase(name)):
                result.append(name)
    return result

def fnmatchcase(name, pat):
    """Test whether FILENAME matches PATTERN, including case.

    This is a version of fnmatch() which doesn't case-normalize
    its arguments.
    """
    match = _compile_pattern(pat)
    return match(name) is not None


def translate(pat):
    """Translate a shell PATTERN to a regular expression.

    There is no way to quote meta-characters.
    """

    i, n = 0, len(pat)
    res = ''
    while i < n:
        c = pat[i]
        i = i+1
        if c == '*':
            res = res + '.*'
        elif c == '?':
            res = res + '.'
        elif c == '[':
            j = i
            if j < n and pat[j] == '!':
                j = j+1
            if j < n and pat[j] == ']':
                j = j+1
            while j < n and pat[j] != ']':
                j = j+1
            if j >= n:
                res = res + '\\['
            else:
                stuff = pat[i:j]
                if '--' not in stuff:
                    stuff = stuff.replace('\\', r'\\')
                else:
                    chunks = []
                    k = i+2 if pat[i] == '!' else i+1
                    while True:
                        k = pat.find('-', k, j)
                        if k < 0:
                            break
                        chunks.append(pat[i:k])
                        i = k+1
                        k = k+3
                    chunks.append(pat[i:j])
                    # Escape backslashes and hyphens for set difference (--).
                    # Hyphens that create ranges shouldn't be escaped.
                    stuff = '-'.join(s.replace('\\', r'\\').replace('-', r'\-')
                                     for s in chunks)
                # Escape set operations (&&, ~~ and ||).
                stuff = re.sub(r'([&~|])', r'\\\1', stuff)
                i = j+1
                if stuff[0] == '!':
                    stuff = '^' + stuff[1:]
                elif stuff[0] in ('^', '['):
                    stuff = '\\' + stuff
                res = '%s[%s]' % (res, stuff)
        else:
            res = res + re.escape(c)
    return r'(?s:%s)\Z' % res
json/tool.py000064400000003737151153537540007067 0ustar00r"""Command-line tool to validate and pretty-print JSON

Usage::

    $ echo '{"json":"obj"}' | python -m json.tool
    {
        "json": "obj"
    }
    $ echo '{ 1.2:3.4}' | python -m json.tool
    Expecting property name enclosed in double quotes: line 1 column 3 (char 2)

"""
import argparse
import json
import sys


def main():
    prog = 'python -m json.tool'
    description = ('A simple command line interface for json module '
                   'to validate and pretty-print JSON objects.')
    parser = argparse.ArgumentParser(prog=prog, description=description)
    parser.add_argument('infile', nargs='?',
                        type=argparse.FileType(encoding="utf-8"),
                        help='a JSON file to be validated or pretty-printed',
                        default=sys.stdin)
    parser.add_argument('outfile', nargs='?',
                        type=argparse.FileType('w', encoding="utf-8"),
                        help='write the output of infile to outfile',
                        default=sys.stdout)
    parser.add_argument('--sort-keys', action='store_true', default=False,
                        help='sort the output of dictionaries alphabetically by key')
    parser.add_argument('--json-lines', action='store_true', default=False,
                        help='parse input using the jsonlines format')
    options = parser.parse_args()

    infile = options.infile
    outfile = options.outfile
    sort_keys = options.sort_keys
    json_lines = options.json_lines
    with infile, outfile:
        try:
            if json_lines:
                objs = (json.loads(line) for line in infile)
            else:
                objs = (json.load(infile), )
            for obj in objs:
                json.dump(obj, outfile, sort_keys=sort_keys, indent=4)
                outfile.write('\n')
        except ValueError as e:
            raise SystemExit(e)


if __name__ == '__main__':
    try:
        main()
    except BrokenPipeError as exc:
        sys.exit(exc.errno)
json/__init__.py000064400000034011151153537540007636 0ustar00r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.

:mod:`json` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules.  It is derived from a
version of the externally maintained simplejson library.

Encoding basic Python object hierarchies::

    >>> import json
    >>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}])
    '["foo", {"bar": ["baz", null, 1.0, 2]}]'
    >>> print(json.dumps("\"foo\bar"))
    "\"foo\bar"
    >>> print(json.dumps('\u1234'))
    "\u1234"
    >>> print(json.dumps('\\'))
    "\\"
    >>> print(json.dumps({"c": 0, "b": 0, "a": 0}, sort_keys=True))
    {"a": 0, "b": 0, "c": 0}
    >>> from io import StringIO
    >>> io = StringIO()
    >>> json.dump(['streaming API'], io)
    >>> io.getvalue()
    '["streaming API"]'

Compact encoding::

    >>> import json
    >>> mydict = {'4': 5, '6': 7}
    >>> json.dumps([1,2,3,mydict], separators=(',', ':'))
    '[1,2,3,{"4":5,"6":7}]'

Pretty printing::

    >>> import json
    >>> print(json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4))
    {
        "4": 5,
        "6": 7
    }

Decoding JSON::

    >>> import json
    >>> obj = ['foo', {'bar': ['baz', None, 1.0, 2]}]
    >>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]') == obj
    True
    >>> json.loads('"\\"foo\\bar"') == '"foo\x08ar'
    True
    >>> from io import StringIO
    >>> io = StringIO('["streaming API"]')
    >>> json.load(io)[0] == 'streaming API'
    True

Specializing JSON object decoding::

    >>> import json
    >>> def as_complex(dct):
    ...     if '__complex__' in dct:
    ...         return complex(dct['real'], dct['imag'])
    ...     return dct
    ...
    >>> json.loads('{"__complex__": true, "real": 1, "imag": 2}',
    ...     object_hook=as_complex)
    (1+2j)
    >>> from decimal import Decimal
    >>> json.loads('1.1', parse_float=Decimal) == Decimal('1.1')
    True

Specializing JSON object encoding::

    >>> import json
    >>> def encode_complex(obj):
    ...     if isinstance(obj, complex):
    ...         return [obj.real, obj.imag]
    ...     raise TypeError(f'Object of type {obj.__class__.__name__} '
    ...                     f'is not JSON serializable')
    ...
    >>> json.dumps(2 + 1j, default=encode_complex)
    '[2.0, 1.0]'
    >>> json.JSONEncoder(default=encode_complex).encode(2 + 1j)
    '[2.0, 1.0]'
    >>> ''.join(json.JSONEncoder(default=encode_complex).iterencode(2 + 1j))
    '[2.0, 1.0]'


Using json.tool from the shell to validate and pretty-print::

    $ echo '{"json":"obj"}' | python -m json.tool
    {
        "json": "obj"
    }
    $ echo '{ 1.2:3.4}' | python -m json.tool
    Expecting property name enclosed in double quotes: line 1 column 3 (char 2)
"""
__version__ = '2.0.9'
__all__ = [
    'dump', 'dumps', 'load', 'loads',
    'JSONDecoder', 'JSONDecodeError', 'JSONEncoder',
]

__author__ = 'Bob Ippolito <bob@redivi.com>'

from .decoder import JSONDecoder, JSONDecodeError
from .encoder import JSONEncoder
import codecs

_default_encoder = JSONEncoder(
    skipkeys=False,
    ensure_ascii=True,
    check_circular=True,
    allow_nan=True,
    indent=None,
    separators=None,
    default=None,
)

def dump(obj, fp, *, skipkeys=False, ensure_ascii=True, check_circular=True,
        allow_nan=True, cls=None, indent=None, separators=None,
        default=None, sort_keys=False, **kw):
    """Serialize ``obj`` as a JSON formatted stream to ``fp`` (a
    ``.write()``-supporting file-like object).

    If ``skipkeys`` is true then ``dict`` keys that are not basic types
    (``str``, ``int``, ``float``, ``bool``, ``None``) will be skipped
    instead of raising a ``TypeError``.

    If ``ensure_ascii`` is false, then the strings written to ``fp`` can
    contain non-ASCII characters if they appear in strings contained in
    ``obj``. Otherwise, all such characters are escaped in JSON strings.

    If ``check_circular`` is false, then the circular reference check
    for container types will be skipped and a circular reference will
    result in an ``OverflowError`` (or worse).

    If ``allow_nan`` is false, then it will be a ``ValueError`` to
    serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``)
    in strict compliance of the JSON specification, instead of using the
    JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``).

    If ``indent`` is a non-negative integer, then JSON array elements and
    object members will be pretty-printed with that indent level. An indent
    level of 0 will only insert newlines. ``None`` is the most compact
    representation.

    If specified, ``separators`` should be an ``(item_separator, key_separator)``
    tuple.  The default is ``(', ', ': ')`` if *indent* is ``None`` and
    ``(',', ': ')`` otherwise.  To get the most compact JSON representation,
    you should specify ``(',', ':')`` to eliminate whitespace.

    ``default(obj)`` is a function that should return a serializable version
    of obj or raise TypeError. The default simply raises TypeError.

    If *sort_keys* is true (default: ``False``), then the output of
    dictionaries will be sorted by key.

    To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the
    ``.default()`` method to serialize additional types), specify it with
    the ``cls`` kwarg; otherwise ``JSONEncoder`` is used.

    """
    # cached encoder
    if (not skipkeys and ensure_ascii and
        check_circular and allow_nan and
        cls is None and indent is None and separators is None and
        default is None and not sort_keys and not kw):
        iterable = _default_encoder.iterencode(obj)
    else:
        if cls is None:
            cls = JSONEncoder
        iterable = cls(skipkeys=skipkeys, ensure_ascii=ensure_ascii,
            check_circular=check_circular, allow_nan=allow_nan, indent=indent,
            separators=separators,
            default=default, sort_keys=sort_keys, **kw).iterencode(obj)
    # could accelerate with writelines in some versions of Python, at
    # a debuggability cost
    for chunk in iterable:
        fp.write(chunk)


def dumps(obj, *, skipkeys=False, ensure_ascii=True, check_circular=True,
        allow_nan=True, cls=None, indent=None, separators=None,
        default=None, sort_keys=False, **kw):
    """Serialize ``obj`` to a JSON formatted ``str``.

    If ``skipkeys`` is true then ``dict`` keys that are not basic types
    (``str``, ``int``, ``float``, ``bool``, ``None``) will be skipped
    instead of raising a ``TypeError``.

    If ``ensure_ascii`` is false, then the return value can contain non-ASCII
    characters if they appear in strings contained in ``obj``. Otherwise, all
    such characters are escaped in JSON strings.

    If ``check_circular`` is false, then the circular reference check
    for container types will be skipped and a circular reference will
    result in an ``OverflowError`` (or worse).

    If ``allow_nan`` is false, then it will be a ``ValueError`` to
    serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in
    strict compliance of the JSON specification, instead of using the
    JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``).

    If ``indent`` is a non-negative integer, then JSON array elements and
    object members will be pretty-printed with that indent level. An indent
    level of 0 will only insert newlines. ``None`` is the most compact
    representation.

    If specified, ``separators`` should be an ``(item_separator, key_separator)``
    tuple.  The default is ``(', ', ': ')`` if *indent* is ``None`` and
    ``(',', ': ')`` otherwise.  To get the most compact JSON representation,
    you should specify ``(',', ':')`` to eliminate whitespace.

    ``default(obj)`` is a function that should return a serializable version
    of obj or raise TypeError. The default simply raises TypeError.

    If *sort_keys* is true (default: ``False``), then the output of
    dictionaries will be sorted by key.

    To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the
    ``.default()`` method to serialize additional types), specify it with
    the ``cls`` kwarg; otherwise ``JSONEncoder`` is used.

    """
    # cached encoder
    if (not skipkeys and ensure_ascii and
        check_circular and allow_nan and
        cls is None and indent is None and separators is None and
        default is None and not sort_keys and not kw):
        return _default_encoder.encode(obj)
    if cls is None:
        cls = JSONEncoder
    return cls(
        skipkeys=skipkeys, ensure_ascii=ensure_ascii,
        check_circular=check_circular, allow_nan=allow_nan, indent=indent,
        separators=separators, default=default, sort_keys=sort_keys,
        **kw).encode(obj)


_default_decoder = JSONDecoder(object_hook=None, object_pairs_hook=None)


def detect_encoding(b):
    bstartswith = b.startswith
    if bstartswith((codecs.BOM_UTF32_BE, codecs.BOM_UTF32_LE)):
        return 'utf-32'
    if bstartswith((codecs.BOM_UTF16_BE, codecs.BOM_UTF16_LE)):
        return 'utf-16'
    if bstartswith(codecs.BOM_UTF8):
        return 'utf-8-sig'

    if len(b) >= 4:
        if not b[0]:
            # 00 00 -- -- - utf-32-be
            # 00 XX -- -- - utf-16-be
            return 'utf-16-be' if b[1] else 'utf-32-be'
        if not b[1]:
            # XX 00 00 00 - utf-32-le
            # XX 00 00 XX - utf-16-le
            # XX 00 XX -- - utf-16-le
            return 'utf-16-le' if b[2] or b[3] else 'utf-32-le'
    elif len(b) == 2:
        if not b[0]:
            # 00 XX - utf-16-be
            return 'utf-16-be'
        if not b[1]:
            # XX 00 - utf-16-le
            return 'utf-16-le'
    # default
    return 'utf-8'


def load(fp, *, cls=None, object_hook=None, parse_float=None,
        parse_int=None, parse_constant=None, object_pairs_hook=None, **kw):
    """Deserialize ``fp`` (a ``.read()``-supporting file-like object containing
    a JSON document) to a Python object.

    ``object_hook`` is an optional function that will be called with the
    result of any object literal decode (a ``dict``). The return value of
    ``object_hook`` will be used instead of the ``dict``. This feature
    can be used to implement custom decoders (e.g. JSON-RPC class hinting).

    ``object_pairs_hook`` is an optional function that will be called with the
    result of any object literal decoded with an ordered list of pairs.  The
    return value of ``object_pairs_hook`` will be used instead of the ``dict``.
    This feature can be used to implement custom decoders.  If ``object_hook``
    is also defined, the ``object_pairs_hook`` takes priority.

    To use a custom ``JSONDecoder`` subclass, specify it with the ``cls``
    kwarg; otherwise ``JSONDecoder`` is used.
    """
    return loads(fp.read(),
        cls=cls, object_hook=object_hook,
        parse_float=parse_float, parse_int=parse_int,
        parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)


def loads(s, *, cls=None, object_hook=None, parse_float=None,
        parse_int=None, parse_constant=None, object_pairs_hook=None, **kw):
    """Deserialize ``s`` (a ``str``, ``bytes`` or ``bytearray`` instance
    containing a JSON document) to a Python object.

    ``object_hook`` is an optional function that will be called with the
    result of any object literal decode (a ``dict``). The return value of
    ``object_hook`` will be used instead of the ``dict``. This feature
    can be used to implement custom decoders (e.g. JSON-RPC class hinting).

    ``object_pairs_hook`` is an optional function that will be called with the
    result of any object literal decoded with an ordered list of pairs.  The
    return value of ``object_pairs_hook`` will be used instead of the ``dict``.
    This feature can be used to implement custom decoders.  If ``object_hook``
    is also defined, the ``object_pairs_hook`` takes priority.

    ``parse_float``, if specified, will be called with the string
    of every JSON float to be decoded. By default this is equivalent to
    float(num_str). This can be used to use another datatype or parser
    for JSON floats (e.g. decimal.Decimal).

    ``parse_int``, if specified, will be called with the string
    of every JSON int to be decoded. By default this is equivalent to
    int(num_str). This can be used to use another datatype or parser
    for JSON integers (e.g. float).

    ``parse_constant``, if specified, will be called with one of the
    following strings: -Infinity, Infinity, NaN.
    This can be used to raise an exception if invalid JSON numbers
    are encountered.

    To use a custom ``JSONDecoder`` subclass, specify it with the ``cls``
    kwarg; otherwise ``JSONDecoder`` is used.

    The ``encoding`` argument is ignored and deprecated since Python 3.1.
    """
    if isinstance(s, str):
        if s.startswith('\ufeff'):
            raise JSONDecodeError("Unexpected UTF-8 BOM (decode using utf-8-sig)",
                                  s, 0)
    else:
        if not isinstance(s, (bytes, bytearray)):
            raise TypeError(f'the JSON object must be str, bytes or bytearray, '
                            f'not {s.__class__.__name__}')
        s = s.decode(detect_encoding(s), 'surrogatepass')

    if "encoding" in kw:
        import warnings
        warnings.warn(
            "'encoding' is ignored and deprecated. It will be removed in Python 3.9",
            DeprecationWarning,
            stacklevel=2
        )
        del kw['encoding']

    if (cls is None and object_hook is None and
            parse_int is None and parse_float is None and
            parse_constant is None and object_pairs_hook is None and not kw):
        return _default_decoder.decode(s)
    if cls is None:
        cls = JSONDecoder
    if object_hook is not None:
        kw['object_hook'] = object_hook
    if object_pairs_hook is not None:
        kw['object_pairs_hook'] = object_pairs_hook
    if parse_float is not None:
        kw['parse_float'] = parse_float
    if parse_int is not None:
        kw['parse_int'] = parse_int
    if parse_constant is not None:
        kw['parse_constant'] = parse_constant
    return cls(**kw).decode(s)
json/scanner.py000064400000004571151153537540007540 0ustar00"""JSON token scanner
"""
import re
try:
    from _json import make_scanner as c_make_scanner
except ImportError:
    c_make_scanner = None

__all__ = ['make_scanner']

NUMBER_RE = re.compile(
    r'(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?',
    (re.VERBOSE | re.MULTILINE | re.DOTALL))

def py_make_scanner(context):
    parse_object = context.parse_object
    parse_array = context.parse_array
    parse_string = context.parse_string
    match_number = NUMBER_RE.match
    strict = context.strict
    parse_float = context.parse_float
    parse_int = context.parse_int
    parse_constant = context.parse_constant
    object_hook = context.object_hook
    object_pairs_hook = context.object_pairs_hook
    memo = context.memo

    def _scan_once(string, idx):
        try:
            nextchar = string[idx]
        except IndexError:
            raise StopIteration(idx) from None

        if nextchar == '"':
            return parse_string(string, idx + 1, strict)
        elif nextchar == '{':
            return parse_object((string, idx + 1), strict,
                _scan_once, object_hook, object_pairs_hook, memo)
        elif nextchar == '[':
            return parse_array((string, idx + 1), _scan_once)
        elif nextchar == 'n' and string[idx:idx + 4] == 'null':
            return None, idx + 4
        elif nextchar == 't' and string[idx:idx + 4] == 'true':
            return True, idx + 4
        elif nextchar == 'f' and string[idx:idx + 5] == 'false':
            return False, idx + 5

        m = match_number(string, idx)
        if m is not None:
            integer, frac, exp = m.groups()
            if frac or exp:
                res = parse_float(integer + (frac or '') + (exp or ''))
            else:
                res = parse_int(integer)
            return res, m.end()
        elif nextchar == 'N' and string[idx:idx + 3] == 'NaN':
            return parse_constant('NaN'), idx + 3
        elif nextchar == 'I' and string[idx:idx + 8] == 'Infinity':
            return parse_constant('Infinity'), idx + 8
        elif nextchar == '-' and string[idx:idx + 9] == '-Infinity':
            return parse_constant('-Infinity'), idx + 9
        else:
            raise StopIteration(idx)

    def scan_once(string, idx):
        try:
            return _scan_once(string, idx)
        finally:
            memo.clear()

    return scan_once

make_scanner = c_make_scanner or py_make_scanner
json/__pycache__/decoder.cpython-38.opt-2.pyc000064400000013341151153537540014735 0ustar00U

e5d�0�	@sddlZddlmZzddlmZWnek
r<dZYnXddgZejej	Bej
BZed�Z
ed�Zed�ZGd	d�de�Zeee
d
�Ze�de�Zdd
ddddddd�Zdd�Zdeejfdd�Zep�eZe�de�ZdZdejefdd�Zejefdd�ZGd d�de�ZdS)!�N)�scanner)�
scanstring�JSONDecoder�JSONDecodeError�nan�infz-infc@seZdZdd�Zdd�ZdS)rcCsb|�dd|�d}||�dd|�}d||||f}t�||�||_||_||_||_||_dS)N�
r�z%s: line %d column %d (char %d))	�count�rfind�
ValueError�__init__�msg�doc�pos�lineno�colno)�selfrrrrr�errmsg�r�$/usr/lib64/python3.8/json/decoder.pyr
szJSONDecodeError.__init__cCs|j|j|j|jffS�N)�	__class__rrr)rrrr�
__reduce__*szJSONDecodeError.__reduce__N)�__name__�
__module__�__qualname__r
rrrrrrs)z	-InfinityZInfinity�NaNz(.*?)(["\\\x00-\x1f])�"�\�/��r�
�	)rrr �b�f�n�r�tcCsb||d|d�}t|�dkrN|ddkrNzt|d�WStk
rLYnXd}t|||��dS)Nr	��ZxX�zInvalid \uXXXX escape)�len�intrr)�sr�escrrrr�
_decode_uXXXX;sr1TcCs�g}|j}|d}|||�}|dkr0td||��|��}|��\}	}
|	rP||	�|
dkr^�q�n.|
dkr�|r�d�|
�}t|||��n
||
�qz||}Wn"tk
r�td||�d�YnX|dk�rz||}
Wn*tk
r�d�|�}t|||��YnX|d7}n�t||�}|d7}d	|k�r2d
k�r�nn`|||d�dk�r�t||d�}d
|k�rrdk�r�nn d|d	d>|d
B}|d7}t|�}
||
�qd�	|�|fS)Nr	zUnterminated string starting atrrz"Invalid control character {0!r} at�uzInvalid \escape: {0!r}r*i�i���z\ui�i��i�
��)
�appendr�end�groups�format�
IndexError�KeyErrorr1�chr�join)r/r8�strictZ_b�_mZchunks�_appendZbegin�chunkZcontent�
terminatorrr0�charZuniZuni2rrr�
py_scanstringEsX


��



2
rEz
[ \t\n\r]*z 	

c
Cs�|\}}	g}
|
j}|dkri}|j}||	|	d�}
|
dkr�|
|krb|||	���}	||	|	d�}
|
dkr�|dk	r�||
�}||	dfSi}
|dk	r�||
�}
|
|	dfS|
dkr�td||	��|	d7}	t||	|�\}}	|||�}||	|	d�dk�r"|||	���}	||	|	d�dk�r"td||	��|	d7}	z:||	|k�rb|	d7}	||	|k�rb|||	d���}	Wntk
�rzYnXz|||	�\}}	Wn4tk
�r�}ztd||j�d�W5d}~XYnX|||f�z0||	}
|
|k�r�|||	d���}	||	}
Wntk
�rd}
YnX|	d7}	|
dk�r4�q�n|
d	k�rNtd
||	d��|||	���}	||	|	d�}
|	d7}	|
dkr�td||	d��q�|dk	�r�||
�}||	fSt|
�}
|dk	�r�||
�}
|
|	fS)Nr	r�}z1Expecting property name enclosed in double quotes�:zExpecting ':' delimiter�Expecting valuer6�,�Expecting ',' delimiter)	r7�
setdefaultr8rrr;�
StopIteration�value�dict)�	s_and_endr?�	scan_once�object_hook�object_pairs_hook�memo�_w�_wsr/r8ZpairsZpairs_appendZmemo_get�nextchar�result�keyrM�errrrr�
JSONObject�s��
"



�

rZc
Cst|\}}g}|||d�}||krF|||d���}|||d�}|dkrZ||dfS|j}z|||�\}	}Wn2tk
r�}
ztd||
j�d�W5d}
~
XYnX||	�|||d�}||kr�|||d���}|||d�}|d7}|dkr��qln|dk�rtd||d��z:|||k�rP|d7}|||k�rP|||d���}Wq`tk
�rhYq`Xq`||fS)Nr	�]rHrIrJ)r8r7rLrrMr;)rOrPrTrUr/r8�valuesrVrArMrYrrr�	JSONArray�s>"
r]c@s<eZdZddddddd�dd�Zejfdd�Zdd	d
�ZdS)rNT)rQ�parse_float�	parse_int�parse_constantr?rRcCsZ||_|pt|_|pt|_|p"tj|_||_||_	t
|_t|_
t|_i|_t�|�|_dSr)rQ�floatr^r.r_�
_CONSTANTS�__getitem__r`r?rRrZZparse_objectr]Zparse_arrayrZparse_stringrSrZmake_scannerrP)rrQr^r_r`r?rRrrrr
s#

zJSONDecoder.__init__cCsF|j|||d���d�\}}|||���}|t|�krBtd||��|S)Nr)�idxz
Extra data)�
raw_decoder8r-r)rr/rT�objr8rrr�decodeLs
zJSONDecoder.decoderc
CsPz|�||�\}}Wn2tk
rF}ztd||j�d�W5d}~XYnX||fS)NrH)rPrLrrM)rr/rdrfr8rYrrrreWs
	"zJSONDecoder.raw_decode)r)rrrr
�
WHITESPACE�matchrgrerrrrr�s�0)�reZjsonrZ_jsonrZc_scanstring�ImportError�__all__�VERBOSE�	MULTILINE�DOTALL�FLAGSrarZPosInfZNegInfrrrb�compileZSTRINGCHUNKZ	BACKSLASHr1rirErhZWHITESPACE_STRrZr]�objectrrrrr�<module>sN
��
�
=�
Q%json/__pycache__/tool.cpython-38.opt-1.pyc000064400000003552151153537540014307 0ustar00U

e5d��
@sjdZddlZddlZddlZdd�Zedkrfz
e�Wn.ek
rdZze�ej	�W5dZ[XYnXdS)aCommand-line tool to validate and pretty-print JSON

Usage::

    $ echo '{"json":"obj"}' | python -m json.tool
    {
        "json": "obj"
    }
    $ echo '{ 1.2:3.4}' | python -m json.tool
    Expecting property name enclosed in double quotes: line 1 column 3 (char 2)

�NcCs4d}d}tj||d�}|jddtjdd�dtjd	�|jd
dtjddd�dtjd	�|jd
dddd�|jddddd�|��}|j}|j	}|j
}|j}|��|�~zJ|r�dd�|D�}nt�
|�f}|D] }	tj|	||dd�|�d�q�Wn,tk
�r}
zt|
��W5d}
~
XYnXW5QRXW5QRXdS)Nzpython -m json.toolzZA simple command line interface for json module to validate and pretty-print JSON objects.)�prog�description�infile�?zutf-8)�encodingz-a JSON file to be validated or pretty-printed)�nargs�type�help�default�outfile�wz%write the output of infile to outfilez--sort-keys�
store_trueFz5sort the output of dictionaries alphabetically by key)�actionr
r	z--json-linesz&parse input using the jsonlines formatcss|]}t�|�VqdS)N)�json�loads)�.0�line�r�!/usr/lib64/python3.8/json/tool.py�	<genexpr>,szmain.<locals>.<genexpr>�)�	sort_keys�indent�
)�argparse�ArgumentParser�add_argumentZFileType�sys�stdin�stdout�
parse_argsrrr�
json_linesr�load�dump�write�
ValueError�
SystemExit)rr�parserZoptionsrrrr!Zobjs�obj�errr�mainsD
��
�
�r*�__main__)
�__doc__rrrr*�__name__�BrokenPipeError�exc�exit�errnorrrr�<module>s$
json/__pycache__/tool.cpython-38.opt-2.pyc000064400000003105151153537540014302 0ustar00U

e5d��
@sfddlZddlZddlZdd�Zedkrbz
e�Wn.ek
r`Zze�ej�W5dZ[XYnXdS)�NcCs4d}d}tj||d�}|jddtjdd�dtjd	�|jd
dtjddd�dtjd	�|jd
dddd�|jddddd�|��}|j}|j	}|j
}|j}|��|�~zJ|r�dd�|D�}nt�
|�f}|D] }	tj|	||dd�|�d�q�Wn,tk
�r}
zt|
��W5d}
~
XYnXW5QRXW5QRXdS)Nzpython -m json.toolzZA simple command line interface for json module to validate and pretty-print JSON objects.)�prog�description�infile�?zutf-8)�encodingz-a JSON file to be validated or pretty-printed)�nargs�type�help�default�outfile�wz%write the output of infile to outfilez--sort-keys�
store_trueFz5sort the output of dictionaries alphabetically by key)�actionr
r	z--json-linesz&parse input using the jsonlines formatcss|]}t�|�VqdS)N)�json�loads)�.0�line�r�!/usr/lib64/python3.8/json/tool.py�	<genexpr>,szmain.<locals>.<genexpr>�)�	sort_keys�indent�
)�argparse�ArgumentParser�add_argumentZFileType�sys�stdin�stdout�
parse_argsrrr�
json_linesr�load�dump�write�
ValueError�
SystemExit)rr�parserZoptionsrrrr!Zobjs�obj�errr�mainsD
��
�
�r*�__main__)	rrrr*�__name__�BrokenPipeError�exc�exit�errnorrrr�<module>
s$
json/__pycache__/encoder.cpython-38.opt-1.pyc000064400000025645151153537540014760 0ustar00U

e5d�>�
@s>dZddlZzddlmZWnek
r4dZYnXzddlmZWnek
r^dZYnXzddlmZ	Wnek
r�dZ	YnXe�
d�Ze�
d�Ze�
d�Z
d	d
ddd
ddd�Zed�D]Ze�ee�d�e��q�ed�Zdd�Zep�eZdd�Ze�peZGdd�de�Zeeeeeeee e!ej"f
dd�Z#dS)zImplementation of JSONEncoder
�N)�encode_basestring_ascii)�encode_basestring)�make_encoderz[\x00-\x1f\\"\b\f\n\r\t]z([\\"]|[^\ -~])s[�-�]z\\z\"z\bz\fz\nz\rz\t)�\�"���
�
�	� �	\u{0:04x}�infcCsdd�}dt�||�dS)z5Return a JSON representation of a Python string

    cSst|�d�S)Nr)�
ESCAPE_DCT�group)�match�r�$/usr/lib64/python3.8/json/encoder.py�replace(sz%py_encode_basestring.<locals>.replacer)�ESCAPE�sub��srrrr�py_encode_basestring$srcCsdd�}dt�||�dS)zAReturn an ASCII-only JSON representation of a Python string

    cSs�|�d�}z
t|WStk
rzt|�}|dkrBd�|�YS|d8}d|d?d@B}d|d@B}d�||�YSYnXdS)	Nrir
i��
i�i�z\u{0:04x}\u{1:04x})rr�KeyError�ord�format)rr�n�s1�s2rrrr4s

z+py_encode_basestring_ascii.<locals>.replacer)�ESCAPE_ASCIIrrrrr�py_encode_basestring_ascii0sr"c	@sNeZdZdZdZdZddddddddd�dd	�Zd
d�Zdd
�Zddd�Z	dS)�JSONEncoderaZExtensible JSON <http://json.org> encoder for Python data structures.

    Supports the following objects and types by default:

    +-------------------+---------------+
    | Python            | JSON          |
    +===================+===============+
    | dict              | object        |
    +-------------------+---------------+
    | list, tuple       | array         |
    +-------------------+---------------+
    | str               | string        |
    +-------------------+---------------+
    | int, float        | number        |
    +-------------------+---------------+
    | True              | true          |
    +-------------------+---------------+
    | False             | false         |
    +-------------------+---------------+
    | None              | null          |
    +-------------------+---------------+

    To extend this to recognize other objects, subclass and implement a
    ``.default()`` method with another method that returns a serializable
    object for ``o`` if possible, otherwise it should call the superclass
    implementation (to raise ``TypeError``).

    z, z: FTN)�skipkeys�ensure_ascii�check_circular�	allow_nan�	sort_keys�indent�
separators�defaultc	CsZ||_||_||_||_||_||_|dk	r:|\|_|_n|dk	rHd|_|dk	rV||_dS)a�Constructor for JSONEncoder, with sensible defaults.

        If skipkeys is false, then it is a TypeError to attempt
        encoding of keys that are not str, int, float or None.  If
        skipkeys is True, such items are simply skipped.

        If ensure_ascii is true, the output is guaranteed to be str
        objects with all incoming non-ASCII characters escaped.  If
        ensure_ascii is false, the output can contain non-ASCII characters.

        If check_circular is true, then lists, dicts, and custom encoded
        objects will be checked for circular references during encoding to
        prevent an infinite recursion (which would cause an OverflowError).
        Otherwise, no such check takes place.

        If allow_nan is true, then NaN, Infinity, and -Infinity will be
        encoded as such.  This behavior is not JSON specification compliant,
        but is consistent with most JavaScript based encoders and decoders.
        Otherwise, it will be a ValueError to encode such floats.

        If sort_keys is true, then the output of dictionaries will be
        sorted by key; this is useful for regression tests to ensure
        that JSON serializations can be compared on a day-to-day basis.

        If indent is a non-negative integer, then JSON array
        elements and object members will be pretty-printed with that
        indent level.  An indent level of 0 will only insert newlines.
        None is the most compact representation.

        If specified, separators should be an (item_separator, key_separator)
        tuple.  The default is (', ', ': ') if *indent* is ``None`` and
        (',', ': ') otherwise.  To get the most compact JSON representation,
        you should specify (',', ':') to eliminate whitespace.

        If specified, default is a function that gets called for objects
        that can't otherwise be serialized.  It should return a JSON encodable
        version of the object or raise a ``TypeError``.

        N�,)	r$r%r&r'r(r)�item_separator�
key_separatorr+)	�selfr$r%r&r'r(r)r*r+rrr�__init__hs+zJSONEncoder.__init__cCstd|jj�d���dS)alImplement this method in a subclass such that it returns
        a serializable object for ``o``, or calls the base implementation
        (to raise a ``TypeError``).

        For example, to support arbitrary iterators, you could
        implement default like this::

            def default(self, o):
                try:
                    iterable = iter(o)
                except TypeError:
                    pass
                else:
                    return list(iterable)
                # Let the base class default method raise the TypeError
                return JSONEncoder.default(self, o)

        zObject of type z is not JSON serializableN)�	TypeError�	__class__�__name__)r/�orrrr+�szJSONEncoder.defaultcCsNt|t�r |jrt|�St|�S|j|dd�}t|ttf�sDt|�}d�|�S)z�Return a JSON string representation of a Python data structure.

        >>> from json.encoder import JSONEncoder
        >>> JSONEncoder().encode({"foo": ["bar", "baz"]})
        '{"foo": ["bar", "baz"]}'

        T)�	_one_shot�)	�
isinstance�strr%rr�
iterencode�list�tuple�join)r/r4�chunksrrr�encode�s	
zJSONEncoder.encodecCs�|jri}nd}|jrt}nt}|jtjttfdd�}|rvtdk	rv|j	dkrvt||j
||j	|j|j|j
|j|j�	}n&t||j
||j	||j|j|j
|j|�
}||d�S)z�Encode the given object and yield each string
        representation as available.

        For example::

            for chunk in JSONEncoder().iterencode(bigobject):
                mysocket.write(chunk)

        NcSsJ||krd}n$||krd}n||kr*d}n||�S|sFtdt|���|S)NZNaNZInfinityz	-Infinityz2Out of range float values are not JSON compliant: )�
ValueError�repr)r4r'Z_reprZ_infZ_neginf�textrrr�floatstr�s��z(JSONEncoder.iterencode.<locals>.floatstrr)r&r%rrr'�float�__repr__�INFINITY�c_make_encoderr)r+r.r-r(r$�_make_iterencode)r/r4r5�markers�_encoderrB�_iterencoderrrr9�sL
�
���zJSONEncoder.iterencode)F)
r3�
__module__�__qualname__�__doc__r-r.r0r+r>r9rrrrr#Is�8r#cs��dk	r����sd�����������	�
��������fdd��	���������	�
���
��������fdd����������	�
��������fdd���S)N� c	3s�|sdVdS�dk	r6�|�}|�kr.�d��|�|<d}�dk	rh|d7}d�|}�|}||7}nd}�}d}|D]�}|r�d}n|}�
|��r�|�|�Vqx|dkr�|dVqx|dkr�|d	Vqx|dkr�|d
Vqx�
|��r�|�|�Vqx�
|�
��r|�|�Vqx|V�
|��f��r8�||�}n"�
|�	��rP�||�}n
�||�}|EdHqx|dk	�r�|d8}d�|VdV�dk	�r��|=dS)Nz[]�Circular reference detected�[�r	TF�null�true�false�]r)	Zlst�_current_indent_level�markeridZbuf�newline_indentZ	separator�first�valuer=)r?rI�	_floatstr�_indent�_intstr�_item_separatorrJ�_iterencode_dict�_iterencode_list�dictrC�id�intr7r:rHr8r;rrr`s\





z*_make_iterencode.<locals>._iterencode_listc
3s:|sdVdS�dk	r6�|�}|�kr.�d��|�|<dV�dk	rh|d7}d�|}�|}|Vnd}�}d}�r�t|���}n|��}|D�]j\}}�|��r�nn�|�
�r��|�}nZ|dkr�d}nL|dkr�d	}n>|dkr�d
}n0�|��r��|�}n�
�rq�ntd|jj����|�r"d}n|V�|�V�	V�|���rP�|�Vq�|dk�rbd
Vq�|dk�rtdVq�|dk�r�d	Vq��|���r��|�Vq��|�
��r��|�Vq��|��f��r҈||�}	n"�|���r�||�}	n
�||�}	|	EdHq�|dk	�r |d8}d�|VdV�dk	�r6�|=dS)
Nz{}rO�{rQr	TrSFrTrRz0keys must be str, int, float, bool or None, not �})�sorted�itemsr1r2r3)
ZdctrVrWrXr-rYrg�keyrZr=)r?rIr[r\r]r^rJr_r`�_key_separator�	_skipkeys�
_sort_keysrarCrbrcr7r:rHr8r;rrr_Ms�











z*_make_iterencode.<locals>._iterencode_dictc3s�|��r�|�Vn�|dkr&dVn�|dkr6dVn�|dkrFdVn��|��r\�|�Vn��|�	�rr�|�Vn��|�
�f�r��||�EdHnj�|��r��||�EdHnN�dk	rֈ
|�}|�krΈd��|�|<�|�}�||�EdH�dk	r��|=dS)NrRTrSFrTrOr)r4rVrW)r?�_defaultrIr[r]rJr_r`rarCrbrcr7r:rHr8r;rrrJ�s2



z%_make_iterencode.<locals>._iterencoder)rHrlrIr\r[rir^rkrjr5r?rarCrbrcr7r:r8r;r]r)r?rlrIr[r\r]r^rJr_r`rirjrkrarCrbrcr7r:rHr8r;rrGs.84P,rG)$rM�reZ_jsonrZc_encode_basestring_ascii�ImportErrorrZc_encode_basestringrrF�compilerr!ZHAS_UTF8r�range�i�
setdefault�chrrrCrErr"�objectr#r?rarbrcr7r:r8r;rDrGrrrr�<module>sZ





�		�>�json/__pycache__/__init__.cpython-38.opt-1.pyc000064400000030502151153537540015064 0ustar00U

e5d	8�
@s�dZdZdddddddgZd	Zd
dlmZmZd
dlmZd
dl	Z	edddddddd�Z
dddddddddd�	dd�Zdddddddddd�	dd�Zeddd�Z
dd�Zddddddd�dd�Zddddddd�dd�ZdS)aJSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.

:mod:`json` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules.  It is derived from a
version of the externally maintained simplejson library.

Encoding basic Python object hierarchies::

    >>> import json
    >>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}])
    '["foo", {"bar": ["baz", null, 1.0, 2]}]'
    >>> print(json.dumps("\"foo\bar"))
    "\"foo\bar"
    >>> print(json.dumps('\u1234'))
    "\u1234"
    >>> print(json.dumps('\\'))
    "\\"
    >>> print(json.dumps({"c": 0, "b": 0, "a": 0}, sort_keys=True))
    {"a": 0, "b": 0, "c": 0}
    >>> from io import StringIO
    >>> io = StringIO()
    >>> json.dump(['streaming API'], io)
    >>> io.getvalue()
    '["streaming API"]'

Compact encoding::

    >>> import json
    >>> mydict = {'4': 5, '6': 7}
    >>> json.dumps([1,2,3,mydict], separators=(',', ':'))
    '[1,2,3,{"4":5,"6":7}]'

Pretty printing::

    >>> import json
    >>> print(json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4))
    {
        "4": 5,
        "6": 7
    }

Decoding JSON::

    >>> import json
    >>> obj = ['foo', {'bar': ['baz', None, 1.0, 2]}]
    >>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]') == obj
    True
    >>> json.loads('"\\"foo\\bar"') == '"foo\x08ar'
    True
    >>> from io import StringIO
    >>> io = StringIO('["streaming API"]')
    >>> json.load(io)[0] == 'streaming API'
    True

Specializing JSON object decoding::

    >>> import json
    >>> def as_complex(dct):
    ...     if '__complex__' in dct:
    ...         return complex(dct['real'], dct['imag'])
    ...     return dct
    ...
    >>> json.loads('{"__complex__": true, "real": 1, "imag": 2}',
    ...     object_hook=as_complex)
    (1+2j)
    >>> from decimal import Decimal
    >>> json.loads('1.1', parse_float=Decimal) == Decimal('1.1')
    True

Specializing JSON object encoding::

    >>> import json
    >>> def encode_complex(obj):
    ...     if isinstance(obj, complex):
    ...         return [obj.real, obj.imag]
    ...     raise TypeError(f'Object of type {obj.__class__.__name__} '
    ...                     f'is not JSON serializable')
    ...
    >>> json.dumps(2 + 1j, default=encode_complex)
    '[2.0, 1.0]'
    >>> json.JSONEncoder(default=encode_complex).encode(2 + 1j)
    '[2.0, 1.0]'
    >>> ''.join(json.JSONEncoder(default=encode_complex).iterencode(2 + 1j))
    '[2.0, 1.0]'


Using json.tool from the shell to validate and pretty-print::

    $ echo '{"json":"obj"}' | python -m json.tool
    {
        "json": "obj"
    }
    $ echo '{ 1.2:3.4}' | python -m json.tool
    Expecting property name enclosed in double quotes: line 1 column 3 (char 2)
z2.0.9�dump�dumps�load�loads�JSONDecoder�JSONDecodeError�JSONEncoderzBob Ippolito <bob@redivi.com>�)rr)r�NFT)�skipkeys�ensure_ascii�check_circular�	allow_nan�indent�
separators�default)	r
rrr
�clsrrr�	sort_keysc	Ks�|sD|rD|rD|rD|dkrD|dkrD|dkrD|	dkrD|
sD|sDt�|�}n2|dkrPt}|f|||||||	|
d�|���|�}|D]}
|�|
�qzdS)a�Serialize ``obj`` as a JSON formatted stream to ``fp`` (a
    ``.write()``-supporting file-like object).

    If ``skipkeys`` is true then ``dict`` keys that are not basic types
    (``str``, ``int``, ``float``, ``bool``, ``None``) will be skipped
    instead of raising a ``TypeError``.

    If ``ensure_ascii`` is false, then the strings written to ``fp`` can
    contain non-ASCII characters if they appear in strings contained in
    ``obj``. Otherwise, all such characters are escaped in JSON strings.

    If ``check_circular`` is false, then the circular reference check
    for container types will be skipped and a circular reference will
    result in an ``OverflowError`` (or worse).

    If ``allow_nan`` is false, then it will be a ``ValueError`` to
    serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``)
    in strict compliance of the JSON specification, instead of using the
    JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``).

    If ``indent`` is a non-negative integer, then JSON array elements and
    object members will be pretty-printed with that indent level. An indent
    level of 0 will only insert newlines. ``None`` is the most compact
    representation.

    If specified, ``separators`` should be an ``(item_separator, key_separator)``
    tuple.  The default is ``(', ', ': ')`` if *indent* is ``None`` and
    ``(',', ': ')`` otherwise.  To get the most compact JSON representation,
    you should specify ``(',', ':')`` to eliminate whitespace.

    ``default(obj)`` is a function that should return a serializable version
    of obj or raise TypeError. The default simply raises TypeError.

    If *sort_keys* is true (default: ``False``), then the output of
    dictionaries will be sorted by key.

    To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the
    ``.default()`` method to serialize additional types), specify it with
    the ``cls`` kwarg; otherwise ``JSONEncoder`` is used.

    N�r
rrr
rrrr)�_default_encoder�
iterencoder�write)�obj�fpr
rrr
rrrrr�kw�iterable�chunk�r�%/usr/lib64/python3.8/json/__init__.pyrxsD-�����������c	Kst|sB|rB|rB|rB|dkrB|dkrB|dkrB|dkrB|	sB|
sBt�|�S|dkrNt}|f||||||||	d�|
���|�S)auSerialize ``obj`` to a JSON formatted ``str``.

    If ``skipkeys`` is true then ``dict`` keys that are not basic types
    (``str``, ``int``, ``float``, ``bool``, ``None``) will be skipped
    instead of raising a ``TypeError``.

    If ``ensure_ascii`` is false, then the return value can contain non-ASCII
    characters if they appear in strings contained in ``obj``. Otherwise, all
    such characters are escaped in JSON strings.

    If ``check_circular`` is false, then the circular reference check
    for container types will be skipped and a circular reference will
    result in an ``OverflowError`` (or worse).

    If ``allow_nan`` is false, then it will be a ``ValueError`` to
    serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in
    strict compliance of the JSON specification, instead of using the
    JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``).

    If ``indent`` is a non-negative integer, then JSON array elements and
    object members will be pretty-printed with that indent level. An indent
    level of 0 will only insert newlines. ``None`` is the most compact
    representation.

    If specified, ``separators`` should be an ``(item_separator, key_separator)``
    tuple.  The default is ``(', ', ': ')`` if *indent* is ``None`` and
    ``(',', ': ')`` otherwise.  To get the most compact JSON representation,
    you should specify ``(',', ':')`` to eliminate whitespace.

    ``default(obj)`` is a function that should return a serializable version
    of obj or raise TypeError. The default simply raises TypeError.

    If *sort_keys* is true (default: ``False``), then the output of
    dictionaries will be sorted by key.

    To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the
    ``.default()`` method to serialize additional types), specify it with
    the ``cls`` kwarg; otherwise ``JSONEncoder`` is used.

    Nr)r�encoder)rr
rrr
rrrrrrrrrr�sD,��������
���)�object_hook�object_pairs_hookcCs�|j}|tjtjf�rdS|tjtjf�r.dS|tj�r<dSt|�dkr�|ds`|dr\dSdS|ds�|d	sx|d
r|dSdSn$t|�d	kr�|ds�dS|ds�dSd
S)Nzutf-32zutf-16z	utf-8-sig�r	rz	utf-16-bez	utf-32-be��z	utf-16-lez	utf-32-lezutf-8)�
startswith�codecs�BOM_UTF32_BE�BOM_UTF32_LE�BOM_UTF16_BE�BOM_UTF16_LE�BOM_UTF8�len)�bZbstartswithrrr�detect_encoding�s$
r-�rr�parse_float�	parse_int�parse_constantr c	Ks"t|��f||||||d�|��S)a�Deserialize ``fp`` (a ``.read()``-supporting file-like object containing
    a JSON document) to a Python object.

    ``object_hook`` is an optional function that will be called with the
    result of any object literal decode (a ``dict``). The return value of
    ``object_hook`` will be used instead of the ``dict``. This feature
    can be used to implement custom decoders (e.g. JSON-RPC class hinting).

    ``object_pairs_hook`` is an optional function that will be called with the
    result of any object literal decoded with an ordered list of pairs.  The
    return value of ``object_pairs_hook`` will be used instead of the ``dict``.
    This feature can be used to implement custom decoders.  If ``object_hook``
    is also defined, the ``object_pairs_hook`` takes priority.

    To use a custom ``JSONDecoder`` subclass, specify it with the ``cls``
    kwarg; otherwise ``JSONDecoder`` is used.
    r.)r�read)rrrr/r0r1r rrrrrs
��c	Ks&t|t�r"|�d�rRtd|d��n0t|ttf�sBtd|jj����|�	t
|�d�}d|krxddl}|jdt
d	d
�|d=|dkr�|dkr�|dkr�|dkr�|dkr�|dkr�|s�t�	|�S|dkr�t}|dk	r�||d<|dk	r�||d<|dk	r�||d
<|dk	�r||d<|dk	�r||d<|f|��	|�S)a�Deserialize ``s`` (a ``str``, ``bytes`` or ``bytearray`` instance
    containing a JSON document) to a Python object.

    ``object_hook`` is an optional function that will be called with the
    result of any object literal decode (a ``dict``). The return value of
    ``object_hook`` will be used instead of the ``dict``. This feature
    can be used to implement custom decoders (e.g. JSON-RPC class hinting).

    ``object_pairs_hook`` is an optional function that will be called with the
    result of any object literal decoded with an ordered list of pairs.  The
    return value of ``object_pairs_hook`` will be used instead of the ``dict``.
    This feature can be used to implement custom decoders.  If ``object_hook``
    is also defined, the ``object_pairs_hook`` takes priority.

    ``parse_float``, if specified, will be called with the string
    of every JSON float to be decoded. By default this is equivalent to
    float(num_str). This can be used to use another datatype or parser
    for JSON floats (e.g. decimal.Decimal).

    ``parse_int``, if specified, will be called with the string
    of every JSON int to be decoded. By default this is equivalent to
    int(num_str). This can be used to use another datatype or parser
    for JSON integers (e.g. float).

    ``parse_constant``, if specified, will be called with one of the
    following strings: -Infinity, Infinity, NaN.
    This can be used to raise an exception if invalid JSON numbers
    are encountered.

    To use a custom ``JSONDecoder`` subclass, specify it with the ``cls``
    kwarg; otherwise ``JSONDecoder`` is used.

    The ``encoding`` argument is ignored and deprecated since Python 3.1.
    uz-Unexpected UTF-8 BOM (decode using utf-8-sig)r	z5the JSON object must be str, bytes or bytearray, not �
surrogatepass�encodingNzF'encoding' is ignored and deprecated. It will be removed in Python 3.9r")�
stacklevelrr r/r0r1)�
isinstance�strr$r�bytes�	bytearray�	TypeError�	__class__�__name__�decoder-�warnings�warn�DeprecationWarning�_default_decoderr)	�srrr/r0r1r rr>rrrr+sT$

�������


)�__doc__�__version__�__all__�
__author__�decoderrr�encoderrr%rrrrAr-rrrrrr�<module>sda��
�?�:��json/__pycache__/scanner.cpython-38.opt-2.pyc000064400000003575151153537540014771 0ustar00U

e5dy	�@sfddlZzddlmZWnek
r0dZYnXdgZe�dejejBej	B�Z
dd�Zep`eZdS)�N)�make_scannerrz)(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?csv|j�	|j�|j�
tj�|j�|j�|j�|j�|j	�|j
�|j�����������	�
�fdd����fdd�}|S)Ncs�z||}Wntk
r*t|�d�YnX|dkrD�
||d��S|dkrf�	||df������S|dkr��||df��S|dkr�|||d�dkr�d|dfS|dkr�|||d�d	kr�d
|dfS|dk�r�|||d�d
k�r�d|dfS�||�}|dk	�r\|��\}}}|�s*|�rH�||�p6d|�p@d�}n�|�}||��fS|dk�r�|||d�dk�r��d�|dfS|dk�r�|||d�dk�r��d�|dfS|dk�r�|||d�dk�r�d�|dfSt|��dS)N�"��{�[�n�Znull�t�trueT�f�ZfalseF��N�ZNaN�I�ZInfinity�-�	z	-Infinity)�
IndexError�
StopIteration�groups�end)�string�idxZnextchar�mZintegerZfracZexp�res��
_scan_onceZmatch_number�memo�object_hook�object_pairs_hook�parse_array�parse_constant�parse_float�	parse_int�parse_object�parse_string�strict��$/usr/lib64/python3.8/json/scanner.pyrsF� 

   z#py_make_scanner.<locals>._scan_oncecsz�||�W�S���XdS)N)�clear)rr)rrr(r)�	scan_onceAsz"py_make_scanner.<locals>.scan_once)r%r!r&�	NUMBER_RE�matchr'r#r$r"rr r)�contextr+r(rr)�py_make_scanners"%r/)�reZ_jsonrZc_make_scanner�ImportError�__all__�compile�VERBOSE�	MULTILINE�DOTALLr,r/r(r(r(r)�<module>s
�:json/__pycache__/decoder.cpython-38.opt-1.pyc000064400000023166151153537540014742 0ustar00U

e5d�0�	@sdZddlZddlmZzddlmZWnek
r@dZYnXddgZej	ej
BejBZe
d�Ze
d�Ze
d	�ZGd
d�de�Zeeed�Ze�de�Zd
dddddddd�Zdd�Zdeejfdd�Zep�eZe�de�ZdZdejefdd�Zejefdd �ZGd!d�de�ZdS)"zImplementation of JSONDecoder
�N)�scanner)�
scanstring�JSONDecoder�JSONDecodeError�nan�infz-infc@s eZdZdZdd�Zdd�ZdS)ra Subclass of ValueError with the following additional properties:

    msg: The unformatted error message
    doc: The JSON document being parsed
    pos: The start index of doc where parsing failed
    lineno: The line corresponding to pos
    colno: The column corresponding to pos

    cCsb|�dd|�d}||�dd|�}d||||f}t�||�||_||_||_||_||_dS)N�
r�z%s: line %d column %d (char %d))	�count�rfind�
ValueError�__init__�msg�doc�pos�lineno�colno)�selfrrrrr�errmsg�r�$/usr/lib64/python3.8/json/decoder.pyr
szJSONDecodeError.__init__cCs|j|j|j|jffS)N)�	__class__rrr)rrrr�
__reduce__*szJSONDecodeError.__reduce__N)�__name__�
__module__�__qualname__�__doc__r
rrrrrrs
)z	-InfinityZInfinity�NaNz(.*?)(["\\\x00-\x1f])�"�\�/��r�
�	)rrr �b�f�n�r�tcCsb||d|d�}t|�dkrN|ddkrNzt|d�WStk
rLYnXd}t|||��dS)Nr	��ZxX�zInvalid \uXXXX escape)�len�intrr)�sr�escrrrr�
_decode_uXXXX;sr1TcCs�g}|j}|d}|||�}|dkr0td||��|��}|��\}	}
|	rP||	�|
dkr^�q�n.|
dkr�|r�d�|
�}t|||��n
||
�qz||}Wn"tk
r�td||�d�YnX|dk�rz||}
Wn*tk
r�d�|�}t|||��YnX|d7}n�t||�}|d	7}d
|k�r2dk�r�nn`|||d�d
k�r�t||d�}d|k�rrdk�r�nn d|d
d>|dB}|d7}t|�}
||
�qd�	|�|fS)a�Scan the string s for a JSON string. End is the index of the
    character in s after the quote that started the JSON string.
    Unescapes all valid JSON string escape sequences and raises ValueError
    on attempt to decode an invalid string. If strict is False then literal
    control characters are allowed in the string.

    Returns a tuple of the decoded string and the index of the character in s
    after the end quote.r	NzUnterminated string starting atrrz"Invalid control character {0!r} at�uzInvalid \escape: {0!r}r*i�i���z\ui�i��i�
��)
�appendr�end�groups�format�
IndexError�KeyErrorr1�chr�join)r/r8�strictZ_b�_mZchunks�_appendZbegin�chunkZcontent�
terminatorrr0�charZuniZuni2rrr�
py_scanstringEsX


��



2
rEz
[ \t\n\r]*z 	

c
Cs�|\}}	g}
|
j}|dkri}|j}||	|	d�}
|
dkr�|
|krb|||	���}	||	|	d�}
|
dkr�|dk	r�||
�}||	dfSi}
|dk	r�||
�}
|
|	dfS|
dkr�td||	��|	d7}	t||	|�\}}	|||�}||	|	d�dk�r"|||	���}	||	|	d�dk�r"td||	��|	d7}	z:||	|k�rb|	d7}	||	|k�rb|||	d���}	Wntk
�rzYnXz|||	�\}}	Wn4tk
�r�}ztd||j�d�W5d}~XYnX|||f�z0||	}
|
|k�r�|||	d���}	||	}
Wntk
�rd}
YnX|	d7}	|
dk�r4�q�n|
d	k�rNtd
||	d��|||	���}	||	|	d�}
|	d7}	|
dkr�td||	d��q�|dk	�r�||
�}||	fSt|
�}
|dk	�r�||
�}
|
|	fS)Nr	r�}z1Expecting property name enclosed in double quotes�:zExpecting ':' delimiter�Expecting valuer6�,�Expecting ',' delimiter)	r7�
setdefaultr8rrr;�
StopIteration�value�dict)�	s_and_endr?�	scan_once�object_hook�object_pairs_hook�memo�_w�_wsr/r8ZpairsZpairs_appendZmemo_get�nextchar�result�keyrM�errrrr�
JSONObject�s��
"



�

rZc
Cst|\}}g}|||d�}||krF|||d���}|||d�}|dkrZ||dfS|j}z|||�\}	}Wn2tk
r�}
ztd||
j�d�W5d}
~
XYnX||	�|||d�}||kr�|||d���}|||d�}|d7}|dkr��qln|dk�rtd||d��z:|||k�rP|d7}|||k�rP|||d���}Wq`tk
�rhYq`Xq`||fS)Nr	�]rHrIrJ)r8r7rLrrMr;)rOrPrTrUr/r8�valuesrVrArMrYrrr�	JSONArray�s>"
r]c@s@eZdZdZddddddd�dd�Zejfdd�Zdd
d�ZdS)
raSimple JSON <http://json.org> decoder

    Performs the following translations in decoding by default:

    +---------------+-------------------+
    | JSON          | Python            |
    +===============+===================+
    | object        | dict              |
    +---------------+-------------------+
    | array         | list              |
    +---------------+-------------------+
    | string        | str               |
    +---------------+-------------------+
    | number (int)  | int               |
    +---------------+-------------------+
    | number (real) | float             |
    +---------------+-------------------+
    | true          | True              |
    +---------------+-------------------+
    | false         | False             |
    +---------------+-------------------+
    | null          | None              |
    +---------------+-------------------+

    It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as
    their corresponding ``float`` values, which is outside the JSON spec.

    NT)rQ�parse_float�	parse_int�parse_constantr?rRcCsZ||_|pt|_|pt|_|p"tj|_||_||_	t
|_t|_
t|_i|_t�|�|_dS)a�``object_hook``, if specified, will be called with the result
        of every JSON object decoded and its return value will be used in
        place of the given ``dict``.  This can be used to provide custom
        deserializations (e.g. to support JSON-RPC class hinting).

        ``object_pairs_hook``, if specified will be called with the result of
        every JSON object decoded with an ordered list of pairs.  The return
        value of ``object_pairs_hook`` will be used instead of the ``dict``.
        This feature can be used to implement custom decoders.
        If ``object_hook`` is also defined, the ``object_pairs_hook`` takes
        priority.

        ``parse_float``, if specified, will be called with the string
        of every JSON float to be decoded. By default this is equivalent to
        float(num_str). This can be used to use another datatype or parser
        for JSON floats (e.g. decimal.Decimal).

        ``parse_int``, if specified, will be called with the string
        of every JSON int to be decoded. By default this is equivalent to
        int(num_str). This can be used to use another datatype or parser
        for JSON integers (e.g. float).

        ``parse_constant``, if specified, will be called with one of the
        following strings: -Infinity, Infinity, NaN.
        This can be used to raise an exception if invalid JSON numbers
        are encountered.

        If ``strict`` is false (true is the default), then control
        characters will be allowed inside strings.  Control characters in
        this context are those with character codes in the 0-31 range,
        including ``'\t'`` (tab), ``'\n'``, ``'\r'`` and ``'\0'``.
        N)rQ�floatr^r.r_�
_CONSTANTS�__getitem__r`r?rRrZZparse_objectr]Zparse_arrayrZparse_stringrSrZmake_scannerrP)rrQr^r_r`r?rRrrrr
s#

zJSONDecoder.__init__cCsF|j|||d���d�\}}|||���}|t|�krBtd||��|S)zlReturn the Python representation of ``s`` (a ``str`` instance
        containing a JSON document).

        r)�idxz
Extra data)�
raw_decoder8r-r)rr/rT�objr8rrr�decodeLs
zJSONDecoder.decoderc
CsPz|�||�\}}Wn2tk
rF}ztd||j�d�W5d}~XYnX||fS)a=Decode a JSON document from ``s`` (a ``str`` beginning with
        a JSON document) and return a 2-tuple of the Python
        representation and the index in ``s`` where the document ended.

        This can be used to decode a JSON document from a string that may
        have extraneous data at the end.

        rHN)rPrLrrM)rr/rdrfr8rYrrrreWs
	"zJSONDecoder.raw_decode)r)	rrrrr
�
WHITESPACE�matchrgrerrrrr�s�0) r�reZjsonrZ_jsonrZc_scanstring�ImportError�__all__�VERBOSE�	MULTILINE�DOTALL�FLAGSrarZPosInfZNegInfrrrb�compileZSTRINGCHUNKZ	BACKSLASHr1rirErhZWHITESPACE_STRrZr]�objectrrrrr�<module>sP
��
�
=�
Q%json/__pycache__/scanner.cpython-38.pyc000064400000003641151153537540014023 0ustar00U

e5dy	�@sjdZddlZzddlmZWnek
r4dZYnXdgZe�dejej	Bej
B�Zdd�ZepdeZdS)zJSON token scanner
�N)�make_scannerrz)(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?csv|j�	|j�|j�
tj�|j�|j�|j�|j�|j	�|j
�|j�����������	�
�fdd����fdd�}|S)Ncs�z||}Wntk
r*t|�d�YnX|dkrD�
||d��S|dkrf�	||df������S|dkr��||df��S|dkr�|||d�dkr�d|dfS|dkr�|||d�d	kr�d
|dfS|dk�r�|||d�d
k�r�d|dfS�||�}|dk	�r\|��\}}}|�s*|�rH�||�p6d|�p@d�}n�|�}||��fS|dk�r�|||d�dk�r��d�|dfS|dk�r�|||d�dk�r��d�|dfS|dk�r�|||d�dk�r�d�|dfSt|��dS)N�"��{�[�n�Znull�t�trueT�f�ZfalseF��N�ZNaN�I�ZInfinity�-�	z	-Infinity)�
IndexError�
StopIteration�groups�end)�string�idxZnextchar�mZintegerZfracZexp�res��
_scan_onceZmatch_number�memo�object_hook�object_pairs_hook�parse_array�parse_constant�parse_float�	parse_int�parse_object�parse_string�strict��$/usr/lib64/python3.8/json/scanner.pyrsF� 

   z#py_make_scanner.<locals>._scan_oncecsz�||�W�S���XdS)N)�clear)rr)rrr(r)�	scan_onceAsz"py_make_scanner.<locals>.scan_once)r%r!r&�	NUMBER_RE�matchr'r#r$r"rr r)�contextr+r(rr)�py_make_scanners"%r/)
�__doc__�reZ_jsonrZc_make_scanner�ImportError�__all__�compile�VERBOSE�	MULTILINE�DOTALLr,r/r(r(r(r)�<module>s
�:json/__pycache__/decoder.cpython-38.pyc000064400000023166151153537540014003 0ustar00U

e5d�0�	@sdZddlZddlmZzddlmZWnek
r@dZYnXddgZej	ej
BejBZe
d�Ze
d�Ze
d	�ZGd
d�de�Zeeed�Ze�de�Zd
dddddddd�Zdd�Zdeejfdd�Zep�eZe�de�ZdZdejefdd�Zejefdd �ZGd!d�de�ZdS)"zImplementation of JSONDecoder
�N)�scanner)�
scanstring�JSONDecoder�JSONDecodeError�nan�infz-infc@s eZdZdZdd�Zdd�ZdS)ra Subclass of ValueError with the following additional properties:

    msg: The unformatted error message
    doc: The JSON document being parsed
    pos: The start index of doc where parsing failed
    lineno: The line corresponding to pos
    colno: The column corresponding to pos

    cCsb|�dd|�d}||�dd|�}d||||f}t�||�||_||_||_||_||_dS)N�
r�z%s: line %d column %d (char %d))	�count�rfind�
ValueError�__init__�msg�doc�pos�lineno�colno)�selfrrrrr�errmsg�r�$/usr/lib64/python3.8/json/decoder.pyr
szJSONDecodeError.__init__cCs|j|j|j|jffS)N)�	__class__rrr)rrrr�
__reduce__*szJSONDecodeError.__reduce__N)�__name__�
__module__�__qualname__�__doc__r
rrrrrrs
)z	-InfinityZInfinity�NaNz(.*?)(["\\\x00-\x1f])�"�\�/��r�
�	)rrr �b�f�n�r�tcCsb||d|d�}t|�dkrN|ddkrNzt|d�WStk
rLYnXd}t|||��dS)Nr	��ZxX�zInvalid \uXXXX escape)�len�intrr)�sr�escrrrr�
_decode_uXXXX;sr1TcCs�g}|j}|d}|||�}|dkr0td||��|��}|��\}	}
|	rP||	�|
dkr^�q�n.|
dkr�|r�d�|
�}t|||��n
||
�qz||}Wn"tk
r�td||�d�YnX|dk�rz||}
Wn*tk
r�d�|�}t|||��YnX|d7}n�t||�}|d	7}d
|k�r2dk�r�nn`|||d�d
k�r�t||d�}d|k�rrdk�r�nn d|d
d>|dB}|d7}t|�}
||
�qd�	|�|fS)a�Scan the string s for a JSON string. End is the index of the
    character in s after the quote that started the JSON string.
    Unescapes all valid JSON string escape sequences and raises ValueError
    on attempt to decode an invalid string. If strict is False then literal
    control characters are allowed in the string.

    Returns a tuple of the decoded string and the index of the character in s
    after the end quote.r	NzUnterminated string starting atrrz"Invalid control character {0!r} at�uzInvalid \escape: {0!r}r*i�i���z\ui�i��i�
��)
�appendr�end�groups�format�
IndexError�KeyErrorr1�chr�join)r/r8�strictZ_b�_mZchunks�_appendZbegin�chunkZcontent�
terminatorrr0�charZuniZuni2rrr�
py_scanstringEsX


��



2
rEz
[ \t\n\r]*z 	

c
Cs�|\}}	g}
|
j}|dkri}|j}||	|	d�}
|
dkr�|
|krb|||	���}	||	|	d�}
|
dkr�|dk	r�||
�}||	dfSi}
|dk	r�||
�}
|
|	dfS|
dkr�td||	��|	d7}	t||	|�\}}	|||�}||	|	d�dk�r"|||	���}	||	|	d�dk�r"td||	��|	d7}	z:||	|k�rb|	d7}	||	|k�rb|||	d���}	Wntk
�rzYnXz|||	�\}}	Wn4tk
�r�}ztd||j�d�W5d}~XYnX|||f�z0||	}
|
|k�r�|||	d���}	||	}
Wntk
�rd}
YnX|	d7}	|
dk�r4�q�n|
d	k�rNtd
||	d��|||	���}	||	|	d�}
|	d7}	|
dkr�td||	d��q�|dk	�r�||
�}||	fSt|
�}
|dk	�r�||
�}
|
|	fS)Nr	r�}z1Expecting property name enclosed in double quotes�:zExpecting ':' delimiter�Expecting valuer6�,�Expecting ',' delimiter)	r7�
setdefaultr8rrr;�
StopIteration�value�dict)�	s_and_endr?�	scan_once�object_hook�object_pairs_hook�memo�_w�_wsr/r8ZpairsZpairs_appendZmemo_get�nextchar�result�keyrM�errrrr�
JSONObject�s��
"



�

rZc
Cst|\}}g}|||d�}||krF|||d���}|||d�}|dkrZ||dfS|j}z|||�\}	}Wn2tk
r�}
ztd||
j�d�W5d}
~
XYnX||	�|||d�}||kr�|||d���}|||d�}|d7}|dkr��qln|dk�rtd||d��z:|||k�rP|d7}|||k�rP|||d���}Wq`tk
�rhYq`Xq`||fS)Nr	�]rHrIrJ)r8r7rLrrMr;)rOrPrTrUr/r8�valuesrVrArMrYrrr�	JSONArray�s>"
r]c@s@eZdZdZddddddd�dd�Zejfdd�Zdd
d�ZdS)
raSimple JSON <http://json.org> decoder

    Performs the following translations in decoding by default:

    +---------------+-------------------+
    | JSON          | Python            |
    +===============+===================+
    | object        | dict              |
    +---------------+-------------------+
    | array         | list              |
    +---------------+-------------------+
    | string        | str               |
    +---------------+-------------------+
    | number (int)  | int               |
    +---------------+-------------------+
    | number (real) | float             |
    +---------------+-------------------+
    | true          | True              |
    +---------------+-------------------+
    | false         | False             |
    +---------------+-------------------+
    | null          | None              |
    +---------------+-------------------+

    It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as
    their corresponding ``float`` values, which is outside the JSON spec.

    NT)rQ�parse_float�	parse_int�parse_constantr?rRcCsZ||_|pt|_|pt|_|p"tj|_||_||_	t
|_t|_
t|_i|_t�|�|_dS)a�``object_hook``, if specified, will be called with the result
        of every JSON object decoded and its return value will be used in
        place of the given ``dict``.  This can be used to provide custom
        deserializations (e.g. to support JSON-RPC class hinting).

        ``object_pairs_hook``, if specified will be called with the result of
        every JSON object decoded with an ordered list of pairs.  The return
        value of ``object_pairs_hook`` will be used instead of the ``dict``.
        This feature can be used to implement custom decoders.
        If ``object_hook`` is also defined, the ``object_pairs_hook`` takes
        priority.

        ``parse_float``, if specified, will be called with the string
        of every JSON float to be decoded. By default this is equivalent to
        float(num_str). This can be used to use another datatype or parser
        for JSON floats (e.g. decimal.Decimal).

        ``parse_int``, if specified, will be called with the string
        of every JSON int to be decoded. By default this is equivalent to
        int(num_str). This can be used to use another datatype or parser
        for JSON integers (e.g. float).

        ``parse_constant``, if specified, will be called with one of the
        following strings: -Infinity, Infinity, NaN.
        This can be used to raise an exception if invalid JSON numbers
        are encountered.

        If ``strict`` is false (true is the default), then control
        characters will be allowed inside strings.  Control characters in
        this context are those with character codes in the 0-31 range,
        including ``'\t'`` (tab), ``'\n'``, ``'\r'`` and ``'\0'``.
        N)rQ�floatr^r.r_�
_CONSTANTS�__getitem__r`r?rRrZZparse_objectr]Zparse_arrayrZparse_stringrSrZmake_scannerrP)rrQr^r_r`r?rRrrrr
s#

zJSONDecoder.__init__cCsF|j|||d���d�\}}|||���}|t|�krBtd||��|S)zlReturn the Python representation of ``s`` (a ``str`` instance
        containing a JSON document).

        r)�idxz
Extra data)�
raw_decoder8r-r)rr/rT�objr8rrr�decodeLs
zJSONDecoder.decoderc
CsPz|�||�\}}Wn2tk
rF}ztd||j�d�W5d}~XYnX||fS)a=Decode a JSON document from ``s`` (a ``str`` beginning with
        a JSON document) and return a 2-tuple of the Python
        representation and the index in ``s`` where the document ended.

        This can be used to decode a JSON document from a string that may
        have extraneous data at the end.

        rHN)rPrLrrM)rr/rdrfr8rYrrrreWs
	"zJSONDecoder.raw_decode)r)	rrrrr
�
WHITESPACE�matchrgrerrrrr�s�0) r�reZjsonrZ_jsonrZc_scanstring�ImportError�__all__�VERBOSE�	MULTILINE�DOTALL�FLAGSrarZPosInfZNegInfrrrb�compileZSTRINGCHUNKZ	BACKSLASHr1rirErhZWHITESPACE_STRrZr]�objectrrrrr�<module>sP
��
�
=�
Q%json/__pycache__/scanner.cpython-38.opt-1.pyc000064400000003641151153537540014762 0ustar00U

e5dy	�@sjdZddlZzddlmZWnek
r4dZYnXdgZe�dejej	Bej
B�Zdd�ZepdeZdS)zJSON token scanner
�N)�make_scannerrz)(-?(?:0|[1-9]\d*))(\.\d+)?([eE][-+]?\d+)?csv|j�	|j�|j�
tj�|j�|j�|j�|j�|j	�|j
�|j�����������	�
�fdd����fdd�}|S)Ncs�z||}Wntk
r*t|�d�YnX|dkrD�
||d��S|dkrf�	||df������S|dkr��||df��S|dkr�|||d�dkr�d|dfS|dkr�|||d�d	kr�d
|dfS|dk�r�|||d�d
k�r�d|dfS�||�}|dk	�r\|��\}}}|�s*|�rH�||�p6d|�p@d�}n�|�}||��fS|dk�r�|||d�dk�r��d�|dfS|dk�r�|||d�dk�r��d�|dfS|dk�r�|||d�dk�r�d�|dfSt|��dS)N�"��{�[�n�Znull�t�trueT�f�ZfalseF��N�ZNaN�I�ZInfinity�-�	z	-Infinity)�
IndexError�
StopIteration�groups�end)�string�idxZnextchar�mZintegerZfracZexp�res��
_scan_onceZmatch_number�memo�object_hook�object_pairs_hook�parse_array�parse_constant�parse_float�	parse_int�parse_object�parse_string�strict��$/usr/lib64/python3.8/json/scanner.pyrsF� 

   z#py_make_scanner.<locals>._scan_oncecsz�||�W�S���XdS)N)�clear)rr)rrr(r)�	scan_onceAsz"py_make_scanner.<locals>.scan_once)r%r!r&�	NUMBER_RE�matchr'r#r$r"rr r)�contextr+r(rr)�py_make_scanners"%r/)
�__doc__�reZ_jsonrZc_make_scanner�ImportError�__all__�compile�VERBOSE�	MULTILINE�DOTALLr,r/r(r(r(r)�<module>s
�:json/__pycache__/encoder.cpython-38.pyc000064400000025645151153537540014021 0ustar00U

e5d�>�
@s>dZddlZzddlmZWnek
r4dZYnXzddlmZWnek
r^dZYnXzddlmZ	Wnek
r�dZ	YnXe�
d�Ze�
d�Ze�
d�Z
d	d
ddd
ddd�Zed�D]Ze�ee�d�e��q�ed�Zdd�Zep�eZdd�Ze�peZGdd�de�Zeeeeeeee e!ej"f
dd�Z#dS)zImplementation of JSONEncoder
�N)�encode_basestring_ascii)�encode_basestring)�make_encoderz[\x00-\x1f\\"\b\f\n\r\t]z([\\"]|[^\ -~])s[�-�]z\\z\"z\bz\fz\nz\rz\t)�\�"���
�
�	� �	\u{0:04x}�infcCsdd�}dt�||�dS)z5Return a JSON representation of a Python string

    cSst|�d�S)Nr)�
ESCAPE_DCT�group)�match�r�$/usr/lib64/python3.8/json/encoder.py�replace(sz%py_encode_basestring.<locals>.replacer)�ESCAPE�sub��srrrr�py_encode_basestring$srcCsdd�}dt�||�dS)zAReturn an ASCII-only JSON representation of a Python string

    cSs�|�d�}z
t|WStk
rzt|�}|dkrBd�|�YS|d8}d|d?d@B}d|d@B}d�||�YSYnXdS)	Nrir
i��
i�i�z\u{0:04x}\u{1:04x})rr�KeyError�ord�format)rr�n�s1�s2rrrr4s

z+py_encode_basestring_ascii.<locals>.replacer)�ESCAPE_ASCIIrrrrr�py_encode_basestring_ascii0sr"c	@sNeZdZdZdZdZddddddddd�dd	�Zd
d�Zdd
�Zddd�Z	dS)�JSONEncoderaZExtensible JSON <http://json.org> encoder for Python data structures.

    Supports the following objects and types by default:

    +-------------------+---------------+
    | Python            | JSON          |
    +===================+===============+
    | dict              | object        |
    +-------------------+---------------+
    | list, tuple       | array         |
    +-------------------+---------------+
    | str               | string        |
    +-------------------+---------------+
    | int, float        | number        |
    +-------------------+---------------+
    | True              | true          |
    +-------------------+---------------+
    | False             | false         |
    +-------------------+---------------+
    | None              | null          |
    +-------------------+---------------+

    To extend this to recognize other objects, subclass and implement a
    ``.default()`` method with another method that returns a serializable
    object for ``o`` if possible, otherwise it should call the superclass
    implementation (to raise ``TypeError``).

    z, z: FTN)�skipkeys�ensure_ascii�check_circular�	allow_nan�	sort_keys�indent�
separators�defaultc	CsZ||_||_||_||_||_||_|dk	r:|\|_|_n|dk	rHd|_|dk	rV||_dS)a�Constructor for JSONEncoder, with sensible defaults.

        If skipkeys is false, then it is a TypeError to attempt
        encoding of keys that are not str, int, float or None.  If
        skipkeys is True, such items are simply skipped.

        If ensure_ascii is true, the output is guaranteed to be str
        objects with all incoming non-ASCII characters escaped.  If
        ensure_ascii is false, the output can contain non-ASCII characters.

        If check_circular is true, then lists, dicts, and custom encoded
        objects will be checked for circular references during encoding to
        prevent an infinite recursion (which would cause an OverflowError).
        Otherwise, no such check takes place.

        If allow_nan is true, then NaN, Infinity, and -Infinity will be
        encoded as such.  This behavior is not JSON specification compliant,
        but is consistent with most JavaScript based encoders and decoders.
        Otherwise, it will be a ValueError to encode such floats.

        If sort_keys is true, then the output of dictionaries will be
        sorted by key; this is useful for regression tests to ensure
        that JSON serializations can be compared on a day-to-day basis.

        If indent is a non-negative integer, then JSON array
        elements and object members will be pretty-printed with that
        indent level.  An indent level of 0 will only insert newlines.
        None is the most compact representation.

        If specified, separators should be an (item_separator, key_separator)
        tuple.  The default is (', ', ': ') if *indent* is ``None`` and
        (',', ': ') otherwise.  To get the most compact JSON representation,
        you should specify (',', ':') to eliminate whitespace.

        If specified, default is a function that gets called for objects
        that can't otherwise be serialized.  It should return a JSON encodable
        version of the object or raise a ``TypeError``.

        N�,)	r$r%r&r'r(r)�item_separator�
key_separatorr+)	�selfr$r%r&r'r(r)r*r+rrr�__init__hs+zJSONEncoder.__init__cCstd|jj�d���dS)alImplement this method in a subclass such that it returns
        a serializable object for ``o``, or calls the base implementation
        (to raise a ``TypeError``).

        For example, to support arbitrary iterators, you could
        implement default like this::

            def default(self, o):
                try:
                    iterable = iter(o)
                except TypeError:
                    pass
                else:
                    return list(iterable)
                # Let the base class default method raise the TypeError
                return JSONEncoder.default(self, o)

        zObject of type z is not JSON serializableN)�	TypeError�	__class__�__name__)r/�orrrr+�szJSONEncoder.defaultcCsNt|t�r |jrt|�St|�S|j|dd�}t|ttf�sDt|�}d�|�S)z�Return a JSON string representation of a Python data structure.

        >>> from json.encoder import JSONEncoder
        >>> JSONEncoder().encode({"foo": ["bar", "baz"]})
        '{"foo": ["bar", "baz"]}'

        T)�	_one_shot�)	�
isinstance�strr%rr�
iterencode�list�tuple�join)r/r4�chunksrrr�encode�s	
zJSONEncoder.encodecCs�|jri}nd}|jrt}nt}|jtjttfdd�}|rvtdk	rv|j	dkrvt||j
||j	|j|j|j
|j|j�	}n&t||j
||j	||j|j|j
|j|�
}||d�S)z�Encode the given object and yield each string
        representation as available.

        For example::

            for chunk in JSONEncoder().iterencode(bigobject):
                mysocket.write(chunk)

        NcSsJ||krd}n$||krd}n||kr*d}n||�S|sFtdt|���|S)NZNaNZInfinityz	-Infinityz2Out of range float values are not JSON compliant: )�
ValueError�repr)r4r'Z_reprZ_infZ_neginf�textrrr�floatstr�s��z(JSONEncoder.iterencode.<locals>.floatstrr)r&r%rrr'�float�__repr__�INFINITY�c_make_encoderr)r+r.r-r(r$�_make_iterencode)r/r4r5�markers�_encoderrB�_iterencoderrrr9�sL
�
���zJSONEncoder.iterencode)F)
r3�
__module__�__qualname__�__doc__r-r.r0r+r>r9rrrrr#Is�8r#cs��dk	r����sd�����������	�
��������fdd��	���������	�
���
��������fdd����������	�
��������fdd���S)N� c	3s�|sdVdS�dk	r6�|�}|�kr.�d��|�|<d}�dk	rh|d7}d�|}�|}||7}nd}�}d}|D]�}|r�d}n|}�
|��r�|�|�Vqx|dkr�|dVqx|dkr�|d	Vqx|dkr�|d
Vqx�
|��r�|�|�Vqx�
|�
��r|�|�Vqx|V�
|��f��r8�||�}n"�
|�	��rP�||�}n
�||�}|EdHqx|dk	�r�|d8}d�|VdV�dk	�r��|=dS)Nz[]�Circular reference detected�[�r	TF�null�true�false�]r)	Zlst�_current_indent_level�markeridZbuf�newline_indentZ	separator�first�valuer=)r?rI�	_floatstr�_indent�_intstr�_item_separatorrJ�_iterencode_dict�_iterencode_list�dictrC�id�intr7r:rHr8r;rrr`s\





z*_make_iterencode.<locals>._iterencode_listc
3s:|sdVdS�dk	r6�|�}|�kr.�d��|�|<dV�dk	rh|d7}d�|}�|}|Vnd}�}d}�r�t|���}n|��}|D�]j\}}�|��r�nn�|�
�r��|�}nZ|dkr�d}nL|dkr�d	}n>|dkr�d
}n0�|��r��|�}n�
�rq�ntd|jj����|�r"d}n|V�|�V�	V�|���rP�|�Vq�|dk�rbd
Vq�|dk�rtdVq�|dk�r�d	Vq��|���r��|�Vq��|�
��r��|�Vq��|��f��r҈||�}	n"�|���r�||�}	n
�||�}	|	EdHq�|dk	�r |d8}d�|VdV�dk	�r6�|=dS)
Nz{}rO�{rQr	TrSFrTrRz0keys must be str, int, float, bool or None, not �})�sorted�itemsr1r2r3)
ZdctrVrWrXr-rYrg�keyrZr=)r?rIr[r\r]r^rJr_r`�_key_separator�	_skipkeys�
_sort_keysrarCrbrcr7r:rHr8r;rrr_Ms�











z*_make_iterencode.<locals>._iterencode_dictc3s�|��r�|�Vn�|dkr&dVn�|dkr6dVn�|dkrFdVn��|��r\�|�Vn��|�	�rr�|�Vn��|�
�f�r��||�EdHnj�|��r��||�EdHnN�dk	rֈ
|�}|�krΈd��|�|<�|�}�||�EdH�dk	r��|=dS)NrRTrSFrTrOr)r4rVrW)r?�_defaultrIr[r]rJr_r`rarCrbrcr7r:rHr8r;rrrJ�s2



z%_make_iterencode.<locals>._iterencoder)rHrlrIr\r[rir^rkrjr5r?rarCrbrcr7r:r8r;r]r)r?rlrIr[r\r]r^rJr_r`rirjrkrarCrbrcr7r:rHr8r;rrGs.84P,rG)$rM�reZ_jsonrZc_encode_basestring_ascii�ImportErrorrZc_encode_basestringrrF�compilerr!ZHAS_UTF8r�range�i�
setdefault�chrrrCrErr"�objectr#r?rarbrcr7r:r8r;rDrGrrrr�<module>sZ





�		�>�json/__pycache__/__init__.cpython-38.opt-2.pyc000064400000006241151153537540015070 0ustar00U

e5d	8�
@s�dZdddddddgZdZd	d
lmZmZd	dlmZdd
lZeddddd
d
d
d�Z	ddddd
d
d
d
dd�	dd�Z
ddddd
d
d
d
dd�	dd�Zed
d
d�Zdd�Z
d
d
d
d
d
d
d�dd�Zd
d
d
d
d
d
d�dd�Zd
S)z2.0.9�dump�dumps�load�loads�JSONDecoder�JSONDecodeError�JSONEncoderzBob Ippolito <bob@redivi.com>�)rr)r�NFT)�skipkeys�ensure_ascii�check_circular�	allow_nan�indent�
separators�default)	r
rrr
�clsrrr�	sort_keysc	Ks�|sD|rD|rD|rD|dkrD|dkrD|dkrD|	dkrD|
sD|sDt�|�}n2|dkrPt}|f|||||||	|
d�|���|�}|D]}
|�|
�qzdS�N)r
rrr
rrrr)�_default_encoder�
iterencoder�write)�obj�fpr
rrr
rrrrr�kw�iterable�chunk�r�%/usr/lib64/python3.8/json/__init__.pyrxsD-�����������c	Kst|sB|rB|rB|rB|dkrB|dkrB|dkrB|dkrB|	sB|
sBt�|�S|dkrNt}|f||||||||	d�|
���|�Sr)r�encoder)rr
rrr
rrrrrrrrrr�sD,��������
���)�object_hook�object_pairs_hookcCs�|j}|tjtjf�rdS|tjtjf�r.dS|tj�r<dSt|�dkr�|ds`|dr\dSdS|ds�|d	sx|d
r|dSdSn$t|�d	kr�|ds�dS|ds�dSd
S)Nzutf-32zutf-16z	utf-8-sig�r	rz	utf-16-bez	utf-32-be��z	utf-16-lez	utf-32-lezutf-8)�
startswith�codecs�BOM_UTF32_BE�BOM_UTF32_LE�BOM_UTF16_BE�BOM_UTF16_LE�BOM_UTF8�len)�bZbstartswithrrr�detect_encoding�s$
r-�rr�parse_float�	parse_int�parse_constantr c	Ks"t|��f||||||d�|��S)Nr.)r�read)rrrr/r0r1r rrrrrs
��c	Ks&t|t�r"|�d�rRtd|d��n0t|ttf�sBtd|jj����|�	t
|�d�}d|krxddl}|jdt
dd	�|d=|dkr�|dkr�|dkr�|dkr�|dkr�|dkr�|s�t�	|�S|dkr�t}|dk	r�||d
<|dk	r�||d<|dk	r�||d<|dk	�r||d
<|dk	�r||d<|f|��	|�S)Nuz-Unexpected UTF-8 BOM (decode using utf-8-sig)r	z5the JSON object must be str, bytes or bytearray, not �
surrogatepass�encodingzF'encoding' is ignored and deprecated. It will be removed in Python 3.9r")�
stacklevelrr r/r0r1)�
isinstance�strr$r�bytes�	bytearray�	TypeError�	__class__�__name__�decoder-�warnings�warn�DeprecationWarning�_default_decoderr)	�srrr/r0r1r rr>rrrr+sT$

�������


)�__version__�__all__�
__author__�decoderrr�encoderrr%rrrrAr-rrrrrr�<module>bsb��
�?�:��json/__pycache__/encoder.cpython-38.opt-2.pyc000064400000015246151153537540014755 0ustar00U

e5d�>�
@s:ddlZzddlmZWnek
r0dZYnXzddlmZWnek
rZdZYnXzddlmZWnek
r�dZYnXe�	d�Z
e�	d�Ze�	d�Zdd	d
ddd
dd�Z
ed�D]Ze
�ee�d�e��q�ed�Zdd�Zep�eZdd�Ze�peZGdd�de�Zeeeeeeeee ej!f
dd�Z"dS)�N)�encode_basestring_ascii)�encode_basestring)�make_encoderz[\x00-\x1f\\"\b\f\n\r\t]z([\\"]|[^\ -~])s[�-�]z\\z\"z\bz\fz\nz\rz\t)�\�"���
�
�	� �	\u{0:04x}�infcCsdd�}dt�||�dS)NcSst|�d�S)Nr)�
ESCAPE_DCT�group)�match�r�$/usr/lib64/python3.8/json/encoder.py�replace(sz%py_encode_basestring.<locals>.replacer)�ESCAPE�sub��srrrr�py_encode_basestring$srcCsdd�}dt�||�dS)NcSs�|�d�}z
t|WStk
rzt|�}|dkrBd�|�YS|d8}d|d?d@B}d|d@B}d�||�YSYnXdS)	Nrir
i��
i�i�z\u{0:04x}\u{1:04x})rr�KeyError�ord�format)rr�n�s1�s2rrrr4s

z+py_encode_basestring_ascii.<locals>.replacer)�ESCAPE_ASCIIrrrrr�py_encode_basestring_ascii0sr"c	@sJeZdZdZdZddddddddd�dd�Zd	d
�Zdd�Zdd
d�ZdS)�JSONEncoderz, z: FTN)�skipkeys�ensure_ascii�check_circular�	allow_nan�	sort_keys�indent�
separators�defaultc	CsZ||_||_||_||_||_||_|dk	r:|\|_|_n|dk	rHd|_|dk	rV||_dS)N�,)	r$r%r&r'r(r)�item_separator�
key_separatorr+)	�selfr$r%r&r'r(r)r*r+rrr�__init__hs+zJSONEncoder.__init__cCstd|jj�d���dS)NzObject of type z is not JSON serializable)�	TypeError�	__class__�__name__)r/�orrrr+�szJSONEncoder.defaultcCsNt|t�r |jrt|�St|�S|j|dd�}t|ttf�sDt|�}d�|�S)NT)�	_one_shot�)	�
isinstance�strr%rr�
iterencode�list�tuple�join)r/r4�chunksrrr�encode�s	
zJSONEncoder.encodecCs�|jri}nd}|jrt}nt}|jtjttfdd�}|rvtdk	rv|j	dkrvt||j
||j	|j|j|j
|j|j�	}n&t||j
||j	||j|j|j
|j|�
}||d�S)NcSsJ||krd}n$||krd}n||kr*d}n||�S|sFtdt|���|S)NZNaNZInfinityz	-Infinityz2Out of range float values are not JSON compliant: )�
ValueError�repr)r4r'Z_reprZ_infZ_neginf�textrrr�floatstr�s��z(JSONEncoder.iterencode.<locals>.floatstrr)r&r%rrr'�float�__repr__�INFINITY�c_make_encoderr)r+r.r-r(r$�_make_iterencode)r/r4r5�markers�_encoderrB�_iterencoderrrr9�sL
�
���zJSONEncoder.iterencode)F)	r3�
__module__�__qualname__r-r.r0r+r>r9rrrrr#Is�8r#cs��dk	r����sd�����������	�
��������fdd��	���������	�
���
��������fdd����������	�
��������fdd���S)N� c	3s�|sdVdS�dk	r6�|�}|�kr.�d��|�|<d}�dk	rh|d7}d�|}�|}||7}nd}�}d}|D]�}|r�d}n|}�
|��r�|�|�Vqx|dkr�|dVqx|dkr�|d	Vqx|dkr�|d
Vqx�
|��r�|�|�Vqx�
|�
��r|�|�Vqx|V�
|��f��r8�||�}n"�
|�	��rP�||�}n
�||�}|EdHqx|dk	�r�|d8}d�|VdV�dk	�r��|=dS)Nz[]�Circular reference detected�[�r	TF�null�true�false�]r)	Zlst�_current_indent_level�markeridZbuf�newline_indentZ	separator�first�valuer=)r?rI�	_floatstr�_indent�_intstr�_item_separatorrJ�_iterencode_dict�_iterencode_list�dictrC�id�intr7r:rHr8r;rrr_s\





z*_make_iterencode.<locals>._iterencode_listc
3s:|sdVdS�dk	r6�|�}|�kr.�d��|�|<dV�dk	rh|d7}d�|}�|}|Vnd}�}d}�r�t|���}n|��}|D�]j\}}�|��r�nn�|�
�r��|�}nZ|dkr�d}nL|dkr�d	}n>|dkr�d
}n0�|��r��|�}n�
�rq�ntd|jj����|�r"d}n|V�|�V�	V�|���rP�|�Vq�|dk�rbd
Vq�|dk�rtdVq�|dk�r�d	Vq��|���r��|�Vq��|�
��r��|�Vq��|��f��r҈||�}	n"�|���r�||�}	n
�||�}	|	EdHq�|dk	�r |d8}d�|VdV�dk	�r6�|=dS)
Nz{}rN�{rPr	TrRFrSrQz0keys must be str, int, float, bool or None, not �})�sorted�itemsr1r2r3)
ZdctrUrVrWr-rXrf�keyrYr=)r?rIrZr[r\r]rJr^r_�_key_separator�	_skipkeys�
_sort_keysr`rCrarbr7r:rHr8r;rrr^Ms�











z*_make_iterencode.<locals>._iterencode_dictc3s�|��r�|�Vn�|dkr&dVn�|dkr6dVn�|dkrFdVn��|��r\�|�Vn��|�	�rr�|�Vn��|�
�f�r��||�EdHnj�|��r��||�EdHnN�dk	rֈ
|�}|�krΈd��|�|<�|�}�||�EdH�dk	r��|=dS)NrQTrRFrSrNr)r4rUrV)r?�_defaultrIrZr\rJr^r_r`rCrarbr7r:rHr8r;rrrJ�s2



z%_make_iterencode.<locals>._iterencoder)rHrkrIr[rZrhr]rjrir5r?r`rCrarbr7r:r8r;r\r)r?rkrIrZr[r\r]rJr^r_rhrirjr`rCrarbr7r:rHr8r;rrGs.84P,rG)#�reZ_jsonrZc_encode_basestring_ascii�ImportErrorrZc_encode_basestringrrF�compilerr!ZHAS_UTF8r�range�i�
setdefault�chrrrCrErr"�objectr#r?r`rarbr7r:r8r;rDrGrrrr�<module>sX





�		�>�json/__pycache__/tool.cpython-38.pyc000064400000003552151153537540013350 0ustar00U

e5d��
@sjdZddlZddlZddlZdd�Zedkrfz
e�Wn.ek
rdZze�ej	�W5dZ[XYnXdS)aCommand-line tool to validate and pretty-print JSON

Usage::

    $ echo '{"json":"obj"}' | python -m json.tool
    {
        "json": "obj"
    }
    $ echo '{ 1.2:3.4}' | python -m json.tool
    Expecting property name enclosed in double quotes: line 1 column 3 (char 2)

�NcCs4d}d}tj||d�}|jddtjdd�dtjd	�|jd
dtjddd�dtjd	�|jd
dddd�|jddddd�|��}|j}|j	}|j
}|j}|��|�~zJ|r�dd�|D�}nt�
|�f}|D] }	tj|	||dd�|�d�q�Wn,tk
�r}
zt|
��W5d}
~
XYnXW5QRXW5QRXdS)Nzpython -m json.toolzZA simple command line interface for json module to validate and pretty-print JSON objects.)�prog�description�infile�?zutf-8)�encodingz-a JSON file to be validated or pretty-printed)�nargs�type�help�default�outfile�wz%write the output of infile to outfilez--sort-keys�
store_trueFz5sort the output of dictionaries alphabetically by key)�actionr
r	z--json-linesz&parse input using the jsonlines formatcss|]}t�|�VqdS)N)�json�loads)�.0�line�r�!/usr/lib64/python3.8/json/tool.py�	<genexpr>,szmain.<locals>.<genexpr>�)�	sort_keys�indent�
)�argparse�ArgumentParser�add_argumentZFileType�sys�stdin�stdout�
parse_argsrrr�
json_linesr�load�dump�write�
ValueError�
SystemExit)rr�parserZoptionsrrrr!Zobjs�obj�errr�mainsD
��
�
�r*�__main__)
�__doc__rrrr*�__name__�BrokenPipeError�exc�exit�errnorrrr�<module>s$
json/__pycache__/__init__.cpython-38.pyc000064400000030502151153537540014125 0ustar00U

e5d	8�
@s�dZdZdddddddgZd	Zd
dlmZmZd
dlmZd
dl	Z	edddddddd�Z
dddddddddd�	dd�Zdddddddddd�	dd�Zeddd�Z
dd�Zddddddd�dd�Zddddddd�dd�ZdS)aJSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.

:mod:`json` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules.  It is derived from a
version of the externally maintained simplejson library.

Encoding basic Python object hierarchies::

    >>> import json
    >>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}])
    '["foo", {"bar": ["baz", null, 1.0, 2]}]'
    >>> print(json.dumps("\"foo\bar"))
    "\"foo\bar"
    >>> print(json.dumps('\u1234'))
    "\u1234"
    >>> print(json.dumps('\\'))
    "\\"
    >>> print(json.dumps({"c": 0, "b": 0, "a": 0}, sort_keys=True))
    {"a": 0, "b": 0, "c": 0}
    >>> from io import StringIO
    >>> io = StringIO()
    >>> json.dump(['streaming API'], io)
    >>> io.getvalue()
    '["streaming API"]'

Compact encoding::

    >>> import json
    >>> mydict = {'4': 5, '6': 7}
    >>> json.dumps([1,2,3,mydict], separators=(',', ':'))
    '[1,2,3,{"4":5,"6":7}]'

Pretty printing::

    >>> import json
    >>> print(json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4))
    {
        "4": 5,
        "6": 7
    }

Decoding JSON::

    >>> import json
    >>> obj = ['foo', {'bar': ['baz', None, 1.0, 2]}]
    >>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]') == obj
    True
    >>> json.loads('"\\"foo\\bar"') == '"foo\x08ar'
    True
    >>> from io import StringIO
    >>> io = StringIO('["streaming API"]')
    >>> json.load(io)[0] == 'streaming API'
    True

Specializing JSON object decoding::

    >>> import json
    >>> def as_complex(dct):
    ...     if '__complex__' in dct:
    ...         return complex(dct['real'], dct['imag'])
    ...     return dct
    ...
    >>> json.loads('{"__complex__": true, "real": 1, "imag": 2}',
    ...     object_hook=as_complex)
    (1+2j)
    >>> from decimal import Decimal
    >>> json.loads('1.1', parse_float=Decimal) == Decimal('1.1')
    True

Specializing JSON object encoding::

    >>> import json
    >>> def encode_complex(obj):
    ...     if isinstance(obj, complex):
    ...         return [obj.real, obj.imag]
    ...     raise TypeError(f'Object of type {obj.__class__.__name__} '
    ...                     f'is not JSON serializable')
    ...
    >>> json.dumps(2 + 1j, default=encode_complex)
    '[2.0, 1.0]'
    >>> json.JSONEncoder(default=encode_complex).encode(2 + 1j)
    '[2.0, 1.0]'
    >>> ''.join(json.JSONEncoder(default=encode_complex).iterencode(2 + 1j))
    '[2.0, 1.0]'


Using json.tool from the shell to validate and pretty-print::

    $ echo '{"json":"obj"}' | python -m json.tool
    {
        "json": "obj"
    }
    $ echo '{ 1.2:3.4}' | python -m json.tool
    Expecting property name enclosed in double quotes: line 1 column 3 (char 2)
z2.0.9�dump�dumps�load�loads�JSONDecoder�JSONDecodeError�JSONEncoderzBob Ippolito <bob@redivi.com>�)rr)r�NFT)�skipkeys�ensure_ascii�check_circular�	allow_nan�indent�
separators�default)	r
rrr
�clsrrr�	sort_keysc	Ks�|sD|rD|rD|rD|dkrD|dkrD|dkrD|	dkrD|
sD|sDt�|�}n2|dkrPt}|f|||||||	|
d�|���|�}|D]}
|�|
�qzdS)a�Serialize ``obj`` as a JSON formatted stream to ``fp`` (a
    ``.write()``-supporting file-like object).

    If ``skipkeys`` is true then ``dict`` keys that are not basic types
    (``str``, ``int``, ``float``, ``bool``, ``None``) will be skipped
    instead of raising a ``TypeError``.

    If ``ensure_ascii`` is false, then the strings written to ``fp`` can
    contain non-ASCII characters if they appear in strings contained in
    ``obj``. Otherwise, all such characters are escaped in JSON strings.

    If ``check_circular`` is false, then the circular reference check
    for container types will be skipped and a circular reference will
    result in an ``OverflowError`` (or worse).

    If ``allow_nan`` is false, then it will be a ``ValueError`` to
    serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``)
    in strict compliance of the JSON specification, instead of using the
    JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``).

    If ``indent`` is a non-negative integer, then JSON array elements and
    object members will be pretty-printed with that indent level. An indent
    level of 0 will only insert newlines. ``None`` is the most compact
    representation.

    If specified, ``separators`` should be an ``(item_separator, key_separator)``
    tuple.  The default is ``(', ', ': ')`` if *indent* is ``None`` and
    ``(',', ': ')`` otherwise.  To get the most compact JSON representation,
    you should specify ``(',', ':')`` to eliminate whitespace.

    ``default(obj)`` is a function that should return a serializable version
    of obj or raise TypeError. The default simply raises TypeError.

    If *sort_keys* is true (default: ``False``), then the output of
    dictionaries will be sorted by key.

    To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the
    ``.default()`` method to serialize additional types), specify it with
    the ``cls`` kwarg; otherwise ``JSONEncoder`` is used.

    N�r
rrr
rrrr)�_default_encoder�
iterencoder�write)�obj�fpr
rrr
rrrrr�kw�iterable�chunk�r�%/usr/lib64/python3.8/json/__init__.pyrxsD-�����������c	Kst|sB|rB|rB|rB|dkrB|dkrB|dkrB|dkrB|	sB|
sBt�|�S|dkrNt}|f||||||||	d�|
���|�S)auSerialize ``obj`` to a JSON formatted ``str``.

    If ``skipkeys`` is true then ``dict`` keys that are not basic types
    (``str``, ``int``, ``float``, ``bool``, ``None``) will be skipped
    instead of raising a ``TypeError``.

    If ``ensure_ascii`` is false, then the return value can contain non-ASCII
    characters if they appear in strings contained in ``obj``. Otherwise, all
    such characters are escaped in JSON strings.

    If ``check_circular`` is false, then the circular reference check
    for container types will be skipped and a circular reference will
    result in an ``OverflowError`` (or worse).

    If ``allow_nan`` is false, then it will be a ``ValueError`` to
    serialize out of range ``float`` values (``nan``, ``inf``, ``-inf``) in
    strict compliance of the JSON specification, instead of using the
    JavaScript equivalents (``NaN``, ``Infinity``, ``-Infinity``).

    If ``indent`` is a non-negative integer, then JSON array elements and
    object members will be pretty-printed with that indent level. An indent
    level of 0 will only insert newlines. ``None`` is the most compact
    representation.

    If specified, ``separators`` should be an ``(item_separator, key_separator)``
    tuple.  The default is ``(', ', ': ')`` if *indent* is ``None`` and
    ``(',', ': ')`` otherwise.  To get the most compact JSON representation,
    you should specify ``(',', ':')`` to eliminate whitespace.

    ``default(obj)`` is a function that should return a serializable version
    of obj or raise TypeError. The default simply raises TypeError.

    If *sort_keys* is true (default: ``False``), then the output of
    dictionaries will be sorted by key.

    To use a custom ``JSONEncoder`` subclass (e.g. one that overrides the
    ``.default()`` method to serialize additional types), specify it with
    the ``cls`` kwarg; otherwise ``JSONEncoder`` is used.

    Nr)r�encoder)rr
rrr
rrrrrrrrrr�sD,��������
���)�object_hook�object_pairs_hookcCs�|j}|tjtjf�rdS|tjtjf�r.dS|tj�r<dSt|�dkr�|ds`|dr\dSdS|ds�|d	sx|d
r|dSdSn$t|�d	kr�|ds�dS|ds�dSd
S)Nzutf-32zutf-16z	utf-8-sig�r	rz	utf-16-bez	utf-32-be��z	utf-16-lez	utf-32-lezutf-8)�
startswith�codecs�BOM_UTF32_BE�BOM_UTF32_LE�BOM_UTF16_BE�BOM_UTF16_LE�BOM_UTF8�len)�bZbstartswithrrr�detect_encoding�s$
r-�rr�parse_float�	parse_int�parse_constantr c	Ks"t|��f||||||d�|��S)a�Deserialize ``fp`` (a ``.read()``-supporting file-like object containing
    a JSON document) to a Python object.

    ``object_hook`` is an optional function that will be called with the
    result of any object literal decode (a ``dict``). The return value of
    ``object_hook`` will be used instead of the ``dict``. This feature
    can be used to implement custom decoders (e.g. JSON-RPC class hinting).

    ``object_pairs_hook`` is an optional function that will be called with the
    result of any object literal decoded with an ordered list of pairs.  The
    return value of ``object_pairs_hook`` will be used instead of the ``dict``.
    This feature can be used to implement custom decoders.  If ``object_hook``
    is also defined, the ``object_pairs_hook`` takes priority.

    To use a custom ``JSONDecoder`` subclass, specify it with the ``cls``
    kwarg; otherwise ``JSONDecoder`` is used.
    r.)r�read)rrrr/r0r1r rrrrrs
��c	Ks&t|t�r"|�d�rRtd|d��n0t|ttf�sBtd|jj����|�	t
|�d�}d|krxddl}|jdt
d	d
�|d=|dkr�|dkr�|dkr�|dkr�|dkr�|dkr�|s�t�	|�S|dkr�t}|dk	r�||d<|dk	r�||d<|dk	r�||d
<|dk	�r||d<|dk	�r||d<|f|��	|�S)a�Deserialize ``s`` (a ``str``, ``bytes`` or ``bytearray`` instance
    containing a JSON document) to a Python object.

    ``object_hook`` is an optional function that will be called with the
    result of any object literal decode (a ``dict``). The return value of
    ``object_hook`` will be used instead of the ``dict``. This feature
    can be used to implement custom decoders (e.g. JSON-RPC class hinting).

    ``object_pairs_hook`` is an optional function that will be called with the
    result of any object literal decoded with an ordered list of pairs.  The
    return value of ``object_pairs_hook`` will be used instead of the ``dict``.
    This feature can be used to implement custom decoders.  If ``object_hook``
    is also defined, the ``object_pairs_hook`` takes priority.

    ``parse_float``, if specified, will be called with the string
    of every JSON float to be decoded. By default this is equivalent to
    float(num_str). This can be used to use another datatype or parser
    for JSON floats (e.g. decimal.Decimal).

    ``parse_int``, if specified, will be called with the string
    of every JSON int to be decoded. By default this is equivalent to
    int(num_str). This can be used to use another datatype or parser
    for JSON integers (e.g. float).

    ``parse_constant``, if specified, will be called with one of the
    following strings: -Infinity, Infinity, NaN.
    This can be used to raise an exception if invalid JSON numbers
    are encountered.

    To use a custom ``JSONDecoder`` subclass, specify it with the ``cls``
    kwarg; otherwise ``JSONDecoder`` is used.

    The ``encoding`` argument is ignored and deprecated since Python 3.1.
    uz-Unexpected UTF-8 BOM (decode using utf-8-sig)r	z5the JSON object must be str, bytes or bytearray, not �
surrogatepass�encodingNzF'encoding' is ignored and deprecated. It will be removed in Python 3.9r")�
stacklevelrr r/r0r1)�
isinstance�strr$r�bytes�	bytearray�	TypeError�	__class__�__name__�decoder-�warnings�warn�DeprecationWarning�_default_decoderr)	�srrr/r0r1r rr>rrrr+sT$

�������


)�__doc__�__version__�__all__�
__author__�decoderrr�encoderrr%rrrrAr-rrrrrr�<module>sda��
�?�:��json/decoder.py000064400000030270151153537540007507 0ustar00"""Implementation of JSONDecoder
"""
import re

from json import scanner
try:
    from _json import scanstring as c_scanstring
except ImportError:
    c_scanstring = None

__all__ = ['JSONDecoder', 'JSONDecodeError']

FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL

NaN = float('nan')
PosInf = float('inf')
NegInf = float('-inf')


class JSONDecodeError(ValueError):
    """Subclass of ValueError with the following additional properties:

    msg: The unformatted error message
    doc: The JSON document being parsed
    pos: The start index of doc where parsing failed
    lineno: The line corresponding to pos
    colno: The column corresponding to pos

    """
    # Note that this exception is used from _json
    def __init__(self, msg, doc, pos):
        lineno = doc.count('\n', 0, pos) + 1
        colno = pos - doc.rfind('\n', 0, pos)
        errmsg = '%s: line %d column %d (char %d)' % (msg, lineno, colno, pos)
        ValueError.__init__(self, errmsg)
        self.msg = msg
        self.doc = doc
        self.pos = pos
        self.lineno = lineno
        self.colno = colno

    def __reduce__(self):
        return self.__class__, (self.msg, self.doc, self.pos)


_CONSTANTS = {
    '-Infinity': NegInf,
    'Infinity': PosInf,
    'NaN': NaN,
}


STRINGCHUNK = re.compile(r'(.*?)(["\\\x00-\x1f])', FLAGS)
BACKSLASH = {
    '"': '"', '\\': '\\', '/': '/',
    'b': '\b', 'f': '\f', 'n': '\n', 'r': '\r', 't': '\t',
}

def _decode_uXXXX(s, pos):
    esc = s[pos + 1:pos + 5]
    if len(esc) == 4 and esc[1] not in 'xX':
        try:
            return int(esc, 16)
        except ValueError:
            pass
    msg = "Invalid \\uXXXX escape"
    raise JSONDecodeError(msg, s, pos)

def py_scanstring(s, end, strict=True,
        _b=BACKSLASH, _m=STRINGCHUNK.match):
    """Scan the string s for a JSON string. End is the index of the
    character in s after the quote that started the JSON string.
    Unescapes all valid JSON string escape sequences and raises ValueError
    on attempt to decode an invalid string. If strict is False then literal
    control characters are allowed in the string.

    Returns a tuple of the decoded string and the index of the character in s
    after the end quote."""
    chunks = []
    _append = chunks.append
    begin = end - 1
    while 1:
        chunk = _m(s, end)
        if chunk is None:
            raise JSONDecodeError("Unterminated string starting at", s, begin)
        end = chunk.end()
        content, terminator = chunk.groups()
        # Content is contains zero or more unescaped string characters
        if content:
            _append(content)
        # Terminator is the end of string, a literal control character,
        # or a backslash denoting that an escape sequence follows
        if terminator == '"':
            break
        elif terminator != '\\':
            if strict:
                #msg = "Invalid control character %r at" % (terminator,)
                msg = "Invalid control character {0!r} at".format(terminator)
                raise JSONDecodeError(msg, s, end)
            else:
                _append(terminator)
                continue
        try:
            esc = s[end]
        except IndexError:
            raise JSONDecodeError("Unterminated string starting at",
                                  s, begin) from None
        # If not a unicode escape sequence, must be in the lookup table
        if esc != 'u':
            try:
                char = _b[esc]
            except KeyError:
                msg = "Invalid \\escape: {0!r}".format(esc)
                raise JSONDecodeError(msg, s, end)
            end += 1
        else:
            uni = _decode_uXXXX(s, end)
            end += 5
            if 0xd800 <= uni <= 0xdbff and s[end:end + 2] == '\\u':
                uni2 = _decode_uXXXX(s, end + 1)
                if 0xdc00 <= uni2 <= 0xdfff:
                    uni = 0x10000 + (((uni - 0xd800) << 10) | (uni2 - 0xdc00))
                    end += 6
            char = chr(uni)
        _append(char)
    return ''.join(chunks), end


# Use speedup if available
scanstring = c_scanstring or py_scanstring

WHITESPACE = re.compile(r'[ \t\n\r]*', FLAGS)
WHITESPACE_STR = ' \t\n\r'


def JSONObject(s_and_end, strict, scan_once, object_hook, object_pairs_hook,
               memo=None, _w=WHITESPACE.match, _ws=WHITESPACE_STR):
    s, end = s_and_end
    pairs = []
    pairs_append = pairs.append
    # Backwards compatibility
    if memo is None:
        memo = {}
    memo_get = memo.setdefault
    # Use a slice to prevent IndexError from being raised, the following
    # check will raise a more specific ValueError if the string is empty
    nextchar = s[end:end + 1]
    # Normally we expect nextchar == '"'
    if nextchar != '"':
        if nextchar in _ws:
            end = _w(s, end).end()
            nextchar = s[end:end + 1]
        # Trivial empty object
        if nextchar == '}':
            if object_pairs_hook is not None:
                result = object_pairs_hook(pairs)
                return result, end + 1
            pairs = {}
            if object_hook is not None:
                pairs = object_hook(pairs)
            return pairs, end + 1
        elif nextchar != '"':
            raise JSONDecodeError(
                "Expecting property name enclosed in double quotes", s, end)
    end += 1
    while True:
        key, end = scanstring(s, end, strict)
        key = memo_get(key, key)
        # To skip some function call overhead we optimize the fast paths where
        # the JSON key separator is ": " or just ":".
        if s[end:end + 1] != ':':
            end = _w(s, end).end()
            if s[end:end + 1] != ':':
                raise JSONDecodeError("Expecting ':' delimiter", s, end)
        end += 1

        try:
            if s[end] in _ws:
                end += 1
                if s[end] in _ws:
                    end = _w(s, end + 1).end()
        except IndexError:
            pass

        try:
            value, end = scan_once(s, end)
        except StopIteration as err:
            raise JSONDecodeError("Expecting value", s, err.value) from None
        pairs_append((key, value))
        try:
            nextchar = s[end]
            if nextchar in _ws:
                end = _w(s, end + 1).end()
                nextchar = s[end]
        except IndexError:
            nextchar = ''
        end += 1

        if nextchar == '}':
            break
        elif nextchar != ',':
            raise JSONDecodeError("Expecting ',' delimiter", s, end - 1)
        end = _w(s, end).end()
        nextchar = s[end:end + 1]
        end += 1
        if nextchar != '"':
            raise JSONDecodeError(
                "Expecting property name enclosed in double quotes", s, end - 1)
    if object_pairs_hook is not None:
        result = object_pairs_hook(pairs)
        return result, end
    pairs = dict(pairs)
    if object_hook is not None:
        pairs = object_hook(pairs)
    return pairs, end

def JSONArray(s_and_end, scan_once, _w=WHITESPACE.match, _ws=WHITESPACE_STR):
    s, end = s_and_end
    values = []
    nextchar = s[end:end + 1]
    if nextchar in _ws:
        end = _w(s, end + 1).end()
        nextchar = s[end:end + 1]
    # Look-ahead for trivial empty array
    if nextchar == ']':
        return values, end + 1
    _append = values.append
    while True:
        try:
            value, end = scan_once(s, end)
        except StopIteration as err:
            raise JSONDecodeError("Expecting value", s, err.value) from None
        _append(value)
        nextchar = s[end:end + 1]
        if nextchar in _ws:
            end = _w(s, end + 1).end()
            nextchar = s[end:end + 1]
        end += 1
        if nextchar == ']':
            break
        elif nextchar != ',':
            raise JSONDecodeError("Expecting ',' delimiter", s, end - 1)
        try:
            if s[end] in _ws:
                end += 1
                if s[end] in _ws:
                    end = _w(s, end + 1).end()
        except IndexError:
            pass

    return values, end


class JSONDecoder(object):
    """Simple JSON <http://json.org> decoder

    Performs the following translations in decoding by default:

    +---------------+-------------------+
    | JSON          | Python            |
    +===============+===================+
    | object        | dict              |
    +---------------+-------------------+
    | array         | list              |
    +---------------+-------------------+
    | string        | str               |
    +---------------+-------------------+
    | number (int)  | int               |
    +---------------+-------------------+
    | number (real) | float             |
    +---------------+-------------------+
    | true          | True              |
    +---------------+-------------------+
    | false         | False             |
    +---------------+-------------------+
    | null          | None              |
    +---------------+-------------------+

    It also understands ``NaN``, ``Infinity``, and ``-Infinity`` as
    their corresponding ``float`` values, which is outside the JSON spec.

    """

    def __init__(self, *, object_hook=None, parse_float=None,
            parse_int=None, parse_constant=None, strict=True,
            object_pairs_hook=None):
        """``object_hook``, if specified, will be called with the result
        of every JSON object decoded and its return value will be used in
        place of the given ``dict``.  This can be used to provide custom
        deserializations (e.g. to support JSON-RPC class hinting).

        ``object_pairs_hook``, if specified will be called with the result of
        every JSON object decoded with an ordered list of pairs.  The return
        value of ``object_pairs_hook`` will be used instead of the ``dict``.
        This feature can be used to implement custom decoders.
        If ``object_hook`` is also defined, the ``object_pairs_hook`` takes
        priority.

        ``parse_float``, if specified, will be called with the string
        of every JSON float to be decoded. By default this is equivalent to
        float(num_str). This can be used to use another datatype or parser
        for JSON floats (e.g. decimal.Decimal).

        ``parse_int``, if specified, will be called with the string
        of every JSON int to be decoded. By default this is equivalent to
        int(num_str). This can be used to use another datatype or parser
        for JSON integers (e.g. float).

        ``parse_constant``, if specified, will be called with one of the
        following strings: -Infinity, Infinity, NaN.
        This can be used to raise an exception if invalid JSON numbers
        are encountered.

        If ``strict`` is false (true is the default), then control
        characters will be allowed inside strings.  Control characters in
        this context are those with character codes in the 0-31 range,
        including ``'\\t'`` (tab), ``'\\n'``, ``'\\r'`` and ``'\\0'``.
        """
        self.object_hook = object_hook
        self.parse_float = parse_float or float
        self.parse_int = parse_int or int
        self.parse_constant = parse_constant or _CONSTANTS.__getitem__
        self.strict = strict
        self.object_pairs_hook = object_pairs_hook
        self.parse_object = JSONObject
        self.parse_array = JSONArray
        self.parse_string = scanstring
        self.memo = {}
        self.scan_once = scanner.make_scanner(self)


    def decode(self, s, _w=WHITESPACE.match):
        """Return the Python representation of ``s`` (a ``str`` instance
        containing a JSON document).

        """
        obj, end = self.raw_decode(s, idx=_w(s, 0).end())
        end = _w(s, end).end()
        if end != len(s):
            raise JSONDecodeError("Extra data", s, end)
        return obj

    def raw_decode(self, s, idx=0):
        """Decode a JSON document from ``s`` (a ``str`` beginning with
        a JSON document) and return a 2-tuple of the Python
        representation and the index in ``s`` where the document ended.

        This can be used to decode a JSON document from a string that may
        have extraneous data at the end.

        """
        try:
            obj, end = self.scan_once(s, idx)
        except StopIteration as err:
            raise JSONDecodeError("Expecting value", s, err.value) from None
        return obj, end
json/encoder.py000064400000037310151153537540007523 0ustar00"""Implementation of JSONEncoder
"""
import re

try:
    from _json import encode_basestring_ascii as c_encode_basestring_ascii
except ImportError:
    c_encode_basestring_ascii = None
try:
    from _json import encode_basestring as c_encode_basestring
except ImportError:
    c_encode_basestring = None
try:
    from _json import make_encoder as c_make_encoder
except ImportError:
    c_make_encoder = None

ESCAPE = re.compile(r'[\x00-\x1f\\"\b\f\n\r\t]')
ESCAPE_ASCII = re.compile(r'([\\"]|[^\ -~])')
HAS_UTF8 = re.compile(b'[\x80-\xff]')
ESCAPE_DCT = {
    '\\': '\\\\',
    '"': '\\"',
    '\b': '\\b',
    '\f': '\\f',
    '\n': '\\n',
    '\r': '\\r',
    '\t': '\\t',
}
for i in range(0x20):
    ESCAPE_DCT.setdefault(chr(i), '\\u{0:04x}'.format(i))
    #ESCAPE_DCT.setdefault(chr(i), '\\u%04x' % (i,))

INFINITY = float('inf')

def py_encode_basestring(s):
    """Return a JSON representation of a Python string

    """
    def replace(match):
        return ESCAPE_DCT[match.group(0)]
    return '"' + ESCAPE.sub(replace, s) + '"'


encode_basestring = (c_encode_basestring or py_encode_basestring)


def py_encode_basestring_ascii(s):
    """Return an ASCII-only JSON representation of a Python string

    """
    def replace(match):
        s = match.group(0)
        try:
            return ESCAPE_DCT[s]
        except KeyError:
            n = ord(s)
            if n < 0x10000:
                return '\\u{0:04x}'.format(n)
                #return '\\u%04x' % (n,)
            else:
                # surrogate pair
                n -= 0x10000
                s1 = 0xd800 | ((n >> 10) & 0x3ff)
                s2 = 0xdc00 | (n & 0x3ff)
                return '\\u{0:04x}\\u{1:04x}'.format(s1, s2)
    return '"' + ESCAPE_ASCII.sub(replace, s) + '"'


encode_basestring_ascii = (
    c_encode_basestring_ascii or py_encode_basestring_ascii)

class JSONEncoder(object):
    """Extensible JSON <http://json.org> encoder for Python data structures.

    Supports the following objects and types by default:

    +-------------------+---------------+
    | Python            | JSON          |
    +===================+===============+
    | dict              | object        |
    +-------------------+---------------+
    | list, tuple       | array         |
    +-------------------+---------------+
    | str               | string        |
    +-------------------+---------------+
    | int, float        | number        |
    +-------------------+---------------+
    | True              | true          |
    +-------------------+---------------+
    | False             | false         |
    +-------------------+---------------+
    | None              | null          |
    +-------------------+---------------+

    To extend this to recognize other objects, subclass and implement a
    ``.default()`` method with another method that returns a serializable
    object for ``o`` if possible, otherwise it should call the superclass
    implementation (to raise ``TypeError``).

    """
    item_separator = ', '
    key_separator = ': '
    def __init__(self, *, skipkeys=False, ensure_ascii=True,
            check_circular=True, allow_nan=True, sort_keys=False,
            indent=None, separators=None, default=None):
        """Constructor for JSONEncoder, with sensible defaults.

        If skipkeys is false, then it is a TypeError to attempt
        encoding of keys that are not str, int, float or None.  If
        skipkeys is True, such items are simply skipped.

        If ensure_ascii is true, the output is guaranteed to be str
        objects with all incoming non-ASCII characters escaped.  If
        ensure_ascii is false, the output can contain non-ASCII characters.

        If check_circular is true, then lists, dicts, and custom encoded
        objects will be checked for circular references during encoding to
        prevent an infinite recursion (which would cause an OverflowError).
        Otherwise, no such check takes place.

        If allow_nan is true, then NaN, Infinity, and -Infinity will be
        encoded as such.  This behavior is not JSON specification compliant,
        but is consistent with most JavaScript based encoders and decoders.
        Otherwise, it will be a ValueError to encode such floats.

        If sort_keys is true, then the output of dictionaries will be
        sorted by key; this is useful for regression tests to ensure
        that JSON serializations can be compared on a day-to-day basis.

        If indent is a non-negative integer, then JSON array
        elements and object members will be pretty-printed with that
        indent level.  An indent level of 0 will only insert newlines.
        None is the most compact representation.

        If specified, separators should be an (item_separator, key_separator)
        tuple.  The default is (', ', ': ') if *indent* is ``None`` and
        (',', ': ') otherwise.  To get the most compact JSON representation,
        you should specify (',', ':') to eliminate whitespace.

        If specified, default is a function that gets called for objects
        that can't otherwise be serialized.  It should return a JSON encodable
        version of the object or raise a ``TypeError``.

        """

        self.skipkeys = skipkeys
        self.ensure_ascii = ensure_ascii
        self.check_circular = check_circular
        self.allow_nan = allow_nan
        self.sort_keys = sort_keys
        self.indent = indent
        if separators is not None:
            self.item_separator, self.key_separator = separators
        elif indent is not None:
            self.item_separator = ','
        if default is not None:
            self.default = default

    def default(self, o):
        """Implement this method in a subclass such that it returns
        a serializable object for ``o``, or calls the base implementation
        (to raise a ``TypeError``).

        For example, to support arbitrary iterators, you could
        implement default like this::

            def default(self, o):
                try:
                    iterable = iter(o)
                except TypeError:
                    pass
                else:
                    return list(iterable)
                # Let the base class default method raise the TypeError
                return JSONEncoder.default(self, o)

        """
        raise TypeError(f'Object of type {o.__class__.__name__} '
                        f'is not JSON serializable')

    def encode(self, o):
        """Return a JSON string representation of a Python data structure.

        >>> from json.encoder import JSONEncoder
        >>> JSONEncoder().encode({"foo": ["bar", "baz"]})
        '{"foo": ["bar", "baz"]}'

        """
        # This is for extremely simple cases and benchmarks.
        if isinstance(o, str):
            if self.ensure_ascii:
                return encode_basestring_ascii(o)
            else:
                return encode_basestring(o)
        # This doesn't pass the iterator directly to ''.join() because the
        # exceptions aren't as detailed.  The list call should be roughly
        # equivalent to the PySequence_Fast that ''.join() would do.
        chunks = self.iterencode(o, _one_shot=True)
        if not isinstance(chunks, (list, tuple)):
            chunks = list(chunks)
        return ''.join(chunks)

    def iterencode(self, o, _one_shot=False):
        """Encode the given object and yield each string
        representation as available.

        For example::

            for chunk in JSONEncoder().iterencode(bigobject):
                mysocket.write(chunk)

        """
        if self.check_circular:
            markers = {}
        else:
            markers = None
        if self.ensure_ascii:
            _encoder = encode_basestring_ascii
        else:
            _encoder = encode_basestring

        def floatstr(o, allow_nan=self.allow_nan,
                _repr=float.__repr__, _inf=INFINITY, _neginf=-INFINITY):
            # Check for specials.  Note that this type of test is processor
            # and/or platform-specific, so do tests which don't depend on the
            # internals.

            if o != o:
                text = 'NaN'
            elif o == _inf:
                text = 'Infinity'
            elif o == _neginf:
                text = '-Infinity'
            else:
                return _repr(o)

            if not allow_nan:
                raise ValueError(
                    "Out of range float values are not JSON compliant: " +
                    repr(o))

            return text


        if (_one_shot and c_make_encoder is not None
                and self.indent is None):
            _iterencode = c_make_encoder(
                markers, self.default, _encoder, self.indent,
                self.key_separator, self.item_separator, self.sort_keys,
                self.skipkeys, self.allow_nan)
        else:
            _iterencode = _make_iterencode(
                markers, self.default, _encoder, self.indent, floatstr,
                self.key_separator, self.item_separator, self.sort_keys,
                self.skipkeys, _one_shot)
        return _iterencode(o, 0)

def _make_iterencode(markers, _default, _encoder, _indent, _floatstr,
        _key_separator, _item_separator, _sort_keys, _skipkeys, _one_shot,
        ## HACK: hand-optimized bytecode; turn globals into locals
        ValueError=ValueError,
        dict=dict,
        float=float,
        id=id,
        int=int,
        isinstance=isinstance,
        list=list,
        str=str,
        tuple=tuple,
        _intstr=int.__repr__,
    ):

    if _indent is not None and not isinstance(_indent, str):
        _indent = ' ' * _indent

    def _iterencode_list(lst, _current_indent_level):
        if not lst:
            yield '[]'
            return
        if markers is not None:
            markerid = id(lst)
            if markerid in markers:
                raise ValueError("Circular reference detected")
            markers[markerid] = lst
        buf = '['
        if _indent is not None:
            _current_indent_level += 1
            newline_indent = '\n' + _indent * _current_indent_level
            separator = _item_separator + newline_indent
            buf += newline_indent
        else:
            newline_indent = None
            separator = _item_separator
        first = True
        for value in lst:
            if first:
                first = False
            else:
                buf = separator
            if isinstance(value, str):
                yield buf + _encoder(value)
            elif value is None:
                yield buf + 'null'
            elif value is True:
                yield buf + 'true'
            elif value is False:
                yield buf + 'false'
            elif isinstance(value, int):
                # Subclasses of int/float may override __repr__, but we still
                # want to encode them as integers/floats in JSON. One example
                # within the standard library is IntEnum.
                yield buf + _intstr(value)
            elif isinstance(value, float):
                # see comment above for int
                yield buf + _floatstr(value)
            else:
                yield buf
                if isinstance(value, (list, tuple)):
                    chunks = _iterencode_list(value, _current_indent_level)
                elif isinstance(value, dict):
                    chunks = _iterencode_dict(value, _current_indent_level)
                else:
                    chunks = _iterencode(value, _current_indent_level)
                yield from chunks
        if newline_indent is not None:
            _current_indent_level -= 1
            yield '\n' + _indent * _current_indent_level
        yield ']'
        if markers is not None:
            del markers[markerid]

    def _iterencode_dict(dct, _current_indent_level):
        if not dct:
            yield '{}'
            return
        if markers is not None:
            markerid = id(dct)
            if markerid in markers:
                raise ValueError("Circular reference detected")
            markers[markerid] = dct
        yield '{'
        if _indent is not None:
            _current_indent_level += 1
            newline_indent = '\n' + _indent * _current_indent_level
            item_separator = _item_separator + newline_indent
            yield newline_indent
        else:
            newline_indent = None
            item_separator = _item_separator
        first = True
        if _sort_keys:
            items = sorted(dct.items())
        else:
            items = dct.items()
        for key, value in items:
            if isinstance(key, str):
                pass
            # JavaScript is weakly typed for these, so it makes sense to
            # also allow them.  Many encoders seem to do something like this.
            elif isinstance(key, float):
                # see comment for int/float in _make_iterencode
                key = _floatstr(key)
            elif key is True:
                key = 'true'
            elif key is False:
                key = 'false'
            elif key is None:
                key = 'null'
            elif isinstance(key, int):
                # see comment for int/float in _make_iterencode
                key = _intstr(key)
            elif _skipkeys:
                continue
            else:
                raise TypeError(f'keys must be str, int, float, bool or None, '
                                f'not {key.__class__.__name__}')
            if first:
                first = False
            else:
                yield item_separator
            yield _encoder(key)
            yield _key_separator
            if isinstance(value, str):
                yield _encoder(value)
            elif value is None:
                yield 'null'
            elif value is True:
                yield 'true'
            elif value is False:
                yield 'false'
            elif isinstance(value, int):
                # see comment for int/float in _make_iterencode
                yield _intstr(value)
            elif isinstance(value, float):
                # see comment for int/float in _make_iterencode
                yield _floatstr(value)
            else:
                if isinstance(value, (list, tuple)):
                    chunks = _iterencode_list(value, _current_indent_level)
                elif isinstance(value, dict):
                    chunks = _iterencode_dict(value, _current_indent_level)
                else:
                    chunks = _iterencode(value, _current_indent_level)
                yield from chunks
        if newline_indent is not None:
            _current_indent_level -= 1
            yield '\n' + _indent * _current_indent_level
        yield '}'
        if markers is not None:
            del markers[markerid]

    def _iterencode(o, _current_indent_level):
        if isinstance(o, str):
            yield _encoder(o)
        elif o is None:
            yield 'null'
        elif o is True:
            yield 'true'
        elif o is False:
            yield 'false'
        elif isinstance(o, int):
            # see comment for int/float in _make_iterencode
            yield _intstr(o)
        elif isinstance(o, float):
            # see comment for int/float in _make_iterencode
            yield _floatstr(o)
        elif isinstance(o, (list, tuple)):
            yield from _iterencode_list(o, _current_indent_level)
        elif isinstance(o, dict):
            yield from _iterencode_dict(o, _current_indent_level)
        else:
            if markers is not None:
                markerid = id(o)
                if markerid in markers:
                    raise ValueError("Circular reference detected")
                markers[markerid] = o
            o = _default(o)
            yield from _iterencode(o, _current_indent_level)
            if markers is not None:
                del markers[markerid]
    return _iterencode
xml/sax/expatreader.py000064400000036530151153537540011035 0ustar00"""
SAX driver for the pyexpat C module.  This driver works with
pyexpat.__version__ == '2.22'.
"""

version = "0.20"

from xml.sax._exceptions import *
from xml.sax.handler import feature_validation, feature_namespaces
from xml.sax.handler import feature_namespace_prefixes
from xml.sax.handler import feature_external_ges, feature_external_pes
from xml.sax.handler import feature_string_interning
from xml.sax.handler import property_xml_string, property_interning_dict

# xml.parsers.expat does not raise ImportError in Jython
import sys
if sys.platform[:4] == "java":
    raise SAXReaderNotAvailable("expat not available in Java", None)
del sys

try:
    from xml.parsers import expat
except ImportError:
    raise SAXReaderNotAvailable("expat not supported", None)
else:
    if not hasattr(expat, "ParserCreate"):
        raise SAXReaderNotAvailable("expat not supported", None)
from xml.sax import xmlreader, saxutils, handler

AttributesImpl = xmlreader.AttributesImpl
AttributesNSImpl = xmlreader.AttributesNSImpl

# If we're using a sufficiently recent version of Python, we can use
# weak references to avoid cycles between the parser and content
# handler, otherwise we'll just have to pretend.
try:
    import _weakref
except ImportError:
    def _mkproxy(o):
        return o
else:
    import weakref
    _mkproxy = weakref.proxy
    del weakref, _weakref

class _ClosedParser:
    pass

# --- ExpatLocator

class ExpatLocator(xmlreader.Locator):
    """Locator for use with the ExpatParser class.

    This uses a weak reference to the parser object to avoid creating
    a circular reference between the parser and the content handler.
    """
    def __init__(self, parser):
        self._ref = _mkproxy(parser)

    def getColumnNumber(self):
        parser = self._ref
        if parser._parser is None:
            return None
        return parser._parser.ErrorColumnNumber

    def getLineNumber(self):
        parser = self._ref
        if parser._parser is None:
            return 1
        return parser._parser.ErrorLineNumber

    def getPublicId(self):
        parser = self._ref
        if parser is None:
            return None
        return parser._source.getPublicId()

    def getSystemId(self):
        parser = self._ref
        if parser is None:
            return None
        return parser._source.getSystemId()


# --- ExpatParser

class ExpatParser(xmlreader.IncrementalParser, xmlreader.Locator):
    """SAX driver for the pyexpat C module."""

    def __init__(self, namespaceHandling=0, bufsize=2**16-20):
        xmlreader.IncrementalParser.__init__(self, bufsize)
        self._source = xmlreader.InputSource()
        self._parser = None
        self._namespaces = namespaceHandling
        self._lex_handler_prop = None
        self._parsing = 0
        self._entity_stack = []
        self._external_ges = 0
        self._interning = None

    # XMLReader methods

    def parse(self, source):
        "Parse an XML document from a URL or an InputSource."
        source = saxutils.prepare_input_source(source)

        self._source = source
        try:
            self.reset()
            self._cont_handler.setDocumentLocator(ExpatLocator(self))
            xmlreader.IncrementalParser.parse(self, source)
        except:
            # bpo-30264: Close the source on error to not leak resources:
            # xml.sax.parse() doesn't give access to the underlying parser
            # to the caller
            self._close_source()
            raise

    def prepareParser(self, source):
        if source.getSystemId() is not None:
            self._parser.SetBase(source.getSystemId())

    # Redefined setContentHandler to allow changing handlers during parsing

    def setContentHandler(self, handler):
        xmlreader.IncrementalParser.setContentHandler(self, handler)
        if self._parsing:
            self._reset_cont_handler()

    def getFeature(self, name):
        if name == feature_namespaces:
            return self._namespaces
        elif name == feature_string_interning:
            return self._interning is not None
        elif name in (feature_validation, feature_external_pes,
                      feature_namespace_prefixes):
            return 0
        elif name == feature_external_ges:
            return self._external_ges
        raise SAXNotRecognizedException("Feature '%s' not recognized" % name)

    def setFeature(self, name, state):
        if self._parsing:
            raise SAXNotSupportedException("Cannot set features while parsing")

        if name == feature_namespaces:
            self._namespaces = state
        elif name == feature_external_ges:
            self._external_ges = state
        elif name == feature_string_interning:
            if state:
                if self._interning is None:
                    self._interning = {}
            else:
                self._interning = None
        elif name == feature_validation:
            if state:
                raise SAXNotSupportedException(
                    "expat does not support validation")
        elif name == feature_external_pes:
            if state:
                raise SAXNotSupportedException(
                    "expat does not read external parameter entities")
        elif name == feature_namespace_prefixes:
            if state:
                raise SAXNotSupportedException(
                    "expat does not report namespace prefixes")
        else:
            raise SAXNotRecognizedException(
                "Feature '%s' not recognized" % name)

    def getProperty(self, name):
        if name == handler.property_lexical_handler:
            return self._lex_handler_prop
        elif name == property_interning_dict:
            return self._interning
        elif name == property_xml_string:
            if self._parser:
                if hasattr(self._parser, "GetInputContext"):
                    return self._parser.GetInputContext()
                else:
                    raise SAXNotRecognizedException(
                        "This version of expat does not support getting"
                        " the XML string")
            else:
                raise SAXNotSupportedException(
                    "XML string cannot be returned when not parsing")
        raise SAXNotRecognizedException("Property '%s' not recognized" % name)

    def setProperty(self, name, value):
        if name == handler.property_lexical_handler:
            self._lex_handler_prop = value
            if self._parsing:
                self._reset_lex_handler_prop()
        elif name == property_interning_dict:
            self._interning = value
        elif name == property_xml_string:
            raise SAXNotSupportedException("Property '%s' cannot be set" %
                                           name)
        else:
            raise SAXNotRecognizedException("Property '%s' not recognized" %
                                            name)

    # IncrementalParser methods

    def feed(self, data, isFinal = 0):
        if not self._parsing:
            self.reset()
            self._parsing = 1
            self._cont_handler.startDocument()

        try:
            # The isFinal parameter is internal to the expat reader.
            # If it is set to true, expat will check validity of the entire
            # document. When feeding chunks, they are not normally final -
            # except when invoked from close.
            self._parser.Parse(data, isFinal)
        except expat.error as e:
            exc = SAXParseException(expat.ErrorString(e.code), e, self)
            # FIXME: when to invoke error()?
            self._err_handler.fatalError(exc)

    def _close_source(self):
        source = self._source
        try:
            file = source.getCharacterStream()
            if file is not None:
                file.close()
        finally:
            file = source.getByteStream()
            if file is not None:
                file.close()

    def close(self):
        if (self._entity_stack or self._parser is None or
            isinstance(self._parser, _ClosedParser)):
            # If we are completing an external entity, do nothing here
            return
        try:
            self.feed("", isFinal = 1)
            self._cont_handler.endDocument()
            self._parsing = 0
            # break cycle created by expat handlers pointing to our methods
            self._parser = None
        finally:
            self._parsing = 0
            if self._parser is not None:
                # Keep ErrorColumnNumber and ErrorLineNumber after closing.
                parser = _ClosedParser()
                parser.ErrorColumnNumber = self._parser.ErrorColumnNumber
                parser.ErrorLineNumber = self._parser.ErrorLineNumber
                self._parser = parser
            self._close_source()

    def _reset_cont_handler(self):
        self._parser.ProcessingInstructionHandler = \
                                    self._cont_handler.processingInstruction
        self._parser.CharacterDataHandler = self._cont_handler.characters

    def _reset_lex_handler_prop(self):
        lex = self._lex_handler_prop
        parser = self._parser
        if lex is None:
            parser.CommentHandler = None
            parser.StartCdataSectionHandler = None
            parser.EndCdataSectionHandler = None
            parser.StartDoctypeDeclHandler = None
            parser.EndDoctypeDeclHandler = None
        else:
            parser.CommentHandler = lex.comment
            parser.StartCdataSectionHandler = lex.startCDATA
            parser.EndCdataSectionHandler = lex.endCDATA
            parser.StartDoctypeDeclHandler = self.start_doctype_decl
            parser.EndDoctypeDeclHandler = lex.endDTD

    def reset(self):
        if self._namespaces:
            self._parser = expat.ParserCreate(self._source.getEncoding(), " ",
                                              intern=self._interning)
            self._parser.namespace_prefixes = 1
            self._parser.StartElementHandler = self.start_element_ns
            self._parser.EndElementHandler = self.end_element_ns
        else:
            self._parser = expat.ParserCreate(self._source.getEncoding(),
                                              intern = self._interning)
            self._parser.StartElementHandler = self.start_element
            self._parser.EndElementHandler = self.end_element

        self._reset_cont_handler()
        self._parser.UnparsedEntityDeclHandler = self.unparsed_entity_decl
        self._parser.NotationDeclHandler = self.notation_decl
        self._parser.StartNamespaceDeclHandler = self.start_namespace_decl
        self._parser.EndNamespaceDeclHandler = self.end_namespace_decl

        self._decl_handler_prop = None
        if self._lex_handler_prop:
            self._reset_lex_handler_prop()
#         self._parser.DefaultHandler =
#         self._parser.DefaultHandlerExpand =
#         self._parser.NotStandaloneHandler =
        self._parser.ExternalEntityRefHandler = self.external_entity_ref
        try:
            self._parser.SkippedEntityHandler = self.skipped_entity_handler
        except AttributeError:
            # This pyexpat does not support SkippedEntity
            pass
        self._parser.SetParamEntityParsing(
            expat.XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE)

        self._parsing = 0
        self._entity_stack = []

    # Locator methods

    def getColumnNumber(self):
        if self._parser is None:
            return None
        return self._parser.ErrorColumnNumber

    def getLineNumber(self):
        if self._parser is None:
            return 1
        return self._parser.ErrorLineNumber

    def getPublicId(self):
        return self._source.getPublicId()

    def getSystemId(self):
        return self._source.getSystemId()

    # event handlers
    def start_element(self, name, attrs):
        self._cont_handler.startElement(name, AttributesImpl(attrs))

    def end_element(self, name):
        self._cont_handler.endElement(name)

    def start_element_ns(self, name, attrs):
        pair = name.split()
        if len(pair) == 1:
            # no namespace
            pair = (None, name)
        elif len(pair) == 3:
            pair = pair[0], pair[1]
        else:
            # default namespace
            pair = tuple(pair)

        newattrs = {}
        qnames = {}
        for (aname, value) in attrs.items():
            parts = aname.split()
            length = len(parts)
            if length == 1:
                # no namespace
                qname = aname
                apair = (None, aname)
            elif length == 3:
                qname = "%s:%s" % (parts[2], parts[1])
                apair = parts[0], parts[1]
            else:
                # default namespace
                qname = parts[1]
                apair = tuple(parts)

            newattrs[apair] = value
            qnames[apair] = qname

        self._cont_handler.startElementNS(pair, None,
                                          AttributesNSImpl(newattrs, qnames))

    def end_element_ns(self, name):
        pair = name.split()
        if len(pair) == 1:
            pair = (None, name)
        elif len(pair) == 3:
            pair = pair[0], pair[1]
        else:
            pair = tuple(pair)

        self._cont_handler.endElementNS(pair, None)

    # this is not used (call directly to ContentHandler)
    def processing_instruction(self, target, data):
        self._cont_handler.processingInstruction(target, data)

    # this is not used (call directly to ContentHandler)
    def character_data(self, data):
        self._cont_handler.characters(data)

    def start_namespace_decl(self, prefix, uri):
        self._cont_handler.startPrefixMapping(prefix, uri)

    def end_namespace_decl(self, prefix):
        self._cont_handler.endPrefixMapping(prefix)

    def start_doctype_decl(self, name, sysid, pubid, has_internal_subset):
        self._lex_handler_prop.startDTD(name, pubid, sysid)

    def unparsed_entity_decl(self, name, base, sysid, pubid, notation_name):
        self._dtd_handler.unparsedEntityDecl(name, pubid, sysid, notation_name)

    def notation_decl(self, name, base, sysid, pubid):
        self._dtd_handler.notationDecl(name, pubid, sysid)

    def external_entity_ref(self, context, base, sysid, pubid):
        if not self._external_ges:
            return 1

        source = self._ent_handler.resolveEntity(pubid, sysid)
        source = saxutils.prepare_input_source(source,
                                               self._source.getSystemId() or
                                               "")

        self._entity_stack.append((self._parser, self._source))
        self._parser = self._parser.ExternalEntityParserCreate(context)
        self._source = source

        try:
            xmlreader.IncrementalParser.parse(self, source)
        except:
            return 0  # FIXME: save error info here?

        (self._parser, self._source) = self._entity_stack[-1]
        del self._entity_stack[-1]
        return 1

    def skipped_entity_handler(self, name, is_pe):
        if is_pe:
            # The SAX spec requires to report skipped PEs with a '%'
            name = '%'+name
        self._cont_handler.skippedEntity(name)

# ---

def create_parser(*args, **kwargs):
    return ExpatParser(*args, **kwargs)

# ---

if __name__ == "__main__":
    import xml.sax.saxutils
    p = create_parser()
    p.setContentHandler(xml.sax.saxutils.XMLGenerator())
    p.setErrorHandler(xml.sax.ErrorHandler())
    p.parse("http://www.ibiblio.org/xml/examples/shakespeare/hamlet.xml")
xml/sax/__init__.py000064400000007077151153537540010274 0ustar00"""Simple API for XML (SAX) implementation for Python.

This module provides an implementation of the SAX 2 interface;
information about the Java version of the interface can be found at
http://www.megginson.com/SAX/.  The Python version of the interface is
documented at <...>.

This package contains the following modules:

handler -- Base classes and constants which define the SAX 2 API for
           the 'client-side' of SAX for Python.

saxutils -- Implementation of the convenience classes commonly used to
            work with SAX.

xmlreader -- Base classes and constants which define the SAX 2 API for
             the parsers used with SAX for Python.

expatreader -- Driver that allows use of the Expat parser with SAX.
"""

from .xmlreader import InputSource
from .handler import ContentHandler, ErrorHandler
from ._exceptions import SAXException, SAXNotRecognizedException, \
                        SAXParseException, SAXNotSupportedException, \
                        SAXReaderNotAvailable


def parse(source, handler, errorHandler=ErrorHandler()):
    parser = make_parser()
    parser.setContentHandler(handler)
    parser.setErrorHandler(errorHandler)
    parser.parse(source)

def parseString(string, handler, errorHandler=ErrorHandler()):
    import io
    if errorHandler is None:
        errorHandler = ErrorHandler()
    parser = make_parser()
    parser.setContentHandler(handler)
    parser.setErrorHandler(errorHandler)

    inpsrc = InputSource()
    if isinstance(string, str):
        inpsrc.setCharacterStream(io.StringIO(string))
    else:
        inpsrc.setByteStream(io.BytesIO(string))
    parser.parse(inpsrc)

# this is the parser list used by the make_parser function if no
# alternatives are given as parameters to the function

default_parser_list = ["xml.sax.expatreader"]

# tell modulefinder that importing sax potentially imports expatreader
_false = 0
if _false:
    import xml.sax.expatreader

import os, sys
if not sys.flags.ignore_environment and "PY_SAX_PARSER" in os.environ:
    default_parser_list = os.environ["PY_SAX_PARSER"].split(",")
del os

_key = "python.xml.sax.parser"
if sys.platform[:4] == "java" and sys.registry.containsKey(_key):
    default_parser_list = sys.registry.getProperty(_key).split(",")


def make_parser(parser_list=()):
    """Creates and returns a SAX parser.

    Creates the first parser it is able to instantiate of the ones
    given in the iterable created by chaining parser_list and
    default_parser_list.  The iterables must contain the names of Python
    modules containing both a SAX parser and a create_parser function."""

    for parser_name in list(parser_list) + default_parser_list:
        try:
            return _create_parser(parser_name)
        except ImportError as e:
            import sys
            if parser_name in sys.modules:
                # The parser module was found, but importing it
                # failed unexpectedly, pass this exception through
                raise
        except SAXReaderNotAvailable:
            # The parser module detected that it won't work properly,
            # so try the next one
            pass

    raise SAXReaderNotAvailable("No parsers found", None)

# --- Internal utility methods used by make_parser

if sys.platform[ : 4] == "java":
    def _create_parser(parser_name):
        from org.python.core import imp
        drv_module = imp.importName(parser_name, 0, globals())
        return drv_module.create_parser()

else:
    def _create_parser(parser_name):
        drv_module = __import__(parser_name,{},{},['create_parser'])
        return drv_module.create_parser()

del sys
xml/sax/handler.py000064400000033142151153537540010142 0ustar00"""
This module contains the core classes of version 2.0 of SAX for Python.
This file provides only default classes with absolutely minimum
functionality, from which drivers and applications can be subclassed.

Many of these classes are empty and are included only as documentation
of the interfaces.

$Id$
"""

version = '2.0beta'

#============================================================================
#
# HANDLER INTERFACES
#
#============================================================================

# ===== ERRORHANDLER =====

class ErrorHandler:
    """Basic interface for SAX error handlers.

    If you create an object that implements this interface, then
    register the object with your XMLReader, the parser will call the
    methods in your object to report all warnings and errors. There
    are three levels of errors available: warnings, (possibly)
    recoverable errors, and unrecoverable errors. All methods take a
    SAXParseException as the only parameter."""

    def error(self, exception):
        "Handle a recoverable error."
        raise exception

    def fatalError(self, exception):
        "Handle a non-recoverable error."
        raise exception

    def warning(self, exception):
        "Handle a warning."
        print(exception)


# ===== CONTENTHANDLER =====

class ContentHandler:
    """Interface for receiving logical document content events.

    This is the main callback interface in SAX, and the one most
    important to applications. The order of events in this interface
    mirrors the order of the information in the document."""

    def __init__(self):
        self._locator = None

    def setDocumentLocator(self, locator):
        """Called by the parser to give the application a locator for
        locating the origin of document events.

        SAX parsers are strongly encouraged (though not absolutely
        required) to supply a locator: if it does so, it must supply
        the locator to the application by invoking this method before
        invoking any of the other methods in the DocumentHandler
        interface.

        The locator allows the application to determine the end
        position of any document-related event, even if the parser is
        not reporting an error. Typically, the application will use
        this information for reporting its own errors (such as
        character content that does not match an application's
        business rules). The information returned by the locator is
        probably not sufficient for use with a search engine.

        Note that the locator will return correct information only
        during the invocation of the events in this interface. The
        application should not attempt to use it at any other time."""
        self._locator = locator

    def startDocument(self):
        """Receive notification of the beginning of a document.

        The SAX parser will invoke this method only once, before any
        other methods in this interface or in DTDHandler (except for
        setDocumentLocator)."""

    def endDocument(self):
        """Receive notification of the end of a document.

        The SAX parser will invoke this method only once, and it will
        be the last method invoked during the parse. The parser shall
        not invoke this method until it has either abandoned parsing
        (because of an unrecoverable error) or reached the end of
        input."""

    def startPrefixMapping(self, prefix, uri):
        """Begin the scope of a prefix-URI Namespace mapping.

        The information from this event is not necessary for normal
        Namespace processing: the SAX XML reader will automatically
        replace prefixes for element and attribute names when the
        http://xml.org/sax/features/namespaces feature is true (the
        default).

        There are cases, however, when applications need to use
        prefixes in character data or in attribute values, where they
        cannot safely be expanded automatically; the
        start/endPrefixMapping event supplies the information to the
        application to expand prefixes in those contexts itself, if
        necessary.

        Note that start/endPrefixMapping events are not guaranteed to
        be properly nested relative to each-other: all
        startPrefixMapping events will occur before the corresponding
        startElement event, and all endPrefixMapping events will occur
        after the corresponding endElement event, but their order is
        not guaranteed."""

    def endPrefixMapping(self, prefix):
        """End the scope of a prefix-URI mapping.

        See startPrefixMapping for details. This event will always
        occur after the corresponding endElement event, but the order
        of endPrefixMapping events is not otherwise guaranteed."""

    def startElement(self, name, attrs):
        """Signals the start of an element in non-namespace mode.

        The name parameter contains the raw XML 1.0 name of the
        element type as a string and the attrs parameter holds an
        instance of the Attributes class containing the attributes of
        the element."""

    def endElement(self, name):
        """Signals the end of an element in non-namespace mode.

        The name parameter contains the name of the element type, just
        as with the startElement event."""

    def startElementNS(self, name, qname, attrs):
        """Signals the start of an element in namespace mode.

        The name parameter contains the name of the element type as a
        (uri, localname) tuple, the qname parameter the raw XML 1.0
        name used in the source document, and the attrs parameter
        holds an instance of the Attributes class containing the
        attributes of the element.

        The uri part of the name tuple is None for elements which have
        no namespace."""

    def endElementNS(self, name, qname):
        """Signals the end of an element in namespace mode.

        The name parameter contains the name of the element type, just
        as with the startElementNS event."""

    def characters(self, content):
        """Receive notification of character data.

        The Parser will call this method to report each chunk of
        character data. SAX parsers may return all contiguous
        character data in a single chunk, or they may split it into
        several chunks; however, all of the characters in any single
        event must come from the same external entity so that the
        Locator provides useful information."""

    def ignorableWhitespace(self, whitespace):
        """Receive notification of ignorable whitespace in element content.

        Validating Parsers must use this method to report each chunk
        of ignorable whitespace (see the W3C XML 1.0 recommendation,
        section 2.10): non-validating parsers may also use this method
        if they are capable of parsing and using content models.

        SAX parsers may return all contiguous whitespace in a single
        chunk, or they may split it into several chunks; however, all
        of the characters in any single event must come from the same
        external entity, so that the Locator provides useful
        information."""

    def processingInstruction(self, target, data):
        """Receive notification of a processing instruction.

        The Parser will invoke this method once for each processing
        instruction found: note that processing instructions may occur
        before or after the main document element.

        A SAX parser should never report an XML declaration (XML 1.0,
        section 2.8) or a text declaration (XML 1.0, section 4.3.1)
        using this method."""

    def skippedEntity(self, name):
        """Receive notification of a skipped entity.

        The Parser will invoke this method once for each entity
        skipped. Non-validating processors may skip entities if they
        have not seen the declarations (because, for example, the
        entity was declared in an external DTD subset). All processors
        may skip external entities, depending on the values of the
        http://xml.org/sax/features/external-general-entities and the
        http://xml.org/sax/features/external-parameter-entities
        properties."""


# ===== DTDHandler =====

class DTDHandler:
    """Handle DTD events.

    This interface specifies only those DTD events required for basic
    parsing (unparsed entities and attributes)."""

    def notationDecl(self, name, publicId, systemId):
        "Handle a notation declaration event."

    def unparsedEntityDecl(self, name, publicId, systemId, ndata):
        "Handle an unparsed entity declaration event."


# ===== ENTITYRESOLVER =====

class EntityResolver:
    """Basic interface for resolving entities. If you create an object
    implementing this interface, then register the object with your
    Parser, the parser will call the method in your object to
    resolve all external entities. Note that DefaultHandler implements
    this interface with the default behaviour."""

    def resolveEntity(self, publicId, systemId):
        """Resolve the system identifier of an entity and return either
        the system identifier to read from as a string, or an InputSource
        to read from."""
        return systemId


#============================================================================
#
# CORE FEATURES
#
#============================================================================

feature_namespaces = "http://xml.org/sax/features/namespaces"
# true: Perform Namespace processing (default).
# false: Optionally do not perform Namespace processing
#        (implies namespace-prefixes).
# access: (parsing) read-only; (not parsing) read/write

feature_namespace_prefixes = "http://xml.org/sax/features/namespace-prefixes"
# true: Report the original prefixed names and attributes used for Namespace
#       declarations.
# false: Do not report attributes used for Namespace declarations, and
#        optionally do not report original prefixed names (default).
# access: (parsing) read-only; (not parsing) read/write

feature_string_interning = "http://xml.org/sax/features/string-interning"
# true: All element names, prefixes, attribute names, Namespace URIs, and
#       local names are interned using the built-in intern function.
# false: Names are not necessarily interned, although they may be (default).
# access: (parsing) read-only; (not parsing) read/write

feature_validation = "http://xml.org/sax/features/validation"
# true: Report all validation errors (implies external-general-entities and
#       external-parameter-entities).
# false: Do not report validation errors.
# access: (parsing) read-only; (not parsing) read/write

feature_external_ges = "http://xml.org/sax/features/external-general-entities"
# true: Include all external general (text) entities.
# false: Do not include external general entities.
# access: (parsing) read-only; (not parsing) read/write

feature_external_pes = "http://xml.org/sax/features/external-parameter-entities"
# true: Include all external parameter entities, including the external
#       DTD subset.
# false: Do not include any external parameter entities, even the external
#        DTD subset.
# access: (parsing) read-only; (not parsing) read/write

all_features = [feature_namespaces,
                feature_namespace_prefixes,
                feature_string_interning,
                feature_validation,
                feature_external_ges,
                feature_external_pes]


#============================================================================
#
# CORE PROPERTIES
#
#============================================================================

property_lexical_handler = "http://xml.org/sax/properties/lexical-handler"
# data type: xml.sax.sax2lib.LexicalHandler
# description: An optional extension handler for lexical events like comments.
# access: read/write

property_declaration_handler = "http://xml.org/sax/properties/declaration-handler"
# data type: xml.sax.sax2lib.DeclHandler
# description: An optional extension handler for DTD-related events other
#              than notations and unparsed entities.
# access: read/write

property_dom_node = "http://xml.org/sax/properties/dom-node"
# data type: org.w3c.dom.Node
# description: When parsing, the current DOM node being visited if this is
#              a DOM iterator; when not parsing, the root DOM node for
#              iteration.
# access: (parsing) read-only; (not parsing) read/write

property_xml_string = "http://xml.org/sax/properties/xml-string"
# data type: String
# description: The literal string of characters that was the source for
#              the current event.
# access: read-only

property_encoding = "http://www.python.org/sax/properties/encoding"
# data type: String
# description: The name of the encoding to assume for input data.
# access: write: set the encoding, e.g. established by a higher-level
#                protocol. May change during parsing (e.g. after
#                processing a META tag)
#         read:  return the current encoding (possibly established through
#                auto-detection.
# initial value: UTF-8
#

property_interning_dict = "http://www.python.org/sax/properties/interning-dict"
# data type: Dictionary
# description: The dictionary used to intern common strings in the document
# access: write: Request that the parser uses a specific dictionary, to
#                allow interning across different documents
#         read:  return the current interning dictionary, or None
#

all_properties = [property_lexical_handler,
                  property_dom_node,
                  property_declaration_handler,
                  property_xml_string,
                  property_encoding,
                  property_interning_dict]
xml/sax/_exceptions.py000064400000011261151153537540011043 0ustar00"""Different kinds of SAX Exceptions"""
import sys
if sys.platform[:4] == "java":
    from java.lang import Exception
del sys

# ===== SAXEXCEPTION =====

class SAXException(Exception):
    """Encapsulate an XML error or warning. This class can contain
    basic error or warning information from either the XML parser or
    the application: you can subclass it to provide additional
    functionality, or to add localization. Note that although you will
    receive a SAXException as the argument to the handlers in the
    ErrorHandler interface, you are not actually required to raise
    the exception; instead, you can simply read the information in
    it."""

    def __init__(self, msg, exception=None):
        """Creates an exception. The message is required, but the exception
        is optional."""
        self._msg = msg
        self._exception = exception
        Exception.__init__(self, msg)

    def getMessage(self):
        "Return a message for this exception."
        return self._msg

    def getException(self):
        "Return the embedded exception, or None if there was none."
        return self._exception

    def __str__(self):
        "Create a string representation of the exception."
        return self._msg

    def __getitem__(self, ix):
        """Avoids weird error messages if someone does exception[ix] by
        mistake, since Exception has __getitem__ defined."""
        raise AttributeError("__getitem__")


# ===== SAXPARSEEXCEPTION =====

class SAXParseException(SAXException):
    """Encapsulate an XML parse error or warning.

    This exception will include information for locating the error in
    the original XML document. Note that although the application will
    receive a SAXParseException as the argument to the handlers in the
    ErrorHandler interface, the application is not actually required
    to raise the exception; instead, it can simply read the
    information in it and take a different action.

    Since this exception is a subclass of SAXException, it inherits
    the ability to wrap another exception."""

    def __init__(self, msg, exception, locator):
        "Creates the exception. The exception parameter is allowed to be None."
        SAXException.__init__(self, msg, exception)
        self._locator = locator

        # We need to cache this stuff at construction time.
        # If this exception is raised, the objects through which we must
        # traverse to get this information may be deleted by the time
        # it gets caught.
        self._systemId = self._locator.getSystemId()
        self._colnum = self._locator.getColumnNumber()
        self._linenum = self._locator.getLineNumber()

    def getColumnNumber(self):
        """The column number of the end of the text where the exception
        occurred."""
        return self._colnum

    def getLineNumber(self):
        "The line number of the end of the text where the exception occurred."
        return self._linenum

    def getPublicId(self):
        "Get the public identifier of the entity where the exception occurred."
        return self._locator.getPublicId()

    def getSystemId(self):
        "Get the system identifier of the entity where the exception occurred."
        return self._systemId

    def __str__(self):
        "Create a string representation of the exception."
        sysid = self.getSystemId()
        if sysid is None:
            sysid = "<unknown>"
        linenum = self.getLineNumber()
        if linenum is None:
            linenum = "?"
        colnum = self.getColumnNumber()
        if colnum is None:
            colnum = "?"
        return "%s:%s:%s: %s" % (sysid, linenum, colnum, self._msg)


# ===== SAXNOTRECOGNIZEDEXCEPTION =====

class SAXNotRecognizedException(SAXException):
    """Exception class for an unrecognized identifier.

    An XMLReader will raise this exception when it is confronted with an
    unrecognized feature or property. SAX applications and extensions may
    use this class for similar purposes."""


# ===== SAXNOTSUPPORTEDEXCEPTION =====

class SAXNotSupportedException(SAXException):
    """Exception class for an unsupported operation.

    An XMLReader will raise this exception when a service it cannot
    perform is requested (specifically setting a state or value). SAX
    applications and extensions may use this class for similar
    purposes."""

# ===== SAXNOTSUPPORTEDEXCEPTION =====

class SAXReaderNotAvailable(SAXNotSupportedException):
    """Exception class for a missing driver.

    An XMLReader module (driver) should raise this exception when it
    is first imported, e.g. when a support module cannot be imported.
    It also may be raised during parsing, e.g. if executing an external
    program is not permitted."""
xml/sax/xmlreader.py000064400000030614151153537540010511 0ustar00"""An XML Reader is the SAX 2 name for an XML parser. XML Parsers
should be based on this code. """

from . import handler

from ._exceptions import SAXNotSupportedException, SAXNotRecognizedException


# ===== XMLREADER =====

class XMLReader:
    """Interface for reading an XML document using callbacks.

    XMLReader is the interface that an XML parser's SAX2 driver must
    implement. This interface allows an application to set and query
    features and properties in the parser, to register event handlers
    for document processing, and to initiate a document parse.

    All SAX interfaces are assumed to be synchronous: the parse
    methods must not return until parsing is complete, and readers
    must wait for an event-handler callback to return before reporting
    the next event."""

    def __init__(self):
        self._cont_handler = handler.ContentHandler()
        self._dtd_handler = handler.DTDHandler()
        self._ent_handler = handler.EntityResolver()
        self._err_handler = handler.ErrorHandler()

    def parse(self, source):
        "Parse an XML document from a system identifier or an InputSource."
        raise NotImplementedError("This method must be implemented!")

    def getContentHandler(self):
        "Returns the current ContentHandler."
        return self._cont_handler

    def setContentHandler(self, handler):
        "Registers a new object to receive document content events."
        self._cont_handler = handler

    def getDTDHandler(self):
        "Returns the current DTD handler."
        return self._dtd_handler

    def setDTDHandler(self, handler):
        "Register an object to receive basic DTD-related events."
        self._dtd_handler = handler

    def getEntityResolver(self):
        "Returns the current EntityResolver."
        return self._ent_handler

    def setEntityResolver(self, resolver):
        "Register an object to resolve external entities."
        self._ent_handler = resolver

    def getErrorHandler(self):
        "Returns the current ErrorHandler."
        return self._err_handler

    def setErrorHandler(self, handler):
        "Register an object to receive error-message events."
        self._err_handler = handler

    def setLocale(self, locale):
        """Allow an application to set the locale for errors and warnings.

        SAX parsers are not required to provide localization for errors
        and warnings; if they cannot support the requested locale,
        however, they must raise a SAX exception. Applications may
        request a locale change in the middle of a parse."""
        raise SAXNotSupportedException("Locale support not implemented")

    def getFeature(self, name):
        "Looks up and returns the state of a SAX2 feature."
        raise SAXNotRecognizedException("Feature '%s' not recognized" % name)

    def setFeature(self, name, state):
        "Sets the state of a SAX2 feature."
        raise SAXNotRecognizedException("Feature '%s' not recognized" % name)

    def getProperty(self, name):
        "Looks up and returns the value of a SAX2 property."
        raise SAXNotRecognizedException("Property '%s' not recognized" % name)

    def setProperty(self, name, value):
        "Sets the value of a SAX2 property."
        raise SAXNotRecognizedException("Property '%s' not recognized" % name)

class IncrementalParser(XMLReader):
    """This interface adds three extra methods to the XMLReader
    interface that allow XML parsers to support incremental
    parsing. Support for this interface is optional, since not all
    underlying XML parsers support this functionality.

    When the parser is instantiated it is ready to begin accepting
    data from the feed method immediately. After parsing has been
    finished with a call to close the reset method must be called to
    make the parser ready to accept new data, either from feed or
    using the parse method.

    Note that these methods must _not_ be called during parsing, that
    is, after parse has been called and before it returns.

    By default, the class also implements the parse method of the XMLReader
    interface using the feed, close and reset methods of the
    IncrementalParser interface as a convenience to SAX 2.0 driver
    writers."""

    def __init__(self, bufsize=2**16):
        self._bufsize = bufsize
        XMLReader.__init__(self)

    def parse(self, source):
        from . import saxutils
        source = saxutils.prepare_input_source(source)

        self.prepareParser(source)
        file = source.getCharacterStream()
        if file is None:
            file = source.getByteStream()
        buffer = file.read(self._bufsize)
        while buffer:
            self.feed(buffer)
            buffer = file.read(self._bufsize)
        self.close()

    def feed(self, data):
        """This method gives the raw XML data in the data parameter to
        the parser and makes it parse the data, emitting the
        corresponding events. It is allowed for XML constructs to be
        split across several calls to feed.

        feed may raise SAXException."""
        raise NotImplementedError("This method must be implemented!")

    def prepareParser(self, source):
        """This method is called by the parse implementation to allow
        the SAX 2.0 driver to prepare itself for parsing."""
        raise NotImplementedError("prepareParser must be overridden!")

    def close(self):
        """This method is called when the entire XML document has been
        passed to the parser through the feed method, to notify the
        parser that there are no more data. This allows the parser to
        do the final checks on the document and empty the internal
        data buffer.

        The parser will not be ready to parse another document until
        the reset method has been called.

        close may raise SAXException."""
        raise NotImplementedError("This method must be implemented!")

    def reset(self):
        """This method is called after close has been called to reset
        the parser so that it is ready to parse new documents. The
        results of calling parse or feed after close without calling
        reset are undefined."""
        raise NotImplementedError("This method must be implemented!")

# ===== LOCATOR =====

class Locator:
    """Interface for associating a SAX event with a document
    location. A locator object will return valid results only during
    calls to DocumentHandler methods; at any other time, the
    results are unpredictable."""

    def getColumnNumber(self):
        "Return the column number where the current event ends."
        return -1

    def getLineNumber(self):
        "Return the line number where the current event ends."
        return -1

    def getPublicId(self):
        "Return the public identifier for the current event."
        return None

    def getSystemId(self):
        "Return the system identifier for the current event."
        return None

# ===== INPUTSOURCE =====

class InputSource:
    """Encapsulation of the information needed by the XMLReader to
    read entities.

    This class may include information about the public identifier,
    system identifier, byte stream (possibly with character encoding
    information) and/or the character stream of an entity.

    Applications will create objects of this class for use in the
    XMLReader.parse method and for returning from
    EntityResolver.resolveEntity.

    An InputSource belongs to the application, the XMLReader is not
    allowed to modify InputSource objects passed to it from the
    application, although it may make copies and modify those."""

    def __init__(self, system_id = None):
        self.__system_id = system_id
        self.__public_id = None
        self.__encoding  = None
        self.__bytefile  = None
        self.__charfile  = None

    def setPublicId(self, public_id):
        "Sets the public identifier of this InputSource."
        self.__public_id = public_id

    def getPublicId(self):
        "Returns the public identifier of this InputSource."
        return self.__public_id

    def setSystemId(self, system_id):
        "Sets the system identifier of this InputSource."
        self.__system_id = system_id

    def getSystemId(self):
        "Returns the system identifier of this InputSource."
        return self.__system_id

    def setEncoding(self, encoding):
        """Sets the character encoding of this InputSource.

        The encoding must be a string acceptable for an XML encoding
        declaration (see section 4.3.3 of the XML recommendation).

        The encoding attribute of the InputSource is ignored if the
        InputSource also contains a character stream."""
        self.__encoding = encoding

    def getEncoding(self):
        "Get the character encoding of this InputSource."
        return self.__encoding

    def setByteStream(self, bytefile):
        """Set the byte stream (a Python file-like object which does
        not perform byte-to-character conversion) for this input
        source.

        The SAX parser will ignore this if there is also a character
        stream specified, but it will use a byte stream in preference
        to opening a URI connection itself.

        If the application knows the character encoding of the byte
        stream, it should set it with the setEncoding method."""
        self.__bytefile = bytefile

    def getByteStream(self):
        """Get the byte stream for this input source.

        The getEncoding method will return the character encoding for
        this byte stream, or None if unknown."""
        return self.__bytefile

    def setCharacterStream(self, charfile):
        """Set the character stream for this input source. (The stream
        must be a Python 2.0 Unicode-wrapped file-like that performs
        conversion to Unicode strings.)

        If there is a character stream specified, the SAX parser will
        ignore any byte stream and will not attempt to open a URI
        connection to the system identifier."""
        self.__charfile = charfile

    def getCharacterStream(self):
        "Get the character stream for this input source."
        return self.__charfile

# ===== ATTRIBUTESIMPL =====

class AttributesImpl:

    def __init__(self, attrs):
        """Non-NS-aware implementation.

        attrs should be of the form {name : value}."""
        self._attrs = attrs

    def getLength(self):
        return len(self._attrs)

    def getType(self, name):
        return "CDATA"

    def getValue(self, name):
        return self._attrs[name]

    def getValueByQName(self, name):
        return self._attrs[name]

    def getNameByQName(self, name):
        if name not in self._attrs:
            raise KeyError(name)
        return name

    def getQNameByName(self, name):
        if name not in self._attrs:
            raise KeyError(name)
        return name

    def getNames(self):
        return list(self._attrs.keys())

    def getQNames(self):
        return list(self._attrs.keys())

    def __len__(self):
        return len(self._attrs)

    def __getitem__(self, name):
        return self._attrs[name]

    def keys(self):
        return list(self._attrs.keys())

    def __contains__(self, name):
        return name in self._attrs

    def get(self, name, alternative=None):
        return self._attrs.get(name, alternative)

    def copy(self):
        return self.__class__(self._attrs)

    def items(self):
        return list(self._attrs.items())

    def values(self):
        return list(self._attrs.values())

# ===== ATTRIBUTESNSIMPL =====

class AttributesNSImpl(AttributesImpl):

    def __init__(self, attrs, qnames):
        """NS-aware implementation.

        attrs should be of the form {(ns_uri, lname): value, ...}.
        qnames of the form {(ns_uri, lname): qname, ...}."""
        self._attrs = attrs
        self._qnames = qnames

    def getValueByQName(self, name):
        for (nsname, qname) in self._qnames.items():
            if qname == name:
                return self._attrs[nsname]

        raise KeyError(name)

    def getNameByQName(self, name):
        for (nsname, qname) in self._qnames.items():
            if qname == name:
                return nsname

        raise KeyError(name)

    def getQNameByName(self, name):
        return self._qnames[name]

    def getQNames(self):
        return list(self._qnames.values())

    def copy(self):
        return self.__class__(self._attrs, self._qnames)


def _test():
    XMLReader()
    IncrementalParser()
    Locator()

if __name__ == "__main__":
    _test()
xml/sax/__pycache__/saxutils.cpython-38.opt-1.pyc000064400000031171151153537540015626 0ustar00U

e5d�/�@s�dZddlZddlZddlZddlZddlZddlmZddlm	Z	dd�Z
ifdd	�Zifd
d�Zifdd
�Z
dd�ZGdd�dej�ZGdd�de	j�Zddd�ZdS)znA library of useful helper classes to the SAX classes, for the
convenience of application and driver writers.
�N�)�handler)�	xmlreadercCs"|��D]\}}|�||�}q|S)z2Replace substrings of a string using a dictionary.)�items�replace)�s�d�key�value�r�(/usr/lib64/python3.8/xml/sax/saxutils.py�__dict_replacesr
cCs6|�dd�}|�dd�}|�dd�}|r2t||�}|S)z�Escape &, <, and > in a string of data.

    You can escape other strings of data by passing a dictionary as
    the optional entities parameter.  The keys and values must all be
    strings; each key will be replaced with its corresponding value.
    �&�&amp;�>�&gt;�<�&lt;�rr
��dataZentitiesrrr�escapes	
rcCs2|�dd�}|�dd�}|r&t||�}|�dd�S)a
Unescape &amp;, &lt;, and &gt; in a string of data.

    You can unescape other strings of data by passing a dictionary as
    the optional entities parameter.  The keys and values must all be
    strings; each key will be replaced with its corresponding value.
    rrrrrrrrrrr�unescape"s

rcCsR|dddd��}t||�}d|krFd|kr<d|�dd�}qNd	|}nd|}|S)
a�Escape and quote an attribute value.

    Escape &, <, and > in a string of data, then quote it for use as
    an attribute value.  The " character will be escaped as well, if
    necessary.

    You can escape other strings of data by passing a dictionary as
    the optional entities parameter.  The keys and values must all be
    strings; each key will be replaced with its corresponding value.
    z&#10;z&#13;z&#9;)�
�
�	�"�'z"%s"z&quot;z'%s')rrrrrr�	quoteattr0s

rcs��dkrddl}|jSt�tj�r&�St�tjtjf�r<�St�tj�rlG�fdd�d�}|�}dd�|_	nDt�
�}dd�|_�j|_z�j
|_
�j|_Wntk
r�YnXtj||ddd	d
�S)NrcseZdZ�jZ�fdd�ZdS)z _gettextwriter.<locals>._wrappercs
t�|�S�N)�getattr��self�name��outrr�__getattr__Zsz,_gettextwriter.<locals>._wrapper.__getattr__N)�__name__�
__module__�__qualname__�	__class__r&rr$rr�_wrapperXsr+cSsdSrrrrrr�<lambda>]�z _gettextwriter.<locals>.<lambda>cSsdS)NTrrrrrr,br-�xmlcharrefreplacerT)�encoding�errors�newline�
write_through)�sys�stdout�
isinstance�io�
TextIOBase�codecs�StreamWriter�StreamReaderWriter�	RawIOBase�close�BufferedIOBase�writable�write�seekable�tell�AttributeError�
TextIOWrapper)r%r/r3r+�bufferrr$r�_gettextwriterGs0
�rEc@s�eZdZd dd�Zdd�Zd!dd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)"�XMLGeneratorN�
iso-8859-1FcCsVtj�|�t||�}|j|_|j|_ig|_|jd|_	g|_
||_||_d|_
dS)N���F)r�ContentHandler�__init__rEr?�_write�flush�_flush�_ns_contexts�_current_context�_undeclared_ns_maps�	_encoding�_short_empty_elements�_pending_start_element)r"r%r/Zshort_empty_elementsrrrrJrs
zXMLGenerator.__init__cCsJ|drBd|dkr d|dS|j|d}|rB|d|dS|dS)z7Builds a qualified name from a (ns_url, localname) pairrz$http://www.w3.org/XML/1998/namespacezxml:r�:)rO)r"r#�prefixrrr�_qname~szXMLGenerator._qnamecCs|jr|�d�d|_dS)NrF�rSrK)r"�
endElementrrr�_finish_pending_start_element�s
z*XMLGenerator._finish_pending_start_elementcCs|�d|j�dS)Nz$<?xml version="1.0" encoding="%s"?>
)rKrQ�r"rrr�
startDocument�s�zXMLGenerator.startDocumentcCs|��dSr)rMrZrrr�endDocument�szXMLGenerator.endDocumentcCs0|j�|j���||j|<|j�||f�dSr)rN�appendrO�copyrP�r"rU�urirrr�startPrefixMapping�s
zXMLGenerator.startPrefixMappingcCs|jd|_|jd=dS)NrH)rNrO�r"rUrrr�endPrefixMapping�szXMLGenerator.endPrefixMappingcCsZ|��|�d|�|��D]\}}|�d|t|�f�q|jrLd|_n
|�d�dS)Nr� %s=%sTr)rYrKrrrRrS)r"r#�attrsr
rrr�startElement�szXMLGenerator.startElementcCs*|jr|�d�d|_n|�d|�dS�Nz/>Fz</%s>rWr!rrrrX�s
zXMLGenerator.endElementcCs�|��|�d|�|��|jD].\}}|rB|�d||f�q"|�d|�q"g|_|��D]$\}}|�d|�|�t|�f�q`|jr�d|_n
|�d�dS)Nrz xmlns:%s="%s"z xmlns="%s"rdTr)rYrKrVrPrrrRrS)r"r#�qnamererUr`r
rrr�startElementNS�szXMLGenerator.startElementNScCs0|jr|�d�d|_n|�d|�|��dSrg)rSrKrV�r"r#rhrrr�endElementNS�s
zXMLGenerator.endElementNScCs4|r0|��t|t�s"t||j�}|�t|��dSr)rYr5�strrQrKr�r"Zcontentrrr�
characters�s

zXMLGenerator.characterscCs0|r,|��t|t�s"t||j�}|�|�dSr)rYr5rlrQrKrmrrr�ignorableWhitespace�s

z XMLGenerator.ignorableWhitespacecCs|��|�d||f�dS)Nz	<?%s %s?>)rYrK�r"�targetrrrr�processingInstruction�sz"XMLGenerator.processingInstruction)NrGF)F)r'r(r)rJrVrYr[r\rarcrfrXrirkrnrorrrrrrrFps


rFc@s�eZdZdZd;dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�ZdS)<�
XMLFilterBaseaYThis class is designed to sit between an XMLReader and the
    client application's event handlers.  By default, it does nothing
    but pass requests up to the reader and events on to the handlers
    unmodified, but subclasses can override specific methods to modify
    the event stream or the configuration requests as they pass
    through.NcCstj�|�||_dSr)r�	XMLReaderrJ�_parent�r"�parentrrrrJ�szXMLFilterBase.__init__cCs|j�|�dSr)�_err_handler�error�r"Z	exceptionrrrry�szXMLFilterBase.errorcCs|j�|�dSr)rx�
fatalErrorrzrrrr{�szXMLFilterBase.fatalErrorcCs|j�|�dSr)rx�warningrzrrrr|�szXMLFilterBase.warningcCs|j�|�dSr)�
_cont_handler�setDocumentLocator)r"Zlocatorrrrr~�sz XMLFilterBase.setDocumentLocatorcCs|j��dSr)r}r[rZrrrr[�szXMLFilterBase.startDocumentcCs|j��dSr)r}r\rZrrrr\szXMLFilterBase.endDocumentcCs|j�||�dSr)r}rar_rrrrasz XMLFilterBase.startPrefixMappingcCs|j�|�dSr)r}rcrbrrrrcszXMLFilterBase.endPrefixMappingcCs|j�||�dSr)r}rf)r"r#rerrrrfszXMLFilterBase.startElementcCs|j�|�dSr)r}rXr!rrrrXszXMLFilterBase.endElementcCs|j�|||�dSr)r}ri)r"r#rhrerrrriszXMLFilterBase.startElementNScCs|j�||�dSr)r}rkrjrrrrkszXMLFilterBase.endElementNScCs|j�|�dSr)r}rnrmrrrrnszXMLFilterBase.characterscCs|j�|�dSr)r}ro)r"�charsrrrrosz!XMLFilterBase.ignorableWhitespacecCs|j�||�dSr)r}rrrprrrrrsz#XMLFilterBase.processingInstructioncCs|j�|�dSr)r}�
skippedEntityr!rrrr� szXMLFilterBase.skippedEntitycCs|j�|||�dSr)�_dtd_handler�notationDecl)r"r#�publicId�systemIdrrrr�%szXMLFilterBase.notationDeclcCs|j�||||�dSr)r��unparsedEntityDecl)r"r#r�r�Zndatarrrr�(sz XMLFilterBase.unparsedEntityDeclcCs|j�||�Sr)Z_ent_handler�
resolveEntity)r"r�r�rrrr�-szXMLFilterBase.resolveEntitycCs@|j�|�|j�|�|j�|�|j�|�|j�|�dSr)ruZsetContentHandlerZsetErrorHandlerZsetEntityResolverZ
setDTDHandler�parse)r"�sourcerrrr�2s
zXMLFilterBase.parsecCs|j�|�dSr)ru�	setLocale)r"Zlocalerrrr�9szXMLFilterBase.setLocalecCs|j�|�Sr)ru�
getFeaturer!rrrr�<szXMLFilterBase.getFeaturecCs|j�||�dSr)ru�
setFeature)r"r#�staterrrr�?szXMLFilterBase.setFeaturecCs|j�|�Sr)ru�getPropertyr!rrrr�BszXMLFilterBase.getPropertycCs|j�||�dSr)ru�setProperty)r"r#r
rrrr�EszXMLFilterBase.setPropertycCs|jSr�rurZrrr�	getParentJszXMLFilterBase.getParentcCs
||_dSrr�rvrrr�	setParentMszXMLFilterBase.setParent)N) r'r(r)�__doc__rJryr{r|r~r[r\rarcrfrXrirkrnrorrr�r�r�r�r�r�r�r�r�r�r�r�rrrrrs�s:
rs�cCs$t|tj�rt�|�}t|t�r,t�|�}n^t|d�r�|}t��}t|�d�t�r^|�	|�n
|�
|�t|d�r�t|jt�r�|�|j�|�
�dk�r |��dk�r |��}tj�tj�|��}tj�||�}tj�|�r�|�|�t|d�}n$|�tj�||��tj�|���}|�
|�|S)z�This function takes an InputSource and an optional base URL and
    returns a fully resolved InputSource object ready for reading.�readrr#N�rb)r5�os�PathLike�fspathrlrZInputSource�hasattrr�ZsetCharacterStreamZ
setByteStreamr#ZsetSystemIdZgetCharacterStreamZ
getByteStreamZgetSystemId�path�dirname�normpath�join�isfile�open�urllibr�ZurljoinZrequestZurlopen)r��base�fZsysidZbaseheadZ
sysidfilenamerrr�prepare_input_sourceRs.





r�)r�)r�r�Zurllib.parser�Zurllib.requestr6r8r�rrr
rrrrErIrFrtrsr�rrrr�<module>s)soxml/sax/__pycache__/handler.cpython-38.pyc000064400000030210151153537540014421 0ustar00U

e5db6�@s�dZdZGdd�d�ZGdd�d�ZGdd�d�ZGdd	�d	�Zd
ZdZdZd
Z	dZ
dZeeee	e
egZdZ
dZdZdZdZdZe
eeeeegZdS)a0
This module contains the core classes of version 2.0 of SAX for Python.
This file provides only default classes with absolutely minimum
functionality, from which drivers and applications can be subclassed.

Many of these classes are empty and are included only as documentation
of the interfaces.

$Id$
z2.0betac@s(eZdZdZdd�Zdd�Zdd�ZdS)	�ErrorHandlera�Basic interface for SAX error handlers.

    If you create an object that implements this interface, then
    register the object with your XMLReader, the parser will call the
    methods in your object to report all warnings and errors. There
    are three levels of errors available: warnings, (possibly)
    recoverable errors, and unrecoverable errors. All methods take a
    SAXParseException as the only parameter.cCs|�dS)zHandle a recoverable error.N���selfZ	exceptionrr�'/usr/lib64/python3.8/xml/sax/handler.py�error szErrorHandler.errorcCs|�dS)zHandle a non-recoverable error.Nrrrrr�
fatalError$szErrorHandler.fatalErrorcCst|�dS)zHandle a warning.N)�printrrrr�warning(szErrorHandler.warningN)�__name__�
__module__�__qualname__�__doc__rrr	rrrrrs	rc@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZdS)�ContentHandlerz�Interface for receiving logical document content events.

    This is the main callback interface in SAX, and the one most
    important to applications. The order of events in this interface
    mirrors the order of the information in the document.cCs
d|_dS)N�Z_locator�rrrr�__init__6szContentHandler.__init__cCs
||_dS)a#Called by the parser to give the application a locator for
        locating the origin of document events.

        SAX parsers are strongly encouraged (though not absolutely
        required) to supply a locator: if it does so, it must supply
        the locator to the application by invoking this method before
        invoking any of the other methods in the DocumentHandler
        interface.

        The locator allows the application to determine the end
        position of any document-related event, even if the parser is
        not reporting an error. Typically, the application will use
        this information for reporting its own errors (such as
        character content that does not match an application's
        business rules). The information returned by the locator is
        probably not sufficient for use with a search engine.

        Note that the locator will return correct information only
        during the invocation of the events in this interface. The
        application should not attempt to use it at any other time.Nr)rZlocatorrrr�setDocumentLocator9sz!ContentHandler.setDocumentLocatorcCsdS)z�Receive notification of the beginning of a document.

        The SAX parser will invoke this method only once, before any
        other methods in this interface or in DTDHandler (except for
        setDocumentLocator).Nrrrrr�
startDocumentPszContentHandler.startDocumentcCsdS)aQReceive notification of the end of a document.

        The SAX parser will invoke this method only once, and it will
        be the last method invoked during the parse. The parser shall
        not invoke this method until it has either abandoned parsing
        (because of an unrecoverable error) or reached the end of
        input.Nrrrrr�endDocumentWszContentHandler.endDocumentcCsdS)aBegin the scope of a prefix-URI Namespace mapping.

        The information from this event is not necessary for normal
        Namespace processing: the SAX XML reader will automatically
        replace prefixes for element and attribute names when the
        http://xml.org/sax/features/namespaces feature is true (the
        default).

        There are cases, however, when applications need to use
        prefixes in character data or in attribute values, where they
        cannot safely be expanded automatically; the
        start/endPrefixMapping event supplies the information to the
        application to expand prefixes in those contexts itself, if
        necessary.

        Note that start/endPrefixMapping events are not guaranteed to
        be properly nested relative to each-other: all
        startPrefixMapping events will occur before the corresponding
        startElement event, and all endPrefixMapping events will occur
        after the corresponding endElement event, but their order is
        not guaranteed.Nr)r�prefixZurirrr�startPrefixMapping`sz!ContentHandler.startPrefixMappingcCsdS)z�End the scope of a prefix-URI mapping.

        See startPrefixMapping for details. This event will always
        occur after the corresponding endElement event, but the order
        of endPrefixMapping events is not otherwise guaranteed.Nr)rrrrr�endPrefixMappingwszContentHandler.endPrefixMappingcCsdS)aSignals the start of an element in non-namespace mode.

        The name parameter contains the raw XML 1.0 name of the
        element type as a string and the attrs parameter holds an
        instance of the Attributes class containing the attributes of
        the element.Nr)r�name�attrsrrr�startElement~szContentHandler.startElementcCsdS)z�Signals the end of an element in non-namespace mode.

        The name parameter contains the name of the element type, just
        as with the startElement event.Nr�rrrrr�
endElement�szContentHandler.endElementcCsdS)a�Signals the start of an element in namespace mode.

        The name parameter contains the name of the element type as a
        (uri, localname) tuple, the qname parameter the raw XML 1.0
        name used in the source document, and the attrs parameter
        holds an instance of the Attributes class containing the
        attributes of the element.

        The uri part of the name tuple is None for elements which have
        no namespace.Nr)rr�qnamerrrr�startElementNS�szContentHandler.startElementNScCsdS)z�Signals the end of an element in namespace mode.

        The name parameter contains the name of the element type, just
        as with the startElementNS event.Nr)rrrrrr�endElementNS�szContentHandler.endElementNScCsdS)a�Receive notification of character data.

        The Parser will call this method to report each chunk of
        character data. SAX parsers may return all contiguous
        character data in a single chunk, or they may split it into
        several chunks; however, all of the characters in any single
        event must come from the same external entity so that the
        Locator provides useful information.Nr)rZcontentrrr�
characters�szContentHandler.characterscCsdS)awReceive notification of ignorable whitespace in element content.

        Validating Parsers must use this method to report each chunk
        of ignorable whitespace (see the W3C XML 1.0 recommendation,
        section 2.10): non-validating parsers may also use this method
        if they are capable of parsing and using content models.

        SAX parsers may return all contiguous whitespace in a single
        chunk, or they may split it into several chunks; however, all
        of the characters in any single event must come from the same
        external entity, so that the Locator provides useful
        information.Nr)rZ
whitespacerrr�ignorableWhitespace�sz"ContentHandler.ignorableWhitespacecCsdS)a�Receive notification of a processing instruction.

        The Parser will invoke this method once for each processing
        instruction found: note that processing instructions may occur
        before or after the main document element.

        A SAX parser should never report an XML declaration (XML 1.0,
        section 2.8) or a text declaration (XML 1.0, section 4.3.1)
        using this method.Nr)r�target�datarrr�processingInstruction�sz$ContentHandler.processingInstructioncCsdS)aReceive notification of a skipped entity.

        The Parser will invoke this method once for each entity
        skipped. Non-validating processors may skip entities if they
        have not seen the declarations (because, for example, the
        entity was declared in an external DTD subset). All processors
        may skip external entities, depending on the values of the
        http://xml.org/sax/features/external-general-entities and the
        http://xml.org/sax/features/external-parameter-entities
        properties.Nrrrrr�
skippedEntity�szContentHandler.skippedEntityN)r
rrr
rrrrrrrrrrr r!r$r%rrrrr/s	
rc@s eZdZdZdd�Zdd�ZdS)�
DTDHandlerz�Handle DTD events.

    This interface specifies only those DTD events required for basic
    parsing (unparsed entities and attributes).cCsdS)z$Handle a notation declaration event.Nr)rr�publicId�systemIdrrr�notationDecl�szDTDHandler.notationDeclcCsdS)z,Handle an unparsed entity declaration event.Nr)rrr'r(Zndatarrr�unparsedEntityDecl�szDTDHandler.unparsedEntityDeclN)r
rrr
r)r*rrrrr&�sr&c@seZdZdZdd�ZdS)�EntityResolvera7Basic interface for resolving entities. If you create an object
    implementing this interface, then register the object with your
    Parser, the parser will call the method in your object to
    resolve all external entities. Note that DefaultHandler implements
    this interface with the default behaviour.cCs|S)z�Resolve the system identifier of an entity and return either
        the system identifier to read from as a string, or an InputSource
        to read from.r)rr'r(rrr�
resolveEntity�szEntityResolver.resolveEntityN)r
rrr
r,rrrrr+�sr+z&http://xml.org/sax/features/namespacesz.http://xml.org/sax/features/namespace-prefixesz,http://xml.org/sax/features/string-interningz&http://xml.org/sax/features/validationz5http://xml.org/sax/features/external-general-entitiesz7http://xml.org/sax/features/external-parameter-entitiesz-http://xml.org/sax/properties/lexical-handlerz1http://xml.org/sax/properties/declaration-handlerz&http://xml.org/sax/properties/dom-nodez(http://xml.org/sax/properties/xml-stringz-http://www.python.org/sax/properties/encodingz3http://www.python.org/sax/properties/interning-dictN)r
�versionrrr&r+Zfeature_namespacesZfeature_namespace_prefixesZfeature_string_interningZfeature_validationZfeature_external_gesZfeature_external_pesZall_featuresZproperty_lexical_handlerZproperty_declaration_handlerZproperty_dom_nodeZproperty_xml_stringZproperty_encodingZproperty_interning_dictZall_propertiesrrrr�<module>s@
"��xml/sax/__pycache__/__init__.cpython-38.opt-1.pyc000064400000006225151153537540015513 0ustar00U

e5d?�@s
dZddlmZddlmZmZddlmZmZm	Z	m
Z
mZe�fdd�Ze�fdd�Z
d	gZd
Zernd
dlZd
dlZd
dlZejjs�dejkr�ejd�d
�Z[dZejdd�dkr�ej�e�r�ej�e��d
�Zddd�Zejdd�dkr�dd�Zndd�Z[dS)a�Simple API for XML (SAX) implementation for Python.

This module provides an implementation of the SAX 2 interface;
information about the Java version of the interface can be found at
http://www.megginson.com/SAX/.  The Python version of the interface is
documented at <...>.

This package contains the following modules:

handler -- Base classes and constants which define the SAX 2 API for
           the 'client-side' of SAX for Python.

saxutils -- Implementation of the convenience classes commonly used to
            work with SAX.

xmlreader -- Base classes and constants which define the SAX 2 API for
             the parsers used with SAX for Python.

expatreader -- Driver that allows use of the Expat parser with SAX.
�)�InputSource)�ContentHandler�ErrorHandler)�SAXException�SAXNotRecognizedException�SAXParseException�SAXNotSupportedException�SAXReaderNotAvailablecCs(t�}|�|�|�|�|�|�dS)N)�make_parser�setContentHandler�setErrorHandler�parse)�source�handler�errorHandler�parser�r�(/usr/lib64/python3.8/xml/sax/__init__.pyr
s

r
cCspddl}|dkrt�}t�}|�|�|�|�t�}t|t�rR|�|�	|��n|�
|�|��|�|�dS)N�)
�iorr
rrr�
isinstance�strZsetCharacterStream�StringIOZ
setByteStream�BytesIOr
)�stringrrrrZinpsrcrrr�parseString#s


rzxml.sax.expatreaderrNZ
PY_SAX_PARSER�,zpython.xml.sax.parser��javarcCsxt|�tD]\}zt|�WStk
rT}zddl}||jkrD�W5d}~XYqtk
rfYqXqtdd��dS)a3Creates and returns a SAX parser.

    Creates the first parser it is able to instantiate of the ones
    given in the iterable created by chaining parser_list and
    default_parser_list.  The iterables must contain the names of Python
    modules containing both a SAX parser and a create_parser function.rNzNo parsers found)�list�default_parser_list�_create_parser�ImportError�sys�modulesr	)Zparser_list�parser_name�er#rrrr
Fs
r
cCs$ddlm}|�|dt��}|��S)Nr)�imp)Zorg.python.corer'Z
importName�globals�
create_parser)r%r'�
drv_modulerrrr!asr!cCst|iidg�}|��S)Nr))�
__import__r))r%r*rrrr!gs)r)�__doc__Z	xmlreaderrrrr�_exceptionsrrrrr	r
rr �_falseZxml.sax.expatreaderZxml�osr#�flags�ignore_environment�environ�splitZ_key�platform�registryZcontainsKeyZgetPropertyr
r!rrrr�<module>s*

xml/sax/__pycache__/xmlreader.cpython-38.opt-2.pyc000064400000024251151153537540015737 0ustar00U

e5d�1�@s�ddlmZddlmZmZGdd�d�ZGdd�de�ZGdd�d�ZGd	d
�d
�ZGdd�d�Z	Gd
d�de	�Z
dd�Zedkr�e�dS)�)�handler)�SAXNotSupportedException�SAXNotRecognizedExceptionc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZdS) �	XMLReadercCs,t��|_t��|_t��|_t��|_dS�N)	rZContentHandler�
_cont_handlerZ
DTDHandler�_dtd_handlerZEntityResolver�_ent_handlerZErrorHandler�_err_handler��self�r
�)/usr/lib64/python3.8/xml/sax/xmlreader.py�__init__s


zXMLReader.__init__cCstd��dS�Nz This method must be implemented!��NotImplementedError�r�sourcer
r
r�parseszXMLReader.parsecCs|jSr�rrr
r
r�getContentHandler"szXMLReader.getContentHandlercCs
||_dSrr�rrr
r
r�setContentHandler&szXMLReader.setContentHandlercCs|jSr�rrr
r
r�
getDTDHandler*szXMLReader.getDTDHandlercCs
||_dSrrrr
r
r�
setDTDHandler.szXMLReader.setDTDHandlercCs|jSr�r	rr
r
r�getEntityResolver2szXMLReader.getEntityResolvercCs
||_dSrr)rZresolverr
r
r�setEntityResolver6szXMLReader.setEntityResolvercCs|jSr�r
rr
r
r�getErrorHandler:szXMLReader.getErrorHandlercCs
||_dSrr rr
r
r�setErrorHandler>szXMLReader.setErrorHandlercCstd��dS)NzLocale support not implemented)r)rZlocaler
r
r�	setLocaleBszXMLReader.setLocalecCstd|��dS�NzFeature '%s' not recognized�r�r�namer
r
r�
getFeatureKszXMLReader.getFeaturecCstd|��dSr$r%)rr'�stater
r
r�
setFeatureOszXMLReader.setFeaturecCstd|��dS�NzProperty '%s' not recognizedr%r&r
r
r�getPropertySszXMLReader.getPropertycCstd|��dSr+r%)rr'�valuer
r
r�setPropertyWszXMLReader.setPropertyN)�__name__�
__module__�__qualname__rrrrrrrrr!r"r#r(r*r,r.r
r
r
rrs
	rc@s>eZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�ZdS)�IncrementalParser�cCs||_t�|�dSr)�_bufsizerr)r�bufsizer
r
rroszIncrementalParser.__init__cCslddlm}|�|�}|�|�|��}|dkr8|��}|�|j�}|r`|�|�|�|j�}qD|�	�dS)Nr)�saxutils)
�r6Zprepare_input_source�
prepareParser�getCharacterStream�
getByteStream�readr4�feed�close)rrr6�file�bufferr
r
rrss


zIncrementalParser.parsecCstd��dSrr)r�datar
r
rr<�szIncrementalParser.feedcCstd��dS)Nz!prepareParser must be overridden!rrr
r
rr8�szIncrementalParser.prepareParsercCstd��dSrrrr
r
rr=�szIncrementalParser.closecCstd��dSrrrr
r
r�reset�szIncrementalParser.resetN)r3)	r/r0r1rrr<r8r=rAr
r
r
rr2[s
	
r2c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�LocatorcCsdS�N���r
rr
r
r�getColumnNumber�szLocator.getColumnNumbercCsdSrCr
rr
r
r�
getLineNumber�szLocator.getLineNumbercCsdSrr
rr
r
r�getPublicId�szLocator.getPublicIdcCsdSrr
rr
r
r�getSystemId�szLocator.getSystemIdN)r/r0r1rErFrGrHr
r
r
rrB�srBc@sfeZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�InputSourceNcCs"||_d|_d|_d|_d|_dSr)�_InputSource__system_id�_InputSource__public_id�_InputSource__encoding�_InputSource__bytefile�_InputSource__charfile�rZ	system_idr
r
rr�s
zInputSource.__init__cCs
||_dSr�rK)rZ	public_idr
r
r�setPublicId�szInputSource.setPublicIdcCs|jSrrPrr
r
rrG�szInputSource.getPublicIdcCs
||_dSr�rJrOr
r
r�setSystemId�szInputSource.setSystemIdcCs|jSrrRrr
r
rrH�szInputSource.getSystemIdcCs
||_dSr�rL)r�encodingr
r
r�setEncoding�szInputSource.setEncodingcCs|jSrrTrr
r
r�getEncoding�szInputSource.getEncodingcCs
||_dSr�rM)rZbytefiler
r
r�
setByteStream�szInputSource.setByteStreamcCs|jSrrXrr
r
rr:�szInputSource.getByteStreamcCs
||_dSr�rN)rZcharfiler
r
r�setCharacterStreamszInputSource.setCharacterStreamcCs|jSrrZrr
r
rr9szInputSource.getCharacterStream)N)r/r0r1rrQrGrSrHrVrWrYr:r[r9r
r
r
rrI�s



rIc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zd$dd�Zdd�Zd d!�Zd"d#�ZdS)%�AttributesImplcCs
||_dSr��_attrs)r�attrsr
r
rrszAttributesImpl.__init__cCs
t|j�Sr��lenr^rr
r
r�	getLengthszAttributesImpl.getLengthcCsdS)NZCDATAr
r&r
r
r�getType!szAttributesImpl.getTypecCs
|j|Srr]r&r
r
r�getValue$szAttributesImpl.getValuecCs
|j|Srr]r&r
r
r�getValueByQName'szAttributesImpl.getValueByQNamecCs||jkrt|��|Sr�r^�KeyErrorr&r
r
r�getNameByQName*s
zAttributesImpl.getNameByQNamecCs||jkrt|��|Srrfr&r
r
r�getQNameByName/s
zAttributesImpl.getQNameByNamecCst|j���Sr��listr^�keysrr
r
r�getNames4szAttributesImpl.getNamescCst|j���Srrjrr
r
r�	getQNames7szAttributesImpl.getQNamescCs
t|j�Srr`rr
r
r�__len__:szAttributesImpl.__len__cCs
|j|Srr]r&r
r
r�__getitem__=szAttributesImpl.__getitem__cCst|j���Srrjrr
r
rrl@szAttributesImpl.keyscCs
||jkSrr]r&r
r
r�__contains__CszAttributesImpl.__contains__NcCs|j�||�Sr)r^�get)rr'�alternativer
r
rrrFszAttributesImpl.getcCs|�|j�Sr)�	__class__r^rr
r
r�copyIszAttributesImpl.copycCst|j���Sr)rkr^�itemsrr
r
rrvLszAttributesImpl.itemscCst|j���Sr)rkr^�valuesrr
r
rrwOszAttributesImpl.values)N)r/r0r1rrbrcrdrerhrirmrnrorprlrqrrrurvrwr
r
r
rr\s"
r\c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�AttributesNSImplcCs||_||_dSr)r^�_qnames)rr_Zqnamesr
r
rrVszAttributesNSImpl.__init__cCs6|j��D]\}}||kr
|j|Sq
t|��dSr)ryrvr^rg�rr'ZnsnameZqnamer
r
rre^sz AttributesNSImpl.getValueByQNamecCs0|j��D]\}}||kr
|Sq
t|��dSr)ryrvrgrzr
r
rrhes
zAttributesNSImpl.getNameByQNamecCs
|j|Sr)ryr&r
r
rrilszAttributesNSImpl.getQNameByNamecCst|j���Sr)rkryrwrr
r
rrnoszAttributesNSImpl.getQNamescCs|�|j|j�Sr)rtr^ryrr
r
rrurszAttributesNSImpl.copyN)	r/r0r1rrerhrirnrur
r
r
rrxTsrxcCst�t�t�dSr)rr2rBr
r
r
r�_testvsr{�__main__N)
r7r�_exceptionsrrrr2rBrIr\rxr{r/r
r
r
r�<module>sPJY>"xml/sax/__pycache__/handler.cpython-38.opt-2.pyc000064400000011055151153537540015367 0ustar00U

e5db6�@s�dZGdd�d�ZGdd�d�ZGdd�d�ZGdd�d�Zd	Zd
ZdZdZd
Z	dZ
eeeee	e
gZdZdZ
dZdZdZdZeee
eeegZdS)z2.0betac@s$eZdZdd�Zdd�Zdd�ZdS)�ErrorHandlercCs|�dS�N���selfZ	exceptionrr�'/usr/lib64/python3.8/xml/sax/handler.py�error szErrorHandler.errorcCs|�dSrrrrrr�
fatalError$szErrorHandler.fatalErrorcCst|�dSr)�printrrrr�warning(szErrorHandler.warningN)�__name__�
__module__�__qualname__rrr
rrrrrs
rc@s|eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)�ContentHandlercCs
d|_dSr�Z_locator�rrrr�__init__6szContentHandler.__init__cCs
||_dSrr)rZlocatorrrr�setDocumentLocator9sz!ContentHandler.setDocumentLocatorcCsdSrrrrrr�
startDocumentPszContentHandler.startDocumentcCsdSrrrrrr�endDocumentWszContentHandler.endDocumentcCsdSrr)r�prefixZurirrr�startPrefixMapping`sz!ContentHandler.startPrefixMappingcCsdSrr)rrrrr�endPrefixMappingwszContentHandler.endPrefixMappingcCsdSrr)r�name�attrsrrr�startElement~szContentHandler.startElementcCsdSrr�rrrrr�
endElement�szContentHandler.endElementcCsdSrr)rr�qnamerrrr�startElementNS�szContentHandler.startElementNScCsdSrr)rrrrrr�endElementNS�szContentHandler.endElementNScCsdSrr)rZcontentrrr�
characters�szContentHandler.characterscCsdSrr)rZ
whitespacerrr�ignorableWhitespace�sz"ContentHandler.ignorableWhitespacecCsdSrr)r�target�datarrr�processingInstruction�sz$ContentHandler.processingInstructioncCsdSrrrrrr�
skippedEntity�szContentHandler.skippedEntityN)rrr
rrrrrrrrrrr r!r$r%rrrrr/s	
rc@seZdZdd�Zdd�ZdS)�
DTDHandlercCsdSrr)rr�publicId�systemIdrrr�notationDecl�szDTDHandler.notationDeclcCsdSrr)rrr'r(Zndatarrr�unparsedEntityDecl�szDTDHandler.unparsedEntityDeclN)rrr
r)r*rrrrr&�sr&c@seZdZdd�ZdS)�EntityResolvercCs|Srr)rr'r(rrr�
resolveEntity�szEntityResolver.resolveEntityN)rrr
r,rrrrr+�sr+z&http://xml.org/sax/features/namespacesz.http://xml.org/sax/features/namespace-prefixesz,http://xml.org/sax/features/string-interningz&http://xml.org/sax/features/validationz5http://xml.org/sax/features/external-general-entitiesz7http://xml.org/sax/features/external-parameter-entitiesz-http://xml.org/sax/properties/lexical-handlerz1http://xml.org/sax/properties/declaration-handlerz&http://xml.org/sax/properties/dom-nodez(http://xml.org/sax/properties/xml-stringz-http://www.python.org/sax/properties/encodingz3http://www.python.org/sax/properties/interning-dictN)�versionrrr&r+Zfeature_namespacesZfeature_namespace_prefixesZfeature_string_interningZfeature_validationZfeature_external_gesZfeature_external_pesZall_featuresZproperty_lexical_handlerZproperty_declaration_handlerZproperty_dom_nodeZproperty_xml_stringZproperty_encodingZproperty_interning_dictZall_propertiesrrrr�<module>s>
"��xml/sax/__pycache__/expatreader.cpython-38.opt-2.pyc000064400000027466151153537540016273 0ustar00U

e5dX=�@s�dZddlTddlmZmZddlmZddlmZmZddlmZddlm	Z	m
Z
ddlZejdd	�d
krxe
dd��[zddlmZWnek
r�e
d
d��YnXeed�s�e
d
d��ddlmZmZmZejZejZzddlZWnek
�rdd�ZYnXddlZejZ[[Gdd�d�ZGdd�dej�ZGdd�dejej�Z dd�Z!e"dk�r�ddl#Z$e!�Z%e%�&e$j'j�(��e%�)e$j'�*��e%�+d�dS)z0.20�)�*)�feature_validation�feature_namespaces)�feature_namespace_prefixes)�feature_external_ges�feature_external_pes)�feature_string_interning)�property_xml_string�property_interning_dictN��javazexpat not available in Java)�expatzexpat not supported�ParserCreate)�	xmlreader�saxutils�handlercCs|S�N�)�orr�+/usr/lib64/python3.8/xml/sax/expatreader.py�_mkproxy'src@seZdZdS)�
_ClosedParserN)�__name__�
__module__�__qualname__rrrrr.src@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�ExpatLocatorcCst|�|_dSr)r�_ref��self�parserrrr�__init__9szExpatLocator.__init__cCs|j}|jdkrdS|jjSr)r�_parser�ErrorColumnNumberrrrr�getColumnNumber<s
zExpatLocator.getColumnNumbercCs|j}|jdkrdS|jjS�N�)rr!�ErrorLineNumberrrrr�
getLineNumberBs
zExpatLocator.getLineNumbercCs|j}|dkrdS|j��Sr)r�_source�getPublicIdrrrrr)HszExpatLocator.getPublicIdcCs|j}|dkrdS|j��Sr)rr(�getSystemIdrrrrr*NszExpatLocator.getSystemIdN)rrrr r#r'r)r*rrrrr3s
rc@seZdZdBdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dCdd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Zd=d>�Z d?d@�Z!dAS)D�ExpatParserr��cCsFtj�||�t��|_d|_||_d|_d|_g|_	d|_
d|_dS)Nr)r�IncrementalParserr ZInputSourcer(r!�_namespaces�_lex_handler_prop�_parsing�
_entity_stack�
_external_ges�
_interning)rZnamespaceHandling�bufsizerrrr Zs
zExpatParser.__init__cCsVt�|�}||_z*|��|j�t|��tj�	||�Wn|�
��YnXdSr)r�prepare_input_sourcer(�reset�
_cont_handlerZsetDocumentLocatorrrr-�parse�
_close_source�r�sourcerrrr8gs
zExpatParser.parsecCs |��dk	r|j�|���dSr)r*r!ZSetBaser:rrr�
prepareParserwszExpatParser.prepareParsercCs tj�||�|jr|��dSr)rr-�setContentHandlerr0�_reset_cont_handler)rrrrrr=}szExpatParser.setContentHandlercCsP|tkr|jS|tkr |jdk	S|tttfkr2dS|tkr@|jSt	d|��dS)Nr�Feature '%s' not recognized)
rr.rr3rrrrr2�SAXNotRecognizedException�r�namerrr�
getFeature�s
�zExpatParser.getFeaturecCs�|jrtd��|tkr||_n�|tkr.||_nt|tkrT|rL|jdkrRi|_q�d|_nN|tkrj|r�td��n8|t	kr�|r�td��n"|t
kr�|r�td��ntd|��dS)Nz!Cannot set features while parsingz!expat does not support validationz/expat does not read external parameter entitiesz(expat does not report namespace prefixesr?)r0�SAXNotSupportedExceptionrr.rr2rr3rrrr@)rrB�staterrr�
setFeature�s:
����zExpatParser.setFeaturecCsd|tjkr|jS|tkr|jS|tkrT|jrLt|jd�rB|j��St	d��nt
d��t	d|��dS)N�GetInputContextz=This version of expat does not support getting the XML stringz.XML string cannot be returned when not parsing�Property '%s' not recognized)r�property_lexical_handlerr/r
r3r	r!�hasattrrGr@rDrArrr�getProperty�s

��zExpatParser.getPropertycCsV|tjkr ||_|jrR|��n2|tkr0||_n"|tkrFtd|��nt	d|��dS)NzProperty '%s' cannot be setrH)
rrIr/r0�_reset_lex_handler_propr
r3r	rDr@)rrB�valuerrr�setProperty�s

��zExpatParser.setPropertyc
Csz|js|��d|_|j��z|j�||�WnDtjk
rt}z$tt�	|j
�||�}|j�|�W5d}~XYnXdSr$)
r0r6r7Z
startDocumentr!ZParser
�errorZSAXParseExceptionZErrorString�codeZ_err_handlerZ
fatalError)r�data�isFinal�e�excrrr�feed�s
zExpatParser.feedcCsB|j}z|��}|dk	r |��W5|��}|dk	r<|��XdSr)r(Z
getByteStream�closeZgetCharacterStream)rr;�filerrrr9�szExpatParser._close_sourcecCs�|js|jdkst|jt�r dSz(|jddd�|j	�
�d|_d|_W5d|_|jdk	rzt�}|jj|_|jj|_||_|��XdS)Nr�r%)rR)r1r!�
isinstancerr0r"r&r9rUr7ZendDocumentrrrrrV�s 
�




zExpatParser.closecCs|jj|j_|jj|j_dSr)r7�processingInstructionr!ZProcessingInstructionHandler�
charactersZCharacterDataHandler�rrrrr>�s�zExpatParser._reset_cont_handlercCs`|j}|j}|dkr4d|_d|_d|_d|_d|_n(|j|_|j|_|j	|_|j
|_|j|_dSr)r/r!ZCommentHandlerZStartCdataSectionHandlerZEndCdataSectionHandlerZStartDoctypeDeclHandlerZEndDoctypeDeclHandlerZcommentZ
startCDATAZendCDATA�start_doctype_declZendDTD)rZlexrrrrrLsz#ExpatParser._reset_lex_handler_propcCs�|jr>tj|j��d|jd�|_d|j_|j|j_	|j
|j_n,tj|j��|jd�|_|j|j_	|j
|j_|��|j|j_|j|j_|j|j_|j|j_d|_|jr�|��|j|j_z|j|j_Wntk
r�YnX|j�tj �d|_!g|_"dS)N� )�internr%r)#r.r
rr(ZgetEncodingr3r!Znamespace_prefixes�start_element_nsZStartElementHandler�end_element_nsZEndElementHandler�
start_element�end_elementr>�unparsed_entity_declZUnparsedEntityDeclHandler�
notation_declZNotationDeclHandler�start_namespace_declZStartNamespaceDeclHandler�end_namespace_declZEndNamespaceDeclHandlerZ_decl_handler_propr/rL�external_entity_refZExternalEntityRefHandler�skipped_entity_handlerZSkippedEntityHandler�AttributeErrorZSetParamEntityParsingZ*XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONEr0r1r\rrrr6s<�
�






�zExpatParser.resetcCs|jdkrdS|jjSr)r!r"r\rrrr#;s
zExpatParser.getColumnNumbercCs|jdkrdS|jjSr$)r!r&r\rrrr'@s
zExpatParser.getLineNumbercCs
|j��Sr)r(r)r\rrrr)EszExpatParser.getPublicIdcCs
|j��Sr)r(r*r\rrrr*HszExpatParser.getSystemIdcCs|j�|t|��dSr)r7ZstartElement�AttributesImpl)rrB�attrsrrrrbLszExpatParser.start_elementcCs|j�|�dSr)r7Z
endElementrArrrrcOszExpatParser.end_elementcCs�|��}t|�dkrd|f}n&t|�dkr<|d|df}nt|�}i}i}|��D]|\}}|��}t|�}	|	dkr�|}
d|f}n>|	dkr�d|d|df}
|d|df}n|d}
t|�}|||<|
||<qT|j�|dt||��dS)Nr%�rz%s:%s�)�split�len�tuple�itemsr7ZstartElementNS�AttributesNSImpl)rrBrl�pairZnewattrsZqnamesZanamerM�partsZlengthZqnameZapairrrrr`Rs0



�zExpatParser.start_element_nscCsV|��}t|�dkrd|f}n&t|�dkr<|d|df}nt|�}|j�|d�dS)Nr%rmr)rorprqr7ZendElementNS)rrBrtrrrrats
zExpatParser.end_element_nscCs|j�||�dSr)r7rZ)r�targetrQrrr�processing_instruction�sz"ExpatParser.processing_instructioncCs|j�|�dSr)r7r[)rrQrrr�character_data�szExpatParser.character_datacCs|j�||�dSr)r7ZstartPrefixMapping)r�prefixZurirrrrf�sz ExpatParser.start_namespace_declcCs|j�|�dSr)r7ZendPrefixMapping)rryrrrrg�szExpatParser.end_namespace_declcCs|j�|||�dSr)r/ZstartDTD)rrB�sysid�pubidZhas_internal_subsetrrrr]�szExpatParser.start_doctype_declcCs|j�||||�dSr)�_dtd_handlerZunparsedEntityDecl)rrB�baserzr{Z
notation_namerrrrd�sz ExpatParser.unparsed_entity_declcCs|j�|||�dSr)r|ZnotationDecl)rrBr}rzr{rrrre�szExpatParser.notation_declcCs�|js
dS|j�||�}t�||j��p*d�}|j�|j	|jf�|j	�
|�|_	||_ztj�
||�WnYdSX|jd\|_	|_|jd=dS)Nr%rXr���)r2Z_ent_handlerZ
resolveEntityrr5r(r*r1�appendr!ZExternalEntityParserCreaterr-r8)r�contextr}rzr{r;rrrrh�s"
�zExpatParser.external_entity_refcCs|rd|}|j�|�dS)N�%)r7Z
skippedEntity)rrBZis_perrrri�sz"ExpatParser.skipped_entity_handlerN)rr,)r)"rrrr r8r<r=rCrFrKrNrUr9rVr>rLr6r#r'r)r*rbrcr`rarwrxrfrgr]rdrerhrirrrrr+Ws>


'"r+cOs
t||�Sr)r+)�args�kwargsrrr�
create_parser�sr��__main__z:http://www.ibiblio.org/xml/examples/shakespeare/hamlet.xml),�versionZxml.sax._exceptionsZxml.sax.handlerrrrrrrr	r
�sys�platformZSAXReaderNotAvailableZxml.parsersr
�ImportErrorrJZxml.saxrrrrkrs�_weakrefr�weakref�proxyrZLocatorrr-r+r�rZxml.sax.saxutilsZxml�pr=ZsaxZXMLGeneratorZsetErrorHandlerZErrorHandlerr8rrrr�<module>sL


$_
xml/sax/__pycache__/saxutils.cpython-38.opt-2.pyc000064400000026002151153537540015624 0ustar00U

e5d�/�@s�ddlZddlZddlZddlZddlZddlmZddlmZdd�Z	ifdd�Z
ifd	d
�Zifdd�Zd
d�Z
Gdd�dej�ZGdd�dej�Zddd�ZdS)�N�)�handler)�	xmlreadercCs"|��D]\}}|�||�}q|S�N)�items�replace)�s�d�key�value�r�(/usr/lib64/python3.8/xml/sax/saxutils.py�__dict_replacesrcCs6|�dd�}|�dd�}|�dd�}|r2t||�}|S)N�&�&amp;�>�&gt;�<�&lt;�rr��dataZentitiesrrr
�escapes	
rcCs2|�dd�}|�dd�}|r&t||�}|�dd�S)Nrrrrrrrrrrr
�unescape"s

rcCsR|dddd��}t||�}d|krFd|kr<d|�dd�}qNd	|}nd|}|S)
Nz&#10;z&#13;z&#9;)�
�
�	�"�'z"%s"z&quot;z'%s')rrrrrr
�	quoteattr0s

rcs��dkrddl}|jSt�tj�r&�St�tjtjf�r<�St�tj�rlG�fdd�d�}|�}dd�|_	nDt�
�}dd�|_�j|_z�j
|_
�j|_Wntk
r�YnXtj||ddd	d
�S)NrcseZdZ�jZ�fdd�ZdS)z _gettextwriter.<locals>._wrappercs
t�|�Sr)�getattr��self�name��outrr
�__getattr__Zsz,_gettextwriter.<locals>._wrapper.__getattr__N)�__name__�
__module__�__qualname__�	__class__r&rr$rr
�_wrapperXsr+cSsdSrrrrrr
�<lambda>]�z _gettextwriter.<locals>.<lambda>cSsdS)NTrrrrr
r,br-�xmlcharrefreplacerT)�encoding�errors�newline�
write_through)�sys�stdout�
isinstance�io�
TextIOBase�codecs�StreamWriter�StreamReaderWriter�	RawIOBase�close�BufferedIOBase�writable�write�seekable�tell�AttributeError�
TextIOWrapper)r%r/r3r+�bufferrr$r
�_gettextwriterGs0
�rEc@s�eZdZd dd�Zdd�Zd!dd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)"�XMLGeneratorN�
iso-8859-1FcCsVtj�|�t||�}|j|_|j|_ig|_|jd|_	g|_
||_||_d|_
dS)N���F)r�ContentHandler�__init__rEr?�_write�flush�_flush�_ns_contexts�_current_context�_undeclared_ns_maps�	_encoding�_short_empty_elements�_pending_start_element)r"r%r/Zshort_empty_elementsrrr
rJrs
zXMLGenerator.__init__cCsJ|drBd|dkr d|dS|j|d}|rB|d|dS|dS)Nrz$http://www.w3.org/XML/1998/namespacezxml:r�:)rO)r"r#�prefixrrr
�_qname~szXMLGenerator._qnamecCs|jr|�d�d|_dS)NrF�rSrK)r"�
endElementrrr
�_finish_pending_start_element�s
z*XMLGenerator._finish_pending_start_elementcCs|�d|j�dS)Nz$<?xml version="1.0" encoding="%s"?>
)rKrQ�r"rrr
�
startDocument�s�zXMLGenerator.startDocumentcCs|��dSr)rMrZrrr
�endDocument�szXMLGenerator.endDocumentcCs0|j�|j���||j|<|j�||f�dSr)rN�appendrO�copyrP�r"rU�urirrr
�startPrefixMapping�s
zXMLGenerator.startPrefixMappingcCs|jd|_|jd=dS)NrH)rNrO�r"rUrrr
�endPrefixMapping�szXMLGenerator.endPrefixMappingcCsZ|��|�d|�|��D]\}}|�d|t|�f�q|jrLd|_n
|�d�dS)Nr� %s=%sTr)rYrKrrrRrS)r"r#�attrsrrrr
�startElement�szXMLGenerator.startElementcCs*|jr|�d�d|_n|�d|�dS�Nz/>Fz</%s>rWr!rrr
rX�s
zXMLGenerator.endElementcCs�|��|�d|�|��|jD].\}}|rB|�d||f�q"|�d|�q"g|_|��D]$\}}|�d|�|�t|�f�q`|jr�d|_n
|�d�dS)Nrz xmlns:%s="%s"z xmlns="%s"rdTr)rYrKrVrPrrrRrS)r"r#�qnamererUr`rrrr
�startElementNS�szXMLGenerator.startElementNScCs0|jr|�d�d|_n|�d|�|��dSrg)rSrKrV�r"r#rhrrr
�endElementNS�s
zXMLGenerator.endElementNScCs4|r0|��t|t�s"t||j�}|�t|��dSr)rYr5�strrQrKr�r"Zcontentrrr
�
characters�s

zXMLGenerator.characterscCs0|r,|��t|t�s"t||j�}|�|�dSr)rYr5rlrQrKrmrrr
�ignorableWhitespace�s

z XMLGenerator.ignorableWhitespacecCs|��|�d||f�dS)Nz	<?%s %s?>)rYrK�r"�targetrrrr
�processingInstruction�sz"XMLGenerator.processingInstruction)NrGF)F)r'r(r)rJrVrYr[r\rarcrfrXrirkrnrorrrrrr
rFps


rFc@s�eZdZd:dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�ZdS);�
XMLFilterBaseNcCstj�|�||_dSr)r�	XMLReaderrJ�_parent�r"�parentrrr
rJ�szXMLFilterBase.__init__cCs|j�|�dSr)�_err_handler�error�r"Z	exceptionrrr
ry�szXMLFilterBase.errorcCs|j�|�dSr)rx�
fatalErrorrzrrr
r{�szXMLFilterBase.fatalErrorcCs|j�|�dSr)rx�warningrzrrr
r|�szXMLFilterBase.warningcCs|j�|�dSr)�
_cont_handler�setDocumentLocator)r"Zlocatorrrr
r~�sz XMLFilterBase.setDocumentLocatorcCs|j��dSr)r}r[rZrrr
r[�szXMLFilterBase.startDocumentcCs|j��dSr)r}r\rZrrr
r\szXMLFilterBase.endDocumentcCs|j�||�dSr)r}rar_rrr
rasz XMLFilterBase.startPrefixMappingcCs|j�|�dSr)r}rcrbrrr
rcszXMLFilterBase.endPrefixMappingcCs|j�||�dSr)r}rf)r"r#rerrr
rfszXMLFilterBase.startElementcCs|j�|�dSr)r}rXr!rrr
rXszXMLFilterBase.endElementcCs|j�|||�dSr)r}ri)r"r#rhrerrr
riszXMLFilterBase.startElementNScCs|j�||�dSr)r}rkrjrrr
rkszXMLFilterBase.endElementNScCs|j�|�dSr)r}rnrmrrr
rnszXMLFilterBase.characterscCs|j�|�dSr)r}ro)r"�charsrrr
rosz!XMLFilterBase.ignorableWhitespacecCs|j�||�dSr)r}rrrprrr
rrsz#XMLFilterBase.processingInstructioncCs|j�|�dSr)r}�
skippedEntityr!rrr
r� szXMLFilterBase.skippedEntitycCs|j�|||�dSr)�_dtd_handler�notationDecl)r"r#�publicId�systemIdrrr
r�%szXMLFilterBase.notationDeclcCs|j�||||�dSr)r��unparsedEntityDecl)r"r#r�r�Zndatarrr
r�(sz XMLFilterBase.unparsedEntityDeclcCs|j�||�Sr)Z_ent_handler�
resolveEntity)r"r�r�rrr
r�-szXMLFilterBase.resolveEntitycCs@|j�|�|j�|�|j�|�|j�|�|j�|�dSr)ruZsetContentHandlerZsetErrorHandlerZsetEntityResolverZ
setDTDHandler�parse)r"�sourcerrr
r�2s
zXMLFilterBase.parsecCs|j�|�dSr)ru�	setLocale)r"Zlocalerrr
r�9szXMLFilterBase.setLocalecCs|j�|�Sr)ru�
getFeaturer!rrr
r�<szXMLFilterBase.getFeaturecCs|j�||�dSr)ru�
setFeature)r"r#�staterrr
r�?szXMLFilterBase.setFeaturecCs|j�|�Sr)ru�getPropertyr!rrr
r�BszXMLFilterBase.getPropertycCs|j�||�dSr)ru�setProperty)r"r#rrrr
r�EszXMLFilterBase.setPropertycCs|jSr�rurZrrr
�	getParentJszXMLFilterBase.getParentcCs
||_dSrr�rvrrr
�	setParentMszXMLFilterBase.setParent)N)r'r(r)rJryr{r|r~r[r\rarcrfrXrirkrnrorrr�r�r�r�r�r�r�r�r�r�r�r�rrrr
rs�s8
rs�cCs$t|tj�rt�|�}t|t�r,t�|�}n^t|d�r�|}t��}t|�d�t�r^|�	|�n
|�
|�t|d�r�t|jt�r�|�|j�|�
�dk�r |��dk�r |��}tj�tj�|��}tj�||�}tj�|�r�|�|�t|d�}n$|�tj�||��tj�|���}|�
|�|S)N�readrr#�rb)r5�os�PathLike�fspathrlrZInputSource�hasattrr�ZsetCharacterStreamZ
setByteStreamr#ZsetSystemIdZgetCharacterStreamZ
getByteStreamZgetSystemId�path�dirname�normpath�join�isfile�open�urllibr�ZurljoinZrequestZurlopen)r��base�fZsysidZbaseheadZ
sysidfilenamerrr
�prepare_input_sourceRs.





r�)r�)r�Zurllib.parser�Zurllib.requestr6r8r�rrrrrrrErIrFrtrsr�rrrr
�<module>s)soxml/sax/__pycache__/xmlreader.cpython-38.pyc000064400000040716151153537540015003 0ustar00U

e5d�1�@s�dZddlmZddlmZmZGdd�d�ZGdd�de�ZGdd	�d	�ZGd
d�d�Z	Gdd
�d
�Z
Gdd�de
�Zdd�Ze
dkr�e�dS)z]An XML Reader is the SAX 2 name for an XML parser. XML Parsers
should be based on this code. �)�handler)�SAXNotSupportedException�SAXNotRecognizedExceptionc@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd S)!�	XMLReadera%Interface for reading an XML document using callbacks.

    XMLReader is the interface that an XML parser's SAX2 driver must
    implement. This interface allows an application to set and query
    features and properties in the parser, to register event handlers
    for document processing, and to initiate a document parse.

    All SAX interfaces are assumed to be synchronous: the parse
    methods must not return until parsing is complete, and readers
    must wait for an event-handler callback to return before reporting
    the next event.cCs,t��|_t��|_t��|_t��|_dS�N)	rZContentHandler�
_cont_handlerZ
DTDHandler�_dtd_handlerZEntityResolver�_ent_handlerZErrorHandler�_err_handler��self�r
�)/usr/lib64/python3.8/xml/sax/xmlreader.py�__init__s


zXMLReader.__init__cCstd��dS)zAParse an XML document from a system identifier or an InputSource.� This method must be implemented!N��NotImplementedError�r�sourcer
r
r�parseszXMLReader.parsecCs|jS)z#Returns the current ContentHandler.�rrr
r
r�getContentHandler"szXMLReader.getContentHandlercCs
||_dS)z:Registers a new object to receive document content events.Nr�rrr
r
r�setContentHandler&szXMLReader.setContentHandlercCs|jS)z Returns the current DTD handler.�rrr
r
r�
getDTDHandler*szXMLReader.getDTDHandlercCs
||_dS)z7Register an object to receive basic DTD-related events.Nrrr
r
r�
setDTDHandler.szXMLReader.setDTDHandlercCs|jS)z#Returns the current EntityResolver.�r	rr
r
r�getEntityResolver2szXMLReader.getEntityResolvercCs
||_dS)z0Register an object to resolve external entities.Nr)rZresolverr
r
r�setEntityResolver6szXMLReader.setEntityResolvercCs|jS)z!Returns the current ErrorHandler.�r
rr
r
r�getErrorHandler:szXMLReader.getErrorHandlercCs
||_dS)z3Register an object to receive error-message events.Nr rr
r
r�setErrorHandler>szXMLReader.setErrorHandlercCstd��dS)aHAllow an application to set the locale for errors and warnings.

        SAX parsers are not required to provide localization for errors
        and warnings; if they cannot support the requested locale,
        however, they must raise a SAX exception. Applications may
        request a locale change in the middle of a parse.zLocale support not implementedN)r)rZlocaler
r
r�	setLocaleBszXMLReader.setLocalecCstd|��dS)z1Looks up and returns the state of a SAX2 feature.�Feature '%s' not recognizedN�r�r�namer
r
r�
getFeatureKszXMLReader.getFeaturecCstd|��dS)z!Sets the state of a SAX2 feature.r$Nr%)rr'�stater
r
r�
setFeatureOszXMLReader.setFeaturecCstd|��dS)z2Looks up and returns the value of a SAX2 property.�Property '%s' not recognizedNr%r&r
r
r�getPropertySszXMLReader.getPropertycCstd|��dS)z"Sets the value of a SAX2 property.r+Nr%)rr'�valuer
r
r�setPropertyWszXMLReader.setPropertyN)�__name__�
__module__�__qualname__�__doc__rrrrrrrrr!r"r#r(r*r,r.r
r
r
rrs 	rc@sBeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�IncrementalParserasThis interface adds three extra methods to the XMLReader
    interface that allow XML parsers to support incremental
    parsing. Support for this interface is optional, since not all
    underlying XML parsers support this functionality.

    When the parser is instantiated it is ready to begin accepting
    data from the feed method immediately. After parsing has been
    finished with a call to close the reset method must be called to
    make the parser ready to accept new data, either from feed or
    using the parse method.

    Note that these methods must _not_ be called during parsing, that
    is, after parse has been called and before it returns.

    By default, the class also implements the parse method of the XMLReader
    interface using the feed, close and reset methods of the
    IncrementalParser interface as a convenience to SAX 2.0 driver
    writers.�cCs||_t�|�dSr)�_bufsizerr)r�bufsizer
r
rroszIncrementalParser.__init__cCslddlm}|�|�}|�|�|��}|dkr8|��}|�|j�}|r`|�|�|�|j�}qD|�	�dS)Nr)�saxutils)
�r7Zprepare_input_source�
prepareParser�getCharacterStream�
getByteStream�readr5�feed�close)rrr7�file�bufferr
r
rrss


zIncrementalParser.parsecCstd��dS)aThis method gives the raw XML data in the data parameter to
        the parser and makes it parse the data, emitting the
        corresponding events. It is allowed for XML constructs to be
        split across several calls to feed.

        feed may raise SAXException.rNr)r�datar
r
rr=�szIncrementalParser.feedcCstd��dS)ztThis method is called by the parse implementation to allow
        the SAX 2.0 driver to prepare itself for parsing.z!prepareParser must be overridden!Nrrr
r
rr9�szIncrementalParser.prepareParsercCstd��dS)a�This method is called when the entire XML document has been
        passed to the parser through the feed method, to notify the
        parser that there are no more data. This allows the parser to
        do the final checks on the document and empty the internal
        data buffer.

        The parser will not be ready to parse another document until
        the reset method has been called.

        close may raise SAXException.rNrrr
r
rr>�szIncrementalParser.closecCstd��dS)z�This method is called after close has been called to reset
        the parser so that it is ready to parse new documents. The
        results of calling parse or feed after close without calling
        reset are undefined.rNrrr
r
r�reset�szIncrementalParser.resetN)r4)
r/r0r1r2rrr=r9r>rBr
r
r
rr3[s
	
r3c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�Locatorz�Interface for associating a SAX event with a document
    location. A locator object will return valid results only during
    calls to DocumentHandler methods; at any other time, the
    results are unpredictable.cCsdS)z6Return the column number where the current event ends.���r
rr
r
r�getColumnNumber�szLocator.getColumnNumbercCsdS)z4Return the line number where the current event ends.rDr
rr
r
r�
getLineNumber�szLocator.getLineNumbercCsdS)z3Return the public identifier for the current event.Nr
rr
r
r�getPublicId�szLocator.getPublicIdcCsdS)z3Return the system identifier for the current event.Nr
rr
r
r�getSystemId�szLocator.getSystemIdN)r/r0r1r2rErFrGrHr
r
r
rrC�s
rCc@sjeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�InputSourceanEncapsulation of the information needed by the XMLReader to
    read entities.

    This class may include information about the public identifier,
    system identifier, byte stream (possibly with character encoding
    information) and/or the character stream of an entity.

    Applications will create objects of this class for use in the
    XMLReader.parse method and for returning from
    EntityResolver.resolveEntity.

    An InputSource belongs to the application, the XMLReader is not
    allowed to modify InputSource objects passed to it from the
    application, although it may make copies and modify those.NcCs"||_d|_d|_d|_d|_dSr)�_InputSource__system_id�_InputSource__public_id�_InputSource__encoding�_InputSource__bytefile�_InputSource__charfile�rZ	system_idr
r
rr�s
zInputSource.__init__cCs
||_dS)z/Sets the public identifier of this InputSource.N�rK)rZ	public_idr
r
r�setPublicId�szInputSource.setPublicIdcCs|jS)z2Returns the public identifier of this InputSource.rPrr
r
rrG�szInputSource.getPublicIdcCs
||_dS)z/Sets the system identifier of this InputSource.N�rJrOr
r
r�setSystemId�szInputSource.setSystemIdcCs|jS)z2Returns the system identifier of this InputSource.rRrr
r
rrH�szInputSource.getSystemIdcCs
||_dS)a4Sets the character encoding of this InputSource.

        The encoding must be a string acceptable for an XML encoding
        declaration (see section 4.3.3 of the XML recommendation).

        The encoding attribute of the InputSource is ignored if the
        InputSource also contains a character stream.N�rL)r�encodingr
r
r�setEncoding�szInputSource.setEncodingcCs|jS)z/Get the character encoding of this InputSource.rTrr
r
r�getEncoding�szInputSource.getEncodingcCs
||_dS)a�Set the byte stream (a Python file-like object which does
        not perform byte-to-character conversion) for this input
        source.

        The SAX parser will ignore this if there is also a character
        stream specified, but it will use a byte stream in preference
        to opening a URI connection itself.

        If the application knows the character encoding of the byte
        stream, it should set it with the setEncoding method.N�rM)rZbytefiler
r
r�
setByteStream�szInputSource.setByteStreamcCs|jS)z�Get the byte stream for this input source.

        The getEncoding method will return the character encoding for
        this byte stream, or None if unknown.rXrr
r
rr;�szInputSource.getByteStreamcCs
||_dS)a^Set the character stream for this input source. (The stream
        must be a Python 2.0 Unicode-wrapped file-like that performs
        conversion to Unicode strings.)

        If there is a character stream specified, the SAX parser will
        ignore any byte stream and will not attempt to open a URI
        connection to the system identifier.N�rN)rZcharfiler
r
r�setCharacterStreamszInputSource.setCharacterStreamcCs|jS)z/Get the character stream for this input source.rZrr
r
rr:szInputSource.getCharacterStream)N)r/r0r1r2rrQrGrSrHrVrWrYr;r[r:r
r
r
rrI�s



rIc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zd$dd�Zdd�Zd d!�Zd"d#�ZdS)%�AttributesImplcCs
||_dS)zQNon-NS-aware implementation.

        attrs should be of the form {name : value}.N��_attrs)r�attrsr
r
rrszAttributesImpl.__init__cCs
t|j�Sr��lenr^rr
r
r�	getLengthszAttributesImpl.getLengthcCsdS)NZCDATAr
r&r
r
r�getType!szAttributesImpl.getTypecCs
|j|Srr]r&r
r
r�getValue$szAttributesImpl.getValuecCs
|j|Srr]r&r
r
r�getValueByQName'szAttributesImpl.getValueByQNamecCs||jkrt|��|Sr�r^�KeyErrorr&r
r
r�getNameByQName*s
zAttributesImpl.getNameByQNamecCs||jkrt|��|Srrfr&r
r
r�getQNameByName/s
zAttributesImpl.getQNameByNamecCst|j���Sr��listr^�keysrr
r
r�getNames4szAttributesImpl.getNamescCst|j���Srrjrr
r
r�	getQNames7szAttributesImpl.getQNamescCs
t|j�Srr`rr
r
r�__len__:szAttributesImpl.__len__cCs
|j|Srr]r&r
r
r�__getitem__=szAttributesImpl.__getitem__cCst|j���Srrjrr
r
rrl@szAttributesImpl.keyscCs
||jkSrr]r&r
r
r�__contains__CszAttributesImpl.__contains__NcCs|j�||�Sr)r^�get)rr'�alternativer
r
rrrFszAttributesImpl.getcCs|�|j�Sr)�	__class__r^rr
r
r�copyIszAttributesImpl.copycCst|j���Sr)rkr^�itemsrr
r
rrvLszAttributesImpl.itemscCst|j���Sr)rkr^�valuesrr
r
rrwOszAttributesImpl.values)N)r/r0r1rrbrcrdrerhrirmrnrorprlrqrrrurvrwr
r
r
rr\s"
r\c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�AttributesNSImplcCs||_||_dS)z�NS-aware implementation.

        attrs should be of the form {(ns_uri, lname): value, ...}.
        qnames of the form {(ns_uri, lname): qname, ...}.N)r^�_qnames)rr_Zqnamesr
r
rrVszAttributesNSImpl.__init__cCs6|j��D]\}}||kr
|j|Sq
t|��dSr)ryrvr^rg�rr'ZnsnameZqnamer
r
rre^sz AttributesNSImpl.getValueByQNamecCs0|j��D]\}}||kr
|Sq
t|��dSr)ryrvrgrzr
r
rrhes
zAttributesNSImpl.getNameByQNamecCs
|j|Sr)ryr&r
r
rrilszAttributesNSImpl.getQNameByNamecCst|j���Sr)rkryrwrr
r
rrnoszAttributesNSImpl.getQNamescCs|�|j|j�Sr)rtr^ryrr
r
rrurszAttributesNSImpl.copyN)	r/r0r1rrerhrirnrur
r
r
rrxTsrxcCst�t�t�dSr)rr3rCr
r
r
r�_testvsr{�__main__N)r2r8r�_exceptionsrrrr3rCrIr\rxr{r/r
r
r
r�<module>sPJY>"xml/sax/__pycache__/handler.cpython-38.opt-1.pyc000064400000030210151153537540015360 0ustar00U

e5db6�@s�dZdZGdd�d�ZGdd�d�ZGdd�d�ZGdd	�d	�Zd
ZdZdZd
Z	dZ
dZeeee	e
egZdZ
dZdZdZdZdZe
eeeeegZdS)a0
This module contains the core classes of version 2.0 of SAX for Python.
This file provides only default classes with absolutely minimum
functionality, from which drivers and applications can be subclassed.

Many of these classes are empty and are included only as documentation
of the interfaces.

$Id$
z2.0betac@s(eZdZdZdd�Zdd�Zdd�ZdS)	�ErrorHandlera�Basic interface for SAX error handlers.

    If you create an object that implements this interface, then
    register the object with your XMLReader, the parser will call the
    methods in your object to report all warnings and errors. There
    are three levels of errors available: warnings, (possibly)
    recoverable errors, and unrecoverable errors. All methods take a
    SAXParseException as the only parameter.cCs|�dS)zHandle a recoverable error.N���selfZ	exceptionrr�'/usr/lib64/python3.8/xml/sax/handler.py�error szErrorHandler.errorcCs|�dS)zHandle a non-recoverable error.Nrrrrr�
fatalError$szErrorHandler.fatalErrorcCst|�dS)zHandle a warning.N)�printrrrr�warning(szErrorHandler.warningN)�__name__�
__module__�__qualname__�__doc__rrr	rrrrrs	rc@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZdS)�ContentHandlerz�Interface for receiving logical document content events.

    This is the main callback interface in SAX, and the one most
    important to applications. The order of events in this interface
    mirrors the order of the information in the document.cCs
d|_dS)N�Z_locator�rrrr�__init__6szContentHandler.__init__cCs
||_dS)a#Called by the parser to give the application a locator for
        locating the origin of document events.

        SAX parsers are strongly encouraged (though not absolutely
        required) to supply a locator: if it does so, it must supply
        the locator to the application by invoking this method before
        invoking any of the other methods in the DocumentHandler
        interface.

        The locator allows the application to determine the end
        position of any document-related event, even if the parser is
        not reporting an error. Typically, the application will use
        this information for reporting its own errors (such as
        character content that does not match an application's
        business rules). The information returned by the locator is
        probably not sufficient for use with a search engine.

        Note that the locator will return correct information only
        during the invocation of the events in this interface. The
        application should not attempt to use it at any other time.Nr)rZlocatorrrr�setDocumentLocator9sz!ContentHandler.setDocumentLocatorcCsdS)z�Receive notification of the beginning of a document.

        The SAX parser will invoke this method only once, before any
        other methods in this interface or in DTDHandler (except for
        setDocumentLocator).Nrrrrr�
startDocumentPszContentHandler.startDocumentcCsdS)aQReceive notification of the end of a document.

        The SAX parser will invoke this method only once, and it will
        be the last method invoked during the parse. The parser shall
        not invoke this method until it has either abandoned parsing
        (because of an unrecoverable error) or reached the end of
        input.Nrrrrr�endDocumentWszContentHandler.endDocumentcCsdS)aBegin the scope of a prefix-URI Namespace mapping.

        The information from this event is not necessary for normal
        Namespace processing: the SAX XML reader will automatically
        replace prefixes for element and attribute names when the
        http://xml.org/sax/features/namespaces feature is true (the
        default).

        There are cases, however, when applications need to use
        prefixes in character data or in attribute values, where they
        cannot safely be expanded automatically; the
        start/endPrefixMapping event supplies the information to the
        application to expand prefixes in those contexts itself, if
        necessary.

        Note that start/endPrefixMapping events are not guaranteed to
        be properly nested relative to each-other: all
        startPrefixMapping events will occur before the corresponding
        startElement event, and all endPrefixMapping events will occur
        after the corresponding endElement event, but their order is
        not guaranteed.Nr)r�prefixZurirrr�startPrefixMapping`sz!ContentHandler.startPrefixMappingcCsdS)z�End the scope of a prefix-URI mapping.

        See startPrefixMapping for details. This event will always
        occur after the corresponding endElement event, but the order
        of endPrefixMapping events is not otherwise guaranteed.Nr)rrrrr�endPrefixMappingwszContentHandler.endPrefixMappingcCsdS)aSignals the start of an element in non-namespace mode.

        The name parameter contains the raw XML 1.0 name of the
        element type as a string and the attrs parameter holds an
        instance of the Attributes class containing the attributes of
        the element.Nr)r�name�attrsrrr�startElement~szContentHandler.startElementcCsdS)z�Signals the end of an element in non-namespace mode.

        The name parameter contains the name of the element type, just
        as with the startElement event.Nr�rrrrr�
endElement�szContentHandler.endElementcCsdS)a�Signals the start of an element in namespace mode.

        The name parameter contains the name of the element type as a
        (uri, localname) tuple, the qname parameter the raw XML 1.0
        name used in the source document, and the attrs parameter
        holds an instance of the Attributes class containing the
        attributes of the element.

        The uri part of the name tuple is None for elements which have
        no namespace.Nr)rr�qnamerrrr�startElementNS�szContentHandler.startElementNScCsdS)z�Signals the end of an element in namespace mode.

        The name parameter contains the name of the element type, just
        as with the startElementNS event.Nr)rrrrrr�endElementNS�szContentHandler.endElementNScCsdS)a�Receive notification of character data.

        The Parser will call this method to report each chunk of
        character data. SAX parsers may return all contiguous
        character data in a single chunk, or they may split it into
        several chunks; however, all of the characters in any single
        event must come from the same external entity so that the
        Locator provides useful information.Nr)rZcontentrrr�
characters�szContentHandler.characterscCsdS)awReceive notification of ignorable whitespace in element content.

        Validating Parsers must use this method to report each chunk
        of ignorable whitespace (see the W3C XML 1.0 recommendation,
        section 2.10): non-validating parsers may also use this method
        if they are capable of parsing and using content models.

        SAX parsers may return all contiguous whitespace in a single
        chunk, or they may split it into several chunks; however, all
        of the characters in any single event must come from the same
        external entity, so that the Locator provides useful
        information.Nr)rZ
whitespacerrr�ignorableWhitespace�sz"ContentHandler.ignorableWhitespacecCsdS)a�Receive notification of a processing instruction.

        The Parser will invoke this method once for each processing
        instruction found: note that processing instructions may occur
        before or after the main document element.

        A SAX parser should never report an XML declaration (XML 1.0,
        section 2.8) or a text declaration (XML 1.0, section 4.3.1)
        using this method.Nr)r�target�datarrr�processingInstruction�sz$ContentHandler.processingInstructioncCsdS)aReceive notification of a skipped entity.

        The Parser will invoke this method once for each entity
        skipped. Non-validating processors may skip entities if they
        have not seen the declarations (because, for example, the
        entity was declared in an external DTD subset). All processors
        may skip external entities, depending on the values of the
        http://xml.org/sax/features/external-general-entities and the
        http://xml.org/sax/features/external-parameter-entities
        properties.Nrrrrr�
skippedEntity�szContentHandler.skippedEntityN)r
rrr
rrrrrrrrrrr r!r$r%rrrrr/s	
rc@s eZdZdZdd�Zdd�ZdS)�
DTDHandlerz�Handle DTD events.

    This interface specifies only those DTD events required for basic
    parsing (unparsed entities and attributes).cCsdS)z$Handle a notation declaration event.Nr)rr�publicId�systemIdrrr�notationDecl�szDTDHandler.notationDeclcCsdS)z,Handle an unparsed entity declaration event.Nr)rrr'r(Zndatarrr�unparsedEntityDecl�szDTDHandler.unparsedEntityDeclN)r
rrr
r)r*rrrrr&�sr&c@seZdZdZdd�ZdS)�EntityResolvera7Basic interface for resolving entities. If you create an object
    implementing this interface, then register the object with your
    Parser, the parser will call the method in your object to
    resolve all external entities. Note that DefaultHandler implements
    this interface with the default behaviour.cCs|S)z�Resolve the system identifier of an entity and return either
        the system identifier to read from as a string, or an InputSource
        to read from.r)rr'r(rrr�
resolveEntity�szEntityResolver.resolveEntityN)r
rrr
r,rrrrr+�sr+z&http://xml.org/sax/features/namespacesz.http://xml.org/sax/features/namespace-prefixesz,http://xml.org/sax/features/string-interningz&http://xml.org/sax/features/validationz5http://xml.org/sax/features/external-general-entitiesz7http://xml.org/sax/features/external-parameter-entitiesz-http://xml.org/sax/properties/lexical-handlerz1http://xml.org/sax/properties/declaration-handlerz&http://xml.org/sax/properties/dom-nodez(http://xml.org/sax/properties/xml-stringz-http://www.python.org/sax/properties/encodingz3http://www.python.org/sax/properties/interning-dictN)r
�versionrrr&r+Zfeature_namespacesZfeature_namespace_prefixesZfeature_string_interningZfeature_validationZfeature_external_gesZfeature_external_pesZall_featuresZproperty_lexical_handlerZproperty_declaration_handlerZproperty_dom_nodeZproperty_xml_stringZproperty_encodingZproperty_interning_dictZall_propertiesrrrr�<module>s@
"��xml/sax/__pycache__/expatreader.cpython-38.pyc000064400000030321151153537540015313 0ustar00U

e5dX=�@s�dZdZddlTddlmZmZddlmZddlmZmZddlm	Z	ddlm
Z
mZdd	lZej
d	d
�dkr|edd	��[zdd
lmZWnek
r�edd	��YnXeed�s�edd	��ddlmZmZmZejZejZzdd	lZWnek
�rdd�ZYnXdd	lZejZ[[Gdd�d�ZGdd�dej�ZGdd�dej ej�Z!dd�Z"e#dk�r�dd	l$Z%e"�Z&e&�'e%j(j�)��e&�*e%j(�+��e&�,d�d	S)z]
SAX driver for the pyexpat C module.  This driver works with
pyexpat.__version__ == '2.22'.
z0.20�)�*)�feature_validation�feature_namespaces)�feature_namespace_prefixes)�feature_external_ges�feature_external_pes)�feature_string_interning)�property_xml_string�property_interning_dictN��javazexpat not available in Java)�expatzexpat not supported�ParserCreate)�	xmlreader�saxutils�handlercCs|S�N�)�orr�+/usr/lib64/python3.8/xml/sax/expatreader.py�_mkproxy'src@seZdZdS)�
_ClosedParserN)�__name__�
__module__�__qualname__rrrrr.src@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�ExpatLocatorz�Locator for use with the ExpatParser class.

    This uses a weak reference to the parser object to avoid creating
    a circular reference between the parser and the content handler.
    cCst|�|_dSr)r�_ref��self�parserrrr�__init__9szExpatLocator.__init__cCs|j}|jdkrdS|jjSr)r�_parser�ErrorColumnNumberrrrr�getColumnNumber<s
zExpatLocator.getColumnNumbercCs|j}|jdkrdS|jjS�N�)rr!�ErrorLineNumberrrrr�
getLineNumberBs
zExpatLocator.getLineNumbercCs|j}|dkrdS|j��Sr)r�_source�getPublicIdrrrrr)HszExpatLocator.getPublicIdcCs|j}|dkrdS|j��Sr)rr(�getSystemIdrrrrr*NszExpatLocator.getSystemIdN)	rrr�__doc__r r#r'r)r*rrrrr3src@seZdZdZdCdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�ZdDdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Zd<d=�Z d>d?�Z!d@dA�Z"dBS)E�ExpatParserz$SAX driver for the pyexpat C module.r��cCsFtj�||�t��|_d|_||_d|_d|_g|_	d|_
d|_dS)Nr)r�IncrementalParserr ZInputSourcer(r!�_namespaces�_lex_handler_prop�_parsing�
_entity_stack�
_external_ges�
_interning)rZnamespaceHandling�bufsizerrrr Zs
zExpatParser.__init__cCsVt�|�}||_z*|��|j�t|��tj�	||�Wn|�
��YnXdS)z3Parse an XML document from a URL or an InputSource.N)r�prepare_input_sourcer(�reset�
_cont_handlerZsetDocumentLocatorrrr.�parse�
_close_source�r�sourcerrrr9gs
zExpatParser.parsecCs |��dk	r|j�|���dSr)r*r!ZSetBaser;rrr�
prepareParserwszExpatParser.prepareParsercCs tj�||�|jr|��dSr)rr.�setContentHandlerr1�_reset_cont_handler)rrrrrr>}szExpatParser.setContentHandlercCsP|tkr|jS|tkr |jdk	S|tttfkr2dS|tkr@|jSt	d|��dS)Nr�Feature '%s' not recognized)
rr/rr4rrrrr3�SAXNotRecognizedException�r�namerrr�
getFeature�s
�zExpatParser.getFeaturecCs�|jrtd��|tkr||_n�|tkr.||_nt|tkrT|rL|jdkrRi|_q�d|_nN|tkrj|r�td��n8|t	kr�|r�td��n"|t
kr�|r�td��ntd|��dS)Nz!Cannot set features while parsingz!expat does not support validationz/expat does not read external parameter entitiesz(expat does not report namespace prefixesr@)r1�SAXNotSupportedExceptionrr/rr3rr4rrrrA)rrC�staterrr�
setFeature�s:
����zExpatParser.setFeaturecCsd|tjkr|jS|tkr|jS|tkrT|jrLt|jd�rB|j��St	d��nt
d��t	d|��dS)N�GetInputContextz=This version of expat does not support getting the XML stringz.XML string cannot be returned when not parsing�Property '%s' not recognized)r�property_lexical_handlerr0r
r4r	r!�hasattrrHrArErBrrr�getProperty�s

��zExpatParser.getPropertycCsV|tjkr ||_|jrR|��n2|tkr0||_n"|tkrFtd|��nt	d|��dS)NzProperty '%s' cannot be setrI)
rrJr0r1�_reset_lex_handler_propr
r4r	rErA)rrC�valuerrr�setProperty�s

��zExpatParser.setPropertyc
Csz|js|��d|_|j��z|j�||�WnDtjk
rt}z$tt�	|j
�||�}|j�|�W5d}~XYnXdSr$)
r1r7r8Z
startDocumentr!ZParser
�errorZSAXParseExceptionZErrorString�codeZ_err_handlerZ
fatalError)r�data�isFinal�e�excrrr�feed�s
zExpatParser.feedcCsB|j}z|��}|dk	r |��W5|��}|dk	r<|��XdSr)r(Z
getByteStream�closeZgetCharacterStream)rr<�filerrrr:�szExpatParser._close_sourcecCs�|js|jdkst|jt�r dSz(|jddd�|j	�
�d|_d|_W5d|_|jdk	rzt�}|jj|_|jj|_||_|��XdS)Nr�r%)rS)r2r!�
isinstancerr1r"r&r:rVr8ZendDocumentrrrrrW�s 
�




zExpatParser.closecCs|jj|j_|jj|j_dSr)r8�processingInstructionr!ZProcessingInstructionHandler�
charactersZCharacterDataHandler�rrrrr?�s�zExpatParser._reset_cont_handlercCs`|j}|j}|dkr4d|_d|_d|_d|_d|_n(|j|_|j|_|j	|_|j
|_|j|_dSr)r0r!ZCommentHandlerZStartCdataSectionHandlerZEndCdataSectionHandlerZStartDoctypeDeclHandlerZEndDoctypeDeclHandlerZcommentZ
startCDATAZendCDATA�start_doctype_declZendDTD)rZlexrrrrrMsz#ExpatParser._reset_lex_handler_propcCs�|jr>tj|j��d|jd�|_d|j_|j|j_	|j
|j_n,tj|j��|jd�|_|j|j_	|j
|j_|��|j|j_|j|j_|j|j_|j|j_d|_|jr�|��|j|j_z|j|j_Wntk
r�YnX|j�tj �d|_!g|_"dS)N� )�internr%r)#r/r
rr(ZgetEncodingr4r!Znamespace_prefixes�start_element_nsZStartElementHandler�end_element_nsZEndElementHandler�
start_element�end_elementr?�unparsed_entity_declZUnparsedEntityDeclHandler�
notation_declZNotationDeclHandler�start_namespace_declZStartNamespaceDeclHandler�end_namespace_declZEndNamespaceDeclHandlerZ_decl_handler_propr0rM�external_entity_refZExternalEntityRefHandler�skipped_entity_handlerZSkippedEntityHandler�AttributeErrorZSetParamEntityParsingZ*XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONEr1r2r]rrrr7s<�
�






�zExpatParser.resetcCs|jdkrdS|jjSr)r!r"r]rrrr#;s
zExpatParser.getColumnNumbercCs|jdkrdS|jjSr$)r!r&r]rrrr'@s
zExpatParser.getLineNumbercCs
|j��Sr)r(r)r]rrrr)EszExpatParser.getPublicIdcCs
|j��Sr)r(r*r]rrrr*HszExpatParser.getSystemIdcCs|j�|t|��dSr)r8ZstartElement�AttributesImpl)rrC�attrsrrrrcLszExpatParser.start_elementcCs|j�|�dSr)r8Z
endElementrBrrrrdOszExpatParser.end_elementcCs�|��}t|�dkrd|f}n&t|�dkr<|d|df}nt|�}i}i}|��D]|\}}|��}t|�}	|	dkr�|}
d|f}n>|	dkr�d|d|df}
|d|df}n|d}
t|�}|||<|
||<qT|j�|dt||��dS)Nr%�rz%s:%s�)�split�len�tuple�itemsr8ZstartElementNS�AttributesNSImpl)rrCrm�pairZnewattrsZqnamesZanamerN�partsZlengthZqnameZapairrrrraRs0



�zExpatParser.start_element_nscCsV|��}t|�dkrd|f}n&t|�dkr<|d|df}nt|�}|j�|d�dS)Nr%rnr)rprqrrr8ZendElementNS)rrCrurrrrbts
zExpatParser.end_element_nscCs|j�||�dSr)r8r[)r�targetrRrrr�processing_instruction�sz"ExpatParser.processing_instructioncCs|j�|�dSr)r8r\)rrRrrr�character_data�szExpatParser.character_datacCs|j�||�dSr)r8ZstartPrefixMapping)r�prefixZurirrrrg�sz ExpatParser.start_namespace_declcCs|j�|�dSr)r8ZendPrefixMapping)rrzrrrrh�szExpatParser.end_namespace_declcCs|j�|||�dSr)r0ZstartDTD)rrC�sysid�pubidZhas_internal_subsetrrrr^�szExpatParser.start_doctype_declcCs|j�||||�dSr)�_dtd_handlerZunparsedEntityDecl)rrC�baser{r|Z
notation_namerrrre�sz ExpatParser.unparsed_entity_declcCs|j�|||�dSr)r}ZnotationDecl)rrCr~r{r|rrrrf�szExpatParser.notation_declcCs�|js
dS|j�||�}t�||j��p*d�}|j�|j	|jf�|j	�
|�|_	||_ztj�
||�WnYdSX|jd\|_	|_|jd=dS)Nr%rYr���)r3Z_ent_handlerZ
resolveEntityrr6r(r*r2�appendr!ZExternalEntityParserCreaterr.r9)r�contextr~r{r|r<rrrri�s"
�zExpatParser.external_entity_refcCs|rd|}|j�|�dS)N�%)r8Z
skippedEntity)rrCZis_perrrrj�sz"ExpatParser.skipped_entity_handlerN)rr-)r)#rrrr+r r9r=r>rDrGrLrOrVr:rWr?rMr7r#r'r)r*rcrdrarbrxryrgrhr^rerfrirjrrrrr,Ws@


'"r,cOs
t||�Sr)r,)�args�kwargsrrr�
create_parser�sr��__main__z:http://www.ibiblio.org/xml/examples/shakespeare/hamlet.xml)-r+�versionZxml.sax._exceptionsZxml.sax.handlerrrrrrrr	r
�sys�platformZSAXReaderNotAvailableZxml.parsersr
�ImportErrorrKZxml.saxrrrrlrt�_weakrefr�weakref�proxyrZLocatorrr.r,r�rZxml.sax.saxutilsZxml�pr>ZsaxZXMLGeneratorZsetErrorHandlerZErrorHandlerr9rrrr�<module>sN


$_
xml/sax/__pycache__/_exceptions.cpython-38.opt-1.pyc000064400000012506151153537540016273 0ustar00U

e5d��@s�dZddlZejdd�dkr*ddlmZ[Gdd�de�ZGdd	�d	e�ZGd
d�de�ZGdd
�d
e�ZGdd�de�Z	dS)z!Different kinds of SAX Exceptions�N��java)�	Exceptionc@s:eZdZdZd
dd�Zdd�Zdd�Zd	d
�Zdd�ZdS)�SAXExceptiona�Encapsulate an XML error or warning. This class can contain
    basic error or warning information from either the XML parser or
    the application: you can subclass it to provide additional
    functionality, or to add localization. Note that although you will
    receive a SAXException as the argument to the handlers in the
    ErrorHandler interface, you are not actually required to raise
    the exception; instead, you can simply read the information in
    it.NcCs||_||_t�||�dS)zUCreates an exception. The message is required, but the exception
        is optional.N)�_msg�
_exceptionr�__init__)�self�msg�	exception�r�+/usr/lib64/python3.8/xml/sax/_exceptions.pyrszSAXException.__init__cCs|jS)z$Return a message for this exception.�r�r	rrr
�
getMessageszSAXException.getMessagecCs|jS)z9Return the embedded exception, or None if there was none.)rrrrr
�getExceptionszSAXException.getExceptioncCs|jS)�0Create a string representation of the exception.rrrrr
�__str__"szSAXException.__str__cCstd��dS)zvAvoids weird error messages if someone does exception[ix] by
        mistake, since Exception has __getitem__ defined.�__getitem__N)�AttributeError)r	Zixrrr
r&szSAXException.__getitem__)N)	�__name__�
__module__�__qualname__�__doc__rrrrrrrrr
r	s	
rc@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�SAXParseExceptiona#Encapsulate an XML parse error or warning.

    This exception will include information for locating the error in
    the original XML document. Note that although the application will
    receive a SAXParseException as the argument to the handlers in the
    ErrorHandler interface, the application is not actually required
    to raise the exception; instead, it can simply read the
    information in it and take a different action.

    Since this exception is a subclass of SAXException, it inherits
    the ability to wrap another exception.cCs<t�|||�||_|j��|_|j��|_|j��|_dS)zECreates the exception. The exception parameter is allowed to be None.N)	rr�_locator�getSystemId�	_systemId�getColumnNumber�_colnum�
getLineNumber�_linenum)r	r
rZlocatorrrr
r;s
zSAXParseException.__init__cCs|jS)zNThe column number of the end of the text where the exception
        occurred.)rrrrr
rHsz!SAXParseException.getColumnNumbercCs|jS)zDThe line number of the end of the text where the exception occurred.)r!rrrr
r MszSAXParseException.getLineNumbercCs
|j��S)zEGet the public identifier of the entity where the exception occurred.)r�getPublicIdrrrr
r"QszSAXParseException.getPublicIdcCs|jS)zEGet the system identifier of the entity where the exception occurred.)rrrrr
rUszSAXParseException.getSystemIdcCsN|��}|dkrd}|��}|dkr(d}|��}|dkr<d}d||||jfS)rNz	<unknown>�?z%s:%s:%s: %s)rr rr)r	ZsysidZlinenumZcolnumrrr
rYszSAXParseException.__str__N)
rrrrrrr r"rrrrrr
r.s
rc@seZdZdZdS)�SAXNotRecognizedExceptionz�Exception class for an unrecognized identifier.

    An XMLReader will raise this exception when it is confronted with an
    unrecognized feature or property. SAX applications and extensions may
    use this class for similar purposes.N�rrrrrrrr
r$isr$c@seZdZdZdS)�SAXNotSupportedExceptionaException class for an unsupported operation.

    An XMLReader will raise this exception when a service it cannot
    perform is requested (specifically setting a state or value). SAX
    applications and extensions may use this class for similar
    purposes.Nr%rrrr
r&ssr&c@seZdZdZdS)�SAXReaderNotAvailableaException class for a missing driver.

    An XMLReader module (driver) should raise this exception when it
    is first imported, e.g. when a support module cannot be imported.
    It also may be raised during parsing, e.g. if executing an external
    program is not permitted.Nr%rrrr
r'}sr')
r�sys�platformZ	java.langrrrr$r&r'rrrr
�<module>s%;

xml/sax/__pycache__/__init__.cpython-38.opt-2.pyc000064400000004156151153537540015515 0ustar00U

e5d?�@sddlmZddlmZmZddlmZmZmZm	Z	m
Z
e�fdd�Ze�fdd�ZdgZ
d	Zerjd	d
lZd	d
lZd	d
lZejjs�dejkr�ejd�d�Z
[d
Zejd
d�dkr�ej�e�r�ej�e��d�Z
ddd�Zejd
d�dkr�dd�Zndd�Z[d
S)�)�InputSource)�ContentHandler�ErrorHandler)�SAXException�SAXNotRecognizedException�SAXParseException�SAXNotSupportedException�SAXReaderNotAvailablecCs(t�}|�|�|�|�|�|�dS)N)�make_parser�setContentHandler�setErrorHandler�parse)�source�handler�errorHandler�parser�r�(/usr/lib64/python3.8/xml/sax/__init__.pyr
s

r
cCspddl}|dkrt�}t�}|�|�|�|�t�}t|t�rR|�|�	|��n|�
|�|��|�|�dS)N�)
�iorr
rrr�
isinstance�strZsetCharacterStream�StringIOZ
setByteStream�BytesIOr
)�stringrrrrZinpsrcrrr�parseString#s


rzxml.sax.expatreaderrNZ
PY_SAX_PARSER�,zpython.xml.sax.parser��javarcCsxt|�tD]\}zt|�WStk
rT}zddl}||jkrD�W5d}~XYqtk
rfYqXqtdd��dS)NrzNo parsers found)�list�default_parser_list�_create_parser�ImportError�sys�modulesr	)Zparser_list�parser_name�er#rrrr
Fs
r
cCs$ddlm}|�|dt��}|��S)Nr)�imp)Zorg.python.corer'Z
importName�globals�
create_parser)r%r'�
drv_modulerrrr!asr!cCst|iidg�}|��S)Nr))�
__import__r))r%r*rrrr!gs)r)Z	xmlreaderrrrr�_exceptionsrrrrr	r
rr �_falseZxml.sax.expatreaderZxml�osr#�flags�ignore_environment�environ�splitZ_key�platform�registryZcontainsKeyZgetPropertyr
r!rrrr�<module>s(

xml/sax/__pycache__/_exceptions.cpython-38.pyc000064400000012506151153537540015334 0ustar00U

e5d��@s�dZddlZejdd�dkr*ddlmZ[Gdd�de�ZGdd	�d	e�ZGd
d�de�ZGdd
�d
e�ZGdd�de�Z	dS)z!Different kinds of SAX Exceptions�N��java)�	Exceptionc@s:eZdZdZd
dd�Zdd�Zdd�Zd	d
�Zdd�ZdS)�SAXExceptiona�Encapsulate an XML error or warning. This class can contain
    basic error or warning information from either the XML parser or
    the application: you can subclass it to provide additional
    functionality, or to add localization. Note that although you will
    receive a SAXException as the argument to the handlers in the
    ErrorHandler interface, you are not actually required to raise
    the exception; instead, you can simply read the information in
    it.NcCs||_||_t�||�dS)zUCreates an exception. The message is required, but the exception
        is optional.N)�_msg�
_exceptionr�__init__)�self�msg�	exception�r�+/usr/lib64/python3.8/xml/sax/_exceptions.pyrszSAXException.__init__cCs|jS)z$Return a message for this exception.�r�r	rrr
�
getMessageszSAXException.getMessagecCs|jS)z9Return the embedded exception, or None if there was none.)rrrrr
�getExceptionszSAXException.getExceptioncCs|jS)�0Create a string representation of the exception.rrrrr
�__str__"szSAXException.__str__cCstd��dS)zvAvoids weird error messages if someone does exception[ix] by
        mistake, since Exception has __getitem__ defined.�__getitem__N)�AttributeError)r	Zixrrr
r&szSAXException.__getitem__)N)	�__name__�
__module__�__qualname__�__doc__rrrrrrrrr
r	s	
rc@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�SAXParseExceptiona#Encapsulate an XML parse error or warning.

    This exception will include information for locating the error in
    the original XML document. Note that although the application will
    receive a SAXParseException as the argument to the handlers in the
    ErrorHandler interface, the application is not actually required
    to raise the exception; instead, it can simply read the
    information in it and take a different action.

    Since this exception is a subclass of SAXException, it inherits
    the ability to wrap another exception.cCs<t�|||�||_|j��|_|j��|_|j��|_dS)zECreates the exception. The exception parameter is allowed to be None.N)	rr�_locator�getSystemId�	_systemId�getColumnNumber�_colnum�
getLineNumber�_linenum)r	r
rZlocatorrrr
r;s
zSAXParseException.__init__cCs|jS)zNThe column number of the end of the text where the exception
        occurred.)rrrrr
rHsz!SAXParseException.getColumnNumbercCs|jS)zDThe line number of the end of the text where the exception occurred.)r!rrrr
r MszSAXParseException.getLineNumbercCs
|j��S)zEGet the public identifier of the entity where the exception occurred.)r�getPublicIdrrrr
r"QszSAXParseException.getPublicIdcCs|jS)zEGet the system identifier of the entity where the exception occurred.)rrrrr
rUszSAXParseException.getSystemIdcCsN|��}|dkrd}|��}|dkr(d}|��}|dkr<d}d||||jfS)rNz	<unknown>�?z%s:%s:%s: %s)rr rr)r	ZsysidZlinenumZcolnumrrr
rYszSAXParseException.__str__N)
rrrrrrr r"rrrrrr
r.s
rc@seZdZdZdS)�SAXNotRecognizedExceptionz�Exception class for an unrecognized identifier.

    An XMLReader will raise this exception when it is confronted with an
    unrecognized feature or property. SAX applications and extensions may
    use this class for similar purposes.N�rrrrrrrr
r$isr$c@seZdZdZdS)�SAXNotSupportedExceptionaException class for an unsupported operation.

    An XMLReader will raise this exception when a service it cannot
    perform is requested (specifically setting a state or value). SAX
    applications and extensions may use this class for similar
    purposes.Nr%rrrr
r&ssr&c@seZdZdZdS)�SAXReaderNotAvailableaException class for a missing driver.

    An XMLReader module (driver) should raise this exception when it
    is first imported, e.g. when a support module cannot be imported.
    It also may be raised during parsing, e.g. if executing an external
    program is not permitted.Nr%rrrr
r'}sr')
r�sys�platformZ	java.langrrrr$r&r'rrrr
�<module>s%;

xml/sax/__pycache__/_exceptions.cpython-38.opt-2.pyc000064400000005433151153537540016275 0ustar00U

e5d��@s|ddlZejdd�dkr&ddlmZ[Gdd�de�ZGdd�de�ZGd	d
�d
e�ZGdd�de�ZGd
d�de�ZdS)�N��java)�	Exceptionc@s6eZdZddd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�SAXExceptionNcCs||_||_t�||�dS�N)�_msg�
_exceptionr�__init__)�self�msg�	exception�r
�+/usr/lib64/python3.8/xml/sax/_exceptions.pyr	szSAXException.__init__cCs|jSr�r�r
r
r
r�
getMessageszSAXException.getMessagecCs|jSr)rrr
r
r�getExceptionszSAXException.getExceptioncCs|jSrrrr
r
r�__str__"szSAXException.__str__cCstd��dS)N�__getitem__)�AttributeError)r
Zixr
r
rr&szSAXException.__getitem__)N)�__name__�
__module__�__qualname__r	rrrrr
r
r
rr	s


rc@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�SAXParseExceptioncCs<t�|||�||_|j��|_|j��|_|j��|_dSr)	rr	�_locator�getSystemId�	_systemId�getColumnNumber�_colnum�
getLineNumber�_linenum)r
rrZlocatorr
r
rr	;s
zSAXParseException.__init__cCs|jSr)rrr
r
rrHsz!SAXParseException.getColumnNumbercCs|jSr)r rr
r
rrMszSAXParseException.getLineNumbercCs
|j��Sr)r�getPublicIdrr
r
rr!QszSAXParseException.getPublicIdcCs|jSr)rrr
r
rrUszSAXParseException.getSystemIdcCsN|��}|dkrd}|��}|dkr(d}|��}|dkr<d}d||||jfS)Nz	<unknown>�?z%s:%s:%s: %s)rrrr)r
ZsysidZlinenumZcolnumr
r
rrYszSAXParseException.__str__N)	rrrr	rrr!rrr
r
r
rr.s

rc@seZdZdS)�SAXNotRecognizedExceptionN�rrrr
r
r
rr#isr#c@seZdZdS)�SAXNotSupportedExceptionNr$r
r
r
rr%ssr%c@seZdZdS)�SAXReaderNotAvailableNr$r
r
r
rr&}sr&)	�sys�platformZ	java.langrrrr#r%r&r
r
r
r�<module>s%;

xml/sax/__pycache__/xmlreader.cpython-38.opt-1.pyc000064400000040716151153537540015742 0ustar00U

e5d�1�@s�dZddlmZddlmZmZGdd�d�ZGdd�de�ZGdd	�d	�ZGd
d�d�Z	Gdd
�d
�Z
Gdd�de
�Zdd�Ze
dkr�e�dS)z]An XML Reader is the SAX 2 name for an XML parser. XML Parsers
should be based on this code. �)�handler)�SAXNotSupportedException�SAXNotRecognizedExceptionc@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd S)!�	XMLReadera%Interface for reading an XML document using callbacks.

    XMLReader is the interface that an XML parser's SAX2 driver must
    implement. This interface allows an application to set and query
    features and properties in the parser, to register event handlers
    for document processing, and to initiate a document parse.

    All SAX interfaces are assumed to be synchronous: the parse
    methods must not return until parsing is complete, and readers
    must wait for an event-handler callback to return before reporting
    the next event.cCs,t��|_t��|_t��|_t��|_dS�N)	rZContentHandler�
_cont_handlerZ
DTDHandler�_dtd_handlerZEntityResolver�_ent_handlerZErrorHandler�_err_handler��self�r
�)/usr/lib64/python3.8/xml/sax/xmlreader.py�__init__s


zXMLReader.__init__cCstd��dS)zAParse an XML document from a system identifier or an InputSource.� This method must be implemented!N��NotImplementedError�r�sourcer
r
r�parseszXMLReader.parsecCs|jS)z#Returns the current ContentHandler.�rrr
r
r�getContentHandler"szXMLReader.getContentHandlercCs
||_dS)z:Registers a new object to receive document content events.Nr�rrr
r
r�setContentHandler&szXMLReader.setContentHandlercCs|jS)z Returns the current DTD handler.�rrr
r
r�
getDTDHandler*szXMLReader.getDTDHandlercCs
||_dS)z7Register an object to receive basic DTD-related events.Nrrr
r
r�
setDTDHandler.szXMLReader.setDTDHandlercCs|jS)z#Returns the current EntityResolver.�r	rr
r
r�getEntityResolver2szXMLReader.getEntityResolvercCs
||_dS)z0Register an object to resolve external entities.Nr)rZresolverr
r
r�setEntityResolver6szXMLReader.setEntityResolvercCs|jS)z!Returns the current ErrorHandler.�r
rr
r
r�getErrorHandler:szXMLReader.getErrorHandlercCs
||_dS)z3Register an object to receive error-message events.Nr rr
r
r�setErrorHandler>szXMLReader.setErrorHandlercCstd��dS)aHAllow an application to set the locale for errors and warnings.

        SAX parsers are not required to provide localization for errors
        and warnings; if they cannot support the requested locale,
        however, they must raise a SAX exception. Applications may
        request a locale change in the middle of a parse.zLocale support not implementedN)r)rZlocaler
r
r�	setLocaleBszXMLReader.setLocalecCstd|��dS)z1Looks up and returns the state of a SAX2 feature.�Feature '%s' not recognizedN�r�r�namer
r
r�
getFeatureKszXMLReader.getFeaturecCstd|��dS)z!Sets the state of a SAX2 feature.r$Nr%)rr'�stater
r
r�
setFeatureOszXMLReader.setFeaturecCstd|��dS)z2Looks up and returns the value of a SAX2 property.�Property '%s' not recognizedNr%r&r
r
r�getPropertySszXMLReader.getPropertycCstd|��dS)z"Sets the value of a SAX2 property.r+Nr%)rr'�valuer
r
r�setPropertyWszXMLReader.setPropertyN)�__name__�
__module__�__qualname__�__doc__rrrrrrrrr!r"r#r(r*r,r.r
r
r
rrs 	rc@sBeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�IncrementalParserasThis interface adds three extra methods to the XMLReader
    interface that allow XML parsers to support incremental
    parsing. Support for this interface is optional, since not all
    underlying XML parsers support this functionality.

    When the parser is instantiated it is ready to begin accepting
    data from the feed method immediately. After parsing has been
    finished with a call to close the reset method must be called to
    make the parser ready to accept new data, either from feed or
    using the parse method.

    Note that these methods must _not_ be called during parsing, that
    is, after parse has been called and before it returns.

    By default, the class also implements the parse method of the XMLReader
    interface using the feed, close and reset methods of the
    IncrementalParser interface as a convenience to SAX 2.0 driver
    writers.�cCs||_t�|�dSr)�_bufsizerr)r�bufsizer
r
rroszIncrementalParser.__init__cCslddlm}|�|�}|�|�|��}|dkr8|��}|�|j�}|r`|�|�|�|j�}qD|�	�dS)Nr)�saxutils)
�r7Zprepare_input_source�
prepareParser�getCharacterStream�
getByteStream�readr5�feed�close)rrr7�file�bufferr
r
rrss


zIncrementalParser.parsecCstd��dS)aThis method gives the raw XML data in the data parameter to
        the parser and makes it parse the data, emitting the
        corresponding events. It is allowed for XML constructs to be
        split across several calls to feed.

        feed may raise SAXException.rNr)r�datar
r
rr=�szIncrementalParser.feedcCstd��dS)ztThis method is called by the parse implementation to allow
        the SAX 2.0 driver to prepare itself for parsing.z!prepareParser must be overridden!Nrrr
r
rr9�szIncrementalParser.prepareParsercCstd��dS)a�This method is called when the entire XML document has been
        passed to the parser through the feed method, to notify the
        parser that there are no more data. This allows the parser to
        do the final checks on the document and empty the internal
        data buffer.

        The parser will not be ready to parse another document until
        the reset method has been called.

        close may raise SAXException.rNrrr
r
rr>�szIncrementalParser.closecCstd��dS)z�This method is called after close has been called to reset
        the parser so that it is ready to parse new documents. The
        results of calling parse or feed after close without calling
        reset are undefined.rNrrr
r
r�reset�szIncrementalParser.resetN)r4)
r/r0r1r2rrr=r9r>rBr
r
r
rr3[s
	
r3c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�Locatorz�Interface for associating a SAX event with a document
    location. A locator object will return valid results only during
    calls to DocumentHandler methods; at any other time, the
    results are unpredictable.cCsdS)z6Return the column number where the current event ends.���r
rr
r
r�getColumnNumber�szLocator.getColumnNumbercCsdS)z4Return the line number where the current event ends.rDr
rr
r
r�
getLineNumber�szLocator.getLineNumbercCsdS)z3Return the public identifier for the current event.Nr
rr
r
r�getPublicId�szLocator.getPublicIdcCsdS)z3Return the system identifier for the current event.Nr
rr
r
r�getSystemId�szLocator.getSystemIdN)r/r0r1r2rErFrGrHr
r
r
rrC�s
rCc@sjeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�InputSourceanEncapsulation of the information needed by the XMLReader to
    read entities.

    This class may include information about the public identifier,
    system identifier, byte stream (possibly with character encoding
    information) and/or the character stream of an entity.

    Applications will create objects of this class for use in the
    XMLReader.parse method and for returning from
    EntityResolver.resolveEntity.

    An InputSource belongs to the application, the XMLReader is not
    allowed to modify InputSource objects passed to it from the
    application, although it may make copies and modify those.NcCs"||_d|_d|_d|_d|_dSr)�_InputSource__system_id�_InputSource__public_id�_InputSource__encoding�_InputSource__bytefile�_InputSource__charfile�rZ	system_idr
r
rr�s
zInputSource.__init__cCs
||_dS)z/Sets the public identifier of this InputSource.N�rK)rZ	public_idr
r
r�setPublicId�szInputSource.setPublicIdcCs|jS)z2Returns the public identifier of this InputSource.rPrr
r
rrG�szInputSource.getPublicIdcCs
||_dS)z/Sets the system identifier of this InputSource.N�rJrOr
r
r�setSystemId�szInputSource.setSystemIdcCs|jS)z2Returns the system identifier of this InputSource.rRrr
r
rrH�szInputSource.getSystemIdcCs
||_dS)a4Sets the character encoding of this InputSource.

        The encoding must be a string acceptable for an XML encoding
        declaration (see section 4.3.3 of the XML recommendation).

        The encoding attribute of the InputSource is ignored if the
        InputSource also contains a character stream.N�rL)r�encodingr
r
r�setEncoding�szInputSource.setEncodingcCs|jS)z/Get the character encoding of this InputSource.rTrr
r
r�getEncoding�szInputSource.getEncodingcCs
||_dS)a�Set the byte stream (a Python file-like object which does
        not perform byte-to-character conversion) for this input
        source.

        The SAX parser will ignore this if there is also a character
        stream specified, but it will use a byte stream in preference
        to opening a URI connection itself.

        If the application knows the character encoding of the byte
        stream, it should set it with the setEncoding method.N�rM)rZbytefiler
r
r�
setByteStream�szInputSource.setByteStreamcCs|jS)z�Get the byte stream for this input source.

        The getEncoding method will return the character encoding for
        this byte stream, or None if unknown.rXrr
r
rr;�szInputSource.getByteStreamcCs
||_dS)a^Set the character stream for this input source. (The stream
        must be a Python 2.0 Unicode-wrapped file-like that performs
        conversion to Unicode strings.)

        If there is a character stream specified, the SAX parser will
        ignore any byte stream and will not attempt to open a URI
        connection to the system identifier.N�rN)rZcharfiler
r
r�setCharacterStreamszInputSource.setCharacterStreamcCs|jS)z/Get the character stream for this input source.rZrr
r
rr:szInputSource.getCharacterStream)N)r/r0r1r2rrQrGrSrHrVrWrYr;r[r:r
r
r
rrI�s



rIc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zd$dd�Zdd�Zd d!�Zd"d#�ZdS)%�AttributesImplcCs
||_dS)zQNon-NS-aware implementation.

        attrs should be of the form {name : value}.N��_attrs)r�attrsr
r
rrszAttributesImpl.__init__cCs
t|j�Sr��lenr^rr
r
r�	getLengthszAttributesImpl.getLengthcCsdS)NZCDATAr
r&r
r
r�getType!szAttributesImpl.getTypecCs
|j|Srr]r&r
r
r�getValue$szAttributesImpl.getValuecCs
|j|Srr]r&r
r
r�getValueByQName'szAttributesImpl.getValueByQNamecCs||jkrt|��|Sr�r^�KeyErrorr&r
r
r�getNameByQName*s
zAttributesImpl.getNameByQNamecCs||jkrt|��|Srrfr&r
r
r�getQNameByName/s
zAttributesImpl.getQNameByNamecCst|j���Sr��listr^�keysrr
r
r�getNames4szAttributesImpl.getNamescCst|j���Srrjrr
r
r�	getQNames7szAttributesImpl.getQNamescCs
t|j�Srr`rr
r
r�__len__:szAttributesImpl.__len__cCs
|j|Srr]r&r
r
r�__getitem__=szAttributesImpl.__getitem__cCst|j���Srrjrr
r
rrl@szAttributesImpl.keyscCs
||jkSrr]r&r
r
r�__contains__CszAttributesImpl.__contains__NcCs|j�||�Sr)r^�get)rr'�alternativer
r
rrrFszAttributesImpl.getcCs|�|j�Sr)�	__class__r^rr
r
r�copyIszAttributesImpl.copycCst|j���Sr)rkr^�itemsrr
r
rrvLszAttributesImpl.itemscCst|j���Sr)rkr^�valuesrr
r
rrwOszAttributesImpl.values)N)r/r0r1rrbrcrdrerhrirmrnrorprlrqrrrurvrwr
r
r
rr\s"
r\c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�AttributesNSImplcCs||_||_dS)z�NS-aware implementation.

        attrs should be of the form {(ns_uri, lname): value, ...}.
        qnames of the form {(ns_uri, lname): qname, ...}.N)r^�_qnames)rr_Zqnamesr
r
rrVszAttributesNSImpl.__init__cCs6|j��D]\}}||kr
|j|Sq
t|��dSr)ryrvr^rg�rr'ZnsnameZqnamer
r
rre^sz AttributesNSImpl.getValueByQNamecCs0|j��D]\}}||kr
|Sq
t|��dSr)ryrvrgrzr
r
rrhes
zAttributesNSImpl.getNameByQNamecCs
|j|Sr)ryr&r
r
rrilszAttributesNSImpl.getQNameByNamecCst|j���Sr)rkryrwrr
r
rrnoszAttributesNSImpl.getQNamescCs|�|j|j�Sr)rtr^ryrr
r
rrurszAttributesNSImpl.copyN)	r/r0r1rrerhrirnrur
r
r
rrxTsrxcCst�t�t�dSr)rr3rCr
r
r
r�_testvsr{�__main__N)r2r8r�_exceptionsrrrr3rCrIr\rxr{r/r
r
r
r�<module>sPJY>"xml/sax/__pycache__/saxutils.cpython-38.pyc000064400000031171151153537540014667 0ustar00U

e5d�/�@s�dZddlZddlZddlZddlZddlZddlmZddlm	Z	dd�Z
ifdd	�Zifd
d�Zifdd
�Z
dd�ZGdd�dej�ZGdd�de	j�Zddd�ZdS)znA library of useful helper classes to the SAX classes, for the
convenience of application and driver writers.
�N�)�handler)�	xmlreadercCs"|��D]\}}|�||�}q|S)z2Replace substrings of a string using a dictionary.)�items�replace)�s�d�key�value�r�(/usr/lib64/python3.8/xml/sax/saxutils.py�__dict_replacesr
cCs6|�dd�}|�dd�}|�dd�}|r2t||�}|S)z�Escape &, <, and > in a string of data.

    You can escape other strings of data by passing a dictionary as
    the optional entities parameter.  The keys and values must all be
    strings; each key will be replaced with its corresponding value.
    �&�&amp;�>�&gt;�<�&lt;�rr
��dataZentitiesrrr�escapes	
rcCs2|�dd�}|�dd�}|r&t||�}|�dd�S)a
Unescape &amp;, &lt;, and &gt; in a string of data.

    You can unescape other strings of data by passing a dictionary as
    the optional entities parameter.  The keys and values must all be
    strings; each key will be replaced with its corresponding value.
    rrrrrrrrrrr�unescape"s

rcCsR|dddd��}t||�}d|krFd|kr<d|�dd�}qNd	|}nd|}|S)
a�Escape and quote an attribute value.

    Escape &, <, and > in a string of data, then quote it for use as
    an attribute value.  The " character will be escaped as well, if
    necessary.

    You can escape other strings of data by passing a dictionary as
    the optional entities parameter.  The keys and values must all be
    strings; each key will be replaced with its corresponding value.
    z&#10;z&#13;z&#9;)�
�
�	�"�'z"%s"z&quot;z'%s')rrrrrr�	quoteattr0s

rcs��dkrddl}|jSt�tj�r&�St�tjtjf�r<�St�tj�rlG�fdd�d�}|�}dd�|_	nDt�
�}dd�|_�j|_z�j
|_
�j|_Wntk
r�YnXtj||ddd	d
�S)NrcseZdZ�jZ�fdd�ZdS)z _gettextwriter.<locals>._wrappercs
t�|�S�N)�getattr��self�name��outrr�__getattr__Zsz,_gettextwriter.<locals>._wrapper.__getattr__N)�__name__�
__module__�__qualname__�	__class__r&rr$rr�_wrapperXsr+cSsdSrrrrrr�<lambda>]�z _gettextwriter.<locals>.<lambda>cSsdS)NTrrrrrr,br-�xmlcharrefreplacerT)�encoding�errors�newline�
write_through)�sys�stdout�
isinstance�io�
TextIOBase�codecs�StreamWriter�StreamReaderWriter�	RawIOBase�close�BufferedIOBase�writable�write�seekable�tell�AttributeError�
TextIOWrapper)r%r/r3r+�bufferrr$r�_gettextwriterGs0
�rEc@s�eZdZd dd�Zdd�Zd!dd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)"�XMLGeneratorN�
iso-8859-1FcCsVtj�|�t||�}|j|_|j|_ig|_|jd|_	g|_
||_||_d|_
dS)N���F)r�ContentHandler�__init__rEr?�_write�flush�_flush�_ns_contexts�_current_context�_undeclared_ns_maps�	_encoding�_short_empty_elements�_pending_start_element)r"r%r/Zshort_empty_elementsrrrrJrs
zXMLGenerator.__init__cCsJ|drBd|dkr d|dS|j|d}|rB|d|dS|dS)z7Builds a qualified name from a (ns_url, localname) pairrz$http://www.w3.org/XML/1998/namespacezxml:r�:)rO)r"r#�prefixrrr�_qname~szXMLGenerator._qnamecCs|jr|�d�d|_dS)NrF�rSrK)r"�
endElementrrr�_finish_pending_start_element�s
z*XMLGenerator._finish_pending_start_elementcCs|�d|j�dS)Nz$<?xml version="1.0" encoding="%s"?>
)rKrQ�r"rrr�
startDocument�s�zXMLGenerator.startDocumentcCs|��dSr)rMrZrrr�endDocument�szXMLGenerator.endDocumentcCs0|j�|j���||j|<|j�||f�dSr)rN�appendrO�copyrP�r"rU�urirrr�startPrefixMapping�s
zXMLGenerator.startPrefixMappingcCs|jd|_|jd=dS)NrH)rNrO�r"rUrrr�endPrefixMapping�szXMLGenerator.endPrefixMappingcCsZ|��|�d|�|��D]\}}|�d|t|�f�q|jrLd|_n
|�d�dS)Nr� %s=%sTr)rYrKrrrRrS)r"r#�attrsr
rrr�startElement�szXMLGenerator.startElementcCs*|jr|�d�d|_n|�d|�dS�Nz/>Fz</%s>rWr!rrrrX�s
zXMLGenerator.endElementcCs�|��|�d|�|��|jD].\}}|rB|�d||f�q"|�d|�q"g|_|��D]$\}}|�d|�|�t|�f�q`|jr�d|_n
|�d�dS)Nrz xmlns:%s="%s"z xmlns="%s"rdTr)rYrKrVrPrrrRrS)r"r#�qnamererUr`r
rrr�startElementNS�szXMLGenerator.startElementNScCs0|jr|�d�d|_n|�d|�|��dSrg)rSrKrV�r"r#rhrrr�endElementNS�s
zXMLGenerator.endElementNScCs4|r0|��t|t�s"t||j�}|�t|��dSr)rYr5�strrQrKr�r"Zcontentrrr�
characters�s

zXMLGenerator.characterscCs0|r,|��t|t�s"t||j�}|�|�dSr)rYr5rlrQrKrmrrr�ignorableWhitespace�s

z XMLGenerator.ignorableWhitespacecCs|��|�d||f�dS)Nz	<?%s %s?>)rYrK�r"�targetrrrr�processingInstruction�sz"XMLGenerator.processingInstruction)NrGF)F)r'r(r)rJrVrYr[r\rarcrfrXrirkrnrorrrrrrrFps


rFc@s�eZdZdZd;dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�ZdS)<�
XMLFilterBaseaYThis class is designed to sit between an XMLReader and the
    client application's event handlers.  By default, it does nothing
    but pass requests up to the reader and events on to the handlers
    unmodified, but subclasses can override specific methods to modify
    the event stream or the configuration requests as they pass
    through.NcCstj�|�||_dSr)r�	XMLReaderrJ�_parent�r"�parentrrrrJ�szXMLFilterBase.__init__cCs|j�|�dSr)�_err_handler�error�r"Z	exceptionrrrry�szXMLFilterBase.errorcCs|j�|�dSr)rx�
fatalErrorrzrrrr{�szXMLFilterBase.fatalErrorcCs|j�|�dSr)rx�warningrzrrrr|�szXMLFilterBase.warningcCs|j�|�dSr)�
_cont_handler�setDocumentLocator)r"Zlocatorrrrr~�sz XMLFilterBase.setDocumentLocatorcCs|j��dSr)r}r[rZrrrr[�szXMLFilterBase.startDocumentcCs|j��dSr)r}r\rZrrrr\szXMLFilterBase.endDocumentcCs|j�||�dSr)r}rar_rrrrasz XMLFilterBase.startPrefixMappingcCs|j�|�dSr)r}rcrbrrrrcszXMLFilterBase.endPrefixMappingcCs|j�||�dSr)r}rf)r"r#rerrrrfszXMLFilterBase.startElementcCs|j�|�dSr)r}rXr!rrrrXszXMLFilterBase.endElementcCs|j�|||�dSr)r}ri)r"r#rhrerrrriszXMLFilterBase.startElementNScCs|j�||�dSr)r}rkrjrrrrkszXMLFilterBase.endElementNScCs|j�|�dSr)r}rnrmrrrrnszXMLFilterBase.characterscCs|j�|�dSr)r}ro)r"�charsrrrrosz!XMLFilterBase.ignorableWhitespacecCs|j�||�dSr)r}rrrprrrrrsz#XMLFilterBase.processingInstructioncCs|j�|�dSr)r}�
skippedEntityr!rrrr� szXMLFilterBase.skippedEntitycCs|j�|||�dSr)�_dtd_handler�notationDecl)r"r#�publicId�systemIdrrrr�%szXMLFilterBase.notationDeclcCs|j�||||�dSr)r��unparsedEntityDecl)r"r#r�r�Zndatarrrr�(sz XMLFilterBase.unparsedEntityDeclcCs|j�||�Sr)Z_ent_handler�
resolveEntity)r"r�r�rrrr�-szXMLFilterBase.resolveEntitycCs@|j�|�|j�|�|j�|�|j�|�|j�|�dSr)ruZsetContentHandlerZsetErrorHandlerZsetEntityResolverZ
setDTDHandler�parse)r"�sourcerrrr�2s
zXMLFilterBase.parsecCs|j�|�dSr)ru�	setLocale)r"Zlocalerrrr�9szXMLFilterBase.setLocalecCs|j�|�Sr)ru�
getFeaturer!rrrr�<szXMLFilterBase.getFeaturecCs|j�||�dSr)ru�
setFeature)r"r#�staterrrr�?szXMLFilterBase.setFeaturecCs|j�|�Sr)ru�getPropertyr!rrrr�BszXMLFilterBase.getPropertycCs|j�||�dSr)ru�setProperty)r"r#r
rrrr�EszXMLFilterBase.setPropertycCs|jSr�rurZrrr�	getParentJszXMLFilterBase.getParentcCs
||_dSrr�rvrrr�	setParentMszXMLFilterBase.setParent)N) r'r(r)�__doc__rJryr{r|r~r[r\rarcrfrXrirkrnrorrr�r�r�r�r�r�r�r�r�r�r�r�rrrrrs�s:
rs�cCs$t|tj�rt�|�}t|t�r,t�|�}n^t|d�r�|}t��}t|�d�t�r^|�	|�n
|�
|�t|d�r�t|jt�r�|�|j�|�
�dk�r |��dk�r |��}tj�tj�|��}tj�||�}tj�|�r�|�|�t|d�}n$|�tj�||��tj�|���}|�
|�|S)z�This function takes an InputSource and an optional base URL and
    returns a fully resolved InputSource object ready for reading.�readrr#N�rb)r5�os�PathLike�fspathrlrZInputSource�hasattrr�ZsetCharacterStreamZ
setByteStreamr#ZsetSystemIdZgetCharacterStreamZ
getByteStreamZgetSystemId�path�dirname�normpath�join�isfile�open�urllibr�ZurljoinZrequestZurlopen)r��base�fZsysidZbaseheadZ
sysidfilenamerrr�prepare_input_sourceRs.





r�)r�)r�r�Zurllib.parser�Zurllib.requestr6r8r�rrr
rrrrErIrFrtrsr�rrrr�<module>s)soxml/sax/__pycache__/expatreader.cpython-38.opt-1.pyc000064400000030321151153537540016252 0ustar00U

e5dX=�@s�dZdZddlTddlmZmZddlmZddlmZmZddlm	Z	ddlm
Z
mZdd	lZej
d	d
�dkr|edd	��[zdd
lmZWnek
r�edd	��YnXeed�s�edd	��ddlmZmZmZejZejZzdd	lZWnek
�rdd�ZYnXdd	lZejZ[[Gdd�d�ZGdd�dej�ZGdd�dej ej�Z!dd�Z"e#dk�r�dd	l$Z%e"�Z&e&�'e%j(j�)��e&�*e%j(�+��e&�,d�d	S)z]
SAX driver for the pyexpat C module.  This driver works with
pyexpat.__version__ == '2.22'.
z0.20�)�*)�feature_validation�feature_namespaces)�feature_namespace_prefixes)�feature_external_ges�feature_external_pes)�feature_string_interning)�property_xml_string�property_interning_dictN��javazexpat not available in Java)�expatzexpat not supported�ParserCreate)�	xmlreader�saxutils�handlercCs|S�N�)�orr�+/usr/lib64/python3.8/xml/sax/expatreader.py�_mkproxy'src@seZdZdS)�
_ClosedParserN)�__name__�
__module__�__qualname__rrrrr.src@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�ExpatLocatorz�Locator for use with the ExpatParser class.

    This uses a weak reference to the parser object to avoid creating
    a circular reference between the parser and the content handler.
    cCst|�|_dSr)r�_ref��self�parserrrr�__init__9szExpatLocator.__init__cCs|j}|jdkrdS|jjSr)r�_parser�ErrorColumnNumberrrrr�getColumnNumber<s
zExpatLocator.getColumnNumbercCs|j}|jdkrdS|jjS�N�)rr!�ErrorLineNumberrrrr�
getLineNumberBs
zExpatLocator.getLineNumbercCs|j}|dkrdS|j��Sr)r�_source�getPublicIdrrrrr)HszExpatLocator.getPublicIdcCs|j}|dkrdS|j��Sr)rr(�getSystemIdrrrrr*NszExpatLocator.getSystemIdN)	rrr�__doc__r r#r'r)r*rrrrr3src@seZdZdZdCdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�ZdDdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Zd<d=�Z d>d?�Z!d@dA�Z"dBS)E�ExpatParserz$SAX driver for the pyexpat C module.r��cCsFtj�||�t��|_d|_||_d|_d|_g|_	d|_
d|_dS)Nr)r�IncrementalParserr ZInputSourcer(r!�_namespaces�_lex_handler_prop�_parsing�
_entity_stack�
_external_ges�
_interning)rZnamespaceHandling�bufsizerrrr Zs
zExpatParser.__init__cCsVt�|�}||_z*|��|j�t|��tj�	||�Wn|�
��YnXdS)z3Parse an XML document from a URL or an InputSource.N)r�prepare_input_sourcer(�reset�
_cont_handlerZsetDocumentLocatorrrr.�parse�
_close_source�r�sourcerrrr9gs
zExpatParser.parsecCs |��dk	r|j�|���dSr)r*r!ZSetBaser;rrr�
prepareParserwszExpatParser.prepareParsercCs tj�||�|jr|��dSr)rr.�setContentHandlerr1�_reset_cont_handler)rrrrrr>}szExpatParser.setContentHandlercCsP|tkr|jS|tkr |jdk	S|tttfkr2dS|tkr@|jSt	d|��dS)Nr�Feature '%s' not recognized)
rr/rr4rrrrr3�SAXNotRecognizedException�r�namerrr�
getFeature�s
�zExpatParser.getFeaturecCs�|jrtd��|tkr||_n�|tkr.||_nt|tkrT|rL|jdkrRi|_q�d|_nN|tkrj|r�td��n8|t	kr�|r�td��n"|t
kr�|r�td��ntd|��dS)Nz!Cannot set features while parsingz!expat does not support validationz/expat does not read external parameter entitiesz(expat does not report namespace prefixesr@)r1�SAXNotSupportedExceptionrr/rr3rr4rrrrA)rrC�staterrr�
setFeature�s:
����zExpatParser.setFeaturecCsd|tjkr|jS|tkr|jS|tkrT|jrLt|jd�rB|j��St	d��nt
d��t	d|��dS)N�GetInputContextz=This version of expat does not support getting the XML stringz.XML string cannot be returned when not parsing�Property '%s' not recognized)r�property_lexical_handlerr0r
r4r	r!�hasattrrHrArErBrrr�getProperty�s

��zExpatParser.getPropertycCsV|tjkr ||_|jrR|��n2|tkr0||_n"|tkrFtd|��nt	d|��dS)NzProperty '%s' cannot be setrI)
rrJr0r1�_reset_lex_handler_propr
r4r	rErA)rrC�valuerrr�setProperty�s

��zExpatParser.setPropertyc
Csz|js|��d|_|j��z|j�||�WnDtjk
rt}z$tt�	|j
�||�}|j�|�W5d}~XYnXdSr$)
r1r7r8Z
startDocumentr!ZParser
�errorZSAXParseExceptionZErrorString�codeZ_err_handlerZ
fatalError)r�data�isFinal�e�excrrr�feed�s
zExpatParser.feedcCsB|j}z|��}|dk	r |��W5|��}|dk	r<|��XdSr)r(Z
getByteStream�closeZgetCharacterStream)rr<�filerrrr:�szExpatParser._close_sourcecCs�|js|jdkst|jt�r dSz(|jddd�|j	�
�d|_d|_W5d|_|jdk	rzt�}|jj|_|jj|_||_|��XdS)Nr�r%)rS)r2r!�
isinstancerr1r"r&r:rVr8ZendDocumentrrrrrW�s 
�




zExpatParser.closecCs|jj|j_|jj|j_dSr)r8�processingInstructionr!ZProcessingInstructionHandler�
charactersZCharacterDataHandler�rrrrr?�s�zExpatParser._reset_cont_handlercCs`|j}|j}|dkr4d|_d|_d|_d|_d|_n(|j|_|j|_|j	|_|j
|_|j|_dSr)r0r!ZCommentHandlerZStartCdataSectionHandlerZEndCdataSectionHandlerZStartDoctypeDeclHandlerZEndDoctypeDeclHandlerZcommentZ
startCDATAZendCDATA�start_doctype_declZendDTD)rZlexrrrrrMsz#ExpatParser._reset_lex_handler_propcCs�|jr>tj|j��d|jd�|_d|j_|j|j_	|j
|j_n,tj|j��|jd�|_|j|j_	|j
|j_|��|j|j_|j|j_|j|j_|j|j_d|_|jr�|��|j|j_z|j|j_Wntk
r�YnX|j�tj �d|_!g|_"dS)N� )�internr%r)#r/r
rr(ZgetEncodingr4r!Znamespace_prefixes�start_element_nsZStartElementHandler�end_element_nsZEndElementHandler�
start_element�end_elementr?�unparsed_entity_declZUnparsedEntityDeclHandler�
notation_declZNotationDeclHandler�start_namespace_declZStartNamespaceDeclHandler�end_namespace_declZEndNamespaceDeclHandlerZ_decl_handler_propr0rM�external_entity_refZExternalEntityRefHandler�skipped_entity_handlerZSkippedEntityHandler�AttributeErrorZSetParamEntityParsingZ*XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONEr1r2r]rrrr7s<�
�






�zExpatParser.resetcCs|jdkrdS|jjSr)r!r"r]rrrr#;s
zExpatParser.getColumnNumbercCs|jdkrdS|jjSr$)r!r&r]rrrr'@s
zExpatParser.getLineNumbercCs
|j��Sr)r(r)r]rrrr)EszExpatParser.getPublicIdcCs
|j��Sr)r(r*r]rrrr*HszExpatParser.getSystemIdcCs|j�|t|��dSr)r8ZstartElement�AttributesImpl)rrC�attrsrrrrcLszExpatParser.start_elementcCs|j�|�dSr)r8Z
endElementrBrrrrdOszExpatParser.end_elementcCs�|��}t|�dkrd|f}n&t|�dkr<|d|df}nt|�}i}i}|��D]|\}}|��}t|�}	|	dkr�|}
d|f}n>|	dkr�d|d|df}
|d|df}n|d}
t|�}|||<|
||<qT|j�|dt||��dS)Nr%�rz%s:%s�)�split�len�tuple�itemsr8ZstartElementNS�AttributesNSImpl)rrCrm�pairZnewattrsZqnamesZanamerN�partsZlengthZqnameZapairrrrraRs0



�zExpatParser.start_element_nscCsV|��}t|�dkrd|f}n&t|�dkr<|d|df}nt|�}|j�|d�dS)Nr%rnr)rprqrrr8ZendElementNS)rrCrurrrrbts
zExpatParser.end_element_nscCs|j�||�dSr)r8r[)r�targetrRrrr�processing_instruction�sz"ExpatParser.processing_instructioncCs|j�|�dSr)r8r\)rrRrrr�character_data�szExpatParser.character_datacCs|j�||�dSr)r8ZstartPrefixMapping)r�prefixZurirrrrg�sz ExpatParser.start_namespace_declcCs|j�|�dSr)r8ZendPrefixMapping)rrzrrrrh�szExpatParser.end_namespace_declcCs|j�|||�dSr)r0ZstartDTD)rrC�sysid�pubidZhas_internal_subsetrrrr^�szExpatParser.start_doctype_declcCs|j�||||�dSr)�_dtd_handlerZunparsedEntityDecl)rrC�baser{r|Z
notation_namerrrre�sz ExpatParser.unparsed_entity_declcCs|j�|||�dSr)r}ZnotationDecl)rrCr~r{r|rrrrf�szExpatParser.notation_declcCs�|js
dS|j�||�}t�||j��p*d�}|j�|j	|jf�|j	�
|�|_	||_ztj�
||�WnYdSX|jd\|_	|_|jd=dS)Nr%rYr���)r3Z_ent_handlerZ
resolveEntityrr6r(r*r2�appendr!ZExternalEntityParserCreaterr.r9)r�contextr~r{r|r<rrrri�s"
�zExpatParser.external_entity_refcCs|rd|}|j�|�dS)N�%)r8Z
skippedEntity)rrCZis_perrrrj�sz"ExpatParser.skipped_entity_handlerN)rr-)r)#rrrr+r r9r=r>rDrGrLrOrVr:rWr?rMr7r#r'r)r*rcrdrarbrxryrgrhr^rerfrirjrrrrr,Ws@


'"r,cOs
t||�Sr)r,)�args�kwargsrrr�
create_parser�sr��__main__z:http://www.ibiblio.org/xml/examples/shakespeare/hamlet.xml)-r+�versionZxml.sax._exceptionsZxml.sax.handlerrrrrrrr	r
�sys�platformZSAXReaderNotAvailableZxml.parsersr
�ImportErrorrKZxml.saxrrrrlrt�_weakrefr�weakref�proxyrZLocatorrr.r,r�rZxml.sax.saxutilsZxml�pr>ZsaxZXMLGeneratorZsetErrorHandlerZErrorHandlerr9rrrr�<module>sN


$_
xml/sax/__pycache__/__init__.cpython-38.pyc000064400000006225151153537540014554 0ustar00U

e5d?�@s
dZddlmZddlmZmZddlmZmZm	Z	m
Z
mZe�fdd�Ze�fdd�Z
d	gZd
Zernd
dlZd
dlZd
dlZejjs�dejkr�ejd�d
�Z[dZejdd�dkr�ej�e�r�ej�e��d
�Zddd�Zejdd�dkr�dd�Zndd�Z[dS)a�Simple API for XML (SAX) implementation for Python.

This module provides an implementation of the SAX 2 interface;
information about the Java version of the interface can be found at
http://www.megginson.com/SAX/.  The Python version of the interface is
documented at <...>.

This package contains the following modules:

handler -- Base classes and constants which define the SAX 2 API for
           the 'client-side' of SAX for Python.

saxutils -- Implementation of the convenience classes commonly used to
            work with SAX.

xmlreader -- Base classes and constants which define the SAX 2 API for
             the parsers used with SAX for Python.

expatreader -- Driver that allows use of the Expat parser with SAX.
�)�InputSource)�ContentHandler�ErrorHandler)�SAXException�SAXNotRecognizedException�SAXParseException�SAXNotSupportedException�SAXReaderNotAvailablecCs(t�}|�|�|�|�|�|�dS)N)�make_parser�setContentHandler�setErrorHandler�parse)�source�handler�errorHandler�parser�r�(/usr/lib64/python3.8/xml/sax/__init__.pyr
s

r
cCspddl}|dkrt�}t�}|�|�|�|�t�}t|t�rR|�|�	|��n|�
|�|��|�|�dS)N�)
�iorr
rrr�
isinstance�strZsetCharacterStream�StringIOZ
setByteStream�BytesIOr
)�stringrrrrZinpsrcrrr�parseString#s


rzxml.sax.expatreaderrNZ
PY_SAX_PARSER�,zpython.xml.sax.parser��javarcCsxt|�tD]\}zt|�WStk
rT}zddl}||jkrD�W5d}~XYqtk
rfYqXqtdd��dS)a3Creates and returns a SAX parser.

    Creates the first parser it is able to instantiate of the ones
    given in the iterable created by chaining parser_list and
    default_parser_list.  The iterables must contain the names of Python
    modules containing both a SAX parser and a create_parser function.rNzNo parsers found)�list�default_parser_list�_create_parser�ImportError�sys�modulesr	)Zparser_list�parser_name�er#rrrr
Fs
r
cCs$ddlm}|�|dt��}|��S)Nr)�imp)Zorg.python.corer'Z
importName�globals�
create_parser)r%r'�
drv_modulerrrr!asr!cCst|iidg�}|��S)Nr))�
__import__r))r%r*rrrr!gs)r)�__doc__Z	xmlreaderrrrr�_exceptionsrrrrr	r
rr �_falseZxml.sax.expatreaderZxml�osr#�flags�ignore_environment�environ�splitZ_key�platform�registryZcontainsKeyZgetPropertyr
r!rrrr�<module>s*

xml/sax/saxutils.py000064400000027737151153537540010416 0ustar00"""\
A library of useful helper classes to the SAX classes, for the
convenience of application and driver writers.
"""

import os, urllib.parse, urllib.request
import io
import codecs
from . import handler
from . import xmlreader

def __dict_replace(s, d):
    """Replace substrings of a string using a dictionary."""
    for key, value in d.items():
        s = s.replace(key, value)
    return s

def escape(data, entities={}):
    """Escape &, <, and > in a string of data.

    You can escape other strings of data by passing a dictionary as
    the optional entities parameter.  The keys and values must all be
    strings; each key will be replaced with its corresponding value.
    """

    # must do ampersand first
    data = data.replace("&", "&amp;")
    data = data.replace(">", "&gt;")
    data = data.replace("<", "&lt;")
    if entities:
        data = __dict_replace(data, entities)
    return data

def unescape(data, entities={}):
    """Unescape &amp;, &lt;, and &gt; in a string of data.

    You can unescape other strings of data by passing a dictionary as
    the optional entities parameter.  The keys and values must all be
    strings; each key will be replaced with its corresponding value.
    """
    data = data.replace("&lt;", "<")
    data = data.replace("&gt;", ">")
    if entities:
        data = __dict_replace(data, entities)
    # must do ampersand last
    return data.replace("&amp;", "&")

def quoteattr(data, entities={}):
    """Escape and quote an attribute value.

    Escape &, <, and > in a string of data, then quote it for use as
    an attribute value.  The \" character will be escaped as well, if
    necessary.

    You can escape other strings of data by passing a dictionary as
    the optional entities parameter.  The keys and values must all be
    strings; each key will be replaced with its corresponding value.
    """
    entities = {**entities, '\n': '&#10;', '\r': '&#13;', '\t':'&#9;'}
    data = escape(data, entities)
    if '"' in data:
        if "'" in data:
            data = '"%s"' % data.replace('"', "&quot;")
        else:
            data = "'%s'" % data
    else:
        data = '"%s"' % data
    return data


def _gettextwriter(out, encoding):
    if out is None:
        import sys
        return sys.stdout

    if isinstance(out, io.TextIOBase):
        # use a text writer as is
        return out

    if isinstance(out, (codecs.StreamWriter, codecs.StreamReaderWriter)):
        # use a codecs stream writer as is
        return out

    # wrap a binary writer with TextIOWrapper
    if isinstance(out, io.RawIOBase):
        # Keep the original file open when the TextIOWrapper is
        # destroyed
        class _wrapper:
            __class__ = out.__class__
            def __getattr__(self, name):
                return getattr(out, name)
        buffer = _wrapper()
        buffer.close = lambda: None
    else:
        # This is to handle passed objects that aren't in the
        # IOBase hierarchy, but just have a write method
        buffer = io.BufferedIOBase()
        buffer.writable = lambda: True
        buffer.write = out.write
        try:
            # TextIOWrapper uses this methods to determine
            # if BOM (for UTF-16, etc) should be added
            buffer.seekable = out.seekable
            buffer.tell = out.tell
        except AttributeError:
            pass
    return io.TextIOWrapper(buffer, encoding=encoding,
                            errors='xmlcharrefreplace',
                            newline='\n',
                            write_through=True)

class XMLGenerator(handler.ContentHandler):

    def __init__(self, out=None, encoding="iso-8859-1", short_empty_elements=False):
        handler.ContentHandler.__init__(self)
        out = _gettextwriter(out, encoding)
        self._write = out.write
        self._flush = out.flush
        self._ns_contexts = [{}] # contains uri -> prefix dicts
        self._current_context = self._ns_contexts[-1]
        self._undeclared_ns_maps = []
        self._encoding = encoding
        self._short_empty_elements = short_empty_elements
        self._pending_start_element = False

    def _qname(self, name):
        """Builds a qualified name from a (ns_url, localname) pair"""
        if name[0]:
            # Per http://www.w3.org/XML/1998/namespace, The 'xml' prefix is
            # bound by definition to http://www.w3.org/XML/1998/namespace.  It
            # does not need to be declared and will not usually be found in
            # self._current_context.
            if 'http://www.w3.org/XML/1998/namespace' == name[0]:
                return 'xml:' + name[1]
            # The name is in a non-empty namespace
            prefix = self._current_context[name[0]]
            if prefix:
                # If it is not the default namespace, prepend the prefix
                return prefix + ":" + name[1]
        # Return the unqualified name
        return name[1]

    def _finish_pending_start_element(self,endElement=False):
        if self._pending_start_element:
            self._write('>')
            self._pending_start_element = False

    # ContentHandler methods

    def startDocument(self):
        self._write('<?xml version="1.0" encoding="%s"?>\n' %
                        self._encoding)

    def endDocument(self):
        self._flush()

    def startPrefixMapping(self, prefix, uri):
        self._ns_contexts.append(self._current_context.copy())
        self._current_context[uri] = prefix
        self._undeclared_ns_maps.append((prefix, uri))

    def endPrefixMapping(self, prefix):
        self._current_context = self._ns_contexts[-1]
        del self._ns_contexts[-1]

    def startElement(self, name, attrs):
        self._finish_pending_start_element()
        self._write('<' + name)
        for (name, value) in attrs.items():
            self._write(' %s=%s' % (name, quoteattr(value)))
        if self._short_empty_elements:
            self._pending_start_element = True
        else:
            self._write(">")

    def endElement(self, name):
        if self._pending_start_element:
            self._write('/>')
            self._pending_start_element = False
        else:
            self._write('</%s>' % name)

    def startElementNS(self, name, qname, attrs):
        self._finish_pending_start_element()
        self._write('<' + self._qname(name))

        for prefix, uri in self._undeclared_ns_maps:
            if prefix:
                self._write(' xmlns:%s="%s"' % (prefix, uri))
            else:
                self._write(' xmlns="%s"' % uri)
        self._undeclared_ns_maps = []

        for (name, value) in attrs.items():
            self._write(' %s=%s' % (self._qname(name), quoteattr(value)))
        if self._short_empty_elements:
            self._pending_start_element = True
        else:
            self._write(">")

    def endElementNS(self, name, qname):
        if self._pending_start_element:
            self._write('/>')
            self._pending_start_element = False
        else:
            self._write('</%s>' % self._qname(name))

    def characters(self, content):
        if content:
            self._finish_pending_start_element()
            if not isinstance(content, str):
                content = str(content, self._encoding)
            self._write(escape(content))

    def ignorableWhitespace(self, content):
        if content:
            self._finish_pending_start_element()
            if not isinstance(content, str):
                content = str(content, self._encoding)
            self._write(content)

    def processingInstruction(self, target, data):
        self._finish_pending_start_element()
        self._write('<?%s %s?>' % (target, data))


class XMLFilterBase(xmlreader.XMLReader):
    """This class is designed to sit between an XMLReader and the
    client application's event handlers.  By default, it does nothing
    but pass requests up to the reader and events on to the handlers
    unmodified, but subclasses can override specific methods to modify
    the event stream or the configuration requests as they pass
    through."""

    def __init__(self, parent = None):
        xmlreader.XMLReader.__init__(self)
        self._parent = parent

    # ErrorHandler methods

    def error(self, exception):
        self._err_handler.error(exception)

    def fatalError(self, exception):
        self._err_handler.fatalError(exception)

    def warning(self, exception):
        self._err_handler.warning(exception)

    # ContentHandler methods

    def setDocumentLocator(self, locator):
        self._cont_handler.setDocumentLocator(locator)

    def startDocument(self):
        self._cont_handler.startDocument()

    def endDocument(self):
        self._cont_handler.endDocument()

    def startPrefixMapping(self, prefix, uri):
        self._cont_handler.startPrefixMapping(prefix, uri)

    def endPrefixMapping(self, prefix):
        self._cont_handler.endPrefixMapping(prefix)

    def startElement(self, name, attrs):
        self._cont_handler.startElement(name, attrs)

    def endElement(self, name):
        self._cont_handler.endElement(name)

    def startElementNS(self, name, qname, attrs):
        self._cont_handler.startElementNS(name, qname, attrs)

    def endElementNS(self, name, qname):
        self._cont_handler.endElementNS(name, qname)

    def characters(self, content):
        self._cont_handler.characters(content)

    def ignorableWhitespace(self, chars):
        self._cont_handler.ignorableWhitespace(chars)

    def processingInstruction(self, target, data):
        self._cont_handler.processingInstruction(target, data)

    def skippedEntity(self, name):
        self._cont_handler.skippedEntity(name)

    # DTDHandler methods

    def notationDecl(self, name, publicId, systemId):
        self._dtd_handler.notationDecl(name, publicId, systemId)

    def unparsedEntityDecl(self, name, publicId, systemId, ndata):
        self._dtd_handler.unparsedEntityDecl(name, publicId, systemId, ndata)

    # EntityResolver methods

    def resolveEntity(self, publicId, systemId):
        return self._ent_handler.resolveEntity(publicId, systemId)

    # XMLReader methods

    def parse(self, source):
        self._parent.setContentHandler(self)
        self._parent.setErrorHandler(self)
        self._parent.setEntityResolver(self)
        self._parent.setDTDHandler(self)
        self._parent.parse(source)

    def setLocale(self, locale):
        self._parent.setLocale(locale)

    def getFeature(self, name):
        return self._parent.getFeature(name)

    def setFeature(self, name, state):
        self._parent.setFeature(name, state)

    def getProperty(self, name):
        return self._parent.getProperty(name)

    def setProperty(self, name, value):
        self._parent.setProperty(name, value)

    # XMLFilter methods

    def getParent(self):
        return self._parent

    def setParent(self, parent):
        self._parent = parent

# --- Utility functions

def prepare_input_source(source, base=""):
    """This function takes an InputSource and an optional base URL and
    returns a fully resolved InputSource object ready for reading."""

    if isinstance(source, os.PathLike):
        source = os.fspath(source)
    if isinstance(source, str):
        source = xmlreader.InputSource(source)
    elif hasattr(source, "read"):
        f = source
        source = xmlreader.InputSource()
        if isinstance(f.read(0), str):
            source.setCharacterStream(f)
        else:
            source.setByteStream(f)
        if hasattr(f, "name") and isinstance(f.name, str):
            source.setSystemId(f.name)

    if source.getCharacterStream() is None and source.getByteStream() is None:
        sysid = source.getSystemId()
        basehead = os.path.dirname(os.path.normpath(base))
        sysidfilename = os.path.join(basehead, sysid)
        if os.path.isfile(sysidfilename):
            source.setSystemId(sysidfilename)
            f = open(sysidfilename, "rb")
        else:
            source.setSystemId(urllib.parse.urljoin(base, sysid))
            f = urllib.request.urlopen(source.getSystemId())

        source.setByteStream(f)

    return source
xml/__init__.py000064400000001055151153537540007467 0ustar00"""Core XML support for Python.

This package contains four sub-packages:

dom -- The W3C Document Object Model.  This supports DOM Level 1 +
       Namespaces.

parsers -- Python wrappers for XML parsers (currently only supports Expat).

sax -- The Simple API for XML, developed by XML-Dev, led by David
       Megginson and ported to Python by Lars Marius Garshol.  This
       supports the SAX 2 API.

etree -- The ElementTree XML library.  This is a subset of the full
       ElementTree XML release.

"""


__all__ = ["dom", "parsers", "sax", "etree"]
xml/dom/domreg.py000064400000006573151153537540007776 0ustar00"""Registration facilities for DOM. This module should not be used
directly. Instead, the functions getDOMImplementation and
registerDOMImplementation should be imported from xml.dom."""

# This is a list of well-known implementations.  Well-known names
# should be published by posting to xml-sig@python.org, and are
# subsequently recorded in this file.

import sys

well_known_implementations = {
    'minidom':'xml.dom.minidom',
    '4DOM': 'xml.dom.DOMImplementation',
    }

# DOM implementations not officially registered should register
# themselves with their

registered = {}

def registerDOMImplementation(name, factory):
    """registerDOMImplementation(name, factory)

    Register the factory function with the name. The factory function
    should return an object which implements the DOMImplementation
    interface. The factory function can either return the same object,
    or a new one (e.g. if that implementation supports some
    customization)."""

    registered[name] = factory

def _good_enough(dom, features):
    "_good_enough(dom, features) -> Return 1 if the dom offers the features"
    for f,v in features:
        if not dom.hasFeature(f,v):
            return 0
    return 1

def getDOMImplementation(name=None, features=()):
    """getDOMImplementation(name = None, features = ()) -> DOM implementation.

    Return a suitable DOM implementation. The name is either
    well-known, the module name of a DOM implementation, or None. If
    it is not None, imports the corresponding module and returns
    DOMImplementation object if the import succeeds.

    If name is not given, consider the available implementations to
    find one with the required feature set. If no implementation can
    be found, raise an ImportError. The features list must be a sequence
    of (feature, version) pairs which are passed to hasFeature."""

    import os
    creator = None
    mod = well_known_implementations.get(name)
    if mod:
        mod = __import__(mod, {}, {}, ['getDOMImplementation'])
        return mod.getDOMImplementation()
    elif name:
        return registered[name]()
    elif not sys.flags.ignore_environment and "PYTHON_DOM" in os.environ:
        return getDOMImplementation(name = os.environ["PYTHON_DOM"])

    # User did not specify a name, try implementations in arbitrary
    # order, returning the one that has the required features
    if isinstance(features, str):
        features = _parse_feature_string(features)
    for creator in registered.values():
        dom = creator()
        if _good_enough(dom, features):
            return dom

    for creator in well_known_implementations.keys():
        try:
            dom = getDOMImplementation(name = creator)
        except Exception: # typically ImportError, or AttributeError
            continue
        if _good_enough(dom, features):
            return dom

    raise ImportError("no suitable DOM implementation found")

def _parse_feature_string(s):
    features = []
    parts = s.split()
    i = 0
    length = len(parts)
    while i < length:
        feature = parts[i]
        if feature[0] in "0123456789":
            raise ValueError("bad feature name: %r" % (feature,))
        i = i + 1
        version = None
        if i < length:
            v = parts[i]
            if v[0] in "0123456789":
                i = i + 1
                version = v
        features.append((feature, version))
    return tuple(features)
xml/dom/minicompat.py000064400000006447151153537540010661 0ustar00"""Python version compatibility support for minidom.

This module contains internal implementation details and
should not be imported; use xml.dom.minidom instead.
"""

# This module should only be imported using "import *".
#
# The following names are defined:
#
#   NodeList      -- lightest possible NodeList implementation
#
#   EmptyNodeList -- lightest possible NodeList that is guaranteed to
#                    remain empty (immutable)
#
#   StringTypes   -- tuple of defined string types
#
#   defproperty   -- function used in conjunction with GetattrMagic;
#                    using these together is needed to make them work
#                    as efficiently as possible in both Python 2.2+
#                    and older versions.  For example:
#
#                        class MyClass(GetattrMagic):
#                            def _get_myattr(self):
#                                return something
#
#                        defproperty(MyClass, "myattr",
#                                    "return some value")
#
#                    For Python 2.2 and newer, this will construct a
#                    property object on the class, which avoids
#                    needing to override __getattr__().  It will only
#                    work for read-only attributes.
#
#                    For older versions of Python, inheriting from
#                    GetattrMagic will use the traditional
#                    __getattr__() hackery to achieve the same effect,
#                    but less efficiently.
#
#                    defproperty() should be used for each version of
#                    the relevant _get_<property>() function.

__all__ = ["NodeList", "EmptyNodeList", "StringTypes", "defproperty"]

import xml.dom

StringTypes = (str,)


class NodeList(list):
    __slots__ = ()

    def item(self, index):
        if 0 <= index < len(self):
            return self[index]

    def _get_length(self):
        return len(self)

    def _set_length(self, value):
        raise xml.dom.NoModificationAllowedErr(
            "attempt to modify read-only attribute 'length'")

    length = property(_get_length, _set_length,
                      doc="The number of nodes in the NodeList.")

    # For backward compatibility
    def __setstate__(self, state):
        if state is None:
            state = []
        self[:] = state


class EmptyNodeList(tuple):
    __slots__ = ()

    def __add__(self, other):
        NL = NodeList()
        NL.extend(other)
        return NL

    def __radd__(self, other):
        NL = NodeList()
        NL.extend(other)
        return NL

    def item(self, index):
        return None

    def _get_length(self):
        return 0

    def _set_length(self, value):
        raise xml.dom.NoModificationAllowedErr(
            "attempt to modify read-only attribute 'length'")

    length = property(_get_length, _set_length,
                      doc="The number of nodes in the NodeList.")


def defproperty(klass, name, doc):
    get = getattr(klass, ("_get_" + name))
    def set(self, value, name=name):
        raise xml.dom.NoModificationAllowedErr(
            "attempt to modify read-only attribute " + repr(name))
    assert not hasattr(klass, "_set_" + name), \
           "expected not to find _set_" + name
    prop = property(get, set, doc=doc)
    setattr(klass, name, prop)
xml/dom/xmlbuilder.py000064400000030163151153537540010660 0ustar00"""Implementation of the DOM Level 3 'LS-Load' feature."""

import copy
import warnings
import xml.dom

from xml.dom.NodeFilter import NodeFilter


__all__ = ["DOMBuilder", "DOMEntityResolver", "DOMInputSource"]


class Options:
    """Features object that has variables set for each DOMBuilder feature.

    The DOMBuilder class uses an instance of this class to pass settings to
    the ExpatBuilder class.
    """

    # Note that the DOMBuilder class in LoadSave constrains which of these
    # values can be set using the DOM Level 3 LoadSave feature.

    namespaces = 1
    namespace_declarations = True
    validation = False
    external_parameter_entities = True
    external_general_entities = True
    external_dtd_subset = True
    validate_if_schema = False
    validate = False
    datatype_normalization = False
    create_entity_ref_nodes = True
    entities = True
    whitespace_in_element_content = True
    cdata_sections = True
    comments = True
    charset_overrides_xml_encoding = True
    infoset = False
    supported_mediatypes_only = False

    errorHandler = None
    filter = None


class DOMBuilder:
    entityResolver = None
    errorHandler = None
    filter = None

    ACTION_REPLACE = 1
    ACTION_APPEND_AS_CHILDREN = 2
    ACTION_INSERT_AFTER = 3
    ACTION_INSERT_BEFORE = 4

    _legal_actions = (ACTION_REPLACE, ACTION_APPEND_AS_CHILDREN,
                      ACTION_INSERT_AFTER, ACTION_INSERT_BEFORE)

    def __init__(self):
        self._options = Options()

    def _get_entityResolver(self):
        return self.entityResolver
    def _set_entityResolver(self, entityResolver):
        self.entityResolver = entityResolver

    def _get_errorHandler(self):
        return self.errorHandler
    def _set_errorHandler(self, errorHandler):
        self.errorHandler = errorHandler

    def _get_filter(self):
        return self.filter
    def _set_filter(self, filter):
        self.filter = filter

    def setFeature(self, name, state):
        if self.supportsFeature(name):
            state = state and 1 or 0
            try:
                settings = self._settings[(_name_xform(name), state)]
            except KeyError:
                raise xml.dom.NotSupportedErr(
                    "unsupported feature: %r" % (name,)) from None
            else:
                for name, value in settings:
                    setattr(self._options, name, value)
        else:
            raise xml.dom.NotFoundErr("unknown feature: " + repr(name))

    def supportsFeature(self, name):
        return hasattr(self._options, _name_xform(name))

    def canSetFeature(self, name, state):
        key = (_name_xform(name), state and 1 or 0)
        return key in self._settings

    # This dictionary maps from (feature,value) to a list of
    # (option,value) pairs that should be set on the Options object.
    # If a (feature,value) setting is not in this dictionary, it is
    # not supported by the DOMBuilder.
    #
    _settings = {
        ("namespace_declarations", 0): [
            ("namespace_declarations", 0)],
        ("namespace_declarations", 1): [
            ("namespace_declarations", 1)],
        ("validation", 0): [
            ("validation", 0)],
        ("external_general_entities", 0): [
            ("external_general_entities", 0)],
        ("external_general_entities", 1): [
            ("external_general_entities", 1)],
        ("external_parameter_entities", 0): [
            ("external_parameter_entities", 0)],
        ("external_parameter_entities", 1): [
            ("external_parameter_entities", 1)],
        ("validate_if_schema", 0): [
            ("validate_if_schema", 0)],
        ("create_entity_ref_nodes", 0): [
            ("create_entity_ref_nodes", 0)],
        ("create_entity_ref_nodes", 1): [
            ("create_entity_ref_nodes", 1)],
        ("entities", 0): [
            ("create_entity_ref_nodes", 0),
            ("entities", 0)],
        ("entities", 1): [
            ("entities", 1)],
        ("whitespace_in_element_content", 0): [
            ("whitespace_in_element_content", 0)],
        ("whitespace_in_element_content", 1): [
            ("whitespace_in_element_content", 1)],
        ("cdata_sections", 0): [
            ("cdata_sections", 0)],
        ("cdata_sections", 1): [
            ("cdata_sections", 1)],
        ("comments", 0): [
            ("comments", 0)],
        ("comments", 1): [
            ("comments", 1)],
        ("charset_overrides_xml_encoding", 0): [
            ("charset_overrides_xml_encoding", 0)],
        ("charset_overrides_xml_encoding", 1): [
            ("charset_overrides_xml_encoding", 1)],
        ("infoset", 0): [],
        ("infoset", 1): [
            ("namespace_declarations", 0),
            ("validate_if_schema", 0),
            ("create_entity_ref_nodes", 0),
            ("entities", 0),
            ("cdata_sections", 0),
            ("datatype_normalization", 1),
            ("whitespace_in_element_content", 1),
            ("comments", 1),
            ("charset_overrides_xml_encoding", 1)],
        ("supported_mediatypes_only", 0): [
            ("supported_mediatypes_only", 0)],
        ("namespaces", 0): [
            ("namespaces", 0)],
        ("namespaces", 1): [
            ("namespaces", 1)],
    }

    def getFeature(self, name):
        xname = _name_xform(name)
        try:
            return getattr(self._options, xname)
        except AttributeError:
            if name == "infoset":
                options = self._options
                return (options.datatype_normalization
                        and options.whitespace_in_element_content
                        and options.comments
                        and options.charset_overrides_xml_encoding
                        and not (options.namespace_declarations
                                 or options.validate_if_schema
                                 or options.create_entity_ref_nodes
                                 or options.entities
                                 or options.cdata_sections))
            raise xml.dom.NotFoundErr("feature %s not known" % repr(name))

    def parseURI(self, uri):
        if self.entityResolver:
            input = self.entityResolver.resolveEntity(None, uri)
        else:
            input = DOMEntityResolver().resolveEntity(None, uri)
        return self.parse(input)

    def parse(self, input):
        options = copy.copy(self._options)
        options.filter = self.filter
        options.errorHandler = self.errorHandler
        fp = input.byteStream
        if fp is None and options.systemId:
            import urllib.request
            fp = urllib.request.urlopen(input.systemId)
        return self._parse_bytestream(fp, options)

    def parseWithContext(self, input, cnode, action):
        if action not in self._legal_actions:
            raise ValueError("not a legal action")
        raise NotImplementedError("Haven't written this yet...")

    def _parse_bytestream(self, stream, options):
        import xml.dom.expatbuilder
        builder = xml.dom.expatbuilder.makeBuilder(options)
        return builder.parseFile(stream)


def _name_xform(name):
    return name.lower().replace('-', '_')


class DOMEntityResolver(object):
    __slots__ = '_opener',

    def resolveEntity(self, publicId, systemId):
        assert systemId is not None
        source = DOMInputSource()
        source.publicId = publicId
        source.systemId = systemId
        source.byteStream = self._get_opener().open(systemId)

        # determine the encoding if the transport provided it
        source.encoding = self._guess_media_encoding(source)

        # determine the base URI is we can
        import posixpath, urllib.parse
        parts = urllib.parse.urlparse(systemId)
        scheme, netloc, path, params, query, fragment = parts
        # XXX should we check the scheme here as well?
        if path and not path.endswith("/"):
            path = posixpath.dirname(path) + "/"
            parts = scheme, netloc, path, params, query, fragment
            source.baseURI = urllib.parse.urlunparse(parts)

        return source

    def _get_opener(self):
        try:
            return self._opener
        except AttributeError:
            self._opener = self._create_opener()
            return self._opener

    def _create_opener(self):
        import urllib.request
        return urllib.request.build_opener()

    def _guess_media_encoding(self, source):
        info = source.byteStream.info()
        if "Content-Type" in info:
            for param in info.getplist():
                if param.startswith("charset="):
                    return param.split("=", 1)[1].lower()


class DOMInputSource(object):
    __slots__ = ('byteStream', 'characterStream', 'stringData',
                 'encoding', 'publicId', 'systemId', 'baseURI')

    def __init__(self):
        self.byteStream = None
        self.characterStream = None
        self.stringData = None
        self.encoding = None
        self.publicId = None
        self.systemId = None
        self.baseURI = None

    def _get_byteStream(self):
        return self.byteStream
    def _set_byteStream(self, byteStream):
        self.byteStream = byteStream

    def _get_characterStream(self):
        return self.characterStream
    def _set_characterStream(self, characterStream):
        self.characterStream = characterStream

    def _get_stringData(self):
        return self.stringData
    def _set_stringData(self, data):
        self.stringData = data

    def _get_encoding(self):
        return self.encoding
    def _set_encoding(self, encoding):
        self.encoding = encoding

    def _get_publicId(self):
        return self.publicId
    def _set_publicId(self, publicId):
        self.publicId = publicId

    def _get_systemId(self):
        return self.systemId
    def _set_systemId(self, systemId):
        self.systemId = systemId

    def _get_baseURI(self):
        return self.baseURI
    def _set_baseURI(self, uri):
        self.baseURI = uri


class DOMBuilderFilter:
    """Element filter which can be used to tailor construction of
    a DOM instance.
    """

    # There's really no need for this class; concrete implementations
    # should just implement the endElement() and startElement()
    # methods as appropriate.  Using this makes it easy to only
    # implement one of them.

    FILTER_ACCEPT = 1
    FILTER_REJECT = 2
    FILTER_SKIP = 3
    FILTER_INTERRUPT = 4

    whatToShow = NodeFilter.SHOW_ALL

    def _get_whatToShow(self):
        return self.whatToShow

    def acceptNode(self, element):
        return self.FILTER_ACCEPT

    def startContainer(self, element):
        return self.FILTER_ACCEPT

del NodeFilter


class DocumentLS:
    """Mixin to create documents that conform to the load/save spec."""

    async_ = False

    def _get_async(self):
        return False

    def _set_async(self, flag):
        if flag:
            raise xml.dom.NotSupportedErr(
                "asynchronous document loading is not supported")

    def abort(self):
        # What does it mean to "clear" a document?  Does the
        # documentElement disappear?
        raise NotImplementedError(
            "haven't figured out what this means yet")

    def load(self, uri):
        raise NotImplementedError("haven't written this yet")

    def loadXML(self, source):
        raise NotImplementedError("haven't written this yet")

    def saveXML(self, snode):
        if snode is None:
            snode = self
        elif snode.ownerDocument is not self:
            raise xml.dom.WrongDocumentErr()
        return snode.toxml()


class DOMImplementationLS:
    MODE_SYNCHRONOUS = 1
    MODE_ASYNCHRONOUS = 2

    def createDOMBuilder(self, mode, schemaType):
        if schemaType is not None:
            raise xml.dom.NotSupportedErr(
                "schemaType not yet supported")
        if mode == self.MODE_SYNCHRONOUS:
            return DOMBuilder()
        if mode == self.MODE_ASYNCHRONOUS:
            raise xml.dom.NotSupportedErr(
                "asynchronous builders are not supported")
        raise ValueError("unknown value for mode")

    def createDOMWriter(self):
        raise NotImplementedError(
            "the writer interface hasn't been written yet!")

    def createDOMInputSource(self):
        return DOMInputSource()
xml/dom/expatbuilder.py000064400000105654151153537540011211 0ustar00"""Facility to use the Expat parser to load a minidom instance
from a string or file.

This avoids all the overhead of SAX and pulldom to gain performance.
"""

# Warning!
#
# This module is tightly bound to the implementation details of the
# minidom DOM and can't be used with other DOM implementations.  This
# is due, in part, to a lack of appropriate methods in the DOM (there is
# no way to create Entity and Notation nodes via the DOM Level 2
# interface), and for performance.  The latter is the cause of some fairly
# cryptic code.
#
# Performance hacks:
#
#   -  .character_data_handler() has an extra case in which continuing
#      data is appended to an existing Text node; this can be a
#      speedup since pyexpat can break up character data into multiple
#      callbacks even though we set the buffer_text attribute on the
#      parser.  This also gives us the advantage that we don't need a
#      separate normalization pass.
#
#   -  Determining that a node exists is done using an identity comparison
#      with None rather than a truth test; this avoids searching for and
#      calling any methods on the node object if it exists.  (A rather
#      nice speedup is achieved this way as well!)

from xml.dom import xmlbuilder, minidom, Node
from xml.dom import EMPTY_NAMESPACE, EMPTY_PREFIX, XMLNS_NAMESPACE
from xml.parsers import expat
from xml.dom.minidom import _append_child, _set_attribute_node
from xml.dom.NodeFilter import NodeFilter

TEXT_NODE = Node.TEXT_NODE
CDATA_SECTION_NODE = Node.CDATA_SECTION_NODE
DOCUMENT_NODE = Node.DOCUMENT_NODE

FILTER_ACCEPT = xmlbuilder.DOMBuilderFilter.FILTER_ACCEPT
FILTER_REJECT = xmlbuilder.DOMBuilderFilter.FILTER_REJECT
FILTER_SKIP = xmlbuilder.DOMBuilderFilter.FILTER_SKIP
FILTER_INTERRUPT = xmlbuilder.DOMBuilderFilter.FILTER_INTERRUPT

theDOMImplementation = minidom.getDOMImplementation()

# Expat typename -> TypeInfo
_typeinfo_map = {
    "CDATA":    minidom.TypeInfo(None, "cdata"),
    "ENUM":     minidom.TypeInfo(None, "enumeration"),
    "ENTITY":   minidom.TypeInfo(None, "entity"),
    "ENTITIES": minidom.TypeInfo(None, "entities"),
    "ID":       minidom.TypeInfo(None, "id"),
    "IDREF":    minidom.TypeInfo(None, "idref"),
    "IDREFS":   minidom.TypeInfo(None, "idrefs"),
    "NMTOKEN":  minidom.TypeInfo(None, "nmtoken"),
    "NMTOKENS": minidom.TypeInfo(None, "nmtokens"),
    }

class ElementInfo(object):
    __slots__ = '_attr_info', '_model', 'tagName'

    def __init__(self, tagName, model=None):
        self.tagName = tagName
        self._attr_info = []
        self._model = model

    def __getstate__(self):
        return self._attr_info, self._model, self.tagName

    def __setstate__(self, state):
        self._attr_info, self._model, self.tagName = state

    def getAttributeType(self, aname):
        for info in self._attr_info:
            if info[1] == aname:
                t = info[-2]
                if t[0] == "(":
                    return _typeinfo_map["ENUM"]
                else:
                    return _typeinfo_map[info[-2]]
        return minidom._no_type

    def getAttributeTypeNS(self, namespaceURI, localName):
        return minidom._no_type

    def isElementContent(self):
        if self._model:
            type = self._model[0]
            return type not in (expat.model.XML_CTYPE_ANY,
                                expat.model.XML_CTYPE_MIXED)
        else:
            return False

    def isEmpty(self):
        if self._model:
            return self._model[0] == expat.model.XML_CTYPE_EMPTY
        else:
            return False

    def isId(self, aname):
        for info in self._attr_info:
            if info[1] == aname:
                return info[-2] == "ID"
        return False

    def isIdNS(self, euri, ename, auri, aname):
        # not sure this is meaningful
        return self.isId((auri, aname))

def _intern(builder, s):
    return builder._intern_setdefault(s, s)

def _parse_ns_name(builder, name):
    assert ' ' in name
    parts = name.split(' ')
    intern = builder._intern_setdefault
    if len(parts) == 3:
        uri, localname, prefix = parts
        prefix = intern(prefix, prefix)
        qname = "%s:%s" % (prefix, localname)
        qname = intern(qname, qname)
        localname = intern(localname, localname)
    elif len(parts) == 2:
        uri, localname = parts
        prefix = EMPTY_PREFIX
        qname = localname = intern(localname, localname)
    else:
        raise ValueError("Unsupported syntax: spaces in URIs not supported: %r" % name)
    return intern(uri, uri), localname, prefix, qname


class ExpatBuilder:
    """Document builder that uses Expat to build a ParsedXML.DOM document
    instance."""

    def __init__(self, options=None):
        if options is None:
            options = xmlbuilder.Options()
        self._options = options
        if self._options.filter is not None:
            self._filter = FilterVisibilityController(self._options.filter)
        else:
            self._filter = None
            # This *really* doesn't do anything in this case, so
            # override it with something fast & minimal.
            self._finish_start_element = id
        self._parser = None
        self.reset()

    def createParser(self):
        """Create a new parser object."""
        return expat.ParserCreate()

    def getParser(self):
        """Return the parser object, creating a new one if needed."""
        if not self._parser:
            self._parser = self.createParser()
            self._intern_setdefault = self._parser.intern.setdefault
            self._parser.buffer_text = True
            self._parser.ordered_attributes = True
            self._parser.specified_attributes = True
            self.install(self._parser)
        return self._parser

    def reset(self):
        """Free all data structures used during DOM construction."""
        self.document = theDOMImplementation.createDocument(
            EMPTY_NAMESPACE, None, None)
        self.curNode = self.document
        self._elem_info = self.document._elem_info
        self._cdata = False

    def install(self, parser):
        """Install the callbacks needed to build the DOM into the parser."""
        # This creates circular references!
        parser.StartDoctypeDeclHandler = self.start_doctype_decl_handler
        parser.StartElementHandler = self.first_element_handler
        parser.EndElementHandler = self.end_element_handler
        parser.ProcessingInstructionHandler = self.pi_handler
        if self._options.entities:
            parser.EntityDeclHandler = self.entity_decl_handler
        parser.NotationDeclHandler = self.notation_decl_handler
        if self._options.comments:
            parser.CommentHandler = self.comment_handler
        if self._options.cdata_sections:
            parser.StartCdataSectionHandler = self.start_cdata_section_handler
            parser.EndCdataSectionHandler = self.end_cdata_section_handler
            parser.CharacterDataHandler = self.character_data_handler_cdata
        else:
            parser.CharacterDataHandler = self.character_data_handler
        parser.ExternalEntityRefHandler = self.external_entity_ref_handler
        parser.XmlDeclHandler = self.xml_decl_handler
        parser.ElementDeclHandler = self.element_decl_handler
        parser.AttlistDeclHandler = self.attlist_decl_handler

    def parseFile(self, file):
        """Parse a document from a file object, returning the document
        node."""
        parser = self.getParser()
        first_buffer = True
        try:
            while 1:
                buffer = file.read(16*1024)
                if not buffer:
                    break
                parser.Parse(buffer, 0)
                if first_buffer and self.document.documentElement:
                    self._setup_subset(buffer)
                first_buffer = False
            parser.Parse("", True)
        except ParseEscape:
            pass
        doc = self.document
        self.reset()
        self._parser = None
        return doc

    def parseString(self, string):
        """Parse a document from a string, returning the document node."""
        parser = self.getParser()
        try:
            parser.Parse(string, True)
            self._setup_subset(string)
        except ParseEscape:
            pass
        doc = self.document
        self.reset()
        self._parser = None
        return doc

    def _setup_subset(self, buffer):
        """Load the internal subset if there might be one."""
        if self.document.doctype:
            extractor = InternalSubsetExtractor()
            extractor.parseString(buffer)
            subset = extractor.getSubset()
            self.document.doctype.internalSubset = subset

    def start_doctype_decl_handler(self, doctypeName, systemId, publicId,
                                   has_internal_subset):
        doctype = self.document.implementation.createDocumentType(
            doctypeName, publicId, systemId)
        doctype.ownerDocument = self.document
        _append_child(self.document, doctype)
        self.document.doctype = doctype
        if self._filter and self._filter.acceptNode(doctype) == FILTER_REJECT:
            self.document.doctype = None
            del self.document.childNodes[-1]
            doctype = None
            self._parser.EntityDeclHandler = None
            self._parser.NotationDeclHandler = None
        if has_internal_subset:
            if doctype is not None:
                doctype.entities._seq = []
                doctype.notations._seq = []
            self._parser.CommentHandler = None
            self._parser.ProcessingInstructionHandler = None
            self._parser.EndDoctypeDeclHandler = self.end_doctype_decl_handler

    def end_doctype_decl_handler(self):
        if self._options.comments:
            self._parser.CommentHandler = self.comment_handler
        self._parser.ProcessingInstructionHandler = self.pi_handler
        if not (self._elem_info or self._filter):
            self._finish_end_element = id

    def pi_handler(self, target, data):
        node = self.document.createProcessingInstruction(target, data)
        _append_child(self.curNode, node)
        if self._filter and self._filter.acceptNode(node) == FILTER_REJECT:
            self.curNode.removeChild(node)

    def character_data_handler_cdata(self, data):
        childNodes = self.curNode.childNodes
        if self._cdata:
            if (  self._cdata_continue
                  and childNodes[-1].nodeType == CDATA_SECTION_NODE):
                childNodes[-1].appendData(data)
                return
            node = self.document.createCDATASection(data)
            self._cdata_continue = True
        elif childNodes and childNodes[-1].nodeType == TEXT_NODE:
            node = childNodes[-1]
            value = node.data + data
            node.data = value
            return
        else:
            node = minidom.Text()
            node.data = data
            node.ownerDocument = self.document
        _append_child(self.curNode, node)

    def character_data_handler(self, data):
        childNodes = self.curNode.childNodes
        if childNodes and childNodes[-1].nodeType == TEXT_NODE:
            node = childNodes[-1]
            node.data = node.data + data
            return
        node = minidom.Text()
        node.data = node.data + data
        node.ownerDocument = self.document
        _append_child(self.curNode, node)

    def entity_decl_handler(self, entityName, is_parameter_entity, value,
                            base, systemId, publicId, notationName):
        if is_parameter_entity:
            # we don't care about parameter entities for the DOM
            return
        if not self._options.entities:
            return
        node = self.document._create_entity(entityName, publicId,
                                            systemId, notationName)
        if value is not None:
            # internal entity
            # node *should* be readonly, but we'll cheat
            child = self.document.createTextNode(value)
            node.childNodes.append(child)
        self.document.doctype.entities._seq.append(node)
        if self._filter and self._filter.acceptNode(node) == FILTER_REJECT:
            del self.document.doctype.entities._seq[-1]

    def notation_decl_handler(self, notationName, base, systemId, publicId):
        node = self.document._create_notation(notationName, publicId, systemId)
        self.document.doctype.notations._seq.append(node)
        if self._filter and self._filter.acceptNode(node) == FILTER_ACCEPT:
            del self.document.doctype.notations._seq[-1]

    def comment_handler(self, data):
        node = self.document.createComment(data)
        _append_child(self.curNode, node)
        if self._filter and self._filter.acceptNode(node) == FILTER_REJECT:
            self.curNode.removeChild(node)

    def start_cdata_section_handler(self):
        self._cdata = True
        self._cdata_continue = False

    def end_cdata_section_handler(self):
        self._cdata = False
        self._cdata_continue = False

    def external_entity_ref_handler(self, context, base, systemId, publicId):
        return 1

    def first_element_handler(self, name, attributes):
        if self._filter is None and not self._elem_info:
            self._finish_end_element = id
        self.getParser().StartElementHandler = self.start_element_handler
        self.start_element_handler(name, attributes)

    def start_element_handler(self, name, attributes):
        node = self.document.createElement(name)
        _append_child(self.curNode, node)
        self.curNode = node

        if attributes:
            for i in range(0, len(attributes), 2):
                a = minidom.Attr(attributes[i], EMPTY_NAMESPACE,
                                 None, EMPTY_PREFIX)
                value = attributes[i+1]
                a.value = value
                a.ownerDocument = self.document
                _set_attribute_node(node, a)

        if node is not self.document.documentElement:
            self._finish_start_element(node)

    def _finish_start_element(self, node):
        if self._filter:
            # To be general, we'd have to call isSameNode(), but this
            # is sufficient for minidom:
            if node is self.document.documentElement:
                return
            filt = self._filter.startContainer(node)
            if filt == FILTER_REJECT:
                # ignore this node & all descendents
                Rejecter(self)
            elif filt == FILTER_SKIP:
                # ignore this node, but make it's children become
                # children of the parent node
                Skipper(self)
            else:
                return
            self.curNode = node.parentNode
            node.parentNode.removeChild(node)
            node.unlink()

    # If this ever changes, Namespaces.end_element_handler() needs to
    # be changed to match.
    #
    def end_element_handler(self, name):
        curNode = self.curNode
        self.curNode = curNode.parentNode
        self._finish_end_element(curNode)

    def _finish_end_element(self, curNode):
        info = self._elem_info.get(curNode.tagName)
        if info:
            self._handle_white_text_nodes(curNode, info)
        if self._filter:
            if curNode is self.document.documentElement:
                return
            if self._filter.acceptNode(curNode) == FILTER_REJECT:
                self.curNode.removeChild(curNode)
                curNode.unlink()

    def _handle_white_text_nodes(self, node, info):
        if (self._options.whitespace_in_element_content
            or not info.isElementContent()):
            return

        # We have element type information and should remove ignorable
        # whitespace; identify for text nodes which contain only
        # whitespace.
        L = []
        for child in node.childNodes:
            if child.nodeType == TEXT_NODE and not child.data.strip():
                L.append(child)

        # Remove ignorable whitespace from the tree.
        for child in L:
            node.removeChild(child)

    def element_decl_handler(self, name, model):
        info = self._elem_info.get(name)
        if info is None:
            self._elem_info[name] = ElementInfo(name, model)
        else:
            assert info._model is None
            info._model = model

    def attlist_decl_handler(self, elem, name, type, default, required):
        info = self._elem_info.get(elem)
        if info is None:
            info = ElementInfo(elem)
            self._elem_info[elem] = info
        info._attr_info.append(
            [None, name, None, None, default, 0, type, required])

    def xml_decl_handler(self, version, encoding, standalone):
        self.document.version = version
        self.document.encoding = encoding
        # This is still a little ugly, thanks to the pyexpat API. ;-(
        if standalone >= 0:
            if standalone:
                self.document.standalone = True
            else:
                self.document.standalone = False


# Don't include FILTER_INTERRUPT, since that's checked separately
# where allowed.
_ALLOWED_FILTER_RETURNS = (FILTER_ACCEPT, FILTER_REJECT, FILTER_SKIP)

class FilterVisibilityController(object):
    """Wrapper around a DOMBuilderFilter which implements the checks
    to make the whatToShow filter attribute work."""

    __slots__ = 'filter',

    def __init__(self, filter):
        self.filter = filter

    def startContainer(self, node):
        mask = self._nodetype_mask[node.nodeType]
        if self.filter.whatToShow & mask:
            val = self.filter.startContainer(node)
            if val == FILTER_INTERRUPT:
                raise ParseEscape
            if val not in _ALLOWED_FILTER_RETURNS:
                raise ValueError(
                      "startContainer() returned illegal value: " + repr(val))
            return val
        else:
            return FILTER_ACCEPT

    def acceptNode(self, node):
        mask = self._nodetype_mask[node.nodeType]
        if self.filter.whatToShow & mask:
            val = self.filter.acceptNode(node)
            if val == FILTER_INTERRUPT:
                raise ParseEscape
            if val == FILTER_SKIP:
                # move all child nodes to the parent, and remove this node
                parent = node.parentNode
                for child in node.childNodes[:]:
                    parent.appendChild(child)
                # node is handled by the caller
                return FILTER_REJECT
            if val not in _ALLOWED_FILTER_RETURNS:
                raise ValueError(
                      "acceptNode() returned illegal value: " + repr(val))
            return val
        else:
            return FILTER_ACCEPT

    _nodetype_mask = {
        Node.ELEMENT_NODE:                NodeFilter.SHOW_ELEMENT,
        Node.ATTRIBUTE_NODE:              NodeFilter.SHOW_ATTRIBUTE,
        Node.TEXT_NODE:                   NodeFilter.SHOW_TEXT,
        Node.CDATA_SECTION_NODE:          NodeFilter.SHOW_CDATA_SECTION,
        Node.ENTITY_REFERENCE_NODE:       NodeFilter.SHOW_ENTITY_REFERENCE,
        Node.ENTITY_NODE:                 NodeFilter.SHOW_ENTITY,
        Node.PROCESSING_INSTRUCTION_NODE: NodeFilter.SHOW_PROCESSING_INSTRUCTION,
        Node.COMMENT_NODE:                NodeFilter.SHOW_COMMENT,
        Node.DOCUMENT_NODE:               NodeFilter.SHOW_DOCUMENT,
        Node.DOCUMENT_TYPE_NODE:          NodeFilter.SHOW_DOCUMENT_TYPE,
        Node.DOCUMENT_FRAGMENT_NODE:      NodeFilter.SHOW_DOCUMENT_FRAGMENT,
        Node.NOTATION_NODE:               NodeFilter.SHOW_NOTATION,
        }


class FilterCrutch(object):
    __slots__ = '_builder', '_level', '_old_start', '_old_end'

    def __init__(self, builder):
        self._level = 0
        self._builder = builder
        parser = builder._parser
        self._old_start = parser.StartElementHandler
        self._old_end = parser.EndElementHandler
        parser.StartElementHandler = self.start_element_handler
        parser.EndElementHandler = self.end_element_handler

class Rejecter(FilterCrutch):
    __slots__ = ()

    def __init__(self, builder):
        FilterCrutch.__init__(self, builder)
        parser = builder._parser
        for name in ("ProcessingInstructionHandler",
                     "CommentHandler",
                     "CharacterDataHandler",
                     "StartCdataSectionHandler",
                     "EndCdataSectionHandler",
                     "ExternalEntityRefHandler",
                     ):
            setattr(parser, name, None)

    def start_element_handler(self, *args):
        self._level = self._level + 1

    def end_element_handler(self, *args):
        if self._level == 0:
            # restore the old handlers
            parser = self._builder._parser
            self._builder.install(parser)
            parser.StartElementHandler = self._old_start
            parser.EndElementHandler = self._old_end
        else:
            self._level = self._level - 1

class Skipper(FilterCrutch):
    __slots__ = ()

    def start_element_handler(self, *args):
        node = self._builder.curNode
        self._old_start(*args)
        if self._builder.curNode is not node:
            self._level = self._level + 1

    def end_element_handler(self, *args):
        if self._level == 0:
            # We're popping back out of the node we're skipping, so we
            # shouldn't need to do anything but reset the handlers.
            self._builder._parser.StartElementHandler = self._old_start
            self._builder._parser.EndElementHandler = self._old_end
            self._builder = None
        else:
            self._level = self._level - 1
            self._old_end(*args)


# framework document used by the fragment builder.
# Takes a string for the doctype, subset string, and namespace attrs string.

_FRAGMENT_BUILDER_INTERNAL_SYSTEM_ID = \
    "http://xml.python.org/entities/fragment-builder/internal"

_FRAGMENT_BUILDER_TEMPLATE = (
    '''\
<!DOCTYPE wrapper
  %%s [
  <!ENTITY fragment-builder-internal
    SYSTEM "%s">
%%s
]>
<wrapper %%s
>&fragment-builder-internal;</wrapper>'''
    % _FRAGMENT_BUILDER_INTERNAL_SYSTEM_ID)


class FragmentBuilder(ExpatBuilder):
    """Builder which constructs document fragments given XML source
    text and a context node.

    The context node is expected to provide information about the
    namespace declarations which are in scope at the start of the
    fragment.
    """

    def __init__(self, context, options=None):
        if context.nodeType == DOCUMENT_NODE:
            self.originalDocument = context
            self.context = context
        else:
            self.originalDocument = context.ownerDocument
            self.context = context
        ExpatBuilder.__init__(self, options)

    def reset(self):
        ExpatBuilder.reset(self)
        self.fragment = None

    def parseFile(self, file):
        """Parse a document fragment from a file object, returning the
        fragment node."""
        return self.parseString(file.read())

    def parseString(self, string):
        """Parse a document fragment from a string, returning the
        fragment node."""
        self._source = string
        parser = self.getParser()
        doctype = self.originalDocument.doctype
        ident = ""
        if doctype:
            subset = doctype.internalSubset or self._getDeclarations()
            if doctype.publicId:
                ident = ('PUBLIC "%s" "%s"'
                         % (doctype.publicId, doctype.systemId))
            elif doctype.systemId:
                ident = 'SYSTEM "%s"' % doctype.systemId
        else:
            subset = ""
        nsattrs = self._getNSattrs() # get ns decls from node's ancestors
        document = _FRAGMENT_BUILDER_TEMPLATE % (ident, subset, nsattrs)
        try:
            parser.Parse(document, 1)
        except:
            self.reset()
            raise
        fragment = self.fragment
        self.reset()
##         self._parser = None
        return fragment

    def _getDeclarations(self):
        """Re-create the internal subset from the DocumentType node.

        This is only needed if we don't already have the
        internalSubset as a string.
        """
        doctype = self.context.ownerDocument.doctype
        s = ""
        if doctype:
            for i in range(doctype.notations.length):
                notation = doctype.notations.item(i)
                if s:
                    s = s + "\n  "
                s = "%s<!NOTATION %s" % (s, notation.nodeName)
                if notation.publicId:
                    s = '%s PUBLIC "%s"\n             "%s">' \
                        % (s, notation.publicId, notation.systemId)
                else:
                    s = '%s SYSTEM "%s">' % (s, notation.systemId)
            for i in range(doctype.entities.length):
                entity = doctype.entities.item(i)
                if s:
                    s = s + "\n  "
                s = "%s<!ENTITY %s" % (s, entity.nodeName)
                if entity.publicId:
                    s = '%s PUBLIC "%s"\n             "%s"' \
                        % (s, entity.publicId, entity.systemId)
                elif entity.systemId:
                    s = '%s SYSTEM "%s"' % (s, entity.systemId)
                else:
                    s = '%s "%s"' % (s, entity.firstChild.data)
                if entity.notationName:
                    s = "%s NOTATION %s" % (s, entity.notationName)
                s = s + ">"
        return s

    def _getNSattrs(self):
        return ""

    def external_entity_ref_handler(self, context, base, systemId, publicId):
        if systemId == _FRAGMENT_BUILDER_INTERNAL_SYSTEM_ID:
            # this entref is the one that we made to put the subtree
            # in; all of our given input is parsed in here.
            old_document = self.document
            old_cur_node = self.curNode
            parser = self._parser.ExternalEntityParserCreate(context)
            # put the real document back, parse into the fragment to return
            self.document = self.originalDocument
            self.fragment = self.document.createDocumentFragment()
            self.curNode = self.fragment
            try:
                parser.Parse(self._source, 1)
            finally:
                self.curNode = old_cur_node
                self.document = old_document
                self._source = None
            return -1
        else:
            return ExpatBuilder.external_entity_ref_handler(
                self, context, base, systemId, publicId)


class Namespaces:
    """Mix-in class for builders; adds support for namespaces."""

    def _initNamespaces(self):
        # list of (prefix, uri) ns declarations.  Namespace attrs are
        # constructed from this and added to the element's attrs.
        self._ns_ordered_prefixes = []

    def createParser(self):
        """Create a new namespace-handling parser."""
        parser = expat.ParserCreate(namespace_separator=" ")
        parser.namespace_prefixes = True
        return parser

    def install(self, parser):
        """Insert the namespace-handlers onto the parser."""
        ExpatBuilder.install(self, parser)
        if self._options.namespace_declarations:
            parser.StartNamespaceDeclHandler = (
                self.start_namespace_decl_handler)

    def start_namespace_decl_handler(self, prefix, uri):
        """Push this namespace declaration on our storage."""
        self._ns_ordered_prefixes.append((prefix, uri))

    def start_element_handler(self, name, attributes):
        if ' ' in name:
            uri, localname, prefix, qname = _parse_ns_name(self, name)
        else:
            uri = EMPTY_NAMESPACE
            qname = name
            localname = None
            prefix = EMPTY_PREFIX
        node = minidom.Element(qname, uri, prefix, localname)
        node.ownerDocument = self.document
        _append_child(self.curNode, node)
        self.curNode = node

        if self._ns_ordered_prefixes:
            for prefix, uri in self._ns_ordered_prefixes:
                if prefix:
                    a = minidom.Attr(_intern(self, 'xmlns:' + prefix),
                                     XMLNS_NAMESPACE, prefix, "xmlns")
                else:
                    a = minidom.Attr("xmlns", XMLNS_NAMESPACE,
                                     "xmlns", EMPTY_PREFIX)
                a.value = uri
                a.ownerDocument = self.document
                _set_attribute_node(node, a)
            del self._ns_ordered_prefixes[:]

        if attributes:
            node._ensure_attributes()
            _attrs = node._attrs
            _attrsNS = node._attrsNS
            for i in range(0, len(attributes), 2):
                aname = attributes[i]
                value = attributes[i+1]
                if ' ' in aname:
                    uri, localname, prefix, qname = _parse_ns_name(self, aname)
                    a = minidom.Attr(qname, uri, localname, prefix)
                    _attrs[qname] = a
                    _attrsNS[(uri, localname)] = a
                else:
                    a = minidom.Attr(aname, EMPTY_NAMESPACE,
                                     aname, EMPTY_PREFIX)
                    _attrs[aname] = a
                    _attrsNS[(EMPTY_NAMESPACE, aname)] = a
                a.ownerDocument = self.document
                a.value = value
                a.ownerElement = node

    if __debug__:
        # This only adds some asserts to the original
        # end_element_handler(), so we only define this when -O is not
        # used.  If changing one, be sure to check the other to see if
        # it needs to be changed as well.
        #
        def end_element_handler(self, name):
            curNode = self.curNode
            if ' ' in name:
                uri, localname, prefix, qname = _parse_ns_name(self, name)
                assert (curNode.namespaceURI == uri
                        and curNode.localName == localname
                        and curNode.prefix == prefix), \
                        "element stack messed up! (namespace)"
            else:
                assert curNode.nodeName == name, \
                       "element stack messed up - bad nodeName"
                assert curNode.namespaceURI == EMPTY_NAMESPACE, \
                       "element stack messed up - bad namespaceURI"
            self.curNode = curNode.parentNode
            self._finish_end_element(curNode)


class ExpatBuilderNS(Namespaces, ExpatBuilder):
    """Document builder that supports namespaces."""

    def reset(self):
        ExpatBuilder.reset(self)
        self._initNamespaces()


class FragmentBuilderNS(Namespaces, FragmentBuilder):
    """Fragment builder that supports namespaces."""

    def reset(self):
        FragmentBuilder.reset(self)
        self._initNamespaces()

    def _getNSattrs(self):
        """Return string of namespace attributes from this element and
        ancestors."""
        # XXX This needs to be re-written to walk the ancestors of the
        # context to build up the namespace information from
        # declarations, elements, and attributes found in context.
        # Otherwise we have to store a bunch more data on the DOM
        # (though that *might* be more reliable -- not clear).
        attrs = ""
        context = self.context
        L = []
        while context:
            if hasattr(context, '_ns_prefix_uri'):
                for prefix, uri in context._ns_prefix_uri.items():
                    # add every new NS decl from context to L and attrs string
                    if prefix in L:
                        continue
                    L.append(prefix)
                    if prefix:
                        declname = "xmlns:" + prefix
                    else:
                        declname = "xmlns"
                    if attrs:
                        attrs = "%s\n    %s='%s'" % (attrs, declname, uri)
                    else:
                        attrs = " %s='%s'" % (declname, uri)
            context = context.parentNode
        return attrs


class ParseEscape(Exception):
    """Exception raised to short-circuit parsing in InternalSubsetExtractor."""
    pass

class InternalSubsetExtractor(ExpatBuilder):
    """XML processor which can rip out the internal document type subset."""

    subset = None

    def getSubset(self):
        """Return the internal subset as a string."""
        return self.subset

    def parseFile(self, file):
        try:
            ExpatBuilder.parseFile(self, file)
        except ParseEscape:
            pass

    def parseString(self, string):
        try:
            ExpatBuilder.parseString(self, string)
        except ParseEscape:
            pass

    def install(self, parser):
        parser.StartDoctypeDeclHandler = self.start_doctype_decl_handler
        parser.StartElementHandler = self.start_element_handler

    def start_doctype_decl_handler(self, name, publicId, systemId,
                                   has_internal_subset):
        if has_internal_subset:
            parser = self.getParser()
            self.subset = []
            parser.DefaultHandler = self.subset.append
            parser.EndDoctypeDeclHandler = self.end_doctype_decl_handler
        else:
            raise ParseEscape()

    def end_doctype_decl_handler(self):
        s = ''.join(self.subset).replace('\r\n', '\n').replace('\r', '\n')
        self.subset = s
        raise ParseEscape()

    def start_element_handler(self, name, attrs):
        raise ParseEscape()


def parse(file, namespaces=True):
    """Parse a document, returning the resulting Document node.

    'file' may be either a file name or an open file object.
    """
    if namespaces:
        builder = ExpatBuilderNS()
    else:
        builder = ExpatBuilder()

    if isinstance(file, str):
        with open(file, 'rb') as fp:
            result = builder.parseFile(fp)
    else:
        result = builder.parseFile(file)
    return result


def parseString(string, namespaces=True):
    """Parse a document from a string, returning the resulting
    Document node.
    """
    if namespaces:
        builder = ExpatBuilderNS()
    else:
        builder = ExpatBuilder()
    return builder.parseString(string)


def parseFragment(file, context, namespaces=True):
    """Parse a fragment of a document, given the context from which it
    was originally extracted.  context should be the parent of the
    node(s) which are in the fragment.

    'file' may be either a file name or an open file object.
    """
    if namespaces:
        builder = FragmentBuilderNS(context)
    else:
        builder = FragmentBuilder(context)

    if isinstance(file, str):
        with open(file, 'rb') as fp:
            result = builder.parseFile(fp)
    else:
        result = builder.parseFile(file)
    return result


def parseFragmentString(string, context, namespaces=True):
    """Parse a fragment of a document from a string, given the context
    from which it was originally extracted.  context should be the
    parent of the node(s) which are in the fragment.
    """
    if namespaces:
        builder = FragmentBuilderNS(context)
    else:
        builder = FragmentBuilder(context)
    return builder.parseString(string)


def makeBuilder(options):
    """Create a builder based on an Options object."""
    if options.namespaces:
        return ExpatBuilderNS(options)
    else:
        return ExpatBuilder(options)
xml/dom/__init__.py000064400000007663151153537540010261 0ustar00"""W3C Document Object Model implementation for Python.

The Python mapping of the Document Object Model is documented in the
Python Library Reference in the section on the xml.dom package.

This package contains the following modules:

minidom -- A simple implementation of the Level 1 DOM with namespace
           support added (based on the Level 2 specification) and other
           minor Level 2 functionality.

pulldom -- DOM builder supporting on-demand tree-building for selected
           subtrees of the document.

"""


class Node:
    """Class giving the NodeType constants."""
    __slots__ = ()

    # DOM implementations may use this as a base class for their own
    # Node implementations.  If they don't, the constants defined here
    # should still be used as the canonical definitions as they match
    # the values given in the W3C recommendation.  Client code can
    # safely refer to these values in all tests of Node.nodeType
    # values.

    ELEMENT_NODE                = 1
    ATTRIBUTE_NODE              = 2
    TEXT_NODE                   = 3
    CDATA_SECTION_NODE          = 4
    ENTITY_REFERENCE_NODE       = 5
    ENTITY_NODE                 = 6
    PROCESSING_INSTRUCTION_NODE = 7
    COMMENT_NODE                = 8
    DOCUMENT_NODE               = 9
    DOCUMENT_TYPE_NODE          = 10
    DOCUMENT_FRAGMENT_NODE      = 11
    NOTATION_NODE               = 12


#ExceptionCode
INDEX_SIZE_ERR                 = 1
DOMSTRING_SIZE_ERR             = 2
HIERARCHY_REQUEST_ERR          = 3
WRONG_DOCUMENT_ERR             = 4
INVALID_CHARACTER_ERR          = 5
NO_DATA_ALLOWED_ERR            = 6
NO_MODIFICATION_ALLOWED_ERR    = 7
NOT_FOUND_ERR                  = 8
NOT_SUPPORTED_ERR              = 9
INUSE_ATTRIBUTE_ERR            = 10
INVALID_STATE_ERR              = 11
SYNTAX_ERR                     = 12
INVALID_MODIFICATION_ERR       = 13
NAMESPACE_ERR                  = 14
INVALID_ACCESS_ERR             = 15
VALIDATION_ERR                 = 16


class DOMException(Exception):
    """Abstract base class for DOM exceptions.
    Exceptions with specific codes are specializations of this class."""

    def __init__(self, *args, **kw):
        if self.__class__ is DOMException:
            raise RuntimeError(
                "DOMException should not be instantiated directly")
        Exception.__init__(self, *args, **kw)

    def _get_code(self):
        return self.code


class IndexSizeErr(DOMException):
    code = INDEX_SIZE_ERR

class DomstringSizeErr(DOMException):
    code = DOMSTRING_SIZE_ERR

class HierarchyRequestErr(DOMException):
    code = HIERARCHY_REQUEST_ERR

class WrongDocumentErr(DOMException):
    code = WRONG_DOCUMENT_ERR

class InvalidCharacterErr(DOMException):
    code = INVALID_CHARACTER_ERR

class NoDataAllowedErr(DOMException):
    code = NO_DATA_ALLOWED_ERR

class NoModificationAllowedErr(DOMException):
    code = NO_MODIFICATION_ALLOWED_ERR

class NotFoundErr(DOMException):
    code = NOT_FOUND_ERR

class NotSupportedErr(DOMException):
    code = NOT_SUPPORTED_ERR

class InuseAttributeErr(DOMException):
    code = INUSE_ATTRIBUTE_ERR

class InvalidStateErr(DOMException):
    code = INVALID_STATE_ERR

class SyntaxErr(DOMException):
    code = SYNTAX_ERR

class InvalidModificationErr(DOMException):
    code = INVALID_MODIFICATION_ERR

class NamespaceErr(DOMException):
    code = NAMESPACE_ERR

class InvalidAccessErr(DOMException):
    code = INVALID_ACCESS_ERR

class ValidationErr(DOMException):
    code = VALIDATION_ERR

class UserDataHandler:
    """Class giving the operation constants for UserDataHandler.handle()."""

    # Based on DOM Level 3 (WD 9 April 2002)

    NODE_CLONED   = 1
    NODE_IMPORTED = 2
    NODE_DELETED  = 3
    NODE_RENAMED  = 4

XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace"
XMLNS_NAMESPACE = "http://www.w3.org/2000/xmlns/"
XHTML_NAMESPACE = "http://www.w3.org/1999/xhtml"
EMPTY_NAMESPACE = None
EMPTY_PREFIX = None

from .domreg import getDOMImplementation, registerDOMImplementation
xml/dom/minidom.py000064400000202451151153537540010146 0ustar00"""Simple implementation of the Level 1 DOM.

Namespaces and other minor Level 2 features are also supported.

parse("foo.xml")

parseString("<foo><bar/></foo>")

Todo:
=====
 * convenience methods for getting elements and text.
 * more testing
 * bring some of the writer and linearizer code into conformance with this
        interface
 * SAX 2 namespaces
"""

import io
import xml.dom

from xml.dom import EMPTY_NAMESPACE, EMPTY_PREFIX, XMLNS_NAMESPACE, domreg
from xml.dom.minicompat import *
from xml.dom.xmlbuilder import DOMImplementationLS, DocumentLS

# This is used by the ID-cache invalidation checks; the list isn't
# actually complete, since the nodes being checked will never be the
# DOCUMENT_NODE or DOCUMENT_FRAGMENT_NODE.  (The node being checked is
# the node being added or removed, not the node being modified.)
#
_nodeTypes_with_children = (xml.dom.Node.ELEMENT_NODE,
                            xml.dom.Node.ENTITY_REFERENCE_NODE)


class Node(xml.dom.Node):
    namespaceURI = None # this is non-null only for elements and attributes
    parentNode = None
    ownerDocument = None
    nextSibling = None
    previousSibling = None

    prefix = EMPTY_PREFIX # non-null only for NS elements and attributes

    def __bool__(self):
        return True

    def toxml(self, encoding=None):
        return self.toprettyxml("", "", encoding)

    def toprettyxml(self, indent="\t", newl="\n", encoding=None):
        if encoding is None:
            writer = io.StringIO()
        else:
            writer = io.TextIOWrapper(io.BytesIO(),
                                      encoding=encoding,
                                      errors="xmlcharrefreplace",
                                      newline='\n')
        if self.nodeType == Node.DOCUMENT_NODE:
            # Can pass encoding only to document, to put it into XML header
            self.writexml(writer, "", indent, newl, encoding)
        else:
            self.writexml(writer, "", indent, newl)
        if encoding is None:
            return writer.getvalue()
        else:
            return writer.detach().getvalue()

    def hasChildNodes(self):
        return bool(self.childNodes)

    def _get_childNodes(self):
        return self.childNodes

    def _get_firstChild(self):
        if self.childNodes:
            return self.childNodes[0]

    def _get_lastChild(self):
        if self.childNodes:
            return self.childNodes[-1]

    def insertBefore(self, newChild, refChild):
        if newChild.nodeType == self.DOCUMENT_FRAGMENT_NODE:
            for c in tuple(newChild.childNodes):
                self.insertBefore(c, refChild)
            ### The DOM does not clearly specify what to return in this case
            return newChild
        if newChild.nodeType not in self._child_node_types:
            raise xml.dom.HierarchyRequestErr(
                "%s cannot be child of %s" % (repr(newChild), repr(self)))
        if newChild.parentNode is not None:
            newChild.parentNode.removeChild(newChild)
        if refChild is None:
            self.appendChild(newChild)
        else:
            try:
                index = self.childNodes.index(refChild)
            except ValueError:
                raise xml.dom.NotFoundErr()
            if newChild.nodeType in _nodeTypes_with_children:
                _clear_id_cache(self)
            self.childNodes.insert(index, newChild)
            newChild.nextSibling = refChild
            refChild.previousSibling = newChild
            if index:
                node = self.childNodes[index-1]
                node.nextSibling = newChild
                newChild.previousSibling = node
            else:
                newChild.previousSibling = None
            newChild.parentNode = self
        return newChild

    def appendChild(self, node):
        if node.nodeType == self.DOCUMENT_FRAGMENT_NODE:
            for c in tuple(node.childNodes):
                self.appendChild(c)
            ### The DOM does not clearly specify what to return in this case
            return node
        if node.nodeType not in self._child_node_types:
            raise xml.dom.HierarchyRequestErr(
                "%s cannot be child of %s" % (repr(node), repr(self)))
        elif node.nodeType in _nodeTypes_with_children:
            _clear_id_cache(self)
        if node.parentNode is not None:
            node.parentNode.removeChild(node)
        _append_child(self, node)
        node.nextSibling = None
        return node

    def replaceChild(self, newChild, oldChild):
        if newChild.nodeType == self.DOCUMENT_FRAGMENT_NODE:
            refChild = oldChild.nextSibling
            self.removeChild(oldChild)
            return self.insertBefore(newChild, refChild)
        if newChild.nodeType not in self._child_node_types:
            raise xml.dom.HierarchyRequestErr(
                "%s cannot be child of %s" % (repr(newChild), repr(self)))
        if newChild is oldChild:
            return
        if newChild.parentNode is not None:
            newChild.parentNode.removeChild(newChild)
        try:
            index = self.childNodes.index(oldChild)
        except ValueError:
            raise xml.dom.NotFoundErr()
        self.childNodes[index] = newChild
        newChild.parentNode = self
        oldChild.parentNode = None
        if (newChild.nodeType in _nodeTypes_with_children
            or oldChild.nodeType in _nodeTypes_with_children):
            _clear_id_cache(self)
        newChild.nextSibling = oldChild.nextSibling
        newChild.previousSibling = oldChild.previousSibling
        oldChild.nextSibling = None
        oldChild.previousSibling = None
        if newChild.previousSibling:
            newChild.previousSibling.nextSibling = newChild
        if newChild.nextSibling:
            newChild.nextSibling.previousSibling = newChild
        return oldChild

    def removeChild(self, oldChild):
        try:
            self.childNodes.remove(oldChild)
        except ValueError:
            raise xml.dom.NotFoundErr()
        if oldChild.nextSibling is not None:
            oldChild.nextSibling.previousSibling = oldChild.previousSibling
        if oldChild.previousSibling is not None:
            oldChild.previousSibling.nextSibling = oldChild.nextSibling
        oldChild.nextSibling = oldChild.previousSibling = None
        if oldChild.nodeType in _nodeTypes_with_children:
            _clear_id_cache(self)

        oldChild.parentNode = None
        return oldChild

    def normalize(self):
        L = []
        for child in self.childNodes:
            if child.nodeType == Node.TEXT_NODE:
                if not child.data:
                    # empty text node; discard
                    if L:
                        L[-1].nextSibling = child.nextSibling
                    if child.nextSibling:
                        child.nextSibling.previousSibling = child.previousSibling
                    child.unlink()
                elif L and L[-1].nodeType == child.nodeType:
                    # collapse text node
                    node = L[-1]
                    node.data = node.data + child.data
                    node.nextSibling = child.nextSibling
                    if child.nextSibling:
                        child.nextSibling.previousSibling = node
                    child.unlink()
                else:
                    L.append(child)
            else:
                L.append(child)
                if child.nodeType == Node.ELEMENT_NODE:
                    child.normalize()
        self.childNodes[:] = L

    def cloneNode(self, deep):
        return _clone_node(self, deep, self.ownerDocument or self)

    def isSupported(self, feature, version):
        return self.ownerDocument.implementation.hasFeature(feature, version)

    def _get_localName(self):
        # Overridden in Element and Attr where localName can be Non-Null
        return None

    # Node interfaces from Level 3 (WD 9 April 2002)

    def isSameNode(self, other):
        return self is other

    def getInterface(self, feature):
        if self.isSupported(feature, None):
            return self
        else:
            return None

    # The "user data" functions use a dictionary that is only present
    # if some user data has been set, so be careful not to assume it
    # exists.

    def getUserData(self, key):
        try:
            return self._user_data[key][0]
        except (AttributeError, KeyError):
            return None

    def setUserData(self, key, data, handler):
        old = None
        try:
            d = self._user_data
        except AttributeError:
            d = {}
            self._user_data = d
        if key in d:
            old = d[key][0]
        if data is None:
            # ignore handlers passed for None
            handler = None
            if old is not None:
                del d[key]
        else:
            d[key] = (data, handler)
        return old

    def _call_user_data_handler(self, operation, src, dst):
        if hasattr(self, "_user_data"):
            for key, (data, handler) in list(self._user_data.items()):
                if handler is not None:
                    handler.handle(operation, key, data, src, dst)

    # minidom-specific API:

    def unlink(self):
        self.parentNode = self.ownerDocument = None
        if self.childNodes:
            for child in self.childNodes:
                child.unlink()
            self.childNodes = NodeList()
        self.previousSibling = None
        self.nextSibling = None

    # A Node is its own context manager, to ensure that an unlink() call occurs.
    # This is similar to how a file object works.
    def __enter__(self):
        return self

    def __exit__(self, et, ev, tb):
        self.unlink()

defproperty(Node, "firstChild", doc="First child node, or None.")
defproperty(Node, "lastChild",  doc="Last child node, or None.")
defproperty(Node, "localName",  doc="Namespace-local name of this node.")


def _append_child(self, node):
    # fast path with less checks; usable by DOM builders if careful
    childNodes = self.childNodes
    if childNodes:
        last = childNodes[-1]
        node.previousSibling = last
        last.nextSibling = node
    childNodes.append(node)
    node.parentNode = self

def _in_document(node):
    # return True iff node is part of a document tree
    while node is not None:
        if node.nodeType == Node.DOCUMENT_NODE:
            return True
        node = node.parentNode
    return False

def _write_data(writer, data):
    "Writes datachars to writer."
    if data:
        data = data.replace("&", "&amp;").replace("<", "&lt;"). \
                    replace("\"", "&quot;").replace(">", "&gt;")
        writer.write(data)

def _get_elements_by_tagName_helper(parent, name, rc):
    for node in parent.childNodes:
        if node.nodeType == Node.ELEMENT_NODE and \
            (name == "*" or node.tagName == name):
            rc.append(node)
        _get_elements_by_tagName_helper(node, name, rc)
    return rc

def _get_elements_by_tagName_ns_helper(parent, nsURI, localName, rc):
    for node in parent.childNodes:
        if node.nodeType == Node.ELEMENT_NODE:
            if ((localName == "*" or node.localName == localName) and
                (nsURI == "*" or node.namespaceURI == nsURI)):
                rc.append(node)
            _get_elements_by_tagName_ns_helper(node, nsURI, localName, rc)
    return rc

class DocumentFragment(Node):
    nodeType = Node.DOCUMENT_FRAGMENT_NODE
    nodeName = "#document-fragment"
    nodeValue = None
    attributes = None
    parentNode = None
    _child_node_types = (Node.ELEMENT_NODE,
                         Node.TEXT_NODE,
                         Node.CDATA_SECTION_NODE,
                         Node.ENTITY_REFERENCE_NODE,
                         Node.PROCESSING_INSTRUCTION_NODE,
                         Node.COMMENT_NODE,
                         Node.NOTATION_NODE)

    def __init__(self):
        self.childNodes = NodeList()


class Attr(Node):
    __slots__=('_name', '_value', 'namespaceURI',
               '_prefix', 'childNodes', '_localName', 'ownerDocument', 'ownerElement')
    nodeType = Node.ATTRIBUTE_NODE
    attributes = None
    specified = False
    _is_id = False

    _child_node_types = (Node.TEXT_NODE, Node.ENTITY_REFERENCE_NODE)

    def __init__(self, qName, namespaceURI=EMPTY_NAMESPACE, localName=None,
                 prefix=None):
        self.ownerElement = None
        self._name = qName
        self.namespaceURI = namespaceURI
        self._prefix = prefix
        self.childNodes = NodeList()

        # Add the single child node that represents the value of the attr
        self.childNodes.append(Text())

        # nodeValue and value are set elsewhere

    def _get_localName(self):
        try:
            return self._localName
        except AttributeError:
            return self.nodeName.split(":", 1)[-1]

    def _get_specified(self):
        return self.specified

    def _get_name(self):
        return self._name

    def _set_name(self, value):
        self._name = value
        if self.ownerElement is not None:
            _clear_id_cache(self.ownerElement)

    nodeName = name = property(_get_name, _set_name)

    def _get_value(self):
        return self._value

    def _set_value(self, value):
        self._value = value
        self.childNodes[0].data = value
        if self.ownerElement is not None:
            _clear_id_cache(self.ownerElement)
        self.childNodes[0].data = value

    nodeValue = value = property(_get_value, _set_value)

    def _get_prefix(self):
        return self._prefix

    def _set_prefix(self, prefix):
        nsuri = self.namespaceURI
        if prefix == "xmlns":
            if nsuri and nsuri != XMLNS_NAMESPACE:
                raise xml.dom.NamespaceErr(
                    "illegal use of 'xmlns' prefix for the wrong namespace")
        self._prefix = prefix
        if prefix is None:
            newName = self.localName
        else:
            newName = "%s:%s" % (prefix, self.localName)
        if self.ownerElement:
            _clear_id_cache(self.ownerElement)
        self.name = newName

    prefix = property(_get_prefix, _set_prefix)

    def unlink(self):
        # This implementation does not call the base implementation
        # since most of that is not needed, and the expense of the
        # method call is not warranted.  We duplicate the removal of
        # children, but that's all we needed from the base class.
        elem = self.ownerElement
        if elem is not None:
            del elem._attrs[self.nodeName]
            del elem._attrsNS[(self.namespaceURI, self.localName)]
            if self._is_id:
                self._is_id = False
                elem._magic_id_nodes -= 1
                self.ownerDocument._magic_id_count -= 1
        for child in self.childNodes:
            child.unlink()
        del self.childNodes[:]

    def _get_isId(self):
        if self._is_id:
            return True
        doc = self.ownerDocument
        elem = self.ownerElement
        if doc is None or elem is None:
            return False

        info = doc._get_elem_info(elem)
        if info is None:
            return False
        if self.namespaceURI:
            return info.isIdNS(self.namespaceURI, self.localName)
        else:
            return info.isId(self.nodeName)

    def _get_schemaType(self):
        doc = self.ownerDocument
        elem = self.ownerElement
        if doc is None or elem is None:
            return _no_type

        info = doc._get_elem_info(elem)
        if info is None:
            return _no_type
        if self.namespaceURI:
            return info.getAttributeTypeNS(self.namespaceURI, self.localName)
        else:
            return info.getAttributeType(self.nodeName)

defproperty(Attr, "isId",       doc="True if this attribute is an ID.")
defproperty(Attr, "localName",  doc="Namespace-local name of this attribute.")
defproperty(Attr, "schemaType", doc="Schema type for this attribute.")


class NamedNodeMap(object):
    """The attribute list is a transient interface to the underlying
    dictionaries.  Mutations here will change the underlying element's
    dictionary.

    Ordering is imposed artificially and does not reflect the order of
    attributes as found in an input document.
    """

    __slots__ = ('_attrs', '_attrsNS', '_ownerElement')

    def __init__(self, attrs, attrsNS, ownerElement):
        self._attrs = attrs
        self._attrsNS = attrsNS
        self._ownerElement = ownerElement

    def _get_length(self):
        return len(self._attrs)

    def item(self, index):
        try:
            return self[list(self._attrs.keys())[index]]
        except IndexError:
            return None

    def items(self):
        L = []
        for node in self._attrs.values():
            L.append((node.nodeName, node.value))
        return L

    def itemsNS(self):
        L = []
        for node in self._attrs.values():
            L.append(((node.namespaceURI, node.localName), node.value))
        return L

    def __contains__(self, key):
        if isinstance(key, str):
            return key in self._attrs
        else:
            return key in self._attrsNS

    def keys(self):
        return self._attrs.keys()

    def keysNS(self):
        return self._attrsNS.keys()

    def values(self):
        return self._attrs.values()

    def get(self, name, value=None):
        return self._attrs.get(name, value)

    __len__ = _get_length

    def _cmp(self, other):
        if self._attrs is getattr(other, "_attrs", None):
            return 0
        else:
            return (id(self) > id(other)) - (id(self) < id(other))

    def __eq__(self, other):
        return self._cmp(other) == 0

    def __ge__(self, other):
        return self._cmp(other) >= 0

    def __gt__(self, other):
        return self._cmp(other) > 0

    def __le__(self, other):
        return self._cmp(other) <= 0

    def __lt__(self, other):
        return self._cmp(other) < 0

    def __getitem__(self, attname_or_tuple):
        if isinstance(attname_or_tuple, tuple):
            return self._attrsNS[attname_or_tuple]
        else:
            return self._attrs[attname_or_tuple]

    # same as set
    def __setitem__(self, attname, value):
        if isinstance(value, str):
            try:
                node = self._attrs[attname]
            except KeyError:
                node = Attr(attname)
                node.ownerDocument = self._ownerElement.ownerDocument
                self.setNamedItem(node)
            node.value = value
        else:
            if not isinstance(value, Attr):
                raise TypeError("value must be a string or Attr object")
            node = value
            self.setNamedItem(node)

    def getNamedItem(self, name):
        try:
            return self._attrs[name]
        except KeyError:
            return None

    def getNamedItemNS(self, namespaceURI, localName):
        try:
            return self._attrsNS[(namespaceURI, localName)]
        except KeyError:
            return None

    def removeNamedItem(self, name):
        n = self.getNamedItem(name)
        if n is not None:
            _clear_id_cache(self._ownerElement)
            del self._attrs[n.nodeName]
            del self._attrsNS[(n.namespaceURI, n.localName)]
            if hasattr(n, 'ownerElement'):
                n.ownerElement = None
            return n
        else:
            raise xml.dom.NotFoundErr()

    def removeNamedItemNS(self, namespaceURI, localName):
        n = self.getNamedItemNS(namespaceURI, localName)
        if n is not None:
            _clear_id_cache(self._ownerElement)
            del self._attrsNS[(n.namespaceURI, n.localName)]
            del self._attrs[n.nodeName]
            if hasattr(n, 'ownerElement'):
                n.ownerElement = None
            return n
        else:
            raise xml.dom.NotFoundErr()

    def setNamedItem(self, node):
        if not isinstance(node, Attr):
            raise xml.dom.HierarchyRequestErr(
                "%s cannot be child of %s" % (repr(node), repr(self)))
        old = self._attrs.get(node.name)
        if old:
            old.unlink()
        self._attrs[node.name] = node
        self._attrsNS[(node.namespaceURI, node.localName)] = node
        node.ownerElement = self._ownerElement
        _clear_id_cache(node.ownerElement)
        return old

    def setNamedItemNS(self, node):
        return self.setNamedItem(node)

    def __delitem__(self, attname_or_tuple):
        node = self[attname_or_tuple]
        _clear_id_cache(node.ownerElement)
        node.unlink()

    def __getstate__(self):
        return self._attrs, self._attrsNS, self._ownerElement

    def __setstate__(self, state):
        self._attrs, self._attrsNS, self._ownerElement = state

defproperty(NamedNodeMap, "length",
            doc="Number of nodes in the NamedNodeMap.")

AttributeList = NamedNodeMap


class TypeInfo(object):
    __slots__ = 'namespace', 'name'

    def __init__(self, namespace, name):
        self.namespace = namespace
        self.name = name

    def __repr__(self):
        if self.namespace:
            return "<%s %r (from %r)>" % (self.__class__.__name__, self.name,
                                          self.namespace)
        else:
            return "<%s %r>" % (self.__class__.__name__, self.name)

    def _get_name(self):
        return self.name

    def _get_namespace(self):
        return self.namespace

_no_type = TypeInfo(None, None)

class Element(Node):
    __slots__=('ownerDocument', 'parentNode', 'tagName', 'nodeName', 'prefix',
               'namespaceURI', '_localName', 'childNodes', '_attrs', '_attrsNS',
               'nextSibling', 'previousSibling')
    nodeType = Node.ELEMENT_NODE
    nodeValue = None
    schemaType = _no_type

    _magic_id_nodes = 0

    _child_node_types = (Node.ELEMENT_NODE,
                         Node.PROCESSING_INSTRUCTION_NODE,
                         Node.COMMENT_NODE,
                         Node.TEXT_NODE,
                         Node.CDATA_SECTION_NODE,
                         Node.ENTITY_REFERENCE_NODE)

    def __init__(self, tagName, namespaceURI=EMPTY_NAMESPACE, prefix=None,
                 localName=None):
        self.parentNode = None
        self.tagName = self.nodeName = tagName
        self.prefix = prefix
        self.namespaceURI = namespaceURI
        self.childNodes = NodeList()
        self.nextSibling = self.previousSibling = None

        # Attribute dictionaries are lazily created
        # attributes are double-indexed:
        #    tagName -> Attribute
        #    URI,localName -> Attribute
        # in the future: consider lazy generation
        # of attribute objects this is too tricky
        # for now because of headaches with
        # namespaces.
        self._attrs = None
        self._attrsNS = None

    def _ensure_attributes(self):
        if self._attrs is None:
            self._attrs = {}
            self._attrsNS = {}

    def _get_localName(self):
        try:
            return self._localName
        except AttributeError:
            return self.tagName.split(":", 1)[-1]

    def _get_tagName(self):
        return self.tagName

    def unlink(self):
        if self._attrs is not None:
            for attr in list(self._attrs.values()):
                attr.unlink()
        self._attrs = None
        self._attrsNS = None
        Node.unlink(self)

    def getAttribute(self, attname):
        if self._attrs is None:
            return ""
        try:
            return self._attrs[attname].value
        except KeyError:
            return ""

    def getAttributeNS(self, namespaceURI, localName):
        if self._attrsNS is None:
            return ""
        try:
            return self._attrsNS[(namespaceURI, localName)].value
        except KeyError:
            return ""

    def setAttribute(self, attname, value):
        attr = self.getAttributeNode(attname)
        if attr is None:
            attr = Attr(attname)
            attr.value = value # also sets nodeValue
            attr.ownerDocument = self.ownerDocument
            self.setAttributeNode(attr)
        elif value != attr.value:
            attr.value = value
            if attr.isId:
                _clear_id_cache(self)

    def setAttributeNS(self, namespaceURI, qualifiedName, value):
        prefix, localname = _nssplit(qualifiedName)
        attr = self.getAttributeNodeNS(namespaceURI, localname)
        if attr is None:
            attr = Attr(qualifiedName, namespaceURI, localname, prefix)
            attr.value = value
            attr.ownerDocument = self.ownerDocument
            self.setAttributeNode(attr)
        else:
            if value != attr.value:
                attr.value = value
                if attr.isId:
                    _clear_id_cache(self)
            if attr.prefix != prefix:
                attr.prefix = prefix
                attr.nodeName = qualifiedName

    def getAttributeNode(self, attrname):
        if self._attrs is None:
            return None
        return self._attrs.get(attrname)

    def getAttributeNodeNS(self, namespaceURI, localName):
        if self._attrsNS is None:
            return None
        return self._attrsNS.get((namespaceURI, localName))

    def setAttributeNode(self, attr):
        if attr.ownerElement not in (None, self):
            raise xml.dom.InuseAttributeErr("attribute node already owned")
        self._ensure_attributes()
        old1 = self._attrs.get(attr.name, None)
        if old1 is not None:
            self.removeAttributeNode(old1)
        old2 = self._attrsNS.get((attr.namespaceURI, attr.localName), None)
        if old2 is not None and old2 is not old1:
            self.removeAttributeNode(old2)
        _set_attribute_node(self, attr)

        if old1 is not attr:
            # It might have already been part of this node, in which case
            # it doesn't represent a change, and should not be returned.
            return old1
        if old2 is not attr:
            return old2

    setAttributeNodeNS = setAttributeNode

    def removeAttribute(self, name):
        if self._attrsNS is None:
            raise xml.dom.NotFoundErr()
        try:
            attr = self._attrs[name]
        except KeyError:
            raise xml.dom.NotFoundErr()
        self.removeAttributeNode(attr)

    def removeAttributeNS(self, namespaceURI, localName):
        if self._attrsNS is None:
            raise xml.dom.NotFoundErr()
        try:
            attr = self._attrsNS[(namespaceURI, localName)]
        except KeyError:
            raise xml.dom.NotFoundErr()
        self.removeAttributeNode(attr)

    def removeAttributeNode(self, node):
        if node is None:
            raise xml.dom.NotFoundErr()
        try:
            self._attrs[node.name]
        except KeyError:
            raise xml.dom.NotFoundErr()
        _clear_id_cache(self)
        node.unlink()
        # Restore this since the node is still useful and otherwise
        # unlinked
        node.ownerDocument = self.ownerDocument
        return node

    removeAttributeNodeNS = removeAttributeNode

    def hasAttribute(self, name):
        if self._attrs is None:
            return False
        return name in self._attrs

    def hasAttributeNS(self, namespaceURI, localName):
        if self._attrsNS is None:
            return False
        return (namespaceURI, localName) in self._attrsNS

    def getElementsByTagName(self, name):
        return _get_elements_by_tagName_helper(self, name, NodeList())

    def getElementsByTagNameNS(self, namespaceURI, localName):
        return _get_elements_by_tagName_ns_helper(
            self, namespaceURI, localName, NodeList())

    def __repr__(self):
        return "<DOM Element: %s at %#x>" % (self.tagName, id(self))

    def writexml(self, writer, indent="", addindent="", newl=""):
        # indent = current indentation
        # addindent = indentation to add to higher levels
        # newl = newline string
        writer.write(indent+"<" + self.tagName)

        attrs = self._get_attributes()

        for a_name in attrs.keys():
            writer.write(" %s=\"" % a_name)
            _write_data(writer, attrs[a_name].value)
            writer.write("\"")
        if self.childNodes:
            writer.write(">")
            if (len(self.childNodes) == 1 and
                self.childNodes[0].nodeType in (
                        Node.TEXT_NODE, Node.CDATA_SECTION_NODE)):
                self.childNodes[0].writexml(writer, '', '', '')
            else:
                writer.write(newl)
                for node in self.childNodes:
                    node.writexml(writer, indent+addindent, addindent, newl)
                writer.write(indent)
            writer.write("</%s>%s" % (self.tagName, newl))
        else:
            writer.write("/>%s"%(newl))

    def _get_attributes(self):
        self._ensure_attributes()
        return NamedNodeMap(self._attrs, self._attrsNS, self)

    def hasAttributes(self):
        if self._attrs:
            return True
        else:
            return False

    # DOM Level 3 attributes, based on the 22 Oct 2002 draft

    def setIdAttribute(self, name):
        idAttr = self.getAttributeNode(name)
        self.setIdAttributeNode(idAttr)

    def setIdAttributeNS(self, namespaceURI, localName):
        idAttr = self.getAttributeNodeNS(namespaceURI, localName)
        self.setIdAttributeNode(idAttr)

    def setIdAttributeNode(self, idAttr):
        if idAttr is None or not self.isSameNode(idAttr.ownerElement):
            raise xml.dom.NotFoundErr()
        if _get_containing_entref(self) is not None:
            raise xml.dom.NoModificationAllowedErr()
        if not idAttr._is_id:
            idAttr._is_id = True
            self._magic_id_nodes += 1
            self.ownerDocument._magic_id_count += 1
            _clear_id_cache(self)

defproperty(Element, "attributes",
            doc="NamedNodeMap of attributes on the element.")
defproperty(Element, "localName",
            doc="Namespace-local name of this element.")


def _set_attribute_node(element, attr):
    _clear_id_cache(element)
    element._ensure_attributes()
    element._attrs[attr.name] = attr
    element._attrsNS[(attr.namespaceURI, attr.localName)] = attr

    # This creates a circular reference, but Element.unlink()
    # breaks the cycle since the references to the attribute
    # dictionaries are tossed.
    attr.ownerElement = element

class Childless:
    """Mixin that makes childless-ness easy to implement and avoids
    the complexity of the Node methods that deal with children.
    """
    __slots__ = ()

    attributes = None
    childNodes = EmptyNodeList()
    firstChild = None
    lastChild = None

    def _get_firstChild(self):
        return None

    def _get_lastChild(self):
        return None

    def appendChild(self, node):
        raise xml.dom.HierarchyRequestErr(
            self.nodeName + " nodes cannot have children")

    def hasChildNodes(self):
        return False

    def insertBefore(self, newChild, refChild):
        raise xml.dom.HierarchyRequestErr(
            self.nodeName + " nodes do not have children")

    def removeChild(self, oldChild):
        raise xml.dom.NotFoundErr(
            self.nodeName + " nodes do not have children")

    def normalize(self):
        # For childless nodes, normalize() has nothing to do.
        pass

    def replaceChild(self, newChild, oldChild):
        raise xml.dom.HierarchyRequestErr(
            self.nodeName + " nodes do not have children")


class ProcessingInstruction(Childless, Node):
    nodeType = Node.PROCESSING_INSTRUCTION_NODE
    __slots__ = ('target', 'data')

    def __init__(self, target, data):
        self.target = target
        self.data = data

    # nodeValue is an alias for data
    def _get_nodeValue(self):
        return self.data
    def _set_nodeValue(self, value):
        self.data = value
    nodeValue = property(_get_nodeValue, _set_nodeValue)

    # nodeName is an alias for target
    def _get_nodeName(self):
        return self.target
    def _set_nodeName(self, value):
        self.target = value
    nodeName = property(_get_nodeName, _set_nodeName)

    def writexml(self, writer, indent="", addindent="", newl=""):
        writer.write("%s<?%s %s?>%s" % (indent,self.target, self.data, newl))


class CharacterData(Childless, Node):
    __slots__=('_data', 'ownerDocument','parentNode', 'previousSibling', 'nextSibling')

    def __init__(self):
        self.ownerDocument = self.parentNode = None
        self.previousSibling = self.nextSibling = None
        self._data = ''
        Node.__init__(self)

    def _get_length(self):
        return len(self.data)
    __len__ = _get_length

    def _get_data(self):
        return self._data
    def _set_data(self, data):
        self._data = data

    data = nodeValue = property(_get_data, _set_data)

    def __repr__(self):
        data = self.data
        if len(data) > 10:
            dotdotdot = "..."
        else:
            dotdotdot = ""
        return '<DOM %s node "%r%s">' % (
            self.__class__.__name__, data[0:10], dotdotdot)

    def substringData(self, offset, count):
        if offset < 0:
            raise xml.dom.IndexSizeErr("offset cannot be negative")
        if offset >= len(self.data):
            raise xml.dom.IndexSizeErr("offset cannot be beyond end of data")
        if count < 0:
            raise xml.dom.IndexSizeErr("count cannot be negative")
        return self.data[offset:offset+count]

    def appendData(self, arg):
        self.data = self.data + arg

    def insertData(self, offset, arg):
        if offset < 0:
            raise xml.dom.IndexSizeErr("offset cannot be negative")
        if offset >= len(self.data):
            raise xml.dom.IndexSizeErr("offset cannot be beyond end of data")
        if arg:
            self.data = "%s%s%s" % (
                self.data[:offset], arg, self.data[offset:])

    def deleteData(self, offset, count):
        if offset < 0:
            raise xml.dom.IndexSizeErr("offset cannot be negative")
        if offset >= len(self.data):
            raise xml.dom.IndexSizeErr("offset cannot be beyond end of data")
        if count < 0:
            raise xml.dom.IndexSizeErr("count cannot be negative")
        if count:
            self.data = self.data[:offset] + self.data[offset+count:]

    def replaceData(self, offset, count, arg):
        if offset < 0:
            raise xml.dom.IndexSizeErr("offset cannot be negative")
        if offset >= len(self.data):
            raise xml.dom.IndexSizeErr("offset cannot be beyond end of data")
        if count < 0:
            raise xml.dom.IndexSizeErr("count cannot be negative")
        if count:
            self.data = "%s%s%s" % (
                self.data[:offset], arg, self.data[offset+count:])

defproperty(CharacterData, "length", doc="Length of the string data.")


class Text(CharacterData):
    __slots__ = ()

    nodeType = Node.TEXT_NODE
    nodeName = "#text"
    attributes = None

    def splitText(self, offset):
        if offset < 0 or offset > len(self.data):
            raise xml.dom.IndexSizeErr("illegal offset value")
        newText = self.__class__()
        newText.data = self.data[offset:]
        newText.ownerDocument = self.ownerDocument
        next = self.nextSibling
        if self.parentNode and self in self.parentNode.childNodes:
            if next is None:
                self.parentNode.appendChild(newText)
            else:
                self.parentNode.insertBefore(newText, next)
        self.data = self.data[:offset]
        return newText

    def writexml(self, writer, indent="", addindent="", newl=""):
        _write_data(writer, "%s%s%s" % (indent, self.data, newl))

    # DOM Level 3 (WD 9 April 2002)

    def _get_wholeText(self):
        L = [self.data]
        n = self.previousSibling
        while n is not None:
            if n.nodeType in (Node.TEXT_NODE, Node.CDATA_SECTION_NODE):
                L.insert(0, n.data)
                n = n.previousSibling
            else:
                break
        n = self.nextSibling
        while n is not None:
            if n.nodeType in (Node.TEXT_NODE, Node.CDATA_SECTION_NODE):
                L.append(n.data)
                n = n.nextSibling
            else:
                break
        return ''.join(L)

    def replaceWholeText(self, content):
        # XXX This needs to be seriously changed if minidom ever
        # supports EntityReference nodes.
        parent = self.parentNode
        n = self.previousSibling
        while n is not None:
            if n.nodeType in (Node.TEXT_NODE, Node.CDATA_SECTION_NODE):
                next = n.previousSibling
                parent.removeChild(n)
                n = next
            else:
                break
        n = self.nextSibling
        if not content:
            parent.removeChild(self)
        while n is not None:
            if n.nodeType in (Node.TEXT_NODE, Node.CDATA_SECTION_NODE):
                next = n.nextSibling
                parent.removeChild(n)
                n = next
            else:
                break
        if content:
            self.data = content
            return self
        else:
            return None

    def _get_isWhitespaceInElementContent(self):
        if self.data.strip():
            return False
        elem = _get_containing_element(self)
        if elem is None:
            return False
        info = self.ownerDocument._get_elem_info(elem)
        if info is None:
            return False
        else:
            return info.isElementContent()

defproperty(Text, "isWhitespaceInElementContent",
            doc="True iff this text node contains only whitespace"
                " and is in element content.")
defproperty(Text, "wholeText",
            doc="The text of all logically-adjacent text nodes.")


def _get_containing_element(node):
    c = node.parentNode
    while c is not None:
        if c.nodeType == Node.ELEMENT_NODE:
            return c
        c = c.parentNode
    return None

def _get_containing_entref(node):
    c = node.parentNode
    while c is not None:
        if c.nodeType == Node.ENTITY_REFERENCE_NODE:
            return c
        c = c.parentNode
    return None


class Comment(CharacterData):
    nodeType = Node.COMMENT_NODE
    nodeName = "#comment"

    def __init__(self, data):
        CharacterData.__init__(self)
        self._data = data

    def writexml(self, writer, indent="", addindent="", newl=""):
        if "--" in self.data:
            raise ValueError("'--' is not allowed in a comment node")
        writer.write("%s<!--%s-->%s" % (indent, self.data, newl))


class CDATASection(Text):
    __slots__ = ()

    nodeType = Node.CDATA_SECTION_NODE
    nodeName = "#cdata-section"

    def writexml(self, writer, indent="", addindent="", newl=""):
        if self.data.find("]]>") >= 0:
            raise ValueError("']]>' not allowed in a CDATA section")
        writer.write("<![CDATA[%s]]>" % self.data)


class ReadOnlySequentialNamedNodeMap(object):
    __slots__ = '_seq',

    def __init__(self, seq=()):
        # seq should be a list or tuple
        self._seq = seq

    def __len__(self):
        return len(self._seq)

    def _get_length(self):
        return len(self._seq)

    def getNamedItem(self, name):
        for n in self._seq:
            if n.nodeName == name:
                return n

    def getNamedItemNS(self, namespaceURI, localName):
        for n in self._seq:
            if n.namespaceURI == namespaceURI and n.localName == localName:
                return n

    def __getitem__(self, name_or_tuple):
        if isinstance(name_or_tuple, tuple):
            node = self.getNamedItemNS(*name_or_tuple)
        else:
            node = self.getNamedItem(name_or_tuple)
        if node is None:
            raise KeyError(name_or_tuple)
        return node

    def item(self, index):
        if index < 0:
            return None
        try:
            return self._seq[index]
        except IndexError:
            return None

    def removeNamedItem(self, name):
        raise xml.dom.NoModificationAllowedErr(
            "NamedNodeMap instance is read-only")

    def removeNamedItemNS(self, namespaceURI, localName):
        raise xml.dom.NoModificationAllowedErr(
            "NamedNodeMap instance is read-only")

    def setNamedItem(self, node):
        raise xml.dom.NoModificationAllowedErr(
            "NamedNodeMap instance is read-only")

    def setNamedItemNS(self, node):
        raise xml.dom.NoModificationAllowedErr(
            "NamedNodeMap instance is read-only")

    def __getstate__(self):
        return [self._seq]

    def __setstate__(self, state):
        self._seq = state[0]

defproperty(ReadOnlySequentialNamedNodeMap, "length",
            doc="Number of entries in the NamedNodeMap.")


class Identified:
    """Mix-in class that supports the publicId and systemId attributes."""

    __slots__ = 'publicId', 'systemId'

    def _identified_mixin_init(self, publicId, systemId):
        self.publicId = publicId
        self.systemId = systemId

    def _get_publicId(self):
        return self.publicId

    def _get_systemId(self):
        return self.systemId

class DocumentType(Identified, Childless, Node):
    nodeType = Node.DOCUMENT_TYPE_NODE
    nodeValue = None
    name = None
    publicId = None
    systemId = None
    internalSubset = None

    def __init__(self, qualifiedName):
        self.entities = ReadOnlySequentialNamedNodeMap()
        self.notations = ReadOnlySequentialNamedNodeMap()
        if qualifiedName:
            prefix, localname = _nssplit(qualifiedName)
            self.name = localname
        self.nodeName = self.name

    def _get_internalSubset(self):
        return self.internalSubset

    def cloneNode(self, deep):
        if self.ownerDocument is None:
            # it's ok
            clone = DocumentType(None)
            clone.name = self.name
            clone.nodeName = self.name
            operation = xml.dom.UserDataHandler.NODE_CLONED
            if deep:
                clone.entities._seq = []
                clone.notations._seq = []
                for n in self.notations._seq:
                    notation = Notation(n.nodeName, n.publicId, n.systemId)
                    clone.notations._seq.append(notation)
                    n._call_user_data_handler(operation, n, notation)
                for e in self.entities._seq:
                    entity = Entity(e.nodeName, e.publicId, e.systemId,
                                    e.notationName)
                    entity.actualEncoding = e.actualEncoding
                    entity.encoding = e.encoding
                    entity.version = e.version
                    clone.entities._seq.append(entity)
                    e._call_user_data_handler(operation, e, entity)
            self._call_user_data_handler(operation, self, clone)
            return clone
        else:
            return None

    def writexml(self, writer, indent="", addindent="", newl=""):
        writer.write("<!DOCTYPE ")
        writer.write(self.name)
        if self.publicId:
            writer.write("%s  PUBLIC '%s'%s  '%s'"
                         % (newl, self.publicId, newl, self.systemId))
        elif self.systemId:
            writer.write("%s  SYSTEM '%s'" % (newl, self.systemId))
        if self.internalSubset is not None:
            writer.write(" [")
            writer.write(self.internalSubset)
            writer.write("]")
        writer.write(">"+newl)

class Entity(Identified, Node):
    attributes = None
    nodeType = Node.ENTITY_NODE
    nodeValue = None

    actualEncoding = None
    encoding = None
    version = None

    def __init__(self, name, publicId, systemId, notation):
        self.nodeName = name
        self.notationName = notation
        self.childNodes = NodeList()
        self._identified_mixin_init(publicId, systemId)

    def _get_actualEncoding(self):
        return self.actualEncoding

    def _get_encoding(self):
        return self.encoding

    def _get_version(self):
        return self.version

    def appendChild(self, newChild):
        raise xml.dom.HierarchyRequestErr(
            "cannot append children to an entity node")

    def insertBefore(self, newChild, refChild):
        raise xml.dom.HierarchyRequestErr(
            "cannot insert children below an entity node")

    def removeChild(self, oldChild):
        raise xml.dom.HierarchyRequestErr(
            "cannot remove children from an entity node")

    def replaceChild(self, newChild, oldChild):
        raise xml.dom.HierarchyRequestErr(
            "cannot replace children of an entity node")

class Notation(Identified, Childless, Node):
    nodeType = Node.NOTATION_NODE
    nodeValue = None

    def __init__(self, name, publicId, systemId):
        self.nodeName = name
        self._identified_mixin_init(publicId, systemId)


class DOMImplementation(DOMImplementationLS):
    _features = [("core", "1.0"),
                 ("core", "2.0"),
                 ("core", None),
                 ("xml", "1.0"),
                 ("xml", "2.0"),
                 ("xml", None),
                 ("ls-load", "3.0"),
                 ("ls-load", None),
                 ]

    def hasFeature(self, feature, version):
        if version == "":
            version = None
        return (feature.lower(), version) in self._features

    def createDocument(self, namespaceURI, qualifiedName, doctype):
        if doctype and doctype.parentNode is not None:
            raise xml.dom.WrongDocumentErr(
                "doctype object owned by another DOM tree")
        doc = self._create_document()

        add_root_element = not (namespaceURI is None
                                and qualifiedName is None
                                and doctype is None)

        if not qualifiedName and add_root_element:
            # The spec is unclear what to raise here; SyntaxErr
            # would be the other obvious candidate. Since Xerces raises
            # InvalidCharacterErr, and since SyntaxErr is not listed
            # for createDocument, that seems to be the better choice.
            # XXX: need to check for illegal characters here and in
            # createElement.

            # DOM Level III clears this up when talking about the return value
            # of this function.  If namespaceURI, qName and DocType are
            # Null the document is returned without a document element
            # Otherwise if doctype or namespaceURI are not None
            # Then we go back to the above problem
            raise xml.dom.InvalidCharacterErr("Element with no name")

        if add_root_element:
            prefix, localname = _nssplit(qualifiedName)
            if prefix == "xml" \
               and namespaceURI != "http://www.w3.org/XML/1998/namespace":
                raise xml.dom.NamespaceErr("illegal use of 'xml' prefix")
            if prefix and not namespaceURI:
                raise xml.dom.NamespaceErr(
                    "illegal use of prefix without namespaces")
            element = doc.createElementNS(namespaceURI, qualifiedName)
            if doctype:
                doc.appendChild(doctype)
            doc.appendChild(element)

        if doctype:
            doctype.parentNode = doctype.ownerDocument = doc

        doc.doctype = doctype
        doc.implementation = self
        return doc

    def createDocumentType(self, qualifiedName, publicId, systemId):
        doctype = DocumentType(qualifiedName)
        doctype.publicId = publicId
        doctype.systemId = systemId
        return doctype

    # DOM Level 3 (WD 9 April 2002)

    def getInterface(self, feature):
        if self.hasFeature(feature, None):
            return self
        else:
            return None

    # internal
    def _create_document(self):
        return Document()

class ElementInfo(object):
    """Object that represents content-model information for an element.

    This implementation is not expected to be used in practice; DOM
    builders should provide implementations which do the right thing
    using information available to it.

    """

    __slots__ = 'tagName',

    def __init__(self, name):
        self.tagName = name

    def getAttributeType(self, aname):
        return _no_type

    def getAttributeTypeNS(self, namespaceURI, localName):
        return _no_type

    def isElementContent(self):
        return False

    def isEmpty(self):
        """Returns true iff this element is declared to have an EMPTY
        content model."""
        return False

    def isId(self, aname):
        """Returns true iff the named attribute is a DTD-style ID."""
        return False

    def isIdNS(self, namespaceURI, localName):
        """Returns true iff the identified attribute is a DTD-style ID."""
        return False

    def __getstate__(self):
        return self.tagName

    def __setstate__(self, state):
        self.tagName = state

def _clear_id_cache(node):
    if node.nodeType == Node.DOCUMENT_NODE:
        node._id_cache.clear()
        node._id_search_stack = None
    elif _in_document(node):
        node.ownerDocument._id_cache.clear()
        node.ownerDocument._id_search_stack= None

class Document(Node, DocumentLS):
    __slots__ = ('_elem_info', 'doctype',
                 '_id_search_stack', 'childNodes', '_id_cache')
    _child_node_types = (Node.ELEMENT_NODE, Node.PROCESSING_INSTRUCTION_NODE,
                         Node.COMMENT_NODE, Node.DOCUMENT_TYPE_NODE)

    implementation = DOMImplementation()
    nodeType = Node.DOCUMENT_NODE
    nodeName = "#document"
    nodeValue = None
    attributes = None
    parentNode = None
    previousSibling = nextSibling = None


    # Document attributes from Level 3 (WD 9 April 2002)

    actualEncoding = None
    encoding = None
    standalone = None
    version = None
    strictErrorChecking = False
    errorHandler = None
    documentURI = None

    _magic_id_count = 0

    def __init__(self):
        self.doctype = None
        self.childNodes = NodeList()
        # mapping of (namespaceURI, localName) -> ElementInfo
        #        and tagName -> ElementInfo
        self._elem_info = {}
        self._id_cache = {}
        self._id_search_stack = None

    def _get_elem_info(self, element):
        if element.namespaceURI:
            key = element.namespaceURI, element.localName
        else:
            key = element.tagName
        return self._elem_info.get(key)

    def _get_actualEncoding(self):
        return self.actualEncoding

    def _get_doctype(self):
        return self.doctype

    def _get_documentURI(self):
        return self.documentURI

    def _get_encoding(self):
        return self.encoding

    def _get_errorHandler(self):
        return self.errorHandler

    def _get_standalone(self):
        return self.standalone

    def _get_strictErrorChecking(self):
        return self.strictErrorChecking

    def _get_version(self):
        return self.version

    def appendChild(self, node):
        if node.nodeType not in self._child_node_types:
            raise xml.dom.HierarchyRequestErr(
                "%s cannot be child of %s" % (repr(node), repr(self)))
        if node.parentNode is not None:
            # This needs to be done before the next test since this
            # may *be* the document element, in which case it should
            # end up re-ordered to the end.
            node.parentNode.removeChild(node)

        if node.nodeType == Node.ELEMENT_NODE \
           and self._get_documentElement():
            raise xml.dom.HierarchyRequestErr(
                "two document elements disallowed")
        return Node.appendChild(self, node)

    def removeChild(self, oldChild):
        try:
            self.childNodes.remove(oldChild)
        except ValueError:
            raise xml.dom.NotFoundErr()
        oldChild.nextSibling = oldChild.previousSibling = None
        oldChild.parentNode = None
        if self.documentElement is oldChild:
            self.documentElement = None

        return oldChild

    def _get_documentElement(self):
        for node in self.childNodes:
            if node.nodeType == Node.ELEMENT_NODE:
                return node

    def unlink(self):
        if self.doctype is not None:
            self.doctype.unlink()
            self.doctype = None
        Node.unlink(self)

    def cloneNode(self, deep):
        if not deep:
            return None
        clone = self.implementation.createDocument(None, None, None)
        clone.encoding = self.encoding
        clone.standalone = self.standalone
        clone.version = self.version
        for n in self.childNodes:
            childclone = _clone_node(n, deep, clone)
            assert childclone.ownerDocument.isSameNode(clone)
            clone.childNodes.append(childclone)
            if childclone.nodeType == Node.DOCUMENT_NODE:
                assert clone.documentElement is None
            elif childclone.nodeType == Node.DOCUMENT_TYPE_NODE:
                assert clone.doctype is None
                clone.doctype = childclone
            childclone.parentNode = clone
        self._call_user_data_handler(xml.dom.UserDataHandler.NODE_CLONED,
                                     self, clone)
        return clone

    def createDocumentFragment(self):
        d = DocumentFragment()
        d.ownerDocument = self
        return d

    def createElement(self, tagName):
        e = Element(tagName)
        e.ownerDocument = self
        return e

    def createTextNode(self, data):
        if not isinstance(data, str):
            raise TypeError("node contents must be a string")
        t = Text()
        t.data = data
        t.ownerDocument = self
        return t

    def createCDATASection(self, data):
        if not isinstance(data, str):
            raise TypeError("node contents must be a string")
        c = CDATASection()
        c.data = data
        c.ownerDocument = self
        return c

    def createComment(self, data):
        c = Comment(data)
        c.ownerDocument = self
        return c

    def createProcessingInstruction(self, target, data):
        p = ProcessingInstruction(target, data)
        p.ownerDocument = self
        return p

    def createAttribute(self, qName):
        a = Attr(qName)
        a.ownerDocument = self
        a.value = ""
        return a

    def createElementNS(self, namespaceURI, qualifiedName):
        prefix, localName = _nssplit(qualifiedName)
        e = Element(qualifiedName, namespaceURI, prefix)
        e.ownerDocument = self
        return e

    def createAttributeNS(self, namespaceURI, qualifiedName):
        prefix, localName = _nssplit(qualifiedName)
        a = Attr(qualifiedName, namespaceURI, localName, prefix)
        a.ownerDocument = self
        a.value = ""
        return a

    # A couple of implementation-specific helpers to create node types
    # not supported by the W3C DOM specs:

    def _create_entity(self, name, publicId, systemId, notationName):
        e = Entity(name, publicId, systemId, notationName)
        e.ownerDocument = self
        return e

    def _create_notation(self, name, publicId, systemId):
        n = Notation(name, publicId, systemId)
        n.ownerDocument = self
        return n

    def getElementById(self, id):
        if id in self._id_cache:
            return self._id_cache[id]
        if not (self._elem_info or self._magic_id_count):
            return None

        stack = self._id_search_stack
        if stack is None:
            # we never searched before, or the cache has been cleared
            stack = [self.documentElement]
            self._id_search_stack = stack
        elif not stack:
            # Previous search was completed and cache is still valid;
            # no matching node.
            return None

        result = None
        while stack:
            node = stack.pop()
            # add child elements to stack for continued searching
            stack.extend([child for child in node.childNodes
                          if child.nodeType in _nodeTypes_with_children])
            # check this node
            info = self._get_elem_info(node)
            if info:
                # We have to process all ID attributes before
                # returning in order to get all the attributes set to
                # be IDs using Element.setIdAttribute*().
                for attr in node.attributes.values():
                    if attr.namespaceURI:
                        if info.isIdNS(attr.namespaceURI, attr.localName):
                            self._id_cache[attr.value] = node
                            if attr.value == id:
                                result = node
                            elif not node._magic_id_nodes:
                                break
                    elif info.isId(attr.name):
                        self._id_cache[attr.value] = node
                        if attr.value == id:
                            result = node
                        elif not node._magic_id_nodes:
                            break
                    elif attr._is_id:
                        self._id_cache[attr.value] = node
                        if attr.value == id:
                            result = node
                        elif node._magic_id_nodes == 1:
                            break
            elif node._magic_id_nodes:
                for attr in node.attributes.values():
                    if attr._is_id:
                        self._id_cache[attr.value] = node
                        if attr.value == id:
                            result = node
            if result is not None:
                break
        return result

    def getElementsByTagName(self, name):
        return _get_elements_by_tagName_helper(self, name, NodeList())

    def getElementsByTagNameNS(self, namespaceURI, localName):
        return _get_elements_by_tagName_ns_helper(
            self, namespaceURI, localName, NodeList())

    def isSupported(self, feature, version):
        return self.implementation.hasFeature(feature, version)

    def importNode(self, node, deep):
        if node.nodeType == Node.DOCUMENT_NODE:
            raise xml.dom.NotSupportedErr("cannot import document nodes")
        elif node.nodeType == Node.DOCUMENT_TYPE_NODE:
            raise xml.dom.NotSupportedErr("cannot import document type nodes")
        return _clone_node(node, deep, self)

    def writexml(self, writer, indent="", addindent="", newl="", encoding=None):
        if encoding is None:
            writer.write('<?xml version="1.0" ?>'+newl)
        else:
            writer.write('<?xml version="1.0" encoding="%s"?>%s' % (
                encoding, newl))
        for node in self.childNodes:
            node.writexml(writer, indent, addindent, newl)

    # DOM Level 3 (WD 9 April 2002)

    def renameNode(self, n, namespaceURI, name):
        if n.ownerDocument is not self:
            raise xml.dom.WrongDocumentErr(
                "cannot rename nodes from other documents;\n"
                "expected %s,\nfound %s" % (self, n.ownerDocument))
        if n.nodeType not in (Node.ELEMENT_NODE, Node.ATTRIBUTE_NODE):
            raise xml.dom.NotSupportedErr(
                "renameNode() only applies to element and attribute nodes")
        if namespaceURI != EMPTY_NAMESPACE:
            if ':' in name:
                prefix, localName = name.split(':', 1)
                if (  prefix == "xmlns"
                      and namespaceURI != xml.dom.XMLNS_NAMESPACE):
                    raise xml.dom.NamespaceErr(
                        "illegal use of 'xmlns' prefix")
            else:
                if (  name == "xmlns"
                      and namespaceURI != xml.dom.XMLNS_NAMESPACE
                      and n.nodeType == Node.ATTRIBUTE_NODE):
                    raise xml.dom.NamespaceErr(
                        "illegal use of the 'xmlns' attribute")
                prefix = None
                localName = name
        else:
            prefix = None
            localName = None
        if n.nodeType == Node.ATTRIBUTE_NODE:
            element = n.ownerElement
            if element is not None:
                is_id = n._is_id
                element.removeAttributeNode(n)
        else:
            element = None
        n.prefix = prefix
        n._localName = localName
        n.namespaceURI = namespaceURI
        n.nodeName = name
        if n.nodeType == Node.ELEMENT_NODE:
            n.tagName = name
        else:
            # attribute node
            n.name = name
            if element is not None:
                element.setAttributeNode(n)
                if is_id:
                    element.setIdAttributeNode(n)
        # It's not clear from a semantic perspective whether we should
        # call the user data handlers for the NODE_RENAMED event since
        # we're re-using the existing node.  The draft spec has been
        # interpreted as meaning "no, don't call the handler unless a
        # new node is created."
        return n

defproperty(Document, "documentElement",
            doc="Top-level element of this document.")


def _clone_node(node, deep, newOwnerDocument):
    """
    Clone a node and give it the new owner document.
    Called by Node.cloneNode and Document.importNode
    """
    if node.ownerDocument.isSameNode(newOwnerDocument):
        operation = xml.dom.UserDataHandler.NODE_CLONED
    else:
        operation = xml.dom.UserDataHandler.NODE_IMPORTED
    if node.nodeType == Node.ELEMENT_NODE:
        clone = newOwnerDocument.createElementNS(node.namespaceURI,
                                                 node.nodeName)
        for attr in node.attributes.values():
            clone.setAttributeNS(attr.namespaceURI, attr.nodeName, attr.value)
            a = clone.getAttributeNodeNS(attr.namespaceURI, attr.localName)
            a.specified = attr.specified

        if deep:
            for child in node.childNodes:
                c = _clone_node(child, deep, newOwnerDocument)
                clone.appendChild(c)

    elif node.nodeType == Node.DOCUMENT_FRAGMENT_NODE:
        clone = newOwnerDocument.createDocumentFragment()
        if deep:
            for child in node.childNodes:
                c = _clone_node(child, deep, newOwnerDocument)
                clone.appendChild(c)

    elif node.nodeType == Node.TEXT_NODE:
        clone = newOwnerDocument.createTextNode(node.data)
    elif node.nodeType == Node.CDATA_SECTION_NODE:
        clone = newOwnerDocument.createCDATASection(node.data)
    elif node.nodeType == Node.PROCESSING_INSTRUCTION_NODE:
        clone = newOwnerDocument.createProcessingInstruction(node.target,
                                                             node.data)
    elif node.nodeType == Node.COMMENT_NODE:
        clone = newOwnerDocument.createComment(node.data)
    elif node.nodeType == Node.ATTRIBUTE_NODE:
        clone = newOwnerDocument.createAttributeNS(node.namespaceURI,
                                                   node.nodeName)
        clone.specified = True
        clone.value = node.value
    elif node.nodeType == Node.DOCUMENT_TYPE_NODE:
        assert node.ownerDocument is not newOwnerDocument
        operation = xml.dom.UserDataHandler.NODE_IMPORTED
        clone = newOwnerDocument.implementation.createDocumentType(
            node.name, node.publicId, node.systemId)
        clone.ownerDocument = newOwnerDocument
        if deep:
            clone.entities._seq = []
            clone.notations._seq = []
            for n in node.notations._seq:
                notation = Notation(n.nodeName, n.publicId, n.systemId)
                notation.ownerDocument = newOwnerDocument
                clone.notations._seq.append(notation)
                if hasattr(n, '_call_user_data_handler'):
                    n._call_user_data_handler(operation, n, notation)
            for e in node.entities._seq:
                entity = Entity(e.nodeName, e.publicId, e.systemId,
                                e.notationName)
                entity.actualEncoding = e.actualEncoding
                entity.encoding = e.encoding
                entity.version = e.version
                entity.ownerDocument = newOwnerDocument
                clone.entities._seq.append(entity)
                if hasattr(e, '_call_user_data_handler'):
                    e._call_user_data_handler(operation, e, entity)
    else:
        # Note the cloning of Document and DocumentType nodes is
        # implementation specific.  minidom handles those cases
        # directly in the cloneNode() methods.
        raise xml.dom.NotSupportedErr("Cannot clone node %s" % repr(node))

    # Check for _call_user_data_handler() since this could conceivably
    # used with other DOM implementations (one of the FourThought
    # DOMs, perhaps?).
    if hasattr(node, '_call_user_data_handler'):
        node._call_user_data_handler(operation, node, clone)
    return clone


def _nssplit(qualifiedName):
    fields = qualifiedName.split(':', 1)
    if len(fields) == 2:
        return fields
    else:
        return (None, fields[0])


def _do_pulldom_parse(func, args, kwargs):
    events = func(*args, **kwargs)
    toktype, rootNode = events.getEvent()
    events.expandNode(rootNode)
    events.clear()
    return rootNode

def parse(file, parser=None, bufsize=None):
    """Parse a file into a DOM by filename or file object."""
    if parser is None and not bufsize:
        from xml.dom import expatbuilder
        return expatbuilder.parse(file)
    else:
        from xml.dom import pulldom
        return _do_pulldom_parse(pulldom.parse, (file,),
            {'parser': parser, 'bufsize': bufsize})

def parseString(string, parser=None):
    """Parse a file into a DOM from a string."""
    if parser is None:
        from xml.dom import expatbuilder
        return expatbuilder.parseString(string)
    else:
        from xml.dom import pulldom
        return _do_pulldom_parse(pulldom.parseString, (string,),
                                 {'parser': parser})

def getDOMImplementation(features=None):
    if features:
        if isinstance(features, str):
            features = domreg._parse_feature_string(features)
        for f, v in features:
            if not Document.implementation.hasFeature(f, v):
                return None
    return Document.implementation
xml/dom/__pycache__/minicompat.cpython-38.pyc000064400000005270151153537540015140 0ustar00U

e5d'
�@sJdZddddgZddlZefZGdd�de�ZGdd�de�Z	d	d�Z
dS)
z�Python version compatibility support for minidom.

This module contains internal implementation details and
should not be imported; use xml.dom.minidom instead.
�NodeList�
EmptyNodeList�StringTypes�defproperty�Nc@s>eZdZdZdd�Zdd�Zdd�Zeeedd	�Zd
d�Z	dS)
r�cCs(d|krt|�kr$nn||SdS�Nr��len��self�indexrr�*/usr/lib64/python3.8/xml/dom/minicompat.py�item5sz
NodeList.itemcCst|�S�Nr�rrrr
�_get_length9szNodeList._get_lengthcCstj�d��dS�Nz.attempt to modify read-only attribute 'length'��xml�dom�NoModificationAllowedErr�r�valuerrr
�_set_length<s�zNodeList._set_length�$The number of nodes in the NodeList.��doccCs|dkrg}||dd�<dSrr)r�staterrr
�__setstate__DszNodeList.__setstate__N)
�__name__�
__module__�__qualname__�	__slots__rrr�property�lengthrrrrr
r2s�c@sFeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Ze	eedd
�Z
dS)rrcCst�}|�|�|Sr�r�extend�r�other�NLrrr
�__add__Ms
zEmptyNodeList.__add__cCst�}|�|�|Srr%r'rrr
�__radd__Rs
zEmptyNodeList.__radd__cCsdSrrr
rrr
rWszEmptyNodeList.itemcCsdSrrrrrr
rZszEmptyNodeList._get_lengthcCstj�d��dSrrrrrr
r]s�zEmptyNodeList._set_lengthrrN)rr r!r"r*r+rrrr#r$rrrr
rJs�cCsRt|d|�}|fdd�}t|d|�r4td|��t|||d�}t|||�dS)NZ_get_cSstj�dt|���dS)Nz&attempt to modify read-only attribute )rrr�repr)rr�namerrr
�setgs
�zdefproperty.<locals>.setZ_set_zexpected not to find _set_r)�getattr�hasattr�AssertionErrorr#�setattr)�klassr-r�getr.Zproprrr
res�)�__doc__�__all__Zxml.domr�strr�listr�tuplerrrrrr
�<module>s*xml/dom/__pycache__/pulldom.cpython-38.opt-1.pyc000064400000024705151153537540015417 0ustar00U

e5d�.�@s�ddlZddlZdZdZdZdZdZdZdZ	d	Z
Gd
d�dejj�Z
Gdd
�d
�ZGdd�d�ZGdd�de
�ZdZddd�Zddd�ZdS)�N�
START_ELEMENT�END_ELEMENT�COMMENT�START_DOCUMENT�END_DOCUMENT�PROCESSING_INSTRUCTION�IGNORABLE_WHITESPACE�
CHARACTERSc@s�eZdZdZdZd$dd�Zdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�ZdS)%�PullDOMNcCszddlm}||_ddg|_|j|_g|_|jj|_z|jj|_Wnt	k
rVYnX|dig|_
|j
d|_g|_dS)Nr)�
XML_NAMESPACE�xml���)
Zxml.domr�documentFactory�
firstEvent�	lastEvent�elementStack�append�push�pop�AttributeError�_ns_contexts�_current_context�pending_events)�selfrr�r�'/usr/lib64/python3.8/xml/dom/pulldom.py�__init__s

zPullDOM.__init__cCs|jd}|jd=|S�Nr
)r)r�resultrrrr!s
zPullDOM.popcCs
||_dS�N)�_locator)rZlocatorrrr�setDocumentLocator&szPullDOM.setDocumentLocatorcCsHt|d�sg|_|j�|pd|f�|j�|j���|p<d|j|<dS)N�_xmlns_attrs�xmlns)�hasattrr"rrr�copy)r�prefix�urirrr�startPrefixMapping)s

zPullDOM.startPrefixMappingcCs|j��|_dSr)rrr)rr&rrr�endPrefixMapping0szPullDOM.endPrefixMappingcCs�d}t|dd�}|dk	r:|D]\}}||j||f<qg|_|\}}	|r�|dkrn|j|}
|
rj|
d|	}n|	}|jr�|j�||�}q�|�||�}n |jr�|j�|	�}n|�d|	�}|��D]�\}}|\}}
||k�r|
dkr�|
}nd|
}|j�	||�}|�
|�nX|�rF|j|}
|
�r(|
d|
}n|
}|j�	||�}|�
|�n|j�|
�}|�|�||_
q�t|fdg|jd<|jd|_|�|�dS)Nzhttp://www.w3.org/2000/xmlns/r"�:r#zxmlns:�)�getattr�_attrsr"r�documentZcreateElementNS�
buildDocument�
createElement�itemsZcreateAttributeNSZsetAttributeNodeNS�createAttribute�setAttributeNode�valuerrr)r�name�tagName�attrsZ	xmlns_uriZxmlns_attrs�anamer4r'Z	localnamer&�nodeZa_uriZa_localnameZqname�attrrrr�startElementNS3sP



zPullDOM.startElementNScCs&t|��fdg|jd<|jd|_dS�Nr+�rrr)rr5r6rrr�endElementNSlszPullDOM.endElementNScCsz|jr|j�|�}n|�d|�}|��D]$\}}|j�|�}||_|�|�q(t|fdg|jd<|jd|_|�	|�dSr<)
r.r0r/r1r2r4r3rrr)rr5r7r9r8r4r:rrr�startElementpszPullDOM.startElementcCs&t|��fdg|jd<|jd|_dSr<r=)rr5rrr�
endElementszPullDOM.endElementcCsN|jr2|j�|�}t|fdg|jd<|jd|_nt|fdg}|j�|�dSr<)r.�
createCommentrrrr)r�sr9�eventrrr�comment�szPullDOM.commentcCsR|jr4|j�||�}t|fdg|jd<|jd|_nt||fdg}|j�|�dSr<)r.�createProcessingInstructionrrrr)r�target�datar9rCrrr�processingInstruction�szPullDOM.processingInstructioncCs.|j�|�}t|fdg|jd<|jd|_dSr<)r.�createTextNoderr�r�charsr9rrr�ignorableWhitespace�szPullDOM.ignorableWhitespacecCs.|j�|�}t|fdg|jd<|jd|_dSr<)r.rIr	rrJrrr�
characters�szPullDOM.characterscCs$|jdkr ddl}|jjjj|_dS)Nr)rZxml.dom.minidomZdomZminidomZDocument�implementation)rrrrr�
startDocument�s
zPullDOM.startDocumentc	Cs�|j�||d�}||_t|fdg|jd<|jd|_|�|�|jD]�}|ddtkr�|d\}}}|j�||�}t|f|d<nD|ddt	kr�|j�
|dd�}t	|f|d<ntd|dd��||jd<||_qDd|_|jS)Nr+rzUnknown pending event )
rZcreateDocumentr.rrrrrrErrA�AssertionErrorZ
firstChild)	rr'Ztagnamer9�e�_rFrG�nrrrr/�s$


zPullDOM.buildDocumentcCs t|jfdg|jd<|��dSr<)rr.rr�rrrr�endDocument�szPullDOM.endDocumentcCs
d|_dS)z.clear(): Explicitly release parsing structuresN)r.rTrrr�clear�sz
PullDOM.clear)N)�__name__�
__module__�__qualname__r r.rrr!r(r)r;r>r?r@rDrHrLrMrOr/rUrVrrrrr

s&
9		r
c@s$eZdZdd�Zdd�Zdd�ZdS)�ErrorHandlercCst|�dSr)�print�rZ	exceptionrrr�warning�szErrorHandler.warningcCs|�dSrrr\rrr�error�szErrorHandler.errorcCs|�dSrrr\rrr�
fatalError�szErrorHandler.fatalErrorN)rWrXrYr]r^r_rrrrrZ�srZc@s\eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)�DOMEventStreamcCs2||_||_||_t|jd�s&|j|_|��dS)N�feed)�stream�parser�bufsizer$�_slurp�getEvent�reset)rrbrcrdrrrr�szDOMEventStream.__init__cCs.t�|_|j�tjjjd�|j�|j�dSr<)	r
�pulldomrcZ
setFeaturer�saxZhandlerZfeature_namespacesZsetContentHandlerrTrrrrg�szDOMEventStream.resetcCs0ddl}|jdtdd�|��}|r(|St�dS)Nrz[DOMEventStream's __getitem__ method ignores 'pos' parameter. Use iterator protocol instead.�)�
stacklevel)�warnings�warn�DeprecationWarningrf�
IndexError)r�posrl�rcrrr�__getitem__�s�zDOMEventStream.__getitem__cCs|��}|r|St�dSr)rf�
StopIteration�rrqrrr�__next__�szDOMEventStream.__next__cCs|SrrrTrrr�__iter__�szDOMEventStream.__iter__cCsl|��}|g}|rh|\}}||kr&dS|tkr<|d�|�|tkrP|�|�n|tkr^|d=|��}qdSr)rfr�appendChildrr)rr9rC�parents�tokenZcur_noderrr�
expandNode�szDOMEventStream.expandNodecCs~|jjds|jj|j_|jjdsR|j�|j�}|sD|j��dS|j�|�q|jjdd}|jjdd|jjd<|S)Nr+r)	rhrrrb�readrdrc�closera)r�bufrqrrrrfs
zDOMEventStream.getEventcCs|j�|j�|j|_|��S)z� Fallback replacement for getEvent() using the
            standard SAX2 interface, which means we slurp the
            SAX events into memory (no performance gain, but
            we are compatible to all SAX parsers).
        )rc�parserb�_emitrfrTrrrreszDOMEventStream._slurpcCs,|jjdd}|jjdd|jjd<|S)zn Fallback replacement for getEvent() that emits
            the events that _slurp() read previously.
        r+r)rhrrtrrrrszDOMEventStream._emitcCs|j��|`d|_d|_dS)z+clear(): Explicitly release parsing objectsN)rhrVrcrbrTrrrrV!s
zDOMEventStream.clearN)
rWrXrYrrgrrrurvrzrfrerrVrrrrr`�s

r`c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�SAX2DOMcCs2t�||||�|jd}|jd}|�|�dS�Nr
���)r
r;rrw)rr5r6r7�curNode�
parentNoderrrr;*s

zSAX2DOM.startElementNScCs0t�|||�|jd}|jd}|�|�dSr�)r
r?rrw)rr5r7r�r�rrrr?0s

zSAX2DOM.startElementcCs4t�|||�|jdd}|jd}|�|�dS�Nrr+r
)r
rHrrrw)rrFrGr9r�rrrrH6s
zSAX2DOM.processingInstructioncCs2t�||�|jdd}|jd}|�|�dSr�)r
rLrrrw�rrKr9r�rrrrL<s
zSAX2DOM.ignorableWhitespacecCs2t�||�|jdd}|jd}|�|�dSr�)r
rMrrrwr�rrrrMBs
zSAX2DOM.charactersN)rWrXrYr;r?rHrLrMrrrrr�(s
r�i�?cCs@|dkrt}t|t�r"t|d�}n|}|s4tj��}t|||�S)N�rb)�default_bufsize�
isinstance�str�openrri�make_parserr`)Zstream_or_stringrcrdrbrrrr~Ks

r~cCs6ddlm}t|�}||�}|s*tj��}t|||�S)Nr)�StringIO)�ior��lenrrir�r`)�stringrcr�rdr}rrr�parseStringVs
r�)NN)N)Zxml.saxrZxml.sax.handlerrrrrrrrr	riZContentHandlerr
rZr`r�r�r~r�rrrr�<module>s"8\!
xml/dom/__pycache__/minicompat.cpython-38.opt-1.pyc000064400000005134151153537540016076 0ustar00U

e5d'
�@sJdZddddgZddlZefZGdd�de�ZGdd�de�Z	d	d�Z
dS)
z�Python version compatibility support for minidom.

This module contains internal implementation details and
should not be imported; use xml.dom.minidom instead.
�NodeList�
EmptyNodeList�StringTypes�defproperty�Nc@s>eZdZdZdd�Zdd�Zdd�Zeeedd	�Zd
d�Z	dS)
r�cCs(d|krt|�kr$nn||SdS�Nr��len��self�indexrr�*/usr/lib64/python3.8/xml/dom/minicompat.py�item5sz
NodeList.itemcCst|�S�Nr�rrrr
�_get_length9szNodeList._get_lengthcCstj�d��dS�Nz.attempt to modify read-only attribute 'length'��xml�dom�NoModificationAllowedErr�r�valuerrr
�_set_length<s�zNodeList._set_length�$The number of nodes in the NodeList.��doccCs|dkrg}||dd�<dSrr)r�staterrr
�__setstate__DszNodeList.__setstate__N)
�__name__�
__module__�__qualname__�	__slots__rrr�property�lengthrrrrr
r2s�c@sFeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Ze	eedd
�Z
dS)rrcCst�}|�|�|Sr�r�extend�r�other�NLrrr
�__add__Ms
zEmptyNodeList.__add__cCst�}|�|�|Srr%r'rrr
�__radd__Rs
zEmptyNodeList.__radd__cCsdSrrr
rrr
rWszEmptyNodeList.itemcCsdSrrrrrr
rZszEmptyNodeList._get_lengthcCstj�d��dSrrrrrr
r]s�zEmptyNodeList._set_lengthrrN)rr r!r"r*r+rrrr#r$rrrr
rJs�cCs8t|d|�}|fdd�}t|||d�}t|||�dS)NZ_get_cSstj�dt|���dS)Nz&attempt to modify read-only attribute )rrr�repr)rr�namerrr
�setgs
�zdefproperty.<locals>.setr)�getattrr#�setattr)�klassr-r�getr.Zproprrr
res)�__doc__�__all__Zxml.domr�strr�listr�tuplerrrrrr
�<module>s*xml/dom/__pycache__/xmlbuilder.cpython-38.opt-2.pyc000064400000027405151153537540016113 0ustar00U

e5ds0�@s�ddlZddlZddlZddlmZdddgZGdd�d�ZGdd�d�Zd	d
�Z	Gdd�de
�ZGdd�de
�ZGd
d�d�Z
[Gdd�d�ZGdd�d�ZdS)�N)�
NodeFilter�
DOMBuilder�DOMEntityResolver�DOMInputSourcec@sXeZdZdZdZdZdZdZdZdZ	dZ
dZdZdZ
dZdZdZdZdZdZdZdZdS)�Options�TFN)�__name__�
__module__�__qualname__�
namespaces�namespace_declarations�
validation�external_parameter_entities�external_general_entitiesZexternal_dtd_subset�validate_if_schemaZvalidate�datatype_normalization�create_entity_ref_nodes�entities�whitespace_in_element_content�cdata_sections�comments�charset_overrides_xml_encoding�infoset�supported_mediatypes_only�errorHandler�filter�rr�*/usr/lib64/python3.8/xml/dom/xmlbuilder.pyr
s&
rc@s&eZdZdZdZdZdZdZdZdZ	eeee	fZ
dd�Zdd	�Zd
d�Z
dd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdgdgdgdgdgdgd gd!gd"gd#gd"d$gd%gd&gd'gd(gd)gd*gd+gd,gd-ggdd!d"d$d(d.d'd+d-g	d/gd0gd1gd2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�ZdS)=rNr���cCst�|_dS�N)r�_options��selfrrr�__init__:szDOMBuilder.__init__cCs|jSr!��entityResolverr#rrr�_get_entityResolver=szDOMBuilder._get_entityResolvercCs
||_dSr!r&)r$r'rrr�_set_entityResolver?szDOMBuilder._set_entityResolvercCs|jSr!�rr#rrr�_get_errorHandlerBszDOMBuilder._get_errorHandlercCs
||_dSr!r*)r$rrrr�_set_errorHandlerDszDOMBuilder._set_errorHandlercCs|jSr!�rr#rrr�_get_filterGszDOMBuilder._get_filtercCs
||_dSr!r-)r$rrrr�_set_filterIszDOMBuilder._set_filtercCs�|�|�rt|rdpd}z|jt|�|f}Wn(tk
rTtj�d|f�d�Yq�X|D]\}}t|j||�qZntj�	dt
|���dS)Nrrzunsupported feature: %rzunknown feature: )�supportsFeature�	_settings�_name_xform�KeyError�xml�dom�NotSupportedErr�setattrr"�NotFoundErr�repr)r$�name�stateZsettings�valuerrr�
setFeatureLs
��zDOMBuilder.setFeaturecCst|jt|��Sr!)�hasattrr"r2)r$r:rrrr0ZszDOMBuilder.supportsFeaturecCst|�|rdpdf}||jkS)Nrr)r2r1)r$r:r;�keyrrr�
canSetFeature]szDOMBuilder.canSetFeature�rr�rr�r
r�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr)rr�rr�rr�rr)rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrT)rr)rrrUrVrWcCs�t|�}zt|j|�WStk
r�|dkrp|j}|joj|joj|joj|joj|jph|j	ph|j
ph|jph|jYSt
j�dt|���YnXdS)Nrzfeature %s not known)r2�getattrr"�AttributeErrorrrrrrrrrrr4r5r8r9)r$r:Zxname�optionsrrr�
getFeature�s0��������	zDOMBuilder.getFeaturecCs.|jr|j�d|�}nt��d|�}|�|�Sr!)r'�
resolveEntityr�parse)r$�uri�inputrrr�parseURI�szDOMBuilder.parseURIcCsRt�|j�}|j|_|j|_|j}|dkrF|jrFddl}|j�|j�}|�	||�S�Nr)
�copyr"rr�
byteStream�systemId�urllib.request�requestZurlopen�_parse_bytestream)r$r_rZ�fp�urllibrrrr]�szDOMBuilder.parsecCs||jkrtd��td��dS)Nznot a legal actionzHaven't written this yet...)�_legal_actions�
ValueError�NotImplementedError)r$r_Zcnode�actionrrr�parseWithContext�s
zDOMBuilder.parseWithContextcCs ddl}|jj�|�}|�|�Sra)Zxml.dom.expatbuilderr5ZexpatbuilderZmakeBuilderZ	parseFile)r$�streamrZr4Zbuilderrrrrg�szDOMBuilder._parse_bytestream)rr	r
r'rrZACTION_REPLACEZACTION_APPEND_AS_CHILDRENZACTION_INSERT_AFTERZACTION_INSERT_BEFORErjr%r(r)r+r,r.r/r=r0r@r1r[r`r]rnrgrrrrr-s���������������������������=
cCs|���dd�S)N�-�_)�lower�replace)r:rrrr2�sr2c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r)�_openerc
Cs�t�}||_||_|���|�|_|�|�|_ddl}ddl	}|j
�|�}|\}}}	}
}}|	r�|	�d�s�|�
|	�d}	|||	|
||f}|j
�|�|_|S)Nr�/)r�publicIdrd�_get_opener�openrc�_guess_media_encoding�encoding�	posixpathZurllib.parser]Zurlparse�endswith�dirnameZ
urlunparse�baseURI)
r$rvrd�sourcer{ri�partsZschemeZnetloc�pathZparamsZqueryZfragmentrrrr\�szDOMEntityResolver.resolveEntitycCs2z|jWStk
r,|��|_|jYSXdSr!)rtrY�_create_openerr#rrrrw�s

zDOMEntityResolver._get_openercCsddl}|j��Sra)rerfZbuild_opener)r$rirrrr��sz DOMEntityResolver._create_openercCsF|j��}d|krB|��D]&}|�d�r|�dd�d��SqdS)NzContent-Typezcharset=�=r)rc�infoZgetplist�
startswith�splitrr)r$rr�Zparamrrrry�s


z'DOMEntityResolver._guess_media_encodingN)rr	r
�	__slots__r\rwr�ryrrrrr�s
c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd S)!r�rc�characterStream�
stringDatarzrvrdr~cCs.d|_d|_d|_d|_d|_d|_d|_dSr!r�r#rrrr%szDOMInputSource.__init__cCs|jSr!�rcr#rrr�_get_byteStreamszDOMInputSource._get_byteStreamcCs
||_dSr!r�)r$rcrrr�_set_byteStreamszDOMInputSource._set_byteStreamcCs|jSr!�r�r#rrr�_get_characterStreamsz#DOMInputSource._get_characterStreamcCs
||_dSr!r�)r$r�rrr�_set_characterStreamsz#DOMInputSource._set_characterStreamcCs|jSr!�r�r#rrr�_get_stringDataszDOMInputSource._get_stringDatacCs
||_dSr!r�)r$�datarrr�_set_stringDataszDOMInputSource._set_stringDatacCs|jSr!�rzr#rrr�
_get_encodingszDOMInputSource._get_encodingcCs
||_dSr!r�)r$rzrrr�
_set_encodingszDOMInputSource._set_encodingcCs|jSr!�rvr#rrr�
_get_publicId"szDOMInputSource._get_publicIdcCs
||_dSr!r�)r$rvrrr�
_set_publicId$szDOMInputSource._set_publicIdcCs|jSr!�rdr#rrr�
_get_systemId'szDOMInputSource._get_systemIdcCs
||_dSr!r�)r$rdrrr�
_set_systemId)szDOMInputSource._set_systemIdcCs|jSr!�r~r#rrr�_get_baseURI,szDOMInputSource._get_baseURIcCs
||_dSr!r��r$r^rrr�_set_baseURI.szDOMInputSource._set_baseURIN)rr	r
r�r%r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrs 	c@s:eZdZdZdZdZdZejZ	dd�Z
dd�Zd	d
�ZdS)�DOMBuilderFilterrrrr cCs|jSr!)�
whatToShowr#rrr�_get_whatToShowCsz DOMBuilderFilter._get_whatToShowcCs|jSr!��
FILTER_ACCEPT�r$Zelementrrr�
acceptNodeFszDOMBuilderFilter.acceptNodecCs|jSr!r�r�rrr�startContainerIszDOMBuilderFilter.startContainerN)
rr	r
r�Z
FILTER_REJECTZFILTER_SKIPZFILTER_INTERRUPTrZSHOW_ALLr�r�r�r�rrrrr�2s
r�c@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�
DocumentLSFcCsdS)NFrr#rrr�
_get_asyncTszDocumentLS._get_asynccCs|rtj�d��dS)Nz.asynchronous document loading is not supported)r4r5r6)r$�flagrrr�
_set_asyncWs�zDocumentLS._set_asynccCstd��dS)Nz'haven't figured out what this means yet�rlr#rrr�abort\s�zDocumentLS.abortcCstd��dS�Nzhaven't written this yetr�r�rrr�loadbszDocumentLS.loadcCstd��dSr�r�)r$rrrr�loadXMLeszDocumentLS.loadXMLcCs*|dkr|}n|j|k	r"tj���|��Sr!)Z
ownerDocumentr4r5ZWrongDocumentErrZtoxml)r$Zsnoderrr�saveXMLhs


zDocumentLS.saveXMLN)
rr	r
Zasync_r�r�r�r�r�r�rrrrr�Osr�c@s,eZdZdZdZdd�Zdd�Zdd�Zd	S)
�DOMImplementationLSrrcCsF|dk	rtj�d��||jkr$t�S||jkr:tj�d��td��dS)NzschemaType not yet supportedz'asynchronous builders are not supportedzunknown value for mode)r4r5r6�MODE_SYNCHRONOUSr�MODE_ASYNCHRONOUSrk)r$�modeZ
schemaTyperrr�createDOMBuilderts�

�z$DOMImplementationLS.createDOMBuildercCstd��dS)Nz-the writer interface hasn't been written yet!r�r#rrr�createDOMWriters�z#DOMImplementationLS.createDOMWritercCst�Sr!)rr#rrr�createDOMInputSource�sz(DOMImplementationLS.createDOMInputSourceN)rr	r
r�r�r�r�r�rrrrr�ps
r�)rb�warningsZxml.domr4Zxml.dom.NodeFilterr�__all__rrr2�objectrrr�r�r�rrrr�<module>s
 %,1!xml/dom/__pycache__/__init__.cpython-38.opt-1.pyc000064400000012634151153537540015500 0ustar00U

e5d��@s�dZGdd�d�ZdZdZdZdZdZdZd	Zd
Z	dZ
dZd
ZdZ
dZdZdZdZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd �d e�ZGd!d"�d"e�ZGd#d$�d$e�ZGd%d&�d&e�ZGd'd(�d(e�ZGd)d*�d*e�ZGd+d,�d,e�ZGd-d.�d.e�Z Gd/d0�d0e�Z!Gd1d2�d2e�Z"Gd3d4�d4e�Z#Gd5d6�d6�Z$d7Z%d8Z&d9Z'd:Z(d:Z)dd;l*m+Z+m,Z,d:S)<a
W3C Document Object Model implementation for Python.

The Python mapping of the Document Object Model is documented in the
Python Library Reference in the section on the xml.dom package.

This package contains the following modules:

minidom -- A simple implementation of the Level 1 DOM with namespace
           support added (based on the Level 2 specification) and other
           minor Level 2 functionality.

pulldom -- DOM builder supporting on-demand tree-building for selected
           subtrees of the document.

c@sDeZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdS)�Nodez$Class giving the NodeType constants.����������	�
��N)�__name__�
__module__�__qualname__�__doc__�	__slots__ZELEMENT_NODEZATTRIBUTE_NODEZ	TEXT_NODEZCDATA_SECTION_NODEZENTITY_REFERENCE_NODEZENTITY_NODEZPROCESSING_INSTRUCTION_NODEZCOMMENT_NODEZ
DOCUMENT_NODEZDOCUMENT_TYPE_NODEZDOCUMENT_FRAGMENT_NODEZ
NOTATION_NODErrr�(/usr/lib64/python3.8/xml/dom/__init__.pyrs	rrrrrrrr	r
rrr
r�
���c@s eZdZdZdd�Zdd�ZdS)�DOMExceptionzmAbstract base class for DOM exceptions.
    Exceptions with specific codes are specializations of this class.cOs(|jtkrtd��tj|f|�|�dS)Nz0DOMException should not be instantiated directly)�	__class__r�RuntimeError�	Exception�__init__)�self�args�kwrrrrBs

�zDOMException.__init__cCs|jS)N)�code)rrrr�	_get_codeHszDOMException._get_codeN)rrrrrr"rrrrr>src@seZdZeZdS)�IndexSizeErrN)rrr�INDEX_SIZE_ERRr!rrrrr#Lsr#c@seZdZeZdS)�DomstringSizeErrN)rrr�DOMSTRING_SIZE_ERRr!rrrrr%Osr%c@seZdZeZdS)�HierarchyRequestErrN)rrr�HIERARCHY_REQUEST_ERRr!rrrrr'Rsr'c@seZdZeZdS)�WrongDocumentErrN)rrr�WRONG_DOCUMENT_ERRr!rrrrr)Usr)c@seZdZeZdS)�InvalidCharacterErrN)rrr�INVALID_CHARACTER_ERRr!rrrrr+Xsr+c@seZdZeZdS)�NoDataAllowedErrN)rrr�NO_DATA_ALLOWED_ERRr!rrrrr-[sr-c@seZdZeZdS)�NoModificationAllowedErrN)rrr�NO_MODIFICATION_ALLOWED_ERRr!rrrrr/^sr/c@seZdZeZdS)�NotFoundErrN)rrr�
NOT_FOUND_ERRr!rrrrr1asr1c@seZdZeZdS)�NotSupportedErrN)rrr�NOT_SUPPORTED_ERRr!rrrrr3dsr3c@seZdZeZdS)�InuseAttributeErrN)rrr�INUSE_ATTRIBUTE_ERRr!rrrrr5gsr5c@seZdZeZdS)�InvalidStateErrN)rrr�INVALID_STATE_ERRr!rrrrr7jsr7c@seZdZeZdS)�	SyntaxErrN)rrr�
SYNTAX_ERRr!rrrrr9msr9c@seZdZeZdS)�InvalidModificationErrN)rrr�INVALID_MODIFICATION_ERRr!rrrrr;psr;c@seZdZeZdS)�NamespaceErrN)rrr�
NAMESPACE_ERRr!rrrrr=ssr=c@seZdZeZdS)�InvalidAccessErrN)rrr�INVALID_ACCESS_ERRr!rrrrr?vsr?c@seZdZeZdS)�
ValidationErrN)rrr�VALIDATION_ERRr!rrrrrAysrAc@s eZdZdZdZdZdZdZdS)�UserDataHandlerzBClass giving the operation constants for UserDataHandler.handle().rrrrN)rrrrZNODE_CLONEDZ
NODE_IMPORTEDZNODE_DELETEDZNODE_RENAMEDrrrrrC|s
rCz$http://www.w3.org/XML/1998/namespacezhttp://www.w3.org/2000/xmlns/zhttp://www.w3.org/1999/xhtmlN)�getDOMImplementation�registerDOMImplementation)-rrr$r&r(r*r,r.r0r2r4r6r8r:r<r>r@rBrrr#r%r'r)r+r-r/r1r3r5r7r9r;r=r?rArCZ
XML_NAMESPACEZXMLNS_NAMESPACEZXHTML_NAMESPACEZEMPTY_NAMESPACEZEMPTY_PREFIXZdomregrDrErrrr�<module>sR
xml/dom/__pycache__/minidom.cpython-38.opt-1.pyc000064400000153752151153537540015404 0ustar00U

e5d)�@s�dZddlZddlZddlmZmZmZmZddlTddl	m
Z
mZejj
jejj
jfZGdd�dejj
�Z
ee
dd	d
�ee
ddd
�ee
d
dd
�dd�Zdd�Zdd�Zdd�Zdd�ZGdd�de
�ZGdd�de
�Zeeddd
�eed
dd
�eed d!d
�Gd"d#�d#e�Zeed$d%d
�eZGd&d'�d'e�Zedd�ZGd(d)�d)e
�Zeed*d+d
�eed
d,d
�d-d.�ZGd/d0�d0�Z Gd1d2�d2e e
�Z!Gd3d4�d4e e
�Z"ee"d$d5d
�Gd6d7�d7e"�Z#ee#d8d9d
�ee#d:d;d
�d<d=�Z$d>d?�Z%Gd@dA�dAe"�Z&GdBdC�dCe#�Z'GdDdE�dEe�Z(ee(d$dFd
�GdGdH�dH�Z)GdIdJ�dJe)e e
�Z*GdKdL�dLe)e
�Z+GdMdN�dNe)e e
�Z,GdOdP�dPe
�Z-GdQdR�dRe�Z.dSdT�Z/GdUdV�dVe
e�Z0ee0dWdXd
�dYdZ�Z1d[d\�Z2d]d^�Z3ded_d`�Z4dfdadb�Z5dgdcdd�Z6dS)hacSimple implementation of the Level 1 DOM.

Namespaces and other minor Level 2 features are also supported.

parse("foo.xml")

parseString("<foo><bar/></foo>")

Todo:
=====
 * convenience methods for getting elements and text.
 * more testing
 * bring some of the writer and linearizer code into conformance with this
        interface
 * SAX 2 namespaces
�N)�EMPTY_NAMESPACE�EMPTY_PREFIX�XMLNS_NAMESPACE�domreg)�*)�DOMImplementationLS�
DocumentLSc@s�eZdZdZdZdZdZdZeZ	dd�Z
d2dd�Zd3dd	�Zd
d�Z
dd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Z dS)4�NodeNcCsdS)NT���selfr
r
�'/usr/lib64/python3.8/xml/dom/minidom.py�__bool__+sz
Node.__bool__cCs|�dd|�S�N�)�toprettyxml)r�encodingr
r
r
�toxml.sz
Node.toxml�	�
cCsx|dkrt��}ntjt��|ddd�}|jtjkrH|�|d|||�n|�|d||�|dkrh|��S|�	���SdS)N�xmlcharrefreplacer)r�errors�newliner)
�io�StringIO�
TextIOWrapper�BytesIO�nodeTyper	�
DOCUMENT_NODE�writexml�getvalue�detach)r�indent�newlr�writerr
r
r
r1s

�zNode.toprettyxmlcCs
t|j�S�N)�bool�
childNodesrr
r
r
�
hasChildNodesCszNode.hasChildNodescCs|jSr%�r'rr
r
r
�_get_childNodesFszNode._get_childNodescCs|jr|jdSdS�Nrr)rr
r
r
�_get_firstChildIszNode._get_firstChildcCs|jr|jdSdS�N���r)rr
r
r
�_get_lastChildMszNode._get_lastChildcCs
|j|jkr,t|j�D]}|�||�q|S|j|jkrTtj�dt	|�t	|�f��|j
dk	rj|j
�|�|dkr~|�|�n�z|j�
|�}Wntk
r�tj���YnX|jtkr�t|�|j�||�||_||_|r�|j|d}||_||_nd|_||_
|S)N�%s cannot be child of %s�)r�DOCUMENT_FRAGMENT_NODE�tupler'�insertBefore�_child_node_types�xml�dom�HierarchyRequestErr�repr�
parentNode�removeChild�appendChild�index�
ValueError�NotFoundErr�_nodeTypes_with_children�_clear_id_cache�insert�nextSibling�previousSibling)r�newChild�refChild�cr=�noder
r
r
r4Qs8�

zNode.insertBeforecCs�|j|jkr*t|j�D]}|�|�q|S|j|jkrTtj�dt	|�t	|�f��n|jt
krft|�|jdk	r||j�
|�t||�d|_|S�Nr0)rr2r3r'r<r5r6r7r8r9r@rAr:r;�
_append_childrC)rrHrGr
r
r
r<qs�


zNode.appendChildcCs|j|jkr(|j}|�|�|�||�S|j|jkrPtj�dt	|�t	|�f��||kr\dS|j
dk	rr|j
�|�z|j�|�}Wnt
k
r�tj���YnX||j|<||_
d|_
|jtks�|jtkr�t|�|j|_|j|_d|_d|_|jr�||j_|j�r||j_|SrI)rr2rCr;r4r5r6r7r8r9r:r'r=r>r?r@rArD)rrE�oldChildrFr=r
r
r
�replaceChild�s@
�


�zNode.replaceChildcCs�z|j�|�Wntk
r.tj���YnX|jdk	rD|j|j_|jdk	rX|j|j_d|_|_|jt	krvt
|�d|_|Sr%)r'�remover>r6r7r?rCrDrr@rAr:�rrKr
r
r
r;�s




zNode.removeChildcCs�g}|jD]�}|jtjkr�|jsJ|r0|j|d_|jr@|j|j_|��q�|r�|dj|jkr�|d}|j|j|_|j|_|jr�||j_|��q�|�|�q
|�|�|jtj	kr
|�
�q
||jdd�<dSr-)r'rr	�	TEXT_NODE�datarCrD�unlink�append�ELEMENT_NODE�	normalize)r�L�childrHr
r
r
rT�s*





zNode.normalizecCst|||jp|�Sr%)�_clone_node�
ownerDocument)r�deepr
r
r
�	cloneNode�szNode.cloneNodecCs|jj�||�Sr%)rX�implementation�
hasFeature�r�feature�versionr
r
r
�isSupported�szNode.isSupportedcCsdSr%r
rr
r
r
�_get_localName�szNode._get_localNamecCs||kSr%r
�r�otherr
r
r
�
isSameNode�szNode.isSameNodecCs|�|d�r|SdSdSr%)r`�rr^r
r
r
�getInterface�szNode.getInterfacec	Cs0z|j|dWSttfk
r*YdSXdSr+)�
_user_data�AttributeError�KeyError�r�keyr
r
r
�getUserData�szNode.getUserDatacCsnd}z
|j}Wntk
r,i}||_YnX||krB||d}|dkr^d}|dk	rj||=n||f||<|Sr+)rgrh)rrkrP�handler�old�dr
r
r
�setUserData�s
zNode.setUserDatacCsDt|d�r@t|j���D]&\}\}}|dk	r|�|||||�qdS)Nrg)�hasattr�listrg�itemsZhandle)r�	operation�srcZdstrkrPrmr
r
r
�_call_user_data_handler�s
zNode._call_user_data_handlercCs>d|_|_|jr.|jD]}|��qt�|_d|_d|_dSr%)r:rXr'rQ�NodeListrDrC)rrVr
r
r
rQs

zNode.unlinkcCs|Sr%r
rr
r
r
�	__enter__szNode.__enter__cCs|��dSr%)rQ)rZetZev�tbr
r
r
�__exit__sz
Node.__exit__)N)rrN)!�__name__�
__module__�__qualname__�namespaceURIr:rXrCrDr�prefixrrrr(r*r,r/r4r<rLr;rTrZr`rardrfrlrprvrQrxrzr
r
r
r
r	"s:

  
r	�
firstChildzFirst child node, or None.)�doc�	lastChildzLast child node, or None.�	localNamez"Namespace-local name of this node.cCs2|j}|r|d}||_||_|�|�||_dSr-)r'rDrCrRr:)rrHr'Zlastr
r
r
rJs
rJcCs$|dk	r |jtjkrdS|j}qdS�NTF)rr	rr:�rHr
r
r
�_in_document&s
r�cCs6|r2|�dd��dd��dd��dd�}|�|�d	S)
zWrites datachars to writer.�&z&amp;�<z&lt;�"z&quot;�>z&gt;N)�replace�write)r$rPr
r
r
�_write_data.s��r�cCsD|jD]8}|jtjkr2|dks(|j|kr2|�|�t|||�q|S�Nr)r'rr	rS�tagNamerR�_get_elements_by_tagName_helper)�parent�name�rcrHr
r
r
r�5s
��
r�cCsX|jD]L}|jtjkr|dks(|j|krD|dks:|j|krD|�|�t||||�q|Sr�)r'rr	rSr�r~rR�"_get_elements_by_tagName_ns_helper)r�ZnsURIr�r�rHr
r
r
r�=s
��
r�c@sJeZdZejZdZdZdZdZ	ej
ejejej
ejejejfZdd�ZdS)�DocumentFragmentz#document-fragmentNcCst�|_dSr%)rwr'rr
r
r
�__init__TszDocumentFragment.__init__)r{r|r}r	r2r�nodeName�	nodeValue�
attributesr:rSrO�CDATA_SECTION_NODE�ENTITY_REFERENCE_NODE�PROCESSING_INSTRUCTION_NODE�COMMENT_NODE�
NOTATION_NODEr5r�r
r
r
r
r�Fs�r�c@s�eZdZdZejZdZdZdZ	ej
ejfZe
ddfdd�Zdd�Zdd	�Zd
d�Zdd
�Zeee�ZZdd�Zdd�Zeee�ZZdd�Zdd�Zeee�Zdd�Zdd�Zdd�ZdS)�Attr)�_name�_valuer~�_prefixr'�
_localNamerX�ownerElementNFcCs2d|_||_||_||_t�|_|j�t��dSr%)r�r�r~r�rwr'rR�Text)r�qNamer~r�rr
r
r
r�bsz
Attr.__init__cCs4z|jWStk
r.|j�dd�dYSXdS�N�:r1r.)r�rhr��splitrr
r
r
raoszAttr._get_localNamecCs|jSr%)�	specifiedrr
r
r
�_get_specifieduszAttr._get_specifiedcCs|jSr%)r�rr
r
r
�	_get_namexszAttr._get_namecCs||_|jdk	rt|j�dSr%)r�r�rA�r�valuer
r
r
�	_set_name{s
zAttr._set_namecCs|jSr%)r�rr
r
r
�
_get_value�szAttr._get_valuecCs6||_||jd_|jdk	r&t|j�||jd_dSr+)r�r'rPr�rAr�r
r
r
�
_set_value�s


zAttr._set_valuecCs|jSr%)r�rr
r
r
�_get_prefix�szAttr._get_prefixcCsd|j}|dkr&|r&|tkr&tj�d��||_|dkr<|j}nd||jf}|jrZt|j�||_	dS)N�xmlnsz5illegal use of 'xmlns' prefix for the wrong namespacez%s:%s)
r~rr6r7�NamespaceErrr�r�r�rAr�)rrZnsuriZnewNamer
r
r
�_set_prefix�s�
zAttr._set_prefixcCsv|j}|dk	rR|j|j=|j|j|jf=|jrRd|_|jd8_|jj	d8_	|j
D]}|��qX|j
dd�=dS)NFr1)r��_attrsr��_attrsNSr~r��_is_id�_magic_id_nodesrX�_magic_id_countr'rQ)r�elemrVr
r
r
rQ�s


zAttr.unlinkcCsf|jr
dS|j}|j}|dks&|dkr*dS|�|�}|dkr@dS|jrV|�|j|j�S|�|j�SdSr�)	r�rXr��_get_elem_infor~�isIdNSr��isIdr��rr�r��infor
r
r
�	_get_isId�s
zAttr._get_isIdcCs\|j}|j}|dks|dkr tS|�|�}|dkr6tS|jrL|�|j|j�S|�|j�SdSr%)	rXr��_no_typer�r~�getAttributeTypeNSr��getAttributeTyper�r�r
r
r
�_get_schemaType�s
zAttr._get_schemaType) r{r|r}�	__slots__r	�ATTRIBUTE_NODErr�r�r�rOr�r5rr�rar�r�r��propertyr�r�r�r�r�r�r�r�rrQr�r�r
r
r
r
r�Xs.�


r�r�z True if this attribute is an ID.z'Namespace-local name of this attribute.�
schemaTypezSchema type for this attribute.c@s�eZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
d:dd�ZeZdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Z dS);�NamedNodeMapaThe attribute list is a transient interface to the underlying
    dictionaries.  Mutations here will change the underlying element's
    dictionary.

    Ordering is imposed artificially and does not reflect the order of
    attributes as found in an input document.
    �r�r��
_ownerElementcCs||_||_||_dSr%r�)r�attrsZattrsNSr�r
r
r
r��szNamedNodeMap.__init__cCs
t|j�Sr%)�lenr�rr
r
r
�_get_length�szNamedNodeMap._get_lengthcCs4z|t|j���|WStk
r.YdSXdSr%)rrr��keys�
IndexError�rr=r
r
r
�item�szNamedNodeMap.itemcCs*g}|j��D]}|�|j|jf�q|Sr%)r��valuesrRr�r��rrUrHr
r
r
rs�szNamedNodeMap.itemscCs0g}|j��D]}|�|j|jf|jf�q|Sr%)r�r�rRr~r�r�r�r
r
r
�itemsNS�szNamedNodeMap.itemsNScCs"t|t�r||jkS||jkSdSr%)�
isinstance�strr�r�rjr
r
r
�__contains__�s

zNamedNodeMap.__contains__cCs
|j��Sr%)r�r�rr
r
r
r�szNamedNodeMap.keyscCs
|j��Sr%)r�r�rr
r
r
�keysNSszNamedNodeMap.keysNScCs
|j��Sr%)r�r�rr
r
r
r�szNamedNodeMap.valuesNcCs|j�||�Sr%�r��get)rr�r�r
r
r
r�
szNamedNodeMap.getcCs:|jt|dd�krdSt|�t|�kt|�t|�kSdS)Nr�r)r��getattr�idrbr
r
r
�_cmpszNamedNodeMap._cmpcCs|�|�dkSr+�r�rbr
r
r
�__eq__szNamedNodeMap.__eq__cCs|�|�dkSr+r�rbr
r
r
�__ge__szNamedNodeMap.__ge__cCs|�|�dkSr+r�rbr
r
r
�__gt__szNamedNodeMap.__gt__cCs|�|�dkSr+r�rbr
r
r
�__le__szNamedNodeMap.__le__cCs|�|�dkSr+r�rbr
r
r
�__lt__!szNamedNodeMap.__lt__cCs"t|t�r|j|S|j|SdSr%)r�r3r�r�)r�attname_or_tupler
r
r
�__getitem__$s

zNamedNodeMap.__getitem__cCsvt|t�rRz|j|}Wn0tk
rHt|�}|jj|_|�|�YnX||_n t|t�sdt	d��|}|�|�dS)Nz%value must be a string or Attr object)
r�r�r�rir�r�rX�setNamedItemr��	TypeError)r�attnamer�rHr
r
r
�__setitem__+s


zNamedNodeMap.__setitem__cCs(z|j|WStk
r"YdSXdSr%)r�ri�rr�r
r
r
�getNamedItem:szNamedNodeMap.getNamedItemcCs,z|j||fWStk
r&YdSXdSr%)r�ri�rr~r�r
r
r
�getNamedItemNS@szNamedNodeMap.getNamedItemNScCsX|�|�}|dk	rJt|j�|j|j=|j|j|jf=t|d�rFd|_	|St
j���dS�Nr�)
r�rAr�r�r�r�r~r�rqr�r6r7r?�rr��nr
r
r
�removeNamedItemFs



zNamedNodeMap.removeNamedItemcCsZ|�||�}|dk	rLt|j�|j|j|jf=|j|j=t|d�rHd|_	|St
j���dSr�)
r�rAr�r�r~r�r�r�rqr�r6r7r?�rr~r�r�r
r
r
�removeNamedItemNSRs


zNamedNodeMap.removeNamedItemNScCstt|t�s&tj�dt|�t|�f��|j�|j�}|r@|�	�||j|j<||j
|j|jf<|j
|_t|j�|SrI)r�r�r6r7r8r9r�r�r�rQr�r~r�r�r�rA)rrHrnr
r
r
r�^s
�
zNamedNodeMap.setNamedItemcCs
|�|�Sr%)r��rrHr
r
r
�setNamedItemNSkszNamedNodeMap.setNamedItemNScCs||}t|j�|��dSr%)rAr�rQ)rr�rHr
r
r
�__delitem__ns
zNamedNodeMap.__delitem__cCs|j|j|jfSr%r�rr
r
r
�__getstate__sszNamedNodeMap.__getstate__cCs|\|_|_|_dSr%r��r�stater
r
r
�__setstate__vszNamedNodeMap.__setstate__)N)!r{r|r}�__doc__r�r�r�r�rsr�r�r�r�r�r��__len__r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r
r
r
r
r��s<

r�Zlengthz$Number of nodes in the NamedNodeMap.c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�TypeInfo��	namespacer�cCs||_||_dSr%r)rrr�r
r
r
r��szTypeInfo.__init__cCs2|jrd|jj|j|jfSd|jj|jfSdS)Nz<%s %r (from %r)>z<%s %r>)r�	__class__r{r�rr
r
r
�__repr__�s
�zTypeInfo.__repr__cCs|jSr%)r�rr
r
r
r��szTypeInfo._get_namecCs|jSr%)rrr
r
r
�_get_namespace�szTypeInfo._get_namespaceN)r{r|r}r�r�rr�rr
r
r
r
r�s
r�c@s eZdZdZejZdZeZ	dZ
ejejejej
ejejfZeddfdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�ZeZdd�Zdd�Z d d!�Z!e!Z"d"d#�Z#d$d%�Z$d&d'�Z%d(d)�Z&d*d+�Z'd9d-d.�Z(d/d0�Z)d1d2�Z*d3d4�Z+d5d6�Z,d7d8�Z-dS):�Element)rXr:r�r�rr~r�r'r�r�rCrDNrcCsBd|_||_|_||_||_t�|_d|_|_d|_	d|_
dSr%)r:r�r�rr~rwr'rCrDr�r�)rr�r~rr�r
r
r
r��s
zElement.__init__cCs|jdkri|_i|_dSr%)r�r�rr
r
r
�_ensure_attributes�s
zElement._ensure_attributescCs4z|jWStk
r.|j�dd�dYSXdSr�)r�rhr�r�rr
r
r
ra�szElement._get_localNamecCs|jSr%�r�rr
r
r
�_get_tagName�szElement._get_tagNamecCs@|jdk	r&t|j���D]}|��qd|_d|_t�|�dSr%)r�rrr�rQr�r	)r�attrr
r
r
rQ�s

zElement.unlinkcCs8|jdkrdSz|j|jWStk
r2YdSXdSr)r�r�ri)rr�r
r
r
�getAttribute�s
zElement.getAttributecCs<|jdkrdSz|j||fjWStk
r6YdSXdSr)r�r�rir�r
r
r
�getAttributeNS�s
zElement.getAttributeNScCsV|�|�}|dkr4t|�}||_|j|_|�|�n||jkrR||_|jrRt|�dSr%)�getAttributeNoder�r�rX�setAttributeNoder�rA)rr�r�r	r
r
r
�setAttribute�s

zElement.setAttributecCs�t|�\}}|�||�}|dkrHt||||�}||_|j|_|�|�n4||jkrf||_|jrft|�|j|kr|||_||_	dSr%)
�_nssplit�getAttributeNodeNSr�r�rXr
r�rArr�)rr~�
qualifiedNamer�r�	localnamer	r
r
r
�setAttributeNS�s

zElement.setAttributeNScCs|jdkrdS|j�|�Sr%r�)r�attrnamer
r
r
r�s
zElement.getAttributeNodecCs|jdkrdS|j�||f�Sr%)r�r�r�r
r
r
rs
zElement.getAttributeNodeNScCs�|jd|fkrtj�d��|��|j�|jd�}|dk	rD|�|�|j	�|j
|jfd�}|dk	rt||k	rt|�|�t||�||k	r�|S||k	r�|SdS)Nzattribute node already owned)
r�r6r7ZInuseAttributeErrrr�r�r��removeAttributeNoder�r~r��_set_attribute_node)rr	Zold1Zold2r
r
r
r
s


zElement.setAttributeNodecCsP|jdkrtj���z|j|}Wntk
r@tj���YnX|�|�dSr%)r�r6r7r?r�rir)rr�r	r
r
r
�removeAttributes

zElement.removeAttributecCsT|jdkrtj���z|j||f}Wntk
rDtj���YnX|�|�dSr%)r�r6r7r?rir)rr~r�r	r
r
r
�removeAttributeNS%s

zElement.removeAttributeNScCs^|dkrtj���z|j|jWntk
r@tj���YnXt|�|��|j|_|Sr%)	r6r7r?r�r�rirArQrXr�r
r
r
r.s
zElement.removeAttributeNodecCs|jdkrdS||jkS�NF�r�r�r
r
r
�hasAttribute>s
zElement.hasAttributecCs|jdkrdS||f|jkSr)r�r�r
r
r
�hasAttributeNSCs
zElement.hasAttributeNScCst||t��Sr%�r�rwr�r
r
r
�getElementsByTagNameHszElement.getElementsByTagNamecCst|||t��Sr%�r�rwr�r
r
r
�getElementsByTagNameNSKs�zElement.getElementsByTagNameNScCsd|jt|�fS)Nz<DOM Element: %s at %#x>)r�r�rr
r
r
rOszElement.__repr__rcCs�|�|d|j�|��}|��D],}|�d|�t|||j�|�d�q$|jr�|�d�t|j�dkr�|jdjt	j
t	jfkr�|jd�|ddd�n4|�|�|jD]}|�|||||�q�|�|�|�d|j|f�n|�d	|�dS)
Nr�z %s="r�r�r1rrz</%s>%sz/>%s)
r�r��_get_attributesr�r�r�r'r�rr	rOr�r)rr$r"�	addindentr#r�Za_namerHr
r
r
rRs*

��


zElement.writexmlcCs|��t|j|j|�Sr%)rr�r�r�rr
r
r
r!mszElement._get_attributescCs|jr
dSdSdSr�rrr
r
r
�
hasAttributesqszElement.hasAttributescCs|�|�}|�|�dSr%)r�setIdAttributeNode)rr��idAttrr
r
r
�setIdAttributeys
zElement.setIdAttributecCs|�||�}|�|�dSr%)rr$)rr~r�r%r
r
r
�setIdAttributeNS}szElement.setIdAttributeNScCsj|dks|�|j�stj���t|�dk	r4tj���|jsfd|_|jd7_|j	j
d7_
t|�dS)NTr1)rdr�r6r7r?�_get_containing_entref�NoModificationAllowedErrr�r�rXr�rA)rr%r
r
r
r$�s

zElement.setIdAttributeNode)rrr).r{r|r}r�r	rSrr�r�r�r�r�r�rOr�r�r5rr�rrarrQr
rrrrrr
ZsetAttributeNodeNSrrrZremoveAttributeNodeNSrrrr rrr!r#r&r'r$r
r
r
r
r�sT��
		
rr�z*NamedNodeMap of attributes on the element.z%Namespace-local name of this element.cCs8t|�|��||j|j<||j|j|jf<||_dSr%)rArr�r�r�r~r�r�)�elementr	r
r
r
r�s
rc@sfeZdZdZdZdZe�ZdZdZ	dd�Z
dd�Zdd	�Zd
d�Z
dd
�Zdd�Zdd�Zdd�ZdS)�	Childlessz�Mixin that makes childless-ness easy to implement and avoids
    the complexity of the Node methods that deal with children.
    r
NcCsdSr%r
rr
r
r
r,�szChildless._get_firstChildcCsdSr%r
rr
r
r
r/�szChildless._get_lastChildcCstj�|jd��dS)Nz nodes cannot have children�r6r7r8r�r�r
r
r
r<�s�zChildless.appendChildcCsdSrr
rr
r
r
r(�szChildless.hasChildNodescCstj�|jd��dS�Nz nodes do not have childrenr,�rrErFr
r
r
r4�s�zChildless.insertBeforecCstj�|jd��dSr-)r6r7r?r�rNr
r
r
r;�s�zChildless.removeChildcCsdSr%r
rr
r
r
rT�szChildless.normalizecCstj�|jd��dSr-r,�rrErKr
r
r
rL�s�zChildless.replaceChild)r{r|r}r�r�r�Z
EmptyNodeListr'r�r�r,r/r<r(r4r;rTrLr
r
r
r
r+�sr+c@s\eZdZejZdZdd�Zdd�Zdd�Z	e
ee	�Zdd	�Zd
d�Z
e
ee
�Zdd
d�ZdS)�ProcessingInstruction��targetrPcCs||_||_dSr%r1)rr2rPr
r
r
r��szProcessingInstruction.__init__cCs|jSr%�rPrr
r
r
�_get_nodeValue�sz$ProcessingInstruction._get_nodeValuecCs
||_dSr%r3r�r
r
r
�_set_nodeValue�sz$ProcessingInstruction._set_nodeValuecCs|jSr%�r2rr
r
r
�
_get_nodeName�sz#ProcessingInstruction._get_nodeNamecCs
||_dSr%r6r�r
r
r
�
_set_nodeName�sz#ProcessingInstruction._set_nodeNamercCs|�d||j|j|f�dS)Nz
%s<?%s %s?>%s)r�r2rP�rr$r"r"r#r
r
r
r�szProcessingInstruction.writexmlN)rrr)r{r|r}r	r�rr�r�r4r5r�r�r7r8r�rr
r
r
r
r0�s

r0c@sreZdZdZdd�Zdd�ZeZdd�Zdd	�Ze	ee�Z
Zd
d�Zdd
�Z
dd�Zdd�Zdd�Zdd�ZdS)�
CharacterData)�_datarXr:rDrCcCs,d|_|_d|_|_d|_t�|�dSr)rXr:rDrCr;r	r�rr
r
r
r��szCharacterData.__init__cCs
t|j�Sr%)r�rPrr
r
r
r��szCharacterData._get_lengthcCs|jSr%�r;rr
r
r
�	_get_data�szCharacterData._get_datacCs
||_dSr%r<�rrPr
r
r
�	_set_data�szCharacterData._set_datacCs6|j}t|�dkrd}nd}d|jj|dd�|fS)N�
z...rz<DOM %s node "%r%s">r)rPr�rr{)rrPZ	dotdotdotr
r
r
r�s
�zCharacterData.__repr__cCsT|dkrtj�d��|t|j�kr.tj�d��|dkrBtj�d��|j|||�S�Nr�offset cannot be negative�#offset cannot be beyond end of data�count cannot be negative�r6r7�IndexSizeErrr�rP�r�offset�countr
r
r
�
substringData�szCharacterData.substringDatacCs|j||_dSr%r3)r�argr
r
r
�
appendDataszCharacterData.appendDatacCsZ|dkrtj�d��|t|j�kr.tj�d��|rVd|jd|�||j|d�f|_dS)NrrBrC�%s%s%srE)rrHrKr
r
r
�
insertData	s�zCharacterData.insertDatacCsl|dkrtj�d��|t|j�kr.tj�d��|dkrBtj�d��|rh|jd|�|j||d�|_dSrArErGr
r
r
�
deleteDataszCharacterData.deleteDatacCsr|dkrtj�d��|t|j�kr.tj�d��|dkrBtj�d��|rnd|jd|�||j||d�f|_dS)NrrBrCrDrMrE)rrHrIrKr
r
r
�replaceDatas�zCharacterData.replaceDataN)r{r|r}r�r�r�r�r=r?r�rPr�rrJrLrNrOrPr
r
r
r
r:�s			
r:zLength of the string data.c@sHeZdZdZejZdZdZdd�Z	ddd�Z
d	d
�Zdd�Zd
d�Z
dS)r�r
z#textNcCs�|dks|t|j�kr"tj�d��|��}|j|d�|_|j|_|j}|jr~||jj	kr~|dkrp|j�
|�n|j�||�|jd|�|_|S)Nrzillegal offset value)r�rPr6r7rFrrXrCr:r'r<r4)rrHZnewText�nextr
r
r
�	splitText1szText.splitTextrcCst|d||j|f�dS)NrM)r�rPr9r
r
r
r@sz
Text.writexmlcCs�|jg}|j}|dk	rB|jtjtjfkrB|�d|j�|j}qqBq|j}|dk	rz|jtjtjfkrz|�|j�|j}qHqzqHd�	|�S)Nrr)
rPrDrr	rOr�rBrCrR�join)rrUr�r
r
r
�_get_wholeTextEszText._get_wholeTextcCs�|j}|j}|dk	r@|jtjtjfkr@|j}|�|�|}qq@q|j}|sT|�|�|dk	r�|jtjtjfkr�|j}|�|�|}qTq�qT|r�||_|SdSdSr%)	r:rDrr	rOr�r;rCrP)rZcontentr�r�rQr
r
r
�replaceWholeTextWs*


zText.replaceWholeTextcCsF|j��rdSt|�}|dkr"dS|j�|�}|dkr:dS|��SdSr)rP�strip�_get_containing_elementrXr��isElementContent)rr�r�r
r
r
�!_get_isWhitespaceInElementContentss
z&Text._get_isWhitespaceInElementContent)rrr)r{r|r}r�r	rOrr�r�rRrrTrUrYr
r
r
r
r�*s
r�ZisWhitespaceInElementContentzKTrue iff this text node contains only whitespace and is in element content.Z	wholeTextz.The text of all logically-adjacent text nodes.cCs*|j}|dk	r&|jtjkr|S|j}qdSr%)r:rr	rS�rHrGr
r
r
rW�srWcCs*|j}|dk	r&|jtjkr|S|j}qdSr%)r:rr	r�rZr
r
r
r(�sr(c@s(eZdZejZdZdd�Zddd�ZdS)	�Commentz#commentcCst�|�||_dSr%)r:r�r;r>r
r
r
r��s
zComment.__init__rcCs,d|jkrtd��|�d||j|f�dS)Nz--z%'--' is not allowed in a comment nodez
%s<!--%s-->%s)rPr>r�r9r
r
r
r�s
zComment.writexmlN)rrr)	r{r|r}r	r�rr�r�rr
r
r
r
r[�sr[c@s$eZdZdZejZdZddd�ZdS)�CDATASectionr
z#cdata-sectionrcCs,|j�d�dkrtd��|�d|j�dS)Nz]]>rz$']]>' not allowed in a CDATA sectionz<![CDATA[%s]]>)rP�findr>r�r9r
r
r
r�szCDATASection.writexmlN)rrr)	r{r|r}r�r	r�rr�rr
r
r
r
r\�sr\c@szeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)�ReadOnlySequentialNamedNodeMap��_seqr
cCs
||_dSr%r_)r�seqr
r
r
r��sz'ReadOnlySequentialNamedNodeMap.__init__cCs
t|j�Sr%�r�r`rr
r
r
r��sz&ReadOnlySequentialNamedNodeMap.__len__cCs
t|j�Sr%rbrr
r
r
r��sz*ReadOnlySequentialNamedNodeMap._get_lengthcCs"|jD]}|j|kr|SqdSr%)r`r�r�r
r
r
r��s

z+ReadOnlySequentialNamedNodeMap.getNamedItemcCs,|jD] }|j|kr|j|kr|SqdSr%)r`r~r�r�r
r
r
r��s
z-ReadOnlySequentialNamedNodeMap.getNamedItemNScCs4t|t�r|j|�}n
|�|�}|dkr0t|��|Sr%)r�r3r�r�ri)rZ
name_or_tuplerHr
r
r
r��s

z*ReadOnlySequentialNamedNodeMap.__getitem__cCs4|dkrdSz|j|WStk
r.YdSXdSr+)r`r�r�r
r
r
r��sz#ReadOnlySequentialNamedNodeMap.itemcCstj�d��dS�Nz"NamedNodeMap instance is read-only�r6r7r)r�r
r
r
r��s�z.ReadOnlySequentialNamedNodeMap.removeNamedItemcCstj�d��dSrcrdr�r
r
r
r��s�z0ReadOnlySequentialNamedNodeMap.removeNamedItemNScCstj�d��dSrcrdr�r
r
r
r��s�z+ReadOnlySequentialNamedNodeMap.setNamedItemcCstj�d��dSrcrdr�r
r
r
r��s�z-ReadOnlySequentialNamedNodeMap.setNamedItemNScCs|jgSr%r_rr
r
r
r��sz+ReadOnlySequentialNamedNodeMap.__getstate__cCs|d|_dSr+r_r�r
r
r
r��sz+ReadOnlySequentialNamedNodeMap.__setstate__N)r
)r{r|r}r�r�r�r�r�r�r�r�r�r�r�r�r�r�r
r
r
r
r^�s
	r^z&Number of entries in the NamedNodeMap.c@s,eZdZdZdZdd�Zdd�Zdd�Zd	S)
�
Identifiedz@Mix-in class that supports the publicId and systemId attributes.��publicId�systemIdcCs||_||_dSr%rf)rrgrhr
r
r
�_identified_mixin_init�sz!Identified._identified_mixin_initcCs|jSr%)rgrr
r
r
�
_get_publicId�szIdentified._get_publicIdcCs|jSr%)rhrr
r
r
�
_get_systemId�szIdentified._get_systemIdN)r{r|r}r�r�rirjrkr
r
r
r
re�s
rec@sHeZdZejZdZdZdZdZ	dZ
dd�Zdd�Zdd�Z
dd	d
�ZdS)�DocumentTypeNcCs2t�|_t�|_|r&t|�\}}||_|j|_dSr%)r^�entities�	notationsrr�r�)rrrrr
r
r
r�
szDocumentType.__init__cCs|jSr%)�internalSubsetrr
r
r
�_get_internalSubsetsz DocumentType._get_internalSubsetcCs�|jdkr�td�}|j|_|j|_tjjj}|r�g|j_	g|j
_	|j
j	D]2}t|j|j|j
�}|j
j	�|�|�|||�qH|jj	D]N}t|j|j|j
|j�}|j|_|j|_|j|_|jj	�|�|�|||�q�|�|||�|SdSdSr%)rXrlr�r�r6r7�UserDataHandler�NODE_CLONEDrmr`rn�NotationrgrhrRrv�Entity�notationName�actualEncodingrr_)rrY�clonertr��notation�e�entityr
r
r
rZs0

�zDocumentType.cloneNodercCs�|�d�|�|j�|jr8|�d||j||jf�n|jrR|�d||jf�|jdk	r||�d�|�|j�|�d�|�d|�dS)Nz
<!DOCTYPE z%s  PUBLIC '%s'%s  '%s'z%s  SYSTEM '%s'z [�]r�)r�r�rgrhror9r
r
r
r0s
�


zDocumentType.writexml)rrr)r{r|r}r	�DOCUMENT_TYPE_NODErr�r�rgrhror�rprZrr
r
r
r
rlsrlc@sfeZdZdZejZdZdZdZ	dZ
dd�Zdd�Zdd�Z
dd	�Zd
d�Zdd
�Zdd�Zdd�ZdS)rtNcCs$||_||_t�|_|�||�dSr%)r�rurwr'ri)rr�rgrhrxr
r
r
r�GszEntity.__init__cCs|jSr%�rvrr
r
r
�_get_actualEncodingMszEntity._get_actualEncodingcCs|jSr%�rrr
r
r
�
_get_encodingPszEntity._get_encodingcCs|jSr%�r_rr
r
r
�_get_versionSszEntity._get_versioncCstj�d��dS)Nz(cannot append children to an entity node�r6r7r8)rrEr
r
r
r<Vs�zEntity.appendChildcCstj�d��dS)Nz+cannot insert children below an entity noder�r.r
r
r
r4Zs�zEntity.insertBeforecCstj�d��dS)Nz*cannot remove children from an entity noder�rNr
r
r
r;^s�zEntity.removeChildcCstj�d��dS)Nz)cannot replace children of an entity noder�r/r
r
r
rLbs�zEntity.replaceChild)r{r|r}r�r	ZENTITY_NODErr�rvrr_r�r~r�r�r<r4r;rLr
r
r
r
rt>srtc@seZdZejZdZdd�ZdS)rsNcCs||_|�||�dSr%)r�ri)rr�rgrhr
r
r
r�jszNotation.__init__)r{r|r}r	r�rr�r�r
r
r
r
rsfsrsc@sHeZdZddddddddgZd	d
�Zdd�Zd
d�Zdd�Zdd�ZdS)�DOMImplementation)�core�1.0)r��2.0)r�N)r6r�)r6r�)r6N)�ls-loadz3.0)r�NcCs|dkrd}|��|f|jkSr)�lower�	_featuresr]r
r
r
r\zszDOMImplementation.hasFeaturec	Cs�|r|jdk	rtj�d��|��}|dko8|dko8|dk}|sP|rPtj�d��|r�t|�\}}|dkr||dkr|tj�d��|r�|s�tj�d��|�||�}|r�|�	|�|�	|�|r�||_|_
||_||_|S)Nz(doctype object owned by another DOM treezElement with no namer6z$http://www.w3.org/XML/1998/namespacezillegal use of 'xml' prefixz(illegal use of prefix without namespaces)
r:r6r7�WrongDocumentErr�_create_documentZInvalidCharacterErrrr��createElementNSr<rX�doctyper[)	rr~rr�r�Zadd_root_elementrrr*r
r
r
�createDocuments>���
��

z DOMImplementation.createDocumentcCst|�}||_||_|Sr%)rlrgrh)rrrgrhr�r
r
r
�createDocumentType�sz$DOMImplementation.createDocumentTypecCs|�|d�r|SdSdSr%)r\rer
r
r
rf�szDOMImplementation.getInterfacecCst�Sr%)�Documentrr
r
r
r��sz"DOMImplementation._create_documentN)	r{r|r}r�r\r�r�rfr�r
r
r
r
r�os�
-r�c@s\eZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dS)�ElementInfoz�Object that represents content-model information for an element.

    This implementation is not expected to be used in practice; DOM
    builders should provide implementations which do the right thing
    using information available to it.

    rcCs
||_dSr%rr�r
r
r
r��szElementInfo.__init__cCstSr%�r��rZanamer
r
r
r��szElementInfo.getAttributeTypecCstSr%r�r�r
r
r
r��szElementInfo.getAttributeTypeNScCsdSrr
rr
r
r
rX�szElementInfo.isElementContentcCsdS)zQReturns true iff this element is declared to have an EMPTY
        content model.Fr
rr
r
r
�isEmpty�szElementInfo.isEmptycCsdS)z7Returns true iff the named attribute is a DTD-style ID.Fr
r�r
r
r
r��szElementInfo.isIdcCsdS)z<Returns true iff the identified attribute is a DTD-style ID.Fr
r�r
r
r
r��szElementInfo.isIdNScCs|jSr%rrr
r
r
r��szElementInfo.__getstate__cCs
||_dSr%rr�r
r
r
r��szElementInfo.__setstate__N)r{r|r}r�r�r�r�r�rXr�r�r�r�r�r
r
r
r
r��sr�cCs>|jtjkr|j��d|_nt|�r:|jj��d|j_dSr%)rr	r�	_id_cache�clear�_id_search_stackr�rXr�r
r
r
rA�s
rAc@sreZdZdZejejejejfZ	e
�ZejZ
dZdZdZdZdZZdZdZdZdZdZdZdZdZdd�Zdd	�Zd
d�Zdd
�Zdd�Z dd�Z!dd�Z"dd�Z#dd�Z$dd�Z%dd�Z&dd�Z'dd�Z(d d!�Z)d"d#�Z*d$d%�Z+d&d'�Z,d(d)�Z-d*d+�Z.d,d-�Z/d.d/�Z0d0d1�Z1d2d3�Z2d4d5�Z3d6d7�Z4d8d9�Z5d:d;�Z6d<d=�Z7d>d?�Z8d@dA�Z9dBdC�Z:dIdEdF�Z;dGdH�Z<dS)Jr�)�
_elem_infor�r�r'r�z	#documentNFrcCs$d|_t�|_i|_i|_d|_dSr%)r�rwr'r�r�r�rr
r
r
r�s
zDocument.__init__cCs&|jr|j|jf}n|j}|j�|�Sr%)r~r�r�r�r�)rr*rkr
r
r
r�szDocument._get_elem_infocCs|jSr%r}rr
r
r
r~szDocument._get_actualEncodingcCs|jSr%)r�rr
r
r
�_get_doctypeszDocument._get_doctypecCs|jSr%)�documentURIrr
r
r
�_get_documentURI!szDocument._get_documentURIcCs|jSr%rrr
r
r
r�$szDocument._get_encodingcCs|jSr%)�errorHandlerrr
r
r
�_get_errorHandler'szDocument._get_errorHandlercCs|jSr%)�
standalonerr
r
r
�_get_standalone*szDocument._get_standalonecCs|jSr%)�strictErrorCheckingrr
r
r
�_get_strictErrorChecking-sz!Document._get_strictErrorCheckingcCs|jSr%r�rr
r
r
r�0szDocument._get_versioncCsj|j|jkr(tj�dt|�t|�f��|jdk	r>|j�|�|jtj	kr^|�
�r^tj�d��t�||�S)Nr0z two document elements disallowed)rr5r6r7r8r9r:r;r	rS�_get_documentElementr<r�r
r
r
r<3s�
��zDocument.appendChildcCsVz|j�|�Wntk
r.tj���YnXd|_|_d|_|j	|krRd|_	|Sr%)
r'rMr>r6r7r?rCrDr:�documentElementrNr
r
r
r;Cs
zDocument.removeChildcCs$|jD]}|jtjkr|SqdSr%)r'rr	rSr�r
r
r
r�Os
zDocument._get_documentElementcCs(|jdk	r|j��d|_t�|�dSr%)r�rQr	rr
r
r
rQTs

zDocument.unlinkcCs�|sdS|j�ddd�}|j|_|j|_|j|_|jD]B}t|||�}|j�|�|jt	j
kr`n|jt	jkrr||_||_
q6|�tjjj||�|Sr%)r[r�rr�r_r'rWrRrr	rr|r�r:rvr6r7rqrr)rrYrwr�Z
childcloner
r
r
rZZs&
�zDocument.cloneNodecCst�}||_|Sr%)r�rX)rror
r
r
�createDocumentFragmentoszDocument.createDocumentFragmentcCst|�}||_|Sr%)rrX)rr�ryr
r
r
�
createElementtszDocument.createElementcCs(t|t�std��t�}||_||_|S�Nznode contents must be a string)r�r�r�r�rPrX)rrP�tr
r
r
�createTextNodeys
zDocument.createTextNodecCs(t|t�std��t�}||_||_|Sr�)r�r�r�r\rPrX�rrPrGr
r
r
�createCDATASection�s
zDocument.createCDATASectioncCst|�}||_|Sr%)r[rXr�r
r
r
�
createComment�szDocument.createCommentcCst||�}||_|Sr%)r0rX)rr2rP�pr
r
r
�createProcessingInstruction�s
z$Document.createProcessingInstructioncCst|�}||_d|_|Sr)r�rXr�)rr��ar
r
r
�createAttribute�szDocument.createAttributecCs"t|�\}}t|||�}||_|Sr%)rrrX)rr~rrr�ryr
r
r
r��szDocument.createElementNScCs*t|�\}}t||||�}||_d|_|Sr)rr�rXr�)rr~rrr�r�r
r
r
�createAttributeNS�s
zDocument.createAttributeNScCst||||�}||_|Sr%)rtrX)rr�rgrhruryr
r
r
�_create_entity�szDocument._create_entitycCst|||�}||_|Sr%)rsrX)rr�rgrhr�r
r
r
�_create_notation�szDocument._create_notationcCs�||jkr|j|S|js$|js$dS|j}|dkrB|jg}||_n|sJdSd}|�r�|��}|�dd�|jD��|�|�}|�rB|j	�
�D]�}|jr�|�|j|j
�r�||j|j<|j|kr�|}n|js��q�q�|�|j��r
||j|j<|j|kr�|}n|j�s>�q�q�|jr�||j|j<|j|k�r.|}q�|jdkr��q�q�n>|j�r�|j	�
�D]*}|j�rT||j|j<|j|k�rT|}�qT|dk	rN�q�qN|S)NcSsg|]}|jtkr|�qSr
)rr@)�.0rVr
r
r
�
<listcomp>�s
�z+Document.getElementById.<locals>.<listcomp>r1)r�r�r�r�r��pop�extendr'r�r�r�r~r�r�r�r�r�r�r�)rr��stack�resultrHr�r	r
r
r
�getElementById�sZ






zDocument.getElementByIdcCst||t��Sr%rr�r
r
r
r�szDocument.getElementsByTagNamecCst|||t��Sr%rr�r
r
r
r �s�zDocument.getElementsByTagNameNScCs|j�||�Sr%)r[r\r]r
r
r
r`�szDocument.isSupportedcCs>|jtjkrtj�d��n|jtjkr2tj�d��t|||�S)Nzcannot import document nodesz!cannot import document type nodes)rr	rr6r7�NotSupportedErrr|rW)rrHrYr
r
r
�
importNode�s
zDocument.importNodercCsJ|dkr|�d|�n|�d||f�|jD]}|�||||�q0dS)Nz<?xml version="1.0" ?>z%<?xml version="1.0" encoding="%s"?>%s)r�r'r)rr$r"r"r#rrHr
r
r
r�s�
zDocument.writexmlcCsJ|j|k	r tj�d||jf��|jtjtjfkr>tj�d��|t	kr�d|kr�|�
dd�\}}|dkr�|tjjkr�tj�d��q�|dkr�|tjjkr�|jtjkr�tj�d��d}|}nd}d}|jtjkr�|j
}|dk	r�|j}|�|�nd}||_||_||_||_|jtjk�r||_n*||_|dk	�rF|�|�|�rF|�|�|S)Nz?cannot rename nodes from other documents;
expected %s,
found %sz8renameNode() only applies to element and attribute nodesr�r1r�zillegal use of 'xmlns' prefixz$illegal use of the 'xmlns' attribute)rXr6r7r�rr	rSr�r�rr�rr�r�r�rrr�r~r�r�r�r
r$)rr�r~r�rr�r*Zis_idr
r
r
�
renameNode	sb
���
��
�
��


zDocument.renameNode)rrrN)=r{r|r}r�r	rSr�r�r|r5r�r[rrr�r�r�r:rDrCrvrr�r_r�r�r�r�r�r�r~r�r�r�r�r�r�r�r<r;r�rQrZr�r�r�r�r�r�r�r�r�r�r�r�rr r`r�rr�r
r
r
r
r��sj�	
:
r�r�z#Top-level element of this document.c
Cs�|j�|�rtjjj}n
tjjj}|jtj	kr�|�
|j|j�}|j
��D]0}|�|j|j|j�|�|j|j�}|j|_qH|r�|jD]}t|||�}|�|�q��n|jtjkr�|��}|r�|jD]}t|||�}|�|�qn�|jtjkr�|�|j�}�n�|jtjk�r|�|j�}�n�|jtjk�r>|�|j |j�}�nj|jtj!k�r\|�"|j�}�nL|jtj#k�r�|�$|j|j�}d|_|j|_�n|jtj%k�r�tjjj}|j&�'|j(|j)|j*�}||_|�r�g|j+_,g|j-_,|j-j,D]F}	t.|	j|	j)|	j*�}
||
_|j-j,�/|
�t0|	d��r�|	�1||	|
��q�|j+j,D]b}t2|j|j)|j*|j3�}|j4|_4|j5|_5|j6|_6||_|j+j,�/|�t0|d��r.|�1|||��q.ntj�7dt8|���t0|d��r�|�1|||�|S)zo
    Clone a node and give it the new owner document.
    Called by Node.cloneNode and Document.importNode
    TrvzCannot clone node %s)9rXrdr6r7rqrrZ
NODE_IMPORTEDrr	rSr�r~r�r�r�rr�rr�r�r'rWr<r2r�rOr�rPr�r�r�r�r2r�r�r�r�r|r[r�r�rgrhrmr`rnrsrRrqrvrtrurvrr_r�r9)
rHrYZnewOwnerDocumentrtrwr	r�rVrGr�rxryrzr
r
r
rWBs�
�


��
��rWcCs,|�dd�}t|�dkr|Sd|dfSdS)Nr�r1�r)r�r�)rZfieldsr
r
r
r�srcCs,|||�}|��\}}|�|�|��|Sr%)ZgetEventZ
expandNoder�)�func�args�kwargsZeventsZtoktypeZrootNoder
r
r
�_do_pulldom_parse�s


r�cCsH|dkr"|s"ddlm}|�|�Sddlm}t|j|f||d��SdS)z3Parse a file into a DOM by filename or file object.Nr��expatbuilder��pulldom)�parser�bufsize)�xml.domr��parser�r�)�filer�r�r�r�r
r
r
r��s

�r�cCsB|dkrddlm}|�|�Sddlm}t|j|fd|i�SdS)z&Parse a file into a DOM from a string.Nrr�r�r�)r�r��parseStringr�r�)�stringr�r�r�r
r
r
r��s

�r�cCs@|r:t|t�rt�|�}|D]\}}tj�||�sdSqtjSr%)r�r�rZ_parse_feature_stringr�r[r\)Zfeatures�f�vr
r
r
�getDOMImplementation�s

r�)NN)N)N)7r�rr�r6rrrrZxml.dom.minicompatZxml.dom.xmlbuilderrrr7r	rSr�r@ZdefpropertyrJr�r�r�r�r�r��objectr�Z
AttributeListr�r�rrr+r0r:r�rWr(r[r\r^rerlrtrsr�r�rAr�rWrr�r�r�r�r
r
r
r
�<module>s��v
	y$�
x��)GU��	>�<(	O*P�R



xml/dom/__pycache__/domreg.cpython-38.opt-2.pyc000064400000003162151153537540015213 0ustar00U

e5d{
�@s<ddlZddd�ZiZdd�Zdd�Zdd
d�Zdd
�ZdS)�Nzxml.dom.minidomzxml.dom.DOMImplementation)ZminidomZ4DOMcCs|t|<dS)N)�
registered)�name�factory�r�&/usr/lib64/python3.8/xml/dom/domreg.py�registerDOMImplementations	rcCs$|D]\}}|�||�sdSqdS)Nr�)Z
hasFeature)�dom�features�f�vrrr�_good_enough sr
rc	Cs�ddl}d}t�|�}|r2t|iidg�}|��S|r@t|�Stjjsbd|j	krbt|j	dd�St
|t�rtt|�}t�
�D]}|�}t||�r||Sq|t��D]>}zt|d�}Wntk
r�Yq�YnXt||�r�|Sq�td��dS)Nr�getDOMImplementationZ
PYTHON_DOM)rz$no suitable DOM implementation found)�os�well_known_implementations�get�
__import__rr�sys�flags�ignore_environment�environ�
isinstance�str�_parse_feature_string�valuesr
�keys�	Exception�ImportError)rr
rZcreator�modr	rrrr's0








rcCs�g}|��}d}t|�}||kr�||}|ddkrBtd|f��|d}d}||krv||}|ddkrv|d}|}|�||f�qt|�S)Nr�
0123456789zbad feature name: %rr)�split�len�
ValueError�append�tuple)�sr
�parts�iZlengthZfeature�versionrrrrrRs"r)Nr)rrrrr
rrrrrr�<module>	s�
+xml/dom/__pycache__/expatbuilder.cpython-38.opt-2.pyc000064400000057213151153537540016434 0ustar00U

e5d���@sddlmZmZmZddlmZmZmZddlmZddl	m
Z
mZddlm
Z
ejZejZejZejjZejjZejjZejjZe��Ze�dd�e�dd�e�dd	�e�dd
�e�dd�e�dd�e�dd
�e�dd�e�dd�d�	ZGdd�de�Zdd�Zdd�ZGdd�d�ZeeefZGdd�de�Z Gdd�de�Z!Gdd�de!�Z"Gdd �d e!�Z#d!Z$d"e$Z%Gd#d$�d$e�Z&Gd%d&�d&�Z'Gd'd(�d(e'e�Z(Gd)d*�d*e'e&�Z)Gd+d,�d,e*�Z+Gd-d.�d.e�Z,d:d0d1�Z-d;d2d3�Z.d<d4d5�Z/d=d6d7�Z0d8d9�Z1dS)>�)�
xmlbuilder�minidom�Node)�EMPTY_NAMESPACE�EMPTY_PREFIX�XMLNS_NAMESPACE)�expat)�
_append_child�_set_attribute_node)�
NodeFilterNZcdata�enumeration�entity�entities�idZidrefZidrefsZnmtokenZnmtokens)	ZCDATA�ENUMZENTITYZENTITIES�IDZIDREFZIDREFSZNMTOKENZNMTOKENSc@sZeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)�ElementInfo��
_attr_info�_model�tagNameNcCs||_g|_||_dS�N)rrr)�selfr�model�r�,/usr/lib64/python3.8/xml/dom/expatbuilder.py�__init__?szElementInfo.__init__cCs|j|j|jfSrr�rrrr�__getstate__DszElementInfo.__getstate__cCs|\|_|_|_dSrr)r�staterrr�__setstate__GszElementInfo.__setstate__cCsN|jD]@}|d|kr|d}|ddkr6tdSt|dSqtjS)N����r�(r)r�
_typeinfo_mapr�_no_type)r�aname�info�trrr�getAttributeTypeJs
zElementInfo.getAttributeTypecCstjSr)rr%)rZnamespaceURIZ	localNamerrr�getAttributeTypeNSTszElementInfo.getAttributeTypeNScCs,|jr$|jd}|tjjtjjfkSdSdS�NrF)rrrZ
XML_CTYPE_ANYZXML_CTYPE_MIXED)r�typerrr�isElementContentWs
�zElementInfo.isElementContentcCs |jr|jdtjjkSdSdSr+)rrrZXML_CTYPE_EMPTYrrrr�isEmpty_szElementInfo.isEmptycCs,|jD] }|d|kr|ddkSqdS)Nr!r"rF)r)rr&r'rrr�isIdes
zElementInfo.isIdcCs|�||f�Sr)r/)rZeuriZenameZaurir&rrr�isIdNSkszElementInfo.isIdNS)N)
�__name__�
__module__�__qualname__�	__slots__rrr r)r*r-r.r/r0rrrrr<s

rcCs|�||�Sr)�_intern_setdefault)�builder�srrr�_internosr8cCs�|�d�}|j}t|�dkrR|\}}}|||�}d||f}|||�}|||�}n4t|�dkrz|\}}t}|||�}}ntd|��|||�|||fS)N� �z%s:%s�z4Unsupported syntax: spaces in URIs not supported: %r)�splitr5�lenr�
ValueError)r6�name�parts�intern�uri�	localname�prefix�qnamerrr�_parse_ns_namers



rFc@s�eZdZd:dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�ZdS);�ExpatBuilderNcCsP|dkrt��}||_|jjdk	r2t|jj�|_nd|_t|_d|_|�	�dSr)
rZOptions�_options�filter�FilterVisibilityController�_filterr�_finish_start_element�_parser�reset)r�optionsrrrr�szExpatBuilder.__init__cCst��Sr)r�ParserCreaterrrr�createParser�szExpatBuilder.createParsercCsF|js@|��|_|jjj|_d|j_d|j_d|j_|�|j�|jS�NT)	rMrQrA�
setdefaultr5Zbuffer_textZordered_attributesZspecified_attributes�installrrrr�	getParser�s
zExpatBuilder.getParsercCs,t�tdd�|_|j|_|jj|_d|_dS�NF)�theDOMImplementationZcreateDocumentr�document�curNode�
_elem_info�_cdatarrrrrN�s�
zExpatBuilder.resetcCs�|j|_|j|_|j|_|j|_|jj	r0|j
|_|j|_
|jjrH|j|_|jjrj|j|_|j|_|j|_n|j|_|j|_|j|_|j|_|j|_ dSr)!�start_doctype_decl_handler�StartDoctypeDeclHandler�first_element_handler�StartElementHandler�end_element_handler�EndElementHandler�
pi_handler�ProcessingInstructionHandlerrHr�entity_decl_handler�EntityDeclHandler�notation_decl_handler�NotationDeclHandler�comments�comment_handler�CommentHandlerZcdata_sections�start_cdata_section_handler�StartCdataSectionHandler�end_cdata_section_handler�EndCdataSectionHandler�character_data_handler_cdata�CharacterDataHandler�character_data_handler�external_entity_ref_handler�ExternalEntityRefHandler�xml_decl_handlerZXmlDeclHandler�element_decl_handlerZElementDeclHandler�attlist_decl_handlerZAttlistDeclHandler�r�parserrrrrT�s$
zExpatBuilder.installcCs�|��}d}zH|�d�}|sqF|�|d�|r@|jjr@|�|�d}q|�dd�Wntk
rhYnX|j}|��d|_|S)NTi@rF�)	rU�read�ParserX�documentElement�
_setup_subset�ParseEscaperNrM)r�filerxZfirst_buffer�buffer�docrrr�	parseFile�s"

zExpatBuilder.parseFilecCsP|��}z|�|d�|�|�Wntk
r6YnX|j}|��d|_|SrR)rUr{r}r~rXrNrM)r�stringrxr�rrr�parseString�szExpatBuilder.parseStringcCs.|jjr*t�}|�|�|��}||jj_dSr)rX�doctype�InternalSubsetExtractorr��	getSubset�internalSubset)rr�Z	extractor�subsetrrrr}�s

zExpatBuilder._setup_subsetcCs�|jj�|||�}|j|_t|j|�||j_|jrj|j�|�tkrjd|j_|jj	d=d}d|j
_d|j
_|r�|dk	r�g|j
_g|j_d|j
_d|j
_|j|j
_dS�N���)rX�implementationZcreateDocumentType�
ownerDocumentr	r�rK�
acceptNode�
FILTER_REJECT�
childNodesrMrergr�_seq�	notationsrjrc�end_doctype_decl_handler�EndDoctypeDeclHandler)rZdoctypeName�systemId�publicId�has_internal_subsetr�rrrr\�s*�
z'ExpatBuilder.start_doctype_decl_handlercCs2|jjr|j|j_|j|j_|js.|js.t	|_
dSr)rHrhrirMrjrbrcrZrKr�_finish_end_elementrrrrr�s


z%ExpatBuilder.end_doctype_decl_handlercCs@|j�||�}t|j|�|jr<|j�|�tkr<|j�|�dSr)rXZcreateProcessingInstructionr	rYrKr�r��removeChild)r�target�data�noderrrrbszExpatBuilder.pi_handlercCs�|jj}|jrH|jr4|djtkr4|d�|�dS|j�|�}d|_nD|rv|djt	krv|d}|j
|}||_
dSt��}||_
|j|_
t|j|�dS)Nr�T)rYr�r[�_cdata_continue�nodeType�CDATA_SECTION_NODEZ
appendDatarXZcreateCDATASection�	TEXT_NODEr�r�Textr�r	)rr�r�r��valuerrrros$�
z)ExpatBuilder.character_data_handler_cdatacCs^|jj}|r2|djtkr2|d}|j||_dSt��}|j||_|j|_t	|j|�dSr�)
rYr�r�r�r�rr�rXr�r	)rr�r�r�rrrrq&sz#ExpatBuilder.character_data_handlerc
Cs�|rdS|jjsdS|j�||||�}|dk	rF|j�|�}	|j�|	�|jjjj�|�|j	r||j	�
|�tkr||jjjjd=dSr�)rHrrXZ_create_entityZcreateTextNoder��appendr�r�rKr�r�)
rZ
entityNameZis_parameter_entityr��baser�r��notationNamer��childrrrrd1s
�z ExpatBuilder.entity_decl_handlercCsJ|j�|||�}|jjjj�|�|jrF|j�|�tkrF|jjjjd=dSr�)	rXZ_create_notationr�r�r�r�rKr��
FILTER_ACCEPT)rr�r�r�r�r�rrrrfCsz"ExpatBuilder.notation_decl_handlercCs>|j�|�}t|j|�|jr:|j�|�tkr:|j�|�dSr)rXZ
createCommentr	rYrKr�r�r�)rr�r�rrrriIszExpatBuilder.comment_handlercCsd|_d|_dS)NTF�r[r�rrrrrkOsz(ExpatBuilder.start_cdata_section_handlercCsd|_d|_dSrVr�rrrrrmSsz&ExpatBuilder.end_cdata_section_handlercCsdS�Nr!r)r�contextr�r�r�rrrrrWsz(ExpatBuilder.external_entity_ref_handlercCs2|jdkr|jst|_|j|��_|�||�dSr)rKrZrr��start_element_handlerrUr_)rr?�
attributesrrrr^Zsz"ExpatBuilder.first_element_handlercCs�|j�|�}t|j|�||_|rptdt|�d�D]<}t�||tdt	�}||d}||_
|j|_t||�q2||jj
k	r�|�|�dS)Nrr;r!)rXZ
createElementr	rY�ranger=r�Attrrrr�r�r
r|rL)rr?r�r��i�ar�rrrr�`s�z"ExpatBuilder.start_element_handlercCsj|jrf||jjkrdS|j�|�}|tkr4t|�n|tkrFt|�ndS|j|_	|j�
|�|��dSr)rKrXr|�startContainerr��Rejecter�FILTER_SKIP�Skipper�
parentNoderYr��unlink)rr�ZfiltrrrrLqs

z"ExpatBuilder._finish_start_elementcCs|j}|j|_|�|�dSr)rYr�r�)rr?rYrrrr`�sz ExpatBuilder.end_element_handlercCs\|j�|j�}|r|�||�|jrX||jjkr4dS|j�|�tkrX|j	�
|�|��dSr)rZ�getr�_handle_white_text_nodesrKrXr|r�r�rYr�r�)rrYr'rrrr��sz ExpatBuilder._finish_end_elementcCsZ|jjs|��sdSg}|jD]"}|jtkr|j��s|�|�q|D]}|�	|�qFdSr)
rHZwhitespace_in_element_contentr-r�r�r�r��stripr�r�)rr�r'�Lr�rrrr��s�
z%ExpatBuilder._handle_white_text_nodescCs0|j�|�}|dkr&t||�|j|<n||_dSr)rZr�rr)rr?rr'rrrru�sz!ExpatBuilder.element_decl_handlerc
CsF|j�|�}|dkr&t|�}||j|<|j�d|dd|d||g�dS�Nr)rZr�rrr�)r�elemr?r,�defaultZrequiredr'rrrrv�s
�z!ExpatBuilder.attlist_decl_handlercCs2||j_||j_|dkr.|r&d|j_nd|j_dS)NrTF)rX�version�encoding�
standalone)rr�r�r�rrrrt�s
zExpatBuilder.xml_decl_handler)N)r1r2r3rrQrUrNrTr�r�r}r\r�rbrorqrdrfrirkrmrrr^r�rLr`r�r�rurvrtrrrrrG�s8

rGc@s�eZdZdZdd�Zdd�Zdd�Zeje	j
eje	jej
e	jeje	jeje	jeje	jeje	jeje	jeje	jeje	jeje	jeje	j iZ!dS)	rJ�rIcCs
||_dSrr�)rrIrrrr�sz#FilterVisibilityController.__init__cCsT|j|j}|jj|@rL|j�|�}|tkr0t�|tkrHtdt	|���|St
SdS)Nz)startContainer() returned illegal value: )�_nodetype_maskr�rI�
whatToShowr��FILTER_INTERRUPTr~�_ALLOWED_FILTER_RETURNSr>�reprr�)rr��mask�valrrrr��s
�z)FilterVisibilityController.startContainercCs�|j|j}|jj|@r||j�|�}|tkr0t�|tkr`|j}|j	dd�D]}|�
|�qLtS|tkrxt
dt|���|StSdS)Nz%acceptNode() returned illegal value: )r�r�rIr�r�r�r~r�r�r�ZappendChildr�r�r>r�r�)rr�r�r��parentr�rrrr��s 
�z%FilterVisibilityController.acceptNodeN)"r1r2r3r4rr�r�rZELEMENT_NODErZSHOW_ELEMENTZATTRIBUTE_NODEZSHOW_ATTRIBUTEr�Z	SHOW_TEXTr�ZSHOW_CDATA_SECTIONZENTITY_REFERENCE_NODEZSHOW_ENTITY_REFERENCEZENTITY_NODEZSHOW_ENTITYZPROCESSING_INSTRUCTION_NODEZSHOW_PROCESSING_INSTRUCTIONZCOMMENT_NODEZSHOW_COMMENT�
DOCUMENT_NODEZ
SHOW_DOCUMENTZDOCUMENT_TYPE_NODEZSHOW_DOCUMENT_TYPEZDOCUMENT_FRAGMENT_NODEZSHOW_DOCUMENT_FRAGMENTZ
NOTATION_NODEZ
SHOW_NOTATIONr�rrrrrJ�s:
�rJc@seZdZdZdd�ZdS)�FilterCrutch)�_builder�_level�
_old_start�_old_endcCs6d|_||_|j}|j|_|j|_|j|_|j|_dSr�)	r�r�rMr_r�rar�r�r`)rr6rxrrrrszFilterCrutch.__init__N)r1r2r3r4rrrrrr�sr�c@s(eZdZdZdd�Zdd�Zdd�ZdS)	r�rcCs,t�||�|j}dD]}t||d�qdS)N)rcrjrprlrnrs)r�rrM�setattr)rr6rxr?rrrrszRejecter.__init__cGs|jd|_dSr�)r��r�argsrrrr�szRejecter.start_element_handlercGs@|jdkr0|jj}|j�|�|j|_|j|_n|jd|_dS�Nrr!)r�r�rMrTr�r_r�ra)rr�rxrrrr` s

zRejecter.end_element_handlerN)r1r2r3r4rr�r`rrrrr�sr�c@s eZdZdZdd�Zdd�ZdS)r�rcGs.|jj}|j|�|jj|k	r*|jd|_dSr�)r�rYr�r�)rr�r�rrrr�-s
zSkipper.start_element_handlercGsD|jdkr*|j|jj_|j|jj_d|_n|jd|_|j|�dSr�)r�r�r�rMr_r�rar�rrrr`3s
zSkipper.end_element_handlerN)r1r2r3r4r�r`rrrrr�*sr�z8http://xml.python.org/entities/fragment-builder/internalz�<!DOCTYPE wrapper
  %%s [
  <!ENTITY fragment-builder-internal
    SYSTEM "%s">
%%s
]>
<wrapper %%s
>&fragment-builder-internal;</wrapper>c@sFeZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dS)�FragmentBuilderNcCs6|jtkr||_||_n|j|_||_t�||�dSr)r�r��originalDocumentr�r�rGr)rr�rOrrrr[s
zFragmentBuilder.__init__cCst�|�d|_dSr)rGrN�fragmentrrrrrNds
zFragmentBuilder.resetcCs|�|���Sr)r�rz�rrrrrr�hszFragmentBuilder.parseFilec	Cs�||_|��}|jj}d}|rV|jp*|��}|jrDd|j|jf}qZ|jrZd|j}nd}|��}t	|||f}z|�
|d�Wn|���YnX|j}|��|S)NryzPUBLIC "%s" "%s"zSYSTEM "%s"r!)
�_sourcerUr�r�r��_getDeclarationsr�r��_getNSattrs�_FRAGMENT_BUILDER_TEMPLATEr{rNr�)	rr�rxr�Zidentr�ZnsattrsrXr�rrrr�ms.
�zFragmentBuilder.parseStringcCs|jjj}d}|�rt|jj�D]R}|j�|�}|r<|d}d||jf}|jrdd||j|j	f}q d||j	f}q t|j
j�D]�}|j
�|�}|r�|d}d||jf}|jr�d||j|j	f}n&|j	r�d||j	f}nd	||jjf}|j
r�d
||j
f}|d}q�|S)Nryz
  z%s<!NOTATION %sz!%s PUBLIC "%s"
             "%s">z%s SYSTEM "%s">z
%s<!ENTITY %sz %s PUBLIC "%s"
             "%s"z%s SYSTEM "%s"z%s "%s"z%s NOTATION %s�>)r�r�r�r�r�Zlength�itemZnodeNamer�r�rZ
firstChildr�r�)rr�r7r�Znotationr
rrrr��s:
��
z FragmentBuilder._getDeclarationscCsdS)Nryrrrrrr��szFragmentBuilder._getNSattrscCs~|tkrh|j}|j}|j�|�}|j|_|j��|_|j|_z|�	|jd�W5||_||_d|_XdSt
�|||||�SdS)Nr!r�)�$_FRAGMENT_BUILDER_INTERNAL_SYSTEM_IDrXrYrMZExternalEntityParserCreater�ZcreateDocumentFragmentr�r�r{rGrr)rr�r�r�r�Zold_documentZold_cur_noderxrrrrr�s(�z+FragmentBuilder.external_entity_ref_handler)N)
r1r2r3rrNr�r�r�r�rrrrrrr�Rs	
	$r�c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�
NamespacescCs
g|_dSr)�_ns_ordered_prefixesrrrr�_initNamespaces�szNamespaces._initNamespacescCstjdd�}d|_|S)Nr9)Znamespace_separatorT)rrPZnamespace_prefixesrwrrrrQ�szNamespaces.createParsercCs t�||�|jjr|j|_dSr)rGrTrHZnamespace_declarations�start_namespace_decl_handlerZStartNamespaceDeclHandlerrwrrrrT�s�zNamespaces.installcCs|j�||f�dSr)r�r�)rrDrBrrrr��sz'Namespaces.start_namespace_decl_handlercCs�d|krt||�\}}}}nt}|}d}t}t�||||�}|j|_t|j|�||_|j	r�|j	D]P\}}|r�t�
t|d|�t|d�}nt�
dtdt�}||_
|j|_t||�qb|j	dd�=|�r~|��|j}	|j}
tdt|�d�D]�}||}||d}
d|k�rDt||�\}}}}t�
||||�}||	|<||
||f<n$t�
|t|t�}||	|<||
t|f<|j|_|
|_
||_q�dS)Nr9�xmlns:�xmlnsrr;r!)rFrrrZElementrXr�r	rYr�r�r8rr�r
Z_ensure_attributes�_attrs�_attrsNSr�r=ZownerElement)rr?r�rBrCrDrEr�r�r�r�r�r&r�rrrr��s^��
�z Namespaces.start_element_handlerN)	r1r2r3r�rQrTr�r�r`rrrrr��s5r�c@seZdZdd�ZdS)�ExpatBuilderNScCst�|�|��dSr)rGrNr�rrrrrN)s
zExpatBuilderNS.resetN)r1r2r3rNrrrrr�&sr�c@seZdZdd�Zdd�ZdS)�FragmentBuilderNScCst�|�|��dSr)r�rNr�rrrrrN1s
zFragmentBuilderNS.resetcCs�d}|j}g}|r~t|d�rv|j��D]N\}}||kr8q&|�|�|rPd|}nd}|rhd|||f}q&d||f}q&|j}q|S)Nry�_ns_prefix_urir�r�z%s
    %s='%s'z %s='%s')r��hasattrr��itemsr�r�)r�attrsr�r�rDrBZdeclnamerrrr�5s"


zFragmentBuilderNS._getNSattrsN)r1r2r3rNr�rrrrr�.sr�c@seZdZdS)r~N)r1r2r3rrrrr~Ssr~c@sHeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)r�NcCs|jSr)r�rrrrr�\sz!InternalSubsetExtractor.getSubsetcCs*zt�||�Wntk
r$YnXdSr)rGr�r~r�rrrr�`sz!InternalSubsetExtractor.parseFilecCs*zt�||�Wntk
r$YnXdSr)rGr�r~)rr�rrrr�fsz#InternalSubsetExtractor.parseStringcCs|j|_|j|_dSr)r\r]r�r_rwrrrrTlszInternalSubsetExtractor.installcCs0|r&|��}g|_|jj|_|j|_nt��dSr)rUr�r�ZDefaultHandlerr�r�r~)rr?r�r�r�rxrrrr\ps

z2InternalSubsetExtractor.start_doctype_decl_handlercCs,d�|j��dd��dd�}||_t��dS)Nryz
�
�
)�joinr��replacer~)rr7rrrr�zsz0InternalSubsetExtractor.end_doctype_decl_handlercCs
t��dSr)r~)rr?r�rrrr�sz-InternalSubsetExtractor.start_element_handler)r1r2r3r�r�r�r�rTr\r�r�rrrrr�Ws
r�Tc	CsL|rt�}nt�}t|t�r>t|d��}|�|�}W5QRXn
|�|�}|S�N�rb)r�rG�
isinstance�str�openr�)r�
namespacesr6�fp�resultrrr�parse�s

r�cCs|rt�}nt�}|�|�Sr)r�rGr�)r�r�r6rrrr��sr�c	CsP|rt|�}nt|�}t|t�rBt|d��}|�|�}W5QRXn
|�|�}|Sr�)r�r�r�r�r�r�)rr�r�r6r�r�rrr�
parseFragment�s


r�cCs |rt|�}nt|�}|�|�Sr)r�r�r�)r�r�r�r6rrr�parseFragmentString�s
r�cCs|jrt|�St|�SdSr)r�r�rG)rOrrr�makeBuilder�sr�)T)T)T)T)2Zxml.domrrrrrrZxml.parsersrZxml.dom.minidomr	r
Zxml.dom.NodeFilterrr�r�r�ZDOMBuilderFilterr�r�r�r�ZgetDOMImplementationrWZTypeInfor$�objectrr8rFrGr�rJr�r�r�r�r�r�r�r�r��	Exceptionr~r�r�r�r�r�r�rrrr�<module>sd








�3C
:�	��
u_%,



xml/dom/__pycache__/NodeFilter.cpython-38.opt-2.pyc000064400000001554151153537540015774 0ustar00U

e5d��@sGdd�d�ZdS)c@sTeZdZdZdZdZdZdZdZdZ	dZ
dZdZd	Z
d
ZdZdZd
ZdZdd�ZdS)�
NodeFilter���l������ �@��iiicCst�dS)N)�NotImplementedError)�selfZnode�r�*/usr/lib64/python3.8/xml/dom/NodeFilter.py�
acceptNodeszNodeFilter.acceptNodeN)�__name__�
__module__�__qualname__Z
FILTER_ACCEPTZ
FILTER_REJECTZFILTER_SKIPZSHOW_ALLZSHOW_ELEMENTZSHOW_ATTRIBUTEZ	SHOW_TEXTZSHOW_CDATA_SECTIONZSHOW_ENTITY_REFERENCEZSHOW_ENTITYZSHOW_PROCESSING_INSTRUCTIONZSHOW_COMMENTZ
SHOW_DOCUMENTZSHOW_DOCUMENT_TYPEZSHOW_DOCUMENT_FRAGMENTZ
SHOW_NOTATIONrrrrrrs"rN)rrrrr�<module>�xml/dom/__pycache__/minidom.cpython-38.pyc000064400000154120151153537540014433 0ustar00U

e5d)�@s�dZddlZddlZddlmZmZmZmZddlTddl	m
Z
mZejj
jejj
jfZGdd�dejj
�Z
ee
dd	d
�ee
ddd
�ee
d
dd
�dd�Zdd�Zdd�Zdd�Zdd�ZGdd�de
�ZGdd�de
�Zeeddd
�eed
dd
�eed d!d
�Gd"d#�d#e�Zeed$d%d
�eZGd&d'�d'e�Zedd�ZGd(d)�d)e
�Zeed*d+d
�eed
d,d
�d-d.�ZGd/d0�d0�Z Gd1d2�d2e e
�Z!Gd3d4�d4e e
�Z"ee"d$d5d
�Gd6d7�d7e"�Z#ee#d8d9d
�ee#d:d;d
�d<d=�Z$d>d?�Z%Gd@dA�dAe"�Z&GdBdC�dCe#�Z'GdDdE�dEe�Z(ee(d$dFd
�GdGdH�dH�Z)GdIdJ�dJe)e e
�Z*GdKdL�dLe)e
�Z+GdMdN�dNe)e e
�Z,GdOdP�dPe
�Z-GdQdR�dRe�Z.dSdT�Z/GdUdV�dVe
e�Z0ee0dWdXd
�dYdZ�Z1d[d\�Z2d]d^�Z3ded_d`�Z4dfdadb�Z5dgdcdd�Z6dS)hacSimple implementation of the Level 1 DOM.

Namespaces and other minor Level 2 features are also supported.

parse("foo.xml")

parseString("<foo><bar/></foo>")

Todo:
=====
 * convenience methods for getting elements and text.
 * more testing
 * bring some of the writer and linearizer code into conformance with this
        interface
 * SAX 2 namespaces
�N)�EMPTY_NAMESPACE�EMPTY_PREFIX�XMLNS_NAMESPACE�domreg)�*)�DOMImplementationLS�
DocumentLSc@s�eZdZdZdZdZdZdZeZ	dd�Z
d2dd�Zd3dd	�Zd
d�Z
dd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Z dS)4�NodeNcCsdS)NT���selfr
r
�'/usr/lib64/python3.8/xml/dom/minidom.py�__bool__+sz
Node.__bool__cCs|�dd|�S�N�)�toprettyxml)r�encodingr
r
r
�toxml.sz
Node.toxml�	�
cCsx|dkrt��}ntjt��|ddd�}|jtjkrH|�|d|||�n|�|d||�|dkrh|��S|�	���SdS)N�xmlcharrefreplacer)r�errors�newliner)
�io�StringIO�
TextIOWrapper�BytesIO�nodeTyper	�
DOCUMENT_NODE�writexml�getvalue�detach)r�indent�newlr�writerr
r
r
r1s

�zNode.toprettyxmlcCs
t|j�S�N)�bool�
childNodesrr
r
r
�
hasChildNodesCszNode.hasChildNodescCs|jSr%�r'rr
r
r
�_get_childNodesFszNode._get_childNodescCs|jr|jdSdS�Nrr)rr
r
r
�_get_firstChildIszNode._get_firstChildcCs|jr|jdSdS�N���r)rr
r
r
�_get_lastChildMszNode._get_lastChildcCs
|j|jkr,t|j�D]}|�||�q|S|j|jkrTtj�dt	|�t	|�f��|j
dk	rj|j
�|�|dkr~|�|�n�z|j�
|�}Wntk
r�tj���YnX|jtkr�t|�|j�||�||_||_|r�|j|d}||_||_nd|_||_
|S)N�%s cannot be child of %s�)r�DOCUMENT_FRAGMENT_NODE�tupler'�insertBefore�_child_node_types�xml�dom�HierarchyRequestErr�repr�
parentNode�removeChild�appendChild�index�
ValueError�NotFoundErr�_nodeTypes_with_children�_clear_id_cache�insert�nextSibling�previousSibling)r�newChild�refChild�cr=�noder
r
r
r4Qs8�

zNode.insertBeforecCs�|j|jkr*t|j�D]}|�|�q|S|j|jkrTtj�dt	|�t	|�f��n|jt
krft|�|jdk	r||j�
|�t||�d|_|S�Nr0)rr2r3r'r<r5r6r7r8r9r@rAr:r;�
_append_childrC)rrHrGr
r
r
r<qs�


zNode.appendChildcCs|j|jkr(|j}|�|�|�||�S|j|jkrPtj�dt	|�t	|�f��||kr\dS|j
dk	rr|j
�|�z|j�|�}Wnt
k
r�tj���YnX||j|<||_
d|_
|jtks�|jtkr�t|�|j|_|j|_d|_d|_|jr�||j_|j�r||j_|SrI)rr2rCr;r4r5r6r7r8r9r:r'r=r>r?r@rArD)rrE�oldChildrFr=r
r
r
�replaceChild�s@
�


�zNode.replaceChildcCs�z|j�|�Wntk
r.tj���YnX|jdk	rD|j|j_|jdk	rX|j|j_d|_|_|jt	krvt
|�d|_|Sr%)r'�remover>r6r7r?rCrDrr@rAr:�rrKr
r
r
r;�s




zNode.removeChildcCs�g}|jD]�}|jtjkr�|jsJ|r0|j|d_|jr@|j|j_|��q�|r�|dj|jkr�|d}|j|j|_|j|_|jr�||j_|��q�|�|�q
|�|�|jtj	kr
|�
�q
||jdd�<dSr-)r'rr	�	TEXT_NODE�datarCrD�unlink�append�ELEMENT_NODE�	normalize)r�L�childrHr
r
r
rT�s*





zNode.normalizecCst|||jp|�Sr%)�_clone_node�
ownerDocument)r�deepr
r
r
�	cloneNode�szNode.cloneNodecCs|jj�||�Sr%)rX�implementation�
hasFeature�r�feature�versionr
r
r
�isSupported�szNode.isSupportedcCsdSr%r
rr
r
r
�_get_localName�szNode._get_localNamecCs||kSr%r
�r�otherr
r
r
�
isSameNode�szNode.isSameNodecCs|�|d�r|SdSdSr%)r`�rr^r
r
r
�getInterface�szNode.getInterfacec	Cs0z|j|dWSttfk
r*YdSXdSr+)�
_user_data�AttributeError�KeyError�r�keyr
r
r
�getUserData�szNode.getUserDatacCsnd}z
|j}Wntk
r,i}||_YnX||krB||d}|dkr^d}|dk	rj||=n||f||<|Sr+)rgrh)rrkrP�handler�old�dr
r
r
�setUserData�s
zNode.setUserDatacCsDt|d�r@t|j���D]&\}\}}|dk	r|�|||||�qdS)Nrg)�hasattr�listrg�itemsZhandle)r�	operation�srcZdstrkrPrmr
r
r
�_call_user_data_handler�s
zNode._call_user_data_handlercCs>d|_|_|jr.|jD]}|��qt�|_d|_d|_dSr%)r:rXr'rQ�NodeListrDrC)rrVr
r
r
rQs

zNode.unlinkcCs|Sr%r
rr
r
r
�	__enter__szNode.__enter__cCs|��dSr%)rQ)rZetZev�tbr
r
r
�__exit__sz
Node.__exit__)N)rrN)!�__name__�
__module__�__qualname__�namespaceURIr:rXrCrDr�prefixrrrr(r*r,r/r4r<rLr;rTrZr`rardrfrlrprvrQrxrzr
r
r
r
r	"s:

  
r	�
firstChildzFirst child node, or None.)�doc�	lastChildzLast child node, or None.�	localNamez"Namespace-local name of this node.cCs2|j}|r|d}||_||_|�|�||_dSr-)r'rDrCrRr:)rrHr'Zlastr
r
r
rJs
rJcCs$|dk	r |jtjkrdS|j}qdS�NTF)rr	rr:�rHr
r
r
�_in_document&s
r�cCs6|r2|�dd��dd��dd��dd�}|�|�d	S)
zWrites datachars to writer.�&z&amp;�<z&lt;�"z&quot;�>z&gt;N)�replace�write)r$rPr
r
r
�_write_data.s��r�cCsD|jD]8}|jtjkr2|dks(|j|kr2|�|�t|||�q|S�Nr)r'rr	rS�tagNamerR�_get_elements_by_tagName_helper)�parent�name�rcrHr
r
r
r�5s
��
r�cCsX|jD]L}|jtjkr|dks(|j|krD|dks:|j|krD|�|�t||||�q|Sr�)r'rr	rSr�r~rR�"_get_elements_by_tagName_ns_helper)r�ZnsURIr�r�rHr
r
r
r�=s
��
r�c@sJeZdZejZdZdZdZdZ	ej
ejejej
ejejejfZdd�ZdS)�DocumentFragmentz#document-fragmentNcCst�|_dSr%)rwr'rr
r
r
�__init__TszDocumentFragment.__init__)r{r|r}r	r2r�nodeName�	nodeValue�
attributesr:rSrO�CDATA_SECTION_NODE�ENTITY_REFERENCE_NODE�PROCESSING_INSTRUCTION_NODE�COMMENT_NODE�
NOTATION_NODEr5r�r
r
r
r
r�Fs�r�c@s�eZdZdZejZdZdZdZ	ej
ejfZe
ddfdd�Zdd�Zdd	�Zd
d�Zdd
�Zeee�ZZdd�Zdd�Zeee�ZZdd�Zdd�Zeee�Zdd�Zdd�Zdd�ZdS)�Attr)�_name�_valuer~�_prefixr'�
_localNamerX�ownerElementNFcCs2d|_||_||_||_t�|_|j�t��dSr%)r�r�r~r�rwr'rR�Text)r�qNamer~r�rr
r
r
r�bsz
Attr.__init__cCs4z|jWStk
r.|j�dd�dYSXdS�N�:r1r.)r�rhr��splitrr
r
r
raoszAttr._get_localNamecCs|jSr%)�	specifiedrr
r
r
�_get_specifieduszAttr._get_specifiedcCs|jSr%)r�rr
r
r
�	_get_namexszAttr._get_namecCs||_|jdk	rt|j�dSr%)r�r�rA�r�valuer
r
r
�	_set_name{s
zAttr._set_namecCs|jSr%)r�rr
r
r
�
_get_value�szAttr._get_valuecCs6||_||jd_|jdk	r&t|j�||jd_dSr+)r�r'rPr�rAr�r
r
r
�
_set_value�s


zAttr._set_valuecCs|jSr%)r�rr
r
r
�_get_prefix�szAttr._get_prefixcCsd|j}|dkr&|r&|tkr&tj�d��||_|dkr<|j}nd||jf}|jrZt|j�||_	dS)N�xmlnsz5illegal use of 'xmlns' prefix for the wrong namespacez%s:%s)
r~rr6r7�NamespaceErrr�r�r�rAr�)rrZnsuriZnewNamer
r
r
�_set_prefix�s�
zAttr._set_prefixcCsv|j}|dk	rR|j|j=|j|j|jf=|jrRd|_|jd8_|jj	d8_	|j
D]}|��qX|j
dd�=dS)NFr1)r��_attrsr��_attrsNSr~r��_is_id�_magic_id_nodesrX�_magic_id_countr'rQ)r�elemrVr
r
r
rQ�s


zAttr.unlinkcCsf|jr
dS|j}|j}|dks&|dkr*dS|�|�}|dkr@dS|jrV|�|j|j�S|�|j�SdSr�)	r�rXr��_get_elem_infor~�isIdNSr��isIdr��rr�r��infor
r
r
�	_get_isId�s
zAttr._get_isIdcCs\|j}|j}|dks|dkr tS|�|�}|dkr6tS|jrL|�|j|j�S|�|j�SdSr%)	rXr��_no_typer�r~�getAttributeTypeNSr��getAttributeTyper�r�r
r
r
�_get_schemaType�s
zAttr._get_schemaType) r{r|r}�	__slots__r	�ATTRIBUTE_NODErr�r�r�rOr�r5rr�rar�r�r��propertyr�r�r�r�r�r�r�r�rrQr�r�r
r
r
r
r�Xs.�


r�r�z True if this attribute is an ID.z'Namespace-local name of this attribute.�
schemaTypezSchema type for this attribute.c@s�eZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
d:dd�ZeZdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Z dS);�NamedNodeMapaThe attribute list is a transient interface to the underlying
    dictionaries.  Mutations here will change the underlying element's
    dictionary.

    Ordering is imposed artificially and does not reflect the order of
    attributes as found in an input document.
    �r�r��
_ownerElementcCs||_||_||_dSr%r�)r�attrsZattrsNSr�r
r
r
r��szNamedNodeMap.__init__cCs
t|j�Sr%)�lenr�rr
r
r
�_get_length�szNamedNodeMap._get_lengthcCs4z|t|j���|WStk
r.YdSXdSr%)rrr��keys�
IndexError�rr=r
r
r
�item�szNamedNodeMap.itemcCs*g}|j��D]}|�|j|jf�q|Sr%)r��valuesrRr�r��rrUrHr
r
r
rs�szNamedNodeMap.itemscCs0g}|j��D]}|�|j|jf|jf�q|Sr%)r�r�rRr~r�r�r�r
r
r
�itemsNS�szNamedNodeMap.itemsNScCs"t|t�r||jkS||jkSdSr%)�
isinstance�strr�r�rjr
r
r
�__contains__�s

zNamedNodeMap.__contains__cCs
|j��Sr%)r�r�rr
r
r
r�szNamedNodeMap.keyscCs
|j��Sr%)r�r�rr
r
r
�keysNSszNamedNodeMap.keysNScCs
|j��Sr%)r�r�rr
r
r
r�szNamedNodeMap.valuesNcCs|j�||�Sr%�r��get)rr�r�r
r
r
r�
szNamedNodeMap.getcCs:|jt|dd�krdSt|�t|�kt|�t|�kSdS)Nr�r)r��getattr�idrbr
r
r
�_cmpszNamedNodeMap._cmpcCs|�|�dkSr+�r�rbr
r
r
�__eq__szNamedNodeMap.__eq__cCs|�|�dkSr+r�rbr
r
r
�__ge__szNamedNodeMap.__ge__cCs|�|�dkSr+r�rbr
r
r
�__gt__szNamedNodeMap.__gt__cCs|�|�dkSr+r�rbr
r
r
�__le__szNamedNodeMap.__le__cCs|�|�dkSr+r�rbr
r
r
�__lt__!szNamedNodeMap.__lt__cCs"t|t�r|j|S|j|SdSr%)r�r3r�r�)r�attname_or_tupler
r
r
�__getitem__$s

zNamedNodeMap.__getitem__cCsvt|t�rRz|j|}Wn0tk
rHt|�}|jj|_|�|�YnX||_n t|t�sdt	d��|}|�|�dS)Nz%value must be a string or Attr object)
r�r�r�rir�r�rX�setNamedItemr��	TypeError)r�attnamer�rHr
r
r
�__setitem__+s


zNamedNodeMap.__setitem__cCs(z|j|WStk
r"YdSXdSr%)r�ri�rr�r
r
r
�getNamedItem:szNamedNodeMap.getNamedItemcCs,z|j||fWStk
r&YdSXdSr%)r�ri�rr~r�r
r
r
�getNamedItemNS@szNamedNodeMap.getNamedItemNScCsX|�|�}|dk	rJt|j�|j|j=|j|j|jf=t|d�rFd|_	|St
j���dS�Nr�)
r�rAr�r�r�r�r~r�rqr�r6r7r?�rr��nr
r
r
�removeNamedItemFs



zNamedNodeMap.removeNamedItemcCsZ|�||�}|dk	rLt|j�|j|j|jf=|j|j=t|d�rHd|_	|St
j���dSr�)
r�rAr�r�r~r�r�r�rqr�r6r7r?�rr~r�r�r
r
r
�removeNamedItemNSRs


zNamedNodeMap.removeNamedItemNScCstt|t�s&tj�dt|�t|�f��|j�|j�}|r@|�	�||j|j<||j
|j|jf<|j
|_t|j�|SrI)r�r�r6r7r8r9r�r�r�rQr�r~r�r�r�rA)rrHrnr
r
r
r�^s
�
zNamedNodeMap.setNamedItemcCs
|�|�Sr%)r��rrHr
r
r
�setNamedItemNSkszNamedNodeMap.setNamedItemNScCs||}t|j�|��dSr%)rAr�rQ)rr�rHr
r
r
�__delitem__ns
zNamedNodeMap.__delitem__cCs|j|j|jfSr%r�rr
r
r
�__getstate__sszNamedNodeMap.__getstate__cCs|\|_|_|_dSr%r��r�stater
r
r
�__setstate__vszNamedNodeMap.__setstate__)N)!r{r|r}�__doc__r�r�r�r�rsr�r�r�r�r�r��__len__r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r
r
r
r
r��s<

r�Zlengthz$Number of nodes in the NamedNodeMap.c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�TypeInfo��	namespacer�cCs||_||_dSr%r)rrr�r
r
r
r��szTypeInfo.__init__cCs2|jrd|jj|j|jfSd|jj|jfSdS)Nz<%s %r (from %r)>z<%s %r>)r�	__class__r{r�rr
r
r
�__repr__�s
�zTypeInfo.__repr__cCs|jSr%)r�rr
r
r
r��szTypeInfo._get_namecCs|jSr%)rrr
r
r
�_get_namespace�szTypeInfo._get_namespaceN)r{r|r}r�r�rr�rr
r
r
r
r�s
r�c@s eZdZdZejZdZeZ	dZ
ejejejej
ejejfZeddfdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�ZeZdd�Zdd�Z d d!�Z!e!Z"d"d#�Z#d$d%�Z$d&d'�Z%d(d)�Z&d*d+�Z'd9d-d.�Z(d/d0�Z)d1d2�Z*d3d4�Z+d5d6�Z,d7d8�Z-dS):�Element)rXr:r�r�rr~r�r'r�r�rCrDNrcCsBd|_||_|_||_||_t�|_d|_|_d|_	d|_
dSr%)r:r�r�rr~rwr'rCrDr�r�)rr�r~rr�r
r
r
r��s
zElement.__init__cCs|jdkri|_i|_dSr%)r�r�rr
r
r
�_ensure_attributes�s
zElement._ensure_attributescCs4z|jWStk
r.|j�dd�dYSXdSr�)r�rhr�r�rr
r
r
ra�szElement._get_localNamecCs|jSr%�r�rr
r
r
�_get_tagName�szElement._get_tagNamecCs@|jdk	r&t|j���D]}|��qd|_d|_t�|�dSr%)r�rrr�rQr�r	)r�attrr
r
r
rQ�s

zElement.unlinkcCs8|jdkrdSz|j|jWStk
r2YdSXdSr)r�r�ri)rr�r
r
r
�getAttribute�s
zElement.getAttributecCs<|jdkrdSz|j||fjWStk
r6YdSXdSr)r�r�rir�r
r
r
�getAttributeNS�s
zElement.getAttributeNScCsV|�|�}|dkr4t|�}||_|j|_|�|�n||jkrR||_|jrRt|�dSr%)�getAttributeNoder�r�rX�setAttributeNoder�rA)rr�r�r	r
r
r
�setAttribute�s

zElement.setAttributecCs�t|�\}}|�||�}|dkrHt||||�}||_|j|_|�|�n4||jkrf||_|jrft|�|j|kr|||_||_	dSr%)
�_nssplit�getAttributeNodeNSr�r�rXr
r�rArr�)rr~�
qualifiedNamer�r�	localnamer	r
r
r
�setAttributeNS�s

zElement.setAttributeNScCs|jdkrdS|j�|�Sr%r�)r�attrnamer
r
r
r�s
zElement.getAttributeNodecCs|jdkrdS|j�||f�Sr%)r�r�r�r
r
r
rs
zElement.getAttributeNodeNScCs�|jd|fkrtj�d��|��|j�|jd�}|dk	rD|�|�|j	�|j
|jfd�}|dk	rt||k	rt|�|�t||�||k	r�|S||k	r�|SdS)Nzattribute node already owned)
r�r6r7ZInuseAttributeErrrr�r�r��removeAttributeNoder�r~r��_set_attribute_node)rr	Zold1Zold2r
r
r
r
s


zElement.setAttributeNodecCsP|jdkrtj���z|j|}Wntk
r@tj���YnX|�|�dSr%)r�r6r7r?r�rir)rr�r	r
r
r
�removeAttributes

zElement.removeAttributecCsT|jdkrtj���z|j||f}Wntk
rDtj���YnX|�|�dSr%)r�r6r7r?rir)rr~r�r	r
r
r
�removeAttributeNS%s

zElement.removeAttributeNScCs^|dkrtj���z|j|jWntk
r@tj���YnXt|�|��|j|_|Sr%)	r6r7r?r�r�rirArQrXr�r
r
r
r.s
zElement.removeAttributeNodecCs|jdkrdS||jkS�NF�r�r�r
r
r
�hasAttribute>s
zElement.hasAttributecCs|jdkrdS||f|jkSr)r�r�r
r
r
�hasAttributeNSCs
zElement.hasAttributeNScCst||t��Sr%�r�rwr�r
r
r
�getElementsByTagNameHszElement.getElementsByTagNamecCst|||t��Sr%�r�rwr�r
r
r
�getElementsByTagNameNSKs�zElement.getElementsByTagNameNScCsd|jt|�fS)Nz<DOM Element: %s at %#x>)r�r�rr
r
r
rOszElement.__repr__rcCs�|�|d|j�|��}|��D],}|�d|�t|||j�|�d�q$|jr�|�d�t|j�dkr�|jdjt	j
t	jfkr�|jd�|ddd�n4|�|�|jD]}|�|||||�q�|�|�|�d|j|f�n|�d	|�dS)
Nr�z %s="r�r�r1rrz</%s>%sz/>%s)
r�r��_get_attributesr�r�r�r'r�rr	rOr�r)rr$r"�	addindentr#r�Za_namerHr
r
r
rRs*

��


zElement.writexmlcCs|��t|j|j|�Sr%)rr�r�r�rr
r
r
r!mszElement._get_attributescCs|jr
dSdSdSr�rrr
r
r
�
hasAttributesqszElement.hasAttributescCs|�|�}|�|�dSr%)r�setIdAttributeNode)rr��idAttrr
r
r
�setIdAttributeys
zElement.setIdAttributecCs|�||�}|�|�dSr%)rr$)rr~r�r%r
r
r
�setIdAttributeNS}szElement.setIdAttributeNScCsj|dks|�|j�stj���t|�dk	r4tj���|jsfd|_|jd7_|j	j
d7_
t|�dS)NTr1)rdr�r6r7r?�_get_containing_entref�NoModificationAllowedErrr�r�rXr�rA)rr%r
r
r
r$�s

zElement.setIdAttributeNode)rrr).r{r|r}r�r	rSrr�r�r�r�r�r�rOr�r�r5rr�rrarrQr
rrrrrr
ZsetAttributeNodeNSrrrZremoveAttributeNodeNSrrrr rrr!r#r&r'r$r
r
r
r
r�sT��
		
rr�z*NamedNodeMap of attributes on the element.z%Namespace-local name of this element.cCs8t|�|��||j|j<||j|j|jf<||_dSr%)rArr�r�r�r~r�r�)�elementr	r
r
r
r�s
rc@sfeZdZdZdZdZe�ZdZdZ	dd�Z
dd�Zdd	�Zd
d�Z
dd
�Zdd�Zdd�Zdd�ZdS)�	Childlessz�Mixin that makes childless-ness easy to implement and avoids
    the complexity of the Node methods that deal with children.
    r
NcCsdSr%r
rr
r
r
r,�szChildless._get_firstChildcCsdSr%r
rr
r
r
r/�szChildless._get_lastChildcCstj�|jd��dS)Nz nodes cannot have children�r6r7r8r�r�r
r
r
r<�s�zChildless.appendChildcCsdSrr
rr
r
r
r(�szChildless.hasChildNodescCstj�|jd��dS�Nz nodes do not have childrenr,�rrErFr
r
r
r4�s�zChildless.insertBeforecCstj�|jd��dSr-)r6r7r?r�rNr
r
r
r;�s�zChildless.removeChildcCsdSr%r
rr
r
r
rT�szChildless.normalizecCstj�|jd��dSr-r,�rrErKr
r
r
rL�s�zChildless.replaceChild)r{r|r}r�r�r�Z
EmptyNodeListr'r�r�r,r/r<r(r4r;rTrLr
r
r
r
r+�sr+c@s\eZdZejZdZdd�Zdd�Zdd�Z	e
ee	�Zdd	�Zd
d�Z
e
ee
�Zdd
d�ZdS)�ProcessingInstruction��targetrPcCs||_||_dSr%r1)rr2rPr
r
r
r��szProcessingInstruction.__init__cCs|jSr%�rPrr
r
r
�_get_nodeValue�sz$ProcessingInstruction._get_nodeValuecCs
||_dSr%r3r�r
r
r
�_set_nodeValue�sz$ProcessingInstruction._set_nodeValuecCs|jSr%�r2rr
r
r
�
_get_nodeName�sz#ProcessingInstruction._get_nodeNamecCs
||_dSr%r6r�r
r
r
�
_set_nodeName�sz#ProcessingInstruction._set_nodeNamercCs|�d||j|j|f�dS)Nz
%s<?%s %s?>%s)r�r2rP�rr$r"r"r#r
r
r
r�szProcessingInstruction.writexmlN)rrr)r{r|r}r	r�rr�r�r4r5r�r�r7r8r�rr
r
r
r
r0�s

r0c@sreZdZdZdd�Zdd�ZeZdd�Zdd	�Ze	ee�Z
Zd
d�Zdd
�Z
dd�Zdd�Zdd�Zdd�ZdS)�
CharacterData)�_datarXr:rDrCcCs,d|_|_d|_|_d|_t�|�dSr)rXr:rDrCr;r	r�rr
r
r
r��szCharacterData.__init__cCs
t|j�Sr%)r�rPrr
r
r
r��szCharacterData._get_lengthcCs|jSr%�r;rr
r
r
�	_get_data�szCharacterData._get_datacCs
||_dSr%r<�rrPr
r
r
�	_set_data�szCharacterData._set_datacCs6|j}t|�dkrd}nd}d|jj|dd�|fS)N�
z...rz<DOM %s node "%r%s">r)rPr�rr{)rrPZ	dotdotdotr
r
r
r�s
�zCharacterData.__repr__cCsT|dkrtj�d��|t|j�kr.tj�d��|dkrBtj�d��|j|||�S�Nr�offset cannot be negative�#offset cannot be beyond end of data�count cannot be negative�r6r7�IndexSizeErrr�rP�r�offset�countr
r
r
�
substringData�szCharacterData.substringDatacCs|j||_dSr%r3)r�argr
r
r
�
appendDataszCharacterData.appendDatacCsZ|dkrtj�d��|t|j�kr.tj�d��|rVd|jd|�||j|d�f|_dS)NrrBrC�%s%s%srE)rrHrKr
r
r
�
insertData	s�zCharacterData.insertDatacCsl|dkrtj�d��|t|j�kr.tj�d��|dkrBtj�d��|rh|jd|�|j||d�|_dSrArErGr
r
r
�
deleteDataszCharacterData.deleteDatacCsr|dkrtj�d��|t|j�kr.tj�d��|dkrBtj�d��|rnd|jd|�||j||d�f|_dS)NrrBrCrDrMrE)rrHrIrKr
r
r
�replaceDatas�zCharacterData.replaceDataN)r{r|r}r�r�r�r�r=r?r�rPr�rrJrLrNrOrPr
r
r
r
r:�s			
r:zLength of the string data.c@sHeZdZdZejZdZdZdd�Z	ddd�Z
d	d
�Zdd�Zd
d�Z
dS)r�r
z#textNcCs�|dks|t|j�kr"tj�d��|��}|j|d�|_|j|_|j}|jr~||jj	kr~|dkrp|j�
|�n|j�||�|jd|�|_|S)Nrzillegal offset value)r�rPr6r7rFrrXrCr:r'r<r4)rrHZnewText�nextr
r
r
�	splitText1szText.splitTextrcCst|d||j|f�dS)NrM)r�rPr9r
r
r
r@sz
Text.writexmlcCs�|jg}|j}|dk	rB|jtjtjfkrB|�d|j�|j}qqBq|j}|dk	rz|jtjtjfkrz|�|j�|j}qHqzqHd�	|�S)Nrr)
rPrDrr	rOr�rBrCrR�join)rrUr�r
r
r
�_get_wholeTextEszText._get_wholeTextcCs�|j}|j}|dk	r@|jtjtjfkr@|j}|�|�|}qq@q|j}|sT|�|�|dk	r�|jtjtjfkr�|j}|�|�|}qTq�qT|r�||_|SdSdSr%)	r:rDrr	rOr�r;rCrP)rZcontentr�r�rQr
r
r
�replaceWholeTextWs*


zText.replaceWholeTextcCsF|j��rdSt|�}|dkr"dS|j�|�}|dkr:dS|��SdSr)rP�strip�_get_containing_elementrXr��isElementContent)rr�r�r
r
r
�!_get_isWhitespaceInElementContentss
z&Text._get_isWhitespaceInElementContent)rrr)r{r|r}r�r	rOrr�r�rRrrTrUrYr
r
r
r
r�*s
r�ZisWhitespaceInElementContentzKTrue iff this text node contains only whitespace and is in element content.Z	wholeTextz.The text of all logically-adjacent text nodes.cCs*|j}|dk	r&|jtjkr|S|j}qdSr%)r:rr	rS�rHrGr
r
r
rW�srWcCs*|j}|dk	r&|jtjkr|S|j}qdSr%)r:rr	r�rZr
r
r
r(�sr(c@s(eZdZejZdZdd�Zddd�ZdS)	�Commentz#commentcCst�|�||_dSr%)r:r�r;r>r
r
r
r��s
zComment.__init__rcCs,d|jkrtd��|�d||j|f�dS)Nz--z%'--' is not allowed in a comment nodez
%s<!--%s-->%s)rPr>r�r9r
r
r
r�s
zComment.writexmlN)rrr)	r{r|r}r	r�rr�r�rr
r
r
r
r[�sr[c@s$eZdZdZejZdZddd�ZdS)�CDATASectionr
z#cdata-sectionrcCs,|j�d�dkrtd��|�d|j�dS)Nz]]>rz$']]>' not allowed in a CDATA sectionz<![CDATA[%s]]>)rP�findr>r�r9r
r
r
r�szCDATASection.writexmlN)rrr)	r{r|r}r�r	r�rr�rr
r
r
r
r\�sr\c@szeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)�ReadOnlySequentialNamedNodeMap��_seqr
cCs
||_dSr%r_)r�seqr
r
r
r��sz'ReadOnlySequentialNamedNodeMap.__init__cCs
t|j�Sr%�r�r`rr
r
r
r��sz&ReadOnlySequentialNamedNodeMap.__len__cCs
t|j�Sr%rbrr
r
r
r��sz*ReadOnlySequentialNamedNodeMap._get_lengthcCs"|jD]}|j|kr|SqdSr%)r`r�r�r
r
r
r��s

z+ReadOnlySequentialNamedNodeMap.getNamedItemcCs,|jD] }|j|kr|j|kr|SqdSr%)r`r~r�r�r
r
r
r��s
z-ReadOnlySequentialNamedNodeMap.getNamedItemNScCs4t|t�r|j|�}n
|�|�}|dkr0t|��|Sr%)r�r3r�r�ri)rZ
name_or_tuplerHr
r
r
r��s

z*ReadOnlySequentialNamedNodeMap.__getitem__cCs4|dkrdSz|j|WStk
r.YdSXdSr+)r`r�r�r
r
r
r��sz#ReadOnlySequentialNamedNodeMap.itemcCstj�d��dS�Nz"NamedNodeMap instance is read-only�r6r7r)r�r
r
r
r��s�z.ReadOnlySequentialNamedNodeMap.removeNamedItemcCstj�d��dSrcrdr�r
r
r
r��s�z0ReadOnlySequentialNamedNodeMap.removeNamedItemNScCstj�d��dSrcrdr�r
r
r
r��s�z+ReadOnlySequentialNamedNodeMap.setNamedItemcCstj�d��dSrcrdr�r
r
r
r��s�z-ReadOnlySequentialNamedNodeMap.setNamedItemNScCs|jgSr%r_rr
r
r
r��sz+ReadOnlySequentialNamedNodeMap.__getstate__cCs|d|_dSr+r_r�r
r
r
r��sz+ReadOnlySequentialNamedNodeMap.__setstate__N)r
)r{r|r}r�r�r�r�r�r�r�r�r�r�r�r�r�r�r
r
r
r
r^�s
	r^z&Number of entries in the NamedNodeMap.c@s,eZdZdZdZdd�Zdd�Zdd�Zd	S)
�
Identifiedz@Mix-in class that supports the publicId and systemId attributes.��publicId�systemIdcCs||_||_dSr%rf)rrgrhr
r
r
�_identified_mixin_init�sz!Identified._identified_mixin_initcCs|jSr%)rgrr
r
r
�
_get_publicId�szIdentified._get_publicIdcCs|jSr%)rhrr
r
r
�
_get_systemId�szIdentified._get_systemIdN)r{r|r}r�r�rirjrkr
r
r
r
re�s
rec@sHeZdZejZdZdZdZdZ	dZ
dd�Zdd�Zdd�Z
dd	d
�ZdS)�DocumentTypeNcCs2t�|_t�|_|r&t|�\}}||_|j|_dSr%)r^�entities�	notationsrr�r�)rrrrr
r
r
r�
szDocumentType.__init__cCs|jSr%)�internalSubsetrr
r
r
�_get_internalSubsetsz DocumentType._get_internalSubsetcCs�|jdkr�td�}|j|_|j|_tjjj}|r�g|j_	g|j
_	|j
j	D]2}t|j|j|j
�}|j
j	�|�|�|||�qH|jj	D]N}t|j|j|j
|j�}|j|_|j|_|j|_|jj	�|�|�|||�q�|�|||�|SdSdSr%)rXrlr�r�r6r7�UserDataHandler�NODE_CLONEDrmr`rn�NotationrgrhrRrv�Entity�notationName�actualEncodingrr_)rrY�clonertr��notation�e�entityr
r
r
rZs0

�zDocumentType.cloneNodercCs�|�d�|�|j�|jr8|�d||j||jf�n|jrR|�d||jf�|jdk	r||�d�|�|j�|�d�|�d|�dS)Nz
<!DOCTYPE z%s  PUBLIC '%s'%s  '%s'z%s  SYSTEM '%s'z [�]r�)r�r�rgrhror9r
r
r
r0s
�


zDocumentType.writexml)rrr)r{r|r}r	�DOCUMENT_TYPE_NODErr�r�rgrhror�rprZrr
r
r
r
rlsrlc@sfeZdZdZejZdZdZdZ	dZ
dd�Zdd�Zdd�Z
dd	�Zd
d�Zdd
�Zdd�Zdd�ZdS)rtNcCs$||_||_t�|_|�||�dSr%)r�rurwr'ri)rr�rgrhrxr
r
r
r�GszEntity.__init__cCs|jSr%�rvrr
r
r
�_get_actualEncodingMszEntity._get_actualEncodingcCs|jSr%�rrr
r
r
�
_get_encodingPszEntity._get_encodingcCs|jSr%�r_rr
r
r
�_get_versionSszEntity._get_versioncCstj�d��dS)Nz(cannot append children to an entity node�r6r7r8)rrEr
r
r
r<Vs�zEntity.appendChildcCstj�d��dS)Nz+cannot insert children below an entity noder�r.r
r
r
r4Zs�zEntity.insertBeforecCstj�d��dS)Nz*cannot remove children from an entity noder�rNr
r
r
r;^s�zEntity.removeChildcCstj�d��dS)Nz)cannot replace children of an entity noder�r/r
r
r
rLbs�zEntity.replaceChild)r{r|r}r�r	ZENTITY_NODErr�rvrr_r�r~r�r�r<r4r;rLr
r
r
r
rt>srtc@seZdZejZdZdd�ZdS)rsNcCs||_|�||�dSr%)r�ri)rr�rgrhr
r
r
r�jszNotation.__init__)r{r|r}r	r�rr�r�r
r
r
r
rsfsrsc@sHeZdZddddddddgZd	d
�Zdd�Zd
d�Zdd�Zdd�ZdS)�DOMImplementation)�core�1.0)r��2.0)r�N)r6r�)r6r�)r6N)�ls-loadz3.0)r�NcCs|dkrd}|��|f|jkSr)�lower�	_featuresr]r
r
r
r\zszDOMImplementation.hasFeaturec	Cs�|r|jdk	rtj�d��|��}|dko8|dko8|dk}|sP|rPtj�d��|r�t|�\}}|dkr||dkr|tj�d��|r�|s�tj�d��|�||�}|r�|�	|�|�	|�|r�||_|_
||_||_|S)Nz(doctype object owned by another DOM treezElement with no namer6z$http://www.w3.org/XML/1998/namespacezillegal use of 'xml' prefixz(illegal use of prefix without namespaces)
r:r6r7�WrongDocumentErr�_create_documentZInvalidCharacterErrrr��createElementNSr<rX�doctyper[)	rr~rr�r�Zadd_root_elementrrr*r
r
r
�createDocuments>���
��

z DOMImplementation.createDocumentcCst|�}||_||_|Sr%)rlrgrh)rrrgrhr�r
r
r
�createDocumentType�sz$DOMImplementation.createDocumentTypecCs|�|d�r|SdSdSr%)r\rer
r
r
rf�szDOMImplementation.getInterfacecCst�Sr%)�Documentrr
r
r
r��sz"DOMImplementation._create_documentN)	r{r|r}r�r\r�r�rfr�r
r
r
r
r�os�
-r�c@s\eZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dS)�ElementInfoz�Object that represents content-model information for an element.

    This implementation is not expected to be used in practice; DOM
    builders should provide implementations which do the right thing
    using information available to it.

    rcCs
||_dSr%rr�r
r
r
r��szElementInfo.__init__cCstSr%�r��rZanamer
r
r
r��szElementInfo.getAttributeTypecCstSr%r�r�r
r
r
r��szElementInfo.getAttributeTypeNScCsdSrr
rr
r
r
rX�szElementInfo.isElementContentcCsdS)zQReturns true iff this element is declared to have an EMPTY
        content model.Fr
rr
r
r
�isEmpty�szElementInfo.isEmptycCsdS)z7Returns true iff the named attribute is a DTD-style ID.Fr
r�r
r
r
r��szElementInfo.isIdcCsdS)z<Returns true iff the identified attribute is a DTD-style ID.Fr
r�r
r
r
r��szElementInfo.isIdNScCs|jSr%rrr
r
r
r��szElementInfo.__getstate__cCs
||_dSr%rr�r
r
r
r��szElementInfo.__setstate__N)r{r|r}r�r�r�r�r�rXr�r�r�r�r�r
r
r
r
r��sr�cCs>|jtjkr|j��d|_nt|�r:|jj��d|j_dSr%)rr	r�	_id_cache�clear�_id_search_stackr�rXr�r
r
r
rA�s
rAc@sreZdZdZejejejejfZ	e
�ZejZ
dZdZdZdZdZZdZdZdZdZdZdZdZdZdd�Zdd	�Zd
d�Zdd
�Zdd�Z dd�Z!dd�Z"dd�Z#dd�Z$dd�Z%dd�Z&dd�Z'dd�Z(d d!�Z)d"d#�Z*d$d%�Z+d&d'�Z,d(d)�Z-d*d+�Z.d,d-�Z/d.d/�Z0d0d1�Z1d2d3�Z2d4d5�Z3d6d7�Z4d8d9�Z5d:d;�Z6d<d=�Z7d>d?�Z8d@dA�Z9dBdC�Z:dIdEdF�Z;dGdH�Z<dS)Jr�)�
_elem_infor�r�r'r�z	#documentNFrcCs$d|_t�|_i|_i|_d|_dSr%)r�rwr'r�r�r�rr
r
r
r�s
zDocument.__init__cCs&|jr|j|jf}n|j}|j�|�Sr%)r~r�r�r�r�)rr*rkr
r
r
r�szDocument._get_elem_infocCs|jSr%r}rr
r
r
r~szDocument._get_actualEncodingcCs|jSr%)r�rr
r
r
�_get_doctypeszDocument._get_doctypecCs|jSr%)�documentURIrr
r
r
�_get_documentURI!szDocument._get_documentURIcCs|jSr%rrr
r
r
r�$szDocument._get_encodingcCs|jSr%)�errorHandlerrr
r
r
�_get_errorHandler'szDocument._get_errorHandlercCs|jSr%)�
standalonerr
r
r
�_get_standalone*szDocument._get_standalonecCs|jSr%)�strictErrorCheckingrr
r
r
�_get_strictErrorChecking-sz!Document._get_strictErrorCheckingcCs|jSr%r�rr
r
r
r�0szDocument._get_versioncCsj|j|jkr(tj�dt|�t|�f��|jdk	r>|j�|�|jtj	kr^|�
�r^tj�d��t�||�S)Nr0z two document elements disallowed)rr5r6r7r8r9r:r;r	rS�_get_documentElementr<r�r
r
r
r<3s�
��zDocument.appendChildcCsVz|j�|�Wntk
r.tj���YnXd|_|_d|_|j	|krRd|_	|Sr%)
r'rMr>r6r7r?rCrDr:�documentElementrNr
r
r
r;Cs
zDocument.removeChildcCs$|jD]}|jtjkr|SqdSr%)r'rr	rSr�r
r
r
r�Os
zDocument._get_documentElementcCs(|jdk	r|j��d|_t�|�dSr%)r�rQr	rr
r
r
rQTs

zDocument.unlinkcCs�|sdS|j�ddd�}|j|_|j|_|j|_|jD]n}t|||�}|j�|�sVt	�|j�
|�|jtj
kr~|jdks�t	�n |jtjkr�|jdks�t	�||_||_q6|�tjjj||�|Sr%)r[r�rr�r_r'rWrXrd�AssertionErrorrRrr	rr�r|r�r:rvr6r7rqrr)rrYrwr�Z
childcloner
r
r
rZZs*
�zDocument.cloneNodecCst�}||_|Sr%)r�rX)rror
r
r
�createDocumentFragmentoszDocument.createDocumentFragmentcCst|�}||_|Sr%)rrX)rr�ryr
r
r
�
createElementtszDocument.createElementcCs(t|t�std��t�}||_||_|S�Nznode contents must be a string)r�r�r�r�rPrX)rrP�tr
r
r
�createTextNodeys
zDocument.createTextNodecCs(t|t�std��t�}||_||_|Sr�)r�r�r�r\rPrX�rrPrGr
r
r
�createCDATASection�s
zDocument.createCDATASectioncCst|�}||_|Sr%)r[rXr�r
r
r
�
createComment�szDocument.createCommentcCst||�}||_|Sr%)r0rX)rr2rP�pr
r
r
�createProcessingInstruction�s
z$Document.createProcessingInstructioncCst|�}||_d|_|Sr)r�rXr�)rr��ar
r
r
�createAttribute�szDocument.createAttributecCs"t|�\}}t|||�}||_|Sr%)rrrX)rr~rrr�ryr
r
r
r��szDocument.createElementNScCs*t|�\}}t||||�}||_d|_|Sr)rr�rXr�)rr~rrr�r�r
r
r
�createAttributeNS�s
zDocument.createAttributeNScCst||||�}||_|Sr%)rtrX)rr�rgrhruryr
r
r
�_create_entity�szDocument._create_entitycCst|||�}||_|Sr%)rsrX)rr�rgrhr�r
r
r
�_create_notation�szDocument._create_notationcCs�||jkr|j|S|js$|js$dS|j}|dkrB|jg}||_n|sJdSd}|�r�|��}|�dd�|jD��|�|�}|�rB|j	�
�D]�}|jr�|�|j|j
�r�||j|j<|j|kr�|}n|js��q�q�|�|j��r
||j|j<|j|kr�|}n|j�s>�q�q�|jr�||j|j<|j|k�r.|}q�|jdkr��q�q�n>|j�r�|j	�
�D]*}|j�rT||j|j<|j|k�rT|}�qT|dk	rN�q�qN|S)NcSsg|]}|jtkr|�qSr
)rr@)�.0rVr
r
r
�
<listcomp>�s
�z+Document.getElementById.<locals>.<listcomp>r1)r�r�r�r�r��pop�extendr'r�r�r�r~r�r�r�r�r�r�r�)rr��stack�resultrHr�r	r
r
r
�getElementById�sZ






zDocument.getElementByIdcCst||t��Sr%rr�r
r
r
r�szDocument.getElementsByTagNamecCst|||t��Sr%rr�r
r
r
r �s�zDocument.getElementsByTagNameNScCs|j�||�Sr%)r[r\r]r
r
r
r`�szDocument.isSupportedcCs>|jtjkrtj�d��n|jtjkr2tj�d��t|||�S)Nzcannot import document nodesz!cannot import document type nodes)rr	rr6r7�NotSupportedErrr|rW)rrHrYr
r
r
�
importNode�s
zDocument.importNodercCsJ|dkr|�d|�n|�d||f�|jD]}|�||||�q0dS)Nz<?xml version="1.0" ?>z%<?xml version="1.0" encoding="%s"?>%s)r�r'r)rr$r"r"r#rrHr
r
r
r�s�
zDocument.writexmlcCsJ|j|k	r tj�d||jf��|jtjtjfkr>tj�d��|t	kr�d|kr�|�
dd�\}}|dkr�|tjjkr�tj�d��q�|dkr�|tjjkr�|jtjkr�tj�d��d}|}nd}d}|jtjkr�|j
}|dk	r�|j}|�|�nd}||_||_||_||_|jtjk�r||_n*||_|dk	�rF|�|�|�rF|�|�|S)Nz?cannot rename nodes from other documents;
expected %s,
found %sz8renameNode() only applies to element and attribute nodesr�r1r�zillegal use of 'xmlns' prefixz$illegal use of the 'xmlns' attribute)rXr6r7r�rr	rSr�r�rr�rr�r�r�rrr�r~r�r�r�r
r$)rr�r~r�rr�r*Zis_idr
r
r
�
renameNode	sb
���
��
�
��


zDocument.renameNode)rrrN)=r{r|r}r�r	rSr�r�r|r5r�r[rrr�r�r�r:rDrCrvrr�r_r�r�r�r�r�r�r~r�r�r�r�r�r�r�r<r;r�rQrZr�r�r�r�r�r�r�r�r�r�r�r�rr r`r�rr�r
r
r
r
r��sj�	
:
r�r�z#Top-level element of this document.c
Cs�|j�|�rtjjj}n
tjjj}|jtj	kr�|�
|j|j�}|j
��D]0}|�|j|j|j�|�|j|j�}|j|_qH|r�|jD]}t|||�}|�|�q��n|jtjkr�|��}|r�|jD]}t|||�}|�|�qn�|jtjkr�|�|j�}�n�|jtjk�r|�|j�}�n�|jtjk�r>|�|j |j�}�nz|jtj!k�r\|�"|j�}�n\|jtj#k�r�|�$|j|j�}d|_|j|_�n,|jtj%k�r�|j|k	�s�t&�tjjj}|j'�(|j)|j*|j+�}||_|�r�g|j,_-g|j._-|j.j-D]F}	t/|	j|	j*|	j+�}
||
_|j.j-�0|
�t1|	d��r�|	�2||	|
��q�|j,j-D]b}t3|j|j*|j+|j4�}|j5|_5|j6|_6|j7|_7||_|j,j-�0|�t1|d��r>|�2|||��q>ntj�8dt9|���t1|d��r�|�2|||�|S)zo
    Clone a node and give it the new owner document.
    Called by Node.cloneNode and Document.importNode
    TrvzCannot clone node %s):rXrdr6r7rqrrZ
NODE_IMPORTEDrr	rSr�r~r�r�r�rr�rr�r�r'rWr<r2r�rOr�rPr�r�r�r�r2r�r�r�r�r|r�r[r�r�rgrhrmr`rnrsrRrqrvrtrurvrr_r�r9)
rHrYZnewOwnerDocumentrtrwr	r�rVrGr�rxryrzr
r
r
rWBs�
�


��
��rWcCs,|�dd�}t|�dkr|Sd|dfSdS)Nr�r1�r)r�r�)rZfieldsr
r
r
r�srcCs,|||�}|��\}}|�|�|��|Sr%)ZgetEventZ
expandNoder�)�func�args�kwargsZeventsZtoktypeZrootNoder
r
r
�_do_pulldom_parse�s


r�cCsH|dkr"|s"ddlm}|�|�Sddlm}t|j|f||d��SdS)z3Parse a file into a DOM by filename or file object.Nr��expatbuilder��pulldom)�parser�bufsize)�xml.domr��parser�r�)�filer�r�r�r�r
r
r
r��s

�r�cCsB|dkrddlm}|�|�Sddlm}t|j|fd|i�SdS)z&Parse a file into a DOM from a string.Nrr�r�r�)r�r��parseStringr�r�)�stringr�r�r�r
r
r
r��s

�r�cCs@|r:t|t�rt�|�}|D]\}}tj�||�sdSqtjSr%)r�r�rZ_parse_feature_stringr�r[r\)Zfeatures�f�vr
r
r
�getDOMImplementation�s

r�)NN)N)N)7r�rr�r6rrrrZxml.dom.minicompatZxml.dom.xmlbuilderrrr7r	rSr�r@ZdefpropertyrJr�r�r�r�r�r��objectr�Z
AttributeListr�r�rrr+r0r:r�rWr(r[r\r^rerlrtrsr�r�rAr�rWrr�r�r�r�r
r
r
r
�<module>s��v
	y$�
x��)GU��	>�<(	O*P�R



xml/dom/__pycache__/NodeFilter.cpython-38.pyc000064400000001711151153537540015027 0ustar00U

e5d��@sGdd�d�ZdS)c@sXeZdZdZdZdZdZdZdZdZ	dZ
dZdZd	Z
d
ZdZdZd
ZdZdZdd�ZdS)�
NodeFilterzL
    This is the DOM2 NodeFilter interface. It contains only constants.
    ���l������ �@��iiicCst�dS)N)�NotImplementedError)�selfZnode�r�*/usr/lib64/python3.8/xml/dom/NodeFilter.py�
acceptNodeszNodeFilter.acceptNodeN)�__name__�
__module__�__qualname__�__doc__Z
FILTER_ACCEPTZ
FILTER_REJECTZFILTER_SKIPZSHOW_ALLZSHOW_ELEMENTZSHOW_ATTRIBUTEZ	SHOW_TEXTZSHOW_CDATA_SECTIONZSHOW_ENTITY_REFERENCEZSHOW_ENTITYZSHOW_PROCESSING_INSTRUCTIONZSHOW_COMMENTZ
SHOW_DOCUMENTZSHOW_DOCUMENT_TYPEZSHOW_DOCUMENT_FRAGMENTZ
SHOW_NOTATIONrrrrrrs$rN)rrrrr�<module>�xml/dom/__pycache__/expatbuilder.cpython-38.pyc000064400000065317151153537540015500 0ustar00U

e5d���@sdZddlmZmZmZddlmZmZmZddlm	Z	ddl
mZmZddl
mZejZejZejZejjZejjZejjZejjZe��Ze�dd�e�dd	�e�dd
�e�dd�e�dd�e�dd
�e�dd�e�dd�e�dd�d�	ZGdd�de�Zdd�Zdd�ZGdd�d�ZeeefZ Gdd�de�Z!Gdd�de�Z"Gdd�de"�Z#Gd d!�d!e"�Z$d"Z%d#e%Z&Gd$d%�d%e�Z'Gd&d'�d'�Z(Gd(d)�d)e(e�Z)Gd*d+�d+e(e'�Z*Gd,d-�d-e+�Z,Gd.d/�d/e�Z-d;d1d2�Z.d<d3d4�Z/d=d5d6�Z0d>d7d8�Z1d9d:�Z2dS)?z�Facility to use the Expat parser to load a minidom instance
from a string or file.

This avoids all the overhead of SAX and pulldom to gain performance.
�)�
xmlbuilder�minidom�Node)�EMPTY_NAMESPACE�EMPTY_PREFIX�XMLNS_NAMESPACE)�expat)�
_append_child�_set_attribute_node)�
NodeFilterNZcdata�enumeration�entity�entities�idZidrefZidrefsZnmtokenZnmtokens)	ZCDATA�ENUMZENTITYZENTITIES�IDZIDREFZIDREFSZNMTOKENZNMTOKENSc@sZeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)�ElementInfo��
_attr_info�_model�tagNameNcCs||_g|_||_dS�N)rrr)�selfr�model�r�,/usr/lib64/python3.8/xml/dom/expatbuilder.py�__init__?szElementInfo.__init__cCs|j|j|jfSrr�rrrr�__getstate__DszElementInfo.__getstate__cCs|\|_|_|_dSrr)r�staterrr�__setstate__GszElementInfo.__setstate__cCsN|jD]@}|d|kr|d}|ddkr6tdSt|dSqtjS)N����r�(r)r�
_typeinfo_mapr�_no_type)r�aname�info�trrr�getAttributeTypeJs
zElementInfo.getAttributeTypecCstjSr)rr%)r�namespaceURI�	localNamerrr�getAttributeTypeNSTszElementInfo.getAttributeTypeNScCs,|jr$|jd}|tjjtjjfkSdSdS�NrF)rrrZ
XML_CTYPE_ANYZXML_CTYPE_MIXED)r�typerrr�isElementContentWs
�zElementInfo.isElementContentcCs |jr|jdtjjkSdSdSr-)rrrZXML_CTYPE_EMPTYrrrr�isEmpty_szElementInfo.isEmptycCs,|jD] }|d|kr|ddkSqdS)Nr!r"rF)r)rr&r'rrr�isIdes
zElementInfo.isIdcCs|�||f�Sr)r1)rZeuriZenameZaurir&rrr�isIdNSkszElementInfo.isIdNS)N)
�__name__�
__module__�__qualname__�	__slots__rrr r)r,r/r0r1r2rrrrr<s

rcCs|�||�Sr)�_intern_setdefault)�builder�srrr�_internosr:cCs�d|kst�|�d�}|j}t|�dkr^|\}}}|||�}d||f}|||�}|||�}n4t|�dkr�|\}}t}|||�}}ntd|��|||�|||fS)N� �z%s:%s�z4Unsupported syntax: spaces in URIs not supported: %r)�AssertionError�splitr7�lenr�
ValueError)r8�name�parts�intern�uri�	localname�prefix�qnamerrr�_parse_ns_namers



rIc@s�eZdZdZd;dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�ZdS)<�ExpatBuilderzPDocument builder that uses Expat to build a ParsedXML.DOM document
    instance.NcCsP|dkrt��}||_|jjdk	r2t|jj�|_nd|_t|_d|_|�	�dSr)
rZOptions�_options�filter�FilterVisibilityController�_filterr�_finish_start_element�_parser�reset)r�optionsrrrr�szExpatBuilder.__init__cCst��S)zCreate a new parser object.)r�ParserCreaterrrr�createParser�szExpatBuilder.createParsercCsF|js@|��|_|jjj|_d|j_d|j_d|j_|�|j�|jS)z7Return the parser object, creating a new one if needed.T)	rPrTrD�
setdefaultr7Zbuffer_textZordered_attributesZspecified_attributes�installrrrr�	getParser�s
zExpatBuilder.getParsercCs,t�tdd�|_|j|_|jj|_d|_dS)z6Free all data structures used during DOM construction.NF)�theDOMImplementationZcreateDocumentr�document�curNode�
_elem_info�_cdatarrrrrQ�s�
zExpatBuilder.resetcCs�|j|_|j|_|j|_|j|_|jj	r0|j
|_|j|_
|jjrH|j|_|jjrj|j|_|j|_|j|_n|j|_|j|_|j|_|j|_|j|_ dS)z>Install the callbacks needed to build the DOM into the parser.N)!�start_doctype_decl_handler�StartDoctypeDeclHandler�first_element_handler�StartElementHandler�end_element_handler�EndElementHandler�
pi_handler�ProcessingInstructionHandlerrKr�entity_decl_handler�EntityDeclHandler�notation_decl_handler�NotationDeclHandler�comments�comment_handler�CommentHandlerZcdata_sections�start_cdata_section_handler�StartCdataSectionHandler�end_cdata_section_handler�EndCdataSectionHandler�character_data_handler_cdata�CharacterDataHandler�character_data_handler�external_entity_ref_handler�ExternalEntityRefHandler�xml_decl_handlerZXmlDeclHandler�element_decl_handlerZElementDeclHandler�attlist_decl_handlerZAttlistDeclHandler�r�parserrrrrV�s$
zExpatBuilder.installcCs�|��}d}zH|�d�}|sqF|�|d�|r@|jjr@|�|�d}q|�dd�Wntk
rhYnX|j}|��d|_|S)zIParse a document from a file object, returning the document
        node.Ti@rF�N)	rW�read�ParserY�documentElement�
_setup_subset�ParseEscaperQrP)r�fileryZfirst_buffer�buffer�docrrr�	parseFile�s"

zExpatBuilder.parseFilecCsP|��}z|�|d�|�|�Wntk
r6YnX|j}|��d|_|S)z<Parse a document from a string, returning the document node.TN)rWr|r~rrYrQrP)r�stringryr�rrr�parseString�szExpatBuilder.parseStringcCs.|jjr*t�}|�|�|��}||jj_dS)z/Load the internal subset if there might be one.N)rY�doctype�InternalSubsetExtractorr��	getSubset�internalSubset)rr�Z	extractor�subsetrrrr~�s

zExpatBuilder._setup_subsetcCs�|jj�|||�}|j|_t|j|�||j_|jrj|j�|�tkrjd|j_|jj	d=d}d|j
_d|j
_|r�|dk	r�g|j
_g|j_d|j
_d|j
_|j|j
_dS�N���)rY�implementationZcreateDocumentType�
ownerDocumentr	r�rN�
acceptNode�
FILTER_REJECT�
childNodesrPrfrhr�_seq�	notationsrkrd�end_doctype_decl_handler�EndDoctypeDeclHandler)rZdoctypeName�systemId�publicId�has_internal_subsetr�rrrr]�s*�
z'ExpatBuilder.start_doctype_decl_handlercCs2|jjr|j|j_|j|j_|js.|js.t	|_
dSr)rKrirjrPrkrcrdr[rNr�_finish_end_elementrrrrr�s


z%ExpatBuilder.end_doctype_decl_handlercCs@|j�||�}t|j|�|jr<|j�|�tkr<|j�|�dSr)rYZcreateProcessingInstructionr	rZrNr�r��removeChild)r�target�data�noderrrrcszExpatBuilder.pi_handlercCs�|jj}|jrH|jr4|djtkr4|d�|�dS|j�|�}d|_nD|rv|djt	krv|d}|j
|}||_
dSt��}||_
|j|_
t|j|�dS)Nr�T)rZr�r\�_cdata_continue�nodeType�CDATA_SECTION_NODEZ
appendDatarYZcreateCDATASection�	TEXT_NODEr�r�Textr�r	)rr�r�r��valuerrrrps$�
z)ExpatBuilder.character_data_handler_cdatacCs^|jj}|r2|djtkr2|d}|j||_dSt��}|j||_|j|_t	|j|�dSr�)
rZr�r�r�r�rr�rYr�r	)rr�r�r�rrrrr&sz#ExpatBuilder.character_data_handlerc
Cs�|rdS|jjsdS|j�||||�}|dk	rF|j�|�}	|j�|	�|jjjj�|�|j	r||j	�
|�tkr||jjjjd=dSr�)rKrrYZ_create_entityZcreateTextNoder��appendr�r�rNr�r�)
rZ
entityNameZis_parameter_entityr��baser�r��notationNamer��childrrrre1s
�z ExpatBuilder.entity_decl_handlercCsJ|j�|||�}|jjjj�|�|jrF|j�|�tkrF|jjjjd=dSr�)	rYZ_create_notationr�r�r�r�rNr��
FILTER_ACCEPT)rr�r�r�r�r�rrrrgCsz"ExpatBuilder.notation_decl_handlercCs>|j�|�}t|j|�|jr:|j�|�tkr:|j�|�dSr)rYZ
createCommentr	rZrNr�r�r�)rr�r�rrrrjIszExpatBuilder.comment_handlercCsd|_d|_dS)NTF�r\r�rrrrrlOsz(ExpatBuilder.start_cdata_section_handlercCsd|_d|_dS)NFr�rrrrrnSsz&ExpatBuilder.end_cdata_section_handlercCsdS�Nr!r)r�contextr�r�r�rrrrsWsz(ExpatBuilder.external_entity_ref_handlercCs2|jdkr|jst|_|j|��_|�||�dSr)rNr[rr��start_element_handlerrWr`)rrB�
attributesrrrr_Zsz"ExpatBuilder.first_element_handlercCs�|j�|�}t|j|�||_|rptdt|�d�D]<}t�||tdt	�}||d}||_
|j|_t||�q2||jj
k	r�|�|�dS)Nrr=r!)rYZ
createElementr	rZ�ranger@r�Attrrrr�r�r
r}rO)rrBr�r��i�ar�rrrr�`s�z"ExpatBuilder.start_element_handlercCsj|jrf||jjkrdS|j�|�}|tkr4t|�n|tkrFt|�ndS|j|_	|j�
|�|��dSr)rNrYr}�startContainerr��Rejecter�FILTER_SKIP�Skipper�
parentNoderZr��unlink)rr�ZfiltrrrrOqs

z"ExpatBuilder._finish_start_elementcCs|j}|j|_|�|�dSr)rZr�r�)rrBrZrrrra�sz ExpatBuilder.end_element_handlercCs\|j�|j�}|r|�||�|jrX||jjkr4dS|j�|�tkrX|j	�
|�|��dSr)r[�getr�_handle_white_text_nodesrNrYr}r�r�rZr�r�)rrZr'rrrr��sz ExpatBuilder._finish_end_elementcCsZ|jjs|��sdSg}|jD]"}|jtkr|j��s|�|�q|D]}|�	|�qFdSr)
rKZwhitespace_in_element_contentr/r�r�r�r��stripr�r�)rr�r'�Lr�rrrr��s�
z%ExpatBuilder._handle_white_text_nodescCs>|j�|�}|dkr&t||�|j|<n|jdks4t�||_dSr)r[r�rrr>)rrBrr'rrrrv�s
z!ExpatBuilder.element_decl_handlerc
CsF|j�|�}|dkr&t|�}||j|<|j�d|dd|d||g�dS�Nr)r[r�rrr�)r�elemrBr.�defaultZrequiredr'rrrrw�s
�z!ExpatBuilder.attlist_decl_handlercCs2||j_||j_|dkr.|r&d|j_nd|j_dS)NrTF)rY�version�encoding�
standalone)rr�r�r�rrrru�s
zExpatBuilder.xml_decl_handler)N) r3r4r5�__doc__rrTrWrQrVr�r�r~r]r�rcrprrrergrjrlrnrsr_r�rOrar�r�rvrwrurrrrrJ�s:

rJc@s�eZdZdZdZdd�Zdd�Zdd�Zej	e
jeje
j
eje
jeje
jeje
jeje
jeje
jeje
jeje
jeje
jeje
jej e
j!iZ"d	S)
rMzoWrapper around a DOMBuilderFilter which implements the checks
    to make the whatToShow filter attribute work.�rLcCs
||_dSrr�)rrLrrrr�sz#FilterVisibilityController.__init__cCsT|j|j}|jj|@rL|j�|�}|tkr0t�|tkrHtdt	|���|St
SdS)Nz)startContainer() returned illegal value: )�_nodetype_maskr�rL�
whatToShowr��FILTER_INTERRUPTr�_ALLOWED_FILTER_RETURNSrA�reprr�)rr��mask�valrrrr��s
�z)FilterVisibilityController.startContainercCs�|j|j}|jj|@r||j�|�}|tkr0t�|tkr`|j}|j	dd�D]}|�
|�qLtS|tkrxt
dt|���|StSdS)Nz%acceptNode() returned illegal value: )r�r�rLr�r�r�rr�r�r�ZappendChildr�r�rAr�r�)rr�r�r��parentr�rrrr��s 
�z%FilterVisibilityController.acceptNodeN)#r3r4r5r�r6rr�r�rZELEMENT_NODErZSHOW_ELEMENTZATTRIBUTE_NODEZSHOW_ATTRIBUTEr�Z	SHOW_TEXTr�ZSHOW_CDATA_SECTIONZENTITY_REFERENCE_NODEZSHOW_ENTITY_REFERENCEZENTITY_NODEZSHOW_ENTITYZPROCESSING_INSTRUCTION_NODEZSHOW_PROCESSING_INSTRUCTIONZCOMMENT_NODEZSHOW_COMMENT�
DOCUMENT_NODEZ
SHOW_DOCUMENTZDOCUMENT_TYPE_NODEZSHOW_DOCUMENT_TYPEZDOCUMENT_FRAGMENT_NODEZSHOW_DOCUMENT_FRAGMENTZ
NOTATION_NODEZ
SHOW_NOTATIONr�rrrrrM�s<
�rMc@seZdZdZdd�ZdS)�FilterCrutch)�_builder�_level�
_old_start�_old_endcCs6d|_||_|j}|j|_|j|_|j|_|j|_dSr�)	r�r�rPr`r�rbr�r�ra)rr8ryrrrrszFilterCrutch.__init__N)r3r4r5r6rrrrrr�sr�c@s(eZdZdZdd�Zdd�Zdd�ZdS)	r�rcCs,t�||�|j}dD]}t||d�qdS)N)rdrkrqrmrort)r�rrP�setattr)rr8ryrBrrrrszRejecter.__init__cGs|jd|_dSr�)r��r�argsrrrr�szRejecter.start_element_handlercGs@|jdkr0|jj}|j�|�|j|_|j|_n|jd|_dS�Nrr!)r�r�rPrVr�r`r�rb)rr�ryrrrra s

zRejecter.end_element_handlerN)r3r4r5r6rr�rarrrrr�sr�c@s eZdZdZdd�Zdd�ZdS)r�rcGs.|jj}|j|�|jj|k	r*|jd|_dSr�)r�rZr�r�)rr�r�rrrr�-s
zSkipper.start_element_handlercGsD|jdkr*|j|jj_|j|jj_d|_n|jd|_|j|�dSr�)r�r�r�rPr`r�rbr�rrrra3s
zSkipper.end_element_handlerN)r3r4r5r6r�rarrrrr�*sr�z8http://xml.python.org/entities/fragment-builder/internalz�<!DOCTYPE wrapper
  %%s [
  <!ENTITY fragment-builder-internal
    SYSTEM "%s">
%%s
]>
<wrapper %%s
>&fragment-builder-internal;</wrapper>c@sJeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�FragmentBuilderz�Builder which constructs document fragments given XML source
    text and a context node.

    The context node is expected to provide information about the
    namespace declarations which are in scope at the start of the
    fragment.
    NcCs6|jtkr||_||_n|j|_||_t�||�dSr)r�r��originalDocumentr�r�rJr)rr�rRrrrr[s
zFragmentBuilder.__init__cCst�|�d|_dSr)rJrQ�fragmentrrrrrQds
zFragmentBuilder.resetcCs|�|���S)zRParse a document fragment from a file object, returning the
        fragment node.)r�r{�rr�rrrr�hszFragmentBuilder.parseFilec	Cs�||_|��}|jj}d}|rV|jp*|��}|jrDd|j|jf}qZ|jrZd|j}nd}|��}t	|||f}z|�
|d�Wn|���YnX|j}|��|S)zMParse a document fragment from a string, returning the
        fragment node.rzzPUBLIC "%s" "%s"zSYSTEM "%s"r!)
�_sourcerWr�r�r��_getDeclarationsr�r��_getNSattrs�_FRAGMENT_BUILDER_TEMPLATEr|rQr�)	rr�ryr�Zidentr�ZnsattrsrYr�rrrr�ms.
�zFragmentBuilder.parseStringcCs|jjj}d}|�rt|jj�D]R}|j�|�}|r<|d}d||jf}|jrdd||j|j	f}q d||j	f}q t|j
j�D]�}|j
�|�}|r�|d}d||jf}|jr�d||j|j	f}n&|j	r�d||j	f}nd	||jjf}|j
r�d
||j
f}|d}q�|S)z�Re-create the internal subset from the DocumentType node.

        This is only needed if we don't already have the
        internalSubset as a string.
        rzz
  z%s<!NOTATION %sz!%s PUBLIC "%s"
             "%s">z%s SYSTEM "%s">z
%s<!ENTITY %sz %s PUBLIC "%s"
             "%s"z%s SYSTEM "%s"z%s "%s"z%s NOTATION %s�>)r�r�r�r�r�Zlength�item�nodeNamer�r�rZ
firstChildr�r�)rr�r9r�Znotationr
rrrr��s:
��
z FragmentBuilder._getDeclarationscCsdS)Nrzrrrrrr��szFragmentBuilder._getNSattrscCs~|tkrh|j}|j}|j�|�}|j|_|j��|_|j|_z|�	|jd�W5||_||_d|_XdSt
�|||||�SdS)Nr!r�)�$_FRAGMENT_BUILDER_INTERNAL_SYSTEM_IDrYrZrPZExternalEntityParserCreater�ZcreateDocumentFragmentr�r�r|rJrs)rr�r�r�r�Zold_documentZold_cur_noderyrrrrs�s(�z+FragmentBuilder.external_entity_ref_handler)N)r3r4r5r�rrQr�r�r�r�rsrrrrr�Rs
	$r�c@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�
Namespacesz7Mix-in class for builders; adds support for namespaces.cCs
g|_dSr)�_ns_ordered_prefixesrrrr�_initNamespaces�szNamespaces._initNamespacescCstjdd�}d|_|S)z'Create a new namespace-handling parser.r;)Znamespace_separatorT)rrSZnamespace_prefixesrxrrrrT�szNamespaces.createParsercCs t�||�|jjr|j|_dS)z.Insert the namespace-handlers onto the parser.N)rJrVrKZnamespace_declarations�start_namespace_decl_handlerZStartNamespaceDeclHandlerrxrrrrV�s�zNamespaces.installcCs|j�||f�dS)z/Push this namespace declaration on our storage.N)r�r�)rrGrErrrr��sz'Namespaces.start_namespace_decl_handlercCs�d|krt||�\}}}}nt}|}d}t}t�||||�}|j|_t|j|�||_|j	r�|j	D]P\}}|r�t�
t|d|�t|d�}nt�
dtdt�}||_
|j|_t||�qb|j	dd�=|�r~|��|j}	|j}
tdt|�d�D]�}||}||d}
d|k�rDt||�\}}}}t�
||||�}||	|<||
||f<n$t�
|t|t�}||	|<||
t|f<|j|_|
|_
||_q�dS)Nr;�xmlns:�xmlnsrr=r!)rIrrrZElementrYr�r	rZr�r�r:rr�r
Z_ensure_attributes�_attrs�_attrsNSr�r@ZownerElement)rrBr�rErFrGrHr�r�r�r�r�r&r�rrrr��s^��
�z Namespaces.start_element_handlercCs�|j}d|krHt||�\}}}}|j|kr>|j|kr>|j|ksltd��n$|j|ksZtd��|jtksltd��|j|_|�	|�dS)Nr;z$element stack messed up! (namespace)z&element stack messed up - bad nodeNamez*element stack messed up - bad namespaceURI)
rZrIr*r+rGr>r�rr�r�)rrBrZrErFrGrHrrrras$
�����zNamespaces.end_element_handlerN)
r3r4r5r�r�rTrVr�r�rarrrrr��s5r�c@seZdZdZdd�ZdS)�ExpatBuilderNSz*Document builder that supports namespaces.cCst�|�|��dSr)rJrQr�rrrrrQ)s
zExpatBuilderNS.resetN)r3r4r5r�rQrrrrr�&sr�c@s eZdZdZdd�Zdd�ZdS)�FragmentBuilderNSz*Fragment builder that supports namespaces.cCst�|�|��dSr)r�rQr�rrrrrQ1s
zFragmentBuilderNS.resetcCs�d}|j}g}|r~t|d�rv|j��D]N\}}||kr8q&|�|�|rPd|}nd}|rhd|||f}q&d||f}q&|j}q|S)zNReturn string of namespace attributes from this element and
        ancestors.rz�_ns_prefix_urir�r�z%s
    %s='%s'z %s='%s')r��hasattrr��itemsr�r�)r�attrsr�r�rGrEZdeclnamerrrr�5s"


zFragmentBuilderNS._getNSattrsN)r3r4r5r�rQr�rrrrr�.sr�c@seZdZdZdS)rzEException raised to short-circuit parsing in InternalSubsetExtractor.N)r3r4r5r�rrrrrSsrc@sLeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�ZdS)r�zBXML processor which can rip out the internal document type subset.NcCs|jS)z'Return the internal subset as a string.)r�rrrrr�\sz!InternalSubsetExtractor.getSubsetcCs*zt�||�Wntk
r$YnXdSr)rJr�rr�rrrr�`sz!InternalSubsetExtractor.parseFilecCs*zt�||�Wntk
r$YnXdSr)rJr�r)rr�rrrr�fsz#InternalSubsetExtractor.parseStringcCs|j|_|j|_dSr)r]r^r�r`rxrrrrVlszInternalSubsetExtractor.installcCs0|r&|��}g|_|jj|_|j|_nt��dSr)rWr�r�ZDefaultHandlerr�r�r)rrBr�r�r�ryrrrr]ps

z2InternalSubsetExtractor.start_doctype_decl_handlercCs,d�|j��dd��dd�}||_t��dS)Nrzz
�
�
)�joinr��replacer)rr9rrrr�zsz0InternalSubsetExtractor.end_doctype_decl_handlercCs
t��dSr)r)rrBr�rrrr�sz-InternalSubsetExtractor.start_element_handler)r3r4r5r�r�r�r�r�rVr]r�r�rrrrr�Ws
r�Tc	CsL|rt�}nt�}t|t�r>t|d��}|�|�}W5QRXn
|�|�}|S)z{Parse a document, returning the resulting Document node.

    'file' may be either a file name or an open file object.
    �rb)r�rJ�
isinstance�str�openr�)r��
namespacesr8�fp�resultrrr�parse�s

r�cCs|rt�}nt�}|�|�S)zOParse a document from a string, returning the resulting
    Document node.
    )r�rJr�)r�r�r8rrrr��sr�c	CsP|rt|�}nt|�}t|t�rBt|d��}|�|�}W5QRXn
|�|�}|S)z�Parse a fragment of a document, given the context from which it
    was originally extracted.  context should be the parent of the
    node(s) which are in the fragment.

    'file' may be either a file name or an open file object.
    r�)r�r�r�r�r�r�)r�r�r�r8r�r�rrr�
parseFragment�s


r�cCs |rt|�}nt|�}|�|�S)z�Parse a fragment of a document from a string, given the context
    from which it was originally extracted.  context should be the
    parent of the node(s) which are in the fragment.
    )r�r�r�)r�r�r�r8rrr�parseFragmentString�s
r�cCs|jrt|�St|�SdS)z,Create a builder based on an Options object.N)r�r�rJ)rRrrr�makeBuilder�sr�)T)T)T)T)3r�Zxml.domrrrrrrZxml.parsersrZxml.dom.minidomr	r
Zxml.dom.NodeFilterrr�r�r�ZDOMBuilderFilterr�r�r�r�ZgetDOMImplementationrXZTypeInfor$�objectrr:rIrJr�rMr�r�r�r�r�r�r�r�r��	Exceptionrr�r�r�r�r�r�rrrr�<module>sf








�3C
:�	��
u_%,



xml/dom/__pycache__/minicompat.cpython-38.opt-2.pyc000064400000004652151153537540016103 0ustar00U

e5d'
�@sFddddgZddlZefZGdd�de�ZGdd�de�Zdd�Z	dS)	�NodeList�
EmptyNodeList�StringTypes�defproperty�Nc@s>eZdZdZdd�Zdd�Zdd�Zeeedd	�Zd
d�Z	dS)
r�cCs(d|krt|�kr$nn||SdS�Nr��len��self�indexrr�*/usr/lib64/python3.8/xml/dom/minicompat.py�item5sz
NodeList.itemcCst|�S�Nr�rrrr
�_get_length9szNodeList._get_lengthcCstj�d��dS�Nz.attempt to modify read-only attribute 'length'��xml�dom�NoModificationAllowedErr�r�valuerrr
�_set_length<s�zNodeList._set_length�$The number of nodes in the NodeList.��doccCs|dkrg}||dd�<dSrr)r�staterrr
�__setstate__DszNodeList.__setstate__N)
�__name__�
__module__�__qualname__�	__slots__rrr�property�lengthrrrrr
r2s�c@sFeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Ze	eedd
�Z
dS)rrcCst�}|�|�|Sr�r�extend�r�other�NLrrr
�__add__Ms
zEmptyNodeList.__add__cCst�}|�|�|Srr%r'rrr
�__radd__Rs
zEmptyNodeList.__radd__cCsdSrrr
rrr
rWszEmptyNodeList.itemcCsdSrrrrrr
rZszEmptyNodeList._get_lengthcCstj�d��dSrrrrrr
r]s�zEmptyNodeList._set_lengthrrN)rr r!r"r*r+rrrr#r$rrrr
rJs�cCs8t|d|�}|fdd�}t|||d�}t|||�dS)NZ_get_cSstj�dt|���dS)Nz&attempt to modify read-only attribute )rrr�repr)rr�namerrr
�setgs
�zdefproperty.<locals>.setr)�getattrr#�setattr)�klassr-r�getr.Zproprrr
res)
�__all__Zxml.domr�strr�listr�tuplerrrrrr
�<module>+s
xml/dom/__pycache__/__init__.cpython-38.opt-2.pyc000064400000011201151153537540015466 0ustar00U

e5d��@s�Gdd�d�ZdZdZdZdZdZdZdZd	Zd
Z	dZ
dZd
ZdZ
dZdZdZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGd d!�d!e�ZGd"d#�d#e�ZGd$d%�d%e�ZGd&d'�d'e�ZGd(d)�d)e�ZGd*d+�d+e�ZGd,d-�d-e�ZGd.d/�d/e�Z Gd0d1�d1e�Z!Gd2d3�d3e�Z"Gd4d5�d5�Z#d6Z$d7Z%d8Z&d9Z'd9Z(dd:l)m*Z*m+Z+d9S);c@s@eZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdS)�Node����������	�
��N)�__name__�
__module__�__qualname__�	__slots__ZELEMENT_NODEZATTRIBUTE_NODEZ	TEXT_NODEZCDATA_SECTION_NODEZENTITY_REFERENCE_NODEZENTITY_NODEZPROCESSING_INSTRUCTION_NODEZCOMMENT_NODEZ
DOCUMENT_NODEZDOCUMENT_TYPE_NODEZDOCUMENT_FRAGMENT_NODEZ
NOTATION_NODErrr�(/usr/lib64/python3.8/xml/dom/__init__.pyrs	rrrrrrrr	r
rrr
r�
���c@seZdZdd�Zdd�ZdS)�DOMExceptioncOs(|jtkrtd��tj|f|�|�dS)Nz0DOMException should not be instantiated directly)�	__class__r�RuntimeError�	Exception�__init__)�self�args�kwrrrrBs

�zDOMException.__init__cCs|jS)N)�code)rrrr�	_get_codeHszDOMException._get_codeN)rrrrr!rrrrr>src@seZdZeZdS)�IndexSizeErrN)rrr�INDEX_SIZE_ERRr rrrrr"Lsr"c@seZdZeZdS)�DomstringSizeErrN)rrr�DOMSTRING_SIZE_ERRr rrrrr$Osr$c@seZdZeZdS)�HierarchyRequestErrN)rrr�HIERARCHY_REQUEST_ERRr rrrrr&Rsr&c@seZdZeZdS)�WrongDocumentErrN)rrr�WRONG_DOCUMENT_ERRr rrrrr(Usr(c@seZdZeZdS)�InvalidCharacterErrN)rrr�INVALID_CHARACTER_ERRr rrrrr*Xsr*c@seZdZeZdS)�NoDataAllowedErrN)rrr�NO_DATA_ALLOWED_ERRr rrrrr,[sr,c@seZdZeZdS)�NoModificationAllowedErrN)rrr�NO_MODIFICATION_ALLOWED_ERRr rrrrr.^sr.c@seZdZeZdS)�NotFoundErrN)rrr�
NOT_FOUND_ERRr rrrrr0asr0c@seZdZeZdS)�NotSupportedErrN)rrr�NOT_SUPPORTED_ERRr rrrrr2dsr2c@seZdZeZdS)�InuseAttributeErrN)rrr�INUSE_ATTRIBUTE_ERRr rrrrr4gsr4c@seZdZeZdS)�InvalidStateErrN)rrr�INVALID_STATE_ERRr rrrrr6jsr6c@seZdZeZdS)�	SyntaxErrN)rrr�
SYNTAX_ERRr rrrrr8msr8c@seZdZeZdS)�InvalidModificationErrN)rrr�INVALID_MODIFICATION_ERRr rrrrr:psr:c@seZdZeZdS)�NamespaceErrN)rrr�
NAMESPACE_ERRr rrrrr<ssr<c@seZdZeZdS)�InvalidAccessErrN)rrr�INVALID_ACCESS_ERRr rrrrr>vsr>c@seZdZeZdS)�
ValidationErrN)rrr�VALIDATION_ERRr rrrrr@ysr@c@seZdZdZdZdZdZdS)�UserDataHandlerrrrrN)rrrZNODE_CLONEDZ
NODE_IMPORTEDZNODE_DELETEDZNODE_RENAMEDrrrrrB|srBz$http://www.w3.org/XML/1998/namespacezhttp://www.w3.org/2000/xmlns/zhttp://www.w3.org/1999/xhtmlN)�getDOMImplementation�registerDOMImplementation),rr#r%r'r)r+r-r/r1r3r5r7r9r;r=r?rArrr"r$r&r(r*r,r.r0r2r4r6r8r:r<r>r@rBZ
XML_NAMESPACEZXMLNS_NAMESPACEZXHTML_NAMESPACEZEMPTY_NAMESPACEZEMPTY_PREFIXZdomregrCrDrrrr�<module>sP
xml/dom/__pycache__/xmlbuilder.cpython-38.opt-1.pyc000064400000030262151153537540016105 0ustar00U

e5ds0�@s�dZddlZddlZddlZddlmZdddgZGdd�d�ZGd	d�d�Z	d
d�Z
Gdd�de�ZGd
d�de�Z
Gdd�d�Z[Gdd�d�ZGdd�d�ZdS)z4Implementation of the DOM Level 3 'LS-Load' feature.�N)�
NodeFilter�
DOMBuilder�DOMEntityResolver�DOMInputSourcec@s\eZdZdZdZdZdZdZdZdZ	dZ
dZdZdZ
dZdZdZdZdZdZdZdZdZdS)�Optionsz�Features object that has variables set for each DOMBuilder feature.

    The DOMBuilder class uses an instance of this class to pass settings to
    the ExpatBuilder class.
    �TFN)�__name__�
__module__�__qualname__�__doc__�
namespaces�namespace_declarations�
validation�external_parameter_entities�external_general_entitiesZexternal_dtd_subset�validate_if_schemaZvalidate�datatype_normalization�create_entity_ref_nodes�entities�whitespace_in_element_content�cdata_sections�comments�charset_overrides_xml_encoding�infoset�supported_mediatypes_only�errorHandler�filter�rr�*/usr/lib64/python3.8/xml/dom/xmlbuilder.pyr
s(	rc@s&eZdZdZdZdZdZdZdZdZ	eeee	fZ
dd�Zdd	�Zd
d�Z
dd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdgdgdgdgdgdgd gd!gd"gd#gd"d$gd%gd&gd'gd(gd)gd*gd+gd,gd-ggdd!d"d$d(d.d'd+d-g	d/gd0gd1gd2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�ZdS)=rNr���cCst�|_dS�N)r�_options��selfrrr�__init__:szDOMBuilder.__init__cCs|jSr"��entityResolverr$rrr�_get_entityResolver=szDOMBuilder._get_entityResolvercCs
||_dSr"r')r%r(rrr�_set_entityResolver?szDOMBuilder._set_entityResolvercCs|jSr"�rr$rrr�_get_errorHandlerBszDOMBuilder._get_errorHandlercCs
||_dSr"r+)r%rrrr�_set_errorHandlerDszDOMBuilder._set_errorHandlercCs|jSr"�rr$rrr�_get_filterGszDOMBuilder._get_filtercCs
||_dSr"r.)r%rrrr�_set_filterIszDOMBuilder._set_filtercCs�|�|�rt|rdpd}z|jt|�|f}Wn(tk
rTtj�d|f�d�Yq�X|D]\}}t|j||�qZntj�	dt
|���dS)Nrrzunsupported feature: %rzunknown feature: )�supportsFeature�	_settings�_name_xform�KeyError�xml�dom�NotSupportedErr�setattrr#�NotFoundErr�repr)r%�name�stateZsettings�valuerrr�
setFeatureLs
��zDOMBuilder.setFeaturecCst|jt|��Sr")�hasattrr#r3)r%r;rrrr1ZszDOMBuilder.supportsFeaturecCst|�|rdpdf}||jkS)Nrr)r3r2)r%r;r<�keyrrr�
canSetFeature]szDOMBuilder.canSetFeature�r
r�r
r�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr)rr�rr�rr�rr)rBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrU)rr)rrrVrWrXcCs�t|�}zt|j|�WStk
r�|dkrp|j}|joj|joj|joj|joj|jph|j	ph|j
ph|jph|jYSt
j�dt|���YnXdS)Nrzfeature %s not known)r3�getattrr#�AttributeErrorrrrrr
rrrrr5r6r9r:)r%r;Zxname�optionsrrr�
getFeature�s0��������	zDOMBuilder.getFeaturecCs.|jr|j�d|�}nt��d|�}|�|�Sr")r(�
resolveEntityr�parse)r%�uri�inputrrr�parseURI�szDOMBuilder.parseURIcCsRt�|j�}|j|_|j|_|j}|dkrF|jrFddl}|j�|j�}|�	||�S�Nr)
�copyr#rr�
byteStream�systemId�urllib.request�requestZurlopen�_parse_bytestream)r%r`r[�fp�urllibrrrr^�szDOMBuilder.parsecCs||jkrtd��td��dS)Nznot a legal actionzHaven't written this yet...)�_legal_actions�
ValueError�NotImplementedError)r%r`Zcnode�actionrrr�parseWithContext�s
zDOMBuilder.parseWithContextcCs ddl}|jj�|�}|�|�Srb)Zxml.dom.expatbuilderr6ZexpatbuilderZmakeBuilderZ	parseFile)r%�streamr[r5Zbuilderrrrrh�szDOMBuilder._parse_bytestream)rr	r
r(rrZACTION_REPLACEZACTION_APPEND_AS_CHILDRENZACTION_INSERT_AFTERZACTION_INSERT_BEFORErkr&r)r*r,r-r/r0r>r1rAr2r\rar^rorhrrrrr-s���������������������������=
cCs|���dd�S)N�-�_)�lower�replace)r;rrrr3�sr3c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r)�_openerc
Cs�t�}||_||_|���|�|_|�|�|_ddl}ddl	}|j
�|�}|\}}}	}
}}|	r�|	�d�s�|�
|	�d}	|||	|
||f}|j
�|�|_|S)Nr�/)r�publicIdre�_get_opener�openrd�_guess_media_encoding�encoding�	posixpathZurllib.parser^Zurlparse�endswith�dirnameZ
urlunparse�baseURI)
r%rwre�sourcer|rj�partsZschemeZnetloc�pathZparamsZqueryZfragmentrrrr]�szDOMEntityResolver.resolveEntitycCs2z|jWStk
r,|��|_|jYSXdSr")rurZ�_create_openerr$rrrrx�s

zDOMEntityResolver._get_openercCsddl}|j��Srb)rfrgZbuild_opener)r%rjrrrr��sz DOMEntityResolver._create_openercCsF|j��}d|krB|��D]&}|�d�r|�dd�d��SqdS)NzContent-Typezcharset=�=r)rd�infoZgetplist�
startswith�splitrs)r%r�r�Zparamrrrrz�s


z'DOMEntityResolver._guess_media_encodingN)rr	r
�	__slots__r]rxr�rzrrrrr�s
c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd S)!r�rd�characterStream�
stringDatar{rwrercCs.d|_d|_d|_d|_d|_d|_d|_dSr"r�r$rrrr&szDOMInputSource.__init__cCs|jSr"�rdr$rrr�_get_byteStreamszDOMInputSource._get_byteStreamcCs
||_dSr"r�)r%rdrrr�_set_byteStreamszDOMInputSource._set_byteStreamcCs|jSr"�r�r$rrr�_get_characterStreamsz#DOMInputSource._get_characterStreamcCs
||_dSr"r�)r%r�rrr�_set_characterStreamsz#DOMInputSource._set_characterStreamcCs|jSr"�r�r$rrr�_get_stringDataszDOMInputSource._get_stringDatacCs
||_dSr"r�)r%�datarrr�_set_stringDataszDOMInputSource._set_stringDatacCs|jSr"�r{r$rrr�
_get_encodingszDOMInputSource._get_encodingcCs
||_dSr"r�)r%r{rrr�
_set_encodingszDOMInputSource._set_encodingcCs|jSr"�rwr$rrr�
_get_publicId"szDOMInputSource._get_publicIdcCs
||_dSr"r�)r%rwrrr�
_set_publicId$szDOMInputSource._set_publicIdcCs|jSr"�rer$rrr�
_get_systemId'szDOMInputSource._get_systemIdcCs
||_dSr"r�)r%rerrr�
_set_systemId)szDOMInputSource._set_systemIdcCs|jSr"�rr$rrr�_get_baseURI,szDOMInputSource._get_baseURIcCs
||_dSr"r��r%r_rrr�_set_baseURI.szDOMInputSource._set_baseURIN)rr	r
r�r&r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrs 	c@s>eZdZdZdZdZdZdZej	Z
dd�Zdd	�Zd
d�Z
dS)
�DOMBuilderFilterzSElement filter which can be used to tailor construction of
    a DOM instance.
    rrr r!cCs|jSr")�
whatToShowr$rrr�_get_whatToShowCsz DOMBuilderFilter._get_whatToShowcCs|jSr"��
FILTER_ACCEPT�r%Zelementrrr�
acceptNodeFszDOMBuilderFilter.acceptNodecCs|jSr"r�r�rrr�startContainerIszDOMBuilderFilter.startContainerN)rr	r
rr�Z
FILTER_REJECTZFILTER_SKIPZFILTER_INTERRUPTrZSHOW_ALLr�r�r�r�rrrrr�2s	r�c@sDeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dS)�
DocumentLSz=Mixin to create documents that conform to the load/save spec.FcCsdS)NFrr$rrr�
_get_asyncTszDocumentLS._get_asynccCs|rtj�d��dS)Nz.asynchronous document loading is not supported)r5r6r7)r%�flagrrr�
_set_asyncWs�zDocumentLS._set_asynccCstd��dS)Nz'haven't figured out what this means yet�rmr$rrr�abort\s�zDocumentLS.abortcCstd��dS�Nzhaven't written this yetr�r�rrr�loadbszDocumentLS.loadcCstd��dSr�r�)r%r�rrr�loadXMLeszDocumentLS.loadXMLcCs*|dkr|}n|j|k	r"tj���|��Sr")Z
ownerDocumentr5r6ZWrongDocumentErrZtoxml)r%Zsnoderrr�saveXMLhs


zDocumentLS.saveXMLN)rr	r
rZasync_r�r�r�r�r�r�rrrrr�Osr�c@s,eZdZdZdZdd�Zdd�Zdd�Zd	S)
�DOMImplementationLSrrcCsF|dk	rtj�d��||jkr$t�S||jkr:tj�d��td��dS)NzschemaType not yet supportedz'asynchronous builders are not supportedzunknown value for mode)r5r6r7�MODE_SYNCHRONOUSr�MODE_ASYNCHRONOUSrl)r%�modeZ
schemaTyperrr�createDOMBuilderts�

�z$DOMImplementationLS.createDOMBuildercCstd��dS)Nz-the writer interface hasn't been written yet!r�r$rrr�createDOMWriters�z#DOMImplementationLS.createDOMWritercCst�Sr")rr$rrr�createDOMInputSource�sz(DOMImplementationLS.createDOMInputSourceN)rr	r
r�r�r�r�r�rrrrr�ps
r�)rrc�warningsZxml.domr5Zxml.dom.NodeFilterr�__all__rrr3�objectrrr�r�r�rrrr�<module>s
 %,1!xml/dom/__pycache__/pulldom.cpython-38.opt-2.pyc000064400000024021151153537540015407 0ustar00U

e5d�.�@s�ddlZddlZdZdZdZdZdZdZdZ	d	Z
Gd
d�dejj�Z
Gdd
�d
�ZGdd�d�ZGdd�de
�ZdZddd�Zddd�ZdS)�N�
START_ELEMENT�END_ELEMENT�COMMENT�START_DOCUMENT�END_DOCUMENT�PROCESSING_INSTRUCTION�IGNORABLE_WHITESPACE�
CHARACTERSc@s�eZdZdZdZd$dd�Zdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�ZdS)%�PullDOMNcCszddlm}||_ddg|_|j|_g|_|jj|_z|jj|_Wnt	k
rVYnX|dig|_
|j
d|_g|_dS)Nr)�
XML_NAMESPACE�xml���)
Zxml.domr�documentFactory�
firstEvent�	lastEvent�elementStack�append�push�pop�AttributeError�_ns_contexts�_current_context�pending_events)�selfrr�r�'/usr/lib64/python3.8/xml/dom/pulldom.py�__init__s

zPullDOM.__init__cCs|jd}|jd=|S�Nr
)r)r�resultrrrr!s
zPullDOM.popcCs
||_dS�N)�_locator)rZlocatorrrr�setDocumentLocator&szPullDOM.setDocumentLocatorcCsHt|d�sg|_|j�|pd|f�|j�|j���|p<d|j|<dS)N�_xmlns_attrs�xmlns)�hasattrr"rrr�copy)r�prefix�urirrr�startPrefixMapping)s

zPullDOM.startPrefixMappingcCs|j��|_dSr)rrr)rr&rrr�endPrefixMapping0szPullDOM.endPrefixMappingcCs�d}t|dd�}|dk	r:|D]\}}||j||f<qg|_|\}}	|r�|dkrn|j|}
|
rj|
d|	}n|	}|jr�|j�||�}q�|�||�}n |jr�|j�|	�}n|�d|	�}|��D]�\}}|\}}
||k�r|
dkr�|
}nd|
}|j�	||�}|�
|�nX|�rF|j|}
|
�r(|
d|
}n|
}|j�	||�}|�
|�n|j�|
�}|�|�||_
q�t|fdg|jd<|jd|_|�|�dS)Nzhttp://www.w3.org/2000/xmlns/r"�:r#zxmlns:�)�getattr�_attrsr"r�documentZcreateElementNS�
buildDocument�
createElement�itemsZcreateAttributeNSZsetAttributeNodeNS�createAttribute�setAttributeNode�valuerrr)r�name�tagName�attrsZ	xmlns_uriZxmlns_attrs�anamer4r'Z	localnamer&�nodeZa_uriZa_localnameZqname�attrrrr�startElementNS3sP



zPullDOM.startElementNScCs&t|��fdg|jd<|jd|_dS�Nr+�rrr)rr5r6rrr�endElementNSlszPullDOM.endElementNScCsz|jr|j�|�}n|�d|�}|��D]$\}}|j�|�}||_|�|�q(t|fdg|jd<|jd|_|�	|�dSr<)
r.r0r/r1r2r4r3rrr)rr5r7r9r8r4r:rrr�startElementpszPullDOM.startElementcCs&t|��fdg|jd<|jd|_dSr<r=)rr5rrr�
endElementszPullDOM.endElementcCsN|jr2|j�|�}t|fdg|jd<|jd|_nt|fdg}|j�|�dSr<)r.�
createCommentrrrr)r�sr9�eventrrr�comment�szPullDOM.commentcCsR|jr4|j�||�}t|fdg|jd<|jd|_nt||fdg}|j�|�dSr<)r.�createProcessingInstructionrrrr)r�target�datar9rCrrr�processingInstruction�szPullDOM.processingInstructioncCs.|j�|�}t|fdg|jd<|jd|_dSr<)r.�createTextNoderr�r�charsr9rrr�ignorableWhitespace�szPullDOM.ignorableWhitespacecCs.|j�|�}t|fdg|jd<|jd|_dSr<)r.rIr	rrJrrr�
characters�szPullDOM.characterscCs$|jdkr ddl}|jjjj|_dS)Nr)rZxml.dom.minidomZdomZminidomZDocument�implementation)rrrrr�
startDocument�s
zPullDOM.startDocumentc	Cs�|j�||d�}||_t|fdg|jd<|jd|_|�|�|jD]�}|ddtkr�|d\}}}|j�||�}t|f|d<nD|ddt	kr�|j�
|dd�}t	|f|d<ntd|dd��||jd<||_qDd|_|jS)Nr+rzUnknown pending event )
rZcreateDocumentr.rrrrrrErrA�AssertionErrorZ
firstChild)	rr'Ztagnamer9�e�_rFrG�nrrrr/�s$


zPullDOM.buildDocumentcCs t|jfdg|jd<|��dSr<)rr.rr�rrrr�endDocument�szPullDOM.endDocumentcCs
d|_dSr)r.rTrrr�clear�sz
PullDOM.clear)N)�__name__�
__module__�__qualname__r r.rrr!r(r)r;r>r?r@rDrHrLrMrOr/rUrVrrrrr

s&
9		r
c@s$eZdZdd�Zdd�Zdd�ZdS)�ErrorHandlercCst|�dSr)�print�rZ	exceptionrrr�warning�szErrorHandler.warningcCs|�dSrrr\rrr�error�szErrorHandler.errorcCs|�dSrrr\rrr�
fatalError�szErrorHandler.fatalErrorN)rWrXrYr]r^r_rrrrrZ�srZc@s\eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)�DOMEventStreamcCs2||_||_||_t|jd�s&|j|_|��dS)N�feed)�stream�parser�bufsizer$�_slurp�getEvent�reset)rrbrcrdrrrr�szDOMEventStream.__init__cCs.t�|_|j�tjjjd�|j�|j�dSr<)	r
�pulldomrcZ
setFeaturer�saxZhandlerZfeature_namespacesZsetContentHandlerrTrrrrg�szDOMEventStream.resetcCs0ddl}|jdtdd�|��}|r(|St�dS)Nrz[DOMEventStream's __getitem__ method ignores 'pos' parameter. Use iterator protocol instead.�)�
stacklevel)�warnings�warn�DeprecationWarningrf�
IndexError)r�posrl�rcrrr�__getitem__�s�zDOMEventStream.__getitem__cCs|��}|r|St�dSr)rf�
StopIteration�rrqrrr�__next__�szDOMEventStream.__next__cCs|SrrrTrrr�__iter__�szDOMEventStream.__iter__cCsl|��}|g}|rh|\}}||kr&dS|tkr<|d�|�|tkrP|�|�n|tkr^|d=|��}qdSr)rfr�appendChildrr)rr9rC�parents�tokenZcur_noderrr�
expandNode�szDOMEventStream.expandNodecCs~|jjds|jj|j_|jjdsR|j�|j�}|sD|j��dS|j�|�q|jjdd}|jjdd|jjd<|S�Nr+r)	rhrrrb�readrdrc�closera)r�bufrqrrrrfs
zDOMEventStream.getEventcCs|j�|j�|j|_|��Sr)rc�parserb�_emitrfrTrrrreszDOMEventStream._slurpcCs,|jjdd}|jjdd|jjd<|Sr{)rhrrtrrrr�szDOMEventStream._emitcCs|j��|`d|_d|_dSr)rhrVrcrbrTrrrrV!s
zDOMEventStream.clearN)
rWrXrYrrgrrrurvrzrfrer�rVrrrrr`�s

r`c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�SAX2DOMcCs2t�||||�|jd}|jd}|�|�dS�Nr
���)r
r;rrw)rr5r6r7�curNode�
parentNoderrrr;*s

zSAX2DOM.startElementNScCs0t�|||�|jd}|jd}|�|�dSr�)r
r?rrw)rr5r7r�r�rrrr?0s

zSAX2DOM.startElementcCs4t�|||�|jdd}|jd}|�|�dS�Nrr+r
)r
rHrrrw)rrFrGr9r�rrrrH6s
zSAX2DOM.processingInstructioncCs2t�||�|jdd}|jd}|�|�dSr�)r
rLrrrw�rrKr9r�rrrrL<s
zSAX2DOM.ignorableWhitespacecCs2t�||�|jdd}|jd}|�|�dSr�)r
rMrrrwr�rrrrMBs
zSAX2DOM.charactersN)rWrXrYr;r?rHrLrMrrrrr�(s
r�i�?cCs@|dkrt}t|t�r"t|d�}n|}|s4tj��}t|||�S)N�rb)�default_bufsize�
isinstance�str�openrri�make_parserr`)Zstream_or_stringrcrdrbrrrrKs

rcCs6ddlm}t|�}||�}|s*tj��}t|||�S)Nr)�StringIO)�ior��lenrrir�r`)�stringrcr�rdr~rrr�parseStringVs
r�)NN)N)Zxml.saxrZxml.sax.handlerrrrrrrrr	riZContentHandlerr
rZr`r�r�rr�rrrr�<module>s"8\!
xml/dom/__pycache__/pulldom.cpython-38.pyc000064400000024705151153537540014460 0ustar00U

e5d�.�@s�ddlZddlZdZdZdZdZdZdZdZ	d	Z
Gd
d�dejj�Z
Gdd
�d
�ZGdd�d�ZGdd�de
�ZdZddd�Zddd�ZdS)�N�
START_ELEMENT�END_ELEMENT�COMMENT�START_DOCUMENT�END_DOCUMENT�PROCESSING_INSTRUCTION�IGNORABLE_WHITESPACE�
CHARACTERSc@s�eZdZdZdZd$dd�Zdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�ZdS)%�PullDOMNcCszddlm}||_ddg|_|j|_g|_|jj|_z|jj|_Wnt	k
rVYnX|dig|_
|j
d|_g|_dS)Nr)�
XML_NAMESPACE�xml���)
Zxml.domr�documentFactory�
firstEvent�	lastEvent�elementStack�append�push�pop�AttributeError�_ns_contexts�_current_context�pending_events)�selfrr�r�'/usr/lib64/python3.8/xml/dom/pulldom.py�__init__s

zPullDOM.__init__cCs|jd}|jd=|S�Nr
)r)r�resultrrrr!s
zPullDOM.popcCs
||_dS�N)�_locator)rZlocatorrrr�setDocumentLocator&szPullDOM.setDocumentLocatorcCsHt|d�sg|_|j�|pd|f�|j�|j���|p<d|j|<dS)N�_xmlns_attrs�xmlns)�hasattrr"rrr�copy)r�prefix�urirrr�startPrefixMapping)s

zPullDOM.startPrefixMappingcCs|j��|_dSr)rrr)rr&rrr�endPrefixMapping0szPullDOM.endPrefixMappingcCs�d}t|dd�}|dk	r:|D]\}}||j||f<qg|_|\}}	|r�|dkrn|j|}
|
rj|
d|	}n|	}|jr�|j�||�}q�|�||�}n |jr�|j�|	�}n|�d|	�}|��D]�\}}|\}}
||k�r|
dkr�|
}nd|
}|j�	||�}|�
|�nX|�rF|j|}
|
�r(|
d|
}n|
}|j�	||�}|�
|�n|j�|
�}|�|�||_
q�t|fdg|jd<|jd|_|�|�dS)Nzhttp://www.w3.org/2000/xmlns/r"�:r#zxmlns:�)�getattr�_attrsr"r�documentZcreateElementNS�
buildDocument�
createElement�itemsZcreateAttributeNSZsetAttributeNodeNS�createAttribute�setAttributeNode�valuerrr)r�name�tagName�attrsZ	xmlns_uriZxmlns_attrs�anamer4r'Z	localnamer&�nodeZa_uriZa_localnameZqname�attrrrr�startElementNS3sP



zPullDOM.startElementNScCs&t|��fdg|jd<|jd|_dS�Nr+�rrr)rr5r6rrr�endElementNSlszPullDOM.endElementNScCsz|jr|j�|�}n|�d|�}|��D]$\}}|j�|�}||_|�|�q(t|fdg|jd<|jd|_|�	|�dSr<)
r.r0r/r1r2r4r3rrr)rr5r7r9r8r4r:rrr�startElementpszPullDOM.startElementcCs&t|��fdg|jd<|jd|_dSr<r=)rr5rrr�
endElementszPullDOM.endElementcCsN|jr2|j�|�}t|fdg|jd<|jd|_nt|fdg}|j�|�dSr<)r.�
createCommentrrrr)r�sr9�eventrrr�comment�szPullDOM.commentcCsR|jr4|j�||�}t|fdg|jd<|jd|_nt||fdg}|j�|�dSr<)r.�createProcessingInstructionrrrr)r�target�datar9rCrrr�processingInstruction�szPullDOM.processingInstructioncCs.|j�|�}t|fdg|jd<|jd|_dSr<)r.�createTextNoderr�r�charsr9rrr�ignorableWhitespace�szPullDOM.ignorableWhitespacecCs.|j�|�}t|fdg|jd<|jd|_dSr<)r.rIr	rrJrrr�
characters�szPullDOM.characterscCs$|jdkr ddl}|jjjj|_dS)Nr)rZxml.dom.minidomZdomZminidomZDocument�implementation)rrrrr�
startDocument�s
zPullDOM.startDocumentc	Cs�|j�||d�}||_t|fdg|jd<|jd|_|�|�|jD]�}|ddtkr�|d\}}}|j�||�}t|f|d<nD|ddt	kr�|j�
|dd�}t	|f|d<ntd|dd��||jd<||_qDd|_|jS)Nr+rzUnknown pending event )
rZcreateDocumentr.rrrrrrErrA�AssertionErrorZ
firstChild)	rr'Ztagnamer9�e�_rFrG�nrrrr/�s$


zPullDOM.buildDocumentcCs t|jfdg|jd<|��dSr<)rr.rr�rrrr�endDocument�szPullDOM.endDocumentcCs
d|_dS)z.clear(): Explicitly release parsing structuresN)r.rTrrr�clear�sz
PullDOM.clear)N)�__name__�
__module__�__qualname__r r.rrr!r(r)r;r>r?r@rDrHrLrMrOr/rUrVrrrrr

s&
9		r
c@s$eZdZdd�Zdd�Zdd�ZdS)�ErrorHandlercCst|�dSr)�print�rZ	exceptionrrr�warning�szErrorHandler.warningcCs|�dSrrr\rrr�error�szErrorHandler.errorcCs|�dSrrr\rrr�
fatalError�szErrorHandler.fatalErrorN)rWrXrYr]r^r_rrrrrZ�srZc@s\eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)�DOMEventStreamcCs2||_||_||_t|jd�s&|j|_|��dS)N�feed)�stream�parser�bufsizer$�_slurp�getEvent�reset)rrbrcrdrrrr�szDOMEventStream.__init__cCs.t�|_|j�tjjjd�|j�|j�dSr<)	r
�pulldomrcZ
setFeaturer�saxZhandlerZfeature_namespacesZsetContentHandlerrTrrrrg�szDOMEventStream.resetcCs0ddl}|jdtdd�|��}|r(|St�dS)Nrz[DOMEventStream's __getitem__ method ignores 'pos' parameter. Use iterator protocol instead.�)�
stacklevel)�warnings�warn�DeprecationWarningrf�
IndexError)r�posrl�rcrrr�__getitem__�s�zDOMEventStream.__getitem__cCs|��}|r|St�dSr)rf�
StopIteration�rrqrrr�__next__�szDOMEventStream.__next__cCs|SrrrTrrr�__iter__�szDOMEventStream.__iter__cCsl|��}|g}|rh|\}}||kr&dS|tkr<|d�|�|tkrP|�|�n|tkr^|d=|��}qdSr)rfr�appendChildrr)rr9rC�parents�tokenZcur_noderrr�
expandNode�szDOMEventStream.expandNodecCs~|jjds|jj|j_|jjdsR|j�|j�}|sD|j��dS|j�|�q|jjdd}|jjdd|jjd<|S)Nr+r)	rhrrrb�readrdrc�closera)r�bufrqrrrrfs
zDOMEventStream.getEventcCs|j�|j�|j|_|��S)z� Fallback replacement for getEvent() using the
            standard SAX2 interface, which means we slurp the
            SAX events into memory (no performance gain, but
            we are compatible to all SAX parsers).
        )rc�parserb�_emitrfrTrrrreszDOMEventStream._slurpcCs,|jjdd}|jjdd|jjd<|S)zn Fallback replacement for getEvent() that emits
            the events that _slurp() read previously.
        r+r)rhrrtrrrrszDOMEventStream._emitcCs|j��|`d|_d|_dS)z+clear(): Explicitly release parsing objectsN)rhrVrcrbrTrrrrV!s
zDOMEventStream.clearN)
rWrXrYrrgrrrurvrzrfrerrVrrrrr`�s

r`c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�SAX2DOMcCs2t�||||�|jd}|jd}|�|�dS�Nr
���)r
r;rrw)rr5r6r7�curNode�
parentNoderrrr;*s

zSAX2DOM.startElementNScCs0t�|||�|jd}|jd}|�|�dSr�)r
r?rrw)rr5r7r�r�rrrr?0s

zSAX2DOM.startElementcCs4t�|||�|jdd}|jd}|�|�dS�Nrr+r
)r
rHrrrw)rrFrGr9r�rrrrH6s
zSAX2DOM.processingInstructioncCs2t�||�|jdd}|jd}|�|�dSr�)r
rLrrrw�rrKr9r�rrrrL<s
zSAX2DOM.ignorableWhitespacecCs2t�||�|jdd}|jd}|�|�dSr�)r
rMrrrwr�rrrrMBs
zSAX2DOM.charactersN)rWrXrYr;r?rHrLrMrrrrr�(s
r�i�?cCs@|dkrt}t|t�r"t|d�}n|}|s4tj��}t|||�S)N�rb)�default_bufsize�
isinstance�str�openrri�make_parserr`)Zstream_or_stringrcrdrbrrrr~Ks

r~cCs6ddlm}t|�}||�}|s*tj��}t|||�S)Nr)�StringIO)�ior��lenrrir�r`)�stringrcr�rdr}rrr�parseStringVs
r�)NN)N)Zxml.saxrZxml.sax.handlerrrrrrrrr	riZContentHandlerr
rZr`r�r�r~r�rrrr�<module>s"8\!
xml/dom/__pycache__/xmlbuilder.cpython-38.pyc000064400000030320151153537540015141 0ustar00U

e5ds0�@s�dZddlZddlZddlZddlmZdddgZGdd�d�ZGd	d�d�Z	d
d�Z
Gdd�de�ZGd
d�de�Z
Gdd�d�Z[Gdd�d�ZGdd�d�ZdS)z4Implementation of the DOM Level 3 'LS-Load' feature.�N)�
NodeFilter�
DOMBuilder�DOMEntityResolver�DOMInputSourcec@s\eZdZdZdZdZdZdZdZdZ	dZ
dZdZdZ
dZdZdZdZdZdZdZdZdZdS)�Optionsz�Features object that has variables set for each DOMBuilder feature.

    The DOMBuilder class uses an instance of this class to pass settings to
    the ExpatBuilder class.
    �TFN)�__name__�
__module__�__qualname__�__doc__�
namespaces�namespace_declarations�
validation�external_parameter_entities�external_general_entitiesZexternal_dtd_subset�validate_if_schemaZvalidate�datatype_normalization�create_entity_ref_nodes�entities�whitespace_in_element_content�cdata_sections�comments�charset_overrides_xml_encoding�infoset�supported_mediatypes_only�errorHandler�filter�rr�*/usr/lib64/python3.8/xml/dom/xmlbuilder.pyr
s(	rc@s&eZdZdZdZdZdZdZdZdZ	eeee	fZ
dd�Zdd	�Zd
d�Z
dd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdgdgdgdgdgdgd gd!gd"gd#gd"d$gd%gd&gd'gd(gd)gd*gd+gd,gd-ggdd!d"d$d(d.d'd+d-g	d/gd0gd1gd2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�ZdS)=rNr���cCst�|_dS�N)r�_options��selfrrr�__init__:szDOMBuilder.__init__cCs|jSr"��entityResolverr$rrr�_get_entityResolver=szDOMBuilder._get_entityResolvercCs
||_dSr"r')r%r(rrr�_set_entityResolver?szDOMBuilder._set_entityResolvercCs|jSr"�rr$rrr�_get_errorHandlerBszDOMBuilder._get_errorHandlercCs
||_dSr"r+)r%rrrr�_set_errorHandlerDszDOMBuilder._set_errorHandlercCs|jSr"�rr$rrr�_get_filterGszDOMBuilder._get_filtercCs
||_dSr"r.)r%rrrr�_set_filterIszDOMBuilder._set_filtercCs�|�|�rt|rdpd}z|jt|�|f}Wn(tk
rTtj�d|f�d�Yq�X|D]\}}t|j||�qZntj�	dt
|���dS)Nrrzunsupported feature: %rzunknown feature: )�supportsFeature�	_settings�_name_xform�KeyError�xml�dom�NotSupportedErr�setattrr#�NotFoundErr�repr)r%�name�stateZsettings�valuerrr�
setFeatureLs
��zDOMBuilder.setFeaturecCst|jt|��Sr")�hasattrr#r3)r%r;rrrr1ZszDOMBuilder.supportsFeaturecCst|�|rdpdf}||jkS)Nrr)r3r2)r%r;r<�keyrrr�
canSetFeature]szDOMBuilder.canSetFeature�r
r�r
r�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr�rr)rr�rr�rr�rr)rBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrU)rr)rrrVrWrXcCs�t|�}zt|j|�WStk
r�|dkrp|j}|joj|joj|joj|joj|jph|j	ph|j
ph|jph|jYSt
j�dt|���YnXdS)Nrzfeature %s not known)r3�getattrr#�AttributeErrorrrrrr
rrrrr5r6r9r:)r%r;Zxname�optionsrrr�
getFeature�s0��������	zDOMBuilder.getFeaturecCs.|jr|j�d|�}nt��d|�}|�|�Sr")r(�
resolveEntityr�parse)r%�uri�inputrrr�parseURI�szDOMBuilder.parseURIcCsRt�|j�}|j|_|j|_|j}|dkrF|jrFddl}|j�|j�}|�	||�S�Nr)
�copyr#rr�
byteStream�systemId�urllib.request�requestZurlopen�_parse_bytestream)r%r`r[�fp�urllibrrrr^�szDOMBuilder.parsecCs||jkrtd��td��dS)Nznot a legal actionzHaven't written this yet...)�_legal_actions�
ValueError�NotImplementedError)r%r`Zcnode�actionrrr�parseWithContext�s
zDOMBuilder.parseWithContextcCs ddl}|jj�|�}|�|�Srb)Zxml.dom.expatbuilderr6ZexpatbuilderZmakeBuilderZ	parseFile)r%�streamr[r5Zbuilderrrrrh�szDOMBuilder._parse_bytestream)rr	r
r(rrZACTION_REPLACEZACTION_APPEND_AS_CHILDRENZACTION_INSERT_AFTERZACTION_INSERT_BEFORErkr&r)r*r,r-r/r0r>r1rAr2r\rar^rorhrrrrr-s���������������������������=
cCs|���dd�S)N�-�_)�lower�replace)r;rrrr3�sr3c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r)�_openerc
Cs�|dk	st�t�}||_||_|���|�|_|�|�|_ddl	}ddl
}|j�|�}|\}}}	}
}}|	r�|	�
d�s�|�|	�d}	|||	|
||f}|j�|�|_|S)Nr�/)�AssertionErrorr�publicIdre�_get_opener�openrd�_guess_media_encoding�encoding�	posixpathZurllib.parser^Zurlparse�endswith�dirnameZ
urlunparse�baseURI)
r%rxre�sourcer}rj�partsZschemeZnetloc�pathZparamsZqueryZfragmentrrrr]�szDOMEntityResolver.resolveEntitycCs2z|jWStk
r,|��|_|jYSXdSr")rurZ�_create_openerr$rrrry�s

zDOMEntityResolver._get_openercCsddl}|j��Srb)rfrgZbuild_opener)r%rjrrrr��sz DOMEntityResolver._create_openercCsF|j��}d|krB|��D]&}|�d�r|�dd�d��SqdS)NzContent-Typezcharset=�=r)rd�infoZgetplist�
startswith�splitrs)r%r�r�Zparamrrrr{�s


z'DOMEntityResolver._guess_media_encodingN)rr	r
�	__slots__r]ryr�r{rrrrr�s
c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd S)!r�rd�characterStream�
stringDatar|rxrer�cCs.d|_d|_d|_d|_d|_d|_d|_dSr"r�r$rrrr&szDOMInputSource.__init__cCs|jSr"�rdr$rrr�_get_byteStreamszDOMInputSource._get_byteStreamcCs
||_dSr"r�)r%rdrrr�_set_byteStreamszDOMInputSource._set_byteStreamcCs|jSr"�r�r$rrr�_get_characterStreamsz#DOMInputSource._get_characterStreamcCs
||_dSr"r�)r%r�rrr�_set_characterStreamsz#DOMInputSource._set_characterStreamcCs|jSr"�r�r$rrr�_get_stringDataszDOMInputSource._get_stringDatacCs
||_dSr"r�)r%�datarrr�_set_stringDataszDOMInputSource._set_stringDatacCs|jSr"�r|r$rrr�
_get_encodingszDOMInputSource._get_encodingcCs
||_dSr"r�)r%r|rrr�
_set_encodingszDOMInputSource._set_encodingcCs|jSr"�rxr$rrr�
_get_publicId"szDOMInputSource._get_publicIdcCs
||_dSr"r�)r%rxrrr�
_set_publicId$szDOMInputSource._set_publicIdcCs|jSr"�rer$rrr�
_get_systemId'szDOMInputSource._get_systemIdcCs
||_dSr"r�)r%rerrr�
_set_systemId)szDOMInputSource._set_systemIdcCs|jSr"�r�r$rrr�_get_baseURI,szDOMInputSource._get_baseURIcCs
||_dSr"r��r%r_rrr�_set_baseURI.szDOMInputSource._set_baseURIN)rr	r
r�r&r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrs 	c@s>eZdZdZdZdZdZdZej	Z
dd�Zdd	�Zd
d�Z
dS)
�DOMBuilderFilterzSElement filter which can be used to tailor construction of
    a DOM instance.
    rrr r!cCs|jSr")�
whatToShowr$rrr�_get_whatToShowCsz DOMBuilderFilter._get_whatToShowcCs|jSr"��
FILTER_ACCEPT�r%Zelementrrr�
acceptNodeFszDOMBuilderFilter.acceptNodecCs|jSr"r�r�rrr�startContainerIszDOMBuilderFilter.startContainerN)rr	r
rr�Z
FILTER_REJECTZFILTER_SKIPZFILTER_INTERRUPTrZSHOW_ALLr�r�r�r�rrrrr�2s	r�c@sDeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dS)�
DocumentLSz=Mixin to create documents that conform to the load/save spec.FcCsdS)NFrr$rrr�
_get_asyncTszDocumentLS._get_asynccCs|rtj�d��dS)Nz.asynchronous document loading is not supported)r5r6r7)r%�flagrrr�
_set_asyncWs�zDocumentLS._set_asynccCstd��dS)Nz'haven't figured out what this means yet�rmr$rrr�abort\s�zDocumentLS.abortcCstd��dS�Nzhaven't written this yetr�r�rrr�loadbszDocumentLS.loadcCstd��dSr�r�)r%r�rrr�loadXMLeszDocumentLS.loadXMLcCs*|dkr|}n|j|k	r"tj���|��Sr")Z
ownerDocumentr5r6ZWrongDocumentErrZtoxml)r%Zsnoderrr�saveXMLhs


zDocumentLS.saveXMLN)rr	r
rZasync_r�r�r�r�r�r�rrrrr�Osr�c@s,eZdZdZdZdd�Zdd�Zdd�Zd	S)
�DOMImplementationLSrrcCsF|dk	rtj�d��||jkr$t�S||jkr:tj�d��td��dS)NzschemaType not yet supportedz'asynchronous builders are not supportedzunknown value for mode)r5r6r7�MODE_SYNCHRONOUSr�MODE_ASYNCHRONOUSrl)r%�modeZ
schemaTyperrr�createDOMBuilderts�

�z$DOMImplementationLS.createDOMBuildercCstd��dS)Nz-the writer interface hasn't been written yet!r�r$rrr�createDOMWriters�z#DOMImplementationLS.createDOMWritercCst�Sr")rr$rrr�createDOMInputSource�sz(DOMImplementationLS.createDOMInputSourceN)rr	r
r�r�r�r�r�rrrrr�ps
r�)rrc�warningsZxml.domr5Zxml.dom.NodeFilterr�__all__rrr3�objectrrr�r�r�rrrr�<module>s
 %,1!xml/dom/__pycache__/minidom.cpython-38.opt-2.pyc000064400000150707151153537540015402 0ustar00U

e5d)�@s�ddlZddlZddlmZmZmZmZddlTddlm	Z	m
Z
ejjj
ejjjfZGdd�dejj�Zeeddd	�eed
dd	�eedd
d	�dd�Zdd�Zdd�Zdd�Zdd�ZGdd�de�ZGdd�de�Zeeddd	�eeddd	�eedd d	�Gd!d"�d"e�Zeed#d$d	�eZGd%d&�d&e�Zedd�ZGd'd(�d(e�Zeed)d*d	�eedd+d	�d,d-�ZGd.d/�d/�ZGd0d1�d1ee�Z Gd2d3�d3ee�Z!ee!d#d4d	�Gd5d6�d6e!�Z"ee"d7d8d	�ee"d9d:d	�d;d<�Z#d=d>�Z$Gd?d@�d@e!�Z%GdAdB�dBe"�Z&GdCdD�dDe�Z'ee'd#dEd	�GdFdG�dG�Z(GdHdI�dIe(ee�Z)GdJdK�dKe(e�Z*GdLdM�dMe(ee�Z+GdNdO�dOe	�Z,GdPdQ�dQe�Z-dRdS�Z.GdTdU�dUee
�Z/ee/dVdWd	�dXdY�Z0dZd[�Z1d\d]�Z2ddd^d_�Z3ded`da�Z4dfdbdc�Z5dS)g�N)�EMPTY_NAMESPACE�EMPTY_PREFIX�XMLNS_NAMESPACE�domreg)�*)�DOMImplementationLS�
DocumentLSc@s�eZdZdZdZdZdZdZeZ	dd�Z
d2dd�Zd3dd	�Zd
d�Z
dd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Z dS)4�NodeNcCsdS)NT���selfr
r
�'/usr/lib64/python3.8/xml/dom/minidom.py�__bool__+sz
Node.__bool__cCs|�dd|�S�N�)�toprettyxml)r�encodingr
r
r
�toxml.sz
Node.toxml�	�
cCsx|dkrt��}ntjt��|ddd�}|jtjkrH|�|d|||�n|�|d||�|dkrh|��S|�	���SdS)N�xmlcharrefreplacer)r�errors�newliner)
�io�StringIO�
TextIOWrapper�BytesIO�nodeTyper	�
DOCUMENT_NODE�writexml�getvalue�detach)r�indent�newlr�writerr
r
r
r1s

�zNode.toprettyxmlcCs
t|j�S�N)�bool�
childNodesrr
r
r
�
hasChildNodesCszNode.hasChildNodescCs|jSr%�r'rr
r
r
�_get_childNodesFszNode._get_childNodescCs|jr|jdSdS�Nrr)rr
r
r
�_get_firstChildIszNode._get_firstChildcCs|jr|jdSdS�N���r)rr
r
r
�_get_lastChildMszNode._get_lastChildcCs
|j|jkr,t|j�D]}|�||�q|S|j|jkrTtj�dt	|�t	|�f��|j
dk	rj|j
�|�|dkr~|�|�n�z|j�
|�}Wntk
r�tj���YnX|jtkr�t|�|j�||�||_||_|r�|j|d}||_||_nd|_||_
|S)N�%s cannot be child of %s�)r�DOCUMENT_FRAGMENT_NODE�tupler'�insertBefore�_child_node_types�xml�dom�HierarchyRequestErr�repr�
parentNode�removeChild�appendChild�index�
ValueError�NotFoundErr�_nodeTypes_with_children�_clear_id_cache�insert�nextSibling�previousSibling)r�newChild�refChild�cr=�noder
r
r
r4Qs8�

zNode.insertBeforecCs�|j|jkr*t|j�D]}|�|�q|S|j|jkrTtj�dt	|�t	|�f��n|jt
krft|�|jdk	r||j�
|�t||�d|_|S�Nr0)rr2r3r'r<r5r6r7r8r9r@rAr:r;�
_append_childrC)rrHrGr
r
r
r<qs�


zNode.appendChildcCs|j|jkr(|j}|�|�|�||�S|j|jkrPtj�dt	|�t	|�f��||kr\dS|j
dk	rr|j
�|�z|j�|�}Wnt
k
r�tj���YnX||j|<||_
d|_
|jtks�|jtkr�t|�|j|_|j|_d|_d|_|jr�||j_|j�r||j_|SrI)rr2rCr;r4r5r6r7r8r9r:r'r=r>r?r@rArD)rrE�oldChildrFr=r
r
r
�replaceChild�s@
�


�zNode.replaceChildcCs�z|j�|�Wntk
r.tj���YnX|jdk	rD|j|j_|jdk	rX|j|j_d|_|_|jt	krvt
|�d|_|Sr%)r'�remover>r6r7r?rCrDrr@rAr:�rrKr
r
r
r;�s




zNode.removeChildcCs�g}|jD]�}|jtjkr�|jsJ|r0|j|d_|jr@|j|j_|��q�|r�|dj|jkr�|d}|j|j|_|j|_|jr�||j_|��q�|�|�q
|�|�|jtj	kr
|�
�q
||jdd�<dSr-)r'rr	�	TEXT_NODE�datarCrD�unlink�append�ELEMENT_NODE�	normalize)r�L�childrHr
r
r
rT�s*





zNode.normalizecCst|||jp|�Sr%)�_clone_node�
ownerDocument)r�deepr
r
r
�	cloneNode�szNode.cloneNodecCs|jj�||�Sr%)rX�implementation�
hasFeature�r�feature�versionr
r
r
�isSupported�szNode.isSupportedcCsdSr%r
rr
r
r
�_get_localName�szNode._get_localNamecCs||kSr%r
�r�otherr
r
r
�
isSameNode�szNode.isSameNodecCs|�|d�r|SdSdSr%)r`�rr^r
r
r
�getInterface�szNode.getInterfacec	Cs0z|j|dWSttfk
r*YdSXdSr+)�
_user_data�AttributeError�KeyError�r�keyr
r
r
�getUserData�szNode.getUserDatacCsnd}z
|j}Wntk
r,i}||_YnX||krB||d}|dkr^d}|dk	rj||=n||f||<|Sr+)rgrh)rrkrP�handler�old�dr
r
r
�setUserData�s
zNode.setUserDatacCsDt|d�r@t|j���D]&\}\}}|dk	r|�|||||�qdS)Nrg)�hasattr�listrg�itemsZhandle)r�	operation�srcZdstrkrPrmr
r
r
�_call_user_data_handler�s
zNode._call_user_data_handlercCs>d|_|_|jr.|jD]}|��qt�|_d|_d|_dSr%)r:rXr'rQ�NodeListrDrC)rrVr
r
r
rQs

zNode.unlinkcCs|Sr%r
rr
r
r
�	__enter__szNode.__enter__cCs|��dSr%)rQ)rZetZev�tbr
r
r
�__exit__sz
Node.__exit__)N)rrN)!�__name__�
__module__�__qualname__�namespaceURIr:rXrCrDr�prefixrrrr(r*r,r/r4r<rLr;rTrZr`rardrfrlrprvrQrxrzr
r
r
r
r	"s:

  
r	�
firstChildzFirst child node, or None.)�doc�	lastChildzLast child node, or None.�	localNamez"Namespace-local name of this node.cCs2|j}|r|d}||_||_|�|�||_dSr-)r'rDrCrRr:)rrHr'Zlastr
r
r
rJs
rJcCs$|dk	r |jtjkrdS|j}qdS�NTF)rr	rr:�rHr
r
r
�_in_document&s
r�cCs6|r2|�dd��dd��dd��dd�}|�|�dS)	N�&z&amp;�<z&lt;�"z&quot;�>z&gt;)�replace�write)r$rPr
r
r
�_write_data.s��r�cCsD|jD]8}|jtjkr2|dks(|j|kr2|�|�t|||�q|S�Nr)r'rr	rS�tagNamerR�_get_elements_by_tagName_helper)�parent�name�rcrHr
r
r
r�5s
��
r�cCsX|jD]L}|jtjkr|dks(|j|krD|dks:|j|krD|�|�t||||�q|Sr�)r'rr	rSr�r~rR�"_get_elements_by_tagName_ns_helper)r�ZnsURIr�r�rHr
r
r
r�=s
��
r�c@sJeZdZejZdZdZdZdZ	ej
ejejej
ejejejfZdd�ZdS)�DocumentFragmentz#document-fragmentNcCst�|_dSr%)rwr'rr
r
r
�__init__TszDocumentFragment.__init__)r{r|r}r	r2r�nodeName�	nodeValue�
attributesr:rSrO�CDATA_SECTION_NODE�ENTITY_REFERENCE_NODE�PROCESSING_INSTRUCTION_NODE�COMMENT_NODE�
NOTATION_NODEr5r�r
r
r
r
r�Fs�r�c@s�eZdZdZejZdZdZdZ	ej
ejfZe
ddfdd�Zdd�Zdd	�Zd
d�Zdd
�Zeee�ZZdd�Zdd�Zeee�ZZdd�Zdd�Zeee�Zdd�Zdd�Zdd�ZdS)�Attr)�_name�_valuer~�_prefixr'�
_localNamerX�ownerElementNFcCs2d|_||_||_||_t�|_|j�t��dSr%)r�r�r~r�rwr'rR�Text)r�qNamer~r�rr
r
r
r�bsz
Attr.__init__cCs4z|jWStk
r.|j�dd�dYSXdS�N�:r1r.)r�rhr��splitrr
r
r
raoszAttr._get_localNamecCs|jSr%)�	specifiedrr
r
r
�_get_specifieduszAttr._get_specifiedcCs|jSr%)r�rr
r
r
�	_get_namexszAttr._get_namecCs||_|jdk	rt|j�dSr%)r�r�rA�r�valuer
r
r
�	_set_name{s
zAttr._set_namecCs|jSr%)r�rr
r
r
�
_get_value�szAttr._get_valuecCs6||_||jd_|jdk	r&t|j�||jd_dSr+)r�r'rPr�rAr�r
r
r
�
_set_value�s


zAttr._set_valuecCs|jSr%)r�rr
r
r
�_get_prefix�szAttr._get_prefixcCsd|j}|dkr&|r&|tkr&tj�d��||_|dkr<|j}nd||jf}|jrZt|j�||_	dS)N�xmlnsz5illegal use of 'xmlns' prefix for the wrong namespacez%s:%s)
r~rr6r7�NamespaceErrr�r�r�rAr�)rrZnsuriZnewNamer
r
r
�_set_prefix�s�
zAttr._set_prefixcCsv|j}|dk	rR|j|j=|j|j|jf=|jrRd|_|jd8_|jj	d8_	|j
D]}|��qX|j
dd�=dS)NFr1)r��_attrsr��_attrsNSr~r��_is_id�_magic_id_nodesrX�_magic_id_countr'rQ)r�elemrVr
r
r
rQ�s


zAttr.unlinkcCsf|jr
dS|j}|j}|dks&|dkr*dS|�|�}|dkr@dS|jrV|�|j|j�S|�|j�SdSr�)	r�rXr��_get_elem_infor~�isIdNSr��isIdr��rr�r��infor
r
r
�	_get_isId�s
zAttr._get_isIdcCs\|j}|j}|dks|dkr tS|�|�}|dkr6tS|jrL|�|j|j�S|�|j�SdSr%)	rXr��_no_typer�r~�getAttributeTypeNSr��getAttributeTyper�r�r
r
r
�_get_schemaType�s
zAttr._get_schemaType) r{r|r}�	__slots__r	�ATTRIBUTE_NODErr�r�r�rOr�r5rr�rar�r�r��propertyr�r�r�r�r�r�r�r�rrQr�r�r
r
r
r
r�Xs.�


r�r�z True if this attribute is an ID.z'Namespace-local name of this attribute.�
schemaTypezSchema type for this attribute.c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zd9dd�Z
eZdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�ZdS):�NamedNodeMap�r�r��
_ownerElementcCs||_||_||_dSr%r�)r�attrsZattrsNSr�r
r
r
r��szNamedNodeMap.__init__cCs
t|j�Sr%)�lenr�rr
r
r
�_get_length�szNamedNodeMap._get_lengthcCs4z|t|j���|WStk
r.YdSXdSr%)rrr��keys�
IndexError�rr=r
r
r
�item�szNamedNodeMap.itemcCs*g}|j��D]}|�|j|jf�q|Sr%)r��valuesrRr�r��rrUrHr
r
r
rs�szNamedNodeMap.itemscCs0g}|j��D]}|�|j|jf|jf�q|Sr%)r�r�rRr~r�r�r�r
r
r
�itemsNS�szNamedNodeMap.itemsNScCs"t|t�r||jkS||jkSdSr%)�
isinstance�strr�r�rjr
r
r
�__contains__�s

zNamedNodeMap.__contains__cCs
|j��Sr%)r�r�rr
r
r
r�szNamedNodeMap.keyscCs
|j��Sr%)r�r�rr
r
r
�keysNSszNamedNodeMap.keysNScCs
|j��Sr%)r�r�rr
r
r
r�szNamedNodeMap.valuesNcCs|j�||�Sr%�r��get)rr�r�r
r
r
r�
szNamedNodeMap.getcCs:|jt|dd�krdSt|�t|�kt|�t|�kSdS)Nr�r)r��getattr�idrbr
r
r
�_cmpszNamedNodeMap._cmpcCs|�|�dkSr+�r�rbr
r
r
�__eq__szNamedNodeMap.__eq__cCs|�|�dkSr+r�rbr
r
r
�__ge__szNamedNodeMap.__ge__cCs|�|�dkSr+r�rbr
r
r
�__gt__szNamedNodeMap.__gt__cCs|�|�dkSr+r�rbr
r
r
�__le__szNamedNodeMap.__le__cCs|�|�dkSr+r�rbr
r
r
�__lt__!szNamedNodeMap.__lt__cCs"t|t�r|j|S|j|SdSr%)r�r3r�r�)r�attname_or_tupler
r
r
�__getitem__$s

zNamedNodeMap.__getitem__cCsvt|t�rRz|j|}Wn0tk
rHt|�}|jj|_|�|�YnX||_n t|t�sdt	d��|}|�|�dS)Nz%value must be a string or Attr object)
r�r�r�rir�r�rX�setNamedItemr��	TypeError)r�attnamer�rHr
r
r
�__setitem__+s


zNamedNodeMap.__setitem__cCs(z|j|WStk
r"YdSXdSr%)r�ri�rr�r
r
r
�getNamedItem:szNamedNodeMap.getNamedItemcCs,z|j||fWStk
r&YdSXdSr%)r�ri�rr~r�r
r
r
�getNamedItemNS@szNamedNodeMap.getNamedItemNScCsX|�|�}|dk	rJt|j�|j|j=|j|j|jf=t|d�rFd|_	|St
j���dS�Nr�)
r�rAr�r�r�r�r~r�rqr�r6r7r?�rr��nr
r
r
�removeNamedItemFs



zNamedNodeMap.removeNamedItemcCsZ|�||�}|dk	rLt|j�|j|j|jf=|j|j=t|d�rHd|_	|St
j���dSr�)
r�rAr�r�r~r�r�r�rqr�r6r7r?�rr~r�r�r
r
r
�removeNamedItemNSRs


zNamedNodeMap.removeNamedItemNScCstt|t�s&tj�dt|�t|�f��|j�|j�}|r@|�	�||j|j<||j
|j|jf<|j
|_t|j�|SrI)r�r�r6r7r8r9r�r�r�rQr�r~r�r�r�rA)rrHrnr
r
r
r�^s
�
zNamedNodeMap.setNamedItemcCs
|�|�Sr%)r��rrHr
r
r
�setNamedItemNSkszNamedNodeMap.setNamedItemNScCs||}t|j�|��dSr%)rAr�rQ)rr�rHr
r
r
�__delitem__ns
zNamedNodeMap.__delitem__cCs|j|j|jfSr%r�rr
r
r
�__getstate__sszNamedNodeMap.__getstate__cCs|\|_|_|_dSr%r��r�stater
r
r
�__setstate__vszNamedNodeMap.__setstate__)N) r{r|r}r�r�r�r�rsr�r�r�r�r�r��__len__r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r
r
r
r
r��s:	

r�Zlengthz$Number of nodes in the NamedNodeMap.c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�TypeInfo��	namespacer�cCs||_||_dSr%r�)rrr�r
r
r
r��szTypeInfo.__init__cCs2|jrd|jj|j|jfSd|jj|jfSdS)Nz<%s %r (from %r)>z<%s %r>)r�	__class__r{r�rr
r
r
�__repr__�s
�zTypeInfo.__repr__cCs|jSr%)r�rr
r
r
r��szTypeInfo._get_namecCs|jSr%)rrr
r
r
�_get_namespace�szTypeInfo._get_namespaceN)r{r|r}r�r�rr�rr
r
r
r
r�s
r�c@s eZdZdZejZdZeZ	dZ
ejejejej
ejejfZeddfdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�ZeZdd�Zdd�Z d d!�Z!e!Z"d"d#�Z#d$d%�Z$d&d'�Z%d(d)�Z&d*d+�Z'd9d-d.�Z(d/d0�Z)d1d2�Z*d3d4�Z+d5d6�Z,d7d8�Z-dS):�Element)rXr:r�r�rr~r�r'r�r�rCrDNrcCsBd|_||_|_||_||_t�|_d|_|_d|_	d|_
dSr%)r:r�r�rr~rwr'rCrDr�r�)rr�r~rr�r
r
r
r��s
zElement.__init__cCs|jdkri|_i|_dSr%)r�r�rr
r
r
�_ensure_attributes�s
zElement._ensure_attributescCs4z|jWStk
r.|j�dd�dYSXdSr�)r�rhr�r�rr
r
r
ra�szElement._get_localNamecCs|jSr%�r�rr
r
r
�_get_tagName�szElement._get_tagNamecCs@|jdk	r&t|j���D]}|��qd|_d|_t�|�dSr%)r�rrr�rQr�r	)r�attrr
r
r
rQ�s

zElement.unlinkcCs8|jdkrdSz|j|jWStk
r2YdSXdSr)r�r�ri)rr�r
r
r
�getAttribute�s
zElement.getAttributecCs<|jdkrdSz|j||fjWStk
r6YdSXdSr)r�r�rir�r
r
r
�getAttributeNS�s
zElement.getAttributeNScCsV|�|�}|dkr4t|�}||_|j|_|�|�n||jkrR||_|jrRt|�dSr%)�getAttributeNoder�r�rX�setAttributeNoder�rA)rr�r�rr
r
r
�setAttribute�s

zElement.setAttributecCs�t|�\}}|�||�}|dkrHt||||�}||_|j|_|�|�n4||jkrf||_|jrft|�|j|kr|||_||_	dSr%)
�_nssplit�getAttributeNodeNSr�r�rXrr�rArr�)rr~�
qualifiedNamer�r�	localnamerr
r
r
�setAttributeNS�s

zElement.setAttributeNScCs|jdkrdS|j�|�Sr%r�)r�attrnamer
r
r
r�s
zElement.getAttributeNodecCs|jdkrdS|j�||f�Sr%)r�r�r�r
r
r
rs
zElement.getAttributeNodeNScCs�|jd|fkrtj�d��|��|j�|jd�}|dk	rD|�|�|j	�|j
|jfd�}|dk	rt||k	rt|�|�t||�||k	r�|S||k	r�|SdS)Nzattribute node already owned)
r�r6r7ZInuseAttributeErrrr�r�r��removeAttributeNoder�r~r��_set_attribute_node)rrZold1Zold2r
r
r
rs


zElement.setAttributeNodecCsP|jdkrtj���z|j|}Wntk
r@tj���YnX|�|�dSr%)r�r6r7r?r�rir)rr�rr
r
r
�removeAttributes

zElement.removeAttributecCsT|jdkrtj���z|j||f}Wntk
rDtj���YnX|�|�dSr%)r�r6r7r?rir)rr~r�rr
r
r
�removeAttributeNS%s

zElement.removeAttributeNScCs^|dkrtj���z|j|jWntk
r@tj���YnXt|�|��|j|_|Sr%)	r6r7r?r�r�rirArQrXr�r
r
r
r.s
zElement.removeAttributeNodecCs|jdkrdS||jkS�NF�r�r�r
r
r
�hasAttribute>s
zElement.hasAttributecCs|jdkrdS||f|jkSr)r�r�r
r
r
�hasAttributeNSCs
zElement.hasAttributeNScCst||t��Sr%�r�rwr�r
r
r
�getElementsByTagNameHszElement.getElementsByTagNamecCst|||t��Sr%�r�rwr�r
r
r
�getElementsByTagNameNSKs�zElement.getElementsByTagNameNScCsd|jt|�fS)Nz<DOM Element: %s at %#x>)r�r�rr
r
r
rOszElement.__repr__rcCs�|�|d|j�|��}|��D],}|�d|�t|||j�|�d�q$|jr�|�d�t|j�dkr�|jdjt	j
t	jfkr�|jd�|ddd�n4|�|�|jD]}|�|||||�q�|�|�|�d|j|f�n|�d	|�dS)
Nr�z %s="r�r�r1rrz</%s>%sz/>%s)
r�r��_get_attributesr�r�r�r'r�rr	rOr�r)rr$r"�	addindentr#r�Za_namerHr
r
r
rRs*

��


zElement.writexmlcCs|��t|j|j|�Sr%)rr�r�r�rr
r
r
r mszElement._get_attributescCs|jr
dSdSdSr�rrr
r
r
�
hasAttributesqszElement.hasAttributescCs|�|�}|�|�dSr%)r�setIdAttributeNode)rr��idAttrr
r
r
�setIdAttributeys
zElement.setIdAttributecCs|�||�}|�|�dSr%)rr#)rr~r�r$r
r
r
�setIdAttributeNS}szElement.setIdAttributeNScCsj|dks|�|j�stj���t|�dk	r4tj���|jsfd|_|jd7_|j	j
d7_
t|�dS)NTr1)rdr�r6r7r?�_get_containing_entref�NoModificationAllowedErrr�r�rXr�rA)rr$r
r
r
r#�s

zElement.setIdAttributeNode)rrr).r{r|r}r�r	rSrr�r�r�r�r�r�rOr�r�r5rr�rrarrQr	r
r
rrrrZsetAttributeNodeNSrrrZremoveAttributeNodeNSrrrrrrr r"r%r&r#r
r
r
r
r�sT��
		
rr�z*NamedNodeMap of attributes on the element.z%Namespace-local name of this element.cCs8t|�|��||j|j<||j|j|jf<||_dSr%)rArr�r�r�r~r�r�)�elementrr
r
r
r�s
rc@sbeZdZdZdZe�ZdZdZdd�Z	dd�Z
dd�Zd	d
�Zdd�Z
d
d�Zdd�Zdd�ZdS)�	Childlessr
NcCsdSr%r
rr
r
r
r,�szChildless._get_firstChildcCsdSr%r
rr
r
r
r/�szChildless._get_lastChildcCstj�|jd��dS)Nz nodes cannot have children�r6r7r8r�r�r
r
r
r<�s�zChildless.appendChildcCsdSrr
rr
r
r
r(�szChildless.hasChildNodescCstj�|jd��dS�Nz nodes do not have childrenr+�rrErFr
r
r
r4�s�zChildless.insertBeforecCstj�|jd��dSr,)r6r7r?r�rNr
r
r
r;�s�zChildless.removeChildcCsdSr%r
rr
r
r
rT�szChildless.normalizecCstj�|jd��dSr,r+�rrErKr
r
r
rL�s�zChildless.replaceChild)r{r|r}r�r�Z
EmptyNodeListr'r�r�r,r/r<r(r4r;rTrLr
r
r
r
r*�sr*c@s\eZdZejZdZdd�Zdd�Zdd�Z	e
ee	�Zdd	�Zd
d�Z
e
ee
�Zdd
d�ZdS)�ProcessingInstruction��targetrPcCs||_||_dSr%r0)rr1rPr
r
r
r��szProcessingInstruction.__init__cCs|jSr%�rPrr
r
r
�_get_nodeValue�sz$ProcessingInstruction._get_nodeValuecCs
||_dSr%r2r�r
r
r
�_set_nodeValue�sz$ProcessingInstruction._set_nodeValuecCs|jSr%�r1rr
r
r
�
_get_nodeName�sz#ProcessingInstruction._get_nodeNamecCs
||_dSr%r5r�r
r
r
�
_set_nodeName�sz#ProcessingInstruction._set_nodeNamercCs|�d||j|j|f�dS)Nz
%s<?%s %s?>%s)r�r1rP�rr$r"r!r#r
r
r
r�szProcessingInstruction.writexmlN)rrr)r{r|r}r	r�rr�r�r3r4r�r�r6r7r�rr
r
r
r
r/�s

r/c@sreZdZdZdd�Zdd�ZeZdd�Zdd	�Ze	ee�Z
Zd
d�Zdd
�Z
dd�Zdd�Zdd�Zdd�ZdS)�
CharacterData)�_datarXr:rDrCcCs,d|_|_d|_|_d|_t�|�dSr)rXr:rDrCr:r	r�rr
r
r
r��szCharacterData.__init__cCs
t|j�Sr%)r�rPrr
r
r
r��szCharacterData._get_lengthcCs|jSr%�r:rr
r
r
�	_get_data�szCharacterData._get_datacCs
||_dSr%r;�rrPr
r
r
�	_set_data�szCharacterData._set_datacCs6|j}t|�dkrd}nd}d|jj|dd�|fS)N�
z...rz<DOM %s node "%r%s">r)rPr�rr{)rrPZ	dotdotdotr
r
r
r�s
�zCharacterData.__repr__cCsT|dkrtj�d��|t|j�kr.tj�d��|dkrBtj�d��|j|||�S�Nr�offset cannot be negative�#offset cannot be beyond end of data�count cannot be negative�r6r7�IndexSizeErrr�rP�r�offset�countr
r
r
�
substringData�szCharacterData.substringDatacCs|j||_dSr%r2)r�argr
r
r
�
appendDataszCharacterData.appendDatacCsZ|dkrtj�d��|t|j�kr.tj�d��|rVd|jd|�||j|d�f|_dS)NrrArB�%s%s%srD)rrGrJr
r
r
�
insertData	s�zCharacterData.insertDatacCsl|dkrtj�d��|t|j�kr.tj�d��|dkrBtj�d��|rh|jd|�|j||d�|_dSr@rDrFr
r
r
�
deleteDataszCharacterData.deleteDatacCsr|dkrtj�d��|t|j�kr.tj�d��|dkrBtj�d��|rnd|jd|�||j||d�f|_dS)NrrArBrCrLrD)rrGrHrJr
r
r
�replaceDatas�zCharacterData.replaceDataN)r{r|r}r�r�r�r�r<r>r�rPr�rrIrKrMrNrOr
r
r
r
r9�s			
r9zLength of the string data.c@sHeZdZdZejZdZdZdd�Z	ddd�Z
d	d
�Zdd�Zd
d�Z
dS)r�r
z#textNcCs�|dks|t|j�kr"tj�d��|��}|j|d�|_|j|_|j}|jr~||jj	kr~|dkrp|j�
|�n|j�||�|jd|�|_|S)Nrzillegal offset value)r�rPr6r7rErrXrCr:r'r<r4)rrGZnewText�nextr
r
r
�	splitText1szText.splitTextrcCst|d||j|f�dS)NrL)r�rPr8r
r
r
r@sz
Text.writexmlcCs�|jg}|j}|dk	rB|jtjtjfkrB|�d|j�|j}qqBq|j}|dk	rz|jtjtjfkrz|�|j�|j}qHqzqHd�	|�S)Nrr)
rPrDrr	rOr�rBrCrR�join)rrUr�r
r
r
�_get_wholeTextEszText._get_wholeTextcCs�|j}|j}|dk	r@|jtjtjfkr@|j}|�|�|}qq@q|j}|sT|�|�|dk	r�|jtjtjfkr�|j}|�|�|}qTq�qT|r�||_|SdSdSr%)	r:rDrr	rOr�r;rCrP)rZcontentr�r�rPr
r
r
�replaceWholeTextWs*


zText.replaceWholeTextcCsF|j��rdSt|�}|dkr"dS|j�|�}|dkr:dS|��SdSr)rP�strip�_get_containing_elementrXr��isElementContent)rr�r�r
r
r
�!_get_isWhitespaceInElementContentss
z&Text._get_isWhitespaceInElementContent)rrr)r{r|r}r�r	rOrr�r�rQrrSrTrXr
r
r
r
r�*s
r�ZisWhitespaceInElementContentzKTrue iff this text node contains only whitespace and is in element content.Z	wholeTextz.The text of all logically-adjacent text nodes.cCs*|j}|dk	r&|jtjkr|S|j}qdSr%)r:rr	rS�rHrGr
r
r
rV�srVcCs*|j}|dk	r&|jtjkr|S|j}qdSr%)r:rr	r�rYr
r
r
r'�sr'c@s(eZdZejZdZdd�Zddd�ZdS)	�Commentz#commentcCst�|�||_dSr%)r9r�r:r=r
r
r
r��s
zComment.__init__rcCs,d|jkrtd��|�d||j|f�dS)Nz--z%'--' is not allowed in a comment nodez
%s<!--%s-->%s)rPr>r�r8r
r
r
r�s
zComment.writexmlN)rrr)	r{r|r}r	r�rr�r�rr
r
r
r
rZ�srZc@s$eZdZdZejZdZddd�ZdS)�CDATASectionr
z#cdata-sectionrcCs,|j�d�dkrtd��|�d|j�dS)Nz]]>rz$']]>' not allowed in a CDATA sectionz<![CDATA[%s]]>)rP�findr>r�r8r
r
r
r�szCDATASection.writexmlN)rrr)	r{r|r}r�r	r�rr�rr
r
r
r
r[�sr[c@szeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)�ReadOnlySequentialNamedNodeMap��_seqr
cCs
||_dSr%r^)r�seqr
r
r
r��sz'ReadOnlySequentialNamedNodeMap.__init__cCs
t|j�Sr%�r�r_rr
r
r
r��sz&ReadOnlySequentialNamedNodeMap.__len__cCs
t|j�Sr%rarr
r
r
r��sz*ReadOnlySequentialNamedNodeMap._get_lengthcCs"|jD]}|j|kr|SqdSr%)r_r�r�r
r
r
r��s

z+ReadOnlySequentialNamedNodeMap.getNamedItemcCs,|jD] }|j|kr|j|kr|SqdSr%)r_r~r�r�r
r
r
r��s
z-ReadOnlySequentialNamedNodeMap.getNamedItemNScCs4t|t�r|j|�}n
|�|�}|dkr0t|��|Sr%)r�r3r�r�ri)rZ
name_or_tuplerHr
r
r
r��s

z*ReadOnlySequentialNamedNodeMap.__getitem__cCs4|dkrdSz|j|WStk
r.YdSXdSr+)r_r�r�r
r
r
r��sz#ReadOnlySequentialNamedNodeMap.itemcCstj�d��dS�Nz"NamedNodeMap instance is read-only�r6r7r(r�r
r
r
r��s�z.ReadOnlySequentialNamedNodeMap.removeNamedItemcCstj�d��dSrbrcr�r
r
r
r��s�z0ReadOnlySequentialNamedNodeMap.removeNamedItemNScCstj�d��dSrbrcr�r
r
r
r��s�z+ReadOnlySequentialNamedNodeMap.setNamedItemcCstj�d��dSrbrcr�r
r
r
r��s�z-ReadOnlySequentialNamedNodeMap.setNamedItemNScCs|jgSr%r^rr
r
r
r��sz+ReadOnlySequentialNamedNodeMap.__getstate__cCs|d|_dSr+r^r�r
r
r
r��sz+ReadOnlySequentialNamedNodeMap.__setstate__N)r
)r{r|r}r�r�r�r�r�r�r�r�r�r�r�r�r�r�r
r
r
r
r]�s
	r]z&Number of entries in the NamedNodeMap.c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�
Identified��publicId�systemIdcCs||_||_dSr%re)rrfrgr
r
r
�_identified_mixin_init�sz!Identified._identified_mixin_initcCs|jSr%)rfrr
r
r
�
_get_publicId�szIdentified._get_publicIdcCs|jSr%)rgrr
r
r
�
_get_systemId�szIdentified._get_systemIdN)r{r|r}r�rhrirjr
r
r
r
rd�srdc@sHeZdZejZdZdZdZdZ	dZ
dd�Zdd�Zdd�Z
dd	d
�ZdS)�DocumentTypeNcCs2t�|_t�|_|r&t|�\}}||_|j|_dSr%)r]�entities�	notationsrr�r�)rrrrr
r
r
r�
szDocumentType.__init__cCs|jSr%)�internalSubsetrr
r
r
�_get_internalSubsetsz DocumentType._get_internalSubsetcCs�|jdkr�td�}|j|_|j|_tjjj}|r�g|j_	g|j
_	|j
j	D]2}t|j|j|j
�}|j
j	�|�|�|||�qH|jj	D]N}t|j|j|j
|j�}|j|_|j|_|j|_|jj	�|�|�|||�q�|�|||�|SdSdSr%)rXrkr�r�r6r7�UserDataHandler�NODE_CLONEDrlr_rm�NotationrfrgrRrv�Entity�notationName�actualEncodingrr_)rrY�clonertr��notation�e�entityr
r
r
rZs0

�zDocumentType.cloneNodercCs�|�d�|�|j�|jr8|�d||j||jf�n|jrR|�d||jf�|jdk	r||�d�|�|j�|�d�|�d|�dS)Nz
<!DOCTYPE z%s  PUBLIC '%s'%s  '%s'z%s  SYSTEM '%s'z [�]r�)r�r�rfrgrnr8r
r
r
r0s
�


zDocumentType.writexml)rrr)r{r|r}r	�DOCUMENT_TYPE_NODErr�r�rfrgrnr�rorZrr
r
r
r
rksrkc@sfeZdZdZejZdZdZdZ	dZ
dd�Zdd�Zdd�Z
dd	�Zd
d�Zdd
�Zdd�Zdd�ZdS)rsNcCs$||_||_t�|_|�||�dSr%)r�rtrwr'rh)rr�rfrgrwr
r
r
r�GszEntity.__init__cCs|jSr%�rurr
r
r
�_get_actualEncodingMszEntity._get_actualEncodingcCs|jSr%�rrr
r
r
�
_get_encodingPszEntity._get_encodingcCs|jSr%�r_rr
r
r
�_get_versionSszEntity._get_versioncCstj�d��dS)Nz(cannot append children to an entity node�r6r7r8)rrEr
r
r
r<Vs�zEntity.appendChildcCstj�d��dS)Nz+cannot insert children below an entity noder�r-r
r
r
r4Zs�zEntity.insertBeforecCstj�d��dS)Nz*cannot remove children from an entity noder�rNr
r
r
r;^s�zEntity.removeChildcCstj�d��dS)Nz)cannot replace children of an entity noder�r.r
r
r
rLbs�zEntity.replaceChild)r{r|r}r�r	ZENTITY_NODErr�rurr_r�r}rr�r<r4r;rLr
r
r
r
rs>srsc@seZdZejZdZdd�ZdS)rrNcCs||_|�||�dSr%)r�rh)rr�rfrgr
r
r
r�jszNotation.__init__)r{r|r}r	r�rr�r�r
r
r
r
rrfsrrc@sHeZdZddddddddgZd	d
�Zdd�Zd
d�Zdd�Zdd�ZdS)�DOMImplementation)�core�1.0)r��2.0)r�N)r6r�)r6r�)r6N)�ls-loadz3.0)r�NcCs|dkrd}|��|f|jkSr)�lower�	_featuresr]r
r
r
r\zszDOMImplementation.hasFeaturec	Cs�|r|jdk	rtj�d��|��}|dko8|dko8|dk}|sP|rPtj�d��|r�t|�\}}|dkr||dkr|tj�d��|r�|s�tj�d��|�||�}|r�|�	|�|�	|�|r�||_|_
||_||_|S)Nz(doctype object owned by another DOM treezElement with no namer6z$http://www.w3.org/XML/1998/namespacezillegal use of 'xml' prefixz(illegal use of prefix without namespaces)
r:r6r7�WrongDocumentErr�_create_documentZInvalidCharacterErrrr��createElementNSr<rX�doctyper[)	rr~rr�r�Zadd_root_elementrrr)r
r
r
�createDocuments>���
��

z DOMImplementation.createDocumentcCst|�}||_||_|Sr%)rkrfrg)rrrfrgr�r
r
r
�createDocumentType�sz$DOMImplementation.createDocumentTypecCs|�|d�r|SdSdSr%)r\rer
r
r
rf�szDOMImplementation.getInterfacecCst�Sr%)�Documentrr
r
r
r��sz"DOMImplementation._create_documentN)	r{r|r}r�r\r�r�rfr�r
r
r
r
r�os�
-r�c@sXeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�ZdS)�ElementInforcCs
||_dSr%rr�r
r
r
r��szElementInfo.__init__cCstSr%�r��rZanamer
r
r
r��szElementInfo.getAttributeTypecCstSr%r�r�r
r
r
r��szElementInfo.getAttributeTypeNScCsdSrr
rr
r
r
rW�szElementInfo.isElementContentcCsdSrr
rr
r
r
�isEmpty�szElementInfo.isEmptycCsdSrr
r�r
r
r
r��szElementInfo.isIdcCsdSrr
r�r
r
r
r��szElementInfo.isIdNScCs|jSr%rrr
r
r
r��szElementInfo.__getstate__cCs
||_dSr%rr�r
r
r
r��szElementInfo.__setstate__N)
r{r|r}r�r�r�r�rWr�r�r�r�r�r
r
r
r
r��s	r�cCs>|jtjkr|j��d|_nt|�r:|jj��d|j_dSr%)rr	r�	_id_cache�clear�_id_search_stackr�rXr�r
r
r
rA�s
rAc@sreZdZdZejejejejfZ	e
�ZejZ
dZdZdZdZdZZdZdZdZdZdZdZdZdZdd�Zdd	�Zd
d�Zdd
�Zdd�Z dd�Z!dd�Z"dd�Z#dd�Z$dd�Z%dd�Z&dd�Z'dd�Z(d d!�Z)d"d#�Z*d$d%�Z+d&d'�Z,d(d)�Z-d*d+�Z.d,d-�Z/d.d/�Z0d0d1�Z1d2d3�Z2d4d5�Z3d6d7�Z4d8d9�Z5d:d;�Z6d<d=�Z7d>d?�Z8d@dA�Z9dBdC�Z:dIdEdF�Z;dGdH�Z<dS)Jr�)�
_elem_infor�r�r'r�z	#documentNFrcCs$d|_t�|_i|_i|_d|_dSr%)r�rwr'r�r�r�rr
r
r
r�s
zDocument.__init__cCs&|jr|j|jf}n|j}|j�|�Sr%)r~r�r�r�r�)rr)rkr
r
r
r�szDocument._get_elem_infocCs|jSr%r|rr
r
r
r}szDocument._get_actualEncodingcCs|jSr%)r�rr
r
r
�_get_doctypeszDocument._get_doctypecCs|jSr%)�documentURIrr
r
r
�_get_documentURI!szDocument._get_documentURIcCs|jSr%r~rr
r
r
r$szDocument._get_encodingcCs|jSr%)�errorHandlerrr
r
r
�_get_errorHandler'szDocument._get_errorHandlercCs|jSr%)�
standalonerr
r
r
�_get_standalone*szDocument._get_standalonecCs|jSr%)�strictErrorCheckingrr
r
r
�_get_strictErrorChecking-sz!Document._get_strictErrorCheckingcCs|jSr%r�rr
r
r
r�0szDocument._get_versioncCsj|j|jkr(tj�dt|�t|�f��|jdk	r>|j�|�|jtj	kr^|�
�r^tj�d��t�||�S)Nr0z two document elements disallowed)rr5r6r7r8r9r:r;r	rS�_get_documentElementr<r�r
r
r
r<3s�
��zDocument.appendChildcCsVz|j�|�Wntk
r.tj���YnXd|_|_d|_|j	|krRd|_	|Sr%)
r'rMr>r6r7r?rCrDr:�documentElementrNr
r
r
r;Cs
zDocument.removeChildcCs$|jD]}|jtjkr|SqdSr%)r'rr	rSr�r
r
r
r�Os
zDocument._get_documentElementcCs(|jdk	r|j��d|_t�|�dSr%)r�rQr	rr
r
r
rQTs

zDocument.unlinkcCs�|sdS|j�ddd�}|j|_|j|_|j|_|jD]B}t|||�}|j�|�|jt	j
kr`n|jt	jkrr||_||_
q6|�tjjj||�|Sr%)r[r�rr�r_r'rWrRrr	rr{r�r:rvr6r7rprq)rrYrvr�Z
childcloner
r
r
rZZs&
�zDocument.cloneNodecCst�}||_|Sr%)r�rX)rror
r
r
�createDocumentFragmentoszDocument.createDocumentFragmentcCst|�}||_|Sr%)rrX)rr�rxr
r
r
�
createElementtszDocument.createElementcCs(t|t�std��t�}||_||_|S�Nznode contents must be a string)r�r�r�r�rPrX)rrP�tr
r
r
�createTextNodeys
zDocument.createTextNodecCs(t|t�std��t�}||_||_|Sr�)r�r�r�r[rPrX�rrPrGr
r
r
�createCDATASection�s
zDocument.createCDATASectioncCst|�}||_|Sr%)rZrXr�r
r
r
�
createComment�szDocument.createCommentcCst||�}||_|Sr%)r/rX)rr1rP�pr
r
r
�createProcessingInstruction�s
z$Document.createProcessingInstructioncCst|�}||_d|_|Sr)r�rXr�)rr��ar
r
r
�createAttribute�szDocument.createAttributecCs"t|�\}}t|||�}||_|Sr%)rrrX)rr~rrr�rxr
r
r
r��szDocument.createElementNScCs*t|�\}}t||||�}||_d|_|Sr)rr�rXr�)rr~rrr�r�r
r
r
�createAttributeNS�s
zDocument.createAttributeNScCst||||�}||_|Sr%)rsrX)rr�rfrgrtrxr
r
r
�_create_entity�szDocument._create_entitycCst|||�}||_|Sr%)rrrX)rr�rfrgr�r
r
r
�_create_notation�szDocument._create_notationcCs�||jkr|j|S|js$|js$dS|j}|dkrB|jg}||_n|sJdSd}|�r�|��}|�dd�|jD��|�|�}|�rB|j	�
�D]�}|jr�|�|j|j
�r�||j|j<|j|kr�|}n|js��q�q�|�|j��r
||j|j<|j|kr�|}n|j�s>�q�q�|jr�||j|j<|j|k�r.|}q�|jdkr��q�q�n>|j�r�|j	�
�D]*}|j�rT||j|j<|j|k�rT|}�qT|dk	rN�q�qN|S)NcSsg|]}|jtkr|�qSr
)rr@)�.0rVr
r
r
�
<listcomp>�s
�z+Document.getElementById.<locals>.<listcomp>r1)r�r�r�r�r��pop�extendr'r�r�r�r~r�r�r�r�r�r�r�)rr��stack�resultrHr�rr
r
r
�getElementById�sZ






zDocument.getElementByIdcCst||t��Sr%rr�r
r
r
r�szDocument.getElementsByTagNamecCst|||t��Sr%rr�r
r
r
r�s�zDocument.getElementsByTagNameNScCs|j�||�Sr%)r[r\r]r
r
r
r`�szDocument.isSupportedcCs>|jtjkrtj�d��n|jtjkr2tj�d��t|||�S)Nzcannot import document nodesz!cannot import document type nodes)rr	rr6r7�NotSupportedErrr{rW)rrHrYr
r
r
�
importNode�s
zDocument.importNodercCsJ|dkr|�d|�n|�d||f�|jD]}|�||||�q0dS)Nz<?xml version="1.0" ?>z%<?xml version="1.0" encoding="%s"?>%s)r�r'r)rr$r"r!r#rrHr
r
r
r�s�
zDocument.writexmlcCsJ|j|k	r tj�d||jf��|jtjtjfkr>tj�d��|t	kr�d|kr�|�
dd�\}}|dkr�|tjjkr�tj�d��q�|dkr�|tjjkr�|jtjkr�tj�d��d}|}nd}d}|jtjkr�|j
}|dk	r�|j}|�|�nd}||_||_||_||_|jtjk�r||_n*||_|dk	�rF|�|�|�rF|�|�|S)Nz?cannot rename nodes from other documents;
expected %s,
found %sz8renameNode() only applies to element and attribute nodesr�r1r�zillegal use of 'xmlns' prefixz$illegal use of the 'xmlns' attribute)rXr6r7r�rr	rSr�r�rr�rr�r�r�rrr�r~r�r�r�rr#)rr�r~r�rr�r)Zis_idr
r
r
�
renameNode	sb
���
��
�
��


zDocument.renameNode)rrrN)=r{r|r}r�r	rSr�r�r{r5r�r[rrr�r�r�r:rDrCrurr�r_r�r�r�r�r�r�r}r�r�rr�r�r�r�r<r;r�rQrZr�r�r�r�r�r�r�r�r�r�r�r�rrr`r�rr�r
r
r
r
r��sj�	
:
r�r�z#Top-level element of this document.c
Cs�|j�|�rtjjj}n
tjjj}|jtj	kr�|�
|j|j�}|j
��D]0}|�|j|j|j�|�|j|j�}|j|_qH|r�|jD]}t|||�}|�|�q��n|jtjkr�|��}|r�|jD]}t|||�}|�|�qn�|jtjkr�|�|j�}�n�|jtjk�r|�|j�}�n�|jtjk�r>|�|j |j�}�nj|jtj!k�r\|�"|j�}�nL|jtj#k�r�|�$|j|j�}d|_|j|_�n|jtj%k�r�tjjj}|j&�'|j(|j)|j*�}||_|�r�g|j+_,g|j-_,|j-j,D]F}	t.|	j|	j)|	j*�}
||
_|j-j,�/|
�t0|	d��r�|	�1||	|
��q�|j+j,D]b}t2|j|j)|j*|j3�}|j4|_4|j5|_5|j6|_6||_|j+j,�/|�t0|d��r.|�1|||��q.ntj�7dt8|���t0|d��r�|�1|||�|S)NTrvzCannot clone node %s)9rXrdr6r7rprqZ
NODE_IMPORTEDrr	rSr�r~r�r�r�rr�rr�r�r'rWr<r2r�rOr�rPr�r�r�r�r1r�r�r�r�r{r[r�r�rfrgrlr_rmrrrRrqrvrsrtrurr_r�r9)
rHrYZnewOwnerDocumentrtrvrr�rVrGr�rwrxryr
r
r
rWBs�
�


��
��rWcCs,|�dd�}t|�dkr|Sd|dfSdS)Nr�r1�r)r�r�)rZfieldsr
r
r
r�srcCs,|||�}|��\}}|�|�|��|Sr%)ZgetEventZ
expandNoder�)�func�args�kwargsZeventsZtoktypeZrootNoder
r
r
�_do_pulldom_parse�s


r�cCsH|dkr"|s"ddlm}|�|�Sddlm}t|j|f||d��SdS)Nr��expatbuilder��pulldom)�parser�bufsize)�xml.domr��parser�r�)�filer�r�r�r�r
r
r
r��s

�r�cCsB|dkrddlm}|�|�Sddlm}t|j|fd|i�SdS)Nrr�r�r�)r�r��parseStringr�r�)�stringr�r�r�r
r
r
r��s

�r�cCs@|r:t|t�rt�|�}|D]\}}tj�||�sdSqtjSr%)r�r�rZ_parse_feature_stringr�r[r\)Zfeatures�f�vr
r
r
�getDOMImplementation�s

r�)NN)N)N)6rr�r6rrrrZxml.dom.minicompatZxml.dom.xmlbuilderrrr7r	rSr�r@ZdefpropertyrJr�r�r�r�r�r��objectr�Z
AttributeListr�r�rrr*r/r9r�rVr'rZr[r]rdrkrsrrr�r�rAr�rWrr�r�r�r�r
r
r
r
�<module>s��v
	y$�
x��)GU��	>�<(	O*P�R



xml/dom/__pycache__/NodeFilter.cpython-38.opt-1.pyc000064400000001711151153537540015766 0ustar00U

e5d��@sGdd�d�ZdS)c@sXeZdZdZdZdZdZdZdZdZ	dZ
dZdZd	Z
d
ZdZdZd
ZdZdZdd�ZdS)�
NodeFilterzL
    This is the DOM2 NodeFilter interface. It contains only constants.
    ���l������ �@��iiicCst�dS)N)�NotImplementedError)�selfZnode�r�*/usr/lib64/python3.8/xml/dom/NodeFilter.py�
acceptNodeszNodeFilter.acceptNodeN)�__name__�
__module__�__qualname__�__doc__Z
FILTER_ACCEPTZ
FILTER_REJECTZFILTER_SKIPZSHOW_ALLZSHOW_ELEMENTZSHOW_ATTRIBUTEZ	SHOW_TEXTZSHOW_CDATA_SECTIONZSHOW_ENTITY_REFERENCEZSHOW_ENTITYZSHOW_PROCESSING_INSTRUCTIONZSHOW_COMMENTZ
SHOW_DOCUMENTZSHOW_DOCUMENT_TYPEZSHOW_DOCUMENT_FRAGMENTZ
SHOW_NOTATIONrrrrrrs$rN)rrrrr�<module>�xml/dom/__pycache__/__init__.cpython-38.pyc000064400000012634151153537540014541 0ustar00U

e5d��@s�dZGdd�d�ZdZdZdZdZdZdZd	Zd
Z	dZ
dZd
ZdZ
dZdZdZdZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd �d e�ZGd!d"�d"e�ZGd#d$�d$e�ZGd%d&�d&e�ZGd'd(�d(e�ZGd)d*�d*e�ZGd+d,�d,e�ZGd-d.�d.e�Z Gd/d0�d0e�Z!Gd1d2�d2e�Z"Gd3d4�d4e�Z#Gd5d6�d6�Z$d7Z%d8Z&d9Z'd:Z(d:Z)dd;l*m+Z+m,Z,d:S)<a
W3C Document Object Model implementation for Python.

The Python mapping of the Document Object Model is documented in the
Python Library Reference in the section on the xml.dom package.

This package contains the following modules:

minidom -- A simple implementation of the Level 1 DOM with namespace
           support added (based on the Level 2 specification) and other
           minor Level 2 functionality.

pulldom -- DOM builder supporting on-demand tree-building for selected
           subtrees of the document.

c@sDeZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdS)�Nodez$Class giving the NodeType constants.����������	�
��N)�__name__�
__module__�__qualname__�__doc__�	__slots__ZELEMENT_NODEZATTRIBUTE_NODEZ	TEXT_NODEZCDATA_SECTION_NODEZENTITY_REFERENCE_NODEZENTITY_NODEZPROCESSING_INSTRUCTION_NODEZCOMMENT_NODEZ
DOCUMENT_NODEZDOCUMENT_TYPE_NODEZDOCUMENT_FRAGMENT_NODEZ
NOTATION_NODErrr�(/usr/lib64/python3.8/xml/dom/__init__.pyrs	rrrrrrrr	r
rrr
r�
���c@s eZdZdZdd�Zdd�ZdS)�DOMExceptionzmAbstract base class for DOM exceptions.
    Exceptions with specific codes are specializations of this class.cOs(|jtkrtd��tj|f|�|�dS)Nz0DOMException should not be instantiated directly)�	__class__r�RuntimeError�	Exception�__init__)�self�args�kwrrrrBs

�zDOMException.__init__cCs|jS)N)�code)rrrr�	_get_codeHszDOMException._get_codeN)rrrrrr"rrrrr>src@seZdZeZdS)�IndexSizeErrN)rrr�INDEX_SIZE_ERRr!rrrrr#Lsr#c@seZdZeZdS)�DomstringSizeErrN)rrr�DOMSTRING_SIZE_ERRr!rrrrr%Osr%c@seZdZeZdS)�HierarchyRequestErrN)rrr�HIERARCHY_REQUEST_ERRr!rrrrr'Rsr'c@seZdZeZdS)�WrongDocumentErrN)rrr�WRONG_DOCUMENT_ERRr!rrrrr)Usr)c@seZdZeZdS)�InvalidCharacterErrN)rrr�INVALID_CHARACTER_ERRr!rrrrr+Xsr+c@seZdZeZdS)�NoDataAllowedErrN)rrr�NO_DATA_ALLOWED_ERRr!rrrrr-[sr-c@seZdZeZdS)�NoModificationAllowedErrN)rrr�NO_MODIFICATION_ALLOWED_ERRr!rrrrr/^sr/c@seZdZeZdS)�NotFoundErrN)rrr�
NOT_FOUND_ERRr!rrrrr1asr1c@seZdZeZdS)�NotSupportedErrN)rrr�NOT_SUPPORTED_ERRr!rrrrr3dsr3c@seZdZeZdS)�InuseAttributeErrN)rrr�INUSE_ATTRIBUTE_ERRr!rrrrr5gsr5c@seZdZeZdS)�InvalidStateErrN)rrr�INVALID_STATE_ERRr!rrrrr7jsr7c@seZdZeZdS)�	SyntaxErrN)rrr�
SYNTAX_ERRr!rrrrr9msr9c@seZdZeZdS)�InvalidModificationErrN)rrr�INVALID_MODIFICATION_ERRr!rrrrr;psr;c@seZdZeZdS)�NamespaceErrN)rrr�
NAMESPACE_ERRr!rrrrr=ssr=c@seZdZeZdS)�InvalidAccessErrN)rrr�INVALID_ACCESS_ERRr!rrrrr?vsr?c@seZdZeZdS)�
ValidationErrN)rrr�VALIDATION_ERRr!rrrrrAysrAc@s eZdZdZdZdZdZdZdS)�UserDataHandlerzBClass giving the operation constants for UserDataHandler.handle().rrrrN)rrrrZNODE_CLONEDZ
NODE_IMPORTEDZNODE_DELETEDZNODE_RENAMEDrrrrrC|s
rCz$http://www.w3.org/XML/1998/namespacezhttp://www.w3.org/2000/xmlns/zhttp://www.w3.org/1999/xhtmlN)�getDOMImplementation�registerDOMImplementation)-rrr$r&r(r*r,r.r0r2r4r6r8r:r<r>r@rBrrr#r%r'r)r+r-r/r1r3r5r7r9r;r=r?rArCZ
XML_NAMESPACEZXMLNS_NAMESPACEZXHTML_NAMESPACEZEMPTY_NAMESPACEZEMPTY_PREFIXZdomregrDrErrrr�<module>sR
xml/dom/__pycache__/domreg.cpython-38.opt-1.pyc000064400000005444151153537540015217 0ustar00U

e5d{
�@s@dZddlZddd�ZiZdd�Zdd	�Zddd�Zd
d�ZdS)z�Registration facilities for DOM. This module should not be used
directly. Instead, the functions getDOMImplementation and
registerDOMImplementation should be imported from xml.dom.�Nzxml.dom.minidomzxml.dom.DOMImplementation)ZminidomZ4DOMcCs|t|<dS)aIregisterDOMImplementation(name, factory)

    Register the factory function with the name. The factory function
    should return an object which implements the DOMImplementation
    interface. The factory function can either return the same object,
    or a new one (e.g. if that implementation supports some
    customization).N)�
registered)�name�factory�r�&/usr/lib64/python3.8/xml/dom/domreg.py�registerDOMImplementations	rcCs$|D]\}}|�||�sdSqdS)zF_good_enough(dom, features) -> Return 1 if the dom offers the featuresr�)Z
hasFeature)�dom�features�f�vrrr�_good_enough sr
rc	Cs�ddl}d}t�|�}|r2t|iidg�}|��S|r@t|�Stjjsbd|j	krbt|j	dd�St
|t�rtt|�}t�
�D]}|�}t||�r||Sq|t��D]>}zt|d�}Wntk
r�Yq�YnXt||�r�|Sq�td��dS)aSgetDOMImplementation(name = None, features = ()) -> DOM implementation.

    Return a suitable DOM implementation. The name is either
    well-known, the module name of a DOM implementation, or None. If
    it is not None, imports the corresponding module and returns
    DOMImplementation object if the import succeeds.

    If name is not given, consider the available implementations to
    find one with the required feature set. If no implementation can
    be found, raise an ImportError. The features list must be a sequence
    of (feature, version) pairs which are passed to hasFeature.rN�getDOMImplementationZ
PYTHON_DOM)rz$no suitable DOM implementation found)�os�well_known_implementations�get�
__import__rr�sys�flags�ignore_environment�environ�
isinstance�str�_parse_feature_string�valuesr
�keys�	Exception�ImportError)rr
rZcreator�modr	rrrr's0








rcCs�g}|��}d}t|�}||kr�||}|ddkrBtd|f��|d}d}||krv||}|ddkrv|d}|}|�||f�qt|�S)Nr�
0123456789zbad feature name: %rr)�split�len�
ValueError�append�tuple)�sr
�parts�iZlengthZfeature�versionrrrrrRs"r)Nr)�__doc__rrrrr
rrrrrr�<module>s�
+xml/dom/__pycache__/domreg.cpython-38.pyc000064400000005444151153537540014260 0ustar00U

e5d{
�@s@dZddlZddd�ZiZdd�Zdd	�Zddd�Zd
d�ZdS)z�Registration facilities for DOM. This module should not be used
directly. Instead, the functions getDOMImplementation and
registerDOMImplementation should be imported from xml.dom.�Nzxml.dom.minidomzxml.dom.DOMImplementation)ZminidomZ4DOMcCs|t|<dS)aIregisterDOMImplementation(name, factory)

    Register the factory function with the name. The factory function
    should return an object which implements the DOMImplementation
    interface. The factory function can either return the same object,
    or a new one (e.g. if that implementation supports some
    customization).N)�
registered)�name�factory�r�&/usr/lib64/python3.8/xml/dom/domreg.py�registerDOMImplementations	rcCs$|D]\}}|�||�sdSqdS)zF_good_enough(dom, features) -> Return 1 if the dom offers the featuresr�)Z
hasFeature)�dom�features�f�vrrr�_good_enough sr
rc	Cs�ddl}d}t�|�}|r2t|iidg�}|��S|r@t|�Stjjsbd|j	krbt|j	dd�St
|t�rtt|�}t�
�D]}|�}t||�r||Sq|t��D]>}zt|d�}Wntk
r�Yq�YnXt||�r�|Sq�td��dS)aSgetDOMImplementation(name = None, features = ()) -> DOM implementation.

    Return a suitable DOM implementation. The name is either
    well-known, the module name of a DOM implementation, or None. If
    it is not None, imports the corresponding module and returns
    DOMImplementation object if the import succeeds.

    If name is not given, consider the available implementations to
    find one with the required feature set. If no implementation can
    be found, raise an ImportError. The features list must be a sequence
    of (feature, version) pairs which are passed to hasFeature.rN�getDOMImplementationZ
PYTHON_DOM)rz$no suitable DOM implementation found)�os�well_known_implementations�get�
__import__rr�sys�flags�ignore_environment�environ�
isinstance�str�_parse_feature_string�valuesr
�keys�	Exception�ImportError)rr
rZcreator�modr	rrrr's0








rcCs�g}|��}d}t|�}||kr�||}|ddkrBtd|f��|d}d}||krv||}|ddkrv|d}|}|�||f�qt|�S)Nr�
0123456789zbad feature name: %rr)�split�len�
ValueError�append�tuple)�sr
�parts�iZlengthZfeature�versionrrrrrRs"r)Nr)�__doc__rrrrr
rrrrrr�<module>s�
+xml/dom/__pycache__/expatbuilder.cpython-38.opt-1.pyc000064400000064270151153537540016434 0ustar00U

e5d���@sdZddlmZmZmZddlmZmZmZddlm	Z	ddl
mZmZddl
mZejZejZejZejjZejjZejjZejjZe��Ze�dd�e�dd	�e�dd
�e�dd�e�dd�e�dd
�e�dd�e�dd�e�dd�d�	ZGdd�de�Zdd�Zdd�ZGdd�d�ZeeefZ Gdd�de�Z!Gdd�de�Z"Gdd�de"�Z#Gd d!�d!e"�Z$d"Z%d#e%Z&Gd$d%�d%e�Z'Gd&d'�d'�Z(Gd(d)�d)e(e�Z)Gd*d+�d+e(e'�Z*Gd,d-�d-e+�Z,Gd.d/�d/e�Z-d;d1d2�Z.d<d3d4�Z/d=d5d6�Z0d>d7d8�Z1d9d:�Z2dS)?z�Facility to use the Expat parser to load a minidom instance
from a string or file.

This avoids all the overhead of SAX and pulldom to gain performance.
�)�
xmlbuilder�minidom�Node)�EMPTY_NAMESPACE�EMPTY_PREFIX�XMLNS_NAMESPACE)�expat)�
_append_child�_set_attribute_node)�
NodeFilterNZcdata�enumeration�entity�entities�idZidrefZidrefsZnmtokenZnmtokens)	ZCDATA�ENUMZENTITYZENTITIES�IDZIDREFZIDREFSZNMTOKENZNMTOKENSc@sZeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)�ElementInfo��
_attr_info�_model�tagNameNcCs||_g|_||_dS�N)rrr)�selfr�model�r�,/usr/lib64/python3.8/xml/dom/expatbuilder.py�__init__?szElementInfo.__init__cCs|j|j|jfSrr�rrrr�__getstate__DszElementInfo.__getstate__cCs|\|_|_|_dSrr)r�staterrr�__setstate__GszElementInfo.__setstate__cCsN|jD]@}|d|kr|d}|ddkr6tdSt|dSqtjS)N����r�(r)r�
_typeinfo_mapr�_no_type)r�aname�info�trrr�getAttributeTypeJs
zElementInfo.getAttributeTypecCstjSr)rr%)rZnamespaceURIZ	localNamerrr�getAttributeTypeNSTszElementInfo.getAttributeTypeNScCs,|jr$|jd}|tjjtjjfkSdSdS�NrF)rrrZ
XML_CTYPE_ANYZXML_CTYPE_MIXED)r�typerrr�isElementContentWs
�zElementInfo.isElementContentcCs |jr|jdtjjkSdSdSr+)rrrZXML_CTYPE_EMPTYrrrr�isEmpty_szElementInfo.isEmptycCs,|jD] }|d|kr|ddkSqdS)Nr!r"rF)r)rr&r'rrr�isIdes
zElementInfo.isIdcCs|�||f�Sr)r/)rZeuriZenameZaurir&rrr�isIdNSkszElementInfo.isIdNS)N)
�__name__�
__module__�__qualname__�	__slots__rrr r)r*r-r.r/r0rrrrr<s

rcCs|�||�Sr)�_intern_setdefault)�builder�srrr�_internosr8cCs�|�d�}|j}t|�dkrR|\}}}|||�}d||f}|||�}|||�}n4t|�dkrz|\}}t}|||�}}ntd|��|||�|||fS)N� �z%s:%s�z4Unsupported syntax: spaces in URIs not supported: %r)�splitr5�lenr�
ValueError)r6�name�parts�intern�uri�	localname�prefix�qnamerrr�_parse_ns_namers



rFc@s�eZdZdZd;dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�ZdS)<�ExpatBuilderzPDocument builder that uses Expat to build a ParsedXML.DOM document
    instance.NcCsP|dkrt��}||_|jjdk	r2t|jj�|_nd|_t|_d|_|�	�dSr)
rZOptions�_options�filter�FilterVisibilityController�_filterr�_finish_start_element�_parser�reset)r�optionsrrrr�szExpatBuilder.__init__cCst��S)zCreate a new parser object.)r�ParserCreaterrrr�createParser�szExpatBuilder.createParsercCsF|js@|��|_|jjj|_d|j_d|j_d|j_|�|j�|jS)z7Return the parser object, creating a new one if needed.T)	rMrQrA�
setdefaultr5Zbuffer_textZordered_attributesZspecified_attributes�installrrrr�	getParser�s
zExpatBuilder.getParsercCs,t�tdd�|_|j|_|jj|_d|_dS)z6Free all data structures used during DOM construction.NF)�theDOMImplementationZcreateDocumentr�document�curNode�
_elem_info�_cdatarrrrrN�s�
zExpatBuilder.resetcCs�|j|_|j|_|j|_|j|_|jj	r0|j
|_|j|_
|jjrH|j|_|jjrj|j|_|j|_|j|_n|j|_|j|_|j|_|j|_|j|_ dS)z>Install the callbacks needed to build the DOM into the parser.N)!�start_doctype_decl_handler�StartDoctypeDeclHandler�first_element_handler�StartElementHandler�end_element_handler�EndElementHandler�
pi_handler�ProcessingInstructionHandlerrHr�entity_decl_handler�EntityDeclHandler�notation_decl_handler�NotationDeclHandler�comments�comment_handler�CommentHandlerZcdata_sections�start_cdata_section_handler�StartCdataSectionHandler�end_cdata_section_handler�EndCdataSectionHandler�character_data_handler_cdata�CharacterDataHandler�character_data_handler�external_entity_ref_handler�ExternalEntityRefHandler�xml_decl_handlerZXmlDeclHandler�element_decl_handlerZElementDeclHandler�attlist_decl_handlerZAttlistDeclHandler�r�parserrrrrS�s$
zExpatBuilder.installcCs�|��}d}zH|�d�}|sqF|�|d�|r@|jjr@|�|�d}q|�dd�Wntk
rhYnX|j}|��d|_|S)zIParse a document from a file object, returning the document
        node.Ti@rF�N)	rT�read�ParserV�documentElement�
_setup_subset�ParseEscaperNrM)r�filervZfirst_buffer�buffer�docrrr�	parseFile�s"

zExpatBuilder.parseFilecCsP|��}z|�|d�|�|�Wntk
r6YnX|j}|��d|_|S)z<Parse a document from a string, returning the document node.TN)rTryr{r|rVrNrM)r�stringrvrrrr�parseString�szExpatBuilder.parseStringcCs.|jjr*t�}|�|�|��}||jj_dS)z/Load the internal subset if there might be one.N)rV�doctype�InternalSubsetExtractorr��	getSubset�internalSubset)rr~Z	extractor�subsetrrrr{�s

zExpatBuilder._setup_subsetcCs�|jj�|||�}|j|_t|j|�||j_|jrj|j�|�tkrjd|j_|jj	d=d}d|j
_d|j
_|r�|dk	r�g|j
_g|j_d|j
_d|j
_|j|j
_dS�N���)rV�implementationZcreateDocumentType�
ownerDocumentr	r�rK�
acceptNode�
FILTER_REJECT�
childNodesrMrcrer�_seq�	notationsrhra�end_doctype_decl_handler�EndDoctypeDeclHandler)rZdoctypeName�systemId�publicId�has_internal_subsetr�rrrrZ�s*�
z'ExpatBuilder.start_doctype_decl_handlercCs2|jjr|j|j_|j|j_|js.|js.t	|_
dSr)rHrfrgrMrhr`rarXrKr�_finish_end_elementrrrrr�s


z%ExpatBuilder.end_doctype_decl_handlercCs@|j�||�}t|j|�|jr<|j�|�tkr<|j�|�dSr)rVZcreateProcessingInstructionr	rWrKr�r��removeChild)r�target�data�noderrrr`szExpatBuilder.pi_handlercCs�|jj}|jrH|jr4|djtkr4|d�|�dS|j�|�}d|_nD|rv|djt	krv|d}|j
|}||_
dSt��}||_
|j|_
t|j|�dS)Nr�T)rWr�rY�_cdata_continue�nodeType�CDATA_SECTION_NODEZ
appendDatarVZcreateCDATASection�	TEXT_NODEr�r�Textr�r	)rr�r�r��valuerrrrms$�
z)ExpatBuilder.character_data_handler_cdatacCs^|jj}|r2|djtkr2|d}|j||_dSt��}|j||_|j|_t	|j|�dSr�)
rWr�r�r�r�rr�rVr�r	)rr�r�r�rrrro&sz#ExpatBuilder.character_data_handlerc
Cs�|rdS|jjsdS|j�||||�}|dk	rF|j�|�}	|j�|	�|jjjj�|�|j	r||j	�
|�tkr||jjjjd=dSr�)rHrrVZ_create_entityZcreateTextNoder��appendr�r�rKr�r�)
rZ
entityNameZis_parameter_entityr��baser�r��notationNamer��childrrrrb1s
�z ExpatBuilder.entity_decl_handlercCsJ|j�|||�}|jjjj�|�|jrF|j�|�tkrF|jjjjd=dSr�)	rVZ_create_notationr�r�r�r�rKr��
FILTER_ACCEPT)rr�r�r�r�r�rrrrdCsz"ExpatBuilder.notation_decl_handlercCs>|j�|�}t|j|�|jr:|j�|�tkr:|j�|�dSr)rVZ
createCommentr	rWrKr�r�r�)rr�r�rrrrgIszExpatBuilder.comment_handlercCsd|_d|_dS)NTF�rYr�rrrrriOsz(ExpatBuilder.start_cdata_section_handlercCsd|_d|_dS)NFr�rrrrrkSsz&ExpatBuilder.end_cdata_section_handlercCsdS�Nr!r)r�contextr�r�r�rrrrpWsz(ExpatBuilder.external_entity_ref_handlercCs2|jdkr|jst|_|j|��_|�||�dSr)rKrXrr��start_element_handlerrTr])rr?�
attributesrrrr\Zsz"ExpatBuilder.first_element_handlercCs�|j�|�}t|j|�||_|rptdt|�d�D]<}t�||tdt	�}||d}||_
|j|_t||�q2||jj
k	r�|�|�dS)Nrr;r!)rVZ
createElementr	rW�ranger=r�Attrrrr�r�r
rzrL)rr?r�r��i�ar�rrrr�`s�z"ExpatBuilder.start_element_handlercCsj|jrf||jjkrdS|j�|�}|tkr4t|�n|tkrFt|�ndS|j|_	|j�
|�|��dSr)rKrVrz�startContainerr��Rejecter�FILTER_SKIP�Skipper�
parentNoderWr��unlink)rr�ZfiltrrrrLqs

z"ExpatBuilder._finish_start_elementcCs|j}|j|_|�|�dSr)rWr�r�)rr?rWrrrr^�sz ExpatBuilder.end_element_handlercCs\|j�|j�}|r|�||�|jrX||jjkr4dS|j�|�tkrX|j	�
|�|��dSr)rX�getr�_handle_white_text_nodesrKrVrzr�r�rWr�r�)rrWr'rrrr��sz ExpatBuilder._finish_end_elementcCsZ|jjs|��sdSg}|jD]"}|jtkr|j��s|�|�q|D]}|�	|�qFdSr)
rHZwhitespace_in_element_contentr-r�r�r�r��stripr�r�)rr�r'�Lr�rrrr��s�
z%ExpatBuilder._handle_white_text_nodescCs0|j�|�}|dkr&t||�|j|<n||_dSr)rXr�rr)rr?rr'rrrrs�sz!ExpatBuilder.element_decl_handlerc
CsF|j�|�}|dkr&t|�}||j|<|j�d|dd|d||g�dS�Nr)rXr�rrr�)r�elemr?r,�defaultZrequiredr'rrrrt�s
�z!ExpatBuilder.attlist_decl_handlercCs2||j_||j_|dkr.|r&d|j_nd|j_dS)NrTF)rV�version�encoding�
standalone)rr�r�r�rrrrr�s
zExpatBuilder.xml_decl_handler)N) r1r2r3�__doc__rrQrTrNrSr�r�r{rZr�r`rmrorbrdrgrirkrpr\r�rLr^r�r�rsrtrrrrrrrG�s:

rGc@s�eZdZdZdZdd�Zdd�Zdd�Zej	e
jeje
j
eje
jeje
jeje
jeje
jeje
jeje
jeje
jeje
jeje
jej e
j!iZ"d	S)
rJzoWrapper around a DOMBuilderFilter which implements the checks
    to make the whatToShow filter attribute work.�rIcCs
||_dSrr�)rrIrrrr�sz#FilterVisibilityController.__init__cCsT|j|j}|jj|@rL|j�|�}|tkr0t�|tkrHtdt	|���|St
SdS)Nz)startContainer() returned illegal value: )�_nodetype_maskr�rI�
whatToShowr��FILTER_INTERRUPTr|�_ALLOWED_FILTER_RETURNSr>�reprr�)rr��mask�valrrrr��s
�z)FilterVisibilityController.startContainercCs�|j|j}|jj|@r||j�|�}|tkr0t�|tkr`|j}|j	dd�D]}|�
|�qLtS|tkrxt
dt|���|StSdS)Nz%acceptNode() returned illegal value: )r�r�rIr�r�r�r|r�r�r�ZappendChildr�r�r>r�r�)rr�r�r��parentr�rrrr��s 
�z%FilterVisibilityController.acceptNodeN)#r1r2r3r�r4rr�r�rZELEMENT_NODErZSHOW_ELEMENTZATTRIBUTE_NODEZSHOW_ATTRIBUTEr�Z	SHOW_TEXTr�ZSHOW_CDATA_SECTIONZENTITY_REFERENCE_NODEZSHOW_ENTITY_REFERENCEZENTITY_NODEZSHOW_ENTITYZPROCESSING_INSTRUCTION_NODEZSHOW_PROCESSING_INSTRUCTIONZCOMMENT_NODEZSHOW_COMMENT�
DOCUMENT_NODEZ
SHOW_DOCUMENTZDOCUMENT_TYPE_NODEZSHOW_DOCUMENT_TYPEZDOCUMENT_FRAGMENT_NODEZSHOW_DOCUMENT_FRAGMENTZ
NOTATION_NODEZ
SHOW_NOTATIONr�rrrrrJ�s<
�rJc@seZdZdZdd�ZdS)�FilterCrutch)�_builder�_level�
_old_start�_old_endcCs6d|_||_|j}|j|_|j|_|j|_|j|_dSr�)	r�r�rMr]r�r_r�r�r^)rr6rvrrrrszFilterCrutch.__init__N)r1r2r3r4rrrrrr�sr�c@s(eZdZdZdd�Zdd�Zdd�ZdS)	r�rcCs,t�||�|j}dD]}t||d�qdS)N)rarhrnrjrlrq)r�rrM�setattr)rr6rvr?rrrrszRejecter.__init__cGs|jd|_dSr�)r��r�argsrrrr�szRejecter.start_element_handlercGs@|jdkr0|jj}|j�|�|j|_|j|_n|jd|_dS�Nrr!)r�r�rMrSr�r]r�r_)rr�rvrrrr^ s

zRejecter.end_element_handlerN)r1r2r3r4rr�r^rrrrr�sr�c@s eZdZdZdd�Zdd�ZdS)r�rcGs.|jj}|j|�|jj|k	r*|jd|_dSr�)r�rWr�r�)rr�r�rrrr�-s
zSkipper.start_element_handlercGsD|jdkr*|j|jj_|j|jj_d|_n|jd|_|j|�dSr�)r�r�r�rMr]r�r_r�rrrr^3s
zSkipper.end_element_handlerN)r1r2r3r4r�r^rrrrr�*sr�z8http://xml.python.org/entities/fragment-builder/internalz�<!DOCTYPE wrapper
  %%s [
  <!ENTITY fragment-builder-internal
    SYSTEM "%s">
%%s
]>
<wrapper %%s
>&fragment-builder-internal;</wrapper>c@sJeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�FragmentBuilderz�Builder which constructs document fragments given XML source
    text and a context node.

    The context node is expected to provide information about the
    namespace declarations which are in scope at the start of the
    fragment.
    NcCs6|jtkr||_||_n|j|_||_t�||�dSr)r�r��originalDocumentr�r�rGr)rr�rOrrrr[s
zFragmentBuilder.__init__cCst�|�d|_dSr)rGrN�fragmentrrrrrNds
zFragmentBuilder.resetcCs|�|���S)zRParse a document fragment from a file object, returning the
        fragment node.)r�rx�rr}rrrr�hszFragmentBuilder.parseFilec	Cs�||_|��}|jj}d}|rV|jp*|��}|jrDd|j|jf}qZ|jrZd|j}nd}|��}t	|||f}z|�
|d�Wn|���YnX|j}|��|S)zMParse a document fragment from a string, returning the
        fragment node.rwzPUBLIC "%s" "%s"zSYSTEM "%s"r!)
�_sourcerTr�r�r��_getDeclarationsr�r��_getNSattrs�_FRAGMENT_BUILDER_TEMPLATEryrNr�)	rr�rvr�Zidentr�ZnsattrsrVr�rrrr�ms.
�zFragmentBuilder.parseStringcCs|jjj}d}|�rt|jj�D]R}|j�|�}|r<|d}d||jf}|jrdd||j|j	f}q d||j	f}q t|j
j�D]�}|j
�|�}|r�|d}d||jf}|jr�d||j|j	f}n&|j	r�d||j	f}nd	||jjf}|j
r�d
||j
f}|d}q�|S)z�Re-create the internal subset from the DocumentType node.

        This is only needed if we don't already have the
        internalSubset as a string.
        rwz
  z%s<!NOTATION %sz!%s PUBLIC "%s"
             "%s">z%s SYSTEM "%s">z
%s<!ENTITY %sz %s PUBLIC "%s"
             "%s"z%s SYSTEM "%s"z%s "%s"z%s NOTATION %s�>)r�r�r�r�r�Zlength�itemZnodeNamer�r�rZ
firstChildr�r�)rr�r7r�Znotationr
rrrr��s:
��
z FragmentBuilder._getDeclarationscCsdS)Nrwrrrrrr��szFragmentBuilder._getNSattrscCs~|tkrh|j}|j}|j�|�}|j|_|j��|_|j|_z|�	|jd�W5||_||_d|_XdSt
�|||||�SdS)Nr!r�)�$_FRAGMENT_BUILDER_INTERNAL_SYSTEM_IDrVrWrMZExternalEntityParserCreater�ZcreateDocumentFragmentr�r�ryrGrp)rr�r�r�r�Zold_documentZold_cur_nodervrrrrp�s(�z+FragmentBuilder.external_entity_ref_handler)N)r1r2r3r�rrNr�r�r�r�rprrrrr�Rs
	$r�c@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�
Namespacesz7Mix-in class for builders; adds support for namespaces.cCs
g|_dSr)�_ns_ordered_prefixesrrrr�_initNamespaces�szNamespaces._initNamespacescCstjdd�}d|_|S)z'Create a new namespace-handling parser.r9)Znamespace_separatorT)rrPZnamespace_prefixesrurrrrQ�szNamespaces.createParsercCs t�||�|jjr|j|_dS)z.Insert the namespace-handlers onto the parser.N)rGrSrHZnamespace_declarations�start_namespace_decl_handlerZStartNamespaceDeclHandlerrurrrrS�s�zNamespaces.installcCs|j�||f�dS)z/Push this namespace declaration on our storage.N)r�r�)rrDrBrrrr��sz'Namespaces.start_namespace_decl_handlercCs�d|krt||�\}}}}nt}|}d}t}t�||||�}|j|_t|j|�||_|j	r�|j	D]P\}}|r�t�
t|d|�t|d�}nt�
dtdt�}||_
|j|_t||�qb|j	dd�=|�r~|��|j}	|j}
tdt|�d�D]�}||}||d}
d|k�rDt||�\}}}}t�
||||�}||	|<||
||f<n$t�
|t|t�}||	|<||
t|f<|j|_|
|_
||_q�dS)Nr9�xmlns:�xmlnsrr;r!)rFrrrZElementrVr�r	rWr�r�r8rr�r
Z_ensure_attributes�_attrs�_attrsNSr�r=ZownerElement)rr?r�rBrCrDrEr�r�r�r�r�r&r�rrrr��s^��
�z Namespaces.start_element_handlerN)
r1r2r3r�r�rQrSr�r�r^rrrrr��s5r�c@seZdZdZdd�ZdS)�ExpatBuilderNSz*Document builder that supports namespaces.cCst�|�|��dSr)rGrNr�rrrrrN)s
zExpatBuilderNS.resetN)r1r2r3r�rNrrrrr�&sr�c@s eZdZdZdd�Zdd�ZdS)�FragmentBuilderNSz*Fragment builder that supports namespaces.cCst�|�|��dSr)r�rNr�rrrrrN1s
zFragmentBuilderNS.resetcCs�d}|j}g}|r~t|d�rv|j��D]N\}}||kr8q&|�|�|rPd|}nd}|rhd|||f}q&d||f}q&|j}q|S)zNReturn string of namespace attributes from this element and
        ancestors.rw�_ns_prefix_urir�r�z%s
    %s='%s'z %s='%s')r��hasattrr��itemsr�r�)r�attrsr�r�rDrBZdeclnamerrrr�5s"


zFragmentBuilderNS._getNSattrsN)r1r2r3r�rNr�rrrrr�.sr�c@seZdZdZdS)r|zEException raised to short-circuit parsing in InternalSubsetExtractor.N)r1r2r3r�rrrrr|Ssr|c@sLeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�ZdS)r�zBXML processor which can rip out the internal document type subset.NcCs|jS)z'Return the internal subset as a string.)r�rrrrr�\sz!InternalSubsetExtractor.getSubsetcCs*zt�||�Wntk
r$YnXdSr)rGr�r|r�rrrr�`sz!InternalSubsetExtractor.parseFilecCs*zt�||�Wntk
r$YnXdSr)rGr�r|)rr�rrrr�fsz#InternalSubsetExtractor.parseStringcCs|j|_|j|_dSr)rZr[r�r]rurrrrSlszInternalSubsetExtractor.installcCs0|r&|��}g|_|jj|_|j|_nt��dSr)rTr�r�ZDefaultHandlerr�r�r|)rr?r�r�r�rvrrrrZps

z2InternalSubsetExtractor.start_doctype_decl_handlercCs,d�|j��dd��dd�}||_t��dS)Nrwz
�
�
)�joinr��replacer|)rr7rrrr�zsz0InternalSubsetExtractor.end_doctype_decl_handlercCs
t��dSr)r|)rr?r�rrrr�sz-InternalSubsetExtractor.start_element_handler)r1r2r3r�r�r�r�r�rSrZr�r�rrrrr�Ws
r�Tc	CsL|rt�}nt�}t|t�r>t|d��}|�|�}W5QRXn
|�|�}|S)z{Parse a document, returning the resulting Document node.

    'file' may be either a file name or an open file object.
    �rb)r�rG�
isinstance�str�openr�)r}�
namespacesr6�fp�resultrrr�parse�s

r�cCs|rt�}nt�}|�|�S)zOParse a document from a string, returning the resulting
    Document node.
    )r�rGr�)r�r�r6rrrr��sr�c	CsP|rt|�}nt|�}t|t�rBt|d��}|�|�}W5QRXn
|�|�}|S)z�Parse a fragment of a document, given the context from which it
    was originally extracted.  context should be the parent of the
    node(s) which are in the fragment.

    'file' may be either a file name or an open file object.
    r�)r�r�r�r�r�r�)r}r�r�r6r�r�rrr�
parseFragment�s


r�cCs |rt|�}nt|�}|�|�S)z�Parse a fragment of a document from a string, given the context
    from which it was originally extracted.  context should be the
    parent of the node(s) which are in the fragment.
    )r�r�r�)r�r�r�r6rrr�parseFragmentString�s
r�cCs|jrt|�St|�SdS)z,Create a builder based on an Options object.N)r�r�rG)rOrrr�makeBuilder�sr�)T)T)T)T)3r�Zxml.domrrrrrrZxml.parsersrZxml.dom.minidomr	r
Zxml.dom.NodeFilterrr�r�r�ZDOMBuilderFilterr�r�r�r�ZgetDOMImplementationrUZTypeInfor$�objectrr8rFrGr�rJr�r�r�r�r�r�r�r�r��	Exceptionr|r�r�r�r�r�r�rrrr�<module>sf








�3C
:�	��
u_%,



xml/dom/pulldom.py000064400000027335151153537540010174 0ustar00import xml.sax
import xml.sax.handler

START_ELEMENT = "START_ELEMENT"
END_ELEMENT = "END_ELEMENT"
COMMENT = "COMMENT"
START_DOCUMENT = "START_DOCUMENT"
END_DOCUMENT = "END_DOCUMENT"
PROCESSING_INSTRUCTION = "PROCESSING_INSTRUCTION"
IGNORABLE_WHITESPACE = "IGNORABLE_WHITESPACE"
CHARACTERS = "CHARACTERS"

class PullDOM(xml.sax.ContentHandler):
    _locator = None
    document = None

    def __init__(self, documentFactory=None):
        from xml.dom import XML_NAMESPACE
        self.documentFactory = documentFactory
        self.firstEvent = [None, None]
        self.lastEvent = self.firstEvent
        self.elementStack = []
        self.push = self.elementStack.append
        try:
            self.pop = self.elementStack.pop
        except AttributeError:
            # use class' pop instead
            pass
        self._ns_contexts = [{XML_NAMESPACE:'xml'}] # contains uri -> prefix dicts
        self._current_context = self._ns_contexts[-1]
        self.pending_events = []

    def pop(self):
        result = self.elementStack[-1]
        del self.elementStack[-1]
        return result

    def setDocumentLocator(self, locator):
        self._locator = locator

    def startPrefixMapping(self, prefix, uri):
        if not hasattr(self, '_xmlns_attrs'):
            self._xmlns_attrs = []
        self._xmlns_attrs.append((prefix or 'xmlns', uri))
        self._ns_contexts.append(self._current_context.copy())
        self._current_context[uri] = prefix or None

    def endPrefixMapping(self, prefix):
        self._current_context = self._ns_contexts.pop()

    def startElementNS(self, name, tagName , attrs):
        # Retrieve xml namespace declaration attributes.
        xmlns_uri = 'http://www.w3.org/2000/xmlns/'
        xmlns_attrs = getattr(self, '_xmlns_attrs', None)
        if xmlns_attrs is not None:
            for aname, value in xmlns_attrs:
                attrs._attrs[(xmlns_uri, aname)] = value
            self._xmlns_attrs = []
        uri, localname = name
        if uri:
            # When using namespaces, the reader may or may not
            # provide us with the original name. If not, create
            # *a* valid tagName from the current context.
            if tagName is None:
                prefix = self._current_context[uri]
                if prefix:
                    tagName = prefix + ":" + localname
                else:
                    tagName = localname
            if self.document:
                node = self.document.createElementNS(uri, tagName)
            else:
                node = self.buildDocument(uri, tagName)
        else:
            # When the tagname is not prefixed, it just appears as
            # localname
            if self.document:
                node = self.document.createElement(localname)
            else:
                node = self.buildDocument(None, localname)

        for aname,value in attrs.items():
            a_uri, a_localname = aname
            if a_uri == xmlns_uri:
                if a_localname == 'xmlns':
                    qname = a_localname
                else:
                    qname = 'xmlns:' + a_localname
                attr = self.document.createAttributeNS(a_uri, qname)
                node.setAttributeNodeNS(attr)
            elif a_uri:
                prefix = self._current_context[a_uri]
                if prefix:
                    qname = prefix + ":" + a_localname
                else:
                    qname = a_localname
                attr = self.document.createAttributeNS(a_uri, qname)
                node.setAttributeNodeNS(attr)
            else:
                attr = self.document.createAttribute(a_localname)
                node.setAttributeNode(attr)
            attr.value = value

        self.lastEvent[1] = [(START_ELEMENT, node), None]
        self.lastEvent = self.lastEvent[1]
        self.push(node)

    def endElementNS(self, name, tagName):
        self.lastEvent[1] = [(END_ELEMENT, self.pop()), None]
        self.lastEvent = self.lastEvent[1]

    def startElement(self, name, attrs):
        if self.document:
            node = self.document.createElement(name)
        else:
            node = self.buildDocument(None, name)

        for aname,value in attrs.items():
            attr = self.document.createAttribute(aname)
            attr.value = value
            node.setAttributeNode(attr)

        self.lastEvent[1] = [(START_ELEMENT, node), None]
        self.lastEvent = self.lastEvent[1]
        self.push(node)

    def endElement(self, name):
        self.lastEvent[1] = [(END_ELEMENT, self.pop()), None]
        self.lastEvent = self.lastEvent[1]

    def comment(self, s):
        if self.document:
            node = self.document.createComment(s)
            self.lastEvent[1] = [(COMMENT, node), None]
            self.lastEvent = self.lastEvent[1]
        else:
            event = [(COMMENT, s), None]
            self.pending_events.append(event)

    def processingInstruction(self, target, data):
        if self.document:
            node = self.document.createProcessingInstruction(target, data)
            self.lastEvent[1] = [(PROCESSING_INSTRUCTION, node), None]
            self.lastEvent = self.lastEvent[1]
        else:
            event = [(PROCESSING_INSTRUCTION, target, data), None]
            self.pending_events.append(event)

    def ignorableWhitespace(self, chars):
        node = self.document.createTextNode(chars)
        self.lastEvent[1] = [(IGNORABLE_WHITESPACE, node), None]
        self.lastEvent = self.lastEvent[1]

    def characters(self, chars):
        node = self.document.createTextNode(chars)
        self.lastEvent[1] = [(CHARACTERS, node), None]
        self.lastEvent = self.lastEvent[1]

    def startDocument(self):
        if self.documentFactory is None:
            import xml.dom.minidom
            self.documentFactory = xml.dom.minidom.Document.implementation

    def buildDocument(self, uri, tagname):
        # Can't do that in startDocument, since we need the tagname
        # XXX: obtain DocumentType
        node = self.documentFactory.createDocument(uri, tagname, None)
        self.document = node
        self.lastEvent[1] = [(START_DOCUMENT, node), None]
        self.lastEvent = self.lastEvent[1]
        self.push(node)
        # Put everything we have seen so far into the document
        for e in self.pending_events:
            if e[0][0] == PROCESSING_INSTRUCTION:
                _,target,data = e[0]
                n = self.document.createProcessingInstruction(target, data)
                e[0] = (PROCESSING_INSTRUCTION, n)
            elif e[0][0] == COMMENT:
                n = self.document.createComment(e[0][1])
                e[0] = (COMMENT, n)
            else:
                raise AssertionError("Unknown pending event ",e[0][0])
            self.lastEvent[1] = e
            self.lastEvent = e
        self.pending_events = None
        return node.firstChild

    def endDocument(self):
        self.lastEvent[1] = [(END_DOCUMENT, self.document), None]
        self.pop()

    def clear(self):
        "clear(): Explicitly release parsing structures"
        self.document = None

class ErrorHandler:
    def warning(self, exception):
        print(exception)
    def error(self, exception):
        raise exception
    def fatalError(self, exception):
        raise exception

class DOMEventStream:
    def __init__(self, stream, parser, bufsize):
        self.stream = stream
        self.parser = parser
        self.bufsize = bufsize
        if not hasattr(self.parser, 'feed'):
            self.getEvent = self._slurp
        self.reset()

    def reset(self):
        self.pulldom = PullDOM()
        # This content handler relies on namespace support
        self.parser.setFeature(xml.sax.handler.feature_namespaces, 1)
        self.parser.setContentHandler(self.pulldom)

    def __getitem__(self, pos):
        import warnings
        warnings.warn(
            "DOMEventStream's __getitem__ method ignores 'pos' parameter. "
            "Use iterator protocol instead.",
            DeprecationWarning,
            stacklevel=2
        )
        rc = self.getEvent()
        if rc:
            return rc
        raise IndexError

    def __next__(self):
        rc = self.getEvent()
        if rc:
            return rc
        raise StopIteration

    def __iter__(self):
        return self

    def expandNode(self, node):
        event = self.getEvent()
        parents = [node]
        while event:
            token, cur_node = event
            if cur_node is node:
                return
            if token != END_ELEMENT:
                parents[-1].appendChild(cur_node)
            if token == START_ELEMENT:
                parents.append(cur_node)
            elif token == END_ELEMENT:
                del parents[-1]
            event = self.getEvent()

    def getEvent(self):
        # use IncrementalParser interface, so we get the desired
        # pull effect
        if not self.pulldom.firstEvent[1]:
            self.pulldom.lastEvent = self.pulldom.firstEvent
        while not self.pulldom.firstEvent[1]:
            buf = self.stream.read(self.bufsize)
            if not buf:
                self.parser.close()
                return None
            self.parser.feed(buf)
        rc = self.pulldom.firstEvent[1][0]
        self.pulldom.firstEvent[1] = self.pulldom.firstEvent[1][1]
        return rc

    def _slurp(self):
        """ Fallback replacement for getEvent() using the
            standard SAX2 interface, which means we slurp the
            SAX events into memory (no performance gain, but
            we are compatible to all SAX parsers).
        """
        self.parser.parse(self.stream)
        self.getEvent = self._emit
        return self._emit()

    def _emit(self):
        """ Fallback replacement for getEvent() that emits
            the events that _slurp() read previously.
        """
        rc = self.pulldom.firstEvent[1][0]
        self.pulldom.firstEvent[1] = self.pulldom.firstEvent[1][1]
        return rc

    def clear(self):
        """clear(): Explicitly release parsing objects"""
        self.pulldom.clear()
        del self.pulldom
        self.parser = None
        self.stream = None

class SAX2DOM(PullDOM):

    def startElementNS(self, name, tagName , attrs):
        PullDOM.startElementNS(self, name, tagName, attrs)
        curNode = self.elementStack[-1]
        parentNode = self.elementStack[-2]
        parentNode.appendChild(curNode)

    def startElement(self, name, attrs):
        PullDOM.startElement(self, name, attrs)
        curNode = self.elementStack[-1]
        parentNode = self.elementStack[-2]
        parentNode.appendChild(curNode)

    def processingInstruction(self, target, data):
        PullDOM.processingInstruction(self, target, data)
        node = self.lastEvent[0][1]
        parentNode = self.elementStack[-1]
        parentNode.appendChild(node)

    def ignorableWhitespace(self, chars):
        PullDOM.ignorableWhitespace(self, chars)
        node = self.lastEvent[0][1]
        parentNode = self.elementStack[-1]
        parentNode.appendChild(node)

    def characters(self, chars):
        PullDOM.characters(self, chars)
        node = self.lastEvent[0][1]
        parentNode = self.elementStack[-1]
        parentNode.appendChild(node)


default_bufsize = (2 ** 14) - 20

def parse(stream_or_string, parser=None, bufsize=None):
    if bufsize is None:
        bufsize = default_bufsize
    if isinstance(stream_or_string, str):
        stream = open(stream_or_string, 'rb')
    else:
        stream = stream_or_string
    if not parser:
        parser = xml.sax.make_parser()
    return DOMEventStream(stream, parser, bufsize)

def parseString(string, parser=None):
    from io import StringIO

    bufsize = len(string)
    buf = StringIO(string)
    if not parser:
        parser = xml.sax.make_parser()
    return DOMEventStream(buf, parser, bufsize)
xml/dom/NodeFilter.py000064400000001650151153537540010543 0ustar00# This is the Python mapping for interface NodeFilter from
# DOM2-Traversal-Range. It contains only constants.

class NodeFilter:
    """
    This is the DOM2 NodeFilter interface. It contains only constants.
    """
    FILTER_ACCEPT = 1
    FILTER_REJECT = 2
    FILTER_SKIP   = 3

    SHOW_ALL                    = 0xFFFFFFFF
    SHOW_ELEMENT                = 0x00000001
    SHOW_ATTRIBUTE              = 0x00000002
    SHOW_TEXT                   = 0x00000004
    SHOW_CDATA_SECTION          = 0x00000008
    SHOW_ENTITY_REFERENCE       = 0x00000010
    SHOW_ENTITY                 = 0x00000020
    SHOW_PROCESSING_INSTRUCTION = 0x00000040
    SHOW_COMMENT                = 0x00000080
    SHOW_DOCUMENT               = 0x00000100
    SHOW_DOCUMENT_TYPE          = 0x00000200
    SHOW_DOCUMENT_FRAGMENT      = 0x00000400
    SHOW_NOTATION               = 0x00000800

    def acceptNode(self, node):
        raise NotImplementedError
xml/__pycache__/__init__.cpython-38.opt-1.pyc000064400000001266151153537540014720 0ustar00U

e5d-�@sdZddddgZdS)a�Core XML support for Python.

This package contains four sub-packages:

dom -- The W3C Document Object Model.  This supports DOM Level 1 +
       Namespaces.

parsers -- Python wrappers for XML parsers (currently only supports Expat).

sax -- The Simple API for XML, developed by XML-Dev, led by David
       Megginson and ported to Python by Lars Marius Garshol.  This
       supports the SAX 2 API.

etree -- The ElementTree XML library.  This is a subset of the full
       ElementTree XML release.

ZdomZparsersZsaxZetreeN)�__doc__�__all__�rr�$/usr/lib64/python3.8/xml/__init__.py�<module>sxml/__pycache__/__init__.cpython-38.opt-2.pyc000064400000000253151153537540014714 0ustar00U

e5d-�@sddddgZdS)ZdomZparsersZsaxZetreeN)�__all__�rr�$/usr/lib64/python3.8/xml/__init__.py�<module>�xml/__pycache__/__init__.cpython-38.pyc000064400000001266151153537540013761 0ustar00U

e5d-�@sdZddddgZdS)a�Core XML support for Python.

This package contains four sub-packages:

dom -- The W3C Document Object Model.  This supports DOM Level 1 +
       Namespaces.

parsers -- Python wrappers for XML parsers (currently only supports Expat).

sax -- The Simple API for XML, developed by XML-Dev, led by David
       Megginson and ported to Python by Lars Marius Garshol.  This
       supports the SAX 2 API.

etree -- The ElementTree XML library.  This is a subset of the full
       ElementTree XML release.

ZdomZparsersZsaxZetreeN)�__doc__�__all__�rr�$/usr/lib64/python3.8/xml/__init__.py�<module>sxml/etree/ElementPath.py000064400000031476151153537540011254 0ustar00#
# ElementTree
# $Id: ElementPath.py 3375 2008-02-13 08:05:08Z fredrik $
#
# limited xpath support for element trees
#
# history:
# 2003-05-23 fl   created
# 2003-05-28 fl   added support for // etc
# 2003-08-27 fl   fixed parsing of periods in element names
# 2007-09-10 fl   new selection engine
# 2007-09-12 fl   fixed parent selector
# 2007-09-13 fl   added iterfind; changed findall to return a list
# 2007-11-30 fl   added namespaces support
# 2009-10-30 fl   added child element value filter
#
# Copyright (c) 2003-2009 by Fredrik Lundh.  All rights reserved.
#
# fredrik@pythonware.com
# http://www.pythonware.com
#
# --------------------------------------------------------------------
# The ElementTree toolkit is
#
# Copyright (c) 1999-2009 by Fredrik Lundh
#
# By obtaining, using, and/or copying this software and/or its
# associated documentation, you agree that you have read, understood,
# and will comply with the following terms and conditions:
#
# Permission to use, copy, modify, and distribute this software and
# its associated documentation for any purpose and without fee is
# hereby granted, provided that the above copyright notice appears in
# all copies, and that both that copyright notice and this permission
# notice appear in supporting documentation, and that the name of
# Secret Labs AB or the author not be used in advertising or publicity
# pertaining to distribution of the software without specific, written
# prior permission.
#
# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
# ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
# --------------------------------------------------------------------

# Licensed to PSF under a Contributor Agreement.
# See http://www.python.org/psf/license for licensing details.

##
# Implementation module for XPath support.  There's usually no reason
# to import this module directly; the <b>ElementTree</b> does this for
# you, if needed.
##

import re

xpath_tokenizer_re = re.compile(
    r"("
    r"'[^']*'|\"[^\"]*\"|"
    r"::|"
    r"//?|"
    r"\.\.|"
    r"\(\)|"
    r"[/.*:\[\]\(\)@=])|"
    r"((?:\{[^}]+\})?[^/\[\]\(\)@=\s]+)|"
    r"\s+"
    )

def xpath_tokenizer(pattern, namespaces=None):
    default_namespace = namespaces.get('') if namespaces else None
    parsing_attribute = False
    for token in xpath_tokenizer_re.findall(pattern):
        ttype, tag = token
        if tag and tag[0] != "{":
            if ":" in tag:
                prefix, uri = tag.split(":", 1)
                try:
                    if not namespaces:
                        raise KeyError
                    yield ttype, "{%s}%s" % (namespaces[prefix], uri)
                except KeyError:
                    raise SyntaxError("prefix %r not found in prefix map" % prefix) from None
            elif default_namespace and not parsing_attribute:
                yield ttype, "{%s}%s" % (default_namespace, tag)
            else:
                yield token
            parsing_attribute = False
        else:
            yield token
            parsing_attribute = ttype == '@'


def get_parent_map(context):
    parent_map = context.parent_map
    if parent_map is None:
        context.parent_map = parent_map = {}
        for p in context.root.iter():
            for e in p:
                parent_map[e] = p
    return parent_map


def _is_wildcard_tag(tag):
    return tag[:3] == '{*}' or tag[-2:] == '}*'


def _prepare_tag(tag):
    _isinstance, _str = isinstance, str
    if tag == '{*}*':
        # Same as '*', but no comments or processing instructions.
        # It can be a surprise that '*' includes those, but there is no
        # justification for '{*}*' doing the same.
        def select(context, result):
            for elem in result:
                if _isinstance(elem.tag, _str):
                    yield elem
    elif tag == '{}*':
        # Any tag that is not in a namespace.
        def select(context, result):
            for elem in result:
                el_tag = elem.tag
                if _isinstance(el_tag, _str) and el_tag[0] != '{':
                    yield elem
    elif tag[:3] == '{*}':
        # The tag in any (or no) namespace.
        suffix = tag[2:]  # '}name'
        no_ns = slice(-len(suffix), None)
        tag = tag[3:]
        def select(context, result):
            for elem in result:
                el_tag = elem.tag
                if el_tag == tag or _isinstance(el_tag, _str) and el_tag[no_ns] == suffix:
                    yield elem
    elif tag[-2:] == '}*':
        # Any tag in the given namespace.
        ns = tag[:-1]
        ns_only = slice(None, len(ns))
        def select(context, result):
            for elem in result:
                el_tag = elem.tag
                if _isinstance(el_tag, _str) and el_tag[ns_only] == ns:
                    yield elem
    else:
        raise RuntimeError(f"internal parser error, got {tag}")
    return select


def prepare_child(next, token):
    tag = token[1]
    if _is_wildcard_tag(tag):
        select_tag = _prepare_tag(tag)
        def select(context, result):
            def select_child(result):
                for elem in result:
                    yield from elem
            return select_tag(context, select_child(result))
    else:
        if tag[:2] == '{}':
            tag = tag[2:]  # '{}tag' == 'tag'
        def select(context, result):
            for elem in result:
                for e in elem:
                    if e.tag == tag:
                        yield e
    return select

def prepare_star(next, token):
    def select(context, result):
        for elem in result:
            yield from elem
    return select

def prepare_self(next, token):
    def select(context, result):
        yield from result
    return select

def prepare_descendant(next, token):
    try:
        token = next()
    except StopIteration:
        return
    if token[0] == "*":
        tag = "*"
    elif not token[0]:
        tag = token[1]
    else:
        raise SyntaxError("invalid descendant")

    if _is_wildcard_tag(tag):
        select_tag = _prepare_tag(tag)
        def select(context, result):
            def select_child(result):
                for elem in result:
                    for e in elem.iter():
                        if e is not elem:
                            yield e
            return select_tag(context, select_child(result))
    else:
        if tag[:2] == '{}':
            tag = tag[2:]  # '{}tag' == 'tag'
        def select(context, result):
            for elem in result:
                for e in elem.iter(tag):
                    if e is not elem:
                        yield e
    return select

def prepare_parent(next, token):
    def select(context, result):
        # FIXME: raise error if .. is applied at toplevel?
        parent_map = get_parent_map(context)
        result_map = {}
        for elem in result:
            if elem in parent_map:
                parent = parent_map[elem]
                if parent not in result_map:
                    result_map[parent] = None
                    yield parent
    return select

def prepare_predicate(next, token):
    # FIXME: replace with real parser!!! refs:
    # http://effbot.org/zone/simple-iterator-parser.htm
    # http://javascript.crockford.com/tdop/tdop.html
    signature = []
    predicate = []
    while 1:
        try:
            token = next()
        except StopIteration:
            return
        if token[0] == "]":
            break
        if token == ('', ''):
            # ignore whitespace
            continue
        if token[0] and token[0][:1] in "'\"":
            token = "'", token[0][1:-1]
        signature.append(token[0] or "-")
        predicate.append(token[1])
    signature = "".join(signature)
    # use signature to determine predicate type
    if signature == "@-":
        # [@attribute] predicate
        key = predicate[1]
        def select(context, result):
            for elem in result:
                if elem.get(key) is not None:
                    yield elem
        return select
    if signature == "@-='":
        # [@attribute='value']
        key = predicate[1]
        value = predicate[-1]
        def select(context, result):
            for elem in result:
                if elem.get(key) == value:
                    yield elem
        return select
    if signature == "-" and not re.match(r"\-?\d+$", predicate[0]):
        # [tag]
        tag = predicate[0]
        def select(context, result):
            for elem in result:
                if elem.find(tag) is not None:
                    yield elem
        return select
    if signature == ".='" or (signature == "-='" and not re.match(r"\-?\d+$", predicate[0])):
        # [.='value'] or [tag='value']
        tag = predicate[0]
        value = predicate[-1]
        if tag:
            def select(context, result):
                for elem in result:
                    for e in elem.findall(tag):
                        if "".join(e.itertext()) == value:
                            yield elem
                            break
        else:
            def select(context, result):
                for elem in result:
                    if "".join(elem.itertext()) == value:
                        yield elem
        return select
    if signature == "-" or signature == "-()" or signature == "-()-":
        # [index] or [last()] or [last()-index]
        if signature == "-":
            # [index]
            index = int(predicate[0]) - 1
            if index < 0:
                raise SyntaxError("XPath position >= 1 expected")
        else:
            if predicate[0] != "last":
                raise SyntaxError("unsupported function")
            if signature == "-()-":
                try:
                    index = int(predicate[2]) - 1
                except ValueError:
                    raise SyntaxError("unsupported expression")
                if index > -2:
                    raise SyntaxError("XPath offset from last() must be negative")
            else:
                index = -1
        def select(context, result):
            parent_map = get_parent_map(context)
            for elem in result:
                try:
                    parent = parent_map[elem]
                    # FIXME: what if the selector is "*" ?
                    elems = list(parent.findall(elem.tag))
                    if elems[index] is elem:
                        yield elem
                except (IndexError, KeyError):
                    pass
        return select
    raise SyntaxError("invalid predicate")

ops = {
    "": prepare_child,
    "*": prepare_star,
    ".": prepare_self,
    "..": prepare_parent,
    "//": prepare_descendant,
    "[": prepare_predicate,
    }

_cache = {}

class _SelectorContext:
    parent_map = None
    def __init__(self, root):
        self.root = root

# --------------------------------------------------------------------

##
# Generate all matching objects.

def iterfind(elem, path, namespaces=None):
    # compile selector pattern
    if path[-1:] == "/":
        path = path + "*" # implicit all (FIXME: keep this?)

    cache_key = (path,)
    if namespaces:
        cache_key += tuple(sorted(namespaces.items()))

    try:
        selector = _cache[cache_key]
    except KeyError:
        if len(_cache) > 100:
            _cache.clear()
        if path[:1] == "/":
            raise SyntaxError("cannot use absolute path on element")
        next = iter(xpath_tokenizer(path, namespaces)).__next__
        try:
            token = next()
        except StopIteration:
            return
        selector = []
        while 1:
            try:
                selector.append(ops[token[0]](next, token))
            except StopIteration:
                raise SyntaxError("invalid path") from None
            try:
                token = next()
                if token[0] == "/":
                    token = next()
            except StopIteration:
                break
        _cache[cache_key] = selector
    # execute selector pattern
    result = [elem]
    context = _SelectorContext(elem)
    for select in selector:
        result = select(context, result)
    return result

##
# Find first matching object.

def find(elem, path, namespaces=None):
    return next(iterfind(elem, path, namespaces), None)

##
# Find all matching objects.

def findall(elem, path, namespaces=None):
    return list(iterfind(elem, path, namespaces))

##
# Find text for first matching object.

def findtext(elem, path, default=None, namespaces=None):
    try:
        elem = next(iterfind(elem, path, namespaces))
        return elem.text or ""
    except StopIteration:
        return default
xml/etree/cElementTree.py000064400000000122151153537540011402 0ustar00# Deprecated alias for xml.etree.ElementTree

from xml.etree.ElementTree import *
xml/etree/__init__.py000064400000003104151153537540010570 0ustar00# $Id: __init__.py 3375 2008-02-13 08:05:08Z fredrik $
# elementtree package

# --------------------------------------------------------------------
# The ElementTree toolkit is
#
# Copyright (c) 1999-2008 by Fredrik Lundh
#
# By obtaining, using, and/or copying this software and/or its
# associated documentation, you agree that you have read, understood,
# and will comply with the following terms and conditions:
#
# Permission to use, copy, modify, and distribute this software and
# its associated documentation for any purpose and without fee is
# hereby granted, provided that the above copyright notice appears in
# all copies, and that both that copyright notice and this permission
# notice appear in supporting documentation, and that the name of
# Secret Labs AB or the author not be used in advertising or publicity
# pertaining to distribution of the software without specific, written
# prior permission.
#
# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
# ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
# --------------------------------------------------------------------

# Licensed to PSF under a Contributor Agreement.
# See http://www.python.org/psf/license for licensing details.
xml/etree/ElementTree.py000064400000216331151153537540011252 0ustar00"""Lightweight XML support for Python.

 XML is an inherently hierarchical data format, and the most natural way to
 represent it is with a tree.  This module has two classes for this purpose:

    1. ElementTree represents the whole XML document as a tree and

    2. Element represents a single node in this tree.

 Interactions with the whole document (reading and writing to/from files) are
 usually done on the ElementTree level.  Interactions with a single XML element
 and its sub-elements are done on the Element level.

 Element is a flexible container object designed to store hierarchical data
 structures in memory. It can be described as a cross between a list and a
 dictionary.  Each Element has a number of properties associated with it:

    'tag' - a string containing the element's name.

    'attributes' - a Python dictionary storing the element's attributes.

    'text' - a string containing the element's text content.

    'tail' - an optional string containing text after the element's end tag.

    And a number of child elements stored in a Python sequence.

 To create an element instance, use the Element constructor,
 or the SubElement factory function.

 You can also use the ElementTree class to wrap an element structure
 and convert it to and from XML.

"""

#---------------------------------------------------------------------
# Licensed to PSF under a Contributor Agreement.
# See http://www.python.org/psf/license for licensing details.
#
# ElementTree
# Copyright (c) 1999-2008 by Fredrik Lundh.  All rights reserved.
#
# fredrik@pythonware.com
# http://www.pythonware.com
# --------------------------------------------------------------------
# The ElementTree toolkit is
#
# Copyright (c) 1999-2008 by Fredrik Lundh
#
# By obtaining, using, and/or copying this software and/or its
# associated documentation, you agree that you have read, understood,
# and will comply with the following terms and conditions:
#
# Permission to use, copy, modify, and distribute this software and
# its associated documentation for any purpose and without fee is
# hereby granted, provided that the above copyright notice appears in
# all copies, and that both that copyright notice and this permission
# notice appear in supporting documentation, and that the name of
# Secret Labs AB or the author not be used in advertising or publicity
# pertaining to distribution of the software without specific, written
# prior permission.
#
# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
# ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
# --------------------------------------------------------------------

__all__ = [
    # public symbols
    "Comment",
    "dump",
    "Element", "ElementTree",
    "fromstring", "fromstringlist",
    "iselement", "iterparse",
    "parse", "ParseError",
    "PI", "ProcessingInstruction",
    "QName",
    "SubElement",
    "tostring", "tostringlist",
    "TreeBuilder",
    "VERSION",
    "XML", "XMLID",
    "XMLParser", "XMLPullParser",
    "register_namespace",
    "canonicalize", "C14NWriterTarget",
    ]

VERSION = "1.3.0"

import sys
import re
import warnings
import io
import collections
import collections.abc
import contextlib

from . import ElementPath


class ParseError(SyntaxError):
    """An error when parsing an XML document.

    In addition to its exception value, a ParseError contains
    two extra attributes:
        'code'     - the specific exception code
        'position' - the line and column of the error

    """
    pass

# --------------------------------------------------------------------


def iselement(element):
    """Return True if *element* appears to be an Element."""
    return hasattr(element, 'tag')


class Element:
    """An XML element.

    This class is the reference implementation of the Element interface.

    An element's length is its number of subelements.  That means if you
    want to check if an element is truly empty, you should check BOTH
    its length AND its text attribute.

    The element tag, attribute names, and attribute values can be either
    bytes or strings.

    *tag* is the element name.  *attrib* is an optional dictionary containing
    element attributes. *extra* are additional element attributes given as
    keyword arguments.

    Example form:
        <tag attrib>text<child/>...</tag>tail

    """

    tag = None
    """The element's name."""

    attrib = None
    """Dictionary of the element's attributes."""

    text = None
    """
    Text before first subelement. This is either a string or the value None.
    Note that if there is no text, this attribute may be either
    None or the empty string, depending on the parser.

    """

    tail = None
    """
    Text after this element's end tag, but before the next sibling element's
    start tag.  This is either a string or the value None.  Note that if there
    was no text, this attribute may be either None or an empty string,
    depending on the parser.

    """

    def __init__(self, tag, attrib={}, **extra):
        if not isinstance(attrib, dict):
            raise TypeError("attrib must be dict, not %s" % (
                attrib.__class__.__name__,))
        self.tag = tag
        self.attrib = {**attrib, **extra}
        self._children = []

    def __repr__(self):
        return "<%s %r at %#x>" % (self.__class__.__name__, self.tag, id(self))

    def makeelement(self, tag, attrib):
        """Create a new element with the same type.

        *tag* is a string containing the element name.
        *attrib* is a dictionary containing the element attributes.

        Do not call this method, use the SubElement factory function instead.

        """
        return self.__class__(tag, attrib)

    def copy(self):
        """Return copy of current element.

        This creates a shallow copy. Subelements will be shared with the
        original tree.

        """
        elem = self.makeelement(self.tag, self.attrib)
        elem.text = self.text
        elem.tail = self.tail
        elem[:] = self
        return elem

    def __len__(self):
        return len(self._children)

    def __bool__(self):
        warnings.warn(
            "The behavior of this method will change in future versions.  "
            "Use specific 'len(elem)' or 'elem is not None' test instead.",
            FutureWarning, stacklevel=2
            )
        return len(self._children) != 0 # emulate old behaviour, for now

    def __getitem__(self, index):
        return self._children[index]

    def __setitem__(self, index, element):
        if isinstance(index, slice):
            for elt in element:
                self._assert_is_element(elt)
        else:
            self._assert_is_element(element)
        self._children[index] = element

    def __delitem__(self, index):
        del self._children[index]

    def append(self, subelement):
        """Add *subelement* to the end of this element.

        The new element will appear in document order after the last existing
        subelement (or directly after the text, if it's the first subelement),
        but before the end tag for this element.

        """
        self._assert_is_element(subelement)
        self._children.append(subelement)

    def extend(self, elements):
        """Append subelements from a sequence.

        *elements* is a sequence with zero or more elements.

        """
        for element in elements:
            self._assert_is_element(element)
            self._children.append(element)

    def insert(self, index, subelement):
        """Insert *subelement* at position *index*."""
        self._assert_is_element(subelement)
        self._children.insert(index, subelement)

    def _assert_is_element(self, e):
        # Need to refer to the actual Python implementation, not the
        # shadowing C implementation.
        if not isinstance(e, _Element_Py):
            raise TypeError('expected an Element, not %s' % type(e).__name__)

    def remove(self, subelement):
        """Remove matching subelement.

        Unlike the find methods, this method compares elements based on
        identity, NOT ON tag value or contents.  To remove subelements by
        other means, the easiest way is to use a list comprehension to
        select what elements to keep, and then use slice assignment to update
        the parent element.

        ValueError is raised if a matching element could not be found.

        """
        # assert iselement(element)
        self._children.remove(subelement)

    def getchildren(self):
        """(Deprecated) Return all subelements.

        Elements are returned in document order.

        """
        warnings.warn(
            "This method will be removed in future versions.  "
            "Use 'list(elem)' or iteration over elem instead.",
            DeprecationWarning, stacklevel=2
            )
        return self._children

    def find(self, path, namespaces=None):
        """Find first matching element by tag name or path.

        *path* is a string having either an element tag or an XPath,
        *namespaces* is an optional mapping from namespace prefix to full name.

        Return the first matching element, or None if no element was found.

        """
        return ElementPath.find(self, path, namespaces)

    def findtext(self, path, default=None, namespaces=None):
        """Find text for first matching element by tag name or path.

        *path* is a string having either an element tag or an XPath,
        *default* is the value to return if the element was not found,
        *namespaces* is an optional mapping from namespace prefix to full name.

        Return text content of first matching element, or default value if
        none was found.  Note that if an element is found having no text
        content, the empty string is returned.

        """
        return ElementPath.findtext(self, path, default, namespaces)

    def findall(self, path, namespaces=None):
        """Find all matching subelements by tag name or path.

        *path* is a string having either an element tag or an XPath,
        *namespaces* is an optional mapping from namespace prefix to full name.

        Returns list containing all matching elements in document order.

        """
        return ElementPath.findall(self, path, namespaces)

    def iterfind(self, path, namespaces=None):
        """Find all matching subelements by tag name or path.

        *path* is a string having either an element tag or an XPath,
        *namespaces* is an optional mapping from namespace prefix to full name.

        Return an iterable yielding all matching elements in document order.

        """
        return ElementPath.iterfind(self, path, namespaces)

    def clear(self):
        """Reset element.

        This function removes all subelements, clears all attributes, and sets
        the text and tail attributes to None.

        """
        self.attrib.clear()
        self._children = []
        self.text = self.tail = None

    def get(self, key, default=None):
        """Get element attribute.

        Equivalent to attrib.get, but some implementations may handle this a
        bit more efficiently.  *key* is what attribute to look for, and
        *default* is what to return if the attribute was not found.

        Returns a string containing the attribute value, or the default if
        attribute was not found.

        """
        return self.attrib.get(key, default)

    def set(self, key, value):
        """Set element attribute.

        Equivalent to attrib[key] = value, but some implementations may handle
        this a bit more efficiently.  *key* is what attribute to set, and
        *value* is the attribute value to set it to.

        """
        self.attrib[key] = value

    def keys(self):
        """Get list of attribute names.

        Names are returned in an arbitrary order, just like an ordinary
        Python dict.  Equivalent to attrib.keys()

        """
        return self.attrib.keys()

    def items(self):
        """Get element attributes as a sequence.

        The attributes are returned in arbitrary order.  Equivalent to
        attrib.items().

        Return a list of (name, value) tuples.

        """
        return self.attrib.items()

    def iter(self, tag=None):
        """Create tree iterator.

        The iterator loops over the element and all subelements in document
        order, returning all elements with a matching tag.

        If the tree structure is modified during iteration, new or removed
        elements may or may not be included.  To get a stable set, use the
        list() function on the iterator, and loop over the resulting list.

        *tag* is what tags to look for (default is to return all elements)

        Return an iterator containing all the matching elements.

        """
        if tag == "*":
            tag = None
        if tag is None or self.tag == tag:
            yield self
        for e in self._children:
            yield from e.iter(tag)

    # compatibility
    def getiterator(self, tag=None):
        warnings.warn(
            "This method will be removed in future versions.  "
            "Use 'elem.iter()' or 'list(elem.iter())' instead.",
            DeprecationWarning, stacklevel=2
        )
        return list(self.iter(tag))

    def itertext(self):
        """Create text iterator.

        The iterator loops over the element and all subelements in document
        order, returning all inner text.

        """
        tag = self.tag
        if not isinstance(tag, str) and tag is not None:
            return
        t = self.text
        if t:
            yield t
        for e in self:
            yield from e.itertext()
            t = e.tail
            if t:
                yield t


def SubElement(parent, tag, attrib={}, **extra):
    """Subelement factory which creates an element instance, and appends it
    to an existing parent.

    The element tag, attribute names, and attribute values can be either
    bytes or Unicode strings.

    *parent* is the parent element, *tag* is the subelements name, *attrib* is
    an optional directory containing element attributes, *extra* are
    additional attributes given as keyword arguments.

    """
    attrib = {**attrib, **extra}
    element = parent.makeelement(tag, attrib)
    parent.append(element)
    return element


def Comment(text=None):
    """Comment element factory.

    This function creates a special element which the standard serializer
    serializes as an XML comment.

    *text* is a string containing the comment string.

    """
    element = Element(Comment)
    element.text = text
    return element


def ProcessingInstruction(target, text=None):
    """Processing Instruction element factory.

    This function creates a special element which the standard serializer
    serializes as an XML comment.

    *target* is a string containing the processing instruction, *text* is a
    string containing the processing instruction contents, if any.

    """
    element = Element(ProcessingInstruction)
    element.text = target
    if text:
        element.text = element.text + " " + text
    return element

PI = ProcessingInstruction


class QName:
    """Qualified name wrapper.

    This class can be used to wrap a QName attribute value in order to get
    proper namespace handing on output.

    *text_or_uri* is a string containing the QName value either in the form
    {uri}local, or if the tag argument is given, the URI part of a QName.

    *tag* is an optional argument which if given, will make the first
    argument (text_or_uri) be interpreted as a URI, and this argument (tag)
    be interpreted as a local name.

    """
    def __init__(self, text_or_uri, tag=None):
        if tag:
            text_or_uri = "{%s}%s" % (text_or_uri, tag)
        self.text = text_or_uri
    def __str__(self):
        return self.text
    def __repr__(self):
        return '<%s %r>' % (self.__class__.__name__, self.text)
    def __hash__(self):
        return hash(self.text)
    def __le__(self, other):
        if isinstance(other, QName):
            return self.text <= other.text
        return self.text <= other
    def __lt__(self, other):
        if isinstance(other, QName):
            return self.text < other.text
        return self.text < other
    def __ge__(self, other):
        if isinstance(other, QName):
            return self.text >= other.text
        return self.text >= other
    def __gt__(self, other):
        if isinstance(other, QName):
            return self.text > other.text
        return self.text > other
    def __eq__(self, other):
        if isinstance(other, QName):
            return self.text == other.text
        return self.text == other

# --------------------------------------------------------------------


class ElementTree:
    """An XML element hierarchy.

    This class also provides support for serialization to and from
    standard XML.

    *element* is an optional root element node,
    *file* is an optional file handle or file name of an XML file whose
    contents will be used to initialize the tree with.

    """
    def __init__(self, element=None, file=None):
        # assert element is None or iselement(element)
        self._root = element # first node
        if file:
            self.parse(file)

    def getroot(self):
        """Return root element of this tree."""
        return self._root

    def _setroot(self, element):
        """Replace root element of this tree.

        This will discard the current contents of the tree and replace it
        with the given element.  Use with care!

        """
        # assert iselement(element)
        self._root = element

    def parse(self, source, parser=None):
        """Load external XML document into element tree.

        *source* is a file name or file object, *parser* is an optional parser
        instance that defaults to XMLParser.

        ParseError is raised if the parser fails to parse the document.

        Returns the root element of the given source document.

        """
        close_source = False
        if not hasattr(source, "read"):
            source = open(source, "rb")
            close_source = True
        try:
            if parser is None:
                # If no parser was specified, create a default XMLParser
                parser = XMLParser()
                if hasattr(parser, '_parse_whole'):
                    # The default XMLParser, when it comes from an accelerator,
                    # can define an internal _parse_whole API for efficiency.
                    # It can be used to parse the whole source without feeding
                    # it with chunks.
                    self._root = parser._parse_whole(source)
                    return self._root
            while True:
                data = source.read(65536)
                if not data:
                    break
                parser.feed(data)
            self._root = parser.close()
            return self._root
        finally:
            if close_source:
                source.close()

    def iter(self, tag=None):
        """Create and return tree iterator for the root element.

        The iterator loops over all elements in this tree, in document order.

        *tag* is a string with the tag name to iterate over
        (default is to return all elements).

        """
        # assert self._root is not None
        return self._root.iter(tag)

    # compatibility
    def getiterator(self, tag=None):
        warnings.warn(
            "This method will be removed in future versions.  "
            "Use 'tree.iter()' or 'list(tree.iter())' instead.",
            DeprecationWarning, stacklevel=2
        )
        return list(self.iter(tag))

    def find(self, path, namespaces=None):
        """Find first matching element by tag name or path.

        Same as getroot().find(path), which is Element.find()

        *path* is a string having either an element tag or an XPath,
        *namespaces* is an optional mapping from namespace prefix to full name.

        Return the first matching element, or None if no element was found.

        """
        # assert self._root is not None
        if path[:1] == "/":
            path = "." + path
            warnings.warn(
                "This search is broken in 1.3 and earlier, and will be "
                "fixed in a future version.  If you rely on the current "
                "behaviour, change it to %r" % path,
                FutureWarning, stacklevel=2
                )
        return self._root.find(path, namespaces)

    def findtext(self, path, default=None, namespaces=None):
        """Find first matching element by tag name or path.

        Same as getroot().findtext(path),  which is Element.findtext()

        *path* is a string having either an element tag or an XPath,
        *namespaces* is an optional mapping from namespace prefix to full name.

        Return the first matching element, or None if no element was found.

        """
        # assert self._root is not None
        if path[:1] == "/":
            path = "." + path
            warnings.warn(
                "This search is broken in 1.3 and earlier, and will be "
                "fixed in a future version.  If you rely on the current "
                "behaviour, change it to %r" % path,
                FutureWarning, stacklevel=2
                )
        return self._root.findtext(path, default, namespaces)

    def findall(self, path, namespaces=None):
        """Find all matching subelements by tag name or path.

        Same as getroot().findall(path), which is Element.findall().

        *path* is a string having either an element tag or an XPath,
        *namespaces* is an optional mapping from namespace prefix to full name.

        Return list containing all matching elements in document order.

        """
        # assert self._root is not None
        if path[:1] == "/":
            path = "." + path
            warnings.warn(
                "This search is broken in 1.3 and earlier, and will be "
                "fixed in a future version.  If you rely on the current "
                "behaviour, change it to %r" % path,
                FutureWarning, stacklevel=2
                )
        return self._root.findall(path, namespaces)

    def iterfind(self, path, namespaces=None):
        """Find all matching subelements by tag name or path.

        Same as getroot().iterfind(path), which is element.iterfind()

        *path* is a string having either an element tag or an XPath,
        *namespaces* is an optional mapping from namespace prefix to full name.

        Return an iterable yielding all matching elements in document order.

        """
        # assert self._root is not None
        if path[:1] == "/":
            path = "." + path
            warnings.warn(
                "This search is broken in 1.3 and earlier, and will be "
                "fixed in a future version.  If you rely on the current "
                "behaviour, change it to %r" % path,
                FutureWarning, stacklevel=2
                )
        return self._root.iterfind(path, namespaces)

    def write(self, file_or_filename,
              encoding=None,
              xml_declaration=None,
              default_namespace=None,
              method=None, *,
              short_empty_elements=True):
        """Write element tree to a file as XML.

        Arguments:
          *file_or_filename* -- file name or a file object opened for writing

          *encoding* -- the output encoding (default: US-ASCII)

          *xml_declaration* -- bool indicating if an XML declaration should be
                               added to the output. If None, an XML declaration
                               is added if encoding IS NOT either of:
                               US-ASCII, UTF-8, or Unicode

          *default_namespace* -- sets the default XML namespace (for "xmlns")

          *method* -- either "xml" (default), "html, "text", or "c14n"

          *short_empty_elements* -- controls the formatting of elements
                                    that contain no content. If True (default)
                                    they are emitted as a single self-closed
                                    tag, otherwise they are emitted as a pair
                                    of start/end tags

        """
        if not method:
            method = "xml"
        elif method not in _serialize:
            raise ValueError("unknown method %r" % method)
        if not encoding:
            if method == "c14n":
                encoding = "utf-8"
            else:
                encoding = "us-ascii"
        enc_lower = encoding.lower()
        with _get_writer(file_or_filename, enc_lower) as write:
            if method == "xml" and (xml_declaration or
                    (xml_declaration is None and
                     enc_lower not in ("utf-8", "us-ascii", "unicode"))):
                declared_encoding = encoding
                if enc_lower == "unicode":
                    # Retrieve the default encoding for the xml declaration
                    import locale
                    declared_encoding = locale.getpreferredencoding()
                write("<?xml version='1.0' encoding='%s'?>\n" % (
                    declared_encoding,))
            if method == "text":
                _serialize_text(write, self._root)
            else:
                qnames, namespaces = _namespaces(self._root, default_namespace)
                serialize = _serialize[method]
                serialize(write, self._root, qnames, namespaces,
                          short_empty_elements=short_empty_elements)

    def write_c14n(self, file):
        # lxml.etree compatibility.  use output method instead
        return self.write(file, method="c14n")

# --------------------------------------------------------------------
# serialization support

@contextlib.contextmanager
def _get_writer(file_or_filename, encoding):
    # returns text write method and release all resources after using
    try:
        write = file_or_filename.write
    except AttributeError:
        # file_or_filename is a file name
        if encoding == "unicode":
            file = open(file_or_filename, "w")
        else:
            file = open(file_or_filename, "w", encoding=encoding,
                        errors="xmlcharrefreplace")
        with file:
            yield file.write
    else:
        # file_or_filename is a file-like object
        # encoding determines if it is a text or binary writer
        if encoding == "unicode":
            # use a text writer as is
            yield write
        else:
            # wrap a binary writer with TextIOWrapper
            with contextlib.ExitStack() as stack:
                if isinstance(file_or_filename, io.BufferedIOBase):
                    file = file_or_filename
                elif isinstance(file_or_filename, io.RawIOBase):
                    file = io.BufferedWriter(file_or_filename)
                    # Keep the original file open when the BufferedWriter is
                    # destroyed
                    stack.callback(file.detach)
                else:
                    # This is to handle passed objects that aren't in the
                    # IOBase hierarchy, but just have a write method
                    file = io.BufferedIOBase()
                    file.writable = lambda: True
                    file.write = write
                    try:
                        # TextIOWrapper uses this methods to determine
                        # if BOM (for UTF-16, etc) should be added
                        file.seekable = file_or_filename.seekable
                        file.tell = file_or_filename.tell
                    except AttributeError:
                        pass
                file = io.TextIOWrapper(file,
                                        encoding=encoding,
                                        errors="xmlcharrefreplace",
                                        newline="\n")
                # Keep the original file open when the TextIOWrapper is
                # destroyed
                stack.callback(file.detach)
                yield file.write

def _namespaces(elem, default_namespace=None):
    # identify namespaces used in this tree

    # maps qnames to *encoded* prefix:local names
    qnames = {None: None}

    # maps uri:s to prefixes
    namespaces = {}
    if default_namespace:
        namespaces[default_namespace] = ""

    def add_qname(qname):
        # calculate serialized qname representation
        try:
            if qname[:1] == "{":
                uri, tag = qname[1:].rsplit("}", 1)
                prefix = namespaces.get(uri)
                if prefix is None:
                    prefix = _namespace_map.get(uri)
                    if prefix is None:
                        prefix = "ns%d" % len(namespaces)
                    if prefix != "xml":
                        namespaces[uri] = prefix
                if prefix:
                    qnames[qname] = "%s:%s" % (prefix, tag)
                else:
                    qnames[qname] = tag # default element
            else:
                if default_namespace:
                    # FIXME: can this be handled in XML 1.0?
                    raise ValueError(
                        "cannot use non-qualified names with "
                        "default_namespace option"
                        )
                qnames[qname] = qname
        except TypeError:
            _raise_serialization_error(qname)

    # populate qname and namespaces table
    for elem in elem.iter():
        tag = elem.tag
        if isinstance(tag, QName):
            if tag.text not in qnames:
                add_qname(tag.text)
        elif isinstance(tag, str):
            if tag not in qnames:
                add_qname(tag)
        elif tag is not None and tag is not Comment and tag is not PI:
            _raise_serialization_error(tag)
        for key, value in elem.items():
            if isinstance(key, QName):
                key = key.text
            if key not in qnames:
                add_qname(key)
            if isinstance(value, QName) and value.text not in qnames:
                add_qname(value.text)
        text = elem.text
        if isinstance(text, QName) and text.text not in qnames:
            add_qname(text.text)
    return qnames, namespaces

def _serialize_xml(write, elem, qnames, namespaces,
                   short_empty_elements, **kwargs):
    tag = elem.tag
    text = elem.text
    if tag is Comment:
        write("<!--%s-->" % text)
    elif tag is ProcessingInstruction:
        write("<?%s?>" % text)
    else:
        tag = qnames[tag]
        if tag is None:
            if text:
                write(_escape_cdata(text))
            for e in elem:
                _serialize_xml(write, e, qnames, None,
                               short_empty_elements=short_empty_elements)
        else:
            write("<" + tag)
            items = list(elem.items())
            if items or namespaces:
                if namespaces:
                    for v, k in sorted(namespaces.items(),
                                       key=lambda x: x[1]):  # sort on prefix
                        if k:
                            k = ":" + k
                        write(" xmlns%s=\"%s\"" % (
                            k,
                            _escape_attrib(v)
                            ))
                for k, v in items:
                    if isinstance(k, QName):
                        k = k.text
                    if isinstance(v, QName):
                        v = qnames[v.text]
                    else:
                        v = _escape_attrib(v)
                    write(" %s=\"%s\"" % (qnames[k], v))
            if text or len(elem) or not short_empty_elements:
                write(">")
                if text:
                    write(_escape_cdata(text))
                for e in elem:
                    _serialize_xml(write, e, qnames, None,
                                   short_empty_elements=short_empty_elements)
                write("</" + tag + ">")
            else:
                write(" />")
    if elem.tail:
        write(_escape_cdata(elem.tail))

HTML_EMPTY = ("area", "base", "basefont", "br", "col", "frame", "hr",
              "img", "input", "isindex", "link", "meta", "param")

try:
    HTML_EMPTY = set(HTML_EMPTY)
except NameError:
    pass

def _serialize_html(write, elem, qnames, namespaces, **kwargs):
    tag = elem.tag
    text = elem.text
    if tag is Comment:
        write("<!--%s-->" % _escape_cdata(text))
    elif tag is ProcessingInstruction:
        write("<?%s?>" % _escape_cdata(text))
    else:
        tag = qnames[tag]
        if tag is None:
            if text:
                write(_escape_cdata(text))
            for e in elem:
                _serialize_html(write, e, qnames, None)
        else:
            write("<" + tag)
            items = list(elem.items())
            if items or namespaces:
                if namespaces:
                    for v, k in sorted(namespaces.items(),
                                       key=lambda x: x[1]):  # sort on prefix
                        if k:
                            k = ":" + k
                        write(" xmlns%s=\"%s\"" % (
                            k,
                            _escape_attrib(v)
                            ))
                for k, v in items:
                    if isinstance(k, QName):
                        k = k.text
                    if isinstance(v, QName):
                        v = qnames[v.text]
                    else:
                        v = _escape_attrib_html(v)
                    # FIXME: handle boolean attributes
                    write(" %s=\"%s\"" % (qnames[k], v))
            write(">")
            ltag = tag.lower()
            if text:
                if ltag == "script" or ltag == "style":
                    write(text)
                else:
                    write(_escape_cdata(text))
            for e in elem:
                _serialize_html(write, e, qnames, None)
            if ltag not in HTML_EMPTY:
                write("</" + tag + ">")
    if elem.tail:
        write(_escape_cdata(elem.tail))

def _serialize_text(write, elem):
    for part in elem.itertext():
        write(part)
    if elem.tail:
        write(elem.tail)

_serialize = {
    "xml": _serialize_xml,
    "html": _serialize_html,
    "text": _serialize_text,
# this optional method is imported at the end of the module
#   "c14n": _serialize_c14n,
}


def register_namespace(prefix, uri):
    """Register a namespace prefix.

    The registry is global, and any existing mapping for either the
    given prefix or the namespace URI will be removed.

    *prefix* is the namespace prefix, *uri* is a namespace uri. Tags and
    attributes in this namespace will be serialized with prefix if possible.

    ValueError is raised if prefix is reserved or is invalid.

    """
    if re.match(r"ns\d+$", prefix):
        raise ValueError("Prefix format reserved for internal use")
    for k, v in list(_namespace_map.items()):
        if k == uri or v == prefix:
            del _namespace_map[k]
    _namespace_map[uri] = prefix

_namespace_map = {
    # "well-known" namespace prefixes
    "http://www.w3.org/XML/1998/namespace": "xml",
    "http://www.w3.org/1999/xhtml": "html",
    "http://www.w3.org/1999/02/22-rdf-syntax-ns#": "rdf",
    "http://schemas.xmlsoap.org/wsdl/": "wsdl",
    # xml schema
    "http://www.w3.org/2001/XMLSchema": "xs",
    "http://www.w3.org/2001/XMLSchema-instance": "xsi",
    # dublin core
    "http://purl.org/dc/elements/1.1/": "dc",
}
# For tests and troubleshooting
register_namespace._namespace_map = _namespace_map

def _raise_serialization_error(text):
    raise TypeError(
        "cannot serialize %r (type %s)" % (text, type(text).__name__)
        )

def _escape_cdata(text):
    # escape character data
    try:
        # it's worth avoiding do-nothing calls for strings that are
        # shorter than 500 characters, or so.  assume that's, by far,
        # the most common case in most applications.
        if "&" in text:
            text = text.replace("&", "&amp;")
        if "<" in text:
            text = text.replace("<", "&lt;")
        if ">" in text:
            text = text.replace(">", "&gt;")
        return text
    except (TypeError, AttributeError):
        _raise_serialization_error(text)

def _escape_attrib(text):
    # escape attribute value
    try:
        if "&" in text:
            text = text.replace("&", "&amp;")
        if "<" in text:
            text = text.replace("<", "&lt;")
        if ">" in text:
            text = text.replace(">", "&gt;")
        if "\"" in text:
            text = text.replace("\"", "&quot;")
        # The following business with carriage returns is to satisfy
        # Section 2.11 of the XML specification, stating that
        # CR or CR LN should be replaced with just LN
        # http://www.w3.org/TR/REC-xml/#sec-line-ends
        if "\r\n" in text:
            text = text.replace("\r\n", "\n")
        if "\r" in text:
            text = text.replace("\r", "\n")
        #The following four lines are issue 17582
        if "\n" in text:
            text = text.replace("\n", "&#10;")
        if "\t" in text:
            text = text.replace("\t", "&#09;")
        return text
    except (TypeError, AttributeError):
        _raise_serialization_error(text)

def _escape_attrib_html(text):
    # escape attribute value
    try:
        if "&" in text:
            text = text.replace("&", "&amp;")
        if ">" in text:
            text = text.replace(">", "&gt;")
        if "\"" in text:
            text = text.replace("\"", "&quot;")
        return text
    except (TypeError, AttributeError):
        _raise_serialization_error(text)

# --------------------------------------------------------------------

def tostring(element, encoding=None, method=None, *,
             xml_declaration=None, default_namespace=None,
             short_empty_elements=True):
    """Generate string representation of XML element.

    All subelements are included.  If encoding is "unicode", a string
    is returned. Otherwise a bytestring is returned.

    *element* is an Element instance, *encoding* is an optional output
    encoding defaulting to US-ASCII, *method* is an optional output which can
    be one of "xml" (default), "html", "text" or "c14n", *default_namespace*
    sets the default XML namespace (for "xmlns").

    Returns an (optionally) encoded string containing the XML data.

    """
    stream = io.StringIO() if encoding == 'unicode' else io.BytesIO()
    ElementTree(element).write(stream, encoding,
                               xml_declaration=xml_declaration,
                               default_namespace=default_namespace,
                               method=method,
                               short_empty_elements=short_empty_elements)
    return stream.getvalue()

class _ListDataStream(io.BufferedIOBase):
    """An auxiliary stream accumulating into a list reference."""
    def __init__(self, lst):
        self.lst = lst

    def writable(self):
        return True

    def seekable(self):
        return True

    def write(self, b):
        self.lst.append(b)

    def tell(self):
        return len(self.lst)

def tostringlist(element, encoding=None, method=None, *,
                 xml_declaration=None, default_namespace=None,
                 short_empty_elements=True):
    lst = []
    stream = _ListDataStream(lst)
    ElementTree(element).write(stream, encoding,
                               xml_declaration=xml_declaration,
                               default_namespace=default_namespace,
                               method=method,
                               short_empty_elements=short_empty_elements)
    return lst


def dump(elem):
    """Write element tree or element structure to sys.stdout.

    This function should be used for debugging only.

    *elem* is either an ElementTree, or a single Element.  The exact output
    format is implementation dependent.  In this version, it's written as an
    ordinary XML file.

    """
    # debugging
    if not isinstance(elem, ElementTree):
        elem = ElementTree(elem)
    elem.write(sys.stdout, encoding="unicode")
    tail = elem.getroot().tail
    if not tail or tail[-1] != "\n":
        sys.stdout.write("\n")

# --------------------------------------------------------------------
# parsing


def parse(source, parser=None):
    """Parse XML document into element tree.

    *source* is a filename or file object containing XML data,
    *parser* is an optional parser instance defaulting to XMLParser.

    Return an ElementTree instance.

    """
    tree = ElementTree()
    tree.parse(source, parser)
    return tree


def iterparse(source, events=None, parser=None):
    """Incrementally parse XML document into ElementTree.

    This class also reports what's going on to the user based on the
    *events* it is initialized with.  The supported events are the strings
    "start", "end", "start-ns" and "end-ns" (the "ns" events are used to get
    detailed namespace information).  If *events* is omitted, only
    "end" events are reported.

    *source* is a filename or file object containing XML data, *events* is
    a list of events to report back, *parser* is an optional parser instance.

    Returns an iterator providing (event, elem) pairs.

    """
    # Use the internal, undocumented _parser argument for now; When the
    # parser argument of iterparse is removed, this can be killed.
    pullparser = XMLPullParser(events=events, _parser=parser)
    def iterator():
        try:
            while True:
                yield from pullparser.read_events()
                # load event buffer
                data = source.read(16 * 1024)
                if not data:
                    break
                pullparser.feed(data)
            root = pullparser._close_and_return_root()
            yield from pullparser.read_events()
            it.root = root
        finally:
            if close_source:
                source.close()

    class IterParseIterator(collections.abc.Iterator):
        __next__ = iterator().__next__
    it = IterParseIterator()
    it.root = None
    del iterator, IterParseIterator

    close_source = False
    if not hasattr(source, "read"):
        source = open(source, "rb")
        close_source = True

    return it


class XMLPullParser:

    def __init__(self, events=None, *, _parser=None):
        # The _parser argument is for internal use only and must not be relied
        # upon in user code. It will be removed in a future release.
        # See http://bugs.python.org/issue17741 for more details.

        self._events_queue = collections.deque()
        self._parser = _parser or XMLParser(target=TreeBuilder())
        # wire up the parser for event reporting
        if events is None:
            events = ("end",)
        self._parser._setevents(self._events_queue, events)

    def feed(self, data):
        """Feed encoded data to parser."""
        if self._parser is None:
            raise ValueError("feed() called after end of stream")
        if data:
            try:
                self._parser.feed(data)
            except SyntaxError as exc:
                self._events_queue.append(exc)

    def _close_and_return_root(self):
        # iterparse needs this to set its root attribute properly :(
        root = self._parser.close()
        self._parser = None
        return root

    def close(self):
        """Finish feeding data to parser.

        Unlike XMLParser, does not return the root element. Use
        read_events() to consume elements from XMLPullParser.
        """
        self._close_and_return_root()

    def read_events(self):
        """Return an iterator over currently available (event, elem) pairs.

        Events are consumed from the internal event queue as they are
        retrieved from the iterator.
        """
        events = self._events_queue
        while events:
            event = events.popleft()
            if isinstance(event, Exception):
                raise event
            else:
                yield event


def XML(text, parser=None):
    """Parse XML document from string constant.

    This function can be used to embed "XML Literals" in Python code.

    *text* is a string containing XML data, *parser* is an
    optional parser instance, defaulting to the standard XMLParser.

    Returns an Element instance.

    """
    if not parser:
        parser = XMLParser(target=TreeBuilder())
    parser.feed(text)
    return parser.close()


def XMLID(text, parser=None):
    """Parse XML document from string constant for its IDs.

    *text* is a string containing XML data, *parser* is an
    optional parser instance, defaulting to the standard XMLParser.

    Returns an (Element, dict) tuple, in which the
    dict maps element id:s to elements.

    """
    if not parser:
        parser = XMLParser(target=TreeBuilder())
    parser.feed(text)
    tree = parser.close()
    ids = {}
    for elem in tree.iter():
        id = elem.get("id")
        if id:
            ids[id] = elem
    return tree, ids

# Parse XML document from string constant.  Alias for XML().
fromstring = XML

def fromstringlist(sequence, parser=None):
    """Parse XML document from sequence of string fragments.

    *sequence* is a list of other sequence, *parser* is an optional parser
    instance, defaulting to the standard XMLParser.

    Returns an Element instance.

    """
    if not parser:
        parser = XMLParser(target=TreeBuilder())
    for text in sequence:
        parser.feed(text)
    return parser.close()

# --------------------------------------------------------------------


class TreeBuilder:
    """Generic element structure builder.

    This builder converts a sequence of start, data, and end method
    calls to a well-formed element structure.

    You can use this class to build an element structure using a custom XML
    parser, or a parser for some other XML-like format.

    *element_factory* is an optional element factory which is called
    to create new Element instances, as necessary.

    *comment_factory* is a factory to create comments to be used instead of
    the standard factory.  If *insert_comments* is false (the default),
    comments will not be inserted into the tree.

    *pi_factory* is a factory to create processing instructions to be used
    instead of the standard factory.  If *insert_pis* is false (the default),
    processing instructions will not be inserted into the tree.
    """
    def __init__(self, element_factory=None, *,
                 comment_factory=None, pi_factory=None,
                 insert_comments=False, insert_pis=False):
        self._data = [] # data collector
        self._elem = [] # element stack
        self._last = None # last element
        self._root = None # root element
        self._tail = None # true if we're after an end tag
        if comment_factory is None:
            comment_factory = Comment
        self._comment_factory = comment_factory
        self.insert_comments = insert_comments
        if pi_factory is None:
            pi_factory = ProcessingInstruction
        self._pi_factory = pi_factory
        self.insert_pis = insert_pis
        if element_factory is None:
            element_factory = Element
        self._factory = element_factory

    def close(self):
        """Flush builder buffers and return toplevel document Element."""
        assert len(self._elem) == 0, "missing end tags"
        assert self._root is not None, "missing toplevel element"
        return self._root

    def _flush(self):
        if self._data:
            if self._last is not None:
                text = "".join(self._data)
                if self._tail:
                    assert self._last.tail is None, "internal error (tail)"
                    self._last.tail = text
                else:
                    assert self._last.text is None, "internal error (text)"
                    self._last.text = text
            self._data = []

    def data(self, data):
        """Add text to current element."""
        self._data.append(data)

    def start(self, tag, attrs):
        """Open new element and return it.

        *tag* is the element name, *attrs* is a dict containing element
        attributes.

        """
        self._flush()
        self._last = elem = self._factory(tag, attrs)
        if self._elem:
            self._elem[-1].append(elem)
        elif self._root is None:
            self._root = elem
        self._elem.append(elem)
        self._tail = 0
        return elem

    def end(self, tag):
        """Close and return current Element.

        *tag* is the element name.

        """
        self._flush()
        self._last = self._elem.pop()
        assert self._last.tag == tag,\
               "end tag mismatch (expected %s, got %s)" % (
                   self._last.tag, tag)
        self._tail = 1
        return self._last

    def comment(self, text):
        """Create a comment using the comment_factory.

        *text* is the text of the comment.
        """
        return self._handle_single(
            self._comment_factory, self.insert_comments, text)

    def pi(self, target, text=None):
        """Create a processing instruction using the pi_factory.

        *target* is the target name of the processing instruction.
        *text* is the data of the processing instruction, or ''.
        """
        return self._handle_single(
            self._pi_factory, self.insert_pis, target, text)

    def _handle_single(self, factory, insert, *args):
        elem = factory(*args)
        if insert:
            self._flush()
            self._last = elem
            if self._elem:
                self._elem[-1].append(elem)
            self._tail = 1
        return elem


# also see ElementTree and TreeBuilder
class XMLParser:
    """Element structure builder for XML source data based on the expat parser.

    *target* is an optional target object which defaults to an instance of the
    standard TreeBuilder class, *encoding* is an optional encoding string
    which if given, overrides the encoding specified in the XML file:
    http://www.iana.org/assignments/character-sets

    """

    def __init__(self, *, target=None, encoding=None):
        try:
            from xml.parsers import expat
        except ImportError:
            try:
                import pyexpat as expat
            except ImportError:
                raise ImportError(
                    "No module named expat; use SimpleXMLTreeBuilder instead"
                    )
        parser = expat.ParserCreate(encoding, "}")
        if target is None:
            target = TreeBuilder()
        # underscored names are provided for compatibility only
        self.parser = self._parser = parser
        self.target = self._target = target
        self._error = expat.error
        self._names = {} # name memo cache
        # main callbacks
        parser.DefaultHandlerExpand = self._default
        if hasattr(target, 'start'):
            parser.StartElementHandler = self._start
        if hasattr(target, 'end'):
            parser.EndElementHandler = self._end
        if hasattr(target, 'start_ns'):
            parser.StartNamespaceDeclHandler = self._start_ns
        if hasattr(target, 'end_ns'):
            parser.EndNamespaceDeclHandler = self._end_ns
        if hasattr(target, 'data'):
            parser.CharacterDataHandler = target.data
        # miscellaneous callbacks
        if hasattr(target, 'comment'):
            parser.CommentHandler = target.comment
        if hasattr(target, 'pi'):
            parser.ProcessingInstructionHandler = target.pi
        # Configure pyexpat: buffering, new-style attribute handling.
        parser.buffer_text = 1
        parser.ordered_attributes = 1
        parser.specified_attributes = 1
        self._doctype = None
        self.entity = {}
        try:
            self.version = "Expat %d.%d.%d" % expat.version_info
        except AttributeError:
            pass # unknown

    def _setevents(self, events_queue, events_to_report):
        # Internal API for XMLPullParser
        # events_to_report: a list of events to report during parsing (same as
        # the *events* of XMLPullParser's constructor.
        # events_queue: a list of actual parsing events that will be populated
        # by the underlying parser.
        #
        parser = self._parser
        append = events_queue.append
        for event_name in events_to_report:
            if event_name == "start":
                parser.ordered_attributes = 1
                parser.specified_attributes = 1
                def handler(tag, attrib_in, event=event_name, append=append,
                            start=self._start):
                    append((event, start(tag, attrib_in)))
                parser.StartElementHandler = handler
            elif event_name == "end":
                def handler(tag, event=event_name, append=append,
                            end=self._end):
                    append((event, end(tag)))
                parser.EndElementHandler = handler
            elif event_name == "start-ns":
                # TreeBuilder does not implement .start_ns()
                if hasattr(self.target, "start_ns"):
                    def handler(prefix, uri, event=event_name, append=append,
                                start_ns=self._start_ns):
                        append((event, start_ns(prefix, uri)))
                else:
                    def handler(prefix, uri, event=event_name, append=append):
                        append((event, (prefix or '', uri or '')))
                parser.StartNamespaceDeclHandler = handler
            elif event_name == "end-ns":
                # TreeBuilder does not implement .end_ns()
                if hasattr(self.target, "end_ns"):
                    def handler(prefix, event=event_name, append=append,
                                end_ns=self._end_ns):
                        append((event, end_ns(prefix)))
                else:
                    def handler(prefix, event=event_name, append=append):
                        append((event, None))
                parser.EndNamespaceDeclHandler = handler
            elif event_name == 'comment':
                def handler(text, event=event_name, append=append, self=self):
                    append((event, self.target.comment(text)))
                parser.CommentHandler = handler
            elif event_name == 'pi':
                def handler(pi_target, data, event=event_name, append=append,
                            self=self):
                    append((event, self.target.pi(pi_target, data)))
                parser.ProcessingInstructionHandler = handler
            else:
                raise ValueError("unknown event %r" % event_name)

    def _raiseerror(self, value):
        err = ParseError(value)
        err.code = value.code
        err.position = value.lineno, value.offset
        raise err

    def _fixname(self, key):
        # expand qname, and convert name string to ascii, if possible
        try:
            name = self._names[key]
        except KeyError:
            name = key
            if "}" in name:
                name = "{" + name
            self._names[key] = name
        return name

    def _start_ns(self, prefix, uri):
        return self.target.start_ns(prefix or '', uri or '')

    def _end_ns(self, prefix):
        return self.target.end_ns(prefix or '')

    def _start(self, tag, attr_list):
        # Handler for expat's StartElementHandler. Since ordered_attributes
        # is set, the attributes are reported as a list of alternating
        # attribute name,value.
        fixname = self._fixname
        tag = fixname(tag)
        attrib = {}
        if attr_list:
            for i in range(0, len(attr_list), 2):
                attrib[fixname(attr_list[i])] = attr_list[i+1]
        return self.target.start(tag, attrib)

    def _end(self, tag):
        return self.target.end(self._fixname(tag))

    def _default(self, text):
        prefix = text[:1]
        if prefix == "&":
            # deal with undefined entities
            try:
                data_handler = self.target.data
            except AttributeError:
                return
            try:
                data_handler(self.entity[text[1:-1]])
            except KeyError:
                from xml.parsers import expat
                err = expat.error(
                    "undefined entity %s: line %d, column %d" %
                    (text, self.parser.ErrorLineNumber,
                    self.parser.ErrorColumnNumber)
                    )
                err.code = 11 # XML_ERROR_UNDEFINED_ENTITY
                err.lineno = self.parser.ErrorLineNumber
                err.offset = self.parser.ErrorColumnNumber
                raise err
        elif prefix == "<" and text[:9] == "<!DOCTYPE":
            self._doctype = [] # inside a doctype declaration
        elif self._doctype is not None:
            # parse doctype contents
            if prefix == ">":
                self._doctype = None
                return
            text = text.strip()
            if not text:
                return
            self._doctype.append(text)
            n = len(self._doctype)
            if n > 2:
                type = self._doctype[1]
                if type == "PUBLIC" and n == 4:
                    name, type, pubid, system = self._doctype
                    if pubid:
                        pubid = pubid[1:-1]
                elif type == "SYSTEM" and n == 3:
                    name, type, system = self._doctype
                    pubid = None
                else:
                    return
                if hasattr(self.target, "doctype"):
                    self.target.doctype(name, pubid, system[1:-1])
                elif hasattr(self, "doctype"):
                    warnings.warn(
                        "The doctype() method of XMLParser is ignored.  "
                        "Define doctype() method on the TreeBuilder target.",
                        RuntimeWarning)

                self._doctype = None

    def feed(self, data):
        """Feed encoded data to parser."""
        try:
            self.parser.Parse(data, 0)
        except self._error as v:
            self._raiseerror(v)

    def close(self):
        """Finish feeding data to parser and return element structure."""
        try:
            self.parser.Parse("", 1) # end of data
        except self._error as v:
            self._raiseerror(v)
        try:
            close_handler = self.target.close
        except AttributeError:
            pass
        else:
            return close_handler()
        finally:
            # get rid of circular references
            del self.parser, self._parser
            del self.target, self._target


# --------------------------------------------------------------------
# C14N 2.0

def canonicalize(xml_data=None, *, out=None, from_file=None, **options):
    """Convert XML to its C14N 2.0 serialised form.

    If *out* is provided, it must be a file or file-like object that receives
    the serialised canonical XML output (text, not bytes) through its ``.write()``
    method.  To write to a file, open it in text mode with encoding "utf-8".
    If *out* is not provided, this function returns the output as text string.

    Either *xml_data* (an XML string) or *from_file* (a file path or
    file-like object) must be provided as input.

    The configuration options are the same as for the ``C14NWriterTarget``.
    """
    if xml_data is None and from_file is None:
        raise ValueError("Either 'xml_data' or 'from_file' must be provided as input")
    sio = None
    if out is None:
        sio = out = io.StringIO()

    parser = XMLParser(target=C14NWriterTarget(out.write, **options))

    if xml_data is not None:
        parser.feed(xml_data)
        parser.close()
    elif from_file is not None:
        parse(from_file, parser=parser)

    return sio.getvalue() if sio is not None else None


_looks_like_prefix_name = re.compile(r'^\w+:\w+$', re.UNICODE).match


class C14NWriterTarget:
    """
    Canonicalization writer target for the XMLParser.

    Serialises parse events to XML C14N 2.0.

    The *write* function is used for writing out the resulting data stream
    as text (not bytes).  To write to a file, open it in text mode with encoding
    "utf-8" and pass its ``.write`` method.

    Configuration options:

    - *with_comments*: set to true to include comments
    - *strip_text*: set to true to strip whitespace before and after text content
    - *rewrite_prefixes*: set to true to replace namespace prefixes by "n{number}"
    - *qname_aware_tags*: a set of qname aware tag names in which prefixes
                          should be replaced in text content
    - *qname_aware_attrs*: a set of qname aware attribute names in which prefixes
                           should be replaced in text content
    - *exclude_attrs*: a set of attribute names that should not be serialised
    - *exclude_tags*: a set of tag names that should not be serialised
    """
    def __init__(self, write, *,
                 with_comments=False, strip_text=False, rewrite_prefixes=False,
                 qname_aware_tags=None, qname_aware_attrs=None,
                 exclude_attrs=None, exclude_tags=None):
        self._write = write
        self._data = []
        self._with_comments = with_comments
        self._strip_text = strip_text
        self._exclude_attrs = set(exclude_attrs) if exclude_attrs else None
        self._exclude_tags = set(exclude_tags) if exclude_tags else None

        self._rewrite_prefixes = rewrite_prefixes
        if qname_aware_tags:
            self._qname_aware_tags = set(qname_aware_tags)
        else:
            self._qname_aware_tags = None
        if qname_aware_attrs:
            self._find_qname_aware_attrs = set(qname_aware_attrs).intersection
        else:
            self._find_qname_aware_attrs = None

        # Stack with globally and newly declared namespaces as (uri, prefix) pairs.
        self._declared_ns_stack = [[
            ("http://www.w3.org/XML/1998/namespace", "xml"),
        ]]
        # Stack with user declared namespace prefixes as (uri, prefix) pairs.
        self._ns_stack = []
        if not rewrite_prefixes:
            self._ns_stack.append(list(_namespace_map.items()))
        self._ns_stack.append([])
        self._prefix_map = {}
        self._preserve_space = [False]
        self._pending_start = None
        self._root_seen = False
        self._root_done = False
        self._ignored_depth = 0

    def _iter_namespaces(self, ns_stack, _reversed=reversed):
        for namespaces in _reversed(ns_stack):
            if namespaces:  # almost no element declares new namespaces
                yield from namespaces

    def _resolve_prefix_name(self, prefixed_name):
        prefix, name = prefixed_name.split(':', 1)
        for uri, p in self._iter_namespaces(self._ns_stack):
            if p == prefix:
                return f'{{{uri}}}{name}'
        raise ValueError(f'Prefix {prefix} of QName "{prefixed_name}" is not declared in scope')

    def _qname(self, qname, uri=None):
        if uri is None:
            uri, tag = qname[1:].rsplit('}', 1) if qname[:1] == '{' else ('', qname)
        else:
            tag = qname

        prefixes_seen = set()
        for u, prefix in self._iter_namespaces(self._declared_ns_stack):
            if u == uri and prefix not in prefixes_seen:
                return f'{prefix}:{tag}' if prefix else tag, tag, uri
            prefixes_seen.add(prefix)

        # Not declared yet => add new declaration.
        if self._rewrite_prefixes:
            if uri in self._prefix_map:
                prefix = self._prefix_map[uri]
            else:
                prefix = self._prefix_map[uri] = f'n{len(self._prefix_map)}'
            self._declared_ns_stack[-1].append((uri, prefix))
            return f'{prefix}:{tag}', tag, uri

        if not uri and '' not in prefixes_seen:
            # No default namespace declared => no prefix needed.
            return tag, tag, uri

        for u, prefix in self._iter_namespaces(self._ns_stack):
            if u == uri:
                self._declared_ns_stack[-1].append((uri, prefix))
                return f'{prefix}:{tag}' if prefix else tag, tag, uri

        if not uri:
            # As soon as a default namespace is defined,
            # anything that has no namespace (and thus, no prefix) goes there.
            return tag, tag, uri

        raise ValueError(f'Namespace "{uri}" is not declared in scope')

    def data(self, data):
        if not self._ignored_depth:
            self._data.append(data)

    def _flush(self, _join_text=''.join):
        data = _join_text(self._data)
        del self._data[:]
        if self._strip_text and not self._preserve_space[-1]:
            data = data.strip()
        if self._pending_start is not None:
            args, self._pending_start = self._pending_start, None
            qname_text = data if data and _looks_like_prefix_name(data) else None
            self._start(*args, qname_text)
            if qname_text is not None:
                return
        if data and self._root_seen:
            self._write(_escape_cdata_c14n(data))

    def start_ns(self, prefix, uri):
        if self._ignored_depth:
            return
        # we may have to resolve qnames in text content
        if self._data:
            self._flush()
        self._ns_stack[-1].append((uri, prefix))

    def start(self, tag, attrs):
        if self._exclude_tags is not None and (
                self._ignored_depth or tag in self._exclude_tags):
            self._ignored_depth += 1
            return
        if self._data:
            self._flush()

        new_namespaces = []
        self._declared_ns_stack.append(new_namespaces)

        if self._qname_aware_tags is not None and tag in self._qname_aware_tags:
            # Need to parse text first to see if it requires a prefix declaration.
            self._pending_start = (tag, attrs, new_namespaces)
            return
        self._start(tag, attrs, new_namespaces)

    def _start(self, tag, attrs, new_namespaces, qname_text=None):
        if self._exclude_attrs is not None and attrs:
            attrs = {k: v for k, v in attrs.items() if k not in self._exclude_attrs}

        qnames = {tag, *attrs}
        resolved_names = {}

        # Resolve prefixes in attribute and tag text.
        if qname_text is not None:
            qname = resolved_names[qname_text] = self._resolve_prefix_name(qname_text)
            qnames.add(qname)
        if self._find_qname_aware_attrs is not None and attrs:
            qattrs = self._find_qname_aware_attrs(attrs)
            if qattrs:
                for attr_name in qattrs:
                    value = attrs[attr_name]
                    if _looks_like_prefix_name(value):
                        qname = resolved_names[value] = self._resolve_prefix_name(value)
                        qnames.add(qname)
            else:
                qattrs = None
        else:
            qattrs = None

        # Assign prefixes in lexicographical order of used URIs.
        parse_qname = self._qname
        parsed_qnames = {n: parse_qname(n) for n in sorted(
            qnames, key=lambda n: n.split('}', 1))}

        # Write namespace declarations in prefix order ...
        if new_namespaces:
            attr_list = [
                ('xmlns:' + prefix if prefix else 'xmlns', uri)
                for uri, prefix in new_namespaces
            ]
            attr_list.sort()
        else:
            # almost always empty
            attr_list = []

        # ... followed by attributes in URI+name order
        if attrs:
            for k, v in sorted(attrs.items()):
                if qattrs is not None and k in qattrs and v in resolved_names:
                    v = parsed_qnames[resolved_names[v]][0]
                attr_qname, attr_name, uri = parsed_qnames[k]
                # No prefix for attributes in default ('') namespace.
                attr_list.append((attr_qname if uri else attr_name, v))

        # Honour xml:space attributes.
        space_behaviour = attrs.get('{http://www.w3.org/XML/1998/namespace}space')
        self._preserve_space.append(
            space_behaviour == 'preserve' if space_behaviour
            else self._preserve_space[-1])

        # Write the tag.
        write = self._write
        write('<' + parsed_qnames[tag][0])
        if attr_list:
            write(''.join([f' {k}="{_escape_attrib_c14n(v)}"' for k, v in attr_list]))
        write('>')

        # Write the resolved qname text content.
        if qname_text is not None:
            write(_escape_cdata_c14n(parsed_qnames[resolved_names[qname_text]][0]))

        self._root_seen = True
        self._ns_stack.append([])

    def end(self, tag):
        if self._ignored_depth:
            self._ignored_depth -= 1
            return
        if self._data:
            self._flush()
        self._write(f'</{self._qname(tag)[0]}>')
        self._preserve_space.pop()
        self._root_done = len(self._preserve_space) == 1
        self._declared_ns_stack.pop()
        self._ns_stack.pop()

    def comment(self, text):
        if not self._with_comments:
            return
        if self._ignored_depth:
            return
        if self._root_done:
            self._write('\n')
        elif self._root_seen and self._data:
            self._flush()
        self._write(f'<!--{_escape_cdata_c14n(text)}-->')
        if not self._root_seen:
            self._write('\n')

    def pi(self, target, data):
        if self._ignored_depth:
            return
        if self._root_done:
            self._write('\n')
        elif self._root_seen and self._data:
            self._flush()
        self._write(
            f'<?{target} {_escape_cdata_c14n(data)}?>' if data else f'<?{target}?>')
        if not self._root_seen:
            self._write('\n')


def _escape_cdata_c14n(text):
    # escape character data
    try:
        # it's worth avoiding do-nothing calls for strings that are
        # shorter than 500 character, or so.  assume that's, by far,
        # the most common case in most applications.
        if '&' in text:
            text = text.replace('&', '&amp;')
        if '<' in text:
            text = text.replace('<', '&lt;')
        if '>' in text:
            text = text.replace('>', '&gt;')
        if '\r' in text:
            text = text.replace('\r', '&#xD;')
        return text
    except (TypeError, AttributeError):
        _raise_serialization_error(text)


def _escape_attrib_c14n(text):
    # escape attribute value
    try:
        if '&' in text:
            text = text.replace('&', '&amp;')
        if '<' in text:
            text = text.replace('<', '&lt;')
        if '"' in text:
            text = text.replace('"', '&quot;')
        if '\t' in text:
            text = text.replace('\t', '&#x9;')
        if '\n' in text:
            text = text.replace('\n', '&#xA;')
        if '\r' in text:
            text = text.replace('\r', '&#xD;')
        return text
    except (TypeError, AttributeError):
        _raise_serialization_error(text)


# --------------------------------------------------------------------

# Import the C accelerators
try:
    # Element is going to be shadowed by the C implementation. We need to keep
    # the Python version of it accessible for some "creative" by external code
    # (see tests)
    _Element_Py = Element

    # Element, SubElement, ParseError, TreeBuilder, XMLParser, _set_factories
    from _elementtree import *
    from _elementtree import _set_factories
except ImportError:
    pass
else:
    _set_factories(Comment, ProcessingInstruction)
xml/etree/ElementInclude.py000064400000012037151153537540011733 0ustar00#
# ElementTree
# $Id: ElementInclude.py 3375 2008-02-13 08:05:08Z fredrik $
#
# limited xinclude support for element trees
#
# history:
# 2003-08-15 fl   created
# 2003-11-14 fl   fixed default loader
#
# Copyright (c) 2003-2004 by Fredrik Lundh.  All rights reserved.
#
# fredrik@pythonware.com
# http://www.pythonware.com
#
# --------------------------------------------------------------------
# The ElementTree toolkit is
#
# Copyright (c) 1999-2008 by Fredrik Lundh
#
# By obtaining, using, and/or copying this software and/or its
# associated documentation, you agree that you have read, understood,
# and will comply with the following terms and conditions:
#
# Permission to use, copy, modify, and distribute this software and
# its associated documentation for any purpose and without fee is
# hereby granted, provided that the above copyright notice appears in
# all copies, and that both that copyright notice and this permission
# notice appear in supporting documentation, and that the name of
# Secret Labs AB or the author not be used in advertising or publicity
# pertaining to distribution of the software without specific, written
# prior permission.
#
# SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
# TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT-
# ABILITY AND FITNESS.  IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR
# BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
# DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
# WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
# ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
# OF THIS SOFTWARE.
# --------------------------------------------------------------------

# Licensed to PSF under a Contributor Agreement.
# See http://www.python.org/psf/license for licensing details.

##
# Limited XInclude support for the ElementTree package.
##

import copy
from . import ElementTree

XINCLUDE = "{http://www.w3.org/2001/XInclude}"

XINCLUDE_INCLUDE = XINCLUDE + "include"
XINCLUDE_FALLBACK = XINCLUDE + "fallback"

##
# Fatal include error.

class FatalIncludeError(SyntaxError):
    pass

##
# Default loader.  This loader reads an included resource from disk.
#
# @param href Resource reference.
# @param parse Parse mode.  Either "xml" or "text".
# @param encoding Optional text encoding (UTF-8 by default for "text").
# @return The expanded resource.  If the parse mode is "xml", this
#    is an ElementTree instance.  If the parse mode is "text", this
#    is a Unicode string.  If the loader fails, it can return None
#    or raise an OSError exception.
# @throws OSError If the loader fails to load the resource.

def default_loader(href, parse, encoding=None):
    if parse == "xml":
        with open(href, 'rb') as file:
            data = ElementTree.parse(file).getroot()
    else:
        if not encoding:
            encoding = 'UTF-8'
        with open(href, 'r', encoding=encoding) as file:
            data = file.read()
    return data

##
# Expand XInclude directives.
#
# @param elem Root element.
# @param loader Optional resource loader.  If omitted, it defaults
#     to {@link default_loader}.  If given, it should be a callable
#     that implements the same interface as <b>default_loader</b>.
# @throws FatalIncludeError If the function fails to include a given
#     resource, or if the tree contains malformed XInclude elements.
# @throws OSError If the function fails to load a given resource.

def include(elem, loader=None):
    if loader is None:
        loader = default_loader
    # look for xinclude elements
    i = 0
    while i < len(elem):
        e = elem[i]
        if e.tag == XINCLUDE_INCLUDE:
            # process xinclude directive
            href = e.get("href")
            parse = e.get("parse", "xml")
            if parse == "xml":
                node = loader(href, parse)
                if node is None:
                    raise FatalIncludeError(
                        "cannot load %r as %r" % (href, parse)
                        )
                node = copy.copy(node)
                if e.tail:
                    node.tail = (node.tail or "") + e.tail
                elem[i] = node
            elif parse == "text":
                text = loader(href, parse, e.get("encoding"))
                if text is None:
                    raise FatalIncludeError(
                        "cannot load %r as %r" % (href, parse)
                        )
                if i:
                    node = elem[i-1]
                    node.tail = (node.tail or "") + text + (e.tail or "")
                else:
                    elem.text = (elem.text or "") + text + (e.tail or "")
                del elem[i]
                continue
            else:
                raise FatalIncludeError(
                    "unknown parse type in xi:include tag (%r)" % parse
                )
        elif e.tag == XINCLUDE_FALLBACK:
            raise FatalIncludeError(
                "xi:fallback tag must be child of xi:include (%r)" % e.tag
                )
        else:
            include(e, loader)
        i = i + 1
xml/etree/__pycache__/ElementPath.cpython-38.opt-2.pyc000064400000020364151153537540016474 0ustar00U

e5d>3�@s�ddlZe�d�Zd"dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zeee	ee
ed�Z
iZGdd�d�Zd#dd�Zd$dd�Zd%dd�Zd&d d!�ZdS)'�Nz\('[^']*'|\"[^\"]*\"|::|//?|\.\.|\(\)|[/.*:\[\]\(\)@=])|((?:\{[^}]+\})?[^/\[\]\(\)@=\s]+)|\s+c		cs�|r|�d�nd}d}t�|�D]�}|\}}|r�|ddkr�d|kr�|�dd�\}}z"|s^t�|d|||ffVWq�tk
r�td|�d�Yq�Xn"|r�|s�|d||ffVn|Vd}q |V|d	k}q dS)
N�Fr�{�:�z{%s}%sz!prefix %r not found in prefix map�@)�get�xpath_tokenizer_re�findall�split�KeyError�SyntaxError)	�pattern�
namespacesZdefault_namespaceZparsing_attribute�tokenZttype�tag�prefixZuri�r�-/usr/lib64/python3.8/xml/etree/ElementPath.py�xpath_tokenizerIs&rcCs>|j}|dkr:i|_}|j��D]}|D]}|||<q*q"|S�N)�
parent_map�root�iter)�contextr�p�errr�get_parent_mapas
rcCs |dd�dkp|dd�dkS)N��{*}����}*r�rrrr�_is_wildcard_tagksr"cs�tt���dkr"��fdd�}n��dkr:��fdd�}n��dd�dkr��dd��tt��d���dd�������fd	d�}nL�d
d�dkrƈdd��tdt��������fd
d�}ntd�����|S)Nz{*}*c3s |D]}�|j��r|VqdSrr!�r�result�elem��_isinstance�_strrr�selectusz_prepare_tag.<locals>.selectz{}*c3s0|D]&}|j}�|��r|ddkr|VqdS)Nrrr!�rr$r%Zel_tagr&rrr){srr�c3s8|D].}|j}|�ks,�|��r|��kr|VqdSrr!r*)r'r(�no_ns�suffixrrrr)�srr ���c3s0|D]&}|j}�|��r|��kr|VqdSrr!r*)r'r(�ns�ns_onlyrrr)�szinternal parser error, got )�
isinstance�str�slice�len�RuntimeError)rr)r)r'r(r,r/r0r-rr�_prepare_tagos 
r6csR|d�t��r&t����fdd�}n(�dd�dkrB�dd���fdd�}|S)Nrcsdd�}�|||��S)Ncss|D]}|EdHqdSrr)r$r%rrr�select_child�sz3prepare_child.<locals>.select.<locals>.select_childr�rr$r7��
select_tagrrr)�szprepare_child.<locals>.selectr+�{}c3s(|D]}|D]}|j�kr|VqqdSrr!�rr$r%rr!rrr)�s
)r"r6��nextrr)r�r:rr�
prepare_child�sr@cCsdd�}|S)Ncss|D]}|EdHqdSrrr#rrrr)�szprepare_star.<locals>.selectrr=rrr�prepare_star�srAcCsdd�}|S)Ncss|EdHdSrr)rr$rrrr)�szprepare_self.<locals>.selectrr=rrr�prepare_self�srBcs�z
|�}Wntk
r YdSX|ddkr4d�n|dsF|d�ntd��t��rlt����fdd�}n(�dd�dkr��dd���fd	d�}|S)
Nr�*rzinvalid descendantcsdd�}�|||��S)Ncss*|D] }|��D]}||k	r|VqqdSr�r)r$r%rrrrr7�sz8prepare_descendant.<locals>.select.<locals>.select_childrr8r9rrr)�sz"prepare_descendant.<locals>.selectr+r;c3s,|D]"}|���D]}||k	r|VqqdSrrDr<r!rrr)�s)�
StopIterationrr"r6r=rr?r�prepare_descendant�s 

rFcCsdd�}|S)Ncss@t|�}i}|D]*}||kr||}||krd||<|VqdSr)r)rr$rZ
result_mapr%�parentrrrr)�szprepare_parent.<locals>.selectrr=rrr�prepare_parent�s
rHcsLg}g}z
|�}Wntk
r(YdSX|ddkr8q�|dkrBq|drr|ddd�dkrrd|ddd�f}|�|dp�d�|�|d�qd	�|�}|d
kr�|d��fdd�}|S|d
kr�|d�|d���fdd�}|S|dk�rt�d|d��s|d��fdd�}|S|dk�sB|dk�rxt�d|d��sx|d�|d���rh��fdd�}n�fdd�}|S|dk�s�|dk�s�|dk�r@|dk�r�t|d�d��dk�r0td��nl|ddk�r�td��|dk�r,zt|d�d�Wntk
�rtd��YnX�dk�r0td��nd��fdd�}|Std��dS) Nr�])rrrz'"�'r.�-rz@-c3s"|D]}|���dk	r|VqdSr�rr#)�keyrrr)�sz!prepare_predicate.<locals>.selectz@-='c3s"|D]}|����kr|VqdSrrLr#)rM�valuerrr)sz\-?\d+$c3s"|D]}|���dk	r|VqdSr)�findr#r!rrr)sz.='z-='c3s:|D]0}|���D] }d�|����kr|VqqqdS�Nr)r	�join�itertextr<)rrNrrr)s
c3s&|D]}d�|����kr|VqdSrP)rQrRr#)rNrrr)sz-()z-()-zXPath position >= 1 expectedZlastzunsupported functionr+zunsupported expressionrz)XPath offset from last() must be negativec
3s^t|�}|D]L}z.||}t|�|j��}|�|kr<|VWqttfk
rVYqXqdSr)r�listr	r�
IndexErrorr)rr$rr%rGZelems)�indexrrr)5s
zinvalid predicate)rE�appendrQ�re�match�intr�
ValueError)r>rZ	signatureZ	predicater)r)rUrMrrNr�prepare_predicate�sj

&





r[)rrC�.z..z//�[c@seZdZdZdd�ZdS)�_SelectorContextNcCs
||_dSr)r)�selfrrrr�__init__Psz_SelectorContext.__init__)�__name__�
__module__�__qualname__rr`rrrrr^Nsr^c
Csj|dd�dkr|d}|f}|r6|tt|����7}zt|}W�n�tk
�r@tt�dkrjt��|dd�dkr�td��tt	||��j
}z
|�}Wntk
r�YYdSXg}z|�t
|d||��Wntk
r�td�d�YnXz|�}|ddk�r|�}Wq�tk
�r0Y�q4Yq�Xq�|t|<YnX|g}t|�}|D]}	|	||�}�qT|S)	Nr.�/rC�drz#cannot use absolute path on elementrzinvalid path)�tuple�sorted�items�_cacherr4�clearrrr�__next__rErV�opsr^)
r%�pathrZ	cache_keyZselectorr>rr$rr)rrr�iterfindXsD


rncCstt|||�d�Sr)r>rn�r%rmrrrrrO�srOcCstt|||��Sr)rSrnrorrrr	�sr	cCs:ztt|||��}|jpdWStk
r4|YSXdSrP)r>rn�textrE)r%rm�defaultrrrr�findtext�s
rr)N)N)N)N)NN)rW�compilerrrr"r6r@rArBrFrHr[rlrir^rnrOr	rrrrrr�<module>;s4�

)
b�	

,

xml/etree/__pycache__/__init__.cpython-38.opt-1.pyc000064400000000205151153537540016014 0ustar00U

e5dD�@sdS)N�rrr�*/usr/lib64/python3.8/xml/etree/__init__.py�<module>�xml/etree/__pycache__/cElementTree.cpython-38.opt-1.pyc000064400000000257151153537540016640 0ustar00U

e5dR�@sddlTdS)�)�*N)Zxml.etree.ElementTree�rr�./usr/lib64/python3.8/xml/etree/cElementTree.py�<module>�xml/etree/__pycache__/ElementTree.cpython-38.pyc000064400000154510151153537540015540 0ustar00U

e5d��@s�dZddddddddd	d
ddd
ddddddddddddgZdZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZGdd
�d
e�Z
d d�ZGd!d�d�Zifd"d�Zd]d#d�Zd^d$d�ZeZGd%d
�d
�ZGd&d�d�Ze	jd'd(��Zd_d)d*�Zd+d,�Zd-Zzee�ZWnek
�r.YnXd.d/�Zd0d1�Zeeed2�Zd3d�Z d4d5d6d7d8d9d:d;�Z!e!e _!d<d=�Z"d>d?�Z#d@dA�Z$dBdC�Z%d`dddDdE�dFd�Z&GdGdH�dHej'�Z(dadddDdE�dId�Z)dJd�Z*dbdKd	�Z+dcdLd�Z,GdMd�d�Z-dddNd�Z.dedOd�Z/e.Z0dfdPd�Z1GdQd�d�Z2GdRd�d�Z3dgdddS�dTd�Z4e�5dUej6�j7Z8GdVd�d�Z9dWdX�Z:dYdZ�Z;zeZ<dd[l=Tdd\l=m>Z>Wne?k
�r�YnXe>ee�dS)haLightweight XML support for Python.

 XML is an inherently hierarchical data format, and the most natural way to
 represent it is with a tree.  This module has two classes for this purpose:

    1. ElementTree represents the whole XML document as a tree and

    2. Element represents a single node in this tree.

 Interactions with the whole document (reading and writing to/from files) are
 usually done on the ElementTree level.  Interactions with a single XML element
 and its sub-elements are done on the Element level.

 Element is a flexible container object designed to store hierarchical data
 structures in memory. It can be described as a cross between a list and a
 dictionary.  Each Element has a number of properties associated with it:

    'tag' - a string containing the element's name.

    'attributes' - a Python dictionary storing the element's attributes.

    'text' - a string containing the element's text content.

    'tail' - an optional string containing text after the element's end tag.

    And a number of child elements stored in a Python sequence.

 To create an element instance, use the Element constructor,
 or the SubElement factory function.

 You can also use the ElementTree class to wrap an element structure
 and convert it to and from XML.

�Comment�dump�Element�ElementTree�
fromstring�fromstringlist�	iselement�	iterparse�parse�
ParseError�PI�ProcessingInstruction�QName�
SubElement�tostring�tostringlist�TreeBuilder�VERSION�XML�XMLID�	XMLParser�
XMLPullParser�register_namespace�canonicalize�C14NWriterTargetz1.3.0�N�)�ElementPathc@seZdZdZdS)r
z�An error when parsing an XML document.

    In addition to its exception value, a ParseError contains
    two extra attributes:
        'code'     - the specific exception code
        'position' - the line and column of the error

    N)�__name__�
__module__�__qualname__�__doc__�r!r!�-/usr/lib64/python3.8/xml/etree/ElementTree.pyr
jscCs
t|d�S)z2Return True if *element* appears to be an Element.�tag)�hasattr)�elementr!r!r"rxsc@s
eZdZdZdZdZdZdZifdd�Zdd�Z	dd�Z
d	d
�Zdd�Zd
d�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd9d!d"�Zd:d#d$�Zd;d%d&�Zd<d'd(�Zd)d*�Zd=d+d,�Zd-d.�Zd/d0�Zd1d2�Zd>d3d4�Z d?d5d6�Z!d7d8�Z"dS)@rahAn XML element.

    This class is the reference implementation of the Element interface.

    An element's length is its number of subelements.  That means if you
    want to check if an element is truly empty, you should check BOTH
    its length AND its text attribute.

    The element tag, attribute names, and attribute values can be either
    bytes or strings.

    *tag* is the element name.  *attrib* is an optional dictionary containing
    element attributes. *extra* are additional element attributes given as
    keyword arguments.

    Example form:
        <tag attrib>text<child/>...</tag>tail

    NcKs6t|t�std|jjf��||_||�|_g|_dS)Nzattrib must be dict, not %s)�
isinstance�dict�	TypeError�	__class__rr#�attrib�	_children)�selfr#r*�extrar!r!r"�__init__�s
�
zElement.__init__cCsd|jj|jt|�fS)Nz<%s %r at %#x>)r)rr#�id�r,r!r!r"�__repr__�szElement.__repr__cCs|�||�S)z�Create a new element with the same type.

        *tag* is a string containing the element name.
        *attrib* is a dictionary containing the element attributes.

        Do not call this method, use the SubElement factory function instead.

        )r))r,r#r*r!r!r"�makeelement�s	zElement.makeelementcCs0|�|j|j�}|j|_|j|_||dd�<|S)z�Return copy of current element.

        This creates a shallow copy. Subelements will be shared with the
        original tree.

        N)r2r#r*�text�tail)r,�elemr!r!r"�copy�s
zElement.copycCs
t|j�S�N)�lenr+r0r!r!r"�__len__�szElement.__len__cCstjdtdd�t|j�dkS)NzyThe behavior of this method will change in future versions.  Use specific 'len(elem)' or 'elem is not None' test instead.���
stacklevelr)�warnings�warn�
FutureWarningr8r+r0r!r!r"�__bool__�s�zElement.__bool__cCs
|j|Sr7�r+�r,�indexr!r!r"�__getitem__�szElement.__getitem__cCs8t|t�r |D]}|�|�qn
|�|�||j|<dSr7)r&�slice�_assert_is_elementr+)r,rCr%Zeltr!r!r"�__setitem__�s


zElement.__setitem__cCs|j|=dSr7rArBr!r!r"�__delitem__�szElement.__delitem__cCs|�|�|j�|�dS)aAdd *subelement* to the end of this element.

        The new element will appear in document order after the last existing
        subelement (or directly after the text, if it's the first subelement),
        but before the end tag for this element.

        N�rFr+�append�r,�
subelementr!r!r"rJ�s
zElement.appendcCs$|D]}|�|�|j�|�qdS)zkAppend subelements from a sequence.

        *elements* is a sequence with zero or more elements.

        NrI)r,�elementsr%r!r!r"�extend�s
zElement.extendcCs|�|�|j�||�dS)z(Insert *subelement* at position *index*.N)rFr+�insert)r,rCrLr!r!r"rO�s
zElement.insertcCs t|t�stdt|�j��dS)Nzexpected an Element, not %s)r&�_Element_Pyr(�typer)r,�er!r!r"rF�s
zElement._assert_is_elementcCs|j�|�dS)a�Remove matching subelement.

        Unlike the find methods, this method compares elements based on
        identity, NOT ON tag value or contents.  To remove subelements by
        other means, the easiest way is to use a list comprehension to
        select what elements to keep, and then use slice assignment to update
        the parent element.

        ValueError is raised if a matching element could not be found.

        N)r+�removerKr!r!r"rSs
zElement.removecCstjdtdd�|jS)z`(Deprecated) Return all subelements.

        Elements are returned in document order.

        zaThis method will be removed in future versions.  Use 'list(elem)' or iteration over elem instead.r:r;)r=r>�DeprecationWarningr+r0r!r!r"�getchildrens�zElement.getchildrencCst�|||�S)aFind first matching element by tag name or path.

        *path* is a string having either an element tag or an XPath,
        *namespaces* is an optional mapping from namespace prefix to full name.

        Return the first matching element, or None if no element was found.

        )r�find�r,�path�
namespacesr!r!r"rV!s	zElement.findcCst�||||�S)a�Find text for first matching element by tag name or path.

        *path* is a string having either an element tag or an XPath,
        *default* is the value to return if the element was not found,
        *namespaces* is an optional mapping from namespace prefix to full name.

        Return text content of first matching element, or default value if
        none was found.  Note that if an element is found having no text
        content, the empty string is returned.

        )r�findtext�r,rX�defaultrYr!r!r"rZ,szElement.findtextcCst�|||�S)aFind all matching subelements by tag name or path.

        *path* is a string having either an element tag or an XPath,
        *namespaces* is an optional mapping from namespace prefix to full name.

        Returns list containing all matching elements in document order.

        )r�findallrWr!r!r"r]:s	zElement.findallcCst�|||�S)a Find all matching subelements by tag name or path.

        *path* is a string having either an element tag or an XPath,
        *namespaces* is an optional mapping from namespace prefix to full name.

        Return an iterable yielding all matching elements in document order.

        )r�iterfindrWr!r!r"r^Es	zElement.iterfindcCs |j��g|_d|_|_dS)z�Reset element.

        This function removes all subelements, clears all attributes, and sets
        the text and tail attributes to None.

        N)r*�clearr+r3r4r0r!r!r"r_Ps
z
Element.clearcCs|j�||�S)agGet element attribute.

        Equivalent to attrib.get, but some implementations may handle this a
        bit more efficiently.  *key* is what attribute to look for, and
        *default* is what to return if the attribute was not found.

        Returns a string containing the attribute value, or the default if
        attribute was not found.

        )r*�get)r,�keyr\r!r!r"r`[szElement.getcCs||j|<dS)z�Set element attribute.

        Equivalent to attrib[key] = value, but some implementations may handle
        this a bit more efficiently.  *key* is what attribute to set, and
        *value* is the attribute value to set it to.

        N)r*)r,ra�valuer!r!r"�sethszElement.setcCs
|j��S)z�Get list of attribute names.

        Names are returned in an arbitrary order, just like an ordinary
        Python dict.  Equivalent to attrib.keys()

        )r*�keysr0r!r!r"rdrszElement.keyscCs
|j��S)z�Get element attributes as a sequence.

        The attributes are returned in arbitrary order.  Equivalent to
        attrib.items().

        Return a list of (name, value) tuples.

        )r*�itemsr0r!r!r"re{s	z
Element.itemsccsD|dkrd}|dks|j|kr$|V|jD]}|�|�EdHq*dS)aCreate tree iterator.

        The iterator loops over the element and all subelements in document
        order, returning all elements with a matching tag.

        If the tree structure is modified during iteration, new or removed
        elements may or may not be included.  To get a stable set, use the
        list() function on the iterator, and loop over the resulting list.

        *tag* is what tags to look for (default is to return all elements)

        Return an iterator containing all the matching elements.

        �*N)r#r+�iter)r,r#rRr!r!r"rg�s
zElement.itercCstjdtdd�t|�|��S)NzbThis method will be removed in future versions.  Use 'elem.iter()' or 'list(elem.iter())' instead.r:r;�r=r>rT�listrg�r,r#r!r!r"�getiterator�s�zElement.getiteratorccsX|j}t|t�s|dk	rdS|j}|r,|V|D]"}|��EdH|j}|r0|Vq0dS)z�Create text iterator.

        The iterator loops over the element and all subelements in document
        order, returning all inner text.

        N)r#r&�strr3�itertextr4)r,r#�trRr!r!r"rm�szElement.itertext)N)NN)N)N)N)N)N)#rrrr r#r*r3r4r.r1r2r6r9r@rDrGrHrJrNrOrFrSrUrVrZr]r^r_r`rcrdrergrkrmr!r!r!r"r}s@	








	

cKs"||�}|�||�}|�|�|S)a�Subelement factory which creates an element instance, and appends it
    to an existing parent.

    The element tag, attribute names, and attribute values can be either
    bytes or Unicode strings.

    *parent* is the parent element, *tag* is the subelements name, *attrib* is
    an optional directory containing element attributes, *extra* are
    additional attributes given as keyword arguments.

    )r2rJ)�parentr#r*r-r%r!r!r"r�s
cCstt�}||_|S)z�Comment element factory.

    This function creates a special element which the standard serializer
    serializes as an XML comment.

    *text* is a string containing the comment string.

    )rrr3)r3r%r!r!r"r�s	cCs&tt�}||_|r"|jd||_|S)a*Processing Instruction element factory.

    This function creates a special element which the standard serializer
    serializes as an XML comment.

    *target* is a string containing the processing instruction, *text* is a
    string containing the processing instruction contents, if any.

    � )rrr3)�targetr3r%r!r!r"r�s

c@sZeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)r
a�Qualified name wrapper.

    This class can be used to wrap a QName attribute value in order to get
    proper namespace handing on output.

    *text_or_uri* is a string containing the QName value either in the form
    {uri}local, or if the tag argument is given, the URI part of a QName.

    *tag* is an optional argument which if given, will make the first
    argument (text_or_uri) be interpreted as a URI, and this argument (tag)
    be interpreted as a local name.

    NcCs|rd||f}||_dS)Nz{%s}%s�r3)r,Ztext_or_urir#r!r!r"r.�szQName.__init__cCs|jSr7rrr0r!r!r"�__str__�sz
QName.__str__cCsd|jj|jfS)Nz<%s %r>)r)rr3r0r!r!r"r1szQName.__repr__cCs
t|j�Sr7)�hashr3r0r!r!r"�__hash__szQName.__hash__cCs t|t�r|j|jkS|j|kSr7�r&r
r3�r,�otherr!r!r"�__le__s
zQName.__le__cCs t|t�r|j|jkS|j|kSr7rvrwr!r!r"�__lt__s
zQName.__lt__cCs t|t�r|j|jkS|j|kSr7rvrwr!r!r"�__ge__s
zQName.__ge__cCs t|t�r|j|jkS|j|kSr7rvrwr!r!r"�__gt__s
zQName.__gt__cCs t|t�r|j|jkS|j|kSr7rvrwr!r!r"�__eq__s
zQName.__eq__)N)
rrrr r.rsr1ruryrzr{r|r}r!r!r!r"r
�s
c@s�eZdZdZddd�Zdd�Zdd�Zdd	d
�Zddd�Zd d
d�Z	d!dd�Z
d"dd�Zd#dd�Zd$dd�Z
d%dd�dd�Zdd�ZdS)&ra%An XML element hierarchy.

    This class also provides support for serialization to and from
    standard XML.

    *element* is an optional root element node,
    *file* is an optional file handle or file name of an XML file whose
    contents will be used to initialize the tree with.

    NcCs||_|r|�|�dSr7)�_rootr	)r,r%�filer!r!r"r.'szElementTree.__init__cCs|jS)z!Return root element of this tree.�r~r0r!r!r"�getroot-szElementTree.getrootcCs
||_dS)z�Replace root element of this tree.

        This will discard the current contents of the tree and replace it
        with the given element.  Use with care!

        Nr�)r,r%r!r!r"�_setroot1szElementTree._setrootcCs�d}t|d�st|d�}d}z^|dkrLt�}t|d�rL|�|�|_|jW�2S|�d�}|s\qh|�|�qL|��|_|jW�S|r�|��XdS)a=Load external XML document into element tree.

        *source* is a file name or file object, *parser* is an optional parser
        instance that defaults to XMLParser.

        ParseError is raised if the parser fails to parse the document.

        Returns the root element of the given source document.

        F�read�rbTN�_parse_wholei)r$�open�closerr�r~r��feed)r,�source�parser�close_source�datar!r!r"r	;s$






zElementTree.parsecCs|j�|�S)z�Create and return tree iterator for the root element.

        The iterator loops over all elements in this tree, in document order.

        *tag* is a string with the tag name to iterate over
        (default is to return all elements).

        )r~rgrjr!r!r"rg`s
zElementTree.itercCstjdtdd�t|�|��S)NzbThis method will be removed in future versions.  Use 'tree.iter()' or 'list(tree.iter())' instead.r:r;rhrjr!r!r"rkms�zElementTree.getiteratorcCs:|dd�dkr,d|}tjd|tdd�|j�||�S)a\Find first matching element by tag name or path.

        Same as getroot().find(path), which is Element.find()

        *path* is a string having either an element tag or an XPath,
        *namespaces* is an optional mapping from namespace prefix to full name.

        Return the first matching element, or None if no element was found.

        Nr�/�.��This search is broken in 1.3 and earlier, and will be fixed in a future version.  If you rely on the current behaviour, change it to %rr:r;)r=r>r?r~rVrWr!r!r"rVus��zElementTree.findcCs<|dd�dkr,d|}tjd|tdd�|j�|||�S)aeFind first matching element by tag name or path.

        Same as getroot().findtext(path),  which is Element.findtext()

        *path* is a string having either an element tag or an XPath,
        *namespaces* is an optional mapping from namespace prefix to full name.

        Return the first matching element, or None if no element was found.

        Nrr�r�r�r:r;)r=r>r?r~rZr[r!r!r"rZ�s��zElementTree.findtextcCs:|dd�dkr,d|}tjd|tdd�|j�||�S)aaFind all matching subelements by tag name or path.

        Same as getroot().findall(path), which is Element.findall().

        *path* is a string having either an element tag or an XPath,
        *namespaces* is an optional mapping from namespace prefix to full name.

        Return list containing all matching elements in document order.

        Nrr�r�r�r:r;)r=r>r?r~r]rWr!r!r"r]�s��zElementTree.findallcCs:|dd�dkr,d|}tjd|tdd�|j�||�S)agFind all matching subelements by tag name or path.

        Same as getroot().iterfind(path), which is element.iterfind()

        *path* is a string having either an element tag or an XPath,
        *namespaces* is an optional mapping from namespace prefix to full name.

        Return an iterable yielding all matching elements in document order.

        Nrr�r�r�r:r;)r=r>r?r~r^rWr!r!r"r^�s��zElementTree.iterfindT��short_empty_elementsc	Cs�|s
d}n|tkrtd|��|s4|dkr0d}nd}|��}t||���}|dkr�|sd|dkr�|dkr�|}	|dkr�d	dl}
|
��}	|d
|	f�|dkr�t||j�n,t|j|�\}}t|}
|
||j|||d�W5QRXdS)
a�Write element tree to a file as XML.

        Arguments:
          *file_or_filename* -- file name or a file object opened for writing

          *encoding* -- the output encoding (default: US-ASCII)

          *xml_declaration* -- bool indicating if an XML declaration should be
                               added to the output. If None, an XML declaration
                               is added if encoding IS NOT either of:
                               US-ASCII, UTF-8, or Unicode

          *default_namespace* -- sets the default XML namespace (for "xmlns")

          *method* -- either "xml" (default), "html, "text", or "c14n"

          *short_empty_elements* -- controls the formatting of elements
                                    that contain no content. If True (default)
                                    they are emitted as a single self-closed
                                    tag, otherwise they are emitted as a pair
                                    of start/end tags

        �xmlzunknown method %r�c14n�utf-8�us-asciiN)r�r��unicoder�rz$<?xml version='1.0' encoding='%s'?>
r3r�)	�
_serialize�
ValueError�lower�_get_writer�localeZgetpreferredencoding�_serialize_textr~�_namespaces)r,�file_or_filename�encoding�xml_declaration�default_namespace�methodr�Z	enc_lower�writeZdeclared_encodingr��qnamesrYZ	serializer!r!r"r��s:����zElementTree.writecCs|j|dd�S)Nr�)r�)r�)r,rr!r!r"�
write_c14nszElementTree.write_c14n)NN)N)N)N)N)NN)N)N)NNNN)rrrr r.r�r�r	rgrkrVrZr]r^r�r�r!r!r!r"rs&



%





��:ccs"z
|j}WnPtk
rZ|dkr.t|d�}nt|d|dd�}|�|jVW5QRXYn�X|dkrl|Vn�t����}t|tj�r�|}nft|tj�r�t�	|�}|�
|j�nBt��}dd�|_||_z|j
|_
|j|_Wntk
r�YnXtj||ddd�}|�
|j�|jVW5QRXdS)	Nr��w�xmlcharrefreplace)r��errorscSsdS�NTr!r!r!r!r"�<lambda>0�z_get_writer.<locals>.<lambda>�
)r�r��newline)r��AttributeErrorr��
contextlib�	ExitStackr&�io�BufferedIOBase�	RawIOBase�BufferedWriter�callback�detach�writable�seekable�tell�
TextIOWrapper)r�r�r�r�stackr!r!r"r�sB
�


�r�csddi�i��rd��<���fdd�}|��D]�}|j}t|t�rZ|j�kr�||j�n<t|t�rv|�kr�||�n |dk	r�|tk	r�|tk	r�t|�|�	�D]F\}}t|t�r�|j}|�kr�||�t|t�r�|j�kr�||j�q�|j}t|t�r0|j�kr0||j�q0��fS)N�cs�z�|dd�dkr�|dd��dd�\}}��|�}|dkrjt�|�}|dkrZdt��}|dkrj|�|<|r�d||f�|<q�|�|<n�r�td��|�|<Wntk
r�t|�YnXdS)Nr�{�}zns%dr�z%s:%sz<cannot use non-qualified names with default_namespace option)�rsplitr`�_namespace_mapr8r�r(�_raise_serialization_error)�qname�urir#�prefix�r�rYr�r!r"�	add_qnameMs(


�z_namespaces.<locals>.add_qname)
rgr#r&r
r3rlrrr�re)r5r�r�r#rarbr3r!r�r"r�Bs4




r�cKs�|j}|j}|tkr$|d|��nv|tkr<|d|��n^||}|dkr||r\|t|��|D]}t|||d|d�q`�n|d|�t|���}	|	s�|�r2|r�t|��dd�d�D](\}
}|r�d|}|d	|t	|
�f�q�|	D]L\}}
t
|t�r�|j}t
|
t��r||
j}
nt	|
�}
|d
|||
f�q�|�sHt|��sH|�s�|d�|�rb|t|��|D]}t|||d|d��qf|d|d�n|d
�|j
�r�|t|j
��dS)N�	<!--%s-->�<?%s?>r��<cSs|dS�Nrr!��xr!r!r"r��r�z _serialize_xml.<locals>.<lambda>�ra�:�
 xmlns%s="%s"� %s="%s"�>�</z />)r#r3rr�
_escape_cdata�_serialize_xmlrire�sorted�_escape_attribr&r
r8r4)r�r5r�rYr��kwargsr#r3rRre�v�kr!r!r"r�s\
�
��


�
r�)
Zarea�baseZbasefont�br�col�frameZhrZimg�inputZisindex�link�metaZparamcKs�|j}|j}|tkr(|dt|���n�|tkrD|dt|���nh||}|dkr�|rd|t|��|D]}t|||d�qh�n,|d|�t|���}|s�|�r8|r�t|��dd�d�D](\}	}
|
r�d|
}
|d|
t	|	�f�q�|D]N\}
}	t
|
t��r|
j}
t
|	t��r||	j}	nt|	�}	|d	||
|	f�q�|d
�|�
�}|�rx|dk�sb|dk�rl||�n|t|��|D]}t|||d��q||tk�r�|d
|d
�|j�r�|t|j��dS)Nr�r�r�cSs|dSr�r!r�r!r!r"r��r�z!_serialize_html.<locals>.<lambda>r�r�r�r�r�ZscriptZstyler�)r#r3rr�r�_serialize_htmlrirer�r�r&r
�_escape_attrib_htmlr��
HTML_EMPTYr4)r�r5r�rYr�r#r3rRrer�r�Zltagr!r!r"r��sX
��


r�cCs*|��D]}||�q|jr&||j�dSr7)rmr4)r�r5�partr!r!r"r��s
r�)r��htmlr3cCsLt�d|�rtd��tt���D]\}}||ks8||kr t|=q |t|<dS)atRegister a namespace prefix.

    The registry is global, and any existing mapping for either the
    given prefix or the namespace URI will be removed.

    *prefix* is the namespace prefix, *uri* is a namespace uri. Tags and
    attributes in this namespace will be serialized with prefix if possible.

    ValueError is raised if prefix is reserved or is invalid.

    zns\d+$z'Prefix format reserved for internal useN)�re�matchr�rir�re)r�r�r�r�r!r!r"r�sr�r�ZrdfZwsdlZxsZxsiZdc)�$http://www.w3.org/XML/1998/namespacezhttp://www.w3.org/1999/xhtmlz+http://www.w3.org/1999/02/22-rdf-syntax-ns#z http://schemas.xmlsoap.org/wsdl/z http://www.w3.org/2001/XMLSchemaz)http://www.w3.org/2001/XMLSchema-instancez http://purl.org/dc/elements/1.1/cCstd|t|�jf��dS)Nzcannot serialize %r (type %s))r(rQrrrr!r!r"r�s�r�c	CshzBd|kr|�dd�}d|kr*|�dd�}d|kr>|�dd�}|WSttfk
rbt|�YnXdS)N�&�&amp;r��&lt;r��&gt;��replacer(r�r�rrr!r!r"r�!sr�c	Cs�z�d|kr|�dd�}d|kr*|�dd�}d|kr>|�dd�}d|krR|�dd�}d	|krf|�d	d
�}d|krz|�dd
�}d
|kr�|�d
d�}d
|kr�|�d
d�}|WSttfk
r�t|�YnXdS)Nr�r�r�r�r�r��"�&quot;z
r��
z&#10;�	z&#09;r�rrr!r!r"r�1s(r�c	CshzBd|kr|�dd�}d|kr*|�dd�}d|kr>|�dd�}|WSttfk
rbt|�YnXdS)Nr�r�r�r�r�r�r�rrr!r!r"r�Msr�T)r�r�r�cCs:|dkrt��nt��}t|�j||||||d�|��S)a
Generate string representation of XML element.

    All subelements are included.  If encoding is "unicode", a string
    is returned. Otherwise a bytestring is returned.

    *element* is an Element instance, *encoding* is an optional output
    encoding defaulting to US-ASCII, *method* is an optional output which can
    be one of "xml" (default), "html", "text" or "c14n", *default_namespace*
    sets the default XML namespace (for "xmlns").

    Returns an (optionally) encoded string containing the XML data.

    r��r�r�r�r�)r��StringIO�BytesIOrr��getvalue)r%r�r�r�r�r��streamr!r!r"r\s�c@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�_ListDataStreamz7An auxiliary stream accumulating into a list reference.cCs
||_dSr7)�lst)r,r�r!r!r"r.vsz_ListDataStream.__init__cCsdSr�r!r0r!r!r"r�ysz_ListDataStream.writablecCsdSr�r!r0r!r!r"r�|sz_ListDataStream.seekablecCs|j�|�dSr7)r�rJ)r,�br!r!r"r�sz_ListDataStream.writecCs
t|j�Sr7)r8r�r0r!r!r"r��sz_ListDataStream.tellN)	rrrr r.r�r�r�r�r!r!r!r"r�tsr�cCs*g}t|�}t|�j||||||d�|S)Nr�)r�rr�)r%r�r�r�r�r�r�r�r!r!r"r�s�cCsLt|t�st|�}|jtjdd�|��j}|r<|ddkrHtj�d�dS)a#Write element tree or element structure to sys.stdout.

    This function should be used for debugging only.

    *elem* is either an ElementTree, or a single Element.  The exact output
    format is implementation dependent.  In this version, it's written as an
    ordinary XML file.

    r�)r����r�N)r&rr��sys�stdoutr�r4)r5r4r!r!r"r�s

cCst�}|�||�|S)z�Parse XML document into element tree.

    *source* is a filename or file object containing XML data,
    *parser* is an optional parser instance defaulting to XMLParser.

    Return an ElementTree instance.

    )rr	)r�r��treer!r!r"r	�s	csft||d������fdd��G�fdd�dtjj�}|��d�_�~d�t�d�sbt�d	��d
��S)aJIncrementally parse XML document into ElementTree.

    This class also reports what's going on to the user based on the
    *events* it is initialized with.  The supported events are the strings
    "start", "end", "start-ns" and "end-ns" (the "ns" events are used to get
    detailed namespace information).  If *events* is omitted, only
    "end" events are reported.

    *source* is a filename or file object containing XML data, *events* is
    a list of events to report back, *parser* is an optional parser instance.

    Returns an iterator providing (event, elem) pairs.

    )�events�_parserc3s^zJ���EdH��d�}|s q,��|�q���}���EdH|�_W5�rX���XdS)Ni@)r��read_eventsr�r��_close_and_return_root�root)r�r)r��it�
pullparserr�r!r"�iterator�s

ziterparse.<locals>.iteratorcseZdZ��jZdS)z$iterparse.<locals>.IterParseIteratorN)rrr�__next__r!)rr!r"�IterParseIterator�srNFr�r�T)r�collections�abc�Iteratorrr$r�)r�r�r�rr!)r�rrrr�r"r�s

c@s<eZdZd
dd�dd�Zdd�Zdd�Zd	d
�Zdd�ZdS)rN)rcCs<t��|_|ptt�d�|_|dkr(d}|j�|j|�dS)N�rq)�end)r	�deque�
_events_queuerrr�
_setevents)r,r�rr!r!r"r.�s

zXMLPullParser.__init__c
CsZ|jdkrtd��|rVz|j�|�Wn.tk
rT}z|j�|�W5d}~XYnXdS)�Feed encoded data to parser.Nz!feed() called after end of stream)rr�r��SyntaxErrorrrJ)r,r��excr!r!r"r��s
zXMLPullParser.feedcCs|j��}d|_|Sr7)rr�)r,rr!r!r"r�s
z$XMLPullParser._close_and_return_rootcCs|��dS)z�Finish feeding data to parser.

        Unlike XMLParser, does not return the root element. Use
        read_events() to consume elements from XMLPullParser.
        N)rr0r!r!r"r�szXMLPullParser.closeccs.|j}|r*|��}t|t�r"|�q|VqdS)z�Return an iterator over currently available (event, elem) pairs.

        Events are consumed from the internal event queue as they are
        retrieved from the iterator.
        N)r�popleftr&�	Exception)r,r��eventr!r!r"rs
zXMLPullParser.read_events)N)rrrr.r�rr�rr!r!r!r"r�s

cCs"|stt�d�}|�|�|��S)aParse XML document from string constant.

    This function can be used to embed "XML Literals" in Python code.

    *text* is a string containing XML data, *parser* is an
    optional parser instance, defaulting to the standard XMLParser.

    Returns an Element instance.

    r�rrr�r�)r3r�r!r!r"rs
cCsR|stt�d�}|�|�|��}i}|��D]}|�d�}|r.|||<q.||fS)aParse XML document from string constant for its IDs.

    *text* is a string containing XML data, *parser* is an
    optional parser instance, defaulting to the standard XMLParser.

    Returns an (Element, dict) tuple, in which the
    dict maps element id:s to elements.

    rr/)rrr�r�rgr`)r3r�r�Zidsr5r/r!r!r"r,s



cCs,|stt�d�}|D]}|�|�q|��S)z�Parse XML document from sequence of string fragments.

    *sequence* is a list of other sequence, *parser* is an optional parser
    instance, defaulting to the standard XMLParser.

    Returns an Element instance.

    rr)Zsequencer�r3r!r!r"rDs
	c@sheZdZdZdddddd�dd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
ddd�Zdd�ZdS)ra8Generic element structure builder.

    This builder converts a sequence of start, data, and end method
    calls to a well-formed element structure.

    You can use this class to build an element structure using a custom XML
    parser, or a parser for some other XML-like format.

    *element_factory* is an optional element factory which is called
    to create new Element instances, as necessary.

    *comment_factory* is a factory to create comments to be used instead of
    the standard factory.  If *insert_comments* is false (the default),
    comments will not be inserted into the tree.

    *pi_factory* is a factory to create processing instructions to be used
    instead of the standard factory.  If *insert_pis* is false (the default),
    processing instructions will not be inserted into the tree.
    NF)�comment_factory�
pi_factory�insert_comments�
insert_piscCsdg|_g|_d|_d|_d|_|dkr*t}||_||_|dkrBt}||_	||_
|dkrZt}||_dSr7)
�_data�_elem�_lastr~�_tailr�_comment_factoryrr�_pi_factoryrr�_factory)r,Zelement_factoryrrrrr!r!r"r.js zTreeBuilder.__init__cCs.t|j�dkstd��|jdk	s(td��|jS)z;Flush builder buffers and return toplevel document Element.rzmissing end tagsNzmissing toplevel element)r8r�AssertionErrorr~r0r!r!r"r�~szTreeBuilder.closecCsf|jrb|jdk	r\d�|j�}|jr@|jjdks6td��||j_n|jjdksTtd��||j_g|_dS)Nr�zinternal error (tail)zinternal error (text))rr�joinrr4r#r3�r,r3r!r!r"�_flush�s

zTreeBuilder._flushcCs|j�|�dS)zAdd text to current element.N)rrJ�r,r�r!r!r"r��szTreeBuilder.datacCsX|��|�||�|_}|jr2|jd�|�n|jdkrB||_|j�|�d|_|S)z�Open new element and return it.

        *tag* is the element name, *attrs* is a dict containing element
        attributes.

        r�Nr)r&r"rrrJr~r)r,r#�attrsr5r!r!r"�start�s
zTreeBuilder.startcCs@|��|j��|_|jj|ks4td|jj|f��d|_|jS)zOClose and return current Element.

        *tag* is the element name.

        z&end tag mismatch (expected %s, got %s)r)r&r�poprr#r#rrjr!r!r"r
�s��zTreeBuilder.endcCs|�|j|j|�S)z`Create a comment using the comment_factory.

        *text* is the text of the comment.
        )�_handle_singler rr%r!r!r"�comment�s
�zTreeBuilder.commentcCs|�|j|j||�S)z�Create a processing instruction using the pi_factory.

        *target* is the target name of the processing instruction.
        *text* is the data of the processing instruction, or ''.
        )r+r!r)r,rqr3r!r!r"�pi�s�zTreeBuilder.picGs:||�}|r6|��||_|jr0|jd�|�d|_|S)Nr�r)r&rrrJr)r,�factoryrO�argsr5r!r!r"r+�szTreeBuilder._handle_single)N)N)
rrrr r.r�r&r�r)r
r,r-r+r!r!r!r"rVs�
	c@speZdZdZddd�dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)raaElement structure builder for XML source data based on the expat parser.

    *target* is an optional target object which defaults to an instance of the
    standard TreeBuilder class, *encoding* is an optional encoding string
    which if given, overrides the encoding specified in the XML file:
    http://www.iana.org/assignments/character-sets

    N)rqr�cCsdzddlm}Wn>tk
rNzddl}Wntk
rHtd��YnXYnX|�|d�}|dkrjt�}||_|_||_|_	|j
|_i|_|j
|_t|d�r�|j|_t|d�r�|j|_t|d�r�|j|_t|d�r�|j|_t|d	�r�|j|_t|d
��r|j|_t|d��r|j|_d|_d|_d|_ d|_!i|_"zd
|j#|_$Wnt%k
�r^YnXdS)Nr��expatz7No module named expat; use SimpleXMLTreeBuilder insteadr�r)r
�start_ns�end_nsr�r,r-rzExpat %d.%d.%d)&�xml.parsersr1�ImportErrorZpyexpatZParserCreaterr�rrq�_target�error�_error�_names�_defaultZDefaultHandlerExpandr$�_start�StartElementHandler�_end�EndElementHandler�	_start_ns�StartNamespaceDeclHandler�_end_ns�EndNamespaceDeclHandlerr�ZCharacterDataHandlerr,�CommentHandlerr-�ProcessingInstructionHandlerZbuffer_text�ordered_attributes�specified_attributes�_doctype�entity�version_info�versionr�)r,rqr�r1r�r!r!r"r.�sP�




zXMLParser.__init__cCs8|j}|j}|D�] }|dkrDd|_d|_|||jfdd�}||_q|dkrf|||jfdd�}||_q|dkr�t|j	d�r�|||j
fd	d�}n||fd
d�}||_q|dkr�t|j	d�r�|||jfd
d�}n||fdd�}||_
q|dk�r|||fdd�}||_q|dk�r&|||fdd�}||_qtd|��qdS)Nr)rcSs|||||�f�dSr7r!)r#Z	attrib_inrrJr)r!r!r"�handlersz%XMLParser._setevents.<locals>.handlerr
cSs||||�f�dSr7r!)r#rrJr
r!r!r"rKszstart-nsr2cSs|||||�f�dSr7r!)r�r�rrJr2r!r!r"rK!scSs|||p
d|pdff�dS�Nr�r!)r�r�rrJr!r!r"rK%szend-nsr3cSs||||�f�dSr7r!)r�rrJr3r!r!r"rK+scSs||df�dSr7r!)r�rrJr!r!r"rK/sr,cSs|||j�|�f�dSr7)rqr,)r3rrJr,r!r!r"rK3sr-cSs|||j�||�f�dSr7)rqr-)Z	pi_targetr�rrJr,r!r!r"rK7szunknown event %r)rrJrErFr;r<r=r>r$rqr?r@rArBrCrDr�)r,Zevents_queueZevents_to_reportr�rJZ
event_namerKr!r!r"rsL
�
�
��

�
zXMLParser._seteventscCs&t|�}|j|_|j|jf|_|�dSr7)r
�code�lineno�offsetZposition)r,rb�errr!r!r"�_raiseerror>szXMLParser._raiseerrorcCsFz|j|}Wn2tk
r@|}d|kr2d|}||j|<YnX|S)Nr�r�)r9�KeyError)r,ra�namer!r!r"�_fixnameDszXMLParser._fixnamecCs|j�|pd|pd�SrL)rqr2�r,r�r�r!r!r"r?OszXMLParser._start_nscCs|j�|pd�SrL)rqr3)r,r�r!r!r"rARszXMLParser._end_nscCsR|j}||�}i}|rDtdt|�d�D]}||d||||�<q&|j�||�S)Nrr:r)rT�ranger8rqr))r,r#�	attr_listZfixnamer*�ir!r!r"r;UszXMLParser._startcCs|j�|�|��Sr7)rqr
rTrjr!r!r"r=aszXMLParser._endc	Cs�|dd�}|dkr�z|jj}Wntk
r6YdSXz||j|dd��WnZtk
r�ddlm}|�d||jj	|jj
f�}d|_|jj	|_|jj
|_
|�YnX�n"|dkr�|dd	�d
kr�g|_�n|jdk	�r�|dkr�d|_dS|��}|�sdS|j�|�t|j�}|dk�r�|jd}|d
k�rd|dk�rd|j\}}}	}
|	�r�|	dd�}	n*|dk�r�|dk�r�|j\}}}
d}	ndSt|jd��r�|j�||	|
dd��nt|d��r�t�dt�d|_dS)Nrr�r�rr0z'undefined entity %s: line %d, column %d�r��	z	<!DOCTYPEr�r:ZPUBLIC�ZSYSTEM��doctypezaThe doctype() method of XMLParser is ignored.  Define doctype() method on the TreeBuilder target.)rqr�r�rHrRr4r1r7r�ZErrorLineNumberZErrorColumnNumberrMrNrOrG�striprJr8r$r]r=r>�RuntimeWarning)r,r3r�Zdata_handlerr1rP�nrQrSZpubid�systemr!r!r"r:dsd���





�zXMLParser._defaultc
CsFz|j�|d�Wn.|jk
r@}z|�|�W5d}~XYnXdS)rrN)r��Parser8rQ)r,r�r�r!r!r"r��szXMLParser.feedc
Cs�z|j�dd�Wn.|jk
r@}z|�|�W5d}~XYnXz0z|jj}Wntk
rdYnX|�W�SW5|`|`|`|`XdS)z;Finish feeding data to parser and return element structure.r�rN)	r�rbr8rQrrqr6r�r�)r,r�Z
close_handlerr!r!r"r��szXMLParser.close)rrrr r.rrQrTr?rAr;r=r:r�r�r!r!r!r"r�s	.66)�out�	from_filecKs�|dkr|dkrtd��d}|dkr0t��}}tt|jf|�d�}|dk	r`|�|�|��n|dk	rtt||d�|dk	r�|�	�SdS)a3Convert XML to its C14N 2.0 serialised form.

    If *out* is provided, it must be a file or file-like object that receives
    the serialised canonical XML output (text, not bytes) through its ``.write()``
    method.  To write to a file, open it in text mode with encoding "utf-8".
    If *out* is not provided, this function returns the output as text string.

    Either *xml_data* (an XML string) or *from_file* (a file path or
    file-like object) must be provided as input.

    The configuration options are the same as for the ``C14NWriterTarget``.
    Nz:Either 'xml_data' or 'from_file' must be provided as inputr)r�)
r�r�r�rrr�r�r�r	r�)Zxml_datarcrdZoptionsZsior�r!r!r"r�s


z	^\w+:\w+$c@s�eZdZdZdddddddd�dd�Zefdd�Zd	d
�Zddd�Zd
d�Z	dj
fdd�Zdd�Zdd�Z
ddd�Zdd�Zdd�Zdd�ZdS) ra�
    Canonicalization writer target for the XMLParser.

    Serialises parse events to XML C14N 2.0.

    The *write* function is used for writing out the resulting data stream
    as text (not bytes).  To write to a file, open it in text mode with encoding
    "utf-8" and pass its ``.write`` method.

    Configuration options:

    - *with_comments*: set to true to include comments
    - *strip_text*: set to true to strip whitespace before and after text content
    - *rewrite_prefixes*: set to true to replace namespace prefixes by "n{number}"
    - *qname_aware_tags*: a set of qname aware tag names in which prefixes
                          should be replaced in text content
    - *qname_aware_attrs*: a set of qname aware attribute names in which prefixes
                           should be replaced in text content
    - *exclude_attrs*: a set of attribute names that should not be serialised
    - *exclude_tags*: a set of tag names that should not be serialised
    FN)�
with_comments�
strip_text�rewrite_prefixes�qname_aware_tags�qname_aware_attrs�
exclude_attrs�exclude_tagsc	Cs�||_g|_||_||_|r$t|�nd|_|r6t|�nd|_||_|rRt|�|_nd|_|rjt|�j	|_
nd|_
dgg|_g|_|s�|j�
tt����|j�
g�i|_dg|_d|_d|_d|_d|_dS)N)r�r�Fr)�_writer�_with_comments�_strip_textrc�_exclude_attrs�
_exclude_tags�_rewrite_prefixes�_qname_aware_tags�intersection�_find_qname_aware_attrs�_declared_ns_stack�	_ns_stackrJrir�re�_prefix_map�_preserve_space�_pending_start�
_root_seen�
_root_done�_ignored_depth)	r,r�rerfrgrhrirjrkr!r!r"r.�s2�zC14NWriterTarget.__init__ccs ||�D]}|r|EdHqdSr7r!)r,Zns_stackZ	_reversedrYr!r!r"�_iter_namespacessz!C14NWriterTarget._iter_namespacescCs\|�dd�\}}|�|j�D]$\}}||krd|�d|��Sqtd|�d|�d���dS)Nr�rr�r�zPrefix z of QName "�" is not declared in scope)�splitr}rvr�)r,Z
prefixed_namer�rSr��pr!r!r"�_resolve_prefix_names
z%C14NWriterTarget._resolve_prefix_namecCs�|dkr:|dd�dkr,|dd��dd�nd|f\}}n|}t�}|�|j�D]B\}}||kr�||kr�|rz|�d|��n|||fS|�|�qP|jr�||jkr�|j|}ndt|j���}|j|<|jd�||f�|�d|��||fS|�sd|k�r|||fS|�|j	�D]J\}}||k�r|jd�||f�|�rR|�d|��n|||fS�q|�st|||fSt
d|�d	���dS)
Nrr�r�r�r�r`r�zNamespace "r~)r�rcr}ru�addrqrwr8rJrvr�)r,r�r�r#Z
prefixes_seen�ur�r!r!r"�_qnames.2 


&
zC14NWriterTarget._qnamecCs|js|j�|�dSr7)r|rrJr'r!r!r"r�CszC14NWriterTarget.datar�cCs�||j�}|jdd�=|jr.|jds.|��}|jdk	rv|jd}|_|rVt|�rV|nd}|j||f��|dk	rvdS|r�|jr�|�t	|��dS�Nr�)
rrnrxr^ry�_looks_like_prefix_namer;rzrl�_escape_cdata_c14n)r,Z
_join_textr�r/�
qname_textr!r!r"r&Gs


zC14NWriterTarget._flushcCs0|jr
dS|jr|��|jd�||f�dSr�)r|rr&rvrJrUr!r!r"r2Us
zC14NWriterTarget.start_nscCs�|jdk	r,|js||jkr,|jd7_dS|jr:|��g}|j�|�|jdk	rn||jkrn|||f|_dS|�|||�dSr�)	rpr|rr&rurJrrryr;)r,r#r(�new_namespacesr!r!r"r)]s
��zC14NWriterTarget.startcs�jdk	r$|r$�fdd�|��D�}|h|�}i}|dk	rV��|�}||<|�|��jdk	r�|r���|�}|r�|D]0}	||	}
t|
�rv��|
�}||
<|�|�qvq�d}nd}�j��fdd�t|dd�d�D�}|r�dd�|D�}|��ng}|�rjt|���D]^\}
}|dk	�r@|
|k�r@||k�r@|||d	}||
\}}	}|�	|�r\|n|	|f��q
|�
d
�}�j�	|�r�|dkn�jd��j}|d
||d	�|�r�|d�
dd�|D���|d�|dk	�r�|t|||d	��d�_�j�	g�dS)Ncs i|]\}}|�jkr||�qSr!)ro��.0r�r�r0r!r"�
<dictcomp>ps
z+C14NWriterTarget._start.<locals>.<dictcomp>csi|]}|�|��qSr!r!)r�r`)�parse_qnamer!r"r��scSs|�dd�S)Nr�r)r)r`r!r!r"r��r�z)C14NWriterTarget._start.<locals>.<lambda>r�cSs$g|]\}}|rd|nd|f�qS)zxmlns:Zxmlnsr!)r�r�r�r!r!r"�
<listcomp>�s�z+C14NWriterTarget._start.<locals>.<listcomp>rz+{http://www.w3.org/XML/1998/namespace}spaceZpreserver�r�r�cSs&g|]\}}d|�dt|��d��qS)rpz="r�)�_escape_attrib_c14nr�r!r!r"r��sr�T)rorer�r�rtr�r�r��sortrJr`rxrlr$r�rzrv)r,r#r(r�r�r�Zresolved_namesr�ZqattrsZ	attr_namerbZ
parsed_qnamesrWr�r�Z
attr_qnamer�Zspace_behaviourr�r!)r�r,r"r;ns`


�
�

�
zC14NWriterTarget._startcCst|jr|jd8_dS|jr&|��|�d|�|�d�d��|j��t|j�dk|_|j	��|j
��dS)Nrr�rr�)r|rr&rlr�rxr*r8r{rurvrjr!r!r"r
�s

zC14NWriterTarget.endcCsd|js
dS|jrdS|jr&|�d�n|jr:|jr:|��|�dt|��d��|js`|�d�dS)Nr�z<!--z-->)rmr|r{rlrzrr&r�r%r!r!r"r,�szC14NWriterTarget.commentcCsp|jr
dS|jr|�d�n|jr0|jr0|��|�|rNd|�dt|��d�n
d|�d��|jsl|�d�dS)Nr�z<?rpz?>)r|r{rlrzrr&r�)r,rqr�r!r!r"r-�s$�zC14NWriterTarget.pi)N)N)rrrr r.�reversedr}r�r�r�r$r&r2r)r;r
r,r-r!r!r!r"r�s(�%
%
E
c	Cs|zVd|kr|�dd�}d|kr*|�dd�}d|kr>|�dd�}d|krR|�dd�}|WSttfk
rvt|�YnXdS)	Nr�r�r�r�r�r�r��&#xD;r�rrr!r!r"r��sr�c	Cs�z~d|kr|�dd�}d|kr*|�dd�}d|kr>|�dd�}d|krR|�dd�}d	|krf|�d	d
�}d|krz|�dd�}|WSttfk
r�t|�YnXdS)
Nr�r�r�r�r�r�r�z&#x9;r�z&#xA;r�r�r�rrr!r!r"r��s r�)rf)�_set_factories)N)N)N)NN)NN)N)NN)N)N)N)N)@r �__all__rr�r�r=r�r	Zcollections.abcr�r�rrr
rrrrrrr
r�contextmanagerr�r�r�r�rc�	NameErrorr�r�r�rr�r�r�r�r�rr�r�rrr	rrrrrrrrr�compile�UNICODEr�r�rr�r�rPZ_elementtreer�r5r!r!r!r"�<module>s�J�>

0s
3
=22�	�
��


05


zgxml/etree/__pycache__/ElementTree.cpython-38.opt-1.pyc000064400000154016151153537540016500 0ustar00U

e5d��@s�dZddddddddd	d
ddd
ddddddddddddgZdZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZGdd
�d
e�Z
d d�ZGd!d�d�Zifd"d�Zd]d#d�Zd^d$d�ZeZGd%d
�d
�ZGd&d�d�Ze	jd'd(��Zd_d)d*�Zd+d,�Zd-Zzee�ZWnek
�r.YnXd.d/�Zd0d1�Zeeed2�Zd3d�Z d4d5d6d7d8d9d:d;�Z!e!e _!d<d=�Z"d>d?�Z#d@dA�Z$dBdC�Z%d`dddDdE�dFd�Z&GdGdH�dHej'�Z(dadddDdE�dId�Z)dJd�Z*dbdKd	�Z+dcdLd�Z,GdMd�d�Z-dddNd�Z.dedOd�Z/e.Z0dfdPd�Z1GdQd�d�Z2GdRd�d�Z3dgdddS�dTd�Z4e�5dUej6�j7Z8GdVd�d�Z9dWdX�Z:dYdZ�Z;zeZ<dd[l=Tdd\l=m>Z>Wne?k
�r�YnXe>ee�dS)haLightweight XML support for Python.

 XML is an inherently hierarchical data format, and the most natural way to
 represent it is with a tree.  This module has two classes for this purpose:

    1. ElementTree represents the whole XML document as a tree and

    2. Element represents a single node in this tree.

 Interactions with the whole document (reading and writing to/from files) are
 usually done on the ElementTree level.  Interactions with a single XML element
 and its sub-elements are done on the Element level.

 Element is a flexible container object designed to store hierarchical data
 structures in memory. It can be described as a cross between a list and a
 dictionary.  Each Element has a number of properties associated with it:

    'tag' - a string containing the element's name.

    'attributes' - a Python dictionary storing the element's attributes.

    'text' - a string containing the element's text content.

    'tail' - an optional string containing text after the element's end tag.

    And a number of child elements stored in a Python sequence.

 To create an element instance, use the Element constructor,
 or the SubElement factory function.

 You can also use the ElementTree class to wrap an element structure
 and convert it to and from XML.

�Comment�dump�Element�ElementTree�
fromstring�fromstringlist�	iselement�	iterparse�parse�
ParseError�PI�ProcessingInstruction�QName�
SubElement�tostring�tostringlist�TreeBuilder�VERSION�XML�XMLID�	XMLParser�
XMLPullParser�register_namespace�canonicalize�C14NWriterTargetz1.3.0�N�)�ElementPathc@seZdZdZdS)r
z�An error when parsing an XML document.

    In addition to its exception value, a ParseError contains
    two extra attributes:
        'code'     - the specific exception code
        'position' - the line and column of the error

    N)�__name__�
__module__�__qualname__�__doc__�r!r!�-/usr/lib64/python3.8/xml/etree/ElementTree.pyr
jscCs
t|d�S)z2Return True if *element* appears to be an Element.�tag)�hasattr)�elementr!r!r"rxsc@s
eZdZdZdZdZdZdZifdd�Zdd�Z	dd�Z
d	d
�Zdd�Zd
d�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd9d!d"�Zd:d#d$�Zd;d%d&�Zd<d'd(�Zd)d*�Zd=d+d,�Zd-d.�Zd/d0�Zd1d2�Zd>d3d4�Z d?d5d6�Z!d7d8�Z"dS)@rahAn XML element.

    This class is the reference implementation of the Element interface.

    An element's length is its number of subelements.  That means if you
    want to check if an element is truly empty, you should check BOTH
    its length AND its text attribute.

    The element tag, attribute names, and attribute values can be either
    bytes or strings.

    *tag* is the element name.  *attrib* is an optional dictionary containing
    element attributes. *extra* are additional element attributes given as
    keyword arguments.

    Example form:
        <tag attrib>text<child/>...</tag>tail

    NcKs6t|t�std|jjf��||_||�|_g|_dS)Nzattrib must be dict, not %s)�
isinstance�dict�	TypeError�	__class__rr#�attrib�	_children)�selfr#r*�extrar!r!r"�__init__�s
�
zElement.__init__cCsd|jj|jt|�fS)Nz<%s %r at %#x>)r)rr#�id�r,r!r!r"�__repr__�szElement.__repr__cCs|�||�S)z�Create a new element with the same type.

        *tag* is a string containing the element name.
        *attrib* is a dictionary containing the element attributes.

        Do not call this method, use the SubElement factory function instead.

        )r))r,r#r*r!r!r"�makeelement�s	zElement.makeelementcCs0|�|j|j�}|j|_|j|_||dd�<|S)z�Return copy of current element.

        This creates a shallow copy. Subelements will be shared with the
        original tree.

        N)r2r#r*�text�tail)r,�elemr!r!r"�copy�s
zElement.copycCs
t|j�S�N)�lenr+r0r!r!r"�__len__�szElement.__len__cCstjdtdd�t|j�dkS)NzyThe behavior of this method will change in future versions.  Use specific 'len(elem)' or 'elem is not None' test instead.���
stacklevelr)�warnings�warn�
FutureWarningr8r+r0r!r!r"�__bool__�s�zElement.__bool__cCs
|j|Sr7�r+�r,�indexr!r!r"�__getitem__�szElement.__getitem__cCs8t|t�r |D]}|�|�qn
|�|�||j|<dSr7)r&�slice�_assert_is_elementr+)r,rCr%Zeltr!r!r"�__setitem__�s


zElement.__setitem__cCs|j|=dSr7rArBr!r!r"�__delitem__�szElement.__delitem__cCs|�|�|j�|�dS)aAdd *subelement* to the end of this element.

        The new element will appear in document order after the last existing
        subelement (or directly after the text, if it's the first subelement),
        but before the end tag for this element.

        N�rFr+�append�r,�
subelementr!r!r"rJ�s
zElement.appendcCs$|D]}|�|�|j�|�qdS)zkAppend subelements from a sequence.

        *elements* is a sequence with zero or more elements.

        NrI)r,�elementsr%r!r!r"�extend�s
zElement.extendcCs|�|�|j�||�dS)z(Insert *subelement* at position *index*.N)rFr+�insert)r,rCrLr!r!r"rO�s
zElement.insertcCs t|t�stdt|�j��dS)Nzexpected an Element, not %s)r&�_Element_Pyr(�typer)r,�er!r!r"rF�s
zElement._assert_is_elementcCs|j�|�dS)a�Remove matching subelement.

        Unlike the find methods, this method compares elements based on
        identity, NOT ON tag value or contents.  To remove subelements by
        other means, the easiest way is to use a list comprehension to
        select what elements to keep, and then use slice assignment to update
        the parent element.

        ValueError is raised if a matching element could not be found.

        N)r+�removerKr!r!r"rSs
zElement.removecCstjdtdd�|jS)z`(Deprecated) Return all subelements.

        Elements are returned in document order.

        zaThis method will be removed in future versions.  Use 'list(elem)' or iteration over elem instead.r:r;)r=r>�DeprecationWarningr+r0r!r!r"�getchildrens�zElement.getchildrencCst�|||�S)aFind first matching element by tag name or path.

        *path* is a string having either an element tag or an XPath,
        *namespaces* is an optional mapping from namespace prefix to full name.

        Return the first matching element, or None if no element was found.

        )r�find�r,�path�
namespacesr!r!r"rV!s	zElement.findcCst�||||�S)a�Find text for first matching element by tag name or path.

        *path* is a string having either an element tag or an XPath,
        *default* is the value to return if the element was not found,
        *namespaces* is an optional mapping from namespace prefix to full name.

        Return text content of first matching element, or default value if
        none was found.  Note that if an element is found having no text
        content, the empty string is returned.

        )r�findtext�r,rX�defaultrYr!r!r"rZ,szElement.findtextcCst�|||�S)aFind all matching subelements by tag name or path.

        *path* is a string having either an element tag or an XPath,
        *namespaces* is an optional mapping from namespace prefix to full name.

        Returns list containing all matching elements in document order.

        )r�findallrWr!r!r"r]:s	zElement.findallcCst�|||�S)a Find all matching subelements by tag name or path.

        *path* is a string having either an element tag or an XPath,
        *namespaces* is an optional mapping from namespace prefix to full name.

        Return an iterable yielding all matching elements in document order.

        )r�iterfindrWr!r!r"r^Es	zElement.iterfindcCs |j��g|_d|_|_dS)z�Reset element.

        This function removes all subelements, clears all attributes, and sets
        the text and tail attributes to None.

        N)r*�clearr+r3r4r0r!r!r"r_Ps
z
Element.clearcCs|j�||�S)agGet element attribute.

        Equivalent to attrib.get, but some implementations may handle this a
        bit more efficiently.  *key* is what attribute to look for, and
        *default* is what to return if the attribute was not found.

        Returns a string containing the attribute value, or the default if
        attribute was not found.

        )r*�get)r,�keyr\r!r!r"r`[szElement.getcCs||j|<dS)z�Set element attribute.

        Equivalent to attrib[key] = value, but some implementations may handle
        this a bit more efficiently.  *key* is what attribute to set, and
        *value* is the attribute value to set it to.

        N)r*)r,ra�valuer!r!r"�sethszElement.setcCs
|j��S)z�Get list of attribute names.

        Names are returned in an arbitrary order, just like an ordinary
        Python dict.  Equivalent to attrib.keys()

        )r*�keysr0r!r!r"rdrszElement.keyscCs
|j��S)z�Get element attributes as a sequence.

        The attributes are returned in arbitrary order.  Equivalent to
        attrib.items().

        Return a list of (name, value) tuples.

        )r*�itemsr0r!r!r"re{s	z
Element.itemsccsD|dkrd}|dks|j|kr$|V|jD]}|�|�EdHq*dS)aCreate tree iterator.

        The iterator loops over the element and all subelements in document
        order, returning all elements with a matching tag.

        If the tree structure is modified during iteration, new or removed
        elements may or may not be included.  To get a stable set, use the
        list() function on the iterator, and loop over the resulting list.

        *tag* is what tags to look for (default is to return all elements)

        Return an iterator containing all the matching elements.

        �*N)r#r+�iter)r,r#rRr!r!r"rg�s
zElement.itercCstjdtdd�t|�|��S)NzbThis method will be removed in future versions.  Use 'elem.iter()' or 'list(elem.iter())' instead.r:r;�r=r>rT�listrg�r,r#r!r!r"�getiterator�s�zElement.getiteratorccsX|j}t|t�s|dk	rdS|j}|r,|V|D]"}|��EdH|j}|r0|Vq0dS)z�Create text iterator.

        The iterator loops over the element and all subelements in document
        order, returning all inner text.

        N)r#r&�strr3�itertextr4)r,r#�trRr!r!r"rm�szElement.itertext)N)NN)N)N)N)N)N)#rrrr r#r*r3r4r.r1r2r6r9r@rDrGrHrJrNrOrFrSrUrVrZr]r^r_r`rcrdrergrkrmr!r!r!r"r}s@	








	

cKs"||�}|�||�}|�|�|S)a�Subelement factory which creates an element instance, and appends it
    to an existing parent.

    The element tag, attribute names, and attribute values can be either
    bytes or Unicode strings.

    *parent* is the parent element, *tag* is the subelements name, *attrib* is
    an optional directory containing element attributes, *extra* are
    additional attributes given as keyword arguments.

    )r2rJ)�parentr#r*r-r%r!r!r"r�s
cCstt�}||_|S)z�Comment element factory.

    This function creates a special element which the standard serializer
    serializes as an XML comment.

    *text* is a string containing the comment string.

    )rrr3)r3r%r!r!r"r�s	cCs&tt�}||_|r"|jd||_|S)a*Processing Instruction element factory.

    This function creates a special element which the standard serializer
    serializes as an XML comment.

    *target* is a string containing the processing instruction, *text* is a
    string containing the processing instruction contents, if any.

    � )rrr3)�targetr3r%r!r!r"r�s

c@sZeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)r
a�Qualified name wrapper.

    This class can be used to wrap a QName attribute value in order to get
    proper namespace handing on output.

    *text_or_uri* is a string containing the QName value either in the form
    {uri}local, or if the tag argument is given, the URI part of a QName.

    *tag* is an optional argument which if given, will make the first
    argument (text_or_uri) be interpreted as a URI, and this argument (tag)
    be interpreted as a local name.

    NcCs|rd||f}||_dS)Nz{%s}%s�r3)r,Ztext_or_urir#r!r!r"r.�szQName.__init__cCs|jSr7rrr0r!r!r"�__str__�sz
QName.__str__cCsd|jj|jfS)Nz<%s %r>)r)rr3r0r!r!r"r1szQName.__repr__cCs
t|j�Sr7)�hashr3r0r!r!r"�__hash__szQName.__hash__cCs t|t�r|j|jkS|j|kSr7�r&r
r3�r,�otherr!r!r"�__le__s
zQName.__le__cCs t|t�r|j|jkS|j|kSr7rvrwr!r!r"�__lt__s
zQName.__lt__cCs t|t�r|j|jkS|j|kSr7rvrwr!r!r"�__ge__s
zQName.__ge__cCs t|t�r|j|jkS|j|kSr7rvrwr!r!r"�__gt__s
zQName.__gt__cCs t|t�r|j|jkS|j|kSr7rvrwr!r!r"�__eq__s
zQName.__eq__)N)
rrrr r.rsr1ruryrzr{r|r}r!r!r!r"r
�s
c@s�eZdZdZddd�Zdd�Zdd�Zdd	d
�Zddd�Zd d
d�Z	d!dd�Z
d"dd�Zd#dd�Zd$dd�Z
d%dd�dd�Zdd�ZdS)&ra%An XML element hierarchy.

    This class also provides support for serialization to and from
    standard XML.

    *element* is an optional root element node,
    *file* is an optional file handle or file name of an XML file whose
    contents will be used to initialize the tree with.

    NcCs||_|r|�|�dSr7)�_rootr	)r,r%�filer!r!r"r.'szElementTree.__init__cCs|jS)z!Return root element of this tree.�r~r0r!r!r"�getroot-szElementTree.getrootcCs
||_dS)z�Replace root element of this tree.

        This will discard the current contents of the tree and replace it
        with the given element.  Use with care!

        Nr�)r,r%r!r!r"�_setroot1szElementTree._setrootcCs�d}t|d�st|d�}d}z^|dkrLt�}t|d�rL|�|�|_|jW�2S|�d�}|s\qh|�|�qL|��|_|jW�S|r�|��XdS)a=Load external XML document into element tree.

        *source* is a file name or file object, *parser* is an optional parser
        instance that defaults to XMLParser.

        ParseError is raised if the parser fails to parse the document.

        Returns the root element of the given source document.

        F�read�rbTN�_parse_wholei)r$�open�closerr�r~r��feed)r,�source�parser�close_source�datar!r!r"r	;s$






zElementTree.parsecCs|j�|�S)z�Create and return tree iterator for the root element.

        The iterator loops over all elements in this tree, in document order.

        *tag* is a string with the tag name to iterate over
        (default is to return all elements).

        )r~rgrjr!r!r"rg`s
zElementTree.itercCstjdtdd�t|�|��S)NzbThis method will be removed in future versions.  Use 'tree.iter()' or 'list(tree.iter())' instead.r:r;rhrjr!r!r"rkms�zElementTree.getiteratorcCs:|dd�dkr,d|}tjd|tdd�|j�||�S)a\Find first matching element by tag name or path.

        Same as getroot().find(path), which is Element.find()

        *path* is a string having either an element tag or an XPath,
        *namespaces* is an optional mapping from namespace prefix to full name.

        Return the first matching element, or None if no element was found.

        Nr�/�.��This search is broken in 1.3 and earlier, and will be fixed in a future version.  If you rely on the current behaviour, change it to %rr:r;)r=r>r?r~rVrWr!r!r"rVus��zElementTree.findcCs<|dd�dkr,d|}tjd|tdd�|j�|||�S)aeFind first matching element by tag name or path.

        Same as getroot().findtext(path),  which is Element.findtext()

        *path* is a string having either an element tag or an XPath,
        *namespaces* is an optional mapping from namespace prefix to full name.

        Return the first matching element, or None if no element was found.

        Nrr�r�r�r:r;)r=r>r?r~rZr[r!r!r"rZ�s��zElementTree.findtextcCs:|dd�dkr,d|}tjd|tdd�|j�||�S)aaFind all matching subelements by tag name or path.

        Same as getroot().findall(path), which is Element.findall().

        *path* is a string having either an element tag or an XPath,
        *namespaces* is an optional mapping from namespace prefix to full name.

        Return list containing all matching elements in document order.

        Nrr�r�r�r:r;)r=r>r?r~r]rWr!r!r"r]�s��zElementTree.findallcCs:|dd�dkr,d|}tjd|tdd�|j�||�S)agFind all matching subelements by tag name or path.

        Same as getroot().iterfind(path), which is element.iterfind()

        *path* is a string having either an element tag or an XPath,
        *namespaces* is an optional mapping from namespace prefix to full name.

        Return an iterable yielding all matching elements in document order.

        Nrr�r�r�r:r;)r=r>r?r~r^rWr!r!r"r^�s��zElementTree.iterfindT��short_empty_elementsc	Cs�|s
d}n|tkrtd|��|s4|dkr0d}nd}|��}t||���}|dkr�|sd|dkr�|dkr�|}	|dkr�d	dl}
|
��}	|d
|	f�|dkr�t||j�n,t|j|�\}}t|}
|
||j|||d�W5QRXdS)
a�Write element tree to a file as XML.

        Arguments:
          *file_or_filename* -- file name or a file object opened for writing

          *encoding* -- the output encoding (default: US-ASCII)

          *xml_declaration* -- bool indicating if an XML declaration should be
                               added to the output. If None, an XML declaration
                               is added if encoding IS NOT either of:
                               US-ASCII, UTF-8, or Unicode

          *default_namespace* -- sets the default XML namespace (for "xmlns")

          *method* -- either "xml" (default), "html, "text", or "c14n"

          *short_empty_elements* -- controls the formatting of elements
                                    that contain no content. If True (default)
                                    they are emitted as a single self-closed
                                    tag, otherwise they are emitted as a pair
                                    of start/end tags

        �xmlzunknown method %r�c14n�utf-8�us-asciiN)r�r��unicoder�rz$<?xml version='1.0' encoding='%s'?>
r3r�)	�
_serialize�
ValueError�lower�_get_writer�localeZgetpreferredencoding�_serialize_textr~�_namespaces)r,�file_or_filename�encoding�xml_declaration�default_namespace�methodr�Z	enc_lower�writeZdeclared_encodingr��qnamesrYZ	serializer!r!r"r��s:����zElementTree.writecCs|j|dd�S)Nr�)r�)r�)r,rr!r!r"�
write_c14nszElementTree.write_c14n)NN)N)N)N)N)NN)N)N)NNNN)rrrr r.r�r�r	rgrkrVrZr]r^r�r�r!r!r!r"rs&



%





��:ccs"z
|j}WnPtk
rZ|dkr.t|d�}nt|d|dd�}|�|jVW5QRXYn�X|dkrl|Vn�t����}t|tj�r�|}nft|tj�r�t�	|�}|�
|j�nBt��}dd�|_||_z|j
|_
|j|_Wntk
r�YnXtj||ddd�}|�
|j�|jVW5QRXdS)	Nr��w�xmlcharrefreplace)r��errorscSsdS�NTr!r!r!r!r"�<lambda>0�z_get_writer.<locals>.<lambda>�
)r�r��newline)r��AttributeErrorr��
contextlib�	ExitStackr&�io�BufferedIOBase�	RawIOBase�BufferedWriter�callback�detach�writable�seekable�tell�
TextIOWrapper)r�r�r�r�stackr!r!r"r�sB
�


�r�csddi�i��rd��<���fdd�}|��D]�}|j}t|t�rZ|j�kr�||j�n<t|t�rv|�kr�||�n |dk	r�|tk	r�|tk	r�t|�|�	�D]F\}}t|t�r�|j}|�kr�||�t|t�r�|j�kr�||j�q�|j}t|t�r0|j�kr0||j�q0��fS)N�cs�z�|dd�dkr�|dd��dd�\}}��|�}|dkrjt�|�}|dkrZdt��}|dkrj|�|<|r�d||f�|<q�|�|<n�r�td��|�|<Wntk
r�t|�YnXdS)Nr�{�}zns%dr�z%s:%sz<cannot use non-qualified names with default_namespace option)�rsplitr`�_namespace_mapr8r�r(�_raise_serialization_error)�qname�urir#�prefix�r�rYr�r!r"�	add_qnameMs(


�z_namespaces.<locals>.add_qname)
rgr#r&r
r3rlrrr�re)r5r�r�r#rarbr3r!r�r"r�Bs4




r�cKs�|j}|j}|tkr$|d|��nv|tkr<|d|��n^||}|dkr||r\|t|��|D]}t|||d|d�q`�n|d|�t|���}	|	s�|�r2|r�t|��dd�d�D](\}
}|r�d|}|d	|t	|
�f�q�|	D]L\}}
t
|t�r�|j}t
|
t��r||
j}
nt	|
�}
|d
|||
f�q�|�sHt|��sH|�s�|d�|�rb|t|��|D]}t|||d|d��qf|d|d�n|d
�|j
�r�|t|j
��dS)N�	<!--%s-->�<?%s?>r��<cSs|dS�Nrr!��xr!r!r"r��r�z _serialize_xml.<locals>.<lambda>�ra�:�
 xmlns%s="%s"� %s="%s"�>�</z />)r#r3rr�
_escape_cdata�_serialize_xmlrire�sorted�_escape_attribr&r
r8r4)r�r5r�rYr��kwargsr#r3rRre�v�kr!r!r"r�s\
�
��


�
r�)
Zarea�baseZbasefont�br�col�frameZhrZimg�inputZisindex�link�metaZparamcKs�|j}|j}|tkr(|dt|���n�|tkrD|dt|���nh||}|dkr�|rd|t|��|D]}t|||d�qh�n,|d|�t|���}|s�|�r8|r�t|��dd�d�D](\}	}
|
r�d|
}
|d|
t	|	�f�q�|D]N\}
}	t
|
t��r|
j}
t
|	t��r||	j}	nt|	�}	|d	||
|	f�q�|d
�|�
�}|�rx|dk�sb|dk�rl||�n|t|��|D]}t|||d��q||tk�r�|d
|d
�|j�r�|t|j��dS)Nr�r�r�cSs|dSr�r!r�r!r!r"r��r�z!_serialize_html.<locals>.<lambda>r�r�r�r�r�ZscriptZstyler�)r#r3rr�r�_serialize_htmlrirer�r�r&r
�_escape_attrib_htmlr��
HTML_EMPTYr4)r�r5r�rYr�r#r3rRrer�r�Zltagr!r!r"r��sX
��


r�cCs*|��D]}||�q|jr&||j�dSr7)rmr4)r�r5�partr!r!r"r��s
r�)r��htmlr3cCsLt�d|�rtd��tt���D]\}}||ks8||kr t|=q |t|<dS)atRegister a namespace prefix.

    The registry is global, and any existing mapping for either the
    given prefix or the namespace URI will be removed.

    *prefix* is the namespace prefix, *uri* is a namespace uri. Tags and
    attributes in this namespace will be serialized with prefix if possible.

    ValueError is raised if prefix is reserved or is invalid.

    zns\d+$z'Prefix format reserved for internal useN)�re�matchr�rir�re)r�r�r�r�r!r!r"r�sr�r�ZrdfZwsdlZxsZxsiZdc)�$http://www.w3.org/XML/1998/namespacezhttp://www.w3.org/1999/xhtmlz+http://www.w3.org/1999/02/22-rdf-syntax-ns#z http://schemas.xmlsoap.org/wsdl/z http://www.w3.org/2001/XMLSchemaz)http://www.w3.org/2001/XMLSchema-instancez http://purl.org/dc/elements/1.1/cCstd|t|�jf��dS)Nzcannot serialize %r (type %s))r(rQrrrr!r!r"r�s�r�c	CshzBd|kr|�dd�}d|kr*|�dd�}d|kr>|�dd�}|WSttfk
rbt|�YnXdS)N�&�&amp;r��&lt;r��&gt;��replacer(r�r�rrr!r!r"r�!sr�c	Cs�z�d|kr|�dd�}d|kr*|�dd�}d|kr>|�dd�}d|krR|�dd�}d	|krf|�d	d
�}d|krz|�dd
�}d
|kr�|�d
d�}d
|kr�|�d
d�}|WSttfk
r�t|�YnXdS)Nr�r�r�r�r�r��"�&quot;z
r��
z&#10;�	z&#09;r�rrr!r!r"r�1s(r�c	CshzBd|kr|�dd�}d|kr*|�dd�}d|kr>|�dd�}|WSttfk
rbt|�YnXdS)Nr�r�r�r�r�r�r�rrr!r!r"r�Msr�T)r�r�r�cCs:|dkrt��nt��}t|�j||||||d�|��S)a
Generate string representation of XML element.

    All subelements are included.  If encoding is "unicode", a string
    is returned. Otherwise a bytestring is returned.

    *element* is an Element instance, *encoding* is an optional output
    encoding defaulting to US-ASCII, *method* is an optional output which can
    be one of "xml" (default), "html", "text" or "c14n", *default_namespace*
    sets the default XML namespace (for "xmlns").

    Returns an (optionally) encoded string containing the XML data.

    r��r�r�r�r�)r��StringIO�BytesIOrr��getvalue)r%r�r�r�r�r��streamr!r!r"r\s�c@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�_ListDataStreamz7An auxiliary stream accumulating into a list reference.cCs
||_dSr7)�lst)r,r�r!r!r"r.vsz_ListDataStream.__init__cCsdSr�r!r0r!r!r"r�ysz_ListDataStream.writablecCsdSr�r!r0r!r!r"r�|sz_ListDataStream.seekablecCs|j�|�dSr7)r�rJ)r,�br!r!r"r�sz_ListDataStream.writecCs
t|j�Sr7)r8r�r0r!r!r"r��sz_ListDataStream.tellN)	rrrr r.r�r�r�r�r!r!r!r"r�tsr�cCs*g}t|�}t|�j||||||d�|S)Nr�)r�rr�)r%r�r�r�r�r�r�r�r!r!r"r�s�cCsLt|t�st|�}|jtjdd�|��j}|r<|ddkrHtj�d�dS)a#Write element tree or element structure to sys.stdout.

    This function should be used for debugging only.

    *elem* is either an ElementTree, or a single Element.  The exact output
    format is implementation dependent.  In this version, it's written as an
    ordinary XML file.

    r�)r����r�N)r&rr��sys�stdoutr�r4)r5r4r!r!r"r�s

cCst�}|�||�|S)z�Parse XML document into element tree.

    *source* is a filename or file object containing XML data,
    *parser* is an optional parser instance defaulting to XMLParser.

    Return an ElementTree instance.

    )rr	)r�r��treer!r!r"r	�s	csft||d������fdd��G�fdd�dtjj�}|��d�_�~d�t�d�sbt�d	��d
��S)aJIncrementally parse XML document into ElementTree.

    This class also reports what's going on to the user based on the
    *events* it is initialized with.  The supported events are the strings
    "start", "end", "start-ns" and "end-ns" (the "ns" events are used to get
    detailed namespace information).  If *events* is omitted, only
    "end" events are reported.

    *source* is a filename or file object containing XML data, *events* is
    a list of events to report back, *parser* is an optional parser instance.

    Returns an iterator providing (event, elem) pairs.

    )�events�_parserc3s^zJ���EdH��d�}|s q,��|�q���}���EdH|�_W5�rX���XdS)Ni@)r��read_eventsr�r��_close_and_return_root�root)r�r)r��it�
pullparserr�r!r"�iterator�s

ziterparse.<locals>.iteratorcseZdZ��jZdS)z$iterparse.<locals>.IterParseIteratorN)rrr�__next__r!)rr!r"�IterParseIterator�srNFr�r�T)r�collections�abc�Iteratorrr$r�)r�r�r�rr!)r�rrrr�r"r�s

c@s<eZdZd
dd�dd�Zdd�Zdd�Zd	d
�Zdd�ZdS)rN)rcCs<t��|_|ptt�d�|_|dkr(d}|j�|j|�dS)N�rq)�end)r	�deque�
_events_queuerrr�
_setevents)r,r�rr!r!r"r.�s

zXMLPullParser.__init__c
CsZ|jdkrtd��|rVz|j�|�Wn.tk
rT}z|j�|�W5d}~XYnXdS)�Feed encoded data to parser.Nz!feed() called after end of stream)rr�r��SyntaxErrorrrJ)r,r��excr!r!r"r��s
zXMLPullParser.feedcCs|j��}d|_|Sr7)rr�)r,rr!r!r"r�s
z$XMLPullParser._close_and_return_rootcCs|��dS)z�Finish feeding data to parser.

        Unlike XMLParser, does not return the root element. Use
        read_events() to consume elements from XMLPullParser.
        N)rr0r!r!r"r�szXMLPullParser.closeccs.|j}|r*|��}t|t�r"|�q|VqdS)z�Return an iterator over currently available (event, elem) pairs.

        Events are consumed from the internal event queue as they are
        retrieved from the iterator.
        N)r�popleftr&�	Exception)r,r��eventr!r!r"rs
zXMLPullParser.read_events)N)rrrr.r�rr�rr!r!r!r"r�s

cCs"|stt�d�}|�|�|��S)aParse XML document from string constant.

    This function can be used to embed "XML Literals" in Python code.

    *text* is a string containing XML data, *parser* is an
    optional parser instance, defaulting to the standard XMLParser.

    Returns an Element instance.

    r�rrr�r�)r3r�r!r!r"rs
cCsR|stt�d�}|�|�|��}i}|��D]}|�d�}|r.|||<q.||fS)aParse XML document from string constant for its IDs.

    *text* is a string containing XML data, *parser* is an
    optional parser instance, defaulting to the standard XMLParser.

    Returns an (Element, dict) tuple, in which the
    dict maps element id:s to elements.

    rr/)rrr�r�rgr`)r3r�r�Zidsr5r/r!r!r"r,s



cCs,|stt�d�}|D]}|�|�q|��S)z�Parse XML document from sequence of string fragments.

    *sequence* is a list of other sequence, *parser* is an optional parser
    instance, defaulting to the standard XMLParser.

    Returns an Element instance.

    rr)Zsequencer�r3r!r!r"rDs
	c@sheZdZdZdddddd�dd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
ddd�Zdd�ZdS)ra8Generic element structure builder.

    This builder converts a sequence of start, data, and end method
    calls to a well-formed element structure.

    You can use this class to build an element structure using a custom XML
    parser, or a parser for some other XML-like format.

    *element_factory* is an optional element factory which is called
    to create new Element instances, as necessary.

    *comment_factory* is a factory to create comments to be used instead of
    the standard factory.  If *insert_comments* is false (the default),
    comments will not be inserted into the tree.

    *pi_factory* is a factory to create processing instructions to be used
    instead of the standard factory.  If *insert_pis* is false (the default),
    processing instructions will not be inserted into the tree.
    NF)�comment_factory�
pi_factory�insert_comments�
insert_piscCsdg|_g|_d|_d|_d|_|dkr*t}||_||_|dkrBt}||_	||_
|dkrZt}||_dSr7)
�_data�_elem�_lastr~�_tailr�_comment_factoryrr�_pi_factoryrr�_factory)r,Zelement_factoryrrrrr!r!r"r.js zTreeBuilder.__init__cCs|jS)z;Flush builder buffers and return toplevel document Element.r�r0r!r!r"r�~szTreeBuilder.closecCs>|jr:|jdk	r4d�|j�}|jr,||j_n||j_g|_dS�Nr�)rr�joinrr4r3�r,r3r!r!r"�_flush�s

zTreeBuilder._flushcCs|j�|�dS)zAdd text to current element.N)rrJ�r,r�r!r!r"r��szTreeBuilder.datacCsX|��|�||�|_}|jr2|jd�|�n|jdkrB||_|j�|�d|_|S)z�Open new element and return it.

        *tag* is the element name, *attrs* is a dict containing element
        attributes.

        r�Nr)r&r"rrrJr~r)r,r#�attrsr5r!r!r"�start�s
zTreeBuilder.startcCs |��|j��|_d|_|jS)zOClose and return current Element.

        *tag* is the element name.

        r)r&r�poprrrjr!r!r"r
�szTreeBuilder.endcCs|�|j|j|�S)z`Create a comment using the comment_factory.

        *text* is the text of the comment.
        )�_handle_singler rr%r!r!r"�comment�s
�zTreeBuilder.commentcCs|�|j|j||�S)z�Create a processing instruction using the pi_factory.

        *target* is the target name of the processing instruction.
        *text* is the data of the processing instruction, or ''.
        )r+r!r)r,rqr3r!r!r"�pi�s�zTreeBuilder.picGs:||�}|r6|��||_|jr0|jd�|�d|_|S)Nr�r)r&rrrJr)r,�factoryrO�argsr5r!r!r"r+�szTreeBuilder._handle_single)N)N)
rrrr r.r�r&r�r)r
r,r-r+r!r!r!r"rVs�
	c@speZdZdZddd�dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)raaElement structure builder for XML source data based on the expat parser.

    *target* is an optional target object which defaults to an instance of the
    standard TreeBuilder class, *encoding* is an optional encoding string
    which if given, overrides the encoding specified in the XML file:
    http://www.iana.org/assignments/character-sets

    N)rqr�cCsdzddlm}Wn>tk
rNzddl}Wntk
rHtd��YnXYnX|�|d�}|dkrjt�}||_|_||_|_	|j
|_i|_|j
|_t|d�r�|j|_t|d�r�|j|_t|d�r�|j|_t|d�r�|j|_t|d	�r�|j|_t|d
��r|j|_t|d��r|j|_d|_d|_d|_ d|_!i|_"zd
|j#|_$Wnt%k
�r^YnXdS)Nr��expatz7No module named expat; use SimpleXMLTreeBuilder insteadr�r)r
�start_ns�end_nsr�r,r-rzExpat %d.%d.%d)&�xml.parsersr1�ImportErrorZpyexpatZParserCreaterr�rrq�_target�error�_error�_names�_defaultZDefaultHandlerExpandr$�_start�StartElementHandler�_end�EndElementHandler�	_start_ns�StartNamespaceDeclHandler�_end_ns�EndNamespaceDeclHandlerr�ZCharacterDataHandlerr,�CommentHandlerr-�ProcessingInstructionHandlerZbuffer_text�ordered_attributes�specified_attributes�_doctype�entity�version_info�versionr�)r,rqr�r1r�r!r!r"r.�sP�




zXMLParser.__init__cCs8|j}|j}|D�] }|dkrDd|_d|_|||jfdd�}||_q|dkrf|||jfdd�}||_q|dkr�t|j	d�r�|||j
fd	d�}n||fd
d�}||_q|dkr�t|j	d�r�|||jfd
d�}n||fdd�}||_
q|dk�r|||fdd�}||_q|dk�r&|||fdd�}||_qtd|��qdS)Nr)rcSs|||||�f�dSr7r!)r#Z	attrib_inrrJr)r!r!r"�handlersz%XMLParser._setevents.<locals>.handlerr
cSs||||�f�dSr7r!)r#rrJr
r!r!r"rKszstart-nsr2cSs|||||�f�dSr7r!)r�r�rrJr2r!r!r"rK!scSs|||p
d|pdff�dSr#r!)r�r�rrJr!r!r"rK%szend-nsr3cSs||||�f�dSr7r!)r�rrJr3r!r!r"rK+scSs||df�dSr7r!)r�rrJr!r!r"rK/sr,cSs|||j�|�f�dSr7)rqr,)r3rrJr,r!r!r"rK3sr-cSs|||j�||�f�dSr7)rqr-)Z	pi_targetr�rrJr,r!r!r"rK7szunknown event %r)rrJrErFr;r<r=r>r$rqr?r@rArBrCrDr�)r,Zevents_queueZevents_to_reportr�rJZ
event_namerKr!r!r"rsL
�
�
��

�
zXMLParser._seteventscCs&t|�}|j|_|j|jf|_|�dSr7)r
�code�lineno�offsetZposition)r,rb�errr!r!r"�_raiseerror>szXMLParser._raiseerrorcCsFz|j|}Wn2tk
r@|}d|kr2d|}||j|<YnX|S)Nr�r�)r9�KeyError)r,ra�namer!r!r"�_fixnameDszXMLParser._fixnamecCs|j�|pd|pd�Sr#)rqr2�r,r�r�r!r!r"r?OszXMLParser._start_nscCs|j�|pd�Sr#)rqr3)r,r�r!r!r"rARszXMLParser._end_nscCsR|j}||�}i}|rDtdt|�d�D]}||d||||�<q&|j�||�S)Nrr:r)rS�ranger8rqr))r,r#�	attr_listZfixnamer*�ir!r!r"r;UszXMLParser._startcCs|j�|�|��Sr7)rqr
rSrjr!r!r"r=aszXMLParser._endc	Cs�|dd�}|dkr�z|jj}Wntk
r6YdSXz||j|dd��WnZtk
r�ddlm}|�d||jj	|jj
f�}d|_|jj	|_|jj
|_
|�YnX�n"|dkr�|dd	�d
kr�g|_�n|jdk	�r�|dkr�d|_dS|��}|�sdS|j�|�t|j�}|dk�r�|jd}|d
k�rd|dk�rd|j\}}}	}
|	�r�|	dd�}	n*|dk�r�|dk�r�|j\}}}
d}	ndSt|jd��r�|j�||	|
dd��nt|d��r�t�dt�d|_dS)Nrr�r�rr0z'undefined entity %s: line %d, column %d�r��	z	<!DOCTYPEr�r:ZPUBLIC�ZSYSTEM��doctypezaThe doctype() method of XMLParser is ignored.  Define doctype() method on the TreeBuilder target.)rqr�r�rHrQr4r1r7r�ZErrorLineNumberZErrorColumnNumberrLrMrNrG�striprJr8r$r\r=r>�RuntimeWarning)r,r3r�Zdata_handlerr1rO�nrQrRZpubid�systemr!r!r"r:dsd���





�zXMLParser._defaultc
CsFz|j�|d�Wn.|jk
r@}z|�|�W5d}~XYnXdS)rrN)r��Parser8rP)r,r�r�r!r!r"r��szXMLParser.feedc
Cs�z|j�dd�Wn.|jk
r@}z|�|�W5d}~XYnXz0z|jj}Wntk
rdYnX|�W�SW5|`|`|`|`XdS)z;Finish feeding data to parser and return element structure.r�rN)	r�rar8rPrrqr6r�r�)r,r�Z
close_handlerr!r!r"r��szXMLParser.close)rrrr r.rrPrSr?rAr;r=r:r�r�r!r!r!r"r�s	.66)�out�	from_filecKs�|dkr|dkrtd��d}|dkr0t��}}tt|jf|�d�}|dk	r`|�|�|��n|dk	rtt||d�|dk	r�|�	�SdS)a3Convert XML to its C14N 2.0 serialised form.

    If *out* is provided, it must be a file or file-like object that receives
    the serialised canonical XML output (text, not bytes) through its ``.write()``
    method.  To write to a file, open it in text mode with encoding "utf-8".
    If *out* is not provided, this function returns the output as text string.

    Either *xml_data* (an XML string) or *from_file* (a file path or
    file-like object) must be provided as input.

    The configuration options are the same as for the ``C14NWriterTarget``.
    Nz:Either 'xml_data' or 'from_file' must be provided as inputr)r�)
r�r�r�rrr�r�r�r	r�)Zxml_datarbrcZoptionsZsior�r!r!r"r�s


z	^\w+:\w+$c@s�eZdZdZdddddddd�dd�Zefdd�Zd	d
�Zddd�Zd
d�Z	dj
fdd�Zdd�Zdd�Z
ddd�Zdd�Zdd�Zdd�ZdS) ra�
    Canonicalization writer target for the XMLParser.

    Serialises parse events to XML C14N 2.0.

    The *write* function is used for writing out the resulting data stream
    as text (not bytes).  To write to a file, open it in text mode with encoding
    "utf-8" and pass its ``.write`` method.

    Configuration options:

    - *with_comments*: set to true to include comments
    - *strip_text*: set to true to strip whitespace before and after text content
    - *rewrite_prefixes*: set to true to replace namespace prefixes by "n{number}"
    - *qname_aware_tags*: a set of qname aware tag names in which prefixes
                          should be replaced in text content
    - *qname_aware_attrs*: a set of qname aware attribute names in which prefixes
                           should be replaced in text content
    - *exclude_attrs*: a set of attribute names that should not be serialised
    - *exclude_tags*: a set of tag names that should not be serialised
    FN)�
with_comments�
strip_text�rewrite_prefixes�qname_aware_tags�qname_aware_attrs�
exclude_attrs�exclude_tagsc	Cs�||_g|_||_||_|r$t|�nd|_|r6t|�nd|_||_|rRt|�|_nd|_|rjt|�j	|_
nd|_
dgg|_g|_|s�|j�
tt����|j�
g�i|_dg|_d|_d|_d|_d|_dS)N)r�r�Fr)�_writer�_with_comments�_strip_textrc�_exclude_attrs�
_exclude_tags�_rewrite_prefixes�_qname_aware_tags�intersection�_find_qname_aware_attrs�_declared_ns_stack�	_ns_stackrJrir�re�_prefix_map�_preserve_space�_pending_start�
_root_seen�
_root_done�_ignored_depth)	r,r�rdrerfrgrhrirjr!r!r"r.�s2�zC14NWriterTarget.__init__ccs ||�D]}|r|EdHqdSr7r!)r,Zns_stackZ	_reversedrYr!r!r"�_iter_namespacessz!C14NWriterTarget._iter_namespacescCs\|�dd�\}}|�|j�D]$\}}||krd|�d|��Sqtd|�d|�d���dS)Nr�rr�r�zPrefix z of QName "�" is not declared in scope)�splitr|rur�)r,Z
prefixed_namer�rRr��pr!r!r"�_resolve_prefix_names
z%C14NWriterTarget._resolve_prefix_namecCs�|dkr:|dd�dkr,|dd��dd�nd|f\}}n|}t�}|�|j�D]B\}}||kr�||kr�|rz|�d|��n|||fS|�|�qP|jr�||jkr�|j|}ndt|j���}|j|<|jd�||f�|�d|��||fS|�sd|k�r|||fS|�|j	�D]J\}}||k�r|jd�||f�|�rR|�d|��n|||fS�q|�st|||fSt
d|�d	���dS)
Nrr�r�r�r�r_r�zNamespace "r})r�rcr|rt�addrprvr8rJrur�)r,r�r�r#Z
prefixes_seen�ur�r!r!r"�_qnames.2 


&
zC14NWriterTarget._qnamecCs|js|j�|�dSr7)r{rrJr'r!r!r"r�CszC14NWriterTarget.datar�cCs�||j�}|jdd�=|jr.|jds.|��}|jdk	rv|jd}|_|rVt|�rV|nd}|j||f��|dk	rvdS|r�|jr�|�t	|��dS�Nr�)
rrmrwr]rx�_looks_like_prefix_namer;ryrk�_escape_cdata_c14n)r,Z
_join_textr�r/�
qname_textr!r!r"r&Gs


zC14NWriterTarget._flushcCs0|jr
dS|jr|��|jd�||f�dSr�)r{rr&rurJrTr!r!r"r2Us
zC14NWriterTarget.start_nscCs�|jdk	r,|js||jkr,|jd7_dS|jr:|��g}|j�|�|jdk	rn||jkrn|||f|_dS|�|||�dSr�)	ror{rr&rtrJrqrxr;)r,r#r(�new_namespacesr!r!r"r)]s
��zC14NWriterTarget.startcs�jdk	r$|r$�fdd�|��D�}|h|�}i}|dk	rV��|�}||<|�|��jdk	r�|r���|�}|r�|D]0}	||	}
t|
�rv��|
�}||
<|�|�qvq�d}nd}�j��fdd�t|dd�d�D�}|r�dd�|D�}|��ng}|�rjt|���D]^\}
}|dk	�r@|
|k�r@||k�r@|||d	}||
\}}	}|�	|�r\|n|	|f��q
|�
d
�}�j�	|�r�|dkn�jd��j}|d
||d	�|�r�|d�
dd�|D���|d�|dk	�r�|t|||d	��d�_�j�	g�dS)Ncs i|]\}}|�jkr||�qSr!)rn��.0r�r�r0r!r"�
<dictcomp>ps
z+C14NWriterTarget._start.<locals>.<dictcomp>csi|]}|�|��qSr!r!)r�r_)�parse_qnamer!r"r��scSs|�dd�S)Nr�r)r~)r_r!r!r"r��r�z)C14NWriterTarget._start.<locals>.<lambda>r�cSs$g|]\}}|rd|nd|f�qS)zxmlns:Zxmlnsr!)r�r�r�r!r!r"�
<listcomp>�s�z+C14NWriterTarget._start.<locals>.<listcomp>rz+{http://www.w3.org/XML/1998/namespace}spaceZpreserver�r�r�cSs&g|]\}}d|�dt|��d��qS)rpz="r�)�_escape_attrib_c14nr�r!r!r"r��sr�T)rnrer�r�rsr�r�r��sortrJr`rwrkr$r�ryru)r,r#r(r�r�r�Zresolved_namesr�ZqattrsZ	attr_namerbZ
parsed_qnamesrVr�r�Z
attr_qnamer�Zspace_behaviourr�r!)r�r,r"r;ns`


�
�

�
zC14NWriterTarget._startcCst|jr|jd8_dS|jr&|��|�d|�|�d�d��|j��t|j�dk|_|j	��|j
��dS)Nrr�rr�)r{rr&rkr�rwr*r8rzrtrurjr!r!r"r
�s

zC14NWriterTarget.endcCsd|js
dS|jrdS|jr&|�d�n|jr:|jr:|��|�dt|��d��|js`|�d�dS)Nr�z<!--z-->)rlr{rzrkryrr&r�r%r!r!r"r,�szC14NWriterTarget.commentcCsp|jr
dS|jr|�d�n|jr0|jr0|��|�|rNd|�dt|��d�n
d|�d��|jsl|�d�dS)Nr�z<?rpz?>)r{rzrkryrr&r�)r,rqr�r!r!r"r-�s$�zC14NWriterTarget.pi)N)N)rrrr r.�reversedr|r�r�r�r$r&r2r)r;r
r,r-r!r!r!r"r�s(�%
%
E
c	Cs|zVd|kr|�dd�}d|kr*|�dd�}d|kr>|�dd�}d|krR|�dd�}|WSttfk
rvt|�YnXdS)	Nr�r�r�r�r�r�r��&#xD;r�rrr!r!r"r��sr�c	Cs�z~d|kr|�dd�}d|kr*|�dd�}d|kr>|�dd�}d|krR|�dd�}d	|krf|�d	d
�}d|krz|�dd�}|WSttfk
r�t|�YnXdS)
Nr�r�r�r�r�r�r�z&#x9;r�z&#xA;r�r�r�rrr!r!r"r��s r�)rf)�_set_factories)N)N)N)NN)NN)N)NN)N)N)N)N)@r �__all__rr�r�r=r�r	Zcollections.abcr�r�rrr
rrrrrrr
r�contextmanagerr�r�r�r�rc�	NameErrorr�r�r�rr�r�r�r�r�rr�r�rrr	rrrrrrrrr�compile�UNICODEr�r�rr�r�rPZ_elementtreer�r5r!r!r!r"�<module>s�J�>

0s
3
=22�	�
��


05


zgxml/etree/__pycache__/ElementPath.cpython-38.opt-1.pyc000064400000020364151153537540016473 0ustar00U

e5d>3�@s�ddlZe�d�Zd"dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zeee	ee
ed�Z
iZGdd�d�Zd#dd�Zd$dd�Zd%dd�Zd&d d!�ZdS)'�Nz\('[^']*'|\"[^\"]*\"|::|//?|\.\.|\(\)|[/.*:\[\]\(\)@=])|((?:\{[^}]+\})?[^/\[\]\(\)@=\s]+)|\s+c		cs�|r|�d�nd}d}t�|�D]�}|\}}|r�|ddkr�d|kr�|�dd�\}}z"|s^t�|d|||ffVWq�tk
r�td|�d�Yq�Xn"|r�|s�|d||ffVn|Vd}q |V|d	k}q dS)
N�Fr�{�:�z{%s}%sz!prefix %r not found in prefix map�@)�get�xpath_tokenizer_re�findall�split�KeyError�SyntaxError)	�pattern�
namespacesZdefault_namespaceZparsing_attribute�tokenZttype�tag�prefixZuri�r�-/usr/lib64/python3.8/xml/etree/ElementPath.py�xpath_tokenizerIs&rcCs>|j}|dkr:i|_}|j��D]}|D]}|||<q*q"|S�N)�
parent_map�root�iter)�contextr�p�errr�get_parent_mapas
rcCs |dd�dkp|dd�dkS)N��{*}����}*r�rrrr�_is_wildcard_tagksr"cs�tt���dkr"��fdd�}n��dkr:��fdd�}n��dd�dkr��dd��tt��d���dd�������fd	d�}nL�d
d�dkrƈdd��tdt��������fd
d�}ntd�����|S)Nz{*}*c3s |D]}�|j��r|VqdSrr!�r�result�elem��_isinstance�_strrr�selectusz_prepare_tag.<locals>.selectz{}*c3s0|D]&}|j}�|��r|ddkr|VqdS)Nrrr!�rr$r%Zel_tagr&rrr){srr�c3s8|D].}|j}|�ks,�|��r|��kr|VqdSrr!r*)r'r(�no_ns�suffixrrrr)�srr ���c3s0|D]&}|j}�|��r|��kr|VqdSrr!r*)r'r(�ns�ns_onlyrrr)�szinternal parser error, got )�
isinstance�str�slice�len�RuntimeError)rr)r)r'r(r,r/r0r-rr�_prepare_tagos 
r6csR|d�t��r&t����fdd�}n(�dd�dkrB�dd���fdd�}|S)Nrcsdd�}�|||��S)Ncss|D]}|EdHqdSrr)r$r%rrr�select_child�sz3prepare_child.<locals>.select.<locals>.select_childr�rr$r7��
select_tagrrr)�szprepare_child.<locals>.selectr+�{}c3s(|D]}|D]}|j�kr|VqqdSrr!�rr$r%rr!rrr)�s
)r"r6��nextrr)r�r:rr�
prepare_child�sr@cCsdd�}|S)Ncss|D]}|EdHqdSrrr#rrrr)�szprepare_star.<locals>.selectrr=rrr�prepare_star�srAcCsdd�}|S)Ncss|EdHdSrr)rr$rrrr)�szprepare_self.<locals>.selectrr=rrr�prepare_self�srBcs�z
|�}Wntk
r YdSX|ddkr4d�n|dsF|d�ntd��t��rlt����fdd�}n(�dd�dkr��dd���fd	d�}|S)
Nr�*rzinvalid descendantcsdd�}�|||��S)Ncss*|D] }|��D]}||k	r|VqqdSr�r)r$r%rrrrr7�sz8prepare_descendant.<locals>.select.<locals>.select_childrr8r9rrr)�sz"prepare_descendant.<locals>.selectr+r;c3s,|D]"}|���D]}||k	r|VqqdSrrDr<r!rrr)�s)�
StopIterationrr"r6r=rr?r�prepare_descendant�s 

rFcCsdd�}|S)Ncss@t|�}i}|D]*}||kr||}||krd||<|VqdSr)r)rr$rZ
result_mapr%�parentrrrr)�szprepare_parent.<locals>.selectrr=rrr�prepare_parent�s
rHcsLg}g}z
|�}Wntk
r(YdSX|ddkr8q�|dkrBq|drr|ddd�dkrrd|ddd�f}|�|dp�d�|�|d�qd	�|�}|d
kr�|d��fdd�}|S|d
kr�|d�|d���fdd�}|S|dk�rt�d|d��s|d��fdd�}|S|dk�sB|dk�rxt�d|d��sx|d�|d���rh��fdd�}n�fdd�}|S|dk�s�|dk�s�|dk�r@|dk�r�t|d�d��dk�r0td��nl|ddk�r�td��|dk�r,zt|d�d�Wntk
�rtd��YnX�dk�r0td��nd��fdd�}|Std��dS) Nr�])rrrz'"�'r.�-rz@-c3s"|D]}|���dk	r|VqdSr�rr#)�keyrrr)�sz!prepare_predicate.<locals>.selectz@-='c3s"|D]}|����kr|VqdSrrLr#)rM�valuerrr)sz\-?\d+$c3s"|D]}|���dk	r|VqdSr)�findr#r!rrr)sz.='z-='c3s:|D]0}|���D] }d�|����kr|VqqqdS�Nr)r	�join�itertextr<)rrNrrr)s
c3s&|D]}d�|����kr|VqdSrP)rQrRr#)rNrrr)sz-()z-()-zXPath position >= 1 expectedZlastzunsupported functionr+zunsupported expressionrz)XPath offset from last() must be negativec
3s^t|�}|D]L}z.||}t|�|j��}|�|kr<|VWqttfk
rVYqXqdSr)r�listr	r�
IndexErrorr)rr$rr%rGZelems)�indexrrr)5s
zinvalid predicate)rE�appendrQ�re�match�intr�
ValueError)r>rZ	signatureZ	predicater)r)rUrMrrNr�prepare_predicate�sj

&





r[)rrC�.z..z//�[c@seZdZdZdd�ZdS)�_SelectorContextNcCs
||_dSr)r)�selfrrrr�__init__Psz_SelectorContext.__init__)�__name__�
__module__�__qualname__rr`rrrrr^Nsr^c
Csj|dd�dkr|d}|f}|r6|tt|����7}zt|}W�n�tk
�r@tt�dkrjt��|dd�dkr�td��tt	||��j
}z
|�}Wntk
r�YYdSXg}z|�t
|d||��Wntk
r�td�d�YnXz|�}|ddk�r|�}Wq�tk
�r0Y�q4Yq�Xq�|t|<YnX|g}t|�}|D]}	|	||�}�qT|S)	Nr.�/rC�drz#cannot use absolute path on elementrzinvalid path)�tuple�sorted�items�_cacherr4�clearrrr�__next__rErV�opsr^)
r%�pathrZ	cache_keyZselectorr>rr$rr)rrr�iterfindXsD


rncCstt|||�d�Sr)r>rn�r%rmrrrrrO�srOcCstt|||��Sr)rSrnrorrrr	�sr	cCs:ztt|||��}|jpdWStk
r4|YSXdSrP)r>rn�textrE)r%rm�defaultrrrr�findtext�s
rr)N)N)N)N)NN)rW�compilerrrr"r6r@rArBrFrHr[rlrir^rnrOr	rrrrrr�<module>;s4�

)
b�	

,

xml/etree/__pycache__/cElementTree.cpython-38.opt-2.pyc000064400000000257151153537540016641 0ustar00U

e5dR�@sddlTdS)�)�*N)Zxml.etree.ElementTree�rr�./usr/lib64/python3.8/xml/etree/cElementTree.py�<module>�xml/etree/__pycache__/ElementInclude.cpython-38.opt-2.pyc000064400000003055151153537540017161 0ustar00U

e5d�@sPddlZddlmZdZedZedZGdd�de�Zdd	d
�Zd
dd�Z	dS)�N�)�ElementTreez!{http://www.w3.org/2001/XInclude}�includeZfallbackc@seZdZdS)�FatalIncludeErrorN)�__name__�
__module__�__qualname__�r	r	�0/usr/lib64/python3.8/xml/etree/ElementInclude.pyr>src	Cs\|dkr.t|d��}t�|���}W5QRXn*|s6d}t|d|d��}|��}W5QRX|S)N�xml�rbzUTF-8�r)�encoding)�openr�parseZgetroot�read)�hrefrr�file�datar	r	r
�default_loaderMsrcCsh|dkrt}d}|t|�k�rd||}|jtk�r4|�d�}|�dd�}|dkr�|||�}|dkrrtd||f��t�|�}|jr�|jp�d|j|_|||<n�|dk�r&||||�d��}|dkr�td||f��|r�||d	}|jp�d||jp�d|_n|j�pd||j�pd|_||=qntd
|��n&|jt	k�rPtd|j��n
t
||�|d	}qdS)Nrrrrzcannot load %r as %r��textrrz)unknown parse type in xi:include tag (%r)z0xi:fallback tag must be child of xi:include (%r))r�len�tag�XINCLUDE_INCLUDE�getr�copy�tailr�XINCLUDE_FALLBACKr)�elem�loader�i�errZnoderr	r	r
rcsN


�



���
)N)N)
rrrZXINCLUDErr�SyntaxErrorrrrr	r	r	r
�<module>3s
xml/etree/__pycache__/ElementTree.cpython-38.opt-2.pyc000064400000110061151153537540016471 0ustar00U

e5d��@s�dddddddddd	d
ddd
dddddddddddgZdZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
Gdd	�d	e�Zdd�Z
Gd d�d�Zifd!d
�Zd\d"d�Zd]d#d�ZeZGd$d�d�ZGd%d�d�Zejd&d'��Zd^d(d)�Zd*d+�Zd,Zzee�ZWnek
�r*YnXd-d.�Zd/d0�Zeeed1�Zd2d�Zd3d4d5d6d7d8d9d:�Z e e_ d;d<�Z!d=d>�Z"d?d@�Z#dAdB�Z$d_dddCdD�dEd�Z%GdFdG�dGej&�Z'd`dddCdD�dHd�Z(dId�Z)dadJd�Z*dbdKd�Z+GdLd�d�Z,dcdMd�Z-dddNd�Z.e-Z/dedOd�Z0GdPd�d�Z1GdQd�d�Z2dfdddR�dSd�Z3e�4dTej5�j6Z7GdUd�d�Z8dVdW�Z9dXdY�Z:zeZ;ddZl<Tdd[l<m=Z=Wne>k
�r�YnXe=ee�dS)g�Comment�dump�Element�ElementTree�
fromstring�fromstringlist�	iselement�	iterparse�parse�
ParseError�PI�ProcessingInstruction�QName�
SubElement�tostring�tostringlist�TreeBuilder�VERSION�XML�XMLID�	XMLParser�
XMLPullParser�register_namespace�canonicalize�C14NWriterTargetz1.3.0�N�)�ElementPathc@seZdZdS)r
N)�__name__�
__module__�__qualname__�r r �-/usr/lib64/python3.8/xml/etree/ElementTree.pyr
js	cCs
t|d�S)N�tag)�hasattr)�elementr r r!rxsc@seZdZdZdZdZdZifdd�Zdd�Zdd�Z	dd	�Z
d
d�Zdd
�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd8d d!�Zd9d"d#�Zd:d$d%�Zd;d&d'�Zd(d)�Zd<d*d+�Zd,d-�Zd.d/�Zd0d1�Zd=d2d3�Zd>d4d5�Z d6d7�Z!dS)?rNcKs6t|t�std|jjf��||_||�|_g|_dS)Nzattrib must be dict, not %s)�
isinstance�dict�	TypeError�	__class__rr"�attrib�	_children)�selfr"r)�extrar r r!�__init__�s
�
zElement.__init__cCsd|jj|jt|�fS)Nz<%s %r at %#x>)r(rr"�id�r+r r r!�__repr__�szElement.__repr__cCs|�||�S�N)r()r+r"r)r r r!�makeelement�s	zElement.makeelementcCs0|�|j|j�}|j|_|j|_||dd�<|Sr1)r2r"r)�text�tail)r+�elemr r r!�copy�s
zElement.copycCs
t|j�Sr1)�lenr*r/r r r!�__len__�szElement.__len__cCstjdtdd�t|j�dkS)NzyThe behavior of this method will change in future versions.  Use specific 'len(elem)' or 'elem is not None' test instead.���
stacklevelr)�warnings�warn�
FutureWarningr7r*r/r r r!�__bool__�s�zElement.__bool__cCs
|j|Sr1�r*�r+�indexr r r!�__getitem__�szElement.__getitem__cCs8t|t�r |D]}|�|�qn
|�|�||j|<dSr1)r%�slice�_assert_is_elementr*)r+rBr$Zeltr r r!�__setitem__�s


zElement.__setitem__cCs|j|=dSr1r@rAr r r!�__delitem__�szElement.__delitem__cCs|�|�|j�|�dSr1�rEr*�append�r+�
subelementr r r!rI�s
zElement.appendcCs$|D]}|�|�|j�|�qdSr1rH)r+�elementsr$r r r!�extend�s
zElement.extendcCs|�|�|j�||�dSr1)rEr*�insert)r+rBrKr r r!rN�s
zElement.insertcCs t|t�stdt|�j��dS)Nzexpected an Element, not %s)r%�_Element_Pyr'�typer)r+�er r r!rE�s
zElement._assert_is_elementcCs|j�|�dSr1)r*�removerJr r r!rRs
zElement.removecCstjdtdd�|jS)NzaThis method will be removed in future versions.  Use 'list(elem)' or iteration over elem instead.r9r:)r<r=�DeprecationWarningr*r/r r r!�getchildrens�zElement.getchildrencCst�|||�Sr1)r�find�r+�path�
namespacesr r r!rU!s	zElement.findcCst�||||�Sr1)r�findtext�r+rW�defaultrXr r r!rY,szElement.findtextcCst�|||�Sr1)r�findallrVr r r!r\:s	zElement.findallcCst�|||�Sr1)r�iterfindrVr r r!r]Es	zElement.iterfindcCs |j��g|_d|_|_dSr1)r)�clearr*r3r4r/r r r!r^Ps
z
Element.clearcCs|j�||�Sr1)r)�get)r+�keyr[r r r!r_[szElement.getcCs||j|<dSr1)r))r+r`�valuer r r!�sethszElement.setcCs
|j��Sr1)r)�keysr/r r r!rcrszElement.keyscCs
|j��Sr1)r)�itemsr/r r r!rd{s	z
Element.itemsccsD|dkrd}|dks|j|kr$|V|jD]}|�|�EdHq*dS)N�*)r"r*�iter)r+r"rQr r r!rf�s
zElement.itercCstjdtdd�t|�|��S)NzbThis method will be removed in future versions.  Use 'elem.iter()' or 'list(elem.iter())' instead.r9r:�r<r=rS�listrf�r+r"r r r!�getiterator�s�zElement.getiteratorccsX|j}t|t�s|dk	rdS|j}|r,|V|D]"}|��EdH|j}|r0|Vq0dSr1)r"r%�strr3�itertextr4)r+r"�trQr r r!rl�szElement.itertext)N)NN)N)N)N)N)N)"rrrr"r)r3r4r-r0r2r6r8r?rCrFrGrIrMrNrErRrTrUrYr\r]r^r_rbrcrdrfrjrlr r r r!r}s>	








	

cKs"||�}|�||�}|�|�|Sr1)r2rI)�parentr"r)r,r$r r r!r�s
cCstt�}||_|Sr1)rrr3)r3r$r r r!r�s	cCs&tt�}||_|r"|jd||_|S)N� )rrr3)�targetr3r$r r r!r�s

c@sVeZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�ZdS)r
NcCs|rd||f}||_dS)Nz{%s}%s�r3)r+Ztext_or_urir"r r r!r-�szQName.__init__cCs|jSr1rqr/r r r!�__str__�sz
QName.__str__cCsd|jj|jfS)Nz<%s %r>)r(rr3r/r r r!r0szQName.__repr__cCs
t|j�Sr1)�hashr3r/r r r!�__hash__szQName.__hash__cCs t|t�r|j|jkS|j|kSr1�r%r
r3�r+�otherr r r!�__le__s
zQName.__le__cCs t|t�r|j|jkS|j|kSr1rurvr r r!�__lt__s
zQName.__lt__cCs t|t�r|j|jkS|j|kSr1rurvr r r!�__ge__s
zQName.__ge__cCs t|t�r|j|jkS|j|kSr1rurvr r r!�__gt__s
zQName.__gt__cCs t|t�r|j|jkS|j|kSr1rurvr r r!�__eq__s
zQName.__eq__)N)rrrr-rrr0rtrxryrzr{r|r r r r!r
�s
c@s�eZdZddd�Zdd�Zdd�Zddd	�Zdd
d�Zddd
�Zd dd�Z	d!dd�Z
d"dd�Zd#dd�Zd$dd�dd�Z
dd�ZdS)%rNcCs||_|r|�|�dSr1)�_rootr	)r+r$�filer r r!r-'szElementTree.__init__cCs|jSr1�r}r/r r r!�getroot-szElementTree.getrootcCs
||_dSr1r)r+r$r r r!�_setroot1szElementTree._setrootcCs�d}t|d�st|d�}d}z^|dkrLt�}t|d�rL|�|�|_|jW�2S|�d�}|s\qh|�|�qL|��|_|jW�S|r�|��XdS)NF�read�rbT�_parse_wholei)r#�open�closerr�r}r��feed)r+�source�parser�close_source�datar r r!r	;s$






zElementTree.parsecCs|j�|�Sr1)r}rfrir r r!rf`s
zElementTree.itercCstjdtdd�t|�|��S)NzbThis method will be removed in future versions.  Use 'tree.iter()' or 'list(tree.iter())' instead.r9r:rgrir r r!rjms�zElementTree.getiteratorcCs:|dd�dkr,d|}tjd|tdd�|j�||�S�Nr�/�.z�This search is broken in 1.3 and earlier, and will be fixed in a future version.  If you rely on the current behaviour, change it to %rr9r:)r<r=r>r}rUrVr r r!rUus��zElementTree.findcCs<|dd�dkr,d|}tjd|tdd�|j�|||�Sr�)r<r=r>r}rYrZr r r!rY�s��zElementTree.findtextcCs:|dd�dkr,d|}tjd|tdd�|j�||�Sr�)r<r=r>r}r\rVr r r!r\�s��zElementTree.findallcCs:|dd�dkr,d|}tjd|tdd�|j�||�Sr�)r<r=r>r}r]rVr r r!r]�s��zElementTree.iterfindT��short_empty_elementsc	Cs�|s
d}n|tkrtd|��|s4|dkr0d}nd}|��}t||���}|dkr�|sd|dkr�|dkr�|}	|dkr�ddl}
|
��}	|d	|	f�|d
kr�t||j�n,t|j|�\}}t|}
|
||j|||d�W5QRXdS)N�xmlzunknown method %r�c14n�utf-8�us-ascii)r�r��unicoder�rz$<?xml version='1.0' encoding='%s'?>
r3r�)	�
_serialize�
ValueError�lower�_get_writer�localeZgetpreferredencoding�_serialize_textr}�_namespaces)r+�file_or_filename�encoding�xml_declaration�default_namespace�methodr�Z	enc_lower�writeZdeclared_encodingr��qnamesrXZ	serializer r r!r��s:����zElementTree.writecCs|j|dd�S)Nr�)r�)r�)r+r~r r r!�
write_c14nszElementTree.write_c14n)NN)N)N)N)N)NN)N)N)NNNN)rrrr-r�r�r	rfrjrUrYr\r]r�r�r r r r!rs$


%





��:ccs"z
|j}WnPtk
rZ|dkr.t|d�}nt|d|dd�}|�|jVW5QRXYn�X|dkrl|Vn�t����}t|tj�r�|}nft|tj�r�t�	|�}|�
|j�nBt��}dd�|_||_z|j
|_
|j|_Wntk
r�YnXtj||ddd�}|�
|j�|jVW5QRXdS)	Nr��w�xmlcharrefreplace)r��errorscSsdS�NTr r r r r!�<lambda>0�z_get_writer.<locals>.<lambda>�
)r�r��newline)r��AttributeErrorr��
contextlib�	ExitStackr%�io�BufferedIOBase�	RawIOBase�BufferedWriter�callback�detach�writable�seekable�tell�
TextIOWrapper)r�r�r�r~�stackr r r!r�sB
�


�r�csddi�i��rd��<���fdd�}|��D]�}|j}t|t�rZ|j�kr�||j�n<t|t�rv|�kr�||�n |dk	r�|tk	r�|tk	r�t|�|�	�D]F\}}t|t�r�|j}|�kr�||�t|t�r�|j�kr�||j�q�|j}t|t�r0|j�kr0||j�q0��fS)N�cs�z�|dd�dkr�|dd��dd�\}}��|�}|dkrjt�|�}|dkrZdt��}|dkrj|�|<|r�d||f�|<q�|�|<n�r�td��|�|<Wntk
r�t|�YnXdS)Nr�{�}zns%dr�z%s:%sz<cannot use non-qualified names with default_namespace option)�rsplitr_�_namespace_mapr7r�r'�_raise_serialization_error)�qname�urir"�prefix�r�rXr�r r!�	add_qnameMs(


�z_namespaces.<locals>.add_qname)
rfr"r%r
r3rkrrr�rd)r5r�r�r"r`rar3r r�r!r�Bs4




r�cKs�|j}|j}|tkr$|d|��nv|tkr<|d|��n^||}|dkr||r\|t|��|D]}t|||d|d�q`�n|d|�t|���}	|	s�|�r2|r�t|��dd�d�D](\}
}|r�d|}|d	|t	|
�f�q�|	D]L\}}
t
|t�r�|j}t
|
t��r||
j}
nt	|
�}
|d
|||
f�q�|�sHt|��sH|�s�|d�|�rb|t|��|D]}t|||d|d��qf|d|d�n|d
�|j
�r�|t|j
��dS)N�	<!--%s-->�<?%s?>r��<cSs|dS�Nrr ��xr r r!r��r�z _serialize_xml.<locals>.<lambda>�r`�:�
 xmlns%s="%s"� %s="%s"�>�</z />)r"r3rr�
_escape_cdata�_serialize_xmlrhrd�sorted�_escape_attribr%r
r7r4)r�r5r�rXr��kwargsr"r3rQrd�v�kr r r!r�s\
�
��


�
r�)
Zarea�baseZbasefont�br�col�frameZhrZimg�inputZisindex�link�metaZparamcKs�|j}|j}|tkr(|dt|���n�|tkrD|dt|���nh||}|dkr�|rd|t|��|D]}t|||d�qh�n,|d|�t|���}|s�|�r8|r�t|��dd�d�D](\}	}
|
r�d|
}
|d|
t	|	�f�q�|D]N\}
}	t
|
t��r|
j}
t
|	t��r||	j}	nt|	�}	|d	||
|	f�q�|d
�|�
�}|�rx|dk�sb|dk�rl||�n|t|��|D]}t|||d��q||tk�r�|d
|d
�|j�r�|t|j��dS)Nr�r�r�cSs|dSr�r r�r r r!r��r�z!_serialize_html.<locals>.<lambda>r�r�r�r�r�ZscriptZstyler�)r"r3rr�r�_serialize_htmlrhrdr�r�r%r
�_escape_attrib_htmlr��
HTML_EMPTYr4)r�r5r�rXr�r"r3rQrdr�r�Zltagr r r!r��sX
��


r�cCs*|��D]}||�q|jr&||j�dSr1)rlr4)r�r5�partr r r!r��s
r�)r��htmlr3cCsLt�d|�rtd��tt���D]\}}||ks8||kr t|=q |t|<dS)Nzns\d+$z'Prefix format reserved for internal use)�re�matchr�rhr�rd)r�r�r�r�r r r!r�sr�r�ZrdfZwsdlZxsZxsiZdc)�$http://www.w3.org/XML/1998/namespacezhttp://www.w3.org/1999/xhtmlz+http://www.w3.org/1999/02/22-rdf-syntax-ns#z http://schemas.xmlsoap.org/wsdl/z http://www.w3.org/2001/XMLSchemaz)http://www.w3.org/2001/XMLSchema-instancez http://purl.org/dc/elements/1.1/cCstd|t|�jf��dS)Nzcannot serialize %r (type %s))r'rPrrqr r r!r�s�r�c	CshzBd|kr|�dd�}d|kr*|�dd�}d|kr>|�dd�}|WSttfk
rbt|�YnXdS)N�&�&amp;r��&lt;r��&gt;��replacer'r�r�rqr r r!r�!sr�c	Cs�z�d|kr|�dd�}d|kr*|�dd�}d|kr>|�dd�}d|krR|�dd�}d	|krf|�d	d
�}d|krz|�dd
�}d
|kr�|�d
d�}d
|kr�|�d
d�}|WSttfk
r�t|�YnXdS)Nr�r�r�r�r�r��"�&quot;z
r��
z&#10;�	z&#09;r�rqr r r!r�1s(r�c	CshzBd|kr|�dd�}d|kr*|�dd�}d|kr>|�dd�}|WSttfk
rbt|�YnXdS)Nr�r�r�r�r�r�r�rqr r r!r�Msr�T)r�r�r�cCs:|dkrt��nt��}t|�j||||||d�|��S)Nr��r�r�r�r�)r��StringIO�BytesIOrr��getvalue)r$r�r�r�r�r��streamr r r!r\s�c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�_ListDataStreamcCs
||_dSr1)�lst)r+r�r r r!r-vsz_ListDataStream.__init__cCsdSr�r r/r r r!r�ysz_ListDataStream.writablecCsdSr�r r/r r r!r�|sz_ListDataStream.seekablecCs|j�|�dSr1)r�rI)r+�br r r!r�sz_ListDataStream.writecCs
t|j�Sr1)r7r�r/r r r!r��sz_ListDataStream.tellN)rrrr-r�r�r�r�r r r r!r�ts
r�cCs*g}t|�}t|�j||||||d�|S)Nr�)r�rr�)r$r�r�r�r�r�r�r�r r r!r�s�cCsLt|t�st|�}|jtjdd�|��j}|r<|ddkrHtj�d�dS)Nr�)r����r�)r%rr��sys�stdoutr�r4)r5r4r r r!r�s

cCst�}|�||�|Sr1)rr	)r�r��treer r r!r	�s	csft||d������fdd��G�fdd�dtjj�}|��d�_�~d�t�d�sbt�d��d	��S)
N)�events�_parserc3s^zJ���EdH��d�}|s q,��|�q���}���EdH|�_W5�rX���XdS)Ni@)r��read_eventsr�r��_close_and_return_root�root)r�r)r��it�
pullparserr�r r!�iterator�s

ziterparse.<locals>.iteratorcseZdZ��jZdS)z$iterparse.<locals>.IterParseIteratorN)rrr�__next__r )rr r!�IterParseIterator�srFr�r�T)r�collections�abc�Iteratorrr#r�)r�r�r�rr )r�rrrr�r!r�s

c@s<eZdZd
dd�dd�Zdd�Zdd�Zd	d
�Zdd�ZdS)rN)r�cCs<t��|_|ptt�d�|_|dkr(d}|j�|j|�dS)N�rp)�end)r�deque�
_events_queuerrr��
_setevents)r+r�r�r r r!r-�s

zXMLPullParser.__init__c
CsZ|jdkrtd��|rVz|j�|�Wn.tk
rT}z|j�|�W5d}~XYnXdS)Nz!feed() called after end of stream)r�r�r��SyntaxErrorrrI)r+r��excr r r!r��s
zXMLPullParser.feedcCs|j��}d|_|Sr1)r�r�)r+rr r r!r�s
z$XMLPullParser._close_and_return_rootcCs|��dSr1)rr/r r r!r�szXMLPullParser.closeccs.|j}|r*|��}t|t�r"|�q|VqdSr1)r�popleftr%�	Exception)r+r��eventr r r!rs
zXMLPullParser.read_events)N)rrrr-r�rr�rr r r r!r�s

cCs"|stt�d�}|�|�|��S�Nr�rrr�r�)r3r�r r r!rs
cCsR|stt�d�}|�|�|��}i}|��D]}|�d�}|r.|||<q.||fS)Nrr.)rrr�r�rfr_)r3r�r�Zidsr5r.r r r!r,s



cCs,|stt�d�}|D]}|�|�q|��Srr)Zsequencer�r3r r r!rDs
	c@sdeZdZdddddd�dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Z	ddd�Z
dd�ZdS)rNF)�comment_factory�
pi_factory�insert_comments�
insert_piscCsdg|_g|_d|_d|_d|_|dkr*t}||_||_|dkrBt}||_	||_
|dkrZt}||_dSr1)
�_data�_elem�_lastr}�_tailr�_comment_factoryrr�_pi_factoryrr�_factory)r+Zelement_factoryrrrrr r r!r-js zTreeBuilder.__init__cCs|jSr1rr/r r r!r�~szTreeBuilder.closecCs>|jr:|jdk	r4d�|j�}|jr,||j_n||j_g|_dS�Nr�)rr�joinrr4r3�r+r3r r r!�_flush�s

zTreeBuilder._flushcCs|j�|�dSr1)rrI�r+r�r r r!r��szTreeBuilder.datacCsX|��|�||�|_}|jr2|jd�|�n|jdkrB||_|j�|�d|_|S)Nr�r)r%r!rrrIr}r)r+r"�attrsr5r r r!�start�s
zTreeBuilder.startcCs |��|j��|_d|_|jSr�)r%r�poprrrir r r!r�szTreeBuilder.endcCs|�|j|j|�Sr1)�_handle_singlerrr$r r r!�comment�s
�zTreeBuilder.commentcCs|�|j|j||�Sr1)r*r r)r+rpr3r r r!�pi�s�zTreeBuilder.picGs:||�}|r6|��||_|jr0|jd�|�d|_|S)Nr�r)r%rrrIr)r+�factoryrN�argsr5r r r!r*�szTreeBuilder._handle_single)N)N)rrrr-r�r%r�r(rr+r,r*r r r r!rVs�
	c@sleZdZddd�dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dS)rN)rpr�cCsdzddlm}Wn>tk
rNzddl}Wntk
rHtd��YnXYnX|�|d�}|dkrjt�}||_|_||_|_	|j
|_i|_|j
|_t|d�r�|j|_t|d�r�|j|_t|d�r�|j|_t|d�r�|j|_t|d	�r�|j|_t|d
��r|j|_t|d��r|j|_d|_d|_d|_ d|_!i|_"zd
|j#|_$Wnt%k
�r^YnXdS)Nr��expatz7No module named expat; use SimpleXMLTreeBuilder insteadr�r(r�start_ns�end_nsr�r+r,rzExpat %d.%d.%d)&�xml.parsersr0�ImportErrorZpyexpatZParserCreaterr�r�rp�_target�error�_error�_names�_defaultZDefaultHandlerExpandr#�_start�StartElementHandler�_end�EndElementHandler�	_start_ns�StartNamespaceDeclHandler�_end_ns�EndNamespaceDeclHandlerr�ZCharacterDataHandlerr+�CommentHandlerr,�ProcessingInstructionHandlerZbuffer_text�ordered_attributes�specified_attributes�_doctype�entity�version_info�versionr�)r+rpr�r0r�r r r!r-�sP�




zXMLParser.__init__cCs8|j}|j}|D�] }|dkrDd|_d|_|||jfdd�}||_q|dkrf|||jfdd�}||_q|dkr�t|j	d�r�|||j
fd	d�}n||fd
d�}||_q|dkr�t|j	d�r�|||jfd
d�}n||fdd�}||_
q|dk�r|||fdd�}||_q|dk�r&|||fdd�}||_qtd|��qdS)Nr(rcSs|||||�f�dSr1r )r"Z	attrib_inrrIr(r r r!�handlersz%XMLParser._setevents.<locals>.handlerrcSs||||�f�dSr1r )r"rrIrr r r!rJszstart-nsr1cSs|||||�f�dSr1r )r�r�rrIr1r r r!rJ!scSs|||p
d|pdff�dSr"r )r�r�rrIr r r!rJ%szend-nsr2cSs||||�f�dSr1r )r�rrIr2r r r!rJ+scSs||df�dSr1r )r�rrIr r r!rJ/sr+cSs|||j�|�f�dSr1)rpr+)r3rrIr+r r r!rJ3sr,cSs|||j�||�f�dSr1)rpr,)Z	pi_targetr�rrIr+r r r!rJ7szunknown event %r)r�rIrDrEr:r;r<r=r#rpr>r?r@rArBrCr�)r+Zevents_queueZevents_to_reportr�rIZ
event_namerJr r r!rsL
�
�
��

�
zXMLParser._seteventscCs&t|�}|j|_|j|jf|_|�dSr1)r
�code�lineno�offsetZposition)r+ra�errr r r!�_raiseerror>szXMLParser._raiseerrorcCsFz|j|}Wn2tk
r@|}d|kr2d|}||j|<YnX|S)Nr�r�)r8�KeyError)r+r`�namer r r!�_fixnameDszXMLParser._fixnamecCs|j�|pd|pd�Sr")rpr1�r+r�r�r r r!r>OszXMLParser._start_nscCs|j�|pd�Sr")rpr2)r+r�r r r!r@RszXMLParser._end_nscCsR|j}||�}i}|rDtdt|�d�D]}||d||||�<q&|j�||�S)Nrr9r)rR�ranger7rpr()r+r"�	attr_listZfixnamer)�ir r r!r:UszXMLParser._startcCs|j�|�|��Sr1)rprrRrir r r!r<aszXMLParser._endc	Cs�|dd�}|dkr�z|jj}Wntk
r6YdSXz||j|dd��WnZtk
r�ddlm}|�d||jj	|jj
f�}d|_|jj	|_|jj
|_
|�YnX�n"|dkr�|dd	�d
kr�g|_�n|jdk	�r�|dkr�d|_dS|��}|�sdS|j�|�t|j�}|dk�r�|jd}|d
k�rd|dk�rd|j\}}}	}
|	�r�|	dd�}	n*|dk�r�|dk�r�|j\}}}
d}	ndSt|jd��r�|j�||	|
dd��nt|d��r�t�dt�d|_dS)Nrr�r�rr/z'undefined entity %s: line %d, column %d�r��	z	<!DOCTYPEr�r9ZPUBLIC�ZSYSTEM��doctypezaThe doctype() method of XMLParser is ignored.  Define doctype() method on the TreeBuilder target.)rpr�r�rGrPr3r0r6r�ZErrorLineNumberZErrorColumnNumberrKrLrMrF�striprIr7r#r[r<r=�RuntimeWarning)r+r3r�Zdata_handlerr0rN�nrPrQZpubid�systemr r r!r9dsd���





�zXMLParser._defaultc
CsFz|j�|d�Wn.|jk
r@}z|�|�W5d}~XYnXdS)Nr)r��Parser7rO)r+r�r�r r r!r��szXMLParser.feedc
Cs�z|j�dd�Wn.|jk
r@}z|�|�W5d}~XYnXz0z|jj}Wntk
rdYnX|�W�SW5|`|`|`|`XdS)Nr�r)	r�r`r7rOr�rpr5r�r�)r+r�Z
close_handlerr r r!r��szXMLParser.close)rrrr-rrOrRr>r@r:r<r9r�r�r r r r!r�s
.66)�out�	from_filecKs�|dkr|dkrtd��d}|dkr0t��}}tt|jf|�d�}|dk	r`|�|�|��n|dk	rtt||d�|dk	r�|�	�SdS)Nz:Either 'xml_data' or 'from_file' must be provided as inputr)r�)
r�r�r�rrr�r�r�r	r�)Zxml_datararbZoptionsZsior�r r r!r�s


z	^\w+:\w+$c@s�eZdZdddddddd�dd�Zefdd�Zdd	�Zdd
d�Zdd
�Zdj	fdd�Z
dd�Zdd�Zddd�Z
dd�Zdd�Zdd�ZdS)rFN)�
with_comments�
strip_text�rewrite_prefixes�qname_aware_tags�qname_aware_attrs�
exclude_attrs�exclude_tagsc	Cs�||_g|_||_||_|r$t|�nd|_|r6t|�nd|_||_|rRt|�|_nd|_|rjt|�j	|_
nd|_
dgg|_g|_|s�|j�
tt����|j�
g�i|_dg|_d|_d|_d|_d|_dS)N)r�r�Fr)�_writer�_with_comments�_strip_textrb�_exclude_attrs�
_exclude_tags�_rewrite_prefixes�_qname_aware_tags�intersection�_find_qname_aware_attrs�_declared_ns_stack�	_ns_stackrIrhr�rd�_prefix_map�_preserve_space�_pending_start�
_root_seen�
_root_done�_ignored_depth)	r+r�rcrdrerfrgrhrir r r!r-�s2�zC14NWriterTarget.__init__ccs ||�D]}|r|EdHqdSr1r )r+Zns_stackZ	_reversedrXr r r!�_iter_namespacessz!C14NWriterTarget._iter_namespacescCs\|�dd�\}}|�|j�D]$\}}||krd|�d|��Sqtd|�d|�d���dS)Nr�rr�r�zPrefix z of QName "�" is not declared in scope)�splitr{rtr�)r+Z
prefixed_namer�rQr��pr r r!�_resolve_prefix_names
z%C14NWriterTarget._resolve_prefix_namecCs�|dkr:|dd�dkr,|dd��dd�nd|f\}}n|}t�}|�|j�D]B\}}||kr�||kr�|rz|�d|��n|||fS|�|�qP|jr�||jkr�|j|}ndt|j���}|j|<|jd�||f�|�d|��||fS|�sd|k�r|||fS|�|j	�D]J\}}||k�r|jd�||f�|�rR|�d|��n|||fS�q|�st|||fSt
d|�d	���dS)
Nrr�r�r�r�r^r�zNamespace "r|)r�rbr{rs�addrorur7rIrtr�)r+r�r�r"Z
prefixes_seen�ur�r r r!�_qnames.2 


&
zC14NWriterTarget._qnamecCs|js|j�|�dSr1)rzrrIr&r r r!r�CszC14NWriterTarget.datar�cCs�||j�}|jdd�=|jr.|jds.|��}|jdk	rv|jd}|_|rVt|�rV|nd}|j||f��|dk	rvdS|r�|jr�|�t	|��dS�Nr�)
rrlrvr\rw�_looks_like_prefix_namer:rxrj�_escape_cdata_c14n)r+Z
_join_textr�r.�
qname_textr r r!r%Gs


zC14NWriterTarget._flushcCs0|jr
dS|jr|��|jd�||f�dSr�)rzrr%rtrIrSr r r!r1Us
zC14NWriterTarget.start_nscCs�|jdk	r,|js||jkr,|jd7_dS|jr:|��g}|j�|�|jdk	rn||jkrn|||f|_dS|�|||�dSr�)	rnrzrr%rsrIrprwr:)r+r"r'�new_namespacesr r r!r(]s
��zC14NWriterTarget.startcs�jdk	r$|r$�fdd�|��D�}|h|�}i}|dk	rV��|�}||<|�|��jdk	r�|r���|�}|r�|D]0}	||	}
t|
�rv��|
�}||
<|�|�qvq�d}nd}�j��fdd�t|dd�d�D�}|r�dd�|D�}|��ng}|�rjt|���D]^\}
}|dk	�r@|
|k�r@||k�r@|||d	}||
\}}	}|�	|�r\|n|	|f��q
|�
d
�}�j�	|�r�|dkn�jd��j}|d
||d	�|�r�|d�
dd�|D���|d�|dk	�r�|t|||d	��d�_�j�	g�dS)Ncs i|]\}}|�jkr||�qSr )rm��.0r�r�r/r r!�
<dictcomp>ps
z+C14NWriterTarget._start.<locals>.<dictcomp>csi|]}|�|��qSr r )r�r^)�parse_qnamer r!r��scSs|�dd�S)Nr�r)r})r^r r r!r��r�z)C14NWriterTarget._start.<locals>.<lambda>r�cSs$g|]\}}|rd|nd|f�qS)zxmlns:Zxmlnsr )r�r�r�r r r!�
<listcomp>�s�z+C14NWriterTarget._start.<locals>.<listcomp>rz+{http://www.w3.org/XML/1998/namespace}spaceZpreserver�r�r�cSs&g|]\}}d|�dt|��d��qS)roz="r�)�_escape_attrib_c14nr�r r r!r��sr�T)rmrdrr�rrr�r�r��sortrIr_rvrjr#r�rxrt)r+r"r'r�r�r�Zresolved_namesr�ZqattrsZ	attr_nameraZ
parsed_qnamesrUr�r�Z
attr_qnamer�Zspace_behaviourr�r )r�r+r!r:ns`


�
�

�
zC14NWriterTarget._startcCst|jr|jd8_dS|jr&|��|�d|�|�d�d��|j��t|j�dk|_|j	��|j
��dS)Nrr�rr�)rzrr%rjr�rvr)r7ryrsrtrir r r!r�s

zC14NWriterTarget.endcCsd|js
dS|jrdS|jr&|�d�n|jr:|jr:|��|�dt|��d��|js`|�d�dS)Nr�z<!--z-->)rkrzryrjrxrr%r�r$r r r!r+�szC14NWriterTarget.commentcCsp|jr
dS|jr|�d�n|jr0|jr0|��|�|rNd|�dt|��d�n
d|�d��|jsl|�d�dS)Nr�z<?roz?>)rzryrjrxrr%r�)r+rpr�r r r!r,�s$�zC14NWriterTarget.pi)N)N)rrrr-�reversedr{rr�r�r#r%r1r(r:rr+r,r r r r!r�s&�%
%
E
c	Cs|zVd|kr|�dd�}d|kr*|�dd�}d|kr>|�dd�}d|krR|�dd�}|WSttfk
rvt|�YnXdS)	Nr�r�r�r�r�r�r��&#xD;r�rqr r r!r��sr�c	Cs�z~d|kr|�dd�}d|kr*|�dd�}d|kr>|�dd�}d|krR|�dd�}d	|krf|�d	d
�}d|krz|�dd�}|WSttfk
r�t|�YnXdS)
Nr�r�r�r�r�r�r�z&#x9;r�z&#xA;r�r�r�rqr r r!r��s r�)re)�_set_factories)N)N)N)NN)NN)N)NN)N)N)N)N)?�__all__rr�r�r<r�rZcollections.abcr�r�rrr
rrrrrrr
r�contextmanagerr�r�r�r�rb�	NameErrorr�r�r�rr�r�r�r�r�rr�r�rrr	rrrrrrrrr�compile�UNICODEr�r�rr�r�rOZ_elementtreer�r4r r r r!�<module>Ks��>

0s
3
=22�	�
��


05


zgxml/etree/__pycache__/ElementInclude.cpython-38.opt-1.pyc000064400000003055151153537540017160 0ustar00U

e5d�@sPddlZddlmZdZedZedZGdd�de�Zdd	d
�Zd
dd�Z	dS)�N�)�ElementTreez!{http://www.w3.org/2001/XInclude}�includeZfallbackc@seZdZdS)�FatalIncludeErrorN)�__name__�
__module__�__qualname__�r	r	�0/usr/lib64/python3.8/xml/etree/ElementInclude.pyr>src	Cs\|dkr.t|d��}t�|���}W5QRXn*|s6d}t|d|d��}|��}W5QRX|S)N�xml�rbzUTF-8�r)�encoding)�openr�parseZgetroot�read)�hrefrr�file�datar	r	r
�default_loaderMsrcCsh|dkrt}d}|t|�k�rd||}|jtk�r4|�d�}|�dd�}|dkr�|||�}|dkrrtd||f��t�|�}|jr�|jp�d|j|_|||<n�|dk�r&||||�d��}|dkr�td||f��|r�||d	}|jp�d||jp�d|_n|j�pd||j�pd|_||=qntd
|��n&|jt	k�rPtd|j��n
t
||�|d	}qdS)Nrrrrzcannot load %r as %r��textrrz)unknown parse type in xi:include tag (%r)z0xi:fallback tag must be child of xi:include (%r))r�len�tag�XINCLUDE_INCLUDE�getr�copy�tailr�XINCLUDE_FALLBACKr)�elem�loader�i�errZnoderr	r	r
rcsN


�



���
)N)N)
rrrZXINCLUDErr�SyntaxErrorrrrr	r	r	r
�<module>3s
xml/etree/__pycache__/__init__.cpython-38.opt-2.pyc000064400000000205151153537540016015 0ustar00U

e5dD�@sdS)N�rrr�*/usr/lib64/python3.8/xml/etree/__init__.py�<module>�xml/etree/__pycache__/ElementPath.cpython-38.pyc000064400000020364151153537540015534 0ustar00U

e5d>3�@s�ddlZe�d�Zd"dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zeee	ee
ed�Z
iZGdd�d�Zd#dd�Zd$dd�Zd%dd�Zd&d d!�ZdS)'�Nz\('[^']*'|\"[^\"]*\"|::|//?|\.\.|\(\)|[/.*:\[\]\(\)@=])|((?:\{[^}]+\})?[^/\[\]\(\)@=\s]+)|\s+c		cs�|r|�d�nd}d}t�|�D]�}|\}}|r�|ddkr�d|kr�|�dd�\}}z"|s^t�|d|||ffVWq�tk
r�td|�d�Yq�Xn"|r�|s�|d||ffVn|Vd}q |V|d	k}q dS)
N�Fr�{�:�z{%s}%sz!prefix %r not found in prefix map�@)�get�xpath_tokenizer_re�findall�split�KeyError�SyntaxError)	�pattern�
namespacesZdefault_namespaceZparsing_attribute�tokenZttype�tag�prefixZuri�r�-/usr/lib64/python3.8/xml/etree/ElementPath.py�xpath_tokenizerIs&rcCs>|j}|dkr:i|_}|j��D]}|D]}|||<q*q"|S�N)�
parent_map�root�iter)�contextr�p�errr�get_parent_mapas
rcCs |dd�dkp|dd�dkS)N��{*}����}*r�rrrr�_is_wildcard_tagksr"cs�tt���dkr"��fdd�}n��dkr:��fdd�}n��dd�dkr��dd��tt��d���dd�������fd	d�}nL�d
d�dkrƈdd��tdt��������fd
d�}ntd�����|S)Nz{*}*c3s |D]}�|j��r|VqdSrr!�r�result�elem��_isinstance�_strrr�selectusz_prepare_tag.<locals>.selectz{}*c3s0|D]&}|j}�|��r|ddkr|VqdS)Nrrr!�rr$r%Zel_tagr&rrr){srr�c3s8|D].}|j}|�ks,�|��r|��kr|VqdSrr!r*)r'r(�no_ns�suffixrrrr)�srr ���c3s0|D]&}|j}�|��r|��kr|VqdSrr!r*)r'r(�ns�ns_onlyrrr)�szinternal parser error, got )�
isinstance�str�slice�len�RuntimeError)rr)r)r'r(r,r/r0r-rr�_prepare_tagos 
r6csR|d�t��r&t����fdd�}n(�dd�dkrB�dd���fdd�}|S)Nrcsdd�}�|||��S)Ncss|D]}|EdHqdSrr)r$r%rrr�select_child�sz3prepare_child.<locals>.select.<locals>.select_childr�rr$r7��
select_tagrrr)�szprepare_child.<locals>.selectr+�{}c3s(|D]}|D]}|j�kr|VqqdSrr!�rr$r%rr!rrr)�s
)r"r6��nextrr)r�r:rr�
prepare_child�sr@cCsdd�}|S)Ncss|D]}|EdHqdSrrr#rrrr)�szprepare_star.<locals>.selectrr=rrr�prepare_star�srAcCsdd�}|S)Ncss|EdHdSrr)rr$rrrr)�szprepare_self.<locals>.selectrr=rrr�prepare_self�srBcs�z
|�}Wntk
r YdSX|ddkr4d�n|dsF|d�ntd��t��rlt����fdd�}n(�dd�dkr��dd���fd	d�}|S)
Nr�*rzinvalid descendantcsdd�}�|||��S)Ncss*|D] }|��D]}||k	r|VqqdSr�r)r$r%rrrrr7�sz8prepare_descendant.<locals>.select.<locals>.select_childrr8r9rrr)�sz"prepare_descendant.<locals>.selectr+r;c3s,|D]"}|���D]}||k	r|VqqdSrrDr<r!rrr)�s)�
StopIterationrr"r6r=rr?r�prepare_descendant�s 

rFcCsdd�}|S)Ncss@t|�}i}|D]*}||kr||}||krd||<|VqdSr)r)rr$rZ
result_mapr%�parentrrrr)�szprepare_parent.<locals>.selectrr=rrr�prepare_parent�s
rHcsLg}g}z
|�}Wntk
r(YdSX|ddkr8q�|dkrBq|drr|ddd�dkrrd|ddd�f}|�|dp�d�|�|d�qd	�|�}|d
kr�|d��fdd�}|S|d
kr�|d�|d���fdd�}|S|dk�rt�d|d��s|d��fdd�}|S|dk�sB|dk�rxt�d|d��sx|d�|d���rh��fdd�}n�fdd�}|S|dk�s�|dk�s�|dk�r@|dk�r�t|d�d��dk�r0td��nl|ddk�r�td��|dk�r,zt|d�d�Wntk
�rtd��YnX�dk�r0td��nd��fdd�}|Std��dS) Nr�])rrrz'"�'r.�-rz@-c3s"|D]}|���dk	r|VqdSr�rr#)�keyrrr)�sz!prepare_predicate.<locals>.selectz@-='c3s"|D]}|����kr|VqdSrrLr#)rM�valuerrr)sz\-?\d+$c3s"|D]}|���dk	r|VqdSr)�findr#r!rrr)sz.='z-='c3s:|D]0}|���D] }d�|����kr|VqqqdS�Nr)r	�join�itertextr<)rrNrrr)s
c3s&|D]}d�|����kr|VqdSrP)rQrRr#)rNrrr)sz-()z-()-zXPath position >= 1 expectedZlastzunsupported functionr+zunsupported expressionrz)XPath offset from last() must be negativec
3s^t|�}|D]L}z.||}t|�|j��}|�|kr<|VWqttfk
rVYqXqdSr)r�listr	r�
IndexErrorr)rr$rr%rGZelems)�indexrrr)5s
zinvalid predicate)rE�appendrQ�re�match�intr�
ValueError)r>rZ	signatureZ	predicater)r)rUrMrrNr�prepare_predicate�sj

&





r[)rrC�.z..z//�[c@seZdZdZdd�ZdS)�_SelectorContextNcCs
||_dSr)r)�selfrrrr�__init__Psz_SelectorContext.__init__)�__name__�
__module__�__qualname__rr`rrrrr^Nsr^c
Csj|dd�dkr|d}|f}|r6|tt|����7}zt|}W�n�tk
�r@tt�dkrjt��|dd�dkr�td��tt	||��j
}z
|�}Wntk
r�YYdSXg}z|�t
|d||��Wntk
r�td�d�YnXz|�}|ddk�r|�}Wq�tk
�r0Y�q4Yq�Xq�|t|<YnX|g}t|�}|D]}	|	||�}�qT|S)	Nr.�/rC�drz#cannot use absolute path on elementrzinvalid path)�tuple�sorted�items�_cacherr4�clearrrr�__next__rErV�opsr^)
r%�pathrZ	cache_keyZselectorr>rr$rr)rrr�iterfindXsD


rncCstt|||�d�Sr)r>rn�r%rmrrrrrO�srOcCstt|||��Sr)rSrnrorrrr	�sr	cCs:ztt|||��}|jpdWStk
r4|YSXdSrP)r>rn�textrE)r%rm�defaultrrrr�findtext�s
rr)N)N)N)N)NN)rW�compilerrrr"r6r@rArBrFrHr[rlrir^rnrOr	rrrrrr�<module>;s4�

)
b�	

,

xml/etree/__pycache__/__init__.cpython-38.pyc000064400000000205151153537540015055 0ustar00U

e5dD�@sdS)N�rrr�*/usr/lib64/python3.8/xml/etree/__init__.py�<module>�xml/etree/__pycache__/cElementTree.cpython-38.pyc000064400000000257151153537540015701 0ustar00U

e5dR�@sddlTdS)�)�*N)Zxml.etree.ElementTree�rr�./usr/lib64/python3.8/xml/etree/cElementTree.py�<module>�xml/etree/__pycache__/ElementInclude.cpython-38.pyc000064400000003055151153537540016221 0ustar00U

e5d�@sPddlZddlmZdZedZedZGdd�de�Zdd	d
�Zd
dd�Z	dS)�N�)�ElementTreez!{http://www.w3.org/2001/XInclude}�includeZfallbackc@seZdZdS)�FatalIncludeErrorN)�__name__�
__module__�__qualname__�r	r	�0/usr/lib64/python3.8/xml/etree/ElementInclude.pyr>src	Cs\|dkr.t|d��}t�|���}W5QRXn*|s6d}t|d|d��}|��}W5QRX|S)N�xml�rbzUTF-8�r)�encoding)�openr�parseZgetroot�read)�hrefrr�file�datar	r	r
�default_loaderMsrcCsh|dkrt}d}|t|�k�rd||}|jtk�r4|�d�}|�dd�}|dkr�|||�}|dkrrtd||f��t�|�}|jr�|jp�d|j|_|||<n�|dk�r&||||�d��}|dkr�td||f��|r�||d	}|jp�d||jp�d|_n|j�pd||j�pd|_||=qntd
|��n&|jt	k�rPtd|j��n
t
||�|d	}qdS)Nrrrrzcannot load %r as %r��textrrz)unknown parse type in xi:include tag (%r)z0xi:fallback tag must be child of xi:include (%r))r�len�tag�XINCLUDE_INCLUDE�getr�copy�tailr�XINCLUDE_FALLBACKr)�elem�loader�i�errZnoderr	r	r
rcsN


�



���
)N)N)
rrrZXINCLUDErr�SyntaxErrorrrrr	r	r	r
�<module>3s
xml/parsers/expat.py000064400000000370151153537540010527 0ustar00"""Interface to the Expat non-validating XML parser."""
import sys

from pyexpat import *

# provide pyexpat submodules as xml.parsers.expat submodules
sys.modules['xml.parsers.expat.model'] = model
sys.modules['xml.parsers.expat.errors'] = errors
xml/parsers/__init__.py000064400000000247151153537540011150 0ustar00"""Python interfaces to XML parsers.

This package contains one module:

expat -- Python wrapper for James Clark's Expat parser, with namespace
         support.

"""
xml/parsers/__pycache__/__init__.cpython-38.opt-1.pyc000064400000000463151153537540016375 0ustar00U

e5d��@sdZdS)z�Python interfaces to XML parsers.

This package contains one module:

expat -- Python wrapper for James Clark's Expat parser, with namespace
         support.

N)�__doc__�rr�,/usr/lib64/python3.8/xml/parsers/__init__.py�<module>�xml/parsers/__pycache__/expat.cpython-38.opt-1.pyc000064400000000520151153537540015751 0ustar00U

e5d��@s,dZddlZddlTeejd<eejd<dS)z1Interface to the Expat non-validating XML parser.�N)�*zxml.parsers.expat.modelzxml.parsers.expat.errors)�__doc__�sysZpyexpatZmodel�modules�errors�rr�)/usr/lib64/python3.8/xml/parsers/expat.py�<module>s
xml/parsers/__pycache__/expat.cpython-38.opt-2.pyc000064400000000416151153537540015756 0ustar00U

e5d��@s(ddlZddlTeejd<eejd<dS)�N)�*zxml.parsers.expat.modelzxml.parsers.expat.errors)�sysZpyexpatZmodel�modules�errors�rr�)/usr/lib64/python3.8/xml/parsers/expat.py�<module>s
xml/parsers/__pycache__/__init__.cpython-38.opt-2.pyc000064400000000207151153537540016372 0ustar00U

e5d��@sdS)N�rrr�,/usr/lib64/python3.8/xml/parsers/__init__.py�<module>�xml/parsers/__pycache__/__init__.cpython-38.pyc000064400000000463151153537540015436 0ustar00U

e5d��@sdZdS)z�Python interfaces to XML parsers.

This package contains one module:

expat -- Python wrapper for James Clark's Expat parser, with namespace
         support.

N)�__doc__�rr�,/usr/lib64/python3.8/xml/parsers/__init__.py�<module>�xml/parsers/__pycache__/expat.cpython-38.pyc000064400000000520151153537540015012 0ustar00U

e5d��@s,dZddlZddlTeejd<eejd<dS)z1Interface to the Expat non-validating XML parser.�N)�*zxml.parsers.expat.modelzxml.parsers.expat.errors)�__doc__�sysZpyexpatZmodel�modules�errors�rr�)/usr/lib64/python3.8/xml/parsers/expat.py�<module>s
unittest/mock.py000064400000300006151153537540007736 0ustar00# mock.py
# Test tools for mocking and patching.
# Maintained by Michael Foord
# Backport for other versions of Python available from
# https://pypi.org/project/mock

__all__ = (
    'Mock',
    'MagicMock',
    'patch',
    'sentinel',
    'DEFAULT',
    'ANY',
    'call',
    'create_autospec',
    'AsyncMock',
    'FILTER_DIR',
    'NonCallableMock',
    'NonCallableMagicMock',
    'mock_open',
    'PropertyMock',
    'seal',
)


__version__ = '1.0'

import asyncio
import contextlib
import io
import inspect
import pprint
import sys
import builtins
from types import CodeType, ModuleType, MethodType
from unittest.util import safe_repr
from functools import wraps, partial


_builtins = {name for name in dir(builtins) if not name.startswith('_')}

FILTER_DIR = True

# Workaround for issue #12370
# Without this, the __class__ properties wouldn't be set correctly
_safe_super = super

def _is_async_obj(obj):
    if _is_instance_mock(obj) and not isinstance(obj, AsyncMock):
        return False
    if hasattr(obj, '__func__'):
        obj = getattr(obj, '__func__')
    return asyncio.iscoroutinefunction(obj) or inspect.isawaitable(obj)


def _is_async_func(func):
    if getattr(func, '__code__', None):
        return asyncio.iscoroutinefunction(func)
    else:
        return False


def _is_instance_mock(obj):
    # can't use isinstance on Mock objects because they override __class__
    # The base class for all mocks is NonCallableMock
    return issubclass(type(obj), NonCallableMock)


def _is_exception(obj):
    return (
        isinstance(obj, BaseException) or
        isinstance(obj, type) and issubclass(obj, BaseException)
    )


def _extract_mock(obj):
    # Autospecced functions will return a FunctionType with "mock" attribute
    # which is the actual mock object that needs to be used.
    if isinstance(obj, FunctionTypes) and hasattr(obj, 'mock'):
        return obj.mock
    else:
        return obj


def _get_signature_object(func, as_instance, eat_self):
    """
    Given an arbitrary, possibly callable object, try to create a suitable
    signature object.
    Return a (reduced func, signature) tuple, or None.
    """
    if isinstance(func, type) and not as_instance:
        # If it's a type and should be modelled as a type, use __init__.
        func = func.__init__
        # Skip the `self` argument in __init__
        eat_self = True
    elif not isinstance(func, FunctionTypes):
        # If we really want to model an instance of the passed type,
        # __call__ should be looked up, not __init__.
        try:
            func = func.__call__
        except AttributeError:
            return None
    if eat_self:
        sig_func = partial(func, None)
    else:
        sig_func = func
    try:
        return func, inspect.signature(sig_func)
    except ValueError:
        # Certain callable types are not supported by inspect.signature()
        return None


def _check_signature(func, mock, skipfirst, instance=False):
    sig = _get_signature_object(func, instance, skipfirst)
    if sig is None:
        return
    func, sig = sig
    def checksig(self, /, *args, **kwargs):
        sig.bind(*args, **kwargs)
    _copy_func_details(func, checksig)
    type(mock)._mock_check_sig = checksig
    type(mock).__signature__ = sig


def _copy_func_details(func, funcopy):
    # we explicitly don't copy func.__dict__ into this copy as it would
    # expose original attributes that should be mocked
    for attribute in (
        '__name__', '__doc__', '__text_signature__',
        '__module__', '__defaults__', '__kwdefaults__',
    ):
        try:
            setattr(funcopy, attribute, getattr(func, attribute))
        except AttributeError:
            pass


def _callable(obj):
    if isinstance(obj, type):
        return True
    if isinstance(obj, (staticmethod, classmethod, MethodType)):
        return _callable(obj.__func__)
    if getattr(obj, '__call__', None) is not None:
        return True
    return False


def _is_list(obj):
    # checks for list or tuples
    # XXXX badly named!
    return type(obj) in (list, tuple)


def _instance_callable(obj):
    """Given an object, return True if the object is callable.
    For classes, return True if instances would be callable."""
    if not isinstance(obj, type):
        # already an instance
        return getattr(obj, '__call__', None) is not None

    # *could* be broken by a class overriding __mro__ or __dict__ via
    # a metaclass
    for base in (obj,) + obj.__mro__:
        if base.__dict__.get('__call__') is not None:
            return True
    return False


def _set_signature(mock, original, instance=False):
    # creates a function with signature (*args, **kwargs) that delegates to a
    # mock. It still does signature checking by calling a lambda with the same
    # signature as the original.

    skipfirst = isinstance(original, type)
    result = _get_signature_object(original, instance, skipfirst)
    if result is None:
        return mock
    func, sig = result
    def checksig(*args, **kwargs):
        sig.bind(*args, **kwargs)
    _copy_func_details(func, checksig)

    name = original.__name__
    if not name.isidentifier():
        name = 'funcopy'
    context = {'_checksig_': checksig, 'mock': mock}
    src = """def %s(*args, **kwargs):
    _checksig_(*args, **kwargs)
    return mock(*args, **kwargs)""" % name
    exec (src, context)
    funcopy = context[name]
    _setup_func(funcopy, mock, sig)
    return funcopy


def _setup_func(funcopy, mock, sig):
    funcopy.mock = mock

    def assert_called_with(*args, **kwargs):
        return mock.assert_called_with(*args, **kwargs)
    def assert_called(*args, **kwargs):
        return mock.assert_called(*args, **kwargs)
    def assert_not_called(*args, **kwargs):
        return mock.assert_not_called(*args, **kwargs)
    def assert_called_once(*args, **kwargs):
        return mock.assert_called_once(*args, **kwargs)
    def assert_called_once_with(*args, **kwargs):
        return mock.assert_called_once_with(*args, **kwargs)
    def assert_has_calls(*args, **kwargs):
        return mock.assert_has_calls(*args, **kwargs)
    def assert_any_call(*args, **kwargs):
        return mock.assert_any_call(*args, **kwargs)
    def reset_mock():
        funcopy.method_calls = _CallList()
        funcopy.mock_calls = _CallList()
        mock.reset_mock()
        ret = funcopy.return_value
        if _is_instance_mock(ret) and not ret is mock:
            ret.reset_mock()

    funcopy.called = False
    funcopy.call_count = 0
    funcopy.call_args = None
    funcopy.call_args_list = _CallList()
    funcopy.method_calls = _CallList()
    funcopy.mock_calls = _CallList()

    funcopy.return_value = mock.return_value
    funcopy.side_effect = mock.side_effect
    funcopy._mock_children = mock._mock_children

    funcopy.assert_called_with = assert_called_with
    funcopy.assert_called_once_with = assert_called_once_with
    funcopy.assert_has_calls = assert_has_calls
    funcopy.assert_any_call = assert_any_call
    funcopy.reset_mock = reset_mock
    funcopy.assert_called = assert_called
    funcopy.assert_not_called = assert_not_called
    funcopy.assert_called_once = assert_called_once
    funcopy.__signature__ = sig

    mock._mock_delegate = funcopy


def _setup_async_mock(mock):
    mock._is_coroutine = asyncio.coroutines._is_coroutine
    mock.await_count = 0
    mock.await_args = None
    mock.await_args_list = _CallList()

    # Mock is not configured yet so the attributes are set
    # to a function and then the corresponding mock helper function
    # is called when the helper is accessed similar to _setup_func.
    def wrapper(attr, /, *args, **kwargs):
        return getattr(mock.mock, attr)(*args, **kwargs)

    for attribute in ('assert_awaited',
                      'assert_awaited_once',
                      'assert_awaited_with',
                      'assert_awaited_once_with',
                      'assert_any_await',
                      'assert_has_awaits',
                      'assert_not_awaited'):

        # setattr(mock, attribute, wrapper) causes late binding
        # hence attribute will always be the last value in the loop
        # Use partial(wrapper, attribute) to ensure the attribute is bound
        # correctly.
        setattr(mock, attribute, partial(wrapper, attribute))


def _is_magic(name):
    return '__%s__' % name[2:-2] == name


class _SentinelObject(object):
    "A unique, named, sentinel object."
    def __init__(self, name):
        self.name = name

    def __repr__(self):
        return 'sentinel.%s' % self.name

    def __reduce__(self):
        return 'sentinel.%s' % self.name


class _Sentinel(object):
    """Access attributes to return a named object, usable as a sentinel."""
    def __init__(self):
        self._sentinels = {}

    def __getattr__(self, name):
        if name == '__bases__':
            # Without this help(unittest.mock) raises an exception
            raise AttributeError
        return self._sentinels.setdefault(name, _SentinelObject(name))

    def __reduce__(self):
        return 'sentinel'


sentinel = _Sentinel()

DEFAULT = sentinel.DEFAULT
_missing = sentinel.MISSING
_deleted = sentinel.DELETED


_allowed_names = {
    'return_value', '_mock_return_value', 'side_effect',
    '_mock_side_effect', '_mock_parent', '_mock_new_parent',
    '_mock_name', '_mock_new_name'
}


def _delegating_property(name):
    _allowed_names.add(name)
    _the_name = '_mock_' + name
    def _get(self, name=name, _the_name=_the_name):
        sig = self._mock_delegate
        if sig is None:
            return getattr(self, _the_name)
        return getattr(sig, name)
    def _set(self, value, name=name, _the_name=_the_name):
        sig = self._mock_delegate
        if sig is None:
            self.__dict__[_the_name] = value
        else:
            setattr(sig, name, value)

    return property(_get, _set)



class _CallList(list):

    def __contains__(self, value):
        if not isinstance(value, list):
            return list.__contains__(self, value)
        len_value = len(value)
        len_self = len(self)
        if len_value > len_self:
            return False

        for i in range(0, len_self - len_value + 1):
            sub_list = self[i:i+len_value]
            if sub_list == value:
                return True
        return False

    def __repr__(self):
        return pprint.pformat(list(self))


def _check_and_set_parent(parent, value, name, new_name):
    value = _extract_mock(value)

    if not _is_instance_mock(value):
        return False
    if ((value._mock_name or value._mock_new_name) or
        (value._mock_parent is not None) or
        (value._mock_new_parent is not None)):
        return False

    _parent = parent
    while _parent is not None:
        # setting a mock (value) as a child or return value of itself
        # should not modify the mock
        if _parent is value:
            return False
        _parent = _parent._mock_new_parent

    if new_name:
        value._mock_new_parent = parent
        value._mock_new_name = new_name
    if name:
        value._mock_parent = parent
        value._mock_name = name
    return True

# Internal class to identify if we wrapped an iterator object or not.
class _MockIter(object):
    def __init__(self, obj):
        self.obj = iter(obj)
    def __next__(self):
        return next(self.obj)

class Base(object):
    _mock_return_value = DEFAULT
    _mock_side_effect = None
    def __init__(self, /, *args, **kwargs):
        pass



class NonCallableMock(Base):
    """A non-callable version of `Mock`"""

    def __new__(cls, /, *args, **kw):
        # every instance has its own class
        # so we can create magic methods on the
        # class without stomping on other mocks
        bases = (cls,)
        if not issubclass(cls, AsyncMock):
            # Check if spec is an async object or function
            sig = inspect.signature(NonCallableMock.__init__)
            bound_args = sig.bind_partial(cls, *args, **kw).arguments
            spec_arg = [
                arg for arg in bound_args.keys()
                if arg.startswith('spec')
            ]
            if spec_arg:
                # what if spec_set is different than spec?
                if _is_async_obj(bound_args[spec_arg[0]]):
                    bases = (AsyncMockMixin, cls,)
        new = type(cls.__name__, bases, {'__doc__': cls.__doc__})
        instance = _safe_super(NonCallableMock, cls).__new__(new)
        return instance


    def __init__(
            self, spec=None, wraps=None, name=None, spec_set=None,
            parent=None, _spec_state=None, _new_name='', _new_parent=None,
            _spec_as_instance=False, _eat_self=None, unsafe=False, **kwargs
        ):
        if _new_parent is None:
            _new_parent = parent

        __dict__ = self.__dict__
        __dict__['_mock_parent'] = parent
        __dict__['_mock_name'] = name
        __dict__['_mock_new_name'] = _new_name
        __dict__['_mock_new_parent'] = _new_parent
        __dict__['_mock_sealed'] = False

        if spec_set is not None:
            spec = spec_set
            spec_set = True
        if _eat_self is None:
            _eat_self = parent is not None

        self._mock_add_spec(spec, spec_set, _spec_as_instance, _eat_self)

        __dict__['_mock_children'] = {}
        __dict__['_mock_wraps'] = wraps
        __dict__['_mock_delegate'] = None

        __dict__['_mock_called'] = False
        __dict__['_mock_call_args'] = None
        __dict__['_mock_call_count'] = 0
        __dict__['_mock_call_args_list'] = _CallList()
        __dict__['_mock_mock_calls'] = _CallList()

        __dict__['method_calls'] = _CallList()
        __dict__['_mock_unsafe'] = unsafe

        if kwargs:
            self.configure_mock(**kwargs)

        _safe_super(NonCallableMock, self).__init__(
            spec, wraps, name, spec_set, parent,
            _spec_state
        )


    def attach_mock(self, mock, attribute):
        """
        Attach a mock as an attribute of this one, replacing its name and
        parent. Calls to the attached mock will be recorded in the
        `method_calls` and `mock_calls` attributes of this one."""
        inner_mock = _extract_mock(mock)

        inner_mock._mock_parent = None
        inner_mock._mock_new_parent = None
        inner_mock._mock_name = ''
        inner_mock._mock_new_name = None

        setattr(self, attribute, mock)


    def mock_add_spec(self, spec, spec_set=False):
        """Add a spec to a mock. `spec` can either be an object or a
        list of strings. Only attributes on the `spec` can be fetched as
        attributes from the mock.

        If `spec_set` is True then only attributes on the spec can be set."""
        self._mock_add_spec(spec, spec_set)


    def _mock_add_spec(self, spec, spec_set, _spec_as_instance=False,
                       _eat_self=False):
        _spec_class = None
        _spec_signature = None
        _spec_asyncs = []

        for attr in dir(spec):
            if asyncio.iscoroutinefunction(getattr(spec, attr, None)):
                _spec_asyncs.append(attr)

        if spec is not None and not _is_list(spec):
            if isinstance(spec, type):
                _spec_class = spec
            else:
                _spec_class = type(spec)
            res = _get_signature_object(spec,
                                        _spec_as_instance, _eat_self)
            _spec_signature = res and res[1]

            spec = dir(spec)

        __dict__ = self.__dict__
        __dict__['_spec_class'] = _spec_class
        __dict__['_spec_set'] = spec_set
        __dict__['_spec_signature'] = _spec_signature
        __dict__['_mock_methods'] = spec
        __dict__['_spec_asyncs'] = _spec_asyncs

    def __get_return_value(self):
        ret = self._mock_return_value
        if self._mock_delegate is not None:
            ret = self._mock_delegate.return_value

        if ret is DEFAULT:
            ret = self._get_child_mock(
                _new_parent=self, _new_name='()'
            )
            self.return_value = ret
        return ret


    def __set_return_value(self, value):
        if self._mock_delegate is not None:
            self._mock_delegate.return_value = value
        else:
            self._mock_return_value = value
            _check_and_set_parent(self, value, None, '()')

    __return_value_doc = "The value to be returned when the mock is called."
    return_value = property(__get_return_value, __set_return_value,
                            __return_value_doc)


    @property
    def __class__(self):
        if self._spec_class is None:
            return type(self)
        return self._spec_class

    called = _delegating_property('called')
    call_count = _delegating_property('call_count')
    call_args = _delegating_property('call_args')
    call_args_list = _delegating_property('call_args_list')
    mock_calls = _delegating_property('mock_calls')


    def __get_side_effect(self):
        delegated = self._mock_delegate
        if delegated is None:
            return self._mock_side_effect
        sf = delegated.side_effect
        if (sf is not None and not callable(sf)
                and not isinstance(sf, _MockIter) and not _is_exception(sf)):
            sf = _MockIter(sf)
            delegated.side_effect = sf
        return sf

    def __set_side_effect(self, value):
        value = _try_iter(value)
        delegated = self._mock_delegate
        if delegated is None:
            self._mock_side_effect = value
        else:
            delegated.side_effect = value

    side_effect = property(__get_side_effect, __set_side_effect)


    def reset_mock(self,  visited=None,*, return_value=False, side_effect=False):
        "Restore the mock object to its initial state."
        if visited is None:
            visited = []
        if id(self) in visited:
            return
        visited.append(id(self))

        self.called = False
        self.call_args = None
        self.call_count = 0
        self.mock_calls = _CallList()
        self.call_args_list = _CallList()
        self.method_calls = _CallList()

        if return_value:
            self._mock_return_value = DEFAULT
        if side_effect:
            self._mock_side_effect = None

        for child in self._mock_children.values():
            if isinstance(child, _SpecState) or child is _deleted:
                continue
            child.reset_mock(visited)

        ret = self._mock_return_value
        if _is_instance_mock(ret) and ret is not self:
            ret.reset_mock(visited)


    def configure_mock(self, /, **kwargs):
        """Set attributes on the mock through keyword arguments.

        Attributes plus return values and side effects can be set on child
        mocks using standard dot notation and unpacking a dictionary in the
        method call:

        >>> attrs = {'method.return_value': 3, 'other.side_effect': KeyError}
        >>> mock.configure_mock(**attrs)"""
        for arg, val in sorted(kwargs.items(),
                               # we sort on the number of dots so that
                               # attributes are set before we set attributes on
                               # attributes
                               key=lambda entry: entry[0].count('.')):
            args = arg.split('.')
            final = args.pop()
            obj = self
            for entry in args:
                obj = getattr(obj, entry)
            setattr(obj, final, val)


    def __getattr__(self, name):
        if name in {'_mock_methods', '_mock_unsafe'}:
            raise AttributeError(name)
        elif self._mock_methods is not None:
            if name not in self._mock_methods or name in _all_magics:
                raise AttributeError("Mock object has no attribute %r" % name)
        elif _is_magic(name):
            raise AttributeError(name)
        if not self._mock_unsafe:
            if name.startswith(('assert', 'assret')):
                raise AttributeError("Attributes cannot start with 'assert' "
                                     "or 'assret'")

        result = self._mock_children.get(name)
        if result is _deleted:
            raise AttributeError(name)
        elif result is None:
            wraps = None
            if self._mock_wraps is not None:
                # XXXX should we get the attribute without triggering code
                # execution?
                wraps = getattr(self._mock_wraps, name)

            result = self._get_child_mock(
                parent=self, name=name, wraps=wraps, _new_name=name,
                _new_parent=self
            )
            self._mock_children[name]  = result

        elif isinstance(result, _SpecState):
            result = create_autospec(
                result.spec, result.spec_set, result.instance,
                result.parent, result.name
            )
            self._mock_children[name]  = result

        return result


    def _extract_mock_name(self):
        _name_list = [self._mock_new_name]
        _parent = self._mock_new_parent
        last = self

        dot = '.'
        if _name_list == ['()']:
            dot = ''

        while _parent is not None:
            last = _parent

            _name_list.append(_parent._mock_new_name + dot)
            dot = '.'
            if _parent._mock_new_name == '()':
                dot = ''

            _parent = _parent._mock_new_parent

        _name_list = list(reversed(_name_list))
        _first = last._mock_name or 'mock'
        if len(_name_list) > 1:
            if _name_list[1] not in ('()', '().'):
                _first += '.'
        _name_list[0] = _first
        return ''.join(_name_list)

    def __repr__(self):
        name = self._extract_mock_name()

        name_string = ''
        if name not in ('mock', 'mock.'):
            name_string = ' name=%r' % name

        spec_string = ''
        if self._spec_class is not None:
            spec_string = ' spec=%r'
            if self._spec_set:
                spec_string = ' spec_set=%r'
            spec_string = spec_string % self._spec_class.__name__
        return "<%s%s%s id='%s'>" % (
            type(self).__name__,
            name_string,
            spec_string,
            id(self)
        )


    def __dir__(self):
        """Filter the output of `dir(mock)` to only useful members."""
        if not FILTER_DIR:
            return object.__dir__(self)

        extras = self._mock_methods or []
        from_type = dir(type(self))
        from_dict = list(self.__dict__)
        from_child_mocks = [
            m_name for m_name, m_value in self._mock_children.items()
            if m_value is not _deleted]

        from_type = [e for e in from_type if not e.startswith('_')]
        from_dict = [e for e in from_dict if not e.startswith('_') or
                     _is_magic(e)]
        return sorted(set(extras + from_type + from_dict + from_child_mocks))


    def __setattr__(self, name, value):
        if name in _allowed_names:
            # property setters go through here
            return object.__setattr__(self, name, value)
        elif (self._spec_set and self._mock_methods is not None and
            name not in self._mock_methods and
            name not in self.__dict__):
            raise AttributeError("Mock object has no attribute '%s'" % name)
        elif name in _unsupported_magics:
            msg = 'Attempting to set unsupported magic method %r.' % name
            raise AttributeError(msg)
        elif name in _all_magics:
            if self._mock_methods is not None and name not in self._mock_methods:
                raise AttributeError("Mock object has no attribute '%s'" % name)

            if not _is_instance_mock(value):
                setattr(type(self), name, _get_method(name, value))
                original = value
                value = lambda *args, **kw: original(self, *args, **kw)
            else:
                # only set _new_name and not name so that mock_calls is tracked
                # but not method calls
                _check_and_set_parent(self, value, None, name)
                setattr(type(self), name, value)
                self._mock_children[name] = value
        elif name == '__class__':
            self._spec_class = value
            return
        else:
            if _check_and_set_parent(self, value, name, name):
                self._mock_children[name] = value

        if self._mock_sealed and not hasattr(self, name):
            mock_name = f'{self._extract_mock_name()}.{name}'
            raise AttributeError(f'Cannot set {mock_name}')

        return object.__setattr__(self, name, value)


    def __delattr__(self, name):
        if name in _all_magics and name in type(self).__dict__:
            delattr(type(self), name)
            if name not in self.__dict__:
                # for magic methods that are still MagicProxy objects and
                # not set on the instance itself
                return

        obj = self._mock_children.get(name, _missing)
        if name in self.__dict__:
            _safe_super(NonCallableMock, self).__delattr__(name)
        elif obj is _deleted:
            raise AttributeError(name)
        if obj is not _missing:
            del self._mock_children[name]
        self._mock_children[name] = _deleted


    def _format_mock_call_signature(self, args, kwargs):
        name = self._mock_name or 'mock'
        return _format_call_signature(name, args, kwargs)


    def _format_mock_failure_message(self, args, kwargs, action='call'):
        message = 'expected %s not found.\nExpected: %s\nActual: %s'
        expected_string = self._format_mock_call_signature(args, kwargs)
        call_args = self.call_args
        actual_string = self._format_mock_call_signature(*call_args)
        return message % (action, expected_string, actual_string)


    def _get_call_signature_from_name(self, name):
        """
        * If call objects are asserted against a method/function like obj.meth1
        then there could be no name for the call object to lookup. Hence just
        return the spec_signature of the method/function being asserted against.
        * If the name is not empty then remove () and split by '.' to get
        list of names to iterate through the children until a potential
        match is found. A child mock is created only during attribute access
        so if we get a _SpecState then no attributes of the spec were accessed
        and can be safely exited.
        """
        if not name:
            return self._spec_signature

        sig = None
        names = name.replace('()', '').split('.')
        children = self._mock_children

        for name in names:
            child = children.get(name)
            if child is None or isinstance(child, _SpecState):
                break
            else:
                # If an autospecced object is attached using attach_mock the
                # child would be a function with mock object as attribute from
                # which signature has to be derived.
                child = _extract_mock(child)
                children = child._mock_children
                sig = child._spec_signature

        return sig


    def _call_matcher(self, _call):
        """
        Given a call (or simply an (args, kwargs) tuple), return a
        comparison key suitable for matching with other calls.
        This is a best effort method which relies on the spec's signature,
        if available, or falls back on the arguments themselves.
        """

        if isinstance(_call, tuple) and len(_call) > 2:
            sig = self._get_call_signature_from_name(_call[0])
        else:
            sig = self._spec_signature

        if sig is not None:
            if len(_call) == 2:
                name = ''
                args, kwargs = _call
            else:
                name, args, kwargs = _call
            try:
                return name, sig.bind(*args, **kwargs)
            except TypeError as e:
                return e.with_traceback(None)
        else:
            return _call

    def assert_not_called(self):
        """assert that the mock was never called.
        """
        if self.call_count != 0:
            msg = ("Expected '%s' to not have been called. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
            raise AssertionError(msg)

    def assert_called(self):
        """assert that the mock was called at least once
        """
        if self.call_count == 0:
            msg = ("Expected '%s' to have been called." %
                   (self._mock_name or 'mock'))
            raise AssertionError(msg)

    def assert_called_once(self):
        """assert that the mock was called only once.
        """
        if not self.call_count == 1:
            msg = ("Expected '%s' to have been called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
            raise AssertionError(msg)

    def assert_called_with(self, /, *args, **kwargs):
        """assert that the last call was made with the specified arguments.

        Raises an AssertionError if the args and keyword args passed in are
        different to the last call to the mock."""
        if self.call_args is None:
            expected = self._format_mock_call_signature(args, kwargs)
            actual = 'not called.'
            error_message = ('expected call not found.\nExpected: %s\nActual: %s'
                    % (expected, actual))
            raise AssertionError(error_message)

        def _error_message():
            msg = self._format_mock_failure_message(args, kwargs)
            return msg
        expected = self._call_matcher((args, kwargs))
        actual = self._call_matcher(self.call_args)
        if expected != actual:
            cause = expected if isinstance(expected, Exception) else None
            raise AssertionError(_error_message()) from cause


    def assert_called_once_with(self, /, *args, **kwargs):
        """assert that the mock was called exactly once and that that call was
        with the specified arguments."""
        if not self.call_count == 1:
            msg = ("Expected '%s' to be called once. Called %s times.%s"
                   % (self._mock_name or 'mock',
                      self.call_count,
                      self._calls_repr()))
            raise AssertionError(msg)
        return self.assert_called_with(*args, **kwargs)


    def assert_has_calls(self, calls, any_order=False):
        """assert the mock has been called with the specified calls.
        The `mock_calls` list is checked for the calls.

        If `any_order` is False (the default) then the calls must be
        sequential. There can be extra calls before or after the
        specified calls.

        If `any_order` is True then the calls can be in any order, but
        they must all appear in `mock_calls`."""
        expected = [self._call_matcher(c) for c in calls]
        cause = next((e for e in expected if isinstance(e, Exception)), None)
        all_calls = _CallList(self._call_matcher(c) for c in self.mock_calls)
        if not any_order:
            if expected not in all_calls:
                if cause is None:
                    problem = 'Calls not found.'
                else:
                    problem = ('Error processing expected calls.\n'
                               'Errors: {}').format(
                                   [e if isinstance(e, Exception) else None
                                    for e in expected])
                raise AssertionError(
                    f'{problem}\n'
                    f'Expected: {_CallList(calls)}'
                    f'{self._calls_repr(prefix="Actual").rstrip(".")}'
                ) from cause
            return

        all_calls = list(all_calls)

        not_found = []
        for kall in expected:
            try:
                all_calls.remove(kall)
            except ValueError:
                not_found.append(kall)
        if not_found:
            raise AssertionError(
                '%r does not contain all of %r in its call list, '
                'found %r instead' % (self._mock_name or 'mock',
                                      tuple(not_found), all_calls)
            ) from cause


    def assert_any_call(self, /, *args, **kwargs):
        """assert the mock has been called with the specified arguments.

        The assert passes if the mock has *ever* been called, unlike
        `assert_called_with` and `assert_called_once_with` that only pass if
        the call is the most recent one."""
        expected = self._call_matcher((args, kwargs))
        actual = [self._call_matcher(c) for c in self.call_args_list]
        if expected not in actual:
            cause = expected if isinstance(expected, Exception) else None
            expected_string = self._format_mock_call_signature(args, kwargs)
            raise AssertionError(
                '%s call not found' % expected_string
            ) from cause


    def _get_child_mock(self, /, **kw):
        """Create the child mocks for attributes and return value.
        By default child mocks will be the same type as the parent.
        Subclasses of Mock may want to override this to customize the way
        child mocks are made.

        For non-callable mocks the callable variant will be used (rather than
        any custom subclass)."""
        _new_name = kw.get("_new_name")
        if _new_name in self.__dict__['_spec_asyncs']:
            return AsyncMock(**kw)

        _type = type(self)
        if issubclass(_type, MagicMock) and _new_name in _async_method_magics:
            # Any asynchronous magic becomes an AsyncMock
            klass = AsyncMock
        elif issubclass(_type, AsyncMockMixin):
            if (_new_name in _all_sync_magics or
                    self._mock_methods and _new_name in self._mock_methods):
                # Any synchronous method on AsyncMock becomes a MagicMock
                klass = MagicMock
            else:
                klass = AsyncMock
        elif not issubclass(_type, CallableMixin):
            if issubclass(_type, NonCallableMagicMock):
                klass = MagicMock
            elif issubclass(_type, NonCallableMock):
                klass = Mock
        else:
            klass = _type.__mro__[1]

        if self._mock_sealed:
            attribute = "." + kw["name"] if "name" in kw else "()"
            mock_name = self._extract_mock_name() + attribute
            raise AttributeError(mock_name)

        return klass(**kw)


    def _calls_repr(self, prefix="Calls"):
        """Renders self.mock_calls as a string.

        Example: "\nCalls: [call(1), call(2)]."

        If self.mock_calls is empty, an empty string is returned. The
        output will be truncated if very long.
        """
        if not self.mock_calls:
            return ""
        return f"\n{prefix}: {safe_repr(self.mock_calls)}."



def _try_iter(obj):
    if obj is None:
        return obj
    if _is_exception(obj):
        return obj
    if _callable(obj):
        return obj
    try:
        return iter(obj)
    except TypeError:
        # XXXX backwards compatibility
        # but this will blow up on first call - so maybe we should fail early?
        return obj


class CallableMixin(Base):

    def __init__(self, spec=None, side_effect=None, return_value=DEFAULT,
                 wraps=None, name=None, spec_set=None, parent=None,
                 _spec_state=None, _new_name='', _new_parent=None, **kwargs):
        self.__dict__['_mock_return_value'] = return_value
        _safe_super(CallableMixin, self).__init__(
            spec, wraps, name, spec_set, parent,
            _spec_state, _new_name, _new_parent, **kwargs
        )

        self.side_effect = side_effect


    def _mock_check_sig(self, /, *args, **kwargs):
        # stub method that can be replaced with one with a specific signature
        pass


    def __call__(self, /, *args, **kwargs):
        # can't use self in-case a function / method we are mocking uses self
        # in the signature
        self._mock_check_sig(*args, **kwargs)
        self._increment_mock_call(*args, **kwargs)
        return self._mock_call(*args, **kwargs)


    def _mock_call(self, /, *args, **kwargs):
        return self._execute_mock_call(*args, **kwargs)

    def _increment_mock_call(self, /, *args, **kwargs):
        self.called = True
        self.call_count += 1

        # handle call_args
        # needs to be set here so assertions on call arguments pass before
        # execution in the case of awaited calls
        _call = _Call((args, kwargs), two=True)
        self.call_args = _call
        self.call_args_list.append(_call)

        # initial stuff for method_calls:
        do_method_calls = self._mock_parent is not None
        method_call_name = self._mock_name

        # initial stuff for mock_calls:
        mock_call_name = self._mock_new_name
        is_a_call = mock_call_name == '()'
        self.mock_calls.append(_Call(('', args, kwargs)))

        # follow up the chain of mocks:
        _new_parent = self._mock_new_parent
        while _new_parent is not None:

            # handle method_calls:
            if do_method_calls:
                _new_parent.method_calls.append(_Call((method_call_name, args, kwargs)))
                do_method_calls = _new_parent._mock_parent is not None
                if do_method_calls:
                    method_call_name = _new_parent._mock_name + '.' + method_call_name

            # handle mock_calls:
            this_mock_call = _Call((mock_call_name, args, kwargs))
            _new_parent.mock_calls.append(this_mock_call)

            if _new_parent._mock_new_name:
                if is_a_call:
                    dot = ''
                else:
                    dot = '.'
                is_a_call = _new_parent._mock_new_name == '()'
                mock_call_name = _new_parent._mock_new_name + dot + mock_call_name

            # follow the parental chain:
            _new_parent = _new_parent._mock_new_parent

    def _execute_mock_call(self, /, *args, **kwargs):
        # separate from _increment_mock_call so that awaited functions are
        # executed separately from their call, also AsyncMock overrides this method

        effect = self.side_effect
        if effect is not None:
            if _is_exception(effect):
                raise effect
            elif not _callable(effect):
                result = next(effect)
                if _is_exception(result):
                    raise result
            else:
                result = effect(*args, **kwargs)

            if result is not DEFAULT:
                return result

        if self._mock_return_value is not DEFAULT:
            return self.return_value

        if self._mock_wraps is not None:
            return self._mock_wraps(*args, **kwargs)

        return self.return_value



class Mock(CallableMixin, NonCallableMock):
    """
    Create a new `Mock` object. `Mock` takes several optional arguments
    that specify the behaviour of the Mock object:

    * `spec`: This can be either a list of strings or an existing object (a
      class or instance) that acts as the specification for the mock object. If
      you pass in an object then a list of strings is formed by calling dir on
      the object (excluding unsupported magic attributes and methods). Accessing
      any attribute not in this list will raise an `AttributeError`.

      If `spec` is an object (rather than a list of strings) then
      `mock.__class__` returns the class of the spec object. This allows mocks
      to pass `isinstance` tests.

    * `spec_set`: A stricter variant of `spec`. If used, attempting to *set*
      or get an attribute on the mock that isn't on the object passed as
      `spec_set` will raise an `AttributeError`.

    * `side_effect`: A function to be called whenever the Mock is called. See
      the `side_effect` attribute. Useful for raising exceptions or
      dynamically changing return values. The function is called with the same
      arguments as the mock, and unless it returns `DEFAULT`, the return
      value of this function is used as the return value.

      If `side_effect` is an iterable then each call to the mock will return
      the next value from the iterable. If any of the members of the iterable
      are exceptions they will be raised instead of returned.

    * `return_value`: The value returned when the mock is called. By default
      this is a new Mock (created on first access). See the
      `return_value` attribute.

    * `wraps`: Item for the mock object to wrap. If `wraps` is not None then
      calling the Mock will pass the call through to the wrapped object
      (returning the real result). Attribute access on the mock will return a
      Mock object that wraps the corresponding attribute of the wrapped object
      (so attempting to access an attribute that doesn't exist will raise an
      `AttributeError`).

      If the mock has an explicit `return_value` set then calls are not passed
      to the wrapped object and the `return_value` is returned instead.

    * `name`: If the mock has a name then it will be used in the repr of the
      mock. This can be useful for debugging. The name is propagated to child
      mocks.

    Mocks can also be called with arbitrary keyword arguments. These will be
    used to set attributes on the mock after it is created.
    """


def _dot_lookup(thing, comp, import_path):
    try:
        return getattr(thing, comp)
    except AttributeError:
        __import__(import_path)
        return getattr(thing, comp)


def _importer(target):
    components = target.split('.')
    import_path = components.pop(0)
    thing = __import__(import_path)

    for comp in components:
        import_path += ".%s" % comp
        thing = _dot_lookup(thing, comp, import_path)
    return thing


class _patch(object):

    attribute_name = None
    _active_patches = []

    def __init__(
            self, getter, attribute, new, spec, create,
            spec_set, autospec, new_callable, kwargs
        ):
        if new_callable is not None:
            if new is not DEFAULT:
                raise ValueError(
                    "Cannot use 'new' and 'new_callable' together"
                )
            if autospec is not None:
                raise ValueError(
                    "Cannot use 'autospec' and 'new_callable' together"
                )

        self.getter = getter
        self.attribute = attribute
        self.new = new
        self.new_callable = new_callable
        self.spec = spec
        self.create = create
        self.has_local = False
        self.spec_set = spec_set
        self.autospec = autospec
        self.kwargs = kwargs
        self.additional_patchers = []


    def copy(self):
        patcher = _patch(
            self.getter, self.attribute, self.new, self.spec,
            self.create, self.spec_set,
            self.autospec, self.new_callable, self.kwargs
        )
        patcher.attribute_name = self.attribute_name
        patcher.additional_patchers = [
            p.copy() for p in self.additional_patchers
        ]
        return patcher


    def __call__(self, func):
        if isinstance(func, type):
            return self.decorate_class(func)
        if inspect.iscoroutinefunction(func):
            return self.decorate_async_callable(func)
        return self.decorate_callable(func)


    def decorate_class(self, klass):
        for attr in dir(klass):
            if not attr.startswith(patch.TEST_PREFIX):
                continue

            attr_value = getattr(klass, attr)
            if not hasattr(attr_value, "__call__"):
                continue

            patcher = self.copy()
            setattr(klass, attr, patcher(attr_value))
        return klass


    @contextlib.contextmanager
    def decoration_helper(self, patched, args, keywargs):
        extra_args = []
        with contextlib.ExitStack() as exit_stack:
            for patching in patched.patchings:
                arg = exit_stack.enter_context(patching)
                if patching.attribute_name is not None:
                    keywargs.update(arg)
                elif patching.new is DEFAULT:
                    extra_args.append(arg)

            args += tuple(extra_args)
            yield (args, keywargs)


    def decorate_callable(self, func):
        # NB. Keep the method in sync with decorate_async_callable()
        if hasattr(func, 'patchings'):
            func.patchings.append(self)
            return func

        @wraps(func)
        def patched(*args, **keywargs):
            with self.decoration_helper(patched,
                                        args,
                                        keywargs) as (newargs, newkeywargs):
                return func(*newargs, **newkeywargs)

        patched.patchings = [self]
        return patched


    def decorate_async_callable(self, func):
        # NB. Keep the method in sync with decorate_callable()
        if hasattr(func, 'patchings'):
            func.patchings.append(self)
            return func

        @wraps(func)
        async def patched(*args, **keywargs):
            with self.decoration_helper(patched,
                                        args,
                                        keywargs) as (newargs, newkeywargs):
                return await func(*newargs, **newkeywargs)

        patched.patchings = [self]
        return patched


    def get_original(self):
        target = self.getter()
        name = self.attribute

        original = DEFAULT
        local = False

        try:
            original = target.__dict__[name]
        except (AttributeError, KeyError):
            original = getattr(target, name, DEFAULT)
        else:
            local = True

        if name in _builtins and isinstance(target, ModuleType):
            self.create = True

        if not self.create and original is DEFAULT:
            raise AttributeError(
                "%s does not have the attribute %r" % (target, name)
            )
        return original, local


    def __enter__(self):
        """Perform the patch."""
        new, spec, spec_set = self.new, self.spec, self.spec_set
        autospec, kwargs = self.autospec, self.kwargs
        new_callable = self.new_callable
        self.target = self.getter()

        # normalise False to None
        if spec is False:
            spec = None
        if spec_set is False:
            spec_set = None
        if autospec is False:
            autospec = None

        if spec is not None and autospec is not None:
            raise TypeError("Can't specify spec and autospec")
        if ((spec is not None or autospec is not None) and
            spec_set not in (True, None)):
            raise TypeError("Can't provide explicit spec_set *and* spec or autospec")

        original, local = self.get_original()

        if new is DEFAULT and autospec is None:
            inherit = False
            if spec is True:
                # set spec to the object we are replacing
                spec = original
                if spec_set is True:
                    spec_set = original
                    spec = None
            elif spec is not None:
                if spec_set is True:
                    spec_set = spec
                    spec = None
            elif spec_set is True:
                spec_set = original

            if spec is not None or spec_set is not None:
                if original is DEFAULT:
                    raise TypeError("Can't use 'spec' with create=True")
                if isinstance(original, type):
                    # If we're patching out a class and there is a spec
                    inherit = True
            if spec is None and _is_async_obj(original):
                Klass = AsyncMock
            else:
                Klass = MagicMock
            _kwargs = {}
            if new_callable is not None:
                Klass = new_callable
            elif spec is not None or spec_set is not None:
                this_spec = spec
                if spec_set is not None:
                    this_spec = spec_set
                if _is_list(this_spec):
                    not_callable = '__call__' not in this_spec
                else:
                    not_callable = not callable(this_spec)
                if _is_async_obj(this_spec):
                    Klass = AsyncMock
                elif not_callable:
                    Klass = NonCallableMagicMock

            if spec is not None:
                _kwargs['spec'] = spec
            if spec_set is not None:
                _kwargs['spec_set'] = spec_set

            # add a name to mocks
            if (isinstance(Klass, type) and
                issubclass(Klass, NonCallableMock) and self.attribute):
                _kwargs['name'] = self.attribute

            _kwargs.update(kwargs)
            new = Klass(**_kwargs)

            if inherit and _is_instance_mock(new):
                # we can only tell if the instance should be callable if the
                # spec is not a list
                this_spec = spec
                if spec_set is not None:
                    this_spec = spec_set
                if (not _is_list(this_spec) and not
                    _instance_callable(this_spec)):
                    Klass = NonCallableMagicMock

                _kwargs.pop('name')
                new.return_value = Klass(_new_parent=new, _new_name='()',
                                         **_kwargs)
        elif autospec is not None:
            # spec is ignored, new *must* be default, spec_set is treated
            # as a boolean. Should we check spec is not None and that spec_set
            # is a bool?
            if new is not DEFAULT:
                raise TypeError(
                    "autospec creates the mock for you. Can't specify "
                    "autospec and new."
                )
            if original is DEFAULT:
                raise TypeError("Can't use 'autospec' with create=True")
            spec_set = bool(spec_set)
            if autospec is True:
                autospec = original

            new = create_autospec(autospec, spec_set=spec_set,
                                  _name=self.attribute, **kwargs)
        elif kwargs:
            # can't set keyword args when we aren't creating the mock
            # XXXX If new is a Mock we could call new.configure_mock(**kwargs)
            raise TypeError("Can't pass kwargs to a mock we aren't creating")

        new_attr = new

        self.temp_original = original
        self.is_local = local
        self._exit_stack = contextlib.ExitStack()
        try:
            setattr(self.target, self.attribute, new_attr)
            if self.attribute_name is not None:
                extra_args = {}
                if self.new is DEFAULT:
                    extra_args[self.attribute_name] =  new
                for patching in self.additional_patchers:
                    arg = self._exit_stack.enter_context(patching)
                    if patching.new is DEFAULT:
                        extra_args.update(arg)
                return extra_args

            return new
        except:
            if not self.__exit__(*sys.exc_info()):
                raise

    def __exit__(self, *exc_info):
        """Undo the patch."""
        if self.is_local and self.temp_original is not DEFAULT:
            setattr(self.target, self.attribute, self.temp_original)
        else:
            delattr(self.target, self.attribute)
            if not self.create and (not hasattr(self.target, self.attribute) or
                        self.attribute in ('__doc__', '__module__',
                                           '__defaults__', '__annotations__',
                                           '__kwdefaults__')):
                # needed for proxy objects like django settings
                setattr(self.target, self.attribute, self.temp_original)

        del self.temp_original
        del self.is_local
        del self.target
        exit_stack = self._exit_stack
        del self._exit_stack
        return exit_stack.__exit__(*exc_info)


    def start(self):
        """Activate a patch, returning any created mock."""
        result = self.__enter__()
        self._active_patches.append(self)
        return result


    def stop(self):
        """Stop an active patch."""
        try:
            self._active_patches.remove(self)
        except ValueError:
            # If the patch hasn't been started this will fail
            return None

        return self.__exit__(None, None, None)



def _get_target(target):
    try:
        target, attribute = target.rsplit('.', 1)
    except (TypeError, ValueError):
        raise TypeError("Need a valid target to patch. You supplied: %r" %
                        (target,))
    getter = lambda: _importer(target)
    return getter, attribute


def _patch_object(
        target, attribute, new=DEFAULT, spec=None,
        create=False, spec_set=None, autospec=None,
        new_callable=None, **kwargs
    ):
    """
    patch the named member (`attribute`) on an object (`target`) with a mock
    object.

    `patch.object` can be used as a decorator, class decorator or a context
    manager. Arguments `new`, `spec`, `create`, `spec_set`,
    `autospec` and `new_callable` have the same meaning as for `patch`. Like
    `patch`, `patch.object` takes arbitrary keyword arguments for configuring
    the mock object it creates.

    When used as a class decorator `patch.object` honours `patch.TEST_PREFIX`
    for choosing which methods to wrap.
    """
    if type(target) is str:
        raise TypeError(
            f"{target!r} must be the actual object to be patched, not a str"
        )
    getter = lambda: target
    return _patch(
        getter, attribute, new, spec, create,
        spec_set, autospec, new_callable, kwargs
    )


def _patch_multiple(target, spec=None, create=False, spec_set=None,
                    autospec=None, new_callable=None, **kwargs):
    """Perform multiple patches in a single call. It takes the object to be
    patched (either as an object or a string to fetch the object by importing)
    and keyword arguments for the patches::

        with patch.multiple(settings, FIRST_PATCH='one', SECOND_PATCH='two'):
            ...

    Use `DEFAULT` as the value if you want `patch.multiple` to create
    mocks for you. In this case the created mocks are passed into a decorated
    function by keyword, and a dictionary is returned when `patch.multiple` is
    used as a context manager.

    `patch.multiple` can be used as a decorator, class decorator or a context
    manager. The arguments `spec`, `spec_set`, `create`,
    `autospec` and `new_callable` have the same meaning as for `patch`. These
    arguments will be applied to *all* patches done by `patch.multiple`.

    When used as a class decorator `patch.multiple` honours `patch.TEST_PREFIX`
    for choosing which methods to wrap.
    """
    if type(target) is str:
        getter = lambda: _importer(target)
    else:
        getter = lambda: target

    if not kwargs:
        raise ValueError(
            'Must supply at least one keyword argument with patch.multiple'
        )
    # need to wrap in a list for python 3, where items is a view
    items = list(kwargs.items())
    attribute, new = items[0]
    patcher = _patch(
        getter, attribute, new, spec, create, spec_set,
        autospec, new_callable, {}
    )
    patcher.attribute_name = attribute
    for attribute, new in items[1:]:
        this_patcher = _patch(
            getter, attribute, new, spec, create, spec_set,
            autospec, new_callable, {}
        )
        this_patcher.attribute_name = attribute
        patcher.additional_patchers.append(this_patcher)
    return patcher


def patch(
        target, new=DEFAULT, spec=None, create=False,
        spec_set=None, autospec=None, new_callable=None, **kwargs
    ):
    """
    `patch` acts as a function decorator, class decorator or a context
    manager. Inside the body of the function or with statement, the `target`
    is patched with a `new` object. When the function/with statement exits
    the patch is undone.

    If `new` is omitted, then the target is replaced with an
    `AsyncMock if the patched object is an async function or a
    `MagicMock` otherwise. If `patch` is used as a decorator and `new` is
    omitted, the created mock is passed in as an extra argument to the
    decorated function. If `patch` is used as a context manager the created
    mock is returned by the context manager.

    `target` should be a string in the form `'package.module.ClassName'`. The
    `target` is imported and the specified object replaced with the `new`
    object, so the `target` must be importable from the environment you are
    calling `patch` from. The target is imported when the decorated function
    is executed, not at decoration time.

    The `spec` and `spec_set` keyword arguments are passed to the `MagicMock`
    if patch is creating one for you.

    In addition you can pass `spec=True` or `spec_set=True`, which causes
    patch to pass in the object being mocked as the spec/spec_set object.

    `new_callable` allows you to specify a different class, or callable object,
    that will be called to create the `new` object. By default `AsyncMock` is
    used for async functions and `MagicMock` for the rest.

    A more powerful form of `spec` is `autospec`. If you set `autospec=True`
    then the mock will be created with a spec from the object being replaced.
    All attributes of the mock will also have the spec of the corresponding
    attribute of the object being replaced. Methods and functions being
    mocked will have their arguments checked and will raise a `TypeError` if
    they are called with the wrong signature. For mocks replacing a class,
    their return value (the 'instance') will have the same spec as the class.

    Instead of `autospec=True` you can pass `autospec=some_object` to use an
    arbitrary object as the spec instead of the one being replaced.

    By default `patch` will fail to replace attributes that don't exist. If
    you pass in `create=True`, and the attribute doesn't exist, patch will
    create the attribute for you when the patched function is called, and
    delete it again afterwards. This is useful for writing tests against
    attributes that your production code creates at runtime. It is off by
    default because it can be dangerous. With it switched on you can write
    passing tests against APIs that don't actually exist!

    Patch can be used as a `TestCase` class decorator. It works by
    decorating each test method in the class. This reduces the boilerplate
    code when your test methods share a common patchings set. `patch` finds
    tests by looking for method names that start with `patch.TEST_PREFIX`.
    By default this is `test`, which matches the way `unittest` finds tests.
    You can specify an alternative prefix by setting `patch.TEST_PREFIX`.

    Patch can be used as a context manager, with the with statement. Here the
    patching applies to the indented block after the with statement. If you
    use "as" then the patched object will be bound to the name after the
    "as"; very useful if `patch` is creating a mock object for you.

    `patch` takes arbitrary keyword arguments. These will be passed to
    the `Mock` (or `new_callable`) on construction.

    `patch.dict(...)`, `patch.multiple(...)` and `patch.object(...)` are
    available for alternate use-cases.
    """
    getter, attribute = _get_target(target)
    return _patch(
        getter, attribute, new, spec, create,
        spec_set, autospec, new_callable, kwargs
    )


class _patch_dict(object):
    """
    Patch a dictionary, or dictionary like object, and restore the dictionary
    to its original state after the test.

    `in_dict` can be a dictionary or a mapping like container. If it is a
    mapping then it must at least support getting, setting and deleting items
    plus iterating over keys.

    `in_dict` can also be a string specifying the name of the dictionary, which
    will then be fetched by importing it.

    `values` can be a dictionary of values to set in the dictionary. `values`
    can also be an iterable of `(key, value)` pairs.

    If `clear` is True then the dictionary will be cleared before the new
    values are set.

    `patch.dict` can also be called with arbitrary keyword arguments to set
    values in the dictionary::

        with patch.dict('sys.modules', mymodule=Mock(), other_module=Mock()):
            ...

    `patch.dict` can be used as a context manager, decorator or class
    decorator. When used as a class decorator `patch.dict` honours
    `patch.TEST_PREFIX` for choosing which methods to wrap.
    """

    def __init__(self, in_dict, values=(), clear=False, **kwargs):
        self.in_dict = in_dict
        # support any argument supported by dict(...) constructor
        self.values = dict(values)
        self.values.update(kwargs)
        self.clear = clear
        self._original = None


    def __call__(self, f):
        if isinstance(f, type):
            return self.decorate_class(f)
        @wraps(f)
        def _inner(*args, **kw):
            self._patch_dict()
            try:
                return f(*args, **kw)
            finally:
                self._unpatch_dict()

        return _inner


    def decorate_class(self, klass):
        for attr in dir(klass):
            attr_value = getattr(klass, attr)
            if (attr.startswith(patch.TEST_PREFIX) and
                 hasattr(attr_value, "__call__")):
                decorator = _patch_dict(self.in_dict, self.values, self.clear)
                decorated = decorator(attr_value)
                setattr(klass, attr, decorated)
        return klass


    def __enter__(self):
        """Patch the dict."""
        self._patch_dict()
        return self.in_dict


    def _patch_dict(self):
        values = self.values
        if isinstance(self.in_dict, str):
            self.in_dict = _importer(self.in_dict)
        in_dict = self.in_dict
        clear = self.clear

        try:
            original = in_dict.copy()
        except AttributeError:
            # dict like object with no copy method
            # must support iteration over keys
            original = {}
            for key in in_dict:
                original[key] = in_dict[key]
        self._original = original

        if clear:
            _clear_dict(in_dict)

        try:
            in_dict.update(values)
        except AttributeError:
            # dict like object with no update method
            for key in values:
                in_dict[key] = values[key]


    def _unpatch_dict(self):
        in_dict = self.in_dict
        original = self._original

        _clear_dict(in_dict)

        try:
            in_dict.update(original)
        except AttributeError:
            for key in original:
                in_dict[key] = original[key]


    def __exit__(self, *args):
        """Unpatch the dict."""
        self._unpatch_dict()
        return False

    start = __enter__
    stop = __exit__


def _clear_dict(in_dict):
    try:
        in_dict.clear()
    except AttributeError:
        keys = list(in_dict)
        for key in keys:
            del in_dict[key]


def _patch_stopall():
    """Stop all active patches. LIFO to unroll nested patches."""
    for patch in reversed(_patch._active_patches):
        patch.stop()


patch.object = _patch_object
patch.dict = _patch_dict
patch.multiple = _patch_multiple
patch.stopall = _patch_stopall
patch.TEST_PREFIX = 'test'

magic_methods = (
    "lt le gt ge eq ne "
    "getitem setitem delitem "
    "len contains iter "
    "hash str sizeof "
    "enter exit "
    # we added divmod and rdivmod here instead of numerics
    # because there is no idivmod
    "divmod rdivmod neg pos abs invert "
    "complex int float index "
    "round trunc floor ceil "
    "bool next "
    "fspath "
    "aiter "
)

numerics = (
    "add sub mul matmul div floordiv mod lshift rshift and xor or pow truediv"
)
inplace = ' '.join('i%s' % n for n in numerics.split())
right = ' '.join('r%s' % n for n in numerics.split())

# not including __prepare__, __instancecheck__, __subclasscheck__
# (as they are metaclass methods)
# __del__ is not supported at all as it causes problems if it exists

_non_defaults = {
    '__get__', '__set__', '__delete__', '__reversed__', '__missing__',
    '__reduce__', '__reduce_ex__', '__getinitargs__', '__getnewargs__',
    '__getstate__', '__setstate__', '__getformat__', '__setformat__',
    '__repr__', '__dir__', '__subclasses__', '__format__',
    '__getnewargs_ex__',
}


def _get_method(name, func):
    "Turns a callable object (like a mock) into a real function"
    def method(self, /, *args, **kw):
        return func(self, *args, **kw)
    method.__name__ = name
    return method


_magics = {
    '__%s__' % method for method in
    ' '.join([magic_methods, numerics, inplace, right]).split()
}

# Magic methods used for async `with` statements
_async_method_magics = {"__aenter__", "__aexit__", "__anext__"}
# Magic methods that are only used with async calls but are synchronous functions themselves
_sync_async_magics = {"__aiter__"}
_async_magics = _async_method_magics | _sync_async_magics

_all_sync_magics = _magics | _non_defaults
_all_magics = _all_sync_magics | _async_magics

_unsupported_magics = {
    '__getattr__', '__setattr__',
    '__init__', '__new__', '__prepare__',
    '__instancecheck__', '__subclasscheck__',
    '__del__'
}

_calculate_return_value = {
    '__hash__': lambda self: object.__hash__(self),
    '__str__': lambda self: object.__str__(self),
    '__sizeof__': lambda self: object.__sizeof__(self),
    '__fspath__': lambda self: f"{type(self).__name__}/{self._extract_mock_name()}/{id(self)}",
}

_return_values = {
    '__lt__': NotImplemented,
    '__gt__': NotImplemented,
    '__le__': NotImplemented,
    '__ge__': NotImplemented,
    '__int__': 1,
    '__contains__': False,
    '__len__': 0,
    '__exit__': False,
    '__complex__': 1j,
    '__float__': 1.0,
    '__bool__': True,
    '__index__': 1,
    '__aexit__': False,
}


def _get_eq(self):
    def __eq__(other):
        ret_val = self.__eq__._mock_return_value
        if ret_val is not DEFAULT:
            return ret_val
        if self is other:
            return True
        return NotImplemented
    return __eq__

def _get_ne(self):
    def __ne__(other):
        if self.__ne__._mock_return_value is not DEFAULT:
            return DEFAULT
        if self is other:
            return False
        return NotImplemented
    return __ne__

def _get_iter(self):
    def __iter__():
        ret_val = self.__iter__._mock_return_value
        if ret_val is DEFAULT:
            return iter([])
        # if ret_val was already an iterator, then calling iter on it should
        # return the iterator unchanged
        return iter(ret_val)
    return __iter__

def _get_async_iter(self):
    def __aiter__():
        ret_val = self.__aiter__._mock_return_value
        if ret_val is DEFAULT:
            return _AsyncIterator(iter([]))
        return _AsyncIterator(iter(ret_val))
    return __aiter__

_side_effect_methods = {
    '__eq__': _get_eq,
    '__ne__': _get_ne,
    '__iter__': _get_iter,
    '__aiter__': _get_async_iter
}



def _set_return_value(mock, method, name):
    fixed = _return_values.get(name, DEFAULT)
    if fixed is not DEFAULT:
        method.return_value = fixed
        return

    return_calculator = _calculate_return_value.get(name)
    if return_calculator is not None:
        return_value = return_calculator(mock)
        method.return_value = return_value
        return

    side_effector = _side_effect_methods.get(name)
    if side_effector is not None:
        method.side_effect = side_effector(mock)



class MagicMixin(Base):
    def __init__(self, /, *args, **kw):
        self._mock_set_magics()  # make magic work for kwargs in init
        _safe_super(MagicMixin, self).__init__(*args, **kw)
        self._mock_set_magics()  # fix magic broken by upper level init


    def _mock_set_magics(self):
        orig_magics = _magics | _async_method_magics
        these_magics = orig_magics

        if getattr(self, "_mock_methods", None) is not None:
            these_magics = orig_magics.intersection(self._mock_methods)

            remove_magics = set()
            remove_magics = orig_magics - these_magics

            for entry in remove_magics:
                if entry in type(self).__dict__:
                    # remove unneeded magic methods
                    delattr(self, entry)

        # don't overwrite existing attributes if called a second time
        these_magics = these_magics - set(type(self).__dict__)

        _type = type(self)
        for entry in these_magics:
            setattr(_type, entry, MagicProxy(entry, self))



class NonCallableMagicMock(MagicMixin, NonCallableMock):
    """A version of `MagicMock` that isn't callable."""
    def mock_add_spec(self, spec, spec_set=False):
        """Add a spec to a mock. `spec` can either be an object or a
        list of strings. Only attributes on the `spec` can be fetched as
        attributes from the mock.

        If `spec_set` is True then only attributes on the spec can be set."""
        self._mock_add_spec(spec, spec_set)
        self._mock_set_magics()


class AsyncMagicMixin(MagicMixin):
    def __init__(self, /, *args, **kw):
        self._mock_set_magics()  # make magic work for kwargs in init
        _safe_super(AsyncMagicMixin, self).__init__(*args, **kw)
        self._mock_set_magics()  # fix magic broken by upper level init

class MagicMock(MagicMixin, Mock):
    """
    MagicMock is a subclass of Mock with default implementations
    of most of the magic methods. You can use MagicMock without having to
    configure the magic methods yourself.

    If you use the `spec` or `spec_set` arguments then *only* magic
    methods that exist in the spec will be created.

    Attributes and the return value of a `MagicMock` will also be `MagicMocks`.
    """
    def mock_add_spec(self, spec, spec_set=False):
        """Add a spec to a mock. `spec` can either be an object or a
        list of strings. Only attributes on the `spec` can be fetched as
        attributes from the mock.

        If `spec_set` is True then only attributes on the spec can be set."""
        self._mock_add_spec(spec, spec_set)
        self._mock_set_magics()



class MagicProxy(Base):
    def __init__(self, name, parent):
        self.name = name
        self.parent = parent

    def create_mock(self):
        entry = self.name
        parent = self.parent
        m = parent._get_child_mock(name=entry, _new_name=entry,
                                   _new_parent=parent)
        setattr(parent, entry, m)
        _set_return_value(parent, m, entry)
        return m

    def __get__(self, obj, _type=None):
        return self.create_mock()


class AsyncMockMixin(Base):
    await_count = _delegating_property('await_count')
    await_args = _delegating_property('await_args')
    await_args_list = _delegating_property('await_args_list')

    def __init__(self, /, *args, **kwargs):
        super().__init__(*args, **kwargs)
        # asyncio.iscoroutinefunction() checks _is_coroutine property to say if an
        # object is a coroutine. Without this check it looks to see if it is a
        # function/method, which in this case it is not (since it is an
        # AsyncMock).
        # It is set through __dict__ because when spec_set is True, this
        # attribute is likely undefined.
        self.__dict__['_is_coroutine'] = asyncio.coroutines._is_coroutine
        self.__dict__['_mock_await_count'] = 0
        self.__dict__['_mock_await_args'] = None
        self.__dict__['_mock_await_args_list'] = _CallList()
        code_mock = NonCallableMock(spec_set=CodeType)
        code_mock.co_flags = inspect.CO_COROUTINE
        self.__dict__['__code__'] = code_mock

    async def _execute_mock_call(self, /, *args, **kwargs):
        # This is nearly just like super(), except for sepcial handling
        # of coroutines

        _call = _Call((args, kwargs), two=True)
        self.await_count += 1
        self.await_args = _call
        self.await_args_list.append(_call)

        effect = self.side_effect
        if effect is not None:
            if _is_exception(effect):
                raise effect
            elif not _callable(effect):
                try:
                    result = next(effect)
                except StopIteration:
                    # It is impossible to propogate a StopIteration
                    # through coroutines because of PEP 479
                    raise StopAsyncIteration
                if _is_exception(result):
                    raise result
            elif asyncio.iscoroutinefunction(effect):
                result = await effect(*args, **kwargs)
            else:
                result = effect(*args, **kwargs)

            if result is not DEFAULT:
                return result

        if self._mock_return_value is not DEFAULT:
            return self.return_value

        if self._mock_wraps is not None:
            if asyncio.iscoroutinefunction(self._mock_wraps):
                return await self._mock_wraps(*args, **kwargs)
            return self._mock_wraps(*args, **kwargs)

        return self.return_value

    def assert_awaited(self):
        """
        Assert that the mock was awaited at least once.
        """
        if self.await_count == 0:
            msg = f"Expected {self._mock_name or 'mock'} to have been awaited."
            raise AssertionError(msg)

    def assert_awaited_once(self):
        """
        Assert that the mock was awaited exactly once.
        """
        if not self.await_count == 1:
            msg = (f"Expected {self._mock_name or 'mock'} to have been awaited once."
                   f" Awaited {self.await_count} times.")
            raise AssertionError(msg)

    def assert_awaited_with(self, /, *args, **kwargs):
        """
        Assert that the last await was with the specified arguments.
        """
        if self.await_args is None:
            expected = self._format_mock_call_signature(args, kwargs)
            raise AssertionError(f'Expected await: {expected}\nNot awaited')

        def _error_message():
            msg = self._format_mock_failure_message(args, kwargs, action='await')
            return msg

        expected = self._call_matcher((args, kwargs))
        actual = self._call_matcher(self.await_args)
        if expected != actual:
            cause = expected if isinstance(expected, Exception) else None
            raise AssertionError(_error_message()) from cause

    def assert_awaited_once_with(self, /, *args, **kwargs):
        """
        Assert that the mock was awaited exactly once and with the specified
        arguments.
        """
        if not self.await_count == 1:
            msg = (f"Expected {self._mock_name or 'mock'} to have been awaited once."
                   f" Awaited {self.await_count} times.")
            raise AssertionError(msg)
        return self.assert_awaited_with(*args, **kwargs)

    def assert_any_await(self, /, *args, **kwargs):
        """
        Assert the mock has ever been awaited with the specified arguments.
        """
        expected = self._call_matcher((args, kwargs))
        actual = [self._call_matcher(c) for c in self.await_args_list]
        if expected not in actual:
            cause = expected if isinstance(expected, Exception) else None
            expected_string = self._format_mock_call_signature(args, kwargs)
            raise AssertionError(
                '%s await not found' % expected_string
            ) from cause

    def assert_has_awaits(self, calls, any_order=False):
        """
        Assert the mock has been awaited with the specified calls.
        The :attr:`await_args_list` list is checked for the awaits.

        If `any_order` is False (the default) then the awaits must be
        sequential. There can be extra calls before or after the
        specified awaits.

        If `any_order` is True then the awaits can be in any order, but
        they must all appear in :attr:`await_args_list`.
        """
        expected = [self._call_matcher(c) for c in calls]
        cause = next((e for e in expected if isinstance(e, Exception)), None)
        all_awaits = _CallList(self._call_matcher(c) for c in self.await_args_list)
        if not any_order:
            if expected not in all_awaits:
                if cause is None:
                    problem = 'Awaits not found.'
                else:
                    problem = ('Error processing expected awaits.\n'
                               'Errors: {}').format(
                                   [e if isinstance(e, Exception) else None
                                    for e in expected])
                raise AssertionError(
                    f'{problem}\n'
                    f'Expected: {_CallList(calls)}\n'
                    f'Actual: {self.await_args_list}'
                ) from cause
            return

        all_awaits = list(all_awaits)

        not_found = []
        for kall in expected:
            try:
                all_awaits.remove(kall)
            except ValueError:
                not_found.append(kall)
        if not_found:
            raise AssertionError(
                '%r not all found in await list' % (tuple(not_found),)
            ) from cause

    def assert_not_awaited(self):
        """
        Assert that the mock was never awaited.
        """
        if self.await_count != 0:
            msg = (f"Expected {self._mock_name or 'mock'} to not have been awaited."
                   f" Awaited {self.await_count} times.")
            raise AssertionError(msg)

    def reset_mock(self, /, *args, **kwargs):
        """
        See :func:`.Mock.reset_mock()`
        """
        super().reset_mock(*args, **kwargs)
        self.await_count = 0
        self.await_args = None
        self.await_args_list = _CallList()


class AsyncMock(AsyncMockMixin, AsyncMagicMixin, Mock):
    """
    Enhance :class:`Mock` with features allowing to mock
    an async function.

    The :class:`AsyncMock` object will behave so the object is
    recognized as an async function, and the result of a call is an awaitable:

    >>> mock = AsyncMock()
    >>> asyncio.iscoroutinefunction(mock)
    True
    >>> inspect.isawaitable(mock())
    True


    The result of ``mock()`` is an async function which will have the outcome
    of ``side_effect`` or ``return_value``:

    - if ``side_effect`` is a function, the async function will return the
      result of that function,
    - if ``side_effect`` is an exception, the async function will raise the
      exception,
    - if ``side_effect`` is an iterable, the async function will return the
      next value of the iterable, however, if the sequence of result is
      exhausted, ``StopIteration`` is raised immediately,
    - if ``side_effect`` is not defined, the async function will return the
      value defined by ``return_value``, hence, by default, the async function
      returns a new :class:`AsyncMock` object.

    If the outcome of ``side_effect`` or ``return_value`` is an async function,
    the mock async function obtained when the mock object is called will be this
    async function itself (and not an async function returning an async
    function).

    The test author can also specify a wrapped object with ``wraps``. In this
    case, the :class:`Mock` object behavior is the same as with an
    :class:`.Mock` object: the wrapped object may have methods
    defined as async function functions.

    Based on Martin Richard's asynctest project.
    """


class _ANY(object):
    "A helper object that compares equal to everything."

    def __eq__(self, other):
        return True

    def __ne__(self, other):
        return False

    def __repr__(self):
        return '<ANY>'

ANY = _ANY()



def _format_call_signature(name, args, kwargs):
    message = '%s(%%s)' % name
    formatted_args = ''
    args_string = ', '.join([repr(arg) for arg in args])
    kwargs_string = ', '.join([
        '%s=%r' % (key, value) for key, value in kwargs.items()
    ])
    if args_string:
        formatted_args = args_string
    if kwargs_string:
        if formatted_args:
            formatted_args += ', '
        formatted_args += kwargs_string

    return message % formatted_args



class _Call(tuple):
    """
    A tuple for holding the results of a call to a mock, either in the form
    `(args, kwargs)` or `(name, args, kwargs)`.

    If args or kwargs are empty then a call tuple will compare equal to
    a tuple without those values. This makes comparisons less verbose::

        _Call(('name', (), {})) == ('name',)
        _Call(('name', (1,), {})) == ('name', (1,))
        _Call(((), {'a': 'b'})) == ({'a': 'b'},)

    The `_Call` object provides a useful shortcut for comparing with call::

        _Call(((1, 2), {'a': 3})) == call(1, 2, a=3)
        _Call(('foo', (1, 2), {'a': 3})) == call.foo(1, 2, a=3)

    If the _Call has no name then it will match any name.
    """
    def __new__(cls, value=(), name='', parent=None, two=False,
                from_kall=True):
        args = ()
        kwargs = {}
        _len = len(value)
        if _len == 3:
            name, args, kwargs = value
        elif _len == 2:
            first, second = value
            if isinstance(first, str):
                name = first
                if isinstance(second, tuple):
                    args = second
                else:
                    kwargs = second
            else:
                args, kwargs = first, second
        elif _len == 1:
            value, = value
            if isinstance(value, str):
                name = value
            elif isinstance(value, tuple):
                args = value
            else:
                kwargs = value

        if two:
            return tuple.__new__(cls, (args, kwargs))

        return tuple.__new__(cls, (name, args, kwargs))


    def __init__(self, value=(), name=None, parent=None, two=False,
                 from_kall=True):
        self._mock_name = name
        self._mock_parent = parent
        self._mock_from_kall = from_kall


    def __eq__(self, other):
        if other is ANY:
            return True
        try:
            len_other = len(other)
        except TypeError:
            return False

        self_name = ''
        if len(self) == 2:
            self_args, self_kwargs = self
        else:
            self_name, self_args, self_kwargs = self

        if (getattr(self, '_mock_parent', None) and getattr(other, '_mock_parent', None)
                and self._mock_parent != other._mock_parent):
            return False

        other_name = ''
        if len_other == 0:
            other_args, other_kwargs = (), {}
        elif len_other == 3:
            other_name, other_args, other_kwargs = other
        elif len_other == 1:
            value, = other
            if isinstance(value, tuple):
                other_args = value
                other_kwargs = {}
            elif isinstance(value, str):
                other_name = value
                other_args, other_kwargs = (), {}
            else:
                other_args = ()
                other_kwargs = value
        elif len_other == 2:
            # could be (name, args) or (name, kwargs) or (args, kwargs)
            first, second = other
            if isinstance(first, str):
                other_name = first
                if isinstance(second, tuple):
                    other_args, other_kwargs = second, {}
                else:
                    other_args, other_kwargs = (), second
            else:
                other_args, other_kwargs = first, second
        else:
            return False

        if self_name and other_name != self_name:
            return False

        # this order is important for ANY to work!
        return (other_args, other_kwargs) == (self_args, self_kwargs)


    __ne__ = object.__ne__


    def __call__(self, /, *args, **kwargs):
        if self._mock_name is None:
            return _Call(('', args, kwargs), name='()')

        name = self._mock_name + '()'
        return _Call((self._mock_name, args, kwargs), name=name, parent=self)


    def __getattr__(self, attr):
        if self._mock_name is None:
            return _Call(name=attr, from_kall=False)
        name = '%s.%s' % (self._mock_name, attr)
        return _Call(name=name, parent=self, from_kall=False)


    def __getattribute__(self, attr):
        if attr in tuple.__dict__:
            raise AttributeError
        return tuple.__getattribute__(self, attr)


    def count(self, /, *args, **kwargs):
        return self.__getattr__('count')(*args, **kwargs)

    def index(self, /, *args, **kwargs):
        return self.__getattr__('index')(*args, **kwargs)

    def _get_call_arguments(self):
        if len(self) == 2:
            args, kwargs = self
        else:
            name, args, kwargs = self

        return args, kwargs

    @property
    def args(self):
        return self._get_call_arguments()[0]

    @property
    def kwargs(self):
        return self._get_call_arguments()[1]

    def __repr__(self):
        if not self._mock_from_kall:
            name = self._mock_name or 'call'
            if name.startswith('()'):
                name = 'call%s' % name
            return name

        if len(self) == 2:
            name = 'call'
            args, kwargs = self
        else:
            name, args, kwargs = self
            if not name:
                name = 'call'
            elif not name.startswith('()'):
                name = 'call.%s' % name
            else:
                name = 'call%s' % name
        return _format_call_signature(name, args, kwargs)


    def call_list(self):
        """For a call object that represents multiple calls, `call_list`
        returns a list of all the intermediate calls as well as the
        final call."""
        vals = []
        thing = self
        while thing is not None:
            if thing._mock_from_kall:
                vals.append(thing)
            thing = thing._mock_parent
        return _CallList(reversed(vals))


call = _Call(from_kall=False)


def create_autospec(spec, spec_set=False, instance=False, _parent=None,
                    _name=None, **kwargs):
    """Create a mock object using another object as a spec. Attributes on the
    mock will use the corresponding attribute on the `spec` object as their
    spec.

    Functions or methods being mocked will have their arguments checked
    to check that they are called with the correct signature.

    If `spec_set` is True then attempting to set attributes that don't exist
    on the spec object will raise an `AttributeError`.

    If a class is used as a spec then the return value of the mock (the
    instance of the class) will have the same spec. You can use a class as the
    spec for an instance object by passing `instance=True`. The returned mock
    will only be callable if instances of the mock are callable.

    `create_autospec` also takes arbitrary keyword arguments that are passed to
    the constructor of the created mock."""
    if _is_list(spec):
        # can't pass a list instance to the mock constructor as it will be
        # interpreted as a list of strings
        spec = type(spec)

    is_type = isinstance(spec, type)
    is_async_func = _is_async_func(spec)
    _kwargs = {'spec': spec}
    if spec_set:
        _kwargs = {'spec_set': spec}
    elif spec is None:
        # None we mock with a normal mock without a spec
        _kwargs = {}
    if _kwargs and instance:
        _kwargs['_spec_as_instance'] = True

    _kwargs.update(kwargs)

    Klass = MagicMock
    if inspect.isdatadescriptor(spec):
        # descriptors don't have a spec
        # because we don't know what type they return
        _kwargs = {}
    elif is_async_func:
        if instance:
            raise RuntimeError("Instance can not be True when create_autospec "
                               "is mocking an async function")
        Klass = AsyncMock
    elif not _callable(spec):
        Klass = NonCallableMagicMock
    elif is_type and instance and not _instance_callable(spec):
        Klass = NonCallableMagicMock

    _name = _kwargs.pop('name', _name)

    _new_name = _name
    if _parent is None:
        # for a top level object no _new_name should be set
        _new_name = ''

    mock = Klass(parent=_parent, _new_parent=_parent, _new_name=_new_name,
                 name=_name, **_kwargs)

    if isinstance(spec, FunctionTypes):
        # should only happen at the top level because we don't
        # recurse for functions
        mock = _set_signature(mock, spec)
        if is_async_func:
            _setup_async_mock(mock)
    else:
        _check_signature(spec, mock, is_type, instance)

    if _parent is not None and not instance:
        _parent._mock_children[_name] = mock

    if is_type and not instance and 'return_value' not in kwargs:
        mock.return_value = create_autospec(spec, spec_set, instance=True,
                                            _name='()', _parent=mock)

    for entry in dir(spec):
        if _is_magic(entry):
            # MagicMock already does the useful magic methods for us
            continue

        # XXXX do we need a better way of getting attributes without
        # triggering code execution (?) Probably not - we need the actual
        # object to mock it so we would rather trigger a property than mock
        # the property descriptor. Likewise we want to mock out dynamically
        # provided attributes.
        # XXXX what about attributes that raise exceptions other than
        # AttributeError on being fetched?
        # we could be resilient against it, or catch and propagate the
        # exception when the attribute is fetched from the mock
        try:
            original = getattr(spec, entry)
        except AttributeError:
            continue

        kwargs = {'spec': original}
        if spec_set:
            kwargs = {'spec_set': original}

        if not isinstance(original, FunctionTypes):
            new = _SpecState(original, spec_set, mock, entry, instance)
            mock._mock_children[entry] = new
        else:
            parent = mock
            if isinstance(spec, FunctionTypes):
                parent = mock.mock

            skipfirst = _must_skip(spec, entry, is_type)
            kwargs['_eat_self'] = skipfirst
            if asyncio.iscoroutinefunction(original):
                child_klass = AsyncMock
            else:
                child_klass = MagicMock
            new = child_klass(parent=parent, name=entry, _new_name=entry,
                              _new_parent=parent,
                              **kwargs)
            mock._mock_children[entry] = new
            _check_signature(original, new, skipfirst=skipfirst)

        # so functions created with _set_signature become instance attributes,
        # *plus* their underlying mock exists in _mock_children of the parent
        # mock. Adding to _mock_children may be unnecessary where we are also
        # setting as an instance attribute?
        if isinstance(new, FunctionTypes):
            setattr(mock, entry, new)

    return mock


def _must_skip(spec, entry, is_type):
    """
    Return whether we should skip the first argument on spec's `entry`
    attribute.
    """
    if not isinstance(spec, type):
        if entry in getattr(spec, '__dict__', {}):
            # instance attribute - shouldn't skip
            return False
        spec = spec.__class__

    for klass in spec.__mro__:
        result = klass.__dict__.get(entry, DEFAULT)
        if result is DEFAULT:
            continue
        if isinstance(result, (staticmethod, classmethod)):
            return False
        elif isinstance(result, FunctionTypes):
            # Normal method => skip if looked up on type
            # (if looked up on instance, self is already skipped)
            return is_type
        else:
            return False

    # function is a dynamically provided attribute
    return is_type


class _SpecState(object):

    def __init__(self, spec, spec_set=False, parent=None,
                 name=None, ids=None, instance=False):
        self.spec = spec
        self.ids = ids
        self.spec_set = spec_set
        self.parent = parent
        self.instance = instance
        self.name = name


FunctionTypes = (
    # python function
    type(create_autospec),
    # instance method
    type(ANY.__eq__),
)


file_spec = None


def _to_stream(read_data):
    if isinstance(read_data, bytes):
        return io.BytesIO(read_data)
    else:
        return io.StringIO(read_data)


def mock_open(mock=None, read_data=''):
    """
    A helper function to create a mock to replace the use of `open`. It works
    for `open` called directly or used as a context manager.

    The `mock` argument is the mock object to configure. If `None` (the
    default) then a `MagicMock` will be created for you, with the API limited
    to methods or attributes available on standard file handles.

    `read_data` is a string for the `read`, `readline` and `readlines` of the
    file handle to return.  This is an empty string by default.
    """
    _read_data = _to_stream(read_data)
    _state = [_read_data, None]

    def _readlines_side_effect(*args, **kwargs):
        if handle.readlines.return_value is not None:
            return handle.readlines.return_value
        return _state[0].readlines(*args, **kwargs)

    def _read_side_effect(*args, **kwargs):
        if handle.read.return_value is not None:
            return handle.read.return_value
        return _state[0].read(*args, **kwargs)

    def _readline_side_effect(*args, **kwargs):
        yield from _iter_side_effect()
        while True:
            yield _state[0].readline(*args, **kwargs)

    def _iter_side_effect():
        if handle.readline.return_value is not None:
            while True:
                yield handle.readline.return_value
        for line in _state[0]:
            yield line

    def _next_side_effect():
        if handle.readline.return_value is not None:
            return handle.readline.return_value
        return next(_state[0])

    global file_spec
    if file_spec is None:
        import _io
        file_spec = list(set(dir(_io.TextIOWrapper)).union(set(dir(_io.BytesIO))))

    if mock is None:
        mock = MagicMock(name='open', spec=open)

    handle = MagicMock(spec=file_spec)
    handle.__enter__.return_value = handle

    handle.write.return_value = None
    handle.read.return_value = None
    handle.readline.return_value = None
    handle.readlines.return_value = None

    handle.read.side_effect = _read_side_effect
    _state[1] = _readline_side_effect()
    handle.readline.side_effect = _state[1]
    handle.readlines.side_effect = _readlines_side_effect
    handle.__iter__.side_effect = _iter_side_effect
    handle.__next__.side_effect = _next_side_effect

    def reset_data(*args, **kwargs):
        _state[0] = _to_stream(read_data)
        if handle.readline.side_effect == _state[1]:
            # Only reset the side effect if the user hasn't overridden it.
            _state[1] = _readline_side_effect()
            handle.readline.side_effect = _state[1]
        return DEFAULT

    mock.side_effect = reset_data
    mock.return_value = handle
    return mock


class PropertyMock(Mock):
    """
    A mock intended to be used as a property, or other descriptor, on a class.
    `PropertyMock` provides `__get__` and `__set__` methods so you can specify
    a return value when it is fetched.

    Fetching a `PropertyMock` instance from an object calls the mock, with
    no args. Setting it calls the mock with the value being set.
    """
    def _get_child_mock(self, /, **kwargs):
        return MagicMock(**kwargs)

    def __get__(self, obj, obj_type=None):
        return self()
    def __set__(self, obj, val):
        self(val)


def seal(mock):
    """Disable the automatic generation of child mocks.

    Given an input Mock, seals it to ensure no further mocks will be generated
    when accessing an attribute that was not already defined.

    The operation recursively seals the mock passed in, meaning that
    the mock itself, any mocks generated by accessing one of its attributes,
    and all assigned mocks without a name or spec will be sealed.
    """
    mock._mock_sealed = True
    for attr in dir(mock):
        try:
            m = getattr(mock, attr)
        except AttributeError:
            continue
        if not isinstance(m, NonCallableMock):
            continue
        if m._mock_new_parent is mock:
            seal(m)


class _AsyncIterator:
    """
    Wraps an iterator in an asynchronous iterator.
    """
    def __init__(self, iterator):
        self.iterator = iterator
        code_mock = NonCallableMock(spec_set=CodeType)
        code_mock.co_flags = inspect.CO_ITERABLE_COROUTINE
        self.__dict__['__code__'] = code_mock

    def __aiter__(self):
        return self

    async def __anext__(self):
        try:
            return next(self.iterator)
        except StopIteration:
            pass
        raise StopAsyncIteration
unittest/__main__.py000064400000000730151153537550010527 0ustar00"""Main entry point"""

import sys
if sys.argv[0].endswith("__main__.py"):
    import os.path
    # We change sys.argv[0] to make help message more useful
    # use executable without path, unquoted
    # (it's just a hint anyway)
    # (if you have spaces in your executable you get what you deserve!)
    executable = os.path.basename(sys.executable)
    sys.argv[0] = executable + " -m unittest"
    del os

__unittest = True

from .main import main

main(module=None)
unittest/util.py000064400000012137151153537550007770 0ustar00"""Various utility functions."""

from collections import namedtuple, Counter
from os.path import commonprefix

__unittest = True

_MAX_LENGTH = 80
_PLACEHOLDER_LEN = 12
_MIN_BEGIN_LEN = 5
_MIN_END_LEN = 5
_MIN_COMMON_LEN = 5
_MIN_DIFF_LEN = _MAX_LENGTH - \
               (_MIN_BEGIN_LEN + _PLACEHOLDER_LEN + _MIN_COMMON_LEN +
                _PLACEHOLDER_LEN + _MIN_END_LEN)
assert _MIN_DIFF_LEN >= 0

def _shorten(s, prefixlen, suffixlen):
    skip = len(s) - prefixlen - suffixlen
    if skip > _PLACEHOLDER_LEN:
        s = '%s[%d chars]%s' % (s[:prefixlen], skip, s[len(s) - suffixlen:])
    return s

def _common_shorten_repr(*args):
    args = tuple(map(safe_repr, args))
    maxlen = max(map(len, args))
    if maxlen <= _MAX_LENGTH:
        return args

    prefix = commonprefix(args)
    prefixlen = len(prefix)

    common_len = _MAX_LENGTH - \
                 (maxlen - prefixlen + _MIN_BEGIN_LEN + _PLACEHOLDER_LEN)
    if common_len > _MIN_COMMON_LEN:
        assert _MIN_BEGIN_LEN + _PLACEHOLDER_LEN + _MIN_COMMON_LEN + \
               (maxlen - prefixlen) < _MAX_LENGTH
        prefix = _shorten(prefix, _MIN_BEGIN_LEN, common_len)
        return tuple(prefix + s[prefixlen:] for s in args)

    prefix = _shorten(prefix, _MIN_BEGIN_LEN, _MIN_COMMON_LEN)
    return tuple(prefix + _shorten(s[prefixlen:], _MIN_DIFF_LEN, _MIN_END_LEN)
                 for s in args)

def safe_repr(obj, short=False):
    try:
        result = repr(obj)
    except Exception:
        result = object.__repr__(obj)
    if not short or len(result) < _MAX_LENGTH:
        return result
    return result[:_MAX_LENGTH] + ' [truncated]...'

def strclass(cls):
    return "%s.%s" % (cls.__module__, cls.__qualname__)

def sorted_list_difference(expected, actual):
    """Finds elements in only one or the other of two, sorted input lists.

    Returns a two-element tuple of lists.    The first list contains those
    elements in the "expected" list but not in the "actual" list, and the
    second contains those elements in the "actual" list but not in the
    "expected" list.    Duplicate elements in either input list are ignored.
    """
    i = j = 0
    missing = []
    unexpected = []
    while True:
        try:
            e = expected[i]
            a = actual[j]
            if e < a:
                missing.append(e)
                i += 1
                while expected[i] == e:
                    i += 1
            elif e > a:
                unexpected.append(a)
                j += 1
                while actual[j] == a:
                    j += 1
            else:
                i += 1
                try:
                    while expected[i] == e:
                        i += 1
                finally:
                    j += 1
                    while actual[j] == a:
                        j += 1
        except IndexError:
            missing.extend(expected[i:])
            unexpected.extend(actual[j:])
            break
    return missing, unexpected


def unorderable_list_difference(expected, actual):
    """Same behavior as sorted_list_difference but
    for lists of unorderable items (like dicts).

    As it does a linear search per item (remove) it
    has O(n*n) performance."""
    missing = []
    while expected:
        item = expected.pop()
        try:
            actual.remove(item)
        except ValueError:
            missing.append(item)

    # anything left in actual is unexpected
    return missing, actual

def three_way_cmp(x, y):
    """Return -1 if x < y, 0 if x == y and 1 if x > y"""
    return (x > y) - (x < y)

_Mismatch = namedtuple('Mismatch', 'actual expected value')

def _count_diff_all_purpose(actual, expected):
    'Returns list of (cnt_act, cnt_exp, elem) triples where the counts differ'
    # elements need not be hashable
    s, t = list(actual), list(expected)
    m, n = len(s), len(t)
    NULL = object()
    result = []
    for i, elem in enumerate(s):
        if elem is NULL:
            continue
        cnt_s = cnt_t = 0
        for j in range(i, m):
            if s[j] == elem:
                cnt_s += 1
                s[j] = NULL
        for j, other_elem in enumerate(t):
            if other_elem == elem:
                cnt_t += 1
                t[j] = NULL
        if cnt_s != cnt_t:
            diff = _Mismatch(cnt_s, cnt_t, elem)
            result.append(diff)

    for i, elem in enumerate(t):
        if elem is NULL:
            continue
        cnt_t = 0
        for j in range(i, n):
            if t[j] == elem:
                cnt_t += 1
                t[j] = NULL
        diff = _Mismatch(0, cnt_t, elem)
        result.append(diff)
    return result

def _count_diff_hashable(actual, expected):
    'Returns list of (cnt_act, cnt_exp, elem) triples where the counts differ'
    # elements must be hashable
    s, t = Counter(actual), Counter(expected)
    result = []
    for elem, cnt_s in s.items():
        cnt_t = t.get(elem, 0)
        if cnt_s != cnt_t:
            diff = _Mismatch(cnt_s, cnt_t, elem)
            result.append(diff)
    for elem, cnt_t in t.items():
        if elem not in s:
            diff = _Mismatch(0, cnt_t, elem)
            result.append(diff)
    return result
unittest/__init__.py000064400000006303151153537550010550 0ustar00"""
Python unit testing framework, based on Erich Gamma's JUnit and Kent Beck's
Smalltalk testing framework (used with permission).

This module contains the core framework classes that form the basis of
specific test cases and suites (TestCase, TestSuite etc.), and also a
text-based utility class for running the tests and reporting the results
 (TextTestRunner).

Simple usage:

    import unittest

    class IntegerArithmeticTestCase(unittest.TestCase):
        def testAdd(self):  # test method names begin with 'test'
            self.assertEqual((1 + 2), 3)
            self.assertEqual(0 + 1, 1)
        def testMultiply(self):
            self.assertEqual((0 * 10), 0)
            self.assertEqual((5 * 8), 40)

    if __name__ == '__main__':
        unittest.main()

Further information is available in the bundled documentation, and from

  http://docs.python.org/library/unittest.html

Copyright (c) 1999-2003 Steve Purcell
Copyright (c) 2003-2010 Python Software Foundation
This module is free software, and you may redistribute it and/or modify
it under the same terms as Python itself, so long as this copyright message
and disclaimer are retained in their original form.

IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.

THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE.  THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS,
AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
"""

__all__ = ['TestResult', 'TestCase', 'IsolatedAsyncioTestCase', 'TestSuite',
           'TextTestRunner', 'TestLoader', 'FunctionTestCase', 'main',
           'defaultTestLoader', 'SkipTest', 'skip', 'skipIf', 'skipUnless',
           'expectedFailure', 'TextTestResult', 'installHandler',
           'registerResult', 'removeResult', 'removeHandler',
           'addModuleCleanup']

# Expose obsolete functions for backwards compatibility
__all__.extend(['getTestCaseNames', 'makeSuite', 'findTestCases'])

__unittest = True

from .result import TestResult
from .async_case import IsolatedAsyncioTestCase
from .case import (addModuleCleanup, TestCase, FunctionTestCase, SkipTest, skip,
                   skipIf, skipUnless, expectedFailure)
from .suite import BaseTestSuite, TestSuite
from .loader import (TestLoader, defaultTestLoader, makeSuite, getTestCaseNames,
                     findTestCases)
from .main import TestProgram, main
from .runner import TextTestRunner, TextTestResult
from .signals import installHandler, registerResult, removeResult, removeHandler

# deprecated
_TextTestResult = TextTestResult

# There are no tests here, so don't try to run anything discovered from
# introspecting the symbols (e.g. FunctionTestCase). Instead, all our
# tests come from within unittest.test.
def load_tests(loader, tests, pattern):
    import os.path
    # top level directory cached on loader instance
    this_dir = os.path.dirname(__file__)
    return loader.discover(start_dir=this_dir, pattern=pattern)
unittest/result.py000064400000016422151153537550010332 0ustar00"""Test result object"""

import io
import sys
import traceback

from . import util
from functools import wraps

__unittest = True

def failfast(method):
    @wraps(method)
    def inner(self, *args, **kw):
        if getattr(self, 'failfast', False):
            self.stop()
        return method(self, *args, **kw)
    return inner

STDOUT_LINE = '\nStdout:\n%s'
STDERR_LINE = '\nStderr:\n%s'


class TestResult(object):
    """Holder for test result information.

    Test results are automatically managed by the TestCase and TestSuite
    classes, and do not need to be explicitly manipulated by writers of tests.

    Each instance holds the total number of tests run, and collections of
    failures and errors that occurred among those test runs. The collections
    contain tuples of (testcase, exceptioninfo), where exceptioninfo is the
    formatted traceback of the error that occurred.
    """
    _previousTestClass = None
    _testRunEntered = False
    _moduleSetUpFailed = False
    def __init__(self, stream=None, descriptions=None, verbosity=None):
        self.failfast = False
        self.failures = []
        self.errors = []
        self.testsRun = 0
        self.skipped = []
        self.expectedFailures = []
        self.unexpectedSuccesses = []
        self.shouldStop = False
        self.buffer = False
        self.tb_locals = False
        self._stdout_buffer = None
        self._stderr_buffer = None
        self._original_stdout = sys.stdout
        self._original_stderr = sys.stderr
        self._mirrorOutput = False

    def printErrors(self):
        "Called by TestRunner after test run"

    def startTest(self, test):
        "Called when the given test is about to be run"
        self.testsRun += 1
        self._mirrorOutput = False
        self._setupStdout()

    def _setupStdout(self):
        if self.buffer:
            if self._stderr_buffer is None:
                self._stderr_buffer = io.StringIO()
                self._stdout_buffer = io.StringIO()
            sys.stdout = self._stdout_buffer
            sys.stderr = self._stderr_buffer

    def startTestRun(self):
        """Called once before any tests are executed.

        See startTest for a method called before each test.
        """

    def stopTest(self, test):
        """Called when the given test has been run"""
        self._restoreStdout()
        self._mirrorOutput = False

    def _restoreStdout(self):
        if self.buffer:
            if self._mirrorOutput:
                output = sys.stdout.getvalue()
                error = sys.stderr.getvalue()
                if output:
                    if not output.endswith('\n'):
                        output += '\n'
                    self._original_stdout.write(STDOUT_LINE % output)
                if error:
                    if not error.endswith('\n'):
                        error += '\n'
                    self._original_stderr.write(STDERR_LINE % error)

            sys.stdout = self._original_stdout
            sys.stderr = self._original_stderr
            self._stdout_buffer.seek(0)
            self._stdout_buffer.truncate()
            self._stderr_buffer.seek(0)
            self._stderr_buffer.truncate()

    def stopTestRun(self):
        """Called once after all tests are executed.

        See stopTest for a method called after each test.
        """

    @failfast
    def addError(self, test, err):
        """Called when an error has occurred. 'err' is a tuple of values as
        returned by sys.exc_info().
        """
        self.errors.append((test, self._exc_info_to_string(err, test)))
        self._mirrorOutput = True

    @failfast
    def addFailure(self, test, err):
        """Called when an error has occurred. 'err' is a tuple of values as
        returned by sys.exc_info()."""
        self.failures.append((test, self._exc_info_to_string(err, test)))
        self._mirrorOutput = True

    def addSubTest(self, test, subtest, err):
        """Called at the end of a subtest.
        'err' is None if the subtest ended successfully, otherwise it's a
        tuple of values as returned by sys.exc_info().
        """
        # By default, we don't do anything with successful subtests, but
        # more sophisticated test results might want to record them.
        if err is not None:
            if getattr(self, 'failfast', False):
                self.stop()
            if issubclass(err[0], test.failureException):
                errors = self.failures
            else:
                errors = self.errors
            errors.append((subtest, self._exc_info_to_string(err, test)))
            self._mirrorOutput = True

    def addSuccess(self, test):
        "Called when a test has completed successfully"
        pass

    def addSkip(self, test, reason):
        """Called when a test is skipped."""
        self.skipped.append((test, reason))

    def addExpectedFailure(self, test, err):
        """Called when an expected failure/error occurred."""
        self.expectedFailures.append(
            (test, self._exc_info_to_string(err, test)))

    @failfast
    def addUnexpectedSuccess(self, test):
        """Called when a test was expected to fail, but succeed."""
        self.unexpectedSuccesses.append(test)

    def wasSuccessful(self):
        """Tells whether or not this result was a success."""
        # The hasattr check is for test_result's OldResult test.  That
        # way this method works on objects that lack the attribute.
        # (where would such result intances come from? old stored pickles?)
        return ((len(self.failures) == len(self.errors) == 0) and
                (not hasattr(self, 'unexpectedSuccesses') or
                 len(self.unexpectedSuccesses) == 0))

    def stop(self):
        """Indicates that the tests should be aborted."""
        self.shouldStop = True

    def _exc_info_to_string(self, err, test):
        """Converts a sys.exc_info()-style tuple of values into a string."""
        exctype, value, tb = err
        # Skip test runner traceback levels
        while tb and self._is_relevant_tb_level(tb):
            tb = tb.tb_next

        if exctype is test.failureException:
            # Skip assert*() traceback levels
            length = self._count_relevant_tb_levels(tb)
        else:
            length = None
        tb_e = traceback.TracebackException(
            exctype, value, tb, limit=length, capture_locals=self.tb_locals)
        msgLines = list(tb_e.format())

        if self.buffer:
            output = sys.stdout.getvalue()
            error = sys.stderr.getvalue()
            if output:
                if not output.endswith('\n'):
                    output += '\n'
                msgLines.append(STDOUT_LINE % output)
            if error:
                if not error.endswith('\n'):
                    error += '\n'
                msgLines.append(STDERR_LINE % error)
        return ''.join(msgLines)


    def _is_relevant_tb_level(self, tb):
        return '__unittest' in tb.tb_frame.f_globals

    def _count_relevant_tb_levels(self, tb):
        length = 0
        while tb and not self._is_relevant_tb_level(tb):
            length += 1
            tb = tb.tb_next
        return length

    def __repr__(self):
        return ("<%s run=%i errors=%i failures=%i>" %
               (util.strclass(self.__class__), self.testsRun, len(self.errors),
                len(self.failures)))
unittest/main.py000064400000025746151153537550007751 0ustar00"""Unittest main program"""

import sys
import argparse
import os

from . import loader, runner
from .signals import installHandler

__unittest = True

MAIN_EXAMPLES = """\
Examples:
  %(prog)s test_module               - run tests from test_module
  %(prog)s module.TestClass          - run tests from module.TestClass
  %(prog)s module.Class.test_method  - run specified test method
  %(prog)s path/to/test_file.py      - run tests from test_file.py
"""

MODULE_EXAMPLES = """\
Examples:
  %(prog)s                           - run default set of tests
  %(prog)s MyTestSuite               - run suite 'MyTestSuite'
  %(prog)s MyTestCase.testSomething  - run MyTestCase.testSomething
  %(prog)s MyTestCase                - run all 'test*' test methods
                                       in MyTestCase
"""

def _convert_name(name):
    # on Linux / Mac OS X 'foo.PY' is not importable, but on
    # Windows it is. Simpler to do a case insensitive match
    # a better check would be to check that the name is a
    # valid Python module name.
    if os.path.isfile(name) and name.lower().endswith('.py'):
        if os.path.isabs(name):
            rel_path = os.path.relpath(name, os.getcwd())
            if os.path.isabs(rel_path) or rel_path.startswith(os.pardir):
                return name
            name = rel_path
        # on Windows both '\' and '/' are used as path
        # separators. Better to replace both than rely on os.path.sep
        return name[:-3].replace('\\', '.').replace('/', '.')
    return name

def _convert_names(names):
    return [_convert_name(name) for name in names]


def _convert_select_pattern(pattern):
    if not '*' in pattern:
        pattern = '*%s*' % pattern
    return pattern


class TestProgram(object):
    """A command-line program that runs a set of tests; this is primarily
       for making test modules conveniently executable.
    """
    # defaults for testing
    module=None
    verbosity = 1
    failfast = catchbreak = buffer = progName = warnings = testNamePatterns = None
    _discovery_parser = None

    def __init__(self, module='__main__', defaultTest=None, argv=None,
                    testRunner=None, testLoader=loader.defaultTestLoader,
                    exit=True, verbosity=1, failfast=None, catchbreak=None,
                    buffer=None, warnings=None, *, tb_locals=False):
        if isinstance(module, str):
            self.module = __import__(module)
            for part in module.split('.')[1:]:
                self.module = getattr(self.module, part)
        else:
            self.module = module
        if argv is None:
            argv = sys.argv

        self.exit = exit
        self.failfast = failfast
        self.catchbreak = catchbreak
        self.verbosity = verbosity
        self.buffer = buffer
        self.tb_locals = tb_locals
        if warnings is None and not sys.warnoptions:
            # even if DeprecationWarnings are ignored by default
            # print them anyway unless other warnings settings are
            # specified by the warnings arg or the -W python flag
            self.warnings = 'default'
        else:
            # here self.warnings is set either to the value passed
            # to the warnings args or to None.
            # If the user didn't pass a value self.warnings will
            # be None. This means that the behavior is unchanged
            # and depends on the values passed to -W.
            self.warnings = warnings
        self.defaultTest = defaultTest
        self.testRunner = testRunner
        self.testLoader = testLoader
        self.progName = os.path.basename(argv[0])
        self.parseArgs(argv)
        self.runTests()

    def usageExit(self, msg=None):
        if msg:
            print(msg)
        if self._discovery_parser is None:
            self._initArgParsers()
        self._print_help()
        sys.exit(2)

    def _print_help(self, *args, **kwargs):
        if self.module is None:
            print(self._main_parser.format_help())
            print(MAIN_EXAMPLES % {'prog': self.progName})
            self._discovery_parser.print_help()
        else:
            print(self._main_parser.format_help())
            print(MODULE_EXAMPLES % {'prog': self.progName})

    def parseArgs(self, argv):
        self._initArgParsers()
        if self.module is None:
            if len(argv) > 1 and argv[1].lower() == 'discover':
                self._do_discovery(argv[2:])
                return
            self._main_parser.parse_args(argv[1:], self)
            if not self.tests:
                # this allows "python -m unittest -v" to still work for
                # test discovery.
                self._do_discovery([])
                return
        else:
            self._main_parser.parse_args(argv[1:], self)

        if self.tests:
            self.testNames = _convert_names(self.tests)
            if __name__ == '__main__':
                # to support python -m unittest ...
                self.module = None
        elif self.defaultTest is None:
            # createTests will load tests from self.module
            self.testNames = None
        elif isinstance(self.defaultTest, str):
            self.testNames = (self.defaultTest,)
        else:
            self.testNames = list(self.defaultTest)
        self.createTests()

    def createTests(self, from_discovery=False, Loader=None):
        if self.testNamePatterns:
            self.testLoader.testNamePatterns = self.testNamePatterns
        if from_discovery:
            loader = self.testLoader if Loader is None else Loader()
            self.test = loader.discover(self.start, self.pattern, self.top)
        elif self.testNames is None:
            self.test = self.testLoader.loadTestsFromModule(self.module)
        else:
            self.test = self.testLoader.loadTestsFromNames(self.testNames,
                                                           self.module)

    def _initArgParsers(self):
        parent_parser = self._getParentArgParser()
        self._main_parser = self._getMainArgParser(parent_parser)
        self._discovery_parser = self._getDiscoveryArgParser(parent_parser)

    def _getParentArgParser(self):
        parser = argparse.ArgumentParser(add_help=False)

        parser.add_argument('-v', '--verbose', dest='verbosity',
                            action='store_const', const=2,
                            help='Verbose output')
        parser.add_argument('-q', '--quiet', dest='verbosity',
                            action='store_const', const=0,
                            help='Quiet output')
        parser.add_argument('--locals', dest='tb_locals',
                            action='store_true',
                            help='Show local variables in tracebacks')
        if self.failfast is None:
            parser.add_argument('-f', '--failfast', dest='failfast',
                                action='store_true',
                                help='Stop on first fail or error')
            self.failfast = False
        if self.catchbreak is None:
            parser.add_argument('-c', '--catch', dest='catchbreak',
                                action='store_true',
                                help='Catch Ctrl-C and display results so far')
            self.catchbreak = False
        if self.buffer is None:
            parser.add_argument('-b', '--buffer', dest='buffer',
                                action='store_true',
                                help='Buffer stdout and stderr during tests')
            self.buffer = False
        if self.testNamePatterns is None:
            parser.add_argument('-k', dest='testNamePatterns',
                                action='append', type=_convert_select_pattern,
                                help='Only run tests which match the given substring')
            self.testNamePatterns = []

        return parser

    def _getMainArgParser(self, parent):
        parser = argparse.ArgumentParser(parents=[parent])
        parser.prog = self.progName
        parser.print_help = self._print_help

        parser.add_argument('tests', nargs='*',
                            help='a list of any number of test modules, '
                            'classes and test methods.')

        return parser

    def _getDiscoveryArgParser(self, parent):
        parser = argparse.ArgumentParser(parents=[parent])
        parser.prog = '%s discover' % self.progName
        parser.epilog = ('For test discovery all test modules must be '
                         'importable from the top level directory of the '
                         'project.')

        parser.add_argument('-s', '--start-directory', dest='start',
                            help="Directory to start discovery ('.' default)")
        parser.add_argument('-p', '--pattern', dest='pattern',
                            help="Pattern to match tests ('test*.py' default)")
        parser.add_argument('-t', '--top-level-directory', dest='top',
                            help='Top level directory of project (defaults to '
                                 'start directory)')
        for arg in ('start', 'pattern', 'top'):
            parser.add_argument(arg, nargs='?',
                                default=argparse.SUPPRESS,
                                help=argparse.SUPPRESS)

        return parser

    def _do_discovery(self, argv, Loader=None):
        self.start = '.'
        self.pattern = 'test*.py'
        self.top = None
        if argv is not None:
            # handle command line args for test discovery
            if self._discovery_parser is None:
                # for testing
                self._initArgParsers()
            self._discovery_parser.parse_args(argv, self)

        self.createTests(from_discovery=True, Loader=Loader)

    def runTests(self):
        if self.catchbreak:
            installHandler()
        if self.testRunner is None:
            self.testRunner = runner.TextTestRunner
        if isinstance(self.testRunner, type):
            try:
                try:
                    testRunner = self.testRunner(verbosity=self.verbosity,
                                                 failfast=self.failfast,
                                                 buffer=self.buffer,
                                                 warnings=self.warnings,
                                                 tb_locals=self.tb_locals)
                except TypeError:
                    # didn't accept the tb_locals argument
                    testRunner = self.testRunner(verbosity=self.verbosity,
                                                 failfast=self.failfast,
                                                 buffer=self.buffer,
                                                 warnings=self.warnings)
            except TypeError:
                # didn't accept the verbosity, buffer or failfast arguments
                testRunner = self.testRunner()
        else:
            # it is assumed to be a TestRunner instance
            testRunner = self.testRunner
        self.result = testRunner.run(self.test)
        if self.exit:
            sys.exit(not self.result.wasSuccessful())

main = TestProgram
unittest/case.py000064400000164276151153537550007742 0ustar00"""Test case implementation"""

import sys
import functools
import difflib
import logging
import pprint
import re
import warnings
import collections
import contextlib
import traceback
import types

from . import result
from .util import (strclass, safe_repr, _count_diff_all_purpose,
                   _count_diff_hashable, _common_shorten_repr)

__unittest = True

_subtest_msg_sentinel = object()

DIFF_OMITTED = ('\nDiff is %s characters long. '
                 'Set self.maxDiff to None to see it.')

class SkipTest(Exception):
    """
    Raise this exception in a test to skip it.

    Usually you can use TestCase.skipTest() or one of the skipping decorators
    instead of raising this directly.
    """

class _ShouldStop(Exception):
    """
    The test should stop.
    """

class _UnexpectedSuccess(Exception):
    """
    The test was supposed to fail, but it didn't!
    """


class _Outcome(object):
    def __init__(self, result=None):
        self.expecting_failure = False
        self.result = result
        self.result_supports_subtests = hasattr(result, "addSubTest")
        self.success = True
        self.skipped = []
        self.expectedFailure = None
        self.errors = []

    @contextlib.contextmanager
    def testPartExecutor(self, test_case, isTest=False):
        old_success = self.success
        self.success = True
        try:
            yield
        except KeyboardInterrupt:
            raise
        except SkipTest as e:
            self.success = False
            self.skipped.append((test_case, str(e)))
        except _ShouldStop:
            pass
        except:
            exc_info = sys.exc_info()
            if self.expecting_failure:
                self.expectedFailure = exc_info
            else:
                self.success = False
                self.errors.append((test_case, exc_info))
            # explicitly break a reference cycle:
            # exc_info -> frame -> exc_info
            exc_info = None
        else:
            if self.result_supports_subtests and self.success:
                self.errors.append((test_case, None))
        finally:
            self.success = self.success and old_success


def _id(obj):
    return obj


_module_cleanups = []
def addModuleCleanup(function, /, *args, **kwargs):
    """Same as addCleanup, except the cleanup items are called even if
    setUpModule fails (unlike tearDownModule)."""
    _module_cleanups.append((function, args, kwargs))


def doModuleCleanups():
    """Execute all module cleanup functions. Normally called for you after
    tearDownModule."""
    exceptions = []
    while _module_cleanups:
        function, args, kwargs = _module_cleanups.pop()
        try:
            function(*args, **kwargs)
        except Exception as exc:
            exceptions.append(exc)
    if exceptions:
        # Swallows all but first exception. If a multi-exception handler
        # gets written we should use that here instead.
        raise exceptions[0]


def skip(reason):
    """
    Unconditionally skip a test.
    """
    def decorator(test_item):
        if not isinstance(test_item, type):
            @functools.wraps(test_item)
            def skip_wrapper(*args, **kwargs):
                raise SkipTest(reason)
            test_item = skip_wrapper

        test_item.__unittest_skip__ = True
        test_item.__unittest_skip_why__ = reason
        return test_item
    if isinstance(reason, types.FunctionType):
        test_item = reason
        reason = ''
        return decorator(test_item)
    return decorator

def skipIf(condition, reason):
    """
    Skip a test if the condition is true.
    """
    if condition:
        return skip(reason)
    return _id

def skipUnless(condition, reason):
    """
    Skip a test unless the condition is true.
    """
    if not condition:
        return skip(reason)
    return _id

def expectedFailure(test_item):
    test_item.__unittest_expecting_failure__ = True
    return test_item

def _is_subtype(expected, basetype):
    if isinstance(expected, tuple):
        return all(_is_subtype(e, basetype) for e in expected)
    return isinstance(expected, type) and issubclass(expected, basetype)

class _BaseTestCaseContext:

    def __init__(self, test_case):
        self.test_case = test_case

    def _raiseFailure(self, standardMsg):
        msg = self.test_case._formatMessage(self.msg, standardMsg)
        raise self.test_case.failureException(msg)

class _AssertRaisesBaseContext(_BaseTestCaseContext):

    def __init__(self, expected, test_case, expected_regex=None):
        _BaseTestCaseContext.__init__(self, test_case)
        self.expected = expected
        self.test_case = test_case
        if expected_regex is not None:
            expected_regex = re.compile(expected_regex)
        self.expected_regex = expected_regex
        self.obj_name = None
        self.msg = None

    def handle(self, name, args, kwargs):
        """
        If args is empty, assertRaises/Warns is being used as a
        context manager, so check for a 'msg' kwarg and return self.
        If args is not empty, call a callable passing positional and keyword
        arguments.
        """
        try:
            if not _is_subtype(self.expected, self._base_type):
                raise TypeError('%s() arg 1 must be %s' %
                                (name, self._base_type_str))
            if not args:
                self.msg = kwargs.pop('msg', None)
                if kwargs:
                    raise TypeError('%r is an invalid keyword argument for '
                                    'this function' % (next(iter(kwargs)),))
                return self

            callable_obj, *args = args
            try:
                self.obj_name = callable_obj.__name__
            except AttributeError:
                self.obj_name = str(callable_obj)
            with self:
                callable_obj(*args, **kwargs)
        finally:
            # bpo-23890: manually break a reference cycle
            self = None


class _AssertRaisesContext(_AssertRaisesBaseContext):
    """A context manager used to implement TestCase.assertRaises* methods."""

    _base_type = BaseException
    _base_type_str = 'an exception type or tuple of exception types'

    def __enter__(self):
        return self

    def __exit__(self, exc_type, exc_value, tb):
        if exc_type is None:
            try:
                exc_name = self.expected.__name__
            except AttributeError:
                exc_name = str(self.expected)
            if self.obj_name:
                self._raiseFailure("{} not raised by {}".format(exc_name,
                                                                self.obj_name))
            else:
                self._raiseFailure("{} not raised".format(exc_name))
        else:
            traceback.clear_frames(tb)
        if not issubclass(exc_type, self.expected):
            # let unexpected exceptions pass through
            return False
        # store exception, without traceback, for later retrieval
        self.exception = exc_value.with_traceback(None)
        if self.expected_regex is None:
            return True

        expected_regex = self.expected_regex
        if not expected_regex.search(str(exc_value)):
            self._raiseFailure('"{}" does not match "{}"'.format(
                     expected_regex.pattern, str(exc_value)))
        return True


class _AssertWarnsContext(_AssertRaisesBaseContext):
    """A context manager used to implement TestCase.assertWarns* methods."""

    _base_type = Warning
    _base_type_str = 'a warning type or tuple of warning types'

    def __enter__(self):
        # The __warningregistry__'s need to be in a pristine state for tests
        # to work properly.
        for v in list(sys.modules.values()):
            if getattr(v, '__warningregistry__', None):
                v.__warningregistry__ = {}
        self.warnings_manager = warnings.catch_warnings(record=True)
        self.warnings = self.warnings_manager.__enter__()
        warnings.simplefilter("always", self.expected)
        return self

    def __exit__(self, exc_type, exc_value, tb):
        self.warnings_manager.__exit__(exc_type, exc_value, tb)
        if exc_type is not None:
            # let unexpected exceptions pass through
            return
        try:
            exc_name = self.expected.__name__
        except AttributeError:
            exc_name = str(self.expected)
        first_matching = None
        for m in self.warnings:
            w = m.message
            if not isinstance(w, self.expected):
                continue
            if first_matching is None:
                first_matching = w
            if (self.expected_regex is not None and
                not self.expected_regex.search(str(w))):
                continue
            # store warning for later retrieval
            self.warning = w
            self.filename = m.filename
            self.lineno = m.lineno
            return
        # Now we simply try to choose a helpful failure message
        if first_matching is not None:
            self._raiseFailure('"{}" does not match "{}"'.format(
                     self.expected_regex.pattern, str(first_matching)))
        if self.obj_name:
            self._raiseFailure("{} not triggered by {}".format(exc_name,
                                                               self.obj_name))
        else:
            self._raiseFailure("{} not triggered".format(exc_name))



_LoggingWatcher = collections.namedtuple("_LoggingWatcher",
                                         ["records", "output"])


class _CapturingHandler(logging.Handler):
    """
    A logging handler capturing all (raw and formatted) logging output.
    """

    def __init__(self):
        logging.Handler.__init__(self)
        self.watcher = _LoggingWatcher([], [])

    def flush(self):
        pass

    def emit(self, record):
        self.watcher.records.append(record)
        msg = self.format(record)
        self.watcher.output.append(msg)



class _AssertLogsContext(_BaseTestCaseContext):
    """A context manager used to implement TestCase.assertLogs()."""

    LOGGING_FORMAT = "%(levelname)s:%(name)s:%(message)s"

    def __init__(self, test_case, logger_name, level):
        _BaseTestCaseContext.__init__(self, test_case)
        self.logger_name = logger_name
        if level:
            self.level = logging._nameToLevel.get(level, level)
        else:
            self.level = logging.INFO
        self.msg = None

    def __enter__(self):
        if isinstance(self.logger_name, logging.Logger):
            logger = self.logger = self.logger_name
        else:
            logger = self.logger = logging.getLogger(self.logger_name)
        formatter = logging.Formatter(self.LOGGING_FORMAT)
        handler = _CapturingHandler()
        handler.setFormatter(formatter)
        self.watcher = handler.watcher
        self.old_handlers = logger.handlers[:]
        self.old_level = logger.level
        self.old_propagate = logger.propagate
        logger.handlers = [handler]
        logger.setLevel(self.level)
        logger.propagate = False
        return handler.watcher

    def __exit__(self, exc_type, exc_value, tb):
        self.logger.handlers = self.old_handlers
        self.logger.propagate = self.old_propagate
        self.logger.setLevel(self.old_level)
        if exc_type is not None:
            # let unexpected exceptions pass through
            return False
        if len(self.watcher.records) == 0:
            self._raiseFailure(
                "no logs of level {} or higher triggered on {}"
                .format(logging.getLevelName(self.level), self.logger.name))


class _OrderedChainMap(collections.ChainMap):
    def __iter__(self):
        seen = set()
        for mapping in self.maps:
            for k in mapping:
                if k not in seen:
                    seen.add(k)
                    yield k


class TestCase(object):
    """A class whose instances are single test cases.

    By default, the test code itself should be placed in a method named
    'runTest'.

    If the fixture may be used for many test cases, create as
    many test methods as are needed. When instantiating such a TestCase
    subclass, specify in the constructor arguments the name of the test method
    that the instance is to execute.

    Test authors should subclass TestCase for their own tests. Construction
    and deconstruction of the test's environment ('fixture') can be
    implemented by overriding the 'setUp' and 'tearDown' methods respectively.

    If it is necessary to override the __init__ method, the base class
    __init__ method must always be called. It is important that subclasses
    should not change the signature of their __init__ method, since instances
    of the classes are instantiated automatically by parts of the framework
    in order to be run.

    When subclassing TestCase, you can set these attributes:
    * failureException: determines which exception will be raised when
        the instance's assertion methods fail; test methods raising this
        exception will be deemed to have 'failed' rather than 'errored'.
    * longMessage: determines whether long messages (including repr of
        objects used in assert methods) will be printed on failure in *addition*
        to any explicit message passed.
    * maxDiff: sets the maximum length of a diff in failure messages
        by assert methods using difflib. It is looked up as an instance
        attribute so can be configured by individual tests if required.
    """

    failureException = AssertionError

    longMessage = True

    maxDiff = 80*8

    # If a string is longer than _diffThreshold, use normal comparison instead
    # of difflib.  See #11763.
    _diffThreshold = 2**16

    # Attribute used by TestSuite for classSetUp

    _classSetupFailed = False

    _class_cleanups = []

    def __init__(self, methodName='runTest'):
        """Create an instance of the class that will use the named test
           method when executed. Raises a ValueError if the instance does
           not have a method with the specified name.
        """
        self._testMethodName = methodName
        self._outcome = None
        self._testMethodDoc = 'No test'
        try:
            testMethod = getattr(self, methodName)
        except AttributeError:
            if methodName != 'runTest':
                # we allow instantiation with no explicit method name
                # but not an *incorrect* or missing method name
                raise ValueError("no such test method in %s: %s" %
                      (self.__class__, methodName))
        else:
            self._testMethodDoc = testMethod.__doc__
        self._cleanups = []
        self._subtest = None

        # Map types to custom assertEqual functions that will compare
        # instances of said type in more detail to generate a more useful
        # error message.
        self._type_equality_funcs = {}
        self.addTypeEqualityFunc(dict, 'assertDictEqual')
        self.addTypeEqualityFunc(list, 'assertListEqual')
        self.addTypeEqualityFunc(tuple, 'assertTupleEqual')
        self.addTypeEqualityFunc(set, 'assertSetEqual')
        self.addTypeEqualityFunc(frozenset, 'assertSetEqual')
        self.addTypeEqualityFunc(str, 'assertMultiLineEqual')

    def addTypeEqualityFunc(self, typeobj, function):
        """Add a type specific assertEqual style function to compare a type.

        This method is for use by TestCase subclasses that need to register
        their own type equality functions to provide nicer error messages.

        Args:
            typeobj: The data type to call this function on when both values
                    are of the same type in assertEqual().
            function: The callable taking two arguments and an optional
                    msg= argument that raises self.failureException with a
                    useful error message when the two arguments are not equal.
        """
        self._type_equality_funcs[typeobj] = function

    def addCleanup(*args, **kwargs):
        """Add a function, with arguments, to be called when the test is
        completed. Functions added are called on a LIFO basis and are
        called after tearDown on test failure or success.

        Cleanup items are called even if setUp fails (unlike tearDown)."""
        if len(args) >= 2:
            self, function, *args = args
        elif not args:
            raise TypeError("descriptor 'addCleanup' of 'TestCase' object "
                            "needs an argument")
        elif 'function' in kwargs:
            function = kwargs.pop('function')
            self, *args = args
            import warnings
            warnings.warn("Passing 'function' as keyword argument is deprecated",
                          DeprecationWarning, stacklevel=2)
        else:
            raise TypeError('addCleanup expected at least 1 positional '
                            'argument, got %d' % (len(args)-1))
        args = tuple(args)

        self._cleanups.append((function, args, kwargs))
    addCleanup.__text_signature__ = '($self, function, /, *args, **kwargs)'

    @classmethod
    def addClassCleanup(cls, function, /, *args, **kwargs):
        """Same as addCleanup, except the cleanup items are called even if
        setUpClass fails (unlike tearDownClass)."""
        cls._class_cleanups.append((function, args, kwargs))

    def setUp(self):
        "Hook method for setting up the test fixture before exercising it."
        pass

    def tearDown(self):
        "Hook method for deconstructing the test fixture after testing it."
        pass

    @classmethod
    def setUpClass(cls):
        "Hook method for setting up class fixture before running tests in the class."

    @classmethod
    def tearDownClass(cls):
        "Hook method for deconstructing the class fixture after running all tests in the class."

    def countTestCases(self):
        return 1

    def defaultTestResult(self):
        return result.TestResult()

    def shortDescription(self):
        """Returns a one-line description of the test, or None if no
        description has been provided.

        The default implementation of this method returns the first line of
        the specified test method's docstring.
        """
        doc = self._testMethodDoc
        return doc.strip().split("\n")[0].strip() if doc else None


    def id(self):
        return "%s.%s" % (strclass(self.__class__), self._testMethodName)

    def __eq__(self, other):
        if type(self) is not type(other):
            return NotImplemented

        return self._testMethodName == other._testMethodName

    def __hash__(self):
        return hash((type(self), self._testMethodName))

    def __str__(self):
        return "%s (%s)" % (self._testMethodName, strclass(self.__class__))

    def __repr__(self):
        return "<%s testMethod=%s>" % \
               (strclass(self.__class__), self._testMethodName)

    def _addSkip(self, result, test_case, reason):
        addSkip = getattr(result, 'addSkip', None)
        if addSkip is not None:
            addSkip(test_case, reason)
        else:
            warnings.warn("TestResult has no addSkip method, skips not reported",
                          RuntimeWarning, 2)
            result.addSuccess(test_case)

    @contextlib.contextmanager
    def subTest(self, msg=_subtest_msg_sentinel, **params):
        """Return a context manager that will return the enclosed block
        of code in a subtest identified by the optional message and
        keyword parameters.  A failure in the subtest marks the test
        case as failed but resumes execution at the end of the enclosed
        block, allowing further test code to be executed.
        """
        if self._outcome is None or not self._outcome.result_supports_subtests:
            yield
            return
        parent = self._subtest
        if parent is None:
            params_map = _OrderedChainMap(params)
        else:
            params_map = parent.params.new_child(params)
        self._subtest = _SubTest(self, msg, params_map)
        try:
            with self._outcome.testPartExecutor(self._subtest, isTest=True):
                yield
            if not self._outcome.success:
                result = self._outcome.result
                if result is not None and result.failfast:
                    raise _ShouldStop
            elif self._outcome.expectedFailure:
                # If the test is expecting a failure, we really want to
                # stop now and register the expected failure.
                raise _ShouldStop
        finally:
            self._subtest = parent

    def _feedErrorsToResult(self, result, errors):
        for test, exc_info in errors:
            if isinstance(test, _SubTest):
                result.addSubTest(test.test_case, test, exc_info)
            elif exc_info is not None:
                if issubclass(exc_info[0], self.failureException):
                    result.addFailure(test, exc_info)
                else:
                    result.addError(test, exc_info)

    def _addExpectedFailure(self, result, exc_info):
        try:
            addExpectedFailure = result.addExpectedFailure
        except AttributeError:
            warnings.warn("TestResult has no addExpectedFailure method, reporting as passes",
                          RuntimeWarning)
            result.addSuccess(self)
        else:
            addExpectedFailure(self, exc_info)

    def _addUnexpectedSuccess(self, result):
        try:
            addUnexpectedSuccess = result.addUnexpectedSuccess
        except AttributeError:
            warnings.warn("TestResult has no addUnexpectedSuccess method, reporting as failure",
                          RuntimeWarning)
            # We need to pass an actual exception and traceback to addFailure,
            # otherwise the legacy result can choke.
            try:
                raise _UnexpectedSuccess from None
            except _UnexpectedSuccess:
                result.addFailure(self, sys.exc_info())
        else:
            addUnexpectedSuccess(self)

    def _callSetUp(self):
        self.setUp()

    def _callTestMethod(self, method):
        method()

    def _callTearDown(self):
        self.tearDown()

    def _callCleanup(self, function, /, *args, **kwargs):
        function(*args, **kwargs)

    def run(self, result=None):
        orig_result = result
        if result is None:
            result = self.defaultTestResult()
            startTestRun = getattr(result, 'startTestRun', None)
            if startTestRun is not None:
                startTestRun()

        result.startTest(self)

        testMethod = getattr(self, self._testMethodName)
        if (getattr(self.__class__, "__unittest_skip__", False) or
            getattr(testMethod, "__unittest_skip__", False)):
            # If the class or method was skipped.
            try:
                skip_why = (getattr(self.__class__, '__unittest_skip_why__', '')
                            or getattr(testMethod, '__unittest_skip_why__', ''))
                self._addSkip(result, self, skip_why)
            finally:
                result.stopTest(self)
            return
        expecting_failure_method = getattr(testMethod,
                                           "__unittest_expecting_failure__", False)
        expecting_failure_class = getattr(self,
                                          "__unittest_expecting_failure__", False)
        expecting_failure = expecting_failure_class or expecting_failure_method
        outcome = _Outcome(result)
        try:
            self._outcome = outcome

            with outcome.testPartExecutor(self):
                self._callSetUp()
            if outcome.success:
                outcome.expecting_failure = expecting_failure
                with outcome.testPartExecutor(self, isTest=True):
                    self._callTestMethod(testMethod)
                outcome.expecting_failure = False
                with outcome.testPartExecutor(self):
                    self._callTearDown()

            self.doCleanups()
            for test, reason in outcome.skipped:
                self._addSkip(result, test, reason)
            self._feedErrorsToResult(result, outcome.errors)
            if outcome.success:
                if expecting_failure:
                    if outcome.expectedFailure:
                        self._addExpectedFailure(result, outcome.expectedFailure)
                    else:
                        self._addUnexpectedSuccess(result)
                else:
                    result.addSuccess(self)
            return result
        finally:
            result.stopTest(self)
            if orig_result is None:
                stopTestRun = getattr(result, 'stopTestRun', None)
                if stopTestRun is not None:
                    stopTestRun()

            # explicitly break reference cycles:
            # outcome.errors -> frame -> outcome -> outcome.errors
            # outcome.expectedFailure -> frame -> outcome -> outcome.expectedFailure
            outcome.errors.clear()
            outcome.expectedFailure = None

            # clear the outcome, no more needed
            self._outcome = None

    def doCleanups(self):
        """Execute all cleanup functions. Normally called for you after
        tearDown."""
        outcome = self._outcome or _Outcome()
        while self._cleanups:
            function, args, kwargs = self._cleanups.pop()
            with outcome.testPartExecutor(self):
                self._callCleanup(function, *args, **kwargs)

        # return this for backwards compatibility
        # even though we no longer use it internally
        return outcome.success

    @classmethod
    def doClassCleanups(cls):
        """Execute all class cleanup functions. Normally called for you after
        tearDownClass."""
        cls.tearDown_exceptions = []
        while cls._class_cleanups:
            function, args, kwargs = cls._class_cleanups.pop()
            try:
                function(*args, **kwargs)
            except Exception as exc:
                cls.tearDown_exceptions.append(sys.exc_info())

    def __call__(self, *args, **kwds):
        return self.run(*args, **kwds)

    def debug(self):
        """Run the test without collecting errors in a TestResult"""
        self.setUp()
        getattr(self, self._testMethodName)()
        self.tearDown()
        while self._cleanups:
            function, args, kwargs = self._cleanups.pop(-1)
            function(*args, **kwargs)

    def skipTest(self, reason):
        """Skip this test."""
        raise SkipTest(reason)

    def fail(self, msg=None):
        """Fail immediately, with the given message."""
        raise self.failureException(msg)

    def assertFalse(self, expr, msg=None):
        """Check that the expression is false."""
        if expr:
            msg = self._formatMessage(msg, "%s is not false" % safe_repr(expr))
            raise self.failureException(msg)

    def assertTrue(self, expr, msg=None):
        """Check that the expression is true."""
        if not expr:
            msg = self._formatMessage(msg, "%s is not true" % safe_repr(expr))
            raise self.failureException(msg)

    def _formatMessage(self, msg, standardMsg):
        """Honour the longMessage attribute when generating failure messages.
        If longMessage is False this means:
        * Use only an explicit message if it is provided
        * Otherwise use the standard message for the assert

        If longMessage is True:
        * Use the standard message
        * If an explicit message is provided, plus ' : ' and the explicit message
        """
        if not self.longMessage:
            return msg or standardMsg
        if msg is None:
            return standardMsg
        try:
            # don't switch to '{}' formatting in Python 2.X
            # it changes the way unicode input is handled
            return '%s : %s' % (standardMsg, msg)
        except UnicodeDecodeError:
            return  '%s : %s' % (safe_repr(standardMsg), safe_repr(msg))

    def assertRaises(self, expected_exception, *args, **kwargs):
        """Fail unless an exception of class expected_exception is raised
           by the callable when invoked with specified positional and
           keyword arguments. If a different type of exception is
           raised, it will not be caught, and the test case will be
           deemed to have suffered an error, exactly as for an
           unexpected exception.

           If called with the callable and arguments omitted, will return a
           context object used like this::

                with self.assertRaises(SomeException):
                    do_something()

           An optional keyword argument 'msg' can be provided when assertRaises
           is used as a context object.

           The context manager keeps a reference to the exception as
           the 'exception' attribute. This allows you to inspect the
           exception after the assertion::

               with self.assertRaises(SomeException) as cm:
                   do_something()
               the_exception = cm.exception
               self.assertEqual(the_exception.error_code, 3)
        """
        context = _AssertRaisesContext(expected_exception, self)
        try:
            return context.handle('assertRaises', args, kwargs)
        finally:
            # bpo-23890: manually break a reference cycle
            context = None

    def assertWarns(self, expected_warning, *args, **kwargs):
        """Fail unless a warning of class warnClass is triggered
           by the callable when invoked with specified positional and
           keyword arguments.  If a different type of warning is
           triggered, it will not be handled: depending on the other
           warning filtering rules in effect, it might be silenced, printed
           out, or raised as an exception.

           If called with the callable and arguments omitted, will return a
           context object used like this::

                with self.assertWarns(SomeWarning):
                    do_something()

           An optional keyword argument 'msg' can be provided when assertWarns
           is used as a context object.

           The context manager keeps a reference to the first matching
           warning as the 'warning' attribute; similarly, the 'filename'
           and 'lineno' attributes give you information about the line
           of Python code from which the warning was triggered.
           This allows you to inspect the warning after the assertion::

               with self.assertWarns(SomeWarning) as cm:
                   do_something()
               the_warning = cm.warning
               self.assertEqual(the_warning.some_attribute, 147)
        """
        context = _AssertWarnsContext(expected_warning, self)
        return context.handle('assertWarns', args, kwargs)

    def assertLogs(self, logger=None, level=None):
        """Fail unless a log message of level *level* or higher is emitted
        on *logger_name* or its children.  If omitted, *level* defaults to
        INFO and *logger* defaults to the root logger.

        This method must be used as a context manager, and will yield
        a recording object with two attributes: `output` and `records`.
        At the end of the context manager, the `output` attribute will
        be a list of the matching formatted log messages and the
        `records` attribute will be a list of the corresponding LogRecord
        objects.

        Example::

            with self.assertLogs('foo', level='INFO') as cm:
                logging.getLogger('foo').info('first message')
                logging.getLogger('foo.bar').error('second message')
            self.assertEqual(cm.output, ['INFO:foo:first message',
                                         'ERROR:foo.bar:second message'])
        """
        return _AssertLogsContext(self, logger, level)

    def _getAssertEqualityFunc(self, first, second):
        """Get a detailed comparison function for the types of the two args.

        Returns: A callable accepting (first, second, msg=None) that will
        raise a failure exception if first != second with a useful human
        readable error message for those types.
        """
        #
        # NOTE(gregory.p.smith): I considered isinstance(first, type(second))
        # and vice versa.  I opted for the conservative approach in case
        # subclasses are not intended to be compared in detail to their super
        # class instances using a type equality func.  This means testing
        # subtypes won't automagically use the detailed comparison.  Callers
        # should use their type specific assertSpamEqual method to compare
        # subclasses if the detailed comparison is desired and appropriate.
        # See the discussion in http://bugs.python.org/issue2578.
        #
        if type(first) is type(second):
            asserter = self._type_equality_funcs.get(type(first))
            if asserter is not None:
                if isinstance(asserter, str):
                    asserter = getattr(self, asserter)
                return asserter

        return self._baseAssertEqual

    def _baseAssertEqual(self, first, second, msg=None):
        """The default assertEqual implementation, not type specific."""
        if not first == second:
            standardMsg = '%s != %s' % _common_shorten_repr(first, second)
            msg = self._formatMessage(msg, standardMsg)
            raise self.failureException(msg)

    def assertEqual(self, first, second, msg=None):
        """Fail if the two objects are unequal as determined by the '=='
           operator.
        """
        assertion_func = self._getAssertEqualityFunc(first, second)
        assertion_func(first, second, msg=msg)

    def assertNotEqual(self, first, second, msg=None):
        """Fail if the two objects are equal as determined by the '!='
           operator.
        """
        if not first != second:
            msg = self._formatMessage(msg, '%s == %s' % (safe_repr(first),
                                                          safe_repr(second)))
            raise self.failureException(msg)

    def assertAlmostEqual(self, first, second, places=None, msg=None,
                          delta=None):
        """Fail if the two objects are unequal as determined by their
           difference rounded to the given number of decimal places
           (default 7) and comparing to zero, or by comparing that the
           difference between the two objects is more than the given
           delta.

           Note that decimal places (from zero) are usually not the same
           as significant digits (measured from the most significant digit).

           If the two objects compare equal then they will automatically
           compare almost equal.
        """
        if first == second:
            # shortcut
            return
        if delta is not None and places is not None:
            raise TypeError("specify delta or places not both")

        diff = abs(first - second)
        if delta is not None:
            if diff <= delta:
                return

            standardMsg = '%s != %s within %s delta (%s difference)' % (
                safe_repr(first),
                safe_repr(second),
                safe_repr(delta),
                safe_repr(diff))
        else:
            if places is None:
                places = 7

            if round(diff, places) == 0:
                return

            standardMsg = '%s != %s within %r places (%s difference)' % (
                safe_repr(first),
                safe_repr(second),
                places,
                safe_repr(diff))
        msg = self._formatMessage(msg, standardMsg)
        raise self.failureException(msg)

    def assertNotAlmostEqual(self, first, second, places=None, msg=None,
                             delta=None):
        """Fail if the two objects are equal as determined by their
           difference rounded to the given number of decimal places
           (default 7) and comparing to zero, or by comparing that the
           difference between the two objects is less than the given delta.

           Note that decimal places (from zero) are usually not the same
           as significant digits (measured from the most significant digit).

           Objects that are equal automatically fail.
        """
        if delta is not None and places is not None:
            raise TypeError("specify delta or places not both")
        diff = abs(first - second)
        if delta is not None:
            if not (first == second) and diff > delta:
                return
            standardMsg = '%s == %s within %s delta (%s difference)' % (
                safe_repr(first),
                safe_repr(second),
                safe_repr(delta),
                safe_repr(diff))
        else:
            if places is None:
                places = 7
            if not (first == second) and round(diff, places) != 0:
                return
            standardMsg = '%s == %s within %r places' % (safe_repr(first),
                                                         safe_repr(second),
                                                         places)

        msg = self._formatMessage(msg, standardMsg)
        raise self.failureException(msg)

    def assertSequenceEqual(self, seq1, seq2, msg=None, seq_type=None):
        """An equality assertion for ordered sequences (like lists and tuples).

        For the purposes of this function, a valid ordered sequence type is one
        which can be indexed, has a length, and has an equality operator.

        Args:
            seq1: The first sequence to compare.
            seq2: The second sequence to compare.
            seq_type: The expected datatype of the sequences, or None if no
                    datatype should be enforced.
            msg: Optional message to use on failure instead of a list of
                    differences.
        """
        if seq_type is not None:
            seq_type_name = seq_type.__name__
            if not isinstance(seq1, seq_type):
                raise self.failureException('First sequence is not a %s: %s'
                                        % (seq_type_name, safe_repr(seq1)))
            if not isinstance(seq2, seq_type):
                raise self.failureException('Second sequence is not a %s: %s'
                                        % (seq_type_name, safe_repr(seq2)))
        else:
            seq_type_name = "sequence"

        differing = None
        try:
            len1 = len(seq1)
        except (TypeError, NotImplementedError):
            differing = 'First %s has no length.    Non-sequence?' % (
                    seq_type_name)

        if differing is None:
            try:
                len2 = len(seq2)
            except (TypeError, NotImplementedError):
                differing = 'Second %s has no length.    Non-sequence?' % (
                        seq_type_name)

        if differing is None:
            if seq1 == seq2:
                return

            differing = '%ss differ: %s != %s\n' % (
                    (seq_type_name.capitalize(),) +
                    _common_shorten_repr(seq1, seq2))

            for i in range(min(len1, len2)):
                try:
                    item1 = seq1[i]
                except (TypeError, IndexError, NotImplementedError):
                    differing += ('\nUnable to index element %d of first %s\n' %
                                 (i, seq_type_name))
                    break

                try:
                    item2 = seq2[i]
                except (TypeError, IndexError, NotImplementedError):
                    differing += ('\nUnable to index element %d of second %s\n' %
                                 (i, seq_type_name))
                    break

                if item1 != item2:
                    differing += ('\nFirst differing element %d:\n%s\n%s\n' %
                                 ((i,) + _common_shorten_repr(item1, item2)))
                    break
            else:
                if (len1 == len2 and seq_type is None and
                    type(seq1) != type(seq2)):
                    # The sequences are the same, but have differing types.
                    return

            if len1 > len2:
                differing += ('\nFirst %s contains %d additional '
                             'elements.\n' % (seq_type_name, len1 - len2))
                try:
                    differing += ('First extra element %d:\n%s\n' %
                                  (len2, safe_repr(seq1[len2])))
                except (TypeError, IndexError, NotImplementedError):
                    differing += ('Unable to index element %d '
                                  'of first %s\n' % (len2, seq_type_name))
            elif len1 < len2:
                differing += ('\nSecond %s contains %d additional '
                             'elements.\n' % (seq_type_name, len2 - len1))
                try:
                    differing += ('First extra element %d:\n%s\n' %
                                  (len1, safe_repr(seq2[len1])))
                except (TypeError, IndexError, NotImplementedError):
                    differing += ('Unable to index element %d '
                                  'of second %s\n' % (len1, seq_type_name))
        standardMsg = differing
        diffMsg = '\n' + '\n'.join(
            difflib.ndiff(pprint.pformat(seq1).splitlines(),
                          pprint.pformat(seq2).splitlines()))

        standardMsg = self._truncateMessage(standardMsg, diffMsg)
        msg = self._formatMessage(msg, standardMsg)
        self.fail(msg)

    def _truncateMessage(self, message, diff):
        max_diff = self.maxDiff
        if max_diff is None or len(diff) <= max_diff:
            return message + diff
        return message + (DIFF_OMITTED % len(diff))

    def assertListEqual(self, list1, list2, msg=None):
        """A list-specific equality assertion.

        Args:
            list1: The first list to compare.
            list2: The second list to compare.
            msg: Optional message to use on failure instead of a list of
                    differences.

        """
        self.assertSequenceEqual(list1, list2, msg, seq_type=list)

    def assertTupleEqual(self, tuple1, tuple2, msg=None):
        """A tuple-specific equality assertion.

        Args:
            tuple1: The first tuple to compare.
            tuple2: The second tuple to compare.
            msg: Optional message to use on failure instead of a list of
                    differences.
        """
        self.assertSequenceEqual(tuple1, tuple2, msg, seq_type=tuple)

    def assertSetEqual(self, set1, set2, msg=None):
        """A set-specific equality assertion.

        Args:
            set1: The first set to compare.
            set2: The second set to compare.
            msg: Optional message to use on failure instead of a list of
                    differences.

        assertSetEqual uses ducktyping to support different types of sets, and
        is optimized for sets specifically (parameters must support a
        difference method).
        """
        try:
            difference1 = set1.difference(set2)
        except TypeError as e:
            self.fail('invalid type when attempting set difference: %s' % e)
        except AttributeError as e:
            self.fail('first argument does not support set difference: %s' % e)

        try:
            difference2 = set2.difference(set1)
        except TypeError as e:
            self.fail('invalid type when attempting set difference: %s' % e)
        except AttributeError as e:
            self.fail('second argument does not support set difference: %s' % e)

        if not (difference1 or difference2):
            return

        lines = []
        if difference1:
            lines.append('Items in the first set but not the second:')
            for item in difference1:
                lines.append(repr(item))
        if difference2:
            lines.append('Items in the second set but not the first:')
            for item in difference2:
                lines.append(repr(item))

        standardMsg = '\n'.join(lines)
        self.fail(self._formatMessage(msg, standardMsg))

    def assertIn(self, member, container, msg=None):
        """Just like self.assertTrue(a in b), but with a nicer default message."""
        if member not in container:
            standardMsg = '%s not found in %s' % (safe_repr(member),
                                                  safe_repr(container))
            self.fail(self._formatMessage(msg, standardMsg))

    def assertNotIn(self, member, container, msg=None):
        """Just like self.assertTrue(a not in b), but with a nicer default message."""
        if member in container:
            standardMsg = '%s unexpectedly found in %s' % (safe_repr(member),
                                                        safe_repr(container))
            self.fail(self._formatMessage(msg, standardMsg))

    def assertIs(self, expr1, expr2, msg=None):
        """Just like self.assertTrue(a is b), but with a nicer default message."""
        if expr1 is not expr2:
            standardMsg = '%s is not %s' % (safe_repr(expr1),
                                             safe_repr(expr2))
            self.fail(self._formatMessage(msg, standardMsg))

    def assertIsNot(self, expr1, expr2, msg=None):
        """Just like self.assertTrue(a is not b), but with a nicer default message."""
        if expr1 is expr2:
            standardMsg = 'unexpectedly identical: %s' % (safe_repr(expr1),)
            self.fail(self._formatMessage(msg, standardMsg))

    def assertDictEqual(self, d1, d2, msg=None):
        self.assertIsInstance(d1, dict, 'First argument is not a dictionary')
        self.assertIsInstance(d2, dict, 'Second argument is not a dictionary')

        if d1 != d2:
            standardMsg = '%s != %s' % _common_shorten_repr(d1, d2)
            diff = ('\n' + '\n'.join(difflib.ndiff(
                           pprint.pformat(d1).splitlines(),
                           pprint.pformat(d2).splitlines())))
            standardMsg = self._truncateMessage(standardMsg, diff)
            self.fail(self._formatMessage(msg, standardMsg))

    def assertDictContainsSubset(self, subset, dictionary, msg=None):
        """Checks whether dictionary is a superset of subset."""
        warnings.warn('assertDictContainsSubset is deprecated',
                      DeprecationWarning)
        missing = []
        mismatched = []
        for key, value in subset.items():
            if key not in dictionary:
                missing.append(key)
            elif value != dictionary[key]:
                mismatched.append('%s, expected: %s, actual: %s' %
                                  (safe_repr(key), safe_repr(value),
                                   safe_repr(dictionary[key])))

        if not (missing or mismatched):
            return

        standardMsg = ''
        if missing:
            standardMsg = 'Missing: %s' % ','.join(safe_repr(m) for m in
                                                    missing)
        if mismatched:
            if standardMsg:
                standardMsg += '; '
            standardMsg += 'Mismatched values: %s' % ','.join(mismatched)

        self.fail(self._formatMessage(msg, standardMsg))


    def assertCountEqual(self, first, second, msg=None):
        """Asserts that two iterables have the same elements, the same number of
        times, without regard to order.

            self.assertEqual(Counter(list(first)),
                             Counter(list(second)))

         Example:
            - [0, 1, 1] and [1, 0, 1] compare equal.
            - [0, 0, 1] and [0, 1] compare unequal.

        """
        first_seq, second_seq = list(first), list(second)
        try:
            first = collections.Counter(first_seq)
            second = collections.Counter(second_seq)
        except TypeError:
            # Handle case with unhashable elements
            differences = _count_diff_all_purpose(first_seq, second_seq)
        else:
            if first == second:
                return
            differences = _count_diff_hashable(first_seq, second_seq)

        if differences:
            standardMsg = 'Element counts were not equal:\n'
            lines = ['First has %d, Second has %d:  %r' % diff for diff in differences]
            diffMsg = '\n'.join(lines)
            standardMsg = self._truncateMessage(standardMsg, diffMsg)
            msg = self._formatMessage(msg, standardMsg)
            self.fail(msg)

    def assertMultiLineEqual(self, first, second, msg=None):
        """Assert that two multi-line strings are equal."""
        self.assertIsInstance(first, str, 'First argument is not a string')
        self.assertIsInstance(second, str, 'Second argument is not a string')

        if first != second:
            # don't use difflib if the strings are too long
            if (len(first) > self._diffThreshold or
                len(second) > self._diffThreshold):
                self._baseAssertEqual(first, second, msg)
            firstlines = first.splitlines(keepends=True)
            secondlines = second.splitlines(keepends=True)
            if len(firstlines) == 1 and first.strip('\r\n') == first:
                firstlines = [first + '\n']
                secondlines = [second + '\n']
            standardMsg = '%s != %s' % _common_shorten_repr(first, second)
            diff = '\n' + ''.join(difflib.ndiff(firstlines, secondlines))
            standardMsg = self._truncateMessage(standardMsg, diff)
            self.fail(self._formatMessage(msg, standardMsg))

    def assertLess(self, a, b, msg=None):
        """Just like self.assertTrue(a < b), but with a nicer default message."""
        if not a < b:
            standardMsg = '%s not less than %s' % (safe_repr(a), safe_repr(b))
            self.fail(self._formatMessage(msg, standardMsg))

    def assertLessEqual(self, a, b, msg=None):
        """Just like self.assertTrue(a <= b), but with a nicer default message."""
        if not a <= b:
            standardMsg = '%s not less than or equal to %s' % (safe_repr(a), safe_repr(b))
            self.fail(self._formatMessage(msg, standardMsg))

    def assertGreater(self, a, b, msg=None):
        """Just like self.assertTrue(a > b), but with a nicer default message."""
        if not a > b:
            standardMsg = '%s not greater than %s' % (safe_repr(a), safe_repr(b))
            self.fail(self._formatMessage(msg, standardMsg))

    def assertGreaterEqual(self, a, b, msg=None):
        """Just like self.assertTrue(a >= b), but with a nicer default message."""
        if not a >= b:
            standardMsg = '%s not greater than or equal to %s' % (safe_repr(a), safe_repr(b))
            self.fail(self._formatMessage(msg, standardMsg))

    def assertIsNone(self, obj, msg=None):
        """Same as self.assertTrue(obj is None), with a nicer default message."""
        if obj is not None:
            standardMsg = '%s is not None' % (safe_repr(obj),)
            self.fail(self._formatMessage(msg, standardMsg))

    def assertIsNotNone(self, obj, msg=None):
        """Included for symmetry with assertIsNone."""
        if obj is None:
            standardMsg = 'unexpectedly None'
            self.fail(self._formatMessage(msg, standardMsg))

    def assertIsInstance(self, obj, cls, msg=None):
        """Same as self.assertTrue(isinstance(obj, cls)), with a nicer
        default message."""
        if not isinstance(obj, cls):
            standardMsg = '%s is not an instance of %r' % (safe_repr(obj), cls)
            self.fail(self._formatMessage(msg, standardMsg))

    def assertNotIsInstance(self, obj, cls, msg=None):
        """Included for symmetry with assertIsInstance."""
        if isinstance(obj, cls):
            standardMsg = '%s is an instance of %r' % (safe_repr(obj), cls)
            self.fail(self._formatMessage(msg, standardMsg))

    def assertRaisesRegex(self, expected_exception, expected_regex,
                          *args, **kwargs):
        """Asserts that the message in a raised exception matches a regex.

        Args:
            expected_exception: Exception class expected to be raised.
            expected_regex: Regex (re.Pattern object or string) expected
                    to be found in error message.
            args: Function to be called and extra positional args.
            kwargs: Extra kwargs.
            msg: Optional message used in case of failure. Can only be used
                    when assertRaisesRegex is used as a context manager.
        """
        context = _AssertRaisesContext(expected_exception, self, expected_regex)
        return context.handle('assertRaisesRegex', args, kwargs)

    def assertWarnsRegex(self, expected_warning, expected_regex,
                         *args, **kwargs):
        """Asserts that the message in a triggered warning matches a regexp.
        Basic functioning is similar to assertWarns() with the addition
        that only warnings whose messages also match the regular expression
        are considered successful matches.

        Args:
            expected_warning: Warning class expected to be triggered.
            expected_regex: Regex (re.Pattern object or string) expected
                    to be found in error message.
            args: Function to be called and extra positional args.
            kwargs: Extra kwargs.
            msg: Optional message used in case of failure. Can only be used
                    when assertWarnsRegex is used as a context manager.
        """
        context = _AssertWarnsContext(expected_warning, self, expected_regex)
        return context.handle('assertWarnsRegex', args, kwargs)

    def assertRegex(self, text, expected_regex, msg=None):
        """Fail the test unless the text matches the regular expression."""
        if isinstance(expected_regex, (str, bytes)):
            assert expected_regex, "expected_regex must not be empty."
            expected_regex = re.compile(expected_regex)
        if not expected_regex.search(text):
            standardMsg = "Regex didn't match: %r not found in %r" % (
                expected_regex.pattern, text)
            # _formatMessage ensures the longMessage option is respected
            msg = self._formatMessage(msg, standardMsg)
            raise self.failureException(msg)

    def assertNotRegex(self, text, unexpected_regex, msg=None):
        """Fail the test if the text matches the regular expression."""
        if isinstance(unexpected_regex, (str, bytes)):
            unexpected_regex = re.compile(unexpected_regex)
        match = unexpected_regex.search(text)
        if match:
            standardMsg = 'Regex matched: %r matches %r in %r' % (
                text[match.start() : match.end()],
                unexpected_regex.pattern,
                text)
            # _formatMessage ensures the longMessage option is respected
            msg = self._formatMessage(msg, standardMsg)
            raise self.failureException(msg)


    def _deprecate(original_func):
        def deprecated_func(*args, **kwargs):
            warnings.warn(
                'Please use {0} instead.'.format(original_func.__name__),
                DeprecationWarning, 2)
            return original_func(*args, **kwargs)
        return deprecated_func

    # see #9424
    failUnlessEqual = assertEquals = _deprecate(assertEqual)
    failIfEqual = assertNotEquals = _deprecate(assertNotEqual)
    failUnlessAlmostEqual = assertAlmostEquals = _deprecate(assertAlmostEqual)
    failIfAlmostEqual = assertNotAlmostEquals = _deprecate(assertNotAlmostEqual)
    failUnless = assert_ = _deprecate(assertTrue)
    failUnlessRaises = _deprecate(assertRaises)
    failIf = _deprecate(assertFalse)
    assertRaisesRegexp = _deprecate(assertRaisesRegex)
    assertRegexpMatches = _deprecate(assertRegex)
    assertNotRegexpMatches = _deprecate(assertNotRegex)



class FunctionTestCase(TestCase):
    """A test case that wraps a test function.

    This is useful for slipping pre-existing test functions into the
    unittest framework. Optionally, set-up and tidy-up functions can be
    supplied. As with TestCase, the tidy-up ('tearDown') function will
    always be called if the set-up ('setUp') function ran successfully.
    """

    def __init__(self, testFunc, setUp=None, tearDown=None, description=None):
        super(FunctionTestCase, self).__init__()
        self._setUpFunc = setUp
        self._tearDownFunc = tearDown
        self._testFunc = testFunc
        self._description = description

    def setUp(self):
        if self._setUpFunc is not None:
            self._setUpFunc()

    def tearDown(self):
        if self._tearDownFunc is not None:
            self._tearDownFunc()

    def runTest(self):
        self._testFunc()

    def id(self):
        return self._testFunc.__name__

    def __eq__(self, other):
        if not isinstance(other, self.__class__):
            return NotImplemented

        return self._setUpFunc == other._setUpFunc and \
               self._tearDownFunc == other._tearDownFunc and \
               self._testFunc == other._testFunc and \
               self._description == other._description

    def __hash__(self):
        return hash((type(self), self._setUpFunc, self._tearDownFunc,
                     self._testFunc, self._description))

    def __str__(self):
        return "%s (%s)" % (strclass(self.__class__),
                            self._testFunc.__name__)

    def __repr__(self):
        return "<%s tec=%s>" % (strclass(self.__class__),
                                     self._testFunc)

    def shortDescription(self):
        if self._description is not None:
            return self._description
        doc = self._testFunc.__doc__
        return doc and doc.split("\n")[0].strip() or None


class _SubTest(TestCase):

    def __init__(self, test_case, message, params):
        super().__init__()
        self._message = message
        self.test_case = test_case
        self.params = params
        self.failureException = test_case.failureException

    def runTest(self):
        raise NotImplementedError("subtests cannot be run directly")

    def _subDescription(self):
        parts = []
        if self._message is not _subtest_msg_sentinel:
            parts.append("[{}]".format(self._message))
        if self.params:
            params_desc = ', '.join(
                "{}={!r}".format(k, v)
                for (k, v) in self.params.items())
            parts.append("({})".format(params_desc))
        return " ".join(parts) or '(<subtest>)'

    def id(self):
        return "{} {}".format(self.test_case.id(), self._subDescription())

    def shortDescription(self):
        """Returns a one-line description of the subtest, or None if no
        description has been provided.
        """
        return self.test_case.shortDescription()

    def __str__(self):
        return "{} {}".format(self.test_case, self._subDescription())
unittest/signals.py000064400000004543151153537550010455 0ustar00import signal
import weakref

from functools import wraps

__unittest = True


class _InterruptHandler(object):
    def __init__(self, default_handler):
        self.called = False
        self.original_handler = default_handler
        if isinstance(default_handler, int):
            if default_handler == signal.SIG_DFL:
                # Pretend it's signal.default_int_handler instead.
                default_handler = signal.default_int_handler
            elif default_handler == signal.SIG_IGN:
                # Not quite the same thing as SIG_IGN, but the closest we
                # can make it: do nothing.
                def default_handler(unused_signum, unused_frame):
                    pass
            else:
                raise TypeError("expected SIGINT signal handler to be "
                                "signal.SIG_IGN, signal.SIG_DFL, or a "
                                "callable object")
        self.default_handler = default_handler

    def __call__(self, signum, frame):
        installed_handler = signal.getsignal(signal.SIGINT)
        if installed_handler is not self:
            # if we aren't the installed handler, then delegate immediately
            # to the default handler
            self.default_handler(signum, frame)

        if self.called:
            self.default_handler(signum, frame)
        self.called = True
        for result in _results.keys():
            result.stop()

_results = weakref.WeakKeyDictionary()
def registerResult(result):
    _results[result] = 1

def removeResult(result):
    return bool(_results.pop(result, None))

_interrupt_handler = None
def installHandler():
    global _interrupt_handler
    if _interrupt_handler is None:
        default_handler = signal.getsignal(signal.SIGINT)
        _interrupt_handler = _InterruptHandler(default_handler)
        signal.signal(signal.SIGINT, _interrupt_handler)


def removeHandler(method=None):
    if method is not None:
        @wraps(method)
        def inner(*args, **kwargs):
            initial = signal.getsignal(signal.SIGINT)
            removeHandler()
            try:
                return method(*args, **kwargs)
            finally:
                signal.signal(signal.SIGINT, initial)
        return inner

    global _interrupt_handler
    if _interrupt_handler is not None:
        signal.signal(signal.SIGINT, _interrupt_handler.original_handler)
unittest/runner.py000064400000017127151153537550010330 0ustar00"""Running tests"""

import sys
import time
import warnings

from . import result
from .signals import registerResult

__unittest = True


class _WritelnDecorator(object):
    """Used to decorate file-like objects with a handy 'writeln' method"""
    def __init__(self,stream):
        self.stream = stream

    def __getattr__(self, attr):
        if attr in ('stream', '__getstate__'):
            raise AttributeError(attr)
        return getattr(self.stream,attr)

    def writeln(self, arg=None):
        if arg:
            self.write(arg)
        self.write('\n') # text-mode streams translate to \r\n if needed


class TextTestResult(result.TestResult):
    """A test result class that can print formatted text results to a stream.

    Used by TextTestRunner.
    """
    separator1 = '=' * 70
    separator2 = '-' * 70

    def __init__(self, stream, descriptions, verbosity):
        super(TextTestResult, self).__init__(stream, descriptions, verbosity)
        self.stream = stream
        self.showAll = verbosity > 1
        self.dots = verbosity == 1
        self.descriptions = descriptions

    def getDescription(self, test):
        doc_first_line = test.shortDescription()
        if self.descriptions and doc_first_line:
            return '\n'.join((str(test), doc_first_line))
        else:
            return str(test)

    def startTest(self, test):
        super(TextTestResult, self).startTest(test)
        if self.showAll:
            self.stream.write(self.getDescription(test))
            self.stream.write(" ... ")
            self.stream.flush()

    def addSuccess(self, test):
        super(TextTestResult, self).addSuccess(test)
        if self.showAll:
            self.stream.writeln("ok")
        elif self.dots:
            self.stream.write('.')
            self.stream.flush()

    def addError(self, test, err):
        super(TextTestResult, self).addError(test, err)
        if self.showAll:
            self.stream.writeln("ERROR")
        elif self.dots:
            self.stream.write('E')
            self.stream.flush()

    def addFailure(self, test, err):
        super(TextTestResult, self).addFailure(test, err)
        if self.showAll:
            self.stream.writeln("FAIL")
        elif self.dots:
            self.stream.write('F')
            self.stream.flush()

    def addSkip(self, test, reason):
        super(TextTestResult, self).addSkip(test, reason)
        if self.showAll:
            self.stream.writeln("skipped {0!r}".format(reason))
        elif self.dots:
            self.stream.write("s")
            self.stream.flush()

    def addExpectedFailure(self, test, err):
        super(TextTestResult, self).addExpectedFailure(test, err)
        if self.showAll:
            self.stream.writeln("expected failure")
        elif self.dots:
            self.stream.write("x")
            self.stream.flush()

    def addUnexpectedSuccess(self, test):
        super(TextTestResult, self).addUnexpectedSuccess(test)
        if self.showAll:
            self.stream.writeln("unexpected success")
        elif self.dots:
            self.stream.write("u")
            self.stream.flush()

    def printErrors(self):
        if self.dots or self.showAll:
            self.stream.writeln()
        self.printErrorList('ERROR', self.errors)
        self.printErrorList('FAIL', self.failures)

    def printErrorList(self, flavour, errors):
        for test, err in errors:
            self.stream.writeln(self.separator1)
            self.stream.writeln("%s: %s" % (flavour,self.getDescription(test)))
            self.stream.writeln(self.separator2)
            self.stream.writeln("%s" % err)


class TextTestRunner(object):
    """A test runner class that displays results in textual form.

    It prints out the names of tests as they are run, errors as they
    occur, and a summary of the results at the end of the test run.
    """
    resultclass = TextTestResult

    def __init__(self, stream=None, descriptions=True, verbosity=1,
                 failfast=False, buffer=False, resultclass=None, warnings=None,
                 *, tb_locals=False):
        """Construct a TextTestRunner.

        Subclasses should accept **kwargs to ensure compatibility as the
        interface changes.
        """
        if stream is None:
            stream = sys.stderr
        self.stream = _WritelnDecorator(stream)
        self.descriptions = descriptions
        self.verbosity = verbosity
        self.failfast = failfast
        self.buffer = buffer
        self.tb_locals = tb_locals
        self.warnings = warnings
        if resultclass is not None:
            self.resultclass = resultclass

    def _makeResult(self):
        return self.resultclass(self.stream, self.descriptions, self.verbosity)

    def run(self, test):
        "Run the given test case or test suite."
        result = self._makeResult()
        registerResult(result)
        result.failfast = self.failfast
        result.buffer = self.buffer
        result.tb_locals = self.tb_locals
        with warnings.catch_warnings():
            if self.warnings:
                # if self.warnings is set, use it to filter all the warnings
                warnings.simplefilter(self.warnings)
                # if the filter is 'default' or 'always', special-case the
                # warnings from the deprecated unittest methods to show them
                # no more than once per module, because they can be fairly
                # noisy.  The -Wd and -Wa flags can be used to bypass this
                # only when self.warnings is None.
                if self.warnings in ['default', 'always']:
                    warnings.filterwarnings('module',
                            category=DeprecationWarning,
                            message=r'Please use assert\w+ instead.')
            startTime = time.perf_counter()
            startTestRun = getattr(result, 'startTestRun', None)
            if startTestRun is not None:
                startTestRun()
            try:
                test(result)
            finally:
                stopTestRun = getattr(result, 'stopTestRun', None)
                if stopTestRun is not None:
                    stopTestRun()
            stopTime = time.perf_counter()
        timeTaken = stopTime - startTime
        result.printErrors()
        if hasattr(result, 'separator2'):
            self.stream.writeln(result.separator2)
        run = result.testsRun
        self.stream.writeln("Ran %d test%s in %.3fs" %
                            (run, run != 1 and "s" or "", timeTaken))
        self.stream.writeln()

        expectedFails = unexpectedSuccesses = skipped = 0
        try:
            results = map(len, (result.expectedFailures,
                                result.unexpectedSuccesses,
                                result.skipped))
        except AttributeError:
            pass
        else:
            expectedFails, unexpectedSuccesses, skipped = results

        infos = []
        if not result.wasSuccessful():
            self.stream.write("FAILED")
            failed, errored = len(result.failures), len(result.errors)
            if failed:
                infos.append("failures=%d" % failed)
            if errored:
                infos.append("errors=%d" % errored)
        else:
            self.stream.write("OK")
        if skipped:
            infos.append("skipped=%d" % skipped)
        if expectedFails:
            infos.append("expected failures=%d" % expectedFails)
        if unexpectedSuccesses:
            infos.append("unexpected successes=%d" % unexpectedSuccesses)
        if infos:
            self.stream.writeln(" (%s)" % (", ".join(infos),))
        else:
            self.stream.write("\n")
        return result
unittest/__pycache__/case.cpython-38.opt-1.pyc000064400000142400151153537550015150 0ustar00U

e5d���@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
Z
ddlmZmZmZmZmZdZe�ZdZGdd	�d	e�ZGd
d�de�ZGdd
�d
e�ZGdd�de�Zdd�ZgZdd�Zdd�Z dd�Z!dd�Z"dd�Z#dd�Z$dd�Z%Gd d!�d!�Z&Gd"d#�d#e&�Z'Gd$d%�d%e'�Z(Gd&d'�d'e'�Z)e�*d(d)d*g�Z+Gd+d,�d,ej,�Z-Gd-d.�d.e&�Z.Gd/d0�d0ej/�Z0Gd1d2�d2e�Z1Gd3d4�d4e1�Z2Gd5d6�d6e1�Z3dS)7zTest case implementation�N�)�result)�strclass�	safe_repr�_count_diff_all_purpose�_count_diff_hashable�_common_shorten_reprTz@
Diff is %s characters long. Set self.maxDiff to None to see it.c@seZdZdZdS)�SkipTestz�
    Raise this exception in a test to skip it.

    Usually you can use TestCase.skipTest() or one of the skipping decorators
    instead of raising this directly.
    N��__name__�
__module__�__qualname__�__doc__�rr�%/usr/lib64/python3.8/unittest/case.pyr	sr	c@seZdZdZdS)�_ShouldStopz
    The test should stop.
    Nr
rrrrr"src@seZdZdZdS)�_UnexpectedSuccessz7
    The test was supposed to fail, but it didn't!
    Nr
rrrrr'src@s&eZdZddd�Zejddd��ZdS)	�_OutcomeNcCs4d|_||_t|d�|_d|_g|_d|_g|_dS)NF�
addSubTestT)�expecting_failurer�hasattr�result_supports_subtests�success�skipped�expectedFailure�errors)�selfrrrr�__init__.sz_Outcome.__init__Fc
cs�|j}d|_z�z
dVWn�tk
r.�Yn�tk
rh}zd|_|j�|t|�f�W5d}~XYnjtk
rzYnXt��}|j	r�||_
nd|_|j�||f�d}YnX|jr�|jr�|j�|df�W5|jo�||_XdS)NTF)
r�KeyboardInterruptr	r�append�strr�sys�exc_inforrrr)r�	test_case�isTestZold_success�er"rrr�testPartExecutor7s*
$
z_Outcome.testPartExecutor)N)F)rrr
r�
contextlib�contextmanagerr&rrrrr-s
	rcCs|S�Nr)�objrrr�_idUsr+cOst�|||f�dS)znSame as addCleanup, except the cleanup items are called even if
    setUpModule fails (unlike tearDownModule).N)�_module_cleanupsr)�function�args�kwargsrrr�addModuleCleanupZsr0c
Csdg}trTt��\}}}z|||�Wqtk
rP}z|�|�W5d}~XYqXq|r`|d�dS)zWExecute all module cleanup functions. Normally called for you after
    tearDownModule.Nr)r,�pop�	Exceptionr)�
exceptionsr-r.r/�excrrr�doModuleCleanups`sr5cs,�fdd�}t�tj�r(�}d�||�S|S)z&
    Unconditionally skip a test.
    cs4t|t�s$t�|��fdd��}|}d|_�|_|S)Ncst���dSr)�r	�r.r/��reasonrr�skip_wrappervsz-skip.<locals>.decorator.<locals>.skip_wrapperT)�
isinstance�type�	functools�wraps�__unittest_skip__�__unittest_skip_why__)�	test_itemr:r8rr�	decoratorts
zskip.<locals>.decorator�)r;�types�FunctionType)r9rBrArr8r�skipps
rFcCs|rt|�StS)z/
    Skip a test if the condition is true.
    �rFr+�Z	conditionr9rrr�skipIf�srIcCs|st|�StS)z3
    Skip a test unless the condition is true.
    rGrHrrr�
skipUnless�srJcCs
d|_|S)NT)�__unittest_expecting_failure__)rArrrr�srcs4t|t�r t�fdd�|D��St|t�o2t|��S)Nc3s|]}t|��VqdSr))�_is_subtype)�.0r%��basetyperr�	<genexpr>�sz_is_subtype.<locals>.<genexpr>)r;�tuple�allr<�
issubclass)�expectedrOrrNrrL�s
rLc@seZdZdd�Zdd�ZdS)�_BaseTestCaseContextcCs
||_dSr))r#)rr#rrrr�sz_BaseTestCaseContext.__init__cCs |j�|j|�}|j�|��dSr))r#�_formatMessage�msg�failureException)r�standardMsgrWrrr�
_raiseFailure�sz"_BaseTestCaseContext._raiseFailureN)rrr
rrZrrrrrU�srUc@seZdZddd�Zdd�ZdS)�_AssertRaisesBaseContextNcCs@t�||�||_||_|dk	r*t�|�}||_d|_d|_dSr))	rUrrTr#�re�compile�expected_regex�obj_namerW)rrTr#r^rrrr�s
z!_AssertRaisesBaseContext.__init__c	Cs�z�t|j|j�s"td||jf��|sV|�dd�|_|rNtdtt|��f��|W�TS|^}}z|j	|_
Wntk
r�t|�|_
YnX|�|||�W5QRXW5d}XdS)z�
        If args is empty, assertRaises/Warns is being used as a
        context manager, so check for a 'msg' kwarg and return self.
        If args is not empty, call a callable passing positional and keyword
        arguments.
        Nz%s() arg 1 must be %srWz3%r is an invalid keyword argument for this function)
rLrT�
_base_type�	TypeError�_base_type_strr1rW�next�iterrr_�AttributeErrorr )r�namer.r/Zcallable_objrrr�handle�s(��z_AssertRaisesBaseContext.handle)N)rrr
rrgrrrrr[�s

r[c@s(eZdZdZeZdZdd�Zdd�ZdS)�_AssertRaisesContextzCA context manager used to implement TestCase.assertRaises* methods.z-an exception type or tuple of exception typescCs|Sr)r�rrrr�	__enter__�sz_AssertRaisesContext.__enter__cCs�|dkrbz|jj}Wntk
r2t|j�}YnX|jrP|�d�||j��ql|�d�|��n
t�|�t	||j�s|dS|�
d�|_|jdkr�dS|j}|�
t|��s�|�d�|jt|���dS)Nz{} not raised by {}z
{} not raisedFT�"{}" does not match "{}")rTrrer r_rZ�format�	traceback�clear_framesrS�with_tracebackZ	exceptionr^�search�pattern)r�exc_type�	exc_value�tb�exc_namer^rrr�__exit__�s.
�

�z_AssertRaisesContext.__exit__N)	rrr
r�
BaseExceptionr`rbrjrvrrrrrh�s
rhc@s(eZdZdZeZdZdd�Zdd�ZdS)�_AssertWarnsContextzBA context manager used to implement TestCase.assertWarns* methods.z(a warning type or tuple of warning typescCsRttj���D]}t|dd�ri|_qtjdd�|_|j�	�|_t�
d|j�|S)N�__warningregistry__T)�record�always)�listr!�modules�values�getattrry�warnings�catch_warnings�warnings_managerrj�simplefilterrT)r�vrrrrj�sz_AssertWarnsContext.__enter__cCs|j�|||�|dk	rdSz|jj}Wntk
rFt|j�}YnXd}|jD]Z}|j}t||j�sjqR|dkrv|}|j	dk	r�|j	�
t|��s�qR||_|j|_|j
|_
dS|dk	r�|�d�|j	jt|���|jr�|�d�||j��n|�d�|��dS)Nrkz{} not triggered by {}z{} not triggered)r�rvrTrrer r��messager;r^rpZwarning�filename�linenorZrlrqr_)rrrrsrtruZfirst_matching�m�wrrrrvs@

��
�z_AssertWarnsContext.__exit__N)	rrr
r�Warningr`rbrjrvrrrrrx�s
rx�_LoggingWatcher�records�outputc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_CapturingHandlerzM
    A logging handler capturing all (raw and formatted) logging output.
    cCstj�|�tgg�|_dSr))�logging�Handlerrr��watcherrirrrr3sz_CapturingHandler.__init__cCsdSr)rrirrr�flush7sz_CapturingHandler.flushcCs*|jj�|�|�|�}|jj�|�dSr))r�r�rrlr�)rrzrWrrr�emit:s
z_CapturingHandler.emitN)rrr
rrr�r�rrrrr�.sr�c@s,eZdZdZdZdd�Zdd�Zdd�Zd	S)
�_AssertLogsContextz:A context manager used to implement TestCase.assertLogs().z"%(levelname)s:%(name)s:%(message)scCs:t�||�||_|r(tj�||�|_ntj|_d|_dSr))	rUr�logger_namer�Z_nameToLevel�get�level�INFOrW)rr#r�r�rrrrFsz_AssertLogsContext.__init__cCs�t|jtj�r|j}|_nt�|j�}|_t�|j�}t�}|�	|�|j
|_
|jdd�|_|j
|_|j|_|g|_|�|j
�d|_|j
S)NF)r;r�r�ZLogger�loggerZ	getLoggerZ	Formatter�LOGGING_FORMATr�ZsetFormatterr��handlers�old_handlersr��	old_level�	propagate�
old_propagate�setLevel)rr�Z	formatterZhandlerrrrrjOs
z_AssertLogsContext.__enter__cCs`|j|j_|j|j_|j�|j�|dk	r.dSt|jj	�dkr\|�
d�t�
|j�|jj��dS)NFrz-no logs of level {} or higher triggered on {})r�r�r�r�r�r�r��lenr�r�rZrlr�ZgetLevelNamer�rf)rrrrsrtrrrrv`s


��z_AssertLogsContext.__exit__N)rrr
rr�rrjrvrrrrr�As
	r�c@seZdZdd�ZdS)�_OrderedChainMapccs8t�}|jD]&}|D]}||kr|�|�|VqqdSr))�set�maps�add)r�seen�mapping�krrr�__iter__ns

z_OrderedChainMap.__iter__N)rrr
r�rrrrr�msr�c@seZdZdZeZdZdZdZdZ	gZ
d�dd�Zd	d
�Zdd�Z
d
e
_edd��Zdd�Zdd�Zedd��Zedd��Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zeje fd*d+��Z!d,d-�Z"d.d/�Z#d0d1�Z$d2d3�Z%d4d5�Z&d6d7�Z'd8d9�Z(d�d;d<�Z)d=d>�Z*ed?d@��Z+dAdB�Z,dCdD�Z-dEdF�Z.d�dGdH�Z/d�dIdJ�Z0d�dKdL�Z1dMdN�Z2dOdP�Z3dQdR�Z4d�dSdT�Z5dUdV�Z6d�dWdX�Z7d�dYdZ�Z8d�d[d\�Z9d�d]d^�Z:d�d_d`�Z;d�dadb�Z<dcdd�Z=d�dedf�Z>d�dgdh�Z?d�didj�Z@d�dkdl�ZAd�dmdn�ZBd�dodp�ZCd�dqdr�ZDd�dsdt�ZEd�dudv�ZFd�dwdx�ZGd�dydz�ZHd�d{d|�ZId�d}d~�ZJd�dd��ZKd�d�d��ZLd�d�d��ZMd�d�d��ZNd�d�d��ZOd�d�d��ZPd�d��ZQd�d��ZRd�d�d��ZSd�d�d��ZTd�d��ZUeUe8�ZVZWeUe9�ZXZYeUe:�ZZZ[eUe;�Z\Z]eUe1�Z^Z_eUe3�Z`eUe0�ZaeUeQ�ZbeUeS�ZceUeT�Zdd:S)��TestCaseaWA class whose instances are single test cases.

    By default, the test code itself should be placed in a method named
    'runTest'.

    If the fixture may be used for many test cases, create as
    many test methods as are needed. When instantiating such a TestCase
    subclass, specify in the constructor arguments the name of the test method
    that the instance is to execute.

    Test authors should subclass TestCase for their own tests. Construction
    and deconstruction of the test's environment ('fixture') can be
    implemented by overriding the 'setUp' and 'tearDown' methods respectively.

    If it is necessary to override the __init__ method, the base class
    __init__ method must always be called. It is important that subclasses
    should not change the signature of their __init__ method, since instances
    of the classes are instantiated automatically by parts of the framework
    in order to be run.

    When subclassing TestCase, you can set these attributes:
    * failureException: determines which exception will be raised when
        the instance's assertion methods fail; test methods raising this
        exception will be deemed to have 'failed' rather than 'errored'.
    * longMessage: determines whether long messages (including repr of
        objects used in assert methods) will be printed on failure in *addition*
        to any explicit message passed.
    * maxDiff: sets the maximum length of a diff in failure messages
        by assert methods using difflib. It is looked up as an instance
        attribute so can be configured by individual tests if required.
    Ti�iF�runTestcCs�||_d|_d|_zt||�}Wn.tk
rN|dkrJtd|j|f��Yn
X|j|_g|_d|_	i|_
|�td�|�t
d�|�td�|�td�|�td�|�td	�dS)
z�Create an instance of the class that will use the named test
           method when executed. Raises a ValueError if the instance does
           not have a method with the specified name.
        NzNo testr�zno such test method in %s: %s�assertDictEqual�assertListEqual�assertTupleEqual�assertSetEqual�assertMultiLineEqual)�_testMethodName�_outcome�_testMethodDocrre�
ValueError�	__class__r�	_cleanups�_subtest�_type_equality_funcs�addTypeEqualityFunc�dictr|rQr��	frozensetr )rZ
methodName�
testMethodrrrr�s(�zTestCase.__init__cCs||j|<dS)a[Add a type specific assertEqual style function to compare a type.

        This method is for use by TestCase subclasses that need to register
        their own type equality functions to provide nicer error messages.

        Args:
            typeobj: The data type to call this function on when both values
                    are of the same type in assertEqual().
            function: The callable taking two arguments and an optional
                    msg= argument that raises self.failureException with a
                    useful error message when the two arguments are not equal.
        N)r�)rZtypeobjr-rrrr��s
zTestCase.addTypeEqualityFunccOs�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d	��t|�}|j�|||f�dS)
aAdd a function, with arguments, to be called when the test is
        completed. Functions added are called on a LIFO basis and are
        called after tearDown on test failure or success.

        Cleanup items are called even if setUp fails (unlike tearDown).�z>descriptor 'addCleanup' of 'TestCase' object needs an argumentr-rNz4Passing 'function' as keyword argument is deprecated)�
stacklevelz:addCleanup expected at least 1 positional argument, got %dr)	r�rar1r��warn�DeprecationWarningrQr�r)r.r/rr-r�rrr�
addCleanup�s"

�
�zTestCase.addCleanupz%($self, function, /, *args, **kwargs)cOs|j�|||f�dS)zpSame as addCleanup, except the cleanup items are called even if
        setUpClass fails (unlike tearDownClass).N)�_class_cleanupsr)�clsr-r.r/rrr�addClassCleanup�szTestCase.addClassCleanupcCsdS)zAHook method for setting up the test fixture before exercising it.Nrrirrr�setUp�szTestCase.setUpcCsdS)zAHook method for deconstructing the test fixture after testing it.Nrrirrr�tearDown�szTestCase.tearDowncCsdS)zKHook method for setting up class fixture before running tests in the class.Nr�r�rrr�
setUpClass�szTestCase.setUpClasscCsdS)zVHook method for deconstructing the class fixture after running all tests in the class.Nrr�rrr�
tearDownClassszTestCase.tearDownClasscCsdS)Nrrrirrr�countTestCasesszTestCase.countTestCasescCst��Sr))rZ
TestResultrirrr�defaultTestResult	szTestCase.defaultTestResultcCs$|j}|r |���d�d��SdS)z�Returns a one-line description of the test, or None if no
        description has been provided.

        The default implementation of this method returns the first line of
        the specified test method's docstring.
        �
rN)r��strip�split�r�docrrr�shortDescriptionszTestCase.shortDescriptioncCsdt|j�|jfS)Nz%s.%s�rr�r�rirrr�idszTestCase.idcCs t|�t|�k	rtS|j|jkSr))r<�NotImplementedr��r�otherrrr�__eq__szTestCase.__eq__cCstt|�|jf�Sr))�hashr<r�rirrr�__hash__ szTestCase.__hash__cCsd|jt|j�fS�Nz%s (%s))r�rr�rirrr�__str__#szTestCase.__str__cCsdt|j�|jfS)Nz<%s testMethod=%s>r�rirrr�__repr__&s�zTestCase.__repr__cCs<t|dd�}|dk	r |||�nt�dtd�|�|�dS)N�addSkipz4TestResult has no addSkip method, skips not reportedr�)rr�r��RuntimeWarning�
addSuccess)rrr#r9r�rrr�_addSkip*s�zTestCase._addSkipc	ks�|jdks|jjsdVdS|j}|dkr4t|�}n|j�|�}t|||�|_zX|jj|jdd��dVW5QRX|jjs�|jj	}|dk	r�|j
r�t�n|jjr�t�W5||_XdS)aPReturn a context manager that will return the enclosed block
        of code in a subtest identified by the optional message and
        keyword parameters.  A failure in the subtest marks the test
        case as failed but resumes execution at the end of the enclosed
        block, allowing further test code to be executed.
        NT�r$)
r�rr�r��params�	new_child�_SubTestr&rrZfailfastrr)rrWr��parentZ
params_maprrrr�subTest3s$
zTestCase.subTestcCs`|D]V\}}t|t�r(|�|j||�q|dk	rt|d|j�rN|�||�q|�||�qdS)Nr)r;r�rr#rSrX�
addFailureZaddError)rrr�testr"rrr�_feedErrorsToResultRs
zTestCase._feedErrorsToResultcCsDz
|j}Wn*tk
r4t�dt�|�|�YnX|||�dS)Nz@TestResult has no addExpectedFailure method, reporting as passes)�addExpectedFailurerer�r�r�r�)rrr"r�rrr�_addExpectedFailure\s
�zTestCase._addExpectedFailurecCshz
|j}WnPtk
rZt�dt�z
td�Wn$tk
rT|�|t���YnXYn
X||�dS)NzCTestResult has no addUnexpectedSuccess method, reporting as failure)	�addUnexpectedSuccessrer�r�r�rr�r!r")rrr�rrr�_addUnexpectedSuccessfs
�
zTestCase._addUnexpectedSuccesscCs|��dSr))r�rirrr�
_callSetUpuszTestCase._callSetUpcCs
|�dSr)r)r�methodrrr�_callTestMethodxszTestCase._callTestMethodcCs|��dSr))r�rirrr�
_callTearDown{szTestCase._callTearDowncOs|||�dSr)r�rr-r.r/rrr�_callCleanup~szTestCase._callCleanupNc

Cs|}|dkr.|��}t|dd�}|dk	r.|�|�|�t||j�}t|jdd�s^t|dd�r�z,t|jdd�pxt|dd�}|�|||�W5|�|�XdSt|dd�}t|dd�}|p�|}t|�}	z�|	|_|	�|��|�
�W5QRX|	j�r@||	_|	j|dd	��|�|�W5QRXd|	_|	�|��|��W5QRX|��|	jD]\}}|�|||��qN|�||	j�|	j�r�|�r�|	j
�r�|�||	j
�n
|�|�n
|�|�|W�S|�|�|dk�r�t|dd�}
|
dk	�r�|
�|	j�	�d|	_
d|_XdS)
N�startTestRunr?Fr@rCrK�stopTestRunTr�)r�rZ	startTestr�r�ZstopTestr�rr�clearrr�r&r�rrr�r��
doCleanupsrr�r�r�r�)
rrZorig_resultr�r�Zskip_whyZexpecting_failure_methodZexpecting_failure_classr�outcomer�r�r9rrr�run�st

�
���




zTestCase.runc	CsR|jp
t�}|jrL|j��\}}}|�|��|j|f|�|�W5QRXq|jS)zNExecute all cleanup functions. Normally called for you after
        tearDown.)r�rr�r1r&r�r)rr�r-r.r/rrrr��szTestCase.doCleanupsc
Csdg|_|jr`|j��\}}}z|||�Wqtk
r\}z|j�t���W5d}~XYqXqdS)zYExecute all class cleanup functions. Normally called for you after
        tearDownClass.N)ZtearDown_exceptionsr�r1r2rr!r")r�r-r.r/r4rrr�doClassCleanups�szTestCase.doClassCleanupscOs|j||�Sr))r�)rr.�kwdsrrr�__call__�szTestCase.__call__cCsF|��t||j��|��|jrB|j�d�\}}}|||�qdS)z6Run the test without collecting errors in a TestResult���N)r�rr�r�r�r1r�rrr�debug�szTestCase.debugcCst|��dS)zSkip this test.Nr6)rr9rrr�skipTest�szTestCase.skipTestcCs|�|��dS)z)Fail immediately, with the given message.N)rX)rrWrrr�fail�sz
TestCase.failcCs&|r"|�|dt|��}|�|��dS)z#Check that the expression is false.z%s is not falseN�rVrrX�r�exprrWrrr�assertFalse�szTestCase.assertFalsecCs&|s"|�|dt|��}|�|��dS)z"Check that the expression is true.z%s is not trueNrrrrr�
assertTrue�szTestCase.assertTruecCsV|js|p|S|dkr|Szd||fWStk
rPdt|�t|�fYSXdS)a�Honour the longMessage attribute when generating failure messages.
        If longMessage is False this means:
        * Use only an explicit message if it is provided
        * Otherwise use the standard message for the assert

        If longMessage is True:
        * Use the standard message
        * If an explicit message is provided, plus ' : ' and the explicit message
        Nz%s : %s)�longMessage�UnicodeDecodeErrorr)rrWrYrrrrV�s
zTestCase._formatMessagecOs(t||�}z|�d||�W�Sd}XdS)a=Fail unless an exception of class expected_exception is raised
           by the callable when invoked with specified positional and
           keyword arguments. If a different type of exception is
           raised, it will not be caught, and the test case will be
           deemed to have suffered an error, exactly as for an
           unexpected exception.

           If called with the callable and arguments omitted, will return a
           context object used like this::

                with self.assertRaises(SomeException):
                    do_something()

           An optional keyword argument 'msg' can be provided when assertRaises
           is used as a context object.

           The context manager keeps a reference to the exception as
           the 'exception' attribute. This allows you to inspect the
           exception after the assertion::

               with self.assertRaises(SomeException) as cm:
                   do_something()
               the_exception = cm.exception
               self.assertEqual(the_exception.error_code, 3)
        N�assertRaises�rhrg)r�expected_exceptionr.r/�contextrrrrs
zTestCase.assertRaisescOst||�}|�d||�S)a�Fail unless a warning of class warnClass is triggered
           by the callable when invoked with specified positional and
           keyword arguments.  If a different type of warning is
           triggered, it will not be handled: depending on the other
           warning filtering rules in effect, it might be silenced, printed
           out, or raised as an exception.

           If called with the callable and arguments omitted, will return a
           context object used like this::

                with self.assertWarns(SomeWarning):
                    do_something()

           An optional keyword argument 'msg' can be provided when assertWarns
           is used as a context object.

           The context manager keeps a reference to the first matching
           warning as the 'warning' attribute; similarly, the 'filename'
           and 'lineno' attributes give you information about the line
           of Python code from which the warning was triggered.
           This allows you to inspect the warning after the assertion::

               with self.assertWarns(SomeWarning) as cm:
                   do_something()
               the_warning = cm.warning
               self.assertEqual(the_warning.some_attribute, 147)
        �assertWarns�rxrg)r�expected_warningr.r/rrrrr5s
zTestCase.assertWarnscCst|||�S)a�Fail unless a log message of level *level* or higher is emitted
        on *logger_name* or its children.  If omitted, *level* defaults to
        INFO and *logger* defaults to the root logger.

        This method must be used as a context manager, and will yield
        a recording object with two attributes: `output` and `records`.
        At the end of the context manager, the `output` attribute will
        be a list of the matching formatted log messages and the
        `records` attribute will be a list of the corresponding LogRecord
        objects.

        Example::

            with self.assertLogs('foo', level='INFO') as cm:
                logging.getLogger('foo').info('first message')
                logging.getLogger('foo.bar').error('second message')
            self.assertEqual(cm.output, ['INFO:foo:first message',
                                         'ERROR:foo.bar:second message'])
        )r�)rr�r�rrr�
assertLogsTszTestCase.assertLogscCsFt|�t|�kr@|j�t|��}|dk	r@t|t�r<t||�}|S|jS)aGet a detailed comparison function for the types of the two args.

        Returns: A callable accepting (first, second, msg=None) that will
        raise a failure exception if first != second with a useful human
        readable error message for those types.
        N)r<r�r�r;r r�_baseAssertEqual)r�first�secondZasserterrrr�_getAssertEqualityFuncjs

zTestCase._getAssertEqualityFunccCs0||ks,dt||�}|�||�}|�|��dS)z:The default assertEqual implementation, not type specific.�%s != %sN)rrVrX)rrrrWrYrrrr�szTestCase._baseAssertEqualcCs|�||�}||||d�dS)z[Fail if the two objects are unequal as determined by the '=='
           operator.
        )rWN)r)rrrrWZassertion_funcrrr�assertEqual�szTestCase.assertEqualcCs2||ks.|�|dt|�t|�f�}|�|��dS)zYFail if the two objects are equal as determined by the '!='
           operator.
        z%s == %sNr)rrrrWrrr�assertNotEqual�s
�zTestCase.assertNotEqualcCs�||krdS|dk	r$|dk	r$td��t||�}|dk	rf||krDdSdt|�t|�t|�t|�f}n:|dkrrd}t||�dkr�dSdt|�t|�|t|�f}|�||�}|�|��dS)a'Fail if the two objects are unequal as determined by their
           difference rounded to the given number of decimal places
           (default 7) and comparing to zero, or by comparing that the
           difference between the two objects is more than the given
           delta.

           Note that decimal places (from zero) are usually not the same
           as significant digits (measured from the most significant digit).

           If the two objects compare equal then they will automatically
           compare almost equal.
        N� specify delta or places not bothz(%s != %s within %s delta (%s difference)�rz)%s != %s within %r places (%s difference)�ra�absr�roundrVrX�rrrZplacesrWZdelta�diffrYrrr�assertAlmostEqual�s4��zTestCase.assertAlmostEqualcCs�|dk	r|dk	rtd��t||�}|dk	rb||ks@||kr@dSdt|�t|�t|�t|�f}n<|dkrnd}||ks�t||�dkr�dSdt|�t|�|f}|�||�}|�|��dS)a�Fail if the two objects are equal as determined by their
           difference rounded to the given number of decimal places
           (default 7) and comparing to zero, or by comparing that the
           difference between the two objects is less than the given delta.

           Note that decimal places (from zero) are usually not the same
           as significant digits (measured from the most significant digit).

           Objects that are equal automatically fail.
        Nrz(%s == %s within %s delta (%s difference)rrz%s == %s within %r placesrrrrr�assertNotAlmostEqual�s,��zTestCase.assertNotAlmostEqualcCs�|dk	rP|j}t||�s.|�d|t|�f��t||�sT|�d|t|�f��nd}d}zt|�}Wn ttfk
r�d|}YnX|dkr�zt|�}Wn ttfk
r�d|}YnX|dk�r�||kr�dSd|��ft||�}t	t
||��D]�}	z||	}
Wn4tttfk
�r<|d|	|f7}Y�q�YnXz||	}Wn4tttfk
�r~|d	|	|f7}Y�q�YnX|
|kr�|d
|	ft|
|�7}�q�q�||k�r�|dk�r�t|�t|�k�r�dS||k�r<|d|||f7}z|d|t||�f7}Wn,tttfk
�r8|d
||f7}YnXnh||k�r�|d|||f7}z|d|t||�f7}Wn,tttfk
�r�|d||f7}YnX|}dd�
t�t�|���t�|�����}
|�||
�}|�||�}|�|�dS)aAAn equality assertion for ordered sequences (like lists and tuples).

        For the purposes of this function, a valid ordered sequence type is one
        which can be indexed, has a length, and has an equality operator.

        Args:
            seq1: The first sequence to compare.
            seq2: The second sequence to compare.
            seq_type: The expected datatype of the sequences, or None if no
                    datatype should be enforced.
            msg: Optional message to use on failure instead of a list of
                    differences.
        NzFirst sequence is not a %s: %szSecond sequence is not a %s: %sZsequencez(First %s has no length.    Non-sequence?z)Second %s has no length.    Non-sequence?z%ss differ: %s != %s
z(
Unable to index element %d of first %s
z)
Unable to index element %d of second %s
z#
First differing element %d:
%s
%s
z+
First %s contains %d additional elements.
zFirst extra element %d:
%s
z'Unable to index element %d of first %s
z,
Second %s contains %d additional elements.
z(Unable to index element %d of second %s
r�)rr;rXrr�ra�NotImplementedError�
capitalizer�range�min�
IndexErrorr<�join�difflib�ndiff�pprint�pformat�
splitlines�_truncateMessagerVr)rZseq1Zseq2rW�seq_typeZ
seq_type_nameZ	differingZlen1Zlen2�iZitem1Zitem2rY�diffMsgrrr�assertSequenceEqual�s�

�

��
�

������

��
�

��
���zTestCase.assertSequenceEqualcCs2|j}|dkst|�|kr"||S|tt|�Sr))�maxDiffr��DIFF_OMITTED)rr�rZmax_diffrrrr+NszTestCase._truncateMessagecCs|j|||td�dS)aA list-specific equality assertion.

        Args:
            list1: The first list to compare.
            list2: The second list to compare.
            msg: Optional message to use on failure instead of a list of
                    differences.

        �r,N)r/r|)rZlist1Zlist2rWrrrr�Ts
zTestCase.assertListEqualcCs|j|||td�dS)aA tuple-specific equality assertion.

        Args:
            tuple1: The first tuple to compare.
            tuple2: The second tuple to compare.
            msg: Optional message to use on failure instead of a list of
                    differences.
        r2N)r/rQ)rZtuple1Ztuple2rWrrrr�`s	zTestCase.assertTupleEqualc

Cs`z|�|�}Wn^tk
r>}z|�d|�W5d}~XYn0tk
rl}z|�d|�W5d}~XYnXz|�|�}Wn^tk
r�}z|�d|�W5d}~XYn0tk
r�}z|�d|�W5d}~XYnX|s�|s�dSg}|�r|�d�|D]}|�t|���q|�r@|�d�|D]}|�t|���q*d�|�}	|�|�||	��dS)a�A set-specific equality assertion.

        Args:
            set1: The first set to compare.
            set2: The second set to compare.
            msg: Optional message to use on failure instead of a list of
                    differences.

        assertSetEqual uses ducktyping to support different types of sets, and
        is optimized for sets specifically (parameters must support a
        difference method).
        z/invalid type when attempting set difference: %sNz2first argument does not support set difference: %sz3second argument does not support set difference: %sz*Items in the first set but not the second:z*Items in the second set but not the first:r�)�
differencerarrer�reprr%rV)
rZset1Zset2rWZdifference1r%Zdifference2�lines�itemrYrrrr�ks2
  


zTestCase.assertSetEqualcCs2||kr.dt|�t|�f}|�|�||��dS)zDJust like self.assertTrue(a in b), but with a nicer default message.z%s not found in %sN�rrrV�r�memberZ	containerrWrYrrr�assertIn�s
�zTestCase.assertIncCs2||kr.dt|�t|�f}|�|�||��dS)zHJust like self.assertTrue(a not in b), but with a nicer default message.z%s unexpectedly found in %sNr7r8rrr�assertNotIn�s
�zTestCase.assertNotIncCs2||k	r.dt|�t|�f}|�|�||��dS)zDJust like self.assertTrue(a is b), but with a nicer default message.z%s is not %sNr7�rZexpr1Zexpr2rWrYrrr�assertIs�s
�zTestCase.assertIscCs,||kr(dt|�f}|�|�||��dS)zHJust like self.assertTrue(a is not b), but with a nicer default message.zunexpectedly identical: %sNr7r<rrr�assertIsNot�szTestCase.assertIsNotc	Cs~|�|td�|�|td�||krzdt||�}dd�t�t�|���t�|�����}|�	||�}|�
|�||��dS)Nz"First argument is not a dictionaryz#Second argument is not a dictionaryrr�)�assertIsInstancer�rr%r&r'r(r)r*r+rrV)rZd1Zd2rWrYrrrrr��s
�zTestCase.assertDictEqualc		Cs�t�dt�g}g}|��D]L\}}||kr8|�|�q|||kr|�dt|�t|�t||�f�q|sv|svdSd}|r�dd�dd�|D��}|r�|r�|d	7}|d
d�|�7}|�|�||��dS)z2Checks whether dictionary is a superset of subset.z&assertDictContainsSubset is deprecatedz%s, expected: %s, actual: %sNrCzMissing: %s�,css|]}t|�VqdSr))r)rMr�rrrrP�sz4TestCase.assertDictContainsSubset.<locals>.<genexpr>z; zMismatched values: %s)	r�r�r��itemsrrr%rrV)	rZsubsetZ
dictionaryrWZmissingZ
mismatched�key�valuerYrrr�assertDictContainsSubset�s4�
���
z!TestCase.assertDictContainsSubsetc
Cs�t|�t|�}}zt�|�}t�|�}Wntk
rHt||�}YnX||krVdSt||�}|r�d}dd�|D�}d�|�}	|�||	�}|�||�}|�	|�dS)a[Asserts that two iterables have the same elements, the same number of
        times, without regard to order.

            self.assertEqual(Counter(list(first)),
                             Counter(list(second)))

         Example:
            - [0, 1, 1] and [1, 0, 1] compare equal.
            - [0, 0, 1] and [0, 1] compare unequal.

        NzElement counts were not equal:
cSsg|]}d|�qS)z First has %d, Second has %d:  %rr)rMrrrr�
<listcomp>�sz-TestCase.assertCountEqual.<locals>.<listcomp>r�)
r|�collections�Counterrarrr%r+rVr)
rrrrWZ	first_seqZ
second_seqZdifferencesrYr5r.rrr�assertCountEqual�s 


zTestCase.assertCountEqualcCs�|�|td�|�|td�||kr�t|�|jks@t|�|jkrN|�|||�|jdd�}|jdd�}t|�dkr�|�d�|kr�|dg}|dg}dt||�}dd	�t	�
||��}|�||�}|�|�
||��d
S)z-Assert that two multi-line strings are equal.zFirst argument is not a stringzSecond argument is not a stringT)�keependsrz
r�rrCN)r?r r��_diffThresholdrr*r�rr%r&r'r+rrV)rrrrWZ
firstlinesZsecondlinesrYrrrrr��s �

zTestCase.assertMultiLineEqualcCs2||ks.dt|�t|�f}|�|�||��dS)zCJust like self.assertTrue(a < b), but with a nicer default message.z%s not less than %sNr7�r�a�brWrYrrr�
assertLessszTestCase.assertLesscCs2||ks.dt|�t|�f}|�|�||��dS)zDJust like self.assertTrue(a <= b), but with a nicer default message.z%s not less than or equal to %sNr7rKrrr�assertLessEqualszTestCase.assertLessEqualcCs2||ks.dt|�t|�f}|�|�||��dS)zCJust like self.assertTrue(a > b), but with a nicer default message.z%s not greater than %sNr7rKrrr�
assertGreaterszTestCase.assertGreatercCs2||ks.dt|�t|�f}|�|�||��dS)zDJust like self.assertTrue(a >= b), but with a nicer default message.z"%s not greater than or equal to %sNr7rKrrr�assertGreaterEqual szTestCase.assertGreaterEqualcCs,|dk	r(dt|�f}|�|�||��dS)zCSame as self.assertTrue(obj is None), with a nicer default message.Nz%s is not Noner7�rr*rWrYrrr�assertIsNone&szTestCase.assertIsNonecCs"|dkrd}|�|�||��dS)z(Included for symmetry with assertIsNone.Nzunexpectedly None)rrVrRrrr�assertIsNotNone,szTestCase.assertIsNotNonecCs0t||�s,dt|�|f}|�|�||��dS)zTSame as self.assertTrue(isinstance(obj, cls)), with a nicer
        default message.z%s is not an instance of %rN�r;rrrV�rr*r�rWrYrrrr?2s
zTestCase.assertIsInstancecCs0t||�r,dt|�|f}|�|�||��dS)z,Included for symmetry with assertIsInstance.z%s is an instance of %rNrUrVrrr�assertNotIsInstance9s
zTestCase.assertNotIsInstancecOst|||�}|�d||�S)aAsserts that the message in a raised exception matches a regex.

        Args:
            expected_exception: Exception class expected to be raised.
            expected_regex: Regex (re.Pattern object or string) expected
                    to be found in error message.
            args: Function to be called and extra positional args.
            kwargs: Extra kwargs.
            msg: Optional message used in case of failure. Can only be used
                    when assertRaisesRegex is used as a context manager.
        �assertRaisesRegexr	)rr
r^r.r/rrrrrX?s
zTestCase.assertRaisesRegexcOst|||�}|�d||�S)a�Asserts that the message in a triggered warning matches a regexp.
        Basic functioning is similar to assertWarns() with the addition
        that only warnings whose messages also match the regular expression
        are considered successful matches.

        Args:
            expected_warning: Warning class expected to be triggered.
            expected_regex: Regex (re.Pattern object or string) expected
                    to be found in error message.
            args: Function to be called and extra positional args.
            kwargs: Extra kwargs.
            msg: Optional message used in case of failure. Can only be used
                    when assertWarnsRegex is used as a context manager.
        �assertWarnsRegexr
)rrr^r.r/rrrrrYOszTestCase.assertWarnsRegexcCsJt|ttf�rt�|�}|�|�sFd|j|f}|�||�}|�|��dS)z=Fail the test unless the text matches the regular expression.z&Regex didn't match: %r not found in %rN)	r;r �bytesr\r]rprqrVrX)r�textr^rWrYrrr�assertRegexbs

�zTestCase.assertRegexcCs`t|ttf�rt�|�}|�|�}|r\d||��|���|j|f}|�	||�}|�
|��dS)z9Fail the test if the text matches the regular expression.z"Regex matched: %r matches %r in %rN)r;r rZr\r]rp�start�endrqrVrX)rr[Zunexpected_regexrW�matchrYrrr�assertNotRegexns

�zTestCase.assertNotRegexcs�fdd�}|S)Ncs t�d��j�td��||�S)NzPlease use {0} instead.r�)r�r�rlrr�r7��
original_funcrr�deprecated_func~s
�z,TestCase._deprecate.<locals>.deprecated_funcr)rbrcrrar�
_deprecate}szTestCase._deprecate)r�)N)N)N)N)NN)N)N)N)NNN)NNN)NN)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)errr
r�AssertionErrorrXrr0rJZ_classSetupFailedr�rr�r��__text_signature__�classmethodr�r�r�r�r�r�r�r�r�r�r�r�r�r�r'r(�_subtest_msg_sentinelr�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrVrrrrrrrrrr/r+r�r�r�r:r;r=r>r�rDrHr�rNrOrPrQrSrTr?rWrXrYr\r`rdZfailUnlessEqualZassertEqualsZfailIfEqualZassertNotEqualsZfailUnlessAlmostEqualZassertAlmostEqualsZfailIfAlmostEqualZassertNotAlmostEqualsZ
failUnlessZassert_ZfailUnlessRaisesZfailIfZassertRaisesRegexpZassertRegexpMatchesZassertNotRegexpMatchesrrrrr�ws� 
 


	


E

	


!



	�
-�
#
c


+






 










	r�csjeZdZdZd�fdd�	Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
�ZS)�FunctionTestCaseaIA test case that wraps a test function.

    This is useful for slipping pre-existing test functions into the
    unittest framework. Optionally, set-up and tidy-up functions can be
    supplied. As with TestCase, the tidy-up ('tearDown') function will
    always be called if the set-up ('setUp') function ran successfully.
    Ncs*tt|���||_||_||_||_dSr))�superrir�
_setUpFunc�
_tearDownFunc�	_testFunc�_description)rZtestFuncr�r�Zdescription�r�rrr�s
zFunctionTestCase.__init__cCs|jdk	r|��dSr))rkrirrrr��s
zFunctionTestCase.setUpcCs|jdk	r|��dSr))rlrirrrr��s
zFunctionTestCase.tearDowncCs|��dSr))rmrirrrr��szFunctionTestCase.runTestcCs|jjSr))rmrrirrrr��szFunctionTestCase.idcCs@t||j�stS|j|jko>|j|jko>|j|jko>|j|jkSr))r;r�r�rkrlrmrnr�rrrr��s
�
�
�zFunctionTestCase.__eq__cCstt|�|j|j|j|jf�Sr))r�r<rkrlrmrnrirrrr��s�zFunctionTestCase.__hash__cCsdt|j�|jjfSr�)rr�rmrrirrrr��s
�zFunctionTestCase.__str__cCsdt|j�|jfS)Nz<%s tec=%s>)rr�rmrirrrr��s
�zFunctionTestCase.__repr__cCs2|jdk	r|jS|jj}|r.|�d�d��p0dS)Nr�r)rnrmrr�r�r�rrrr��s
z!FunctionTestCase.shortDescription)NNN)rrr
rrr�r�r�r�r�r�r�r�r��
__classcell__rrrorri�s	ricsDeZdZ�fdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Z�Z	S)
r�cs(t���||_||_||_|j|_dSr))rjr�_messager#r�rX)rr#r�r�rorrr�s

z_SubTest.__init__cCstd��dS)Nzsubtests cannot be run directly)r rirrrr��sz_SubTest.runTestcCs^g}|jtk	r |�d�|j��|jrPd�dd�|j��D��}|�d�|��d�|�p\dS)Nz[{}]z, css|]\}}d�||�VqdS)z{}={!r}N)rl)rMr�r�rrrrP�s�z+_SubTest._subDescription.<locals>.<genexpr>z({})� z(<subtest>))rqrhrrlr�r%rA)r�partsZparams_descrrr�_subDescription�s

�z_SubTest._subDescriptioncCsd�|j��|���S�Nz{} {})rlr#r�rtrirrrr��sz_SubTest.idcCs
|j��S)zlReturns a one-line description of the subtest, or None if no
        description has been provided.
        )r#r�rirrrr��sz_SubTest.shortDescriptioncCsd�|j|���Sru)rlr#rtrirrrr��sz_SubTest.__str__)
rrr
rr�rtr�r�r�rprrrorr��sr�)4rr!r=r&r�r(r\r�rFr'rmrDrCr�utilrrrrrZ
__unittest�objectrhr1r2r	rrrr+r,r0r5rFrIrJrrLrUr[rhrx�
namedtupler�r�r�r��ChainMapr�r�rir�rrrr�<module>sd(	*%5�,
$:unittest/__pycache__/async_case.cpython-38.opt-2.pyc000064400000010005151153537550016341 0ustar00U

e5d��@s0ddlZddlZddlmZGdd�de�ZdS)�N�)�TestCasecs�eZdZd�fdd�	Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zd �fdd�	Z�ZS)!�IsolatedAsyncioTestCase�runTestcst��|�d|_d|_dS�N)�super�__init__�_asyncioTestLoop�_asyncioCallsQueue)�selfZ
methodName��	__class__��+/usr/lib64/python3.8/unittest/async_case.pyr"sz IsolatedAsyncioTestCase.__init__c�sdSrr�rrrr�
asyncSetUp'sz"IsolatedAsyncioTestCase.asyncSetUpc�sdSrrrrrr�
asyncTearDown*sz%IsolatedAsyncioTestCase.asyncTearDowncOs|j|f|�|�dSr)Z
addCleanup)r�func�args�kwargsrrr�addAsyncCleanup-s
z'IsolatedAsyncioTestCase.addAsyncCleanupcCs|��|�|j�dSr)ZsetUp�
_callAsyncrrrrr�
_callSetUp<sz"IsolatedAsyncioTestCase._callSetUpcCs|�|�dSr��_callMaybeAsync)r�methodrrr�_callTestMethod@sz'IsolatedAsyncioTestCase._callTestMethodcCs|�|j�|��dSr)rrZtearDownrrrr�
_callTearDownCsz%IsolatedAsyncioTestCase._callTearDowncOs|j|f|�|�dSrr)rZfunctionrrrrr�_callCleanupGsz$IsolatedAsyncioTestCase._callCleanupcOs0|||�}|j��}|j�||f�|j�|�Sr)r	�
create_futurer
�
put_nowait�run_until_complete�rrrr�ret�futrrrrJs

z"IsolatedAsyncioTestCase._callAsynccOsB|||�}t�|�r:|j��}|j�||f�|j�|�S|SdSr)�inspectZisawaitabler	rr
r r!r"rrrrRs


z'IsolatedAsyncioTestCase._callMaybeAsyncc
�s�t��|_}|�d�|��IdH}|��|dkr:dS|\}}z |IdH}|��s`|�|�Wqttfk
r|�Yqt	tj
fk
r�}z|��s�|�|�W5d}~XYqXqdSr)�asyncioZQueuer
Z
set_result�getZ	task_done�	cancelled�
SystemExit�KeyboardInterrupt�
BaseExceptionZCancelledErrorZ
set_exception)rr$ZqueueZqueryZ	awaitabler#Zexrrr�_asyncioLoopRunner\s 

z*IsolatedAsyncioTestCase._asyncioLoopRunnercCsJt��}t�|�|�d�||_|��}|�|�|��|_|�	|�dS)NT)
r&Znew_event_loop�set_event_loopZ	set_debugr	rZcreate_taskr,Z_asyncioCallsTaskr!)r�loopr$rrr�_setupAsyncioLoopos

z)IsolatedAsyncioTestCase._setupAsyncioLoopc	Cs�|j}d|_|j�d�|�|j���z�t�|�}|s@W�vdS|D]}|�	�qD|�tj
||dd���|D]0}|��r|qn|��dk	rn|�
d|��|d��qn|�|���W5t�d�|��XdS)NT)r.Zreturn_exceptionsz(unhandled exception during test shutdown)�message�	exception�task)r	r
r r!�joinr&r-�closeZ	all_tasksZcancelZgatherr(r1Zcall_exception_handlerZshutdown_asyncgens)rr.Z	to_cancelr2rrr�_tearDownAsyncioLoopys2

��

z,IsolatedAsyncioTestCase._tearDownAsyncioLoopNcs(|��zt��|�W�S|��XdSr)r/r5r�run)r�resultrrrr6�szIsolatedAsyncioTestCase.run)r)N)�__name__�
__module__�__qualname__rrrrrrrrrrr,r/r5r6�
__classcell__rrrrrs

"r)r&r%Zcaserrrrrr�<module>sunittest/__pycache__/loader.cpython-38.opt-2.pyc000064400000026742151153537550015516 0ustar00U

e5d�X�@sddlZddlZddlZddlZddlZddlZddlZddlmZmZddl	m
Z
mZmZdZ
e�dej�ZGdd�de
j�Zd	d
�Zdd�Zd
d�Zdd�Zdd�ZGdd�de�Ze�Zddd�Zejdfdd�Zdejejfdd�Zdejejfdd�Z dS)�N)�fnmatch�fnmatchcase�)�case�suite�utilTz[_a-z]\w*\.py$cs,eZdZdZ�fdd�Z�fdd�Z�ZS)�_FailedTestNcs||_tt|��|�dS�N)�
_exception�superr�__init__)�selfZmethod_name�	exception��	__class__��'/usr/lib64/python3.8/unittest/loader.pyrsz_FailedTest.__init__cs*|�jkrtt���|�S�fdd�}|S)Ncs
�j�dSr	)r
r�r
rr�testFailure!sz,_FailedTest.__getattr__.<locals>.testFailure)�_testMethodNamerr�__getattr__)r
�namerrrrrs
z_FailedTest.__getattr__)�__name__�
__module__�__qualname__rrr�
__classcell__rrrrrsrcCs"d|t��f}t|t|�||�S)Nz#Failed to import test module: %s
%s)�	traceback�
format_exc�_make_failed_test�ImportError)r�
suiteClass�messagerrr�_make_failed_import_test&s
�r"cCsdt��f}t||||�S)NzFailed to call load_tests:
%s)rrr)rrr r!rrr�_make_failed_load_tests+s�r#cCst||�}||f�|fSr	)r)�
methodnamerr r!�testrrrr0s
rcCs<t�t|��dd��}||i}tdtjf|�}|||�f�S)NcSsdSr	rrrrr�testSkipped5sz'_make_skipped_test.<locals>.testSkippedZ
ModuleSkipped)r�skip�str�type�TestCase)r$rr r&�attrsZ	TestClassrrr�_make_skipped_test4s

r,cCs*|���d�r|dd�Stj�|�dS)Nz	$py.classi����r)�lower�endswith�os�path�splitext)r0rrr�_jython_aware_splitext<sr2cs�eZdZdZeej�ZdZe	j
ZdZ�fdd�Z
dd�Zdd�dd	�Zd d
d�Zd!dd
�Zdd�Zd"dd�Zdd�Zdd�Zdd�Zdd�Zd#dd�Zd$dd�Z�ZS)%�
TestLoaderr%Ncs tt|���g|_t�|_dSr	)rr3r�errors�set�_loading_packagesrrrrrMszTestLoader.__init__cCsFt|tj�rtd��|�|�}|s2t|d�r2dg}|�t||��}|S)NzYTest cases should not be derived from TestSuite. Maybe you meant to derive from TestCase?ZrunTest)�
issubclassr�	TestSuite�	TypeError�getTestCaseNames�hasattrr �map)r
�
testCaseClassZ
testCaseNamesZloaded_suiterrr�loadTestsFromTestCaseTs
z TestLoader.loadTestsFromTestCase��patternc

Os:t|�dksd|kr,t�dt�|�dd�t|�dkrRt|�d}td�|���t|�dkrxt|�d}td�|���g}t|�D]4}t	||�}t
|t�r�t|t
j�r�|�|�|��q�t	|dd�}	|�|�}|	dk	�r6z|	|||�WStk
�r4}
z,t|j|
|j�\}}|j�|�|WY�Sd}
~
XYnX|S)NrZuse_load_testsz(use_load_tests is deprecated and ignoredrzCloadTestsFromModule() takes 1 positional argument but {} were givenz=loadTestsFromModule() got an unexpected keyword argument '{}'�
load_tests)�len�warnings�warn�DeprecationWarning�popr9�format�sorted�dir�getattr�
isinstancer)r7rr*�appendr>r �	Exceptionr#rr4)
r
�moduler@�argsZkwsZ	complaint�testsr�objrA�e�
error_case�
error_messagerrr�loadTestsFromModulebs<�


�zTestLoader.loadTestsFromModulecCsX|�d�}d\}}|dkr�|dd�}|r�zd�|�}t|�}Wq�Wq&tk
r�|��}t||j�\}}|s�|j�|�|YSYq&Xq&|dd�}|}	|D]�}
z|	t	|	|
�}}	Wq�t
k
�rN}zvt	|	dd�dk	�r|dk	�r|j�|�|WY�DSt|
||jdt�
�f�\}}|j�|�|WY�
SW5d}~XYq�Xq�t|	tj��rj|�|	�St|	t��r�t|	tj��r�|�|	�St|	tj��r�t|t��r�t|tj��r�|d}||�}
tt	|
|�tj��s�|�|
g�Snt|	tj��r�|	St|	��rH|	�}t|tj��r|St|tj��r6|�|g�Std|	|f��ntd|	��dS)	N�.)NNr�__path__zFailed to access attribute:
%s���z"calling %s returned %s, not a testz$don't know how to make test from: %s)�split�join�
__import__rrFr"r r4rLrJ�AttributeErrorrrrrK�types�
ModuleTyperUr)r7rr*r>�FunctionTyperr8�callabler9)r
rrN�partsrSrTZ
parts_copy�module_nameZnext_attributerQ�part�parentrR�instr%rrr�loadTestsFromName�s�	

����$

�
�
�zTestLoader.loadTestsFromNamecs��fdd�|D�}��|�S)Ncsg|]}��|���qSr)rf)�.0r�rNr
rr�
<listcomp>�sz1TestLoader.loadTestsFromNames.<locals>.<listcomp>)r )r
�namesrNZsuitesrrhr�loadTestsFromNames�szTestLoader.loadTestsFromNamescs>��fdd�}tt|t����}�jr:|jt��j�d�|S)NcsZ|��j�sdSt�|�}t|�s&dSd�j�j|f��jdkpXt�fdd��jD��S)NFz%s.%s.%sc3s|]}t�|�VqdSr	)r)rgr@�ZfullNamerr�	<genexpr>�szKTestLoader.getTestCaseNames.<locals>.shouldIncludeMethod.<locals>.<genexpr>)�
startswith�testMethodPrefixrJr`rr�testNamePatterns�any)�attrnameZtestFunc�r
r=rlr�shouldIncludeMethod�s
�
�z8TestLoader.getTestCaseNames.<locals>.shouldIncludeMethod)�key)�list�filterrI�sortTestMethodsUsing�sort�	functools�
cmp_to_key)r
r=rtZtestFnNamesrrsrr:�s
zTestLoader.getTestCaseNames�test*.pycCsJd}|dkr|jdk	r|j}n|dkr.d}|}tj�|�}|tjkrRtj�d|�||_d}d}g}tj�tj�|��r�tj�|�}||kr�tj�tj�|d��}�npzt	|�Wnt
k
r�d}Y�nJXtj|}|�d�d}	ztj�tj�
|j��}Wn�tk
�r�z
|j}
Wntk
�r8d}
YnX|
�r�|
jdk�r�|
jdk	�r�d}|jD]P}|�s||�|��s|�qb|�|j�dtjj��d|_|�|j||dd���qbn*|jtjk�r�td�d�ntd�|��d�YnX|�r|�s|�|	�|_tj�|�ntj�|�|�r*t
d	|��|�s@t|�||��}|� |�S)
NFTr�__init__.pyrV)�	namespacez2Can not use builtin modules as dotted module namesz$don't know how to discover from {!r}z%Start directory is not importable: %r)!�_top_level_dirr/r0�abspath�sys�insert�isdir�isfilerZr[r�modulesrY�dirname�__file__r\�__spec__�loader�submodule_search_locationsrWrnr�replace�sep�extend�_find_tests�builtin_module_namesr9rG� _get_directory_containing_module�removervr )r
�	start_dirr@Z
top_level_dirZset_implicit_topZis_not_importable�is_namespacerPZ
the_moduleZtop_part�specr0rrr�discover�s�

�


�
���
������zTestLoader.discovercCsRtj|}tj�|j�}tj�|����d�rBtj�	tj�	|��Stj�	|�SdS)Nr})
r�r�r/r0r�r��basenamer-rnr�)r
rbrN�	full_pathrrrr�`s

z+TestLoader._get_directory_containing_modulecCsB||jkrdSttj�|��}tj�||j�}|�tjjd�}|S�NrV)rr2r/r0�normpath�relpathr�r�)r
r0Z_relpathrrrr�_get_name_from_pathls
zTestLoader._get_name_from_pathcCst|�tj|Sr	)r[r�r�)r
rrrr�_get_module_from_namexsz TestLoader._get_module_from_namecCs
t||�Sr	)r)r
r0r�r@rrr�_match_path|szTestLoader._match_pathFc

cs�|�|�}|dkrD||jkrD|�|||�\}}|dk	r<|V|sDdStt�|��}|D]t}tj�||�}	|�|	||�\}}|dk	r�|V|rV|�|	�}|j�|�z|�
|	||�EdHW5|j�	|�XqVdSr�)r�r6�_find_test_pathrHr/�listdirr0rZ�add�discardr�)
r
r�r@r~rrPZshould_recurse�pathsr0r�rrrr��s6
��
zTestLoader._find_testsc
Csttj�|�}tj�|��rVt�|�s(dS|�|||�s:dS|�|�}z|�|�}Wnht	j
k
r�}zt|||j�dfWY�Sd}~XYn�t
||j�\}}	|j�|	�|dfYSXtj�t|d|��}
ttj�|
��}ttj�|��}|��|��k�r@tj�|�}
ttj�|��}tj�|�}d}t|||
|f��|j||d�dfS�ntj�|��rl|�s�tj�tj�|d���s�dSd}d}|�|�}z|�|�}Wnjt	j
k
�r�}zt|||j�dfWY�Sd}~XYn�t
||j�\}}	|j�|	�|dfYSXt|dd�}|j�|�z0|j||d�}|dk	�rP|dfW�S|dfW�S|j�|�XndSdS)	N)NFFr�zW%r module incorrectly imported from %r. Expected %r. Is this module globally installed?r?r}rAT)r/r0r�r��VALID_MODULE_NAME�matchr�r�r�rZSkipTestr,r r"r4rLr�rJr2�realpathr-r�rrUr�rZr6r�r�)r
r�r@r~r�rrNrRrSrTZmod_filer�Zfullpath_noextZ
module_dirZmod_nameZexpected_dir�msgrArP�packagerrrr��s|

&
�
�
�
�
���
&
�
zTestLoader._find_test_path)N)N)r|N)F)F)rrrro�staticmethodr�
three_way_cmprxrprr8r rrr>rUrfrkr:r�r�r�r�r�r�r�rrrrrr3Bs$
(
N

n
"r3cCs&t�}||_||_||_|r"||_|Sr	)r3rxrorpr )�prefix�	sortUsingr rpr�rrr�_makeLoader�sr�cCst|||d��|�S)N)rp)r�r:)r=r�r�rprrrr:�sr:r%cCst|||��|�Sr	)r�r>)r=r�r�r rrr�	makeSuite�s�r�cCst|||��|�Sr	)r�rU)rNr�r�r rrr�
findTestCasess�r�)NN)!r/�rer�rr]rzrCrr�rrrZ
__unittest�compile�
IGNORECASEr�r*rr"r#rr,r2�objectr3ZdefaultTestLoaderr�r�r:r8r�r�rrrr�<module>s:/
	�
�unittest/__pycache__/runner.cpython-38.opt-2.pyc000064400000014403151153537550015550 0ustar00U

e5dW�@sjddlZddlZddlZddlmZddlmZdZGdd�de�Z	Gdd	�d	ej
�ZGd
d�de�ZdS)�N�)�result)�registerResultTc@s&eZdZdd�Zdd�Zddd�ZdS)	�_WritelnDecoratorcCs
||_dS�N)�stream)�selfr�r	�'/usr/lib64/python3.8/unittest/runner.py�__init__sz_WritelnDecorator.__init__cCs|dkrt|��t|j|�S)N)r�__getstate__)�AttributeError�getattrr)r�attrr	r	r
�__getattr__sz_WritelnDecorator.__getattr__NcCs|r|�|�|�d�dS�N�
)�write)r�argr	r	r
�writelns
z_WritelnDecorator.writeln)N)�__name__�
__module__�__qualname__rrrr	r	r	r
r
srcs�eZdZdZdZ�fdd�Zdd�Z�fdd�Z�fd	d
�Z�fdd�Z	�fd
d�Z
�fdd�Z�fdd�Z�fdd�Z
dd�Zdd�Z�ZS)�TextTestResultzF======================================================================zF----------------------------------------------------------------------cs8tt|��|||�||_|dk|_|dk|_||_dS)Nr)�superrrr�showAll�dots�descriptions)rrr�	verbosity��	__class__r	r
r%s


zTextTestResult.__init__cCs0|��}|jr$|r$d�t|�|f�St|�SdSr)ZshortDescriptionr�join�str)r�testZdoc_first_liner	r	r
�getDescription,s
zTextTestResult.getDescriptioncsBtt|��|�|jr>|j�|�|��|j�d�|j��dS)Nz ... )rr�	startTestrrrr$�flush�rr#rr	r
r%3s
zTextTestResult.startTestcsDtt|��|�|jr$|j�d�n|jr@|j�d�|j��dS)N�ok�.)	rr�
addSuccessrrrrrr&r'rr	r
r*:szTextTestResult.addSuccesscsFtt|��||�|jr&|j�d�n|jrB|j�d�|j��dS)N�ERROR�E)	rr�addErrorrrrrrr&�rr#�errrr	r
r-BszTextTestResult.addErrorcsFtt|��||�|jr&|j�d�n|jrB|j�d�|j��dS)N�FAIL�F)	rr�
addFailurerrrrrr&r.rr	r
r2JszTextTestResult.addFailurecsLtt|��||�|jr,|j�d�|��n|jrH|j�d�|j�	�dS)Nz
skipped {0!r}�s)
rr�addSkiprrr�formatrrr&)rr#�reasonrr	r
r4RszTextTestResult.addSkipcsFtt|��||�|jr&|j�d�n|jrB|j�d�|j��dS)Nzexpected failure�x)	rr�addExpectedFailurerrrrrr&r.rr	r
r8Zsz!TextTestResult.addExpectedFailurecsDtt|��|�|jr$|j�d�n|jr@|j�d�|j��dS)Nzunexpected success�u)	rr�addUnexpectedSuccessrrrrrr&r'rr	r
r:bsz#TextTestResult.addUnexpectedSuccesscCs6|js|jr|j��|�d|j�|�d|j�dS)Nr+r0)rrrr�printErrorList�errors�failures�rr	r	r
�printErrorsjs
zTextTestResult.printErrorscCsX|D]N\}}|j�|j�|j�d||�|�f�|j�|j�|j�d|�qdS)Nz%s: %sz%s)rr�
separator1r$�
separator2)rZflavourr<r#r/r	r	r
r;ps
zTextTestResult.printErrorList)rrrr@rArr$r%r*r-r2r4r8r:r?r;�
__classcell__r	r	rr
rsrc@s0eZdZeZddd�dd�Zdd	�Zd
d�ZdS)
�TextTestRunnerNTrF)�	tb_localsc	CsN|dkrtj}t|�|_||_||_||_||_||_||_	|dk	rJ||_
dSr)�sys�stderrrrrr�failfast�bufferrD�warnings�resultclass)	rrrrrGrHrJrIrDr	r	r
r�s
zTextTestRunner.__init__cCs|�|j|j|j�Sr)rJrrrr>r	r	r
�_makeResult�szTextTestRunner._makeResultcCs2|��}t|�|j|_|j|_|j|_t����|jr^t�|j�|jdkr^tjdt	dd�t
��}t|dd�}|dk	r�|�z||�W5t|dd�}|dk	r�|�Xt
��}W5QRX||}|�
�t|d�r�|j�|j�|j}|j�d||d	ko�d
�pd|f�|j��d}	}
}ztt|j|j|jf�}Wntk
�rTYnX|\}	}
}g}
|���s�|j�d
�t|j�t|j�}}|�r�|
�d|�|�r�|
�d|�n|j�d�|�r�|
�d|�|	�r�|
�d|	�|
�r|
�d|
�|
�r"|j�dd�|
�f�n|j�d�|S)N)�default�always�modulezPlease use assert\w+ instead.)�category�message�startTestRun�stopTestRunrAzRan %d test%s in %.3fsrr3�rZFAILEDzfailures=%dz	errors=%dZOKz
skipped=%dzexpected failures=%dzunexpected successes=%dz (%s)z, r)rKrrGrHrDrI�catch_warnings�simplefilter�filterwarnings�DeprecationWarning�time�perf_counterrr?�hasattrrrrAZtestsRun�map�lenZexpectedFailures�unexpectedSuccesses�skippedr
Z
wasSuccessfulrr=r<�appendr!)rr#rZ	startTimerQrRZstopTimeZ	timeTaken�runZ
expectedFailsr]r^ZresultsZinfosZfailedZerroredr	r	r
r`�sx

�
�
�


zTextTestRunner.run)NTrFFNN)rrrrrJrrKr`r	r	r	r
rCxs��rC)
rErXrIrSrZsignalsrZ
__unittest�objectrZ
TestResultrrCr	r	r	r
�<module>s[unittest/__pycache__/case.cpython-38.opt-2.pyc000064400000104730151153537550015155 0ustar00U

e5d���@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZddl
mZmZmZmZmZdZe�ZdZGdd�de�ZGd	d
�d
e�ZGdd�de�ZGd
d�de�Zdd�ZgZdd�Zdd�Zdd�Z dd�Z!dd�Z"dd�Z#dd�Z$Gdd �d �Z%Gd!d"�d"e%�Z&Gd#d$�d$e&�Z'Gd%d&�d&e&�Z(e�)d'd(d)g�Z*Gd*d+�d+ej+�Z,Gd,d-�d-e%�Z-Gd.d/�d/ej.�Z/Gd0d1�d1e�Z0Gd2d3�d3e0�Z1Gd4d5�d5e0�Z2dS)6�N�)�result)�strclass�	safe_repr�_count_diff_all_purpose�_count_diff_hashable�_common_shorten_reprTz@
Diff is %s characters long. Set self.maxDiff to None to see it.c@seZdZdS)�SkipTestN��__name__�
__module__�__qualname__�rr�%/usr/lib64/python3.8/unittest/case.pyr	sr	c@seZdZdS)�_ShouldStopNr
rrrrr"src@seZdZdS)�_UnexpectedSuccessNr
rrrrr'src@s&eZdZddd�Zejddd��ZdS)	�_OutcomeNcCs4d|_||_t|d�|_d|_g|_d|_g|_dS)NF�
addSubTestT)�expecting_failurer�hasattr�result_supports_subtests�success�skipped�expectedFailure�errors)�selfrrrr�__init__.sz_Outcome.__init__Fc
cs�|j}d|_z�z
dVWn�tk
r.�Yn�tk
rh}zd|_|j�|t|�f�W5d}~XYnjtk
rzYnXt��}|j	r�||_
nd|_|j�||f�d}YnX|jr�|jr�|j�|df�W5|jo�||_XdS)NTF)
r�KeyboardInterruptr	r�append�strr�sys�exc_inforrrr)r�	test_case�isTestZold_success�er!rrr�testPartExecutor7s*
$
z_Outcome.testPartExecutor)N)F)rrr
r�
contextlib�contextmanagerr%rrrrr-s
	rcCs|S�Nr)�objrrr�_idUsr*cOst�|||f�dSr()�_module_cleanupsr)�function�args�kwargsrrr�addModuleCleanupZsr/c
Csdg}trTt��\}}}z|||�Wqtk
rP}z|�|�W5d}~XYqXq|r`|d�dS�Nr)r+�pop�	Exceptionr)�
exceptionsr,r-r.�excrrr�doModuleCleanups`sr5cs,�fdd�}t�tj�r(�}d�||�S|S)Ncs4t|t�s$t�|��fdd��}|}d|_�|_|S)Ncst���dSr(�r	�r-r.��reasonrr�skip_wrappervsz-skip.<locals>.decorator.<locals>.skip_wrapperT)�
isinstance�type�	functools�wraps�__unittest_skip__�__unittest_skip_why__)�	test_itemr:r8rr�	decoratorts
zskip.<locals>.decorator�)r;�types�FunctionType)r9rBrArr8r�skipps
rFcCs|rt|�StSr(�rFr*�Z	conditionr9rrr�skipIf�srIcCs|st|�StSr(rGrHrrr�
skipUnless�srJcCs
d|_|S)NT)�__unittest_expecting_failure__)rArrrr�srcs4t|t�r t�fdd�|D��St|t�o2t|��S)Nc3s|]}t|��VqdSr()�_is_subtype)�.0r$��basetyperr�	<genexpr>�sz_is_subtype.<locals>.<genexpr>)r;�tuple�allr<�
issubclass)�expectedrOrrNrrL�s
rLc@seZdZdd�Zdd�ZdS)�_BaseTestCaseContextcCs
||_dSr()r")rr"rrrr�sz_BaseTestCaseContext.__init__cCs |j�|j|�}|j�|��dSr()r"�_formatMessage�msg�failureException)r�standardMsgrWrrr�
_raiseFailure�sz"_BaseTestCaseContext._raiseFailureN)rrr
rrZrrrrrU�srUc@seZdZddd�Zdd�ZdS)�_AssertRaisesBaseContextNcCs@t�||�||_||_|dk	r*t�|�}||_d|_d|_dSr()	rUrrTr"�re�compile�expected_regex�obj_namerW)rrTr"r^rrrr�s
z!_AssertRaisesBaseContext.__init__c	Cs�z�t|j|j�s"td||jf��|sV|�dd�|_|rNtdtt|��f��|W�TS|^}}z|j	|_
Wntk
r�t|�|_
YnX|�|||�W5QRXW5d}XdS)Nz%s() arg 1 must be %srWz3%r is an invalid keyword argument for this function)
rLrT�
_base_type�	TypeError�_base_type_strr1rW�next�iterrr_�AttributeErrorr)r�namer-r.Zcallable_objrrr�handle�s(��z_AssertRaisesBaseContext.handle)N)rrr
rrgrrrrr[�s

r[c@s$eZdZeZdZdd�Zdd�ZdS)�_AssertRaisesContextz-an exception type or tuple of exception typescCs|Sr(r�rrrr�	__enter__�sz_AssertRaisesContext.__enter__cCs�|dkrbz|jj}Wntk
r2t|j�}YnX|jrP|�d�||j��ql|�d�|��n
t�|�t	||j�s|dS|�
d�|_|jdkr�dS|j}|�
t|��s�|�d�|jt|���dS)Nz{} not raised by {}z
{} not raisedFT�"{}" does not match "{}")rTrrerr_rZ�format�	traceback�clear_framesrS�with_tracebackZ	exceptionr^�search�pattern)r�exc_type�	exc_value�tb�exc_namer^rrr�__exit__�s.
�

�z_AssertRaisesContext.__exit__N)rrr
�
BaseExceptionr`rbrjrvrrrrrh�srhc@s$eZdZeZdZdd�Zdd�ZdS)�_AssertWarnsContextz(a warning type or tuple of warning typescCsRttj���D]}t|dd�ri|_qtjdd�|_|j�	�|_t�
d|j�|S)N�__warningregistry__T)�record�always)�listr �modules�values�getattrry�warnings�catch_warnings�warnings_managerrj�simplefilterrT)r�vrrrrj�sz_AssertWarnsContext.__enter__cCs|j�|||�|dk	rdSz|jj}Wntk
rFt|j�}YnXd}|jD]Z}|j}t||j�sjqR|dkrv|}|j	dk	r�|j	�
t|��s�qR||_|j|_|j
|_
dS|dk	r�|�d�|j	jt|���|jr�|�d�||j��n|�d�|��dS)Nrkz{} not triggered by {}z{} not triggered)r�rvrTrrerr��messager;r^rpZwarning�filename�linenorZrlrqr_)rrrrsrtruZfirst_matching�m�wrrrrvs@

��
�z_AssertWarnsContext.__exit__N)rrr
�Warningr`rbrjrvrrrrrx�srx�_LoggingWatcher�records�outputc@s$eZdZdd�Zdd�Zdd�ZdS)�_CapturingHandlercCstj�|�tgg�|_dSr()�logging�Handlerrr��watcherrirrrr3sz_CapturingHandler.__init__cCsdSr(rrirrr�flush7sz_CapturingHandler.flushcCs*|jj�|�|�|�}|jj�|�dSr()r�r�rrlr�)rrzrWrrr�emit:s
z_CapturingHandler.emitN)rrr
rr�r�rrrrr�.sr�c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_AssertLogsContextz"%(levelname)s:%(name)s:%(message)scCs:t�||�||_|r(tj�||�|_ntj|_d|_dSr()	rUr�logger_namer�Z_nameToLevel�get�level�INFOrW)rr"r�r�rrrrFsz_AssertLogsContext.__init__cCs�t|jtj�r|j}|_nt�|j�}|_t�|j�}t�}|�	|�|j
|_
|jdd�|_|j
|_|j|_|g|_|�|j
�d|_|j
S)NF)r;r�r�ZLogger�loggerZ	getLoggerZ	Formatter�LOGGING_FORMATr�ZsetFormatterr��handlers�old_handlersr��	old_level�	propagate�
old_propagate�setLevel)rr�Z	formatterZhandlerrrrrjOs
z_AssertLogsContext.__enter__cCs`|j|j_|j|j_|j�|j�|dk	r.dSt|jj	�dkr\|�
d�t�
|j�|jj��dS)NFrz-no logs of level {} or higher triggered on {})r�r�r�r�r�r�r��lenr�r�rZrlr�ZgetLevelNamer�rf)rrrrsrtrrrrv`s


��z_AssertLogsContext.__exit__N)rrr
r�rrjrvrrrrr�As	r�c@seZdZdd�ZdS)�_OrderedChainMapccs8t�}|jD]&}|D]}||kr|�|�|VqqdSr()�set�maps�add)r�seen�mapping�krrr�__iter__ns

z_OrderedChainMap.__iter__N)rrr
r�rrrrr�msr�c@seZdZeZdZdZdZdZgZ	d�dd�Z
dd	�Zd
d�Zde_
ed
d��Zdd�Zdd�Zedd��Zedd��Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zejefd)d*��Z d+d,�Z!d-d.�Z"d/d0�Z#d1d2�Z$d3d4�Z%d5d6�Z&d7d8�Z'd�d:d;�Z(d<d=�Z)ed>d?��Z*d@dA�Z+dBdC�Z,dDdE�Z-d�dFdG�Z.d�dHdI�Z/d�dJdK�Z0dLdM�Z1dNdO�Z2dPdQ�Z3d�dRdS�Z4dTdU�Z5d�dVdW�Z6d�dXdY�Z7d�dZd[�Z8d�d\d]�Z9d�d^d_�Z:d�d`da�Z;dbdc�Z<d�ddde�Z=d�dfdg�Z>d�dhdi�Z?d�djdk�Z@d�dldm�ZAd�dndo�ZBd�dpdq�ZCd�drds�ZDd�dtdu�ZEd�dvdw�ZFd�dxdy�ZGd�dzd{�ZHd�d|d}�ZId�d~d�ZJd�d�d��ZKd�d�d��ZLd�d�d��ZMd�d�d��ZNd�d�d��ZOd�d��ZPd�d��ZQd�d�d��ZRd�d�d��ZSd�d��ZTeTe7�ZUZVeTe8�ZWZXeTe9�ZYZZeTe:�Z[Z\eTe0�Z]Z^eTe2�Z_eTe/�Z`eTeP�ZaeTeR�ZbeTeS�Zcd9S)��TestCaseTi�iF�runTestcCs�||_d|_d|_zt||�}Wn.tk
rN|dkrJtd|j|f��Yn
X|j|_g|_d|_	i|_
|�td�|�t
d�|�td�|�td�|�td�|�td�dS)	NzNo testr�zno such test method in %s: %s�assertDictEqual�assertListEqual�assertTupleEqual�assertSetEqual�assertMultiLineEqual)�_testMethodName�_outcome�_testMethodDocrre�
ValueError�	__class__�__doc__�	_cleanups�_subtest�_type_equality_funcs�addTypeEqualityFunc�dictr|rQr��	frozensetr)rZ
methodName�
testMethodrrrr�s(�zTestCase.__init__cCs||j|<dSr()r�)rZtypeobjr,rrrr��s
zTestCase.addTypeEqualityFunccOs�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��t|�}|j�|||f�dS)	N�z>descriptor 'addCleanup' of 'TestCase' object needs an argumentr,rz4Passing 'function' as keyword argument is deprecated)�
stacklevelz:addCleanup expected at least 1 positional argument, got %dr)	r�rar1r��warn�DeprecationWarningrQr�r)r-r.rr,r�rrr�
addCleanup�s"

�
�zTestCase.addCleanupz%($self, function, /, *args, **kwargs)cOs|j�|||f�dSr()�_class_cleanupsr)�clsr,r-r.rrr�addClassCleanup�szTestCase.addClassCleanupcCsdSr(rrirrr�setUp�szTestCase.setUpcCsdSr(rrirrr�tearDown�szTestCase.tearDowncCsdSr(r�r�rrr�
setUpClass�szTestCase.setUpClasscCsdSr(rr�rrr�
tearDownClassszTestCase.tearDownClasscCsdS)Nrrrirrr�countTestCasesszTestCase.countTestCasescCst��Sr()rZ
TestResultrirrr�defaultTestResult	szTestCase.defaultTestResultcCs$|j}|r |���d�d��SdS�N�
r)r��strip�split�r�docrrr�shortDescriptionszTestCase.shortDescriptioncCsdt|j�|jfS)Nz%s.%s�rr�r�rirrr�idszTestCase.idcCs t|�t|�k	rtS|j|jkSr()r<�NotImplementedr��r�otherrrr�__eq__szTestCase.__eq__cCstt|�|jf�Sr()�hashr<r�rirrr�__hash__ szTestCase.__hash__cCsd|jt|j�fS�Nz%s (%s))r�rr�rirrr�__str__#szTestCase.__str__cCsdt|j�|jfS)Nz<%s testMethod=%s>r�rirrr�__repr__&s�zTestCase.__repr__cCs<t|dd�}|dk	r |||�nt�dtd�|�|�dS)N�addSkipz4TestResult has no addSkip method, skips not reportedr�)rr�r��RuntimeWarning�
addSuccess)rrr"r9r�rrr�_addSkip*s�zTestCase._addSkipc	ks�|jdks|jjsdVdS|j}|dkr4t|�}n|j�|�}t|||�|_zX|jj|jdd��dVW5QRX|jjs�|jj	}|dk	r�|j
r�t�n|jjr�t�W5||_XdS)NT�r#)
r�rr�r��params�	new_child�_SubTestr%rrZfailfastrr)rrWr��parentZ
params_maprrrr�subTest3s$
zTestCase.subTestcCs`|D]V\}}t|t�r(|�|j||�q|dk	rt|d|j�rN|�||�q|�||�qdSr0)r;r�rr"rSrX�
addFailureZaddError)rrr�testr!rrr�_feedErrorsToResultRs
zTestCase._feedErrorsToResultcCsDz
|j}Wn*tk
r4t�dt�|�|�YnX|||�dS)Nz@TestResult has no addExpectedFailure method, reporting as passes)�addExpectedFailurerer�r�r�r�)rrr!r�rrr�_addExpectedFailure\s
�zTestCase._addExpectedFailurecCshz
|j}WnPtk
rZt�dt�z
td�Wn$tk
rT|�|t���YnXYn
X||�dS)NzCTestResult has no addUnexpectedSuccess method, reporting as failure)	�addUnexpectedSuccessrer�r�r�rr�r r!)rrr�rrr�_addUnexpectedSuccessfs
�
zTestCase._addUnexpectedSuccesscCs|��dSr()r�rirrr�
_callSetUpuszTestCase._callSetUpcCs
|�dSr(r)r�methodrrr�_callTestMethodxszTestCase._callTestMethodcCs|��dSr()r�rirrr�
_callTearDown{szTestCase._callTearDowncOs|||�dSr(r�rr,r-r.rrr�_callCleanup~szTestCase._callCleanupNc

Cs|}|dkr.|��}t|dd�}|dk	r.|�|�|�t||j�}t|jdd�s^t|dd�r�z,t|jdd�pxt|dd�}|�|||�W5|�|�XdSt|dd�}t|dd�}|p�|}t|�}	z�|	|_|	�|��|�
�W5QRX|	j�r@||	_|	j|dd	��|�|�W5QRXd|	_|	�|��|��W5QRX|��|	jD]\}}|�|||��qN|�||	j�|	j�r�|�r�|	j
�r�|�||	j
�n
|�|�n
|�|�|W�S|�|�|dk�r�t|dd�}
|
dk	�r�|
�|	j�	�d|	_
d|_XdS)
N�startTestRunr?Fr@rCrK�stopTestRunTr�)r�rZ	startTestr�r�ZstopTestr�rr�clearrr�r%r�rrr�r��
doCleanupsrr�r�r�r�)
rrZorig_resultr�r�Zskip_whyZexpecting_failure_methodZexpecting_failure_classr�outcomer�r�r9rrr�run�st

�
���




zTestCase.runc	CsR|jp
t�}|jrL|j��\}}}|�|��|j|f|�|�W5QRXq|jSr()r�rr�r1r%r�r)rr�r,r-r.rrrr��szTestCase.doCleanupsc
Csdg|_|jr`|j��\}}}z|||�Wqtk
r\}z|j�t���W5d}~XYqXqdSr()ZtearDown_exceptionsr�r1r2rr r!)r�r,r-r.r4rrr�doClassCleanups�szTestCase.doClassCleanupscOs|j||�Sr()r�)rr-�kwdsrrr�__call__�szTestCase.__call__cCsF|��t||j��|��|jrB|j�d�\}}}|||�qdS)N���)r�rr�r�r�r1r�rrr�debug�szTestCase.debugcCst|��dSr(r6)rr9rrr�skipTest�szTestCase.skipTestcCs|�|��dSr()rX)rrWrrr�fail�sz
TestCase.failcCs&|r"|�|dt|��}|�|��dS)Nz%s is not false�rVrrX�r�exprrWrrr�assertFalse�szTestCase.assertFalsecCs&|s"|�|dt|��}|�|��dS)Nz%s is not truerrrrr�
assertTrue�szTestCase.assertTruecCsV|js|p|S|dkr|Szd||fWStk
rPdt|�t|�fYSXdS)Nz%s : %s)�longMessage�UnicodeDecodeErrorr)rrWrYrrrrV�s
zTestCase._formatMessagecOs(t||�}z|�d||�W�Sd}XdS)N�assertRaises�rhrg)r�expected_exceptionr-r.�contextrrrr
s
zTestCase.assertRaisescOst||�}|�d||�S)N�assertWarns�rxrg)r�expected_warningr-r.r
rrrr5s
zTestCase.assertWarnscCst|||�Sr()r�)rr�r�rrr�
assertLogsTszTestCase.assertLogscCsFt|�t|�kr@|j�t|��}|dk	r@t|t�r<t||�}|S|jSr()r<r�r�r;rr�_baseAssertEqual)r�first�secondZasserterrrr�_getAssertEqualityFuncjs

zTestCase._getAssertEqualityFunccCs0||ks,dt||�}|�||�}|�|��dS)N�%s != %s)rrVrX)rrrrWrYrrrr�szTestCase._baseAssertEqualcCs|�||�}||||d�dS)N)rW)r)rrrrWZassertion_funcrrr�assertEqual�szTestCase.assertEqualcCs2||ks.|�|dt|�t|�f�}|�|��dS)Nz%s == %sr)rrrrWrrr�assertNotEqual�s
�zTestCase.assertNotEqualcCs�||krdS|dk	r$|dk	r$td��t||�}|dk	rf||krDdSdt|�t|�t|�t|�f}n:|dkrrd}t||�dkr�dSdt|�t|�|t|�f}|�||�}|�|��dS)N� specify delta or places not bothz(%s != %s within %s delta (%s difference)�rz)%s != %s within %r places (%s difference)�ra�absr�roundrVrX�rrrZplacesrWZdelta�diffrYrrr�assertAlmostEqual�s4��zTestCase.assertAlmostEqualcCs�|dk	r|dk	rtd��t||�}|dk	rb||ks@||kr@dSdt|�t|�t|�t|�f}n<|dkrnd}||ks�t||�dkr�dSdt|�t|�|f}|�||�}|�|��dS)Nrz(%s == %s within %s delta (%s difference)rrz%s == %s within %r placesrrrrr�assertNotAlmostEqual�s,��zTestCase.assertNotAlmostEqualcCs�|dk	rP|j}t||�s.|�d|t|�f��t||�sT|�d|t|�f��nd}d}zt|�}Wn ttfk
r�d|}YnX|dkr�zt|�}Wn ttfk
r�d|}YnX|dk�r�||kr�dSd|��ft||�}t	t
||��D]�}	z||	}
Wn4tttfk
�r<|d|	|f7}Y�q�YnXz||	}Wn4tttfk
�r~|d|	|f7}Y�q�YnX|
|kr�|d	|	ft|
|�7}�q�q�||k�r�|dk�r�t|�t|�k�r�dS||k�r<|d
|||f7}z|d|t||�f7}Wn,tttfk
�r8|d||f7}YnXnh||k�r�|d
|||f7}z|d|t||�f7}Wn,tttfk
�r�|d||f7}YnX|}dd�
t�t�|���t�|�����}
|�||
�}|�||�}|�|�dS)NzFirst sequence is not a %s: %szSecond sequence is not a %s: %sZsequencez(First %s has no length.    Non-sequence?z)Second %s has no length.    Non-sequence?z%ss differ: %s != %s
z(
Unable to index element %d of first %s
z)
Unable to index element %d of second %s
z#
First differing element %d:
%s
%s
z+
First %s contains %d additional elements.
zFirst extra element %d:
%s
z'Unable to index element %d of first %s
z,
Second %s contains %d additional elements.
z(Unable to index element %d of second %s
r�)rr;rXrr�ra�NotImplementedError�
capitalizer�range�min�
IndexErrorr<�join�difflib�ndiff�pprint�pformat�
splitlines�_truncateMessagerVr)rZseq1Zseq2rW�seq_typeZ
seq_type_nameZ	differingZlen1Zlen2�iZitem1Zitem2rY�diffMsgrrr�assertSequenceEqual�s�

�

��
�

������

��
�

��
���zTestCase.assertSequenceEqualcCs2|j}|dkst|�|kr"||S|tt|�Sr()�maxDiffr��DIFF_OMITTED)rr�rZmax_diffrrrr-NszTestCase._truncateMessagecCs|j|||td�dS�N)r.)r1r|)rZlist1Zlist2rWrrrr�Ts
zTestCase.assertListEqualcCs|j|||td�dSr4)r1rQ)rZtuple1Ztuple2rWrrrr�`s	zTestCase.assertTupleEqualc

Cs`z|�|�}Wn^tk
r>}z|�d|�W5d}~XYn0tk
rl}z|�d|�W5d}~XYnXz|�|�}Wn^tk
r�}z|�d|�W5d}~XYn0tk
r�}z|�d|�W5d}~XYnX|s�|s�dSg}|�r|�d�|D]}|�t|���q|�r@|�d�|D]}|�t|���q*d�|�}	|�|�||	��dS)Nz/invalid type when attempting set difference: %sz2first argument does not support set difference: %sz3second argument does not support set difference: %sz*Items in the first set but not the second:z*Items in the second set but not the first:r�)�
differencerarrer�reprr'rV)
rZset1Zset2rWZdifference1r$Zdifference2�lines�itemrYrrrr�ks2
  


zTestCase.assertSetEqualcCs2||kr.dt|�t|�f}|�|�||��dS)Nz%s not found in %s�rrrV�r�memberZ	containerrWrYrrr�assertIn�s
�zTestCase.assertIncCs2||kr.dt|�t|�f}|�|�||��dS)Nz%s unexpectedly found in %sr9r:rrr�assertNotIn�s
�zTestCase.assertNotIncCs2||k	r.dt|�t|�f}|�|�||��dS)Nz%s is not %sr9�rZexpr1Zexpr2rWrYrrr�assertIs�s
�zTestCase.assertIscCs,||kr(dt|�f}|�|�||��dS)Nzunexpectedly identical: %sr9r>rrr�assertIsNot�szTestCase.assertIsNotc	Cs~|�|td�|�|td�||krzdt||�}dd�t�t�|���t�|�����}|�	||�}|�
|�||��dS)Nz"First argument is not a dictionaryz#Second argument is not a dictionaryrr�)�assertIsInstancer�rr'r(r)r*r+r,r-rrV)rZd1Zd2rWrYrrrrr��s
�zTestCase.assertDictEqualc		Cs�t�dt�g}g}|��D]L\}}||kr8|�|�q|||kr|�dt|�t|�t||�f�q|sv|svdSd}|r�dd�dd�|D��}|r�|r�|d7}|d	d�|�7}|�|�||��dS)
Nz&assertDictContainsSubset is deprecatedz%s, expected: %s, actual: %srCzMissing: %s�,css|]}t|�VqdSr()r)rMr�rrrrP�sz4TestCase.assertDictContainsSubset.<locals>.<genexpr>z; zMismatched values: %s)	r�r�r��itemsrrr'rrV)	rZsubsetZ
dictionaryrWZmissingZ
mismatched�key�valuerYrrr�assertDictContainsSubset�s4�
���
z!TestCase.assertDictContainsSubsetc
Cs�t|�t|�}}zt�|�}t�|�}Wntk
rHt||�}YnX||krVdSt||�}|r�d}dd�|D�}d�|�}	|�||	�}|�||�}|�	|�dS)NzElement counts were not equal:
cSsg|]}d|�qS)z First has %d, Second has %d:  %rr)rMrrrr�
<listcomp>�sz-TestCase.assertCountEqual.<locals>.<listcomp>r�)
r|�collections�Counterrarrr'r-rVr)
rrrrWZ	first_seqZ
second_seqZdifferencesrYr7r0rrr�assertCountEqual�s 


zTestCase.assertCountEqualcCs�|�|td�|�|td�||kr�t|�|jks@t|�|jkrN|�|||�|jdd�}|jdd�}t|�dkr�|�d�|kr�|dg}|dg}dt||�}dd	�t	�
||��}|�||�}|�|�
||��dS)
NzFirst argument is not a stringzSecond argument is not a stringT)�keependsrz
r�rrC)rArr��_diffThresholdrr,r�rr'r(r)r-rrV)rrrrWZ
firstlinesZsecondlinesrYrrrrr��s �

zTestCase.assertMultiLineEqualcCs2||ks.dt|�t|�f}|�|�||��dS)Nz%s not less than %sr9�r�a�brWrYrrr�
assertLessszTestCase.assertLesscCs2||ks.dt|�t|�f}|�|�||��dS)Nz%s not less than or equal to %sr9rMrrr�assertLessEqualszTestCase.assertLessEqualcCs2||ks.dt|�t|�f}|�|�||��dS)Nz%s not greater than %sr9rMrrr�
assertGreaterszTestCase.assertGreatercCs2||ks.dt|�t|�f}|�|�||��dS)Nz"%s not greater than or equal to %sr9rMrrr�assertGreaterEqual szTestCase.assertGreaterEqualcCs,|dk	r(dt|�f}|�|�||��dS)Nz%s is not Noner9�rr)rWrYrrr�assertIsNone&szTestCase.assertIsNonecCs"|dkrd}|�|�||��dS)Nzunexpectedly None)rrVrTrrr�assertIsNotNone,szTestCase.assertIsNotNonecCs0t||�s,dt|�|f}|�|�||��dS)Nz%s is not an instance of %r�r;rrrV�rr)r�rWrYrrrrA2s
zTestCase.assertIsInstancecCs0t||�r,dt|�|f}|�|�||��dS)Nz%s is an instance of %rrWrXrrr�assertNotIsInstance9s
zTestCase.assertNotIsInstancecOst|||�}|�d||�S)N�assertRaisesRegexr)rrr^r-r.r
rrrrZ?s
zTestCase.assertRaisesRegexcOst|||�}|�d||�S)N�assertWarnsRegexr)rrr^r-r.r
rrrr[OszTestCase.assertWarnsRegexcCsJt|ttf�rt�|�}|�|�sFd|j|f}|�||�}|�|��dS)Nz&Regex didn't match: %r not found in %r)	r;r�bytesr\r]rprqrVrX)r�textr^rWrYrrr�assertRegexbs

�zTestCase.assertRegexcCs`t|ttf�rt�|�}|�|�}|r\d||��|���|j|f}|�	||�}|�
|��dS)Nz"Regex matched: %r matches %r in %r)r;rr\r\r]rp�start�endrqrVrX)rr]Zunexpected_regexrW�matchrYrrr�assertNotRegexns

�zTestCase.assertNotRegexcs�fdd�}|S)Ncs t�d��j�td��||�S)NzPlease use {0} instead.r�)r�r�rlrr�r7��
original_funcrr�deprecated_func~s
�z,TestCase._deprecate.<locals>.deprecated_funcr)rdrerrcr�
_deprecate}szTestCase._deprecate)r�)N)N)N)N)NN)N)N)N)NNN)NNN)NN)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)drrr
�AssertionErrorrXrr2rLZ_classSetupFailedr�rr�r��__text_signature__�classmethodr�r�r�r�r�r�r�r�r�r�r�r�r�r�r&r'�_subtest_msg_sentinelr�r�r�r�r�r�r�r�r�r�r�r�rrrrrrVr
rrrrrrr r!r1r-r�r�r�r<r=r?r@r�rFrJr�rPrQrRrSrUrVrArYrZr[r^rbrfZfailUnlessEqualZassertEqualsZfailIfEqualZassertNotEqualsZfailUnlessAlmostEqualZassertAlmostEqualsZfailIfAlmostEqualZassertNotAlmostEqualsZ
failUnlessZassert_ZfailUnlessRaisesZfailIfZassertRaisesRegexpZassertRegexpMatchesZassertNotRegexpMatchesrrrrr�ws�!
 


	


E

	


!



	�
-�
#
c


+






 










	r�csfeZdZd�fdd�	Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Z�Z
S)�FunctionTestCaseNcs*tt|���||_||_||_||_dSr()�superrkr�
_setUpFunc�
_tearDownFunc�	_testFunc�_description)rZtestFuncr�r�Zdescription�r�rrr�s
zFunctionTestCase.__init__cCs|jdk	r|��dSr()rmrirrrr��s
zFunctionTestCase.setUpcCs|jdk	r|��dSr()rnrirrrr��s
zFunctionTestCase.tearDowncCs|��dSr()rorirrrr��szFunctionTestCase.runTestcCs|jjSr()rorrirrrr��szFunctionTestCase.idcCs@t||j�stS|j|jko>|j|jko>|j|jko>|j|jkSr()r;r�r�rmrnrorpr�rrrr��s
�
�
�zFunctionTestCase.__eq__cCstt|�|j|j|j|jf�Sr()r�r<rmrnrorprirrrr��s�zFunctionTestCase.__hash__cCsdt|j�|jjfSr�)rr�rorrirrrr��s
�zFunctionTestCase.__str__cCsdt|j�|jfS)Nz<%s tec=%s>)rr�rorirrrr��s
�zFunctionTestCase.__repr__cCs2|jdk	r|jS|jj}|r.|�d�d��p0dSr�)rpror�r�r�r�rrrr��s
z!FunctionTestCase.shortDescription)NNN)rrr
rr�r�r�r�r�r�r�r�r��
__classcell__rrrqrrk�s		rkcsDeZdZ�fdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Z�Z	S)
r�cs(t���||_||_||_|j|_dSr()rlr�_messager"r�rX)rr"r�r�rqrrr�s

z_SubTest.__init__cCstd��dS)Nzsubtests cannot be run directly)r"rirrrr��sz_SubTest.runTestcCs^g}|jtk	r |�d�|j��|jrPd�dd�|j��D��}|�d�|��d�|�p\dS)Nz[{}]z, css|]\}}d�||�VqdS)z{}={!r}N)rl)rMr�r�rrrrP�s�z+_SubTest._subDescription.<locals>.<genexpr>z({})� z(<subtest>))rsrjrrlr�r'rC)r�partsZparams_descrrr�_subDescription�s

�z_SubTest._subDescriptioncCsd�|j��|���S�Nz{} {})rlr"r�rvrirrrr��sz_SubTest.idcCs
|j��Sr()r"r�rirrrr��sz_SubTest.shortDescriptioncCsd�|j|���Srw)rlr"rvrirrrr��sz_SubTest.__str__)
rrr
rr�rvr�r�r�rrrrrqrr��sr�)3r r=r(r�r*r\r�rHr&rmrDrCr�utilrrrrrZ
__unittest�objectrjr3r2r	rrrr*r+r/r5rFrIrJrrLrUr[rhrx�
namedtupler�r�r�r��ChainMapr�r�rkr�rrrr�<module>sb(	*%5�,
$:unittest/__pycache__/signals.cpython-38.pyc000064400000004256151153537550014744 0ustar00U

e5dc	�@sbddlZddlZddlmZdZGdd�de�Ze��Zdd�Z	dd	�Z
dad
d�Zddd
�Z
dS)�N)�wrapsTc@seZdZdd�Zdd�ZdS)�_InterruptHandlercCsNd|_||_t|t�rD|tjkr(tj}n|tjkr<dd�}ntd��||_	dS)NFcSsdS�N�)Z
unused_signumZunused_framerr�(/usr/lib64/python3.8/unittest/signals.py�default_handlersz3_InterruptHandler.__init__.<locals>.default_handlerzYexpected SIGINT signal handler to be signal.SIG_IGN, signal.SIG_DFL, or a callable object)
�called�original_handler�
isinstance�int�signal�SIG_DFL�default_int_handler�SIG_IGN�	TypeErrorr)�selfrrrr�__init__
s



z_InterruptHandler.__init__cCsRt�tj�}||k	r |�||�|jr2|�||�d|_t��D]}|��q@dS)NT)r�	getsignal�SIGINTrr�_results�keys�stop)rZsignum�frameZinstalled_handler�resultrrr�__call__sz_InterruptHandler.__call__N)�__name__�
__module__�__qualname__rrrrrrr	srcCsdt|<dS)N�)r�rrrr�registerResult*sr cCstt�|d��Sr)�boolr�poprrrr�removeResult-sr#cCs.tdkr*t�tj�}t|�at�tjt�dSr)�_interrupt_handlerrrrr)rrrr�installHandler1sr%cs<�dk	r t���fdd��}|Stdk	r8t�tjtj�dS)Nc
s6t�tj�}t�z�||�W�St�tj|�XdSr)rrr�
removeHandler)�args�kwargs�initial��methodrr�inner;s
zremoveHandler.<locals>.inner)rr$rrr	)r+r,rr*rr&9sr&)N)r�weakref�	functoolsrZ
__unittest�objectr�WeakKeyDictionaryrr r#r$r%r&rrrr�<module>s unittest/__pycache__/suite.cpython-38.pyc000064400000023321151153537550014427 0ustar00U

e5d2�@s|dZddlZddlmZddlmZdZdd�ZGd	d
�d
e�ZGdd�de�Z	Gdd
�d
e�Z
dd�ZGdd�de�ZdS)�	TestSuite�N�)�case)�utilTcCst||dd��}|�dS)NcSsdS�N�rrr�&/usr/lib64/python3.8/unittest/suite.py�<lambda>�z!_call_if_exists.<locals>.<lambda>)�getattr)�parent�attr�funcrrr�_call_if_existssrc@sneZdZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)�
BaseTestSuitezNA simple test suite that doesn't provide class or module shared fixtures.
    TrcCsg|_d|_|�|�dS�Nr)�_tests�_removed_tests�addTests)�self�testsrrr�__init__szBaseTestSuite.__init__cCsdt�|j�t|�fS)Nz
<%s tests=%s>)r�strclass�	__class__�list�rrrr�__repr__szBaseTestSuite.__repr__cCs t||j�stSt|�t|�kSr)�
isinstancer�NotImplementedr)r�otherrrr�__eq__szBaseTestSuite.__eq__cCs
t|j�Sr)�iterrrrrr�__iter__"szBaseTestSuite.__iter__cCs$|j}|D]}|r
||��7}q
|Sr)r�countTestCases)rZcases�testrrrr#%s
zBaseTestSuite.countTestCasescCsLt|�std�t|����t|t�r<t|tjt	f�r<td��|j
�|�dS)Nz{} is not callablezNTestCases and TestSuites must be instantiated before passing them to addTest())�callable�	TypeError�format�reprr�type�
issubclassrZTestCaserr�append�rr$rrr�addTest,s�zBaseTestSuite.addTestcCs*t|t�rtd��|D]}|�|�qdS)Nz0tests must be an iterable of tests, not a string)r�strr&r-)rrr$rrrr6s
zBaseTestSuite.addTestscCs8t|�D]*\}}|jrq4||�|jr|�|�q|Sr)�	enumerate�
shouldStop�_cleanup�_removeTestAtIndex)r�result�indexr$rrr�run<szBaseTestSuite.runcCsNz|j|}Wntk
r"Yn(Xt|d�r@|j|��7_d|j|<dS)z2Stop holding a reference to the TestCase at index.r#N)rr&�hasattrrr#)rr4r$rrrr2Es
z BaseTestSuite._removeTestAtIndexcOs|j||�Sr�r5)r�args�kwdsrrr�__call__SszBaseTestSuite.__call__cCs|D]}|��qdS)�7Run the tests without collecting errors in a TestResultN)�debugr,rrrr<VszBaseTestSuite.debugN)r)�__name__�
__module__�__qualname__�__doc__r1rrr r"r#r-rr5r2r:r<rrrrrs

	rc@s^eZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zddd�Z	ddd�Z
dd�Zdd�Zd
S)ra�A test suite is a composite test consisting of a number of TestCases.

    For use, create an instance of TestSuite, then add test case instances.
    When all tests have been added, the suite can be passed to a test
    runner, such as TextTestRunner. It will run the individual test cases
    in the order in which they were added, aggregating the results. When
    subclassing, do not forget to call the base class constructor.
    FcCs�d}t|dd�dkrd|_}t|�D]�\}}|jr8q�t|�r�|�||�|�||�|�||�|j|_	t|jdd�s&t|dd�r�q&|s�||�n|�
�|jr&|�|�q&|r�|�d|�|�
|�d|_|S)NF�_testRunEnteredT�_classSetupFailed�_moduleSetUpFailed)rrAr/r0�_isnotsuite�_tearDownPreviousClass�_handleModuleFixture�_handleClassSetUpr�_previousTestClassr<r1r2�_handleModuleTearDown)rr3r<ZtopLevelr4r$rrrr5fs2

�

z
TestSuite.runcCst�}|�|d�dS)r;TN)�_DebugResultr5)rr<rrrr<�szTestSuite.debugc	Cs2t|dd�}|j}||krdS|jr(dSt|dd�r8dSz
d|_Wntk
rVYnXt|dd�}|dk	�r.t|d�z^z
|�WnNt
k
r�}z0t|t�r��d|_t
�|�}|�	||d|�W5d}~XYnXW5t|d�|jdk�r,|��t|j�dk�r,|jD]}|j	||d	d||d
��qXdS)NrH�__unittest_skip__F�
setUpClass�_setupStdout�_restoreStdoutTrr��info)rrrCrBr&r�doClassCleanups�len�tearDown_exceptions�"_createClassOrModuleLevelException�	ExceptionrrJrr)	rr$r3�
previousClass�currentClassrL�exc�	className�errrrG�sL





�

�zTestSuite._handleClassSetUpcCs"d}t|dd�}|dk	r|j}|S)NrH)rr>)rr3�previousModulerVrrr�_get_previous_module�s
zTestSuite._get_previous_modulec	
Cs|�|�}|jj}||krdS|�|�d|_ztj|}Wntk
rRYdSXt|dd�}|dk	�rt	|d�z�z
|�Wn�t
k
�r}zfzt��Wn2t
k
r�}z|�
||d|�W5d}~XYnXt|t�r�d|_|�
||d|�W5d}~XYnXW5t	|d�XdS)NF�setUpModulerMrNT)r\rr>rIrC�sys�modules�KeyErrorrrrUr�doModuleCleanupsrTrrJ)	rr$r3r[Z
currentModule�moduler]rZrXrrrrF�s>




�
�zTestSuite._handleModuleFixtureNcCs$|�d|�d�}|�||||�dS)Nz (�))�_addClassOrModuleLevelException)rr3rXZmethod_namerrP�	errorNamerrrrT�sz,TestSuite._createClassOrModuleLevelExceptioncCs^t|�}t|dd�}|dk	r8t|tj�r8||t|��n"|sN|�|t���n|�||�dS)N�addSkip)	�_ErrorHolderrrrZSkipTestr.ZaddErrorr^�exc_info)rr3Z	exceptionrerP�errorrfrrrrd�sz)TestSuite._addClassOrModuleLevelExceptioncCs|�|�}|dkrdS|jr dSztj|}Wntk
rDYdSXt|dd�}|dk	�rt|d�zNz
|�Wn>t	k
r�}z t|t�r��|�
||d|�W5d}~XYnXW5t|d�zt��Wn4t	k
�r}z|�
||d|�W5d}~XYnXXdS)N�tearDownModulerMrN)
r\rCr^r_r`rrrrarUrTrrJ)rr3r[rbrjrZrrrrI�s:




�
�zTestSuite._handleModuleTearDownc	Cst|dd�}|j}||krdSt|dd�r.dSt|dd�r>dSt|dd�rNdSt|dd�}|dk	�rt|d�zXz
|�WnHt	k
r�}z*t
|t�r��t�|�}|�||d|�W5d}~XYnXW5t|d�|��t|j�d	k�r|jD]&}t�|�}|j||d
d||d�q�XdS)NrHrBFrCrK�
tearDownClassrMrNrrrO)rrrrQrRrSrrrTrUrrJ)	rr$r3rVrWrkrXrYrZrrrrEsB




�


�z TestSuite._tearDownPreviousClass)F)N)N)
r=r>r?r@r5r<rGr\rFrTrdrIrErrrrr\s	
!($�
�
 c@sTeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�ZdS)rgz�
    Placeholder for a TestCase inside a result. As far as a TestResult
    is concerned, this looks exactly like a unit test. Used to insert
    arbitrary errors into a test suite run.
    NcCs
||_dSr��description)rrmrrrrBsz_ErrorHolder.__init__cCs|jSrrlrrrr�idEsz_ErrorHolder.idcCsdSrrrrrr�shortDescriptionHsz_ErrorHolder.shortDescriptioncCsd|jfS)Nz<ErrorHolder description=%r>rlrrrrrKsz_ErrorHolder.__repr__cCs|��Sr)rnrrrr�__str__Nsz_ErrorHolder.__str__cCsdSrr�rr3rrrr5Qsz_ErrorHolder.runcCs
|�|�Srr7rqrrrr:Vsz_ErrorHolder.__call__cCsdSrrrrrrr#Ysz_ErrorHolder.countTestCases)
r=r>r?r@ZfailureExceptionrrnrorrpr5r:r#rrrrrg6s	rgcCs(zt|�Wntk
r"YdSXdS)z?A crude way to tell apart testcases and suites with duck-typingTF)r!r&)r$rrrrD\s
rDc@seZdZdZdZdZdZdS)rJzCUsed by the TestSuite to hold previous class when running in debug.NF)r=r>r?r@rHrCr0rrrrrJesrJ)
r@r^�rrZ
__unittestr�objectrrrgrDrJrrrr�<module>sL[&	unittest/__pycache__/mock.cpython-38.opt-1.pyc000064400000227070151153537550015175 0ustar00U

e5d��@s�dZdZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
mZmZddl
mZddlmZmZdd�ee�D�Zd	ZeZd
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Zd�dd�Zdd�Zdd�Zdd�Z dd �Z!d�d!d"�Z"d#d$�Z#d%d&�Z$d'd(�Z%Gd)d*�d*e&�Z'Gd+d,�d,e&�Z(e(�Z)e)j*Z*e)j+Z,e)j-Z.d-d.d/d0d1d2d3d4hZ/d5d6�Z0Gd7d8�d8e1�Z2d9d:�Z3Gd;d<�d<e&�Z4Gd=d>�d>e&�Z5Gd?d@�d@e5�Z6dAdB�Z7GdCdD�dDe5�Z8GdEdF�dFe8e6�Z9dGdH�Z:dIdJ�Z;GdKdL�dLe&�Z<dMdN�Z=e*dddddfdOdP�Z>d�dQdR�Z?e*dddddfdSdT�Z@GdUdV�dVe&�ZAdWdX�ZBdYdZ�ZCe>e@_&eAe@_De?e@_EeCe@_Fd[e@_Gd\ZHd]ZId^�Jd_d`�eI�K�D��ZLd^�Jdad`�eI�K�D��ZMdbdcdddedfdgdhdidjdkdldmdndodpdqdrdshZNdtdu�ZOdvd�d^�JeHeIeLeMg��K�D�ZPdwdxdyhZQdzhZReQeRBZSePeNBZTeTeSBZUd{d|d}d~dd�d�d�hZVd�d��d�d��d�d��d�d��d��ZWeXeXeXeXd�dddd�d�d	d�dd��
ZYd�d��ZZd�d��Z[d�d��Z\d�d��Z]eZe[e\e]d��Z^d�d��Z_Gd�d��d�e5�Z`Gd�d��d�e`e6�ZaGd�d��d�e`�ZbGd�d��d�e`e9�ZcGd�d��d�e5�ZdGd�d��d�e5�ZeGd�d��d�eeebe9�ZfGd�d��d�e&�Zgeg�Zhd�d��ZiGd�d��d�ej�Zkekdd��Zld�d�d��Zmd�d��ZnGd�d��d�e&�Zoepem�epehjq�fZrdasd�d��Ztd�d�d��ZuGd�d��d�e9�Zvd�d��ZwGd�d��d��ZxdS)�)�Mock�	MagicMock�patch�sentinel�DEFAULT�ANY�call�create_autospec�	AsyncMock�
FILTER_DIR�NonCallableMock�NonCallableMagicMock�	mock_open�PropertyMock�sealz1.0�N)�CodeType�
ModuleType�
MethodType)�	safe_repr)�wraps�partialcCsh|]}|�d�s|�qS��_��
startswith)�.0�name�r�%/usr/lib64/python3.8/unittest/mock.py�	<setcomp>(s
rTcCs>t|�rt|t�sdSt|d�r*t|d�}t�|�p<t�|�S)NF�__func__)	�_is_instance_mock�
isinstancer	�hasattr�getattr�asyncio�iscoroutinefunction�inspectZisawaitable��objrrr�
_is_async_obj0s


r*cCst|dd�rt�|�SdSdS)N�__code__F)r$r%r&��funcrrr�_is_async_func8s
r.cCstt|�t�S�N)�
issubclass�typerr(rrrr!?sr!cCst|t�pt|t�ot|t�Sr/)r"�
BaseExceptionr1r0r(rrr�
_is_exceptionEs
�r3cCs"t|t�rt|d�r|jS|SdS�N�mock)r"�
FunctionTypesr#r5r(rrr�
_extract_mockLsr7cCs�t|t�r|s|j}d}n,t|t�sFz
|j}Wntk
rDYdSX|rVt|d�}n|}z|t�|�fWSt	k
r�YdSXdS)z�
    Given an arbitrary, possibly callable object, try to create a suitable
    signature object.
    Return a (reduced func, signature) tuple, or None.
    TN)
r"r1�__init__r6�__call__�AttributeErrorrr'�	signature�
ValueError)r-Zas_instanceZeat_selfZsig_funcrrr�_get_signature_objectUs

r=FcsNt|||���dkrdS�\}��fdd�}t||�|t|�_�t|�_dS)Ncs�j||�dSr/��bind��self�args�kwargs��sigrr�checksigwsz"_check_signature.<locals>.checksig)r=�_copy_func_detailsr1�_mock_check_sig�
__signature__)r-r5�	skipfirst�instancerFrrDr�_check_signaturers

rLc	Cs:dD]0}zt||t||��Wqtk
r2YqXqdS)N)�__name__�__doc__�__text_signature__�
__module__�__defaults__�__kwdefaults__)�setattrr$r:)r-�funcopy�	attributerrrrG~s
rGcCs@t|t�rdSt|tttf�r(t|j�St|dd�dk	r<dSdS)NTr9F)r"r1�staticmethod�classmethodr�	_callabler r$r(rrrrX�s

rXcCst|�ttfkSr/)r1�list�tupler(rrr�_is_list�sr[cCsFt|t�st|dd�dk	S|f|jD]}|j�d�dk	r&dSq&dS)ztGiven an object, return True if the object is callable.
    For classes, return True if instances would be callable.r9NTF)r"r1r$�__mro__�__dict__�get)r)�baserrr�_instance_callable�s
r`cs�t|t�}t|||�}|dkr"|S|\}��fdd�}t||�|j}|��sRd}||d�}d|}	t|	|�||}
t|
|��|
S)Ncs�j||�dSr/r>�rBrCrDrrrF�sz _set_signature.<locals>.checksigrT)Z
_checksig_r5zYdef %s(*args, **kwargs):
    _checksig_(*args, **kwargs)
    return mock(*args, **kwargs))r"r1r=rGrM�isidentifier�exec�_setup_func)r5�originalrKrJ�resultr-rFr�context�srcrTrrDr�_set_signature�s$


�
rics���_�fdd�}�fdd�}�fdd�}�fdd�}�fd	d
�}�fdd�}�fd
d�}	��fdd�}
d�_d�_d�_t��_t��_t��_�j�_�j	�_	�j
�_
|�_|�_|�_
|	�_|
�_|�_|�_|�_|�_��_dS)Ncs�j||�Sr/)�assert_called_withra�r5rrrj�sz'_setup_func.<locals>.assert_called_withcs�j||�Sr/)�
assert_calledrarkrrrl�sz"_setup_func.<locals>.assert_calledcs�j||�Sr/)�assert_not_calledrarkrrrm�sz&_setup_func.<locals>.assert_not_calledcs�j||�Sr/)�assert_called_oncerarkrrrn�sz'_setup_func.<locals>.assert_called_oncecs�j||�Sr/)�assert_called_once_withrarkrrro�sz,_setup_func.<locals>.assert_called_once_withcs�j||�Sr/)�assert_has_callsrarkrrrp�sz%_setup_func.<locals>.assert_has_callscs�j||�Sr/)�assert_any_callrarkrrrq�sz$_setup_func.<locals>.assert_any_callcs:t��_t��_����j}t|�r6|�k	r6|��dSr/)�	_CallList�method_calls�
mock_calls�
reset_mock�return_valuer!)�ret�rTr5rrru�sz_setup_func.<locals>.reset_mockFr)r5�called�
call_count�	call_argsrr�call_args_listrsrtrv�side_effect�_mock_childrenrjrorprqrurlrmrnrI�_mock_delegate)rTr5rErjrlrmrnrorprqrurrxrrd�s8rdcsJtjj�_d�_d�_t��_�fdd�}dD]}t�|t||��q.dS)Nrcst�j|�||�Sr/)r$r5)�attrrBrCrkrr�wrapper�sz"_setup_async_mock.<locals>.wrapper)�assert_awaited�assert_awaited_once�assert_awaited_with�assert_awaited_once_with�assert_any_await�assert_has_awaits�assert_not_awaited)	r%�
coroutines�
_is_coroutine�await_count�
await_argsrr�await_args_listrSr)r5r�rUrrkr�_setup_async_mock�s
r�cCsd|dd�|kS)N�__%s__����r�rrrr�	_is_magicsr�c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_SentinelObjectz!A unique, named, sentinel object.cCs
||_dSr/r��rArrrrr8sz_SentinelObject.__init__cCs
d|jS�Nzsentinel.%sr��rArrr�__repr__sz_SentinelObject.__repr__cCs
d|jSr�r�r�rrr�
__reduce__sz_SentinelObject.__reduce__N)rMrP�__qualname__rNr8r�r�rrrrr�sr�c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�	_SentinelzAAccess attributes to return a named object, usable as a sentinel.cCs
i|_dSr/)�
_sentinelsr�rrrr8#sz_Sentinel.__init__cCs|dkrt�|j�|t|��S)N�	__bases__)r:r��
setdefaultr�r�rrr�__getattr__&sz_Sentinel.__getattr__cCsdS)Nrrr�rrrr�,sz_Sentinel.__reduce__N)rMrPr�rNr8r�r�rrrrr�!sr�rv�_mock_return_valuer}�_mock_side_effect�_mock_parent�_mock_new_parent�
_mock_name�_mock_new_namecCs8t�|�d|}||fdd�}||fdd�}t||�S)NZ_mock_cSs"|j}|dkrt||�St||�Sr/)rr$)rAr�	_the_namerErrr�_getAs
z"_delegating_property.<locals>._getcSs*|j}|dkr||j|<nt|||�dSr/)rr]rS)rA�valuerr�rErrr�_setFsz"_delegating_property.<locals>._set)�_allowed_names�add�property)rr�r�r�rrr�_delegating_property>s

r�c@seZdZdd�Zdd�ZdS)rrcCslt|t�st�||�St|�}t|�}||kr2dStd||d�D]"}||||�}||krDdSqDdS)NFr�T)r"rY�__contains__�len�range)rAr�Z	len_valueZlen_self�iZsub_listrrrr�Ss
z_CallList.__contains__cCst�t|��Sr/)�pprintZpformatrYr�rrrr�asz_CallList.__repr__N)rMrPr�r�r�rrrrrrQsrrcCs|t|�}t|�sdS|js4|js4|jdk	s4|jdk	r8dS|}|dk	rX||krPdS|j}q<|rh||_||_|rx||_||_dS)NFT)r7r!r�r�r�r�)�parentr�r�new_name�_parentrrr�_check_and_set_parentes*��r�c@seZdZdd�Zdd�ZdS)�	_MockItercCst|�|_dSr/)�iterr))rAr)rrrr8�sz_MockIter.__init__cCs
t|j�Sr/)�nextr)r�rrr�__next__�sz_MockIter.__next__N)rMrPr�r8r�rrrrr��sr�c@seZdZeZdZdd�ZdS)�BaseNcOsdSr/rr@rrrr8�sz
Base.__init__)rMrPr�rr�r�r8rrrrr��sr�c@sdeZdZdZdd�ZdLdd�Zd	d
�ZdMdd�ZdNd
d�Zdd�Z	dd�Z
dZee	e
e�Z
edd��Zed�Zed�Zed�Zed�Zed�Zdd�Zdd�Zeee�ZdOddd�d d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Z dPd3d4�Z!d5d6�Z"d7d8�Z#d9d:�Z$d;d<�Z%d=d>�Z&d?d@�Z'dAdB�Z(dQdCdD�Z)dEdF�Z*dGdH�Z+dRdJdK�Z,dS)Srz A non-callable version of `Mock`c	Os�|f}t|t�s^t�tj�}|j|f|�|�j}dd�|��D�}|r^t	||d�r^t
|f}t|j|d|j
i�}tt|��|�}|S)NcSsg|]}|�d�r|�qS��specr�r�argrrr�
<listcomp>�s
�z+NonCallableMock.__new__.<locals>.<listcomp>rrN)r0r	r'r;rr8Zbind_partialZ	arguments�keysr*�AsyncMockMixinr1rMrN�_safe_super�__new__)	�clsrB�kw�basesrEZ
bound_argsZspec_arg�newrKrrrr��s
�zNonCallableMock.__new__N�FcKs�|dkr|}|j}
||
d<||
d<||
d<||
d<d|
d<|dk	rJ|}d}|
dkrZ|dk	}
|�|||	|
�i|
d<||
d	<d|
d
<d|
d<d|
d<d
|
d<t�|
d<t�|
d<t�|
d<||
d<|r�|jf|�tt|��||||||�dS)Nr�r�r�r�F�_mock_sealedTr~�_mock_wrapsrZ_mock_calledZ_mock_call_argsrZ_mock_call_countZ_mock_call_args_listZ_mock_mock_callsrs�_mock_unsafe)r]�_mock_add_specrr�configure_mockr�rr8)rAr�rr�spec_setr��_spec_state�	_new_name�_new_parent�_spec_as_instance�	_eat_selfZunsaferCr]rrrr8�sD



�zNonCallableMock.__init__cCs0t|�}d|_d|_d|_d|_t|||�dS)z�
        Attach a mock as an attribute of this one, replacing its name and
        parent. Calls to the attached mock will be recorded in the
        `method_calls` and `mock_calls` attributes of this one.Nr�)r7r�r�r�r�rS)rAr5rUZ
inner_mockrrr�attach_mock�szNonCallableMock.attach_mockcCs|�||�dS�z�Add a spec to a mock. `spec` can either be an object or a
        list of strings. Only attributes on the `spec` can be fetched as
        attributes from the mock.

        If `spec_set` is True then only attributes on the spec can be set.N)r��rAr�r�rrr�
mock_add_spec�szNonCallableMock.mock_add_speccCs�d}d}g}t|�D] }t�t||d��r|�|�q|dk	r~t|�s~t|t�rV|}nt|�}t|||�}	|	ot|	d}t|�}|j	}
||
d<||
d<||
d<||
d<||
d<dS)Nr��_spec_class�	_spec_set�_spec_signature�
_mock_methods�_spec_asyncs)
�dirr%r&r$�appendr[r"r1r=r])rAr�r�r�r�r�r�r�r��resr]rrrr��s,
�zNonCallableMock._mock_add_speccCs8|j}|jdk	r|jj}|tkr4|j|dd�}||_|S)N�()�r�r�)r�rrvr�_get_child_mock)rArwrrrZ__get_return_values
�z"NonCallableMock.__get_return_valuecCs,|jdk	r||j_n||_t||dd�dS)Nr�)rrvr�r�)rAr�rrrZ__set_return_values

z"NonCallableMock.__set_return_valuez1The value to be returned when the mock is called.cCs|jdkrt|�S|jSr/)r�r1r�rrr�	__class__!s
zNonCallableMock.__class__ryrzr{r|rtcCsN|j}|dkr|jS|j}|dk	rJt|�sJt|t�sJt|�sJt|�}||_|Sr/)rr�r}�callabler"r�r3)rA�	delegatedZsfrrrZ__get_side_effect.s��z!NonCallableMock.__get_side_effectcCs(t|�}|j}|dkr||_n||_dSr/)�	_try_iterrr�r})rAr�r�rrrZ__set_side_effect9s
z!NonCallableMock.__set_side_effect)rvr}cCs�|dkrg}t|�|krdS|�t|��d|_d|_d|_t�|_t�|_t�|_|r^t	|_
|rhd|_|j�
�D]"}t|t�sr|tkr�qr|�|�qr|j
}t|�r�||k	r�|�|�dS)z-Restore the mock object to its initial state.NFr)�idr�ryr{rzrrrtr|rsrr�r�r~�valuesr"�
_SpecState�_deletedrur!)rAZvisitedrvr}�childrwrrrruDs,zNonCallableMock.reset_mockcKsXt|��dd�d�D]>\}}|�d�}|��}|}|D]}t||�}q6t|||�qdS)aZSet attributes on the mock through keyword arguments.

        Attributes plus return values and side effects can be set on child
        mocks using standard dot notation and unpacking a dictionary in the
        method call:

        >>> attrs = {'method.return_value': 3, 'other.side_effect': KeyError}
        >>> mock.configure_mock(**attrs)cSs|d�d�S)Nr�.)�count)�entryrrr�<lambda>o�z0NonCallableMock.configure_mock.<locals>.<lambda>)�keyr�N)�sorted�items�split�popr$rS)rArCr��valrB�finalr)r�rrrr�bs	�
zNonCallableMock.configure_mockcCs�|dkrt|��n:|jdk	r<||jks.|tkrLtd|��nt|�rLt|��|jsd|�d�rdtd��|j�|�}|tkr�t|��np|dkr�d}|j	dk	r�t
|j	|�}|j|||||d�}||j|<n.t|t
�r�t|j|j|j|j|j�}||j|<|S)N>r�r�zMock object has no attribute %r)�assertZassretz1Attributes cannot start with 'assert' or 'assret')r�rrr�r�)r:r��_all_magicsr�r�rr~r^r�r�r$r�r"r�rr�r�rKr�r)rArrfrrrrr�xsF




�
�
zNonCallableMock.__getattr__cCs�|jg}|j}|}d}|dgkr$d}|dk	rZ|}|�|j|�d}|jdkrRd}|j}q$tt|��}|jpnd}t|�dkr�|ddkr�|d7}||d<d�|�S)Nr�r�r�r5r�)r�z().r)r�r�r�rY�reversedr�r��join)rAZ
_name_listr�Zlast�dotZ_firstrrr�_extract_mock_name�s(


z"NonCallableMock._extract_mock_namecCs^|��}d}|dkrd|}d}|jdk	rDd}|jr8d}||jj}dt|�j||t|�fS)Nr�)r5zmock.z name=%rz spec=%rz spec_set=%rz<%s%s%s id='%s'>)r�r�r�rMr1r�)rArZname_stringZspec_stringrrrr��s 
�zNonCallableMock.__repr__cCsvtst�|�S|jpg}tt|��}t|j�}dd�|j�	�D�}dd�|D�}dd�|D�}t
t||||��S)z8Filter the output of `dir(mock)` to only useful members.cSsg|]\}}|tk	r|�qSr)r�)rZm_nameZm_valuerrrr��s�z+NonCallableMock.__dir__.<locals>.<listcomp>cSsg|]}|�d�s|�qSrr�r�errrr��s
cSs"g|]}|�d�rt|�r|�qSr)rr�rrrrr��s
�)r
�object�__dir__r�r�r1rYr]r~r�r��set)rAZextrasZ	from_typeZ	from_dictZfrom_child_mocksrrrr�s


�zNonCallableMock.__dir__csT|tkrt��||�S�jrH�jdk	rH|�jkrH|�jkrHtd|��n�|tkrbd|}t|��n�|tkr�jdk	r�|�jkr�td|��t	|�s�t
t��|t||��|���fdd�}n(t
�|d|�t
t��||�|�j|<n,|dkr�|�_dSt
�|||��r|�j|<�j�rFt�|��sF����d|��}td|����t��||�S)Nz!Mock object has no attribute '%s'z.Attempting to set unsupported magic method %r.cs��f|�|�Sr/r�rBr��rerArrr��r�z-NonCallableMock.__setattr__.<locals>.<lambda>r�r�zCannot set )r�r�__setattr__r�r�r]r:�_unsupported_magicsr�r!rSr1�_get_methodr�r~r�r�r#r�)rArr��msg�	mock_namerrrr�s<��

zNonCallableMock.__setattr__cCs�|tkr2|t|�jkr2tt|�|�||jkr2dS|j�|t�}||jkr\tt|��	|�n|t
krlt|��|tk	r||j|=t
|j|<dSr/)r�r1r]�delattrr~r^�_missingr�r�__delattr__r�r:)rArr)rrrrs

zNonCallableMock.__delattr__cCs|jpd}t|||�Sr4)r��_format_call_signature�rArBrCrrrr�_format_mock_call_signatures
z+NonCallableMock._format_mock_call_signaturercCs.d}|�||�}|j}|j|�}||||fS)Nz.expected %s not found.
Expected: %s
Actual: %s)rr{)rArBrC�action�message�expected_stringr{Z
actual_stringrrr�_format_mock_failure_messages

z,NonCallableMock._format_mock_failure_messagecCsj|s
|jSd}|�dd��d�}|j}|D]:}|�|�}|dksJt|t�rPqfq*t|�}|j}|j}q*|S)aH
        * If call objects are asserted against a method/function like obj.meth1
        then there could be no name for the call object to lookup. Hence just
        return the spec_signature of the method/function being asserted against.
        * If the name is not empty then remove () and split by '.' to get
        list of names to iterate through the children until a potential
        match is found. A child mock is created only during attribute access
        so if we get a _SpecState then no attributes of the spec were accessed
        and can be safely exited.
        Nr�r�r�)r��replacer�r~r^r"r�r7)rArrE�namesZchildrenr�rrr�_get_call_signature_from_name's
z-NonCallableMock._get_call_signature_from_namec
Cs�t|t�r&t|�dkr&|�|d�}n|j}|dk	r�t|�dkrNd}|\}}n
|\}}}z||j||�fWStk
r�}z|�d�WY�Sd}~XYq�Xn|SdS)a
        Given a call (or simply an (args, kwargs) tuple), return a
        comparison key suitable for matching with other calls.
        This is a best effort method which relies on the spec's signature,
        if available, or falls back on the arguments themselves.
        r�rNr�)r"rZr�rr�r?�	TypeError�with_traceback)rA�_callrErrBrCrrrr�
_call_matcherHs

"zNonCallableMock._call_matchercCs0|jdkr,d|jpd|j|��f}t|��dS)z/assert that the mock was never called.
        rz9Expected '%s' to not have been called. Called %s times.%sr5N�rzr��_calls_repr�AssertionError�rAr
rrrrmbs
��z!NonCallableMock.assert_not_calledcCs$|jdkr d|jpd}t|��dS)z6assert that the mock was called at least once
        rz"Expected '%s' to have been called.r5N)rzr�rr rrrrlls

�zNonCallableMock.assert_calledcCs0|jdks,d|jpd|j|��f}t|��dS)z3assert that the mock was called only once.
        r�z:Expected '%s' to have been called once. Called %s times.%sr5Nrr rrrrnts
��z"NonCallableMock.assert_called_oncecs��jdkr.�����}d}d||f}t|�����fdd�}����f�}���j�}||kr~t|t�rn|nd}t|��|�dS)z�assert that the last call was made with the specified arguments.

        Raises an AssertionError if the args and keyword args passed in are
        different to the last call to the mock.Nznot called.z0expected call not found.
Expected: %s
Actual: %scs�����}|Sr/�r�r
�rBrCrArr�_error_message�sz:NonCallableMock.assert_called_with.<locals>._error_message)r{rrrr"�	Exception)rArBrC�expected�actualZ
error_messager$�causerr#rrj~s
�z"NonCallableMock.assert_called_withcOs8|jdks,d|jpd|j|��f}t|��|j||�S)ziassert that the mock was called exactly once and that that call was
        with the specified arguments.r�z3Expected '%s' to be called once. Called %s times.%sr5)rzr�rrrj�rArBrCr
rrrro�s
��z'NonCallableMock.assert_called_once_withc		s�fdd�|D�}tdd�|D�d�}t�fdd��jD��}|s�||kr�|dkrXd}nd�d	d�|D��}t|�d
t|���jdd��d
����|�dSt|�}g}|D]2}z|�|�Wq�t	k
r�|�
|�Yq�Xq�|�rtd�jp�dt|�|f�|�dS)a�assert the mock has been called with the specified calls.
        The `mock_calls` list is checked for the calls.

        If `any_order` is False (the default) then the calls must be
        sequential. There can be extra calls before or after the
        specified calls.

        If `any_order` is True then the calls can be in any order, but
        they must all appear in `mock_calls`.csg|]}��|��qSr�r�r�cr�rrr��sz4NonCallableMock.assert_has_calls.<locals>.<listcomp>css|]}t|t�r|VqdSr/�r"r%rrrr�	<genexpr>�s
z3NonCallableMock.assert_has_calls.<locals>.<genexpr>Nc3s|]}��|�VqdSr/r*r+r�rrr.�szCalls not found.z+Error processing expected calls.
Errors: {}cSsg|]}t|t�r|nd�qSr/r-rrrrr��s��
Expected: ZActual)�prefixr�z@%r does not contain all of %r in its call list, found %r insteadr5)
r�rrrt�formatrr�rstriprY�remover<r�r�rZ)	rA�calls�	any_orderr&r(Z	all_calls�problem�	not_found�kallrr�rrp�sH
��"������z NonCallableMock.assert_has_callscsZ��||f�}�fdd��jD�}||krVt|t�r8|nd}��||�}td|�|�dS)z�assert the mock has been called with the specified arguments.

        The assert passes if the mock has *ever* been called, unlike
        `assert_called_with` and `assert_called_once_with` that only pass if
        the call is the most recent one.csg|]}��|��qSrr*r+r�rrr��sz3NonCallableMock.assert_any_call.<locals>.<listcomp>Nz%s call not found)rr|r"r%rr�rArBrCr&r'r(rrr�rrq�s��zNonCallableMock.assert_any_callcKs�|�d�}||jdkr"tf|�St|�}t|t�rB|tkrBt}nbt|t�rp|tksd|j	rj||j	krjt}q�t}n4t|t
�s�t|t�r�t}q�t|t�r�t
}n
|jd}|jr�d|kr�d|dnd}|��|}t|��|f|�S)aPCreate the child mocks for attributes and return value.
        By default child mocks will be the same type as the parent.
        Subclasses of Mock may want to override this to customize the way
        child mocks are made.

        For non-callable mocks the callable variant will be used (rather than
        any custom subclass).r�r�r�rr�r�)r^r]r	r1r0r�_async_method_magicsr��_all_sync_magicsr��
CallableMixinrrrr\r�r�r:)rAr�r��_type�klassrUrrrrr��s2


��



zNonCallableMock._get_child_mock�CallscCs"|js
dSd|�dt|j��d�S)z�Renders self.mock_calls as a string.

        Example: "
Calls: [call(1), call(2)]."

        If self.mock_calls is empty, an empty string is returned. The
        output will be truncated if very long.
        r��
z: r�)rtr)rAr0rrrrszNonCallableMock._calls_repr)NNNNNNr�NFNF)F)FF)N)r)F)r?)-rMrPr�rNr�r8r�r�r�Z"_NonCallableMock__get_return_valueZ"_NonCallableMock__set_return_valueZ"_NonCallableMock__return_value_docr�rvr�r�ryrzr{r|rtZ!_NonCallableMock__get_side_effectZ!_NonCallableMock__set_side_effectr}rur�r�r�r�rrrrrrrrmrlrnrjrorprqr�rrrrrr�sp�
-
	�

�

''
!


-'rcCsL|dkr|St|�r|St|�r$|Sz
t|�WStk
rF|YSXdSr/)r3rXr�rr(rrrr�s
r�c
@sReZdZddedddddddf
dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)r<Nr�c	Ks6||jd<tt|�j|||||||	|
f|�||_dS)Nr�)r]r�r<r8r})rAr�r}rvrrr�r�r�r�r�rCrrrr8#s

��zCallableMixin.__init__cOsdSr/rr@rrrrH/szCallableMixin._mock_check_sigcOs$|j||�|j||�|j||�Sr/)rH�_increment_mock_call�
_mock_callr@rrrr94szCallableMixin.__call__cOs|j||�Sr/)�_execute_mock_callr@rrrrB<szCallableMixin._mock_callcOsd|_|jd7_t||fdd�}||_|j�|�|jdk	}|j}|j}|dk}|j	�td||f��|j
}|dk	r�|r�|j�t|||f��|jdk	}|r�|jd|}t|||f�}	|j	�|	�|jr�|r�d}
nd}
|jdk}|j|
|}|j
}qpdS)NTr���twor�r�r�)ryrz�_Callr{r|r�r�r�r�rtr�rs)rArBrCrZdo_method_callsZmethod_call_nameZmock_call_nameZ	is_a_callr�Zthis_mock_callr�rrrrA?s4


z"CallableMixin._increment_mock_callcOs||j}|dk	rPt|�r|�n(t|�s:t|�}t|�rD|�n
|||�}|tk	rP|S|jtk	r`|jS|jdk	rv|j||�S|jSr/)r}r3rXr�rr�rvr�)rArBrC�effectrfrrrrCms 


z CallableMixin._execute_mock_call)
rMrPr�rr8rHr9rBrArCrrrrr<!s�
.r<c@seZdZdZdS)ra�	
    Create a new `Mock` object. `Mock` takes several optional arguments
    that specify the behaviour of the Mock object:

    * `spec`: This can be either a list of strings or an existing object (a
      class or instance) that acts as the specification for the mock object. If
      you pass in an object then a list of strings is formed by calling dir on
      the object (excluding unsupported magic attributes and methods). Accessing
      any attribute not in this list will raise an `AttributeError`.

      If `spec` is an object (rather than a list of strings) then
      `mock.__class__` returns the class of the spec object. This allows mocks
      to pass `isinstance` tests.

    * `spec_set`: A stricter variant of `spec`. If used, attempting to *set*
      or get an attribute on the mock that isn't on the object passed as
      `spec_set` will raise an `AttributeError`.

    * `side_effect`: A function to be called whenever the Mock is called. See
      the `side_effect` attribute. Useful for raising exceptions or
      dynamically changing return values. The function is called with the same
      arguments as the mock, and unless it returns `DEFAULT`, the return
      value of this function is used as the return value.

      If `side_effect` is an iterable then each call to the mock will return
      the next value from the iterable. If any of the members of the iterable
      are exceptions they will be raised instead of returned.

    * `return_value`: The value returned when the mock is called. By default
      this is a new Mock (created on first access). See the
      `return_value` attribute.

    * `wraps`: Item for the mock object to wrap. If `wraps` is not None then
      calling the Mock will pass the call through to the wrapped object
      (returning the real result). Attribute access on the mock will return a
      Mock object that wraps the corresponding attribute of the wrapped object
      (so attempting to access an attribute that doesn't exist will raise an
      `AttributeError`).

      If the mock has an explicit `return_value` set then calls are not passed
      to the wrapped object and the `return_value` is returned instead.

    * `name`: If the mock has a name then it will be used in the repr of the
      mock. This can be useful for debugging. The name is propagated to child
      mocks.

    Mocks can also be called with arbitrary keyword arguments. These will be
    used to set attributes on the mock after it is created.
    N�rMrPr�rNrrrrr�srcCs8zt||�WStk
r2t|�t||�YSXdSr/)r$r:�
__import__)�thing�comp�import_pathrrr�_dot_lookup�s
rMcCsB|�d�}|�d�}t|�}|D]}|d|7}t|||�}q |S)Nr�rz.%s)r�r�rIrM)�targetZ
componentsrLrJrKrrr�	_importer�s

rOc@szeZdZdZgZdd�Zdd�Zdd�Zdd	�Ze	j
d
d��Zdd
�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�ZdS)�_patchNc

Csn|dk	r(|tk	rtd��|dk	r(td��||_||_||_||_||_||_d|_||_	||_
|	|_g|_dS)Nz,Cannot use 'new' and 'new_callable' togetherz1Cannot use 'autospec' and 'new_callable' togetherF)
rr<�getterrUr��new_callabler��createZ	has_localr��autospecrC�additional_patchers)
rArQrUr�r�rSr�rTrRrCrrrr8�s(��z_patch.__init__c
CsHt|j|j|j|j|j|j|j|j|j	�	}|j
|_
dd�|jD�|_|S)NcSsg|]}|���qSr)�copy)r�prrrr��sz_patch.copy.<locals>.<listcomp>)rPrQrUr�r�rSr�rTrRrC�attribute_namerU)rA�patcherrrrrV�s ��z_patch.copycCs2t|t�r|�|�St�|�r(|�|�S|�|�Sr/)r"r1�decorate_classr'r&�decorate_async_callable�decorate_callable�rAr-rrrr9�s




z_patch.__call__cCsNt|�D]@}|�tj�sqt||�}t|d�s0q|��}t||||��q|S�Nr9)r�rr�TEST_PREFIXr$r#rVrS)rAr>r��
attr_valuerYrrrrZs

z_patch.decorate_classc	csrg}t���\}|jD]8}|�|�}|jdk	r8|�|�q|jtkr|�|�q|t	|�7}||fVW5QRXdSr/)
�
contextlib�	ExitStack�	patchings�
enter_contextrX�updater�rr�rZ)rA�patchedrB�keywargs�
extra_args�
exit_stack�patchingr�rrr�decoration_helpers




z_patch.decoration_helpercs>t�d�r�j����St�����fdd����g�_�S)Nrcc
s4���||��\}}�||�W5QR�SQRXdSr/�rk�rBrgZnewargsZnewkeywargs�r-rfrArrrf(s�z)_patch.decorate_callable.<locals>.patched�r#rcr�rr]rrnrr\"s
z_patch.decorate_callablecs>t�d�r�j����St�����fdd����g�_�S)Nrcc
�s:���||��"\}}�||�IdHW5QR�SQRXdSr/rlrmrnrrrf9s�z/_patch.decorate_async_callable.<locals>.patchedror]rrnrr[3s
z_patch.decorate_async_callablec	Cs�|��}|j}t}d}z|j|}Wn$ttfk
rHt||t�}YnXd}|tkrft|t	�rfd|_
|j
s�|tkr�td||f��||fS)NFTz!%s does not have the attribute %r)rQrUrr]r:�KeyErrorr$�	_builtinsr"rrS)rArNrre�localrrr�get_originalDs 
�z_patch.get_originalcCs�|j|j|j}}}|j|j}}|j}|��|_|dkr@d}|dkrLd}|dkrXd}|dk	rp|dk	rptd��|dk	s�|dk	r�|dkr�td��|�	�\}}|t
k�r||dk�r|d}	|dkr�|}|dkr�|}d}n&|dk	r�|dkr�|}d}n|dkr�|}|dk	�s|dk	�r.|t
k�rtd��t|t��r.d}	|dk�rHt
|��rHt}
nt}
i}|dk	�r`|}
n^|dk	�st|dk	�r�|}|dk	�r�|}t|��r�d|k}
n
t|�}
t
|��r�t}
n
|
�r�t}
|dk	�r�||d	<|dk	�r�||d
<t|
t��rt|
t��r|j�r|j|d<|�|�|
f|�}|	�r�t|��r�|}|dk	�rB|}t|��sZt|��sZt}
|�d�|
f|dd
�|��|_nl|dk	�r�|t
k	�r�td��|t
k�r�td��t|�}|dk�r�|}t|f||jd�|��}n|�r�td��|}||_||_t� �|_!zrt"|j|j|�|j#dk	�rpi}|jt
k�r:|||j#<|j$D](}|j!�%|�}|jt
k�r@|�|��q@|WS|WS|j&t'�(���s��YnXdS)zPerform the patch.FNzCan't specify spec and autospec)TNz6Can't provide explicit spec_set *and* spec or autospecTz!Can't use 'spec' with create=Truer9r�r�rr�r�zBautospec creates the mock for you. Can't specify autospec and new.z%Can't use 'autospec' with create=True)r��_namez.Can't pass kwargs to a mock we aren't creating))r�r�r�rTrCrRrQrNrrsrr"r1r*r	rr[r�rr0rrUrer!r`r�rv�boolr�
temp_original�is_localrarb�_exit_stackrSrXrUrd�__exit__�sys�exc_info)rAr�r�r�rTrCrRrerrZinherit�Klass�_kwargsZ	this_specZnot_callableZnew_attrrhrjr�rrr�	__enter__\s�
�








��




�
�


�

��


z_patch.__enter__cGs�|jr$|jtk	r$t|j|j|j�n>t|j|j�|jsbt|j|j�rP|jdkrbt|j|j|j�|`|`|`|j	}|`	|j
|�S)zUndo the patch.)rNrPrQ�__annotations__rR)rwrvrrSrNrUrrSr#rxry)rAr{rirrrry�s�z_patch.__exit__cCs|��}|j�|�|S)z-Activate a patch, returning any created mock.)r~�_active_patchesr�)rArfrrr�start�sz_patch.startcCs6z|j�|�Wntk
r&YdSX|�ddd�S)zStop an active patch.N)r�r3r<ryr�rrr�stop�s
z_patch.stop)rMrPr�rXr�r8rVr9rZra�contextmanagerrkr\r[rsr~ryr�r�rrrrrP�s 

rPc	sPz��dd�\�}Wn&ttfk
r:td�f��YnX�fdd�}||fS)Nr�r�z.Need a valid target to patch. You supplied: %rcst��Sr/�rOr�rNrrr�r�z_get_target.<locals>.<lambda>)�rsplitrr<)rNrUrQrr�r�_get_target
s�r�c

s>t��tkrt��d����fdd�}	t|	||||||||�	S)a
    patch the named member (`attribute`) on an object (`target`) with a mock
    object.

    `patch.object` can be used as a decorator, class decorator or a context
    manager. Arguments `new`, `spec`, `create`, `spec_set`,
    `autospec` and `new_callable` have the same meaning as for `patch`. Like
    `patch`, `patch.object` takes arbitrary keyword arguments for configuring
    the mock object it creates.

    When used as a class decorator `patch.object` honours `patch.TEST_PREFIX`
    for choosing which methods to wrap.
    z3 must be the actual object to be patched, not a strcs�Sr/rrr�rrr�*r�z_patch_object.<locals>.<lambda>)r1�strrrP)
rNrUr�r�rSr�rTrRrCrQrr�r�
_patch_objects ��r�c
s�t��tkr�fdd�}n�fdd�}|s2td��t|���}|d\}	}
t||	|
|||||i�	}|	|_|dd�D]2\}	}
t||	|
|||||i�	}|	|_|j�|�qt|S)a�Perform multiple patches in a single call. It takes the object to be
    patched (either as an object or a string to fetch the object by importing)
    and keyword arguments for the patches::

        with patch.multiple(settings, FIRST_PATCH='one', SECOND_PATCH='two'):
            ...

    Use `DEFAULT` as the value if you want `patch.multiple` to create
    mocks for you. In this case the created mocks are passed into a decorated
    function by keyword, and a dictionary is returned when `patch.multiple` is
    used as a context manager.

    `patch.multiple` can be used as a decorator, class decorator or a context
    manager. The arguments `spec`, `spec_set`, `create`,
    `autospec` and `new_callable` have the same meaning as for `patch`. These
    arguments will be applied to *all* patches done by `patch.multiple`.

    When used as a class decorator `patch.multiple` honours `patch.TEST_PREFIX`
    for choosing which methods to wrap.
    cst��Sr/r�rr�rrr�Hr�z!_patch_multiple.<locals>.<lambda>cs�Sr/rrr�rrr�Jr�z=Must supply at least one keyword argument with patch.multiplerr�N)	r1r�r<rYr�rPrXrUr�)
rNr�rSr�rTrRrCrQr�rUr�rYZthis_patcherrr�r�_patch_multiple1sH���r�c

Ks$t|�\}}	t||	|||||||�	S)a7
    `patch` acts as a function decorator, class decorator or a context
    manager. Inside the body of the function or with statement, the `target`
    is patched with a `new` object. When the function/with statement exits
    the patch is undone.

    If `new` is omitted, then the target is replaced with an
    `AsyncMock if the patched object is an async function or a
    `MagicMock` otherwise. If `patch` is used as a decorator and `new` is
    omitted, the created mock is passed in as an extra argument to the
    decorated function. If `patch` is used as a context manager the created
    mock is returned by the context manager.

    `target` should be a string in the form `'package.module.ClassName'`. The
    `target` is imported and the specified object replaced with the `new`
    object, so the `target` must be importable from the environment you are
    calling `patch` from. The target is imported when the decorated function
    is executed, not at decoration time.

    The `spec` and `spec_set` keyword arguments are passed to the `MagicMock`
    if patch is creating one for you.

    In addition you can pass `spec=True` or `spec_set=True`, which causes
    patch to pass in the object being mocked as the spec/spec_set object.

    `new_callable` allows you to specify a different class, or callable object,
    that will be called to create the `new` object. By default `AsyncMock` is
    used for async functions and `MagicMock` for the rest.

    A more powerful form of `spec` is `autospec`. If you set `autospec=True`
    then the mock will be created with a spec from the object being replaced.
    All attributes of the mock will also have the spec of the corresponding
    attribute of the object being replaced. Methods and functions being
    mocked will have their arguments checked and will raise a `TypeError` if
    they are called with the wrong signature. For mocks replacing a class,
    their return value (the 'instance') will have the same spec as the class.

    Instead of `autospec=True` you can pass `autospec=some_object` to use an
    arbitrary object as the spec instead of the one being replaced.

    By default `patch` will fail to replace attributes that don't exist. If
    you pass in `create=True`, and the attribute doesn't exist, patch will
    create the attribute for you when the patched function is called, and
    delete it again afterwards. This is useful for writing tests against
    attributes that your production code creates at runtime. It is off by
    default because it can be dangerous. With it switched on you can write
    passing tests against APIs that don't actually exist!

    Patch can be used as a `TestCase` class decorator. It works by
    decorating each test method in the class. This reduces the boilerplate
    code when your test methods share a common patchings set. `patch` finds
    tests by looking for method names that start with `patch.TEST_PREFIX`.
    By default this is `test`, which matches the way `unittest` finds tests.
    You can specify an alternative prefix by setting `patch.TEST_PREFIX`.

    Patch can be used as a context manager, with the with statement. Here the
    patching applies to the indented block after the with statement. If you
    use "as" then the patched object will be bound to the name after the
    "as"; very useful if `patch` is creating a mock object for you.

    `patch` takes arbitrary keyword arguments. These will be passed to
    the `Mock` (or `new_callable`) on construction.

    `patch.dict(...)`, `patch.multiple(...)` and `patch.object(...)` are
    available for alternate use-cases.
    )r�rP)
rNr�r�rSr�rTrRrCrQrUrrrrbsF�rc@sReZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
eZe
ZdS)�_patch_dicta#
    Patch a dictionary, or dictionary like object, and restore the dictionary
    to its original state after the test.

    `in_dict` can be a dictionary or a mapping like container. If it is a
    mapping then it must at least support getting, setting and deleting items
    plus iterating over keys.

    `in_dict` can also be a string specifying the name of the dictionary, which
    will then be fetched by importing it.

    `values` can be a dictionary of values to set in the dictionary. `values`
    can also be an iterable of `(key, value)` pairs.

    If `clear` is True then the dictionary will be cleared before the new
    values are set.

    `patch.dict` can also be called with arbitrary keyword arguments to set
    values in the dictionary::

        with patch.dict('sys.modules', mymodule=Mock(), other_module=Mock()):
            ...

    `patch.dict` can be used as a context manager, decorator or class
    decorator. When used as a class decorator `patch.dict` honours
    `patch.TEST_PREFIX` for choosing which methods to wrap.
    rFcKs,||_t|�|_|j�|�||_d|_dSr/)�in_dict�dictr�re�clear�	_original)rAr�r�r�rCrrrr8�s

z_patch_dict.__init__cs.t�t�r����St����fdd��}|S)Ncs&���z�||�W�S���XdSr/)r��
_unpatch_dictr��frArr�_inner�sz$_patch_dict.__call__.<locals>._inner)r"r1rZr)rAr�r�rr�rr9�s


z_patch_dict.__call__cCsXt|�D]J}t||�}|�tj�rt|d�rt|j|j|j	�}||�}t
|||�q|Sr^)r�r$rrr_r#r�r�r�r�rS)rAr>r�r`Z	decoratorZ	decoratedrrrrZ�s
�z_patch_dict.decorate_classcCs|��|jS)zPatch the dict.)r�r�r�rrrr~�sz_patch_dict.__enter__cCs�|j}t|jt�rt|j�|_|j}|j}z|��}Wn.tk
rdi}|D]}||||<qNYnX||_|rxt	|�z|�
|�Wn*tk
r�|D]}||||<q�YnXdSr/)r�r"r�r�rOr�rVr:r��_clear_dictre)rAr�r�r�rer�rrrr��s&z_patch_dict._patch_dictcCsR|j}|j}t|�z|�|�Wn*tk
rL|D]}||||<q6YnXdSr/)r�r�r�rer:)rAr�rer�rrrr�sz_patch_dict._unpatch_dictcGs|��dS)zUnpatch the dict.F)r�)rArBrrrrysz_patch_dict.__exit__N)rF)
rMrPr�rNr8r9rZr~r�r�ryr�r�rrrrr��s
	
r�cCs>z|��Wn,tk
r8t|�}|D]
}||=q(YnXdSr/)r�r:rY)r�r�r�rrrr�&sr�cCsttj�D]}|��q
dS)z7Stop all active patches. LIFO to unroll nested patches.N)r�rPr�r�)rrrr�_patch_stopall/sr�Ztestz�lt le gt ge eq ne getitem setitem delitem len contains iter hash str sizeof enter exit divmod rdivmod neg pos abs invert complex int float index round trunc floor ceil bool next fspath aiter zHadd sub mul matmul div floordiv mod lshift rshift and xor or pow truediv� ccs|]}d|VqdS)zi%sNr�r�nrrrr.Nsr.ccs|]}d|VqdS)zr%sNrr�rrrr.Os�__get__�__set__�
__delete__�__reversed__�__missing__r��
__reduce_ex__Z__getinitargs__�__getnewargs__�__getstate__�__setstate__�
__getformat__Z
__setformat__r�r�__subclasses__�
__format__�__getnewargs_ex__cs�fdd�}||_|S)z:Turns a callable object (like a mock) into a real functioncs�|f|�|�Sr/r�rArBr�r,rr�method`sz_get_method.<locals>.method)rM)rr-r�rr,rr	^sr	cCsh|]}d|�qS)r�r)rr�rrrrfs�
__aenter__�	__aexit__�	__anext__�	__aiter__r�rr8r��__prepare__�__instancecheck__�__subclasscheck__�__del__cCs
t�|�Sr/)r�__hash__r�rrrr�|r�r�cCs
t�|�Sr/)r�__str__r�rrrr�}r�cCs
t�|�Sr/)r�
__sizeof__r�rrrr�~r�cCs"t|�j�d|���dt|���S)N�/)r1rMr�r�r�rrrr�r�)r�r�r��
__fspath__r�y�?g�?)
�__lt__�__gt__�__le__�__ge__�__int__r��__len__ry�__complex__�	__float__�__bool__�	__index__r�cs�fdd�}|S)Ncs$�jj}|tk	r|S�|kr dStS�NT)�__eq__r�r�NotImplemented)�other�ret_valr�rrr��sz_get_eq.<locals>.__eq__r)rAr�rr�r�_get_eq�sr�cs�fdd�}|S)Ncs �jjtk	rtS�|krdStS�NF)�__ne__r�rr�)r�r�rrr��s
z_get_ne.<locals>.__ne__r)rAr�rr�r�_get_ne�sr�cs�fdd�}|S)Ncs �jj}|tkrtg�St|�Sr/)�__iter__r�rr��r�r�rrr��sz_get_iter.<locals>.__iter__r)rAr�rr�r�	_get_iter�sr�cs�fdd�}|S)Ncs(�jj}|tkrttg��Stt|��Sr/)r�r�r�_AsyncIteratorr�r�r�rrr��sz"_get_async_iter.<locals>.__aiter__r)rAr�rr�r�_get_async_iter�sr�)r�r�r�r�cCsbt�|t�}|tk	r||_dSt�|�}|dk	rB||�}||_dSt�|�}|dk	r^||�|_dSr/)�_return_valuesr^rrv�_calculate_return_value�_side_effect_methodsr})r5r�rZfixedZreturn_calculatorrvZ
side_effectorrrr�_set_return_value�s

r�c@seZdZdd�Zdd�ZdS)�
MagicMixincOs&|��tt|�j||�|��dSr/)�_mock_set_magicsr�r�r8r�rrrr8�szMagicMixin.__init__cCs�ttB}|}t|dd�dk	rX|�|j�}t�}||}|D]}|t|�jkr:t||�q:|tt|�j�}t|�}|D]}t	||t
||��qvdS)Nr�)�_magicsr:r$�intersectionr�rr1r]rrS�
MagicProxy)rAZorig_magicsZthese_magicsZ
remove_magicsr�r=rrrr��szMagicMixin._mock_set_magicsN)rMrPr�r8r�rrrrr��sr�c@seZdZdZddd�ZdS)rz-A version of `MagicMock` that isn't callable.FcCs|�||�|��dSr��r�r�r�rrrr��sz"NonCallableMagicMock.mock_add_specN)F�rMrPr�rNr�rrrrr�src@seZdZdd�ZdS)�AsyncMagicMixincOs&|��tt|�j||�|��dSr/)r�r�r�r8r�rrrr8�szAsyncMagicMixin.__init__N�rMrPr�r8rrrrr��sr�c@seZdZdZddd�ZdS)ra�
    MagicMock is a subclass of Mock with default implementations
    of most of the magic methods. You can use MagicMock without having to
    configure the magic methods yourself.

    If you use the `spec` or `spec_set` arguments then *only* magic
    methods that exist in the spec will be created.

    Attributes and the return value of a `MagicMock` will also be `MagicMocks`.
    FcCs|�||�|��dSr�r�r�rrrr�szMagicMock.mock_add_specN)Fr�rrrrrs
rc@s&eZdZdd�Zdd�Zddd�ZdS)	r�cCs||_||_dSr/�rr�)rArr�rrrr8szMagicProxy.__init__cCs8|j}|j}|j|||d�}t|||�t|||�|S)N)rr�r�)rr�r�rSr�)rAr�r��mrrr�create_mocks�zMagicProxy.create_mockNcCs|��Sr/)r�)rAr)r=rrrr�(szMagicProxy.__get__)N)rMrPr�r8r�r�rrrrr�s	r�cs�eZdZed�Zed�Zed�Z�fdd�Zdd�Zdd	�Z	d
d�Z
dd
�Zdd�Zdd�Z
ddd�Zdd�Z�fdd�Z�ZS)r�r�r�r�cs\t�j||�tjj|jd<d|jd<d|jd<t�|jd<ttd�}t	j
|_||jd<dS)Nr�rZ_mock_await_countZ_mock_await_argsZ_mock_await_args_list�r�r+)�superr8r%r�r�r]rrrrr'ZCO_COROUTINE�co_flags)rArBrC�	code_mock�r�rrr81s


zAsyncMockMixin.__init__c�st||fdd�}|jd7_||_|j�|�|j}|dk	r�t|�rL|�nbt|�s�zt|�}Wnt	k
rxt
�YnXt|�r�|�n&t�|�r�|||�IdH}n
|||�}|t
k	r�|S|jt
k	r�|jS|jdk	r�t�|j�r�|j||�IdHS|j||�S|jS)NTrDr�)rFr�r�r�r�r}r3rXr��
StopIteration�StopAsyncIterationr%r&rr�rvr�)rArBrCrrGrfrrrrCAs6




z!AsyncMockMixin._execute_mock_callcCs(|jdkr$d|jpd�d�}t|��dS)zA
        Assert that the mock was awaited at least once.
        r�	Expected r5z to have been awaited.N�r�r�rr rrrr�is
zAsyncMockMixin.assert_awaitedcCs0|jdks,d|jpd�d|j�d�}t|��dS)z@
        Assert that the mock was awaited exactly once.
        r�r�r5�$ to have been awaited once. Awaited � times.Nr�r rrrr�qs
z"AsyncMockMixin.assert_awaited_oncecsz�jdkr&�����}td|�d������fdd�}����f�}���j�}||krvt|t�rf|nd}t|��|�dS)zN
        Assert that the last await was with the specified arguments.
        NzExpected await: z
Not awaitedcs�j��dd�}|S)N�await)rr!r"r#rrr$�sz:AsyncMockMixin.assert_awaited_with.<locals>._error_message)r�rrrr"r%)rArBrCr&r$r'r(rr#rr�zs
z"AsyncMockMixin.assert_awaited_withcOs8|jdks,d|jpd�d|j�d�}t|��|j||�S)zi
        Assert that the mock was awaited exactly once and with the specified
        arguments.
        r�r�r5r�r�)r�r�rr�r)rrrr��s
z'AsyncMockMixin.assert_awaited_once_withcsZ��||f�}�fdd��jD�}||krVt|t�r8|nd}��||�}td|�|�dS)zU
        Assert the mock has ever been awaited with the specified arguments.
        csg|]}��|��qSrr*r+r�rrr��sz3AsyncMockMixin.assert_any_await.<locals>.<listcomp>Nz%s await not found)rr�r"r%rrr9rr�rr��s��zAsyncMockMixin.assert_any_awaitFc		s��fdd�|D�}tdd�|D�d�}t�fdd��jD��}|s�||kr�|dkrXd}nd�d	d�|D��}t|�d
t|��d�j���|�dSt|�}g}|D]2}z|�|�Wq�tk
r�|�|�Yq�Xq�|r�tdt	|�f�|�dS)
a�
        Assert the mock has been awaited with the specified calls.
        The :attr:`await_args_list` list is checked for the awaits.

        If `any_order` is False (the default) then the awaits must be
        sequential. There can be extra calls before or after the
        specified awaits.

        If `any_order` is True then the awaits can be in any order, but
        they must all appear in :attr:`await_args_list`.
        csg|]}��|��qSrr*r+r�rrr��sz4AsyncMockMixin.assert_has_awaits.<locals>.<listcomp>css|]}t|t�r|VqdSr/r-rrrrr.�s
z3AsyncMockMixin.assert_has_awaits.<locals>.<genexpr>Nc3s|]}��|�VqdSr/r*r+r�rrr.�szAwaits not found.z,Error processing expected awaits.
Errors: {}cSsg|]}t|t�r|nd�qSr/r-rrrrr��s�r/z	
Actual: z%r not all found in await list)
r�rrr�r1rrYr3r<r�rZ)	rAr4r5r&r(Z
all_awaitsr6r7r8rr�rr��s>������z AsyncMockMixin.assert_has_awaitscCs0|jdkr,d|jpd�d|j�d�}t|��dS)z9
        Assert that the mock was never awaited.
        rr�r5z# to not have been awaited. Awaited r�Nr�r rrrr��s
z!AsyncMockMixin.assert_not_awaitedcs&t�j||�d|_d|_t�|_dS)z0
        See :func:`.Mock.reset_mock()`
        rN)r�rur�r�rrr�r@r�rrru�szAsyncMockMixin.reset_mock)F)rMrPr�r�r�r�r�r8rCr�r�r�r�r�r�r�ru�
__classcell__rrr�rr�,s(	
,	r�c@seZdZdZdS)r	aa
    Enhance :class:`Mock` with features allowing to mock
    an async function.

    The :class:`AsyncMock` object will behave so the object is
    recognized as an async function, and the result of a call is an awaitable:

    >>> mock = AsyncMock()
    >>> asyncio.iscoroutinefunction(mock)
    True
    >>> inspect.isawaitable(mock())
    True


    The result of ``mock()`` is an async function which will have the outcome
    of ``side_effect`` or ``return_value``:

    - if ``side_effect`` is a function, the async function will return the
      result of that function,
    - if ``side_effect`` is an exception, the async function will raise the
      exception,
    - if ``side_effect`` is an iterable, the async function will return the
      next value of the iterable, however, if the sequence of result is
      exhausted, ``StopIteration`` is raised immediately,
    - if ``side_effect`` is not defined, the async function will return the
      value defined by ``return_value``, hence, by default, the async function
      returns a new :class:`AsyncMock` object.

    If the outcome of ``side_effect`` or ``return_value`` is an async function,
    the mock async function obtained when the mock object is called will be this
    async function itself (and not an async function returning an async
    function).

    The test author can also specify a wrapped object with ``wraps``. In this
    case, the :class:`Mock` object behavior is the same as with an
    :class:`.Mock` object: the wrapped object may have methods
    defined as async function functions.

    Based on Martin Richard's asynctest project.
    NrHrrrrr	�sr	c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_ANYz2A helper object that compares equal to everything.cCsdSr�r�rAr�rrrr�	sz_ANY.__eq__cCsdSr�rr�rrrr�	sz_ANY.__ne__cCsdS)Nz<ANY>rr�rrrr�	sz
_ANY.__repr__N)rMrPr�rNr�r�r�rrrrr�	sr�cCs`d|}d}d�dd�|D��}d�dd�|��D��}|r@|}|rX|rP|d7}||7}||S)Nz%s(%%s)r�z, cSsg|]}t|��qSr)�reprr�rrrr�!	sz*_format_call_signature.<locals>.<listcomp>cSsg|]\}}d||f�qS)z%s=%rr)rr�r�rrrr�"	s)r�r�)rrBrCrZformatted_argsZargs_stringZ
kwargs_stringrrrr	s
�rc@s�eZdZdZd!dd�Zd"d	d
�Zdd�ZejZd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zedd��Zedd��Zdd�Zdd �ZdS)#rFa�
    A tuple for holding the results of a call to a mock, either in the form
    `(args, kwargs)` or `(name, args, kwargs)`.

    If args or kwargs are empty then a call tuple will compare equal to
    a tuple without those values. This makes comparisons less verbose::

        _Call(('name', (), {})) == ('name',)
        _Call(('name', (1,), {})) == ('name', (1,))
        _Call(((), {'a': 'b'})) == ({'a': 'b'},)

    The `_Call` object provides a useful shortcut for comparing with call::

        _Call(((1, 2), {'a': 3})) == call(1, 2, a=3)
        _Call(('foo', (1, 2), {'a': 3})) == call.foo(1, 2, a=3)

    If the _Call has no name then it will match any name.
    rr�NFTcCs�d}i}t|�}|dkr$|\}}}nr|dkrd|\}	}
t|	t�rX|	}t|
t�rR|
}qb|
}q�|	|
}}n2|dkr�|\}t|t�r�|}nt|t�r�|}n|}|r�t�|||f�St�||||f�S)Nr�r�r�)r�r"r�rZr�)r�r�rr�rE�	from_kallrBrC�_len�first�secondrrrr�C	s.



z
_Call.__new__cCs||_||_||_dSr/)r�r��_mock_from_kall)rAr�rr�rEr�rrrr8c	sz_Call.__init__cCsh|tkrdSzt|�}Wntk
r.YdSXd}t|�dkrJ|\}}n
|\}}}t|dd�r|t|dd�r||j|jkr|dSd}|dkr�di}}n�|dkr�|\}}}n�|d	kr�|\}	t|	t�r�|	}i}n"t|	t�r�|	}di}}nd}|	}nV|dk�r@|\}
}t|
t��r4|
}t|t��r(|i}}n
d|}}n
|
|}}ndS|�rX||k�rXdS||f||fkS)
NTFr�r�r�rrr�r�)rr�rr$r�r"rZr�)rAr�Z	len_otherZ	self_nameZ	self_argsZself_kwargsZ
other_nameZ
other_argsZother_kwargsr�r�r�rrrr�j	sR


�


z_Call.__eq__cOs<|jdkrtd||fdd�S|jd}t|j||f||d�S)Nr�r�r�r��r�rFrrrrr9�	s

z_Call.__call__cCs2|jdkrt|dd�Sd|j|f}t||dd�S)NF)rr�z%s.%s)rr�r�r�)rAr�rrrrr��	s
z_Call.__getattr__cCs|tjkrt�t�||�Sr/)rZr]r:�__getattribute__)rAr�rrrr��	s
z_Call.__getattribute__cOs|�d�||�S)Nr��r�r@rrrr��	sz_Call.countcOs|�d�||�S)N�indexr�r@rrrr��	sz_Call.indexcCs(t|�dkr|\}}n
|\}}}||fS)Nr�)r�rrrr�_get_call_arguments�	s

z_Call._get_call_argumentscCs|��dS�Nr�r�r�rrrrB�	sz
_Call.argscCs|��dS)Nr�r�r�rrrrC�	sz_Call.kwargscCs||js&|jpd}|�d�r"d|}|St|�dkr@d}|\}}n0|\}}}|sTd}n|�d�shd|}nd|}t|||�S)Nrr�zcall%sr�zcall.%s)r�r�rr�r)rArrBrCrrrr��	s





z_Call.__repr__cCs4g}|}|dk	r(|jr |�|�|j}qtt|��S)z�For a call object that represents multiple calls, `call_list`
        returns a list of all the intermediate calls as well as the
        final call.N)r�r�r�rrr�)rAZvalsrJrrr�	call_list�	s
z_Call.call_list)rr�NFT)rNNFT)rMrPr�rNr�r8r�rr�r9r�r�r�r�r�r�rBrCr�r�rrrrrF0	s*�
 �
7

rF)r�c	Kslt|�rt|�}t|t�}t|�}d|i}|r8d|i}n|dkrDi}|rT|rTd|d<|�|�t}	t�|�rri}n8|r�|r�td��t	}	n"t
|�s�t}	n|r�|r�t|�s�t}	|�
d|�}|}
|dkr�d}
|	f|||
|d	�|��}t|t��rt||�}|�rt|�nt||||�|dk	�r,|�s,||j|<|�rV|�sVd
|k�rVt||dd|d�|_t|�D�]}t|��rr�q^zt||�}
Wntk
�r�Y�q^YnXd|
i}|�r�d|
i}t|
t��s�t|
||||�}||j|<np|}t|t��r�|j}t|||�}||d
<t�|
��rt	}nt}|f||||d�|��}||j|<t|
||d�t|t��r^t|||��q^|S)aICreate a mock object using another object as a spec. Attributes on the
    mock will use the corresponding attribute on the `spec` object as their
    spec.

    Functions or methods being mocked will have their arguments checked
    to check that they are called with the correct signature.

    If `spec_set` is True then attempting to set attributes that don't exist
    on the spec object will raise an `AttributeError`.

    If a class is used as a spec then the return value of the mock (the
    instance of the class) will have the same spec. You can use a class as the
    spec for an instance object by passing `instance=True`. The returned mock
    will only be callable if instances of the mock are callable.

    `create_autospec` also takes arbitrary keyword arguments that are passed to
    the constructor of the created mock.r�r�NTr�zJInstance can not be True when create_autospec is mocking an async functionrr�)r�r�r�rrvr�)rKrtr�r�)r�rr�r�)rJ)r[r1r"r.rerr'Zisdatadescriptor�RuntimeErrorr	rXrr`r�r6rir�rLr~rrvr�r�r$r:r�r5�
_must_skipr%r&rS)r�r�rKr�rtrC�is_typeZ
is_async_funcr}r|r�r5r�rer�r�rJZchild_klassrrrr�	s�




��


�

��
rcCsxt|t�s$|t|di�krdS|j}|jD]H}|j�|t�}|tkrFq*t|tt	f�rZdSt|t
�rl|SdSq*|S)z[
    Return whether we should skip the first argument on spec's `entry`
    attribute.
    r]F)r"r1r$r�r\r]r^rrVrWr6)r�r�r�r>rfrrrr�w
s


r�c@seZdZddd�ZdS)r�FNcCs(||_||_||_||_||_||_dSr/)r��idsr�r�rKr)rAr�r�r�rr�rKrrrr8�
sz_SpecState.__init__)FNNNFr�rrrrr��
s
�r�cCs"t|t�rt�|�St�|�SdSr/)r"�bytes�io�BytesIO�StringIO)�	read_datarrr�
_to_stream�
s

rr�cs&t��}|dg���fdd�}��fdd�}��fdd����fdd	����fd
d�}tdkr�ddl}ttt|j���tt|j����a|dkr�t	d
t
d�}t	td����j_d�j
_d�j_d�j_d�j_|�j_���d<�d�j_|�j_��j_|�j_����fdd�}||_�|_|S)a�
    A helper function to create a mock to replace the use of `open`. It works
    for `open` called directly or used as a context manager.

    The `mock` argument is the mock object to configure. If `None` (the
    default) then a `MagicMock` will be created for you, with the API limited
    to methods or attributes available on standard file handles.

    `read_data` is a string for the `read`, `readline` and `readlines` of the
    file handle to return.  This is an empty string by default.
    Ncs$�jjdk	r�jjS�dj||�Sr�)�	readlinesrvra��_state�handlerr�_readlines_side_effect�
sz)mock_open.<locals>._readlines_side_effectcs$�jjdk	r�jjS�dj||�Sr�)�readrvrarrr�_read_side_effect�
sz$mock_open.<locals>._read_side_effectc?s$��EdH�dj||�VqdSr�)�readlinera)�_iter_side_effectrrr�_readline_side_effect�
sz(mock_open.<locals>._readline_side_effectc3s0�jjdk	r�jjVq�dD]
}|Vq dSr�)rrv)�linerrrr
�
sz$mock_open.<locals>._iter_side_effectcs �jjdk	r�jjSt�d�Sr�)rrvr�rrrr�_next_side_effect�
sz$mock_open.<locals>._next_side_effectr�open)rr�r�r�cs6t���d<�jj�dkr2���d<�d�j_tS)Nrr�)rrr}rra)rrrrrr�
reset_data�
s

zmock_open.<locals>.reset_data)r�	file_spec�_iorYrr��
TextIOWrapper�unionrrrr~rv�writer
rrr}r�r�)r5rZ
_read_datar	rrrrr)r
rrrrrr
�
s8"

r
c@s*eZdZdZdd�Zd	dd�Zdd�ZdS)
raW
    A mock intended to be used as a property, or other descriptor, on a class.
    `PropertyMock` provides `__get__` and `__set__` methods so you can specify
    a return value when it is fetched.

    Fetching a `PropertyMock` instance from an object calls the mock, with
    no args. Setting it calls the mock with the value being set.
    cKs
tf|�Sr/)r)rArCrrrr�szPropertyMock._get_child_mockNcCs|�Sr/r)rAr)Zobj_typerrrr�szPropertyMock.__get__cCs||�dSr/r)rAr)r�rrrr�
szPropertyMock.__set__)N)rMrPr�rNr�r�r�rrrrr�
s
rc	Cs^d|_t|�D]J}zt||�}Wntk
r8YqYnXt|t�sFq|j|krt|�qdS)a�Disable the automatic generation of child mocks.

    Given an input Mock, seals it to ensure no further mocks will be generated
    when accessing an attribute that was not already defined.

    The operation recursively seals the mock passed in, meaning that
    the mock itself, any mocks generated by accessing one of its attributes,
    and all assigned mocks without a name or spec will be sealed.
    TN)r�r�r$r:r"rr�r)r5r�r�rrrrs



rc@s(eZdZdZdd�Zdd�Zdd�ZdS)	r�z8
    Wraps an iterator in an asynchronous iterator.
    cCs&||_ttd�}tj|_||jd<dS)Nr�r+)�iteratorrrr'ZCO_ITERABLE_COROUTINEr�r])rArr�rrrr8+s
z_AsyncIterator.__init__cCs|Sr/rr�rrrr�1sz_AsyncIterator.__aiter__c�s*zt|j�WStk
r YnXt�dSr/)r�rr�r�r�rrrr�4s
z_AsyncIterator.__anext__N)rMrPr�rNr8r�r�rrrrr�'sr�)F)F)NFNNN)FFNN)Nr�)y�__all__�__version__r%rarr'r�rz�builtins�typesrrrZ
unittest.utilr�	functoolsrrr�rqr
r�r�r*r.r!r3r7r=rLrGrXr[r`rirdr�r�rr�r�rr�MISSINGr
ZDELETEDr�r�r�rYrrr�r�r�rr�r<rrMrOrPr�r�r�rr�r�r�r�ZmultipleZstopallr_Z
magic_methodsZnumericsr�r�Zinplace�rightZ
_non_defaultsr	r�r:Z_sync_async_magicsZ
_async_magicsr;r�rr�r�r�r�r�r�r�r�r�r�rr�rr�r�r	r�rrrZrFrrr�r�r1r�r6rrr
rrr�rrrr�<module>s~	



1�	h4<�
�
2�
Mw	���	�
���
	
	�	8+B
�
�
Nunittest/__pycache__/result.cpython-38.opt-1.pyc000064400000016175151153537550015564 0ustar00U

e5d�@s\dZddlZddlZddlZddlmZddlmZdZdd�Z	d	Z
d
ZGdd�de�Z
dS)
zTest result object�N�)�util��wrapsTcst���fdd��}|S)Ncs$t|dd�r|���|f|�|�S)N�failfastF)�getattr�stop)�self�args�kw��method��'/usr/lib64/python3.8/unittest/result.py�inner
szfailfast.<locals>.innerr)r
rrrrrsrz
Stdout:
%sz
Stderr:
%sc@s�eZdZdZdZdZdZd.dd�Zdd�Zdd	�Z	d
d�Z
dd
�Zdd�Zdd�Z
dd�Zedd��Zedd��Zdd�Zdd�Zdd�Zdd�Zed d!��Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�ZdS)/�
TestResulta�Holder for test result information.

    Test results are automatically managed by the TestCase and TestSuite
    classes, and do not need to be explicitly manipulated by writers of tests.

    Each instance holds the total number of tests run, and collections of
    failures and errors that occurred among those test runs. The collections
    contain tuples of (testcase, exceptioninfo), where exceptioninfo is the
    formatted traceback of the error that occurred.
    NFcCsbd|_g|_g|_d|_g|_g|_g|_d|_d|_d|_	d|_
d|_tj
|_tj|_d|_dS)NFr)r�failures�errors�testsRun�skipped�expectedFailures�unexpectedSuccesses�
shouldStop�buffer�	tb_locals�_stdout_buffer�_stderr_buffer�sys�stdout�_original_stdout�stderr�_original_stderr�
_mirrorOutput)r	�streamZdescriptions�	verbosityrrr�__init__&szTestResult.__init__cCsdS)z#Called by TestRunner after test runNr�r	rrr�printErrors7szTestResult.printErrorscCs |jd7_d|_|��dS)z-Called when the given test is about to be runrFN)rr"�_setupStdout�r	�testrrr�	startTest:szTestResult.startTestcCs8|jr4|jdkr$t��|_t��|_|jt_|jt_dS)N)rr�io�StringIOrrrr r&rrrr(@s


zTestResult._setupStdoutcCsdS)zpCalled once before any tests are executed.

        See startTest for a method called before each test.
        Nrr&rrr�startTestRunHszTestResult.startTestRuncCs|��d|_dS)z'Called when the given test has been runFN)�_restoreStdoutr"r)rrr�stopTestNszTestResult.stopTestcCs�|jr�|jrltj��}tj��}|rF|�d�s6|d7}|j�t	|�|rl|�d�s\|d7}|j
�t|�|jt_|j
t_|j�
d�|j��|j�
d�|j��dS)N�
r)rr"rr�getvaluer �endswithr�write�STDOUT_LINEr!�STDERR_LINEr�seek�truncater)r	�output�errorrrrr/Ss$




zTestResult._restoreStdoutcCsdS)zmCalled once after all tests are executed.

        See stopTest for a method called after each test.
        Nrr&rrr�stopTestRunhszTestResult.stopTestRuncCs"|j�||�||�f�d|_dS)zmCalled when an error has occurred. 'err' is a tuple of values as
        returned by sys.exc_info().
        TN)r�append�_exc_info_to_stringr"�r	r*�errrrr�addErrornszTestResult.addErrorcCs"|j�||�||�f�d|_dS)zdCalled when an error has occurred. 'err' is a tuple of values as
        returned by sys.exc_info().TN)rr<r=r"r>rrr�
addFailurevszTestResult.addFailurecCsZ|dk	rVt|dd�r|��t|d|j�r4|j}n|j}|�||�||�f�d|_dS)z�Called at the end of a subtest.
        'err' is None if the subtest ended successfully, otherwise it's a
        tuple of values as returned by sys.exc_info().
        NrFrT)	rr�
issubclass�failureExceptionrrr<r=r")r	r*Zsubtestr?rrrr�
addSubTest}szTestResult.addSubTestcCsdS)z-Called when a test has completed successfullyNrr)rrr�
addSuccess�szTestResult.addSuccesscCs|j�||f�dS)zCalled when a test is skipped.N)rr<)r	r*�reasonrrr�addSkip�szTestResult.addSkipcCs|j�||�||�f�dS)z/Called when an expected failure/error occurred.N)rr<r=r>rrr�addExpectedFailure�s�zTestResult.addExpectedFailurecCs|j�|�dS)z5Called when a test was expected to fail, but succeed.N)rr<r)rrr�addUnexpectedSuccess�szTestResult.addUnexpectedSuccesscCs>t|j�t|j�kodkno<t|d�p<t|j�dkS)z/Tells whether or not this result was a success.rr)�lenrr�hasattrrr&rrr�
wasSuccessful�s$�zTestResult.wasSuccessfulcCs
d|_dS)z+Indicates that the tests should be aborted.TN)rr&rrrr�szTestResult.stopcCs�|\}}}|r |�|�r |j}q
||jkr6|�|�}nd}tj|||||jd�}t|���}|j	r�t
j��}	t
j
��}
|	r�|	�d�s�|	d7}	|�t|	�|
r�|
�d�s�|
d7}
|�t|
�d�|�S)z>Converts a sys.exc_info()-style tuple of values into a string.N)�limit�capture_localsr1�)�_is_relevant_tb_level�tb_nextrC�_count_relevant_tb_levels�	traceback�TracebackExceptionr�list�formatrrrr2r r3r<r5r6�join)r	r?r*�exctype�value�tb�lengthZtb_eZmsgLinesr9r:rrrr=�s4

�



zTestResult._exc_info_to_stringcCsd|jjkS)N�
__unittest)�tb_frame�	f_globals)r	rZrrrrP�sz TestResult._is_relevant_tb_levelcCs&d}|r"|�|�s"|d7}|j}q|S)Nrr)rPrQ)r	rZr[rrrrR�s
z$TestResult._count_relevant_tb_levelscCs&dt�|j�|jt|j�t|j�fS)Nz!<%s run=%i errors=%i failures=%i>)rZstrclass�	__class__rrJrrr&rrr�__repr__�s
��zTestResult.__repr__)NNN)�__name__�
__module__�__qualname__�__doc__Z_previousTestClassZ_testRunEnteredZ_moduleSetUpFailedr%r'r+r(r.r0r/r;rr@rArDrErGrHrIrLrr=rPrRr`rrrrrs8




	r)rdr,rrSrOr�	functoolsrr\rr5r6�objectrrrrr�<module>sunittest/__pycache__/main.cpython-38.pyc000064400000016560151153537550014231 0ustar00U

e5d�+�@stdZddlZddlZddlZddlmZmZddlmZdZ	dZ
dZd	d
�Zdd�Z
d
d�ZGdd�de�ZeZdS)zUnittest main program�N�)�loader�runner)�installHandlerTaExamples:
  %(prog)s test_module               - run tests from test_module
  %(prog)s module.TestClass          - run tests from module.TestClass
  %(prog)s module.Class.test_method  - run specified test method
  %(prog)s path/to/test_file.py      - run tests from test_file.py
aFExamples:
  %(prog)s                           - run default set of tests
  %(prog)s MyTestSuite               - run suite 'MyTestSuite'
  %(prog)s MyTestCase.testSomething  - run MyTestCase.testSomething
  %(prog)s MyTestCase                - run all 'test*' test methods
                                       in MyTestCase
cCsxtj�|�rt|���d�rttj�|�rXtj�|t���}tj�|�sP|�tj	�rT|S|}|dd��
dd��
dd�S|S)Nz.py����\�.�/)�os�path�isfile�lower�endswith�isabs�relpath�getcwd�
startswith�pardir�replace)�nameZrel_path�r�%/usr/lib64/python3.8/unittest/main.py�
_convert_namesrcCsdd�|D�S)NcSsg|]}t|��qSr)r)�.0rrrr�
<listcomp>.sz"_convert_names.<locals>.<listcomp>r)�namesrrr�_convert_names-srcCsd|krd|}|S)N�*z*%s*r)�patternrrr�_convert_select_pattern1src@s�eZdZdZdZdZdZZZZ	Z
ZdZdddde
jddddddfdd�dd	�Zdd
d�Zdd
�Zdd�Zddd�Zdd�Zdd�Zdd�Zdd�Zd dd�Zdd�ZdS)!�TestProgramzA command-line program that runs a set of tests; this is primarily
       for making test modules conveniently executable.
    Nr�__main__TF)�	tb_localscCs�t|t�r<t|�|_|�d�dd�D]}
t|j|
�|_q&n||_|dkrPtj}||_||_	|	|_
||_|
|_||_
|dkr�tjs�d|_n||_||_||_||_tj�|d�|_|�|�|��dS)Nrr�defaultr)�
isinstance�str�
__import__�module�split�getattr�sys�argv�exit�failfast�
catchbreak�	verbosity�bufferr"�warnoptions�warnings�defaultTest�
testRunner�
testLoaderr
r�basename�progName�	parseArgs�runTests)�selfr'r3r+r4r5r,r/r-r.r0r2r"�partrrr�__init__As,


zTestProgram.__init__cCs4|rt|�|jdkr|��|��t�d�dS)N�)�print�_discovery_parser�_initArgParsers�_print_helpr*r,)r:�msgrrr�	usageExitgs
zTestProgram.usageExitcOsZ|jdkr6t|j���ttd|ji�|j��n t|j���ttd|ji�dS)N�prog)	r'r>�_main_parserZformat_help�
MAIN_EXAMPLESr7r?�
print_help�MODULE_EXAMPLES)r:�args�kwargsrrrrAos
zTestProgram._print_helpcCs�|��|jdkrpt|�dkrD|d��dkrD|�|dd��dS|j�|dd�|�|js�|�g�dSn|j�|dd�|�|jr�t|j�|_	t
dkr�d|_n6|jdkr�d|_	n$t|jt
�r�|jf|_	nt|j�|_	|��dS)Nr�discoverr=r!)r@r'�lenr
�
_do_discoveryrE�
parse_args�testsr�	testNames�__name__r3r$r%�list�createTests)r:r+rrrr8xs(


zTestProgram.parseArgscCst|jr|j|j_|r@|dkr"|jn|�}|�|j|j|j�|_n0|jdkr\|j�|j	�|_n|j�
|j|j	�|_dS�N)�testNamePatternsr5rK�startr�top�testrPZloadTestsFromModuler'ZloadTestsFromNames)r:�from_discovery�LoaderrrrrrS�s


�zTestProgram.createTestscCs$|��}|�|�|_|�|�|_dSrT)�_getParentArgParser�_getMainArgParserrE�_getDiscoveryArgParserr?)r:Z
parent_parserrrrr@�szTestProgram._initArgParserscCs�tjdd�}|jddddddd	�|jd
ddddd
d	�|jddddd�|jdkrn|jdddddd�d|_|jdkr�|jdddddd�d|_|jdkr�|jdddddd�d|_|jdkr�|jdd d!td"d#�g|_|S)$NF)Zadd_helpz-vz	--verboser/Zstore_constr=zVerbose output)�dest�actionZconst�helpz-qz--quietrzQuiet outputz--localsr"�
store_truez"Show local variables in tracebacks)r^r_r`z-fz
--failfastr-zStop on first fail or errorz-cz--catchr.z'Catch Ctrl-C and display results so farz-bz--bufferr0z%Buffer stdout and stderr during testsz-krU�appendz.Only run tests which match the given substring)r^r_�typer`)�argparse�ArgumentParser�add_argumentr-r.r0rUr)r:�parserrrrr[�sR
�
��

�

�

�
�zTestProgram._getParentArgParsercCs2tj|gd�}|j|_|j|_|jdddd�|S)N��parentsrOrz?a list of any number of test modules, classes and test methods.)�nargsr`)rdrer7rDrArGrf)r:�parentrgrrrr\�s�zTestProgram._getMainArgParsercCsztj|gd�}d|j|_d|_|jddddd�|jd	d
ddd�|jd
dddd�dD]}|j|dtjtjd�qZ|S)Nrhz%s discoverzcFor test discovery all test modules must be importable from the top level directory of the project.z-sz--start-directoryrVz*Directory to start discovery ('.' default))r^r`z-pz	--patternrz+Pattern to match tests ('test*.py' default)z-tz--top-level-directoryrWz<Top level directory of project (defaults to start directory))rVrrW�?)rjr#r`)rdrer7rDZepilogrfZSUPPRESS)r:rkrg�argrrrr]�s$
�
�
��z"TestProgram._getDiscoveryArgParsercCsLd|_d|_d|_|dk	r:|jdkr,|��|j�||�|jd|d�dS)Nrztest*.pyT)rYrZ)rVrrWr?r@rNrS)r:r+rZrrrrM�s
zTestProgram._do_discoveryc	Cs�|jrt�|jdkrtj|_t|jt�r�zVz"|j|j|j|j	|j
|jd�}Wn.tk
r||j|j|j|j	|j
d�}YnXWq�tk
r�|��}Yq�Xn|j}|�
|j�|_|jr�t�|j���dS)N)r/r-r0r2r")r/r-r0r2)r.rr4rZTextTestRunnerr$rcr/r-r0r2r"�	TypeError�runrX�resultr,r*Z
wasSuccessful)r:r4rrrr9�s2
�
�zTestProgram.runTests)N)FN)N)rQ�
__module__�__qualname__�__doc__r'r/r-r.r0r7r2rUr?rZdefaultTestLoaderr<rCrAr8rSr@r[r\r]rMr9rrrrr 7s6��&
	
#

r )rsr*rdr
�rrZsignalsrZ
__unittestrFrHrrr�objectr �mainrrrr�<module>s	]unittest/__pycache__/signals.cpython-38.opt-2.pyc000064400000004256151153537550015704 0ustar00U

e5dc	�@sbddlZddlZddlmZdZGdd�de�Ze��Zdd�Z	dd	�Z
dad
d�Zddd
�Z
dS)�N)�wrapsTc@seZdZdd�Zdd�ZdS)�_InterruptHandlercCsNd|_||_t|t�rD|tjkr(tj}n|tjkr<dd�}ntd��||_	dS)NFcSsdS�N�)Z
unused_signumZunused_framerr�(/usr/lib64/python3.8/unittest/signals.py�default_handlersz3_InterruptHandler.__init__.<locals>.default_handlerzYexpected SIGINT signal handler to be signal.SIG_IGN, signal.SIG_DFL, or a callable object)
�called�original_handler�
isinstance�int�signal�SIG_DFL�default_int_handler�SIG_IGN�	TypeErrorr)�selfrrrr�__init__
s



z_InterruptHandler.__init__cCsRt�tj�}||k	r |�||�|jr2|�||�d|_t��D]}|��q@dS)NT)r�	getsignal�SIGINTrr�_results�keys�stop)rZsignum�frameZinstalled_handler�resultrrr�__call__sz_InterruptHandler.__call__N)�__name__�
__module__�__qualname__rrrrrrr	srcCsdt|<dS)N�)r�rrrr�registerResult*sr cCstt�|d��Sr)�boolr�poprrrr�removeResult-sr#cCs.tdkr*t�tj�}t|�at�tjt�dSr)�_interrupt_handlerrrrr)rrrr�installHandler1sr%cs<�dk	r t���fdd��}|Stdk	r8t�tjtj�dS)Nc
s6t�tj�}t�z�||�W�St�tj|�XdSr)rrr�
removeHandler)�args�kwargs�initial��methodrr�inner;s
zremoveHandler.<locals>.inner)rr$rrr	)r+r,rr*rr&9sr&)N)r�weakref�	functoolsrZ
__unittest�objectr�WeakKeyDictionaryrr r#r$r%r&rrrr�<module>s unittest/__pycache__/__init__.cpython-38.opt-1.pyc000064400000006070151153537550015776 0ustar00U

e5d��@s�dZddddddddd	d
ddd
dddddddgZe�dddg�dZddlmZddlmZddlm	Z	m
Z
mZmZm
Z
mZmZmZddlmZmZddlmZmZmZmZmZddlmZmZdd lmZmZdd!lm Z m!Z!m"Z"m#Z#eZ$d"d#�Z%d$S)%a�
Python unit testing framework, based on Erich Gamma's JUnit and Kent Beck's
Smalltalk testing framework (used with permission).

This module contains the core framework classes that form the basis of
specific test cases and suites (TestCase, TestSuite etc.), and also a
text-based utility class for running the tests and reporting the results
 (TextTestRunner).

Simple usage:

    import unittest

    class IntegerArithmeticTestCase(unittest.TestCase):
        def testAdd(self):  # test method names begin with 'test'
            self.assertEqual((1 + 2), 3)
            self.assertEqual(0 + 1, 1)
        def testMultiply(self):
            self.assertEqual((0 * 10), 0)
            self.assertEqual((5 * 8), 40)

    if __name__ == '__main__':
        unittest.main()

Further information is available in the bundled documentation, and from

  http://docs.python.org/library/unittest.html

Copyright (c) 1999-2003 Steve Purcell
Copyright (c) 2003-2010 Python Software Foundation
This module is free software, and you may redistribute it and/or modify
it under the same terms as Python itself, so long as this copyright message
and disclaimer are retained in their original form.

IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.

THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE.  THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS,
AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
�
TestResult�TestCase�IsolatedAsyncioTestCase�	TestSuite�TextTestRunner�
TestLoader�FunctionTestCase�main�defaultTestLoader�SkipTest�skip�skipIf�
skipUnless�expectedFailure�TextTestResult�installHandler�registerResult�removeResult�
removeHandler�addModuleCleanup�getTestCaseNames�	makeSuite�
findTestCasesT�)r)r)rrrr
rrr
r)�
BaseTestSuiter)rr	rrr)�TestProgramr)rr)rrrrcCs"ddl}|j�t�}|j||d�S)N�)Z	start_dir�pattern)Zos.path�path�dirname�__file__Zdiscover)�loaderZtestsr�osZthis_dir�r"�)/usr/lib64/python3.8/unittest/__init__.py�
load_testsLsr$N)&�__doc__�__all__�extendZ
__unittest�resultrZ
async_caserZcaserrrr
rrr
rZsuiterrr rr	rrrrrZrunnerrrZsignalsrrrrZ_TextTestResultr$r"r"r"r#�<module>s<.�(unittest/__pycache__/util.cpython-38.opt-2.pyc000064400000007070151153537550015216 0ustar00U

e5d_�@s�ddlmZmZddlmZdZdZdZdZdZ	dZ
eeee
ee	Zdd�Zd	d
�Z
ddd
�Zdd�Zdd�Zdd�Zdd�Zedd�Zdd�Zdd�ZdS)�)�
namedtuple�Counter)�commonprefixT�P��cCsBt|�||}|tkr>d|d|�||t|�|d�f}|S)Nz%s[%d chars]%s)�len�_PLACEHOLDER_LEN)�s�	prefixlenZ	suffixlen�skip�r
�%/usr/lib64/python3.8/unittest/util.py�_shortens&rcs�ttt|��}ttt|��}|tkr(|St|��t���t|�tt}|t	krxt
�t|��t��fdd�|D��St
�tt	��t��fdd�|D��S)Nc3s|]}�|�d�VqdS�Nr
��.0r
��prefixrr
r�	<genexpr>'sz'_common_shorten_repr.<locals>.<genexpr>c3s&|]}�t|�d�tt�VqdSr)r�
_MIN_DIFF_LEN�_MIN_END_LENrrr
rr*s�)�tuple�map�	safe_repr�maxr�_MAX_LENGTHr�_MIN_BEGIN_LENr	�_MIN_COMMON_LENr)�args�maxlenZ
common_lenr
rr�_common_shorten_reprs ��r!FcCsPzt|�}Wntk
r*t�|�}YnX|r<t|�tkr@|S|dt�dS)Nz [truncated]...)�repr�	Exception�object�__repr__rr)�objZshort�resultr
r
rr-srcCsd|j|jfS)Nz%s.%s)�
__module__�__qualname__)�clsr
r
r�strclass6sr+cCsd}}g}g}z�||}||}||krT|�|�|d7}|||kr�|d7}q<nv||kr�|�|�|d7}|||kr�|d7}qnnD|d7}z|||kr�|d7}q�W5|d7}|||kr�|d7}q�XWqtk
�r|�||d��|�||d��Y�qYqXq||fS�Nr�)�append�
IndexError�extend)�expected�actual�i�j�missingZ
unexpected�e�ar
r
r�sorted_list_difference9s8

r8cCsHg}|r@|��}z|�|�Wqtk
r<|�|�YqXq||fSr)�pop�remove�
ValueErrorr.)r1r2r5�itemr
r
r�unorderable_list_differencebsr=cCs||k||kSrr
)�x�yr
r
r�
three_way_cmpssr@ZMismatchzactual expected valuecCs,t|�t|�}}t|�t|�}}t�}g}t|�D]�\}}	|	|krHq6d}
}t||�D] }|||	krZ|
d7}
|||<qZt|�D] \}}
|
|	kr�|d7}|||<q�|
|kr6t|
||	�}|�|�q6t|�D]X\}}	|	|kr�q�d}t||�D] }|||	kr�|d7}|||<q�td||	�}|�|�q�|Sr,)�listrr$�	enumerate�range�	_Mismatchr.)r2r1r
�t�m�nZNULLr'r3�elem�cnt_s�cnt_tr4Z
other_elem�diffr
r
r�_count_diff_all_purposeys<


rLc	Cs�t|�t|�}}g}|��D]2\}}|�|d�}||krt|||�}|�|�q|��D]&\}}||krZtd||�}|�|�qZ|S)Nr)r�items�getrDr.)	r2r1r
rEr'rHrIrJrKr
r
r�_count_diff_hashable�srON)F)�collectionsrrZos.pathrZ
__unittestrr	rrrrrr!rr+r8r=r@rDrLrOr
r
r
r�<module>s0
���
	)
#unittest/__pycache__/case.cpython-38.pyc000064400000142466151153537550014225 0ustar00U

e5d���@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
Z
ddlmZmZmZmZmZdZe�ZdZGdd	�d	e�ZGd
d�de�ZGdd
�d
e�ZGdd�de�Zdd�ZgZdd�Zdd�Z dd�Z!dd�Z"dd�Z#dd�Z$dd�Z%Gd d!�d!�Z&Gd"d#�d#e&�Z'Gd$d%�d%e'�Z(Gd&d'�d'e'�Z)e�*d(d)d*g�Z+Gd+d,�d,ej,�Z-Gd-d.�d.e&�Z.Gd/d0�d0ej/�Z0Gd1d2�d2e�Z1Gd3d4�d4e1�Z2Gd5d6�d6e1�Z3dS)7zTest case implementation�N�)�result)�strclass�	safe_repr�_count_diff_all_purpose�_count_diff_hashable�_common_shorten_reprTz@
Diff is %s characters long. Set self.maxDiff to None to see it.c@seZdZdZdS)�SkipTestz�
    Raise this exception in a test to skip it.

    Usually you can use TestCase.skipTest() or one of the skipping decorators
    instead of raising this directly.
    N��__name__�
__module__�__qualname__�__doc__�rr�%/usr/lib64/python3.8/unittest/case.pyr	sr	c@seZdZdZdS)�_ShouldStopz
    The test should stop.
    Nr
rrrrr"src@seZdZdZdS)�_UnexpectedSuccessz7
    The test was supposed to fail, but it didn't!
    Nr
rrrrr'src@s&eZdZddd�Zejddd��ZdS)	�_OutcomeNcCs4d|_||_t|d�|_d|_g|_d|_g|_dS)NF�
addSubTestT)�expecting_failurer�hasattr�result_supports_subtests�success�skipped�expectedFailure�errors)�selfrrrr�__init__.sz_Outcome.__init__Fc
cs�|j}d|_z�z
dVWn�tk
r.�Yn�tk
rh}zd|_|j�|t|�f�W5d}~XYnjtk
rzYnXt��}|j	r�||_
nd|_|j�||f�d}YnX|jr�|jr�|j�|df�W5|jo�||_XdS)NTF)
r�KeyboardInterruptr	r�append�strr�sys�exc_inforrrr)r�	test_case�isTestZold_success�er"rrr�testPartExecutor7s*
$
z_Outcome.testPartExecutor)N)F)rrr
r�
contextlib�contextmanagerr&rrrrr-s
	rcCs|S�Nr)�objrrr�_idUsr+cOst�|||f�dS)znSame as addCleanup, except the cleanup items are called even if
    setUpModule fails (unlike tearDownModule).N)�_module_cleanupsr)�function�args�kwargsrrr�addModuleCleanupZsr0c
Csdg}trTt��\}}}z|||�Wqtk
rP}z|�|�W5d}~XYqXq|r`|d�dS)zWExecute all module cleanup functions. Normally called for you after
    tearDownModule.Nr)r,�pop�	Exceptionr)�
exceptionsr-r.r/�excrrr�doModuleCleanups`sr5cs,�fdd�}t�tj�r(�}d�||�S|S)z&
    Unconditionally skip a test.
    cs4t|t�s$t�|��fdd��}|}d|_�|_|S)Ncst���dSr)�r	�r.r/��reasonrr�skip_wrappervsz-skip.<locals>.decorator.<locals>.skip_wrapperT)�
isinstance�type�	functools�wraps�__unittest_skip__�__unittest_skip_why__)�	test_itemr:r8rr�	decoratorts
zskip.<locals>.decorator�)r;�types�FunctionType)r9rBrArr8r�skipps
rFcCs|rt|�StS)z/
    Skip a test if the condition is true.
    �rFr+�Z	conditionr9rrr�skipIf�srIcCs|st|�StS)z3
    Skip a test unless the condition is true.
    rGrHrrr�
skipUnless�srJcCs
d|_|S)NT)�__unittest_expecting_failure__)rArrrr�srcs4t|t�r t�fdd�|D��St|t�o2t|��S)Nc3s|]}t|��VqdSr))�_is_subtype)�.0r%��basetyperr�	<genexpr>�sz_is_subtype.<locals>.<genexpr>)r;�tuple�allr<�
issubclass)�expectedrOrrNrrL�s
rLc@seZdZdd�Zdd�ZdS)�_BaseTestCaseContextcCs
||_dSr))r#)rr#rrrr�sz_BaseTestCaseContext.__init__cCs |j�|j|�}|j�|��dSr))r#�_formatMessage�msg�failureException)r�standardMsgrWrrr�
_raiseFailure�sz"_BaseTestCaseContext._raiseFailureN)rrr
rrZrrrrrU�srUc@seZdZddd�Zdd�ZdS)�_AssertRaisesBaseContextNcCs@t�||�||_||_|dk	r*t�|�}||_d|_d|_dSr))	rUrrTr#�re�compile�expected_regex�obj_namerW)rrTr#r^rrrr�s
z!_AssertRaisesBaseContext.__init__c	Cs�z�t|j|j�s"td||jf��|sV|�dd�|_|rNtdtt|��f��|W�TS|^}}z|j	|_
Wntk
r�t|�|_
YnX|�|||�W5QRXW5d}XdS)z�
        If args is empty, assertRaises/Warns is being used as a
        context manager, so check for a 'msg' kwarg and return self.
        If args is not empty, call a callable passing positional and keyword
        arguments.
        Nz%s() arg 1 must be %srWz3%r is an invalid keyword argument for this function)
rLrT�
_base_type�	TypeError�_base_type_strr1rW�next�iterrr_�AttributeErrorr )r�namer.r/Zcallable_objrrr�handle�s(��z_AssertRaisesBaseContext.handle)N)rrr
rrgrrrrr[�s

r[c@s(eZdZdZeZdZdd�Zdd�ZdS)�_AssertRaisesContextzCA context manager used to implement TestCase.assertRaises* methods.z-an exception type or tuple of exception typescCs|Sr)r�rrrr�	__enter__�sz_AssertRaisesContext.__enter__cCs�|dkrbz|jj}Wntk
r2t|j�}YnX|jrP|�d�||j��ql|�d�|��n
t�|�t	||j�s|dS|�
d�|_|jdkr�dS|j}|�
t|��s�|�d�|jt|���dS)Nz{} not raised by {}z
{} not raisedFT�"{}" does not match "{}")rTrrer r_rZ�format�	traceback�clear_framesrS�with_tracebackZ	exceptionr^�search�pattern)r�exc_type�	exc_value�tb�exc_namer^rrr�__exit__�s.
�

�z_AssertRaisesContext.__exit__N)	rrr
r�
BaseExceptionr`rbrjrvrrrrrh�s
rhc@s(eZdZdZeZdZdd�Zdd�ZdS)�_AssertWarnsContextzBA context manager used to implement TestCase.assertWarns* methods.z(a warning type or tuple of warning typescCsRttj���D]}t|dd�ri|_qtjdd�|_|j�	�|_t�
d|j�|S)N�__warningregistry__T)�record�always)�listr!�modules�values�getattrry�warnings�catch_warnings�warnings_managerrj�simplefilterrT)r�vrrrrj�sz_AssertWarnsContext.__enter__cCs|j�|||�|dk	rdSz|jj}Wntk
rFt|j�}YnXd}|jD]Z}|j}t||j�sjqR|dkrv|}|j	dk	r�|j	�
t|��s�qR||_|j|_|j
|_
dS|dk	r�|�d�|j	jt|���|jr�|�d�||j��n|�d�|��dS)Nrkz{} not triggered by {}z{} not triggered)r�rvrTrrer r��messager;r^rpZwarning�filename�linenorZrlrqr_)rrrrsrtruZfirst_matching�m�wrrrrvs@

��
�z_AssertWarnsContext.__exit__N)	rrr
r�Warningr`rbrjrvrrrrrx�s
rx�_LoggingWatcher�records�outputc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_CapturingHandlerzM
    A logging handler capturing all (raw and formatted) logging output.
    cCstj�|�tgg�|_dSr))�logging�Handlerrr��watcherrirrrr3sz_CapturingHandler.__init__cCsdSr)rrirrr�flush7sz_CapturingHandler.flushcCs*|jj�|�|�|�}|jj�|�dSr))r�r�rrlr�)rrzrWrrr�emit:s
z_CapturingHandler.emitN)rrr
rrr�r�rrrrr�.sr�c@s,eZdZdZdZdd�Zdd�Zdd�Zd	S)
�_AssertLogsContextz:A context manager used to implement TestCase.assertLogs().z"%(levelname)s:%(name)s:%(message)scCs:t�||�||_|r(tj�||�|_ntj|_d|_dSr))	rUr�logger_namer�Z_nameToLevel�get�level�INFOrW)rr#r�r�rrrrFsz_AssertLogsContext.__init__cCs�t|jtj�r|j}|_nt�|j�}|_t�|j�}t�}|�	|�|j
|_
|jdd�|_|j
|_|j|_|g|_|�|j
�d|_|j
S)NF)r;r�r�ZLogger�loggerZ	getLoggerZ	Formatter�LOGGING_FORMATr�ZsetFormatterr��handlers�old_handlersr��	old_level�	propagate�
old_propagate�setLevel)rr�Z	formatterZhandlerrrrrjOs
z_AssertLogsContext.__enter__cCs`|j|j_|j|j_|j�|j�|dk	r.dSt|jj	�dkr\|�
d�t�
|j�|jj��dS)NFrz-no logs of level {} or higher triggered on {})r�r�r�r�r�r�r��lenr�r�rZrlr�ZgetLevelNamer�rf)rrrrsrtrrrrv`s


��z_AssertLogsContext.__exit__N)rrr
rr�rrjrvrrrrr�As
	r�c@seZdZdd�ZdS)�_OrderedChainMapccs8t�}|jD]&}|D]}||kr|�|�|VqqdSr))�set�maps�add)r�seen�mapping�krrr�__iter__ns

z_OrderedChainMap.__iter__N)rrr
r�rrrrr�msr�c@seZdZdZeZdZdZdZdZ	gZ
d�dd�Zd	d
�Zdd�Z
d
e
_edd��Zdd�Zdd�Zedd��Zedd��Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zeje fd*d+��Z!d,d-�Z"d.d/�Z#d0d1�Z$d2d3�Z%d4d5�Z&d6d7�Z'd8d9�Z(d�d;d<�Z)d=d>�Z*ed?d@��Z+dAdB�Z,dCdD�Z-dEdF�Z.d�dGdH�Z/d�dIdJ�Z0d�dKdL�Z1dMdN�Z2dOdP�Z3dQdR�Z4d�dSdT�Z5dUdV�Z6d�dWdX�Z7d�dYdZ�Z8d�d[d\�Z9d�d]d^�Z:d�d_d`�Z;d�dadb�Z<dcdd�Z=d�dedf�Z>d�dgdh�Z?d�didj�Z@d�dkdl�ZAd�dmdn�ZBd�dodp�ZCd�dqdr�ZDd�dsdt�ZEd�dudv�ZFd�dwdx�ZGd�dydz�ZHd�d{d|�ZId�d}d~�ZJd�dd��ZKd�d�d��ZLd�d�d��ZMd�d�d��ZNd�d�d��ZOd�d�d��ZPd�d��ZQd�d��ZRd�d�d��ZSd�d�d��ZTd�d��ZUeUe8�ZVZWeUe9�ZXZYeUe:�ZZZ[eUe;�Z\Z]eUe1�Z^Z_eUe3�Z`eUe0�ZaeUeQ�ZbeUeS�ZceUeT�Zdd:S)��TestCaseaWA class whose instances are single test cases.

    By default, the test code itself should be placed in a method named
    'runTest'.

    If the fixture may be used for many test cases, create as
    many test methods as are needed. When instantiating such a TestCase
    subclass, specify in the constructor arguments the name of the test method
    that the instance is to execute.

    Test authors should subclass TestCase for their own tests. Construction
    and deconstruction of the test's environment ('fixture') can be
    implemented by overriding the 'setUp' and 'tearDown' methods respectively.

    If it is necessary to override the __init__ method, the base class
    __init__ method must always be called. It is important that subclasses
    should not change the signature of their __init__ method, since instances
    of the classes are instantiated automatically by parts of the framework
    in order to be run.

    When subclassing TestCase, you can set these attributes:
    * failureException: determines which exception will be raised when
        the instance's assertion methods fail; test methods raising this
        exception will be deemed to have 'failed' rather than 'errored'.
    * longMessage: determines whether long messages (including repr of
        objects used in assert methods) will be printed on failure in *addition*
        to any explicit message passed.
    * maxDiff: sets the maximum length of a diff in failure messages
        by assert methods using difflib. It is looked up as an instance
        attribute so can be configured by individual tests if required.
    Ti�iF�runTestcCs�||_d|_d|_zt||�}Wn.tk
rN|dkrJtd|j|f��Yn
X|j|_g|_d|_	i|_
|�td�|�t
d�|�td�|�td�|�td�|�td	�dS)
z�Create an instance of the class that will use the named test
           method when executed. Raises a ValueError if the instance does
           not have a method with the specified name.
        NzNo testr�zno such test method in %s: %s�assertDictEqual�assertListEqual�assertTupleEqual�assertSetEqual�assertMultiLineEqual)�_testMethodName�_outcome�_testMethodDocrre�
ValueError�	__class__r�	_cleanups�_subtest�_type_equality_funcs�addTypeEqualityFunc�dictr|rQr��	frozensetr )rZ
methodName�
testMethodrrrr�s(�zTestCase.__init__cCs||j|<dS)a[Add a type specific assertEqual style function to compare a type.

        This method is for use by TestCase subclasses that need to register
        their own type equality functions to provide nicer error messages.

        Args:
            typeobj: The data type to call this function on when both values
                    are of the same type in assertEqual().
            function: The callable taking two arguments and an optional
                    msg= argument that raises self.failureException with a
                    useful error message when the two arguments are not equal.
        N)r�)rZtypeobjr-rrrr��s
zTestCase.addTypeEqualityFunccOs�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d	��t|�}|j�|||f�dS)
aAdd a function, with arguments, to be called when the test is
        completed. Functions added are called on a LIFO basis and are
        called after tearDown on test failure or success.

        Cleanup items are called even if setUp fails (unlike tearDown).�z>descriptor 'addCleanup' of 'TestCase' object needs an argumentr-rNz4Passing 'function' as keyword argument is deprecated)�
stacklevelz:addCleanup expected at least 1 positional argument, got %dr)	r�rar1r��warn�DeprecationWarningrQr�r)r.r/rr-r�rrr�
addCleanup�s"

�
�zTestCase.addCleanupz%($self, function, /, *args, **kwargs)cOs|j�|||f�dS)zpSame as addCleanup, except the cleanup items are called even if
        setUpClass fails (unlike tearDownClass).N)�_class_cleanupsr)�clsr-r.r/rrr�addClassCleanup�szTestCase.addClassCleanupcCsdS)zAHook method for setting up the test fixture before exercising it.Nrrirrr�setUp�szTestCase.setUpcCsdS)zAHook method for deconstructing the test fixture after testing it.Nrrirrr�tearDown�szTestCase.tearDowncCsdS)zKHook method for setting up class fixture before running tests in the class.Nr�r�rrr�
setUpClass�szTestCase.setUpClasscCsdS)zVHook method for deconstructing the class fixture after running all tests in the class.Nrr�rrr�
tearDownClassszTestCase.tearDownClasscCsdS)Nrrrirrr�countTestCasesszTestCase.countTestCasescCst��Sr))rZ
TestResultrirrr�defaultTestResult	szTestCase.defaultTestResultcCs$|j}|r |���d�d��SdS)z�Returns a one-line description of the test, or None if no
        description has been provided.

        The default implementation of this method returns the first line of
        the specified test method's docstring.
        �
rN)r��strip�split�r�docrrr�shortDescriptionszTestCase.shortDescriptioncCsdt|j�|jfS)Nz%s.%s�rr�r�rirrr�idszTestCase.idcCs t|�t|�k	rtS|j|jkSr))r<�NotImplementedr��r�otherrrr�__eq__szTestCase.__eq__cCstt|�|jf�Sr))�hashr<r�rirrr�__hash__ szTestCase.__hash__cCsd|jt|j�fS�Nz%s (%s))r�rr�rirrr�__str__#szTestCase.__str__cCsdt|j�|jfS)Nz<%s testMethod=%s>r�rirrr�__repr__&s�zTestCase.__repr__cCs<t|dd�}|dk	r |||�nt�dtd�|�|�dS)N�addSkipz4TestResult has no addSkip method, skips not reportedr�)rr�r��RuntimeWarning�
addSuccess)rrr#r9r�rrr�_addSkip*s�zTestCase._addSkipc	ks�|jdks|jjsdVdS|j}|dkr4t|�}n|j�|�}t|||�|_zX|jj|jdd��dVW5QRX|jjs�|jj	}|dk	r�|j
r�t�n|jjr�t�W5||_XdS)aPReturn a context manager that will return the enclosed block
        of code in a subtest identified by the optional message and
        keyword parameters.  A failure in the subtest marks the test
        case as failed but resumes execution at the end of the enclosed
        block, allowing further test code to be executed.
        NT�r$)
r�rr�r��params�	new_child�_SubTestr&rrZfailfastrr)rrWr��parentZ
params_maprrrr�subTest3s$
zTestCase.subTestcCs`|D]V\}}t|t�r(|�|j||�q|dk	rt|d|j�rN|�||�q|�||�qdS)Nr)r;r�rr#rSrX�
addFailureZaddError)rrr�testr"rrr�_feedErrorsToResultRs
zTestCase._feedErrorsToResultcCsDz
|j}Wn*tk
r4t�dt�|�|�YnX|||�dS)Nz@TestResult has no addExpectedFailure method, reporting as passes)�addExpectedFailurerer�r�r�r�)rrr"r�rrr�_addExpectedFailure\s
�zTestCase._addExpectedFailurecCshz
|j}WnPtk
rZt�dt�z
td�Wn$tk
rT|�|t���YnXYn
X||�dS)NzCTestResult has no addUnexpectedSuccess method, reporting as failure)	�addUnexpectedSuccessrer�r�r�rr�r!r")rrr�rrr�_addUnexpectedSuccessfs
�
zTestCase._addUnexpectedSuccesscCs|��dSr))r�rirrr�
_callSetUpuszTestCase._callSetUpcCs
|�dSr)r)r�methodrrr�_callTestMethodxszTestCase._callTestMethodcCs|��dSr))r�rirrr�
_callTearDown{szTestCase._callTearDowncOs|||�dSr)r�rr-r.r/rrr�_callCleanup~szTestCase._callCleanupNc

Cs|}|dkr.|��}t|dd�}|dk	r.|�|�|�t||j�}t|jdd�s^t|dd�r�z,t|jdd�pxt|dd�}|�|||�W5|�|�XdSt|dd�}t|dd�}|p�|}t|�}	z�|	|_|	�|��|�
�W5QRX|	j�r@||	_|	j|dd	��|�|�W5QRXd|	_|	�|��|��W5QRX|��|	jD]\}}|�|||��qN|�||	j�|	j�r�|�r�|	j
�r�|�||	j
�n
|�|�n
|�|�|W�S|�|�|dk�r�t|dd�}
|
dk	�r�|
�|	j�	�d|	_
d|_XdS)
N�startTestRunr?Fr@rCrK�stopTestRunTr�)r�rZ	startTestr�r�ZstopTestr�rr�clearrr�r&r�rrr�r��
doCleanupsrr�r�r�r�)
rrZorig_resultr�r�Zskip_whyZexpecting_failure_methodZexpecting_failure_classr�outcomer�r�r9rrr�run�st

�
���




zTestCase.runc	CsR|jp
t�}|jrL|j��\}}}|�|��|j|f|�|�W5QRXq|jS)zNExecute all cleanup functions. Normally called for you after
        tearDown.)r�rr�r1r&r�r)rr�r-r.r/rrrr��szTestCase.doCleanupsc
Csdg|_|jr`|j��\}}}z|||�Wqtk
r\}z|j�t���W5d}~XYqXqdS)zYExecute all class cleanup functions. Normally called for you after
        tearDownClass.N)ZtearDown_exceptionsr�r1r2rr!r")r�r-r.r/r4rrr�doClassCleanups�szTestCase.doClassCleanupscOs|j||�Sr))r�)rr.�kwdsrrr�__call__�szTestCase.__call__cCsF|��t||j��|��|jrB|j�d�\}}}|||�qdS)z6Run the test without collecting errors in a TestResult���N)r�rr�r�r�r1r�rrr�debug�szTestCase.debugcCst|��dS)zSkip this test.Nr6)rr9rrr�skipTest�szTestCase.skipTestcCs|�|��dS)z)Fail immediately, with the given message.N)rX)rrWrrr�fail�sz
TestCase.failcCs&|r"|�|dt|��}|�|��dS)z#Check that the expression is false.z%s is not falseN�rVrrX�r�exprrWrrr�assertFalse�szTestCase.assertFalsecCs&|s"|�|dt|��}|�|��dS)z"Check that the expression is true.z%s is not trueNrrrrr�
assertTrue�szTestCase.assertTruecCsV|js|p|S|dkr|Szd||fWStk
rPdt|�t|�fYSXdS)a�Honour the longMessage attribute when generating failure messages.
        If longMessage is False this means:
        * Use only an explicit message if it is provided
        * Otherwise use the standard message for the assert

        If longMessage is True:
        * Use the standard message
        * If an explicit message is provided, plus ' : ' and the explicit message
        Nz%s : %s)�longMessage�UnicodeDecodeErrorr)rrWrYrrrrV�s
zTestCase._formatMessagecOs(t||�}z|�d||�W�Sd}XdS)a=Fail unless an exception of class expected_exception is raised
           by the callable when invoked with specified positional and
           keyword arguments. If a different type of exception is
           raised, it will not be caught, and the test case will be
           deemed to have suffered an error, exactly as for an
           unexpected exception.

           If called with the callable and arguments omitted, will return a
           context object used like this::

                with self.assertRaises(SomeException):
                    do_something()

           An optional keyword argument 'msg' can be provided when assertRaises
           is used as a context object.

           The context manager keeps a reference to the exception as
           the 'exception' attribute. This allows you to inspect the
           exception after the assertion::

               with self.assertRaises(SomeException) as cm:
                   do_something()
               the_exception = cm.exception
               self.assertEqual(the_exception.error_code, 3)
        N�assertRaises�rhrg)r�expected_exceptionr.r/�contextrrrrs
zTestCase.assertRaisescOst||�}|�d||�S)a�Fail unless a warning of class warnClass is triggered
           by the callable when invoked with specified positional and
           keyword arguments.  If a different type of warning is
           triggered, it will not be handled: depending on the other
           warning filtering rules in effect, it might be silenced, printed
           out, or raised as an exception.

           If called with the callable and arguments omitted, will return a
           context object used like this::

                with self.assertWarns(SomeWarning):
                    do_something()

           An optional keyword argument 'msg' can be provided when assertWarns
           is used as a context object.

           The context manager keeps a reference to the first matching
           warning as the 'warning' attribute; similarly, the 'filename'
           and 'lineno' attributes give you information about the line
           of Python code from which the warning was triggered.
           This allows you to inspect the warning after the assertion::

               with self.assertWarns(SomeWarning) as cm:
                   do_something()
               the_warning = cm.warning
               self.assertEqual(the_warning.some_attribute, 147)
        �assertWarns�rxrg)r�expected_warningr.r/rrrrr5s
zTestCase.assertWarnscCst|||�S)a�Fail unless a log message of level *level* or higher is emitted
        on *logger_name* or its children.  If omitted, *level* defaults to
        INFO and *logger* defaults to the root logger.

        This method must be used as a context manager, and will yield
        a recording object with two attributes: `output` and `records`.
        At the end of the context manager, the `output` attribute will
        be a list of the matching formatted log messages and the
        `records` attribute will be a list of the corresponding LogRecord
        objects.

        Example::

            with self.assertLogs('foo', level='INFO') as cm:
                logging.getLogger('foo').info('first message')
                logging.getLogger('foo.bar').error('second message')
            self.assertEqual(cm.output, ['INFO:foo:first message',
                                         'ERROR:foo.bar:second message'])
        )r�)rr�r�rrr�
assertLogsTszTestCase.assertLogscCsFt|�t|�kr@|j�t|��}|dk	r@t|t�r<t||�}|S|jS)aGet a detailed comparison function for the types of the two args.

        Returns: A callable accepting (first, second, msg=None) that will
        raise a failure exception if first != second with a useful human
        readable error message for those types.
        N)r<r�r�r;r r�_baseAssertEqual)r�first�secondZasserterrrr�_getAssertEqualityFuncjs

zTestCase._getAssertEqualityFunccCs0||ks,dt||�}|�||�}|�|��dS)z:The default assertEqual implementation, not type specific.�%s != %sN)rrVrX)rrrrWrYrrrr�szTestCase._baseAssertEqualcCs|�||�}||||d�dS)z[Fail if the two objects are unequal as determined by the '=='
           operator.
        )rWN)r)rrrrWZassertion_funcrrr�assertEqual�szTestCase.assertEqualcCs2||ks.|�|dt|�t|�f�}|�|��dS)zYFail if the two objects are equal as determined by the '!='
           operator.
        z%s == %sNr)rrrrWrrr�assertNotEqual�s
�zTestCase.assertNotEqualcCs�||krdS|dk	r$|dk	r$td��t||�}|dk	rf||krDdSdt|�t|�t|�t|�f}n:|dkrrd}t||�dkr�dSdt|�t|�|t|�f}|�||�}|�|��dS)a'Fail if the two objects are unequal as determined by their
           difference rounded to the given number of decimal places
           (default 7) and comparing to zero, or by comparing that the
           difference between the two objects is more than the given
           delta.

           Note that decimal places (from zero) are usually not the same
           as significant digits (measured from the most significant digit).

           If the two objects compare equal then they will automatically
           compare almost equal.
        N� specify delta or places not bothz(%s != %s within %s delta (%s difference)�rz)%s != %s within %r places (%s difference)�ra�absr�roundrVrX�rrrZplacesrWZdelta�diffrYrrr�assertAlmostEqual�s4��zTestCase.assertAlmostEqualcCs�|dk	r|dk	rtd��t||�}|dk	rb||ks@||kr@dSdt|�t|�t|�t|�f}n<|dkrnd}||ks�t||�dkr�dSdt|�t|�|f}|�||�}|�|��dS)a�Fail if the two objects are equal as determined by their
           difference rounded to the given number of decimal places
           (default 7) and comparing to zero, or by comparing that the
           difference between the two objects is less than the given delta.

           Note that decimal places (from zero) are usually not the same
           as significant digits (measured from the most significant digit).

           Objects that are equal automatically fail.
        Nrz(%s == %s within %s delta (%s difference)rrz%s == %s within %r placesrrrrr�assertNotAlmostEqual�s,��zTestCase.assertNotAlmostEqualcCs�|dk	rP|j}t||�s.|�d|t|�f��t||�sT|�d|t|�f��nd}d}zt|�}Wn ttfk
r�d|}YnX|dkr�zt|�}Wn ttfk
r�d|}YnX|dk�r�||kr�dSd|��ft||�}t	t
||��D]�}	z||	}
Wn4tttfk
�r<|d|	|f7}Y�q�YnXz||	}Wn4tttfk
�r~|d	|	|f7}Y�q�YnX|
|kr�|d
|	ft|
|�7}�q�q�||k�r�|dk�r�t|�t|�k�r�dS||k�r<|d|||f7}z|d|t||�f7}Wn,tttfk
�r8|d
||f7}YnXnh||k�r�|d|||f7}z|d|t||�f7}Wn,tttfk
�r�|d||f7}YnX|}dd�
t�t�|���t�|�����}
|�||
�}|�||�}|�|�dS)aAAn equality assertion for ordered sequences (like lists and tuples).

        For the purposes of this function, a valid ordered sequence type is one
        which can be indexed, has a length, and has an equality operator.

        Args:
            seq1: The first sequence to compare.
            seq2: The second sequence to compare.
            seq_type: The expected datatype of the sequences, or None if no
                    datatype should be enforced.
            msg: Optional message to use on failure instead of a list of
                    differences.
        NzFirst sequence is not a %s: %szSecond sequence is not a %s: %sZsequencez(First %s has no length.    Non-sequence?z)Second %s has no length.    Non-sequence?z%ss differ: %s != %s
z(
Unable to index element %d of first %s
z)
Unable to index element %d of second %s
z#
First differing element %d:
%s
%s
z+
First %s contains %d additional elements.
zFirst extra element %d:
%s
z'Unable to index element %d of first %s
z,
Second %s contains %d additional elements.
z(Unable to index element %d of second %s
r�)rr;rXrr�ra�NotImplementedError�
capitalizer�range�min�
IndexErrorr<�join�difflib�ndiff�pprint�pformat�
splitlines�_truncateMessagerVr)rZseq1Zseq2rW�seq_typeZ
seq_type_nameZ	differingZlen1Zlen2�iZitem1Zitem2rY�diffMsgrrr�assertSequenceEqual�s�

�

��
�

������

��
�

��
���zTestCase.assertSequenceEqualcCs2|j}|dkst|�|kr"||S|tt|�Sr))�maxDiffr��DIFF_OMITTED)rr�rZmax_diffrrrr+NszTestCase._truncateMessagecCs|j|||td�dS)aA list-specific equality assertion.

        Args:
            list1: The first list to compare.
            list2: The second list to compare.
            msg: Optional message to use on failure instead of a list of
                    differences.

        �r,N)r/r|)rZlist1Zlist2rWrrrr�Ts
zTestCase.assertListEqualcCs|j|||td�dS)aA tuple-specific equality assertion.

        Args:
            tuple1: The first tuple to compare.
            tuple2: The second tuple to compare.
            msg: Optional message to use on failure instead of a list of
                    differences.
        r2N)r/rQ)rZtuple1Ztuple2rWrrrr�`s	zTestCase.assertTupleEqualc

Cs`z|�|�}Wn^tk
r>}z|�d|�W5d}~XYn0tk
rl}z|�d|�W5d}~XYnXz|�|�}Wn^tk
r�}z|�d|�W5d}~XYn0tk
r�}z|�d|�W5d}~XYnX|s�|s�dSg}|�r|�d�|D]}|�t|���q|�r@|�d�|D]}|�t|���q*d�|�}	|�|�||	��dS)a�A set-specific equality assertion.

        Args:
            set1: The first set to compare.
            set2: The second set to compare.
            msg: Optional message to use on failure instead of a list of
                    differences.

        assertSetEqual uses ducktyping to support different types of sets, and
        is optimized for sets specifically (parameters must support a
        difference method).
        z/invalid type when attempting set difference: %sNz2first argument does not support set difference: %sz3second argument does not support set difference: %sz*Items in the first set but not the second:z*Items in the second set but not the first:r�)�
differencerarrer�reprr%rV)
rZset1Zset2rWZdifference1r%Zdifference2�lines�itemrYrrrr�ks2
  


zTestCase.assertSetEqualcCs2||kr.dt|�t|�f}|�|�||��dS)zDJust like self.assertTrue(a in b), but with a nicer default message.z%s not found in %sN�rrrV�r�memberZ	containerrWrYrrr�assertIn�s
�zTestCase.assertIncCs2||kr.dt|�t|�f}|�|�||��dS)zHJust like self.assertTrue(a not in b), but with a nicer default message.z%s unexpectedly found in %sNr7r8rrr�assertNotIn�s
�zTestCase.assertNotIncCs2||k	r.dt|�t|�f}|�|�||��dS)zDJust like self.assertTrue(a is b), but with a nicer default message.z%s is not %sNr7�rZexpr1Zexpr2rWrYrrr�assertIs�s
�zTestCase.assertIscCs,||kr(dt|�f}|�|�||��dS)zHJust like self.assertTrue(a is not b), but with a nicer default message.zunexpectedly identical: %sNr7r<rrr�assertIsNot�szTestCase.assertIsNotc	Cs~|�|td�|�|td�||krzdt||�}dd�t�t�|���t�|�����}|�	||�}|�
|�||��dS)Nz"First argument is not a dictionaryz#Second argument is not a dictionaryrr�)�assertIsInstancer�rr%r&r'r(r)r*r+rrV)rZd1Zd2rWrYrrrrr��s
�zTestCase.assertDictEqualc		Cs�t�dt�g}g}|��D]L\}}||kr8|�|�q|||kr|�dt|�t|�t||�f�q|sv|svdSd}|r�dd�dd�|D��}|r�|r�|d	7}|d
d�|�7}|�|�||��dS)z2Checks whether dictionary is a superset of subset.z&assertDictContainsSubset is deprecatedz%s, expected: %s, actual: %sNrCzMissing: %s�,css|]}t|�VqdSr))r)rMr�rrrrP�sz4TestCase.assertDictContainsSubset.<locals>.<genexpr>z; zMismatched values: %s)	r�r�r��itemsrrr%rrV)	rZsubsetZ
dictionaryrWZmissingZ
mismatched�key�valuerYrrr�assertDictContainsSubset�s4�
���
z!TestCase.assertDictContainsSubsetc
Cs�t|�t|�}}zt�|�}t�|�}Wntk
rHt||�}YnX||krVdSt||�}|r�d}dd�|D�}d�|�}	|�||	�}|�||�}|�	|�dS)a[Asserts that two iterables have the same elements, the same number of
        times, without regard to order.

            self.assertEqual(Counter(list(first)),
                             Counter(list(second)))

         Example:
            - [0, 1, 1] and [1, 0, 1] compare equal.
            - [0, 0, 1] and [0, 1] compare unequal.

        NzElement counts were not equal:
cSsg|]}d|�qS)z First has %d, Second has %d:  %rr)rMrrrr�
<listcomp>�sz-TestCase.assertCountEqual.<locals>.<listcomp>r�)
r|�collections�Counterrarrr%r+rVr)
rrrrWZ	first_seqZ
second_seqZdifferencesrYr5r.rrr�assertCountEqual�s 


zTestCase.assertCountEqualcCs�|�|td�|�|td�||kr�t|�|jks@t|�|jkrN|�|||�|jdd�}|jdd�}t|�dkr�|�d�|kr�|dg}|dg}dt||�}dd	�t	�
||��}|�||�}|�|�
||��d
S)z-Assert that two multi-line strings are equal.zFirst argument is not a stringzSecond argument is not a stringT)�keependsrz
r�rrCN)r?r r��_diffThresholdrr*r�rr%r&r'r+rrV)rrrrWZ
firstlinesZsecondlinesrYrrrrr��s �

zTestCase.assertMultiLineEqualcCs2||ks.dt|�t|�f}|�|�||��dS)zCJust like self.assertTrue(a < b), but with a nicer default message.z%s not less than %sNr7�r�a�brWrYrrr�
assertLessszTestCase.assertLesscCs2||ks.dt|�t|�f}|�|�||��dS)zDJust like self.assertTrue(a <= b), but with a nicer default message.z%s not less than or equal to %sNr7rKrrr�assertLessEqualszTestCase.assertLessEqualcCs2||ks.dt|�t|�f}|�|�||��dS)zCJust like self.assertTrue(a > b), but with a nicer default message.z%s not greater than %sNr7rKrrr�
assertGreaterszTestCase.assertGreatercCs2||ks.dt|�t|�f}|�|�||��dS)zDJust like self.assertTrue(a >= b), but with a nicer default message.z"%s not greater than or equal to %sNr7rKrrr�assertGreaterEqual szTestCase.assertGreaterEqualcCs,|dk	r(dt|�f}|�|�||��dS)zCSame as self.assertTrue(obj is None), with a nicer default message.Nz%s is not Noner7�rr*rWrYrrr�assertIsNone&szTestCase.assertIsNonecCs"|dkrd}|�|�||��dS)z(Included for symmetry with assertIsNone.Nzunexpectedly None)rrVrRrrr�assertIsNotNone,szTestCase.assertIsNotNonecCs0t||�s,dt|�|f}|�|�||��dS)zTSame as self.assertTrue(isinstance(obj, cls)), with a nicer
        default message.z%s is not an instance of %rN�r;rrrV�rr*r�rWrYrrrr?2s
zTestCase.assertIsInstancecCs0t||�r,dt|�|f}|�|�||��dS)z,Included for symmetry with assertIsInstance.z%s is an instance of %rNrUrVrrr�assertNotIsInstance9s
zTestCase.assertNotIsInstancecOst|||�}|�d||�S)aAsserts that the message in a raised exception matches a regex.

        Args:
            expected_exception: Exception class expected to be raised.
            expected_regex: Regex (re.Pattern object or string) expected
                    to be found in error message.
            args: Function to be called and extra positional args.
            kwargs: Extra kwargs.
            msg: Optional message used in case of failure. Can only be used
                    when assertRaisesRegex is used as a context manager.
        �assertRaisesRegexr	)rr
r^r.r/rrrrrX?s
zTestCase.assertRaisesRegexcOst|||�}|�d||�S)a�Asserts that the message in a triggered warning matches a regexp.
        Basic functioning is similar to assertWarns() with the addition
        that only warnings whose messages also match the regular expression
        are considered successful matches.

        Args:
            expected_warning: Warning class expected to be triggered.
            expected_regex: Regex (re.Pattern object or string) expected
                    to be found in error message.
            args: Function to be called and extra positional args.
            kwargs: Extra kwargs.
            msg: Optional message used in case of failure. Can only be used
                    when assertWarnsRegex is used as a context manager.
        �assertWarnsRegexr
)rrr^r.r/rrrrrYOszTestCase.assertWarnsRegexcCsVt|ttf�r$|std��t�|�}|�|�sRd|j|f}|�||�}|�	|��dS)z=Fail the test unless the text matches the regular expression.z!expected_regex must not be empty.z&Regex didn't match: %r not found in %rN)
r;r �bytes�AssertionErrorr\r]rprqrVrX)r�textr^rWrYrrr�assertRegexbs

�zTestCase.assertRegexcCs`t|ttf�rt�|�}|�|�}|r\d||��|���|j|f}|�	||�}|�
|��dS)z9Fail the test if the text matches the regular expression.z"Regex matched: %r matches %r in %rN)r;r rZr\r]rp�start�endrqrVrX)rr\Zunexpected_regexrW�matchrYrrr�assertNotRegexns

�zTestCase.assertNotRegexcs�fdd�}|S)Ncs t�d��j�td��||�S)NzPlease use {0} instead.r�)r�r�rlrr�r7��
original_funcrr�deprecated_func~s
�z,TestCase._deprecate.<locals>.deprecated_funcr)rcrdrrbr�
_deprecate}szTestCase._deprecate)r�)N)N)N)N)NN)N)N)N)NNN)NNN)NN)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)errr
rr[rXrr0rJZ_classSetupFailedr�rr�r��__text_signature__�classmethodr�r�r�r�r�r�r�r�r�r�r�r�r�r�r'r(�_subtest_msg_sentinelr�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrVrrrrrrrrrr/r+r�r�r�r:r;r=r>r�rDrHr�rNrOrPrQrSrTr?rWrXrYr]rareZfailUnlessEqualZassertEqualsZfailIfEqualZassertNotEqualsZfailUnlessAlmostEqualZassertAlmostEqualsZfailIfAlmostEqualZassertNotAlmostEqualsZ
failUnlessZassert_ZfailUnlessRaisesZfailIfZassertRaisesRegexpZassertRegexpMatchesZassertNotRegexpMatchesrrrrr�ws� 
 


	


E

	


!



	�
-�
#
c


+






 










	r�csjeZdZdZd�fdd�	Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
�ZS)�FunctionTestCaseaIA test case that wraps a test function.

    This is useful for slipping pre-existing test functions into the
    unittest framework. Optionally, set-up and tidy-up functions can be
    supplied. As with TestCase, the tidy-up ('tearDown') function will
    always be called if the set-up ('setUp') function ran successfully.
    Ncs*tt|���||_||_||_||_dSr))�superrir�
_setUpFunc�
_tearDownFunc�	_testFunc�_description)rZtestFuncr�r�Zdescription�r�rrr�s
zFunctionTestCase.__init__cCs|jdk	r|��dSr))rkrirrrr��s
zFunctionTestCase.setUpcCs|jdk	r|��dSr))rlrirrrr��s
zFunctionTestCase.tearDowncCs|��dSr))rmrirrrr��szFunctionTestCase.runTestcCs|jjSr))rmrrirrrr��szFunctionTestCase.idcCs@t||j�stS|j|jko>|j|jko>|j|jko>|j|jkSr))r;r�r�rkrlrmrnr�rrrr��s
�
�
�zFunctionTestCase.__eq__cCstt|�|j|j|j|jf�Sr))r�r<rkrlrmrnrirrrr��s�zFunctionTestCase.__hash__cCsdt|j�|jjfSr�)rr�rmrrirrrr��s
�zFunctionTestCase.__str__cCsdt|j�|jfS)Nz<%s tec=%s>)rr�rmrirrrr��s
�zFunctionTestCase.__repr__cCs2|jdk	r|jS|jj}|r.|�d�d��p0dS)Nr�r)rnrmrr�r�r�rrrr��s
z!FunctionTestCase.shortDescription)NNN)rrr
rrr�r�r�r�r�r�r�r�r��
__classcell__rrrorri�s	ricsDeZdZ�fdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Z�Z	S)
r�cs(t���||_||_||_|j|_dSr))rjr�_messager#r�rX)rr#r�r�rorrr�s

z_SubTest.__init__cCstd��dS)Nzsubtests cannot be run directly)r rirrrr��sz_SubTest.runTestcCs^g}|jtk	r |�d�|j��|jrPd�dd�|j��D��}|�d�|��d�|�p\dS)Nz[{}]z, css|]\}}d�||�VqdS)z{}={!r}N)rl)rMr�r�rrrrP�s�z+_SubTest._subDescription.<locals>.<genexpr>z({})� z(<subtest>))rqrhrrlr�r%rA)r�partsZparams_descrrr�_subDescription�s

�z_SubTest._subDescriptioncCsd�|j��|���S�Nz{} {})rlr#r�rtrirrrr��sz_SubTest.idcCs
|j��S)zlReturns a one-line description of the subtest, or None if no
        description has been provided.
        )r#r�rirrrr��sz_SubTest.shortDescriptioncCsd�|j|���Sru)rlr#rtrirrrr��sz_SubTest.__str__)
rrr
rr�rtr�r�r�rprrrorr��sr�)4rr!r=r&r�r(r\r�rFr'rmrDrCr�utilrrrrrZ
__unittest�objectrhr1r2r	rrrr+r,r0r5rFrIrJrrLrUr[rhrx�
namedtupler�r�r�r��ChainMapr�r�rir�rrrr�<module>sd(	*%5�,
$:unittest/__pycache__/__main__.cpython-38.opt-2.pyc000064400000000560151153537550015756 0ustar00U

e5d��@s\ddlZejd�d�r>ddlZej�ej�Zedejd<[dZddl	m	Z	e	dd�dS)�Nz__main__.pyz -m unittestT�)�main)�module)
�sys�argv�endswithZos.path�os�path�basename�
executableZ
__unittestr�rr�)/usr/lib64/python3.8/unittest/__main__.py�<module>sunittest/__pycache__/runner.cpython-38.opt-1.pyc000064400000015552151153537550015555 0ustar00U

e5dW�@sndZddlZddlZddlZddlmZddlmZdZGdd�de	�Z
Gd	d
�d
ej�ZGdd�de	�Z
dS)
z
Running tests�N�)�result)�registerResultTc@s*eZdZdZdd�Zdd�Zd	dd�ZdS)
�_WritelnDecoratorz@Used to decorate file-like objects with a handy 'writeln' methodcCs
||_dS�N)�stream)�selfr�r	�'/usr/lib64/python3.8/unittest/runner.py�__init__sz_WritelnDecorator.__init__cCs|dkrt|��t|j|�S)N)r�__getstate__)�AttributeError�getattrr)r�attrr	r	r
�__getattr__sz_WritelnDecorator.__getattr__NcCs|r|�|�|�d�dS�N�
)�write)r�argr	r	r
�writelns
z_WritelnDecorator.writeln)N)�__name__�
__module__�__qualname__�__doc__rrrr	r	r	r
r
srcs�eZdZdZdZdZ�fdd�Zdd�Z�fdd	�Z�fd
d�Z	�fdd
�Z
�fdd�Z�fdd�Z�fdd�Z
�fdd�Zdd�Zdd�Z�ZS)�TextTestResultzhA test result class that can print formatted text results to a stream.

    Used by TextTestRunner.
    zF======================================================================zF----------------------------------------------------------------------cs8tt|��|||�||_|dk|_|dk|_||_dS)Nr)�superrrr�showAll�dots�descriptions)rrr�	verbosity��	__class__r	r
r%s


zTextTestResult.__init__cCs0|��}|jr$|r$d�t|�|f�St|�SdSr)ZshortDescriptionr�join�str)r�testZdoc_first_liner	r	r
�getDescription,s
zTextTestResult.getDescriptioncsBtt|��|�|jr>|j�|�|��|j�d�|j��dS)Nz ... )rr�	startTestrrrr%�flush�rr$r r	r
r&3s
zTextTestResult.startTestcsDtt|��|�|jr$|j�d�n|jr@|j�d�|j��dS)N�ok�.)	rr�
addSuccessrrrrrr'r(r r	r
r+:szTextTestResult.addSuccesscsFtt|��||�|jr&|j�d�n|jrB|j�d�|j��dS)N�ERROR�E)	rr�addErrorrrrrrr'�rr$�errr r	r
r.BszTextTestResult.addErrorcsFtt|��||�|jr&|j�d�n|jrB|j�d�|j��dS)N�FAIL�F)	rr�
addFailurerrrrrr'r/r r	r
r3JszTextTestResult.addFailurecsLtt|��||�|jr,|j�d�|��n|jrH|j�d�|j�	�dS)Nz
skipped {0!r}�s)
rr�addSkiprrr�formatrrr')rr$�reasonr r	r
r5RszTextTestResult.addSkipcsFtt|��||�|jr&|j�d�n|jrB|j�d�|j��dS)Nzexpected failure�x)	rr�addExpectedFailurerrrrrr'r/r r	r
r9Zsz!TextTestResult.addExpectedFailurecsDtt|��|�|jr$|j�d�n|jr@|j�d�|j��dS)Nzunexpected success�u)	rr�addUnexpectedSuccessrrrrrr'r(r r	r
r;bsz#TextTestResult.addUnexpectedSuccesscCs6|js|jr|j��|�d|j�|�d|j�dS)Nr,r1)rrrr�printErrorList�errors�failures�rr	r	r
�printErrorsjs
zTextTestResult.printErrorscCsX|D]N\}}|j�|j�|j�d||�|�f�|j�|j�|j�d|�qdS)Nz%s: %sz%s)rr�
separator1r%�
separator2)rZflavourr=r$r0r	r	r
r<ps
zTextTestResult.printErrorList)rrrrrArBrr%r&r+r.r3r5r9r;r@r<�
__classcell__r	r	r r
rsrc@s4eZdZdZeZd
dd�dd�Zd	d
�Zdd�ZdS)�TextTestRunnerz�A test runner class that displays results in textual form.

    It prints out the names of tests as they are run, errors as they
    occur, and a summary of the results at the end of the test run.
    NTrF)�	tb_localsc	CsN|dkrtj}t|�|_||_||_||_||_||_||_	|dk	rJ||_
dS)z�Construct a TextTestRunner.

        Subclasses should accept **kwargs to ensure compatibility as the
        interface changes.
        N)�sys�stderrrrrr�failfast�bufferrE�warnings�resultclass)	rrrrrHrIrKrJrEr	r	r
r�s
zTextTestRunner.__init__cCs|�|j|j|j�Sr)rKrrrr?r	r	r
�_makeResult�szTextTestRunner._makeResultcCs2|��}t|�|j|_|j|_|j|_t����|jr^t�|j�|jdkr^tjdt	dd�t
��}t|dd�}|dk	r�|�z||�W5t|dd�}|dk	r�|�Xt
��}W5QRX||}|�
�t|d�r�|j�|j�|j}|j�d	||d
ko�d�pd|f�|j��d
}	}
}ztt|j|j|jf�}Wntk
�rTYnX|\}	}
}g}
|���s�|j�d�t|j�t|j�}}|�r�|
�d|�|�r�|
�d|�n|j�d�|�r�|
�d|�|	�r�|
�d|	�|
�r|
�d|
�|
�r"|j�dd�|
�f�n|j�d�|S)z&Run the given test case or test suite.)�default�always�modulezPlease use assert\w+ instead.)�category�message�startTestRunN�stopTestRunrBzRan %d test%s in %.3fsrr4�rZFAILEDzfailures=%dz	errors=%dZOKz
skipped=%dzexpected failures=%dzunexpected successes=%dz (%s)z, r)rLrrHrIrErJ�catch_warnings�simplefilter�filterwarnings�DeprecationWarning�time�perf_counterrr@�hasattrrrrBZtestsRun�map�lenZexpectedFailures�unexpectedSuccesses�skippedr
Z
wasSuccessfulrr>r=�appendr")rr$rZ	startTimerRrSZstopTimeZ	timeTaken�runZ
expectedFailsr^r_ZresultsZinfosZfailedZerroredr	r	r
ra�sx

�
�
�


zTextTestRunner.run)NTrFFNN)	rrrrrrKrrLrar	r	r	r
rDxs��rD)rrFrYrJrTrZsignalsrZ
__unittest�objectrZ
TestResultrrDr	r	r	r
�<module>s[unittest/__pycache__/main.cpython-38.opt-2.pyc000064400000016276151153537550015175 0ustar00U

e5d�+�@spddlZddlZddlZddlmZmZddlmZdZdZ	dZ
dd	�Zd
d�Zdd
�Z
Gdd�de�ZeZdS)�N�)�loader�runner)�installHandlerTaExamples:
  %(prog)s test_module               - run tests from test_module
  %(prog)s module.TestClass          - run tests from module.TestClass
  %(prog)s module.Class.test_method  - run specified test method
  %(prog)s path/to/test_file.py      - run tests from test_file.py
aFExamples:
  %(prog)s                           - run default set of tests
  %(prog)s MyTestSuite               - run suite 'MyTestSuite'
  %(prog)s MyTestCase.testSomething  - run MyTestCase.testSomething
  %(prog)s MyTestCase                - run all 'test*' test methods
                                       in MyTestCase
cCsxtj�|�rt|���d�rttj�|�rXtj�|t���}tj�|�sP|�tj	�rT|S|}|dd��
dd��
dd�S|S)Nz.py����\�.�/)�os�path�isfile�lower�endswith�isabs�relpath�getcwd�
startswith�pardir�replace)�nameZrel_path�r�%/usr/lib64/python3.8/unittest/main.py�
_convert_namesrcCsdd�|D�S)NcSsg|]}t|��qSr)r)�.0rrrr�
<listcomp>.sz"_convert_names.<locals>.<listcomp>r)�namesrrr�_convert_names-srcCsd|krd|}|S)N�*z*%s*r)�patternrrr�_convert_select_pattern1src@s�eZdZdZdZdZZZZZ	Z
dZddddej
ddddddfdd�dd�Zdd	d
�Zdd�Zd
d�Zddd�Zdd�Zdd�Zdd�Zdd�Zddd�Zdd�ZdS) �TestProgramNr�__main__TF)�	tb_localscCs�t|t�r<t|�|_|�d�dd�D]}
t|j|
�|_q&n||_|dkrPtj}||_||_	|	|_
||_|
|_||_
|dkr�tjs�d|_n||_||_||_||_tj�|d�|_|�|�|��dS)Nrr�defaultr)�
isinstance�str�
__import__�module�split�getattr�sys�argv�exit�failfast�
catchbreak�	verbosity�bufferr"�warnoptions�warnings�defaultTest�
testRunner�
testLoaderr
r�basename�progName�	parseArgs�runTests)�selfr'r3r+r4r5r,r/r-r.r0r2r"�partrrr�__init__As,


zTestProgram.__init__cCs4|rt|�|jdkr|��|��t�d�dS)N�)�print�_discovery_parser�_initArgParsers�_print_helpr*r,)r:�msgrrr�	usageExitgs
zTestProgram.usageExitcOsZ|jdkr6t|j���ttd|ji�|j��n t|j���ttd|ji�dS)N�prog)	r'r>�_main_parserZformat_help�
MAIN_EXAMPLESr7r?�
print_help�MODULE_EXAMPLES)r:�args�kwargsrrrrAos
zTestProgram._print_helpcCs�|��|jdkrpt|�dkrD|d��dkrD|�|dd��dS|j�|dd�|�|js�|�g�dSn|j�|dd�|�|jr�t|j�|_	t
dkr�d|_n6|jdkr�d|_	n$t|jt
�r�|jf|_	nt|j�|_	|��dS)Nr�discoverr=r!)r@r'�lenr
�
_do_discoveryrE�
parse_args�testsr�	testNames�__name__r3r$r%�list�createTests)r:r+rrrr8xs(


zTestProgram.parseArgscCst|jr|j|j_|r@|dkr"|jn|�}|�|j|j|j�|_n0|jdkr\|j�|j	�|_n|j�
|j|j	�|_dS�N)�testNamePatternsr5rK�startr�top�testrPZloadTestsFromModuler'ZloadTestsFromNames)r:�from_discovery�LoaderrrrrrS�s


�zTestProgram.createTestscCs$|��}|�|�|_|�|�|_dSrT)�_getParentArgParser�_getMainArgParserrE�_getDiscoveryArgParserr?)r:Z
parent_parserrrrr@�szTestProgram._initArgParserscCs�tjdd�}|jddddddd	�|jd
ddddd
d	�|jddddd�|jdkrn|jdddddd�d|_|jdkr�|jdddddd�d|_|jdkr�|jdddddd�d|_|jdkr�|jdd d!td"d#�g|_|S)$NF)Zadd_helpz-vz	--verboser/Zstore_constr=zVerbose output)�dest�actionZconst�helpz-qz--quietrzQuiet outputz--localsr"�
store_truez"Show local variables in tracebacks)r^r_r`z-fz
--failfastr-zStop on first fail or errorz-cz--catchr.z'Catch Ctrl-C and display results so farz-bz--bufferr0z%Buffer stdout and stderr during testsz-krU�appendz.Only run tests which match the given substring)r^r_�typer`)�argparse�ArgumentParser�add_argumentr-r.r0rUr)r:�parserrrrr[�sR
�
��

�

�

�
�zTestProgram._getParentArgParsercCs2tj|gd�}|j|_|j|_|jdddd�|S)N��parentsrOrz?a list of any number of test modules, classes and test methods.)�nargsr`)rdrer7rDrArGrf)r:�parentrgrrrr\�s�zTestProgram._getMainArgParsercCsztj|gd�}d|j|_d|_|jddddd�|jd	d
ddd�|jd
dddd�dD]}|j|dtjtjd�qZ|S)Nrhz%s discoverzcFor test discovery all test modules must be importable from the top level directory of the project.z-sz--start-directoryrVz*Directory to start discovery ('.' default))r^r`z-pz	--patternrz+Pattern to match tests ('test*.py' default)z-tz--top-level-directoryrWz<Top level directory of project (defaults to start directory))rVrrW�?)rjr#r`)rdrer7rDZepilogrfZSUPPRESS)r:rkrg�argrrrr]�s$
�
�
��z"TestProgram._getDiscoveryArgParsercCsLd|_d|_d|_|dk	r:|jdkr,|��|j�||�|jd|d�dS)Nrztest*.pyT)rYrZ)rVrrWr?r@rNrS)r:r+rZrrrrM�s
zTestProgram._do_discoveryc	Cs�|jrt�|jdkrtj|_t|jt�r�zVz"|j|j|j|j	|j
|jd�}Wn.tk
r||j|j|j|j	|j
d�}YnXWq�tk
r�|��}Yq�Xn|j}|�
|j�|_|jr�t�|j���dS)N)r/r-r0r2r")r/r-r0r2)r.rr4rZTextTestRunnerr$rcr/r-r0r2r"�	TypeError�runrX�resultr,r*Z
wasSuccessful)r:r4rrrr9�s2
�
�zTestProgram.runTests)N)FN)N)rQ�
__module__�__qualname__r'r/r-r.r0r7r2rUr?rZdefaultTestLoaderr<rCrAr8rSr@r[r\r]rMr9rrrrr 7s4��&
	
#

r )r*rdr
�rrZsignalsrZ
__unittestrFrHrrr�objectr �mainrrrr�<module>s	]unittest/__pycache__/suite.cpython-38.opt-1.pyc000064400000023321151153537550015366 0ustar00U

e5d2�@s|dZddlZddlmZddlmZdZdd�ZGd	d
�d
e�ZGdd�de�Z	Gdd
�d
e�Z
dd�ZGdd�de�ZdS)�	TestSuite�N�)�case)�utilTcCst||dd��}|�dS)NcSsdS�N�rrr�&/usr/lib64/python3.8/unittest/suite.py�<lambda>�z!_call_if_exists.<locals>.<lambda>)�getattr)�parent�attr�funcrrr�_call_if_existssrc@sneZdZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)�
BaseTestSuitezNA simple test suite that doesn't provide class or module shared fixtures.
    TrcCsg|_d|_|�|�dS�Nr)�_tests�_removed_tests�addTests)�self�testsrrr�__init__szBaseTestSuite.__init__cCsdt�|j�t|�fS)Nz
<%s tests=%s>)r�strclass�	__class__�list�rrrr�__repr__szBaseTestSuite.__repr__cCs t||j�stSt|�t|�kSr)�
isinstancer�NotImplementedr)r�otherrrr�__eq__szBaseTestSuite.__eq__cCs
t|j�Sr)�iterrrrrr�__iter__"szBaseTestSuite.__iter__cCs$|j}|D]}|r
||��7}q
|Sr)r�countTestCases)rZcases�testrrrr#%s
zBaseTestSuite.countTestCasescCsLt|�std�t|����t|t�r<t|tjt	f�r<td��|j
�|�dS)Nz{} is not callablezNTestCases and TestSuites must be instantiated before passing them to addTest())�callable�	TypeError�format�reprr�type�
issubclassrZTestCaserr�append�rr$rrr�addTest,s�zBaseTestSuite.addTestcCs*t|t�rtd��|D]}|�|�qdS)Nz0tests must be an iterable of tests, not a string)r�strr&r-)rrr$rrrr6s
zBaseTestSuite.addTestscCs8t|�D]*\}}|jrq4||�|jr|�|�q|Sr)�	enumerate�
shouldStop�_cleanup�_removeTestAtIndex)r�result�indexr$rrr�run<szBaseTestSuite.runcCsNz|j|}Wntk
r"Yn(Xt|d�r@|j|��7_d|j|<dS)z2Stop holding a reference to the TestCase at index.r#N)rr&�hasattrrr#)rr4r$rrrr2Es
z BaseTestSuite._removeTestAtIndexcOs|j||�Sr�r5)r�args�kwdsrrr�__call__SszBaseTestSuite.__call__cCs|D]}|��qdS)�7Run the tests without collecting errors in a TestResultN)�debugr,rrrr<VszBaseTestSuite.debugN)r)�__name__�
__module__�__qualname__�__doc__r1rrr r"r#r-rr5r2r:r<rrrrrs

	rc@s^eZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zddd�Z	ddd�Z
dd�Zdd�Zd
S)ra�A test suite is a composite test consisting of a number of TestCases.

    For use, create an instance of TestSuite, then add test case instances.
    When all tests have been added, the suite can be passed to a test
    runner, such as TextTestRunner. It will run the individual test cases
    in the order in which they were added, aggregating the results. When
    subclassing, do not forget to call the base class constructor.
    FcCs�d}t|dd�dkrd|_}t|�D]�\}}|jr8q�t|�r�|�||�|�||�|�||�|j|_	t|jdd�s&t|dd�r�q&|s�||�n|�
�|jr&|�|�q&|r�|�d|�|�
|�d|_|S)NF�_testRunEnteredT�_classSetupFailed�_moduleSetUpFailed)rrAr/r0�_isnotsuite�_tearDownPreviousClass�_handleModuleFixture�_handleClassSetUpr�_previousTestClassr<r1r2�_handleModuleTearDown)rr3r<ZtopLevelr4r$rrrr5fs2

�

z
TestSuite.runcCst�}|�|d�dS)r;TN)�_DebugResultr5)rr<rrrr<�szTestSuite.debugc	Cs2t|dd�}|j}||krdS|jr(dSt|dd�r8dSz
d|_Wntk
rVYnXt|dd�}|dk	�r.t|d�z^z
|�WnNt
k
r�}z0t|t�r��d|_t
�|�}|�	||d|�W5d}~XYnXW5t|d�|jdk�r,|��t|j�dk�r,|jD]}|j	||d	d||d
��qXdS)NrH�__unittest_skip__F�
setUpClass�_setupStdout�_restoreStdoutTrr��info)rrrCrBr&r�doClassCleanups�len�tearDown_exceptions�"_createClassOrModuleLevelException�	ExceptionrrJrr)	rr$r3�
previousClass�currentClassrL�exc�	className�errrrG�sL





�

�zTestSuite._handleClassSetUpcCs"d}t|dd�}|dk	r|j}|S)NrH)rr>)rr3�previousModulerVrrr�_get_previous_module�s
zTestSuite._get_previous_modulec	
Cs|�|�}|jj}||krdS|�|�d|_ztj|}Wntk
rRYdSXt|dd�}|dk	�rt	|d�z�z
|�Wn�t
k
�r}zfzt��Wn2t
k
r�}z|�
||d|�W5d}~XYnXt|t�r�d|_|�
||d|�W5d}~XYnXW5t	|d�XdS)NF�setUpModulerMrNT)r\rr>rIrC�sys�modules�KeyErrorrrrUr�doModuleCleanupsrTrrJ)	rr$r3r[Z
currentModule�moduler]rZrXrrrrF�s>




�
�zTestSuite._handleModuleFixtureNcCs$|�d|�d�}|�||||�dS)Nz (�))�_addClassOrModuleLevelException)rr3rXZmethod_namerrP�	errorNamerrrrT�sz,TestSuite._createClassOrModuleLevelExceptioncCs^t|�}t|dd�}|dk	r8t|tj�r8||t|��n"|sN|�|t���n|�||�dS)N�addSkip)	�_ErrorHolderrrrZSkipTestr.ZaddErrorr^�exc_info)rr3Z	exceptionrerP�errorrfrrrrd�sz)TestSuite._addClassOrModuleLevelExceptioncCs|�|�}|dkrdS|jr dSztj|}Wntk
rDYdSXt|dd�}|dk	�rt|d�zNz
|�Wn>t	k
r�}z t|t�r��|�
||d|�W5d}~XYnXW5t|d�zt��Wn4t	k
�r}z|�
||d|�W5d}~XYnXXdS)N�tearDownModulerMrN)
r\rCr^r_r`rrrrarUrTrrJ)rr3r[rbrjrZrrrrI�s:




�
�zTestSuite._handleModuleTearDownc	Cst|dd�}|j}||krdSt|dd�r.dSt|dd�r>dSt|dd�rNdSt|dd�}|dk	�rt|d�zXz
|�WnHt	k
r�}z*t
|t�r��t�|�}|�||d|�W5d}~XYnXW5t|d�|��t|j�d	k�r|jD]&}t�|�}|j||d
d||d�q�XdS)NrHrBFrCrK�
tearDownClassrMrNrrrO)rrrrQrRrSrrrTrUrrJ)	rr$r3rVrWrkrXrYrZrrrrEsB




�


�z TestSuite._tearDownPreviousClass)F)N)N)
r=r>r?r@r5r<rGr\rFrTrdrIrErrrrr\s	
!($�
�
 c@sTeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�ZdS)rgz�
    Placeholder for a TestCase inside a result. As far as a TestResult
    is concerned, this looks exactly like a unit test. Used to insert
    arbitrary errors into a test suite run.
    NcCs
||_dSr��description)rrmrrrrBsz_ErrorHolder.__init__cCs|jSrrlrrrr�idEsz_ErrorHolder.idcCsdSrrrrrr�shortDescriptionHsz_ErrorHolder.shortDescriptioncCsd|jfS)Nz<ErrorHolder description=%r>rlrrrrrKsz_ErrorHolder.__repr__cCs|��Sr)rnrrrr�__str__Nsz_ErrorHolder.__str__cCsdSrr�rr3rrrr5Qsz_ErrorHolder.runcCs
|�|�Srr7rqrrrr:Vsz_ErrorHolder.__call__cCsdSrrrrrrr#Ysz_ErrorHolder.countTestCases)
r=r>r?r@ZfailureExceptionrrnrorrpr5r:r#rrrrrg6s	rgcCs(zt|�Wntk
r"YdSXdS)z?A crude way to tell apart testcases and suites with duck-typingTF)r!r&)r$rrrrD\s
rDc@seZdZdZdZdZdZdS)rJzCUsed by the TestSuite to hold previous class when running in debug.NF)r=r>r?r@rHrCr0rrrrrJesrJ)
r@r^�rrZ
__unittestr�objectrrrgrDrJrrrr�<module>sL[&	unittest/__pycache__/main.cpython-38.opt-1.pyc000064400000016560151153537550015170 0ustar00U

e5d�+�@stdZddlZddlZddlZddlmZmZddlmZdZ	dZ
dZd	d
�Zdd�Z
d
d�ZGdd�de�ZeZdS)zUnittest main program�N�)�loader�runner)�installHandlerTaExamples:
  %(prog)s test_module               - run tests from test_module
  %(prog)s module.TestClass          - run tests from module.TestClass
  %(prog)s module.Class.test_method  - run specified test method
  %(prog)s path/to/test_file.py      - run tests from test_file.py
aFExamples:
  %(prog)s                           - run default set of tests
  %(prog)s MyTestSuite               - run suite 'MyTestSuite'
  %(prog)s MyTestCase.testSomething  - run MyTestCase.testSomething
  %(prog)s MyTestCase                - run all 'test*' test methods
                                       in MyTestCase
cCsxtj�|�rt|���d�rttj�|�rXtj�|t���}tj�|�sP|�tj	�rT|S|}|dd��
dd��
dd�S|S)Nz.py����\�.�/)�os�path�isfile�lower�endswith�isabs�relpath�getcwd�
startswith�pardir�replace)�nameZrel_path�r�%/usr/lib64/python3.8/unittest/main.py�
_convert_namesrcCsdd�|D�S)NcSsg|]}t|��qSr)r)�.0rrrr�
<listcomp>.sz"_convert_names.<locals>.<listcomp>r)�namesrrr�_convert_names-srcCsd|krd|}|S)N�*z*%s*r)�patternrrr�_convert_select_pattern1src@s�eZdZdZdZdZdZZZZ	Z
ZdZdddde
jddddddfdd�dd	�Zdd
d�Zdd
�Zdd�Zddd�Zdd�Zdd�Zdd�Zdd�Zd dd�Zdd�ZdS)!�TestProgramzA command-line program that runs a set of tests; this is primarily
       for making test modules conveniently executable.
    Nr�__main__TF)�	tb_localscCs�t|t�r<t|�|_|�d�dd�D]}
t|j|
�|_q&n||_|dkrPtj}||_||_	|	|_
||_|
|_||_
|dkr�tjs�d|_n||_||_||_||_tj�|d�|_|�|�|��dS)Nrr�defaultr)�
isinstance�str�
__import__�module�split�getattr�sys�argv�exit�failfast�
catchbreak�	verbosity�bufferr"�warnoptions�warnings�defaultTest�
testRunner�
testLoaderr
r�basename�progName�	parseArgs�runTests)�selfr'r3r+r4r5r,r/r-r.r0r2r"�partrrr�__init__As,


zTestProgram.__init__cCs4|rt|�|jdkr|��|��t�d�dS)N�)�print�_discovery_parser�_initArgParsers�_print_helpr*r,)r:�msgrrr�	usageExitgs
zTestProgram.usageExitcOsZ|jdkr6t|j���ttd|ji�|j��n t|j���ttd|ji�dS)N�prog)	r'r>�_main_parserZformat_help�
MAIN_EXAMPLESr7r?�
print_help�MODULE_EXAMPLES)r:�args�kwargsrrrrAos
zTestProgram._print_helpcCs�|��|jdkrpt|�dkrD|d��dkrD|�|dd��dS|j�|dd�|�|js�|�g�dSn|j�|dd�|�|jr�t|j�|_	t
dkr�d|_n6|jdkr�d|_	n$t|jt
�r�|jf|_	nt|j�|_	|��dS)Nr�discoverr=r!)r@r'�lenr
�
_do_discoveryrE�
parse_args�testsr�	testNames�__name__r3r$r%�list�createTests)r:r+rrrr8xs(


zTestProgram.parseArgscCst|jr|j|j_|r@|dkr"|jn|�}|�|j|j|j�|_n0|jdkr\|j�|j	�|_n|j�
|j|j	�|_dS�N)�testNamePatternsr5rK�startr�top�testrPZloadTestsFromModuler'ZloadTestsFromNames)r:�from_discovery�LoaderrrrrrS�s


�zTestProgram.createTestscCs$|��}|�|�|_|�|�|_dSrT)�_getParentArgParser�_getMainArgParserrE�_getDiscoveryArgParserr?)r:Z
parent_parserrrrr@�szTestProgram._initArgParserscCs�tjdd�}|jddddddd	�|jd
ddddd
d	�|jddddd�|jdkrn|jdddddd�d|_|jdkr�|jdddddd�d|_|jdkr�|jdddddd�d|_|jdkr�|jdd d!td"d#�g|_|S)$NF)Zadd_helpz-vz	--verboser/Zstore_constr=zVerbose output)�dest�actionZconst�helpz-qz--quietrzQuiet outputz--localsr"�
store_truez"Show local variables in tracebacks)r^r_r`z-fz
--failfastr-zStop on first fail or errorz-cz--catchr.z'Catch Ctrl-C and display results so farz-bz--bufferr0z%Buffer stdout and stderr during testsz-krU�appendz.Only run tests which match the given substring)r^r_�typer`)�argparse�ArgumentParser�add_argumentr-r.r0rUr)r:�parserrrrr[�sR
�
��

�

�

�
�zTestProgram._getParentArgParsercCs2tj|gd�}|j|_|j|_|jdddd�|S)N��parentsrOrz?a list of any number of test modules, classes and test methods.)�nargsr`)rdrer7rDrArGrf)r:�parentrgrrrr\�s�zTestProgram._getMainArgParsercCsztj|gd�}d|j|_d|_|jddddd�|jd	d
ddd�|jd
dddd�dD]}|j|dtjtjd�qZ|S)Nrhz%s discoverzcFor test discovery all test modules must be importable from the top level directory of the project.z-sz--start-directoryrVz*Directory to start discovery ('.' default))r^r`z-pz	--patternrz+Pattern to match tests ('test*.py' default)z-tz--top-level-directoryrWz<Top level directory of project (defaults to start directory))rVrrW�?)rjr#r`)rdrer7rDZepilogrfZSUPPRESS)r:rkrg�argrrrr]�s$
�
�
��z"TestProgram._getDiscoveryArgParsercCsLd|_d|_d|_|dk	r:|jdkr,|��|j�||�|jd|d�dS)Nrztest*.pyT)rYrZ)rVrrWr?r@rNrS)r:r+rZrrrrM�s
zTestProgram._do_discoveryc	Cs�|jrt�|jdkrtj|_t|jt�r�zVz"|j|j|j|j	|j
|jd�}Wn.tk
r||j|j|j|j	|j
d�}YnXWq�tk
r�|��}Yq�Xn|j}|�
|j�|_|jr�t�|j���dS)N)r/r-r0r2r")r/r-r0r2)r.rr4rZTextTestRunnerr$rcr/r-r0r2r"�	TypeError�runrX�resultr,r*Z
wasSuccessful)r:r4rrrr9�s2
�
�zTestProgram.runTests)N)FN)N)rQ�
__module__�__qualname__�__doc__r'r/r-r.r0r7r2rUr?rZdefaultTestLoaderr<rCrAr8rSr@r[r\r]rMr9rrrrr 7s6��&
	
#

r )rsr*rdr
�rrZsignalsrZ
__unittestrFrHrrr�objectr �mainrrrr�<module>s	]unittest/__pycache__/mock.cpython-38.opt-2.pyc000064400000161575151153537550015205 0ustar00U

e5d��@s�dZdZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
mZmZddl
mZddlmZmZdd�ee�D�Zd	ZeZd
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Zd�dd�Zdd�Zdd�Zdd�Z dd �Z!d�d!d"�Z"d#d$�Z#d%d&�Z$d'd(�Z%Gd)d*�d*e&�Z'Gd+d,�d,e&�Z(e(�Z)e)j*Z*e)j+Z,e)j-Z.d-d.d/d0d1d2d3d4hZ/d5d6�Z0Gd7d8�d8e1�Z2d9d:�Z3Gd;d<�d<e&�Z4Gd=d>�d>e&�Z5Gd?d@�d@e5�Z6dAdB�Z7GdCdD�dDe5�Z8GdEdF�dFe8e6�Z9dGdH�Z:dIdJ�Z;GdKdL�dLe&�Z<dMdN�Z=e*dddddfdOdP�Z>d�dQdR�Z?e*dddddfdSdT�Z@GdUdV�dVe&�ZAdWdX�ZBdYdZ�ZCe>e@_&eAe@_De?e@_EeCe@_Fd[e@_Gd\ZHd]ZId^�Jd_d`�eI�K�D��ZLd^�Jdad`�eI�K�D��ZMdbdcdddedfdgdhdidjdkdldmdndodpdqdrdshZNdtdu�ZOdvd�d^�JeHeIeLeMg��K�D�ZPdwdxdyhZQdzhZReQeRBZSePeNBZTeTeSBZUd{d|d}d~dd�d�d�hZVd�d��d�d��d�d��d�d��d��ZWeXeXeXeXd�dddd�d�d	d�dd��
ZYd�d��ZZd�d��Z[d�d��Z\d�d��Z]eZe[e\e]d��Z^d�d��Z_Gd�d��d�e5�Z`Gd�d��d�e`e6�ZaGd�d��d�e`�ZbGd�d��d�e`e9�ZcGd�d��d�e5�ZdGd�d��d�e5�ZeGd�d��d�eeebe9�ZfGd�d��d�e&�Zgeg�Zhd�d��ZiGd�d��d�ej�Zkekdd��Zld�d�d��Zmd�d��ZnGd�d��d�e&�Zoepem�epehjq�fZrdasd�d��Ztd�d�d��ZuGd�d��d�e9�Zvd�d��ZwGd�d��d��ZxdS)�)�Mock�	MagicMock�patch�sentinel�DEFAULT�ANY�call�create_autospec�	AsyncMock�
FILTER_DIR�NonCallableMock�NonCallableMagicMock�	mock_open�PropertyMock�sealz1.0�N)�CodeType�
ModuleType�
MethodType)�	safe_repr)�wraps�partialcCsh|]}|�d�s|�qS��_��
startswith)�.0�name�r�%/usr/lib64/python3.8/unittest/mock.py�	<setcomp>(s
rTcCs>t|�rt|t�sdSt|d�r*t|d�}t�|�p<t�|�S)NF�__func__)	�_is_instance_mock�
isinstancer	�hasattr�getattr�asyncio�iscoroutinefunction�inspectZisawaitable��objrrr�
_is_async_obj0s


r*cCst|dd�rt�|�SdSdS)N�__code__F)r$r%r&��funcrrr�_is_async_func8s
r.cCstt|�t�S�N)�
issubclass�typerr(rrrr!?sr!cCst|t�pt|t�ot|t�Sr/)r"�
BaseExceptionr1r0r(rrr�
_is_exceptionEs
�r3cCs"t|t�rt|d�r|jS|SdS�N�mock)r"�
FunctionTypesr#r5r(rrr�
_extract_mockLsr7cCs�t|t�r|s|j}d}n,t|t�sFz
|j}Wntk
rDYdSX|rVt|d�}n|}z|t�|�fWSt	k
r�YdSXdS�NT)
r"r1�__init__r6�__call__�AttributeErrorrr'�	signature�
ValueError)r-Zas_instanceZeat_selfZsig_funcrrr�_get_signature_objectUs

r>FcsNt|||���dkrdS�\}��fdd�}t||�|t|�_�t|�_dS)Ncs�j||�dSr/��bind��self�args�kwargs��sigrr�checksigwsz"_check_signature.<locals>.checksig)r>�_copy_func_detailsr1�_mock_check_sig�
__signature__)r-r5�	skipfirst�instancerGrrEr�_check_signaturers

rMc	Cs:dD]0}zt||t||��Wqtk
r2YqXqdS)N)�__name__�__doc__�__text_signature__�
__module__�__defaults__�__kwdefaults__)�setattrr$r;)r-�funcopy�	attributerrrrH~s
rHcCs@t|t�rdSt|tttf�r(t|j�St|dd�dk	r<dSdS)NTr:F)r"r1�staticmethod�classmethodr�	_callabler r$r(rrrrY�s

rYcCst|�ttfkSr/)r1�list�tupler(rrr�_is_list�sr\cCsFt|t�st|dd�dk	S|f|jD]}|j�d�dk	r&dSq&dS)Nr:TF)r"r1r$�__mro__�__dict__�get)r)�baserrr�_instance_callable�s
racs�t|t�}t|||�}|dkr"|S|\}��fdd�}t||�|j}|��sRd}||d�}d|}	t|	|�||}
t|
|��|
S)Ncs�j||�dSr/r?�rCrDrErrrG�sz _set_signature.<locals>.checksigrU)Z
_checksig_r5zYdef %s(*args, **kwargs):
    _checksig_(*args, **kwargs)
    return mock(*args, **kwargs))r"r1r>rHrN�isidentifier�exec�_setup_func)r5�originalrLrK�resultr-rGr�context�srcrUrrEr�_set_signature�s$


�
rjcs���_�fdd�}�fdd�}�fdd�}�fdd�}�fd	d
�}�fdd�}�fd
d�}	��fdd�}
d�_d�_d�_t��_t��_t��_�j�_�j	�_	�j
�_
|�_|�_|�_
|	�_|
�_|�_|�_|�_|�_��_dS)Ncs�j||�Sr/)�assert_called_withrb�r5rrrk�sz'_setup_func.<locals>.assert_called_withcs�j||�Sr/)�
assert_calledrbrlrrrm�sz"_setup_func.<locals>.assert_calledcs�j||�Sr/)�assert_not_calledrbrlrrrn�sz&_setup_func.<locals>.assert_not_calledcs�j||�Sr/)�assert_called_oncerbrlrrro�sz'_setup_func.<locals>.assert_called_oncecs�j||�Sr/)�assert_called_once_withrbrlrrrp�sz,_setup_func.<locals>.assert_called_once_withcs�j||�Sr/)�assert_has_callsrbrlrrrq�sz%_setup_func.<locals>.assert_has_callscs�j||�Sr/)�assert_any_callrbrlrrrr�sz$_setup_func.<locals>.assert_any_callcs:t��_t��_����j}t|�r6|�k	r6|��dSr/)�	_CallList�method_calls�
mock_calls�
reset_mock�return_valuer!)�ret�rUr5rrrv�sz_setup_func.<locals>.reset_mockFr)r5�called�
call_count�	call_argsrs�call_args_listrtrurw�side_effect�_mock_childrenrkrprqrrrvrmrnrorJ�_mock_delegate)rUr5rFrkrmrnrorprqrrrvrryrre�s8recsJtjj�_d�_d�_t��_�fdd�}dD]}t�|t||��q.dS)Nrcst�j|�||�Sr/)r$r5)�attrrCrDrlrr�wrapper�sz"_setup_async_mock.<locals>.wrapper)�assert_awaited�assert_awaited_once�assert_awaited_with�assert_awaited_once_with�assert_any_await�assert_has_awaits�assert_not_awaited)	r%�
coroutines�
_is_coroutine�await_count�
await_argsrs�await_args_listrTr)r5r�rVrrlr�_setup_async_mock�s
r�cCsd|dd�|kS)N�__%s__����r�rrrr�	_is_magicsr�c@s$eZdZdd�Zdd�Zdd�ZdS)�_SentinelObjectcCs
||_dSr/r��rBrrrrr9sz_SentinelObject.__init__cCs
d|jS�Nzsentinel.%sr��rBrrr�__repr__sz_SentinelObject.__repr__cCs
d|jSr�r�r�rrr�
__reduce__sz_SentinelObject.__reduce__N)rNrQ�__qualname__r9r�r�rrrrr�sr�c@s$eZdZdd�Zdd�Zdd�ZdS)�	_SentinelcCs
i|_dSr/)�
_sentinelsr�rrrr9#sz_Sentinel.__init__cCs|dkrt�|j�|t|��S)N�	__bases__)r;r��
setdefaultr�r�rrr�__getattr__&sz_Sentinel.__getattr__cCsdS)Nrrr�rrrr�,sz_Sentinel.__reduce__N)rNrQr�r9r�r�rrrrr�!sr�rw�_mock_return_valuer~�_mock_side_effect�_mock_parent�_mock_new_parent�
_mock_name�_mock_new_namecCs8t�|�d|}||fdd�}||fdd�}t||�S)NZ_mock_cSs"|j}|dkrt||�St||�Sr/)r�r$)rBr�	_the_namerFrrr�_getAs
z"_delegating_property.<locals>._getcSs*|j}|dkr||j|<nt|||�dSr/)r�r^rT)rB�valuerr�rFrrr�_setFsz"_delegating_property.<locals>._set)�_allowed_names�add�property)rr�r�r�rrr�_delegating_property>s

r�c@seZdZdd�Zdd�ZdS)rscCslt|t�st�||�St|�}t|�}||kr2dStd||d�D]"}||||�}||krDdSqDdS)NFr�T)r"rZ�__contains__�len�range)rBr�Z	len_valueZlen_self�iZsub_listrrrr�Ss
z_CallList.__contains__cCst�t|��Sr/)�pprintZpformatrZr�rrrr�asz_CallList.__repr__N)rNrQr�r�r�rrrrrsQsrscCs|t|�}t|�sdS|js4|js4|jdk	s4|jdk	r8dS|}|dk	rX||krPdS|j}q<|rh||_||_|rx||_||_dS)NFT)r7r!r�r�r�r�)�parentr�r�new_name�_parentrrr�_check_and_set_parentes*��r�c@seZdZdd�Zdd�ZdS)�	_MockItercCst|�|_dSr/)�iterr))rBr)rrrr9�sz_MockIter.__init__cCs
t|j�Sr/)�nextr)r�rrr�__next__�sz_MockIter.__next__N)rNrQr�r9r�rrrrr��sr�c@seZdZeZdZdd�ZdS)�BaseNcOsdSr/rrArrrr9�sz
Base.__init__)rNrQr�rr�r�r9rrrrr��sr�c@s`eZdZdd�ZdKdd�Zdd	�ZdLd
d�ZdMdd
�Zdd�Zdd�Z	dZ
eee	e
�Zedd��Z
ed�Zed�Zed�Zed�Zed�Zdd�Zdd�Zeee�ZdNddd�dd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�ZdOd2d3�Z d4d5�Z!d6d7�Z"d8d9�Z#d:d;�Z$d<d=�Z%d>d?�Z&d@dA�Z'dPdBdC�Z(dDdE�Z)dFdG�Z*dQdIdJ�Z+dS)Rrc	Os�|f}t|t�s^t�tj�}|j|f|�|�j}dd�|��D�}|r^t	||d�r^t
|f}t|j|d|j
i�}tt|��|�}|S)NcSsg|]}|�d�r|�qS��specr�r�argrrr�
<listcomp>�s
�z+NonCallableMock.__new__.<locals>.<listcomp>rrO)r0r	r'r<rr9Zbind_partialZ	arguments�keysr*�AsyncMockMixinr1rNrO�_safe_super�__new__)	�clsrC�kw�basesrFZ
bound_argsZspec_arg�newrLrrrr��s
�zNonCallableMock.__new__N�FcKs�|dkr|}|j}
||
d<||
d<||
d<||
d<d|
d<|dk	rJ|}d}|
dkrZ|dk	}
|�|||	|
�i|
d<||
d	<d|
d
<d|
d<d|
d<d
|
d<t�|
d<t�|
d<t�|
d<||
d<|r�|jf|�tt|��||||||�dS)Nr�r�r�r�F�_mock_sealedTr�_mock_wrapsr�Z_mock_calledZ_mock_call_argsrZ_mock_call_countZ_mock_call_args_listZ_mock_mock_callsrt�_mock_unsafe)r^�_mock_add_specrs�configure_mockr�rr9)rBr�rr�spec_setr��_spec_state�	_new_name�_new_parent�_spec_as_instance�	_eat_selfZunsaferDr^rrrr9�sD



�zNonCallableMock.__init__cCs0t|�}d|_d|_d|_d|_t|||�dS)Nr�)r7r�r�r�r�rT)rBr5rVZ
inner_mockrrr�attach_mock�szNonCallableMock.attach_mockcCs|�||�dSr/)r��rBr�r�rrr�
mock_add_spec�szNonCallableMock.mock_add_speccCs�d}d}g}t|�D] }t�t||d��r|�|�q|dk	r~t|�s~t|t�rV|}nt|�}t|||�}	|	ot|	d}t|�}|j	}
||
d<||
d<||
d<||
d<||
d<dS)Nr��_spec_class�	_spec_set�_spec_signature�
_mock_methods�_spec_asyncs)
�dirr%r&r$�appendr\r"r1r>r^)rBr�r�r�r�r�r�r�r��resr^rrrr��s,
�zNonCallableMock._mock_add_speccCs8|j}|jdk	r|jj}|tkr4|j|dd�}||_|S)N�()�r�r�)r�r�rwr�_get_child_mock)rBrxrrrZ__get_return_values
�z"NonCallableMock.__get_return_valuecCs,|jdk	r||j_n||_t||dd�dS)Nr�)r�rwr�r�)rBr�rrrZ__set_return_values

z"NonCallableMock.__set_return_valuez1The value to be returned when the mock is called.cCs|jdkrt|�S|jSr/)r�r1r�rrr�	__class__!s
zNonCallableMock.__class__rzr{r|r}rucCsN|j}|dkr|jS|j}|dk	rJt|�sJt|t�sJt|�sJt|�}||_|Sr/)r�r�r~�callabler"r�r3)rB�	delegatedZsfrrrZ__get_side_effect.s��z!NonCallableMock.__get_side_effectcCs(t|�}|j}|dkr||_n||_dSr/)�	_try_iterr�r�r~)rBr�r�rrrZ__set_side_effect9s
z!NonCallableMock.__set_side_effect)rwr~cCs�|dkrg}t|�|krdS|�t|��d|_d|_d|_t�|_t�|_t�|_|r^t	|_
|rhd|_|j�
�D]"}t|t�sr|tkr�qr|�|�qr|j
}t|�r�||k	r�|�|�dS)NFr)�idr�rzr|r{rsrur}rtrr�r�r�valuesr"�
_SpecState�_deletedrvr!)rBZvisitedrwr~�childrxrrrrvDs,zNonCallableMock.reset_mockcKsXt|��dd�d�D]>\}}|�d�}|��}|}|D]}t||�}q6t|||�qdS)NcSs|d�d�S)Nr�.)�count)�entryrrr�<lambda>o�z0NonCallableMock.configure_mock.<locals>.<lambda>)�keyr�)�sorted�items�split�popr$rT)rBrDr��valrC�finalr)r�rrrr�bs	�
zNonCallableMock.configure_mockcCs�|dkrt|��n:|jdk	r<||jks.|tkrLtd|��nt|�rLt|��|jsd|�d�rdtd��|j�|�}|tkr�t|��np|dkr�d}|j	dk	r�t
|j	|�}|j|||||d�}||j|<n.t|t
�r�t|j|j|j|j|j�}||j|<|S)N>r�r�zMock object has no attribute %r)�assertZassretz1Attributes cannot start with 'assert' or 'assret')r�rrr�r�)r;r��_all_magicsr�r�rrr_r�r�r$r�r"r�rr�r�rLr�r)rBrrgrrrrr�xsF




�
�
zNonCallableMock.__getattr__cCs�|jg}|j}|}d}|dgkr$d}|dk	rZ|}|�|j|�d}|jdkrRd}|j}q$tt|��}|jpnd}t|�dkr�|ddkr�|d7}||d<d�|�S)Nr�r�r�r5r�)r�z().r)r�r�r�rZ�reversedr�r��join)rBZ
_name_listr�Zlast�dotZ_firstrrr�_extract_mock_name�s(


z"NonCallableMock._extract_mock_namecCs^|��}d}|dkrd|}d}|jdk	rDd}|jr8d}||jj}dt|�j||t|�fS)Nr�)r5zmock.z name=%rz spec=%rz spec_set=%rz<%s%s%s id='%s'>)r�r�r�rNr1r�)rBrZname_stringZspec_stringrrrr��s 
�zNonCallableMock.__repr__cCsvtst�|�S|jpg}tt|��}t|j�}dd�|j�	�D�}dd�|D�}dd�|D�}t
t||||��S)NcSsg|]\}}|tk	r|�qSr)r�)rZm_nameZm_valuerrrr��s�z+NonCallableMock.__dir__.<locals>.<listcomp>cSsg|]}|�d�s|�qSrr�r�errrr��s
cSs"g|]}|�d�rt|�r|�qSr)rr�rrrrr��s
�)r
�object�__dir__r�r�r1rZr^rr�r��set)rBZextrasZ	from_typeZ	from_dictZfrom_child_mocksrrrr�s


�zNonCallableMock.__dir__csT|tkrt��||�S�jrH�jdk	rH|�jkrH|�jkrHtd|��n�|tkrbd|}t|��n�|tkr�jdk	r�|�jkr�td|��t	|�s�t
t��|t||��|���fdd�}n(t
�|d|�t
t��||�|�j|<n,|dkr�|�_dSt
�|||��r|�j|<�j�rFt�|��sF����d|��}td|����t��||�S)Nz!Mock object has no attribute '%s'z.Attempting to set unsupported magic method %r.cs��f|�|�Sr/r�rCr��rfrBrrr��r�z-NonCallableMock.__setattr__.<locals>.<lambda>r�r�zCannot set )r�r�__setattr__r�r�r^r;�_unsupported_magicsr�r!rTr1�_get_methodr�rr�r�r#r�)rBrr��msg�	mock_namerrrr�s<��

zNonCallableMock.__setattr__cCs�|tkr2|t|�jkr2tt|�|�||jkr2dS|j�|t�}||jkr\tt|��	|�n|t
krlt|��|tk	r||j|=t
|j|<dSr/)r�r1r^�delattrrr_�_missingr�r�__delattr__r�r;)rBrr)rrrrs

zNonCallableMock.__delattr__cCs|jpd}t|||�Sr4)r��_format_call_signature�rBrCrDrrrr�_format_mock_call_signatures
z+NonCallableMock._format_mock_call_signaturercCs.d}|�||�}|j}|j|�}||||fS)Nz.expected %s not found.
Expected: %s
Actual: %s)rr|)rBrCrD�action�message�expected_stringr|Z
actual_stringrrr�_format_mock_failure_messages

z,NonCallableMock._format_mock_failure_messagecCsj|s
|jSd}|�dd��d�}|j}|D]:}|�|�}|dksJt|t�rPqfq*t|�}|j}|j}q*|S)Nr�r�r�)r��replacer�rr_r"r�r7)rBrrF�namesZchildrenr�rrr�_get_call_signature_from_name's
z-NonCallableMock._get_call_signature_from_namec
Cs�t|t�r&t|�dkr&|�|d�}n|j}|dk	r�t|�dkrNd}|\}}n
|\}}}z||j||�fWStk
r�}z|�d�WY�Sd}~XYq�Xn|SdS)Nr�rr�)r"r[r�rr�r@�	TypeError�with_traceback)rB�_callrFrrCrDrrrr�
_call_matcherHs

"zNonCallableMock._call_matchercCs0|jdkr,d|jpd|j|��f}t|��dS)Nrz9Expected '%s' to not have been called. Called %s times.%sr5�r{r��_calls_repr�AssertionError�rBr
rrrrnbs
��z!NonCallableMock.assert_not_calledcCs$|jdkr d|jpd}t|��dS)Nrz"Expected '%s' to have been called.r5)r{r�rr rrrrmls

�zNonCallableMock.assert_calledcCs0|jdks,d|jpd|j|��f}t|��dS)Nr�z:Expected '%s' to have been called once. Called %s times.%sr5rr rrrrots
��z"NonCallableMock.assert_called_oncecs��jdkr.�����}d}d||f}t|�����fdd�}����f�}���j�}||kr~t|t�rn|nd}t|��|�dS)Nznot called.z0expected call not found.
Expected: %s
Actual: %scs�����}|Sr/�r�r
�rCrDrBrr�_error_message�sz:NonCallableMock.assert_called_with.<locals>._error_message)r|rrrr"�	Exception)rBrCrD�expected�actualZ
error_messager$�causerr#rrk~s
�z"NonCallableMock.assert_called_withcOs8|jdks,d|jpd|j|��f}t|��|j||�S)Nr�z3Expected '%s' to be called once. Called %s times.%sr5)r{r�rrrk�rBrCrDr
rrrrp�s
��z'NonCallableMock.assert_called_once_withc		s�fdd�|D�}tdd�|D�d�}t�fdd��jD��}|s�||kr�|dkrXd}nd�dd�|D��}t|�d	t|���jd
d��d����|�dSt|�}g}|D]2}z|�|�Wq�t	k
r�|�
|�Yq�Xq�|�rtd
�jp�dt|�|f�|�dS)Ncsg|]}��|��qSr�r�r�cr�rrr��sz4NonCallableMock.assert_has_calls.<locals>.<listcomp>css|]}t|t�r|VqdSr/�r"r%rrrr�	<genexpr>�s
z3NonCallableMock.assert_has_calls.<locals>.<genexpr>c3s|]}��|�VqdSr/r*r+r�rrr.�szCalls not found.z+Error processing expected calls.
Errors: {}cSsg|]}t|t�r|nd�qSr/r-rrrrr��s��
Expected: ZActual)�prefixr�z@%r does not contain all of %r in its call list, found %r insteadr5)
r�rsru�formatrr�rstriprZ�remover=r�r�r[)	rB�calls�	any_orderr&r(Z	all_calls�problem�	not_found�kallrr�rrq�sH
��"������z NonCallableMock.assert_has_callscsZ��||f�}�fdd��jD�}||krVt|t�r8|nd}��||�}td|�|�dS)Ncsg|]}��|��qSrr*r+r�rrr��sz3NonCallableMock.assert_any_call.<locals>.<listcomp>z%s call not found)rr}r"r%rr�rBrCrDr&r'r(rrr�rrr�s��zNonCallableMock.assert_any_callcKs�|�d�}||jdkr"tf|�St|�}t|t�rB|tkrBt}nbt|t�rp|tksd|j	rj||j	krjt}q�t}n4t|t
�s�t|t�r�t}q�t|t�r�t
}n
|jd}|jr�d|kr�d|dnd}|��|}t|��|f|�S)Nr�r�r�rr�r�)r_r^r	r1r0r�_async_method_magicsr��_all_sync_magicsr��
CallableMixinrrrr]r�r�r;)rBr�r��_type�klassrVrrrrr��s2


��



zNonCallableMock._get_child_mock�CallscCs"|js
dSd|�dt|j��d�S)Nr��
z: r�)rur)rBr0rrrrszNonCallableMock._calls_repr)NNNNNNr�NFNF)F)FF)N)r)F)r?),rNrQr�r�r9r�r�r�Z"_NonCallableMock__get_return_valueZ"_NonCallableMock__set_return_valueZ"_NonCallableMock__return_value_docr�rwr�r�rzr{r|r}ruZ!_NonCallableMock__get_side_effectZ!_NonCallableMock__set_side_effectr~rvr�r�r�r�rrrrrrrrnrmrorkrprqrrr�rrrrrr�sn�
-
	�

�

''
!


-'rcCsL|dkr|St|�r|St|�r$|Sz
t|�WStk
rF|YSXdSr/)r3rYr�rr(rrrr�s
r�c
@sReZdZddedddddddf
dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)r<Nr�c	Ks6||jd<tt|�j|||||||	|
f|�||_dS)Nr�)r^r�r<r9r~)rBr�r~rwrrr�r�r�r�r�rDrrrr9#s

��zCallableMixin.__init__cOsdSr/rrArrrrI/szCallableMixin._mock_check_sigcOs$|j||�|j||�|j||�Sr/)rI�_increment_mock_call�
_mock_callrArrrr:4szCallableMixin.__call__cOs|j||�Sr/)�_execute_mock_callrArrrrB<szCallableMixin._mock_callcOsd|_|jd7_t||fdd�}||_|j�|�|jdk	}|j}|j}|dk}|j	�td||f��|j
}|dk	r�|r�|j�t|||f��|jdk	}|r�|jd|}t|||f�}	|j	�|	�|jr�|r�d}
nd}
|jdk}|j|
|}|j
}qpdS)NTr���twor�r�r�)rzr{�_Callr|r}r�r�r�r�rur�rt)rBrCrDrZdo_method_callsZmethod_call_nameZmock_call_nameZ	is_a_callr�Zthis_mock_callr�rrrrA?s4


z"CallableMixin._increment_mock_callcOs||j}|dk	rPt|�r|�n(t|�s:t|�}t|�rD|�n
|||�}|tk	rP|S|jtk	r`|jS|jdk	rv|j||�S|jSr/)r~r3rYr�rr�rwr�)rBrCrD�effectrgrrrrCms 


z CallableMixin._execute_mock_call)
rNrQr�rr9rIr:rBrArCrrrrr<!s�
.r<c@seZdZdS)rN�rNrQr�rrrrr�srcCs8zt||�WStk
r2t|�t||�YSXdSr/)r$r;�
__import__)�thing�comp�import_pathrrr�_dot_lookup�s
rMcCsB|�d�}|�d�}t|�}|D]}|d|7}t|||�}q |S)Nr�rz.%s)r�r�rIrM)�targetZ
componentsrLrJrKrrr�	_importer�s

rOc@szeZdZdZgZdd�Zdd�Zdd�Zdd	�Ze	j
d
d��Zdd
�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�ZdS)�_patchNc

Csn|dk	r(|tk	rtd��|dk	r(td��||_||_||_||_||_||_d|_||_	||_
|	|_g|_dS)Nz,Cannot use 'new' and 'new_callable' togetherz1Cannot use 'autospec' and 'new_callable' togetherF)
rr=�getterrVr��new_callabler��createZ	has_localr��autospecrD�additional_patchers)
rBrQrVr�r�rSr�rTrRrDrrrr9�s(��z_patch.__init__c
CsHt|j|j|j|j|j|j|j|j|j	�	}|j
|_
dd�|jD�|_|S)NcSsg|]}|���qSr)�copy)r�prrrr��sz_patch.copy.<locals>.<listcomp>)rPrQrVr�r�rSr�rTrRrD�attribute_namerU)rB�patcherrrrrV�s ��z_patch.copycCs2t|t�r|�|�St�|�r(|�|�S|�|�Sr/)r"r1�decorate_classr'r&�decorate_async_callable�decorate_callable�rBr-rrrr:�s




z_patch.__call__cCsNt|�D]@}|�tj�sqt||�}t|d�s0q|��}t||||��q|S�Nr:)r�rr�TEST_PREFIXr$r#rVrT)rBr>r��
attr_valuerYrrrrZs

z_patch.decorate_classc	csrg}t���\}|jD]8}|�|�}|jdk	r8|�|�q|jtkr|�|�q|t	|�7}||fVW5QRXdSr/)
�
contextlib�	ExitStack�	patchings�
enter_contextrX�updater�rr�r[)rB�patchedrC�keywargs�
extra_args�
exit_stack�patchingr�rrr�decoration_helpers




z_patch.decoration_helpercs>t�d�r�j����St�����fdd����g�_�S)Nrcc
s4���||��\}}�||�W5QR�SQRXdSr/�rk�rCrgZnewargsZnewkeywargs�r-rfrBrrrf(s�z)_patch.decorate_callable.<locals>.patched�r#rcr�rr]rrnrr\"s
z_patch.decorate_callablecs>t�d�r�j����St�����fdd����g�_�S)Nrcc
�s:���||��"\}}�||�IdHW5QR�SQRXdSr/rlrmrnrrrf9s�z/_patch.decorate_async_callable.<locals>.patchedror]rrnrr[3s
z_patch.decorate_async_callablec	Cs�|��}|j}t}d}z|j|}Wn$ttfk
rHt||t�}YnXd}|tkrft|t	�rfd|_
|j
s�|tkr�td||f��||fS)NFTz!%s does not have the attribute %r)rQrVrr^r;�KeyErrorr$�	_builtinsr"rrS)rBrNrrf�localrrr�get_originalDs 
�z_patch.get_originalcCs�|j|j|j}}}|j|j}}|j}|��|_|dkr@d}|dkrLd}|dkrXd}|dk	rp|dk	rptd��|dk	s�|dk	r�|dkr�td��|�	�\}}|t
k�r||dk�r|d}	|dkr�|}|dkr�|}d}n&|dk	r�|dkr�|}d}n|dkr�|}|dk	�s|dk	�r.|t
k�rtd��t|t��r.d}	|dk�rHt
|��rHt}
nt}
i}|dk	�r`|}
n^|dk	�st|dk	�r�|}|dk	�r�|}t|��r�d|k}
n
t|�}
t
|��r�t}
n
|
�r�t}
|dk	�r�||d<|dk	�r�||d	<t|
t��rt|
t��r|j�r|j|d
<|�|�|
f|�}|	�r�t|��r�|}|dk	�rB|}t|��sZt|��sZt}
|�d
�|
f|dd�|��|_nl|dk	�r�|t
k	�r�td
��|t
k�r�td��t|�}|dk�r�|}t|f||jd�|��}n|�r�td��|}||_||_t� �|_!zrt"|j|j|�|j#dk	�rpi}|jt
k�r:|||j#<|j$D](}|j!�%|�}|jt
k�r@|�|��q@|WS|WS|j&t'�(���s��YnXdS)NFzCan't specify spec and autospec)TNz6Can't provide explicit spec_set *and* spec or autospecTz!Can't use 'spec' with create=Truer:r�r�rr�r�zBautospec creates the mock for you. Can't specify autospec and new.z%Can't use 'autospec' with create=True)r��_namez.Can't pass kwargs to a mock we aren't creating))r�r�r�rTrDrRrQrNrrsrr"r1r*r	rr\r�rr0rrVrer!rar�rw�boolr�
temp_original�is_localrarb�_exit_stackrTrXrUrd�__exit__�sys�exc_info)rBr�r�r�rTrDrRrfrrZinherit�Klass�_kwargsZ	this_specZnot_callableZnew_attrrhrjr�rrr�	__enter__\s�
�








��




�
�


�

��


z_patch.__enter__cGs�|jr$|jtk	r$t|j|j|j�n>t|j|j�|jsbt|j|j�rP|jdkrbt|j|j|j�|`|`|`|j	}|`	|j
|�S)N)rOrQrR�__annotations__rS)rwrvrrTrNrVrrSr#rxry)rBr{rirrrry�s�z_patch.__exit__cCs|��}|j�|�|Sr/)r~�_active_patchesr�)rBrgrrr�start�sz_patch.startcCs6z|j�|�Wntk
r&YdSX|�ddd�Sr/)r�r3r=ryr�rrr�stop�s
z_patch.stop)rNrQr�rXr�r9rVr:rZra�contextmanagerrkr\r[rsr~ryr�r�rrrrrP�s 

rPc	sPz��dd�\�}Wn&ttfk
r:td�f��YnX�fdd�}||fS)Nr�r�z.Need a valid target to patch. You supplied: %rcst��Sr/�rOr�rNrrr�r�z_get_target.<locals>.<lambda>)�rsplitrr=)rNrVrQrr�r�_get_target
s�r�c

s>t��tkrt��d����fdd�}	t|	||||||||�	S)Nz3 must be the actual object to be patched, not a strcs�Sr/rrr�rrr�*r�z_patch_object.<locals>.<lambda>)r1�strrrP)
rNrVr�r�rSr�rTrRrDrQrr�r�
_patch_objects ��r�c
s�t��tkr�fdd�}n�fdd�}|s2td��t|���}|d\}	}
t||	|
|||||i�	}|	|_|dd�D]2\}	}
t||	|
|||||i�	}|	|_|j�|�qt|S)Ncst��Sr/r�rr�rrr�Hr�z!_patch_multiple.<locals>.<lambda>cs�Sr/rrr�rrr�Jr�z=Must supply at least one keyword argument with patch.multiplerr�)	r1r�r=rZr�rPrXrUr�)
rNr�rSr�rTrRrDrQr�rVr�rYZthis_patcherrr�r�_patch_multiple1sH���r�c

Ks$t|�\}}	t||	|||||||�	Sr/)r�rP)
rNr�r�rSr�rTrRrDrQrVrrrrbsF�rc@sNeZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	eZ
e	ZdS)�_patch_dictrFcKs,||_t|�|_|j�|�||_d|_dSr/)�in_dict�dictr�re�clear�	_original)rBr�r�r�rDrrrr9�s

z_patch_dict.__init__cs.t�t�r����St����fdd��}|S)Ncs&���z�||�W�S���XdSr/)r��
_unpatch_dictr��frBrr�_inner�sz$_patch_dict.__call__.<locals>._inner)r"r1rZr)rBr�r�rr�rr:�s


z_patch_dict.__call__cCsXt|�D]J}t||�}|�tj�rt|d�rt|j|j|j	�}||�}t
|||�q|Sr^)r�r$rrr_r#r�r�r�r�rT)rBr>r�r`Z	decoratorZ	decoratedrrrrZ�s
�z_patch_dict.decorate_classcCs|��|jSr/)r�r�r�rrrr~�sz_patch_dict.__enter__cCs�|j}t|jt�rt|j�|_|j}|j}z|��}Wn.tk
rdi}|D]}||||<qNYnX||_|rxt	|�z|�
|�Wn*tk
r�|D]}||||<q�YnXdSr/)r�r"r�r�rOr�rVr;r��_clear_dictre)rBr�r�r�rfr�rrrr��s&z_patch_dict._patch_dictcCsR|j}|j}t|�z|�|�Wn*tk
rL|D]}||||<q6YnXdSr/)r�r�r�rer;)rBr�rfr�rrrr�sz_patch_dict._unpatch_dictcGs|��dS�NF)r�)rBrCrrrrysz_patch_dict.__exit__N)rF)rNrQr�r9r:rZr~r�r�ryr�r�rrrrr��s
	
r�cCs>z|��Wn,tk
r8t|�}|D]
}||=q(YnXdSr/)r�r;rZ)r�r�r�rrrr�&sr�cCsttj�D]}|��q
dSr/)r�rPr�r�)rrrr�_patch_stopall/sr�Ztestz�lt le gt ge eq ne getitem setitem delitem len contains iter hash str sizeof enter exit divmod rdivmod neg pos abs invert complex int float index round trunc floor ceil bool next fspath aiter zHadd sub mul matmul div floordiv mod lshift rshift and xor or pow truediv� ccs|]}d|VqdS)zi%sNr�r�nrrrr.Nsr.ccs|]}d|VqdS)zr%sNrr�rrrr.Os�__get__�__set__�
__delete__�__reversed__�__missing__r��
__reduce_ex__Z__getinitargs__�__getnewargs__�__getstate__�__setstate__�
__getformat__Z
__setformat__r�r�__subclasses__�
__format__�__getnewargs_ex__cs�fdd�}||_|S)Ncs�|f|�|�Sr/r�rBrCr�r,rr�method`sz_get_method.<locals>.method)rN)rr-r�rr,rr	^sr	cCsh|]}d|�qS)r�r)rr�rrrrfs�
__aenter__�	__aexit__�	__anext__�	__aiter__r�rr9r��__prepare__�__instancecheck__�__subclasscheck__�__del__cCs
t�|�Sr/)r�__hash__r�rrrr�|r�r�cCs
t�|�Sr/)r�__str__r�rrrr�}r�cCs
t�|�Sr/)r�
__sizeof__r�rrrr�~r�cCs"t|�j�d|���dt|���S)N�/)r1rNr�r�r�rrrr�r�)r�r�r��
__fspath__r�y�?g�?)
�__lt__�__gt__�__le__�__ge__�__int__r��__len__ry�__complex__�	__float__�__bool__�	__index__r�cs�fdd�}|S)Ncs$�jj}|tk	r|S�|kr dStSr8)�__eq__r�r�NotImplemented)�other�ret_valr�rrr��sz_get_eq.<locals>.__eq__r)rBr�rr�r�_get_eq�sr�cs�fdd�}|S)Ncs �jjtk	rtS�|krdStSr�)�__ne__r�rr�)r�r�rrr��s
z_get_ne.<locals>.__ne__r)rBr�rr�r�_get_ne�sr�cs�fdd�}|S)Ncs �jj}|tkrtg�St|�Sr/)�__iter__r�rr��r�r�rrr��sz_get_iter.<locals>.__iter__r)rBr�rr�r�	_get_iter�sr�cs�fdd�}|S)Ncs(�jj}|tkrttg��Stt|��Sr/)r�r�r�_AsyncIteratorr�r�r�rrr��sz"_get_async_iter.<locals>.__aiter__r)rBr�rr�r�_get_async_iter�sr�)r�r�r�r�cCsbt�|t�}|tk	r||_dSt�|�}|dk	rB||�}||_dSt�|�}|dk	r^||�|_dSr/)�_return_valuesr_rrw�_calculate_return_value�_side_effect_methodsr~)r5r�rZfixedZreturn_calculatorrwZ
side_effectorrrr�_set_return_value�s

r�c@seZdZdd�Zdd�ZdS)�
MagicMixincOs&|��tt|�j||�|��dSr/)�_mock_set_magicsr�r�r9r�rrrr9�szMagicMixin.__init__cCs�ttB}|}t|dd�dk	rX|�|j�}t�}||}|D]}|t|�jkr:t||�q:|tt|�j�}t|�}|D]}t	||t
||��qvdS)Nr�)�_magicsr:r$�intersectionr�rr1r^rrT�
MagicProxy)rBZorig_magicsZthese_magicsZ
remove_magicsr�r=rrrr��szMagicMixin._mock_set_magicsN)rNrQr�r9r�rrrrr��sr�c@seZdZddd�ZdS)rFcCs|�||�|��dSr/�r�r�r�rrrr��sz"NonCallableMagicMock.mock_add_specN)F�rNrQr�r�rrrrr�src@seZdZdd�ZdS)�AsyncMagicMixincOs&|��tt|�j||�|��dSr/)r�r�r�r9r�rrrr9�szAsyncMagicMixin.__init__N�rNrQr�r9rrrrr��sr�c@seZdZddd�ZdS)rFcCs|�||�|��dSr/r�r�rrrr�szMagicMock.mock_add_specN)Fr�rrrrrsrc@s&eZdZdd�Zdd�Zddd�ZdS)	r�cCs||_||_dSr/�rr�)rBrr�rrrr9szMagicProxy.__init__cCs8|j}|j}|j|||d�}t|||�t|||�|S)N)rr�r�)rr�r�rTr�)rBr�r��mrrr�create_mocks�zMagicProxy.create_mockNcCs|��Sr/)r�)rBr)r=rrrr�(szMagicProxy.__get__)N)rNrQr�r9r�r�rrrrr�s	r�cs�eZdZed�Zed�Zed�Z�fdd�Zdd�Zdd	�Z	d
d�Z
dd
�Zdd�Zdd�Z
ddd�Zdd�Z�fdd�Z�ZS)r�r�r�r�cs\t�j||�tjj|jd<d|jd<d|jd<t�|jd<ttd�}t	j
|_||jd<dS)Nr�rZ_mock_await_countZ_mock_await_argsZ_mock_await_args_list�r�r+)�superr9r%r�r�r^rsrrr'ZCO_COROUTINE�co_flags)rBrCrD�	code_mock�r�rrr91s


zAsyncMockMixin.__init__c�st||fdd�}|jd7_||_|j�|�|j}|dk	r�t|�rL|�nbt|�s�zt|�}Wnt	k
rxt
�YnXt|�r�|�n&t�|�r�|||�IdH}n
|||�}|t
k	r�|S|jt
k	r�|jS|jdk	r�t�|j�r�|j||�IdHS|j||�S|jS)NTrDr�)rFr�r�r�r�r~r3rYr��
StopIteration�StopAsyncIterationr%r&rr�rwr�)rBrCrDrrGrgrrrrCAs6




z!AsyncMockMixin._execute_mock_callcCs(|jdkr$d|jpd�d�}t|��dS)Nr�	Expected r5z to have been awaited.�r�r�rr rrrr�is
zAsyncMockMixin.assert_awaitedcCs0|jdks,d|jpd�d|j�d�}t|��dS�Nr�r�r5z$ to have been awaited once. Awaited � times.r�r rrrr�qs
z"AsyncMockMixin.assert_awaited_oncecsz�jdkr&�����}td|�d������fdd�}����f�}���j�}||krvt|t�rf|nd}t|��|�dS)NzExpected await: z
Not awaitedcs�j��dd�}|S)N�await)rr!r"r#rrr$�sz:AsyncMockMixin.assert_awaited_with.<locals>._error_message)r�rrrr"r%)rBrCrDr&r$r'r(rr#rr�zs
z"AsyncMockMixin.assert_awaited_withcOs8|jdks,d|jpd�d|j�d�}t|��|j||�Sr�)r�r�rr�r)rrrr��s
z'AsyncMockMixin.assert_awaited_once_withcsZ��||f�}�fdd��jD�}||krVt|t�r8|nd}��||�}td|�|�dS)Ncsg|]}��|��qSrr*r+r�rrr��sz3AsyncMockMixin.assert_any_await.<locals>.<listcomp>z%s await not found)rr�r"r%rrr9rr�rr��s��zAsyncMockMixin.assert_any_awaitFc		s��fdd�|D�}tdd�|D�d�}t�fdd��jD��}|s�||kr�|dkrXd}nd�dd�|D��}t|�d	t|��d
�j���|�dSt|�}g}|D]2}z|�|�Wq�tk
r�|�|�Yq�Xq�|r�tdt	|�f�|�dS)Ncsg|]}��|��qSrr*r+r�rrr��sz4AsyncMockMixin.assert_has_awaits.<locals>.<listcomp>css|]}t|t�r|VqdSr/r-rrrrr.�s
z3AsyncMockMixin.assert_has_awaits.<locals>.<genexpr>c3s|]}��|�VqdSr/r*r+r�rrr.�szAwaits not found.z,Error processing expected awaits.
Errors: {}cSsg|]}t|t�r|nd�qSr/r-rrrrr��s�r/z	
Actual: z%r not all found in await list)
r�rsr�r1rrZr3r=r�r[)	rBr4r5r&r(Z
all_awaitsr6r7r8rr�rr��s>������z AsyncMockMixin.assert_has_awaitscCs0|jdkr,d|jpd�d|j�d�}t|��dS)Nrr�r5z# to not have been awaited. Awaited r�r�r rrrr��s
z!AsyncMockMixin.assert_not_awaitedcs&t�j||�d|_d|_t�|_dS�Nr)r�rvr�r�rsr�rAr�rrrv�szAsyncMockMixin.reset_mock)F)rNrQr�r�r�r�r�r9rCr�r�r�r�r�r�r�rv�
__classcell__rrr�rr�,s(	
,	r�c@seZdZdS)r	NrHrrrrr	�sr	c@s$eZdZdd�Zdd�Zdd�ZdS)�_ANYcCsdSr8r�rBr�rrrr�	sz_ANY.__eq__cCsdSr�rr�rrrr�	sz_ANY.__ne__cCsdS)Nz<ANY>rr�rrrr�	sz
_ANY.__repr__N)rNrQr�r�r�r�rrrrr�	sr�cCs`d|}d}d�dd�|D��}d�dd�|��D��}|r@|}|rX|rP|d7}||7}||S)Nz%s(%%s)r�z, cSsg|]}t|��qSr)�reprr�rrrr�!	sz*_format_call_signature.<locals>.<listcomp>cSsg|]\}}d||f�qS)z%s=%rr)rr�r�rrrr�"	s)r�r�)rrCrDrZformatted_argsZargs_stringZ
kwargs_stringrrrr	s
�rc@s�eZdZd dd�Zd!dd	�Zd
d�ZejZdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
edd��Zedd��Zdd�Zdd�ZdS)"rFrr�NFTcCs�d}i}t|�}|dkr$|\}}}nr|dkrd|\}	}
t|	t�rX|	}t|
t�rR|
}qb|
}q�|	|
}}n2|dkr�|\}t|t�r�|}nt|t�r�|}n|}|r�t�|||f�St�||||f�S)Nr�r�r�)r�r"r�r[r�)r�r�rr�rE�	from_kallrCrD�_len�first�secondrrrr�C	s.



z
_Call.__new__cCs||_||_||_dSr/)r�r��_mock_from_kall)rBr�rr�rEr�rrrr9c	sz_Call.__init__cCsh|tkrdSzt|�}Wntk
r.YdSXd}t|�dkrJ|\}}n
|\}}}t|dd�r|t|dd�r||j|jkr|dSd}|dkr�di}}n�|dkr�|\}}}n�|d	kr�|\}	t|	t�r�|	}i}n"t|	t�r�|	}di}}nd}|	}nV|dk�r@|\}
}t|
t��r4|
}t|t��r(|i}}n
d|}}n
|
|}}ndS|�rX||k�rXdS||f||fkS)
NTFr�r�r�rrr�r�)rr�rr$r�r"r[r�)rBr�Z	len_otherZ	self_nameZ	self_argsZself_kwargsZ
other_nameZ
other_argsZother_kwargsr�r�r�rrrr�j	sR


�


z_Call.__eq__cOs<|jdkrtd||fdd�S|jd}t|j||f||d�S)Nr�r�r�r��r�rFrrrrr:�	s

z_Call.__call__cCs2|jdkrt|dd�Sd|j|f}t||dd�S)NF)rr�z%s.%s)rr�r�r�)rBr�rrrrr��	s
z_Call.__getattr__cCs|tjkrt�t�||�Sr/)r[r^r;�__getattribute__)rBr�rrrr��	s
z_Call.__getattribute__cOs|�d�||�S)Nr��r�rArrrr��	sz_Call.countcOs|�d�||�S)N�indexr�rArrrr��	sz_Call.indexcCs(t|�dkr|\}}n
|\}}}||fS)Nr�)r�rrrr�_get_call_arguments�	s

z_Call._get_call_argumentscCs|��dSr��r�r�rrrrC�	sz
_Call.argscCs|��dS)Nr�r�r�rrrrD�	sz_Call.kwargscCs||js&|jpd}|�d�r"d|}|St|�dkr@d}|\}}n0|\}}}|sTd}n|�d�shd|}nd|}t|||�S)Nrr�zcall%sr�zcall.%s)r�r�rr�r)rBrrCrDrrrr��	s





z_Call.__repr__cCs4g}|}|dk	r(|jr |�|�|j}qtt|��Sr/)r�r�r�rsr�)rBZvalsrJrrr�	call_list�	s
z_Call.call_list)rr�NFT)rNNFT)rNrQr�r�r9r�rr�r:r�r�r�r�r�r�rCrDr�r�rrrrrF0	s(�
 �
7

rF)r�c	Kslt|�rt|�}t|t�}t|�}d|i}|r8d|i}n|dkrDi}|rT|rTd|d<|�|�t}	t�|�rri}n8|r�|r�td��t	}	n"t
|�s�t}	n|r�|r�t|�s�t}	|�
d|�}|}
|dkr�d}
|	f|||
|d�|��}t|t��rt||�}|�rt|�nt||||�|dk	�r,|�s,||j|<|�rV|�sVd	|k�rVt||dd
|d�|_t|�D�]}t|��rr�q^zt||�}
Wntk
�r�Y�q^YnXd|
i}|�r�d|
i}t|
t��s�t|
||||�}||j|<np|}t|t��r�|j}t|||�}||d<t�|
��rt	}nt}|f||||d
�|��}||j|<t|
||d�t|t��r^t|||��q^|S)Nr�r�Tr�zJInstance can not be True when create_autospec is mocking an async functionrr�)r�r�r�rrwr�)rLrtr�r�)r�rr�r�)rK)r\r1r"r.rerr'Zisdatadescriptor�RuntimeErrorr	rYrrar�r6rjr�rMrrrwr�r�r$r;r�r5�
_must_skipr%r&rT)r�r�rLr�rtrD�is_typeZ
is_async_funcr}r|r�r5r�rfr�r�rKZchild_klassrrrr�	s�




��


�

��
rcCsxt|t�s$|t|di�krdS|j}|jD]H}|j�|t�}|tkrFq*t|tt	f�rZdSt|t
�rl|SdSq*|S)Nr^F)r"r1r$r�r]r^r_rrWrXr6)r�r�r�r>rgrrrr�w
s


r�c@seZdZddd�ZdS)r�FNcCs(||_||_||_||_||_||_dSr/)r��idsr�r�rLr)rBr�r�r�rr�rLrrrr9�
sz_SpecState.__init__)FNNNFr�rrrrr��
s
�r�cCs"t|t�rt�|�St�|�SdSr/)r"�bytes�io�BytesIO�StringIO)�	read_datarrr�
_to_stream�
s

rr�cs&t��}|dg���fdd�}��fdd�}��fdd����fdd����fd	d
�}tdkr�ddl}ttt|j���tt|j����a|dkr�t	dt
d
�}t	td����j_d�j
_d�j_d�j_d�j_|�j_���d<�d�j_|�j_��j_|�j_����fdd�}||_�|_|S)Ncs$�jjdk	r�jjS�dj||�Sr�)�	readlinesrwrb��_state�handlerr�_readlines_side_effect�
sz)mock_open.<locals>._readlines_side_effectcs$�jjdk	r�jjS�dj||�Sr�)�readrwrbrrr�_read_side_effect�
sz$mock_open.<locals>._read_side_effectc?s$��EdH�dj||�VqdSr�)�readlinerb)�_iter_side_effectrrr�_readline_side_effect�
sz(mock_open.<locals>._readline_side_effectc3s0�jjdk	r�jjVq�dD]
}|Vq dSr�)rrw)�linerrrr�
sz$mock_open.<locals>._iter_side_effectcs �jjdk	r�jjSt�d�Sr�)rrwr�rrrr�_next_side_effect�
sz$mock_open.<locals>._next_side_effectr�open)rr�r�r�cs6t���d<�jj�dkr2���d<�d�j_tS)Nrr�)rrr~rrb)r
rrrrr�
reset_data�
s

zmock_open.<locals>.reset_data)r�	file_spec�_iorZrr��
TextIOWrapper�unionrrrr~rw�writer	rrr~r�r�)r5rZ
_read_datarr
rrrr)rr
rrrrr
�
s8"

r
c@s&eZdZdd�Zddd�Zdd�ZdS)	rcKs
tf|�Sr/)r)rBrDrrrr�szPropertyMock._get_child_mockNcCs|�Sr/r)rBr)Zobj_typerrrr�szPropertyMock.__get__cCs||�dSr/r)rBr)r�rrrr�
szPropertyMock.__set__)N)rNrQr�r�r�r�rrrrr�
s	
rc	Cs^d|_t|�D]J}zt||�}Wntk
r8YqYnXt|t�sFq|j|krt|�qdSr8)r�r�r$r;r"rr�r)r5r�r�rrrrs



rc@s$eZdZdd�Zdd�Zdd�ZdS)r�cCs&||_ttd�}tj|_||jd<dS)Nr�r+)�iteratorrrr'ZCO_ITERABLE_COROUTINEr�r^)rBrr�rrrr9+s
z_AsyncIterator.__init__cCs|Sr/rr�rrrr�1sz_AsyncIterator.__aiter__c�s*zt|j�WStk
r YnXt�dSr/)r�rr�r�r�rrrr�4s
z_AsyncIterator.__anext__N)rNrQr�r9r�r�rrrrr�'sr�)F)F)NFNNN)FFNN)Nr�)y�__all__�__version__r%rar�r'r�rz�builtins�typesrrrZ
unittest.utilr�	functoolsrrr�rqr
r�r�r*r.r!r3r7r>rMrHrYr\rarjrer�r�rr�r�rr�MISSINGr
ZDELETEDr�r�r�rZrsr�r�r�rr�r<rrMrOrPr�r�r�rr�r�r�r�ZmultipleZstopallr_Z
magic_methodsZnumericsr�r�Zinplace�rightZ
_non_defaultsr	r�r:Z_sync_async_magicsZ
_async_magicsr;r�rr�r�r�r�r�r�r�r�r�r�rr�rr�r�r	r�rrr[rFrrr�r�r1r�r6rrr
rrr�rrrr�<module>s~	



1�	h4<�
�
2�
Mw	���	�
���
	
	�	8+B
�
�
Nunittest/__pycache__/signals.cpython-38.opt-1.pyc000064400000004256151153537550015703 0ustar00U

e5dc	�@sbddlZddlZddlmZdZGdd�de�Ze��Zdd�Z	dd	�Z
dad
d�Zddd
�Z
dS)�N)�wrapsTc@seZdZdd�Zdd�ZdS)�_InterruptHandlercCsNd|_||_t|t�rD|tjkr(tj}n|tjkr<dd�}ntd��||_	dS)NFcSsdS�N�)Z
unused_signumZunused_framerr�(/usr/lib64/python3.8/unittest/signals.py�default_handlersz3_InterruptHandler.__init__.<locals>.default_handlerzYexpected SIGINT signal handler to be signal.SIG_IGN, signal.SIG_DFL, or a callable object)
�called�original_handler�
isinstance�int�signal�SIG_DFL�default_int_handler�SIG_IGN�	TypeErrorr)�selfrrrr�__init__
s



z_InterruptHandler.__init__cCsRt�tj�}||k	r |�||�|jr2|�||�d|_t��D]}|��q@dS)NT)r�	getsignal�SIGINTrr�_results�keys�stop)rZsignum�frameZinstalled_handler�resultrrr�__call__sz_InterruptHandler.__call__N)�__name__�
__module__�__qualname__rrrrrrr	srcCsdt|<dS)N�)r�rrrr�registerResult*sr cCstt�|d��Sr)�boolr�poprrrr�removeResult-sr#cCs.tdkr*t�tj�}t|�at�tjt�dSr)�_interrupt_handlerrrrr)rrrr�installHandler1sr%cs<�dk	r t���fdd��}|Stdk	r8t�tjtj�dS)Nc
s6t�tj�}t�z�||�W�St�tj|�XdSr)rrr�
removeHandler)�args�kwargs�initial��methodrr�inner;s
zremoveHandler.<locals>.inner)rr$rrr	)r+r,rr*rr&9sr&)N)r�weakref�	functoolsrZ
__unittest�objectr�WeakKeyDictionaryrr r#r$r%r&rrrr�<module>s unittest/__pycache__/runner.cpython-38.pyc000064400000015552151153537550014616 0ustar00U

e5dW�@sndZddlZddlZddlZddlmZddlmZdZGdd�de	�Z
Gd	d
�d
ej�ZGdd�de	�Z
dS)
z
Running tests�N�)�result)�registerResultTc@s*eZdZdZdd�Zdd�Zd	dd�ZdS)
�_WritelnDecoratorz@Used to decorate file-like objects with a handy 'writeln' methodcCs
||_dS�N)�stream)�selfr�r	�'/usr/lib64/python3.8/unittest/runner.py�__init__sz_WritelnDecorator.__init__cCs|dkrt|��t|j|�S)N)r�__getstate__)�AttributeError�getattrr)r�attrr	r	r
�__getattr__sz_WritelnDecorator.__getattr__NcCs|r|�|�|�d�dS�N�
)�write)r�argr	r	r
�writelns
z_WritelnDecorator.writeln)N)�__name__�
__module__�__qualname__�__doc__rrrr	r	r	r
r
srcs�eZdZdZdZdZ�fdd�Zdd�Z�fdd	�Z�fd
d�Z	�fdd
�Z
�fdd�Z�fdd�Z�fdd�Z
�fdd�Zdd�Zdd�Z�ZS)�TextTestResultzhA test result class that can print formatted text results to a stream.

    Used by TextTestRunner.
    zF======================================================================zF----------------------------------------------------------------------cs8tt|��|||�||_|dk|_|dk|_||_dS)Nr)�superrrr�showAll�dots�descriptions)rrr�	verbosity��	__class__r	r
r%s


zTextTestResult.__init__cCs0|��}|jr$|r$d�t|�|f�St|�SdSr)ZshortDescriptionr�join�str)r�testZdoc_first_liner	r	r
�getDescription,s
zTextTestResult.getDescriptioncsBtt|��|�|jr>|j�|�|��|j�d�|j��dS)Nz ... )rr�	startTestrrrr%�flush�rr$r r	r
r&3s
zTextTestResult.startTestcsDtt|��|�|jr$|j�d�n|jr@|j�d�|j��dS)N�ok�.)	rr�
addSuccessrrrrrr'r(r r	r
r+:szTextTestResult.addSuccesscsFtt|��||�|jr&|j�d�n|jrB|j�d�|j��dS)N�ERROR�E)	rr�addErrorrrrrrr'�rr$�errr r	r
r.BszTextTestResult.addErrorcsFtt|��||�|jr&|j�d�n|jrB|j�d�|j��dS)N�FAIL�F)	rr�
addFailurerrrrrr'r/r r	r
r3JszTextTestResult.addFailurecsLtt|��||�|jr,|j�d�|��n|jrH|j�d�|j�	�dS)Nz
skipped {0!r}�s)
rr�addSkiprrr�formatrrr')rr$�reasonr r	r
r5RszTextTestResult.addSkipcsFtt|��||�|jr&|j�d�n|jrB|j�d�|j��dS)Nzexpected failure�x)	rr�addExpectedFailurerrrrrr'r/r r	r
r9Zsz!TextTestResult.addExpectedFailurecsDtt|��|�|jr$|j�d�n|jr@|j�d�|j��dS)Nzunexpected success�u)	rr�addUnexpectedSuccessrrrrrr'r(r r	r
r;bsz#TextTestResult.addUnexpectedSuccesscCs6|js|jr|j��|�d|j�|�d|j�dS)Nr,r1)rrrr�printErrorList�errors�failures�rr	r	r
�printErrorsjs
zTextTestResult.printErrorscCsX|D]N\}}|j�|j�|j�d||�|�f�|j�|j�|j�d|�qdS)Nz%s: %sz%s)rr�
separator1r%�
separator2)rZflavourr=r$r0r	r	r
r<ps
zTextTestResult.printErrorList)rrrrrArBrr%r&r+r.r3r5r9r;r@r<�
__classcell__r	r	r r
rsrc@s4eZdZdZeZd
dd�dd�Zd	d
�Zdd�ZdS)�TextTestRunnerz�A test runner class that displays results in textual form.

    It prints out the names of tests as they are run, errors as they
    occur, and a summary of the results at the end of the test run.
    NTrF)�	tb_localsc	CsN|dkrtj}t|�|_||_||_||_||_||_||_	|dk	rJ||_
dS)z�Construct a TextTestRunner.

        Subclasses should accept **kwargs to ensure compatibility as the
        interface changes.
        N)�sys�stderrrrrr�failfast�bufferrE�warnings�resultclass)	rrrrrHrIrKrJrEr	r	r
r�s
zTextTestRunner.__init__cCs|�|j|j|j�Sr)rKrrrr?r	r	r
�_makeResult�szTextTestRunner._makeResultcCs2|��}t|�|j|_|j|_|j|_t����|jr^t�|j�|jdkr^tjdt	dd�t
��}t|dd�}|dk	r�|�z||�W5t|dd�}|dk	r�|�Xt
��}W5QRX||}|�
�t|d�r�|j�|j�|j}|j�d	||d
ko�d�pd|f�|j��d
}	}
}ztt|j|j|jf�}Wntk
�rTYnX|\}	}
}g}
|���s�|j�d�t|j�t|j�}}|�r�|
�d|�|�r�|
�d|�n|j�d�|�r�|
�d|�|	�r�|
�d|	�|
�r|
�d|
�|
�r"|j�dd�|
�f�n|j�d�|S)z&Run the given test case or test suite.)�default�always�modulezPlease use assert\w+ instead.)�category�message�startTestRunN�stopTestRunrBzRan %d test%s in %.3fsrr4�rZFAILEDzfailures=%dz	errors=%dZOKz
skipped=%dzexpected failures=%dzunexpected successes=%dz (%s)z, r)rLrrHrIrErJ�catch_warnings�simplefilter�filterwarnings�DeprecationWarning�time�perf_counterrr@�hasattrrrrBZtestsRun�map�lenZexpectedFailures�unexpectedSuccesses�skippedr
Z
wasSuccessfulrr>r=�appendr")rr$rZ	startTimerRrSZstopTimeZ	timeTaken�runZ
expectedFailsr^r_ZresultsZinfosZfailedZerroredr	r	r
ra�sx

�
�
�


zTextTestRunner.run)NTrFFNN)	rrrrrrKrrLrar	r	r	r
rDxs��rD)rrFrYrJrTrZsignalsrZ
__unittest�objectrZ
TestResultrrDr	r	r	r
�<module>s[unittest/__pycache__/async_case.cpython-38.opt-1.pyc000064400000010005151153537550016340 0ustar00U

e5d��@s0ddlZddlZddlmZGdd�de�ZdS)�N�)�TestCasecs�eZdZd�fdd�	Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zd �fdd�	Z�ZS)!�IsolatedAsyncioTestCase�runTestcst��|�d|_d|_dS�N)�super�__init__�_asyncioTestLoop�_asyncioCallsQueue)�selfZ
methodName��	__class__��+/usr/lib64/python3.8/unittest/async_case.pyr"sz IsolatedAsyncioTestCase.__init__c�sdSrr�rrrr�
asyncSetUp'sz"IsolatedAsyncioTestCase.asyncSetUpc�sdSrrrrrr�
asyncTearDown*sz%IsolatedAsyncioTestCase.asyncTearDowncOs|j|f|�|�dSr)Z
addCleanup)r�func�args�kwargsrrr�addAsyncCleanup-s
z'IsolatedAsyncioTestCase.addAsyncCleanupcCs|��|�|j�dSr)ZsetUp�
_callAsyncrrrrr�
_callSetUp<sz"IsolatedAsyncioTestCase._callSetUpcCs|�|�dSr��_callMaybeAsync)r�methodrrr�_callTestMethod@sz'IsolatedAsyncioTestCase._callTestMethodcCs|�|j�|��dSr)rrZtearDownrrrr�
_callTearDownCsz%IsolatedAsyncioTestCase._callTearDowncOs|j|f|�|�dSrr)rZfunctionrrrrr�_callCleanupGsz$IsolatedAsyncioTestCase._callCleanupcOs0|||�}|j��}|j�||f�|j�|�Sr)r	�
create_futurer
�
put_nowait�run_until_complete�rrrr�ret�futrrrrJs

z"IsolatedAsyncioTestCase._callAsynccOsB|||�}t�|�r:|j��}|j�||f�|j�|�S|SdSr)�inspectZisawaitabler	rr
r r!r"rrrrRs


z'IsolatedAsyncioTestCase._callMaybeAsyncc
�s�t��|_}|�d�|��IdH}|��|dkr:dS|\}}z |IdH}|��s`|�|�Wqttfk
r|�Yqt	tj
fk
r�}z|��s�|�|�W5d}~XYqXqdSr)�asyncioZQueuer
Z
set_result�getZ	task_done�	cancelled�
SystemExit�KeyboardInterrupt�
BaseExceptionZCancelledErrorZ
set_exception)rr$ZqueueZqueryZ	awaitabler#Zexrrr�_asyncioLoopRunner\s 

z*IsolatedAsyncioTestCase._asyncioLoopRunnercCsJt��}t�|�|�d�||_|��}|�|�|��|_|�	|�dS)NT)
r&Znew_event_loop�set_event_loopZ	set_debugr	rZcreate_taskr,Z_asyncioCallsTaskr!)r�loopr$rrr�_setupAsyncioLoopos

z)IsolatedAsyncioTestCase._setupAsyncioLoopc	Cs�|j}d|_|j�d�|�|j���z�t�|�}|s@W�vdS|D]}|�	�qD|�tj
||dd���|D]0}|��r|qn|��dk	rn|�
d|��|d��qn|�|���W5t�d�|��XdS)NT)r.Zreturn_exceptionsz(unhandled exception during test shutdown)�message�	exception�task)r	r
r r!�joinr&r-�closeZ	all_tasksZcancelZgatherr(r1Zcall_exception_handlerZshutdown_asyncgens)rr.Z	to_cancelr2rrr�_tearDownAsyncioLoopys2

��

z,IsolatedAsyncioTestCase._tearDownAsyncioLoopNcs(|��zt��|�W�S|��XdSr)r/r5r�run)r�resultrrrr6�szIsolatedAsyncioTestCase.run)r)N)�__name__�
__module__�__qualname__rrrrrrrrrrr,r/r5r6�
__classcell__rrrrrs

"r)r&r%Zcaserrrrrr�<module>sunittest/__pycache__/result.cpython-38.pyc000064400000016175151153537550014625 0ustar00U

e5d�@s\dZddlZddlZddlZddlmZddlmZdZdd�Z	d	Z
d
ZGdd�de�Z
dS)
zTest result object�N�)�util��wrapsTcst���fdd��}|S)Ncs$t|dd�r|���|f|�|�S)N�failfastF)�getattr�stop)�self�args�kw��method��'/usr/lib64/python3.8/unittest/result.py�inner
szfailfast.<locals>.innerr)r
rrrrrsrz
Stdout:
%sz
Stderr:
%sc@s�eZdZdZdZdZdZd.dd�Zdd�Zdd	�Z	d
d�Z
dd
�Zdd�Zdd�Z
dd�Zedd��Zedd��Zdd�Zdd�Zdd�Zdd�Zed d!��Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�ZdS)/�
TestResulta�Holder for test result information.

    Test results are automatically managed by the TestCase and TestSuite
    classes, and do not need to be explicitly manipulated by writers of tests.

    Each instance holds the total number of tests run, and collections of
    failures and errors that occurred among those test runs. The collections
    contain tuples of (testcase, exceptioninfo), where exceptioninfo is the
    formatted traceback of the error that occurred.
    NFcCsbd|_g|_g|_d|_g|_g|_g|_d|_d|_d|_	d|_
d|_tj
|_tj|_d|_dS)NFr)r�failures�errors�testsRun�skipped�expectedFailures�unexpectedSuccesses�
shouldStop�buffer�	tb_locals�_stdout_buffer�_stderr_buffer�sys�stdout�_original_stdout�stderr�_original_stderr�
_mirrorOutput)r	�streamZdescriptions�	verbosityrrr�__init__&szTestResult.__init__cCsdS)z#Called by TestRunner after test runNr�r	rrr�printErrors7szTestResult.printErrorscCs |jd7_d|_|��dS)z-Called when the given test is about to be runrFN)rr"�_setupStdout�r	�testrrr�	startTest:szTestResult.startTestcCs8|jr4|jdkr$t��|_t��|_|jt_|jt_dS)N)rr�io�StringIOrrrr r&rrrr(@s


zTestResult._setupStdoutcCsdS)zpCalled once before any tests are executed.

        See startTest for a method called before each test.
        Nrr&rrr�startTestRunHszTestResult.startTestRuncCs|��d|_dS)z'Called when the given test has been runFN)�_restoreStdoutr"r)rrr�stopTestNszTestResult.stopTestcCs�|jr�|jrltj��}tj��}|rF|�d�s6|d7}|j�t	|�|rl|�d�s\|d7}|j
�t|�|jt_|j
t_|j�
d�|j��|j�
d�|j��dS)N�
r)rr"rr�getvaluer �endswithr�write�STDOUT_LINEr!�STDERR_LINEr�seek�truncater)r	�output�errorrrrr/Ss$




zTestResult._restoreStdoutcCsdS)zmCalled once after all tests are executed.

        See stopTest for a method called after each test.
        Nrr&rrr�stopTestRunhszTestResult.stopTestRuncCs"|j�||�||�f�d|_dS)zmCalled when an error has occurred. 'err' is a tuple of values as
        returned by sys.exc_info().
        TN)r�append�_exc_info_to_stringr"�r	r*�errrrr�addErrornszTestResult.addErrorcCs"|j�||�||�f�d|_dS)zdCalled when an error has occurred. 'err' is a tuple of values as
        returned by sys.exc_info().TN)rr<r=r"r>rrr�
addFailurevszTestResult.addFailurecCsZ|dk	rVt|dd�r|��t|d|j�r4|j}n|j}|�||�||�f�d|_dS)z�Called at the end of a subtest.
        'err' is None if the subtest ended successfully, otherwise it's a
        tuple of values as returned by sys.exc_info().
        NrFrT)	rr�
issubclass�failureExceptionrrr<r=r")r	r*Zsubtestr?rrrr�
addSubTest}szTestResult.addSubTestcCsdS)z-Called when a test has completed successfullyNrr)rrr�
addSuccess�szTestResult.addSuccesscCs|j�||f�dS)zCalled when a test is skipped.N)rr<)r	r*�reasonrrr�addSkip�szTestResult.addSkipcCs|j�||�||�f�dS)z/Called when an expected failure/error occurred.N)rr<r=r>rrr�addExpectedFailure�s�zTestResult.addExpectedFailurecCs|j�|�dS)z5Called when a test was expected to fail, but succeed.N)rr<r)rrr�addUnexpectedSuccess�szTestResult.addUnexpectedSuccesscCs>t|j�t|j�kodkno<t|d�p<t|j�dkS)z/Tells whether or not this result was a success.rr)�lenrr�hasattrrr&rrr�
wasSuccessful�s$�zTestResult.wasSuccessfulcCs
d|_dS)z+Indicates that the tests should be aborted.TN)rr&rrrr�szTestResult.stopcCs�|\}}}|r |�|�r |j}q
||jkr6|�|�}nd}tj|||||jd�}t|���}|j	r�t
j��}	t
j
��}
|	r�|	�d�s�|	d7}	|�t|	�|
r�|
�d�s�|
d7}
|�t|
�d�|�S)z>Converts a sys.exc_info()-style tuple of values into a string.N)�limit�capture_localsr1�)�_is_relevant_tb_level�tb_nextrC�_count_relevant_tb_levels�	traceback�TracebackExceptionr�list�formatrrrr2r r3r<r5r6�join)r	r?r*�exctype�value�tb�lengthZtb_eZmsgLinesr9r:rrrr=�s4

�



zTestResult._exc_info_to_stringcCsd|jjkS)N�
__unittest)�tb_frame�	f_globals)r	rZrrrrP�sz TestResult._is_relevant_tb_levelcCs&d}|r"|�|�s"|d7}|j}q|S)Nrr)rPrQ)r	rZr[rrrrR�s
z$TestResult._count_relevant_tb_levelscCs&dt�|j�|jt|j�t|j�fS)Nz!<%s run=%i errors=%i failures=%i>)rZstrclass�	__class__rrJrrr&rrr�__repr__�s
��zTestResult.__repr__)NNN)�__name__�
__module__�__qualname__�__doc__Z_previousTestClassZ_testRunEnteredZ_moduleSetUpFailedr%r'r+r(r.r0r/r;rr@rArDrErGrHrIrLrr=rPrRr`rrrrrs8




	r)rdr,rrSrOr�	functoolsrr\rr5r6�objectrrrrr�<module>sunittest/__pycache__/__main__.cpython-38.opt-1.pyc000064400000000621151153537550015753 0ustar00U

e5d��@s`dZddlZejd�d�rBddlZej�ej�Zedejd<[dZ	ddl
m
Z
e
dd�dS)	zMain entry point�Nz__main__.pyz -m unittestT�)�main)�module)�__doc__�sys�argv�endswithZos.path�os�path�basename�
executableZ
__unittestr�r
r
�)/usr/lib64/python3.8/unittest/__main__.py�<module>sunittest/__pycache__/util.cpython-38.opt-1.pyc000064400000010410151153537550015205 0ustar00U

e5d_�@s�dZddlmZmZddlmZdZdZdZdZ	dZ
dZee	eeee
Zdd	�Z
d
d�Zdd
d�Zdd�Zdd�Zdd�Zdd�Zedd�Zdd�Zdd�ZdS)zVarious utility functions.�)�
namedtuple�Counter)�commonprefixT�P��cCsBt|�||}|tkr>d|d|�||t|�|d�f}|S)Nz%s[%d chars]%s)�len�_PLACEHOLDER_LEN)�s�	prefixlenZ	suffixlen�skip�r
�%/usr/lib64/python3.8/unittest/util.py�_shortens&rcs�ttt|��}ttt|��}|tkr(|St|��t���t|�tt}|t	krxt
�t|��t��fdd�|D��St
�tt	��t��fdd�|D��S)Nc3s|]}�|�d�VqdS�Nr
��.0r
��prefixrr
r�	<genexpr>'sz'_common_shorten_repr.<locals>.<genexpr>c3s&|]}�t|�d�tt�VqdSr)r�
_MIN_DIFF_LEN�_MIN_END_LENrrr
rr*s�)�tuple�map�	safe_repr�maxr�_MAX_LENGTHr�_MIN_BEGIN_LENr	�_MIN_COMMON_LENr)�args�maxlenZ
common_lenr
rr�_common_shorten_reprs ��r!FcCsPzt|�}Wntk
r*t�|�}YnX|r<t|�tkr@|S|dt�dS)Nz [truncated]...)�repr�	Exception�object�__repr__rr)�objZshort�resultr
r
rr-srcCsd|j|jfS)Nz%s.%s)�
__module__�__qualname__)�clsr
r
r�strclass6sr+cCsd}}g}g}z�||}||}||krT|�|�|d7}|||kr�|d7}q<nv||kr�|�|�|d7}|||kr�|d7}qnnD|d7}z|||kr�|d7}q�W5|d7}|||kr�|d7}q�XWqtk
�r|�||d��|�||d��Y�qYqXq||fS)arFinds elements in only one or the other of two, sorted input lists.

    Returns a two-element tuple of lists.    The first list contains those
    elements in the "expected" list but not in the "actual" list, and the
    second contains those elements in the "actual" list but not in the
    "expected" list.    Duplicate elements in either input list are ignored.
    r�N)�append�
IndexError�extend)�expected�actual�i�j�missingZ
unexpected�e�ar
r
r�sorted_list_difference9s8

r7cCsHg}|r@|��}z|�|�Wqtk
r<|�|�YqXq||fS)z�Same behavior as sorted_list_difference but
    for lists of unorderable items (like dicts).

    As it does a linear search per item (remove) it
    has O(n*n) performance.)�pop�remove�
ValueErrorr-)r0r1r4�itemr
r
r�unorderable_list_differencebsr<cCs||k||kS)z.Return -1 if x < y, 0 if x == y and 1 if x > yr
)�x�yr
r
r�
three_way_cmpssr?ZMismatchzactual expected valuecCs,t|�t|�}}t|�t|�}}t�}g}t|�D]�\}}	|	|krHq6d}
}t||�D] }|||	krZ|
d7}
|||<qZt|�D] \}}
|
|	kr�|d7}|||<q�|
|kr6t|
||	�}|�|�q6t|�D]X\}}	|	|kr�q�d}t||�D] }|||	kr�|d7}|||<q�td||	�}|�|�q�|S)�HReturns list of (cnt_act, cnt_exp, elem) triples where the counts differrr,)�listrr$�	enumerate�range�	_Mismatchr-)r1r0r
�t�m�nZNULLr'r2�elem�cnt_s�cnt_tr3Z
other_elem�diffr
r
r�_count_diff_all_purposeys<


rLc	Cs�t|�t|�}}g}|��D]2\}}|�|d�}||krt|||�}|�|�q|��D]&\}}||krZtd||�}|�|�qZ|S)r@r)r�items�getrDr-)	r1r0r
rEr'rHrIrJrKr
r
r�_count_diff_hashable�srON)F)�__doc__�collectionsrrZos.pathrZ
__unittestrr	rrrrrr!rr+r7r<r?rDrLrOr
r
r
r�<module>s2
���
	)
#unittest/__pycache__/result.cpython-38.opt-2.pyc000064400000013117151153537550015556 0ustar00U

e5d�@sXddlZddlZddlZddlmZddlmZdZdd�ZdZ	d	Z
Gd
d�de�ZdS)�N�)�util��wrapsTcst���fdd��}|S)Ncs$t|dd�r|���|f|�|�S)N�failfastF)�getattr�stop)�self�args�kw��method��'/usr/lib64/python3.8/unittest/result.py�inner
szfailfast.<locals>.innerr)r
rrrrrsrz
Stdout:
%sz
Stderr:
%sc@s�eZdZdZdZdZd-dd�Zdd�Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
edd��Zedd��Zdd�Zdd�Zdd�Zdd�Zedd ��Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�ZdS).�
TestResultNFcCsbd|_g|_g|_d|_g|_g|_g|_d|_d|_d|_	d|_
d|_tj
|_tj|_d|_dS)NFr)r�failures�errors�testsRun�skipped�expectedFailures�unexpectedSuccesses�
shouldStop�buffer�	tb_locals�_stdout_buffer�_stderr_buffer�sys�stdout�_original_stdout�stderr�_original_stderr�
_mirrorOutput)r	�streamZdescriptions�	verbosityrrr�__init__&szTestResult.__init__cCsdS�Nr�r	rrr�printErrors7szTestResult.printErrorscCs |jd7_d|_|��dS)NrF)rr"�_setupStdout�r	�testrrr�	startTest:szTestResult.startTestcCs8|jr4|jdkr$t��|_t��|_|jt_|jt_dSr&)rr�io�StringIOrrrr r'rrrr)@s


zTestResult._setupStdoutcCsdSr&rr'rrr�startTestRunHszTestResult.startTestRuncCs|��d|_dS)NF)�_restoreStdoutr"r*rrr�stopTestNszTestResult.stopTestcCs�|jr�|jrltj��}tj��}|rF|�d�s6|d7}|j�t	|�|rl|�d�s\|d7}|j
�t|�|jt_|j
t_|j�
d�|j��|j�
d�|j��dS)N�
r)rr"rr�getvaluer �endswithr�write�STDOUT_LINEr!�STDERR_LINEr�seek�truncater)r	�output�errorrrrr0Ss$




zTestResult._restoreStdoutcCsdSr&rr'rrr�stopTestRunhszTestResult.stopTestRuncCs"|j�||�||�f�d|_dS�NT)r�append�_exc_info_to_stringr"�r	r+�errrrr�addErrornszTestResult.addErrorcCs"|j�||�||�f�d|_dSr=)rr>r?r"r@rrr�
addFailurevszTestResult.addFailurecCsZ|dk	rVt|dd�r|��t|d|j�r4|j}n|j}|�||�||�f�d|_dS)NrFrT)	rr�
issubclass�failureExceptionrrr>r?r")r	r+ZsubtestrArrrr�
addSubTest}szTestResult.addSubTestcCsdSr&rr*rrr�
addSuccess�szTestResult.addSuccesscCs|j�||f�dSr&)rr>)r	r+�reasonrrr�addSkip�szTestResult.addSkipcCs|j�||�||�f�dSr&)rr>r?r@rrr�addExpectedFailure�s�zTestResult.addExpectedFailurecCs|j�|�dSr&)rr>r*rrr�addUnexpectedSuccess�szTestResult.addUnexpectedSuccesscCs>t|j�t|j�kodkno<t|d�p<t|j�dkS)Nrr)�lenrr�hasattrrr'rrr�
wasSuccessful�s$�zTestResult.wasSuccessfulcCs
d|_dSr=)rr'rrrr�szTestResult.stopcCs�|\}}}|r |�|�r |j}q
||jkr6|�|�}nd}tj|||||jd�}t|���}|j	r�t
j��}	t
j
��}
|	r�|	�d�s�|	d7}	|�t|	�|
r�|
�d�s�|
d7}
|�t|
�d�|�S)N)�limit�capture_localsr2�)�_is_relevant_tb_level�tb_nextrE�_count_relevant_tb_levels�	traceback�TracebackExceptionr�list�formatrrrr3r r4r>r6r7�join)r	rAr+�exctype�value�tb�lengthZtb_eZmsgLinesr:r;rrrr?�s4

�



zTestResult._exc_info_to_stringcCsd|jjkS)N�
__unittest)�tb_frame�	f_globals)r	r\rrrrR�sz TestResult._is_relevant_tb_levelcCs&d}|r"|�|�s"|d7}|j}q|S)Nrr)rRrS)r	r\r]rrrrT�s
z$TestResult._count_relevant_tb_levelscCs&dt�|j�|jt|j�t|j�fS)Nz!<%s run=%i errors=%i failures=%i>)rZstrclass�	__class__rrLrrr'rrr�__repr__�s
��zTestResult.__repr__)NNN)�__name__�
__module__�__qualname__Z_previousTestClassZ_testRunEnteredZ_moduleSetUpFailedr%r(r,r)r/r1r0r<rrBrCrFrGrIrJrKrNrr?rRrTrbrrrrrs6



	r)
r-rrUrQr�	functoolsrr^rr6r7�objectrrrrr�<module>sunittest/__pycache__/__init__.cpython-38.opt-2.pyc000064400000002527151153537550016002 0ustar00U

e5d��@s�dddddddddd	d
ddd
ddddddgZe�dddg�dZddlmZddlmZddlmZm	Z	m
Z
mZmZm
Z
mZmZddlmZmZddlmZmZmZmZmZddlmZmZddlmZmZdd lmZm Z m!Z!m"Z"eZ#d!d"�Z$d#S)$�
TestResult�TestCase�IsolatedAsyncioTestCase�	TestSuite�TextTestRunner�
TestLoader�FunctionTestCase�main�defaultTestLoader�SkipTest�skip�skipIf�
skipUnless�expectedFailure�TextTestResult�installHandler�registerResult�removeResult�
removeHandler�addModuleCleanup�getTestCaseNames�	makeSuite�
findTestCasesT�)r)r)rrrr
rrr
r)�
BaseTestSuiter)rr	rrr)�TestProgramr)rr)rrrrcCs"ddl}|j�t�}|j||d�S)N�)Z	start_dir�pattern)Zos.path�path�dirname�__file__Zdiscover)�loaderZtestsr�osZthis_dir�r"�)/usr/lib64/python3.8/unittest/__init__.py�
load_testsLsr$N)%�__all__�extendZ
__unittest�resultrZ
async_caserZcaserrrr
rrr
rZsuiterrr rr	rrrrrZrunnerrrZsignalsrrrrZ_TextTestResultr$r"r"r"r#�<module>/s:�(unittest/__pycache__/mock.cpython-38.pyc000064400000227070151153537550014236 0ustar00U

e5d��@s�dZdZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
mZmZddl
mZddlmZmZdd�ee�D�Zd	ZeZd
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Zd�dd�Zdd�Zdd�Zdd�Z dd �Z!d�d!d"�Z"d#d$�Z#d%d&�Z$d'd(�Z%Gd)d*�d*e&�Z'Gd+d,�d,e&�Z(e(�Z)e)j*Z*e)j+Z,e)j-Z.d-d.d/d0d1d2d3d4hZ/d5d6�Z0Gd7d8�d8e1�Z2d9d:�Z3Gd;d<�d<e&�Z4Gd=d>�d>e&�Z5Gd?d@�d@e5�Z6dAdB�Z7GdCdD�dDe5�Z8GdEdF�dFe8e6�Z9dGdH�Z:dIdJ�Z;GdKdL�dLe&�Z<dMdN�Z=e*dddddfdOdP�Z>d�dQdR�Z?e*dddddfdSdT�Z@GdUdV�dVe&�ZAdWdX�ZBdYdZ�ZCe>e@_&eAe@_De?e@_EeCe@_Fd[e@_Gd\ZHd]ZId^�Jd_d`�eI�K�D��ZLd^�Jdad`�eI�K�D��ZMdbdcdddedfdgdhdidjdkdldmdndodpdqdrdshZNdtdu�ZOdvd�d^�JeHeIeLeMg��K�D�ZPdwdxdyhZQdzhZReQeRBZSePeNBZTeTeSBZUd{d|d}d~dd�d�d�hZVd�d��d�d��d�d��d�d��d��ZWeXeXeXeXd�dddd�d�d	d�dd��
ZYd�d��ZZd�d��Z[d�d��Z\d�d��Z]eZe[e\e]d��Z^d�d��Z_Gd�d��d�e5�Z`Gd�d��d�e`e6�ZaGd�d��d�e`�ZbGd�d��d�e`e9�ZcGd�d��d�e5�ZdGd�d��d�e5�ZeGd�d��d�eeebe9�ZfGd�d��d�e&�Zgeg�Zhd�d��ZiGd�d��d�ej�Zkekdd��Zld�d�d��Zmd�d��ZnGd�d��d�e&�Zoepem�epehjq�fZrdasd�d��Ztd�d�d��ZuGd�d��d�e9�Zvd�d��ZwGd�d��d��ZxdS)�)�Mock�	MagicMock�patch�sentinel�DEFAULT�ANY�call�create_autospec�	AsyncMock�
FILTER_DIR�NonCallableMock�NonCallableMagicMock�	mock_open�PropertyMock�sealz1.0�N)�CodeType�
ModuleType�
MethodType)�	safe_repr)�wraps�partialcCsh|]}|�d�s|�qS��_��
startswith)�.0�name�r�%/usr/lib64/python3.8/unittest/mock.py�	<setcomp>(s
rTcCs>t|�rt|t�sdSt|d�r*t|d�}t�|�p<t�|�S)NF�__func__)	�_is_instance_mock�
isinstancer	�hasattr�getattr�asyncio�iscoroutinefunction�inspectZisawaitable��objrrr�
_is_async_obj0s


r*cCst|dd�rt�|�SdSdS)N�__code__F)r$r%r&��funcrrr�_is_async_func8s
r.cCstt|�t�S�N)�
issubclass�typerr(rrrr!?sr!cCst|t�pt|t�ot|t�Sr/)r"�
BaseExceptionr1r0r(rrr�
_is_exceptionEs
�r3cCs"t|t�rt|d�r|jS|SdS�N�mock)r"�
FunctionTypesr#r5r(rrr�
_extract_mockLsr7cCs�t|t�r|s|j}d}n,t|t�sFz
|j}Wntk
rDYdSX|rVt|d�}n|}z|t�|�fWSt	k
r�YdSXdS)z�
    Given an arbitrary, possibly callable object, try to create a suitable
    signature object.
    Return a (reduced func, signature) tuple, or None.
    TN)
r"r1�__init__r6�__call__�AttributeErrorrr'�	signature�
ValueError)r-Zas_instanceZeat_selfZsig_funcrrr�_get_signature_objectUs

r=FcsNt|||���dkrdS�\}��fdd�}t||�|t|�_�t|�_dS)Ncs�j||�dSr/��bind��self�args�kwargs��sigrr�checksigwsz"_check_signature.<locals>.checksig)r=�_copy_func_detailsr1�_mock_check_sig�
__signature__)r-r5�	skipfirst�instancerFrrDr�_check_signaturers

rLc	Cs:dD]0}zt||t||��Wqtk
r2YqXqdS)N)�__name__�__doc__�__text_signature__�
__module__�__defaults__�__kwdefaults__)�setattrr$r:)r-�funcopy�	attributerrrrG~s
rGcCs@t|t�rdSt|tttf�r(t|j�St|dd�dk	r<dSdS)NTr9F)r"r1�staticmethod�classmethodr�	_callabler r$r(rrrrX�s

rXcCst|�ttfkSr/)r1�list�tupler(rrr�_is_list�sr[cCsFt|t�st|dd�dk	S|f|jD]}|j�d�dk	r&dSq&dS)ztGiven an object, return True if the object is callable.
    For classes, return True if instances would be callable.r9NTF)r"r1r$�__mro__�__dict__�get)r)�baserrr�_instance_callable�s
r`cs�t|t�}t|||�}|dkr"|S|\}��fdd�}t||�|j}|��sRd}||d�}d|}	t|	|�||}
t|
|��|
S)Ncs�j||�dSr/r>�rBrCrDrrrF�sz _set_signature.<locals>.checksigrT)Z
_checksig_r5zYdef %s(*args, **kwargs):
    _checksig_(*args, **kwargs)
    return mock(*args, **kwargs))r"r1r=rGrM�isidentifier�exec�_setup_func)r5�originalrKrJ�resultr-rFr�context�srcrTrrDr�_set_signature�s$


�
rics���_�fdd�}�fdd�}�fdd�}�fdd�}�fd	d
�}�fdd�}�fd
d�}	��fdd�}
d�_d�_d�_t��_t��_t��_�j�_�j	�_	�j
�_
|�_|�_|�_
|	�_|
�_|�_|�_|�_|�_��_dS)Ncs�j||�Sr/)�assert_called_withra�r5rrrj�sz'_setup_func.<locals>.assert_called_withcs�j||�Sr/)�
assert_calledrarkrrrl�sz"_setup_func.<locals>.assert_calledcs�j||�Sr/)�assert_not_calledrarkrrrm�sz&_setup_func.<locals>.assert_not_calledcs�j||�Sr/)�assert_called_oncerarkrrrn�sz'_setup_func.<locals>.assert_called_oncecs�j||�Sr/)�assert_called_once_withrarkrrro�sz,_setup_func.<locals>.assert_called_once_withcs�j||�Sr/)�assert_has_callsrarkrrrp�sz%_setup_func.<locals>.assert_has_callscs�j||�Sr/)�assert_any_callrarkrrrq�sz$_setup_func.<locals>.assert_any_callcs:t��_t��_����j}t|�r6|�k	r6|��dSr/)�	_CallList�method_calls�
mock_calls�
reset_mock�return_valuer!)�ret�rTr5rrru�sz_setup_func.<locals>.reset_mockFr)r5�called�
call_count�	call_argsrr�call_args_listrsrtrv�side_effect�_mock_childrenrjrorprqrurlrmrnrI�_mock_delegate)rTr5rErjrlrmrnrorprqrurrxrrd�s8rdcsJtjj�_d�_d�_t��_�fdd�}dD]}t�|t||��q.dS)Nrcst�j|�||�Sr/)r$r5)�attrrBrCrkrr�wrapper�sz"_setup_async_mock.<locals>.wrapper)�assert_awaited�assert_awaited_once�assert_awaited_with�assert_awaited_once_with�assert_any_await�assert_has_awaits�assert_not_awaited)	r%�
coroutines�
_is_coroutine�await_count�
await_argsrr�await_args_listrSr)r5r�rUrrkr�_setup_async_mock�s
r�cCsd|dd�|kS)N�__%s__����r�rrrr�	_is_magicsr�c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_SentinelObjectz!A unique, named, sentinel object.cCs
||_dSr/r��rArrrrr8sz_SentinelObject.__init__cCs
d|jS�Nzsentinel.%sr��rArrr�__repr__sz_SentinelObject.__repr__cCs
d|jSr�r�r�rrr�
__reduce__sz_SentinelObject.__reduce__N)rMrP�__qualname__rNr8r�r�rrrrr�sr�c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�	_SentinelzAAccess attributes to return a named object, usable as a sentinel.cCs
i|_dSr/)�
_sentinelsr�rrrr8#sz_Sentinel.__init__cCs|dkrt�|j�|t|��S)N�	__bases__)r:r��
setdefaultr�r�rrr�__getattr__&sz_Sentinel.__getattr__cCsdS)Nrrr�rrrr�,sz_Sentinel.__reduce__N)rMrPr�rNr8r�r�rrrrr�!sr�rv�_mock_return_valuer}�_mock_side_effect�_mock_parent�_mock_new_parent�
_mock_name�_mock_new_namecCs8t�|�d|}||fdd�}||fdd�}t||�S)NZ_mock_cSs"|j}|dkrt||�St||�Sr/)rr$)rAr�	_the_namerErrr�_getAs
z"_delegating_property.<locals>._getcSs*|j}|dkr||j|<nt|||�dSr/)rr]rS)rA�valuerr�rErrr�_setFsz"_delegating_property.<locals>._set)�_allowed_names�add�property)rr�r�r�rrr�_delegating_property>s

r�c@seZdZdd�Zdd�ZdS)rrcCslt|t�st�||�St|�}t|�}||kr2dStd||d�D]"}||||�}||krDdSqDdS)NFr�T)r"rY�__contains__�len�range)rAr�Z	len_valueZlen_self�iZsub_listrrrr�Ss
z_CallList.__contains__cCst�t|��Sr/)�pprintZpformatrYr�rrrr�asz_CallList.__repr__N)rMrPr�r�r�rrrrrrQsrrcCs|t|�}t|�sdS|js4|js4|jdk	s4|jdk	r8dS|}|dk	rX||krPdS|j}q<|rh||_||_|rx||_||_dS)NFT)r7r!r�r�r�r�)�parentr�r�new_name�_parentrrr�_check_and_set_parentes*��r�c@seZdZdd�Zdd�ZdS)�	_MockItercCst|�|_dSr/)�iterr))rAr)rrrr8�sz_MockIter.__init__cCs
t|j�Sr/)�nextr)r�rrr�__next__�sz_MockIter.__next__N)rMrPr�r8r�rrrrr��sr�c@seZdZeZdZdd�ZdS)�BaseNcOsdSr/rr@rrrr8�sz
Base.__init__)rMrPr�rr�r�r8rrrrr��sr�c@sdeZdZdZdd�ZdLdd�Zd	d
�ZdMdd�ZdNd
d�Zdd�Z	dd�Z
dZee	e
e�Z
edd��Zed�Zed�Zed�Zed�Zed�Zdd�Zdd�Zeee�ZdOddd�d d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Z dPd3d4�Z!d5d6�Z"d7d8�Z#d9d:�Z$d;d<�Z%d=d>�Z&d?d@�Z'dAdB�Z(dQdCdD�Z)dEdF�Z*dGdH�Z+dRdJdK�Z,dS)Srz A non-callable version of `Mock`c	Os�|f}t|t�s^t�tj�}|j|f|�|�j}dd�|��D�}|r^t	||d�r^t
|f}t|j|d|j
i�}tt|��|�}|S)NcSsg|]}|�d�r|�qS��specr�r�argrrr�
<listcomp>�s
�z+NonCallableMock.__new__.<locals>.<listcomp>rrN)r0r	r'r;rr8Zbind_partialZ	arguments�keysr*�AsyncMockMixinr1rMrN�_safe_super�__new__)	�clsrB�kw�basesrEZ
bound_argsZspec_arg�newrKrrrr��s
�zNonCallableMock.__new__N�FcKs�|dkr|}|j}
||
d<||
d<||
d<||
d<d|
d<|dk	rJ|}d}|
dkrZ|dk	}
|�|||	|
�i|
d<||
d	<d|
d
<d|
d<d|
d<d
|
d<t�|
d<t�|
d<t�|
d<||
d<|r�|jf|�tt|��||||||�dS)Nr�r�r�r�F�_mock_sealedTr~�_mock_wrapsrZ_mock_calledZ_mock_call_argsrZ_mock_call_countZ_mock_call_args_listZ_mock_mock_callsrs�_mock_unsafe)r]�_mock_add_specrr�configure_mockr�rr8)rAr�rr�spec_setr��_spec_state�	_new_name�_new_parent�_spec_as_instance�	_eat_selfZunsaferCr]rrrr8�sD



�zNonCallableMock.__init__cCs0t|�}d|_d|_d|_d|_t|||�dS)z�
        Attach a mock as an attribute of this one, replacing its name and
        parent. Calls to the attached mock will be recorded in the
        `method_calls` and `mock_calls` attributes of this one.Nr�)r7r�r�r�r�rS)rAr5rUZ
inner_mockrrr�attach_mock�szNonCallableMock.attach_mockcCs|�||�dS�z�Add a spec to a mock. `spec` can either be an object or a
        list of strings. Only attributes on the `spec` can be fetched as
        attributes from the mock.

        If `spec_set` is True then only attributes on the spec can be set.N)r��rAr�r�rrr�
mock_add_spec�szNonCallableMock.mock_add_speccCs�d}d}g}t|�D] }t�t||d��r|�|�q|dk	r~t|�s~t|t�rV|}nt|�}t|||�}	|	ot|	d}t|�}|j	}
||
d<||
d<||
d<||
d<||
d<dS)Nr��_spec_class�	_spec_set�_spec_signature�
_mock_methods�_spec_asyncs)
�dirr%r&r$�appendr[r"r1r=r])rAr�r�r�r�r�r�r�r��resr]rrrr��s,
�zNonCallableMock._mock_add_speccCs8|j}|jdk	r|jj}|tkr4|j|dd�}||_|S)N�()�r�r�)r�rrvr�_get_child_mock)rArwrrrZ__get_return_values
�z"NonCallableMock.__get_return_valuecCs,|jdk	r||j_n||_t||dd�dS)Nr�)rrvr�r�)rAr�rrrZ__set_return_values

z"NonCallableMock.__set_return_valuez1The value to be returned when the mock is called.cCs|jdkrt|�S|jSr/)r�r1r�rrr�	__class__!s
zNonCallableMock.__class__ryrzr{r|rtcCsN|j}|dkr|jS|j}|dk	rJt|�sJt|t�sJt|�sJt|�}||_|Sr/)rr�r}�callabler"r�r3)rA�	delegatedZsfrrrZ__get_side_effect.s��z!NonCallableMock.__get_side_effectcCs(t|�}|j}|dkr||_n||_dSr/)�	_try_iterrr�r})rAr�r�rrrZ__set_side_effect9s
z!NonCallableMock.__set_side_effect)rvr}cCs�|dkrg}t|�|krdS|�t|��d|_d|_d|_t�|_t�|_t�|_|r^t	|_
|rhd|_|j�
�D]"}t|t�sr|tkr�qr|�|�qr|j
}t|�r�||k	r�|�|�dS)z-Restore the mock object to its initial state.NFr)�idr�ryr{rzrrrtr|rsrr�r�r~�valuesr"�
_SpecState�_deletedrur!)rAZvisitedrvr}�childrwrrrruDs,zNonCallableMock.reset_mockcKsXt|��dd�d�D]>\}}|�d�}|��}|}|D]}t||�}q6t|||�qdS)aZSet attributes on the mock through keyword arguments.

        Attributes plus return values and side effects can be set on child
        mocks using standard dot notation and unpacking a dictionary in the
        method call:

        >>> attrs = {'method.return_value': 3, 'other.side_effect': KeyError}
        >>> mock.configure_mock(**attrs)cSs|d�d�S)Nr�.)�count)�entryrrr�<lambda>o�z0NonCallableMock.configure_mock.<locals>.<lambda>)�keyr�N)�sorted�items�split�popr$rS)rArCr��valrB�finalr)r�rrrr�bs	�
zNonCallableMock.configure_mockcCs�|dkrt|��n:|jdk	r<||jks.|tkrLtd|��nt|�rLt|��|jsd|�d�rdtd��|j�|�}|tkr�t|��np|dkr�d}|j	dk	r�t
|j	|�}|j|||||d�}||j|<n.t|t
�r�t|j|j|j|j|j�}||j|<|S)N>r�r�zMock object has no attribute %r)�assertZassretz1Attributes cannot start with 'assert' or 'assret')r�rrr�r�)r:r��_all_magicsr�r�rr~r^r�r�r$r�r"r�rr�r�rKr�r)rArrfrrrrr�xsF




�
�
zNonCallableMock.__getattr__cCs�|jg}|j}|}d}|dgkr$d}|dk	rZ|}|�|j|�d}|jdkrRd}|j}q$tt|��}|jpnd}t|�dkr�|ddkr�|d7}||d<d�|�S)Nr�r�r�r5r�)r�z().r)r�r�r�rY�reversedr�r��join)rAZ
_name_listr�Zlast�dotZ_firstrrr�_extract_mock_name�s(


z"NonCallableMock._extract_mock_namecCs^|��}d}|dkrd|}d}|jdk	rDd}|jr8d}||jj}dt|�j||t|�fS)Nr�)r5zmock.z name=%rz spec=%rz spec_set=%rz<%s%s%s id='%s'>)r�r�r�rMr1r�)rArZname_stringZspec_stringrrrr��s 
�zNonCallableMock.__repr__cCsvtst�|�S|jpg}tt|��}t|j�}dd�|j�	�D�}dd�|D�}dd�|D�}t
t||||��S)z8Filter the output of `dir(mock)` to only useful members.cSsg|]\}}|tk	r|�qSr)r�)rZm_nameZm_valuerrrr��s�z+NonCallableMock.__dir__.<locals>.<listcomp>cSsg|]}|�d�s|�qSrr�r�errrr��s
cSs"g|]}|�d�rt|�r|�qSr)rr�rrrrr��s
�)r
�object�__dir__r�r�r1rYr]r~r�r��set)rAZextrasZ	from_typeZ	from_dictZfrom_child_mocksrrrr�s


�zNonCallableMock.__dir__csT|tkrt��||�S�jrH�jdk	rH|�jkrH|�jkrHtd|��n�|tkrbd|}t|��n�|tkr�jdk	r�|�jkr�td|��t	|�s�t
t��|t||��|���fdd�}n(t
�|d|�t
t��||�|�j|<n,|dkr�|�_dSt
�|||��r|�j|<�j�rFt�|��sF����d|��}td|����t��||�S)Nz!Mock object has no attribute '%s'z.Attempting to set unsupported magic method %r.cs��f|�|�Sr/r�rBr��rerArrr��r�z-NonCallableMock.__setattr__.<locals>.<lambda>r�r�zCannot set )r�r�__setattr__r�r�r]r:�_unsupported_magicsr�r!rSr1�_get_methodr�r~r�r�r#r�)rArr��msg�	mock_namerrrr�s<��

zNonCallableMock.__setattr__cCs�|tkr2|t|�jkr2tt|�|�||jkr2dS|j�|t�}||jkr\tt|��	|�n|t
krlt|��|tk	r||j|=t
|j|<dSr/)r�r1r]�delattrr~r^�_missingr�r�__delattr__r�r:)rArr)rrrrs

zNonCallableMock.__delattr__cCs|jpd}t|||�Sr4)r��_format_call_signature�rArBrCrrrr�_format_mock_call_signatures
z+NonCallableMock._format_mock_call_signaturercCs.d}|�||�}|j}|j|�}||||fS)Nz.expected %s not found.
Expected: %s
Actual: %s)rr{)rArBrC�action�message�expected_stringr{Z
actual_stringrrr�_format_mock_failure_messages

z,NonCallableMock._format_mock_failure_messagecCsj|s
|jSd}|�dd��d�}|j}|D]:}|�|�}|dksJt|t�rPqfq*t|�}|j}|j}q*|S)aH
        * If call objects are asserted against a method/function like obj.meth1
        then there could be no name for the call object to lookup. Hence just
        return the spec_signature of the method/function being asserted against.
        * If the name is not empty then remove () and split by '.' to get
        list of names to iterate through the children until a potential
        match is found. A child mock is created only during attribute access
        so if we get a _SpecState then no attributes of the spec were accessed
        and can be safely exited.
        Nr�r�r�)r��replacer�r~r^r"r�r7)rArrE�namesZchildrenr�rrr�_get_call_signature_from_name's
z-NonCallableMock._get_call_signature_from_namec
Cs�t|t�r&t|�dkr&|�|d�}n|j}|dk	r�t|�dkrNd}|\}}n
|\}}}z||j||�fWStk
r�}z|�d�WY�Sd}~XYq�Xn|SdS)a
        Given a call (or simply an (args, kwargs) tuple), return a
        comparison key suitable for matching with other calls.
        This is a best effort method which relies on the spec's signature,
        if available, or falls back on the arguments themselves.
        r�rNr�)r"rZr�rr�r?�	TypeError�with_traceback)rA�_callrErrBrCrrrr�
_call_matcherHs

"zNonCallableMock._call_matchercCs0|jdkr,d|jpd|j|��f}t|��dS)z/assert that the mock was never called.
        rz9Expected '%s' to not have been called. Called %s times.%sr5N�rzr��_calls_repr�AssertionError�rAr
rrrrmbs
��z!NonCallableMock.assert_not_calledcCs$|jdkr d|jpd}t|��dS)z6assert that the mock was called at least once
        rz"Expected '%s' to have been called.r5N)rzr�rr rrrrlls

�zNonCallableMock.assert_calledcCs0|jdks,d|jpd|j|��f}t|��dS)z3assert that the mock was called only once.
        r�z:Expected '%s' to have been called once. Called %s times.%sr5Nrr rrrrnts
��z"NonCallableMock.assert_called_oncecs��jdkr.�����}d}d||f}t|�����fdd�}����f�}���j�}||kr~t|t�rn|nd}t|��|�dS)z�assert that the last call was made with the specified arguments.

        Raises an AssertionError if the args and keyword args passed in are
        different to the last call to the mock.Nznot called.z0expected call not found.
Expected: %s
Actual: %scs�����}|Sr/�r�r
�rBrCrArr�_error_message�sz:NonCallableMock.assert_called_with.<locals>._error_message)r{rrrr"�	Exception)rArBrC�expected�actualZ
error_messager$�causerr#rrj~s
�z"NonCallableMock.assert_called_withcOs8|jdks,d|jpd|j|��f}t|��|j||�S)ziassert that the mock was called exactly once and that that call was
        with the specified arguments.r�z3Expected '%s' to be called once. Called %s times.%sr5)rzr�rrrj�rArBrCr
rrrro�s
��z'NonCallableMock.assert_called_once_withc		s�fdd�|D�}tdd�|D�d�}t�fdd��jD��}|s�||kr�|dkrXd}nd�d	d�|D��}t|�d
t|���jdd��d
����|�dSt|�}g}|D]2}z|�|�Wq�t	k
r�|�
|�Yq�Xq�|�rtd�jp�dt|�|f�|�dS)a�assert the mock has been called with the specified calls.
        The `mock_calls` list is checked for the calls.

        If `any_order` is False (the default) then the calls must be
        sequential. There can be extra calls before or after the
        specified calls.

        If `any_order` is True then the calls can be in any order, but
        they must all appear in `mock_calls`.csg|]}��|��qSr�r�r�cr�rrr��sz4NonCallableMock.assert_has_calls.<locals>.<listcomp>css|]}t|t�r|VqdSr/�r"r%rrrr�	<genexpr>�s
z3NonCallableMock.assert_has_calls.<locals>.<genexpr>Nc3s|]}��|�VqdSr/r*r+r�rrr.�szCalls not found.z+Error processing expected calls.
Errors: {}cSsg|]}t|t�r|nd�qSr/r-rrrrr��s��
Expected: ZActual)�prefixr�z@%r does not contain all of %r in its call list, found %r insteadr5)
r�rrrt�formatrr�rstriprY�remover<r�r�rZ)	rA�calls�	any_orderr&r(Z	all_calls�problem�	not_found�kallrr�rrp�sH
��"������z NonCallableMock.assert_has_callscsZ��||f�}�fdd��jD�}||krVt|t�r8|nd}��||�}td|�|�dS)z�assert the mock has been called with the specified arguments.

        The assert passes if the mock has *ever* been called, unlike
        `assert_called_with` and `assert_called_once_with` that only pass if
        the call is the most recent one.csg|]}��|��qSrr*r+r�rrr��sz3NonCallableMock.assert_any_call.<locals>.<listcomp>Nz%s call not found)rr|r"r%rr�rArBrCr&r'r(rrr�rrq�s��zNonCallableMock.assert_any_callcKs�|�d�}||jdkr"tf|�St|�}t|t�rB|tkrBt}nbt|t�rp|tksd|j	rj||j	krjt}q�t}n4t|t
�s�t|t�r�t}q�t|t�r�t
}n
|jd}|jr�d|kr�d|dnd}|��|}t|��|f|�S)aPCreate the child mocks for attributes and return value.
        By default child mocks will be the same type as the parent.
        Subclasses of Mock may want to override this to customize the way
        child mocks are made.

        For non-callable mocks the callable variant will be used (rather than
        any custom subclass).r�r�r�rr�r�)r^r]r	r1r0r�_async_method_magicsr��_all_sync_magicsr��
CallableMixinrrrr\r�r�r:)rAr�r��_type�klassrUrrrrr��s2


��



zNonCallableMock._get_child_mock�CallscCs"|js
dSd|�dt|j��d�S)z�Renders self.mock_calls as a string.

        Example: "
Calls: [call(1), call(2)]."

        If self.mock_calls is empty, an empty string is returned. The
        output will be truncated if very long.
        r��
z: r�)rtr)rAr0rrrrszNonCallableMock._calls_repr)NNNNNNr�NFNF)F)FF)N)r)F)r?)-rMrPr�rNr�r8r�r�r�Z"_NonCallableMock__get_return_valueZ"_NonCallableMock__set_return_valueZ"_NonCallableMock__return_value_docr�rvr�r�ryrzr{r|rtZ!_NonCallableMock__get_side_effectZ!_NonCallableMock__set_side_effectr}rur�r�r�r�rrrrrrrrmrlrnrjrorprqr�rrrrrr�sp�
-
	�

�

''
!


-'rcCsL|dkr|St|�r|St|�r$|Sz
t|�WStk
rF|YSXdSr/)r3rXr�rr(rrrr�s
r�c
@sReZdZddedddddddf
dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)r<Nr�c	Ks6||jd<tt|�j|||||||	|
f|�||_dS)Nr�)r]r�r<r8r})rAr�r}rvrrr�r�r�r�r�rCrrrr8#s

��zCallableMixin.__init__cOsdSr/rr@rrrrH/szCallableMixin._mock_check_sigcOs$|j||�|j||�|j||�Sr/)rH�_increment_mock_call�
_mock_callr@rrrr94szCallableMixin.__call__cOs|j||�Sr/)�_execute_mock_callr@rrrrB<szCallableMixin._mock_callcOsd|_|jd7_t||fdd�}||_|j�|�|jdk	}|j}|j}|dk}|j	�td||f��|j
}|dk	r�|r�|j�t|||f��|jdk	}|r�|jd|}t|||f�}	|j	�|	�|jr�|r�d}
nd}
|jdk}|j|
|}|j
}qpdS)NTr���twor�r�r�)ryrz�_Callr{r|r�r�r�r�rtr�rs)rArBrCrZdo_method_callsZmethod_call_nameZmock_call_nameZ	is_a_callr�Zthis_mock_callr�rrrrA?s4


z"CallableMixin._increment_mock_callcOs||j}|dk	rPt|�r|�n(t|�s:t|�}t|�rD|�n
|||�}|tk	rP|S|jtk	r`|jS|jdk	rv|j||�S|jSr/)r}r3rXr�rr�rvr�)rArBrC�effectrfrrrrCms 


z CallableMixin._execute_mock_call)
rMrPr�rr8rHr9rBrArCrrrrr<!s�
.r<c@seZdZdZdS)ra�	
    Create a new `Mock` object. `Mock` takes several optional arguments
    that specify the behaviour of the Mock object:

    * `spec`: This can be either a list of strings or an existing object (a
      class or instance) that acts as the specification for the mock object. If
      you pass in an object then a list of strings is formed by calling dir on
      the object (excluding unsupported magic attributes and methods). Accessing
      any attribute not in this list will raise an `AttributeError`.

      If `spec` is an object (rather than a list of strings) then
      `mock.__class__` returns the class of the spec object. This allows mocks
      to pass `isinstance` tests.

    * `spec_set`: A stricter variant of `spec`. If used, attempting to *set*
      or get an attribute on the mock that isn't on the object passed as
      `spec_set` will raise an `AttributeError`.

    * `side_effect`: A function to be called whenever the Mock is called. See
      the `side_effect` attribute. Useful for raising exceptions or
      dynamically changing return values. The function is called with the same
      arguments as the mock, and unless it returns `DEFAULT`, the return
      value of this function is used as the return value.

      If `side_effect` is an iterable then each call to the mock will return
      the next value from the iterable. If any of the members of the iterable
      are exceptions they will be raised instead of returned.

    * `return_value`: The value returned when the mock is called. By default
      this is a new Mock (created on first access). See the
      `return_value` attribute.

    * `wraps`: Item for the mock object to wrap. If `wraps` is not None then
      calling the Mock will pass the call through to the wrapped object
      (returning the real result). Attribute access on the mock will return a
      Mock object that wraps the corresponding attribute of the wrapped object
      (so attempting to access an attribute that doesn't exist will raise an
      `AttributeError`).

      If the mock has an explicit `return_value` set then calls are not passed
      to the wrapped object and the `return_value` is returned instead.

    * `name`: If the mock has a name then it will be used in the repr of the
      mock. This can be useful for debugging. The name is propagated to child
      mocks.

    Mocks can also be called with arbitrary keyword arguments. These will be
    used to set attributes on the mock after it is created.
    N�rMrPr�rNrrrrr�srcCs8zt||�WStk
r2t|�t||�YSXdSr/)r$r:�
__import__)�thing�comp�import_pathrrr�_dot_lookup�s
rMcCsB|�d�}|�d�}t|�}|D]}|d|7}t|||�}q |S)Nr�rz.%s)r�r�rIrM)�targetZ
componentsrLrJrKrrr�	_importer�s

rOc@szeZdZdZgZdd�Zdd�Zdd�Zdd	�Ze	j
d
d��Zdd
�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�ZdS)�_patchNc

Csn|dk	r(|tk	rtd��|dk	r(td��||_||_||_||_||_||_d|_||_	||_
|	|_g|_dS)Nz,Cannot use 'new' and 'new_callable' togetherz1Cannot use 'autospec' and 'new_callable' togetherF)
rr<�getterrUr��new_callabler��createZ	has_localr��autospecrC�additional_patchers)
rArQrUr�r�rSr�rTrRrCrrrr8�s(��z_patch.__init__c
CsHt|j|j|j|j|j|j|j|j|j	�	}|j
|_
dd�|jD�|_|S)NcSsg|]}|���qSr)�copy)r�prrrr��sz_patch.copy.<locals>.<listcomp>)rPrQrUr�r�rSr�rTrRrC�attribute_namerU)rA�patcherrrrrV�s ��z_patch.copycCs2t|t�r|�|�St�|�r(|�|�S|�|�Sr/)r"r1�decorate_classr'r&�decorate_async_callable�decorate_callable�rAr-rrrr9�s




z_patch.__call__cCsNt|�D]@}|�tj�sqt||�}t|d�s0q|��}t||||��q|S�Nr9)r�rr�TEST_PREFIXr$r#rVrS)rAr>r��
attr_valuerYrrrrZs

z_patch.decorate_classc	csrg}t���\}|jD]8}|�|�}|jdk	r8|�|�q|jtkr|�|�q|t	|�7}||fVW5QRXdSr/)
�
contextlib�	ExitStack�	patchings�
enter_contextrX�updater�rr�rZ)rA�patchedrB�keywargs�
extra_args�
exit_stack�patchingr�rrr�decoration_helpers




z_patch.decoration_helpercs>t�d�r�j����St�����fdd����g�_�S)Nrcc
s4���||��\}}�||�W5QR�SQRXdSr/�rk�rBrgZnewargsZnewkeywargs�r-rfrArrrf(s�z)_patch.decorate_callable.<locals>.patched�r#rcr�rr]rrnrr\"s
z_patch.decorate_callablecs>t�d�r�j����St�����fdd����g�_�S)Nrcc
�s:���||��"\}}�||�IdHW5QR�SQRXdSr/rlrmrnrrrf9s�z/_patch.decorate_async_callable.<locals>.patchedror]rrnrr[3s
z_patch.decorate_async_callablec	Cs�|��}|j}t}d}z|j|}Wn$ttfk
rHt||t�}YnXd}|tkrft|t	�rfd|_
|j
s�|tkr�td||f��||fS)NFTz!%s does not have the attribute %r)rQrUrr]r:�KeyErrorr$�	_builtinsr"rrS)rArNrre�localrrr�get_originalDs 
�z_patch.get_originalcCs�|j|j|j}}}|j|j}}|j}|��|_|dkr@d}|dkrLd}|dkrXd}|dk	rp|dk	rptd��|dk	s�|dk	r�|dkr�td��|�	�\}}|t
k�r||dk�r|d}	|dkr�|}|dkr�|}d}n&|dk	r�|dkr�|}d}n|dkr�|}|dk	�s|dk	�r.|t
k�rtd��t|t��r.d}	|dk�rHt
|��rHt}
nt}
i}|dk	�r`|}
n^|dk	�st|dk	�r�|}|dk	�r�|}t|��r�d|k}
n
t|�}
t
|��r�t}
n
|
�r�t}
|dk	�r�||d	<|dk	�r�||d
<t|
t��rt|
t��r|j�r|j|d<|�|�|
f|�}|	�r�t|��r�|}|dk	�rB|}t|��sZt|��sZt}
|�d�|
f|dd
�|��|_nl|dk	�r�|t
k	�r�td��|t
k�r�td��t|�}|dk�r�|}t|f||jd�|��}n|�r�td��|}||_||_t� �|_!zrt"|j|j|�|j#dk	�rpi}|jt
k�r:|||j#<|j$D](}|j!�%|�}|jt
k�r@|�|��q@|WS|WS|j&t'�(���s��YnXdS)zPerform the patch.FNzCan't specify spec and autospec)TNz6Can't provide explicit spec_set *and* spec or autospecTz!Can't use 'spec' with create=Truer9r�r�rr�r�zBautospec creates the mock for you. Can't specify autospec and new.z%Can't use 'autospec' with create=True)r��_namez.Can't pass kwargs to a mock we aren't creating))r�r�r�rTrCrRrQrNrrsrr"r1r*r	rr[r�rr0rrUrer!r`r�rv�boolr�
temp_original�is_localrarb�_exit_stackrSrXrUrd�__exit__�sys�exc_info)rAr�r�r�rTrCrRrerrZinherit�Klass�_kwargsZ	this_specZnot_callableZnew_attrrhrjr�rrr�	__enter__\s�
�








��




�
�


�

��


z_patch.__enter__cGs�|jr$|jtk	r$t|j|j|j�n>t|j|j�|jsbt|j|j�rP|jdkrbt|j|j|j�|`|`|`|j	}|`	|j
|�S)zUndo the patch.)rNrPrQ�__annotations__rR)rwrvrrSrNrUrrSr#rxry)rAr{rirrrry�s�z_patch.__exit__cCs|��}|j�|�|S)z-Activate a patch, returning any created mock.)r~�_active_patchesr�)rArfrrr�start�sz_patch.startcCs6z|j�|�Wntk
r&YdSX|�ddd�S)zStop an active patch.N)r�r3r<ryr�rrr�stop�s
z_patch.stop)rMrPr�rXr�r8rVr9rZra�contextmanagerrkr\r[rsr~ryr�r�rrrrrP�s 

rPc	sPz��dd�\�}Wn&ttfk
r:td�f��YnX�fdd�}||fS)Nr�r�z.Need a valid target to patch. You supplied: %rcst��Sr/�rOr�rNrrr�r�z_get_target.<locals>.<lambda>)�rsplitrr<)rNrUrQrr�r�_get_target
s�r�c

s>t��tkrt��d����fdd�}	t|	||||||||�	S)a
    patch the named member (`attribute`) on an object (`target`) with a mock
    object.

    `patch.object` can be used as a decorator, class decorator or a context
    manager. Arguments `new`, `spec`, `create`, `spec_set`,
    `autospec` and `new_callable` have the same meaning as for `patch`. Like
    `patch`, `patch.object` takes arbitrary keyword arguments for configuring
    the mock object it creates.

    When used as a class decorator `patch.object` honours `patch.TEST_PREFIX`
    for choosing which methods to wrap.
    z3 must be the actual object to be patched, not a strcs�Sr/rrr�rrr�*r�z_patch_object.<locals>.<lambda>)r1�strrrP)
rNrUr�r�rSr�rTrRrCrQrr�r�
_patch_objects ��r�c
s�t��tkr�fdd�}n�fdd�}|s2td��t|���}|d\}	}
t||	|
|||||i�	}|	|_|dd�D]2\}	}
t||	|
|||||i�	}|	|_|j�|�qt|S)a�Perform multiple patches in a single call. It takes the object to be
    patched (either as an object or a string to fetch the object by importing)
    and keyword arguments for the patches::

        with patch.multiple(settings, FIRST_PATCH='one', SECOND_PATCH='two'):
            ...

    Use `DEFAULT` as the value if you want `patch.multiple` to create
    mocks for you. In this case the created mocks are passed into a decorated
    function by keyword, and a dictionary is returned when `patch.multiple` is
    used as a context manager.

    `patch.multiple` can be used as a decorator, class decorator or a context
    manager. The arguments `spec`, `spec_set`, `create`,
    `autospec` and `new_callable` have the same meaning as for `patch`. These
    arguments will be applied to *all* patches done by `patch.multiple`.

    When used as a class decorator `patch.multiple` honours `patch.TEST_PREFIX`
    for choosing which methods to wrap.
    cst��Sr/r�rr�rrr�Hr�z!_patch_multiple.<locals>.<lambda>cs�Sr/rrr�rrr�Jr�z=Must supply at least one keyword argument with patch.multiplerr�N)	r1r�r<rYr�rPrXrUr�)
rNr�rSr�rTrRrCrQr�rUr�rYZthis_patcherrr�r�_patch_multiple1sH���r�c

Ks$t|�\}}	t||	|||||||�	S)a7
    `patch` acts as a function decorator, class decorator or a context
    manager. Inside the body of the function or with statement, the `target`
    is patched with a `new` object. When the function/with statement exits
    the patch is undone.

    If `new` is omitted, then the target is replaced with an
    `AsyncMock if the patched object is an async function or a
    `MagicMock` otherwise. If `patch` is used as a decorator and `new` is
    omitted, the created mock is passed in as an extra argument to the
    decorated function. If `patch` is used as a context manager the created
    mock is returned by the context manager.

    `target` should be a string in the form `'package.module.ClassName'`. The
    `target` is imported and the specified object replaced with the `new`
    object, so the `target` must be importable from the environment you are
    calling `patch` from. The target is imported when the decorated function
    is executed, not at decoration time.

    The `spec` and `spec_set` keyword arguments are passed to the `MagicMock`
    if patch is creating one for you.

    In addition you can pass `spec=True` or `spec_set=True`, which causes
    patch to pass in the object being mocked as the spec/spec_set object.

    `new_callable` allows you to specify a different class, or callable object,
    that will be called to create the `new` object. By default `AsyncMock` is
    used for async functions and `MagicMock` for the rest.

    A more powerful form of `spec` is `autospec`. If you set `autospec=True`
    then the mock will be created with a spec from the object being replaced.
    All attributes of the mock will also have the spec of the corresponding
    attribute of the object being replaced. Methods and functions being
    mocked will have their arguments checked and will raise a `TypeError` if
    they are called with the wrong signature. For mocks replacing a class,
    their return value (the 'instance') will have the same spec as the class.

    Instead of `autospec=True` you can pass `autospec=some_object` to use an
    arbitrary object as the spec instead of the one being replaced.

    By default `patch` will fail to replace attributes that don't exist. If
    you pass in `create=True`, and the attribute doesn't exist, patch will
    create the attribute for you when the patched function is called, and
    delete it again afterwards. This is useful for writing tests against
    attributes that your production code creates at runtime. It is off by
    default because it can be dangerous. With it switched on you can write
    passing tests against APIs that don't actually exist!

    Patch can be used as a `TestCase` class decorator. It works by
    decorating each test method in the class. This reduces the boilerplate
    code when your test methods share a common patchings set. `patch` finds
    tests by looking for method names that start with `patch.TEST_PREFIX`.
    By default this is `test`, which matches the way `unittest` finds tests.
    You can specify an alternative prefix by setting `patch.TEST_PREFIX`.

    Patch can be used as a context manager, with the with statement. Here the
    patching applies to the indented block after the with statement. If you
    use "as" then the patched object will be bound to the name after the
    "as"; very useful if `patch` is creating a mock object for you.

    `patch` takes arbitrary keyword arguments. These will be passed to
    the `Mock` (or `new_callable`) on construction.

    `patch.dict(...)`, `patch.multiple(...)` and `patch.object(...)` are
    available for alternate use-cases.
    )r�rP)
rNr�r�rSr�rTrRrCrQrUrrrrbsF�rc@sReZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
eZe
ZdS)�_patch_dicta#
    Patch a dictionary, or dictionary like object, and restore the dictionary
    to its original state after the test.

    `in_dict` can be a dictionary or a mapping like container. If it is a
    mapping then it must at least support getting, setting and deleting items
    plus iterating over keys.

    `in_dict` can also be a string specifying the name of the dictionary, which
    will then be fetched by importing it.

    `values` can be a dictionary of values to set in the dictionary. `values`
    can also be an iterable of `(key, value)` pairs.

    If `clear` is True then the dictionary will be cleared before the new
    values are set.

    `patch.dict` can also be called with arbitrary keyword arguments to set
    values in the dictionary::

        with patch.dict('sys.modules', mymodule=Mock(), other_module=Mock()):
            ...

    `patch.dict` can be used as a context manager, decorator or class
    decorator. When used as a class decorator `patch.dict` honours
    `patch.TEST_PREFIX` for choosing which methods to wrap.
    rFcKs,||_t|�|_|j�|�||_d|_dSr/)�in_dict�dictr�re�clear�	_original)rAr�r�r�rCrrrr8�s

z_patch_dict.__init__cs.t�t�r����St����fdd��}|S)Ncs&���z�||�W�S���XdSr/)r��
_unpatch_dictr��frArr�_inner�sz$_patch_dict.__call__.<locals>._inner)r"r1rZr)rAr�r�rr�rr9�s


z_patch_dict.__call__cCsXt|�D]J}t||�}|�tj�rt|d�rt|j|j|j	�}||�}t
|||�q|Sr^)r�r$rrr_r#r�r�r�r�rS)rAr>r�r`Z	decoratorZ	decoratedrrrrZ�s
�z_patch_dict.decorate_classcCs|��|jS)zPatch the dict.)r�r�r�rrrr~�sz_patch_dict.__enter__cCs�|j}t|jt�rt|j�|_|j}|j}z|��}Wn.tk
rdi}|D]}||||<qNYnX||_|rxt	|�z|�
|�Wn*tk
r�|D]}||||<q�YnXdSr/)r�r"r�r�rOr�rVr:r��_clear_dictre)rAr�r�r�rer�rrrr��s&z_patch_dict._patch_dictcCsR|j}|j}t|�z|�|�Wn*tk
rL|D]}||||<q6YnXdSr/)r�r�r�rer:)rAr�rer�rrrr�sz_patch_dict._unpatch_dictcGs|��dS)zUnpatch the dict.F)r�)rArBrrrrysz_patch_dict.__exit__N)rF)
rMrPr�rNr8r9rZr~r�r�ryr�r�rrrrr��s
	
r�cCs>z|��Wn,tk
r8t|�}|D]
}||=q(YnXdSr/)r�r:rY)r�r�r�rrrr�&sr�cCsttj�D]}|��q
dS)z7Stop all active patches. LIFO to unroll nested patches.N)r�rPr�r�)rrrr�_patch_stopall/sr�Ztestz�lt le gt ge eq ne getitem setitem delitem len contains iter hash str sizeof enter exit divmod rdivmod neg pos abs invert complex int float index round trunc floor ceil bool next fspath aiter zHadd sub mul matmul div floordiv mod lshift rshift and xor or pow truediv� ccs|]}d|VqdS)zi%sNr�r�nrrrr.Nsr.ccs|]}d|VqdS)zr%sNrr�rrrr.Os�__get__�__set__�
__delete__�__reversed__�__missing__r��
__reduce_ex__Z__getinitargs__�__getnewargs__�__getstate__�__setstate__�
__getformat__Z
__setformat__r�r�__subclasses__�
__format__�__getnewargs_ex__cs�fdd�}||_|S)z:Turns a callable object (like a mock) into a real functioncs�|f|�|�Sr/r�rArBr�r,rr�method`sz_get_method.<locals>.method)rM)rr-r�rr,rr	^sr	cCsh|]}d|�qS)r�r)rr�rrrrfs�
__aenter__�	__aexit__�	__anext__�	__aiter__r�rr8r��__prepare__�__instancecheck__�__subclasscheck__�__del__cCs
t�|�Sr/)r�__hash__r�rrrr�|r�r�cCs
t�|�Sr/)r�__str__r�rrrr�}r�cCs
t�|�Sr/)r�
__sizeof__r�rrrr�~r�cCs"t|�j�d|���dt|���S)N�/)r1rMr�r�r�rrrr�r�)r�r�r��
__fspath__r�y�?g�?)
�__lt__�__gt__�__le__�__ge__�__int__r��__len__ry�__complex__�	__float__�__bool__�	__index__r�cs�fdd�}|S)Ncs$�jj}|tk	r|S�|kr dStS�NT)�__eq__r�r�NotImplemented)�other�ret_valr�rrr��sz_get_eq.<locals>.__eq__r)rAr�rr�r�_get_eq�sr�cs�fdd�}|S)Ncs �jjtk	rtS�|krdStS�NF)�__ne__r�rr�)r�r�rrr��s
z_get_ne.<locals>.__ne__r)rAr�rr�r�_get_ne�sr�cs�fdd�}|S)Ncs �jj}|tkrtg�St|�Sr/)�__iter__r�rr��r�r�rrr��sz_get_iter.<locals>.__iter__r)rAr�rr�r�	_get_iter�sr�cs�fdd�}|S)Ncs(�jj}|tkrttg��Stt|��Sr/)r�r�r�_AsyncIteratorr�r�r�rrr��sz"_get_async_iter.<locals>.__aiter__r)rAr�rr�r�_get_async_iter�sr�)r�r�r�r�cCsbt�|t�}|tk	r||_dSt�|�}|dk	rB||�}||_dSt�|�}|dk	r^||�|_dSr/)�_return_valuesr^rrv�_calculate_return_value�_side_effect_methodsr})r5r�rZfixedZreturn_calculatorrvZ
side_effectorrrr�_set_return_value�s

r�c@seZdZdd�Zdd�ZdS)�
MagicMixincOs&|��tt|�j||�|��dSr/)�_mock_set_magicsr�r�r8r�rrrr8�szMagicMixin.__init__cCs�ttB}|}t|dd�dk	rX|�|j�}t�}||}|D]}|t|�jkr:t||�q:|tt|�j�}t|�}|D]}t	||t
||��qvdS)Nr�)�_magicsr:r$�intersectionr�rr1r]rrS�
MagicProxy)rAZorig_magicsZthese_magicsZ
remove_magicsr�r=rrrr��szMagicMixin._mock_set_magicsN)rMrPr�r8r�rrrrr��sr�c@seZdZdZddd�ZdS)rz-A version of `MagicMock` that isn't callable.FcCs|�||�|��dSr��r�r�r�rrrr��sz"NonCallableMagicMock.mock_add_specN)F�rMrPr�rNr�rrrrr�src@seZdZdd�ZdS)�AsyncMagicMixincOs&|��tt|�j||�|��dSr/)r�r�r�r8r�rrrr8�szAsyncMagicMixin.__init__N�rMrPr�r8rrrrr��sr�c@seZdZdZddd�ZdS)ra�
    MagicMock is a subclass of Mock with default implementations
    of most of the magic methods. You can use MagicMock without having to
    configure the magic methods yourself.

    If you use the `spec` or `spec_set` arguments then *only* magic
    methods that exist in the spec will be created.

    Attributes and the return value of a `MagicMock` will also be `MagicMocks`.
    FcCs|�||�|��dSr�r�r�rrrr�szMagicMock.mock_add_specN)Fr�rrrrrs
rc@s&eZdZdd�Zdd�Zddd�ZdS)	r�cCs||_||_dSr/�rr�)rArr�rrrr8szMagicProxy.__init__cCs8|j}|j}|j|||d�}t|||�t|||�|S)N)rr�r�)rr�r�rSr�)rAr�r��mrrr�create_mocks�zMagicProxy.create_mockNcCs|��Sr/)r�)rAr)r=rrrr�(szMagicProxy.__get__)N)rMrPr�r8r�r�rrrrr�s	r�cs�eZdZed�Zed�Zed�Z�fdd�Zdd�Zdd	�Z	d
d�Z
dd
�Zdd�Zdd�Z
ddd�Zdd�Z�fdd�Z�ZS)r�r�r�r�cs\t�j||�tjj|jd<d|jd<d|jd<t�|jd<ttd�}t	j
|_||jd<dS)Nr�rZ_mock_await_countZ_mock_await_argsZ_mock_await_args_list�r�r+)�superr8r%r�r�r]rrrrr'ZCO_COROUTINE�co_flags)rArBrC�	code_mock�r�rrr81s


zAsyncMockMixin.__init__c�st||fdd�}|jd7_||_|j�|�|j}|dk	r�t|�rL|�nbt|�s�zt|�}Wnt	k
rxt
�YnXt|�r�|�n&t�|�r�|||�IdH}n
|||�}|t
k	r�|S|jt
k	r�|jS|jdk	r�t�|j�r�|j||�IdHS|j||�S|jS)NTrDr�)rFr�r�r�r�r}r3rXr��
StopIteration�StopAsyncIterationr%r&rr�rvr�)rArBrCrrGrfrrrrCAs6




z!AsyncMockMixin._execute_mock_callcCs(|jdkr$d|jpd�d�}t|��dS)zA
        Assert that the mock was awaited at least once.
        r�	Expected r5z to have been awaited.N�r�r�rr rrrr�is
zAsyncMockMixin.assert_awaitedcCs0|jdks,d|jpd�d|j�d�}t|��dS)z@
        Assert that the mock was awaited exactly once.
        r�r�r5�$ to have been awaited once. Awaited � times.Nr�r rrrr�qs
z"AsyncMockMixin.assert_awaited_oncecsz�jdkr&�����}td|�d������fdd�}����f�}���j�}||krvt|t�rf|nd}t|��|�dS)zN
        Assert that the last await was with the specified arguments.
        NzExpected await: z
Not awaitedcs�j��dd�}|S)N�await)rr!r"r#rrr$�sz:AsyncMockMixin.assert_awaited_with.<locals>._error_message)r�rrrr"r%)rArBrCr&r$r'r(rr#rr�zs
z"AsyncMockMixin.assert_awaited_withcOs8|jdks,d|jpd�d|j�d�}t|��|j||�S)zi
        Assert that the mock was awaited exactly once and with the specified
        arguments.
        r�r�r5r�r�)r�r�rr�r)rrrr��s
z'AsyncMockMixin.assert_awaited_once_withcsZ��||f�}�fdd��jD�}||krVt|t�r8|nd}��||�}td|�|�dS)zU
        Assert the mock has ever been awaited with the specified arguments.
        csg|]}��|��qSrr*r+r�rrr��sz3AsyncMockMixin.assert_any_await.<locals>.<listcomp>Nz%s await not found)rr�r"r%rrr9rr�rr��s��zAsyncMockMixin.assert_any_awaitFc		s��fdd�|D�}tdd�|D�d�}t�fdd��jD��}|s�||kr�|dkrXd}nd�d	d�|D��}t|�d
t|��d�j���|�dSt|�}g}|D]2}z|�|�Wq�tk
r�|�|�Yq�Xq�|r�tdt	|�f�|�dS)
a�
        Assert the mock has been awaited with the specified calls.
        The :attr:`await_args_list` list is checked for the awaits.

        If `any_order` is False (the default) then the awaits must be
        sequential. There can be extra calls before or after the
        specified awaits.

        If `any_order` is True then the awaits can be in any order, but
        they must all appear in :attr:`await_args_list`.
        csg|]}��|��qSrr*r+r�rrr��sz4AsyncMockMixin.assert_has_awaits.<locals>.<listcomp>css|]}t|t�r|VqdSr/r-rrrrr.�s
z3AsyncMockMixin.assert_has_awaits.<locals>.<genexpr>Nc3s|]}��|�VqdSr/r*r+r�rrr.�szAwaits not found.z,Error processing expected awaits.
Errors: {}cSsg|]}t|t�r|nd�qSr/r-rrrrr��s�r/z	
Actual: z%r not all found in await list)
r�rrr�r1rrYr3r<r�rZ)	rAr4r5r&r(Z
all_awaitsr6r7r8rr�rr��s>������z AsyncMockMixin.assert_has_awaitscCs0|jdkr,d|jpd�d|j�d�}t|��dS)z9
        Assert that the mock was never awaited.
        rr�r5z# to not have been awaited. Awaited r�Nr�r rrrr��s
z!AsyncMockMixin.assert_not_awaitedcs&t�j||�d|_d|_t�|_dS)z0
        See :func:`.Mock.reset_mock()`
        rN)r�rur�r�rrr�r@r�rrru�szAsyncMockMixin.reset_mock)F)rMrPr�r�r�r�r�r8rCr�r�r�r�r�r�r�ru�
__classcell__rrr�rr�,s(	
,	r�c@seZdZdZdS)r	aa
    Enhance :class:`Mock` with features allowing to mock
    an async function.

    The :class:`AsyncMock` object will behave so the object is
    recognized as an async function, and the result of a call is an awaitable:

    >>> mock = AsyncMock()
    >>> asyncio.iscoroutinefunction(mock)
    True
    >>> inspect.isawaitable(mock())
    True


    The result of ``mock()`` is an async function which will have the outcome
    of ``side_effect`` or ``return_value``:

    - if ``side_effect`` is a function, the async function will return the
      result of that function,
    - if ``side_effect`` is an exception, the async function will raise the
      exception,
    - if ``side_effect`` is an iterable, the async function will return the
      next value of the iterable, however, if the sequence of result is
      exhausted, ``StopIteration`` is raised immediately,
    - if ``side_effect`` is not defined, the async function will return the
      value defined by ``return_value``, hence, by default, the async function
      returns a new :class:`AsyncMock` object.

    If the outcome of ``side_effect`` or ``return_value`` is an async function,
    the mock async function obtained when the mock object is called will be this
    async function itself (and not an async function returning an async
    function).

    The test author can also specify a wrapped object with ``wraps``. In this
    case, the :class:`Mock` object behavior is the same as with an
    :class:`.Mock` object: the wrapped object may have methods
    defined as async function functions.

    Based on Martin Richard's asynctest project.
    NrHrrrrr	�sr	c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_ANYz2A helper object that compares equal to everything.cCsdSr�r�rAr�rrrr�	sz_ANY.__eq__cCsdSr�rr�rrrr�	sz_ANY.__ne__cCsdS)Nz<ANY>rr�rrrr�	sz
_ANY.__repr__N)rMrPr�rNr�r�r�rrrrr�	sr�cCs`d|}d}d�dd�|D��}d�dd�|��D��}|r@|}|rX|rP|d7}||7}||S)Nz%s(%%s)r�z, cSsg|]}t|��qSr)�reprr�rrrr�!	sz*_format_call_signature.<locals>.<listcomp>cSsg|]\}}d||f�qS)z%s=%rr)rr�r�rrrr�"	s)r�r�)rrBrCrZformatted_argsZargs_stringZ
kwargs_stringrrrr	s
�rc@s�eZdZdZd!dd�Zd"d	d
�Zdd�ZejZd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zedd��Zedd��Zdd�Zdd �ZdS)#rFa�
    A tuple for holding the results of a call to a mock, either in the form
    `(args, kwargs)` or `(name, args, kwargs)`.

    If args or kwargs are empty then a call tuple will compare equal to
    a tuple without those values. This makes comparisons less verbose::

        _Call(('name', (), {})) == ('name',)
        _Call(('name', (1,), {})) == ('name', (1,))
        _Call(((), {'a': 'b'})) == ({'a': 'b'},)

    The `_Call` object provides a useful shortcut for comparing with call::

        _Call(((1, 2), {'a': 3})) == call(1, 2, a=3)
        _Call(('foo', (1, 2), {'a': 3})) == call.foo(1, 2, a=3)

    If the _Call has no name then it will match any name.
    rr�NFTcCs�d}i}t|�}|dkr$|\}}}nr|dkrd|\}	}
t|	t�rX|	}t|
t�rR|
}qb|
}q�|	|
}}n2|dkr�|\}t|t�r�|}nt|t�r�|}n|}|r�t�|||f�St�||||f�S)Nr�r�r�)r�r"r�rZr�)r�r�rr�rE�	from_kallrBrC�_len�first�secondrrrr�C	s.



z
_Call.__new__cCs||_||_||_dSr/)r�r��_mock_from_kall)rAr�rr�rEr�rrrr8c	sz_Call.__init__cCsh|tkrdSzt|�}Wntk
r.YdSXd}t|�dkrJ|\}}n
|\}}}t|dd�r|t|dd�r||j|jkr|dSd}|dkr�di}}n�|dkr�|\}}}n�|d	kr�|\}	t|	t�r�|	}i}n"t|	t�r�|	}di}}nd}|	}nV|dk�r@|\}
}t|
t��r4|
}t|t��r(|i}}n
d|}}n
|
|}}ndS|�rX||k�rXdS||f||fkS)
NTFr�r�r�rrr�r�)rr�rr$r�r"rZr�)rAr�Z	len_otherZ	self_nameZ	self_argsZself_kwargsZ
other_nameZ
other_argsZother_kwargsr�r�r�rrrr�j	sR


�


z_Call.__eq__cOs<|jdkrtd||fdd�S|jd}t|j||f||d�S)Nr�r�r�r��r�rFrrrrr9�	s

z_Call.__call__cCs2|jdkrt|dd�Sd|j|f}t||dd�S)NF)rr�z%s.%s)rr�r�r�)rAr�rrrrr��	s
z_Call.__getattr__cCs|tjkrt�t�||�Sr/)rZr]r:�__getattribute__)rAr�rrrr��	s
z_Call.__getattribute__cOs|�d�||�S)Nr��r�r@rrrr��	sz_Call.countcOs|�d�||�S)N�indexr�r@rrrr��	sz_Call.indexcCs(t|�dkr|\}}n
|\}}}||fS)Nr�)r�rrrr�_get_call_arguments�	s

z_Call._get_call_argumentscCs|��dS�Nr�r�r�rrrrB�	sz
_Call.argscCs|��dS)Nr�r�r�rrrrC�	sz_Call.kwargscCs||js&|jpd}|�d�r"d|}|St|�dkr@d}|\}}n0|\}}}|sTd}n|�d�shd|}nd|}t|||�S)Nrr�zcall%sr�zcall.%s)r�r�rr�r)rArrBrCrrrr��	s





z_Call.__repr__cCs4g}|}|dk	r(|jr |�|�|j}qtt|��S)z�For a call object that represents multiple calls, `call_list`
        returns a list of all the intermediate calls as well as the
        final call.N)r�r�r�rrr�)rAZvalsrJrrr�	call_list�	s
z_Call.call_list)rr�NFT)rNNFT)rMrPr�rNr�r8r�rr�r9r�r�r�r�r�r�rBrCr�r�rrrrrF0	s*�
 �
7

rF)r�c	Kslt|�rt|�}t|t�}t|�}d|i}|r8d|i}n|dkrDi}|rT|rTd|d<|�|�t}	t�|�rri}n8|r�|r�td��t	}	n"t
|�s�t}	n|r�|r�t|�s�t}	|�
d|�}|}
|dkr�d}
|	f|||
|d	�|��}t|t��rt||�}|�rt|�nt||||�|dk	�r,|�s,||j|<|�rV|�sVd
|k�rVt||dd|d�|_t|�D�]}t|��rr�q^zt||�}
Wntk
�r�Y�q^YnXd|
i}|�r�d|
i}t|
t��s�t|
||||�}||j|<np|}t|t��r�|j}t|||�}||d
<t�|
��rt	}nt}|f||||d�|��}||j|<t|
||d�t|t��r^t|||��q^|S)aICreate a mock object using another object as a spec. Attributes on the
    mock will use the corresponding attribute on the `spec` object as their
    spec.

    Functions or methods being mocked will have their arguments checked
    to check that they are called with the correct signature.

    If `spec_set` is True then attempting to set attributes that don't exist
    on the spec object will raise an `AttributeError`.

    If a class is used as a spec then the return value of the mock (the
    instance of the class) will have the same spec. You can use a class as the
    spec for an instance object by passing `instance=True`. The returned mock
    will only be callable if instances of the mock are callable.

    `create_autospec` also takes arbitrary keyword arguments that are passed to
    the constructor of the created mock.r�r�NTr�zJInstance can not be True when create_autospec is mocking an async functionrr�)r�r�r�rrvr�)rKrtr�r�)r�rr�r�)rJ)r[r1r"r.rerr'Zisdatadescriptor�RuntimeErrorr	rXrr`r�r6rir�rLr~rrvr�r�r$r:r�r5�
_must_skipr%r&rS)r�r�rKr�rtrC�is_typeZ
is_async_funcr}r|r�r5r�rer�r�rJZchild_klassrrrr�	s�




��


�

��
rcCsxt|t�s$|t|di�krdS|j}|jD]H}|j�|t�}|tkrFq*t|tt	f�rZdSt|t
�rl|SdSq*|S)z[
    Return whether we should skip the first argument on spec's `entry`
    attribute.
    r]F)r"r1r$r�r\r]r^rrVrWr6)r�r�r�r>rfrrrr�w
s


r�c@seZdZddd�ZdS)r�FNcCs(||_||_||_||_||_||_dSr/)r��idsr�r�rKr)rAr�r�r�rr�rKrrrr8�
sz_SpecState.__init__)FNNNFr�rrrrr��
s
�r�cCs"t|t�rt�|�St�|�SdSr/)r"�bytes�io�BytesIO�StringIO)�	read_datarrr�
_to_stream�
s

rr�cs&t��}|dg���fdd�}��fdd�}��fdd����fdd	����fd
d�}tdkr�ddl}ttt|j���tt|j����a|dkr�t	d
t
d�}t	td����j_d�j
_d�j_d�j_d�j_|�j_���d<�d�j_|�j_��j_|�j_����fdd�}||_�|_|S)a�
    A helper function to create a mock to replace the use of `open`. It works
    for `open` called directly or used as a context manager.

    The `mock` argument is the mock object to configure. If `None` (the
    default) then a `MagicMock` will be created for you, with the API limited
    to methods or attributes available on standard file handles.

    `read_data` is a string for the `read`, `readline` and `readlines` of the
    file handle to return.  This is an empty string by default.
    Ncs$�jjdk	r�jjS�dj||�Sr�)�	readlinesrvra��_state�handlerr�_readlines_side_effect�
sz)mock_open.<locals>._readlines_side_effectcs$�jjdk	r�jjS�dj||�Sr�)�readrvrarrr�_read_side_effect�
sz$mock_open.<locals>._read_side_effectc?s$��EdH�dj||�VqdSr�)�readlinera)�_iter_side_effectrrr�_readline_side_effect�
sz(mock_open.<locals>._readline_side_effectc3s0�jjdk	r�jjVq�dD]
}|Vq dSr�)rrv)�linerrrr
�
sz$mock_open.<locals>._iter_side_effectcs �jjdk	r�jjSt�d�Sr�)rrvr�rrrr�_next_side_effect�
sz$mock_open.<locals>._next_side_effectr�open)rr�r�r�cs6t���d<�jj�dkr2���d<�d�j_tS)Nrr�)rrr}rra)rrrrrr�
reset_data�
s

zmock_open.<locals>.reset_data)r�	file_spec�_iorYrr��
TextIOWrapper�unionrrrr~rv�writer
rrr}r�r�)r5rZ
_read_datar	rrrrr)r
rrrrrr
�
s8"

r
c@s*eZdZdZdd�Zd	dd�Zdd�ZdS)
raW
    A mock intended to be used as a property, or other descriptor, on a class.
    `PropertyMock` provides `__get__` and `__set__` methods so you can specify
    a return value when it is fetched.

    Fetching a `PropertyMock` instance from an object calls the mock, with
    no args. Setting it calls the mock with the value being set.
    cKs
tf|�Sr/)r)rArCrrrr�szPropertyMock._get_child_mockNcCs|�Sr/r)rAr)Zobj_typerrrr�szPropertyMock.__get__cCs||�dSr/r)rAr)r�rrrr�
szPropertyMock.__set__)N)rMrPr�rNr�r�r�rrrrr�
s
rc	Cs^d|_t|�D]J}zt||�}Wntk
r8YqYnXt|t�sFq|j|krt|�qdS)a�Disable the automatic generation of child mocks.

    Given an input Mock, seals it to ensure no further mocks will be generated
    when accessing an attribute that was not already defined.

    The operation recursively seals the mock passed in, meaning that
    the mock itself, any mocks generated by accessing one of its attributes,
    and all assigned mocks without a name or spec will be sealed.
    TN)r�r�r$r:r"rr�r)r5r�r�rrrrs



rc@s(eZdZdZdd�Zdd�Zdd�ZdS)	r�z8
    Wraps an iterator in an asynchronous iterator.
    cCs&||_ttd�}tj|_||jd<dS)Nr�r+)�iteratorrrr'ZCO_ITERABLE_COROUTINEr�r])rArr�rrrr8+s
z_AsyncIterator.__init__cCs|Sr/rr�rrrr�1sz_AsyncIterator.__aiter__c�s*zt|j�WStk
r YnXt�dSr/)r�rr�r�r�rrrr�4s
z_AsyncIterator.__anext__N)rMrPr�rNr8r�r�rrrrr�'sr�)F)F)NFNNN)FFNN)Nr�)y�__all__�__version__r%rarr'r�rz�builtins�typesrrrZ
unittest.utilr�	functoolsrrr�rqr
r�r�r*r.r!r3r7r=rLrGrXr[r`rirdr�r�rr�r�rr�MISSINGr
ZDELETEDr�r�r�rYrrr�r�r�rr�r<rrMrOrPr�r�r�rr�r�r�r�ZmultipleZstopallr_Z
magic_methodsZnumericsr�r�Zinplace�rightZ
_non_defaultsr	r�r:Z_sync_async_magicsZ
_async_magicsr;r�rr�r�r�r�r�r�r�r�r�r�rr�rr�r�r	r�rrrZrFrrr�r�r1r�r6rrr
rrr�rrrr�<module>s~	



1�	h4<�
�
2�
Mw	���	�
���
	
	�	8+B
�
�
Nunittest/__pycache__/util.cpython-38.pyc000064400000010521151153537550014251 0ustar00U

e5d_�@s�dZddlmZmZddlmZdZdZdZdZ	dZ
dZee	eeee
Zedks\t
�dd	�Zd
d�Zdd
d�Zdd�Zdd�Zdd�Zdd�Zedd�Zdd�Zdd�ZdS)zVarious utility functions.�)�
namedtuple�Counter)�commonprefixT�P��cCsBt|�||}|tkr>d|d|�||t|�|d�f}|S)Nz%s[%d chars]%s)�len�_PLACEHOLDER_LEN)�s�	prefixlenZ	suffixlen�skip�r
�%/usr/lib64/python3.8/unittest/util.py�_shortens&rcs�ttt|��}ttt|��}|tkr(|St|��t���t|�tt}|t	kr�ttt	|�tkspt
�t�t|��t��fdd�|D��St�tt	��t��fdd�|D��S)Nc3s|]}�|�d�VqdS�Nr
��.0r
��prefixrr
r�	<genexpr>'sz'_common_shorten_repr.<locals>.<genexpr>c3s&|]}�t|�d�tt�VqdSr)r�
_MIN_DIFF_LEN�_MIN_END_LENrrr
rr*s�)�tuple�map�	safe_repr�maxr�_MAX_LENGTHr�_MIN_BEGIN_LENr	�_MIN_COMMON_LEN�AssertionErrorr)�args�maxlenZ
common_lenr
rr�_common_shorten_reprs*�
���r"FcCsPzt|�}Wntk
r*t�|�}YnX|r<t|�tkr@|S|dt�dS)Nz [truncated]...)�repr�	Exception�object�__repr__rr)�objZshort�resultr
r
rr-srcCsd|j|jfS)Nz%s.%s)�
__module__�__qualname__)�clsr
r
r�strclass6sr,cCsd}}g}g}z�||}||}||krT|�|�|d7}|||kr�|d7}q<nv||kr�|�|�|d7}|||kr�|d7}qnnD|d7}z|||kr�|d7}q�W5|d7}|||kr�|d7}q�XWqtk
�r|�||d��|�||d��Y�qYqXq||fS)arFinds elements in only one or the other of two, sorted input lists.

    Returns a two-element tuple of lists.    The first list contains those
    elements in the "expected" list but not in the "actual" list, and the
    second contains those elements in the "actual" list but not in the
    "expected" list.    Duplicate elements in either input list are ignored.
    r�N)�append�
IndexError�extend)�expected�actual�i�j�missingZ
unexpected�e�ar
r
r�sorted_list_difference9s8

r8cCsHg}|r@|��}z|�|�Wqtk
r<|�|�YqXq||fS)z�Same behavior as sorted_list_difference but
    for lists of unorderable items (like dicts).

    As it does a linear search per item (remove) it
    has O(n*n) performance.)�pop�remove�
ValueErrorr.)r1r2r5�itemr
r
r�unorderable_list_differencebsr=cCs||k||kS)z.Return -1 if x < y, 0 if x == y and 1 if x > yr
)�x�yr
r
r�
three_way_cmpssr@ZMismatchzactual expected valuecCs,t|�t|�}}t|�t|�}}t�}g}t|�D]�\}}	|	|krHq6d}
}t||�D] }|||	krZ|
d7}
|||<qZt|�D] \}}
|
|	kr�|d7}|||<q�|
|kr6t|
||	�}|�|�q6t|�D]X\}}	|	|kr�q�d}t||�D] }|||	kr�|d7}|||<q�td||	�}|�|�q�|S)�HReturns list of (cnt_act, cnt_exp, elem) triples where the counts differrr-)�listrr%�	enumerate�range�	_Mismatchr.)r2r1r
�t�m�nZNULLr(r3�elem�cnt_s�cnt_tr4Z
other_elem�diffr
r
r�_count_diff_all_purposeys<


rMc	Cs�t|�t|�}}g}|��D]2\}}|�|d�}||krt|||�}|�|�q|��D]&\}}||krZtd||�}|�|�qZ|S)rAr)r�items�getrEr.)	r2r1r
rFr(rIrJrKrLr
r
r�_count_diff_hashable�srPN)F)�__doc__�collectionsrrZos.pathrZ
__unittestrr	rrrrrrr"rr,r8r=r@rErMrPr
r
r
r�<module>s4
���
	)
#unittest/__pycache__/loader.cpython-38.pyc000064400000034312151153537550014546 0ustar00U

e5d�X�@sdZddlZddlZddlZddlZddlZddlZddlZddlmZm	Z	ddl
mZmZm
Z
dZe�dej�ZGdd	�d	ej�Zd
d�Zdd
�Zdd�Zdd�Zdd�ZGdd�de�Ze�Zddd�Ze
jdfdd�Zde
jejfdd�Z de
jejfdd�Z!dS) zLoading unittests.�N)�fnmatch�fnmatchcase�)�case�suite�utilTz[_a-z]\w*\.py$cs,eZdZdZ�fdd�Z�fdd�Z�ZS)�_FailedTestNcs||_tt|��|�dS�N)�
_exception�superr�__init__)�selfZmethod_name�	exception��	__class__��'/usr/lib64/python3.8/unittest/loader.pyrsz_FailedTest.__init__cs*|�jkrtt���|�S�fdd�}|S)Ncs
�j�dSr	)r
r�r
rr�testFailure!sz,_FailedTest.__getattr__.<locals>.testFailure)�_testMethodNamerr�__getattr__)r
�namerrrrrs
z_FailedTest.__getattr__)�__name__�
__module__�__qualname__rrr�
__classcell__rrrrrsrcCs"d|t��f}t|t|�||�S)Nz#Failed to import test module: %s
%s)�	traceback�
format_exc�_make_failed_test�ImportError)r�
suiteClass�messagerrr�_make_failed_import_test&s
�r"cCsdt��f}t||||�S)NzFailed to call load_tests:
%s)rrr)rrr r!rrr�_make_failed_load_tests+s�r#cCst||�}||f�|fSr	)r)�
methodnamerr r!�testrrrr0s
rcCs<t�t|��dd��}||i}tdtjf|�}|||�f�S)NcSsdSr	rrrrr�testSkipped5sz'_make_skipped_test.<locals>.testSkippedZ
ModuleSkipped)r�skip�str�type�TestCase)r$rr r&�attrsZ	TestClassrrr�_make_skipped_test4s

r,cCs*|���d�r|dd�Stj�|�dS)Nz	$py.classi����r)�lower�endswith�os�path�splitext)r0rrr�_jython_aware_splitext<sr2cs�eZdZdZdZeej�ZdZ	e
jZdZ
�fdd�Zdd�Zdd�d	d
�Zd!dd�Zd"d
d�Zdd�Zd#dd�Zdd�Zdd�Zdd�Zdd�Zd$dd�Zd%dd �Z�ZS)&�
TestLoaderz�
    This class is responsible for loading tests according to various criteria
    and returning them wrapped in a TestSuite
    r%Ncs tt|���g|_t�|_dSr	)rr3r�errors�set�_loading_packagesrrrrrMszTestLoader.__init__cCsFt|tj�rtd��|�|�}|s2t|d�r2dg}|�t||��}|S)z;Return a suite of all test cases contained in testCaseClasszYTest cases should not be derived from TestSuite. Maybe you meant to derive from TestCase?ZrunTest)�
issubclassr�	TestSuite�	TypeError�getTestCaseNames�hasattrr �map)r
�
testCaseClassZ
testCaseNamesZloaded_suiterrr�loadTestsFromTestCaseTs
z TestLoader.loadTestsFromTestCase��patternc

Os:t|�dksd|kr,t�dt�|�dd�t|�dkrRt|�d}td�|���t|�dkrxt|�d}td�|���g}t|�D]4}t	||�}t
|t�r�t|t
j�r�|�|�|��q�t	|dd�}	|�|�}|	dk	�r6z|	|||�WStk
�r4}
z,t|j|
|j�\}}|j�|�|WY�Sd}
~
XYnX|S)	z>Return a suite of all test cases contained in the given modulerZuse_load_testsz(use_load_tests is deprecated and ignoredNrzCloadTestsFromModule() takes 1 positional argument but {} were givenz=loadTestsFromModule() got an unexpected keyword argument '{}'�
load_tests)�len�warnings�warn�DeprecationWarning�popr9�format�sorted�dir�getattr�
isinstancer)r7rr*�appendr>r �	Exceptionr#rr4)
r
�moduler@�argsZkwsZ	complaint�testsr�objrA�e�
error_case�
error_messagerrr�loadTestsFromModulebs<�


�zTestLoader.loadTestsFromModulecCsX|�d�}d\}}|dkr�|dd�}|r�zd�|�}t|�}Wq�Wq&tk
r�|��}t||j�\}}|s�|j�|�|YSYq&Xq&|dd�}|}	|D]�}
z|	t	|	|
�}}	Wq�t
k
�rN}zvt	|	dd�dk	�r|dk	�r|j�|�|WY�DSt|
||jdt�
�f�\}}|j�|�|WY�
SW5d}~XYq�Xq�t|	tj��rj|�|	�St|	t��r�t|	tj��r�|�|	�St|	tj��r�t|t��r�t|tj��r�|d}||�}
tt	|
|�tj��s�|�|
g�Snt|	tj��r�|	St|	��rH|	�}t|tj��r|St|tj��r6|�|g�Std|	|f��ntd	|	��dS)
aSReturn a suite of all test cases given a string specifier.

        The name may resolve either to a module, a test case class, a
        test method within a test case class, or a callable object which
        returns a TestCase or TestSuite instance.

        The method optionally resolves the names relative to a given module.
        �.)NNNr�__path__zFailed to access attribute:
%s���z"calling %s returned %s, not a testz$don't know how to make test from: %s)�split�join�
__import__rrFr"r r4rLrJ�AttributeErrorrrrrK�types�
ModuleTyperUr)r7rr*r>�FunctionTyperr8�callabler9)r
rrN�partsrSrTZ
parts_copy�module_nameZnext_attributerQ�part�parentrR�instr%rrr�loadTestsFromName�s�	

����$

�
�
�zTestLoader.loadTestsFromNamecs��fdd�|D�}��|�S)z�Return a suite of all test cases found using the given sequence
        of string specifiers. See 'loadTestsFromName()'.
        csg|]}��|���qSr)rf)�.0r�rNr
rr�
<listcomp>�sz1TestLoader.loadTestsFromNames.<locals>.<listcomp>)r )r
�namesrNZsuitesrrhr�loadTestsFromNames�szTestLoader.loadTestsFromNamescs>��fdd�}tt|t����}�jr:|jt��j�d�|S)zLReturn a sorted sequence of method names found within testCaseClass
        csZ|��j�sdSt�|�}t|�s&dSd�j�j|f��jdkpXt�fdd��jD��S)NFz%s.%s.%sc3s|]}t�|�VqdSr	)r)rgr@�ZfullNamerr�	<genexpr>�szKTestLoader.getTestCaseNames.<locals>.shouldIncludeMethod.<locals>.<genexpr>)�
startswith�testMethodPrefixrJr`rr�testNamePatterns�any)�attrnameZtestFunc�r
r=rlr�shouldIncludeMethod�s
�
�z8TestLoader.getTestCaseNames.<locals>.shouldIncludeMethod)�key)�list�filterrI�sortTestMethodsUsing�sort�	functools�
cmp_to_key)r
r=rtZtestFnNamesrrsrr:�s
zTestLoader.getTestCaseNames�test*.pycCsJd}|dkr|jdk	r|j}n|dkr.d}|}tj�|�}|tjkrRtj�d|�||_d}d}g}tj�tj�|��r�tj�|�}||kr�tj�tj�|d��}�npzt	|�Wnt
k
r�d}Y�nJXtj|}|�d�d}	ztj�tj�
|j��}Wn�tk
�r�z
|j}
Wntk
�r8d}
YnX|
�r�|
jdk�r�|
jdk	�r�d}|jD]P}|�s||�|��s|�qb|�|j�dtjj��d|_|�|j||dd���qbn*|jtjk�r�td�d�ntd	�|��d�YnX|�r|�s|�|	�|_tj�|�ntj�|�|�r*t
d
|��|�s@t|�||��}|� |�S)a%Find and return all test modules from the specified start
        directory, recursing into subdirectories to find them and return all
        tests found within them. Only test files that match the pattern will
        be loaded. (Using shell style pattern matching.)

        All test modules must be importable from the top level of the project.
        If the start directory is not the top level directory then the top
        level directory must be specified separately.

        If a test package name (directory with '__init__.py') matches the
        pattern then the package will be checked for a 'load_tests' function. If
        this exists then it will be called with (loader, tests, pattern) unless
        the package has already had load_tests called from the same discovery
        invocation, in which case the package module object is not scanned for
        tests - this ensures that when a package uses discover to further
        discover child tests that infinite recursion does not happen.

        If load_tests exists then discovery does *not* recurse into the package,
        load_tests is responsible for loading all tests in the package.

        The pattern is deliberately not stored as a loader attribute so that
        packages can continue discovery themselves. top_level_dir is stored so
        load_tests does not need to pass this argument in to loader.discover().

        Paths are sorted before being imported to ensure reproducible execution
        order even on filesystems with non-alphabetical ordering like ext3/4.
        FNTr�__init__.pyrV)�	namespacez2Can not use builtin modules as dotted module namesz$don't know how to discover from {!r}z%Start directory is not importable: %r)!�_top_level_dirr/r0�abspath�sys�insert�isdir�isfilerZr[r�modulesrY�dirname�__file__r\�__spec__�loader�submodule_search_locationsrWrnr�replace�sep�extend�_find_tests�builtin_module_namesr9rG� _get_directory_containing_module�removervr )r
�	start_dirr@Z
top_level_dirZset_implicit_topZis_not_importable�is_namespacerPZ
the_moduleZtop_part�specr0rrr�discover�s�

�


�
���
������zTestLoader.discovercCsRtj|}tj�|j�}tj�|����d�rBtj�	tj�	|��Stj�	|�SdS)Nr})
r�r�r/r0r�r��basenamer-rnr�)r
rbrN�	full_pathrrrr�`s

z+TestLoader._get_directory_containing_modulecCsh||jkrdSttj�|��}tj�||j�}tj�|�rBtd��|�d�rTtd��|�	tjj
d�}|S)NrVzPath must be within the projectz..)rr2r/r0�normpath�relpath�isabs�AssertionErrorrnr�r�)r
r0Z_relpathrrrr�_get_name_from_pathls
zTestLoader._get_name_from_pathcCst|�tj|Sr	)r[r�r�)r
rrrr�_get_module_from_namexsz TestLoader._get_module_from_namecCs
t||�Sr	)r)r
r0r�r@rrr�_match_path|szTestLoader._match_pathFc

cs�|�|�}|dkrD||jkrD|�|||�\}}|dk	r<|V|sDdStt�|��}|D]t}tj�||�}	|�|	||�\}}|dk	r�|V|rV|�|	�}|j�|�z|�
|	||�EdHW5|j�	|�XqVdS)z/Used by discovery. Yields test suites it loads.rVN)r�r6�_find_test_pathrHr/�listdirr0rZ�add�discardr�)
r
r�r@r~rrPZshould_recurse�pathsr0r�rrrr��s6
��
zTestLoader._find_testsc
Csttj�|�}tj�|��rVt�|�s(dS|�|||�s:dS|�|�}z|�|�}Wnht	j
k
r�}zt|||j�dfWY�Sd}~XYn�t
||j�\}}	|j�|	�|dfYSXtj�t|d|��}
ttj�|
��}ttj�|��}|��|��k�r@tj�|�}
ttj�|��}tj�|�}d}t|||
|f��|j||d�dfS�ntj�|��rl|�s�tj�tj�|d���s�dSd}d}|�|�}z|�|�}Wnjt	j
k
�r�}zt|||j�dfWY�Sd}~XYn�t
||j�\}}	|j�|	�|dfYSXt|dd�}|j�|�z0|j||d�}|dk	�rP|dfW�S|d	fW�S|j�|�XndSdS)
z�Used by discovery.

        Loads tests from a single file, or a directories' __init__.py when
        passed the directory.

        Returns a tuple (None_or_tests_from_file, should_recurse).
        )NFFNr�zW%r module incorrectly imported from %r. Expected %r. Is this module globally installed?r?r}rAT)r/r0r�r��VALID_MODULE_NAME�matchr�r�r�rZSkipTestr,r r"r4rLr�rJr2�realpathr-r�rrUr�rZr6r�r�)r
r�r@r~r�rrNrRrSrTZmod_filer�Zfullpath_noextZ
module_dirZmod_nameZexpected_dir�msgrArP�packagerrrr��s|

&
�
�
�
�
���
&
�
zTestLoader._find_test_path)N)N)r|N)F)F)rrr�__doc__ro�staticmethodr�
three_way_cmprxrprr8r rrr>rUrfrkr:r�r�r�r�r�r�r�rrrrrr3Bs&
(
N

n
"r3cCs&t�}||_||_||_|r"||_|Sr	)r3rxrorpr )�prefix�	sortUsingr rpr�rrr�_makeLoader�sr�cCst|||d��|�S)N)rp)r�r:)r=r�r�rprrrr:�sr:r%cCst|||��|�Sr	)r�r>)r=r�r�r rrr�	makeSuite�s�r�cCst|||��|�Sr	)r�rU)rNr�r�r rrr�
findTestCasess�r�)NN)"r�r/�rer�rr]rzrCrr�rrrZ
__unittest�compile�
IGNORECASEr�r*rr"r#rr,r2�objectr3ZdefaultTestLoaderr�r�r:r8r�r�rrrr�<module>s</
	�
�unittest/__pycache__/async_case.cpython-38.pyc000064400000010131151153537550015401 0ustar00U

e5d��@s0ddlZddlZddlmZGdd�de�ZdS)�N�)�TestCasecs�eZdZd�fdd�	Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zd �fdd�	Z�ZS)!�IsolatedAsyncioTestCase�runTestcst��|�d|_d|_dS�N)�super�__init__�_asyncioTestLoop�_asyncioCallsQueue)�selfZ
methodName��	__class__��+/usr/lib64/python3.8/unittest/async_case.pyr"sz IsolatedAsyncioTestCase.__init__c�sdSrr�rrrr�
asyncSetUp'sz"IsolatedAsyncioTestCase.asyncSetUpc�sdSrrrrrr�
asyncTearDown*sz%IsolatedAsyncioTestCase.asyncTearDowncOs|j|f|�|�dSr)Z
addCleanup)r�func�args�kwargsrrr�addAsyncCleanup-s
z'IsolatedAsyncioTestCase.addAsyncCleanupcCs|��|�|j�dSr)ZsetUp�
_callAsyncrrrrr�
_callSetUp<sz"IsolatedAsyncioTestCase._callSetUpcCs|�|�dSr��_callMaybeAsync)r�methodrrr�_callTestMethod@sz'IsolatedAsyncioTestCase._callTestMethodcCs|�|j�|��dSr)rrZtearDownrrrr�
_callTearDownCsz%IsolatedAsyncioTestCase._callTearDowncOs|j|f|�|�dSrr)rZfunctionrrrrr�_callCleanupGsz$IsolatedAsyncioTestCase._callCleanupcOsL|jdk	st�|||�}t�|�s&t�|j��}|j�||f�|j�|�Sr�r	�AssertionError�inspectZisawaitable�
create_futurer
�
put_nowait�run_until_complete�rrrr�ret�futrrrrJs

z"IsolatedAsyncioTestCase._callAsynccOsP|jdk	st�|||�}t�|�rH|j��}|j�||f�|j�|�S|SdSrrr%rrrrRs


z'IsolatedAsyncioTestCase._callMaybeAsyncc
�s�t��|_}|�d�|��IdH}|��|dkr:dS|\}}z |IdH}|��s`|�|�Wqttfk
r|�Yqt	tj
fk
r�}z|��s�|�|�W5d}~XYqXqdSr)�asyncioZQueuer
Z
set_result�getZ	task_done�	cancelled�
SystemExit�KeyboardInterrupt�
BaseExceptionZCancelledErrorZ
set_exception)rr'ZqueueZqueryZ	awaitabler&Zexrrr�_asyncioLoopRunner\s 

z*IsolatedAsyncioTestCase._asyncioLoopRunnercCsX|jdkst�t��}t�|�|�d�||_|��}|�|�|��|_	|�
|�dS)NT)r	r r(Znew_event_loop�set_event_loopZ	set_debugr"Zcreate_taskr.Z_asyncioCallsTaskr$)r�loopr'rrr�_setupAsyncioLoopos

z)IsolatedAsyncioTestCase._setupAsyncioLoopc	Cs�|jdk	st�|j}d|_|j�d�|�|j���z�t�	|�}|sNW�vdS|D]}|�
�qR|�tj||dd���|D]0}|��r�q||�
�dk	r||�d|�
�|d��q||�|���W5t�d�|��XdS)NT)r0Zreturn_exceptionsz(unhandled exception during test shutdown)�message�	exception�task)r	r r
r#r$�joinr(r/�closeZ	all_tasksZcancelZgatherr*r3Zcall_exception_handlerZshutdown_asyncgens)rr0Z	to_cancelr4rrr�_tearDownAsyncioLoopys4

��

z,IsolatedAsyncioTestCase._tearDownAsyncioLoopNcs(|��zt��|�W�S|��XdSr)r1r7r�run)r�resultrrrr8�szIsolatedAsyncioTestCase.run)r)N)�__name__�
__module__�__qualname__rrrrrrrrrrr.r1r7r8�
__classcell__rrrrrs

"r)r(r!Zcaserrrrrr�<module>sunittest/__pycache__/__init__.cpython-38.pyc000064400000006070151153537550015037 0ustar00U

e5d��@s�dZddddddddd	d
ddd
dddddddgZe�dddg�dZddlmZddlmZddlm	Z	m
Z
mZmZm
Z
mZmZmZddlmZmZddlmZmZmZmZmZddlmZmZdd lmZmZdd!lm Z m!Z!m"Z"m#Z#eZ$d"d#�Z%d$S)%a�
Python unit testing framework, based on Erich Gamma's JUnit and Kent Beck's
Smalltalk testing framework (used with permission).

This module contains the core framework classes that form the basis of
specific test cases and suites (TestCase, TestSuite etc.), and also a
text-based utility class for running the tests and reporting the results
 (TextTestRunner).

Simple usage:

    import unittest

    class IntegerArithmeticTestCase(unittest.TestCase):
        def testAdd(self):  # test method names begin with 'test'
            self.assertEqual((1 + 2), 3)
            self.assertEqual(0 + 1, 1)
        def testMultiply(self):
            self.assertEqual((0 * 10), 0)
            self.assertEqual((5 * 8), 40)

    if __name__ == '__main__':
        unittest.main()

Further information is available in the bundled documentation, and from

  http://docs.python.org/library/unittest.html

Copyright (c) 1999-2003 Steve Purcell
Copyright (c) 2003-2010 Python Software Foundation
This module is free software, and you may redistribute it and/or modify
it under the same terms as Python itself, so long as this copyright message
and disclaimer are retained in their original form.

IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.

THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE.  THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS,
AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
�
TestResult�TestCase�IsolatedAsyncioTestCase�	TestSuite�TextTestRunner�
TestLoader�FunctionTestCase�main�defaultTestLoader�SkipTest�skip�skipIf�
skipUnless�expectedFailure�TextTestResult�installHandler�registerResult�removeResult�
removeHandler�addModuleCleanup�getTestCaseNames�	makeSuite�
findTestCasesT�)r)r)rrrr
rrr
r)�
BaseTestSuiter)rr	rrr)�TestProgramr)rr)rrrrcCs"ddl}|j�t�}|j||d�S)N�)Z	start_dir�pattern)Zos.path�path�dirname�__file__Zdiscover)�loaderZtestsr�osZthis_dir�r"�)/usr/lib64/python3.8/unittest/__init__.py�
load_testsLsr$N)&�__doc__�__all__�extendZ
__unittest�resultrZ
async_caserZcaserrrr
rrr
rZsuiterrr rr	rrrrrZrunnerrrZsignalsrrrrZ_TextTestResultr$r"r"r"r#�<module>s<.�(unittest/__pycache__/__main__.cpython-38.pyc000064400000000621151153537550015014 0ustar00U

e5d��@s`dZddlZejd�d�rBddlZej�ej�Zedejd<[dZ	ddl
m
Z
e
dd�dS)	zMain entry point�Nz__main__.pyz -m unittestT�)�main)�module)�__doc__�sys�argv�endswithZos.path�os�path�basename�
executableZ
__unittestr�r
r
�)/usr/lib64/python3.8/unittest/__main__.py�<module>sunittest/__pycache__/suite.cpython-38.opt-2.pyc000064400000021331151153537550015366 0ustar00U

e5d2�@sxddlZddlmZddlmZdZdd�ZGdd	�d	e�ZGd
d�de�ZGdd
�d
e�Z	dd�Z
Gdd�de�ZdS)�N�)�case)�utilTcCst||dd��}|�dS)NcSsdS�N�rrr�&/usr/lib64/python3.8/unittest/suite.py�<lambda>�z!_call_if_exists.<locals>.<lambda>)�getattr)�parent�attr�funcrrr�_call_if_existssrc@sjeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�
BaseTestSuiteTrcCsg|_d|_|�|�dS�Nr)�_tests�_removed_tests�addTests)�self�testsrrr�__init__szBaseTestSuite.__init__cCsdt�|j�t|�fS)Nz
<%s tests=%s>)r�strclass�	__class__�list�rrrr�__repr__szBaseTestSuite.__repr__cCs t||j�stSt|�t|�kSr)�
isinstancer�NotImplementedr)r�otherrrr�__eq__szBaseTestSuite.__eq__cCs
t|j�Sr)�iterrrrrr�__iter__"szBaseTestSuite.__iter__cCs$|j}|D]}|r
||��7}q
|Sr)r�countTestCases)rZcases�testrrrr"%s
zBaseTestSuite.countTestCasescCsLt|�std�t|����t|t�r<t|tjt	f�r<td��|j
�|�dS)Nz{} is not callablezNTestCases and TestSuites must be instantiated before passing them to addTest())�callable�	TypeError�format�reprr�type�
issubclassrZTestCase�	TestSuiter�append�rr#rrr�addTest,s�zBaseTestSuite.addTestcCs*t|t�rtd��|D]}|�|�qdS)Nz0tests must be an iterable of tests, not a string)r�strr%r-)rrr#rrrr6s
zBaseTestSuite.addTestscCs8t|�D]*\}}|jrq4||�|jr|�|�q|Sr)�	enumerate�
shouldStop�_cleanup�_removeTestAtIndex)r�result�indexr#rrr�run<szBaseTestSuite.runcCsNz|j|}Wntk
r"Yn(Xt|d�r@|j|��7_d|j|<dS)Nr")rr%�hasattrrr")rr4r#rrrr2Es
z BaseTestSuite._removeTestAtIndexcOs|j||�Sr�r5)r�args�kwdsrrr�__call__SszBaseTestSuite.__call__cCs|D]}|��qdSr)�debugr,rrrr;VszBaseTestSuite.debugN)r)�__name__�
__module__�__qualname__r1rrrr!r"r-rr5r2r:r;rrrrrs

	rc@sZeZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
d�Zddd�Z	dd�Z
dd�ZdS)r*FcCs�d}t|dd�dkrd|_}t|�D]�\}}|jr8q�t|�r�|�||�|�||�|�||�|j|_	t|jdd�s&t|dd�r�q&|s�||�n|�
�|jr&|�|�q&|r�|�d|�|�
|�d|_|S)NF�_testRunEnteredT�_classSetupFailed�_moduleSetUpFailed)r
r?r/r0�_isnotsuite�_tearDownPreviousClass�_handleModuleFixture�_handleClassSetUpr�_previousTestClassr;r1r2�_handleModuleTearDown)rr3r;ZtopLevelr4r#rrrr5fs2

�

z
TestSuite.runcCst�}|�|d�dS)NT)�_DebugResultr5)rr;rrrr;�szTestSuite.debugc	Cs2t|dd�}|j}||krdS|jr(dSt|dd�r8dSz
d|_Wntk
rVYnXt|dd�}|dk	�r.t|d�z^z
|�WnNt
k
r�}z0t|t�r��d|_t
�|�}|�	||d|�W5d}~XYnXW5t|d�|jdk�r,|��t|j�dk�r,|jD]}|j	||d	d||d
��qXdS)NrF�__unittest_skip__F�
setUpClass�_setupStdout�_restoreStdoutTrr��info)r
rrAr@r%r�doClassCleanups�len�tearDown_exceptions�"_createClassOrModuleLevelException�	ExceptionrrHrr)	rr#r3�
previousClass�currentClassrJ�exc�	className�errrrE�sL





�

�zTestSuite._handleClassSetUpcCs"d}t|dd�}|dk	r|j}|S)NrF)r
r=)rr3�previousModulerTrrr�_get_previous_module�s
zTestSuite._get_previous_modulec	
Cs|�|�}|jj}||krdS|�|�d|_ztj|}Wntk
rRYdSXt|dd�}|dk	�rt	|d�z�z
|�Wn�t
k
�r}zfzt��Wn2t
k
r�}z|�
||d|�W5d}~XYnXt|t�r�d|_|�
||d|�W5d}~XYnXW5t	|d�XdS)NF�setUpModulerKrLT)rZrr=rGrA�sys�modules�KeyErrorr
rrSr�doModuleCleanupsrRrrH)	rr#r3rYZ
currentModule�moduler[rXrVrrrrD�s>




�
�zTestSuite._handleModuleFixtureNcCs$|�d|�d�}|�||||�dS)Nz (�))�_addClassOrModuleLevelException)rr3rVZmethod_namerrN�	errorNamerrrrR�sz,TestSuite._createClassOrModuleLevelExceptioncCs^t|�}t|dd�}|dk	r8t|tj�r8||t|��n"|sN|�|t���n|�||�dS)N�addSkip)	�_ErrorHolderr
rrZSkipTestr.ZaddErrorr\�exc_info)rr3Z	exceptionrcrN�errorrdrrrrb�sz)TestSuite._addClassOrModuleLevelExceptioncCs|�|�}|dkrdS|jr dSztj|}Wntk
rDYdSXt|dd�}|dk	�rt|d�zNz
|�Wn>t	k
r�}z t|t�r��|�
||d|�W5d}~XYnXW5t|d�zt��Wn4t	k
�r}z|�
||d|�W5d}~XYnXXdS)N�tearDownModulerKrL)
rZrAr\r]r^r
rrr_rSrRrrH)rr3rYr`rhrXrrrrG�s:




�
�zTestSuite._handleModuleTearDownc	Cst|dd�}|j}||krdSt|dd�r.dSt|dd�r>dSt|dd�rNdSt|dd�}|dk	�rt|d�zXz
|�WnHt	k
r�}z*t
|t�r��t�|�}|�||d|�W5d}~XYnXW5t|d�|��t|j�d	k�r|jD]&}t�|�}|j||d
d||d�q�XdS)NrFr@FrArI�
tearDownClassrKrLrrrM)r
rrrOrPrQrrrRrSrrH)	rr#r3rTrUrirVrWrXrrrrCsB




�


�z TestSuite._tearDownPreviousClass)F)N)N)r<r=r>r5r;rErZrDrRrbrGrCrrrrr*\s

!($�
�
 r*c@sPeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�ZdS)reNcCs
||_dSr��description)rrkrrrrBsz_ErrorHolder.__init__cCs|jSrrjrrrr�idEsz_ErrorHolder.idcCsdSrrrrrr�shortDescriptionHsz_ErrorHolder.shortDescriptioncCsd|jfS)Nz<ErrorHolder description=%r>rjrrrrrKsz_ErrorHolder.__repr__cCs|��Sr)rlrrrr�__str__Nsz_ErrorHolder.__str__cCsdSrr�rr3rrrr5Qsz_ErrorHolder.runcCs
|�|�Srr7rorrrr:Vsz_ErrorHolder.__call__cCsdSrrrrrrr"Ysz_ErrorHolder.countTestCases)r<r=r>ZfailureExceptionrrlrmrrnr5r:r"rrrrre6s
recCs(zt|�Wntk
r"YdSXdS)NTF)r r%)r#rrrrB\s
rBc@seZdZdZdZdZdS)rHNF)r<r=r>rFrAr0rrrrrHesrH)r\�rrZ
__unittestr�objectrr*rerBrHrrrr�<module>sL[&	unittest/__pycache__/loader.cpython-38.opt-1.pyc000064400000034137151153537550015512 0ustar00U

e5d�X�@sdZddlZddlZddlZddlZddlZddlZddlZddlmZm	Z	ddl
mZmZm
Z
dZe�dej�ZGdd	�d	ej�Zd
d�Zdd
�Zdd�Zdd�Zdd�ZGdd�de�Ze�Zddd�Ze
jdfdd�Zde
jejfdd�Z de
jejfdd�Z!dS) zLoading unittests.�N)�fnmatch�fnmatchcase�)�case�suite�utilTz[_a-z]\w*\.py$cs,eZdZdZ�fdd�Z�fdd�Z�ZS)�_FailedTestNcs||_tt|��|�dS�N)�
_exception�superr�__init__)�selfZmethod_name�	exception��	__class__��'/usr/lib64/python3.8/unittest/loader.pyrsz_FailedTest.__init__cs*|�jkrtt���|�S�fdd�}|S)Ncs
�j�dSr	)r
r�r
rr�testFailure!sz,_FailedTest.__getattr__.<locals>.testFailure)�_testMethodNamerr�__getattr__)r
�namerrrrrs
z_FailedTest.__getattr__)�__name__�
__module__�__qualname__rrr�
__classcell__rrrrrsrcCs"d|t��f}t|t|�||�S)Nz#Failed to import test module: %s
%s)�	traceback�
format_exc�_make_failed_test�ImportError)r�
suiteClass�messagerrr�_make_failed_import_test&s
�r"cCsdt��f}t||||�S)NzFailed to call load_tests:
%s)rrr)rrr r!rrr�_make_failed_load_tests+s�r#cCst||�}||f�|fSr	)r)�
methodnamerr r!�testrrrr0s
rcCs<t�t|��dd��}||i}tdtjf|�}|||�f�S)NcSsdSr	rrrrr�testSkipped5sz'_make_skipped_test.<locals>.testSkippedZ
ModuleSkipped)r�skip�str�type�TestCase)r$rr r&�attrsZ	TestClassrrr�_make_skipped_test4s

r,cCs*|���d�r|dd�Stj�|�dS)Nz	$py.classi����r)�lower�endswith�os�path�splitext)r0rrr�_jython_aware_splitext<sr2cs�eZdZdZdZeej�ZdZ	e
jZdZ
�fdd�Zdd�Zdd�d	d
�Zd!dd�Zd"d
d�Zdd�Zd#dd�Zdd�Zdd�Zdd�Zdd�Zd$dd�Zd%dd �Z�ZS)&�
TestLoaderz�
    This class is responsible for loading tests according to various criteria
    and returning them wrapped in a TestSuite
    r%Ncs tt|���g|_t�|_dSr	)rr3r�errors�set�_loading_packagesrrrrrMszTestLoader.__init__cCsFt|tj�rtd��|�|�}|s2t|d�r2dg}|�t||��}|S)z;Return a suite of all test cases contained in testCaseClasszYTest cases should not be derived from TestSuite. Maybe you meant to derive from TestCase?ZrunTest)�
issubclassr�	TestSuite�	TypeError�getTestCaseNames�hasattrr �map)r
�
testCaseClassZ
testCaseNamesZloaded_suiterrr�loadTestsFromTestCaseTs
z TestLoader.loadTestsFromTestCase��patternc

Os:t|�dksd|kr,t�dt�|�dd�t|�dkrRt|�d}td�|���t|�dkrxt|�d}td�|���g}t|�D]4}t	||�}t
|t�r�t|t
j�r�|�|�|��q�t	|dd�}	|�|�}|	dk	�r6z|	|||�WStk
�r4}
z,t|j|
|j�\}}|j�|�|WY�Sd}
~
XYnX|S)	z>Return a suite of all test cases contained in the given modulerZuse_load_testsz(use_load_tests is deprecated and ignoredNrzCloadTestsFromModule() takes 1 positional argument but {} were givenz=loadTestsFromModule() got an unexpected keyword argument '{}'�
load_tests)�len�warnings�warn�DeprecationWarning�popr9�format�sorted�dir�getattr�
isinstancer)r7rr*�appendr>r �	Exceptionr#rr4)
r
�moduler@�argsZkwsZ	complaint�testsr�objrA�e�
error_case�
error_messagerrr�loadTestsFromModulebs<�


�zTestLoader.loadTestsFromModulecCsX|�d�}d\}}|dkr�|dd�}|r�zd�|�}t|�}Wq�Wq&tk
r�|��}t||j�\}}|s�|j�|�|YSYq&Xq&|dd�}|}	|D]�}
z|	t	|	|
�}}	Wq�t
k
�rN}zvt	|	dd�dk	�r|dk	�r|j�|�|WY�DSt|
||jdt�
�f�\}}|j�|�|WY�
SW5d}~XYq�Xq�t|	tj��rj|�|	�St|	t��r�t|	tj��r�|�|	�St|	tj��r�t|t��r�t|tj��r�|d}||�}
tt	|
|�tj��s�|�|
g�Snt|	tj��r�|	St|	��rH|	�}t|tj��r|St|tj��r6|�|g�Std|	|f��ntd	|	��dS)
aSReturn a suite of all test cases given a string specifier.

        The name may resolve either to a module, a test case class, a
        test method within a test case class, or a callable object which
        returns a TestCase or TestSuite instance.

        The method optionally resolves the names relative to a given module.
        �.)NNNr�__path__zFailed to access attribute:
%s���z"calling %s returned %s, not a testz$don't know how to make test from: %s)�split�join�
__import__rrFr"r r4rLrJ�AttributeErrorrrrrK�types�
ModuleTyperUr)r7rr*r>�FunctionTyperr8�callabler9)r
rrN�partsrSrTZ
parts_copy�module_nameZnext_attributerQ�part�parentrR�instr%rrr�loadTestsFromName�s�	

����$

�
�
�zTestLoader.loadTestsFromNamecs��fdd�|D�}��|�S)z�Return a suite of all test cases found using the given sequence
        of string specifiers. See 'loadTestsFromName()'.
        csg|]}��|���qSr)rf)�.0r�rNr
rr�
<listcomp>�sz1TestLoader.loadTestsFromNames.<locals>.<listcomp>)r )r
�namesrNZsuitesrrhr�loadTestsFromNames�szTestLoader.loadTestsFromNamescs>��fdd�}tt|t����}�jr:|jt��j�d�|S)zLReturn a sorted sequence of method names found within testCaseClass
        csZ|��j�sdSt�|�}t|�s&dSd�j�j|f��jdkpXt�fdd��jD��S)NFz%s.%s.%sc3s|]}t�|�VqdSr	)r)rgr@�ZfullNamerr�	<genexpr>�szKTestLoader.getTestCaseNames.<locals>.shouldIncludeMethod.<locals>.<genexpr>)�
startswith�testMethodPrefixrJr`rr�testNamePatterns�any)�attrnameZtestFunc�r
r=rlr�shouldIncludeMethod�s
�
�z8TestLoader.getTestCaseNames.<locals>.shouldIncludeMethod)�key)�list�filterrI�sortTestMethodsUsing�sort�	functools�
cmp_to_key)r
r=rtZtestFnNamesrrsrr:�s
zTestLoader.getTestCaseNames�test*.pycCsJd}|dkr|jdk	r|j}n|dkr.d}|}tj�|�}|tjkrRtj�d|�||_d}d}g}tj�tj�|��r�tj�|�}||kr�tj�tj�|d��}�npzt	|�Wnt
k
r�d}Y�nJXtj|}|�d�d}	ztj�tj�
|j��}Wn�tk
�r�z
|j}
Wntk
�r8d}
YnX|
�r�|
jdk�r�|
jdk	�r�d}|jD]P}|�s||�|��s|�qb|�|j�dtjj��d|_|�|j||dd���qbn*|jtjk�r�td�d�ntd	�|��d�YnX|�r|�s|�|	�|_tj�|�ntj�|�|�r*t
d
|��|�s@t|�||��}|� |�S)a%Find and return all test modules from the specified start
        directory, recursing into subdirectories to find them and return all
        tests found within them. Only test files that match the pattern will
        be loaded. (Using shell style pattern matching.)

        All test modules must be importable from the top level of the project.
        If the start directory is not the top level directory then the top
        level directory must be specified separately.

        If a test package name (directory with '__init__.py') matches the
        pattern then the package will be checked for a 'load_tests' function. If
        this exists then it will be called with (loader, tests, pattern) unless
        the package has already had load_tests called from the same discovery
        invocation, in which case the package module object is not scanned for
        tests - this ensures that when a package uses discover to further
        discover child tests that infinite recursion does not happen.

        If load_tests exists then discovery does *not* recurse into the package,
        load_tests is responsible for loading all tests in the package.

        The pattern is deliberately not stored as a loader attribute so that
        packages can continue discovery themselves. top_level_dir is stored so
        load_tests does not need to pass this argument in to loader.discover().

        Paths are sorted before being imported to ensure reproducible execution
        order even on filesystems with non-alphabetical ordering like ext3/4.
        FNTr�__init__.pyrV)�	namespacez2Can not use builtin modules as dotted module namesz$don't know how to discover from {!r}z%Start directory is not importable: %r)!�_top_level_dirr/r0�abspath�sys�insert�isdir�isfilerZr[r�modulesrY�dirname�__file__r\�__spec__�loader�submodule_search_locationsrWrnr�replace�sep�extend�_find_tests�builtin_module_namesr9rG� _get_directory_containing_module�removervr )r
�	start_dirr@Z
top_level_dirZset_implicit_topZis_not_importable�is_namespacerPZ
the_moduleZtop_part�specr0rrr�discover�s�

�


�
���
������zTestLoader.discovercCsRtj|}tj�|j�}tj�|����d�rBtj�	tj�	|��Stj�	|�SdS)Nr})
r�r�r/r0r�r��basenamer-rnr�)r
rbrN�	full_pathrrrr�`s

z+TestLoader._get_directory_containing_modulecCsB||jkrdSttj�|��}tj�||j�}|�tjjd�}|S)NrV)rr2r/r0�normpath�relpathr�r�)r
r0Z_relpathrrrr�_get_name_from_pathls
zTestLoader._get_name_from_pathcCst|�tj|Sr	)r[r�r�)r
rrrr�_get_module_from_namexsz TestLoader._get_module_from_namecCs
t||�Sr	)r)r
r0r�r@rrr�_match_path|szTestLoader._match_pathFc

cs�|�|�}|dkrD||jkrD|�|||�\}}|dk	r<|V|sDdStt�|��}|D]t}tj�||�}	|�|	||�\}}|dk	r�|V|rV|�|	�}|j�|�z|�
|	||�EdHW5|j�	|�XqVdS)z/Used by discovery. Yields test suites it loads.rVN)r�r6�_find_test_pathrHr/�listdirr0rZ�add�discardr�)
r
r�r@r~rrPZshould_recurse�pathsr0r�rrrr��s6
��
zTestLoader._find_testsc
Csttj�|�}tj�|��rVt�|�s(dS|�|||�s:dS|�|�}z|�|�}Wnht	j
k
r�}zt|||j�dfWY�Sd}~XYn�t
||j�\}}	|j�|	�|dfYSXtj�t|d|��}
ttj�|
��}ttj�|��}|��|��k�r@tj�|�}
ttj�|��}tj�|�}d}t|||
|f��|j||d�dfS�ntj�|��rl|�s�tj�tj�|d���s�dSd}d}|�|�}z|�|�}Wnjt	j
k
�r�}zt|||j�dfWY�Sd}~XYn�t
||j�\}}	|j�|	�|dfYSXt|dd�}|j�|�z0|j||d�}|dk	�rP|dfW�S|d	fW�S|j�|�XndSdS)
z�Used by discovery.

        Loads tests from a single file, or a directories' __init__.py when
        passed the directory.

        Returns a tuple (None_or_tests_from_file, should_recurse).
        )NFFNr�zW%r module incorrectly imported from %r. Expected %r. Is this module globally installed?r?r}rAT)r/r0r�r��VALID_MODULE_NAME�matchr�r�r�rZSkipTestr,r r"r4rLr�rJr2�realpathr-r�rrUr�rZr6r�r�)r
r�r@r~r�rrNrRrSrTZmod_filer�Zfullpath_noextZ
module_dirZmod_nameZexpected_dir�msgrArP�packagerrrr��s|

&
�
�
�
�
���
&
�
zTestLoader._find_test_path)N)N)r|N)F)F)rrr�__doc__ro�staticmethodr�
three_way_cmprxrprr8r rrr>rUrfrkr:r�r�r�r�r�r�r�rrrrrr3Bs&
(
N

n
"r3cCs&t�}||_||_||_|r"||_|Sr	)r3rxrorpr )�prefix�	sortUsingr rpr�rrr�_makeLoader�sr�cCst|||d��|�S)N)rp)r�r:)r=r�r�rprrrr:�sr:r%cCst|||��|�Sr	)r�r>)r=r�r�r rrr�	makeSuite�s�r�cCst|||��|�Sr	)r�rU)rNr�r�r rrr�
findTestCasess�r�)NN)"r�r/�rer�rr]rzrCrr�rrrZ
__unittest�compile�
IGNORECASEr�r*rr"r#rr,r2�objectr3ZdefaultTestLoaderr�r�r:r8r�r�rrrr�<module>s</
	�
�unittest/loader.py000064400000054256151153537550010271 0ustar00"""Loading unittests."""

import os
import re
import sys
import traceback
import types
import functools
import warnings

from fnmatch import fnmatch, fnmatchcase

from . import case, suite, util

__unittest = True

# what about .pyc (etc)
# we would need to avoid loading the same tests multiple times
# from '.py', *and* '.pyc'
VALID_MODULE_NAME = re.compile(r'[_a-z]\w*\.py$', re.IGNORECASE)


class _FailedTest(case.TestCase):
    _testMethodName = None

    def __init__(self, method_name, exception):
        self._exception = exception
        super(_FailedTest, self).__init__(method_name)

    def __getattr__(self, name):
        if name != self._testMethodName:
            return super(_FailedTest, self).__getattr__(name)
        def testFailure():
            raise self._exception
        return testFailure


def _make_failed_import_test(name, suiteClass):
    message = 'Failed to import test module: %s\n%s' % (
        name, traceback.format_exc())
    return _make_failed_test(name, ImportError(message), suiteClass, message)

def _make_failed_load_tests(name, exception, suiteClass):
    message = 'Failed to call load_tests:\n%s' % (traceback.format_exc(),)
    return _make_failed_test(
        name, exception, suiteClass, message)

def _make_failed_test(methodname, exception, suiteClass, message):
    test = _FailedTest(methodname, exception)
    return suiteClass((test,)), message

def _make_skipped_test(methodname, exception, suiteClass):
    @case.skip(str(exception))
    def testSkipped(self):
        pass
    attrs = {methodname: testSkipped}
    TestClass = type("ModuleSkipped", (case.TestCase,), attrs)
    return suiteClass((TestClass(methodname),))

def _jython_aware_splitext(path):
    if path.lower().endswith('$py.class'):
        return path[:-9]
    return os.path.splitext(path)[0]


class TestLoader(object):
    """
    This class is responsible for loading tests according to various criteria
    and returning them wrapped in a TestSuite
    """
    testMethodPrefix = 'test'
    sortTestMethodsUsing = staticmethod(util.three_way_cmp)
    testNamePatterns = None
    suiteClass = suite.TestSuite
    _top_level_dir = None

    def __init__(self):
        super(TestLoader, self).__init__()
        self.errors = []
        # Tracks packages which we have called into via load_tests, to
        # avoid infinite re-entrancy.
        self._loading_packages = set()

    def loadTestsFromTestCase(self, testCaseClass):
        """Return a suite of all test cases contained in testCaseClass"""
        if issubclass(testCaseClass, suite.TestSuite):
            raise TypeError("Test cases should not be derived from "
                            "TestSuite. Maybe you meant to derive from "
                            "TestCase?")
        testCaseNames = self.getTestCaseNames(testCaseClass)
        if not testCaseNames and hasattr(testCaseClass, 'runTest'):
            testCaseNames = ['runTest']
        loaded_suite = self.suiteClass(map(testCaseClass, testCaseNames))
        return loaded_suite

    # XXX After Python 3.5, remove backward compatibility hacks for
    # use_load_tests deprecation via *args and **kws.  See issue 16662.
    def loadTestsFromModule(self, module, *args, pattern=None, **kws):
        """Return a suite of all test cases contained in the given module"""
        # This method used to take an undocumented and unofficial
        # use_load_tests argument.  For backward compatibility, we still
        # accept the argument (which can also be the first position) but we
        # ignore it and issue a deprecation warning if it's present.
        if len(args) > 0 or 'use_load_tests' in kws:
            warnings.warn('use_load_tests is deprecated and ignored',
                          DeprecationWarning)
            kws.pop('use_load_tests', None)
        if len(args) > 1:
            # Complain about the number of arguments, but don't forget the
            # required `module` argument.
            complaint = len(args) + 1
            raise TypeError('loadTestsFromModule() takes 1 positional argument but {} were given'.format(complaint))
        if len(kws) != 0:
            # Since the keyword arguments are unsorted (see PEP 468), just
            # pick the alphabetically sorted first argument to complain about,
            # if multiple were given.  At least the error message will be
            # predictable.
            complaint = sorted(kws)[0]
            raise TypeError("loadTestsFromModule() got an unexpected keyword argument '{}'".format(complaint))
        tests = []
        for name in dir(module):
            obj = getattr(module, name)
            if isinstance(obj, type) and issubclass(obj, case.TestCase):
                tests.append(self.loadTestsFromTestCase(obj))

        load_tests = getattr(module, 'load_tests', None)
        tests = self.suiteClass(tests)
        if load_tests is not None:
            try:
                return load_tests(self, tests, pattern)
            except Exception as e:
                error_case, error_message = _make_failed_load_tests(
                    module.__name__, e, self.suiteClass)
                self.errors.append(error_message)
                return error_case
        return tests

    def loadTestsFromName(self, name, module=None):
        """Return a suite of all test cases given a string specifier.

        The name may resolve either to a module, a test case class, a
        test method within a test case class, or a callable object which
        returns a TestCase or TestSuite instance.

        The method optionally resolves the names relative to a given module.
        """
        parts = name.split('.')
        error_case, error_message = None, None
        if module is None:
            parts_copy = parts[:]
            while parts_copy:
                try:
                    module_name = '.'.join(parts_copy)
                    module = __import__(module_name)
                    break
                except ImportError:
                    next_attribute = parts_copy.pop()
                    # Last error so we can give it to the user if needed.
                    error_case, error_message = _make_failed_import_test(
                        next_attribute, self.suiteClass)
                    if not parts_copy:
                        # Even the top level import failed: report that error.
                        self.errors.append(error_message)
                        return error_case
            parts = parts[1:]
        obj = module
        for part in parts:
            try:
                parent, obj = obj, getattr(obj, part)
            except AttributeError as e:
                # We can't traverse some part of the name.
                if (getattr(obj, '__path__', None) is not None
                    and error_case is not None):
                    # This is a package (no __path__ per importlib docs), and we
                    # encountered an error importing something. We cannot tell
                    # the difference between package.WrongNameTestClass and
                    # package.wrong_module_name so we just report the
                    # ImportError - it is more informative.
                    self.errors.append(error_message)
                    return error_case
                else:
                    # Otherwise, we signal that an AttributeError has occurred.
                    error_case, error_message = _make_failed_test(
                        part, e, self.suiteClass,
                        'Failed to access attribute:\n%s' % (
                            traceback.format_exc(),))
                    self.errors.append(error_message)
                    return error_case

        if isinstance(obj, types.ModuleType):
            return self.loadTestsFromModule(obj)
        elif isinstance(obj, type) and issubclass(obj, case.TestCase):
            return self.loadTestsFromTestCase(obj)
        elif (isinstance(obj, types.FunctionType) and
              isinstance(parent, type) and
              issubclass(parent, case.TestCase)):
            name = parts[-1]
            inst = parent(name)
            # static methods follow a different path
            if not isinstance(getattr(inst, name), types.FunctionType):
                return self.suiteClass([inst])
        elif isinstance(obj, suite.TestSuite):
            return obj
        if callable(obj):
            test = obj()
            if isinstance(test, suite.TestSuite):
                return test
            elif isinstance(test, case.TestCase):
                return self.suiteClass([test])
            else:
                raise TypeError("calling %s returned %s, not a test" %
                                (obj, test))
        else:
            raise TypeError("don't know how to make test from: %s" % obj)

    def loadTestsFromNames(self, names, module=None):
        """Return a suite of all test cases found using the given sequence
        of string specifiers. See 'loadTestsFromName()'.
        """
        suites = [self.loadTestsFromName(name, module) for name in names]
        return self.suiteClass(suites)

    def getTestCaseNames(self, testCaseClass):
        """Return a sorted sequence of method names found within testCaseClass
        """
        def shouldIncludeMethod(attrname):
            if not attrname.startswith(self.testMethodPrefix):
                return False
            testFunc = getattr(testCaseClass, attrname)
            if not callable(testFunc):
                return False
            fullName = f'%s.%s.%s' % (
                testCaseClass.__module__, testCaseClass.__qualname__, attrname
            )
            return self.testNamePatterns is None or \
                any(fnmatchcase(fullName, pattern) for pattern in self.testNamePatterns)
        testFnNames = list(filter(shouldIncludeMethod, dir(testCaseClass)))
        if self.sortTestMethodsUsing:
            testFnNames.sort(key=functools.cmp_to_key(self.sortTestMethodsUsing))
        return testFnNames

    def discover(self, start_dir, pattern='test*.py', top_level_dir=None):
        """Find and return all test modules from the specified start
        directory, recursing into subdirectories to find them and return all
        tests found within them. Only test files that match the pattern will
        be loaded. (Using shell style pattern matching.)

        All test modules must be importable from the top level of the project.
        If the start directory is not the top level directory then the top
        level directory must be specified separately.

        If a test package name (directory with '__init__.py') matches the
        pattern then the package will be checked for a 'load_tests' function. If
        this exists then it will be called with (loader, tests, pattern) unless
        the package has already had load_tests called from the same discovery
        invocation, in which case the package module object is not scanned for
        tests - this ensures that when a package uses discover to further
        discover child tests that infinite recursion does not happen.

        If load_tests exists then discovery does *not* recurse into the package,
        load_tests is responsible for loading all tests in the package.

        The pattern is deliberately not stored as a loader attribute so that
        packages can continue discovery themselves. top_level_dir is stored so
        load_tests does not need to pass this argument in to loader.discover().

        Paths are sorted before being imported to ensure reproducible execution
        order even on filesystems with non-alphabetical ordering like ext3/4.
        """
        set_implicit_top = False
        if top_level_dir is None and self._top_level_dir is not None:
            # make top_level_dir optional if called from load_tests in a package
            top_level_dir = self._top_level_dir
        elif top_level_dir is None:
            set_implicit_top = True
            top_level_dir = start_dir

        top_level_dir = os.path.abspath(top_level_dir)

        if not top_level_dir in sys.path:
            # all test modules must be importable from the top level directory
            # should we *unconditionally* put the start directory in first
            # in sys.path to minimise likelihood of conflicts between installed
            # modules and development versions?
            sys.path.insert(0, top_level_dir)
        self._top_level_dir = top_level_dir

        is_not_importable = False
        is_namespace = False
        tests = []
        if os.path.isdir(os.path.abspath(start_dir)):
            start_dir = os.path.abspath(start_dir)
            if start_dir != top_level_dir:
                is_not_importable = not os.path.isfile(os.path.join(start_dir, '__init__.py'))
        else:
            # support for discovery from dotted module names
            try:
                __import__(start_dir)
            except ImportError:
                is_not_importable = True
            else:
                the_module = sys.modules[start_dir]
                top_part = start_dir.split('.')[0]
                try:
                    start_dir = os.path.abspath(
                       os.path.dirname((the_module.__file__)))
                except AttributeError:
                    # look for namespace packages
                    try:
                        spec = the_module.__spec__
                    except AttributeError:
                        spec = None

                    if spec and spec.loader is None:
                        if spec.submodule_search_locations is not None:
                            is_namespace = True

                            for path in the_module.__path__:
                                if (not set_implicit_top and
                                    not path.startswith(top_level_dir)):
                                    continue
                                self._top_level_dir = \
                                    (path.split(the_module.__name__
                                         .replace(".", os.path.sep))[0])
                                tests.extend(self._find_tests(path,
                                                              pattern,
                                                              namespace=True))
                    elif the_module.__name__ in sys.builtin_module_names:
                        # builtin module
                        raise TypeError('Can not use builtin modules '
                                        'as dotted module names') from None
                    else:
                        raise TypeError(
                            'don\'t know how to discover from {!r}'
                            .format(the_module)) from None

                if set_implicit_top:
                    if not is_namespace:
                        self._top_level_dir = \
                           self._get_directory_containing_module(top_part)
                        sys.path.remove(top_level_dir)
                    else:
                        sys.path.remove(top_level_dir)

        if is_not_importable:
            raise ImportError('Start directory is not importable: %r' % start_dir)

        if not is_namespace:
            tests = list(self._find_tests(start_dir, pattern))
        return self.suiteClass(tests)

    def _get_directory_containing_module(self, module_name):
        module = sys.modules[module_name]
        full_path = os.path.abspath(module.__file__)

        if os.path.basename(full_path).lower().startswith('__init__.py'):
            return os.path.dirname(os.path.dirname(full_path))
        else:
            # here we have been given a module rather than a package - so
            # all we can do is search the *same* directory the module is in
            # should an exception be raised instead
            return os.path.dirname(full_path)

    def _get_name_from_path(self, path):
        if path == self._top_level_dir:
            return '.'
        path = _jython_aware_splitext(os.path.normpath(path))

        _relpath = os.path.relpath(path, self._top_level_dir)
        assert not os.path.isabs(_relpath), "Path must be within the project"
        assert not _relpath.startswith('..'), "Path must be within the project"

        name = _relpath.replace(os.path.sep, '.')
        return name

    def _get_module_from_name(self, name):
        __import__(name)
        return sys.modules[name]

    def _match_path(self, path, full_path, pattern):
        # override this method to use alternative matching strategy
        return fnmatch(path, pattern)

    def _find_tests(self, start_dir, pattern, namespace=False):
        """Used by discovery. Yields test suites it loads."""
        # Handle the __init__ in this package
        name = self._get_name_from_path(start_dir)
        # name is '.' when start_dir == top_level_dir (and top_level_dir is by
        # definition not a package).
        if name != '.' and name not in self._loading_packages:
            # name is in self._loading_packages while we have called into
            # loadTestsFromModule with name.
            tests, should_recurse = self._find_test_path(
                start_dir, pattern, namespace)
            if tests is not None:
                yield tests
            if not should_recurse:
                # Either an error occurred, or load_tests was used by the
                # package.
                return
        # Handle the contents.
        paths = sorted(os.listdir(start_dir))
        for path in paths:
            full_path = os.path.join(start_dir, path)
            tests, should_recurse = self._find_test_path(
                full_path, pattern, namespace)
            if tests is not None:
                yield tests
            if should_recurse:
                # we found a package that didn't use load_tests.
                name = self._get_name_from_path(full_path)
                self._loading_packages.add(name)
                try:
                    yield from self._find_tests(full_path, pattern, namespace)
                finally:
                    self._loading_packages.discard(name)

    def _find_test_path(self, full_path, pattern, namespace=False):
        """Used by discovery.

        Loads tests from a single file, or a directories' __init__.py when
        passed the directory.

        Returns a tuple (None_or_tests_from_file, should_recurse).
        """
        basename = os.path.basename(full_path)
        if os.path.isfile(full_path):
            if not VALID_MODULE_NAME.match(basename):
                # valid Python identifiers only
                return None, False
            if not self._match_path(basename, full_path, pattern):
                return None, False
            # if the test file matches, load it
            name = self._get_name_from_path(full_path)
            try:
                module = self._get_module_from_name(name)
            except case.SkipTest as e:
                return _make_skipped_test(name, e, self.suiteClass), False
            except:
                error_case, error_message = \
                    _make_failed_import_test(name, self.suiteClass)
                self.errors.append(error_message)
                return error_case, False
            else:
                mod_file = os.path.abspath(
                    getattr(module, '__file__', full_path))
                realpath = _jython_aware_splitext(
                    os.path.realpath(mod_file))
                fullpath_noext = _jython_aware_splitext(
                    os.path.realpath(full_path))
                if realpath.lower() != fullpath_noext.lower():
                    module_dir = os.path.dirname(realpath)
                    mod_name = _jython_aware_splitext(
                        os.path.basename(full_path))
                    expected_dir = os.path.dirname(full_path)
                    msg = ("%r module incorrectly imported from %r. Expected "
                           "%r. Is this module globally installed?")
                    raise ImportError(
                        msg % (mod_name, module_dir, expected_dir))
                return self.loadTestsFromModule(module, pattern=pattern), False
        elif os.path.isdir(full_path):
            if (not namespace and
                not os.path.isfile(os.path.join(full_path, '__init__.py'))):
                return None, False

            load_tests = None
            tests = None
            name = self._get_name_from_path(full_path)
            try:
                package = self._get_module_from_name(name)
            except case.SkipTest as e:
                return _make_skipped_test(name, e, self.suiteClass), False
            except:
                error_case, error_message = \
                    _make_failed_import_test(name, self.suiteClass)
                self.errors.append(error_message)
                return error_case, False
            else:
                load_tests = getattr(package, 'load_tests', None)
                # Mark this package as being in load_tests (possibly ;))
                self._loading_packages.add(name)
                try:
                    tests = self.loadTestsFromModule(package, pattern=pattern)
                    if load_tests is not None:
                        # loadTestsFromModule(package) has loaded tests for us.
                        return tests, False
                    return tests, True
                finally:
                    self._loading_packages.discard(name)
        else:
            return None, False


defaultTestLoader = TestLoader()


def _makeLoader(prefix, sortUsing, suiteClass=None, testNamePatterns=None):
    loader = TestLoader()
    loader.sortTestMethodsUsing = sortUsing
    loader.testMethodPrefix = prefix
    loader.testNamePatterns = testNamePatterns
    if suiteClass:
        loader.suiteClass = suiteClass
    return loader

def getTestCaseNames(testCaseClass, prefix, sortUsing=util.three_way_cmp, testNamePatterns=None):
    return _makeLoader(prefix, sortUsing, testNamePatterns=testNamePatterns).getTestCaseNames(testCaseClass)

def makeSuite(testCaseClass, prefix='test', sortUsing=util.three_way_cmp,
              suiteClass=suite.TestSuite):
    return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromTestCase(
        testCaseClass)

def findTestCases(module, prefix='test', sortUsing=util.three_way_cmp,
                  suiteClass=suite.TestSuite):
    return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(\
        module)
unittest/suite.py000064400000031017151153537550010142 0ustar00"""TestSuite"""

import sys

from . import case
from . import util

__unittest = True


def _call_if_exists(parent, attr):
    func = getattr(parent, attr, lambda: None)
    func()


class BaseTestSuite(object):
    """A simple test suite that doesn't provide class or module shared fixtures.
    """
    _cleanup = True

    def __init__(self, tests=()):
        self._tests = []
        self._removed_tests = 0
        self.addTests(tests)

    def __repr__(self):
        return "<%s tests=%s>" % (util.strclass(self.__class__), list(self))

    def __eq__(self, other):
        if not isinstance(other, self.__class__):
            return NotImplemented
        return list(self) == list(other)

    def __iter__(self):
        return iter(self._tests)

    def countTestCases(self):
        cases = self._removed_tests
        for test in self:
            if test:
                cases += test.countTestCases()
        return cases

    def addTest(self, test):
        # sanity checks
        if not callable(test):
            raise TypeError("{} is not callable".format(repr(test)))
        if isinstance(test, type) and issubclass(test,
                                                 (case.TestCase, TestSuite)):
            raise TypeError("TestCases and TestSuites must be instantiated "
                            "before passing them to addTest()")
        self._tests.append(test)

    def addTests(self, tests):
        if isinstance(tests, str):
            raise TypeError("tests must be an iterable of tests, not a string")
        for test in tests:
            self.addTest(test)

    def run(self, result):
        for index, test in enumerate(self):
            if result.shouldStop:
                break
            test(result)
            if self._cleanup:
                self._removeTestAtIndex(index)
        return result

    def _removeTestAtIndex(self, index):
        """Stop holding a reference to the TestCase at index."""
        try:
            test = self._tests[index]
        except TypeError:
            # support for suite implementations that have overridden self._tests
            pass
        else:
            # Some unittest tests add non TestCase/TestSuite objects to
            # the suite.
            if hasattr(test, 'countTestCases'):
                self._removed_tests += test.countTestCases()
            self._tests[index] = None

    def __call__(self, *args, **kwds):
        return self.run(*args, **kwds)

    def debug(self):
        """Run the tests without collecting errors in a TestResult"""
        for test in self:
            test.debug()


class TestSuite(BaseTestSuite):
    """A test suite is a composite test consisting of a number of TestCases.

    For use, create an instance of TestSuite, then add test case instances.
    When all tests have been added, the suite can be passed to a test
    runner, such as TextTestRunner. It will run the individual test cases
    in the order in which they were added, aggregating the results. When
    subclassing, do not forget to call the base class constructor.
    """

    def run(self, result, debug=False):
        topLevel = False
        if getattr(result, '_testRunEntered', False) is False:
            result._testRunEntered = topLevel = True

        for index, test in enumerate(self):
            if result.shouldStop:
                break

            if _isnotsuite(test):
                self._tearDownPreviousClass(test, result)
                self._handleModuleFixture(test, result)
                self._handleClassSetUp(test, result)
                result._previousTestClass = test.__class__

                if (getattr(test.__class__, '_classSetupFailed', False) or
                    getattr(result, '_moduleSetUpFailed', False)):
                    continue

            if not debug:
                test(result)
            else:
                test.debug()

            if self._cleanup:
                self._removeTestAtIndex(index)

        if topLevel:
            self._tearDownPreviousClass(None, result)
            self._handleModuleTearDown(result)
            result._testRunEntered = False
        return result

    def debug(self):
        """Run the tests without collecting errors in a TestResult"""
        debug = _DebugResult()
        self.run(debug, True)

    ################################

    def _handleClassSetUp(self, test, result):
        previousClass = getattr(result, '_previousTestClass', None)
        currentClass = test.__class__
        if currentClass == previousClass:
            return
        if result._moduleSetUpFailed:
            return
        if getattr(currentClass, "__unittest_skip__", False):
            return

        try:
            currentClass._classSetupFailed = False
        except TypeError:
            # test may actually be a function
            # so its class will be a builtin-type
            pass

        setUpClass = getattr(currentClass, 'setUpClass', None)
        if setUpClass is not None:
            _call_if_exists(result, '_setupStdout')
            try:
                setUpClass()
            except Exception as e:
                if isinstance(result, _DebugResult):
                    raise
                currentClass._classSetupFailed = True
                className = util.strclass(currentClass)
                self._createClassOrModuleLevelException(result, e,
                                                        'setUpClass',
                                                        className)
            finally:
                _call_if_exists(result, '_restoreStdout')
                if currentClass._classSetupFailed is True:
                    currentClass.doClassCleanups()
                    if len(currentClass.tearDown_exceptions) > 0:
                        for exc in currentClass.tearDown_exceptions:
                            self._createClassOrModuleLevelException(
                                    result, exc[1], 'setUpClass', className,
                                    info=exc)

    def _get_previous_module(self, result):
        previousModule = None
        previousClass = getattr(result, '_previousTestClass', None)
        if previousClass is not None:
            previousModule = previousClass.__module__
        return previousModule


    def _handleModuleFixture(self, test, result):
        previousModule = self._get_previous_module(result)
        currentModule = test.__class__.__module__
        if currentModule == previousModule:
            return

        self._handleModuleTearDown(result)


        result._moduleSetUpFailed = False
        try:
            module = sys.modules[currentModule]
        except KeyError:
            return
        setUpModule = getattr(module, 'setUpModule', None)
        if setUpModule is not None:
            _call_if_exists(result, '_setupStdout')
            try:
                setUpModule()
            except Exception as e:
                try:
                    case.doModuleCleanups()
                except Exception as exc:
                    self._createClassOrModuleLevelException(result, exc,
                                                            'setUpModule',
                                                            currentModule)
                if isinstance(result, _DebugResult):
                    raise
                result._moduleSetUpFailed = True
                self._createClassOrModuleLevelException(result, e,
                                                        'setUpModule',
                                                        currentModule)
            finally:
                _call_if_exists(result, '_restoreStdout')

    def _createClassOrModuleLevelException(self, result, exc, method_name,
                                           parent, info=None):
        errorName = f'{method_name} ({parent})'
        self._addClassOrModuleLevelException(result, exc, errorName, info)

    def _addClassOrModuleLevelException(self, result, exception, errorName,
                                        info=None):
        error = _ErrorHolder(errorName)
        addSkip = getattr(result, 'addSkip', None)
        if addSkip is not None and isinstance(exception, case.SkipTest):
            addSkip(error, str(exception))
        else:
            if not info:
                result.addError(error, sys.exc_info())
            else:
                result.addError(error, info)

    def _handleModuleTearDown(self, result):
        previousModule = self._get_previous_module(result)
        if previousModule is None:
            return
        if result._moduleSetUpFailed:
            return

        try:
            module = sys.modules[previousModule]
        except KeyError:
            return

        tearDownModule = getattr(module, 'tearDownModule', None)
        if tearDownModule is not None:
            _call_if_exists(result, '_setupStdout')
            try:
                tearDownModule()
            except Exception as e:
                if isinstance(result, _DebugResult):
                    raise
                self._createClassOrModuleLevelException(result, e,
                                                        'tearDownModule',
                                                        previousModule)
            finally:
                _call_if_exists(result, '_restoreStdout')
                try:
                    case.doModuleCleanups()
                except Exception as e:
                    self._createClassOrModuleLevelException(result, e,
                                                            'tearDownModule',
                                                            previousModule)

    def _tearDownPreviousClass(self, test, result):
        previousClass = getattr(result, '_previousTestClass', None)
        currentClass = test.__class__
        if currentClass == previousClass:
            return
        if getattr(previousClass, '_classSetupFailed', False):
            return
        if getattr(result, '_moduleSetUpFailed', False):
            return
        if getattr(previousClass, "__unittest_skip__", False):
            return

        tearDownClass = getattr(previousClass, 'tearDownClass', None)
        if tearDownClass is not None:
            _call_if_exists(result, '_setupStdout')
            try:
                tearDownClass()
            except Exception as e:
                if isinstance(result, _DebugResult):
                    raise
                className = util.strclass(previousClass)
                self._createClassOrModuleLevelException(result, e,
                                                        'tearDownClass',
                                                        className)
            finally:
                _call_if_exists(result, '_restoreStdout')
                previousClass.doClassCleanups()
                if len(previousClass.tearDown_exceptions) > 0:
                    for exc in previousClass.tearDown_exceptions:
                        className = util.strclass(previousClass)
                        self._createClassOrModuleLevelException(result, exc[1],
                                                                'tearDownClass',
                                                                className,
                                                                info=exc)


class _ErrorHolder(object):
    """
    Placeholder for a TestCase inside a result. As far as a TestResult
    is concerned, this looks exactly like a unit test. Used to insert
    arbitrary errors into a test suite run.
    """
    # Inspired by the ErrorHolder from Twisted:
    # http://twistedmatrix.com/trac/browser/trunk/twisted/trial/runner.py

    # attribute used by TestResult._exc_info_to_string
    failureException = None

    def __init__(self, description):
        self.description = description

    def id(self):
        return self.description

    def shortDescription(self):
        return None

    def __repr__(self):
        return "<ErrorHolder description=%r>" % (self.description,)

    def __str__(self):
        return self.id()

    def run(self, result):
        # could call result.addError(...) - but this test-like object
        # shouldn't be run anyway
        pass

    def __call__(self, result):
        return self.run(result)

    def countTestCases(self):
        return 0

def _isnotsuite(test):
    "A crude way to tell apart testcases and suites with duck-typing"
    try:
        iter(test)
    except TypeError:
        return True
    return False


class _DebugResult(object):
    "Used by the TestSuite to hold previous class when running in debug."
    _previousTestClass = None
    _moduleSetUpFailed = False
    shouldStop = False
unittest/async_case.py000064400000013262151153537550011123 0ustar00import asyncio
import inspect

from .case import TestCase



class IsolatedAsyncioTestCase(TestCase):
    # Names intentionally have a long prefix
    # to reduce a chance of clashing with user-defined attributes
    # from inherited test case
    #
    # The class doesn't call loop.run_until_complete(self.setUp()) and family
    # but uses a different approach:
    # 1. create a long-running task that reads self.setUp()
    #    awaitable from queue along with a future
    # 2. await the awaitable object passing in and set the result
    #    into the future object
    # 3. Outer code puts the awaitable and the future object into a queue
    #    with waiting for the future
    # The trick is necessary because every run_until_complete() call
    # creates a new task with embedded ContextVar context.
    # To share contextvars between setUp(), test and tearDown() we need to execute
    # them inside the same task.

    # Note: the test case modifies event loop policy if the policy was not instantiated
    # yet.
    # asyncio.get_event_loop_policy() creates a default policy on demand but never
    # returns None
    # I believe this is not an issue in user level tests but python itself for testing
    # should reset a policy in every test module
    # by calling asyncio.set_event_loop_policy(None) in tearDownModule()

    def __init__(self, methodName='runTest'):
        super().__init__(methodName)
        self._asyncioTestLoop = None
        self._asyncioCallsQueue = None

    async def asyncSetUp(self):
        pass

    async def asyncTearDown(self):
        pass

    def addAsyncCleanup(self, func, /, *args, **kwargs):
        # A trivial trampoline to addCleanup()
        # the function exists because it has a different semantics
        # and signature:
        # addCleanup() accepts regular functions
        # but addAsyncCleanup() accepts coroutines
        #
        # We intentionally don't add inspect.iscoroutinefunction() check
        # for func argument because there is no way
        # to check for async function reliably:
        # 1. It can be "async def func()" iself
        # 2. Class can implement "async def __call__()" method
        # 3. Regular "def func()" that returns awaitable object
        self.addCleanup(*(func, *args), **kwargs)

    def _callSetUp(self):
        self.setUp()
        self._callAsync(self.asyncSetUp)

    def _callTestMethod(self, method):
        self._callMaybeAsync(method)

    def _callTearDown(self):
        self._callAsync(self.asyncTearDown)
        self.tearDown()

    def _callCleanup(self, function, *args, **kwargs):
        self._callMaybeAsync(function, *args, **kwargs)

    def _callAsync(self, func, /, *args, **kwargs):
        assert self._asyncioTestLoop is not None
        ret = func(*args, **kwargs)
        assert inspect.isawaitable(ret)
        fut = self._asyncioTestLoop.create_future()
        self._asyncioCallsQueue.put_nowait((fut, ret))
        return self._asyncioTestLoop.run_until_complete(fut)

    def _callMaybeAsync(self, func, /, *args, **kwargs):
        assert self._asyncioTestLoop is not None
        ret = func(*args, **kwargs)
        if inspect.isawaitable(ret):
            fut = self._asyncioTestLoop.create_future()
            self._asyncioCallsQueue.put_nowait((fut, ret))
            return self._asyncioTestLoop.run_until_complete(fut)
        else:
            return ret

    async def _asyncioLoopRunner(self, fut):
        self._asyncioCallsQueue = queue = asyncio.Queue()
        fut.set_result(None)
        while True:
            query = await queue.get()
            queue.task_done()
            if query is None:
                return
            fut, awaitable = query
            try:
                ret = await awaitable
                if not fut.cancelled():
                    fut.set_result(ret)
            except (SystemExit, KeyboardInterrupt):
                raise
            except (BaseException, asyncio.CancelledError) as ex:
                if not fut.cancelled():
                    fut.set_exception(ex)

    def _setupAsyncioLoop(self):
        assert self._asyncioTestLoop is None
        loop = asyncio.new_event_loop()
        asyncio.set_event_loop(loop)
        loop.set_debug(True)
        self._asyncioTestLoop = loop
        fut = loop.create_future()
        self._asyncioCallsTask = loop.create_task(self._asyncioLoopRunner(fut))
        loop.run_until_complete(fut)

    def _tearDownAsyncioLoop(self):
        assert self._asyncioTestLoop is not None
        loop = self._asyncioTestLoop
        self._asyncioTestLoop = None
        self._asyncioCallsQueue.put_nowait(None)
        loop.run_until_complete(self._asyncioCallsQueue.join())

        try:
            # cancel all tasks
            to_cancel = asyncio.all_tasks(loop)
            if not to_cancel:
                return

            for task in to_cancel:
                task.cancel()

            loop.run_until_complete(
                asyncio.gather(*to_cancel, loop=loop, return_exceptions=True))

            for task in to_cancel:
                if task.cancelled():
                    continue
                if task.exception() is not None:
                    loop.call_exception_handler({
                        'message': 'unhandled exception during test shutdown',
                        'exception': task.exception(),
                        'task': task,
                    })
            # shutdown asyncgens
            loop.run_until_complete(loop.shutdown_asyncgens())
        finally:
            asyncio.set_event_loop(None)
            loop.close()

    def run(self, result=None):
        self._setupAsyncioLoop()
        try:
            return super().run(result)
        finally:
            self._tearDownAsyncioLoop()
pickletools.py000064400000266456151153537550007503 0ustar00'''"Executable documentation" for the pickle module.

Extensive comments about the pickle protocols and pickle-machine opcodes
can be found here.  Some functions meant for external use:

genops(pickle)
   Generate all the opcodes in a pickle, as (opcode, arg, position) triples.

dis(pickle, out=None, memo=None, indentlevel=4)
   Print a symbolic disassembly of a pickle.
'''

import codecs
import io
import pickle
import re
import sys

__all__ = ['dis', 'genops', 'optimize']

bytes_types = pickle.bytes_types

# Other ideas:
#
# - A pickle verifier:  read a pickle and check it exhaustively for
#   well-formedness.  dis() does a lot of this already.
#
# - A protocol identifier:  examine a pickle and return its protocol number
#   (== the highest .proto attr value among all the opcodes in the pickle).
#   dis() already prints this info at the end.
#
# - A pickle optimizer:  for example, tuple-building code is sometimes more
#   elaborate than necessary, catering for the possibility that the tuple
#   is recursive.  Or lots of times a PUT is generated that's never accessed
#   by a later GET.


# "A pickle" is a program for a virtual pickle machine (PM, but more accurately
# called an unpickling machine).  It's a sequence of opcodes, interpreted by the
# PM, building an arbitrarily complex Python object.
#
# For the most part, the PM is very simple:  there are no looping, testing, or
# conditional instructions, no arithmetic and no function calls.  Opcodes are
# executed once each, from first to last, until a STOP opcode is reached.
#
# The PM has two data areas, "the stack" and "the memo".
#
# Many opcodes push Python objects onto the stack; e.g., INT pushes a Python
# integer object on the stack, whose value is gotten from a decimal string
# literal immediately following the INT opcode in the pickle bytestream.  Other
# opcodes take Python objects off the stack.  The result of unpickling is
# whatever object is left on the stack when the final STOP opcode is executed.
#
# The memo is simply an array of objects, or it can be implemented as a dict
# mapping little integers to objects.  The memo serves as the PM's "long term
# memory", and the little integers indexing the memo are akin to variable
# names.  Some opcodes pop a stack object into the memo at a given index,
# and others push a memo object at a given index onto the stack again.
#
# At heart, that's all the PM has.  Subtleties arise for these reasons:
#
# + Object identity.  Objects can be arbitrarily complex, and subobjects
#   may be shared (for example, the list [a, a] refers to the same object a
#   twice).  It can be vital that unpickling recreate an isomorphic object
#   graph, faithfully reproducing sharing.
#
# + Recursive objects.  For example, after "L = []; L.append(L)", L is a
#   list, and L[0] is the same list.  This is related to the object identity
#   point, and some sequences of pickle opcodes are subtle in order to
#   get the right result in all cases.
#
# + Things pickle doesn't know everything about.  Examples of things pickle
#   does know everything about are Python's builtin scalar and container
#   types, like ints and tuples.  They generally have opcodes dedicated to
#   them.  For things like module references and instances of user-defined
#   classes, pickle's knowledge is limited.  Historically, many enhancements
#   have been made to the pickle protocol in order to do a better (faster,
#   and/or more compact) job on those.
#
# + Backward compatibility and micro-optimization.  As explained below,
#   pickle opcodes never go away, not even when better ways to do a thing
#   get invented.  The repertoire of the PM just keeps growing over time.
#   For example, protocol 0 had two opcodes for building Python integers (INT
#   and LONG), protocol 1 added three more for more-efficient pickling of short
#   integers, and protocol 2 added two more for more-efficient pickling of
#   long integers (before protocol 2, the only ways to pickle a Python long
#   took time quadratic in the number of digits, for both pickling and
#   unpickling).  "Opcode bloat" isn't so much a subtlety as a source of
#   wearying complication.
#
#
# Pickle protocols:
#
# For compatibility, the meaning of a pickle opcode never changes.  Instead new
# pickle opcodes get added, and each version's unpickler can handle all the
# pickle opcodes in all protocol versions to date.  So old pickles continue to
# be readable forever.  The pickler can generally be told to restrict itself to
# the subset of opcodes available under previous protocol versions too, so that
# users can create pickles under the current version readable by older
# versions.  However, a pickle does not contain its version number embedded
# within it.  If an older unpickler tries to read a pickle using a later
# protocol, the result is most likely an exception due to seeing an unknown (in
# the older unpickler) opcode.
#
# The original pickle used what's now called "protocol 0", and what was called
# "text mode" before Python 2.3.  The entire pickle bytestream is made up of
# printable 7-bit ASCII characters, plus the newline character, in protocol 0.
# That's why it was called text mode.  Protocol 0 is small and elegant, but
# sometimes painfully inefficient.
#
# The second major set of additions is now called "protocol 1", and was called
# "binary mode" before Python 2.3.  This added many opcodes with arguments
# consisting of arbitrary bytes, including NUL bytes and unprintable "high bit"
# bytes.  Binary mode pickles can be substantially smaller than equivalent
# text mode pickles, and sometimes faster too; e.g., BININT represents a 4-byte
# int as 4 bytes following the opcode, which is cheaper to unpickle than the
# (perhaps) 11-character decimal string attached to INT.  Protocol 1 also added
# a number of opcodes that operate on many stack elements at once (like APPENDS
# and SETITEMS), and "shortcut" opcodes (like EMPTY_DICT and EMPTY_TUPLE).
#
# The third major set of additions came in Python 2.3, and is called "protocol
# 2".  This added:
#
# - A better way to pickle instances of new-style classes (NEWOBJ).
#
# - A way for a pickle to identify its protocol (PROTO).
#
# - Time- and space- efficient pickling of long ints (LONG{1,4}).
#
# - Shortcuts for small tuples (TUPLE{1,2,3}}.
#
# - Dedicated opcodes for bools (NEWTRUE, NEWFALSE).
#
# - The "extension registry", a vector of popular objects that can be pushed
#   efficiently by index (EXT{1,2,4}).  This is akin to the memo and GET, but
#   the registry contents are predefined (there's nothing akin to the memo's
#   PUT).
#
# Another independent change with Python 2.3 is the abandonment of any
# pretense that it might be safe to load pickles received from untrusted
# parties -- no sufficient security analysis has been done to guarantee
# this and there isn't a use case that warrants the expense of such an
# analysis.
#
# To this end, all tests for __safe_for_unpickling__ or for
# copyreg.safe_constructors are removed from the unpickling code.
# References to these variables in the descriptions below are to be seen
# as describing unpickling in Python 2.2 and before.


# Meta-rule:  Descriptions are stored in instances of descriptor objects,
# with plain constructors.  No meta-language is defined from which
# descriptors could be constructed.  If you want, e.g., XML, write a little
# program to generate XML from the objects.

##############################################################################
# Some pickle opcodes have an argument, following the opcode in the
# bytestream.  An argument is of a specific type, described by an instance
# of ArgumentDescriptor.  These are not to be confused with arguments taken
# off the stack -- ArgumentDescriptor applies only to arguments embedded in
# the opcode stream, immediately following an opcode.

# Represents the number of bytes consumed by an argument delimited by the
# next newline character.
UP_TO_NEWLINE = -1

# Represents the number of bytes consumed by a two-argument opcode where
# the first argument gives the number of bytes in the second argument.
TAKEN_FROM_ARGUMENT1  = -2   # num bytes is 1-byte unsigned int
TAKEN_FROM_ARGUMENT4  = -3   # num bytes is 4-byte signed little-endian int
TAKEN_FROM_ARGUMENT4U = -4   # num bytes is 4-byte unsigned little-endian int
TAKEN_FROM_ARGUMENT8U = -5   # num bytes is 8-byte unsigned little-endian int

class ArgumentDescriptor(object):
    __slots__ = (
        # name of descriptor record, also a module global name; a string
        'name',

        # length of argument, in bytes; an int; UP_TO_NEWLINE and
        # TAKEN_FROM_ARGUMENT{1,4,8} are negative values for variable-length
        # cases
        'n',

        # a function taking a file-like object, reading this kind of argument
        # from the object at the current position, advancing the current
        # position by n bytes, and returning the value of the argument
        'reader',

        # human-readable docs for this arg descriptor; a string
        'doc',
    )

    def __init__(self, name, n, reader, doc):
        assert isinstance(name, str)
        self.name = name

        assert isinstance(n, int) and (n >= 0 or
                                       n in (UP_TO_NEWLINE,
                                             TAKEN_FROM_ARGUMENT1,
                                             TAKEN_FROM_ARGUMENT4,
                                             TAKEN_FROM_ARGUMENT4U,
                                             TAKEN_FROM_ARGUMENT8U))
        self.n = n

        self.reader = reader

        assert isinstance(doc, str)
        self.doc = doc

from struct import unpack as _unpack

def read_uint1(f):
    r"""
    >>> import io
    >>> read_uint1(io.BytesIO(b'\xff'))
    255
    """

    data = f.read(1)
    if data:
        return data[0]
    raise ValueError("not enough data in stream to read uint1")

uint1 = ArgumentDescriptor(
            name='uint1',
            n=1,
            reader=read_uint1,
            doc="One-byte unsigned integer.")


def read_uint2(f):
    r"""
    >>> import io
    >>> read_uint2(io.BytesIO(b'\xff\x00'))
    255
    >>> read_uint2(io.BytesIO(b'\xff\xff'))
    65535
    """

    data = f.read(2)
    if len(data) == 2:
        return _unpack("<H", data)[0]
    raise ValueError("not enough data in stream to read uint2")

uint2 = ArgumentDescriptor(
            name='uint2',
            n=2,
            reader=read_uint2,
            doc="Two-byte unsigned integer, little-endian.")


def read_int4(f):
    r"""
    >>> import io
    >>> read_int4(io.BytesIO(b'\xff\x00\x00\x00'))
    255
    >>> read_int4(io.BytesIO(b'\x00\x00\x00\x80')) == -(2**31)
    True
    """

    data = f.read(4)
    if len(data) == 4:
        return _unpack("<i", data)[0]
    raise ValueError("not enough data in stream to read int4")

int4 = ArgumentDescriptor(
           name='int4',
           n=4,
           reader=read_int4,
           doc="Four-byte signed integer, little-endian, 2's complement.")


def read_uint4(f):
    r"""
    >>> import io
    >>> read_uint4(io.BytesIO(b'\xff\x00\x00\x00'))
    255
    >>> read_uint4(io.BytesIO(b'\x00\x00\x00\x80')) == 2**31
    True
    """

    data = f.read(4)
    if len(data) == 4:
        return _unpack("<I", data)[0]
    raise ValueError("not enough data in stream to read uint4")

uint4 = ArgumentDescriptor(
            name='uint4',
            n=4,
            reader=read_uint4,
            doc="Four-byte unsigned integer, little-endian.")


def read_uint8(f):
    r"""
    >>> import io
    >>> read_uint8(io.BytesIO(b'\xff\x00\x00\x00\x00\x00\x00\x00'))
    255
    >>> read_uint8(io.BytesIO(b'\xff' * 8)) == 2**64-1
    True
    """

    data = f.read(8)
    if len(data) == 8:
        return _unpack("<Q", data)[0]
    raise ValueError("not enough data in stream to read uint8")

uint8 = ArgumentDescriptor(
            name='uint8',
            n=8,
            reader=read_uint8,
            doc="Eight-byte unsigned integer, little-endian.")


def read_stringnl(f, decode=True, stripquotes=True):
    r"""
    >>> import io
    >>> read_stringnl(io.BytesIO(b"'abcd'\nefg\n"))
    'abcd'

    >>> read_stringnl(io.BytesIO(b"\n"))
    Traceback (most recent call last):
    ...
    ValueError: no string quotes around b''

    >>> read_stringnl(io.BytesIO(b"\n"), stripquotes=False)
    ''

    >>> read_stringnl(io.BytesIO(b"''\n"))
    ''

    >>> read_stringnl(io.BytesIO(b'"abcd"'))
    Traceback (most recent call last):
    ...
    ValueError: no newline found when trying to read stringnl

    Embedded escapes are undone in the result.
    >>> read_stringnl(io.BytesIO(br"'a\n\\b\x00c\td'" + b"\n'e'"))
    'a\n\\b\x00c\td'
    """

    data = f.readline()
    if not data.endswith(b'\n'):
        raise ValueError("no newline found when trying to read stringnl")
    data = data[:-1]    # lose the newline

    if stripquotes:
        for q in (b'"', b"'"):
            if data.startswith(q):
                if not data.endswith(q):
                    raise ValueError("strinq quote %r not found at both "
                                     "ends of %r" % (q, data))
                data = data[1:-1]
                break
        else:
            raise ValueError("no string quotes around %r" % data)

    if decode:
        data = codecs.escape_decode(data)[0].decode("ascii")
    return data

stringnl = ArgumentDescriptor(
               name='stringnl',
               n=UP_TO_NEWLINE,
               reader=read_stringnl,
               doc="""A newline-terminated string.

                   This is a repr-style string, with embedded escapes, and
                   bracketing quotes.
                   """)

def read_stringnl_noescape(f):
    return read_stringnl(f, stripquotes=False)

stringnl_noescape = ArgumentDescriptor(
                        name='stringnl_noescape',
                        n=UP_TO_NEWLINE,
                        reader=read_stringnl_noescape,
                        doc="""A newline-terminated string.

                        This is a str-style string, without embedded escapes,
                        or bracketing quotes.  It should consist solely of
                        printable ASCII characters.
                        """)

def read_stringnl_noescape_pair(f):
    r"""
    >>> import io
    >>> read_stringnl_noescape_pair(io.BytesIO(b"Queue\nEmpty\njunk"))
    'Queue Empty'
    """

    return "%s %s" % (read_stringnl_noescape(f), read_stringnl_noescape(f))

stringnl_noescape_pair = ArgumentDescriptor(
                             name='stringnl_noescape_pair',
                             n=UP_TO_NEWLINE,
                             reader=read_stringnl_noescape_pair,
                             doc="""A pair of newline-terminated strings.

                             These are str-style strings, without embedded
                             escapes, or bracketing quotes.  They should
                             consist solely of printable ASCII characters.
                             The pair is returned as a single string, with
                             a single blank separating the two strings.
                             """)


def read_string1(f):
    r"""
    >>> import io
    >>> read_string1(io.BytesIO(b"\x00"))
    ''
    >>> read_string1(io.BytesIO(b"\x03abcdef"))
    'abc'
    """

    n = read_uint1(f)
    assert n >= 0
    data = f.read(n)
    if len(data) == n:
        return data.decode("latin-1")
    raise ValueError("expected %d bytes in a string1, but only %d remain" %
                     (n, len(data)))

string1 = ArgumentDescriptor(
              name="string1",
              n=TAKEN_FROM_ARGUMENT1,
              reader=read_string1,
              doc="""A counted string.

              The first argument is a 1-byte unsigned int giving the number
              of bytes in the string, and the second argument is that many
              bytes.
              """)


def read_string4(f):
    r"""
    >>> import io
    >>> read_string4(io.BytesIO(b"\x00\x00\x00\x00abc"))
    ''
    >>> read_string4(io.BytesIO(b"\x03\x00\x00\x00abcdef"))
    'abc'
    >>> read_string4(io.BytesIO(b"\x00\x00\x00\x03abcdef"))
    Traceback (most recent call last):
    ...
    ValueError: expected 50331648 bytes in a string4, but only 6 remain
    """

    n = read_int4(f)
    if n < 0:
        raise ValueError("string4 byte count < 0: %d" % n)
    data = f.read(n)
    if len(data) == n:
        return data.decode("latin-1")
    raise ValueError("expected %d bytes in a string4, but only %d remain" %
                     (n, len(data)))

string4 = ArgumentDescriptor(
              name="string4",
              n=TAKEN_FROM_ARGUMENT4,
              reader=read_string4,
              doc="""A counted string.

              The first argument is a 4-byte little-endian signed int giving
              the number of bytes in the string, and the second argument is
              that many bytes.
              """)


def read_bytes1(f):
    r"""
    >>> import io
    >>> read_bytes1(io.BytesIO(b"\x00"))
    b''
    >>> read_bytes1(io.BytesIO(b"\x03abcdef"))
    b'abc'
    """

    n = read_uint1(f)
    assert n >= 0
    data = f.read(n)
    if len(data) == n:
        return data
    raise ValueError("expected %d bytes in a bytes1, but only %d remain" %
                     (n, len(data)))

bytes1 = ArgumentDescriptor(
              name="bytes1",
              n=TAKEN_FROM_ARGUMENT1,
              reader=read_bytes1,
              doc="""A counted bytes string.

              The first argument is a 1-byte unsigned int giving the number
              of bytes, and the second argument is that many bytes.
              """)


def read_bytes4(f):
    r"""
    >>> import io
    >>> read_bytes4(io.BytesIO(b"\x00\x00\x00\x00abc"))
    b''
    >>> read_bytes4(io.BytesIO(b"\x03\x00\x00\x00abcdef"))
    b'abc'
    >>> read_bytes4(io.BytesIO(b"\x00\x00\x00\x03abcdef"))
    Traceback (most recent call last):
    ...
    ValueError: expected 50331648 bytes in a bytes4, but only 6 remain
    """

    n = read_uint4(f)
    assert n >= 0
    if n > sys.maxsize:
        raise ValueError("bytes4 byte count > sys.maxsize: %d" % n)
    data = f.read(n)
    if len(data) == n:
        return data
    raise ValueError("expected %d bytes in a bytes4, but only %d remain" %
                     (n, len(data)))

bytes4 = ArgumentDescriptor(
              name="bytes4",
              n=TAKEN_FROM_ARGUMENT4U,
              reader=read_bytes4,
              doc="""A counted bytes string.

              The first argument is a 4-byte little-endian unsigned int giving
              the number of bytes, and the second argument is that many bytes.
              """)


def read_bytes8(f):
    r"""
    >>> import io, struct, sys
    >>> read_bytes8(io.BytesIO(b"\x00\x00\x00\x00\x00\x00\x00\x00abc"))
    b''
    >>> read_bytes8(io.BytesIO(b"\x03\x00\x00\x00\x00\x00\x00\x00abcdef"))
    b'abc'
    >>> bigsize8 = struct.pack("<Q", sys.maxsize//3)
    >>> read_bytes8(io.BytesIO(bigsize8 + b"abcdef"))  #doctest: +ELLIPSIS
    Traceback (most recent call last):
    ...
    ValueError: expected ... bytes in a bytes8, but only 6 remain
    """

    n = read_uint8(f)
    assert n >= 0
    if n > sys.maxsize:
        raise ValueError("bytes8 byte count > sys.maxsize: %d" % n)
    data = f.read(n)
    if len(data) == n:
        return data
    raise ValueError("expected %d bytes in a bytes8, but only %d remain" %
                     (n, len(data)))

bytes8 = ArgumentDescriptor(
              name="bytes8",
              n=TAKEN_FROM_ARGUMENT8U,
              reader=read_bytes8,
              doc="""A counted bytes string.

              The first argument is an 8-byte little-endian unsigned int giving
              the number of bytes, and the second argument is that many bytes.
              """)


def read_bytearray8(f):
    r"""
    >>> import io, struct, sys
    >>> read_bytearray8(io.BytesIO(b"\x00\x00\x00\x00\x00\x00\x00\x00abc"))
    bytearray(b'')
    >>> read_bytearray8(io.BytesIO(b"\x03\x00\x00\x00\x00\x00\x00\x00abcdef"))
    bytearray(b'abc')
    >>> bigsize8 = struct.pack("<Q", sys.maxsize//3)
    >>> read_bytearray8(io.BytesIO(bigsize8 + b"abcdef"))  #doctest: +ELLIPSIS
    Traceback (most recent call last):
    ...
    ValueError: expected ... bytes in a bytearray8, but only 6 remain
    """

    n = read_uint8(f)
    assert n >= 0
    if n > sys.maxsize:
        raise ValueError("bytearray8 byte count > sys.maxsize: %d" % n)
    data = f.read(n)
    if len(data) == n:
        return bytearray(data)
    raise ValueError("expected %d bytes in a bytearray8, but only %d remain" %
                     (n, len(data)))

bytearray8 = ArgumentDescriptor(
              name="bytearray8",
              n=TAKEN_FROM_ARGUMENT8U,
              reader=read_bytearray8,
              doc="""A counted bytearray.

              The first argument is an 8-byte little-endian unsigned int giving
              the number of bytes, and the second argument is that many bytes.
              """)

def read_unicodestringnl(f):
    r"""
    >>> import io
    >>> read_unicodestringnl(io.BytesIO(b"abc\\uabcd\njunk")) == 'abc\uabcd'
    True
    """

    data = f.readline()
    if not data.endswith(b'\n'):
        raise ValueError("no newline found when trying to read "
                         "unicodestringnl")
    data = data[:-1]    # lose the newline
    return str(data, 'raw-unicode-escape')

unicodestringnl = ArgumentDescriptor(
                      name='unicodestringnl',
                      n=UP_TO_NEWLINE,
                      reader=read_unicodestringnl,
                      doc="""A newline-terminated Unicode string.

                      This is raw-unicode-escape encoded, so consists of
                      printable ASCII characters, and may contain embedded
                      escape sequences.
                      """)


def read_unicodestring1(f):
    r"""
    >>> import io
    >>> s = 'abcd\uabcd'
    >>> enc = s.encode('utf-8')
    >>> enc
    b'abcd\xea\xaf\x8d'
    >>> n = bytes([len(enc)])  # little-endian 1-byte length
    >>> t = read_unicodestring1(io.BytesIO(n + enc + b'junk'))
    >>> s == t
    True

    >>> read_unicodestring1(io.BytesIO(n + enc[:-1]))
    Traceback (most recent call last):
    ...
    ValueError: expected 7 bytes in a unicodestring1, but only 6 remain
    """

    n = read_uint1(f)
    assert n >= 0
    data = f.read(n)
    if len(data) == n:
        return str(data, 'utf-8', 'surrogatepass')
    raise ValueError("expected %d bytes in a unicodestring1, but only %d "
                     "remain" % (n, len(data)))

unicodestring1 = ArgumentDescriptor(
                    name="unicodestring1",
                    n=TAKEN_FROM_ARGUMENT1,
                    reader=read_unicodestring1,
                    doc="""A counted Unicode string.

                    The first argument is a 1-byte little-endian signed int
                    giving the number of bytes in the string, and the second
                    argument-- the UTF-8 encoding of the Unicode string --
                    contains that many bytes.
                    """)


def read_unicodestring4(f):
    r"""
    >>> import io
    >>> s = 'abcd\uabcd'
    >>> enc = s.encode('utf-8')
    >>> enc
    b'abcd\xea\xaf\x8d'
    >>> n = bytes([len(enc), 0, 0, 0])  # little-endian 4-byte length
    >>> t = read_unicodestring4(io.BytesIO(n + enc + b'junk'))
    >>> s == t
    True

    >>> read_unicodestring4(io.BytesIO(n + enc[:-1]))
    Traceback (most recent call last):
    ...
    ValueError: expected 7 bytes in a unicodestring4, but only 6 remain
    """

    n = read_uint4(f)
    assert n >= 0
    if n > sys.maxsize:
        raise ValueError("unicodestring4 byte count > sys.maxsize: %d" % n)
    data = f.read(n)
    if len(data) == n:
        return str(data, 'utf-8', 'surrogatepass')
    raise ValueError("expected %d bytes in a unicodestring4, but only %d "
                     "remain" % (n, len(data)))

unicodestring4 = ArgumentDescriptor(
                    name="unicodestring4",
                    n=TAKEN_FROM_ARGUMENT4U,
                    reader=read_unicodestring4,
                    doc="""A counted Unicode string.

                    The first argument is a 4-byte little-endian signed int
                    giving the number of bytes in the string, and the second
                    argument-- the UTF-8 encoding of the Unicode string --
                    contains that many bytes.
                    """)


def read_unicodestring8(f):
    r"""
    >>> import io
    >>> s = 'abcd\uabcd'
    >>> enc = s.encode('utf-8')
    >>> enc
    b'abcd\xea\xaf\x8d'
    >>> n = bytes([len(enc)]) + b'\0' * 7  # little-endian 8-byte length
    >>> t = read_unicodestring8(io.BytesIO(n + enc + b'junk'))
    >>> s == t
    True

    >>> read_unicodestring8(io.BytesIO(n + enc[:-1]))
    Traceback (most recent call last):
    ...
    ValueError: expected 7 bytes in a unicodestring8, but only 6 remain
    """

    n = read_uint8(f)
    assert n >= 0
    if n > sys.maxsize:
        raise ValueError("unicodestring8 byte count > sys.maxsize: %d" % n)
    data = f.read(n)
    if len(data) == n:
        return str(data, 'utf-8', 'surrogatepass')
    raise ValueError("expected %d bytes in a unicodestring8, but only %d "
                     "remain" % (n, len(data)))

unicodestring8 = ArgumentDescriptor(
                    name="unicodestring8",
                    n=TAKEN_FROM_ARGUMENT8U,
                    reader=read_unicodestring8,
                    doc="""A counted Unicode string.

                    The first argument is an 8-byte little-endian signed int
                    giving the number of bytes in the string, and the second
                    argument-- the UTF-8 encoding of the Unicode string --
                    contains that many bytes.
                    """)


def read_decimalnl_short(f):
    r"""
    >>> import io
    >>> read_decimalnl_short(io.BytesIO(b"1234\n56"))
    1234

    >>> read_decimalnl_short(io.BytesIO(b"1234L\n56"))
    Traceback (most recent call last):
    ...
    ValueError: invalid literal for int() with base 10: b'1234L'
    """

    s = read_stringnl(f, decode=False, stripquotes=False)

    # There's a hack for True and False here.
    if s == b"00":
        return False
    elif s == b"01":
        return True

    return int(s)

def read_decimalnl_long(f):
    r"""
    >>> import io

    >>> read_decimalnl_long(io.BytesIO(b"1234L\n56"))
    1234

    >>> read_decimalnl_long(io.BytesIO(b"123456789012345678901234L\n6"))
    123456789012345678901234
    """

    s = read_stringnl(f, decode=False, stripquotes=False)
    if s[-1:] == b'L':
        s = s[:-1]
    return int(s)


decimalnl_short = ArgumentDescriptor(
                      name='decimalnl_short',
                      n=UP_TO_NEWLINE,
                      reader=read_decimalnl_short,
                      doc="""A newline-terminated decimal integer literal.

                          This never has a trailing 'L', and the integer fit
                          in a short Python int on the box where the pickle
                          was written -- but there's no guarantee it will fit
                          in a short Python int on the box where the pickle
                          is read.
                          """)

decimalnl_long = ArgumentDescriptor(
                     name='decimalnl_long',
                     n=UP_TO_NEWLINE,
                     reader=read_decimalnl_long,
                     doc="""A newline-terminated decimal integer literal.

                         This has a trailing 'L', and can represent integers
                         of any size.
                         """)


def read_floatnl(f):
    r"""
    >>> import io
    >>> read_floatnl(io.BytesIO(b"-1.25\n6"))
    -1.25
    """
    s = read_stringnl(f, decode=False, stripquotes=False)
    return float(s)

floatnl = ArgumentDescriptor(
              name='floatnl',
              n=UP_TO_NEWLINE,
              reader=read_floatnl,
              doc="""A newline-terminated decimal floating literal.

              In general this requires 17 significant digits for roundtrip
              identity, and pickling then unpickling infinities, NaNs, and
              minus zero doesn't work across boxes, or on some boxes even
              on itself (e.g., Windows can't read the strings it produces
              for infinities or NaNs).
              """)

def read_float8(f):
    r"""
    >>> import io, struct
    >>> raw = struct.pack(">d", -1.25)
    >>> raw
    b'\xbf\xf4\x00\x00\x00\x00\x00\x00'
    >>> read_float8(io.BytesIO(raw + b"\n"))
    -1.25
    """

    data = f.read(8)
    if len(data) == 8:
        return _unpack(">d", data)[0]
    raise ValueError("not enough data in stream to read float8")


float8 = ArgumentDescriptor(
             name='float8',
             n=8,
             reader=read_float8,
             doc="""An 8-byte binary representation of a float, big-endian.

             The format is unique to Python, and shared with the struct
             module (format string '>d') "in theory" (the struct and pickle
             implementations don't share the code -- they should).  It's
             strongly related to the IEEE-754 double format, and, in normal
             cases, is in fact identical to the big-endian 754 double format.
             On other boxes the dynamic range is limited to that of a 754
             double, and "add a half and chop" rounding is used to reduce
             the precision to 53 bits.  However, even on a 754 box,
             infinities, NaNs, and minus zero may not be handled correctly
             (may not survive roundtrip pickling intact).
             """)

# Protocol 2 formats

from pickle import decode_long

def read_long1(f):
    r"""
    >>> import io
    >>> read_long1(io.BytesIO(b"\x00"))
    0
    >>> read_long1(io.BytesIO(b"\x02\xff\x00"))
    255
    >>> read_long1(io.BytesIO(b"\x02\xff\x7f"))
    32767
    >>> read_long1(io.BytesIO(b"\x02\x00\xff"))
    -256
    >>> read_long1(io.BytesIO(b"\x02\x00\x80"))
    -32768
    """

    n = read_uint1(f)
    data = f.read(n)
    if len(data) != n:
        raise ValueError("not enough data in stream to read long1")
    return decode_long(data)

long1 = ArgumentDescriptor(
    name="long1",
    n=TAKEN_FROM_ARGUMENT1,
    reader=read_long1,
    doc="""A binary long, little-endian, using 1-byte size.

    This first reads one byte as an unsigned size, then reads that
    many bytes and interprets them as a little-endian 2's-complement long.
    If the size is 0, that's taken as a shortcut for the long 0L.
    """)

def read_long4(f):
    r"""
    >>> import io
    >>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\xff\x00"))
    255
    >>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\xff\x7f"))
    32767
    >>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\x00\xff"))
    -256
    >>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\x00\x80"))
    -32768
    >>> read_long1(io.BytesIO(b"\x00\x00\x00\x00"))
    0
    """

    n = read_int4(f)
    if n < 0:
        raise ValueError("long4 byte count < 0: %d" % n)
    data = f.read(n)
    if len(data) != n:
        raise ValueError("not enough data in stream to read long4")
    return decode_long(data)

long4 = ArgumentDescriptor(
    name="long4",
    n=TAKEN_FROM_ARGUMENT4,
    reader=read_long4,
    doc="""A binary representation of a long, little-endian.

    This first reads four bytes as a signed size (but requires the
    size to be >= 0), then reads that many bytes and interprets them
    as a little-endian 2's-complement long.  If the size is 0, that's taken
    as a shortcut for the int 0, although LONG1 should really be used
    then instead (and in any case where # of bytes < 256).
    """)


##############################################################################
# Object descriptors.  The stack used by the pickle machine holds objects,
# and in the stack_before and stack_after attributes of OpcodeInfo
# descriptors we need names to describe the various types of objects that can
# appear on the stack.

class StackObject(object):
    __slots__ = (
        # name of descriptor record, for info only
        'name',

        # type of object, or tuple of type objects (meaning the object can
        # be of any type in the tuple)
        'obtype',

        # human-readable docs for this kind of stack object; a string
        'doc',
    )

    def __init__(self, name, obtype, doc):
        assert isinstance(name, str)
        self.name = name

        assert isinstance(obtype, type) or isinstance(obtype, tuple)
        if isinstance(obtype, tuple):
            for contained in obtype:
                assert isinstance(contained, type)
        self.obtype = obtype

        assert isinstance(doc, str)
        self.doc = doc

    def __repr__(self):
        return self.name


pyint = pylong = StackObject(
    name='int',
    obtype=int,
    doc="A Python integer object.")

pyinteger_or_bool = StackObject(
    name='int_or_bool',
    obtype=(int, bool),
    doc="A Python integer or boolean object.")

pybool = StackObject(
    name='bool',
    obtype=bool,
    doc="A Python boolean object.")

pyfloat = StackObject(
    name='float',
    obtype=float,
    doc="A Python float object.")

pybytes_or_str = pystring = StackObject(
    name='bytes_or_str',
    obtype=(bytes, str),
    doc="A Python bytes or (Unicode) string object.")

pybytes = StackObject(
    name='bytes',
    obtype=bytes,
    doc="A Python bytes object.")

pybytearray = StackObject(
    name='bytearray',
    obtype=bytearray,
    doc="A Python bytearray object.")

pyunicode = StackObject(
    name='str',
    obtype=str,
    doc="A Python (Unicode) string object.")

pynone = StackObject(
    name="None",
    obtype=type(None),
    doc="The Python None object.")

pytuple = StackObject(
    name="tuple",
    obtype=tuple,
    doc="A Python tuple object.")

pylist = StackObject(
    name="list",
    obtype=list,
    doc="A Python list object.")

pydict = StackObject(
    name="dict",
    obtype=dict,
    doc="A Python dict object.")

pyset = StackObject(
    name="set",
    obtype=set,
    doc="A Python set object.")

pyfrozenset = StackObject(
    name="frozenset",
    obtype=set,
    doc="A Python frozenset object.")

pybuffer = StackObject(
    name='buffer',
    obtype=object,
    doc="A Python buffer-like object.")

anyobject = StackObject(
    name='any',
    obtype=object,
    doc="Any kind of object whatsoever.")

markobject = StackObject(
    name="mark",
    obtype=StackObject,
    doc="""'The mark' is a unique object.

Opcodes that operate on a variable number of objects
generally don't embed the count of objects in the opcode,
or pull it off the stack.  Instead the MARK opcode is used
to push a special marker object on the stack, and then
some other opcodes grab all the objects from the top of
the stack down to (but not including) the topmost marker
object.
""")

stackslice = StackObject(
    name="stackslice",
    obtype=StackObject,
    doc="""An object representing a contiguous slice of the stack.

This is used in conjunction with markobject, to represent all
of the stack following the topmost markobject.  For example,
the POP_MARK opcode changes the stack from

    [..., markobject, stackslice]
to
    [...]

No matter how many object are on the stack after the topmost
markobject, POP_MARK gets rid of all of them (including the
topmost markobject too).
""")

##############################################################################
# Descriptors for pickle opcodes.

class OpcodeInfo(object):

    __slots__ = (
        # symbolic name of opcode; a string
        'name',

        # the code used in a bytestream to represent the opcode; a
        # one-character string
        'code',

        # If the opcode has an argument embedded in the byte string, an
        # instance of ArgumentDescriptor specifying its type.  Note that
        # arg.reader(s) can be used to read and decode the argument from
        # the bytestream s, and arg.doc documents the format of the raw
        # argument bytes.  If the opcode doesn't have an argument embedded
        # in the bytestream, arg should be None.
        'arg',

        # what the stack looks like before this opcode runs; a list
        'stack_before',

        # what the stack looks like after this opcode runs; a list
        'stack_after',

        # the protocol number in which this opcode was introduced; an int
        'proto',

        # human-readable docs for this opcode; a string
        'doc',
    )

    def __init__(self, name, code, arg,
                 stack_before, stack_after, proto, doc):
        assert isinstance(name, str)
        self.name = name

        assert isinstance(code, str)
        assert len(code) == 1
        self.code = code

        assert arg is None or isinstance(arg, ArgumentDescriptor)
        self.arg = arg

        assert isinstance(stack_before, list)
        for x in stack_before:
            assert isinstance(x, StackObject)
        self.stack_before = stack_before

        assert isinstance(stack_after, list)
        for x in stack_after:
            assert isinstance(x, StackObject)
        self.stack_after = stack_after

        assert isinstance(proto, int) and 0 <= proto <= pickle.HIGHEST_PROTOCOL
        self.proto = proto

        assert isinstance(doc, str)
        self.doc = doc

I = OpcodeInfo
opcodes = [

    # Ways to spell integers.

    I(name='INT',
      code='I',
      arg=decimalnl_short,
      stack_before=[],
      stack_after=[pyinteger_or_bool],
      proto=0,
      doc="""Push an integer or bool.

      The argument is a newline-terminated decimal literal string.

      The intent may have been that this always fit in a short Python int,
      but INT can be generated in pickles written on a 64-bit box that
      require a Python long on a 32-bit box.  The difference between this
      and LONG then is that INT skips a trailing 'L', and produces a short
      int whenever possible.

      Another difference is due to that, when bool was introduced as a
      distinct type in 2.3, builtin names True and False were also added to
      2.2.2, mapping to ints 1 and 0.  For compatibility in both directions,
      True gets pickled as INT + "I01\\n", and False as INT + "I00\\n".
      Leading zeroes are never produced for a genuine integer.  The 2.3
      (and later) unpicklers special-case these and return bool instead;
      earlier unpicklers ignore the leading "0" and return the int.
      """),

    I(name='BININT',
      code='J',
      arg=int4,
      stack_before=[],
      stack_after=[pyint],
      proto=1,
      doc="""Push a four-byte signed integer.

      This handles the full range of Python (short) integers on a 32-bit
      box, directly as binary bytes (1 for the opcode and 4 for the integer).
      If the integer is non-negative and fits in 1 or 2 bytes, pickling via
      BININT1 or BININT2 saves space.
      """),

    I(name='BININT1',
      code='K',
      arg=uint1,
      stack_before=[],
      stack_after=[pyint],
      proto=1,
      doc="""Push a one-byte unsigned integer.

      This is a space optimization for pickling very small non-negative ints,
      in range(256).
      """),

    I(name='BININT2',
      code='M',
      arg=uint2,
      stack_before=[],
      stack_after=[pyint],
      proto=1,
      doc="""Push a two-byte unsigned integer.

      This is a space optimization for pickling small positive ints, in
      range(256, 2**16).  Integers in range(256) can also be pickled via
      BININT2, but BININT1 instead saves a byte.
      """),

    I(name='LONG',
      code='L',
      arg=decimalnl_long,
      stack_before=[],
      stack_after=[pyint],
      proto=0,
      doc="""Push a long integer.

      The same as INT, except that the literal ends with 'L', and always
      unpickles to a Python long.  There doesn't seem a real purpose to the
      trailing 'L'.

      Note that LONG takes time quadratic in the number of digits when
      unpickling (this is simply due to the nature of decimal->binary
      conversion).  Proto 2 added linear-time (in C; still quadratic-time
      in Python) LONG1 and LONG4 opcodes.
      """),

    I(name="LONG1",
      code='\x8a',
      arg=long1,
      stack_before=[],
      stack_after=[pyint],
      proto=2,
      doc="""Long integer using one-byte length.

      A more efficient encoding of a Python long; the long1 encoding
      says it all."""),

    I(name="LONG4",
      code='\x8b',
      arg=long4,
      stack_before=[],
      stack_after=[pyint],
      proto=2,
      doc="""Long integer using found-byte length.

      A more efficient encoding of a Python long; the long4 encoding
      says it all."""),

    # Ways to spell strings (8-bit, not Unicode).

    I(name='STRING',
      code='S',
      arg=stringnl,
      stack_before=[],
      stack_after=[pybytes_or_str],
      proto=0,
      doc="""Push a Python string object.

      The argument is a repr-style string, with bracketing quote characters,
      and perhaps embedded escapes.  The argument extends until the next
      newline character.  These are usually decoded into a str instance
      using the encoding given to the Unpickler constructor. or the default,
      'ASCII'.  If the encoding given was 'bytes' however, they will be
      decoded as bytes object instead.
      """),

    I(name='BINSTRING',
      code='T',
      arg=string4,
      stack_before=[],
      stack_after=[pybytes_or_str],
      proto=1,
      doc="""Push a Python string object.

      There are two arguments: the first is a 4-byte little-endian
      signed int giving the number of bytes in the string, and the
      second is that many bytes, which are taken literally as the string
      content.  These are usually decoded into a str instance using the
      encoding given to the Unpickler constructor. or the default,
      'ASCII'.  If the encoding given was 'bytes' however, they will be
      decoded as bytes object instead.
      """),

    I(name='SHORT_BINSTRING',
      code='U',
      arg=string1,
      stack_before=[],
      stack_after=[pybytes_or_str],
      proto=1,
      doc="""Push a Python string object.

      There are two arguments: the first is a 1-byte unsigned int giving
      the number of bytes in the string, and the second is that many
      bytes, which are taken literally as the string content.  These are
      usually decoded into a str instance using the encoding given to
      the Unpickler constructor. or the default, 'ASCII'.  If the
      encoding given was 'bytes' however, they will be decoded as bytes
      object instead.
      """),

    # Bytes (protocol 3 and higher)

    I(name='BINBYTES',
      code='B',
      arg=bytes4,
      stack_before=[],
      stack_after=[pybytes],
      proto=3,
      doc="""Push a Python bytes object.

      There are two arguments:  the first is a 4-byte little-endian unsigned int
      giving the number of bytes, and the second is that many bytes, which are
      taken literally as the bytes content.
      """),

    I(name='SHORT_BINBYTES',
      code='C',
      arg=bytes1,
      stack_before=[],
      stack_after=[pybytes],
      proto=3,
      doc="""Push a Python bytes object.

      There are two arguments:  the first is a 1-byte unsigned int giving
      the number of bytes, and the second is that many bytes, which are taken
      literally as the string content.
      """),

    I(name='BINBYTES8',
      code='\x8e',
      arg=bytes8,
      stack_before=[],
      stack_after=[pybytes],
      proto=4,
      doc="""Push a Python bytes object.

      There are two arguments:  the first is an 8-byte unsigned int giving
      the number of bytes in the string, and the second is that many bytes,
      which are taken literally as the string content.
      """),

    # Bytearray (protocol 5 and higher)

    I(name='BYTEARRAY8',
      code='\x96',
      arg=bytearray8,
      stack_before=[],
      stack_after=[pybytearray],
      proto=5,
      doc="""Push a Python bytearray object.

      There are two arguments:  the first is an 8-byte unsigned int giving
      the number of bytes in the bytearray, and the second is that many bytes,
      which are taken literally as the bytearray content.
      """),

    # Out-of-band buffer (protocol 5 and higher)

    I(name='NEXT_BUFFER',
      code='\x97',
      arg=None,
      stack_before=[],
      stack_after=[pybuffer],
      proto=5,
      doc="Push an out-of-band buffer object."),

    I(name='READONLY_BUFFER',
      code='\x98',
      arg=None,
      stack_before=[pybuffer],
      stack_after=[pybuffer],
      proto=5,
      doc="Make an out-of-band buffer object read-only."),

    # Ways to spell None.

    I(name='NONE',
      code='N',
      arg=None,
      stack_before=[],
      stack_after=[pynone],
      proto=0,
      doc="Push None on the stack."),

    # Ways to spell bools, starting with proto 2.  See INT for how this was
    # done before proto 2.

    I(name='NEWTRUE',
      code='\x88',
      arg=None,
      stack_before=[],
      stack_after=[pybool],
      proto=2,
      doc="Push True onto the stack."),

    I(name='NEWFALSE',
      code='\x89',
      arg=None,
      stack_before=[],
      stack_after=[pybool],
      proto=2,
      doc="Push False onto the stack."),

    # Ways to spell Unicode strings.

    I(name='UNICODE',
      code='V',
      arg=unicodestringnl,
      stack_before=[],
      stack_after=[pyunicode],
      proto=0,  # this may be pure-text, but it's a later addition
      doc="""Push a Python Unicode string object.

      The argument is a raw-unicode-escape encoding of a Unicode string,
      and so may contain embedded escape sequences.  The argument extends
      until the next newline character.
      """),

    I(name='SHORT_BINUNICODE',
      code='\x8c',
      arg=unicodestring1,
      stack_before=[],
      stack_after=[pyunicode],
      proto=4,
      doc="""Push a Python Unicode string object.

      There are two arguments:  the first is a 1-byte little-endian signed int
      giving the number of bytes in the string.  The second is that many
      bytes, and is the UTF-8 encoding of the Unicode string.
      """),

    I(name='BINUNICODE',
      code='X',
      arg=unicodestring4,
      stack_before=[],
      stack_after=[pyunicode],
      proto=1,
      doc="""Push a Python Unicode string object.

      There are two arguments:  the first is a 4-byte little-endian unsigned int
      giving the number of bytes in the string.  The second is that many
      bytes, and is the UTF-8 encoding of the Unicode string.
      """),

    I(name='BINUNICODE8',
      code='\x8d',
      arg=unicodestring8,
      stack_before=[],
      stack_after=[pyunicode],
      proto=4,
      doc="""Push a Python Unicode string object.

      There are two arguments:  the first is an 8-byte little-endian signed int
      giving the number of bytes in the string.  The second is that many
      bytes, and is the UTF-8 encoding of the Unicode string.
      """),

    # Ways to spell floats.

    I(name='FLOAT',
      code='F',
      arg=floatnl,
      stack_before=[],
      stack_after=[pyfloat],
      proto=0,
      doc="""Newline-terminated decimal float literal.

      The argument is repr(a_float), and in general requires 17 significant
      digits for roundtrip conversion to be an identity (this is so for
      IEEE-754 double precision values, which is what Python float maps to
      on most boxes).

      In general, FLOAT cannot be used to transport infinities, NaNs, or
      minus zero across boxes (or even on a single box, if the platform C
      library can't read the strings it produces for such things -- Windows
      is like that), but may do less damage than BINFLOAT on boxes with
      greater precision or dynamic range than IEEE-754 double.
      """),

    I(name='BINFLOAT',
      code='G',
      arg=float8,
      stack_before=[],
      stack_after=[pyfloat],
      proto=1,
      doc="""Float stored in binary form, with 8 bytes of data.

      This generally requires less than half the space of FLOAT encoding.
      In general, BINFLOAT cannot be used to transport infinities, NaNs, or
      minus zero, raises an exception if the exponent exceeds the range of
      an IEEE-754 double, and retains no more than 53 bits of precision (if
      there are more than that, "add a half and chop" rounding is used to
      cut it back to 53 significant bits).
      """),

    # Ways to build lists.

    I(name='EMPTY_LIST',
      code=']',
      arg=None,
      stack_before=[],
      stack_after=[pylist],
      proto=1,
      doc="Push an empty list."),

    I(name='APPEND',
      code='a',
      arg=None,
      stack_before=[pylist, anyobject],
      stack_after=[pylist],
      proto=0,
      doc="""Append an object to a list.

      Stack before:  ... pylist anyobject
      Stack after:   ... pylist+[anyobject]

      although pylist is really extended in-place.
      """),

    I(name='APPENDS',
      code='e',
      arg=None,
      stack_before=[pylist, markobject, stackslice],
      stack_after=[pylist],
      proto=1,
      doc="""Extend a list by a slice of stack objects.

      Stack before:  ... pylist markobject stackslice
      Stack after:   ... pylist+stackslice

      although pylist is really extended in-place.
      """),

    I(name='LIST',
      code='l',
      arg=None,
      stack_before=[markobject, stackslice],
      stack_after=[pylist],
      proto=0,
      doc="""Build a list out of the topmost stack slice, after markobject.

      All the stack entries following the topmost markobject are placed into
      a single Python list, which single list object replaces all of the
      stack from the topmost markobject onward.  For example,

      Stack before: ... markobject 1 2 3 'abc'
      Stack after:  ... [1, 2, 3, 'abc']
      """),

    # Ways to build tuples.

    I(name='EMPTY_TUPLE',
      code=')',
      arg=None,
      stack_before=[],
      stack_after=[pytuple],
      proto=1,
      doc="Push an empty tuple."),

    I(name='TUPLE',
      code='t',
      arg=None,
      stack_before=[markobject, stackslice],
      stack_after=[pytuple],
      proto=0,
      doc="""Build a tuple out of the topmost stack slice, after markobject.

      All the stack entries following the topmost markobject are placed into
      a single Python tuple, which single tuple object replaces all of the
      stack from the topmost markobject onward.  For example,

      Stack before: ... markobject 1 2 3 'abc'
      Stack after:  ... (1, 2, 3, 'abc')
      """),

    I(name='TUPLE1',
      code='\x85',
      arg=None,
      stack_before=[anyobject],
      stack_after=[pytuple],
      proto=2,
      doc="""Build a one-tuple out of the topmost item on the stack.

      This code pops one value off the stack and pushes a tuple of
      length 1 whose one item is that value back onto it.  In other
      words:

          stack[-1] = tuple(stack[-1:])
      """),

    I(name='TUPLE2',
      code='\x86',
      arg=None,
      stack_before=[anyobject, anyobject],
      stack_after=[pytuple],
      proto=2,
      doc="""Build a two-tuple out of the top two items on the stack.

      This code pops two values off the stack and pushes a tuple of
      length 2 whose items are those values back onto it.  In other
      words:

          stack[-2:] = [tuple(stack[-2:])]
      """),

    I(name='TUPLE3',
      code='\x87',
      arg=None,
      stack_before=[anyobject, anyobject, anyobject],
      stack_after=[pytuple],
      proto=2,
      doc="""Build a three-tuple out of the top three items on the stack.

      This code pops three values off the stack and pushes a tuple of
      length 3 whose items are those values back onto it.  In other
      words:

          stack[-3:] = [tuple(stack[-3:])]
      """),

    # Ways to build dicts.

    I(name='EMPTY_DICT',
      code='}',
      arg=None,
      stack_before=[],
      stack_after=[pydict],
      proto=1,
      doc="Push an empty dict."),

    I(name='DICT',
      code='d',
      arg=None,
      stack_before=[markobject, stackslice],
      stack_after=[pydict],
      proto=0,
      doc="""Build a dict out of the topmost stack slice, after markobject.

      All the stack entries following the topmost markobject are placed into
      a single Python dict, which single dict object replaces all of the
      stack from the topmost markobject onward.  The stack slice alternates
      key, value, key, value, ....  For example,

      Stack before: ... markobject 1 2 3 'abc'
      Stack after:  ... {1: 2, 3: 'abc'}
      """),

    I(name='SETITEM',
      code='s',
      arg=None,
      stack_before=[pydict, anyobject, anyobject],
      stack_after=[pydict],
      proto=0,
      doc="""Add a key+value pair to an existing dict.

      Stack before:  ... pydict key value
      Stack after:   ... pydict

      where pydict has been modified via pydict[key] = value.
      """),

    I(name='SETITEMS',
      code='u',
      arg=None,
      stack_before=[pydict, markobject, stackslice],
      stack_after=[pydict],
      proto=1,
      doc="""Add an arbitrary number of key+value pairs to an existing dict.

      The slice of the stack following the topmost markobject is taken as
      an alternating sequence of keys and values, added to the dict
      immediately under the topmost markobject.  Everything at and after the
      topmost markobject is popped, leaving the mutated dict at the top
      of the stack.

      Stack before:  ... pydict markobject key_1 value_1 ... key_n value_n
      Stack after:   ... pydict

      where pydict has been modified via pydict[key_i] = value_i for i in
      1, 2, ..., n, and in that order.
      """),

    # Ways to build sets

    I(name='EMPTY_SET',
      code='\x8f',
      arg=None,
      stack_before=[],
      stack_after=[pyset],
      proto=4,
      doc="Push an empty set."),

    I(name='ADDITEMS',
      code='\x90',
      arg=None,
      stack_before=[pyset, markobject, stackslice],
      stack_after=[pyset],
      proto=4,
      doc="""Add an arbitrary number of items to an existing set.

      The slice of the stack following the topmost markobject is taken as
      a sequence of items, added to the set immediately under the topmost
      markobject.  Everything at and after the topmost markobject is popped,
      leaving the mutated set at the top of the stack.

      Stack before:  ... pyset markobject item_1 ... item_n
      Stack after:   ... pyset

      where pyset has been modified via pyset.add(item_i) = item_i for i in
      1, 2, ..., n, and in that order.
      """),

    # Way to build frozensets

    I(name='FROZENSET',
      code='\x91',
      arg=None,
      stack_before=[markobject, stackslice],
      stack_after=[pyfrozenset],
      proto=4,
      doc="""Build a frozenset out of the topmost slice, after markobject.

      All the stack entries following the topmost markobject are placed into
      a single Python frozenset, which single frozenset object replaces all
      of the stack from the topmost markobject onward.  For example,

      Stack before: ... markobject 1 2 3
      Stack after:  ... frozenset({1, 2, 3})
      """),

    # Stack manipulation.

    I(name='POP',
      code='0',
      arg=None,
      stack_before=[anyobject],
      stack_after=[],
      proto=0,
      doc="Discard the top stack item, shrinking the stack by one item."),

    I(name='DUP',
      code='2',
      arg=None,
      stack_before=[anyobject],
      stack_after=[anyobject, anyobject],
      proto=0,
      doc="Push the top stack item onto the stack again, duplicating it."),

    I(name='MARK',
      code='(',
      arg=None,
      stack_before=[],
      stack_after=[markobject],
      proto=0,
      doc="""Push markobject onto the stack.

      markobject is a unique object, used by other opcodes to identify a
      region of the stack containing a variable number of objects for them
      to work on.  See markobject.doc for more detail.
      """),

    I(name='POP_MARK',
      code='1',
      arg=None,
      stack_before=[markobject, stackslice],
      stack_after=[],
      proto=1,
      doc="""Pop all the stack objects at and above the topmost markobject.

      When an opcode using a variable number of stack objects is done,
      POP_MARK is used to remove those objects, and to remove the markobject
      that delimited their starting position on the stack.
      """),

    # Memo manipulation.  There are really only two operations (get and put),
    # each in all-text, "short binary", and "long binary" flavors.

    I(name='GET',
      code='g',
      arg=decimalnl_short,
      stack_before=[],
      stack_after=[anyobject],
      proto=0,
      doc="""Read an object from the memo and push it on the stack.

      The index of the memo object to push is given by the newline-terminated
      decimal string following.  BINGET and LONG_BINGET are space-optimized
      versions.
      """),

    I(name='BINGET',
      code='h',
      arg=uint1,
      stack_before=[],
      stack_after=[anyobject],
      proto=1,
      doc="""Read an object from the memo and push it on the stack.

      The index of the memo object to push is given by the 1-byte unsigned
      integer following.
      """),

    I(name='LONG_BINGET',
      code='j',
      arg=uint4,
      stack_before=[],
      stack_after=[anyobject],
      proto=1,
      doc="""Read an object from the memo and push it on the stack.

      The index of the memo object to push is given by the 4-byte unsigned
      little-endian integer following.
      """),

    I(name='PUT',
      code='p',
      arg=decimalnl_short,
      stack_before=[],
      stack_after=[],
      proto=0,
      doc="""Store the stack top into the memo.  The stack is not popped.

      The index of the memo location to write into is given by the newline-
      terminated decimal string following.  BINPUT and LONG_BINPUT are
      space-optimized versions.
      """),

    I(name='BINPUT',
      code='q',
      arg=uint1,
      stack_before=[],
      stack_after=[],
      proto=1,
      doc="""Store the stack top into the memo.  The stack is not popped.

      The index of the memo location to write into is given by the 1-byte
      unsigned integer following.
      """),

    I(name='LONG_BINPUT',
      code='r',
      arg=uint4,
      stack_before=[],
      stack_after=[],
      proto=1,
      doc="""Store the stack top into the memo.  The stack is not popped.

      The index of the memo location to write into is given by the 4-byte
      unsigned little-endian integer following.
      """),

    I(name='MEMOIZE',
      code='\x94',
      arg=None,
      stack_before=[anyobject],
      stack_after=[anyobject],
      proto=4,
      doc="""Store the stack top into the memo.  The stack is not popped.

      The index of the memo location to write is the number of
      elements currently present in the memo.
      """),

    # Access the extension registry (predefined objects).  Akin to the GET
    # family.

    I(name='EXT1',
      code='\x82',
      arg=uint1,
      stack_before=[],
      stack_after=[anyobject],
      proto=2,
      doc="""Extension code.

      This code and the similar EXT2 and EXT4 allow using a registry
      of popular objects that are pickled by name, typically classes.
      It is envisioned that through a global negotiation and
      registration process, third parties can set up a mapping between
      ints and object names.

      In order to guarantee pickle interchangeability, the extension
      code registry ought to be global, although a range of codes may
      be reserved for private use.

      EXT1 has a 1-byte integer argument.  This is used to index into the
      extension registry, and the object at that index is pushed on the stack.
      """),

    I(name='EXT2',
      code='\x83',
      arg=uint2,
      stack_before=[],
      stack_after=[anyobject],
      proto=2,
      doc="""Extension code.

      See EXT1.  EXT2 has a two-byte integer argument.
      """),

    I(name='EXT4',
      code='\x84',
      arg=int4,
      stack_before=[],
      stack_after=[anyobject],
      proto=2,
      doc="""Extension code.

      See EXT1.  EXT4 has a four-byte integer argument.
      """),

    # Push a class object, or module function, on the stack, via its module
    # and name.

    I(name='GLOBAL',
      code='c',
      arg=stringnl_noescape_pair,
      stack_before=[],
      stack_after=[anyobject],
      proto=0,
      doc="""Push a global object (module.attr) on the stack.

      Two newline-terminated strings follow the GLOBAL opcode.  The first is
      taken as a module name, and the second as a class name.  The class
      object module.class is pushed on the stack.  More accurately, the
      object returned by self.find_class(module, class) is pushed on the
      stack, so unpickling subclasses can override this form of lookup.
      """),

    I(name='STACK_GLOBAL',
      code='\x93',
      arg=None,
      stack_before=[pyunicode, pyunicode],
      stack_after=[anyobject],
      proto=4,
      doc="""Push a global object (module.attr) on the stack.
      """),

    # Ways to build objects of classes pickle doesn't know about directly
    # (user-defined classes).  I despair of documenting this accurately
    # and comprehensibly -- you really have to read the pickle code to
    # find all the special cases.

    I(name='REDUCE',
      code='R',
      arg=None,
      stack_before=[anyobject, anyobject],
      stack_after=[anyobject],
      proto=0,
      doc="""Push an object built from a callable and an argument tuple.

      The opcode is named to remind of the __reduce__() method.

      Stack before: ... callable pytuple
      Stack after:  ... callable(*pytuple)

      The callable and the argument tuple are the first two items returned
      by a __reduce__ method.  Applying the callable to the argtuple is
      supposed to reproduce the original object, or at least get it started.
      If the __reduce__ method returns a 3-tuple, the last component is an
      argument to be passed to the object's __setstate__, and then the REDUCE
      opcode is followed by code to create setstate's argument, and then a
      BUILD opcode to apply  __setstate__ to that argument.

      If not isinstance(callable, type), REDUCE complains unless the
      callable has been registered with the copyreg module's
      safe_constructors dict, or the callable has a magic
      '__safe_for_unpickling__' attribute with a true value.  I'm not sure
      why it does this, but I've sure seen this complaint often enough when
      I didn't want to <wink>.
      """),

    I(name='BUILD',
      code='b',
      arg=None,
      stack_before=[anyobject, anyobject],
      stack_after=[anyobject],
      proto=0,
      doc="""Finish building an object, via __setstate__ or dict update.

      Stack before: ... anyobject argument
      Stack after:  ... anyobject

      where anyobject may have been mutated, as follows:

      If the object has a __setstate__ method,

          anyobject.__setstate__(argument)

      is called.

      Else the argument must be a dict, the object must have a __dict__, and
      the object is updated via

          anyobject.__dict__.update(argument)
      """),

    I(name='INST',
      code='i',
      arg=stringnl_noescape_pair,
      stack_before=[markobject, stackslice],
      stack_after=[anyobject],
      proto=0,
      doc="""Build a class instance.

      This is the protocol 0 version of protocol 1's OBJ opcode.
      INST is followed by two newline-terminated strings, giving a
      module and class name, just as for the GLOBAL opcode (and see
      GLOBAL for more details about that).  self.find_class(module, name)
      is used to get a class object.

      In addition, all the objects on the stack following the topmost
      markobject are gathered into a tuple and popped (along with the
      topmost markobject), just as for the TUPLE opcode.

      Now it gets complicated.  If all of these are true:

        + The argtuple is empty (markobject was at the top of the stack
          at the start).

        + The class object does not have a __getinitargs__ attribute.

      then we want to create an old-style class instance without invoking
      its __init__() method (pickle has waffled on this over the years; not
      calling __init__() is current wisdom).  In this case, an instance of
      an old-style dummy class is created, and then we try to rebind its
      __class__ attribute to the desired class object.  If this succeeds,
      the new instance object is pushed on the stack, and we're done.

      Else (the argtuple is not empty, it's not an old-style class object,
      or the class object does have a __getinitargs__ attribute), the code
      first insists that the class object have a __safe_for_unpickling__
      attribute.  Unlike as for the __safe_for_unpickling__ check in REDUCE,
      it doesn't matter whether this attribute has a true or false value, it
      only matters whether it exists (XXX this is a bug).  If
      __safe_for_unpickling__ doesn't exist, UnpicklingError is raised.

      Else (the class object does have a __safe_for_unpickling__ attr),
      the class object obtained from INST's arguments is applied to the
      argtuple obtained from the stack, and the resulting instance object
      is pushed on the stack.

      NOTE:  checks for __safe_for_unpickling__ went away in Python 2.3.
      NOTE:  the distinction between old-style and new-style classes does
             not make sense in Python 3.
      """),

    I(name='OBJ',
      code='o',
      arg=None,
      stack_before=[markobject, anyobject, stackslice],
      stack_after=[anyobject],
      proto=1,
      doc="""Build a class instance.

      This is the protocol 1 version of protocol 0's INST opcode, and is
      very much like it.  The major difference is that the class object
      is taken off the stack, allowing it to be retrieved from the memo
      repeatedly if several instances of the same class are created.  This
      can be much more efficient (in both time and space) than repeatedly
      embedding the module and class names in INST opcodes.

      Unlike INST, OBJ takes no arguments from the opcode stream.  Instead
      the class object is taken off the stack, immediately above the
      topmost markobject:

      Stack before: ... markobject classobject stackslice
      Stack after:  ... new_instance_object

      As for INST, the remainder of the stack above the markobject is
      gathered into an argument tuple, and then the logic seems identical,
      except that no __safe_for_unpickling__ check is done (XXX this is
      a bug).  See INST for the gory details.

      NOTE:  In Python 2.3, INST and OBJ are identical except for how they
      get the class object.  That was always the intent; the implementations
      had diverged for accidental reasons.
      """),

    I(name='NEWOBJ',
      code='\x81',
      arg=None,
      stack_before=[anyobject, anyobject],
      stack_after=[anyobject],
      proto=2,
      doc="""Build an object instance.

      The stack before should be thought of as containing a class
      object followed by an argument tuple (the tuple being the stack
      top).  Call these cls and args.  They are popped off the stack,
      and the value returned by cls.__new__(cls, *args) is pushed back
      onto the stack.
      """),

    I(name='NEWOBJ_EX',
      code='\x92',
      arg=None,
      stack_before=[anyobject, anyobject, anyobject],
      stack_after=[anyobject],
      proto=4,
      doc="""Build an object instance.

      The stack before should be thought of as containing a class
      object followed by an argument tuple and by a keyword argument dict
      (the dict being the stack top).  Call these cls and args.  They are
      popped off the stack, and the value returned by
      cls.__new__(cls, *args, *kwargs) is  pushed back  onto the stack.
      """),

    # Machine control.

    I(name='PROTO',
      code='\x80',
      arg=uint1,
      stack_before=[],
      stack_after=[],
      proto=2,
      doc="""Protocol version indicator.

      For protocol 2 and above, a pickle must start with this opcode.
      The argument is the protocol version, an int in range(2, 256).
      """),

    I(name='STOP',
      code='.',
      arg=None,
      stack_before=[anyobject],
      stack_after=[],
      proto=0,
      doc="""Stop the unpickling machine.

      Every pickle ends with this opcode.  The object at the top of the stack
      is popped, and that's the result of unpickling.  The stack should be
      empty then.
      """),

    # Framing support.

    I(name='FRAME',
      code='\x95',
      arg=uint8,
      stack_before=[],
      stack_after=[],
      proto=4,
      doc="""Indicate the beginning of a new frame.

      The unpickler may use this opcode to safely prefetch data from its
      underlying stream.
      """),

    # Ways to deal with persistent IDs.

    I(name='PERSID',
      code='P',
      arg=stringnl_noescape,
      stack_before=[],
      stack_after=[anyobject],
      proto=0,
      doc="""Push an object identified by a persistent ID.

      The pickle module doesn't define what a persistent ID means.  PERSID's
      argument is a newline-terminated str-style (no embedded escapes, no
      bracketing quote characters) string, which *is* "the persistent ID".
      The unpickler passes this string to self.persistent_load().  Whatever
      object that returns is pushed on the stack.  There is no implementation
      of persistent_load() in Python's unpickler:  it must be supplied by an
      unpickler subclass.
      """),

    I(name='BINPERSID',
      code='Q',
      arg=None,
      stack_before=[anyobject],
      stack_after=[anyobject],
      proto=1,
      doc="""Push an object identified by a persistent ID.

      Like PERSID, except the persistent ID is popped off the stack (instead
      of being a string embedded in the opcode bytestream).  The persistent
      ID is passed to self.persistent_load(), and whatever object that
      returns is pushed on the stack.  See PERSID for more detail.
      """),
]
del I

# Verify uniqueness of .name and .code members.
name2i = {}
code2i = {}

for i, d in enumerate(opcodes):
    if d.name in name2i:
        raise ValueError("repeated name %r at indices %d and %d" %
                         (d.name, name2i[d.name], i))
    if d.code in code2i:
        raise ValueError("repeated code %r at indices %d and %d" %
                         (d.code, code2i[d.code], i))

    name2i[d.name] = i
    code2i[d.code] = i

del name2i, code2i, i, d

##############################################################################
# Build a code2op dict, mapping opcode characters to OpcodeInfo records.
# Also ensure we've got the same stuff as pickle.py, although the
# introspection here is dicey.

code2op = {}
for d in opcodes:
    code2op[d.code] = d
del d

def assure_pickle_consistency(verbose=False):

    copy = code2op.copy()
    for name in pickle.__all__:
        if not re.match("[A-Z][A-Z0-9_]+$", name):
            if verbose:
                print("skipping %r: it doesn't look like an opcode name" % name)
            continue
        picklecode = getattr(pickle, name)
        if not isinstance(picklecode, bytes) or len(picklecode) != 1:
            if verbose:
                print(("skipping %r: value %r doesn't look like a pickle "
                       "code" % (name, picklecode)))
            continue
        picklecode = picklecode.decode("latin-1")
        if picklecode in copy:
            if verbose:
                print("checking name %r w/ code %r for consistency" % (
                      name, picklecode))
            d = copy[picklecode]
            if d.name != name:
                raise ValueError("for pickle code %r, pickle.py uses name %r "
                                 "but we're using name %r" % (picklecode,
                                                              name,
                                                              d.name))
            # Forget this one.  Any left over in copy at the end are a problem
            # of a different kind.
            del copy[picklecode]
        else:
            raise ValueError("pickle.py appears to have a pickle opcode with "
                             "name %r and code %r, but we don't" %
                             (name, picklecode))
    if copy:
        msg = ["we appear to have pickle opcodes that pickle.py doesn't have:"]
        for code, d in copy.items():
            msg.append("    name %r with code %r" % (d.name, code))
        raise ValueError("\n".join(msg))

assure_pickle_consistency()
del assure_pickle_consistency

##############################################################################
# A pickle opcode generator.

def _genops(data, yield_end_pos=False):
    if isinstance(data, bytes_types):
        data = io.BytesIO(data)

    if hasattr(data, "tell"):
        getpos = data.tell
    else:
        getpos = lambda: None

    while True:
        pos = getpos()
        code = data.read(1)
        opcode = code2op.get(code.decode("latin-1"))
        if opcode is None:
            if code == b"":
                raise ValueError("pickle exhausted before seeing STOP")
            else:
                raise ValueError("at position %s, opcode %r unknown" % (
                                 "<unknown>" if pos is None else pos,
                                 code))
        if opcode.arg is None:
            arg = None
        else:
            arg = opcode.arg.reader(data)
        if yield_end_pos:
            yield opcode, arg, pos, getpos()
        else:
            yield opcode, arg, pos
        if code == b'.':
            assert opcode.name == 'STOP'
            break

def genops(pickle):
    """Generate all the opcodes in a pickle.

    'pickle' is a file-like object, or string, containing the pickle.

    Each opcode in the pickle is generated, from the current pickle position,
    stopping after a STOP opcode is delivered.  A triple is generated for
    each opcode:

        opcode, arg, pos

    opcode is an OpcodeInfo record, describing the current opcode.

    If the opcode has an argument embedded in the pickle, arg is its decoded
    value, as a Python object.  If the opcode doesn't have an argument, arg
    is None.

    If the pickle has a tell() method, pos was the value of pickle.tell()
    before reading the current opcode.  If the pickle is a bytes object,
    it's wrapped in a BytesIO object, and the latter's tell() result is
    used.  Else (the pickle doesn't have a tell(), and it's not obvious how
    to query its current position) pos is None.
    """
    return _genops(pickle)

##############################################################################
# A pickle optimizer.

def optimize(p):
    'Optimize a pickle string by removing unused PUT opcodes'
    put = 'PUT'
    get = 'GET'
    oldids = set()          # set of all PUT ids
    newids = {}             # set of ids used by a GET opcode
    opcodes = []            # (op, idx) or (pos, end_pos)
    proto = 0
    protoheader = b''
    for opcode, arg, pos, end_pos in _genops(p, yield_end_pos=True):
        if 'PUT' in opcode.name:
            oldids.add(arg)
            opcodes.append((put, arg))
        elif opcode.name == 'MEMOIZE':
            idx = len(oldids)
            oldids.add(idx)
            opcodes.append((put, idx))
        elif 'FRAME' in opcode.name:
            pass
        elif 'GET' in opcode.name:
            if opcode.proto > proto:
                proto = opcode.proto
            newids[arg] = None
            opcodes.append((get, arg))
        elif opcode.name == 'PROTO':
            if arg > proto:
                proto = arg
            if pos == 0:
                protoheader = p[pos:end_pos]
            else:
                opcodes.append((pos, end_pos))
        else:
            opcodes.append((pos, end_pos))
    del oldids

    # Copy the opcodes except for PUTS without a corresponding GET
    out = io.BytesIO()
    # Write the PROTO header before any framing
    out.write(protoheader)
    pickler = pickle._Pickler(out, proto)
    if proto >= 4:
        pickler.framer.start_framing()
    idx = 0
    for op, arg in opcodes:
        frameless = False
        if op is put:
            if arg not in newids:
                continue
            data = pickler.put(idx)
            newids[arg] = idx
            idx += 1
        elif op is get:
            data = pickler.get(newids[arg])
        else:
            data = p[op:arg]
            frameless = len(data) > pickler.framer._FRAME_SIZE_TARGET
        pickler.framer.commit_frame(force=frameless)
        if frameless:
            pickler.framer.file_write(data)
        else:
            pickler.write(data)
    pickler.framer.end_framing()
    return out.getvalue()

##############################################################################
# A symbolic pickle disassembler.

def dis(pickle, out=None, memo=None, indentlevel=4, annotate=0):
    """Produce a symbolic disassembly of a pickle.

    'pickle' is a file-like object, or string, containing a (at least one)
    pickle.  The pickle is disassembled from the current position, through
    the first STOP opcode encountered.

    Optional arg 'out' is a file-like object to which the disassembly is
    printed.  It defaults to sys.stdout.

    Optional arg 'memo' is a Python dict, used as the pickle's memo.  It
    may be mutated by dis(), if the pickle contains PUT or BINPUT opcodes.
    Passing the same memo object to another dis() call then allows disassembly
    to proceed across multiple pickles that were all created by the same
    pickler with the same memo.  Ordinarily you don't need to worry about this.

    Optional arg 'indentlevel' is the number of blanks by which to indent
    a new MARK level.  It defaults to 4.

    Optional arg 'annotate' if nonzero instructs dis() to add short
    description of the opcode on each line of disassembled output.
    The value given to 'annotate' must be an integer and is used as a
    hint for the column where annotation should start.  The default
    value is 0, meaning no annotations.

    In addition to printing the disassembly, some sanity checks are made:

    + All embedded opcode arguments "make sense".

    + Explicit and implicit pop operations have enough items on the stack.

    + When an opcode implicitly refers to a markobject, a markobject is
      actually on the stack.

    + A memo entry isn't referenced before it's defined.

    + The markobject isn't stored in the memo.

    + A memo entry isn't redefined.
    """

    # Most of the hair here is for sanity checks, but most of it is needed
    # anyway to detect when a protocol 0 POP takes a MARK off the stack
    # (which in turn is needed to indent MARK blocks correctly).

    stack = []          # crude emulation of unpickler stack
    if memo is None:
        memo = {}       # crude emulation of unpickler memo
    maxproto = -1       # max protocol number seen
    markstack = []      # bytecode positions of MARK opcodes
    indentchunk = ' ' * indentlevel
    errormsg = None
    annocol = annotate  # column hint for annotations
    for opcode, arg, pos in genops(pickle):
        if pos is not None:
            print("%5d:" % pos, end=' ', file=out)

        line = "%-4s %s%s" % (repr(opcode.code)[1:-1],
                              indentchunk * len(markstack),
                              opcode.name)

        maxproto = max(maxproto, opcode.proto)
        before = opcode.stack_before    # don't mutate
        after = opcode.stack_after      # don't mutate
        numtopop = len(before)

        # See whether a MARK should be popped.
        markmsg = None
        if markobject in before or (opcode.name == "POP" and
                                    stack and
                                    stack[-1] is markobject):
            assert markobject not in after
            if __debug__:
                if markobject in before:
                    assert before[-1] is stackslice
            if markstack:
                markpos = markstack.pop()
                if markpos is None:
                    markmsg = "(MARK at unknown opcode offset)"
                else:
                    markmsg = "(MARK at %d)" % markpos
                # Pop everything at and after the topmost markobject.
                while stack[-1] is not markobject:
                    stack.pop()
                stack.pop()
                # Stop later code from popping too much.
                try:
                    numtopop = before.index(markobject)
                except ValueError:
                    assert opcode.name == "POP"
                    numtopop = 0
            else:
                errormsg = markmsg = "no MARK exists on stack"

        # Check for correct memo usage.
        if opcode.name in ("PUT", "BINPUT", "LONG_BINPUT", "MEMOIZE"):
            if opcode.name == "MEMOIZE":
                memo_idx = len(memo)
                markmsg = "(as %d)" % memo_idx
            else:
                assert arg is not None
                memo_idx = arg
            if memo_idx in memo:
                errormsg = "memo key %r already defined" % arg
            elif not stack:
                errormsg = "stack is empty -- can't store into memo"
            elif stack[-1] is markobject:
                errormsg = "can't store markobject in the memo"
            else:
                memo[memo_idx] = stack[-1]
        elif opcode.name in ("GET", "BINGET", "LONG_BINGET"):
            if arg in memo:
                assert len(after) == 1
                after = [memo[arg]]     # for better stack emulation
            else:
                errormsg = "memo key %r has never been stored into" % arg

        if arg is not None or markmsg:
            # make a mild effort to align arguments
            line += ' ' * (10 - len(opcode.name))
            if arg is not None:
                line += ' ' + repr(arg)
            if markmsg:
                line += ' ' + markmsg
        if annotate:
            line += ' ' * (annocol - len(line))
            # make a mild effort to align annotations
            annocol = len(line)
            if annocol > 50:
                annocol = annotate
            line += ' ' + opcode.doc.split('\n', 1)[0]
        print(line, file=out)

        if errormsg:
            # Note that we delayed complaining until the offending opcode
            # was printed.
            raise ValueError(errormsg)

        # Emulate the stack effects.
        if len(stack) < numtopop:
            raise ValueError("tries to pop %d items from stack with "
                             "only %d items" % (numtopop, len(stack)))
        if numtopop:
            del stack[-numtopop:]
        if markobject in after:
            assert markobject not in before
            markstack.append(pos)

        stack.extend(after)

    print("highest protocol among opcodes =", maxproto, file=out)
    if stack:
        raise ValueError("stack not empty after STOP: %r" % stack)

# For use in the doctest, simply as an example of a class to pickle.
class _Example:
    def __init__(self, value):
        self.value = value

_dis_test = r"""
>>> import pickle
>>> x = [1, 2, (3, 4), {b'abc': "def"}]
>>> pkl0 = pickle.dumps(x, 0)
>>> dis(pkl0)
    0: (    MARK
    1: l        LIST       (MARK at 0)
    2: p    PUT        0
    5: I    INT        1
    8: a    APPEND
    9: I    INT        2
   12: a    APPEND
   13: (    MARK
   14: I        INT        3
   17: I        INT        4
   20: t        TUPLE      (MARK at 13)
   21: p    PUT        1
   24: a    APPEND
   25: (    MARK
   26: d        DICT       (MARK at 25)
   27: p    PUT        2
   30: c    GLOBAL     '_codecs encode'
   46: p    PUT        3
   49: (    MARK
   50: V        UNICODE    'abc'
   55: p        PUT        4
   58: V        UNICODE    'latin1'
   66: p        PUT        5
   69: t        TUPLE      (MARK at 49)
   70: p    PUT        6
   73: R    REDUCE
   74: p    PUT        7
   77: V    UNICODE    'def'
   82: p    PUT        8
   85: s    SETITEM
   86: a    APPEND
   87: .    STOP
highest protocol among opcodes = 0

Try again with a "binary" pickle.

>>> pkl1 = pickle.dumps(x, 1)
>>> dis(pkl1)
    0: ]    EMPTY_LIST
    1: q    BINPUT     0
    3: (    MARK
    4: K        BININT1    1
    6: K        BININT1    2
    8: (        MARK
    9: K            BININT1    3
   11: K            BININT1    4
   13: t            TUPLE      (MARK at 8)
   14: q        BINPUT     1
   16: }        EMPTY_DICT
   17: q        BINPUT     2
   19: c        GLOBAL     '_codecs encode'
   35: q        BINPUT     3
   37: (        MARK
   38: X            BINUNICODE 'abc'
   46: q            BINPUT     4
   48: X            BINUNICODE 'latin1'
   59: q            BINPUT     5
   61: t            TUPLE      (MARK at 37)
   62: q        BINPUT     6
   64: R        REDUCE
   65: q        BINPUT     7
   67: X        BINUNICODE 'def'
   75: q        BINPUT     8
   77: s        SETITEM
   78: e        APPENDS    (MARK at 3)
   79: .    STOP
highest protocol among opcodes = 1

Exercise the INST/OBJ/BUILD family.

>>> import pickletools
>>> dis(pickle.dumps(pickletools.dis, 0))
    0: c    GLOBAL     'pickletools dis'
   17: p    PUT        0
   20: .    STOP
highest protocol among opcodes = 0

>>> from pickletools import _Example
>>> x = [_Example(42)] * 2
>>> dis(pickle.dumps(x, 0))
    0: (    MARK
    1: l        LIST       (MARK at 0)
    2: p    PUT        0
    5: c    GLOBAL     'copy_reg _reconstructor'
   30: p    PUT        1
   33: (    MARK
   34: c        GLOBAL     'pickletools _Example'
   56: p        PUT        2
   59: c        GLOBAL     '__builtin__ object'
   79: p        PUT        3
   82: N        NONE
   83: t        TUPLE      (MARK at 33)
   84: p    PUT        4
   87: R    REDUCE
   88: p    PUT        5
   91: (    MARK
   92: d        DICT       (MARK at 91)
   93: p    PUT        6
   96: V    UNICODE    'value'
  103: p    PUT        7
  106: I    INT        42
  110: s    SETITEM
  111: b    BUILD
  112: a    APPEND
  113: g    GET        5
  116: a    APPEND
  117: .    STOP
highest protocol among opcodes = 0

>>> dis(pickle.dumps(x, 1))
    0: ]    EMPTY_LIST
    1: q    BINPUT     0
    3: (    MARK
    4: c        GLOBAL     'copy_reg _reconstructor'
   29: q        BINPUT     1
   31: (        MARK
   32: c            GLOBAL     'pickletools _Example'
   54: q            BINPUT     2
   56: c            GLOBAL     '__builtin__ object'
   76: q            BINPUT     3
   78: N            NONE
   79: t            TUPLE      (MARK at 31)
   80: q        BINPUT     4
   82: R        REDUCE
   83: q        BINPUT     5
   85: }        EMPTY_DICT
   86: q        BINPUT     6
   88: X        BINUNICODE 'value'
   98: q        BINPUT     7
  100: K        BININT1    42
  102: s        SETITEM
  103: b        BUILD
  104: h        BINGET     5
  106: e        APPENDS    (MARK at 3)
  107: .    STOP
highest protocol among opcodes = 1

Try "the canonical" recursive-object test.

>>> L = []
>>> T = L,
>>> L.append(T)
>>> L[0] is T
True
>>> T[0] is L
True
>>> L[0][0] is L
True
>>> T[0][0] is T
True
>>> dis(pickle.dumps(L, 0))
    0: (    MARK
    1: l        LIST       (MARK at 0)
    2: p    PUT        0
    5: (    MARK
    6: g        GET        0
    9: t        TUPLE      (MARK at 5)
   10: p    PUT        1
   13: a    APPEND
   14: .    STOP
highest protocol among opcodes = 0

>>> dis(pickle.dumps(L, 1))
    0: ]    EMPTY_LIST
    1: q    BINPUT     0
    3: (    MARK
    4: h        BINGET     0
    6: t        TUPLE      (MARK at 3)
    7: q    BINPUT     1
    9: a    APPEND
   10: .    STOP
highest protocol among opcodes = 1

Note that, in the protocol 0 pickle of the recursive tuple, the disassembler
has to emulate the stack in order to realize that the POP opcode at 16 gets
rid of the MARK at 0.

>>> dis(pickle.dumps(T, 0))
    0: (    MARK
    1: (        MARK
    2: l            LIST       (MARK at 1)
    3: p        PUT        0
    6: (        MARK
    7: g            GET        0
   10: t            TUPLE      (MARK at 6)
   11: p        PUT        1
   14: a        APPEND
   15: 0        POP
   16: 0        POP        (MARK at 0)
   17: g    GET        1
   20: .    STOP
highest protocol among opcodes = 0

>>> dis(pickle.dumps(T, 1))
    0: (    MARK
    1: ]        EMPTY_LIST
    2: q        BINPUT     0
    4: (        MARK
    5: h            BINGET     0
    7: t            TUPLE      (MARK at 4)
    8: q        BINPUT     1
   10: a        APPEND
   11: 1        POP_MARK   (MARK at 0)
   12: h    BINGET     1
   14: .    STOP
highest protocol among opcodes = 1

Try protocol 2.

>>> dis(pickle.dumps(L, 2))
    0: \x80 PROTO      2
    2: ]    EMPTY_LIST
    3: q    BINPUT     0
    5: h    BINGET     0
    7: \x85 TUPLE1
    8: q    BINPUT     1
   10: a    APPEND
   11: .    STOP
highest protocol among opcodes = 2

>>> dis(pickle.dumps(T, 2))
    0: \x80 PROTO      2
    2: ]    EMPTY_LIST
    3: q    BINPUT     0
    5: h    BINGET     0
    7: \x85 TUPLE1
    8: q    BINPUT     1
   10: a    APPEND
   11: 0    POP
   12: h    BINGET     1
   14: .    STOP
highest protocol among opcodes = 2

Try protocol 3 with annotations:

>>> dis(pickle.dumps(T, 3), annotate=1)
    0: \x80 PROTO      3 Protocol version indicator.
    2: ]    EMPTY_LIST   Push an empty list.
    3: q    BINPUT     0 Store the stack top into the memo.  The stack is not popped.
    5: h    BINGET     0 Read an object from the memo and push it on the stack.
    7: \x85 TUPLE1       Build a one-tuple out of the topmost item on the stack.
    8: q    BINPUT     1 Store the stack top into the memo.  The stack is not popped.
   10: a    APPEND       Append an object to a list.
   11: 0    POP          Discard the top stack item, shrinking the stack by one item.
   12: h    BINGET     1 Read an object from the memo and push it on the stack.
   14: .    STOP         Stop the unpickling machine.
highest protocol among opcodes = 2

"""

_memo_test = r"""
>>> import pickle
>>> import io
>>> f = io.BytesIO()
>>> p = pickle.Pickler(f, 2)
>>> x = [1, 2, 3]
>>> p.dump(x)
>>> p.dump(x)
>>> f.seek(0)
0
>>> memo = {}
>>> dis(f, memo=memo)
    0: \x80 PROTO      2
    2: ]    EMPTY_LIST
    3: q    BINPUT     0
    5: (    MARK
    6: K        BININT1    1
    8: K        BININT1    2
   10: K        BININT1    3
   12: e        APPENDS    (MARK at 5)
   13: .    STOP
highest protocol among opcodes = 2
>>> dis(f, memo=memo)
   14: \x80 PROTO      2
   16: h    BINGET     0
   18: .    STOP
highest protocol among opcodes = 2
"""

__test__ = {'disassembler_test': _dis_test,
            'disassembler_memo_test': _memo_test,
           }

def _test():
    import doctest
    return doctest.testmod()

if __name__ == "__main__":
    import argparse
    parser = argparse.ArgumentParser(
        description='disassemble one or more pickle files')
    parser.add_argument(
        'pickle_file', type=argparse.FileType('br'),
        nargs='*', help='the pickle file')
    parser.add_argument(
        '-o', '--output', default=sys.stdout, type=argparse.FileType('w'),
        help='the file where the output should be written')
    parser.add_argument(
        '-m', '--memo', action='store_true',
        help='preserve memo between disassemblies')
    parser.add_argument(
        '-l', '--indentlevel', default=4, type=int,
        help='the number of blanks by which to indent a new MARK level')
    parser.add_argument(
        '-a', '--annotate',  action='store_true',
        help='annotate each line with a short opcode description')
    parser.add_argument(
        '-p', '--preamble', default="==> {name} <==",
        help='if more than one pickle file is specified, print this before'
        ' each disassembly')
    parser.add_argument(
        '-t', '--test', action='store_true',
        help='run self-test suite')
    parser.add_argument(
        '-v', action='store_true',
        help='run verbosely; only affects self-test run')
    args = parser.parse_args()
    if args.test:
        _test()
    else:
        annotate = 30 if args.annotate else 0
        if not args.pickle_file:
            parser.print_help()
        elif len(args.pickle_file) == 1:
            dis(args.pickle_file[0], args.output, None,
                args.indentlevel, annotate)
        else:
            memo = {} if args.memo else None
            for f in args.pickle_file:
                preamble = args.preamble.format(name=f.name)
                args.output.write(preamble + '\n')
                dis(f, args.output, memo, args.indentlevel, annotate)
__future__.py000064400000012033151153537550007235 0ustar00"""Record of phased-in incompatible language changes.

Each line is of the form:

    FeatureName = "_Feature(" OptionalRelease "," MandatoryRelease ","
                              CompilerFlag ")"

where, normally, OptionalRelease < MandatoryRelease, and both are 5-tuples
of the same form as sys.version_info:

    (PY_MAJOR_VERSION, # the 2 in 2.1.0a3; an int
     PY_MINOR_VERSION, # the 1; an int
     PY_MICRO_VERSION, # the 0; an int
     PY_RELEASE_LEVEL, # "alpha", "beta", "candidate" or "final"; string
     PY_RELEASE_SERIAL # the 3; an int
    )

OptionalRelease records the first release in which

    from __future__ import FeatureName

was accepted.

In the case of MandatoryReleases that have not yet occurred,
MandatoryRelease predicts the release in which the feature will become part
of the language.

Else MandatoryRelease records when the feature became part of the language;
in releases at or after that, modules no longer need

    from __future__ import FeatureName

to use the feature in question, but may continue to use such imports.

MandatoryRelease may also be None, meaning that a planned feature got
dropped.

Instances of class _Feature have two corresponding methods,
.getOptionalRelease() and .getMandatoryRelease().

CompilerFlag is the (bitfield) flag that should be passed in the fourth
argument to the builtin function compile() to enable the feature in
dynamically compiled code.  This flag is stored in the .compiler_flag
attribute on _Future instances.  These values must match the appropriate
#defines of CO_xxx flags in Include/compile.h.

No feature line is ever to be deleted from this file.
"""

all_feature_names = [
    "nested_scopes",
    "generators",
    "division",
    "absolute_import",
    "with_statement",
    "print_function",
    "unicode_literals",
    "barry_as_FLUFL",
    "generator_stop",
    "annotations",
]

__all__ = ["all_feature_names"] + all_feature_names

# The CO_xxx symbols are defined here under the same names defined in
# code.h and used by compile.h, so that an editor search will find them here.
# However, they're not exported in __all__, because they don't really belong to
# this module.
CO_NESTED = 0x0010                      # nested_scopes
CO_GENERATOR_ALLOWED = 0                # generators (obsolete, was 0x1000)
CO_FUTURE_DIVISION = 0x20000            # division
CO_FUTURE_ABSOLUTE_IMPORT = 0x40000     # perform absolute imports by default
CO_FUTURE_WITH_STATEMENT = 0x80000      # with statement
CO_FUTURE_PRINT_FUNCTION = 0x100000     # print function
CO_FUTURE_UNICODE_LITERALS = 0x200000   # unicode string literals
CO_FUTURE_BARRY_AS_BDFL = 0x400000
CO_FUTURE_GENERATOR_STOP = 0x800000     # StopIteration becomes RuntimeError in generators
CO_FUTURE_ANNOTATIONS = 0x1000000       # annotations become strings at runtime


class _Feature:

    def __init__(self, optionalRelease, mandatoryRelease, compiler_flag):
        self.optional = optionalRelease
        self.mandatory = mandatoryRelease
        self.compiler_flag = compiler_flag

    def getOptionalRelease(self):
        """Return first release in which this feature was recognized.

        This is a 5-tuple, of the same form as sys.version_info.
        """
        return self.optional

    def getMandatoryRelease(self):
        """Return release in which this feature will become mandatory.

        This is a 5-tuple, of the same form as sys.version_info, or, if
        the feature was dropped, is None.
        """
        return self.mandatory

    def __repr__(self):
        return "_Feature" + repr((self.optional,
                                  self.mandatory,
                                  self.compiler_flag))


nested_scopes = _Feature((2, 1, 0, "beta",  1),
                         (2, 2, 0, "alpha", 0),
                         CO_NESTED)

generators = _Feature((2, 2, 0, "alpha", 1),
                      (2, 3, 0, "final", 0),
                      CO_GENERATOR_ALLOWED)

division = _Feature((2, 2, 0, "alpha", 2),
                    (3, 0, 0, "alpha", 0),
                    CO_FUTURE_DIVISION)

absolute_import = _Feature((2, 5, 0, "alpha", 1),
                           (3, 0, 0, "alpha", 0),
                           CO_FUTURE_ABSOLUTE_IMPORT)

with_statement = _Feature((2, 5, 0, "alpha", 1),
                          (2, 6, 0, "alpha", 0),
                          CO_FUTURE_WITH_STATEMENT)

print_function = _Feature((2, 6, 0, "alpha", 2),
                          (3, 0, 0, "alpha", 0),
                          CO_FUTURE_PRINT_FUNCTION)

unicode_literals = _Feature((2, 6, 0, "alpha", 2),
                            (3, 0, 0, "alpha", 0),
                            CO_FUTURE_UNICODE_LITERALS)

barry_as_FLUFL = _Feature((3, 1, 0, "alpha", 2),
                          (4, 0, 0, "alpha", 0),
                          CO_FUTURE_BARRY_AS_BDFL)

generator_stop = _Feature((3, 5, 0, "beta", 1),
                          (3, 7, 0, "alpha", 0),
                          CO_FUTURE_GENERATOR_STOP)

annotations = _Feature((3, 7, 0, "beta", 1),
                       (3, 10, 0, "alpha", 0),
                       CO_FUTURE_ANNOTATIONS)
__pycache__/asynchat.cpython-38.pyc000064400000015305151153537550013234 0ustar00U

e5d@,�@sDdZddlZddlmZGdd�dej�ZGdd�d�Zdd	�ZdS)
a�A class supporting chat-style (command/response) protocols.

This class adds support for 'chat' style protocols - where one side
sends a 'command', and the other sends a response (examples would be
the common internet protocols - smtp, nntp, ftp, etc..).

The handle_read() method looks at the input stream for the current
'terminator' (usually '\r\n' for single-line responses, '\r\n.\r\n'
for multi-line output), calling self.found_terminator() on its
receipt.

for example:
Say you build an async nntp client using this class.  At the start
of the connection, you'll have self.terminator set to '\r\n', in
order to process the single-line greeting.  Just before issuing a
'LIST' command you'll set it to '\r\n.\r\n'.  The output of the LIST
command will be accumulated (using your own 'collect_incoming_data'
method) up to the terminator, and then control will be returned to
you - by calling your self.found_terminator() method.
�N)�dequec@s�eZdZdZdZdZdZdZd(dd�Zdd	�Z	d
d�Z
dd
�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�ZdS))�
async_chatz�This is an abstract class.  You must derive from this class, and add
    the two methods collect_incoming_data() and found_terminator()irzlatin-1NcCs(d|_g|_t�|_tj�|||�dS�N�)�ac_in_buffer�incomingr�
producer_fifo�asyncore�
dispatcher�__init__)�selfZsock�map�r� /usr/lib64/python3.8/asynchat.pyrCszasync_chat.__init__cCstd��dS�Nzmust be implemented in subclass��NotImplementedError�r�datarrr�collect_incoming_dataQsz async_chat.collect_incoming_datacCs|j�|�dS�N)r�appendrrrr�_collect_incoming_dataTsz!async_chat._collect_incoming_datacCsd�|j�}|jdd�=|Sr)�joinr)r�drrr�	_get_dataWszasync_chat._get_datacCstd��dSrr�rrrr�found_terminator\szasync_chat.found_terminatorcCsBt|t�r|jrt||j�}nt|t�r8|dkr8td��||_dS)zdSet the input delimiter.

        Can be a fixed string of any length, an integer, or None.
        rz-the number of received bytes must be positiveN)�
isinstance�str�use_encoding�bytes�encoding�int�
ValueError�
terminator)rZtermrrr�set_terminator_s
zasync_chat.set_terminatorcCs|jSr)r%rrrr�get_terminatorjszasync_chat.get_terminatorc
Cs�z|�|j�}WnDtk
r&YdStk
rT}z|��WY�dSd}~XYnXt|t�rr|jrrtt|j	�}|j
||_
|j
�r�t|j
�}|��}|s�|�
|j
�d|_
q~t|t��r|}||kr�|�
|j
�d|_
|j||_n2|�
|j
d|��|j
|d�|_
d|_|��q~t|�}|j
�|�}|dk�rv|dk�rX|�
|j
d|��|j
||d�|_
|��q~t|j
|�}|�r�||k�r�|�
|j
d|��|j
|d�|_
�q�q~|�
|j
�d|_
q~dS)Nrr���)Zrecv�ac_in_buffer_size�BlockingIOError�OSError�handle_errorrrr r!r"r�lenr'rr#r%r�find�find_prefix_at_end)rrZwhyZlbr%�nZterminator_len�indexrrr�handle_readrsR

	



zasync_chat.handle_readcCs|��dSr)�
initiate_sendrrrr�handle_write�szasync_chat.handle_writecCs|��dSr)�closerrrr�handle_close�szasync_chat.handle_closecCsxt|tttf�stdt|���|j}t|�|kr`tdt|�|�D]}|j	�
||||��q@n|j	�
|�|��dS)Nz#data argument must be byte-ish (%r)r)rr!�	bytearray�
memoryview�	TypeError�type�ac_out_buffer_sizer-�rangerrr3)rrZsabs�irrr�push�s�zasync_chat.pushcCs|j�|�|��dSr)rrr3)rZproducerrrr�push_with_producer�szasync_chat.push_with_producercCsdS)z4predicate for inclusion in the readable for select()�rrrrr�readable�szasync_chat.readablecCs|jp|jS)z4predicate for inclusion in the writable for select())r�	connectedrrrr�writable�szasync_chat.writablecCs|j�d�dS)zAautomatically close this channel once the outgoing queue is emptyN)rrrrrr�close_when_done�szasync_chat.close_when_donecCs|j�r|j�r|jd}|s:|jd=|dkr:|��dS|j}z|d|�}Wn:tk
r�|��}|rz|j�|�n|jd=YqYnXt|t�r�|j	r�t
||j�}z|�|�}Wnt
k
r�|��YdSX|�r|t|�ks�|t|�k�r
||d�|jd<n|jd=dSdS)Nr)rrBr6r;r9�more�
appendleftrrr r!r"�sendr+r,r-)r�firstZobsrZnum_sentrrrr3�s8

zasync_chat.initiate_sendcCs d|_|jdd�=|j��dSr)rrr�clearrrrr�discard_buffersszasync_chat.discard_buffers)NN)�__name__�
__module__�__qualname__�__doc__r)r;r r"rrrrrr&r'r2r4r6r>r?rArCrDr3rJrrrrr4s,
H(rc@seZdZddd�Zdd�ZdS)�simple_producer�cCs||_||_dSr)r�buffer_size)rrrQrrrrszsimple_producer.__init__cCsJt|j�|jkr6|jd|j�}|j|jd�|_|S|j}d|_|SdSr)r-rrQ)r�resultrrrrEszsimple_producer.moreN)rP)rKrLrMrrErrrrrOs
rOcCs0t|�d}|r,|�|d|��s,|d8}q|S)Nr@)r-�endswith)ZhaystackZneedle�lrrrr//s
r/)rNr	�collectionsrr
rrOr/rrrr�<module>s\ __pycache__/subprocess.cpython-38.pyc000064400000122341151153537550013611 0ustar00U

e5d�1�@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZdddddd	d
ddd
ddddgZ
zddlZddlZdZWn0ek
r�dZddlZddlZddlZYn�XddlmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&e
�'dddddddddddd d!d"d#d$d%d&d'g�Gd(d�de(�Z)Gd)d
�d
e)�Z*Gd*d�de)�Z+e�r�Gd+d�d�Z,Gd,d-�d-e-�Z.n&e/ed.d/�Z0e1ed0��r�ej2Z3nej4Z3e�r�dZ5d1d2�Z6ngZ5d3d2�Z6d4Z7d5Z8d6Z9d7d8�Z:d9d:�Z;dd;�d<d�Z<d=d�Z=dd;�d>d�Z>Gd?d�de?�Z@ddddd@�dAd�ZAdBdC�ZBdDd	�ZCdEd
�ZDdFdG�ZEeE�ZFGdHd�de?�ZGdS)Ia�Subprocesses with accessible I/O streams

This module allows you to spawn processes, connect to their
input/output/error pipes, and obtain their return codes.

For a complete description of this module see the Python documentation.

Main API
========
run(...): Runs a command, waits for it to complete, then returns a
          CompletedProcess instance.
Popen(...): A class for flexibly executing a command in a new process

Constants
---------
DEVNULL: Special value that indicates that os.devnull should be used
PIPE:    Special value that indicates a pipe should be created
STDOUT:  Special value that indicates that stderr should go to stdout


Older API
=========
call(...): Runs a command, waits for it to complete, then returns
    the return code.
check_call(...): Same as call() but raises CalledProcessError()
    if return code is not 0
check_output(...): Same as check_call() but returns the contents of
    stdout instead of a return code
getoutput(...): Runs a command in the shell, waits for it to complete,
    then returns the output
getstatusoutput(...): Runs a command in the shell, waits for it to complete,
    then returns a (exitcode, output) tuple
�N)�	monotonic�Popen�PIPE�STDOUT�call�
check_call�getstatusoutput�	getoutput�check_output�run�CalledProcessError�DEVNULL�SubprocessError�TimeoutExpired�CompletedProcessTF)�CREATE_NEW_CONSOLE�CREATE_NEW_PROCESS_GROUP�STD_INPUT_HANDLE�STD_OUTPUT_HANDLE�STD_ERROR_HANDLE�SW_HIDE�STARTF_USESTDHANDLES�STARTF_USESHOWWINDOW�ABOVE_NORMAL_PRIORITY_CLASS�BELOW_NORMAL_PRIORITY_CLASS�HIGH_PRIORITY_CLASS�IDLE_PRIORITY_CLASS�NORMAL_PRIORITY_CLASS�REALTIME_PRIORITY_CLASS�CREATE_NO_WINDOW�DETACHED_PROCESS�CREATE_DEFAULT_ERROR_MODE�CREATE_BREAKAWAY_FROM_JOBrrrrrrrr�STARTUPINFOrrrrrrrr r!r"c@seZdZdS)rN)�__name__�
__module__�__qualname__�r'r'�"/usr/lib64/python3.8/subprocess.pyr`sc@s<eZdZdZd
dd�Zdd�Zedd��Zejd	d��ZdS)rz�Raised when run() is called with check=True and the process
    returns a non-zero exit status.

    Attributes:
      cmd, returncode, stdout, stderr, output
    NcCs||_||_||_||_dS�N)�
returncode�cmd�output�stderr)�selfr*r+r,r-r'r'r(�__init__jszCalledProcessError.__init__cCsh|jrT|jdkrTzd|jt�|j�fWStk
rPd|j|jfYSXnd|j|jfSdS)NrzCommand '%s' died with %r.z)Command '%s' died with unknown signal %d.z.Command '%s' returned non-zero exit status %d.)r*r+�signalZSignals�
ValueError�r.r'r'r(�__str__ps���zCalledProcessError.__str__cCs|jS)z+Alias for output attribute, to match stderr�r,r2r'r'r(�stdout|szCalledProcessError.stdoutcCs
||_dSr)r4�r.�valuer'r'r(r5�s)NN�	r$r%r&�__doc__r/r3�propertyr5�setterr'r'r'r(rcs

c@s<eZdZdZd
dd�Zdd�Zedd��Zejd	d��ZdS)rz�This exception is raised when the timeout expires while waiting for a
    child process.

    Attributes:
        cmd, output, stdout, stderr, timeout
    NcCs||_||_||_||_dSr))r+�timeoutr,r-)r.r+r<r,r-r'r'r(r/�szTimeoutExpired.__init__cCsd|j|jfS)Nz'Command '%s' timed out after %s seconds)r+r<r2r'r'r(r3�s
�zTimeoutExpired.__str__cCs|jSr)r4r2r'r'r(r5�szTimeoutExpired.stdoutcCs
||_dSr)r4r6r'r'r(r5�s)NNr8r'r'r'r(r�s

c@s,eZdZddddddd�dd�Zdd�ZdS)r#rN��dwFlags�	hStdInput�
hStdOutput�	hStdError�wShowWindow�lpAttributeListcCs0||_||_||_||_||_|p(dgi|_dS)N�handle_listr=)r.r>r?r@rArBrCr'r'r(r/�szSTARTUPINFO.__init__cCs@|j��}d|kr"t|d�|d<t|j|j|j|j|j|d�S)NrDr=)	rC�copy�listr#r>r?r@rArB)r.Z	attr_listr'r'r(rE�s
�zSTARTUPINFO.copy)r$r%r&r/rEr'r'r'r(r#�s�	c@s2eZdZdZejfdd�Zdd�Zdd�ZeZ	dS)	�HandleFcCs|jsd|_||�dS)NT)�closed)r.�CloseHandler'r'r(�Close�szHandle.ClosecCs |jsd|_t|�Std��dS)NTzalready closed)rH�intr1r2r'r'r(�Detach�sz
Handle.DetachcCsd|jjt|�fS)Nz%s(%d))�	__class__r$rKr2r'r'r(�__repr__�szHandle.__repr__N)
r$r%r&rH�_winapirIrJrLrN�__del__r'r'r'r(rG�s
rGZPIPE_BUFi�PollSelectorcCsdSr)r'r'r'r'r(�_cleanup�srRc	Cs\tdkrdStdd�D]>}|jtjd�}|dk	rzt�|�Wqtk
rTYqXqdS)N��
_deadstate)�_active�_internal_poll�sys�maxsize�remover1)�inst�resr'r'r(rR�s���������cCs*g}tjj}|dkr&|�dd|�|S)zgReturn a list of command-line arguments reproducing the current
    optimization settings in sys.flags.r�-�O)rW�flags�optimize�append)�argsr7r'r'r(�"_optim_args_from_interpreter_flagss
recCsVddddddd�}t�}|��D].\}}ttj|�}|dkr |�d	||�q tjjrd|�d
�n$tjjrv|�d�tjjr�|�d�tj	d
d
�}tjj
}ttdi�}d|k}|dkr�|�d�n|r�|�d�|r�|�d�|D]}|�d|�q�|�r
|�d�dD]B}||k�r||}	|	dk�r4|}
nd||	f}
|�d|
f��q|S)z}Return a list of command-line arguments reproducing the current
    settings in sys.flags, sys.warnoptions and sys._xoptions.�d�B�S�v�b�q)�debug�dont_write_bytecode�no_site�verbose�
bytes_warning�quietrr_z-Iz-Ez-sN�	_xoptions�dev�zerror::BytesWarningzdefault::BytesWarning�defaultz-W)�-Xrs)Zfaulthandler�tracemallocZ
importtimeZshowalloccountZshowrefcount�utf8Tz%s=%srv)
re�items�getattrrWrarc�isolated�ignore_environment�no_user_site�warnoptionsrprY�extend)Zflag_opt_maprd�flag�optriZwarnoptsrpZxoptions�dev_moder7�argr'r'r(�_args_from_interpreter_flagssP�






r��r<c
OsLt||��8}z|j|d�WW5QR�S|���YnXW5QRXdS)z�Run command with arguments.  Wait for command to complete or
    timeout, then return the returncode attribute.

    The arguments are the same as for the Popen constructor.  Example:

    retcode = call(["ls", "-l"])
    r�N)r�wait�kill)r<�	popenargs�kwargs�pr'r'r(rLscOs6t||�}|r2|�d�}|dkr(|d}t||��dS)aORun command with arguments.  Wait for command to complete.  If
    the exit code was zero then return, otherwise raise
    CalledProcessError.  The CalledProcessError object will have the
    return code in the returncode attribute.

    The arguments are the same as for the call function.  Example:

    check_call(["ls", "-l"])
    rdNr)r�getr)r�r��retcoder+r'r'r(r]s



cOsbd|krtd��d|krJ|ddkrJ|�d�s8|�d�r>d}nd}||d<t|t|d	d
�|��jS)aRun command with arguments and return its output.

    If the exit code was non-zero it raises a CalledProcessError.  The
    CalledProcessError object will have the return code in the returncode
    attribute and output in the output attribute.

    The arguments are the same as for the Popen constructor.  Example:

    >>> check_output(["ls", "-l", "/dev/null"])
    b'crw-rw-rw- 1 root root 1, 3 Oct 18  2007 /dev/null\n'

    The stdout argument is not allowed as it is used internally.
    To capture standard error in the result, use stderr=STDOUT.

    >>> check_output(["/bin/sh", "-c",
    ...               "ls -l non_existent_file ; exit 0"],
    ...              stderr=STDOUT)
    b'ls: non_existent_file: No such file or directory\n'

    There is an additional optional argument, "input", allowing you to
    pass a string to the subprocess's stdin.  If you use this argument
    you may not also use the Popen constructor's "stdin" argument, as
    it too will be used internally.  Example:

    >>> check_output(["sed", "-e", "s/foo/bar/"],
    ...              input=b"when in the course of fooman events\n")
    b'when in the course of barman events\n'

    By default, all communication is in bytes, and therefore any "input"
    should be bytes, and the return value will be bytes.  If in text mode,
    any "input" should be a string, and the return value will be a string
    decoded according to locale encoding, or by "encoding" if set. Text mode
    is triggered by setting any of text, encoding, errors or universal_newlines.
    r5z3stdout argument not allowed, it will be overridden.�inputN�universal_newlines�text��T)r5r<�check)r1r�rrr5)r<r�r��emptyr'r'r(r
ps#�c@s*eZdZdZd	dd�Zdd�Zdd�ZdS)
raEA process that has finished running.

    This is returned by run().

    Attributes:
      args: The list or str args passed to run().
      returncode: The exit code of the process, negative for signals.
      stdout: The standard output (None if not captured).
      stderr: The standard error (None if not captured).
    NcCs||_||_||_||_dSr))rdr*r5r-)r.rdr*r5r-r'r'r(r/�szCompletedProcess.__init__cCshd�|j�d�|j�g}|jdk	r4|�d�|j��|jdk	rP|�d�|j��d�t|�jd�|��S)Nz	args={!r}zreturncode={!r}zstdout={!r}zstderr={!r}z{}({})z, )	�formatrdr*r5rcr-�typer$�join)r.rdr'r'r(rN�s

�

zCompletedProcess.__repr__cCs |jrt|j|j|j|j��dS)z6Raise CalledProcessError if the exit code is non-zero.N)r*rrdr5r-r2r'r'r(�check_returncode�s�z!CompletedProcess.check_returncode)NN)r$r%r&r9r/rNr�r'r'r'r(r�s

	)r��capture_outputr<r�cOs |dk	r&|�d�dk	rtd��t|d<|r^|�d�dk	sF|�d�dk	rNtd��t|d<t|d<t||���}z|j||d�\}}Wn^tk
r�}	z,|��tr�|��\|	_|	_	n|�
��W5d}	~	XYn|���YnX|��}
|�r|
�rt|
|j
||d��W5QRXt|j
|
||�S)	aKRun command with arguments and return a CompletedProcess instance.

    The returned instance will have attributes args, returncode, stdout and
    stderr. By default, stdout and stderr are not captured, and those attributes
    will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them.

    If check is True and the exit code was non-zero, it raises a
    CalledProcessError. The CalledProcessError object will have the return code
    in the returncode attribute, and output & stderr attributes if those streams
    were captured.

    If timeout is given, and the process takes too long, a TimeoutExpired
    exception will be raised.

    There is an optional argument "input", allowing you to
    pass bytes or a string to the subprocess's stdin.  If you use this argument
    you may not also use the Popen constructor's "stdin" argument, as
    it will be used internally.

    By default, all communication is in bytes, and therefore any "input" should
    be bytes, and the stdout and stderr will be bytes. If in text mode, any
    "input" should be a string, and stdout and stderr will be strings decoded
    according to locale encoding, or by "encoding" if set. Text mode is
    triggered by setting any of text, encoding, errors or universal_newlines.

    The other arguments are the same as for the Popen constructor.
    N�stdinz/stdin and input arguments may not both be used.r5r-z@stdout and stderr arguments may not be used with capture_output.r��r,r-)r�r1rr�communicaterr��
_mswindowsr5r-r��pollrrdr)r�r�r<r�r�r�Zprocessr5r-�excr�r'r'r(r�s8�cCs�g}d}ttj|�D]�}g}|r*|�d�d|kp>d|kp>|}|rN|�d�|D]b}|dkrj|�|�qR|dkr�|�dt|�d�g}|�d�qR|r�|�|�g}|�|�qR|r�|�|�|r|�|�|�d�qd�|�S)	a�
    Translate a sequence of arguments into a command line
    string, using the same rules as the MS C runtime:

    1) Arguments are delimited by white space, which is either a
       space or a tab.

    2) A string surrounded by double quotation marks is
       interpreted as a single argument, regardless of white space
       contained within.  A quoted string can be embedded in an
       argument.

    3) A double quotation mark preceded by a backslash is
       interpreted as a literal double quotation mark.

    4) Backslashes are interpreted literally, unless they
       immediately precede a double quotation mark.

    5) If backslashes immediately precede a double quotation mark,
       every pair of backslashes is interpreted as a literal
       backslash.  If the number of backslashes is odd, the last
       backslash escapes the next double quotation mark as
       described in rule 3.
    F� �	�"�\�z\"r�)�map�os�fsdecoderc�lenrr�)�seq�resultZ	needquoter�Zbs_buf�cr'r'r(�list2cmdline	s4




r�c
Cslzt|ddtd�}d}Wn.tk
rF}z|j}|j}W5d}~XYnX|dd�dkrd|dd�}||fS)a�Return (exitcode, output) of executing cmd in a shell.

    Execute the string 'cmd' in a shell with 'check_output' and
    return a 2-tuple (status, output). The locale encoding is used
    to decode the output and process newlines.

    A trailing newline is stripped from the output.
    The exit status for the command can be interpreted
    according to the rules for the function 'wait'. Example:

    >>> import subprocess
    >>> subprocess.getstatusoutput('ls /bin/ls')
    (0, '/bin/ls')
    >>> subprocess.getstatusoutput('cat /bin/junk')
    (1, 'cat: /bin/junk: No such file or directory')
    >>> subprocess.getstatusoutput('/bin/junk')
    (127, 'sh: /bin/junk: not found')
    >>> subprocess.getstatusoutput('/bin/kill $$')
    (-15, '')
    T)�shellr�r-rNr\�
)r
rrr,r*)r+�dataZexitcodeZexr'r'r(rRscCst|�dS)a%Return output (stdout or stderr) of executing cmd in a shell.

    Like getstatusoutput(), except the exit status is ignored and the return
    value is a string containing the command's output.  Example:

    >>> import subprocess
    >>> subprocess.getoutput('ls /bin/ls')
    '/bin/ls'
    rt)r)r+r'r'r(r	qs
c
Cs�tsttd�sdStjdkr dSzjt�d�}|jdd�}t|�dkrHt�|d	}t	t
t|d�d
���}tjdkr�|dkr�|d
kr�WdSWnttt
fk
r�YnXdS)a�Check if posix_spawn() can be used for subprocess.

    subprocess requires a posix_spawn() implementation that properly reports
    errors to the parent process, & sets errno on the following failures:

    * Process attribute actions failed.
    * File actions failed.
    * exec() failed.

    Prefer an implementation which can use vfork() in some cases for best
    performance.
    �posix_spawnF�darwinT�CS_GNU_LIBC_VERSIONrt)�maxsplitr�r�.ZlinuxZglibc)r��)r��hasattrr�rW�platform�confstr�splitr�r1�tupler�rK�AttributeError�OSError)Zver�partsZlibc�versionr'r'r(�_use_posix_spawn~s 



r�c@s�eZdZdZdZdKdddd�d	d
�Zedd��Zejd
d��Zdd�Z	dd�Z
dd�Zej
ejfdd�Zdd�Zdd�ZdLdd�Zdd�Zdd�ZdMd d!�ZdNd"d#�Zd$d%�Ze�rd&d'�Zd(d)�Zd*d+�Zd,d-�Zdejej ej!fd.d/�Z"d0d1�Z#d2d3�Z$d4d5�Z%d6d7�Z&d8d9�Z'e'Z(n�d:d'�Zd;d<�Z)d=d-�Ze*j+e*j,e*j-e*j.e*j/e*j0fd>d?�Z1de*j2e*j3e4j5fd@d/�Z"dAdB�Z6dCd1�Z#dDd5�Z%dEdF�Z7dGd7�Z&dHd9�Z'dIdJ�Z(dS)Ora� Execute a child program in a new process.

    For a complete description of the arguments see the Python documentation.

    Arguments:
      args: A string, or a sequence of program arguments.

      bufsize: supplied as the buffering argument to the open() function when
          creating the stdin/stdout/stderr pipe file objects

      executable: A replacement program to execute.

      stdin, stdout and stderr: These specify the executed programs' standard
          input, standard output and standard error file handles, respectively.

      preexec_fn: (POSIX only) An object to be called in the child process
          just before the child is executed.

      close_fds: Controls closing or inheriting of file descriptors.

      shell: If true, the command will be executed through the shell.

      cwd: Sets the current directory before the child is executed.

      env: Defines the environment variables for the new process.

      text: If true, decode stdin, stdout and stderr using the given encoding
          (if set) or the system default otherwise.

      universal_newlines: Alias of text, provided for backwards compatibility.

      startupinfo and creationflags (Windows only)

      restore_signals (POSIX only)

      start_new_session (POSIX only)

      pass_fds (POSIX only)

      encoding and errors: Text mode encoding and error handling to use for
          file objects stdin, stdout and stderr.

    Attributes:
        stdin, stdout, stderr, pid, returncode
    Fr\NTrr')�encoding�errorsr�cCslt�t��|_d|_d|_|dkr(d}t|t�s:td��t	rP|dk	r�t
d��n8|rh|sht�dt
�d}|
dk	rxt
d��|d	kr�t
d
��||_d|_d|_d|_d|_d|_||_||_|dk	r�|dk	r�t|�t|�kr�td��|�|||�\}}}}}}t	�rN|dk�rt�|��d	�}|dk�r4t�|��d	�}|dk�rNt�|��d	�}|�pb|�pb|�pb||_d|_d|_|j�r�|d
k�r�d}d}nd}z�|dk�r�t� |d|�|_|j�r�tj!|jd|||d�|_|dk�rt� |d|�|_|j�rtj!|j||d�|_|dk�r:t� |d|�|_|j�r:tj!|j||d�|_|�"||||||
||
||	||||||||�Wn�t#d|j|j|jf�D]*}z|�$�Wnt%k
�r�YnX�q�|j�s`g}|t&k�r�|�'|�|t&k�r�|�'|�|t&k�r�|�'|�t(|d��r|�'|j)�|D]H}z*t	�r8t|t*��r8|�+�n
t,�$|�Wnt%k
�rZYnX�q�YnXdS)zCreate new Popen instance.NFr\zbufsize must be an integerz0preexec_fn is not supported on Windows platformszpass_fds overriding close_fds.Tz2startupinfo is only supported on Windows platformsrz4creationflags is only supported on Windows platformszlCannot disambiguate when both text and universal_newlines are supplied but different. Pass one or the other.g�?rt�wb)�
write_through�line_bufferingr�r��rb)r�r��_devnull)-rR�	threadingZLock�
_waitpid_lock�_input�_communication_started�
isinstancerK�	TypeErrorr�r1�warnings�warn�RuntimeWarningrdr�r5r-�pidr*r�r��boolr�_get_handles�msvcrtZopen_osfhandlerL�	text_mode�_sigint_wait_secs�_closed_child_pipe_fds�io�open�
TextIOWrapper�_execute_child�filter�closer�rrcr�r�rGrJr�)r.rd�bufsize�
executabler�r5r-�
preexec_fn�	close_fdsr��cwd�envr��startupinfo�
creationflags�restore_signals�start_new_session�pass_fdsr�r�r��p2cread�p2cwrite�c2pread�c2pwrite�errread�errwriter��fZto_close�fdr'r'r(r/�s�


��





�
�
��








zPopen.__init__cCs|jSr))r�r2r'r'r(r�~szPopen.universal_newlinescCst|�|_dSr))r�r�)r.r�r'r'r(r��scCs |�||�}|�dd��dd�S)Nz
r��
)�decode�replace)r.r�r�r�r'r'r(�_translate_newlines�szPopen._translate_newlinescCs|Sr)r'r2r'r'r(�	__enter__�szPopen.__enter__cCs�|jr|j��|jr |j��dz|jr4|j��W5|tkr�|jdkrrz|j|jd�Wntk
rpYnXd|_�dS|��XdS)Nrr�)	r5r�r-�KeyboardInterruptr��_waitrr�r�)r.�exc_typer7�	tracebackr'r'r(�__exit__�s 


zPopen.__exit__cCsT|js
dS|jdkr(|d|jt|d�|j|d�|jdkrPtdk	rPt�|�dS)Nzsubprocess %s is still running)�sourcerS)�_child_createdr*r��ResourceWarningrVrUrc)r.Z_maxsizeZ_warnr'r'r(rP�s

�z
Popen.__del__cCs"t|d�st�tjtj�|_|jS)Nr�)r�r�r��devnull�O_RDWRr�r2r'r'r(�_get_devnull�s
zPopen._get_devnullc
Cs�|rZz|j�|�WnDtk
r(Yn2tk
rX}z|jtjkrFn�W5d}~XYnXz|j��WnDtk
r|Yn2tk
r�}z|jtjkr�n�W5d}~XYnXdSr))r��write�BrokenPipeErrorr��errnoZEINVALr�)r.r�r�r'r'r(�_stdin_write�s"zPopen._stdin_writecCsT|jr|rtd��|dkr�|js�|j|j|jg�d�dkr�d}d}|jrT|�|�n6|jrp|j��}|j��n|jr�|j��}|j��|�	�n�|dk	r�t
�|}nd}z�z|�|||�\}}Wnhtk
�r,|dk	r�t
|j|�|��}n|j}d|_z|j|d�Wntk
�r$YnX�YnXW5d|_X|j	|�|�d�}||fS)a9Interact with process: Send data to stdin and close it.
        Read data from stdout and stderr, until end-of-file is
        reached.  Wait for process to terminate.

        The optional "input" argument should be data to be sent to the
        child process, or None, if no data should be sent to the child.
        communicate() returns a tuple (stdout, stderr).

        By default, all communication is in bytes, and therefore any
        "input" should be bytes, and the (stdout, stderr) will be bytes.
        If in text mode (indicated by self.text_mode), any "input" should
        be a string, and (stdout, stderr) will be strings decoded
        according to locale encoding, or by "encoding" if set. Text mode
        is triggered by setting any of text, encoding, errors or
        universal_newlines.
        z.Cannot send input after starting communicationNr�Trr�)r�r1r�r5r-�countr�readr�r��_time�_communicater��minr��_remaining_timer�r)r.r�r<r5r-�endtime�sigint_timeout�stsr'r'r(r��sH
�



�zPopen.communicatecCs|��S)zSCheck if child process has terminated. Set and return returncode
        attribute.)rVr2r'r'r(r�sz
Popen.pollcCs|dkrdS|t�SdS)z5Convenience for _communicate when computing timeouts.N)r)r.r	r'r'r(r"szPopen._remaining_timecCsL|dkrdS|st�|krHt|j||r0d�|�nd|r@d�|�ndd��dS)z2Convenience for checking if a timeout has expired.Nr�r�)rrrdr�)r.r	�orig_timeoutZ
stdout_seqZ
stderr_seq�skip_check_and_raiser'r'r(�_check_timeout*s�zPopen._check_timeoutcCs�|dk	rt�|}z|j|d�WStk
r�|dk	rLt|j|�|��}n|j}d|_z|j|d�Wntk
r|YnX�YnXdS)z=Wait for child process to terminate; returns self.returncode.Nr�r)rr�r�rr�rr)r.r<r	r
r'r'r(r�6s 
�z
Popen.waitc		Cs�t|dd�}t����}trX|dkr.|�|j�|dkrB|�|j�|dkr�|�|j�nr|dkr~|dkr~||kr~|�tj|�|dkr�|dkr�||kr�|�tj|�|dkr�|dkr�||kr�|�tj|�|dk	r�|�tj|�W5QRXd|_dS)Nr�r\T)	rz�
contextlib�	ExitStackr��callbackrJr�r�r�)	r.r�r�r�r�r�r�Z
devnull_fd�stackr'r'r(�_close_pipe_fdsMs$
zPopen._close_pipe_fdscCs~|dkr|dkr|dkrdSd\}}d\}}d\}}	|dkrtt�tj�}|dkr�t�dd�\}}
t|�}t�|
�nh|tkr�t�dd�\}}t|�t|�}}n<|tkr�t�	|�
��}n$t|t�r�t�	|�}nt�	|�
��}|�|�}|dk�r*t�tj�}|dk�r�t�dd�\}
}t|�}t�|
�nn|tk�rXt�dd�\}}t|�t|�}}n@|tk�rrt�	|�
��}n&t|t��r�t�	|�}nt�	|�
��}|�|�}|dk�r�t�tj�}	|	dk�rdt�dd�\}
}	t|	�}	t�|
�n~|tk�rt�dd�\}}	t|�t|	�}}	nP|tk�r$|}	n@|tk�r>t�	|�
��}	n&t|t��rVt�	|�}	nt�	|�
��}	|�|	�}	||||||	fS)�|Construct and return tuple with IO objects:
            p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite
            N)r\r\r\r\r\r\�r\r\r)rOZGetStdHandlerZ
CreatePiperGrIrr
r�Z
get_osfhandler�r�rK�fileno�_make_inheritablerrr)r.r�r5r-r�r�r�r�r�r��_r'r'r(r�nst












�zPopen._get_handlescCs&t�t��|t��ddtj�}t|�S)z2Return a duplicate of handle, which is inheritablerrt)rOZDuplicateHandleZGetCurrentProcessZDUPLICATE_SAME_ACCESSrG)r.�handle�hr'r'r(r�s�zPopen._make_inheritablecCstdd�|D��S)z�Filter out console handles that can't be used
            in lpAttributeList["handle_list"] and make sure the list
            isn't empty. This also removes duplicate handles.cSs,h|]$}|d@dks$t�|�tjkr|�qS)�)rOZGetFileTypeZFILE_TYPE_CHAR)�.0rr'r'r(�	<setcomp>�s��z,Popen._filter_handle_list.<locals>.<setcomp>)rF)r.rDr'r'r(�_filter_handle_list�szPopen._filter_handle_listcCs�|rtd��t|t�rnNt|t�r:|
r.td��t|g�}n,t|tj�r^|
rRtd��t|g�}nt|�}|dk	rxt�|�}|dkr�t	�}n|�
�}d|||fk}|r�|jtj
O_||_||_||_|j}t|o�d|ko�|d�}|s�|�rl|�rl|dk�ri}|_t|�dg��}|d<|�r>|t|�t|�t|�g7}|�|�|dd�<|�rl|�sht�dt�d}|
�r�|jtjO_tj|_|�s�tj�d	�}|�s�tj�d
d�}tj�|dd
�}tj� |��s�t!d��tj� |��r�|}n|}d�"||�}|dk	�rt�|�}t#�$d||||�z,t�&||ddt|�|	|||�	\}}}}W5|�%|||
|||�Xd|_'t(|�|_)||_*t�+|�dS)z$Execute program (MS Windows version)z"pass_fds not supported on Windows.z$bytes args is not allowed on Windows�0path-like args is not allowed when shell is trueNr\rDz?startupinfo.lpAttributeList['handle_list'] overriding close_fdsFZComSpecZ
SystemRootr�ZSystem32zcmd.exez:shell not found: neither %ComSpec% nor %SystemRoot% is setz
{} /c "{}"�subprocess.PopenT),�AssertionErrorr��str�bytesr�r�r��PathLiker�r#rEr>rOrr?r@rArCr�rFr�rKrr�r�r�rrrB�environ�pathr��isabs�FileNotFoundErrorr�rW�auditrZ
CreateProcessr�rG�_handler�rI)r.rdr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�Zunused_restore_signalsZunused_start_new_sessionZuse_std_handlesZattribute_listZhave_handle_listrDZcomspecZsystem_rootZhpZhtr��tidr'r'r(r��s�	


��

�
�

��
zPopen._execute_childcCs,|jdkr&||jd�|kr&||j�|_|jS)z�Check if child process has terminated.  Returns returncode
            attribute.

            This method is called by __del__, so it can only refer to objects
            in its local scope.

            Nr)r*r*)r.rTZ_WaitForSingleObjectZ_WAIT_OBJECT_0Z_GetExitCodeProcessr'r'r(rVHs
zPopen._internal_pollcCs^|dkrtj}nt|d�}|jdkrXt�|j|�}|tjkrJt|j|��t�	|j�|_|jS)z-Internal implementation of wait() on Windows.Ni�)
rOZINFINITErKr*�WaitForSingleObjectr*ZWAIT_TIMEOUTrrd�GetExitCodeProcess)r.r<Ztimeout_millisr�r'r'r(r�Ys
�
zPopen._waitcCs|�|���|��dSr))rcrr�)r.Zfh�bufferr'r'r(�
_readerthreadiszPopen._readerthreadcCs\|jrBt|d�sBg|_tj|j|j|jfd�|_d|j_|j��|j	r�t|d�s�g|_
tj|j|j	|j
fd�|_d|j_|j��|jr�|�
|�|jdk	r�|j�|�|��|j��r�t|j|��|j	dk	r�|j�|�|��|j��r�t|j|��d}d}|j�r|j}|j��|j	�r0|j
}|j	��|�r>|dnd}|�rP|dnd}||fS)N�_stdout_buff)�targetrdT�_stderr_buffr)r5r�r0r�ZThreadr/Z
stdout_threadZdaemon�startr-r2Z
stderr_threadr�rr�rZis_aliverrdr�)r.r�r	rr5r-r'r'r(rnsJ
��

��







zPopen._communicatecCsl|jdk	rdS|tjkr"|��nF|tjkr>t�|jtj�n*|tjkrZt�|jtj�nt	d�
|���dS)�Send a signal to the process.NzUnsupported signal: {})r*r0�SIGTERM�	terminateZCTRL_C_EVENTr�r�r�ZCTRL_BREAK_EVENTr1r��r.Zsigr'r'r(�send_signal�s




zPopen.send_signalcCsX|jdk	rdSzt�|jd�Wn2tk
rRt�|j�}|tjkrH�||_YnXdS)zTerminates the process.Nrt)r*rOZTerminateProcessr*�PermissionErrorr-ZSTILL_ACTIVE)r.Zrcr'r'r(r6�s

zPopen.terminatec
Cs,d\}}d\}}d\}}	|dkr"n@|tkr8t��\}}n*|tkrJ|��}nt|t�rZ|}n|��}|dkrln@|tkr�t��\}}n*|tkr�|��}nt|t�r�|}n|��}|dkr�nf|tkr�t��\}}	nP|tkr�|dkr�|}	n
t	j
��}	n.|tk�r|��}	nt|t��r|}	n|��}	||||||	fS)rrNr\)rr��piper
r�r�rKrrrW�
__stdout__)
r.r�r5r-r�r�r�r�r�r�r'r'r(r��sP





�cCs�|dkrtj}i}|rJg}dD]"}
tt|
d�}|dk	r|�|�q||d<g}|||	fD]}|dkrX|�tj|f�qX|df|df|
dffD]"\}}|dkr�|�tj||f�q�|r�||d<tj|||f|�|_d	|_	|�
|||||	|
�dS)
z'Execute program using os.posix_spawn().N)�SIGPIPEZSIGXFZ�SIGXFSZZ	setsigdefr\rrtr��file_actionsT)r�r%rzr0rc�POSIX_SPAWN_CLOSE�POSIX_SPAWN_DUP2r�r�r�r)r.rdr�r�r�r�r�r�r�r�r�r�ZsigsetZsignameZsignumr>r�Zfd2r'r'r(�_posix_spawn�s<��zPopen._posix_spawnc)s�t|ttf�r|g}n(t|tj�r6|
r.td��|g}nt|�}|
rlttd�rPdnd}|dg|}�rl�|d<�dkr||d�t�	d�|||�t
�rtj����r|dk�r|�s|�s|dk�r|d	ks�|d
k�r|d	ks�|d
k�r|d	ks�|d
k�r|�s|�
|�|||||
|||�
dS�}t��\}}g}|dk�rT|�|�t�|�}�q2|D]}t�|��qX�zJz�|dk	�r�g}|��D]>\}}t�|�}d|k�r�td
��|�|dt�|���q�nd}t����tj����r�f}nt�fdd�t�|�D��}t|�}|�|�t�|||tttt|���|||||
||||||||�|_d|_W5t�|�X|� |||
|||�t!�}t�"|d�}||7}|�r�t#|�dk�r��q��q�W5t�|�X|�r�z6t�$|jd�\} }!| |jk�r�|�%|!�ntj&|_'Wnt(k
�rYnXz|�)dd
�\}"}#}$|$�*�}$Wn,tk
�rbd}"d}#d�+t|��}$YnXt,t-|"�*d�t.�}%t/|%t0��r�|#�r�t|#d�}&|$dk}'|'�r�d}$|}(n|}(|&dk�r�t�1|&�}$|%|&|$|(��|%|$��dS)zExecute program (POSIX version)rZgetandroidapilevelz/system/bin/shz/bin/shz-crNr r\r�r�=z!illegal environment variable namec3s"|]}tj�t�|���VqdSr))r�r&r��fsencode)r�dir�r�r'r(�	<genexpr>rs�z'Popen._execute_child.<locals>.<genexpr>TiP��:sSubprocessError�0z#Bad exception data from child: {!r}�ascii�Znoexecr�)2r�r"r#r�r$r�rFr�rWr)�_USE_POSIX_SPAWNr&�dirnamerAr:rc�dupr�ryrCr1r��
get_exec_path�set�add�_posixsubprocessZ	fork_exec�sortedr�rKr�r�r�	bytearrayrr��waitpid�_handle_exitstatusrXr*�ChildProcessErrorr�r�r�rz�builtinsr�
issubclassr��strerror))r.rdr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�Z
unix_shellZorig_executableZerrpipe_readZ
errpipe_writeZlow_fds_to_closeZlow_fdZenv_list�kriZexecutable_listZfds_to_keepZerrpipe_data�partr�rZexception_nameZ	hex_errno�err_msgZchild_exception_typeZ	errno_numZchild_exec_never_calledZerr_filenamer'rEr(r� s"	��
�����������	�
�





�
�
�
��
�


cCsL||�r||�|_n2||�r*||�|_n||�r@||�|_ntd��dS)�:All callers to this function MUST hold self._waitpid_lock.zUnknown child exit status!N)r*r)r.rZ_WIFSIGNALEDZ	_WTERMSIGZ
_WIFEXITEDZ_WEXITSTATUSZ_WIFSTOPPEDZ	_WSTOPSIGr'r'r(rU�szPopen._handle_exitstatusc
Cs�|jdkr�|j�d�sdSz�z>|jdk	r4|jWW�pS||j|�\}}||jkrX|�|�WnBtk
r�}z$|dk	r|||_n|j|kr�d|_W5d}~XYnXW5|j��X|jS)z�Check if child process has terminated.  Returns returncode
            attribute.

            This method is called by __del__, so it cannot reference anything
            outside of the local scope (nor can any methods it calls).

            NFr)r*r��acquire�releaser�rUr�r)r.rTZ_waitpidZ_WNOHANGZ_ECHILDr�r�er'r'r(rV�s 	



cCs>zt�|j|�\}}Wntk
r4|j}d}YnX||fS)r]r)r�rTr�rV)r.Z
wait_flagsr�rr'r'r(�	_try_wait�s
zPopen._try_waitc	Cs2|jdk	r|jS|dk	r�t�|}d}|j�d�r�zT|jdk	rDW�Fq�|�tj�\}}||jksj|dksjt	�||jkr�|�
|�W�q�W5|j��X|�|�}|dkr�t|j
|��t|d|d�}t�|�q&n\|jdk�r,|j�B|jdk	r�W5QR��q,|�d�\}}||jk�r |�
|�W5QRXq�|jS)z+Internal implementation of wait() on POSIX.Ng����Mb@?Frr�g�������?)r*rr�r^r_rar��WNOHANGr�r!rUrrrdr�time�sleep)r.r<r	Zdelayr�rZ	remainingr'r'r(r��s8







c
Cs"|jrX|jsXz|j��Wntk
r.YnX|sXz|j��Wntk
rVYnXd}d}|js�i|_|jr~g|j|j<|jr�g|j|j<|jr�|j|j}|jr�|j|j}|�|�|j	r�t
|j	�}t����}|jr�|r�|�|jt
j�|j�r|jj�s|�|jt
j�|j�r6|jj�s6|�|jt
j�|���r�|�|�}|dk	�rz|dk�rz|j||||dd�td��|�|�}	|�||||�|	D]�\}
}|
j|jk�r6||j|jt�}z|jt�|
j|�7_Wn,tk
�r
|�|
j�|
j��Yn*X|jt|j	�k�r�|�|
j�|
j��nP|
j|j|jfk�r�t�|
jd�}
|
�st|�|
j�|
j��|j|
j�|
��q��q6W5QRX|j |�|�d�|dk	�r�d�!|�}|dk	�r�d�!|�}|j"�r|dk	�r�|�#||jj$|jj%�}|dk	�r|�#||jj$|jj%�}||fS)NrT)r
zN_check_timeout(..., skip_check_and_raise=True) failed to raise TimeoutExpired.i�r�r�)&r�r��flushrr�Z_fileobj2outputr5r-�_save_inputr��
memoryview�_PopenSelector�register�	selectorsZEVENT_WRITErHZ
EVENT_READZget_maprr�RuntimeError�selectZfileobj�
_input_offset�	_PIPE_BUFr�r�r�Z
unregisterr�rrcr�r�r�r�r�r�)r.r�r	rr5r-Z
input_viewZselectorr<Zready�keyZevents�chunkr�r'r'r(r's�





��
�
$




�
�cCsF|jrB|jdkrBd|_||_|dk	rB|jrB|j�|jj|jj�|_dS)Nr)r�r�rmr��encoder�r�)r.r�r'r'r(rf�s�zPopen._save_inputcCs|jdkrt�|j|�dS)r4N)r*r�r�r�r7r'r'r(r8�s
cCs|�tj�dS)z/Terminate the process with SIGTERM
            N)r8r0r5r2r'r'r(r6�scCs|�tj�dS)z*Kill the process with SIGKILL
            N)r8r0�SIGKILLr2r'r'r(r��sz
Popen.kill)r\NNNNNTFNNNNrTFr')NN)F)N)8r$r%r&r9r�r/r:r�r;r�r�r�rWrXr�r�rPr�rr�r�rrr�rr�r�rrr�rOr,Z
WAIT_OBJECT_0r-rVr�r/rr8r6r�rAr��WIFSIGNALED�WTERMSIG�	WIFEXITED�WEXITSTATUS�
WIFSTOPPED�WSTOPSIGrUrTrbrZECHILDrarfr'r'r'r(r�s�-��


D	�

H	
|�
26'�
�
#
)f)Hr9rWrr�r�rcr0rWr�r�rrr�__all__r�rOr��ModuleNotFoundErrorrQrlrjrrrrrrrrrrrrrrrr r!r"r�	Exceptionrrrr#rKrGrzrnr�rQrhZSelectSelectorrUrRrrr
rer�rrr
�objectrrr�rr	r�rKrr'r'r'r(�<module>
s�"�P
�
%	


;3"�EI
/__pycache__/sunau.cpython-38.pyc000064400000041272151153537550012557 0ustar00U

e5d�G�@s�dZddlmZddlZedd�ZdZdZdZd	Zd
Z	dZ
dZd
ZdZ
dZdZdZdZdZeeee	e
egZGdd�de�Zdd�Zdd�ZGdd�d�ZGdd�d�Zd"dd�Zd#d d!�ZdS)$a�Stuff to parse Sun and NeXT audio files.

An audio file consists of a header followed by the data.  The structure
of the header is as follows.

        +---------------+
        | magic word    |
        +---------------+
        | header size   |
        +---------------+
        | data size     |
        +---------------+
        | encoding      |
        +---------------+
        | sample rate   |
        +---------------+
        | # of channels |
        +---------------+
        | info          |
        |               |
        +---------------+

The magic word consists of the 4 characters '.snd'.  Apart from the
info field, all header fields are 4 bytes in size.  They are all
32-bit unsigned integers encoded in big-endian byte order.

The header size really gives the start of the data.
The data size is the physical size of the data.  From the other
parameters the number of frames can be calculated.
The encoding gives the way in which audio samples are encoded.
Possible values are listed below.
The info field currently consists of an ASCII string giving a
human-readable description of the audio file.  The info field is
padded with NUL bytes to the header size.

Usage.

Reading audio files:
        f = sunau.open(file, 'r')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods read(), seek(), and close().
When the setpos() and rewind() methods are not used, the seek()
method is not  necessary.

This returns an instance of a class with the following public methods:
        getnchannels()  -- returns number of audio channels (1 for
                           mono, 2 for stereo)
        getsampwidth()  -- returns sample width in bytes
        getframerate()  -- returns sampling frequency
        getnframes()    -- returns number of audio frames
        getcomptype()   -- returns compression type ('NONE' or 'ULAW')
        getcompname()   -- returns human-readable version of
                           compression type ('not compressed' matches 'NONE')
        getparams()     -- returns a namedtuple consisting of all of the
                           above in the above order
        getmarkers()    -- returns None (for compatibility with the
                           aifc module)
        getmark(id)     -- raises an error since the mark does not
                           exist (for compatibility with the aifc module)
        readframes(n)   -- returns at most n frames of audio
        rewind()        -- rewind to the beginning of the audio stream
        setpos(pos)     -- seek to the specified position
        tell()          -- return the current position
        close()         -- close the instance (make it unusable)
The position returned by tell() and the position given to setpos()
are compatible and have nothing to do with the actual position in the
file.
The close() method is called automatically when the class instance
is destroyed.

Writing audio files:
        f = sunau.open(file, 'w')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods write(), tell(), seek(), and
close().

This returns an instance of a class with the following public methods:
        setnchannels(n) -- set the number of channels
        setsampwidth(n) -- set the sample width
        setframerate(n) -- set the frame rate
        setnframes(n)   -- set the number of frames
        setcomptype(type, name)
                        -- set the compression type and the
                           human-readable compression type
        setparams(tuple)-- set all parameters at once
        tell()          -- return current position in output file
        writeframesraw(data)
                        -- write audio frames without pathing up the
                           file header
        writeframes(data)
                        -- write audio frames and patch up the file header
        close()         -- patch up the file header and close the
                           output file
You should set the parameters before the first writeframesraw or
writeframes.  The total number of frames does not need to be set,
but when it is set to the correct value, the header does not have to
be patched up.
It is best to first set all parameters, perhaps possibly the
compression type, and then write audio frames using writeframesraw.
When all frames have been written, either call writeframes(b'') or
close() to patch up the sizes in the header.
The close() method is called automatically when the class instance
is destroyed.
�)�
namedtupleN�
_sunau_paramsz7nchannels sampwidth framerate nframes comptype compnameidns.������������l��c@seZdZdS)�ErrorN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/sunau.pyr�srcCs8d}td�D]&}|�d�}|s"t�|dt|�}q|S)Nrrr�)�range�read�EOFError�ord)�file�x�iZbyterrr�	_read_u32�s
rcCsFg}td�D]&}t|d�\}}|�dt|��|}q|�t|��dS)Nrrr)r�divmod�insert�int�write�bytes)rr�datar�d�mrrr�
_write_u32�sr'c@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)S)*�Au_readcCs@t|�td�kr,ddl}|�|d�}d|_nd|_|�|�dS)N�r�rbTF��type�builtins�open�_opened�initfp��self�fr-rrr�__init__�szAu_read.__init__cCs|jr|��dS�N��_file�close�r2rrr�__del__�szAu_read.__del__cCs|Sr5rr9rrr�	__enter__�szAu_read.__enter__cGs|��dSr5�r8�r2�argsrrr�__exit__�szAu_read.__exit__c	Cs�||_d|_tt|��}|tkr(td��tt|��|_|jdkrHtd��|jdkrZtd��t|�|_|jtkrzt|j�|_tt|��|_	|j	t
kr�td��|j	ttfkr�d|_
d	|_nj|j	tkr�d	|_|_
nR|j	tkr�d|_|_
n:|j	tkr�d
|_|_
n"|j	tk�rd|_|_
ntd��tt|��|_tt|��|_|j�sLtd
��|j|j|_|jdk�r�|�|jd�|_|j�d�\|_}}nd|_z|��|_Wn ttfk
�r�d|_YnXdS)Nrzbad magic numberrzheader size too small�dzheader size ridiculously largezencoding not (yet) supportedrrrrzunknown encodingzbad # of channels��)r7�	_soundposr!r�AUDIO_FILE_MAGICrZ	_hdr_size�
_data_size�AUDIO_UNKNOWN_SIZE�	_encoding�_simple_encodings�AUDIO_FILE_ENCODING_MULAW_8�AUDIO_FILE_ENCODING_ALAW_8�
_sampwidth�
_framesize�AUDIO_FILE_ENCODING_LINEAR_8�AUDIO_FILE_ENCODING_LINEAR_16�AUDIO_FILE_ENCODING_LINEAR_24�AUDIO_FILE_ENCODING_LINEAR_32�
_framerate�
_nchannelsr�_info�	partition�tell�	_data_pos�AttributeError�OSError)r2r�magic�_rrrr0�sV




�


zAu_read.initfpcCs|jSr5)r7r9rrr�getfp�sz
Au_read.getfpcCs|jSr5)rRr9rrr�getnchannels�szAu_read.getnchannelscCs|jSr5)rKr9rrr�getsampwidth�szAu_read.getsampwidthcCs|jSr5)rQr9rrr�getframerate�szAu_read.getframeratecCs(|jtkrtS|jtkr$|j|jSdS�Nr)rErFrGrHrLr9rrr�
getnframes�s


zAu_read.getnframescCs$|jtkrdS|jtkrdSdSdS)N�ULAW�ALAW�NONE�rGrIrJr9rrr�getcomptype�s


zAu_read.getcomptypecCs$|jtkrdS|jtkrdSdSdS)N�CCITT G.711 u-law�CCITT G.711 A-law�not compressedrdr9rrr�getcompname�s


zAu_read.getcompnamecCs*t|��|��|��|��|��|���Sr5�rr\r]r^r`rerir9rrr�	getparamss�zAu_read.getparamscCsdSr5rr9rrr�
getmarkersszAu_read.getmarkerscCstd��dS)Nzno marks)r)r2�idrrr�getmarkszAu_read.getmarkcCsp|jtkrl|tkr|j��}n|j�||j�}|jt|�|j7_|jtkrhddl	}|�
||j�}|SdSr_)rGrHrFr7rrLrC�lenrI�audioopZulaw2linrK)r2�nframesr$rprrr�
readframess

zAu_read.readframescCs*|jdkrtd��|j�|j�d|_dS)N�cannot seekr)rVrXr7�seekrCr9rrr�rewinds
zAu_read.rewindcCs|jSr5)rCr9rrrrU!szAu_read.tellcCsP|dks||��krtd��|jdkr.td��|j�|j||j�||_dS)Nrzposition not in rangers)r`rrVrXr7rtrLrC)r2�posrrr�setpos$s
zAu_read.setposcCs"|j}|rd|_|jr|��dSr5)r7r/r8�r2rrrrr8,s
z
Au_read.closeN)rrrr4r:r;r?r0r[r\r]r^r`rerirkrlrnrrrurUrwr8rrrrr(�s(	.
r(c@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3S)4�Au_writecCs@t|�td�kr,ddl}|�|d�}d|_nd|_|�|�dS)Nr)r�wbTFr+r1rrrr45szAu_write.__init__cCs|jr|��d|_dSr5r6r9rrrr:>szAu_write.__del__cCs|Sr5rr9rrrr;CszAu_write.__enter__cGs|��dSr5r<r=rrrr?FszAu_write.__exit__cCsF||_d|_d|_d|_d|_t|_d|_d|_d|_	d|_
d|_dS)NrrBra)r7rQrRrKrLrF�_nframes�_nframeswritten�_datawritten�_datalengthrS�	_comptyperxrrrr0IszAu_write.initfpcCs(|jrtd��|dkrtd��||_dS)N�0cannot change parameters after starting to write)rrrz"only 1, 2, or 4 channels supported)r|rrR)r2�	nchannelsrrr�setnchannelsVs
zAu_write.setnchannelscCs|jstd��|jS)Nznumber of channels not set)rRrr9rrrr\]szAu_write.getnchannelscCs(|jrtd��|dkrtd��||_dS)Nr�)rrrrzbad sample width)r|rrK)r2�	sampwidthrrr�setsampwidthbs
zAu_write.setsampwidthcCs|jstd��|jS)N�sample width not specified)rQrrKr9rrrr]iszAu_write.getsampwidthcCs|jrtd��||_dS)Nr�)r|rrQ)r2�	frameraterrr�setframeratenszAu_write.setframeratecCs|jstd��|jS)Nzframe rate not set)rQrr9rrrr^sszAu_write.getframeratecCs(|jrtd��|dkrtd��||_dS)Nr�rz# of frames cannot be negative)r|rr{)r2rqrrr�
setnframesxs
zAu_write.setnframescCs|jSr5�r|r9rrrr`szAu_write.getnframescCs|dkr||_ntd��dS)N)rcrazunknown compression type)rr)r2r,�namerrr�setcomptype�szAu_write.setcomptypecCs|jSr5�rr9rrrre�szAu_write.getcomptypecCs$|jdkrdS|jdkrdSdSdS)Nrarfrbrgrhr�r9rrrri�s


zAu_write.getcompnamecCsH|\}}}}}}|�|�|�|�|�|�|�|�|�||�dSr5)r�r�r�r�r�)r2Zparamsr�r�r�rqZcomptypeZcompnamerrr�	setparams�s



zAu_write.setparamscCs*t|��|��|��|��|��|���Sr5rjr9rrrrk�s�zAu_write.getparamscCs|jSr5r�r9rrrrU�sz
Au_write.tellcCs~t|ttf�st|��d�}|��|jdkrDddl}|�||j	�}t
|�|j}|j�
|�|j||_|jt
|�|_dS)N�Brar)�
isinstancer#�	bytearray�
memoryview�cast�_ensure_header_writtenrrpZlin2ulawrKrorLr7r"r|r})r2r$rprqrrr�writeframesraw�s
zAu_write.writeframesrawcCs.|�|�|j|jks"|j|jkr*|��dSr5)r�r|r{r~r}�_patchheader)r2r$rrr�writeframes�s


�zAu_write.writeframescCs^|jrZz6|��|j|jks(|j|jkr0|��|j�	�W5|j}d|_|jrX|��XdSr5)
r7r/r8r�r|r{r~r}r��flushrxrrrr8�s
�zAu_write.closecCs<|js8|jstd��|js"td��|js0td��|��dS)Nz# of channels not specifiedr�zframe rate not specified)r|rRrrKrQ�
_write_headerr9rrrr��szAu_write._ensure_header_writtenc	Cs�|jdkrl|jdkr t}d|_q�|jdkr6t}d|_q�|jdkrLt}d|_q�|jdkrbt}d|_q�td��n|jdkr�t}d|_ntd��|j|j	|_t
|jt�dt
|j�}|d	d
@}t
|j|�|jtkr�t}n|j|j}z|j��|_Wn ttfk
�rd|_YnXt
|j|�||_t
|j|�t
|j|j�t
|j|j	�|j�|j�|j�d|t
|j�d�dS)
Nrcrrrrzinternal errorrar
r
i����rAr)rrKrMrLrNrOrPrrIrRr'r7rDrorSr{rFrU�_form_length_posrWrXr~rQr")r2�encoding�header_sizeZlengthrrrr��sJ







zAu_write._write_headercCsH|jdkrtd��|j�|j�t|j|j�|j|_|j�dd�dS)Nrsrr)r�rXr7rtr'r}r~r9rrrr��s
zAu_write._patchheaderN)rrrr4r:r;r?r0r�r\r�r]r�r^r�r`r�rerir�rkrUr�r�r8r�r�r�rrrrry3s2	

*rycCsJ|dkrt|d�r|j}nd}|dkr.t|�S|dkr>t|�Std��dS)N�moder*)�rr*)�wrzz$mode must be 'r', 'rb', 'w', or 'wb')�hasattrr�r(ryr�r3r�rrrr.s
r.cCstjdtdd�t||d�S)NzDsunau.openfp is deprecated since Python 3.7. Use sunau.open instead.r)�
stacklevel)r�)�warnings�warn�DeprecationWarningr.r�rrr�openfps
�r�)N)N)�__doc__�collectionsrr�rrDrIrMrNrOrPZAUDIO_FILE_ENCODING_FLOATZAUDIO_FILE_ENCODING_DOUBLEZAUDIO_FILE_ENCODING_ADPCM_G721ZAUDIO_FILE_ENCODING_ADPCM_G722Z AUDIO_FILE_ENCODING_ADPCM_G723_3Z AUDIO_FILE_ENCODING_ADPCM_G723_5rJrFrH�	Exceptionrrr'r(ryr.r�rrrr�<module>sFi��	Q

__pycache__/cgitb.cpython-38.pyc000064400000023650151153537550012514 0ustar00U

e5d@/�@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
dd�ZgZdd�Z
dd�Zd	d
�Zdd�Zd
d�Zddd�Zddd�ZGdd�d�Ze�jZddd�ZdS)a�More comprehensive traceback formatting for Python scripts.

To enable this module, do:

    import cgitb; cgitb.enable()

at the top of your script.  The optional arguments to enable() are:

    display     - if true, tracebacks are displayed in the web browser
    logdir      - if set, tracebacks are written to files in this directory
    context     - number of lines of source code to show for each stack frame
    format      - 'text' or 'html' controls the output format

By default, tracebacks are displayed but not saved, the context is 5 lines
and the output format is 'html' (for backwards compatibility with the
original use of this module)

Alternatively, if you have caught an exception and want cgitb to display it
for you, call cgitb.handler().  The optional argument to handler() is a
3-item tuple (etype, evalue, etb) just like the value of sys.exc_info().
The default handler displays output as HTML.

�NcCsdS)zAReturn a string that resets the CGI and browser to a known state.a'<!--: spam
Content-Type: text/html

<body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> -->
<body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> --> -->
</font> </font> </font> </script> </object> </blockquote> </pre>
</table> </table> </table> </table> </table> </font> </font> </font>�rrr�/usr/lib64/python3.8/cgitb.py�reset#srcCs|rd|dSdSdS)Nz<small>z</small>�r��textrrr�small.srcCs|rd|dSdSdS)Nz<strong>z	</strong>rrrrrr�strong4sr	cCs|rd|dSdSdS)Nz<font color="#909090">z</font>rrrrrr�grey:sr
cCs�||krd||fS||jkr,d|j|fSd|jkr~|jd}t|�ti�krf||kr~d||fSnt||�r~dt||�fSdtfS)z9Find the value for a given name in the given environment.�local�global�__builtins__�builtinN)�	f_globals�type�hasattr�getattr�	__UNDEF__)�name�frame�locals�builtinsrrr�lookup@s



rcCs�gdddtf\}}}}}t�|�D]�\}}	}
}}|tjkr>q�|tjkr�|	tjkr�|dkr�|tk	r�t||	t�}|�||	||f�q�t	|	||�\}
}|�|	|
|f�n"|	dkr�||d7}|}nd\}}|	}q"|S)zEScan one logical line of Python and look up values of variables used.Nr�.)Nr)
r�tokenize�generate_tokens�NEWLINE�NAME�keyword�kwlistr�appendr)�readerrr�varsZ	lasttoken�parent�prefix�valueZttype�token�start�end�line�whererrr�scanvarsPs"
r+�c"s�|\}}}t|t�r|j}dtj��ddtj}t�t���}dt	j
�dtt	j
�
t|���dd|d|�d	}d
td�d}g}	t�||�}
|
D�]F\}�}}
}}�r�tj����d
�t	j
�
��f}nd�}t�|�\}}}}d}|
dk�r8dtt	j
�
|
��}|
dk�r8|tj||||dd�d�7}i�|gf��fdd�	}t|||�}dd||fg}|dk	�r
||}|D]�}tddtt|��t|��d}|�k�r�d|t	j
�|�f}|�d|�n&d|t	j
�|�f}|�dt|��|d 7}�q�ig}}|D]�\}}} ||k�r0�qd ||<| tk	�r�|d!k�r^d"|t|�}n*|d#k�rrt|�}n|t|�d$�d%�}|�d&|t	j
�| �f�n|�|d'��q|�dttd(�|����|	�d)d*�|��q�d+tt	j
�
t|���t	j
�
t|��fg}!t|�D]B}|dd �d,k�r4�qt	j
�t ||��} |!�d-||| f��q|d�|	�d�|!�d.t	j
�
d�t!�"|||���S)/z9Return a nice HTML document describing a given traceback.�Python r�: z<body bgcolor="#f0f0f8">z<big><big>%s</big></big>z#ffffffz#6622aaz<br>z�
<p>A problem occurred in a Python script.  Here is the sequence of
function calls leading up to the error, in the order they occurred.</p>z<tt>z&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;z&nbsp;</tt>z<a href="file://%s">%s</a>�?r�in �<module>cSsdtj�|�S�N�=)�pydoc�html�repr�r%rrr�<lambda>��zhtml.<locals>.<lambda>�Zformatvaluec
s8d�|d<zt��|d�W�S|dd7<XdS�N�r��	linecache�getline��lnum��fileZ	highlightrrr!�szhtml.<locals>.readerz+<tr><td bgcolor="#d8bbff">%s%s %s</td></tr>z<big>&nbsp;</big>Nz&nbsp;r,z<tt>=&gt;%s%s</tt>z&<tr><td bgcolor="#ffccee">%s</td></tr>z<tt>&nbsp;&nbsp;%s%s</tt>z<tr><td>%s</td></tr>r<)rrz<em>%s</em> rr���z%s&nbsp;= %sz <em>undefined</em>z, zF
<table width="100%%" cellspacing=0 cellpadding=0 border=0>
%s</table>�
z	<p>%s: %s�_z
<br>%s%s&nbsp;=
%sz�


<!-- The above is a description of an error in a Python program, formatted
     for a Web browser because the 'cgitb' module was enabled.  In case you
     are not reading this in a Web browser, here is the original traceback:

%s
-->
)#�
isinstancer�__name__�sys�version�split�
executable�time�ctimer4r5Zheadingr	�escape�strr�inspect�getinnerframes�os�path�abspath�getargvalues�formatargvaluesr+�lenZ	preformatr r
rr6�join�dirr�	traceback�format_exception)"�einfo�context�etype�evalue�etb�pyver�date�head�indent�frames�recordsrrA�func�lines�index�link�args�varargs�varkwr�callr!r"�rows�ir)�num�done�dumprr*r%�	exceptionrrBrr5es�

�
��

��
$






��	��r5c 	s�|\}}}t|t�r|j}dtj��ddtj}t�t���}dt	|�||fd}g}t
�||�}	|	D�]�\}
�}}}
}�r�tj
���p�d�t
�|
�\}}}}d}|dkr�d|}|d	kr�|t
j||||d
d�d�7}i�|gf��fd
d�	}t||
|�}d�|fg}|dk	�rP||}|
D](}d|}|�||���|d7}�q&ig}}|D]�\}}}||k�rv�q^d||<|tk	�r�|dk�r�d|}n|dk�r�||�d�d}|�d|tj�|�f�n|�|d��q^|�d�|��|�dd�|��qndt	|�t	|�fg}t|�D],}tj�t||��}|�dd||f��q*|d�|�d�|�dd�t�|||��S) z:Return a plain text document describing a given traceback.r-rr.z	%s
%s
%s
z�
A problem occurred in a Python script.  Here is the sequence of
function calls leading up to the error, in the order they occurred.
r/rr0r1cSsdtj�|�Sr2)r4rr6r7rrrr8�r9ztext.<locals>.<lambda>r:c
s8d�|d<zt��|d�W�S|dd7<XdSr;r=r@rBrrr!�sztext.<locals>.readerz %s %sNz%5d r<rzglobal rrrDz%s = %sz
 undefinedrEz
%s
z%s: %sz

%s%s = %sz    zc

The above is a description of an error in a Python program.  Here is
the original traceback:

%s
)rGrrHrIrJrKrLrMrNrPrQrRrSrTrUrVrWr+r �rstriprr4rr6rYrZrr[r\) r]r^r_r`rarbrcrdrfrgrrArhrirjrlrmrnrror!r"rprqr)rrrsrtrr*r%rurrBrr�sb

�






�rc@s,eZdZdZddd�Zdd	�Zd
d
d�ZdS)�Hookz?A hook to replace sys.excepthook that shows tracebacks in HTML.r<Nr,r5cCs(||_||_||_|ptj|_||_dS�N)�display�logdirr^rI�stdoutrC�format)�selfryrzr^rCr|rrr�__init__s
z
Hook.__init__cCs|�|||f�dSrx)�handle)r}r_r`rarrr�__call__
sz
Hook.__call__c
	Csz|p
t��}|jdkr$|j�t��|jdkr2tp4t}d}z|||j�}Wn d�	t
j|��}d}YnX|jr�|r�t
j�|�}|j�d|d�q�|j�|d�n|j�d�|jdk	�rZd	d
g|jdk}tj||jd�\}}z.t�|d��}|�|�W5QRXd
|}	Wnd|}	YnX|jdk�rJ|j�d|	�n|j�|	d�z|j��WnYnXdS)Nr5FrTz<pre>z</pre>
rEz*<p>A problem occurred in a Python script.
z.txtz.html)�suffixrZ�wz*%s contains the description of this error.z*Tried to save traceback to %s, but failed.z
<p>%s</p>
)rI�exc_infor|rC�writerr5rr^rYr[r\ryr4rOrz�tempfileZmkstemprS�fdopen�flush)
r}�infoZ	formatterZplain�docr��fdrTrC�msgrrrrs@

zHook.handle)r<Nr,Nr5)N)rH�
__module__�__qualname__�__doc__r~r�rrrrrrws�
rwr<cCst||||d�t_dS)aInstall an exception handler that formats tracebacks as HTML.

    The optional argument 'display' can be set to 0 to suppress sending the
    traceback to the browser, and 'logdir' can be set to a directory to cause
    tracebacks to be written to files there.�ryrzr^r|N)rwrI�
excepthookr�rrr�enable:s�r�)r,)r,)r<Nr,r5)r�rQrr>rSr4rIr�rMrr[rrrr	r
rr+r5rrwrZhandlerr�rrrr�<module>s,

[
B7__pycache__/modulefinder.cpython-38.opt-1.pyc000064400000037267151153537550015051 0ustar00U

e5dn_�@sdZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ejdZejdZ
ejdZejdZeefZejZdZdZdZd	Zd
ZdZdZiZd
d�ZiZdd�Zddd�ZGdd�d�ZGdd�d�Zdd�Z e!dk�rz
e �Z"Wne#k
�re$d�YnXdS)z3Find modules used by a script, using introspection.�N�
LOAD_CONST�IMPORT_NAME�
STORE_NAME�STORE_GLOBAL������cCst�|g��|�dS�N)�packagePathMap�
setdefault�append)Zpackagename�path�r�$/usr/lib64/python3.8/modulefinder.py�AddPackagePath(srcCs|t|<dSr)�replacePackageMap)Zoldname�newnamerrr�ReplacePackage3srcCstjj��tjj�||�}|dkr8tdj|d�|d��|jtjjkrVddddt	ffS|jtjj
krtddddtffS|j}|j�
|�r�dtj�|�ddtffSt|jtjj�r�t}n<t|jtjj�r�t}n&t|jtjj�r�t}nddddtffSt�|�}tj�|�d}|||d|ffS)zDAn importlib reimplementation of imp.find_module (for our purposes).NzNo module named {name!r})�name�����rb)�	importlib�	machinery�
PathFinder�invalidate_caches�	find_spec�ImportError�format�loader�BuiltinImporter�
_C_BUILTIN�FrozenImporter�
_PY_FROZEN�origin�
is_package�osr�dirname�_PKG_DIRECTORY�
isinstance�SourceFileLoader�
_PY_SOURCE�ExtensionFileLoader�_C_EXTENSION�SourcelessFileLoader�_PY_COMPILED�
_SEARCH_ERROR�io�	open_code�splitext)rr�specZ	file_pathZkind�file�suffixrrr�_find_module7s*
r:c@seZdZddd�Zdd�ZdS)�ModuleNcCs(||_||_||_d|_i|_i|_dSr)�__name__�__file__�__path__�__code__�globalnames�starimports)�selfrr8rrrr�__init__fszModule.__init__cCsLd|jf}|jdk	r&|d|jf}|jdk	r@|d|jf}|d}|S)Nz	Module(%rz, %r�))r<r=r>)rB�srrr�__repr__ss

zModule.__repr__)NN)r<�
__module__�__qualname__rCrFrrrrr;ds

r;c@s�eZdZd6dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zd7dd�Z	d8dd�Z
dd�Zdd�Zd9dd�Z
dd�Zdd�Zdd�Zd d!�Zd:d"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd;d,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�ZdS)<�ModuleFinderNrcCsZ|dkrtj}||_i|_i|_||_d|_|dk	r8|ng|_|dk	rJ|ng|_g|_dS)Nr)	�sysr�modules�
badmodules�debug�indent�excludes�
replace_paths�processed_paths)rBrrMrOrPrrrrC~szModuleFinder.__init__cGsV||jkrRt|j�D]}tddd�qt|dd�|D]}tt|�dd�q6t�dS)N�   � ��end)rM�rangerN�print�repr)rB�level�str�args�i�argrrr�msg�s
zModuleFinder.msgcGs,|d}||jkr(|jd|_|j|�dS�Nrr�rMrNr^�rBr[rYrrr�msgin�s
zModuleFinder.msgincGs,|d}||jkr(|jd|_|j|�dSr_r`rarrr�msgout�s
zModuleFinder.msgoutc	CsB|�dd|�t�|�� }ddtf}|�d|||�W5QRXdS)Nr�
run_scriptrr�__main__)r^r4r5r.�load_module)rB�pathname�fp�stuffrrrrd�s
zModuleFinder.run_scriptc	CsTtj�|�\}}tj�|�\}}t�|�� }|dtf}|�||||�W5QRXdS)Nr)r)r�splitr6r4r5r.rf)rBrg�dirrZextrhrirrr�	load_file�s

zModuleFinder.load_filerc	Cs\|�dd||||�|j||d�}|�||�\}}|�||�}|sF|S|jrX|�||�dS)Nr�import_hook�rY)r^�determine_parent�find_head_package�	load_tailr>�ensure_fromlist)	rBr�caller�fromlistrY�parent�q�tail�mrrrrm�szModuleFinder.import_hookcCs&|�dd||�|r|dkr,|�dd�dS|j}|dkr�|jrH|d8}|dkrl|j|}|�dd|�|S|�d�|kr�td��d�|�d�d|��}|j|}|�dd|�|S|jr�|j|}|�dd|�|Sd|k�r|�	d�}|d|�}|j|}|�dd|�|S|�dd�dS)	N�rorzdetermine_parent -> Nonerzdetermine_parent ->�.zrelative importpath too deep)
rbrcr<r>rK�countr �joinrj�rfind)rBrsrYZpnamerur\rrrro�s<





zModuleFinder.determine_parentcCs�|�dd||�d|kr@|�d�}|d|�}||dd�}n|}d}|r\d|j|f}n|}|�|||�}|r�|�dd||f�||fS|r�|}d}|�|||�}|r�|�dd||f�||fS|�dd|�td	|��dS)
Nryrprzrr�%s.%szfind_head_package ->�"raise ImportError: No module named�No module named )rb�findr<�
import_modulercr )rBrurr\�headrwZqnamervrrrrp�s.
zModuleFinder.find_head_packagecCs�|�dd||�|}|r�|�d�}|dkr2t|�}|d|�||dd�}}d|j|f}|�|||�}|s|�dd|�td|��q|�dd	|�|S)
Nryrqrzrrr~rr�zload_tail ->)rbr��lenr<r�rcr )rBrvrwrxr\r�Zmnamerrrrq�s
zModuleFinder.load_tailcCs�|�dd|||�|D]d}|dkrD|sz|�|�}|rz|�||d�qt||�sd|j|f}|�|||�}|std|��qdS)Nryrr�*rr~r�)r^�find_all_submodulesrr�hasattrr<r�r )rBrxrt�	recursive�sub�all�subnameZsubmodrrrrrs

zModuleFinder.ensure_fromlistc
	Cs�|js
dSi}g}|tjjdd�7}|tjjdd�7}|tjjdd�7}|jD]�}zt�|�}Wn&tk
r�|�	dd|�YqTYnX|D]R}d}|D]0}t
|�}	||	d�|kr�|d|	�}q�q�|r�|dkr�|||<q�qT|��S)Nrzcan't list directoryrC)r>rr�EXTENSION_SUFFIXES�SOURCE_SUFFIXES�BYTECODE_SUFFIXESr)�listdir�OSErrorr^r��keys)
rBrxrK�suffixesrk�namesr�modZsuff�nrrrr�s.

z ModuleFinder.find_all_submodulescCs
|�dd|||�z|j|}Wntk
r4YnX|�dd|�|S||jkrb|�dd�dS|r�|jdkr�|�dd�dSz|�||o�|j|�\}}}Wn$tk
r�|�ddd�YdSXz|�	||||�}W5|r�|��X|r�t
|||�|�dd|�|S)Nrr�zimport_module ->zimport_module -> None)rbrK�KeyErrorrcrLr>�find_moduler �closerf�setattr)rBZpartname�fqnamerurxrhrgrirrrr�.s:
�
zModuleFinder.import_modulec
Cs(|\}}}|�dd||od|�|tkrF|�||�}|�dd|�|S|tkr`t|��|d�}	n||tkr�z|��}
tj	�
|
|i�Wn:tk
r�}z|�ddt|�|��W5d}~XYnXt
�t|
�dd��}	nd}	|�|�}||_|	�r|j�r|�|	�}	|	|_|�|	|�|�dd|�|S)Nrrfrhzload_module ->�execzraise ImportError: �)rbr+�load_packagercr.�compile�readr2r�_bootstrap_external�
_classify_pycr rZ�marshal�loads�
memoryview�
add_moduler=rP�replace_paths_in_coder?�	scan_code)rBr�rhrg�	file_infor9�mode�typerx�co�data�excrrrrfNs4


zModuleFinder.load_modulecCs<||jkri|j|<|r*d|j||j<nd|j|d<dS)Nr�-)rLr<)rBrrsrrr�_add_badmoduleks


zModuleFinder._add_badmodulecCsB||jkr|�||�dSz|j|||d�Wn~tk
rn}z"|�ddt|��|�||�W5d}~XYn�tk
r�}z"|�ddt|��|�||�W5d}~XYn�X|�r>|D]�}|d|}||jkr�|�||�q�z|j|||g|d�Wq�tk
�r:}z"|�ddt|��|�||�W5d}~XYq�Xq�dS)NrnrzImportError:zSyntaxError:rz)rLr�rmr r^rZ�SyntaxError)rBrrsrtrYr^r��fullnamerrr�_safe_import_hookss,

zModuleFinder._safe_import_hookccs�|j}|j}|j}dd�t�|�D�}t|�D]�\}\}}|tkrTd||ffVq.|tkr.|dkr.||dd||ddkr�tkr.nq.|||dd}	|||dd}
|	dkr�d|
||ffVq.d|	|
||ffVq.q.dS)	NcSs"g|]\}}}|tkr||f�qSr)�EXTENDED_ARG)�.0�_�opr]rrr�
<listcomp>�s�z-ModuleFinder.scan_opcodes.<locals>.<listcomp>�storerrr�absolute_import�relative_import)	�co_code�co_names�	co_consts�disZ_unpack_opargs�	enumerate�	STORE_OPSrr)rBr��coder��constsZopargsr\r�ZopargrYrtrrr�scan_opcodes�s(��
zModuleFinder.scan_opcodescCs�|j}|j}||�D�]F\}}|dkr8|\}d|j|<q|dk�r|\}}d}	|dk	rpd|krbd}	dd�|D�}|j|||dd�|	�r\d}
|jr�|j�|jd	|�}
|
dkr�|j�|�}
|
dk	r�|j�|
j�|j	�|
j	�|
j
dkr�d|j	|<n
d|j	|<q|d
k�rT|\}}}|�r0|j||||d�n"|j||d�}|j|jd|dd�qt|��q|j
D]"}
t|
t|���rd|�|
|��qddS)Nr�rr�rr�cSsg|]}|dkr|�qS)r�r)r��frrrr��sz*ModuleFinder.scan_code.<locals>.<listcomp>rnrzr�)r�r�r@r�r>rK�getr<�updaterAr?ro�RuntimeErrorr�r,r�r�)rBr�rxr��scannerZwhatr[rrtZ	have_starZmmrYru�crrrr��sH





zModuleFinder.scan_codecCs�|�dd||�t�|�}|r"|}|�|�}||_|g|_|jt�|g�|_|�d|j�\}}}z&|�	||||�|�
dd|�|W�S|r�|��XdS)Nrr�rCzload_package ->)rbrr�r�r=r>r
r�r�rfrc)rBr�rgrrxrhZbufrirrrr��s

zModuleFinder.load_packagecCs*||jkr|j|St|�|j|<}|Sr)rKr;)rBr�rxrrrr��s

zModuleFinder.add_modulecCsn|dk	r|jd|}n|}||jkr<|�dd|�t|��|dkrd|tjkr^ddddtffS|j}t||�S)Nrzrzfind_module -> Excludedr)	r<rOrcr rJ�builtin_module_namesr$rr:)rBrrrur�rrrr��s

zModuleFinder.find_modulecCst�tdd�tdd�t|j���}|D]B}|j|}|jrRtddd�ntddd�td||jpnd	�q0|��\}}|r�t�td
�|D]*}t|j|���}td|dd
�|��q�|�rt�tddd�td�|D]*}t|j|���}td|dd
�|��q�dS)z�Print a report to stdout, listing the found modules with their
        paths, as well as modules that are missing, or seem to be missing.
        z
  %-25s %s)�NameZFile)�----r��PrSrTrxz%-25srzMissing modules:�?z
imported fromz, z7Submodules that appear to be missing, but could also bez#global names in the parent package:N)	rW�sortedrKr�r>r=�any_missing_mayberLr|)rBr��keyrx�missing�mayberZmodsrrr�reports0
zModuleFinder.reportcCs|��\}}||S)z�Return a list of modules that appear to be missing. Use
        any_missing_maybe() if you want to know which modules are
        certain to be missing, and which *may* be missing.
        )r�)rBr�r�rrr�any_missing"szModuleFinder.any_missingcCs�g}g}|jD]�}||jkrq|�d�}|dkr<|�|�q||dd�}|d|�}|j�|�}|dk	r�||j|kr�|�|�q�||jkr�q�|jr�|�|�q�|�|�q|�|�q|��|��||fS)a�Return two lists, one with modules that are certainly missing
        and one with modules that *may* be missing. The latter names could
        either be submodules *or* just global names in the package.

        The reason it can't always be determined is that it's impossible to
        tell which names are imported when "from module import *" is done
        with an extension module, short of actually importing it.
        rzrrN)	rLrOr}rrKr�r@rA�sort)rBr�r�rr\r�ZpkgnameZpkgrrrr�*s0	




zModuleFinder.any_missing_maybecCs�tj�|j�}}|jD]*\}}|�|�r||t|�d�}qDq|jr�||jkr�||krr|�	dd||f�n|�	dd|f�|j�
|�t|j�}t
t|��D](}t||t|��r�|�||�||<q�|jt|�|d�S)Nrzco_filename %r changed to %rz co_filename %r remains unchanged)r��co_filename)r)r�normpathr�rP�
startswithr�rMrQrcr�listr�rVr,r�r��replace�tuple)rBr�Znew_filenameZoriginal_filenamer��rr�r\rrrr�Xs&
��
z"ModuleFinder.replace_paths_in_code)NrNN)NNr)r)r)r)N)r<rGrHrCr^rbrcrdrlrmrorprqrrr�r�rfr�r�r�r�r�r�r�r�r�r�r�rrrrrI|s2
	

#
 
1
".rIc
Cs�ddl}z|�tjdd�d�\}}Wn2|jk
rX}zt|�WY�dSd}~XYnXd}d}g}g}|D]Z\}}	|dkr�|d}|dkr�d}|dkr�||	�tj�}|dkr�d}|dkrn|�|	�qn|s�d	}
n|d}
tj	dd�}tj	�
|
�|d<||}|dk�r.td
�|D]}tdt|���qt|||�}
|dd�D]`}|dk�r\d}�qF|�r�|dd�d
k�r�|
�
|dd�ddg�n
|
�
|�n
|
�|��qF|
�|
�|
��|
S)Nrrzdmp:qx:z-dz-mz-pz-qz-xzhello.pyzpath:rR���z.*r�)�getoptrJ�argv�errorrWrjr)�pathseprrr*rXrIrmrlrdr�)r�Zoptsr[r^rMZdomodsZaddpathZexclude�o�aZscriptr�item�mfr]rrr�testpsX


r�rez
[interrupted])N)%�__doc__r�Zimportlib._bootstrap_externalr�importlib.machineryr�r)r4rJ�types�warningsZopmaprrrrr�r�r3r.r2r0r+r$r&r
rrrr:r;rIr�r<r��KeyboardInterruptrWrrrr�<module>sL




-w;

__pycache__/copyreg.cpython-38.pyc000064400000010340151153537550013064 0ustar00U

e5d��@s�dZdddddgZiZddd�Zdd�ZzeWnek
rDYnXd	d
�Zeeee�dd�Zd
Z	dd�Z
dd�Zdd�Zdd�Z
iZiZiZdd�Zdd�Zdd�ZdS)z�Helper to provide extensibility for pickle.

This is only useful to add pickle support for extension types defined in
C, not for instances of user-defined classes.
�pickle�constructor�
add_extension�remove_extension�clear_extension_cacheNcCs,t|�std��|t|<|dk	r(t|�dS)Nz$reduction functions must be callable)�callable�	TypeError�dispatch_tabler)�ob_type�pickle_function�constructor_ob�r�/usr/lib64/python3.8/copyreg.pyrs
cCst|�std��dS)Nzconstructors must be callable)rr)�objectrrr
rscCst|j|jffS�N)�complex�real�imag)�crrr
�pickle_complex"srcCs<|tkrt�|�}n$|�||�}|jtjkr8|�||�|Sr)r�__new__�__init__)�cls�base�state�objrrr
�_reconstructor)sricCs�|dkst�|j}|jD]}t|d�r|jt@sq:qt}|tkrHd}n"||krbtd|j�d���||�}|||f}z
|j	}Wn\t
k
r�t|dd�r�td|j�d|���d�z
|j}Wnt
k
r�d}YnXYnX|�}|r�t
||fSt
|fSdS)N��	__flags__zcannot pickle z object�	__slots__zf object: a class that defines __slots__ without defining __getstate__ cannot be pickled with protocol )�AssertionError�	__class__�__mro__�hasattrr�	_HEAPTYPErr�__name__�__getstate__�AttributeError�getattr�__dict__r)�self�protorrr�args�getstate�dictrrr
�
_reduce_ex6s6


�

r.cGs|j|f|��Sr�r)rr+rrr
�
__newobj__Zsr0cCs|j|f|�|�S)zUsed by pickle protocol 4, instead of __newobj__ to allow classes with
    keyword-only arguments to be pickled correctly.
    r/)rr+�kwargsrrr
�
__newobj_ex__]sr2cCs�|j�d�}|dk	r|Sg}t|d�s(n�|jD]�}d|jkr.|jd}t|t�rV|f}|D]^}|dkrjqZqZ|�d�r�|�d�s�|j�	d�}|r�|�
d||f�q�|�
|�qZ|�
|�qZq.z
||_WnYnX|S)a�Return a list of slot names for a given class.

    This needs to find slots defined by the class and its bases, so we
    can't simply return the __slots__ attribute.  We must walk down
    the Method Resolution Order and concatenate the __slots__ of each
    class found there.  (This assumes classes don't modify their
    __slots__ attribute to misrepresent their slots after the class is
    defined.)
    �
__slotnames__Nr)r(�__weakref__�__�_z_%s%s)r(�getr"r!�
isinstance�str�
startswith�endswithr$�lstrip�appendr3)r�namesr�slots�name�strippedrrr
�
_slotnamescs2





rBcCs�t|�}d|krdks&ntd��||f}t�|�|krNt�|�|krNdS|tkrjtd|t|f��|tkr�td|t|f��|t|<|t|<dS)zRegister an extension code.�i���zcode out of rangeNz)key %s is already registered with code %sz$code %s is already in use for key %s)�int�
ValueError�_extension_registryr7�_inverted_registry��moduler@�code�keyrrr
r�s$�
�
�cCsR||f}t�|�|ks$t�|�|kr4td||f��t|=t|=|tkrNt|=dS)z0Unregister an extension code.  For testing only.z%key %s is not registered with code %sN)rFr7rGrE�_extension_cacherHrrr
r�s��cCst��dSr)rL�clearrrrr
r�s)N)�__doc__�__all__rrrr�	NameErrorrrr#r.r0r2rBrFrGrLrrrrrrr
�<module>s4�

	$<__pycache__/nturl2path.cpython-38.pyc000064400000003322151153537550013521 0ustar00U

e5dG�@sdZdd�Zdd�ZdS)z�Convert a NT pathname to a file URL and vice versa.

This module only exists to provide OS-specific code
for urllib.requests, thus do not use directly.
cCs�ddl}ddl}|�dd�}d|kr\|dd�dkr@|dd�}|�d�}|j�d	�|��S|�d�}t|�dks�|dd
|jkr�d|}t	|��|dd
�
�}|d�d�}|d}|D]}|r�|d	|j�|�}q�|�d�r�|�d�r�|d	7}|S)
z{OS-specific conversion from a relative URL of the 'file' scheme
    to a file system path; not recommended for general use.�N�:�|�z////��/�\���z	Bad URL: �)�string�urllib.parse�replace�split�parseZunquote�join�lenZ
ascii_letters�OSError�upper�endswith)Zurlr
�urllib�
components�comp�error�drive�path�r�"/usr/lib64/python3.8/nturl2path.py�url2pathnames(	

rcCs4ddl}|dd�dkrf|dd�}|dd���dkrJd|dd�}n|dd�d	krftd
|��d	|kr�|dd�dkr�d|}|�d�}|j�d�|��S|jd	dd
�}t|�dks�t|d�dkr�d
|}t|��|j�|d���}|d�d�}d|d	}|D] }|�r|d|j�|�}�q|S)z{OS-specific conversion from a file system path to a relative URL
    of the 'file' scheme; not recommended for general use.rNrz\\?\zUNC\rr	rrz
Bad path: z\\r)�maxsplitz///)rrrr
rZquoterr)�prrrrrrrrr�pathname2url-s.
rN)�__doc__rrrrrr�<module>s%__pycache__/plistlib.cpython-38.opt-2.pyc000064400000056763151153537550014221 0ustar00U

e5d�}�
@s:dddddddddd	d
ddg
Zd
dlZd
dlZd
dlZd
dlZd
dlZd
dlmZd
dlZd
dl	Z	d
dl
Z
d
dlZd
dlm
Z
d
dlmZejdded�Ze��ej�ejdd��Zdd�Zdd�Zdd�Zdd�ZGdd�d�ZGdd�d�ZdZe
�d�Z dKd d!�Z!d"d#�Z"e
�d$e
j#�Z$d%d&�Z%d'd(�Z&d)d*�Z'Gd+d,�d,�Z(Gd-d.�d.�Z)Gd/d0�d0e)�Z*d1d2�Z+Gd3d�de,�Z-d4d5d6d7d8�Z.e/�Z0Gd9d:�d:�Z1d;d<�Z2e3e4e5eje6fZ7Gd=d>�d>e/�Z8d?d@�Z9e:e;e+e(e*dA�e<e;e9e1e8dA�iZ=ddBe;dC�dDd�Z>ddBe;dC�dEd
�Z?e:dBdFdG�dHd	�Z@e:dFdBdI�dJd�ZAdS)L�	readPlist�
writePlist�readPlistFromBytes�writePlistToBytes�Data�InvalidFileException�FMT_XML�
FMT_BINARY�load�dump�loads�dumps�UID�N)�BytesIO)�warn)�ParserCreate�PlistFormatzFMT_XML FMT_BINARY)�modulec	cs2t|t�r(t||��}|VW5QRXn|VdS�N)�
isinstance�str�open)�
pathOrFile�mode�fp�r� /usr/lib64/python3.8/plistlib.py�_maybe_openOs
rc
Cs<tdtd�t|d��}t|ddd�W5QR�SQRXdS)Nz8The readPlist function is deprecated, use load() instead��rbF��fmt�use_builtin_types)r�DeprecationWarningrr	)rrrrrrYs�c	Cs8tdtd�t|d��}t||tddd�W5QRXdS)Nz9The writePlist function is deprecated, use dump() insteadr�wbTF�r!�	sort_keys�skipkeys)rr#rr
r)�valuerrrrrrfs�cCstdtd�tt|�ddd�S)NzBThe readPlistFromBytes function is deprecated, use loads() insteadrFr )rr#r	r��datarrrrss
�cCs,tdtd�t�}t||tddd�|��S)NzAThe writePlistToBytes function is deprecated, use dumps() insteadrTFr%)rr#rr
r�getvalue)r(�frrrr~s�c@s:eZdZdd�Zedd��Zd
dd�Zdd	�Zd
d�ZdS)rcCst|t�std��||_dS)Nzdata must be as bytes)r�bytes�	TypeErrorr*��selfr*rrr�__init__�s
z
Data.__init__cCs|t|��Sr)�_decode_base64)�clsr*rrr�
fromBase64�szData.fromBase64�LcCst|j|�Sr)�_encode_base64r*)r0�
maxlinelengthrrr�asBase64�sz
Data.asBase64cCs4t||j�r|j|jkSt|t�r,|j|kStSdSr)r�	__class__r*r-�NotImplemented�r0�otherrrr�__eq__�s


zData.__eq__cCsd|jjt|j�fS�Nz%s(%s)�r9�__name__�reprr*�r0rrr�__repr__�sz
Data.__repr__N)r5)	r@�
__module__�__qualname__r1�classmethodr4r8r=rCrrrrr�s

c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)r
cCs<t|t�std��|dkr"td��|dkr2td��||_dS)Nzdata must be an int�zUIDs cannot be >= 2**64r�UIDs must be positive)r�intr.�
ValueErrorr*r/rrrr1�s
zUID.__init__cCs|jSrr)rBrrr�	__index__�sz
UID.__index__cCsd|jjt|j�fSr>r?rBrrrrC�szUID.__repr__cCs|j|jffSr)r9r*rBrrr�
__reduce__�szUID.__reduce__cCst|t�stS|j|jkSr)rr
r:r*r;rrrr=�s
z
UID.__eq__cCs
t|j�Sr)�hashr*rBrrr�__hash__�szUID.__hash__N)	r@rDrEr1rKrCrLr=rNrrrrr
�s	s�<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
zv[\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0c\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f]r5cCsP|dd}g}tdt|�|�D]$}||||�}|�t�|��q d�|�S)N��r�)�range�len�append�binasciiZ
b2a_base64�join)�sr7Z
maxbinsize�pieces�i�chunkrrrr6�sr6cCs(t|t�rt�|�d��St�|�SdS)N�utf-8)rrrUZ
a2b_base64�encode)rWrrrr2�s
r2z{(?P<year>\d\d\d\d)(?:-(?P<month>\d\d)(?:-(?P<day>\d\d)(?:T(?P<hour>\d\d)(?::(?P<minute>\d\d)(?::(?P<second>\d\d))?)?)?)?)?ZcCsLd}t�|���}g}|D]&}||}|dkr2qB|�t|��qtj|�S)N�ZyearZmonthZdayZhourZminute�second)�_dateParser�match�	groupdictrTrI�datetime)rW�orderZgdZlst�key�valrrr�_date_from_string�srfcCs d|j|j|j|j|j|jfS)Nz%04d-%02d-%02dT%02d:%02d:%02dZr])�drrr�_date_to_strings�rhcCsZt�|�}|dk	rtd��|�dd�}|�dd�}|�dd�}|�dd�}|�d	d
�}|S)Nz<strings can't contains control characters; use bytes insteadz
�
�
�&z&amp;�<z&lt;�>z&gt;)�_controlCharPat�searchrJ�replace)�text�mrrr�_escapes
rsc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)S)*�_PlistParsercCs"g|_d|_d|_||_||_dSr)�stack�current_key�root�_use_builtin_types�
_dict_type�r0r"�	dict_typerrrr1s
z_PlistParser.__init__cCsBt�|_|j|j_|j|j_|j|j_|j|j_	|j�
|�|jSr)r�parser�handle_begin_elementZStartElementHandler�handle_end_elementZEndElementHandler�handle_dataZCharacterDataHandler�handle_entity_declZEntityDeclHandlerZ	ParseFilerw)r0Zfileobjrrr�parses



z_PlistParser.parsecCstd��dS)Nz8XML entity declarations are not supported in plist files)r)r0Zentity_nameZis_parameter_entityr(�baseZ	system_idZ	public_idZ
notation_namerrrr�$sz_PlistParser.handle_entity_declcCs*g|_t|d|d�}|dk	r&||�dS)NZbegin_)r*�getattr)r0�element�attrs�handlerrrrr}*sz!_PlistParser.handle_begin_elementcCs"t|d|d�}|dk	r|�dS)NZend_)r�)r0r�r�rrrr~0sz_PlistParser.handle_end_elementcCs|j�|�dSr)r*rTr/rrrr5sz_PlistParser.handle_datacCs�|jdk	rFt|jdti��s.td|jj��||jd|j<d|_nB|jsT||_n4t|jdtg��sxtd|jj��|jd�|�dS)N���zunexpected element at line %d)	rvrru�typerJr|�CurrentLineNumberrwrT�r0r(rrr�
add_object8s
��z_PlistParser.add_objectcCsd�|j�}g|_|S)N�)rVr*r/rrr�get_dataHsz_PlistParser.get_datacCs"|��}|�|�|j�|�dSr)ryr�rurT)r0r�rgrrr�
begin_dictOs
z_PlistParser.begin_dictcCs*|jrtd|j|jjf��|j��dS)Nz%missing value for key '%s' at line %d)rvrJr|r�ru�poprBrrr�end_dictTs
�z_PlistParser.end_dictcCs8|jst|jdti��s*td|jj��|��|_dS)Nr�zunexpected key at line %d)rvrrur�rJr|r�r�rBrrr�end_keyZs
�z_PlistParser.end_keycCsg}|�|�|j�|�dSr)r�rurT)r0r��arrr�begin_array`s
z_PlistParser.begin_arraycCs|j��dSr)rur�rBrrr�	end_arrayesz_PlistParser.end_arraycCs|�d�dS)NT�r�rBrrr�end_truehsz_PlistParser.end_truecCs|�d�dS)NFr�rBrrr�	end_falseksz_PlistParser.end_falsecCs@|��}|�d�s|�d�r.|�t|d��n|�t|��dS)NZ0xZ0X�)r��
startswithr�rI)r0�rawrrr�end_integernsz_PlistParser.end_integercCs|�t|����dSr)r��floatr�rBrrr�end_realusz_PlistParser.end_realcCs|�|���dSr)r�r�rBrrr�
end_stringxsz_PlistParser.end_stringcCs2|jr|�t|����n|�t�|����dSr)rxr�r2r�rr4rBrrr�end_data{sz_PlistParser.end_datacCs|�t|����dSr)r�rfr�rBrrr�end_date�sz_PlistParser.end_dateN)r@rDrEr1r�r�r}r~rr�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrts(	rtc@s8eZdZddd�Zdd�Zdd�Zdd
d�Zdd
�Zd	S)�_DumbXMLWriterr�	cCs||_g|_||_||_dSr)�fileru�
_indent_level�indent)r0r��indent_levelr�rrrr1�sz_DumbXMLWriter.__init__cCs,|j�|�|�d|�|jd7_dS)Nz<%s>�)rurT�writelnr��r0r�rrr�
begin_element�sz_DumbXMLWriter.begin_elementcCs |jd8_|�d|�dS)Nr�z</%s>)r�r�r�rrr�end_element�sz_DumbXMLWriter.end_elementNcCs8|dk	r&t|�}|�d|||f�n|�d|�dS)Nz<%s>%s</%s>z<%s/>)rsr�)r0r�r(rrr�simple_element�sz_DumbXMLWriter.simple_elementcCsH|r8t|t�r|�d�}|j�|j|j�|j�|�|j�d�dS)Nr[�
)rrr\r��writer�r�)r0�linerrrr��s

z_DumbXMLWriter.writeln)rr�)N)r@rDrEr1r�r�r�r�rrrrr��s


r�c@sFeZdZddd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Zdd�Z	dS)�_PlistWriterr�	r�TFcCs.|r|�t�t�||||�||_||_dSr)r��PLISTHEADERr�r1�
_sort_keys�	_skipkeys)r0r�r�r�ZwriteHeaderr&r'rrrr1�s

z_PlistWriter.__init__cCs"|�d�|�|�|�d�dS)Nz<plist version="1.0">z</plist>)r��write_valuer�rrrr��s

z_PlistWriter.writecCs4t|t�r|�d|��n|dkr0|�d��n|dkrD|�d�n�t|t�r�d|krbdkrxnn|�dd	|�nt|��n�t|t�r�|�d
t|��n�t|t�r�|�|�n|t|t	�r�|�
|�nft|ttf�r�|�
|�nLt|tj��r|�dt|��n,t|ttf��r |�|�ntdt|���dS)
N�stringT�trueFZfalsel����rGZintegerz%d�real�datezunsupported type: %s)rrr�rI�
OverflowErrorr�rA�dict�
write_dictr�
write_datar-�	bytearray�write_bytesrbrh�tuple�list�write_arrayr.r�r�rrrr��s.





z_PlistWriter.write_valuecCs|�|j�dSr)r�r*r/rrrr��sz_PlistWriter.write_datacCsz|�d�|jd8_tddt|j�dd�|j��}t||��d�D]}|rJ|�|�qJ|jd7_|�	d�dS)Nr*r�r�r5r�s        r�)
r�r��maxrSr�rpr6�splitr�r�)r0r*r7r�rrrr��s
�z_PlistWriter.write_bytescCs�|rt|�d�|jr"t|���}n|��}|D]8\}}t|t�sP|jrHq.td��|�d|�|�	|�q.|�
d�n
|�d�dS)Nr��keys must be stringsrd)r�r��sorted�itemsrrr�r.r�r�r�)r0rgr�rdr(rrrr��s

z_PlistWriter.write_dictcCs<|r.|�d�|D]}|�|�q|�d�n
|�d�dS)N�array)r�r�r�r�)r0r�r(rrrr�s
z_PlistWriter.write_arrayN)rr�r�TF)
r@rDrEr1r�r�r�r�r�r�rrrrr��s�

%
r�cCs�d}|D]}|�|�rdSqtjdftjdftjdffD]N\}}|�|�sNq:|D]4}||�d��|�}|dt|��|krRdSqRq:dS)N)s<?xmls<plistTr[z	utf-16-bez	utf-16-le�asciiF)r��codecs�BOM_UTF8�BOM_UTF16_BE�BOM_UTF16_LE�decoder\rS)�header�prefixesZpfxZbom�encoding�start�prefixrrr�_is_fmt_xmls
�
r�c@seZdZddd�ZdS)r�Invalid filecCst�||�dSr)rJr1)r0�messagerrrr12szInvalidFileException.__init__N)r�)r@rDrEr1rrrrr1s�B�H�L�Q)r�rrO�c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�_BinaryPlistParsercCs||_||_dSr)rxryrzrrrr1Asz_BinaryPlistParser.__init__cCs�z~||_|j�dtj�|j�d�}t|�dkr6t��t�d|�\}|_	}}}|j�|�|�
||�|_tg||_
|�|�WStttjttfk
r�t��YnXdS)Ni��� z>6xBBQQQ)�_fp�seek�os�SEEK_END�readrSr�struct�unpack�	_ref_size�
_read_ints�_object_offsets�
_undefined�_objects�_read_object�OSError�
IndexError�errorr�rJ)r0r�trailer�offset_size�num_objects�
top_object�offset_table_offsetrrrr�Es*
��z_BinaryPlistParser.parsecCsL|dkrH|j�d�dd@}d|>}dt|}t�||j�|��dS|S)N�r�rrPrm)r�r��_BINARY_FORMATr�r�)r0�tokenLrrrWr,rrr�	_get_size^sz_BinaryPlistParser._get_sizecst|j��|���tkr2t�d|�t�����S�rFt���|krLt��t��fdd�td�|��D��SdS)Nrmc3s&|]}t��||��d�VqdS)�bigN)rI�
from_bytes)�.0rY�r*�sizerr�	<genexpr>os�z0_BinaryPlistParser._read_ints.<locals>.<genexpr>r)	r�r�r�r�r�rSrr�rR)r0�nr�rr�rr�hs�z_BinaryPlistParser._read_intscCs|�||j�Sr)r�r�)r0r�rrr�
_read_refsrsz_BinaryPlistParser._read_refscs�j|}|tk	r|S�j|}�j�|��j�d�d}|d@|d@}}|dkr^d}�n�|dkrnd}�n�|dkr~d}�n�|dkr�d	}�n�|d
kr�tj�j�d|>�d|dkd
�}�nT|dkr�t�	d�j�d��d}�n0|dk�rt�	d�j�d��d}�n
|dk�rDt�	d�j�d��d}t
�
ddd�t
j|d�}�n�|dk�r���|�}�j�|�}t
|�|k�rxt���j�st|�}�n�|dk�rΈ�|�}�j�|�}	t
|	�|k�r�t��|	�d�}�n@|dk�r��|�d}�j�|�}	t
|	�|k�rt��|	�d�}n�|dk�r:tt��j�d|�d��}n�|dk�r���|�}��|�}
g}|�j|<|��fdd�|
D��n�|d k�r��|�}��|�}��|�}
���}|�j|<z.t||
�D]\}}
��|
�|��|�<�q�Wntk
�rt��YnXnt��|�j|<|S)!Nr�r��r�r�F�	TrQr�r�rP�Zsigned�"z>frO�#z>d�3��)Zseconds�@�Pr��`r�utf-16be��c3s|]}��|�VqdSr)r�)r��xrBrrr��sz2_BinaryPlistParser._read_object.<locals>.<genexpr>��)r�r�r�r�r�r�rIr�r�r�rbZ	timedeltar�rSrrxrr�r
r��extendry�zipr�r.)r0�ref�result�offset�tokenZtokenHr�r,rWr*Zobj_refsZkey_refs�k�orrBrr�us�

�



�















z_BinaryPlistParser._read_objectN)	r@rDrEr1r�r�r�r�r�rrrrr�9s

r�cCs,|dkrdS|dkrdS|dkr$dSdSdS)N�r��r�rOr�r)�countrrr�_count_to_size�src@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�_BinaryPlistWritercCs||_||_||_dSr)r�r�r�)r0rr&r'rrrr1�sz_BinaryPlistWriter.__init__c
Cs�g|_i|_i|_|�|�t|j�}dg||_t|�|_t|j|_	|j
�d�|jD]}|�|�qZ|�
|�}|j
��}t|�}dt||}|j
�tj|f|j���d}|||j|||f}	|j
�tjd|	���dS)Nr�bplist00rm�	>5xBBBQQQ)r)�_objlist�	_objtable�_objidtable�_flattenrSr�rr�r��_ref_formatr�r��
_write_object�
_getrefnum�tellr��pack)
r0r(r��objr�r�r�Z
offset_formatZsort_versionr�rrrr��s2





�z_BinaryPlistWriter.writec	Csrt|t�r"t|�|f|jkrZdSn8t|t�rHt|j�|jf|jkrZdSnt|�|jkrZdSt|j	�}|j	�
|�t|t�r�||jt|�|f<n0t|t�r�||jt|j�|jf<n||jt|�<t|t��rHg}g}|��}|j
r�t|�}|D]:\}}t|t��s|j�r
q�td��|�
|�|�
|�q�t�||�D]}|�|��q4n&t|ttf��rn|D]}|�|��q\dS)Nr�)r�_scalarsr�rrr*�idr rSrrTr�r�r�r�rr�r.�	itertools�chainr!r�r�)	r0r(Zrefnum�keys�valuesr�r�vrrrrr!sB





z_BinaryPlistWriter._flattencCsNt|t�r|jt|�|fSt|t�r<|jt|j�|jfS|jt|�SdSr)rr(rr�rr*r r)r�rrrr$Ns


z_BinaryPlistWriter._getrefnumcCs�|dkr"|j�t�d||B��n�|dkrH|j�t�d|dBd|��nh|dkrn|j�t�d|dBd|��nB|d	kr�|j�t�d
|dBd|��n|j�t�d|dBd
|��dS)Nr�z>Brz>BBBr�rz>BBH�rz>BBL�z>BBQ�)r�r�r�r&)r0rr�rrr�_write_sizeVsz_BinaryPlistWriter._write_sizecs���|�}�j���j|<|dkr2�j�d��nl|dkrJ�j�d��nT|dkrb�j�d��n<t|t��rl|dkr�z�j�t�dd|��Wn tj	k
r�t
|�d�YnXn�|d	krԈj�t�d
d|��n�|dkr�j�t�d
d|��nt|dk�r�j�t�dd|��nR|dk�r8�j�t�dd|��n0|dk�r`�j�d|jdddd��nt
|���n2t|t��r��j�t�dd|���nt|t
j
��r�|t
�
ddd���}�j�t�dd|���n�t|t��r��dt|j���j�|j��n�t|ttf��r0��dt|���j�|��nnt|t��r�z|�d�}��dt|��Wn4tk
�r�|�d �}��d!t|�d"�YnX�j�|��n�t|t��r^|jdk�r�td#��n�|jd	k�r�j�t�d
d$|��nt|jdk�r
�j�t�d
d%|��nP|jdk�r.�j�t�dd&|��n,|jdk�rR�j�t�dd'|��nt
|���n@t|ttf��r��fd(d)�|D�}t|�}��d*|��j�tjd+�j|f|���n�t|t��r�gg}}�j�r�t|� ��}	n|� �}	|	D]J\}
}t|
t��s�j!�r�q�t"d,��|�#��|
��|�#��|���q�t|�}��d-|��j�tjd+�j|f|����j�tjd+�j|f|���nt"|��dS).N�F�Tr�rz>Bqr1rz>BBr�rz>BHr/rz>BLr0lz>BQrG�r�rz>Bdrrr�rrr�rr	rrrHr
���csg|]}��|��qSr)r$)r�rrBrr�
<listcomp>�sz4_BinaryPlistWriter._write_object.<locals>.<listcomp>rrmr�r
)$r$r�r%r�r�rrIr�r&r�r��to_bytesr�rbZ
total_secondsrr2rSr*r-r�rr\�UnicodeEncodeErrorr
rJr�r�r"r�r�r�r�r�r.rT)r0r(rr,�tZrefsrWZkeyRefsZvalRefsZ	rootItemsrr.rrBrr#fs�






$
"$z _BinaryPlistWriter._write_objectN)	r@rDrEr1r�r!r$r2r#rrrrr�s-0rcCs|dd�dkS)Nr�rr)r�rrr�_is_fmt_binary�sr=)�detectr|�writerT�r!r"r{cCsl|dkrJ|�d�}|�d�t��D]}|d|�r$|d}qVq$t��nt|d}|||d�}|�|�S)Nr�rr>r|)r"r{)r�r��_FORMATSr-rr�)rr!r"r{r��info�P�prrrr	�s

cCst|�}t||||d�S)Nr@)rr	)r(r!r"r{rrrrr�s�Fr%cCs:|tkrtd|f��t|d|||d�}|�|�dS)NzUnsupported format: %rr?)r&r')rArJr�)r(rr!r&r'r?rrrr
s�r!r'r&cCs t�}t|||||d�|��S)NrE)rr
r+)r(r!r'r&rrrrrs)r5)B�__all__rUr��
contextlibrb�enum�iorr*r��rer��warningsrZxml.parsers.expatr�Enumr@r�globals�update�__members__�contextmanagerrrrrrrr
r��compilernr6r2�ASCIIr_rfrhrsrtr�r�r�rJrr��objectr�r�rrrIr�r-r(rr=rr�rrAr	rr
rrrrr�<module>1s��

	


'"�
	
s&d!$
a	���	__pycache__/locale.cpython-38.pyc000064400000103603151153537550012660 0ustar00U

e5do1�M@s0dZddlZddlZddlZddlZddlZddlmZddl	Z	dddddd	d
ddd
dddddddddddddgZ
dd�Zdd�Zzddl
TWnLek
r�d Zd!Zd"ZdZd#Zd$Zd%Zd&ZeZd'd
�Z�d�d(d�ZYnXde�kr�eZde�kr�eZeZiZe	� e�d)d
��Zd*d+�Z!�d�d-d.�Z"d/d0�Z#e�$d1�Z%�d�d2d3�Z&�d�d4d�Z'�d�d5d�Z(�d�d7d�Z)d8d
�Zd9d:�Z*e+fd;d�Z,d<d�Z-d=d>�Z.eZ/d?d@�Z0dAdB�Z1dCd�Z2dDdE�Z3dFdG�Z4�d�dId�Z5efdJd�Z6�d�dKd�ZefdLd	�Z7ej8�9dM��r�d�dNd�Z:nRze;Wn<e<k
�rPe=edO��r@�d�dPd�Z:n�d�dQd�Z:YnX�d�dRd�Z:dSdSdTdUdUdVdWdXdYdZdTd[d\d]dTdTdTd^d_d`dad]dbd[dcddd\dedfdgdhdUdidjdVdkdldmdndodpdXdYdZdq�,Z>e?e>�@��D]"\ZAZBeA�Cdrds�ZAe>�DeAeB��q�dtdtdtdudvdwdxdxdydzd{d{d|d}d~ddd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�dSd�dSdSd|d�dSdSd�d�d�d�d�d�d�d�d|d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d|d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d|d�d�d�d�d�d�d�d|d�d|dSd|d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��dd͐d�d�d�d�d�d�d�d�d�d�d�d�d	�d
�d
�d�dd��d
�d�d�d�d�d�d
�d�d�d�d�d�d�d�d�d�dd�d�d�d��d�d�d�ddΐd�d�d�d�d�d�d�d�d�d�d�d�d�dd�d�d��d�d �d!�d!�d!�d"�d#�d$�d%�d&�d'�d'�d(�d)�d'�d'�d&�d&d|d�d|d�d|d�d*�d+�d*�d*�d,�d,�d,�d�d�d-�d.�d.�d.�d/�d/�d.�d.�d.�d.�d.�d0�d0�d0�d1�d0�d2�d3�d4�d4�d5�d6�d6�d7�d7�d7�d8�d7�d7�d9�d9�d:�d;�d<�d<�d=�d=�d>�d?�d@�dA�dB�dC�dD�dE�dE�dF�dF�dE�dC�dC�dG�dG�dH�dI�dJ�dJ�dK�dL�dM�dN�dO�dO�dP�dQ�dR�dR�dS�dS�dT�dU�dV�dV�dW�dW�dX�dX�dY�dZd�d��d[�d\�d]�d^�d_�d`dȐdad�dȐdb�db�dc�dd�dc�dc�dc�dc�de�de�df�df�dd�dd�db�dg�dg�dh�di�dj�dj�dk�dl�dl�dm�dn�do�dp�dq�dr�dq�ds�ds�dt�dt�dt�du�dvdSdS�dw�dw�dx�du�dv�du�dy�dz�d{�d{�d{�d|�d|�d}�d{�d~�d�d�d��d��d��d��d��d��d��d��d��d��d��d��d�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d�d�d�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d�d��d��d��d��d��d��d��d��dddÐdÐdÐdÐdĐdĐdŐdŐdƐdǐdȐdɐdɐdʐdʐdːd̐d�d��dΐd�d��dАdАdѐdҐd�d�d��dӐdӐdԐ�LZE�dՐd֐dאdؐdِdڐdېdܐdݐdސdߐd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d��d��d��d��d��d��d��d��d��d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d �d!�d"�d#�d$�d%�d&�d'�d(�d)�d*�d+�d,�d-�d.�d.�d/�d0�d1�d2�d3�d4�d5�d6�d7�d8�d9�d:�d;�d<�d=�d>�d?�d@�dA�dB�dC�dD�dE�dF�dG�dH�dI�dJ�dK�dL�dM�dN�dO�dP�dQ�dR�dS�dT�dU�dV�dW�dX�dY�dZ�d[�d\�d]�d^�d_�d`�da�db�dc�dd�de�df�dg�df�dg�dh�di�dj�dk�dl�dm�dn�dm�do�dp�dq�dr�ds�dt�du�dv�dw�dx�dy�dz�d{�d|�d}�d~�d�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d���ZF�d��d��ZGzeWne<k
�
r�YnXe
�H�d��eI�d�k�r,eJ�d��eJ�eG�eJ�eJ�d��eJ�e.�dS(�a�Locale support module.

The module provides low-level access to the C lib's locale APIs and adds high
level number formatting APIs as well as a locale aliasing engine to complement
these.

The aliasing engine includes support for many commonly used locale names and
maps them to values suitable for passing to the C lib's setlocale() function. It
also includes default encodings for all supported locale names.

�N)�str�	getlocale�getdefaultlocale�getpreferredencoding�Error�	setlocale�resetlocale�
localeconv�strcoll�strxfrmr�atof�atoi�format�
format_string�currency�	normalize�LC_CTYPE�
LC_COLLATE�LC_TIME�LC_MONETARY�
LC_NUMERIC�LC_ALL�CHAR_MAXcCs||k||kS)zZ strcoll(string,string) -> int.
        Compares two strings according to the locale.
    �)�a�brr�/usr/lib64/python3.8/locale.py�_strcoll!srcCs|S)z\ strxfrm(string) -> string.
        Returns a string that behaves for cmp locale-aware.
    r)�srrr�_strxfrm'sr)�*�������cCs,dgddddgddddddddddddd�S)zd localeconv() -> dict.
            Returns numeric and monetary locale-specific parameters.
        r!��.)�grouping�currency_symbol�n_sign_posn�
p_cs_precedes�
n_cs_precedes�mon_grouping�n_sep_by_space�
decimal_point�
negative_sign�
positive_sign�p_sep_by_space�int_curr_symbol�p_sign_posn�
thousands_sep�mon_thousands_sep�frac_digits�mon_decimal_point�int_frac_digitsrrrrrr	?s&�cCs|dkrtd��dS)zd setlocale(integer,string=None) -> string.
            Activates/queries locale processing.
        )Nr(�Cz*_locale emulation only supports "C" localer<)r)�category�valuerrrrWscCst�}tr|�t�|S)N)�_localeconv�_override_localeconv�update)�drrrr	ls
ccsJd}|D]<}|tkrdS|dkr:|dkr2td��|Vq2|V|}qdS)Nrzinvalid grouping)r�
ValueError)r*Z
last_interval�intervalrrr�_grouping_intervalszsrEFc
Cs�t�}||rdpd}||r dp"d}|s2|dfS|ddkr\|��}|t|�d�}|}nd}d}g}t|�D]B}	|r�|dd	kr�|}d}q�|�||	d��|d|	�}qp|r�|�|�|��||�|�|t|�t|�d
fS)Nr8r7r/r*r���� r(�
0123456789r&)r	�rstrip�lenrE�append�reverse�join)
r�monetary�convr7r*�strippedZright_spacesZleft_spaces�groupsrDrrr�_group�s2
�rRcCsdd}|r&||dkr&|d7}|d8}qt|�d}|rT||dkrT|d8}|d8}q2|||d�S)NrrGr&)rJ)rZamountZlposZrposrrr�_strip_padding�s

rSzG%(?:\((?P<key>.*?)\))?(?P<modifiers>[-#0-9 +*.hlL]*?)[eEfFgGdiouxXcrs%]c	Gs�|r||f|}n||}|ddkr~d}|�d�}|rRt|d|d�\|d<}t�|r^dp`d}|�|�}|r�t||�}n2|ddkr�d}|r�t||d�\}}|r�t||�}|S)	NrFZeEfFgGrr)�rNr:r1Zdiu)�splitrRr	rMrS)	�percentr>r*rN�
additionalZ	formattedZseps�partsr1rrr�_format�s*
�

rYc
	Cs
tt�|��}t�d|�}t|tj�rjg}|D]8}|��ddkrN|�d�q.|�t	|��|||��q.n�t|t
�sz|f}g}d}|D]r}|��ddkr�|�d�q�|�d��d�}	|�t	|��||||f||d|d|	����|d|	7}q�t
|�}||S)aFormats a string in the same way that the % formatting would use,
    but takes the current locale into account.

    Grouping is applied if the third parameter is true.
    Conversion uses monetary thousands separator and grouping strings if
    forth parameter monetary is true.z%srF�%rZ	modifiersr r&)�list�_percent_re�finditer�sub�
isinstance�_collections_abc�Mapping�grouprKrY�tuple�count)
�f�valr*rNZpercentsZnew_fZnew_valZperc�iZ	starcountrrrr�s4
��cGs^ddl}|jdtdd�t�|�}|r:t|���t|�krJtdt|���t	||||f|��S)z&Deprecated, use format_string instead.rNz`This method will be removed in a future version of Python. Use 'locale.format_string()' instead.r')�
stacklevelzHformat() must be given exactly one %%char format specifier, %s not valid)
�warnings�warn�DeprecationWarningr\�matchrJrbrC�reprrY)rVr>r*rNrWrirlrrrr�s�
�TcCsft�}||rdpd}|dkr&td��td|t|�|dd�}d|d	}|r�||rXd
pZd}||dkrld
pnd}||dkr�dp�d}	|r�||	r�dp�d|}n||	r�dp�d|}||dkr�dp�d}
||dkr�dp�d}|
dkr�d|d}n`|
dk�r||}nL|
dk�r||}n8|
dk�r2|�d|�}n |
dk�rJ|�d	|�}n||}|�dd��d	d�S)zIFormats val according to the currency settings
    in the current locale.r;r9r!z9Currency formatting is not possible using the 'C' locale.z%%.%ifTrT�<�>r5r+rr.r-r0r4rGr(r,r6r2r3�(�)r&r'r#r%)r	rCrY�abs�replace)rfZsymbolr*Z
internationalrOZdigitsrZsmbZprecedesZ	separatedZsign_posZsignrrrrs6





cCs
td|�S)z8Convert float to string, taking the locale into account.z%.12g)rY)rfrrrr0scCs:t�}|d}|r|�|d�}|d}|r6|�|d�}|S)zHParses a string as a normalized number according to the locale settings.r7r(r1r))r	rs)�stringrO�tsZddrrr�
delocalize4srvcCs|t|��S)z<Parses a string as a float according to the locale settings.)rv)rt�funcrrrrDscCstt|��S)zAConverts a string to an integer according to the locale settings.)�intrv)rtrrrr
HscCsBttd�tddd�}t|dt|��td�}t|dt|��dS)Nr(z%di�[r&�isg��Q�	@)rrr�printr
rr)�s1rrr�_testLs

r|cCs�d|kr|d|�d��}n|}t�|�}tjj�|��|�}|}|��}|tkr\t|}n(|�dd�}|�dd�}|tkr�t|}|d|S)Nr)�_r(�-)�index�	encodings�normalize_encoding�aliases�get�lower�locale_encoding_aliasrs)�code�encoding�langname�
norm_encodingrrr�_replace_encoding^s 
�
r�cCsR|dkrFd|kr|dS|�d�\}}}|dkr4|S|dkrFt|d�S|d|S)N�euror)z.ISO8859-15)�
ISO8859-15�UTF-8�	ISO8859-1r��@)�	partitionr�)r��modifierr}r�rrr�_append_modifierus
r�c	Cs�|��}d|kr|�dd�}d|kr6|�dd�\}}nd}d|krZ|�d�dd�\}}n|}d}|}|r�|�dd�}|�d	d�}|d|7}|}|r�|d|7}t�|d�}|dk	r�|S|�rt�|d�}|dk	�rd|kr�t||�S|�dd�d��|k�r|S|�r�|}|�r"|d|7}t�|d�}|dk	�rnd|k�rLt||�S|�dd�\}}t||�d|S|�r�t�|d�}|dk	�r�d|k�r�t||�}t||�S|�dd�\}}|��|k�r�t||�d|S|S)
a� Returns a normalized locale code for the given locale
        name.

        The returned locale code is formatted for use with
        setlocale().

        If normalization fails, the original name is returned
        unchanged.

        If the given encoding is not known, the function defaults to
        the default encoding for the locale code just like setlocale()
        does.

    �:r)r�r&r(Nr'r~r})r�rsrU�locale_aliasr�r�r�)	�
localenamer�r�r�r�Zlang_encr�Zlookup_nameZdefmodrrrr�s`








cCs~t|�}d|kr8|�dd�\}}|dkr8d|kr8|dfSd|krVt|�d�dd��S|dkrbd	S|d
krndStd|��dS)
a� Parses the locale code for localename and returns the
        result as tuple (language code, encoding).

        The localename is normalized and passed through the locale
        alias engine. A ValueError is raised in case the locale name
        cannot be parsed.

        The language code corresponds to RFC 1766.  code and encoding
        can be None in case the values cannot be determined or are
        unknown to this implementation.

    r�r&r�r)�iso-8859-15Nr'r<)NNr��Nr�zunknown locale: %s)rrUrcrC)r�r�r�rrr�_parse_localename�sr�c	Cs\z4|\}}|dkrd}|dkr$|WS|d|WSWn"ttfk
rVtd�d�YnXdS)z� Builds a locale code from the given tuple (language code,
        encoding).

        No aliasing or normalizing takes place.

    Nr<r)zXLocale must be None, a string, or an iterable of two strings -- language code, encoding.)�	TypeErrorrC)ZlocaletupleZlanguager�rrr�_build_localename�s�r��rrZLANG�LANGUAGEc	Cs�zddl}|��\}}Wnttfk
r0Yn8Xtjdkr`|r`|dd�dkr`t�t|d��}||fSddl	}|j
j}|D],}||d�}|r||dkr�|�d�d}q�q|d}t|�S)	a� Tries to determine the default locale settings and returns
        them as tuple (language code, encoding).

        According to POSIX, a program which has not called
        setlocale(LC_ALL, "") runs using the portable 'C' locale.
        Calling setlocale(LC_ALL, "") lets it use the default locale as
        defined by the LANG variable. Since we don't want to interfere
        with the current locale setting we thus emulate the behavior
        in the way described above.

        To maintain compatibility with other platforms, not only the
        LANG variable is tested, but a list of variables given as
        envvars parameter. The first found to be defined will be
        used. envvars defaults to the search path used in GNU gettext;
        it must always contain the variable name 'LANG'.

        Except for the code 'C', the language code corresponds to RFC
        1766.  code and encoding can be None in case the values cannot
        be determined.

    rNZwin32r'Z0xr�r�r<)
�_localeZ_getdefaultlocale�ImportError�AttributeError�sys�platform�windows_localer�rx�os�environrUr�)Zenvvarsr�r�r�r��lookupZvariabler�rrrr
s$
cCs(t|�}|tkr d|kr td��t|�S)ap Returns the current setting for the given locale category as
        tuple (language code, encoding).

        category may be one of the LC_* value except LC_ALL. It
        defaults to LC_CTYPE.

        Except for the code 'C', the language code corresponds to RFC
        1766.  code and encoding can be None in case the values cannot
        be determined.

    �;z category LC_ALL is not supported)�
_setlocalerr�r�)r=r�rrrr?s
cCs$|rt|t�stt|��}t||�S)a^ Set the locale for the given category.  The locale can be
        a string, an iterable of two strings (language code and encoding),
        or None.

        Iterables are converted to strings using the locale aliasing
        engine.  Locale strings are passed directly to the C lib.

        category may be given as one of the LC_* values.

    )r_�_builtin_strrr�r�)r=ZlocalerrrrQscCst|tt���dS)z� Sets the locale for category to the default setting.

        The default setting is determined by calling
        getdefaultlocale(). category defaults to LC_ALL.

    N)r�r�r)r=rrrrbs�wincCstjjrdSddl}|�d�S)z1Return the charset that the user is likely using.r�rNF)r��flags�	utf8_mode�_bootlocaler)�do_setlocaler�rrrrnsZgetandroidapilevelcCsdSr�r)r�rrrr|scCs&tjjrdSt�d}|dkr"d}|S)zfReturn the charset that the user is likely using,
                by looking at environment variables.r�r&N�ascii)r�r�r�r)r��resrrrr�s
cCs`tjjrdSddl}|rDtt�}zttd�Wntk
rBYnX|�d�}|r\tt|�|S)zdReturn the charset that the user is likely using,
            according to the system configuration.r�rNr(F)r�r�r�r�rrrr)r�r�Zoldloc�resultrrrr�s

r<r�ZJIS7ZeucJPzKOI8-CZCP1251ZCP1255ZCP1256z	ISO8859-2z	ISO8859-5r�z
ISO8859-10z
ISO8859-11z
ISO8859-13z
ISO8859-14z
ISO8859-16z	ISO8859-3z	ISO8859-4z	ISO8859-6z	ISO8859-7z	ISO8859-8z	ISO8859-9ZSJISZTACTISZeucKRr�zKOI8-RzKOI8-TzKOI8-UZRK1048),�437�c�enZjisZjis7ZajecZkoi8cZmicrosoftcp1251Zmicrosoftcp1255Zmicrosoftcp1256Z88591Z88592Z88595Z885915r��latin_1�	iso8859_1�
iso8859_10�
iso8859_11�
iso8859_13�
iso8859_14�
iso8859_15�
iso8859_16�	iso8859_2�	iso8859_3�	iso8859_4�	iso8859_5�	iso8859_6�	iso8859_7�	iso8859_8�	iso8859_9�
iso2022_jp�	shift_jis�tactis�euc_jp�euc_kr�utf_8�koi8_rZkoi8_tZkoi8_u�kz1048�cp1251�cp1255�cp1256r}r(zaz_AZ.KOI8-Czaa_DJ.ISO8859-1zaa_ER.UTF-8zaa_ET.UTF-8zaf_ZA.ISO8859-1zagr_PE.UTF-8zak_GH.UTF-8zam_ET.UTF-8zen_US.ISO8859-1zan_ES.ISO8859-15zanp_IN.UTF-8zar_AA.ISO8859-6zar_AE.ISO8859-6zar_BH.ISO8859-6zar_DZ.ISO8859-6zar_EG.ISO8859-6zar_IN.UTF-8zar_IQ.ISO8859-6zar_JO.ISO8859-6zar_KW.ISO8859-6zar_LB.ISO8859-6zar_LY.ISO8859-6zar_MA.ISO8859-6zar_OM.ISO8859-6zar_QA.ISO8859-6zar_SA.ISO8859-6zar_SD.ISO8859-6zar_SS.UTF-8zar_SY.ISO8859-6zar_TN.ISO8859-6zar_YE.ISO8859-6zas_IN.UTF-8zast_ES.ISO8859-15zayc_PE.UTF-8zaz_AZ.ISO8859-9Ezaz_IR.UTF-8zbe_BY.CP1251zbe_BY.UTF-8@latinzbg_BG.UTF-8zbem_ZM.UTF-8zber_DZ.UTF-8zber_MA.UTF-8zbg_BG.CP1251zbhb_IN.UTF-8zbho_IN.UTF-8zbho_NP.UTF-8zbi_VU.UTF-8zbn_BD.UTF-8zbn_IN.UTF-8zbo_CN.UTF-8zbo_IN.UTF-8znb_NO.ISO8859-1zbr_FR.ISO8859-1zbrx_IN.UTF-8zbs_BA.ISO8859-2zbyn_ER.UTF-8zfr_CA.ISO8859-1zen_US.UTF-8zca_ES.ISO8859-1zca_AD.ISO8859-1zca_ES.UTF-8@valenciazca_FR.ISO8859-1zca_IT.ISO8859-1zce_RU.UTF-8zzh_CN.eucCNzzh_TW.eucTWzchr_US.UTF-8zckb_IQ.UTF-8zcmn_TW.UTF-8zcrh_UA.UTF-8zhr_HR.ISO8859-2zcs_CZ.ISO8859-2zcsb_PL.UTF-8zcv_RU.UTF-8zcy_GB.ISO8859-1zda_DK.ISO8859-1zde_DE.ISO8859-1zde_AT.ISO8859-1zde_BE.ISO8859-1zde_CH.ISO8859-1zde_IT.ISO8859-1zde_LI.UTF-8zde_LU.ISO8859-1zdoi_IN.UTF-8znl_NL.ISO8859-1znl_BE.ISO8859-1zdv_MV.UTF-8zdz_BT.UTF-8zee_EE.ISO8859-4zet_EE.ISO8859-1zel_GR.ISO8859-7zel_CY.ISO8859-7zel_GR.ISO8859-15zen_AG.UTF-8zen_AU.ISO8859-1zen_BE.ISO8859-1zen_BW.ISO8859-1zen_CA.ISO8859-1zen_DK.ISO8859-1zen_DL.UTF-8zen_GB.ISO8859-1zen_HK.ISO8859-1zen_IE.ISO8859-1zen_IL.UTF-8zen_IN.ISO8859-1zen_NG.UTF-8zen_NZ.ISO8859-1zen_PH.ISO8859-1zen_SC.UTF-8zen_SG.ISO8859-1zen_US.ISO8859-15zen_ZA.ISO8859-1zen_ZM.UTF-8zen_ZW.ISO8859-1zen_ZS.UTF-8zen_EN.ISO8859-1zeo_XX.ISO8859-3zeo.UTF-8zeo_EO.ISO8859-3zeo_US.UTF-8zes_ES.ISO8859-1zes_AR.ISO8859-1zes_BO.ISO8859-1zes_CL.ISO8859-1zes_CO.ISO8859-1zes_CR.ISO8859-1zes_CU.UTF-8zes_DO.ISO8859-1zes_EC.ISO8859-1zes_GT.ISO8859-1zes_HN.ISO8859-1zes_MX.ISO8859-1zes_NI.ISO8859-1zes_PA.ISO8859-1zes_PE.ISO8859-1zes_PR.ISO8859-1zes_PY.ISO8859-1zes_SV.ISO8859-1zes_US.ISO8859-1zes_UY.ISO8859-1zes_VE.ISO8859-1zet_EE.ISO8859-15zeu_ES.ISO8859-1zeu_FR.ISO8859-1zfa_IR.UTF-8zfa_IR.ISIRI-3342zff_SN.UTF-8zfi_FI.ISO8859-15zfil_PH.UTF-8zfi_FI.ISO8859-1zfo_FO.ISO8859-1zfr_FR.ISO8859-1zfr_BE.ISO8859-1zfr_CH.ISO8859-1zfr_LU.ISO8859-1zfur_IT.UTF-8zfy_DE.UTF-8zfy_NL.UTF-8zga_IE.ISO8859-1zgl_ES.ISO8859-1zgd_GB.ISO8859-1zgez_ER.UTF-8zgez_ET.UTF-8zgu_IN.UTF-8zgv_GB.ISO8859-1zha_NG.UTF-8zhak_TW.UTF-8zhe_IL.ISO8859-8zhi_IN.ISCII-DEVzhif_FJ.UTF-8zhne_IN.UTF-8zhsb_DE.ISO8859-2zht_HT.UTF-8zhu_HU.ISO8859-2zhy_AM.UTF-8zhy_AM.ARMSCII_8zia.UTF-8zia_FR.UTF-8zis_IS.ISO8859-1zid_ID.ISO8859-1zig_NG.UTF-8zik_CA.UTF-8zit_IT.ISO8859-1zit_CH.ISO8859-1ziu_CA.NUNACOM-8ziw_IL.UTF-8zja_JP.eucJPz
ja_JP.SJISzka_GE.GEORGIAN-ACADEMYzka_GE.GEORGIAN-PSzkab_DZ.UTF-8z
kk_KZ.ptcp154zkl_GL.ISO8859-1zkm_KH.UTF-8zkn_IN.UTF-8zko_KR.eucKRzkok_IN.UTF-8zks_IN.UTF-8zks_IN.UTF-8@devanagarizku_TR.ISO8859-9zkw_GB.ISO8859-1zky_KG.UTF-8zlb_LU.UTF-8zlg_UG.ISO8859-10zli_BE.UTF-8zli_NL.UTF-8zlij_IT.UTF-8zlt_LT.ISO8859-13zln_CD.UTF-8zlo_LA.MULELAO-1zlo_LA.IBM-CP1133zlv_LV.ISO8859-13zlzh_TW.UTF-8zmag_IN.UTF-8zmai_IN.UTF-8zmai_NP.UTF-8zmfe_MU.UTF-8zmg_MG.ISO8859-15zmhr_RU.UTF-8zmi_NZ.ISO8859-1zmiq_NI.UTF-8zmjw_IN.UTF-8zmk_MK.ISO8859-5zml_IN.UTF-8zmn_MN.UTF-8zmni_IN.UTF-8zmr_IN.UTF-8zms_MY.ISO8859-1zmt_MT.ISO8859-3zmy_MM.UTF-8znan_TW.UTF-8znds_DE.UTF-8znds_NL.UTF-8zne_NP.UTF-8znhn_MX.UTF-8zniu_NU.UTF-8zniu_NZ.UTF-8znl_AW.UTF-8znn_NO.ISO8859-1zno_NO.ISO8859-1zny_NO.ISO8859-1znr_ZA.ISO8859-1znso_ZA.ISO8859-15zoc_FR.ISO8859-1zom_ET.UTF-8zom_KE.ISO8859-1zor_IN.UTF-8zos_RU.UTF-8zpa_IN.UTF-8zpa_PK.UTF-8zpap_AN.UTF-8zpap_AW.UTF-8zpap_CW.UTF-8zpd_US.ISO8859-1zpd_DE.ISO8859-1zph_PH.ISO8859-1zpl_PL.ISO8859-2zpt_PT.ISO8859-1zpt_BR.ISO8859-1zpp_AN.ISO8859-1zps_AF.UTF-8zquz_PE.UTF-8zraj_IN.UTF-8zro_RO.ISO8859-2zru_RU.UTF-8zru_UA.KOI8-Uzru_RU.KOI8-Rzrw_RW.ISO8859-1zsa_IN.UTF-8zsat_IN.UTF-8zsc_IT.UTF-8zsd_IN.UTF-8zsd_IN.UTF-8@devanagarizsd_PK.UTF-8zse_NO.UTF-8zsr_RS.UTF-8@latinzsgs_LT.UTF-8zsr_CS.ISO8859-2zsh_HR.ISO8859-2zshn_MM.UTF-8zshs_CA.UTF-8zsi_LK.UTF-8zsid_ET.UTF-8zsk_SK.ISO8859-2zsl_SI.ISO8859-2zsl_CS.ISO8859-2zsm_WS.UTF-8zso_DJ.ISO8859-1zso_ET.UTF-8zso_KE.ISO8859-1zso_SO.ISO8859-1zsr_CS.ISO8859-5zsq_AL.ISO8859-2zsq_MK.UTF-8zsr_RS.UTF-8zsr_CS.UTF-8@latinzsr_CS.UTF-8zsr_ME.UTF-8zsr_CS.CP1251zss_ZA.ISO8859-1zst_ZA.ISO8859-1zsv_SE.ISO8859-1zsv_FI.ISO8859-1zsw_KE.UTF-8zsw_TZ.UTF-8zszl_PL.UTF-8z
ta_IN.TSCII-0zta_LK.UTF-8ztcy_IN.UTF-8zte_IN.UTF-8ztg_TJ.KOI8-Czth_TH.ISO8859-11zth_TH.TIS620zthe_NP.UTF-8zti_ER.UTF-8zti_ET.UTF-8ztig_ER.UTF-8ztk_TM.UTF-8ztl_PH.ISO8859-1ztn_ZA.ISO8859-15zto_TO.UTF-8ztpi_PG.UTF-8ztr_TR.ISO8859-9ztr_CY.ISO8859-9zts_ZA.ISO8859-1ztt_RU.TATAR-CYRztt_RU.UTF-8@iqtelifzug_CN.UTF-8zuk_UA.KOI8-Uz	en_US.utfzunm_US.UTF-8zur_PK.CP1256zur_IN.UTF-8zuz_UZ.UTF-8zve_ZA.UTF-8z
vi_VN.TCVNzvi_VN.VISCIIzwa_BE.ISO8859-1zwae_CH.UTF-8zwal_ET.UTF-8zwo_SN.UTF-8zxh_ZA.ISO8859-1zyi_US.CP1255zyo_NG.UTF-8zyue_HK.UTF-8zyuw_PG.UTF-8zzh_CN.gb2312z
zh_TW.big5zzh_HK.big5hkscszzh_SG.GB2312z	zh_SG.GBKzzu_ZA.ISO8859-1(LZa3Za3_azz
a3_az.koicZaa_djZaa_erZaa_etZafZaf_zaZagr_peZak_ghZamZam_etZamericanZan_esZanp_inZarZar_aaZar_aeZar_bhZar_dzZar_egZar_inZar_iqZar_joZar_kwZar_lbZar_lyZar_maZar_omZar_qaZar_saZar_sdZar_ssZar_syZar_tnZar_ye�arabic�asZas_inZast_esZayc_peZazZaz_azzaz_az.iso88599eZaz_irZbezbe@latinz
be_bg.utf8Zbe_byzbe_by@latinZbem_zmZber_dzZber_maZbgZbg_bgzbhb_in.utf8Zbho_inZbho_npZbi_vuZbn_bdZbn_inZbo_cnZbo_inZbokmalubokmål�brZbr_frZbrx_inZbsZbs_baZ	bulgarianZbyn_err�zc-frenchzc.asciizc.enz
c.iso88591zc.utf8Zc_czc_c.cZcaZca_adZca_eszca_es@valenciaZca_frZca_itZcatalanZce_ruZcextendz	chinese-sz	chinese-tZchr_usZckb_iqZcmn_twZcrh_uaZcroatianZcsZcs_csZcs_czZcsb_plZcv_ruZcyZcy_gbZczZcz_czZczechZdaZda_dkZdanishZdanskZdeZde_atZde_beZde_chZde_deZde_itz
de_li.utf8Zde_luZdeutschZdoi_inZdutchzdutch.iso88591Zdv_mvZdz_btZeeZee_eeZeestiZelZel_cyZel_grz
el_gr@euror�Zen_agZen_auZen_beZen_bwZen_caZen_dkz
en_dl.utf8Zen_gbZen_hkZen_ieZen_ilZen_inZen_ngZen_nzZen_phz
en_sc.utf8Zen_sgZen_ukZen_uszen_us@euro@euroZen_zaZen_zmZen_zwz
en_zw.utf8Zeng_gbZenglishzenglish.iso88591Z
english_ukzenglish_united-stateszenglish_united-states.437Z
english_usZeozeo.utf8Zeo_eoz
eo_us.utf8Zeo_xxZesZes_arZes_boZes_clZes_coZes_crZes_cuZes_doZes_ecZes_esZes_gtZes_hnZes_mxZes_niZes_paZes_peZes_prZes_pyZes_svZes_usZes_uyZes_veZestonianZetZet_eeZeuZeu_esZeu_frZfaZfa_irzfa_ir.isiri3342Zff_snZfiZfi_fiZfil_phZfinnishZfoZfo_fo�frZfr_beZfr_caZfr_chZfr_frZfr_luu	françaisZfre_frZfrenchzfrench.iso88591Z
french_franceZfur_itZfy_deZfy_nlZgaZga_ieZgalegoZgalicianZgdZgd_gbZger_deZgermanzgerman.iso88591Zgerman_germanyZgez_erZgez_etZglZgl_es�greekZgu_inZgvZgv_gbZha_ngZhak_twZheZhe_il�hebrew�hiZhi_inzhi_in.isciidevZhif_fjZhneZhne_inZhrZhr_hrZhrvatskiZhsb_deZht_htZhuZhu_huZ	hungarianZhy_amzhy_am.armscii8ZiaZia_frZ	icelandic�idZid_idZig_ngZik_ca�inZin_idryZis_isz
iso-8859-1r�z	iso8859-1z
iso8859-15�
iso_8859_1�iso_8859_15�itZit_chZit_itZitalianZiuZiu_caziu_ca.nunacom8ZiwZiw_ilz
iw_il.utf8ZjaZja_jpz	ja_jp.euczja_jp.mscodez	ja_jp.pckZjapanZjapanesezjapanese-euczjapanese.eucZjp_jpZkaZka_gezka_ge.georgianacademyzka_ge.georgianpszka_ge.georgianrsZkab_dzZkk_kzZklZkl_glZkm_khZknZkn_inZkoZko_krz	ko_kr.eucZkok_in�koreanz
korean.eucZksZks_inzks_in@devanagari.utf8Zku_tr�kwZkw_gbZkyZky_kgZlb_luZlg_ugZli_beZli_nlZlij_itZ
lithuanianZln_cd�loZlo_lazlo_la.cp1133zlo_la.ibmcp1133zlo_la.mulelao1�ltZlt_ltZlvZlv_lvZlzh_twZmag_inZmaiZmai_inZmai_npZmfe_muZmg_mgZmhr_ru�miZmi_nzZmiq_niZmjw_inZmkZmk_mkZmlZml_inZmn_mnZmni_inZmrZmr_inZmsZms_myZmtZmt_mtZmy_mmZnan_twZnbZnb_noZnds_deZnds_nlZne_npZnhn_mxZniu_nuZniu_nz�nlZnl_awZnl_beZnl_nlZnnZnn_noZnoz
no@nynorskZno_nozno_no.iso88591@bokmalzno_no.iso88591@nynorskZ	norwegianZnrZnr_zaZnsoZnso_zaZnyZny_noZnynorskZocZoc_frZom_etZom_ke�orZor_inZos_ruZpaZpa_inZpa_pkZpap_anZpap_awZpap_cwZpdZpd_deZpd_usZphZph_phZplZpl_plZpolishZ
portugueseZportuguese_brazil�posixz
posix-utf2ZppZpp_anZps_afZptZpt_brZpt_ptZquz_peZraj_inZroZro_roZromanianZruZru_ruZru_uaZrumanianZrussianZrwZrw_rwZsa_inZsat_inZsc_itZsdZsd_inzsd_in@devanagari.utf8Zsd_pkZse_noZ
serbocroatianZsgs_ltZshzsh_ba.iso88592@bosniaZsh_hrzsh_hr.iso88592Zsh_spZsh_yuZshn_mmZshs_caZsiZsi_lkZsid_etZsinhalaZskZsk_skZslZsl_csZsl_siZslovakZsloveneZ	slovenianZsm_wsZso_djZso_etZso_keZso_soZspZsp_yuZspanishZ
spanish_spainZsqZsq_alZsq_mk�srzsr@cyrilliczsr@latnZsr_cszsr_cs.iso88592@latnz
sr_cs@latnZsr_meZsr_rsz
sr_rs@latnZsr_spZsr_yuzsr_yu.cp1251@cyrilliczsr_yu.iso88592zsr_yu.iso88595zsr_yu.iso88595@cyrilliczsr_yu.microsoftcp1251@cyrillicz
sr_yu.utf8zsr_yu.utf8@cyrilliczsr_yu@cyrillicZssZss_za�stZst_zaZsvZsv_fiZsv_seZsw_keZsw_tzZswedishZszl_plZtaZta_inzta_in.tsciizta_in.tscii0Zta_lkztcy_in.utf8ZteZte_inZtgZtg_tjZthZth_thzth_th.tactiszth_th.tis620�thaiZthe_npZti_erZti_etZtig_erZtk_tmZtlZtl_phZtnZtn_zaZto_toZtpi_pgZtrZtr_cyZtr_trruZts_zaZttZtt_ruztt_ru.tatarcyrz
tt_ru@iqtelifZturkishZug_cnZukZuk_uaZunivZ	universalzuniversal.utf8@ucs4Zunm_usZurZur_inZur_pkZuzZuz_uzzuz_uz@cyrillicZveZve_zaZviZvi_vnz
vi_vn.tcvnzvi_vn.tcvn5712zvi_vn.visciizvi_vn.viscii111ZwaZwa_beZwae_chZwal_etZwo_snZxhZxh_zaZyiZyi_usZyo_ngZyue_hkZyuw_pgZzhZzh_cnz
zh_cn.big5z	zh_cn.eucZzh_hkzzh_hk.big5hkZzh_sgz	zh_sg.gbkZzh_twz	zh_tw.euczzh_tw.euctwZzuZzu_zaZaf_ZAZsq_ALZgsw_FRZam_ETZar_SAZar_IQZar_EGZar_LYZar_DZZar_MAZar_TNZar_OMZar_YEZar_SYZar_JOZar_LBZar_KWZar_AEZar_BHZar_QAZhy_AMZas_INZaz_AZZba_RUZeu_ESZbe_BYZbn_INZbs_BAZbr_FRZbg_BGZca_ESZzh_CHSZzh_TWZzh_CNZzh_HKZzh_SGZzh_MOZzh_CHTZco_FRZhr_HRZhr_BAZcs_CZZda_DKZgbz_AFZdiv_MVZnl_NLZnl_BEZen_USZen_GBZen_AUZen_CAZen_NZZen_IEZen_ZAZen_JAZen_CBZen_BZZen_TTZen_ZWZen_PHZen_INZen_MYZet_EEZfo_FOZfil_PHZfi_FIZfr_FRZfr_BEZfr_CAZfr_CHZfr_LUZfr_MCZfy_NLZgl_ESZka_GEZde_DEZde_CHZde_ATZde_LUZde_LIZel_GRZkl_GLZgu_INZha_NGZhe_ILZhi_INZhu_HUZis_ISZid_IDZiu_CAZga_IEZit_ITZit_CHZja_JPZkn_INZkk_KZZkh_KHZqut_GTZrw_RWZkok_INZko_KRZky_KGZlo_LAZlv_LVZlt_LTZdsb_DEZlb_LUZmk_MKZms_MYZms_BNZml_INZmt_MTZmi_NZZarn_CLZmr_INZmoh_CAZmn_MNZmn_CNZne_NPZnb_NOZnn_NOZoc_FRZor_INZps_AFZfa_IRZpl_PLZpt_BRZpt_PTZpa_INZquz_BOZquz_ECZquz_PEZro_ROZrm_CHZru_RUZsmn_FIZsmj_NOZsmj_SEZse_NOZse_SEZse_FIZsms_FIZsma_NOZsma_SEZsa_INZsr_SPZsr_BAZsi_LKZns_ZAZtn_ZAZsk_SKZsl_SIZes_ESZes_MXZes_GTZes_CRZes_PAZes_DOZes_VEZes_COZes_PEZes_ARZes_ECZes_CLZes_URZes_PYZes_BOZes_SVZes_HNZes_NIZes_PRZes_USZsw_KEZsv_SEZsv_FIZsyr_SYZtg_TJZtmz_DZZta_INZtt_RUZte_INZth_THZbo_BTZbo_CNZtr_TRZtk_TMZug_CNZuk_UAZwen_DEZur_PKZur_INZuz_UZZvi_VNZcy_GBZwo_SNZxh_ZAZsah_RUZii_CNZyo_NGZzu_ZA)�i6ii�i^iiiiiiii i$i(i,i0i4i8i<i@i+iMi,i,imi-i#iEi ii~iir%iiiiii|i�iiiii�ieiii	i	i	i	i	i	i	i	 i	$i	(i	,i	0i	4i	@i	Di	Hi%i8idiiiiiiiibiVi7iiiiiiioiGihi
i9iii!i]i]i<iiiiKi?iSi�i�iWii@iTi&i'i.ini/i>i>iLi:i�iziNi|iPiPiaiii�iHici)iiiiFikikikiiii;$i;i;i;i;i;i; i;i;iOiiiii[ili2ii$i
i
i
i
i
i
i
i
 i
$i
(i
,i
0i
4i
8i
<i
@i
Di
Hi
Li
Pi
TiAiiiZi(i_iIiDiJiiQiQiiBi�i"i.i i iCiCi*iRi�i4i�ixiji5cCs�i}|fdd�}|�|d=td�td�t�\}}td|p@d�td|pNd�t�td	�td�|��D]@\}}t|d
�t|�\}}td|p�d�td|p�d�t�qpt�td
�td�t�|��D]B\}}t|d
�t|�\}}td|p�d�td|�pd�t�q�zttd�Wn$td�td�td�YnhXt�td�td�|��D]F\}}t|d
�t|�\}}td|�p�d�td|�p�d�t��qldS)z Test function.
    cSs0t���D] \}}|dd�dkr
|||<q
dS)Nr#ZLC_)�globals�items)�
categories�k�vrrr�_init_categories�sz'_print_locale.<locals>._init_categoriesrz4Locale defaults as determined by getdefaultlocale():zH------------------------------------------------------------------------z
Language: z(undefined)z
Encoding: zLocale settings on startup:z...z
   Language: z
   Encoding: z,Locale settings after calling resetlocale():r(zNOTE:z9setlocale(LC_ALL, "") does not support the default localez&given in the OS environment variables.z4Locale settings after calling setlocale(LC_ALL, ""):N)rzrr�rrrr)r�r�Zlang�enc�namer=rrr�
_print_locale�sV



r��LC_MESSAGES�__main__zLocale aliasing:zNumber formatting:)N)F)FF)FF)FF)TFF)r�)N)T)T)T)T)K�__doc__r�r�Zencodings.aliases�rer`�builtinsrr��	functools�__all__rrr�r�rrrrr�rrrrCrr	rr�rr
r?r@�wrapsrErRrS�compiler\rYrrrrv�floatrr
r|r�r�r�rr�r�rrrr��
startswithr�CODESET�	NameError�hasattrr��sortedr�r�r�rs�
setdefaultr�r�r�rK�__name__rzrrrr�<module>st�	




%-S"5
$�6}�����
a��V:

__pycache__/sre_parse.cpython-38.opt-1.pyc000064400000052142151153537550014344 0ustar00U

e5d&��@s�dZddlTdZdZed�Zed�Zed�Zed�Zed	�Z	ee
eh�Zee
eeeeeh�Zeed
�feed�feed�feed
�feed�feed�feed�feed�fd�Zeefeefeefeeefgfeeefgfeeefgfeeefgfeeefgfeeefgfee fd�
Z!e"e#e$e%e&e'e(e)d�Z*e'e#Be)BZ+e,e(BZ-Gdd�de.�Z/Gdd�d�Z0Gdd�d�Z1Gdd�d�Z2dd�Z3dd �Z4d!d"�Z5d#d$�Z6d3d&d'�Z7d(d)�Z8d*d+�Z9d4d-d.�Z:d/d0�Z;d1d2�Z<d,S)5zInternal support module for sre�)�*z.\[{()*+?^$|z*+?{�
0123456789Z01234567Z0123456789abcdefABCDEFZ4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZz 	

����
�
�	��\)z\a�\bz\fz\nz\rz\tz\vz\\)
z\Arz\Bz\dz\Dz\sz\Sz\wz\Wz\Z)�i�L�m�s�x�a�t�uc@seZdZdS)�VerboseN)�__name__�
__module__�__qualname__�rr�!/usr/lib64/python3.8/sre_parse.pyrGsrc@sBeZdZdd�Zedd��Zddd�Zdd	�Zd
d�Zdd
�Z	dS)�StatecCsd|_i|_dg|_d|_dS)Nr)�flags�	groupdict�groupwidths�lookbehindgroups��selfrrr�__init__LszState.__init__cCs
t|j�S�N)�lenrr rrr�groupsQszState.groupsNcCsb|j}|j�d�|jtkr$td��|dk	r^|j�|d�}|dk	rTtd|||f��||j|<|S)Nztoo many groupsz7redefinition of group name %r as group %d; was group %d)r%r�append�	MAXGROUPS�errorr�get)r!�name�gid�ogidrrr�	opengroupTs
�
zState.opengroupcCs|��|j|<dSr#)�getwidthr)r!r+�prrr�
closegroup`szState.closegroupcCs||jko|j|dk	Sr#)r%r)r!r+rrr�
checkgroupbszState.checkgroupcCs6|jdk	r2|�|�s|�d��||jkr2|�d��dS)N�cannot refer to an open groupz?cannot refer to group defined in the same lookbehind subpattern)rr1r()r!r+�sourcerrr�checklookbehindgroupes




zState.checklookbehindgroup)N)
rrrr"�propertyr%r-r0r1r4rrrrrJs

rc@s`eZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�ZdS)�
SubPatternNcCs"||_|dkrg}||_d|_dSr#)�state�data�width)r!r7r8rrrr"os
zSubPattern.__init__rcCs�d}ttf}|jD�]t\}}t|dt|�dd�|tkrlt�|D]"\}}t|ddt|�|�qFq|tkr�t�t|d�D]*\}}|r�t|dd�|�|d�q�q|t	k�r|\}}	}
td|�|	�|d�|
�r�t|dd�|
�|d�qt
||��r~d}|D]T}t
|t��rJ|�s6t�|�|d�d}n"|�s\td	dd�t|dd�d}�q|�s�t�qtd|�qdS)
NTz  �)�end��OR�ELSEF� )�tuple�listr8�print�str�IN�BRANCH�	enumerate�dump�GROUPREF_EXISTS�
isinstancer6)r!�level�nl�seqtypes�op�avrr
�	condgroup�item_yes�item_norrrrGvsH


zSubPattern.dumpcCs
t|j�Sr#)�reprr8r rrr�__repr__�szSubPattern.__repr__cCs
t|j�Sr#)r$r8r rrr�__len__�szSubPattern.__len__cCs|j|=dSr#�r8�r!�indexrrr�__delitem__�szSubPattern.__delitem__cCs&t|t�rt|j|j|�S|j|Sr#)rI�slicer6r7r8rVrrr�__getitem__�s
zSubPattern.__getitem__cCs||j|<dSr#rU�r!rW�coderrr�__setitem__�szSubPattern.__setitem__cCs|j�||�dSr#)r8�insertr[rrrr^�szSubPattern.insertcCs|j�|�dSr#)r8r&)r!r\rrrr&�szSubPattern.appendc	Cs�|jdk	r|jSd}}|jD�]�\}}|tkr|td}d}|dD]$}|��\}}t||�}t||�}qD||}||}q|tkr�|��\}}||}||}q|tkr�|d��\}}||}||}q|t	k�r|d��\}}|||d}|||d}q|t
k�r$|d}|d}q|tk�rP|jj
|\}}||}||}q|tk�r�|d��\}}|ddk	�r�|d��\}}t||�}t||�}nd}||}||}q|tkr�q�qt|td�t|t�f|_|jS)Nrr<����)r9r8rE�	MAXREPEATr.�min�max�CALL�
SUBPATTERN�_REPEATCODES�
_UNITCODES�GROUPREFr7rrH�SUCCESS)	r!�lo�hirMrNr
�j�l�hrrrr.�sZ












zSubPattern.getwidth)N)r)
rrrr"rGrSrTrXrZr]r^r&r.rrrrr6ms

(r6c@sbeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Ze	d
d��Z
dd�Zdd�Zddd�Z
dS)�	TokenizercCs@t|t�|_||_|js"t|d�}||_d|_d|_|��dS)N�latin1r)rIrC�istext�string�decoded_stringrW�next�_Tokenizer__next)r!rrrrrr"�s
zTokenizer.__init__cCs�|j}z|j|}Wntk
r0d|_YdSX|dkr�|d7}z||j|7}Wn.tk
r�td|jt|j�d�d�YnX|d|_||_dS)Nrr<zbad escape (end of pattern))rWrs�
IndexErrorrtr(rrr$)r!rW�charrrr�__next�s&��
zTokenizer.__nextcCs||jkr|��dSdS)NTF�rtru)r!rwrrr�match�s
zTokenizer.matchcCs|j}|��|Sr#ry)r!�thisrrrr)�sz
Tokenizer.getcCs8d}t|�D]&}|j}||kr"q4||7}|��q|S�Nr:)�rangertru)r!�n�charset�result�_�crrr�getwhiles
zTokenizer.getwhilecCsld}|j}|��|dkr@|s,|�d|��|�d|t|���||kr^|sh|�d|d��qh||7}q|S)Nr:zmissing zmissing %s, unterminated namer<)rtrur(r$)r!�
terminatorr*r�r�rrr�getuntils
�
zTokenizer.getuntilcCs|jt|jpd�Sr|�rWr$rtr rrr�possz
Tokenizer.poscCs|jt|jpd�Sr|r�r rrr�tellszTokenizer.tellcCs||_|��dSr#)rWrurVrrr�seek szTokenizer.seekrcCst||j|��|�Sr#)r(rrr�)r!�msg�offsetrrrr($szTokenizer.errorN)r)rrrr"rurzr)r�r�r5r�r�r�r(rrrrro�s		
roc	Cs�t�|�}|r|St�|�}|r0|dtkr0|S�zJ|dd�}|dkr�||�dt�7}t|�dkrx|�d|t|���tt	|dd�d�fWS|dkr�|j
r�||�dt�7}t|�d	kr�|�d|t|���tt	|dd�d�fWS|d
k�rN|j
�rN||�dt�7}t|�dk�r*|�d|t|���t	|dd�d�}t|�t|fWS|d
k�r�|j
�r�ddl}|�
d��s~|�d��|�dd�}zt|�|��}Wn2tk
�r�|�d|t|�td���YnXt|fWS|tk�r.||�dt�7}t	|dd�d�}|dk�r$|�d|t|���t|fWS|tk�r<t�t|�dk�rz|tk�rh|�d|t|���tt|d�fWSWntk
�r�YnX|�d|t|���dS)Nrr<r`r��incomplete escape %s�r��U��
�N�{�	missing {�}�character name�undefined character name %r�\N{}��.octal escape value %s outside of range 0-0o377�
bad escape %s)�ESCAPESr)�
CATEGORIESrDr��	HEXDIGITSr$r(�LITERAL�intrq�chr�unicodedatarzr��ord�lookup�KeyError�	OCTDIGITS�DIGITS�
ValueError�ASCIILETTERS)r3�escaper\r�r��charnamerrr�
_class_escape'sp




�



��


r�c	Csft�|�}|r|St�|�}|r$|S�z|dd�}|dkr�||�dt�7}t|�dkrl|�d|t|���tt|dd�d�fWS|dkr�|j	r�||�dt�7}t|�dkr�|�d|t|���tt|dd�d�fWS|d	k�rB|j	�rB||�d
t�7}t|�dk�r|�d|t|���t|dd�d�}t
|�t|fWS|dk�r�|j	�r�d
dl}|�d��sr|�d��|�
dd�}zt|�|��}Wn2tk
�r�|�d|t|�td���YnXt|fWS|dk�r||�dt�7}tt|dd�d
�fWS|tk�r�|jtk�r�||��7}|dtk�r�|dtk�r�|jtk�r�||��7}t|dd�d
�}|dk�r�|�d|t|���t|fWSt|dd��}||jk�r�|�|��s�|�dt|���|�||�t|fWS|�d|t|�d��t|�dk�r4|tk�r"|�d|t|���tt|d�fWSWntk
�rLYnX|�d|t|���dS)Nr<r`rr�r�r�rr�r�r�r�r�rr�r�r�r�r�r��0r�r�r2�invalid group reference %dr�)r�r)r�r�r�r$r(r�r�rqr�r�rzr�r�r�r�r�r�rtr%r1r4rhr�r�)r3r�r7r\r�r�r��grouprrr�_escapecs�




�



�
��
�

r�cCstt�|��Sr#)rA�dict�fromkeys)�itemsrrr�_uniq�sr�cCsVg}|j}|j}|��}|t||||d|o2|��|d�sqDqt|�dkrX|dSt|�}d}	|D].}
|
stq�|	dkr�|
d}	qh|
d|	krhq�qh|D]
}
|
d=q�|�|	�q`q�q`g}|D]h}
t|
�dkr��q@|
d\}}
|tkr�|�||
f�q�|tk�r"|
ddtk	�r"|�	|
�q��q@q�|�tt
|�f�|S|�td|ff�|S)Nr<�|r)r&rzr��_parser$r6r�rD�NEGATE�extendr�rE)r3r7�verbose�nestedr��itemsappend�sourcematch�start�
subpattern�prefix�item�setrMrNrrr�
_parse_sub�sN
�

r�Fc/
Cs�t|�}|j}|j}|j}t}	t}
|j}|dkr4�q*|dkr@�q*|�|rx|tkrTq"|dkrx|�}|dksv|dkr\q"q\q"|ddkr�t|||�}||�q"|t	kr�|t
|
|�f�q"|dk�r�|��d}
g}|j}|jdk�rddl}|j
d|��t|d	d
�|d�}|�}|dk�r0|�d|��|
��|d
k�rF|�rF�qbn�|ddk�r`t||�}n~|�r�|dk�r�|j|k�r�ddl}|j
d|dk�r�dn|dk�r�dn|dk�r�dnd|��dft|d	d
�t
|
|�f}|d��r<|�}|dk�r|�d|��|
��|d
k�rL|dtk�r0|dd}||�|t
|
d�f��qb|ddk�rft||�}n>|dk�r�ddl}|j
d|��dt|d	d
�t
|
|�f}|dt
k�s�|dt
k�r�d||f}|�|t|�dt|���|d}|d}||k�r*d||f}|�|t|�dt|���|t||ff�n"|dtk�rV|dd}||��qt|�}|	|�dk�r�|ddt
k�r�|�r�|t|ddf�n||d�n"|�r�|�dtdf�|t|f�q"|tk�r.|��}
|dk�rd\}}�nB|dk�rdt}}�n*|dk�r0dt}}�n|dk�r4|jdk�rX|t
|
|�f�q"dt}}d }}|jtk�r�||�7}�qj|d!��r�|jtk�r�||�7}�q�n|}|d��s�|t
|
|�f�|�|
�q"|�r�t|�}|tk�r�td"��|�rBt|�}|tk�rtd"��||k�rB|�d#|��|
��ntd$|f��|�rV|d%d�}nd}|�rr|ddtk�r�|�d&|��|
t|���|ddtk�r�|�d'|��|
t|���|ddt k�r�|dd\}}}}|dk�r�|�s�|�s�|}|d��rt!|||ff|d%<nt"|||ff|d%<q"|d(k�rF|t#df�q"|d)k�r�|��d} d*}d}!d}d}|d��r|�}|dk�r�|�d+��|d,k�r�|d-��r�|�$d.d/�}!|!�%��s�d0|!}|�|t|!�d��n�|d1��r�|�$d2d/�}!|!�%��sd0|!}|�|t|!�d��|j&�|!�}"|"dk�rFd3|!}|�|t|!�d��|�'|"��sf|�d4t|!�d��|�(|"|�|t)|"f�q"n2|�}|dk�r�|�d+��|�d5|t|�d���nd|d6k�r�d}�nR|dk�r|jdk�r�|�d7|��| ��|�d2k�r�q"�q�q"�n|d8k�r�d}#|d-k�r||�}|dk�r>|�d+��|d9k�r`|�d:|t|�d��d%}#|j*}$|$dk�r||j+|_*t,||||d�}|#dk�r�|$dk�r�d|_*|d2��s�|�d;|��| ��|d1k�r�|t-|#|ff�q"|t.|#|ff�q"�n$|d)k�
rj|�$d2d/�}%|%�%��	rL|j&�|%�}&|&dk�	r�d3|%}|�|t|%�d��n�zt|%�}&|&dk�	rdt/�Wn4t/k
�	r�d0|%}|�|t|%�d�d�YnX|&�	s�|�d<t|%�d��|&t0k�	r�d=|&}|�|t|%�d��|�(|&|�t1||||d�}'|�d>��
r0t1||||d�}(|jd>k�
r4|�d?��nd}(|�d2��
sT|�d;|��| ��|t2|&|'|(ff�q"n�|t3k�
s~|dk�rt4|||�})|)dk�
r�|�
r�|�
r�ddl}|j
d@|j5ddA�t|j5�dAk�
r�dBnd ft6|d	d
�|j7t8@r"|s"t9�q"|)\}}d}n|�dC|t|�d��|dk	�rrz|�:|!�}Wn<tk
�rp}*z|�|*j;t|!�d�d�W5d}*~*XYnX|�s�|t8@�o�|t8@}+t,|||+|d�}|�d2��s�|�d;|��| ��|dk	�r�|�<||�|t ||||ff�q"|dk�r|tt=f�q"|dDk�r|tt>f�q"tdE|f��q"t?t|��ddd%�D]N},||,\}-}.|-t k�r@|.\}}}}|dk�r@|�s@|�s@|||,|,d�<�q@|S)FNz|)�#rrr�[r<z"Possible nested set at position %dr�)�
stacklevel�^zunterminated character set�]z-&~|zPossible set %s at position %d�-�
difference�&�intersection�~zsymmetric difference�unionz&Possible set difference at position %dr`zbad character range %s-%s�?)rr<r�+r�r�r:�,z"the repetition number is too largez"min repeat greater than max repeatzunsupported quantifier %rr_znothing to repeatzmultiple repeat�.�(Tzunexpected end of pattern�P�<�>�
group name�bad character in group name %r�=�)�unknown group name %rr2zunknown extension ?P�:zmissing ), unterminated commentz=!<z=!zunknown extension ?<z"missing ), unterminated subpatternzbad group numberr�r�z/conditional backref with more than two branchesz-Flags not at the start of the expression %r%s�z (truncated)zunknown extension ?�$z unsupported special character %r)@r6r&r)rzr$r�rt�
WHITESPACEr��
SPECIAL_CHARSr�r��warnings�warn�
FutureWarningr(r�rD�RANGEr��NOT_LITERALr^r��REPEAT_CHARSrar�r�r��
OverflowError�AssertionError�ATrfre�
MIN_REPEAT�
MAX_REPEAT�ANYr��isidentifierrr1r4rhrr%r��ASSERT�
ASSERT_NOTr�r'r�rH�FLAGS�_parse_flagsrr�DeprecationWarningr�SRE_FLAG_VERBOSErr-r�r0�AT_BEGINNING�AT_ENDr})/r3r7r�r��firstr��subpatternappend�	sourcegetr��_len�_ordr{r\�herer��	setappendr��negate�code1�that�code2r�rjrkrbrcrwr�r��	add_flags�	del_flagsr/r�r*r+�dirr�condnamerOrPrQr�err�sub_verboser
rMrNrrrr��s|


�

�
��	


�


��
 












���












�



�


�






�




�





�

�
��

�
*�
�



r�cCs�|j}d}d}|dkr�t|}|jr<|dkrRd}|�|��n|dkrRd}|�|��||O}|t@r||t@|kr|d}|�|��|�}|dkr�|�d��|d	kr�q�|tkr|��r�d
nd}|�|t|���q|dkr�|j|O_dS|t@r�|�dd
��|dk�r�|�}|dk�r|�d��|tk�rF|���r2d
nd}|�|t|���t|}|t@�rfd}|�|��||O}|�}|dk�r�|�d��|dk�r��q�|tk�rF|���r�d
nd}|�|t|����qF|t@�r�|�dd
��||@�r�|�dd
��||fS)Nrr�rz8bad inline flags: cannot use 'L' flag with a str patternrz:bad inline flags: cannot use 'u' flag with a bytes patternz9bad inline flags: flags 'a', 'u' and 'L' are incompatiblezmissing -, : or )z)-:zunknown flagr�z,bad inline flags: cannot turn on global flagr<zmissing flagz8bad inline flags: cannot turn off flags 'a', 'u' and 'L'z	missing :r�z-bad inline flags: cannot turn off global flagz(bad inline flags: flag turned on and off)	r)r�rqr(�
TYPE_FLAGS�isalphar$r�GLOBAL_FLAGS)r3r7rwr�rr�flagr�rrrr�]sl














r�cCsjt|t�r>|t@rtd��|t@s,|tO}qf|t@rftd��n(|t@rNtd��|t@rf|t@rftd��|S)Nz)cannot use LOCALE flag with a str patternz(ASCII and UNICODE flags are incompatiblez,cannot use UNICODE flag with a bytes patternz'ASCII and LOCALE flags are incompatible)rIrC�SRE_FLAG_LOCALEr��SRE_FLAG_ASCII�SRE_FLAG_UNICODE)�srcrrrr�	fix_flags�s


rNcCs�t|�}|dkrt�}||_||_zt|||t@d�}WnBtk
rzt�}|tB|_||_|�d�t||dd�}YnXt||j	j�|j	_|j
dk	r�|�d��|t@r�|�
�|S)NrTzunbalanced parenthesis)rorrrCr�r�rr�rr7rtr(�SRE_FLAG_DEBUGrG)rCrr7r3r/rrr�parse�s&



rcs�t|���j}g�g�g��j}�����fdd�}�j}|�}|dkrL�q�|ddk�r�|d}|dk�rJd}��d�s���d	����d
d�}|��r�z||}	Wn tk
r�t	d|��YnXnlzt
|�}	|	dkr�t�Wn0tk
�r��d
|t|�d�d�YnX|	t
k�r4��d|	t|�d��||	t|�d��q�|dk�r��jtk�r�||�7}�jtk�r�||�7}|tt
|dd�d�d@���q�|tk�rZd}
�jtk�r4||�7}|tk�r4|dtk�r4�jtk�r4||�7}d}
t
|dd�d�}|dk�r(��d|t|���|t|��|
�s�|t
|dd��t|�d�nRztt|d�}Wn4tk
�r�|tk�r���d|t|���YnX||�q:||�q:��rΈ�d����t|t��s�dd��D����fS)NcsX|�jkr��d||���r8��d�����dd�=��t��|f���d�dS)Nr�r:)r%r(r&�joinr$)rWr��r%�literal�literalsrr7rr�addgroup�s

z parse_template.<locals>.addgrouprrr<�gr:r�z	missing <r�r�r�r�r�r�r�r�Fr`Tr�r�cSs"g|]}|dkrdn|�d��qS)Nzlatin-1)�encode)�.0rrrr�
<listcomp>sz"parse_template.<locals>.<listcomp>)ror)r&�
groupindexrzr(r�r�r�rvr�r�r$r'rtr�r�r�r�r�rrIrC)r3r7�sget�lappendrrr{r�r*rW�isoctalrrr�parse_template�s�




��


�


"

�

�� 


rcCsv|j}|jdd�}|\}}|dd�}z"|D]\}}||�p@|||<q.Wn tk
rjtd|��YnX|�|�S)Nrr�)r�rrrvr(r)�templaterzr�emptyr%rrWr�rrr�expand_templatesr")F)rN)=�__doc__�
sre_constantsr�r��	frozensetr�r�r�r�r�r�r�rfr�r�rDr�r��CATEGORYrgr�r�r�ZAT_BEGINNING_STRINGZAT_BOUNDARYZAT_NON_BOUNDARYZCATEGORY_DIGITZCATEGORY_NOT_DIGITZCATEGORY_SPACEZCATEGORY_NOT_SPACEZ
CATEGORY_WORDZCATEGORY_NOT_WORDZ
AT_END_STRINGr��SRE_FLAG_IGNORECASEr�SRE_FLAG_MULTILINE�SRE_FLAG_DOTALLr�r�SRE_FLAG_TEMPLATEr
r�rrr	�	Exceptionrrr6ror�r�r�r�r�r�rrrr"rrrr�<module>sr







���
#rH<M:
r<
 U__pycache__/sysconfig.cpython-38.opt-1.pyc000064400000036751151153537550014375 0ustar00U

��.e@a�
@sdZddlZddlZddlmZmZdddddd	d
ddd
dgZdhZddddddddd�ddddddddd�ddddddd dd�d!d!d"d"d#d$d%d&�d'd'd(d)d*d+d%d&�d,d,d-d-d.d+d%d&�d/�Zd&Z	ej
��dZd0ej
dd1�Zd2ej
dd1�Zej�ej�Zej�ej�Zej�ej�Zej�ej�ZdadZd3d4�Zej�rVej�eej��Znee� ��Zej!d5k�r�e�"��#d6��r�eej�$eee��Zd7ej%k�r�eej%d7�Zd8d9�Z&e'ed:d�Z(ej!d5k�r�d;d<�Z)e)e�Ze)e(�Z(djd>d?�Z*e*d@�Z+e+�r dAD]Z,dBee,dC<dDee,dE<�qdFdG�Z-dHdI�Z.dJdK�Z/dLdM�Z0dNdO�Z1dkdPdQ�Z2dRd�Z3dSdT�Z4dUdV�Z5dWdX�Z6dYdZ�Z7dld[d�Z8d\d�Z9d]d
�Z:d^d	�Z;e0�dd@fd_d
�Z<e0�dd@fd`d�Z=dad�Z>dbd�Z?dcd�Z@ddd�ZAdedf�ZBdgdh�ZCeDdik�reC�dS)mz-Access to Python's configuration information.�N)�pardir�realpath�get_config_h_filename�get_config_var�get_config_vars�get_makefile_filename�get_path�get_path_names�	get_paths�get_platform�get_python_version�get_scheme_names�parse_config_hZMACOSX_DEPLOYMENT_TARGETz/{installed_base}/lib64/python{py_version_short}z){platbase}/lib64/python{py_version_short}z1{base}/lib/python{py_version_short}/site-packagesz7{platbase}/lib64/python{py_version_short}/site-packagesz;{installed_base}/include/python{py_version_short}{abiflags}z?{installed_platbase}/include/python{py_version_short}{abiflags}z
{base}/binz{base})�stdlib�
platstdlib�purelib�platlib�include�platinclude�scripts�dataz{installed_base}/lib/pythonz{base}/lib/pythonz{installed_base}/include/pythonz{installed_base}/Libz
{base}/Libz{base}/Lib/site-packagesz{installed_base}/Includez{base}/Scriptsz#{userbase}/Python{py_version_nodot}z1{userbase}/Python{py_version_nodot}/site-packagesz+{userbase}/Python{py_version_nodot}/Includez+{userbase}/Python{py_version_nodot}/Scriptsz
{userbase})rrrrrrrz){userbase}/lib64/python{py_version_short}z5{userbase}/lib/python{py_version_short}/site-packagesz7{userbase}/lib64/python{py_version_short}/site-packagesz+{userbase}/include/python{py_version_short}z{userbase}/binz{userbase}/lib/pythonz#{userbase}/lib/python/site-packagesz{userbase}/include)�posix_prefix�
posix_home�ntZnt_userZ
posix_userZosx_framework_user�%d.%d�z%d%dcCs(z
t|�WStk
r"|YSXdS�N)r�OSError)�path�r�!/usr/lib64/python3.8/sysconfig.py�_safe_realpathis
r!r)z\pcbuild\win32z\pcbuild\amd64Z_PYTHON_PROJECT_BASEcCs,dD]"}tj�tj�|d|��rdSqdS)N)ZSetupzSetup.localZModulesTF)�osr�isfile�join)�d�fnrrr �_is_python_source_dir~sr'�_homecCs0|r,tj�|��tj�tj�td���r,tS|S)NZPCbuild)r"r�normcase�
startswithr$�_PREFIX)r%rrr �_fix_pcbuild�s
�r,FcCs|rtrtt�Stt�Sr)�	_sys_homer'�
_PROJECT_BASE)Z
check_homerrr �is_python_build�sr/T)rrz{srcdir}/Includerz{projectbase}/.rc
Csnz|jf|�WStk
rhz|jftj�WYStk
rb}ztd|�d�W5d}~XYnXYnXdS)Nz{%s})�format�KeyErrorr"�environ�AttributeError)�sZ
local_vars�varrrr �_subst_vars�sr6cCs0|��}|��D]\}}||kr"q|||<qdSr)�keys�items)Ztarget_dictZ
other_dictZtarget_keys�key�valuerrr �_extend_dict�s
r;cCsbi}|dkri}t|t��t|��D]4\}}tjdkrFtj�|�}tj�t	||��||<q(|S)N)�posixr)
r;r�_INSTALL_SCHEMESr8r"�namer�
expanduser�normpathr6)�scheme�vars�resr9r:rrr �_expand_vars�s
rDcCstjdkrdStjS)Nr<r)r"r>rrrr �_get_default_scheme�s
rEcCsztj�dd�}|r|Sdd�}tjdkrBtj�d�p6d}||d�Stjdkrptjrp|dd	tjd
tjdd��S|dd�S)
N�PYTHONUSERBASEcWstj�tjj|��Sr)r"rr?r$)�argsrrr �joinuser�sz_getuserbase.<locals>.joinuserr�APPDATA�~�Python�darwin�Libraryrrz.local)r"r2�getr>�sys�platform�
_framework�version_info)�env_baserH�baserrr �_getuserbase�s


�rUc	Cs`ddl}|�d�}|�d�}|�d�}|dkr2i}i}i}t|dd��}|��}	W5QRX|	D]�}
|
�d�s^|
��d	krzq^|�|
�}|r^|�d
d�\}}
|
��}
|
�dd	�}d
|kr�|
||<q^z|t	kr�t
�t|
�}
Wn$t
k
r�|
�dd
�||<Yq^X|
||<q^t|�
��}d}t|�dk�r&t|�D�]�}||}|�|�}|�|�}|�rv|�rv|��|��k�rp|n|}n|�r�|n|}|dk	�r|�d
�}d}||k�r�t||�}n�||k�r�d}nx|tjk�r�tj|}n`||k�r0|�d��r
|dd�|k�r
d	}n$d||k�rd}nt|d|�}nd	||<}|�r||��d�}|d|���||}d
|k�r~|||<n�z|t	k�r�t
�t|�}Wn"t
k
�r�|��||<Yn
X|||<|�|�|�d��r|dd�|k�r|dd�}||k�r|||<n|||<|�|��q,�q|��D]"\}}
t|
t��r.|
��||<�q.|�|�|S)z�Parse a Makefile-style file.

    A dictionary containing name/value pairs is returned.  If an
    optional dictionary is passed in as the second argument, it is
    used instead of a new dictionary.
    rNz"([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)z\$\(([A-Za-z][A-Za-z0-9_]*)\)z\${([A-Za-z][A-Za-z0-9_]*)}�surrogateescape)�errors�#��rz$$�$)ZCFLAGSZLDFLAGSZCPPFLAGSTFZPY_�)�re�compile�open�	readlinesr*�strip�match�group�replace�_ALWAYS_STR�
ValueError�int�listr7�len�tuple�search�start�strr"r2�end�remover8�
isinstance�update)�filenamerBr]Z_variable_rxZ_findvar1_rxZ_findvar2_rxZdoneZnotdone�f�lines�line�m�n�vZtmpvZ	variablesZrenamed_variablesr>r:Zm1Zm2�found�itemZafter�krrr �_parse_makefile�s�	












�



�


r|cCsdtrtj�tptd�Sttd�r0dttj	f}nd}ttj
d�rP|dtj
j7}tj�td�|d�S)z Return the path of the Makefile.ZMakefile�abiflagszconfig-%s%sZconfig�
_multiarchz-%sr)
�
_PYTHON_BUILDr"rr$r-r.�hasattrrO�_PY_VERSION_SHORTr}�implementationr~r)Zconfig_dir_namerrr rWs
c
Cs(tj�ddjtjtjttjdd�d��S)NZ_PYTHON_SYSCONFIGDATA_NAMEz+_sysconfigdata_{abi}_{platform}_{multiarch}r~rY)ZabirPZ	multiarch)	r"r2rNr0rOr}rP�getattrr�rrrr �_get_sysconfigdata_nameds��r�c
Cs�ddl}i}t�}zt||�WnJtk
rj}z,d|}t|d�rR|d|j}t|��W5d}~XYnXt�}z"t|��}t||�W5QRXWnJtk
r�}z,d|}t|d�r�|d|j}t|��W5d}~XYnXt	r�|d|d<t
�}dtjk�r$ddl
}|�|�}	||	_|	tj|<d	t�tf}
ttd
��rF|
d7}
tj|
dd
�tj�|
|d�}t|ddd��(}|�d�|�d�|j||d�W5QRXtdddd��}|�|
�W5QRXdS)z;Generate the Python module containing build-time variables.rNz.invalid Python installation: unable to open %s�strerrorz (%s)ZLDSHAREDZ	BLDSHAREDrLzbuild/lib.%s-%sZgettotalrefcountz-pydebugT)�exist_okz.py�w�utf8)�encodingzB# system configuration generated and used by the sysconfig module
zbuild_time_vars = )�streamzpybuilddir.txt)�pprintrr|rr�r�rr_rrr�rOrP�types�
ModuleType�build_time_vars�modulesrr�r"�makedirsrr$�write)r�rBZmakefile�e�msgZconfig_hrsr>r��moduleZ
pybuilddirZdestfilerrr �_generate_posix_varsmsL







r�cCs0t�}t|t�t�dgd�}|j}|�|�dS)z7Initialize the module as appropriate for POSIX systems.r�rN)r��
__import__�globals�localsr�rq)rBr>Z_tempr�rrr �_init_posix�sr�cCsfddl}td�|d<td�|d<td�|d<|��d|d	<d
|d<t|d<tj�ttj	��|d
<dS)z+Initialize the module as appropriate for NTrNrZLIBDESTrZ
BINLIBDESTrZ	INCLUDEPY�
EXT_SUFFIXz.exeZEXEZVERSIONZBINDIR)
�_impr�extension_suffixes�_PY_VERSION_SHORT_NO_DOTr"r�dirnamer!rO�
executable)rBr�rrr �_init_non_posix�sr�c	Cs�|dkri}ddl}|�d�}|�d�}|��}|s6q�|�|�}|r�|�dd�\}}z|tkrbt�t|�}Wntk
r�YnX|||<q(|�|�}|r(d||�d�<q(|S)z�Parse a config.h-style file.

    A dictionary containing name/value pairs is returned.  If an
    optional dictionary is passed in as the second argument, it is
    used instead of a new dictionary.
    Nrz"#define ([A-Z][A-Za-z0-9_]+) (.*)
z&/[*] #undef ([A-Z][A-Za-z0-9_]+) [*]/
rZr)r]r^�readlinerbrcrerfrg)	�fprBr]Z	define_rxZundef_rxrurvrwrxrrr r�s,




cCsBtr,tjdkr"tj�tptd�}q4tp(t}ntd�}tj�|d�S)zReturn the path of pyconfig.h.rZPCrz
pyconfig-64.h)rr"r>rr$r-r.r)Zinc_dirrrr r�s

cCsttt��S)z,Return a tuple containing the schemes names.)rj�sortedr=rrrr r
�scCstS)z*Return a tuple containing the paths names.)�_SCHEME_KEYSrrrr r	�scCs|rt||�St|SdS)z�Return a mapping containing an install scheme.

    ``scheme`` is the install scheme name. If not provided, it will
    return the default scheme for the current platform.
    N)rDr=)rArB�expandrrr r
�s
cCst|||�|S)z[Return a path corresponding to the scheme.

    ``scheme`` is the install scheme name.
    )r
)r>rArBr�rrr r	scGsxtdk�rFiattd<ttd<ttd<ttd<ttd<ttd<ttd<ttd	<ttd
<ttd<zt	j
td<Wntk
r�d
td<YnXtj
dkr�tt�tj
dkr�tt�t�d�}|dk	r�|td<t�td<t�dt�}tj
dk�rt�rtj�t��}tj�||�}ntj�t��}t|�td<t	jdk�rFddl}|�t�|�rpg}|D]}|�t�|���qT|StSdS)anWith no arguments, return a dictionary of all configuration
    variables relevant for the current platform.

    On Unix, this means every variable defined in Python's installed Makefile;
    On Windows it's a much smaller set.

    With arguments, return a list of values that result from looking up
    each argument in the configuration variable dictionary.
    N�prefix�exec_prefixZ
py_versionZpy_version_shortZpy_version_nodotZinstalled_baserTZinstalled_platbaseZplatbaseZprojectbaser}rYrr<r��SO�userbase�srcdirrLr)�_CONFIG_VARSr+�_EXEC_PREFIX�_PY_VERSIONr�r��_BASE_PREFIX�_BASE_EXEC_PREFIXr.rOr}r3r"r>r�r�rNrUrrr�rr$r!rP�_osx_supportZcustomize_config_vars�append)rGr�r�rTr�Zvalsr>rrr rsP





cCs*|dkrddl}|�dtd�t��|�S)z�Return the value of a single variable using the dictionary returned by
    'get_config_vars()'.

    Equivalent to get_config_vars().get(name)
    r�rNz SO is deprecated, use EXT_SUFFIXr)�warnings�warn�DeprecationWarningrrN)r>r�rrr r^sc
Cs�tjdkrFdtj��krdSdtj��kr.dSdtj��kr@dStjStjdksZttd	�s`tjSd
tjkrttjd
St��\}}}}}|���	dd�}|�	d
d�}|�	dd�}|dd�dkr�d||fS|dd�dk�r,|ddk�r�d}dt
|d�d|dd�f}ddd�}|d|tj7}n�|dd�dk�rLd |||fS|dd!�d"k�r�d"}ddl}|�
d#�}|�|�}|�r�|��}n2|dd!�d$k�r�ddl}	|	�t�|||�\}}}d%|||fS)&a�Return a string that identifies the current platform.

    This is used mainly to distinguish platform-specific build directories and
    platform-specific built distributions.  Typically includes the OS name and
    version and the architecture (as supplied by 'os.uname()'), although the
    exact information included depends on the OS; on Linux, the kernel version
    isn't particularly important.

    Examples of returned values:
       linux-i586
       linux-alpha (?)
       solaris-2.6-sun4u

    Windows will return one of:
       win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc)
       win32 (all others - specifically, sys.platform is returned)

    For other non-POSIX platforms, currently just returns 'sys.platform'.

    rZamd64z	win-amd64z(arm)z	win-arm32z(arm64)z	win-arm64r<�unameZ_PYTHON_HOST_PLATFORM�/rY� �_�-N�Zlinuxz%s-%sZsunosr�5Zsolarisz%d.%sr\rZ32bitZ64bit)i���l����z.%sZaixz%s-%s.%s��cygwinz[\d.]+rLz%s-%s-%s)r"r>rO�version�lowerrPr�r2r�rdrg�maxsizer]r^rbrcr�Zget_platform_osxr)
ZosnameZhost�releaser��machineZbitnessr]Zrel_rervr�rrr rjsT


 



�
cCstSr)r�rrrr r�scCsFtt|����D]0\}\}}|dkr0td|�td||f�qdS)Nrz%s: z
	%s = "%s")�	enumerater�r8�print)�titler�indexr9r:rrr �_print_dict�sr�cCsfdtjkrt�dStdt��tdt��tdt��t�tdt��t�tdt	��dS)z*Display all information sysconfig detains.z--generate-posix-varsNzPlatform: "%s"zPython version: "%s"z!Current installation scheme: "%s"ZPathsZ	Variables)
rO�argvr�r�rrrEr�r
rrrrr �_main�s
r��__main__)F)N)N)E�__doc__r"rOZos.pathrr�__all__rer=r�r��splitr�rRr�r�rr@r�r+�base_prefixr�r�r��base_exec_prefixr�r�Z
_USER_BASEr!r�r�r.�getcwdr>r��endswithr$r2r'r�r-r,r/rrAr6r;rDrErUr|rr�r�r�r�rrr
r	r
rrrrrr�r��__name__rrrr �<module>s����
���
�
��?�
	
	

	?
"MP
__pycache__/struct.cpython-38.pyc000064400000000514151153537550012742 0ustar00U

e5d�@s8ddddddddgZdd	lTdd
lmZddlmZdS)
ZcalcsizeZpackZ	pack_intoZunpackZunpack_fromZiter_unpackZStruct�error�)�*)�_clearcache)�__doc__N)�__all__Z_structrr�rr�/usr/lib64/python3.8/struct.py�<module>s�__pycache__/symtable.cpython-38.opt-1.pyc000064400000025736151153537550014212 0ustar00U

e5dU�	@sJdZddlZddlmZmZmZmZmZmZmZm	Z	m
Z
mZmZm
Z
mZmZmZddlZdddddgZd	d�ZGd
d�d�Ze�ZGdd�d�ZGd
d�de�ZGdd�de�ZGdd�d�Zedk�rFddlZddlZeejd��Ze� �Z!W5QRXee!ej"�#ejd�dd�Z$e$�%�D]$Z&e$�'e&�Z(e)e(e(�*�e(�+���q dS)z2Interface to the compiler's internal symbol tables�N)�USE�
DEF_GLOBAL�DEF_NONLOCAL�	DEF_LOCAL�	DEF_PARAM�
DEF_IMPORT�	DEF_BOUND�	DEF_ANNOT�	SCOPE_OFF�
SCOPE_MASK�FREE�LOCAL�GLOBAL_IMPLICIT�GLOBAL_EXPLICIT�CELL�symtable�SymbolTable�Class�Function�SymbolcCst�|||�}t||�S�N)�	_symtabler�_newSymbolTable)�code�filenameZcompile_type�top�r� /usr/lib64/python3.8/symtable.pyrsc@s$eZdZdd�Zdd�Zdd�ZdS)�SymbolTableFactorycCst��|_dSr)�weakrefZWeakValueDictionary�_SymbolTableFactory__memo��selfrrr�__init__szSymbolTableFactory.__init__cCs6|jtjkrt||�S|jtjkr,t||�St||�Sr)�typer�
TYPE_FUNCTIONr�
TYPE_CLASSrr)r"�tablerrrr�news


zSymbolTableFactory.newcCs8||f}|j�|d�}|dkr4|�||�}|j|<|Sr)r �getr()r"r'r�key�objrrr�__call__s
zSymbolTableFactory.__call__N)�__name__�
__module__�__qualname__r#r(r,rrrrrsrc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZdS) rcCs||_||_i|_dSr)�_table�	_filename�_symbols)r"Z	raw_tablerrrrr#'szSymbolTable.__init__cCsN|jtkrd}nd|jj}|jjdkr6d�||j�Sd�||jj|j�SdS)N�z%s rz<{0}SymbolTable for module {1}>z<{0}SymbolTable for {1} in {2}>)�	__class__rr-r0�name�formatr1)r"Zkindrrr�__repr__,s
�zSymbolTable.__repr__cCs:|jjtjkrdS|jjtjkr$dS|jjtjkr6dSdS)N�moduleZfunction�class)r0r$rZTYPE_MODULEr%r&r!rrr�get_type9szSymbolTable.get_typecCs|jjSr)r0�idr!rrr�get_idCszSymbolTable.get_idcCs|jjSr)r0r5r!rrr�get_nameFszSymbolTable.get_namecCs|jjSr)r0�linenor!rrr�
get_linenoIszSymbolTable.get_linenocCst|jjtjk�Sr)�boolr0r$rr%r!rrr�is_optimizedLszSymbolTable.is_optimizedcCst|jj�Sr)r@r0�nestedr!rrr�	is_nestedOszSymbolTable.is_nestedcCst|jj�Sr)r@r0�childrenr!rrr�has_childrenRszSymbolTable.has_childrencCsdS)z7Return true if the scope uses exec.  Deprecated method.Frr!rrr�has_execUszSymbolTable.has_execcCs|jj��Sr)r0�symbols�keysr!rrr�get_identifiersYszSymbolTable.get_identifierscCsT|j�|�}|dkrP|jj|}|�|�}|jjdk}t||||d�}|j|<|S)Nr��module_scope)r2r)r0rG�_SymbolTable__check_childrenr5r)r"r5Zsym�flags�
namespacesrKrrr�lookup\s
�zSymbolTable.lookupcs�fdd����D�S)Ncsg|]}��|��qSr)rO��.0�identr!rr�
<listcomp>gsz+SymbolTable.get_symbols.<locals>.<listcomp>)rIr!rr!r�get_symbolsfszSymbolTable.get_symbolscs��fdd��jjD�S)Ncs"g|]}|j�krt|�j��qSr)r5rr1�rQ�st�r5r"rrrSjs
�z0SymbolTable.__check_children.<locals>.<listcomp>�r0rD)r"r5rrWrZ__check_childrenis�zSymbolTable.__check_childrencs�fdd��jjD�S)Ncsg|]}t|�j��qSr)rr1rUr!rrrSos�z,SymbolTable.get_children.<locals>.<listcomp>rXr!rr!r�get_childrenns
�zSymbolTable.get_childrenN)r-r.r/r#r7r:r<r=r?rArCrErFrIrOrTrLrYrrrrr%s


c@sPeZdZdZdZdZdZdZdd�Zdd�Z	dd�Z
dd	�Zd
d�Zdd
�Z
dS)rNcst��fdd����D��S)Nc3s"|]}��jj|�r|VqdSr)r0rGrP�r"Z	test_funcrr�	<genexpr>}s�z-Function.__idents_matching.<locals>.<genexpr>)�tuplerIrZrrZrZ__idents_matching|szFunction.__idents_matchingcCs |jdkr|�dd��|_|jS)NcSs|t@Sr)r��xrrr�<lambda>��z)Function.get_parameters.<locals>.<lambda>)�_Function__params�_Function__idents_matchingr!rrr�get_parameters�s
zFunction.get_parameterscs0|jdkr*ttf��fdd�}|�|�|_|jS)Ncs|t?t@�kSr�r
rr]�Zlocsrrr_�r`z%Function.get_locals.<locals>.<lambda>)�_Function__localsr
rrb�r"Ztestrrer�
get_locals�s

zFunction.get_localscs0|jdkr*ttf��fdd�}|�|�|_|jS)Ncs|t?t@�kSrrdr]�Zglobrrr_�r`z&Function.get_globals.<locals>.<lambda>)�_Function__globalsrrrbrgrrir�get_globals�s

zFunction.get_globalscCs |jdkr|�dd��|_|jS)NcSs|t@Sr)rr]rrrr_�r`z(Function.get_nonlocals.<locals>.<lambda>)�_Function__nonlocalsrbr!rrr�
get_nonlocals�s
zFunction.get_nonlocalscCs$|jdkrdd�}|�|�|_|jS)NcSs|t?t@tkSr)r
rrr]rrrr_�r`z$Function.get_frees.<locals>.<lambda>)�_Function__freesrb)r"�is_freerrr�	get_frees�s
zFunction.get_frees)r-r.r/rarfrnrjrlrbrcrhrkrmrprrrrrssc@seZdZdZdd�ZdS)rNcCs6|jdkr0i}|jjD]}d||j<qt|�|_|jS)N�)�_Class__methodsr0rDr5r\)r"�drVrrr�get_methods�s

zClass.get_methods)r-r.r/rrrtrrrrr�sc@s�eZdZd$dd�dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd d!�Zd"d#�ZdS)%rNFrJcCs.||_||_|t?t@|_|p d|_||_dS)Nr)�
_Symbol__name�_Symbol__flagsr
r�_Symbol__scope�_Symbol__namespaces�_Symbol__module_scope)r"r5rMrNrKrrrr#�s

zSymbol.__init__cCsd�|j�S)Nz<symbol {0!r}>)r6rur!rrrr7�szSymbol.__repr__cCs|jSr)rur!rrrr=�szSymbol.get_namecCst|jtj@�Sr)r@rvrrr!rrr�
is_referenced�szSymbol.is_referencedcCst|jt@�Sr)r@rvrr!rrr�is_parameter�szSymbol.is_parametercCs"t|jttfkp|jo|jt@�S)z0Return *True* if the sysmbol is global.
        )r@rwrrryrvrr!rrr�	is_global�s�zSymbol.is_globalcCst|jt@�Sr)r@rvrr!rrr�is_nonlocal�szSymbol.is_nonlocalcCst|jtk�Sr)r@rwrr!rrr�is_declared_global�szSymbol.is_declared_globalcCs"t|jttfkp|jo|jt@�S)z.Return *True* if the symbol is local.
        )r@rwr
rryrvrr!rrr�is_local�s�zSymbol.is_localcCst|jt@�Sr)r@rvr	r!rrr�is_annotated�szSymbol.is_annotatedcCst|jtk�Sr)r@rwrr!rrrro�szSymbol.is_freecCst|jt@�Sr)r@rvrr!rrr�is_imported�szSymbol.is_importedcCst|jt@�Sr)r@rvrr!rrr�is_assigned�szSymbol.is_assignedcCs
t|j�S)a�Returns true if name binding introduces new namespace.

        If the name is used as the target of a function or class
        statement, this will be true.

        Note that a single name can be bound to multiple objects.  If
        is_namespace() is true, the name may also be bound to other
        objects, like an int or list, that does not introduce a new
        namespace.
        )r@rxr!rrr�is_namespace�szSymbol.is_namespacecCs|jS)z.Return a list of namespaces bound to this name)rxr!rrr�get_namespaces�szSymbol.get_namespacescCs t|j�dkrtd��|jdS)z�Returns the single namespace bound to this name.

        Raises ValueError if the name is bound to multiple namespaces.
        rqz$name is bound to multiple namespacesr)�lenrx�
ValueErrorr!rrr�
get_namespace�szSymbol.get_namespace)N)r-r.r/r#r7r=rzr{r|r}r~rr�ror�r�r�r�r�rrrrr�s 
�__main__rq�exec),�__doc__rrrrrrrrr	r
rrr
rrrr�__all__rrrrrrrr-�os�sys�open�argv�f�read�src�path�split�modrIrRrO�info�printrr�rrrr�<module>s&DN,
M

__pycache__/_bootlocale.cpython-38.pyc000064400000002335151153537550013703 0ustar00U

e5d	�@szdZddlZddlZej�d�r,ddd�ZnJz
ejWn4ek
rjeed�r\ddd�Zn
d
d	d�ZYnXdd
d�ZdS)z�A minimal subset of the locale module used at interpreter startup
(imported by the _io module), in order to reduce startup time.

Don't import directly from third-party code; use the `locale` module instead!
�N�winTcCstjjrdSt��dS)N�UTF-8�)�sys�flags�	utf8_mode�_localeZ_getdefaultlocale��do_setlocale�r�#/usr/lib64/python3.8/_bootlocale.py�getpreferredencodingsr
ZgetandroidapilevelcCsdS)Nrrr	rrrr
scCstjjrdSddl}|�|�S)Nrr)rrr�localer
)r
rrrrr
scCs6|rt�tjjrdSt�tj�}|s2tjdkr2d}|S)Nr�darwin)�AssertionErrorrrrr�nl_langinfo�CODESET�platform)r
�resultrrrr
!s)T)T)T)T)	�__doc__rrr�
startswithr
r�AttributeError�hasattrrrrr�<module>s

__pycache__/stringprep.cpython-38.opt-1.pyc000064400000025321151153537550014555 0ustar00U

e5du2��@s�dZddlmZdd�Zeddddd	d
ddd
ddgeedd���Zdd�Zddddddddddddd d!d"d#d$d%d&d'dd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCd<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdDdEdFdGdHdIdJdKdLdMdNdOdPdMddQdRdSdTdUdRdVddWdXdYddZd[d\d]d^d_d`dad^dbdcdddedfdgdgdgdhdhdidjdkdldmdndndndodpdqdrdrdsdcdtdudvdwd%dxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d|d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�dsdcdxdtdud�dgdhd�d�didvdjd�dldmdndd�d�d�d�d�d�drd�dsdcdxdtdud�dgdhd�d�didvdjd�dldmdndd�d�d�d�d�d�drd�dsdcdxdtdud�dgdhd�d�didvdjd�dldmdndd�d�d�d�d�d�drd�dcdxd�d�d�djd�dldmdd�d�d�d�d�d�drd�dsdcdxdtdud�dgdhd�d�didvdjd�dldmdndd�d�d�d�d�d�drd�dsdxdtdud�d�d�didvdjd�dldmdd�d�d�d�d�d�d�dsdxdtdud�dhd�d�didvd�dd�d�d�d�d�d�d�dsdcdxdtdud�dgdhd�d�didvdjd�dldmdndd�d�d�d�d�d�drd�dsdcdxdtdud�dgdhd�d�didvdjd�dldmdndd�d�d�d�d�d�drd�dsdcdxdtdud�dgdhd�d�didvdjd�dldmdndd�d�d�d�d�d�drd�dsdcdxdtdud�dgdhd�d�didvdjd�dldmdndd�d�d�d�d�d�drd�dsdcdxdtdud�dgdhd�d�didvdjd�dldmdndd�d�d�d�d�d�drd�dsdcdxdtdud�dgdhd�d�didvdjd�dldmdndd�d�d�d�d�d�drd�ddwd�d(d�d�d dd&d�dd�d�d�d%d'd dd�d!d$d�d�d�dd�ddwd�d(d�d�d dd&d�dd�d�d�d%d'd dd�d!d$d�d�d�dd�ddwd�d(d�d�d dd&d�dd�d�d�d%d'd dd�d!d$d�d�d�dd�ddwd�d(d�d�d dd&d�dd�d�d�d%d'd dd�d!d$d�d�d�dd�ddwd�d(d�d�d dd&d�dd�d�d�d%d'd dd�d!d$d�d�d�ddʐ��Z	d�d̄Z
d�d΄Zd�dЄZd�d҄Z
d�dԄZd�dքZed�d�d�dd
d�d�dgeedd܃�eed�dރ�eed�d��eed�d���Zd�d�Zd�d�Zd�d�Zd�d�Zd�d�Zeed�d��Zd�d�Zeed�d��Zd�d�Zed�d�d�d�geed�d���eed�dރ��Zd�d��Zed�geed�d����Zd��d�Z�d�d�Z�d�d�Z�dS(z�Library that exposes various tables found in the StringPrep RFC 3454.

There are two kinds of tables: sets, for which a member test is provided,
and mappings, for which a mapping function is provided.
�)�	ucd_3_2_0cCsBt�|�dkrdSt|�}d|kr.dkr6nndS|d@dkS)NZCnF�������r)�unicodedata�category�ord��code�c�r�"/usr/lib64/python3.8/stringprep.py�in_table_a1sr�iOiiii
i i i
 i` i��i�i�cCst|�tkS�N)r
�b1_set�rrrr�in_table_b1sruμZssui̇uʼn�suǰuιu ιuΐuΰuσuβuθuυuύuϋuφuπuκuρuεuեւuẖuẗuẘuẙuaʾuṡuὐuὒuὔuὖuἀιuἁιuἂιuἃιuἄιuἅιuἆιuἇιuἠιuἡιuἢιuἣιuἤιuἥιuἦιuἧιuὠιuὡιuὢιuὣιuὤιuὥιuὦιuὧιuὰιuαιuάιuᾶuᾶιuὴιuηιuήιuῆuῆιuῒuῖuῗuῢuῤuῦuῧuὼιuωιuώιuῶuῶιZrsr
u°cuɛu°f�h�i�l�nZno�p�q�rZsmZtelZtm�z�b�e�f�muγ�dZhpaZauZovZpaZnauμaZmaZkaZkbZmbZgbZpfZnfuμf�hzZkhzZmhzZghzZthzZkpaZmpaZgpaZpvZnvuμvZmvZkvZpwZnwuμwZmw�kwukωumωZbquc∕kgzco.ZdbZgyZhpZkkZkmZphZppmZprZsv�wbZffZfiZflZffiZffl�stuմնuմեuմիuվնuմխ�a�g�j�k�o�t�u�v�w�x�yuαuδuζuηuλuνuξuοuτuχuψuω(����i0iIii�iEizi�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�iPiRiTiVi�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i� i!i!i!i	!i!i!i
!i!i!i!i!i!i!i!i!i!i!i !i!!i"!i$!i(!i,!i-!i0!i1!i3!i>!i?!iE!iq3is3iu3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i	�i
�i�i�i
�i�i�i�i�i�i�i�i�i�i�i�i�i4�i5�i6�i7�i8�i9�i:�i;�i<�i=�i>�i?�i@�iA�iB�iC�iD�iE�iF�iG�iH�iI�iJ�iK�iL�iM�ih�ii�ij�ik�il�im�in�io�ip�iq�ir�is�it�iu�iv�iw�ix�iy�iz�i{�i|�i}�i~�i�i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i�i�i�i�i	�i
�i
�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i8�i9�i;�i<�i=�i>�i@�iA�iB�iC�iD�iF�iJ�iK�iL�iM�iN�iO�iP�il�im�in�io�ip�iq�ir�is�it�iu�iv�iw�ix�iy�iz�i{�i|�i}�i~�i�i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i�i	�i
�i�i�i
�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i �i!�i<�i=�i>�i?�i@�iA�iB�iC�iD�iE�iF�iG�iH�iI�iJ�iK�iL�iM�iN�iO�iP�iQ�iR�iS�iT�iU�ip�iq�ir�is�it�iu�iv�iw�ix�iy�iz�i{�i|�i}�i~�i�i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i
�i�i�i�i�i �i!�i"�i#�i$�i%�i&�i'�i(�i)�i*�i+�i,�i-�i.�i/�i0�i1�i2�i3�i4�iG�iV�iW�iX�iY�iZ�i[�i\�i]�i^�i_�i`�ia�ib�ic�id�ie�if�ig�ih�ii�ij�ik�il�im�in�i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��cCs"t�t|��}|dk	r|S|��Sr)�
b3_exceptions�getr
�lower)rrrrr�map_table_b3�sr8cCsHt|�}t�d|�}d�dd�|D��}t�d|�}||kr@|S|SdS)NZNFKC�cSsg|]}t|��qSr)r8)�.0Zchrrr�
<listcomp>�sz map_table_b2.<locals>.<listcomp>)r8rZ	normalize�join)r(ZalrZblr
rrr�map_table_b2�sr=cCs|dkS)N� rrrrr�in_table_c11�sr?cCst�|�dko|dkS)N�Zsr>�rr	rrrr�in_table_c12�srBcCst�|�dkS)Nr@rArrrr�in_table_c11_c12�srCcCst|�dkot�|�dkS)N��Cc)r
rr	rrrr�in_table_c21�srFi�iii( i) id ij ip i��i��is�i{�cCs.t|�}|dkrdSt�|�dkr&dS|tkS)NrDFrET)r
rr	�c22_specialsrrrr�in_table_c22�srHcCst�|�dkpt|�tkS)NrE)rr	r
rGrrrr�in_table_c21_c22�s
�rIcCst�|�dkS)NZCorArrrr�in_table_c3�srJcCs0t|�}|dkrdS|dkr dSt|�d@dkS)NrFrTrr)r
rrrr�in_table_c4�srKcCst�|�dkS)NZCsrArrrr�in_table_c5�srLrcCst|�tkSr)r
�c6_setrrrr�in_table_c6�srNi�/i�/cCst|�tkSr)r
�c7_setrrrr�in_table_c7�srPi@iAi i i* i/ cCst|�tkSr)r
�c8_setrrrr�in_table_c8srRii i�cCst|�tkSr)r
�c9_setrrrr�in_table_c9srTcCst�|�dkS)N)�RZAL�rZ
bidirectionalrrrr�in_table_d1srWcCst�|�dkS)N�LrVrrrr�in_table_d2srYN) �__doc__rrr�set�list�rangerrr5r8r=r?rBrCrFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrWrYrrrr�<module>sN,��&P,
__pycache__/ipaddress.cpython-38.opt-2.pyc000064400000106453151153537550014345 0ustar00U

e5d��@s�dZddlZdZdZGdd�de�ZGdd�de�Zd	d
�Zd<dd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�ZGd"d#�d#�ZejGd$d%�d%e��ZejGd&d'�d'e��ZGd(d)�d)�ZGd*d+�d+ee�ZGd,d-�d-e�ZGd.d/�d/ee�ZGd0d1�d1�Zee_Gd2d3�d3�ZGd4d5�d5ee�ZGd6d7�d7e�ZGd8d9�d9ee�Z Gd:d;�d;�Z!e!e_dS)=z1.0�N� �c@seZdZdS)�AddressValueErrorN��__name__�
__module__�__qualname__�r	r	�!/usr/lib64/python3.8/ipaddress.pyrsrc@seZdZdS)�NetmaskValueErrorNrr	r	r	r
rsrc	CsXz
t|�WSttfk
r"YnXz
t|�WSttfk
rFYnXtd|��dS)Nz0%r does not appear to be an IPv4 or IPv6 address)�IPv4Addressrr�IPv6Address�
ValueError��addressr	r	r
�
ip_addresss

�rTc	Cs\zt||�WSttfk
r$YnXzt||�WSttfk
rJYnXtd|��dS)Nz0%r does not appear to be an IPv4 or IPv6 network)�IPv4Networkrr�IPv6Networkr)r�strictr	r	r
�
ip_network9s�rc	CsXz
t|�WSttfk
r"YnXz
t|�WSttfk
rFYnXtd|��dS)Nz2%r does not appear to be an IPv4 or IPv6 interface)�
IPv4Interfacerr�
IPv6Interfacerrr	r	r
�ip_interfaceWs

�rcCs0z|�dd�WStk
r*td��YnXdS)N��bigz&Address negative or too large for IPv4��to_bytes�
OverflowErrorrrr	r	r
�v4_int_to_packedzsrcCs0z|�dd�WStk
r*td��YnXdS)N�rz&Address negative or too large for IPv6rrr	r	r
�v6_int_to_packed�s
r cCs*t|��d�}t|�dkr&td|��|S)N�/�zOnly one '/' permitted in %r)�str�split�lenr)r�addrr	r	r
�_split_optional_netmask�sr'ccsNt|�}t|�}}|D]&}|j|jdkr:||fV|}|}q||fVdS�N�)�iter�next�_ip)�	addresses�it�first�last�ipr	r	r
�_find_address_range�s

r2cCs$|dkr|St|||d@���S)Nrr))�min�
bit_length)Znumber�bitsr	r	r
�_count_righthand_zero_bits�sr6ccs�t|t�rt|t�std��|j|jkr8td||f��||krHtd��|jdkrXt}n|jdkrht}ntd��|j}|j}|j}||kr�t	t
||�||d��d�}||||f�}|V|d|>7}|d|jkr�q�q�dS)Nz1first and last must be IP addresses, not networks�%%s and %s are not of the same versionz*last IP address must be greater than firstr�zunknown IP versionr))
�
isinstance�_BaseAddress�	TypeError�versionrrr�_max_prefixlenr,r3r6r4�	_ALL_ONES)r/r0r1Zip_bitsZ	first_intZlast_intZnbits�netr	r	r
�summarize_address_range�s8
��


�r@ccs�t|�}i}|rV|��}|��}|�|�}|dkr<|||<q||kr||=|�|�qd}t|���D]$}|dk	r�|j|jkr�qf|V|}qfdS�N)�list�pop�supernet�get�append�sorted�values�broadcast_address)r-Zto_merge�subnetsr?rDZexistingr0r	r	r
�_collapse_addresses_internals$

rKc	Cs0g}g}g}|D]�}t|t�rR|rF|dj|jkrFtd||df��|�|�q|j|jkr�|r�|dj|jkr�td||df��z|�|j�Wq�tk
r�|�|j	�Yq�Xq|r�|dj|jkr�td||df��|�|�qt
t|��}|�r$t|�D]\}}|�
t||���qt||�S)N���r7)r9r:�_versionr;rF�
_prefixlenr=r1�AttributeError�network_addressrG�setr2�extendr@rK)r-ZaddrsZipsZnetsr1r/r0r	r	r
�collapse_addresses2s@
���rScCs(t|t�r|��St|t�r$|��StSrA)r9�_BaseNetwork�_get_networks_keyr:�_get_address_key�NotImplemented)�objr	r	r
�get_mixed_type_keyhs


rYc@s�eZdZdZedd��Zedd��Zedd��Zedd	��Zd
d�Z	dd
�Z
edd��Zedd��Z
edd��Zedd��Zedd��Zedd��Zdd�ZdS)�_IPAddressBaser	cCs|��SrA)�_explode_shorthand_ip_string��selfr	r	r
�exploded�sz_IPAddressBase.explodedcCst|�SrA�r#r\r	r	r
�
compressed�sz_IPAddressBase.compressedcCs|��SrA)�_reverse_pointerr\r	r	r
�reverse_pointer�s	z_IPAddressBase.reverse_pointercCsdt|�f}t|��dS)Nz%200s has no version specified��type�NotImplementedError�r]�msgr	r	r
r<�sz_IPAddressBase.versioncCsF|dkrd}t|||jf��||jkrBd}t|||j|jf��dS)Nrz-%d (< 0) is not permitted as an IPv%d addressz2%d (>= 2**%d) is not permitted as an IPv%d address)rrMr>r=)r]rrgr	r	r
�_check_int_address�s

�z!_IPAddressBase._check_int_addresscCs.t|�}||kr*d}t|||||jf��dS)Nz6%r (len %d != %d) is not permitted as an IPv%d address)r%rrM)r]rZexpected_lenZaddress_lenrgr	r	r
�_check_packed_address�s�z$_IPAddressBase._check_packed_addresscCs|j|j|?ASrA)r>)�cls�	prefixlenr	r	r
�_ip_int_from_prefix�sz"_IPAddressBase._ip_int_from_prefixc	Cs\t||j�}|j|}||?}d|>d}||krX|jd}|�|d�}d}t||��|S)Nr)�rz&Netmask pattern %r mixes zeroes & ones)r6r=rr)	rj�ip_intZtrailing_zeroesrkZleading_onesZall_onesZbyteslenZdetailsrgr	r	r
�_prefix_from_ip_int�s
�

z"_IPAddressBase._prefix_from_ip_intcCsd|}t|�d�dS)Nz%r is not a valid netmask)r)rjZnetmask_strrgr	r	r
�_report_invalid_netmask�sz&_IPAddressBase._report_invalid_netmaskcCsl|��r|��s|�|�zt|�}Wntk
rD|�|�YnXd|kr\|jkshn|�|�|S�Nr)�isascii�isdigitrp�intrr=)rjZ
prefixlen_strrkr	r	r
�_prefix_from_prefix_string�s

z)_IPAddressBase._prefix_from_prefix_stringcCs�z|�|�}Wntk
r,|�|�YnXz|�|�WStk
rNYnX||jN}z|�|�WStk
r�|�|�YnXdSrA)�_ip_int_from_stringrrprorr>)rj�ip_strrnr	r	r
�_prefix_from_ip_string�s
z%_IPAddressBase._prefix_from_ip_stringcCsHt|ttf�r||jfSt|t�s*t|�}t|�dkr:|S|d|jfS)Nr)r)r9�bytesrtr=�tupler'r%)rjrr	r	r
�_split_addr_prefixs

z!_IPAddressBase._split_addr_prefixcCs|jt|�ffSrA)�	__class__r#r\r	r	r
�
__reduce__/sz_IPAddressBase.__reduce__N)rrr�	__slots__�propertyr^r`rbr<rhri�classmethodrlrorprurxr{r}r	r	r	r
rZ�s0




	




!
rZc@s`eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dS)r:r	cCs|jSrA�r,r\r	r	r
�__int__>sz_BaseAddress.__int__cCs8z|j|jko|j|jkWStk
r2tYSXdSrA)r,rMrOrW�r]�otherr	r	r
�__eq__As
�z_BaseAddress.__eq__cCsFt|t�stS|j|jkr*td||f��|j|jkrB|j|jkSdS�Nr7F)r9r:rWrMr;r,r�r	r	r
�__lt__Hs
�z_BaseAddress.__lt__cCs t|t�stS|�t|�|�SrA�r9rtrWr|r�r	r	r
�__add__Ts
z_BaseAddress.__add__cCs t|t�stS|�t|�|�SrAr�r�r	r	r
�__sub__Ys
z_BaseAddress.__sub__cCsd|jjt|�fS�Nz%s(%r)�r|rr#r\r	r	r
�__repr__^sz_BaseAddress.__repr__cCst|�|j��SrA)r#�_string_from_ip_intr,r\r	r	r
�__str__asz_BaseAddress.__str__cCsttt|j���SrA)�hash�hexrtr,r\r	r	r
�__hash__dsz_BaseAddress.__hash__cCs
|j|fSrA�rMr\r	r	r
rVgsz_BaseAddress._get_address_keycCs|j|jffSrA)r|r,r\r	r	r
r}jsz_BaseAddress.__reduce__N)rrrr~r�r�r�r�r�r�r�r�rVr}r	r	r	r
r:3s	r:c@s\eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Ze
jdd��Ze
jdd��Zedd��Zedd��Zedd��Zedd ��Zed!d"��Zed#d$��Zd%d&�Zd'd(�Zd)d*�ZdEd-d.�ZdFd/d0�Zed1d2��Zed3d4��Zd5d6�Z d7d8�Z!ed9d:��Z"ed;d<��Z#ed=d>��Z$ed?d@��Z%edAdB��Z&edCdD��Z'd,S)GrTcCsd|jjt|�fSr�r�r\r	r	r
r�vsz_BaseNetwork.__repr__cCsd|j|jfS�N�%s/%d)rPrkr\r	r	r
r�ysz_BaseNetwork.__str__ccs8t|j�}t|j�}t|d|�D]}|�|�Vq"dSr(�rtrPrI�range�_address_class�r]�network�	broadcast�xr	r	r
�hosts|s

z_BaseNetwork.hostsccs8t|j�}t|j�}t||d�D]}|�|�Vq"dSr(r�r�r	r	r
�__iter__�s

z_BaseNetwork.__iter__cCslt|j�}t|j�}|dkr>|||kr0td��|�||�S|d7}|||krZtd��|�||�SdS)Nrzaddress out of ranger))rtrPrI�
IndexErrorr�)r]�nr�r�r	r	r
�__getitem__�s

z_BaseNetwork.__getitem__cCs^t|t�stS|j|jkr*td||f��|j|jkrB|j|jkS|j|jkrZ|j|jkSdSr�)r9rTrWrMr;rP�netmaskr�r	r	r
r��s
�z_BaseNetwork.__lt__cCsLz.|j|jko,|j|jko,t|j�t|j�kWStk
rFtYSXdSrA)rMrPrtr�rOrWr�r	r	r
r��s
��z_BaseNetwork.__eq__cCstt|j�t|j�A�SrA)r�rtrPr�r\r	r	r
r��sz_BaseNetwork.__hash__cCs8|j|jkrdSt|t�rdS|j|jj@|jjkSdS�NF)rMr9rTr,r�rPr�r	r	r
�__contains__�s

z_BaseNetwork.__contains__cCs(|j|kp&|j|kp&|j|kp&|j|kSrA)rPrIr�r	r	r
�overlaps�s



�z_BaseNetwork.overlapscCs|�t|j�t|j�B�SrA)r�rtrP�hostmaskr\r	r	r
rI�s�z_BaseNetwork.broadcast_addresscCs|�t|j�|jA�SrA)r�rtr�r>r\r	r	r
r��sz_BaseNetwork.hostmaskcCsd|j|jfSr�)rPrNr\r	r	r
�with_prefixlen�sz_BaseNetwork.with_prefixlencCsd|j|jfS�N�%s/%s)rPr�r\r	r	r
�with_netmask�sz_BaseNetwork.with_netmaskcCsd|j|jfSr�)rPr�r\r	r	r
�
with_hostmask�sz_BaseNetwork.with_hostmaskcCst|j�t|j�dSr()rtrIrPr\r	r	r
�
num_addresses�sz_BaseNetwork.num_addressescCsdt|�f}t|��dS)Nz%%200s has no associated address classrcrfr	r	r
r��sz_BaseNetwork._address_classcCs|jSrA)rNr\r	r	r
rk�sz_BaseNetwork.prefixlenccs|j|jkstd||f��t|t�s2td|��|�|�sLtd||f��||krXdS|�d|j|jf�}|�	�\}}||kr�||kr�|�|�r�|V|�	�\}}qz|�|�r�|V|�	�\}}qzt
d|||f��qz||kr�|Vn"||kr�|Vnt
d|||f��dS)Nr7z%s is not a network objectz%s not contained in %sr�z3Error performing exclusion: s1: %s s2: %s other: %s)rMr;r9rT�	subnet_ofrr|rPrkrJ�AssertionError)r]r��s1�s2r	r	r
�address_exclude�s@$�


�

��z_BaseNetwork.address_excludecCs`|j|jkrtd||f��|j|jkr,dS|j|jkr<dS|j|jkrLdS|j|jkr\dSdS)Nz"%s and %s are not of the same typerLr)r)rMr;rPr�r�r	r	r
�compare_networks6s!�z_BaseNetwork.compare_networkscCs|j|j|jfSrA)rMrPr�r\r	r	r
rUfsz_BaseNetwork._get_networks_keyr)Nc	cs�|j|jkr|VdS|dk	rJ||jkr0td��|dkr@td��||j}|dkrZtd��|j|}||jkr~td||f��t|j�}t|j�d}t|j�d|?}t|||�D]}|�||f�}|Vq�dS)Nznew prefix must be longerr)�(cannot set prefixlen_diff and new_prefixrzprefix length diff must be > 0z0prefix length diff %d is invalid for netblock %s)	rNr=rrtrPrIr�r�r|)	r]�prefixlen_diff�
new_prefix�
new_prefixlen�start�end�stepZnew_addrZcurrentr	r	r
rJps2



��
z_BaseNetwork.subnetscCs�|jdkr|S|dk	rB||jkr(td��|dkr8td��|j|}|j|}|dkrftd|j|f��|�t|j�t|j�|>@|f�S)Nrznew prefix must be shorterr)r�z;current prefixlen is %d, cannot have a prefixlen_diff of %d)rNrrkr|rtrPr�)r]r�r�r�r	r	r
rD�s&



���z_BaseNetwork.supernetcCs|jjo|jjSrA)rP�is_multicastrIr\r	r	r
r��s	�z_BaseNetwork.is_multicastcCshz:|j|jkr"t|�d|�d���|j|jko8|j|jkWStk
rbtd|�d|����YnXdS)Nz and z are not of the same versionz*Unable to test subnet containment between )rMr;rPrIrO)�a�br	r	r
�
_is_subnet_of�s
�z_BaseNetwork._is_subnet_ofcCs|�||�SrA�r�r�r	r	r
r��sz_BaseNetwork.subnet_ofcCs|�||�SrAr�r�r	r	r
�supernet_of�sz_BaseNetwork.supernet_ofcCs|jjo|jjSrA)rP�is_reservedrIr\r	r	r
r��s	�z_BaseNetwork.is_reservedcCs|jjo|jjSrA)rP�
is_link_localrIr\r	r	r
r��s�z_BaseNetwork.is_link_localcCs|jjo|jjSrA)rP�
is_privaterIr\r	r	r
r�s	�z_BaseNetwork.is_privatecCs|jSrA�r�r\r	r	r
�	is_globals	z_BaseNetwork.is_globalcCs|jjo|jjSrA)rP�is_unspecifiedrIr\r	r	r
r�s	�z_BaseNetwork.is_unspecifiedcCs|jjo|jjSrA)rP�is_loopbackrIr\r	r	r
r�(s	�z_BaseNetwork.is_loopback)r)N)r)N)(rrrr�r�r�r�r�r�r�r�r�r��	functools�cached_propertyrIr�rr�r�r�r�r�rkr�r�rUrJrDr��staticmethodr�r�r�r�r�r�r�r�r�r	r	r	r
rTnsb








K0

5
)








rTc@s�eZdZdZdZdedZeZiZdd�Z	e
dd��Ze
d	d
��Ze
dd��Z
e
d
d��Zdd�Zedd��Zedd��ZdS)�_BaseV4r	rr"r)cCst|�SrAr_r\r	r	r
r[Hsz$_BaseV4._explode_shorthand_ip_stringcCs�||jkr�t|t�r<|}d|kr.|jksjn|�|�n.z|�|�}Wntk
rh|�|�}YnXt|�	|��}||f|j|<|j|Srq)
�_netmask_cacher9rtr=rprurrxrrl�rj�argrkr�r	r	r
�
_make_netmaskKs	

z_BaseV4._make_netmaskc
Cs~|std��|�d�}t|�dkr.td|��zt�t|j|�d�WStk
rx}ztd||f�d�W5d}~XYnXdS)N�Address cannot be empty�.rzExpected 4 octets in %rr�%s in %r)rr$r%rt�
from_bytes�map�_parse_octetr)rjrwZoctets�excr	r	r
rves
z_BaseV4._ip_int_from_stringcCs�|std��|��r|��s,d}t||��t|�dkrHd}t||��|dkrl|ddkrld}t||��t|d�}|d	kr�td
|��|S)NzEmpty octet not permittedz#Only decimal digits permitted in %r�z$At most 3 characters permitted in %r�0rz%Leading zeros are not permitted in %r�
�zOctet %d (> 255) not permitted)rrrrsr%rt)rjZ	octet_strrgZ	octet_intr	r	r
r�s
z_BaseV4._parse_octetcCsd�tt|�dd���S)Nr�rr)�joinr�r#r)rjrnr	r	r
r��sz_BaseV4._string_from_ip_intcCs&t|��d�ddd�}d�|�dS)Nr�rLz
.in-addr.arpa)r#r$r�)r]Zreverse_octetsr	r	r
ra�sz_BaseV4._reverse_pointercCs|jSrA�r=r\r	r	r
�
max_prefixlen�sz_BaseV4.max_prefixlencCs|jSrAr�r\r	r	r
r<�sz_BaseV4.versionN)rrrr~rM�
IPV4LENGTHr>r=r�r[r�r�rvr�r�rarr�r<r	r	r	r
r�5s&	


#
	
r�c@s�eZdZdZdd�Zedd��Zedd��Zee�	�dd	���Z
ee�	�d
d���Zedd
��Zedd��Z
edd��Zedd��ZdS)r�r,�__weakref__cCsrt|t�r|�|�||_dSt|t�rF|�|d�t�|d�|_dSt|�}d|krbtd|��|�	|�|_dS)Nrrr!�Unexpected '/' in %r�
r9rtrhr,ryrir�r#rrv�r]rZaddr_strr	r	r
�__init__�s


zIPv4Address.__init__cCs
t|j�SrA)rr,r\r	r	r
�packed�szIPv4Address.packedcCs||jjkSrA)�
_constants�_reserved_networkr\r	r	r
r��s	zIPv4Address.is_reservedcst�fdd��jjD��S)Nc3s|]}�|kVqdSrAr	��.0r?r\r	r
�	<genexpr>sz)IPv4Address.is_private.<locals>.<genexpr>��anyr��_private_networksr\r	r\r
r��s
zIPv4Address.is_privatecCs||jjko|jSrA)r��_public_networkr�r\r	r	r
r�szIPv4Address.is_globalcCs||jjkSrA�r��_multicast_networkr\r	r	r
r�s	zIPv4Address.is_multicastcCs||jjkSrA)r��_unspecified_addressr\r	r	r
r�s	zIPv4Address.is_unspecifiedcCs||jjkSrA)r��_loopback_networkr\r	r	r
r�"szIPv4Address.is_loopbackcCs||jjkSrA�r��_linklocal_networkr\r	r	r
r�,szIPv4Address.is_link_localN)rrrr~r�rr�r�r��	lru_cacher�r�r�r�r�r�r	r	r	r
r�s(#








	rc@sxeZdZdd�Zejdd��Zdd�Zdd�Zd	d
�Z	dd�Z
ejZe
d
d��Ze
dd��Ze
dd��Ze
dd��ZdS)rcCsD|�|�\}}t�||�t||fdd�|_|jj|_|jj|_dS�NF)r)r{rr�rr�r�rN�r]rr&�maskr	r	r
r�9s

zIPv4Interface.__init__cCs|jjSrA�r�r�r\r	r	r
r�AszIPv4Interface.hostmaskcCsd|�|j�|jfSr��r�r,rNr\r	r	r
r�Es�zIPv4Interface.__str__cCsFt�||�}|r|tkr|Sz|j|jkWStk
r@YdSXdSr�)rr�rWr�rO�r]r�Z
address_equalr	r	r
r�IszIPv4Interface.__eq__cCsRt�||�}|tkrtSz|j|jkp4|j|jko4|WStk
rLYdSXdSr�)rr�rWr�rO�r]r�Zaddress_lessr	r	r
r�Us�zIPv4Interface.__lt__cCst|j|jt|jj�f�SrA�r�r,rNrtr�rPr\r	r	r
r�aszIPv4Interface.__hash__cCs
t|j�SrA)rr,r\r	r	r
r1fszIPv4Interface.ipcCsd|�|j�|jfSr�r�r\r	r	r
r�js�zIPv4Interface.with_prefixlencCsd|�|j�|jfSr��r�r,r�r\r	r	r
r�os�zIPv4Interface.with_netmaskcCsd|�|j�|jfSr��r�r,r�r\r	r	r
r�ts�zIPv4Interface.with_hostmaskN)rrrr�r�r�r�r�r�r�r�rZr}rr1r�r�r�r	r	r	r
r7s 



rc@s.eZdZeZddd�Zee��dd���Z	dS)rTcs�|�|�\�}t��|_|�|�\|_|_t|j�}|t|j�@|krl|rXtd|��nt|t|j�@�|_|j|jdkr�|j	|_
n|j|jkr��fdd�|_
dS)N�%s has host bits setr)cs
t��gSrA)rr	�r&r	r
�<lambda>��z&IPv4Network.__init__.<locals>.<lambda>)r{rrPr�r�rNrtrr=r�r��r]rrr�r�r	rr
r��s#

�
zIPv4Network.__init__cCs&|jtd�ko|jtd�ko$|jS)N�
100.64.0.0/10)rPrrIr�r\r	r	r
r��s

��zIPv4Network.is_globalN)T)
rrrrr�r�rr�r�r�r	r	r	r
rzs


4rc@s�eZdZed�Zed�Zed�Zed�Zed�ed�ed�ed�ed�ed�ed	�ed
�ed�ed�ed
�ed�ed�ed�gZed�Z	e
d�ZdS)�_IPv4Constantsz169.254.0.0/16z127.0.0.0/8z224.0.0.0/4rz	0.0.0.0/8z
10.0.0.0/8z
172.16.0.0/12z192.0.0.0/29z192.0.0.170/31z192.0.2.0/24z192.168.0.0/16z
198.18.0.0/15z198.51.100.0/24z203.0.113.0/24z240.0.0.0/4z255.255.255.255/32z0.0.0.0N)rrrrr�r�r�r�r�r�rr�r	r	r	r
r�s*�rc@s�eZdZdZdZdedZdZed�Z	eZ
iZedd��Z
ed	d
��Zedd��Zed
d��Zeddd��Zdd�Zdd�Zedd��Zedd��ZdS)�_BaseV6r	r8r"r)rmZ0123456789ABCDEFabcdefcCsl||jkrbt|t�r<|}d|kr.|jksFn|�|�n
|�|�}t|�|��}||f|j|<|j|Srq)r�r9rtr=rprur
rlr�r	r	r
r�s	


z_BaseV6._make_netmaskc
Cs�|std��|�d�}d}t|�|kr:d||f}t|��d|dkr�zt|���j}Wn4tk
r�}ztd||f�d�W5d}~XYnX|�d|d	?d
@�|�d|d
@�|jd}t|�|kr�d|d|f}t|��d}tdt|�d�D]*}	||	s�|dk	�r d
|}t|��|	}q�|dk	�r�|}
t|�|d}|d�sl|
d8}
|
�rld}t||��|d�s�|d8}|�r�d}t||��|j|
|}|dk�r2d}t||jd|f��njt|�|jk�r�d}t||j|f��|d�sd}t||��|d�s"d}t||��t|�}
d}d}znd}
t|
�D] }	|
d	K}
|
|�	||	�O}
�q@|
d	|K}
t|d�D] }	|
d	K}
|
|�	||	�O}
�qz|
WSt
k
�r�}ztd||f�d�W5d}~XYnXdS)Nr��:r�z At least %d parts expected in %rr�rLr��%xr�r)z!At most %d colons permitted in %rz At most one '::' permitted in %rrz0Leading ':' only permitted as part of '::' in %rz1Trailing ':' only permitted as part of '::' in %rz/Expected at most %d other parts with '::' in %rz,Exactly %d parts expected without '::' in %r)rr$r%rrCr,rF�
_HEXTET_COUNTr��
_parse_hextetr)rjrw�partsZ
_min_partsrgZipv4_intr�Z
_max_partsZ
skip_index�iZparts_hiZparts_loZ
parts_skippedrnr	r	r
rvs�
$







z_BaseV6._ip_int_from_stringcCs>|j�|�std|��t|�dkr4d}t||��t|d�S)NzOnly hex digits permitted in %rrz$At most 4 characters permitted in %rr)�_HEX_DIGITS�
issupersetrr%rt)rjZ
hextet_strrgr	r	r
r~sz_BaseV6._parse_hextetc	Cs�d}d}d}d}t|�D]>\}}|dkrN|d7}|dkr<|}||krV|}|}qd}d}q|dkr�||}|t|�kr~|dg7}dg|||�<|dkr�dg|}|S)NrLrr�r)�)�	enumerater%)	rj�hextetsZbest_doublecolon_startZbest_doublecolon_lenZdoublecolon_startZdoublecolon_len�indexZhextetZbest_doublecolon_endr	r	r
�_compress_hextets�s0�

z_BaseV6._compress_hextetsNcsZ|dkrt|j�}||jkr$td��d|��fdd�tddd�D�}|�|�}d�|�S)	NzIPv6 address is too large�%032xcs&g|]}dt�||d�d��qS)rrr)rt�r�r��Zhex_strr	r
�
<listcomp>�sz/_BaseV6._string_from_ip_int.<locals>.<listcomp>rrrr)rtr,r>rr�rr�)rjrnrr	rr
r��s


z_BaseV6._string_from_ip_intcs�t|t�rt|j�}nt|t�r,t|j�}nt|�}|�|�}d|��fdd�tddd�D�}t|ttf�r�dd�	|�|j
fSd�	|�S)	Nrcsg|]}�||d��qS)rr	rrr	r
r�sz8_BaseV6._explode_shorthand_ip_string.<locals>.<listcomp>rrrr�r)r9rr#rPrr1rvr�rTr�rN)r]rwrnrr	rr
r[�s



z$_BaseV6._explode_shorthand_ip_stringcCs&|jddd��dd�}d�|�dS)NrLrrr�z	.ip6.arpa)r^�replacer�)r]Z
reverse_charsr	r	r
ra�sz_BaseV6._reverse_pointercCs|jSrAr�r\r	r	r
r�sz_BaseV6.max_prefixlencCs|jSrAr�r\r	r	r
r<sz_BaseV6.version)N)rrrr~rM�
IPV6LENGTHr>r
�	frozensetrr=r�r�r�rvrrr�r[rarr�r<r	r	r	r
r�s.	

g

/	
rc@s�eZdZdZdd�Zedd��Zedd��Zedd	��Zed
d��Z	edd
��Z
ee��dd���Z
edd��Zedd��Zedd��Zedd��Zedd��Zedd��ZdS)r
r�cCsrt|t�r|�|�||_dSt|t�rF|�|d�t�|d�|_dSt|�}d|krbtd|��|�	|�|_dS)Nrrr!r�r�r�r	r	r
r�s


zIPv6Address.__init__cCs
t|j�SrA)r r,r\r	r	r
r�6szIPv6Address.packedcCs||jjkSrAr�r\r	r	r
r�;s	zIPv6Address.is_multicastcst�fdd��jjD��S)Nc3s|]}�|kVqdSrAr	rr\r	r
r�Osz*IPv6Address.is_reserved.<locals>.<genexpr>)r�r��_reserved_networksr\r	r\r
r�Fs	zIPv6Address.is_reservedcCs||jjkSrAr�r\r	r	r
r�QszIPv6Address.is_link_localcCs||jjkSrA)r��_sitelocal_networkr\r	r	r
�
is_site_local[szIPv6Address.is_site_localcst�fdd��jjD��S)Nc3s|]}�|kVqdSrAr	r�r\r	r
r�ssz)IPv6Address.is_private.<locals>.<genexpr>r�r\r	r\r
r�is
zIPv6Address.is_privatecCs|jSrAr�r\r	r	r
r�us	zIPv6Address.is_globalcCs
|jdkSrqr�r\r	r	r
r��s	zIPv6Address.is_unspecifiedcCs
|jdkSr(r�r\r	r	r
r��s	zIPv6Address.is_loopbackcCs |jd?dkrdSt|jd@�S)Nrr	����r,rr\r	r	r
�ipv4_mapped�s	zIPv6Address.ipv4_mappedcCs4|jd?dkrdSt|jd?d@�t|jd@�fS)N�`i �@rr r\r	r	r
�teredo�s

�zIPv6Address.teredocCs$|jd?dkrdSt|jd?d@�S)N�pi �Prr r\r	r	r
�	sixtofour�s	zIPv6Address.sixtofourN)rrrr~r�rr�r�r�r�rr�r�r�r�r�r�r!r$r'r	r	r	r
r
s6$





	










r
c@s�eZdZdd�Zejdd��Zdd�Zdd�Zd	d
�Z	dd�Z
ejZe
d
d��Ze
dd��Ze
dd��Ze
dd��Ze
dd��Ze
dd��ZdS)rcCsD|�|�\}}t�||�t||fdd�|_|jj|_|jj|_dSr�)r{r
r�rr�r�rNr�r	r	r
r��s

zIPv6Interface.__init__cCs|jjSrAr�r\r	r	r
r��szIPv6Interface.hostmaskcCsd|�|j�|jfSr�r�r\r	r	r
r��s�zIPv6Interface.__str__cCsFt�||�}|r|tkr|Sz|j|jkWStk
r@YdSXdSr�)r
r�rWr�rOr�r	r	r
r��szIPv6Interface.__eq__cCsRt�||�}|tkrtSz|j|jkp4|j|jko4|WStk
rLYdSXdSr�)r
r�rWr�rOr�r	r	r
r��s�zIPv6Interface.__lt__cCst|j|jt|jj�f�SrAr�r\r	r	r
r��szIPv6Interface.__hash__cCs
t|j�SrA)r
r,r\r	r	r
r1�szIPv6Interface.ipcCsd|�|j�|jfSr�r�r\r	r	r
r��s�zIPv6Interface.with_prefixlencCsd|�|j�|jfSr�r�r\r	r	r
r��s�zIPv6Interface.with_netmaskcCsd|�|j�|jfSr�r�r\r	r	r
r��s�zIPv6Interface.with_hostmaskcCs|jdko|jjSrq)r,r�r�r\r	r	r
r�szIPv6Interface.is_unspecifiedcCs|jdko|jjSr()r,r�r�r\r	r	r
r�szIPv6Interface.is_loopbackN)rrrr�r�r�r�r�r�r�r�rZr}rr1r�r�r�r�r�r	r	r	r
r�s(





rc@s.eZdZeZd	dd�Zdd�Zedd��ZdS)
rTcs�|�|�\�}t��|_|�|�\|_|_t|j�}|t|j�@|krl|rXtd|��nt|t|j�@�|_|j|jdkr�|j	|_
n|j|jkr��fdd�|_
dS)Nr�r)cs
t��gSrA)r
r	rr	r
rIrz&IPv6Network.__init__.<locals>.<lambda>)r{r
rPr�r�rNrtrr=r�r�rr	rr
r�s

�
zIPv6Network.__init__ccs<t|j�}t|j�}t|d|d�D]}|�|�Vq&dSr(r�r�r	r	r
r�Ks

zIPv6Network.hostscCs|jjo|jjSrA)rPrrIr\r	r	r
rWs�zIPv6Network.is_site_localN)T)	rrrr
r�r�r�rrr	r	r	r
rs

0rc@s�eZdZed�Zed�Zed�ed�ed�ed�ed�ed�ed	�ed
�ed�ed�g
Zed�ed
�ed�ed�ed�ed�ed�ed�ed�ed�ed�ed�ed�ed�ed�gZed�ZdS)�_IPv6Constantsz	fe80::/10zff00::/8z::1/128z::/128z
::ffff:0:0/96z100::/64z	2001::/23z2001:2::/48z
2001:db8::/32z2001:10::/28zfc00::/7z::/8z100::/8z200::/7z400::/6z800::/5z1000::/4z4000::/3z6000::/3z8000::/3zA000::/3zC000::/3zE000::/4zF000::/5zF800::/6zFE00::/9z	fec0::/10N)	rrrrr�r�r�rrr	r	r	r
r(gs<��r()T)"�__version__r�r�rrrrrrrrr r'r2r6r@rKrSrYrZ�total_orderingr:rTr�rrrrr�rr
rrr(r	r	r	r
�<module>sT
#7163:IuCR 5K\!__pycache__/mailcap.cpython-38.opt-1.pyc000064400000016050151153537550013765 0ustar00U

e5dk#�@s�dZddlZddlZddlZddgZdd�Ze�d�jZGdd	�d	e	�Z
d
d�Zdd�Zd
d�Z
dd�Zdd�Zdd�Zddgfdd�Zd#dd�Zgfdd�Zdd�Zdd�Zd d!�Zed"kr�e�dS)$z%Mailcap file handling.  See RFC 1524.�N�getcaps�	findmatchcCsd|krd|dfSdSdS)N�linenor)�r�)�entryrr�/usr/lib64/python3.8/mailcap.py�lineno_sort_key
sr	z[^\xa1-\U0010FFFF\w@+=:,./-]c@seZdZdZdS)�UnsafeMailcapInputz)Warning raised when refusing unsafe inputN)�__name__�
__module__�__qualname__�__doc__rrrrr
sr
c
Cs�i}d}t�D]~}zt|d�}Wntk
r8YqYnX|�t||�\}}W5QRX|��D]*\}}||krz|||<q`|||||<q`q|S)a�Return a dictionary containing the mailcap database.

    The dictionary maps a MIME type (in all lowercase, e.g. 'text/plain')
    to a list of dictionaries corresponding to mailcap entries.  The list
    collects all the entries for that MIME type from all available mailcap
    files.  Each dictionary contains key-value pairs for that MIME type,
    where the viewing command is stored with the key "view".

    r�r)�listmailcapfiles�open�OSError�_readmailcapfile�items)�capsrZmailcap�fpZmorecaps�key�valuerrrrs



cCsPdtjkr"tjd}|�tj�}n*dtjkr8tjd}nd}|ddddg}|S)z7Return a list of all mailcap files found on the system.ZMAILCAPS�HOME�.z	/.mailcapz/etc/mailcapz/usr/etc/mailcapz/usr/local/etc/mailcap)�os�environ�split�pathsep)ZpathstrZmailcaps�homerrrr3s


�rcCs t�dtd�t|d�\}}|S)z?Read a mailcap file and return a dictionary keyed by MIME type.z2readmailcapfile is deprecated, use getcaps instead�N)�warnings�warn�DeprecationWarningr)rr�_rrr�readmailcapfileEs�r%c	Cs�i}|��}|sq�|ddks|��dkr,q|}|dd�dkrb|��}|sPd}|dd�|}q0t|�\}}|r|sxq|dk	r�||d<|d	7}|�d
�}tt|��D]}||��||<q�d
�|���}||kr�||�|�q|g||<q||fS)a�Read a mailcap file and return a dictionary keyed by MIME type.

    Each MIME type is mapped to an entry consisting of a list of
    dictionaries; the list will contain more than one such dictionary
    if a given MIME type appears more than once in the mailcap file.
    Each dictionary contains key-value pairs for that MIME type, where
    the viewing command is stored with the key "view".
    r�#����Nz\
�
rr�/)	�readline�strip�	parseliner�range�len�join�lower�append)	rrr�lineZnextliner�fields�types�jrrrrMs4	
rc
Cs�g}dt|�}}||kr>t|||�\}}|�|�|d}qt|�dkrNdS|d|d|dd�}}}d|i}|D]V}|�d�}|dkr�|}d}	n$|d|���}||dd���}	||kr�qz|	||<qz||fS)	z�Parse one entry in a mailcap file and return a dictionary.

    The viewing command is stored as the value with the key "view",
    and the rest of the fields produce key-value pairs in the dict.
    rrr �NNN�view�=r')r/�
parsefieldr2�findr,)
r3r4�i�n�fieldrr8�restZfkeyZfvaluerrrr-vs*

 

r-cCsP|}||kr<||}|dkr q<q|dkr2|d}q|d}q|||���|fS)z/Separate one key-value pair in a mailcap entry.�;�\r r)r,)r3r<r=�start�crrrr:�s

r:r8z	/dev/nullc
Cs�t|�r"d|f}t�|t�dSt|||�}|D]`}d|krlt|d||�}|dkrXq2|rlt�|�dkrlq2t|||||�}	|	dk	r2|	|fSq2dS)aFind a match for a mailcap entry.

    Return a tuple containing the command line, and the mailcap entry
    used; (None, None) if no match is found.  This may invoke the
    'test' command of several matching entries before deciding which
    entry to use.

    zHRefusing to use mailcap with filename %r. Use a safe temporary filename.r7�testNr)�_find_unsafer!r"r
�lookup�substr�system)
r�MIMEtyper�filename�plist�msg�entries�erD�commandrrrr�s 	
cslg}||kr|||}|�d�}|dd}||krB|||}�dk	r\�fdd�|D�}t|td�}|S)Nr*rz/*csg|]}�|kr|�qSrr)�.0rN�rrr�
<listcomp>�szlookup.<locals>.<listcomp>rQ)r�sortedr	)rrIrrMZ	MIMEtypesrrQrrF�s
rFcCsRd}dt|�}}||k�rN||}|d}|dkr^|dkrT|||d�}|d}||}q||}|d}|dkr�||}q|dkr�||}q|dkr�t|�r�d|f}t�|t�dS||}q|d	k�r@|}	||kr�||d
kr�|d}q�||	|�}
|d}t|
|�}t|��r6d||
f}t�|t�dS||}q|d|}q|S)Nr'rr�%rA�s�tz9Refusing to substitute MIME type %r into a shell command.�{�}z=Refusing to substitute parameter %r (%s) into a shell command)r/rEr!r"r
�	findparam)r>rIrJrK�resr<r=rCrLrB�nameZparamrrrrG�sH










rGcCsF|��d}t|�}|D](}|d|���|kr||d�SqdS)Nr9r')r1r/)r[rKr=�prrrrY�srYc	Cs�ddl}t�}|jdd�s(t|�dStdt|j�d�D]�}|j||d�}t|�dkrjtd�dS|d}|d}t||d|�\}}|s�tdt�q:td|�t	�
|�}|r:td|�q:dS)	Nrrr z"usage: mailcap [MIMEtype file] ...r8zNo viewer found forz
Executing:zExit status:)�sysr�argv�showr.r/�printr�typerrH)	r]rr<�argsrI�filerOrN�stsrrrrDs&

rDcCs�td�t�D]}td|�qt�|s0t�}td�t�t|�}|D]H}t|�||}|D].}t|�}|D]}td|||�qrt�qbqJdS)NzMailcap files:�	zMailcap entries:z  %-15s)r`rrrS)r�fnZckeysrarMrN�keys�krrrr_s"
r_�__main__)N)rrr!�re�__all__r	�compile�searchrE�Warningr
rrr%rr-r:rrFrGrYrDr_rrrrr�<module>s*)

)__pycache__/xdrlib.cpython-38.opt-2.pyc000064400000017072151153537550013651 0ustar00U

e5d�@stddlZddlmZddlmZddddgZGdd�de�ZGd	d�de�Zd
d�Z	Gdd�d�Z
Gd
d�d�ZdS)�N)�BytesIO��wraps�Error�Packer�Unpacker�ConversionErrorc@s$eZdZdd�Zdd�Zdd�ZdS)rcCs
||_dS�N)�msg)�selfr
�r�/usr/lib64/python3.8/xdrlib.py�__init__szError.__init__cCs
t|j�Sr	)�reprr
�rrrr
�__repr__szError.__repr__cCs
t|j�Sr	)�strr
rrrr
�__str__sz
Error.__str__N)�__name__�
__module__�__qualname__rrrrrrr
rs
c@seZdZdS)rN)rrrrrrr
r scst���fdd��}|S)Nc
sFz�||�WStjk
r@}zt|jd�d�W5d}~XYnXdS�Nr)�struct�errorr�args)r�value�e��functionrr
�result&sz&raise_conversion_error.<locals>.resultr)rrrrr
�raise_conversion_error#sr c@s�eZdZdd�Zdd�Zdd�ZeZedd��Zed	d
��Z	e	Z
dd�Zd
d�ZeZ
edd��Zedd��Zdd�ZeZdd�ZeZeZdd�Zdd�Zdd�ZdS)rcCs|��dSr	��resetrrrr
r2szPacker.__init__cCst�|_dSr	)r�_Packer__bufrrrr
r"5szPacker.resetcCs
|j��Sr	)r#�getvaluerrrr
�
get_buffer8szPacker.get_buffercCs|j�t�d|��dS)N�>L�r#�writerZpack�r�xrrr
�	pack_uint=szPacker.pack_uintcCs|j�t�d|��dS)N�>lr'r)rrr
�pack_intAszPacker.pack_intcCs"|r|j�d�n|j�d�dS)Nss)r#r(r)rrr
�	pack_boolGszPacker.pack_boolc
Cs�z|�|d?d@�Wn8ttjfk
rN}zt|jd�d�W5d}~XYnXz|�|d@�Wn8ttjfk
r�}zt|jd�d�W5d}~XYnXdS)N� l��r)r+�	TypeErrorrrrr)rr*rrrr
�pack_uhyperKs"zPacker.pack_uhypercCs|j�t�d|��dS)N�>fr'r)rrr
�
pack_floatWszPacker.pack_floatcCs|j�t�d|��dS)N�>dr'r)rrr
�pack_double[szPacker.pack_doublecCsP|dkrtd��|d|�}|ddd}||t|�d}|j�|�dS)Nr� fstring size must be nonnegative���)�
ValueError�lenr#r()r�n�s�datarrr
�pack_fstring_szPacker.pack_fstringcCs"t|�}|�|�|�||�dSr	)r;r+r?)rr=r<rrr
�pack_stringis
zPacker.pack_stringcCs*|D]}|�d�||�q|�d�dS)N�r)r+)r�list�	pack_item�itemrrr
�	pack_listqs

zPacker.pack_listcCs*t|�|krtd��|D]}||�qdS)Nzwrong array size)r;r:)rr<rBrCrDrrr
�pack_farraywszPacker.pack_farraycCs$t|�}|�|�|�|||�dSr	)r;r+rF)rrBrCr<rrr
�
pack_array}s
zPacker.pack_arrayN)rrrrr"r%Zget_bufr r+r-Z	pack_enumr.r1Z
pack_hyperr3r5r?Zpack_fopaquer@Zpack_opaqueZ
pack_bytesrErFrGrrrr
r/s0




c@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
e
Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZeZdd�ZeZeZdd �Zd!d"�Zd#d$�Zd%S)&rcCs|�|�dSr	r!�rr>rrr
r�szUnpacker.__init__cCs||_d|_dSr)�_Unpacker__buf�_Unpacker__posrHrrr
r"�szUnpacker.resetcCs|jSr	�rJrrrr
�get_position�szUnpacker.get_positioncCs
||_dSr	rK)rZpositionrrr
�set_position�szUnpacker.set_positioncCs|jSr	)rIrrrr
r%�szUnpacker.get_buffercCs|jt|j�krtd��dS)Nzunextracted data remains)rJr;rIrrrrr
�done�sz
Unpacker.donecCsB|j}|d|_}|j||�}t|�dkr2t�t�d|�dS)Nr8r&r�rJrIr;�EOFErrorrZunpack�r�i�jr>rrr
�unpack_uint�szUnpacker.unpack_uintcCsB|j}|d|_}|j||�}t|�dkr2t�t�d|�dS)Nr8r,rrOrQrrr
�
unpack_int�szUnpacker.unpack_intcCst|���Sr	)�boolrUrrrr
�unpack_bool�szUnpacker.unpack_boolcCs |��}|��}t|�d>|BS)Nr/)rT�int)r�hi�lorrr
�
unpack_uhyper�szUnpacker.unpack_uhypercCs|��}|dkr|d}|S)Nll)r[r)rrr
�unpack_hyper�szUnpacker.unpack_hypercCsB|j}|d|_}|j||�}t|�dkr2t�t�d|�dS)Nr8r2rrOrQrrr
�unpack_float�szUnpacker.unpack_floatcCsB|j}|d|_}|j||�}t|�dkr2t�t�d|�dS)N�r4rrOrQrrr
�
unpack_double�szUnpacker.unpack_doublecCsT|dkrtd��|j}||ddd}|t|j�kr<t�||_|j|||�S)Nrr6r7r8)r:rJr;rIrP)rr<rRrSrrr
�unpack_fstring�szUnpacker.unpack_fstringcCs|��}|�|�Sr	)rTr`)rr<rrr
�
unpack_string�szUnpacker.unpack_stringcCsBg}|��}|dkrq>|dkr,td|f��|�}|�|�q|S)NrrAz0 or 1 expected, got %r)rTr�append)r�unpack_itemrBr*rDrrr
�unpack_list�szUnpacker.unpack_listcCs"g}t|�D]}|�|��q|Sr	)�rangerb)rr<rcrBrRrrr
�
unpack_farray�szUnpacker.unpack_farraycCs|��}|�||�Sr	)rTrf)rrcr<rrr
�unpack_array�szUnpacker.unpack_arrayN)rrrrr"rLrMr%rNrTrUZunpack_enumrWr[r\r]r_r`Zunpack_fopaqueraZ
unpack_opaqueZunpack_bytesrdrfrgrrrr
r�s,
)r�ior�	functoolsr�__all__�	Exceptionrrr rrrrrr
�<module>sU__pycache__/bdb.cpython-38.pyc000064400000060533151153537550012154 0ustar00U

e5d8}�@s�dZddlZddlZddlZddlmZmZmZdddgZeeBeBZ	Gdd�de
�ZGdd�d�Zd	d
�Z
Gdd�d�Zdd
�Zdd�ZGdd�de�Zdd�Zdd�Zdd�ZdS)zDebugger basics�N)�CO_GENERATOR�CO_COROUTINE�CO_ASYNC_GENERATOR�BdbQuit�Bdb�
Breakpointc@seZdZdZdS)rz Exception to give up completely.N)�__name__�
__module__�__qualname__�__doc__�rr�/usr/lib64/python3.8/bdb.pyr
sc@sveZdZdZd[dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd\d&d'�Zd]d(d)�Zd*d+�Zd,d-�Zd.d/�Zd^d0d1�Zd2d3�Zd4d5�Zd_d7d8�Zd9d:�Zd;d<�Zd=d>�Z d?d@�Z!dAdB�Z"dCdD�Z#dEdF�Z$dGdH�Z%dIdJ�Z&dKdL�Z'dMdN�Z(d`dPdQ�Z)dadRdS�Z*dbdTdU�Z+dVdW�Z,dXdY�Z-dZe-_.dS)craGeneric Python debugger base class.

    This class takes care of details of the trace facility;
    a derived class should implement user interaction.
    The standard debugger class (pdb.Pdb) is an example.

    The optional skip argument must be an iterable of glob-style
    module name patterns.  The debugger will not step into frames
    that originate in a module that matches one of these patterns.
    Whether a frame is considered to originate in a certain module
    is determined by the __name__ in the frame globals.
    NcCs(|rt|�nd|_i|_i|_d|_dS)N)�set�skip�breaks�fncache�frame_returning)�selfrrrr
�__init__szBdb.__init__cCsR|d|dd�dkr|S|j�|�}|sNtj�|�}tj�|�}||j|<|S)a%Return canonical form of filename.

        For real filenames, the canonical form is a case-normalized (on
        case insensitive filesystems) absolute path.  'Filenames' with
        angle brackets, such as "<stdin>", generated in interactive
        mode, are returned unchanged.
        �<�����>)r�get�os�path�abspath�normcase)r�filename�canonicrrr
r%s
zBdb.canoniccCs&ddl}|��d|_|�dd�dS)z5Set values of attributes as ready to start debugging.rN)�	linecache�
checkcache�botframe�
_set_stopinfo)rr rrr
�reset6sz	Bdb.resetcCs�|jr
dS|dkr|�|�S|dkr0|�||�S|dkrD|�||�S|dkrX|�||�S|dkrf|jS|dkrt|jS|dkr�|jStd	t|��|jS)
aODispatch a trace function for debugged frames based on the event.

        This function is installed as the trace function for debugged
        frames. Its return value is the new trace function, which is
        usually itself. The default implementation decides how to
        dispatch a frame, depending on the type of event (passed in as a
        string) that is about to be executed.

        The event can be one of the following:
            line: A new line of code is going to be executed.
            call: A function is about to be called or another code block
                  is entered.
            return: A function or other code block is about to return.
            exception: An exception has occurred.
            c_call: A C function is about to be called.
            c_return: A C function has returned.
            c_exception: A C function has raised an exception.

        For the Python events, specialized functions (see the dispatch_*()
        methods) are called.  For the C events, no action is taken.

        The arg parameter depends on the previous event.
        N�lineZcall�returnZ	exceptionZc_callZc_exceptionZc_returnz*bdb.Bdb.dispatch: unknown debugging event:)�quitting�
dispatch_line�
dispatch_call�dispatch_return�dispatch_exception�trace_dispatch�print�repr)r�frameZevent�argrrr
r,=s$
zBdb.trace_dispatchcCs.|�|�s|�|�r(|�|�|jr(t�|jS)a	Invoke user function and return trace function for line event.

        If the debugger stops on the current line, invoke
        self.user_line(). Raise BdbQuit if self.quitting is set.
        Return self.trace_dispatch to continue tracing in this scope.
        )�	stop_here�
break_here�	user_liner'rr,�rr/rrr
r(hs

zBdb.dispatch_linecCsd|jdkr|j|_|jS|�|�s0|�|�s0dS|jrH|jjt@rH|jS|�	||�|j
r^t�|jS)aInvoke user function and return trace function for call event.

        If the debugger stops on this function call, invoke
        self.user_call(). Raise BbdQuit if self.quitting is set.
        Return self.trace_dispatch to continue tracing in this scope.
        N)r"�f_backr,r1�break_anywhere�	stopframe�f_code�co_flags�GENERATOR_AND_COROUTINE_FLAGS�	user_callr'r�rr/r0rrr
r)ts
zBdb.dispatch_callcCs||�|�s||jkrv|jr,|jjt@r,|jSz||_|�||�W5d|_X|j	rVt
�|j|krv|jdkrv|�dd�|jS)aInvoke user function and return trace function for return event.

        If the debugger stops on this function return, invoke
        self.user_return(). Raise BdbQuit if self.quitting is set.
        Return self.trace_dispatch to continue tracing in this scope.
        Nr)
r1�returnframer7r8r9r:r,r�user_returnr'r�
stoplinenor#r<rrr
r*�szBdb.dispatch_returncCs�|�|�rF|jjt@r.|dtkr.|ddks�|�||�|jr�t�nD|jr�||jk	r�|jjjt@r�|dtt	fkr�|�||�|jr�t�|j
S)aInvoke user function and return trace function for exception event.

        If the debugger stops on this exception, invoke
        self.user_exception(). Raise BdbQuit if self.quitting is set.
        Return self.trace_dispatch to continue tracing in this scope.
        r�N)r1r8r9r:�
StopIteration�user_exceptionr'rr7�
GeneratorExitr,r<rrr
r+�s$

�
���zBdb.dispatch_exceptioncCs.|dkrdS|jD]}t�||�rdSqdS)z4Return True if module_name matches any skip pattern.NFT)r�fnmatch)rZmodule_name�patternrrr
�is_skipped_module�s
zBdb.is_skipped_modulecCsN|jr|�|j�d��rdS||jkr@|jdkr4dS|j|jkS|jsJdSdS)z>Return True if frame is below the starting frame in the stack.rFrT)rrF�	f_globalsrr7r?�f_linenor4rrr
r1�s�

z
Bdb.stop_herecCs�|�|jj�}||jkrdS|j}||j|krJ|jj}||j|krJdSt|||�\}}|r�|j|_|r�|j	r�|�
t|j��dSdSdS)z�Return True if there is an effective breakpoint for this line.

        Check for line or function breakpoint and if in effect.
        Delete temporary breakpoints if effective() says to.
        FTN)rr8�co_filenamerrH�co_firstlineno�	effective�numberZ	currentbp�	temporary�do_clear�str)rr/r�lineno�bp�flagrrr
r2�s

zBdb.break_herecCstd��dS)zlRemove temporary breakpoint.

        Must implement in derived classes or get NotImplementedError.
        z)subclass of bdb must implement do_clear()N)�NotImplementedError)rr0rrr
rN�szBdb.do_clearcCs|�|jj�|jkS)zEReturn True if there is any breakpoint for frame's filename.
        )rr8rIrr4rrr
r6�szBdb.break_anywherecCsdS)z&Called if we might stop in a function.Nr)rr/Z
argument_listrrr
r;sz
Bdb.user_callcCsdS)z'Called when we stop or break at a line.Nrr4rrr
r3sz
Bdb.user_linecCsdS)z&Called when a return trap is set here.Nr)rr/Zreturn_valuerrr
r>	szBdb.user_returncCsdS)z$Called when we stop on an exception.Nr)rr/�exc_inforrr
rB
szBdb.user_exceptionrcCs||_||_d|_||_dS)z�Set the attributes for stopping.

        If stoplineno is greater than or equal to 0, then stop at line
        greater than or equal to the stopline.  If stoplineno is -1, then
        don't stop at all.
        FN)r7r=r'r?)rr7r=r?rrr
r#szBdb._set_stopinfocCs$|dkr|jd}|�|||�dS)zxStop when the line with the lineno greater than the current one is
        reached or when returning from current frame.Nr)rHr#)rr/rPrrr
�	set_until"s
z
Bdb.set_untilcCs0|jr |jj}|r |js |j|_|�dd�dS)zStop after one line of code.N)rr5�f_tracer,r#)rZcaller_framerrr
�set_step*s

zBdb.set_stepcCs|�|d�dS)z2Stop on the next line in or below the given frame.N)r#r4rrr
�set_next6szBdb.set_nextcCs.|jjt@r|�|dd�n|�|j|�dS)z)Stop when returning from the given frame.Nr)r8r9r:r#r5r4rrr
�
set_return:szBdb.set_returncCsL|dkrt��j}|��|r4|j|_||_|j}q|��t�|j�dS)znStart debugging from frame.

        If frame is not specified, debugging starts from caller's frame.
        N)	�sys�	_getframer5r$r,rVr"rW�settracer4rrr
�	set_traceAs
z
Bdb.set_tracecCsH|�|jdd�|jsDt�d�t��j}|rD||jk	rD|`|j}q*dS)z�Stop only at breakpoints or when finished.

        If there are no breakpoints, set the system trace function to None.
        Nr)r#r"rrZr\r[r5rVr4rrr
�set_continuePs

zBdb.set_continuecCs"|j|_d|_d|_t�d�dS)zuSet quitting attribute to True.

        Raises BdbQuit exception in the next call to a dispatch_*() method.
        NT)r"r7r=r'rZr\�rrrr
�set_quit_szBdb.set_quitFc
Csb|�|�}ddl}|�||�}|s.d||fS|j�|g�}||krN|�|�t|||||�}	dS)z�Set a new breakpoint for filename:lineno.

        If lineno doesn't exist for the filename, return an error message.
        The filename should be in canonical form.
        rNzLine %s:%d does not exist)rr �getliner�
setdefault�appendr)
rrrPrM�cond�funcnamer r%�listrQrrr
�	set_breakps

z
Bdb.set_breakcCs4||ftjkr|j|�|�|j|s0|j|=dS)aPrune breakpoints for filename:lineno.

        A list of breakpoints is maintained in the Bdb instance and in
        the Breakpoint class.  If a breakpoint in the Bdb instance no
        longer exists in the Breakpoint class, then it's removed from the
        Bdb instance.
        N)r�bplistr�remove�rrrPrrr
�
_prune_breaks�s
zBdb._prune_breakscCsj|�|�}||jkrd|S||j|kr6d||fStj||fdd�D]}|��qL|�||�dS)znDelete breakpoints for filename:lineno.

        If no breakpoints were set, return an error message.
        �There are no breakpoints in %szThere is no breakpoint at %s:%dN)rrrrh�deleteMerk)rrrPrQrrr
�clear_break�s


zBdb.clear_breakc
CsZz|�|�}Wn.tk
r<}zt|�WY�Sd}~XYnX|��|�|j|j�dS)zxDelete a breakpoint by its index in Breakpoint.bpbynumber.

        If arg is invalid, return an error message.
        N)�get_bpbynumber�
ValueErrorrOrmrk�filer%)rr0rQ�errrrr
�clear_bpbynumber�szBdb.clear_bpbynumbercCsX|�|�}||jkrd|S|j|D]$}tj||f}|D]}|��q<q&|j|=dS)z`Delete all breakpoints in filename.

        If none were set, return an error message.
        rlN)rrrrhrm)rrr%ZblistrQrrr
�clear_all_file_breaks�s

zBdb.clear_all_file_breakscCs,|js
dStjD]}|r|��qi|_dS)z]Delete all existing breakpoints.

        If none were set, return an error message.
        zThere are no breakpointsN)rr�
bpbynumberrm)rrQrrr
�clear_all_breaks�s

zBdb.clear_all_breakscCs�|std��zt|�}Wn"tk
r:td|�d�YnXztj|}Wn"tk
rltd|�d�YnX|dkr�td|��|S)z�Return a breakpoint by its index in Breakpoint.bybpnumber.

        For invalid arg values or if the breakpoint doesn't exist,
        raise a ValueError.
        zBreakpoint number expectedz Non-numeric breakpoint number %sNz!Breakpoint number %d out of rangezBreakpoint %d already deleted)rp�intrru�
IndexError)rr0rLrQrrr
ro�szBdb.get_bpbynumbercCs"|�|�}||jko ||j|kS)z9Return True if there is a breakpoint for filename:lineno.�rrrjrrr
�	get_break�s

�z
Bdb.get_breakcCs4|�|�}||jkr0||j|kr0tj||fp2gS)znReturn all breakpoints for filename:lineno.

        If no breakpoints are set, return an empty list.
        )rrrrhrjrrr
�
get_breaks�s

���zBdb.get_breakscCs&|�|�}||jkr|j|SgSdS)zrReturn all lines with breakpoints for filename.

        If no breakpoints are set, return an empty list.
        Nry)rrrrr
�get_file_breaks�s


zBdb.get_file_breakscCs|jS)z$Return all breakpoints that are set.)rr_rrr
�get_all_breaks�szBdb.get_all_breakscCs�g}|r|j|kr|j}|dk	rD|�||jf�||jkr<qD|j}q|��tdt|�d�}|dk	r�|�|j|j	f�|j}q^|dkr�tdt|�d�}||fS)z�Return a list of (frame, lineno) in a stack trace and a size.

        List starts with original calling frame, if there is one.
        Size may be number of frames above or below f.
        Nrr)
�tb_frame�tb_nextrcrHr"r5�reverse�max�len�	tb_lineno)r�f�t�stack�irrr
�	get_stack�s 
z
Bdb.get_stack�: cCs�ddl}ddl}|\}}|�|jj�}d||f}|jjrH||jj7}n|d7}|d7}d|jkr�|jd}	|d7}||�|	�7}|�|||j	�}
|
r�|||
�
�7}|S)a:Return a string with information about a stack entry.

        The stack entry frame_lineno is a (frame, lineno) tuple.  The
        return string contains the canonical filename, the function name
        or '<lambda>', the input arguments, the return value, and the
        line of code (if it exists).

        rNz%s(%r)z<lambda>z()Z
__return__z->)r �reprlibrr8rI�co_name�f_localsr.rarG�strip)rZframe_linenoZlprefixr r�r/rPr�s�rvr%rrr
�format_stack_entrys 	

zBdb.format_stack_entryc	Cs�|dkrddl}|j}|dkr"|}|��t|t�r@t|dd�}t�|j�z*zt
|||�Wntk
rrYnXW5d|_	t�d�XdS)z�Debug a statement executed via the exec() function.

        globals defaults to __main__.dict; locals defaults to globals.
        Nrz<string>�execT)�__main__�__dict__r$�
isinstancerO�compilerZr\r,r'r�r)r�cmd�globals�localsr�rrr
�run5s

zBdb.runc	Csz|dkrddl}|j}|dkr"|}|��t�|j�z,zt|||�WW�Stk
r^YnXW5d|_t�d�XdS)z�Debug an expression executed via the eval() function.

        globals defaults to __main__.dict; locals defaults to globals.
        NrT)	r�r�r$rZr\r,r'�evalr)r�exprr�r�r�rrr
�runevalKs
zBdb.runevalcCs|�|||�dS)z.For backwards-compatibility.  Defers to run().N)r�)rr�r�r�rrr
�runctx_sz
Bdb.runctxc	Os�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d	��|��t�|j	�d}z(z|||�}Wntk
r�YnXW5d
|_
t�d�X|S)zWDebug a single function call.

        Return the result of the function call.
        r@z6descriptor 'runcall' of 'Bdb' object needs an argument�funcrNz0Passing 'func' as keyword argument is deprecated)�
stacklevelz7runcall expected at least 1 positional argument, got %drT)r��	TypeError�pop�warnings�warn�DeprecationWarningr$rZr\r,r'r)�args�kwdsrr�r��resrrr
�runcallfs2

�
�
zBdb.runcallz($self, func, /, *args, **kwds))N)r)N)N)FNN)r�)NN)NN)/rr	r
rrrr$r,r(r)r*r+rFr1r2rNr6r;r3r>rBr#rUrWrXrYr]r^r`rgrkrnrsrtrvrorzr{r|r}r�r�r�r�r�r��__text_signature__rrrr
rs\
+	


�







cCst���dS)z<Start debugging with a Bdb instance from the caller's frame.N)rr]rrrr
r]�sr]c@sZeZdZdZdZiZdgZddd�Zdd�Zd	d
�Z	dd�Z
dd
d�Zdd�Zdd�Z
dS)ra�Breakpoint class.

    Implements temporary breakpoints, ignore counts, disabling and
    (re)-enabling, and conditionals.

    Breakpoints are indexed by number through bpbynumber and by
    the (file, line) tuple using bplist.  The former points to a
    single instance of class Breakpoint.  The latter points to a
    list of such instances since there may be more than one
    breakpoint per line.

    When creating a breakpoint, its associated filename should be
    in canonical form.  If funcname is defined, a breakpoint hit will be
    counted when the first line of that function is executed.  A
    conditional breakpoint always counts a hit.
    rNFcCs�||_d|_||_||_||_||_d|_d|_d|_t	j
|_t	j
d7_
|j�
|�||f|jkr||j||f�
|�n|g|j||f<dS)NTrr)re�func_first_executable_linerqr%rMrd�enabled�ignore�hitsr�nextrLrurcrh)rrqr%rMrdrerrr
r�szBreakpoint.__init__cCs>|j|jf}d|j|j<|j|�|�|j|s:|j|=dS)z�Delete the breakpoint from the list associated to a file:line.

        If it is the last breakpoint in that position, it also deletes
        the entry for the file:line.
        N)rqr%rurLrhri)r�indexrrr
rm�s

zBreakpoint.deleteMecCs
d|_dS)zMark the breakpoint as enabled.TN�r�r_rrr
�enable�szBreakpoint.enablecCs
d|_dS)z Mark the breakpoint as disabled.FNr�r_rrr
�disable�szBreakpoint.disablecCs"|dkrtj}t|��|d�dS)z�Print the output of bpformat().

        The optional out argument directs where the output is sent
        and defaults to standard output.
        N)rq)rZ�stdoutr-�bpformat)r�outrrr
�bpprint�szBreakpoint.bpprintcCs�|jrd}nd}|jr |d}n|d}d|j||j|jf}|jrT|d|jf7}|jrj|d|jf7}|jr�|jdkr�d	}nd
}|d|j|f7}|S)z�Return a string with information about the breakpoint.

        The information includes the breakpoint number, temporary
        status, file:line position, break condition, number of times to
        ignore, and number of times hit.

        zdel  zkeep zyes  zno   z%-4dbreakpoint   %s at %s:%dz
	stop only if %sz
	ignore next %d hitsrr��z"
	breakpoint already hit %d time%s)rMr�rLrqr%rdr�r�)rZdispZretZssrrr
r��s(
�
zBreakpoint.bpformatcCsd|j|j|jfS)z1Return a condensed description of the breakpoint.zbreakpoint %s at %s:%s)rLrqr%r_rrr
�__str__�szBreakpoint.__str__)FNN)N)rr	r
rr�rhrurrmr�r�r�r�r�rrrr
r�s


cCsN|js|j|jkrdSdS|jj|jkr,dS|js:|j|_|j|jkrJdSdS)aVReturn True if break should happen here.

    Whether a break should happen depends on the way that b (the breakpoint)
    was set.  If it was set via line number, check if b.line is the same as
    the one in the frame.  If it was set via function name, check if this is
    the right function and if it is on the first executable line.
    FT)rer%rHr8r�r�)�br/rrr
�
checkfuncnamesr�cCs�tj||f}|D]�}|jsqt||�s*q|jd7_|jsh|jdkrZ|jd8_qq�|dfSqzBt|j|j|j	�}|r�|jdkr�|jd8_n|dfWSWq|dfYSXqdS)aEDetermine which breakpoint for this file:line is to be acted upon.

    Called only if we know there is a breakpoint at this location.  Return
    the breakpoint that was triggered and a boolean that indicates if it is
    ok to delete a temporary breakpoint.  Return (None, None) if there is no
    matching breakpoint.
    rrTF)NN)
rrhr�r�r�rdr�r�rGr�)rqr%r/Z	possiblesr��valrrr
rK#s*


rKc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�TdbcCs |jj}|sd}td||�dS)N�???z+++ call)r8r�r-)rr/r��namerrr
r;Tsz
Tdb.user_callcCsTddl}|jj}|sd}|�|jj�}|�||j|j�}td||j|d|�	��dS)Nrr�z+++�:)
r r8r�rrIrarHrGr-r�)rr/r r��fnr%rrr
r3Xsz
Tdb.user_linecCstd|�dS)Nz
+++ return�r-)rr/Zretvalrrr
r>_szTdb.user_returncCstd|�|��dS)Nz
+++ exception)r-r^)rr/Z	exc_stuffrrr
rBas
zTdb.user_exceptionN)rr	r
r;r3r>rBrrrr
r�Ssr�cCs&td|d�t|d�}td|�dS)Nzfoo(�)�
zbar returned)r-�bar)�n�xrrr
�fooesr�cCstd|d�|dS)Nzbar(r�r@r�)�arrr
r�jsr�cCst�}|�d�dS)Nzimport bdb; bdb.foo(10))r�r�)r�rrr
�testnsr�)rrDrZr�inspectrrr�__all__r:�	Exceptionrrr]rr�rKr�r�r�r�rrrr
�<module>s(
{t"0__pycache__/pkgutil.cpython-38.pyc000064400000037722151153537550013110 0ustar00U

e5d�S�@sxdZddlmZddlmZddlZddlZddlZddl	Z	ddl
Z	ddlZddlm
Z
ddlZdddd	d
ddd
ddddgZedd�Zde_dd�Zdd�Zd+dd
�Zd,dd�Zed-dd��Zd.dd�Ze�ejje�dd�ZGd d
�d
�ZGd!d�d�Zz.ddlZdd"lmZd/d#d$�Ze�ee�Wne k
�r@YnXd%d�Z!d0d&d�Z"d'd�Z#d(d	�Z$d)d�Z%d*d�Z&dS)1zUtilities to support packages.�)�
namedtuple)�singledispatchN)�
ModuleType�get_importer�iter_importers�
get_loader�find_loader�
walk_packages�iter_modules�get_data�ImpImporter�	ImpLoader�	read_code�extend_path�
ModuleInfozmodule_finder name ispkgz.A namedtuple with minimal info about a module.cCsRz
|j}Wn:tk
rD|�|�}|dkr2YdStj�||�YSX||�SdS)z'Return the finder-specific module spec.N)�	find_spec�AttributeError�find_module�	importlib�util�spec_from_loader)�finder�namer�loader�r�/usr/lib64/python3.8/pkgutil.py�	_get_specs

rcCs6ddl}|�d�}|tjjkr"dS|�d�|�|�S)Nr��)�marshal�readrr�MAGIC_NUMBER�load)�streamr�magicrrrr(s

�c	#s�ifdd��t||�D]�}|V|jrzt|j�WnNtk
rZ|dk	rV||j�Yqtk
r�|dk	r|||j�n�YqXttj|jdd�p�g}�fdd�|D�}t	||jd|�EdHqdS)a�Yields ModuleInfo for all modules recursively
    on path, or, if path is None, all accessible modules.

    'path' should be either None or a list of paths to look for
    modules in.

    'prefix' is a string to output on the front of every module name
    on output.

    Note that this function must import all *packages* (NOT all
    modules!) on the given path, in order to access the __path__
    attribute to find submodules.

    'onerror' is a function which gets called with one argument (the
    name of the package which was being imported) if any exception
    occurs while trying to import a package.  If no onerror function is
    supplied, ImportErrors are caught and ignored, while all other
    exceptions are propagated, terminating the search.

    Examples:

    # list all modules python can access
    walk_packages()

    # list all submodules of ctypes
    walk_packages(ctypes.__path__, ctypes.__name__+'.')
    cSs||krdSd||<dS)NTr)�p�mrrr�seenRszwalk_packages.<locals>.seenN�__path__csg|]}�|�s|�qSrr)�.0r&�r(rr�
<listcomp>isz!walk_packages.<locals>.<listcomp>�.)
r
�ispkg�
__import__r�ImportError�	Exception�getattr�sys�modulesr	)�path�prefix�onerror�inforr+rr	5s ccsr|dkrt�}nt|t�r$td��n
tt|�}i}|D]6}t||�D]&\}}||krDd||<t|||�VqDq6dS)aYields ModuleInfo for all submodules on path,
    or, if path is None, all top-level modules on sys.path.

    'path' should be either None or a list of paths to look for
    modules in.

    'prefix' is a string to output on the front of every module name
    on output.
    Nz9path must be None or list of paths to look for modules in�)r�
isinstance�str�
ValueError�mapr�iter_importer_modulesr)r5r6Z	importers�yielded�irr.rrrr
ns



cCst|d�sgS|�|�S)Nr
)�hasattrr
)�importerr6rrrr>�s
r>c	cs$|jdkstj�|j�sdSi}ddl}zt�|j�}Wntk
rPg}YnX|��|D]�}|�|�}|dks^||kr~q^tj�|j|�}d}|s�tj�|�r�d|kr�|}zt�|�}	Wntk
r�g}	YnX|	D]}|�|�}
|
dkr�d}q�q�q^|r^d|kr^d||<|||fVq^dS�Nr�__init__Fr-Tr9�	r5�os�isdir�inspect�listdir�OSError�sort�
getmodulename�join)rBr6r?rH�	filenames�fn�modnamer5r.�dircontents�subnamerrr�_iter_file_finder_modules�s<



rSc	Cs.t���t�dt�t�d�aW5QRXdS)N�ignore�imp)�warnings�catch_warnings�simplefilter�DeprecationWarningr�
import_modulerUrrrr�_import_imp�s
r[c@s.eZdZdZd
dd�Zddd�Zddd	�ZdS)
raPEP 302 Finder that wraps Python's "classic" import algorithm

    ImpImporter(dirname) produces a PEP 302 finder that searches that
    directory.  ImpImporter(None) produces a PEP 302 finder that searches
    the current sys.path, plus any modules that are frozen or built-in.

    Note that ImpImporter does not currently support being used by placement
    on sys.meta_path.
    NcCst�dt�t�||_dS�Nz5This emulation is deprecated, use 'importlib' instead)rV�warnrYr[r5)�selfr5rrrrD�s
�zImpImporter.__init__cCs�|�d�d}||kr$|jdkr$dS|jdkr4d}ntj�|j�g}zt�||�\}}}Wntk
rpYdSXt||||�S)Nr-���)�splitr5rF�realpathrUrr0r
)r^�fullnamer5rR�file�filename�etcrrrr�s
zImpImporter.find_moduler%c	cs$|jdkstj�|j�sdSi}ddl}zt�|j�}Wntk
rPg}YnX|��|D]�}|�|�}|dks^||kr~q^tj�|j|�}d}|s�tj�|�r�d|kr�|}zt�|�}	Wntk
r�g}	YnX|	D]}|�|�}
|
dkr�d}q�q�q^|r^d|kr^d||<|||fVq^dSrCrE)r^r6r?rHrNrOrPr5r.rQrRrrrr
�s<



zImpImporter.iter_modules)N)N)r%)�__name__�
__module__�__qualname__�__doc__rDrr
rrrrr�s


c@sneZdZdZdZZdd�Zdd�Zdd�Zd	d
�Z	dd�Z
d
d�Zddd�Zddd�Z
dd�Zddd�ZdS)r
zBPEP 302 Loader that wraps Python's "classic" import algorithm
    NcCs.t�dt�t�||_||_||_||_dSr\)rVr]rYr[rcrdrbre)r^rbrcrdrerrrrDs�zImpLoader.__init__cCs:|��zt�||j|j|j�}W5|jr4|j��X|S)N)�_reopenrc�closerU�load_modulerdre)r^rb�modrrrrlszImpLoader.load_modulec
Cs*t|d��}|��W5QR�SQRXdS)N�rb)�openr )r^�pathnamercrrrr%szImpLoader.get_datacCsT|jrP|jjrP|jd}|tjkr2t|jd�|_n|tjtjfkrPt|jd�|_dS)N��rrn)	rc�closedrerU�	PY_SOURCErord�PY_COMPILED�C_EXTENSION)r^�mod_typerrrrj)s

zImpLoader._reopencCs0|dkr|j}n||jkr,td|j|f��|S)Nz,Loader for module %s cannot handle module %s)rbr0�r^rbrrr�	_fix_name1s
�zImpLoader._fix_namecCs|�|�}|jdtjkS�Nrq)ryrerU�
PKG_DIRECTORYrxrrr�
is_package9s
zImpLoader.is_packagecCs�|�|�}|jdkr�|jd}|tjkrD|�|�}t||jd�|_nJ|tjkrv|�	�zt|j
�|_W5|j
��Xn|tj
kr�|����|_|jS)Nrq�exec)ry�codererUrt�
get_source�compilerdrurjrcrkrr{�
_get_delegate�get_code)r^rbrw�sourcerrrr�=s






zImpLoader.get_codec	Cs�|�|�}|jdkr�|jd}|tjkrP|��z|j��|_W5|j��Xnd|tj	kr�t
j�|j
dd��r�t|j
dd�d��}|��|_W5QRXn|tjkr�|����|_|jS)Nrqr_rr)ryr�rerUrtrjrcrkr rurFr5�existsrdror{r�r)r^rbrw�frrrrNs





zImpLoader.get_sourcecCst|j�}t|d�}|jS)NrD)rrdrr)r^r�specrrrr�`s

zImpLoader._get_delegatecCsH|�|�}|jd}|tjkr*|����S|tjtjtjfkrD|j	SdSrz)
ryrerUr{r��get_filenamertrurvrd)r^rbrwrrrr�es


zImpLoader.get_filename)N)N)N)rfrgrhrir~r�rDrlrrjryr|r�rr�r�rrrrr
s	

)�zipimporterc	cs�ttj|j�}|j}t|�}i}ddl}|D]�}|�|�s>q.||d��t	j
�}t|�dkr�|d�d�r�|d|kr�d||d<||ddfVt|�dkr�q.|�|d�}|dkr�q.|r.d|kr.||kr.d||<||dfVq.dS)	Nrrqr9z__init__.pyTrDr-F)�sorted�	zipimport�_zip_directory_cache�archiver6�lenrH�
startswithr`rF�seprL)	rBr6Zdirlist�_prefixZplenr?rHrOrPrrr�iter_zipimport_modulesss*
r�cCsxt�|�}ztj|}WnZtk
rrtjD]:}z ||�}tj�||�WqnWq.tk
rfYq.Xq.d}YnX|S)z�Retrieve a finder for the given path item

    The returned finder is cached in sys.path_importer_cache
    if it was newly created by a path hook.

    The cache (or part of it) can be cleared manually if a
    rescan of sys.path_hooks is necessary.
    N)rF�fsdecoder3�path_importer_cache�KeyError�
path_hooks�
setdefaultr0)Z	path_itemrB�	path_hookrrrr�s	



ccs�|�d�rd�|�}t|��d|krV|�d�d}t�|�}t|dd�}|dkrhdSntjEdHtj	}|D]}t
|�VqldS)a�Yield finders for the given module name

    If fullname contains a '.', the finders will be for the package
    containing fullname, otherwise they will be all registered top level
    finders (i.e. those on both sys.meta_path and sys.path_hooks).

    If the named module is in a package, that package is imported as a side
    effect of invoking this function.

    If no module name is specified, all top level finders are produced.
    r-�'Relative module name {!r} not supportedrr)N)r��formatr0�
rpartitionrrZr2r3�	meta_pathr5r)rb�msgZpkg_nameZpkgr5�itemrrrr�s


cCsn|tjkr tj|}|dkr dSt|t�rb|}t|dd�}|dk	rF|St|dd�dkrZdS|j}n|}t|�S)z�Get a "loader" object for module_or_name

    Returns None if the module cannot be found or imported.
    If the named module is not already imported, its containing package
    (if any) is imported, in order to establish the package __path__.
    N�
__loader__�__spec__)r3r4r:rr2rfr)Zmodule_or_name�modulerrbrrrr�s


cCs�|�d�rd�|�}t|��ztj�|�}WnFttttfk
rr}z d}t|�|t	|�|��|�W5d}~XYnX|dk	r�|j
SdS)z�Find a "loader" object for fullname

    This is a backwards compatibility wrapper around
    importlib.util.find_spec that converts most failures to ImportError
    and only returns the loader rather than the full spec
    r-r�z,Error while finding loader for {!r} ({}: {})N)r�r�r0rrrr�	TypeErrorr<�typer)rbr�r�Zexrrrr�s

*cCs�t|t�s|S|d}|dd�}|�d�\}}}|rfztj|j}Wqlttfk
rb|YSXntj}|D�]&}t|t	�s�qpt
|�}|dk	r�g}	t|d�r�|�|�}
|
dk	r�|
j
p�g}	nt|d�r�|�|�\}}	|	D]}||kr�|�|�q�tj�||�}tj�|�rpzt|�}
Wn8tk
�rP}ztj�d||f�W5d}~XYqpX|
�<|
D]0}|�d�}|�r\|�d��r��q\|�|��q\W5QRXqp|S)	a�Extend a package's path.

    Intended use is to place the following code in a package's __init__.py:

        from pkgutil import extend_path
        __path__ = extend_path(__path__, __name__)

    This will add to the package's __path__ all subdirectories of
    directories on sys.path named after the package.  This is useful
    if one wants to distribute different parts of a single logical
    package as multiple directories.

    It also looks for *.pkg files beginning where * matches the name
    argument.  This feature is similar to *.pth files (see site.py),
    except that it doesn't special-case lines starting with 'import'.
    A *.pkg file is trusted at face value: apart from checking for
    duplicates, all entries found in a *.pkg file are added to the
    path, regardless of whether they are exist the filesystem.  (This
    is a feature.)

    If the input path is not a list (as is the case for frozen
    packages) it is returned unchanged.  The input path is not
    modified; an extended copy is returned.  Items are only appended
    to the copy at the end.

    It is assumed that sys.path is a sequence.  Items of sys.path that
    are not (unicode or 8-bit) strings referring to existing
    directories are ignored.  Unicode items of sys.path that cause
    errors when used as filenames may cause this function to raise an
    exception (in line with os.path.isdir() behavior).
    z.pkgNr-rrzCan't open %s: %s
�
�#)r:�listr�r3r4r)r�rr5r;rrAr�submodule_search_locationsr�appendrFrM�isfilerorJ�stderr�write�rstripr�)r5rZ	sname_pkgZparent_package�_Z
final_nameZsearch_path�dirr�portionsr�ZportionZpkgfiler�r��linerrrr�sR!





�
cCs�tj�|�}|dkrdS|j}|dks0t|d�s4dStj�|�pJtj�	|�}|dks^t|d�sbdS|�
d�}|�dtj
�|j��tj
j|�}|�|�S)afGet a resource from a package.

    This is a wrapper round the PEP 302 loader get_data API. The package
    argument should be the name of a package, in standard module format
    (foo.bar). The resource argument should be in the form of a relative
    filename, using '/' as the path separator. The parent directory name '..'
    is not allowed, and nor is a rooted name (starting with a '/').

    The function returns a binary string, which is the contents of the
    specified resource.

    For packages located in the filesystem, which have already been imported,
    this is the rough equivalent of

        d = os.path.dirname(sys.modules[package].__file__)
        data = open(os.path.join(d, resource), 'rb').read()

    If the package cannot be located or loaded, or it uses a PEP 302 loader
    which does not support get_data(), then None is returned.
    Nr�__file__�/r)rrrrrAr3r4�get�
_bootstrap�_loadr`�insertrFr5�dirnamer�rMr)�package�resourcer�rrm�partsZ
resource_namerrrrVs
�
)Nr%N)Nr%)r%)r%)r%)r%)'ri�collectionsr�	functoolsrZ
simplegenericr�importlib.util�importlib.machineryrFZos.pathr3�typesrrV�__all__rrrr	r
r>rS�register�	machinery�
FileFinderr[rr
r�r�r�r0rrrrrrrrrr�<module>sh�

9

(�Jc

^__pycache__/pty.cpython-38.opt-1.pyc000064400000007565151153537550013206 0ustar00U

e5d��@s�dZddlmZddlZddlZddlZdddgZdZdZdZdZ	d	d�Z
d
d�Zdd
�Zdd�Z
dd�Zdd�Zdd�Zeefdd�Zeefdd�ZdS)zPseudo terminal utilities.�)�selectN�openpty�fork�spawn��c	Cs>z
t��WSttfk
r"YnXt�\}}t|�}||fS)zdopenpty() -> (master_fd, slave_fd)
    Open a pty master/slave pair, using os.openpty() if possible.)�osr�AttributeError�OSError�_open_terminal�
slave_open)�	master_fd�
slave_name�slave_fd�r�/usr/lib64/python3.8/pty.pyrs

c	CsLzt��\}}Wnttfk
r(YnXt�|�}t�|�||fSt�S)z�master_open() -> (master_fd, slave_name)
    Open a pty master and return the fd, and the filename of the slave end.
    Deprecated, use openpty() instead.)rrr	r
�ttyname�closer)r
rrrrr�master_open"s

rc
CsndD]\}dD]R}d||}zt�|tj�}Wntk
rFYqYnX|d||fSqtd��dS)z1Open pty master and return (master_fd, tty_name).ZpqrstuvwxyzPQRSTZ0123456789abcdefz/dev/ptyz/dev/ttyzout of pty devicesN)r�open�O_RDWRr
)�x�yZpty_name�fdrrrr2s
rcCsrt�|tj�}zddlm}m}Wntk
r:|YSXz|||d�|||d�Wntk
rlYnX|S)z�slave_open(tty_name) -> slave_fd
    Open the pty slave and acquire the controlling terminal, returning
    opened filedescriptor.
    Deprecated, use openpty() instead.r)�ioctl�I_PUSHZptemZldterm)rrrZfcntlrr�ImportErrorr
)Ztty_name�resultrrrrrr>s
rc	Cs�zt��\}}Wnttfk
r(Yn4X|tkrTzt��Wntk
rRYnX||fSt�\}}t��}|tkr�t��t�|�t�	|t
�t�	|t�t�	|t�|tkr�t�|�t�
t�t�tj�}t�|�n
t�|�||fS)zdfork() -> (pid, master_fd)
    Fork and make the child a session leader with a controlling terminal.)r�forkptyr	r
�CHILD�setsidrrr�dup2�STDIN_FILENO�
STDOUT_FILENO�
STDERR_FILENOrrr)�pidrr
rZtmp_fdrrrrPs0



cCs"|rt�||�}||d�}qdS)z#Write all the data to a descriptor.N)r�write)r�data�nrrr�_writenxsr)cCst�|d�S)zDefault read function.i)r�read)rrrr�_read~sr+cCsv|tg}t|gg�\}}}||krF||�}|s:|�|�nt�t|�t|kr|t�}|sf|�t�qt||�qdS)z�Parent copy loop.
    Copies
            pty master -> standard output   (master_read)
            standard input -> pty master    (stdin_read)N)r"r�removerr&r#r))r
�master_read�
stdin_readZfdsZrfdsZwfdsZxfdsr'rrr�_copy�sr/cCs�t|�td�kr|f}t�d|�t�\}}|tkrHtj|df|��zt�t	�}t�
t	�d}Wntjk
r~d}YnXzt|||�Wn(t
k
r�|r�t�t	tj|�YnXt�|�t�|d�dS)zCreate a spawned process.�z	pty.spawnrr)�type�sys�auditrrr�execlp�ttyZ	tcgetattrr"Zsetraw�errorr/r
Z	tcsetattrZ	TCSAFLUSHr�waitpid)�argvr-r.r%r
�modeZrestorerrrr�s&




)�__doc__rrr2r5�__all__r"r#r$rrrrrrr)r+r/rrrrr�<module>s$
(__pycache__/_weakrefset.cpython-38.pyc000064400000016662151153537550013730 0ustar00U

e5dg�@s2ddlmZdgZGdd�d�ZGdd�d�ZdS)���ref�WeakSetc@s$eZdZdd�Zdd�Zdd�ZdS)�_IterationGuardcCst|�|_dS�N)r�
weakcontainer)�selfr�r	�#/usr/lib64/python3.8/_weakrefset.py�__init__sz_IterationGuard.__init__cCs |��}|dk	r|j�|�|Sr)r�
_iterating�add)r�wr	r	r
�	__enter__sz_IterationGuard.__enter__cCs0|��}|dk	r,|j}|�|�|s,|��dSr)rr�remove�_commit_removals)r�e�t�br�sr	r	r
�__exit__s
z_IterationGuard.__exit__N)�__name__�
__module__�__qualname__rrrr	r	r	r
r
src@seZdZd@dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZeZd d!�Zd"d#�Zd$d%�ZeZd&d'�Zd(d)�Zd*d+�ZeZd,d-�Zd.d/�ZeZd0d1�Zd2d3�Zd4d5�Z e Z!d6d7�Z"d8d9�Z#d:d;�Z$e$Z%d<d=�Z&d>d?�Z'dS)ArNcCsBt�|_t|�fdd�}||_g|_t�|_|dk	r>|�|�dS)NcSs2|�}|dk	r.|jr"|j�|�n|j�|�dSr)r�_pending_removals�append�data�discard)�itemZselfrefrr	r	r
�_remove&s
z!WeakSet.__init__.<locals>._remove)�setrrrrr�update)rrrr	r	r
r$szWeakSet.__init__cCs$|j}|jj}|r ||���qdSr)rrr�pop)r�lrr	r	r
r4szWeakSet._commit_removalsc	cs8t|��&|jD]}|�}|dk	r|VqW5QRXdSr)rr�rZitemrefrr	r	r
�__iter__:s


zWeakSet.__iter__cCst|j�t|j�Sr)�lenrr�rr	r	r
�__len__CszWeakSet.__len__cCs.zt|�}Wntk
r"YdSX||jkS)NF)r�	TypeErrorr)rrZwrr	r	r
�__contains__Fs
zWeakSet.__contains__cCs|jt|�ft|dd�fS)N�__dict__)�	__class__�list�getattrr'r	r	r
�
__reduce__Ms
�zWeakSet.__reduce__cCs&|jr|��|j�t||j��dSr)rrrr
rr�rrr	r	r
r
QszWeakSet.addcCs|jr|��|j��dSr)rrr�clearr'r	r	r
r1Vsz
WeakSet.clearcCs
|�|�Sr�r,r'r	r	r
�copy[szWeakSet.copycCsT|jr|��z|j��}Wntk
r:td�d�YnX|�}|dk	r|SqdS)Nzpop from empty WeakSet)rrrr"�KeyErrorr$r	r	r
r"^szWeakSet.popcCs"|jr|��|j�t|��dSr)rrrrrr0r	r	r
rjszWeakSet.removecCs"|jr|��|j�t|��dSr)rrrrrr0r	r	r
roszWeakSet.discardcCs&|jr|��|D]}|�|�qdSr)rrr
)r�otherZelementr	r	r
r!tszWeakSet.updatecCs|�|�|Sr)r!�rr5r	r	r
�__ior__zs
zWeakSet.__ior__cCs|��}|�|�|Sr)r3�difference_update�rr5Znewsetr	r	r
�
difference~s
zWeakSet.differencecCs|�|�dSr)�__isub__r6r	r	r
r8�szWeakSet.difference_updatecCs<|jr|��||kr"|j��n|j�dd�|D��|S)Ncss|]}t|�VqdSrr��.0rr	r	r
�	<genexpr>�sz#WeakSet.__isub__.<locals>.<genexpr>)rrrr1r8r6r	r	r
r;�szWeakSet.__isub__cs���fdd�|D��S)Nc3s|]}|�kr|VqdSrr	r<r'r	r
r>�sz'WeakSet.intersection.<locals>.<genexpr>r2r6r	r'r
�intersection�szWeakSet.intersectioncCs|�|�dSr)�__iand__r6r	r	r
�intersection_update�szWeakSet.intersection_updatecCs(|jr|��|j�dd�|D��|S)Ncss|]}t|�VqdSrrr<r	r	r
r>�sz#WeakSet.__iand__.<locals>.<genexpr>)rrrrAr6r	r	r
r@�szWeakSet.__iand__cCs|j�dd�|D��S)Ncss|]}t|�VqdSrrr<r	r	r
r>�sz#WeakSet.issubset.<locals>.<genexpr>)r�issubsetr6r	r	r
rB�szWeakSet.issubsetcCs|jttt|��kSr�rr �maprr6r	r	r
�__lt__�szWeakSet.__lt__cCs|j�dd�|D��S)Ncss|]}t|�VqdSrrr<r	r	r
r>�sz%WeakSet.issuperset.<locals>.<genexpr>)r�
issupersetr6r	r	r
rF�szWeakSet.issupersetcCs|jttt|��kSrrCr6r	r	r
�__gt__�szWeakSet.__gt__cCs$t||j�stS|jttt|��kSr)�
isinstancer,�NotImplementedrr rDrr6r	r	r
�__eq__�szWeakSet.__eq__cCs|��}|�|�|Sr)r3�symmetric_difference_updater9r	r	r
�symmetric_difference�s
zWeakSet.symmetric_differencecCs|�|�dSr)�__ixor__r6r	r	r
rK�sz#WeakSet.symmetric_difference_updatecs@�jr����|kr"�j��n�j��fdd�|D���S)Nc3s|]}t|�j�VqdSr)rrr<r'r	r
r>�sz#WeakSet.__ixor__.<locals>.<genexpr>)rrrr1rKr6r	r'r
rM�szWeakSet.__ixor__cCs|�dd�||fD��S)Ncss|]}|D]
}|Vq
qdSrr	)r=rrr	r	r
r>�sz WeakSet.union.<locals>.<genexpr>r2r6r	r	r
�union�sz
WeakSet.unioncCst|�|��dkS)Nr)r&r?r6r	r	r
�
isdisjoint�szWeakSet.isdisjointcCs
t|j�Sr)�reprrr'r	r	r
�__repr__�szWeakSet.__repr__)N)(rrrrrr%r(r*r/r
r1r3r"rrr!r7r:�__sub__r8r;r?�__and__rAr@rB�__le__rErF�__ge__rGrJrL�__xor__rKrMrN�__or__rOrQr	r	r	r
r#sJ
			N)�_weakrefr�__all__rrr	r	r	r
�<module>s__pycache__/io.cpython-38.opt-1.pyc000064400000006600151153537550012766 0ustar00U

e5d�
�@sjdZdZdddddddd	d
ddd
dddddddgZddlZddlZddlmZmZmZmZm	Z	m
Z
mZmZm
Z
mZmZmZmZmZejZde_dZdZdZGdd�dejejd�ZGdd�deje�ZGdd
�d
eje�ZGdd�deje�Z e�!e
�ee
eeefD]Z"e�!e"��qeefD]Z"e �!e"��q ["zdd lm#Z#Wne$k
�rZYnXe�!e#�dS)!a�The io module provides the Python interfaces to stream handling. The
builtin open function is defined in this module.

At the top of the I/O hierarchy is the abstract base class IOBase. It
defines the basic interface to a stream. Note, however, that there is no
separation between reading and writing to streams; implementations are
allowed to raise an OSError if they do not support a given operation.

Extending IOBase is RawIOBase which deals simply with the reading and
writing of raw bytes to a stream. FileIO subclasses RawIOBase to provide
an interface to OS files.

BufferedIOBase deals with buffering on a raw byte stream (RawIOBase). Its
subclasses, BufferedWriter, BufferedReader, and BufferedRWPair buffer
streams that are readable, writable, and both respectively.
BufferedRandom provides a buffered interface to random access
streams. BytesIO is a simple stream of in-memory bytes.

Another IOBase subclass, TextIOBase, deals with the encoding and decoding
of streams into text. TextIOWrapper, which extends it, is a buffered text
interface to a buffered raw stream (`BufferedIOBase`). Finally, StringIO
is an in-memory stream for text.

Argument names are not part of the specification, and only the arguments
of open() are intended to be used as keyword arguments.

data:

DEFAULT_BUFFER_SIZE

   An int containing the default buffer size used by the module's buffered
   I/O classes. open() uses the file's blksize (as obtained by os.stat) if
   possible.
z�Guido van Rossum <guido@python.org>, Mike Verdone <mike.verdone@gmail.com>, Mark Russell <mark.russell@zen.co.uk>, Antoine Pitrou <solipsis@pitrou.net>, Amaury Forgeot d'Arc <amauryfa@gmail.com>, Benjamin Peterson <benjamin@python.org>�BlockingIOError�open�	open_code�IOBase�	RawIOBase�FileIO�BytesIO�StringIO�BufferedIOBase�BufferedReader�BufferedWriter�BufferedRWPair�BufferedRandom�
TextIOBase�
TextIOWrapper�UnsupportedOperation�SEEK_SET�SEEK_CUR�SEEK_END�N)�DEFAULT_BUFFER_SIZErrrrrrrr
rrr
�IncrementalNewlineDecoderr�io��c@seZdZejjZdS)rN)�__name__�
__module__�__qualname__�_io�_IOBase�__doc__�r r �/usr/lib64/python3.8/io.pyrHs)�	metaclassc@seZdZejjZdS)rN)rrrr�
_RawIOBaserr r r r!rKsc@seZdZejjZdS)r	N)rrrr�_BufferedIOBaserr r r r!r	Nsc@seZdZejjZdS)rN)rrrr�_TextIOBaserr r r r!rQs)�_WindowsConsoleIO)%r�
__author__�__all__r�abcrrrrrrrrr
rrr
rr�OpenWrapperrrrrr�ABCMetarr#rr$r	r%r�register�klassr&�ImportErrorr r r r!�<module>sT$
�@
�__pycache__/pyclbr.cpython-38.opt-1.pyc000064400000024325151153537550013656 0ustar00U

e5d�;�@s�dZddlZddlZddlZddlZddlmZmZm	Z	ddddgZ
iZGdd	�d	�ZGd
d�de�Z
Gdd�de�Zdd
�Zddd�Zddd�Zddd�Zd dd�Zdd�Zdd�Zdd�Zdd�Zedkr�e�dS)!aParse a Python module and describe its classes and functions.

Parse enough of a Python file to recognize imports and class and
function definitions, and to find out the superclasses of a class.

The interface consists of a single function:
    readmodule_ex(module, path=None)
where module is the name of a Python module, and path is an optional
list of directories where the module is to be searched.  If present,
path is prepended to the system search path sys.path.  The return value
is a dictionary.  The keys of the dictionary are the names of the
classes and functions defined in the module (including classes that are
defined via the from XXX import YYY construct).  The values are
instances of classes Class and Function.  One special key/value pair is
present for packages: the key '__path__' has a list as its value which
contains the package search path.

Classes and Functions have a common superclass: _Object.  Every instance
has the following attributes:
    module  -- name of the module;
    name    -- name of the object;
    file    -- file in which the object is defined;
    lineno  -- line in the file where the object's definition starts;
    parent  -- parent of this object, if any;
    children -- nested objects contained in this object.
The 'children' attribute is a dictionary mapping names to objects.

Instances of Function describe functions with the attributes from _Object.

Instances of Class describe classes with the attributes from _Object,
plus the following:
    super   -- list of super classes (Class instances if possible);
    methods -- mapping of method names to beginning line numbers.
If the name of a super class is not recognized, the corresponding
entry in the list of super classes is not a class instance but a
string giving the name of the super class.  Since import statements
are recognized and imported modules are scanned as well, this
shouldn't happen often.
�N)�NAME�DEDENT�OP�
readmodule�
readmodule_ex�Class�Functionc@s eZdZdZdd�Zdd�ZdS)�_Objectz+Information about Python class or function.cCs(||_||_||_||_||_i|_dS�N)�module�name�file�lineno�parent�children��selfrrr
rr�r�/usr/lib64/python3.8/pyclbr.py�__init__6sz_Object.__init__cCs||j|<dSr
)r)rr�objrrr�	_addchild>sz_Object._addchildN)�__name__�
__module__�__qualname__�__doc__rrrrrrr	4sr	c@seZdZdZddd�ZdS)rz7Information about a Python function, including methods.NcCst�||||||�dSr
)r	rrrrrrDszFunction.__init__)N)rrrrrrrrrrBscs*eZdZdZd�fdd�	Zdd�Z�ZS)rz!Information about a Python class.Ncs0t�||||||�|dkr gn||_i|_dSr
)r	r�super�methods)rrrrr
rr��	__class__rrrJszClass.__init__cCs||j|<dSr
)r)rrrrrr�
_addmethodOszClass._addmethod)N)rrrrrr �
__classcell__rrrrrHscCs:t|j||j||�}|�||�t|t�r6|�||�|S)z*Return a Function after nesting within ob.)rrr
r�
isinstancerr )�ob�	func_namerZnewfuncrrr�_nest_functionSs

r%cCs&t|j|||j||�}|�||�|S)z'Return a Class after nesting within ob.)rrr
r)r#�
class_namerrZnewclassrrr�_nest_class[sr'cCs6i}t||pg���D]\}}t|t�r|||<q|S)z�Return Class objects for the top-level classes in module.

    This is the original interface, before Functions were added.
    )�_readmodule�itemsr"r)r�path�res�key�valuerrrras


cCst||p
g�S)z�Return a dictionary with all functions and classes in module.

    Search for module in PATH + sys.path.
    If possible, include imported superclasses.
    Do this by reading source, without importing (and executing) it.
    )r()rr*rrrrmsc	Cs�|dk	rd||f}n|}|tkr*t|Si}|tjkrL|dkrL|t|<|S|�d�}|dkr�|d|�}||dd�}t|||�}|dk	r�d||f}d|kr�td�|���t||d|�Sd}	|dk	r�|}
n
|tj}
tj	�
||
�}|dk�rtd|��|d	��|t|<|jdk	�r$|j|d<z|j
�|�}Wnttfk
�rR|YSX|dk�rb|S|j
�|�}
t|||
|||�S)
a.Do the hard work for readmodule[_ex].

    If inpackage is given, it must be the dotted name of the package in
    which we are searching for a submodule, and then PATH must be the
    package search path; otherwise, we are searching for a top-level
    module, and path is combined with sys.path.
    Nz%s.%s�.r��__path__zNo package named {}zno module named )r)�_modules�sys�builtin_module_names�rfindr(�ImportError�formatr*�	importlib�util�_find_spec_from_path�ModuleNotFoundError�submodule_search_locations�loader�
get_source�AttributeError�get_filename�_create_tree)rr*�	inpackage�
fullmodule�tree�i�packageZ	submoduler�fZsearch_path�spec�source�fnamerrrr(vsJ	





r(c!
CsHt�|�}g}t�|j�}�z|D�]�\}	}
}}}
|	tkr`|\}}|r^|dd|kr^|d=qBq"|
dkr�|\}}|r�|dd|kr�|d=qpt|�dd�\}	}}|	tkr�q"d}|r�|dd}t|||�}nt	||||�}|||<|�
||f�q"|
dk�r�|\}}|�r(|dd|k�r(|d=�qt|�dd�\}	}}|	tk�rJq"t|�dd�\}	}
}d}|
dk�r�g}d}g}t|�dd�\}	}
}|
d	k�r|dk�rd
�|�}||k�r�||}nL|�d�}t
|�dk�r|d}|d}|tk�rt|}||k�r||}|�
|�g}|
dk�r0|d7}nZ|
d
k�rR|d8}|dk�r��q�n8|
dk�rh|dk�rhn"|	ttfk�rz|dk�rz|�
|
��qz|}|�r�|dd}t||||�}nt|||||�}|||<|�
||f�q"|
dk�rh|ddk�rht|�}|D]d\}}zL|dk�r t||�n2zt|||�Wn tk
�rPt|g�YnXWnYnX�qq"|
dkr"|ddkr"t|�\}}
|r"|
dk�r�q"t|�}zt|||�}WnYq"YnX|D]X\}} ||k�r�|||| �p�|<n0|dk�r�|D] }|ddk�r�||||<�q��q�q"Wntk
�r:YnX|��|S)a�Return the tree for a particular module.

    fullmodule (full module name), inpackage+module, becomes o.module.
    path is passed to recursive calls of _readmodule.
    fname becomes o.file.
    source is tokenized.  Imports cause recursive calls to _readmodule.
    tree is {} or {'__path__': <submodule search locations>}.
    inpackage, None or string, is passed to recursive calls of _readmodule.

    The effect of recursive calls is mutation of global _modules.
    ���r/�defr�N�class�()�)�,�r.���rOrP�import�from�*�_)�io�StringIO�tokenize�generate_tokens�readliner�nextrr%r�append�join�split�lenr1rr'r�_getnamelistr(r5�_getname�
StopIteration�close)!rBr*rIrHrCrArF�stack�g�	tokentype�token�startZ_end�_linerZ
thisindentr$Zcur_funcZcur_objr&Zinherit�names�levelr�n�c�m�dZ	cur_class�modules�modZ_mod2Zn2rrrr@�s�
















��



r@cCslg}t|�\}}|sqh|dkr,t|�\}}nd}|�||f�|dkr\d|kr\t|�d}q>|dkrqhq|S)z�Return list of (dotted-name, as-name or None) tuples for token source g.

    An as-name is the name that follows 'as' in an as clause.
    �asNrP�
r/)rbr]r\)rfrkrrhZname2rrrraEsracCs�g}t|�dd�\}}|tkr0|dkr0d|fS|�|�t|�dd�\}}|dkrXq�t|�dd�\}}|tkrvq�|�|�q:d�|�|fS)zBReturn (dotted-name or None, next-token) tuple for token source g.r�rUNr.)r\rr]r^)rf�partsrgrhrrrrb[s
rbc
CsXddl}ztjd}Wnt}YnX|j�|�rj|j�|�g}|j�|�}|���	d�rn|dd�}ng}t
||�}dd�}t|��|dd	�}d
}|�rT|�
�}t|t�r�q�t|d�s�d|_t|t�r�t|j��|dd	�}|D]}	|j||	_q�|�|�t|t��r,td�d
|j|j|j|j��q�t|t�r�td�d
|j|j|j��q�dS)z?Print module output (default this file) for quick visual check.rNr/z.py���cSst|dd�S)Nrr)�getattr)�arrr�<lambda>|�z_main.<locals>.<lambda>T)r,�reverseru�indentz{}class {} {} {}� z{}def {} {})�osr2�argv�__file__r*�exists�dirname�basename�lower�endswithr�sorted�values�popr"�list�hasattrr}r	r�extendr�printr6rrrr)
rrrr*rCZ
lineno_keyZobjsZindent_levelrZnew_objsr#rrr�_mainmsL





�
�
r��__main__)N)N)N)N)rrWr2�importlib.utilr7rYrhrrr�__all__r1r	rrr%r'rrr(r@rarbr�rrrrr�<module>s,(


	
@&__pycache__/_sitebuiltins.cpython-38.opt-1.pyc000064400000006633151153537550015242 0ustar00U

e5d+�@s@dZddlZGdd�de�ZGdd�de�ZGdd�de�ZdS)	z=
The objects used by the site module to add custom builtins.
�Nc@s&eZdZdd�Zdd�Zddd�ZdS)	�QuittercCs||_||_dS�N��name�eof)�selfrr�r�%/usr/lib64/python3.8/_sitebuiltins.py�__init__szQuitter.__init__cCsd|j|jfS)NzUse %s() or %s to exitr�rrrr	�__repr__szQuitter.__repr__NcCs(ztj��WnYnXt|��dSr)�sys�stdin�close�
SystemExit)r�coderrr	�__call__s
zQuitter.__call__)N)�__name__�
__module__�__qualname__r
rrrrrr	r
src@s6eZdZdZdZd
dd�Zdd�Zdd	�Zd
d�ZdS)�_Printerzninteractive prompt objects for printing the license text, a list of
    contributors and the copyright notice.�rcs4ddl�||_||_d|_��fdd�|D�|_dS)Nrcs$g|]}�D]}�j�||��qqSr)�path�join)�.0�dir�filename��files�osrr	�
<listcomp>(s�z%_Printer.__init__.<locals>.<listcomp>)r�_Printer__name�_Printer__data�_Printer__lines�_Printer__filenames)rr�datar�dirsrrr	r
#s�z_Printer.__init__c
Cs~|jr
dSd}|jD]B}z(t|d��}|��}W5QRXWqXWqtk
rTYqXq|sb|j}|�d�|_t|j�|_dS)N�r�
)	r#r$�open�read�OSErrorr"�split�len�_Printer__linecnt)rr%r�fprrr	�__setup,s

z_Printer.__setupcCs8|��t|j�|jkr$d�|j�Sd|jfdSdS)Nr(z!Type %s() to see the full %s text�)�_Printer__setupr-r#�MAXLINESrr!rrrr	r<sz_Printer.__repr__cCs�|��d}d}z(t|||j�D]}t|j|�q"Wntk
rPYq�YqX||j7}d}|dkr~t|�}|dkr`d}q`|dkrq�qdS)Nz0Hit Return for more, or q (and Return) to quit: r)��qr5)r2�ranger3�printr#�
IndexError�input)r�prompt�lineno�i�keyrrr	rCs 

z_Printer.__call__N)rr)	rrr�__doc__r3r
r2rrrrrr	rs
	rc@s eZdZdZdd�Zdd�ZdS)�_Helpera3Define the builtin 'help'.

    This is a wrapper around pydoc.help that provides a helpful message
    when 'help' is typed at the Python interactive prompt.

    Calling help() at the Python prompt starts an interactive help session.
    Calling help(thing) prints help for the python object 'thing'.
    cCsdS)NzHType help() for interactive help, or help(object) for help about object.rrrrr	rbsz_Helper.__repr__cOsddl}|j||�S)Nr)�pydoc�help)r�args�kwdsr@rrr	resz_Helper.__call__N)rrrr>rrrrrr	r?Xs	r?)r>r
�objectrrr?rrrr	�<module>s
;__pycache__/traceback.cpython-38.opt-2.pyc000064400000025435151153537550014306 0ustar00U

e5d;\�@s6ddlZddlZddlZddlZdddddddd	d
ddd
dddddddgZd2dd�Zdd�Zd3dd�Zd4dd�Zd5dd�Z	dZ
dZd6dd�Zd7dd�Z
d d�Zd!d"�Zd#d$�Zd8d%d	�Zd9d&d
�Zd:d'd�Zd;d(d
�Zd<d)d�Zd=d*d�Zd+d�ZGd,d�d�Zd-d�Zd.d�Zd/ZGd0d�de�ZGd1d�d�ZdS)>�N�
extract_stack�
extract_tb�format_exception�format_exception_only�format_list�format_stack�	format_tb�	print_exc�
format_exc�print_exception�
print_last�print_stack�print_tb�clear_frames�FrameSummary�StackSummary�TracebackException�
walk_stack�walk_tbcCs4|dkrtj}t�|���D]}t||dd�qdS)N���file�end)�sys�stderrr�	from_list�format�print)�extracted_listr�item�r �!/usr/lib64/python3.8/traceback.py�
print_listsr"cCst�|���S�N)rrr)rr r r!rscCstt||d�|d�dS�N��limit)r)r"r)�tbr&rr r r!r-scCst||d���S�Nr%)rr�r'r&r r r!r7scCstjt|�|d�Sr()r�extractrr)r r r!r;s
zG
The above exception was the direct cause of the following exception:

zF
During handling of the above exception, another exception occurred:

TcCsB|dkrtj}tt|�|||d�j|d�D]}t||dd�q*dS)Nr%��chainrr)rrr�typerr)�etype�valuer'r&rr,�liner r r!rWs��
cCs ttt|�|||d�j|d��S)Nr%r+)�listrr-r)r.r/r'r&r,r r r!rls��cCstt||d����Sr#)r1rr)r.r/r r r!r|scCs.t|�}|dks|sd|}nd||f}|S)Nz%s
z%s: %s
)�	_some_str)r.r/�valuestrr0r r r!�_format_final_exc_line�s

r4cCs*z
t|�WSdt|�jYSXdS)Nz<unprintable %s object>)�strr-�__name__)r/r r r!r2�s
r2cCstt��|||d��dS)N�r&rr,)rr�exc_infor7r r r!r	�scCsd�tt��||d���S)Nr�r&r,)�joinrrr8r9r r r!r
�scCs.ttd�std��ttjtjtj|||�dS)N�	last_typezno last exception)�hasattrr�
ValueErrorrr;�
last_value�last_tracebackr7r r r!r�s
�cCs*|dkrt��j}tt||d�|d�dSr$)r�	_getframe�f_backr"r)�fr&rr r r!r
�s
cCs"|dkrt��j}tt||d��Sr()rr@rArr)rBr&r r r!r�s
cCs0|dkrt��j}tjt|�|d�}|��|Sr()rr@rArr*r�reverse)rBr&�stackr r r!r�s
	
cCs8|dk	r4z|j��Wntk
r*YnX|j}qdSr#)�tb_frame�clear�RuntimeError�tb_next�r'r r r!r�sc@sVeZdZdZdddd�dd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	e
dd��ZdS)r)�filename�lineno�name�_line�localsTN)�lookup_linerNr0cCsB||_||_||_||_|r"|j|r8dd�|��D�nd|_dS)NcSsi|]\}}|t|��qSr )�repr)�.0�k�vr r r!�
<dictcomp>sz)FrameSummary.__init__.<locals>.<dictcomp>)rJrKrLrMr0�itemsrN)�selfrJrKrLrOrNr0r r r!�__init__�szFrameSummary.__init__cCs`t|t�r:|j|jko8|j|jko8|j|jko8|j|jkSt|t�r\|j|j|j|jf|kStSr#)	�
isinstancerrJrKrLrN�tupler0�NotImplemented�rV�otherr r r!�__eq__s

�
�
�
zFrameSummary.__eq__cCs|j|j|j|jf|Sr#)rJrKrLr0)rV�posr r r!�__getitem__szFrameSummary.__getitem__cCst|j|j|j|jg�Sr#)�iterrJrKrLr0�rVr r r!�__iter__szFrameSummary.__iter__cCsdj|j|j|jd�S)Nz7<FrameSummary file {filename}, line {lineno} in {name}>)rJrKrL)rrJrKrLrar r r!�__repr__s
�zFrameSummary.__repr__cCsdS)N�r rar r r!�__len__szFrameSummary.__len__cCs&|jdkr t�|j|j���|_|jSr#)rM�	linecache�getlinerJrK�striprar r r!r0s
zFrameSummary.line)r6�
__module__�__qualname__�	__slots__rWr]r_rbrcre�propertyr0r r r r!r�s�
ccs4|dkrt��jj}|dk	r0||jfV|j}qdSr#)rr@rA�f_lineno)rBr r r!r$s
ccs"|dk	r|j|jfV|j}qdSr#)rE�	tb_linenorHrIr r r!r1s�c@s6eZdZedddd�dd��Zedd��Zd	d
�ZdS)rNTF�r&�lookup_lines�capture_localsc

Cs�|dkr(ttdd�}|dk	r(|dkr(d}|dk	rV|dkrFt�||�}ntj||d�}|�}t�}|D]Z\}}|j}	|	j}
|	j	}|�
|
�t�|
|j
�|r�|j}nd}|�t|
||d|d��qf|D]}
t�|
�q�|r�|D]
}|jq�|S)N�tracebacklimitr)�maxlenF)rOrN)�getattrr�	itertools�islice�collections�deque�set�f_code�co_filename�co_name�addrf�	lazycache�	f_globals�f_locals�appendr�
checkcacher0)
�klass�	frame_genr&rqrr�result�fnamesrBrK�corJrLr�r r r!r*As@
�
zStackSummary.extractc	CsLt�}|D]<}t|t�r$|�|�q
|\}}}}|�t||||d��q
|S)N)r0)rrXrr�)r��a_listr��framerJrKrLr0r r r!rqs

zStackSummary.from_listc
Csng}d}d}d}d}|D�]}|dksT||jksT|dksT||jksT|dksT||jkr�|tkr�|t8}|�d|�d|dkr|dnd�d��|j}|j}|j}d}|d7}|tkr�qg}|�d�|j|j|j��|jr�|�d	�|j����|j�r t	|j�
��D]\}}	|�d
j||	d���q|�d�|��q|tk�rj|t8}|�d|�d|dk�r^dnd�d��|S)Nrz  [Previous line repeated z
 more time��srz]
z  File "{}", line {}, in {}
�    {}
z    {name} = {value}
)rLr/)rJrKrL�_RECURSIVE_CUTOFFr�rr0rhrN�sortedrUr:)
rVr��	last_file�	last_line�	last_name�countr��rowrLr/r r r!r�sZ
������
�zStackSummary.format)r6rirj�classmethodr*rrr r r r!r>s�/
c@sZeZdZddddd�dd�Zedd��Zd	d
�Zdd�Zd
d�Zdd�Z	dd�dd�Z
dS)rNTF�r&rqrr�_seenc	CsJ|dkrt�}|�t|��|r\|jdk	r\t|j�|kr\tt|j�|j|jj|d||d�}nd}|r�|jdk	r�t|j�|kr�tt|j�|j|jj|d||d�}	nd}	||_|	|_|r�|jnd|_t	j
t|�|||d�|_||_
t|�|_|�r8t|t��r8|j|_|j}
|
dk	�rt|
�nd|_|j|_|j|_|j|_|�rF|��dS)NFr�rp)rzr~�id�	__cause__rr-�
__traceback__�__context__�__suppress_context__rr*rrD�exc_typer2�_str�
issubclass�SyntaxErrorrJrKr5�text�offset�msg�_load_lines)rVr��	exc_value�
exc_tracebackr&rqrrr��cause�context�lnor r r!rW�sd��	��	��
zTracebackException.__init__cOs|t|�||jf|�|�Sr#)r-r�)�cls�exc�args�kwargsr r r!�from_exceptionsz!TracebackException.from_exceptioncCs6|jD]
}|jq|jr"|j��|jr2|j��dSr#)rDr0r�r�r�)rVr�r r r!r�s

zTracebackException._load_linescCs|j|jkSr#)�__dict__r[r r r!r]szTracebackException.__eq__cCs|jSr#)r�rar r r!�__str__szTracebackException.__str__ccs6|jdkrtd|j�VdS|jj}|jj}|dkr@|d|}t|jt�s^t||j�VdSd}|jdk	r�d�|j	pxd|j�Vn|j	dk	r�d�|j	�}|j
}|j}|dk	�rd�|���V|dk	�r|�
d�}tt|�|�d	}|d|���}d
d�|D�}d�d�|��V|j�p d
}d�|||�VdS)N)�__main__�builtins�.rz  File "{}", line {}
z<string>z ({})r��
r�css|]}|��r|pdVqdS)� N)�isspace)rQ�cr r r!�	<genexpr>Msz;TracebackException.format_exception_only.<locals>.<genexpr>z    {}^
z<no detail available>z	{}: {}{}
)r�r4r�rjrir�r�rKrrJr�r�rh�rstrip�min�len�lstripr:r�)rV�stype�smod�filename_suffix�badliner��
caretspacer�r r r!r"s<

�



z(TracebackException.format_exception_onlyr+ccs�|rT|jdk	r*|jj|d�EdHtVn*|jdk	rT|jsT|jj|d�EdHtV|jrpdV|j��EdH|��EdHdS)Nr+z#Traceback (most recent call last):
)r�r�_cause_messager�r��_context_messagerDr)rVr,r r r!rRs

�zTracebackException.format)r6rirjrWr�r�r�r]r�rrr r r r!r�s�:
	0)N)NN)N)N)NNT)NT)NNT)NT)NNT)NNN)NN)NN)rxrvrfr�__all__r"rrrrr�r�rrrr4r2r	r
rr
rrrrrrr�r1rrr r r r!�<module>s`�




��







A
z__pycache__/platform.cpython-38.opt-1.pyc000064400000057410151153537550014210 0ustar00U

e5d��@sldZdZdZddlZddlZddlZddlZddddddd	d	d
d
d�
Ze�d�Z	d
d�Z
e�dej�Zdwdd�Z
dxdd�Ze�d�Zdydd�Zddddddd d!d"d#d$d%�Zdd&d'd(d)d*d+�Zd,d-�Zd.d/�Zdzd0d1�Zd2d3�Zd{d5d6�Zd7d8�Zd|d9d:�Zd;d<�Zd=d>�Zd}d?d@�ZdAdB�Zd~dCdD�ZddEdF�ZdGdHdId�Z ej!ddfdJdK�Z"e�#dLdM�Z$da%dNdO�Z&dPdQ�Z'dRdS�Z(dTdU�Z)dVdW�Z*dXdY�Z+dZd[�Z,e�d\ej�Z-e�d]ej�Z.e�d^�Z/e�d_�Z0iZ1d�d`da�Z2dbdc�Z3ddde�Z4dfdg�Z5dhdi�Z6djdk�Z7dldm�Z8dndo�Z9iZ:d�dpdq�Z;e<drk�rhdsej=k�p8dtej=kZ>duej=k�oNdvej=kZ?e@e;e?e>��e�Ad�dS)�a8 This module tries to retrieve as much platform-identifying data as
    possible. It makes this information available via function APIs.

    If called from the command line, it prints the platform
    information concatenated as single string to stdout. The output
    format is useable as part of a filename.

a
    Copyright (c) 1999-2000, Marc-Andre Lemburg; mailto:mal@lemburg.com
    Copyright (c) 2000-2010, eGenix.com Software GmbH; mailto:info@egenix.com

    Permission to use, copy, modify, and distribute this software and its
    documentation for any purpose and without fee or royalty is hereby granted,
    provided that the above copyright notice appear in all copies and that
    both that copyright notice and this permission notice appear in
    supporting documentation or portions thereof, including modifications,
    that you make.

    EGENIX.COM SOFTWARE GMBH DISCLAIMS ALL WARRANTIES WITH REGARD TO
    THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
    FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
    INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
    FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
    NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
    WITH THE USE OR PERFORMANCE OF THIS SOFTWARE !

z1.0.8�N�
���(�2��)
ZdevZalpha�aZbeta�b�cZRCZrc�pl�pz([0-9]+|[._+-])c	Csbg}t�|�D]N}|dkrzt|d�}d}Wn tk
rLt�|d�}YnX|�||f�q|S)Nz._+-r�dr)�
_component_re�split�int�
ValueError�_ver_stages�get�extend)�version�result�v�t�r� /usr/lib64/python3.8/platform.py�_comparable_version�s
rsC(__libc_init)|(GLIBC_([0-9.]+))|(libc(_\w+)?\.so(?:\.(\d[0-9.]*))?)��@c
Cs�|dkrZz0t�d�}|jdd�}t|�dkr6t|�WSWntttfk
rRYnXtj	}t
}ttjd�rvtj�
|�}t|d���`}|�|�}d}	|	t|�k�r�d	|ks�d
|kr�t�||	�}
nd}
|
r�|
��t|�k�r|�|�}|�r|t|	t|�d�d�|}d}	q�|
�s�q�dd
�|
��D�\}}
}}}}|�rF|�sFd}n�|
�rx|dk�r`d}|}n||�||�k�r�|}n\|�r�|dk�r�d}|�r�|�r�||�||�k�r�|}|�r�|t|�d�|k�r�||}|
��}	q�W5QRX||fS)a Tries to determine the libc version that the file executable
        (which defaults to the Python interpreter) is linked against.

        Returns a tuple of strings (lib,version) which default to the
        given parameters in case the lookup fails.

        Note that the function has intimate knowledge of how different
        libc versions add symbols to the executable and thus is probably
        only useable for executables compiled using gcc.

        The file is read and scanned in chunks of chunksize bytes.

    N�CS_GNU_LIBC_VERSION�)�maxsplit��realpath�rbrslibcsGLIBCi�cSs"g|]}|dk	r|�d�n|�qS)N�latin1)�decode)�.0�srrr�
<listcomp>�s�zlibc_ver.<locals>.<listcomp>Zlibc�glibc)�os�confstrr�len�tuple�AttributeErrorr�OSError�sys�
executabler�hasattr�pathr"�open�read�_libc_search�search�end�max�groups)r1�librZ	chunksize�ver�parts�V�fZbinary�pos�m�chunkZlibcinitr)ZglibcversionZsoZthreadsZ	soversionrrr�libc_ver�s^


�

rCcCs`|�d�}|r|�|�zttttt|���}Wntk
rH|}YnXd�|dd��}|S)z� Normalize the version and build strings and return a single
        version string using the format major.minor.build (or patchlevel).
    �.N�)r�append�list�map�strrr�join)r�build�lZstringsrrr�
_norm_version�s


rMz'(?:([\w ]+) ([\w.]+) .*\[.* ([\d.]+)\])��win32�win16�dosc	Cs�tj|kr|||fSddl}dD]R}z|j||jddd�}Wn0t|jfk
rl}zWY�q W5d}~XYq Xq~q |||fS|��}t�	|�}|dk	r�|�
�\}}}|ddkr�|dd�}|ddkr�|dd�}t|�}|||fS)a+ Tries to figure out the OS version used and returns
        a tuple (system, release, version).

        It uses the "ver" shell command for this which is known
        to exists on Windows, DOS. XXX Others too ?

        In case this fails, the given parameters are used as
        defaults.

    rN)r<zcommand /c verz
cmd /c verT)�stderr�text�shell���rD)r0�platform�
subprocess�check_output�DEVNULLr/�CalledProcessError�strip�_ver_output�matchr:rM)	�system�releaserZsupported_platformsrW�cmd�infoZwhyrArrr�_syscmd_vers0

�


rbZ2000ZXPZ
2003ServerZpost2003�Vista�7�8z8.1zpost8.1Z10Zpost10))�r)rfr�rfr!)rfN��r�rir�rir!�rirE�riN)rr)rNZ
2008ServerZ2008ServerR2Z
2012ServerZ2012ServerR2Zpost2012ServerR2)rgrhrjrkrlrmcCs
t�dkS)N)ZIoTUAPZ
NanoServerZWindowsCoreHeadlessZ	IoTEdgeOS)�
win32_editionrrrr�win32_is_iotOsroc
Cs�z.zddl}Wntk
r*ddl}YnXWntk
rBYnTXz<d}|�|j|�� }|�|d�dW5QR�WSQRXWntk
r�YnXdS)Nr�,SOFTWARE\Microsoft\Windows NT\CurrentVersionZ	EditionId)�winreg�ImportError�_winreg�	OpenKeyEx�HKEY_LOCAL_MACHINE�QueryValueExr/)rq�cvkey�keyrrrrnRs(rnc	Cs�zddlm}Wn tk
r0||||fYSX|�}z ttt�d�d��\}}}Wn,tk
r�|jpx|dd�\}}}YnXd�	|||�}t
�||f�p�t
�|df�p�|}|dd�||fk�rzd�	|j�}Wn8t
k
�r|dd�d	k�rd
|dd�}YnXt|dd�dk�rJt�||f��pHt�|df��pH|}z0zddl}	Wntk
�rvddl}	YnXWntk
�r�YnLXz2d}
|	�|	j|
��}|	�|d
�d}W5QRXWntk
�r�YnX||||fS)Nr)�getwindowsversionr!rDrEz{0}.{1}.{2}zSP{}�
z
Service Pack ZSPZproduct_typerpZCurrentType)r0ryrrrHrrbrrZplatform_version�format�_WIN32_CLIENT_RELEASESrZservice_pack_majorr.�getattr�_WIN32_SERVER_RELEASESrqrsrtrurvr/)r_r�csd�ptyperyZwinver�major�minorrKrqrwrxrrr�	win32_verdsR ����r�c	Cs�d}tj�|�sdSzddl}Wntk
r6YdSXt|d��}|�|�}W5QRX|d}d}t��j}|dkrzd}|||fS)Nz0/System/Library/CoreServices/SystemVersion.plistrr#ZProductVersion�rrr)ZppczPower MacintoshZPowerPC)	r*r3�exists�plistlibrrr4�load�uname�machine)�fnr�r?rr_�versioninfor�rrr�_mac_ver_xml�s
r�r�cCst�}|dk	r|S|||fS)a< Get macOS version information and return it as tuple (release,
        versioninfo, machine) with versioninfo being a tuple (version,
        dev_stage, non_release_version).

        Entries which cannot be determined are set to the parameter values
        which default to ''. All tuple entries are strings.
    N)r�)r_r�r�rarrr�mac_ver�sr�cCsHddlm}z|�|�}|dkr&|WS|WStk
rB|YSXdS)Nr)�System)�	java.langr�ZgetPropertyr.)�name�defaultr��valuerrr�
_java_getprop�s
r�cCs�zddl}Wn tk
r,||||fYSXtd|�}td|�}|\}}}td|�}td|�}td|�}|||f}|\}}	}
td|
�}
td	|�}td
|	�}	||	|
f}||||fS)a] Version interface for Jython.

        Returns a tuple (release, vendor, vminfo, osinfo) with vminfo being
        a tuple (vm_name, vm_release, vm_vendor) and osinfo being a
        tuple (os_name, os_version, os_arch).

        Values which cannot be determined are set to the defaults
        given as parameters (which all default to '').

    rNzjava.vendorzjava.versionzjava.vm.namezjava.vm.vendorzjava.vm.versionzjava.os.archzjava.os.namezjava.os.version)r�rrr�)r_�vendor�vminfo�osinfo�javaZvm_nameZ
vm_releaseZ	vm_vendor�os_name�
os_version�os_archrrr�java_ver�s"












r�cCs�|dkr�|dkr|||fS|�d�}|rlzt|d�}Wntk
rLYn X|d}t|�|d<d�|�}|dkrzd}q�d}n,|dkr�d	}|r�|d
}q�d}n|dkr�d
}|||fS)z� Returns (system, release, version) aliased to common
        marketing names used for some systems.

        It also does some reordering of the information in some cases
        where it would otherwise cause confusion.

    ZSunOS�5rDrrE�6ZSolarisZIRIX64ZIRIXz (64bit)�64bit�rOrP�Windows)rrrrIrJ)r^r_rrLr�rrr�system_alias�s.	



r�cGs�d�dd�tt|�D��}|�dd�}|�dd�}|�dd�}|�dd�}|�d	d�}|�d
d�}|�dd�}|�dd�}|�d
d�}|�dd�}||kr�q�|}q�|ddkr�|dd�}q�|S)zq Helper to format the platform string in a filename
        compatible format e.g. "system-version-machine".
    �-css|]}|��VqdS)N)r[)r&�xrrr�	<genexpr>(sz_platform.<locals>.<genexpr>� �_�/�\�:�;�"�(�)�unknownrz--rUN)rJ�filterr,�replace)�argsrVZcleanedrrr�	_platform"s"r�cCsNzddl}Wntk
r$|YSXz
|��WStk
rH|YSXdS)z8 Helper to determine the node name of this machine.
    rN)�socketrrZgethostnamer/)r�r�rrr�_nodeBs

r�cCsBtj�|�}tj�|�r>tj�tj�tj�|�t�|���}q|S)zT In case filepath is a symlink, follow it until a
        real file is reached.
    )r*r3�abspath�islink�normpathrJ�dirname�readlink)�filepathrrr�_follow_symlinksQs�r�c	Cs\tjdkr|Sddl}z|jd|f|jdd�}Wnt|jfk
rN|YSX|��pZ|S)z. Interface to the system's uname command.
    �rQrOrPrNr�T)rRrS)r0rVrWrXrYr/rZr[)Zoptionr�rW�outputrrr�
_syscmd_uname\s

�

r�c	Csztjdkr|Sddl}t|�}ttjdd�}z|jdd|g|j|d�}Wnt	|j
fk
rf|YSX|sp|S|�d	�S)
z� Interface to the system's file command.

        The function uses the -b option of the file command to have it
        omit the filename in its output. Follow the symlinks. It returns
        default in case the command should fail.

    r�rN�C)�LC_ALL�filez-b)rR�envzlatin-1)r0rVrWr��dictr*�environrXrYr/rZr%)�targetr�rWr�r�rrr�_syscmd_filems	
�

r�)r�	WindowsPE)rr�)r�MSDOScCs|s&ddl}|�d�}t|d�d}|r6t|d�}nd}|sx|tjkrxtjtkrpttj\}}|rh|}|rp|}||fSd|kr�d|kr�||fSd	|kr�d
}nd|kr�d}nd
|kr�d}d|kr�d}n8d|kr�d|kr�d}q�d}nd|kr�d}nd|kr�d}n||fS)a� Queries the given executable (defaults to the Python interpreter
        binary) for various architecture information.

        Returns a tuple (bits, linkage) which contains information about
        the bit architecture and the linkage format used for the
        executable. Both values are returned as strings.

        Values that cannot be determined are returned as given by the
        parameter presets. If bits is given as '', the sizeof(pointer)
        (or sizeof(long) on Python version < 1.5.2) is used as
        indicator for the supported pointer size.

        The function relies on the system's "file" command to do the
        actual work. This is available on most if not all Unix
        platforms. On some non-Unix platforms where the "file" command
        does not exist and the executable is set to the Python interpreter
        binary defaults from _default_architecture are used.

    rN�P��bitrr1z
shared objectz32-bit�32bitZN32Zn32bitz64-bitr�ZELFZPEr�r�ZCOFFzMS-DOSr�)�structZcalcsizerIr�r0r1rV�_default_architecture)r1�bits�linkager��sizeZfileoutr	rLrrr�architecture�sH
�
r��uname_resultz-system node release version machine processorcCs�d}tdk	rtSd}zt��\}}}}}Wntk
rBd}YnX|sbttd|||||f���s�|r~tj}d}d}t�}d}d}|dkr�t	�\}}}}	|r�|r�d}|s�dtj
kr�tj
�dd�}ntj
�dd�}|s�tj
�d|�}|�r:t|�\}}}|d	k�rd
}n4|dk�r:|d
k�r:d
}d|dd
�k�r6d}nd}|dk�rd|�s^|dk�rZd}nd}d
}n8|dd�dk�r�t
�\}}
}}d}d�|�}|�s�|
}|dk�r|�r�|dk�r�|}d}zddl}
Wntk
�r�Yn&X|
�dd�\}}|dk�rd}nd}|�stdd�}|dk�r$d}|dk�r2d}|dk�r@d}|dk�rNd}|dk�r\d}|dk�rjd}|dk�r�|d
k�r�d
}d}t||||||�atS)an Fairly portable uname interface. Returns a tuple
        of strings (system, node, release, version, machine, processor)
        identifying the underlying platform.

        Note that unlike the os.uname function this also returns
        possible processor information as an additional tuple entry.

        Entries which cannot be determined are set to ''.

    rNrrrOZPROCESSOR_ARCHITEW6432ZPROCESSOR_ARCHITECTUREZPROCESSOR_IDENTIFIERzMicrosoft Windowsr�Z	Microsoftz6.0rErcr�r�Z16bit�r��Javaz, ZOpenVMS�0zSYI$_CPU�ZAlphaZVAXz-pr�)�_uname_cacher*r�r.rGr�r0rVr�r�r�rrbr�rJ�vms_librrZgetsyir�r�)Zno_os_uname�	processorr^�noder_rr�Zuse_syscmd_verrr�r�r�r�r�ZcsidZ
cpu_numberrrrr��s�
















�r�cCst�jS)z� Returns the system/OS name, e.g. 'Linux', 'Windows' or 'Java'.

        An empty string is returned if the value cannot be determined.

    )r�r^rrrrr^usr^cCst�jS)z� Returns the computer's network name (which may not be fully
        qualified)

        An empty string is returned if the value cannot be determined.

    )r�r�rrrrr�~sr�cCst�jS)z� Returns the system's release, e.g. '2.2.0' or 'NT'

        An empty string is returned if the value cannot be determined.

    )r�r_rrrrr_�sr_cCst�jS)z� Returns the system's release version, e.g. '#3 on degas'

        An empty string is returned if the value cannot be determined.

    )r�rrrrrr�srcCst�jS)zt Returns the machine type, e.g. 'i386'

        An empty string is returned if the value cannot be determined.

    )r�r�rrrrr��sr�cCst�jS)a Returns the (true) processor name, e.g. 'amdk6'

        An empty string is returned if the value cannot be
        determined. Note that many platforms do not provide this
        information or simply return the same value as for machine(),
        e.g.  NetBSD does this.

    )r�r�rrrrr��s
r�zL([\w.+]+)\s*\(#?([^,]+)(?:,\s*([\w ]*)(?:,\s*([\w :]*))?)?\)\s*\[([^\]]+)\]?z;IronPython\s*([\d\.]+)(?: \(([\d\.]+)\))? on (.NET [\d\.]+)zU([\d.]+)\s*\(IronPython\s*[\d.]+\s*\(([\d.]+)\) on ([\w.]+ [\d.]+(?: \(\d+-bit\))?)\)zE([\w.+]+)\s*\(#?([^,]+),\s*([\w ]+),\s*([\w :]+)\)\s*\[PyPy [^\]]+\]?cCs|dkrtj}t�|d�}|dk	r&|Sd|kr�d}|�d�rHt�|�}n
t�|�}|dkrjtdt	|���|�
�\}}}d}d}n�tj�d�r�d}t�|�}|dkr�tdt	|���|�
�\}}}}	}
|dkr�d}tj}n�d|k�r"d}t
�|�}|dk�rtd	t	|���|�
�\}}}}	d}n\t�|�}|dk�rFtd
t	|���|�
�\}}}}	}d}|dk�rld}n|	�r~|d|	}ttd
��r�tj\}
}}n"ttd��r�tj\}
}}nd}d}|�d�}
t|
�dk�r�|
�d�d�|
�}|||||||f}|t|<|S)a� Returns a parsed version of Python's sys.version as tuple
        (name, version, branch, revision, buildno, builddate, compiler)
        referring to the Python implementation name, version, branch,
        revision, build number, build date/time as string and the compiler
        identification string.

        Note that unlike the Python sys.version, the returned value
        for the Python version will always include the patchlevel (it
        defaults to '.0').

        The function returns empty strings for tuple entries that
        cannot be determined.

        sys_version may be given to parse an alternative version
        string, e.g. if the version was read from a different Python
        interpreter.

    NZ
IronPythonz*failed to parse IronPython sys.version: %srr�ZJythonz&failed to parse Jython sys.version: %sZPyPyz$failed to parse PyPy sys.version: %sz'failed to parse CPython sys.version: %sZCPythonr��_git�
_mercurialrDr!r�)r0r�_sys_version_cacher�
startswith�_ironpython_sys_version_parserr]� _ironpython26_sys_version_parserr�reprr:rV�_sys_version_parser�_pypy_sys_version_parserr2r�r�rr,rFrJ)�sys_versionrr�r]rZalt_versionZcompilerZbuildnoZ	builddateZ	buildtimer��branchZrevisionrLrrr�_sys_version�s�

��
��


�

���



r�cCs
t�dS)aR Returns a string identifying the Python implementation.

        Currently, the following implementations are identified:
          'CPython' (C implementation of Python),
          'IronPython' (.NET implementation of Python),
          'Jython' (Java implementation of Python),
          'PyPy' (Python implementation of Python).

    r�r�rrrr�python_implementation5sr�cCs
t�dS)z� Returns the Python version as string 'major.minor.patchlevel'

        Note that unlike the Python sys.version, the returned value
        will always include the patchlevel (it defaults to 0).

    rr�rrrr�python_versionBsr�cCstt�d�d��S)z� Returns the Python version as tuple (major, minor, patchlevel)
        of strings.

        Note that unlike the Python sys.version, the returned value
        will always include the patchlevel (it defaults to 0).

    rrD)r-r�rrrrr�python_version_tupleLs	r�cCs
t�dS)z� Returns a string identifying the Python implementation
        branch.

        For CPython this is the SCM branch from which the
        Python binary was built.

        If not available, an empty string is returned.

    r!r�rrrr�
python_branchWsr�cCs
t�dS)z� Returns a string identifying the Python implementation
        revision.

        For CPython this is the SCM revision from which the
        Python binary was built.

        If not available, an empty string is returned.

    rEr�rrrr�python_revisionesr�cCst�dd�S)zh Returns a tuple (buildno, builddate) stating the Python
        build number and date as strings.

    r�rir�rrrr�python_buildrsr�cCs
t�dS)zS Returns a string identifying the compiler used for compiling
        Python.

    rir�rrrr�python_compilerzsr�cCsbt�||fd�}|dk	r|St�\}}}}}}||kr:d}|rPt|||�\}}}|dkrnt�d}	|	rnd}|	}|dkr�t|�\}
}}}
|r�t||�}nt||||�}n�|dkr�ttj	�\}}t||||d||�}n~|d	k�r t
�\}}}\}}}|s�|�s
t|||�}nt|||d
|||�}n2|�r2t||�}n ttj	�\}}t||||||�}|t||f<|S)a� Returns a single string identifying the underlying platform
        with as much useful information as possible (but no more :).

        The output is intended to be human readable rather than
        machine parseable. It may look different on different
        platforms and this is intended.

        If "aliased" is true, the function will use aliases for
        various platforms that report system names which differ from
        their common names, e.g. SunOS will be reported as
        Solaris. The system_alias() function is used to implement
        this.

        Setting terse to true causes the function to return only the
        absolute minimum information needed to identify the platform.

    NrZDarwinrZmacOSr�)ZLinux�withr�Zon)�_platform_cacherr�r�r�r�r�rCr0r1r�r�)�aliased�terserr^r�r_rr�r�Z
macos_releaseZrelZversrr�rVZlibcnameZlibcversion�rrr�r�r�r�r�r�rrrrV�sX

�

��rV�__main__r�z--terseZ
nonaliasedz--nonaliased)Nrrr)r)rrrrN)rrrr)rr�r)rrr�r�)r)r)r)N)rr)B�__doc__Z
__copyright__�__version__�collectionsr*�rer0r�compilerr�ASCIIr6rCrMr\rbr|r~rornr�r�r�r�r�r�r�r�r�r�r�r�r1r��
namedtupler�r�r�r^r�r_rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rV�__name__�argvr�r��print�exitrrrr�<module>s�Y
�
�
G


�
1��

3

#4 


$�P�	
			����
h




L
__pycache__/quopri.cpython-38.opt-1.pyc000064400000012707151153537550013703 0ustar00U

e5dT�@s�dZddddgZdZdZdZdZzd	d
lmZmZWne	k
rPdZdZYnXdd
�Z
dd�Zddd�Zddd�Z
ddd�Zddd�Zdd�Zdd�Zdd�Zedkr�e�dS) zHConversions to/from quoted-printable transport encoding as per RFC 1521.�encode�decode�encodestring�decodestring�=�Ls0123456789ABCDEF��)�a2b_qp�b2a_qpNcCs:|dkr|S|dkr|S|tkp8d|ko2dknS)z�Decide whether a particular byte ordinal needs to be quoted.

    The 'quotetabs' flag indicates whether embedded tabs and spaces should be
    quoted.  Note that line-ending tabs and spaces are always encoded, as per
    RFC 1521.
    � 	�_� �~)�ESCAPE)�c�	quotetabs�header�r�/usr/lib64/python3.8/quopri.py�needsquotings
rcCs(t|�}ttt|dt|df�S)zQuote a single character.�)�ordr�bytes�HEX�rrrr�quote$srFc
Cs2tdk	r,|��}t|||d�}|�|�dS|dfdd�}d}|��}|sN�qg}	d}
|dd�dkrv|dd�}d}
|D]D}t|f�}t|||�r�t|�}|r�|dkr�|	�d	�qz|	�|�qz|dk	r�||�t�	|	�}t
|�tk�r||dtd
�dd�|td
d�}q�|}q>|dk	�r.|||
d�dS)
avRead 'input', apply quoted-printable encoding, and write to 'output'.

    'input' and 'output' are binary file objects. The 'quotetabs' flag
    indicates whether embedded tabs and spaces should be quoted. Note that
    line-ending tabs and spaces are always encoded, as per RFC 1521.
    The 'header' flag indicates whether we are encoding spaces as _ as per RFC
    1522.N�rr�
cSsj|r<|dd�dkr<|�|dd�t|dd��|�n*|dkrX|�t|�|�n|�||�dS)N���r�.)�writer)�s�output�lineEndrrrr ;s
(zencode.<locals>.writerrr
r�s=
)r#)r
�readr �readlinerrr�append�EMPTYSTRING�join�len�MAXLINESIZE)
�inputr"rr�data�odatar Zprevline�lineZoutline�strippedrZthislinerrrr,s>	




cCsFtdk	rt|||d�Sddlm}||�}|�}t||||�|��S)Nrr��BytesIO)r
�ior2r�getvalue)r!rrr2�infp�outfprrrrjscCs�tdk	r*|��}t||d�}|�|�dSd}|��}|s>�q�dt|�}}|dkr�||d|�dkr�d}	|d}|dkr�||d|�dkr�|d}qtnd}	||k�r�|||d�}
|
dkr�|r�|d	}|d}q�|
tkr�||
}|d}q�|d|k�r|	�sd}	�q�q�|d|k�rJ||d|d
�tk�rJ|t}|d
}q�|d
|k�r�t||d|d
���r�t||d
|d���r�|tt||d|d��f�}|d}q�||
}|d}q�|	s.|�|d�d}q.|�r�|�|�dS)z�Read 'input', apply quoted-printable decoding, and write to 'output'.
    'input' and 'output' are binary file objects.
    If 'header' is true, decode underscore as space (per RFC 1522).N�rrrr$rs 	
rr
��)	r	r%r r&r*r�ishexr�unhex)r,r"rr-r.�newr/�i�n�partialrrrrrusP



(
B"

cCsDtdk	rt||d�Sddlm}||�}|�}t|||d�|��S)Nr7rr1)r	r3r2rr4)r!rr2r5r6rrrr�scCsHd|kodknpFd|ko*dknpFd|koBdkSS)zDReturn true if the byte ordinal 'c' is a hexadecimal digit in ASCII.�0�9�a�f�A�Frrrrrr:�sr:cCs�d}|D]�}t|f�}d|kr*dkr8nn
td�}nLd|krLdkr^nntd�d}n&d	|krrd
kr�nntd	�d}n|dt|�|}q|S)z.Get the integer value of a hexadecimal number.rr@rA�0rBrC�a�
rDrEr)rr)r!�bitsrr=rrrr;�s

r;cCs�ddl}ddl}z|�|jdd�d�\}}WnV|jk
r�}z6|j|_t|�td�td�td�|�d�W5d}~XYnXd}d}|D] \}}|dkr�d}|d	kr�d}q�|r�|r�|j|_td
�|�d�|s�dg}d}	|D]�}
|
dkr�|jj	}nTzt
|
d�}WnDtk
�rP}z$|j�d
|
|f�d}	WY�q�W5d}~XYnXz*|�rjt||jj	�nt||jj	|�W5|
dk�r�|�
�Xq�|	�r�|�|	�dS)Nrr$Ztdz"usage: quopri [-t | -d] [file] ...z-t: quote tabsz-d: decode; default encoder8z-tz-dz -t and -d are mutually exclusive�-�rbz%s: can't open (%s)
)�sys�getopt�argv�error�stderr�stdout�print�exit�stdin�buffer�open�OSErrorr �closerr)rLrMZopts�args�msgZdecoZtabs�orG�sts�file�fprrr�main�sT


r_�__main__)F)FF)F)F)�__doc__�__all__rr+rr(Zbinasciir	r
�ImportErrorrrrrrrr:r;r_�__name__rrrr�<module>s*

>

+
.__pycache__/copy.cpython-38.pyc000064400000015515151153537550012377 0ustar00U

e5d�!�@sTdZddlZddlZddlmZGdd�de�ZeZzddlm	Z	Wne
k
r\dZ	YnXdddgZd	d�ZiZ
Zd
d�Zed�eeeeeeeeeeeeejee�ee�ejej fD]Z!eee!<q�e"edd�Z!e!dk	r�eee!<e#jee#<e$jee$<e%jee%<e&jee&<e	dk	�r e	jee	<[[!dgfd
d�Z'iZ(Zdd�Z)e)eed�<e)eee�<e)eee�<e)ee<e)ee<e)ee<e)ee<e)ee<e)ee<e)eej*<e)ee<e)eej<e)eej<e)eej <e)ee<e'fdd�Z+e+ee#<e'fdd�Z,e,ee<e'fdd�Z-e-ee$<e	dk	�re-ee	<dd�Z.e.eej/<[dd�Z0ddde'fdd�Z1[[[	dS)a�Generic (shallow and deep) copying operations.

Interface summary:

        import copy

        x = copy.copy(y)        # make a shallow copy of y
        x = copy.deepcopy(y)    # make a deep copy of y

For module specific errors, copy.Error is raised.

The difference between shallow and deep copying is only relevant for
compound objects (objects that contain other objects, like lists or
class instances).

- A shallow copy constructs a new compound object and then (to the
  extent possible) inserts *the same objects* into it that the
  original contains.

- A deep copy constructs a new compound object and then, recursively,
  inserts *copies* into it of the objects found in the original.

Two problems often exist with deep copy operations that don't exist
with shallow copy operations:

 a) recursive objects (compound objects that, directly or indirectly,
    contain a reference to themselves) may cause a recursive loop

 b) because deep copy copies *everything* it may copy too much, e.g.
    administrative data structures that should be shared even between
    copies

Python's deep copy operation avoids these problems by:

 a) keeping a table of objects already copied during the current
    copying pass

 b) letting user-defined classes override the copying operation or the
    set of components copied

This version does not copy types like module, class, function, method,
nor stack trace, stack frame, nor file, socket, window, nor array, nor
any similar types.

Classes can use the same interfaces to control copying that they use
to control pickling: they can define methods called __getinitargs__(),
__getstate__() and __setstate__().  See the documentation for module
"pickle" for information on these methods.
�N)�dispatch_tablec@seZdZdS)�ErrorN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/copy.pyr7sr)�PyStringMap�copy�deepcopycCs�t|�}t�|�}|r||�St|t�r0t|�St|dd�}|dk	rL||�St�|�}|dk	rh||�}nBt|dd�}|dk	r�|d�}n$t|dd�}|r�|�}ntd|��t|t	�r�|St
|df|��S)zlShallow copy operation on arbitrary Python objects.

    See the module's __doc__ string for more info.
    �__copy__N�
__reduce_ex__��
__reduce__z%un(shallow)copyable object of type %s)�type�_copy_dispatch�get�
issubclass�_copy_immutable�getattrrr�
isinstance�str�_reconstruct)�x�cls�copier�reductor�rvrrrr
Bs,





cCs|S�Nr)rrrrrksr�CodeTypec	Cs |dkri}t|�}|�||�}||k	r,|St|�}t�|�}|dk	rR|||�}n�t|t�rht||�}n�t|dd�}|dk	r�||�}nzt�|�}|r�||�}nBt|dd�}|dk	r�|d�}n$t|dd�}|r�|�}ntd|��t	|t
�r�|}nt||f|��}||k	�r|||<t||�|S)ziDeep copy operation on arbitrary Python objects.

    See the module's __doc__ string for more info.
    N�__deepcopy__r
rrz"un(deep)copyable object of type %s)
�idrr�_deepcopy_dispatchr�_deepcopy_atomicrrrrrr�_keep_alive)	r�memoZ_nil�d�yrrrrrrrr�sD





�


cCs|Srr�rr%rrrr#�sr#cCs2g}||t|�<|j}|D]}||||��q|Sr)r!�append)rr%rr'r)�arrr�_deepcopy_list�sr+csh��fdd�|D�}z�t|�WStk
r6YnXt||�D]\}}||k	rBt|�}qdqB|}|S)Ncsg|]}�|���qSrr)�.0r*�rr%rr�
<listcomp>�sz#_deepcopy_tuple.<locals>.<listcomp>)r!�KeyError�zip�tuple)rr%rr'�k�jrr-r�_deepcopy_tuple�sr4cCs:i}||t|�<|��D]\}}|||�||||�<q|Sr)r!�items)rr%rr'�key�valuerrr�_deepcopy_dict�s
r8cCst|�|jt|j|��Sr)r�__func__r�__self__r(rrr�_deepcopy_method�sr;cCs>z|t|��|�Wn"tk
r8|g|t|�<YnXdS)aMKeeps a reference to the object x in the memo.

    Because we remember objects by their id, we have
    to assure that possibly temporary objects are kept
    alive by referencing them.
    We store a reference at the id of the memo, which should
    normally not be used unless someone tries to deepcopy
    the memo itself...
    N)r!r)r/r(rrrr$�s
r$csb�dk	}|r$|r$��fdd�|D�}||�}	|r<|	�t|�<|dk	r�|rR�|��}t|	d�rh|	�|�n^t|t�r�t|�dkr�|\}}
nd}
|dk	r�|	j�|�|
dk	r�|
��D]\}}t	|	||�q�|dk	�r|r�|D]}
�|
��}
|	�
|
�q�n|D]}
|	�
|
�q�|dk	�r^|�rF|D]&\}}�|��}�|��}||	|<�qn|D]\}}||	|<�qJ|	S)Nc3s|]}�|��VqdSrr)r,�argr-rr�	<genexpr>sz_reconstruct.<locals>.<genexpr>�__setstate__�)r!�hasattrr>rr1�len�__dict__�updater5�setattrr))rr%�func�args�stateZlistiterZdictiterrZdeepr'Z	slotstater6r7�itemrr-rrsF







r)2�__doc__�types�weakref�copyregr�	Exceptionr�errorZorg.python.corer	�ImportError�__all__r
rr&rr�int�float�bool�complexrr1�bytes�	frozenset�range�slice�property�BuiltinFunctionType�Ellipsis�NotImplemented�FunctionType�ref�tr�list�dict�set�	bytearrayrr"r#rr+r4r8r;�
MethodTyper$rrrrr�<module>s�2

'�






4





�
-__pycache__/nturl2path.cpython-38.opt-2.pyc000064400000002457151153537550014471 0ustar00U

e5dG�@sdd�Zdd�ZdS)cCs�ddl}ddl}|�dd�}d|kr\|dd�dkr@|dd�}|�d�}|j�d�|��S|�d�}t|�dks�|dd	|jkr�d
|}t	|��|dd	�
�}|d�d�}|d}|D]}|r�|d|j�|�}q�|�d�r�|�d�r�|d7}|S)N��:�|�z////��/�\���z	Bad URL: �)�string�urllib.parse�replace�split�parseZunquote�join�lenZ
ascii_letters�OSError�upper�endswith)Zurlr
�urllib�
components�comp�error�drive�path�r�"/usr/lib64/python3.8/nturl2path.py�url2pathnames(	

rcCs4ddl}|dd�dkrf|dd�}|dd���dkrJd|dd�}n|dd�dkrftd	|��d|kr�|dd�d
kr�d
|}|�d�}|j�d�|��S|jddd�}t|�dks�t|d�dkr�d	|}t|��|j�|d���}|d�d�}d
|d}|D] }|�r|d|j�|�}�q|S)Nrrz\\?\zUNC\rr	rrz
Bad path: z\\r)�maxsplitz///)rrrr
rZquoterr)�prrrrrrrrr�pathname2url-s.
rN)rrrrrr�<module>s%__pycache__/trace.cpython-38.opt-1.pyc000064400000047120151153537550013457 0ustar00U

e5d�t�@s�dZddgZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
mZddlZdZGdd�d�Zd	d
�Zdd�ZGd
d�d�Zdd�Zdd�Zddd�Zdd�ZGdd�d�Zdd�Zedkr�e�dS)a�program/module to trace Python program or function execution

Sample use, command line:
  trace.py -c -f counts --ignore-dir '$prefix' spam.py eggs
  trace.py -t --ignore-dir '$prefix' spam.py eggs
  trace.py --trackcalls spam.py eggs

Sample use, programmatically
  import sys

  # create a Trace object, telling it what to ignore, and whether to
  # do tracing or line-counting or both.
  tracer = trace.Trace(ignoredirs=[sys.base_prefix, sys.base_exec_prefix,],
                       trace=0, count=1)
  # run the new command using the given tracer
  tracer.run('main()')
  # make a report, placing output in /tmp
  r = tracer.results()
  r.write_results(show_missing=True, coverdir="/tmp")
�Trace�CoverageResults�N)�	monotonicz#pragma NO COVERc@seZdZddd�Zdd�ZdS)�_IgnoreNcCs:|s
t�nt|�|_|sgndd�|D�|_ddi|_dS)NcSsg|]}tj�|��qS�)�os�path�normpath��.0�drr�/usr/lib64/python3.8/trace.py�
<listcomp>Hs�z$_Ignore.__init__.<locals>.<listcomp>z<string>�)�set�_mods�_dirs�_ignore)�self�modules�dirsrrr
�__init__Fs
�z_Ignore.__init__cCs�||jkr|j|S||jkr,d|j|<dS|jD]"}|�|d�r2d|j|<dSq2|dkrld|j|<dS|jD]$}|�|tj�rrd|j|<dSqrd|j|<dS)Nr�.r)rr�
startswithrr�sep)r�filename�
modulename�modrrrr
�namesLs$









z
_Ignore.names)NN)�__name__�
__module__�__qualname__rrrrrr
rEs
rcCs tj�|�}tj�|�\}}|S)z-Return a plausible module name for the patch.)rr�basename�splitext)r�baser�extrrr
�_modnamewsr&cCs�tj�|�}d}tjD]@}tj�|�}|�|�r|t|�tjkrt|�t|�kr|}q|rr|t|�dd�}n|}tj�|�\}}|�tjd�}tj	r�|�tj	d�}tj�
|�\}}|�d�S)z,Return a plausible module name for the path.�rNr)rr�normcase�sysr�lenr�
splitdrive�replace�altsepr#�lstrip)rZcomparepathZlongest�dirr$Zdriverr%rrr
�_fullmodname~s 
r0c@s:eZdZddd�Zdd�Zdd�Zdd
d�Zddd
�ZdS)rNc
Cs�||_|jdkri|_|j��|_||_|jdkr8i|_|j��|_||_|jdkrZi|_|j��|_||_||_|jr�z@t|jd��}t�	|�\}}}W5QRX|�
|�|||��Wn@tt
tfk
r�}ztd|j|ftjd�W5d}~XYnXdS)N�rbzSkipping counts file %r: %s��file)�counts�copyZcounter�calledfuncs�callers�infile�outfile�open�pickle�load�update�	__class__�OSError�EOFError�
ValueError�printr)�stderr)rr4r6r8r7r9�f�errrrr
r�s2


��zCoverageResults.__init__cCs|�d�o|�d�S)z_Return True if the filename does not refer to a file
        we want to have reported.
        �<�>)r�endswith)rrrrr
�is_ignored_filename�sz#CoverageResults.is_ignored_filenamec	Csn|j}|j}|j}|j}|j}|j}|D]}|�|d�||||<q(|D]}d||<qJ|D]}d||<q\dS)z.Merge in the data from another CoverageResultsrrN)r4r6r7�get)	r�otherr4r6r7Zother_countsZother_calledfuncsZ
other_callers�keyrrr
r=�s
zCoverageResults.updateTFc"
Cs�|jr@t�td�|j}t|�D]\}}}td|||f�q"|jr�t�td�d}}	t|j�D]h\\}
}}\}
}}|
|kr�t�td|
d�|
}d}	|
|
kr�|	|
kr�td|
�|
}	td||||f�qfi}|jD].\}}|�|i�}||<|j||f||<q�i}|��D�]\}}|�|��r0�q|�d��rH|d	d
�}|d	k�rpt	j
�t	j
�|��}t
|�}n$|}t	j
�|��s�t	�|�t|�}|�r�t|�}ni}t�|�}t	j
�||d�}t|d��}t�|j�\}}W5QRX|�|||||�\}}|�r|�rtd
||�}||||f||<�q|�rt|�rttd�t|�D]&}||\}}}}td||��qL|j�r�z6t|jd�� } t�|j|j|jf| d�W5QRXWn6tk
�r�}!ztd|!tj d�W5d	}!~!XYnXd	S)af
        Write the coverage results.

        :param show_missing: Show lines that had no hits.
        :param summary: Include coverage summary per module.
        :param coverdir: If None, the results of each module are placed in its
                         directory, otherwise it is included in the directory
                         specified.
        zfunctions called:z*filename: %s, modulename: %s, funcname: %szcalling relationships:r'z***z  -->z    %s.%s -> %s.%sz.pycN���z.coverr1�dzlines   cov%   module   (path)z%5d   %3d%%   %s   (%s)�wbrz"Can't save counts files because %sr2)!r6rB�sortedr7r4rJ�itemsrIrHrr�dirname�abspathr&�exists�makedirsr0�_find_executable_linenos�	linecache�getlines�joinr:�tokenize�detect_encoding�readline�write_results_file�intr9r;�dumpr?r)rC)"rZshow_missing�summary�coverdirZcallsrr�funcnameZlastfileZ	lastcfileZpfileZpmodZpfunc�cfileZcmodZcfuncZper_file�lineno�	lines_hitZsums�countr/�lnotab�sourceZ	coverpath�fp�encoding�_�n_hits�n_linesZpercent�mrDrErrr
�
write_results�s�
��





��zCoverageResults.write_resultsc
Cs�zt|d|d�}Wn>tk
rP}z td||ftjd�WY�dSd}~XYnXd}d}	|��t|d�D]r\}
}|
|kr�|�d	||
�|	d7}	|d7}n.|
|kr�t|kr�|�d
�|d7}n
|�d�|�|�d��qjW5QRX|	|fS)
z'Return a coverage results file in path.�w�rjz3trace: Could not open %r for writing: %s - skippingr2)rrNrrz%5d: z>>>>>> z       �)	r:r?rBr)rC�	enumerate�write�PRAGMA_NOCOVER�
expandtabs)rr�linesrgrerjr9rErmrlrd�linerrr
r])s.��



z"CoverageResults.write_results_file)NNNNN)TFN)N)rr r!rrIr=ror]rrrr
r�s�

\cCs,i}t�|�D]\}}||krd||<q|S)z:Return dict where keys are lines in the line number table.r)�disZfindlinestarts)�code�strs�linenosrkrdrrr
�_find_lines_from_codeIs

r}cCs4t||�}|jD]}t�|�r|�t||��q|S)z<Return lineno dict for all code objects reachable from code.)r}�	co_consts�inspectZiscoder=�_find_lines)rzr{r|�crrr
r�Ss



r�c	Cs�i}tj}t||d��j}t�|j�}|D]R\}}}}	}
|tjkrv|tjkrv|\}}|	\}
}t||
d�D]}d||<qh|}q(W5QRX|S)z�Return a dict of possible docstring positions.

    The dict maps line numbers to strings.  There is an entry for
    line that contains only a string or a part of a triple-quoted
    string.
    rqr)�token�INDENTr:rZ�generate_tokensr\�STRING�range)rrjrZ
prev_ttyperD�tokZttypeZtstr�start�endrxZslineZscolZelineZecol�irrr
�
_find_strings_s


r�c
Cs�z(t�|��}|��}|j}W5QRXWn@tk
rh}z"td||ftjd�iWY�Sd}~XYnXt||d�}t	||�}t
||�S)zAReturn dict where keys are line numbers in the line number table.z%Not printing coverage data for %r: %sr2N�exec)rZr:�readrjr?rBr)rC�compiler�r�)rrD�progrjrErzr{rrr
rVvs��
rVc	@sveZdZddd�Zdd	�Zd d
d�Zdd
�Zde_dd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)!rrrrNFc

Cs�||_||_t||�|_i|_i|_d|_||_i|_i|_	i|_
d|_|	rTt�|_|rb|j
|_nZ|rp|j|_nL|r�|r�|j|_|j|_n2|r�|j|_|j|_n|r�|j|_|j|_nd|_dS)ax
        @param count true iff it should count number of times each
                     line is executed
        @param trace true iff it should print out each line that is
                     being counted
        @param countfuncs true iff it should just output a list of
                     (filename, modulename, funcname,) for functions
                     that were called at least once;  This overrides
                     `count' and `trace'
        @param ignoremods a list of the names of modules to ignore
        @param ignoredirs a list of the names of directories to ignore
                     all of the (recursive) contents of
        @param infile file from which to read stored counts to be
                     added into the results
        @param outfile file in which to write the results
        @param timing true iff timing information be displayed
        rNr)r8r9r�ignorer4Zpathtobasename�	donothing�trace�_calledfuncs�_callers�
_caller_cache�
start_time�_time�globaltrace_trackcallers�globaltrace�globaltrace_countfuncs�globaltrace_lt�localtrace_trace_and_count�
localtrace�localtrace_trace�localtrace_count)
rrfr��
countfuncs�countcallers�
ignoremods�
ignoredirsr8r9�timingrrr
r�s6




zTrace.__init__cCs ddl}|j}|�|||�dS)Nr)�__main__�__dict__�runctx)r�cmdr��dictrrr
�run�sz	Trace.runc	Csh|dkri}|dkri}|js6t�|j�t�|j�zt|||�W5|jsbt�d�t�d�XdS)N)r��	threading�settracer�r)r�)rr��globals�localsrrr
r��s
zTrace.runctxc	Os�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��d}|js�t�|j	�z|||�}W5|js�t�d�X|S)	N�z8descriptor 'runfunc' of 'Trace' object needs an argument�funcrz0Passing 'func' as keyword argument is deprecated)�
stacklevelz7runfunc expected at least 1 positional argument, got %dr)
r*�	TypeError�pop�warnings�warn�DeprecationWarningr�r)r�r�)�args�kwrr�r��resultrrr
�runfunc�s.

�
�z
Trace.runfuncz($self, func, /, *args, **kw)c
Cs�|j}|j}|rt|�}nd}|j}d}||jkrL|j|dk	r�|j|}n�d|j|<dd�t�|�D�}t|�dkr�dd�t�|d�D�}t|�dkr�dd�t�|d�D�}	t|	�dkr�|	dj}||j|<|dk	r�d||f}|||fS)NcSsg|]}t�|�r|�qSr)rZ
isfunction)rrDrrr
r�s
�z1Trace.file_module_function_of.<locals>.<listcomp>rcSsg|]}t|t�r|�qSr)�
isinstancer�r
rrr
r�s
�rcSsg|]}t|d�r|�qS)�	__bases__)�hasattr)rr�rrr
r�s
�z%s.%s)	�f_code�co_filenamer&�co_namer��gcZ
get_referrersr*r)
r�framerzrrrbZclsnameZfuncsZdicts�classesrrr
�file_module_function_of�s,




zTrace.file_module_function_ofcCs0|dkr,|�|�}|�|j�}d|j||f<dS)zkHandler for call events.

        Adds information about who called who to the self._callers dict.
        �callrN)r��f_backr�)rr��why�arg�	this_funcZparent_funcrrr
r�
s
zTrace.globaltrace_trackcallerscCs |dkr|�|�}d|j|<dS)zoHandler for call events.

        Adds (filename, modulename, funcname) to the self._calledfuncs dict.
        r�rN)r�r�)rr�r�r�r�rrr
r�s
zTrace.globaltrace_countfuncscCsj|dkrf|j}|j�dd�}|rbt|�}|dk	rf|j�||�}|sf|jrZtd||jf�|j	SndSdS)z�Handler for call events.

        If the code block being entered is to be ignored, returns `None',
        else returns self.localtrace.
        r��__file__Nz! --- modulename: %s, funcname: %s)
r��	f_globalsrJr&r�rr�rBr�r�)rr�r�r�rzrrZ	ignore_itrrr
r�!s�zTrace.globaltrace_ltcCs�|dkr~|jj}|j}||f}|j�|d�d|j|<|jrTtdt�|jdd�tj	�
|�}td||t�||�fdd�|j
S)	Nrxrr�%.2f� �r��
%s(%d): %sr')r�r��f_linenor4rJr�rBr�rrr"rW�getliner�)rr�r�r�rrdrL�bnamerrr
r�8s
��z Trace.localtrace_trace_and_countcCsd|dkr^|jj}|j}|jr4tdt�|jdd�tj�|�}td||t	�
||�fdd�|jS)Nrxr�r�r�r�r')r�r�r�r�rBr�rrr"rWr�r�)rr�r�r�rrdr�rrr
r�Gs
��zTrace.localtrace_tracecCs<|dkr6|jj}|j}||f}|j�|d�d|j|<|jS)Nrxrr)r�r�r�r4rJr�)rr�r�r�rrdrLrrr
r�TszTrace.localtrace_countcCst|j|j|j|j|jd�S)N)r8r9r6r7)rr4r8r9r�r�)rrrr
�results\s

�z
Trace.results)	rrrrrrNNF)NN)rr r!rr�r�r��__text_signature__r�r�r�r�r�r�r�r�rrrr
r�s&�
2

)	
cs�ddl}|��}|jdddd�|�dd�}|jdd	d
dd�|jd
dd
dd�|jddd
dd�|jddd
dd�|�d�}|��}|jddd
dd�|jddd
dd�|jdddd �|jd!d"d#d �|jd$d%d
d&d�|jd'd(d
d)d�|jd*d+d
d,d�|�d-d.�}|jd/d0gd1d2�|jd3d0gd4d2�|jd5d
d6d7d2�|jd8d9d:d;�|jd<|jd=d;�|��}|j�r�t�	d>��t�	d?����fd@dA��dBdC�|j
D�|_
�fdDdC�|jD�|_|j�r�|j�s�|�
dE�t|j|jdF�}|�|j|j|j�St|j|j|j|jg��s |�
dG�|j�rB|j�s8|j�rB|�
dH�|j�r\|j�s\|�
dI�|jdk�rr|�
dJ�t|j|j|j|j|j
|j|j|j|jdK�	}z�|j�r�ddl}|j}|�|�\}	}
}|jf|j�t _!dL|j|
j"|
j#|
ddM�}n^|jf|j�t _!t$j%�&|j�t j%d<t'�(|j��}
t)|
�*�|jdN�}W5QRX|jdLdddO�}|�+|||�WnPt,k
�r�}zt �-dPt j!d|f�W5d}~XYnt.k
�r�YnX|�/�}|j0�s�|�|j|j|j�dS)QNrz	--version�versionz	trace 2.0)�actionr�zMain optionsz(One of these (or --report) must be givenz-cz--count�
store_truez�Count the number of times each line is executed and write the counts to <module>.cover for each module executed, in the module's directory. See also --coverdir, --file, --no-report below.)r��helpz-tz--tracez3Print each line to sys.stdout before it is executedz-lz--listfuncsz�Keep track of which functions are executed at least once and write the results to sys.stdout after the program exits. Cannot be specified alongside --trace or --count.z-Tz--trackcallsz^Keep track of caller/called pairs and write the results to sys.stdout after the program exits.Z	Modifiersz-rz--reportz�Generate a report from a counts file; does not execute any code. --file must specify the results file to read, which must have been created in a previous run with --count --file=FILEz-Rz--no-reportz^Do not generate the coverage report files. Useful if you want to accumulate over several runs.z-fz--filez+File to accumulate counts over several runs)r�z-Cz
--coverdirz�Directory where the report files go. The coverage report for <package>.<module> will be written to file <dir>/<package>/<module>.coverz-mz	--missingz?Annotate executable lines that were not executed with ">>>>>> "z-sz	--summaryz\Write a brief summary for each file to sys.stdout. Can only be used with --count or --reportz-gz--timingzQPrefix each line with the time since the program started. Only used while tracingZFilterszCan be specified multiple timesz--ignore-module�appendzqIgnore the given module(s) and its submodules (if it is a package). Accepts comma separated list of module names.)r��defaultr�z--ignore-dirzWIgnore files in the given directory (multiple directories can be joined by os.pathsep).z--moduleFzTrace a module. �progname�?zfile to run as main program)�nargsr��	argumentszarguments to the programZstdlibZ
platstdlibcs4tj�tj�|��}|�d���d��}tj�|�S)Nz$prefixz$exec_prefix)rr�
expanduser�
expandvarsr,r	)�s)�_exec_prefix�_prefixrr
�parse_ignore_dir�szmain.<locals>.parse_ignore_dircSs$g|]}|�d�D]}|���qqS)�,)�split�strip)rr�rrrr
r�s�zmain.<locals>.<listcomp>cs&g|]}|�tj�D]}�|��qqSr)r�r�pathsep)rr�r�)r�rr
r�s�z-r/--report requires -f/--file)r8r9zLmust specify one of --trace, --count, --report, --listfuncs, or --trackcallsz8cannot specify both --listfuncs and (--trace or --count)z3--summary can only be used with --count or --reportz3progname is missing: required with the main options)r�r�r�r�r8r9r�r�)rr��__package__�
__loader__�__spec__�
__cached__r�)r�rr�r�zCannot run file %r because: %s)1�argparse�ArgumentParser�add_argumentZadd_argument_groupZadd_mutually_exclusive_groupZ	REMAINDER�
parse_argsZ
ignore_dir�	sysconfigZget_pathZ
ignore_moduleZreportr3�errorrroZmissingr`ra�anyr�rfZ	listfuncsZ
trackcallsr�rr��module�runpyZ_get_module_detailsr�r�r)�argv�parent�loaderrrrR�io�	open_coder�r�r�r?�exit�
SystemExitr�Z	no_report)r��parserZgrpZ_grpZoptsr��tr�Zmodule_nameZmod_nameZmod_specrzZglobsrirEr)r�r�r�r
�mainbs��
�
�
�
�

�
���
�
�
��
�
�
��
�

�
�




��	�(r�r�)N)�__doc__�__all__r�rWrr)r�r�rZrr�ryr;�timerr�r�rurr&r0rr}r�r�rVrr�rrrrr
�<module>s<20

___pycache__/getopt.cpython-38.opt-1.pyc000064400000014137151153537550013665 0ustar00U

e5dA�@s�dZddddgZddlZzddlmZWnek
rDdd	�ZYnXGd
d�de�ZeZgfdd�Z	gfdd�Z
d
d�Zdd�Zdd�Z
dd�Zedkr�ddlZee	ejdd�dddg��dS)a�Parser for command line options.

This module helps scripts to parse the command line arguments in
sys.argv.  It supports the same conventions as the Unix getopt()
function (including the special meanings of arguments of the form `-'
and `--').  Long options similar to those supported by GNU software
may be used as well via an optional third argument.  This module
provides two functions and an exception:

getopt() -- Parse command line options
gnu_getopt() -- Like getopt(), but allow option and non-option arguments
to be intermixed.
GetoptError -- exception (class) raised with 'opt' attribute, which is the
option involved with the exception.
�GetoptError�error�getopt�
gnu_getopt�N)�gettextcCs|S�N�)�srr�/usr/lib64/python3.8/getopt.py�_)�rc@s&eZdZdZdZddd�Zdd�ZdS)r�cCs||_||_t�|||�dSr)�msg�opt�	Exception�__init__)�selfrrrrr
r.szGetoptError.__init__cCs|jSr)r)rrrr
�__str__3szGetoptError.__str__N)r
)�__name__�
__module__�__qualname__rrrrrrrr
r+s
cCs�g}t|�td�kr|g}nt|�}|r�|d�d�r�|ddkr�|ddkr\|dd�}q�|d�d�r�t||ddd�||dd��\}}q$t||ddd�||dd��\}}q$||fS)a@getopt(args, options[, long_options]) -> opts, args

    Parses command line options and parameter list.  args is the
    argument list to be parsed, without the leading reference to the
    running program.  Typically, this means "sys.argv[1:]".  shortopts
    is the string of option letters that the script wants to
    recognize, with options that require an argument followed by a
    colon (i.e., the same format that Unix getopt() uses).  If
    specified, longopts is a list of strings with the names of the
    long options which should be supported.  The leading '--'
    characters should not be included in the option name.  Options
    which require an argument should be followed by an equal sign
    ('=').

    The return value consists of two elements: the first is a list of
    (option, value) pairs; the second is the list of program arguments
    left after the option list was stripped (this is a trailing slice
    of the first argument).  Each option-and-value pair returned has
    the option as its first element, prefixed with a hyphen (e.g.,
    '-x'), and the option argument as its second element, or an empty
    string if the option has no argument.  The options occur in the
    list in the same order in which they were found, thus allowing
    multiple occurrences.  Long and short options may be mixed.

    r
r�-�--�N�)�type�list�
startswith�do_longs�	do_shorts)�args�	shortopts�longopts�optsrrr
r8s((cCs6g}g}t|t�r|g}nt|�}|�d�r>|dd�}d}ntj�d�rPd}nd}|�r.|ddkrz||dd�7}�q.|ddd	�dkr�t||dd	d�||dd��\}}qT|ddd�d
kr�|dd
kr�t||ddd�||dd��\}}qT|�r||7}�q.qT|�	|d�|dd�}qT||fS)agetopt(args, options[, long_options]) -> opts, args

    This function works like getopt(), except that GNU style scanning
    mode is used by default. This means that option and non-option
    arguments may be intermixed. The getopt() function stops
    processing options as soon as a non-option argument is
    encountered.

    If the first character of the option string is `+', or if the
    environment variable POSIXLY_CORRECT is set, then option
    processing stops as soon as a non-option argument is encountered.

    �+rNTZPOSIXLY_CORRECTFrrrr)
�
isinstance�strrr�os�environ�getrr�append)r r!r"r#Z	prog_argsZall_options_firstrrr
rcs2

( (cCs�z|�d�}Wntk
r&d}Yn X|d|�||dd�}}t||�\}}|r�|dkr�|svttd�||��|d|dd�}}n|dk	r�ttd�||��|�d||p�df�||fS)N�=rzoption --%s requires argumentrz%option --%s must not have an argumentrr
)�index�
ValueError�
long_has_argsrrr*)r#rr"r �i�optarg�has_argrrr
r�s
rcs��fdd�|D�}|s(ttd������|kr8d�fS�d|krLd�fSt|�dkrjttd�����|d	}|�d�}|r�|dd
�}||fS)Ncsg|]}|���r|�qSr)r)�.0�o�rrr
�
<listcomp>�s
z!long_has_args.<locals>.<listcomp>zoption --%s not recognizedFr+Trzoption --%s not a unique prefixr���)rr�len�endswith)rr"Z
possibilitiesZunique_matchr1rr4r
r.�s
r.cCs�|dkr�|d|dd�}}t||�rh|dkr\|sFttd�||��|d|dd�}}|d}}nd}|�d||f�q||fS)Nr
rrzoption -%s requires argumentr)�
short_has_argrrr*)r#Z	optstringr!r rr0rrr
r�s
�rcCsXtt|��D]4}|||kr(dkrnq|�d|d�Sqttd�||��dS)N�:rzoption -%s not recognized)�ranger7rrr)rr!r/rrr
r9�sr9�__main__rza:bzalpha=Zbeta)�__doc__�__all__r'rr�ImportErrorrrrrrrr.rr9r�sys�print�argvrrrr
�<module>s"!+2__pycache__/quopri.cpython-38.pyc000064400000013166151153537550012744 0ustar00U

e5dT�@s�dZddddgZdZdZdZdZzd	d
lmZmZWne	k
rPdZdZYnXdd
�Z
dd�Zddd�Zddd�Z
ddd�Zddd�Zdd�Zdd�Zdd�Zedkr�e�dS) zHConversions to/from quoted-printable transport encoding as per RFC 1521.�encode�decode�encodestring�decodestring�=�Ls0123456789ABCDEF��)�a2b_qp�b2a_qpNcCsHt|t�st�|dkr|S|dkr&|S|tkpFd|ko@dknS)z�Decide whether a particular byte ordinal needs to be quoted.

    The 'quotetabs' flag indicates whether embedded tabs and spaces should be
    quoted.  Note that line-ending tabs and spaces are always encoded, as per
    RFC 1521.
    � 	�_� �~)�
isinstance�bytes�AssertionError�ESCAPE)�c�	quotetabs�header�r�/usr/lib64/python3.8/quopri.py�needsquotingsrcCsBt|t�rt|�dkst�t|�}ttt|dt|df�S)zQuote a single character.��)rr�lenr�ordr�HEX�rrrr�quote$srFc
Cs2tdk	r,|��}t|||d�}|�|�dS|dfdd�}d}|��}|sN�qg}	d}
|dd�dkrv|dd�}d}
|D]D}t|f�}t|||�r�t|�}|r�|dkr�|	�d	�qz|	�|�qz|dk	r�||�t�	|	�}t
|�tk�r||dtd
�dd�|td
d�}q�|}q>|dk	�r.|||
d�dS)
avRead 'input', apply quoted-printable encoding, and write to 'output'.

    'input' and 'output' are binary file objects. The 'quotetabs' flag
    indicates whether embedded tabs and spaces should be quoted. Note that
    line-ending tabs and spaces are always encoded, as per RFC 1521.
    The 'header' flag indicates whether we are encoding spaces as _ as per RFC
    1522.N�rr�
cSsj|r<|dd�dkr<|�|dd�t|dd��|�n*|dkrX|�t|�|�n|�||�dS)N���r�.)�writer)�s�output�lineEndrrrr$;s
(zencode.<locals>.writerr"r
rrs=
)r')r
�readr$�readlinerrr�append�EMPTYSTRING�joinr�MAXLINESIZE)
�inputr&rr�data�odatar$Zprevline�lineZoutline�strippedrZthislinerrrr,s>	




cCsFtdk	rt|||d�Sddlm}||�}|�}t||||�|��S)Nr r��BytesIO)r
�ior4r�getvalue)r%rrr4�infp�outfprrrrjscCs�tdk	r*|��}t||d�}|�|�dSd}|��}|s>�q�dt|�}}|dkr�||d|�dkr�d}	|d}|dkr�||d|�dkr�|d}qtnd}	||k�r�|||d�}
|
dkr�|r�|d	}|d}q�|
tkr�||
}|d}q�|d|k�r|	�sd}	�q�q�|d|k�rJ||d|d
�tk�rJ|t}|d
}q�|d
|k�r�t||d|d
���r�t||d
|d���r�|tt||d|d��f�}|d}q�||
}|d}q�|	s.|�|d�d}q.|�r�|�|�dS)z�Read 'input', apply quoted-printable decoding, and write to 'output'.
    'input' and 'output' are binary file objects.
    If 'header' is true, decode underscore as space (per RFC 1522).N�rrrrr!s 	
rr
��)	r	r(r$r)rr�ishexr�unhex)r.r&rr/r0�newr1�i�n�partialrrrrrusP



(
B"

cCsDtdk	rt||d�Sddlm}||�}|�}t|||d�|��S)Nr9rr3)r	r5r4rr6)r%rr4r7r8rrrr�scCsVt|t�st�d|ko dknpTd|ko8dknpTd|koPdkSS)zDReturn true if the byte ordinal 'c' is a hexadecimal digit in ASCII.�0�9�a�f�A�F)rrrrrrrr<�sr<cCs�d}|D]�}t|f�}d|kr*dkr8nn
td�}n`d|krLdkr^nntd�d}n:d	|krrd
kr�nntd	�d}nds�tdt|���|d
t|�|}q|S)z.Get the integer value of a hexadecimal number.rrBrC�0rDrE�a�
rFrGFznon-hex digit r)rrr�repr)r%�bitsrr?rrrr=�s

r=cCs�ddl}ddl}z|�|jdd�d�\}}WnV|jk
r�}z6|j|_t|�td�td�td�|�d�W5d}~XYnXd}d}|D] \}}|dkr�d}|d	kr�d}q�|r�|r�|j|_td
�|�d�|s�dg}d}	|D]�}
|
dkr�|jj	}nTzt
|
d�}WnDtk
�rP}z$|j�d
|
|f�d}	WY�q�W5d}~XYnXz*|�rjt||jj	�nt||jj	|�W5|
dk�r�|�
�Xq�|	�r�|�|	�dS)NrrZtdz"usage: quopri [-t | -d] [file] ...z-t: quote tabsz-d: decode; default encoder:z-tz-dz -t and -d are mutually exclusive�-�rbz%s: can't open (%s)
)�sys�getopt�argv�error�stderr�stdout�print�exit�stdin�buffer�open�OSErrorr$�closerr)rOrPZopts�args�msgZdecoZtabs�orI�sts�file�fprrr�main�sT


rb�__main__)F)FF)F)F)�__doc__�__all__rr-rr+Zbinasciir	r
�ImportErrorrrrrrrr<r=rb�__name__rrrr�<module>s*

>

+
.__pycache__/sre_compile.cpython-38.pyc000064400000035450151153537550013726 0ustar00U

e5dGh�@s$dZddlZddlZddlTejeks.td��eehZe	e
ehZe
ehZeehZeeehBZdZdd�eD�Zejfdd	�Zd
d�Zdd
�Zd-dd�ZejdZde>dZdZ ee!fdd�Z"dd�Z#dd�Z$dd�Z%dd�Z&dd�Z'dd �Z(d!d"�Z)d#d$�Z*d%d&�Z+d'd(�Z,d)d*�Z-d.d+d,�Z.dS)/zInternal support module for sre�N)�*zSRE module mismatch))�ii1)�si)�i�)iEi�i�)i�i�)i�i�)i�i�)i�i�)i�i�)i�i�)i�i�)i�i�)i�i�)i�i�)iai�)i�i�cs.i|]&}|D]��t�fdd�|D���qqS)c3s|]}�|kr|VqdS�N�)�.0�j��ir�#/usr/lib64/python3.8/sre_compile.py�	<genexpr>>sz<dictcomp>.<genexpr>)�tuple)r�trr
r�
<dictcomp>>s
�rcCs ||@r||M}||B|@Srr)�flags�	add_flags�	del_flags�
TYPE_FLAGSrrr�_combine_flagsAs
rcCs�|j}t}t}t}t}t}d}	d}
d}|t@r\|t@s\|t@rPt	j
}	t	j}
t}nt	j
}	t	j}
|D�]|\}}
||k�rr|t@s�||�||
�n�|t@r�|t|�||
�n�|	|
�s�||�||
�n�|
|
�}|s�|t|�||�n�||k�r|t|�||�nh|t�||�}|d�|tk�r2|t�|f||D]}|t�||��q@|t�||�|||<q`|tk�rt|
|	|
|�\}}|t@�r�|t@�r�|t�n(|�s�|t�n|�s�|t�n|t�||�}|d�t|||�||�|||<q`|tk�r*|t@�r |t�n|t�q`||k�r6|t@�rLt d|f��t!|
d��r�|t"k�rn|t#�n|t$�||�}|d�||
d�||
d�t%||
d|�|t&�||�|||<nl|t'�||�}|d�||
d�||
d�t%||
d|�||�|||<|t"k�r,|t(�n|t)�q`|t*k�r�|
\}}}}|�rj|t+�||dd�t%||t,|||��|�r�|t+�||ddd�q`||k�r�||�q`||k�rD||�||�}|d�|
ddk�r�|d�n*|
d�-�\}}||k�rt d��||�t%||
d|�|t&�||�|||<q`|t.k�r�||�||�}|d�t%||
|�|t&�||�|||<q`|t/k�r�||�|t0@�r�t1�2|
|
�}
|t@�r�t3�2|
|
�}
n|t@�r�t4�2|
|
�}
||
�q`|t5k�r�||�g}|j}|
dD]N}
||�}|d�t%||
|�|t6�|||��|d�||�|||<�q|t�|D]}||�|||<�qlq`|t7k�r�||�|t@�r�t8|
}
n|t@�r�t9|
}
||
�q`|t:k�r |t@�s�||�n,|t@�r�|t;�n|�s
|t<�n|t=�||
d�q`|t>k�r�||�||
dd�||�}|d�t%||
d|�|
d�r�|t6�||�}|d�||�|d||<t%||
d|�||�|||<n||�|d||<q`t d|f��q`dS)Nrz*internal: unsupported template operator %r��z(look-behind requires fixed-width patternz%internal: unsupported operand type %r)?�append�len�_LITERAL_CODES�_REPEATING_CODES�_SUCCESS_CODES�
_ASSERT_CODES�SRE_FLAG_IGNORECASE�SRE_FLAG_LOCALE�SRE_FLAG_UNICODE�_sre�unicode_iscased�unicode_tolower�_ignorecase_fixes�
ascii_iscased�
ascii_tolower�OP_LOCALE_IGNORE�	OP_IGNORE�OP_UNICODE_IGNORE�
IN_UNI_IGNORE�NOT_LITERAL�NEGATE�LITERAL�FAILURE�IN�_optimize_charset�
IN_LOC_IGNORE�	IN_IGNORE�_compile_charset�ANY�SRE_FLAG_DOTALL�ANY_ALL�SRE_FLAG_TEMPLATE�error�_simple�
MAX_REPEAT�
REPEAT_ONE�MIN_REPEAT_ONE�_compile�SUCCESS�REPEAT�	MAX_UNTIL�	MIN_UNTIL�
SUBPATTERN�MARKr�getwidth�CALL�AT�SRE_FLAG_MULTILINE�AT_MULTILINE�get�	AT_LOCALE�
AT_UNICODE�BRANCH�JUMP�CATEGORY�	CH_LOCALE�
CH_UNICODE�GROUPREF�GROUPREF_LOC_IGNORE�GROUPREF_IGNORE�GROUPREF_UNI_IGNORE�GROUPREF_EXISTS)�code�patternr�emit�_len�
LITERAL_CODES�REPEATING_CODES�
SUCCESS_CODES�ASSERT_CODES�iscased�tolower�fixes�op�av�lo�skip�k�charset�hascased�grouprr�p�hi�tail�
tailappend�skipyes�skipnorrrr=GsV
















































r=cCs�|j}|D]�\}}||�|tkr$q
|tkr6||�q
|tksF|tkr`||d�||d�q
|tkrt|�|�q
|tkr�|�|�q
|tkr�|t	@r�|t
|�q�|t@r�|t|�q�||�q
t
d|f��q
|t�dS)Nrrz%internal: unsupported set operator %r)rr,r-�RANGE�RANGE_UNI_IGNORE�CHARSET�extend�
BIGCHARSETrNrrOr rPr8r.)rfrrVrXrarbrrrr3�s,

r3c	Cs�g}g}td�}d}|D�]�\}}	�z,|tkr�|rv||	�}
d||
<|rd|
|krd||
D]}d||<qV|s~||	�r~d}nd||	<n�|tk�r&t|	d|	dd�}|�r|r�t||�D]*}
d||
<|
|kr�||
D]}d||<q�q�nt||�D]}
d||
<q�|�s$tt||��}n|D]}
d||
<�qn(|tk�r@|�||	f�n|�||	f�WnZtk
�r�t	|�dk�r�|dd7}Yq"|�r�d}|tk�r�t
}|�||	f�YnXqq"qg}d}|�d|�}|dk�rԐq(t	|�dk�r�d}�q(|�d|�}|dk�r|�|t	|�f��q(|�||f��q�|dk	�r�|D]>\}}||dk�r\|�t|f�n|�t||dff��q6||7}|�s�t	|�t	|�k�r�||fS||fSt	|�dk�r�t|�}|�t
|f�||7}||fSt|�}i}td�}d}t�}tdd	d�D]V}
||
|
d�}||k�r4||||
d<n$|||
d<||<|d7}||7}�qt|�}|gt|�|dd�<|�t|f�||7}||fS)
N�FrTr�i�ri)�	bytearrayr-ro�range�map�anyr,r�
IndexErrorrrp�find�
_mk_bitmaprq�bytes�_bytes_to_codesrs)rfr^�fixupr`�outrk�charmaprgrarbrcre�rr�runs�qri�data�comps�mapping�block�chunkrrrr0s�









r0�rs0111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111cs8|�t�ddd�����fdd�tt��d��D�S)N���cs"g|]}��|�|�d��qS)rr)rr��	_CODEBITS�_int�srr�
<listcomp>�s�z_mk_bitmap.<locals>.<listcomp>r)�	translate�_BITS_TRANSrwr)�bitsr�r�rr�rr|�s�r|cCs@t|��d�}|jtjkst�t|�|jt|�ks8t�|��S)N�I)�
memoryview�cast�itemsizer!�CODESIZE�AssertionErrorr�tolist)�b�arrrr~�sr~cCsDt|�dkrdS|d\}}|tkr<|ddko:t|d�S|tkS)NrFrr�)rrBr9�_UNIT_CODES)rirarbrrrr9�sr9cCsndgt|�}tdt|��D]L}||d}||||kr\|dkrNd||<q||d}q,|d||<q|S)aj
    Generate an overlap table for the following prefix.
    An overlap table is a table of the same size as the prefix which
    informs about the potential self-overlap for each index in the prefix:
    - if overlap[i] == 0, prefix[i:] can't overlap prefix[0:...]
    - if overlap[i] == k with 0 < k <= i, prefix[i-k+1:i+1] overlaps with
      prefix[0:k]
    rr)rrw)�prefix�tabler�idxrrr�_generate_overlap_table�s	r�cCs$|t@sdS|t@rtjStjSdSr)rr r!r"r%)rrrr�_get_iscased�s
r�cCs�g}|j}d}t|�}|jD]�\}}|tkrF|r<||�r<q�||�q|tkr�|\}}	}
}t||	|
�}|t@rz|t@rzq�t||�\}
}}|dkr�|dk	r�t	|�}n|dk	r�t	|�|}|�
|
�|s�q�qq�q||dfS||dfS)NTF)rr�r�r-rBrrr�_get_literal_prefixrrr)rWrr��prefixappend�prefix_skipr^rarbrhrrri�flags1�prefix1�prefix_skip1�got_allrrrr��s4



r�cCsd|js
dS|jd\}}|tk	r"qP|\}}}}t|||�}|t@r|t@rdSqt|�}|tkrz|rp||�rpdS||fgS|tkr�g}|j}	|dD]B}
|
s�dS|
d\}}|tkr�|r�||�s�|	||f�q�dSq�|S|t	k�r`|}|�r\|D]f\}}|tk�r||��rZdSq�|t
kr�|ddk�r4dStt|t
|d|dd���r�dSq�|SdS)Nrri��)r�rBrrrr�r-rLrr/roryrxrw)rWrrarbrhrrr^rf�
charsetappendrirrr�_get_charset_prefix�sN



 r�c
Cs||��\}}|tkrt}|dkr8|�tdd||g�dSg}d}g}|t@rT|t@srt||�\}}}|srt||�}|j}	|	t�t	|�}
|	d�d}|r�t
}|dkr�|r�|tB}n|r�|tB}|	|�|tkr�|	|�n|	t�|dt�}|	t
|t��|�r@|	t	|��|dk�rt	|�}|	|�|�|�|�t|��n(|�rht|�\}}|�r\t�t|||�t	|�|
||
<dS)Nr�)rD�MAXCODErr�INFOrrr�r�rr�SRE_INFO_PREFIX�SRE_INFO_LITERAL�SRE_INFO_CHARSET�minr�r0r�r3)
rVrWrrcrjr�r�rfr�rXrd�maskrgrrr�
_compile_infosT





r�cCst|ttf�Sr)�
isinstance�strr})�objrrr�isstringSsr�cCs8|jj|B}g}t|||�t||j|�|�t�|Sr)�staterr�r=r�rr>)rirrVrrr�_codeVs
r�cCsdd�dd�|D��S)N�[%s]�, css$|]}dtjdd|fVqdS)z%#0*xrN)r!r��r�xrrrr
fsz_hex_code.<locals>.<genexpr>)�join�rVrrr�	_hex_codeesr�csNddl�t��d�ttt��d���������fdd���dt���dS)Nrrc	s�dd�����fdd�
}��fdd�}�d7��}||k�r�|��|}|d7}t|}|tttttttfkrx||�q2|tt	t
ttt
ttfkr��|}|d7}||d|t|�f�q2|tk�r�|}|d7}tt|�}|dd�d	ks�t�|||dd��q2|tk�rV�|}|d7}tt|�}|dd
�dk�sBt�|||d
d��q2|ttttfk�r��|}|||||d��|d||�||7}q2|ttfk�r�||d�\}}	|d7}||d
||	t|�t|	�f�q2|tk�r||t�||dt���|dt7}q2|t k�rʈ|}|d7}t!d�"�fdd��||dt#j$�D���}
||||
�|dt#j$7}�d7�t%|�D].}|t�||dt���|dt7}�q��d8�q2|t&t't(t)t*fk�r��|}|d7}|||�q2|t+k�r(�|}|||||d�|d7}q2|t,k�r��|}|||||d�|�r��|d||�||7}|��|}|�r�|d|||d�n|t��qL|d7}q2|t-t.t/fk�r�||d�\}}}
|
t0k�r�d}
|||||
||d��|d||�||7}q2|t1k�rJ�||d�\}}||||||d�|d7}q2|t2t3fk�r��||d�\}}||||||d��|d||�||7}q2|t4k�rĈ||d�\}}}}
|
t0k�r�d}
|||t5|�||
||d�|d�|t6@�r��|d|d�\}}|d|�|d����|�}|ddd�"dd�|D��dd�"t7t|����|7�|d���|���|7�|t8@�r��d7�|d���||��d8�||7}q2t9|��q2�d8�dS)N)�tocsX|dk	r"��|�|d|ff7}td����kr6dndfd�dd�t|�dS)Nz(to %d)z%*d%s �:�.z  r��end)�add�print)r��args)�labels�level�offset_width�startrr�print_ps

�z!dis.<locals>.dis_.<locals>.print_cs"td�d�d�t|�dS)N� rr�)r�)r�)r�r�rr�print_2xsz"dis.<locals>.dis_.<locals>.print_2rz
%#02x (%r)�ZAT_�	Z	CATEGORY_rz%#02x %#02x (%r-%r)rt�c3s|]}|�tj�j�VqdSr)�to_bytesr!r��	byteorderr�)�sysrrr
�s�z$dis.<locals>.dis_.<locals>.<genexpr>�branch�	MAXREPEATr��z
  prefix_skipz  prefixr�r�css|]}d|VqdS)z%#02xNrr�rrrr
�sz(%r)�z	  overlap�in):�OPCODESr>r.r4r6r@rAr,r-r+�LITERAL_IGNORE�NOT_LITERAL_IGNORE�LITERAL_UNI_IGNORE�NOT_LITERAL_UNI_IGNORE�LITERAL_LOC_IGNORE�NOT_LITERAL_LOC_IGNORE�chrrFr��ATCODESr�rN�CHCODESr/r2r*r1rorprqr�r�rs�listr�r!r�rwrCrQrSrTrRrMrLr?r;r<r�rU�ASSERT�
ASSERT_NOTr��binr�rxr��
ValueError)r�r�r�r�rra�argrdrcrjr�r	r��maxr�
prefix_lenr�r��rV�dis_r�r�r�r�)r�rr�os�

�
�


 

�


�












�


zdis.<locals>.dis_)r��setrr�r�rr�r�dishsr�c	Cs�t|�r|}t�||�}nd}t||�}|t@r>t�t|�|jj}dg|jj	}|�
�D]\}}|||<q\t�|||jj
B||jj	d|t|��S)Nr)r��	sre_parse�parser��SRE_FLAG_DEBUGr�r�r��	groupdict�groups�itemsr!�compilerr)rirrWrV�
groupindex�
indexgrouprerrrrr��s(



�r�)NNN)r)/�__doc__r!r��
sre_constants�MAGICr�r-r+rr?�
MIN_REPEATr:rr>r.rr�r�rr4r/r��
_equivalencesr$rrr=r3r0r�r�r�r��intr|r~r9r�r�r�r�r�r�r�r�r�r�rrrr�<module>sJ
$��
3

	,;__pycache__/signal.cpython-38.opt-2.pyc000064400000005075151153537550013642 0ustar00U

e5d��@s&ddlZddlTddlmZddlmZe�Ze�	de
dd��e�	de
d	d��d
ekrle�	de
dd��d
d�Zdd�Zeej
�dd��Z
eej�dd��Zd
ekr�eej�dd
��Zejje_dekr�eej�dd��Zdek�reej�dd��Zeje_dek�reej�dd��Z[[dS)�N)�*)�wraps)�IntEnum�SignalscCs(|��r|�d�r|�d�p&|�d�S)NZSIGZSIG_ZCTRL_)�isupper�
startswith��name�r
�/usr/lib64/python3.8/signal.py�<lambda>
s�r�HandlerscCs|dkS)N)�SIG_DFL�SIG_IGNr
rr
r
rr��pthread_sigmaskZSigmaskscCs|dkS)N)�	SIG_BLOCK�SIG_UNBLOCK�SIG_SETMASKr
rr
r
rrrcCs(z
||�WStk
r"|YSXdS�N)�
ValueError)�valueZ
enum_klassr
r
r�_int_to_enums
rc	Cs,z
t|�WSttfk
r&|YSXdSr)�intr�	TypeError)rr
r
r�_enum_to_int#s
rcCst�t|�t|��}t|t�Sr)�_signal�signalrrr
�Z	signalnumZhandlerr
r
rr-srcCst�|�}t|t�Sr)r�	getsignalrr
rr
r
rr3s
rcCst�||�}tdd�|D��S)Ncss|]}t|t�VqdSr�rr��.0�xr
r
r�	<genexpr>=sz"pthread_sigmask.<locals>.<genexpr>)rr�set)Zhow�maskZsigs_setr
r
rr:s�
sigpendingcCsdd�t��D�S)NcSsh|]}t|t��qSr
r r!r
r
r�	<setcomp>Dszsigpending.<locals>.<setcomp>)rr'r
r
r
rr'Bs�sigwaitcCst�|�}t|t�Sr)rr)rr)ZsigsetZretsigr
r
rr)Hs
�
valid_signalscCsdd�t��D�S)NcSsh|]}t|t��qSr
r r!r
r
rr(Rsz valid_signals.<locals>.<setcomp>)rr*r
r
r
rr*Ps)r�	functoolsrZ_wraps�enumrZ_IntEnum�globalsZ_globals�	_convert_�__name__rrrrr�__doc__r'r)r*r
r
r
r�<module>sR���










__pycache__/_py_abc.cpython-38.pyc000064400000011100151153537550013003 0ustar00U

e5d-�@s(ddlmZdd�ZGdd�de�ZdS)�)�WeakSetcCstjS)z�Returns the current ABC cache token.

    The token is an opaque object (supporting equality testing) identifying the
    current version of the ABC cache for virtual subclasses. The token changes
    with every call to ``register()`` on any ABC.
    )�ABCMeta�_abc_invalidation_counter�rr�/usr/lib64/python3.8/_py_abc.py�get_cache_tokensrcsVeZdZdZdZ�fdd�Zdd�Zddd	�Zd
d�Zdd
�Z	dd�Z
dd�Z�ZS)rahMetaclass for defining Abstract Base Classes (ABCs).

    Use this metaclass to create an ABC.  An ABC can be subclassed
    directly, and then acts as a mix-in class.  You can also register
    unrelated concrete classes (even built-in classes) and unrelated
    ABCs as 'virtual subclasses' -- these and their descendants will
    be considered subclasses of the registering ABC by the built-in
    issubclass() function, but the registering ABC won't show up in
    their MRO (Method Resolution Order) nor will method
    implementations defined by the registering ABC be callable (not
    even via super()).
    rc	s�t�j||||f|�}dd�|��D�}|D]:}t|dt��D]&}t||d�}t|dd�r>|�|�q>q,t|�|_t�|_	t�|_
t�|_tj
|_|S)NcSs h|]\}}t|dd�r|�qS)�__isabstractmethod__F)�getattr)�.0�name�valuerrr�	<setcomp>&s�z"ABCMeta.__new__.<locals>.<setcomp>�__abstractmethods__rF)�super�__new__�itemsr	�set�add�	frozensetrr�
_abc_registry�
_abc_cache�_abc_negative_cacherr�_abc_negative_cache_version)	�mclsr�bases�	namespace�kwargs�clsZ	abstracts�baser��	__class__rrr#s�
zABCMeta.__new__cCsPt|t�std��t||�r |St||�r2td��|j�|�tjd7_|S)zsRegister a virtual subclass of an ABC.

        Returns the subclass, to allow usage as a class decorator.
        zCan only register classesz'Refusing to create an inheritance cycle�)	�
isinstance�type�	TypeError�
issubclass�RuntimeErrorrrrr)r�subclassrrr�register6s


zABCMeta.registerNcCs|td|j�d|j��|d�tdt���|d�|jD]@}|�d�r6t||�}t|t�r`t	|�}t|�d|��|d�q6dS)z'Debug helper to print the ABC registry.zClass: �.)�filezInv. counter: Z_abc_z: N)
�print�
__module__�__qualname__r�__dict__�
startswithr	r"rr)rr*rrrrr�_dump_registryHs



zABCMeta._dump_registrycCs|j��dS)z.Clear the registry (for debugging or testing).N)r�clear�rrrr�_abc_registry_clearSszABCMeta._abc_registry_clearcCs|j��|j��dS)z,Clear the caches (for debugging or testing).N)rr1rr2rrr�_abc_caches_clearWs
zABCMeta._abc_caches_clearcsb|j}|�jkrdSt|�}||krH�jtjkr>|�jkr>dS��|�St�fdd�||fD��S)z'Override for isinstance(instance, cls).TFc3s|]}��|�VqdS)N)�__subclasscheck__)r
�cr2rr�	<genexpr>jsz,ABCMeta.__instancecheck__.<locals>.<genexpr>)	r rr#rrrrr5�any)r�instancer'Zsubtyperr2r�__instancecheck__\s
��
zABCMeta.__instancecheck__cCst|t�std��||jkr dS|jtjkr>t�|_tj|_n||jkrLdS|�	|�}|t
k	r�t|t�slt�|r~|j�
|�n|j�
|�|S|t|dd�kr�|j�
|�dS|jD] }t||�r�|j�
|�dSq�|��D] }t||�r�|j�
|�dSq�|j�
|�dS)z'Override for issubclass(subclass, cls).z"issubclass() arg 1 must be a classTF�__mro__r)r"r#r$rrrrrr�__subclasshook__�NotImplemented�bool�AssertionErrorrr	rr%�__subclasses__)rr'�okZrclsZsclsrrrr5ls:







zABCMeta.__subclasscheck__)N)
�__name__r,r-�__doc__rrr(r0r3r4r:r5�
__classcell__rrrrrs
rN)Z_weakrefsetrrr#rrrrr�<module>s
__pycache__/traceback.cpython-38.opt-1.pyc000064400000046744151153537550014313 0ustar00U

e5d;\�@s:dZddlZddlZddlZddlZddddddd	d
ddd
ddddddddgZd3dd�Zdd�Zd4dd�Zd5dd	�Z	d6dd�Z
dZdZd7dd�Z
d8d d�Zd!d�Zd"d#�Zd$d%�Zd9d&d
�Zd:d'd�Zd;d(d
�Zd<d)d�Zd=d*d�Zd>d+d�Zd,d�ZGd-d�d�Zd.d�Zd/d�Zd0ZGd1d�de�ZGd2d�d�ZdS)?z@Extract, format and print information about Python stack traces.�N�
extract_stack�
extract_tb�format_exception�format_exception_only�format_list�format_stack�	format_tb�	print_exc�
format_exc�print_exception�
print_last�print_stack�print_tb�clear_frames�FrameSummary�StackSummary�TracebackException�
walk_stack�walk_tbcCs4|dkrtj}t�|���D]}t||dd�qdS)zyPrint the list of tuples as returned by extract_tb() or
    extract_stack() as a formatted stack trace to the given file.N���file�end)�sys�stderrr�	from_list�format�print)�extracted_listr�item�r �!/usr/lib64/python3.8/traceback.py�
print_listsr"cCst�|���S)a�Format a list of tuples or FrameSummary objects for printing.

    Given a list of tuples or FrameSummary objects as returned by
    extract_tb() or extract_stack(), return a list of strings ready
    for printing.

    Each string in the resulting list corresponds to the item with the
    same index in the argument list.  Each string ends in a newline;
    the strings may contain internal newlines as well, for those items
    whose source text line is not None.
    )rrr)rr r r!rscCstt||d�|d�dS)aPrint up to 'limit' stack trace entries from the traceback 'tb'.

    If 'limit' is omitted or None, all entries are printed.  If 'file'
    is omitted or None, the output goes to sys.stderr; otherwise
    'file' should be an open file or file-like object with a write()
    method.
    ��limit�rN)r"r)�tbr$rr r r!r-scCst||d���S)z5A shorthand for 'format_list(extract_tb(tb, limit))'.r#)rr�r&r$r r r!r7scCstjt|�|d�S)a#
    Return a StackSummary object representing a list of
    pre-processed entries from traceback.

    This is useful for alternate formatting of stack traces.  If
    'limit' is omitted or None, all entries are extracted.  A
    pre-processed stack trace entry is a FrameSummary object
    containing attributes filename, lineno, name, and line
    representing the information that is usually printed for a stack
    trace.  The line is a string with leading and trailing
    whitespace stripped; if the source is not available it is None.
    r#)r�extractrr'r r r!r;s
zG
The above exception was the direct cause of the following exception:

zF
During handling of the above exception, another exception occurred:

TcCsB|dkrtj}tt|�|||d�j|d�D]}t||dd�q*dS)a�Print exception up to 'limit' stack trace entries from 'tb' to 'file'.

    This differs from print_tb() in the following ways: (1) if
    traceback is not None, it prints a header "Traceback (most recent
    call last):"; (2) it prints the exception type and value after the
    stack trace; (3) if type is SyntaxError and value has the
    appropriate format, it prints the line where the syntax error
    occurred with a caret on the next line indicating the approximate
    position of the error.
    Nr#��chainrr)rrr�typerr)�etype�valuer&r$rr*�liner r r!rWs��
cCs ttt|�|||d�j|d��S)azFormat a stack trace and the exception information.

    The arguments have the same meaning as the corresponding arguments
    to print_exception().  The return value is a list of strings, each
    ending in a newline and some containing internal newlines.  When
    these lines are concatenated and printed, exactly the same text is
    printed as does print_exception().
    r#r))�listrr+r)r,r-r&r$r*r r r!rls��cCstt||d����S)aFormat the exception part of a traceback.

    The arguments are the exception type and value such as given by
    sys.last_type and sys.last_value. The return value is a list of
    strings, each ending in a newline.

    Normally, the list contains a single string; however, for
    SyntaxError exceptions, it contains several lines that (when
    printed) display detailed information about where the syntax
    error occurred.

    The message indicating which exception occurred is always the last
    string in the list.

    N)r/rr)r,r-r r r!r|scCs.t|�}|dks|sd|}nd||f}|S)Nz%s
z%s: %s
)�	_some_str)r,r-�valuestrr.r r r!�_format_final_exc_line�s

r2cCs*z
t|�WSdt|�jYSXdS)Nz<unprintable %s object>)�strr+�__name__)r-r r r!r0�s
r0cCstt��|||d��dS)z>Shorthand for 'print_exception(*sys.exc_info(), limit, file)'.�r$rr*N)rr�exc_infor5r r r!r	�scCsd�tt��||d���S)z%Like print_exc() but return a string.r�r$r*)�joinrrr6r7r r r!r
�scCs.ttd�std��ttjtjtj|||�dS)znThis is a shorthand for 'print_exception(sys.last_type,
    sys.last_value, sys.last_traceback, limit, file)'.�	last_typezno last exceptionN)�hasattrr�
ValueErrorrr9�
last_value�last_tracebackr5r r r!r�s
�cCs*|dkrt��j}tt||d�|d�dS)z�Print a stack trace from its invocation point.

    The optional 'f' argument can be used to specify an alternate
    stack frame at which to start. The optional 'limit' and 'file'
    arguments have the same meaning as for print_exception().
    Nr#r%)r�	_getframe�f_backr"r)�fr$rr r r!r
�s
cCs"|dkrt��j}tt||d��S)z5Shorthand for 'format_list(extract_stack(f, limit))'.Nr#)rr>r?rr)r@r$r r r!r�s
cCs0|dkrt��j}tjt|�|d�}|��|S)asExtract the raw traceback from the current stack frame.

    The return value has the same format as for extract_tb().  The
    optional 'f' and 'limit' arguments have the same meaning as for
    print_stack().  Each item in the list is a quadruple (filename,
    line number, function name, text), and the entries are in order
    from oldest to newest stack frame.
    Nr#)rr>r?rr(r�reverse)r@r$�stackr r r!r�s
	
cCs8|dk	r4z|j��Wntk
r*YnX|j}qdS)zEClear all references to local variables in the frames of a traceback.N)�tb_frame�clear�RuntimeError�tb_next�r&r r r!r�sc@sZeZdZdZdZdddd�dd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
edd��ZdS)ra,A single frame from a traceback.

    - :attr:`filename` The filename for the frame.
    - :attr:`lineno` The line within filename for the frame that was
      active when the frame was captured.
    - :attr:`name` The name of the function or method that was executing
      when the frame was captured.
    - :attr:`line` The text from the linecache module for the
      of code that was running when the frame was captured.
    - :attr:`locals` Either None if locals were not supplied, or a dict
      mapping the name to the repr() of the variable.
    )�filename�lineno�name�_line�localsTN)�lookup_linerLr.cCsB||_||_||_||_|r"|j|r8dd�|��D�nd|_dS)a�Construct a FrameSummary.

        :param lookup_line: If True, `linecache` is consulted for the source
            code line. Otherwise, the line will be looked up when first needed.
        :param locals: If supplied the frame locals, which will be captured as
            object representations.
        :param line: If provided, use this instead of looking up the line in
            the linecache.
        cSsi|]\}}|t|��qSr )�repr)�.0�k�vr r r!�
<dictcomp>sz)FrameSummary.__init__.<locals>.<dictcomp>N)rHrIrJrKr.�itemsrL)�selfrHrIrJrMrLr.r r r!�__init__�szFrameSummary.__init__cCs`t|t�r:|j|jko8|j|jko8|j|jko8|j|jkSt|t�r\|j|j|j|jf|kStS�N)	�
isinstancerrHrIrJrL�tupler.�NotImplemented�rT�otherr r r!�__eq__s

�
�
�
zFrameSummary.__eq__cCs|j|j|j|jf|SrV)rHrIrJr.)rT�posr r r!�__getitem__szFrameSummary.__getitem__cCst|j|j|j|jg�SrV)�iterrHrIrJr.�rTr r r!�__iter__szFrameSummary.__iter__cCsdj|j|j|jd�S)Nz7<FrameSummary file {filename}, line {lineno} in {name}>)rHrIrJ)rrHrIrJr`r r r!�__repr__s
�zFrameSummary.__repr__cCsdS)N�r r`r r r!�__len__szFrameSummary.__len__cCs&|jdkr t�|j|j���|_|jSrV)rK�	linecache�getlinerHrI�stripr`r r r!r.s
zFrameSummary.line)
r4�
__module__�__qualname__�__doc__�	__slots__rUr\r^rarbrd�propertyr.r r r r!r�s
�
ccs4|dkrt��jj}|dk	r0||jfV|j}qdS)z�Walk a stack yielding the frame and line number for each frame.

    This will follow f.f_back from the given frame. If no frame is given, the
    current stack is used. Usually used with StackSummary.extract.
    N)rr>r?�f_lineno)r@r r r!r$s
ccs"|dk	r|j|jfV|j}qdS)z�Walk a traceback yielding the frame and line number for each frame.

    This will follow tb.tb_next (and thus is in the opposite order to
    walk_stack). Usually used with StackSummary.extract.
    N)rC�	tb_linenorFrGr r r!r1s�c@s:eZdZdZedddd�dd��Zedd	��Zd
d�ZdS)rzA stack of frames.NTF�r$�lookup_lines�capture_localsc

Cs�|dkr(ttdd�}|dk	r(|dkr(d}|dk	rV|dkrFt�||�}ntj||d�}|�}t�}|D]Z\}}|j}	|	j}
|	j	}|�
|
�t�|
|j
�|r�|j}nd}|�t|
||d|d��qf|D]}
t�|
�q�|r�|D]
}|jq�|S)a?Create a StackSummary from a traceback or stack object.

        :param frame_gen: A generator that yields (frame, lineno) tuples to
            include in the stack.
        :param limit: None to include all frames or the number of frames to
            include.
        :param lookup_lines: If True, lookup lines for each frame immediately,
            otherwise lookup is deferred until the frame is rendered.
        :param capture_locals: If True, the local variables from each frame will
            be captured as object representations into the FrameSummary.
        N�tracebacklimitr)�maxlenF)rMrL)�getattrr�	itertools�islice�collections�deque�set�f_code�co_filename�co_name�addre�	lazycache�	f_globals�f_locals�appendr�
checkcacher.)
�klass�	frame_genr$rqrr�result�fnamesr@rI�corHrJr�r r r!r(As@
�
zStackSummary.extractc	CsLt�}|D]<}t|t�r$|�|�q
|\}}}}|�t||||d��q
|S)z�
        Create a StackSummary object from a supplied list of
        FrameSummary objects or old-style list of tuples.
        )r.)rrWrr�)r��a_listr��framerHrIrJr.r r r!rqs

zStackSummary.from_listc
Csng}d}d}d}d}|D�]}|dksT||jksT|dksT||jksT|dksT||jkr�|tkr�|t8}|�d|�d|dkr|dnd�d��|j}|j}|j}d}|d7}|tkr�qg}|�d	�|j|j|j��|jr�|�d
�|j����|j�r t	|j�
��D]\}}	|�dj||	d���q|�d�|��q|tk�rj|t8}|�d|�d|dk�r^dnd�d��|S)
aFormat the stack ready for printing.

        Returns a list of strings ready for printing.  Each string in the
        resulting list corresponds to a single frame from the stack.
        Each string ends in a newline; the strings may contain internal
        newlines as well, for those items with source text lines.

        For long sequences of the same frame and line, the first few
        repetitions are shown, followed by a summary line stating the exact
        number of further repetitions.
        Nrz  [Previous line repeated z
 more time��srz]
z  File "{}", line {}, in {}
�    {}
z    {name} = {value}
)rJr-)rHrIrJ�_RECURSIVE_CUTOFFr�rr.rgrL�sortedrSr8)
rTr��	last_file�	last_line�	last_name�countr��rowrJr-r r r!r�sZ
������
�zStackSummary.format)r4rhrirj�classmethodr(rrr r r r!r>s�/
c@s^eZdZdZddddd�dd�Zedd	��Zd
d�Zdd
�Zdd�Z	dd�Z
dd�dd�ZdS)ra�An exception ready for rendering.

    The traceback module captures enough attributes from the original exception
    to this intermediary form to ensure that no references are held, while
    still being able to fully print or format it.

    Use `from_exception` to create TracebackException instances from exception
    objects, or the constructor to create TracebackException instances from
    individual components.

    - :attr:`__cause__` A TracebackException of the original *__cause__*.
    - :attr:`__context__` A TracebackException of the original *__context__*.
    - :attr:`__suppress_context__` The *__suppress_context__* value from the
      original exception.
    - :attr:`stack` A `StackSummary` representing the traceback.
    - :attr:`exc_type` The class of the original traceback.
    - :attr:`filename` For syntax errors - the filename where the error
      occurred.
    - :attr:`lineno` For syntax errors - the linenumber where the error
      occurred.
    - :attr:`text` For syntax errors - the text where the error
      occurred.
    - :attr:`offset` For syntax errors - the offset into the text where the
      error occurred.
    - :attr:`msg` For syntax errors - the compiler error message.
    NTF�r$rqrr�_seenc	CsJ|dkrt�}|�t|��|r\|jdk	r\t|j�|kr\tt|j�|j|jj|d||d�}nd}|r�|jdk	r�t|j�|kr�tt|j�|j|jj|d||d�}	nd}	||_|	|_|r�|jnd|_t	j
t|�|||d�|_||_
t|�|_|�r8t|t��r8|j|_|j}
|
dk	�rt|
�nd|_|j|_|j|_|j|_|�rF|��dS)NFr�rp)rzr~�id�	__cause__rr+�
__traceback__�__context__�__suppress_context__rr(rrB�exc_typer0�_str�
issubclass�SyntaxErrorrHrIr3�text�offset�msg�_load_lines)rTr��	exc_value�
exc_tracebackr$rqrrr��cause�context�lnor r r!rU�sd��	��	��
zTracebackException.__init__cOs|t|�||jf|�|�S)z.Create a TracebackException from an exception.)r+r�)�cls�exc�args�kwargsr r r!�from_exceptionsz!TracebackException.from_exceptioncCs6|jD]
}|jq|jr"|j��|jr2|j��dS)z7Private API. force all lines in the stack to be loaded.N)rBr.r�r�r�)rTr�r r r!r�s

zTracebackException._load_linescCs|j|jkSrV)�__dict__rZr r r!r\szTracebackException.__eq__cCs|jSrV)r�r`r r r!�__str__szTracebackException.__str__ccs6|jdkrtd|j�VdS|jj}|jj}|dkr@|d|}t|jt�s^t||j�VdSd}|jdk	r�d�|j	pxd|j�Vn|j	dk	r�d�|j	�}|j
}|j}|dk	�rd�|���V|dk	�r|�
d	�}tt|�|�d
}|d|���}dd�|D�}d
�d�|��V|j�p d}d�|||�VdS)a�Format the exception part of the traceback.

        The return value is a generator of strings, each ending in a newline.

        Normally, the generator emits a single string; however, for
        SyntaxError exceptions, it emits several lines that (when
        printed) display detailed information about where the syntax
        error occurred.

        The message indicating which exception occurred is always the last
        string in the output.
        N)�__main__�builtins�.rz  File "{}", line {}
z<string>z ({})r��
r�css|]}|��r|pdVqdS)� N)�isspace)rO�cr r r!�	<genexpr>Msz;TracebackException.format_exception_only.<locals>.<genexpr>z    {}^
z<no detail available>z	{}: {}{}
)r�r2r�rirhr�r�rIrrHr�r�rg�rstrip�min�len�lstripr8r�)rT�stype�smod�filename_suffix�badliner��
caretspacer�r r r!r"s<

�



z(TracebackException.format_exception_onlyr)ccs�|rT|jdk	r*|jj|d�EdHtVn*|jdk	rT|jsT|jj|d�EdHtV|jrpdV|j��EdH|��EdHdS)a�Format the exception.

        If chain is not *True*, *__cause__* and *__context__* will not be formatted.

        The return value is a generator of strings, each ending in a newline and
        some containing internal newlines. `print_exception` is a wrapper around
        this method which just prints the lines to a file.

        The message indicating which exception occurred is always the last
        string in the output.
        Nr)z#Traceback (most recent call last):
)r�r�_cause_messager�r��_context_messagerBr)rTr*r r r!rRs

�zTracebackException.format)r4rhrirjrUr�r�r�r\r�rrr r r r!r�s�:
	0)N)NN)N)N)NNT)NT)NNT)NT)NNT)NNN)NN)NN) rjrxrvrer�__all__r"rrrrr�r�rrrr2r0r	r
rr
rrrrrrr�r/rrr r r r!�<module>sb�




��







A
z__pycache__/optparse.cpython-38.opt-1.pyc000064400000135550151153537550014223 0ustar00U

e5d���@s�dZdZdddddddd	d
ddd
dddddgZdZddlZddlZddlZdd�ZzddlmZm	Z	Wn$e
k
r�dd�Zdd�Z	YnXeZGdd
�d
e�Z
Gdd�de
�ZGdd�de�ZGd d�de
�ZGd!d�de
�ZGd"d#�d#e�ZGd$d
�d
�ZGd%d�de�ZGd&d�de�Zd'd(�Zd)d*�Zeed+�feed+�feed,�feed-�fd.�Zd/d0�Zd1d�Zd2ZGd3d�d�Zd4Zd5Z Gd6d�d�Z!Gd7d�d�Z"Gd8d�de"�Z#Gd9d	�d	e"�Z$d:d;�Z%eZ&dS)<a�A powerful, extensible, and easy-to-use option parser.

By Greg Ward <gward@python.net>

Originally distributed as Optik.

For support, use the optik-users@lists.sourceforge.net mailing list
(http://lists.sourceforge.net/lists/listinfo/optik-users).

Simple usage example:

   from optparse import OptionParser

   parser = OptionParser()
   parser.add_option("-f", "--file", dest="filename",
                     help="write report to FILE", metavar="FILE")
   parser.add_option("-q", "--quiet",
                     action="store_false", dest="verbose", default=True,
                     help="don't print status messages to stdout")

   (options, args) = parser.parse_args()
z1.5.3�Option�make_option�
SUPPRESS_HELP�SUPPRESS_USAGE�Values�OptionContainer�OptionGroup�OptionParser�
HelpFormatter�IndentedHelpFormatter�TitledHelpFormatter�
OptParseError�OptionError�OptionConflictError�OptionValueError�BadOptionError�check_choicea"
Copyright (c) 2001-2006 Gregory P. Ward.  All rights reserved.
Copyright (c) 2002-2006 Python Software Foundation.  All rights reserved.

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

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

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

  * Neither the name of the author nor the names of its
    contributors may be used to endorse or promote products derived from
    this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
�NcCsd|jjt|�|fS)Nz<%s at 0x%x: %s>)�	__class__�__name__�id��self�r� /usr/lib64/python3.8/optparse.py�_reprOsr)�gettext�ngettextcCs|S�Nr)�messagerrrr\srcCs|dkr|S|S�N�r)ZsingularZplural�nrrrr_src@seZdZdd�Zdd�ZdS)rcCs
||_dSr��msg�rr#rrr�__init__hszOptParseError.__init__cCs|jSrr"rrrr�__str__kszOptParseError.__str__N)r�
__module__�__qualname__r%r&rrrrrgsc@s eZdZdZdd�Zdd�ZdS)r
z]
    Raised if an Option instance is created with invalid or
    inconsistent arguments.
    cCs||_t|�|_dSr)r#�str�	option_id)rr#�optionrrrr%uszOptionError.__init__cCs |jrd|j|jfS|jSdS)Nz
option %s: %s)r*r#rrrrr&yszOptionError.__str__N�rr'r(�__doc__r%r&rrrrr
osc@seZdZdZdS)rzE
    Raised if conflicting options are added to an OptionParser.
    N�rr'r(r-rrrrrsc@seZdZdZdS)rzS
    Raised if an invalid option value is encountered on the command
    line.
    Nr.rrrrr�sc@s eZdZdZdd�Zdd�ZdS)rzB
    Raised if an invalid option is seen on the command line.
    cCs
||_dSr)�opt_str�rr/rrrr%�szBadOptionError.__init__cCstd�|jS)Nzno such option: %s)�_r/rrrrr&�szBadOptionError.__str__Nr,rrrrr�sc@s eZdZdZdd�Zdd�ZdS)�AmbiguousOptionErrorzD
    Raised if an ambiguous option is seen on the command line.
    cCst�||�||_dSr)rr%�
possibilities)rr/r3rrrr%�szAmbiguousOptionError.__init__cCstd�|jd�|j�fS)Nzambiguous option: %s (%s?)�, )r1r/�joinr3rrrrr&�s�zAmbiguousOptionError.__str__Nr,rrrrr2�sr2c@s�eZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!S)"r	a�
    Abstract base class for formatting option help.  OptionParser
    instances should use one of the HelpFormatter subclasses for
    formatting help; by default IndentedHelpFormatter is used.

    Instance attributes:
      parser : OptionParser
        the controlling OptionParser instance
      indent_increment : int
        the number of columns to indent per nesting level
      max_help_position : int
        the maximum starting column for option help text
      help_position : int
        the calculated starting column for option help text;
        initially the same as the maximum
      width : int
        total number of columns for output (pass None to constructor for
        this value to be taken from the $COLUMNS environment variable)
      level : int
        current indentation level
      current_indent : int
        current indentation level (in columns)
      help_width : int
        number of columns available for option help text (calculated)
      default_tag : str
        text to replace with each option's default value, "%default"
        by default.  Set to false value to disable default value expansion.
      option_strings : { Option : str }
        maps Option instances to the snippet of help text explaining
        the syntax of that option, e.g. "-h, --help" or
        "-fFILE, --file=FILE"
      _short_opt_fmt : str
        format string controlling how short options with values are
        printed in help text.  Must be either "%s%s" ("-fFILE") or
        "%s %s" ("-f FILE"), because those are the two syntaxes that
        Optik supports.
      _long_opt_fmt : str
        similar but for long options; must be either "%s %s" ("--file FILE")
        or "%s=%s" ("--file=FILE").
    Znonec	Cs�d|_||_|dkrLzttjd�}Wnttfk
rBd}YnX|d8}||_t|t	|d|d��|_
|_d|_d|_
d|_||_d|_i|_d|_d|_dS)	NZCOLUMNS�P��rz%defaultz%s %sz%s=%s)�parser�indent_increment�int�os�environ�KeyError�
ValueError�width�min�max�
help_position�max_help_position�current_indent�level�
help_width�short_first�default_tag�option_strings�_short_opt_fmt�
_long_opt_fmt�rr:rDr@rHrrrr%�s&
�
zHelpFormatter.__init__cCs
||_dSr)r9�rr9rrr�
set_parser�szHelpFormatter.set_parsercCs&|dkrtd|��d|d|_dS)N)�� z/invalid metavar delimiter for short options: %r�%s)r?rK�rZdelimrrr�set_short_opt_delimiter�s
�z%HelpFormatter.set_short_opt_delimitercCs&|dkrtd|��d|d|_dS)N)�=rQz.invalid metavar delimiter for long options: %rrR)r?rLrSrrr�set_long_opt_delimiter�s
�z$HelpFormatter.set_long_opt_delimitercCs"|j|j7_|jd7_dSr�rEr:rFrrrr�indent�szHelpFormatter.indentcCs"|j|j8_|jd8_dSrrWrrrr�dedent�szHelpFormatter.dedentcCstd��dS�Nzsubclasses must implement��NotImplementedError�r�usagerrr�format_usage�szHelpFormatter.format_usagecCstd��dSrZr[�rZheadingrrr�format_headingszHelpFormatter.format_headingcCs.t|j|jd�}d|j}tj||||d�S)z�
        Format a paragraph of free-form text for inclusion in the
        help output at the current indentation level.
        �rQ)Zinitial_indentZsubsequent_indent)rBr@rE�textwrapZfill)r�textZ
text_widthrXrrr�_format_texts
�zHelpFormatter._format_textcCs|r|�|�dSdSdS�N�
rP�re�r�descriptionrrr�format_descriptionsz HelpFormatter.format_descriptioncCs|rd|�|�dSdSdSrfrh)r�epilogrrr�
format_epilogszHelpFormatter.format_epilogcCsP|jdks|js|jS|jj�|j�}|tks6|dkr<|j}|j�|jt	|��Sr)
r9rI�help�defaults�get�dest�
NO_DEFAULT�NO_DEFAULT_VALUE�replacer))rr+Z
default_valuerrr�expand_defaultszHelpFormatter.expand_defaultcs�g}�j|}�j�jd}t|�|krBd�jd|f}�j}nd�jd||f}d}|�|�|jr���|�}t�|�j	�}|�d|d|df�|�
�fdd�|dd�D��n|d	d
kr�|�d
�d�|�S)Nr7�%*s%s
rPz	%*s%-*s  rcsg|]}d�jd|f�qS)rvrP)rC)�.0�linerrr�
<listcomp>Es�z/HelpFormatter.format_option.<locals>.<listcomp>r ���rg)rJrCrE�len�appendrnrurcZwraprG�extendr5)rr+�result�optsZ	opt_widthZindent_firstZ	help_textZ
help_linesrrr�
format_option(s&



�

zHelpFormatter.format_optioncCs�|��d}|jD],}|�|�}||j|<t|t|�|j�}q|��|jD]8}|jD],}|�|�}||j|<t|t|�|j�}qXqN|��|��t	|d|j
�|_t|j|jd�|_
dS)Nrr7rb)rX�option_list�format_option_stringsrJrBr{rE�
option_groupsrYrArDrCr@rG)rr9Zmax_len�optZstrings�grouprrr�store_option_stringsKs 






z"HelpFormatter.store_option_stringscst|��rF|jp|j�����fdd�|jD�}��fdd�|jD�}n|j}|j}�jrb||}n||}d�|�S)z@Return a comma-separated list of option strings & metavariables.csg|]}�j|�f�qSr)rK)rwZsopt��metavarrrrryas�z7HelpFormatter.format_option_strings.<locals>.<listcomp>csg|]}�j|�f�qSr)rL)rwZloptr�rrrycs�r4)�takes_valuer�rq�upper�_short_opts�
_long_optsrHr5)rr+Z
short_optsZ	long_optsrrr�rr�]s��
z#HelpFormatter.format_option_stringsN)rr'r(r-rsr%rOrTrVrXrYr_rarerkrmrur�r�r�rrrrr	�s")
#c@s*eZdZdZddd�Zdd	�Zd
d�ZdS)
r
z.Format help with indented section bodies.
    r7�Nr cCst�|||||�dSr�r	r%rMrrrr%ts�zIndentedHelpFormatter.__init__cCstd�|S)Nz
Usage: %s
)r1r]rrrr_|sz"IndentedHelpFormatter.format_usagecCsd|jd|fS)Nz%*s%s:
rP)rEr`rrrrasz$IndentedHelpFormatter.format_heading)r7r�Nr �rr'r(r-r%r_rarrrrr
ps�
c@s*eZdZdZddd�Zdd�Zd	d
�ZdS)rz1Format help with underlined section headers.
    rr�NcCst�|||||�dSrr�rMrrrr%�s�zTitledHelpFormatter.__init__cCsd|�td��|fS)Nz%s  %s
ZUsage)rar1r]rrrr_�sz TitledHelpFormatter.format_usagecCsd|d|jt|�fS)Nz%s
%s
z=-)rFr{r`rrrra�sz"TitledHelpFormatter.format_heading)rr�Nrr�rrrrr�s�
cCsh|dd���dkrd}nD|dd���dkrDd}|dd�p@d}n|dd�dkrZd}nd}|||�S)	Nr7Z0x�Z0b�0r ��
)�lower)�val�type�radixrrr�
_parse_num�sr�cCs
t|t�Sr)r�r;)r�rrr�
_parse_int�sr�Zintegerzfloating-point�complex)r;�long�floatr�cCsHt|j\}}z
||�WStk
rBttd�|||f��YnXdS)Nzoption %s: invalid %s value: %r)�_builtin_cvtr�r?rr1)r+r��valueZcvtZwhatrrr�
check_builtin�s
�r�cCs:||jkr|Sd�tt|j��}ttd�|||f��dS)Nr4z.option %s: invalid choice: %r (choose from %s))�choicesr5�map�reprrr1)r+r�r�r�rrrr�s
��)ZNOZDEFAULTc@s�eZdZdZdddddddd	d
ddd
gZdZdZdZdZdZ	dZ
eeeeed�Z
dZdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�ZeeeeeeegZd,d-�ZeZd.d/�Zd0d1�Zd2d3�Zd4d5�Z d6d7�Z!d8d9�Z"dS):rar
    Instance attributes:
      _short_opts : [string]
      _long_opts : [string]

      action : string
      type : string
      dest : string
      default : any
      nargs : int
      const : any
      choices : [string]
      callback : function
      callback_args : (any*)
      callback_kwargs : { string : any }
      help : string
      metavar : string
    �actionr�rq�default�nargs�constr��callback�
callback_args�callback_kwargsrnr�)
�store�store_const�
store_true�store_falser|�append_const�countr�rn�version)r�r�r�r�r|r�r�)r�r|r�)r�r|)r�r�)�stringr;r�r�r��choice)r;r�r�r�r�NcOsBg|_g|_|�|�}|�|�|�|�|jD]}||�q0dSr)r�r��_check_opt_strings�_set_opt_strings�
_set_attrs�
CHECK_METHODS)rr�attrs�checkerrrrr%4s



zOption.__init__cCsdd�|D�}|std��|S)NcSsg|]}|r|�qSrr)rwr�rrrryKsz-Option._check_opt_strings.<locals>.<listcomp>z+at least one option string must be supplied)�	TypeError)rrrrrr�GszOption._check_opt_stringscCs�|D]�}t|�dkr$td||��qt|�dkrd|ddkrH|ddksVtd||��|j�|�q|dd�dkr�|ddks�td||��|j�|�qdS)	Nr7z>invalid option string %r: must be at least two characters longr�-r zMinvalid short option string %r: must be of the form -x, (x any non-dash char)�--zGinvalid long option string %r: must start with --, followed by non-dash)r{r
r�r|r�)rrr�rrrr�Ps2������zOption._set_opt_stringscCsv|jD]F}||kr*t||||�||=q|dkr@t||t�qt||d�q|rrt|���}tdd�|�|��dS)Nr�zinvalid keyword arguments: %sr4)�ATTRS�setattrrr�sorted�keysr
r5)rr��attrrrrr�es
�zOption._set_attrscCs2|jdkrd|_n|j|jkr.td|j|��dS)Nr�zinvalid action: %r)r��ACTIONSr
rrrr�
_check_actionxs
zOption._check_actioncCs�|jdkr0|j|jkr�|jdk	r(d|_q�d|_n^t|jt�rF|jj|_|jdkrVd|_|j|jkrrtd|j|��|j|jkr�td|j|��dS)Nr�r�r)zinvalid option type: %rz$must not supply a type for action %r)	r�r��ALWAYS_TYPED_ACTIONSr��
isinstancer�TYPESr
�
TYPED_ACTIONSrrrr�_check_type~s 



�zOption._check_typecCsr|jdkrT|jdkr td|��qnt|jttf�sntdtt|j���d�d|��n|jdk	rntd|j|��dS)Nr�z/must supply a list of choices for type 'choice'z1choices must be a list of strings ('%s' supplied)�'r z#must not supply choices for type %r)r�r�r
r��tuple�listr)�splitrrrr�
_check_choice�s$

���
�zOption._check_choicecCs\|j|jkp|jdk	}|jdkrX|rX|jrH|jddd��dd�|_n|jdd|_dS)Nrr7r�r1r )r��
STORE_ACTIONSr�rqr�rtr�)rr�rrr�_check_dest�s�zOption._check_destcCs*|j|jkr&|jdk	r&td|j|��dS)Nz*'const' must not be supplied for action %r)r��
CONST_ACTIONSr�r
rrrr�_check_const�s
�zOption._check_constcCs<|j|jkr|jdkr8d|_n|jdk	r8td|j|��dS)Nr z*'nargs' must not be supplied for action %r)r�r�r�r
rrrr�_check_nargs�s

�zOption._check_nargscCs�|jdkrrt|j�s$td|j|��|jdk	rJt|jt�sJtd|j|��|jdk	r�t|jt�s�td|j|��nB|jdk	r�td|j|��|jdk	r�td|��|jdk	r�td|��dS)Nr�zcallback not callable: %rz3callback_args, if supplied, must be a tuple: not %rz4callback_kwargs, if supplied, must be a dict: not %rz.callback supplied (%r) for non-callback optionz.callback_args supplied for non-callback optionz0callback_kwargs supplied for non-callback option)	r��callabler�r
r�r�r�r��dictrrrr�_check_callback�sR

�

���

���
��
�
�zOption._check_callbackcCsd�|j|j�S)N�/)r5r�r�rrrrr&�szOption.__str__cCs
|jdk	Sr)r�rrrrr��szOption.takes_valuecCs|jr|jdS|jdSdS�Nr)r�r�rrrr�get_opt_string�s
zOption.get_opt_stringcCs*|j�|j�}|dkr|S||||�SdSr)�TYPE_CHECKERrpr�)rr�r�r�rrr�check_value�szOption.check_valuecs:|dk	r6�jdkr���|�St��fdd�|D��SdS)Nr csg|]}���|��qSr)r�)rw�v�r�rrrrysz(Option.convert_value.<locals>.<listcomp>)r�r�r�)rr�r�rr�r�
convert_values
zOption.convert_valuecCs$|�||�}|�|j|j||||�Sr)r��take_actionr�rq)rr�r��valuesr9rrr�processs�zOption.processc	Cs:|dkrt|||��n|dkr2t|||j��n|dkrHt||d�n�|dkr^t||d�n�|dkrz|�|g��|�n�|dkr�|�|g��|j�n�|d	kr�t|||�|d
�d�n||dkr�|jp�d
}|jp�i}|j||||f|�|�nF|dk�r|��|��n*|dk�r(|�	�|��nt
d|j��dS)Nr�r�r�Tr�Fr|r�r�rr r�rrnr�zunknown action %r)r�r��ensure_valuer|r�r�r��
print_help�exit�
print_versionr?r�)	rr�rqr�r�r�r9�args�kwargsrrrr�s4





zOption.take_action)#rr'r(r-r�r�r�r�r�r�r�r�rr�r�r%r�r�r�r�r�r�r�r�r�r�r&r�__repr__r�r�r�r�r�r�rrrrr�sl�
�	
	�	ZSUPPRESSHELPZ
SUPPRESSUSAGEc@s^eZdZddd�Zdd�ZeZdd�Zdd	�Zd
d�Z	dd
�Z
ddd�Zddd�Zdd�Z
dS)rNcCs&|r"|��D]\}}t|||�qdSr)�itemsr�)rror�r�rrrr%9szValues.__init__cCs
t|j�Sr)r)�__dict__rrrrr&>szValues.__str__cCs2t|t�r|j|jkSt|t�r*|j|kStSdSr)r�rr�r��NotImplemented)r�otherrrr�__eq__Cs



z
Values.__eq__cCs6t|�D](}||kr||}|dk	rt|||�qdS)z�
        Update the option values from an arbitrary dictionary, but only
        use keys from dict that already have a corresponding attribute
        in self.  Any keys in dict without a corresponding attribute
        are silently ignored.
        N)�dirr�)rr�r�Zdvalrrr�_update_carefulKs
zValues._update_carefulcCs|j�|�dS)z�
        Update the option values from an arbitrary dictionary,
        using all keys from the dictionary regardless of whether
        they have a corresponding attribute in self or not.
        N)r��update)rr�rrr�
_update_looseXszValues._update_loosecCs8|dkr|�|�n |dkr(|�|�ntd|��dS)N�carefulZloosezinvalid update mode: %r)r�r�r?)rr��moderrr�_update`s
zValues._updater�cCs&t|�tj|}|�t|�|�dSr)�
__import__�sys�modulesr��vars)r�modnamer��modrrr�read_modulehs
zValues.read_modulecCs&i}tt|���|�|�||�dSr)�exec�open�readr�)r�filenamer�r�rrr�	read_filemszValues.read_filecCs.t||�rt||�dkr$t|||�t||�Sr)�hasattr�getattrr�)rr�r�rrrr�rszValues.ensure_value)N)r�)r�)rr'r(r%r&rr�r�r�r�r�r�r�r�rrrrr7s



c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"S)#ra�
    Abstract base class.

    Class attributes:
      standard_option_list : [Option]
        list of standard options that will be accepted by all instances
        of this parser class (intended to be overridden by subclasses).

    Instance attributes:
      option_list : [Option]
        the list of Option objects contained by this OptionContainer
      _short_opt : { string : Option }
        dictionary mapping short option strings, eg. "-f" or "-X",
        to the Option instances that implement them.  If an Option
        has multiple short option strings, it will appear in this
        dictionary multiple times. [1]
      _long_opt : { string : Option }
        dictionary mapping long option strings, eg. "--file" or
        "--exclude", to the Option instances that implement them.
        Again, a given Option can occur multiple times in this
        dictionary. [1]
      defaults : { string : any }
        dictionary mapping option destination names to default
        values for each destination [1]

    [1] These mappings are common to (shared by) all components of the
        controlling OptionParser, where they are initially created.

    cCs&|��||_|�|�|�|�dSr)�_create_option_list�option_class�set_conflict_handler�set_description)rr�conflict_handlerrjrrrr%�s
zOptionContainer.__init__cCsi|_i|_i|_dSr��
_short_opt�	_long_optrorrrr�_create_option_mappings�sz'OptionContainer._create_option_mappingscCs|j|_|j|_|j|_dSrrrNrrr�_share_option_mappings�sz&OptionContainer._share_option_mappingscCs|dkrtd|��||_dS)N)�error�resolvez$invalid conflict_resolution value %r)r?r)r�handlerrrrr�sz$OptionContainer.set_conflict_handlercCs
||_dSr�rjrirrrr�szOptionContainer.set_descriptioncCs|jSrrrrrr�get_description�szOptionContainer.get_descriptioncCs|`|`|`dS�zsee OptionParser.destroy().Nrrrrr�destroy�szOptionContainer.destroycCs�g}|jD]"}||jkr
|�||j|f�q
|jD]"}||jkr4|�||j|f�q4|r�|j}|dkr�tdd�dd�|D��|��nd|dkr�|D]V\}}|�d�r�|j�	|�|j|=n|j�	|�|j|=|js�|js�|j
j�	|�q�dS)Nrz conflicting option string(s): %sr4cSsg|]}|d�qS)rr)rw�corrrry�sz3OptionContainer._check_conflict.<locals>.<listcomp>rr�)r�rr|r�rrrr5�
startswith�remove�	containerr�)rr+Z
conflict_optsr�r
Zc_optionrrr�_check_conflict�s2



��

zOptionContainer._check_conflictcOs�t|dt�r|j||�}n8t|�dkrL|sL|d}t|t�sTtd|��ntd��|�|�|j�|�||_	|j
D]}||j|<qv|jD]}||j
|<q�|jdk	r�|jtk	r�|j|j|j<n|j|jkr�d|j|j<|S)zOadd_option(Option)
           add_option(opt_str, ..., kwarg=val, ...)
        rr znot an Option instance: %r�invalid argumentsN)r�r)rr{rr�rr�r|rr�rr�rrqr�rrro)rr�r�r+r�rrr�
add_option�s(





zOptionContainer.add_optioncCs|D]}|�|�qdSr)r)rr�r+rrr�add_optionsszOptionContainer.add_optionscCs|j�|�p|j�|�Sr)rrprr0rrr�
get_options
�zOptionContainer.get_optioncCs||jkp||jkSr)rrr0rrr�
has_options
�zOptionContainer.has_optioncCsn|j�|�}|dkr |j�|�}|dkr4td|��|jD]}|j|=q:|jD]}|j|=qN|jj�|�dS)Nzno such option %r)	rrprr?r�r�rr�r)rr/r+r�rrr�
remove_options



zOptionContainer.remove_optioncCs>|js
dSg}|jD]}|jtk	r|�|�|��qd�|�S�NrP)r�rnrr|r�r5)r�	formatterr~r+rrr�format_option_helps

z"OptionContainer.format_option_helpcCs|�|���Sr)rkr�rrrrrrk(sz"OptionContainer.format_descriptioncCs:g}|jr|�|�|��|jr0|�|�|��d�|�S)Nrg)rjr|rkr�rr5�rrr~rrr�format_help+szOptionContainer.format_helpN)rr'r(r-r%r	r
rrrrrrrrrrrrkr"rrrrrxs"			c@s6eZdZddd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
rNcCs$||_t�||j|j|�||_dSr)r9rr%rr�title)rr9r#rjrrrr%6s�zOptionGroup.__init__cCsg|_|�|j�dSr)r�r
r9rrrrr<szOptionGroup._create_option_listcCs
||_dSr)r#)rr#rrr�	set_title@szOptionGroup.set_titlecCst�|�|`dSr)rrr�rrrrrCs
zOptionGroup.destroycCs0|�|j�}|��|t�||�7}|��|Sr)rar#rXrr"rYr!rrrr"Js
zOptionGroup.format_help)N)rr'r(r%rr$rr"rrrrr4s

c
@sbeZdZdZgZddedddddddf
dd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dPdd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�ZdQd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Z dRd<d=�Z!d>d?�Z"d@dA�Z#dSdBdC�Z$dDdE�Z%dTdFdG�Z&dUdHdI�Z'dJdK�Z(dVdLdM�Z)dWdNdO�Z*dS)Xra$
    Class attributes:
      standard_option_list : [Option]
        list of standard options that will be accepted by all instances
        of this parser class (intended to be overridden by subclasses).

    Instance attributes:
      usage : string
        a usage string for your program.  Before it is displayed
        to the user, "%prog" will be expanded to the name of
        your program (self.prog or os.path.basename(sys.argv[0])).
      prog : string
        the name of the current program (to override
        os.path.basename(sys.argv[0])).
      description : string
        A paragraph of text giving a brief overview of your program.
        optparse reformats this paragraph to fit the current terminal
        width and prints it when the user requests help (after usage,
        but before the list of options).
      epilog : string
        paragraph of help text to print after option help

      option_groups : [OptionGroup]
        list of option groups in this parser (option groups are
        irrelevant for parsing the command-line, but very useful
        for generating help)

      allow_interspersed_args : bool = true
        if true, positional arguments may be interspersed with options.
        Assuming -a and -b each take a single argument, the command-line
          -ablah foo bar -bboo baz
        will be interpreted the same as
          -ablah -bboo -- foo bar baz
        If this flag were false, that command line would be interpreted as
          -ablah -- foo bar -bboo baz
        -- ie. we stop processing options as soon as we see the first
        non-option argument.  (This is the tradition followed by
        Python's getopt module, Perl's Getopt::Std, and other argument-
        parsing libraries, but it is generally annoying to users.)

      process_default_values : bool = true
        if true, option default values are processed similarly to option
        values from the command line: that is, they are passed to the
        type-checking function for the option's type (as long as the
        default value is a string).  (This really only matters if you
        have defined custom types; see SF bug #955889.)  Set it to false
        to restore the behaviour of Optik 1.4.1 and earlier.

      rargs : [string]
        the argument list currently being parsed.  Only set when
        parse_args() is active, and continually trimmed down as
        we consume arguments.  Mainly there for the benefit of
        callback options.
      largs : [string]
        the list of leftover arguments that we have skipped while
        parsing options.  If allow_interspersed_args is false, this
        list is always empty.
      values : Values
        the set of option values currently being accumulated.  Only
        set when parse_args() is active.  Also mainly for callbacks.

    Because of the 'rargs', 'largs', and 'values' attributes,
    OptionParser is not thread-safe.  If, for some perverse reason, you
    need to parse command-line arguments simultaneously in different
    threads, use different OptionParser instances.

    NrTcCsrt�||||�|�|�|	|_||_d|_d|_|dkr@t�}||_|j�	|�|
|_
|j||d�|��dS)NT)�add_help)
rr%�	set_usage�progr��allow_interspersed_args�process_default_valuesr
rrOrl�_populate_option_list�_init_parsing_state)rr^r�rr�rrjrZadd_help_optionr'rlrrrr%�s(�
�zOptionParser.__init__cCs.t�|�|jD]}|��q|`|`|`dS)a
        Declare that you are done with this OptionParser.  This cleans up
        reference cycles so the OptionParser (and all objects referenced by
        it) can be garbage-collected promptly.  After calling destroy(), the
        OptionParser is unusable.
        N)rrr�r�r)rr�rrrr�s


zOptionParser.destroycCsg|_g|_|��dSr)r�r�r	rrrrr�sz OptionParser._create_option_listcCs|jdddtd�d�dS)Nz-hz--helprnzshow this help message and exit�r�rn�rr1rrrr�_add_help_option�s�zOptionParser._add_help_optioncCs|jddtd�d�dS)Nz	--versionr�z&show program's version number and exitr,r-rrrr�_add_version_option�s�z OptionParser._add_version_optioncCs>|jr|�|j�|r |�|�|jr.|��|r:|��dSr)�standard_option_listrr�r/r.)rr�r%rrrr*�s
z"OptionParser._populate_option_listcCsd|_d|_d|_dSr)�rargs�largsr�rrrrr+�sz OptionParser._init_parsing_statecCsL|dkrtd�|_n4|tkr$d|_n$|���d�rB|dd�|_n||_dS)Nz%prog [options]zusage: �)r1r^rr�rr]rrrr&�szOptionParser.set_usagecCs
d|_dS)aSet parsing to not stop on the first non-option, allowing
        interspersing switches with command arguments. This is the
        default behavior. See also disable_interspersed_args() and the
        class documentation description of the attribute
        allow_interspersed_args.TN�r(rrrr�enable_interspersed_args�sz%OptionParser.enable_interspersed_argscCs
d|_dS)z�Set parsing to stop on the first non-option. Use this if
        you have a command processor which runs another command that
        has options of its own and you want to make sure these options
        don't get confused.
        FNr4rrrr�disable_interspersed_argssz&OptionParser.disable_interspersed_argscCs
||_dSr)r))rr�rrr�set_process_default_valuessz'OptionParser.set_process_default_valuescCs||j|<dSr)ro)rrqr�rrr�set_defaultszOptionParser.set_defaultcKs|j�|�dSr)ror�)rr�rrr�set_defaultsszOptionParser.set_defaultscCs*|jdd�}|jD]}|�|j�q|Sr)r�r�r})rZoptionsr�rrr�_get_all_optionss
zOptionParser._get_all_optionscCs`|jst|j�S|j��}|��D]4}|�|j�}t|t�r"|�	�}|�
||�||j<q"t|�Sr)r)rro�copyr:rprqr�r)r�r�)rror+r�r/rrr�get_default_valuess


zOptionParser.get_default_valuescOszt|dt�r t|f|�|�}nJt|�dkrb|sb|d}t|t�sNtd|��|j|k	rjtd��ntd��|j�|�|S)Nrr znot an OptionGroup instance: %rz"invalid OptionGroup (wrong parser)r)	r�r)rr{r�r9r?r�r|)rr�r�r�rrr�add_option_group+s


zOptionParser.add_option_groupcCs0|j�|�p|j�|�}|r,|j|k	r,|jSdSr)rrprr)rr/r+rrr�get_option_group;s
�zOptionParser.get_option_groupcCs&|dkrtjdd�S|dd�SdSr)r��argv)rr�rrr�	_get_argsEszOptionParser._get_argsc
Cs�|�|�}|dkr|��}||_g|_}||_z|�|||�}Wn4ttfk
rv}z|�t	|��W5d}~XYnX||}|�
||�S)aR
        parse_args(args : [string] = sys.argv[1:],
                   values : Values = None)
        -> (values : Values, args : [string])

        Parse the command-line options found in 'args' (default:
        sys.argv[1:]).  Any errors result in a call to 'error()', which
        by default prints the usage message to stderr and calls
        sys.exit() with an error message.  On success returns a pair
        (values, args) where 'values' is a Values instance (with all
        your option values) and 'args' is the list of arguments left
        over after parsing options.
        N)r@r<r1r2r��
_process_argsrrrr)�check_values)rr�r�r1r2�stop�errrrr�
parse_argsKs

 zOptionParser.parse_argscCs||fS)a�
        check_values(values : Values, args : [string])
        -> (values : Values, args : [string])

        Check that the supplied option values and leftover arguments are
        valid.  Returns the option values and leftover arguments
        (possibly adjusted, possibly completely new -- whatever you
        like).  Default implementation just returns the passed-in
        values; subclasses may override as desired.
        r)rr�r�rrrrBrszOptionParser.check_valuescCs�|r�|d}|dkr|d=dS|dd�dkr<|�||�q|dd�dkrft|�dkrf|�||�q|jr~|�|�|d=qdSqdS)a�_process_args(largs : [string],
                         rargs : [string],
                         values : Values)

        Process command-line arguments and populate 'values', consuming
        options and arguments from 'rargs'.  If 'allow_interspersed_args' is
        false, stop at the first non-option argument.  If true, accumulate any
        interspersed non-option arguments in 'largs'.
        rr�Nr7r r�)�_process_long_optr{�_process_short_optsr(r|)rr2r1r��argrrrrAs

zOptionParser._process_argscCst||j�S)a_match_long_opt(opt : string) -> string

        Determine which long option string 'opt' matches, ie. which one
        it is an unambiguous abbreviation for.  Raises BadOptionError if
        'opt' doesn't unambiguously match any long option string.
        )�
_match_abbrevr)rr�rrr�_match_long_opt�szOptionParser._match_long_optc
Cs�|�d�}d|kr4|�dd�\}}|�d|�d}n|}d}|�|�}|j|}|��r�|j}t|�|kr�|�t	dd|�||d��q�|dkr�|�d�}	q�t
|d|��}	|d|�=n|r�|�td	�|�nd}	|�||	||�dS)
NrrUr TF�.%(option)s option requires %(number)d argument�/%(option)s option requires %(number)d arguments�r+Znumberz%s option does not take a value)
�popr��insertrJrr�r�r{rrr�r1r�)
rr1r�rHr�Znext_argZhad_explicit_valuer+r�r�rrrrF�s6


��zOptionParser._process_long_optcCs�|�d�}d}d}|dd�D]�}d|}|j�|�}|d7}|sJt|��|��r�|t|�krv|�d||d��d}|j}	t|�|	kr�|�t	dd|	�||	d��q�|	dkr�|�d�}
q�t
|d|	��}
|d|	�=nd}
|�||
||�|rq�qdS)	NrFr r�TrKrLrM)rNrrprr�r{rOr�rrr�r�)rr1r�rHrC�iZchr�r+r�r�rrrrG�s<
��z OptionParser._process_short_optscCs&|jdkrtj�tjd�S|jSdSr�)r'r<�path�basenamer�r?rrrr�
get_prog_names
zOptionParser.get_prog_namecCs|�d|���S)Nz%prog)rtrS)r�srrr�expand_prog_nameszOptionParser.expand_prog_namecCs|�|j�Sr)rUrjrrrrrszOptionParser.get_descriptionrcCs|rtj�|�t�|�dSr)r��stderr�writer�)rZstatusr#rrrr�szOptionParser.exitcCs(|�tj�|�dd|��|f�dS)z�error(msg : string)

        Print a usage message incorporating 'msg' to stderr and exit.
        If you override this in a subclass, it should not return -- it
        should either exit or raise an exception.
        r7z%s: error: %s
N)�print_usager�rVr�rSr$rrrrszOptionParser.errorcCs"|jr|j�|�|j��SdSdSr)r^rr_rUrrrr�	get_usage#s

�zOptionParser.get_usagecCs|jrt|��|d�dS)aaprint_usage(file : file = stdout)

        Print the usage message for the current program (self.usage) to
        'file' (default stdout).  Any occurrence of the string "%prog" in
        self.usage is replaced with the name of the current program
        (basename of sys.argv[0]).  Does nothing if self.usage is empty
        or not defined.
        ��fileN)r^�printrY�rr[rrrrX*s	zOptionParser.print_usagecCs|jr|�|j�SdSdSr)r�rUrrrr�get_version6szOptionParser.get_versioncCs|jrt|��|d�dS)aEprint_version(file : file = stdout)

        Print the version message for this program (self.version) to
        'file' (default stdout).  As with print_usage(), any occurrence
        of "%prog" in self.version is replaced by the current program's
        name.  Does nothing if self.version is empty or undefined.
        rZN)r�r\r^r]rrrr�<szOptionParser.print_versioncCs�|dkr|j}|�|�g}|�|�td���|��|jrZ|�t�||��|�d�|j	D]}|�|�
|��|�d�q`|��d�|dd��S)NZOptionsrgrPrz)
rr�r|rar1rXr�rrr�r"rYr5)rrr~r�rrrrGs


zOptionParser.format_option_helpcCs|�|j�Sr)rmrlr rrrrmXszOptionParser.format_epilogcCsn|dkr|j}g}|jr*|�|��d�|jrD|�|�|�d�|�|�|��|�|�|��d�|�Srf)	rr^r|rYrjrkrrmr5r!rrrr"[szOptionParser.format_helpcCs |dkrtj}|�|���dS)z�print_help(file : file = stdout)

        Print an extended help message, listing all options and any
        help text provided with them, to 'file' (default stdout).
        N)r��stdoutrWr"r]rrrr�gszOptionParser.print_help)T)NN)rN)N)N)N)N)N)+rr'r(r-r0rr%rrr.r/r*r+r&r5r6r7r8r9r:r<r=r>r@rErBrArJrFrGrSrUrr�rrYrXr^r�rrmr"r�rrrrrRsbD�
"

	

'
3	$)





csZ�|kr�S�fdd�|��D�}t|�dkr6|dS|sDt���n|��t�|��dS)z�_match_abbrev(s : string, wordmap : {string : Option}) -> string

    Return the string key in 'wordmap' for which 's' is an unambiguous
    abbreviation.  If 's' is found to be ambiguous or doesn't match any of
    'words', raise BadOptionError.
    csg|]}|���r|�qSr)r)rwZword�rTrrry�s
�z!_match_abbrev.<locals>.<listcomp>r rN)r�r{r�sortr2)rTZwordmapr3rr`rrIts
rI)'r-�__version__�__all__Z
__copyright__r�r<rcrrr�ImportErrorr1�	Exceptionrr
rrrr2r	r
rr�r�r�r�r�r�rrrrrrrrrrrIrrrrr�<module>s�� 


P




�uA=&__pycache__/shlex.cpython-38.pyc000064400000016562151153537550012553 0ustar00U

e5d
4�	@s�dZddlZddlZddlZddlmZddlmZddddgZGd	d�d�Z	ddd�Z
d
d�Ze�dej
�jZdd�Zdd�Zedkr�eej�dkr�ee	��n,ejdZee��Zee	ee��W5QRXdS)�8A lexical analyzer class for simple shell-like syntaxes.�N)�deque)�StringIO�shlex�split�quote�joinc@sreZdZdZddd�Zedd��Zdd	�Zdd
d�Zdd
�Z	dd�Z
dd�Zdd�Zddd�Z
dd�Zdd�ZdS)rrNFcCst|t�rt|�}|dk	r(||_||_ntj|_d|_||_|rHd|_nd|_d|_	d|_
|jrn|j
d7_
d|_d|_d|_
d|_d	|_d
|_t�|_d|_d|_d|_t�|_d|_|s�d}n|d
kr�d}||_|�rt�|_|j
d7_
|j
�t�|��}|j
�|�|_
dS)N��#Z?abcdfeghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_u|ßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞz 	
Fz'"�\�"� �rTz();<>|&z~-./*?=)�
isinstance�strr�instream�infile�sys�stdin�posix�eof�
commenters�	wordchars�
whitespace�whitespace_split�quotes�escape�
escapedquotes�stater�pushback�lineno�debug�token�	filestack�source�_punctuation_chars�_pushback_chars�	maketrans�dict�fromkeys�	translate)�selfrrr�punctuation_chars�t�r.�/usr/lib64/python3.8/shlex.py�__init__sJ
zshlex.__init__cCs|jS�N)r%�r+r.r.r/r,Dszshlex.punctuation_charscCs*|jdkrtdt|��|j�|�dS)z:Push a token onto the stack popped by the get_token methodrzshlex: pushing token N)r!�print�reprr�
appendleft)r+�tokr.r.r/�
push_tokenHs
zshlex.push_tokencCspt|t�rt|�}|j�|j|j|jf�||_||_d|_|jrl|dk	r\t	d|jf�nt	d|jf�dS)z9Push an input source onto the lexer's input source stack.rNzshlex: pushing to file %szshlex: pushing to stream %s)
rrrr#r5rrr r!r3)r+�	newstream�newfiler.r.r/�push_sourceNs
zshlex.push_sourcecCsD|j��|j��\|_|_|_|jr:td|j|jf�d|_dS)zPop the input source stack.zshlex: popping to %s, line %dr
N)	r�closer#�popleftrr r!r3rr2r.r.r/�
pop_source\s

�zshlex.pop_sourcecCs�|jr.|j��}|jdkr*tdt|��|S|��}|jdk	rz||jkrz|�|���}|rp|\}}|�||�|�	�}q@||j
kr�|js�|j
S|��|�	�}qz|jdkr�||j
kr�tdt|��ntd�|S)zBGet a token from the input stream (or from stack if it's nonempty)rzshlex: popping token Nz
shlex: token=zshlex: token=EOF)
rr<r!r3r4�
read_tokenr$�
sourcehookr:�	get_tokenrr#r=)r+r6�raw�specr9r8r.r.r/r@es.








zshlex.get_tokencCs�d}d}|jr |jr |j��}n|j�d�}|dkrB|jd7_|jdkr^td|j|f�|jdkrtd|_	�q�q|jdk�r�|s�d|_�q��q�||j
kr�|jdkr�td	�|j	s�|jr|r�q�nqn�||jkr�|j�
�|jd7_n�|j�r||jk�rd
}||_n�||jk�r&||_	d
|_nr||jk�r@||_	d|_nX||jk�rb|j�sZ||_	||_n6|j�rx||_	d
|_n ||_	|j	�s�|jr|r�q�nqq|j|jk�rDd}|�s�|jdk�r�td
�td��||jk�r|j�s�|j	|7_	d|_�q�nd
|_n>|j�r4||jk�r4|j|jk�r4|j}||_n|j	|7_	q|j|jk�r�|�st|jdk�rltd�td��||jk�r�||jk�r�||k�r�|j	|j7_	|j	|7_	||_q|jdkr|�s�d|_�q�q||j
k�r|jdk�r�td�d|_|j	�s�|jr|r�q�nqq||jk�rh|j�
�|jd7_|j�r�d|_|j	�s�|jr|r�q�nqq|jdk�r�||jk�r�|j	|7_	n"||j
k�r�|j�|�d|_�q�q|j�r�||jk�r�||_q|j�r�||jk�r�d
}||_q||jk�s||jk�s|j�r,||jk�r,|j	|7_	q|j�rB|j�|�n|j�|�|jdk�rbtd�d|_|j	�s�|jr|r�q�qqq|j	}d|_	|j�r�|�s�|dk�r�d}|jdk�r�|�r�tdt|��ntd�|S)NFr
r�
�z&shlex: in state %r I see character: %rr	�z+shlex: I see whitespace in whitespace state�a�cTz shlex: I see EOF in quotes statezNo closing quotationz shlex: I see EOF in escape statezNo escaped character)rFrGz%shlex: I see whitespace in word statez&shlex: I see punctuation in word statezshlex: raw token=zshlex: raw token=EOF)r,r&�popr�readr r!r3rr"rrr�readlinerrrr�
ValueErrorr�appendrr5r4)r+ZquotedZescapedstateZnextchar�resultr.r.r/r>�s

�




���

��zshlex.read_tokencCsV|ddkr|dd�}t|jt�rHtj�|�sHtj�tj�|j�|�}|t|d�fS)z(Hook called on a filename to be sourced.rrr����r)	rrr�os�path�isabsr�dirname�open)r+r9r.r.r/r?s
zshlex.sourcehookcCs(|dkr|j}|dkr|j}d||fS)z<Emit a C-compiler-like, Emacs-friendly error-message leader.Nz"%s", line %d: )rr )r+rr r.r.r/�error_leader s
zshlex.error_leadercCs|Sr1r.r2r.r.r/�__iter__(szshlex.__iter__cCs|��}||jkrt�|Sr1)r@r�
StopIteration)r+r"r.r.r/�__next__+s
zshlex.__next__)NNFF)N)NN)�__name__�
__module__�__qualname__�__doc__r0�propertyr,r7r:r=r@r>r?rUrVrXr.r.r.r/rs �
/

	 	
FTcCs$t||d�}d|_|sd|_t|�S)z-Split the string *s* using shell-like syntax.)rTr	)rrr�list)�sZcommentsrZlexr.r.r/r1s
cCsd�dd�|D��S)z3Return a shell-escaped string from *split_command*.r
css|]}t|�VqdSr1)r)�.0�argr.r.r/�	<genexpr><szjoin.<locals>.<genexpr>)r)Z
split_commandr.r.r/r:sz[^\w@%+=:,./-]cCs,|sdSt|�dkr|Sd|�dd�dS)z1Return a shell-escaped version of the string *s*.z''N�'z'"'"')�_find_unsafe�replace)r_r.r.r/rAs
cCs$|��}|sq tdt|��qdS)NzToken: )r@r3r4)ZlexerZttr.r.r/�
_print_tokensMsrf�__main__r)FT)r\rP�rer�collectionsr�ior�__all__rrr�compile�ASCII�searchrdrrfrY�len�argv�fnrT�fr.r.r.r/�<module>s(	 
	

__pycache__/mailbox.cpython-38.pyc000064400000165552151153537550013067 0ustar00U

e5dE3�@sRdZddlZddlZddlZddlZddlZddlZddlZddlZddl	Zddl
ZddlZddlZzddl
Z
Wnek
r�dZ
YnXddddddd	d
ddd
ddddddgZej�d�ZGdd�d�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd	�d	ejj�ZGd d
�d
e�ZGd!d"�d"e�ZGd#d�de�ZGd$d�de�ZGd%d
�d
e�Z Gd&d�de�Z!Gd'd(�d(�Z"Gd)d*�d*e"�Z#d=d,d-�Z$d.d/�Z%d0d1�Z&d2d3�Z'd4d5�Z(d6d7�Z)Gd8d�de*�Z+Gd9d�de+�Z,Gd:d�de+�Z-Gd;d�de+�Z.Gd<d�de+�Z/dS)>zDRead/write support for Maildir, mbox, MH, Babyl, and MMDF mailboxes.�N�Mailbox�Maildir�mbox�MH�Babyl�MMDF�Message�MaildirMessage�mboxMessage�	MHMessage�BabylMessage�MMDFMessage�Error�NoSuchMailboxError�
NotEmptyError�ExternalClashError�FormatError�asciic@seZdZdZdCdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dDdd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�ZdEd0d1�Zd2d3�ZdFd4d5�Zd6d7�Zd8d9�Zd:d;�Zd<d=�Z d>d?�Z!d@Z"dGdAdB�Z#dS)Hrz*A group of messages in a particular place.NTcCs tj�tj�|��|_||_dS)zInitialize a Mailbox instance.N)�os�path�abspath�
expanduser�_path�_factory��selfr�factory�create�r�/usr/lib64/python3.8/mailbox.py�__init__$szMailbox.__init__cCstd��dS)�$Add message and return assigned key.�&Method must be implemented by subclassN��NotImplementedError�r�messagerrr�add)szMailbox.addcCstd��dS)�=Remove the keyed message; raise KeyError if it doesn't exist.r"Nr#�r�keyrrr�remove-szMailbox.removecCs|�|�dS�N)r+r)rrr�__delitem__1szMailbox.__delitem__cCs(z|�|�Wntk
r"YnXdS�z'If the keyed message exists, remove it.N)r+�KeyErrorr)rrr�discard4szMailbox.discardcCstd��dS)�>Replace the keyed message; raise KeyError if it doesn't exist.r"Nr#�rr*r&rrr�__setitem__;szMailbox.__setitem__cCs*z|�|�WStk
r$|YSXdS)z9Return the keyed message, or default if it doesn't exist.N)�__getitem__r/)rr*�defaultrrr�get?szMailbox.getc
CsB|js|�|�St�|�|���}|�|�W5QR�SQRXdS)z=Return the keyed message; raise KeyError if it doesn't exist.N)r�get_message�
contextlib�closing�get_file)rr*�filerrrr4Fs
zMailbox.__getitem__cCstd��dS)�4Return a Message representation or raise a KeyError.r"Nr#r)rrrr7NszMailbox.get_messagecCst�|�|����S)z�Return a string representation or raise a KeyError.

        Uses email.message.Message to create a 7bit clean string
        representation of the message.��email�message_from_bytes�	get_bytesZ	as_stringr)rrr�
get_stringRszMailbox.get_stringcCstd��dS)z8Return a byte string representation or raise a KeyError.r"Nr#r)rrrr@YszMailbox.get_bytescCstd��dS)�6Return a file-like representation or raise a KeyError.r"Nr#r)rrrr:]szMailbox.get_filecCstd��dS)�Return an iterator over keys.r"Nr#�rrrr�iterkeysaszMailbox.iterkeyscCst|���S)zReturn a list of keys.)�listrErDrrr�keyseszMailbox.keysc	cs>|��D]0}z||}Wntk
r0YqYnX|VqdS)z%Return an iterator over all messages.N�rEr/�rr*�valuerrr�
itervaluesis
zMailbox.itervaluescCs|��Sr,)rKrDrrr�__iter__rszMailbox.__iter__cCst|���S)z,Return a list of messages. Memory intensive.)rFrKrDrrr�valuesuszMailbox.valuesc	csB|��D]4}z||}Wntk
r0YqYnX||fVqdS)z.Return an iterator over (key, message) tuples.NrHrIrrr�	iteritemsys
zMailbox.iteritemscCst|���S)z9Return a list of (key, message) tuples. Memory intensive.)rFrNrDrrr�items�sz
Mailbox.itemscCstd��dS)�9Return True if the keyed message exists, False otherwise.r"Nr#r)rrr�__contains__�szMailbox.__contains__cCstd��dS)�*Return a count of messages in the mailbox.r"Nr#rDrrr�__len__�szMailbox.__len__cCs|��D]}|�|�qdS)zDelete all messages.N)rGr0r)rrr�clear�sz
Mailbox.clearcCs4z||}Wntk
r$|YSX|�|�|S)z3Delete the keyed message and return it, or default.)r/r0)rr*r5�resultrrr�pop�s

zMailbox.popcCs*|��D]}||�|�fStd��dS)z6Delete an arbitrary (key, message) pair and return it.zNo messages in mailboxN)rErVr/r)rrr�popitem�szMailbox.popitemc	Cstt|d�r|��}nt|d�r(|��}n|}d}|D].\}}z|||<Wq4tk
r`d}Yq4Xq4|rptd��dS)z4Change the messages that correspond to certain keys.rNrOFTzNo message with key(s)N)�hasattrrNrOr/)r�arg�sourceZbad_keyr*r&rrr�update�s



zMailbox.updatecCstd��dS)�&Write any pending changes to the disk.r"Nr#rDrrr�flush�sz
Mailbox.flushcCstd��dS)�Lock the mailbox.r"Nr#rDrrr�lock�szMailbox.lockcCstd��dS)�#Unlock the mailbox if it is locked.r"Nr#rDrrr�unlock�szMailbox.unlockcCstd��dS)�Flush and close the mailbox.r"Nr#rDrrr�close�sz
Mailbox.closecCs.z|�d�WStk
r(td��YnXdS)Nrz?String input must be ASCII-only; use bytes or a Message instead)�encode�UnicodeError�
ValueErrorr%rrr�_string_to_bytes�szMailbox._string_to_bytesFc	Cs�t|tjj�rvt��}tj�||d�}|�|�|�	d�|�
�}|�dt�}|�
|�|jrr|�t�sr|�
t��n�t|tttjf��rt|tj�r�t�dtd�|��}t|t�r�|�|�}|r�|�dd�}|�dt�}|�
|�|j�r�|�t��s�|�
t�n�t|d��r�t|d��r2t�d	td�|j}d
}|��}|�d��r\|d
d�d}n|�d
��rx|d
d�d}|�s��q�|�r�|�d��r�d|dd
�}|�dt�}|�
|�|}�q6|j�r�|�r�|�t��s�|�
t�ntdt|���d
S)z%Dump message contents to target file.r�
�8Use of StringIO input is deprecated, use BytesIO instead�s
From s
>From �read�buffer�DUse of text mode files is deprecated, use a binary mode file insteadN�
����
����From s>From ��Invalid message type: %s)�
isinstancer>r&r�io�BytesIO�	generator�BytesGenerator�flatten�seekrk�replace�linesep�write�_append_newline�endswith�str�bytes�StringIO�warnings�warn�DeprecationWarning�getvaluergrXrl�readline�
startswith�	TypeError�type)	rr&�targetZmangle_from_rl�gen�dataZlastline�linerrr�
_dump_message�s`


�


�
zMailbox._dump_message)NT)N)N)N)F)$�__name__�
__module__�__qualname__�__doc__r r'r+r-r0r3r6r4r7rAr@r:rErGrKrLrMrNrOrQrSrTrVrWr[r]r_rarcrgrr�rrrrr!sB

		
	
c@s�eZdZdZdZd6dd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-Zd.d/�Zd0d1�Zd2d3�Zd4d5�ZdS)7rzA qmail-style Maildir mailbox.�:NTcCs�t�||||�tj�|jd�tj�|jd�tj�|jd�d�|_tj�|j�s�|r�t�|jd�|j�	�D]}t�|d�qln
t
|j��i|_ddd�|_d|_
d|_d	S)
zInitialize a Maildir instance.�tmp�new�cur)r�r�r��r)r�r�g�������?N)rr rr�joinr�_paths�exists�mkdirrMr�_toc�_toc_mtimes�
_last_read�_skewfactor)r�dirnamerrrrrrr 
s�
zMaildir.__init__c
Cs~|��}z|�||�Wn*tk
rB|��t�|j��YnXt|�t|t	�r||�
�}|j|��}||jkr�d}nd}d}tj
�|j��|j�d}tj
�|j|||�}t|t	�r�t�|jtj
�|j�|��f�zLzt�|j|�Wn(ttfk
�rt�|j|�YnXt�|j�WnNtk
�rx}z.t�|j�|jtjk�rftd|��n�W5d}~XYnX|S)r!�r�rz$Name clash with existing message: %sN)�_create_tmpr��
BaseExceptionrcrr+�name�_sync_closerur	�
get_subdir�colon�get_infor�basename�splitr�r�utime�getatime�get_date�link�AttributeError�PermissionError�rename�OSError�errnoZEEXISTr)rr&Ztmp_file�subdir�suffix�uniq�dest�errrr'!sF


��zMaildir.addcCs t�tj�|j|�|���dS�r(N)rr+rr�r�_lookupr)rrrr+KszMaildir.removec	Cs,z|�|�Wnttfk
r&YnXdSr.)r+r/�FileNotFoundErrorr)rrrr0OszMaildir.discardcCs�|�|�}|�|�}|�|�}t|t�r.|}n|}tj�|�}|j|kr`|j|�|j�d}nd}|�	|�tj�
|j|�}	tj�
|j|||�}
t|t�r�t�|	tj�
|	�|��f�t�|	|
�dS)r1rqr�N)r�r'rur	rrr�r�r�r0r�rr�r�r�r�)rr*r&Zold_subpathZtemp_keyZtemp_subpathZdominant_subpathr�r�Ztmp_path�new_pathrrrr3Ws$






�zMaildir.__setitem__c	Cs�|�|�}ttj�|j|�d�� }|jr4|�|�}nt|�}W5QRXtj�|�\}}|�	|�|j
|kr�|�|�|j
�d�|�tj�
tj�|j|���|S)r<�rbrq)r��openrrr�rrr	r��
set_subdirr��set_info�set_date�getmtime)rr*Zsubpath�f�msgr�r�rrrr7rs


zMaildir.get_messagec
CsDttj�|j|�|��d��}|���td�W5QR�SQRXdS)�2Return a bytes representation or raise a KeyError.r�rhN)	r�rrr�rr�rkr|r}�rr*r�rrrr@�szMaildir.get_bytescCs$ttj�|j|�|��d�}t|�S)rBr�)r�rrr�rr��
_ProxyFiler�rrrr:�szMaildir.get_filec	csF|��|jD]2}z|�|�Wntk
r8YqYnX|VqdS�rCN)�_refreshr�r�r/r)rrrrE�s

zMaildir.iterkeyscCs|��||jkS�rP)r�r�r)rrrrQ�szMaildir.__contains__cCs|��t|j�S�rR)r��lenr�rDrrrrS�szMaildir.__len__cCsdS)�"Write any pending changes to disk.NrrDrrrr]�sz
Maildir.flushcCsdS)r^NrrDrrrr_�szMaildir.lockcCsdS)r`NrrDrrrra�szMaildir.unlockcCsdS�rbNrrDrrrrc�sz
Maildir.closecCs\g}t�|j�D]F}t|�dkr|ddkrtj�tj�|j|��r|�|dd��q|S)�Return a list of folder names.�r�.N)r�listdirrr�r�isdirr��append�rrU�entryrrr�list_folders�s�zMaildir.list_folderscCs ttj�|jd|�|jdd�S)z/Return a Maildir instance for the named folder.r�F�rr)rrrr�rr�r�folderrrr�
get_folder�s�zMaildir.get_foldercCs\tj�|jd|�}t||jd�}tj�|d�}tj�|�sXt�t�|tj	tj
Bd��|S)z>Create a folder and return a Maildir instance representing it.r��rZ
maildirfolder�)rrr�rrrr�rcr��O_CREAT�O_WRONLY)rr�rrUZmaildirfolder_pathrrr�
add_folder�s�zMaildir.add_foldercCstj�|jd|�}t�tj�|d��t�tj�|d��D](}t|�dksX|ddkr<td|��q<t�|�D]B}|dkrp|dkrp|dkrptj�tj�||��rptd||f��qptj|d	d
�D]F\}}}|D]}t�	tj�||��q�|D]}t�
tj�||��q�q�t�
|�dS)�-Delete the named folder, which must be empty.r�r�r�r�rzFolder contains message(s): %sr�z%Folder contains subdirectory '%s': %sF)�topdownN)rrr�rr�r�rr��walkr+�rmdir)rr�rr��root�dirs�filesrrr�
remove_folder�s&���zMaildir.remove_foldercCsXt��}t�tj�|jd��D]4}tj�|jd|�}|tj�|�dkrt�|�qdS)zDelete old files in "tmp".r�i@�N)�timerr�rr�rr�r+)r�nowr�rrrr�clean�s
z
Maildir.cleanr�cCs�t��}t��}d|kr$|�dd�}d|kr8|�dd�}dt|�t|dd�t��tj|f}tj	�
|jd|�}zt�|�WnFt
k
r�tjd7_zt|�WYStk
r�YnXYnXtd	|��d
S)z=Create a file in the tmp subdirectory and open and return it.�/z\057r�z\072z%s.M%sP%sQ%s.%sr�g��.Ar�z&Name clash prevented file creation: %sN)r��socket�gethostnamer|�intr�getpidr�_countrr�r�statr��_create_carefully�FileExistsErrorr)rr�Zhostnamer�rrrrr��s,��zMaildir._create_tmpcCs�t��|jd|jkr^d}|jD]2}tj�|j|�}||j|krJd}||j|<q"|s^dSi|_|jD]^}|j|}t�	|�D]D}tj�
||�}tj�|�r�q�|�|j
�d}tj�
||�|j|<q�qjt��|_dS)z!Update table of contents mapping.�FTNr)r�r�r�r�rrr�r�r�r�r�r�r�r�)rZrefreshr��mtimerr��pr�rrrr��s&


zMaildir._refreshcCs�z.tj�tj�|j|j|��r,|j|WSWntk
rBYnX|��z|j|WStk
rztd|�d�YnXdS)z=Use TOC to return subpath for given key, or raise a KeyError.�No message with key: %sN)rrr�r�rr�r/r�r)rrrr�#szMaildir._lookupcCsXt|d�s|��|_z|t|j�WStk
r:YdStk
rPYqYqXqdS)z0Return the next message in a one-time iteration.�
_onetime_keysN)rXrEr��next�
StopIterationr/rDrrrr�1s

zMaildir.next)NT)r�r�r�r�r�r r'r+r0r3r7r@r:rErQrSr]r_rarcr�r�r�r�r�r�r�r�r�r�rrrrrs6
*
	
$c@s�eZdZdZd$dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd%d d!�Zd"d#�ZdS)&�_singlefileMailboxzA single-file mailbox.NTc
Cs�t�||||�zt|jd�}Wnntk
r�}zP|jtjkr\|rPt|jd�}q~t|j��n"|jtjtj	fkr|t|jd�}n�W5d}~XYnX||_
d|_d|_d|_
d|_d|_d|_dS)z!Initialize a single-file mailbox.�rb+zwb+r�NrF)rr r�rr�r��ENOENTr�EACCES�EROFS�_filer��	_next_key�_pending�
_pending_sync�_locked�_file_length)rrrrr�r�rrrr As$z_singlefileMailbox.__init__cCs8|��|�|�|j|j<|jd7_d|_|jdS)r!r�T)r��_append_messager�rrr%rrrr'Xs
z_singlefileMailbox.addcCs|�|�|j|=d|_dS)r(TN)r�r�rr)rrrr+bs
z_singlefileMailbox.removecCs$|�|�|�|�|j|<d|_dS)r1TN)r�r	r�rr2rrrr3hs
z_singlefileMailbox.__setitem__ccs|��|j��EdHdSr�)r�r�rGrDrrrrEnsz_singlefileMailbox.iterkeyscCs|��||jkSr�)r�r�r)rrrrQssz_singlefileMailbox.__contains__cCs|��t|j�Sr�)r�r�r�rDrrrrSxsz_singlefileMailbox.__len__cCs|jst|j�d|_dS)r^TN)r�
_lock_filerrDrrrr_}s
z_singlefileMailbox.lockcCs|jrt|j�d|_dS�r`FN)r�_unlock_filerrDrrrra�s
z_singlefileMailbox.unlockc
Cs�|js |jrt|j�d|_dS|jdk	s.t�|j�dd�|j��}||jkrbt	d|j|f��t
|j�}z�i}|�|�t
|j���D]x}|j|\}}|j�|�|�|�|��}|j�td||j����}|s�q�|�|�q�||��f||<|�|�q�|��|_Wn"|��t�|j��YnXt|�|j��t�|j�j}	t�|j|	�zt�|j|j�Wn2tk
�r�t�|j�t�|j|j�YnXt|jd�|_||_d|_d|_|j�r�t |jdd�dS)	r�FNrr�z4Size of mailbox file changed (expected %i, found %i)�r�)�dotlock)!rr�_sync_flushrr��AssertionErrorr{�tellrr�_create_temporaryr�_pre_mailbox_hook�sortedrG�_pre_message_hookrk�minr~�_post_message_hookrcrr+r�r�r��st_mode�chmodr�r�r�rr
)
rZcur_lenZnew_fileZnew_tocr*�start�stopZ	new_startrl�moderrrr]�sb


�



�
z_singlefileMailbox.flushcCsdS)�,Called before writing the mailbox to file f.Nr�rr�rrrr�sz$_singlefileMailbox._pre_mailbox_hookcCsdS)�-Called before writing each message to file f.Nrrrrrr�sz$_singlefileMailbox._pre_message_hookcCsdS��,Called after writing each message to file f.Nrrrrrr�sz%_singlefileMailbox._post_message_hookcCs4z|��W5z|jr|��W5|j��XXdSr�)rrcrrar]rDrrrrc�sz_singlefileMailbox.closecCsN|jdkr|��|dk	rJz|j|WStk
rHtd|�d�YnXdS)z'Return (start, stop) or raise KeyError.Nr�)r��
_generate_tocr/r)rrrr��s
z_singlefileMailbox._lookupcCs�|j�dd�|j��}t|j�dkr8|js8|�|j�z&|�|j�|�|�}|�	|j�Wn"t
k
r�|j�|��YnX|j��|j��|_
|S)z;Append message to mailbox and return (start, stop) offsets.rr�)rr{rr�r�rrr�_install_messagerr��truncater]r)rr&ZbeforeZoffsetsrrrr	�s


z"_singlefileMailbox._append_message)NT)N)r�r�r�r�r r'r+r3rErQrSr_rar]rrrrcr�r	rrrrr�>s"

@

r�c@sBeZdZdZdZdd�Zddd�Zddd	�Zdd
d�Zdd
�Z	dS)�	_mboxMMDFzAn mbox or MMDF mailbox.TcCsp|�|�\}}|j�|�|j���td�}|j�||j���}|�|�td��}|�	|dd��
d��|S)r<�rhrsNr)r�rr{r�r|r}rkr�_message_factory�set_from�decode)rr*rr�	from_line�stringr�rrrr7sz_mboxMMDF.get_messageFcCst�|�||��j|d�S)�3Return a string representation or raise a KeyError.)�unixfromr=)rr*�from_rrrrAs

��z_mboxMMDF.get_stringcCsJ|�|�\}}|j�|�|s(|j��|j�||j���}|�td�S)r,rh)r�rr{r�rkrr|r})rr*r.rrr+rrrr@s
z_mboxMMDF.get_bytescCs<|�|�\}}|j�|�|s(|j��t|j|j��|�S)rB)r�rr{r��_PartialFiler)rr*r.rrrrrr:s

z_mboxMMDF.get_filecCsd}t|t�r|�|�}t|t�rf|�d�rf|�d�}|dkr\|d|�}||dd�}q�|}d}nJt|t�r�|���d�}d|}n(t|t	j
j�r�|��}|dk	r�|�d�}|dkr�dt
�t
�����}|j��}|j�|t�|�||j|j�|j��}||fS)	z1Format a message and blindly write to self._file.Nrrrhrqr�r&rsFrom MAILER-DAEMON )rur�rgr�r��find�_mboxMMDFMessage�get_fromrdr>r&r�get_unixfromr��asctime�gmtimerrr~r}r��
_mangle_from_)rr&r*�newlineZauthorrrrrrr#&s0







z_mboxMMDF._install_messageN)F)F)F)
r�r�r�r�r6r7rAr@r:r#rrrrr%s


	
r%c@s2eZdZdZdZdZd
dd�Zdd�Zdd	�ZdS)rzA classic mbox mailbox.TNcCst|_t�||||�dS)zInitialize an mbox mailbox.N)r
r'r%r rrrrr Lsz
mbox.__init__cCs|�t�dSr �r~r}rrrrrQszmbox._post_message_hookcCs�gg}}d}|j�d�|j��}|j��}|�d�rzt|�t|�krj|r`|�|tt��n
|�|�|�|�d}q|s�|r�|�|tt��q�|�|�q�q|tkr�d}qd}qtt	t
||���|_t|j�|_|j��|_
dS)�0Generate key-to-(start, stop) table of contents.FrrrTN)rr{rr�r�r�r�r}�dict�	enumerate�zipr�rr)r�starts�stopsZlast_was_empty�line_posr�rrrr"Us.






zmbox._generate_toc)NT)	r�r�r�r�r6rr rr"rrrrrCs
c@s2eZdZdZddd�Zdd�Zdd	�Zd
d�ZdS)
rzAn MMDF mailbox.NTcCst|_t�||||�dS)zInitialize an MMDF mailbox.N)r
r'r%r rrrrr zsz
MMDF.__init__cCs|�dt�dS)r�Nr8rrrrrszMMDF._pre_message_hookcCs|�tdt�dS)r!r@Nr8rrrrr�szMMDF._post_message_hookcCs�gg}}|j�d�d}|}|j��}|j��}|�dt�r�|�|�|}|j��}|j��}|dtkr�|�|tt��q�qJ|sJ|�|�q�qJq|sq�qtt	t
||���|_t|j�|_|j�dd�|j��|_
dS)r9rr@r�N)rr{r�rr�r}r�r�r:r;r<r�rr)rr=r>�next_posr?r�rrrr"�s.






zMMDF._generate_toc)NT)r�r�r�r�r rrr"rrrrrws

c@s�eZdZdZd0dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�ZdS)1rzAn MH mailbox.NTcCstt�||||�tj�|j�sj|r`t�|jd�t�t�tj�	|jd�tj
tjBtjBd��n
t
|j��d|_dS)zInitialize an MH instance.r��
.mh_sequencesi�FN)rr rrr�rr�rcr�r�r��O_EXCLr�rrrrrrr �s�
zMH.__init__cCs�|��}t|�dkrd}nt|�d}tj�|jt|��}t|�}d}z�|j
rVt|�zfz|�
||�Wn:tk
r�|j
r�t|�t	|�d}t�|��YnXt|t�r�|�||�W5|j
r�t|�XW5|s�t	|�X|S)r!rr�FT)rGr��maxrrr�rr�r�r�rr
rr�r�r+rur�_dump_sequences)rr&rGZnew_keyr�r��closedrrrr'�s6


zMH.addc
Csxtj�|jt|��}zt|d�}Wn>tk
r`}z |jtjkrNt	d|��n�W5d}~XYnX|�
�t�|�dS)r(r�r�N)rrr�rr�r�r�r�rr/rcr+)rr*rr�r�rrrr+�sz	MH.removec
Cs�tj�|jt|��}zt|d�}Wn>tk
r`}z |jtjkrNt	d|��n�W5d}~XYnXzd|jrrt|�z@t�t�|tjtjB��|�||�t|t�r�|�||�W5|jr�t
|�XW5t
|�XdS)r1r�r�N)rrr�rr�r�r�r�rr/r�rr
rrcr��O_TRUNCr�rurrE)rr*r&rr�r�rrrr3�s$
zMH.__setitem__c
Cs�z@|jr$ttj�|jt|��d�}nttj�|jt|��d�}Wn>tk
r~}z |jtj	krlt
d|��n�W5d}~XYnX|�2|jr�t|�zt
|�}W5|jr�t|�XW5QRX|����D]\}}||kr�|�|�q�|S)r<r�r�r�N)rr�rrr�rr�r�r�rr/r
rr�
get_sequencesrO�add_sequence)rr*r�r�r�r��key_listrrrr7�s&zMH.get_messagec
Cs�z@|jr$ttj�|jt|��d�}nttj�|jt|��d�}Wn>tk
r~}z |jtj	krlt
d|��n�W5d}~XYnX|�F|jr�t|�z |�
��td�W�W5QR�S|jr�t|�XW5QRXdS)r�r�r�r�Nrh)rr�rrr�rr�r�r�rr/r
rrkr|r}�rr*r�r�rrrr@s zMH.get_bytesc
Csfzttj�|jt|��d�}Wn>tk
r\}z |jtjkrJt	d|��n�W5d}~XYnXt
|�S)rBr�r�N)r�rrr�rr�r�r�rr/r�rKrrrr:)szMH.get_filecCsttdd�t�|j�D���S)rCcss|]}|��rt|�VqdSr,)�isdigitr�)�.0r�rrr�	<genexpr>6s�zMH.iterkeys.<locals>.<genexpr>)�iterrrr�rrDrrrrE4szMH.iterkeyscCstj�tj�|jt|���Sr�)rrr�r�rr�r)rrrrQ9szMH.__contains__cCstt|����Sr�)r�rFrErDrrrrS=sz
MH.__len__cCs2|js.ttj�|jd�d�|_t|j�d|_dS)r^rBr�TN)rr�rrr�rrr
rDrrrr_As
zMH.lockcCs(|jr$t|j�t|j�|`d|_dSr)rrrr�rDrrrraHs


z	MH.unlockcCsdS)r\NrrDrrrr]PszMH.flushcCs|jr|��dSr�)rrarDrrrrcTszMH.closecCs<g}t�|j�D]&}tj�tj�|j|��r|�|�q|S)r�)rr�rrr�r�r�r�rrrr�Ys
zMH.list_folderscCsttj�|j|�|jdd�S)z+Return an MH instance for the named folder.Fr��rrrr�rrr�rrrr�as�z
MH.get_foldercCsttj�|j|�|jd�S)z:Create a folder and return an MH instance representing it.r�rPr�rrrr�fs�z
MH.add_foldercCs`tj�|j|�}t�|�}|dgkr:t�tj�|d��n|gkrDntd|j��t�|�dS)r�rBzFolder not empty: %sN)rrr�rr�r+rr�)rr�r�entriesrrrr�ks

zMH.remove_folderc

si}ttj�|jd�ddd���}t|����|D]�}z�|�d�\}}t�}|��D]H}|��rn|�	t
|��qRdd�|�d�D�\}}	|�t||	d	��qR�fd
d�t
|�D�||<t||�dkr�||=Wq0tk
r�td
|����Yq0Xq0W5QRX|S)z=Return a name-to-key-list dictionary to define each sequence.rB�r�ASCII��encodingr�css|]}t|�VqdSr,)r�)rM�xrrrrN�sz#MH.get_sequences.<locals>.<genexpr>�-r�csg|]}|�kr|�qSrr)rMr*�Zall_keysrr�
<listcomp>�s�z$MH.get_sequences.<locals>.<listcomp>rz"Invalid sequence specification: %s)r�rrr�r�setrGr�rLr'r�r[�rangerr�rfr�rstrip)
rZresultsr�r�r��contentsrG�specrrrrXrrHws(
�zMH.get_sequencescCsttj�|jd�ddd�}z�t�t�|jtjtj	B��|�
�D]�\}}t|�dkrVq@|�|d�d}d}t
t|��D]R}|d	|kr�|s�d
}|�d�n*|r�d}|�d||f�n|�d
|�|}qx|r�|�t|�d�q@|�d�q@W5t|�XdS)z:Set sequences using the given name-to-key-list dictionary.rBzr+rSrTrr�NFr�TrWz%s %sz %s�
)r�rrr�rr�rcr�r�rGrOr�r~rrZr�)r�	sequencesr�r�rG�prevZ
completingr*rrr�
set_sequences�s.zMH.set_sequencesc	
Cs>|��}d}g}|��D]�}|d|kr�|�||df�z4t�tj�|jt|��tj�|jt|d���WnHt	t
fk
r�t�tj�|jt|��tj�|jt|d���YnXt�tj�|jt|���|d7}q|d|_
t|�dkr�dS|��D]0\}}|D]"\}}||k�r
|||�|�<�q
q�|�|�dS)z?Re-name messages to eliminate numbering gaps. Invalidates keys.rr�N)rHrEr�rr�rr�rr�r�r�r��unlinkrr�rO�indexrb)	rr`raZchangesr*r�rJ�oldr�rrr�pack�s0��



zMH.packcCst|��}|��}|��D]0\}}||kr4|�|�q||kr||�|�=q|D]}||krN|g||<qN|�|�dS)z;Inspect a new MHMessage and update sequences appropriately.N)rHrOr�rdrb)rr&r*Zpending_sequencesZ
all_sequencesr�rJ�sequencerrrrE�szMH._dump_sequences)NT)r�r�r�r�r r'r+r3r7r@r:rErQrSr_rar]rcr�r�r�r�rHrbrfrErrrrr�s.
"c@s�eZdZdZedddddddh�Zd%dd�Zd
d�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd �Zd!d"�Zd#d$�Zd	S)&rzAn Rmail-style Babyl mailbox.�unseen�deletedZfiled�answered�	forwardedZedited�resentNTcCst�||||�i|_dS)zInitialize a Babyl mailbox.N)r�r �_labelsrrrrr �szBabyl.__init__cCs(t�||�}t|t�r$|��|j|<|S)r!)r�r'rur�
get_labelsrm)rr&r*rrrr'�s
z	Babyl.addcCs"t�||�||jkr|j|=dSr�)r�r+rmr)rrrr+�s
zBabyl.removecCs*t�|||�t|t�r&|��|j|<dS)r1N)r�r3rurrnrmr2rrrr3�s
zBabyl.__setitem__c
Cs�|�|�\}}|j�|�|j��t��}|j��}|dtks\|sHq\|�|�td��q,t��}|j��}|tks�|s|q�|�|�td��qd||j�	�}|dks�t
�|j�|�}|�td�}t|�
�|�}	|	�|�
��||jkr�|	�|j|�|	S)r<�*** EOOH ***rhr)r�rr{r�rvrwr}r~r|rrrkrr��set_visiblerm�
set_labels)
rr*rr�original_headersr�Zvisible_headers�nZbodyr�rrrr7�s,



zBabyl.get_messagec	Cs�|�|�\}}|j�|�|j��t��}|j��}|dtks\|sHq\|�|�td��q,|j��}|tksv|s\qvq\|�	�}||j�
�}|dks�t�|j�|�}|�td�}||S)r,rorhr)
r�rr{r�rvrwr}r~r|r�rrrk)	rr*rrrrr�Zheadersrsr�rrrr@s"


zBabyl.get_bytescCst�|�|��dt��S)rBrh)rvrwr@r|r}r)rrrr:%szBabyl.get_filecCs<|��t�}|j��D]}|�|�q|�|j�t|�S)z4Return a list of user-defined labels in the mailbox.)r�rZrmrMr[�difference_update�_special_labelsrF)r�labelsZ
label_listrrrrn)szBabyl.get_labelscCs:gg}}|j�d�d}g}|}|j��}|j��}|dtkr�t|�t|�krd|�|tt��|�|�dd�|j��dd��d�D�}|�|�q|dks�|dtkr�t|�t|�kr�|�|tt��q|s|�|tt��q�qtt	t
||���|_tt	|��|_t|j�|_
|j�dd	�|j��|_dS)
r9rscSsg|]}|��r|���qSr)�strip�rM�labelrrrrY@s�z'Babyl._generate_toc.<locals>.<listcomp>r�N�,�r�)rr{r�rr}r�r�r�r:r;r<r�rmrr)rr=r>rAZlabel_listsr?r�rvrrrr"2s4



�zBabyl._generate_toccCsVdt}|dt7}|��}dd�|D�}|dd�|�t7}|d7}|�|�dS)	rsBABYL OPTIONS:s
Version: 5css|]}|��VqdSr,)rdrxrrrrNUsz*Babyl._pre_mailbox_hook.<locals>.<genexpr>sLabels:rzr{N)r}rnr�r~)rr�ZbabylrvrrrrPszBabyl._pre_mailbox_hookcCs|�dt�dS)r�Nr8rrrrrZszBabyl._pre_message_hookcCs|�td�dS)r!r{Nr8rrrrr^szBabyl._post_message_hookcCsx|j��}t|t�r�g}g}|��D]$}||jkr>|�|�q$|�|�q$|j�d�|D]}|j�d|���qZ|j�d�|D]}|j�d|��d�q�|j�t	�n|j�dt	�t|t
jj��rt
��}t
j�|dd�}|�|�|�d�|��}|j�|�d	t	��|d	k�s,|s��q,q�|j�d
t	�t|t��r�t
��}	t
j�|	dd�}
|
�|���|	��}|j�|�d	t	��|d	k�s�|�sn�q�qnn>|�d�|��}|j�|�d	t	��|d	k�s�|�s��q�q�|�d�}|�s��qf|j�|�d	t	���q�nTt|ttt
jf��rt|t
j��rJt�dtd
�|��}t|t��r`|�|�}|�d�d}|ddk�r�|j�|d|��d	t	��|j�d
t	�|j�|d|��d	t	��|j�||d��d	t	��n(|j�d
t	t	�|j�|�d	t	���nXt |d��rVt |d��r:t�dtd
�|j!}|��}
d}|��}|�"d��rl|dd�d	}n|�"d��r�|dd�d	}|j�|�d	t	��|d	k�s�|�sF|�r�d}|j�d
t	�|�|
�n�qڐqF|��}|�s�qf|�"d��r
|dd�t	}n:|�"d��r(|dd�t	}n|�"d	��rD|dd�t	}|j�|��q�nt#dt$|���|j��}||fS)z0Write message contents and return (start, stop).�1s, s,,� rzs1,,Frrhror
rirjs

r�rqNr�rlrmTrnrorprt)%rrrurrnrur�r~rdr}r>r&rrvrwrxryrzr{r�r|�get_visiblerkr�r�r�r�r�r�r�rgr0rXrlr�r�r�)rr&rZspecial_labelsrvryZorig_bufferZorig_generatorr�Z
vis_bufferZ
vis_generatorrlZ
body_startZoriginal_posZ
first_passrrrrr#bs�







�
�
zBabyl._install_message)NT)r�r�r�r��	frozensetrur r'r+r3r7r@r:rnr"rrrr#rrrrr�s&
�
	
c@s*eZdZdZd	dd�Zdd�Zdd�ZdS)
rz0Message with mailbox-format-specific properties.NcCs�t|tjj�r4|�t�|��t|t�r�|�|�n�t|t�rP|�t�	|��n~t|t
�rl|�t�|��nbt|tj
�r�|�t�|��nDt|d�r�|�t�|��n(|dkr�tjj�|�ntdt|���dS)zInitialize a Message instance.rkNrt)rur>r&r�_become_message�copyZdeepcopy�_explain_tor�r?r�Zmessage_from_stringrv�
TextIOWrapperZmessage_from_filerXZmessage_from_binary_filer r�r�r%rrrr �s



zMessage.__init__cCs4t|dg�}|jD]}||kr|j||j|<qdS)z0Assume the non-format-specific state of message.�_type_specific_attributesN)�getattr�__dict__)rr&Z
type_specificr�rrrr��s
zMessage._become_messagecCst|t�rdStd��dS)z:Copy format-specific state to message insofar as possible.Nz Cannot convert to specified type)rurr�r%rrrr��s
zMessage._explain_to)N)r�r�r�r�r r�r�rrrrr�s
c@s|eZdZdZdddgZddd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)r	z)Message with Maildir-specific properties.�_subdir�_info�_dateNcCs&d|_d|_t��|_t�||�dS)z%Initialize a MaildirMessage instance.r�r�N)r�r�r�r�rr r%rrrr �s
zMaildirMessage.__init__cCs|jS)zReturn 'new' or 'cur'.)r�rDrrrr��szMaildirMessage.get_subdircCs(|dks|dkr||_ntd|��dS)zSet subdir to 'new' or 'cur'.r�r�z!subdir must be 'new' or 'cur': %sN)r�rf)rr�rrrr�szMaildirMessage.set_subdircCs"|j�d�r|jdd�SdSdS)�*Return as a string the flags that are set.�2,r�Nr�)r�r�rDrrr�	get_flags
szMaildirMessage.get_flagscCsdd�t|��|_dS)�)Set the given flags and unset all others.r�r�N)r�rr�)r�flagsrrr�	set_flagsszMaildirMessage.set_flagscCs$|�d�t|���t|�B��dS�z.Set the given flag(s) without changing others.r�N�r�r�rZr��r�flagrrr�add_flagszMaildirMessage.add_flagcCs,|��r(|�d�t|���t|���dS)�7Unset the given string flag(s) without changing others.r�N)r�r�r�rZr�rrr�remove_flagszMaildirMessage.remove_flagcCs|jS)z<Return delivery date of message, in seconds since the epoch.)r�rDrrrr�szMaildirMessage.get_datecCs6zt|�|_Wn"tk
r0td|�d�YnXdS)z9Set delivery date of message, in seconds since the epoch.zcan't convert to float: %sN)�floatr�rfr�)r�daterrrr�"szMaildirMessage.set_datecCs|jS)z%Get the message's "info" as a string.)r�rDrrrr�)szMaildirMessage.get_infocCs&t|t�r||_ntdt|���dS)z Set the message's "info" string.zinfo must be a string: %sN)rur�r�r�r�)r�inforrrr�-s
zMaildirMessage.set_infocCs�t|t�r8|�|���|�|���|�|����nht|t�r�t	|���}d|kr`|�
d�|��dkrv|�
d�d|kr�|�
d�d|kr�|�
d�d|kr�|�
d�|�d	t�
|����n�t|t��rt	|���}d|kr�|�d
�d|k�r|�d�d|k�r�|�d�n�t|t��r�t	|���}d|k�rD|�d
�d|k�rX|�d
�d|k�rl|�d�d|k�r�|�d�nt|t��r�ntdt|���dS)z;Copy Maildir-specific state to message insofar as possible.�S�Rr��O�T�D�F�A�
MAILER-DAEMONrh�replied�flaggedrirj�Prk�$Cannot convert to specified type: %sN)rur	r�r�r�r�r�r�r1rZr�r(r�r5rrIr�	add_labelrr�r�)rr&r�rrrr�4sP

















�zMaildirMessage._explain_to)N)r�r�r�r�r�r r�r�r�r�r�r�r�r�r�r�r�rrrrr	�s

c@sZeZdZdZdgZddd�Zdd�Zddd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�ZdS)r1z/Message with mbox- or MMDF-specific properties.�_fromNcCsV|�dd�t|tjj�rF|��}|dk	rF|�d�rF|�|dd��t�||�dS)z'Initialize an mboxMMDFMessage instance.r�TNzFrom rs)r(rur>r&rr3r�r )rr&r-rrrr esz_mboxMMDFMessage.__init__cCs|jS)z Return contents of "From " line.)r�rDrrrr2nsz_mboxMMDFMessage.get_fromcCs4|dk	r*|dkrt��}|dt�|�7}||_dS)z>Set "From " line, formatting and appending time_ if specified.NT� )r�r5r4r�)rr.Ztime_rrrr(rs
z_mboxMMDFMessage.set_fromcCs|�dd�|�dd�S)r��Statusr��X-Status)r6rDrrrr�zsz_mboxMMDFMessage.get_flagscCs�t|�}d\}}dD]}||kr||7}|�|�qdD]}||kr8||7}|�|�q8|d�t|��7}z|�d|�Wn tk
r�|�d|�YnXz|�d|�Wn tk
r�|�d|�YnXdS)r�)r�r�)r�r�)r�r�r�r�r�r�N)rZr+r�r�replace_headerr/Z
add_header)rr�Zstatus_flagsZ
xstatus_flagsr�rrrr�~s&z_mboxMMDFMessage.set_flagscCs$|�d�t|���t|�B��dSr�r�r�rrrr��sz_mboxMMDFMessage.add_flagcCs4d|ksd|kr0|�d�t|���t|���dS)r�r�r�r�Nr�r�rrrr��sz_mboxMMDFMessage.remove_flagc	Cs�t|t�r�t|���}d|kr(|�d�d|kr:|�d�d|krL|�d�d|kr^|�d�d|krp|�d�|d	=|d
=d�|����dd
��}z|�	t
�t�
|d���Wnttfk
r�YnX�n
t|t�r�|�|���|�|���n�t|t��rZt|���}d|k�r$|�d�d|k�r8|�d�d|k�rL|�d�|d	=|d
=n�t|t��r�t|���}d|k�r�|�d�d|k�r�|�d�d|k�r�|�d�|d	=|d
=nt|t��r�ntdt|���d
S)zACopy mbox- or MMDF-specific state to message insofar as possible.r�r�r�r�r�r�r�r�Zstatuszx-statusr����Nz%a %b %d %H:%M:%S %Yrhr�r�rirjr�)rur	rZr�r�r�r�r2r�r��calendarZtimegmr��strptimerf�
OverflowErrorr1r�r(rrIrr�rr�r�)rr&r�Z
maybe_daterrrr��sb





�













�z_mboxMMDFMessage._explain_to)N)N)
r�r�r�r�r�r r2r(r�r�r�r�r�rrrrr1`s
	
r1c@seZdZdZdS)r
z&Message with mbox-specific properties.N�r�r�r�r�rrrrr
�sc@sHeZdZdZdgZddd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)rz$Message with MH-specific properties.�
_sequencesNcCsg|_t�||�dS)z!Initialize an MHMessage instance.N)r�rr r%rrrr �szMHMessage.__init__cCs|jdd�S)z4Return a list of sequences that include the message.N)r�rDrrrrH�szMHMessage.get_sequencescCst|�|_dS)z3Set the list of sequences that include the message.N)rFr�)rr`rrrrb�szMHMessage.set_sequencescCs6t|t�r"||jkr2|j�|�ntdt|���dS)z8Add sequence to list of sequences including the message.zsequence type must be str: %sN)rur�r�r�r�r��rrgrrrrI�s

zMHMessage.add_sequencecCs*z|j�|�Wntk
r$YnXdS)zARemove sequence from the list of sequences including the message.N)r�r+rfr�rrr�remove_sequence�szMHMessage.remove_sequencecCsFt|t�rdt|���}d|kr*|�d�n|�d�|�d�d|krP|�d�d|krb|�d�n�t|t�r�t|���}d|kr�|�d�n
|�d	�d|kr�|�d�d|kr�|�d
�n�t|t�r�|��D]}|�|�q�n`t|t	��r$t|���}d|k�r|�
d�d|k�rB|�
d�nt|t��r2ntdt
|���d
S)z6Copy MH-specific state to message insofar as possible.rhr�r�r�r�r�r��ROr�r�rjr�N)rur	rZrHr�r�r1rrIrr�rr�r�)rr&r`rgrrrr��sB










�zMHMessage._explain_to)N)r�r�r�r�r�r rHrbrIr�r�rrrrr�s
c@sbeZdZdZddgZddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dS)rz'Message with Babyl-specific properties.rm�_visibleNcCsg|_t�|_t�||�dS)z#Initialize a BabylMessage instance.N)rmrr�r r%rrrr "szBabylMessage.__init__cCs|jdd�S)z'Return a list of labels on the message.N)rmrDrrrrn(szBabylMessage.get_labelscCst|�|_dS)z&Set the list of labels on the message.N)rFrm)rrvrrrrq,szBabylMessage.set_labelscCs6t|t�r"||jkr2|j�|�ntdt|���dS)z+Add label to list of labels on the message.zlabel must be a string: %sN)rur�rmr�r�r��rryrrrr�0s

zBabylMessage.add_labelcCs*z|j�|�Wntk
r$YnXdS)z4Remove label from the list of labels on the message.N)rmr+rfr�rrr�remove_label8szBabylMessage.remove_labelcCs
t|j�S)z3Return a Message representation of visible headers.�rr�rDrrrr?szBabylMessage.get_visiblecCst|�|_dS)z2Set the Message representation of visible headers.Nr�)rZvisiblerrrrpCszBabylMessage.set_visiblecCsb|j��D](}||kr*|j�|||�q
|j|=q
dD]$}||kr8||jkr8|||j|<q8dS)z9Update and/or sensibly generate a set of visible headers.)ZDateZFromzReply-ToZToZCCZSubjectN)r�rGr�)r�headerrrr�update_visibleGs
zBabylMessage.update_visiblecCsrt|t�r~t|���}d|kr*|�d�n|�d�|�d�d|ksNd|krX|�d�d|krj|�d�d	|kr||�d
�n�t|t�r�t|���}d|kr�|�d�n
|�d�d	|kr�|�d
�d|kr�|�d�n�t|t��rt|���}d|k�r|�d�d|k�rn|�d�nTt|t	��rP|�
|���|��D]}|�|��q<nt|t
��r^ntdt|���dS)z9Copy Babyl-specific state to message insofar as possible.rhr�r�rkrlr�rjr�rir�r�r�r�r�r�r�N)rur	rZrnr�r�r1rrIrrprr�rr�r�)rr&rvryrrrr�RsH










�zBabylMessage._explain_to)N)r�r�r�r�r�r rnrqr�r�rrpr�r�rrrrrs
c@seZdZdZdS)r
z&Message with MMDF-specific properties.Nr�rrrrr
|sc@s�eZdZdZd&dd�Zd'dd�Zd(dd�Zd)d	d
�Zd*dd�Zd
d�Z	dd�Z
d+dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zed$d%��ZdS),r�zA read-only wrapper of a file.NcCs$||_|dkr|��|_n||_dS)zInitialize a _ProxyFile.N)rr�_pos)rr��posrrrr �sz_ProxyFile.__init__cCs|�||jj�S�zRead bytes.)�_readrrk�r�sizerrrrk�sz_ProxyFile.readcCs|�||jj�Sr�)r�r�read1r�rrrr��sz_ProxyFile.read1cCs|�||jj�S)zRead a line.)r�rr�r�rrrr��sz_ProxyFile.readlinecCs<g}|D].}|�|�|dk	r|t|�8}|dkrq8q|S)zRead multiple lines.Nr)r�r�)r�sizehintrUr�rrr�	readlines�s
z_ProxyFile.readlinesccs|��}|sdS|VqdS)zIterate over lines.N)r�)rr�rrrrL�sz_ProxyFile.__iter__cCs|jS)zReturn the position.)r�rDrrrr�sz_ProxyFile.tellrcCs4|dkr|j�|j�|j�||�|j��|_dS)zChange position.r�N�rr{r�r�r�offset�whencerrrr{�sz_ProxyFile.seekcCs0t|d�r,zt|jd�r"|j��W5|`XdS)zClose the file.rrcN)rXrrcrDrrrrc�s

z_ProxyFile.closecCs2|dkrd}|j�|j�||�}|j��|_|S)z"Read size bytes using read_method.Nrqr�)rr��read_methodrUrrrr��sz_ProxyFile._readcCs|S)z$Context management protocol support.rrDrrr�	__enter__�sz_ProxyFile.__enter__cGs|��dSr,)rc)r�excrrr�__exit__�sz_ProxyFile.__exit__cCs
|j��Sr,)r�readablerDrrrr��sz_ProxyFile.readablecCs
|j��Sr,)r�writablerDrrrr��sz_ProxyFile.writablecCs
|j��Sr,)r�seekablerDrrrr��sz_ProxyFile.seekablecCs
|j��Sr,)rr]rDrrrr]�sz_ProxyFile.flushcCs&t|d�sdSt|jd�sdS|jjS)NrTrFF)rXrrFrDrrrrF�s

z_ProxyFile.closed)N)N)N)N)N)r)r�r�r�r�r rkr�r�r�rLrr{rcr�r�r�r�r�r�r]�propertyrFrrrrr��s&





		r�c@s<eZdZdZddd�Zdd�Zddd	�Zd
d�Zdd
�ZdS)r/z&A read-only wrapper of part of a file.NcCst�|||�||_||_dS)zInitialize a _PartialFile.N)r�r �_start�_stop)rr�rrrrrr �sz_PartialFile.__init__cCst�|�|jS)z*Return the position with respect to start.)r�rr�rDrrrr�sz_PartialFile.tellrcCs<|dkr|j|_d}n|dkr*|j|_d}t�|||�dS)z8Change position, possibly with respect to start or stop.rr�r�N)r�r�r�r�r{r�rrrr{�sz_PartialFile.seekcCsB|j|j}|dkrdS|dks0|dks0||kr4|}t�|||�S)z;Read size bytes using read_method, honoring start and stop.rr&N)r�r�r�r�)rr�r�Z	remainingrrrr��sz_PartialFile._readcCst|d�r|`dS)Nr)rXrrDrrrrcs
z_PartialFile.close)NN)r)	r�r�r�r�r rr{r�rcrrrrr/�s


	r/Tc
Cs�d}�zbtrpzt�|tjtjB�WnJtk
rn}z,|jtjtjtjfkr\t	d|j
��n�W5d}~XYnX|�rfzt|j
d�}|��WnBtk
r�}z$|jtjtjfkr�WY�WdS�W5d}~XYnXz`zt
�|j
|j
d�d}Wn2ttfk
�r$t
�|j
|j
d�d}YnXt
�|j
�Wn0tk
�rdt
�|j
�t	d|j
��YnXWn8t�r�t�|tj�|�r�t
�|j
d��YnXdS)z(Lock file f using lockf and dot locking.Fzlockf: lock unavailable: %sN�.lockTzdot lock unavailable: %s)�fcntl�lockfZLOCK_EXZLOCK_NBr�r�ZEAGAINrrrr�rrcrr�r�r�r�rcr�r+�LOCK_UN)r�rZdotlock_doner�Zpre_lockrrrr

sL�
�r
cCs8trt�|tj�tj�|jd�r4t�|jd�dS)z*Unlock file f using lockf and dot locking.r�N)r�r�r�rrr�r�r+�r�rrrr4src	Cs<t�|tjtjBtjBd�}zt|d�W�St�|�XdS)zCCreate a file if it doesn't exist and open for reading and writing.r�r�N)rr�r�rC�O_RDWRrc)r�fdrrrr�;sr�cCs$td|tt���t��t��f�S)zBCreate a temp file based on path and open for reading and writing.z%s.%s.%s.%s)r�r�r�r�r�rr�)rrrrrCs�rcCs$|��ttd�r t�|���dS)z0Ensure changes to file f are physically on disk.�fsyncN)r]rXrr��filenor�rrrrIs
rcCst|�|��dS)z:Close file f, ensuring all changes are physically on disk.N)rrcr�rrrr�Osr�c@seZdZdZdS)rz"Raised for module-specific errors.Nr�rrrrrUsc@seZdZdZdS)rz:The specified mailbox does not exist and won't be created.Nr�rrrrrXsc@seZdZdZdS)rz>The specified mailbox is not empty and deletion was requested.Nr�rrrrr[sc@seZdZdZdS)rz)Another process caused an action to fail.Nr�rrrrr^sc@seZdZdZdS)rz)A file appears to have an invalid format.Nr�rrrrras)T)0r�rr�r�r�r�r�r�r>Z
email.messageZemail.generatorrvr8r��ImportError�__all__r}rdrrr�r%rrrrr&rr	r1r
rrr
r�r/r
rr�rrr��	Exceptionrrrrrrrrr�<module>s�
�h8DB4-3z%mqH_c'
*__pycache__/sndhdr.cpython-38.opt-1.pyc000064400000015517151153537550013650 0ustar00U

e5d��@s2dZddgZddlmZedd�Zdej_dej_d	ej_d
ej_dej	_dd�Z
d
d�ZgZdd�Z
e�e
�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zed*k�r.e�d+S),a�Routines to help recognizing sound files.

Function whathdr() recognizes various types of sound file headers.
It understands almost all headers that SOX can decode.

The return tuple contains the following items, in this order:
- file type (as SOX understands it)
- sampling rate (0 if unknown or hard to decode)
- number of channels (0 if unknown or hard to decode)
- number of frames in the file (-1 if unknown or hard to decode)
- number of bits/sample, or 'U' for U-LAW, or 'A' for A-LAW

If the file doesn't have a recognizable type, it returns None.
If the file can't be opened, OSError is raised.

To compute the total time, divide the number of frames by the
sampling rate (a frame contains a sample for each channel).

Function what() calls whathdr().  (It used to also use some
heuristics for raw data, but this doesn't work very well.)

Finally, the function test() is a simple main program that calls
what() for all files mentioned on the argument list.  For directory
arguments it calls what() for all files in that directory.  Default
argument is "." (testing all files in the current directory).  The
option -r tells it to recurse down directories found inside
explicitly given directories.
�what�whathdr�)�
namedtuple�
SndHeadersz.filetype framerate nchannels nframes sampwidthz�The value for type indicates the data type
and will be one of the strings 'aifc', 'aiff', 'au','hcom',
'sndr', 'sndt', 'voc', 'wav', '8svx', 'sb', 'ub', or 'ul'.zYThe sampling_rate will be either the actual
value or 0 if unknown or difficult to decode.z^The number of channels or 0 if it cannot be
determined or if the value is difficult to decode.z?The value for frames will be either the number
of frames or -1.zAEither the sample size in bits or
'A' for A-LAW or 'U' for u-LAW.cCst|�}|S)zGuess the type of a sound file.)r)�filename�res�r�/usr/lib64/python3.8/sndhdr.pyr4sc
Cs^t|d��J}|�d�}tD]*}|||�}|rt|�W5QR�SqW5QR�dSQRXdS)zRecognize sound headers.�rbiN)�open�read�testsr)r�f�hZtfrrrr	r:s

c	Cs�ddl}|�d�sdS|dd�dkr,d}n|dd�dkrBd}ndS|�d�z|�|d	�}Wnt|jfk
r|YdSX||��|��|��d|�	�fS)
Nr�FORM��sAIFC�aifcsAIFFZaiff�r)
r�
startswith�seekr�EOFError�Error�getframerate�getnchannels�
getnframes�getsampwidth)rrrZfmt�arrr	�	test_aifcKs"


�rc
Cs�|�d�rt}n|dd�dkr&t}ndSd}||dd��}||dd��}||dd��}||dd��}||dd	��}d
}	|d
kr�d}
n$|dkr�d}
n|d
kr�d}
d}	nd}
|	|}|r�||}nd}|||||
fS)Ns.snd�)sds.sdns.Zaurr�����U���?���)r�get_long_be�get_long_le)
rr�func�filetypeZhdr_size�	data_size�encoding�rate�	nchannelsZsample_sizeZsample_bitsZ
frame_sizeZnframerrr	�test_au`s2

r1cCsT|dd�dks |dd�dkr$dSt|dd��}|rBd	|}nd
}d|dd
dfS)N�A�EsFSSD��sHCOM��i"VrZhcomr#r(r)r))rrZdivisorr/rrr	�	test_hcom�s 
r8cCst|�d�sdSt|dd��}d}d|kr6dkrfnn,||dkrfd||d}|rftd	|�}d
|dddfS)
NsCreative Voice Filer!�ri�r#�rg��.AZvocr(r)r�get_short_le�int)rrZsbseekr/Zratecoderrr	�test_voc�s
$r=c	Cs�ddl}|�d�r2|dd�dks2|dd�dkr6dS|�d�z|�|d�}Wnt|jfk
rlYdSXd	|��|��|��d|�	�fS)
NrsRIFFrrsWAVEr sfmt rZwav)
�waverrrrrrrrr)rrr>�wrrr	�test_wav�s*

�r@cCs"|�d�r|dd�dkrdSdS)Nrrrs8SVX)Z8svxrr#rr)r)rrrrr	�	test_8svx�srAcCs<|�d�r8t|dd��}t|dd��}d|d|dfSdS)NsSOUNDrrr!r9Zsndtr#)rr*r;)rrZnsamplesr/rrr	�	test_sndt�s
rBcCsD|�d�r@t|dd��}d|kr.dkr@nnd|ddd	fSdS)
Nsr%ri�i�aZsndrr#r(r)rr;)rrr/rrr	�	test_sndr�s
rCcCs,|dd>|dd>B|dd>B|dBS)Nrr"r#r r%rr&r��brrr	r)�sr)cCs,|dd>|dd>B|dd>B|dBS)Nr&r"r%r r#rrrrDrrr	r*�sr*cCs|dd>|dBS)Nrrr#rrDrrr	�get_short_be�srFcCs|dd>|dBS)Nr#rrrrDrrr	r;�sr;cCs�ddl}d}|jdd�r8|jddkr8|jdd�=d}z8|jdd�r`t|jdd�|d�ntdg|d�Wn*tk
r�|j�d�|�d�YnXdS)Nrr#z-rr%�.z
[Interrupted]
)�sys�argv�testall�KeyboardInterrupt�stderr�write�exit)rH�	recursiverrr	�test�srPc	Cs�ddl}ddl}|D]�}|j�|�r~t|ddd�|s<|rttd�ddl}|�|j�|�|�d��}t||d�q�td�qt|ddd�|j	�
�ztt|��Wqtk
r�td	�YqXqdS)
Nrz/:� )�endzrecursing down:�*z*** directory (use -r) ***�:z*** not found ***)
rH�os�path�isdir�print�glob�join�escaperJ�stdout�flushr�OSError)�listrOZtoplevelrHrUrrY�namesrrr	rJ�s"

rJ�__main__N)�__doc__�__all__�collectionsrrr,Z	framerater0ZnframesZ	sampwidthrrr
r�appendr1r8r=r@rArBrCr)r*rFr;rPrJ�__name__rrrr	�<module>sJ �









__pycache__/pickletools.cpython-38.pyc000064400000203206151153537550013751 0ustar00U

e5d.m�L@s�
dZddlZddlZddlZddlZddlZdddgZejZdZdZ	dZ
d	Zd
ZGdd�de
�Zdd
lmZdd�Zeddedd�Zdd�Zeddedd�Zdd�Zeddedd�Zdd�Zed ded!d�Zd"d#�Zed$d%ed&d�Z�d�d(d)�Zed*eed+d�Zd,d-�Zed.eed/d�Zd0d1�Z ed2ee d3d�Z!d4d5�Z"ed6e	e"d7d�Z#d8d9�Z$ed:e
e$d;d�Z%d<d=�Z&ed>e	e&d?d�Z'd@dA�Z(edBee(dCd�Z)dDdE�Z*edFee*dGd�Z+dHdI�Z,edJee,dKd�Z-dLdM�Z.edNee.dOd�Z/dPdQ�Z0edRe	e0dSd�Z1dTdU�Z2edVee2dWd�Z3dXdY�Z4edZee4d[d�Z5d\d]�Z6d^d_�Z7ed`ee6dad�Z8edbee7dcd�Z9ddde�Z:edfee:dgd�Z;dhdi�Z<edjd%e<dkd�Z=ddllm>Z>dmdn�Z?edoe	e?dpd�Z@dqdr�ZAedse
eAdtd�ZBGdudv�dve
�ZCeCdweDdxdy�ZEZFeCdzeDeGfd{dy�ZHeCd|eGd}dy�ZIeCd~eJddy�ZKeCd�eLeMfd�dy�ZNZOeCd�eLd�dy�ZPeCd�eQd�dy�ZReCd�eMd�dy�ZSeCd�eTd�d�dy�ZUeCd�eVd�dy�ZWeCd�eXd�dy�ZYeCd�eZd�dy�Z[eCd�e\d�dy�Z]eCd�e\d�dy�Z^eCd�e
d�dy�Z_eCd�e
d�dy�Z`eCd�eCd�dy�ZaeCd�eCd�dy�ZbGd�d��d�e
�ZcecZdedd�d�e8geHgdd�d��edd�d�egeEgdd�d��edd�d�egeEgdd�d��edd�d�egeEgdd�d��edd�d�e9geEgdd�d��edd�d�e@geEgdd�d��edd�d�eBgeEgdd�d��edd�d�egeNgdd�d��edd�d�e%geNgdd�d��edd�d�e#geNgdd�d��edd�d�e)gePgd�d�d��edd�d�e'gePgd�d�d��edd�d�e+gePgdd�d��edd�d�e-geRgd�d�d��edd�d�dge_gd�d�d��edd�d�de_ge_gd�d�d��edd�d�dgeUgdd�d��edd�d�dgeIgdd�d��edd�d�dgeIgdd�d��edd�d�e/geSgdd�d��edd�d�e1geSgdd�d��edd�d�e3geSgdd�d��edd�d�e5geSgdd�d��edd�d�e;geKgdd�d��edd�d�e=geKgdd�d��edd�d�dgeYgdd�d��edd�d�deYe`geYgdd�d��edd�d�deYeaebgeYgdd�d��edd�d�deaebgeYgdd�d��edd�d�dgeWgdd�d��edd�d�deaebgeWgdd�d��edd�d�de`geWgd�dd��ed�d�dde`e`geWgd�dd��ed�d�dde`e`e`geWgd�dd��ed�d�ddge[gd�d	d��ed�d
�ddeaebge[gd�dd��ed�d
�dde[e`e`ge[gd�dd��ed�d�dde[eaebge[gd�dd��ed�d�ddge]gd�dd��ed�d�dde]eaebge]gd�dd��ed�d�ddeaebge^gd�dd��ed�d�dde`ggd�dd��ed�d�d de`ge`e`gd�d!d��ed�d"�d#dgeagd�d$d��ed�d%�d&deaebggd�d'd��ed�d(�d)e8ge`gd�d*d��ed�d+�d,ege`gd�d-d��ed�d.�d/ege`gd�d0d��ed�d1�d2e8ggd�d3d��ed�d4�d5eggd�d6d��ed�d7�d8eggd�d9d��ed�d:�d;de`ge`gd�d<d��ed�d=�d>ege`gd�d?d��ed�d@�dAege`gd�dBd��ed�dC�dDege`gd�dEd��ed�dF�dGe!ge`gd�dHd��ed�dI�dJdeSeSge`gd�dKd��ed�dL�dMde`e`ge`gd�dNd��ed�dO�dPde`e`ge`gd�dQd��ed�dR�dSe!eaebge`gd�dTd��ed�dU�dVdeae`ebge`gd�dWd��ed�dX�dYde`e`ge`gd�dZd��ed�d[�d\de`e`e`ge`gd�d]d��ed�d^�d_eggd�d`d��ed�da�dbde`ggd�dcd��ed�dd�deeggd�dfd��ed�dg�dhege`gd�did��ed�dj�dkde`ge`gd�dld��gDZe[diZfiZgehee�D]n\ZiZjejjkefk�rBel�dmejjkefejjkeif��ejjmegk�rjel�dnejjmegejjmeif��eiefejjk<eiegejjm<�q[f[g[i[jiZneeD]Zjejenejjm<�q�[j�d��dp�dq�Zoeo�[o�d��dr�ds�Zp�dtd�Zq�dud�Zr�d��dvd�ZsG�dw�dx��dx�Zt�dyZu�dzZveuev�d{�Zw�d|�d}�Zxey�d~k�
r�ddlzZzezj{�d�d��Z|e|j}�d�ez�~�d���d��d��d��e|j}�d��d�ejez�~�d���d��d��e|j}�d��d��d��d��d��e|j}�d��d�deD�d��d��e|j}�d��d��d��d��d��e|j}�d��d��d��d��d��e|j}�d��d��d��d��d��e|j}�d��d��d��d��e|���Z�e�j��
rPex�n�e�j��
r^�d�ndZ�e�j��
ste|���n�e�e�j��dk�
r�ese�j�de�j�de�j�e��nVe�j��
r�indZ�e�j�D]>Z�e�j�j�e�jk�d��Z�e�j���e��d��ese�e�j�e�e�j�e���
q�dS(�ar"Executable documentation" for the pickle module.

Extensive comments about the pickle protocols and pickle-machine opcodes
can be found here.  Some functions meant for external use:

genops(pickle)
   Generate all the opcodes in a pickle, as (opcode, arg, position) triples.

dis(pickle, out=None, memo=None, indentlevel=4)
   Print a symbolic disassembly of a pickle.
�N�dis�genops�optimize���������������c@seZdZdZdd�ZdS)�ArgumentDescriptor��name�n�reader�doccCs`t|t�st�||_t|t�r8|dks<|ttttt	fks<t�||_
||_t|t�sVt�||_dS�Nr)
�
isinstance�str�AssertionErrorr�int�
UP_TO_NEWLINE�TAKEN_FROM_ARGUMENT1�TAKEN_FROM_ARGUMENT4�TAKEN_FROM_ARGUMENT4U�TAKEN_FROM_ARGUMENT8Ur
rr)�selfrr
rr�r�#/usr/lib64/python3.8/pickletools.py�__init__�s��zArgumentDescriptor.__init__N��__name__�
__module__�__qualname__�	__slots__rrrrrr
�sr
)�unpackcCs"|�d�}|r|dStd��dS)zG
    >>> import io
    >>> read_uint1(io.BytesIO(b'\xff'))
    255
    �rz'not enough data in stream to read uint1N)�read�
ValueError��f�datarrr�
read_uint1�s
r*�uint1r$zOne-byte unsigned integer.rcCs0|�d�}t|�dkr$td|�dStd��dS)z�
    >>> import io
    >>> read_uint2(io.BytesIO(b'\xff\x00'))
    255
    >>> read_uint2(io.BytesIO(b'\xff\xff'))
    65535
    �z<Hrz'not enough data in stream to read uint2N�r%�len�_unpackr&r'rrr�
read_uint2�s	
r0�uint2r,z)Two-byte unsigned integer, little-endian.cCs0|�d�}t|�dkr$td|�dStd��dS)z�
    >>> import io
    >>> read_int4(io.BytesIO(b'\xff\x00\x00\x00'))
    255
    >>> read_int4(io.BytesIO(b'\x00\x00\x00\x80')) == -(2**31)
    True
    �z<irz&not enough data in stream to read int4Nr-r'rrr�	read_int4�s	
r3�int4r2z8Four-byte signed integer, little-endian, 2's complement.cCs0|�d�}t|�dkr$td|�dStd��dS)z�
    >>> import io
    >>> read_uint4(io.BytesIO(b'\xff\x00\x00\x00'))
    255
    >>> read_uint4(io.BytesIO(b'\x00\x00\x00\x80')) == 2**31
    True
    r2z<Irz'not enough data in stream to read uint4Nr-r'rrr�
read_uint4s	
r5�uint4z*Four-byte unsigned integer, little-endian.cCs0|�d�}t|�dkr$td|�dStd��dS)z�
    >>> import io
    >>> read_uint8(io.BytesIO(b'\xff\x00\x00\x00\x00\x00\x00\x00'))
    255
    >>> read_uint8(io.BytesIO(b'\xff' * 8)) == 2**64-1
    True
    �z<Qrz'not enough data in stream to read uint8Nr-r'rrr�
read_uint8&s	
r8�uint8r7z+Eight-byte unsigned integer, little-endian.TcCs�|��}|�d�std��|dd�}|rtdD]8}|�|�r.|�|�sVtd||f��|dd�}qtq.td|��|r�t�|�d	�d
�}|S)au
    >>> import io
    >>> read_stringnl(io.BytesIO(b"'abcd'\nefg\n"))
    'abcd'

    >>> read_stringnl(io.BytesIO(b"\n"))
    Traceback (most recent call last):
    ...
    ValueError: no string quotes around b''

    >>> read_stringnl(io.BytesIO(b"\n"), stripquotes=False)
    ''

    >>> read_stringnl(io.BytesIO(b"''\n"))
    ''

    >>> read_stringnl(io.BytesIO(b'"abcd"'))
    Traceback (most recent call last):
    ...
    ValueError: no newline found when trying to read stringnl

    Embedded escapes are undone in the result.
    >>> read_stringnl(io.BytesIO(br"'a\n\\b\x00c\td'" + b"\n'e'"))
    'a\n\\b\x00c\td'
    �
z-no newline found when trying to read stringnlNr)�"�'z,strinq quote %r not found at both ends of %rr$zno string quotes around %rr�ascii)�readline�endswithr&�
startswith�codecs�
escape_decode�decode)r(rC�stripquotesr)�qrrr�
read_stringnl;s"


�rF�stringnlz�A newline-terminated string.

                   This is a repr-style string, with embedded escapes, and
                   bracketing quotes.
                   cCst|dd�S)NF)rD)rF�r(rrr�read_stringnl_noescapetsrI�stringnl_noescapeaA newline-terminated string.

                        This is a str-style string, without embedded escapes,
                        or bracketing quotes.  It should consist solely of
                        printable ASCII characters.
                        cCsdt|�t|�fS)zp
    >>> import io
    >>> read_stringnl_noescape_pair(io.BytesIO(b"Queue\nEmpty\njunk"))
    'Queue Empty'
    z%s %s)rIrHrrr�read_stringnl_noescape_pair�srK�stringnl_noescape_paira�A pair of newline-terminated strings.

                             These are str-style strings, without embedded
                             escapes, or bracketing quotes.  They should
                             consist solely of printable ASCII characters.
                             The pair is returned as a single string, with
                             a single blank separating the two strings.
                             cCsLt|�}|dkst�|�|�}t|�|kr4|�d�Std|t|�f��dS)z�
    >>> import io
    >>> read_string1(io.BytesIO(b"\x00"))
    ''
    >>> read_string1(io.BytesIO(b"\x03abcdef"))
    'abc'
    r�latin-1z2expected %d bytes in a string1, but only %d remainN)r*rr%r.rCr&�r(r
r)rrr�read_string1�s	


�rO�string1z�A counted string.

              The first argument is a 1-byte unsigned int giving the number
              of bytes in the string, and the second argument is that many
              bytes.
              cCsTt|�}|dkrtd|��|�|�}t|�|kr<|�d�Std|t|�f��dS)aP
    >>> import io
    >>> read_string4(io.BytesIO(b"\x00\x00\x00\x00abc"))
    ''
    >>> read_string4(io.BytesIO(b"\x03\x00\x00\x00abcdef"))
    'abc'
    >>> read_string4(io.BytesIO(b"\x00\x00\x00\x03abcdef"))
    Traceback (most recent call last):
    ...
    ValueError: expected 50331648 bytes in a string4, but only 6 remain
    rzstring4 byte count < 0: %drMz2expected %d bytes in a string4, but only %d remainN)r3r&r%r.rCrNrrr�read_string4�s



�rQ�string4z�A counted string.

              The first argument is a 4-byte little-endian signed int giving
              the number of bytes in the string, and the second argument is
              that many bytes.
              cCsFt|�}|dkst�|�|�}t|�|kr.|Std|t|�f��dS)z�
    >>> import io
    >>> read_bytes1(io.BytesIO(b"\x00"))
    b''
    >>> read_bytes1(io.BytesIO(b"\x03abcdef"))
    b'abc'
    rz1expected %d bytes in a bytes1, but only %d remainN)r*rr%r.r&rNrrr�read_bytes1�s	

�rS�bytes1z�A counted bytes string.

              The first argument is a 1-byte unsigned int giving the number
              of bytes, and the second argument is that many bytes.
              cCs\t|�}|dkst�|tjkr*td|��|�|�}t|�|krD|Std|t|�f��dS)aN
    >>> import io
    >>> read_bytes4(io.BytesIO(b"\x00\x00\x00\x00abc"))
    b''
    >>> read_bytes4(io.BytesIO(b"\x03\x00\x00\x00abcdef"))
    b'abc'
    >>> read_bytes4(io.BytesIO(b"\x00\x00\x00\x03abcdef"))
    Traceback (most recent call last):
    ...
    ValueError: expected 50331648 bytes in a bytes4, but only 6 remain
    rz#bytes4 byte count > sys.maxsize: %dz1expected %d bytes in a bytes4, but only %d remainN)r5r�sys�maxsizer&r%r.rNrrr�read_bytes4�s



�rW�bytes4z�A counted bytes string.

              The first argument is a 4-byte little-endian unsigned int giving
              the number of bytes, and the second argument is that many bytes.
              cCs\t|�}|dkst�|tjkr*td|��|�|�}t|�|krD|Std|t|�f��dS)a�
    >>> import io, struct, sys
    >>> read_bytes8(io.BytesIO(b"\x00\x00\x00\x00\x00\x00\x00\x00abc"))
    b''
    >>> read_bytes8(io.BytesIO(b"\x03\x00\x00\x00\x00\x00\x00\x00abcdef"))
    b'abc'
    >>> bigsize8 = struct.pack("<Q", sys.maxsize//3)
    >>> read_bytes8(io.BytesIO(bigsize8 + b"abcdef"))  #doctest: +ELLIPSIS
    Traceback (most recent call last):
    ...
    ValueError: expected ... bytes in a bytes8, but only 6 remain
    rz#bytes8 byte count > sys.maxsize: %dz1expected %d bytes in a bytes8, but only %d remainN)r8rrUrVr&r%r.rNrrr�read_bytes8s


�rY�bytes8z�A counted bytes string.

              The first argument is an 8-byte little-endian unsigned int giving
              the number of bytes, and the second argument is that many bytes.
              cCs`t|�}|dkst�|tjkr*td|��|�|�}t|�|krHt|�Std|t|�f��dS)a�
    >>> import io, struct, sys
    >>> read_bytearray8(io.BytesIO(b"\x00\x00\x00\x00\x00\x00\x00\x00abc"))
    bytearray(b'')
    >>> read_bytearray8(io.BytesIO(b"\x03\x00\x00\x00\x00\x00\x00\x00abcdef"))
    bytearray(b'abc')
    >>> bigsize8 = struct.pack("<Q", sys.maxsize//3)
    >>> read_bytearray8(io.BytesIO(bigsize8 + b"abcdef"))  #doctest: +ELLIPSIS
    Traceback (most recent call last):
    ...
    ValueError: expected ... bytes in a bytearray8, but only 6 remain
    rz'bytearray8 byte count > sys.maxsize: %dz5expected %d bytes in a bytearray8, but only %d remainN)r8rrUrVr&r%r.�	bytearrayrNrrr�read_bytearray89s


�r\�
bytearray8z�A counted bytearray.

              The first argument is an 8-byte little-endian unsigned int giving
              the number of bytes, and the second argument is that many bytes.
              cCs0|��}|�d�std��|dd�}t|d�S)zm
    >>> import io
    >>> read_unicodestringnl(io.BytesIO(b"abc\\uabcd\njunk")) == 'abc\uabcd'
    True
    r:z4no newline found when trying to read unicodestringnlNrzraw-unicode-escape)r>r?r&rr'rrr�read_unicodestringnl[s

r^�unicodestringnlz�A newline-terminated Unicode string.

                      This is raw-unicode-escape encoded, so consists of
                      printable ASCII characters, and may contain embedded
                      escape sequences.
                      cCsNt|�}|dkst�|�|�}t|�|kr6t|dd�Std|t|�f��dS)a�
    >>> import io
    >>> s = 'abcd\uabcd'
    >>> enc = s.encode('utf-8')
    >>> enc
    b'abcd\xea\xaf\x8d'
    >>> n = bytes([len(enc)])  # little-endian 1-byte length
    >>> t = read_unicodestring1(io.BytesIO(n + enc + b'junk'))
    >>> s == t
    True

    >>> read_unicodestring1(io.BytesIO(n + enc[:-1]))
    Traceback (most recent call last):
    ...
    ValueError: expected 7 bytes in a unicodestring1, but only 6 remain
    r�utf-8�
surrogatepassz9expected %d bytes in a unicodestring1, but only %d remainN)r*rr%r.rr&rNrrr�read_unicodestring1us

�rb�unicodestring1aAA counted Unicode string.

                    The first argument is a 1-byte little-endian signed int
                    giving the number of bytes in the string, and the second
                    argument-- the UTF-8 encoding of the Unicode string --
                    contains that many bytes.
                    cCsdt|�}|dkst�|tjkr*td|��|�|�}t|�|krLt|dd�Std|t|�f��dS)a�
    >>> import io
    >>> s = 'abcd\uabcd'
    >>> enc = s.encode('utf-8')
    >>> enc
    b'abcd\xea\xaf\x8d'
    >>> n = bytes([len(enc), 0, 0, 0])  # little-endian 4-byte length
    >>> t = read_unicodestring4(io.BytesIO(n + enc + b'junk'))
    >>> s == t
    True

    >>> read_unicodestring4(io.BytesIO(n + enc[:-1]))
    Traceback (most recent call last):
    ...
    ValueError: expected 7 bytes in a unicodestring4, but only 6 remain
    rz+unicodestring4 byte count > sys.maxsize: %dr`raz9expected %d bytes in a unicodestring4, but only %d remainN)r5rrUrVr&r%r.rrNrrr�read_unicodestring4�s


�rd�unicodestring4aAA counted Unicode string.

                    The first argument is a 4-byte little-endian signed int
                    giving the number of bytes in the string, and the second
                    argument-- the UTF-8 encoding of the Unicode string --
                    contains that many bytes.
                    cCsdt|�}|dkst�|tjkr*td|��|�|�}t|�|krLt|dd�Std|t|�f��dS)a�
    >>> import io
    >>> s = 'abcd\uabcd'
    >>> enc = s.encode('utf-8')
    >>> enc
    b'abcd\xea\xaf\x8d'
    >>> n = bytes([len(enc)]) + b'\0' * 7  # little-endian 8-byte length
    >>> t = read_unicodestring8(io.BytesIO(n + enc + b'junk'))
    >>> s == t
    True

    >>> read_unicodestring8(io.BytesIO(n + enc[:-1]))
    Traceback (most recent call last):
    ...
    ValueError: expected 7 bytes in a unicodestring8, but only 6 remain
    rz+unicodestring8 byte count > sys.maxsize: %dr`raz9expected %d bytes in a unicodestring8, but only %d remainN)r8rrUrVr&r%r.rrNrrr�read_unicodestring8�s


�rf�unicodestring8aBA counted Unicode string.

                    The first argument is an 8-byte little-endian signed int
                    giving the number of bytes in the string, and the second
                    argument-- the UTF-8 encoding of the Unicode string --
                    contains that many bytes.
                    cCs.t|ddd�}|dkrdS|dkr&dSt|�S)z�
    >>> import io
    >>> read_decimalnl_short(io.BytesIO(b"1234\n56"))
    1234

    >>> read_decimalnl_short(io.BytesIO(b"1234L\n56"))
    Traceback (most recent call last):
    ...
    ValueError: invalid literal for int() with base 10: b'1234L'
    F�rCrDs00s01T�rFr�r(�srrr�read_decimalnl_short�srlcCs2t|ddd�}|dd�dkr*|dd�}t|�S)z�
    >>> import io

    >>> read_decimalnl_long(io.BytesIO(b"1234L\n56"))
    1234

    >>> read_decimalnl_long(io.BytesIO(b"123456789012345678901234L\n6"))
    123456789012345678901234
    FrhrN�Lrirjrrr�read_decimalnl_longsrn�decimalnl_shorta�A newline-terminated decimal integer literal.

                          This never has a trailing 'L', and the integer fit
                          in a short Python int on the box where the pickle
                          was written -- but there's no guarantee it will fit
                          in a short Python int on the box where the pickle
                          is read.
                          �decimalnl_longz�A newline-terminated decimal integer literal.

                         This has a trailing 'L', and can represent integers
                         of any size.
                         cCst|ddd�}t|�S)zO
    >>> import io
    >>> read_floatnl(io.BytesIO(b"-1.25\n6"))
    -1.25
    Frh)rF�floatrjrrr�read_floatnl-srr�floatnla�A newline-terminated decimal floating literal.

              In general this requires 17 significant digits for roundtrip
              identity, and pickling then unpickling infinities, NaNs, and
              minus zero doesn't work across boxes, or on some boxes even
              on itself (e.g., Windows can't read the strings it produces
              for infinities or NaNs).
              cCs0|�d�}t|�dkr$td|�dStd��dS)z�
    >>> import io, struct
    >>> raw = struct.pack(">d", -1.25)
    >>> raw
    b'\xbf\xf4\x00\x00\x00\x00\x00\x00'
    >>> read_float8(io.BytesIO(raw + b"\n"))
    -1.25
    r7z>drz(not enough data in stream to read float8Nr-r'rrr�read_float8Cs

rt�float8aAn 8-byte binary representation of a float, big-endian.

             The format is unique to Python, and shared with the struct
             module (format string '>d') "in theory" (the struct and pickle
             implementations don't share the code -- they should).  It's
             strongly related to the IEEE-754 double format, and, in normal
             cases, is in fact identical to the big-endian 754 double format.
             On other boxes the dynamic range is limited to that of a 754
             double, and "add a half and chop" rounding is used to reduce
             the precision to 53 bits.  However, even on a 754 box,
             infinities, NaNs, and minus zero may not be handled correctly
             (may not survive roundtrip pickling intact).
             )�decode_longcCs.t|�}|�|�}t|�|kr&td��t|�S)a+
    >>> import io
    >>> read_long1(io.BytesIO(b"\x00"))
    0
    >>> read_long1(io.BytesIO(b"\x02\xff\x00"))
    255
    >>> read_long1(io.BytesIO(b"\x02\xff\x7f"))
    32767
    >>> read_long1(io.BytesIO(b"\x02\x00\xff"))
    -256
    >>> read_long1(io.BytesIO(b"\x02\x00\x80"))
    -32768
    z'not enough data in stream to read long1)r*r%r.r&rvrNrrr�
read_long1is

rw�long1aA binary long, little-endian, using 1-byte size.

    This first reads one byte as an unsigned size, then reads that
    many bytes and interprets them as a little-endian 2's-complement long.
    If the size is 0, that's taken as a shortcut for the long 0L.
    cCsBt|�}|dkrtd|��|�|�}t|�|kr:td��t|�S)ag
    >>> import io
    >>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\xff\x00"))
    255
    >>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\xff\x7f"))
    32767
    >>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\x00\xff"))
    -256
    >>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\x00\x80"))
    -32768
    >>> read_long1(io.BytesIO(b"\x00\x00\x00\x00"))
    0
    rzlong4 byte count < 0: %dz'not enough data in stream to read long4)r3r&r%r.rvrNrrr�
read_long4�s
ry�long4a�A binary representation of a long, little-endian.

    This first reads four bytes as a signed size (but requires the
    size to be >= 0), then reads that many bytes and interprets them
    as a little-endian 2's-complement long.  If the size is 0, that's taken
    as a shortcut for the int 0, although LONG1 should really be used
    then instead (and in any case where # of bytes < 256).
    c@s eZdZdZdd�Zdd�ZdS)�StackObject�r�obtypercCslt|t�st�||_t|t�s,t|t�s,t�t|t�rN|D]}t|t�s:t�q:||_t|t�sbt�||_dS�N)rrrr�type�tupler}r)rrr}rZ	containedrrrr�s
zStackObject.__init__cCs|jSr~�r)rrrr�__repr__�szStackObject.__repr__N)rr r!r"rr�rrrrr{�s
r{rzA Python integer object.r|Zint_or_boolz#A Python integer or boolean object.�boolzA Python boolean object.rqzA Python float object.Zbytes_or_strz*A Python bytes or (Unicode) string object.�byteszA Python bytes object.r[zA Python bytearray object.rz!A Python (Unicode) string object.�NonezThe Python None object.r�zA Python tuple object.�listzA Python list object.�dictzA Python dict object.�setzA Python set object.�	frozensetzA Python frozenset object.�bufferzA Python buffer-like object.�anyzAny kind of object whatsoever.Zmarkaz'The mark' is a unique object.

Opcodes that operate on a variable number of objects
generally don't embed the count of objects in the opcode,
or pull it off the stack.  Instead the MARK opcode is used
to push a special marker object on the stack, and then
some other opcodes grab all the objects from the top of
the stack down to (but not including) the topmost marker
object.
�
stackslicea�An object representing a contiguous slice of the stack.

This is used in conjunction with markobject, to represent all
of the stack following the topmost markobject.  For example,
the POP_MARK opcode changes the stack from

    [..., markobject, stackslice]
to
    [...]

No matter how many object are on the stack after the topmost
markobject, POP_MARK gets rid of all of them (including the
topmost markobject too).
c@seZdZdZdd�ZdS)�
OpcodeInfo�r�code�arg�stack_before�stack_after�protorc	Cs�t|t�st�||_t|t�s"t�t|�dks2t�||_|dksNt|t�sNt�||_t|t�sbt�|D]}t|t	�sft�qf||_
t|t�s�t�|D]}t|t	�s�t�q�||_t|t�r�d|kr�t
jks�nt�||_t|t�s�t�||_dS)Nr$r)rrrrr.r�r
r�r�r{r�r�r�pickleZHIGHEST_PROTOCOLr�r)	rrr�r�r�r�r�r�xrrrrds&&zOpcodeInfo.__init__Nrrrrrr�Esr�ZINT�Ia�Push an integer or bool.

      The argument is a newline-terminated decimal literal string.

      The intent may have been that this always fit in a short Python int,
      but INT can be generated in pickles written on a 64-bit box that
      require a Python long on a 32-bit box.  The difference between this
      and LONG then is that INT skips a trailing 'L', and produces a short
      int whenever possible.

      Another difference is due to that, when bool was introduced as a
      distinct type in 2.3, builtin names True and False were also added to
      2.2.2, mapping to ints 1 and 0.  For compatibility in both directions,
      True gets pickled as INT + "I01\n", and False as INT + "I00\n".
      Leading zeroes are never produced for a genuine integer.  The 2.3
      (and later) unpicklers special-case these and return bool instead;
      earlier unpicklers ignore the leading "0" and return the int.
      r�ZBININT�Ja1Push a four-byte signed integer.

      This handles the full range of Python (short) integers on a 32-bit
      box, directly as binary bytes (1 for the opcode and 4 for the integer).
      If the integer is non-negative and fits in 1 or 2 bytes, pickling via
      BININT1 or BININT2 saves space.
      ZBININT1�Kz�Push a one-byte unsigned integer.

      This is a space optimization for pickling very small non-negative ints,
      in range(256).
      ZBININT2�Mz�Push a two-byte unsigned integer.

      This is a space optimization for pickling small positive ints, in
      range(256, 2**16).  Integers in range(256) can also be pickled via
      BININT2, but BININT1 instead saves a byte.
      ZLONG�La�Push a long integer.

      The same as INT, except that the literal ends with 'L', and always
      unpickles to a Python long.  There doesn't seem a real purpose to the
      trailing 'L'.

      Note that LONG takes time quadratic in the number of digits when
      unpickling (this is simply due to the nature of decimal->binary
      conversion).  Proto 2 added linear-time (in C; still quadratic-time
      in Python) LONG1 and LONG4 opcodes.
      ZLONG1�Šz|Long integer using one-byte length.

      A more efficient encoding of a Python long; the long1 encoding
      says it all.ZLONG4�‹z~Long integer using found-byte length.

      A more efficient encoding of a Python long; the long4 encoding
      says it all.�STRING�Sa�Push a Python string object.

      The argument is a repr-style string, with bracketing quote characters,
      and perhaps embedded escapes.  The argument extends until the next
      newline character.  These are usually decoded into a str instance
      using the encoding given to the Unpickler constructor. or the default,
      'ASCII'.  If the encoding given was 'bytes' however, they will be
      decoded as bytes object instead.
      Z	BINSTRING�Ta�Push a Python string object.

      There are two arguments: the first is a 4-byte little-endian
      signed int giving the number of bytes in the string, and the
      second is that many bytes, which are taken literally as the string
      content.  These are usually decoded into a str instance using the
      encoding given to the Unpickler constructor. or the default,
      'ASCII'.  If the encoding given was 'bytes' however, they will be
      decoded as bytes object instead.
      ZSHORT_BINSTRING�Ua�Push a Python string object.

      There are two arguments: the first is a 1-byte unsigned int giving
      the number of bytes in the string, and the second is that many
      bytes, which are taken literally as the string content.  These are
      usually decoded into a str instance using the encoding given to
      the Unpickler constructor. or the default, 'ASCII'.  If the
      encoding given was 'bytes' however, they will be decoded as bytes
      object instead.
      ZBINBYTES�B�z�Push a Python bytes object.

      There are two arguments:  the first is a 4-byte little-endian unsigned int
      giving the number of bytes, and the second is that many bytes, which are
      taken literally as the bytes content.
      ZSHORT_BINBYTES�Cz�Push a Python bytes object.

      There are two arguments:  the first is a 1-byte unsigned int giving
      the number of bytes, and the second is that many bytes, which are taken
      literally as the string content.
      Z	BINBYTES8�Žz�Push a Python bytes object.

      There are two arguments:  the first is an 8-byte unsigned int giving
      the number of bytes in the string, and the second is that many bytes,
      which are taken literally as the string content.
      Z
BYTEARRAY8�–�z�Push a Python bytearray object.

      There are two arguments:  the first is an 8-byte unsigned int giving
      the number of bytes in the bytearray, and the second is that many bytes,
      which are taken literally as the bytearray content.
      ZNEXT_BUFFER�—z"Push an out-of-band buffer object.ZREADONLY_BUFFER�˜z,Make an out-of-band buffer object read-only.ZNONE�NzPush None on the stack.ZNEWTRUE�ˆzPush True onto the stack.ZNEWFALSE�‰zPush False onto the stack.�UNICODE�Vz�Push a Python Unicode string object.

      The argument is a raw-unicode-escape encoding of a Unicode string,
      and so may contain embedded escape sequences.  The argument extends
      until the next newline character.
      ZSHORT_BINUNICODE�ŒaPush a Python Unicode string object.

      There are two arguments:  the first is a 1-byte little-endian signed int
      giving the number of bytes in the string.  The second is that many
      bytes, and is the UTF-8 encoding of the Unicode string.
      Z
BINUNICODE�XaPush a Python Unicode string object.

      There are two arguments:  the first is a 4-byte little-endian unsigned int
      giving the number of bytes in the string.  The second is that many
      bytes, and is the UTF-8 encoding of the Unicode string.
      ZBINUNICODE8�aPush a Python Unicode string object.

      There are two arguments:  the first is an 8-byte little-endian signed int
      giving the number of bytes in the string.  The second is that many
      bytes, and is the UTF-8 encoding of the Unicode string.
      ZFLOAT�Fa�Newline-terminated decimal float literal.

      The argument is repr(a_float), and in general requires 17 significant
      digits for roundtrip conversion to be an identity (this is so for
      IEEE-754 double precision values, which is what Python float maps to
      on most boxes).

      In general, FLOAT cannot be used to transport infinities, NaNs, or
      minus zero across boxes (or even on a single box, if the platform C
      library can't read the strings it produces for such things -- Windows
      is like that), but may do less damage than BINFLOAT on boxes with
      greater precision or dynamic range than IEEE-754 double.
      ZBINFLOAT�Ga�Float stored in binary form, with 8 bytes of data.

      This generally requires less than half the space of FLOAT encoding.
      In general, BINFLOAT cannot be used to transport infinities, NaNs, or
      minus zero, raises an exception if the exponent exceeds the range of
      an IEEE-754 double, and retains no more than 53 bits of precision (if
      there are more than that, "add a half and chop" rounding is used to
      cut it back to 53 significant bits).
      Z
EMPTY_LIST�]zPush an empty list.ZAPPEND�az�Append an object to a list.

      Stack before:  ... pylist anyobject
      Stack after:   ... pylist+[anyobject]

      although pylist is really extended in-place.
      ZAPPENDS�ez�Extend a list by a slice of stack objects.

      Stack before:  ... pylist markobject stackslice
      Stack after:   ... pylist+stackslice

      although pylist is really extended in-place.
      ZLIST�lasBuild a list out of the topmost stack slice, after markobject.

      All the stack entries following the topmost markobject are placed into
      a single Python list, which single list object replaces all of the
      stack from the topmost markobject onward.  For example,

      Stack before: ... markobject 1 2 3 'abc'
      Stack after:  ... [1, 2, 3, 'abc']
      ZEMPTY_TUPLE�)zPush an empty tuple.ZTUPLE�tavBuild a tuple out of the topmost stack slice, after markobject.

      All the stack entries following the topmost markobject are placed into
      a single Python tuple, which single tuple object replaces all of the
      stack from the topmost markobject onward.  For example,

      Stack before: ... markobject 1 2 3 'abc'
      Stack after:  ... (1, 2, 3, 'abc')
      ZTUPLE1�…z�Build a one-tuple out of the topmost item on the stack.

      This code pops one value off the stack and pushes a tuple of
      length 1 whose one item is that value back onto it.  In other
      words:

          stack[-1] = tuple(stack[-1:])
      ZTUPLE2�†aBuild a two-tuple out of the top two items on the stack.

      This code pops two values off the stack and pushes a tuple of
      length 2 whose items are those values back onto it.  In other
      words:

          stack[-2:] = [tuple(stack[-2:])]
      ZTUPLE3�‡aBuild a three-tuple out of the top three items on the stack.

      This code pops three values off the stack and pushes a tuple of
      length 3 whose items are those values back onto it.  In other
      words:

          stack[-3:] = [tuple(stack[-3:])]
      Z
EMPTY_DICT�}zPush an empty dict.ZDICT�da�Build a dict out of the topmost stack slice, after markobject.

      All the stack entries following the topmost markobject are placed into
      a single Python dict, which single dict object replaces all of the
      stack from the topmost markobject onward.  The stack slice alternates
      key, value, key, value, ....  For example,

      Stack before: ... markobject 1 2 3 'abc'
      Stack after:  ... {1: 2, 3: 'abc'}
      ZSETITEMrkz�Add a key+value pair to an existing dict.

      Stack before:  ... pydict key value
      Stack after:   ... pydict

      where pydict has been modified via pydict[key] = value.
      ZSETITEMS�ua\Add an arbitrary number of key+value pairs to an existing dict.

      The slice of the stack following the topmost markobject is taken as
      an alternating sequence of keys and values, added to the dict
      immediately under the topmost markobject.  Everything at and after the
      topmost markobject is popped, leaving the mutated dict at the top
      of the stack.

      Stack before:  ... pydict markobject key_1 value_1 ... key_n value_n
      Stack after:   ... pydict

      where pydict has been modified via pydict[key_i] = value_i for i in
      1, 2, ..., n, and in that order.
      Z	EMPTY_SET�zPush an empty set.ZADDITEMS�a$Add an arbitrary number of items to an existing set.

      The slice of the stack following the topmost markobject is taken as
      a sequence of items, added to the set immediately under the topmost
      markobject.  Everything at and after the topmost markobject is popped,
      leaving the mutated set at the top of the stack.

      Stack before:  ... pyset markobject item_1 ... item_n
      Stack after:   ... pyset

      where pyset has been modified via pyset.add(item_i) = item_i for i in
      1, 2, ..., n, and in that order.
      Z	FROZENSET�‘azBuild a frozenset out of the topmost slice, after markobject.

      All the stack entries following the topmost markobject are placed into
      a single Python frozenset, which single frozenset object replaces all
      of the stack from the topmost markobject onward.  For example,

      Stack before: ... markobject 1 2 3
      Stack after:  ... frozenset({1, 2, 3})
      �POP�0z<Discard the top stack item, shrinking the stack by one item.ZDUP�2z=Push the top stack item onto the stack again, duplicating it.�MARK�(z�Push markobject onto the stack.

      markobject is a unique object, used by other opcodes to identify a
      region of the stack containing a variable number of objects for them
      to work on.  See markobject.doc for more detail.
      ZPOP_MARK�1aPop all the stack objects at and above the topmost markobject.

      When an opcode using a variable number of stack objects is done,
      POP_MARK is used to remove those objects, and to remove the markobject
      that delimited their starting position on the stack.
      �GET�gz�Read an object from the memo and push it on the stack.

      The index of the memo object to push is given by the newline-terminated
      decimal string following.  BINGET and LONG_BINGET are space-optimized
      versions.
      �BINGET�hz�Read an object from the memo and push it on the stack.

      The index of the memo object to push is given by the 1-byte unsigned
      integer following.
      �LONG_BINGET�jz�Read an object from the memo and push it on the stack.

      The index of the memo object to push is given by the 4-byte unsigned
      little-endian integer following.
      �PUT�pz�Store the stack top into the memo.  The stack is not popped.

      The index of the memo location to write into is given by the newline-
      terminated decimal string following.  BINPUT and LONG_BINPUT are
      space-optimized versions.
      �BINPUTrEz�Store the stack top into the memo.  The stack is not popped.

      The index of the memo location to write into is given by the 1-byte
      unsigned integer following.
      �LONG_BINPUT�rz�Store the stack top into the memo.  The stack is not popped.

      The index of the memo location to write into is given by the 4-byte
      unsigned little-endian integer following.
      �MEMOIZE�”z�Store the stack top into the memo.  The stack is not popped.

      The index of the memo location to write is the number of
      elements currently present in the memo.
      ZEXT1�‚a�Extension code.

      This code and the similar EXT2 and EXT4 allow using a registry
      of popular objects that are pickled by name, typically classes.
      It is envisioned that through a global negotiation and
      registration process, third parties can set up a mapping between
      ints and object names.

      In order to guarantee pickle interchangeability, the extension
      code registry ought to be global, although a range of codes may
      be reserved for private use.

      EXT1 has a 1-byte integer argument.  This is used to index into the
      extension registry, and the object at that index is pushed on the stack.
      ZEXT2�ƒzNExtension code.

      See EXT1.  EXT2 has a two-byte integer argument.
      ZEXT4�„zOExtension code.

      See EXT1.  EXT4 has a four-byte integer argument.
      ZGLOBAL�ca�Push a global object (module.attr) on the stack.

      Two newline-terminated strings follow the GLOBAL opcode.  The first is
      taken as a module name, and the second as a class name.  The class
      object module.class is pushed on the stack.  More accurately, the
      object returned by self.find_class(module, class) is pushed on the
      stack, so unpickling subclasses can override this form of lookup.
      ZSTACK_GLOBAL�“z7Push a global object (module.attr) on the stack.
      ZREDUCE�RaLPush an object built from a callable and an argument tuple.

      The opcode is named to remind of the __reduce__() method.

      Stack before: ... callable pytuple
      Stack after:  ... callable(*pytuple)

      The callable and the argument tuple are the first two items returned
      by a __reduce__ method.  Applying the callable to the argtuple is
      supposed to reproduce the original object, or at least get it started.
      If the __reduce__ method returns a 3-tuple, the last component is an
      argument to be passed to the object's __setstate__, and then the REDUCE
      opcode is followed by code to create setstate's argument, and then a
      BUILD opcode to apply  __setstate__ to that argument.

      If not isinstance(callable, type), REDUCE complains unless the
      callable has been registered with the copyreg module's
      safe_constructors dict, or the callable has a magic
      '__safe_for_unpickling__' attribute with a true value.  I'm not sure
      why it does this, but I've sure seen this complaint often enough when
      I didn't want to <wink>.
      ZBUILD�ba�Finish building an object, via __setstate__ or dict update.

      Stack before: ... anyobject argument
      Stack after:  ... anyobject

      where anyobject may have been mutated, as follows:

      If the object has a __setstate__ method,

          anyobject.__setstate__(argument)

      is called.

      Else the argument must be a dict, the object must have a __dict__, and
      the object is updated via

          anyobject.__dict__.update(argument)
      ZINST�iaqBuild a class instance.

      This is the protocol 0 version of protocol 1's OBJ opcode.
      INST is followed by two newline-terminated strings, giving a
      module and class name, just as for the GLOBAL opcode (and see
      GLOBAL for more details about that).  self.find_class(module, name)
      is used to get a class object.

      In addition, all the objects on the stack following the topmost
      markobject are gathered into a tuple and popped (along with the
      topmost markobject), just as for the TUPLE opcode.

      Now it gets complicated.  If all of these are true:

        + The argtuple is empty (markobject was at the top of the stack
          at the start).

        + The class object does not have a __getinitargs__ attribute.

      then we want to create an old-style class instance without invoking
      its __init__() method (pickle has waffled on this over the years; not
      calling __init__() is current wisdom).  In this case, an instance of
      an old-style dummy class is created, and then we try to rebind its
      __class__ attribute to the desired class object.  If this succeeds,
      the new instance object is pushed on the stack, and we're done.

      Else (the argtuple is not empty, it's not an old-style class object,
      or the class object does have a __getinitargs__ attribute), the code
      first insists that the class object have a __safe_for_unpickling__
      attribute.  Unlike as for the __safe_for_unpickling__ check in REDUCE,
      it doesn't matter whether this attribute has a true or false value, it
      only matters whether it exists (XXX this is a bug).  If
      __safe_for_unpickling__ doesn't exist, UnpicklingError is raised.

      Else (the class object does have a __safe_for_unpickling__ attr),
      the class object obtained from INST's arguments is applied to the
      argtuple obtained from the stack, and the resulting instance object
      is pushed on the stack.

      NOTE:  checks for __safe_for_unpickling__ went away in Python 2.3.
      NOTE:  the distinction between old-style and new-style classes does
             not make sense in Python 3.
      ZOBJ�oa�Build a class instance.

      This is the protocol 1 version of protocol 0's INST opcode, and is
      very much like it.  The major difference is that the class object
      is taken off the stack, allowing it to be retrieved from the memo
      repeatedly if several instances of the same class are created.  This
      can be much more efficient (in both time and space) than repeatedly
      embedding the module and class names in INST opcodes.

      Unlike INST, OBJ takes no arguments from the opcode stream.  Instead
      the class object is taken off the stack, immediately above the
      topmost markobject:

      Stack before: ... markobject classobject stackslice
      Stack after:  ... new_instance_object

      As for INST, the remainder of the stack above the markobject is
      gathered into an argument tuple, and then the logic seems identical,
      except that no __safe_for_unpickling__ check is done (XXX this is
      a bug).  See INST for the gory details.

      NOTE:  In Python 2.3, INST and OBJ are identical except for how they
      get the class object.  That was always the intent; the implementations
      had diverged for accidental reasons.
      ZNEWOBJ�aLBuild an object instance.

      The stack before should be thought of as containing a class
      object followed by an argument tuple (the tuple being the stack
      top).  Call these cls and args.  They are popped off the stack,
      and the value returned by cls.__new__(cls, *args) is pushed back
      onto the stack.
      Z	NEWOBJ_EX�’auBuild an object instance.

      The stack before should be thought of as containing a class
      object followed by an argument tuple and by a keyword argument dict
      (the dict being the stack top).  Call these cls and args.  They are
      popped off the stack, and the value returned by
      cls.__new__(cls, *args, *kwargs) is  pushed back  onto the stack.
      �PROTO�€z�Protocol version indicator.

      For protocol 2 and above, a pickle must start with this opcode.
      The argument is the protocol version, an int in range(2, 256).
      �STOP�.z�Stop the unpickling machine.

      Every pickle ends with this opcode.  The object at the top of the stack
      is popped, and that's the result of unpickling.  The stack should be
      empty then.
      �FRAME�•z�Indicate the beginning of a new frame.

      The unpickler may use this opcode to safely prefetch data from its
      underlying stream.
      ZPERSID�PaPush an object identified by a persistent ID.

      The pickle module doesn't define what a persistent ID means.  PERSID's
      argument is a newline-terminated str-style (no embedded escapes, no
      bracketing quote characters) string, which *is* "the persistent ID".
      The unpickler passes this string to self.persistent_load().  Whatever
      object that returns is pushed on the stack.  There is no implementation
      of persistent_load() in Python's unpickler:  it must be supplied by an
      unpickler subclass.
      Z	BINPERSID�QaXPush an object identified by a persistent ID.

      Like PERSID, except the persistent ID is popped off the stack (instead
      of being a string embedded in the opcode bytestream).  The persistent
      ID is passed to self.persistent_load(), and whatever object that
      returns is pushed on the stack.  See PERSID for more detail.
      z%repeated name %r at indices %d and %dz%repeated code %r at indices %d and %dFcCst��}tjD]�}t�d|�s0|rtd|�qtt|�}t|t	�rPt
|�dkrf|rtd||f�q|�d�}||kr�|r�td||f�||}|j|kr�t
d|||jf��||=qt
d||f��q|�rd	g}|��D]\}}|�d
|j|f�q�t
d�|���dS)Nz[A-Z][A-Z0-9_]+$z0skipping %r: it doesn't look like an opcode namer$z5skipping %r: value %r doesn't look like a pickle coderMz+checking name %r w/ code %r for consistencyzBfor pickle code %r, pickle.py uses name %r but we're using name %rzPpickle.py appears to have a pickle opcode with name %r and code %r, but we don'tz=we appear to have pickle opcodes that pickle.py doesn't have:z    name %r with code %r�
)�code2op�copyr��__all__�re�match�print�getattrrr�r.rCrr&�items�append�join)�verboser�rZ
picklecoder��msgr�rrr�assure_pickle_consistency�sJ

�
�
���r�ccs�t|t�rt�|�}t|d�r&|j}ndd�}|�}|�d�}t�|�	d��}|dkr�|dkrht
d��nt
d|dkrxd	n||f��|jdkr�d}n|j�|�}|r�||||�fVn|||fV|d
kr.|j
dks�t�q�q.dS)N�tellcSsdSr~rrrrr�<lambda>��z_genops.<locals>.<lambda>r$rMr�z#pickle exhausted before seeing STOPz!at position %s, opcode %r unknownz	<unknown>�.r�)r�bytes_types�io�BytesIO�hasattrr�r%r��getrCr&r�rrr)r)�
yield_end_posZgetpos�posr��opcoder�rrr�_genops�s0




�
rcCst|�S)axGenerate all the opcodes in a pickle.

    'pickle' is a file-like object, or string, containing the pickle.

    Each opcode in the pickle is generated, from the current pickle position,
    stopping after a STOP opcode is delivered.  A triple is generated for
    each opcode:

        opcode, arg, pos

    opcode is an OpcodeInfo record, describing the current opcode.

    If the opcode has an argument embedded in the pickle, arg is its decoded
    value, as a Python object.  If the opcode doesn't have an argument, arg
    is None.

    If the pickle has a tell() method, pos was the value of pickle.tell()
    before reading the current opcode.  If the pickle is a bytes object,
    it's wrapped in a BytesIO object, and the latter's tell() result is
    used.  Else (the pickle doesn't have a tell(), and it's not obvious how
    to query its current position) pos is None.
    )r)r�rrrr�scCsd}d}t�}i}g}d}d}t|dd�D]�\}}	}
}d|jkrZ|�|	�|�||	f�q*|jdkr�t|�}|�|�|�||f�q*d|jkr�q*d|jkr�|j|kr�|j}d	||	<|�||	f�q*|jd
k�r|	|kr�|	}|
dkr�||
|�}n|�|
|f�q*|�|
|f�q*~t��}
|
�	|�t
�|
|�}|dk�rF|j�
�d}|D]�\}}	d}||k�r�|	|k�rr�qN|�|�}|||	<|d
7}n6||k�r�|�||	�}n|||	�}t|�|jjk}|jj|d�|�r�|j�|�n
|�	|��qN|j��|
��S)z7Optimize a pickle string by removing unused PUT opcodesr�r�rr�T)r�r�r�Nr�r2Fr$)Zforce)r�rr�addr�r.r�r�r��writer�Z_PicklerZframerZ
start_framing�putr�Z_FRAME_SIZE_TARGETZcommit_frameZ
file_writeZend_framing�getvalue)r�rr�ZoldidsZnewids�opcodesr�Zprotoheaderrr�rZend_pos�idx�outZpickler�opZ	framelessr)rrrr	sl















c	Csng}|dkri}d}g}d|}d}	|}
t|�D�]\}}}
|
dk	rVtd|
d|d�dt|j�dd�|t|�|jf}t||j�}|j}|j	}t|�}d}t
|ks�|jdk�rx|�rx|dt
k�rxt
|ks�t�t
|kr�|dtks�t�|�rp|�
�}|dk�r
d	}nd
|}|dt
k	�r,|�
��q|�
�z|�t
�}Wn*tk
�rl|jdk�sdt�d}YnXnd}	}|jd
k�r�|jdk�r�t|�}d|}n|dk	�s�t�|}||k�r�d|}	n,|�s�d}	n |dt
k�r�d}	n|d||<n<|jdk�r2||k�r*t|�dk�st�||g}nd|}	|dk	�sB|�r�|ddt|j�7}|dk	�rr|dt|�7}|�r�|d|7}|�r�|d|
t|�7}t|�}
|
dk�r�|}
|d|j�dd�d7}t||d�|	�r�t|	��t|�|k�r
td|t|�f��|�r||d�=t
|k�r>t
|k�s4t�|�|
�|�|�q0td||d�|�rjtd|��dS)aKProduce a symbolic disassembly of a pickle.

    'pickle' is a file-like object, or string, containing a (at least one)
    pickle.  The pickle is disassembled from the current position, through
    the first STOP opcode encountered.

    Optional arg 'out' is a file-like object to which the disassembly is
    printed.  It defaults to sys.stdout.

    Optional arg 'memo' is a Python dict, used as the pickle's memo.  It
    may be mutated by dis(), if the pickle contains PUT or BINPUT opcodes.
    Passing the same memo object to another dis() call then allows disassembly
    to proceed across multiple pickles that were all created by the same
    pickler with the same memo.  Ordinarily you don't need to worry about this.

    Optional arg 'indentlevel' is the number of blanks by which to indent
    a new MARK level.  It defaults to 4.

    Optional arg 'annotate' if nonzero instructs dis() to add short
    description of the opcode on each line of disassembled output.
    The value given to 'annotate' must be an integer and is used as a
    hint for the column where annotation should start.  The default
    value is 0, meaning no annotations.

    In addition to printing the disassembly, some sanity checks are made:

    + All embedded opcode arguments "make sense".

    + Explicit and implicit pop operations have enough items on the stack.

    + When an opcode implicitly refers to a markobject, a markobject is
      actually on the stack.

    + A memo entry isn't referenced before it's defined.

    + The markobject isn't stored in the memo.

    + A memo entry isn't redefined.
    Nr� z%5d:)�end�filez	%-4s %s%sr$r�z(MARK at unknown opcode offset)z(MARK at %d)rzno MARK exists on stack)r�r�r�r�r�z(as %d)zmemo key %r already definedz'stack is empty -- can't store into memoz"can't store markobject in the memo)r�r�r�z&memo key %r has never been stored into�
�2r�)r
z3tries to pop %d items from stack with only %d itemsz highest protocol among opcodes =zstack not empty after STOP: %r)rr��reprr�r.r�maxr�r�r��
markobjectrr��pop�indexr&r�splitr��extend)r�r	�memo�indentlevel�annotate�stackZmaxprotoZ	markstackZindentchunkZerrormsgZannocolrr�r�lineZbeforeZafterZnumtopopZmarkmsgZmarkposZmemo_idxrrrr[	s�-
��
�







�

c@seZdZdd�ZdS)�_ExamplecCs
||_dSr~)�value)rrrrrr�	sz_Example.__init__N)rr r!rrrrrr�	sra�
>>> import pickle
>>> x = [1, 2, (3, 4), {b'abc': "def"}]
>>> pkl0 = pickle.dumps(x, 0)
>>> dis(pkl0)
    0: (    MARK
    1: l        LIST       (MARK at 0)
    2: p    PUT        0
    5: I    INT        1
    8: a    APPEND
    9: I    INT        2
   12: a    APPEND
   13: (    MARK
   14: I        INT        3
   17: I        INT        4
   20: t        TUPLE      (MARK at 13)
   21: p    PUT        1
   24: a    APPEND
   25: (    MARK
   26: d        DICT       (MARK at 25)
   27: p    PUT        2
   30: c    GLOBAL     '_codecs encode'
   46: p    PUT        3
   49: (    MARK
   50: V        UNICODE    'abc'
   55: p        PUT        4
   58: V        UNICODE    'latin1'
   66: p        PUT        5
   69: t        TUPLE      (MARK at 49)
   70: p    PUT        6
   73: R    REDUCE
   74: p    PUT        7
   77: V    UNICODE    'def'
   82: p    PUT        8
   85: s    SETITEM
   86: a    APPEND
   87: .    STOP
highest protocol among opcodes = 0

Try again with a "binary" pickle.

>>> pkl1 = pickle.dumps(x, 1)
>>> dis(pkl1)
    0: ]    EMPTY_LIST
    1: q    BINPUT     0
    3: (    MARK
    4: K        BININT1    1
    6: K        BININT1    2
    8: (        MARK
    9: K            BININT1    3
   11: K            BININT1    4
   13: t            TUPLE      (MARK at 8)
   14: q        BINPUT     1
   16: }        EMPTY_DICT
   17: q        BINPUT     2
   19: c        GLOBAL     '_codecs encode'
   35: q        BINPUT     3
   37: (        MARK
   38: X            BINUNICODE 'abc'
   46: q            BINPUT     4
   48: X            BINUNICODE 'latin1'
   59: q            BINPUT     5
   61: t            TUPLE      (MARK at 37)
   62: q        BINPUT     6
   64: R        REDUCE
   65: q        BINPUT     7
   67: X        BINUNICODE 'def'
   75: q        BINPUT     8
   77: s        SETITEM
   78: e        APPENDS    (MARK at 3)
   79: .    STOP
highest protocol among opcodes = 1

Exercise the INST/OBJ/BUILD family.

>>> import pickletools
>>> dis(pickle.dumps(pickletools.dis, 0))
    0: c    GLOBAL     'pickletools dis'
   17: p    PUT        0
   20: .    STOP
highest protocol among opcodes = 0

>>> from pickletools import _Example
>>> x = [_Example(42)] * 2
>>> dis(pickle.dumps(x, 0))
    0: (    MARK
    1: l        LIST       (MARK at 0)
    2: p    PUT        0
    5: c    GLOBAL     'copy_reg _reconstructor'
   30: p    PUT        1
   33: (    MARK
   34: c        GLOBAL     'pickletools _Example'
   56: p        PUT        2
   59: c        GLOBAL     '__builtin__ object'
   79: p        PUT        3
   82: N        NONE
   83: t        TUPLE      (MARK at 33)
   84: p    PUT        4
   87: R    REDUCE
   88: p    PUT        5
   91: (    MARK
   92: d        DICT       (MARK at 91)
   93: p    PUT        6
   96: V    UNICODE    'value'
  103: p    PUT        7
  106: I    INT        42
  110: s    SETITEM
  111: b    BUILD
  112: a    APPEND
  113: g    GET        5
  116: a    APPEND
  117: .    STOP
highest protocol among opcodes = 0

>>> dis(pickle.dumps(x, 1))
    0: ]    EMPTY_LIST
    1: q    BINPUT     0
    3: (    MARK
    4: c        GLOBAL     'copy_reg _reconstructor'
   29: q        BINPUT     1
   31: (        MARK
   32: c            GLOBAL     'pickletools _Example'
   54: q            BINPUT     2
   56: c            GLOBAL     '__builtin__ object'
   76: q            BINPUT     3
   78: N            NONE
   79: t            TUPLE      (MARK at 31)
   80: q        BINPUT     4
   82: R        REDUCE
   83: q        BINPUT     5
   85: }        EMPTY_DICT
   86: q        BINPUT     6
   88: X        BINUNICODE 'value'
   98: q        BINPUT     7
  100: K        BININT1    42
  102: s        SETITEM
  103: b        BUILD
  104: h        BINGET     5
  106: e        APPENDS    (MARK at 3)
  107: .    STOP
highest protocol among opcodes = 1

Try "the canonical" recursive-object test.

>>> L = []
>>> T = L,
>>> L.append(T)
>>> L[0] is T
True
>>> T[0] is L
True
>>> L[0][0] is L
True
>>> T[0][0] is T
True
>>> dis(pickle.dumps(L, 0))
    0: (    MARK
    1: l        LIST       (MARK at 0)
    2: p    PUT        0
    5: (    MARK
    6: g        GET        0
    9: t        TUPLE      (MARK at 5)
   10: p    PUT        1
   13: a    APPEND
   14: .    STOP
highest protocol among opcodes = 0

>>> dis(pickle.dumps(L, 1))
    0: ]    EMPTY_LIST
    1: q    BINPUT     0
    3: (    MARK
    4: h        BINGET     0
    6: t        TUPLE      (MARK at 3)
    7: q    BINPUT     1
    9: a    APPEND
   10: .    STOP
highest protocol among opcodes = 1

Note that, in the protocol 0 pickle of the recursive tuple, the disassembler
has to emulate the stack in order to realize that the POP opcode at 16 gets
rid of the MARK at 0.

>>> dis(pickle.dumps(T, 0))
    0: (    MARK
    1: (        MARK
    2: l            LIST       (MARK at 1)
    3: p        PUT        0
    6: (        MARK
    7: g            GET        0
   10: t            TUPLE      (MARK at 6)
   11: p        PUT        1
   14: a        APPEND
   15: 0        POP
   16: 0        POP        (MARK at 0)
   17: g    GET        1
   20: .    STOP
highest protocol among opcodes = 0

>>> dis(pickle.dumps(T, 1))
    0: (    MARK
    1: ]        EMPTY_LIST
    2: q        BINPUT     0
    4: (        MARK
    5: h            BINGET     0
    7: t            TUPLE      (MARK at 4)
    8: q        BINPUT     1
   10: a        APPEND
   11: 1        POP_MARK   (MARK at 0)
   12: h    BINGET     1
   14: .    STOP
highest protocol among opcodes = 1

Try protocol 2.

>>> dis(pickle.dumps(L, 2))
    0: \x80 PROTO      2
    2: ]    EMPTY_LIST
    3: q    BINPUT     0
    5: h    BINGET     0
    7: \x85 TUPLE1
    8: q    BINPUT     1
   10: a    APPEND
   11: .    STOP
highest protocol among opcodes = 2

>>> dis(pickle.dumps(T, 2))
    0: \x80 PROTO      2
    2: ]    EMPTY_LIST
    3: q    BINPUT     0
    5: h    BINGET     0
    7: \x85 TUPLE1
    8: q    BINPUT     1
   10: a    APPEND
   11: 0    POP
   12: h    BINGET     1
   14: .    STOP
highest protocol among opcodes = 2

Try protocol 3 with annotations:

>>> dis(pickle.dumps(T, 3), annotate=1)
    0: \x80 PROTO      3 Protocol version indicator.
    2: ]    EMPTY_LIST   Push an empty list.
    3: q    BINPUT     0 Store the stack top into the memo.  The stack is not popped.
    5: h    BINGET     0 Read an object from the memo and push it on the stack.
    7: \x85 TUPLE1       Build a one-tuple out of the topmost item on the stack.
    8: q    BINPUT     1 Store the stack top into the memo.  The stack is not popped.
   10: a    APPEND       Append an object to a list.
   11: 0    POP          Discard the top stack item, shrinking the stack by one item.
   12: h    BINGET     1 Read an object from the memo and push it on the stack.
   14: .    STOP         Stop the unpickling machine.
highest protocol among opcodes = 2

a=
>>> import pickle
>>> import io
>>> f = io.BytesIO()
>>> p = pickle.Pickler(f, 2)
>>> x = [1, 2, 3]
>>> p.dump(x)
>>> p.dump(x)
>>> f.seek(0)
0
>>> memo = {}
>>> dis(f, memo=memo)
    0: \x80 PROTO      2
    2: ]    EMPTY_LIST
    3: q    BINPUT     0
    5: (    MARK
    6: K        BININT1    1
    8: K        BININT1    2
   10: K        BININT1    3
   12: e        APPENDS    (MARK at 5)
   13: .    STOP
highest protocol among opcodes = 2
>>> dis(f, memo=memo)
   14: \x80 PROTO      2
   16: h    BINGET     0
   18: .    STOP
highest protocol among opcodes = 2
)Zdisassembler_testZdisassembler_memo_testcCsddl}|��Sr)�doctestZtestmod)rrrr�_testsr�__main__z$disassemble one or more pickle files)Zdescription�pickle_file�br�*zthe pickle file)r�nargs�helpz-oz--output�wz+the file where the output should be written)�defaultrr%z-mz--memo�
store_truez#preserve memo between disassemblies)�actionr%z-lz
--indentlevelz8the number of blanks by which to indent a new MARK levelz-az
--annotatez2annotate each line with a short opcode descriptionz-pz
--preamblez==> {name} <==zMif more than one pickle file is specified, print this before each disassembly)r'r%z-tz--testzrun self-test suitez-vz)run verbosely; only affects self-test run�r�r�)TT)F)F)NNr2r)��__doc__rAr�r�r�rUr�r�rrrrr�objectr
Zstructr#r/r*r+r0r1r3r4r5r6r8r9rFrGrIrJrKrLrOrPrQrRrSrTrWrXrYrZr\r]r^r_rbrcrdrerfrgrlrnrorprrrsrtrurvrwrxryrzr{rZpyintZpylongr�Zpyinteger_or_boolZpyboolrqZpyfloatr�rZpybytes_or_strZpystringZpybytesr[ZpybytearrayZ	pyunicoderZpynoner�Zpytupler�Zpylistr�Zpydictr�ZpysetZpyfrozensetZpybufferZ	anyobjectrr�r�r�rZname2iZcode2i�	enumerater�r�rr&r�r�r�rrrrrZ	_dis_testZ
_memo_testZ__test__rr�argparse�ArgumentParser�parser�add_argumentZFileType�stdout�
parse_args�argsZtestrr!Z
print_helpr.�outputrrr(Zpreamble�formatrrrrr�<module>s`
$�����/�
�	�������
��
�
�
�
�	�
����
����
�������������;����
���
����
�
����
���
�
�
�
����������������������
��
���
�����������2� ������������������
& 

C��
�
�������
�
__pycache__/tempfile.cpython-38.pyc000064400000055547151153537550013243 0ustar00U

e5d�k�
@s�dZddddddddd	d
ddd
g
ZddlZddlZddlZddlZ	ddl
ZddlZ
ddlmZddlZddlZddlZejZe	je	jBe	jBZee	d�r�ee	jOZeZee	d�r�ee	jOZee	d�r�e	j Z ndZ dZ!e�Z"dd�Z#dd�Z$dd�Z%Gdd�d�Z&dd�Z'dd �Z(da)d!d"�Z*d#d$�Z+d%d	�Z,d&d�Z-da.d'd�Z/d(d
�Z0d=d*d�Z1d>d+d�Z2d,e!dfd-d�Z3Gd.d/�d/�Z4Gd0d1�d1�Z5d?dd5�d6d�Z6e	j7d7k�s�ej8d8k�r�e6Z9nee	d9�a:d@dd5�d:d�Z9Gd;d�d�Z;Gd<d�de<�Z=dS)Aa�Temporary files.

This module provides generic, low- and high-level interfaces for
creating temporary files and directories.  All of the interfaces
provided by this module can be used without fear of race conditions
except for 'mktemp'.  'mktemp' is subject to race conditions and
should not be used; it is provided for backward compatibility only.

The default path names are returned as str.  If you supply bytes as
input, all return values will be in bytes.  Ex:

    >>> tempfile.mkstemp()
    (4, '/tmp/tmptpu9nin8')
    >>> tempfile.mkdtemp(suffix=b'')
    b'/tmp/tmppbi8f0hy'

This module also provides some data items to the user:

  TMP_MAX  - maximum number of names that will be tried before
             giving up.
  tempdir  - If this is set to a string before the first use of
             any routine from this module, it will be considered as
             another candidate location to store temporary files.
�NamedTemporaryFile�
TemporaryFile�SpooledTemporaryFile�TemporaryDirectory�mkstemp�mkdtemp�mktemp�TMP_MAX�
gettempprefix�tempdir�
gettempdir�gettempprefixb�gettempdirb�N)�Random�
O_NOFOLLOW�O_BINARYi'ZtmpcCs.zt�|�Wntk
r$YdSXdSdS)NFT)�_os�lstat�OSError)�fn�r� /usr/lib64/python3.8/tempfile.py�_existsKs
rcGs\d}|D]B}|dkrqt|t�r6|tkr0td��t}q|tkrFtd��t}q|dkrXtS|S)zBLook at the type of all args and divine their implied return type.Nz1Can't mix bytes and non-bytes in path components.)�
isinstance�bytes�str�	TypeError)�argsZreturn_type�argrrr�_infer_return_typeTs
rcCsdt|||�}|dkr|�}|dkr:|tkr0t}n
t�t�}|dkrX|tkrRt�}nt�}||||fS)z9Common parameter processing for most APIs in this module.N)rr�templater�fsencoderr
)�prefix�suffix�dir�output_typerrr�_sanitize_paramsis
r&c@s0eZdZdZdZedd��Zdd�Zdd�Zd	S)
�_RandomNameSequencea,An instance of _RandomNameSequence generates an endless
    sequence of unpredictable strings which can safely be incorporated
    into file names.  Each string is eight characters long.  Multiple
    threads can safely use the same instance at the same time.

    _RandomNameSequence is an iterator.Z%abcdefghijklmnopqrstuvwxyz0123456789_cCs,t��}|t|dd�kr&t�|_||_|jS)N�_rng_pid)r�getpid�getattr�_RandomZ_rngr()�selfZcur_pidrrr�rng�s
z_RandomNameSequence.rngcCs|S�Nr�r,rrr�__iter__�sz_RandomNameSequence.__iter__cs0|j�|jj���fdd�td�D�}d�|�S)Ncsg|]}����qSrr)�.0Zdummy��cZchooserr�
<listcomp>�sz0_RandomNameSequence.__next__.<locals>.<listcomp>��)�
charactersr-Zchoice�range�join)r,Zlettersrr2r�__next__�sz_RandomNameSequence.__next__N)	�__name__�
__module__�__qualname__�__doc__r7�propertyr-r0r:rrrrr'{s
r'c	Cs�g}dD]}t�|�}|r|�|�qtjdkrX|�tj�d�tj�d�ddddg�n|�d	d
dg�z|�t���Wn$t	t
fk
r�|�tj�YnX|S)z[Generate a list of candidate temporary directories which
    _get_default_tempdir will try.)ZTMPDIRZTEMPZTMP�ntz~\AppData\Local\Tempz%SYSTEMROOT%\Tempzc:\tempzc:\tmpz\tempz\tmpz/tmpz/var/tmpz/usr/tmp)r�getenv�append�name�extend�path�
expanduser�
expandvars�getcwd�AttributeErrorr�curdir)�dirlistZenvname�dirnamerrr�_candidate_tempdir_list�s&


�rMcCsFt�}t�}|D�]}|tjkr,tj�|�}td�D�]�}t|�}tj�||�}zft�	|t
d�}z<z*t
j	|ddd��}|�d�W5QRXW5t�|�XW5t�|�X|WStk
r�Yq4tk
�rtjdk�rtj�|��rt�|tj��rYq4YqYq4tk
�r,YqYq4Xq4qttjd|��d	S)
aqCalculate the default directory to use for temporary files.
    This routine should be called exactly once.

    We determine whether or not a candidate temp dir is usable by
    trying to create and write to a file in that directory.  If this
    is successful, the test file is deleted.  To prevent denial of
    service, the name of the test file must be randomized.�d��wbF)�closefdsblatr@z)No usable temporary directory found in %sN)r'rMrrJrE�abspathr8�nextr9�open�_bin_openflags�unlink�close�_io�write�FileExistsError�PermissionErrorrC�isdir�access�W_OKr�FileNotFoundError�_errnoZENOENT)ZnamerrKr$�seqrC�filename�fd�fprrr�_get_default_tempdir�s@	

�
��recCs2tdkr.t��ztdkr t�aW5t��XtS)z7Common setup sequence for all user-callable interfaces.N)�_name_sequence�
_once_lock�acquire�releaser'rrrr�_get_candidate_names�s

rjc
	Cs�t�}|tkrttj|�}tt�D]�}t|�}tj�	||||�}t
�d|�zt�||d�}	WnVt
k
rzYq"Yn@tk
r�tjdkr�tj�|�r�t�|tj�r�Yq"n�YnX|	tj�|�fSt
tjd��dS)z>Code common to mkstemp, TemporaryFile, and NamedTemporaryFile.ztempfile.mkstemprOr@z#No usable temporary file name foundN)rjr�maprr!r8rrSrEr9�_sys�auditrTrZr[rCr\r]r^rRr`�EEXIST)
r$ZpreZsuf�flagsr%�namesrarC�filercrrr�_mkstemp_inner�s*��rrcCstS)z-The default prefix for temporary directories.)r rrrrr	
scCst�t��S)z6The default prefix for temporary directories as bytes.)rr!r	rrrrrscCs2tdkr.t��ztdkr t�aW5t��XtS)zAccessor for tempfile.tempdir.N)r
rgrhrirerrrrrs

cCst�t��S)z)A bytes version of tempfile.gettempdir().)rr!rrrrrr
#sFcCs2t|||�\}}}}|rt}nt}t|||||�S)a�User-callable function to create and return a unique temporary
    file.  The return value is a pair (fd, name) where fd is the
    file descriptor returned by os.open, and name is the filename.

    If 'suffix' is not None, the file name will end with that suffix,
    otherwise there will be no suffix.

    If 'prefix' is not None, the file name will begin with that prefix,
    otherwise a default prefix is used.

    If 'dir' is not None, the file will be created in that directory,
    otherwise a default directory is used.

    If 'text' is specified and true, the file is opened in text
    mode.  Else (the default) the file is opened in binary mode.

    If any of 'suffix', 'prefix' and 'dir' are not None, they must be the
    same type.  If they are bytes, the returned name will be bytes; str
    otherwise.

    The file is readable and writable only by the creating user ID.
    If the operating system uses permission bits to indicate whether a
    file is executable, the file is executable by no one. The file
    descriptor is not inherited by children of this process.

    Caller is responsible for deleting the file when done with it.
    )r&�_text_openflagsrUrr)r#r"r$�textr%rorrrr's
c	Cs�t|||�\}}}}t�}|tkr.ttj|�}tt�D]�}t|�}tj	�
||||�}t�d|�zt�
|d�WnVtk
r�Yq6Yn@tk
r�tjdkr�tj	�|�r�t�|tj�r�Yq6n�YnX|Sttjd��dS)aUser-callable function to create and return a unique temporary
    directory.  The return value is the pathname of the directory.

    Arguments are as for mkstemp, except that the 'text' argument is
    not accepted.

    The directory is readable, writable, and searchable only by the
    creating user.

    Caller is responsible for deleting the directory when done with it.
    ztempfile.mkdtemp�r@z(No usable temporary directory name foundN)r&rjrrkrr!r8rrSrEr9rlrm�mkdirrZr[rCr\r]r^r`rn)r#r"r$r%rprarCrqrrrrNs,
��r6cCs`|dkrt�}t�}tt�D]2}t|�}tj�||||�}t|�s|Sqt	t
jd��dS)a�User-callable function to return a unique temporary file name.  The
    file is not created.

    Arguments are similar to mkstemp, except that the 'text' argument is
    not accepted, and suffix=None, prefix=None and bytes file names are not
    supported.

    THIS FUNCTION IS UNSAFE AND SHOULD NOT BE USED.  The file name may
    refer to a file that did not exist at some point, but by the time
    you get around to creating it, someone else may have beaten you to
    the punch.
    Nz"No usable temporary filename found)rrjr8rrSrrEr9rrZr`rn)r#r"r$rprarCrqrrrrvs
�c@sLeZdZdZdZdZd
dd�Zejdkr@ej	fdd	�Z
d
d�Zndd	�Z
dS)�_TemporaryFileCloserz�A separate object allowing proper closing of a temporary file's
    underlying file object, without adding a __del__ method to the
    temporary file.NFTcCs||_||_||_dSr.)rqrC�delete�r,rqrCrxrrr�__init__�sz_TemporaryFileCloser.__init__r@cCs<|js8|jdk	r8d|_z|j��W5|jr6||j�XdS�NT)�close_calledrqrxrCrW)r,rVrrrrW�sz_TemporaryFileCloser.closecCs|��dSr.)rWr/rrr�__del__�sz_TemporaryFileCloser.__del__cCs|jsd|_|j��dSr{)r|rqrWr/rrrrW�s)T)r;r<r=r>rqr|rzrrCrVrWr}rrrrrw�s



rwc@sBeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�_TemporaryFileWrapperz�Temporary file wrapper

    This class provides a wrapper around files opened for
    temporary use.  In particular, it seeks to automatically
    remove the file when it is no longer needed.
    TcCs$||_||_||_t|||�|_dSr.)rqrCrxrw�_closerryrrrrz�sz_TemporaryFileWrapper.__init__cs^|jd}t||�}t|d�rD|�t����fdd��}|j|_|}t|t�sZt|||�|S)Nrq�__call__cs
�||�Sr.r)r�kwargs��funcrr�func_wrapper�sz7_TemporaryFileWrapper.__getattr__.<locals>.func_wrapper)	�__dict__r*�hasattr�
_functools�wrapsrr�int�setattr)r,rCrq�ar�rr�r�__getattr__�s



z!_TemporaryFileWrapper.__getattr__cCs|j��|Sr.)rq�	__enter__r/rrrr��s
z_TemporaryFileWrapper.__enter__cCs|j�|||�}|��|Sr.)rq�__exit__rW)r,�exc�value�tb�resultrrrr��sz_TemporaryFileWrapper.__exit__cCs|j��dS)zA
        Close the temporary file, possibly deleting it.
        N)rrWr/rrrrW�sz_TemporaryFileWrapper.closeccs|jD]
}|VqdSr.)rq)r,�linerrrr0�s
z_TemporaryFileWrapper.__iter__N)T)
r;r<r=r>rzr�r�r�rWr0rrrrr~�s
r~�w+b���T��errorscCs�t|||�\}}}}	t}
tjdkr0|r0|
tjO}
t||||
|	�\}}z$tj||||||d�}
t|
||�WSt	k
r�t�
|�t�|��YnXdS)a�Create and return a temporary file.
    Arguments:
    'prefix', 'suffix', 'dir' -- as for mkstemp.
    'mode' -- the mode argument to io.open (default "w+b").
    'buffering' -- the buffer size argument to io.open (default -1).
    'encoding' -- the encoding argument to io.open (default None)
    'newline' -- the newline argument to io.open (default None)
    'delete' -- whether the file is deleted on close (default True).
    'errors' -- the errors argument to io.open (default None)
    The file is created as mkstemp() would do it.

    Returns an object with a file-like interface; the name of the file
    is accessible as its 'name' attribute.  The file will be automatically
    deleted when it is closed unless the 'delete' argument is set to False.
    r@��	buffering�newline�encodingr�N)r&rUrrCZO_TEMPORARYrrrXrTr~�
BaseExceptionrVrW)�moder�r�r�r#r"r$rxr�r%rorcrCrqrrrrs 

�

�posix�cygwin�	O_TMPFILEc
Cs�t|||�\}}}}t}	tr�z$|	tjBtj@}
t�||
d�}Wn*tk
rXdaYnFtk
rjYn4Xzt	j||||||d�WSt�
|��YnXt||||	|�\}}z"t�|�t	j||||||d�WSt�
|��YnXdS)a�Create and return a temporary file.
        Arguments:
        'prefix', 'suffix', 'dir' -- as for mkstemp.
        'mode' -- the mode argument to io.open (default "w+b").
        'buffering' -- the buffer size argument to io.open (default -1).
        'encoding' -- the encoding argument to io.open (default None)
        'newline' -- the newline argument to io.open (default None)
        'errors' -- the errors argument to io.open (default None)
        The file is created as mkstemp() would do it.

        Returns an object with a file-like interface.  The file has no
        name, and will cease to exist when it is closed.
        rOFr�N)
r&rU�_O_TMPFILE_WORKSrr��O_CREATrT�IsADirectoryErrorrrXrWrrrV)
r�r�r�r�r#r"r$r�r%roZflags2rcrCrrrr2s<
�


�
c@seZdZdZdZd:dd�dd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�Zedd��Z
edd��Zedd��Zdd�Zdd�Zd d!�Zed"d#��Zed$d%��Zed&d'��Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zed0d1��Zd2d3�Zd;d4d5�Zd6d7�Zd8d9�ZdS)<rz�Temporary file wrapper, specialized to switch from BytesIO
    or StringIO to a real file when it exceeds a certain size or
    when a fileno is needed.
    Frr�r�Nr�c	
	CsTd|krt��|_ntjt��||	|d�|_||_d|_||||||||	d�|_dS)N�b)r�r�r�F)r�r�r#r"r�r�r$r�)rX�BytesIO�_file�
TextIOWrapper�	_max_size�_rolled�_TemporaryFileArgs)
r,�max_sizer�r�r�r�r#r"r$r�rrrrzus"
��zSpooledTemporaryFile.__init__cCs,|jr
dS|j}|r(|��|kr(|��dSr.)r�r��tell�rollover)r,rqr�rrr�_check�s
zSpooledTemporaryFile._checkcCsr|jr
dS|j}tf|j�}|_|`|��}t|d�rN|j�|���	��n|�|�	��|�
|d�d|_dS)N�bufferrT)r�r�rr�r�r�r�rY�detach�getvalue�seek)r,rqZnewfile�posrrrr��s
zSpooledTemporaryFile.rollovercCs|jjrtd��|S)Nz%Cannot enter context with closed file)r��closed�
ValueErrorr/rrrr��szSpooledTemporaryFile.__enter__cCs|j��dSr.�r�rW�r,r�r�r�rrrr��szSpooledTemporaryFile.__exit__cCs
|j��Sr.)r�r0r/rrrr0�szSpooledTemporaryFile.__iter__cCs|j��dSr.r�r/rrrrW�szSpooledTemporaryFile.closecCs|jjSr.)r�r�r/rrrr��szSpooledTemporaryFile.closedcCs|jjSr.)r�r�r/rrrr��szSpooledTemporaryFile.encodingcCs|jjSr.)r�r�r/rrrr��szSpooledTemporaryFile.errorscCs|��|j��Sr.)r�r��filenor/rrrr��szSpooledTemporaryFile.filenocCs|j��dSr.)r��flushr/rrrr��szSpooledTemporaryFile.flushcCs
|j��Sr.)r��isattyr/rrrr��szSpooledTemporaryFile.isattycCs.z
|jjWStk
r(|jdYSXdS)Nr�)r�r�rIr�r/rrrr��s
zSpooledTemporaryFile.modecCs&z
|jjWStk
r YdSXdSr.)r�rCrIr/rrrrC�s
zSpooledTemporaryFile.namecCs|jjSr.)r��newlinesr/rrrr��szSpooledTemporaryFile.newlinescGs|jj|�Sr.)r��read�r,rrrrr��szSpooledTemporaryFile.readcGs|jj|�Sr.)r��readliner�rrrr��szSpooledTemporaryFile.readlinecGs|jj|�Sr.)r��	readlinesr�rrrr��szSpooledTemporaryFile.readlinescGs|jj|�Sr.)r�r�r�rrrr��szSpooledTemporaryFile.seekcCs|jjSr.)r��	softspacer/rrrr��szSpooledTemporaryFile.softspacecCs
|j��Sr.)r�r�r/rrrr��szSpooledTemporaryFile.tellcCs6|dkr|j��n||jkr&|��|j�|�dSr.)r��truncater�r�)r,�sizerrrr��s

zSpooledTemporaryFile.truncatecCs|j}|�|�}|�|�|Sr.)r�rYr�)r,�srq�rvrrrrY�s

zSpooledTemporaryFile.writecCs|j}|�|�}|�|�|Sr.)r��
writelinesr�)r,�iterablerqr�rrrr��s

zSpooledTemporaryFile.writelines)rr�r�NNNNN)N)r;r<r=r>r�rzr�r�r�r�r0rWr?r�r�r�r�r�r�r�rCr�r�r�r�r�r�r�r�rYr�rrrrrnsT��







c@sReZdZdZddd�Zedd��Zedd��Zd	d
�Zdd�Z	d
d�Z
dd�ZdS)ra+Create and return a temporary directory.  This has the same
    behavior as mkdtemp but can be used as a context manager.  For
    example:

        with TemporaryDirectory() as tmpdir:
            ...

    Upon exiting the context, the directory and everything contained
    in it are removed.
    NcCs0t|||�|_tj||j|jd�|�d�|_dS)NzImplicitly cleaning up {!r})�warn_message)rrC�_weakrefZfinalize�_cleanup�format�
_finalizer)r,r#r"r$rrrrzs�zTemporaryDirectory.__init__cs ��fdd�}tj�|d�dS)Nc	s�t|dt�r�dd�}zV|�kr0|tj�|��||�zt�|�Wn"ttfk
rh��|�YnXWq�tk
r�Yq�Xnt|dt�r�n�dS)NrcSs6zt�|d�Wntk
r$YnXt�|d�dS)Nrru)rZchflagsrI�chmod)rErrr�
resetpermss
z?TemporaryDirectory._rmtree.<locals>.onerror.<locals>.resetperms)	�
issubclassr[rrErLrVr��_rmtreer_)r�rE�exc_infor���clsrCrr�onerrorsz+TemporaryDirectory._rmtree.<locals>.onerror)r�)�_shutilZrmtree)r�rCr�rr�rr�szTemporaryDirectory._rmtreecCs|�|�t�|t�dSr.)r��	_warnings�warn�ResourceWarning)r�rCr�rrrr�/s
zTemporaryDirectory._cleanupcCsd�|jj|j�S)Nz	<{} {!r}>)r��	__class__r;rCr/rrr�__repr__4szTemporaryDirectory.__repr__cCs|jSr.)rCr/rrrr�7szTemporaryDirectory.__enter__cCs|��dSr.)�cleanupr�rrrr�:szTemporaryDirectory.__exit__cCs|j��r|�|j�dSr.)r�r�r�rCr/rrrr�=s
zTemporaryDirectory.cleanup)NNN)r;r<r=r>rz�classmethodr�r�r�r�r�r�rrrrr�s


)NNNF)NNN)r�r�NNNNNT)r�r�NNNNN)>r>�__all__�	functoolsr��warningsr��iorX�osrZshutilr��errnor`Zrandomrr+�sysrl�weakrefr��_thread�
allocate_lockZ_allocate_lock�O_RDWRr��O_EXCLrsr�rrUrrr rgrrr&r'rMrerfrjrrr	rr
rr
rrrrwr~rrC�platformrr�r�objectrrrrr�<module>s��





	-
'
( +?��'
��<__pycache__/weakref.cpython-38.pyc000064400000046100151153537550013043 0ustar00U

e5d�S�
@s�dZddlmZmZmZmZmZmZmZm	Z	ddl
mZmZddl
Z
ddlZddlZeefZddddd	d
ddd
ddddg
ZGdd�de�ZGdd�de
j�ZGdd�de�ZGdd	�d	e
j�ZGdd�d�ZdS)z{Weak reference support for Python.

This module is an implementation of PEP 205:

http://www.python.org/dev/peps/pep-0205/
�)�getweakrefcount�getweakrefs�ref�proxy�CallableProxyType�	ProxyType�
ReferenceType�_remove_dead_weakref)�WeakSet�_IterationGuardNrrrr�WeakKeyDictionaryrrr�
ProxyTypes�WeakValueDictionaryr
�
WeakMethod�finalizecsDeZdZdZdZddd�Z�fdd�Zdd	�Zd
d�Ze	j
Z
�ZS)
rz�
    A custom `weakref.ref` subclass which simulates a weak reference to
    a bound method, working around the lifetime problem of bound methods.
    )�	_func_ref�
_meth_type�_alive�__weakref__Ncs~z|j}|j}Wn(tk
r8td�t|���d�YnX��fdd�}t�|||�}t||�|_t|�|_	d|_
t|��|S)Nz)argument should be a bound method, not {}cs&��}|jr"d|_�dk	r"�|�dS�NF)r)�arg�self��callbackZself_wr��/usr/lib64/python3.8/weakref.py�_cb3s
zWeakMethod.__new__.<locals>._cbT)�__self__�__func__�AttributeError�	TypeError�format�typer�__new__rrr)�clsZmethr�obj�funcrrrrrr#,s 
��
zWeakMethod.__new__cs2t���}|��}|dks"|dkr&dS|�||�S�N)�super�__call__rr)rr%r&��	__class__rrr)Bs

zWeakMethod.__call__cCs:t|t�r6|jr|js||kSt�||�o4|j|jkSdSr)�
isinstancerrr�__eq__r�r�otherrrrr-Is

zWeakMethod.__eq__cCs:t|t�r6|jr|js||k	St�||�p4|j|jkSdS�NT)r,rrr�__ne__rr.rrrr1Ps

zWeakMethod.__ne__)N)�__name__�
__module__�__qualname__�__doc__�	__slots__r#r)r-r1r�__hash__�
__classcell__rrr*rr$s
c@s�eZdZdZd,dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZeZ
dd�Zd-dd�Zdd�Zdd�ZeZdd�Zd d!�Zd"d#�Zd$d%�Zd.d&d'�Zd/d(d)�Zd*d+�ZdS)0rz�Mapping class that references values weakly.

    Entries in the dictionary will be discarded when no strong
    reference to the value exists anymore
    rcKs>t|�tfdd�}||_g|_t�|_i|_|j|f|�dS)NcSs6|�}|dk	r2|jr$|j�|j�n||j|j�dSr')�
_iterating�_pending_removals�append�key�data)�wr�selfrefZ_atomic_removalrrrr�removegs
z,WeakValueDictionary.__init__.<locals>.remove)rr	�_remover:�setr9r=�update)rr/�kwr@rrr�__init__fs	zWeakValueDictionary.__init__cCs(|j}|j}|r$|��}t||�qdSr')r:r=�popr	)r�l�dr<rrr�_commit_removalsws
z$WeakValueDictionary._commit_removalscCs4|jr|��|j|�}|dkr,t|��n|SdSr'�r:rIr=�KeyError�rr<�orrr�__getitem__�s
zWeakValueDictionary.__getitem__cCs|jr|��|j|=dSr')r:rIr=�rr<rrr�__delitem__�szWeakValueDictionary.__delitem__cCs|jr|��t|j�Sr')r:rI�lenr=�rrrr�__len__�szWeakValueDictionary.__len__cCs>|jr|��z|j|�}Wntk
r4YdSX|dk	SrrJrLrrr�__contains__�sz WeakValueDictionary.__contains__cCsd|jjt|�fS�Nz<%s at %#x>�r+r2�idrRrrr�__repr__�szWeakValueDictionary.__repr__cCs&|jr|��t||j|�|j|<dSr')r:rI�KeyedRefrAr=�rr<�valuerrr�__setitem__�szWeakValueDictionary.__setitem__c	CsV|jr|��t�}t|��0|j��D]\}}|�}|dk	r(|||<q(W5QRX|Sr')r:rIrrr=�items)r�newr<r>rMrrr�copy�s
zWeakValueDictionary.copyc	Csjddlm}|jr|��|��}t|��6|j��D]$\}}|�}|dk	r6|||||�<q6W5QRX|S�Nr)�deepcopy)r_rar:rIr+rr=r])r�memorar^r<r>rMrrr�__deepcopy__�s
z WeakValueDictionary.__deepcopy__NcCsP|jr|��z|j|}Wntk
r4|YSX|�}|dkrH|S|SdSr'rJ)rr<�defaultr>rMrrr�get�s
zWeakValueDictionary.getc	csR|jr|��t|��2|j��D] \}}|�}|dk	r"||fVq"W5QRXdSr'�r:rIrr=r])r�kr>�vrrrr]�s
zWeakValueDictionary.itemsc	csJ|jr|��t|��*|j��D]\}}|�dk	r"|Vq"W5QRXdSr'rf)rrgr>rrr�keys�s

zWeakValueDictionary.keysc	cs6|jr|��t|��|j��EdHW5QRXdS)a�Return an iterator that yields the weak references to the values.

        The references are not guaranteed to be 'live' at the time
        they are used, so the result of calling the references needs
        to be checked before being used.  This can be used to avoid
        creating references that will cause the garbage collector to
        keep the values around longer than needed.

        N�r:rIrr=�valuesrRrrr�
itervaluerefs�s

z!WeakValueDictionary.itervaluerefsc	csJ|jr|��t|��*|j��D]}|�}|dk	r"|Vq"W5QRXdSr'rj�rr>r%rrrrk�s
zWeakValueDictionary.valuescCs8|jr|��|j��\}}|�}|dk	r||fSqdSr')r:rIr=�popitem)rr<r>rMrrrrn�szWeakValueDictionary.popitemcGs`|jr|��z|j�|��}Wntk
r8d}YnX|dkrX|rN|dSt|��n|SdS)Nr)r:rIr=rFrK)rr<�argsrMrrrrFs

zWeakValueDictionary.popcCs`z|j|�}Wntk
r(d}YnX|dkrX|jr@|��t||j|�|j|<|S|SdSr')r=rKr:rIrYrA)rr<rdrMrrr�
setdefaults
zWeakValueDictionary.setdefaultcKsz|jr|��|j}|dk	rRt|d�s.t|�}|��D]\}}t||j|�||<q6|��D]\}}t||j|�||<qZdS�Nr])r:rIr=�hasattr�dictr]rYrA)rr/�kwargsrHr<rMrrrrCs
zWeakValueDictionary.updatecCs|jr|��t|j���S)a~Return a list of weak references to the values.

        The references are not guaranteed to be 'live' at the time
        they are used, so the result of calling the references needs
        to be checked before being used.  This can be used to avoid
        creating references that will cause the garbage collector to
        keep the values around longer than needed.

        )r:rI�listr=rkrRrrr�	valuerefs(s
zWeakValueDictionary.valuerefs)r)N)N)N)r2r3r4r5rErIrNrPrSrTrXr\r_�__copy__rcrer]ri�__iter__rlrkrnrFrprCrvrrrrrZs.
			
			

cs,eZdZdZdZdd�Z�fdd�Z�ZS)rYa[Specialized reference that includes a key corresponding to the value.

    This is used in the WeakValueDictionary to avoid having to create
    a function object for each key stored in the mapping.  A shared
    callback object can use the 'key' attribute of a KeyedRef instead
    of getting a reference to the key from an enclosing scope.

    �r<cCst�|||�}||_|Sr')rr#r<)r"�obrr<rrrrr#CszKeyedRef.__new__cst��||�dSr')r(rE)rrzrr<r*rrrEHszKeyedRef.__init__)r2r3r4r5r6r#rEr8rrr*rrY7s	rYc@s�eZdZdZd+dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZeZ
dd�Zd,dd�Zdd�Zdd�Zdd�ZeZdd �Zd!d"�Zd#d$�Zd%d&�Zd-d'd(�Zd.d)d*�ZdS)/ra� Mapping class that references keys weakly.

    Entries in the dictionary will be discarded when there is no
    longer a strong reference to the key. This can be used to
    associate additional data with an object owned by other parts of
    an application without adding attributes to those objects. This
    can be especially useful with objects that override attribute
    accesses.
    NcCsFi|_t|�fdd�}||_g|_t�|_d|_|dk	rB|�|�dS)NcSs.|�}|dk	r*|jr"|j�|�n|j|=dSr')r9r:r;r=)rgr?rrrrr@Ys
z*WeakKeyDictionary.__init__.<locals>.removeF)r=rrAr:rBr9�
_dirty_lenrC)rrsr@rrrrEWszWeakKeyDictionary.__init__cCs:|j}|j}|r6z||��=Wqtk
r2YqXqdSr')r:r=rFrK)rrGrHrrrrIhsz"WeakKeyDictionary._commit_removalscs&|j��fdd�|jD�|_d|_dS)Ncsg|]}|�kr|�qSrr)�.0rg�rHrr�
<listcomp>wsz5WeakKeyDictionary._scrub_removals.<locals>.<listcomp>F)r=r:r{rRrr}r�_scrub_removalsusz!WeakKeyDictionary._scrub_removalscCsd|_|jt|�=dSr0)r{r=rrOrrrrPzszWeakKeyDictionary.__delitem__cCs|jt|�Sr')r=rrOrrrrN~szWeakKeyDictionary.__getitem__cCs(|jr|jr|��t|j�t|j�Sr')r{r:rrQr=rRrrrrS�szWeakKeyDictionary.__len__cCsd|jjt|�fSrUrVrRrrrrX�szWeakKeyDictionary.__repr__cCs||jt||j�<dSr')r=rrArZrrrr\�szWeakKeyDictionary.__setitem__c	CsHt�}t|��0|j��D]\}}|�}|dk	r|||<qW5QRX|Sr')rrr=r])rr^r<r[rMrrrr_�s
zWeakKeyDictionary.copyc	Cs\ddlm}|��}t|��6|j��D]$\}}|�}|dk	r(|||�||<q(W5QRX|Sr`)r_rar+rr=r])rrbrar^r<r[rMrrrrc�s
zWeakKeyDictionary.__deepcopy__cCs|j�t|�|�Sr')r=rer�rr<rdrrrre�szWeakKeyDictionary.getcCs.zt|�}Wntk
r"YdSX||jkSr)rr r=)rr<r>rrrrT�s
zWeakKeyDictionary.__contains__c	csDt|��2|j��D] \}}|�}|dk	r||fVqW5QRXdSr'�rr=r])rr>r[r<rrrr]�s

zWeakKeyDictionary.itemsc	cs8t|��&|jD]}|�}|dk	r|VqW5QRXdSr')rr=rmrrrri�s


zWeakKeyDictionary.keysc	cs<t|��*|j��D]\}}|�dk	r|VqW5QRXdSr'r�)rr>r[rrrrk�s

zWeakKeyDictionary.valuescCs
t|j�S)azReturn a list of weak references to the keys.

        The references are not guaranteed to be 'live' at the time
        they are used, so the result of calling the references needs
        to be checked before being used.  This can be used to avoid
        creating references that will cause the garbage collector to
        keep the keys around longer than needed.

        )rur=rRrrr�keyrefs�s
zWeakKeyDictionary.keyrefscCs0d|_|j��\}}|�}|dk	r||fSqdSr0)r{r=rn)rr<r[rMrrrrn�s
zWeakKeyDictionary.popitemcGsd|_|jjt|�f|��Sr0)r{r=rFr)rr<rorrrrF�szWeakKeyDictionary.popcCs|j�t||j�|�Sr')r=rprrAr�rrrrp�szWeakKeyDictionary.setdefaultcKs\|j}|dk	rFt|d�s$ti�|�}|��D]\}}||t||j�<q,t|�rX|�|�dSrq)r=rrr"r]rrArQrC)rrsrtrHr<r[rrrrC�s
zWeakKeyDictionary.update)N)N)N)N)r2r3r4r5rErIrrPrNrSrXr\r_rwrcrerTr]rirxrkr�rnrFrprCrrrrrLs.


	


c@s�eZdZdZdZiZdZe��Z	dZ
dZGdd�d�Zdd�Z
de
_dd
d�Zdd
�Zdd�Zedd��Zedd��Zejdd��Zdd�Zedd��Zedd��Zd	S)raClass for finalization of weakrefable objects

    finalize(obj, func, *args, **kwargs) returns a callable finalizer
    object which will be called when obj is garbage collected. The
    first time the finalizer is called it evaluates func(*arg, **kwargs)
    and returns the result. After this the finalizer is dead, and
    calling it just returns None.

    When the program exits any remaining finalizers for which the
    atexit attribute is true will be run in reverse order of creation.
    By default atexit is true.
    rFc@seZdZdZdS)zfinalize._Info)�weakrefr&rort�atexit�indexN)r2r3r4r6rrrr�_Infosr�cOs>t|�dkr|^}}}}n�|s(td��n�d|krDtdt|�d��|�d�}t|�dkr~|^}}}ddl}|jdtdd	�nFd
|kr�tdt|�d��|�d
�}|^}}ddl}|jdtdd	�t|�}|js�ddl}|�	|j
�dt_|��}t
||�|_||_||_|�pd|_d|_t|j�|_||j|<dt_dS)
N�z<descriptor '__init__' of 'finalize' object needs an argumentr&z9finalize expected at least 2 positional arguments, got %d��rz0Passing 'func' as keyword argument is deprecated)�
stacklevelr%z/Passing 'obj' as keyword argument is deprecatedT)rQr rF�warnings�warn�DeprecationWarning�tuple�_registered_with_atexitr��register�	_exitfuncrr�rr�r&rort�next�_index_iterr��	_registry�_dirty)rortrr%r&r�r��inforrrrEsR

�

�
�
�
zfinalize.__init__z&($self, obj, func, /, *args, **kwargs)NcCs0|j�|d�}|r,|js,|j|j|jp(i�SdS)zZIf alive then mark as dead and return func(*args, **kwargs);
        otherwise return NoneN)r�rF�	_shutdownr&rort)r�_r�rrrr)1s
zfinalize.__call__cCsH|j�|�}|o|��}|dk	rD|j�|d�rD||j|j|jp@ifSdS)z^If alive then mark as dead and return (obj, func, args, kwargs);
        otherwise return NoneN)r�rer�rFr&rort�rr�r%rrr�detach8szfinalize.detachcCs:|j�|�}|o|��}|dk	r6||j|j|jp2ifSdS)zMIf alive then return (obj, func, args, kwargs);
        otherwise return NoneN)r�rer�r&rortr�rrr�peek@sz
finalize.peekcCs
||jkS)zWhether finalizer is alive)r�rRrrr�aliveHszfinalize.alivecCs|j�|�}t|�o|jS)z*Whether finalizer should be called at exit�r�re�boolr�)rr�rrrr�Mszfinalize.atexitcCs|j�|�}|rt|�|_dSr'r�)rr[r�rrrr�SscCs^|j�|�}|o|��}|dkr6dt|�jt|�fSdt|�jt|�t|�jt|�fSdS)Nz<%s object at %#x; dead>z!<%s object at %#x; for %r at %#x>)r�rer�r"r2rWr�rrrrXYs�zfinalize.__repr__cCs2dd�|j��D�}|jdd�d�dd�|D�S)NcSsg|]\}}|jr||f�qSr)r��r|�f�irrrr~esz-finalize._select_for_exit.<locals>.<listcomp>cSs
|djS)Nr�)r�)�itemrrr�<lambda>f�z+finalize._select_for_exit.<locals>.<lambda>rycSsg|]\}}|�qSrrr�rrrr~gs)r�r]�sort)r$�Lrrr�_select_for_exitbszfinalize._select_for_exitcCs�d}z�|jr�ddl}|��r(d}|��d}|dks:tjrH|��}dt_|sNq�|�	�}z
|�Wn"t
k
r�tjt�
��YnX||jks,t�q,W5dt_|r�|��XdS)NFTr)rr�Zenabler��gcZ	isenabledZdisabler�r�rF�	Exception�sys�
excepthook�exc_info�AssertionError)r$Zreenable_gcr�Zpendingr�rrrr�is,
zfinalize._exitfunc)N)r2r3r4r5r6r�r��	itertools�countr�r�r�r�rE�__text_signature__r)r�r��propertyr�r��setterrX�classmethodr�r�rrrrr�s0*



	
)r5�_weakrefrrrrrrrr	Z_weakrefsetr
r�_collections_abcr�r�r
�__all__r�MutableMappingrrYrrrrrr�<module>s0(
�6^__pycache__/_compat_pickle.cpython-38.opt-2.pyc000064400000012505151153537550015332 0ustar00U

e5d-"�+@s�dddddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*�*Zd+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdL�!ZdMZzeWnek
r�Yn
XedN7ZeD]ZdefedOef<q�dPZeD]ZdQefedRef<q�edSdT�e��D��Z	edUdT�e��D��Z
e�dVdWdddd"d"dXdXdXd(dYdYdZ�
�e	�d[d(d\d]dVd^��e�d/d_d6d`da��e
�dbdcdddedfdgdhdidjdkdldmdndo�
�dpZeD]Zdqe
def<�q�drZ
e
D]Zdse
def<�q�dtS)u�builtins�copyregZqueueZsocketserverZconfigparser�reprlib�tkinter.filedialog�tkinter.simpledialogztkinter.colorchooserztkinter.commondialogztkinter.dialogztkinter.dndztkinter.fontztkinter.messageboxztkinter.scrolledtextztkinter.constantsztkinter.tixztkinter.ttkZtkinterZ_markupbase�winreg�_threadZ
_dummy_threadzdbm.bsdzdbm.dumbzdbm.ndbmzdbm.gnuz
xmlrpc.client�
xmlrpc.serverzhttp.clientz
html.entitieszhtml.parserzhttp.cookieszhttp.cookiejar�http.serverztest.support�
subprocess�urllib.parsezurllib.robotparser�urllib.request�dbmzcollections.abc)*�__builtin__Zcopy_regZQueueZSocketServerZConfigParser�reprZtkFileDialogZtkSimpleDialogZtkColorChooserZtkCommonDialogZDialogZTkdndZtkFontZtkMessageBoxZScrolledTextZTkconstantsZTixZttkZTkinterZ
markupbase�_winreg�threadZdummy_threadZdbhashZdumbdbmr
�gdbmZ	xmlrpclibZSimpleXMLRPCServerZhttplibZhtmlentitydefsZ
HTMLParserZCookieZ	cookielibZBaseHTTPServerztest.test_supportZcommandsZurlparseZrobotparser�urllib2ZanydbmZ_abcoll)r�range)�	functools�reduce)�sys�intern)r�chr)r�str)r�int)r�zip)r�map)r�filter)�	itertools�filterfalse)r�zip_longest)�collections�UserDict)r"�UserList)r"�
UserString)r
�whichdb)�socket�fromfd)zmultiprocessing.connection�
Connection)�multiprocessing.context�Process)zmultiprocessing.popen_fork�Popen)�urllib.error�ContentTooShortError)r�
getproxies)r�pathname2url)r�
quote_plus)r�quote)r�unquote_plus)r�unquote)r�url2pathname)r�
urlcleanup)r�	urlencode)r�urlopen)r�urlretrieve)r-�	HTTPError)r-�URLError)!)rZxrange�rr)rr)rZunichr)rZunicode)rZlong)rZizip)rZimap)rZifilter)rZifilterfalse)rZizip_longest)r#ZIterableUserDict)r$r$)r%r%)r&r&)�_socketr()Z_multiprocessingr))zmultiprocessing.processr+)zmultiprocessing.forkingr,)�urllibr.)r>r/)r>r0)r>r1)r>r2)r>r3)r>r4)r>r5)r>r6)r>r7)r>r8)r>r9)rr:)rr;)/�ArithmeticError�AssertionError�AttributeError�
BaseException�BufferError�BytesWarning�DeprecationWarning�EOFError�EnvironmentError�	Exception�FloatingPointError�
FutureWarning�
GeneratorExit�IOError�ImportError�
ImportWarning�IndentationError�
IndexError�KeyError�KeyboardInterrupt�LookupError�MemoryError�	NameError�NotImplementedError�OSError�
OverflowError�PendingDeprecationWarning�ReferenceError�RuntimeError�RuntimeWarning�
StopIteration�SyntaxError�
SyntaxWarning�SystemError�
SystemExit�TabError�	TypeError�UnboundLocalError�UnicodeDecodeError�UnicodeEncodeError�UnicodeError�UnicodeTranslateError�UnicodeWarning�UserWarning�
ValueError�Warning�ZeroDivisionError)�WindowsError�
exceptions)ZAuthenticationErrorZBufferTooShortZProcessError�TimeoutErrorr*Zmultiprocessingccs|]\}}||fVqdS�N���.0�k�vrrrr�&/usr/lib64/python3.8/_compat_pickle.py�	<genexpr>�srxccs|]\}}||fVqdSrqrrrsrrrrrwrx�s�picklezxml.etree.ElementTreer"�io)
ZcPickleZ_elementtree�
FileDialog�SimpleDialog�DocXMLRPCServer�SimpleHTTPServer�
CGIHTTPServerr#r$r%r&�StringIOZ	cStringIO�bz2rr)Z_bz2Z_dbm�
_functoolsZ_gdbm�_pickle)rrH)r'Z
SocketType))rZ
basestring)roZ
StandardError)r#r#�r'Z
_socketobjectr<)r{r{)r{�LoadFileDialog)r{�SaveFileDialog)r|r|)r}�
ServerHTMLDoc)r}�XMLRPCDocGenerator)r}�DocXMLRPCRequestHandler)r}r})r}�DocCGIXMLRPCRequestHandler)r~�SimpleHTTPRequestHandler)r�CGIHTTPRequestHandlerr�)
)r�r)rr{)rr�)rr�)rr|)rr�)rr�)rr�)rr})rr�)r	r�)r	r�)r=r')�BrokenPipeError�ChildProcessError�ConnectionAbortedError�ConnectionError�ConnectionRefusedError�ConnectionResetError�FileExistsError�FileNotFoundError�InterruptedError�IsADirectoryError�NotADirectoryError�PermissionError�ProcessLookupErrorrp)rorW)�ModuleNotFoundError)rorMN)ZIMPORT_MAPPINGZNAME_MAPPINGZPYTHON2_EXCEPTIONSrnrUZexcnameZMULTIPROCESSING_EXCEPTIONS�dict�itemsZREVERSE_IMPORT_MAPPINGZREVERSE_NAME_MAPPING�updateZPYTHON3_OSERROR_EXCEPTIONSZPYTHON3_IMPORTERROR_EXCEPTIONSrrrrrrrw�<module>	s�2�$3����__pycache__/textwrap.cpython-38.opt-2.pyc000064400000014136151153537550014241 0ustar00U

e5d�K�@s�ddlZddddddgZdZGd	d�d�Zddd�Zddd�Zd
d�Ze�dej�Z	e�dej�Z
dd�Zddd�Ze
dkr�eed��dS)�N�TextWrapper�wrap�fill�dedent�indent�shortenz	

 c
@s�eZdZiZed�ZeD]Zeeee�<qdZdZ	de
�e�Zdedd�Z
e
�dee	ee
d	�e
j�Z[[	[
e
�d
e�Z[e
�d�Zd%ddd�dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�ZdS)&r� z[\w!"\'&.,?]z[^\d\W]z[%s]z[^�Na�
        ( # any whitespace
          %(ws)s+
        | # em-dash between words
          (?<=%(wp)s) -{2,} (?=\w)
        | # word, possibly hyphenated
          %(nws)s+? (?:
            # hyphenated word
              -(?: (?<=%(lt)s{2}-) | (?<=%(lt)s-%(lt)s-))
              (?= %(lt)s -? %(lt)s)
            | # end of word
              (?=%(ws)s|\Z)
            | # em-dash
              (?<=%(wp)s) (?=-{2,}\w)
            )
        ))Zwp�ltZwsZnwsz(%s+)z[a-z][\.\!\?][\"\']?\Z�F�TF�z [...])�	max_lines�placeholderc
CsL||_||_||_||_||_||_||_||_|	|_|
|_	||_
||_dS�N)�width�initial_indent�subsequent_indent�expand_tabs�replace_whitespace�fix_sentence_endings�break_long_words�drop_whitespace�break_on_hyphens�tabsizerr)
�selfrrrrrrrrrrrr�r� /usr/lib64/python3.8/textwrap.py�__init__sszTextWrapper.__init__cCs(|jr|�|j�}|jr$|�|j�}|Sr)r�
expandtabsrr�	translate�unicode_whitespace_trans�r�textrrr�_munge_whitespace�s
zTextWrapper._munge_whitespacecCs6|jdkr|j�|�}n|j�|�}dd�|D�}|S)NTcSsg|]}|r|�qSrr)�.0�crrr�
<listcomp>�sz&TextWrapper._split.<locals>.<listcomp>)r�
wordsep_re�split�wordsep_simple_re�rr#�chunksrrr�_split�s

zTextWrapper._splitcCs\d}|jj}|t|�dkrX||ddkrN|||�rNd||d<|d7}q|d7}qdS)Nrr	rz  �)�sentence_end_re�search�len)rr,�iZ	patsearchrrr�_fix_sentence_endings�s	
z!TextWrapper._fix_sentence_endingscCs^|dkrd}n||}|jrH|�|dd|��|d|d�|d<n|sZ|�|���dS)Nr	���)r�append�pop)rZreversed_chunks�cur_line�cur_lenrZ
space_leftrrr�_handle_long_word�s
zTextWrapper._handle_long_wordc	Cs�g}|jdkrtd|j��|jdk	rb|jdkr8|j}n|j}t|�t|j���|jkrbtd��|��|�r�g}d}|r�|j}n|j}|jt|�}|j	r�|d�
�dkr�|r�|d=|r�t|d�}|||kr�|�|���||7}q�q�q�|�r&t|d�|k�r&|�
||||�ttt|��}|j	�r\|�r\|d�
�dk�r\|t|d�8}|d=|rj|jdk�s�t|�d|jk�s�|�r�|j	�r�t|�dk�r�|d�
��s�||k�r�|�|d�|��qj|�r0|d�
��r|t|j�|k�r|�|j�|�|d�|���q�|t|d�8}|d=�q�|�rn|d��}t|�t|j�|jk�rn||j|d<�q�|�||j����q�qj|S)Nrzinvalid width %r (must be > 0)r	z#placeholder too large for max widthr4r)r�
ValueErrorrrrr1r�lstrip�reverser�stripr5r6r9�sum�map�join�rstrip)	rr,�linesrr7r8r�lZ	prev_linerrr�_wrap_chunks�s�




 ���
�
���
�zTextWrapper._wrap_chunkscCs|�|�}|�|�Sr)r$r-r"rrr�
_split_chunksPs
zTextWrapper._split_chunkscCs$|�|�}|jr|�|�|�|�Sr)rErr3rDr+rrrrVs	

zTextWrapper.wrapcCsd�|�|��S)N�
)r@rr"rrrrdszTextWrapper.fill)
rrrTTFTTTr
)�__name__�
__module__�__qualname__r!�ordZuspace�_whitespace�xZ
word_punctZletter�re�escapeZ
whitespaceZnowhitespace�compile�VERBOSEr(r*r/rr$r-r3r9rDrErrrrrrrsT1���
��!grcKstfd|i|��}|�|�S�Nr)rr�r#r�kwargs�wrrrrps
cKstfd|i|��}|�|�SrQ)rrrRrrrr}s	cKs,tf|dd�|��}|�d�|������S)Nr	)rrr)rrr@r=r)rRrrrr�sz^[ 	]+$z(^[ 	]*)(?:[^ 	
])cCs�d}t�d|�}t�|�}|D]b}|dkr0|}q|�|�r<q|�|�rL|}qtt||��D]$\}\}}||krZ|d|�}qqZqdr�|r�|�d�D]}q�|r�t�d|d|�}|S)NrrrFz(?m)^)	�_whitespace_only_re�sub�_leading_whitespace_re�findall�
startswith�	enumerate�zipr)rM)r#Zmargin�indentsrr2rL�y�linerrrr�s(


cs,�dkrdd�����fdd�}d�|��S)NcSs|��Sr)r=�r^rrr�	predicate�szindent.<locals>.predicatec3s*��d�D]}�|�r�|n|Vq
dS)NT)�
splitlinesr_�r`�prefixr#rr�prefixed_lines�szindent.<locals>.prefixed_linesr)r@)r#rcr`rdrrbrr�s�__main__z Hello there.
  This is indented.)r)r)N)rM�__all__rKrrrrrO�	MULTILINErUrWrrrG�printrrrr�<module>sa

3
__pycache__/heapq.cpython-38.pyc000064400000033370151153537550012522 0ustar00U

e5d]Y�@sZdZdZdddddddd	gZd
d�Zdd�Zdd�Zd
d	�Zdd�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zddd�d d�Zd)d!d�Zd*d"d�Zzd#d$lTWnek
r�YnXzd#d%lm	Z	Wnek
r�YnXzd#d&lm
Z
Wnek
�rYnXzd#d'lmZWnek
�r6YnXed(k�rVd#dlZee���dS)+a�Heap queue algorithm (a.k.a. priority queue).

Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0.  For the sake of comparison,
non-existing elements are considered to be infinite.  The interesting
property of a heap is that a[0] is always its smallest element.

Usage:

heap = []            # creates an empty heap
heappush(heap, item) # pushes a new item on the heap
item = heappop(heap) # pops the smallest item from the heap
item = heap[0]       # smallest item on the heap without popping it
heapify(x)           # transforms list into a heap, in-place, in linear time
item = heapreplace(heap, item) # pops and returns smallest item, and adds
                               # new item; the heap size is unchanged

Our API differs from textbook heap algorithms as follows:

- We use 0-based indexing.  This makes the relationship between the
  index for a node and the indexes for its children slightly less
  obvious, but is more suitable since Python uses 0-based indexing.

- Our heappop() method returns the smallest item, not the largest.

These two make it possible to view the heap as a regular Python list
without surprises: heap[0] is the smallest item, and heap.sort()
maintains the heap invariant!
uoHeap queues

[explanation by François Pinard]

Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0.  For the sake of comparison,
non-existing elements are considered to be infinite.  The interesting
property of a heap is that a[0] is always its smallest element.

The strange invariant above is meant to be an efficient memory
representation for a tournament.  The numbers below are `k', not a[k]:

                                   0

                  1                                 2

          3               4                5               6

      7       8       9       10      11      12      13      14

    15 16   17 18   19 20   21 22   23 24   25 26   27 28   29 30


In the tree above, each cell `k' is topping `2*k+1' and `2*k+2'.  In
a usual binary tournament we see in sports, each cell is the winner
over the two cells it tops, and we can trace the winner down the tree
to see all opponents s/he had.  However, in many computer applications
of such tournaments, we do not need to trace the history of a winner.
To be more memory efficient, when a winner is promoted, we try to
replace it by something else at a lower level, and the rule becomes
that a cell and the two cells it tops contain three different items,
but the top cell "wins" over the two topped cells.

If this heap invariant is protected at all time, index 0 is clearly
the overall winner.  The simplest algorithmic way to remove it and
find the "next" winner is to move some loser (let's say cell 30 in the
diagram above) into the 0 position, and then percolate this new 0 down
the tree, exchanging values, until the invariant is re-established.
This is clearly logarithmic on the total number of items in the tree.
By iterating over all items, you get an O(n ln n) sort.

A nice feature of this sort is that you can efficiently insert new
items while the sort is going on, provided that the inserted items are
not "better" than the last 0'th element you extracted.  This is
especially useful in simulation contexts, where the tree holds all
incoming events, and the "win" condition means the smallest scheduled
time.  When an event schedule other events for execution, they are
scheduled into the future, so they can easily go into the heap.  So, a
heap is a good structure for implementing schedulers (this is what I
used for my MIDI sequencer :-).

Various structures for implementing schedulers have been extensively
studied, and heaps are good for this, as they are reasonably speedy,
the speed is almost constant, and the worst case is not much different
than the average case.  However, there are other representations which
are more efficient overall, yet the worst cases might be terrible.

Heaps are also very useful in big disk sorts.  You most probably all
know that a big sort implies producing "runs" (which are pre-sorted
sequences, which size is usually related to the amount of CPU memory),
followed by a merging passes for these runs, which merging is often
very cleverly organised[1].  It is very important that the initial
sort produces the longest runs possible.  Tournaments are a good way
to that.  If, using all the memory available to hold a tournament, you
replace and percolate items that happen to fit the current run, you'll
produce runs which are twice the size of the memory for random input,
and much better for input fuzzily ordered.

Moreover, if you output the 0'th item on disk and get an input which
may not fit in the current tournament (because the value "wins" over
the last output value), it cannot fit in the heap, so the size of the
heap decreases.  The freed memory could be cleverly reused immediately
for progressively building a second heap, which grows at exactly the
same rate the first heap is melting.  When the first heap completely
vanishes, you switch heaps and start a new run.  Clever and quite
effective!

In a word, heaps are useful memory structures to know.  I use them in
a few applications, and I think it is good to keep a `heap' module
around. :-)

--------------------
[1] The disk balancing algorithms which are current, nowadays, are
more annoying than clever, and this is a consequence of the seeking
capabilities of the disks.  On devices which cannot seek, like big
tape drives, the story was quite different, and one had to be very
clever to ensure (far in advance) that each tape movement will be the
most effective possible (that is, will best participate at
"progressing" the merge).  Some tapes were even able to read
backwards, and this was also used to avoid the rewinding time.
Believe me, real good tape sorts were quite spectacular to watch!
From all times, sorting has always been a Great Art! :-)
�heappush�heappop�heapify�heapreplace�merge�nlargest�	nsmallest�heappushpopcCs"|�|�t|dt|�d�dS)z4Push item onto heap, maintaining the heap invariant.��N)�append�	_siftdown�len��heap�item�r�/usr/lib64/python3.8/heapq.pyr�s
cCs.|��}|r*|d}||d<t|d�|S|S)zCPop the smallest item off the heap, maintaining the heap invariant.r	)�pop�_siftup�rZlastelt�
returnitemrrrr�s
cCs|d}||d<t|d�|S)a�Pop and return the current smallest value, and add the new item.

    This is more efficient than heappop() followed by heappush(), and can be
    more appropriate when using a fixed-size heap.  Note that the value
    returned may be larger than item!  That constrains reasonable uses of
    this routine unless written as part of a conditional replacement:

        if item > heap[0]:
            item = heapreplace(heap, item)
    r	�r�rrrrrrr�s
cCs0|r,|d|kr,|d|}|d<t|d�|S)z1Fast version of a heappush followed by a heappop.r	rrrrrr�s
cCs,t|�}tt|d��D]}t||�qdS)z8Transform list into a heap, in-place, in O(len(x)) time.�N)r
�reversed�ranger��x�n�irrrr�scCs.|��}|r*|d}||d<t|d�|S|S)zMaxheap version of a heappop.r	)r�_siftup_maxrrrr�_heappop_max�s
r!cCs|d}||d<t|d�|S)z4Maxheap version of a heappop followed by a heappush.r	)r rrrr�_heapreplace_max�s
r"cCs,t|�}tt|d��D]}t||�qdS)z;Transform list into a maxheap, in-place, in O(len(x)) time.rN)r
rrr rrrr�_heapify_max�sr#cCsJ||}||kr>|dd?}||}||kr>|||<|}qq>q|||<dS)Nr
r�r�startpos�pos�newitem�	parentpos�parentrrrr�srcCs�t|�}|}||}d|d}||krj|d}||krL||||ksL|}||||<|}d|d}q |||<t|||�dS)Nrr
)r
r�rr&�endposr%r'�childpos�rightposrrrrsrcCsJ||}||kr>|dd?}||}||kr>|||<|}qq>q|||<dS)zMaxheap variant of _siftdownr
Nrr$rrr�
_siftdown_maxsr.cCs�t|�}|}||}d|d}||krj|d}||krL||||ksL|}||||<|}d|d}q |||<t|||�dS)zMaxheap variant of _siftuprr
N)r
r.r*rrrr %sr NF��key�reversec	gsg}|j}|r t}t}t}d}nt}t}t}d}|dk�rttt	|��D]<\}	}
z|
j
}||�|	||g�WqHtk
r�YqHXqH||�t|�dkr�z2|d\}}	}}
|V|�|
d<|||
�q�Wq�tk
r�||�Yq�Xq�|�r|d\}}	}|V|j
EdHdSttt	|��D]J\}	}
z(|
j
}|�}|||�|	|||g�Wntk
�rjYnX�q$||�t|�dk�r�zF|d\}}	}}}
|V|�}||�|
d<||
d<|||
��q�Wntk
�r�||�YnX�qx|�r|d\}}	}}|V|j
EdHdS)akMerge multiple sorted inputs into a single sorted output.

    Similar to sorted(itertools.chain(*iterables)) but returns a generator,
    does not pull the data into memory all at once, and assumes that each of
    the input streams is already sorted (smallest to largest).

    >>> list(merge([1,3,5,7], [0,2,4,8], [5,10,15,20], [], [25]))
    [0, 1, 2, 3, 4, 5, 5, 7, 8, 10, 15, 20, 25]

    If *key* is not None, applies a key function to each element to determine
    its sort order.

    >>> list(merge(['dog', 'horse'], ['cat', 'fish', 'kangaroo'], key=len))
    ['dog', 'cat', 'fish', 'horse', 'kangaroo']

    ���r
Nr	r)rr#r!r"rrr�	enumerate�map�iter�__next__�
StopIterationr
�__self__)r0r1�	iterables�h�h_append�_heapify�_heappop�_heapreplace�	direction�order�it�next�value�s�	key_valuerrrr:sl


c	s�|dkr6t|�}t�}t||�d�}||kr0gS|gSzt|�}Wnttfk
rZYnX||krxt|�d�d|�S�dk�rt|�}dd�tt|�|�D�}|s�|St	|�|dd}|}t
}	|D].}
|
|kr�|	||
|f�|d\}}|d7}q�|��dd�|D�St|�}�fd	d�tt|�|�D�}|�s>|St	|�|dd}|}t
}	|D]>}
�|
�}||k�r^|	||||
f�|d\}}}
|d7}�q^|��d
d�|D�S)zbFind the n smallest elements in a dataset.

    Equivalent to:  sorted(iterable, key=key)[:n]
    r
��defaultr0�r0NcSsg|]\}}||f�qSrr��.0r�elemrrr�
<listcomp>�sznsmallest.<locals>.<listcomp>r	cSsg|]\}}|�qSrr�rJrKr@rrrrL�scsg|]\}}�|�||f�qSrrrIrHrrrL�scSsg|]\}}}|�qSrr�rJ�kr@rKrrrrLs)r5�object�minr
�	TypeError�AttributeError�sorted�ziprr#r"�sort�r�iterabler0rA�sentinel�result�size�topr@r>rK�_orderrO�_elemrrHrr�sV


c	s�|dkr6t|�}t�}t||�d�}||kr0gS|gSzt|�}Wnttfk
rZYn X||krzt|�dd�d|�S�dk�rt|�}dd�ttd|d	�|�D�}|s�|St	|�|dd}|}t
}	|D].}
||
kr�|	||
|f�|d\}}|d8}q�|jdd
�dd�|D�St|�}�fdd�ttd|d	�|�D�}|�sR|St	|�|dd}|}t
}	|D]>}
�|
�}||k�rt|	||||
f�|d\}}}
|d8}�qt|jdd
�d
d�|D�S)zoFind the n largest elements in a dataset.

    Equivalent to:  sorted(iterable, key=key, reverse=True)[:n]
    r
rFTr/NcSsg|]\}}||f�qSrrrIrrrrL"sznlargest.<locals>.<listcomp>r	r2)r1cSsg|]\}}|�qSrrrMrrrrL/scsg|]\}}�|�||f�qSrrrIrHrrrL3scSsg|]\}}}|�qSrrrNrrrrLAs)r5rP�maxr
rRrSrTrUrrrrVrWrrHrr	sV

"
r	)�*)r")r#)r!�__main__)N)N)�__doc__�	__about__�__all__rrrrrr!r"r#rrr.r rrr�_heapq�ImportError�__name__Zdoctest�printZtestmodrrrr�<module>sR ^
�

	5
<
;
__pycache__/bisect.cpython-38.opt-1.pyc000064400000004464151153537550013636 0ustar00U

e5d��@sZdZddd�Zd
dd�Zddd�Zdd	d
�ZzddlTWnek
rLYnXeZeZdS)zBisection algorithms.�NcCst||||�}|�||�dS)z�Insert item x in list a, and keep it sorted assuming a is sorted.

    If x is already in a, insert it to the right of the rightmost x.

    Optional args lo (default 0) and hi (default len(a)) bound the
    slice of a to be searched.
    N)�bisect_right�insert��a�x�lo�hi�r	�/usr/lib64/python3.8/bisect.py�insort_rights	rcCsT|dkrtd��|dkr t|�}||krP||d}|||krF|}q |d}q |S)a�Return the index where to insert item x in list a, assuming a is sorted.

    The return value i is such that all e in a[:i] have e <= x, and all e in
    a[i:] have e > x.  So if x already appears in the list, a.insert(x) will
    insert just after the rightmost x already there.

    Optional args lo (default 0) and hi (default len(a)) bound the
    slice of a to be searched.
    r�lo must be non-negativeN����
ValueError�len�rrrrZmidr	r	r
rs
rcCst||||�}|�||�dS)z�Insert item x in list a, and keep it sorted assuming a is sorted.

    If x is already in a, insert it to the left of the leftmost x.

    Optional args lo (default 0) and hi (default len(a)) bound the
    slice of a to be searched.
    N)�bisect_leftrrr	r	r
�insort_left$s	rcCsT|dkrtd��|dkr t|�}||krP||d}|||krJ|d}q |}q |S)a�Return the index where to insert item x in list a, assuming a is sorted.

    The return value i is such that all e in a[:i] have e < x, and all e in
    a[i:] have e >= x.  So if x already appears in the list, a.insert(x) will
    insert just before the leftmost x already there.

    Optional args lo (default 0) and hi (default len(a)) bound the
    slice of a to be searched.
    rrNr
rrrr	r	r
r1s
r)�*)rN)rN)rN)rN)	�__doc__rrrrZ_bisect�ImportErrorZbisectZinsortr	r	r	r
�<module>s



__pycache__/webbrowser.cpython-38.pyc000064400000041342151153537550013603 0ustar00U

e5d^�@s�dZddlZddlZddlZddlZddlZddlZddddddgZGd	d�de�Z	e�
�ZiZda
dad<d
d�dd�Zd=d
d�Zd>dd�Zdd�Zdd�Zd
d�dd�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGd d!�d!e�ZGd"d#�d#e�ZeZGd$d%�d%e�ZGd&d'�d'e�Z Gd(d)�d)e�Z!Gd*d+�d+e�Z"d,d-�Z#d.d/�Z$ej%dd0�d1k�r�Gd2d3�d3e�Z&ej%d4k�r�Gd5d6�d6e�Z'Gd7d8�d8e�Z(d9d:�Z)e*d;k�r�e)�dS)?z?Interfaces for launching and remotely controlling Web browsers.�N�Error�open�open_new�open_new_tab�get�registerc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�"/usr/lib64/python3.8/webbrowser.pyrsF��	preferredc	CsZt�Ltdkrt�||gt|��<|s4trB|tkrBt�d|�n
t�|�W5QRXdS)zRegister a browser connector.Nr)�_lock�	_tryorder�register_standard_browsers�	_browsers�lower�_os_preferred_browser�insert�append)�name�klass�instancerrrrrsc	Cs�tdkr&t�tdkrt�W5QRX|dk	r6|g}nt}|D]�}d|kr�t�|�}|ddkrtt|dd��St|�Sq>zt|��}Wnt	k
r�t
|�}YnX|ddk	r�|dS|ddk	r>|d�Sq>td��dS)zCReturn a browser launcher instance appropriate for the environment.N�%s����&�rz!could not locate runnable browser)rrr�shlex�split�BackgroundBrowser�GenericBrowserrr�KeyError�_synthesizer)ZusingZalternatives�browser�commandrrrr%s,
Tc	CsPtdkr&t�tdkrt�W5QRXtD] }t|�}|�|||�r*dSq*dS)aDisplay url using the default browser.

    If possible, open url in a location determined by new.
    - 0: the same browser window (the default).
    - 1: a new browser window.
    - 2: a new browser page ("tab").
    If possible, autoraise raises the window (the default) or not.
    NTF)rrrrr)�url�new�	autoraiserr$rrrrGs	cCs
t|d�S)zuOpen url in a new window of the default browser.

    If not possible, then open url in the only browser window.
    r�r�r&rrrrZscCs
t|d�S)z�Open url in a new page ("tab") of the default browser.

    If not possible, then the behavior becomes equivalent to open_new().
    �r)r*rrrrascCs�|��d}t�|�sddgStj�|�}zt|��}Wntk
rVddgYSX|d}|r�|��|jkr�ddl	}|�	|�}||_
tj�|�|_t|d||d�d|gSddgS)a�Attempt to synthesize a controller based on existing controllers.

    This is useful to create a controller when a user specifies a path to
    an entry in the BROWSER environment variable -- we can copy a general
    controller to operate using a specific installation of the desired
    browser in this way.

    If we can't create a controller in this way, or if there is no
    executable for the requested browser, return [None, None].

    rNr)rr)r�shutil�which�os�path�basenamerrr"�copyrr)r$r�cmdrr%Z
controllerr1rrrr#is"

r#c@s:eZdZdZdgZddd�Zddd	�Zd
d�Zdd
�ZdS)�BaseBrowserz3Parent class for all browsers. Do not use directly.r�cCs||_||_dS�N)rr0��selfrrrr�__init__�szBaseBrowser.__init__rTcCst�dSr5)�NotImplementedError�r7r&r'r(rrrr�szBaseBrowser.opencCs|�|d�S)Nrr)�r7r&rrrr�szBaseBrowser.open_newcCs|�|d�S)Nr+r)r;rrrr�szBaseBrowser.open_new_tabN)r4)rT)	rr	r
�__doc__�argsr8rrrrrrrr3�s

r3c@s"eZdZdZdd�Zd	dd�ZdS)
r!zVClass for all browsers started with a command
       and without remote functionality.cCsFt|t�r||_dg|_n|d|_|dd�|_tj�|j�|_dS)Nrrr)�
isinstance�strrr=r.r/r0r6rrrr8�s


zGenericBrowser.__init__rTcs|t�d��|jg�fdd�|jD�}z8tjdd�dkrHt�|�}ntj|dd�}|��WStk
rvYdSXdS)	N�webbrowser.opencsg|]}|�d���qS�r��replace��.0�argr*rr�
<listcomp>�s�z'GenericBrowser.open.<locals>.<listcomp>��winT)�	close_fdsF)	�sys�auditrr=�platform�
subprocess�Popen�wait�OSError�r7r&r'r(�cmdline�prr*rr�s�zGenericBrowser.openN)rT�rr	r
r<r8rrrrrr!�s
r!c@seZdZdZddd�ZdS)r zHClass for all browsers which are to be started in the
       background.rTcs�|jg�fdd�|jD�}t�d��z<tjdd�dkrHt�|�}ntj|ddd�}|��dkWStk
rzYdSXdS)	Ncsg|]}|�d���qSrArBrDr*rrrG�s�z*BackgroundBrowser.open.<locals>.<listcomp>r@rHrIT)rJ�start_new_sessionF)	rr=rKrLrMrNrO�pollrQrRrr*rr�s��zBackgroundBrowser.openN)rT�rr	r
r<rrrrrr �sr c@sDeZdZdZdZdZdZddgZdZdZ	dZ
ddd�Zd
d
d�ZdS)�UnixBrowserz=Parent class for all Unix browsers with remote functionality.NFT�%actionrcCs�g}|r*|jr*t|�}|j|}|r*|g}|jg||}|sD|jrLtj}nd}tj|d||jrd|pfd|dd�}	|r�z|	�d�}
|
WStj	k
r�YdSXn&|jr�|	�
�dkr�dSdSn
|	��SdS)NT�rJ�stdin�stdout�stderrrV�F)�
raise_opts�intr�
backgroundrN�DEVNULLrO�redirect_stdoutrPZTimeoutExpiredrW)r7r=Zremoter(r&Z	raise_opt�optrSZinoutrT�rcrrr�_invoke�s4



�

zUnixBrowser._invokercs�t�d��|dkr|j�nB|dkr,|j�n2|dkrN|jdkrF|j�q^|j�ntdd|����fdd�|jD�}d	d�|D�}|�|d
|��}|s��fdd�|jD�}|�|dd�Sd
SdS)
Nr@rrr+zBad 'new' parameter to open(); zexpected 0, 1, or 2, got %scs g|]}|�d���d���qS)rrZrBrD��actionr&rrrGs�z$UnixBrowser.open.<locals>.<listcomp>cSsg|]}|r|�qSrrrDrrrrGsTcsg|]}|�d���qSrArBrDr*rrrGsF)	rKrL�
remote_action�remote_action_newwin�remote_action_newtabr�remote_argsrgr=)r7r&r'r(r=Zsuccessrrhrrs*
��zUnixBrowser.open)N)rT)
rr	r
r<r`rbrdrmrjrkrlrgrrrrrrY�s
#rYc@s(eZdZdZddgZdZdZdZdZdS)	�Mozillaz$Launcher class for Mozilla browsers.rZrr4z-new-windowz-new-tabTN�	rr	r
r<rmrjrkrlrbrrrrrnsrnc@s0eZdZdZddgZddgZdZdZdZd	Z	d
S)�Netscapez$Launcher class for Netscape browser.�-noraisez-raise�-remote�openURL(%s%action)r4�,new-window�,new-tabTN)
rr	r
r<r`rmrjrkrlrbrrrrrp&srpc@s,eZdZdZddgZddgZdZdZdZd	S)
�Galeonz,Launcher class for Galeon/Epiphany browsers.rqr4rZr�-nz-wTN)	rr	r
r<r`rmrjrkrbrrrrrv1srvc@s(eZdZdZddgZdZdZdZdZdS)�Chromez)Launcher class for Google Chrome browser.rZrr4�--new-windowTNrorrrrrx;srxc@s(eZdZdZddgZdZdZdZdZdS)�Operaz!Launcher class for Opera browser.rZrr4ryTNrorrrrrzGsrzc@s,eZdZdZddgZdZdZdZdZdZ	dS)	�Elinksz#Launcher class for Elinks browsers.rrrsr4rtruFN)
rr	r
r<rmrjrkrlrbrdrrrrr{Qsr{c@seZdZdZddd�ZdS)�	Konquerorz�Controller for the KDE File Manager (kfm, or Konqueror).

    See the output of ``kfmclient --commands``
    for more information on the Konqueror remote-control interface.
    rTcCs�t�d|�|dkrd}nd}tj}ztjd||gd|||d�}Wntk
rVYnX|��dSz tjdd	|gd|||dd
�}Wntk
r�YnX|��dkr�dSz tjdd|gd|||dd
�}Wntk
r�Yd
SX|��dkSdS)Nr@r+ZnewTabZopenURL�	kfmclientT)rJr\r]r^�	konquerorz--silentr[�kfmz-dF)rKrLrNrcrOrQrPrW)r7r&r'r(ri�devnullrTrrrrfsN�
�
�
zKonqueror.openN)rTrXrrrrr|_sr|c@s&eZdZdd�Zdd�Zd
dd�Zd	S)�GrailcCs�ddl}ddl}ddl}ddl}tj�|��d�}|�t�	��d}tj�|�
|�|�
|�d�}|�|�}|stdS|�|j|j�}	|D]T}
z|	�
|
�Wn8tk
r�zt�|
�Wntk
r�YnXYq�X|	Sq�dS)Nrz.grail-unixz-*)�glob�pwd�socket�tempfiler.r/�joinZ
gettempdir�getpwuid�getuid�escapeZAF_UNIXZSOCK_STREAMZconnectrQ�unlink)r7r�r�r�r�Ztempdir�user�filenameZmaybes�s�fnrrr�_find_grail_rc�s,�
zGrail._find_grail_rccCs&|��}|sdS|�|�|��dS)Nrr)r��send�close)r7rir�rrr�_remote�s
z
Grail._remoterTcCs2t�d|�|r |�d|�}n|�d|�}|S)Nr@zLOADNEW zLOAD )rKrLr�)r7r&r'r(�okrrrr�s
z
Grail.openN)rT)rr	r
r�r�rrrrrr��sr�cCs�t�d�rtddtd��dtjkr>t�d�r>tddtd��dtjkrbt�d�rbtddtd��dtjkr�t�d�r�tdttd��t�d�r�tddtd��dD]}t�|�r�t|dt|��q�d	D]}t�|�r�t|dt|��q�t�d
��rtd
ttd
��nt�d��r"tdttd��dD]"}t�|��r&t|dt	|���q&t�d
��rftd
dtd
��dD]"}t�|��rjt|dt
|���qjt�d��r�tddtd��t�d��r�tddtd��t�d��r�tdtd�dS)Nzxdg-openZGNOME_DESKTOP_SESSION_IDz	gvfs-openz
gnome-openZKDE_FULL_SESSIONr}z
x-www-browser)�firefoxZ	iceweaselZiceape�	seamonkey)zmozilla-firefoxzmozilla-firebird�firebird�mozilla�netscaperr~)ZgaleonZepiphanyZ	skipstone)z
google-chrome�chromeZchromiumzchromium-browser�operaZmosaicZgrail)
r,r-rr r.�environr|rnrprvrxrzr�)r$rrr�register_X_browsers�sD



r�cCs.gatjdkrNtddtd��tddtd��tddtd��tddtd��tjdd�dkr�td	t�tj�tj	�
d
d�d�}dd
dddd|fD]}t�|�r�t|dt
|��q��ntj	�
d�s�tj	�
d��r&z(d��}tj|tjd�}|����}Wn ttjttfk
�rYnX|at�tj	�
d��r�t�d��rPtddtd��t�d��rltddtd��t�d��r�tddtd��t�d��r�tddtd��t�d��r�tddtd��dtj	k�r*tj	d�tj�}|��|D]>}|dk�r�t|dd�}|d dk�r�t|dt|�dd��q�dS)!N�darwin�MacOSX�defaultr�r�ZsafarirHrIzwindows-defaultZPROGRAMFILESzC:\Program FileszInternet Explorer\IEXPLORE.EXEr�r�r�r�r�ZDISPLAYZWAYLAND_DISPLAYz$xdg-settings get default-web-browser)r^ZTERMzwww-browserZlinksZelinksZlynxZw3mZBROWSERr4Tr
r)rrKrMr�MacOSXOSAScript�WindowsDefaultr.r/r�r�rr,r-r rrNZcheck_outputrc�decode�strip�FileNotFoundErrorZCalledProcessError�PermissionError�NotADirectoryErrorrr�r!r{�pathsep�reverser#)Ziexplorer$r2Z
raw_result�resultZuserchoicesrSrrrrs\

��

rrHrIc@seZdZddd�ZdS)r�rTcCs:t�d|�zt�|�Wntk
r0YdSXdSdS)Nr@FT)rKrLr.Z	startfilerQr:rrrrXszWindowsDefault.openN)rT)rr	r
rrrrrr�Wsr�r�c@s"eZdZdZdd�Zd	dd�ZdS)
r�a{Launcher class for Aqua browsers on Mac OS X

        Optionally specify a browser name on instantiation.  Note that this
        will not work for Aqua browsers if the user has moved the application
        package after installation.

        If no browser is specified, the default browser, as specified in the
        Internet System Preferences panel, will be used.
        cCs
||_dSr5)rr6rrrr8sszMacOSX.__init__rTc	Cs�t�d|�d|kst�d|kr(d|}tt|��}|jdkrPd|�dd�}n<|jd	kr`d
}nd|d}d
|�dd�}d|j||f}t�dd�}|dkr�dS|�	|�|�
�}|S)Nr@�'�:zfile:r��open location "%s"�"�%22ZOmniWebr4ztoWindow %drzOpenURL "%s"z�tell application "%s"
                                activate
                                %s %s
                            end tell�	osascript�wF)rKrL�AssertionErrorra�boolrrCr.�popen�writer�)	r7r&r'r(�scriptZtoWindowr2�osapiperfrrrrvs(


�
zMacOSX.openN)rTrUrrrrr�is	r�c@seZdZdd�Zddd�ZdS)	r�cCs
||_dSr5)�_namer6rrrr8�szMacOSXOSAScript.__init__rTcCsb|jdkrd|�dd�}nd|j|�dd�f}t�dd�}|dkrJdS|�|�|��}|S)	Nr�r�r�r�z�
                   tell application "%s"
                       activate
                       open location "%s"
                   end
                   r�r�F)r�rCr.r�r�r�)r7r&r'r(r�r�rfrrrr�s
�
zMacOSXOSAScript.openN)rT)rr	r
r8rrrrrr��sr�c	
Cs�ddl}dtjd}z|�tjdd�d�\}}WnJ|jk
r~}z*t|tjd�t|tjd�t�d�W5d}~XYnXd}|D]"\}}|dkr�d}q�|dkr�d}q�t|�dkr�t|tjd�t�d�|d}t||�td	�dS)
NrzDUsage: %s [-n | -t] url
    -n: open new window
    -t: open new tabrZntd)�filerwz-tr+�)	�getoptrK�argv�error�printr^�exit�lenr)	r�ZusageZoptsr=�msgZnew_win�o�ar&rrr�main�s,�

r��__main__)N)N)rT)+r<r.rr,rKrNZ	threading�__all__�	Exceptionr�RLockrrrrrrrrrr#�objectr3r!r rYrnrprvrxZChromiumrzr{r|r�r�rrMr�r�r�r�rrrrr�<module>sR
"
"O

	
56AK/
__pycache__/bisect.cpython-38.opt-2.pyc000064400000002024151153537550013625 0ustar00U

e5d��@sVddd�Zddd�Zd
dd�Zddd	�Zzdd
lTWnek
rHYnXeZeZdS)�NcCst||||�}|�||�dS�N)�bisect_right�insert��a�x�lo�hi�r
�/usr/lib64/python3.8/bisect.py�insort_rights	rcCsT|dkrtd��|dkr t|�}||krP||d}|||krF|}q |d}q |S�Nrzlo must be non-negative����
ValueError�len�rrrr	Zmidr
r
rrs
rcCst||||�}|�||�dSr)�bisect_leftrrr
r
r�insort_left$s	rcCsT|dkrtd��|dkr t|�}||krP||d}|||krJ|d}q |}q |Sr
rrr
r
rr1s
r)�*)rN)rN)rN)rN)rrrrZ_bisect�ImportErrorZbisectZinsortr
r
r
r�<module>s



__pycache__/fractions.cpython-38.opt-1.pyc000064400000044465151153537550014362 0ustar00U

e5d	_�@s�dZddlmZddlZddlZddlZddlZddlZddgZdd�Z	dd�Z
ejjZ
ejjZe�d	ejejB�ZGd
d�dej�ZdS)z+Fraction, infinite-precision, real numbers.���DecimalN�Fraction�gcdcCsfddl}|�dtd�t|�tkr2t|�kr\nn&|p<|dkrPt�||�St�||�St||�S)z�Calculate the Greatest Common Divisor of a and b.

    Unless b==0, the result will have the same sign as b (so that when
    b is divided by it, the result comes out positive).
    rNz6fractions.gcd() is deprecated. Use math.gcd() instead.�)�warnings�warn�DeprecationWarning�type�int�mathr�_gcd)�a�br�r�!/usr/lib64/python3.8/fractions.pyrs� cCs|r|||}}q|S�Nr�rrrrrr
 sr
aC
    \A\s*                      # optional whitespace at the start, then
    (?P<sign>[-+]?)            # an optional sign, then
    (?=\d|\.\d)                # lookahead for digit or .digit
    (?P<num>\d*)               # numerator (possibly empty)
    (?:                        # followed by
       (?:/(?P<denom>\d+))?    # an optional denominator
    |                          # or
       (?:\.(?P<decimal>\d*))? # an optional fractional part
       (?:E(?P<exp>[-+]?\d+))? # and optional exponent
    )
    \s*\Z                      # and optional whitespace to finish
cs�eZdZdZdZdRdd��fdd�Zed	d
��Zedd��Zd
d�Z	dSdd�Z
edd��Zedd��Z
dd�Zdd�Zdd�Zdd�Zeeej�\ZZdd�Zeeej�\ZZd d!�Zeeej�\ZZd"d#�Zeeej�\Z Z!d$d%�Z"ee"ej#�\Z$Z%d&d'�Z&ee&e'�\Z(Z)d(d)�Z*ee*ej+�\Z,Z-d*d+�Z.d,d-�Z/d.d/�Z0d0d1�Z1d2d3�Z2d4d5�Z3d6d7�Z4d8d9�Z5dTd:d;�Z6d<d=�Z7d>d?�Z8d@dA�Z9dBdC�Z:dDdE�Z;dFdG�Z<dHdI�Z=dJdK�Z>dLdM�Z?dNdO�Z@dPdQ�ZA�ZBS)Ura]This class implements rational numbers.

    In the two-argument form of the constructor, Fraction(8, 6) will
    produce a rational number equivalent to 4/3. Both arguments must
    be Rational. The numerator defaults to 0 and the denominator
    defaults to 1 so that Fraction(3) == 3 and Fraction() == 0.

    Fractions can also be constructed from:

      - numeric strings similar to those accepted by the
        float constructor (for example, '-2.3' or '1e10')

      - strings of the form '123/456'

      - float and Decimal instances

      - other Rational instances (including integers)

    ��
_numerator�_denominatorrNT��
_normalizecsRtt|��|�}|dk�rdt|�tkr6||_d|_|St|tj	�rV|j
|_|j|_|St|tt
f�rx|��\|_|_|St|t��rZt�|�}|dkr�td|��t|�d�p�d�}|�d�}|r�t|�}nvd}|�d�}|�rdt|�}||t|�}||9}|�d	�}	|	�rBt|	�}	|	d
k�r4|d|	9}n|d|	9}|�d�dk�rb|}ntd
��nft|�tk�r�t|�k�r�nnn@t|tj	��r�t|tj	��r�|j
|j|j
|j}}ntd��|d
k�r�td|��|�rBt|�tk�rt|�k�r(nnt�||�}
|d
k�r2|
}
n
t||�}
||
}||
}||_||_|S)a�Constructs a Rational.

        Takes a string like '3/2' or '1.5', another Rational instance, a
        numerator/denominator pair, or a float.

        Examples
        --------

        >>> Fraction(10, -8)
        Fraction(-5, 4)
        >>> Fraction(Fraction(1, 7), 5)
        Fraction(1, 35)
        >>> Fraction(Fraction(1, 7), Fraction(2, 3))
        Fraction(3, 14)
        >>> Fraction('314')
        Fraction(314, 1)
        >>> Fraction('-35/4')
        Fraction(-35, 4)
        >>> Fraction('3.1415') # conversion from numeric string
        Fraction(6283, 2000)
        >>> Fraction('-47e-2') # string may include a decimal exponent
        Fraction(-47, 100)
        >>> Fraction(1.47)  # direct construction from float (exact conversion)
        Fraction(6620291452234629, 4503599627370496)
        >>> Fraction(2.25)
        Fraction(9, 4)
        >>> Fraction(Decimal('1.47'))
        Fraction(147, 100)

        N�z Invalid literal for Fraction: %rZnum�0�denom�decimal�
�exprZsign�-z2argument should be a string or a Rational instancez+both arguments should be Rational instanceszFraction(%s, 0))�superr�__new__r
rrr�
isinstance�numbers�Rational�	numerator�denominator�floatr�as_integer_ratio�str�_RATIONAL_FORMAT�match�
ValueError�group�len�	TypeError�ZeroDivisionErrorrrr
)�clsr%r&r�self�mrrZscaler�g��	__class__rrr!Tsx

�





$
�

�
$

zFraction.__new__cCsDt|tj�r||�St|t�s8td|j|t|�jf��||���S)z�Converts a finite float to a rational number, exactly.

        Beware that Fraction.from_float(0.3) != Fraction(3, 10).

        z.%s.from_float() only takes floats, not %r (%s))r"r#�Integralr'r/�__name__r
r()r1�frrr�
from_float�s
�zFraction.from_floatcCsVddlm}t|tj�r&|t|��}n$t||�sJtd|j|t|�jf��||�	��S)zAConverts a finite Decimal instance to a rational number, exactly.rrz2%s.from_decimal() only takes Decimals, not %r (%s))
rrr"r#r7rr/r8r
r()r1Zdecrrrr�from_decimal�s
��zFraction.from_decimalcCs|j|jfS)z�Return the integer ratio as a tuple.

        Return a tuple of two integers, whose ratio is equal to the
        Fraction and with a positive denominator.
        r�r2rrrr(�szFraction.as_integer_ratio�@Bc
Cs�|dkrtd��|j|kr"t|�Sd\}}}}|j|j}}||}|||}	|	|krZq�||||||	f\}}}}||||}}q<|||}
t||
|||
|�}t||�}t||�t||�kr�|S|SdS)aWClosest Fraction to self with denominator at most max_denominator.

        >>> Fraction('3.141592653589793').limit_denominator(10)
        Fraction(22, 7)
        >>> Fraction('3.141592653589793').limit_denominator(100)
        Fraction(311, 99)
        >>> Fraction(4321, 8765).limit_denominator(10000)
        Fraction(4321, 8765)

        rz$max_denominator should be at least 1)rrrrN)r,rrr�abs)
r2Zmax_denominatorZp0Zq0Zp1Zq1�n�drZq2�kZbound1Zbound2rrr�limit_denominator�s$ 

zFraction.limit_denominatorcCs|jSr)r�rrrrr%szFraction.numeratorcCs|jSr)rrCrrrr&szFraction.denominatorcCsd|jj|j|jfS)z
repr(self)z
%s(%s, %s))r6r8rrr<rrr�__repr__"s�zFraction.__repr__cCs(|jdkrt|j�Sd|j|jfSdS)z	str(self)rz%s/%sN)rr)rr<rrr�__str__'s

zFraction.__str__csT��fdd�}d�jd|_�j|_��fdd�}d�jd|_�j|_||fS)a�Generates forward and reverse operators given a purely-rational
        operator and a function from the operator module.

        Use this like:
        __op__, __rop__ = _operator_fallbacks(just_rational_op, operator.op)

        In general, we want to implement the arithmetic operations so
        that mixed-mode operations either call an implementation whose
        author knew about the types of both arguments, or convert both
        to the nearest built in type and do the operation there. In
        Fraction, that means that we define __add__ and __radd__ as:

            def __add__(self, other):
                # Both types have numerators/denominator attributes,
                # so do the operation directly
                if isinstance(other, (int, Fraction)):
                    return Fraction(self.numerator * other.denominator +
                                    other.numerator * self.denominator,
                                    self.denominator * other.denominator)
                # float and complex don't have those operations, but we
                # know about those types, so special case them.
                elif isinstance(other, float):
                    return float(self) + other
                elif isinstance(other, complex):
                    return complex(self) + other
                # Let the other type take over.
                return NotImplemented

            def __radd__(self, other):
                # radd handles more types than add because there's
                # nothing left to fall back to.
                if isinstance(other, numbers.Rational):
                    return Fraction(self.numerator * other.denominator +
                                    other.numerator * self.denominator,
                                    self.denominator * other.denominator)
                elif isinstance(other, Real):
                    return float(other) + float(self)
                elif isinstance(other, Complex):
                    return complex(other) + complex(self)
                return NotImplemented


        There are 5 different cases for a mixed-type addition on
        Fraction. I'll refer to all of the above code that doesn't
        refer to Fraction, float, or complex as "boilerplate". 'r'
        will be an instance of Fraction, which is a subtype of
        Rational (r : Fraction <: Rational), and b : B <:
        Complex. The first three involve 'r + b':

            1. If B <: Fraction, int, float, or complex, we handle
               that specially, and all is well.
            2. If Fraction falls back to the boilerplate code, and it
               were to return a value from __add__, we'd miss the
               possibility that B defines a more intelligent __radd__,
               so the boilerplate should return NotImplemented from
               __add__. In particular, we don't handle Rational
               here, even though we could get an exact answer, in case
               the other type wants to do something special.
            3. If B <: Fraction, Python tries B.__radd__ before
               Fraction.__add__. This is ok, because it was
               implemented with knowledge of Fraction, so it can
               handle those instances before delegating to Real or
               Complex.

        The next two situations describe 'b + r'. We assume that b
        didn't know about Fraction in its implementation, and that it
        uses similar boilerplate code:

            4. If B <: Rational, then __radd_ converts both to the
               builtin rational type (hey look, that's us) and
               proceeds.
            5. Otherwise, __radd__ tries to find the nearest common
               base ABC, and fall back to its builtin type. Since this
               class doesn't subclass a concrete type, there's no
               implementation to fall back to, so we need to try as
               hard as possible to return an actual value, or the user
               will get a TypeError.

        csPt|ttf�r�||�St|t�r0�t|�|�St|t�rH�t|�|�StSdSr)r"rrr'�complex�NotImplementedr��fallback_operator�monomorphic_operatorrr�forward~s


z-Fraction._operator_fallbacks.<locals>.forward�__csZt|tj�r�||�St|tj�r4�t|�t|��St|tj�rR�t|�t|��StSdSr)r"r#r$ZRealr'�ComplexrFrG�rrrHrr�reverse�s
z-Fraction._operator_fallbacks.<locals>.reverseZ__r)r8�__doc__)rJrIrKrOrrHr�_operator_fallbacks.sP	
zFraction._operator_fallbackscCs,|j|j}}t|j||j|||�S)za + b�r&rr%�rr�da�dbrrr�_add�s�z
Fraction._addcCs,|j|j}}t|j||j|||�S)za - brRrSrrr�_sub�s�z
Fraction._subcCst|j|j|j|j�S)za * b�rr%r&rrrr�_mul�sz
Fraction._mulcCst|j|j|j|j�S)za / brXrrrr�_div�s
�z
Fraction._divcCs|j|j|j|jS)za // b�r%r&rrrr�	_floordiv�szFraction._floordivcCs:|j|j}}t|j|||j�\}}|t|||�fS)z(a // b, a % b))r&�divmodr%r)rrrTrUZdivZn_modrrr�_divmod�szFraction._divmodcCs,|j|j}}t|j||j|||�S)za % brRrSrrr�_mod�sz
Fraction._modcCs�t|tj�r�|jdkr�|j}|dkr>t|j||j|dd�S|jdkrft|j||j|dd�St|j||j|dd�Sq�t|�t|�Snt|�|SdS)z�a ** b

        If b is not an integer, the result will be a float or complex
        since roots are generally irrational. If b is an integer, the
        result will be rational.

        rrFrN)	r"r#r$r&r%rrrr')rrZpowerrrr�__pow__�s&

�

��zFraction.__pow__cCs\|jdkr|jdkr||jSt|tj�r<t|j|j�|S|jdkrP||jS|t|�S)za ** brr)	rrr"r#r$rr%r&r'rNrrr�__rpow__�s


zFraction.__rpow__cCst|j|jdd�S)z++a: Coerces a subclass instance to FractionFr�rrrrCrrr�__pos__�szFraction.__pos__cCst|j|jdd�S)z-aFrrbrCrrr�__neg__�szFraction.__neg__cCstt|j�|jdd�S)zabs(a)Fr)rr>rrrCrrr�__abs__�szFraction.__abs__cCs*|jdkr|j|jS|j|jSdS)ztrunc(a)rNrrCrrr�	__trunc__s
zFraction.__trunc__cCs|j|jS)z
math.floor(a)r[rCrrr�	__floor__
szFraction.__floor__cCs|j|jS)zmath.ceil(a)r[rCrrr�__ceil__szFraction.__ceil__cCs�|dkrZt|j|j�\}}|d|jkr,|S|d|jkrB|dS|ddkrR|S|dSdt|�}|dkr�tt||�|�Stt||�|�SdS)z?round(self, ndigits)

        Rounds half toward even.
        Nrrrr)r]r%r&r>r�round)r2ZndigitsZfloorZ	remainder�shiftrrr�	__round__szFraction.__round__cCsPt|jtdt�}|st}nt|j�|t}|dkr:|n|}|dkrLdS|S)z
hash(self)rr������)�powr�_PyHASH_MODULUS�_PyHASH_INFr>r)r2ZdinvZhash_�resultrrr�__hash__,szFraction.__hash__cCs�t|�tkr |j|ko|jdkSt|tj�rD|j|jkoB|j|jkSt|tj	�r`|j
dkr`|j}t|t�r�t
�|�s~t
�|�r�d|kS||�|�kSntSdS)za == brr�N)r
rrrr"r#r$r%r&rM�imag�realr'r�isnan�isinfr:rGrrrr�__eq__Bs
�
zFraction.__eq__cCsht|tj�r&||j|j|j|j�St|t�r`t�	|�sDt�
|�rN|d|�S|||�|��SntSdS)acHelper for comparison operators, for internal use only.

        Implement comparison between a Rational instance `self`, and
        either another Rational instance or a float `other`.  If
        `other` is not a Rational instance or a float, return
        NotImplemented. `op` should be one of the six standard
        comparison operators.

        rsN)
r"r#r$rr&rr%r'rrvrwr:rG)r2�other�oprrr�_richcmpWs
�

zFraction._richcmpcCs|�|tj�S)za < b)r{�operator�ltrrrr�__lt__mszFraction.__lt__cCs|�|tj�S)za > b)r{r|�gtrrrr�__gt__qszFraction.__gt__cCs|�|tj�S)za <= b)r{r|�lerrrr�__le__uszFraction.__le__cCs|�|tj�S)za >= b)r{r|�gerrrr�__ge__yszFraction.__ge__cCs
t|j�S)za != 0)�boolrrCrrr�__bool__}szFraction.__bool__cCs|jt|�ffSr)r6r)r<rrr�
__reduce__�szFraction.__reduce__cCs t|�tkr|S|�|j|j�Sr�r
rr6rrr<rrr�__copy__�szFraction.__copy__cCs t|�tkr|S|�|j|j�Srr�)r2Zmemorrr�__deepcopy__�szFraction.__deepcopy__)rN)r=)N)Cr8�
__module__�__qualname__rP�	__slots__r!�classmethodr:r;r(rB�propertyr%r&rDrErQrVr|�add�__add__�__radd__rW�sub�__sub__�__rsub__rY�mul�__mul__�__rmul__rZ�truediv�__truediv__�__rtruediv__r\�floordiv�__floordiv__�
__rfloordiv__r^r]�
__divmod__�__rdivmod__r_�mod�__mod__�__rmod__r`rarcrdrerfrgrhrkrrrxr{r~r�r�r�r�r�r�r��
__classcell__rrr5rr<sdm



7

k
)rPrrrr#r|�re�sys�__all__rr
�	hash_info�modulusro�infrp�compile�VERBOSE�
IGNORECASEr*r$rrrrr�<module>s
�__pycache__/netrc.cpython-38.pyc000064400000007303151153537550012534 0ustar00U

e5d��@sXdZddlZddlZddlZddgZGdd�de�ZGdd�d�ZedkrTe	e��dS)z-An object-oriented interface to .netrc files.�N�netrc�NetrcParseErrorc@s"eZdZdZddd�Zdd�ZdS)rz5Exception raised on syntax errors in the .netrc file.NcCs"||_||_||_t�||�dS)N)�filename�lineno�msg�	Exception�__init__)�selfrrr�r
�/usr/lib64/python3.8/netrc.pyrszNetrcParseError.__init__cCsd|j|j|jfS)Nz%s (%s, line %s))rrr)r	r
r
r�__str__szNetrcParseError.__str__)NN)�__name__�
__module__�__qualname__�__doc__rrr
r
r
rr
s
c@s.eZdZd
dd�Zdd�Zdd�Zdd	�ZdS)rNc	CsX|dk}|dkr&tj�tj�d�d�}i|_i|_t|��}|�|||�W5QRXdS)N�~z.netrc)�os�path�join�
expanduser�hosts�macros�open�_parse)r	�file�
default_netrc�fpr
r
rrs
znetrc.__init__cCs�t�|�}|jd7_|j�dd�|_|j}|��}}|sD�q�n�|ddkrt|j|kr(t|�dkr(|j��q(n�|dkr�|��}nt|dkr�d}nf|dkr�|��}g|j	|<d	|_
|j��}	|	r�|	d
kr�d|_
q(|j	|�|	�q�q(ntd|||j��d}
d}}i|j
|<|��}|�d��s.|d
k�rr|�rR|
||f|j
|<|�|�q(ntd||t|�f||j���q|dk�s�|dk�r�|��}
�q|dk�r�|��}�q|dk�r�tjdk�r�|�r�t�|���}
|
jt��k�rpddl}z|�|
j�d}Wn tk
�rd|
j}YnXz|�t���d}Wn"tk
�rXdt��}YnXtd||f||j��|
jtjtjB@�r�td||j��|��}ntd|||j���qq(dS)Nz !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~�#�r��machine�default�macdefz 	�
z 	
zbad toplevel token %r>rr"r!r z&malformed %s entry %s terminated by %s�login�user�account�password�posixzuid %sz9~/.netrc file owner (%s) does not match current user (%s)zY~/.netrc access too permissive: access permissions must restrict access to only the ownerzbad follower token %r)�shlexZ	wordcharsZ
commenters�replacerZ	get_token�lenZinstream�readlinerZ
whitespace�appendrr�
startswithZ
push_token�reprr�name�fstat�fileno�st_uid�getuid�pwd�getpwuid�KeyError�st_mode�stat�S_IRWXG�S_IRWXO)r	rrrZlexerZsaved_linenoZtoplevelZttZ	entryname�liner$r&r'Zpropr5Zfownerr%r
r
rr s�




�
�
��

���
�znetrc._parsecCs0||jkr|j|Sd|jkr(|jdSdSdS)z8Return a (user, account, password) tuple for given host.r!N)r)r	�hostr
r
r�authenticatorsqs




znetrc.authenticatorscCs�d}|j��D]X}|j|}|d|�d|d�d�7}|drR|d|d�d�7}|d|d	�d�7}q|j��D]4}|d
|�d�7}|j|D]}||7}q�|d7}qr|S)z3Dump the class data in the format of a .netrc file.rzmachine z
	login rr#rz		account z
	password �zmacdef )r�keysr)r	Zrepr=�attrsZmacror<r
r
r�__repr__zs


znetrc.__repr__)N)r
rrrrr>rBr
r
r
rrs
	Q	�__main__)
rrr)r9�__all__rrrr
�printr
r
r
r�<module>st__pycache__/_strptime.cpython-38.opt-2.pyc000064400000030036151153537550014366 0ustar00U

e5d�b�@s�ddlZddlZddlZddlmZddlmZddlmZddl	m
ZmZ
mZddlmZgZdd�ZGd	d
�d
e�ZGdd�de�Ze�Ze�ad
Ziadd�Zdd�Zddd�Zddd�Z ddd�Z!dS)�N)�compile)�
IGNORECASE)�escape)�date�	timedelta�timezone)�
allocate_lockcCst�tj�S�N)�localeZ	getlocale�LC_TIME�rr�!/usr/lib64/python3.8/_strptime.py�_getlangsrc@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�
LocaleTimecCsht�|_|��|��|��|��|��t�|jkrDtd��tj	|j	ks\tj
|j
krdtd��dS)Nz$locale changed during initializationz&timezone changed during initialization)r�lang�_LocaleTime__calc_weekday�_LocaleTime__calc_month�_LocaleTime__calc_am_pm�_LocaleTime__calc_timezone�_LocaleTime__calc_date_time�
ValueError�time�tzname�daylight)�selfrrr
�__init__1szLocaleTime.__init__cCs4dd�td�D�}dd�td�D�}||_||_dS)NcSsg|]}tj|���qSr)�calendarZday_abbr�lower��.0�irrr
�
<listcomp>Ssz-LocaleTime.__calc_weekday.<locals>.<listcomp>�cSsg|]}tj|���qSr)rZday_namerrrrr
r!Ts)�range�	a_weekday�	f_weekday)rr$r%rrr
Z__calc_weekdayPszLocaleTime.__calc_weekdaycCs4dd�td�D�}dd�td�D�}||_||_dS)NcSsg|]}tj|���qSr)rZ
month_abbrrrrrr
r!Zsz+LocaleTime.__calc_month.<locals>.<listcomp>�
cSsg|]}tj|���qSr)rZ
month_namerrrrr
r![s)r#�a_month�f_month)rr'r(rrr
Z__calc_monthXszLocaleTime.__calc_monthcCsJg}dD]6}t�ddd|ddddd	f	�}|�t�d
|����q||_dS)N)�������,�7��Lr�%p)r�struct_time�append�strftimer�am_pm)rr6�hour�
time_tuplerrr
Z__calc_am_pm_s
zLocaleTime.__calc_am_pmc
CsJt�d�}dddg}t�d|���|d<t�d|���|d<t�d|���|d<d|jdd	f|jd
df|jddf|jd
d
f|jddfdddddddddddg}|�	dd�|j
D��dD]d\}}||}|D]\}}|r�|�||�}q�t�d�}dt�||�k�rd}	nd }	|�d!|	�||<q�|d|_|d|_
|d|_dS)"N)	r+r,r-r*r.r/r0r1r�%cr�%xr)�%Xr0)�%z%%z%Ar,z%Bz%az%br2)Z1999z%Y)Z99z%y)Z22z%H)Z44z%M)Z55z%S)Z76z%j)Z17z%d)Z03�%m)�3r=)�2z%w)Z10z%IcSsg|]}|D]}|df�qqS)z%Zr)r�	tz_values�tzrrr
r!�s�z/LocaleTime.__calc_date_time.<locals>.<listcomp>))rr9)r)r:)r0r;)	r+r)r,r)r)r)�r,rZ00z%Wz%UZ11)rr3r5rr%r(r$r'r6�extendr�replace�LC_date_time�LC_date�LC_time)
rr8Z	date_timeZreplacement_pairs�offset�	directiveZcurrent_format�old�newZU_Wrrr
Z__calc_date_timeksH

�


zLocaleTime.__calc_date_timecCszzt��Wntk
r YnXtj|_tj|_tdd|jd��h�}|jrft|jd��h�}nt�}||f|_dS)N�utc�gmtrr))r�tzset�AttributeErrorrr�	frozensetrr)rZ	no_savingZ
has_savingrrr
Z__calc_timezone�szLocaleTime.__calc_timezoneN)	�__name__�
__module__�__qualname__rrrrrrrrrr
rs-rcs6eZdZd
�fdd�	Zdd�Zdd�Zdd	�Z�ZS)�TimeRENcs|r||_nt�|_t�}|�ddddddddd	d
ddd
ddd|�|jjd�|�|jjd�|�|jjdd�d�|�|jjdd�d�|�|jj	d�|�dd�|jj
D�d�dd��|�d|�d��
dd��|�d|�|jj��|�d|�|jj��|�d |�|jj��dS)!Nz)(?P<d>3[0-1]|[1-2]\d|0[1-9]|[1-9]| [1-9])z(?P<f>[0-9]{1,6})z(?P<H>2[0-3]|[0-1]\d|\d)z(?P<I>1[0-2]|0[1-9]|[1-9])z(?P<G>\d\d\d\d)zG(?P<j>36[0-6]|3[0-5]\d|[1-2]\d\d|0[1-9]\d|00[1-9]|[1-9]\d|0[1-9]|[1-9])z(?P<m>1[0-2]|0[1-9]|[1-9])z(?P<M>[0-5]\d|\d)z(?P<S>6[0-1]|[0-5]\d|\d)z(?P<U>5[0-3]|[0-4]\d|\d)z(?P<w>[0-6])z(?P<u>[1-7])z(?P<V>5[0-3]|0[1-9]|[1-4]\d|\d)z(?P<y>\d\d)z(?P<Y>\d\d\d\d)z2(?P<z>[+-]\d\d:?[0-5]\d(:?[0-5]\d(\.\d{1,6})?)?|Z)�A�ar)�B�b�pcss|]}|D]
}|Vq
qdSr	r)rZtz_namesrArrr
�	<genexpr>�s�z"TimeRE.__init__.<locals>.<genexpr>�Zr<)�d�f�H�I�G�j�m�M�S�U�w�u�V�y�Y�zrUrVrWrXrYr[r<�Wre�c�x�X)�locale_timer�superr�_TimeRE__seqToREr%r$r(r'r6r�__setitem__�__getitem__rD�patternrErFrG)rrp�base��	__class__rr
r�sF��zTimeRE.__init__cCsPt|tdd�}|D]}|dkrq(qdSd�dd�|D��}d||f}d|S)	NT)�key�reverse��|css|]}t|�VqdSr	)�	re_escape)rZstuffrrr
rZ�sz#TimeRE.__seqToRE.<locals>.<genexpr>z	(?P<%s>%sz%s))�sorted�len�join)rZ
to_convertrI�valueZregexrrr
Z	__seqToRE�s	zTimeRE.__seqToREcCs�d}td�}|�d|�}td�}|�d|�}d|krv|�d�d}d||d|d�|||f}||dd�}q,d	||fS)
Nr{z([\\.^$*+?\(\){}\[\]|])z\\\1z\s+z\\s+r<r)z%s%s%sz%s%s)�
re_compile�sub�index)r�formatZprocessed_formatZregex_charsZwhitespace_replacementZdirective_indexrrr
ru�s
�zTimeRE.patterncCst|�|�t�Sr	)r�rur)rr�rrr
rszTimeRE.compile)N)rQrRrSrrrrur�
__classcell__rrrwr
rT�s.rT�cCslt|dd���}|s,|dd}|dd}d|d}|dkrLd||S|d|d}d||SdS)Nr)r"r)�
datetime_date�weekday)�year�week_of_yearZday_of_week�week_starts_MonZ
first_weekdayZ
week_0_lengthZdays_to_weekrrr
�_calc_julian_from_U_or_Wsr�cCsdt|dd���d}|d||}|dkr\|t|dd���7}|d8}|t|dd���8}||fS)Nr)�r,r")r�Z
isoweekday�	toordinal)�iso_year�iso_weekZiso_weekdayZ
correctionZordinalrrr
�_calc_julian_from_V%sr��%a %b %d %H:%M:%S %Yc,Cs.t||g�D]*\}}t|t�sd}t|�|t|����qt��tj}t	�|j
kshtj|jkshtj
|j
kr|t�at��tj}tt�tkr�t��t�|�}|�s&zt�|�}Wnntk
r�}z.|jd}|dkr�d}~td||f�d�W5d}~XYn$tk
�rtd|�d�YnX|t|<W5QRX|�|�}	|	�sPtd||f��t|�|	��k�rztd||	��d���d}
}d	}}
d}}}}d
}d}d}d}}d}d}}|	��}|��D�]d}|dk�rt|d�}|dk�r�|d
7}n|d7}�q�|dk�r t|d�}�q�|dk�r:t|d�}
�q�|dk�rTt|d�}�q�|dk�rv|j�|d� ��}�q�|dk�r�|j!�|d� ��}�q�|dk�r�t|d�}
�q�|dk�r�t|d�}�q�|dk�r<t|d�}|�dd�� �}|d|j"dfk�r|dk�r8d}n"||j"d	k�r.|dk�r.|d7}�q�|dk�rVt|d�}�q�|dk�rpt|d�}�q�|dk�r�|d}|ddt|�7}t|�}�q�|dk�r�|j#�|d� ��}�q�|d k�r�|j$�|d � ��}�q�|d!k�rt|d!�}|dk�rd}n|d	8}�q�|d"k�r:t|d"�}|d	8}�q�|d#k�rTt|d#�}�q�|d$k�r�t||�}|d%k�rzd}nd}�q�|d&k�r�t|d&�}�q�|d'k�r�|d'}|d(k�r�d}n�|d)d*k�r.|dd)�|d+d�}t|�d,k�r.|d,d*k�rd-|d'��}t|��|dd,�|dd�}t|d	d)��}t|d)d,��} t|d,d.��p`d�}!|d/d/| d/|!}|d0d�}"ddt|"�}#t|"|#�}|�%d1��r.|}|}np|d(k�r�|d(� �}$t|j&�D]N\}%}&|$|&k�r�tjdtjd	k�r tj
�r |$d2k�r �q�n
|%}�qʐqސq�|dk�rv|
dk	�rv|dk�sZ|dk�rbtd3��|dk	�r�td4��n0|dk�r�|dk	�r�|dk�r�td5��ntd6��d7}'|dk�r�|d8k�r�|
d9k�r�d:}d;}'n|dk�r�d}|dk�r�|dk	�r�|dk	�r |dk�rd;nd7}(t'||||(�}n(|
dk	�rH|dk	�rHt(|
||d	�\}}|dk	�r�|dk�r�|d	8}t)�*|��rtd<nd=})||)7}|dk�r�t+|||
��,�t+|d	d	��,�d	}n0t+�-|d	t+|d	d	��,��}*|*j.}|*j/}|*j0}
|dk�r�t+|||
��1�}|�d(�}+|'�rd}|||
|||||||+|f||fS)>Nz*strptime() argument {} must be str, not {}r�\r<z&'%s' is a bad directive in format '%s'zstray %% in format '%s'z%time data %r does not match format %rzunconverted data remains: %sr)���ri�Di�ilrjr`rbrWrXr\r^r_rYr{�rcrdr]�0rBrUrVrfrgra)rerlrerhrkr[r,�:r�r�zInconsistent use of : in r"�<��-)rLrMzzISO year directive '%G' must be used with the ISO week directive '%V' and a weekday directive ('%A', '%a', '%w', or '%u').z`Day of the year directive '%j' is not compatible with ISO year directive '%G'. Use '%Y' instead.zzISO week directive '%V' must be used with the ISO year directive '%G' and a weekday directive ('%A', '%a', '%w', or '%u').zdISO week directive '%V' is incompatible with the year directive '%Y'. Use the ISO year '%G' instead.Fr0�ipTinim)2�	enumerate�
isinstance�str�	TypeErrorr��type�_cache_lock�
_TimeRE_cacherprrrrrrT�_regex_cache�clearr�_CACHE_MAX_SIZE�getr�KeyError�argsr�
IndexError�match�end�	groupdict�keys�intr(r�rr'r6r%r$�
startswithrr�r�rZisleapr�r�Zfromordinalr��month�dayr�),�data_stringr�r��arg�msgrpZformat_regex�errZ
bad_directive�foundr�r�r�r�r7Zminute�second�fractionrA�gmtoff�gmtoff_fractionr�r�Zweek_of_year_startr�ZjulianZ
found_dictZ	group_keyZampm�srkZhoursZminutes�secondsZgmtoff_remainderZgmtoff_remainder_paddingZ
found_zoner�r@Z
leap_year_fixr�ZydayZdatetime_resultrrrr
�	_strptime5s�

�
�

��
��




























��





�
����

��r�cCs"t||�d}t�|dtj��S)Nr)r�rr3�_STRUCT_TM_ITEMS)r�r��ttrrr
�_strptime_time/sr�cCspt||�\}}}|dd�\}}|dd�|f}|dk	rht||d�}	|rVt|	|�}
nt|	�}
||
f7}||�S)N���rB)r�Zmicroseconds)r��datetime_timedelta�datetime_timezone)�clsr�r�r�r�r�rr�r�ZtzdeltarArrr
�_strptime_datetime5s
r�)r�)r�)r�)"rr
r�rerr�rrr}Zdatetimerr�rr�rr��_threadrZ_thread_allocate_lock�__all__r�objectr�dictrTr�r�r�r�r�r�r�r�r�rrrr
�<module>
s,
_
{
__pycache__/pdb.cpython-38.opt-1.pyc000064400000134105151153537550013126 0ustar00U

e5d��"@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZGdd�de�Zddddd	d
ddd
g	Zdd�Zdd�Zdd�ZGdd�de�ZdZGdd�dejej�Zedk	�rnd
ddddddddd d!d"d#d$d%d&d'd(dd)d*d+d,d-d.d/d0d1d2d3d4d5d6d7g"ZeD]"Zeeed8e�j��d97Z�q:eej j7Z[[dJd:d�Z!dKd;d�Z"d<d	�Z#d=d
�Z$dd>�d?d�Z%dLd@d�Z&dAd�Z'dBZ(dCdD�Z)dEd
�Z*dFZ+dGdH�Z,e-dIk�r�ddl.Z.e.�,�dS)Ma�	
The Python Debugger Pdb
=======================

To use the debugger in its simplest form:

        >>> import pdb
        >>> pdb.run('<a statement>')

The debugger's prompt is '(Pdb) '.  This will stop in the first
function call in <a statement>.

Alternatively, if a statement terminated with an unhandled exception,
you can use pdb's post-mortem facility to inspect the contents of the
traceback:

        >>> <a statement>
        <exception traceback>
        >>> import pdb
        >>> pdb.pm()

The commands recognized by the debugger are listed in the next
section.  Most can be abbreviated as indicated; e.g., h(elp) means
that 'help' can be typed as 'h' or 'help' (but not as 'he' or 'hel',
nor as 'H' or 'Help' or 'HELP').  Optional arguments are enclosed in
square brackets.  Alternatives in the command syntax are separated
by a vertical bar (|).

A blank line repeats the previous command literally, except for
'list', where it lists the next 11 lines.

Commands that the debugger doesn't recognize are assumed to be Python
statements and are executed in the context of the program being
debugged.  Python statements can also be prefixed with an exclamation
point ('!').  This is a powerful way to inspect the program being
debugged; it is even possible to change variables or call functions.
When an exception occurs in such a statement, the exception name is
printed but the debugger's state is not changed.

The debugger supports aliases, which can save typing.  And aliases can
have parameters (see the alias help entry) which allows one a certain
level of adaptability to the context under examination.

Multiple commands may be entered on a single line, separated by the
pair ';;'.  No intelligence is applied to separating the commands; the
input is split at the first ';;', even if it is in the middle of a
quoted string.

If a file ".pdbrc" exists in your home directory or in the current
directory, it is read in and executed as if it had been typed at the
debugger prompt.  This is particularly useful for aliases.  If both
files exist, the one in the home directory is read first and aliases
defined there can be overridden by the local file.  This behavior can be
disabled by passing the "readrc=False" argument to the Pdb constructor.

Aside from aliases, the debugger is not directly programmable; but it
is implemented as a class from which you can derive your own debugger
class, which you can make as fancy as you like.


Debugger commands
=================

�Nc@seZdZdZdS)�RestartzBCauses a debugger to be restarted for the debugged python program.N)�__name__�
__module__�__qualname__�__doc__�rr�/usr/lib64/python3.8/pdb.pyrWsr�run�pm�Pdb�runeval�runctx�runcall�	set_trace�post_mortem�helpc
Cs�t�dt�|��}zt�|�}Wntk
r8YdSX|�@t|dd�D],\}}|�|�rL|||fW5QR�SqLW5QRXdS)Nzdef\s+%s\s*[(]�)�start)�re�compile�escape�tokenize�open�OSError�	enumerate�match)�funcname�filenameZcre�fp�lineno�linerrr�
find_function^s
&r!cCsXt�|�\}}t�|�r,|j|jkr,|dfSt�|�r>|dfSt�||d��|dfS)Nr)�inspectZ
findsourceZisframe�	f_globals�f_localsZismoduleZgetblock)�obj�linesrrrr�getsourcelinesks
r'cCs8tt�|��}|��|D]\}}||kr|SqdS�Nr)�list�disZfindlinestarts�reverse)�codeZlastiZ
linestarts�irrrr�lasti2linenots
r.c@seZdZdZdd�ZdS)�_rstrz#String that doesn't quote its repr.cCs|S�Nr��selfrrr�__repr__sz_rstr.__repr__N)rrrrr3rrrrr/}sr/z
-> c@seZdZdZd�dd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�ZeZd�d8d9�Zd:d;�ZeZ eZ!eZ"d<d=�Z#eZ$d>d?�Z%d@dA�Z&dBdC�Z'eZ(dDdE�Z)eZ*dFdG�Z+eZ,dHdI�Z-eZ.dJdK�Z/e/Z0eZ1eZ2dLdM�Z3e3Z4e3Z5dNdO�Z6dPdQ�Z7e7Z8dRdS�Z9e9Z:dTdU�Z;e;Z<dVdW�Z=e=Z>dXdY�Z?e?Z@dZd[�ZAeAZBd\d]�ZCeCZDd^d_�ZEeEZFZGd`da�ZHeHZIdbdc�ZJeZKddde�ZLeLZMeLZNdfdg�ZOdhdi�ZPePZQdjdk�ZReRZSdldm�ZTd�dndo�ZUdpdq�ZVdrds�ZWeZXeZYeZZdtdu�Z[e[Z\dvdw�Z]e]Z^dxdy�Z_eZ`d�d{d|�Zad}d~�ZbeZcdd��ZdeZed�d��Zfd�d��Zgd�d��Zhd�d��Zid�d��Zjd�d��Zkd�d�d�d�d�d�gZld�d��Zmenfd�d��Zod�d��ZpepZqd�d��Zrd�d��Zsd�d��Ztd�d��Zud�d��ZvdS)�rN�tabFTc		Cs>tjj||d�tj�||||�t�d�|r6d|_d|_i|_	i|_
d|_d|_i|_
zddl}|�d�Wntk
r�YnXd|_||_g|_|�rz,ttj�d���}|j�|�W5QRXWntk
r�YnXz$td	��}|j�|�W5QRXWntk
�rYnXi|_i|_i|_d|_d|_dS)
N)�skipzpdb.Pdbrz(Pdb) �Fz 	
`@#$%^&*()=+[{]}\|;:'",<>?z~/.pdbrcz.pdbrc)�bdb�Bdb�__init__�cmd�Cmd�sys�auditZuse_rawinput�prompt�aliases�
displaying�
mainpyfile�_wait_for_mainpyfile�	tb_lineno�readlineZset_completer_delims�ImportError�allow_kbdint�nosigint�rcLinesr�os�path�
expanduser�extendr�commands�commands_doprompt�commands_silent�commands_defining�
commands_bnum)	r2�completekey�stdin�stdoutr5rGZreadrcrDZrcFilerrrr9�sF

zPdb.__init__cCs*|jr
t�|�d�|��|�|�dS)Nz-
Program interrupted. (Use 'cont' to resume).)rF�KeyboardInterrupt�message�set_stepr)r2Zsignum�framerrr�sigint_handler�s

zPdb.sigint_handlercCstj�|�|��dSr0)r7r8�reset�forgetr1rrrrZ�sz	Pdb.resetcCs&d|_g|_d|_d|_|j��dSr()r�stack�curindex�curframerC�clearr1rrrr[�s
z
Pdb.forgetcCsh|��|�||�\|_|_|rDt|jj|j�}||j|j<|j	}q|j|jd|_
|j
j|_|�
�Sr()r[Z	get_stackr\r]r.�tb_frame�f_code�tb_lastirC�tb_nextr^r$�curframe_locals�execRcLines)r2�f�tbrrrr�setup�s
z	Pdb.setupcCsd|js
dS|j}|��g|_|r`|����}|r|ddkr|�|�r|jt|�7_dSqdS)Nr�#T)rHr+�pop�strip�onecmd�reversed)r2rHr rrrre�s
zPdb.execRcLinescCs.|jr
dS|�|�r*|�d�|�|d�dS)znThis method is called when there is the remote possibility
        that we ever need to stop in this function.Nz--Call--)rBZ	stop_hererV�interaction)r2rXZ
argument_listrrr�	user_call�s


z
Pdb.user_callcCsH|jr.|j|�|jj�ks$|jdkr(dSd|_|�|�rD|�|d�dS)z;This function is called when we stop or break at this line.rNF)rBrA�canonicra�co_filename�f_lineno�bp_commandsrn)r2rXrrr�	user_line�s�
z
Pdb.user_linecCs�t|dd�r�|j|jkr�|j}d|_|j}|�|d�|j|D]}|�|�q@||_|j|sr|�|j|j	�|j
|r�|��|��dSdS)z�Call every command that was set for the current active breakpoint
        (if there is one).

        Returns True if the normal interaction function must be called,
        False otherwise.�	currentbpFrNr)
�getattrrurM�lastcmdrhrlrO�print_stack_entryr\r]rN�_cmdloopr[)r2rXruZlastcmd_backr rrrrss"
�

zPdb.bp_commandscCs.|jr
dS||jd<|�d�|�|d�dS)z7This function is called when a return trap is set here.N�
__return__z
--Return--)rBr$rVrn)r2rXZreturn_valuerrr�user_return s


zPdb.user_returncCsh|jr
dS|\}}}||f|jd<|s2|tkr2dnd}|�d|t�||�d��f�|�||�dS)zoThis function is called if an exception occurs,
        but only if we are to stop at or just below this level.NZ
__exception__z	Internal r6z%s%s���)rBr$�
StopIterationrV�	traceback�format_exception_onlyrkrn)r2rX�exc_info�exc_type�	exc_value�
exc_traceback�prefixrrr�user_exception(s
���zPdb.user_exceptioncCsBzd|_|��d|_Wq>Wqtk
r:|�d�YqXqdS)NTFz--KeyboardInterrupt--)rF�cmdlooprUrVr1rrrry<szPdb._cmdloopcCs^|j�|j�}|rZ|��D]>\}}|�|�}||k	r||kr|||<|�d|||f�qdS)Nzdisplay %s: %r  [old: %r])r@�getr^�items�_getval_exceptrV)r2r@�exprZoldvalueZnewvaluerrr�preloopIs
�zPdb.preloopcCsttjr6zt�tjtj�Wntk
r.YnXdt_|�||�rN|��dS|�|j|j	�|�
�|��dSr0)r�_previous_sigint_handler�signal�SIGINT�
ValueErrorrhr[rxr\r]ry)r2rXr~rrrrnVszPdb.interactioncCs|dk	r|�t|��dS)z{Custom displayhook for the exec in default(), which prevents
        assignment of the _ variable in the builtins.
        N)rV�repr)r2r%rrr�displayhookhszPdb.displayhookc	Cs�|dd�dkr|dd�}|j}|jj}zdt|ddd�}tj}tj}tj}z(|jt_|jt_|jt_t|||�W5|t_|t_|t_XWn4t�	�dd�}|�
tj|�d�
��YnXdS)Nr�!�
z<stdin>Zsingle�r|)rdr^r#rr<rTrSr��execr��errorr~rrk)	r2r �locals�globalsr,Zsave_stdoutZ
save_stdinZsave_displayhookr�rrr�defaultps(zPdb.defaultcCs�|��s|S|��}|d|jkr�|j|d}d}|dd�D] }|�dt|�|�}|d7}q@|�dd�|dd���}|��}q|ddkr�|�d�}|dkr�||d	d���}|j�	|�|d|��
�}|S)
z*Handle alias expansion and ';;' separator.rrN�%z%*� �aliasz;;r�)rk�splitr?�replace�str�join�find�lstrip�cmdqueue�append�rstrip)r2r �argsZiiZtmpArgZmarker�nextrrr�precmd�s(�


z
Pdb.precmdcCs"|jstj�||�S|�|�SdS)z�Interpret the argument as though it had been typed in response
        to the prompt.

        Checks whether this line is typed at the normal prompt or in
        a breakpoint command list definition.
        N)rPr:r;rl�handle_command_def)r2r rrrrl�sz
Pdb.onecmdcCs�|�|�\}}}|sdS|dkr0d|j|j<dS|dkrBg|_dS|j|j}|rf|�|d|�n
|�|�zt|d|�}Wntk
r�|j}YnX|j	|j
kr�d|j|j<g|_dSdS)	z8Handles one command line during command list definition.NZsilentT�endrr��do_F)Z	parselinerOrQr�rMr�rv�AttributeErrorr�r�commands_resumingrN)r2r r:�argZcmdlist�funcrrrr��s,
zPdb.handle_command_defcCst||jd�dS)N��file��printrT�r2�msgrrrrV�szPdb.messagecCstd||jd�dS)Nz***r�r�r�rrrr��sz	Pdb.errorcCs�|���d�rgSz|�||||�}Wntk
r>g}YnXt�t�|�d�}|D]H}tj�|�rx|�	|d�qXtj�
|�rX|���d�rX|�	|d�qX|S)N)�:�,�*�/)�.pyz.pywr�)rk�endswith�_complete_expression�	Exception�globrrIrJ�isdirr��isfile�lower)r2�textr �begidx�endidxZret�globs�fnrrr�_complete_location�s
zPdb._complete_locationcs�fdd�ttjj�D�S)Ncs.g|]&\}}|dk	rt|����rt|��qSr0)r��
startswith)�.0r-�bp�r�rr�
<listcomp>�s�z*Pdb._complete_bpnumber.<locals>.<listcomp>)rr7�
Breakpoint�
bpbynumber�r2r�r r�r�rr�r�_complete_bpnumber�szPdb._complete_bpnumberc	s�|js
gS|jj|j�}d�kr���d��z,|�d}�dd�D]}t||�}qDWnttfk
rrgYSXd��dd��d���fdd�t|�D�S�fdd�|�	�D�SdS)N�.rrr|cs"g|]}|��d�r�|�qS)r|�r��r��n)�dottedr�rrr�sz,Pdb._complete_expression.<locals>.<listcomp>csg|]}|���r|�qSrr�r�r�rrr�s
)
r^r#rdr�rv�KeyErrorr�r��dir�keys)r2r�r r�r��nsr%�partr)r�r�r�rr��s

zPdb._complete_expressioncCs,|sttjj�d}n&zt|�}Wn|�d�YdSX||_||jkrj|j||j||j	|f}nd}g|j|<d|j|<d|j	|<|j
}d|_
d|_zzz|��Wnht
k
�r|r�|d|j|<|d|j|<|d|j	|<n|j|=|j|=|j	|=|�d	�YnXW5d|_||_
XdS)
a4commands [bpnumber]
        (com) ...
        (com) end
        (Pdb)

        Specify a list of commands for breakpoint number bpnumber.
        The commands themselves are entered on the following lines.
        Type a line containing just 'end' to terminate the commands.
        The commands are executed when the breakpoint is hit.

        To remove all commands from a breakpoint, type commands and
        follow it immediately with end; that is, give no commands.

        With no bpnumber argument, commands refers to the last
        breakpoint set.

        You can use breakpoint commands to start your program up
        again.  Simply use the continue command, or step, or any other
        command that resumes execution.

        Specifying any command resuming execution (currently continue,
        step, next, return, jump, quit and their abbreviations)
        terminates the command list (as if that command was
        immediately followed by end).  This is because any time you
        resume execution (even with a simple next or step), you may
        encounter another breakpoint -- which could have its own
        command list, leading to ambiguities about which list to
        execute.

        If you use the 'silent' command in the command list, the usual
        message about stopping at a breakpoint is not printed.  This
        may be desirable for breakpoints that are to print a specific
        message and then continue.  If none of the other commands
        print anything, you will see no sign that the breakpoint was
        reached.
        rz.Usage: commands [bnum]
        ...
        endNTFz(com) rr�z1command definition aborted, old commands restored)�lenr7r�r��intr�rQrMrNrOr>rPr�rU)r2r�ZbnumZold_command_defsZprompt_backrrr�do_commands	sB%

�


zPdb.do_commandsrc
CsB|s8|jr4|�d�tjjD]}|r|�|���qdSd}d}d}|�d�}|dkrz||dd���}|d|���}|�	d�}d}	|dk�r|d|���}|�
|�}
|
s�|�d|�dS|
}||dd���}zt|�}Wn&t
k
�r|�d|�YdSXn�zt|�}Wn�t
k
�r�zt||jj|j�}Wn|}YnXz.t|d	��rj|j}|j}|j}	|j}|j}WnD|�|�\}
}}|
�s�|�d
|�YYdS|
}	t|�}YnXYnX|�s�|��}|�||�}|�r>|�|||||	�}|�r|�|�n*|�||�d}|�d|j|j|jf�dS)
a�b(reak) [ ([filename:]lineno | function) [, condition] ]
        Without argument, list all breaks.

        With a line number argument, set a break at this line in the
        current file.  With a function name, set a break at the first
        executable line of that function.  If a second argument is
        present, it is a string specifying an expression which must
        evaluate to true before the breakpoint is honored.

        The line number may be prefixed with a filename and a colon,
        to specify a breakpoint in another file (probably one that
        hasn't been loaded yet).  The file is searched for on
        sys.path; the .py suffix may be omitted.
        z!Num Type         Disp Enb   WhereNr�rrr�z%r not found from sys.pathzBad lineno: %s�__func__zJThe specified object %r is not a function or was not found along sys.path.r|zBreakpoint %d at %s:%d) �breaksrVr7r�r�Zbpformatr�r�r��rfind�lookupmoduler�r�r��evalr^r#rd�hasattrr��__code__�co_name�co_firstlinenorq�lineinfo�defaultFile�	checklineZ	set_break�
get_breaks�numberr�r )r2r�Z	temporaryr�rr�condZcommaZcolonrrfr�r,�okZlnr �errrrr�do_breakXs�





�

��zPdb.do_breakcCs"|jjj}|dkr|jr|j}|S)zProduce a reasonable default.z<string>)r^rarqrA)r2rrrrr��s
zPdb.defaultFilecCs|�|d�dS)z�tbreak [ ([filename:]lineno | function) [, condition] ]
        Same arguments as break, but sets a temporary breakpoint: it
        is automatically deleted when first hit.
        rN)r��r2r�rrr�	do_tbreak�sz
Pdb.do_tbreakc
Cs�d}|�d�}t|�dkr(|d��}nt|�dkrB|d��}n|S|dkrR|S|�d�}|ddkr~|d=t|�dkr~|S|��}t|�dkr�|d}n|�|d�}|r�|}|d}t||�}	|	p�|S)	N)NNN�'rr�r6r�r2)r�r�rkr�r�r!)
r2Z
identifierZfailedZidstring�id�partsZfname�itemrfZanswerrrrr��s.



zPdb.lineinfocCs�t|d�r|jjnd}t�|||�}|s6|�d�dS|��}|rn|ddksn|dd�dksn|dd�dkr||�d	�dS|S)
z�Check whether specified line seems to be executable.

        Return `lineno` if it is, 0 if not (e.g. a docstring, comment, blank
        line or EOF). Warning: testing is not comprehensive.
        r^NzEnd of filerrir�z"""z'''zBlank or comment)r�r^r#�	linecache�getlinerVrkr�)r2rrr�r rrrr��s
��
z
Pdb.checklinecCsh|��}|D]V}z|�|�}Wn,tk
rJ}z|�|�W5d}~XYqX|��|�d|�qdS)z�enable bpnumber [bpnumber ...]
        Enables the breakpoints given as a space separated list of
        breakpoint numbers.
        Nz
Enabled %s)r��get_bpbynumberr�r��enablerV�r2r�r�r-r�r�rrr�	do_enablesz
Pdb.do_enablecCsh|��}|D]V}z|�|�}Wn,tk
rJ}z|�|�W5d}~XYqX|��|�d|�qdS)aNdisable bpnumber [bpnumber ...]
        Disables the breakpoints given as a space separated list of
        breakpoint numbers.  Disabling a breakpoint means it cannot
        cause the program to stop execution, but unlike clearing a
        breakpoint, it remains in the list of breakpoints and can be
        (re-)enabled.
        NzDisabled %s)r�r�r�r��disablerVr�rrr�
do_disableszPdb.do_disablec
Cs�|�dd�}z|d}Wntk
r0d}YnXz|�|d���}WnHtk
rf|�d�YnXtk
r�}z|�|�W5d}~XYn.X||_|s�|�d|j�n|�d|j�dS)a#condition bpnumber [condition]
        Set a new condition for the breakpoint, an expression which
        must evaluate to true before the breakpoint is honored.  If
        condition is absent, any existing condition is removed; i.e.,
        the breakpoint is made unconditional.
        r�rNr�Breakpoint number expectedz#Breakpoint %d is now unconditional.z$New condition set for breakpoint %d.)	r��
IndexErrorr�rkr�r�r�rVr�)r2r�r�r�r�r�rrr�do_condition%s
zPdb.do_conditionc
Cs�|��}zt|d���}Wnd}YnXz|�|d���}WnHtk
rb|�d�Ynvtk
r�}z|�|�W5d}~XYnLX||_|dkr�|dkr�d|}nd}|�d||j	f�n|�d|j	�dS)	a�ignore bpnumber [count]
        Set the ignore count for the given breakpoint number.  If
        count is omitted, the ignore count is set to 0.  A breakpoint
        becomes active when the ignore count is zero.  When non-zero,
        the count is decremented each time the breakpoint is reached
        and the breakpoint is not disabled and any associated
        condition evaluates to true.
        rrr�Nz%d crossingsz
1 crossingz%Will ignore next %s of breakpoint %d.z-Will stop next time breakpoint %d is reached.)
r�r�rkr�rr�r��ignorerVr�)r2r�r��countr�r�Zcountstrrrr�	do_ignore@s,	

��z
Pdb.do_ignorec
Cs�|stztd�}Wntk
r(d}YnX|����}|dkrpdd�tjjD�}|��|D]}|�d|�q\dSd|k�r|�	d�}|d|�}||d	d�}zt
|�}Wntk
r�d
|}YnX|�||�}|�
||�}|r�|�|�n|D]}|�d|�q�dS|��}	|	D]\}z|�|�}Wn.tk
�r^}z|�|�W5d}~XYnX|�|�|�d|��qdS)a=cl(ear) filename:lineno
cl(ear) [bpnumber [bpnumber...]]
        With a space separated list of breakpoint numbers, clear
        those breakpoints.  Without argument, clear all breaks (but
        first ask confirmation).  With a filename:lineno argument,
        clear all breaks at that line in that file.
        zClear all breaks? Zno)�yZyescSsg|]}|r|�qSrr)r�r�rrrr�qsz Pdb.do_clear.<locals>.<listcomp>z
Deleted %sNr�rzInvalid line number (%s))�input�EOFErrorrkr�r7r�r�Zclear_all_breaksrVr�r�r�r�Zclear_breakr�r�r�Zclear_bpbynumber)
r2r�ZreplyZbplistr�r-rrr�Z
numberlistrrr�do_clearcsF



zPdb.do_clearcCs|��dS)z�w(here)
        Print a stack trace, with the most recent frame at the bottom.
        An arrow indicates the "current frame", which determines the
        context of most commands.  'bt' is an alias for this command.
        N)�print_stack_tracer�rrr�do_where�szPdb.do_wherecCs>||_|j|jd|_|jj|_|�|j|j�d|_dSr()r]r\r^r$rdrxr)r2r�rrr�
_select_frame�s

zPdb._select_framecCsz|jdkr|�d�dSzt|p"d�}Wn$tk
rL|�d|�YdSX|dkr\d}ntd|j|�}|�|�dS)z�u(p) [count]
        Move the current frame count (default one) levels up in the
        stack trace (to an older frame).
        rzOldest frameNr�Invalid frame count (%s))r]r�r�r��maxr�r2r�rZnewframerrr�do_up�s

z	Pdb.do_upcCs�|jdt|j�kr"|�d�dSzt|p,d�}Wn$tk
rV|�d|�YdSX|dkrpt|j�d}ntt|j�d|j|�}|�|�dS)z�d(own) [count]
        Move the current frame count (default one) levels down in the
        stack trace (to a newer frame).
        rzNewest frameNrr)r]r�r\r�r�r��minrrrrr�do_down�s
zPdb.do_downcCsh|rRzt|�}Wn$tk
r4|�d|�YdSX||jjkrV|�d�dSnd}|�|j|�dS)aNunt(il) [lineno]
        Without argument, continue execution until the line with a
        number greater than the current one is reached.  With a line
        number, continue execution until a line with a number greater
        or equal to that is reached.  In both cases, also stop when
        the current frame returns.
        �Error in argument: %rNz7"until" line number is smaller than current line numberr)r�r�r�r^rrZ	set_until)r2r�rrrr�do_until�s
zPdb.do_untilcCs|��dS)z�s(tep)
        Execute the current line, stop at the first possible occasion
        (either in a function that is called or in the current
        function).
        r)rWr�rrr�do_step�szPdb.do_stepcCs|�|j�dS)zxn(ext)
        Continue execution until the next line in the current function
        is reached or it returns.
        r)Zset_nextr^r�rrr�do_next�szPdb.do_nextcCs<|r4ddl}tjdd�}|�|�t_|tjdd�<t�dS)arun [args...]
        Restart the debugged python program. If a string is supplied
        it is split with "shlex", and the result is used as the new
        sys.argv.  History, breakpoints, actions and debugger options
        are preserved.  "restart" is an alias for "run".
        rNr)�shlexr<�argvr�r)r2r�rZargv0rrr�do_run�sz
Pdb.do_runcCs|�|j�dS)zPr(eturn)
        Continue execution until the current function returns.
        r)Z
set_returnr^r�rrr�	do_returnsz
Pdb.do_returncCs>|js2zt�tj|j�t_Wntk
r0YnX|��dS)z]c(ont(inue))
        Continue execution, only stop when a breakpoint is encountered.
        r)rGr�r�rYrr�r�Zset_continuer�rrr�do_continues�zPdb.do_continuec
Cs�|jdt|j�kr"|�d�dSzt|�}Wntk
rL|�d�YnnXz:||j_|j|jd|f|j|j<|�|j|j�Wn0tk
r�}z|�d|�W5d}~XYnXdS)a�j(ump) lineno
        Set the next line that will be executed.  Only available in
        the bottom-most frame.  This lets you jump back and execute
        code again, or jump forward to skip code that you don't want
        to run.

        It should be noted that not all jumps are allowed -- for
        instance it is not possible to jump into the middle of a
        for loop or out of a finally clause.
        rz)You can only jump within the bottom frameNz)The 'jump' command requires a line numberrzJump failed: %s)	r]r�r\r�r�r�r^rrrx)r2r��errr�do_jump&s
zPdb.do_jumpcCs�t�d�|jj}|j}t|j|j|j�}d|j	�
�|_	|�d�zt�|j
|||f�Wn<tk
r�t��dd�}|�tj|�d�
��YnX|�d�t�|j�|j|_dS)z�debug code
        Enter a recursive debugger that steps through the code
        argument (which is an arbitrary expression or statement to be
        executed in the current environment).
        Nz(%s) zENTERING RECURSIVE DEBUGGERr�r|zLEAVING RECURSIVE DEBUGGER)r<�settracer^r#rdrrRrSrTr>rkrV�call_tracingr	r�r�r�r~rZtrace_dispatchrw)r2r�r�r��pr�rrr�do_debugCs


zPdb.do_debugcCsd|_|��dS)z[q(uit)
exit
        Quit from the debugger. The program being executed is aborted.
        Tr)�_user_requested_quit�set_quitr�rrr�do_quitZszPdb.do_quitcCs|�d�d|_|��dS)z=EOF
        Handles the receipt of EOF as a command.
        r6Tr)rVr!r"r�rrr�do_EOFes
z
Pdb.do_EOFcCs�|jj}|j}|j|j}|jtj@r.|d}|jtj@rB|d}t	|�D]>}|j
|}||krx|�d|||f�qJ|�d|f�qJdS)zHa(rgs)
        Print the argument list of the current function.
        rz%s = %rz%s = *** undefined ***N)r^rard�co_argcount�co_kwonlyargcount�co_flagsr"Z
CO_VARARGSZCO_VARKEYWORDS�range�co_varnamesrV)r2r��co�dictr�r-�namerrr�do_argsns
zPdb.do_argscCs.d|jkr |�t|jd��n
|�d�dS)zQretval
        Print the return value for the last return of a function.
        rzzNot yet returned!N)rdrVr�r�r�rrr�	do_retvals
z
Pdb.do_retvalcCsPzt||jj|j�WSt��dd�}|�tj|�d�	���YnXdS)Nr�r|)
r�r^r#rdr<r�r�r~rrk)r2r�r�rrr�_getval�szPdb._getvalcCsrz2|dkrt||jj|j�WSt||j|j�WSWn:t��dd�}tj|�d�	�}t
d|�YSXdS)Nr�r|z** raised %s **)r�r^r#rdr$r<r�r~rrkr/)r2r�rXr�r�rrrr��szPdb._getval_exceptcCs*z|�t|�|���WnYnXdS)z@p expression
        Print the value of the expression.
        N)rVr�r/r�rrr�do_p�szPdb.do_pcCs,z|�t�|�|���WnYnXdS)zHpp expression
        Pretty-print the value of the expression.
        N)rV�pprintZpformatr/r�rrr�do_pp�sz	Pdb.do_ppcCsfd|_d}|r�|dkr�z^d|krX|�d�\}}t|���}t|���}||krr||}nt|���}td|d�}Wq�tk
r�|�d|�YdSXn0|jdks�|dkr�td|jj	d�}n
|jd}|dkr�|d}|jj
j}|�|�}zZt
�||jj�}|�||d|�|||j�t|t|��|_t|�|k�rH|�d	�Wntk
�r`YnXdS)
a�l(ist) [first [,last] | .]

        List source code for the current file.  Without arguments,
        list 11 lines around the current line or continue the previous
        listing.  With . as argument, list 11 lines around the current
        line.  With one argument, list 11 lines starting at that line.
        With two arguments, list the given range; if the second
        argument is less than the first, it is a count.

        The current line in the current frame is indicated by "->".
        If an exception is being debugged, the line where the
        exception was originally raised or propagated is indicated by
        ">>", if it differs from the current line.
        r)Nr�r�r�r�
z[EOF])rwr�r�rkr
r�r�rr^rrrarq�get_file_breaksr��getlinesr#�_print_linesrr�rVrU)r2r�Zlast�firstr�	breaklistr&rrr�do_list�s@




�zPdb.do_listc
Csp|jjj}|�|�}zt|j�\}}Wn2tk
rX}z|�|�WY�dSd}~XYnX|�||||j�dS)z\longlist | ll
        List the whole source code for the current function or frame.
        N)r^rarqr5r'rr�r7)r2r�rr9r&rr�rrr�do_longlist�s


zPdb.do_longlistc
Csvz|�|�}WnYdSXzt|�\}}Wn6ttfk
rd}z|�|�WY�dSd}~XYnX|�||�dS)z^source expression
        Try to get source code for the given object and display it.
        N)r/r'r�	TypeErrorr�r7)r2r�r%r&rr�rrr�	do_source�s
z
Pdb.do_sourcerc
Cs�|r|j}|j�|d�}nd}}t||�D]|\}}t|��d�}	t|	�dkrV|	d7}	||krh|	d7}	n|	d7}	||kr�|	d7}	n||kr�|	d7}	|�|	d|���q,d	S)
zPrint a range of lines.r|r��r��Bz->z>>�	N)	rrrCr�rr��rjustr�rVr�)
r2r&rr�rXZcurrent_linenoZ
exc_linenorr �srrrr7s 

zPdb._print_linescCs�z|�|�}WnYdSXd}z|jj}Wntk
rBYnX|r\|�d|j�dSz
|j}Wntk
rzYnX|r�|�d|j�dS|jtkr�|�d|j|j	f�dS|�t|��dS)z;whatis arg
        Print the type of the argument.
        Nz	Method %szFunction %szClass %s.%s)
r/r�r�r�rVr��	__class__�typerr)r2r��valuer,rrr�	do_whatiss.

z
Pdb.do_whatiscCsl|s8|�d�|j�|ji���D]}|�d|�q"n0|�|�}||j�|ji�|<|�d||f�dS)z�display [expression]

        Display the value of the expression if it changed, each time execution
        stops in the current frame.

        Without expression, list all display expressions for the current frame.
        zCurrently displaying:z%s: %rzdisplay %s: %rN)rVr@r�r^r�r��
setdefault)r2r�r��valrrr�
do_display<s

zPdb.do_displaycCsT|r@z|j�|ji�|=WqPtk
r<|�d|�YqPXn|j�|jd�dS)z�undisplay [expression]

        Do not display the expression any more in the current frame.

        Without expression, clear all display expressions for the current frame.
        znot displaying %sN)r@r�r^r�r�rjr�rrr�do_undisplayOszPdb.do_undisplaycs�fdd�|j�|ji�D�S)Ncsg|]}|���r|�qSrr�)r�rr�rrr�_s
�z*Pdb.complete_undisplay.<locals>.<listcomp>)r@r�r^r�rr�r�complete_undisplay^szPdb.complete_undisplaycCs |jj|j�}tjd|d�dS)z�interact

        Start an interactive interpreter whose global namespace
        contains all the (global and local) names found in the current scope.
        z
*interactive*)ZlocalN)r^r#rdr,�interact)r2r�r�rrr�do_interactbszPdb.do_interactcCs�|��}t|�dkrHt|j���}|D]}|�d||j|f�q&dS|d|jkr�t|�dkr�|�d|d|j|df�nd�|dd��|j|d<dS)acalias [name [command [parameter parameter ...] ]]
        Create an alias called 'name' that executes 'command'.  The
        command must *not* be enclosed in quotes.  Replaceable
        parameters can be indicated by %1, %2, and so on, while %* is
        replaced by all the parameters.  If no command is given, the
        current alias for name is shown. If no name is given, all
        aliases are listed.

        Aliases may be nested and can contain anything that can be
        legally typed at the pdb prompt.  Note!  You *can* override
        internal pdb commands with aliases!  Those internal commands
        are then hidden until the alias is removed.  Aliasing is
        recursively applied to the first word of the command line; all
        other words in the line are left alone.

        As an example, here are two useful aliases (especially when
        placed in the .pdbrc file):

        # Print instance variables (usage "pi classInst")
        alias pi for k in %1.__dict__.keys(): print("%1.",k,"=",%1.__dict__[k])
        # Print instance variables in self
        alias ps pi self
        rz%s = %sNrr�)r�r��sortedr?r�rVr�)r2r�r�r�r�rrr�do_aliasks"zPdb.do_aliascCs6|��}t|�dkrdS|d|jkr2|j|d=dS)z9unalias name
        Delete the specified alias.
        rN)r�r�r?)r2r�r�rrr�
do_unalias�s
zPdb.do_unaliascs�fdd�|jD�S)Ncsg|]}|���r|�qSrr�)r��ar�rrr��s
z(Pdb.complete_unalias.<locals>.<listcomp>)r?r�rr�r�complete_unalias�szPdb.complete_unaliasrrrrr#rcCs4z|jD]}|�|�qWntk
r.YnXdSr0)r\rxrU)r2�frame_linenorrrr	�s

zPdb.print_stack_tracecCs6|\}}||jkrd}nd}|�||�||��dS)Nz> z  )r^rVZformat_stack_entry)r2rSZ
prompt_prefixrXrr�rrrrx�s

�zPdb.print_stack_entrycCs�|stj�||�Sz@zt|d|�}|�WWStk
rNt|d|�}YnXWn"tk
rt|�d|�Yn0Xtjjdkr�|�d|�dS|�	|j
���dS)z�h(elp)
        Without argument, print the list of available commands.
        With a command name as argument, print help about that command.
        "help pdb" shows the full pdb documentation.
        "help exec" gives help on the ! command.
        Zhelp_r�zNo help for %rr�zJNo help for %r; please do not run Python with -OO if you need command helpN)r:r;�do_helprvr�r�r<�flags�optimizerVrr�)r2r�ZtopicZcommandrrrrT�s 
�zPdb.do_helpcCs|�|jjpd���dS)a�(!) statement
        Execute the (one-line) statement in the context of the current
        stack frame.  The exclamation point can be omitted unless the
        first word of the statement resembles a debugger command.  To
        assign to a global variable you must always prefix the command
        with a 'global' command, e.g.:
        (Pdb) global list_options; list_options = ['-l']
        (Pdb)
        r6N)rV�	help_execrrkr1rrrrW�s
z
Pdb.help_execcCs
t�dSr0)rr1rrr�help_pdb�szPdb.help_pdbcCs�tj�|�rtj�|�r|Stj�tjd|�}tj�|�rP|�|�|jkrP|Stj�|�\}}|dkrp|d}tj�|�r�|StjD]>}tj�	|�r�t�
|�}q�tj�||�}tj�|�r�|Sq�dS)z�Helper function for break/clear parsing -- may be overridden.

        lookupmodule() translates (possibly incomplete) file or module name
        into an absolute file name.
        rr6r�N)rIrJ�isabs�existsr�r<rprA�splitext�islink�readlink)r2rrf�rootZext�dirname�fullnamerrrr��s"

zPdb.lookupmodulec	Csrd|_d|_ddl}|�|�\}}}|�|j�|_ddl}|j�	�|j�
d|j|j|j|t
d��|�|�dS)NTFr�__main__)r�__file__�__package__�
__loader__�__spec__�__builtins__)rBr!�runpyZ_get_module_detailsrprqrAra�__dict__r_�update�parent�loaderrfr	)r2Zmodule_namergZmod_nameZmod_specr,rarrr�
_runmodule�s 
�zPdb._runmodulec	Cstddl}|j��|j�d|td��d|_|�|�|_d|_t	�
|��}d|��|jf}W5QRX|�|�dS)Nrra)rrbrfTFzexec(compile(%r, %r, 'exec')))
rarhr_rirfrBrprAr!�io�	open_code�readr	)r2rrar�	statementrrr�
_runscript
s
�
�zPdb._runscript)r4NNNFT)r)N)rN)wrrrr�r9rYrZr[rhrerortrsr{r�ryr�rnr�r�r�rlr�rVr�r�r�r�r�Zcomplete_commandsr�r�Zdo_bZcomplete_breakZ
complete_br�Zcomplete_tbreakr�r�r�Zcomplete_enabler�Zcomplete_disablerZcomplete_conditionrZcomplete_ignorerZdo_clZcomplete_clearZcomplete_clr
Zdo_wZdo_btrrZdo_urZdo_drZdo_untrZdo_srZdo_nrZ
do_restartrZdo_rrZdo_cZdo_contrZdo_jr Zcomplete_debugr#Zdo_qZdo_exitr$r-Zdo_ar.Zdo_rvr/r�r0r2Zcomplete_printZ
complete_pZcomplete_ppr:Zdo_lr;Zdo_llr=Zcomplete_sourcer7rFZcomplete_whatisrIZcomplete_displayrJrKrMrOrPrRr�r	�line_prefixrxrTZdo_hrWrXr�rlrqrrrrr�s��
/	


M
]!!.	
		1
!	#	��whereZdownZup�breakZtbreakr_r�r�rZ	conditionrM�stepr�ZuntilZjump�returnZretval�continuer)Zlonglistr�rZppZwhatis�sourceZdisplayZ	undisplayrLr�Zunalias�debug�quitr�z

cCst��|||�dSr0)rr	�rpr�r�rrrr	<scCst��|||�Sr0)rr)Z
expressionr�r�rrrr?scCst|||�dSr0)r	r{rrrr
BscOst�j||�Sr0)rr)r��kwdsrrrrFs)�headercCs,t�}|dk	r|�|�|�t��j�dSr0)rrVrr<�	_getframe�f_back)r}�pdbrrrrIs
cCsB|dkrt��d}|dkr$td��t�}|��|�d|�dS)Nr�zAA valid traceback must be passed if no exception is being handled)r<r�r�rrZrn)�trrrrrQscCsttj�dSr0)rr<�last_tracebackrrrrr
_szimport x; x.main()cCstt�dSr0)r	�TESTCMDrrrr�testgsr�cCsddl}|�t�dSr()�pydocZpagerr)r�rrrrksausage: pdb.py [-c command] ... [-m module | pyfile] [arg] ...

Debug the Python program given by pyfile. Alternatively,
an executable module or package to debug can be specified using
the -m switch.

Initial commands are read from .pdbrc files in your home directory
and in the current directory, if they exist.  Commands supplied with
-c are executed after commands from .pdbrc files.

To let the script run until an exception occurs, use "-c continue".
To let the script run up to a given line X in the debugged file, use
"-c 'until X'".c

Csddl}|�tjdd�dddg�\}}|s>tt�t�d�g}d}|D]B\}}|dkrltt�t��qJ|d	kr�|�|�qJ|d
krJd}qJ|d}|s�tj�	|�s�td|d
�t�d�|tjdd�<|s�tj�
|�}tj�|�tjd<t�}|j
�|�z6|�r|�|�n
|�|�|j�r*W�qtd�Wq�tk
�rrtd|d�tdd�tjdd���Yq�tk
�r�tddd�tt��d�Yq�tk
�r�t��t�d�Yq�t��td�td�t��d}	|�d|	�td|d�Yq�Xq�dS)Nrrzmhc:rzcommand=r�F)z-hz--help)z-cz	--command)z-mTzError:zdoes not existz*The program finished and will be restartedZ
Restartingzwith arguments:r@r�z/The program exited via sys.exit(). Exit status:)r�z2Uncaught exception. Entering post mortem debuggingz1Running 'cont' or 'step' will restart the programz#Post mortem debugger finished. The z will be restarted)�getoptr<rr��_usage�exitr�rIrJrZ�realpathr_rrHrLrlrqr!rr��
SystemExitr��SyntaxErrorr~�	print_excrn)
r�Zoptsr�rMZ
run_as_module�optZoptargrAr�r�rrr�main~sd 



 �r�ra)NN)NN)N)/rrIrmrr<r:r7r*r,r�r1r�r"rr~r�r�r�__all__r!r'r.r�r/rrr8r;rZ_help_orderZ_commandrvrkrWr	rr
rrrr
r�r�rr�r�rr�rrrr�<module>s�C�
		*
� 


D
__pycache__/netrc.cpython-38.opt-2.pyc000064400000006725151153537550013503 0ustar00U

e5d��@sTddlZddlZddlZddgZGdd�de�ZGdd�d�ZedkrPee��dS)�N�netrc�NetrcParseErrorc@seZdZddd�Zdd�ZdS)rNcCs"||_||_||_t�||�dS)N)�filename�lineno�msg�	Exception�__init__)�selfrrr�r
�/usr/lib64/python3.8/netrc.pyrszNetrcParseError.__init__cCsd|j|j|jfS)Nz%s (%s, line %s))rrr)r	r
r
r�__str__szNetrcParseError.__str__)NN)�__name__�
__module__�__qualname__rrr
r
r
rr
s
c@s.eZdZd
dd�Zdd�Zdd�Zdd	�ZdS)rNc	CsX|dk}|dkr&tj�tj�d�d�}i|_i|_t|��}|�|||�W5QRXdS)N�~z.netrc)�os�path�join�
expanduser�hosts�macros�open�_parse)r	�file�
default_netrc�fpr
r
rrs
znetrc.__init__cCs�t�|�}|jd7_|j�dd�|_|j}|��}}|sD�q�n�|ddkrt|j|kr(t|�dkr(|j��q(n�|dkr�|��}nt|dkr�d}nf|dkr�|��}g|j	|<d	|_
|j��}	|	r�|	d
kr�d|_
q(|j	|�|	�q�q(ntd|||j��d}
d}}i|j
|<|��}|�d��s.|d
k�rr|�rR|
||f|j
|<|�|�q(ntd||t|�f||j���q|dk�s�|dk�r�|��}
�q|dk�r�|��}�q|dk�r�tjdk�r�|�r�t�|���}
|
jt��k�rpddl}z|�|
j�d}Wn tk
�rd|
j}YnXz|�t���d}Wn"tk
�rXdt��}YnXtd||f||j��|
jtjtjB@�r�td||j��|��}ntd|||j���qq(dS)Nz !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~�#�r��machine�default�macdefz 	�
z 	
zbad toplevel token %r>rr!r rz&malformed %s entry %s terminated by %s�login�user�account�password�posixzuid %sz9~/.netrc file owner (%s) does not match current user (%s)zY~/.netrc access too permissive: access permissions must restrict access to only the ownerzbad follower token %r)�shlexZ	wordcharsZ
commenters�replacerZ	get_token�lenZinstream�readlinerZ
whitespace�appendrr�
startswithZ
push_token�reprr�name�fstat�fileno�st_uid�getuid�pwd�getpwuid�KeyError�st_mode�stat�S_IRWXG�S_IRWXO)r	rrrZlexerZsaved_linenoZtoplevelZttZ	entryname�liner#r%r&Zpropr4Zfownerr$r
r
rr s�




�
�
��

���
�znetrc._parsecCs0||jkr|j|Sd|jkr(|jdSdSdS)Nr )r)r	�hostr
r
r�authenticatorsqs




znetrc.authenticatorscCs�d}|j��D]X}|j|}|d|�d|d�d�7}|drR|d|d�d�7}|d|d	�d�7}q|j��D]4}|d
|�d�7}|j|D]}||7}q�|d7}qr|S)Nrzmachine z
	login rr"rz		account z
	password �zmacdef )r�keysr)r	Zrepr<�attrsZmacror;r
r
r�__repr__zs


znetrc.__repr__)N)r
rrrrr=rAr
r
r
rrs
	Q	�__main__)	rr(r8�__all__rrrr
�printr
r
r
r�<module>s
t__pycache__/turtle.cpython-38.opt-2.pyc000064400000205521151153537550013702 0ustar00U

e5dd1�O@s2dZddlZddlZddlZddlZddlZddlZddlm	Z	m
Z
mZddlm
Z
ddlmZdddd	d
ddd
dg	Zdddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-gZd.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|gOZd}d~gZeeeedgZdd/d2d?dLdPdTdZd\dadbdddedpdudxdygZd�d�d�d�ddd�d�d�d�d�d�d�d�d�d�d�d�d�d�d��Zd�d��Zd�d��Zzee�Wnek
�red��YnXGd�d�de�Zd�d��Zd�d��Zd�Zd�d�d��ZGd�d�dej �Z!ee!ej"d��Gd�d��d�ej#�Z$ej"Z"Gd�d��d�e%�Z&Gd�d�de�Z'Gd�d��d�e�Z(Gd�d
�d
e%�Z)Gd�d��d�e%�Z*Gd�d�de&�Z+Gd�d��d�e%�Z,Gd�d��d�e%�Z-Gd�d��d�e%�Z.Gd�d	�d	e-e,�Z/e/Z0d�d�Z1Gd�d��d�e+�Z2Gd�d
�d
e/�Z3e3Z4d�d�d}�Z5d�d��Z6ed�Z7ze7d�k�rne6e7�Wn@e8k
�r�ed�e7�Yn"ek
�r�ed�e7�YnXd�d��Z9d�d„Z:d�dĄZ;d�Z<d�dDŽZ=e=ee2d�d�e;�e=ee3d�d�e:�e>Z?e@d�k�r.d�d΄ZAd�dЄZBd�d҄ZCeB�eC�eD�dS)�z-turtle 1.1b- - for Python 3.1   -  4. 5. 2009�N)�isfile�split�join)�deepcopy)�simpledialog�ScrolledCanvas�TurtleScreen�Screen�	RawTurtle�Turtle�RawPen�Pen�Shape�Vec2D�addshape�bgcolor�bgpic�bye�clearscreen�	colormode�delay�exitonclick�	getcanvas�	getshapes�listen�mainloop�mode�numinput�onkey�
onkeypress�onkeyrelease�
onscreenclick�ontimer�register_shape�resetscreen�
screensize�setup�setworldcoordinates�	textinput�title�tracer�turtles�update�
window_height�window_width�back�backward�
begin_fill�
begin_poly�bk�circle�clear�
clearstamp�clearstamps�clone�color�degrees�distance�dot�down�end_fill�end_poly�fd�	fillcolor�filling�forward�get_poly�getpen�	getscreen�
get_shapepoly�	getturtle�goto�heading�
hideturtle�home�ht�isdown�	isvisible�left�lt�onclick�ondrag�	onrelease�pd�pen�pencolor�pendown�pensize�penup�pos�position�pu�radians�right�reset�
resizemode�rt�seth�
setheading�setpos�setposition�settiltangle�
setundobuffer�setx�sety�shape�	shapesize�shapetransform�shearfactor�
showturtle�speed�st�stamp�tilt�	tiltangle�towards�
turtlesize�undo�undobufferentries�up�width�write�xcor�ycor�write_docstringdict�done�
Terminator��?g�?i�i,�standard��?�
i��classic�black�noresizeTZenglish�turtle�screenzPython Turtle GraphicsF)rz�height�	canvwidth�
canvheight�	leftright�	topbottomrrr�undobuffersizerkrWrAra�visible�language�
exampleturtle�
examplescreenr)�
using_IDLEc	Cs�t|d��}|��}W5QRXi}|D]�}|��}|r&|�d�rBq&z|�d�\}}Wn(tk
r|td||f�Yq&YnX|��}|��}|dkr�t|�}n4zd|kr�t|�}nt	|�}Wntk
r�YnX|||<q&|S)N�r�#�=zBad line in config-file %s:
%s)�True�False�Nonez''z""�.)
�open�	readlines�strip�
startswithr�
ValueError�print�eval�float�int)�filename�fZcfglines�cfgdict�line�key�value�r��/usr/lib64/python3.8/turtle.py�config_dict�s0



r�cCs�d}i}i}t|�rt|�}d|kr0d|d}ztt�\}}t||�}Wntk
rbd}YnXt|�rtt|�}t�|�t�|�dS)Nz
turtle.cfgZimportconfigz
turtle_%s.cfg�)rr�r�__file__r�	Exception�_CFGr,)r�Zdefault_cfgZcfgdict1Zcfgdict2�head�tailZ	cfg_file2r�r�r��
readconfig�s 


r�z"No configfile read, reason unknownc@s\eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)rcCst�|||f�S�N)�tuple�__new__)�cls�x�yr�r�r�r��sz
Vec2D.__new__cCs"t|d|d|d|d�S�Nr��r��self�otherr�r�r��__add__�sz
Vec2D.__add__cCsDt|t�r*|d|d|d|dSt|d||d|�Sr�)�
isinstancerr�r�r�r��__mul__�s
 z
Vec2D.__mul__cCs2t|t�st|t�r.t|d||d|�StSr�)r�r�r�r�NotImplementedr�r�r�r��__rmul__szVec2D.__rmul__cCs"t|d|d|d|d�Sr�r�r�r�r�r��__sub__sz
Vec2D.__sub__cCst|d|d�Sr�r��r�r�r�r��__neg__sz
Vec2D.__neg__cCs|dd|dddS)Nr�r�r�r�r�r�r�r��__abs__
sz
Vec2D.__abs__cCsjt|d|d�}|tjd}t�|�t�|�}}t|d||d||d||d|�S)Nr�r��f@)r�math�pi�cos�sin)r��angleZperp�c�sr�r�r��rotateszVec2D.rotatecCs|d|dfSr�r�r�r�r�r��__getnewargs__szVec2D.__getnewargs__cCsd|S)Nz(%.2f,%.2f)r�r�r�r�r��__repr__szVec2D.__repr__N)
�__name__�
__module__�__qualname__r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�scCsTt|j�}|��|D]}t||�q|j��D]\}}t|�tjkr0|||<q0dSr�)	�list�	__bases__�reverse�__methodDict�__dict__�items�type�types�FunctionType)r��_dictZbaseListZ_superr�r�r�r�r�r�!s
r�cCsi}t||�|��Sr�)r��keys)r�r�r�r�r��	__methods+s
r�zTdef %(method)s(self, *args, **kw): return self.%(attribute)s.%(method)s(*args, **kw)r�cCs�i}t||�i}t|�}|��D]B}|dd�dksd|dd�dksd||ksd||krXq"||||<q"|��D]D\}}	||	d�}
t|t�r�t||d�}t||
�t|||
|�qndS)Nr��_���)�method�func)r�Z	attribute)	r�r�r�r�r��str�__stringBody�exec�setattr)Z	fromClassZtoClassZtoPartZexcludeZ_dict_1r�ZmfcZexr�r��dZ
execStringr�r�r��__forwardmethods5s
0

�
r�c@s`eZdZddd�Zddd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�Z	dd�Z
dd�Zdd�ZdS)r���^�Xc
Cs0tjj||||d�|��|_|||_|_|||_|_d|_	tj
||||j	tjdd�|_tj
||jjtjd�|_tj
||jjd�|_|jj|jj|jjd�|jdd	dd
�|jdd	dd
�|jjd	|d	ddd	d	dd�|jjd	|d	dd	d	d	dd�|jjd	|d	d	dd	d	dd�|��|j�d
|j�dS)N)rzr��whiter�)rzr��bgZreliefZborderwidth)�commandZorient)r�)ZxscrollcommandZyscrollcommandrr�)ZweightZminsize�news�ZpadxZin_Zpady�row�columnZrowspanZ
columnspanZstickyz<Configure>)�TK�Frame�__init__�winfo_toplevelZ_rootwindowrzr�r�r�r��CanvasZSUNKEN�_canvasZ	ScrollbarZxviewZ
HORIZONTAL�hscrollZyview�vscrollZ	configure�setZrowconfigureZcolumnconfigure�gridr`�bind�onResize)r��masterrzr�r�r�r�r�r�r�PsN

������zScrolledCanvas.__init__NcCs�|r
||_|r||_|r||_|jj||jd|jd|jd|jdfd�|j�d|j|jd|j�|j�d|j|jd|j�|�	�dS)Nr�)r��scrollregionr��)
r�r�r�r��config�xview_movetorz�yview_movetor��
adjustScrolls�r�r�r�r�r�r�r�r`is&����zScrolledCanvas.resetc
Cs�|j��}|j��}|j�d|j||j�|j�d|j||j�||jks`||jkr�|jjd|ddddddd�|j	jd|ddddddd�n|j�
�|j	�
�dS)Nr�r�rr�r�)r��winfo_width�winfo_heightr	r�r
r�r�rrZgrid_forget)r��cwidth�cheightr�r�r�r{s&

��
zScrolledCanvas.adjustScrollscCs|��dSr�)r)r��eventr�r�r�r�szScrolledCanvas.onResizecGs|jj|�Sr�)r��bbox�r��argsr�r�r�r�szScrolledCanvas.bboxcOs|jj||�Sr�)r��cget�r�r�kwargsr�r�r�r�szScrolledCanvas.cgetcOs|jj||�dSr�)r�rrr�r�r�r�szScrolledCanvas.configcOs|jj||�dSr�)r�rrr�r�r�r�szScrolledCanvas.bindcOs|jj||�dSr�)r��unbindrr�r�r�r�szScrolledCanvas.unbindcCs|j��dSr�)r��focus_forcer�r�r�r�r�szScrolledCanvas.focus_force)r�r�r�r�)NNN)
r�r�r�r�r`rrrrrrrrr�r�r�r�rJs�

r�c@sDeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�_RootcCstj�|�dSr�)r��Tkr�r�r�r�r�r��sz_Root.__init__cCs&t|||||�|_|jjddd�dS)Nr�Zboth)�expand�fill)rr�Zpack)r�rzr�rrr�r�r��setupcanvas�sz_Root.setupcanvascCs|jSr�)r�r�r�r�r��
_getcanvas�sz_Root._getcanvascCs|�d||||f�dS)Nz%dx%d%+d%+d)Zgeometry)r�rzr��startx�startyr�r�r��set_geometry�sz_Root.set_geometrycCs|�d|�dS)NZWM_DELETE_WINDOW)Zwm_protocol)r��destroyr�r�r��	ondestroy�sz_Root.ondestroycCs|��Sr�)Zwinfo_screenwidthr�r�r�r��	win_width�sz_Root.win_widthcCs|��Sr�)Zwinfo_screenheightr�r�r�r��
win_height�sz_Root.win_heightN)
r�r�r�r�rrr"r$r%r&r�r�r�r�r�src@s(eZdZdd�Zdd�Zdd�Zdd�ZdFdd�Zd
d�ZdGdd�Z	dd�Z
dd�Zdd�Zdd�Z
dHdd�Zdd�ZdIdd�ZdJd d!�ZdKd"d#�ZdLd$d%�Zd&d'�ZdMd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�ZdNd<d=�Zd>d?�Z d@dA�Z!dBdC�Z"dOdDdE�Z#d	S)P�TurtleScreenBasecCstjdd|jd�}|��|S)Nr�)rzr�r)r��
PhotoImage�cv�blank)r�Zimgr�r�r��_blankimage�szTurtleScreenBase._blankimagecCstj||jd�S)N)�filer)r�r(r))r�r�r�r�r��_image�szTurtleScreenBase._imagecCs�||_t|t�r"|jj}|jj}nJt|j�d��}t|j�d��}|jj|d|d|d|dfd�||_||_d|_|_	dS)Nrzr�r��rr�)
r)r�rr�r�r�rr�xscale�yscale)r�r)�w�hr�r�r�r��s

*zTurtleScreenBase.__init__cCs|jjdddd�S)N)rrrrrrr��r�outline)r)Zcreate_polygonr�r�r�r��_createpoly�szTurtleScreenBase._createpolyNFc
Cs�g}|D]*\}}	|�||j�|�|	|j�q|jj|f|��|dk	r^|jj||d�|dk	rv|jj||d�|dk	r�|jj||d�|r�|j�|�dS)N�r)r4�rz��appendr/r0r)�coordsZ
itemconfigureZ	tag_raise)
r�Zpolyitem�	coordlistrr4rz�top�clr�r�r�r�r��	_drawpoly�szTurtleScreenBase._drawpolyc	Cs|jjddddddtjd�S)Nrr�r�)rrzZcapstyle)r)Zcreate_liner�ZROUNDr�r�r�r��_createlines�zTurtleScreenBase._createlinec	Cs�|dk	rNg}|D]*\}}|�||j�|�||j�q|jj|f|��|dk	rf|jj||d�|dk	r~|jj||d�|r�|j�|�dS)Nr6r7r8)	r�Zlineitemr;rrzr<r=r�r�r�r�r��	_drawlines
zTurtleScreenBase._drawlinecCs|j�|�dSr�)r)�delete�r��itemr�r�r��_delete(szTurtleScreenBase._deletecCs|j��dSr�)r)r,r�r�r�r��_update.szTurtleScreenBase._updatecCs|j�|�dSr�)r)�after�r�rr�r�r��_delay3szTurtleScreenBase._delaycCs4z|j�|�}d}Wntjk
r.d}YnX|S)NTF)r)Z	winfo_rgbr�ZTclError)r�r9Zrgb�okr�r�r��_iscolorstring7s
zTurtleScreenBase._iscolorstringcCs0|dk	r |jj|d�|��n|j�d�SdS)N)r�r�)r)rrEr)r�r9r�r�r��_bgcolorAs
zTurtleScreenBase._bgcolorcCst|\}}||j}||j}dddd�}|jj|d||||||d�}	|j�|	�\}
}}}
|j��|	|dfS)N�swr�Zse)rP�centerr_r�)�text�anchorr�font)r/r0r)Zcreate_textrr,)r�r[�txt�alignrPrWr�r�rOrCZx0Zy0Zx1Zy1r�r�r��_writeJs

�
zTurtleScreenBase._writer�csD�dkr�j�|d|�n$��fdd�}�j�|d|||�dS)N�<Button-%s>cs:�j�|j��j�j�|j��j}}�||�dSr��r)�canvasxr�r/�canvasyr�r0�rr�r���funr�r�r��eventfunes�z+TurtleScreenBase._onclick.<locals>.eventfun�r)Z
tag_unbindZtag_bind�r�rCrZ�num�addr[r�rYr��_onclick\szTurtleScreenBase._onclickcsD�dkr�j�|d|�n$��fdd�}�j�|d|||�dS)Nz<Button%s-ButtonRelease>cs:�j�|j��j�j�|j��j}}�||�dSr�rUrXrYr�r�r[ws�z-TurtleScreenBase._onrelease.<locals>.eventfunr\r]r�rYr��
_onreleaseks	�zTurtleScreenBase._onreleasecsD�dkr�j�|d|�n$��fdd�}�j�|d|||�dS)Nz<Button%s-Motion>csTz:�j�|j��j�j�|j��j}}�||�Wntk
rNYnXdSr�)r)rVr�r/rWr�r0r�rXrYr�r�r[�s�z*TurtleScreenBase._ondrag.<locals>.eventfunr\r]r�rYr��_ondrag~s	zTurtleScreenBase._ondragcs@�dkr�j�d|�n"��fdd�}�j�d|||�dS)NrTcs:�j�|j��j�j�|j��j}}�||�dSr�rUrXrYr�r�r[�s�z1TurtleScreenBase._onscreenclick.<locals>.eventfun�r)rr)r�rZr^r_r[r�rYr��_onscreenclick�s	zTurtleScreenBase._onscreenclickcs>�dkr|j�d|d�n�fdd�}|j�d||�dS)Nz<KeyRelease-%s>cs
��dSr�r��r�rZr�r�r[�sz0TurtleScreenBase._onkeyrelease.<locals>.eventfunrc�r�rZr�r[r�rfr��
_onkeyrelease�szTurtleScreenBase._onkeyreleasecsn�dkr4|dkr |j�dd�qj|j�d|d�n6�fdd�}|dkrX|j�d|�n|j�d||�dS)Nz
<KeyPress>z
<KeyPress-%s>cs
��dSr�r�rerfr�r�r[�sz.TurtleScreenBase._onkeypress.<locals>.eventfunrcrgr�rfr��_onkeypress�szTurtleScreenBase._onkeypresscCs|j��dSr�)r)rr�r�r�r��_listen�szTurtleScreenBase._listencCs(|dkr|j�|�n|j�||�dS�Nr)r)Z
after_idlerF�r�rZ�tr�r�r��_ontimer�szTurtleScreenBase._ontimercCs|jjdd|d�S)Nr��image)r)Zcreate_image)r�rpr�r�r��_createimage�szTurtleScreenBase._createimagecCs<|\}}|j�|||j||jf�|jj||d�dS�Nro)r)r:r/r0�
itemconfig)r�rCr[rpr�r�r�r�r��
_drawimage�s zTurtleScreenBase._drawimagecCs |jj||d�|j�|�dSrr)r)rsZ	tag_lower)r�rCrpr�r�r��	_setbgpic�szTurtleScreenBase._setbgpiccCs|j�|�Sr�)r)r�rBr�r�r��_type�szTurtleScreenBase._typecs.|j�|���fdd�tdt��d�D�}|S)Ncs"g|]}�|�|df�qS)r�r���.0�i�r=r�r��
<listcomp>�sz/TurtleScreenBase._pointlist.<locals>.<listcomp>rr�)r)r:�range�len)r�rC�plr�rzr��
_pointlist�szTurtleScreenBase._pointlistcCs|jj||||fd�dS)Nr.)r)r)r��srx1�sry1�srx2�sry2r�r�r��_setscrollregion�sz!TurtleScreenBase._setscrollregionc	Cs||j��}|D]h}t|j�|��}g}|rd|dd�\}}|�||�|�||�|dd�}q&|jj|f|��qdS�Nr�)r)Zfind_allr�r:r9)	r�ZxscalefactorZyscalefactorr�rCZcoordinatesZnewcoordlistr�r�r�r�r��_rescale�s
zTurtleScreenBase._rescalecCszt|jt�s|j|jfS||kr6|kr6dkrJnn|jj|jjfS|dk	rX||_|dk	rf||_|j�|||�dSr�)r�r)rr�r�r`rr�r�r��_resizes"zTurtleScreenBase._resizecCs@|j��}|dkr|jd}|j��}|dkr8|jd}||fS)Nr�rzr�)r)r
r)r�rzr�r�r�r��_window_sizes



zTurtleScreenBase._window_sizecCs|jj��dSr�)r)Ztkrr�r�r�r�rs
zTurtleScreenBase.mainloopcCstj|||jd�S)N)�parent)rZ	askstringr))r�r)�promptr�r�r�r(.s
zTurtleScreenBase.textinputcCstj||||||jd�S)N)ZinitialvalueZminvalueZmaxvaluer�)rZaskfloatr))r�r)r��defaultZminvalZmaxvalr�r�r�r=s

�zTurtleScreenBase.numinput)NNNF)NNNF)N)r�N)r�N)r�N)r�N)N)NNN)NNN)$r�r�r�r+r-r�r5r>r?r@rDrErHrJrKrSr`rarbrdrhrirjrnrqrtrurvrr�r�r�r�rr(rr�r�r�r�r'�sR
�
�


	





r'c@seZdZdS)r�N�r�r�r�r�r�r�r�r�Ysc@seZdZdS)�TurtleGraphicsErrorNr�r�r�r�r�r�bsr�c@s eZdZddd�Zddd�ZdS)rNcCsz||_|dkr"t|t�rpt|�}nN|dkrVt|t�rp|���d�rpt|�rpt�	|�}n|dkrdg}nt
d|��||_dS)N�polygonrp�.gif�compoundzThere is no shape type %s)rvr�r�r�r��lower�endswithrrr-r��_data)r�Ztype_�datar�r�r�r�ns


zShape.__init__cCs:|jdkrtd|j��|dkr$|}|j�|||g�dS)Nr�z Cannot add component to %s Shape)rvr�r�r9)r��polyrr4r�r�r��addcomponent~s
�zShape.addcomponent)N)N)r�r�r�r�r�r�r�r�r�rgs
c@s@eZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�ZdS)�Tbufferr�cCs$||_dgg||_d|_d|_dS)Nr�F)�bufsize�buffer�ptr�cumulate)r�r�r�r�r�r��szTbuffer.__init__NcCsD|dkr&t|j�D]}dg|j|<qn||_dgg||_d|_dS)Nr�)r|r�r�r�)r�r�ryr�r�r�r`�sz
Tbuffer.resetcCsF|jdkrB|js0|jd|j|_||j|j<n|j|j�|�dSr�)r�r�r�r�r9rBr�r�r��push�s

zTbuffer.pushcCsJ|jdkrF|j|j}|dkr"dSdg|j|j<|jd|j|_|SdSr�)r�r�r�rBr�r�r��pop�s
zTbuffer.popcCs|j|j�dg�Sr�)r�r��countr�r�r�r��nr_of_items�szTbuffer.nr_of_itemscCst|j�dt|j�S)N� )r�r�r�r�r�r�r�r��szTbuffer.__repr__)r�)N)	r�r�r�r�r`r�r�r�r�r�r�r�r�r��s

	r�c@seZdZdZedededfdd�Zdd�Zd<d
d�Zdd
�Zd=dd�Z	dd�Z
dd�Zd>dd�Zdd�Z
dd�Zdd�Zd?dd�Zd@dd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�ZdAd-d.�Zd/d0�ZdBd1d2�ZdCd3d4�ZdDd6d7�ZdEd8d9�ZdFd:d;�ZeZe
Z eZ!e	Z"eZ#d	S)GrTrrrc
Cs�t�||�tdd�tdd�tdd�tdd�tdd�tdd�td|���d	�|_d
di|_||_||_td|_	g|_
|��tj
d
kr�|��}|�ddddd�|�ddddd�dS)Nr�)����r�r�r�rr�))r�)����)r�r�)����)����	)����)����)r�r�)������)���r�)r�r�)r�r��rr�)�r�)�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�)��Q�#@���Q�@)�G�z. @��Q��@)r�r�)r�r�r�)���Q��r�)��Q���r�)�G�z. �r�)��Q�#�r�r�)r�r�)r�r�)r�r�)r�r�)g�g$�)r�r�)r�r�)r�r�)r�r�))r�r�)r�r�)r�r�)r�r�))r���G�z�)rg�����'@)r�r�)�rr)r�r�r�)r�r�rp)Zarrowr�r4ZsquareZtriangler�r*�nopicr�r�darwinZwmZ
attributesr�z-topmost�1�0)r'r�rr+�_shapes�_bgpics�_mode�_delayvaluer��
_colormode�_keysr5�sys�platformr�Zcall)r�r)rrrZ
rootwindowr�r�r�r��s&�


zTurtleScreen.__init__cCs�td|_td|_|�d�|�d�|_d|_d|_d|_g|_	|�
d�d	D]}|�d|�qP|�d�|j
dd�D]}|�d|�|�d|�qzdt_dS)
Nrr�allr�r�r�rr�)r�r��)r�r�r�rDrq�_bgpic�
_bgpicname�_tracing�_updatecounter�_turtlesrrRrr�rr�_pen)r��btnr�r�r�r�r5�s 




zTurtleScreen.clearNcCs||dkr|jS|��}|dkr*td|��||_|dkrp|�|jd|jd|jd|jd�d|_|_|��dS)N�r��logo�worldzNo turtle-graphics-mode %s)r�r�r�r�)	r�r�r�r�r�r�r/r0r`�r�rr�r�r�rs�zTurtleScreen.modecCs�|��dkr|�d�t||�}t||�}|��\}}|�|d|d�|j|j}	}
|j||_|j||_||j}||j}|j|}
|j|}|�|||
|�|�	|j|	|j|
�|�
�dS)Nr��)rr�r�r%r/r0r�r�r�r�r,)r�ZllxZllyZurxZuryZxspanZyspanZwxZwyZ	oldxscaleZ	oldyscaler�r�r�r�r�r�r�r'-s 



z TurtleScreen.setworldcoordinatescCsT|dkr2|���d�r(td|�|��}qFtd��nt|t�rFtd|�}||j|<dS)Nr�rpz;Bad arguments for register_shape.
Use  help(register_shape)r�)r�r�rr-r�r�r�r�)r��namerkr�r�r�r#Ts


zTurtleScreen.register_shapec	Cst|�dkr|d}t|t�rD|�|�s0|dkr4|Stdt|���z|\}}}Wn(ttfk
rztdt|���YnX|jdkr�dd�|||fD�\}}}d|kr�d	kr�nn.d|kr�d	kr�nnd|kr�d	ks�ntd
t|���d|||fS)Nr�rr�zbad color string: %s�bad color arguments: %sr�cSsg|]}td|��qS�g�o@��round�rxr�r�r�r�r{�sz*TurtleScreen._colorstr.<locals>.<listcomp>��bad color sequence: %s�
#%02x%02x%02x)r}r�r�rJr��	TypeErrorr�r�)r�r9r��g�br�r�r��	_colorstrws


FzTurtleScreen._colorstrcsx��d�s�St��dkr.�fdd�dD�}n4t��dkrV�fdd��dd�D�}ntd	���t�fd
d�|D��S)Nr�r�cs"g|]}t�||d�d��qS)r�r��r�rw��cstrr�r�r{�sz'TurtleScreen._color.<locals>.<listcomp>)r�r�r�r�csg|]}dt�|d��qS)r�r�)rxr2r�r�r�r{�sr�zbad colorstring: %sc3s|]}|�jdVqdS)r�N)r�)rxr�r�r�r��	<genexpr>�sz&TurtleScreen._color.<locals>.<genexpr>)r�r}r�r�)r�r�r=r�)r�r�r��_color�s
zTurtleScreen._colorcCs8|dkr|jS|dkr"t|�|_n|dkr4t|�|_dS)Nr�r�)r�r�r�)r�Zcmoder�r�r�r�szTurtleScreen.colormodecCs$|jD]}|�|j�|��qdSr�)r��_setmoder�r`)r�r�r�r�r�r`�s
zTurtleScreen.resetcCs|jSr�)r�r�r�r�r�r+�szTurtleScreen.turtlescGs4|r|�|�}nd}|�|�}|dk	r0|�|�}|Sr�)r�rKr��r�rr9r�r�r�r�s

zTurtleScreen.bgcolorcCsB|dkr|jSt|�|_d|_|dk	r0t|�|_|jr>|��dSrk)r�r�r�r�r,)r��nrr�r�r�r*�s

zTurtleScreen.tracercCs|dkr|jSt|�|_dSr�)r�r�rGr�r�r�r�szTurtleScreen.delaycCs<tjsdt_t�|jdkr8|jd7_|j|j;_dS)NTrr�)r�_RUNNINGr�r�r�r�r�r�r��
_incrementudc	s
zTurtleScreen._incrementudccCs<|j}d|_|��D]}|��|��q||_|��dS�NT)r�r+�_update_data�_drawturtlerE)r��tracingrmr�r�r�r,s
zTurtleScreen.updatecCs|��dSrk�r�r�r�r�r�r.szTurtleScreen.window_widthcCs|��dS�Nr�r�r�r�r�r�r-&szTurtleScreen.window_heightcCs|jSr�)r)r�r�r�r�r/s
zTurtleScreen.getcanvascCst|j���Sr�)�sortedr�r�r�r�r�r�r;s	zTurtleScreen.getshapesr�cCs|�|||�dSr�)rd�r�rZr�r_r�r�r�rRFszTurtleScreen.onclickcCsF|dkr ||jkr6|j�|�n||jkr6|j�|�|�||�dSr�)r��remover9rh�r�rZr�r�r�r�rWs

zTurtleScreen.onkeycCsN|dkr ||jkr>|j�|�n|dk	r>||jkr>|j�|�|�||�dSr�)r�r�r9rir�r�r�r�rus
zTurtleScreen.onkeypresscCs|��dSr�)rj)r��xdummy�ydummyr�r�r�r�s
zTurtleScreen.listenrcCs|�||�dSr�)rnrlr�r�r�r"�szTurtleScreen.ontimercCsF|dkr|jS||jkr(|�|�|j|<|�|j|j|�||_dSr�)r�r�r-rur�)r�Zpicnamer�r�r�r�s
zTurtleScreen.bgpiccCs|�|||�Sr�)r�rr�r�r�r%�szTurtleScreen.screensize)N)N)N)NN)N)r�N)N)NN)r)N)NNN)$r�r�r�r�r�r�r5rr'r#r�r�rr`r+rr*rr�r,r.r-rrrRrrrr"rr%r!r$rrr r�r�r�r�r�sF�
(
"'
#
	

			

 



c@sPeZdZedd�edd�edd�d�ZdZdZdZefdd�Zd	d
�Z	dAdd
�Z
dd�ZdBdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�ZdCd)d*�Zd+d,�Zd-d.�Zd/d0�ZdDd1d2�ZdEd3d4�Zd5d6�Zd7d8�ZdFd9d:�Z dGd;d<�Z!dHd=d>�Z"dId?d@�Z#eZ$eZ%eZ&eZ'eZ(eZ)eZ*eZ+eZ,dS)J�
TNavigatorr��)r�r�r�r�rr�cCsB|j|_|j|_||_d|_|��d|_|�|�t�	|�dSr�)
�DEFAULT_ANGLEOFFSET�_angleOffset�DEFAULT_ANGLEORIENT�_angleOrientr��
undobufferr:r�r�r`r�r�r�r�r��s
zTNavigator.__init__cCstdd�|_tj|j|_dS)Nr�)r�	_positionr��START_ORIENTATIONr��_orientr�r�r�r�r`�szTNavigator.resetNcCsL|dkr|jS|dkrdS||_|dkr6d|_d|_n|jd|_d|_dS)Nr�)r�r�rr��@r�)r�rr�_fullcircler�r�r�r�r�szTNavigator._setmodecCs0||_d||_|jdkr"d|_n
|d|_dS)Nihr�rr)r�
_degreesPerAUr�r�r�Z
fullcircler�r�r��_setDegreesPerAUs


zTNavigator._setDegreesPerAU��v@cCs|�|�dSr�)rr
r�r�r�r:szTNavigator.degreescCs|�dtj�dSr�)rr�r�r�r�r�r�r^5szTNavigator.radianscCs|j|j|}|�|�dSr�)rr�_goto)r�r;Zender�r�r��_goCszTNavigator._gocCs||j9}|j�|�|_dSr�)r	rr��r�r�r�r�r��_rotateHs
zTNavigator._rotatecCs
||_dSr��r)r��endr�r�r�r
MszTNavigator._gotocCs|�|�dSr��r�r�r;r�r�r�rCQszTNavigator.forwardcCs|�|�dSr�rrr�r�r�r/hszTNavigator.backcCs|�|�dSr��rrr�r�r�r_|szTNavigator.rightcCs|�|�dSr�rrr�r�r�rP�szTNavigator.leftcCs|jSr�rr�r�r�r�r[�szTNavigator.poscCs
|jdSrkrr�r�r�r�r|�szTNavigator.xcorcCs
|jdSr�rr�r�r�r�r}�szTNavigator.ycorcCs,|dkr|�t|��n|�t||��dSr�)r
r)r�r�r�r�r�r�rI�szTNavigator.gotocCs|�dd�|�d�dSrk)rIrdr�r�r�r�rL�szTNavigator.homecCs|�t||jd��dSr��r
rr)r�r�r�r�r�riszTNavigator.setxcCs|�t|jd|��dSrkr)r�r�r�r�r�rjszTNavigator.setycCsT|dk	rt||�}t|t�r"|}n$t|t�r6t|�}nt|t�rF|j}t||j�Sr�)rr�r�r�r�abs)r�r�r�r[r�r�r�r;%s




zTNavigator.distancecCs�|dk	rt||�}t|t�r"|}n$t|t�r6t|�}nt|t�rF|j}||j\}}tt�||�dtjd�d}||j	}|j
|j||jS�Nr�r�r)
rr�r�r�rr�r��atan2r�r	rrr)r�r�r�r[�resultr�r�r�ruEs




 
zTNavigator.towardscCsJ|j\}}tt�||�dtjd�d}||j}|j|j||jSr)	rr�r�rr�r	rrr)r�r�r�rr�r�r�rJhs

 
zTNavigator.headingcCs>||��|j}|j}||d||d}|�|�dS)N�@)rJrrr)r�Zto_angler�Zfullr�r�r�rdwszTNavigator.setheadingcCsp|jr|j�dg�d|j_|��}|dkr2|j}|dkrjt|�|j}dttdt|�dd�|�}d||}d|}d	|t�	|tj
d
|j�}|dkr�|||}}}|��}	|�
�}
|dkr�|�dd�n
|�d�|�|�t|�D].}|�|�|�|�|�d�|�|��q|�|�|dk�rR|�|	|
�|�|�|j�rld|j_dS)
N�seqTr��g@g�M@r�r�rr�rF)rr�r�rprrr��minr�r�r�r	�_tracerrHrr|r)r��radiusZextent�stepsrpZfracr1Zw2�lZtrZdlryr�r�r�r4�s>""






zTNavigator.circlecCsdSr�r�)r�r�r�r�r�rp�szTNavigator.speedcCsdSr�r�)r��ar�r�r�r�r�szTNavigator._tracercCsdSr�r�)r�r�r�r�r�rH�szTNavigator._delay)N)r)N)N)N)NN)r)NN)N)-r�r�r�rrZDEFAULT_MODEr�rr�r`r�rr:r^rrr
rCr/r_rPr[r|r}rIrLrirjr;rurJrdr4rprrHr@r3r0rbrQr\rerfrcr�r�r�r�r��sX�

	


#
 
#
A


r�c@s�eZdZedfdd�Zededfdd�Zd-d	d
�Zd.dd�Zd
d�Zdd�Z	dd�Z
d/dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd �Zd0d!d"�Zd1d$d%�Zd2d'd(�Zd)d*�Zd+d,�ZeZeZeZe	Ze	ZeZeZdS)3�TPenracCs||_d|_t�|�dSr�)�_resizemoderr$�_reset)r�rar�r�r�r��sz
TPen.__init__rWrAcCsFd|_d|_||_||_d|_d|_d|_d|_d|_d|_	d|_
dS)Nr�Tr�)r�r�r�)r�r�r�r�)�_pensize�_shown�	_pencolor�
_fillcolor�_drawing�_speed�_stretchfactor�_shearfactor�_tilt�_shapetrafo�
_outlinewidth)r�rWrAr�r�r�r&�szTPen._resetNcCs.|dkr|jS|��}|dkr*|j|d�dS)N)�auto�userr��ra)r%r�rV)r�Zrmoder�r�r�ra�s
zTPen.resizemodecCs|dkr|jS|j|d�dS)N)rY)r'rV)r�rzr�r�r�rYszTPen.pensizecCs|js
dS|jdd�dS)NF�rX�r+rVr�r�r�r�rZ0s
z
TPen.penupcCs|jr
dS|jdd�dS)NTr5r6r�r�r�r�rX>s
zTPen.pendowncCs|jSr�)r+r�r�r�r�rNLs
zTPen.isdowncCsjdddddd�}|dkr|jS||kr0||}n*d|krDdkrVnntt|��}nd}|j|d	�dS)
Nrr�r�r�r�)ZfastestZfast�normalZslowZslowestr�g%@)rp)r,r�r�rV)r�rpZspeedsr�r�r�rp[s
z
TPen.speedcGs�|rht|�}|dkr"|d}}n"|dkr4|\}}n|dkrD|}}|�|�}|�|�}|j||d�n|�|j�|�|j�fSdS)Nr�rr�r�)rWrA)r}r�rVr�r)r*)r�rr"ZpcolorZfcolorr�r�r�r9�s 


z
TPen.colorcGs:|r*|�|�}||jkrdS|j|d�n|�|j�SdS)N)rW)r�r)rVr�r�r�r�r�rW�s

z
TPen.pencolorcGs:|r*|�|�}||jkrdS|j|d�n|�|j�SdS)N)rA)r�r*rVr�r�r�r�r�rA�s

zTPen.fillcolorcCs|jdd�dS)NT��shown�rVr�r�r�r�ro�szTPen.showturtlecCs|jdd�dS)NFr8r:r�r�r�r�rK	szTPen.hideturtlecCs|jSr�)r(r�r�r�r�rO	s
zTPen.isvisiblecKs�|j|j|j|j|j|j|j|j|j|j	|j
d�}|s>|s>|St|t�rN|}ni}|�
|�i}|D]}||||<qd|jr�|j�d|f�d}d|kr�|j|dkr�d}d|kr�t|dt�r�|�|df�|d<|j|dkr�d}d|k�r|j|dk�rd}|�r|��d|k�r&|d|_d|k�r:|d|_d|k�rN|d|_d|k�r�t|dt��r||�|df�|d<|d|_d	|k�r�|d	|_d
|k�r�|d
|_d|k�r�|d}t|ttf��r�||f}||_d|k�r�|d|_d
|k�r|d
|_	d|k�r|d|_d|k�r.|d|_
d|k�sLd|k�sLd|k�r�|j\}	}
|j}t�|j
�t�|j
�}}
|	|
|
||
||	||
|
||f|_|��dS)N)r9rXrWrArYrpra�
stretchfactorrnr4rsrVFrXTrWrYrArprar;rnr4r9rs)r(r+r)r*r'r,r%r-r.r1r/r��dictr,rr�r�r��_newLiner�r�r�r�r�r0rE)r�rVZpendictZ_pd�pZ_p_bufr�ZnewLineZsfZscxZscyZshf�sa�car�r�r�rV!	s�/�

























�zTPen.penTcCsdSr�r��r�ZusePosr�r�r�r=�	sz
TPen._newLineFcCsdSr�r�)r�r�Zforcedr�r�r�rE�	szTPen._updatecCsdSr�r�rr�r�r�r��	szTPen._colorcCsdSr�r�rr�r�r�r��	szTPen._colorstr)N)N)N)N)T)TF)r�r�r�r�r�r&rarYrZrXrNrpr9rWrArorKrOrVr=rEr�r�rzryr]rUr=rqrMr�r�r�r�r$�s8�



&.%$



r$c@seZdZdd�Zdd�ZdS)�_TurtleImagecCs||_d|_|�|�dSr�)r�rv�	_setshape)r�r��
shapeIndexr�r�r�r��	sz_TurtleImage.__init__cs�|j�||_|jdkr*�j|jkr2nndS|jdkrP�j|jkrXnndS|jdkrp��|j�n |jdkr�|jD]}��|�q��j|j|_|jdkr����|_nF|jdkrԈ��jdj�|_n&|jdkr��fdd��j|jD�|_dS)Nr�rp)rpr�r�r*csg|]}����qSr��r5�rxrC�r�r�r�r{�	sz*_TurtleImage._setshape.<locals>.<listcomp>)	r�rDrvr�rD�_itemr5rqr�)r�rDrCr�rGr�rC�	s(""







�z_TurtleImage._setshapeN)r�r�r�r�rCr�r�r�r�rB�	srBc@s�eZdZgZdedededfdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdldd�Z
dd�Zdd�Zdd�Zdd�Zdmdd �Zdnd!d"�Zdod#d$�Zd%d&�Zdpd'd(�Zd)d*�Zdqd+d,�Zd-d.�Zd/d0�Zdrd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Zdsd<d=�Z d>d?�Z!d@dA�Z"dBdC�Z#dtdEdF�Z$dGdH�Z%dIdJ�Z&dKdL�Z'dudMdN�Z(dOdP�Z)dvdSdT�Z*dUdV�Z+dWdX�Z,dYdZ�Z-d[d\�Z.d]d^�Z/e/Z0dwd_d`�Z1dxdbdc�Z2dyddde�Z3dzdfdg�Z4dhdi�Z5djdk�Z6eZ7dS){r
Nrkr�r�cCs4t|t�r||_n|t|t�r:|tjkr2tj�|�||_nTt|ttf�r�tjD]}|j	|krN||_q�qNt|�|_tj�|j�nt
d|��|j}t�||�
��t�|�|j�|�|��|_t||�|_d|_d|_d|_|_||_d|_|��|_|jg|_|jg|_g|_||_t |�|_!|�"�dS)Nzbad canvas argument %sF)#r��_Screenr�rr
�screensr9rr�r)r�r�r�rr$r�r?�drawingLineItemrBr��_poly�
_creatingPoly�	_fillitem�	_fillpathr(�_hidden_from_screen�currentLineItemr�currentLiner��
stampItems�_undobuffersizer�rrE)r�Zcanvasrkr�r�r�r�r�r�r��	s@











zRawTurtle.__init__cCs0t�|�t�|�|��|��|��dSr�)r�r`r$r&�_clearr�rEr�r�r�r�r`
s


zRawTurtle.resetcCs&|dks|dkrd|_n
t|�|_dSrk)rr�)r��sizer�r�r�rh
szRawTurtle.setundobuffercCs|jdkrdS|j��Srk)rr�r�r�r�r�rx,
s	
zRawTurtle.undobufferentriescCsld|_|_|jD]}|j�|�q|j��|_g|_|jrJ|j�	|j
�|jg|_|��|�|j
�dSr�)rNrOr�r�rDr?rQrRr+r9rr7rhrTrBr�r�r�rU9
s

zRawTurtle._clearcCs|��|��dSr�)rUrEr�r�r�r�r5G
szRawTurtle.clearcCsF|j��|jjdkrdSt|j�dkrB|j�|j|j|j|j�dSr�)	r�r�r�r}rRr@rQr)r'r�r�r�r�r�V
s
�zRawTurtle._update_datacCsx|j}|jdkrdS|jdkrD|��|��|��|�|j�n0|��|jdkrt|��D]}|��q^|��dSr�)	r�r�r�r�rErHr�r�r+)r�r�rmr�r�r�rE^
s



zRawTurtle._updatecCs|j�||�Sr�)r�r*)r��flagrr�r�r�rp
szRawTurtle._tracercCs|j�|�Sr�)r�r�rr�r�r�r��
szRawTurtle._colorcCs|j�|�Sr�)r�r�rr�r�r�r��
szRawTurtle._colorstrc	Cs�t|t�r|Sz|\}}}Wn(ttfk
rDtdt|���YnX|jjdkrldd�|||fD�\}}}d|kr�dkr�nn.d|kr�dkr�nnd|kr�dks�ntdt|���d|||fS)	Nr�r�cSsg|]}td|��qSr�r�r�r�r�r�r{�
sz!RawTurtle._cc.<locals>.<listcomp>rr�r�r�)r�r�r�r�r�r�r�)r�rr�r�r�r�r�r��_cc�
s
Fz
RawTurtle._cccs�|j�|�|j�|j}d|_d|_t|�}�|_||_�|_t�|jj�|_�j�|��j	|jjj
}|dkr����|j_nJ|dkr���
�j	dj�|j_n*|dkrʇfdd��j	|jjjD�|j_���|_|��|S)Nr�rpr*r�csg|]}����qSr�rErFrGr�r�r{�
sz#RawTurtle.clone.<locals>.<listcomp>)r�r=r+r�rrBrDr�r9r�rvr5rHrqr�r?rQrE)r�r��q�ttyper�rGr�r8�
s.
�

zRawTurtle.clonecCsB|dkr|jjS||j��kr*td|��|j�|�|��dS)NzThere is no shape named %s)r�rDr�rr�rCrE)r�r�r�r�r�rk�
szRawTurtle.shapecCs�||kr|krdkr8nn|j\}}|||jfS|dksH|dkrPtd��|dk	rt|dkrj||f}q�||f}n|dk	r�|jd|f}n|j}|dkr�|j}|jd||d�dS)Nrz(stretch_wid/stretch_len must not be zeror3)rar;r4)r-r1r�rV)r�Zstretch_widZstretch_lenr4r;r�r�r�rl�
s$"


�zRawTurtle.shapesizecCs |dkr|jS|jd|d�dS)Nr3)rarn)r.rV)r�Zshearr�r�r�rnszRawTurtle.shearfactorcCs<||j|j}|tjddtj}|jd|d�dS)Nr�r�r3)rars)r	rr�r�rV�r�r�rsr�r�r�rgszRawTurtle.settiltanglecCs>|dkr0|jdtj|j}||j|jS|�|�dS)Nr�)r/r�r�rr	rrgr[r�r�r�rt4szRawTurtle.tiltanglecCs|�||���dSr�)rgrtrr�r�r�rsNszRawTurtle.tiltcCs6||kr(|kr(|kr(dkr2nn|jS|j\}}}}|dk	rL|}|dk	rX|}|dk	rd|}|dk	rp|}||||dkr�td��||||f|_t�||�dtj}	t�|	�t�|	�}
}|||
||||
||
||||
|||f\}}
}}||f|_|
||_|	|_	|j
dd�dS)Nrz0Bad shape transform matrix: must not be singularr�r3r4)r0r�r�rr�r�r�r-r.r/rV)r��t11�t12�t21�t22Zm11Zm12Zm21Zm22Zalfar?r@Za11Za12Za21Za22r�r�r�rmas0,�

zRawTurtle.shapetransformcs^|j�|j\��|j\��t���j�j�}dt|�|\�������fdd�|D�S)Nr�csFg|]>\}}��|�|�j��|�|�jf�qSr�)r/r0�rxr�r��Ze0Ze1Zp0Zp1r�r�r�r{�s�z(RawTurtle._polytrafo.<locals>.<listcomp>)r�rrrr0r/r)r�r��er�rar��
_polytrafo�s

�zRawTurtle._polytrafocCs2|jj|jj}|jdkr.|�|j|jdk�SdS)Nr�r�)r�r�r�rDrv�
_getshapepolyr�)r�rkr�r�r�rG�s
zRawTurtle.get_shapepolyFcsx|jdks|r|j\����n>|jdkrNtd|jd�}|dd|f\����n|jdkr\|St����fdd�|D��S)	Nr3r2r�g@rr�c3s2|]*\}}�|�|�|�|fVqdSr�r�r`�r\r]r^r_r�r�r��sz*RawTurtle._getshapepoly.<locals>.<genexpr>)r%r0�maxr'r�)r�r�r�r"r�rer�rd�s

zRawTurtle._getshapepolyc	Cs�|j}|j|jj}|j}|jj}|j�r*|jdk�r*|jdk�r*d|_	|j
}|dkr�|jdkrfd}n|jdkrx|j}n|j
}|�|�|��}|j|j}}|j|||||dd�nt|d	kr�|�||j|�nZ|d
k�r�t||�D]D\}	\}
}}|�|�|
d��}
|j|	|
|�|�|�|�|j
dd�q�nx|j	�r6dS|dk�rR|�|ddd�nJ|d	k�rv|�||j|jd
j
�n&|d
k�r�|D]}	|�|	ddd��q�d|_	dS)NrFr�r�r�r2T�rr4rzr<rpr��r�r�r�r�r*)r�r�r�rDrvrHr(r�r�rPr�r%r'r1rcrdr*r)r>rtr�ziprX)r�r�rkrZZtitem�tshaper1�fc�ocrCr�r�r�r�r��sR 

�
�




�
zRawTurtle._drawturtlec	CsT|j}|j|jj}|j}|j}|dkr�|��}|jdkr@d}n|jdkrR|j}n|j	}|�
|�|��}|j|j
}}|j|||||dd�n�|dkr�|�d�}|�||j|�n�|d	k�r4g}|D]}	|��}
|�|
�q�t|�}t||�D]D\}
\}}}|�
|�|d��}|j|
||�|�|�|�|j	dd�q�|j�|�|j�d
|f�|S)Nr�r�r�r2Trgrpr�r�rr)r�r�r�rDrvr�r5r%r'r1rcrdr*r)r>rqrtrr9r�rirXrSrr�)r�r�rkrZrj�stitemr1rkrlZelementrCr�r�r�r�rr�sH

�

�zRawTurtle.stampcCs�||jkrDt|t�r,|D]}|j�|�qn|j�|�|j�|�d|f}|j}||jkr`dS|j�|�}|j�|�||j	kr�|j	d|j
|_	|j�|j	d|j
dg�dS)Nrrr�)rSr�r�r�rDr�rr��indexr�r��insert)r��stampidZsubitemrCZbufrnr�r�r��_clearstamps



zRawTurtle._clearstampcCs|�|�|��dSr�)rqrE)r�rpr�r�r�r6s
zRawTurtle.clearstampcCs^|dkr|jdd�}n&|dkr0|jd|�}n|j|d�}|D]}|�|�qB|��dSrk)rSrqrE)r�r�ZtoDeleterCr�r�r�r7-szRawTurtle.clearstampsc
Cs�|j|j|jt|jt�f}|j}d|j|||j|j	dd�|�
|j�|jdd�ff}|jrh|j�
|�|j}|j�rZ|jdk�rZ||}|d|jd|d|jd}dt|ddd|j|j�}|d|}	td|�D]R}
|
dkr�d	}nd
}||	|
|_|j�r2|�|j||jf|j|j|�|��q�|j�rZ|j|jdd|jd
�|j�rn|j	�|�t|jt��r�|j�|�||_|j�r�|j�|�t|j	�dk�r�|��|��dS)N�gor�rr�r�r�皙�����?r�TF�r�r�r��rrz�*)r+r)r'r�rOr�r�rrQrRrr�rr�r,r�r/r0r�r|r@rKrEr9rMrLr}r=)r�r�go_modesr�Z
undo_entry�start�diff�diffsq�nhops�deltar�r<r�r�r�r
Isb
�

��$$�

�zRawTurtle._gotocs|\}}}}|\}}}}	|\}
}}�|j�t|j|�dkrDtd�|
|_||_|ddgkrbd}
n|}
�j|
||
|d���fdd�|jD�}|D]}��|�|j�	|�q�|}|j
�r��jdk�r�||}|d	�jd
|d�j
d
}dt|ddd|j
|j
�}|d
|}td|�D]P}|dk�r@d}nd}||||_|�rr��|j||jf|||�|���q,|�r��j|jdd|d�||_|j�r�t|j�d	k�r�|j��|jgk�r�d|_d|_|	�r|jgk�r�d|_td�n|jdk	�r|j��|��dS)Nr�z$undogoto: HALLO-DA-STIMMT-WAS-NICHT!r�r�rucs&g|]}|�kr��|�dkr|�qS)r�)rvrw�r�r�r�r�r{�s�z'RawTurtle._undogoto.<locals>.<listcomp>r�rr�r�rsr�TFrtzUnwahrscheinlich in _undogoto!)r�rrr�rQrRr@r�rDr�r,r�r/r0r�r|rKrErMr}rLr�rO)r��entry�old�newrwZcoodataZdrawingZpcZpsrBZcLIZcLr~ZusepcZtodeleteryrxryrzr{r|r�r<r�r}r��	_undogoto~sl
$$
�
�


zRawTurtle._undogotocCs�|jr|j�d||jf�||j9}|j�|�}|jj}|dkr�|jdkr�d|j}dtt	|�|�}d||}t
|�D]}|j�|�|_|��q|||_|��dS)N�rotr�rg@r�)rr�r	rr�r�r�r,r�rr|rE)r�r�Z	neworientr�Zanglevelr!r|r�r�r�r�r�s


zRawTurtle._rotateTcCsnt|j�dkrD|j�|j|j|j|j�|j��|_|j�	|j�n|jj|jdd�g|_|rj|j
g|_dS)Nr�T)r<)r}rRr�r@rQr)r'r?r�r9rrAr�r�r�r=�s�zRawTurtle._newLinecCst|jt�Sr�)r�rOr�r�r�r�r�rB�szRawTurtle.fillingcCsX|��s"|j��|_|j�|j�|jg|_|��|j	rL|j	�
d|jf�|��dS)N�	beginfill)rBr�r5rNr�r9rrOr=rr�rEr�r�r�r�r1�s
zRawTurtle.begin_fillcCs^|��rZt|j�dkrF|jj|j|j|jd�|jrF|j�d|jf�d|_|_|�	�dS)Nr�r6�dofill)
rBr}rOr�r>rNr*rr�rEr�r�r�r�r>
s�zRawTurtle.end_fillc	Gs8|sNt|ttf�r0|�|�}|jt|jd�}qr|j}|sr|jt|jd�}n$|dkrh|jt|jd�}|�|�}t|jd�r�|j�	|j
||�}|j�|�|j
r�|j
�d|f�n�|��}|j
r�|j
�dg�d|j
_z>|��dkr�|��|��|�|�|�|�|�d�W5|�|�X|j
�r4d|j
_dS)	Nr��_dotr<rTr2rF)r�r�r�r�r'rfr)�hasattrr�r�rr�r9rr�rVr�rarMrXrYrWrC)r�rVr9rCrVr�r�r�r<
s:



z
RawTurtle.dotcCsB|j�|j||||j�\}}|j�|�|jr>|j�d|f�|S)N�wri)r�rSrr)r�r9rr�)r�rQrRrPrCrr�r�r�rSH
s�zRawTurtle._writerP��Arialr�r7cCs`|jr|j�dg�d|j_|�t|�|��|�}|rN|��\}}|�||�|jr\d|j_dS)NrTF)rr�r�rSr�r�r[re)r��argZmoverRrPrr�r�r�r�r�r{R
szRawTurtle.writecCs|jg|_d|_dSr�)rrLrMr�r�r�r�r2o
s
zRawTurtle.begin_polycCs
d|_dS�NF)rMr�r�r�r�r?}
szRawTurtle.end_polycCs|jdk	rt|j�SdSr�)rLr�r�r�r�r�rD�
s

zRawTurtle.get_polycCs|jSr�rGr�r�r�r�rF�
szRawTurtle.getscreencCs|Sr�r�r�r�r�r�rH�
szRawTurtle.getturtlecCs|j�|�Sr�)r�rrGr�r�r�rH�
szRawTurtle._delayr�cCs"|j�|jj|||�|��dSr�)r�r`r�rHrEr�r�r�r�rR�
szRawTurtle.onclickcCs"|j�|jj|||�|��dSr�)r�rar�rHrEr�r�r�r�rT�
szRawTurtle.onreleasecCs|j�|jj|||�dSr�)r�rbr�rHr�r�r�r�rS�
szRawTurtle.ondragcCs,|jdkrdS|dkr@|\}}|�|||j�|j��}n�|dkr\|d}|�|�n�|dkrp|�|�n�|dkr�|d}|j�|�|j�	|�n�|dkr�|d}|jj
|dddd	�nh|d
k�r|d}d|_|_||jk�r(|j�|�|j�	|�n$|dk�r(t
�||d�|j��dS)Nr�rrrrr)r�r<r�rhr�r3r�rV)rrr	r�r6r�r�rDr�r�r>rNrOr$rV)r��actionr�r�ZdegPAUZdummyrmrCr�r�r��_undos<

�

zRawTurtle._undocCsl|jdkrdS|j��}|d}|dd�}|dkr\|rh|��}|�|d|dd��q4n|�||�dS)Nrr�r)rr�r�)r�rCr�r�r�r�r�rw's

zRawTurtle.undo)NN)N)NNN)N)N)NNNN)F)N)T)N)FrPr�)N)r�N)r�N)r�N)8r�r�r�rJr�r�r`rhrxrUr5r�rErr�r�rXr8rkrlrnrgrtrsrmrcrGrdr�rrrqr6r7r
r�rr=rBr1r>r<rSr{r2r?rDrFrHrErHrRrTrSr�rwrvr�r�r�r�r
�	sp�
(

(

(


(

(-
5A

0







 cCstjdkrt�t_tjSr�)r�_screenrIr�r�r�r�r	Js
c@sfeZdZdZdZedZdd�Zededededfd	d
�Zdd�Z	d
d�Z
dd�Zdd�ZdS)rINr)cCs�tjdkr4t�t_|_|j�tj�|j�|j�tjdkr�td}td}td}td}td}td}|j�	||||�|j�
�t_t�|tj�|�
||||�dS)Nrzr�r�r�r�r�)rI�_rootrr)�_titler$�_destroyr�r�rrrr�r&)r�rzr�r�r�r�r�r�r�r�r�Xs

z_Screen.__init__rzr�r�r�cCs�t|jd�sdS|j��}|j��}t|t�rNd|krBdkrNnn||}|dkrb||d}t|t�r�d|kr�dkr�nn||}|dkr�||d}|j�||||�|��dS)Nr"rr�r�)r�r�r%r&r�r�r"r,)r�rzr�r r!rLZshr�r�r�r&ns

""z
_Screen.setupcCs tjdk	rtj�|�|t_dSr�)rIr�r)r�)r�Ztitlestringr�r�r�r)�s
z
_Screen.titlecCs:|j}|tjkr(dt_dt_dt_dt_dt_|��dSr�)	r�rIrr�r�r�rr�r#)r��rootr�r�r�r��s
z_Screen._destroycCs|��dSr�)r�r�r�r�r�r�sz_Screen.byecsN�fdd�}��|�tdr"dSz
t�Wntk
rHtd�YnXdS)Ncs���dSr�)r)r�r�r�r�r��exitGracefully�sz+_Screen.exitonclick.<locals>.exitGracefullyr�r)rRr�r�AttributeError�exit)r�r�r�r�r�r�s

z_Screen.exitonclick)
r�r�r�r�r�r�r�r�r&r)r�rrr�r�r�r�rIRs�
(
rIc@s0eZdZdZdZedededfdd�ZdS)rNrkr�r�cCs,tjdkrt�t_tj|tj|||d�dS)N)rkr�r�)rr�r	r
r�)r�rkr�r�r�r�r�r��s

�zTurtle.__init__)r�r�r�r�r�r�r�r�r�r�r�r�s��turtle_docstringdictc	Cs�i}tD]}d|}t|�j||<qtD]}d|}t|�j||<q(td|d���}tdd�|D��}|�d�|dd�D](}|�d	t|��|�d
||�q||d}|�d	t|��|�d||�|�d�|��W5QRXdS)
Nz_Screen.zTurtle.z%s.pyr1css$|]}|�d�dtkr|VqdS)r�r�N)r�_alias_listr�r�r�r�r�s�z&write_docstringdict.<locals>.<genexpr>zdocsdict = {

r�z%s :
z        """%s
""",

z        """%s
"""

z}
)	�_tg_screen_functionsr��__doc__�_tg_turtle_functionsr�r�r{�repr�close)r��docsdict�
methodnamer�r�r�r�r�r�r~�s$

c	Cs`dd|��i}t|�}|j}|D]8}z||t|�_Wq"tk
rXtd|�Yq"Xq"dS)Nz!turtle_docstringdict_%(language)sr�zBad docstring-entry: %s)r��
__import__r�r�r�r�r�)Zlang�modname�moduler�r�r�r�r��read_docstringssr�r�zCannot find docsdict forz;Unknown Error when trying to import %s-docstring-dictionaryc
Cs�d}}t�|j�\}}}|dd�}|dd�}|jp:g}dd�|D�}dgt|�t|�|}dd�t||�D�}	|dk	r�|	�d|�|�d|�|dk	r�|	�d|�|�d|�d�|	�}d	|}d�|�}d	|}||fS)
Nr�r�cSsg|]}d|f�qS)z=%rr�)rxr�r�r�r�r{<sz"getmethparlist.<locals>.<listcomp>cSsg|]\}}||�qSr�r�)rxr�Zdfltr�r�r�r{>s�*z**z, z(%s))�inspectZgetargs�__code__�__defaults__r}rir9r)
ZobZdefTextZcallTextrZvarargsZvarkwZitems2ZrealArgs�defaultsZitems1r�r�r��getmethparlist,s&


r�cCsJddl}|dkrdStd}|�d|d�}|�d|�}|�d|�}|S)Nrr��%s.r�� \(.+ %s\):�:��rer��replace�compile�sub)�docstrr�Z
turtlename�	newdocstr�parexpr�r�r��_turtle_docreviseKsr�cCsJddl}|dkrdStd}|�d|d�}|�d|�}|�d|�}|S)Nrr�r�r�r�r�r�)r�r�Z
screennamer�r�r�r�r��_screen_docreviseWsr�ardef {name}{paramslist}:
    if {obj} is None:
        if not TurtleScreen._RUNNING:
            TurtleScreen._RUNNING = True
            raise Terminator
        {obj} = {init}
    try:
        return {obj}.{name}{argslist}
    except TK.TclError:
        if not TurtleScreen._RUNNING:
            TurtleScreen._RUNNING = True
            raise Terminator
        raise
c
Csl|D]b}t||�}t|�\}}|dkr4td||�qtj|||||d�}	t|	t��||j�t�|_qdS)Nr�z>>>>>>)�obj�initr�Z
paramslistZargslist)�getattrr�r��__func_body�formatr��globalsr�)
Z	functionsr�r�r�Z	docreviser�r�Zpl1Zpl2Zdefstrr�r�r��_make_global_funcsws

�r�zTurtle._screenzScreen()zTurtle._penzTurtle()�__main__cCst�rt�nt�dSr�)rNr]rUr�r�r�r��	switchpen�sr�cCslt�td�t�td�t�td�td�D]Z}|dkrDt�td�D]}td�t	d�qL|dkrxt
d�t�t�td	�t�q2td
�t
d�td�t�td�td�td�td�td
�t�t
dd
�t
dd
�t
d�td�D]$}td�t	d�td�td�q�td�t�td�D]&}td�t	d�td�td��q:t�dS)NT�dr�r�r�r��ZZmaroonrr�r�F�Z
startstartrx�redr�)r`r*ryr0r=rzr|r1rCrPr9r>r_r{)ryr�r�r�r��demo1�sX



r�cCsBtd�t�td�ttdd��tdd�d}td�td�D]}t�t	|d�qBt
d�t�rnt�q`t
�td�td	�d}td
�td�td�tdd
�D]p}|dkr�t�td	d|dd|�td�D]}t|�td�q�t�|d7}td�tt�dd�q�td�t�td�td�t�tdd�td�t�td�D](}t	dd�td�td�td��q`t�td�t�td�t�td�t�}|�d�t�}|�d�|�d�|�
�|�d�|�d�|��|�dd�|�d�|��|�d�|�dd�|�d�|�d�tt|��d}|�|�dk�r�|�d�|�d �|�|�|��|�d�|d!dk�r�|� �|� �t�|d7}�qZ|j
d"d#d$d%�|�d&�|�d�d'd(�}t!�"d�t��r|��|���q�|�d�|j
d)d*d+�|�#|d�dS),Nr�r�rrr��r�zwait a moment...r�Zgreenr�r�r���x��Frr�Zyellowr��2r�r2i�(r�ZblueZoranger�g@g333333�?r�zCAUGHT! )r�r��boldr_)rPrRr�cSst�t�dSr�)rr)r�r�r�r�r��babaszdemo2.<locals>.babaz  Click me!)ZCourierr�r�)rP)$rprqrYrdrur;rbr|r�r4r{rxrwr`rQrrWr1rAr@r>r]rUr9rkrHrarrPryrIr=rr�time�sleeprR)r r�ZlaengeryZtrir�r�r�r�r�r��demo2�s�


















r�)r�)r�)EZ_verZtkinterr�r�r�r�r�r�Zos.pathrrr�copyrrZ_tg_classesr�r�Z
_tg_utilities�__all__r�r�r�r�r�r�r�rr�r�r�r�r�rr�rr�objectr'r�r�rr�rr�r$rBr
rr	rIrr
r~r�Z	_LANGUAGE�ImportErrorr�r�r�r�r�rrr�r�r�r�rr�r�r�r��<module>gs���
�

����5
�
c	/&/O}
"
���
5c__pycache__/imp.cpython-38.opt-1.pyc000064400000023123151153537550013143 0ustar00U

e5d()�@s�dZddlmZmZmZmZmZmZmZm	Z	m
Z
zddlmZWnek
rXdZYnXddl
mZmZmZmZddlmZddlmZddlmZddlZddlZddlZddlZddlZddlZejd	ed
d�dZdZd
Z d
Z!dZ"dZ#dZ$dZ%dZ&dZ'dd�Z(dd�Z)dd�Z*d8dd�Z+dd�Z,dd�Z-Gd d!�d!�Z.Gd"d#�d#�Z/Gd$d%�d%e/ej0�Z1d9d&d'�Z2Gd(d)�d)e/e�Z3d:d*d+�Z4d,d-�Z5d.d/�Z6d;d0d1�Z7d2d3�Z8d4d5�Z9e�r�d<d6d7�Z:ndZ:dS)=z�This module provides the components needed to build your own __import__
function.  Undocumented functions are obsolete.

In most cases it is preferred you consider using the importlib module's
functionality over this module.

�)	�	lock_held�acquire_lock�release_lock�get_frozen_object�is_frozen_package�init_frozen�
is_builtin�	is_frozen�_fix_co_filename)�create_dynamicN)�_ERR_MSG�_exec�_load�_builtin_from_name)�SourcelessFileLoader)�	machinery)�utilzhthe imp module is deprecated in favour of importlib; see the module's documentation for alternative uses�)�
stacklevel��������	cCs
t�|�S)z_**DEPRECATED**

    Create a new module.

    The module is not entered into sys.modules.

    )�types�
ModuleType��name�r!�/usr/lib64/python3.8/imp.py�
new_module0sr#cCstjS)z@**DEPRECATED**

    Return the magic number for .pyc files.
    )r�MAGIC_NUMBERr!r!r!r"�	get_magic;sr%cCstjjS)z$Return the magic tag for .pyc files.)�sys�implementation�	cache_tagr!r!r!r"�get_tagCsr)c
Cs6t���$t�d�t�||�W5QR�SQRXdS)a�**DEPRECATED**

    Given the path to a .py file, return the path to its .pyc file.

    The .py file does not need to exist; this simply returns the path to the
    .pyc file calculated as if the .py file were imported.

    If debug_override is not None, then it must be a boolean and is used in
    place of sys.flags.optimize.

    If sys.implementation.cache_tag is None then NotImplementedError is raised.

    �ignoreN)�warnings�catch_warnings�simplefilterr�cache_from_source)�path�debug_overrider!r!r"r.Hs

r.cCs
t�|�S)a~**DEPRECATED**

    Given the path to a .pyc. file, return the path to its .py file.

    The .pyc file does not need to exist; this simply returns the path to
    the .py file calculated to correspond to the .pyc file.  If path does
    not conform to PEP 3147 format, ValueError will be raised. If
    sys.implementation.cache_tag is None then NotImplementedError is raised.

    )r�source_from_cache�r/r!r!r"r1[sr1cCs<dd�tjD�}dd�tjD�}dd�tjD�}|||S)�**DEPRECATED**cSsg|]}|dtf�qS��rb)�C_EXTENSION��.0�sr!r!r"�
<listcomp>ksz get_suffixes.<locals>.<listcomp>cSsg|]}|dtf�qS)�r)�	PY_SOURCEr7r!r!r"r:lscSsg|]}|dtf�qSr4)�PY_COMPILEDr7r!r!r"r:ms)r�EXTENSION_SUFFIXES�SOURCE_SUFFIXES�BYTECODE_SUFFIXES)�
extensions�source�bytecoder!r!r"�get_suffixesisrDc@s eZdZdZdd�Zdd�ZdS)�NullImporterz-**DEPRECATED**

    Null import object.

    cCs2|dkrtddd��ntj�|�r.td|d��dS)N�zempty pathnamer2zexisting directory)�ImportError�osr/�isdir)�selfr/r!r!r"�__init__zszNullImporter.__init__cCsdS)zAlways returns None.Nr!)rJ�fullnamer!r!r"�find_module�szNullImporter.find_moduleN)�__name__�
__module__�__qualname__�__doc__rKrMr!r!r!r"rErsrEcs.eZdZdZd�fdd�	Z�fdd�Z�ZS)�_HackedGetDatazMCompatibility support for 'file' arguments of various load_*()
    functions.Ncst��||�||_dS)N)�superrK�file)rJrLr/rT��	__class__r!r"rK�sz_HackedGetData.__init__c
s||jrl||jkrl|jjs0|j}d|jkr0|��|jjrJt|jd�|_}|�|��W5QR�SQRXnt��|�SdS)z;Gross hack to contort loader to deal w/ load_*()'s bad API.�br5N)	rTr/�closed�mode�close�open�readrS�get_data)rJr/rTrUr!r"r]�s
z_HackedGetData.get_data)N)rNrOrPrQrKr]�
__classcell__r!r!rUr"rR�srRc@seZdZdZdS)�_LoadSourceCompatibilityz5Compatibility support for implementing load_source().N�rNrOrPrQr!r!r!r"r_�sr_cCs\t|||�}tj|||d�}|tjkr8t|tj|�}nt|�}t�||�|_	|j	|j
_|S)N��loader)r_r�spec_from_file_locationr&�modulesr
rr�SourceFileLoader�
__loader__�__spec__rb�r �pathnamerTrb�spec�moduler!r!r"�load_source�s

rlc@seZdZdZdS)�_LoadCompiledCompatibilityz7Compatibility support for implementing load_compiled().Nr`r!r!r!r"rm�srmcCsZt|||�}tj|||d�}|tjkr8t|tj|�}nt|�}t||�|_|j|j	_
|S)r3ra)rmrrcr&rdr
rrrfrgrbrhr!r!r"�
load_compiled�s

rncCs�tj�|�rftjdd�tjdd�}|D]*}tj�|d|�}tj�|�r,|}qfq,td�	|���t
j||gd�}|tj
kr�t|tj
|�St|�SdS)r3NrKz{!r} is not a package)�submodule_search_locations)rHr/rIrr?r@�join�exists�
ValueError�formatrrcr&rdr
r)r r/rA�	extensionZ	init_pathrjr!r!r"�load_package�s ��
ruc	
Cs$|\}}}|r0|�d�r d|kr0td�|���n�|dkrX|tthkrXd�|�}t|��n�|tkrlt|||�S|tkr�t|||�S|tkr�tdk	r�|dkr�t	|d��}t|||�W5QR�SQRXnt|||�SnN|t
kr�t||�S|tk�r�t
|�S|tk�rt|�Sd�||�}t||d��dS)	z�**DEPRECATED**

    Load a module, given information returned by find_module().

    The module name must include the full package name, if any.

    )r;�U�+zinvalid file open mode {!r}Nz.file object required for import (type code {})r5z*Don't know how to import {} (type code {})r)�
startswithrrrsr<r=rlrnr6�load_dynamicr[�
PKG_DIRECTORYru�	C_BUILTIN�init_builtin�	PY_FROZENrrG)	r rT�filenameZdetails�suffixrY�type_�msgZopened_filer!r!r"�load_module�s.


 


r�c	Cs�t|t�std�t|����n$t|td�tf�sBtd�t|����|dkr�t|�rbddddtffSt	|�rzddddt
ffStj}|D]�}t
j�||�}dtjdfD]>}d|}t
j�||�}t
j�|�r�d|ddtffSq�t�D]2\}}}||}	t
j�||	�}t
j�|�r��q q�q��q:q�tt�|�|d��d}
d	|k�rnt|d
��}t�|j�d}
W5QRXt|||
d�}|||||ffS)a,**DEPRECATED**

    Search for a module.

    If path is omitted or None, search for a built-in, frozen or special
    module and continue search in sys.path. The module name cannot
    contain '.'; to search for a submodule of a package, pass the
    submodule name and the package's __path__.

    z'name' must be a str, not {}Nz%'path' must be None or a list, not {}rFz.pyrrKrrWr5)�encoding)�
isinstance�str�	TypeErrorrs�type�list�RuntimeErrorrr{r	r}r&r/rHrprr@�isfilerzrDrGrr[�tokenize�detect_encoding�readline)r r/�entryZpackage_directoryrZpackage_file_nameZ	file_pathrYr��	file_namer�rTr!r!r"rM�sB
�
rMcCs
t�|�S)zw**DEPRECATED**

    Reload the module and return it.

    The module must have been successfully imported before.

    )�	importlib�reload)rkr!r!r"r�2sr�cCs&z
t|�WStk
r YdSXdS)zl**DEPRECATED**

    Load and return a built-in module by name, or None is such module doesn't
    exist
    N)rrGrr!r!r"r|=s
r|cCs0ddl}|j�||�}|jj|||d�}t|�S)z:**DEPRECATED**

        Load an extension module.
        rN)r rb�origin)�importlib.machineryr�ExtensionFileLoader�
ModuleSpecr)r r/rTr�rbrjr!r!r"ryJs�ry)N)N)N)N)N);rQ�_imprrrrrrrr	r
rrGZimportlib._bootstraprr
rrZimportlib._bootstrap_externalrr�rrrHr&r�rr+�warn�DeprecationWarningZSEARCH_ERRORr<r=r6ZPY_RESOURCErzr{r}ZPY_CODERESOURCEZIMP_HOOKr#r%r)r.r1rDrErRrer_rlrmrnrur�rMr�r|ryr!r!r!r"�<module>sb,
�
	

#
4__pycache__/cmd.cpython-38.opt-1.pyc000064400000030524151153537550013124 0ustar00U

e5d:�@s@dZddlZddlZdgZdZejejdZGdd�d�ZdS)a	A generic class to build line-oriented command interpreters.

Interpreters constructed with this class obey the following conventions:

1. End of file on input is processed as the command 'EOF'.
2. A command is parsed out of each line by collecting the prefix composed
   of characters in the identchars member.
3. A command `foo' is dispatched to a method 'do_foo()'; the do_ method
   is passed a single argument consisting of the remainder of the line.
4. Typing an empty line repeats the last command.  (Actually, it calls the
   method `emptyline', which may be overridden in a subclass.)
5. There is a predefined `help' method.  Given an argument `topic', it
   calls the command `help_topic'.  With no arguments, it lists all topics
   with defined help_ functions, broken into up to three topics; documented
   commands, miscellaneous help topics, and undocumented commands.
6. The command '?' is a synonym for `help'.  The command '!' is a synonym
   for `shell', if a do_shell method exists.
7. If completion is enabled, completing commands will be done automatically,
   and completing of commands args is done by calling complete_foo() with
   arguments text, line, begidx, endidx.  text is string we are matching
   against, all returned matches must begin with it.  line is the current
   input line (lstripped), begidx and endidx are the beginning and end
   indexes of the text being matched, which could be used to provide
   different completion depending upon which position the argument is in.

The `default' method may be overridden to intercept commands for which there
is no do_ method.

The `completedefault' method may be overridden to intercept completions for
commands that have no complete_ method.

The data member `self.ruler' sets the character used to draw separator lines
in the help messages.  If empty, no ruler line is drawn.  It defaults to "=".

If the value of `self.intro' is nonempty when the cmdloop method is called,
it is printed out on interpreter startup.  This value may be overridden
via an optional argument to the cmdloop() method.

The data members `self.doc_header', `self.misc_header', and
`self.undoc_header' set the headers used for the help function's
listings of documented functions, miscellaneous topics, and undocumented
functions respectively.
�N�Cmdz(Cmd) �_c@s�eZdZdZeZeZdZdZ	dZ
dZdZdZ
dZdZd	Zd0dd�Zd1d
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Z d+d,�Z!d2d.d/�Z"dS)3raA simple framework for writing line-oriented command interpreters.

    These are often useful for test harnesses, administrative tools, and
    prototypes that will later be wrapped in a more sophisticated interface.

    A Cmd instance or subclass instance is a line-oriented interpreter
    framework.  There is no good reason to instantiate Cmd itself; rather,
    it's useful as a superclass of an interpreter class you define yourself
    in order to inherit Cmd's methods and encapsulate action methods.

    �=�Nz(Documented commands (type help <topic>):zMiscellaneous help topics:zUndocumented commands:z*** No help on %s��tabcCs@|dk	r||_ntj|_|dk	r(||_ntj|_g|_||_dS)a�Instantiate a line-oriented interpreter framework.

        The optional argument 'completekey' is the readline name of a
        completion key; it defaults to the Tab key. If completekey is
        not None and the readline module is available, command completion
        is done automatically. The optional arguments stdin and stdout
        specify alternate input and output file objects; if not specified,
        sys.stdin and sys.stdout are used.

        N)�stdin�sys�stdout�cmdqueue�completekey)�selfrrr
�r�/usr/lib64/python3.8/cmd.py�__init__LszCmd.__init__cCs�|��|jr\|jr\z2ddl}|��|_|�|j�|�|jd�Wnt	k
rZYnXz�|dk	rl||_
|j
r�|j�t
|j
�d�d}|�s4|jr�|j�d�}nl|jr�zt|j�}Wntk
r�d}YnXn<|j�|j�|j��|j��}t|��sd}n
|�d�}|�|�}|�|�}|�||�}q�|��W5|j�r�|j�r�zddl}|�|j�Wnt	k
�r~YnXXdS)z�Repeatedly issue a prompt, accept input, parse an initial prefix
        off the received input, and dispatch to action methods, passing them
        the remainder of the line as argument.

        rNz
: complete�
�EOFz
)�preloop�use_rawinputr�readlineZ
get_completerZ
old_completerZ
set_completer�complete�parse_and_bind�ImportError�intror
�write�strr�pop�input�prompt�EOFError�flushr�len�rstrip�precmd�onecmd�postcmd�postloop)r
rr�stop�linerrr�cmdloopbsN






zCmd.cmdloopcCs|S)z�Hook method executed just before the command line is
        interpreted, but after the input prompt is generated and issued.

        r�r
r(rrrr#�sz
Cmd.precmdcCs|S)z?Hook method executed just after a command dispatch is finished.r)r
r'r(rrrr%�szCmd.postcmdcCsdS)z>Hook method executed once when the cmdloop() method is called.Nr�r
rrrr�szCmd.preloopcCsdS)zYHook method executed once when the cmdloop() method is about to
        return.

        Nrr+rrrr&�szCmd.postloopcCs�|��}|sdd|fS|ddkr4d|dd�}n2|ddkrft|d�r\d|dd�}n
dd|fSdt|�}}||kr�|||jkr�|d}qt|d|�||d���}}|||fS)	z�Parse the line into a command name and a string containing
        the arguments.  Returns a tuple containing (command, args, line).
        'command' and 'args' may be None if the line couldn't be parsed.
        Nr�?zhelp r�!Zdo_shellzshell )�strip�hasattrr!�
identchars)r
r(�i�n�cmd�argrrr�	parseline�s



z
Cmd.parselinecCs�|�|�\}}}|s|��S|dkr.|�|�S||_|dkrBd|_|dkrT|�|�Szt|d|�}Wntk
r�|�|�YSX||�SdS)ahInterpret the argument as though it had been typed in response
        to the prompt.

        This may be overridden, but should not normally need to be;
        see the precmd() and postcmd() methods for useful execution hooks.
        The return value is a flag indicating whether interpretation of
        commands by the interpreter should stop.

        Nrr�do_)r5�	emptyline�default�lastcmd�getattr�AttributeError)r
r(r3r4�funcrrrr$�s


z
Cmd.onecmdcCs|jr|�|j�SdS)z�Called when an empty line is entered in response to the prompt.

        If this method is not overridden, it repeats the last nonempty
        command entered.

        N)r9r$r+rrrr7�sz
Cmd.emptylinecCs|j�d|�dS)z�Called on an input line when the command prefix is not recognized.

        If this method is not overridden, it prints an error message and
        returns.

        z*** Unknown syntax: %s
N)r
rr*rrrr8�szCmd.defaultcGsgS)z�Method called to complete an input line when no command-specific
        complete_*() method is available.

        By default, it returns an empty list.

        r)r
�ignoredrrr�completedefault�szCmd.completedefaultcsd|��fdd�|��D�S)Nr6cs"g|]}|���r|dd��qS)�N��
startswith��.0�a�Zdotextrr�
<listcomp>�s
z%Cmd.completenames.<locals>.<listcomp>)�	get_names)r
�textr=rrEr�
completenames�szCmd.completenamesc
Cs�|dkr�ddl}|��}|��}t|�t|�}|��|}|��|}|dkr�|�|�\}	}
}|	dkrp|j}q�zt|d|	�}Wq�t	k
r�|j}Yq�Xn|j
}|||||�|_z|j|WStk
r�YdSXdS)z�Return the next possible completion for 'text'.

        If a command has not been entered, then complete against command list.
        Otherwise try to call complete_<command> to get list of completions.
        rNrZ	complete_)
rZget_line_buffer�lstripr!Z
get_begidxZ
get_endidxr5r>r:r;rIZcompletion_matches�
IndexError)
r
rH�staterZorigliner(�strippedZbegidxZendidxr3�argsZfooZcompfuncrrrr�s*zCmd.completecCs
t|j�S)N)�dir�	__class__r+rrrrGsz
Cmd.get_namescs4t|j���}t�fdd�|��D��}t||B�S)Nc3s,|]$}|�d�d�r|dd�VqdS)�help_r�Nr@rB�rNrr�	<genexpr> s�z$Cmd.complete_help.<locals>.<genexpr>)�setrIrG�list)r
rNZcommandsZtopicsrrSr�
complete_helpszCmd.complete_helpcCs�|r�zt|d|�}Wn|tk
r�z4t|d|�j}|rX|j�dt|��WYdSWntk
rnYnX|j�dt|j|f��YdSX|��n|��}g}g}i}|D]$}|dd�dkr�d||dd�<q�|��d}	|D]p}|dd�dkr�||	k�rq�|}	|dd�}
|
|k�r8|�	|
�||
=q�t||�j�rR|�	|
�q�|�	|
�q�|j�dt|j
��|�|j|d	d
�|�|j
t|���d	d
�|�|j|d	d
�dS)zEList available commands with "help" or detailed help with "help cmd".rQr6�%s
NrRrrr?��P)r:r;�__doc__r
rr�nohelprG�sort�append�
doc_leader�print_topics�
doc_header�misc_headerrV�keys�undoc_header)r
r4r<�doc�namesZcmds_docZ
cmds_undoc�help�nameZprevnamer3rrr�do_help$sN



zCmd.do_helpcCs\|rX|j�dt|��|jr<|j�dt|jt|���|�||d�|j�d�dS)NrXrr)r
rr�rulerr!�	columnize)r
�headerZcmdsZcmdlenZmaxcolrrrr`RszCmd.print_topicsrZcs��s|j�d�dS�fdd�tt���D�}|rJtdd�tt|����t��}|dkrv|j�dt�d	��dStdt���D]�}||d|}g}d
}t|�D]h}	d	}
t|�D]2}|||	}||kr�q�|}
t|
t|
��}
q�|�	|
�||
d7}||kr��qq�||kr��q4q�t��}d}d	g}t|�D]�}g}t|�D]4}	|||	}||k�rld}
n�|}
|�	|
��qL|�r�|d
�s�|d
=�q�tt|��D]}	||	�
||	�||	<�q�|j�dtd�|����q<dS)z�Display a list of strings as a compact set of columns.

        Each column is only as wide as necessary.
        Columns are separated by two spaces (one was not legible enough).
        z<empty>
Ncsg|]}t�|t�s|�qSr)�
isinstancer)rCr1�rVrrrFds�z!Cmd.columnize.<locals>.<listcomp>z list[i] not a string for i in %sz, rrXr����r���z  )r
r�ranger!�	TypeError�join�mapr�maxr^�ljust)r
rVZdisplaywidthZ
nonstrings�sizeZnrowsZncolsZ	colwidthsZtotwidth�colZcolwidth�rowr1�xZtextsrrnrrkZs\�


z
Cmd.columnize)rNN)N)rZ)#�__name__�
__module__�__qualname__r[�PROMPTr�
IDENTCHARSr0rjr9rr_rarbrdr\rrr)r#r%rr&r5r$r7r8r>rIrrGrWrir`rkrrrrr4s<

4
		.)	r[�stringr	�__all__rZ
ascii_lettersZdigitsr�rrrrr�<module>s
,__pycache__/sre_compile.cpython-38.opt-1.pyc000064400000035106151153537550014663 0ustar00U

e5dGh�@sdZddlZddlZddlTeehZeee	hZ
eehZ
eehZeeehBZdZdd�eD�Zejfdd�Zd	d
�Zdd�Zd,d
d�ZejdZde>dZdZeefdd�Z dd�Z!dd�Z"dd�Z#dd�Z$dd�Z%dd�Z&d d!�Z'd"d#�Z(d$d%�Z)d&d'�Z*d(d)�Z+d-d*d+�Z,dS).zInternal support module for sre�N)�*))�ii1)�si)�i�)iEi�i�)i�i�)i�i�)i�i�)i�i�)i�i�)i�i�)i�i�)i�i�)i�i�)i�i�)iai�)i�i�cs.i|]&}|D]��t�fdd�|D���qqS)c3s|]}�|kr|VqdS�N�)�.0�j��ir�#/usr/lib64/python3.8/sre_compile.py�	<genexpr>>sz<dictcomp>.<genexpr>)�tuple)r�trr
r�
<dictcomp>>s
�rcCs ||@r||M}||B|@Srr)�flags�	add_flags�	del_flags�
TYPE_FLAGSrrr�_combine_flagsAs
rcCs�|j}t}t}t}t}t}d}	d}
d}|t@r\|t@s\|t@rPt	j
}	t	j}
t}nt	j
}	t	j}
|D�]|\}}
||k�rr|t@s�||�||
�n�|t@r�|t|�||
�n�|	|
�s�||�||
�n�|
|
�}|s�|t|�||�n�||k�r|t|�||�nh|t�||�}|d�|tk�r2|t�|f||D]}|t�||��q@|t�||�|||<q`|tk�rt|
|	|
|�\}}|t@�r�|t@�r�|t�n(|�s�|t�n|�s�|t�n|t�||�}|d�t|||�||�|||<q`|tk�r*|t@�r |t�n|t�q`||k�r6|t@�rLt d|f��t!|
d��r�|t"k�rn|t#�n|t$�||�}|d�||
d�||
d�t%||
d|�|t&�||�|||<nl|t'�||�}|d�||
d�||
d�t%||
d|�||�|||<|t"k�r,|t(�n|t)�q`|t*k�r�|
\}}}}|�rj|t+�||dd�t%||t,|||��|�r�|t+�||ddd�q`||k�r�||�q`||k�rD||�||�}|d�|
ddk�r�|d�n*|
d�-�\}}||k�rt d��||�t%||
d|�|t&�||�|||<q`|t.k�r�||�||�}|d�t%||
|�|t&�||�|||<q`|t/k�r�||�|t0@�r�t1�2|
|
�}
|t@�r�t3�2|
|
�}
n|t@�r�t4�2|
|
�}
||
�q`|t5k�r�||�g}|j}|
dD]N}
||�}|d�t%||
|�|t6�|||��|d�||�|||<�q|t�|D]}||�|||<�qlq`|t7k�r�||�|t@�r�t8|
}
n|t@�r�t9|
}
||
�q`|t:k�r |t@�s�||�n,|t@�r�|t;�n|�s
|t<�n|t=�||
d�q`|t>k�r�||�||
dd�||�}|d�t%||
d|�|
d�r�|t6�||�}|d�||�|d||<t%||
d|�||�|||<n||�|d||<q`t d|f��q`dS)Nrz*internal: unsupported template operator %r��z(look-behind requires fixed-width patternz%internal: unsupported operand type %r)?�append�len�_LITERAL_CODES�_REPEATING_CODES�_SUCCESS_CODES�
_ASSERT_CODES�SRE_FLAG_IGNORECASE�SRE_FLAG_LOCALE�SRE_FLAG_UNICODE�_sre�unicode_iscased�unicode_tolower�_ignorecase_fixes�
ascii_iscased�
ascii_tolower�OP_LOCALE_IGNORE�	OP_IGNORE�OP_UNICODE_IGNORE�
IN_UNI_IGNORE�NOT_LITERAL�NEGATE�LITERAL�FAILURE�IN�_optimize_charset�
IN_LOC_IGNORE�	IN_IGNORE�_compile_charset�ANY�SRE_FLAG_DOTALL�ANY_ALL�SRE_FLAG_TEMPLATE�error�_simple�
MAX_REPEAT�
REPEAT_ONE�MIN_REPEAT_ONE�_compile�SUCCESS�REPEAT�	MAX_UNTIL�	MIN_UNTIL�
SUBPATTERN�MARKr�getwidth�CALL�AT�SRE_FLAG_MULTILINE�AT_MULTILINE�get�	AT_LOCALE�
AT_UNICODE�BRANCH�JUMP�CATEGORY�	CH_LOCALE�
CH_UNICODE�GROUPREF�GROUPREF_LOC_IGNORE�GROUPREF_IGNORE�GROUPREF_UNI_IGNORE�GROUPREF_EXISTS)�code�patternr�emit�_len�
LITERAL_CODES�REPEATING_CODES�
SUCCESS_CODES�ASSERT_CODES�iscased�tolower�fixes�op�av�lo�skip�k�charset�hascased�grouprr�p�hi�tail�
tailappend�skipyes�skipnorrrr=GsV
















































r=cCs�|j}|D]�\}}||�|tkr$q
|tkr6||�q
|tksF|tkr`||d�||d�q
|tkrt|�|�q
|tkr�|�|�q
|tkr�|t	@r�|t
|�q�|t@r�|t|�q�||�q
t
d|f��q
|t�dS)Nrrz%internal: unsupported set operator %r)rr,r-�RANGE�RANGE_UNI_IGNORE�CHARSET�extend�
BIGCHARSETrNrrOr rPr8r.)rfrrVrXrarbrrrr3�s,

r3c	Cs�g}g}td�}d}|D�]�\}}	�z,|tkr�|rv||	�}
d||
<|rd|
|krd||
D]}d||<qV|s~||	�r~d}nd||	<n�|tk�r&t|	d|	dd�}|�r|r�t||�D]*}
d||
<|
|kr�||
D]}d||<q�q�nt||�D]}
d||
<q�|�s$tt||��}n|D]}
d||
<�qn(|tk�r@|�||	f�n|�||	f�WnZtk
�r�t	|�dk�r�|dd7}Yq"|�r�d}|tk�r�t
}|�||	f�YnXqq"qg}d}|�d|�}|dk�rԐq(t	|�dk�r�d}�q(|�d|�}|dk�r|�|t	|�f��q(|�||f��q�|dk	�r�|D]>\}}||dk�r\|�t|f�n|�t||dff��q6||7}|�s�t	|�t	|�k�r�||fS||fSt	|�dk�r�t|�}|�t
|f�||7}||fSt|�}i}td�}d}t�}tdd	d�D]V}
||
|
d�}||k�r4||||
d<n$|||
d<||<|d7}||7}�qt|�}|gt|�|dd�<|�t|f�||7}||fS)
N�FrTr�i�ri)�	bytearrayr-ro�range�map�anyr,r�
IndexErrorrrp�find�
_mk_bitmaprq�bytes�_bytes_to_codesrs)rfr^�fixupr`�outrk�charmaprgrarbrcre�rr�runs�qri�data�comps�mapping�block�chunkrrrr0s�









r0�rs0111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111cs8|�t�ddd�����fdd�tt��d��D�S)N���cs"g|]}��|�|�d��qS)rr)rr��	_CODEBITS�_int�srr�
<listcomp>�s�z_mk_bitmap.<locals>.<listcomp>r)�	translate�_BITS_TRANSrwr)�bitsr�r�rr�rr|�s�r|cCst|��d�}|��S)N�I)�
memoryview�cast�tolist)�b�arrrr~�sr~cCsDt|�dkrdS|d\}}|tkr<|ddko:t|d�S|tkS)NrFrr�)rrBr9�_UNIT_CODES)rirarbrrrr9�sr9cCsndgt|�}tdt|��D]L}||d}||||kr\|dkrNd||<q||d}q,|d||<q|S)aj
    Generate an overlap table for the following prefix.
    An overlap table is a table of the same size as the prefix which
    informs about the potential self-overlap for each index in the prefix:
    - if overlap[i] == 0, prefix[i:] can't overlap prefix[0:...]
    - if overlap[i] == k with 0 < k <= i, prefix[i-k+1:i+1] overlaps with
      prefix[0:k]
    rr)rrw)�prefix�tabler�idxrrr�_generate_overlap_table�s	r�cCs$|t@sdS|t@rtjStjSdSr)rr r!r"r%)rrrr�_get_iscased�s
r�cCs�g}|j}d}t|�}|jD]�\}}|tkrF|r<||�r<q�||�q|tkr�|\}}	}
}t||	|
�}|t@rz|t@rzq�t||�\}
}}|dkr�|dk	r�t	|�}n|dk	r�t	|�|}|�
|
�|s�q�qq�q||dfS||dfS)NTF)rr�r�r-rBrrr�_get_literal_prefixrrr)rWrr��prefixappend�prefix_skipr^rarbrhrrri�flags1�prefix1�prefix_skip1�got_allrrrr��s4



r�cCsd|js
dS|jd\}}|tk	r"qP|\}}}}t|||�}|t@r|t@rdSqt|�}|tkrz|rp||�rpdS||fgS|tkr�g}|j}	|dD]B}
|
s�dS|
d\}}|tkr�|r�||�s�|	||f�q�dSq�|S|t	k�r`|}|�r\|D]f\}}|tk�r||��rZdSq�|t
kr�|ddk�r4dStt|t
|d|dd���r�dSq�|SdS)Nrri��)r�rBrrrr�r-rLrr/roryrxrw)rWrrarbrhrrr^rf�
charsetappendrirrr�_get_charset_prefix�sN



 r�c
Csr|��\}}|tkrt}|dkr8|�tdd||g�dSg}d}g}|t@rT|t@srt||�\}}}|srt||�}|j}	|	t�t	|�}
|	d�d}|r�t
}|dkr�|r�|tB}n|r�|tB}|	|�|tkr�|	|�n|	t�|dt�}|	t
|t��|�r@|	t	|��|dk�rt	|�}|	|�|�|�|�t|��n|�r^t|�\}}t|||�t	|�|
||
<dS)Nr�)rD�MAXCODErr�INFOrrr�r�rr�SRE_INFO_PREFIX�SRE_INFO_LITERAL�SRE_INFO_CHARSET�minr�r0r3)
rVrWrrcrjr�r�rfr�rXrd�maskrgrrr�
_compile_infosR




r�cCst|ttf�Sr)�
isinstance�strr})�objrrr�isstringSsr�cCs8|jj|B}g}t|||�t||j|�|�t�|Sr)�staterr�r=r�rr>)rirrVrrr�_codeVs
r�cCsdd�dd�|D��S)N�[%s]�, css$|]}dtjdd|fVqdS)z%#0*xrN)r!�CODESIZE�r�xrrrr
fsz_hex_code.<locals>.<genexpr>)�join�rVrrr�	_hex_codeesr�csNddl�t��d�ttt��d���������fdd���dt���dS)Nrrc	s�dd�����fdd�
}��fdd�}�d7��}||k�r�|��|}|d7}t|}|tttttttfkrx||�q2|tt	t
ttt
ttfkr��|}|d7}||d|t|�f�q2|tkr�|}|d7}tt|�}|||dd��q2|tk�r*�|}|d7}tt|�}|||d	d��q2|ttttfk�rr�|}|||||d��|d||�||7}q2|ttfk�r��||d
�\}}	|d
7}||d||	t|�t|	�f�q2|tk�r�||t�||dt���|dt7}q2|tk�r��|}|d7}t d
�!�fdd��||dt"j#�D���}
||||
�|dt"j#7}�d7�t$|�D].}|t�||dt���|dt7}�qd�d8�q2|t%t&t't(t)fk�rΈ|}|d7}|||�q2|t*k�r��|}|||||d�|d7}q2|t+k�r|�|}|||||d�|�rr�|d||�||7}|��|}|�rf|d|||d�n|t��q |d7}q2|t,t-t.fk�r�||d�\}}}
|
t/k�r�d}
|||||
||d��|d||�||7}q2|t0k�r�||d
�\}}||||||d�|d
7}q2|t1t2fk�rp�||d
�\}}||||||d��|d
||�||7}q2|t3k�r��||d�\}}}}
|
t/k�r�d}
|||t4|�||
||d�|d�|t5@�r^�|d|d�\}}|d|�|d����|�}|ddd�!dd�|D��dd�!t6t|����|7�|d���|���|7�|t7@�r��d7�|d���||��d8�||7}q2t8|��q2�d8�dS)N)�tocsX|dk	r"��|�|d|ff7}td����kr6dndfd�dd�t|�dS)Nz(to %d)z%*d%s �:�.z  r��end)�add�print)r��args)�labels�level�offset_width�startrr�print_ps

�z!dis.<locals>.dis_.<locals>.print_cs"td�d�d�t|�dS)N� rr�)r�)r�)r�r�rr�print_2xsz"dis.<locals>.dis_.<locals>.print_2rz
%#02x (%r)��	rz%#02x %#02x (%r-%r)rt�c3s|]}|�tj�j�VqdSr)�to_bytesr!r��	byteorderr�)�sysrrr
�s�z$dis.<locals>.dis_.<locals>.<genexpr>�branch�	MAXREPEATr��z
  prefix_skipz  prefixr�r�css|]}d|VqdS)z%#02xNrr�rrrr
�sz(%r)�z	  overlap�in)9�OPCODESr>r.r4r6r@rAr,r-r+�LITERAL_IGNORE�NOT_LITERAL_IGNORE�LITERAL_UNI_IGNORE�NOT_LITERAL_UNI_IGNORE�LITERAL_LOC_IGNORE�NOT_LITERAL_LOC_IGNORE�chrrFr��ATCODESrN�CHCODESr/r2r*r1rorprqr�r�rs�listr�r!r�rwrCrQrSrTrRrMrLr?r;r<r�rU�ASSERT�
ASSERT_NOTr��binr�rxr��
ValueError)r�r�r�r�rra�argrdrcrjr�r	r��maxr�
prefix_lenr�r��rV�dis_r�r�r�r�)r�rr�os�

�
�

 

�


�












�


zdis.<locals>.dis_)r��setrr�r�rr�r�dishsr�c	Cs�t|�r|}t�||�}nd}t||�}|t@r>t�t|�|jj}dg|jj	}|�
�D]\}}|||<q\t�|||jj
B||jj	d|t|��S)Nr)r��	sre_parse�parser��SRE_FLAG_DEBUGr�r�r��	groupdict�groups�itemsr!�compilerr)rirrWrV�
groupindex�
indexgrouprerrrrr��s(



�r�)NNN)r)-�__doc__r!r��
sre_constantsr-r+rr?�
MIN_REPEATr:rr>r.rr�r�rr4r/r��
_equivalencesr$rrr=r3r0r�r�r�r��intr|r~r9r�r�r�r�r�r�r�r�r�r�rrrr�<module>sH
$��
3

	,;__pycache__/pdb.cpython-38.pyc000064400000134174151153537550012175 0ustar00U

e5d��"@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZGdd�de�Zddddd	d
ddd
g	Zdd�Zdd�Zdd�ZGdd�de�ZdZGdd�dejej�Zedk	�rnd
ddddddddd d!d"d#d$d%d&d'd(dd)d*d+d,d-d.d/d0d1d2d3d4d5d6d7g"ZeD]"Zeeed8e�j��d97Z�q:eej j7Z[[dJd:d�Z!dKd;d�Z"d<d	�Z#d=d
�Z$dd>�d?d�Z%dLd@d�Z&dAd�Z'dBZ(dCdD�Z)dEd
�Z*dFZ+dGdH�Z,e-dIk�r�ddl.Z.e.�,�dS)Ma�	
The Python Debugger Pdb
=======================

To use the debugger in its simplest form:

        >>> import pdb
        >>> pdb.run('<a statement>')

The debugger's prompt is '(Pdb) '.  This will stop in the first
function call in <a statement>.

Alternatively, if a statement terminated with an unhandled exception,
you can use pdb's post-mortem facility to inspect the contents of the
traceback:

        >>> <a statement>
        <exception traceback>
        >>> import pdb
        >>> pdb.pm()

The commands recognized by the debugger are listed in the next
section.  Most can be abbreviated as indicated; e.g., h(elp) means
that 'help' can be typed as 'h' or 'help' (but not as 'he' or 'hel',
nor as 'H' or 'Help' or 'HELP').  Optional arguments are enclosed in
square brackets.  Alternatives in the command syntax are separated
by a vertical bar (|).

A blank line repeats the previous command literally, except for
'list', where it lists the next 11 lines.

Commands that the debugger doesn't recognize are assumed to be Python
statements and are executed in the context of the program being
debugged.  Python statements can also be prefixed with an exclamation
point ('!').  This is a powerful way to inspect the program being
debugged; it is even possible to change variables or call functions.
When an exception occurs in such a statement, the exception name is
printed but the debugger's state is not changed.

The debugger supports aliases, which can save typing.  And aliases can
have parameters (see the alias help entry) which allows one a certain
level of adaptability to the context under examination.

Multiple commands may be entered on a single line, separated by the
pair ';;'.  No intelligence is applied to separating the commands; the
input is split at the first ';;', even if it is in the middle of a
quoted string.

If a file ".pdbrc" exists in your home directory or in the current
directory, it is read in and executed as if it had been typed at the
debugger prompt.  This is particularly useful for aliases.  If both
files exist, the one in the home directory is read first and aliases
defined there can be overridden by the local file.  This behavior can be
disabled by passing the "readrc=False" argument to the Pdb constructor.

Aside from aliases, the debugger is not directly programmable; but it
is implemented as a class from which you can derive your own debugger
class, which you can make as fancy as you like.


Debugger commands
=================

�Nc@seZdZdZdS)�RestartzBCauses a debugger to be restarted for the debugged python program.N)�__name__�
__module__�__qualname__�__doc__�rr�/usr/lib64/python3.8/pdb.pyrWsr�run�pm�Pdb�runeval�runctx�runcall�	set_trace�post_mortem�helpc
Cs�t�dt�|��}zt�|�}Wntk
r8YdSX|�@t|dd�D],\}}|�|�rL|||fW5QR�SqLW5QRXdS)Nzdef\s+%s\s*[(]�)�start)�re�compile�escape�tokenize�open�OSError�	enumerate�match)�funcname�filenameZcre�fp�lineno�linerrr�
find_function^s
&r!cCsXt�|�\}}t�|�r,|j|jkr,|dfSt�|�r>|dfSt�||d��|dfS)Nr)�inspectZ
findsourceZisframe�	f_globals�f_localsZismoduleZgetblock)�obj�linesrrrr�getsourcelinesks
r'cCs8tt�|��}|��|D]\}}||kr|SqdS�Nr)�list�disZfindlinestarts�reverse)�codeZlastiZ
linestarts�irrrr�lasti2linenots
r.c@seZdZdZdd�ZdS)�_rstrz#String that doesn't quote its repr.cCs|S�Nr��selfrrr�__repr__sz_rstr.__repr__N)rrrrr3rrrrr/}sr/z
-> c@seZdZdZd�dd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�ZeZd�d8d9�Zd:d;�ZeZ eZ!eZ"d<d=�Z#eZ$d>d?�Z%d@dA�Z&dBdC�Z'eZ(dDdE�Z)eZ*dFdG�Z+eZ,dHdI�Z-eZ.dJdK�Z/e/Z0eZ1eZ2dLdM�Z3e3Z4e3Z5dNdO�Z6dPdQ�Z7e7Z8dRdS�Z9e9Z:dTdU�Z;e;Z<dVdW�Z=e=Z>dXdY�Z?e?Z@dZd[�ZAeAZBd\d]�ZCeCZDd^d_�ZEeEZFZGd`da�ZHeHZIdbdc�ZJeZKddde�ZLeLZMeLZNdfdg�ZOdhdi�ZPePZQdjdk�ZReRZSdldm�ZTd�dndo�ZUdpdq�ZVdrds�ZWeZXeZYeZZdtdu�Z[e[Z\dvdw�Z]e]Z^dxdy�Z_eZ`d�d{d|�Zad}d~�ZbeZcdd��ZdeZed�d��Zfd�d��Zgd�d��Zhd�d��Zid�d��Zjd�d��Zkd�d�d�d�d�d�gZld�d��Zmenfd�d��Zod�d��ZpepZqd�d��Zrd�d��Zsd�d��Ztd�d��Zud�d��ZvdS)�rN�tabFTc		Cs>tjj||d�tj�||||�t�d�|r6d|_d|_i|_	i|_
d|_d|_i|_
zddl}|�d�Wntk
r�YnXd|_||_g|_|�rz,ttj�d���}|j�|�W5QRXWntk
r�YnXz$td	��}|j�|�W5QRXWntk
�rYnXi|_i|_i|_d|_d|_dS)
N)�skipzpdb.Pdbrz(Pdb) �Fz 	
`@#$%^&*()=+[{]}\|;:'",<>?z~/.pdbrcz.pdbrc)�bdb�Bdb�__init__�cmd�Cmd�sys�auditZuse_rawinput�prompt�aliases�
displaying�
mainpyfile�_wait_for_mainpyfile�	tb_lineno�readlineZset_completer_delims�ImportError�allow_kbdint�nosigint�rcLinesr�os�path�
expanduser�extendr�commands�commands_doprompt�commands_silent�commands_defining�
commands_bnum)	r2�completekey�stdin�stdoutr5rGZreadrcrDZrcFilerrrr9�sF

zPdb.__init__cCs*|jr
t�|�d�|��|�|�dS)Nz-
Program interrupted. (Use 'cont' to resume).)rF�KeyboardInterrupt�message�set_stepr)r2Zsignum�framerrr�sigint_handler�s

zPdb.sigint_handlercCstj�|�|��dSr0)r7r8�reset�forgetr1rrrrZ�sz	Pdb.resetcCs&d|_g|_d|_d|_|j��dSr()r�stack�curindex�curframerC�clearr1rrrr[�s
z
Pdb.forgetcCsh|��|�||�\|_|_|rDt|jj|j�}||j|j<|j	}q|j|jd|_
|j
j|_|�
�Sr()r[Z	get_stackr\r]r.�tb_frame�f_code�tb_lastirC�tb_nextr^r$�curframe_locals�execRcLines)r2�f�tbrrrr�setup�s
z	Pdb.setupcCsd|js
dS|j}|��g|_|r`|����}|r|ddkr|�|�r|jt|�7_dSqdS)Nr�#T)rHr+�pop�strip�onecmd�reversed)r2rHr rrrre�s
zPdb.execRcLinescCs.|jr
dS|�|�r*|�d�|�|d�dS)znThis method is called when there is the remote possibility
        that we ever need to stop in this function.Nz--Call--)rBZ	stop_hererV�interaction)r2rXZ
argument_listrrr�	user_call�s


z
Pdb.user_callcCsH|jr.|j|�|jj�ks$|jdkr(dSd|_|�|�rD|�|d�dS)z;This function is called when we stop or break at this line.rNF)rBrA�canonicra�co_filename�f_lineno�bp_commandsrn)r2rXrrr�	user_line�s�
z
Pdb.user_linecCs�t|dd�r�|j|jkr�|j}d|_|j}|�|d�|j|D]}|�|�q@||_|j|sr|�|j|j	�|j
|r�|��|��dSdS)z�Call every command that was set for the current active breakpoint
        (if there is one).

        Returns True if the normal interaction function must be called,
        False otherwise.�	currentbpFrNr)
�getattrrurM�lastcmdrhrlrO�print_stack_entryr\r]rN�_cmdloopr[)r2rXruZlastcmd_backr rrrrss"
�

zPdb.bp_commandscCs.|jr
dS||jd<|�d�|�|d�dS)z7This function is called when a return trap is set here.N�
__return__z
--Return--)rBr$rVrn)r2rXZreturn_valuerrr�user_return s


zPdb.user_returncCsh|jr
dS|\}}}||f|jd<|s2|tkr2dnd}|�d|t�||�d��f�|�||�dS)zoThis function is called if an exception occurs,
        but only if we are to stop at or just below this level.NZ
__exception__z	Internal r6z%s%s���)rBr$�
StopIterationrV�	traceback�format_exception_onlyrkrn)r2rX�exc_info�exc_type�	exc_value�
exc_traceback�prefixrrr�user_exception(s
���zPdb.user_exceptioncCsBzd|_|��d|_Wq>Wqtk
r:|�d�YqXqdS)NTFz--KeyboardInterrupt--)rF�cmdlooprUrVr1rrrry<szPdb._cmdloopcCs^|j�|j�}|rZ|��D]>\}}|�|�}||k	r||kr|||<|�d|||f�qdS)Nzdisplay %s: %r  [old: %r])r@�getr^�items�_getval_exceptrV)r2r@�exprZoldvalueZnewvaluerrr�preloopIs
�zPdb.preloopcCsttjr6zt�tjtj�Wntk
r.YnXdt_|�||�rN|��dS|�|j|j	�|�
�|��dSr0)r�_previous_sigint_handler�signal�SIGINT�
ValueErrorrhr[rxr\r]ry)r2rXr~rrrrnVszPdb.interactioncCs|dk	r|�t|��dS)z{Custom displayhook for the exec in default(), which prevents
        assignment of the _ variable in the builtins.
        N)rV�repr)r2r%rrr�displayhookhszPdb.displayhookc	Cs�|dd�dkr|dd�}|j}|jj}zdt|ddd�}tj}tj}tj}z(|jt_|jt_|jt_t|||�W5|t_|t_|t_XWn4t�	�dd�}|�
tj|�d�
��YnXdS)Nr�!�
z<stdin>Zsingle�r|)rdr^r#rr<rTrSr��execr��errorr~rrk)	r2r �locals�globalsr,Zsave_stdoutZ
save_stdinZsave_displayhookr�rrr�defaultps(zPdb.defaultcCs�|��s|S|��}|d|jkr�|j|d}d}|dd�D] }|�dt|�|�}|d7}q@|�dd�|dd���}|��}q|ddkr�|�d�}|dkr�||d	d���}|j�	|�|d|��
�}|S)
z*Handle alias expansion and ';;' separator.rrN�%z%*� �aliasz;;r�)rk�splitr?�replace�str�join�find�lstrip�cmdqueue�append�rstrip)r2r �argsZiiZtmpArgZmarker�nextrrr�precmd�s(�


z
Pdb.precmdcCs"|jstj�||�S|�|�SdS)z�Interpret the argument as though it had been typed in response
        to the prompt.

        Checks whether this line is typed at the normal prompt or in
        a breakpoint command list definition.
        N)rPr:r;rl�handle_command_def)r2r rrrrl�sz
Pdb.onecmdcCs�|�|�\}}}|sdS|dkr0d|j|j<dS|dkrBg|_dS|j|j}|rf|�|d|�n
|�|�zt|d|�}Wntk
r�|j}YnX|j	|j
kr�d|j|j<g|_dSdS)	z8Handles one command line during command list definition.NZsilentT�endrr��do_F)Z	parselinerOrQr�rMr�rv�AttributeErrorr�r�commands_resumingrN)r2r r:�argZcmdlist�funcrrrr��s,
zPdb.handle_command_defcCst||jd�dS)N��file��printrT�r2�msgrrrrV�szPdb.messagecCstd||jd�dS)Nz***r�r�r�rrrr��sz	Pdb.errorcCs�|���d�rgSz|�||||�}Wntk
r>g}YnXt�t�|�d�}|D]H}tj�|�rx|�	|d�qXtj�
|�rX|���d�rX|�	|d�qX|S)N)�:�,�*�/)�.pyz.pywr�)rk�endswith�_complete_expression�	Exception�globrrIrJ�isdirr��isfile�lower)r2�textr �begidx�endidxZret�globs�fnrrr�_complete_location�s
zPdb._complete_locationcs�fdd�ttjj�D�S)Ncs.g|]&\}}|dk	rt|����rt|��qSr0)r��
startswith)�.0r-�bp�r�rr�
<listcomp>�s�z*Pdb._complete_bpnumber.<locals>.<listcomp>)rr7�
Breakpoint�
bpbynumber�r2r�r r�r�rr�r�_complete_bpnumber�szPdb._complete_bpnumberc	s�|js
gS|jj|j�}d�kr���d��z,|�d}�dd�D]}t||�}qDWnttfk
rrgYSXd��dd��d���fdd�t|�D�S�fdd�|�	�D�SdS)N�.rrr|cs"g|]}|��d�r�|�qS)r|�r��r��n)�dottedr�rrr�sz,Pdb._complete_expression.<locals>.<listcomp>csg|]}|���r|�qSrr�r�r�rrr�s
)
r^r#rdr�rv�KeyErrorr�r��dir�keys)r2r�r r�r��nsr%�partr)r�r�r�rr��s

zPdb._complete_expressioncCs,|sttjj�d}n&zt|�}Wn|�d�YdSX||_||jkrj|j||j||j	|f}nd}g|j|<d|j|<d|j	|<|j
}d|_
d|_zzz|��Wnht
k
�r|r�|d|j|<|d|j|<|d|j	|<n|j|=|j|=|j	|=|�d	�YnXW5d|_||_
XdS)
a4commands [bpnumber]
        (com) ...
        (com) end
        (Pdb)

        Specify a list of commands for breakpoint number bpnumber.
        The commands themselves are entered on the following lines.
        Type a line containing just 'end' to terminate the commands.
        The commands are executed when the breakpoint is hit.

        To remove all commands from a breakpoint, type commands and
        follow it immediately with end; that is, give no commands.

        With no bpnumber argument, commands refers to the last
        breakpoint set.

        You can use breakpoint commands to start your program up
        again.  Simply use the continue command, or step, or any other
        command that resumes execution.

        Specifying any command resuming execution (currently continue,
        step, next, return, jump, quit and their abbreviations)
        terminates the command list (as if that command was
        immediately followed by end).  This is because any time you
        resume execution (even with a simple next or step), you may
        encounter another breakpoint -- which could have its own
        command list, leading to ambiguities about which list to
        execute.

        If you use the 'silent' command in the command list, the usual
        message about stopping at a breakpoint is not printed.  This
        may be desirable for breakpoints that are to print a specific
        message and then continue.  If none of the other commands
        print anything, you will see no sign that the breakpoint was
        reached.
        rz.Usage: commands [bnum]
        ...
        endNTFz(com) rr�z1command definition aborted, old commands restored)�lenr7r�r��intr�rQrMrNrOr>rPr�rU)r2r�ZbnumZold_command_defsZprompt_backrrr�do_commands	sB%

�


zPdb.do_commandsrc
CsB|s8|jr4|�d�tjjD]}|r|�|���qdSd}d}d}|�d�}|dkrz||dd���}|d|���}|�	d�}d}	|dk�r|d|���}|�
|�}
|
s�|�d|�dS|
}||dd���}zt|�}Wn&t
k
�r|�d|�YdSXn�zt|�}Wn�t
k
�r�zt||jj|j�}Wn|}YnXz.t|d	��rj|j}|j}|j}	|j}|j}WnD|�|�\}
}}|
�s�|�d
|�YYdS|
}	t|�}YnXYnX|�s�|��}|�||�}|�r>|�|||||	�}|�r|�|�n*|�||�d}|�d|j|j|jf�dS)
a�b(reak) [ ([filename:]lineno | function) [, condition] ]
        Without argument, list all breaks.

        With a line number argument, set a break at this line in the
        current file.  With a function name, set a break at the first
        executable line of that function.  If a second argument is
        present, it is a string specifying an expression which must
        evaluate to true before the breakpoint is honored.

        The line number may be prefixed with a filename and a colon,
        to specify a breakpoint in another file (probably one that
        hasn't been loaded yet).  The file is searched for on
        sys.path; the .py suffix may be omitted.
        z!Num Type         Disp Enb   WhereNr�rrr�z%r not found from sys.pathzBad lineno: %s�__func__zJThe specified object %r is not a function or was not found along sys.path.r|zBreakpoint %d at %s:%d) �breaksrVr7r�r�Zbpformatr�r�r��rfind�lookupmoduler�r�r��evalr^r#rd�hasattrr��__code__�co_name�co_firstlinenorq�lineinfo�defaultFile�	checklineZ	set_break�
get_breaks�numberr�r )r2r�Z	temporaryr�rr�condZcommaZcolonrrfr�r,�okZlnr �errrrr�do_breakXs�





�

��zPdb.do_breakcCs"|jjj}|dkr|jr|j}|S)zProduce a reasonable default.z<string>)r^rarqrA)r2rrrrr��s
zPdb.defaultFilecCs|�|d�dS)z�tbreak [ ([filename:]lineno | function) [, condition] ]
        Same arguments as break, but sets a temporary breakpoint: it
        is automatically deleted when first hit.
        rN)r��r2r�rrr�	do_tbreak�sz
Pdb.do_tbreakc
Cs�d}|�d�}t|�dkr(|d��}nt|�dkrB|d��}n|S|dkrR|S|�d�}|ddkr~|d=t|�dkr~|S|��}t|�dkr�|d}n|�|d�}|r�|}|d}t||�}	|	p�|S)	N)NNN�'rr�r6r�r2)r�r�rkr�r�r!)
r2Z
identifierZfailedZidstring�id�partsZfname�itemrfZanswerrrrr��s.



zPdb.lineinfocCs�t|d�r|jjnd}t�|||�}|s6|�d�dS|��}|rn|ddksn|dd�dksn|dd�dkr||�d	�dS|S)
z�Check whether specified line seems to be executable.

        Return `lineno` if it is, 0 if not (e.g. a docstring, comment, blank
        line or EOF). Warning: testing is not comprehensive.
        r^NzEnd of filerrir�z"""z'''zBlank or comment)r�r^r#�	linecache�getlinerVrkr�)r2rrr�r rrrr��s
��
z
Pdb.checklinecCsh|��}|D]V}z|�|�}Wn,tk
rJ}z|�|�W5d}~XYqX|��|�d|�qdS)z�enable bpnumber [bpnumber ...]
        Enables the breakpoints given as a space separated list of
        breakpoint numbers.
        Nz
Enabled %s)r��get_bpbynumberr�r��enablerV�r2r�r�r-r�r�rrr�	do_enablesz
Pdb.do_enablecCsh|��}|D]V}z|�|�}Wn,tk
rJ}z|�|�W5d}~XYqX|��|�d|�qdS)aNdisable bpnumber [bpnumber ...]
        Disables the breakpoints given as a space separated list of
        breakpoint numbers.  Disabling a breakpoint means it cannot
        cause the program to stop execution, but unlike clearing a
        breakpoint, it remains in the list of breakpoints and can be
        (re-)enabled.
        NzDisabled %s)r�r�r�r��disablerVr�rrr�
do_disableszPdb.do_disablec
Cs�|�dd�}z|d}Wntk
r0d}YnXz|�|d���}WnHtk
rf|�d�YnXtk
r�}z|�|�W5d}~XYn.X||_|s�|�d|j�n|�d|j�dS)a#condition bpnumber [condition]
        Set a new condition for the breakpoint, an expression which
        must evaluate to true before the breakpoint is honored.  If
        condition is absent, any existing condition is removed; i.e.,
        the breakpoint is made unconditional.
        r�rNr�Breakpoint number expectedz#Breakpoint %d is now unconditional.z$New condition set for breakpoint %d.)	r��
IndexErrorr�rkr�r�r�rVr�)r2r�r�r�r�r�rrr�do_condition%s
zPdb.do_conditionc
Cs�|��}zt|d���}Wnd}YnXz|�|d���}WnHtk
rb|�d�Ynvtk
r�}z|�|�W5d}~XYnLX||_|dkr�|dkr�d|}nd}|�d||j	f�n|�d|j	�dS)	a�ignore bpnumber [count]
        Set the ignore count for the given breakpoint number.  If
        count is omitted, the ignore count is set to 0.  A breakpoint
        becomes active when the ignore count is zero.  When non-zero,
        the count is decremented each time the breakpoint is reached
        and the breakpoint is not disabled and any associated
        condition evaluates to true.
        rrr�Nz%d crossingsz
1 crossingz%Will ignore next %s of breakpoint %d.z-Will stop next time breakpoint %d is reached.)
r�r�rkr�rr�r��ignorerVr�)r2r�r��countr�r�Zcountstrrrr�	do_ignore@s,	

��z
Pdb.do_ignorec
Cs�|stztd�}Wntk
r(d}YnX|����}|dkrpdd�tjjD�}|��|D]}|�d|�q\dSd|k�r|�	d�}|d|�}||d	d�}zt
|�}Wntk
r�d
|}YnX|�||�}|�
||�}|r�|�|�n|D]}|�d|�q�dS|��}	|	D]\}z|�|�}Wn.tk
�r^}z|�|�W5d}~XYnX|�|�|�d|��qdS)a=cl(ear) filename:lineno
cl(ear) [bpnumber [bpnumber...]]
        With a space separated list of breakpoint numbers, clear
        those breakpoints.  Without argument, clear all breaks (but
        first ask confirmation).  With a filename:lineno argument,
        clear all breaks at that line in that file.
        zClear all breaks? Zno)�yZyescSsg|]}|r|�qSrr)r�r�rrrr�qsz Pdb.do_clear.<locals>.<listcomp>z
Deleted %sNr�rzInvalid line number (%s))�input�EOFErrorrkr�r7r�r�Zclear_all_breaksrVr�r�r�r�Zclear_breakr�r�r�Zclear_bpbynumber)
r2r�ZreplyZbplistr�r-rrr�Z
numberlistrrr�do_clearcsF



zPdb.do_clearcCs|��dS)z�w(here)
        Print a stack trace, with the most recent frame at the bottom.
        An arrow indicates the "current frame", which determines the
        context of most commands.  'bt' is an alias for this command.
        N)�print_stack_tracer�rrr�do_where�szPdb.do_wherecCs^d|krt|j�ks nt�||_|j|jd|_|jj|_|�|j|j�d|_dSr()	r�r\�AssertionErrorr]r^r$rdrxr)r2r�rrr�
_select_frame�s 
zPdb._select_framecCsz|jdkr|�d�dSzt|p"d�}Wn$tk
rL|�d|�YdSX|dkr\d}ntd|j|�}|�|�dS)z�u(p) [count]
        Move the current frame count (default one) levels up in the
        stack trace (to an older frame).
        rzOldest frameNr�Invalid frame count (%s))r]r�r�r��maxr�r2r�rZnewframerrr�do_up�s

z	Pdb.do_upcCs�|jdt|j�kr"|�d�dSzt|p,d�}Wn$tk
rV|�d|�YdSX|dkrpt|j�d}ntt|j�d|j|�}|�|�dS)z�d(own) [count]
        Move the current frame count (default one) levels down in the
        stack trace (to a newer frame).
        rzNewest frameNr
r)r]r�r\r�r�r��minrrrrr�do_down�s
zPdb.do_downcCsh|rRzt|�}Wn$tk
r4|�d|�YdSX||jjkrV|�d�dSnd}|�|j|�dS)aNunt(il) [lineno]
        Without argument, continue execution until the line with a
        number greater than the current one is reached.  With a line
        number, continue execution until a line with a number greater
        or equal to that is reached.  In both cases, also stop when
        the current frame returns.
        �Error in argument: %rNz7"until" line number is smaller than current line numberr)r�r�r�r^rrZ	set_until)r2r�rrrr�do_until�s
zPdb.do_untilcCs|��dS)z�s(tep)
        Execute the current line, stop at the first possible occasion
        (either in a function that is called or in the current
        function).
        r)rWr�rrr�do_step�szPdb.do_stepcCs|�|j�dS)zxn(ext)
        Continue execution until the next line in the current function
        is reached or it returns.
        r)Zset_nextr^r�rrr�do_next�szPdb.do_nextcCs<|r4ddl}tjdd�}|�|�t_|tjdd�<t�dS)arun [args...]
        Restart the debugged python program. If a string is supplied
        it is split with "shlex", and the result is used as the new
        sys.argv.  History, breakpoints, actions and debugger options
        are preserved.  "restart" is an alias for "run".
        rNr)�shlexr<�argvr�r)r2r�rZargv0rrr�do_run�sz
Pdb.do_runcCs|�|j�dS)zPr(eturn)
        Continue execution until the current function returns.
        r)Z
set_returnr^r�rrr�	do_returnsz
Pdb.do_returncCs>|js2zt�tj|j�t_Wntk
r0YnX|��dS)z]c(ont(inue))
        Continue execution, only stop when a breakpoint is encountered.
        r)rGr�r�rYrr�r�Zset_continuer�rrr�do_continues�zPdb.do_continuec
Cs�|jdt|j�kr"|�d�dSzt|�}Wntk
rL|�d�YnnXz:||j_|j|jd|f|j|j<|�|j|j�Wn0tk
r�}z|�d|�W5d}~XYnXdS)a�j(ump) lineno
        Set the next line that will be executed.  Only available in
        the bottom-most frame.  This lets you jump back and execute
        code again, or jump forward to skip code that you don't want
        to run.

        It should be noted that not all jumps are allowed -- for
        instance it is not possible to jump into the middle of a
        for loop or out of a finally clause.
        rz)You can only jump within the bottom frameNz)The 'jump' command requires a line numberrzJump failed: %s)	r]r�r\r�r�r�r^rrrx)r2r��errr�do_jump&s
zPdb.do_jumpcCs�t�d�|jj}|j}t|j|j|j�}d|j	�
�|_	|�d�zt�|j
|||f�Wn<tk
r�t��dd�}|�tj|�d�
��YnX|�d�t�|j�|j|_dS)z�debug code
        Enter a recursive debugger that steps through the code
        argument (which is an arbitrary expression or statement to be
        executed in the current environment).
        Nz(%s) zENTERING RECURSIVE DEBUGGERr�r|zLEAVING RECURSIVE DEBUGGER)r<�settracer^r#rdrrRrSrTr>rkrV�call_tracingr	r�r�r�r~rZtrace_dispatchrw)r2r�r�r��pr�rrr�do_debugCs


zPdb.do_debugcCsd|_|��dS)z[q(uit)
exit
        Quit from the debugger. The program being executed is aborted.
        Tr)�_user_requested_quit�set_quitr�rrr�do_quitZszPdb.do_quitcCs|�d�d|_|��dS)z=EOF
        Handles the receipt of EOF as a command.
        r6Tr)rVr"r#r�rrr�do_EOFes
z
Pdb.do_EOFcCs�|jj}|j}|j|j}|jtj@r.|d}|jtj@rB|d}t	|�D]>}|j
|}||krx|�d|||f�qJ|�d|f�qJdS)zHa(rgs)
        Print the argument list of the current function.
        rz%s = %rz%s = *** undefined ***N)r^rard�co_argcount�co_kwonlyargcount�co_flagsr"Z
CO_VARARGSZCO_VARKEYWORDS�range�co_varnamesrV)r2r��co�dictr�r-�namerrr�do_argsns
zPdb.do_argscCs.d|jkr |�t|jd��n
|�d�dS)zQretval
        Print the return value for the last return of a function.
        rzzNot yet returned!N)rdrVr�r�r�rrr�	do_retvals
z
Pdb.do_retvalcCsPzt||jj|j�WSt��dd�}|�tj|�d�	���YnXdS)Nr�r|)
r�r^r#rdr<r�r�r~rrk)r2r�r�rrr�_getval�szPdb._getvalcCsrz2|dkrt||jj|j�WSt||j|j�WSWn:t��dd�}tj|�d�	�}t
d|�YSXdS)Nr�r|z** raised %s **)r�r^r#rdr$r<r�r~rrkr/)r2r�rXr�r�rrrr��szPdb._getval_exceptcCs*z|�t|�|���WnYnXdS)z@p expression
        Print the value of the expression.
        N)rVr�r0r�rrr�do_p�szPdb.do_pcCs,z|�t�|�|���WnYnXdS)zHpp expression
        Pretty-print the value of the expression.
        N)rV�pprintZpformatr0r�rrr�do_pp�sz	Pdb.do_ppcCsfd|_d}|r�|dkr�z^d|krX|�d�\}}t|���}t|���}||krr||}nt|���}td|d�}Wq�tk
r�|�d|�YdSXn0|jdks�|dkr�td|jj	d�}n
|jd}|dkr�|d}|jj
j}|�|�}zZt
�||jj�}|�||d|�|||j�t|t|��|_t|�|k�rH|�d	�Wntk
�r`YnXdS)
a�l(ist) [first [,last] | .]

        List source code for the current file.  Without arguments,
        list 11 lines around the current line or continue the previous
        listing.  With . as argument, list 11 lines around the current
        line.  With one argument, list 11 lines starting at that line.
        With two arguments, list the given range; if the second
        argument is less than the first, it is a count.

        The current line in the current frame is indicated by "->".
        If an exception is being debugged, the line where the
        exception was originally raised or propagated is indicated by
        ">>", if it differs from the current line.
        r)Nr�r�r�r�
z[EOF])rwr�r�rkrr�r�rr^rrrarq�get_file_breaksr��getlinesr#�_print_linesrr�rVrU)r2r�Zlast�firstr�	breaklistr&rrr�do_list�s@




�zPdb.do_listc
Csp|jjj}|�|�}zt|j�\}}Wn2tk
rX}z|�|�WY�dSd}~XYnX|�||||j�dS)z\longlist | ll
        List the whole source code for the current function or frame.
        N)r^rarqr6r'rr�r8)r2r�rr:r&rr�rrr�do_longlist�s


zPdb.do_longlistc
Csvz|�|�}WnYdSXzt|�\}}Wn6ttfk
rd}z|�|�WY�dSd}~XYnX|�||�dS)z^source expression
        Try to get source code for the given object and display it.
        N)r0r'r�	TypeErrorr�r8)r2r�r%r&rr�rrr�	do_source�s
z
Pdb.do_sourcerc
Cs�|r|j}|j�|d�}nd}}t||�D]|\}}t|��d�}	t|	�dkrV|	d7}	||krh|	d7}	n|	d7}	||kr�|	d7}	n||kr�|	d7}	|�|	d|���q,d	S)
zPrint a range of lines.r|r��r��Bz->z>>�	N)	rrrCr�rr��rjustr�rVr�)
r2r&rr�rXZcurrent_linenoZ
exc_linenorr �srrrr8s 

zPdb._print_linescCs�z|�|�}WnYdSXd}z|jj}Wntk
rBYnX|r\|�d|j�dSz
|j}Wntk
rzYnX|r�|�d|j�dS|jtkr�|�d|j|j	f�dS|�t|��dS)z;whatis arg
        Print the type of the argument.
        Nz	Method %szFunction %szClass %s.%s)
r0r�r�r�rVr��	__class__�typerr)r2r��valuer,rrr�	do_whatiss.

z
Pdb.do_whatiscCsl|s8|�d�|j�|ji���D]}|�d|�q"n0|�|�}||j�|ji�|<|�d||f�dS)z�display [expression]

        Display the value of the expression if it changed, each time execution
        stops in the current frame.

        Without expression, list all display expressions for the current frame.
        zCurrently displaying:z%s: %rzdisplay %s: %rN)rVr@r�r^r�r��
setdefault)r2r�r��valrrr�
do_display<s

zPdb.do_displaycCsT|r@z|j�|ji�|=WqPtk
r<|�d|�YqPXn|j�|jd�dS)z�undisplay [expression]

        Do not display the expression any more in the current frame.

        Without expression, clear all display expressions for the current frame.
        znot displaying %sN)r@r�r^r�r�rjr�rrr�do_undisplayOszPdb.do_undisplaycs�fdd�|j�|ji�D�S)Ncsg|]}|���r|�qSrr�)r�rr�rrr�_s
�z*Pdb.complete_undisplay.<locals>.<listcomp>)r@r�r^r�rr�r�complete_undisplay^szPdb.complete_undisplaycCs |jj|j�}tjd|d�dS)z�interact

        Start an interactive interpreter whose global namespace
        contains all the (global and local) names found in the current scope.
        z
*interactive*)ZlocalN)r^r#rdr,�interact)r2r�r�rrr�do_interactbszPdb.do_interactcCs�|��}t|�dkrHt|j���}|D]}|�d||j|f�q&dS|d|jkr�t|�dkr�|�d|d|j|df�nd�|dd��|j|d<dS)acalias [name [command [parameter parameter ...] ]]
        Create an alias called 'name' that executes 'command'.  The
        command must *not* be enclosed in quotes.  Replaceable
        parameters can be indicated by %1, %2, and so on, while %* is
        replaced by all the parameters.  If no command is given, the
        current alias for name is shown. If no name is given, all
        aliases are listed.

        Aliases may be nested and can contain anything that can be
        legally typed at the pdb prompt.  Note!  You *can* override
        internal pdb commands with aliases!  Those internal commands
        are then hidden until the alias is removed.  Aliasing is
        recursively applied to the first word of the command line; all
        other words in the line are left alone.

        As an example, here are two useful aliases (especially when
        placed in the .pdbrc file):

        # Print instance variables (usage "pi classInst")
        alias pi for k in %1.__dict__.keys(): print("%1.",k,"=",%1.__dict__[k])
        # Print instance variables in self
        alias ps pi self
        rz%s = %sNrr�)r�r��sortedr?r�rVr�)r2r�r�r�r�rrr�do_aliasks"zPdb.do_aliascCs6|��}t|�dkrdS|d|jkr2|j|d=dS)z9unalias name
        Delete the specified alias.
        rN)r�r�r?)r2r�r�rrr�
do_unalias�s
zPdb.do_unaliascs�fdd�|jD�S)Ncsg|]}|���r|�qSrr�)r��ar�rrr��s
z(Pdb.complete_unalias.<locals>.<listcomp>)r?r�rr�r�complete_unalias�szPdb.complete_unaliasrrrrr$rcCs4z|jD]}|�|�qWntk
r.YnXdSr0)r\rxrU)r2�frame_linenorrrr	�s

zPdb.print_stack_tracecCs6|\}}||jkrd}nd}|�||�||��dS)Nz> z  )r^rVZformat_stack_entry)r2rTZ
prompt_prefixrXrr�rrrrx�s

�zPdb.print_stack_entrycCs�|stj�||�Sz@zt|d|�}|�WWStk
rNt|d|�}YnXWn"tk
rt|�d|�Yn0Xtjjdkr�|�d|�dS|�	|j
���dS)z�h(elp)
        Without argument, print the list of available commands.
        With a command name as argument, print help about that command.
        "help pdb" shows the full pdb documentation.
        "help exec" gives help on the ! command.
        Zhelp_r�zNo help for %rr�zJNo help for %r; please do not run Python with -OO if you need command helpN)r:r;�do_helprvr�r�r<�flags�optimizerVrr�)r2r�ZtopicZcommandrrrrU�s 
�zPdb.do_helpcCs|�|jjpd���dS)a�(!) statement
        Execute the (one-line) statement in the context of the current
        stack frame.  The exclamation point can be omitted unless the
        first word of the statement resembles a debugger command.  To
        assign to a global variable you must always prefix the command
        with a 'global' command, e.g.:
        (Pdb) global list_options; list_options = ['-l']
        (Pdb)
        r6N)rV�	help_execrrkr1rrrrX�s
z
Pdb.help_execcCs
t�dSr0)rr1rrr�help_pdb�szPdb.help_pdbcCs�tj�|�rtj�|�r|Stj�tjd|�}tj�|�rP|�|�|jkrP|Stj�|�\}}|dkrp|d}tj�|�r�|StjD]>}tj�	|�r�t�
|�}q�tj�||�}tj�|�r�|Sq�dS)z�Helper function for break/clear parsing -- may be overridden.

        lookupmodule() translates (possibly incomplete) file or module name
        into an absolute file name.
        rr6r�N)rIrJ�isabs�existsr�r<rprA�splitext�islink�readlink)r2rrf�rootZext�dirname�fullnamerrrr��s"

zPdb.lookupmodulec	Csrd|_d|_ddl}|�|�\}}}|�|j�|_ddl}|j�	�|j�
d|j|j|j|t
d��|�|�dS)NTFr�__main__)r�__file__�__package__�
__loader__�__spec__�__builtins__)rBr"�runpyZ_get_module_detailsrprqrArb�__dict__r_�update�parent�loaderrgr	)r2Zmodule_namerhZmod_nameZmod_specr,rbrrr�
_runmodule�s 
�zPdb._runmodulec	Cstddl}|j��|j�d|td��d|_|�|�|_d|_t	�
|��}d|��|jf}W5QRX|�|�dS)Nrrb)rrcrgTFzexec(compile(%r, %r, 'exec')))
rbrir_rjrgrBrprAr"�io�	open_code�readr	)r2rrbr�	statementrrr�
_runscript
s
�
�zPdb._runscript)r4NNNFT)r)N)rN)wrrrr�r9rYrZr[rhrerortrsr{r�ryr�rnr�r�r�rlr�rVr�r�r�r�r�Zcomplete_commandsr�r�Zdo_bZcomplete_breakZ
complete_br�Zcomplete_tbreakr�r�r�Zcomplete_enabler�Zcomplete_disablerZcomplete_conditionrZcomplete_ignorerZdo_clZcomplete_clearZcomplete_clr
Zdo_wZdo_btrrZdo_urZdo_drZdo_untrZdo_srZdo_nrZ
do_restartrZdo_rrZdo_cZdo_contrZdo_jr!Zcomplete_debugr$Zdo_qZdo_exitr%r.Zdo_ar/Zdo_rvr0r�r1r3Zcomplete_printZ
complete_pZcomplete_ppr;Zdo_lr<Zdo_llr>Zcomplete_sourcer8rGZcomplete_whatisrJZcomplete_displayrKrLrNrPrQrSr�r	�line_prefixrxrUZdo_hrXrYr�rmrrrrrrr�s��
/	


M
]!!.	
		1
!	#	��whereZdownZup�breakZtbreakr_r�r�rZ	conditionrM�stepr�ZuntilZjump�returnZretval�continuer)Zlonglistr�r ZppZwhatis�sourceZdisplayZ	undisplayrMr�Zunalias�debug�quitr�z

cCst��|||�dSr0)rr	�rqr�r�rrrr	<scCst��|||�Sr0)rr)Z
expressionr�r�rrrr?scCst|||�dSr0)r	r|rrrr
BscOst�j||�Sr0)rr)r��kwdsrrrrFs)�headercCs,t�}|dk	r|�|�|�t��j�dSr0)rrVrr<�	_getframe�f_back)r~�pdbrrrrIs
cCsB|dkrt��d}|dkr$td��t�}|��|�d|�dS)Nr�zAA valid traceback must be passed if no exception is being handled)r<r�r�rrZrn)�tr rrrrQscCsttj�dSr0)rr<�last_tracebackrrrrr
_szimport x; x.main()cCstt�dSr0)r	�TESTCMDrrrr�testgsr�cCsddl}|�t�dSr()�pydocZpagerr)r�rrrrksausage: pdb.py [-c command] ... [-m module | pyfile] [arg] ...

Debug the Python program given by pyfile. Alternatively,
an executable module or package to debug can be specified using
the -m switch.

Initial commands are read from .pdbrc files in your home directory
and in the current directory, if they exist.  Commands supplied with
-c are executed after commands from .pdbrc files.

To let the script run until an exception occurs, use "-c continue".
To let the script run up to a given line X in the debugged file, use
"-c 'until X'".c

Csddl}|�tjdd�dddg�\}}|s>tt�t�d�g}d}|D]B\}}|dkrltt�t��qJ|d	kr�|�|�qJ|d
krJd}qJ|d}|s�tj�	|�s�td|d
�t�d�|tjdd�<|s�tj�
|�}tj�|�tjd<t�}|j
�|�z6|�r|�|�n
|�|�|j�r*W�qtd�Wq�tk
�rrtd|d�tdd�tjdd���Yq�tk
�r�tddd�tt��d�Yq�tk
�r�t��t�d�Yq�t��td�td�t��d}	|�d|	�td|d�Yq�Xq�dS)Nrrzmhc:rzcommand=r�F)z-hz--help)z-cz	--command)z-mTzError:zdoes not existz*The program finished and will be restartedZ
Restartingzwith arguments:rAr�z/The program exited via sys.exit(). Exit status:)r�z2Uncaught exception. Entering post mortem debuggingz1Running 'cont' or 'step' will restart the programz#Post mortem debugger finished. The z will be restarted)�getoptr<rr��_usage�exitr�rIrJr[�realpathr`rrHrLrmrrr"rr��
SystemExitr��SyntaxErrorr~�	print_excrn)
r�Zoptsr�rMZ
run_as_module�optZoptargrAr�r�rrr�main~sd 



 �r�rb)NN)NN)N)/rrIrnrr<r:r7r*r,r�r2r�r"rr~r�r�r�__all__r!r'r.r�r/rsr8r;rZ_help_orderZ_commandrvrkrXr	rr
rrrr
r�r�rr�r�rr�rrrr�<module>s�C�
		*
� 


D
__pycache__/turtle.cpython-38.pyc000064400000375750151153537550012756 0ustar00U

e5dd1�O@s6dZdZddlZddlZddlZddlZddlZddlZddl	m
Z
mZmZddl
mZddlmZddd	d
ddd
ddg	Zddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.gZd/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}gOZd~dgZeeeed�gZdd0d3d@dMdQdUd[d]dbdcdedfdqdvdydzgZd�d�d�d�ddd�d�d�d�d�d�d�d�d�d�d�d�d�d�d��Zd�d��Zd�d��Zzee�Wnek
�r
ed��YnXGd�d�de�Zd�d��Zd�d��Zd�Zd�d�d��Z Gd�d�dej!�Z"e e"ej#d��Gd�d��d�ej$�Z%ej#Z#Gd�d��d�e&�Z'Gd�d��d�e�Z(Gd�d��d�e�Z)Gd�d�de&�Z*Gd�d��d�e&�Z+Gd�d�de'�Z,Gd�d��d�e&�Z-Gd�d��d�e&�Z.Gd�d��d�e&�Z/Gd�d
�d
e.e-�Z0e0Z1d�d	�Z2Gd�d��d�e,�Z3Gd�d�de0�Z4e4Z5d�d�d~�Z6d�d��Z7ed�Z8ze8d�k�rre7e8�Wn@e9k
�r�ed�e8�Yn"ek
�r�ed�e8�YnXd�d��Z:d�dÄZ;d�dńZ<d�Z=d�dȄZ>e>ee3d�d�e<�e>ee4d�d�e;�e?Z@eAd�k�r2d�dτZBd�dфZCd�dӄZDeC�eD�eE�dS)�a�

Turtle graphics is a popular way for introducing programming to
kids. It was part of the original Logo programming language developed
by Wally Feurzig and Seymour Papert in 1966.

Imagine a robotic turtle starting at (0, 0) in the x-y plane. After an ``import turtle``, give it
the command turtle.forward(15), and it moves (on-screen!) 15 pixels in
the direction it is facing, drawing a line as it moves. Give it the
command turtle.right(25), and it rotates in-place 25 degrees clockwise.

By combining together these and similar commands, intricate shapes and
pictures can easily be drawn.

----- turtle.py

This module is an extended reimplementation of turtle.py from the
Python standard distribution up to Python 2.5. (See: http://www.python.org)

It tries to keep the merits of turtle.py and to be (nearly) 100%
compatible with it. This means in the first place to enable the
learning programmer to use all the commands, classes and methods
interactively when using the module from within IDLE run with
the -n switch.

Roughly it has the following features added:

- Better animation of the turtle movements, especially of turning the
  turtle. So the turtles can more easily be used as a visual feedback
  instrument by the (beginning) programmer.

- Different turtle shapes, gif-images as turtle shapes, user defined
  and user controllable turtle shapes, among them compound
  (multicolored) shapes. Turtle shapes can be stretched and tilted, which
  makes turtles very versatile geometrical objects.

- Fine control over turtle movement and screen updates via delay(),
  and enhanced tracer() and speed() methods.

- Aliases for the most commonly used commands, like fd for forward etc.,
  following the early Logo traditions. This reduces the boring work of
  typing long sequences of commands, which often occur in a natural way
  when kids try to program fancy pictures on their first encounter with
  turtle graphics.

- Turtles now have an undo()-method with configurable undo-buffer.

- Some simple commands/methods for creating event driven programs
  (mouse-, key-, timer-events). Especially useful for programming games.

- A scrollable Canvas class. The default scrollable Canvas can be
  extended interactively as needed while playing around with the turtle(s).

- A TurtleScreen class with methods controlling background color or
  background image, window and canvas size and other properties of the
  TurtleScreen.

- There is a method, setworldcoordinates(), to install a user defined
  coordinate-system for the TurtleScreen.

- The implementation uses a 2-vector class named Vec2D, derived from tuple.
  This class is public, so it can be imported by the application programmer,
  which makes certain types of computations very natural and compact.

- Appearance of the TurtleScreen and the Turtles at startup/import can be
  configured by means of a turtle.cfg configuration file.
  The default configuration mimics the appearance of the old turtle module.

- If configured appropriately the module reads in docstrings from a docstring
  dictionary in some different language, supplied separately  and replaces
  the English ones by those read in. There is a utility function
  write_docstringdict() to write a dictionary with the original (English)
  docstrings to disc, so it can serve as a template for translations.

Behind the scenes there are some features included with possible
extensions in mind. These will be commented and documented elsewhere.

z-turtle 1.1b- - for Python 3.1   -  4. 5. 2009�N)�isfile�split�join)�deepcopy)�simpledialog�ScrolledCanvas�TurtleScreen�Screen�	RawTurtle�Turtle�RawPen�Pen�Shape�Vec2D�addshape�bgcolor�bgpic�bye�clearscreen�	colormode�delay�exitonclick�	getcanvas�	getshapes�listen�mainloop�mode�numinput�onkey�
onkeypress�onkeyrelease�
onscreenclick�ontimer�register_shape�resetscreen�
screensize�setup�setworldcoordinates�	textinput�title�tracer�turtles�update�
window_height�window_width�back�backward�
begin_fill�
begin_poly�bk�circle�clear�
clearstamp�clearstamps�clone�color�degrees�distance�dot�down�end_fill�end_poly�fd�	fillcolor�filling�forward�get_poly�getpen�	getscreen�
get_shapepoly�	getturtle�goto�heading�
hideturtle�home�ht�isdown�	isvisible�left�lt�onclick�ondrag�	onrelease�pd�pen�pencolor�pendown�pensize�penup�pos�position�pu�radians�right�reset�
resizemode�rt�seth�
setheading�setpos�setposition�settiltangle�
setundobuffer�setx�sety�shape�	shapesize�shapetransform�shearfactor�
showturtle�speed�st�stamp�tilt�	tiltangle�towards�
turtlesize�undo�undobufferentries�up�width�write�xcor�ycor�write_docstringdict�done�
Terminator��?g�?i�i,�standard��?�
i��classic�black�noresizeTZenglish�turtle�screenzPython Turtle GraphicsF)rz�height�	canvwidth�
canvheight�	leftright�	topbottomrrr�undobuffersizerkrWrAra�visible�language�
exampleturtle�
examplescreenr)�
using_IDLEc	Cs�t|d��}|��}W5QRXi}|D]�}|��}|r&|�d�rBq&z|�d�\}}Wn(tk
r|td||f�Yq&YnX|��}|��}|dkr�t|�}n4zd|kr�t|�}nt	|�}Wntk
r�YnX|||<q&|S)z/Convert content of config-file into dictionary.�r�#�=zBad line in config-file %s:
%s)�True�False�Nonez''z""�.)
�open�	readlines�strip�
startswithr�
ValueError�print�eval�float�int)�filename�fZcfglines�cfgdict�line�key�value�r��/usr/lib64/python3.8/turtle.py�config_dict�s0



r�cCs�d}i}i}t|�rt|�}d|kr0d|d}ztt�\}}t||�}Wntk
rbd}YnXt|�rtt|�}t�|�t�|�dS)a@Read config-files, change configuration-dict accordingly.

    If there is a turtle.cfg file in the current working directory,
    read it from there. If this contains an importconfig-value,
    say 'myway', construct filename turtle_mayway.cfg else use
    turtle.cfg and read it from the import-directory, where
    turtle.py is located.
    Update configuration dictionary first according to config-file,
    in the import directory, then according to config-file in the
    current working directory.
    If no config-file is found, the default configuration is used.
    z
turtle.cfgZimportconfigz
turtle_%s.cfg�N)rr�r�__file__r�	Exception�_CFGr,)r�Zdefault_cfgZcfgdict1Zcfgdict2�head�tailZ	cfg_file2r�r�r��
readconfig�s 


r�z"No configfile read, reason unknownc@s`eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dS)ra�A 2 dimensional vector class, used as a helper class
    for implementing turtle graphics.
    May be useful for turtle graphics programs also.
    Derived from tuple, so a vector is a tuple!

    Provides (for a, b vectors, k number):
       a+b vector addition
       a-b vector subtraction
       a*b inner product
       k*a and a*k multiplication with scalar
       |a| absolute value of a
       a.rotate(angle) rotation
    cCst�|||f�S�N)�tuple�__new__)�cls�x�yr�r�r�r��sz
Vec2D.__new__cCs"t|d|d|d|d�S�Nr��r��self�otherr�r�r��__add__�sz
Vec2D.__add__cCsDt|t�r*|d|d|d|dSt|d||d|�Sr�)�
isinstancerr�r�r�r��__mul__�s
 z
Vec2D.__mul__cCs2t|t�st|t�r.t|d||d|�StSr�)r�r�r�r�NotImplementedr�r�r�r��__rmul__szVec2D.__rmul__cCs"t|d|d|d|d�Sr�r�r�r�r�r��__sub__sz
Vec2D.__sub__cCst|d|d�Sr�r��r�r�r�r��__neg__sz
Vec2D.__neg__cCs|dd|dddS)Nr�r�r�r�r�r�r�r��__abs__
sz
Vec2D.__abs__cCsjt|d|d�}|tjd}t�|�t�|�}}t|d||d||d||d|�S)z.rotate self counterclockwise by angle
        r�r��f@)r�math�pi�cos�sin)r��angleZperp�c�sr�r�r��rotateszVec2D.rotatecCs|d|dfSr�r�r�r�r�r��__getnewargs__szVec2D.__getnewargs__cCsd|S)Nz(%.2f,%.2f)r�r�r�r�r��__repr__szVec2D.__repr__N)�__name__�
__module__�__qualname__�__doc__r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�s
cCsTt|j�}|��|D]}t||�q|j��D]\}}t|�tjkr0|||<q0dS)�#helper function for Scrolled CanvasN)	�list�	__bases__�reverse�__methodDict�__dict__�items�type�types�FunctionType)r��_dictZbaseListZ_superr�r�r�r�r�r�!s
r�cCsi}t||�|��S)r�)r��keys)r�r�r�r�r��	__methods+s
r�zTdef %(method)s(self, *args, **kw): return self.%(attribute)s.%(method)s(*args, **kw)r�cCs�i}t||�i}t|�}|��D]B}|dd�dksd|dd�dksd||ksd||krXq"||||<q"|��D]D\}}	||	d�}
t|t�r�t||d�}t||
�t|||
|�qndS)Nr��_���)�method�func)r�Z	attribute)	r�r�r�r�r��str�__stringBody�exec�setattr)Z	fromClassZtoClassZtoPartZexcludeZ_dict_1r�ZmfcZexr�r��dZ
execStringr�r�r��__forwardmethods5s
0

�
r�c@sdeZdZdZddd�Zddd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dS)rz�Modeled after the scrolled canvas class from Grayons's Tkinter book.

    Used as the default canvas, which pops up automatically when
    using turtle graphics functions or the Turtle class.
    ���^�Xc
Cs0tjj||||d�|��|_|||_|_|||_|_d|_	tj
||||j	tjdd�|_tj
||jjtjd�|_tj
||jjd�|_|jj|jj|jjd�|jdd	dd
�|jdd	dd
�|jjd	|d	ddd	d	dd�|jjd	|d	dd	d	d	dd�|jjd	|d	d	dd	d	dd�|��|j�d
|j�dS)N)rzr��whiter�)rzr��bgZreliefZborderwidth)�commandZorient)r�)ZxscrollcommandZyscrollcommandrr�)ZweightZminsize�news�ZpadxZin_Zpady�row�columnZrowspanZ
columnspanZstickyz<Configure>)�TK�Frame�__init__�winfo_toplevelZ_rootwindowrzr�r�r�r��CanvasZSUNKEN�_canvasZ	ScrollbarZxviewZ
HORIZONTAL�hscrollZyview�vscrollZ	configure�setZrowconfigureZcolumnconfigure�gridr`�bind�onResize)r��masterrzr�r�r�r�r�r�r�PsN

������zScrolledCanvas.__init__NcCs�|r
||_|r||_|r||_|jj||jd|jd|jd|jdfd�|j�d|j|jd|j�|j�d|j|jd|j�|�	�dS)z<Adjust canvas and scrollbars according to given canvas size.r�)r��scrollregionr��N)
r�r�r�r�config�xview_movetorz�yview_movetor��
adjustScrolls�r�r�r�r�r�r�r�r`is&����zScrolledCanvas.resetc
Cs�|j��}|j��}|j�d|j||j�|j�d|j||j�||jks`||jkr�|jjd|ddddddd�|j	jd|ddddddd�n|j�
�|j	�
�dS)zA Adjust scrollbars according to window- and canvas-size.
        r�r�rr�r�N)r�winfo_width�winfo_heightrr�rr�rrrZgrid_forget)r��cwidth�cheightr�r�r�r
{s&

��
zScrolledCanvas.adjustScrollscCs|��dS)zself-explanatoryN)r
)r��eventr�r�r�r�szScrolledCanvas.onResizecGs|jj|�S��@ 'forward' method, which canvas itself has inherited...
        )r�bbox�r��argsr�r�r�r�szScrolledCanvas.bboxcOs|jj||�Sr)r�cget�r�r�kwargsr�r�r�r�szScrolledCanvas.cgetcOs|jj||�dS�rN)rr
rr�r�r�r
�szScrolledCanvas.configcOs|jj||�dSr)rrrr�r�r�r�szScrolledCanvas.bindcOs|jj||�dSr)r�unbindrr�r�r�r�szScrolledCanvas.unbindcCs|j��dSr)r�focus_forcer�r�r�r�r�szScrolledCanvas.focus_force)r�r�r�r�)NNN)r�r�r�r�r�r`r
rrrr
rrrr�r�r�r�rJs�

rc@sHeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)�_Rootz'Root class for Screen based on Tkinter.cCstj�|�dSr�)r��Tkr�r�r�r�r�r��sz_Root.__init__cCs&t|||||�|_|jjddd�dS)Nr�Zboth)�expand�fill)rrZpack)r�rzr�rrr�r�r��setupcanvas�sz_Root.setupcanvascCs|jSr�)rr�r�r�r��
_getcanvas�sz_Root._getcanvascCs|�d||||f�dS)Nz%dx%d%+d%+d)Zgeometry)r�rzr��startx�startyr�r�r��set_geometry�sz_Root.set_geometrycCs|�d|�dS)NZWM_DELETE_WINDOW)Zwm_protocol)r��destroyr�r�r��	ondestroy�sz_Root.ondestroycCs|��Sr�)Zwinfo_screenwidthr�r�r�r��	win_width�sz_Root.win_widthcCs|��Sr�)Zwinfo_screenheightr�r�r�r��
win_height�sz_Root.win_heightN)r�r�r�r�r�r#r$r'r)r*r+r�r�r�r�r�src@s,eZdZdZdd�Zdd�Zdd�Zdd	�ZdGdd
�Zdd�Z	dHdd�Z
dd�Zdd�Zdd�Z
dd�ZdIdd�Zdd�ZdJdd �ZdKd!d"�ZdLd#d$�ZdMd%d&�Zd'd(�ZdNd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�ZdOd=d>�Z d?d@�Z!dAdB�Z"dCdD�Z#dPdEdF�Z$d
S)Q�TurtleScreenBasez�Provide the basic graphics functionality.
       Interface between Tkinter and turtle.py.

       To port turtle.py to some different graphics toolkit
       a corresponding TurtleScreenBase class has to be implemented.
    cCstjdd|jd�}|��|S)z$return a blank image object
        r�)rzr�r)r��
PhotoImage�cv�blank)r�Zimgr�r�r��_blankimage�szTurtleScreenBase._blankimagecCstj||jd�S)z`return an image object containing the
        imagedata from a gif-file named filename.
        )�filer)r�r-r.)r�r�r�r�r��_image�szTurtleScreenBase._imagecCs�||_t|t�r"|jj}|jj}nJt|j�d��}t|j�d��}|jj|d|d|d|dfd�||_||_d|_|_	dS)Nrzr�r��rr�)
r.r�rr�r�r�rr
�xscale�yscale)r�r.�w�hr�r�r�r��s

*zTurtleScreenBase.__init__cCs|jjdddd�S)z<Create an invisible polygon item on canvas self.cv)
        )rrrrrrr��r"�outline)r.Zcreate_polygonr�r�r�r��_createpoly�szTurtleScreenBase._createpolyNFc
Cs�g}|D]*\}}	|�||j�|�|	|j�q|jj|f|��|dk	r^|jj||d�|dk	rv|jj||d�|dk	r�|jj||d�|r�|j�|�dS)a`Configure polygonitem polyitem according to provided
        arguments:
        coordlist is sequence of coordinates
        fill is filling color
        outline is outline color
        top is a boolean value, which specifies if polyitem
        will be put on top of the canvas' displaylist so it
        will not be covered by other items.
        N�r")r9�rz��appendr4r5r.�coordsZ
itemconfigureZ	tag_raise)
r�Zpolyitem�	coordlistr"r9rz�top�clr�r�r�r�r��	_drawpoly�szTurtleScreenBase._drawpolyc	Cs|jjddddddtjd�S)z9Create an invisible line item on canvas self.cv)
        rr�r�)r"rzZcapstyle)r.Zcreate_liner�ZROUNDr�r�r�r��_createlines�zTurtleScreenBase._createlinec	Cs�|dk	rNg}|D]*\}}|�||j�|�||j�q|jj|f|��|dk	rf|jj||d�|dk	r~|jj||d�|r�|j�|�dS)aQConfigure lineitem according to provided arguments:
        coordlist is sequence of coordinates
        fill is drawing color
        width is width of drawn line.
        top is a boolean value, which specifies if polyitem
        will be put on top of the canvas' displaylist so it
        will not be covered by other items.
        Nr;r<r=)	r�Zlineitemr@r"rzrArBr�r�r�r�r��	_drawlines
zTurtleScreenBase._drawlinecCs|j�|�dS)z]Delete graphics item from canvas.
        If item is"all" delete all graphics items.
        N)r.�delete�r��itemr�r�r��_delete(szTurtleScreenBase._deletecCs|j��dS)z(Redraw graphics items on canvas
        N)r.r,r�r�r�r��_update.szTurtleScreenBase._updatecCs|j�|�dS)z-Delay subsequent canvas actions for delay ms.N)r.�after�r�rr�r�r��_delay3szTurtleScreenBase._delaycCs4z|j�|�}d}Wntjk
r.d}YnX|S)zCCheck if the string color is a legal Tkinter color string.
        TF)r.Z	winfo_rgbr�ZTclError)r�r9Zrgb�okr�r�r��_iscolorstring7s
zTurtleScreenBase._iscolorstringcCs0|dk	r |jj|d�|��n|j�d�SdS)zVSet canvas' backgroundcolor if color is not None,
        else return backgroundcolor.N)r�r�)r.r
rJr)r�r9r�r�r��_bgcolorAs
zTurtleScreenBase._bgcolorcCst|\}}||j}||j}dddd�}|jj|d||||||d�}	|j�|	�\}
}}}
|j��|	|dfS)z�Write txt at pos in canvas with specified font
        and color.
        Return text item and x-coord of right bottom corner
        of text's bounding box.�swr�Zse)rP�centerr_r�)�text�anchorr"�font)r4r5r.Zcreate_textrr,)r�r[�txt�alignrUrWr�r�rTrHZx0Zy0Zx1Zy1r�r�r��_writeJs

�
zTurtleScreenBase._writer�csD�dkr�j�|d|�n$��fdd�}�j�|d|||�dS)z�Bind fun to mouse-click event on turtle.
        fun must be a function with two arguments, the coordinates
        of the clicked point on the canvas.
        num, the number of the mouse-button defaults to 1
        N�<Button-%s>cs:�j�|j��j�j�|j��j}}�||�dSr��r.�canvasxr�r4�canvasyr�r5�rr�r���funr�r�r��eventfunes�z+TurtleScreenBase._onclick.<locals>.eventfun�r.Z
tag_unbindZtag_bind�r�rHr_�num�addr`r�r^r��_onclick\szTurtleScreenBase._onclickcsD�dkr�j�|d|�n$��fdd�}�j�|d|||�dS)agBind fun to mouse-button-release event on turtle.
        fun must be a function with two arguments, the coordinates
        of the point on the canvas where mouse button is released.
        num, the number of the mouse-button defaults to 1

        If a turtle is clicked, first _onclick-event will be performed,
        then _onscreensclick-event.
        Nz<Button%s-ButtonRelease>cs:�j�|j��j�j�|j��j}}�||�dSr�rZr]r^r�r�r`ws�z-TurtleScreenBase._onrelease.<locals>.eventfunrarbr�r^r��
_onreleaseks	�zTurtleScreenBase._onreleasecsD�dkr�j�|d|�n$��fdd�}�j�|d|||�dS)aqBind fun to mouse-move-event (with pressed mouse button) on turtle.
        fun must be a function with two arguments, the coordinates of the
        actual mouse position on the canvas.
        num, the number of the mouse-button defaults to 1

        Every sequence of mouse-move-events on a turtle is preceded by a
        mouse-click event on that turtle.
        Nz<Button%s-Motion>csTz:�j�|j��j�j�|j��j}}�||�Wntk
rNYnXdSr�)r.r[r�r4r\r�r5r�r]r^r�r�r`�s�z*TurtleScreenBase._ondrag.<locals>.eventfunrarbr�r^r��_ondrag~s	zTurtleScreenBase._ondragcs@�dkr�j�d|�n"��fdd�}�j�d|||�dS)aGBind fun to mouse-click event on canvas.
        fun must be a function with two arguments, the coordinates
        of the clicked point on the canvas.
        num, the number of the mouse-button defaults to 1

        If a turtle is clicked, first _onclick-event will be performed,
        then _onscreensclick-event.
        NrYcs:�j�|j��j�j�|j��j}}�||�dSr�rZr]r^r�r�r`�s�z1TurtleScreenBase._onscreenclick.<locals>.eventfun�r.rr)r�r_rcrdr`r�r^r��_onscreenclick�s	zTurtleScreenBase._onscreenclickcs>�dkr|j�d|d�n�fdd�}|j�d||�dS)z`Bind fun to key-release event of key.
        Canvas must have focus. See method listen
        Nz<KeyRelease-%s>cs
��dSr�r��r�r_r�r�r`�sz0TurtleScreenBase._onkeyrelease.<locals>.eventfunrh�r�r_r�r`r�rkr��
_onkeyrelease�szTurtleScreenBase._onkeyreleasecsn�dkr4|dkr |j�dd�qj|j�d|d�n6�fdd�}|dkrX|j�d|�n|j�d||�dS)z�If key is given, bind fun to key-press event of key.
        Otherwise bind fun to any key-press.
        Canvas must have focus. See method listen.
        Nz
<KeyPress>z
<KeyPress-%s>cs
��dSr�r�rjrkr�r�r`�sz.TurtleScreenBase._onkeypress.<locals>.eventfunrhrlr�rkr��_onkeypress�szTurtleScreenBase._onkeypresscCs|j��dS)z=Set focus on canvas (in order to collect key-events)
        N)r.rr�r�r�r��_listen�szTurtleScreenBase._listencCs(|dkr|j�|�n|j�||�dS)z?Install a timer, which calls fun after t milliseconds.
        rN)r.Z
after_idlerK�r�r_�tr�r�r��_ontimer�szTurtleScreenBase._ontimercCs|jjdd|d�S)z0Create and return image item on canvas.
        r��image)r.Zcreate_image)r�rtr�r�r��_createimage�szTurtleScreenBase._createimagecCs<|\}}|j�|||j||jf�|jj||d�dS)zZConfigure image item as to draw image object
        at position (x,y) on canvas)
        rsN)r.r?r4r5�
itemconfig)r�rHr[rtr�r�r�r�r��
_drawimage�s zTurtleScreenBase._drawimagecCs |jj||d�|j�|�dS)z�Configure image item as to draw image object
        at center of canvas. Set item to the first item
        in the displaylist, so it will be drawn below
        any other item .rsN)r.rvZ	tag_lower)r�rHrtr�r�r��	_setbgpic�szTurtleScreenBase._setbgpiccCs|j�|�S)zQReturn 'line' or 'polygon' or 'image' depending on
        type of item.
        )r.r�rGr�r�r��_type�szTurtleScreenBase._typecs.|j�|���fdd�tdt��d�D�}|S)a returns list of coordinate-pairs of points of item
        Example (for insiders):
        >>> from turtle import *
        >>> getscreen()._pointlist(getturtle().turtle._item)
        [(0.0, 9.9999999999999982), (0.0, -9.9999999999999982),
        (9.9999999999999982, 0.0)]
        >>> cs"g|]}�|�|df�qS)r�r���.0�i�rBr�r��
<listcomp>�sz/TurtleScreenBase._pointlist.<locals>.<listcomp>rr�)r.r?�range�len)r�rH�plr�r}r��
_pointlist�szTurtleScreenBase._pointlistcCs|jj||||fd�dS)Nr3)r.r
)r��srx1�sry1�srx2�sry2r�r�r��_setscrollregion�sz!TurtleScreenBase._setscrollregionc	Cs||j��}|D]h}t|j�|��}g}|rd|dd�\}}|�||�|�||�|dd�}q&|jj|f|��qdS)Nr�)r.Zfind_allr�r?r>)	r�ZxscalefactorZyscalefactorr�rHZcoordinatesZnewcoordlistr�r�r�r�r��_rescale�s
zTurtleScreenBase._rescalecCszt|jt�s|j|jfS||kr6|kr6dkrJnn|jj|jjfS|dk	rX||_|dk	rf||_|j�|||�dS)zaResize the canvas the turtles are drawing on. Does
        not alter the drawing window.
        N)r�r.rr�r�r`rr�r�r��_resizes"zTurtleScreenBase._resizecCs@|j��}|dkr|jd}|j��}|dkr8|jd}||fS)z; Return the width and height of the turtle window.
        r�rzr�)r.rr)r�rzr�r�r�r��_window_sizes



zTurtleScreenBase._window_sizecCs|jj��dS)a{Starts event loop - calling Tkinter's mainloop function.

        No argument.

        Must be last statement in a turtle graphics program.
        Must NOT be used if a script is run from within IDLE in -n mode
        (No subprocess) - for interactive use of turtle graphics.

        Example (for a TurtleScreen instance named screen):
        >>> screen.mainloop()

        N)r.Ztkrr�r�r�r�rs
zTurtleScreenBase.mainloopcCstj|||jd�S)a�Pop up a dialog window for input of a string.

        Arguments: title is the title of the dialog window,
        prompt is a text mostly describing what information to input.

        Return the string input
        If the dialog is canceled, return None.

        Example (for a TurtleScreen instance named screen):
        >>> screen.textinput("NIM", "Name of first player:")

        )�parent)rZ	askstringr.)r�r)�promptr�r�r�r(.s
zTurtleScreenBase.textinputcCstj||||||jd�S)a�Pop up a dialog window for input of a number.

        Arguments: title is the title of the dialog window,
        prompt is a text mostly describing what numerical information to input.
        default: default value
        minval: minimum value for input
        maxval: maximum value for input

        The number input must be in the range minval .. maxval if these are
        given. If not, a hint is issued and the dialog remains open for
        correction. Return the number input.
        If the dialog is canceled,  return None.

        Example (for a TurtleScreen instance named screen):
        >>> screen.numinput("Poker", "Your stakes:", 1000, minval=10, maxval=10000)

        )ZinitialvalueZminvalueZmaxvaluer�)rZaskfloatr.)r�r)r��defaultZminvalZmaxvalr�r�r�r=s

�zTurtleScreenBase.numinput)NNNF)NNNF)N)r�N)r�N)r�N)r�N)N)NNN)NNN)%r�r�r�r�r0r2r�r:rCrDrErIrJrMrOrPrXrerfrgrirmrnrorrrurwrxryr�r�r�r�r�rr(rr�r�r�r�r,�sT
�
�


	





r,c@seZdZdZdS)r�z�Will be raised in TurtleScreen.update, if _RUNNING becomes False.

    This stops execution of a turtle graphics script.
    Main purpose: use in the Demo-Viewer turtle.Demo.py.
    N�r�r�r�r�r�r�r�r�r�Ysc@seZdZdZdS)�TurtleGraphicsErrorzSome TurtleGraphics Error
    Nr�r�r�r�r�r�bsr�c@s$eZdZdZddd�Zddd�ZdS)	rz�Data structure modeling shapes.

    attribute _type is one of "polygon", "image", "compound"
    attribute _data is - depending on _type a poygon-tuple,
    an image or a list constructed using the addcomponent method.
    NcCsz||_|dkr"t|t�rpt|�}nN|dkrVt|t�rp|���d�rpt|�rpt�	|�}n|dkrdg}nt
d|��||_dS)N�polygonrt�.gif�compoundzThere is no shape type %s)ryr�r�r�r��lower�endswithrrr2r��_data)r�Ztype_�datar�r�r�r�ns


zShape.__init__cCs:|jdkrtd|j��|dkr$|}|j�|||g�dS)a-Add component to a shape of type compound.

        Arguments: poly is a polygon, i. e. a tuple of number pairs.
        fill is the fillcolor of the component,
        outline is the outline color of the component.

        call (for a Shapeobject namend s):
        --   s.addcomponent(((0,0), (10,10), (-10,10)), "red", "blue")

        Example:
        >>> poly = ((0,0),(10,-5),(0,10),(-10,-5))
        >>> s = Shape("compound")
        >>> s.addcomponent(poly, "red", "blue")
        >>> # .. add more components and then use register_shape()
        r�z Cannot add component to %s ShapeN)ryr�r�r>)r��polyr"r9r�r�r��addcomponent~s
�zShape.addcomponent)N)N)r�r�r�r�r�r�r�r�r�r�rgs
c@sDeZdZdZddd�Zddd�Zdd	�Zd
d�Zdd
�Zdd�Z	dS)�Tbufferz5Ring buffer used as undobuffer for RawTurtle objects.r�cCs$||_dgg||_d|_d|_dS)Nr�F)�bufsize�buffer�ptr�cumulate)r�r�r�r�r�r��szTbuffer.__init__NcCsD|dkr&t|j�D]}dg|j|<qn||_dgg||_d|_dS)Nr�)rr�r�r�)r�r�r|r�r�r�r`�sz
Tbuffer.resetcCsF|jdkrB|js0|jd|j|_||j|j<n|j|j�|�dSr�)r�r�r�r�r>rGr�r�r��push�s

zTbuffer.pushcCsJ|jdkrF|j|j}|dkr"dSdg|j|j<|jd|j|_|SdSr�)r�r�r�rGr�r�r��pop�s
zTbuffer.popcCs|j|j�dg�Sr�)r�r��countr�r�r�r��nr_of_items�szTbuffer.nr_of_itemscCst|j�dt|j�S)N� )r�r�r�r�r�r�r�r��szTbuffer.__repr__)r�)N)
r�r�r�r�r�r`r�r�r�r�r�r�r�r�r��s

	r�c@s"eZdZdZdZedededfdd�Zdd	�Zd=dd�Zd
d�Z	d>dd�Z
dd�Zdd�Zd?dd�Z
dd�Zdd�Zdd�Zd@dd�ZdAdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�ZdBd.d/�Zd0d1�ZdCd2d3�ZdDd4d5�ZdEd7d8�ZdFd9d:�ZdGd;d<�ZeZ eZ!eZ"e
Z#eZ$d
S)Hrz�Provides screen oriented methods like setbg etc.

    Only relies upon the methods of TurtleScreenBase and NOT
    upon components of the underlying graphics toolkit -
    which is Tkinter in this case.
    Trrrc
Cs�t�||�tdd�tdd�tdd�tdd�tdd�tdd�td|���d	�|_d
di|_||_||_td|_	g|_
|��tj
d
kr�|��}|�ddddd�|�ddddd�dS)Nr�)����r�r�r�rr�))r�)����)r�r�)����)����	)����)����)r�r�)������)���r�)r�r�)r�r��rr�)�r�)�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�)��Q�#@���Q�@)�G�z. @��Q��@)r�r�)r�r�r�)���Q��r�)��Q���r�)�G�z. �r�)��Q�#�r�r�)r�r�)r�r�)r�r�)r�r�)g�g$�)r�r�)r�r�)r�r�)r�r�))r�r�)r�r�)r�r�)r�r�))r���G�z�)rg�����'@)r�r�)�rr)r�r�r�)r�r�rt)Zarrowr�r4ZsquareZtriangler�r/�nopicr�r�darwinZwmZ
attributesr�z-topmost�1�0)r,r�rr0�_shapes�_bgpics�_mode�_delayvaluer��
_colormode�_keysr5�sys�platformr�Zcall)r�r.rrrZ
rootwindowr�r�r�r��s&�


zTurtleScreen.__init__cCs�td|_td|_|�d�|�d�|_d|_d|_d|_g|_	|�
d�d	D]}|�d
|�qP|�d
�|j
d
d
�D]}|�d
|�|�d
|�qzd
t_d
S)aqDelete all drawings and all turtles from the TurtleScreen.

        No argument.

        Reset empty TurtleScreen to its initial state: white background,
        no backgroundimage, no eventbindings and tracing on.

        Example (for a TurtleScreen instance named screen):
        >>> screen.clear()

        Note: this method is not available as function.
        rr�allr�r�r�rr�)r�r��N)r�r�r�rIru�_bgpic�
_bgpicname�_tracing�_updatecounter�_turtlesrrRrr�rr�_pen)r��btnr�r�r�r�r5�s 




zTurtleScreen.clearNcCs||dkr|jS|��}|dkr*td|��||_|dkrp|�|jd|jd|jd|jd�d|_|_|��dS)ahSet turtle-mode ('standard', 'logo' or 'world') and perform reset.

        Optional argument:
        mode -- one of the strings 'standard', 'logo' or 'world'

        Mode 'standard' is compatible with turtle.py.
        Mode 'logo' is compatible with most Logo-Turtle-Graphics.
        Mode 'world' uses userdefined 'worldcoordinates'. *Attention*: in
        this mode angles appear distorted if x/y unit-ratio doesn't equal 1.
        If mode is not given, return the current mode.

             Mode      Initial turtle heading     positive angles
         ------------|-------------------------|-------------------
          'standard'    to the right (east)       counterclockwise
            'logo'        upward    (north)         clockwise

        Examples:
        >>> mode('logo')   # resets turtle heading to north
        >>> mode()
        'logo'
        N�r��logo�worldzNo turtle-graphics-mode %s)r�r�r�r�)	r�r�r�r�r�r�r4r5r`�r�rr�r�r�rs�zTurtleScreen.modecCs�|��dkr|�d�t||�}t||�}|��\}}|�|d|d�|j|j}	}
|j||_|j||_||j}||j}|j|}
|j|}|�|||
|�|�	|j|	|j|
�|�
�dS)asSet up a user defined coordinate-system.

        Arguments:
        llx -- a number, x-coordinate of lower left corner of canvas
        lly -- a number, y-coordinate of lower left corner of canvas
        urx -- a number, x-coordinate of upper right corner of canvas
        ury -- a number, y-coordinate of upper right corner of canvas

        Set up user coodinat-system and switch to mode 'world' if necessary.
        This performs a screen.reset. If mode 'world' is already active,
        all drawings are redrawn according to the new coordinates.

        But ATTENTION: in user-defined coordinatesystems angles may appear
        distorted. (see Screen.mode())

        Example (for a TurtleScreen instance named screen):
        >>> screen.setworldcoordinates(-10,-0.5,50,1.5)
        >>> for _ in range(36):
        ...     left(10)
        ...     forward(0.5)
        r��N)rr�r�r%r4r5r�r�r�r�r,)r�ZllxZllyZurxZuryZxspanZyspanZwxZwyZ	oldxscaleZ	oldyscaler�r�r�r�r�r�r�r'-s 



z TurtleScreen.setworldcoordinatescCsT|dkr2|���d�r(td|�|��}qFtd��nt|t�rFtd|�}||j|<dS)a�Adds a turtle shape to TurtleScreen's shapelist.

        Arguments:
        (1) name is the name of a gif-file and shape is None.
            Installs the corresponding image shape.
            !! Image-shapes DO NOT rotate when turning the turtle,
            !! so they do not display the heading of the turtle!
        (2) name is an arbitrary string and shape is a tuple
            of pairs of coordinates. Installs the corresponding
            polygon shape
        (3) name is an arbitrary string and shape is a
            (compound) Shape object. Installs the corresponding
            compound shape.
        To use a shape, you have to issue the command shape(shapename).

        call: register_shape("turtle.gif")
        --or: register_shape("tri", ((0,0), (10,10), (-10,10)))

        Example (for a TurtleScreen instance named screen):
        >>> screen.register_shape("triangle", ((5,-3),(0,5),(-5,-3)))

        Nr�rtz;Bad arguments for register_shape.
Use  help(register_shape)r�)r�r�rr2r�r�r�r�)r��namerkr�r�r�r#Ts


zTurtleScreen.register_shapec	Cst|�dkr|d}t|t�rD|�|�s0|dkr4|Stdt|���z|\}}}Wn(ttfk
rztdt|���YnX|jdkr�dd�|||fD�\}}}d|kr�d	kr�nn.d|kr�d	kr�nnd|kr�d	ks�ntd
t|���d|||fS)aReturn color string corresponding to args.

        Argument may be a string or a tuple of three
        numbers corresponding to actual colormode,
        i.e. in the range 0<=n<=colormode.

        If the argument doesn't represent a color,
        an error is raised.
        r�rr�zbad color string: %s�bad color arguments: %sr�cSsg|]}td|��qS�g�o@��round�r{r�r�r�r�r~�sz*TurtleScreen._colorstr.<locals>.<listcomp>��bad color sequence: %s�
#%02x%02x%02x)r�r�r�rOr��	TypeErrorr�r�)r�r9r��g�br�r�r��	_colorstrws


FzTurtleScreen._colorstrcsx��d�s�St��dkr.�fdd�dD�}n4t��dkrV�fdd��dd�D�}ntd	���t�fd
d�|D��S)Nr�r�cs"g|]}t�||d�d��qS)r�r��r�rz��cstrr�r�r~�sz'TurtleScreen._color.<locals>.<listcomp>)r�r�r�r�csg|]}dt�|d��qS)r�r�)r{r7r�r�r�r~�sr�zbad colorstring: %sc3s|]}|�jdVqdS)r�N)r�)r{r�r�r�r��	<genexpr>�sz&TurtleScreen._color.<locals>.<genexpr>)r�r�r�r�)r�r�rBr�)r�r�r��_color�s
zTurtleScreen._colorcCs8|dkr|jS|dkr"t|�|_n|dkr4t|�|_dS)aqReturn the colormode or set it to 1.0 or 255.

        Optional argument:
        cmode -- one of the values 1.0 or 255

        r, g, b values of colortriples have to be in range 0..cmode.

        Example (for a TurtleScreen instance named screen):
        >>> screen.colormode()
        1.0
        >>> screen.colormode(255)
        >>> pencolor(240,160,80)
        Nr�r�)r�r�r�)r�Zcmoder�r�r�r�szTurtleScreen.colormodecCs$|jD]}|�|j�|��qdS)z�Reset all Turtles on the Screen to their initial state.

        No argument.

        Example (for a TurtleScreen instance named screen):
        >>> screen.reset()
        N)r��_setmoder�r`)r�r�r�r�r�r`�s
zTurtleScreen.resetcCs|jS)z�Return the list of turtles on the screen.

        Example (for a TurtleScreen instance named screen):
        >>> screen.turtles()
        [<turtle.Turtle object at 0x00E11FB0>]
        )r�r�r�r�r�r+�szTurtleScreen.turtlescGs4|r|�|�}nd}|�|�}|dk	r0|�|�}|S)a�Set or return backgroundcolor of the TurtleScreen.

        Arguments (if given): a color string or three numbers
        in the range 0..colormode or a 3-tuple of such numbers.

        Example (for a TurtleScreen instance named screen):
        >>> screen.bgcolor("orange")
        >>> screen.bgcolor()
        'orange'
        >>> screen.bgcolor(0.5,0,0.5)
        >>> screen.bgcolor()
        '#800080'
        N)r�rPr��r�rr9r�r�r�r�s

zTurtleScreen.bgcolorcCsB|dkr|jSt|�|_d|_|dk	r0t|�|_|jr>|��dS)aeTurns turtle animation on/off and set delay for update drawings.

        Optional arguments:
        n -- nonnegative  integer
        delay -- nonnegative  integer

        If n is given, only each n-th regular screen update is really performed.
        (Can be used to accelerate the drawing of complex graphics.)
        Second arguments sets delay value (see RawTurtle.delay())

        Example (for a TurtleScreen instance named screen):
        >>> screen.tracer(8, 25)
        >>> dist = 2
        >>> for i in range(200):
        ...     fd(dist)
        ...     rt(90)
        ...     dist += 2
        Nr)r�r�r�r�r,)r��nrr�r�r�r*�s

zTurtleScreen.tracercCs|dkr|jSt|�|_dS)z� Return or set the drawing delay in milliseconds.

        Optional argument:
        delay -- positive integer

        Example (for a TurtleScreen instance named screen):
        >>> screen.delay(15)
        >>> screen.delay()
        15
        N)r�r�rLr�r�r�r�szTurtleScreen.delaycCs<tjsdt_t�|jdkr8|jd7_|j|j;_dS)zIncrement update counter.Trr�N)r�_RUNNINGr�r�r�r�r�r�r��
_incrementudc	s
zTurtleScreen._incrementudccCs<|j}d|_|��D]}|��|��q||_|��dS)z'Perform a TurtleScreen update.
        TN)r�r+�_update_data�_drawturtlerJ)r��tracingrqr�r�r�r,s
zTurtleScreen.updatecCs|��dS)z� Return the width of the turtle window.

        Example (for a TurtleScreen instance named screen):
        >>> screen.window_width()
        640
        r�r�r�r�r�r�r.szTurtleScreen.window_widthcCs|��dS)z� Return the height of the turtle window.

        Example (for a TurtleScreen instance named screen):
        >>> screen.window_height()
        480
        r�r�r�r�r�r�r-&szTurtleScreen.window_heightcCs|jS)z�Return the Canvas of this TurtleScreen.

        No argument.

        Example (for a Screen instance named screen):
        >>> cv = screen.getcanvas()
        >>> cv
        <turtle.ScrolledCanvas instance at 0x010742D8>
        )r.r�r�r�r�r/s
zTurtleScreen.getcanvascCst|j���S)z�Return a list of names of all currently available turtle shapes.

        No argument.

        Example (for a TurtleScreen instance named screen):
        >>> screen.getshapes()
        ['arrow', 'blank', 'circle', ... , 'turtle']
        )�sortedr�r�r�r�r�r�r;s	zTurtleScreen.getshapesr�cCs|�|||�dS)a�Bind fun to mouse-click event on canvas.

        Arguments:
        fun -- a function with two arguments, the coordinates of the
               clicked point on the canvas.
        btn -- the number of the mouse-button, defaults to 1

        Example (for a TurtleScreen instance named screen)

        >>> screen.onclick(goto)
        >>> # Subsequently clicking into the TurtleScreen will
        >>> # make the turtle move to the clicked point.
        >>> screen.onclick(None)
        N)ri�r�r_r�rdr�r�r�rRFszTurtleScreen.onclickcCsF|dkr ||jkr6|j�|�n||jkr6|j�|�|�||�dS)amBind fun to key-release event of key.

        Arguments:
        fun -- a function with no arguments
        key -- a string: key (e.g. "a") or key-symbol (e.g. "space")

        In order to be able to register key-events, TurtleScreen
        must have focus. (See method listen.)

        Example (for a TurtleScreen instance named screen):

        >>> def f():
        ...     fd(50)
        ...     lt(60)
        ...
        >>> screen.onkey(f, "Up")
        >>> screen.listen()

        Subsequently the turtle can be moved by repeatedly pressing
        the up-arrow key, consequently drawing a hexagon

        N)r��remover>rm�r�r_r�r�r�r�rWs

zTurtleScreen.onkeycCsN|dkr ||jkr>|j�|�n|dk	r>||jkr>|j�|�|�||�dS)aBind fun to key-press event of key if key is given,
        or to any key-press-event if no key is given.

        Arguments:
        fun -- a function with no arguments
        key -- a string: key (e.g. "a") or key-symbol (e.g. "space")

        In order to be able to register key-events, TurtleScreen
        must have focus. (See method listen.)

        Example (for a TurtleScreen instance named screen
        and a Turtle instance named turtle):

        >>> def f():
        ...     fd(50)
        ...     lt(60)
        ...
        >>> screen.onkeypress(f, "Up")
        >>> screen.listen()

        Subsequently the turtle can be moved by repeatedly pressing
        the up-arrow key, or by keeping pressed the up-arrow key.
        consequently drawing a hexagon.
        N)r�r�r>rnr�r�r�r�rus
zTurtleScreen.onkeypresscCs|��dS)aSet focus on TurtleScreen (in order to collect key-events)

        No arguments.
        Dummy arguments are provided in order
        to be able to pass listen to the onclick method.

        Example (for a TurtleScreen instance named screen):
        >>> screen.listen()
        N)ro)r��xdummy�ydummyr�r�r�r�s
zTurtleScreen.listenrcCs|�||�dS)a�Install a timer, which calls fun after t milliseconds.

        Arguments:
        fun -- a function with no arguments.
        t -- a number >= 0

        Example (for a TurtleScreen instance named screen):

        >>> running = True
        >>> def f():
        ...     if running:
        ...             fd(50)
        ...             lt(60)
        ...             screen.ontimer(f, 250)
        ...
        >>> f()   # makes the turtle marching around
        >>> running = False
        N)rrrpr�r�r�r"�szTurtleScreen.ontimercCsF|dkr|jS||jkr(|�|�|j|<|�|j|j|�||_dS)aFSet background image or return name of current backgroundimage.

        Optional argument:
        picname -- a string, name of a gif-file or "nopic".

        If picname is a filename, set the corresponding image as background.
        If picname is "nopic", delete backgroundimage, if present.
        If picname is None, return the filename of the current backgroundimage.

        Example (for a TurtleScreen instance named screen):
        >>> screen.bgpic()
        'nopic'
        >>> screen.bgpic("landscape.gif")
        >>> screen.bgpic()
        'landscape.gif'
        N)r�r�r2rxr�)r�Zpicnamer�r�r�r�s
zTurtleScreen.bgpiccCs|�|||�S)a�Resize the canvas the turtles are drawing on.

        Optional arguments:
        canvwidth -- positive integer, new width of canvas in pixels
        canvheight --  positive integer, new height of canvas in pixels
        bg -- colorstring or color-tuple, new backgroundcolor
        If no arguments are given, return current (canvaswidth, canvasheight)

        Do not alter the drawing window. To observe hidden parts of
        the canvas use the scrollbars. (Can make visible those parts
        of a drawing, which were outside the canvas before!)

        Example (for a Turtle instance named turtle):
        >>> turtle.screensize(2000,1500)
        >>> # e.g. to search for an erroneously escaped turtle ;-)
        )r�rr�r�r�r%�szTurtleScreen.screensize)N)N)N)NN)N)r�N)N)NN)r)N)NNN)%r�r�r�r�r�r�r�r5rr'r#r�r�rr`r+rr*rr�r,r.r-rrrRrrrr"rr%r!r$rrr r�r�r�r�r�sH�
(
"'
#
	

			

 



c@sTeZdZdZedd�edd�edd�d�ZdZdZdZefdd	�Z	d
d�Z
dBd
d�Zdd�ZdCdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�ZdDd*d+�Zd,d-�Zd.d/�Zd0d1�ZdEd2d3�ZdFd4d5�Zd6d7�Zd8d9�Z dGd:d;�Z!dHd<d=�Z"dId>d?�Z#dJd@dA�Z$eZ%eZ&eZ'eZ(eZ)eZ*eZ+eZ,e Z-dS)K�
TNavigatorzRNavigation part of the RawTurtle.
    Implements methods for turtle movement.
    r��)r�r�r�r�rr�cCsB|j|_|j|_||_d|_|��d|_|�|�t�	|�dSr�)
�DEFAULT_ANGLEOFFSET�_angleOffset�DEFAULT_ANGLEORIENT�_angleOrientr��
undobufferr:r�r�r`r�r�r�r�r��s
zTNavigator.__init__cCstdd�|_tj|j|_dS)zXreset turtle to its initial values

        Will be overwritten by parent class
        r�N)r�	_positionr��START_ORIENTATIONr��_orientr�r�r�r�r`�szTNavigator.resetNcCsL|dkr|jS|dkrdS||_|dkr6d|_d|_n|jd|_d|_dS)z:Set turtle-mode to 'standard', 'world' or 'logo'.
        Nr�)r�r�rr��@r�)r�rr�_fullcircler�r�r�r�r�szTNavigator._setmodecCs0||_d||_|jdkr"d|_n
|d|_dS)z+Helper function for degrees() and radians()ihr�rrN)r�
_degreesPerAUr�r�r�Z
fullcircler�r�r��_setDegreesPerAUs


zTNavigator._setDegreesPerAU��v@cCs|�|�dS)a> Set angle measurement units to degrees.

        Optional argument:
        fullcircle -  a number

        Set angle measurement units, i. e. set number
        of 'degrees' for a full circle. Default value is
        360 degrees.

        Example (for a Turtle instance named turtle):
        >>> turtle.left(90)
        >>> turtle.heading()
        90

        Change angle measurement unit to grad (also known as gon,
        grade, or gradian and equals 1/100-th of the right angle.)
        >>> turtle.degrees(400.0)
        >>> turtle.heading()
        100

        N)rr
r�r�r�r:szTNavigator.degreescCs|�dtj�dS)a Set the angle measurement units to radians.

        No arguments.

        Example (for a Turtle instance named turtle):
        >>> turtle.heading()
        90
        >>> turtle.radians()
        >>> turtle.heading()
        1.5707963267948966
        r�N)rr�r�r�r�r�r�r^5szTNavigator.radianscCs|j|j|}|�|�dS)z)move turtle forward by specified distanceN)rr�_goto)r�r;Zender�r�r��_goCszTNavigator._gocCs||j9}|j�|�|_dS)z=Turn turtle counterclockwise by specified angle if angle > 0.N)r	rr��r�r�r�r�r��_rotateHs
zTNavigator._rotatecCs
||_dS)zmove turtle to position end.N�r)r��endr�r�r�r
MszTNavigator._gotocCs|�|�dS)aMove the turtle forward by the specified distance.

        Aliases: forward | fd

        Argument:
        distance -- a number (integer or float)

        Move the turtle forward by the specified distance, in the direction
        the turtle is headed.

        Example (for a Turtle instance named turtle):
        >>> turtle.position()
        (0.00, 0.00)
        >>> turtle.forward(25)
        >>> turtle.position()
        (25.00,0.00)
        >>> turtle.forward(-75)
        >>> turtle.position()
        (-50.00,0.00)
        N�r�r�r;r�r�r�rCQszTNavigator.forwardcCs|�|�dS)a�Move the turtle backward by distance.

        Aliases: back | backward | bk

        Argument:
        distance -- a number

        Move the turtle backward by distance, opposite to the direction the
        turtle is headed. Do not change the turtle's heading.

        Example (for a Turtle instance named turtle):
        >>> turtle.position()
        (0.00, 0.00)
        >>> turtle.backward(30)
        >>> turtle.position()
        (-30.00, 0.00)
        Nrrr�r�r�r/hszTNavigator.backcCs|�|�dS)a�Turn turtle right by angle units.

        Aliases: right | rt

        Argument:
        angle -- a number (integer or float)

        Turn turtle right by angle units. (Units are by default degrees,
        but can be set via the degrees() and radians() functions.)
        Angle orientation depends on mode. (See this.)

        Example (for a Turtle instance named turtle):
        >>> turtle.heading()
        22.0
        >>> turtle.right(45)
        >>> turtle.heading()
        337.0
        N�rrr�r�r�r_|szTNavigator.rightcCs|�|�dS)a�Turn turtle left by angle units.

        Aliases: left | lt

        Argument:
        angle -- a number (integer or float)

        Turn turtle left by angle units. (Units are by default degrees,
        but can be set via the degrees() and radians() functions.)
        Angle orientation depends on mode. (See this.)

        Example (for a Turtle instance named turtle):
        >>> turtle.heading()
        22.0
        >>> turtle.left(45)
        >>> turtle.heading()
        67.0
        Nrrr�r�r�rP�szTNavigator.leftcCs|jS)z�Return the turtle's current location (x,y), as a Vec2D-vector.

        Aliases: pos | position

        No arguments.

        Example (for a Turtle instance named turtle):
        >>> turtle.pos()
        (0.00, 240.00)
        rr�r�r�r�r[�szTNavigator.poscCs
|jdS)z� Return the turtle's x coordinate.

        No arguments.

        Example (for a Turtle instance named turtle):
        >>> reset()
        >>> turtle.left(60)
        >>> turtle.forward(100)
        >>> print turtle.xcor()
        50.0
        rrr�r�r�r�r|�szTNavigator.xcorcCs
|jdS)a	 Return the turtle's y coordinate
        ---
        No arguments.

        Example (for a Turtle instance named turtle):
        >>> reset()
        >>> turtle.left(60)
        >>> turtle.forward(100)
        >>> print turtle.ycor()
        86.6025403784
        r�rr�r�r�r�r}�szTNavigator.ycorcCs,|dkr|�t|��n|�t||��dS)atMove turtle to an absolute position.

        Aliases: setpos | setposition | goto:

        Arguments:
        x -- a number      or     a pair/vector of numbers
        y -- a number             None

        call: goto(x, y)         # two coordinates
        --or: goto((x, y))       # a pair (tuple) of coordinates
        --or: goto(vec)          # e.g. as returned by pos()

        Move turtle to an absolute position. If the pen is down,
        a line will be drawn. The turtle's orientation does not change.

        Example (for a Turtle instance named turtle):
        >>> tp = turtle.pos()
        >>> tp
        (0.00, 0.00)
        >>> turtle.setpos(60,30)
        >>> turtle.pos()
        (60.00,30.00)
        >>> turtle.setpos((20,80))
        >>> turtle.pos()
        (20.00,80.00)
        >>> turtle.setpos(tp)
        >>> turtle.pos()
        (0.00,0.00)
        N)r
r)r�r�r�r�r�r�rI�szTNavigator.gotocCs|�dd�|�d�dS)a$Move turtle to the origin - coordinates (0,0).

        No arguments.

        Move turtle to the origin - coordinates (0,0) and set its
        heading to its start-orientation (which depends on mode).

        Example (for a Turtle instance named turtle):
        >>> turtle.home()
        rN)rIrdr�r�r�r�rL�szTNavigator.homecCs|�t||jd��dS)a�Set the turtle's first coordinate to x

        Argument:
        x -- a number (integer or float)

        Set the turtle's first coordinate to x, leave second coordinate
        unchanged.

        Example (for a Turtle instance named turtle):
        >>> turtle.position()
        (0.00, 240.00)
        >>> turtle.setx(10)
        >>> turtle.position()
        (10.00, 240.00)
        r�N�r
rr)r�r�r�r�r�riszTNavigator.setxcCs|�t|jd|��dS)a�Set the turtle's second coordinate to y

        Argument:
        y -- a number (integer or float)

        Set the turtle's first coordinate to x, second coordinate remains
        unchanged.

        Example (for a Turtle instance named turtle):
        >>> turtle.position()
        (0.00, 40.00)
        >>> turtle.sety(-10)
        >>> turtle.position()
        (0.00, -10.00)
        rNr)r�r�r�r�r�rjszTNavigator.setycCsT|dk	rt||�}t|t�r"|}n$t|t�r6t|�}nt|t�rF|j}t||j�S)a�Return the distance from the turtle to (x,y) in turtle step units.

        Arguments:
        x -- a number   or  a pair/vector of numbers   or   a turtle instance
        y -- a number       None                            None

        call: distance(x, y)         # two coordinates
        --or: distance((x, y))       # a pair (tuple) of coordinates
        --or: distance(vec)          # e.g. as returned by pos()
        --or: distance(mypen)        # where mypen is another turtle

        Example (for a Turtle instance named turtle):
        >>> turtle.pos()
        (0.00, 0.00)
        >>> turtle.distance(30,40)
        50.0
        >>> pen = Turtle()
        >>> pen.forward(77)
        >>> turtle.distance(pen)
        77.0
        N)rr�r�r�r�abs)r�r�r�r[r�r�r�r;%s




zTNavigator.distancecCs�|dk	rt||�}t|t�r"|}n$t|t�r6t|�}nt|t�rF|j}||j\}}tt�||�dtjd�d}||j	}|j
|j||jS)aCReturn the angle of the line from the turtle's position to (x, y).

        Arguments:
        x -- a number   or  a pair/vector of numbers   or   a turtle instance
        y -- a number       None                            None

        call: distance(x, y)         # two coordinates
        --or: distance((x, y))       # a pair (tuple) of coordinates
        --or: distance(vec)          # e.g. as returned by pos()
        --or: distance(mypen)        # where mypen is another turtle

        Return the angle, between the line from turtle-position to position
        specified by x, y and the turtle's start orientation. (Depends on
        modes - "standard" or "logo")

        Example (for a Turtle instance named turtle):
        >>> turtle.pos()
        (10.00, 10.00)
        >>> turtle.towards(0,0)
        225.0
        Nr�r�r)
rr�r�r�rr�r��atan2r�r	rrr)r�r�r�r[�resultr�r�r�ruEs




 
zTNavigator.towardscCsJ|j\}}tt�||�dtjd�d}||j}|j|j||jS)z� Return the turtle's current heading.

        No arguments.

        Example (for a Turtle instance named turtle):
        >>> turtle.left(67)
        >>> turtle.heading()
        67.0
        r�r�r)	rr�r�rr�r	rrr)r�r�r�rr�r�r�rJhs

 
zTNavigator.headingcCs>||��|j}|j}||d||d}|�|�dS)a�Set the orientation of the turtle to to_angle.

        Aliases:  setheading | seth

        Argument:
        to_angle -- a number (integer or float)

        Set the orientation of the turtle to to_angle.
        Here are some common directions in degrees:

         standard - mode:          logo-mode:
        -------------------|--------------------
           0 - east                0 - north
          90 - north              90 - east
         180 - west              180 - south
         270 - south             270 - west

        Example (for a Turtle instance named turtle):
        >>> turtle.setheading(90)
        >>> turtle.heading()
        90
        �@N)rJrrr)r�Zto_angler�Zfullr�r�r�rdwszTNavigator.setheadingcCsp|jr|j�dg�d|j_|��}|dkr2|j}|dkrjt|�|j}dttdt|�dd�|�}d||}d	|}d
|t�	|tj
d|j�}|dkr�|||}}}|��}	|�
�}
|dkr�|�dd�n
|�d�|�|�t|�D].}|�|�|�|�|�d�|�|��q|�|�|dk�rR|�|	|
�|�|�|j�rld
|j_dS)a� Draw a circle with given radius.

        Arguments:
        radius -- a number
        extent (optional) -- a number
        steps (optional) -- an integer

        Draw a circle with given radius. The center is radius units left
        of the turtle; extent - an angle - determines which part of the
        circle is drawn. If extent is not given, draw the entire circle.
        If extent is not a full circle, one endpoint of the arc is the
        current pen position. Draw the arc in counterclockwise direction
        if radius is positive, otherwise in clockwise direction. Finally
        the direction of the turtle is changed by the amount of extent.

        As the circle is approximated by an inscribed regular polygon,
        steps determines the number of steps to use. If not given,
        it will be calculated automatically. Maybe used to draw regular
        polygons.

        call: circle(radius)                  # full circle
        --or: circle(radius, extent)          # arc
        --or: circle(radius, extent, steps)
        --or: circle(radius, steps=6)         # 6-sided polygon

        Example (for a Turtle instance named turtle):
        >>> turtle.circle(50)
        >>> turtle.circle(120, 180)  # semicircle
        �seqTNr��g@g�M@r�r�rr�rF)rr�r�rprrr��minr�r�r�r	�_tracerrMrrr)r��radiusZextent�stepsrpZfracr6Zw2�lZtrZdlr|r�r�r�r4�s>""






zTNavigator.circlecCsdS�z/dummy method - to be overwritten by child classNr�)r�r�r�r�r�rp�szTNavigator.speedcCsdSr"r�)r��ar�r�r�r�r�szTNavigator._tracercCsdSr"r�)r�r�r�r�r�rM�szTNavigator._delay)N)r)N)N)N)NN)r)NN)N).r�r�r�r�rrZDEFAULT_MODEr�rr�r`r�rr:r^rrr
rCr/r_rPr[r|r}rIrLrirjr;rurJrdr4rprrMr@r3r0rbrQr\rerfrcr�r�r�r�r��sZ�

	


#
 
#
A


r�c@s�eZdZdZedfdd�Zededfdd�Zd.d
d�Zd/dd
�Zdd�Z	dd�Z
dd�Zd0dd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd1d"d#�Zd2d%d&�Zd3d(d)�Zd*d+�Zd,d-�ZeZe	Ze	Ze
Ze
ZeZeZd	S)4�TPenzFDrawing part of the RawTurtle.
    Implements drawing properties.
    racCs||_d|_t�|�dSr�)�_resizemoderr$�_reset)r�rar�r�r�r��sz
TPen.__init__rWrAcCsFd|_d|_||_||_d|_d|_d|_d|_d|_d|_	d|_
dS)Nr�Tr�)r�r�r�)r�r�r�r�)�_pensize�_shown�	_pencolor�
_fillcolor�_drawing�_speed�_stretchfactor�_shearfactor�_tilt�_shapetrafo�
_outlinewidth)r�rWrAr�r�r�r&�szTPen._resetNcCs.|dkr|jS|��}|dkr*|j|d�dS)azSet resizemode to one of the values: "auto", "user", "noresize".

        (Optional) Argument:
        rmode -- one of the strings "auto", "user", "noresize"

        Different resizemodes have the following effects:
          - "auto" adapts the appearance of the turtle
                   corresponding to the value of pensize.
          - "user" adapts the appearance of the turtle according to the
                   values of stretchfactor and outlinewidth (outline),
                   which are set by shapesize()
          - "noresize" no adaption of the turtle's appearance takes place.
        If no argument is given, return current resizemode.
        resizemode("user") is called by a call of shapesize with arguments.


        Examples (for a Turtle instance named turtle):
        >>> turtle.resizemode("noresize")
        >>> turtle.resizemode()
        'noresize'
        N)�auto�userr��ra)r%r�rV)r�Zrmoder�r�r�ra�s
zTPen.resizemodecCs|dkr|jS|j|d�dS)a!Set or return the line thickness.

        Aliases:  pensize | width

        Argument:
        width -- positive number

        Set the line thickness to width or return it. If resizemode is set
        to "auto" and turtleshape is a polygon, that polygon is drawn with
        the same line thickness. If no argument is given, current pensize
        is returned.

        Example (for a Turtle instance named turtle):
        >>> turtle.pensize()
        1
        >>> turtle.pensize(10)   # from here on lines of width 10 are drawn
        N)rY)r'rV)r�rzr�r�r�rYszTPen.pensizecCs|js
dS|jdd�dS)z�Pull the pen up -- no drawing when moving.

        Aliases: penup | pu | up

        No argument

        Example (for a Turtle instance named turtle):
        >>> turtle.penup()
        NF�rX�r+rVr�r�r�r�rZ0s
z
TPen.penupcCs|jr
dS|jdd�dS)z�Pull the pen down -- drawing when moving.

        Aliases: pendown | pd | down

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.pendown()
        NTr5r6r�r�r�r�rX>s
zTPen.pendowncCs|jS)aReturn True if pen is down, False if it's up.

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.penup()
        >>> turtle.isdown()
        False
        >>> turtle.pendown()
        >>> turtle.isdown()
        True
        )r+r�r�r�r�rNLs
zTPen.isdowncCsjdddddd�}|dkr|jS||kr0||}n*d|krDd	krVnntt|��}nd}|j|d
�dS)a� Return or set the turtle's speed.

        Optional argument:
        speed -- an integer in the range 0..10 or a speedstring (see below)

        Set the turtle's speed to an integer value in the range 0 .. 10.
        If no argument is given: return current speed.

        If input is a number greater than 10 or smaller than 0.5,
        speed is set to 0.
        Speedstrings  are mapped to speedvalues in the following way:
            'fastest' :  0
            'fast'    :  10
            'normal'  :  6
            'slow'    :  3
            'slowest' :  1
        speeds from 1 to 10 enforce increasingly faster animation of
        line drawing and turtle turning.

        Attention:
        speed = 0 : *no* animation takes place. forward/back makes turtle jump
        and likewise left/right make the turtle turn instantly.

        Example (for a Turtle instance named turtle):
        >>> turtle.speed(3)
        rr�r�r�r�)ZfastestZfast�normalZslowZslowestNr�g%@)rp)r,r�r�rV)r�rpZspeedsr�r�r�rp[s
z
TPen.speedcGs�|rht|�}|dkr"|d}}n"|dkr4|\}}n|dkrD|}}|�|�}|�|�}|j||d�n|�|j�|�|j�fSdS)a�Return or set the pencolor and fillcolor.

        Arguments:
        Several input formats are allowed.
        They use 0, 1, 2, or 3 arguments as follows:

        color()
            Return the current pencolor and the current fillcolor
            as a pair of color specification strings as are returned
            by pencolor and fillcolor.
        color(colorstring), color((r,g,b)), color(r,g,b)
            inputs as in pencolor, set both, fillcolor and pencolor,
            to the given value.
        color(colorstring1, colorstring2),
        color((r1,g1,b1), (r2,g2,b2))
            equivalent to pencolor(colorstring1) and fillcolor(colorstring2)
            and analogously, if the other input format is used.

        If turtleshape is a polygon, outline and interior of that polygon
        is drawn with the newly set colors.
        For more info see: pencolor, fillcolor

        Example (for a Turtle instance named turtle):
        >>> turtle.color('red', 'green')
        >>> turtle.color()
        ('red', 'green')
        >>> colormode(255)
        >>> color((40, 80, 120), (160, 200, 240))
        >>> color()
        ('#285078', '#a0c8f0')
        r�rr�r�)rWrAN)r�r�rVr�r)r*)r�rr!ZpcolorZfcolorr�r�r�r9�s 


z
TPen.colorcGs:|r*|�|�}||jkrdS|j|d�n|�|j�SdS)aZ Return or set the pencolor.

        Arguments:
        Four input formats are allowed:
          - pencolor()
            Return the current pencolor as color specification string,
            possibly in hex-number format (see example).
            May be used as input to another color/pencolor/fillcolor call.
          - pencolor(colorstring)
            s is a Tk color specification string, such as "red" or "yellow"
          - pencolor((r, g, b))
            *a tuple* of r, g, and b, which represent, an RGB color,
            and each of r, g, and b are in the range 0..colormode,
            where colormode is either 1.0 or 255
          - pencolor(r, g, b)
            r, g, and b represent an RGB color, and each of r, g, and b
            are in the range 0..colormode

        If turtleshape is a polygon, the outline of that polygon is drawn
        with the newly set pencolor.

        Example (for a Turtle instance named turtle):
        >>> turtle.pencolor('brown')
        >>> tup = (0.2, 0.8, 0.55)
        >>> turtle.pencolor(tup)
        >>> turtle.pencolor()
        '#33cc8c'
        N)rW)r�r)rVr�r�r�r�r�rW�s

z
TPen.pencolorcGs:|r*|�|�}||jkrdS|j|d�n|�|j�SdS)a] Return or set the fillcolor.

        Arguments:
        Four input formats are allowed:
          - fillcolor()
            Return the current fillcolor as color specification string,
            possibly in hex-number format (see example).
            May be used as input to another color/pencolor/fillcolor call.
          - fillcolor(colorstring)
            s is a Tk color specification string, such as "red" or "yellow"
          - fillcolor((r, g, b))
            *a tuple* of r, g, and b, which represent, an RGB color,
            and each of r, g, and b are in the range 0..colormode,
            where colormode is either 1.0 or 255
          - fillcolor(r, g, b)
            r, g, and b represent an RGB color, and each of r, g, and b
            are in the range 0..colormode

        If turtleshape is a polygon, the interior of that polygon is drawn
        with the newly set fillcolor.

        Example (for a Turtle instance named turtle):
        >>> turtle.fillcolor('violet')
        >>> col = turtle.pencolor()
        >>> turtle.fillcolor(col)
        >>> turtle.fillcolor(0, .5, 0)
        N)rA)r�r*rVr�r�r�r�r�rA�s

zTPen.fillcolorcCs|jdd�dS)z�Makes the turtle visible.

        Aliases: showturtle | st

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.hideturtle()
        >>> turtle.showturtle()
        T��shownN�rVr�r�r�r�ro�szTPen.showturtlecCs|jdd�dS)aYMakes the turtle invisible.

        Aliases: hideturtle | ht

        No argument.

        It's a good idea to do this while you're in the
        middle of a complicated drawing, because hiding
        the turtle speeds up the drawing observably.

        Example (for a Turtle instance named turtle):
        >>> turtle.hideturtle()
        Fr8Nr:r�r�r�r�rK	szTPen.hideturtlecCs|jS)z�Return True if the Turtle is shown, False if it's hidden.

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.hideturtle()
        >>> print turtle.isvisible():
        False
        )r(r�r�r�r�rO	s
zTPen.isvisiblecKs�|j|j|j|j|j|j|j|j|j|j	|j
d�}|s>|s>|St|t�rN|}ni}|�
|�i}|D]}||||<qd|jr�|j�d|f�d}d|kr�|j|dkr�d}d|kr�t|dt�r�|�|df�|d<|j|dkr�d}d|k�r|j|dk�rd}|�r|��d|k�r&|d|_d|k�r:|d|_d|k�rN|d|_d|k�r�t|dt��r||�|df�|d<|d|_d	|k�r�|d	|_d
|k�r�|d
|_d|k�r�|d}t|ttf��r�||f}||_d|k�r�|d|_d
|k�r|d
|_	d|k�r|d|_d|k�r.|d|_
d|k�sLd|k�sLd|k�r�|j\}	}
|j}t�|j
�t�|j
�}}
|	|
|
||
||	||
|
||f|_|��dS)aLReturn or set the pen's attributes.

        Arguments:
            pen -- a dictionary with some or all of the below listed keys.
            **pendict -- one or more keyword-arguments with the below
                         listed keys as keywords.

        Return or set the pen's attributes in a 'pen-dictionary'
        with the following key/value pairs:
           "shown"      :   True/False
           "pendown"    :   True/False
           "pencolor"   :   color-string or color-tuple
           "fillcolor"  :   color-string or color-tuple
           "pensize"    :   positive number
           "speed"      :   number in range 0..10
           "resizemode" :   "auto" or "user" or "noresize"
           "stretchfactor": (positive number, positive number)
           "shearfactor":   number
           "outline"    :   positive number
           "tilt"       :   number

        This dictionary can be used as argument for a subsequent
        pen()-call to restore the former pen-state. Moreover one
        or more of these attributes can be provided as keyword-arguments.
        This can be used to set several pen attributes in one statement.


        Examples (for a Turtle instance named turtle):
        >>> turtle.pen(fillcolor="black", pencolor="red", pensize=10)
        >>> turtle.pen()
        {'pensize': 10, 'shown': True, 'resizemode': 'auto', 'outline': 1,
        'pencolor': 'red', 'pendown': True, 'fillcolor': 'black',
        'stretchfactor': (1,1), 'speed': 3, 'shearfactor': 0.0}
        >>> penstate=turtle.pen()
        >>> turtle.color("yellow","")
        >>> turtle.penup()
        >>> turtle.pen()
        {'pensize': 10, 'shown': True, 'resizemode': 'auto', 'outline': 1,
        'pencolor': 'yellow', 'pendown': False, 'fillcolor': '',
        'stretchfactor': (1,1), 'speed': 3, 'shearfactor': 0.0}
        >>> p.pen(penstate, fillcolor="green")
        >>> p.pen()
        {'pensize': 10, 'shown': True, 'resizemode': 'auto', 'outline': 1,
        'pencolor': 'red', 'pendown': True, 'fillcolor': 'green',
        'stretchfactor': (1,1), 'speed': 3, 'shearfactor': 0.0}
        )r9rXrWrArYrpra�
stretchfactorrnr9rsrVFrXTrWrYrArprar;rnr9r9rsN)r(r+r)r*r'r,r%r-r.r1r/r��dictr,rr�r�r��_newLiner�r�r�r�r�r0rJ)r�rVZpendictZ_pd�pZ_p_bufr�ZnewLineZsfZscxZscyZshf�sa�car�r�r�rV!	s�/�

























�zTPen.penTcCsdSr"r��r�ZusePosr�r�r�r=�	sz
TPen._newLineFcCsdSr"r�)r�r�Zforcedr�r�r�rJ�	szTPen._updatecCsdSr"r�rr�r�r�r��	szTPen._colorcCsdSr"r�rr�r�r�r��	szTPen._colorstr)N)N)N)N)T)TF)r�r�r�r�r�r�r&rarYrZrXrNrpr9rWrArorKrOrVr=rJr�r�rzryr]rUr=rqrMr�r�r�r�r$�s:�



&.%$



r$c@s eZdZdZdd�Zdd�ZdS)�_TurtleImagez6Helper class: Datatype to store Turtle attributes
    cCs||_d|_|�|�dSr�)r�ry�	_setshape)r�r��
shapeIndexr�r�r�r��	sz_TurtleImage.__init__cs�|j�||_|jdkr*�j|jkr2nndS|jdkrP�j|jkrXnndS|jdkrp��|j�n |jdkr�|jD]}��|�q��j|j|_|jdkr����|_nF|jdkrԈ��jdj�|_n&|jdkr��fdd��j|jD�|_dS)Nr�rt)rtr�r�r/csg|]}����qSr��r:�r{rH�r�r�r�r~�	sz*_TurtleImage._setshape.<locals>.<listcomp>)	r�rDryr�rI�_itemr:rur�)r�rDrHr�rGr�rC�	s(""







�z_TurtleImage._setshapeN)r�r�r�r�r�rCr�r�r�r�rB�	srBc@s�eZdZdZgZdedededfdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dmdd�Zdd�Zdd�Zdd�Zdd�Zdnd d!�Zdod"d#�Zdpd$d%�Zd&d'�Zdqd(d)�Zd*d+�Zdrd,d-�Zd.d/�Zd0d1�Zdsd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z dtd=d>�Z!d?d@�Z"dAdB�Z#dCdD�Z$dudFdG�Z%dHdI�Z&dJdK�Z'dLdM�Z(dvdNdO�Z)dPdQ�Z*dwdTdU�Z+dVdW�Z,dXdY�Z-dZd[�Z.d\d]�Z/d^d_�Z0e0Z1dxd`da�Z2dydcdd�Z3dzdedf�Z4d{dgdh�Z5didj�Z6dkdl�Z7eZ8dS)|r
zvAnimation part of the RawTurtle.
    Puts RawTurtle upon a TurtleScreen and provides tools for
    its animation.
    Nrkr�r�cCs4t|t�r||_n|t|t�r:|tjkr2tj�|�||_nTt|ttf�r�tjD]}|j	|krN||_q�qNt|�|_tj�|j�nt
d|��|j}t�||�
��t�|�|j�|�|��|_t||�|_d|_d|_d|_|_||_d|_|��|_|jg|_|jg|_g|_||_t |�|_!|�"�dS)Nzbad canvas argument %sF)#r��_Screenr�rr
�screensr>rr�r.r�r�r�rr$r�rD�drawingLineItemrBr��_poly�
_creatingPoly�	_fillitem�	_fillpathr(�_hidden_from_screen�currentLineItemr�currentLiner��
stampItems�_undobuffersizer�rrJ)r�Zcanvasrkr�r�r�r�r�r�r��	s@











zRawTurtle.__init__cCs0t�|�t�|�|��|��|��dS)a�Delete the turtle's drawings and restore its default values.

        No argument.

        Delete the turtle's drawings from the screen, re-center the turtle
        and set variables to the default values.

        Example (for a Turtle instance named turtle):
        >>> turtle.position()
        (0.00,-22.00)
        >>> turtle.heading()
        100.0
        >>> turtle.reset()
        >>> turtle.position()
        (0.00,0.00)
        >>> turtle.heading()
        0.0
        N)r�r`r$r&�_clearr�rJr�r�r�r�r`
s


zRawTurtle.resetcCs&|dks|dkrd|_n
t|�|_dS)a�Set or disable undobuffer.

        Argument:
        size -- an integer or None

        If size is an integer an empty undobuffer of given size is installed.
        Size gives the maximum number of turtle-actions that can be undone
        by the undo() function.
        If size is None, no undobuffer is present.

        Example (for a Turtle instance named turtle):
        >>> turtle.setundobuffer(42)
        Nr)rr�)r��sizer�r�r�rh
szRawTurtle.setundobuffercCs|jdkrdS|j��S)z�Return count of entries in the undobuffer.

        No argument.

        Example (for a Turtle instance named turtle):
        >>> while undobufferentries():
        ...     undo()
        Nr)rr�r�r�r�r�rx,
s	
zRawTurtle.undobufferentriescCsld|_|_|jD]}|j�|�q|j��|_g|_|jrJ|j�	|j
�|jg|_|��|�|j
�dS)zDelete all of pen's drawingsN)rNrOr�r�rIrDrQrRr+r>rr7rhrTrGr�r�r�rU9
s

zRawTurtle._clearcCs|��|��dS)agDelete the turtle's drawings from the screen. Do not move turtle.

        No arguments.

        Delete the turtle's drawings from the screen. Do not move turtle.
        State and position of the turtle as well as drawings of other
        turtles are not affected.

        Examples (for a Turtle instance named turtle):
        >>> turtle.clear()
        N)rUrJr�r�r�r�r5G
szRawTurtle.clearcCsF|j��|jjdkrdSt|j�dkrB|j�|j|j|j|j�dSr�)	r�r�r�r�rRrErQr)r'r�r�r�r�r�V
s
�zRawTurtle._update_datacCsx|j}|jdkrdS|jdkrD|��|��|��|�|j�n0|��|jdkrt|��D]}|��q^|��dS)z&Perform a Turtle-data update.
        rNr�)	r�r�r�r�rJrMr�r�r+)r�r�rqr�r�r�rJ^
s



zRawTurtle._updatecCs|j�||�S)amTurns turtle animation on/off and set delay for update drawings.

        Optional arguments:
        n -- nonnegative  integer
        delay -- nonnegative  integer

        If n is given, only each n-th regular screen update is really performed.
        (Can be used to accelerate the drawing of complex graphics.)
        Second arguments sets delay value (see RawTurtle.delay())

        Example (for a Turtle instance named turtle):
        >>> turtle.tracer(8, 25)
        >>> dist = 2
        >>> for i in range(200):
        ...     turtle.fd(dist)
        ...     turtle.rt(90)
        ...     dist += 2
        )r�r*)r��flagrr�r�r�rp
szRawTurtle._tracercCs|j�|�Sr�)r�r�rr�r�r�r��
szRawTurtle._colorcCs|j�|�Sr�)r�r�rr�r�r�r��
szRawTurtle._colorstrc	Cs�t|t�r|Sz|\}}}Wn(ttfk
rDtdt|���YnX|jjdkrldd�|||fD�\}}}d|kr�dkr�nn.d|kr�dkr�nnd|kr�dks�ntdt|���d|||fS)	z,Convert colortriples to hexstrings.
        r�r�cSsg|]}td|��qSr�r�r�r�r�r�r~�
sz!RawTurtle._cc.<locals>.<listcomp>rr�r�r�)r�r�r�r�r�r�r�)r�rr�r�r�r�r�r��_cc�
s
Fz
RawTurtle._cccs�|j�|�|j�|j}d|_d|_t|�}�|_||_�|_t�|jj�|_�j�|��j	|jjj
}|dkr����|j_nJ|dkr���
�j	dj�|j_n*|dkrʇfdd��j	|jjjD�|j_���|_|��|S)aCreate and return a clone of the turtle.

        No argument.

        Create and return a clone of the turtle with same position, heading
        and turtle properties.

        Example (for a Turtle instance named mick):
        mick = Turtle()
        joe = mick.clone()
        Nr�rtr/r�csg|]}����qSr�rErFrGr�r�r~�
sz#RawTurtle.clone.<locals>.<listcomp>)r�r=r+r�rrBrDr�r>r�ryr:rHrur�rDrQrJ)r�r��q�ttyper�rGr�r8�
s.
�

zRawTurtle.clonecCsB|dkr|jjS||j��kr*td|��|j�|�|��dS)a�Set turtle shape to shape with given name / return current shapename.

        Optional argument:
        name -- a string, which is a valid shapename

        Set turtle shape to shape with given name or, if name is not given,
        return name of current shape.
        Shape with name must exist in the TurtleScreen's shape dictionary.
        Initially there are the following polygon shapes:
        'arrow', 'turtle', 'circle', 'square', 'triangle', 'classic'.
        To learn about how to deal with shapes see Screen-method register_shape.

        Example (for a Turtle instance named turtle):
        >>> turtle.shape()
        'arrow'
        >>> turtle.shape("turtle")
        >>> turtle.shape()
        'turtle'
        NzThere is no shape named %s)r�rDr�rr�rCrJ)r�r�r�r�r�rk�
szRawTurtle.shapecCs�||kr|krdkr8nn|j\}}|||jfS|dksH|dkrPtd��|dk	rt|dkrj||f}q�||f}n|dk	r�|jd|f}n|j}|dkr�|j}|jd||d�dS)aOSet/return turtle's stretchfactors/outline. Set resizemode to "user".

        Optional arguments:
           stretch_wid : positive number
           stretch_len : positive number
           outline  : positive number

        Return or set the pen's attributes x/y-stretchfactors and/or outline.
        Set resizemode to "user".
        If and only if resizemode is set to "user", the turtle will be displayed
        stretched according to its stretchfactors:
        stretch_wid is stretchfactor perpendicular to orientation
        stretch_len is stretchfactor in direction of turtles orientation.
        outline determines the width of the shapes's outline.

        Examples (for a Turtle instance named turtle):
        >>> turtle.resizemode("user")
        >>> turtle.shapesize(5, 5, 12)
        >>> turtle.shapesize(outline=8)
        Nrz(stretch_wid/stretch_len must not be zeror3)rar;r9)r-r1r�rV)r�Zstretch_widZstretch_lenr9r;r�r�r�rl�
s$"


�zRawTurtle.shapesizecCs |dkr|jS|jd|d�dS)a�Set or return the current shearfactor.

        Optional argument: shear -- number, tangent of the shear angle

        Shear the turtleshape according to the given shearfactor shear,
        which is the tangent of the shear angle. DO NOT change the
        turtle's heading (direction of movement).
        If shear is not given: return the current shearfactor, i. e. the
        tangent of the shear angle, by which lines parallel to the
        heading of the turtle are sheared.

        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("circle")
        >>> turtle.shapesize(5,2)
        >>> turtle.shearfactor(0.5)
        >>> turtle.shearfactor()
        >>> 0.5
        Nr3)rarn)r.rV)r�Zshearr�r�r�rnszRawTurtle.shearfactorcCs<||j|j}|tjddtj}|jd|d�dS)aIRotate the turtleshape to point in the specified direction

        Argument: angle -- number

        Rotate the turtleshape to point in the direction specified by angle,
        regardless of its current tilt-angle. DO NOT change the turtle's
        heading (direction of movement).


        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("circle")
        >>> turtle.shapesize(5,2)
        >>> turtle.settiltangle(45)
        >>> stamp()
        >>> turtle.fd(50)
        >>> turtle.settiltangle(-45)
        >>> stamp()
        >>> turtle.fd(50)
        r�r�r3)rarsN)r	rr�r�rV�r�r�rsr�r�r�rgszRawTurtle.settiltanglecCs>|dkr0|jdtj|j}||j|jS|�|�dS)a�Set or return the current tilt-angle.

        Optional argument: angle -- number

        Rotate the turtleshape to point in the direction specified by angle,
        regardless of its current tilt-angle. DO NOT change the turtle's
        heading (direction of movement).
        If angle is not given: return the current tilt-angle, i. e. the angle
        between the orientation of the turtleshape and the heading of the
        turtle (its direction of movement).

        Deprecated since Python 3.1

        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("circle")
        >>> turtle.shapesize(5,2)
        >>> turtle.tilt(45)
        >>> turtle.tiltangle()
        Nr�)r/r�r�rr	rrgr[r�r�r�rt4szRawTurtle.tiltanglecCs|�||���dS)a�Rotate the turtleshape by angle.

        Argument:
        angle - a number

        Rotate the turtleshape by angle from its current tilt-angle,
        but do NOT change the turtle's heading (direction of movement).

        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("circle")
        >>> turtle.shapesize(5,2)
        >>> turtle.tilt(30)
        >>> turtle.fd(50)
        >>> turtle.tilt(30)
        >>> turtle.fd(50)
        N)rgrtrr�r�r�rsNszRawTurtle.tiltcCs6||kr(|kr(|kr(dkr2nn|jS|j\}}}}|dk	rL|}|dk	rX|}|dk	rd|}|dk	rp|}||||dkr�td��||||f|_t�||�dtj}	t�|	�t�|	�}
}|||
||||
||
||||
|||f\}}
}}||f|_|
||_|	|_	|j
dd�dS)a�Set or return the current transformation matrix of the turtle shape.

        Optional arguments: t11, t12, t21, t22 -- numbers.

        If none of the matrix elements are given, return the transformation
        matrix.
        Otherwise set the given elements and transform the turtleshape
        according to the matrix consisting of first row t11, t12 and
        second row t21, 22.
        Modify stretchfactor, shearfactor and tiltangle according to the
        given matrix.

        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("square")
        >>> turtle.shapesize(4,2)
        >>> turtle.shearfactor(-0.5)
        >>> turtle.shapetransform()
        (4.0, -1.0, -0.0, 2.0)
        Nrz0Bad shape transform matrix: must not be singularr�r3r4)r0r�r�rr�r�r�r-r.r/rV)r��t11�t12�t21�t22Zm11Zm12Zm21Zm22Zalfar?r@Za11Za12Za21Za22r�r�r�rmas0,�

zRawTurtle.shapetransformcs^|j�|j\��|j\��t���j�j�}dt|�|\�������fdd�|D�S)zlComputes transformed polygon shapes from a shape
        according to current position and heading.
        r�csFg|]>\}}��|�|�j��|�|�jf�qSr�)r4r5�r{r�r��Ze0Ze1Zp0Zp1r�r�r�r~�s�z(RawTurtle._polytrafo.<locals>.<listcomp>)r�rrrr5r4r)r�r��er�rar��
_polytrafo�s

�zRawTurtle._polytrafocCs2|jj|jj}|jdkr.|�|j|jdk�SdS)a@Return the current shape polygon as tuple of coordinate pairs.

        No argument.

        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("square")
        >>> turtle.shapetransform(4, -1, 0, 2)
        >>> turtle.get_shapepoly()
        ((50, -20), (30, 20), (-50, 20), (-30, -20))

        r�r�N)r�r�r�rDry�
_getshapepolyr�)r�rkr�r�r�rG�s
zRawTurtle.get_shapepolyFcsx|jdks|r|j\����n>|jdkrNtd|jd�}|dd|f\����n|jdkr\|St����fdd�|D��S)	z`Calculate transformed shape polygon according to resizemode
        and shapetransform.
        r3r2r�g@rr�c3s2|]*\}}�|�|�|�|fVqdSr�r�r`�r\r]r^r_r�r�r��sz*RawTurtle._getshapepoly.<locals>.<genexpr>)r%r0�maxr'r�)r�r�r�r!r�rer�rd�s

zRawTurtle._getshapepolyc	Cs�|j}|j|jj}|j}|jj}|j�r*|jdk�r*|jdk�r*d|_	|j
}|dkr�|jdkrfd}n|jdkrx|j}n|j
}|�|�|��}|j|j}}|j|||||dd�nt|d	kr�|�||j|�nZ|d
k�r�t||�D]D\}	\}
}}|�|�|
d��}
|j|	|
|�|�|�|�|j
dd�q�nx|j	�r6dS|dk�rR|�|dd
d
�nJ|d	k�rv|�||j|jdj
�n&|d
k�r�|D]}	|�|	dd
d
��q�d|_	dS)zpManages the correct rendering of the turtle with respect to
        its shape, resizemode, stretch and tilt etc.rFr�r�r�r2T�r"r9rzrArtr�N�r�r�r�r�r/)r�r�r�rDryrHr(r�r�rPr�r%r'r1rcrdr*r)rCrwr�ziprX)r�r�rkrZZtitem�tshaper6�fc�ocrHr�r�r�r�r��sR 

�
�




�
zRawTurtle._drawturtlec	CsT|j}|j|jj}|j}|j}|dkr�|��}|jdkr@d}n|jdkrR|j}n|j	}|�
|�|��}|j|j
}}|j|||||dd�n�|dkr�|�d�}|�||j|�n�|d	k�r4g}|D]}	|��}
|�|
�q�t|�}t||�D]D\}
\}}}|�
|�|d��}|j|
||�|�|�|�|j	dd�q�|j�|�|j�d
|f�|S)a�Stamp a copy of the turtleshape onto the canvas and return its id.

        No argument.

        Stamp a copy of the turtle shape onto the canvas at the current
        turtle position. Return a stamp_id for that stamp, which can be
        used to delete it by calling clearstamp(stamp_id).

        Example (for a Turtle instance named turtle):
        >>> turtle.color("blue")
        >>> turtle.stamp()
        13
        >>> turtle.fd(50)
        r�r�r�r2Trgrtr�r�rr)r�r�r�rDryr�r:r%r'r1rcrdr*r)rCrurwrr>r�rirXrSrr�)r�r�rkrZrj�stitemr6rkrlZelementrHr�r�r�r�rr�sH

�

�zRawTurtle.stampcCs�||jkrDt|t�r,|D]}|j�|�qn|j�|�|j�|�d|f}|j}||jkr`dS|j�|�}|j�|�||j	kr�|j	d|j
|_	|j�|j	d|j
dg�dS)z9does the work for clearstamp() and clearstamps()
        rrNr�)rSr�r�r�rIr�rr��indexr�r��insert)r��stampidZsubitemrHZbufrnr�r�r��_clearstamps



zRawTurtle._clearstampcCs|�|�|��dS)aDDelete stamp with given stampid

        Argument:
        stampid - an integer, must be return value of previous stamp() call.

        Example (for a Turtle instance named turtle):
        >>> turtle.color("blue")
        >>> astamp = turtle.stamp()
        >>> turtle.fd(50)
        >>> turtle.clearstamp(astamp)
        N)rqrJ)r�rpr�r�r�r6s
zRawTurtle.clearstampcCs^|dkr|jdd�}n&|dkr0|jd|�}n|j|d�}|D]}|�|�qB|��dS)a�Delete all or first/last n of turtle's stamps.

        Optional argument:
        n -- an integer

        If n is None, delete all of pen's stamps,
        else if n > 0 delete first n stamps
        else if n < 0 delete last n stamps.

        Example (for a Turtle instance named turtle):
        >>> for i in range(8):
        ...     turtle.stamp(); turtle.fd(30)
        ...
        >>> turtle.clearstamps(2)
        >>> turtle.clearstamps(-2)
        >>> turtle.clearstamps()
        Nr)rSrqrJ)r�r�ZtoDeleterHr�r�r�r7-szRawTurtle.clearstampsc
Cs�|j|j|jt|jt�f}|j}d|j|||j|j	dd�|�
|j�|jdd�ff}|jrh|j�
|�|j}|j�rZ|jdk�rZ||}|d|jd|d|jd}dt|ddd|j|j�}|d	|}	td|�D]R}
|
dkr�d
}nd}||	|
|_|j�r2|�|j||jf|j|j|�|��q�|j�rZ|j|jdd
|jd�|j�rn|j	�|�t|jt��r�|j�|�||_|j�r�|j�|�t|j	�dk�r�|��|��dS)z�Move the pen to the point end, thereby drawing a line
        if pen is down. All other methods for turtle movement depend
        on this one.
        �goNr�rr�r�r�皙�����?r�TF�r�r�r��r"rz�*)r+r)r'r�rOr�r�rrQrRr�r�rr�r,r�r4r5r�rrErKrJr>rMrLr�r=)r�r�go_modesr�Z
undo_entry�start�diff�diffsq�nhops�deltar�rAr�r�r�r
Isb
�

��$$�

�zRawTurtle._gotocs|\}}}}|\}}}}	|\}
}}�|j�t|j|�dkrDtd�|
|_||_|ddgkrbd}
n|}
�j|
||
|d���fdd�|jD�}|D]}��|�|j�	|�q�|}|j
�r��jdk�r�||}|d	�jd
|d�j
d
}dt|ddd|j
|j
�}|d
|}td|�D]P}|dk�r@d}nd}||||_|�rr��|j||jf|||�|���q,|�r��j|jdd|d�||_|j�r�t|j�d	k�r�|j��|jgk�r�d|_d|_|	�r|jgk�r�d|_td�n|jdk	�r|j��|��dS)z)Reverse a _goto. Used for undo()
        r�z$undogoto: HALLO-DA-STIMMT-WAS-NICHT!r�r�rucs&g|]}|�kr��|�dkr|�qS)r�)ryrz�r�r�r�r�r~�s�z'RawTurtle._undogoto.<locals>.<listcomp>r�rr�r�rsr�TFrtNzUnwahrscheinlich in _undogoto!)r�rrr�rQrRrEr�rIr�r,r�r4r5r�rrKrJrMr�rLr�rO)r��entry�old�newrwZcoodataZdrawingZpcZpsrBZcLIZcLr�ZusepcZtodeleter|rxryrzr{r|r�rAr�r}r��	_undogoto~sl
$$
�
�


zRawTurtle._undogotocCs�|jr|j�d||jf�||j9}|j�|�}|jj}|dkr�|jdkr�d|j}dtt	|�|�}d||}t
|�D]}|j�|�|_|��q|||_|��dS)z&Turns pen clockwise by angle.
        �rotr�rg@r�N)rr�r	rr�r�r�r,r�rrrJ)r�r�Z	neworientr�Zanglevelr r|r�r�r�r�r�s


zRawTurtle._rotateTcCsnt|j�dkrD|j�|j|j|j|j�|j��|_|j�	|j�n|jj|jdd�g|_|rj|j
g|_dS)z�Closes current line item and starts a new one.
           Remark: if current line became too long, animation
           performance (via _drawline) slowed down considerably.
        r�T)rAN)r�rRr�rErQr)r'rDr�r>rrAr�r�r�r=�s�zRawTurtle._newLinecCst|jt�S)aReturn fillstate (True if filling, False else).

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.begin_fill()
        >>> if turtle.filling():
        ...     turtle.pensize(5)
        ... else:
        ...     turtle.pensize(3)
        )r�rOr�r�r�r�r�rB�szRawTurtle.fillingcCsX|��s"|j��|_|j�|j�|jg|_|��|j	rL|j	�
d|jf�|��dS)aCalled just before drawing a shape to be filled.

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.color("black", "red")
        >>> turtle.begin_fill()
        >>> turtle.circle(60)
        >>> turtle.end_fill()
        �	beginfillN)rBr�r:rNr�r>rrOr=rr�rJr�r�r�r�r1�s
zRawTurtle.begin_fillcCs^|��rZt|j�dkrF|jj|j|j|jd�|jrF|j�d|jf�d|_|_|�	�dS)aFill the shape drawn after the call begin_fill().

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.color("black", "red")
        >>> turtle.begin_fill()
        >>> turtle.circle(60)
        >>> turtle.end_fill()
        r�r;�dofillN)
rBr�rOr�rCrNr*rr�rJr�r�r�r�r>
s�zRawTurtle.end_fillc	Gs8|sNt|ttf�r0|�|�}|jt|jd�}qr|j}|sr|jt|jd�}n$|dkrh|jt|jd�}|�|�}t|jd�r�|j�	|j
||�}|j�|�|j
r�|j
�d|f�n�|��}|j
r�|j
�dg�d|j
_z>|��dkr�|��|��|�|�|�|�|�d�W5|�|�X|j
�r4d	|j
_dS)
a�Draw a dot with diameter size, using color.

        Optional arguments:
        size -- an integer >= 1 (if given)
        color -- a colorstring or a numeric color tuple

        Draw a circular dot with diameter size, using color.
        If size is not given, the maximum of pensize+4 and 2*pensize is used.

        Example (for a Turtle instance named turtle):
        >>> turtle.dot()
        >>> turtle.fd(50); turtle.dot(20, "blue"); turtle.fd(50)
        r�N�_dotr<rTr2rF)r�r�r�r�r'rfr)�hasattrr�r�rr�r>rr�rVr�rarMrXrYrWrC)r�rVr9rHrVr�r�r�r<
s:



z
RawTurtle.dotcCsB|j�|j||||j�\}}|j�|�|jr>|j�d|f�|S)z)Performs the writing for write()
        �wri)r�rXrr)r�r>rr�)r�rVrWrUrHrr�r�r�rXH
s�zRawTurtle._writerP��Arialr�r7cCs`|jr|j�dg�d|j_|�t|�|��|�}|rN|��\}}|�||�|jr\d|j_dS)a�Write text at the current turtle position.

        Arguments:
        arg -- info, which is to be written to the TurtleScreen
        move (optional) -- True/False
        align (optional) -- one of the strings "left", "center" or right"
        font (optional) -- a triple (fontname, fontsize, fonttype)

        Write text - the string representation of arg - at the current
        turtle position according to align ("left", "center" or right")
        and with the given font.
        If move is True, the pen is moved to the bottom-right corner
        of the text. By default, move is False.

        Example (for a Turtle instance named turtle):
        >>> turtle.write('Home = ', True, align="center")
        >>> turtle.write((0,0), True)
        rTFN)rr�r�rXr�r�r[re)r��argZmoverWrUrr�r�r�r�r�r{R
szRawTurtle.writecCs|jg|_d|_dS)aStart recording the vertices of a polygon.

        No argument.

        Start recording the vertices of a polygon. Current turtle position
        is first point of polygon.

        Example (for a Turtle instance named turtle):
        >>> turtle.begin_poly()
        TN)rrLrMr�r�r�r�r2o
s
zRawTurtle.begin_polycCs
d|_dS)a7Stop recording the vertices of a polygon.

        No argument.

        Stop recording the vertices of a polygon. Current turtle position is
        last point of polygon. This will be connected with the first point.

        Example (for a Turtle instance named turtle):
        >>> turtle.end_poly()
        FN)rMr�r�r�r�r?}
szRawTurtle.end_polycCs|jdk	rt|j�SdS)z�Return the lastly recorded polygon.

        No argument.

        Example (for a Turtle instance named turtle):
        >>> p = turtle.get_poly()
        >>> turtle.register_shape("myFavouriteShape", p)
        N)rLr�r�r�r�r�rD�
s

zRawTurtle.get_polycCs|jS)a�Return the TurtleScreen object, the turtle is drawing  on.

        No argument.

        Return the TurtleScreen object, the turtle is drawing  on.
        So TurtleScreen-methods can be called for that object.

        Example (for a Turtle instance named turtle):
        >>> ts = turtle.getscreen()
        >>> ts
        <turtle.TurtleScreen object at 0x0106B770>
        >>> ts.bgcolor("pink")
        rGr�r�r�r�rF�
szRawTurtle.getscreencCs|S)aUReturn the Turtleobject itself.

        No argument.

        Only reasonable use: as a function to return the 'anonymous turtle':

        Example:
        >>> pet = getturtle()
        >>> pet.fd(50)
        >>> pet
        <turtle.Turtle object at 0x0187D810>
        >>> turtles()
        [<turtle.Turtle object at 0x0187D810>]
        r�r�r�r�r�rH�
szRawTurtle.getturtlecCs|j�|�S)zDSet delay value which determines speed of turtle animation.
        )r�rrLr�r�r�rM�
szRawTurtle._delayr�cCs"|j�|jj|||�|��dS)a�Bind fun to mouse-click event on this turtle on canvas.

        Arguments:
        fun --  a function with two arguments, to which will be assigned
                the coordinates of the clicked point on the canvas.
        btn --  number of the mouse-button defaults to 1 (left mouse button).
        add --  True or False. If True, new binding will be added, otherwise
                it will replace a former binding.

        Example for the anonymous turtle, i. e. the procedural way:

        >>> def turn(x, y):
        ...     left(360)
        ...
        >>> onclick(turn)  # Now clicking into the turtle will turn it.
        >>> onclick(None)  # event-binding will be removed
        N)r�rer�rHrJr�r�r�r�rR�
szRawTurtle.onclickcCs"|j�|jj|||�|��dS)a�Bind fun to mouse-button-release event on this turtle on canvas.

        Arguments:
        fun -- a function with two arguments, to which will be assigned
                the coordinates of the clicked point on the canvas.
        btn --  number of the mouse-button defaults to 1 (left mouse button).

        Example (for a MyTurtle instance named joe):
        >>> class MyTurtle(Turtle):
        ...     def glow(self,x,y):
        ...             self.fillcolor("red")
        ...     def unglow(self,x,y):
        ...             self.fillcolor("")
        ...
        >>> joe = MyTurtle()
        >>> joe.onclick(joe.glow)
        >>> joe.onrelease(joe.unglow)

        Clicking on joe turns fillcolor red, unclicking turns it to
        transparent.
        N)r�rfr�rHrJr�r�r�r�rT�
szRawTurtle.onreleasecCs|j�|jj|||�dS)a�Bind fun to mouse-move event on this turtle on canvas.

        Arguments:
        fun -- a function with two arguments, to which will be assigned
               the coordinates of the clicked point on the canvas.
        btn -- number of the mouse-button defaults to 1 (left mouse button).

        Every sequence of mouse-move-events on a turtle is preceded by a
        mouse-click event on that turtle.

        Example (for a Turtle instance named turtle):
        >>> turtle.ondrag(turtle.goto)

        Subsequently clicking and dragging a Turtle will move it
        across the screen thereby producing handdrawings (if pen is
        down).
        N)r�rgr�rHr�r�r�r�rS�
szRawTurtle.ondragcCs,|jdkrdS|dkr@|\}}|�|||j�|j��}n�|dkr\|d}|�|�n�|dkrp|�|�n�|dkr�|d}|j�|�|j�	|�n�|dkr�|d}|jj
|dd	d	d
�nh|dk�r|d}d|_|_||jk�r(|j�|�|j�	|�n$|dk�r(t
�||d�|j��dS)
z2Does the main part of the work for undo()
        Nr�rrrrr)r�r<r�rhr�r8r�rV)rrr	r�r6r�r�rIr�r�rCrNrOr$rV)r��actionr�r�ZdegPAUZdummyrmrHr�r�r��_undos<

�

zRawTurtle._undocCsl|jdkrdS|j��}|d}|dd�}|dkr\|rh|��}|�|d|dd��q4n|�||�dS)a�undo (repeatedly) the last turtle action.

        No argument.

        undo (repeatedly) the last turtle action.
        Number of available undo actions is determined by the size of
        the undobuffer.

        Example (for a Turtle instance named turtle):
        >>> for i in range(4):
        ...     turtle.fd(50); turtle.lt(80)
        ...
        >>> for i in range(8):
        ...     turtle.undo()
        ...
        Nrr�r)rr�r�)r�rHr�r�r�r�r�rw's

zRawTurtle.undo)NN)N)NNN)N)N)NNNN)F)N)T)N)FrPr�)N)r�N)r�N)r�N)9r�r�r�r�rJr�r�r`rhrxrUr5r�rJrr�r�rXr8rkrlrnrgrtrsrmrcrGrdr�rrrqr6r7r
r�rr=rBr1r>r<rXr{r2r?rDrFrHrErMrRrTrSr�rwrvr�r�r�r�r
�	sr�
(

(

(


(

(-
5A

0







 cCstjdkrt�t_tjS)z�Return the singleton screen object.
    If none exists at the moment, create a new one and return it,
    else return the existing one.N)r�_screenrIr�r�r�r�r	Js
c@sfeZdZdZdZedZdd�Zededededfd	d
�Zdd�Z	d
d�Z
dd�Zdd�ZdS)rINr)cCs�tjdkr4t�t_|_|j�tj�|j�|j�tjdkr�td}td}td}td}td}td}|j�	||||�|j�
�t_t�|tj�|�
||||�dS)Nrzr�r�r�r�r�)rI�_rootrr)�_titler)�_destroyrr�r#r$rr�r&)r�rzr�r�r�r�r�r�r�r�r�Xs

z_Screen.__init__rzr�r�r�cCs�t|jd�sdS|j��}|j��}t|t�rNd|krBdkrNnn||}|dkrb||d}t|t�r�d|kr�dkr�nn||}|dkr�||d}|j�||||�|��dS)a Set the size and position of the main window.

        Arguments:
        width: as integer a size in pixels, as float a fraction of the screen.
          Default is 50% of screen.
        height: as integer the height in pixels, as float a fraction of the
          screen. Default is 75% of screen.
        startx: if positive, starting position in pixels from the left
          edge of the screen, if negative from the right edge
          Default, startx=None is to center window horizontally.
        starty: if positive, starting position in pixels from the top
          edge of the screen, if negative from the bottom edge
          Default, starty=None is to center window vertically.

        Examples (for a Screen instance named screen):
        >>> screen.setup (width=200, height=200, startx=0, starty=0)

        sets window to 200x200 pixels, in upper left of screen

        >>> screen.setup(width=.75, height=0.5, startx=None, starty=None)

        sets window to 75% of screen by 50% of screen and centers
        r'Nrr�r�)r�r�r*r+r�r�r'r,)r�rzr�r%r&rQZshr�r�r�r&ns

""z
_Screen.setupcCs tjdk	rtj�|�|t_dS)aqSet title of turtle-window

        Argument:
        titlestring -- a string, to appear in the titlebar of the
                       turtle graphics window.

        This is a method of Screen-class. Not available for TurtleScreen-
        objects.

        Example (for a Screen instance named screen):
        >>> screen.title("Welcome to the turtle-zoo!")
        N)rIr�r)r�)r�Ztitlestringr�r�r�r)�s
z
_Screen.titlecCs:|j}|tjkr(dt_dt_dt_dt_dt_|��dS)NF)	r�rIrr�r�rrr�r()r��rootr�r�r�r��s
z_Screen._destroycCs|��dS)z~Shut the turtlegraphics window.

        Example (for a TurtleScreen instance named screen):
        >>> screen.bye()
        N)r�r�r�r�r�r�sz_Screen.byecsN�fdd�}��|�tdr"dSz
t�Wntk
rHtd�YnXdS)alGo into mainloop until the mouse is clicked.

        No arguments.

        Bind bye() method to mouseclick on TurtleScreen.
        If "using_IDLE" - value in configuration dictionary is False
        (default value), enter mainloop.
        If IDLE with -n switch (no subprocess) is used, this value should be
        set to True in turtle.cfg. In this case IDLE's mainloop
        is active also for the client script.

        This is a method of the Screen-class and not available for
        TurtleScreen instances.

        Example (for a Screen instance named screen):
        >>> screen.exitonclick()

        cs���dS)z&Screen.bye() with two dummy-parametersN)r)r�r�r�r�r��exitGracefully�sz+_Screen.exitonclick.<locals>.exitGracefullyr�Nr)rRr�r�AttributeError�exit)r�r�r�r�r�r�s

z_Screen.exitonclick)
r�r�r�r�rr�r�r�r&r)r�rrr�r�r�r�rIRs�
(
rIc@s4eZdZdZdZdZedededfdd�ZdS)rz�RawTurtle auto-creating (scrolled) canvas.

    When a Turtle object is created or a function derived from some
    Turtle method is called a TurtleScreen object is automatically created.
    Nrkr�r�cCs,tjdkrt�t_tj|tj|||d�dS)N)rkr�r�)rr�r	r
r�)r�rkr�r�r�r�r�r��s

�zTurtle.__init__)r�r�r�r�r�r�r�r�r�r�r�r�r�s��turtle_docstringdictc	Cs�i}tD]}d|}t|�j||<qtD]}d|}t|�j||<q(td|d���}tdd�|D��}|�d�|dd	�D](}|�d
t|��|�d||�q||d	}|�d
t|��|�d||�|�d
�|��W5QRXdS)a�Create and write docstring-dictionary to file.

    Optional argument:
    filename -- a string, used as filename
                default value is turtle_docstringdict

    Has to be called explicitly, (not used by the turtle-graphics classes)
    The docstring dictionary will be written to the Python script <filname>.py
    It is intended to serve as a template for translation of the docstrings
    into different languages.
    z_Screen.zTurtle.z%s.pyr6css$|]}|�d�dtkr|VqdS)r�r�N)r�_alias_listr�r�r�r�r�s�z&write_docstringdict.<locals>.<genexpr>zdocsdict = {

Nr�z%s :
z        """%s
""",

z        """%s
"""

z}
)	�_tg_screen_functionsr�r��_tg_turtle_functionsr�r�r{�repr�close)r��docsdict�
methodnamer�r�r�r�r�r�r~�s$

c	Cs`dd|��i}t|�}|j}|D]8}z||t|�_Wq"tk
rXtd|�Yq"Xq"dS)z�Read in docstrings from lang-specific docstring dictionary.

    Transfer docstrings, translated to lang, from a dictionary-file
    to the methods of classes Screen and Turtle and - in revised form -
    to the corresponding functions.
    z!turtle_docstringdict_%(language)sr�zBad docstring-entry: %sN)r��
__import__r�r�r�r�r�)Zlang�modname�moduler�r�r�r�r��read_docstringssr�r�zCannot find docsdict forz;Unknown Error when trying to import %s-docstring-dictionaryc
Cs�d}}t�|j�\}}}|dd�}|dd�}|jp:g}dd�|D�}dgt|�t|�|}dd�t||�D�}	|dk	r�|	�d|�|�d|�|dk	r�|	�d|�|�d|�d	�|	�}d
|}d	�|�}d
|}||fS)a?Get strings describing the arguments for the given object

    Returns a pair of strings representing function parameter lists
    including parenthesis.  The first string is suitable for use in
    function definition and the second is suitable for use in function
    call.  The "self" parameter is not included.
    r�r�NcSsg|]}d|f�qS)z=%rr�)r{r�r�r�r�r~<sz"getmethparlist.<locals>.<listcomp>cSsg|]\}}||�qSr�r�)r{r�Zdfltr�r�r�r~>s�*z**z, z(%s))�inspectZgetargs�__code__�__defaults__r�rir>r)
ZobZdefTextZcallTextrZvarargsZvarkwZitems2ZrealArgs�defaultsZitems1r�r�r��getmethparlist,s&


r�cCsJddl}|dkrdStd}|�d|d�}|�d|�}|�d|�}|S)z<To reduce docstrings from RawTurtle class for functions
    rNr��%s.r�� \(.+ %s\):�:��rer��replace�compile�sub)�docstrr�Z
turtlename�	newdocstr�parexpr�r�r��_turtle_docreviseKsr�cCsJddl}|dkrdStd}|�d|d�}|�d|�}|�d|�}|S)z?To reduce docstrings from TurtleScreen class for functions
    rNr�r�r�r�r�r�)r�r�Z
screennamer�r�r�r�r��_screen_docreviseWsr�ardef {name}{paramslist}:
    if {obj} is None:
        if not TurtleScreen._RUNNING:
            TurtleScreen._RUNNING = True
            raise Terminator
        {obj} = {init}
    try:
        return {obj}.{name}{argslist}
    except TK.TclError:
        if not TurtleScreen._RUNNING:
            TurtleScreen._RUNNING = True
            raise Terminator
        raise
c
Csl|D]b}t||�}t|�\}}|dkr4td||�qtj|||||d�}	t|	t��||j�t�|_qdS)Nr�z>>>>>>)�obj�initr�Z
paramslistZargslist)�getattrr�r��__func_body�formatr��globalsr�)
Z	functionsr�r�r�Z	docreviser�r�Zpl1Zpl2Zdefstrr�r�r��_make_global_funcsws

�r�zTurtle._screenzScreen()zTurtle._penzTurtle()�__main__cCst�rt�nt�dSr�)rNr]rUr�r�r�r��	switchpen�sr�cCslt�td�t�td�t�td�td�D]Z}|dkrDt�td�D]}td�t	d�qL|dkrxt
d�t�t�td	�t�q2td
�t
d�td�t�td�td�td�td�td
�t�t
dd
�t
dd
�t
d�td�D]$}td�t	d�td�td�q�td�t�td�D]&}td�t	d�td�td��q:t�dS)zDemo of old turtle.py - moduleT�dr�r�r�r��ZZmaroonr	r�r�F�Z
startstartrx�redr�N)r`r*ryr0r=rzrr1rCrPr9r>r_r{)r|r�r�r�r��demo1�sX



r�cCsBtd�t�td�ttdd��tdd�d}td�td�D]}t�t	|d�qBt
d�t�rnt�q`t
�td�td	�d}td
�td�td�tdd
�D]p}|dkr�t�td	d|dd|�td�D]}t|�td�q�t�|d7}td�tt�dd�q�td�t�td�td�t�tdd�td�t�td�D](}t	dd�td�td�td��q`t�td�t�td�t�td�t�}|�d�t�}|�d�|�d�|�
�|�d�|�d�|��|�dd�|�d�|��|�d�|�dd�|�d�|�d�tt|��d}|�|�dk�r�|�d�|�d �|�|�|��|�d�|d!dk�r�|� �|� �t�|d7}�qZ|j
d"d#d$d%�|�d&�|�d�d'd(�}t!�"d�t��r|��|���q�|�d�|j
d)d*d+�|�#|d�d,S)-zDemo of some new features.r�r�rrr��r�zwait a moment...r�Zgreenr�r�r���x��Fr	r�Zyellowr��2r�r2i�(r�ZblueZoranger�g@g333333�?r�zCAUGHT! )r�r��boldr_)rUrWr�cSst�t�dSr�)rr)r�r�r�r�r��babaszdemo2.<locals>.babaz  Click me!)ZCourierr�r�)rUN)$rprqrYrdrur;rbrr�r4r{rxrwr`rQrrWr1rAr@r>r]rUr9rkrHrarrPryrIr=rr�time�sleeprR)rr�Zlaenger|Ztrir�r�r�r�r�r��demo2�s�


















r�)r�)r�)Fr�Z_verZtkinterr�r�r�r�r�r�Zos.pathrrr�copyrrZ_tg_classesr�r�Z
_tg_utilities�__all__r�r�r�r�r�r�r�rr�r�r�r�r�rr�r r�objectr,r�r�rr�rr�r$rBr
rr	rIrr
r~r�Z	_LANGUAGE�ImportErrorr�r�r�r�r�rrr�r�r�r�rr�r�r�r��<module>s�N��
�

����5
�
c	/&/O}
"
���
5c__pycache__/_pyio.cpython-38.opt-1.pyc000064400000220515151153537550013501 0ustar00U

e5d�k�@s|dZddlZddlZddlZddlZddlZddlZddlmZ	ej
dkrXddlmZ
ndZ
ddlZddlmZmZmZmZdddhZeed	�r�e�ej�e�ej�d
ZeZeed�p�ejjZd7dd�Zdd�Zz
ejZWne k
�r�eZYnXGdd�d�Z!Gdd�d�Z"z
ej#Z#Wn(e k
�rHGdd�de$e%�Z#YnXGdd�dej&d�Z'ej'�(e'�Gdd�de'�Z)ej)�(e)�ddl*m+Z+e)�(e+�Gdd �d e'�Z,ej,�(e,�Gd!d"�d"e,�Z-Gd#d$�d$e,�Z.Gd%d&�d&e-�Z/Gd'd(�d(e-�Z0Gd)d*�d*e,�Z1Gd+d,�d,e0e/�Z2Gd-d.�d.e)�Z+Gd/d0�d0e'�Z3ej3�(e3�Gd1d2�d2ej4�Z5Gd3d4�d4e3�Z6Gd5d6�d6e6�Z7dS)8z)
Python implementation of the io module.
�N)�
allocate_lock>�win32�cygwin)�setmode)�__all__�SEEK_SET�SEEK_CUR�SEEK_END���	SEEK_HOLEi Zgettotalrefcount�r���Tc	Cs�t|t�st�|�}t|tttf�s0td|��t|t�sFtd|��t|t�s\td|��|dk	rzt|t�sztd|��|dk	r�t|t�s�td|��t|�}|td�s�t|�t|�kr�t	d|��d|k}	d	|k}
d
|k}d|k}d|k}
d
|k}d|k}d|k�rD|	�s"|�s"|�s"|
�r*t	d��ddl
}|�dtd�d}
|�rX|�rXt	d��|	|
||dk�rvt	d��|	�s�|
�s�|�s�|�s�t	d��|�r�|dk	�r�t	d��|�r�|dk	�r�t	d��|�r�|dk	�r�t	d��|�r|dk�rddl
}|�dt
d�t||	�rd�pd|
�r"d	�p$d|�r2d
�p4d|�rBd�pDd|
�rRd�pTd||d�}|}�z$d}|dk�s�|dk�r�|���r�d }d}|dk�r�t}zt�|���j}Wnttfk
�r�YnX|dk�r�|}|dk�r�t	d!��|dk�r|�r|WSt	d"��|
�r t||�}n<|	�s2|�s2|�r>t||�}n|
�rPt||�}nt	d#|��|}|�rl|WSt|||||�}|}||_|WS|���YnXdS)$a�Open file and return a stream.  Raise OSError upon failure.

    file is either a text or byte string giving the name (and the path
    if the file isn't in the current working directory) of the file to
    be opened or an integer file descriptor of the file to be
    wrapped. (If a file descriptor is given, it is closed when the
    returned I/O object is closed, unless closefd is set to False.)

    mode is an optional string that specifies the mode in which the file is
    opened. It defaults to 'r' which means open for reading in text mode. Other
    common values are 'w' for writing (truncating the file if it already
    exists), 'x' for exclusive creation of a new file, and 'a' for appending
    (which on some Unix systems, means that all writes append to the end of the
    file regardless of the current seek position). In text mode, if encoding is
    not specified the encoding used is platform dependent. (For reading and
    writing raw bytes use binary mode and leave encoding unspecified.) The
    available modes are:

    ========= ===============================================================
    Character Meaning
    --------- ---------------------------------------------------------------
    'r'       open for reading (default)
    'w'       open for writing, truncating the file first
    'x'       create a new file and open it for writing
    'a'       open for writing, appending to the end of the file if it exists
    'b'       binary mode
    't'       text mode (default)
    '+'       open a disk file for updating (reading and writing)
    'U'       universal newline mode (deprecated)
    ========= ===============================================================

    The default mode is 'rt' (open for reading text). For binary random
    access, the mode 'w+b' opens and truncates the file to 0 bytes, while
    'r+b' opens the file without truncation. The 'x' mode implies 'w' and
    raises an `FileExistsError` if the file already exists.

    Python distinguishes between files opened in binary and text modes,
    even when the underlying operating system doesn't. Files opened in
    binary mode (appending 'b' to the mode argument) return contents as
    bytes objects without any decoding. In text mode (the default, or when
    't' is appended to the mode argument), the contents of the file are
    returned as strings, the bytes having been first decoded using a
    platform-dependent encoding or using the specified encoding if given.

    'U' mode is deprecated and will raise an exception in future versions
    of Python.  It has no effect in Python 3.  Use newline to control
    universal newlines mode.

    buffering is an optional integer used to set the buffering policy.
    Pass 0 to switch buffering off (only allowed in binary mode), 1 to select
    line buffering (only usable in text mode), and an integer > 1 to indicate
    the size of a fixed-size chunk buffer.  When no buffering argument is
    given, the default buffering policy works as follows:

    * Binary files are buffered in fixed-size chunks; the size of the buffer
      is chosen using a heuristic trying to determine the underlying device's
      "block size" and falling back on `io.DEFAULT_BUFFER_SIZE`.
      On many systems, the buffer will typically be 4096 or 8192 bytes long.

    * "Interactive" text files (files for which isatty() returns True)
      use line buffering.  Other text files use the policy described above
      for binary files.

    encoding is the str name of the encoding used to decode or encode the
    file. This should only be used in text mode. The default encoding is
    platform dependent, but any encoding supported by Python can be
    passed.  See the codecs module for the list of supported encodings.

    errors is an optional string that specifies how encoding errors are to
    be handled---this argument should not be used in binary mode. Pass
    'strict' to raise a ValueError exception if there is an encoding error
    (the default of None has the same effect), or pass 'ignore' to ignore
    errors. (Note that ignoring encoding errors can lead to data loss.)
    See the documentation for codecs.register for a list of the permitted
    encoding error strings.

    newline is a string controlling how universal newlines works (it only
    applies to text mode). It can be None, '', '\n', '\r', and '\r\n'.  It works
    as follows:

    * On input, if newline is None, universal newlines mode is
      enabled. Lines in the input can end in '\n', '\r', or '\r\n', and
      these are translated into '\n' before being returned to the
      caller. If it is '', universal newline mode is enabled, but line
      endings are returned to the caller untranslated. If it has any of
      the other legal values, input lines are only terminated by the given
      string, and the line ending is returned to the caller untranslated.

    * On output, if newline is None, any '\n' characters written are
      translated to the system default line separator, os.linesep. If
      newline is '', no translation takes place. If newline is any of the
      other legal values, any '\n' characters written are translated to
      the given string.

    closedfd is a bool. If closefd is False, the underlying file descriptor will
    be kept open when the file is closed. This does not work when a file name is
    given and must be True in that case.

    The newly created file is non-inheritable.

    A custom opener can be used by passing a callable as *opener*. The
    underlying file descriptor for the file object is then obtained by calling
    *opener* with (*file*, *flags*). *opener* must return an open file
    descriptor (passing os.open as *opener* results in functionality similar to
    passing None).

    open() returns a file object whose type depends on the mode, and
    through which the standard file operations such as reading and writing
    are performed. When open() is used to open a file in a text mode ('w',
    'r', 'wt', 'rt', etc.), it returns a TextIOWrapper. When used to open
    a file in a binary mode, the returned class varies: in read binary
    mode, it returns a BufferedReader; in write binary and append binary
    modes, it returns a BufferedWriter, and in read/write mode, it returns
    a BufferedRandom.

    It is also possible to use a string or bytearray as a file for both
    reading and writing. For strings StringIO can be used like a file
    opened in a text mode, and for bytes a BytesIO can be used like a file
    opened in a binary mode.
    zinvalid file: %rzinvalid mode: %rzinvalid buffering: %rN�invalid encoding: %r�invalid errors: %rzaxrwb+tU�xr
�w�a�+�t�b�Uz4mode U cannot be combined with 'x', 'w', 'a', or '+'rz'U' mode is deprecatedrTz'can't have text and binary mode at oncer
z)can't have read/write/append mode at oncez/must have exactly one of read/write/append modez-binary mode doesn't take an encoding argumentz+binary mode doesn't take an errors argumentz+binary mode doesn't take a newline argumentzaline buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used�)�openerFrzinvalid buffering sizezcan't have unbuffered text I/Ozunknown mode: %r)�
isinstance�int�os�fspath�str�bytes�	TypeError�set�len�
ValueError�warnings�warn�DeprecationWarning�RuntimeWarning�FileIO�isatty�DEFAULT_BUFFER_SIZE�fstat�fileno�
st_blksize�OSError�AttributeError�BufferedRandom�BufferedWriter�BufferedReader�
TextIOWrapper�mode�close)�filer4�	buffering�encoding�errors�newline�closefdrZmodesZcreatingZreadingZwritingZ	appendingZupdating�textZbinaryr$�raw�result�line_bufferingZbs�buffer�rA�/usr/lib64/python3.8/_pyio.py�open)s�{




�������



rCcCs ddl}|�dtd�t|d�S)azOpens the provided file with mode ``'rb'``. This function
    should be used when the intent is to treat the contents as
    executable code.

    ``path`` should be an absolute path.

    When supported by the runtime, this function can be hooked
    in order to allow embedders more control over code files.
    This functionality is not supported on the current runtime.
    rNz(_pyio.open_code() may not be using hooksr�rb)r$r%r'rC)�pathr$rArArB�_open_code_with_warnings�rFc@seZdZdZddd�ZdS)�
DocDescriptorz%Helper for builtins.open.__doc__
    NcCs
dtjS)Nz\open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True)

)rC�__doc__)�self�obj�typrArArB�__get__s��zDocDescriptor.__get__)N)�__name__�
__module__�__qualname__rHrLrArArArBrGsrGc@seZdZdZe�Zdd�ZdS)�OpenWrapperz�Wrapper for builtins.open

    Trick so that open won't become a bound method when stored
    as a class variable (as dbm.dumb does).

    See initstdio() in Python/pylifecycle.c.
    cOs
t||�S�N)rC)�cls�args�kwargsrArArB�__new__,szOpenWrapper.__new__N)rMrNrOrHrGrUrArArArBrP"srPc@seZdZdS)�UnsupportedOperationN)rMrNrOrArArArBrV5srVc@s�eZdZdZdd�Zd6dd�Zdd�Zd7d
d�Zdd
�ZdZ	dd�Z
dd�Zdd�Zd8dd�Z
dd�Zd9dd�Zdd�Zd:dd�Zedd ��Zd;d!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd<d,d-�Zd.d/�Zd0d1�Zd=d2d3�Zd4d5�Zd	S)>�IOBaseaThe abstract base class for all I/O classes, acting on streams of
    bytes. There is no public constructor.

    This class provides dummy implementations for many methods that
    derived classes can override selectively; the default implementations
    represent a file that cannot be read, written or seeked.

    Even though IOBase does not declare read or write because
    their signatures will vary, implementations and clients should
    consider those methods part of the interface. Also, implementations
    may raise UnsupportedOperation when operations they do not support are
    called.

    The basic type used for binary data read from or written to a file is
    bytes. Other bytes-like objects are accepted as method arguments too.
    Text I/O classes work with str data.

    Note that calling any method (even inquiries) on a closed stream is
    undefined. Implementations may raise OSError in this case.

    IOBase (and its subclasses) support the iterator protocol, meaning
    that an IOBase object can be iterated over yielding the lines in a
    stream.

    IOBase also supports the :keyword:`with` statement. In this example,
    fp is closed after the suite of the with statement is complete:

    with open('spam.txt', 'r') as fp:
        fp.write('Spam and eggs!')
    cCstd|jj|f��dS)z@Internal: raise an OSError exception for unsupported operations.z%s.%s() not supportedN)rV�	__class__rM)rI�namerArArB�_unsupported\s
�zIOBase._unsupportedrcCs|�d�dS)a$Change stream position.

        Change the stream position to byte offset pos. Argument pos is
        interpreted relative to the position indicated by whence.  Values
        for whence are ints:

        * 0 -- start of stream (the default); offset should be zero or positive
        * 1 -- current stream position; offset may be negative
        * 2 -- end of stream; offset is usually negative
        Some operating systems / file systems could provide additional values.

        Return an int indicating the new absolute position.
        �seekN�rZ�rI�pos�whencerArArBr[cszIOBase.seekcCs|�dd�S)z5Return an int indicating the current stream position.rr
)r[�rIrArArB�tellsszIOBase.tellNcCs|�d�dS)z�Truncate file to size bytes.

        Size defaults to the current IO position as reported by tell().  Return
        the new size.
        �truncateNr\�rIr^rArArBrbwszIOBase.truncatecCs|��dS)zuFlush write buffers, if applicable.

        This is not implemented for read-only and non-blocking streams.
        N��_checkClosedr`rArArB�flush�szIOBase.flushFcCs |jsz|��W5d|_XdS)ziFlush and close the IO object.

        This method has no effect if the file is already closed.
        TN)�_IOBase__closedrfr`rArArBr5�szIOBase.closecCsVz
|j}Wntk
r YdSX|r*dStr8|��nz|��WnYnXdS)zDestructor.  Calls close().N)�closedr/�_IOBASE_EMITS_UNRAISABLEr5)rIrhrArArB�__del__�s

zIOBase.__del__cCsdS)z�Return a bool indicating whether object supports random access.

        If False, seek(), tell() and truncate() will raise OSError.
        This method may need to do a test seek().
        FrAr`rArArB�seekable�szIOBase.seekablecCs |��st|dkrdn|��dS)zEInternal: raise UnsupportedOperation if file is not seekable
        NzFile or stream is not seekable.)rkrV�rI�msgrArArB�_checkSeekable�s��zIOBase._checkSeekablecCsdS)zvReturn a bool indicating whether object was opened for reading.

        If False, read() will raise OSError.
        FrAr`rArArB�readable�szIOBase.readablecCs |��st|dkrdn|��dS)zEInternal: raise UnsupportedOperation if file is not readable
        NzFile or stream is not readable.)rorVrlrArArB�_checkReadable�s��zIOBase._checkReadablecCsdS)z�Return a bool indicating whether object was opened for writing.

        If False, write() and truncate() will raise OSError.
        FrAr`rArArB�writable�szIOBase.writablecCs |��st|dkrdn|��dS)zEInternal: raise UnsupportedOperation if file is not writable
        NzFile or stream is not writable.)rqrVrlrArArB�_checkWritable�s��zIOBase._checkWritablecCs|jS)z�closed: bool.  True iff the file has been closed.

        For backwards compatibility, this is a property, not a predicate.
        )rgr`rArArBrh�sz
IOBase.closedcCs|jrt|dkrdn|��dS)z7Internal: raise a ValueError if file is closed
        N�I/O operation on closed file.�rhr#rlrArArBre�s��zIOBase._checkClosedcCs|��|S)zCContext management protocol.  Returns self (an instance of IOBase).rdr`rArArB�	__enter__�szIOBase.__enter__cGs|��dS)z+Context management protocol.  Calls close()N)r5)rIrSrArArB�__exit__�szIOBase.__exit__cCs|�d�dS)z�Returns underlying file descriptor (an int) if one exists.

        An OSError is raised if the IO object does not use a file descriptor.
        r,Nr\r`rArArBr,�sz
IOBase.filenocCs|��dS)z{Return a bool indicating whether this is an 'interactive' stream.

        Return False if it can't be determined.
        Frdr`rArArBr)sz
IOBase.isattyrcs�t�d�r��fdd�}ndd�}�dkr0d�n4z
�j}Wn"tk
r\t��d���YnX|��t�}�dks~t|��kr���|��}|s�q�||7}|�d	�rjq�qjt|�S)
aNRead and return a line of bytes from the stream.

        If size is specified, at most size bytes will be read.
        Size should be an int.

        The line terminator is always b'\n' for binary files; for text
        files, the newlines argument to open can be used to select the line
        terminator(s) recognized.
        �peekcs>��d�}|sdS|�d�dp&t|�}�dkr:t|��}|S)Nr
�
r)rw�findr"�min)Z	readahead�n�rI�sizerArB�
nreadaheads

z#IOBase.readline.<locals>.nreadaheadcSsdS�Nr
rArArArArBr~ sNr� is not an integerrrx)	�hasattr�	__index__r/r �	bytearrayr"�read�endswithr)rIr}r~�
size_index�resrrAr|rB�readlines&
	

zIOBase.readlinecCs|��|SrQrdr`rArArB�__iter__5szIOBase.__iter__cCs|��}|st�|SrQ)r��
StopIteration�rI�linerArArB�__next__9szIOBase.__next__cCsP|dks|dkrt|�Sd}g}|D]&}|�|�|t|�7}||kr$qLq$|S)z�Return a list of lines from the stream.

        hint can be specified to control the number of lines read: no more
        lines will be read if the total size (in bytes/characters) of all
        lines so far exceeds hint.
        Nr)�list�appendr")rIZhintr{�linesr�rArArB�	readlines?s
zIOBase.readlinescCs |��|D]}|�|�qdS)z�Write a list of lines to the stream.

        Line separators are not added, so it is usual for each of the lines
        provided to have a line separator at the end.
        N)re�write)rIr�r�rArArB�
writelinesQszIOBase.writelines)r)N)N)N)N)N)r)N)rMrNrOrHrZr[rarbrfrgr5rjrkrnrorprqrr�propertyrhrerurvr,r)r�r�r�r�r�rArArArBrW9s6!







	

*
rW)�	metaclassc@s2eZdZdZddd�Zdd�Zdd�Zd	d
�ZdS)
�	RawIOBasezBase class for raw binary I/O.rcCsP|dkrd}|dkr|��St|���}|�|�}|dkr>dS||d�=t|�S)z�Read and return up to size bytes, where size is an int.

        Returns an empty bytes object on EOF, or None if the object is
        set not to block and has no data to read.
        Nrr)�readallr�r��readintor)rIr}rr{rArArBr�ls

zRawIOBase.readcCs4t�}|�t�}|sq ||7}q|r,t|�S|SdS)z+Read until EOF, using multiple read() call.N)r�r�r*r)rIr��datarArArBr�}s

zRawIOBase.readallcCs|�d�dS)z�Read bytes into a pre-allocated bytes-like object b.

        Returns an int representing the number of bytes read (0 for EOF), or
        None if the object is set not to block and has no data to read.
        r�Nr\�rIrrArArBr��szRawIOBase.readintocCs|�d�dS)z�Write the given buffer to the IO stream.

        Returns the number of bytes written, which may be less than the
        length of b in bytes.
        r�Nr\r�rArArBr��szRawIOBase.writeN)r)rMrNrOrHr�r�r�r�rArArArBr�^s

r�)r(c@sLeZdZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�BufferedIOBaseaBase class for buffered IO objects.

    The main difference with RawIOBase is that the read() method
    supports omitting the size argument, and does not have a default
    implementation that defers to readinto().

    In addition, read(), readinto() and write() may raise
    BlockingIOError if the underlying raw stream is in non-blocking
    mode and not ready; unlike their raw counterparts, they will never
    return None.

    A typical implementation should not inherit from a RawIOBase
    implementation, but wrap one.
    rcCs|�d�dS)a�Read and return up to size bytes, where size is an int.

        If the argument is omitted, None, or negative, reads and
        returns all data until EOF.

        If the argument is positive, and the underlying raw stream is
        not 'interactive', multiple raw reads may be issued to satisfy
        the byte count (unless EOF is reached first).  But for
        interactive raw streams (XXX and for pipes?), at most one raw
        read will be issued, and a short result does not imply that
        EOF is imminent.

        Returns an empty bytes array on EOF.

        Raises BlockingIOError if the underlying raw stream has no
        data at the moment.
        r�Nr\r|rArArBr��szBufferedIOBase.readcCs|�d�dS)zaRead up to size bytes with at most one read() system call,
        where size is an int.
        �read1Nr\r|rArArBr��szBufferedIOBase.read1cCs|j|dd�S)afRead bytes into a pre-allocated bytes-like object b.

        Like read(), this may issue multiple reads to the underlying raw
        stream, unless the latter is 'interactive'.

        Returns an int representing the number of bytes read (0 for EOF).

        Raises BlockingIOError if the underlying raw stream has no
        data at the moment.
        F�r���	_readintor�rArArBr��szBufferedIOBase.readintocCs|j|dd�S)z�Read bytes into buffer *b*, using at most one system call

        Returns an int representing the number of bytes read (0 for EOF).

        Raises BlockingIOError if the underlying raw stream has no
        data at the moment.
        Tr�r�r�rArArB�	readinto1�s	zBufferedIOBase.readinto1cCsVt|t�st|�}|�d�}|r0|�t|��}n|�t|��}t|�}||d|�<|S)N�B)r�
memoryview�castr�r"r�)rIrr�r�r{rArArBr��s

zBufferedIOBase._readintocCs|�d�dS)aWrite the given bytes buffer to the IO stream.

        Return the number of bytes written, which is always the length of b
        in bytes.

        Raises BlockingIOError if the buffer is full and the
        underlying raw stream cannot accept more data at the moment.
        r�Nr\r�rArArBr��s	zBufferedIOBase.writecCs|�d�dS)z�
        Separate the underlying raw stream from the buffer and return it.

        After the raw stream has been detached, the buffer is in an unusable
        state.
        �detachNr\r`rArArBr��szBufferedIOBase.detachN)r)r)rMrNrOrHr�r�r�r�r�r�r�rArArArBr��s

r�c@s�eZdZdZdd�Zd$dd�Zdd�Zd%d
d�Zdd
�Zdd�Z	dd�Z
dd�Zedd��Z
edd��Zedd��Zedd��Zdd�Zdd�Zd d!�Zd"d#�Zd	S)&�_BufferedIOMixinz�A mixin implementation of BufferedIOBase with an underlying raw stream.

    This passes most requests on to the underlying raw stream.  It
    does *not* provide implementations of read(), readinto() or
    write().
    cCs
||_dSrQ��_raw�rIr=rArArB�__init__sz_BufferedIOMixin.__init__rcCs"|j�||�}|dkrtd��|S)Nrz#seek() returned an invalid position)r=r[r.)rIr^r_Znew_positionrArArBr[sz_BufferedIOMixin.seekcCs|j��}|dkrtd��|S)Nrz#tell() returned an invalid position)r=rar.rcrArArBras
z_BufferedIOMixin.tellNcCs$|��|dkr|��}|j�|�SrQ)rfrar=rbrcrArArBrb$sz_BufferedIOMixin.truncatecCs|jrtd��|j��dS)N�flush on closed file)rhr#r=rfr`rArArBrf2sz_BufferedIOMixin.flushcCs.|jdk	r*|js*z|��W5|j��XdSrQ)r=rhr5rfr`rArArBr57sz_BufferedIOMixin.closecCs*|jdkrtd��|��|j}d|_|S)Nzraw stream already detached)r=r#rfr�r�rArArBr�?s
z_BufferedIOMixin.detachcCs
|j��SrQ)r=rkr`rArArBrkIsz_BufferedIOMixin.seekablecCs|jSrQr�r`rArArBr=Lsz_BufferedIOMixin.rawcCs|jjSrQ)r=rhr`rArArBrhPsz_BufferedIOMixin.closedcCs|jjSrQ)r=rYr`rArArBrYTsz_BufferedIOMixin.namecCs|jjSrQ)r=r4r`rArArBr4Xsz_BufferedIOMixin.modecCstd|jj�d���dS�Nzcannot pickle z object�r rXrMr`rArArB�__getstate__\sz_BufferedIOMixin.__getstate__cCsN|jj}|jj}z
|j}Wn tk
r:d�||�YSXd�|||�SdS)Nz<{}.{}>z<{}.{} name={!r}>)rXrNrOrYr/�format)rI�modnameZclsnamerYrArArB�__repr___s
z_BufferedIOMixin.__repr__cCs
|j��SrQ)r=r,r`rArArBr,ksz_BufferedIOMixin.filenocCs
|j��SrQ)r=r)r`rArArBr)nsz_BufferedIOMixin.isatty)r)N)rMrNrOrHr�r[rarbrfr5r�rkr�r=rhrYr4r�r�r,r)rArArArBr�
s*






r�cs�eZdZdZdZd!dd�Zdd�Zdd�Zd	d
�Z�fdd�Z	d"dd�Z
d#dd�Zdd�Zd$dd�Z
dd�Zd%dd�Zdd�Zdd�Zdd �Z�ZS)&�BytesIOz<Buffered I/O implementation using an in-memory bytes buffer.NcCs&t�}|dk	r||7}||_d|_dS�Nr)r��_buffer�_pos)rIZ
initial_bytes�bufrArArBr�zs
zBytesIO.__init__cCs|jrtd��|j��S)Nz__getstate__ on closed file)rhr#�__dict__�copyr`rArArBr��szBytesIO.__getstate__cCs|jrtd��t|j�S)z8Return the bytes value (contents) of the buffer
        zgetvalue on closed file)rhr#rr�r`rArArB�getvalue�szBytesIO.getvaluecCs|jrtd��t|j�S)z;Return a readable and writable view of the buffer.
        zgetbuffer on closed file)rhr#r�r�r`rArArB�	getbuffer�szBytesIO.getbuffercs"|jdk	r|j��t���dSrQ)r��clear�superr5r`�rXrArBr5�s

z
BytesIO.closercCs�|jrtd��|dkrd}n4z
|j}Wn"tk
rHt|�d���YnX|�}|dkrbt|j�}t|j�|jkrvdStt|j�|j|�}|j|j|�}||_t	|�S)N�read from closed filerr�r�)
rhr#r�r/r r"r�r�rzr)rIr}r�ZnewposrrArArBr��s"

zBytesIO.readcCs
|�|�S)z"This is the same as read.
        )r�r|rArArBr��sz
BytesIO.read1c	Cs�|jrtd��t|t�r td��t|��}|j}W5QRX|dkrFdS|j}|t|j	�krzd|t|j	�}|j	|7_	||j	|||�<|j|7_|S)N�write to closed file� can't write str to binary streamr�)
rhr#rrr r��nbytesr�r"r�)rIrZviewr{r^ZpaddingrArArBr��s

z
BytesIO.writercCs�|jrtd��z
|j}Wn"tk
r:t|�d���YnX|�}|dkrh|dkr`td|f��||_nD|dkr�td|j|�|_n(|dkr�tdt|j�|�|_ntd��|jS)Nzseek on closed filer�r�negative seek position %rr
rzunsupported whence value)	rhr#r�r/r r��maxr"r�)rIr^r_�	pos_indexrArArBr[�s"
zBytesIO.seekcCs|jrtd��|jS)N�tell on closed file)rhr#r�r`rArArBra�szBytesIO.tellcCsx|jrtd��|dkr|j}nJz
|j}Wn"tk
rJt|�d���YnX|�}|dkrhtd|f��|j|d�=|S)Nztruncate on closed filer�rznegative truncate position %r)rhr#r�r�r/r r�)rIr^r�rArArBrb�s
zBytesIO.truncatecCs|jrtd��dS�NrsTrtr`rArArBro�szBytesIO.readablecCs|jrtd��dSr�rtr`rArArBrq�szBytesIO.writablecCs|jrtd��dSr�rtr`rArArBrk�szBytesIO.seekable)N)r)r)r)N)rMrNrOrHr�r�r�r�r�r5r�r�r�r[rarbrorqrk�
__classcell__rArAr�rBr�rs 




r�c@sxeZdZdZefdd�Zdd�Zdd�Zdd	d
�Zddd�Z	ddd�Z
ddd�Zddd�Zdd�Z
dd�Zd dd�ZdS)!r2aBufferedReader(raw[, buffer_size])

    A buffer for a readable, sequential BaseRawIO object.

    The constructor creates a BufferedReader for the given readable raw
    stream and buffer_size. If buffer_size is omitted, DEFAULT_BUFFER_SIZE
    is used.
    cCsF|��std��t�||�|dkr,td��||_|��t�|_dS)zMCreate a new buffered reader using the given readable raw IO object.
        z "raw" argument must be readable.r�invalid buffer sizeN)	ror.r�r�r#�buffer_size�_reset_read_buf�Lock�
_read_lock�rIr=r�rArArBr�szBufferedReader.__init__cCs
|j��SrQ)r=ror`rArArBroszBufferedReader.readablecCsd|_d|_dS)Nr�r)�	_read_buf�	_read_posr`rArArBr�szBufferedReader._reset_read_bufNc
Cs@|dk	r|dkrtd��|j�|�|�W5QR�SQRXdS)z�Read size bytes.

        Returns exactly size bytes of data unless the underlying raw IO
        stream reaches EOF or if the call would block in non-blocking
        mode. If size is negative, read until EOF or until read() would
        block.
        Nrzinvalid number of bytes to read)r#r��_read_unlockedr|rArArBr� szBufferedReader.readcCs�d}d}|j}|j}|dks$|dkr�|��t|jd�rj|j��}|dkrZ||d�pXdS||d�|S||d�g}d}|j��}||kr�|}q�|t|�7}|�|�q|d�	|�p�|St|�|}	||	kr�|j|7_||||�S||d�g}t
|j|�}
|	|k�rH|j�|
�}||k�r.|}�qH|	t|�7}	|�|��qt||	�}d�	|�}||d�|_d|_|�r�|d|�S|S)Nr�)r�Nrr�r)
r�r�r�r�r=r�r�r"r��joinr�r�rz)rIr{Z
nodata_valZempty_valuesr�r^�chunkZchunksZcurrent_size�availZwanted�outrArArBr�-sL





zBufferedReader._read_unlockedrc
Cs(|j�|�|�W5QR�SQRXdS)z�Returns buffered bytes without advancing the position.

        The argument indicates a desired minimal number of bytes; we
        do at most one raw read to satisfy it.  We never return more
        than self.buffer_size.
        N)r��_peek_unlockedr|rArArBrwaszBufferedReader.peekcCsrt||j�}t|j�|j}||ks,|dkrb|j|}|j�|�}|rb|j|jd�||_d|_|j|jd�Sr�)rzr�r"r�r�r=r�)rIr{ZwantZhaveZto_readZcurrentrArArBr�ks
zBufferedReader._peek_unlockedrc
Cs^|dkr|j}|dkrdS|j�4|�d�|�t|t|j�|j��W5QR�SQRXdS)z<Reads up to size bytes, with at most one read() system call.rr�r
N)r�r�r�r�rzr"r�r�r|rArArBr�vs
�zBufferedReader.read1c	Cs
t|t�st|�}|jdkr dS|�d�}d}|j��|t|�kr�tt|j�|jt|��}|r�|j|j|j|�||||�<|j|7_||7}|t|�kr�q�t|�||j	kr�|j
�||d��}|s�q�||7}n|r�|s�|�d�s�q�|r6|r6q�q6W5QRX|S)z2Read data into *buf* with at most one system call.rr�Nr
)
rr�r�r�r�r"rzr�r�r�r=r�r�)rIr�r��writtenr�r{rArArBr��s6


�

zBufferedReader._readintocCst�|�t|j�|jSrQ)r�rar"r�r�r`rArArBra�szBufferedReader.tellc
Csd|tkrtd��|j�D|dkr4|t|j�|j8}t�|||�}|��|W5QR�SQRXdS)N�invalid whence valuer
)	�valid_seek_flagsr#r�r"r�r�r�r[r�r]rArArBr[�szBufferedReader.seek)N)N)r)r)r)r)rMrNrOrHr*r�ror�r�r�rwr�r�r�rar[rArArArBr2s	


4



.r2c@s`eZdZdZefdd�Zdd�Zdd�Zdd	d
�Zdd�Z	d
d�Z
dd�Zddd�Zdd�Z
dS)r1z�A buffer for a writeable sequential RawIO object.

    The constructor creates a BufferedWriter for the given writeable raw
    stream. If the buffer_size is not given, it defaults to
    DEFAULT_BUFFER_SIZE.
    cCsF|��std��t�||�|dkr,td��||_t�|_t�|_	dS)Nz "raw" argument must be writable.rr�)
rqr.r�r�r#r�r��
_write_bufr��_write_lockr�rArArBr��szBufferedWriter.__init__cCs
|j��SrQ)r=rqr`rArArBrq�szBufferedWriter.writablecCst|t�rtd��|j��|jr(td��t|j�|jkr@|�	�t|j�}|j�
|�t|j�|}t|j�|jkr�z|�	�Wnltk
r�}zNt|j�|jkr�t|j�|j}||8}|jd|j�|_t|j|j
|��W5d}~XYnX|W5QR�SQRXdS)Nr�r�)rrr r�rhr#r"r�r��_flush_unlocked�extend�BlockingIOError�errno�strerror)rIrZbeforer��eZoveragerArArBr��s(

"zBufferedWriter.writeNc
CsD|j�4|��|dkr"|j��}|j�|�W5QR�SQRXdSrQ)r�r�r=rarbrcrArArBrb�s

zBufferedWriter.truncatec	Cs|j�|��W5QRXdSrQ)r�r�r`rArArBrf�szBufferedWriter.flushcCs�|jrtd��|jr�z|j�|j�}Wntk
rBtd��YnX|dkrZttjdd��|t	|j�ksp|dkrxt
d��|jd|�=qdS)Nr�zHself.raw should implement RawIOBase: it should not raise BlockingIOErrorz)write could not complete without blockingrz*write() returned incorrect number of bytes)rhr#r�r=r�r��RuntimeErrorr�ZEAGAINr"r.�rIr{rArArBr�s �zBufferedWriter._flush_unlockedcCst�|�t|j�SrQ)r�rar"r�r`rArArBraszBufferedWriter.tellrc
CsD|tkrtd��|j�$|��t�|||�W5QR�SQRXdS)Nr�)r�r#r�r�r�r[r]rArArBr[s
zBufferedWriter.seekcCs`|j�$|jdks|jr&W5QR�dSW5QRXz|��W5|j�|j��W5QRXXdSrQ)r�r=rhr5rfr`rArArBr5szBufferedWriter.close)N)r)rMrNrOrHr*r�rqr�rbrfr�rar[r5rArArArBr1�s

r1c@s�eZdZdZefdd�Zddd�Zdd�Zd	d
�Zd dd
�Z	d!dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zedd��ZdS)"�BufferedRWPaira�A buffered reader and writer object together.

    A buffered reader object and buffered writer object put together to
    form a sequential IO object that can read and write. This is typically
    used with a socket or two-way pipe.

    reader and writer are RawIOBase objects that are readable and
    writeable respectively. If the buffer_size is omitted it defaults to
    DEFAULT_BUFFER_SIZE.
    cCs<|��std��|��s td��t||�|_t||�|_dS)zEConstructor.

        The arguments are two RawIO instances.
        z#"reader" argument must be readable.z#"writer" argument must be writable.N)ror.rqr2�readerr1�writer)rIr�r�r�rArArBr�<szBufferedRWPair.__init__rcCs|dkrd}|j�|�S�Nr)r�r�r|rArArBr�JszBufferedRWPair.readcCs|j�|�SrQ)r�r�r�rArArBr�OszBufferedRWPair.readintocCs|j�|�SrQ)r�r�r�rArArBr�RszBufferedRWPair.writercCs|j�|�SrQ)r�rwr|rArArBrwUszBufferedRWPair.peekcCs|j�|�SrQ)r�r�r|rArArBr�XszBufferedRWPair.read1cCs|j�|�SrQ)r�r�r�rArArBr�[szBufferedRWPair.readinto1cCs
|j��SrQ)r�ror`rArArBro^szBufferedRWPair.readablecCs
|j��SrQ)r�rqr`rArArBrqaszBufferedRWPair.writablecCs
|j��SrQ)r�rfr`rArArBrfdszBufferedRWPair.flushcCs z|j��W5|j��XdSrQ)r�r5r�r`rArArBr5gszBufferedRWPair.closecCs|j��p|j��SrQ)r�r)r�r`rArArBr)mszBufferedRWPair.isattycCs|jjSrQ)r�rhr`rArArBrhpszBufferedRWPair.closedN)r)r)r)rMrNrOrHr*r�r�r�r�rwr�r�rorqrfr5r)r�rhrArArArBr�,s


r�c@sneZdZdZefdd�Zddd�Zdd�Zdd
d�Zddd
�Z	dd�Z
ddd�Zddd�Zdd�Z
dd�Zd	S)r0z�A buffered interface to random access streams.

    The constructor creates a reader and writer for a seekable stream,
    raw, given in the first argument. If the buffer_size is omitted it
    defaults to DEFAULT_BUFFER_SIZE.
    cCs(|��t�|||�t�|||�dSrQ)rnr2r�r1r�rArArBr�~szBufferedRandom.__init__rc	Cs�|tkrtd��|��|jrJ|j� |j�|jt|j�d�W5QRX|j�||�}|j�|�	�W5QRX|dkr�t
d��|S)Nr�r
rz seek() returned invalid position)r�r#rfr�r�r=r[r�r"r�r.r]rArArBr[�s$zBufferedRandom.seekcCs|jrt�|�St�|�SdSrQ)r�r1rar2r`rArArBra�s
zBufferedRandom.tellNcCs|dkr|��}t�||�SrQ)rar1rbrcrArArBrb�szBufferedRandom.truncatecCs |dkrd}|��t�||�Sr�)rfr2r�r|rArArBr��szBufferedRandom.readcCs|��t�||�SrQ)rfr2r�r�rArArBr��szBufferedRandom.readintocCs|��t�||�SrQ)rfr2rwr|rArArBrw�szBufferedRandom.peekrcCs|��t�||�SrQ)rfr2r�r|rArArBr��szBufferedRandom.read1cCs|��t�||�SrQ)rfr2r�r�rArArBr��szBufferedRandom.readinto1c	CsF|jr:|j�(|j�|jt|j�d�|��W5QRXt�||�Sr)	r�r�r=r[r�r"r�r1r�r�rArArBr��s
zBufferedRandom.write)r)N)N)r)r)rMrNrOrHr*r�r[rarbr�r�rwr�r�r�rArArArBr0us




r0cs�eZdZdZdZdZdZdZdZdZ	d0dd�Z
dd	�Zd
d�Zdd
�Z
dd�Zd1dd�Zd2dd�Zdd�Zdd�Zdd�Zefdd�Zdd�Zd3dd�Z�fd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zed,d-��Zed.d/��Z �Z!S)4r(rFNTr
c
CsB|jdkr*z|jrt�|j�W5d|_Xt|t�r<td��t|t�r\|}|dkr`td��nd}t|t	�sxtd|f��t
|�t
d�ks�td|f��tdd�|D��d	ks�|�d
�d	kr�td��d|kr�d
|_
d
|_tjtjB}nTd|kr�d
|_d}n@d|k�rd
|_tjtjB}n"d|k�r8d
|_d
|_tjtjB}d
|k�rNd
|_d
|_|j�rj|j�rj|tjO}n|j�r~|tjO}n
|tjO}|ttdd�O}ttdd��p�ttdd�}||O}d}�zT|dk�r:|�s�td��|dk�r�t�||d�}n0|||�}t|t��std��|dk�r$td��|}|�s:t�|d�||_t�|�}	z(t�|	j��rpt t!j"t�#t!j"�|��Wnt$k
�r�YnXt|	dd�|_%|j%d	k�r�t&|_%t'�r�t'|tj(�||_)|j�rzt�*|dt+�Wn4tk
�r}
z|
j!t!j,k�r�W5d}
~
XYnXWn"|dk	�r0t�|��YnX||_dS)adOpen a file.  The mode can be 'r' (default), 'w', 'x' or 'a' for reading,
        writing, exclusive creation or appending.  The file will be created if it
        doesn't exist when opened for writing or appending; it will be truncated
        when opened for writing.  A FileExistsError will be raised if it already
        exists when opened for creating. Opening a file for creating implies
        writing so this mode behaves in a similar way to 'w'. Add a '+' to the mode
        to allow simultaneous reading and writing. A custom opener can be used by
        passing a callable as *opener*. The underlying file descriptor for the file
        object is then obtained by calling opener with (*name*, *flags*).
        *opener* must return an open file descriptor (passing os.open as *opener*
        results in functionality similar to passing None).
        rrz$integer argument expected, got floatznegative file descriptorzinvalid mode: %szxrwab+css|]}|dkVqdS)ZrwaxNrA)�.0�crArArB�	<genexpr>�sz"FileIO.__init__.<locals>.<genexpr>r
rzKMust have exactly one of create/read/write/append mode and at most one plusrTr
rr�O_BINARYZO_NOINHERIT�	O_CLOEXECNz'Cannot use closefd=False with file namei�zexpected integer from openerzNegative file descriptorFr-)-�_fd�_closefdrr5r�floatr rr#rr!�sum�count�_created�	_writable�O_EXCL�O_CREAT�	_readable�O_TRUNC�
_appending�O_APPEND�O_RDWR�O_RDONLY�O_WRONLY�getattrrCr.�set_inheritabler+�stat�S_ISDIR�st_mode�IsADirectoryErrorr�ZEISDIRr�r/�_blksizer*�_setmoder�rY�lseekr	ZESPIPE)rIr6r4r;r�fd�flagsZnoinherit_flagZowned_fdZfdfstatr�rArArBr��s�




$




�





�

zFileIO.__init__cCsB|jdkr>|jr>|js>ddl}|jd|ftd|d�|��dS)Nrzunclosed file %rr)�
stacklevel�source)r�r�rhr$r%�ResourceWarningr5)rIr$rArArBrjAs�zFileIO.__del__cCstd|jj�d���dSr�r�r`rArArBr�HszFileIO.__getstate__cCspd|jj|jjf}|jr"d|Sz
|j}Wn*tk
rVd||j|j|jfYSXd|||j|jfSdS)Nz%s.%sz
<%s [closed]>z<%s fd=%d mode=%r closefd=%r>z<%s name=%r mode=%r closefd=%r>)	rXrNrOrhrYr/r�r4r�)rI�
class_namerYrArArBr�Ks�
�
�zFileIO.__repr__cCs|jstd��dS)NzFile not open for reading)r�rVr`rArArBrpYszFileIO._checkReadablecCs|jstd��dS)NzFile not open for writing)r�rVrlrArArBrr]szFileIO._checkWritablecCsT|��|��|dks |dkr(|��Szt�|j|�WStk
rNYdSXdS)z�Read at most size bytes, returned as bytes.

        Only makes one system call, so less data may be returned than requested
        In non-blocking mode, returns None if no data is available.
        Return an empty bytes object at EOF.
        Nr)rerpr�rr�r�r�r|rArArBr�aszFileIO.readcCs�|��|��t}z6t�|jdt�}t�|j�j}||krH||d}Wnt	k
r^YnXt
�}t|�|kr�t|�}|t|t�7}|t|�}zt�
|j|�}Wntk
r�|r�Yq�YdSX|s�q�||7}qft|�S)z�Read all data from the file, returned as bytes.

        In non-blocking mode, returns as much as is immediately available,
        or None if no data is available.  Return an empty bytes object at EOF.
        rr
N)rerpr*rrr�rr+�st_sizer.r�r"r�r�r�r)rI�bufsizer^�endr>r{r�rArArBr�qs2
zFileIO.readallcCs4t|��d�}|�t|��}t|�}||d|�<|S)zSame as RawIOBase.readinto().r�N)r�r�r�r")rIr�mr�r{rArArBr��s
zFileIO.readintocCs<|��|��zt�|j|�WStk
r6YdSXdS)aWrite bytes b to file, return number written.

        Only makes one system call, so not all of the data may be written.
        The number of bytes actually written is returned.  In non-blocking mode,
        returns None if the write would block.
        N)rerrrr�r�r�r�rArArBr��szFileIO.writecCs*t|t�rtd��|��t�|j||�S)a�Move to new file position.

        Argument offset is a byte count.  Optional argument whence defaults to
        SEEK_SET or 0 (offset from start of file, offset should be >= 0); other values
        are SEEK_CUR or 1 (move relative to current position, positive or negative),
        and SEEK_END or 2 (move relative to end of file, usually negative, although
        many platforms allow seeking beyond the end of a file).

        Note that not all file objects are seekable.
        zan integer is required)rr�r rerrr�r]rArArBr[�s
zFileIO.seekcCs|��t�|jdt�S)zYtell() -> int.  Current file position.

        Can raise OSError for non seekable files.r)rerrr�rr`rArArBra�szFileIO.tellcCs2|��|��|dkr |��}t�|j|�|S)z�Truncate the file to at most size bytes.

        Size defaults to the current file position, as returned by tell().
        The current file position is changed to the value of size.
        N)rerrrar�	ftruncater�r|rArArBrb�szFileIO.truncatecs.|js*z|jrt�|j�W5t���XdS)z�Close the file.

        A closed file cannot be used for further I/O operations.  close() may be
        called more than once without error.
        N)rhr�r5r�rr�r`r�rArBr5�s
zFileIO.closecCsF|��|jdkr@z|��Wntk
r8d|_YnXd|_|jS)z$True if file supports random-access.NFT)re�	_seekablerar.r`rArArBrk�s
zFileIO.seekablecCs|��|jS)z'True if file was opened in a read mode.)rer�r`rArArBro�szFileIO.readablecCs|��|jS)z(True if file was opened in a write mode.)rer�r`rArArBrq�szFileIO.writablecCs|��|jS)z3Return the underlying file descriptor (an integer).)rer�r`rArArBr,�sz
FileIO.filenocCs|��t�|j�S)z.True if the file is connected to a TTY device.)rerr)r�r`rArArBr)�sz
FileIO.isattycCs|jS)z6True if the file descriptor will be closed by close().)r�r`rArArBr;�szFileIO.closefdcCsJ|jr|jrdSdSn0|jr,|jr&dSdSn|jrB|jr<dSdSndSdS)	zString giving the file modezxb+Zxbzab+Zabzrb+rD�wbN)r�r�r�r�r`rArArBr4szFileIO.mode)r
TN)N)N)N)"rMrNrOr�r�r�r�r�rr�r�rjr�r�rprrr�r�r�r�rr[rarbr5rkrorqr,r)r�r;r4r�rArAr�rBr(�s<
y

#



r(c@s`eZdZdZddd�Zdd�Zddd	�Zd
d�Zdd
�Ze	dd��Z
e	dd��Ze	dd��ZdS)�
TextIOBasez�Base class for text I/O.

    This class provides a character and line based interface to stream
    I/O. There is no public constructor.
    rcCs|�d�dS)z�Read at most size characters from stream, where size is an int.

        Read from underlying buffer until we have size characters or we hit EOF.
        If size is negative or omitted, read until EOF.

        Returns a string.
        r�Nr\r|rArArBr�szTextIOBase.readcCs|�d�dS)z.Write string s to stream and returning an int.r�Nr\)rI�srArArBr�(szTextIOBase.writeNcCs|�d�dS)z*Truncate size to pos, where pos is an int.rbNr\rcrArArBrb,szTextIOBase.truncatecCs|�d�dS)z_Read until newline or EOF.

        Returns an empty string if EOF is hit immediately.
        r�Nr\r`rArArBr�0szTextIOBase.readlinecCs|�d�dS)z�
        Separate the underlying buffer from the TextIOBase and return it.

        After the underlying buffer has been detached, the TextIO is in an
        unusable state.
        r�Nr\r`rArArBr�7szTextIOBase.detachcCsdS)zSubclasses should override.NrAr`rArArBr8@szTextIOBase.encodingcCsdS)z�Line endings translated so far.

        Only line endings translated during reading are considered.

        Subclasses should override.
        NrAr`rArArB�newlinesEszTextIOBase.newlinescCsdS)zMError setting of the decoder or encoder.

        Subclasses should override.NrAr`rArArBr9OszTextIOBase.errors)r)N)
rMrNrOrHr�r�rbr�r�r�r8rr9rArArArBrs


	

	rc@sTeZdZdZddd�Zddd�Zdd	�Zd
d�Zdd
�ZdZ	dZ
dZedd��Z
dS)�IncrementalNewlineDecodera+Codec used when reading a file in universal newlines mode.  It wraps
    another incremental decoder, translating \r\n and \r into \n.  It also
    records the types of newlines encountered.  When used with
    translate=False, it ensures that the newline sequence is returned in
    one piece.
    �strictcCs,tjj||d�||_||_d|_d|_dS)N)r9rF)�codecs�IncrementalDecoderr��	translate�decoder�seennl�	pendingcr)rIrrr9rArArBr�`s
z"IncrementalNewlineDecoder.__init__FcCs�|jdkr|}n|jj||d�}|jr<|s.|r<d|}d|_|�d�r\|s\|dd�}d|_|�d�}|�d�|}|�d�|}|j|o�|j|o�|jB|o�|jBO_|j	r�|r�|�
dd�}|r�|�
dd�}|S)N��final�
FrT�
�
)r�decoderr�r�r�_LF�_CR�_CRLFr�replace)rI�inputr�outputZcrlfZcrZlfrArArBr#gs*

�z IncrementalNewlineDecoder.decodecCs@|jdkrd}d}n|j��\}}|dK}|jr8|dO}||fS)Nr�rr
)r�getstater)rIr��flagrArArBr*�s
z"IncrementalNewlineDecoder.getstatecCs8|\}}t|d@�|_|jdk	r4|j�||d?f�dSr)�boolrr�setstate)rI�stater�r+rArArBr-�s
z"IncrementalNewlineDecoder.setstatecCs$d|_d|_|jdk	r |j��dS)NrF)rrr�resetr`rArArBr/�s
zIncrementalNewlineDecoder.resetr
r�cCs
d|jS)N)Nr"r )r r"r!)r"r!)r r!)r r"r!)rr`rArArBr�s�z"IncrementalNewlineDecoder.newlinesN)r)F)rMrNrOrHr�r#r*r-r/r$r%r&r�rrArArArBrYs

rc@sveZdZdZdZdZdOdd�Zdd�ZdPd	d
�Zdd�Z	e
d
d��Ze
dd��Ze
dd��Z
e
dd��Ze
dd��Zddeddd�dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Ze
d$d%��Ze
d&d'��Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�ZdQd4d5�Zd6d7�Z d8d9�Z!dRd;d<�Z"d=d>�Z#d?d@�Z$dSdAdB�Z%dCdD�Z&dTdEdF�Z'dUdGdH�Z(dIdJ�Z)dVdKdL�Z*e
dMdN��Z+dS)Wr3aCharacter and line based layer over a BufferedIOBase object, buffer.

    encoding gives the name of the encoding that the stream will be
    decoded or encoded with. It defaults to locale.getpreferredencoding(False).

    errors determines the strictness of encoding and decoding (see the
    codecs.register) and defaults to "strict".

    newline can be None, '', '\n', '\r', or '\r\n'.  It controls the
    handling of line endings. If it is None, universal newlines is
    enabled.  With this enabled, on input, the lines endings '\n', '\r',
    or '\r\n' are translated to '\n' before being returned to the
    caller. Conversely, on output, '\n' is translated to the system
    default line separator, os.linesep. If newline is any other of its
    legal values, that newline becomes the newline when the file is read
    and it is returned untranslated. On output, '\n' is converted to the
    newline.

    If line_buffering is True, a call to flush is implied when a call to
    write contains a newline character.
    iNFc		Cs|�|�|dkrvzt�|���}Wnttfk
r<YnX|dkrvzddl}Wntk
rjd}YnX|�d�}t	|t
�s�td|��t�
|�js�d}t||��|dkr�d}nt	|t
�s�td|��||_d|_d|_d|_|j��|_|_t|jd	�|_|�|||||�dS)
Nr�asciiFrzG%r is not a text encoding; use codecs.open() to handle arbitrary codecsrrrr�)�_check_newliner�device_encodingr,r/rV�locale�ImportErrorZgetpreferredencodingrrr#r�lookup�_is_text_encoding�LookupErrorr��_decoded_chars�_decoded_chars_used�	_snapshotr@rkr�_tellingr��
_has_read1�
_configure)	rIr@r8r9r:r?�
write_throughr4rmrArArBr��s>





�zTextIOWrapper.__init__cCs>|dk	r$t|t�s$tdt|�f��|dkr:td|f��dS)Nzillegal newline type: %r)Nrr"r r!zillegal newline value: %r)rrr �typer#)rIr:rArArBr2�szTextIOWrapper._check_newlinecCs�||_||_d|_d|_d|_||_|dk|_||_|dk|_|pHt	j
|_||_||_
|jr�|��r�|j��}|dkr�z|���d�Wntk
r�YnXdS)N�rr)�	_encoding�_errors�_encoder�_decoder�	_b2cratio�_readuniversal�_readtranslate�_readnl�_writetranslater�linesep�_writenl�_line_buffering�_write_throughrrqr@ra�_get_encoderr-r8)rIr8r9r:r?r?�positionrArArBr>�s&


zTextIOWrapper._configurecCs�d�|jj|jj�}z
|j}Wntk
r2YnX|d�|�7}z
|j}Wntk
r`YnX|d�|�7}|d�|j�S)Nz<{}.{}z name={0!r}z mode={0!r}z encoding={0!r}>)r�rXrNrOrYr/r4r8)rIr>rYr4rArArBr�!s
�

zTextIOWrapper.__repr__cCs|jSrQ)rBr`rArArBr82szTextIOWrapper.encodingcCs|jSrQ)rCr`rArArBr96szTextIOWrapper.errorscCs|jSrQ)rMr`rArArBr?:szTextIOWrapper.line_bufferingcCs|jSrQ)rNr`rArArBr?>szTextIOWrapper.write_throughcCs|jSrQ)r�r`rArArBr@BszTextIOWrapper.buffer)r8r9r:r?r?cCs�|jdk	r*|dk	s"|dk	s"|tk	r*td��|dkrH|dkrB|j}q^d}nt|t�s^td|��|dkrn|j}nt|t�s�td|��|tkr�|j}|�	|�|dkr�|j
}|dkr�|j}|��|�
|||||�dS)z`Reconfigure the text stream with new parameters.

        This also flushes the stream.
        NzPIt is not possible to set the encoding or newline of stream after the first readrrr)rE�EllipsisrVrCrrr rBrIr2r?r?rfr>)rIr8r9r:r?r?rArArB�reconfigureFs@
����



�zTextIOWrapper.reconfigurecCs|jrtd��|jS)Nrs)rhr#rr`rArArBrkoszTextIOWrapper.seekablecCs
|j��SrQ)r@ror`rArArBrotszTextIOWrapper.readablecCs
|j��SrQ)r@rqr`rArArBrqwszTextIOWrapper.writablecCs|j��|j|_dSrQ)r@rfrr<r`rArArBrfzs
zTextIOWrapper.flushcCs.|jdk	r*|js*z|��W5|j��XdSrQ)r@rhr5rfr`rArArBr5~szTextIOWrapper.closecCs|jjSrQ)r@rhr`rArArBrh�szTextIOWrapper.closedcCs|jjSrQ)r@rYr`rArArBrY�szTextIOWrapper.namecCs
|j��SrQ)r@r,r`rArArBr,�szTextIOWrapper.filenocCs
|j��SrQ)r@r)r`rArArBr)�szTextIOWrapper.isattycCs�|jrtd��t|t�s(td|jj��t|�}|js<|j	oBd|k}|rf|jrf|j
dkrf|�d|j
�}|jpr|�
�}|�|�}|j�|�|j	r�|s�d|kr�|��|�d�d|_|jr�|j��|S)zWrite data, where s is a strr�zcan't write %s to text streamr"r rN)rhr#rrr rXrMr"rJrMrLr'rDrO�encoder@r�rf�_set_decoded_charsr;rEr/)rIrZlengthZhaslf�encoderrrArArBr��s(
�


zTextIOWrapper.writecCst�|j�}||j�|_|jSrQ)r�getincrementalencoderrBrCrD)rIZmake_encoderrArArBrO�szTextIOWrapper._get_encodercCs2t�|j�}||j�}|jr(t||j�}||_|SrQ)r�getincrementaldecoderrBrCrGrrHrE)rIZmake_decoderrrArArB�_get_decoder�s
zTextIOWrapper._get_decodercCs||_d|_dS)zSet the _decoded_chars buffer.rN)r9r:)rI�charsrArArBrT�sz TextIOWrapper._set_decoded_charscCsF|j}|dkr|j|d�}n|j|||�}|jt|�7_|S)z'Advance into the _decoded_chars buffer.N)r:r9r")rIr{�offsetrYrArArB�_get_decoded_chars�sz TextIOWrapper._get_decoded_charscCs$|j|krtd��|j|8_dS)z!Rewind the _decoded_chars buffer.z"rewind decoded_chars out of boundsN)r:�AssertionErrorr�rArArB�_rewind_decoded_chars�s
z#TextIOWrapper._rewind_decoded_charscCs�|jdkrtd��|jr&|j��\}}|jr<|j�|j�}n|j�|j�}|}|j�	||�}|�
|�|r�t|�t|j�|_
nd|_
|jr�|||f|_|S)zQ
        Read and decode the next chunk of data from the BufferedReader.
        Nz
no decoderrA)rEr#r<r*r=r@r��_CHUNK_SIZEr�r#rTr"r9rFr;)rI�
dec_buffer�	dec_flags�input_chunk�eofZ
decoded_charsrArArB�_read_chunk�s 

zTextIOWrapper._read_chunkrcCs(||d>B|d>B|d>Bt|�d>BS)N�@���)r,)rIrPr`�
bytes_to_feed�need_eof�
chars_to_skiprArArB�_pack_cookie�s
�
�zTextIOWrapper._pack_cookiecCsFt|d�\}}t|d�\}}t|d�\}}t|d�\}}|||||fS)Nl)�divmod)rIZbigint�restrPr`rhrirjrArArB�_unpack_cookie	s
zTextIOWrapper._unpack_cookiec	Cs@|jstd��|jstd��|��|j��}|j}|dksF|jdkrX|j	rTt
d��|S|j\}}|t|�8}|j}|dkr�|�
||�S|��}�z�t|j|�}d}|dk�r"|�d|f�t|�|d|���}	|	|k�r|��\}
}|
s�|}||	8}�q4|t|
�8}d}q�||8}|d}q�d}|�d|f�||}|}
|dk�rZ|�
||
�W��Sd}d}d}t|t|��D]x}|d7}|t|�|||d���7}|��\}}|�s�||k�r�||7}||8}|dd}
}}||k�rt�q�qt|t|jddd	��7}d}||k�rtd
��|�
||
|||�W�S|�|�XdS)N�!underlying stream is not seekablez(telling position disabled by next() callzpending decoded textrr
r�rTrz'can't reconstruct logical file position)rrVr<r.rfr@rarEr;r9r\r"r:rkr*r-rrFr#�range)rIrPrr`Z
next_inputrjZsaved_stateZ
skip_bytesZ	skip_backr{r�d�	start_posZstart_flagsZ	bytes_fedriZ
chars_decoded�ir_rArArBra
	s�








�zTextIOWrapper.tellcCs$|��|dkr|��}|j�|�SrQ)rfrar@rbrcrArArBrbm	szTextIOWrapper.truncatecCs*|jdkrtd��|��|j}d|_|S)Nzbuffer is already detached)r@r#rfr�)rIr@rArArBr�s	s
zTextIOWrapper.detachcs��fdd�}�jrtd���js(td��|tkrN|dkr@td��d}���}nZ|tkr�|dkrftd������j�	d|�}��
d�d�_�jr��j�
�||�|S|dkr�td	|f��|dkr�td
|f�������|�\}}}}}	�j�	|���
d�d�_|dk�r*�j�r*�j�
�n@�j�s>|�s>|	�rj�j�pL����_�j�d|f�|df�_|	�r��j�|�}
��
�j�|
|��||
f�_t�j�|	k�r�td��|	�_||�|S)
NcsHz�jp���}Wntk
r&YnX|dkr<|�d�n|��dS)z9Reset the encoder (merely useful for proper BOM handling)rN)rDrOr8r-r/)rPrUr`rArB�_reset_encoder|	sz*TextIOWrapper.seek.<locals>._reset_encoderr�rorz#can't do nonzero cur-relative seeksz#can't do nonzero end-relative seeksrzunsupported whence (%r)r�r�z#can't restore logical file position)rhr#rrVrrar	rfr@r[rTr;rEr/rnrXr-r�r#r"r9r.r:)rIZcookier_rtrPrrr`rhrirjrarAr`rBr[{	s`



�

�
zTextIOWrapper.seekcCs�|��|dkrd}n4z
|j}Wn"tk
rBt|�d���YnX|�}|jpV|��}|dkr�|��|j|j�	�dd�}|�
d�d|_|Sd}|�|�}t|�|kr�|s�|�
�}||�|t|��7}q�|SdS)Nrr�rTrrF)rpr�r/r rErXr[r#r@r�rTr;r"rc)rIr}r�rr>rbrArArBr��	s,
�


zTextIOWrapper.readcCs(d|_|��}|s$d|_|j|_t�|S)NF)r<r�r;rr�r�rArArBr��	szTextIOWrapper.__next__c	Cs
|jrtd��|dkrd}n4z
|j}Wn"tk
rHt|�d���YnX|�}|��}d}|jsj|��d}}|jr�|�	d|�}|dkr�|d}�q�nt
|�}n�|j�rF|�	d|�}|�	d|�}|dkr�|dkr�t
|�}n|d}�q�nX|dk�r|d}�q�n@||k�r|d}�q�n(||dk�r8|d}�q�n|d}�q�n(|�	|j�}|dk�rn|t
|j�}�q�|dk�r�t
|�|k�r�|}�q�|�
��r�|j�r��q��q�|j�r�||��7}qr|�d	�d|_|Sqr|dk�r�||k�r�|}|�t
|�|�|d|�S)
Nr�rr�rr"r
r rr)rhr#r�r/r r[rErXrHryr"rGrIrcr9rTr;r])	rIr}r�r��startr^�endposZnlposZcrposrArArBr��	st







zTextIOWrapper.readlinecCs|jr|jjSdSrQ)rErr`rArArBrH
szTextIOWrapper.newlines)NNNFF)NNNFF)N)rrrr)N)r)N)N),rMrNrOrHr^r�r�r2r>r�r�r8r9r?r?r@rQrRrkrorqrfr5rhrYr,r)r�rOrXrTr[r]rcrkrnrarbr�r[r�r�r�rrArArArBr3�s|�
(�
$




�)



*�

c

K
	
]r3csReZdZdZd�fdd�	Zdd�Zdd	�Zed
d��Zedd
��Z	dd�Z
�ZS)�StringIOz�Text I/O implementation using an in-memory buffer.

    The initial_value argument sets the value of object.  The newline
    argument is like the one of TextIOWrapper's constructor.
    rr"csftt|�jt�dd|d�|dkr(d|_|dk	rbt|t�sNtd�t	|�j
���|�|�|�d�dS)Nzutf-8�
surrogatepass)r8r9r:Fz*initial_value must be str or None, not {0}r)
r�rwr�r�rJrrr r�r@rMr�r[)rIZ
initial_valuer:r�rArBr�T
s�
�
zStringIO.__init__c	CsP|��|jp|��}|��}|��z|j|j��dd�W�S|�|�XdS)NTr)	rfrErXr*r/r-r#r@r�)rIrZ	old_staterArArBr�d
szStringIO.getvaluecCs
t�|�SrQ)�objectr�r`rArArBr�n
szStringIO.__repr__cCsdSrQrAr`rArArBr9s
szStringIO.errorscCsdSrQrAr`rArArBr8w
szStringIO.encodingcCs|�d�dS)Nr�r\r`rArArBr�{
szStringIO.detach)rr")rMrNrOrHr�r�r�r�r9r8r�r�rArAr�rBrwM
s


rw)r
rNNNTN)8rHr�abcrr�r��sys�_threadrr��platformZmsvcrtrr�iorrrr	r�r��addr�	SEEK_DATAr*r�r�dev_moderirCrF�	open_coder/rGrPrVr.r#�ABCMetarW�registerr��_ior(r�r�r�r2r1r�r0rrrr3rwrArArArB�<module>s�


�
[

	
$=
ghCiIJY@U$__pycache__/aifc.cpython-38.opt-2.pyc000064400000047455151153537550013277 0ustar00U

e5d.��
@s>ddlZddlZddlZdddgZGdd�de�ZdZdd�Zd	d
�Zdd�Z	d
d�Z
dd�ZdZdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd lmZdd!lmZed"d#�Zd$ej_d%ej_d&ej_d'ej_d(ej_d)ej_Gd*d+�d+�Z Gd,d-�d-�Z!d@d.d�Z"dAd/d�Z#e$d0k�r:ddl%Z%e%j&d1d��sJe%j&�'d2�e%j&d1Z(e"e(d3���Z)e*d4e(�e*d5e)�+��e*d6e)�,��e*d7e)�-��e*d8e)�.��e*d9e)�/��e*d:e)�0��e%j&d;d��r0e%j&d;Z1e*d<e1�e"e1d=��6Z2e2�3e)�4��e)�5d>�Z6e6�s�qe2�7e6��q�W5QRXe*d?�W5QRXdS)B�N�Error�open�openfpc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/aifc.pyr�sl@QEcCs:zt�d|�d��dWStjk
r4td�YnXdS)N�>l�r��structZunpack�read�error�EOFError��filerrr	�
_read_long�srcCs:zt�d|�d��dWStjk
r4td�YnXdS)N�>Lrrrrrrr	�_read_ulong�srcCs:zt�d|�d��dWStjk
r4td�YnXdS)N�>h�rrrrrr	�_read_short�srcCs:zt�d|�d��dWStjk
r4td�YnXdS)N�>Hrrrrrrr	�_read_ushort�srcCs@t|�d��}|dkrd}n
|�|�}|d@dkr<|�d�}|S)N�r�)�ordr)r�length�data�dummyrrr	�_read_string�s

r!g�����cCs�t|�}d}|dkr d}|d}t|�}t|�}||krN|krNdkrXnnd}n0|dkrft}n"|d}|d|td	|d
�}||S)Nrr�����g�i�?lg@�?)rr�	_HUGE_VAL�pow)�f�expon�sign�himant�lomantrrr	�_read_float�s"r-cCs|�t�d|��dS)Nr��writer
�pack�r(�xrrr	�_write_short�sr3cCs|�t�d|��dS)Nrr.r1rrr	�
_write_ushort�sr4cCs|�t�d|��dS)Nr
r.r1rrr	�_write_long�sr5cCs|�t�d|��dS)Nrr.r1rrr	�_write_ulong�sr6cCsRt|�dkrtd��|�t�dt|���|�|�t|�d@dkrN|�d�dS)N�z%string exceeds maximum pstring length�Brr�)�len�
ValueErrorr/r
r0)r(�srrr	�
_write_string�s
r=c	Cs�ddl}|dkrd}|d}nd}|dkr8d}d}d}n�|�|�\}}|dks^|dks^||krp|dB}d}d}nh|d}|dkr�|�||�}d}||B}|�|d�}|�|�}t|�}|�||d�}|�|�}t|�}t||�t||�t||�dS)	Nrr#r"i@rr$i�?� )�mathZfrexpZldexpZfloor�intr4r6)	r(r2r?r*r)r+r,ZfmantZfsmantrrr	�_write_float�s8




rA)�Chunk)�
namedtuple�_aifc_paramsz7nchannels sampwidth framerate nframes comptype compnamez3Number of audio channels (1 for mono, 2 for stereo)zSample width in byteszSampling frequencyzNumber of audio framesz(Compression type ("NONE" for AIFF files)zRA human-readable version of the compression type
('not compressed' for AIFF files)c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�ZdS)2�	Aifc_readNcCs8d|_d|_g|_d|_||_t|�}|��dkr:td��|�d�}|dkrTd|_	n|dkrdd|_	ntd��d|_
d|_d|_zt|j�}Wnt
k
r�Y�qYnX|��}|d	kr�|�|�d|_
nH|d
kr�||_|�d�}d|_n(|dkr�t|�|_n|d
k�r|�|�|��qx|j
�r,|j�s4td��dS)Nr�FORMz file does not start with FORM idr�AIFF�AIFCrznot an AIFF or AIFF-C file�COMM�SSND��FVER�MARKz$COMM chunk and/or SSND chunk missing)�_version�_convert�_markers�	_soundpos�_filerBZgetnamerr�_aifcZ_comm_chunk_read�_ssnd_chunk�_ssnd_seek_neededr�_read_comm_chunkr�	_readmark�skip)�selfr�chunkZformdataZ	chunknamer rrr	�initfp4sH





zAifc_read.initfpcCsLt|t�r>t�|d�}z|�|�WqH|���YqHXn
|�|�dS)N�rb)�
isinstance�str�builtinsrr[�close�rYr(Zfile_objectrrr	�__init__\s

zAifc_read.__init__cCs|S�Nr�rYrrr	�	__enter__hszAifc_read.__enter__cGs|��dSrc�r`�rY�argsrrr	�__exit__kszAifc_read.__exit__cCs|jSrc)rRrdrrr	�getfpqszAifc_read.getfpcCsd|_d|_dS)Nrr)rUrQrdrrr	�rewindtszAifc_read.rewindcCs |j}|dk	rd|_|��dSrc)rRr`�rYrrrr	r`xszAifc_read.closecCs|jSrc)rQrdrrr	�tell~szAifc_read.tellcCs|jSrc)�
_nchannelsrdrrr	�getnchannels�szAifc_read.getnchannelscCs|jSrc)�_nframesrdrrr	�
getnframes�szAifc_read.getnframescCs|jSrc)�
_sampwidthrdrrr	�getsampwidth�szAifc_read.getsampwidthcCs|jSrc)�
_frameraterdrrr	�getframerate�szAifc_read.getframeratecCs|jSrc��	_comptyperdrrr	�getcomptype�szAifc_read.getcomptypecCs|jSrc��	_compnamerdrrr	�getcompname�szAifc_read.getcompnamecCs*t|��|��|��|��|��|���Src)rDrorsrurqrxr{rdrrr	�	getparams�s�zAifc_read.getparamscCst|j�dkrdS|jS�Nr�r:rPrdrrr	�
getmarkers�szAifc_read.getmarkerscCs2|jD]}||dkr|Sqtd�|���dS�Nrzmarker {0!r} does not exist�rPr�format�rY�id�markerrrr	�getmark�s

zAifc_read.getmarkcCs*|dks||jkrtd��||_d|_dS)Nrzposition not in ranger)rprrQrU)rY�posrrr	�setpos�szAifc_read.setposcCs�|jrD|j�d�|j�d�}|j|j}|r>|j�|d�d|_|dkrPdS|j�||j�}|jrv|rv|�|�}|jt|�|j|j	|_|S)NrrKr)
rUrT�seekrrQ�
_framesizerOr:rnrr)rY�nframesr r�rrrr	�
readframes�s 

�
zAifc_read.readframescCsddl}|�|d�S�Nrr)�audioopZalaw2lin�rYrr�rrr	�	_alaw2lin�szAifc_read._alaw2lincCsddl}|�|d�Sr�)r�Zulaw2linr�rrr	�	_ulaw2lin�szAifc_read._ulaw2lincCs2ddl}t|d�sd|_|�|d|j�\}|_|S�Nr�_adpcmstater)r��hasattrr�Z	adpcm2linr�rrr	�
_adpcm2lin�s

zAifc_read._adpcm2lincCsVt|�|_t|�|_t|�dd|_tt|��|_|jdkrFtd��|jdkrXtd��|j|j|_	|j
�rFd}|jdkr�d}t�
d�d	|_|�d
�|_|r�t|j�d��}|d@dkr�|d}|j||_|j�dd�t|�|_|jdk�rR|jd
k�r
|j|_n4|jdk�r |j|_n|jdk�r6|j|_ntd��d|_nd|_d|_dS)N�rKr�bad sample width�bad # of channels�rzWarning: bad COMM chunk size�rr"�NONE�G722��ulaw�ULAW��alaw�ALAW�unsupported compression typer�not compressed)rrnrrprrr@r-rtrr�rSZ	chunksize�warnings�warnrrwrrr�r!rzr�rOr�r�)rYrZZkludgerrrr	rV�sD









zAifc_read._read_comm_chunkcCs�t|�}zDt|�D]6}t|�}t|�}t|�}|s6|r|j�|||f�qWnDtk
r�dt|j�t|j�dkrxdnd|f}t�	|�YnXdS)Nz;Warning: MARK chunk contains only %s marker%s instead of %sr�r<)
r�rangerr!rP�appendrr:r�r�)rYrZZnmarkers�ir�r��name�wrrr	rW�s��zAifc_read._readmark)rrrrRr[rbrerirjrkr`rmrorqrsrurxr{r|rr�r�r�r�r�r�rVrWrrrr	rEs2$(*rEc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Z d<d=�Z!d>d?�Z"d@dA�Z#dBdC�Z$dDdE�Z%dFdG�Z&dHdI�Z'dS)J�
Aifc_writeNcCs\t|t�rNt�|d�}z|�|�Wn|���YnX|�d�rXd|_n
|�|�dS)N�wbz.aiffr)r]r^r_rr[r`�endswithrSrarrr	rb/s

zAifc_write.__init__cCs^||_t|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_g|_
d|_d|_dS)Nr�r�rr)rR�
_AIFC_versionrNrwrzrOrnrrrtrp�_nframeswritten�_datawritten�_datalengthrP�_marklengthrSrlrrr	r[?szAifc_write.initfpcCs|��dSrcrfrdrrr	�__del__PszAifc_write.__del__cCs|Srcrrdrrr	reSszAifc_write.__enter__cGs|��dSrcrfrgrrr	riVszAifc_write.__exit__cCs|jrtd��d|_dS)N�0cannot change parameters after starting to writer�r�rrSrdrrr	�aiff\szAifc_write.aiffcCs|jrtd��d|_dS)Nr�rr�rdrrr	�aifcaszAifc_write.aifccCs(|jrtd��|dkrtd��||_dS)Nr�rr�)r�rrn)rY�	nchannelsrrr	�setnchannelsfs
zAifc_write.setnchannelscCs|jstd��|jS)Nznumber of channels not set)rnrrdrrr	romszAifc_write.getnchannelscCs0|jrtd��|dks|dkr&td��||_dS)Nr�rrr�)r�rrr)rY�	sampwidthrrr	�setsampwidthrs
zAifc_write.setsampwidthcCs|jstd��|jS)Nzsample width not set)rrrrdrrr	rsyszAifc_write.getsampwidthcCs(|jrtd��|dkrtd��||_dS)Nr�rzbad frame rate)r�rrt)rY�	frameraterrr	�setframerate~s
zAifc_write.setframeratecCs|jstd��|jS)Nzframe rate not set)rtrrdrrr	ru�szAifc_write.getframeratecCs|jrtd��||_dS)Nr�)r�rrp)rYr�rrr	�
setnframes�szAifc_write.setnframescCs|jSrc�r�rdrrr	rq�szAifc_write.getnframescCs.|jrtd��|dkrtd��||_||_dS�Nr�)r�r�r�r�r�r�r�)r�rrwrz)rY�comptype�compnamerrr	�setcomptype�szAifc_write.setcomptypecCs|jSrcrvrdrrr	rx�szAifc_write.getcomptypecCs|jSrcryrdrrr	r{�szAifc_write.getcompnamecCsf|\}}}}}}|jrtd��|dkr.td��|�|�|�|�|�|�|�|�|�||�dSr�)r�rr�r�r�r�r�)rYZparamsr�r�r�r�r�r�rrr	�	setparams�s



zAifc_write.setparamscCs8|jr|jr|jstd��t|j|j|j|j|j|j�S)Nznot all parameters set)rnrrrtrrDrprwrzrdrrr	r|�s�zAifc_write.getparamscCs�|dkrtd��|dkr td��t|t�s2td��tt|j��D],}||j|dkr@|||f|j|<dSq@|j�|||f�dS)Nrzmarker ID must be > 0zmarker position must be >= 0zmarker name must be bytes)rr]�bytesr�r:rPr�)rYr�r�r�r�rrr	�setmark�s
zAifc_write.setmarkcCs2|jD]}||dkr|Sqtd�|���dSr�r�r�rrr	r��s

zAifc_write.getmarkcCst|j�dkrdS|jSr}r~rdrrr	r�szAifc_write.getmarkerscCs|jSrcr�rdrrr	rm�szAifc_write.tellcCszt|ttf�st|��d�}|�t|��t|�|j|j}|j	rN|�	|�}|j
�|�|j||_|j
t|�|_
dS)Nr8)r]r��	bytearray�
memoryview�cast�_ensure_header_writtenr:rrrnrOrRr/r�r�)rYrr�rrr	�writeframesraw�s
zAifc_write.writeframesrawcCs.|�|�|j|jks"|j|jkr*|��dSrc)r�r�rpr�r��_patchheader)rYrrrr	�writeframes�s


�zAifc_write.writeframescCs�|jdkrdSz^|�d�|jd@r<|j�d�|jd|_|��|j|jksb|j	|jksb|j
rj|��W5d|_|j}d|_|��XdS)Nrrr9)rRrOr`r�r�r/�
_writemarkersr�rpr�r�r�)rYr(rrr	r`�s$



��zAifc_write.closecCsddl}|�|d�Sr�)r�Zlin2alawr�rrr	�	_lin2alaw�szAifc_write._lin2alawcCsddl}|�|d�Sr�)r�Zlin2ulawr�rrr	�	_lin2ulawszAifc_write._lin2ulawcCs2ddl}t|d�sd|_|�|d|j�\}|_|Sr�)r�r�r�Z	lin2adpcmr�rrr	�
_lin2adpcms

zAifc_write._lin2adpcmcCsf|jsb|jdkr.|jsd|_|jdkr.td��|js<td��|jsJtd��|jsXtd��|�|�dS)N�r�r�r�r�r�rzRsample width must be 2 when compressing with ulaw/ULAW, alaw/ALAW or G7.22 (ADPCM)z# channels not specifiedzsample width not specifiedzsampling rate not specified)r�rwrrrrnrt�
_write_header)rYZdatasizerrr	r�
s

z!Aifc_write._ensure_header_writtencCs>|jdkr|j|_n&|jdkr(|j|_n|jdkr:|j|_dS)Nr�r�r�)rwr�rOr�r�rdrrr	�_init_compressions




zAifc_write._init_compressionc	CsJ|jr|jdkr|��|j�d�|js<||j|j|_|j|j|j|_|jd@rf|jd|_|jr�|jdkr�|jd|_|jd@r�|jd|_n0|jdkr�|jdd|_|jd@r�|jd|_z|j�	�|_
Wnttfk
r�d|_
YnX|�
|j�}|j�rB|j�d	�|j�d
�t|jd�t|j|j�n|j�d�|j�d�t|j|�t|j|j�|j
dk	�r�|j�	�|_t|j|j�|jd
k�r�t|jd�nt|j|jd�t|j|j�|j�r�|j�|j�t|j|j�|j�d�|j
dk	�r|j�	�|_t|j|jd�t|jd�t|jd�dS)Nr�rFr)r�r�r�r�rr��rrHrLrGrIr�rKrJr)rSrwr�rRr/rprnrrr�rm�_form_length_pos�AttributeError�OSError�_write_form_lengthr6rNr3�_nframes_posrArtr=rz�_ssnd_length_pos)rYZ
initlength�
commlengthrrr	r�%s^




zAifc_write._write_headercCs\|jr*dt|j�}|d@r$|d}d}nd}d}t|jd||jd|d|�|S)	Nr�r�r�rrrK�)rSr:rzr6rRr�)rY�
datalengthr�Z
verslengthrrr	r�Xs"����zAifc_write._write_form_lengthcCs�|j��}|jd@r,|jd}|j�d�n|j}||jkrd|j|jkrd|jdkrd|j�|d�dS|j�|j	d�|�
|�}|j�|jd�t|j|j�|j�|j
d�t|j|d�|j�|d�|j|_||_dS)Nrr9rrK)rRrmr�r/r�rpr�r�r�r�r�r�r6r�)rYZcurposr�r rrr	r�es*




��
zAifc_write._patchheadercCs�t|j�dkrdS|j�d�d}|jD]:}|\}}}|t|�dd}t|�d@dkr(|d}q(t|j|�|d|_t|jt|j��|jD]2}|\}}}t|j|�t|j|�t|j|�q�dS)NrrMrr�rK)r:rPrRr/r6r�r3r=)rYrr�r�r�r�rrr	r�{s"





zAifc_write._writemarkers)(rrrrRrbr[r�rerir�r�r�ror�rsr�rur�rqr�rxr{r�r|r�r�rrmr�r�r`r�r�r�r�r�r�r�r�r�rrrr	r�sJ	

3
r�cCsJ|dkrt|d�r|j}nd}|dkr.t|�S|dkr>t|�Std��dS)N�moder\)�rr\)r�r�z$mode must be 'r', 'rb', 'w', or 'wb')r�r�rEr�r�r(r�rrr	r�s
cCstjdtdd�t||d�S)NzBaifc.openfp is deprecated since Python 3.7. Use aifc.open instead.r)�
stacklevel)r�)r�r��DeprecationWarningrr�rrr	r�s
��__main__rz/usr/demos/data/audio/bach.aiffr�ZReadingznchannels =znframes   =zsampwidth =zframerate =zcomptype  =zcompname  =rZWritingr�izDone.)N)N)8r
r_r��__all__�	Exceptionrr�rrrrr!r&r-r3r4r5r6r=rArZrB�collectionsrCrDr��__doc__r�r�r�r�r�rEr�rrr�sys�argvr��fnr(�printrorqrsrurxr{Zgn�gr�r|r�rr�rrrr	�<module>�sz

!�







__pycache__/platform.cpython-38.pyc000064400000057410151153537550013251 0ustar00U

e5d��@sldZdZdZddlZddlZddlZddlZddddddd	d	d
d
d�
Ze�d�Z	d
d�Z
e�dej�Zdwdd�Z
dxdd�Ze�d�Zdydd�Zddddddd d!d"d#d$d%�Zdd&d'd(d)d*d+�Zd,d-�Zd.d/�Zdzd0d1�Zd2d3�Zd{d5d6�Zd7d8�Zd|d9d:�Zd;d<�Zd=d>�Zd}d?d@�ZdAdB�Zd~dCdD�ZddEdF�ZdGdHdId�Z ej!ddfdJdK�Z"e�#dLdM�Z$da%dNdO�Z&dPdQ�Z'dRdS�Z(dTdU�Z)dVdW�Z*dXdY�Z+dZd[�Z,e�d\ej�Z-e�d]ej�Z.e�d^�Z/e�d_�Z0iZ1d�d`da�Z2dbdc�Z3ddde�Z4dfdg�Z5dhdi�Z6djdk�Z7dldm�Z8dndo�Z9iZ:d�dpdq�Z;e<drk�rhdsej=k�p8dtej=kZ>duej=k�oNdvej=kZ?e@e;e?e>��e�Ad�dS)�a8 This module tries to retrieve as much platform-identifying data as
    possible. It makes this information available via function APIs.

    If called from the command line, it prints the platform
    information concatenated as single string to stdout. The output
    format is useable as part of a filename.

a
    Copyright (c) 1999-2000, Marc-Andre Lemburg; mailto:mal@lemburg.com
    Copyright (c) 2000-2010, eGenix.com Software GmbH; mailto:info@egenix.com

    Permission to use, copy, modify, and distribute this software and its
    documentation for any purpose and without fee or royalty is hereby granted,
    provided that the above copyright notice appear in all copies and that
    both that copyright notice and this permission notice appear in
    supporting documentation or portions thereof, including modifications,
    that you make.

    EGENIX.COM SOFTWARE GMBH DISCLAIMS ALL WARRANTIES WITH REGARD TO
    THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
    FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
    INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
    FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
    NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
    WITH THE USE OR PERFORMANCE OF THIS SOFTWARE !

z1.0.8�N�
���(�2��)
ZdevZalpha�aZbeta�b�cZRCZrc�pl�pz([0-9]+|[._+-])c	Csbg}t�|�D]N}|dkrzt|d�}d}Wn tk
rLt�|d�}YnX|�||f�q|S)Nz._+-r�dr)�
_component_re�split�int�
ValueError�_ver_stages�get�extend)�version�result�v�t�r� /usr/lib64/python3.8/platform.py�_comparable_version�s
rsC(__libc_init)|(GLIBC_([0-9.]+))|(libc(_\w+)?\.so(?:\.(\d[0-9.]*))?)��@c
Cs�|dkrZz0t�d�}|jdd�}t|�dkr6t|�WSWntttfk
rRYnXtj	}t
}ttjd�rvtj�
|�}t|d���`}|�|�}d}	|	t|�k�r�d	|ks�d
|kr�t�||	�}
nd}
|
r�|
��t|�k�r|�|�}|�r|t|	t|�d�d�|}d}	q�|
�s�q�dd
�|
��D�\}}
}}}}|�rF|�sFd}n�|
�rx|dk�r`d}|}n||�||�k�r�|}n\|�r�|dk�r�d}|�r�|�r�||�||�k�r�|}|�r�|t|�d�|k�r�||}|
��}	q�W5QRX||fS)a Tries to determine the libc version that the file executable
        (which defaults to the Python interpreter) is linked against.

        Returns a tuple of strings (lib,version) which default to the
        given parameters in case the lookup fails.

        Note that the function has intimate knowledge of how different
        libc versions add symbols to the executable and thus is probably
        only useable for executables compiled using gcc.

        The file is read and scanned in chunks of chunksize bytes.

    N�CS_GNU_LIBC_VERSION�)�maxsplit��realpath�rbrslibcsGLIBCi�cSs"g|]}|dk	r|�d�n|�qS)N�latin1)�decode)�.0�srrr�
<listcomp>�s�zlibc_ver.<locals>.<listcomp>Zlibc�glibc)�os�confstrr�len�tuple�AttributeErrorr�OSError�sys�
executabler�hasattr�pathr"�open�read�_libc_search�search�end�max�groups)r1�librZ	chunksize�ver�parts�V�fZbinary�pos�m�chunkZlibcinitr)ZglibcversionZsoZthreadsZ	soversionrrr�libc_ver�s^


�

rCcCs`|�d�}|r|�|�zttttt|���}Wntk
rH|}YnXd�|dd��}|S)z� Normalize the version and build strings and return a single
        version string using the format major.minor.build (or patchlevel).
    �.N�)r�append�list�map�strrr�join)r�build�lZstringsrrr�
_norm_version�s


rMz'(?:([\w ]+) ([\w.]+) .*\[.* ([\d.]+)\])��win32�win16�dosc	Cs�tj|kr|||fSddl}dD]R}z|j||jddd�}Wn0t|jfk
rl}zWY�q W5d}~XYq Xq~q |||fS|��}t�	|�}|dk	r�|�
�\}}}|ddkr�|dd�}|ddkr�|dd�}t|�}|||fS)a+ Tries to figure out the OS version used and returns
        a tuple (system, release, version).

        It uses the "ver" shell command for this which is known
        to exists on Windows, DOS. XXX Others too ?

        In case this fails, the given parameters are used as
        defaults.

    rN)r<zcommand /c verz
cmd /c verT)�stderr�text�shell���rD)r0�platform�
subprocess�check_output�DEVNULLr/�CalledProcessError�strip�_ver_output�matchr:rM)	�system�releaserZsupported_platformsrW�cmd�infoZwhyrArrr�_syscmd_vers0

�


rbZ2000ZXPZ
2003ServerZpost2003�Vista�7�8z8.1zpost8.1Z10Zpost10))�r)rfr�rfr!)rfN��r�rir�rir!�rirE�riN)rr)rNZ
2008ServerZ2008ServerR2Z
2012ServerZ2012ServerR2Zpost2012ServerR2)rgrhrjrkrlrmcCs
t�dkS)N)ZIoTUAPZ
NanoServerZWindowsCoreHeadlessZ	IoTEdgeOS)�
win32_editionrrrr�win32_is_iotOsroc
Cs�z.zddl}Wntk
r*ddl}YnXWntk
rBYnTXz<d}|�|j|�� }|�|d�dW5QR�WSQRXWntk
r�YnXdS)Nr�,SOFTWARE\Microsoft\Windows NT\CurrentVersionZ	EditionId)�winreg�ImportError�_winreg�	OpenKeyEx�HKEY_LOCAL_MACHINE�QueryValueExr/)rq�cvkey�keyrrrrnRs(rnc	Cs�zddlm}Wn tk
r0||||fYSX|�}z ttt�d�d��\}}}Wn,tk
r�|jpx|dd�\}}}YnXd�	|||�}t
�||f�p�t
�|df�p�|}|dd�||fk�rzd�	|j�}Wn8t
k
�r|dd�d	k�rd
|dd�}YnXt|dd�dk�rJt�||f��pHt�|df��pH|}z0zddl}	Wntk
�rvddl}	YnXWntk
�r�YnLXz2d}
|	�|	j|
��}|	�|d
�d}W5QRXWntk
�r�YnX||||fS)Nr)�getwindowsversionr!rDrEz{0}.{1}.{2}zSP{}�
z
Service Pack ZSPZproduct_typerpZCurrentType)r0ryrrrHrrbrrZplatform_version�format�_WIN32_CLIENT_RELEASESrZservice_pack_majorr.�getattr�_WIN32_SERVER_RELEASESrqrsrtrurvr/)r_r�csd�ptyperyZwinver�major�minorrKrqrwrxrrr�	win32_verdsR ����r�c	Cs�d}tj�|�sdSzddl}Wntk
r6YdSXt|d��}|�|�}W5QRX|d}d}t��j}|dkrzd}|||fS)Nz0/System/Library/CoreServices/SystemVersion.plistrr#ZProductVersion�rrr)ZppczPower MacintoshZPowerPC)	r*r3�exists�plistlibrrr4�load�uname�machine)�fnr�r?rr_�versioninfor�rrr�_mac_ver_xml�s
r�r�cCst�}|dk	r|S|||fS)a< Get macOS version information and return it as tuple (release,
        versioninfo, machine) with versioninfo being a tuple (version,
        dev_stage, non_release_version).

        Entries which cannot be determined are set to the parameter values
        which default to ''. All tuple entries are strings.
    N)r�)r_r�r�rarrr�mac_ver�sr�cCsHddlm}z|�|�}|dkr&|WS|WStk
rB|YSXdS)Nr)�System)�	java.langr�ZgetPropertyr.)�name�defaultr��valuerrr�
_java_getprop�s
r�cCs�zddl}Wn tk
r,||||fYSXtd|�}td|�}|\}}}td|�}td|�}td|�}|||f}|\}}	}
td|
�}
td	|�}td
|	�}	||	|
f}||||fS)a] Version interface for Jython.

        Returns a tuple (release, vendor, vminfo, osinfo) with vminfo being
        a tuple (vm_name, vm_release, vm_vendor) and osinfo being a
        tuple (os_name, os_version, os_arch).

        Values which cannot be determined are set to the defaults
        given as parameters (which all default to '').

    rNzjava.vendorzjava.versionzjava.vm.namezjava.vm.vendorzjava.vm.versionzjava.os.archzjava.os.namezjava.os.version)r�rrr�)r_�vendor�vminfo�osinfo�javaZvm_nameZ
vm_releaseZ	vm_vendor�os_name�
os_version�os_archrrr�java_ver�s"












r�cCs�|dkr�|dkr|||fS|�d�}|rlzt|d�}Wntk
rLYn X|d}t|�|d<d�|�}|dkrzd}q�d}n,|dkr�d	}|r�|d
}q�d}n|dkr�d
}|||fS)z� Returns (system, release, version) aliased to common
        marketing names used for some systems.

        It also does some reordering of the information in some cases
        where it would otherwise cause confusion.

    ZSunOS�5rDrrE�6ZSolarisZIRIX64ZIRIXz (64bit)�64bit�rOrP�Windows)rrrrIrJ)r^r_rrLr�rrr�system_alias�s.	



r�cGs�d�dd�tt|�D��}|�dd�}|�dd�}|�dd�}|�dd�}|�d	d�}|�d
d�}|�dd�}|�dd�}|�d
d�}|�dd�}||kr�q�|}q�|ddkr�|dd�}q�|S)zq Helper to format the platform string in a filename
        compatible format e.g. "system-version-machine".
    �-css|]}|��VqdS)N)r[)r&�xrrr�	<genexpr>(sz_platform.<locals>.<genexpr>� �_�/�\�:�;�"�(�)�unknownrz--rUN)rJ�filterr,�replace)�argsrVZcleanedrrr�	_platform"s"r�cCsNzddl}Wntk
r$|YSXz
|��WStk
rH|YSXdS)z8 Helper to determine the node name of this machine.
    rN)�socketrrZgethostnamer/)r�r�rrr�_nodeBs

r�cCsBtj�|�}tj�|�r>tj�tj�tj�|�t�|���}q|S)zT In case filepath is a symlink, follow it until a
        real file is reached.
    )r*r3�abspath�islink�normpathrJ�dirname�readlink)�filepathrrr�_follow_symlinksQs�r�c	Cs\tjdkr|Sddl}z|jd|f|jdd�}Wnt|jfk
rN|YSX|��pZ|S)z. Interface to the system's uname command.
    �rQrOrPrNr�T)rRrS)r0rVrWrXrYr/rZr[)Zoptionr�rW�outputrrr�
_syscmd_uname\s

�

r�c	Csztjdkr|Sddl}t|�}ttjdd�}z|jdd|g|j|d�}Wnt	|j
fk
rf|YSX|sp|S|�d	�S)
z� Interface to the system's file command.

        The function uses the -b option of the file command to have it
        omit the filename in its output. Follow the symlinks. It returns
        default in case the command should fail.

    r�rN�C)�LC_ALL�filez-b)rR�envzlatin-1)r0rVrWr��dictr*�environrXrYr/rZr%)�targetr�rWr�r�rrr�_syscmd_filems	
�

r�)r�	WindowsPE)rr�)r�MSDOScCs|s&ddl}|�d�}t|d�d}|r6t|d�}nd}|sx|tjkrxtjtkrpttj\}}|rh|}|rp|}||fSd|kr�d|kr�||fSd	|kr�d
}nd|kr�d}nd
|kr�d}d|kr�d}n8d|kr�d|kr�d}q�d}nd|kr�d}nd|kr�d}n||fS)a� Queries the given executable (defaults to the Python interpreter
        binary) for various architecture information.

        Returns a tuple (bits, linkage) which contains information about
        the bit architecture and the linkage format used for the
        executable. Both values are returned as strings.

        Values that cannot be determined are returned as given by the
        parameter presets. If bits is given as '', the sizeof(pointer)
        (or sizeof(long) on Python version < 1.5.2) is used as
        indicator for the supported pointer size.

        The function relies on the system's "file" command to do the
        actual work. This is available on most if not all Unix
        platforms. On some non-Unix platforms where the "file" command
        does not exist and the executable is set to the Python interpreter
        binary defaults from _default_architecture are used.

    rN�P��bitrr1z
shared objectz32-bit�32bitZN32Zn32bitz64-bitr�ZELFZPEr�r�ZCOFFzMS-DOSr�)�structZcalcsizerIr�r0r1rV�_default_architecture)r1�bits�linkager��sizeZfileoutr	rLrrr�architecture�sH
�
r��uname_resultz-system node release version machine processorcCs�d}tdk	rtSd}zt��\}}}}}Wntk
rBd}YnX|sbttd|||||f���s�|r~tj}d}d}t�}d}d}|dkr�t	�\}}}}	|r�|r�d}|s�dtj
kr�tj
�dd�}ntj
�dd�}|s�tj
�d|�}|�r:t|�\}}}|d	k�rd
}n4|dk�r:|d
k�r:d
}d|dd
�k�r6d}nd}|dk�rd|�s^|dk�rZd}nd}d
}n8|dd�dk�r�t
�\}}
}}d}d�|�}|�s�|
}|dk�r|�r�|dk�r�|}d}zddl}
Wntk
�r�Yn&X|
�dd�\}}|dk�rd}nd}|�stdd�}|dk�r$d}|dk�r2d}|dk�r@d}|dk�rNd}|dk�r\d}|dk�rjd}|dk�r�|d
k�r�d
}d}t||||||�atS)an Fairly portable uname interface. Returns a tuple
        of strings (system, node, release, version, machine, processor)
        identifying the underlying platform.

        Note that unlike the os.uname function this also returns
        possible processor information as an additional tuple entry.

        Entries which cannot be determined are set to ''.

    rNrrrOZPROCESSOR_ARCHITEW6432ZPROCESSOR_ARCHITECTUREZPROCESSOR_IDENTIFIERzMicrosoft Windowsr�Z	Microsoftz6.0rErcr�r�Z16bit�r��Javaz, ZOpenVMS�0zSYI$_CPU�ZAlphaZVAXz-pr�)�_uname_cacher*r�r.rGr�r0rVr�r�r�rrbr�rJ�vms_librrZgetsyir�r�)Zno_os_uname�	processorr^�noder_rr�Zuse_syscmd_verrr�r�r�r�r�ZcsidZ
cpu_numberrrrr��s�
















�r�cCst�jS)z� Returns the system/OS name, e.g. 'Linux', 'Windows' or 'Java'.

        An empty string is returned if the value cannot be determined.

    )r�r^rrrrr^usr^cCst�jS)z� Returns the computer's network name (which may not be fully
        qualified)

        An empty string is returned if the value cannot be determined.

    )r�r�rrrrr�~sr�cCst�jS)z� Returns the system's release, e.g. '2.2.0' or 'NT'

        An empty string is returned if the value cannot be determined.

    )r�r_rrrrr_�sr_cCst�jS)z� Returns the system's release version, e.g. '#3 on degas'

        An empty string is returned if the value cannot be determined.

    )r�rrrrrr�srcCst�jS)zt Returns the machine type, e.g. 'i386'

        An empty string is returned if the value cannot be determined.

    )r�r�rrrrr��sr�cCst�jS)a Returns the (true) processor name, e.g. 'amdk6'

        An empty string is returned if the value cannot be
        determined. Note that many platforms do not provide this
        information or simply return the same value as for machine(),
        e.g.  NetBSD does this.

    )r�r�rrrrr��s
r�zL([\w.+]+)\s*\(#?([^,]+)(?:,\s*([\w ]*)(?:,\s*([\w :]*))?)?\)\s*\[([^\]]+)\]?z;IronPython\s*([\d\.]+)(?: \(([\d\.]+)\))? on (.NET [\d\.]+)zU([\d.]+)\s*\(IronPython\s*[\d.]+\s*\(([\d.]+)\) on ([\w.]+ [\d.]+(?: \(\d+-bit\))?)\)zE([\w.+]+)\s*\(#?([^,]+),\s*([\w ]+),\s*([\w :]+)\)\s*\[PyPy [^\]]+\]?cCs|dkrtj}t�|d�}|dk	r&|Sd|kr�d}|�d�rHt�|�}n
t�|�}|dkrjtdt	|���|�
�\}}}d}d}n�tj�d�r�d}t�|�}|dkr�tdt	|���|�
�\}}}}	}
|dkr�d}tj}n�d|k�r"d}t
�|�}|dk�rtd	t	|���|�
�\}}}}	d}n\t�|�}|dk�rFtd
t	|���|�
�\}}}}	}d}|dk�rld}n|	�r~|d|	}ttd
��r�tj\}
}}n"ttd��r�tj\}
}}nd}d}|�d�}
t|
�dk�r�|
�d�d�|
�}|||||||f}|t|<|S)a� Returns a parsed version of Python's sys.version as tuple
        (name, version, branch, revision, buildno, builddate, compiler)
        referring to the Python implementation name, version, branch,
        revision, build number, build date/time as string and the compiler
        identification string.

        Note that unlike the Python sys.version, the returned value
        for the Python version will always include the patchlevel (it
        defaults to '.0').

        The function returns empty strings for tuple entries that
        cannot be determined.

        sys_version may be given to parse an alternative version
        string, e.g. if the version was read from a different Python
        interpreter.

    NZ
IronPythonz*failed to parse IronPython sys.version: %srr�ZJythonz&failed to parse Jython sys.version: %sZPyPyz$failed to parse PyPy sys.version: %sz'failed to parse CPython sys.version: %sZCPythonr��_git�
_mercurialrDr!r�)r0r�_sys_version_cacher�
startswith�_ironpython_sys_version_parserr]� _ironpython26_sys_version_parserr�reprr:rV�_sys_version_parser�_pypy_sys_version_parserr2r�r�rr,rFrJ)�sys_versionrr�r]rZalt_versionZcompilerZbuildnoZ	builddateZ	buildtimer��branchZrevisionrLrrr�_sys_version�s�

��
��


�

���



r�cCs
t�dS)aR Returns a string identifying the Python implementation.

        Currently, the following implementations are identified:
          'CPython' (C implementation of Python),
          'IronPython' (.NET implementation of Python),
          'Jython' (Java implementation of Python),
          'PyPy' (Python implementation of Python).

    r�r�rrrr�python_implementation5sr�cCs
t�dS)z� Returns the Python version as string 'major.minor.patchlevel'

        Note that unlike the Python sys.version, the returned value
        will always include the patchlevel (it defaults to 0).

    rr�rrrr�python_versionBsr�cCstt�d�d��S)z� Returns the Python version as tuple (major, minor, patchlevel)
        of strings.

        Note that unlike the Python sys.version, the returned value
        will always include the patchlevel (it defaults to 0).

    rrD)r-r�rrrrr�python_version_tupleLs	r�cCs
t�dS)z� Returns a string identifying the Python implementation
        branch.

        For CPython this is the SCM branch from which the
        Python binary was built.

        If not available, an empty string is returned.

    r!r�rrrr�
python_branchWsr�cCs
t�dS)z� Returns a string identifying the Python implementation
        revision.

        For CPython this is the SCM revision from which the
        Python binary was built.

        If not available, an empty string is returned.

    rEr�rrrr�python_revisionesr�cCst�dd�S)zh Returns a tuple (buildno, builddate) stating the Python
        build number and date as strings.

    r�rir�rrrr�python_buildrsr�cCs
t�dS)zS Returns a string identifying the compiler used for compiling
        Python.

    rir�rrrr�python_compilerzsr�cCsbt�||fd�}|dk	r|St�\}}}}}}||kr:d}|rPt|||�\}}}|dkrnt�d}	|	rnd}|	}|dkr�t|�\}
}}}
|r�t||�}nt||||�}n�|dkr�ttj	�\}}t||||d||�}n~|d	k�r t
�\}}}\}}}|s�|�s
t|||�}nt|||d
|||�}n2|�r2t||�}n ttj	�\}}t||||||�}|t||f<|S)a� Returns a single string identifying the underlying platform
        with as much useful information as possible (but no more :).

        The output is intended to be human readable rather than
        machine parseable. It may look different on different
        platforms and this is intended.

        If "aliased" is true, the function will use aliases for
        various platforms that report system names which differ from
        their common names, e.g. SunOS will be reported as
        Solaris. The system_alias() function is used to implement
        this.

        Setting terse to true causes the function to return only the
        absolute minimum information needed to identify the platform.

    NrZDarwinrZmacOSr�)ZLinux�withr�Zon)�_platform_cacherr�r�r�r�r�rCr0r1r�r�)�aliased�terserr^r�r_rr�r�Z
macos_releaseZrelZversrr�rVZlibcnameZlibcversion�rrr�r�r�r�r�r�rrrrV�sX

�

��rV�__main__r�z--terseZ
nonaliasedz--nonaliased)Nrrr)r)rrrrN)rrrr)rr�r)rrr�r�)r)r)r)N)rr)B�__doc__Z
__copyright__�__version__�collectionsr*�rer0r�compilerr�ASCIIr6rCrMr\rbr|r~rornr�r�r�r�r�r�r�r�r�r�r�r�r1r��
namedtupler�r�r�r^r�r_rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rV�__name__�argvr�r��print�exitrrrr�<module>s�Y
�
�
G


�
1��

3

#4 


$�P�	
			����
h




L
__pycache__/csv.cpython-38.pyc000064400000027210151153537550012213 0ustar00U

e5d?�@s@dZddlZddlmZmZmZmZmZmZm	Z	m
Z
mZmZm
Z
mZmZmZddlmZddlmZdddd	d
ddd
dddddddddddddgZGdd�d�ZGdd
�d
e�Zed
e�Gdd�de�Zede�Gdd�de�Zed e�Gd!d�d�ZGd"d�d�ZzeWnek
�r,eZYnXGd#d�d�ZdS)$z+
csv.py - read/write/investigate CSV files
�N)�Error�__version__�writer�reader�register_dialect�unregister_dialect�get_dialect�
list_dialects�field_size_limit�
QUOTE_MINIMAL�	QUOTE_ALL�QUOTE_NONNUMERIC�
QUOTE_NONE�__doc__)�Dialect)�StringIOrrr
rrrr�excel�	excel_tabr
rrrrr	�Snifferrr�
DictReader�
DictWriter�unix_dialectc@sDeZdZdZdZdZdZdZdZdZ	dZ
dZdZdd�Z
dd�ZdS)	rz�Describe a CSV dialect.

    This must be subclassed (see csv.excel).  Valid attributes are:
    delimiter, quotechar, escapechar, doublequote, skipinitialspace,
    lineterminator, quoting.

    �FNcCs|jtkrd|_|��dS)NT)�	__class__r�_valid�	_validate��self�r�/usr/lib64/python3.8/csv.py�__init__*s
zDialect.__init__c
Cs@zt|�Wn.tk
r:}ztt|���W5d}~XYnXdS�N)�_Dialect�	TypeErrorr�str)r�errrr/szDialect._validate)�__name__�
__module__�__qualname__r�_namer�	delimiter�	quotecharZ
escapechar�doublequote�skipinitialspace�lineterminator�quotingr rrrrrrsc@s(eZdZdZdZdZdZdZdZe	Z
dS)rz;Describe the usual properties of Excel-generated CSV files.�,�"TF�
N)r&r'r(rr*r+r,r-r.rr/rrrrr6sc@seZdZdZdZdS)rzEDescribe the usual properties of Excel-generated TAB-delimited files.�	N)r&r'r(rr*rrrrr@sz	excel-tabc@s(eZdZdZdZdZdZdZdZe	Z
dS)rz:Describe the usual properties of Unix-generated CSV files.r0r1TF�
N)r&r'r(rr*r+r,r-r.rr/rrrrrEsZunixc@s@eZdZddd�Zdd�Zedd��Zejd	d��Zd
d�ZdS)
rNrcOs6||_||_||_t||f|�|�|_||_d|_dS�Nr)�_fieldnames�restkey�restvalr�dialect�line_num)r�f�
fieldnamesr7r8r9�args�kwdsrrrr QszDictReader.__init__cCs|Sr!rrrrr�__iter__ZszDictReader.__iter__cCs@|jdkr0zt|j�|_Wntk
r.YnX|jj|_|jSr!)r6�nextr�
StopIterationr:rrrrr<]s

zDictReader.fieldnamescCs
||_dSr!)r6)r�valuerrrr<gscCs�|jdkr|jt|j�}|jj|_|gkr8t|j�}q$tt|j|��}t|j�}t|�}||krv||d�||j<n&||kr�|j|d�D]}|j||<q�|Sr5)	r:r<r@r�dict�zip�lenr7r8)r�row�dZlfZlr�keyrrr�__next__ks



zDictReader.__next__)NNNr)	r&r'r(r r?�propertyr<�setterrIrrrrrPs�
	
	
c@s6eZdZddd�Zdd�Zdd	�Zd
d�Zdd
�ZdS)rr�raisercOsB||_||_|��dkr$td|��||_t||f|�|�|_dS)N)rL�ignorez-extrasaction (%s) must be 'raise' or 'ignore')r<r8�lower�
ValueError�extrasactionr)rr;r<r8rPr9r=r>rrrr �s�zDictWriter.__init__cCstt|j|j��}|�|�Sr!)rCrDr<�writerow)r�headerrrr�writeheader�szDictWriter.writeheadercsN�jdkr8����j}|r8tdd�dd�|D������fdd��jD�S)NrLz(dict contains fields not in fieldnames: z, cSsg|]}t|��qSr)�repr)�.0�xrrr�
<listcomp>�sz,DictWriter._dict_to_list.<locals>.<listcomp>c3s|]}��|�j�VqdSr!)�getr8)rUrH��rowdictrrr�	<genexpr>�sz+DictWriter._dict_to_list.<locals>.<genexpr>)rP�keysr<rO�join)rrZZwrong_fieldsrrYr�
_dict_to_list�s
�zDictWriter._dict_to_listcCs|j�|�|��Sr!)rrQr^)rrZrrrrQ�szDictWriter.writerowcCs|j�t|j|��Sr!)r�	writerows�mapr^)rZrowdictsrrrr_�szDictWriter.writerowsN)rrLr)r&r'r(r rSr^rQr_rrrrr�s�

c@s:eZdZdZdd�Zd
dd�Zdd�Zd	d
�Zdd�ZdS)rze
    "Sniffs" the format of a CSV file (i.e. delimiter, quotechar)
    Returns a Dialect object.
    cCsdddddg|_dS)Nr0r3�;� �:)�	preferredrrrrr �szSniffer.__init__NcCsd|�||�\}}}}|s(|�||�\}}|s4td��Gdd�dt�}||_||_|pVd|_||_|S)zI
        Returns a dialect (or None) corresponding to the sample
        zCould not determine delimiterc@seZdZdZdZeZdS)zSniffer.sniff.<locals>.dialectZsniffedr2N)r&r'r(r)r.rr/rrrrr9�sr9r1)�_guess_quote_and_delimiter�_guess_delimiterrrr,r*r+r-)r�sample�
delimitersr+r,r*r-r9rrr�sniff�s
�
�
z
Sniffer.sniffc	Cs�g}dD]*}t�|tjtjB�}|�|�}|rq4q|s<dSi}i}d}|j}	|D]�}
|	dd}|
|}|r�|�|d�d||<z|	dd}|
|}Wntk
r�YqRYnX|r�|dks�||kr�|�|d�d||<z|	dd}Wntk
�rYqRYnX|
|rR|d7}qRt||jd	�}
|�rXt||jd	�}|||k}|d
k�r`d}nd}d}t�dt�	|�|
d
�tj�}|�
|��r�d}nd}|
|||fS)a�
        Looks for text enclosed between two identical quotes
        (the probable quotechar) which are preceded and followed
        by the same character (the probable delimiter).
        For example:
                         ,'some text',
        The quote with the most wins, same with the delimiter.
        If there is no quotechar the delimiter can't be determined
        this way.
        )zI(?P<delim>[^\w\n"\'])(?P<space> ?)(?P<quote>["\']).*?(?P=quote)(?P=delim)zG(?:^|\n)(?P<quote>["\']).*?(?P=quote)(?P<delim>[^\w\n"\'])(?P<space> ?)zG(?P<delim>[^\w\n"\'])(?P<space> ?)(?P<quote>["\']).*?(?P=quote)(?:$|\n)z-(?:^|\n)(?P<quote>["\']).*?(?P=quote)(?:$|\n))rFNrr�quote��delimNZspace�rHr4rz]((%(delim)s)|^)\W*%(quote)s[^%(delim)s\n]*%(quote)s[^%(delim)s\n]*%(quote)s\W*((%(delim)s)|$))rlrjTF)�re�compile�DOTALL�	MULTILINE�findall�
groupindexrX�KeyError�max�escape�search)r�datarhZmatchesZrestrZregexpZquotes�delimsZspacesrs�m�nrHr+rlr-Z	dq_regexpr,rrrre�s`




��z"Sniffer._guess_quote_and_delimitercCsttd|�d���}dd�td�D�}tdt|��}d}i}i}i}d|}	}
|	t|�k�rR|d7}||	|
�D]@}|D]6}|�|i�}
|�|�}|
�|d�d|
|<|
||<qxqp|��D]�}t||�	��}t|�dkr�|dddkr�q�t|�dk�rLt
|d	d
�d�||<|�||�||d||dtdd
�|D��f||<q�|d||<q�|�	�}t
t||t|���}d}d}t|�dk�r�||k�r�|D]T\}}|ddk�r�|ddk�r�|d||k�r�|dk�s�||k�r�|||<�q�|d8}�q�t|�dk�rDt|���d}|d�|�|d�d|�k}||fS|
}	|
|7}
qN|�s\dSt|�dk�r�|jD]@}||��k�rp|d�|�|d�d|�k}||fS�qpdd�|�	�D�}|��|dd}|d�|�|d�d|�k}||fS)a�
        The delimiter /should/ occur the same number of times on
        each row. However, due to malformed data, it may not. We don't want
        an all or nothing approach, so we allow for small variations in this
        number.
          1) build a table of the frequency of each character on every line.
          2) build a table of frequencies of this frequency (meta-frequency?),
             e.g.  'x occurred 5 times in 10 rows, 6 times in 1000 rows,
             7 times in 2 rows'
          3) use the mode of the meta-frequency to determine the /expected/
             frequency for that character
          4) find out how often the character actually meets that goal
          5) the character that best meets its goal is the delimiter
        For performance reasons, the data is evaluated in chunks, so it can
        try and evaluate the smallest portion of the data possible, evaluating
        additional chunks as necessary.
        Nr4cSsg|]}t|��qSr)�chr)rU�crrrrW-sz,Sniffer._guess_delimiter.<locals>.<listcomp>��
rrkcSs|dS)Nrkr)rVrrr�<lambda>G�z*Sniffer._guess_delimiter.<locals>.<lambda>rmcss|]}|dVqdS)rkNr)rU�itemrrrr[Lsz+Sniffer._guess_delimiter.<locals>.<genexpr>g�?g�������?g{�G�z�?z%c )rrcSsg|]\}}||f�qSrr)rU�k�vrrrrWvs���)�list�filter�split�range�minrErX�countr\�itemsru�remove�sum�floatrd�sort)rrxrh�asciiZchunkLengthZ	iterationZ
charFrequencyZmodesry�start�end�line�charZ
metaFrequencyZfreqr�ZmodeListZtotalZconsistencyZ	thresholdr�r�rlr-rGrrrrfs�

����

��zSniffer._guess_delimiterc
Cs�tt|�|�|��}t|�}t|�}i}t|�D]}d||<q0d}|D]�}|dkrVq�|d7}t|�|krlqFt|���D]x}	tt	t
fD]4}
z|
||	�Wq�Wq�ttfk
r�Yq�Xq�t||	�}
|
||	krx||	dkr�|
||	<qx||	=qxqFd}|�
�D]~\}	}t|�td�k�r@t||	�|k�r6|d7}n|d8}n<z|||	�Wn"ttfk
�rr|d7}Yn
X|d8}�q|dkS)Nr�rk)rrrir@rEr�r�r\�intr��complexrO�
OverflowErrorr��typer#)
rrgZrdrrR�columnsZcolumnTypes�i�checkedrF�colZthisTypeZ	hasHeaderZcolTyperrr�
has_headersJ






zSniffer.has_header)N)	r&r'r(rr rirerfr�rrrrr�s
Lg)rrnZ_csvrrrrrrrr	r
rrr
rrr"�ior�__all__rrrrrr��	NameErrorr�rrrrr�<module>sJ@�


2
__pycache__/rlcompleter.cpython-38.opt-1.pyc000064400000013175151153537550014714 0ustar00U

e5d��@s�dZddlZddlZddlZdgZGdd�d�Zdd�ZzddlZWnek
r\dZ	Yn"Xe�
e�j�e�dd	��d
Z	dS)a1Word completion for GNU readline.

The completer completes keywords, built-ins and globals in a selectable
namespace (which defaults to __main__); when completing NAME.NAME..., it
evaluates (!) the expression up to the last dot and completes its attributes.

It's very cool to do "import sys" type "sys.", hit the completion key (twice),
and see the list of names defined by the sys module!

Tip: to use the tab key as the completion key, call

    readline.parse_and_bind("tab: complete")

Notes:

- Exceptions raised by the completer function are *ignored* (and generally cause
  the completion to fail).  This is a feature -- since readline sets the tty
  device in raw (or cbreak) mode, printing a traceback wouldn't work well
  without some complicated hoopla to save, reset and restore the tty state.

- The evaluation of the NAME.NAME... form may cause arbitrary application
  defined code to be executed if an object with a __getattr__ hook is found.
  Since it is the responsibility of the application (or the user) to enable this
  feature, I consider this an acceptable risk.  More complicated expressions
  (e.g. function calls or indexing operations) are *not* evaluated.

- When the original stdin is not a tty device, GNU readline is never
  used, and this module (and the readline module) are silently inactive.

�N�	Completerc@s6eZdZddd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
rNcCs6|rt|t�std��|dkr&d|_nd|_||_dS)a�Create a new completer for the command line.

        Completer([namespace]) -> completer instance.

        If unspecified, the default namespace where completions are performed
        is __main__ (technically, __main__.__dict__). Namespaces should be
        given as dictionaries.

        Completer instances should be used as the completion mechanism of
        readline via the set_completer() call:

        readline.set_completer(Completer(my_namespace).complete)
        znamespace must be a dictionaryN�r)�
isinstance�dict�	TypeError�use_main_ns�	namespace)�selfr�r
�#/usr/lib64/python3.8/rlcompleter.py�__init__'szCompleter.__init__cCs�|jrtj|_|��sB|dkr>tr8t�d�t��dSdSndS|dkrld|kr`|�	|�|_
n|�|�|_
z|j
|WStk
r�YdSXdS)z�Return the next possible completion for 'text'.

        This is called successively with state == 0, 1, 2, ... until it
        returns None.  The completion should begin with 'text'.

        r�	�N�.)
r�__main__�__dict__r�strip�_readline_available�readlineZinsert_textZ	redisplay�attr_matches�matches�global_matches�
IndexError)r	�text�stater
r
r�completeBs$
zCompleter.completecCst|�r|d}|S)N�()�callable)r	�val�wordr
r
r�_callable_postfixaszCompleter._callable_postfixc	Cs�ddl}g}dh}t|�}|jD]J}|d|�|kr |�|�|dkrP|d}n|dkr`|d}|�|�q |jtjfD]J}|��D]<\}}|d|�|kr�||kr�|�|�|�|�	||��q�qx|S)z�Compute matches when text is a simple name.

        Return a list of all keywords, built-in functions and names currently
        defined in self.namespace that match.

        rN�__builtins__>�try�finally�:>�break�None�pass�continue�False�True�else� )
�keyword�len�kwlist�add�appendr�builtinsr�itemsr )	r	rr-r�seen�nrZnspacerr
r
rrfs$



zCompleter.global_matchesc	Cshddl}|�d|�}|sgS|�dd�\}}zt||j�}Wntk
rTgYSXtt|��}|�d�t	|d�r�|�
d�|�t|j
��g}t|�}	|dkr�d	}
n|d	kr�d
}
nd}
|D]t}|d|	�|kr�|
r�|d|	d�|
ks�d||f}zt||�}
Wntk
�rYnX|�|
|�}|�|�q�|�s\|
�sF�q\|
d	k�rVd
}
q�d}
q�|��|S)a�Compute matches when text contains a dot.

        Assuming the text is of the form NAME.NAME....[NAME], and is
        evaluable in self.namespace, it will be evaluated and its attributes
        (as revealed by dir()) are used as possible completions.  (For class
        instances, class members are also considered.)

        WARNING: this can still invoke arbitrary C code, if an object
        with a __getattr__ hook is evaluated.

        rNz(\w+(\.\w+)*)\.(\w*)r�r!�	__class__r�_�__z%s.%s)�re�match�group�evalr�	Exception�set�dir�discard�hasattrr0�update�get_class_membersr7r.�getattrr r1�sort)r	rr:�m�expr�attrZ
thisobjectZwordsrr5Znoprefixrr;rr
r
rr�sR



��
zCompleter.attr_matches)N)�__name__�
__module__�__qualname__rrr rrr
r
r
rr&s

cCs.t|�}t|d�r*|jD]}|t|�}q|S)N�	__bases__)r@rBrMrD)�klassZret�baser
r
rrD�s


rDFcCs
t�d�S)N)r�
set_completerr
r
r
r�<lambda>��rQT)
�__doc__�atexitr2r�__all__rrDr�ImportErrorrrPr�registerr
r
r
r�<module>s
__pycache__/getpass.cpython-38.opt-1.pyc000064400000010124151153537550014021 0ustar00U

e5dj�@s�dZddlZddlZddlZddlZddlZdddgZGdd�de�Zddd	�Z	dd
d�Z
ddd
�Zddd�Zdd�Z
zddlZejejfWnBeefk
r�zddlZWnek
r�eZYnXe
ZYnXe	ZdS)a�Utilities to get a password and/or the current user name.

getpass(prompt[, stream]) - Prompt for a password, with echo turned off.
getuser() - Get the user name from the environment or password database.

GetPassWarning - This UserWarning is issued when getpass() cannot prevent
                 echoing of the password contents while reading.

On Windows, the msvcrt module will be used.

�N�getpass�getuser�GetPassWarningc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/getpass.pyrs�
Password: c
Cs�d}t�����}zJt�dtjtjB�}t�|d�}|�|�t�	|�}|�|�|sX|}Wnpt
k
r�}zR|��ztj
��}Wn&ttfk
r�d}t||�}YnXtj
}|s�tj}W5d}~XYnX|dk	�r�z�t�|�}|dd�}	|	dtjM<tj}
ttd��r|
tjO}
z t�||
|	�t|||d�}W5t�||
|�|��XWn@tjk
�r�|dk	�rz�||k	�r�|��t||�}YnX|�d�|W5QR�SQRXdS)aPrompt for a password, with echo turned off.

    Args:
      prompt: Written on stream to ask for the input.  Default: 'Password: '
      stream: A writable file object to display the prompt.  Defaults to
              the tty.  If no tty is available defaults to sys.stderr.
    Returns:
      The seKr3t input.
    Raises:
      EOFError: If our input tty or stdin was closed.
      GetPassWarning: When we were unable to turn echo off on the input.

    Always restores terminal settings before returning.
    Nz/dev/ttyzw+��TCSASOFT)�input�
)�
contextlib�	ExitStack�os�open�O_RDWR�O_NOCTTY�io�FileIO�
enter_context�
TextIOWrapper�OSError�close�sys�stdin�fileno�AttributeError�
ValueError�fallback_getpass�stderr�termios�	tcgetattrZECHOZ	TCSAFLUSH�hasattrr�	tcsetattr�flush�
_raw_input�error�write)�prompt�streamZpasswd�stack�fdZttyr
�e�old�newZtcsetattr_flagsrrr	�unix_getpasssR








r1cCs�tjtjk	rt||�S|D]}t�|�qd}t��}|dkst|dkrHqt|dkrTt�|dkrj|dd�}q.||}q.t�d�t�d�|S)z9Prompt for password with echo off, using Windows getch().��
r��N���)rr�	__stdin__r �msvcrtZputwchZgetwch�KeyboardInterrupt)r*r+�cZpwrrr	�win_getpassas 



r;cCs0tjdtdd�|stj}td|d�t||�S)Nz%Can not control echo on the terminal.�)�
stacklevelz&Warning: Password input may be echoed.)�file)�warnings�warnrrr!�printr')r*r+rrr	r xs�r r2cCs�|s
tj}|stj}t|�}|rpz|�|�Wn8tk
rf|�|jd�}|�|j�}|�|�YnX|�	�|�
�}|s�t�|ddkr�|dd�}|S)N�replacer6r)rr!r�strr)�UnicodeEncodeError�encode�encoding�decoder&�readline�EOFError)r*r+r
�linerrr	r'�s&r'cCs<dD]}tj�|�}|r|Sqddl}|�t���dS)z�Get the username from the environment or password database.

    First try various environment variables, then the password
    database.  This works on Windows as long as USERNAME is set.

    )ZLOGNAMEZUSERZLNAMEZUSERNAMErN)r�environ�get�pwd�getpwuid�getuid)�name�userrMrrr	r�s
)r
N)r
N)r
N)r2NN)�__doc__rrrrr?�__all__�UserWarningrr1r;r r'rr"r#r%�ImportErrorrr8rrrrr	�<module>s,

D

	


__pycache__/socket.cpython-38.opt-1.pyc000064400000066145151153537550013661 0ustar00U

e5d���@sdZddlZddlTddlZddlZddlZddlZddlmZmZzddl	Z	Wne
k
rhdZ	YnXee	dd�Zee	dd�Z
ee	d	d�Zd
ddd
dddgZe�e�e��e�dedd��e�dedd��e�dedd��e�dedd��dZdZdd�ZeZej���d��r$iZded<ded <d!ed"<d#ed$<d%ed&<d'ed(<d)ed*<d+ed,<d-ed.<d/ed0<d1ed2<d3ed4<d5ed6<d7ed8<d9ed:<d;ed<<d=ed><d?ed@<dAedB<dCedD<dEedF<dGedH<dIedJ<dKedL<dMedN<dOedP<dQedR<dSedT<dUedV<dWedX<dYedZ<d[ed\<d]ed^<d_ed`<daedb<dcedd<deedf<dgedh<diedj<dkedl<dmedn<doedp<dqedr<dsedt<duedv<dwedx<dyedz<d{ed|<d}ed~<ded�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<e�d١Gd�dۄd�e�ZGd�d݄d�ej�Zd�d�d
�Z e!ejd߃�rpd�d�Z"e�d�e!ed��r�de#dfd�d�Z$ne%e#dfd�d�Z$e�d�d�e$_e
ehZ&Gd�d�d�ej'�Z(d�d�d�Z)e*�Z+e+dfd�d�Z,d�d�Z-e%dd�d�d�d�d
�Z.d�d�d�Z/dS)�a0This module provides socket operations and some related functions.
On Unix, it supports IP (Internet Protocol) and Unix domain sockets.
On other systems, it only supports IP. Functions specific for a
socket are available as methods of the socket object.

Functions:

socket() -- create a new socket object
socketpair() -- create a pair of new socket objects [*]
fromfd() -- create a socket object from an open file descriptor [*]
fromshare() -- create a socket object from data received from socket.share() [*]
gethostname() -- return the current hostname
gethostbyname() -- map a hostname to its IP number
gethostbyaddr() -- map an IP number or hostname to DNS info
getservbyname() -- map a service name and a protocol name to a port number
getprotobyname() -- map a protocol name (e.g. 'tcp') to a number
ntohs(), ntohl() -- convert 16, 32 bit int from network to host byte order
htons(), htonl() -- convert 16, 32 bit int from host to network byte order
inet_aton() -- convert IP addr string (123.45.67.89) to 32-bit packed format
inet_ntoa() -- convert 32-bit packed format IP to string (123.45.67.89)
socket.getdefaulttimeout() -- get the default timeout value
socket.setdefaulttimeout() -- set the default timeout value
create_connection() -- connects to an address, with an optional timeout and
                       optional source address.

 [*] not available on all platforms!

Special objects:

SocketType -- type object for socket objects
error -- exception raised for I/O errors
has_ipv6 -- boolean value indicating if IPv6 is supported

IntEnum constants:

AF_INET, AF_UNIX -- socket domains (first argument to socket() call)
SOCK_STREAM, SOCK_DGRAM, SOCK_RAW -- socket types (second argument)

Integer constants:

Many other constants may be defined; these may be used in calls to
the setsockopt() and getsockopt() methods.
�N)�*)�IntEnum�IntFlag�EBADF�	�EAGAIN��EWOULDBLOCK�fromfd�getfqdn�create_connection�
create_server�has_dualstack_ipv6�
AddressFamily�
SocketKindcCs|��o|�d�S)NZAF_��isupper�
startswith��C�r�/usr/lib64/python3.8/socket.py�<lambda>L�rcCs|��o|�d�S)NZSOCK_rrrrrrQrZMsgFlagcCs|��o|�d�S)NZMSG_rrrrrrVrZAddressInfocCs|��o|�d�S)NZAI_rrrrrr[rz	127.0.0.1z::1cCs(z
||�WStk
r"|YSXdS)z{Convert a numeric family value to an IntEnum member.

    If it's not a known member, return the numeric value itself.
    N)�
ValueError)�valueZ
enum_klassrrr�_intenum_converteras
r�winz)Specified event object handle is invalid.�zInsufficient memory available.�z#One or more parameters are invalid.�WzOverlapped operation aborted.i�z2Overlapped I/O event object not in signaled state.i�z)Overlapped operation will complete later.i�zThe operation was interrupted.i'zA bad file handle was passed.i'zPermission denied.i'z!A fault occurred on the network??i'z#An invalid operation was attempted.i&'zToo many open files.i('z The socket operation would blocki3'z,A blocking operation is already in progress.i4'zOperation already in progress.i5'zSocket operation on nonsocket.i6'zDestination address required.i7'zMessage too long.i8'zProtocol wrong type for socket.i9'zBad protocol option.i:'zProtocol not supported.i;'zSocket type not supported.i<'zOperation not supported.i='zProtocol family not supported.i>'z0Address family not supported by protocol family.i?'zThe network address is in use.i@'z Cannot assign requested address.iA'zNetwork is down.iB'zNetwork is unreachable.iC'z$Network dropped connection on reset.iD'z!Software caused connection abort.iE'zThe connection has been reset.iF'zNo buffer space available.iG'zSocket is already connected.iH'zSocket is not connected.iI'zThe network has been shut down.iJ'zToo many references.iK'zThe operation timed out.iL'zConnection refused.iM'zCannot translate name.iN'zThe name is too long.iO'zThe host is down.iP'zThe host is unreachable.iQ'zDirectory not empty.iR'zToo many processes.iS'zUser quota exceeded.iT'zDisk quota exceeded.iU'zStale file handle reference.iV'zItem is remote.iW'z!Network subsystem is unavailable.ik'z!Winsock.dll version out of range.il'z(Successful WSAStartup not yet performed.im'zGraceful shutdown in progress.iu'z*No more results from WSALookupServiceNext.iv'zCall has been canceled.iw'z Procedure call table is invalid.ix'zService provider is invalid.iy'z&Service provider failed to initialize.iz'zSystem call failure.i{'zService not found.i|'zClass type not found.i}'i~'zCall was canceled.i'zDatabase query was refused.i�'zHost not found.i�*z Nonauthoritative host not found.i�*zThis is a nonrecoverable error.i�*z*Valid name, no data record requested type.i�*zQoS receivers.i�*zQoS senders.i�*zNo QoS senders.i�*zQoS no receivers.i+zQoS request confirmed.i+zQoS admission error.i+zQoS policy failure.i+zQoS bad style.i+zQoS bad object.i+zQoS traffic control error.i+zQoS generic error.i+zQoS service type error.i+zQoS flowspec error.i	+zInvalid QoS provider buffer.i
+zInvalid QoS filter style.i+i+zIncorrect QoS filter count.i
+zInvalid QoS object length.i+zIncorrect QoS flow count.i+zUnrecognized QoS object.i+zInvalid QoS policy object.i+zInvalid QoS flow descriptor.i+z'Invalid QoS provider-specific flowspec.i+z)Invalid QoS provider-specific filterspec.i+z&Invalid QoS shape discard mode object.i+z Invalid QoS shaping rate object.i+z!Reserved policy QoS element type.i+�errorTabc@seZdZdS)�_GiveupOnSendfileN)�__name__�
__module__�__qualname__rrrrr"�sr"cs,eZdZdZdddgZd9dd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zd:dddd�dd�Ze
ed�rzd;dd�Zn
d<dd�Zd=dd�Zd d!�Zd>d"d#�Zd$d%�Zejfd&d'�Zd(d)�Z�fd*d+�Ze�fd,d-��Ze�fd.d/��Zejd0k�rd1d2�Zd3d4�Znd5d2�Zd6d4�Zd7e_d8e_�ZS)?�socketz:A subclass of _socket.socket adding the makefile() method.�__weakref__�_io_refs�_closed���NcCsP|dkr,|dkrt}|dkr t}|dkr,d}tj�|||||�d|_d|_dS)Nr*rF)�AF_INET�SOCK_STREAM�_socketr&�__init__r(r))�self�family�type�proto�filenorrrr.�szsocket.__init__cCs|S�Nr�r/rrr�	__enter__�szsocket.__enter__cGs|js|��dSr4)r)�close)r/�argsrrr�__exit__�szsocket.__exit__cCs�t|dd�}d|jj|jj|r"dnd|��|j|j|jf}|s�z |��}|r^|dt	|�7}Wnt
k
rtYnXz |��}|r�|dt	|�7}Wnt
k
r�YnX|d7}|S)	zVWrap __repr__() to reveal the real class name and socket
        address(es).
        r)Fz,<%s.%s%s fd=%i, family=%s, type=%s, proto=%iz	 [closed]�z
, laddr=%sz
, raddr=%s�>)�getattr�	__class__r$r%r3r0r1r2�getsockname�str�errorZgetpeername)r/�closed�sZladdrZraddrrrr�__repr__�s4
��zsocket.__repr__cCstd|jj�d���dS)Nzcannot pickle z object)�	TypeErrorr=r#r5rrr�__getstate__szsocket.__getstate__cCs6t|���}|j|j|j|j|d�}|�|���|S)z�dup() -> socket object

        Duplicate the socket. Return a new socket object connected to the same
        system resource. The new socket is non-inheritable.
        �r3)�dupr3r=r0r1r2�
settimeout�
gettimeout)r/�fd�sockrrrrGsz
socket.dupcCsF|��\}}t|j|j|j|d�}t�dkr>|��r>|�d�||fS)z�accept() -> (socket object, address info)

        Wait for an incoming connection.  Return a new socket
        representing the connection, and the address of the client.
        For IP sockets, the address info is a pair (hostaddr, port).
        rFNT)Z_acceptr&r0r1r2ZgetdefaulttimeoutrI�setblocking)r/rJ�addrrKrrr�accepts

z
socket.accept�r)�encoding�errors�newlinec
Cs�t|�dddhks td|f��d|k}d|kp4|}d|k}d}	|rN|	d7}	|rZ|	d7}	t||	�}
|jd7_|dkr~d}|d	kr�tj}|d	kr�|s�td
��|
S|r�|r�t�|
|
|�}n|r�t�|
|�}nt�|
|�}|r�|St�	||||�}||_
|S)z�makefile(...) -> an I/O stream connected to the socket

        The arguments are as for io.open() after the filename, except the only
        supported mode values are 'r' (default), 'w' and 'b'.
        rO�w�bz&invalid mode %r (only r, w, b allowed)r:�Nr*rz!unbuffered streams must be binary)�setr�SocketIOr(�io�DEFAULT_BUFFER_SIZE�BufferedRWPair�BufferedReader�BufferedWriter�
TextIOWrapper�mode)
r/r^�	bufferingrPrQrRZwritingZreadingZbinaryZrawmode�raw�buffer�textrrr�makefile-s<
zsocket.makefile�sendfilerc
Cs�|�|||�|��}z|��}Wn0ttjfk
rR}zt|��W5d}~XYnXzt�|�j}Wn*t	k
r�}zt|��W5d}~XYnX|s�dSt
|p�|d�}|��}	|	dkr�td��t
td�r�t��}
nt��}
|
�|tj�d}|
j}tj}
z�|	�r||	��st�d��|�r0||}|dk�r0�q�z|
||||�}Wn`tk
�rh|	�s`|�Yq�Yq�t	k
�r�}z|dk�r�t|��|d�W5d}~XYq�X|dk�r��q�||7}||7}q�|W�S|dk�r�t
|d��r�|�|�XdS)Nri@�&non-blocking sockets are not supported�PollSelector�seekz	timed out)�_check_sendfile_paramsr3�AttributeErrorrX�UnsupportedOperationr"�os�fstat�st_size�OSError�minrIr�hasattr�	selectorsrfZSelectSelector�registerZEVENT_WRITEZselectrdrgr-�timeout�BlockingIOError)r/�file�offset�countZsocknor3�errZfsize�	blocksizersZselector�
total_sentZselector_selectZos_sendfile�sentrrr�_sendfile_use_sendfileYs^






zsocket._sendfile_use_sendfilecCstd��dS)Nz,os.sendfile() not available on this platform)r"�r/rurvrwrrrr|�s�c

Cs�|�|||�|��dkr"td��|r0|�|�|r>t|d�nd}d}|j}|j}z�|rpt|||�}|dkrpq�t||��}|s�q�z||�}	Wnt	k
r�Yq�Yq�X||	7}|	t
|�kr�||	d�}q�qTq�qT|W�S|dkr�t|d�r�|�||�XdS)Nrrei rg)rhrIrrgro�read�sendrp�
memoryviewrt�len)
r/rurvrwryrzZ	file_readZ	sock_send�datar{rrr�_sendfile_use_send�s8

zsocket._sendfile_use_sendcCsddt|dd�krtd��|jt@s*td��|dk	r`t|t�sJtd�|���|dkr`td�|���dS)NrTr^z$file should be opened in binary modez+only SOCK_STREAM type sockets are supportedz+count must be a positive integer (got {!r})r)r<rr1r,�
isinstance�intrD�formatr}rrrrh�s

��zsocket._check_sendfile_paramscCs8z|�|||�WStk
r2|�|||�YSXdS)a_sendfile(file[, offset[, count]]) -> sent

        Send a file until EOF is reached by using high-performance
        os.sendfile() and return the total number of bytes which
        were sent.
        *file* must be a regular file object opened in binary mode.
        If os.sendfile() is not available (e.g. Windows) or file is
        not a regular file socket.send() will be used instead.
        *offset* tells from where to start reading the file.
        If specified, *count* is the total number of bytes to transmit
        as opposed to sending the file until EOF is reached.
        File position is updated on return or also in case of error in
        which case file.tell() can be used to figure out the number of
        bytes which were sent.
        The socket must be of SOCK_STREAM type.
        Non-blocking sockets are not supported.
        N)r|r"r�r}rrrrd�szsocket.sendfilecCs*|jdkr|jd8_|jr&|��dS)NrrU)r(r)r7r5rrr�_decref_socketios�s
zsocket._decref_socketioscCs|�|�dSr4)r7)r/Z_ssrrr�_real_close�szsocket._real_closecCsd|_|jdkr|��dS)NTr)r)r(r�r5rrrr7�s
zsocket.closecsd|_t���S)adetach() -> file descriptor

        Close the socket object without closing the underlying file descriptor.
        The object cannot be used after this call, but the file descriptor
        can be reused for other purposes.  The file descriptor is returned.
        T)r)�super�detachr5�r=rrr��sz
socket.detachcstt�jt�S)z@Read-only access to the address family for this socket.
        )rr�r0rr5r�rrr0sz
socket.familycstt�jt�S)z-Read-only access to the socket type.
        )rr�r1rr5r�rrr1szsocket.type�ntcCst�|���Sr4)rkZget_handle_inheritabler3r5rrr�get_inheritable
szsocket.get_inheritablecCst�|��|�dSr4)rkZset_handle_inheritabler3�r/Zinheritablerrr�set_inheritableszsocket.set_inheritablecCst�|���Sr4)rkr�r3r5rrrr�scCst�|��|�dSr4)rkr�r3r�rrrr�sz&Get the inheritable flag of the socketz&Set the inheritable flag of the socket)r*r*r*N)rON)rN)rN)rN)rN) r#r$r%�__doc__�	__slots__r.r6r9rCrErGrNrcrprkr|r�rhrdr�r-r&r�r7r��propertyr0r1�namer�r��
__classcell__rrr�rr&�sF

�*
A

$


r&cCst|�}t||||�S)z� fromfd(fd, family, type[, proto]) -> socket object

    Create a socket object from a duplicate of the given file
    descriptor.  The remaining arguments are the same as for socket().
    )rGr&)rJr0r1r2Znfdrrrr
sZsharecCstddd|�S)z� fromshare(info) -> socket object

        Create a socket object from the bytes object returned by
        socket.share(pid).
        r)r&)�inforrr�	fromshare#sr��
socketpaircCsh|dkr*zt}Wntk
r(t}YnXt�|||�\}}t||||���}t||||���}||fS)aasocketpair([family[, type[, proto]]]) -> (socket object, socket object)

        Create a pair of socket objects from the sockets returned by the platform
        socketpair() function.
        The arguments are the same as for socket() except the default family is
        AF_UNIX if defined on the platform; otherwise, the default is AF_INET.
        N)ZAF_UNIX�	NameErrorr+r-r�r&r�)r0r1r2�arTrrrr�.s
c
	Cs|tkrt}n|tkrt}ntd��|tkr4td��|dkrDtd��t|||�}z�|�|df�|�	�|�
�dd�\}}t|||�}zP|�d�z|�||f�Wnt
tfk
r�YnX|�d�|��\}}	Wn|���YnXW5|��X||fS)Nz?Only AF_INET and AF_INET6 socket address families are supportedz)Only SOCK_STREAM socket type is supportedrzOnly protocol zero is supported�FT)r+�
_LOCALHOST�AF_INET6�
_LOCALHOST_V6rr,r&r7�bind�listenr>rL�connectrt�InterruptedErrorrN)
r0r1r2�hostZlsockrM�portZcsockZssock�_rrrr�Cs8


a8socketpair([family[, type[, proto]]]) -> (socket object, socket object)
Create a pair of socket objects from the sockets returned by the platform
socketpair() function.
The arguments are the same as for socket() except the default family is AF_UNIX
if defined on the platform; otherwise, the default is AF_INET.
cspeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Z�fdd
�Z	dd�Z
edd��Zedd��Z
dd�Z�ZS)rWz�Raw I/O implementation for stream sockets.

    This class supports the makefile() method on sockets.  It provides
    the raw I/O interface on top of a socket object.
    cCsZ|dkrtd|��tj�|�||_d|kr6|d7}||_d|k|_d|k|_d|_dS)N)rOrSZrw�rb�wbZrwbzinvalid mode: %rrTrOrSF)	rrX�	RawIOBaser.�_sock�_mode�_reading�_writing�_timeout_occurred)r/rKr^rrrr.�s

zSocketIO.__init__c
Cs�|��|��|jrtd��z|j�|�WStk
rHd|_�Yqtk
r�}z|jdt	krpWY�
dS�W5d}~XYqXqdS)a3Read up to len(b) bytes into the writable buffer *b* and return
        the number of bytes read.  If the socket is non-blocking and no bytes
        are available, None is returned.

        If *b* is non-empty, a 0 return value indicates that the connection
        was shutdown at the other end.
        z!cannot read from timed out objectTrN)
�_checkClosed�_checkReadabler�rnr�Z	recv_intorsr@r8�_blocking_errnos�r/rT�errr�readinto�s
zSocketIO.readintoc
Cs`|��|��z|j�|�WStk
rZ}z|jdtkrHWY�
dS�W5d}~XYnXdS)aWrite the given bytes or bytearray object *b* to the socket
        and return the number of bytes written.  This can be less than
        len(b) if not all data could be written.  If the socket is
        non-blocking and no bytes could be written None is returned.
        rN)r��_checkWritabler�rr@r8r�r�rrr�write�s
zSocketIO.writecCs|jrtd��|jS)z2True if the SocketIO is open for reading.
        �I/O operation on closed socket.)rArr�r5rrr�readable�szSocketIO.readablecCs|jrtd��|jS)z2True if the SocketIO is open for writing.
        r�)rArr�r5rrr�writable�szSocketIO.writablecs|jrtd��t���S)z2True if the SocketIO is open for seeking.
        r�)rArr��seekabler5r�rrr��szSocketIO.seekablecCs|��|j��S)z=Return the file descriptor of the underlying socket.
        )r�r�r3r5rrrr3�szSocketIO.filenocCs|js|��SdSdS)Nr*)rAr3r5rrrr��sz
SocketIO.namecCs|jSr4)r�r5rrrr^�sz
SocketIO.modecCs*|jr
dStj�|�|j��d|_dS)z�Close the SocketIO object.  This doesn't close the underlying
        socket, except if all references to it have disappeared.
        N)rArXr�r7r�r�r5rrrr7�s

zSocketIO.close)r#r$r%r�r.r�r�r�r�r�r3r�r�r^r7r�rrr�rrWrs

rWr:cCsl|��}|r|dkrt�}zt|�\}}}Wntk
r@Yn(X|�d|�|D]}d|krRqhqR|}|S)aGet fully qualified domain name from name.

    An empty argument is interpreted as meaning the local host.

    First the hostname returned by gethostbyaddr() is checked, then
    possibly existing aliases. In case no FQDN is available, hostname
    from gethostname() is returned.
    z0.0.0.0r�.)�stripZgethostnameZ
gethostbyaddrr@�insert)r�Zhostname�aliasesZipaddrsrrrr�s	cCs�|\}}d}t||dt�D]�}|\}}}	}
}d}zDt|||	�}|tk	rP|�|�|r^|�|�|�|�d}|WStk
r�}
z|
}|dk	r�|��W5d}
~
XYqXq|dk	r�z|�W5d}Xntd��dS)acConnect to *address* and return the socket object.

    Convenience function.  Connect to *address* (a 2-tuple ``(host,
    port)``) and return the socket object.  Passing the optional
    *timeout* parameter will set the timeout on the socket instance
    before attempting to connect.  If no *timeout* is supplied, the
    global default timeout setting returned by :func:`getdefaulttimeout`
    is used.  If *source_address* is set it must be a tuple of (host, port)
    for the socket to bind as a source address before making the connection.
    A host of '' or port 0 tells the OS to use the default.
    Nrz!getaddrinfo returns an empty list)	�getaddrinfor,r&�_GLOBAL_DEFAULT_TIMEOUTrHr�r�r@r7)�addressrsZsource_addressr�r�rx�res�af�socktyper2�	canonname�sarKr�rrrrs.



c	Csltrttd�rttd�sdSz4ttt�� }|�ttd�W5QR�WdSQRXWnt	k
rfYdSXdS)z�Return True if the platform supports creating a SOCK_STREAM socket
    which can handle both AF_INET and AF_INET6 (IPv4 / IPv6) connections.
    �IPPROTO_IPV6�IPV6_V6ONLYFrTN)
�has_ipv6rpr-r&r�r,�
setsockoptr�r�r@)rKrrrr0s��F)r0�backlog�
reuse_port�dualstack_ipv6c
Csn|rttd�std��|r8t�s(td��|tkr8td��t|t�}�ztjdkr�ttd�r�z|�	t
td�Wntk
r�YnX|r�|�	t
t
d�tr�|tkr�|r�|�	ttd�n"ttd	�r�ttd
�r�|�	ttd�z|�|�Wn@tk
�r$}z d|j|f}t|j|�d�W5d}~XYnX|dk�r:|��n
|�|�|WStk
�rh|���YnXdS)
a�Convenience function which creates a SOCK_STREAM type socket
    bound to *address* (a 2-tuple (host, port)) and return the socket
    object.

    *family* should be either AF_INET or AF_INET6.
    *backlog* is the queue size passed to socket.listen().
    *reuse_port* dictates whether to use the SO_REUSEPORT socket option.
    *dualstack_ipv6*: if true and the platform supports it, it will
    create an AF_INET6 socket able to accept both IPv4 or IPv6
    connections. When false it will explicitly disable this option on
    platforms that enable it by default (e.g. Linux).

    >>> with create_server(('', 8000)) as server:
    ...     while True:
    ...         conn, addr = server.accept()
    ...         # handle new connection
    �SO_REUSEPORTz+SO_REUSEPORT not supported on this platformz-dualstack_ipv6 not supported on this platformz'dualstack_ipv6 requires AF_INET6 family)r��cygwin�SO_REUSEADDRrUrr�r�z+%s (while attempting to bind on address %r)N)rpr-rrr�r&r,rkr�r�Z
SOL_SOCKETr�r@r�r�r�r�r��strerror�errnor�r7)r�r0r�r�r�rKrx�msgrrrr
@sN


�
�� 


cCsPg}t�||||||�D]2}|\}}	}}
}|�t|t�t|	t�||
|f�q|S)a�Resolve host and port into list of address info entries.

    Translate the host/port argument into a sequence of 5-tuples that contain
    all the necessary arguments for creating a socket connected to that service.
    host is a domain name, a string representation of an IPv4/v6 address or
    None. port is a string service name such as 'http', a numeric port number or
    None. By passing None as the value of host and port, you can pass NULL to
    the underlying C API.

    The family, type and proto arguments can be optionally specified in order to
    narrow the list of addresses returned. Passing zero as a value for each of
    these arguments selects the full range of results.
    )r-r��appendrrr)r�r�r0r1r2�flagsZaddrlistr�r�r�r�r�rrrr��s�r�)r)r:)rrrr)0r�r-rk�sysrXrq�enumrrr��ImportErrorr<rrr	�__all__�extend�_get_exports_list�	_convert_r#r�r�rr&Z_realsocket�platform�lowerrr!r��	Exceptionr"r
rpr�r,r�r+r�r�rWr�objectr�rrr
r�rrrr�<module>sH- 
�����

F
	
$
u
�
-�E__pycache__/sndhdr.cpython-38.pyc000064400000015517151153537560012712 0ustar00U

e5d��@s2dZddgZddlmZedd�Zdej_dej_d	ej_d
ej_dej	_dd�Z
d
d�ZgZdd�Z
e�e
�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zed*k�r.e�d+S),a�Routines to help recognizing sound files.

Function whathdr() recognizes various types of sound file headers.
It understands almost all headers that SOX can decode.

The return tuple contains the following items, in this order:
- file type (as SOX understands it)
- sampling rate (0 if unknown or hard to decode)
- number of channels (0 if unknown or hard to decode)
- number of frames in the file (-1 if unknown or hard to decode)
- number of bits/sample, or 'U' for U-LAW, or 'A' for A-LAW

If the file doesn't have a recognizable type, it returns None.
If the file can't be opened, OSError is raised.

To compute the total time, divide the number of frames by the
sampling rate (a frame contains a sample for each channel).

Function what() calls whathdr().  (It used to also use some
heuristics for raw data, but this doesn't work very well.)

Finally, the function test() is a simple main program that calls
what() for all files mentioned on the argument list.  For directory
arguments it calls what() for all files in that directory.  Default
argument is "." (testing all files in the current directory).  The
option -r tells it to recurse down directories found inside
explicitly given directories.
�what�whathdr�)�
namedtuple�
SndHeadersz.filetype framerate nchannels nframes sampwidthz�The value for type indicates the data type
and will be one of the strings 'aifc', 'aiff', 'au','hcom',
'sndr', 'sndt', 'voc', 'wav', '8svx', 'sb', 'ub', or 'ul'.zYThe sampling_rate will be either the actual
value or 0 if unknown or difficult to decode.z^The number of channels or 0 if it cannot be
determined or if the value is difficult to decode.z?The value for frames will be either the number
of frames or -1.zAEither the sample size in bits or
'A' for A-LAW or 'U' for u-LAW.cCst|�}|S)zGuess the type of a sound file.)r)�filename�res�r�/usr/lib64/python3.8/sndhdr.pyr4sc
Cs^t|d��J}|�d�}tD]*}|||�}|rt|�W5QR�SqW5QR�dSQRXdS)zRecognize sound headers.�rbiN)�open�read�testsr)r�f�hZtfrrrr	r:s

c	Cs�ddl}|�d�sdS|dd�dkr,d}n|dd�dkrBd}ndS|�d�z|�|d	�}Wnt|jfk
r|YdSX||��|��|��d|�	�fS)
Nr�FORM��sAIFC�aifcsAIFFZaiff�r)
r�
startswith�seekr�EOFError�Error�getframerate�getnchannels�
getnframes�getsampwidth)rrrZfmt�arrr	�	test_aifcKs"


�rc
Cs�|�d�rt}n|dd�dkr&t}ndSd}||dd��}||dd��}||dd��}||dd��}||dd	��}d
}	|d
kr�d}
n$|dkr�d}
n|d
kr�d}
d}	nd}
|	|}|r�||}nd}|||||
fS)Ns.snd�)sds.sdns.Zaurr�����U���?���)r�get_long_be�get_long_le)
rr�func�filetypeZhdr_size�	data_size�encoding�rate�	nchannelsZsample_sizeZsample_bitsZ
frame_sizeZnframerrr	�test_au`s2

r1cCsT|dd�dks |dd�dkr$dSt|dd��}|rBd	|}nd
}d|dd
dfS)N�A�EsFSSD��sHCOM��i"VrZhcomr#r(r)r))rrZdivisorr/rrr	�	test_hcom�s 
r8cCst|�d�sdSt|dd��}d}d|kr6dkrfnn,||dkrfd||d}|rftd	|�}d
|dddfS)
NsCreative Voice Filer!�ri�r#�rg��.AZvocr(r)r�get_short_le�int)rrZsbseekr/Zratecoderrr	�test_voc�s
$r=c	Cs�ddl}|�d�r2|dd�dks2|dd�dkr6dS|�d�z|�|d�}Wnt|jfk
rlYdSXd	|��|��|��d|�	�fS)
NrsRIFFrrsWAVEr sfmt rZwav)
�waverrrrrrrrr)rrr>�wrrr	�test_wav�s*

�r@cCs"|�d�r|dd�dkrdSdS)Nrrrs8SVX)Z8svxrr#rr)r)rrrrr	�	test_8svx�srAcCs<|�d�r8t|dd��}t|dd��}d|d|dfSdS)NsSOUNDrrr!r9Zsndtr#)rr*r;)rrZnsamplesr/rrr	�	test_sndt�s
rBcCsD|�d�r@t|dd��}d|kr.dkr@nnd|ddd	fSdS)
Nsr%ri�i�aZsndrr#r(r)rr;)rrr/rrr	�	test_sndr�s
rCcCs,|dd>|dd>B|dd>B|dBS)Nrr"r#r r%rr&r��brrr	r)�sr)cCs,|dd>|dd>B|dd>B|dBS)Nr&r"r%r r#rrrrDrrr	r*�sr*cCs|dd>|dBS)Nrrr#rrDrrr	�get_short_be�srFcCs|dd>|dBS)Nr#rrrrDrrr	r;�sr;cCs�ddl}d}|jdd�r8|jddkr8|jdd�=d}z8|jdd�r`t|jdd�|d�ntdg|d�Wn*tk
r�|j�d�|�d�YnXdS)Nrr#z-rr%�.z
[Interrupted]
)�sys�argv�testall�KeyboardInterrupt�stderr�write�exit)rH�	recursiverrr	�test�srPc	Cs�ddl}ddl}|D]�}|j�|�r~t|ddd�|s<|rttd�ddl}|�|j�|�|�d��}t||d�q�td�qt|ddd�|j	�
�ztt|��Wqtk
r�td	�YqXqdS)
Nrz/:� )�endzrecursing down:�*z*** directory (use -r) ***�:z*** not found ***)
rH�os�path�isdir�print�glob�join�escaperJ�stdout�flushr�OSError)�listrOZtoplevelrHrUrrY�namesrrr	rJ�s"

rJ�__main__N)�__doc__�__all__�collectionsrrr,Z	framerater0ZnframesZ	sampwidthrrr
r�appendr1r8r=r@rArBrCr)r*rFr;rPrJ�__name__rrrr	�<module>sJ �









__pycache__/_pydecimal.cpython-38.pyc000064400000471741151153537560013543 0ustar00U

e5d:}�%@s�dZddddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%g%ZeZd&Zd'Zd(Zd)d*lZd)d*lZ	d)d*l
Z
zd)d+lmZ
e
dd,�ZWnek
r�d-d.�ZYnXdZdZdZdZdZdZdZdZd/Zd/Ze
jd0kr�d1Zd1Zd2Znd3Zd3Zd4Zeed5ZGd6d�de�Z Gd7d�de �Z!Gd8d	�d	e �Z"Gd9d�de"�Z#Gd:d
�d
e e$�Z%Gd;d�de"�Z&Gd<d�de"e$�Z'Gd=d�de �Z(Gd>d�de"�Z)Gd?d�de �Z*Gd@d
�d
e �Z+GdAd�de(e*�Z,GdBd�de(e*e+�Z-GdCd�de e.�Z/e!e%e(e,e*e-e"e+e/g	Z0e#e"e&e"e'e"e)e"iZ1eeeeeeeefZ2d)d*l3Z3e3�4dD�Z5dEd�Z6dFd�Z7[3d�dGd�Z8GdHd�de9�Z:d�dJdK�Z;e	j<�=e:�GdLdM�dMe9�Z>GdNd�de9�Z?GdOdP�dPe9�Z@d�dQdR�ZAeBjCZDdSdT�ZEdUdV�ZFdWdX�ZGdYdZ�ZHd�d\d]�ZId^d_�ZJd`da�ZKGdbdc�dce9�ZLeL�jMZNd�ddde�ZOdfdg�ZPdhdi�ZQdjdkdldmdndodpdqdrds�	fdtdu�ZRd�dvdw�ZSd�dxdy�ZTe?dzee%e,e"ggd{d|d5d)d}�ZUe?d~ee%e,e"e!e-ggd�ZVe?d~eggd�ZWd)d*lXZXeX�Yd�eXjZeXj[B�j\Z]eX�Yd��j\Z^eX�Yd��j\Z_eX�Yd�eXjZeXj`B�Za[Xzd)d*lbZcWnek
�rYnXd�d�d��Zdd�d��Zed�d��Zfd�d�d��Zgd�d��Zhd�d��Zie:d��Zje:d��Zke:d��Zle:d)�Zme:d5�Zne:d��ZoejekfZpe
jqjrZse
jqjtZue
jqjvZwexdqesd�es�Zy[
d*S)�a�	
This is an implementation of decimal floating point arithmetic based on
the General Decimal Arithmetic Specification:

    http://speleotrove.com/decimal/decarith.html

and IEEE standard 854-1987:

    http://en.wikipedia.org/wiki/IEEE_854-1987

Decimal floating point has finite precision with arbitrarily large bounds.

The purpose of this module is to support arithmetic using familiar
"schoolhouse" rules and to avoid some of the tricky representation
issues associated with binary floating point.  The package is especially
useful for financial applications or for contexts where users have
expectations that are at odds with binary floating point (for instance,
in binary floating point, 1.00 % 0.1 gives 0.09999999999999995 instead
of 0.0; Decimal('1.00') % Decimal('0.1') returns the expected
Decimal('0.00')).

Here are some examples of using the decimal module:

>>> from decimal import *
>>> setcontext(ExtendedContext)
>>> Decimal(0)
Decimal('0')
>>> Decimal('1')
Decimal('1')
>>> Decimal('-.0123')
Decimal('-0.0123')
>>> Decimal(123456)
Decimal('123456')
>>> Decimal('123.45e12345678')
Decimal('1.2345E+12345680')
>>> Decimal('1.33') + Decimal('1.27')
Decimal('2.60')
>>> Decimal('12.34') + Decimal('3.87') - Decimal('18.41')
Decimal('-2.20')
>>> dig = Decimal(1)
>>> print(dig / Decimal(3))
0.333333333
>>> getcontext().prec = 18
>>> print(dig / Decimal(3))
0.333333333333333333
>>> print(dig.sqrt())
1
>>> print(Decimal(3).sqrt())
1.73205080756887729
>>> print(Decimal(3) ** 123)
4.85192780976896427E+58
>>> inf = Decimal(1) / Decimal(0)
>>> print(inf)
Infinity
>>> neginf = Decimal(-1) / Decimal(0)
>>> print(neginf)
-Infinity
>>> print(neginf + inf)
NaN
>>> print(neginf * inf)
-Infinity
>>> print(dig / 0)
Infinity
>>> getcontext().traps[DivisionByZero] = 1
>>> print(dig / 0)
Traceback (most recent call last):
  ...
  ...
  ...
decimal.DivisionByZero: x / 0
>>> c = Context()
>>> c.traps[InvalidOperation] = 0
>>> print(c.flags[InvalidOperation])
0
>>> c.divide(Decimal(0), Decimal(0))
Decimal('NaN')
>>> c.traps[InvalidOperation] = 1
>>> print(c.flags[InvalidOperation])
1
>>> c.flags[InvalidOperation] = 0
>>> print(c.flags[InvalidOperation])
0
>>> print(c.divide(Decimal(0), Decimal(0)))
Traceback (most recent call last):
  ...
  ...
  ...
decimal.InvalidOperation: 0 / 0
>>> print(c.flags[InvalidOperation])
1
>>> c.flags[InvalidOperation] = 0
>>> c.traps[InvalidOperation] = 0
>>> print(c.divide(Decimal(0), Decimal(0)))
NaN
>>> print(c.flags[InvalidOperation])
1
>>>
�Decimal�Context�DecimalTuple�DefaultContext�BasicContext�ExtendedContext�DecimalException�Clamped�InvalidOperation�DivisionByZero�Inexact�Rounded�	Subnormal�Overflow�	Underflow�FloatOperation�DivisionImpossible�InvalidContext�ConversionSyntax�DivisionUndefined�
ROUND_DOWN�
ROUND_HALF_UP�ROUND_HALF_EVEN�
ROUND_CEILING�ROUND_FLOOR�ROUND_UP�ROUND_HALF_DOWN�
ROUND_05UP�
setcontext�
getcontext�localcontext�MAX_PREC�MAX_EMAX�MIN_EMIN�	MIN_ETINY�HAVE_THREADS�HAVE_CONTEXTVARZdecimalz1.70z2.4.2�N)�
namedtuplezsign digits exponentcGs|S�N�)�argsr)r)�"/usr/lib64/python3.8/_pydecimal.py�<lambda>��r,Tl����l��N�Zol������N�Zoi@�Ti����c@seZdZdZdd�ZdS)ra1Base exception class.

    Used exceptions derive from this.
    If an exception derives from another exception besides this (such as
    Underflow (Inexact, Rounded, Subnormal) that indicates that it is only
    called if the others are present.  This isn't actually used for
    anything, though.

    handle  -- Called when context._raise_error is called and the
               trap_enabler is not set.  First argument is self, second is the
               context.  More arguments can be given, those being after
               the explanation in _raise_error (For example,
               context._raise_error(NewError, '(-x)!', self._sign) would
               call NewError().handle(context, self._sign).)

    To define a new exception, it should be sufficient to have it derive
    from DecimalException.
    cGsdSr(r)��self�contextr*r)r)r+�handle�szDecimalException.handleN��__name__�
__module__�__qualname__�__doc__r2r)r)r)r+r�sc@seZdZdZdS)ra)Exponent of a 0 changed to fit bounds.

    This occurs and signals clamped if the exponent of a result has been
    altered in order to fit the constraints of a specific concrete
    representation.  This may occur when the exponent of a zero result would
    be outside the bounds of a representation, or when a large normal
    number would have an encoded exponent that cannot be represented.  In
    this latter case, the exponent is reduced to fit and the corresponding
    number of zero digits are appended to the coefficient ("fold-down").
    N�r4r5r6r7r)r)r)r+r�sc@seZdZdZdd�ZdS)r	a0An invalid operation was performed.

    Various bad things cause this:

    Something creates a signaling NaN
    -INF + INF
    0 * (+-)INF
    (+-)INF / (+-)INF
    x % 0
    (+-)INF % x
    x._rescale( non-integer )
    sqrt(-x) , x > 0
    0 ** 0
    x ** (non-integer)
    x ** (+-)INF
    An operand is invalid

    The result of the operation after these is a quiet positive NaN,
    except when the cause is a signaling NaN, in which case the result is
    also a quiet NaN, but with the original sign, and an optional
    diagnostic information.
    cGs,|r(t|dj|djdd�}|�|�StS)Nr&�nT)�_dec_from_triple�_sign�_int�_fix_nan�_NaN)r0r1r*�ansr)r)r+r2�s
zInvalidOperation.handleNr3r)r)r)r+r	�sc@seZdZdZdd�ZdS)rz�Trying to convert badly formed string.

    This occurs and signals invalid-operation if a string is being
    converted to a number and it does not conform to the numeric string
    syntax.  The result is [0,qNaN].
    cGstSr(�r>r/r)r)r+r2szConversionSyntax.handleNr3r)r)r)r+rsc@seZdZdZdd�ZdS)r
a�Division by 0.

    This occurs and signals division-by-zero if division of a finite number
    by zero was attempted (during a divide-integer or divide operation, or a
    power operation with negative right-hand operand), and the dividend was
    not zero.

    The result of the operation is [sign,inf], where sign is the exclusive
    or of the signs of the operands for divide, or is 1 for an odd power of
    -0, for power.
    cGst|Sr()�_SignedInfinity�r0r1�signr*r)r)r+r2szDivisionByZero.handleNr3r)r)r)r+r

sc@seZdZdZdd�ZdS)rz�Cannot perform the division adequately.

    This occurs and signals invalid-operation if the integer result of a
    divide-integer or remainder operation had too many digits (would be
    longer than precision).  The result is [0,qNaN].
    cGstSr(r@r/r)r)r+r2"szDivisionImpossible.handleNr3r)r)r)r+rsc@seZdZdZdd�ZdS)rz�Undefined result of division.

    This occurs and signals invalid-operation if division by zero was
    attempted (during a divide-integer, divide, or remainder operation), and
    the dividend is also zero.  The result is [0,qNaN].
    cGstSr(r@r/r)r)r+r2-szDivisionUndefined.handleNr3r)r)r)r+r%sc@seZdZdZdS)ra�Had to round, losing information.

    This occurs and signals inexact whenever the result of an operation is
    not exact (that is, it needed to be rounded and any discarded digits
    were non-zero), or if an overflow or underflow condition occurs.  The
    result in all cases is unchanged.

    The inexact signal may be tested (or trapped) to determine if a given
    operation (or sequence of operations) was inexact.
    Nr8r)r)r)r+r0sc@seZdZdZdd�ZdS)ra�Invalid context.  Unknown rounding, for example.

    This occurs and signals invalid-operation if an invalid context was
    detected during an operation.  This can occur if contexts are not checked
    on creation and either the precision exceeds the capability of the
    underlying concrete representation or an unknown or unsupported rounding
    was specified.  These aspects of the context need only be checked when
    the values are required to be used.  The result is [0,qNaN].
    cGstSr(r@r/r)r)r+r2GszInvalidContext.handleNr3r)r)r)r+r<s
c@seZdZdZdS)ra�Number got rounded (not  necessarily changed during rounding).

    This occurs and signals rounded whenever the result of an operation is
    rounded (that is, some zero or non-zero digits were discarded from the
    coefficient), or if an overflow or underflow condition occurs.  The
    result in all cases is unchanged.

    The rounded signal may be tested (or trapped) to determine if a given
    operation (or sequence of operations) caused a loss of precision.
    Nr8r)r)r)r+rJsc@seZdZdZdS)r
a�Exponent < Emin before rounding.

    This occurs and signals subnormal whenever the result of a conversion or
    operation is subnormal (that is, its adjusted exponent is less than
    Emin, before any rounding).  The result in all cases is unchanged.

    The subnormal signal may be tested (or trapped) to determine if a given
    or operation (or sequence of operations) yielded a subnormal result.
    Nr8r)r)r)r+r
Vsc@seZdZdZdd�ZdS)raNumerical overflow.

    This occurs and signals overflow if the adjusted exponent of a result
    (from a conversion or from an operation that is not an attempt to divide
    by zero), after rounding, would be greater than the largest value that
    can be handled by the implementation (the value Emax).

    The result depends on the rounding mode:

    For round-half-up and round-half-even (and for round-half-down and
    round-up, if implemented), the result of the operation is [sign,inf],
    where sign is the sign of the intermediate result.  For round-down, the
    result is the largest finite number that can be represented in the
    current precision, with the sign of the intermediate result.  For
    round-ceiling, the result is the same as for round-down if the sign of
    the intermediate result is 1, or is [0,inf] otherwise.  For round-floor,
    the result is the same as for round-down if the sign of the intermediate
    result is 0, or is [1,inf] otherwise.  In all cases, Inexact and Rounded
    will also be raised.
    cGs�|jttttfkrt|S|dkrR|jtkr4t|St|d|j|j	|jd�S|dkr�|jt
krlt|St|d|j|j	|jd�SdS)Nr&�9r.)�roundingrrrrrArr:�prec�EmaxrrBr)r)r+r2ws"�
�
�zOverflow.handleNr3r)r)r)r+rasc@seZdZdZdS)raxNumerical underflow with result rounded to 0.

    This occurs and signals underflow if a result is inexact and the
    adjusted exponent of the result would be smaller (more negative) than
    the smallest value that can be handled by the implementation (the value
    Emin).  That is, the result is both inexact and subnormal.

    The result after an underflow will be a subnormal number rounded, if
    necessary, so that its exponent is not less than Etiny.  This may result
    in 0 with the sign of the intermediate result and an exponent of Etiny.

    In all cases, Inexact, Rounded, and Subnormal will also be raised.
    Nr8r)r)r)r+r�sc@seZdZdZdS)ra�Enable stricter semantics for mixing floats and Decimals.

    If the signal is not trapped (default), mixing floats and Decimals is
    permitted in the Decimal() constructor, context.create_decimal() and
    all comparison operators. Both conversion and comparisons are exact.
    Any occurrence of a mixed operation is silently recorded by setting
    FloatOperation in the context flags.  Explicit conversions with
    Decimal.from_float() or context.create_decimal_from_float() do not
    set the flag.

    Otherwise (the signal is trapped), only equality comparisons and explicit
    conversions are silent. All other mixed operations raise FloatOperation.
    Nr8r)r)r)r+r�sZdecimal_contextcCs8z
t��WStk
r2t�}t�|�|YSXdS)z�Returns this thread's context.

    If this thread does not yet have a context, returns
    a new context and sets this thread's context.
    New contexts are copies of DefaultContext.
    N)�_current_context_var�get�LookupErrorr�set�r1r)r)r+r�s

cCs,|tttfkr|��}|��t�|�dS)z%Set this thread's context to context.N)rrr�copy�clear_flagsrHrKrLr)r)r+r�scCs|dkrt�}t|�S)abReturn a context manager for a copy of the supplied context

    Uses a copy of the current context if no context is specified
    The returned context manager creates a local decimal context
    in a with statement:
        def sin(x):
             with localcontext() as ctx:
                 ctx.prec += 2
                 # Rest of sin calculation algorithm
                 # uses a precision 2 greater than normal
             return +s  # Convert result to normal precision

         def sin(x):
             with localcontext(ExtendedContext):
                 # Rest of sin calculation algorithm
                 # uses the Extended Context from the
                 # General Decimal Arithmetic Specification
             return +s  # Convert result to normal context

    >>> setcontext(DefaultContext)
    >>> print(getcontext().prec)
    28
    >>> with localcontext():
    ...     ctx = getcontext()
    ...     ctx.prec += 2
    ...     print(ctx.prec)
    ...
    30
    >>> with localcontext(ExtendedContext):
    ...     print(getcontext().prec)
    ...
    9
    >>> print(getcontext().prec)
    28
    N)r�_ContextManager)Zctxr)r)r+r�s$c
@s�eZdZdZdZd�dd�Zedd��Zd	d
�Zdd�Z	d�d
d�Z
dd�Zdd�Zdd�Z
d�dd�Zd�dd�Zd�dd�Zd�dd�Zd�dd�Zd�dd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd�d*d+�Zd�d,d-�Zd�d.d/�Zd�d0d1�Zd�d3d4�Zd�d5d6�ZeZ�dd7d8�Z�dd9d:�Z �dd;d<�Z!e!Z"�dd=d>�Z#d?d@�Z$�ddAdB�Z%�ddCdD�Z&�ddEdF�Z'�ddGdH�Z(�ddIdJ�Z)�d	dKdL�Z*�d
dMdN�Z+�ddOdP�Z,dQdR�Z-dSdT�Z.e.Z/e0dUdV��Z1e0dWdX��Z2dYdZ�Z3d[d\�Z4d]d^�Z5d_d`�Z6dadb�Z7dcdd�Z8dedf�Z9dgdh�Z:didj�Z;dkdl�Z<dmdn�Z=dodp�Z>e?e7e8e9e:e;e<e=e>dq�Z@�ddrds�ZAdtdu�ZBdvdw�ZC�d
dxdy�ZD�ddzd{�ZEd|d}�ZF�dd~d�ZG�dd�d��ZH�dd�d��ZI�dd�d��ZJ�dd�d��ZKd�d��ZLd�d��ZM�dd�d��ZN�dd�d��ZOeOZP�dd�d��ZQ�dd�d��ZR�dd�d��ZSd�d��ZTd�d��ZUd�d��ZVd�d��ZW�dd�d��ZX�dd�d��ZY�dd�d��ZZd�d��Z[d�d��Z\�dd�d��Z]�dd�d��Z^d�d��Z_d�d��Z`d�d��Zad�d��Zb�dd�d��Zcd�d��Zdd�d��Zed�d��Zf�dd�d��Zgd�d��Zhd�d��Zi�d d�dÄZjd�dńZk�d!d�dDŽZl�d"d�dɄZmd�d˄Znd�d̈́Zo�d#d�dτZp�d$d�dфZq�d%d�dӄZr�d&d�dՄZs�d'd�dׄZt�d(d�dلZu�d)d�dۄZv�d*d�d݄Zw�d+d�d߄Zx�d,d�d�Zyd�d�Zz�d-d�d�Z{�d.d�d�Z|�d/d�d�Z}d�d�Z~d�d�Zd�d�Z��d0d�d�Z�dS(1rz,Floating point class for decimal arithmetic.)�_expr<r;�_is_special�0NcCs�t�|�}t|t��r$t|���dd��}|dkrP|dkr@t�}|�t	d|�S|�
d�dkrfd|_nd|_|�
d	�}|dk	r�|�
d
�p�d}t|�
d�p�d�}tt||��|_
|t|�|_d
|_nZ|�
d�}|dk	�rtt|p�d���d�|_
|�
d��rd|_nd|_nd|_
d|_d|_|St|t��rf|dk�rBd|_nd|_d|_tt|��|_
d
|_|St|t��r�|j|_|j|_|j
|_
|j|_|St|t��r�|j|_t|j�|_
t|j�|_d
|_|St|ttf��r"t|�dk�r�td��t|dt��r|ddk�std��|d|_|ddk�rHd|_
|d|_d|_n�g}	|dD]R}
t|
t��r�d|
k�r|dk�r�nn|	�s�|
dk�r�|	�|
�ntd���qT|ddk�r�d�tt|	��|_
|d|_d|_nDt|dt��rd�tt|	�p�dg��|_
|d|_d
|_ntd��|St|t��rx|dk�r>t�}|�td�t�|�}|j|_|j|_|j
|_
|j|_|St d|��dS)a�Create a decimal point instance.

        >>> Decimal('3.14')              # string input
        Decimal('3.14')
        >>> Decimal((0, (3, 1, 4), -2))  # tuple (sign, digit_tuple, exponent)
        Decimal('3.14')
        >>> Decimal(314)                 # int
        Decimal('314')
        >>> Decimal(Decimal(314))        # another decimal instance
        Decimal('314')
        >>> Decimal('  3.14  \n')        # leading and trailing whitespace okay
        Decimal('3.14')
        �_�NzInvalid literal for Decimal: %rrC�-r.r&�intZfrac�exprRF�diag�signal�Nr9�FT�ztInvalid tuple size in creation of Decimal from list or tuple.  The list or tuple should have exactly three elements.�r&r.z|Invalid sign.  The first value in the tuple should be an integer; either 0 for a positive number or 1 for a negative number.��	zTThe second value in the tuple must be composed of integers in the range 0 through 9.�r9rZzUThe third value in the tuple must be an integer, or one of the strings 'F', 'n', 'N'.�;strict semantics for mixing floats and Decimals are enabledzCannot convert %r to Decimal)!�object�__new__�
isinstance�str�_parser�strip�replacer�_raise_errorr�groupr;rVr<�lenrPrQ�lstrip�absr�_WorkReprCrW�list�tuple�
ValueError�append�join�map�floatr�
from_float�	TypeError)�cls�valuer1r0�m�intpart�fracpartrWrX�digitsZdigitr)r)r+rc
s�
�





(


�
zDecimal.__new__cCs�t|t�r,|dkrdnd}d}tt|��}nzt|t�r�t�|�sJt�|�rV|t|��St�	d|�dkrld}nd}t|��
�\}}|��d}t|d|�}ntd��t
|||�}|tkr�|S||�SdS)a.Converts a float to a decimal number, exactly.

        Note that Decimal.from_float(0.1) is not the same as Decimal('0.1').
        Since 0.1 is not exactly representable in binary floating point, the
        value is stored as the nearest representable value which is
        0x1.999999999999ap-4.  The exact equivalent of the value in decimal
        is 0.1000000000000000055511151231257827021181583404541015625.

        >>> Decimal.from_float(0.1)
        Decimal('0.1000000000000000055511151231257827021181583404541015625')
        >>> Decimal.from_float(float('nan'))
        Decimal('NaN')
        >>> Decimal.from_float(float('inf'))
        Decimal('Infinity')
        >>> Decimal.from_float(-float('inf'))
        Decimal('-Infinity')
        >>> Decimal.from_float(-0.0)
        Decimal('-0')

        r&r.g�?�zargument must be int or float.N)rdrVrermru�_mathZisinfZisnan�reprZcopysign�as_integer_ratio�
bit_lengthrwr:r)rx�frC�k�coeffr9�d�resultr)r)r+rv�s$

zDecimal.from_floatcCs(|jr$|j}|dkrdS|dkr$dSdS)zrReturns whether the number is not actually one.

        0 if a number
        1 if NaN
        2 if sNaN
        r9r.rZr^r&)rQrP)r0rWr)r)r+�_isnan�szDecimal._isnancCs|jdkr|jrdSdSdS)zyReturns whether the number is infinite

        0 if finite or not a number
        1 if +INF
        -1 if -INF
        r[���r.r&)rPr;�r0r)r)r+�_isinfinity�s

zDecimal._isinfinitycCs||��}|dkrd}n|��}|s&|rx|dkr4t�}|dkrJ|�td|�S|dkr`|�td|�S|rn|�|�S|�|�SdS)z�Returns whether the number is not actually one.

        if self, other are sNaN, signal
        if self, other are NaN return nan
        return 0

        Done before operations.
        NFr^�sNaNr&)r�rrir	r=)r0�otherr1�self_is_nan�other_is_nanr)r)r+�_check_nans�s&
��

zDecimal._check_nanscCsv|dkrt�}|js|jrr|��r0|�td|�S|��rF|�td|�S|��r\|�td|�S|��rr|�td|�SdS)aCVersion of _check_nans used for the signaling comparisons
        compare_signal, __le__, __lt__, __ge__, __gt__.

        Signal InvalidOperation if either self or other is a (quiet
        or signaling) NaN.  Signaling NaNs take precedence over quiet
        NaNs.

        Return 0 if neither operand is a NaN.

        Nzcomparison involving sNaNzcomparison involving NaNr&)rrQ�is_snanrir	�is_qnan�r0r�r1r)r)r+�_compare_check_nans	s0����zDecimal._compare_check_nanscCs|jp|jdkS)zuReturn True if self is nonzero; otherwise return False.

        NaNs and infinities are considered nonzero.
        rR�rQr<r�r)r)r+�__bool__*szDecimal.__bool__cCs|js|jr8|��}|��}||kr(dS||kr4dSdS|sP|sDdSd|jS|s^d|jS|j|jkrndS|j|jkr~dS|��}|��}||kr�|jd|j|j}|jd|j|j}||kr�dS||kr�d|jSd|jSn ||k�rd|jSd|jSdS)z�Compare the two non-NaN decimal instances self and other.

        Returns -1 if self < other, 0 if self == other and 1
        if self > other.  This routine is for internal use only.r&r�r.rRN)rQr�r;�adjustedr<rP)r0r�Zself_infZ	other_inf�
self_adjustedZother_adjusted�self_paddedZother_paddedr)r)r+�_cmp1s>


zDecimal._cmpcCs<t||dd�\}}|tkr|S|�||�r.dS|�|�dkS)NT)�equality_opFr&)�_convert_for_comparison�NotImplementedr�r�r�r)r)r+�__eq__qszDecimal.__eq__cCs<t||�\}}|tkr|S|�||�}|r.dS|�|�dkS�NFr&�r�r�r�r��r0r�r1r?r)r)r+�__lt__yszDecimal.__lt__cCs<t||�\}}|tkr|S|�||�}|r.dS|�|�dkSr�r�r�r)r)r+�__le__�szDecimal.__le__cCs<t||�\}}|tkr|S|�||�}|r.dS|�|�dkSr�r�r�r)r)r+�__gt__�szDecimal.__gt__cCs<t||�\}}|tkr|S|�||�}|r.dS|�|�dkSr�r�r�r)r)r+�__ge__�szDecimal.__ge__cCs>t|dd�}|js|r0|jr0|�||�}|r0|St|�|��S)z�Compare self to other.  Return a decimal value:

        a or b is a NaN ==> Decimal('NaN')
        a < b           ==> Decimal('-1')
        a == b          ==> Decimal('0')
        a > b           ==> Decimal('1')
        T��raiseit)�_convert_otherrQr�rr�r�r)r)r+�compare�szDecimal.comparecCs�|jr4|��rtd��n|��r$tS|jr0tStS|jdkrNtd|jt	�}ntt
|jt	�}t|j�|t	}|dkr||n|}|dkr�dS|S)zx.__hash__() <==> hash(x)z"Cannot hash a signaling NaN value.r&�
r����)
rQr�rw�is_nan�_PyHASH_NANr;�_PyHASH_INFrP�pow�_PyHASH_MODULUS�
_PyHASH_10INVrVr<)r0Zexp_hashZhash_r?r)r)r+�__hash__�s

zDecimal.__hash__cCst|jttt|j��|j�S)zeRepresents the number as a triple tuple.

        To show the internals exactly as they are.
        )rr;rprtrVr<rPr�r)r)r+�as_tuple�szDecimal.as_tuplecCs�|jr |��rtd��ntd��|s(dSt|j�}|jdkrR|d|jd}}nn|j}|dkr�|ddkr�|d}|d8}qZ|j}t||@��d|�}|r�||L}||8}d||>}|j	r�|}||fS)a�Express a finite Decimal instance in the form n / d.

        Returns a pair (n, d) of integers.  When called on an infinity
        or NaN, raises OverflowError or ValueError respectively.

        >>> Decimal('3.14').as_integer_ratio()
        (157, 50)
        >>> Decimal('-123e5').as_integer_ratio()
        (-12300000, 1)
        >>> Decimal('0.00').as_integer_ratio()
        (0, 1)

        z#cannot convert NaN to integer ratioz(cannot convert Infinity to integer ratior]r&r�r.r~)
rQr�rq�
OverflowErrorrVr<rP�minr�r;)r0r9r�Zd5Zd2Zshift2r)r)r+r��s,



zDecimal.as_integer_ratiocCsdt|�S)z0Represents the number as an instance of Decimal.z
Decimal('%s'))rer�r)r)r+�__repr__szDecimal.__repr__Fc	Csbddg|j}|jrL|jdkr&|dS|jdkr>|d|jS|d|jS|jt|j�}|jdkrt|d	krt|}n6|s~d
}n,|jdkr�|d
dd
}n|d
dd
}|dkr�d}d
d||j}nL|t|j�kr�|jd|t|j�}d}n |jd|�}d
|j|d�}||k�r(d}n*|dk�r8t�}ddg|jd||}||||S)z�Return string representation of the number in scientific notation.

        Captures all of the information in the underlying representation.
        rTrUr[ZInfinityr9�NaNr�r&���r.rRr\�.N�e�Ez%+d)r;rQrPr<rkr�capitals)	r0�engr1rC�
leftdigits�dotplacer{r|rWr)r)r+�__str__s:




zDecimal.__str__cCs|jd|d�S)a,Convert to a string, using engineering notation if an exponent is needed.

        Engineering notation has an exponent which is a multiple of 3.  This
        can leave up to 3 digits to the left of the decimal place and may
        require the addition of either one or two trailing zeros.
        T)r�r1)r��r0r1r)r)r+�
to_eng_string;szDecimal.to_eng_stringcCsR|jr|j|d�}|r|S|dkr(t�}|s@|jtkr@|��}n|��}|�|�S)zRReturns a copy with the sign switched.

        Rounds, if it has reason.
        rLN)rQr�rrEr�copy_abs�copy_negate�_fix�r0r1r?r)r)r+�__neg__Ds
zDecimal.__neg__cCsR|jr|j|d�}|r|S|dkr(t�}|s@|jtkr@|��}nt|�}|�|�S)zhReturns a copy, unless it is a sNaN.

        Rounds the number (if more than precision digits)
        rLN)rQr�rrErr�rr�r�r)r)r+�__pos__Zs
zDecimal.__pos__TcCsJ|s|��S|jr&|j|d�}|r&|S|jr:|j|d�}n|j|d�}|S)z�Returns the absolute value of self.

        If the keyword argument 'round' is false, do not round.  The
        expression self.__abs__(round=False) is equivalent to
        self.copy_abs().
        rL)r�rQr�r;r�r�)r0�roundr1r?r)r)r+�__abs__oszDecimal.__abs__c
Csht|�}|tkr|S|dkr"t�}|js.|jr�|�||�}|rB|S|��rr|j|jkrj|��rj|�td�St	|�S|��r�t	|�St
|j|j�}d}|jt
kr�|j|jkr�d}|s�|s�t
|j|j�}|r�d}t|d|�}|�|�}|S|�st||j|jd�}|�||j�}|�|�}|S|�sVt||j|jd�}|�||j�}|�|�}|St|�}t|�}t|||j�\}}t�}	|j|jk�r�|j|jk�r�t|d|�}|�|�}|S|j|jk�r�||}}|jdk�r�d|	_|j|j|_|_nd|	_n&|jdk�rd|	_d\|_|_nd|	_|jdk�r<|j|j|	_n|j|j|	_|j|	_t	|	�}|�|�}|S)zbReturns self + other.

        -INF + INF (or the reverse) cause InvalidOperation errors.
        Nz
-INF + INFr&r.rR)r&r&)r�r�rrQr�r�r;rir	rr�rPrErr:r��maxrF�_rescalern�
_normalizerCrVrW)
r0r�r1r?rWZnegativezerorC�op1�op2r�r)r)r+�__add__�s|





zDecimal.__add__cCsHt|�}|tkr|S|js |jr6|j||d�}|r6|S|j|��|d�S)zReturn self - otherrL)r�r�rQr�r�r�r�r)r)r+�__sub__�szDecimal.__sub__cCs"t|�}|tkr|S|j||d�S)zReturn other - selfrL)r�r�r�r�r)r)r+�__rsub__�szDecimal.__rsub__cCs@t|�}|tkr|S|dkr"t�}|j|jA}|js:|jr�|�||�}|rN|S|��rn|sf|�td�St	|S|��r�|s�|�td�St	|S|j
|j
}|r�|s�t|d|�}|�|�}|S|j
dkr�t||j
|�}|�|�}|S|j
dk�r
t||j
|�}|�|�}|St|�}t|�}t|t|j|j�|�}|�|�}|S)z\Return self * other.

        (+-) INF * 0 (or its reverse) raise InvalidOperation.
        Nz(+-)INF * 0z0 * (+-)INFrR�1)r�r�rr;rQr�r�rir	rArPr:r�r<rnrerV)r0r�r1Z
resultsignr?Z	resultexpr�r�r)r)r+�__mul__�sH




zDecimal.__mul__cCs�t|�}|tkrtS|dkr"t�}|j|jA}|js:|jr�|�||�}|rN|S|��rj|��rj|�td�S|��rzt	|S|��r�|�t
d�t|d|���S|s�|s�|�t
d�S|�td|�S|s�|j|j}d}n�t|j�t|j�|jd}|j|j|}t|�}t|�}	|dk�r:t|jd	||	j�\}}
nt|j|	jd	|�\}}
|
�rt|d
dk�r�|d7}n8|j|j}||k�r�|d	dk�r�|d	}|d7}�q�t|t|�|�}|�|�S)zReturn self / other.Nz(+-)INF/(+-)INFzDivision by infinityrRz0 / 0zx / 0r&r.r�r~)r�r�rr;rQr�r�rir	rArr:�Etinyrr
rPrkr<rFrn�divmodrVrer�)r0r�r1rCr?rWr��shiftr�r��	remainder�	ideal_expr)r)r+�__truediv__,sP

zDecimal.__truediv__cCs|j|jA}|��r|j}nt|j|j�}|��|��}|rN|��sN|dkrht|dd�|�||j�fS||jk�r
t	|�}t	|�}|j
|j
kr�|jd|j
|j
9_n|jd|j
|j
9_t|j|j�\}}	|d|jk�r
t|t
|�d�t|jt
|	�|�fS|�td�}
|
|
fS)z�Return (self // other, self % other), to context.prec precision.

        Assumes that neither self nor other is a NaN, that self is not
        infinite and that other is nonzero.
        r�rRr&r�z%quotient too large in //, % or divmod)r;r�rPr�r�r:r�rErFrnrWrVr�rerir)r0r�r1rCr��expdiffr�r��q�rr?r)r)r+�_dividegs0
���zDecimal._dividecCs"t|�}|tkr|S|j||d�S)z)Swaps self/other and returns __truediv__.rL)r�r�r�r�r)r)r+�__rtruediv__�szDecimal.__rtruediv__cCs�t|�}|tkr|S|dkr"t�}|�||�}|r:||fS|j|jA}|��r~|��rj|�td�}||fSt||�td�fS|s�|s�|�t	d�}||fS|�t
d|�|�td�fS|�||�\}}|�|�}||fS)z6
        Return (self // other, self % other)
        Nzdivmod(INF, INF)�INF % xzdivmod(0, 0)�x // 0�x % 0)
r�r�rr�r;r�rir	rArr
r�r�)r0r�r1r?rCZquotientr�r)r)r+�
__divmod__�s4
�
�
zDecimal.__divmod__cCs"t|�}|tkr|S|j||d�S)z(Swaps self/other and returns __divmod__.rL)r�r�r�r�r)r)r+�__rdivmod__�szDecimal.__rdivmod__cCs�t|�}|tkr|S|dkr"t�}|�||�}|r6|S|��rJ|�td�S|sj|r^|�td�S|�td�S|�||�d}|�	|�}|S)z
        self % other
        Nr�r�z0 % 0r.)
r�r�rr�r�rir	rr�r�)r0r�r1r?r�r)r)r+�__mod__�s"
zDecimal.__mod__cCs"t|�}|tkr|S|j||d�S)z%Swaps self/other and returns __mod__.rL)r�r�r�r�r)r)r+�__rmod__�szDecimal.__rmod__cCs�|dkrt�}t|dd�}|�||�}|r.|S|��rB|�td�S|sb|rV|�td�S|�td�S|��r|t|�}|�|�St	|j
|j
�}|s�t|jd|�}|�|�S|�
�|�
�}||jdkr�|�t�S|d	kr�|�||j�}|�|�St|�}t|�}|j|jk�r(|jd
|j|j9_n|jd
|j|j9_t|j|j�\}}	d|	|d@|jk�r~|	|j8}	|d7}|d
|jk�r�|�t�S|j}
|	dk�r�d|
}
|	}	t|
t|	�|�}|�|�S)
zI
        Remainder nearest to 0-  abs(remainder-near) <= other/2
        NTr�zremainder_near(infinity, x)zremainder_near(x, 0)zremainder_near(0, 0)rRr.r�r�r^r&)rr�r�r�rir	rrr�r�rPr:r;r�rFrr�rErnrWrVr�re)r0r�r1r?�ideal_exponentr�r�r�r�r�rCr)r)r+�remainder_near�s`���






zDecimal.remainder_nearcCs�t|�}|tkr|S|dkr"t�}|�||�}|r6|S|��rb|��rR|�td�St|j|jAS|s�|r�|�t	d|j|jA�S|�t
d�S|�||�dS)z
self // otherNz
INF // INFr�z0 // 0r&)r�r�rr�r�rir	rAr;r
rr�r�r)r)r+�__floordiv__'s&
�zDecimal.__floordiv__cCs"t|�}|tkr|S|j||d�S)z*Swaps self/other and returns __floordiv__.rL)r�r�r�r�r)r)r+�
__rfloordiv__CszDecimal.__rfloordiv__cCs8|��r(|��rtd��|jr"dnd}nt|�}t|�S)zFloat representation.z%Cannot convert signaling NaN to floatz-nan�nan)r�r�rqr;reru�r0�sr)r)r+�	__float__JszDecimal.__float__cCst|jr(|��rtd��n|��r(td��d|j}|jdkrT|t|j�d|jS|t|jd|j�pjd�SdS)z1Converts self to an int, truncating if necessary.zCannot convert NaN to integerz"Cannot convert infinity to integerr�r&r�NrR)	rQr�rqr�r�r;rPrVr<r�r)r)r+�__int__Ts


zDecimal.__int__cCs|Sr(r)r�r)r)r+�realcszDecimal.realcCstd�S)Nr&�rr�r)r)r+�imaggszDecimal.imagcCs|Sr(r)r�r)r)r+�	conjugatekszDecimal.conjugatecCstt|��Sr()�complexrur�r)r)r+�__complex__nszDecimal.__complex__cCsR|j}|j|j}t|�|krJ|t|�|d��d�}t|j||jd�St|�S)z2Decapitate the payload of a NaN to fit the contextNrRT)	r<rF�clamprkrlr:r;rPr)r0r1ZpayloadZmax_payload_lenr)r)r+r=qszDecimal._fix_nancCsX|jr |��r|�|�St|�S|��}|��}|s�|j|g|j}tt	|j
|�|�}||j
krx|�t�t
|jd|�St|�St|j�|j
|j}||kr�|�td|j�}|�t�|�t�|S||k}|r�|}|j
|k�r�t|j�|j
|}	|	dk�rt
|jd|d�}d}	|j|j}
|
||	�}|jd|	��p>d}|dk�r~tt|�d�}t|�|jk�r~|dd�}|d7}||k�r�|�td|j�}nt
|j||�}|�r�|�r�|�t�|�r�|�t�|�r�|�t�|�t�|�s�|�t�|S|�r|�t�|jdk�rP|j
|k�rP|�t�|jd|j
|}
t
|j|
|�St|�S)z�Round if it is necessary to keep self within prec precision.

        Rounds and fixes the exponent.  Does not raise on a sNaN.

        Arguments:
        self - Decimal instance
        context - context used.
        rR�
above Emaxr&r�r.Nr�)rQr�r=rr��EtoprGr�r�r�rPrirr:r;rkr<rFrrr�_pick_rounding_functionrErerVrr
)r0r1r�r��exp_maxZnew_expZexp_minr?Zself_is_subnormalr}Zrounding_method�changedr�r�r)r)r+r�}sn
















zDecimal._fixcCst|j|�rdSdSdS)z(Also known as round-towards-0, truncate.r&r�N)�
_all_zerosr<�r0rFr)r)r+�_round_down�szDecimal._round_downcCs|�|�S)zRounds away from 0.)r�r�r)r)r+�	_round_up�szDecimal._round_upcCs*|j|dkrdSt|j|�r"dSdSdS)zRounds 5 up (away from 0)Z56789r.r&r�N)r<r�r�r)r)r+�_round_half_up�s
zDecimal._round_half_upcCst|j|�rdS|�|�SdS)zRound 5 downr�N��_exact_halfr<rr�r)r)r+�_round_half_down�szDecimal._round_half_downcCs8t|j|�r*|dks&|j|ddkr*dS|�|�SdS)z!Round 5 to even, rest to nearest.r&r.�02468r�Nrr�r)r)r+�_round_half_even�s��zDecimal._round_half_evencCs |jr|�|�S|�|�SdS)z(Rounds up (not away from 0 if negative.)N�r;r�r�r)r)r+�_round_ceilings
zDecimal._round_ceilingcCs |js|�|�S|�|�SdS)z'Rounds down (not towards 0 if negative)Nrr�r)r)r+�_round_floor
s
zDecimal._round_floorcCs0|r |j|ddkr |�|�S|�|�SdS)z)Round down unless digit prec-1 is 0 or 5.r.Z05N)r<r�r�r)r)r+�_round_05ups
zDecimal._round_05up)rrrrrrrrcCsb|dk	r2t|t�std��tdd|�}|�|�S|jrR|��rJtd��ntd��t|�	dt
��S)a�Round self to the nearest integer, or to a given precision.

        If only one argument is supplied, round a finite Decimal
        instance self to the nearest integer.  If self is infinite or
        a NaN then a Python exception is raised.  If self is finite
        and lies exactly halfway between two integers then it is
        rounded to the integer with even last digit.

        >>> round(Decimal('123.456'))
        123
        >>> round(Decimal('-456.789'))
        -457
        >>> round(Decimal('-3.0'))
        -3
        >>> round(Decimal('2.5'))
        2
        >>> round(Decimal('3.5'))
        4
        >>> round(Decimal('Inf'))
        Traceback (most recent call last):
          ...
        OverflowError: cannot round an infinity
        >>> round(Decimal('NaN'))
        Traceback (most recent call last):
          ...
        ValueError: cannot round a NaN

        If a second argument n is supplied, self is rounded to n
        decimal places using the rounding mode for the current
        context.

        For an integer n, round(self, -n) is exactly equivalent to
        self.quantize(Decimal('1En')).

        >>> round(Decimal('123.456'), 0)
        Decimal('123')
        >>> round(Decimal('123.456'), 2)
        Decimal('123.46')
        >>> round(Decimal('123.456'), -2)
        Decimal('1E+2')
        >>> round(Decimal('-Infinity'), 37)
        Decimal('NaN')
        >>> round(Decimal('sNaN123'), 0)
        Decimal('NaN123')

        Nz+Second argument to round should be integralr&r��cannot round a NaN�cannot round an infinity)rdrVrwr:�quantizerQr�rqr�r�r)r0r9rWr)r)r+�	__round__&s/


zDecimal.__round__cCs0|jr |��rtd��ntd��t|�dt��S)z�Return the floor of self, as an integer.

        For a finite Decimal instance self, return the greatest
        integer n such that n <= self.  If self is infinite or a NaN
        then a Python exception is raised.

        r
rr&)rQr�rqr�rVr�rr�r)r)r+�	__floor__ds

zDecimal.__floor__cCs0|jr |��rtd��ntd��t|�dt��S)z�Return the ceiling of self, as an integer.

        For a finite Decimal instance self, return the least integer n
        such that n >= self.  If self is infinite or a NaN then a
        Python exception is raised.

        r
rr&)rQr�rqr�rVr�rr�r)r)r+�__ceil__ss

zDecimal.__ceil__cCst|dd�}t|dd�}|js$|jr�|dkr2t�}|jdkrJ|�td|�S|jdkrb|�td|�S|jdkrr|}nf|jdkr�|}nV|jdkr�|s�|�td�St|j|jA}n*|jdkr�|s�|�td	�St|j|jA}n0t|j|jAt	t
|j�t
|j��|j|j�}|�||�S)
a:Fused multiply-add.

        Returns self*other+third with no rounding of the intermediate
        product self*other.

        self and other are multiplied together, with no rounding of
        the result.  The third operand is then added to the result,
        and a single final rounding is performed.
        Tr�NrZr�r9r[zINF * 0 in fmaz0 * INF in fma)
r�rQrrPrir	rAr;r:rerVr<r�)r0r�Zthirdr1�productr)r)r+�fma�s<




�
�
�zDecimal.fmacCs�t|�}|tkr|St|�}|tkr(|S|dkr6t�}|��}|��}|��}|sZ|sZ|r�|dkrp|�td|�S|dkr�|�td|�S|dkr�|�td|�S|r�|�|�S|r�|�|�S|�|�S|��r�|��r�|��s�|�td�S|dkr�|�td�S|�s|�td�S|��|j	k�r(|�td�S|�s@|�s@|�td	�S|�
��rPd}n|j}tt
|��}t|���}t|���}	|j
|td
|j|�|}t|	j�D]}
t|d
|�}�q�t||	j
|�}t|t|�d�S)z!Three argument version of __pow__Nr^r�z@pow() 3rd argument not allowed unless all arguments are integersr&zApow() 2nd argument cannot be negative when 3rd argument specifiedzpow() 3rd argument cannot be 0zSinsufficient precision: pow() 3rd argument must not have more than precision digitszXat least one of pow() 1st argument and 2nd argument must be nonzero; 0**0 is not definedr�)r�r�rr�rir	r=�
_isintegerr�rF�_isevenr;rmrVrn�to_integral_valuer�rW�ranger:re)r0r��modulor1r�r�Z
modulo_is_nanrC�base�exponent�ir)r)r+�
_power_modulo�s����


�������
zDecimal._power_modulocCs�t|�}|j|j}}|ddkr4|d}|d7}qt|�}|j|j}}|ddkrh|d}|d7}qJ|dk�r||9}|ddkr�|d}|d7}qz|dkr�dS|d|}	|jdkr�|	}	|��r�|jdkr�|jt|�}
t|	|
|d�}nd}tddd||	|�S|jdk�r�|d}|dk�r�||@|k�rBdSt	|�d}
|dd	}|t
t|��k�rpdSt|
||�}
t|||�}|
dk�s�|dk�r�dS|
|k�r�dSd
|
}n�|d
k�r�t	|�dd	}
t
d
|
|�\}}|�r�dS|d
dk�r|d
}|
d8}
�q�|dd}|t
t|��k�r6dSt|
||�}
t|||�}|
dk�sf|dk�rjdS|
|k�rxdSd
|
}ndS|d|k�r�dS|
|}tdt|�|�S|dk�r�|d|d}}n�|dk�r�t
tt||���|k�r�dSt	|�}|dk�r,t
tt|�|��|k�r,dS|d|}}|d
|d
k�r\dk�rtnn|d
}|d
}�q<|d
|d
k�r�dk�r�nn|d
}|d
}�qt|dk�rX|dk�r�||k�r�dSt
||�\}}|dk�r�dSdt	|�|>}t
|||d�\}}||k�r$�q<n||d||}�q�||k�rP|dk�sTdS|}|dk�r|||dt|�k�r|dS||}||9}|d|k�r�dSt|�}|���r�|jdk�r�|jt|�}
t||
|t
|��}nd}td|d|||�S)ahAttempt to compute self**other exactly.

        Given Decimals self and other and an integer p, attempt to
        compute an exact result for the power self**other, with p
        digits of precision.  Return None if self**other is not
        exactly representable in p digits.

        Assumes that elimination of special cases has already been
        performed: self and other must both be nonspecial; self must
        be positive and not numerically equal to 1; other must be
        nonzero.  For efficiency, other._exp should not be too large,
        so that 10**abs(other._exp) is a feasible calculation.r�r&r.Nr�rR)r^����]�Ar~�r\r^�d)rnrVrWrCrr;rPr�r:�_nbitsrkre�_decimal_lshift_exactr�rm�	_log10_lb)r0r��p�x�xc�xe�y�yc�yerr�ZzerosZ
last_digitr�Zemaxr�rzr9Zxc_bits�rem�ar�r�Zstr_xcr)r)r+�_power_exacts�:












&&$$


 zDecimal._power_exactcCs4|dk	r|�|||�St|�}|tkr*|S|dkr8t�}|�||�}|rL|S|sd|s`|�td�StSd}|jdkr�|�	�r�|�
�s�d}n|r�|�td�S|��}|s�|jdkr�t|dd�St
|S|��r�|jdkr�t
|St|dd�S|tk�r�|�	��rZ|jdk�rd}n||jk�r"|j}nt|�}|j|}|d|jk�rxd|j}|�t�n|�t�|�t�d|j}t|dd||�S|��}|���r�|jdk|dkk�r�t|dd�St
|Sd}d}	|��|��}
|dk|jdkk�r|
tt|j��k�rHt|d|jd�}n,|��}|
tt|��k�rHt|d|d�}|dk�r�|�||jd�}|dk	�r�|dk�r�td|j|j�}d	}	|dk�r8|j}t|�}
|
j|
j}}t|�}|j|j}}|jdk�r�|}d
}t||||||�\}}|ddtt|��|d�r�q(|d
7}�q�t|t|�|�}|	�r&|�	��s&t|j�|jk�r�|jdt|j�}t|j|jd||j|�}|� �}|�!�t"D]}d|j#|<�q�|�$|�}|�t�|j%t&�r�|�t'�|j%t(�r�|�t(d
|j�t't&ttt)fD]}|j%|�r|�|��qn
|�$|�}|S)aHReturn self ** other [ % modulo].

        With two arguments, compute self**other.

        With three arguments, compute (self**other) % modulo.  For the
        three argument form, the following restrictions on the
        arguments hold:

         - all three arguments must be integral
         - other must be nonnegative
         - either self or other (or both) must be nonzero
         - modulo must be nonzero and must have at most p digits,
           where p is the context precision.

        If any of these restrictions is violated the InvalidOperation
        flag is raised.

        The result of pow(self, other, modulo) is identical to the
        result that would be obtained by computing (self**other) %
        modulo with unbounded precision, but is computed more
        efficiently.  It is always exact.
        Nz0 ** 0r&r.z+x ** y with x negative and y not an integerrRr�FTr\r~r�r�)*rr�r�rr�rir	�_Oner;rrr�r:rAr�rFrVrPrrr��_log10_exp_boundrkrerGr�r.r<rnrWrC�_dpowerrMrN�_signals�trapsr��flagsr
rrr)r0r�rr1r?Zresult_signZ
multiplierrWZself_adj�exactZboundr�r%r&r'r(r)r*r+�extrar�r�Z
newcontextZ	exceptionr)r)r+�__pow__�s�
�













"�



zDecimal.__pow__cCs"t|�}|tkr|S|j||d�S)z%Swaps self/other and returns __pow__.rL)r�r�r7r�r)r)r+�__rpow__�	szDecimal.__rpow__cCs�|dkrt�}|jr(|j|d�}|r(|S|�|�}|��r>|S|sPt|jdd�S|j|��g|j	}t
|j�}|j}|j|ddkr�||kr�|d7}|d8}qtt|j|jd|�|�S)z?Normalize- strip trailing 0s, change anything equal to 0 to 0e0NrLrRr&r.)
rrQr�r�r�r:r;rGr�r�rkr<rP)r0r1r?�dupr��endrWr)r)r+�	normalize�	s$


zDecimal.normalizecCs�t|dd�}|dkrt�}|dkr(|j}|js4|jr||�||�}|rH|S|��sX|��r||��rp|��rpt|�S|�td�S|�	�|j
kr�|jks�n|�td�S|s�t|j
d|j
�}|�|�S|��}||jkr�|�td�S||j
d|jk�r|�td	�S|�|j
|�}|��|jk�r.|�td�St|j�|jk�rL|�td	�S|�rl|��|jk�rl|�t�|j
|j
k�r�||k�r�|�t�|�t�|�|�}|S)
z�Quantize self so its exponent is the same as that of exp.

        Similar to self._rescale(exp._exp) but with error checking.
        Tr�Nzquantize with one INFz)target exponent out of bounds in quantizerRz9exponent of quantize result too large for current contextr.z7quantize result has too many digits for current context)r�rrErQr�r�rrir	r�rPrGr:r;r�r�rFr�rkr<�Eminr
rr)r0rWrEr1r?r�r)r)r+r�	s`��

����




zDecimal.quantizecCsDt|dd�}|js|jr8|��r(|��p6|��o6|��S|j|jkS)a=Return True if self and other have the same exponent; otherwise
        return False.

        If either operand is a special value, the following rules are used:
           * return True if both operands are infinities
           * return True if both operands are NaNs
           * otherwise, return False.
        Tr�)r�rQr��is_infiniterPr�r)r)r+�same_quantum%
s	�zDecimal.same_quantumcCs�|jrt|�S|s t|jd|�S|j|krHt|j|jd|j||�St|j�|j|}|dkrzt|jd|d�}d}|j|}|||�}|jd|�p�d}|dkr�tt	|�d�}t|j||�S)asRescale self so that the exponent is exp, either by padding with zeros
        or by truncating digits, using the given rounding mode.

        Specials are returned without change.  This operation is
        quiet: it raises no flags, and uses no information from the
        context.

        exp = exp to scale to (an integer)
        rounding = rounding mode
        rRr&r�r.N)
rQrr:r;rPr<rkr�rerV)r0rWrEr}Z
this_functionr�r�r)r)r+r�4
s&
�

zDecimal._rescalecCsf|dkrtd��|js|s"t|�S|�|��d||�}|��|��krb|�|��d||�}|S)a"Round a nonzero, nonspecial Decimal to a fixed number of
        significant figures, using the given rounding mode.

        Infinities, NaNs and zeros are returned unaltered.

        This operation is quiet: it raises no flags, and uses no
        information from the context.

        r&z'argument should be at least 1 in _roundr.)rqrQrr�r�)r0�placesrEr?r)r)r+�_roundV
s

zDecimal._roundcCs�|jr"|j|d�}|r|St|�S|jdkr4t|�S|sFt|jdd�S|dkrTt�}|dkrb|j}|�d|�}||kr�|�	t
�|�	t�|S)aVRounds to a nearby integer.

        If no rounding mode is specified, take the rounding mode from
        the context.  This method raises the Rounded and Inexact flags
        when appropriate.

        See also: to_integral_value, which does exactly the same as
        this method except that it doesn't raise Inexact or Rounded.
        rLr&rRN)rQr�rrPr:r;rrEr�rirr�r0rEr1r?r)r)r+�to_integral_exactm
s$



zDecimal.to_integral_exactcCs`|dkrt�}|dkr|j}|jr>|j|d�}|r6|St|�S|jdkrPt|�S|�d|�SdS)z@Rounds to the nearest integer, without raising inexact, rounded.NrLr&)rrErQr�rrPr�rAr)r)r+r�
s
zDecimal.to_integral_valuecCs�|dkrt�}|jrB|j|d�}|r(|S|��rB|jdkrBt|�S|sdt|jd|jd�}|�|�S|jdkrz|�	t
d�S|jd}t|�}|j
d?}|j
d@r�|jd}t|j�d?d}n|j}t|j�dd?}||}|dkr�|d	|9}d
}	nt|d	|�\}}
|
}	||8}d|}||}||k�r:�qJn||d?}�q"|	�oZ|||k}	|	�r�|dk�rz|d|}n|d|9}||7}n|ddk�r�|d7}tdt|�|�}|��}|�t�}
|�|�}|
|_|S)zReturn the square root of self.NrLr&rRr^r.zsqrt(-x), x > 0r�r!Tr~)rrQr�r�r;rr:rPr�rir	rFrnrWrVrkr<r�re�
_shallow_copy�
_set_roundingrrE)r0r1r?rF�opr��c�lr�r5r�r9r�rEr)r)r+�sqrt�
s^










zDecimal.sqrtcCs�t|dd�}|dkrt�}|js&|jr~|��}|��}|s>|r~|dkrX|dkrX|�|�S|dkrr|dkrr|�|�S|�||�S|�|�}|dkr�|�|�}|dkr�|}n|}|�|�S)z�Returns the larger value.

        Like max(self, other) except if one is not a number, returns
        NaN (and signals if one is sNaN).  Also rounds.
        Tr�Nr.r&r��r�rrQr�r�r�r��
compare_total�r0r�r1ZsnZonrFr?r)r)r+r�s&


	
zDecimal.maxcCs�t|dd�}|dkrt�}|js&|jr~|��}|��}|s>|r~|dkrX|dkrX|�|�S|dkrr|dkrr|�|�S|�||�S|�|�}|dkr�|�|�}|dkr�|}n|}|�|�S)z�Returns the smaller value.

        Like min(self, other) except if one is not a number, returns
        NaN (and signals if one is sNaN).  Also rounds.
        Tr�Nr.r&r�rIrKr)r)r+r�*s&



zDecimal.mincCs8|jr
dS|jdkrdS|j|jd�}|dt|�kS)z"Returns whether self is an integerFr&TNrR)rQrPr<rk)r0�restr)r)r+rLs
zDecimal._isintegercCs&|r|jdkrdS|jd|jdkS)z:Returns True if self is even.  Assumes self is an integer.r&Tr�r)rPr<r�r)r)r+rUszDecimal._isevencCs2z|jt|j�dWStk
r,YdSXdS)z$Return the adjusted exponent of selfr.r&N)rPrkr<rwr�r)r)r+r�[szDecimal.adjustedcCs|S)z�Returns the same Decimal object.

        As we do not have different encodings for the same number, the
        received object already is in its canonical form.
        r)r�r)r)r+�	canonicalcszDecimal.canonicalcCs.t|dd�}|�||�}|r |S|j||d�S)z�Compares self to the other operand numerically.

        It's pretty much like compare(), but all NaNs signal, with signaling
        NaNs taking precedence over quiet NaNs.
        Tr�rL)r�r�r�r�r)r)r+�compare_signalks
zDecimal.compare_signalcCs`t|dd�}|jr|jstS|js,|jr,tS|j}|��}|��}|sL|�r||kr�t|j�|jf}t|j�|jf}||kr�|r�tStS||kr�|r�tStStS|r�|dkr�tS|dkr�tS|dkr�tS|dkr�tSn2|dkr�tS|dkr�tS|dkr�tS|dk�rtS||k�rtS||k�r$tS|j|jk�r@|�r<tStS|j|jk�r\|�rXtStStS)z�Compares self to other using the abstract representations.

        This is not like the standard compare, which use their numerical
        value. Note that a total ordering is defined for all possible abstract
        representations.
        Tr�r.r^)	r�r;�_NegativeOner/r�rkr<�_ZerorP)r0r�r1rCZself_nanZ	other_nanZself_keyZ	other_keyr)r)r+rJwsf



zDecimal.compare_totalcCs&t|dd�}|��}|��}|�|�S)z�Compares self to other using abstract repr., ignoring sign.

        Like compare_total, but with operand's sign ignored and assumed to be 0.
        Tr�)r�r�rJ)r0r�r1r��or)r)r+�compare_total_mag�szDecimal.compare_total_magcCstd|j|j|j�S)z'Returns a copy with the sign set to 0. r&)r:r<rPrQr�r)r)r+r��szDecimal.copy_abscCs2|jrtd|j|j|j�Std|j|j|j�SdS)z&Returns a copy with the sign inverted.r&r.N)r;r:r<rPrQr�r)r)r+r��szDecimal.copy_negatecCs"t|dd�}t|j|j|j|j�S)z$Returns self with the sign of other.Tr�)r�r:r;r<rPrQr�r)r)r+�	copy_sign�s

�zDecimal.copy_signcCs�|dkrt�}|j|d�}|r"|S|��dkr2tS|s:tS|��dkrNt|�S|j}|��}|jdkr�|t	t
|jdd��kr�tdd|jd�}�n0|jdkr�|t	t
|�
�dd��kr�tdd|�
�d�}n�|jdk�r||k�rtddd|dd|�}n�|jdk�rD||dk�rDtdd	|d|d�}n�t|�}|j|j}}|jdk�rl|}d}t||||�\}	}
|	d
dt	t
|	��|d�r��q�|d7}�qptdt
|	�|
�}|��}|�t�}|�|�}||_|S)zReturns e ** self.NrLr�r.r&r\r�rRrDr~r�)rr�r�rPr/rrFr�r;rkrerGr:r�rnrVrWrC�_dexprCrDrr�rE)r0r1r?r%�adjrErFr�r6r�rWrEr)r)r+rW�sH$( "

zDecimal.expcCsdS)z�Return True if self is canonical; otherwise return False.

        Currently, the encoding of a Decimal instance is always
        canonical, so this method returns True for any Decimal.
        Tr)r�r)r)r+�is_canonical'szDecimal.is_canonicalcCs|jS)z�Return True if self is finite; otherwise return False.

        A Decimal instance is considered finite if it is neither
        infinite nor a NaN.
        )rQr�r)r)r+�	is_finite/szDecimal.is_finitecCs
|jdkS)z8Return True if self is infinite; otherwise return False.r[�rPr�r)r)r+r=7szDecimal.is_infinitecCs
|jdkS)z>Return True if self is a qNaN or sNaN; otherwise return False.r`rXr�r)r)r+r�;szDecimal.is_nancCs*|js
|sdS|dkrt�}|j|��kS)z?Return True if self is a normal number; otherwise return False.FN)rQrr<r�r�r)r)r+�	is_normal?s

zDecimal.is_normalcCs
|jdkS)z;Return True if self is a quiet NaN; otherwise return False.r9rXr�r)r)r+r�GszDecimal.is_qnancCs
|jdkS)z8Return True if self is negative; otherwise return False.r.)r;r�r)r)r+�	is_signedKszDecimal.is_signedcCs
|jdkS)z?Return True if self is a signaling NaN; otherwise return False.rZrXr�r)r)r+r�OszDecimal.is_snancCs*|js
|sdS|dkrt�}|��|jkS)z9Return True if self is subnormal; otherwise return False.FN)rQrr�r<r�r)r)r+�is_subnormalSs

zDecimal.is_subnormalcCs|jo|jdkS)z6Return True if self is a zero; otherwise return False.rRr�r�r)r)r+�is_zero[szDecimal.is_zerocCs�|jt|j�d}|dkr4tt|dd��dS|dkrXttd|dd��dSt|�}|j|j}}|dkr�t|d|�}t|�}t|�t|�||kS|ttd||��dS)z�Compute a lower bound for the adjusted exponent of self.ln().
        In other words, compute r such that self.ln() >= 10**r.  Assumes
        that self is finite and positive and that self != 1.
        r.�r�r�r�r&�rPrkr<rernrVrW�r0rUrErFr��numZdenr)r)r+�
_ln_exp_bound_szDecimal._ln_exp_boundc
Cs|dkrt�}|j|d�}|r"|S|s*tS|��dkr:tS|tkrFtS|jdkr\|�t	d�St
|�}|j|j}}|j
}||��d}t|||�}|ddttt|���|dr�q�|d7}q�tt|d	k�tt|��|�}|��}|�t�}	|�|�}|	|_|S)
z/Returns the natural (base e) logarithm of self.NrLr.zln of a negative valuer^r~r�r\r&)rr��_NegativeInfinityr��	_Infinityr/rPr;rir	rnrVrWrFra�_dlogrkrermr:rCrDrr�rE�
r0r1r?rErFr�r%r?r�rEr)r)r+�lnxs:
�$


z
Decimal.lncCs�|jt|j�d}|dkr,tt|��dS|dkrHttd|��dSt|�}|j|j}}|dkr�t|d|�}td|�}t|�t|�||kdStd||�}t|�||dkdS)	z�Compute a lower bound for the adjusted exponent of self.log10().
        In other words, find r such that self.log10() >= 10**r.
        Assumes that self is finite and positive and that self != 1.
        r.r�r�r&r���r^Z231r^r_r)r)r+r0�szDecimal._log10_exp_boundc
CsF|dkrt�}|j|d�}|r"|S|s*tS|��dkr:tS|jdkrP|�td�S|jddkr�|jdd�dt	|j�dkr�t
|jt	|j�d�}n�t|�}|j
|j}}|j}||��d}t|||�}|d	d
t	tt|���|dr��q|d7}q�tt
|dk�tt|��|�}|��}|�t�}	|�|�}|	|_|S)z&Returns the base 10 logarithm of self.NrLr.zlog10 of a negative valuer&r�rRr^r~r�r\)rr�rbr�rcr;rir	r<rkrrPrnrVrWrFr0�_dlog10rermr:rCrDrr�rErer)r)r+�log10�s:
�.$


z
Decimal.log10cCsV|j|d�}|r|S|dkr"t�}|��r.tS|s@|�tdd�St|���}|�|�S)aM Returns the exponent of the magnitude of self's MSD.

        The result is the integer which is the exponent of the magnitude
        of the most significant digit of self (as though it were truncated
        to a single digit while maintaining the value of that digit and
        without limiting the resulting exponent).
        rLNzlogb(0)r.)	r�rr�rcrir
rr�r�r�r)r)r+�logb�s	zDecimal.logbcCs6|jdks|jdkrdS|jD]}|dkrdSqdS)z�Return True if self is a logical operand.

        For being logical, it must be a finite number with a sign of 0,
        an exponent of 0, and a coefficient whose digits must all be
        either 0 or 1.
        r&FZ01T)r;rPr<)r0�digr)r)r+�
_islogical
s
zDecimal._islogicalcCs�|jt|�}|dkr$d||}n|dkr<||jd�}|jt|�}|dkr`d||}n|dkrx||jd�}||fS)Nr&rR)rFrk)r0r1�opa�opbZdifr)r)r+�
_fill_logical'
szDecimal._fill_logicalcCsz|dkrt�}t|dd�}|��r*|��s4|�t�S|�||j|j�\}}d�dd�t||�D��}t	d|�
d�ptdd�S)	z;Applies an 'and' operation between self and other's digits.NTr�rTcSs$g|]\}}tt|�t|�@��qSr)�rerV��.0r-�br)r)r+�
<listcomp>B
sz'Decimal.logical_and.<locals>.<listcomp>r&rR�rr�rlrir	ror<rs�zipr:rl�r0r�r1rmrnr�r)r)r+�logical_and4
s
zDecimal.logical_andcCs(|dkrt�}|�tdd|jd�|�S)zInvert all its digits.Nr&r�)r�logical_xorr:rFr�r)r)r+�logical_invertE
s
�zDecimal.logical_invertcCsz|dkrt�}t|dd�}|��r*|��s4|�t�S|�||j|j�\}}d�dd�t||�D��}t	d|�
d�ptdd�S)	z:Applies an 'or' operation between self and other's digits.NTr�rTcSs$g|]\}}tt|�t|�B��qSr)rprqr)r)r+rtZ
sz&Decimal.logical_or.<locals>.<listcomp>r&rRrurwr)r)r+�
logical_orL
s
zDecimal.logical_orcCsz|dkrt�}t|dd�}|��r*|��s4|�t�S|�||j|j�\}}d�dd�t||�D��}t	d|�
d�ptdd�S)	z;Applies an 'xor' operation between self and other's digits.NTr�rTcSs$g|]\}}tt|�t|�A��qSr)rprqr)r)r+rtk
sz'Decimal.logical_xor.<locals>.<listcomp>r&rRrurwr)r)r+ry]
s
zDecimal.logical_xorcCs�t|dd�}|dkrt�}|js&|jr~|��}|��}|s>|r~|dkrX|dkrX|�|�S|dkrr|dkrr|�|�S|�||�S|���|���}|dkr�|�|�}|dkr�|}n|}|�|�S�z8Compares the values numerically with their sign ignored.Tr�Nr.r&r��	r�rrQr�r�r�r�r�rJrKr)r)r+�max_magn
s&


zDecimal.max_magcCs�t|dd�}|dkrt�}|js&|jr~|��}|��}|s>|r~|dkrX|dkrX|�|�S|dkrr|dkrr|�|�S|�||�S|���|���}|dkr�|�|�}|dkr�|}n|}|�|�Sr|r}rKr)r)r+�min_mag�
s&


zDecimal.min_magcCs�|dkrt�}|j|d�}|r"|S|��dkr2tS|��dkrTtdd|j|���S|��}|�t	�|�
�|�|�}||kr�|S|�tdd|�
�d�|�S)z=Returns the largest representable number smaller than itself.NrLr�r.r&rDr�)rr�r�rbr:rFr�rMrDr�_ignore_all_flagsr�r�r��r0r1r?Znew_selfr)r)r+�
next_minus�
s$

�zDecimal.next_minuscCs�|dkrt�}|j|d�}|r"|S|��dkr2tS|��dkrTtdd|j|���S|��}|�t	�|�
�|�|�}||kr�|S|�tdd|�
�d�|�S)z=Returns the smallest representable number larger than itself.NrLr.r�rDr&r�)rr�r�rcr:rFr�rMrDrr�r�r�r�r�r)r)r+�	next_plus�
s$

�zDecimal.next_pluscCs�t|dd�}|dkrt�}|�||�}|r.|S|�|�}|dkrJ|�|�S|dkr^|�|�}n
|�|�}|��r�|�t	d|j
�|�t�|�t�nD|�
�|jkr�|�t�|�t�|�t�|�t�|s�|�t�|S)a�Returns the number closest to self, in the direction towards other.

        The result is the closest representable number to self
        (excluding self) that is in the direction towards other,
        unless both have the same value.  If the two operands are
        numerically equal, then the result is a copy of self with the
        sign set to be the same as the sign of other.
        Tr�Nr&r�z Infinite result from next_toward)r�rr�r�rSr�r�r�rirr;rrr�r<rr
r)r0r�r1r?Z
comparisonr)r)r+�next_toward�
s6	


�





zDecimal.next_towardcCs�|��rdS|��rdS|��}|dkr,dS|dkr8dS|��rN|jrJdSdS|d	kr\t�}|j|d
�rv|jrrdSdS|jr�d
SdSd	S)aReturns an indication of the class of self.

        The class is one of the following strings:
          sNaN
          NaN
          -Infinity
          -Normal
          -Subnormal
          -Zero
          +Zero
          +Subnormal
          +Normal
          +Infinity
        r�r�r.z	+Infinityr�z	-Infinityz-Zeroz+ZeroNrLz
-Subnormalz
+Subnormalz-Normalz+Normal)r�r�r�r\r;rr[)r0r1�infr)r)r+�number_classs,zDecimal.number_classcCstd�S)z'Just returns 10, as this is Decimal, :)r�r�r�r)r)r+�radix0sz
Decimal.radixcCs�|dkrt�}t|dd�}|�||�}|r.|S|jdkrB|�t�S|jt|�kr`|jksln|�t�S|��r|t	|�St|�}|j
}|jt|�}|dkr�d||}n|dkr�||d�}||d�|d|�}t|j
|�d�p�d|j�S)z5Returns a rotated copy of self, value-of-other times.NTr�r&rR�rr�r�rPrir	rFrVr�rr<rkr:r;rl)r0r�r1r?�torot�rotdig�topadZrotatedr)r)r+�rotate4s0

 
�zDecimal.rotatecCs�|dkrt�}t|dd�}|�||�}|r.|S|jdkrB|�t�Sd|j|j}d|j|j}|t|�krz|ks�n|�t�S|�	�r�t
|�St|j|j
|jt|��}|�|�}|S)z>Returns self operand after adding the second value to its exp.NTr�r&r�r^)rr�r�rPrir	rGrFrVr�rr:r;r<r�)r0r�r1r?ZliminfZlimsupr�r)r)r+�scalebUs"



zDecimal.scalebcCs|dkrt�}t|dd�}|�||�}|r.|S|jdkrB|�t�S|jt|�kr`|jksln|�t�S|��r|t	|�St|�}|j
}|jt|�}|dkr�d||}n|dkr�||d�}|dkr�|d|�}n|d|}||jd�}t|j
|�d��p
d|j�S)z5Returns a shifted copy of self, value-of-other times.NTr�r&rRr�)r0r�r1r?r�r�r�Zshiftedr)r)r+r�ns6

 
�z
Decimal.shiftcCs|jt|�ffSr()�	__class__rer�r)r)r+�
__reduce__�szDecimal.__reduce__cCst|�tkr|S|�t|��Sr(��typerr�rer�r)r)r+�__copy__�szDecimal.__copy__cCst|�tkr|S|�t|��Sr(r�)r0Zmemor)r)r+�__deepcopy__�szDecimal.__deepcopy__cCsJ|dkrt�}t||d�}|jrXt|j|�}t|���}|ddkrL|d7}t|||�S|ddkrvddg|j|d<|ddkr�t	|j|j
|jd�}|j}|d}|dk	�r|dd	kr�|�
|d
|�}nF|ddkr�|�||�}n*|ddk�rt|j
�|k�r|�
||�}|�s@|jd
k�r@|ddk�r@|�d
|�}|jt|j
�}	|dd	k�r~|�sx|dk	�rxd
|}
nd
}
nB|ddk�r�|	}
n.|ddk�r�|jd
k�r�|	dk�r�|	}
nd
}
|
d
k�r�d}d|
|j
}nP|
t|j
�k�r|j
d|
t|j
�}d}n"|j
d|
��p d}|j
|
d�}|	|
}
t|j|||
|�S)a|Format a Decimal instance according to the given specifier.

        The specifier should be a standard format specifier, with the
        form described in PEP 3101.  Formatting types 'e', 'E', 'f',
        'F', 'g', 'G', 'n' and '%' are supported.  If the formatting
        type is omitted it defaults to 'g' or 'G', depending on the
        value of context.capitals.
        N)�_localeconvr��%�g�Gr^�	precision�eEr.zfF%ZgGr&r�rRrT)r�_parse_format_specifierrQ�_format_signr;rer��
_format_alignr�r:r<rPrEr@r�rk�_format_number)r0Z	specifierr1r��specrC�bodyrEr�r�r�r{r|rWr)r)r+�
__format__�sZ
 

zDecimal.__format__)rRN)NN)N)N)N)N)N)N)FN)N)N)N)TN)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)NN)N)N)NN)N)NN)NN)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)NN)�r4r5r6r7�	__slots__rc�classmethodrvr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��__radd__r�r�r��__rmul__r�r�r�r�r�r�r�r�r�r�r�r��	__trunc__�propertyr�r�r�r�r=r�r�r�rrrrrr	�dictr�r
rrrrr.r7r8r;rr>r�r@rBr�to_integralrHr�r�rrr�rMrNrJrRr�r�rSrWrVrWr=r�rYr�rZr�r[r\rarfr0rirjrlrorxrzr{ryr~rr�r�r�r�r�r�r�r�r�r�r�r�r)r)r)r+rs

,
 !@

	
	
	
	
2
4
	



V7;!$K



f	�>,UnY="c*"	IK23
.*!'FcCs&t�t�}||_||_||_||_|S)z�Create a decimal instance directly, without any validation,
    normalization (e.g. removal of leading zeros) or argument
    conversion.

    This function is for *internal use only*.
    )rbrcrr;r<rPrQ)rCZcoefficientrZspecialr0r)r)r+r:�s
r:c@s(eZdZdZdd�Zdd�Zdd�ZdS)	rOz�Context manager class to support localcontext().

      Sets a copy of the supplied context in __enter__() and restores
      the previous decimal context in __exit__()
    cCs|��|_dSr()rM�new_context)r0r�r)r)r+�__init__sz_ContextManager.__init__cCst�|_t|j�|jSr()r�
saved_contextrr�r�r)r)r+�	__enter__s
z_ContextManager.__enter__cCst|j�dSr()rr�)r0�t�v�tbr)r)r+�__exit__sz_ContextManager.__exit__N)r4r5r6r7r�r�r�r)r)r)r+rOsrOc	@s�eZdZdZd�dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZeZd�dd�Zdd�Zdd�Zdd �ZdZd!d"�Zd#d$�Zd%d&�Zd�d(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Z d:d;�Z!d<d=�Z"d>d?�Z#d@dA�Z$dBdC�Z%dDdE�Z&dFdG�Z'dHdI�Z(dJdK�Z)dLdM�Z*dNdO�Z+dPdQ�Z,dRdS�Z-dTdU�Z.dVdW�Z/dXdY�Z0dZd[�Z1d\d]�Z2d^d_�Z3d`da�Z4dbdc�Z5ddde�Z6dfdg�Z7dhdi�Z8djdk�Z9dldm�Z:dndo�Z;dpdq�Z<drds�Z=dtdu�Z>dvdw�Z?dxdy�Z@dzd{�ZAd|d}�ZBd~d�ZCd�d��ZDd�d��ZEd�d��ZFd�d��ZGd�d�d��ZHd�d��ZId�d��ZJd�d��ZKd�d��ZLd�d��ZMd�d��ZNd�d��ZOd�d��ZPd�d��ZQd�d��ZRd�d��ZSd�d��ZTd�d��ZUd�d��ZVeVZWdS)�ra�Contains the context for a Decimal instance.

    Contains:
    prec - precision (for use in rounding, division, square roots..)
    rounding - rounding type (how you round)
    traps - If traps[exception] = 1, then the exception is
                    raised when it is caused.  Otherwise, a value is
                    substituted in.
    flags  - When an exception is caused, flags[exception] is set.
             (Whether or not the trap_enabler is set)
             Should be reset by user of Decimal instance.
    Emin -   Minimum exponent
    Emax -   Maximum exponent
    capitals -      If 1, 1*10^1 is printed as 1E+1.
                    If 0, printed as 1e1
    clamp -  If 1, change exponents if too high (Default 0)
    Nc
s>zt}
Wntk
rYnX|dk	r*|n|
j|_|dk	r>|n|
j|_|dk	rR|n|
j|_|dk	rf|n|
j|_|dk	rz|n|
j|_|dk	r�|n|
j|_|	dkr�g|_n|	|_�dkr�|
j	�
�|_	n.t�t�s�t�fdd�t
�D��|_	n�|_	�dk�r
t�t
d�|_n0t�t��s4t�fdd�t
�D��|_n�|_dS)Nc3s|]}|t|�k�fVqdSr(�rV�rrr��r3r)r+�	<genexpr>Isz#Context.__init__.<locals>.<genexpr>r&c3s|]}|t|�k�fVqdSr(r�r��r4r)r+r�Ps)r�	NameErrorrFrEr<rGr�r��_ignored_flagsr3rMrdr�r2�fromkeysr4)r0rFrEr<rGr�r�r4r3r�Zdcr))r4r3r+r�0s.

zContext.__init__cCs�t|t�std|��|dkr<||kr�td||||f��nJ|dkrb||kr�td||||f��n$||ksr||kr�td||||f��t�|||�S)Nz%s must be an integer�-infz%s must be in [%s, %d]. got: %sr�z%s must be in [%d, %s]. got: %sz%s must be in [%d, %d]. got %s)rdrVrwrqrb�__setattr__)r0�nameryZvminZvmaxr)r)r+�_set_integer_checkTs
zContext._set_integer_checkcCs`t|t�std|��|D]}|tkrtd|��qtD]}||kr8td|��q8t�|||�S)Nz%s must be a signal dictz%s is not a valid signal dict)rdr�rwr2�KeyErrorrbr�)r0r�r��keyr)r)r+�_set_signal_dictbs
zContext._set_signal_dictcCs�|dkr|�||dd�S|dkr0|�||dd�S|dkrH|�||dd�S|dkr`|�||dd�S|d	krx|�||dd�S|d
kr�|tkr�td|��t�|||�S|dks�|d
kr�|�||�S|dkr�t�|||�Std|��dS)NrFr.r�r<r�r&rGr�r�rEz%s: invalid rounding moder4r3r�z.'decimal.Context' object has no attribute '%s')r��_rounding_modesrwrbr�r��AttributeError)r0r�ryr)r)r+r�ms*�zContext.__setattr__cCstd|��dS)Nz%s cannot be deleted)r�)r0r�r)r)r+�__delattr__�szContext.__delattr__c	CsNdd�|j��D�}dd�|j��D�}|j|j|j|j|j|j|j	||ffS)NcSsg|]\}}|r|�qSr)r)�rrZsigr�r)r)r+rt�sz&Context.__reduce__.<locals>.<listcomp>cSsg|]\}}|r|�qSr)r)r�r)r)r+rt�s)
r4�itemsr3r�rFrEr<rGr�r�)r0r4r3r)r)r+r��s��zContext.__reduce__cCs|g}|�dt|��dd�|j��D�}|�dd�|�d�dd�|j��D�}|�dd�|�d�d�|�d	S)
zShow the current context.zrContext(prec=%(prec)d, rounding=%(rounding)s, Emin=%(Emin)d, Emax=%(Emax)d, capitals=%(capitals)d, clamp=%(clamp)dcSsg|]\}}|r|j�qSr)�r4)rrr�r�r)r)r+rt�sz$Context.__repr__.<locals>.<listcomp>zflags=[z, �]cSsg|]\}}|r|j�qSr)r�)rrr�r�r)r)r+rt�sztraps=[�))rr�varsr4r�rsr3)r0r��namesr)r)r+r��s�zContext.__repr__cCs|jD]}d|j|<qdS)zReset all flags to zeror&Nr��r0�flagr)r)r+rN�s
zContext.clear_flagscCs|jD]}d|j|<qdS)zReset all traps to zeror&Nr�r�r)r)r+�clear_traps�s
zContext.clear_trapsc
Cs.t|j|j|j|j|j|j|j|j|j	�	}|S)z!Returns a shallow copy from self.)
rrFrEr<rGr�r�r4r3r��r0Zncr)r)r+rC�s�zContext._shallow_copyc
Cs6t|j|j|j|j|j|j|j��|j	��|j
�	}|S)zReturns a deep copy from self.)rrFrEr<rGr�r�r4rMr3r�r�r)r)r+rM�s�zContext.copycGsZt�||�}||jkr(|�j|f|��Sd|j|<|j|sN|�j|f|��S||��dS)a#Handles an error

        If the flag is in _ignored_flags, returns the default response.
        Otherwise, it sets the flag, then, if the corresponding
        trap_enabler is set, it reraises the exception.  Otherwise, it returns
        the default value after setting the flag.
        r.N)�_condition_maprIr�r2r4r3)r0Z	conditionZexplanationr*�errorr)r)r+ri�s


zContext._raise_errorcCs
|jt�S)z$Ignore all flags, if they are raised)�
_ignore_flagsr2r�r)r)r+r��szContext._ignore_all_flagscGs|jt|�|_t|�S)z$Ignore the flags, if they are raised)r�ro)r0r4r)r)r+r��szContext._ignore_flagscGs8|rt|dttf�r|d}|D]}|j�|�q"dS)z+Stop ignoring the flags, if they are raisedr&N)rdrpror��remove)r0r4r�r)r)r+�
_regard_flags�szContext._regard_flagscCst|j|jd�S)z!Returns Etiny (= Emin - prec + 1)r.)rVr<rFr�r)r)r+r��sz
Context.EtinycCst|j|jd�S)z,Returns maximum exponent (= Emax - prec + 1)r.)rVrGrFr�r)r)r+r��szContext.EtopcCs|j}||_|S)a�Sets the rounding type.

        Sets the rounding type, and returns the current (previous)
        rounding type.  Often used like:

        context = context.copy()
        # so you don't change the calling context
        # if an error occurs in the middle.
        rounding = context._set_rounding(ROUND_UP)
        val = self.__sub__(other, context=context)
        context._set_rounding(rounding)

        This will make it round up for that operation.
        )rE)r0r�rEr)r)r+rD�szContext._set_roundingrRcCsjt|t�r*||��ksd|kr*|�td�St||d�}|��r`t|j�|j	|j
kr`|�td�S|�|�S)z�Creates a new Decimal instance but using self as context.

        This method implements the to-number operation of the
        IBM Decimal specification.rSzAtrailing or leading whitespace and underscores are not permitted.rLzdiagnostic info too long in NaN)rdrergrirrr�rkr<rFr�r�)r0r`r�r)r)r+�create_decimal�s��zContext.create_decimalcCst�|�}|�|�S)a�Creates a new Decimal instance from a float but rounding using self
        as the context.

        >>> context = Context(prec=5, rounding=ROUND_DOWN)
        >>> context.create_decimal_from_float(3.1415926535897932)
        Decimal('3.1415')
        >>> context = Context(prec=5, traps=[Inexact])
        >>> context.create_decimal_from_float(3.1415926535897932)
        Traceback (most recent call last):
            ...
        decimal.Inexact: None

        )rrvr�)r0r�r�r)r)r+�create_decimal_from_floats
z!Context.create_decimal_from_floatcCst|dd�}|j|d�S)a[Returns the absolute value of the operand.

        If the operand is negative, the result is the same as using the minus
        operation on the operand.  Otherwise, the result is the same as using
        the plus operation on the operand.

        >>> ExtendedContext.abs(Decimal('2.1'))
        Decimal('2.1')
        >>> ExtendedContext.abs(Decimal('-100'))
        Decimal('100')
        >>> ExtendedContext.abs(Decimal('101.5'))
        Decimal('101.5')
        >>> ExtendedContext.abs(Decimal('-101.5'))
        Decimal('101.5')
        >>> ExtendedContext.abs(-1)
        Decimal('1')
        Tr�rL)r�r��r0r-r)r)r+rm!szContext.abscCs8t|dd�}|j||d�}|tkr0td|��n|SdS)a�Return the sum of the two operands.

        >>> ExtendedContext.add(Decimal('12'), Decimal('7.00'))
        Decimal('19.00')
        >>> ExtendedContext.add(Decimal('1E+2'), Decimal('1.01E+4'))
        Decimal('1.02E+4')
        >>> ExtendedContext.add(1, Decimal(2))
        Decimal('3')
        >>> ExtendedContext.add(Decimal(8), 5)
        Decimal('13')
        >>> ExtendedContext.add(5, 5)
        Decimal('10')
        Tr�rL�Unable to convert %s to DecimalN)r�r�r�rw�r0r-rsr�r)r)r+�add6s
zContext.addcCst|�|��Sr()rer�r�r)r)r+�_applyKszContext._applycCst|t�std��|��S)z�Returns the same Decimal object.

        As we do not have different encodings for the same number, the
        received object already is in its canonical form.

        >>> ExtendedContext.canonical(Decimal('2.50'))
        Decimal('2.50')
        z,canonical requires a Decimal as an argument.)rdrrwrMr�r)r)r+rMNs	
zContext.canonicalcCst|dd�}|j||d�S)a�Compares values numerically.

        If the signs of the operands differ, a value representing each operand
        ('-1' if the operand is less than zero, '0' if the operand is zero or
        negative zero, or '1' if the operand is greater than zero) is used in
        place of that operand for the comparison instead of the actual
        operand.

        The comparison is then effected by subtracting the second operand from
        the first and then returning a value according to the result of the
        subtraction: '-1' if the result is less than zero, '0' if the result is
        zero or negative zero, or '1' if the result is greater than zero.

        >>> ExtendedContext.compare(Decimal('2.1'), Decimal('3'))
        Decimal('-1')
        >>> ExtendedContext.compare(Decimal('2.1'), Decimal('2.1'))
        Decimal('0')
        >>> ExtendedContext.compare(Decimal('2.1'), Decimal('2.10'))
        Decimal('0')
        >>> ExtendedContext.compare(Decimal('3'), Decimal('2.1'))
        Decimal('1')
        >>> ExtendedContext.compare(Decimal('2.1'), Decimal('-3'))
        Decimal('1')
        >>> ExtendedContext.compare(Decimal('-3'), Decimal('2.1'))
        Decimal('-1')
        >>> ExtendedContext.compare(1, 2)
        Decimal('-1')
        >>> ExtendedContext.compare(Decimal(1), 2)
        Decimal('-1')
        >>> ExtendedContext.compare(1, Decimal(2))
        Decimal('-1')
        Tr�rL)r�r��r0r-rsr)r)r+r�[s!zContext.comparecCst|dd�}|j||d�S)aCompares the values of the two operands numerically.

        It's pretty much like compare(), but all NaNs signal, with signaling
        NaNs taking precedence over quiet NaNs.

        >>> c = ExtendedContext
        >>> c.compare_signal(Decimal('2.1'), Decimal('3'))
        Decimal('-1')
        >>> c.compare_signal(Decimal('2.1'), Decimal('2.1'))
        Decimal('0')
        >>> c.flags[InvalidOperation] = 0
        >>> print(c.flags[InvalidOperation])
        0
        >>> c.compare_signal(Decimal('NaN'), Decimal('2.1'))
        Decimal('NaN')
        >>> print(c.flags[InvalidOperation])
        1
        >>> c.flags[InvalidOperation] = 0
        >>> print(c.flags[InvalidOperation])
        0
        >>> c.compare_signal(Decimal('sNaN'), Decimal('2.1'))
        Decimal('NaN')
        >>> print(c.flags[InvalidOperation])
        1
        >>> c.compare_signal(-1, 2)
        Decimal('-1')
        >>> c.compare_signal(Decimal(-1), 2)
        Decimal('-1')
        >>> c.compare_signal(-1, Decimal(2))
        Decimal('-1')
        Tr�rL)r�rNr�r)r)r+rNs zContext.compare_signalcCst|dd�}|�|�S)a+Compares two operands using their abstract representation.

        This is not like the standard compare, which use their numerical
        value. Note that a total ordering is defined for all possible abstract
        representations.

        >>> ExtendedContext.compare_total(Decimal('12.73'), Decimal('127.9'))
        Decimal('-1')
        >>> ExtendedContext.compare_total(Decimal('-127'),  Decimal('12'))
        Decimal('-1')
        >>> ExtendedContext.compare_total(Decimal('12.30'), Decimal('12.3'))
        Decimal('-1')
        >>> ExtendedContext.compare_total(Decimal('12.30'), Decimal('12.30'))
        Decimal('0')
        >>> ExtendedContext.compare_total(Decimal('12.3'),  Decimal('12.300'))
        Decimal('1')
        >>> ExtendedContext.compare_total(Decimal('12.3'),  Decimal('NaN'))
        Decimal('-1')
        >>> ExtendedContext.compare_total(1, 2)
        Decimal('-1')
        >>> ExtendedContext.compare_total(Decimal(1), 2)
        Decimal('-1')
        >>> ExtendedContext.compare_total(1, Decimal(2))
        Decimal('-1')
        Tr�)r�rJr�r)r)r+rJ�szContext.compare_totalcCst|dd�}|�|�S)z�Compares two operands using their abstract representation ignoring sign.

        Like compare_total, but with operand's sign ignored and assumed to be 0.
        Tr�)r�rRr�r)r)r+rR�szContext.compare_total_magcCst|dd�}|��S)aReturns a copy of the operand with the sign set to 0.

        >>> ExtendedContext.copy_abs(Decimal('2.1'))
        Decimal('2.1')
        >>> ExtendedContext.copy_abs(Decimal('-100'))
        Decimal('100')
        >>> ExtendedContext.copy_abs(-1)
        Decimal('1')
        Tr�)r�r�r�r)r)r+r��s
zContext.copy_abscCst|dd�}t|�S)aReturns a copy of the decimal object.

        >>> ExtendedContext.copy_decimal(Decimal('2.1'))
        Decimal('2.1')
        >>> ExtendedContext.copy_decimal(Decimal('-1.00'))
        Decimal('-1.00')
        >>> ExtendedContext.copy_decimal(1)
        Decimal('1')
        Tr�)r�rr�r)r)r+�copy_decimal�s
zContext.copy_decimalcCst|dd�}|��S)a(Returns a copy of the operand with the sign inverted.

        >>> ExtendedContext.copy_negate(Decimal('101.5'))
        Decimal('-101.5')
        >>> ExtendedContext.copy_negate(Decimal('-101.5'))
        Decimal('101.5')
        >>> ExtendedContext.copy_negate(1)
        Decimal('-1')
        Tr�)r�r�r�r)r)r+r��s
zContext.copy_negatecCst|dd�}|�|�S)aCopies the second operand's sign to the first one.

        In detail, it returns a copy of the first operand with the sign
        equal to the sign of the second operand.

        >>> ExtendedContext.copy_sign(Decimal( '1.50'), Decimal('7.33'))
        Decimal('1.50')
        >>> ExtendedContext.copy_sign(Decimal('-1.50'), Decimal('7.33'))
        Decimal('1.50')
        >>> ExtendedContext.copy_sign(Decimal( '1.50'), Decimal('-7.33'))
        Decimal('-1.50')
        >>> ExtendedContext.copy_sign(Decimal('-1.50'), Decimal('-7.33'))
        Decimal('-1.50')
        >>> ExtendedContext.copy_sign(1, -2)
        Decimal('-1')
        >>> ExtendedContext.copy_sign(Decimal(1), -2)
        Decimal('-1')
        >>> ExtendedContext.copy_sign(1, Decimal(-2))
        Decimal('-1')
        Tr�)r�rSr�r)r)r+rS�szContext.copy_signcCs8t|dd�}|j||d�}|tkr0td|��n|SdS)a�Decimal division in a specified context.

        >>> ExtendedContext.divide(Decimal('1'), Decimal('3'))
        Decimal('0.333333333')
        >>> ExtendedContext.divide(Decimal('2'), Decimal('3'))
        Decimal('0.666666667')
        >>> ExtendedContext.divide(Decimal('5'), Decimal('2'))
        Decimal('2.5')
        >>> ExtendedContext.divide(Decimal('1'), Decimal('10'))
        Decimal('0.1')
        >>> ExtendedContext.divide(Decimal('12'), Decimal('12'))
        Decimal('1')
        >>> ExtendedContext.divide(Decimal('8.00'), Decimal('2'))
        Decimal('4.00')
        >>> ExtendedContext.divide(Decimal('2.400'), Decimal('2.0'))
        Decimal('1.20')
        >>> ExtendedContext.divide(Decimal('1000'), Decimal('100'))
        Decimal('10')
        >>> ExtendedContext.divide(Decimal('1000'), Decimal('1'))
        Decimal('1000')
        >>> ExtendedContext.divide(Decimal('2.40E+6'), Decimal('2'))
        Decimal('1.20E+6')
        >>> ExtendedContext.divide(5, 5)
        Decimal('1')
        >>> ExtendedContext.divide(Decimal(5), 5)
        Decimal('1')
        >>> ExtendedContext.divide(5, Decimal(5))
        Decimal('1')
        Tr�rLr�N)r�r�r�rwr�r)r)r+�divides
zContext.dividecCs8t|dd�}|j||d�}|tkr0td|��n|SdS)a/Divides two numbers and returns the integer part of the result.

        >>> ExtendedContext.divide_int(Decimal('2'), Decimal('3'))
        Decimal('0')
        >>> ExtendedContext.divide_int(Decimal('10'), Decimal('3'))
        Decimal('3')
        >>> ExtendedContext.divide_int(Decimal('1'), Decimal('0.3'))
        Decimal('3')
        >>> ExtendedContext.divide_int(10, 3)
        Decimal('3')
        >>> ExtendedContext.divide_int(Decimal(10), 3)
        Decimal('3')
        >>> ExtendedContext.divide_int(10, Decimal(3))
        Decimal('3')
        Tr�rLr�N)r�r�r�rwr�r)r)r+�
divide_int+s
zContext.divide_intcCs8t|dd�}|j||d�}|tkr0td|��n|SdS)a�Return (a // b, a % b).

        >>> ExtendedContext.divmod(Decimal(8), Decimal(3))
        (Decimal('2'), Decimal('2'))
        >>> ExtendedContext.divmod(Decimal(8), Decimal(4))
        (Decimal('2'), Decimal('0'))
        >>> ExtendedContext.divmod(8, 4)
        (Decimal('2'), Decimal('0'))
        >>> ExtendedContext.divmod(Decimal(8), 4)
        (Decimal('2'), Decimal('0'))
        >>> ExtendedContext.divmod(8, Decimal(4))
        (Decimal('2'), Decimal('0'))
        Tr�rLr�N)r�r�r�rwr�r)r)r+r�Bs
zContext.divmodcCst|dd�}|j|d�S)a#Returns e ** a.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.exp(Decimal('-Infinity'))
        Decimal('0')
        >>> c.exp(Decimal('-1'))
        Decimal('0.367879441')
        >>> c.exp(Decimal('0'))
        Decimal('1')
        >>> c.exp(Decimal('1'))
        Decimal('2.71828183')
        >>> c.exp(Decimal('0.693147181'))
        Decimal('2.00000000')
        >>> c.exp(Decimal('+Infinity'))
        Decimal('Infinity')
        >>> c.exp(10)
        Decimal('22026.4658')
        Tr�rL)r�rWr�r)r)r+rWWszContext.expcCst|dd�}|j|||d�S)aReturns a multiplied by b, plus c.

        The first two operands are multiplied together, using multiply,
        the third operand is then added to the result of that
        multiplication, using add, all with only one final rounding.

        >>> ExtendedContext.fma(Decimal('3'), Decimal('5'), Decimal('7'))
        Decimal('22')
        >>> ExtendedContext.fma(Decimal('3'), Decimal('-5'), Decimal('7'))
        Decimal('-8')
        >>> ExtendedContext.fma(Decimal('888565290'), Decimal('1557.96930'), Decimal('-86087.7578'))
        Decimal('1.38435736E+12')
        >>> ExtendedContext.fma(1, 3, 4)
        Decimal('7')
        >>> ExtendedContext.fma(1, Decimal(3), 4)
        Decimal('7')
        >>> ExtendedContext.fma(1, 3, Decimal(4))
        Decimal('7')
        Tr�rL)r�r)r0r-rsrFr)r)r+roszContext.fmacCst|t�std��|��S)aReturn True if the operand is canonical; otherwise return False.

        Currently, the encoding of a Decimal instance is always
        canonical, so this method returns True for any Decimal.

        >>> ExtendedContext.is_canonical(Decimal('2.50'))
        True
        z/is_canonical requires a Decimal as an argument.)rdrrwrVr�r)r)r+rV�s	
zContext.is_canonicalcCst|dd�}|��S)a,Return True if the operand is finite; otherwise return False.

        A Decimal instance is considered finite if it is neither
        infinite nor a NaN.

        >>> ExtendedContext.is_finite(Decimal('2.50'))
        True
        >>> ExtendedContext.is_finite(Decimal('-0.3'))
        True
        >>> ExtendedContext.is_finite(Decimal('0'))
        True
        >>> ExtendedContext.is_finite(Decimal('Inf'))
        False
        >>> ExtendedContext.is_finite(Decimal('NaN'))
        False
        >>> ExtendedContext.is_finite(1)
        True
        Tr�)r�rWr�r)r)r+rW�szContext.is_finitecCst|dd�}|��S)aUReturn True if the operand is infinite; otherwise return False.

        >>> ExtendedContext.is_infinite(Decimal('2.50'))
        False
        >>> ExtendedContext.is_infinite(Decimal('-Inf'))
        True
        >>> ExtendedContext.is_infinite(Decimal('NaN'))
        False
        >>> ExtendedContext.is_infinite(1)
        False
        Tr�)r�r=r�r)r)r+r=�szContext.is_infinitecCst|dd�}|��S)aOReturn True if the operand is a qNaN or sNaN;
        otherwise return False.

        >>> ExtendedContext.is_nan(Decimal('2.50'))
        False
        >>> ExtendedContext.is_nan(Decimal('NaN'))
        True
        >>> ExtendedContext.is_nan(Decimal('-sNaN'))
        True
        >>> ExtendedContext.is_nan(1)
        False
        Tr�)r�r�r�r)r)r+r��s
zContext.is_nancCst|dd�}|j|d�S)a�Return True if the operand is a normal number;
        otherwise return False.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.is_normal(Decimal('2.50'))
        True
        >>> c.is_normal(Decimal('0.1E-999'))
        False
        >>> c.is_normal(Decimal('0.00'))
        False
        >>> c.is_normal(Decimal('-Inf'))
        False
        >>> c.is_normal(Decimal('NaN'))
        False
        >>> c.is_normal(1)
        True
        Tr�rL)r�rYr�r)r)r+rY�szContext.is_normalcCst|dd�}|��S)aHReturn True if the operand is a quiet NaN; otherwise return False.

        >>> ExtendedContext.is_qnan(Decimal('2.50'))
        False
        >>> ExtendedContext.is_qnan(Decimal('NaN'))
        True
        >>> ExtendedContext.is_qnan(Decimal('sNaN'))
        False
        >>> ExtendedContext.is_qnan(1)
        False
        Tr�)r�r�r�r)r)r+r��szContext.is_qnancCst|dd�}|��S)a�Return True if the operand is negative; otherwise return False.

        >>> ExtendedContext.is_signed(Decimal('2.50'))
        False
        >>> ExtendedContext.is_signed(Decimal('-12'))
        True
        >>> ExtendedContext.is_signed(Decimal('-0'))
        True
        >>> ExtendedContext.is_signed(8)
        False
        >>> ExtendedContext.is_signed(-8)
        True
        Tr�)r�rZr�r)r)r+rZ�szContext.is_signedcCst|dd�}|��S)aTReturn True if the operand is a signaling NaN;
        otherwise return False.

        >>> ExtendedContext.is_snan(Decimal('2.50'))
        False
        >>> ExtendedContext.is_snan(Decimal('NaN'))
        False
        >>> ExtendedContext.is_snan(Decimal('sNaN'))
        True
        >>> ExtendedContext.is_snan(1)
        False
        Tr�)r�r�r�r)r)r+r��s
zContext.is_snancCst|dd�}|j|d�S)a�Return True if the operand is subnormal; otherwise return False.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.is_subnormal(Decimal('2.50'))
        False
        >>> c.is_subnormal(Decimal('0.1E-999'))
        True
        >>> c.is_subnormal(Decimal('0.00'))
        False
        >>> c.is_subnormal(Decimal('-Inf'))
        False
        >>> c.is_subnormal(Decimal('NaN'))
        False
        >>> c.is_subnormal(1)
        False
        Tr�rL)r�r[r�r)r)r+r[szContext.is_subnormalcCst|dd�}|��S)auReturn True if the operand is a zero; otherwise return False.

        >>> ExtendedContext.is_zero(Decimal('0'))
        True
        >>> ExtendedContext.is_zero(Decimal('2.50'))
        False
        >>> ExtendedContext.is_zero(Decimal('-0E+2'))
        True
        >>> ExtendedContext.is_zero(1)
        False
        >>> ExtendedContext.is_zero(0)
        True
        Tr�)r�r\r�r)r)r+r\%szContext.is_zerocCst|dd�}|j|d�S)a�Returns the natural (base e) logarithm of the operand.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.ln(Decimal('0'))
        Decimal('-Infinity')
        >>> c.ln(Decimal('1.000'))
        Decimal('0')
        >>> c.ln(Decimal('2.71828183'))
        Decimal('1.00000000')
        >>> c.ln(Decimal('10'))
        Decimal('2.30258509')
        >>> c.ln(Decimal('+Infinity'))
        Decimal('Infinity')
        >>> c.ln(1)
        Decimal('0')
        Tr�rL)r�rfr�r)r)r+rf6sz
Context.lncCst|dd�}|j|d�S)a�Returns the base 10 logarithm of the operand.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.log10(Decimal('0'))
        Decimal('-Infinity')
        >>> c.log10(Decimal('0.001'))
        Decimal('-3')
        >>> c.log10(Decimal('1.000'))
        Decimal('0')
        >>> c.log10(Decimal('2'))
        Decimal('0.301029996')
        >>> c.log10(Decimal('10'))
        Decimal('1')
        >>> c.log10(Decimal('70'))
        Decimal('1.84509804')
        >>> c.log10(Decimal('+Infinity'))
        Decimal('Infinity')
        >>> c.log10(0)
        Decimal('-Infinity')
        >>> c.log10(1)
        Decimal('0')
        Tr�rL)r�rir�r)r)r+riLsz
Context.log10cCst|dd�}|j|d�S)a4 Returns the exponent of the magnitude of the operand's MSD.

        The result is the integer which is the exponent of the magnitude
        of the most significant digit of the operand (as though the
        operand were truncated to a single digit while maintaining the
        value of that digit and without limiting the resulting exponent).

        >>> ExtendedContext.logb(Decimal('250'))
        Decimal('2')
        >>> ExtendedContext.logb(Decimal('2.50'))
        Decimal('0')
        >>> ExtendedContext.logb(Decimal('0.03'))
        Decimal('-2')
        >>> ExtendedContext.logb(Decimal('0'))
        Decimal('-Infinity')
        >>> ExtendedContext.logb(1)
        Decimal('0')
        >>> ExtendedContext.logb(10)
        Decimal('1')
        >>> ExtendedContext.logb(100)
        Decimal('2')
        Tr�rL)r�rjr�r)r)r+rjhszContext.logbcCst|dd�}|j||d�S)a�Applies the logical operation 'and' between each operand's digits.

        The operands must be both logical numbers.

        >>> ExtendedContext.logical_and(Decimal('0'), Decimal('0'))
        Decimal('0')
        >>> ExtendedContext.logical_and(Decimal('0'), Decimal('1'))
        Decimal('0')
        >>> ExtendedContext.logical_and(Decimal('1'), Decimal('0'))
        Decimal('0')
        >>> ExtendedContext.logical_and(Decimal('1'), Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.logical_and(Decimal('1100'), Decimal('1010'))
        Decimal('1000')
        >>> ExtendedContext.logical_and(Decimal('1111'), Decimal('10'))
        Decimal('10')
        >>> ExtendedContext.logical_and(110, 1101)
        Decimal('100')
        >>> ExtendedContext.logical_and(Decimal(110), 1101)
        Decimal('100')
        >>> ExtendedContext.logical_and(110, Decimal(1101))
        Decimal('100')
        Tr�rL)r�rxr�r)r)r+rx�szContext.logical_andcCst|dd�}|j|d�S)aInvert all the digits in the operand.

        The operand must be a logical number.

        >>> ExtendedContext.logical_invert(Decimal('0'))
        Decimal('111111111')
        >>> ExtendedContext.logical_invert(Decimal('1'))
        Decimal('111111110')
        >>> ExtendedContext.logical_invert(Decimal('111111111'))
        Decimal('0')
        >>> ExtendedContext.logical_invert(Decimal('101010101'))
        Decimal('10101010')
        >>> ExtendedContext.logical_invert(1101)
        Decimal('111110010')
        Tr�rL)r�rzr�r)r)r+rz�szContext.logical_invertcCst|dd�}|j||d�S)a�Applies the logical operation 'or' between each operand's digits.

        The operands must be both logical numbers.

        >>> ExtendedContext.logical_or(Decimal('0'), Decimal('0'))
        Decimal('0')
        >>> ExtendedContext.logical_or(Decimal('0'), Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.logical_or(Decimal('1'), Decimal('0'))
        Decimal('1')
        >>> ExtendedContext.logical_or(Decimal('1'), Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.logical_or(Decimal('1100'), Decimal('1010'))
        Decimal('1110')
        >>> ExtendedContext.logical_or(Decimal('1110'), Decimal('10'))
        Decimal('1110')
        >>> ExtendedContext.logical_or(110, 1101)
        Decimal('1111')
        >>> ExtendedContext.logical_or(Decimal(110), 1101)
        Decimal('1111')
        >>> ExtendedContext.logical_or(110, Decimal(1101))
        Decimal('1111')
        Tr�rL)r�r{r�r)r)r+r{�szContext.logical_orcCst|dd�}|j||d�S)a�Applies the logical operation 'xor' between each operand's digits.

        The operands must be both logical numbers.

        >>> ExtendedContext.logical_xor(Decimal('0'), Decimal('0'))
        Decimal('0')
        >>> ExtendedContext.logical_xor(Decimal('0'), Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.logical_xor(Decimal('1'), Decimal('0'))
        Decimal('1')
        >>> ExtendedContext.logical_xor(Decimal('1'), Decimal('1'))
        Decimal('0')
        >>> ExtendedContext.logical_xor(Decimal('1100'), Decimal('1010'))
        Decimal('110')
        >>> ExtendedContext.logical_xor(Decimal('1111'), Decimal('10'))
        Decimal('1101')
        >>> ExtendedContext.logical_xor(110, 1101)
        Decimal('1011')
        >>> ExtendedContext.logical_xor(Decimal(110), 1101)
        Decimal('1011')
        >>> ExtendedContext.logical_xor(110, Decimal(1101))
        Decimal('1011')
        Tr�rL)r�ryr�r)r)r+ry�szContext.logical_xorcCst|dd�}|j||d�S)a�max compares two values numerically and returns the maximum.

        If either operand is a NaN then the general rules apply.
        Otherwise, the operands are compared as though by the compare
        operation.  If they are numerically equal then the left-hand operand
        is chosen as the result.  Otherwise the maximum (closer to positive
        infinity) of the two operands is chosen as the result.

        >>> ExtendedContext.max(Decimal('3'), Decimal('2'))
        Decimal('3')
        >>> ExtendedContext.max(Decimal('-10'), Decimal('3'))
        Decimal('3')
        >>> ExtendedContext.max(Decimal('1.0'), Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.max(Decimal('7'), Decimal('NaN'))
        Decimal('7')
        >>> ExtendedContext.max(1, 2)
        Decimal('2')
        >>> ExtendedContext.max(Decimal(1), 2)
        Decimal('2')
        >>> ExtendedContext.max(1, Decimal(2))
        Decimal('2')
        Tr�rL)r�r�r�r)r)r+r��szContext.maxcCst|dd�}|j||d�S)a�Compares the values numerically with their sign ignored.

        >>> ExtendedContext.max_mag(Decimal('7'), Decimal('NaN'))
        Decimal('7')
        >>> ExtendedContext.max_mag(Decimal('7'), Decimal('-10'))
        Decimal('-10')
        >>> ExtendedContext.max_mag(1, -2)
        Decimal('-2')
        >>> ExtendedContext.max_mag(Decimal(1), -2)
        Decimal('-2')
        >>> ExtendedContext.max_mag(1, Decimal(-2))
        Decimal('-2')
        Tr�rL)r�r~r�r)r)r+r~szContext.max_magcCst|dd�}|j||d�S)a�min compares two values numerically and returns the minimum.

        If either operand is a NaN then the general rules apply.
        Otherwise, the operands are compared as though by the compare
        operation.  If they are numerically equal then the left-hand operand
        is chosen as the result.  Otherwise the minimum (closer to negative
        infinity) of the two operands is chosen as the result.

        >>> ExtendedContext.min(Decimal('3'), Decimal('2'))
        Decimal('2')
        >>> ExtendedContext.min(Decimal('-10'), Decimal('3'))
        Decimal('-10')
        >>> ExtendedContext.min(Decimal('1.0'), Decimal('1'))
        Decimal('1.0')
        >>> ExtendedContext.min(Decimal('7'), Decimal('NaN'))
        Decimal('7')
        >>> ExtendedContext.min(1, 2)
        Decimal('1')
        >>> ExtendedContext.min(Decimal(1), 2)
        Decimal('1')
        >>> ExtendedContext.min(1, Decimal(29))
        Decimal('1')
        Tr�rL)r�r�r�r)r)r+r�szContext.mincCst|dd�}|j||d�S)a�Compares the values numerically with their sign ignored.

        >>> ExtendedContext.min_mag(Decimal('3'), Decimal('-2'))
        Decimal('-2')
        >>> ExtendedContext.min_mag(Decimal('-3'), Decimal('NaN'))
        Decimal('-3')
        >>> ExtendedContext.min_mag(1, -2)
        Decimal('1')
        >>> ExtendedContext.min_mag(Decimal(1), -2)
        Decimal('1')
        >>> ExtendedContext.min_mag(1, Decimal(-2))
        Decimal('1')
        Tr�rL)r�rr�r)r)r+r-szContext.min_magcCst|dd�}|j|d�S)a�Minus corresponds to unary prefix minus in Python.

        The operation is evaluated using the same rules as subtract; the
        operation minus(a) is calculated as subtract('0', a) where the '0'
        has the same exponent as the operand.

        >>> ExtendedContext.minus(Decimal('1.3'))
        Decimal('-1.3')
        >>> ExtendedContext.minus(Decimal('-1.3'))
        Decimal('1.3')
        >>> ExtendedContext.minus(1)
        Decimal('-1')
        Tr�rL)r�r�r�r)r)r+�minus>sz
Context.minuscCs8t|dd�}|j||d�}|tkr0td|��n|SdS)a�multiply multiplies two operands.

        If either operand is a special value then the general rules apply.
        Otherwise, the operands are multiplied together
        ('long multiplication'), resulting in a number which may be as long as
        the sum of the lengths of the two operands.

        >>> ExtendedContext.multiply(Decimal('1.20'), Decimal('3'))
        Decimal('3.60')
        >>> ExtendedContext.multiply(Decimal('7'), Decimal('3'))
        Decimal('21')
        >>> ExtendedContext.multiply(Decimal('0.9'), Decimal('0.8'))
        Decimal('0.72')
        >>> ExtendedContext.multiply(Decimal('0.9'), Decimal('-0'))
        Decimal('-0.0')
        >>> ExtendedContext.multiply(Decimal('654321'), Decimal('654321'))
        Decimal('4.28135971E+11')
        >>> ExtendedContext.multiply(7, 7)
        Decimal('49')
        >>> ExtendedContext.multiply(Decimal(7), 7)
        Decimal('49')
        >>> ExtendedContext.multiply(7, Decimal(7))
        Decimal('49')
        Tr�rLr�N)r�r�r�rwr�r)r)r+�multiplyOs
zContext.multiplycCst|dd�}|j|d�S)a"Returns the largest representable number smaller than a.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> ExtendedContext.next_minus(Decimal('1'))
        Decimal('0.999999999')
        >>> c.next_minus(Decimal('1E-1007'))
        Decimal('0E-1007')
        >>> ExtendedContext.next_minus(Decimal('-1.00000003'))
        Decimal('-1.00000004')
        >>> c.next_minus(Decimal('Infinity'))
        Decimal('9.99999999E+999')
        >>> c.next_minus(1)
        Decimal('0.999999999')
        Tr�rL)r�r�r�r)r)r+r�oszContext.next_minuscCst|dd�}|j|d�S)aReturns the smallest representable number larger than a.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> ExtendedContext.next_plus(Decimal('1'))
        Decimal('1.00000001')
        >>> c.next_plus(Decimal('-1E-1007'))
        Decimal('-0E-1007')
        >>> ExtendedContext.next_plus(Decimal('-1.00000003'))
        Decimal('-1.00000002')
        >>> c.next_plus(Decimal('-Infinity'))
        Decimal('-9.99999999E+999')
        >>> c.next_plus(1)
        Decimal('1.00000001')
        Tr�rL)r�r�r�r)r)r+r��szContext.next_pluscCst|dd�}|j||d�S)a�Returns the number closest to a, in direction towards b.

        The result is the closest representable number from the first
        operand (but not the first operand) that is in the direction
        towards the second operand, unless the operands have the same
        value.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.next_toward(Decimal('1'), Decimal('2'))
        Decimal('1.00000001')
        >>> c.next_toward(Decimal('-1E-1007'), Decimal('1'))
        Decimal('-0E-1007')
        >>> c.next_toward(Decimal('-1.00000003'), Decimal('0'))
        Decimal('-1.00000002')
        >>> c.next_toward(Decimal('1'), Decimal('0'))
        Decimal('0.999999999')
        >>> c.next_toward(Decimal('1E-1007'), Decimal('-100'))
        Decimal('0E-1007')
        >>> c.next_toward(Decimal('-1.00000003'), Decimal('-10'))
        Decimal('-1.00000004')
        >>> c.next_toward(Decimal('0.00'), Decimal('-0.0000'))
        Decimal('-0.00')
        >>> c.next_toward(0, 1)
        Decimal('1E-1007')
        >>> c.next_toward(Decimal(0), 1)
        Decimal('1E-1007')
        >>> c.next_toward(0, Decimal(1))
        Decimal('1E-1007')
        Tr�rL)r�r�r�r)r)r+r��s zContext.next_towardcCst|dd�}|j|d�S)a�normalize reduces an operand to its simplest form.

        Essentially a plus operation with all trailing zeros removed from the
        result.

        >>> ExtendedContext.normalize(Decimal('2.1'))
        Decimal('2.1')
        >>> ExtendedContext.normalize(Decimal('-2.0'))
        Decimal('-2')
        >>> ExtendedContext.normalize(Decimal('1.200'))
        Decimal('1.2')
        >>> ExtendedContext.normalize(Decimal('-120'))
        Decimal('-1.2E+2')
        >>> ExtendedContext.normalize(Decimal('120.00'))
        Decimal('1.2E+2')
        >>> ExtendedContext.normalize(Decimal('0.00'))
        Decimal('0')
        >>> ExtendedContext.normalize(6)
        Decimal('6')
        Tr�rL)r�r;r�r)r)r+r;�szContext.normalizecCst|dd�}|j|d�S)a�Returns an indication of the class of the operand.

        The class is one of the following strings:
          -sNaN
          -NaN
          -Infinity
          -Normal
          -Subnormal
          -Zero
          +Zero
          +Subnormal
          +Normal
          +Infinity

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.number_class(Decimal('Infinity'))
        '+Infinity'
        >>> c.number_class(Decimal('1E-10'))
        '+Normal'
        >>> c.number_class(Decimal('2.50'))
        '+Normal'
        >>> c.number_class(Decimal('0.1E-999'))
        '+Subnormal'
        >>> c.number_class(Decimal('0'))
        '+Zero'
        >>> c.number_class(Decimal('-0'))
        '-Zero'
        >>> c.number_class(Decimal('-0.1E-999'))
        '-Subnormal'
        >>> c.number_class(Decimal('-1E-10'))
        '-Normal'
        >>> c.number_class(Decimal('-2.50'))
        '-Normal'
        >>> c.number_class(Decimal('-Infinity'))
        '-Infinity'
        >>> c.number_class(Decimal('NaN'))
        'NaN'
        >>> c.number_class(Decimal('-NaN'))
        'NaN'
        >>> c.number_class(Decimal('sNaN'))
        'sNaN'
        >>> c.number_class(123)
        '+Normal'
        Tr�rL)r�r�r�r)r)r+r��s/zContext.number_classcCst|dd�}|j|d�S)a�Plus corresponds to unary prefix plus in Python.

        The operation is evaluated using the same rules as add; the
        operation plus(a) is calculated as add('0', a) where the '0'
        has the same exponent as the operand.

        >>> ExtendedContext.plus(Decimal('1.3'))
        Decimal('1.3')
        >>> ExtendedContext.plus(Decimal('-1.3'))
        Decimal('-1.3')
        >>> ExtendedContext.plus(-1)
        Decimal('-1')
        Tr�rL)r�r�r�r)r)r+�plusszContext.pluscCs:t|dd�}|j|||d�}|tkr2td|��n|SdS)aRaises a to the power of b, to modulo if given.

        With two arguments, compute a**b.  If a is negative then b
        must be integral.  The result will be inexact unless b is
        integral and the result is finite and can be expressed exactly
        in 'precision' digits.

        With three arguments, compute (a**b) % modulo.  For the
        three argument form, the following restrictions on the
        arguments hold:

         - all three arguments must be integral
         - b must be nonnegative
         - at least one of a or b must be nonzero
         - modulo must be nonzero and have at most 'precision' digits

        The result of pow(a, b, modulo) is identical to the result
        that would be obtained by computing (a**b) % modulo with
        unbounded precision, but is computed more efficiently.  It is
        always exact.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.power(Decimal('2'), Decimal('3'))
        Decimal('8')
        >>> c.power(Decimal('-2'), Decimal('3'))
        Decimal('-8')
        >>> c.power(Decimal('2'), Decimal('-3'))
        Decimal('0.125')
        >>> c.power(Decimal('1.7'), Decimal('8'))
        Decimal('69.7575744')
        >>> c.power(Decimal('10'), Decimal('0.301029996'))
        Decimal('2.00000000')
        >>> c.power(Decimal('Infinity'), Decimal('-1'))
        Decimal('0')
        >>> c.power(Decimal('Infinity'), Decimal('0'))
        Decimal('1')
        >>> c.power(Decimal('Infinity'), Decimal('1'))
        Decimal('Infinity')
        >>> c.power(Decimal('-Infinity'), Decimal('-1'))
        Decimal('-0')
        >>> c.power(Decimal('-Infinity'), Decimal('0'))
        Decimal('1')
        >>> c.power(Decimal('-Infinity'), Decimal('1'))
        Decimal('-Infinity')
        >>> c.power(Decimal('-Infinity'), Decimal('2'))
        Decimal('Infinity')
        >>> c.power(Decimal('0'), Decimal('0'))
        Decimal('NaN')

        >>> c.power(Decimal('3'), Decimal('7'), Decimal('16'))
        Decimal('11')
        >>> c.power(Decimal('-3'), Decimal('7'), Decimal('16'))
        Decimal('-11')
        >>> c.power(Decimal('-3'), Decimal('8'), Decimal('16'))
        Decimal('1')
        >>> c.power(Decimal('3'), Decimal('7'), Decimal('-16'))
        Decimal('11')
        >>> c.power(Decimal('23E12345'), Decimal('67E189'), Decimal('123456789'))
        Decimal('11729830')
        >>> c.power(Decimal('-0'), Decimal('17'), Decimal('1729'))
        Decimal('-0')
        >>> c.power(Decimal('-23'), Decimal('0'), Decimal('65537'))
        Decimal('1')
        >>> ExtendedContext.power(7, 7)
        Decimal('823543')
        >>> ExtendedContext.power(Decimal(7), 7)
        Decimal('823543')
        >>> ExtendedContext.power(7, Decimal(7), 2)
        Decimal('1')
        Tr�rLr�N)r�r7r�rw)r0r-rsrr�r)r)r+�powers
Iz
Context.powercCst|dd�}|j||d�S)a
Returns a value equal to 'a' (rounded), having the exponent of 'b'.

        The coefficient of the result is derived from that of the left-hand
        operand.  It may be rounded using the current rounding setting (if the
        exponent is being increased), multiplied by a positive power of ten (if
        the exponent is being decreased), or is unchanged (if the exponent is
        already equal to that of the right-hand operand).

        Unlike other operations, if the length of the coefficient after the
        quantize operation would be greater than precision then an Invalid
        operation condition is raised.  This guarantees that, unless there is
        an error condition, the exponent of the result of a quantize is always
        equal to that of the right-hand operand.

        Also unlike other operations, quantize will never raise Underflow, even
        if the result is subnormal and inexact.

        >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('0.001'))
        Decimal('2.170')
        >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('0.01'))
        Decimal('2.17')
        >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('0.1'))
        Decimal('2.2')
        >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('1e+0'))
        Decimal('2')
        >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('1e+1'))
        Decimal('0E+1')
        >>> ExtendedContext.quantize(Decimal('-Inf'), Decimal('Infinity'))
        Decimal('-Infinity')
        >>> ExtendedContext.quantize(Decimal('2'), Decimal('Infinity'))
        Decimal('NaN')
        >>> ExtendedContext.quantize(Decimal('-0.1'), Decimal('1'))
        Decimal('-0')
        >>> ExtendedContext.quantize(Decimal('-0'), Decimal('1e+5'))
        Decimal('-0E+5')
        >>> ExtendedContext.quantize(Decimal('+35236450.6'), Decimal('1e-2'))
        Decimal('NaN')
        >>> ExtendedContext.quantize(Decimal('-35236450.6'), Decimal('1e-2'))
        Decimal('NaN')
        >>> ExtendedContext.quantize(Decimal('217'), Decimal('1e-1'))
        Decimal('217.0')
        >>> ExtendedContext.quantize(Decimal('217'), Decimal('1e-0'))
        Decimal('217')
        >>> ExtendedContext.quantize(Decimal('217'), Decimal('1e+1'))
        Decimal('2.2E+2')
        >>> ExtendedContext.quantize(Decimal('217'), Decimal('1e+2'))
        Decimal('2E+2')
        >>> ExtendedContext.quantize(1, 2)
        Decimal('1')
        >>> ExtendedContext.quantize(Decimal(1), 2)
        Decimal('1')
        >>> ExtendedContext.quantize(1, Decimal(2))
        Decimal('1')
        Tr�rL)r�rr�r)r)r+res7zContext.quantizecCstd�S)zkJust returns 10, as this is Decimal, :)

        >>> ExtendedContext.radix()
        Decimal('10')
        r�r�r�r)r)r+r��sz
Context.radixcCs8t|dd�}|j||d�}|tkr0td|��n|SdS)aReturns the remainder from integer division.

        The result is the residue of the dividend after the operation of
        calculating integer division as described for divide-integer, rounded
        to precision digits if necessary.  The sign of the result, if
        non-zero, is the same as that of the original dividend.

        This operation will fail under the same conditions as integer division
        (that is, if integer division on the same two operands would fail, the
        remainder cannot be calculated).

        >>> ExtendedContext.remainder(Decimal('2.1'), Decimal('3'))
        Decimal('2.1')
        >>> ExtendedContext.remainder(Decimal('10'), Decimal('3'))
        Decimal('1')
        >>> ExtendedContext.remainder(Decimal('-10'), Decimal('3'))
        Decimal('-1')
        >>> ExtendedContext.remainder(Decimal('10.2'), Decimal('1'))
        Decimal('0.2')
        >>> ExtendedContext.remainder(Decimal('10'), Decimal('0.3'))
        Decimal('0.1')
        >>> ExtendedContext.remainder(Decimal('3.6'), Decimal('1.3'))
        Decimal('1.0')
        >>> ExtendedContext.remainder(22, 6)
        Decimal('4')
        >>> ExtendedContext.remainder(Decimal(22), 6)
        Decimal('4')
        >>> ExtendedContext.remainder(22, Decimal(6))
        Decimal('4')
        Tr�rLr�N)r�r�r�rwr�r)r)r+r��s
zContext.remaindercCst|dd�}|j||d�S)aGReturns to be "a - b * n", where n is the integer nearest the exact
        value of "x / b" (if two integers are equally near then the even one
        is chosen).  If the result is equal to 0 then its sign will be the
        sign of a.

        This operation will fail under the same conditions as integer division
        (that is, if integer division on the same two operands would fail, the
        remainder cannot be calculated).

        >>> ExtendedContext.remainder_near(Decimal('2.1'), Decimal('3'))
        Decimal('-0.9')
        >>> ExtendedContext.remainder_near(Decimal('10'), Decimal('6'))
        Decimal('-2')
        >>> ExtendedContext.remainder_near(Decimal('10'), Decimal('3'))
        Decimal('1')
        >>> ExtendedContext.remainder_near(Decimal('-10'), Decimal('3'))
        Decimal('-1')
        >>> ExtendedContext.remainder_near(Decimal('10.2'), Decimal('1'))
        Decimal('0.2')
        >>> ExtendedContext.remainder_near(Decimal('10'), Decimal('0.3'))
        Decimal('0.1')
        >>> ExtendedContext.remainder_near(Decimal('3.6'), Decimal('1.3'))
        Decimal('-0.3')
        >>> ExtendedContext.remainder_near(3, 11)
        Decimal('3')
        >>> ExtendedContext.remainder_near(Decimal(3), 11)
        Decimal('3')
        >>> ExtendedContext.remainder_near(3, Decimal(11))
        Decimal('3')
        Tr�rL)r�r�r�r)r)r+r��szContext.remainder_nearcCst|dd�}|j||d�S)aNReturns a rotated copy of a, b times.

        The coefficient of the result is a rotated copy of the digits in
        the coefficient of the first operand.  The number of places of
        rotation is taken from the absolute value of the second operand,
        with the rotation being to the left if the second operand is
        positive or to the right otherwise.

        >>> ExtendedContext.rotate(Decimal('34'), Decimal('8'))
        Decimal('400000003')
        >>> ExtendedContext.rotate(Decimal('12'), Decimal('9'))
        Decimal('12')
        >>> ExtendedContext.rotate(Decimal('123456789'), Decimal('-2'))
        Decimal('891234567')
        >>> ExtendedContext.rotate(Decimal('123456789'), Decimal('0'))
        Decimal('123456789')
        >>> ExtendedContext.rotate(Decimal('123456789'), Decimal('+2'))
        Decimal('345678912')
        >>> ExtendedContext.rotate(1333333, 1)
        Decimal('13333330')
        >>> ExtendedContext.rotate(Decimal(1333333), 1)
        Decimal('13333330')
        >>> ExtendedContext.rotate(1333333, Decimal(1))
        Decimal('13333330')
        Tr�rL)r�r�r�r)r)r+r��szContext.rotatecCst|dd�}|�|�S)a�Returns True if the two operands have the same exponent.

        The result is never affected by either the sign or the coefficient of
        either operand.

        >>> ExtendedContext.same_quantum(Decimal('2.17'), Decimal('0.001'))
        False
        >>> ExtendedContext.same_quantum(Decimal('2.17'), Decimal('0.01'))
        True
        >>> ExtendedContext.same_quantum(Decimal('2.17'), Decimal('1'))
        False
        >>> ExtendedContext.same_quantum(Decimal('Inf'), Decimal('-Inf'))
        True
        >>> ExtendedContext.same_quantum(10000, -1)
        True
        >>> ExtendedContext.same_quantum(Decimal(10000), -1)
        True
        >>> ExtendedContext.same_quantum(10000, Decimal(-1))
        True
        Tr�)r�r>r�r)r)r+r>szContext.same_quantumcCst|dd�}|j||d�S)a3Returns the first operand after adding the second value its exp.

        >>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('-2'))
        Decimal('0.0750')
        >>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('0'))
        Decimal('7.50')
        >>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('3'))
        Decimal('7.50E+3')
        >>> ExtendedContext.scaleb(1, 4)
        Decimal('1E+4')
        >>> ExtendedContext.scaleb(Decimal(1), 4)
        Decimal('1E+4')
        >>> ExtendedContext.scaleb(1, Decimal(4))
        Decimal('1E+4')
        Tr�rL)r�r�r�r)r)r+r�$szContext.scalebcCst|dd�}|j||d�S)a{Returns a shifted copy of a, b times.

        The coefficient of the result is a shifted copy of the digits
        in the coefficient of the first operand.  The number of places
        to shift is taken from the absolute value of the second operand,
        with the shift being to the left if the second operand is
        positive or to the right otherwise.  Digits shifted into the
        coefficient are zeros.

        >>> ExtendedContext.shift(Decimal('34'), Decimal('8'))
        Decimal('400000000')
        >>> ExtendedContext.shift(Decimal('12'), Decimal('9'))
        Decimal('0')
        >>> ExtendedContext.shift(Decimal('123456789'), Decimal('-2'))
        Decimal('1234567')
        >>> ExtendedContext.shift(Decimal('123456789'), Decimal('0'))
        Decimal('123456789')
        >>> ExtendedContext.shift(Decimal('123456789'), Decimal('+2'))
        Decimal('345678900')
        >>> ExtendedContext.shift(88888888, 2)
        Decimal('888888800')
        >>> ExtendedContext.shift(Decimal(88888888), 2)
        Decimal('888888800')
        >>> ExtendedContext.shift(88888888, Decimal(2))
        Decimal('888888800')
        Tr�rL)r�r�r�r)r)r+r�7sz
Context.shiftcCst|dd�}|j|d�S)a�Square root of a non-negative number to context precision.

        If the result must be inexact, it is rounded using the round-half-even
        algorithm.

        >>> ExtendedContext.sqrt(Decimal('0'))
        Decimal('0')
        >>> ExtendedContext.sqrt(Decimal('-0'))
        Decimal('-0')
        >>> ExtendedContext.sqrt(Decimal('0.39'))
        Decimal('0.624499800')
        >>> ExtendedContext.sqrt(Decimal('100'))
        Decimal('10')
        >>> ExtendedContext.sqrt(Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.sqrt(Decimal('1.0'))
        Decimal('1.0')
        >>> ExtendedContext.sqrt(Decimal('1.00'))
        Decimal('1.0')
        >>> ExtendedContext.sqrt(Decimal('7'))
        Decimal('2.64575131')
        >>> ExtendedContext.sqrt(Decimal('10'))
        Decimal('3.16227766')
        >>> ExtendedContext.sqrt(2)
        Decimal('1.41421356')
        >>> ExtendedContext.prec
        9
        Tr�rL)r�rHr�r)r)r+rHUszContext.sqrtcCs8t|dd�}|j||d�}|tkr0td|��n|SdS)a&Return the difference between the two operands.

        >>> ExtendedContext.subtract(Decimal('1.3'), Decimal('1.07'))
        Decimal('0.23')
        >>> ExtendedContext.subtract(Decimal('1.3'), Decimal('1.30'))
        Decimal('0.00')
        >>> ExtendedContext.subtract(Decimal('1.3'), Decimal('2.07'))
        Decimal('-0.77')
        >>> ExtendedContext.subtract(8, 5)
        Decimal('3')
        >>> ExtendedContext.subtract(Decimal(8), 5)
        Decimal('3')
        >>> ExtendedContext.subtract(8, Decimal(5))
        Decimal('3')
        Tr�rLr�N)r�r�r�rwr�r)r)r+�subtractus
zContext.subtractcCst|dd�}|j|d�S)a�Convert to a string, using engineering notation if an exponent is needed.

        Engineering notation has an exponent which is a multiple of 3.  This
        can leave up to 3 digits to the left of the decimal place and may
        require the addition of either one or two trailing zeros.

        The operation is not affected by the context.

        >>> ExtendedContext.to_eng_string(Decimal('123E+1'))
        '1.23E+3'
        >>> ExtendedContext.to_eng_string(Decimal('123E+3'))
        '123E+3'
        >>> ExtendedContext.to_eng_string(Decimal('123E-10'))
        '12.3E-9'
        >>> ExtendedContext.to_eng_string(Decimal('-123E-12'))
        '-123E-12'
        >>> ExtendedContext.to_eng_string(Decimal('7E-7'))
        '700E-9'
        >>> ExtendedContext.to_eng_string(Decimal('7E+1'))
        '70'
        >>> ExtendedContext.to_eng_string(Decimal('0E+1'))
        '0.00E+3'

        Tr�rL)r�r�r�r)r)r+r��szContext.to_eng_stringcCst|dd�}|j|d�S)zyConverts a number to a string, using scientific notation.

        The operation is not affected by the context.
        Tr�rL)r�r�r�r)r)r+�
to_sci_string�szContext.to_sci_stringcCst|dd�}|j|d�S)akRounds to an integer.

        When the operand has a negative exponent, the result is the same
        as using the quantize() operation using the given operand as the
        left-hand-operand, 1E+0 as the right-hand-operand, and the precision
        of the operand as the precision setting; Inexact and Rounded flags
        are allowed in this operation.  The rounding mode is taken from the
        context.

        >>> ExtendedContext.to_integral_exact(Decimal('2.1'))
        Decimal('2')
        >>> ExtendedContext.to_integral_exact(Decimal('100'))
        Decimal('100')
        >>> ExtendedContext.to_integral_exact(Decimal('100.0'))
        Decimal('100')
        >>> ExtendedContext.to_integral_exact(Decimal('101.5'))
        Decimal('102')
        >>> ExtendedContext.to_integral_exact(Decimal('-101.5'))
        Decimal('-102')
        >>> ExtendedContext.to_integral_exact(Decimal('10E+5'))
        Decimal('1.0E+6')
        >>> ExtendedContext.to_integral_exact(Decimal('7.89E+77'))
        Decimal('7.89E+77')
        >>> ExtendedContext.to_integral_exact(Decimal('-Inf'))
        Decimal('-Infinity')
        Tr�rL)r�rBr�r)r)r+rB�szContext.to_integral_exactcCst|dd�}|j|d�S)aLRounds to an integer.

        When the operand has a negative exponent, the result is the same
        as using the quantize() operation using the given operand as the
        left-hand-operand, 1E+0 as the right-hand-operand, and the precision
        of the operand as the precision setting, except that no flags will
        be set.  The rounding mode is taken from the context.

        >>> ExtendedContext.to_integral_value(Decimal('2.1'))
        Decimal('2')
        >>> ExtendedContext.to_integral_value(Decimal('100'))
        Decimal('100')
        >>> ExtendedContext.to_integral_value(Decimal('100.0'))
        Decimal('100')
        >>> ExtendedContext.to_integral_value(Decimal('101.5'))
        Decimal('102')
        >>> ExtendedContext.to_integral_value(Decimal('-101.5'))
        Decimal('-102')
        >>> ExtendedContext.to_integral_value(Decimal('10E+5'))
        Decimal('1.0E+6')
        >>> ExtendedContext.to_integral_value(Decimal('7.89E+77'))
        Decimal('7.89E+77')
        >>> ExtendedContext.to_integral_value(Decimal('-Inf'))
        Decimal('-Infinity')
        Tr�rL)r�rr�r)r)r+r�szContext.to_integral_value)	NNNNNNNNN)N)rR)N)Xr4r5r6r7r�r�r�r�r�r�r�rNr�rCrMr�rir�r�r�r�r�r�rDr�r�rmr�r�rMr�rNrJrRr�r�r�rSr�r�r�rWrrVrWr=r�rYr�rZr�r[r\rfrirjrxrzr{ryr�r~r�rr�r�r�r�r�r;r�r�r�rr�r�r�r�r>r�r�rHr�r�r�rBrr�r)r)r)r+rs��
$



$#


%
 #2
P:&" c@s"eZdZdZddd�Zdd�ZdS)rn�rCrVrWNcCsf|dkrd|_d|_d|_nFt|t�rD|j|_t|j�|_|j|_n|d|_|d|_|d|_dS)Nr&r.r^)rCrVrWrdrr;r<rP)r0ryr)r)r+r��s



z_WorkRep.__init__cCsd|j|j|jfS)Nz(%r, %r, %r)r�r�r)r)r+r�sz_WorkRep.__repr__)N)r4r5r6r�r�r�r)r)r)r+rn�s
rncCs�|j|jkr|}|}n|}|}tt|j��}tt|j��}|jtd||d�}||jd|krpd|_||_|jd|j|j9_|j|_||fS)zcNormalizes op1, op2 to have the same exp and length of coefficient.

    Done during addition.
    r�r^r.r�)rWrkrerVr�)r�r�rFZtmpr�Ztmp_lenZ	other_lenrWr)r)r+r�sr�cCsb|dkrdS|dkr |d|Stt|��}t|�t|�d��}||krPdS|d|SdS)a Given integers n and e, return n * 10**e if it's an integer, else None.

    The computation is designed to avoid computing large powers of 10
    unnecessarily.

    >>> _decimal_lshift_exact(3, 4)
    30000
    >>> _decimal_lshift_exact(300, -999999999)  # returns None

    r&r�rRN)rermrk�rstrip)r9r�Zstr_nZval_nr)r)r+r#(sr#cCsB|dks|dkrtd��d}||kr>||||d?}}q|S)z�Closest integer to the square root of the positive integer n.  a is
    an initial approximation to the square root.  Any positive integer
    will do for a, but the closer a is to the square root of n the
    faster convergence will be.

    r&z3Both arguments to _sqrt_nearest should be positive.r.)rq)r9r-rsr)r)r+�
_sqrt_nearest=sr�cCs2d|>||?}}|d||d@|d@|kS)z�Given an integer x and a nonnegative integer shift, return closest
    integer to x / 2**shift; use round-to-even in case of a tie.

    r.r^r))r&r�rsr�r)r)r+�_rshift_nearestLsr�cCs&t||�\}}|d||d@|kS)zaClosest integer to a/b, a and b positive integers; rounds to even
    in the case of a tie.

    r^r.)r�)r-rsr�r�r)r)r+�_div_nearestTsr�rc		Cs�||}d}||kr(t|�||>|ksD||krxt|�||?|krxt||d>|t||t||�|��}|d7}qtdtt|��d|�}t||�}t||�}t|ddd�D]}t||�t|||�}q�t|||�S)a�Integer approximation to M*log(x/M), with absolute error boundable
    in terms only of x/M.

    Given positive integers x and M, return an integer approximation to
    M * log(x/M).  For L = 8 and 0.1 <= x/M <= 10 the difference
    between the approximation and the exact result is at most 22.  For
    L = 8 and 1.0 <= x/M <= 10.0 the difference is at most 15.  In
    both cases these are upper bounds on the error; it will usually be
    much smaller.r&r.���r\r�)rmr�r�r�rVrkrer)	r&�M�Lr)�R�TZyshift�wr�r)r)r+�_ilog\s"���


r�c
Cs�|d7}tt|��}||||dk}|dkr�d|}|||}|dkrZ|d|9}nt|d|�}t||�}t|�}t|||�}||}	nd}t|d|�}	t|	|d�S)z�Given integers c, e and p with c > 0, p >= 0, compute an integer
    approximation to 10**p * log10(c*10**e), with an absolute error of
    at most 1.  Assumes that c*10**e is not exactly 1.r^r.r&r�r!)rkrer�r��
_log10_digits)
rFr�r%rGr�r�r��log_dZlog_10Zlog_tenpowerr)r)r+rh�s 

rhc	Cs�|d7}tt|��}||||dk}|dkrr|||}|dkrR|d|9}nt|d|�}t|d|�}nd}|r�ttt|���d}||dkr�t|t||�d|�}q�d}nd}t||d�S)z�Given integers c, e and p with c > 0, compute an integer
    approximation to 10**p * log(c*10**e), with an absolute error of
    at most 1.  Assumes that c*10**e is not exactly 1.r^r.r&r�r!)rkrer�r�rmr�)	rFr�r%rGr�r�r�r6Z	f_log_tenr)r)r+rd�s"rdc@s eZdZdZdd�Zdd�ZdS)�
_Log10Memoizez�Class to compute, store, and allow retrieval of, digits of the
    constant log(10) = 2.302585....  This constant is needed by
    Decimal.ln, Decimal.log10, Decimal.exp and Decimal.__pow__.cCs
d|_dS)NZ/23025850929940456840179914546843642076011014886)r}r�r)r)r+r��sz_Log10Memoize.__init__cCs�|dkrtd��|t|j�kr�d}d||d}tttd||�d��}||d�d|krbql|d7}q"|�d�dd	�|_t|jd|d
��S)ztGiven an integer p >= 0, return floor(10**p)*log(10).

        For example, self.getdigits(3) returns 2302.
        r&zp should be nonnegativer\r�r^r!NrRr�r.)rqrkr}rer�r�r�rV)r0r%r6r�r}r)r)r+�	getdigits�s	
z_Log10Memoize.getdigitsN)r4r5r6r7r�r�r)r)r)r+r��sr�c	Cs�t||>|�}tdtt|��d|�}t||�}||>}t|ddd�D]}t|||||�}qPt|ddd�D]"}||d>}t||||�}q|||S)z�Given integers x and M, M > 0, such that x/M is small in absolute
    value, compute an integer approximation to M*exp(x/M).  For 0 <=
    x/M <= 2.4, the absolute error in the result is bounded by 60 (and
    is usually much smaller).r�r\r.r&r�r^)r"rVrkrer�r)	r&r�r�r�r�r)ZMshiftrr�r)r)r+�_iexp�s
r�c	Cs�|d7}td|tt|��d�}||}||}|dkrH|d|}n|d|}t|t|��\}}t|d|�}tt|d|�d�||dfS)a�Compute an approximation to exp(c*10**e), with p decimal places of
    precision.

    Returns integers d, f such that:

      10**(p-1) <= d <= 10**p, and
      (d-1)*10**f < exp(c*10**e) < (d+1)*10**f

    In other words, d*10**f is an approximation to exp(c*10**e) with p
    digits of precision, and with an error in d of at most 1.  This is
    almost, but not quite, the same as the error being < 1ulp: when d
    = 10**(p-1) the error could be up to 10 ulp.r^r&r.r�i�r\)r�rkrer�r�r�r�)	rFr�r%r6r�r�ZcshiftZquotr,r)r)r+rT$srTcCs�ttt|���|}t||||d�}||}|dkrJ||d|}nt||d|�}|dkr�tt|��|dk|dkkr�d|ddd|}	}
q�d|d|}	}
n,t||d|d�\}	}
t|	d�}	|
d7}
|	|
fS)a5Given integers xc, xe, yc and ye representing Decimals x = xc*10**xe and
    y = yc*10**ye, compute x**y.  Returns a pair of integers (c, e) such that:

      10**(p-1) <= c <= 10**p, and
      (c-1)*10**e < x**y < (c+1)*10**e

    in other words, c*10**e is an approximation to x**y with p digits
    of precision, and with an error in c of at most 1.  (This is
    almost, but not quite, the same as the error being < 1ulp: when c
    == 10**(p-1) we can only guarantee error < 10ulp.)

    We assume that: x is positive and not equal to 1, and y is nonzero.
    r.r&r�)rkrermrdr�rT)r'r(r*r+r%rsZlxcr�Zpcr�rWr)r)r+r1Hs
r1r!�F�5�(�r]�r�r~)	r��2�3�4�5�6�7�8rDcCs0|dkrtd��t|�}dt|�||dS)z@Compute a lower bound for 100*log10(c) for a positive integer c.r&z0The argument to _log10_lb should be nonnegative.r!)rqrerk)rFZ
correctionZstr_cr)r)r+r$rsr$cCsLt|t�r|St|t�r t|�S|r8t|t�r8t�|�S|rHtd|��tS)z�Convert other to Decimal.

    Verifies that it's ok to use in an implicit construction.
    If allow_float is true, allow conversion from float;  this
    is used in the comparison methods (__eq__ and friends).

    r�)rdrrVrurvrwr�)r�r�Zallow_floatr)r)r+r�}s


r�cCs�t|t�r||fSt|tj�rR|jsDt|jtt|j	�|j
�|j�}|t|j�fS|rrt|tj
�rr|jdkrr|j}t|t�r�t�}|r�d|jt<n|�td�|t�|�fSttfS)z�Given a Decimal instance self and a Python object other, return
    a pair (s, o) of Decimal instances such that "s op o" is
    equivalent to "self op other" for any of the 6 comparison
    operators "op".

    r&r.ra)rdr�_numbersZRationalrQr:r;rerVr<�denominatorrP�	numeratorZComplexr�r�rurr4rrirvr�)r0r�r�r1r)r)r+r��s(
�
�r�r i?Bi���)rFrEr3r4rGr<r�r�r_)rFrEr3r4a�        # A numeric string consists of:
#    \s*
    (?P<sign>[-+])?              # an optional sign, followed by either...
    (
        (?=\d|\.\d)              # ...a number (with at least one digit)
        (?P<int>\d*)             # having a (possibly empty) integer part
        (\.(?P<frac>\d*))?       # followed by an optional fractional part
        (E(?P<exp>[-+]?\d+))?    # followed by an optional exponent, or...
    |
        Inf(inity)?              # ...an infinity, or...
    |
        (?P<signal>s)?           # ...an (optionally signaling)
        NaN                      # NaN
        (?P<diag>\d*)            # with (possibly empty) diagnostic info.
    )
#    \s*
    \Z
z0*$z50*$z�\A
(?:
   (?P<fill>.)?
   (?P<align>[<>=^])
)?
(?P<sign>[-+ ])?
(?P<alt>\#)?
(?P<zeropad>0)?
(?P<minimumwidth>(?!0)\d+)?
(?P<thousands_sep>,)?
(?:\.(?P<precision>0|(?!0)\d+))?
(?P<type>[eEfFgGn%])?
\Z
cCs�t�|�}|dkrtd|��|��}|d}|d}|ddk	|d<|drv|dk	rbtd|��|dk	rvtd|��|p|d|d<|p�d	|d<|d
dkr�d|d
<t|dp�d
�|d<|ddk	r�t|d�|d<|ddkr�|ddks�|ddkr�d|d<|ddk�rfd|d<|dk�r&t��}|ddk	�r@td|��|d|d<|d|d<|d|d<n*|ddk�r|d|d<ddg|d<d|d<|S)a�Parse and validate a format specifier.

    Turns a standard numeric format specifier into a dict, with the
    following entries:

      fill: fill character to pad field to minimum width
      align: alignment type, either '<', '>', '=' or '^'
      sign: either '+', '-' or ' '
      minimumwidth: nonnegative integer giving minimum width
      zeropad: boolean, indicating whether to pad with zeros
      thousands_sep: string to use as thousands separator, or ''
      grouping: grouping for thousands separators, in format
        used by localeconv
      decimal_point: string to use for decimal point
      precision: nonnegative integer giving precision, or None
      type: one of the characters 'eEfFgG%', or None

    NzInvalid format specifier: �fill�align�zeropadz7Fill character conflicts with '0' in format specifier: z2Alignment conflicts with '0' in format specifier: � �>rCrU�minimumwidthrRr�r&r�ZgGnr.r9r��
thousands_sepzJExplicit thousands separator conflicts with 'n' type in format specifier: �grouping�
decimal_pointrTr\r�)�_parse_format_specifier_regex�matchrq�	groupdictrV�_locale�
localeconv)�format_specr�rzZformat_dictrrr)r)r+r�sT
��
�r�c	Cs�|d}|d}||t|�t|�}|d}|dkrF|||}nj|dkr\|||}nT|dkrr|||}n>|dkr�t|�d}|d	|�||||d	�}ntd
��|S)z�Given an unpadded, non-aligned numeric string 'body' and sign
    string 'sign', add padding and alignment conforming to the given
    format specifier dictionary 'spec' (as produced by
    parse_format_specifier).

    r	rr�<r�=�^r^NzUnrecognised alignment field)rkrq)	rCr�r�r	rZpaddingrr�Zhalfr)r)r+r�ms"r�cCspddlm}m}|sgS|ddkrJt|�dkrJ||dd�||d��S|dtjkrd|dd�Std��dS)zyConvert a localeconv-style grouping into a (possibly infinite)
    iterable of integers representing group lengths.

    r&)�chain�repeatr�r^Nr�z unrecognised format for grouping)�	itertoolsrrrkr�CHAR_MAXrq)rrrr)r)r+�_group_lengths�s
rcCs�|d}|d}g}t|�D]�}|dkr0td��ttt|�|d�|�}|�d|t|�||d��|d|�}||8}|s�|dkr�q�|t|�8}qtt|�|d�}|�d|t|�||d��|�t|��S)anInsert thousands separators into a digit string.

    spec is a dictionary whose keys should include 'thousands_sep' and
    'grouping'; typically it's the result of parsing the format
    specifier using _parse_format_specifier.

    The min_width keyword argument gives the minimum length of the
    result, which will be padded on the left with zeros if necessary.

    If necessary, the zero padding adds an extra '0' on the left to
    avoid a leading thousands separator.  For example, inserting
    commas every three digits in '123456', with min_width=8, gives
    '0,123,456', even though that has length 9.

    r
rr&zgroup length should be positiver.rRN)rrqr�r�rkrrrs�reversed)r}r��	min_width�sepr�groupsrGr)r)r+�_insert_thousands_sep�s $$rcCs$|rdS|ddkr|dSdSdS)zDetermine sign character.rUrCz +rTNr))�is_negativer�r)r)r+r��s
r�cCs�t||�}|s|dr"|d|}|dks6|ddkr\ddddd�|d}|d	�||�7}|dd
krp|d
7}|dr�|dt|�t|�}nd}t|||�}t||||�S)
acFormat a number, given the following data:

    is_negative: true if the number is negative, else false
    intpart: string of digits that must appear before the decimal point
    fracpart: string of digits that must come after the point
    exp: exponent, as an integer
    spec: dictionary resulting from parsing the format specifier

    This function uses the information in spec to:
      insert separators (decimal separator and thousands separators)
      format the sign
      format the exponent
      add trailing '%' for the '%' type
      zero-pad if necessary
      fill and align if necessary
    Zaltrr&r�r�r�r�)r�r�r�r�z{0}{1:+}r�rr	)r��formatrkrr�)r r{r|rWr�rCZecharrr)r)r+r��s
r�ZInfz-Infr�r�r^)N)F)r&)r)r)FF)F)N)r.)zr7�__all__r4Z	__xname__�__version__Z__libmpdec_version__ZmathrZnumbersr�sys�collectionsr'Z_namedtupler�ImportErrorrrrrrrrrr$r%�maxsizer r!r"r#�ArithmeticErrorrrr	r�ZeroDivisionErrorr
rrrrrr
rrrwrr2r�r�ZcontextvarsZ
ContextVarrHrrrrbrr:�Number�registerrOrrnr�rVr�r"r#r�r�r�r�rhrdr�r�r�r�rTr1r$r�r�rrr�re�compile�VERBOSE�
IGNORECASErrfr�r�DOTALLr
Zlocalerr�r�rrr�r�rcrbr>rPr/rOrA�	hash_info�modulusr�r�r�r�r�r�r�r)r)r)r+�<module>s�e�#

&
���

.
^

0",#
%$+�

*���
�
�
P
%
)__pycache__/shelve.cpython-38.opt-2.pyc000064400000012335151153537560013651 0ustar00U

e5dO!�@s�ddlmZmZddlmZddlZddddgZGdd	�d	ejj	�Z
Gd
d�dejj	�ZGdd�de�ZGdd�de�Z
ddd�ZdS)�)�Pickler�	Unpickler)�BytesION�Shelf�
BsdDbShelf�DbfilenameShelf�openc@s4eZdZdd�ZeZZZZZZ	dd�Z
dS)�_ClosedDictcGstd��dS)Nz!invalid operation on closed shelf)�
ValueError)�self�args�r
�/usr/lib64/python3.8/shelve.py�closedEsz_ClosedDict.closedcCsdS)Nz<Closed Dictionary>r
�rr
r
r�__repr__Isz_ClosedDict.__repr__N)�__name__�
__module__�__qualname__r�__iter__�__len__�__getitem__�__setitem__�__delitem__�keysrr
r
r
rr	Bsr	c@sxeZdZddd�Zdd�Zdd	�Zd
d�Zddd
�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS) rNF�utf-8cCs.||_|dkrd}||_||_i|_||_dS)N�)�dict�	_protocol�	writeback�cache�keyencoding�rr�protocolrr!r
r
r�__init__TszShelf.__init__ccs"|j��D]}|�|j�Vq
dS�N)rr�decoder!)r�kr
r
rr^szShelf.__iter__cCs
t|j�Sr%)�lenrrr
r
rrbsz
Shelf.__len__cCs|�|j�|jkSr%��encoder!r�r�keyr
r
r�__contains__eszShelf.__contains__cCs|�|j�|jkr||S|Sr%r))rr,�defaultr
r
r�gethsz	Shelf.getcCsZz|j|}WnFtk
rTt|j|�|j��}t|���}|jrP||j|<YnX|Sr%)	r �KeyErrorrrr*r!r�loadr�rr,�value�fr
r
rrmszShelf.__getitem__cCsF|jr||j|<t�}t||j�}|�|�|��|j|�|j	�<dSr%)
rr rrr�dump�getvaluerr*r!)rr,r3r4�pr
r
rrws

zShelf.__setitem__cCs6|j|�|j�=z|j|=Wntk
r0YnXdSr%)rr*r!r r0r+r
r
rrs
zShelf.__delitem__cCs|Sr%r
rr
r
r�	__enter__�szShelf.__enter__cCs|��dSr%)�close)r�typer3�	tracebackr
r
r�__exit__�szShelf.__exit__cCsf|jdkrdSz0|��z|j��Wntk
r:YnXW5zt�|_Wnd|_YnXXdSr%)rr	�syncr9�AttributeErrorrr
r
rr9�s

zShelf.closecCst|d�sdS|��dS)Nr)�hasattrr9rr
r
r�__del__�s
z
Shelf.__del__cCsT|jr:|jr:d|_|j��D]\}}|||<qd|_i|_t|jd�rP|j��dS)NFTr=)rr �itemsr?rr=)rr,�entryr
r
rr=�s
z
Shelf.sync)NFr)N)rrrr$rrr-r/rrrr8r<r9r@r=r
r
r
rrMs�



c@s>eZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�ZdS)rNFrcCst�|||||�dSr%)rr$r"r
r
rr$�szBsdDbShelf.__init__cCs0|j�|�\}}t|�}|�|j�t|���fSr%)r�set_locationrr&r!rr1r2r
r
rrC�szBsdDbShelf.set_locationcCs.t|j�\}}t|�}|�|j�t|���fSr%)�nextrrr&r!rr1r2r
r
rrD�szBsdDbShelf.nextcCs.|j��\}}t|�}|�|j�t|���fSr%)r�previousrr&r!rr1r2r
r
rrE�szBsdDbShelf.previouscCs.|j��\}}t|�}|�|j�t|���fSr%)r�firstrr&r!rr1r2r
r
rrF�szBsdDbShelf.firstcCs.|j��\}}t|�}|�|j�t|���fSr%)r�lastrr&r!rr1r2r
r
rrG�szBsdDbShelf.last)NFr)	rrrr$rCrDrErFrGr
r
r
rr�s
�
c@seZdZddd�ZdS)r�cNFcCs$ddl}t�||�||�||�dS)Nr)�dbmrr$r)r�filename�flagr#rrIr
r
rr$�szDbfilenameShelf.__init__)rHNF)rrrr$r
r
r
rr�srHFcCst||||�Sr%)r)rJrKr#rr
r
rr�s
)rHNF)�picklerr�iorZcollections.abc�collections�__all__�abc�MutableMappingr	rrrrr
r
r
r�<module>;sb+__pycache__/decimal.cpython-38.opt-1.pyc000064400000000551151153537560013755 0ustar00U

e5d@�@svz0ddlTddlmZddlmZddlmZWn@ek
rpddlTddlmZddlmZddlmZYnXdS)�)�*)�__doc__)�__version__)�__libmpdec_version__N)Z_decimalrrr�ImportErrorZ
_pydecimal�rr�/usr/lib64/python3.8/decimal.py�<module>s__pycache__/bz2.cpython-38.opt-1.pyc000064400000026267151153537560013070 0ustar00U

e5d1�@s�dZddddddgZdZdd	lmZdd
lZdd
lZdd
lZdd
l	Z	ddl
mZddlm
Z
mZdZd
ZdZe�ZGdd�de	j�Zddd�Zddd�Zdd�Zd
S)z�Interface to the libbzip2 compression library.

This module provides a file interface, classes for incremental
(de)compression, and functions for one-shot (de)compression.
�BZ2File�
BZ2Compressor�BZ2Decompressor�open�compress�
decompressz%Nadeem Vawda <nadeem.vawda@gmail.com>�)rN)�RLock)rr��c@s�eZdZdZdedfdd�Zdd�Zedd	��Zd
d�Z	dd
�Z
dd�Zdd�Zd)dd�Z
d*dd�Zd+dd�Zdd�Zd,dd�Zd-dd�Zd d!�Zd"d#�Zejfd$d%�Zd&d'�Zd(S).ra@A file object providing transparent bzip2 (de)compression.

    A BZ2File can act as a wrapper for an existing file object, or refer
    directly to a named file on disk.

    Note that BZ2File provides a *binary* file interface - data read is
    returned as bytes, and data to be written should be given as bytes.
    �r�	cCsTt�|_d|_d|_t|_|tk	r2tjdt	dd�d|krFdksPnt
d��|d	krbd
}t}nb|dkr~d}t}t
|�|_nF|d
kr�d}t}t
|�|_n*|dkr�d}t}t
|�|_nt
d|f��t|tttjf�r�t||�|_d|_||_n.t|d��st|d��r||_||_ntd��|jtk�rJtj|jttd�}t�|�|_nd|_dS)aOOpen a bzip2-compressed file.

        If filename is a str, bytes, or PathLike object, it gives the
        name of the file to be opened. Otherwise, it should be a file
        object, which will be used to read or write the compressed data.

        mode can be 'r' for reading (default), 'w' for (over)writing,
        'x' for creating exclusively, or 'a' for appending. These can
        equivalently be given as 'rb', 'wb', 'xb', and 'ab'.

        buffering is ignored since Python 3.0. Its use is deprecated.

        If mode is 'w', 'x' or 'a', compresslevel can be a number between 1
        and 9 specifying the level of compression: 1 produces the least
        compression, and 9 (default) produces the most compression.

        If mode is 'r', the input file may be the concatenation of
        multiple compressed streams.
        NFzGUse of 'buffering' argument is deprecated and ignored since Python 3.0.�)�
stacklevelr	rz%compresslevel must be between 1 and 9)�r�rbr)�w�wbr)�x�xbr)�a�abr�Invalid mode: %rT�read�writez6filename must be a str, bytes, file or PathLike object)Ztrailing_errorr)r�_lock�_fp�_closefp�_MODE_CLOSED�_mode�	_sentinel�warnings�warn�DeprecationWarning�
ValueError�
_MODE_READ�_MODE_WRITEr�_compressor�
isinstance�str�bytes�os�PathLike�
_builtin_open�hasattr�	TypeError�_compressionZDecompressReaderr�OSError�io�BufferedReader�_buffer�_pos)�self�filename�mode�	buffering�
compresslevelZ	mode_code�raw�r;�/usr/lib64/python3.8/bz2.py�__init__)sT��zBZ2File.__init__cCs�|j��|jtkr W5QR�dSz<|jtkr8|j��n"|jtkrZ|j�	|j
���d|_
W5z|jrp|j��W5d|_d|_t|_d|_XXW5QRXdS)z�Flush and close the file.

        May be called more than once without error. Once the file is
        closed, any other operation on it will raise a ValueError.
        NF)rrrrrr3�closer$r%rr&�flush�r5r;r;r<r>ps 



z
BZ2File.closecCs
|jtkS)zTrue if this file is closed.)rrr@r;r;r<�closed�szBZ2File.closedcCs|��|j��S)z3Return the file descriptor for the underlying file.)�_check_not_closedr�filenor@r;r;r<rC�szBZ2File.filenocCs|��o|j��S)z)Return whether the file supports seeking.)�readabler3�seekabler@r;r;r<rE�szBZ2File.seekablecCs|��|jtkS)z/Return whether the file was opened for reading.)rBrr$r@r;r;r<rD�szBZ2File.readablecCs|��|jtkS)z/Return whether the file was opened for writing.)rBrr%r@r;r;r<�writable�szBZ2File.writablerc
Cs2|j�"|��|j�|�W5QR�SQRXdS)z�Return buffered data without advancing the file position.

        Always returns at least one byte of data, unless at EOF.
        The exact number of bytes returned is unspecified.
        N)r�_check_can_readr3�peek)r5�nr;r;r<rH�szBZ2File.peek���c
Cs2|j�"|��|j�|�W5QR�SQRXdS)z�Read up to size uncompressed bytes from the file.

        If size is negative or omitted, read until EOF is reached.
        Returns b'' if the file is already at EOF.
        N)rrGr3r�r5�sizer;r;r<r�szBZ2File.readc
Cs@|j�0|��|dkrtj}|j�|�W5QR�SQRXdS)z�Read up to size uncompressed bytes, while trying to avoid
        making multiple reads from the underlying stream. Reads up to a
        buffer's worth of data if size is negative.

        Returns b'' if the file is at EOF.
        rN)rrGr1�DEFAULT_BUFFER_SIZEr3�read1rKr;r;r<rN�s
z
BZ2File.read1c
Cs2|j�"|��|j�|�W5QR�SQRXdS)zRRead bytes into b.

        Returns the number of bytes read (0 for EOF).
        N)rrGr3�readinto)r5�br;r;r<rO�szBZ2File.readintoc
CsVt|t�s$t|d�std��|��}|j�"|��|j�|�W5QR�SQRXdS)a
Read a line of uncompressed bytes from the file.

        The terminating newline (if present) is retained. If size is
        non-negative, no more than size bytes will be read (in which
        case the line may be incomplete). Returns b'' if already at EOF.
        �	__index__�Integer argument expectedN)	r'�intr-r.rQrrGr3�readlinerKr;r;r<rT�s

zBZ2File.readlinec
CsVt|t�s$t|d�std��|��}|j�"|��|j�|�W5QR�SQRXdS)z�Read a list of lines of uncompressed bytes from the file.

        size can be specified to control the number of lines read: no
        further lines will be read once the total size of the lines read
        so far equals or exceeds size.
        rQrRN)	r'rSr-r.rQrrGr3�	readlinesrKr;r;r<rU�s

zBZ2File.readlinesc
CsX|j�H|��|j�|�}|j�|�|jt|�7_t|�W5QR�SQRXdS)z�Write a byte string to the file.

        Returns the number of uncompressed bytes written, which is
        always len(data). Note that due to buffering, the file on disk
        may not reflect the data written until close() is called.
        N)rZ_check_can_writer&rrrr4�len)r5�dataZ
compressedr;r;r<r�sz
BZ2File.writec
Cs,|j�tj�||�W5QR�SQRXdS)z�Write a sequence of byte strings to the file.

        Returns the number of uncompressed bytes written.
        seq can be any iterable yielding byte strings.

        Line separators are not added between the written byte strings.
        N)rr/�
BaseStream�
writelines)r5�seqr;r;r<rY�szBZ2File.writelinesc
Cs4|j�$|��|j�||�W5QR�SQRXdS)a�Change the file position.

        The new position is specified by offset, relative to the
        position indicated by whence. Values for whence are:

            0: start of stream (default); offset must not be negative
            1: current stream position
            2: end of stream; offset must not be positive

        Returns the new file position.

        Note that seeking is emulated, so depending on the parameters,
        this operation may be extremely slow.
        N)rZ_check_can_seekr3�seek)r5�offset�whencer;r;r<r[szBZ2File.seekc
CsL|j�<|��|jtkr0|j��W5QR�S|jW5QR�SQRXdS)z!Return the current file position.N)rrBrr$r3�tellr4r@r;r;r<r^s

zBZ2File.tellN)r)rJ)rJ)rJ)rJ)�__name__�
__module__�__qualname__�__doc__rr=r>�propertyrArCrErDrFrHrrNrOrTrUrrYr1�SEEK_SETr[r^r;r;r;r<rs&	G





	

rrcCs�d|kr d|krPtd|f��n0|dk	r0td��|dk	r@td��|dk	rPtd��|�dd�}t|||d	�}d|kr�t�||||�S|SdS)
aOpen a bzip2-compressed file in binary or text mode.

    The filename argument can be an actual filename (a str, bytes, or
    PathLike object), or an existing file object to read from or write
    to.

    The mode argument can be "r", "rb", "w", "wb", "x", "xb", "a" or
    "ab" for binary mode, or "rt", "wt", "xt" or "at" for text mode.
    The default mode is "rb", and the default compresslevel is 9.

    For binary mode, this function is equivalent to the BZ2File
    constructor: BZ2File(filename, mode, compresslevel). In this case,
    the encoding, errors and newline arguments must not be provided.

    For text mode, a BZ2File object is created, and wrapped in an
    io.TextIOWrapper instance with the specified encoding, error
    handling behavior, and line ending(s).

    �trPrNz0Argument 'encoding' not supported in binary modez.Argument 'errors' not supported in binary modez/Argument 'newline' not supported in binary moder)r9)r#�replacerr1�
TextIOWrapper)r6r7r9�encoding�errors�newlineZbz_modeZbinary_filer;r;r<r!scCst|�}|�|�|��S)z�Compress a block of data.

    compresslevel, if given, must be a number between 1 and 9.

    For incremental compression, use a BZ2Compressor object instead.
    )rrr?)rWr9�compr;r;r<rJscCshg}|r^t�}z|�|�}Wn tk
r<|r6Yq^n�YnX|�|�|jsVtd��|j}qd�|�S)zjDecompress a block of data.

    For incremental decompression, use a BZ2Decompressor object instead.
    zACompressed data ended before the end-of-stream marker was reached�)rrr0�append�eofr#Zunused_data�join)rWZresultsZdecomp�resr;r;r<rUs
)rrNNN)r)rb�__all__�
__author__�builtinsrr,r1r*r r/Z	threadingrZ_bz2rrrr$r%�objectrrXrrrr;r;r;r<�<module>s6��
)
__pycache__/opcode.cpython-38.opt-1.pyc000064400000012456151153537560013637 0ustar00U

e5d��
@s�dZddddddddd	d
ddd
g
ZzddlmZe�d�Wnek
rPYnXdZgZgZgZ	gZ
gZgZgZ
gZiZdd�ed�D�Zdd�Zdd�Zdd�Zdd�Zedd�edd �ed!d"�ed#d$�ed%d&�ed'd(�ed)d*�ed+d,�ed-d.�ed/d0�ed1d2�ed3d4�ed5d6�ed7d8�ed9d:�ed;d<�ed=d>�ed?d@�edAdB�edCdD�edEdF�edGdH�edIdJ�edKdL�edMdN�edOdP�edQdR�edSdT�edUdV�edWdX�edYdZ�ed[d\�ed]d^�ed_d`�edadb�edcdd�ededf�edgdh�edidj�edkdl�edmdn�edodp�edqdr�edsdt�edudv�edwdx�edydz�ed{d|�ed}d~�edd��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��d�Zed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��e�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��e�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�dƒed�dăed�dƃed�dȃed�dʃed�d̃e�d̡ed�d΃e�dΡed�dЃe�dСed�d҃ed�dԃed�dփed�d؃ed�dڃe
�dڡed�d܃e
�dܡed�dރe
�dޡed�d�e
�d�ed�d�ed�d�ed�d�ed�d�ed�d�ed�d�ed�d�e
�d�edd�d�Zed�d�ed�d�ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��e�d�d�e�d�d�e�d�d�e�d�d�e�d�d	�e�d
�d�[[[[�dS(
zy
opcode module - potentially shared between dis and other modules which
operate on bytecodes (e.g. peephole optimizers).
�cmp_op�hasconst�hasname�hasjrel�hasjabs�haslocal�
hascompare�hasfree�opname�opmap�
HAVE_ARGUMENT�EXTENDED_ARG�hasnargs�)�stack_effectr)�<z<=z==z!=�>z>=�inznot in�iszis notzexception matchZBADcCsg|]}d|f�qS)z<%r>�)�.0�oprr�/usr/lib64/python3.8/opcode.py�
<listcomp>%sr�cCs|t|<|t|<dS�N)r	r
��namerrrr�def_op'srcCst||�t�|�dSr)rr�appendrrrr�name_op+s
rcCst||�t�|�dSr)rrrrrrr�jrel_op/s
r cCst||�t�|�dSr)rrrrrrr�jabs_op3s
r!ZPOP_TOP�ZROT_TWO�Z	ROT_THREE�ZDUP_TOP�ZDUP_TOP_TWO�ZROT_FOUR�ZNOP�	ZUNARY_POSITIVE�
ZUNARY_NEGATIVE�Z	UNARY_NOT�ZUNARY_INVERT�ZBINARY_MATRIX_MULTIPLY�ZINPLACE_MATRIX_MULTIPLY�ZBINARY_POWER�ZBINARY_MULTIPLY�Z
BINARY_MODULO�Z
BINARY_ADD�ZBINARY_SUBTRACT�Z
BINARY_SUBSCR�ZBINARY_FLOOR_DIVIDE�ZBINARY_TRUE_DIVIDE�ZINPLACE_FLOOR_DIVIDE�ZINPLACE_TRUE_DIVIDE�Z	GET_AITER�2Z	GET_ANEXT�3ZBEFORE_ASYNC_WITH�4Z
BEGIN_FINALLY�5Z
END_ASYNC_FOR�6ZINPLACE_ADD�7ZINPLACE_SUBTRACT�8ZINPLACE_MULTIPLY�9ZINPLACE_MODULO�;ZSTORE_SUBSCR�<Z
DELETE_SUBSCR�=Z
BINARY_LSHIFT�>Z
BINARY_RSHIFT�?Z
BINARY_AND�@Z
BINARY_XOR�AZ	BINARY_OR�BZ
INPLACE_POWER�CZGET_ITER�DZGET_YIELD_FROM_ITER�EZ
PRINT_EXPR�FZLOAD_BUILD_CLASS�GZ
YIELD_FROM�HZ
GET_AWAITABLE�IZINPLACE_LSHIFT�KZINPLACE_RSHIFT�LZINPLACE_AND�MZINPLACE_XOR�NZ
INPLACE_OR�OZWITH_CLEANUP_START�QZWITH_CLEANUP_FINISH�RZRETURN_VALUE�SZIMPORT_STAR�TZSETUP_ANNOTATIONS�UZYIELD_VALUE�VZ	POP_BLOCK�WZEND_FINALLY�XZ
POP_EXCEPT�Y�ZZ
STORE_NAMEZDELETE_NAME�[ZUNPACK_SEQUENCE�\ZFOR_ITER�]Z	UNPACK_EX�^Z
STORE_ATTR�_ZDELETE_ATTR�`ZSTORE_GLOBAL�aZ
DELETE_GLOBAL�bZ
LOAD_CONST�dZ	LOAD_NAME�eZBUILD_TUPLE�fZ
BUILD_LIST�gZ	BUILD_SET�hZ	BUILD_MAP�iZ	LOAD_ATTR�jZ
COMPARE_OP�kZIMPORT_NAME�lZIMPORT_FROM�mZJUMP_FORWARD�nZJUMP_IF_FALSE_OR_POP�oZJUMP_IF_TRUE_OR_POP�pZ
JUMP_ABSOLUTE�qZPOP_JUMP_IF_FALSE�rZPOP_JUMP_IF_TRUE�sZLOAD_GLOBAL�tZ
SETUP_FINALLY�zZ	LOAD_FAST�|Z
STORE_FAST�}ZDELETE_FAST�~Z
RAISE_VARARGS�Z
CALL_FUNCTION�Z
MAKE_FUNCTION�ZBUILD_SLICE�ZLOAD_CLOSURE�Z
LOAD_DEREF�ZSTORE_DEREF�ZDELETE_DEREF�ZCALL_FUNCTION_KW�ZCALL_FUNCTION_EX�Z
SETUP_WITH�ZLIST_APPEND�ZSET_ADD�ZMAP_ADD�ZLOAD_CLASSDEREF��ZBUILD_LIST_UNPACK�ZBUILD_MAP_UNPACK�ZBUILD_MAP_UNPACK_WITH_CALL�ZBUILD_TUPLE_UNPACK�ZBUILD_SET_UNPACK�ZSETUP_ASYNC_WITH�ZFORMAT_VALUE�ZBUILD_CONST_KEY_MAP�ZBUILD_STRING�ZBUILD_TUPLE_UNPACK_WITH_CALL�ZLOAD_METHOD�ZCALL_METHOD�ZCALL_FINALLY�ZPOP_FINALLY�N)�__doc__�__all__Z_opcoderr�ImportErrorrrrrrrrrr
r
�ranger	rrr r!rrrrrr�<module>sF
�



























































































































__pycache__/random.cpython-38.opt-2.pyc000064400000031516151153537560013645 0ustar00U

e5d�p�@sddlmZddlmZmZmZ	m
ZmZ
ddlmZmZmZmZddlmZddlmZmZddlmZ m!Z"ddl#m#Z$ddlZ%zdd	l&m'Z&Wn e(k
r�dd	l)m'Z&YnXd
ddd
ddddddddddddddddddd d!gZ*d"ed#�ed$�Z+d$e	Z,ed%�Z-d&ed'�Z.d(Z/d)e/Z0ddl1Z1Gd*d
�d
e1j2�Z2Gd+d!�d!e2�Z3d,d-�Z4d4d/d0�Z5e2�Z6e6j7Z7e6j8Z8e6j9Z9e6j:Z:e6j;Z;e6j<Z<e6j=Z=e6j>Z>e6j?Z?e6j@Z@e6jAZAe6jBZBe6jCZCe6jDZDe6jEZEe6jFZFe6jGZGe6jHZHe6jIZIe6jJZJe6jKZKe6jLZLeMe%d1��re%jNe6j7d2�eOd3k�re5�dS)5�)�warn)�log�exp�pi�e�ceil)�sqrt�acos�cos�sin)�urandom)�Set�Sequence)�
accumulate�repeat)�bisectN)�sha512�Random�seed�random�uniform�randint�choice�sample�	randrange�shuffle�
normalvariate�lognormvariate�expovariate�vonmisesvariate�gammavariate�
triangular�gauss�betavariate�
paretovariate�weibullvariate�getstate�setstate�getrandbits�choices�SystemRandom�g��@�@��?�@�5�cs eZdZdZd>dd�Zdd�Zd?�fdd	�	Z�fd
d�Z�fdd
�Zdd�Z	dd�Z
dd�Zddefdd�Z
dd�Zdd�Zede>fdd�ZeZdd�Zd@dd �Zd!d"�ZdAddd#�d$d%�Zd&d'�ZdBd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Z d<d=�Z!�Z"S)Cr�NcCs|�|�d|_dS�N)r�
gauss_next)�self�x�r7�/usr/lib64/python3.8/random.py�__init__^s
zRandom.__init__cKsJ|jD]>}d|jkrqFd|jkr.|j|_qFd|jkr|j|_qFqdS)N�
_randbelowr(r)�__mro__�__dict__�_randbelow_with_getrandbitsr:�_randbelow_without_getrandbits)�cls�kwargs�cr7r7r8�__init_subclass__gs	



zRandom.__init_subclass__r1cs�|dkr�t|ttf�r�t|t�r*|�d�n|}|rBt|d�d>nd}tt|�D]}d||Ad@}qP|t|�N}|dkr~dn|}|d	kr�t|tttf�r�t|t�r�|��}|t	|��
�7}t�|d
�}t
��|�d|_dS)N�zlatin-1r�iCBl����������r1�big)�
isinstance�str�bytes�decode�ord�map�len�	bytearray�encode�_sha512Zdigest�int�
from_bytes�superrr4)r5�a�versionr6rA��	__class__r7r8r{s
zRandom.seedcs|jt���|jfSr3)�VERSIONrTr&r4�r5rWr7r8r&�szRandom.getstatec
s�|d}|dkr*|\}}|_t��|�nt|dkr�|\}}|_ztdd�|D��}Wn(tk
r|}z
t|�W5d}~XYnXt��|�ntd||jf��dS)Nrr2r1css|]}|dVqdS)lNr7)�.0r6r7r7r8�	<genexpr>�sz"Random.setstate.<locals>.<genexpr>z?state with version %s passed to Random.setstate() of version %s)r4rTr'�tuple�
ValueError�	TypeErrorrY)r5�staterVZ
internalstaterrWr7r8r'�s�zRandom.setstatecCs|��Sr3)r&rZr7r7r8�__getstate__�szRandom.__getstate__cCs|�|�dSr3)r')r5r`r7r7r8�__setstate__�szRandom.__setstate__cCs|jd|��fS)Nr7)rXr&rZr7r7r8�
__reduce__�szRandom.__reduce__rCc
Cs||�}||krtd��|dkr:|dkr2|�|�Std��||�}||krRtd��||}|dkrx|dkrx||�|�S|dkr�td|||f��||�}||kr�td��|dkr�||d|}	n"|dkr�||d|}	ntd��|	dkr�td��|||�|	�S)	Nz!non-integer arg 1 for randrange()rzempty range for randrange()z non-integer stop for randrange()rCz(empty range for randrange() (%d, %d, %d)z non-integer step for randrange()zzero step for randrange())r^r:)
r5�start�stop�step�_intZistartZistop�widthZistep�nr7r7r8r�s4

zRandom.randrangecCs|�||d�S�NrC)r�r5rU�br7r7r8r�szRandom.randintcCs,|j}|��}||�}||kr(||�}q|Sr3)r(�
bit_length)r5rir(�k�rr7r7r8r=�s
z"Random._randbelow_with_getrandbitscCsn|j}||kr$td�||�|�S|dkr4td��||}|||}|�}||kr^|�}qN|||�|S)Nz�Underlying random() generator does not supply 
enough bits to choose from a population range this large.
To remove the range limitation, add a getrandbits() method.rzBoundary cannot be zero)r�_warnr^)r5rirR�maxsizerZrem�limitror7r7r8r>sz%Random._randbelow_without_getrandbitscCs:z|�t|��}Wntk
r0td�d�YnX||S)Nz$Cannot choose from an empty sequence)r:rNr^�
IndexError)r5�seq�ir7r7r8rs
z
Random.choicecCs�|dkrN|j}ttdt|���D]*}||d�}||||||<||<q nHt}ttdt|���D]0}||�|d�}||||||<||<qddSrj)r:�reversed�rangerNrR)r5r6r�	randbelowru�jrgr7r7r8r%s	zRandom.shufflecCst|t�rt|�}t|t�s$td��|j}t|�}d|krF|ksPntd��dg|}d}|dkr�|dtt	|dd��7}||kr�t
|�}t|�D]0}|||�}	||	||<|||d||	<q�nHt�}
|
j
}t|�D]2}||�}	|	|
kr�||�}	q�||	�||	||<q�|S)	Nz>Population must be a sequence or set.  For dicts, use list(d).rz,Sample larger than population or is negative��r+r2rC)rH�_Setr]�	_Sequencer_r:rNr^�_ceil�_log�listrw�set�add)r5�
populationrnrxri�resultZsetsizeZpoolruryZselectedZselected_addr7r7r8r;s6)



z
Random.sample)�cum_weightsrncs�|j�t����dkrV|dkrHt��d7�����fdd�td|�D�Stt|���n|dk	rftd��t���krztd��t��dd��d�������fdd�td|�D�S)	N�csg|]}�������qSr7r7�r[ru)rgrir�rr7r8�
<listcomp>�sz"Random.choices.<locals>.<listcomp>z2Cannot specify both weights and cumulative weightsz3The number of weights does not match the populationrErCcs$g|]}������d���qS)rr7r�)rr��hir�r�totalr7r8r��s�)	rrNrR�_repeatr��_accumulater_r^�_bisect)r5r�Zweightsr�rnr7)rgrr�r�rir�rr�r8r)�s$�zRandom.choicescCs||||��Sr3�rrkr7r7r8r�szRandom.uniformr�r.cCs||��}z |dkrdn||||}Wntk
r@|YSX||krdd|}d|}||}}|||t||�S)N��?r.)r�ZeroDivisionError�_sqrt)r5ZlowZhigh�mode�urAr7r7r8r!�s	 

zRandom.triangularcCsP|j}|�}d|�}t|d|}||d}|t|�krqDq|||S)Nr.r�r-)r�
NV_MAGICCONSTr)r5�mu�sigmar�u1�u2�zZzzr7r7r8r�s

zRandom.normalvariatecCst|�||��Sr3)�_expr)r5r�r�r7r7r8r�szRandom.lognormvariatecCstd|���|S�Nr.)rr)r5Zlambdr7r7r8r�szRandom.expovariatecCs�|j}|dkrt|�Sd|}|td||�}|�}tt|�}|||}|�}	|	d||ks�|	d|t|�kr4q�q4d|}
|
|d|
|}|�}|dkr�|t|�t}
n|t|�t}
|
S)Ng���ư>r�r.)r�TWOPIr��_cos�_pir��_acos)r5r�Zkappar�sror�r��dr��q�fZu3Zthetar7r7r8r�s$
$zRandom.vonmisesvariatecCs~|dks|dkrtd��|j}|dkr�td|d�}|t}||}|�}d|kr`dksdqFqFd|�}t|d|�|}	|t|	�}
|||}|||	|
}|td|dks�|t|�krF|
|SqFn�|dkr�td|��|S|�}
t|t}||
}|dk�r$|d|}
nt|||�}
|�}|dk�r^||
|dk�rp�qrq�|t|
�kr�qrq�|
|SdS)Nr�z*gammavariate: alpha and beta must be > 0.0r.r,gH�����z>g�P���?r/)r^rr��LOG4rr��
SG_MAGICCONST�_e)r5�alpha�betarZainvZbbbZcccr�r��vr6r�ror�rl�pr7r7r8r #s@
 

zRandom.gammavariatecCs`|j}|j}d|_|dkrT|�t}tdtd|���}t|�|}t|�||_|||S)Ng�r.)rr4r�r�rr��_sin)r5r�r�rr�Zx2piZg2radr7r7r8r"hs
zRandom.gausscCs0|�|d�}|dkrdS|||�|d�SdS)Nr.rr�)r )r5r�r��yr7r7r8r#�s
zRandom.betavariatecCsd|��}d|d|Sr�r�)r5r�r�r7r7r8r$�szRandom.paretovariatecCs"d|��}|t|�d|Sr�)rr)r5r�r�r�r7r7r8r%�szRandom.weibullvariate)N)Nr1)N)N)r�r.N)#�__name__�
__module__�__qualname__rYr9rBrr&r'rarbrcrRrrr=�BPFr>r:rrrr)rr!rrrrr r"r#r$r%�
__classcell__r7r7rWr8rNs:
	 ,

G
0E5	c@s4eZdZdd�Zdd�Zdd�Zdd�ZeZZd	S)
r*cCst�td�d�d?tS)NrDrGr2)rRrS�_urandom�	RECIP_BPFrZr7r7r8r�szSystemRandom.randomcCs<|dkrtd��|dd}t�t|�d�}||d|?S)Nrz(number of bits must be greater than zerorD�rG)r^rRrSr�)r5rnZnumbytesr6r7r7r8r(�s
zSystemRandom.getrandbitscOsdSr3r7�r5�args�kwdsr7r7r8r�szSystemRandom.seedcOstd��dS)Nz*System entropy source does not have state.)�NotImplementedErrorr�r7r7r8�_notimplemented�szSystemRandom._notimplementedN)	r�r�r�rr(rr�r&r'r7r7r7r8r*�s
cCs�ddl}t|d|j�d}d}d}d}|��}t|�D]4}	||�}
||
7}||
|
}t|
|�}t|
|�}q6|��}tt||d�ddd	�||}t||||�}
td
||
||f�dS)Nr�timesr�g _�Bg _��r2zsec,� )�endz"avg %g, stddev %g, min %g, max %g
)	�time�printr��perf_counterrw�min�max�roundr�)ri�funcr�r�r�ZsqsumZsmallestZlargestZt0rur6�t1ZavgZstddevr7r7r8�_test_generator�s(

�r���cCs�t|td�t|td�t|td�t|td�t|td�t|td�t|td�t|td�t|td�t|td�t|td	�t|td
�t|td�t|td�t|td�t|td
�dS)Nr7)r�r.)g{�G�z�?r.)皙�����?r.)r�r,)r�r.)g�������?r.)r.r.)r,r.)g4@r.)gi@r.)�@r�)r�r.gUUUUUU�?)	r�rrrrr r"r#r!)�Nr7r7r8�_test�s r��fork)Zafter_in_child�__main__)r�)P�warningsrrpZmathrrrr�rr�rr�rr~rr�r	r�r
r�rr��osrr��_collections_abcr
r|rr}�	itertoolsrr�rr�rr��_osrQr�ImportErrorZhashlib�__all__r�r�r�r�r�r�Z_randomrr*r�r�Z_instrrrr!rrrrrr)rrrrr r"r#r$r%r&r'r(�hasattr�register_at_forkr�r7r7r7r8�<module>(s��
{

__pycache__/_sitebuiltins.cpython-38.opt-2.pyc000064400000005617151153537560015245 0ustar00U

e5d+�@s<ddlZGdd�de�ZGdd�de�ZGdd�de�ZdS)�Nc@s&eZdZdd�Zdd�Zddd�ZdS)	�QuittercCs||_||_dS�N��name�eof)�selfrr�r�%/usr/lib64/python3.8/_sitebuiltins.py�__init__szQuitter.__init__cCsd|j|jfS)NzUse %s() or %s to exitr�rrrr	�__repr__szQuitter.__repr__NcCs(ztj��WnYnXt|��dSr)�sys�stdin�close�
SystemExit)r�coderrr	�__call__s
zQuitter.__call__)N)�__name__�
__module__�__qualname__r
rrrrrr	r
src@s2eZdZdZddd�Zdd�Zdd�Zd	d
�ZdS)
�_Printer�rcs4ddl�||_||_d|_��fdd�|D�|_dS)Nrcs$g|]}�D]}�j�||��qqSr)�path�join)�.0�dir�filename��files�osrr	�
<listcomp>(s�z%_Printer.__init__.<locals>.<listcomp>)r�_Printer__name�_Printer__data�_Printer__lines�_Printer__filenames)rr�datar�dirsrrr	r
#s�z_Printer.__init__c
Cs~|jr
dSd}|jD]B}z(t|d��}|��}W5QRXWqXWqtk
rTYqXq|sb|j}|�d�|_t|j�|_dS)N�r�
)	r#r$�open�read�OSErrorr"�split�len�_Printer__linecnt)rr%r�fprrr	�__setup,s

z_Printer.__setupcCs8|��t|j�|jkr$d�|j�Sd|jfdSdS)Nr(z!Type %s() to see the full %s text�)�_Printer__setupr-r#�MAXLINESrr!rrrr	r<sz_Printer.__repr__cCs�|��d}d}z(t|||j�D]}t|j|�q"Wntk
rPYq�YqX||j7}d}|dkr~t|�}|dkr`d}q`|dkrq�qdS)Nz0Hit Return for more, or q (and Return) to quit: r)��qr5)r2�ranger3�printr#�
IndexError�input)r�prompt�lineno�i�keyrrr	rCs 

z_Printer.__call__N)rr)rrrr3r
r2rrrrrr	rs

	rc@seZdZdd�Zdd�ZdS)�_HelpercCsdS)NzHType help() for interactive help, or help(object) for help about object.rrrrr	rbsz_Helper.__repr__cOsddl}|j||�S)Nr)�pydoc�help)r�args�kwdsr?rrr	resz_Helper.__call__N)rrrrrrrrr	r>Xs
r>)r
�objectrrr>rrrr	�<module>s;__pycache__/hashlib.cpython-38.opt-1.pyc000064400000012457151153537560014001 0ustar00U

&�.e� �	@svdZdZee�Zee�ZedZddddddd	d
hZzddlmZ	Wne
k
r`d
d�Z	YnXe	�stiZdd�Zdd�Z
e	�s�ddd�Zddd�Zz ddlZeZe
Ze�ej�ZWn$e
k
r�e	�r΂eZeZYnXddlmZzddlmZWne
k
�rYnXeD]DZzee�e�e<Wn*ek
�rTddlZe�de�YnX�q[[[[[
e���sp[[	dS)a3hashlib module - A common interface to many hash functions.

new(name, data=b'', **kwargs) - returns a new hash object implementing the
                                given hash function; initializing the hash
                                using the given binary data.

Named constructor functions are also available, these are faster
than using new(name):

md5(), sha1(), sha224(), sha256(), sha384(), sha512(), blake2b(), blake2s(),
sha3_224, sha3_256, sha3_384, sha3_512, shake_128, and shake_256.

More algorithms may be available on your platform but the above are guaranteed
to exist.  See the algorithms_guaranteed and algorithms_available attributes
to find out what algorithm names can be passed to new().

NOTE: If you want the adler32 or crc32 hash functions they are available in
the zlib module.

Choose your hash function wisely.  Some have known collision weaknesses.
sha384 and sha512 will be slow on 32 bit platforms.

Hash objects have these methods:
 - update(data): Update the hash object with the bytes in data. Repeated calls
                 are equivalent to a single call with the concatenation of all
                 the arguments.
 - digest():     Return the digest of the bytes passed to the update() method
                 so far as a bytes object.
 - hexdigest():  Like digest() except the digest is returned as a string
                 of double length, containing only hexadecimal digits.
 - copy():       Return a copy (clone) of the hash object. This can be used to
                 efficiently compute the digests of datas that share a common
                 initial substring.

For example, to obtain the digest of the byte string 'Nobody inspects the
spammish repetition':

    >>> import hashlib
    >>> m = hashlib.md5()
    >>> m.update(b"Nobody inspects")
    >>> m.update(b" the spammish repetition")
    >>> m.digest()
    b'\xbbd\x9c\x83\xdd\x1e\xa5\xc9\xd9\xde\xc9\xa1\x8d\xf0\xff\xe9'

More condensed:

    >>> hashlib.sha224(b"Nobody inspects the spammish repetition").hexdigest()
    'a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2'

)�md5�sha1�sha224�sha256�sha384�sha512�blake2b�blake2s�sha3_224�sha3_256�sha3_384�sha3_512�	shake_128�	shake_256)�new�algorithms_guaranteed�algorithms_available�pbkdf2_hmacr	r
rrr
rrr�)�
get_fips_modecCsdS)Nr�rrr�/usr/lib64/python3.8/hashlib.py�_hashlib_get_fips_modeQsrc	Cs�t}|�|�}|dk	r|S�zB|dkrDddl}|j|d<|d<�n|dkrhddl}|j|d<|d<n�|dkr�ddl}|j|d	<|d
<|j|d<|d<n�|d
kr�ddl	}|j
|d<|d<|j|d<|d<n�|dkr�ddl}|j
|d<|j|d<nb|dk�r6ddl}|j|d<|j|d<|j|d<|j|d<n&|dk�r\ddl}|j|d<|j|d<Wntk
�rtYnX|�|�}|dk	�r�|Std|��dS)N>r�SHA1rrr>�MD5rrr>r�SHA224r�SHA256rrrr>r�SHA512�SHA384rrrrr>rrrr>rr	rr
r	r
rr>r
rr
rzunsupported hash type )�__builtin_constructor_cache�get�_sha1r�_md5r�_sha256rr�_sha512rr�_blake2rr�_sha3r	r
rrr
r�ImportError�
ValueError)	�name�cache�constructorr r!r"r#r$r%rrr�__get_builtin_constructorWsN









r+c	Cs^t�s|tkrt|�Sz"ttd|�}t��s4|�|WSttfk
rXt|�YSXdS)NZopenssl_)r�__block_openssl_constructorr+�getattr�_hashlibr�AttributeErrorr')r(�frrr�__get_openssl_constructor�sr1�cKst|�|f|�S)z�new(name, data=b'', **kwargs) - Return a new hashing object using the
        named algorithm; optionally initialized with data (which must be
        a bytes-like object).
        )r+�r(�data�kwargsrrr�__py_new�sr6cKsft��s |tkr t|�|f|�Sztj||f|�WStk
r`t��rL�t|�|f|�YSXdS)z�new(name, data=b'') - Return a new hashing object using the named algorithm;
    optionally initialized with data (which must be a bytes-like object).
    N)r.rr,r+rr'r3rrr�
__hash_new�sr7N)r)�scryptzcode for hash %s was not found.)r2)r2)�__doc__Z__always_supported�setrr�__all__r,r.rrr&rr+r1r6r7rZ
__get_hash�unionZopenssl_md_meth_namesrr8Z__func_name�globalsr'ZloggingZ	exceptionrrrr�<module>sh5�,

�

__pycache__/random.cpython-38.pyc000064400000047216151153537560012711 0ustar00U

e5d�p�@sdZddlmZddlmZmZm	Z
mZm
ZddlmZmZmZmZddlmZddlmZmZddlm Z!m"Z#ddl$m$Z%dd	lZ&zdd
l'm(Z'Wn e)k
r�dd
l*m(Z'YnXddd
ddddddddddddddddddd d!d"gZ+d#ed$�ed%�Z,d%e
Z-ed&�Z.d'ed(�Z/d)Z0d*e0Z1dd	l2Z2Gd+d�de2j3�Z3Gd,d"�d"e3�Z4d-d.�Z5d5d0d1�Z6e3�Z7e7j8Z8e7j9Z9e7j:Z:e7j;Z;e7j<Z<e7j=Z=e7j>Z>e7j?Z?e7j@Z@e7jAZAe7jBZBe7jCZCe7jDZDe7jEZEe7jFZFe7jGZGe7jHZHe7jIZIe7jJZJe7jKZKe7jLZLe7jMZMeNe&d2��re&jOe7j8d3�ePd4k�re6�d	S)6a�Random variable generators.

    integers
    --------
           uniform within range

    sequences
    ---------
           pick random element
           pick random sample
           pick weighted random sample
           generate random permutation

    distributions on the real line:
    ------------------------------
           uniform
           triangular
           normal (Gaussian)
           lognormal
           negative exponential
           gamma
           beta
           pareto
           Weibull

    distributions on the circle (angles 0 to 2pi)
    ---------------------------------------------
           circular uniform
           von Mises

General notes on the underlying Mersenne Twister core generator:

* The period is 2**19937-1.
* It is one of the most extensively tested generators in existence.
* The random() method is implemented in C, executes in a single Python step,
  and is, therefore, threadsafe.

�)�warn)�log�exp�pi�e�ceil)�sqrt�acos�cos�sin)�urandom)�Set�Sequence)�
accumulate�repeat)�bisectN)�sha512�Random�seed�random�uniform�randint�choice�sample�	randrange�shuffle�
normalvariate�lognormvariate�expovariate�vonmisesvariate�gammavariate�
triangular�gauss�betavariate�
paretovariate�weibullvariate�getstate�setstate�getrandbits�choices�SystemRandom�g��@�@��?�@�5�cs$eZdZdZdZd?dd�Zdd�Zd@�fd	d
�	Z�fdd�Z�fd
d�Z	dd�Z
dd�Zdd�Zdde
fdd�Zdd�Zdd�Ze
de>fdd�ZeZdd�ZdAd d!�Zd"d#�ZdBddd$�d%d&�Zd'd(�ZdCd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Z d;d<�Z!d=d>�Z"�Z#S)Dra�Random number generator base class used by bound module functions.

    Used to instantiate instances of Random to get generators that don't
    share state.

    Class Random can also be subclassed if you want to use a different basic
    generator of your own devising: in that case, override the following
    methods:  random(), seed(), getstate(), and setstate().
    Optionally, implement a getrandbits() method so that randrange()
    can cover arbitrarily large ranges.

    �NcCs|�|�d|_dS)zeInitialize an instance.

        Optional argument x controls seeding, as for Random.seed().
        N)r�
gauss_next)�self�x�r6�/usr/lib64/python3.8/random.py�__init__^s
zRandom.__init__cKsJ|jD]>}d|jkrqFd|jkr.|j|_qFd|jkr|j|_qFqdS)aControl how subclasses generate random integers.

        The algorithm a subclass can use depends on the random() and/or
        getrandbits() implementation available to it and determines
        whether it can generate random integers from arbitrarily large
        ranges.
        �
_randbelowr(rN)�__mro__�__dict__�_randbelow_with_getrandbitsr9�_randbelow_without_getrandbits)�cls�kwargs�cr6r6r7�__init_subclass__gs	



zRandom.__init_subclass__r1cs�|dkr�t|ttf�r�t|t�r*|�d�n|}|rBt|d�d>nd}tt|�D]}d||Ad@}qP|t|�N}|dkr~dn|}|d	kr�t|tttf�r�t|t�r�|��}|t	|��
�7}t�|d
�}t
��|�d|_dS)aInitialize internal state from hashable object.

        None or no argument seeds from current time or from an operating
        system specific randomness source if available.

        If *a* is an int, all bits are used.

        For version 2 (the default), all of the bits are used if *a* is a str,
        bytes, or bytearray.  For version 1 (provided for reproducing random
        sequences from older versions of Python), the algorithm for str and
        bytes generates a narrower range of seeds.

        �zlatin-1r�iCBl����������r1�bigN)�
isinstance�str�bytes�decode�ord�map�len�	bytearray�encode�_sha512Zdigest�int�
from_bytes�superrr3)r4�a�versionr5r@��	__class__r6r7r{s
zRandom.seedcs|jt���|jfS)z9Return internal state; can be passed to setstate() later.)�VERSIONrSr&r3�r4rVr6r7r&�szRandom.getstatec
s�|d}|dkr*|\}}|_t��|�nt|dkr�|\}}|_ztdd�|D��}Wn(tk
r|}z
t|�W5d}~XYnXt��|�ntd||jf��dS)z:Restore internal state from object returned by getstate().rr2r1css|]}|dVqdS)lNr6)�.0r5r6r6r7�	<genexpr>�sz"Random.setstate.<locals>.<genexpr>Nz?state with version %s passed to Random.setstate() of version %s)r3rSr'�tuple�
ValueError�	TypeErrorrX)r4�staterUZ
internalstaterrVr6r7r'�s�zRandom.setstatecCs|��S�N)r&rYr6r6r7�__getstate__�szRandom.__getstate__cCs|�|�dSr`)r')r4r_r6r6r7�__setstate__�szRandom.__setstate__cCs|jd|��fS)Nr6)rWr&rYr6r6r7�
__reduce__�szRandom.__reduce__rBc
Cs||�}||krtd��|dkr:|dkr2|�|�Std��||�}||krRtd��||}|dkrx|dkrx||�|�S|dkr�td|||f��||�}||kr�td��|dkr�||d|}	n"|dkr�||d|}	ntd	��|	dkr�td��|||�|	�S)
z�Choose a random item from range(start, stop[, step]).

        This fixes the problem with randint() which includes the
        endpoint; in Python this is usually not what you want.

        z!non-integer arg 1 for randrange()Nrzempty range for randrange()z non-integer stop for randrange()rBz(empty range for randrange() (%d, %d, %d)z non-integer step for randrange()zzero step for randrange())r]r9)
r4�start�stop�step�_intZistartZistop�widthZistep�nr6r6r7r�s4

zRandom.randrangecCs|�||d�S)zJReturn random integer in range [a, b], including both end points.
        rB)r�r4rT�br6r6r7r�szRandom.randintcCs,|j}|��}||�}||kr(||�}q|S)zCReturn a random int in the range [0,n).  Raises ValueError if n==0.)r(�
bit_length)r4rir(�k�rr6r6r7r<�s
z"Random._randbelow_with_getrandbitscCsn|j}||kr$td�||�|�S|dkr4td��||}|||}|�}||kr^|�}qN|||�|S)z�Return a random int in the range [0,n).  Raises ValueError if n==0.

        The implementation does not use getrandbits, but only random.
        z�Underlying random() generator does not supply 
enough bits to choose from a population range this large.
To remove the range limitation, add a getrandbits() method.rzBoundary cannot be zero)r�_warnr])r4rirQ�maxsizerZrem�limitrnr6r6r7r=sz%Random._randbelow_without_getrandbitscCs:z|�t|��}Wntk
r0td�d�YnX||S)z2Choose a random element from a non-empty sequence.z$Cannot choose from an empty sequenceN)r9rMr]�
IndexError)r4�seq�ir6r6r7rs
z
Random.choicecCs�|dkrN|j}ttdt|���D]*}||d�}||||||<||<q nHt}ttdt|���D]0}||�|d�}||||||<||<qddS)z�Shuffle list x in place, and return None.

        Optional argument random is a 0-argument function returning a
        random float in [0.0, 1.0); if it is the default None, the
        standard random.random will be used.

        NrB)r9�reversed�rangerMrQ)r4r5r�	randbelowrt�jrgr6r6r7r%s	zRandom.shufflecCst|t�rt|�}t|t�s$td��|j}t|�}d|krF|ksPntd��dg|}d}|dkr�|dtt	|dd��7}||kr�t
|�}t|�D]0}|||�}	||	||<|||d	||	<q�nHt�}
|
j
}t|�D]2}||�}	|	|
kr�||�}	q�||	�||	||<q�|S)
a=Chooses k unique random elements from a population sequence or set.

        Returns a new list containing elements from the population while
        leaving the original population unchanged.  The resulting list is
        in selection order so that all sub-slices will also be valid random
        samples.  This allows raffle winners (the sample) to be partitioned
        into grand prize and second place winners (the subslices).

        Members of the population need not be hashable or unique.  If the
        population contains repeats, then each occurrence is a possible
        selection in the sample.

        To choose a sample in a range of integers, use range as an argument.
        This is especially fast and space efficient for sampling from a
        large population:   sample(range(10000000), 60)
        z>Population must be a sequence or set.  For dicts, use list(d).rz,Sample larger than population or is negativeN��r+r2rB)rG�_Setr\�	_Sequencer^r9rMr]�_ceil�_log�listrv�set�add)r4�
populationrmrwri�resultZsetsizeZpoolrtrxZselectedZselected_addr6r6r7r;s6)



z
Random.sample)�cum_weightsrmcs�|j�t����dkrV|dkrHt��d7�����fdd�td|�D�Stt|���n|dk	rftd��t���krztd��t��dd��d�������fd	d�td|�D�S)
z�Return a k sized list of population elements chosen with replacement.

        If the relative weights or cumulative weights are not specified,
        the selections are made with equal probability.

        N�csg|]}�������qSr6r6�rZrt)rgrir�rr6r7�
<listcomp>�sz"Random.choices.<locals>.<listcomp>z2Cannot specify both weights and cumulative weightsz3The number of weights does not match the populationrDrBcs$g|]}������d���qS)rr6r�)rr��hir�r�totalr6r7r��s�)	rrMrQ�_repeatr�_accumulater^r]�_bisect)r4r�Zweightsr�rmr6)rgrr�r�rir�rr�r7r)�s$�zRandom.choicescCs||||��S)zHGet a random number in the range [a, b) or [a, b] depending on rounding.�rrjr6r6r7r�szRandom.uniformr�r.cCs||��}z |dkrdn||||}Wntk
r@|YSX||krdd|}d|}||}}|||t||�S)z�Triangular distribution.

        Continuous distribution bounded by given lower and upper limits,
        and having a given mode value in-between.

        http://en.wikipedia.org/wiki/Triangular_distribution

        N��?r.)r�ZeroDivisionError�_sqrt)r4ZlowZhigh�mode�ur@r6r6r7r!�s	 

zRandom.triangularcCsP|j}|�}d|�}t|d|}||d}|t|�krqDq|||S)z\Normal distribution.

        mu is the mean, and sigma is the standard deviation.

        r.r�r-)r�
NV_MAGICCONSTr~)r4�mu�sigmar�u1�u2�zZzzr6r6r7r�s

zRandom.normalvariatecCst|�||��S)z�Log normal distribution.

        If you take the natural logarithm of this distribution, you'll get a
        normal distribution with mean mu and standard deviation sigma.
        mu can have any value, and sigma must be greater than zero.

        )�_expr)r4r�r�r6r6r7r�szRandom.lognormvariatecCstd|���|S)a^Exponential distribution.

        lambd is 1.0 divided by the desired mean.  It should be
        nonzero.  (The parameter would be called "lambda", but that is
        a reserved word in Python.)  Returned values range from 0 to
        positive infinity if lambd is positive, and from negative
        infinity to 0 if lambd is negative.

        r.)r~r)r4Zlambdr6r6r7r�szRandom.expovariatecCs�|j}|dkrt|�Sd|}|td||�}|�}tt|�}|||}|�}	|	d||ks�|	d|t|�kr4q�q4d|}
|
|d|
|}|�}|dkr�|t|�t}
n|t|�t}
|
S)aFCircular data distribution.

        mu is the mean angle, expressed in radians between 0 and 2*pi, and
        kappa is the concentration parameter, which must be greater than or
        equal to zero.  If kappa is equal to zero, this distribution reduces
        to a uniform random angle over the range 0 to 2*pi.

        g���ư>r�r.)r�TWOPIr��_cos�_pir��_acos)r4r�Zkappar�srnr�r��dr��q�fZu3Zthetar6r6r7r�s$
$zRandom.vonmisesvariatecCs~|dks|dkrtd��|j}|dkr�td|d�}|t}||}|�}d|kr`dksdqFqFd|�}t|d|�|}	|t|	�}
|||}|||	|
}|td|dks�|t|�krF|
|SqFn�|dkr�td|��|S|�}
t|t}||
}|dk�r$|d|}
nt|||�}
|�}|dk�r^||
|dk�rp�qrq�|t|
�kr�qrq�|
|SdS)	aZGamma distribution.  Not the gamma function!

        Conditions on the parameters are alpha > 0 and beta > 0.

        The probability distribution function is:

                    x ** (alpha - 1) * math.exp(-x / beta)
          pdf(x) =  --------------------------------------
                      math.gamma(alpha) * beta ** alpha

        r�z*gammavariate: alpha and beta must be > 0.0r.r,gH�����z>g�P���?r/N)r]rr��LOG4r~r��
SG_MAGICCONST�_e)r4�alpha�betarZainvZbbbZcccr�r��vr5r�rnr�rk�pr6r6r7r #s@
 

zRandom.gammavariatecCs`|j}|j}d|_|dkrT|�t}tdtd|���}t|�|}t|�||_|||S)z�Gaussian distribution.

        mu is the mean, and sigma is the standard deviation.  This is
        slightly faster than the normalvariate() function.

        Not thread-safe without a lock around calls.

        Ng�r.)rr3r�r�r~r��_sin)r4r�r�rr�Zx2piZg2radr6r6r7r"hs
zRandom.gausscCs0|�|d�}|dkrdS|||�|d�SdS)z�Beta distribution.

        Conditions on the parameters are alpha > 0 and beta > 0.
        Returned values range between 0 and 1.

        r.rr�N)r )r4r�r��yr6r6r7r#�s
zRandom.betavariatecCsd|��}d|d|S)z3Pareto distribution.  alpha is the shape parameter.r.r�)r4r�r�r6r6r7r$�szRandom.paretovariatecCs"d|��}|t|�d|S)zfWeibull distribution.

        alpha is the scale parameter and beta is the shape parameter.

        r.)rr~)r4r�r�r�r6r6r7r%�szRandom.weibullvariate)N)Nr1)N)N)r�r.N)$�__name__�
__module__�__qualname__�__doc__rXr8rArr&r'rarbrcrQrrr<�BPFr=r9rrrr)rr!rrrrr r"r#r$r%�
__classcell__r6r6rVr7rNs<

	 ,

G
0E5	c@s8eZdZdZdd�Zdd�Zdd�Zdd	�ZeZZ	d
S)r*z�Alternate random number generator using sources provided
    by the operating system (such as /dev/urandom on Unix or
    CryptGenRandom on Windows).

     Not available on all systems (see os.urandom() for details).
    cCst�td�d�d?tS)z3Get the next random number in the range [0.0, 1.0).rCrFr2)rQrR�_urandom�	RECIP_BPFrYr6r6r7r�szSystemRandom.randomcCs<|dkrtd��|dd}t�t|�d�}||d|?S)z:getrandbits(k) -> x.  Generates an int with k random bits.rz(number of bits must be greater than zerorC�rF)r]rQrRr�)r4rmZnumbytesr5r6r6r7r(�s
zSystemRandom.getrandbitscOsdS)z<Stub method.  Not used for a system random number generator.Nr6�r4�args�kwdsr6r6r7r�szSystemRandom.seedcOstd��dS)zAMethod should not be called for a system random number generator.z*System entropy source does not have state.N)�NotImplementedErrorr�r6r6r7�_notimplemented�szSystemRandom._notimplementedN)
r�r�r�r�rr(rr�r&r'r6r6r6r7r*�scCs�ddl}t|d|j�d}d}d}d}|��}t|�D]4}	||�}
||
7}||
|
}t|
|�}t|
|�}q6|��}tt||d�ddd	�||}t||||�}
td
||
||f�dS)Nr�timesr�g _�Bg _��r2zsec,� )�endz"avg %g, stddev %g, min %g, max %g
)	�time�printr��perf_counterrv�min�max�roundr�)ri�funcr�r�r�ZsqsumZsmallestZlargestZt0rtr5�t1ZavgZstddevr6r6r7�_test_generator�s(

�r���cCs�t|td�t|td�t|td�t|td�t|td�t|td�t|td�t|td�t|td�t|td�t|td	�t|td
�t|td�t|td�t|td�t|td
�dS)Nr6)r�r.)g{�G�z�?r.)皙�����?r.)r�r,)r�r.)g�������?r.)r.r.)r,r.)g4@r.)gi@r.)�@r�)r�r.gUUUUUU�?)	r�rrrrr r"r#r!)�Nr6r6r7�_test�s r��fork)Zafter_in_child�__main__)r�)Qr��warningsrroZmathrr~rr�rr�rr�rr}rr�r	r�r
r�rr��osrr��_collections_abcr
r{rr|�	itertoolsrr�rr�rr��_osrPr�ImportErrorZhashlib�__all__r�r�r�r�r�r�Z_randomrr*r�r�Z_instrrrr!rrrrrr)rrrrr r"r#r$r%r&r'r(�hasattr�register_at_forkr�r6r6r6r7�<module>s�'�
{

__pycache__/smtplib.cpython-38.opt-1.pyc000064400000105434151153537560014037 0ustar00U

e5dɯ�
@srdZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
mZdddddd	d
ddd
dddg
ZdZdZdZdZdZdZe�dej�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd	�d	e�Z Gdd
�d
e�Z!Gdd�de�Z"Gd d�de�Z#Gd!d
�d
e�Z$d"d�Z%d#d$�Z&d%d�Z'd&d'�Z(d(d)�Z)zddl*Z*Wne+k
�r�d*Z,YnXd+Z,Gd,d�d�Z-e,�r�Gd-d.�d.e-�Z.e�/d.�d/Z0Gd0d1�d1e-�Z1e2d2k�rnd3d4�Z3e3d5�Z4e3d6��5d7�Z6e7d8�d9Z8ej9�:�Z;e;�s*�q6e8e;Z8�qe7d:e<e8��e-d;�Z=e=�>d<�e=�?e4e6e8�e=�@�dS)=aSMTP/ESMTP client class.

This should follow RFC 821 (SMTP), RFC 1869 (ESMTP), RFC 2554 (SMTP
Authentication) and RFC 2487 (Secure SMTP over TLS).

Notes:

Please remember, when doing ESMTP, that the names of the SMTP service
extensions are NOT the same thing as the option keywords for the RCPT
and MAIL commands!

Example:

  >>> import smtplib
  >>> s=smtplib.SMTP("localhost")
  >>> print(s.help())
  This is Sendmail version 8.8.4
  Topics:
      HELO    EHLO    MAIL    RCPT    DATA
      RSET    NOOP    QUIT    HELP    VRFY
      EXPN    VERB    ETRN    DSN
  For more info use "HELP <topic>".
  To report bugs in the implementation send email to
      sendmail-bugs@sendmail.org.
  For local information send email to Postmaster at your site.
  End of HELP info
  >>> s.putcmd("vrfy","someone@here")
  >>> s.getreply()
  (250, "Somebody OverHere <somebody@here.my.org>")
  >>> s.quit()
�N)�body_encode�
SMTPException�SMTPNotSupportedError�SMTPServerDisconnected�SMTPResponseException�SMTPSenderRefused�SMTPRecipientsRefused�
SMTPDataError�SMTPConnectError�
SMTPHeloError�SMTPAuthenticationError�	quoteaddr�	quotedata�SMTP�i��
s
i �z	auth=(.*)c@seZdZdZdS)rz4Base class for all exceptions raised by this module.N��__name__�
__module__�__qualname__�__doc__�rr�/usr/lib64/python3.8/smtplib.pyrHsc@seZdZdZdS)rz�The command or option is not supported by the SMTP server.

    This exception is raised when an attempt is made to run a command or a
    command with an option which is not supported by the server.
    NrrrrrrKsc@seZdZdZdS)rz�Not connected to any SMTP server.

    This exception is raised when the server unexpectedly disconnects,
    or when an attempt is made to use the SMTP instance before
    connecting it to a server.
    NrrrrrrRsc@seZdZdZdd�ZdS)ra2Base class for all exceptions that include an SMTP error code.

    These exceptions are generated in some instances when the SMTP
    server returns an error code.  The error code is stored in the
    `smtp_code' attribute of the error, and the `smtp_error' attribute
    is set to the error message.
    cCs||_||_||f|_dS�N)�	smtp_code�
smtp_error�args)�self�code�msgrrr�__init__cszSMTPResponseException.__init__N�rrrrr!rrrrrZsc@seZdZdZdd�ZdS)rz�Sender address refused.

    In addition to the attributes set by on all SMTPResponseException
    exceptions, this sets `sender' to the string that the SMTP refused.
    cCs"||_||_||_|||f|_dSr)rr�senderr)rrr r#rrrr!oszSMTPSenderRefused.__init__Nr"rrrrrhsc@seZdZdZdd�ZdS)rz�All recipient addresses refused.

    The errors for each recipient are accessible through the attribute
    'recipients', which is a dictionary of exactly the same sort as
    SMTP.sendmail() returns.
    cCs||_|f|_dSr)�
recipientsr)rr$rrrr!}szSMTPRecipientsRefused.__init__Nr"rrrrrusc@seZdZdZdS)r	z'The SMTP server didn't accept the data.Nrrrrrr	�sc@seZdZdZdS)r
z&Error during connection establishment.Nrrrrrr
�sc@seZdZdZdS)rz"The server refused our HELO reply.Nrrrrrr�sc@seZdZdZdS)rzvAuthentication error.

    Most probably the server didn't accept the username/password
    combination provided.
    Nrrrrrr�scCs>tj�|�\}}||fdkr6|���d�r.|Sd|Sd|S)z�Quote a subset of the email addresses defined by RFC 821.

    Should be able to handle anything email.utils.parseaddr can handle.
    ��r&�<z<%s>)�email�utils�	parseaddr�strip�
startswith�Z
addrstringZdisplayname�addrrrrr
�scCs$tj�|�\}}||fdkr |S|S)Nr%)r(r)r*r-rrr�
_addr_only�sr/c	Cst�ddt�dt|��S)z�Quote data for email.

    Double leading '.', and change Unix newline '\n', or Mac '\r' into
    Internet CRLF end-of-line.
    z(?m)^\.z..�(?:\r\n|\n|\r(?!\n))��re�sub�CRLF��datarrrr�s�cCst�dd|�S)Ns(?m)^\.s..)r2r3)Zbindatarrr�_quote_periods�sr7cCst�dt|�S)Nr0r1r5rrr�	_fix_eols�sr8FTc@szeZdZdZdZdZdZdZdZdZ	dZ
eZddde
jdfdd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�ZdNdd�Zdd�ZdOdd�Zdd�ZdPdd�ZdQdd�ZdRdd �Zd!d"�ZdSd#d$�Zd%d&�Zd'd(�Zd)d*�Z dTd,d-�Z!dUd.d/�Z"d0d1�Z#d2d3�Z$e$Z%d4d5�Z&d6d7�Z'd8d9�d:d;�Z(dVd<d=�Z)dWd>d?�Z*dXd@dA�Z+d8d9�dBdC�Z,dYdDdE�Z-dZdFdG�Z.d[dHdI�Z/dJdK�Z0dLdM�Z1dS)\ra�This class manages a connection to an SMTP or ESMTP server.
    SMTP Objects:
        SMTP objects have the following attributes:
            helo_resp
                This is the message given by the server in response to the
                most recent HELO command.

            ehlo_resp
                This is the message given by the server in response to the
                most recent EHLO command. This is usually multiline.

            does_esmtp
                This is a True value _after you do an EHLO command_, if the
                server supports ESMTP.

            esmtp_features
                This is a dictionary, which, if the server supports ESMTP,
                will _after you do an EHLO command_, contain the names of the
                SMTP service extensions this server supports, and their
                parameters (if any).

                Note, all extension names are mapped to lower case in the
                dictionary.

        See each method's docstrings for details.  In general, there is a
        method of the same name to perform each SMTP command.  There is also a
        method called 'sendmail' that will do an entire mail transaction.
        rN�ehlor&c
Cs�||_||_i|_d|_||_d|_|rR|�||�\}}|dkrR|��t||��|dk	rb||_	nPt
��}d|krz||_	n8d}	zt
�t
�
��}	Wnt
jk
r�YnXd|	|_	dS)aInitialize a new instance.

        If specified, `host` is the name of the remote host to which to
        connect.  If specified, `port` specifies the port to which to connect.
        By default, smtplib.SMTP_PORT is used.  If a host is specified the
        connect method is called, and if it returns anything other than a
        success code an SMTPConnectError is raised.  If specified,
        `local_hostname` is used as the FQDN of the local host in the HELO/EHLO
        command.  Otherwise, the local hostname is found using
        socket.getfqdn(). The `source_address` parameter takes a 2-tuple (host,
        port) for the socket to bind to as its source address before
        connecting. If the host is '' and port is 0, the OS default behavior
        will be used.

        �asciir��N�.z	127.0.0.1z[%s])�_host�timeout�esmtp_features�command_encoding�source_address�_auth_challenge_count�connect�closer
�local_hostname�socketZgetfqdnZ
gethostbynameZgethostnameZgaierror)
r�host�portrEr>rArr Zfqdnr.rrrr!�s,
z
SMTP.__init__cCs|Srr�rrrr�	__enter__szSMTP.__enter__cGsNz>z$|�d�\}}|dkr$t||��Wntk
r:YnXW5|��XdS)NZQUIT��)rD�docmdrr)rrr�messagerrr�__exit__s
z
SMTP.__exit__cCs
||_dS)z�Set the debug output level.

        A non-false value results in debug messages for connection and for all
        messages sent to and received from the server.

        N)�
debuglevel)rrOrrr�set_debuglevel"szSMTP.set_debuglevelcGs@|jdkr,ttj����f|�dtji�nt|dtji�dS)N��file)rO�print�datetimeZnow�time�sys�stderr�rrrrr�_print_debug+s
"zSMTP._print_debugcCs2|jdkr|�d||f|j�t�||f||j�S)Nrzconnect: to)rOrYrArF�create_connection)rrGrHr>rrr�_get_socket1s

�zSMTP._get_socket�	localhostcCs�|r
||_|s||�d�|�d�kr||�d�}|dkr||d|�||dd�}}zt|�}Wntk
rztd��YnX|s�|j}t�d|||�|�	|||j
�|_d|_|�
�\}}|jdkr�|�dt|��||fS)apConnect to a host on a given port.

        If the hostname ends with a colon (`:') followed by a number, and
        there is no port specified, that suffix will be stripped off and the
        number interpreted as the port number to use.

        Note: This method is automatically invoked by __init__, if a host is
        specified during instantiation.

        �:rNrQznonnumeric portzsmtplib.connect�connect:)rA�find�rfind�int�
ValueError�OSError�default_portrV�auditr[r>�sockrR�getreplyrOrY�repr)rrGrHrA�irr rrrrC9s&

zSMTP.connectcCs�|jdkr|�dt|��|jr|t|t�r6|�|j�}t�	d||�z|j�
|�Wq�tk
rx|��t
d��Yq�Xnt
d��dS)zSend `s' to the server.rzsend:zsmtplib.send�Server not connectedzplease run connect() firstN)rOrYrhrf�
isinstance�str�encoder@rVreZsendallrcrDr)r�srrr�sendZs

z	SMTP.sendcCsd|dkr|}n|�d|��}d|ks,d|krN|�dd��dd�}td|����|�|�t���dS)	zSend a command to the server.r&� �
�
z\nz\rz=command and arguments contain prohibited newline characters: N)�replacerbror4)r�cmdrrnrrr�putcmdms�zSMTP.putcmdc
CsPg}|jdkr|j�d�|_z|j�td�}Wn:tk
rj}z|��tdt|���W5d}~XYnX|s�|��td��|j	dkr�|�
dt|��t|�tkr�|��t
dd	��|�|d
d��d��|dd�}zt|�}Wn tk
�rd
}Y�q YnX|dd
�dkr�q qd�|�}|j	dk�rH|�
d||f�||fS)a�Get a reply from the server.

        Returns a tuple consisting of:

          - server response code (e.g. '250', or such, if all goes well)
            Note: returns -1 if it can't read response code.

          - server response string corresponding to response code (multiline
            responses are converted to a single, multiline string).

        Raises SMTPServerDisconnected if end-of-file is reached.
        N�rbrQz Connection unexpectedly closed: zConnection unexpectedly closedrzreply:i�zLine too long.�s 	
�����-�
zreply: retcode (%s); Msg: %a)rRrfZmakefile�readline�_MAXLINErcrDrrlrOrYrh�lenr�appendr+rarb�join)r�resp�line�erZerrcode�errmsgrrrrgzs>

�


z
SMTP.getreplycCs|�||�|��S)z-Send a command, and return its response code.�rurg)rrtrrrrrL�sz
SMTP.docmdcCs,|�d|p|j�|��\}}||_||fS)zwSMTP 'helo' command.
        Hostname to send for this command defaults to the FQDN of the local
        host.
        �helo)rurErg�	helo_resp)r�namerr rrrr��sz	SMTP.heloc
Cs.i|_|�|j|p|j�|��\}}|dkrJt|�dkrJ|��td��||_|dkr`||fSd|_	|j�
d��d�}|d=|D]�}t�
|�}|r�|j�dd	�d
|�d�d|jd<q�t�
d|�}|r�|�d���}|j|�d�d
���}	|dk�r|j�|d	�d
|	|j|<q�|	|j|<q�||fS)zx SMTP 'ehlo' command.
        Hostname to send for this command defaults to the FQDN of the local
        host.
        ryrrj�rQzlatin-1rr�authr&rpz((?P<feature>[A-Za-z0-9][A-Za-z0-9\-]*) ?�featureN)r?ru�ehlo_msgrErgr~rDr�	ehlo_resp�
does_esmtp�decode�split�
OLDSTYLE_AUTH�match�get�groupsr2�group�lower�string�endr+)
rr�rr r��eachZ
auth_match�mr�Zparamsrrrr9�sB
��

��z	SMTP.ehlocCs|��|jkS)z7Does the server support a given SMTP service extension?)r�r?)r�optrrr�has_extn�sz
SMTP.has_extncCs|�d|�|��dS)z;SMTP 'help' command.
        Returns help text from server.�helprQr�rXrrrr��sz	SMTP.helpcCsd|_|�d�S)z&SMTP 'rset' command -- resets session.r:�rset)r@rLrIrrrr��sz	SMTP.rsetcCs&z|��Wntk
r YnXdS)aInternal 'rset' command which ignores any SMTPServerDisconnected error.

        Used internally in the library, since the server disconnected error
        should appear to the application when the *next* command is issued, if
        we are doing an internal "safety" reset.
        N)r�rrIrrr�_rset�sz
SMTP._rsetcCs
|�d�S)z-SMTP 'noop' command -- doesn't do anything :>�noop)rLrIrrrr�	sz	SMTP.nooprcCshd}|rH|jrHtdd�|D��r:|�d�r2d|_ntd��dd�|�}|�dd	t|�|f�|��S)
a8SMTP 'mail' command -- begins mail xfer session.

        This method may raise the following exceptions:

         SMTPNotSupportedError  The options parameter includes 'SMTPUTF8'
                                but the SMTPUTF8 extension is not supported by
                                the server.
        r&css|]}|��dkVqdS)�smtputf8N)r�)�.0�xrrr�	<genexpr>szSMTP.mail.<locals>.<genexpr>r�zutf-8z SMTPUTF8 not supported by serverrp�mailz	FROM:%s%s)	r��anyr�r@rr�rur
rg)rr#�options�
optionlistrrrr�
s	

�z	SMTP.mailcCs<d}|r|jrdd�|�}|�ddt|�|f�|��S)z;SMTP 'rcpt' command -- indicates 1 recipient for this mail.r&rp�rcptzTO:%s%s)r�r�rur
rg)rZrecipr�r�rrrr�"s

z	SMTP.rcptcCs�|�d�|��\}}|jdkr0|�d||f�|dkrDt||��n|t|t�r\t|��d�}t	|�}|dd�t
kr||t
}|dt
}|�|�|��\}}|jdkr�|�d||f�||fSdS)	a�SMTP 'DATA' command -- sends message data to server.

        Automatically quotes lines beginning with a period per rfc821.
        Raises SMTPDataError if there is an unexpected reply to the
        DATA command; the return value from this method is the final
        response code received when the all data is sent.  If msg
        is a string, lone '\r' and '\n' characters are converted to
        '\r\n' characters.  If msg is bytes, it is transmitted as is.
        r6rzdata:ibr:���N�.)rurgrOrYr	rkrlr8rmr7�bCRLFro)rr r�repl�qrrrr6*s"





z	SMTP.datacCs|�dt|��|��S)z5SMTP 'verify' command -- checks for address validity.�vrfy�rur/rg�rZaddressrrr�verifyGszSMTP.verifycCs|�dt|��|��S)z.SMTP 'expn' command -- expands a mailing list.�expnr�r�rrrr�Nsz	SMTP.expncCsb|jdkr^|jdkr^d|��dkr0dks^n|��\}}d|krRdks^nt||��dS)abCall self.ehlo() and/or self.helo() if needed.

        If there has been no previous EHLO or HELO command this session, this
        method tries ESMTP EHLO first.

        This method may raise the following exceptions:

         SMTPHeloError            The server didn't reply properly to
                                  the helo greeting.
        N��ri+)r�r�r9r�r)rrr�rrr�ehlo_or_helo_if_neededUs
zSMTP.ehlo_or_helo_if_neededT��initial_response_okc	Cs�|��}|r|�nd}|dk	rPt|�d�dd�}|�d|d|�\}}d|_n|�d|�\}}d|_|d	kr�|jd7_t�|�}t||��d�dd�}|�|�\}}|jtkrftd
t	||f���qf|dkr�||fSt
||��dS)a�Authentication command - requires response processing.

        'mechanism' specifies which authentication mechanism is to
        be used - the valid values are those listed in the 'auth'
        element of 'esmtp_features'.

        'authobject' must be a callable object taking a single argument:

                data = authobject(challenge)

        It will be called to process the server's challenge response; the
        challenge argument it is passed will be a bytes.  It should return
        an ASCII string that will be base64 encoded and sent to the server.

        Keyword arguments:
            - initial_response_ok: Allow sending the RFC 4954 initial-response
              to the AUTH command, if the authentication methods supports it.
        Nr:r&)ZeolZAUTHrprQriNz4Server AUTH mechanism infinite loop. Last response: ���i�)�upper�
encode_base64rmrLrB�base64Zdecodebytes�
_MAXCHALLENGErrhr)	rZ	mechanismZ
authobjectr�Zinitial_responseZresponserr��	challengerrrr�fs2
�

��z	SMTP.authcCs0|dkrdS|jdt�|j�d�|d���S)zh Authobject to use with CRAM-MD5 authentication. Requires self.user
        and self.password to be set.Nrpr:Zmd5)�user�hmacZHMAC�passwordrmZ	hexdigest�rr�rrr�
auth_cram_md5�s
�zSMTP.auth_cram_md5cCsd|j|jfS)ze Authobject to use with PLAIN authentication. Requires self.user and
        self.password to be set.z%s%s)r�r�r�rrr�
auth_plain�szSMTP.auth_plaincCs"|dks|jdkr|jS|jSdS)ze Authobject to use with LOGIN authentication. Requires self.user and
        self.password to be set.N�)rBr�r�r�rrr�
auth_login�szSMTP.auth_logincs�|��|�d�std��|jd���dddg}�fdd�|D�}|sPtd��|||_|_|D]t}d	|���	d
d�}z4|j
|t||�|d�\}}	|d
kr�||	fWSWqbtk
r�}
z|
}W5d}
~
XYqbXqb|�dS)awLog in on an SMTP server that requires authentication.

        The arguments are:
            - user:         The user name to authenticate with.
            - password:     The password for the authentication.

        Keyword arguments:
            - initial_response_ok: Allow sending the RFC 4954 initial-response
              to the AUTH command, if the authentication methods supports it.

        If there has been no previous EHLO or HELO command this session, this
        method tries ESMTP EHLO first.

        This method will return normally if the authentication was successful.

        This method may raise the following exceptions:

         SMTPHeloError            The server didn't reply properly to
                                  the helo greeting.
         SMTPAuthenticationError  The server didn't accept the username/
                                  password combination.
         SMTPNotSupportedError    The AUTH command is not supported by the
                                  server.
         SMTPException            No suitable authentication method was
                                  found.
        r�z,SMTP AUTH extension not supported by server.zCRAM-MD5ZPLAINZLOGINcsg|]}|�kr|�qSrr)r�r��Zadvertised_authlistrr�
<listcomp>�s�zSMTP.login.<locals>.<listcomp>z(No suitable authentication method found.Zauth_�-�_r�r�N)
r�r�rr?r�rr�r�r�rsr��getattrr)rr�r�r�Zpreferred_authsZauthlistZ
authmethodZmethod_namerr�r�Zlast_exceptionrr�r�login�s0
�
�
z
SMTP.logincCs�|��|�d�std��|�d�\}}|dkr�ts<td��|dk	rT|dk	rTtd��|dk	rl|dk	rltd��|dk	s||dk	r�d	dl}|�d
t	d�|dkr�t
j||d�}|j|j
|jd
�|_
d|_d|_d|_i|_d	|_n
t||��||fS)a�Puts the connection to the SMTP server into TLS mode.

        If there has been no previous EHLO or HELO command this session, this
        method tries ESMTP EHLO first.

        If the server supports TLS, this will encrypt the rest of the SMTP
        session. If you provide the keyfile and certfile parameters,
        the identity of the SMTP server and client can be checked. This,
        however, depends on whether the socket module really checks the
        certificates.

        This method may raise the following exceptions:

         SMTPHeloError            The server didn't reply properly to
                                  the helo greeting.
        �starttlsz+STARTTLS extension not supported by server.ZSTARTTLSr;z&No SSL support included in this PythonN�4context and keyfile arguments are mutually exclusive�5context and certfile arguments are mutually exclusiver�Akeyfile and certfile are deprecated, use a custom context insteadr���certfile�keyfile�Zserver_hostname)r�r�rrL�	_have_ssl�RuntimeErrorrb�warnings�warn�DeprecationWarning�ssl�_create_stdlib_context�wrap_socketrfr=rRr�r�r?r�r)rr�r��contextr�Zreplyr�rrrr��sB
����
z
SMTP.starttlscCs^|��g}t|t�r$t|��d�}|jrZ|�d�rF|�dt|��|D]}|�|�qJ|�	||�\}}	|dkr�|dkr�|�
�n|��t||	|��i}
t|t�r�|g}|D]H}|�
||�\}}	|dkr�|dkr�||	f|
|<|dkr�|�
�t|
��q�t|
�t|�k�r|��t|
��|�|�\}}	|dk�rZ|dk�rH|�
�n|��t||	��|
S)a|This command performs an entire mail transaction.

        The arguments are:
            - from_addr    : The address sending this mail.
            - to_addrs     : A list of addresses to send this mail to.  A bare
                             string will be treated as a list with 1 address.
            - msg          : The message to send.
            - mail_options : List of ESMTP options (such as 8bitmime) for the
                             mail command.
            - rcpt_options : List of ESMTP options (such as DSN commands) for
                             all the rcpt commands.

        msg may be a string containing characters in the ASCII range, or a byte
        string.  A string is encoded to bytes using the ascii codec, and lone
        \r and \n characters are converted to \r\n characters.

        If there has been no previous EHLO or HELO command this session, this
        method tries ESMTP EHLO first.  If the server does ESMTP, message size
        and each of the specified options will be passed to it.  If EHLO
        fails, HELO will be tried and ESMTP options suppressed.

        This method will return normally if the mail is accepted for at least
        one recipient.  It returns a dictionary, with one entry for each
        recipient that was refused.  Each entry contains a tuple of the SMTP
        error code and the accompanying error message sent by the server.

        This method may raise the following exceptions:

         SMTPHeloError          The server didn't reply properly to
                                the helo greeting.
         SMTPRecipientsRefused  The server rejected ALL recipients
                                (no mail was sent).
         SMTPSenderRefused      The server didn't accept the from_addr.
         SMTPDataError          The server replied with an unexpected
                                error code (other than a refusal of
                                a recipient).
         SMTPNotSupportedError  The mail_options parameter includes 'SMTPUTF8'
                                but the SMTPUTF8 extension is not supported by
                                the server.

        Note: the connection will be open even after an exception is raised.

        Example:

         >>> import smtplib
         >>> s=smtplib.SMTP("localhost")
         >>> tolist=["one@one.org","two@two.org","three@three.org","four@four.org"]
         >>> msg = '''\
         ... From: Me@my.org
         ... Subject: testin'...
         ...
         ... This is a test '''
         >>> s.sendmail("me@my.org",tolist,msg)
         { "three@three.org" : ( 550 ,"User unknown" ) }
         >>> s.quit()

        In the above example, the message was accepted for delivery to three
        of the four addresses, and one was rejected, with the error code
        550.  If all addresses are accepted, then the method will return an
        empty dictionary.

        r:�sizezsize=%dr�i��)r�rkrlr8rmr�r�rr~r�rDr�rr�rr6r	)r�	from_addr�to_addrsr �mail_options�rcpt_optionsZ
esmtp_optsZoptionrr�Zsenderrsr�rrr�sendmail&sF@








z
SMTP.sendmailc	Cs�|��|�d�}|dkr d}nt|�dkr2d}ntd��|dkr||d|krZ||dn
||d}tj�|g�d	d}|dkr�d
d�||d||d
||dfD�}dd�tj�|�D�}t�|�}	|	d
=|	d=d}
zd�|f|���	d�Wn.t
k
�r(|�d��s td��d}
YnXt
���R}|
�r^tjj||jjdd�d�}|d�}ntj�|�}|j|	dd�|��}
W5QRX|�|||
||�S)a~Converts message to a bytestring and passes it to sendmail.

        The arguments are as for sendmail, except that msg is an
        email.message.Message object.  If from_addr is None or to_addrs is
        None, these arguments are taken from the headers of the Message as
        described in RFC 2822 (a ValueError is raised if there is more than
        one set of 'Resent-' headers).  Regardless of the values of from_addr and
        to_addr, any Bcc field (or Resent-Bcc field, when the Message is a
        resent) of the Message object won't be transmitted.  The Message
        object is then serialized using email.generator.BytesGenerator and
        sendmail is called to transmit the message.  If the sender or any of
        the recipient addresses contain non-ASCII and the server advertises the
        SMTPUTF8 capability, the policy is cloned with utf8 set to True for the
        serialization, and SMTPUTF8 and BODY=8BITMIME are asserted on the send.
        If the server does not support SMTPUTF8, an SMTPNotSupported error is
        raised.  Otherwise the generator is called without modifying the
        policy.

        zResent-DateNr&rQzResent-z0message has more than one 'Resent-' header blockZSender�FromrcSsg|]}|dk	r|�qSrr)r��frrrr��s�z%SMTP.send_message.<locals>.<listcomp>�ToZBccZCccSsg|]}|d�qS)rQr)r��arrrr��sz
Resent-BccFr:r�z�One or more source or delivery addresses require internationalized email support, but the server does not advertise the required SMTPUTF8 capabilityT)�utf8)�policy�SMTPUTF8�
BODY=8BITMIMEr)�linesep)r�r�)r�Zget_allr~rbr(r)Zgetaddresses�copyr�rm�UnicodeEncodeErrorr�r�io�BytesIO�	generatorZBytesGeneratorr�ZcloneZflatten�getvaluer�)rr r�r�r�r�ZresentZ
header_prefixZaddr_fieldsZmsg_copyZ
internationalZbytesmsg�gZflatmsgrrr�send_message�sX

�
�

�
�

�
�zSMTP.send_messagecCs<z|j}d|_|r|��W5|j}d|_|r6|��XdS)z(Close the connection to the SMTP server.N)rfrDrR)rrfrRrrrrD�sz
SMTP.closecCs.|�d�}d|_|_i|_d|_|��|S)zTerminate the SMTP session.�quitNF)rLr�r�r?r�rD)r�resrrrr��s
z	SMTP.quit)r\rN)r&)r&)r&)r&)r&)r)r)N)N)N)NNN)rr)NNrr)2rrrrrOrfrRr�r�r�r��	SMTP_PORTrdrF�_GLOBAL_DEFAULT_TIMEOUTr!rJrNrPrYr[rCrorurgrLr�r9r�r�r�r�r�r�r�r6r�r�r�r�r�r�r�r�r�r�r�r�rDr�rrrrr�sh�
0
	
!

1



3


0
	

B
8�
h�
M
c@s8eZdZdZeZdddddejddfdd�Zdd�Z	dS)	�SMTP_SSLa� This is a subclass derived from SMTP that connects over an SSL
        encrypted socket (to use this class you need a socket module that was
        compiled with SSL support). If host is not specified, '' (the local
        host) is used. If port is omitted, the standard SMTP-over-SSL port
        (465) is used.  local_hostname and source_address have the same meaning
        as they do in the SMTP class.  keyfile and certfile are also optional -
        they can contain a PEM formatted private key and certificate chain file
        for the SSL connection. context also optional, can contain a
        SSLContext, and is an alternative to keyfile and certfile; If it is
        specified both keyfile and certfile must be None.

        r&rNc	
Cs�|dk	r|dk	rtd��|dk	r0|dk	r0td��|dk	s@|dk	rVddl}	|	�dtd�||_||_|dkrxtj||d�}||_t	�
||||||�dS)Nr�r�rr�r�r�)rbr�r�r�r�r�r�r�r�rr!)
rrGrHrEr�r�r>rAr�r�rrrr!s(���zSMTP_SSL.__init__cCsD|jdkr|�d||f�t�||f||j�}|jj||jd�}|S)Nrr^r�)rOrYrFrZrAr�r�r=)rrGrHr>Z
new_socketrrrr[s
��zSMTP_SSL._get_socket)
rrrr�
SMTP_SSL_PORTrdrFr�r!r[rrrrr��s
�
r�i�c@s0eZdZdZdZdeddfdd�Zdd	d
�ZdS)�LMTPa�LMTP - Local Mail Transfer Protocol

    The LMTP protocol, which is very similar to ESMTP, is heavily based
    on the standard SMTP client. It's common to use Unix sockets for
    LMTP, so our connect() method must support that as well as a regular
    host:port server.  local_hostname and source_address have the same
    meaning as they do in the SMTP class.  To specify a Unix socket,
    you must use an absolute path as the host, starting with a '/'.

    Authentication is supported, using the regular SMTP mechanism. When
    using a Unix socket, LMTP generally don't support or require any
    authentication, but your mileage might vary.Zlhlor&NcCstj|||||d�dS)zInitialize a new instance.)rErAN)rr!)rrGrHrErArrrr!;s�z
LMTP.__init__r\rcCs�|ddkrtj||||d�Sz(t�tjtj�|_d|_|j�|�WnBtk
r�|jdkrl|�	d|�|jr||j�
�d|_�YnX|��\}}|jdkr�|�	d|�||fS)z=Connect to the LMTP daemon, on either a Unix or a TCP socket.r�/)rANz
connect fail:r^)rrCrFZAF_UNIXZSOCK_STREAMrfrRrcrOrYrDrg)rrGrHrArr rrrrCAs"


zLMTP.connect)r\rN)rrrrr��	LMTP_PORTr!rCrrrrr�+s
�
r��__main__cCs(tj�|d�tj��tj����S)Nz: )rV�stdout�write�flush�stdinr|r+)�promptrrrr[s
rr�r��,zEnter message, end with ^D:r&zMessage length is %dr\rQ)ArrFr�r2Zemail.utilsr(Z
email.messageZemail.generatorr�r�r�rTrVZemail.base64mimerr��__all__r�r�r4r�r}r��compile�Ir�rcrrrrrrr	r
rrr
r/rr7r8r��ImportErrorr�rr�rr�r�rrZfromaddrr�ZtoaddrsrSr rr|r�r~ZserverrPr�r�rrrr�<module>s�)�


	
:0
/


__pycache__/pydoc.cpython-38.pyc000064400000243037151153537560012546 0ustar00U

��.e̠�@s�dZdgZdZdZdZddlZddlZddlZddl	Zddl
ZddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlmZddlmZdd	lmZd
d�Zdd
�Zdd�Z dd�Z!dd�Z"dd�Z#dd�Z$e�%dej&�Z'dd�Z(dd�Z)dd�Z*dd �Z+dxd!d"�Z,d#d$�Z-d%d&�Z.d'd(�Z/d)d*�Z0ifd+d,�Z1Gd-d.�d.e2�Z3d/d0�Z4difd1d2�Z5Gd3d4�d4�Z6Gd5d6�d6e�Z7Gd7d8�d8e6�Z8Gd9d:�d:e�Z9Gd;d<�d<e6�Z:Gd=d>�d>e:�Z;d?d@�a<dAdB�Z=dCdD�Z>dEdF�Z?dGdH�Z@dIdJ�ZAdKdL�ZBdMdN�ZCdOdP�ZDdydQdR�ZEe:�ZFe;�ZGe8�ZHdzdSdT�ZId{dVdW�ZJd|dXdY�ZKd}dZd[�ZLd~d]d^�ZMGd_d`�d`�ZNeN�ZOGdadb�db�ZPdcdd�ZQdedf�ZRddhdi�ZSd�djdkdl�dmdn�ZTdodp�ZUdqdr�ZVdsdt�ZWdudv�ZXeYdwk�r�eX�dS)�aGenerate Python documentation in HTML or text for interactive use.

At the Python interactive prompt, calling help(thing) on a Python object
documents the object, and calling help() starts up an interactive
help session.

Or, at the shell command line outside of Python:

Run "pydoc <name>" to show documentation on something.  <name> may be
the name of a function, module, package, or a dotted reference to a
class or function within a module or module in a package.  If the
argument contains a path segment delimiter (e.g. slash on Unix,
backslash on Windows) it is treated as the path to a Python source file.

Run "pydoc -k <keyword>" to search for a keyword in the synopsis lines
of all available modules.

Run "pydoc -n <hostname>" to start an HTTP server with the given
hostname (default: localhost) on the local machine.

Run "pydoc -p <port>" to start an HTTP server on the given port on the
local machine.  Port number 0 can be used to get an arbitrary unused port.

Run "pydoc -b" to start an HTTP server on an arbitrary unused port and
open a Web browser to interactively browse documentation.  Combine with
the -n and -p options to control the hostname and port used.

Run "pydoc -w <name>" to write out the HTML documentation for a module
to a file named "<name>.html".

Module docs for core modules are assumed to be in

    https://docs.python.org/X.Y/library/

This can be overridden by setting the PYTHONDOCS environment variable
to a different URL or to a local directory containing the Library
Reference Manual pages.
�helpzKa-Ping Yee <ping@lfw.org>z26 February 2001z�Guido van Rossum, for an excellent programming language.
Tommy Burnette, the original creator of manpy.
Paul Prescod, for all his work on onlinehelp.
Richard Chamberlain, for the first implementation of textdoc.
�N)�deque)�Repr)�format_exception_onlycCs\g}g}tjD]H}tj�|pd�}tj�|�}||krtj�|�r|�|�|�|�q|S)zAConvert sys.path into a list of absolute, existing, unique paths.�.)�sys�path�os�abspath�normcase�isdir�append)�dirsZnormdirs�dirZnormdir�r�/usr/lib64/python3.8/pydoc.py�pathdirsPs

rcCs.t�|�pt�|�}|r*t�dd|���p,dS)z-Get the doc string or comments for an object.z^ *
�)�inspect�getdocZgetcomments�re�sub�rstrip)�object�resultrrrr\srcCsf|���d�}t|�dkr&|ddfSt|�dkrX|d��sX|dd�|dd��fSdd�|�fS)z>Split a doc string into a synopsis line (if any) and the rest.�
�rr�N)�strip�split�lenr�join)�doc�linesrrr�splitdocasr$cCs"|j}|j|kr|jd|}|S)z@Get a class name and qualify it with a module name if necessary.r)�__name__�
__module__)r�modname�namerrr�	classnamejs
r)cCs>t�|�p:t�|�p:t�|�p:t�|�p:t�|�p:t�|�S)z>Check if an object is of a type that probably means it's data.)r�ismodule�isclass�	isroutineZisframeZistracebackZiscode�rrrr�isdataqs����r.cGs.|r*|d�|�|d��}|dd�}q|S)z/Do a series of global replacements on a string.rrrN)r!r)�textZpairsrrr�replacewsr0cCsXt|�|krTtd|dd�}td|d|�}|d|�d|t|�|d�S|S)zCOmit part of a string if needed to make it fit in a maximum length.r�rN�...)r �max)r/�maxlenZpreZpostrrr�cram~s
$r5z at 0x[0-9a-f]{6,16}(>+)$cCst�d|�S)z>Remove the hexadecimal id from a Python object representation.z\1)�_re_stripidr�r/rrr�stripid�sr8cCs<t�|�rdSt�|�r8t|dd�}t�|�p4|dkSdS)zo
    Returns True if fn is a bound method, regardless of whether
    fn was implemented in Python or in C.
    T�__self__NF)r�ismethod�	isbuiltin�getattrr*)�fn�selfrrr�_is_bound_method�s

r?cCs^i}t�|tj�D]\}}d||<q|jD]}|�t|��q*|��D]}t||�||<qF|S�Nr)r�
getmembersr,�	__bases__�update�
allmethods�keysr<)�cl�methods�key�value�baserrrrD�s

rDcCs8g}g}|D]"}||�r$|�|�q|�|�q||fS)z�Split sequence s via predicate, and return pair ([true], [false]).

    The return value is a 2-tuple of lists,
        ([x for x in s if predicate(x)],
         [x for x in s if not predicate(x)])
    �r
)�s�	predicateZyesZno�xrrr�_split_list�srOcCs\|dkrdS|�d�r$|�d�r$dS|�d�r<t|d�r<dS|dk	rL||kS|�d�SdS)	z3Decide whether to show documentation on a variable.>�	__slots__�__date__�__path__�__qualname__�__builtins__�__credits__�__doc__�
__author__�__version__�__file__r%�
__cached__r&�
__loader__�__spec__�__package__r�__r�_�_fieldsTN)�
startswith�endswith�hasattr)r(�all�objrrr�visiblename�srfcCsXg}t�|�D]D\}}}}t�|�r@d}t|t�r@|jdkr@d}|�||||f�q|S)zCWrap inspect.classify_class_attrs, with fixup for data descriptors.�data descriptorN�readonly property)r�classify_class_attrs�isdatadescriptor�
isinstance�property�fsetr
)r�resultsr(�kind�clsrIrrrri�s
rics\t|dg��z�fdd�t��D��Wntk
r>i�YnX�fdd�}|j|d�dS)zGSort the attrs list in-place by _fields and then alphabetically by namer`csi|]\}}||t���qSr)r )�.0�ir()�fieldsrr�
<dictcomp>�sz#sort_attributes.<locals>.<dictcomp>cs��|dd�|dfS�Nr)�get)�attr)�field_orderrr�<lambda>��z!sort_attributes.<locals>.<lambda>�rHN)r<�	enumerate�	TypeError�sort)�attrsrZkeyfuncr)rxrsr�sort_attributes�s
r�cCs:tj�|�r6dD]$}tj�tj�|d|��rdSqdS)z3Guess whether a path refers to a package directory.)z.pyz.pyc�__init__TF)r	rr�isfiler!)r�extrrr�	ispackage�s
r�cCs�|��}|dd�dks |��s0|��}|sq0q|��}|dd�dkrT|dd�}|dd�dkr�|dd�}|dd�dkr�|dd�}|��s�|��}|s�q�q�|�d�d	��}nd}|S)
Nr�#�zr"""r1�"""����\r)�readlinerr)�file�linerrrr�source_synopsis�s&r�c
	Cs t�|�j}|�|d�\}}|dks.||k�r|�ttjj��rJtjj	}n |�ttjj
��rftjj}nd}|dkr�zt�
|�}Wntk
r�YdSX|�t|�}W5QRXn^|d|�}tjjd||d�}ztj�|�}	WnYdSXtjd=|	j�r|	j��dnd}||f||<|S)z.Get the one-line summary out of a module file.)NNNZ__temp__��loaderr)r	�stat�st_mtimervrb�tuple�	importlib�	machinery�BYTECODE_SUFFIXES�SourcelessFileLoader�EXTENSION_SUFFIXES�ExtensionFileLoader�tokenize�open�OSErrorr��util�spec_from_file_location�
_bootstrap�_loadr�modulesrV�
splitlines)
�filename�cache�mtimeZ
lastupdaterZ
loader_clsr�r��spec�modulerrr�synopsis�s6



�r�c@s eZdZdZdd�Zdd�ZdS)�ErrorDuringImportzEErrors that occurred while trying to import something to document it.cCs||_|\|_|_|_dS�N)r��excrI�tb)r>r��exc_inforrrr�#szErrorDuringImport.__init__cCs|jj}d|j||jfS)Nzproblem in %s - %s: %s)r�r%r�rI)r>r�rrr�__str__'szErrorDuringImport.__str__N)r%r&rSrVr�r�rrrrr�!sr�c		Cs�tjj}t|d��}||�t|��k}W5QRXtj�|�}tj�	|�\}}|r`tj
�||�}ntj
�||�}tjj
|||d�}ztj�|�WSt|t����YnXdS)z<Import a Python source file or compiled file given its path.�rbr�N)r�r��MAGIC_NUMBERr��readr r	r�basename�splitext�_bootstrap_externalr��SourceFileLoaderr�r�r�r�rr�)	r�magicr�Zis_bytecoder�r(r�r�r�rrr�
importfile+sr�c	s z^|rT�tjkrT�tjkrT�fdd�tjD�}�g|D]}tj|||<tj|=q8t��}Wnzt��\}}}}	�tjkr�ttj�j|	��n>|tkr�t|j|	��n(t	|t
�r�|j�kr�YdSt�t����YnX��d�dd�D].}
zt
||
�}Wq�tk
�rYdSXq�|S)a�Import a module; handle errors; return None if the module isn't found.

    If the module *is* found but an exception occurs, it's wrapped in an
    ErrorDuringImport exception and reraised.  Unlike __import__, if a
    package path is specified, the module at the end of the path is returned,
    not the package at the beginning.  If the optional 'forceload' argument
    is 1, we reload the module from disk (unless it's a dynamic extension).csg|]}|��d�r|�qS)r)ra)rq�m�rrr�
<listcomp>Qszsafeimport.<locals>.<listcomp>Nrr)rr��builtin_module_names�
__import__r�r�rY�SyntaxErrorr��
issubclass�ImportErrorr(rr<�AttributeError)r�	forceloadr�ZsubsrHr�r�rIr��info�partrr�r�
safeimport=s.


r�c@sfeZdZej�ddejdd��Zddd�Z	d
dd�Z
e
ZZZ
ZZZe�d	�fd
d�ZdS)�Doc�
PYTHONDOCSz%https://docs.python.org/%d.%d/libraryNrcGs�||f|}zFt�|�r$|j|�WSt�|�r:|j|�WSt�|�rP|j|�WSWntk
rfYnXt�|�r||j	|�S|j
|�S)z%Generate documentation for an object.)rr*�	docmoduler+�docclassr,�
docroutiner�rj�docdata�docother)r>rr(�argsrrr�documentss




zDoc.documentcGs*d|odt|�t|�jf}t|��dS)z+Raise an exception for unimplemented types.z.don't know how to document object%s of type %s� N)�repr�typer%r})r>rr(r��messagerrr�fail�s
�zDoc.failZstdlibcCs�zt�|�}Wntk
r&d}YnXtj�d|j�}tj�|�}t	|t
t��r�|jdksz|�|�r�|�tj�
|d��s�|jdkr�|�d�r�d|�d�|j��f}q�tj�
||j��d	�}nd
}|S)z*Return the location of module docs or None�
(built-in)r�)
�errno�
exceptionsZgcZimp�marshal�posix�signalr�_threadZ	zipimportz
site-packages)z	xml.etreeztest.pydoc_mod)zhttp://zhttps://z%s/%s�/�.htmlN)r�
getabsfiler}r	�environrvr�rrrkr�r%rar!r�lower)r>rZbasedirr��doclocrrr�	getdocloc�s(
����
z
Doc.getdocloc)N)N)r%r&rSr	r�rvr�version_infor�r�r�r�r�r�r��docpropertyr��	sysconfigZget_pathr�rrrrr�ms��

r�c@sHeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZeZ	dd
�Z
eZdS)�HTMLReprzBClass for safely making an HTML representation of a Python object.cCs,t�|�d|_|_d|_d|_|_dS�N��
�d�rr��maxlist�maxtuple�maxdict�	maxstring�maxother�r>rrrr��s
zHTMLRepr.__init__cCst|dddddd�S)N�&z&amp;�<z&lt;�>z&gt;)r0�r>r/rrr�escape�szHTMLRepr.escapecCst�||�Sr�)rr��r>rrrrr��sz
HTMLRepr.reprcCsZtt|�d�r@dd�t|�j���}t||�r@t||�||�S|�ttt	|��|j
��S�Nr%�repr_r_)rcr�r!r%rr<r�r5r8r�r��r>rN�levelZ
methodnamerrr�repr1�s

zHTMLRepr.repr1cCs^t||j�}t|�}d|krJdt|dd�krJd|d|�|�|dSt�dd|�|��S)Nr��\\r�rrz-((\\[\\abfnrtv\'"]|\\[0-9]..|\\x..|\\u....)+)z<font color="#c040c0">\1</font>)r5r�r�r0r�rr�r>rNr�ZtestZtestreprrrr�repr_string�s�zHTMLRepr.repr_stringcCs@z|�ttt|��|j��WS|�d|jj�YSXdS�Nz
<%s instance>)r�r5r8r�r��	__class__r%�r>rNr�rrr�
repr_instance�szHTMLRepr.repr_instanceN)r%r&rSrVr�r�r�r�r��repr_strrZrepr_unicoderrrrr��sr�c@seZdZdZe�ZejZejZdd�Zd1dd�Z	d2d
d�Z
dd
�Zdd�Zd3dd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdiiifdd �Zd4d!d"�Zd5d#d$�Zddiifd%d&�Zd'd(�Zddiiidfd)d*�Zd6d+d,�ZeZd7d-d.�Zd8d/d0�ZdS)9�HTMLDocz'Formatter class for HTML documentation.cCsd||fS)�Format an HTML page.z�<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: %s</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body bgcolor="#f0f0f8">
%s
</body></html>r)r>�title�contentsrrr�page�s�zHTMLDoc.pagercCsd|||||pdfS)zFormat a page heading.a'
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="%s">
<td valign=bottom>&nbsp;<br>
<font color="%s" face="helvetica, arial">&nbsp;<br>%s</font></td
><td align=right valign=bottom
><font color="%s" face="helvetica, arial">%s</font></td></tr></table>
    �&nbsp;r)r>r�fgcol�bgcolZextrasrrr�heading�s�zHTMLDoc.heading�Nrc	
Cs^|dkrdd|d}d|||f}	|r@|	d||||f}	n|	d|||f}	|	d|S)	z Format a section with a heading.Nz<tt>rz</tt>z�<p>
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="%s">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="%s" face="helvetica, arial">%s</font></td></tr>
    zR
<tr bgcolor="%s"><td rowspan=2>%s</td>
<td colspan=2>%s</td></tr>
<tr><td>%s</td>z(
<tr><td bgcolor="%s">%s</td><td>%s</td>z'
<td width="100%%">%s</td></tr></table>r)
r>rr	r
r�widthZpreludeZ
marginaliaZgaprrrr�section�s�
��zHTMLDoc.sectioncGsd|}|j|f|��S)z$Format a section with a big heading.z<big><strong>%s</strong></big>)r)r>rr�rrr�
bigsectionszHTMLDoc.bigsectionc
Cs&|�|���}t|dddddddd�	S)z!Format literal preformatted text.�

z
 
r�rr�<br>
)r��
expandtabsr0r�rrr�	preformat
s�zHTMLDoc.preformatr�cCs�d}t|�|d|}t|�D]X}|dd|}t|||||�D]$}|t|�krJ||||�d}qJ|d}q d|S)z0Format a list of items into a multi-column list.rrz<td width="%d%%" valign=top>r�rz</td>z7<table width="100%%" summary="list"><tr>%s</tr></table>)r �range)r>�list�formatZcolsr�rows�colrrrrr�multicolumns
zHTMLDoc.multicolumncCsd|S)Nz<font color="#909090">%s</font>rr�rrr�greyrzzHTMLDoc.greycGs*|D] }||krd|||fSq|S)z:Make a link for an identifier, given name-to-URL mappings.�<a href="%s">%s</a>r)r>r(Zdicts�dictrrr�namelinkszHTMLDoc.namelinkcCsN|jtj�|j�}}t||�rDt||�|krDd|j|t||�fSt||�S)zMake a link for a class.z<a href="%s.html#%s">%s</a>)r%rr�rvr&rcr<r))r>rr'r(r�rrr�	classlink%s�zHTMLDoc.classlinkcCsd|j|jfS)zMake a link for a module.�<a href="%s.html">%s</a>)r%r�rrr�
modulelink-szHTMLDoc.modulelinkcCsR|\}}}}|r|�|�S|r,d||f}nd|}|rBd|}n|}d||fS)z;Make a link for a module or package to display in an index.z
%s.%s.htmlz%s.htmlz"<strong>%s</strong>&nbsp;(package)r)r)r>Z
modpkginfor(rr��shadowed�urlr/rrr�
modpkglink1s

zHTMLDoc.modpkglinkcCsd||fS)zMake a link to source file.z<a href="file:%s">%s</a>r)r>r"rrrr�filelink@szHTMLDoc.filelinkcCs�|p|j}g}d}t�d�}|�||�}	|	s0�qh|	��\}
}|�||||
���|	��\}}
}}}}|
r�||��dd�}|�d||f�n�|r�dt|�}|�d|||�f�n�|r�dt|�}|�d|||�f�n�|�r"|||d�d	k�r|�d
|�	||��n|�d|�n@|||d�d	k�rP|�|�	||||��n|�|�	||��|}q|�|||d���d
�
|�S)z�Mark up some plain text, given a context of symbols to look for.
        Each context dictionary maps object names to anchor names.rzD\b((http|ftp)://\S+[\w/]|RFC[- ]?(\d+)|PEP[- ]?(\d+)|(self\.)?(\w+))�"z&quot;rz'http://www.rfc-editor.org/rfc/rfc%d.txtz(http://www.python.org/dev/peps/pep-%04d/r�(zself.zself.<strong>%s</strong>Nr)r�r�compile�search�spanr
�groupsr0�intrr!)r>r/r��funcs�classesrGrn�here�pattern�match�start�endrdZschemeZrfcZpepZselfdotr(r"rrr�markupDs:

zHTMLDoc.markupc
Cs�d}|D]�}t|�td�kr�|\}}|d}||�||�}|r�||fkr�g}|D]}	|�|�|	|��qR|dd�|�d}|d}qt|�tg�kr|d|�|||�}qd	|S)
zAProduce HTML for a class tree as given by inspect.getclasstree().rrz"<dt><font face="helvetica, arial">r&�, �)z
</font></dt>z
<dd>
%s</dd>
z
<dl>
%s</dl>
)r�rr
r!�
formattree)
r>�treer'�parentr�entry�c�bases�parentsrJrrrr6os&
�
zHTMLDoc.formattreec#
s�|j}z
|j}Wntk
r(d}YnX|�d�}g}tt|�d�D],}|�dd�|d|d��||f�qHd�||dd��}	d|	}
z&t�	|�}t
j�|�}��
||�}
Wntk
r�d}
YnXg}t|d��r6t|j�}|dd	�d
k�r"|dd�dk�r"|d	d���}|�d��|��t|d
��rX|���t|j���|�rp|
dd�|�}
��|�}|dk	�r�dt�}nd}��|
ddd|
|�}t�|tj�}gi}}t�|tj�D]Z\}}|dk	�s�t�|��p�||k�r�t|||��r�|�||f�d|||<||<�q�|D]�\}}|jD]n}|j|j}}tj �!|�}||k�r@|�r@t||��r@t"||�|k�r@||k�r@|d|||<||<�q@�q2gi}}t�|tj#�D]p\}}|dk	�s�t�$|��s�t�|�|k�r�t|||��r�|�||f�d|||<t�%|��r�||||<�q�g}t�|t&�D]&\}}t|||��rN|�||f��qN��'t(|��j)||�}|�o�d|}|d|}t|d��rg}t*�+|j,�D]\}}} |�||| df��q�|�-���.|�j/�}!|��0ddd|!�}n.|�r<��.|�fdd��}!|��0d dd|!�}|�r�d!d"�|D�}"��1t�2|"d�|�g}!|D]"\}}|!���3|||||���qj|��0d#dd$d%�|!��}|�r�g}!|D]"\}}|!���3|||||���q�|��0d&dd'd%�|!��}|�r:g}!|D]\}}|!���3||���q|��0d(dd)d*�|!��}t|d+��rn��'t|j4��j)�}!|��0d,dd|!�}t|d-��r���'t|j5��j)�}!|��0d.dd|!�}|S)/z/Produce HTML documentation for a module object.Nrrz5<a href="%s.html"><font color="#ffffff">%s</font></a>r��)<big><big><strong>%s</strong></big></big>r�rX��$Revision: �$z
version %srQz (%s)r4z-<br><a href="%(docloc)s">Module Reference</a>r�#ffffff�#7799eez<a href=".">index</a><br>r�z.html#z#-z<tt>%s</tt>z
<p>%s</p>
rRrzPackage Contentsz#aa55cccs��|d�Sr@)r ��tr�rrry�rzz#HTMLDoc.docmodule.<locals>.<lambda>ZModulescSsg|]\}}|�qSrr�rqrHrIrrrr��sz%HTMLDoc.docmodule.<locals>.<listcomp>ZClasses�#ee77aar�Z	Functionsz#eeaa77ZDataz#55aa55rrWZAuthorrUZCredits)6r%�__all__r�rrr r
r!rr��urllib�parseZquoter$r}rc�strrXrr�rQr��localsrrAr*r+�	getmodulerfrBr&rr�rvr<r,r;�
isfunctionr.r3rr�pkgutil�iter_modulesrRr~rr#rr6�getclasstreer�rWrU)#r>rr(�mod�ignoredrd�partsZlinksrrZ
linkedname�headrr"r$r��versionr�rr�r-ZcdictrHrIrJr'r�r,Zfdict�datar"�modpkgs�importer�ispkgr�	classlistrr�rr��s*


��


$


�

�

 

���
��������zHTMLDoc.docmodulec	s��j}|p|}�j}g}	|	j�G�fdd�d�}
|
��tt����}t|�dkr�����d�|D]}�d��|�j	��qd�d���������fdd�}
����fd	d
�}��������fdd�}�fd
d�t
��D�}i�|D]n\}}}}d|d|�|<}zt�|�}Wntk
�r4YnXz|�|<Wq�t
k
�rXYq�Xq�|�rx|�rr|���n|dd�t|�fdd��\}}�tjk	�r��tjk�r�|}�q\n"��k�r�d}nd����j	�}|d7}t|��|
d||dd��}|
d||dd��}|
d||dd��}|d||dd��}|d||d d��}|d!||d"d��}|gk�spt�|}�q\d#�|	�}	||k�r�d$||f}nd%|||f}|�r�g}|D]}|���|�j	���q�|d&d'�|�}d#}zt���}Wntt
fk
�rd(}YnX|�rFt|�}|�rF|d)k�rF|��|�d*}t��}|�rb||�p^d#}��|�j����}|�o�d+|}��|d,d-|	d.|�S)/z.Produce HTML documentation for a class object.cs eZdZdd�Z�fdd�ZdS)z(HTMLDoc.docclass.<locals>.HorizontalRulecSs
d|_dSru�Zneedoner�rrrr�sz1HTMLDoc.docclass.<locals>.HorizontalRule.__init__cs|jr�d�d|_dS)Nz<hr>
rr[r���pushrr�maybe	sz.HTMLDoc.docclass.<locals>.HorizontalRule.maybeN�r%r&rSr�r^rr\rr�HorizontalRulesr`rz&<dl><dt>Method resolution order:</dt>
z<dd>%s</dd>
�</dl>
cs�t||�\}}|r�����|�|D]d\}}}}zt�|�}Wn&tk
rf���||���YnX���||��������d�q&|S)Nr�rOr^r<�	Exceptionr�r���msgrrM�okr(ro�homeclsrI�r-r,�hr�mdictrQrr]r>rr�spills"�
zHTMLDoc.docclass.<locals>.spillcsJt||�\}}|rF����|�|D]\}}}}���||���q&|Sr��rOr^r�rd�rirQr]r>rr�spilldescriptors+sz*HTMLDoc.docclass.<locals>.spilldescriptorsc
s�t||�\}}|r�����|�|D]�\}}}}��t�|�|��}t|�sXt�|�rft|dd�}	nd}	|	dkr��d|�n0��t|��j	����}	d|	}	�d||	f��d�q&|S)NrVz<dl><dt>%s</dl>
z<dd><tt>%s</tt>z<dl><dt>%s%s</dl>
r)
rOr^r�r<�callablerrjr3rr)
rerrMrfr(rorgrIrJr"rhrr�	spilldata4s(�
z#HTMLDoc.docclass.<locals>.spilldatacs,g|]$\}}}}t|�d�r||||f�qS�)re�rf�rqr(rorprIr-rrr�Is
�z$HTMLDoc.docclass.<locals>.<listcomp>r��-rcs|d�kS�NrrrC��	thisclassrrrybrzz"HTMLDoc.docclass.<locals>.<lambda>�defined here�inherited from %sz:<br>
z
Methods %scSs|ddkS�Nr�methodrrCrrrryrrzzClass methods %scSs|ddkS�Nrzclass methodrrCrrrrytrzzStatic methods %scSs|ddkS�Nrz
static methodrrCrrrryvrzzReadonly properties %scSs|ddkS�NrrhrrCrrrryxrzzData descriptors %scSs|ddkS�NrrgrrCrrrryzrzzData and other attributes %scSs|ddkS�NrrVrrCrrrry|rzrz*<a name="%s">class <strong>%s</strong></a>z/<strong>%s</strong> = <a name="%s">class %s</a>�(%s)r4N�()rz<tt>%s<br>&nbsp;</tt>z#000000z#ffc8d8r1)r%rBr
rr�getmror r^rr&rir<rcr}�popleftrO�builtinsrr��AssertionErrorr!�	signature�
ValueErrorrJr�rr3rr)r>rr(rQr,r-rR�realnamer;rr`�mrorJrkrnrprrHrorgrI�anchor�	inherited�tagrr<�declr��argspecr"r)	r-r,rirjrQrr]r>rwrr��s�
�
	
�

�

�
�
�
�
�
�

��
zHTMLDoc.docclasscCs|�d|�|��S�z)Format an argument default value as text.�=)rr�r�rrr�formatvalue�szHTMLDoc.formatvaluec	Cs�|j}|p|}|r|jpdd|}	d}
d}t|�r�|jj}|rZ||k	r�d|�||�}
n0|jdk	rzd|�|jj|�}
nd|�||�}
t�|�s�t�|�r�d}
nd}
||kr�d	|	|f}nD|r�t�||g�|kr�d
|jd||f}d}n|}d|	||f}d}t�	|��rlzt�
|�}Wnttfk
�r>d}YnX|�rlt
|�}|d
k�rld|}|dd�}|�svd}|
||�|�|
�o�|�d|
�}|�r�d|S|�t|�|j|||�}|�o�d|}d||fSdS)z;Produce HTML documentation for a function or method object.rrtr� from N� method of %s instance� unbound %s method�async z$<a name="%s"><strong>%s</strong></a>z<a href="#%s">%s</a>rz)<a name="%s"><strong>%s</strong></a> = %s�<lambda>z$<strong>%s</strong> <em>lambda</em> r��(...)z'<font face="helvetica, arial">%s</font>z<dl><dt>%s</dt></dl>
z<dd><tt>%s</tt></dd>z<dl><dt>%s</dt>%s</dl>
)r%r?r9r�rr�iscoroutinefunction�isasyncgenfunction�getattr_staticr,r�r�r}rJr�rr3rr)r>rr(rQr,r-rGrFr�r��note�skipdocs�imclass�asyncqualifierrZreallinkr�r�r�r"rrrr��s|
�
���

��zHTMLDoc.docroutinecCsNg}|j}|r|d|�|�t|�|j�}|r<|d|�|d�d�|�S)z1Produce html documentation for a data descriptor.z!<dl><dt><strong>%s</strong></dt>
z<dd><tt>%s</tt></dd>
rar)r
r3rrr!�r>rr(rQrFrnr]r"rrrr��szHTMLDoc.docdatacGs|rd|pd}||�|�S)z-Produce HTML documentation for a data object.z<strong>%s</strong> = r�r�)r>rr(rQrRZlhsrrrr��szHTMLDoc.docothercCs�g}|dkri}t�|g�D]<\}}}tdd�|D��r:q|�|d|||kf�d||<q|��|�||j�}|�|dd|�S)z2Generate an HTML index for a directory of modules.Ncss*|]"}dt|�kodknVqdS)i�i��N)�ord�rqZchrrr�	<genexpr>�sz HTMLDoc.index.<locals>.<genexpr>rrrArF)rNrO�anyr
r~rr#r)r>rr!rWrXr(rYrrrr�index�s
z
HTMLDoc.index)r)rrNr)r�)N)NN)NNN)NN)N)r%r&rSrVr��_repr_instancer�r�rrrrrrrrrr r#r$r3r6r�r�r�r�r�r�r�r�rrrrr�sH

�

+

y&�
A

rc@s4eZdZdZdd�Zdd�Zdd�ZeZdd	�Zd
S)�TextReprzAClass for safely making a text representation of a Python object.cCs,t�|�d|_|_d|_d|_|_dSr�r�r�rrrr�
s
zTextRepr.__init__cCsTtt|�d�r@dd�t|�j���}t||�r@t||�||�Sttt|��|j	�Sr�)
rcr�r!r%rr<r5r8r�r�r�rrrr�s

zTextRepr.repr1cCsHt||j�}t|�}d|krDdt|dd�krDd|d||dS|S)Nr�r�rr�r)r5r�r�r0r�rrrr�s
zTextRepr.repr_stringcCs4zttt|��|j�WSd|jjYSXdSr�)r5r8r�r�r�r%rrrrr%szTextRepr.repr_instanceN)	r%r&rSrVr�r�r�rrrrrrr�s	r�c@s~eZdZdZe�ZejZdd�Zddd�Zdd�Z	ddd�Z
dd
d�Zddd�Zdd�Z
ddd�Zddd�ZeZddd�Zd	S) �TextDocz'Formatter class for text documentation.cCsd�dd�|D��S)z(Format a string in bold by overstriking.rcss|]}|d|VqdS)�Nrr�rrrr�5szTextDoc.bold.<locals>.<genexpr>)r!r�rrr�bold3szTextDoc.bold�    cs>|sdS�fdd�|�d�D�}|r4|d��|d<d�|�S)z6Indent text by prepending a given prefix to each line.rcsg|]}�|�qSrr�rqr���prefixrrr�:sz"TextDoc.indent.<locals>.<listcomp>rr�)rrr!)r>r/r�r#rr�r�indent7szTextDoc.indentcCs$|�|���}|�|�d|dS)z&Format a section with a given heading.rr)r�rr�)r>rrZclean_contentsrrrr>szTextDoc.sectionNrc
	s�d}|D]�}t|�td�krr|\}}||t|��}|rh||fkrh�fdd�|D�}	|dd�|	�}|d}qt|�tg�kr||�|�||d�}q|S)	zBRender in text a class tree as returned by inspect.getclasstree().rrc3s|]}t|��VqdSr��r))rqr:�r'rrr�Msz%TextDoc.formattree.<locals>.<genexpr>r�r4rr�)r�r)r!r6)
r>r7r'r8r�rr9r:r;r<rr�rr6Es"
�zTextDoc.formattreec	Cs$|j}tt|��\}}|�d||o(d|�}t|dd�}|�|�}|dk	r`||�d|d�}|rt||�d|�}g}	t�|tj�D]<\}
}|dk	s�t�	|�p�||kr�t
|
||�r�|	�|
|f�q�g}t�|tj�D]F\}
}|dk	�st�
|��st�	|�|kr�t
|
||�r�|�|
|f�q�g}
t�|t�D]&\}
}t
|
||��r.|
�|
|f��q.g}t�}t|d��r�t�|j�D]6\}}}|�|�|�r�|�|d	�n
|�|��qx|��||�d
d�|��}g}t�|tj�D]0\}
}|j�|d��r�|
|k�r�|�|
��q�|�r6|��||�d
d�|��}|	�r�dd�|	D�}|�t�|d�|�g}|	D]\}
}|�|�||
|���qd||�dd�|��}|�r�g}|D]\}
}|�|�||
|���q�||�dd�|��}|
�r&g}|
D]"\}
}|�|j||
|dd���q�||�dd�|��}t|d��r�t|j�}|dd�dk�rp|dd�dk�rp|dd���}||�d|�}t|d��r�||�dt|j ��}t|d��r�||�dt|j!��}t|d ��r�||�d!t|j"��}zt�#|�}Wnt$k
�rd"}YnX||�d#|�}|S)$z5Produce text documentation for a given module object.�NAME� - rGNzMODULE REFERENCEa.

The following documentation is automatically generated from the Python
source files.  It may be incomplete, incorrect or include features that
are considered implementation detail and may vary between Python
implementations.  When in doubt, consult the module reference at the
location listed above.
ZDESCRIPTIONrR�
 (package)zPACKAGE CONTENTSrrZ
SUBMODULEScSsg|]\}}|�qSrrrErrrr��sz%TextDoc.docmodule.<locals>.<listcomp>r�CLASSES�	FUNCTIONS�F)r4ZDATArXr>r?r�r@ZVERSIONrQZDATErWZAUTHORrUZCREDITSr�ZFILE)%r%r$rrr<r�rrAr+rLrfr
r,r;r.�setrcrNrOrR�addr~r!r*rar6rPr�r�rJrXrrQrWrUr�r})r>rr(rQZsynop�descrrdr�r-rHrIr,rVrWZ
modpkgs_namesrXr'rYZ
submodulesrZrrUr�rrrr�Us�
	�
��
��
�
$
zTextDoc.docmodulec	sZ�j}|p|}�j}�jfdd�}||kr:d��|�}n��|�d|}|rlt||�}	|dd�|	�}g}
|
j�zt���}Wnt	t
fk
r�d}YnX|r�t|�}|r�|dkrʈ||d	�t��}
|
r�|
d	�t
t����}t|�d
k�r*�d�|D]}�d||���q
�d
�tdd�t���D�tjd�}t|�}d}|�r��d�|d|�D]}�d|��qn||k�r��dt||�d��d
�G�fdd�d�}|�������fdd�}����fdd�}�����fdd�}�fdd�t��D�}|�r&|�r*|���n|dd
�t|�fd d!��\}}�tjk	�rn�tjk�rn|}�qn ��k�r~d"}nd#t��j�}t|��|d$||d%d!��}|d&||d'd!��}|d(||d)d!��}|d*||d+d!��}|d,||d-d!��}|d.||d/d!��}|gk�st�|}�qd	�|
�}
|
�s>|d	S|d	��|
��d0�d	S)1z4Produce text documentation for a given class object.cSs
t||�Sr�r�)r:r�rrr�makename�sz"TextDoc.docclass.<locals>.makename�class z	 = class r�r4Nr�rrzMethod resolution order:r�rcss.|]&}|j�d�s|jdkrt|j�VqdS)r_r�N)r%rar&rJ)rqrprrrr��s
�z#TextDoc.docclass.<locals>.<genexpr>r{r�zBuilt-in subclasses:z    ... and z other subclassescs eZdZdd�Z�fdd�ZdS)z(TextDoc.docclass.<locals>.HorizontalRulecSs
d|_dSrur[r�rrrr��sz1TextDoc.docclass.<locals>.HorizontalRule.__init__cs|jr�d�d|_dS)NzF----------------------------------------------------------------------rr[r�r\rrr^�sz.TextDoc.docclass.<locals>.HorizontalRule.maybeNr_rr\rrr`�sr`c
s�t||�\}}|r~����|�|D]V\}}}}zt�|�}Wn&tk
rf���||���Yq&X���||����q&|Sr�rbrd�rirQrr]r>rrrk�s�zTextDoc.docclass.<locals>.spillcsJt||�\}}|rF����|�|D]\}}}}���||���q&|Sr�rlrdrmrrrnsz*TextDoc.docclass.<locals>.spilldescriptorsc
	s�t||�\}}|r�����|�|D]v\}}}}t|�sDt�|�rNt|�}nd}zt�|�}	Wntk
r~|j|}	YnX��j	|	|�d|d�d�q&|S)Nr�)r4r"r)
rOr^rorrjrr<r��__dict__r�)
rerrMrfr(rorgrIr"rer�rrrps 
�z#TextDoc.docclass.<locals>.spilldatacs,g|]$\}}}}t|�d�r||||f�qSrqrrrsr-rrr�+s
�z$TextDoc.docclass.<locals>.<listcomp>rcs|d�kSrurrCrvrrry4rzz"TextDoc.docclass.<locals>.<lambda>rxryzMethods %s:
cSs|ddkSrzrrCrrrryCrzzClass methods %s:
cSs|ddkSr|rrCrrrryErzzStatic methods %s:
cSs|ddkSr}rrCrrrryGrzzReadonly properties %s:
cSs|ddkSr~rrCrrrryIrzzData descriptors %s:
cSs|ddkSrrrCrrrryKrzzData and other attributes %s:
cSs|ddkSr�rrCrrrryMrzz |  )r%rBr&r��mapr!r
rr�r�r}rJrrr�r �sortedr��__subclasses__r�rir�rOr�rr)r�r�r�r)r>rr(rQrRr�r;r�rr<rr�r�r"r�rJZ
subclassesZno_of_subclassesZMAX_SUBCLASSES_TO_DISPLAYZsubclassnamer`rkrnrprr�r�r)rirQrr]r>rwrr��s�

�

��	
�

�

�
�
�
�
�
�
zTextDoc.docclasscCsd|�|�Sr�r�r�rrrr�WszTextDoc.formatvaluec	Cs�|j}|p|}d}d}t|�rn|jj}|rB||k	rndt||�}n,|jdk	r`dt|jj|�}ndt||�}t�|�s�t�|�r�d}	nd}	||kr�|�|�}
n,|r�t�	||g�|kr�d}|�|�d	|}
d}t�
|��r<zt�|�}Wntt
fk
�rd}YnX|�r<t|�}|d
k�r<|�|�d}
|dd�}|�sFd
}|	|
||}
|�rd|
dSt|��ppd}|
d|�o�|�|���dSdS)z;Produce text documentation for a function or method object.rrr�Nr�r�r�r� = r�z lambda r�r�r)r%r?r9r�r)rr�r�r�r�r,r�r�r}rJrr�r)r>rr(rQrFr�r�r�r�r�rr�r�r�r"rrrr�[sV
�
�

zTextDoc.docroutinecCsTg}|j}|r$||�|��|d�t|�p.d}|rJ||�|��|d�d�|�S)z1Produce text documentation for a data descriptor.rr)r
r�rr�r!r�rrrr��szTextDoc.docdatac
Cs�|�|�}|rF|r|dpd|}|t|�}	|	dkrF|d|	�d}|rX|�|�dpZd|}|dk	r~|d|�t|��7}|S)z-Produce text documentation for a data object.r�rrNr2r)r�r r�r�rJ)
r>rr(rQr8r4r"r�r�Zchoprrrr��s
zTextDoc.docother)r�)Nr)NN)NN)NNN)NNN)NNNNN)r%r&rSrVr�r�r�r�r�rr6r�r�r�r�r�r�r�rrrrr�+s


e

7
r�c@seZdZdZdd�ZdS)�
_PlainTextDocz2Subclass of TextDoc which overrides string stylingcCs|Sr�rr�rrrr��sz_PlainTextDoc.boldN)r%r&rSrVr�rrrrr��sr�cCst�at|�dS)zCThe first time this is called, determine what kind of pager to use.N)�getpager�pagerr7rrrr��sr�c	s@ttjd�stSttjd�s tStj��r4tj��s8tStj�d�pNtj�d���r�tj	dkrj�fdd�Stj�d�dkr��fd	d�S�fd
d�Stj�d�dkr�tStj	dkr�dd�Sttd�r�t�
d
�dkr�dd�Sddl}|��\}}t�
|�z8ttd��r$t�
d|�dk�r$dd�W�StW�SW5t�|�XdS)z2Decide what method to use for paging through text.�isattyZMANPAGERZPAGER�win32cstt|���Sr���
tempfilepager�plainr7�Z	use_pagerrrry�rzzgetpager.<locals>.<lambda>ZTERM)ZdumbZemacscstt|���Sr�)�	pipepagerr�r7r�rrry�rzcs
t|��Sr��r�r7r�rrry�rzcSstt|�d�S)Nzmore <r�r7rrrry�rz�systemz(less) 2>/dev/nullrcSs
t|d�S)NZlessr�r7rrrry�rzNz	more "%s"cSs
t|d�S)NZmorer�r7rrrry�rz)rcr�stdin�
plainpager�stdoutr�r	r�rv�platformr��tempfileZmkstemp�close�unlink�ttypager)r��fdr�rr�rr��s6


 r�cCst�dd|�S)z%Remove boldface formatting from text.z.r)rrr7rrrr��sr�c	Cs�ddl}|j|d|jd�}zDtj|jdd��*}z|�|�Wntk
rPYnXW5QRXWntk
rrYnXz|�	�Wq�Wqttk
r�YqtXqtdS)z3Page through text by feeding it to another program.rNT)�shellr��backslashreplace)�errors)
�
subprocess�Popen�PIPE�io�
TextIOWrapperr��write�KeyboardInterruptr��wait)r/�cmdr��proc�piperrrr��sr�c
Cs~ddl}|���d}tj�|d�}t|ddtjdkr<t�d�ndd��}|�	|�W5QRXt�
|d|d	�W5QRXdS)
z<Page through text by invoking a program on a temporary file.rNz	pydoc.out�wr�r�)r��encodingz "r%)r�ZTemporaryDirectoryr	rr!r�rr��device_encodingr�r�)r/r�r�Ztempdirr�r�rrrr��s
��r�cCs$ttjdd�pd}|�|d��|�S)Nr��utf-8r�)r<rr��encode�decode)r/r�rrr�_escape_stdoutsr�c
Cs�tt|���d�}z2ddl}tj��}|�|�}|�|�dd�}Wn(t	t
tjfk
rld}dd�}YnX�z0zttj�dd��}Wntk
r�d}YnX|dkr�d	}|d}}tj�d�|d|��d�||d��r�tj�d
�tj��|�}	|	dk�rtj�d��q�n,|	d
k�rJtj�d||d�|d}q�|	dk�rn|||}|dk�rnd}tj�dd�||||��d�||}q�W5|�r�|�
||j|�XdS)z%Page through text on a text terminal.rrNcSstj�d�Sr@)rr�r�rrrrryrzzttypager.<locals>.<lambda>cSstj��dd�dd�S)Nr�r)rr�r�rrrrryrzZLINESr�z
-- more --)�q�Qz
          
)�
r)�b�B�)r�r�r�ttyrr��filenoZ	tcgetattrZ	setcbreakr�r�r��UnsupportedOperationZ	tcsetattrZ	TCSAFLUSHr+r	r�rvr�r�r�r!�flush)
r/r#r�r��oldZgetchar�hr�Zincr:rrrr�	sL








&r�cCstj�tt|���dS)z>Simply print unformatted text.  This is the ultimate fallback.N)rr�r�r�r�r7rrrr�5sr�cCs�t�|�r>|jtjkr d|jSt|d�r4d|jSd|jSt�|�rRd|jSt�|�rtd|jj	|jj|jfSt�
|�r�d|jj	|jj|jfSt�|�r�d|jSt�|�r�d	|jSt�
|�r�d
|jSt|�jS)z/Produce a short description of the given thing.zbuilt-in module rRzpackage zmodule zbuilt-in function zgetset descriptor %s.%s.%szmember descriptor %s.%s.%sr�z	function zmethod )rr*r%rr�rcr;Zisgetsetdescriptor�__objclass__r&Zismemberdescriptorr+rMr:r�)�thingrrr�describe9s6







�
�





r�c	Cs�dd�|�d�D�}d\}}|t|�kr\td�|d|d��|�}|r\||d}}qq\q|rf|}nt}||d�D],}zt||�}Wqvtk
r�YdSXqv|S)z@Locate an object by name or dotted path, importing as necessary.cSsg|]}|r|�qSrr)rqr�rrrr�Vszlocate.<locals>.<listcomp>rruNr)rr r�r!r�r<r�)rr�rSr��nZ
nextmodulerr�rrr�locateTs r�cCsVt|t�r0t||�}|dkr(td|��||fSt|dd�}|t|t�rL|ndfSdS)zDGiven an object or a path to an object, get the object and its name.Nz~No Python documentation found for %r.
Use help() to get the interactive help utility.
Use help(str) for help on the str class.r%)rkrJr�r�r<)r�r�rr(rrr�resolvems

�r� Python Library Documentation: %scCs�|dkrt}t||�\}}t|�}t�|�}|rTd|krT|d|d|�d��7}n|rn||k	rn|d|j7}t�|�s�t�|�s�t�	|�s�t�
|�s�t|�}|d7}||d|�||�S)zBRender text documentation, given an object or a path to an object.Nrz in z in module z objectr)
r/rr�rrL�rfindr%r*r+r,rjr�r�)r�rr�Zrendererrr(r�r�rrr�
render_doc{s&

���rc
Csfz2|dkrtt|||��n|�t|||t��Wn.ttfk
r`}zt|�W5d}~XYnXdS)zCDisplay text documentation, given an object or a path to an object.N)r�rr��	plaintextr�r��print)r�rr��outputrIrrrr"�sr"c
Cs�z`t||�\}}t�t|�t�||��}t|dddd��}|�|�W5QRXtd|d�Wn.tt	fk
r�}zt|�W5d}~XYnXdS)z<Write HTML documentation to a file in the current directory.r�r�r�)r�ZwroteN)
r�htmlrr�r�r�r�rr�r�)r�r�rr(rr�rIrrr�writedoc�srrcCs2|dkri}t�|g|�D]\}}}t|�qdS)zAWrite out HTML documentation for all modules in a directory tree.N)rN�
walk_packagesr)r�pkgpathZdonerXr'rYrrr�	writedocs�s

rcJ@s"eZdZddddddddddd	d
ddd
ddddddddddddddddddddd�#Zd d!�d"D�Zd�e�d'd(d)d*d+d,d-�Zd.d/d0d1d2d3d4d5d6d7d8d9d9d:d:d;�Ze��D]:\ZZ	e	D],Z
e�e
e�Zeekr�ed<eZeee
<q�q�d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdLdMdNdOdPdQddRdSdSdTdUdVdWdXdYdZd[d\d]d^d_d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{ddd|d}d~dd��IZd�d�d��Z
ed�d���Zed�d���Zd�d��Ze�Zefd�d��Zd�d��Zd�d��Zd�d��Zd�d��Zd�d�d��Zd�d��Zd�d��Zd�d��Zd�d�d��Zd�d�d��Zd�d��Zd�d�d��Z d�S)��Helperr�BOOLEAN�with)�assertr)�asyncr)�awaitr)�break�	while for)�classzCLASSES SPECIALMETHODS)�continuer)Zfunctionr)�del�BASICMETHODS�if)�elser�try)�forzbreak continue while�import)�globalznonlocal NAMESPACES)r�
TRUTHVALUE)r�MODULES)�in�SEQUENCEMETHODS�
COMPARISON)�lambdar�)�nonlocalzglobal NAMESPACES)�passr)�raise�
EXCEPTIONS)�returnr�)rr')�whilezbreak continue if TRUTHVALUE)rz CONTEXTMANAGERS EXCEPTIONS yield)�yieldr)#�False�None�True�and�asrrrrrr�defr�elifr�except�finallyr�fromrrrr �isr#r$�not�orr%r&r(rr)rr*cCsg|]}dD]}||�qqS)��'r%r)rq�pr�rrrr��szHelper.<listcomp>)r��fr��ur9�'''r%r�)�+rt�*�**r�z//�%�<<�>>r��|�^�~r�r��<=�>=�==�!=�<>)r�r�rGrHrIrJrK)rtrF)z+=z-=z*=z/=z%=z&=z|=z^=z<<=z>>=z**=z//=)rBrCr�rDrErF)�j�J)�STRINGS�	OPERATORSr"�UNARY�AUGMENTEDASSIGNMENT�BITWISE�COMPLEXzOPERATORS FORMATTING�POWERzTUPLES LISTS FUNCTIONSz ATTRIBUTES FLOAT MODULES OBJECTS�ELLIPSISzSLICINGS DICTIONARYLITERALSz	def classrN�PRIVATENAMESzPRIVATENAMES SPECIALMETHODSZ
BACKQUOTESzTUPLES FUNCTIONS CALLSzLISTS SUBSCRIPTS SLICINGS)rAr@�,rr2�:�@r�r_r^�`r&r5�[�]r�)�typeszRSTRINGS UNICODE NUMBERS SEQUENCES MAPPINGS FUNCTIONS CLASSES MODULES FILES inspect)�stringsz4str UNICODE SEQUENCES STRINGMETHODS FORMATTING TYPES)zstring-methodszSTRINGS FORMATTING)Z
formatstringsrO)r^z:encodings unicode SEQUENCES STRINGMETHODS FORMATTING TYPES)ZnumberszINTEGER FLOAT COMPLEX TYPES)Zintegersz	int range)Zfloatingz
float math)Z	imaginaryz
complex cmath)Ztypesseqz$STRINGMETHODS FORMATTING range LISTS�DICTIONARIES)Ztypesfunctionsz	def TYPES)Ztypesmethodszclass def CLASSES TYPES)zbltin-code-objectszcompile FUNCTIONS TYPES)zbltin-type-objectsztypes TYPES�TYPES)zbltin-null-objectr)zbltin-ellipsis-object�SLICINGS)Zspecialattrsr)r]z!class SPECIALMETHODS PRIVATENAMES)Ztypesmodulesr)zoperator-summaryz�lambda or and not in is BOOLEAN COMPARISON BITWISE SHIFTING BINARY FORMATTING POWER UNARY ATTRIBUTES SUBSCRIPTS SLICINGS CALLS TUPLES LISTS DICTIONARIES�EXPRESSIONS)Zobjectsr`)ZspecialnameszbBASICMETHODS ATTRIBUTEMETHODS CALLABLEMETHODS SEQUENCEMETHODS MAPPINGMETHODS NUMBERMETHODS CLASSES)Z
customizationzhash repr str SPECIALMETHODS)zattribute-accesszATTRIBUTES SPECIALMETHODS)zcallable-typeszCALLS SPECIALMETHODS)�sequence-typesz(SEQUENCES SEQUENCEMETHODS SPECIALMETHODS)rczMAPPINGS SPECIALMETHODS)z
numeric-typesz*NUMBERS AUGMENTEDASSIGNMENT SPECIALMETHODS)Z	execmodelz%NAMESPACES DYNAMICFEATURES EXCEPTIONS)Znamingz3global nonlocal ASSIGNMENT DELETION DYNAMICFEATURES)zdynamic-featuresr�
NAMESPACES)r�ztry except finally raise)Zconversionsr)Zidentifierszkeywords SPECIALIDENTIFIERS)z
id-classesr)zatom-identifiersr)z
atom-literalsz=STRINGS NUMBERS TUPLELITERALS LISTLITERALS DICTIONARYLITERALS�	SEQUENCES)Z	exprlistszTUPLES LITERALS)ztypesseq-mutable�LISTLITERALS)ZlistszLISTS LITERALS)Ztypesmapping�DICTIONARYLITERALS)rzDICTIONARIES LITERALS)zattribute-referencesz(getattr hasattr setattr ATTRIBUTEMETHODS)Z
subscriptionsr!)Zslicingsr!)Zcallsrb)Zpowerrb)Zunaryrb)Zbinaryrb)Zshiftingrb)Zbitwiserb)ZcomparisonszEXPRESSIONS BASICMETHODS)ZbooleanszEXPRESSIONS TRUTHVALUEr)Z
assignmentrQ)Z	augassign�
NUMBERMETHODSrr()Zcompoundzfor while break continue)�truthz if while and or not BASICMETHODS)ZdebuggerZpdb)zcontext-managersr)Ir`rNZ
STRINGMETHODSZ
FORMATTING�UNICODEZNUMBERSZINTEGERZFLOATrSreZMAPPINGSr�ZMETHODSZCODEOBJECTSZTYPEOBJECTSZFRAMEOBJECTSZ
TRACEBACKSZNONErUZSPECIALATTRIBUTESr�rZPACKAGESrbrOZ
PRECEDENCEZOBJECTSZSPECIALMETHODSrZATTRIBUTEMETHODSZCALLABLEMETHODSr!ZMAPPINGMETHODSrhZ	EXECUTIONrdZDYNAMICFEATURESZSCOPINGZFRAMESr'ZCONVERSIONSZIDENTIFIERSZSPECIALIDENTIFIERSrVZLITERALSZTUPLESZ
TUPLELITERALSZLISTSrfr_rgZ
ATTRIBUTESZ
SUBSCRIPTSraZCALLSrTrPZBINARYZSHIFTINGrRr"r
Z	ASSERTIONZ
ASSIGNMENTrQZDELETIONZ	RETURNINGZ	IMPORTINGZCONDITIONALZLOOPINGrZ	DEBUGGINGZCONTEXTMANAGERSNcCs||_||_dSr�)�_input�_output)r>�inputrrrrr�^szHelper.__init__cCs|jp
tjSr�)rkrr�r�rrrrmbszHelper.inputcCs|jp
tjSr�)rlrr�r�rrrrfsz
Helper.outputcCs2t��dddkr|�dSd|jj|jjfS)Nrr1�?rz<%s.%s instance>)r�stackr�r&rSr�rrr�__repr__js�zHelper.__repr__cCs6||jk	r|�|�n|��|��|j�d�dS)Na
You are now leaving help and returning to the Python interpreter.
If you want to ask for help on a particular object directly from the
interpreter, you can type "help(object)".  Executing "help('string')"
has the same effect as typing a particular string at the help> prompt.
)�_GoInteractiver�intro�interactrr��r>Zrequestrrr�__call__rs

zHelper.__call__c	Cs�|j�d�z|�d�}|s Wq�Wnttfk
r>Yq�YnX|��}t|�dkr�|d|dkrpdkr�nn |d|dd�kr�|dd�}|��dkr�q�|d	kr�|��q|�	|�qdS)
Nrzhelp> rrr�r8r)r��quitr)
rr��getliner��EOFErrorrr r�rrrrtrrrrss"

,�
zHelper.interactcCs8|jtjkrt|�S|j�|�|j��|j��SdS)z.Read one line, using input() when appropriate.N)rmrr�rr�r�r�)r>�promptrrrrw�s

zHelper.getlinecCs<t|�td�k�r|��}|dkr,|��n�|dkr>|��n�|dkrP|��n�|dkrb|��n�|dd�dkr�|�|��d�n�||jkr�|�|�nj|d	kr�t	t
|�d
�nR||jkr�|�|�n<||j
kr�|�|�n&|r�t	|d
|jd�nt	td
|jd�n$t|t��r|�nt	|d
|jd�|j�d�dS)
Nr�keywords�symbols�topicsr��zmodules r)r-r+r,zHelp on %s:)rr)r�r�listkeywords�listsymbols�
listtopics�listmodulesrr{�
showsymbolr"�evalrz�	showtopicr|rlrJrkrrr�rtrrrr�s6






zHelper.helpcCs$|j�d�dtjdd���dS)Na�
Welcome to Python {0}'s help utility!

If this is your first time using Python, you should definitely check out
the tutorial on the Internet at https://docs.python.org/{0}/tutorial/.

Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules.  To quit this help utility and
return to the interpreter, just type "quit".

To get a list of available modules, keywords, symbols, or topics, type
"modules", "keywords", "symbols", or "topics".  Each module also comes
with a one-line summary of what it does; to list the modules whose name
or summary contain a given string such as "spam", type "modules spam".
z%d.%dr)rr�rrr�r�rrrrr�s
�zHelper.intror��Pc	
Cs�tt|��}||}t|�|d|}t|�D]v}t|�D]\}|||}|t|�kr<|j�||�||dkr<|j�dd|dt||��q<|j�d�q0dS)Nrr�r)rr�r rrr�)	r>�items�columnsr
Zcolwr�rowrrrrrrr�s&zHelper.listcCs |j�d�|�|j���dS)NzN
Here is a list of the Python keywords.  Enter any keyword to get more help.

)rr�rrzrEr�rrrr~�szHelper.listkeywordscCs |j�d�|�|j���dS)Nzx
Here is a list of the punctuation symbols which Python assigns special meaning
to. Enter any symbol to get more help.

)rr�rr{rEr�rrrr�szHelper.listsymbolscCs |j�d�|�|j���dS)NzN
Here is a list of available topics.  Enter any topic name to get more help.

)rr�rr|rEr�rrrr��szHelper.listtopicscCs0zddl}Wn"tk
r.|j�d�YdSX|j�||j�|��}|sb|j�dt|��dSt|�td�kr~|�	||�S|\}}z|jj|}Wn*t
k
r�|j�dt|��YdSX|��d}|r�|p�dd|}|�r$ddl}dd�
|���d}	|�|	d	�}
|d
d�
|
�7}t|�dS)Nr�t
Sorry, topic and keyword documentation is not available because the
module "pydoc_data.topics" could not be found.
zno documentation found for %s
rrr��Related help topics: r4�Hz
%s
)�pydoc_data.topicsr�rr�r|rvrzr�r�r��KeyErrorr�textwrapr!rZwrapr�)r>�topic�
more_xrefs�
pydoc_data�target�label�xrefsr"r�r/Zwrapped_textrrrr��s4zHelper.showtopiccCs�zddl}Wntk
r"YdSX|j�||j�|��}|sFtd��t|t�r\|�||�S|\}}|jj|}|r�|pzdd|}||fS)a*Return unbuffered tuple of (topic, xrefs).

        If an error occurs here, the exception is caught and displayed by
        the url handler.

        This function duplicates the showtopic method but returns its
        result directly so it can be formatted for display in an html page.
        rN)r�rzcould not find topicrr�)	r�r�r|rvrzr�rkrJ�	_gettopic)r>r�r�r�r�r�r�r"rrrr�s	
zHelper._gettopiccCs*|j|}|�d�\}}}|�||�dS)Nr�)r{�	partitionr�)r>�symbolr�r�r_r�rrrr�!s
zHelper.showsymbolcsv|r |j�d�|��t|�nR|j�d�i}|fdd���fdd�}t�j�|d�|�|���|j�d�dS)	Nzy
Here is a list of modules whose name or summary contains '{}'.
If there are any, enter a module name to get more help.

zI
Please wait a moment while I gather a list of all available modules...

cSs>|r$|dd�dkr$|dd�d}|�d�dkr:d||<dS)N����	.__init__r�rrr)�find)rr'r�r�rrr�callback4sz$Helper.listmodules.<locals>.callbackcs�d|d�dSr�rr��r�rr�onerror9sz#Helper.listmodules.<locals>.onerror�r�z�
Enter any module name to get more help.  Or, type "modules spam" to search
for modules whose name or summary contain the string "spam".
)rr�r�apropos�
ModuleScanner�runrrE)r>rHr�r�rr�rr�&s
�
zHelper.listmodules)r9r=r%r�)NN)r�r�)r)r)r)!r%r&rSrzZ_strprefixesZ_symbols_inverser{r�r�Zsymbols_r�rvr|r�rlrmrrprrqrursrwrrrrr~rr�r�r�r�r�rrrrr�sB�'���W



	


 
rc@seZdZdZddd�ZdS)r�z7An interruptible scanner that searches module synopses.Nc	Cs
|r|��}d|_i}tjD]p}|dkrd||<|dkrF|d|d�qt|�jpRd}|�d�d}|d|}|���|�dkr|d||�qtj	|d�D�]\\}	}}
|jr��q�|dkr�|d|d�q�zt�
|	|�}Wntk
r�Yq�YnX|j}t
|d	��rnz|�|�}
Wn(tk
�r:|�r2||�Yq�YnXtt�|
���pNd}t
|d
��rh|�|�}nd}n`ztj�|�}Wn(tk
�r�|�r�||�Yq�YnX|j�r�|j��dnd}t|dd�}|d|}|���|�dkr�||||�q�|�r|�dS)NF�__main__rrrrr�r��
get_source�get_filenamerY)r�rvrr�r�rVrr�rNr	�	_get_specr�r�rcr�rcr�r��StringIOr�r�r�r�r�r�r<)r>r�rHZ	completerr��seenr'r(r�rXrYr�r��sourcerr�rrrr�Gs`



zModuleScanner.run)NNN)r%r&rSrVr�rrrrr�Dsr�c	CsDdd�}dd�}t���"t�d�t�j|||d�W5QRXdS)zAPrint all the one-line module summaries that contain a substring.cSs6|dd�dkr |dd�d}t||o.d|�dS�Nr�r�r�z- )r�rr'r�rrrr��szapropos.<locals>.callbackcSsdSr�rr�rrrr��szapropos.<locals>.onerror�ignorer�N)�warnings�catch_warnings�filterwarningsr�r�)rHr�r�rrrr��s


r�cs�ddl�ddl�ddl�ddl�Gdd�d�jj��G�fdd�d�jj��G�����fdd�d�j�}||||�}|��|j	s�|j
s�t�d	�q~|S)
aAStart an HTTP server thread on a specific port.

    Start an HTML/text server thread, so HTML or text documents can be
    browsed dynamically and interactively with a Web browser.  Example use:

        >>> import time
        >>> import pydoc

        Define a URL handler.  To determine what the client is asking
        for, check the URL and content_type.

        Then get or generate some text or HTML code and return it.

        >>> def my_url_handler(url, content_type):
        ...     text = 'the URL sent was: (%s, %s)' % (url, content_type)
        ...     return text

        Start server thread on port 0.
        If you use port 0, the server will pick a random port number.
        You can then use serverthread.port to get the port number.

        >>> port = 0
        >>> serverthread = pydoc._start_server(my_url_handler, port)

        Check that the server is really started.  If it is, open browser
        and get first page.  Use serverthread.url as the starting page.

        >>> if serverthread.serving:
        ...    import webbrowser

        The next two lines are commented out so a browser doesn't open if
        doctest is run on this module.

        #...    webbrowser.open(serverthread.url)
        #True

        Let the server do its thing. We just need to monitor its status.
        Use time.sleep so the loop doesn't hog the CPU.

        >>> starttime = time.monotonic()
        >>> timeout = 1                    #seconds

        This is a short timeout for testing purposes.

        >>> while serverthread.serving:
        ...     time.sleep(.01)
        ...     if serverthread.serving and time.monotonic() - starttime > timeout:
        ...          serverthread.stop()
        ...          break

        Print any errors that may have occurred.

        >>> print(serverthread.error)
        None
   rNc@seZdZdd�Zdd�ZdS)z!_start_server.<locals>.DocHandlercSsX|j�d�rd}nd}|�d�|�dd|�|��|j�|�|j|��d��dS)	z�Process a request from an HTML browser.

            The URL received is in self.path.
            Get an HTML page from self.urlhandler and send it.
            z.css�text/css�	text/html��zContent-Typez%s; charset=UTF-8r�N)	rrbZ
send_responseZsend_headerZend_headersZwfiler��
urlhandlerr�)r>�content_typerrr�do_GET�s

��z(_start_server.<locals>.DocHandler.do_GETcWsdSr�r)r>r�rrr�log_message�sz-_start_server.<locals>.DocHandler.log_messageN)r%r&rSr�r�rrrr�
DocHandler�sr�cs(eZdZdd�Z�fdd�Zdd�ZdS)z _start_server.<locals>.DocServercSs6||_|j|f|_||_|j�||j|j�d|_dS�NF)�hostZaddressr�rJr��handlerrv)r>r��portr�rrrr��s
z)_start_server.<locals>.DocServer.__init__cs>|js2��|j��gggd�\}}}|r|��q|��dSr@)rv�selectZsocketr�Zhandle_requestZserver_close)r>ZrdZwrZex�r�rr�serve_until_quit�s

z1_start_server.<locals>.DocServer.serve_until_quitcSs |j�|�|jr|�|�dSr�)rJ�server_activater�r�rrrr��sz0_start_server.<locals>.DocServer.server_activateN)r%r&rSr�r�r�rr�rr�	DocServer�sr�cs:eZdZ�fdd�Z����fdd�Zdd�Zdd�Zd	S)
z#_start_server.<locals>.ServerThreadcs2||_||_t|�|_�j�|�d|_d|_dSr�)r�r�r+r��Threadr��serving�error)r>r�r�r�)�	threadingrrr��s
z,_start_server.<locals>.ServerThread.__init__c
sxzJ�jj�_��_�jj�_t|j��_�|j	|j
|j�}||_|�
�Wn(tk
rr}z
||_W5d}~XYnXdS)zStart the server.N)�server�
HTTPServerrJr�r�ZMessageZMessageClass�staticmethodr�r�r��ready�	docserverr�rcr�)r>Zdocsvr�e)r�r��email�httprrr�	s

z'_start_server.<locals>.ServerThread.runcSs,d|_|j|_|j|_d|j|jf|_dS)NTz
http://%s:%d/)r�r�Zserver_portr�r")r>r�rrrr�	sz)_start_server.<locals>.ServerThread.readycSs&d|j_|��d|_d|_d|_dS)z&Stop the server and this thread nicelyTNF)r�rvr!r�r"r�rrr�stop	s
z(_start_server.<locals>.ServerThread.stopN)r%r&rSr�r�r�r�r)r�r�r�r�r�rr�ServerThread�s
r�g{�G�z�?)
Zhttp.serverZ
email.messager�r�r�ZBaseHTTPRequestHandlerr�r�r1r�r��time�sleep)r��hostnamer�r��threadr)r�r�r�r�r�r�r�
_start_server�s8'r�r�c
s(G�fdd�dt�}|���fdd���fdd���fdd���fd	d
���fdd���fd
d���fdd���fdd����������fdd�}|�d�r�|dd�}|dk�rtj�tj�t��}tj�||�}t|��}d�|�	��W5QR�SQRXn|dk�r||�St
d||f��dS)aThe pydoc url handler for use with the pydoc server.

    If the content_type is 'text/css', the _pydoc.css style
    sheet is read and returned if it exits.

    If the content_type is 'text/html', then the result of
    get_html_page(url) is returned.
    cseZdZ�fdd�ZdS)z_url_handler.<locals>._HTMLDoccsd}d|}d||��|fS)rzpydoc_data/_pydoc.cssz1<link rel="stylesheet" type="text/css" href="%s">a<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Pydoc: %s</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
%s</head><body bgcolor="#f0f0f8">%s<div style="clear:both;padding-top:.5em;">%s</div>
</body></html>r)r>rr�css_pathZcss_link��html_navbarrrr2	s���z#_url_handler.<locals>._HTMLDoc.pageN)r%r&rSrrr�rr�_HTMLDoc0	sr�cs>��dt��t��dt��f�}d|��tjdd��fS)Nz%s [%s, %s]raZ
            <div style='float:left'>
                Python %s<br>%s
            </div>
            <div style='float:right'>
                <div style='text-align:center'>
                  <a href="index.html">Module Index</a>
                  : <a href="topics.html">Topics</a>
                  : <a href="keywords.html">Keywords</a>
                </div>
                <div>
                    <form action="get" style='display:inline;'>
                      <input type=text name=key size=15>
                      <input type=submit value="Get">
                    </form>&nbsp;
                    <form action="search" style='display:inline;'>
                      <input type=text name=key size=15>
                      <input type=submit value="Search">
                    </form>
                </div>
            </div>
            T)Zterse)r�r�Zpython_versionZpython_buildZpython_compiler)rU�rrrr�B	s
��z!_url_handler.<locals>.html_navbarcs�dd�}��ddd�}dd�tjD�}��||�}|d��d	dd
|�g}i}tjD]}|���||��qT|�d�dd
�|�fS)zModule Index page.cSsd||fS�Nrr�r(rrr�	bltinlink`	sz3_url_handler.<locals>.html_index.<locals>.bltinlinkz7<big><big><strong>Index of Modules</strong></big></big>rArBcSsg|]}|dkr|�qS)r�r)rqr(rrrr�f	s�z4_url_handler.<locals>.html_index.<locals>.<listcomp>z<p>zBuilt-in ModulesrFz|<p align=right><font color="#909090" face="helvetica,arial"><strong>pydoc</strong> by Ka-Ping Yee&lt;ping@lfw.org&gt;</font>zIndex of Modulesr)	rrr�rrrr
r�r!)r�r�namesrr�rr�rr�
html_index]	s*��
�z _url_handler.<locals>.html_indexc		s�g��fdd�}t���*t�d�dd�}t�j|||d�W5QRXdd�}g}��d	d
d�}�D]\}}|�||�|�qf|��d|d
d
d�|��}d|fS)zSearch results page.cs:|dd�dkr |dd�d}��||o0d|f�dSr�rKr��Z
search_resultrrr�{	sz3_url_handler.<locals>.html_search.<locals>.callbackr�cSsdSr�rr�rrrr��	sz2_url_handler.<locals>.html_search.<locals>.onerrorr�cSsd||fSr�rr�rrrr��	sz4_url_handler.<locals>.html_search.<locals>.bltinlinkz5<big><big><strong>Search Results</strong></big></big>rArBzkey = %srF�<br>zSearch Results)	r�r�r�r�r�rr
rr!)	rHr�r�r�rnrr(r�rr�r�r�html_searchv	s,

��z!_url_handler.<locals>.html_searchcsLdd�}��ddd�}ttj���}��||�}|��ddd|�}d|fS)zIndex of topic texts available.cSsd||fS�Nz<a href="topic?key=%s">%s</a>rr�rrrr��	sz4_url_handler.<locals>.html_topics.<locals>.bltinlink�,<big><big><strong>INDEX</strong></big></big>rArBZTopicsrF)rr�rr|rErr)r�rr�rr�rr�html_topics�	s��z!_url_handler.<locals>.html_topicscsL��ddd�}ttj���}dd�}��||�}|��ddd|�}d|fS)zIndex of keywords.r�rArBcSsd||fSr�rr�rrrr��	sz6_url_handler.<locals>.html_keywords.<locals>.bltinlinkZKeywordsrF)rr�rrzrErr)rr�r�rr�rr�
html_keywords�	s��z#_url_handler.<locals>.html_keywordscs�t��}t||�}|�|�\}}||jkr0d}nd}��d|dd�}d��|�}��|dd|�}|r�t|�	��}dd	�}��
||�}��d
dd|�}d||fd�|||f�fS)
zTopic or keyword help page.ZKEYWORDZTOPICr=rArBz
<pre>%s</pre>rFcSsd||fSr�rr�rrrr��	sz7_url_handler.<locals>.html_topicpage.<locals>.bltinlinkr�z%s %sr)
r�r�rr�rzrr3rr�rrrr!)r�ZbufZhtmlhelprr�rrr�r�rr�html_topicpage�	s2

��
�z$_url_handler.<locals>.html_topicpagecs@t|dd�}|dkr$|dkr$td��t|�}��||�}||fS)Nr)r�r,zcould not find object)r�r�r�r�)r"rer�contentr�rr�html_getobj�	sz!_url_handler.<locals>.html_getobjcsP��ddd�}d��fdd�tt|�|�D��}|��|dd|�}d||fS)	Nz,<big><big><strong>Error</strong></big></big>rArBr�c3s|]}��|�VqdSr�)r�r�r�rrr��	sz3_url_handler.<locals>.html_error.<locals>.<genexpr>z#bb0000z
Error - %s)rr!rr�r)r"r�rrr�rr�
html_error�	s���z _url_handler.<locals>.html_errorc
sr|}|�d�r|dd�}�z|dkr2��\}}n�|dkrF��\}}n�|dkrZ��\}}n�d|k�r$|�d�\}}}|dkr��|�\}}n�|d	kr�z�|�\}}Wn tk
r��|�\}}YnXn\|d
k�r|dkr��\}}n4z�|�\}}Wn"tk
�r�|�\}}YnXntd��n�|�\}}Wn2tk
�rd}z�||�\}}W5d}~XYnX��||�S)zGenerate an HTML page for url.r�N���)rr�r|rzr�z
search?keyz	topic?keyzget?keyz
bad pydoc url)rbr�r�rcr)r"Zcomplete_urlrr��opr_r�)rr�r�r�r�r�r�r�rr�
get_html_page�	s>



 z#_url_handler.<locals>.get_html_pager�rNr�rr�z"unknown content type %r for url %s)rrar	r�dirname�realpathrYr!r��	readlinesr})r"r�r�r�Z	path_herer��fpr)	rr�r�r�r�r�r�r�r�r�_url_handler'	s*	
(


"
r�T�	localhost)�open_browserr�c	Cs�ddl}tt||�}|jr(t|j�dS|jr�d}|rB|�|j�z~zZtd|j�t|�|jr�t	d�}|�
�}|dkr|q�qZ|dkr�|�|j�qZt|�qZWnttfk
r�t�YnXW5|jr�|��td�XdS)	z�Start the enhanced pydoc Web server and open a Web browser.

    Use port '0' to start the server on an arbitrary port.
    Set open_browser to False to suppress opening a browser.
    rNz"Server commands: [b]rowser, [q]uitzServer stoppedzServer ready atzserver> r�r�)
�
webbrowserr�r�r�rr�r�r"r�rmr�r�rx)r�r�r�r�ZserverthreadZserver_help_msgr�rrr�browse
s2
r�cCst|t�o|�tj�dkSru)rkrJr�r	�sep)rNrrr�ispath9
sr�cCsvd|kstj|kst��|kr"dStj�t�}tj�|�}|��}||krbtj�||�sb|�|�|�	dt���|S)z�Ensures current directory is on returned path, and argv0 directory is not

    Exception: argv0 dir is left alone if it's also pydoc's directory.

    Returns a new path entry list, or None if no adjustment is needed.
    rNr)
r	�curdir�getcwdrr�rY�copy�samefile�remove�insert)Z
given_pathZargv0Z
stdlib_dirZ
script_dir�revised_pathrrr�_get_revised_path<
s

r�cCs,ttjtjd�}|dk	r(|tjdd�<dS)z�Ensures current directory is on sys.path, and __main__ directory is not.

    Exception: __main__ dir is left alone if it's also pydoc's directory.
    rN)r�rr�argv)r�rrr�_adjust_cli_sys_pathX
sr�cCs�ddl}Gdd�dt�}t��zv|�tjdd�d�\}}d}d}d}d}d}|D]\\}	}
|	d	krld
}d
}|	dkr�t|
�WdS|	dkr�d
}|
}|	d
kr�d
}|	dkrTd
}|
}qT|r�t|||d�WdS|s�|�|D]�}t|��rtj	�
|��std|��q�z`t|��r&tj	�|��r&t
|�}|�rXt|��rNtj	�|��rNt|�nt|�n
t�|�Wq�tk
�r�}zt|�W5d}~XYq�Xq�WnN|j|fk
�r�tj	�tj	�tjd��d}
tdj|
tjd��YnXdS)z@Command-line interface (looks at sys.argv to decide what to do).rNc@seZdZdS)zcli.<locals>.BadUsageN)r%r&rSrrrr�BadUsagee
srrzbk:n:p:wFr�z-bTz-kz-pz-wz-n)r�r�zfile %r does not exista�pydoc - the Python documentation tool

{cmd} <name> ...
    Show text documentation on something.  <name> may be the name of a
    Python keyword, topic, function, module, or package, or a dotted
    reference to a class or function within a module or module in a
    package.  If <name> contains a '{sep}', it is used as the path to a
    Python source file to document. If name is 'keywords', 'topics',
    or 'modules', a listing of these things is displayed.

{cmd} -k <keyword>
    Search for a keyword in the synopsis lines of all available modules.

{cmd} -n <hostname>
    Start an HTTP server with the given hostname (default: localhost).

{cmd} -p <port>
    Start an HTTP server on the given port on the local machine.  Port
    number 0 can be used to get an arbitrary unused port.

{cmd} -b
    Start an HTTP server on an arbitrary unused port and open a Web browser
    to interactively browse documentation.  This option can be used in
    combination with -n and/or -p.

{cmd} -w <name> ...
    Write out the HTML documentation for a module to a file in the current
    directory.  If <name> contains a '{sep}', it is treated as a filename; if
    it names a directory, documentation is written for all the contents.
)r�r�)�getoptrcr�rr�r�r�r�r	r�existsrr�r�rrrrr�r�r�r�rr�)rrZoptsr�ZwritingZstart_serverr�r�r��opt�val�argrIr�rrr�clib
sd

 �rr�)NN)r)r)rrN)rrN)r)rN)r�)r)ZrVrGrWrQrUr�Zimportlib._bootstrapr�Zimportlib._bootstrap_external�importlib.machinery�importlib.utilrr�r	rNr�rrr�r�r�Zurllib.parserHr��collectionsr�reprlibr�	tracebackrrrr$r)r.r0r5r'�
IGNORECASEr6r8r?rDrOrfrir�r�r�r�rcr�r�r�r�r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r/rrrrr"rrrrr�r�r�r�r�r�r�r�rr%rrrr�<module>s�&
	


'
0:*> ",

�
�


=
n%
U
__pycache__/ast.cpython-38.opt-2.pyc000064400000024137151153537560013155 0ustar00U

e5d"K�@s�ddlTd<ddd�dd�Zd	d
�Zd=dd
�Zdd�Zdd�Zd>dd�Zdd�Zdd�Zd?dd�Z	dd�Z
dd�Zdd�d d!�Zd"d#�Z
Gd$d%�d%e�ZGd&d'�d'e�Zd(d)�Zd*d+�Zeee�e_eee�e_Gd,d-�d-e�Zd.d/�ZGd0d1�d1eed2�ZGd3d4�d4eed2�ZGd5d6�d6eed2�ZGd7d8�d8eed2�ZGd9d:�d:eed2�Zeee e!fee"fee#feed�e$feed;�fiZ%ee$fiZ&e$d8ed�d8ed1e d1e!d1e"d4e#d6ed;�d:iZ'dS)@�)�*�	<unknown>�execFN)�
type_comments�feature_versioncCsFt}|r|tO}t|t�r(|\}}|}n|dkr4d}t|||||d�S)N���)�_feature_version)Z
PyCF_ONLY_ASTZPyCF_TYPE_COMMENTS�
isinstance�tuple�compile)�source�filename�moderr�flags�major�minor�r�/usr/lib64/python3.8/ast.py�parses

�rcs`t|t�rt|dd�}t|t�r&|j}dd���fdd���fdd������fd	d
���|�S)N�eval)rcSstd|����dS)Nzmalformed node or string: )�
ValueError��noderrr�_raise_malformed_node>sz+literal_eval.<locals>._raise_malformed_nodecs,t|t�rt|j�tttfkr&�|�|jS�N)r	�Constant�type�value�int�float�complexr)rrr�_convert_num@sz"literal_eval.<locals>._convert_numcsDt|t�r<t|jttf�r<�|j�}t|jt�r6|
S|S�|�Sr)r	ZUnaryOp�opZUAddZUSub�operand)rr#)r!rr�_convert_signed_numDs
z)literal_eval.<locals>._convert_signed_numcst|t�r|jSt|t�r*tt�|j��St|t�rDtt�|j��St|t	�r^t
t�|j��St|t�r�t|j
�t|j�kr��|�ttt�|j
�t�|j���St|t��rt|jttf��r�|j�}�|j�}t|ttf��rt|t��rt|jt��r||S||S�|�Sr)r	rrZTupler
�mapZeltsZList�list�Set�setZDict�len�keys�values�dict�zipZBinOpr"ZAddZSub�left�rightrrr )rr.r/��_convertr!r$rrrr1Ls,





�

zliteral_eval.<locals>._convert)r	�strrZ
Expression�body)Znode_or_stringrr0r�literal_eval3s

r4Tcs2���fdd��t|t�s*td|jj���|�S)Nc	st|t�r�g}�}|jD]V}zt||�}Wntk
rBd}YqX|r`|�d|�|�f�q|��|��q�r�|jr�|jD]:}z |�d|�t||��f�Wq�tk
r�Yq�Xq�d|jjd�	|�fSt|t
�r�dd�	�fdd�|D��St|�S)NTz%s=%sz%s(%s)z, z[%s]c3s|]}�|�VqdSrr)�.0�x)�_formatrr�	<genexpr>�sz(dump.<locals>._format.<locals>.<genexpr>)r	�AST�_fields�getattr�AttributeError�append�_attributes�	__class__�__name__�joinr&�repr)r�args�keywords�fieldr�a�r7�annotate_fields�include_attributesrrr7ps*




 
zdump.<locals>._formatzexpected AST, got %r)r	r9�	TypeErrorr?r@)rrHrIrrGr�dumpfs

rKcCsVdD]L}||jkr||jkrt||d�}|dk	sDt||�r|�d�rt|||�q|S)N)�lineno�
col_offset�
end_lineno�end_col_offsetZend_)r>r;�hasattr�
startswith�setattr)�new_nodeZold_node�attrrrrr�
copy_location�s��rUcs �fdd���|dddd�|S)Ncs�d|jkr"t|d�s||_n|j}d|jkrDt|d�s>||_n|j}d|jkrft|d�s`||_n|j}d|jkr�t|d�s�||_n|j}t|�D]}�|||||�q�dS)NrLrNrMrO)r>rPrLrNrMrO�iter_child_nodes)rrLrMrNrO�child��_fixrrrY�s$







z#fix_missing_locations.<locals>._fix�rrrrrXr�fix_missing_locations�sr[rZcCsVt|�D]H}d|jkr(t|dd�||_d|jkrt|dd�}dk	r|||_q|S)NrLrrN)�walkr>r;rLrN)r�nrWrNrrr�increment_lineno�s
��r^c	cs:|jD].}z|t||�fVWqtk
r2YqXqdSr)r:r;r<)rrErrr�iter_fields�s

r_ccsLt|�D]>\}}t|t�r"|Vqt|t�r|D]}t|t�r0|Vq0qdSr)r_r	r9r&)r�namerE�itemrrrrV�s


rVcCs�t|ttttf�s"td|jj��|jr8t|jdt	�s<dS|jdj
}t|t�rZ|j}n"t|t
�rxt|j
t�rx|j
}ndS|r�ddl}|�|�}|S)Nz%r can't have docstringsr)r	ZAsyncFunctionDefZFunctionDefZClassDefZModulerJr?r@r3ZExprr�Str�srr2�inspectZcleandoc)rZclean�textrdrrr�
get_docstring�s	

rfcCs�d}g}d}|t|�krx||}||7}|d7}|dkr`|t|�kr`||dkr`|d7}|d7}|dkr|�|�d}q|r�|�|�|S)Nr�rZ�
�
z
)r)r=)r�idx�linesZ	next_line�crrr�_splitlines_no_ffs  

rmcCs,d}|D]}|dkr||7}q|d7}q|S)Nrgz	� r)r�resultrlrrr�_pad_whitespaces

rp)�paddedcCs�z$|jd}|jd}|j}|j}Wntk
r:YdSXt|�}||krd||��||���S|r�t||��d|����}nd}|||��|d���}	||��d|���}
||d|�}|�	d|	�|�
|
�d�|�S)NrZrgr)rLrNrMrOr<rm�encode�decoderp�insertr=rA)rrrqrLrNrMrOrkZpadding�firstZlastrrr�get_source_segment*s&	



rvccs<ddlm}||g�}|r8|��}|�t|��|VqdS)Nr)�deque)�collectionsrw�popleft�extendrV)rrwZtodorrrr\Ms
r\c@s$eZdZdd�Zdd�Zdd�ZdS)�NodeVisitorcCs"d|jj}t|||j�}||�S)N�visit_)r?r@r;�
generic_visit)�selfr�method�visitorrrr�visitoszNodeVisitor.visitcCsTt|�D]F\}}t|t�r:|D]}t|t�r|�|�qqt|t�r|�|�qdSr)r_r	r&r9r�)r~rrErrarrrr}us


zNodeVisitor.generic_visitc	Cs�|j}t�t|��}|dkr@t��D]\}}t||�r$|}q@q$|dk	r�d|}zt||�}Wntk
rrYn&Xddl}|�	|�d�t
d�||�S|�|�S)Nr|rz" is deprecated; add visit_Constant�)r�_const_node_type_names�getr�itemsr	r;r<�warnings�warn�PendingDeprecationWarningr})	r~rrZ	type_name�clsr`rr�r�rrr�visit_Constants(
�zNodeVisitor.visit_ConstantN)r@�
__module__�__qualname__r�r}r�rrrrr{[s
r{c@seZdZdd�ZdS)�NodeTransformercCs�t|�D]�\}}t|t�rvg}|D]D}t|t�r\|�|�}|dkrFq"nt|t�s\|�|�q"|�|�q"||dd�<qt|t�r|�|�}|dkr�t||�qt|||�q|Sr)	r_r	r&r9r�rzr=�delattrrR)r~rrE�	old_valueZ
new_valuesrrSrrrr}�s&






zNodeTransformer.generic_visitN)r@r�r�r}rrrrr��s$r�cCs|jSr�r)r~rrr�_getter�sr�cCs
||_dSrr�)r~rrrr�_setter�sr�c@seZdZdd�ZdS)�_ABCcCsft|t�sdS|tkrZz
|j}Wntk
r6YdSXt|t|�oXt|t�|d��St�||�S)NFr)	r	r�_const_typesrr<�_const_types_notr�r�__instancecheck__)r��instrrrrr��s

�z_ABC.__instancecheck__N)r@r�r�r�rrrrr��sr�cOsf|D]<}||jkrq|j�|�}|t|�krt|j�d|����q|tkrTt||�Stj|f|�|�S)Nz" got multiple values for argument )r:�indexr)rJr@r�r�__new__)r�rC�kwargs�key�posrrr�_new�s

r�c@seZdZdZeZdS)�Num)r]N�r@r�r�r:r�r�rrrrr��sr�)�	metaclassc@seZdZdZeZdS)rb�rcNr�rrrrrb�srbc@seZdZdZeZdS)�Bytesr�Nr�rrrrr�sr�c@seZdZeZdS)�NameConstantN)r@r�r�r�r�rrrrr�sr�c@seZdZdZdd�ZdS)�EllipsisrcOs(|tkrtd|�|�Stj|f|�|�S)N.).)r�rr�)r�rCr�rrrr�szEllipsis.__new__N)r@r�r�r:r�rrrrr�sr�.)rr)TF)rZ)T)(�_astrr4rKrUr[r^r_rVrfrmrprvr\�objectr{r�r�r��propertyrr]rcrr�r�r�rbr�r�r�rrr r2�bytes�boolr�r�r�rrrr�<module>sx�3
'#

#:>	
���__pycache__/_sysconfigdata_d_linux_x86_64-linux-gnu.cpython-38.opt-2.pyc000064400000070505151153537560022047 0ustar00U

��.e]���@s`dddddddddddd	d
dddd
ddddddddddddddddddddddd	dd dd!d"d#d$d%dddd&d'dd(d)d*d&d+dd!dd,d-dddddddd.d&d&d&d&dd&dd&d&d&d&d&dddddddddd&dd&d&d&d&d&d&d&d&dd&d&d&d&d&dd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&dd&d&d&dd&dd&dd&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&d&d&dd&d&d&d&d&d&dd&d&d&d&dd&d&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&d&d&dd&ddd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&dd&d&d&d&dd&d&d&d&d&ddd&d&dd&dddd&d&d&ddd&d&dddd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&d&d&dd&d&dd&d&dd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&dd&d&d&d&d&d&dd&d&d&d&d&d&d&d&ddd&d&d&dd&d&ddd&d&d&d&d&d&d&dddddd&dd&d&dddddd&ddd&d&d&d&d&d&d&d&d&d&d&ddd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&ddd&d&d&d&ddd&d&d&ddd&dd&d&d&d&d&d&d&d&d&d&d&d&d&d&dd
d/ddd0d1d0d0d2d3d4dd5d6d7ddd8dd	d9dd:d;dd<d=dd>ddd?d@dAdBddd+ddCdDddEdd	dddd&dFdGdHdIdddJddKdLd&dMddddNdOdddddddddPdQdRdddSd&d&dddddTddddUdVdddWddXd&dYdZdd[d6d\d]dd^d&d&ddd_d`dadbdcd9dddded?dfd&dddgdhdidhdgdidgdgdhdhdgd]dgdgdgdgdhd&djdkdld&dmdnddod:d&dddddpddqdrdd&ddddsd&dtdud&d&d&d&dddd&d&ddvdwdudxdydydudz���Zd{S)|�d�z"cpython-38-x86_64-linux-gnu"ZarZrcsz!-Wno-unused-result -Wsign-comparez-IObjects -IInclude -IPython�z/usr/binz/usr/lib64/python3.8z-L. -lpython3.8dzOgcc -pthread -shared -Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -g�pythonzx86_64-redhat-linux-gnu�\zgcc -pthreadz-fPICa{-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -Ogz?configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.ina-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapvaK-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declarationz-Wl,-z,relro  -Wl,-z,now  -gz�-Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -ga�'--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--enable-ipv6' '--enable-shared' '--with-computed-gotos=yes' '--with-dbmliborder=gdbm:ndbm:bdb' '--with-system-expat' '--with-system-ffi' '--enable-loadable-sqlite-extensions' '--with-dtrace' '--with-lto' '--with-ssl-default-suites=openssl' '--with-valgrind' '--without-ensurepip' '--with-pydebug' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'CFLAGS= -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv ' 'LDFLAGS= -Wl,-z,relro  -Wl,-z,now  -g ' 'CPPFLAGS=' 'PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'z/usr/includez/usr/include/python3.8dz=/builddir/build/BUILD/Python-3.8.17/build/debug/coverage.infoz;/builddir/build/BUILD/Python-3.8.17/build/debug/lcov-reportz2--no-branch-coverage --title "CPython lcov report"zN-IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Includezg++ -pthreadzE/usr /usr/lib64 /usr/lib64/python3.8 /usr/lib64/python3.8/lib-dynloadz /usr/lib64/python3.8/lib-dynloadi�zoREADME.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in Include Lib Misc Ext-dummyzInclude Lib Misc Ext-dummyzTREADME.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in�.�z/usr/bin/dtracezInclude/pydtrace_probes.hzPython/pydtrace.ozdynload_shlib.oZnoz .cpython-38d-x86_64-linux-gnu.soi�ZyeszI/usr/include /usr/include /usr/include/python3.8d /usr/include/python3.8dz/usr/bin/install -cz/usr/bin/install -c -m 644z/usr/bin/install -c -m 755zlibpython3.8d.so.1.0zModules/_io/_iomodule.hzg++ -pthread -sharedz:-Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -gzlibpython3.8d.soz3.8dz
/usr/lib64z-lmzPython/z/usr/lib64/pkgconfigz1/usr/lib64/python3.8/config-3.8d-x86_64-linux-gnuzlibpython3.8d.az"-lcrypt -lpthread -ldl  -lutil -lmz0tkinter tkinter/test tkinter/test/test_tkinter \Zgccz-Xlinker -export-dynamic�trueZlnZlinuxz5/builddir/build/BUILD/Python-3.8.17/Modules/makesetupz/usr/share/manz/usr/bin/mkdir -pz�posix  errno  pwd  _sre  _codecs  _weakref  _functools  _operator  _collections  _abc  itertools  atexit  _signal  _stat  time  _thread  _locale  _io  faulthandler  _tracemalloc  _symtable  xxsubtypeavModules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  Modules/_sre.o  Modules/_codecsmodule.o  Modules/_weakref.o  Modules/_functoolsmodule.o  Modules/_operator.o  Modules/_collectionsmodule.o  Modules/_abc.o  Modules/itertoolsmodule.o  Modules/atexitmodule.o  Modules/signalmodule.o  Modules/_stat.o  Modules/timemodule.o  Modules/_threadmodule.o  Modules/_localemodule.o  Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o  Modules/faulthandler.o  Modules/_tracemalloc.o Modules/hashtable.o  Modules/symtablemodule.o  Modules/xxsubtype.ozx86_64-linux-gnuz -DMULTIARCH=\"x86_64-linux-gnu\"z-Wl,--no-as-neededz-lssl -lcryptoa1-DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapvz:\ Parser/myreadline.o Parser/parsetok.o Parser/tokenizer.oz-fprofile-generatez"-fprofile-use -fprofile-correctionz
-m test --pgozno-frameworkz./python -Ez	python3.8a�-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -Og -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -Og -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPIC -DPy_BUILD_CORE_BUILTINa-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -Og -I/builddir/build/BUILD/Python-3.8.17/Include/internala�-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -Og -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -Og -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPIC -DPy_BUILD_COREaT-Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g -lcryptoz"z"a-Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g�a�-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -Og -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -Og -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPICz)-x test_subprocess test_io test_lib2to3 \ZreadelfzMac/Resources/frameworkZvoidz?LD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/debugz	@SGI_ABI@z/bin/shz.so���zcpython-38d-x86_64-linux-gnuz2Parser Objects Python Modules Modules/_io Programsz:/builddir/build/BUILD/Python-3.8.17/Tools/gdb/libpython.pyz"/* Don't use ncurses extensions */z-szInclude Lib MisczHLD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/debug ./pythonz�LD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/debug ./python /builddir/build/BUILD/Python-3.8.17/Tools/scripts/run_tests.pyi�zJpython3.8 /builddir/build/BUILD/Python-3.8.17/Tools/scripts/update_file.pyz3.8z#/builddir/build/BUILD/Python-3.8.17z)xml xml/dom xml/etree xml/parsers xml/saxz//builddir/build/BUILD/Python-3.8.17/build/debugz
/usr/sharez/usr(�ZABIFLAGSZAC_APPLE_UNIVERSAL_BUILDZAIX_GENUINE_CPLUSPLUSZ	ALT_SOABIZANDROID_API_LEVELZARZARFLAGSZ
BASECFLAGSZBASECPPFLAGSZBASEMODLIBSZBINDIRZ
BINLIBDESTZ
BLDLIBRARYZ	BLDSHAREDZBUILDEXEZBUILDPYTHONZBUILD_GNU_TYPEZBYTESTR_DEPSZCCZCCSHAREDZCFLAGSZCFLAGSFORSHAREDZCFLAGS_ALIASINGZCONFIGFILESZCONFIGURE_CFLAGSZCONFIGURE_CFLAGS_NODISTZCONFIGURE_CPPFLAGSZCONFIGURE_LDFLAGSZCONFIGURE_LDFLAGS_NODISTZCONFIG_ARGSZCONFINCLUDEDIRZ
CONFINCLUDEPYZCOREPYTHONPATHZ
COVERAGE_INFOZCOVERAGE_REPORTZCOVERAGE_REPORT_OPTIONSZCPPFLAGSZCXXZDESTDIRSZDESTLIBZDESTPATHZ
DESTSHAREDZDFLAGSZDIRMODEZDISTZDISTDIRSZ	DISTFILESZ	DLINCLDIRZ
DLLLIBRARYZ"DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754ZDOUBLE_IS_BIG_ENDIAN_IEEE754ZDOUBLE_IS_LITTLE_ENDIAN_IEEE754ZDTRACEZDTRACE_DEPSZDTRACE_HEADERSZDTRACE_OBJSZDYNLOADFILEZENABLE_IPV6Z	ENSUREPIPZEXEZEXEMODEZ
EXTRATESTOPTSZ
EXT_SUFFIXZFILEMODEZFLOAT_WORDS_BIGENDIANZFLOCK_NEEDS_LIBBSDZGETPGRP_HAVE_ARGZGETTIMEOFDAY_NO_TZZ	GITBRANCHZGITTAGZ
GITVERSIONZGNULDZHAVE_ACCEPT4Z
HAVE_ACOSHZ
HAVE_ADDRINFOZ
HAVE_ALARMZHAVE_ALIGNED_REQUIREDZ
HAVE_ALLOCA_HZHAVE_ALTZONEZ
HAVE_ASINHZHAVE_ASM_TYPES_HZ
HAVE_ATANHZHAVE_BIND_TEXTDOMAIN_CODESETZHAVE_BLUETOOTH_BLUETOOTH_HZHAVE_BLUETOOTH_HZHAVE_BROKEN_MBSTOWCSZHAVE_BROKEN_NICEZHAVE_BROKEN_PIPE_BUFZHAVE_BROKEN_POLLZHAVE_BROKEN_POSIX_SEMAPHORESZHAVE_BROKEN_PTHREAD_SIGMASKZHAVE_BROKEN_SEM_GETVALUEZHAVE_BROKEN_UNSETENVZHAVE_BUILTIN_ATOMICZHAVE_CHFLAGSZ
HAVE_CHOWNZHAVE_CHROOTZ
HAVE_CLOCKZHAVE_CLOCK_GETRESZHAVE_CLOCK_GETTIMEZHAVE_CLOCK_SETTIMEZHAVE_COMPUTED_GOTOSZHAVE_CONFSTRZHAVE_CONIO_HZ
HAVE_COPYSIGNZHAVE_COPY_FILE_RANGEZHAVE_CRYPT_HZHAVE_CRYPT_RZHAVE_CTERMIDZHAVE_CTERMID_RZHAVE_CURSES_FILTERZ
HAVE_CURSES_HZHAVE_CURSES_HAS_KEYZHAVE_CURSES_IMMEDOKZHAVE_CURSES_IS_PADZHAVE_CURSES_IS_TERM_RESIZEDZHAVE_CURSES_RESIZETERMZHAVE_CURSES_RESIZE_TERMZHAVE_CURSES_SYNCOKZHAVE_CURSES_TYPEAHEADZHAVE_CURSES_USE_ENVZHAVE_CURSES_WCHGATZHAVE_DECL_ISFINITEZHAVE_DECL_ISINFZHAVE_DECL_ISNANZHAVE_DECL_RTLD_DEEPBINDZHAVE_DECL_RTLD_GLOBALZHAVE_DECL_RTLD_LAZYZHAVE_DECL_RTLD_LOCALZHAVE_DECL_RTLD_MEMBERZHAVE_DECL_RTLD_NODELETEZHAVE_DECL_RTLD_NOLOADZHAVE_DECL_RTLD_NOWZHAVE_DECL_TZNAMEZHAVE_DEVICE_MACROSZHAVE_DEV_PTCZ
HAVE_DEV_PTMXZ
HAVE_DIRECT_HZHAVE_DIRENT_D_TYPEZ
HAVE_DIRENT_HZ
HAVE_DIRFDZHAVE_DLFCN_HZHAVE_DLOPENZ	HAVE_DUP2Z	HAVE_DUP3Z$HAVE_DYLD_SHARED_CACHE_CONTAINS_PATHZHAVE_DYNAMIC_LOADINGZ
HAVE_ENDIAN_HZ
HAVE_EPOLLZHAVE_EPOLL_CREATE1ZHAVE_ERFZ	HAVE_ERFCZHAVE_ERRNO_HZ
HAVE_EXECVZHAVE_EXPLICIT_BZEROZHAVE_EXPLICIT_MEMSETZ
HAVE_EXPM1ZHAVE_FACCESSATZHAVE_FCHDIRZHAVE_FCHMODZ
HAVE_FCHMODATZHAVE_FCHOWNZ
HAVE_FCHOWNATZHAVE_FCNTL_HZHAVE_FDATASYNCZHAVE_FDOPENDIRZHAVE_FDWALKZHAVE_FEXECVEZHAVE_FINITEZ
HAVE_FLOCKZ	HAVE_FORKZHAVE_FORKPTYZHAVE_FPATHCONFZHAVE_FSEEK64ZHAVE_FSEEKOZHAVE_FSTATATZ
HAVE_FSTATVFSZ
HAVE_FSYNCZHAVE_FTELL64ZHAVE_FTELLOZ
HAVE_FTIMEZHAVE_FTRUNCATEZ
HAVE_FUTIMENSZHAVE_FUTIMESZHAVE_FUTIMESATZHAVE_GAI_STRERRORZ
HAVE_GAMMAZHAVE_GCC_ASM_FOR_MC68881ZHAVE_GCC_ASM_FOR_X64ZHAVE_GCC_ASM_FOR_X87ZHAVE_GCC_UINT128_TZHAVE_GETADDRINFOZHAVE_GETC_UNLOCKEDZHAVE_GETENTROPYZHAVE_GETGRGID_RZHAVE_GETGRNAM_RZHAVE_GETGROUPLISTZHAVE_GETGROUPSZHAVE_GETHOSTBYNAMEZHAVE_GETHOSTBYNAME_RZHAVE_GETHOSTBYNAME_R_3_ARGZHAVE_GETHOSTBYNAME_R_5_ARGZHAVE_GETHOSTBYNAME_R_6_ARGZHAVE_GETITIMERZHAVE_GETLOADAVGZ
HAVE_GETLOGINZHAVE_GETNAMEINFOZHAVE_GETPAGESIZEZHAVE_GETPEERNAMEZHAVE_GETPGIDZHAVE_GETPGRPZHAVE_GETPIDZHAVE_GETPRIORITYZ
HAVE_GETPWENTZHAVE_GETPWNAM_RZHAVE_GETPWUID_RZHAVE_GETRANDOMZHAVE_GETRANDOM_SYSCALLZHAVE_GETRESGIDZHAVE_GETRESUIDZHAVE_GETSIDZ
HAVE_GETSPENTZ
HAVE_GETSPNAMZHAVE_GETTIMEOFDAYZ
HAVE_GETWDZHAVE_GLIBC_MEMMOVE_BUGZ
HAVE_GRP_HZHAVE_HSTRERRORZHAVE_HTOLE64Z
HAVE_HYPOTZ
HAVE_IEEEFP_HZHAVE_IF_NAMEINDEXZHAVE_INET_ATONZHAVE_INET_PTONZHAVE_INITGROUPSZHAVE_INTTYPES_HZ	HAVE_IO_HZHAVE_IPA_PURE_CONST_BUGZ	HAVE_KILLZHAVE_KILLPGZHAVE_KQUEUEZHAVE_LANGINFO_HZHAVE_LARGEFILE_SUPPORTZ
HAVE_LCHFLAGSZHAVE_LCHMODZHAVE_LCHOWNZHAVE_LGAMMAZ
HAVE_LIBDLZHAVE_LIBDLDZHAVE_LIBIEEEZHAVE_LIBINTL_HZHAVE_LIBREADLINEZHAVE_LIBRESOLVZHAVE_LIBSENDFILEZHAVE_LIBUTIL_HZ	HAVE_LINKZHAVE_LINKATZHAVE_LINUX_CAN_BCM_HZHAVE_LINUX_CAN_HZHAVE_LINUX_CAN_RAW_FD_FRAMESZHAVE_LINUX_CAN_RAW_HZHAVE_LINUX_MEMFD_HZHAVE_LINUX_NETLINK_HZHAVE_LINUX_QRTR_HZHAVE_LINUX_RANDOM_HZHAVE_LINUX_TIPC_HZHAVE_LINUX_VM_SOCKETS_HZ
HAVE_LOCKFZ
HAVE_LOG1PZ	HAVE_LOG2ZHAVE_LONG_DOUBLEZ
HAVE_LSTATZHAVE_LUTIMESZHAVE_MADVISEZHAVE_MAKEDEVZHAVE_MBRTOWCZHAVE_MEMFD_CREATEZ
HAVE_MEMORY_HZHAVE_MEMRCHRZHAVE_MKDIRATZHAVE_MKFIFOZ
HAVE_MKFIFOATZ
HAVE_MKNODZHAVE_MKNODATZHAVE_MKTIMEZ	HAVE_MMAPZHAVE_MREMAPZHAVE_NCURSES_HZHAVE_NDIR_HZHAVE_NETPACKET_PACKET_HZ
HAVE_NET_IF_HZ	HAVE_NICEZHAVE_OPENATZHAVE_OPENPTYZ
HAVE_PATHCONFZ
HAVE_PAUSEZ
HAVE_PIPE2Z
HAVE_PLOCKZ	HAVE_POLLZHAVE_POLL_HZHAVE_POSIX_FADVISEZHAVE_POSIX_FALLOCATEZHAVE_POSIX_SPAWNZHAVE_POSIX_SPAWNPZ
HAVE_PREADZHAVE_PREADVZHAVE_PREADV2ZHAVE_PRLIMITZHAVE_PROCESS_HZHAVE_PROTOTYPESZHAVE_PTHREAD_CONDATTR_SETCLOCKZHAVE_PTHREAD_DESTRUCTORZHAVE_PTHREAD_GETCPUCLOCKIDZHAVE_PTHREAD_HZHAVE_PTHREAD_INITZHAVE_PTHREAD_KILLZHAVE_PTHREAD_SIGMASKZ
HAVE_PTY_HZHAVE_PUTENVZHAVE_PWRITEZHAVE_PWRITEVZ
HAVE_PWRITEV2Z
HAVE_READLINKZHAVE_READLINKATZ
HAVE_READVZ
HAVE_REALPATHZ
HAVE_RENAMEATZHAVE_RL_APPEND_HISTORYZHAVE_RL_CATCH_SIGNALZ#HAVE_RL_COMPLETION_APPEND_CHARACTERZ'HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOKZHAVE_RL_COMPLETION_MATCHESZ"HAVE_RL_COMPLETION_SUPPRESS_APPENDZHAVE_RL_PRE_INPUT_HOOKZHAVE_RL_RESIZE_TERMINALZ
HAVE_ROUNDZ
HAVE_RTPSPAWNZHAVE_SCHED_GET_PRIORITY_MAXZHAVE_SCHED_HZHAVE_SCHED_RR_GET_INTERVALZHAVE_SCHED_SETAFFINITYZHAVE_SCHED_SETPARAMZHAVE_SCHED_SETSCHEDULERZHAVE_SEM_GETVALUEZ
HAVE_SEM_OPENZHAVE_SEM_TIMEDWAITZHAVE_SEM_UNLINKZ
HAVE_SENDFILEZHAVE_SETEGIDZHAVE_SETEUIDZHAVE_SETGIDZHAVE_SETGROUPSZHAVE_SETHOSTNAMEZHAVE_SETITIMERZHAVE_SETLOCALEZHAVE_SETPGIDZHAVE_SETPGRPZHAVE_SETPRIORITYZ
HAVE_SETREGIDZHAVE_SETRESGIDZHAVE_SETRESUIDZ
HAVE_SETREUIDZHAVE_SETSIDZHAVE_SETUIDZHAVE_SETVBUFZ
HAVE_SHADOW_HZ
HAVE_SHM_OPENZHAVE_SHM_UNLINKZHAVE_SIGACTIONZHAVE_SIGALTSTACKZHAVE_SIGFILLSETZHAVE_SIGINFO_T_SI_BANDZHAVE_SIGINTERRUPTZ
HAVE_SIGNAL_HZHAVE_SIGPENDINGZ
HAVE_SIGRELSEZHAVE_SIGTIMEDWAITZHAVE_SIGWAITZHAVE_SIGWAITINFOZ
HAVE_SNPRINTFZHAVE_SOCKADDR_ALGZHAVE_SOCKADDR_SA_LENZHAVE_SOCKADDR_STORAGEZHAVE_SOCKETPAIRZHAVE_SPAWN_HZHAVE_SSIZE_TZHAVE_STATVFSZHAVE_STAT_TV_NSECZHAVE_STAT_TV_NSEC2ZHAVE_STDARG_PROTOTYPESZ
HAVE_STDINT_HZ
HAVE_STDLIB_HZHAVE_STD_ATOMICZHAVE_STRDUPZ
HAVE_STRFTIMEZHAVE_STRINGS_HZ
HAVE_STRING_HZHAVE_STRLCPYZHAVE_STROPTS_HZHAVE_STRSIGNALZHAVE_STRUCT_PASSWD_PW_GECOSZHAVE_STRUCT_PASSWD_PW_PASSWDZHAVE_STRUCT_STAT_ST_BIRTHTIMEZHAVE_STRUCT_STAT_ST_BLKSIZEZHAVE_STRUCT_STAT_ST_BLOCKSZHAVE_STRUCT_STAT_ST_FLAGSZHAVE_STRUCT_STAT_ST_GENZHAVE_STRUCT_STAT_ST_RDEVZHAVE_STRUCT_TM_TM_ZONEZHAVE_SYMLINKZHAVE_SYMLINKATZ	HAVE_SYNCZHAVE_SYSCONFZHAVE_SYSEXITS_HZHAVE_SYS_AUDIOIO_HZHAVE_SYS_BSDTTY_HZHAVE_SYS_DEVPOLL_HZHAVE_SYS_DIR_HZHAVE_SYS_ENDIAN_HZHAVE_SYS_EPOLL_HZHAVE_SYS_EVENT_HZHAVE_SYS_FILE_HZHAVE_SYS_IOCTL_HZHAVE_SYS_KERN_CONTROL_HZHAVE_SYS_LOADAVG_HZHAVE_SYS_LOCK_HZHAVE_SYS_MEMFD_HZHAVE_SYS_MKDEV_HZHAVE_SYS_MMAN_HZHAVE_SYS_MODEM_HZHAVE_SYS_NDIR_HZHAVE_SYS_PARAM_HZHAVE_SYS_POLL_HZHAVE_SYS_RANDOM_HZHAVE_SYS_RESOURCE_HZHAVE_SYS_SELECT_HZHAVE_SYS_SENDFILE_HZHAVE_SYS_SOCKET_HZHAVE_SYS_STATVFS_HZHAVE_SYS_STAT_HZHAVE_SYS_SYSCALL_HZHAVE_SYS_SYSMACROS_HZHAVE_SYS_SYS_DOMAIN_HZHAVE_SYS_TERMIO_HZHAVE_SYS_TIMES_HZHAVE_SYS_TIME_HZHAVE_SYS_TYPES_HZHAVE_SYS_UIO_HZ
HAVE_SYS_UN_HZHAVE_SYS_UTSNAME_HZHAVE_SYS_WAIT_HZHAVE_SYS_XATTR_HZHAVE_TCGETPGRPZHAVE_TCSETPGRPZHAVE_TEMPNAMZHAVE_TERMIOS_HZHAVE_TERM_HZHAVE_TGAMMAZHAVE_TIMEGMZ
HAVE_TIMESZHAVE_TMPFILEZHAVE_TMPNAMZ
HAVE_TMPNAM_RZHAVE_TM_ZONEZ
HAVE_TRUNCATEZHAVE_TZNAMEZ
HAVE_UCS4_TCLZ
HAVE_UNAMEZ
HAVE_UNISTD_HZ
HAVE_UNLINKATZ
HAVE_UNSETENVZHAVE_USABLE_WCHAR_TZHAVE_UTIL_HZHAVE_UTIMENSATZHAVE_UTIMESZHAVE_UTIME_HZHAVE_UUID_CREATEZHAVE_UUID_ENC_BEZHAVE_UUID_GENERATE_TIME_SAFEZHAVE_UUID_HZHAVE_UUID_UUID_HZ
HAVE_WAIT3Z
HAVE_WAIT4ZHAVE_WAITIDZHAVE_WAITPIDZHAVE_WCHAR_HZHAVE_WCSCOLLZ
HAVE_WCSFTIMEZHAVE_WCSXFRMZHAVE_WMEMCMPZHAVE_WORKING_TZSETZHAVE_WRITEVZ HAVE_X509_VERIFY_PARAM_SET1_HOSTZHAVE_ZLIB_COPYZHAVE__GETPTYZ
HOST_GNU_TYPEZINCLDIRSTOMAKEZ
INCLUDEDIRZ	INCLUDEPYZINSTALLZINSTALL_DATAZINSTALL_PROGRAMZINSTALL_SCRIPTZINSTALL_SHAREDZ
INSTSONAMEZIO_HZIO_OBJSZLDCXXSHAREDZLDFLAGSZ	LDLIBRARYZLDLIBRARYDIRZLDSHAREDZ	LDVERSIONZLIBCZLIBDESTZLIBDIRZLIBFFI_INCLUDEDIRZLIBMZ	LIBOBJDIRZLIBOBJSZLIBPCZLIBPLZ	LIBPYTHONZLIBRARYZLIBRARY_OBJSZLIBRARY_OBJS_OMIT_FROZENZLIBSZ
LIBSUBDIRSZLINKCCZ
LINKFORSHAREDZLIPO_32BIT_FLAGSZLIPO_INTEL64_FLAGSZ
LLVM_PROF_ERRZLLVM_PROF_FILEZLLVM_PROF_MERGERZLNZLOCALMODLIBSZMACHDEPZMACHDEP_OBJSZMACHDESTLIBZMACOSX_DEPLOYMENT_TARGETZMAINCCZMAJOR_IN_MKDEVZMAJOR_IN_SYSMACROSZ	MAKESETUPZMANDIRZMKDIR_PZMODBUILT_NAMESZMODDISABLED_NAMESZMODLIBSZMODOBJSZMODULE_OBJSZ	MULTIARCHZMULTIARCH_CPPFLAGSZMVWDELCH_IS_EXPRESSIONZNO_AS_NEEDEDZOBJECT_OBJSZOPENSSL_INCLUDESZOPENSSL_LDFLAGSZOPENSSL_LIBSZOPTZOTHER_LIBTOOL_OPTZPACKAGE_BUGREPORTZPACKAGE_NAMEZPACKAGE_STRINGZPACKAGE_TARNAMEZPACKAGE_URLZPACKAGE_VERSIONZPARSER_HEADERSZPARSER_OBJSZPGO_PROF_GEN_FLAGZPGO_PROF_USE_FLAGZPOBJSZPOSIX_SEMAPHORES_NOT_ENABLEDZPROFILE_TASKZ$PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INTZPTHREAD_SYSTEM_SCHED_SUPPORTEDZ
PY3LIBRARYZPYLONG_BITS_IN_DIGITZPYTHONZPYTHONFRAMEWORKZPYTHONFRAMEWORKDIRZPYTHONFRAMEWORKINSTALLDIRZPYTHONFRAMEWORKPREFIXZ
PYTHONPATHZPYTHON_FOR_BUILDZPYTHON_FOR_REGENZPYTHON_HEADERSZPYTHON_OBJSZPY_BUILTIN_MODULE_CFLAGSZ	PY_CFLAGSZPY_CFLAGS_NODISTZPY_COERCE_C_LOCALEZPY_CORE_CFLAGSZPY_CORE_LDFLAGSZPY_CPPFLAGSZPY_FORMAT_SIZE_TZ
PY_LDFLAGSZPY_LDFLAGS_NODISTZPY_SSL_DEFAULT_CIPHERSZPY_SSL_DEFAULT_CIPHER_STRINGZPY_STDMODULE_CFLAGSZPy_DEBUGZPy_ENABLE_SHAREDZPy_HASH_ALGORITHMZ
Py_TRACE_REFSZ
QUICKTESTOPTSZREADELFZ	RESSRCDIRZ
RETSIGTYPEZ	RUNSHAREDZ	SCRIPTDIRZSETPGRP_HAVE_ARGZSGI_ABIZSHELLZSHLIBSZSHLIB_SUFFIXZSHM_NEEDS_LIBRTZSIGNED_RIGHT_SHIFT_ZERO_FILLSZSITEPATHZ
SIZEOF_DOUBLEZSIZEOF_FLOATZ
SIZEOF_FPOS_TZ
SIZEOF_INTZSIZEOF_LONGZSIZEOF_LONG_DOUBLEZSIZEOF_LONG_LONGZSIZEOF_OFF_TZSIZEOF_PID_TZSIZEOF_PTHREAD_KEY_TZSIZEOF_PTHREAD_TZSIZEOF_SHORTZ
SIZEOF_SIZE_TZ
SIZEOF_TIME_TZSIZEOF_UINTPTR_TZ
SIZEOF_VOID_PZSIZEOF_WCHAR_TZSIZEOF__BOOLZSOABIZSRCDIRSZ
SRC_GDB_HOOKSZSTDC_HEADERSZSTRICT_SYSV_CURSESZ	STRIPFLAGZSUBDIRSZ
SUBDIRSTOOZSYSLIBSZSYS_SELECT_WITH_SYS_TIMEZTCLTK_INCLUDESZ
TCLTK_LIBSZTESTOPTSZTESTPATHZ
TESTPYTHONZTESTPYTHONOPTSZ
TESTRUNNERZTESTTIMEOUTZTIMEMODULE_LIBZTIME_WITH_SYS_TIMEZTM_IN_SYS_TIMEZUNICODE_DEPSZUNIVERSALSDKZUPDATE_FILEZUSE_COMPUTED_GOTOSZVERSIONZVPATHZWINDOW_HAS_FLAGSZWITH_DECIMAL_CONTEXTVARZWITH_DOC_STRINGSZWITH_DTRACEZ	WITH_DYLDZWITH_LIBINTLZWITH_NEXT_FRAMEWORKZ
WITH_PYMALLOCZ
WITH_VALGRINDZX87_DOUBLE_ROUNDINGZ
XMLLIBSUBDIRSZabs_builddirZ
abs_srcdirZdatarootdir�exec_prefix�prefixZsrcdirN)Zbuild_time_vars�rr�?/usr/lib64/python3.8/_sysconfigdata_d_linux_x86_64-linux-gnu.py�<module>sb2+-��������__pycache__/opcode.cpython-38.opt-2.pyc000064400000012242151153537560013631 0ustar00U

e5d��
@s�dddddddddd	d
ddg
Zzd
dlmZe�d�Wnek
rLYnXdZgZgZgZgZ	gZ
gZgZgZ
iZdd�ed�D�Zdd�Zdd�Zdd�Zdd�Zedd�edd�ed d!�ed"d#�ed$d%�ed&d'�ed(d)�ed*d+�ed,d-�ed.d/�ed0d1�ed2d3�ed4d5�ed6d7�ed8d9�ed:d;�ed<d=�ed>d?�ed@dA�edBdC�edDdE�edFdG�edHdI�edJdK�edLdM�edNdO�edPdQ�edRdS�edTdU�edVdW�edXdY�edZd[�ed\d]�ed^d_�ed`da�edbdc�eddde�edfdg�edhdi�edjdk�edldm�edndo�edpdq�edrds�edtdu�edvdw�edxdy�edzd{�ed|d}�ed~d�ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��d�Zed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��e�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��e�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�dÃed�dŃed�dǃed�dɃed�d˃e
�dˡed�d̓e
�d͡ed�dσe
�dϡed�dуed�dӃed�dՃed�d׃ed�dكe�d١ed�dۃe�dۡed�d݃e�dݡed�d߃e�dߡed�d�ed�d�ed�d�ed�d�ed�d�ed�d�ed�d�e�d�edd�d�Zed�d�ed�d�ed�d�ed�d��ed�d��ed�d��ed�d��ed�d��ed��d�e�d�d�e�d�d�e�d�d�e�d�d�e�d	�d
�[[[[�dS(�cmp_op�hasconst�hasname�hasjrel�hasjabs�haslocal�
hascompare�hasfree�opname�opmap�
HAVE_ARGUMENT�EXTENDED_ARG�hasnargs�)�stack_effectr)�<z<=z==z!=�>z>=�inznot in�iszis notzexception matchZBADcCsg|]}d|f�qS)z<%r>�)�.0�oprr�/usr/lib64/python3.8/opcode.py�
<listcomp>%sr�cCs|t|<|t|<dS�N)r	r
��namerrrr�def_op'srcCst||�t�|�dSr)rr�appendrrrr�name_op+s
rcCst||�t�|�dSr)rrrrrrr�jrel_op/s
r cCst||�t�|�dSr)rrrrrrr�jabs_op3s
r!ZPOP_TOP�ZROT_TWO�Z	ROT_THREE�ZDUP_TOP�ZDUP_TOP_TWO�ZROT_FOUR�ZNOP�	ZUNARY_POSITIVE�
ZUNARY_NEGATIVE�Z	UNARY_NOT�ZUNARY_INVERT�ZBINARY_MATRIX_MULTIPLY�ZINPLACE_MATRIX_MULTIPLY�ZBINARY_POWER�ZBINARY_MULTIPLY�Z
BINARY_MODULO�Z
BINARY_ADD�ZBINARY_SUBTRACT�Z
BINARY_SUBSCR�ZBINARY_FLOOR_DIVIDE�ZBINARY_TRUE_DIVIDE�ZINPLACE_FLOOR_DIVIDE�ZINPLACE_TRUE_DIVIDE�Z	GET_AITER�2Z	GET_ANEXT�3ZBEFORE_ASYNC_WITH�4Z
BEGIN_FINALLY�5Z
END_ASYNC_FOR�6ZINPLACE_ADD�7ZINPLACE_SUBTRACT�8ZINPLACE_MULTIPLY�9ZINPLACE_MODULO�;ZSTORE_SUBSCR�<Z
DELETE_SUBSCR�=Z
BINARY_LSHIFT�>Z
BINARY_RSHIFT�?Z
BINARY_AND�@Z
BINARY_XOR�AZ	BINARY_OR�BZ
INPLACE_POWER�CZGET_ITER�DZGET_YIELD_FROM_ITER�EZ
PRINT_EXPR�FZLOAD_BUILD_CLASS�GZ
YIELD_FROM�HZ
GET_AWAITABLE�IZINPLACE_LSHIFT�KZINPLACE_RSHIFT�LZINPLACE_AND�MZINPLACE_XOR�NZ
INPLACE_OR�OZWITH_CLEANUP_START�QZWITH_CLEANUP_FINISH�RZRETURN_VALUE�SZIMPORT_STAR�TZSETUP_ANNOTATIONS�UZYIELD_VALUE�VZ	POP_BLOCK�WZEND_FINALLY�XZ
POP_EXCEPT�Y�ZZ
STORE_NAMEZDELETE_NAME�[ZUNPACK_SEQUENCE�\ZFOR_ITER�]Z	UNPACK_EX�^Z
STORE_ATTR�_ZDELETE_ATTR�`ZSTORE_GLOBAL�aZ
DELETE_GLOBAL�bZ
LOAD_CONST�dZ	LOAD_NAME�eZBUILD_TUPLE�fZ
BUILD_LIST�gZ	BUILD_SET�hZ	BUILD_MAP�iZ	LOAD_ATTR�jZ
COMPARE_OP�kZIMPORT_NAME�lZIMPORT_FROM�mZJUMP_FORWARD�nZJUMP_IF_FALSE_OR_POP�oZJUMP_IF_TRUE_OR_POP�pZ
JUMP_ABSOLUTE�qZPOP_JUMP_IF_FALSE�rZPOP_JUMP_IF_TRUE�sZLOAD_GLOBAL�tZ
SETUP_FINALLY�zZ	LOAD_FAST�|Z
STORE_FAST�}ZDELETE_FAST�~Z
RAISE_VARARGS�Z
CALL_FUNCTION�Z
MAKE_FUNCTION�ZBUILD_SLICE�ZLOAD_CLOSURE�Z
LOAD_DEREF�ZSTORE_DEREF�ZDELETE_DEREF�ZCALL_FUNCTION_KW�ZCALL_FUNCTION_EX�Z
SETUP_WITH�ZLIST_APPEND�ZSET_ADD�ZMAP_ADD�ZLOAD_CLASSDEREF��ZBUILD_LIST_UNPACK�ZBUILD_MAP_UNPACK�ZBUILD_MAP_UNPACK_WITH_CALL�ZBUILD_TUPLE_UNPACK�ZBUILD_SET_UNPACK�ZSETUP_ASYNC_WITH�ZFORMAT_VALUE�ZBUILD_CONST_KEY_MAP�ZBUILD_STRING�ZBUILD_TUPLE_UNPACK_WITH_CALL�ZLOAD_METHOD�ZCALL_METHOD�ZCALL_FINALLY�ZPOP_FINALLY�N)�__all__Z_opcoderr�ImportErrorrrrrrrrrr
r
�ranger	rrr r!rrrrrr�<module>sD
�



























































































































__pycache__/smtpd.cpython-38.opt-1.pyc000064400000063541151153537560013516 0ustar00U

e5d���@s^dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddlm
Z
mZddddd	gZejdZd
ZGdd�d�Ze�ad
ZdZdZd%dd�ZGdd�dej�ZGdd�dej�ZGdd�de�ZGdd�de�ZGdd	�d	e�ZGdd�d�Z dd�Z!e"dk�rZe!�Z#e#j$Z$de$k�rpe$�%d�Z&e'e$de&�e(�e)�dg�Z*e$e&dd�Z$nddl+Z*e,e*e$�Z-e-e#j.e#j/fe#j0e#j1fe#j2e#j3d�Z4e#j5�r6zddl6Z6Wn.e7k
�r�e8d ej9d!�e�:d�YnXe6�;d"�d#Z<ze�5e<�Wn.e=k
�r4e8d$ej9d!�e�:d�YnXze�>�Wne?k
�rXYnXdS)&a�An RFC 5321 smtp proxy with optional RFC 1870 and RFC 6531 extensions.

Usage: %(program)s [options] [localhost:localport [remotehost:remoteport]]

Options:

    --nosetuid
    -n
        This program generally tries to setuid `nobody', unless this flag is
        set.  The setuid call will fail if this program is not run as root (in
        which case, use this flag).

    --version
    -V
        Print the version number and exit.

    --class classname
    -c classname
        Use `classname' as the concrete SMTP proxy class.  Uses `PureProxy' by
        default.

    --size limit
    -s limit
        Restrict the total size of the incoming message to "limit" number of
        bytes via the RFC 1870 SIZE extension.  Defaults to 33554432 bytes.

    --smtputf8
    -u
        Enable the SMTPUTF8 extension and behave as an RFC 6531 smtp proxy.

    --debug
    -d
        Turn on debugging prints.

    --help
    -h
        Print this message and exit.

Version: %(__version__)s

If localhost is not given then `localhost' is used, and if localport is not
given then 8025 is used.  If remotehost is not given then `localhost' is used,
and if remoteport is not given, then 25 is used.
�N)�warn)�
get_addr_spec�get_angle_addr�SMTPChannel�
SMTPServer�DebuggingServer�	PureProxy�MailmanProxyzPython SMTP proxy version 0.3c@seZdZdd�Zdd�ZdS)�DevnullcCsdS�N���self�msgrr�/usr/lib64/python3.8/smtpd.py�writef�z
Devnull.writecCsdSrr�rrrr�flushgrz
Devnull.flushN)�__name__�
__module__�__qualname__rrrrrrr
esr
�
z, i�cCs4ttt�tjd�|r&t|tjd�t�|�dS)N��file)�print�__doc__�globals�sys�stderr�exit)�coderrrr�usagepsr#c@s�eZdZdZdZdZe�efdd��Ze	dd��Z
edd	d	fd
d�Zdd
�Z
dd�Ze	dd��Zejdd��Ze	dd��Zejdd��Ze	dd��Zejdd��Ze	dd��Zejdd��Ze	dd��Zejdd��Ze	dd ��Zejd!d ��Ze	d"d#��Zejd$d#��Ze	d%d&��Zejd'd&��Ze	d(d)��Zejd*d)��Ze	d+d,��Zejd-d,��Ze	d.d/��Zejd0d/��Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dAdB�Z#dCdD�Z$dEdF�Z%dGdH�Z&dIdJ�Z'dKdL�Z(dMdN�Z)dOdP�Z*dQdR�Z+dS)Srr�icCs|Srr)�xrrr�<lambda>|rzSMTPChannel.<lambda>cCs0zt|j���WStk
r*|jYSXdSr)�max�command_size_limits�values�
ValueError�command_size_limitrrrr�max_command_size_limit~sz"SMTPChannel.max_command_size_limitNFc	
Cs&tjj|||d�||_||_||_||_||_||_|rF|rFt	d��|rdd|_
d|_d|_t
|_nd|_
d|_td�|_d	|_|��d|_d
|_|j��t��|_z|��|_WnBtk
r�}z$|��|jdtjkr�WY�dSd}~XYnXtdt |j�t!d
�|�"d|jt#f�dS)N��map�Fdecode_data and enable_SMTPUTF8 cannot be set to True at the same timer�
�.r�
�.�
FrzPeer:rz	220 %s %s)$�asynchat�
async_chat�__init__�smtp_server�conn�addr�data_size_limit�enable_SMTPUTF8�_decode_datar*�_emptystring�_linesep�_dotsep�NEWLINE�_newline�ord�_set_rset_state�
seen_greeting�
extended_smtpr(�clear�socketZgetfqdn�fqdnZgetpeername�peer�OSError�close�args�errnoZENOTCONNr�repr�DEBUGSTREAM�push�__version__)	rZserverr9r:r;r.r<�decode_data�errrrrr7�s@


zSMTPChannel.__init__cCs.|j|_d|_g|_d|_d|_|�d�dS)z/Reset state variables to their post-DATA state.NFrr2)�COMMAND�
smtp_state�mailfrom�rcpttos�require_SMTPUTF8�	num_bytes�set_terminatorrrrr�_set_post_data_state�sz SMTPChannel._set_post_data_statecCs|��d|_g|_dS)z.Reset all state variables except the greeting.rN)r\�
received_data�received_linesrrrrrD�szSMTPChannel._set_rset_statecCstdtd�|jS)NzTAccess to __server attribute on SMTPChannel is deprecated, use 'smtp_server' instead��r�DeprecationWarningr8rrrr�__server�s
�zSMTPChannel.__servercCstdtd�||_dS)NzRSetting __server attribute on SMTPChannel is deprecated, set 'smtp_server' insteadr_r`�r�valuerrrrb�s
�cCstdtd�|jS)NzUAccess to __line attribute on SMTPChannel is deprecated, use 'received_lines' insteadr_�rrar^rrrr�__line�s
�zSMTPChannel.__linecCstdtd�||_dS)NzSSetting __line attribute on SMTPChannel is deprecated, set 'received_lines' insteadr_rercrrrrf�s
�cCstdtd�|jS)NzRAccess to __state attribute on SMTPChannel is deprecated, use 'smtp_state' insteadr_�rrarVrrrr�__state�s
�zSMTPChannel.__statecCstdtd�||_dS)NzPSetting __state attribute on SMTPChannel is deprecated, set 'smtp_state' insteadr_rgrcrrrrh�s
�cCstdtd�|jS)NzXAccess to __greeting attribute on SMTPChannel is deprecated, use 'seen_greeting' insteadr_�rrarErrrr�
__greeting�s
�zSMTPChannel.__greetingcCstdtd�||_dS)NzVSetting __greeting attribute on SMTPChannel is deprecated, set 'seen_greeting' insteadr_rircrrrrj�s
�cCstdtd�|jS)NzSAccess to __mailfrom attribute on SMTPChannel is deprecated, use 'mailfrom' insteadr_�rrarWrrrr�
__mailfrom�s
�zSMTPChannel.__mailfromcCstdtd�||_dS)NzQSetting __mailfrom attribute on SMTPChannel is deprecated, set 'mailfrom' insteadr_rkrcrrrrl�s
�cCstdtd�|jS)NzQAccess to __rcpttos attribute on SMTPChannel is deprecated, use 'rcpttos' insteadr_�rrarXrrrr�	__rcpttos�s
�zSMTPChannel.__rcpttoscCstdtd�||_dS)NzOSetting __rcpttos attribute on SMTPChannel is deprecated, set 'rcpttos' insteadr_rmrcrrrrn�s
�cCstdtd�|jS)NzTAccess to __data attribute on SMTPChannel is deprecated, use 'received_data' insteadr_�rrar]rrrr�__data�s
�zSMTPChannel.__datacCstdtd�||_dS)NzRSetting __data attribute on SMTPChannel is deprecated, set 'received_data' insteadr_rorcrrrrps
�cCstdtd�|jS)NzKAccess to __fqdn attribute on SMTPChannel is deprecated, use 'fqdn' insteadr_�rrarIrrrr�__fqdn
s
�zSMTPChannel.__fqdncCstdtd�||_dS)NzISetting __fqdn attribute on SMTPChannel is deprecated, set 'fqdn' insteadr_rqrcrrrrrs
�cCstdtd�|jS)NzKAccess to __peer attribute on SMTPChannel is deprecated, use 'peer' insteadr_�rrarJrrrr�__peers
�zSMTPChannel.__peercCstdtd�||_dS)NzISetting __peer attribute on SMTPChannel is deprecated, set 'peer' insteadr_rsrcrrrrts
�cCstdtd�|jS)NzKAccess to __conn attribute on SMTPChannel is deprecated, use 'conn' insteadr_�rrar9rrrr�__conn s
�zSMTPChannel.__conncCstdtd�||_dS)NzISetting __conn attribute on SMTPChannel is deprecated, set 'conn' insteadr_rurcrrrrv%s
�cCstdtd�|jS)NzKAccess to __addr attribute on SMTPChannel is deprecated, use 'addr' insteadr_�rrar:rrrr�__addr+s
�zSMTPChannel.__addrcCstdtd�||_dS)NzISetting __addr attribute on SMTPChannel is deprecated, set 'addr' insteadr_rwrcrrrrx0s
�cCs&tj�|t|d|jrdnd��dS)Nr0�utf-8�ascii)r5r6rQ�bytesrYr
rrrrQ7s
�zSMTPChannel.pushcCs|d}|j|jkr|j}n|j|jkr*|j}|r<|j|kr<dS|rR|jt|�7_|jrl|j�	t
|d��n|j�	|�dS)Nry)rVrUr,�DATAr;rZ�lenr=r^�append�str)r�data�limitrrr�collect_incoming_data<sz!SMTPChannel.collect_incoming_datac
Cs|j�|j�}tdt|�td�g|_|j|jk�r|jd}|_|sT|�	d�dS|j
sdt|d�}|�d�}|dkr�|�
�}d}n$|d|��
�}||dd���}|jr�|j|n|j}||kr�|�	d�dSt|d	|d�}|s�|�	d
|�dS||�dS|j|jk�r(|�	d�d|_dS|j�rR|j|jk�rR|�	d�d|_dSg}|�|j�D]:}	|	�r�|	d|jk�r�|�|	dd��n
|�|	��qb|j�|�|_|j|j|j|jf}
i}|j
�s�|j|jd
�}|j j!|
|�}|�"�|�s|�	d�n
|�	|�dS)NzData:rrz500 Error: bad syntaxry� r$z500 Error: line too longZsmtp_z&500 Error: command "%s" not recognizedz451 Internal confusionz552 Error: Too much mail data)�mail_options�rcpt_options�250 OK)#r>�joinr^rrOrPrVrUrZrQr=r�find�upper�striprFr(r+�getattrr|r;�splitr?r@r~rBr]rJrWrXr�r�r8�process_messager\)
r�lineZsz�i�command�argZmax_sz�methodr��textrM�kwargsZstatusrrr�found_terminatorLsl


��


�zSMTPChannel.found_terminatorcCsH|s|�d�dS|jr&|�d�dS|��||_|�d|j�dS)Nz501 Syntax: HELO hostname�503 Duplicate HELO/EHLOz250 %s)rQrErDrI�rr�rrr�	smtp_HELO�s

zSMTPChannel.smtp_HELOcCs�|s|�d�dS|jr&|�d�dS|��||_d|_|�d|j�|jrr|�d|j�|jdd7<|js�|�d�|jr�|�d	�|jdd
7<|�d�dS)Nz501 Syntax: EHLO hostnamer�Tz250-%sz250-SIZE %s�MAIL�z250-8BITMIMEz250-SMTPUTF8�
z250 HELP)	rQrErDrFrIr;r(r=r<r�rrr�	smtp_EHLO�s&



zSMTPChannel.smtp_EHLOcCs|r|�d�n
|�d�dS)Nz501 Syntax: NOOPr��rQr�rrr�	smtp_NOOP�szSMTPChannel.smtp_NOOPcCs|�d�|��dS)Nz221 Bye)rQZclose_when_doner�rrr�	smtp_QUIT�s
zSMTPChannel.smtp_QUITcCs0t|�}|d|���|kr,||d���SdS)Nr)r}r�r�)r�keywordr�Zkeylenrrr�_strip_command_keyword�sz"SMTPChannel._strip_command_keywordcCsF|sdS|���d�r$t|�\}}nt|�\}}|s<||fS|j|fS)N)rr�<)�lstrip�
startswithrrZ	addr_spec)rr��address�restrrr�_getaddr�szSMTPChannel._getaddrcCsHi}|D]:}|�d�\}}}|��r,|r2|s2dS|r:|nd||<q|S)N�=T)�	partition�isalnum)r�params�resultZparam�eqrdrrr�
_getparams�szSMTPChannel._getparamscCs|r�d}|��}|dkr$|�d�q�|dkr8|�d�q�|dkr^d}|jrR||7}|�|�q�|dkr�d	}|jrx||7}|�|�q�|d
kr�|�d�q�|dkr�|�d
�q�|dkr�|�d�q�|dkr�|�d�q�|dkr�|�d�q�|�d�n
|�d�dS)N� [SP <mail-parameters>]ZEHLOz250 Syntax: EHLO hostnameZHELOz250 Syntax: HELO hostnamer�z 250 Syntax: MAIL FROM: <address>ZRCPTz250 Syntax: RCPT TO: <address>r|z250 Syntax: DATAZRSETz250 Syntax: RSETZNOOPz250 Syntax: NOOPZQUITz250 Syntax: QUITZVRFYz250 Syntax: VRFY <address>zD501 Supported commands: EHLO HELO MAIL RCPT DATA RSET NOOP QUIT VRFYzD250 Supported commands: EHLO HELO MAIL RCPT DATA RSET NOOP QUIT VRFY)r�rQrF)rr�ZextendedZlc_argrrrr�	smtp_HELP�s:zSMTPChannel.smtp_HELPcCs@|r2|�|�\}}|r"|�d�q<|�d|�n
|�d�dS)NzB252 Cannot VRFY user, but will accept message and attempt deliveryz502 Could not VRFY %sz501 Syntax: VRFY <address>)r�rQ)rr�r�r�rrr�	smtp_VRFY�szSMTPChannel.smtp_VRFYcCs�|js|�d�dStd|td�d}|jr4|d7}|dkrJ|�|�dS|�d|�}|�|�\}}|sv|�|�dS|js�|r�|�|�dS|jr�|�d�dS|���	�|_
|�|j
�}|dkr�|�|�dS|js�|�
dd	�}|d
kr�|�d�dS|j�r8|�
dd
�}|dk�r d|_n|d
k	�r8|�d�dS|�
dd�}|�r�|���sb|�|�dS|j�r�t|�|jk�r�|�d�dSt|���dk�r�|�d�dS||_td|jtd�|�d�dS)N�503 Error: send HELO firstz	===> MAILrz 501 Syntax: MAIL FROM: <address>r�zFROM:z503 Error: nested MAIL commandZBODY�7BIT)r�Z8BITMIMEz1501 Error: BODY can only be one of 7BIT, 8BITMIMEZSMTPUTF8FTz&501 Error: SMTPUTF8 takes no argumentsZSIZEz:552 Error: message size exceeds fixed maximum message sizerz:555 MAIL FROM parameters not recognized or not implementedzsender:r�)rErQrrPrFr�r�rWr�r�r�r�r=�popr<rY�isdigitr;�intr}�keys)rr��	syntaxerrr�r�Zbody�smtputf8�sizerrr�	smtp_MAILsh














zSMTPChannel.smtp_MAILcCs|js|�d�dStd|td�|js6|�d�dSd}|jrH|d7}|dkr^|�|�dS|�d|�}|�|�\}}|s�|�|�dS|js�|r�|�|�dS|���	�|_
|�|j
�}|dkr�|�|�dSt|�
��dkr�|�d	�dS|j�|�td
|jtd�|�d�dS)Nr�z	===> RCPTrz503 Error: need MAIL commandz501 Syntax: RCPT TO: <address>r�zTO:rz8555 RCPT TO parameters not recognized or not implementedzrecips:r�)rErQrrPrWrFr�r�r�r�r�r�r}r�rXr~)rr�r�r�r�rrr�	smtp_RCPT7s@







zSMTPChannel.smtp_RCPTcCs(|r|�d�dS|��|�d�dS)Nz501 Syntax: RSETr�)rQrDr�rrr�	smtp_RSETZs

zSMTPChannel.smtp_RSETcCsZ|js|�d�dS|js(|�d�dS|r:|�d�dS|j|_|�d�|�d�dS)Nr�z503 Error: need RCPT commandz501 Syntax: DATAs
.
z#354 End data with <CR><LF>.<CR><LF>)rErQrXr|rVr[r�rrr�	smtp_DATAas



zSMTPChannel.smtp_DATAcCs|�d�dS)Nz502 EXPN not implementedr�r�rrr�	smtp_EXPNpszSMTPChannel.smtp_EXPN),rrrrUr|r+�collections�defaultdictr(�propertyr,�DATA_SIZE_DEFAULTr7r\rDZ_SMTPChannel__server�setterZ_SMTPChannel__lineZ_SMTPChannel__stateZ_SMTPChannel__greetingZ_SMTPChannel__mailfromZ_SMTPChannel__rcpttosZ_SMTPChannel__dataZ_SMTPChannel__fqdnZ_SMTPChannel__peerZ_SMTPChannel__connZ_SMTPChannel__addrrQr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrws�
�
'	





















>#6#c@s2eZdZeZedddfdd�Zdd�Zdd�ZdS)	rNFcCs�||_||_||_||_||_|r.|r.td��tjj||d�zNt	j
|dt	ji�}|�|dd|dd�|�
�|�|�|�d�Wn|���Yn(Xtd|jjt�t���||ftd�dS)	Nr/r-�typerr$�z0%s started at %s
	Local addr: %s
	Remote addr:%sr)Z
_localaddr�_remoteaddrr;r<r=r*�asyncore�
dispatcherr7rHZgetaddrinfoZSOCK_STREAMZ
create_socketZset_reuse_addrZbindZlistenrLr�	__class__r�time�ctimerP)rZ	localaddrZ
remoteaddrr;r.r<rSZgai_resultsrrrr7xs6�
��zSMTPServer.__init__c	Cs6tdt|�td�|�||||j|j|j|j�}dS)NzIncoming connection from %sr)rrOrP�
channel_classr;�_mapr<r=)rr9r:Zchannelrrr�handle_accepted�s�zSMTPServer.handle_acceptedcKst�dS)aOverride this abstract method to handle messages from the client.

        peer is a tuple containing (ipaddr, port) of the client that made the
        socket connection to our smtp port.

        mailfrom is the raw address the client claims the message is coming
        from.

        rcpttos is a list of raw addresses the client wishes to deliver the
        message to.

        data is a string containing the entire full text of the message,
        headers (if supplied) and all.  It has been `de-transparencied'
        according to RFC 821, Section 4.5.2.  In other words, a line
        containing a `.' followed by other text has had the leading dot
        removed.

        kwargs is a dictionary containing additional information.  It is
        empty if decode_data=True was given as init parameter, otherwise
        it will contain the following keys:
            'mail_options': list of parameters to the mail command.  All
                            elements are uppercase strings.  Example:
                            ['BODY=8BITMIME', 'SMTPUTF8'].
            'rcpt_options': same, for the rcpt command.

        This function should return None for a normal `250 Ok' response;
        otherwise, it should return the desired response string in RFC 821
        format.

        N)�NotImplementedError�rrJrWrXr�r�rrrr��szSMTPServer.process_message)	rrrrr�r�r7r�r�rrrrrts�
c@seZdZdd�Zdd�ZdS)rcCsld}|��}|D]V}|rL|sLd|d}t|t�s@t|�d��}t|�d}t|t�s^t|�}t|�qdS)Nr$zX-Peer: rry)�
splitlines�
isinstancerrO�encoder)rrJr�Z	inheaders�linesr�Z
peerheaderrrr�_print_message_content�s

z&DebuggingServer._print_message_contentcKsXtd�|r@|�d�r&td|d�|�d�r@td|d�|�||�td�dS)Nz%---------- MESSAGE FOLLOWS ----------r�zmail options: %sr�zrcpt options: %s
z%------------ END MESSAGE ------------)r�getr�r�rrrr��s

zDebuggingServer.process_messageN)rrrr�r�rrrrr�scs,eZdZ�fdd�Zdd�Zdd�Z�ZS)rcs.d|kr|drtd��tt|�j||�dS)Nr<z$PureProxy does not support SMTPUTF8.�r*�superrr7�rrMr��r�rrr7�szPureProxy.__init__c	Csf|�d�}d}|D]}|sq(|d7}q|�|d|d�t�|�}|�|||�}td|td�dS)Nrrr$z
X-Peer: %szwe got some refusals:r)r��insertrAr��_deliverrrP)	rrJrWrXr�r�r�r��refusedrrrr��s


zPureProxy.process_messagec
Cs�ddl}i}zB|��}|�|jd|jd�z|�|||�}W5|��XWn�|jk
r�}ztdtd�|j	}W5d}~XYnft
|jfk
r�}zBtd|jtd�t
|dd�}t
|dd	�}	|D]}
||	f||
<q�W5d}~XYnX|S)
Nrr$zgot SMTPRecipientsRefusedrZgotZ	smtp_code���Z
smtp_error�ignore)�smtplibZSMTPZconnectr��quitZsendmailZSMTPRecipientsRefusedrrPZ
recipientsrKZ
SMTPExceptionr�r�)rrWrXr�r�r��s�eZerrcode�errmsg�rrrrr��s$ zPureProxy._deliver)rrrr7r�r��
__classcell__rrr�rr�scs$eZdZ�fdd�Zdd�Z�ZS)r	cs.d|kr|drtd��tt|�j||�dS)Nr<z'MailmanProxy does not support SMTPUTF8.r�r�r�rrr7
szMailmanProxy.__init__cCs*ddlm}ddlm}ddlm}ddlm}g}	|D]t}
|
���d�d}|�d�}t|�dkrfq8|d}
t|�dkr�|d	}nd
}|�	|
�r8|dkr�q8|	�
|
|
|f�q8|	D]\}
}
}|�|
�q�tdd
�
|�td�|r�|�|||�}td|td�i}||�}|�|�}|�d��s&||d<|�d��sDt�t���|d<|	D]�\}
}
}td|
td�|�|
�}|�s�|j|
dd�}|||
<|d
k�r�|j|d	d�n�|dk�r�|j|d	d�nh|dk�r�|j|d	d�nN|dk�r�|j|d	d�n4|dk�rH|dk�rd|d <nd!|d <|j|d	d��qHdS)"Nr)�StringIO)�Utils)�Message)�MailList�@�-r_r$r)r�admin�owner�requestr��leavezforwarding recips:r�rzwe got refusals:�fromZFrom�dateZDatezsending message to)�lock)�tolistr�)Ztoadminr�)Ztoownerr�)Z	torequest)r�r�r�Z	subscribeZSubjectZunsubscribe)�ior�ZMailmanr�r�r��lowerr�r}Zlist_existsr~�removerr�rPr�r�r�r�ZEnqueue)rrJrWrXr�r�r�r�r�Z	listnamesZrcptZlocal�partsZlistnamer�r�Zmlistsr�rZmlistrrrr�sb










zMailmanProxy.process_message)rrrr7r�r�rrr�rr	sc@seZdZdZdZdZdZdS)�OptionsTrNF)rrr�setuid�	classname�
size_limitr<rrrrr�_sr�c
Cspz.t�tjdd�dddddddd	g�\}}Wn.tjk
r\}ztd|�W5d}~XYnXt�}|D]�\}}|d
kr�td�qh|dkr�tt�t�d�qh|d
kr�d|_	qh|dkr�||_
qh|dkr�tjaqh|dkr�d|_
qh|dkrhzt|�}||_Wqhtd|tjd�t�d�YqhXqht|�dk�r<d}d}nPt|�dk�rX|d}d}n4t|�dk�rx|d}|d}ntddt�|��|�d�}	|	dk�r�tdd|�|d|	�|_zt||	dd��|_Wn$tk
�r�tdd|�YnX|�d�}	|	dk�rtdd|�|d|	�|_zt||	dd��|_Wn$tk
�rjtdd|�YnX|S) Nr$z	nVhc:s:duzclass=Znosetuid�version�helpzsize=�debugr�)z-hz--helpr)z-Vz	--version)z-nz
--nosetuidF)z-cz--class)z-dz--debug)z-uz
--smtputf8T)z-sz--sizezInvalid size: rzlocalhost:8025zlocalhost:25r_�zInvalid arguments: %s�:zBad local spec: %szBad local port: %szBad remote spec: %szBad remote port: %s)�getoptr�argv�errorr#r�rrRr!r�r�r rPr<r�r�r}�
COMMASPACEr�r��	localhost�	localportr*�
remotehost�
remoteport)
ZoptsrMr��options�optr�Zint_sizeZ	localspecZ
remotespecr�rrr�	parseargsfsv��






r
�__main__r1r$)r<z7Cannot import module "pwd"; try running with -n option.r�nobodyr_z3Cannot setuid "nobody"; try running with -n option.)r)@rr�osrNrr�rHr�r5r��warningsrZemail._header_value_parserrr�__all__rZprogramrRr
rPrArr�r#r6rr�rrrr	r�r
rrr��rfindZlastdot�
__import__r�locals�modrr�Zclass_rrr	r
r�r<�proxyr��pwd�ImportErrorrr r!�getpwnamr�PermissionErrorZloop�KeyboardInterruptrrrr�<module>s�N�

M-SB




�__pycache__/signal.cpython-38.pyc000064400000005435151153537560012703 0ustar00U

e5d��@s&ddlZddlTddlmZddlmZe�Ze�	de
dd��e�	de
d	d��d
ekrle�	de
dd��d
d�Zdd�Zeej
�dd��Z
eej�dd��Zd
ekr�eej�dd
��Zejje_dekr�eej�dd��Zdek�reej�dd��Zeje_dek�reej�dd��Z[[dS)�N)�*)�wraps)�IntEnum�SignalscCs(|��r|�d�r|�d�p&|�d�S)NZSIGZSIG_ZCTRL_)�isupper�
startswith��name�r
�/usr/lib64/python3.8/signal.py�<lambda>
s�r�HandlerscCs|dkS)N)�SIG_DFL�SIG_IGNr
rr
r
rr��pthread_sigmaskZSigmaskscCs|dkS)N)�	SIG_BLOCK�SIG_UNBLOCK�SIG_SETMASKr
rr
r
rrrcCs(z
||�WStk
r"|YSXdS)zsConvert a numeric value to an IntEnum member.
    If it's not a known member, return the numeric value itself.
    N)�
ValueError)�valueZ
enum_klassr
r
r�_int_to_enums
rc	Cs,z
t|�WSttfk
r&|YSXdS)zmConvert an IntEnum member to a numeric value.
    If it's not an IntEnum member return the value itself.
    N)�intr�	TypeError)rr
r
r�_enum_to_int#s
rcCst�t|�t|��}t|t�S�N)�_signal�signalrrr
�Z	signalnumZhandlerr
r
rr-srcCst�|�}t|t�Sr)r�	getsignalrr
rr
r
rr3s
rcCst�||�}tdd�|D��S)Ncss|]}t|t�VqdSr�rr��.0�xr
r
r�	<genexpr>=sz"pthread_sigmask.<locals>.<genexpr>)rr�set)Zhow�maskZsigs_setr
r
rr:s�
sigpendingcCsdd�t��D�S)NcSsh|]}t|t��qSr
r r!r
r
r�	<setcomp>Dszsigpending.<locals>.<setcomp>)rr'r
r
r
rr'Bs�sigwaitcCst�|�}t|t�Sr)rr)rr)ZsigsetZretsigr
r
rr)Hs
�
valid_signalscCsdd�t��D�S)NcSsh|]}t|t��qSr
r r!r
r
rr(Rsz valid_signals.<locals>.<setcomp>)rr*r
r
r
rr*Ps)r�	functoolsrZ_wraps�enumrZ_IntEnum�globalsZ_globals�	_convert_�__name__rrrrr�__doc__r'r)r*r
r
r
r�<module>sR���










__pycache__/_sysconfigdata__linux_x86_64-linux-gnu.cpython-38.pyc000064400000070732151153537560020745 0ustar00U

��.en���@s`dddddddddddddd	dd
ddd
dddddddddddddddddddddddddd d!d"d#dddd$d%dd&d'd(d$d)dddd*d+dddddddd,d$d$d$d$dd$dd$d$d$d$d$dddddddddd$dd$d$d$d$d$d$d$d$dd$d$d$d$d$dd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$dd$d$d$dd$dd$dd$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$d$d$dd$d$d$d$d$d$dd$d$d$d$dd$d$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$d$d$dd$ddd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$dd$d$d$d$dd$d$d$d$d$ddd$d$dd$dddd$d$d$ddd$d$dddd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$d$d$dd$d$dd$d$dd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$dd$d$d$d$d$d$dd$d$d$d$d$d$d$d$ddd$d$d$dd$d$ddd$d$d$d$d$d$d$dddddd$dd$d$dddddd$ddd$d$d$d$d$d$d$d$d$d$d$ddd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$ddd$d$d$d$ddd$d$d$ddd$dd$d$d$d$d$d$d$d$d$d$d$d$d$d$ddd-ddd.d/d.d.d0d1d2dd3d4d5dd	d6ddd7dd8d9dd:d;dd<ddd=d>d?d@ddd)ddAdBddCdddd
dd$dDdEdFdGdddHddIdJd$dKddddLdMdddddddddNdOdPdddQd$d$dRdd
ddSddddTdUdddVddWd$dXdYddZd4d[d\dd]dd$ddd^d_d`dadbd7ddcddd=ded$dddfdgdhdgdfdhdfdfdgdgdfd\dfdfdfdfdgd$didjdkd$dldmddnd8d$dddddoddpdqdd$ddddrd$d6dsd$d$d$d$dddd$d$ddtdudsdvdwdwdsdx���ZdyS)z��ZarZrcsz!-Wno-unused-result -Wsign-comparez-IObjects -IInclude -IPythonz/usr/binz/usr/lib64/python3.8z-L. -lpython3.8zOgcc -pthread -shared -Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -g�pythonzx86_64-redhat-linux-gnu�\zgcc -pthreadz-fPICa-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapvz?configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.ina-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapvaK-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declarationz-Wl,-z,relro  -Wl,-z,now  -gz�-Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -ga�'--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--enable-ipv6' '--enable-shared' '--with-computed-gotos=yes' '--with-dbmliborder=gdbm:ndbm:bdb' '--with-system-expat' '--with-system-ffi' '--enable-loadable-sqlite-extensions' '--with-dtrace' '--with-lto' '--with-ssl-default-suites=openssl' '--with-valgrind' '--without-ensurepip' '--enable-optimizations' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'CFLAGS= -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv ' 'LDFLAGS= -Wl,-z,relro  -Wl,-z,now  -g ' 'CPPFLAGS=' 'PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'z/usr/includez/usr/include/python3.8zA/builddir/build/BUILD/Python-3.8.17/build/optimized/coverage.infoz?/builddir/build/BUILD/Python-3.8.17/build/optimized/lcov-reportz2--no-branch-coverage --title "CPython lcov report"zN-IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Includezg++ -pthreadzE/usr /usr/lib64 /usr/lib64/python3.8 /usr/lib64/python3.8/lib-dynloadz /usr/lib64/python3.8/lib-dynloadi�zoREADME.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in Include Lib Misc Ext-dummyzInclude Lib Misc Ext-dummyzTREADME.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in�.�z/usr/bin/dtracezInclude/pydtrace_probes.hzPython/pydtrace.ozdynload_shlib.oZnoz.cpython-38-x86_64-linux-gnu.soi�ZyeszG/usr/include /usr/include /usr/include/python3.8 /usr/include/python3.8z/usr/bin/install -cz/usr/bin/install -c -m 644z/usr/bin/install -c -m 755zlibpython3.8.so.1.0zModules/_io/_iomodule.hzg++ -pthread -sharedz:-Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -gzlibpython3.8.soz3.8z
/usr/lib64z-lmzPython/z/usr/lib64/pkgconfigz0/usr/lib64/python3.8/config-3.8-x86_64-linux-gnuzlibpython3.8.az"-lcrypt -lpthread -ldl  -lutil -lmz0tkinter tkinter/test tkinter/test/test_tkinter \Zgccz-Xlinker -export-dynamic�trueZlnZlinuxz5/builddir/build/BUILD/Python-3.8.17/Modules/makesetupz/usr/share/manz/usr/bin/mkdir -pz�posix  errno  pwd  _sre  _codecs  _weakref  _functools  _operator  _collections  _abc  itertools  atexit  _signal  _stat  time  _thread  _locale  _io  faulthandler  _tracemalloc  _symtable  xxsubtypeavModules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  Modules/_sre.o  Modules/_codecsmodule.o  Modules/_weakref.o  Modules/_functoolsmodule.o  Modules/_operator.o  Modules/_collectionsmodule.o  Modules/_abc.o  Modules/itertoolsmodule.o  Modules/atexitmodule.o  Modules/signalmodule.o  Modules/_stat.o  Modules/timemodule.o  Modules/_threadmodule.o  Modules/_localemodule.o  Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o  Modules/faulthandler.o  Modules/_tracemalloc.o Modules/hashtable.o  Modules/symtablemodule.o  Modules/xxsubtype.ozx86_64-linux-gnuz -DMULTIARCH=\"x86_64-linux-gnu\"z-Wl,--no-as-neededz-lssl -lcryptoa:-DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapvz:\ Parser/myreadline.o Parser/parsetok.o Parser/tokenizer.oz-fprofile-generatez"-fprofile-use -fprofile-correctionz
-m test --pgoz
libpython3.sozno-frameworkz./python -Ez	python3.8a-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition  -fprofile-use -fprofile-correction -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPIC -DPy_BUILD_CORE_BUILTINa.-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition  -fprofile-use -fprofile-correction -I/builddir/build/BUILD/Python-3.8.17/Include/internala-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition  -fprofile-use -fprofile-correction -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPIC -DPy_BUILD_COREaT-Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g -lcryptoz"z"a-Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g�a-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition  -fprofile-use -fprofile-correction -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPICz)-x test_subprocess test_io test_lib2to3 \ZreadelfzMac/Resources/frameworkZvoidzCLD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/optimizedz	@SGI_ABI@z/bin/shz.so���zcpython-38-x86_64-linux-gnuz2Parser Objects Python Modules Modules/_io Programsz:/builddir/build/BUILD/Python-3.8.17/Tools/gdb/libpython.pyz"/* Don't use ncurses extensions */z-szInclude Lib MisczLLD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/optimized ./pythonz�LD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/optimized ./python /builddir/build/BUILD/Python-3.8.17/Tools/scripts/run_tests.pyi�zJpython3.8 /builddir/build/BUILD/Python-3.8.17/Tools/scripts/update_file.pyz#/builddir/build/BUILD/Python-3.8.17z)xml xml/dom xml/etree xml/parsers xml/saxz3/builddir/build/BUILD/Python-3.8.17/build/optimizedz
/usr/sharez/usr(�ZABIFLAGSZAC_APPLE_UNIVERSAL_BUILDZAIX_GENUINE_CPLUSPLUSZ	ALT_SOABIZANDROID_API_LEVELZARZARFLAGSZ
BASECFLAGSZBASECPPFLAGSZBASEMODLIBSZBINDIRZ
BINLIBDESTZ
BLDLIBRARYZ	BLDSHAREDZBUILDEXEZBUILDPYTHONZBUILD_GNU_TYPEZBYTESTR_DEPSZCCZCCSHAREDZCFLAGSZCFLAGSFORSHAREDZCFLAGS_ALIASINGZCONFIGFILESZCONFIGURE_CFLAGSZCONFIGURE_CFLAGS_NODISTZCONFIGURE_CPPFLAGSZCONFIGURE_LDFLAGSZCONFIGURE_LDFLAGS_NODISTZCONFIG_ARGSZCONFINCLUDEDIRZ
CONFINCLUDEPYZCOREPYTHONPATHZ
COVERAGE_INFOZCOVERAGE_REPORTZCOVERAGE_REPORT_OPTIONSZCPPFLAGSZCXXZDESTDIRSZDESTLIBZDESTPATHZ
DESTSHAREDZDFLAGSZDIRMODEZDISTZDISTDIRSZ	DISTFILESZ	DLINCLDIRZ
DLLLIBRARYZ"DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754ZDOUBLE_IS_BIG_ENDIAN_IEEE754ZDOUBLE_IS_LITTLE_ENDIAN_IEEE754ZDTRACEZDTRACE_DEPSZDTRACE_HEADERSZDTRACE_OBJSZDYNLOADFILEZENABLE_IPV6Z	ENSUREPIPZEXEZEXEMODEZ
EXTRATESTOPTSZ
EXT_SUFFIXZFILEMODEZFLOAT_WORDS_BIGENDIANZFLOCK_NEEDS_LIBBSDZGETPGRP_HAVE_ARGZGETTIMEOFDAY_NO_TZZ	GITBRANCHZGITTAGZ
GITVERSIONZGNULDZHAVE_ACCEPT4Z
HAVE_ACOSHZ
HAVE_ADDRINFOZ
HAVE_ALARMZHAVE_ALIGNED_REQUIREDZ
HAVE_ALLOCA_HZHAVE_ALTZONEZ
HAVE_ASINHZHAVE_ASM_TYPES_HZ
HAVE_ATANHZHAVE_BIND_TEXTDOMAIN_CODESETZHAVE_BLUETOOTH_BLUETOOTH_HZHAVE_BLUETOOTH_HZHAVE_BROKEN_MBSTOWCSZHAVE_BROKEN_NICEZHAVE_BROKEN_PIPE_BUFZHAVE_BROKEN_POLLZHAVE_BROKEN_POSIX_SEMAPHORESZHAVE_BROKEN_PTHREAD_SIGMASKZHAVE_BROKEN_SEM_GETVALUEZHAVE_BROKEN_UNSETENVZHAVE_BUILTIN_ATOMICZHAVE_CHFLAGSZ
HAVE_CHOWNZHAVE_CHROOTZ
HAVE_CLOCKZHAVE_CLOCK_GETRESZHAVE_CLOCK_GETTIMEZHAVE_CLOCK_SETTIMEZHAVE_COMPUTED_GOTOSZHAVE_CONFSTRZHAVE_CONIO_HZ
HAVE_COPYSIGNZHAVE_COPY_FILE_RANGEZHAVE_CRYPT_HZHAVE_CRYPT_RZHAVE_CTERMIDZHAVE_CTERMID_RZHAVE_CURSES_FILTERZ
HAVE_CURSES_HZHAVE_CURSES_HAS_KEYZHAVE_CURSES_IMMEDOKZHAVE_CURSES_IS_PADZHAVE_CURSES_IS_TERM_RESIZEDZHAVE_CURSES_RESIZETERMZHAVE_CURSES_RESIZE_TERMZHAVE_CURSES_SYNCOKZHAVE_CURSES_TYPEAHEADZHAVE_CURSES_USE_ENVZHAVE_CURSES_WCHGATZHAVE_DECL_ISFINITEZHAVE_DECL_ISINFZHAVE_DECL_ISNANZHAVE_DECL_RTLD_DEEPBINDZHAVE_DECL_RTLD_GLOBALZHAVE_DECL_RTLD_LAZYZHAVE_DECL_RTLD_LOCALZHAVE_DECL_RTLD_MEMBERZHAVE_DECL_RTLD_NODELETEZHAVE_DECL_RTLD_NOLOADZHAVE_DECL_RTLD_NOWZHAVE_DECL_TZNAMEZHAVE_DEVICE_MACROSZHAVE_DEV_PTCZ
HAVE_DEV_PTMXZ
HAVE_DIRECT_HZHAVE_DIRENT_D_TYPEZ
HAVE_DIRENT_HZ
HAVE_DIRFDZHAVE_DLFCN_HZHAVE_DLOPENZ	HAVE_DUP2Z	HAVE_DUP3Z$HAVE_DYLD_SHARED_CACHE_CONTAINS_PATHZHAVE_DYNAMIC_LOADINGZ
HAVE_ENDIAN_HZ
HAVE_EPOLLZHAVE_EPOLL_CREATE1ZHAVE_ERFZ	HAVE_ERFCZHAVE_ERRNO_HZ
HAVE_EXECVZHAVE_EXPLICIT_BZEROZHAVE_EXPLICIT_MEMSETZ
HAVE_EXPM1ZHAVE_FACCESSATZHAVE_FCHDIRZHAVE_FCHMODZ
HAVE_FCHMODATZHAVE_FCHOWNZ
HAVE_FCHOWNATZHAVE_FCNTL_HZHAVE_FDATASYNCZHAVE_FDOPENDIRZHAVE_FDWALKZHAVE_FEXECVEZHAVE_FINITEZ
HAVE_FLOCKZ	HAVE_FORKZHAVE_FORKPTYZHAVE_FPATHCONFZHAVE_FSEEK64ZHAVE_FSEEKOZHAVE_FSTATATZ
HAVE_FSTATVFSZ
HAVE_FSYNCZHAVE_FTELL64ZHAVE_FTELLOZ
HAVE_FTIMEZHAVE_FTRUNCATEZ
HAVE_FUTIMENSZHAVE_FUTIMESZHAVE_FUTIMESATZHAVE_GAI_STRERRORZ
HAVE_GAMMAZHAVE_GCC_ASM_FOR_MC68881ZHAVE_GCC_ASM_FOR_X64ZHAVE_GCC_ASM_FOR_X87ZHAVE_GCC_UINT128_TZHAVE_GETADDRINFOZHAVE_GETC_UNLOCKEDZHAVE_GETENTROPYZHAVE_GETGRGID_RZHAVE_GETGRNAM_RZHAVE_GETGROUPLISTZHAVE_GETGROUPSZHAVE_GETHOSTBYNAMEZHAVE_GETHOSTBYNAME_RZHAVE_GETHOSTBYNAME_R_3_ARGZHAVE_GETHOSTBYNAME_R_5_ARGZHAVE_GETHOSTBYNAME_R_6_ARGZHAVE_GETITIMERZHAVE_GETLOADAVGZ
HAVE_GETLOGINZHAVE_GETNAMEINFOZHAVE_GETPAGESIZEZHAVE_GETPEERNAMEZHAVE_GETPGIDZHAVE_GETPGRPZHAVE_GETPIDZHAVE_GETPRIORITYZ
HAVE_GETPWENTZHAVE_GETPWNAM_RZHAVE_GETPWUID_RZHAVE_GETRANDOMZHAVE_GETRANDOM_SYSCALLZHAVE_GETRESGIDZHAVE_GETRESUIDZHAVE_GETSIDZ
HAVE_GETSPENTZ
HAVE_GETSPNAMZHAVE_GETTIMEOFDAYZ
HAVE_GETWDZHAVE_GLIBC_MEMMOVE_BUGZ
HAVE_GRP_HZHAVE_HSTRERRORZHAVE_HTOLE64Z
HAVE_HYPOTZ
HAVE_IEEEFP_HZHAVE_IF_NAMEINDEXZHAVE_INET_ATONZHAVE_INET_PTONZHAVE_INITGROUPSZHAVE_INTTYPES_HZ	HAVE_IO_HZHAVE_IPA_PURE_CONST_BUGZ	HAVE_KILLZHAVE_KILLPGZHAVE_KQUEUEZHAVE_LANGINFO_HZHAVE_LARGEFILE_SUPPORTZ
HAVE_LCHFLAGSZHAVE_LCHMODZHAVE_LCHOWNZHAVE_LGAMMAZ
HAVE_LIBDLZHAVE_LIBDLDZHAVE_LIBIEEEZHAVE_LIBINTL_HZHAVE_LIBREADLINEZHAVE_LIBRESOLVZHAVE_LIBSENDFILEZHAVE_LIBUTIL_HZ	HAVE_LINKZHAVE_LINKATZHAVE_LINUX_CAN_BCM_HZHAVE_LINUX_CAN_HZHAVE_LINUX_CAN_RAW_FD_FRAMESZHAVE_LINUX_CAN_RAW_HZHAVE_LINUX_MEMFD_HZHAVE_LINUX_NETLINK_HZHAVE_LINUX_QRTR_HZHAVE_LINUX_RANDOM_HZHAVE_LINUX_TIPC_HZHAVE_LINUX_VM_SOCKETS_HZ
HAVE_LOCKFZ
HAVE_LOG1PZ	HAVE_LOG2ZHAVE_LONG_DOUBLEZ
HAVE_LSTATZHAVE_LUTIMESZHAVE_MADVISEZHAVE_MAKEDEVZHAVE_MBRTOWCZHAVE_MEMFD_CREATEZ
HAVE_MEMORY_HZHAVE_MEMRCHRZHAVE_MKDIRATZHAVE_MKFIFOZ
HAVE_MKFIFOATZ
HAVE_MKNODZHAVE_MKNODATZHAVE_MKTIMEZ	HAVE_MMAPZHAVE_MREMAPZHAVE_NCURSES_HZHAVE_NDIR_HZHAVE_NETPACKET_PACKET_HZ
HAVE_NET_IF_HZ	HAVE_NICEZHAVE_OPENATZHAVE_OPENPTYZ
HAVE_PATHCONFZ
HAVE_PAUSEZ
HAVE_PIPE2Z
HAVE_PLOCKZ	HAVE_POLLZHAVE_POLL_HZHAVE_POSIX_FADVISEZHAVE_POSIX_FALLOCATEZHAVE_POSIX_SPAWNZHAVE_POSIX_SPAWNPZ
HAVE_PREADZHAVE_PREADVZHAVE_PREADV2ZHAVE_PRLIMITZHAVE_PROCESS_HZHAVE_PROTOTYPESZHAVE_PTHREAD_CONDATTR_SETCLOCKZHAVE_PTHREAD_DESTRUCTORZHAVE_PTHREAD_GETCPUCLOCKIDZHAVE_PTHREAD_HZHAVE_PTHREAD_INITZHAVE_PTHREAD_KILLZHAVE_PTHREAD_SIGMASKZ
HAVE_PTY_HZHAVE_PUTENVZHAVE_PWRITEZHAVE_PWRITEVZ
HAVE_PWRITEV2Z
HAVE_READLINKZHAVE_READLINKATZ
HAVE_READVZ
HAVE_REALPATHZ
HAVE_RENAMEATZHAVE_RL_APPEND_HISTORYZHAVE_RL_CATCH_SIGNALZ#HAVE_RL_COMPLETION_APPEND_CHARACTERZ'HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOKZHAVE_RL_COMPLETION_MATCHESZ"HAVE_RL_COMPLETION_SUPPRESS_APPENDZHAVE_RL_PRE_INPUT_HOOKZHAVE_RL_RESIZE_TERMINALZ
HAVE_ROUNDZ
HAVE_RTPSPAWNZHAVE_SCHED_GET_PRIORITY_MAXZHAVE_SCHED_HZHAVE_SCHED_RR_GET_INTERVALZHAVE_SCHED_SETAFFINITYZHAVE_SCHED_SETPARAMZHAVE_SCHED_SETSCHEDULERZHAVE_SEM_GETVALUEZ
HAVE_SEM_OPENZHAVE_SEM_TIMEDWAITZHAVE_SEM_UNLINKZ
HAVE_SENDFILEZHAVE_SETEGIDZHAVE_SETEUIDZHAVE_SETGIDZHAVE_SETGROUPSZHAVE_SETHOSTNAMEZHAVE_SETITIMERZHAVE_SETLOCALEZHAVE_SETPGIDZHAVE_SETPGRPZHAVE_SETPRIORITYZ
HAVE_SETREGIDZHAVE_SETRESGIDZHAVE_SETRESUIDZ
HAVE_SETREUIDZHAVE_SETSIDZHAVE_SETUIDZHAVE_SETVBUFZ
HAVE_SHADOW_HZ
HAVE_SHM_OPENZHAVE_SHM_UNLINKZHAVE_SIGACTIONZHAVE_SIGALTSTACKZHAVE_SIGFILLSETZHAVE_SIGINFO_T_SI_BANDZHAVE_SIGINTERRUPTZ
HAVE_SIGNAL_HZHAVE_SIGPENDINGZ
HAVE_SIGRELSEZHAVE_SIGTIMEDWAITZHAVE_SIGWAITZHAVE_SIGWAITINFOZ
HAVE_SNPRINTFZHAVE_SOCKADDR_ALGZHAVE_SOCKADDR_SA_LENZHAVE_SOCKADDR_STORAGEZHAVE_SOCKETPAIRZHAVE_SPAWN_HZHAVE_SSIZE_TZHAVE_STATVFSZHAVE_STAT_TV_NSECZHAVE_STAT_TV_NSEC2ZHAVE_STDARG_PROTOTYPESZ
HAVE_STDINT_HZ
HAVE_STDLIB_HZHAVE_STD_ATOMICZHAVE_STRDUPZ
HAVE_STRFTIMEZHAVE_STRINGS_HZ
HAVE_STRING_HZHAVE_STRLCPYZHAVE_STROPTS_HZHAVE_STRSIGNALZHAVE_STRUCT_PASSWD_PW_GECOSZHAVE_STRUCT_PASSWD_PW_PASSWDZHAVE_STRUCT_STAT_ST_BIRTHTIMEZHAVE_STRUCT_STAT_ST_BLKSIZEZHAVE_STRUCT_STAT_ST_BLOCKSZHAVE_STRUCT_STAT_ST_FLAGSZHAVE_STRUCT_STAT_ST_GENZHAVE_STRUCT_STAT_ST_RDEVZHAVE_STRUCT_TM_TM_ZONEZHAVE_SYMLINKZHAVE_SYMLINKATZ	HAVE_SYNCZHAVE_SYSCONFZHAVE_SYSEXITS_HZHAVE_SYS_AUDIOIO_HZHAVE_SYS_BSDTTY_HZHAVE_SYS_DEVPOLL_HZHAVE_SYS_DIR_HZHAVE_SYS_ENDIAN_HZHAVE_SYS_EPOLL_HZHAVE_SYS_EVENT_HZHAVE_SYS_FILE_HZHAVE_SYS_IOCTL_HZHAVE_SYS_KERN_CONTROL_HZHAVE_SYS_LOADAVG_HZHAVE_SYS_LOCK_HZHAVE_SYS_MEMFD_HZHAVE_SYS_MKDEV_HZHAVE_SYS_MMAN_HZHAVE_SYS_MODEM_HZHAVE_SYS_NDIR_HZHAVE_SYS_PARAM_HZHAVE_SYS_POLL_HZHAVE_SYS_RANDOM_HZHAVE_SYS_RESOURCE_HZHAVE_SYS_SELECT_HZHAVE_SYS_SENDFILE_HZHAVE_SYS_SOCKET_HZHAVE_SYS_STATVFS_HZHAVE_SYS_STAT_HZHAVE_SYS_SYSCALL_HZHAVE_SYS_SYSMACROS_HZHAVE_SYS_SYS_DOMAIN_HZHAVE_SYS_TERMIO_HZHAVE_SYS_TIMES_HZHAVE_SYS_TIME_HZHAVE_SYS_TYPES_HZHAVE_SYS_UIO_HZ
HAVE_SYS_UN_HZHAVE_SYS_UTSNAME_HZHAVE_SYS_WAIT_HZHAVE_SYS_XATTR_HZHAVE_TCGETPGRPZHAVE_TCSETPGRPZHAVE_TEMPNAMZHAVE_TERMIOS_HZHAVE_TERM_HZHAVE_TGAMMAZHAVE_TIMEGMZ
HAVE_TIMESZHAVE_TMPFILEZHAVE_TMPNAMZ
HAVE_TMPNAM_RZHAVE_TM_ZONEZ
HAVE_TRUNCATEZHAVE_TZNAMEZ
HAVE_UCS4_TCLZ
HAVE_UNAMEZ
HAVE_UNISTD_HZ
HAVE_UNLINKATZ
HAVE_UNSETENVZHAVE_USABLE_WCHAR_TZHAVE_UTIL_HZHAVE_UTIMENSATZHAVE_UTIMESZHAVE_UTIME_HZHAVE_UUID_CREATEZHAVE_UUID_ENC_BEZHAVE_UUID_GENERATE_TIME_SAFEZHAVE_UUID_HZHAVE_UUID_UUID_HZ
HAVE_WAIT3Z
HAVE_WAIT4ZHAVE_WAITIDZHAVE_WAITPIDZHAVE_WCHAR_HZHAVE_WCSCOLLZ
HAVE_WCSFTIMEZHAVE_WCSXFRMZHAVE_WMEMCMPZHAVE_WORKING_TZSETZHAVE_WRITEVZ HAVE_X509_VERIFY_PARAM_SET1_HOSTZHAVE_ZLIB_COPYZHAVE__GETPTYZ
HOST_GNU_TYPEZINCLDIRSTOMAKEZ
INCLUDEDIRZ	INCLUDEPYZINSTALLZINSTALL_DATAZINSTALL_PROGRAMZINSTALL_SCRIPTZINSTALL_SHAREDZ
INSTSONAMEZIO_HZIO_OBJSZLDCXXSHAREDZLDFLAGSZ	LDLIBRARYZLDLIBRARYDIRZLDSHAREDZ	LDVERSIONZLIBCZLIBDESTZLIBDIRZLIBFFI_INCLUDEDIRZLIBMZ	LIBOBJDIRZLIBOBJSZLIBPCZLIBPLZ	LIBPYTHONZLIBRARYZLIBRARY_OBJSZLIBRARY_OBJS_OMIT_FROZENZLIBSZ
LIBSUBDIRSZLINKCCZ
LINKFORSHAREDZLIPO_32BIT_FLAGSZLIPO_INTEL64_FLAGSZ
LLVM_PROF_ERRZLLVM_PROF_FILEZLLVM_PROF_MERGERZLNZLOCALMODLIBSZMACHDEPZMACHDEP_OBJSZMACHDESTLIBZMACOSX_DEPLOYMENT_TARGETZMAINCCZMAJOR_IN_MKDEVZMAJOR_IN_SYSMACROSZ	MAKESETUPZMANDIRZMKDIR_PZMODBUILT_NAMESZMODDISABLED_NAMESZMODLIBSZMODOBJSZMODULE_OBJSZ	MULTIARCHZMULTIARCH_CPPFLAGSZMVWDELCH_IS_EXPRESSIONZNO_AS_NEEDEDZOBJECT_OBJSZOPENSSL_INCLUDESZOPENSSL_LDFLAGSZOPENSSL_LIBSZOPTZOTHER_LIBTOOL_OPTZPACKAGE_BUGREPORTZPACKAGE_NAMEZPACKAGE_STRINGZPACKAGE_TARNAMEZPACKAGE_URLZPACKAGE_VERSIONZPARSER_HEADERSZPARSER_OBJSZPGO_PROF_GEN_FLAGZPGO_PROF_USE_FLAGZPOBJSZPOSIX_SEMAPHORES_NOT_ENABLEDZPROFILE_TASKZ$PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INTZPTHREAD_SYSTEM_SCHED_SUPPORTEDZ
PY3LIBRARYZPYLONG_BITS_IN_DIGITZPYTHONZPYTHONFRAMEWORKZPYTHONFRAMEWORKDIRZPYTHONFRAMEWORKINSTALLDIRZPYTHONFRAMEWORKPREFIXZ
PYTHONPATHZPYTHON_FOR_BUILDZPYTHON_FOR_REGENZPYTHON_HEADERSZPYTHON_OBJSZPY_BUILTIN_MODULE_CFLAGSZ	PY_CFLAGSZPY_CFLAGS_NODISTZPY_COERCE_C_LOCALEZPY_CORE_CFLAGSZPY_CORE_LDFLAGSZPY_CPPFLAGSZPY_FORMAT_SIZE_TZ
PY_LDFLAGSZPY_LDFLAGS_NODISTZPY_SSL_DEFAULT_CIPHERSZPY_SSL_DEFAULT_CIPHER_STRINGZPY_STDMODULE_CFLAGSZPy_DEBUGZPy_ENABLE_SHAREDZPy_HASH_ALGORITHMZ
Py_TRACE_REFSZ
QUICKTESTOPTSZREADELFZ	RESSRCDIRZ
RETSIGTYPEZ	RUNSHAREDZ	SCRIPTDIRZSETPGRP_HAVE_ARGZSGI_ABIZSHELLZSHLIBSZSHLIB_SUFFIXZSHM_NEEDS_LIBRTZSIGNED_RIGHT_SHIFT_ZERO_FILLSZSITEPATHZ
SIZEOF_DOUBLEZSIZEOF_FLOATZ
SIZEOF_FPOS_TZ
SIZEOF_INTZSIZEOF_LONGZSIZEOF_LONG_DOUBLEZSIZEOF_LONG_LONGZSIZEOF_OFF_TZSIZEOF_PID_TZSIZEOF_PTHREAD_KEY_TZSIZEOF_PTHREAD_TZSIZEOF_SHORTZ
SIZEOF_SIZE_TZ
SIZEOF_TIME_TZSIZEOF_UINTPTR_TZ
SIZEOF_VOID_PZSIZEOF_WCHAR_TZSIZEOF__BOOLZSOABIZSRCDIRSZ
SRC_GDB_HOOKSZSTDC_HEADERSZSTRICT_SYSV_CURSESZ	STRIPFLAGZSUBDIRSZ
SUBDIRSTOOZSYSLIBSZSYS_SELECT_WITH_SYS_TIMEZTCLTK_INCLUDESZ
TCLTK_LIBSZTESTOPTSZTESTPATHZ
TESTPYTHONZTESTPYTHONOPTSZ
TESTRUNNERZTESTTIMEOUTZTIMEMODULE_LIBZTIME_WITH_SYS_TIMEZTM_IN_SYS_TIMEZUNICODE_DEPSZUNIVERSALSDKZUPDATE_FILEZUSE_COMPUTED_GOTOSZVERSIONZVPATHZWINDOW_HAS_FLAGSZWITH_DECIMAL_CONTEXTVARZWITH_DOC_STRINGSZWITH_DTRACEZ	WITH_DYLDZWITH_LIBINTLZWITH_NEXT_FRAMEWORKZ
WITH_PYMALLOCZ
WITH_VALGRINDZX87_DOUBLE_ROUNDINGZ
XMLLIBSUBDIRSZabs_builddirZ
abs_srcdirZdatarootdir�exec_prefix�prefixZsrcdirN)Zbuild_time_vars�rr�>/usr/lib64/python3.8/_sysconfigdata__linux_x86_64-linux-gnu.py�<module>sb2,/��������__pycache__/stat.cpython-38.opt-1.pyc000064400000010426151153537560013334 0ustar00U

e5dm�
@sLdZdZdZdZdZdZdZdZdZd	Z	d
Z
dd�Zd
d�ZdZ
dZdZdZdZdZdZdZdZdZdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Z d*Z!d+Z"e"Z#d,Z$d-Z%d.Z&d/Z'd0Z(d-Z)d.Z*d/Z+d1Z,d2Z-d3Z.d	Z/dZ0dZ1dZ2dZ3dZ4dZ5dZ6d	Z7d3Z8d2Z9dZ:d4Z;d5Z<d6Z=d7Z>d8Z?ed9fed:fed;fed<fe
d=fed>fed?ffe)d@ffe*dAffe+e!Bd:fe!dBfe+dCffe-d@ffe.dAffe/e"Bd:fe"dBfe/dCffe1d@ffe2dAffe3e$BdDfe$dEfe3dCfff
Z@dFdG�ZAd2ZBd*ZCd/ZDd3ZEdZFdZGdZHd.ZIdZJd5ZKdZLdZMd+ZNd,ZOdZPd-ZQd4ZRzddHlSTWneTk
�rFYnXdIS)JzoConstants/functions for interpreting results of os.stat() and os.lstat().

Suggested usage: from stat import *
����������	cCs|d@S)zMReturn the portion of the file's mode that can be set by
    os.chmod().
    i����moderr�/usr/lib64/python3.8/stat.py�S_IMODEsrcCs|d@S)zLReturn the portion of the file's mode that describes the
    file type.
    i�rrrrr�S_IFMTsri@i i`i�ii�i�cCst|�tkS)z(Return True if mode is from a directory.)r�S_IFDIRrrrr�S_ISDIR2srcCst|�tkS)z<Return True if mode is from a character special device file.)r�S_IFCHRrrrr�S_ISCHR6srcCst|�tkS)z8Return True if mode is from a block special device file.)r�S_IFBLKrrrr�S_ISBLK:srcCst|�tkS)z+Return True if mode is from a regular file.)r�S_IFREGrrrr�S_ISREG>srcCst|�tkS)z0Return True if mode is from a FIFO (named pipe).)r�S_IFIFOrrrr�S_ISFIFOBsrcCst|�tkS)z,Return True if mode is from a symbolic link.)r�S_IFLNKrrrr�S_ISLNKFsrcCst|�tkS)z%Return True if mode is from a socket.)r�S_IFSOCKrrrr�S_ISSOCKJsrcCsdS)z#Return True if mode is from a door.Frrrrr�S_ISDOORNsrcCsdS)z*Return True if mode is from an event port.Frrrrr�S_ISPORTRsr cCsdS)z'Return True if mode is from a whiteout.Frrrrr�S_ISWHTVsr!iii���@i��8� �iiiii �l�s�-�b�d�c�p�r�w�S�x�t�TcCsJg}tD]6}|D]"\}}||@|kr|�|�qq|�d�qd�|�S)z;Convert a file's mode to a string of the form '-rwxrwxrwx'.r*�)�_filemode_table�append�join)r
Zperm�table�bit�charrrr�filemode�s
r<)�*N)U�__doc__�ST_MODE�ST_INO�ST_DEV�ST_NLINK�ST_UID�ST_GID�ST_SIZE�ST_ATIME�ST_MTIME�ST_CTIMErrrrrrrrr�S_IFDOOR�S_IFPORT�S_IFWHTrrrrrrrrr r!�S_ISUID�S_ISGID�S_ENFMT�S_ISVTX�S_IREAD�S_IWRITE�S_IEXEC�S_IRWXU�S_IRUSR�S_IWUSR�S_IXUSR�S_IRWXG�S_IRGRP�S_IWGRP�S_IXGRP�S_IRWXO�S_IROTH�S_IWOTH�S_IXOTH�	UF_NODUMP�UF_IMMUTABLE�	UF_APPEND�	UF_OPAQUE�UF_NOUNLINK�
UF_COMPRESSED�	UF_HIDDEN�SF_ARCHIVED�SF_IMMUTABLE�	SF_APPEND�SF_NOUNLINK�SF_SNAPSHOTr6r<�FILE_ATTRIBUTE_ARCHIVE�FILE_ATTRIBUTE_COMPRESSED�FILE_ATTRIBUTE_DEVICE�FILE_ATTRIBUTE_DIRECTORY�FILE_ATTRIBUTE_ENCRYPTED�FILE_ATTRIBUTE_HIDDEN�FILE_ATTRIBUTE_INTEGRITY_STREAM�FILE_ATTRIBUTE_NORMAL�"FILE_ATTRIBUTE_NOT_CONTENT_INDEXED�FILE_ATTRIBUTE_NO_SCRUB_DATA�FILE_ATTRIBUTE_OFFLINE�FILE_ATTRIBUTE_READONLY�FILE_ATTRIBUTE_REPARSE_POINT�FILE_ATTRIBUTE_SPARSE_FILE�FILE_ATTRIBUTE_SYSTEM�FILE_ATTRIBUTE_TEMPORARY�FILE_ATTRIBUTE_VIRTUAL�_stat�ImportErrorrrrr�<module>s�	�
�
�
��__pycache__/pdb.cpython-38.opt-2.pyc000064400000100516151153537560013127 0ustar00U

e5d��"@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZGdd�de�Zdddddd	d
ddg	Zd
d�Zdd�Zdd�ZGdd�de�ZdZGdd�dejej�Zedk	�rjddddddddddd d!d"d#d$d%d&d'dd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6g"ZeD]"Zeeed7e�j��d87Z�q6eej j7Z[[dId9d�Z!dJd:d�Z"d;d�Z#d<d	�Z$dd=�d>d
�Z%dKd?d�Z&d@d�Z'dAZ(dBdC�Z)dDd�Z*dEZ+dFdG�Z,e-dHk�r�ddl.Z.e.�,�dS)L�Nc@seZdZdS)�RestartN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/pdb.pyrWsr�run�pm�Pdb�runeval�runctx�runcall�	set_trace�post_mortem�helpc
Cs�t�dt�|��}zt�|�}Wntk
r8YdSX|�@t|dd�D],\}}|�|�rL|||fW5QR�SqLW5QRXdS)Nzdef\s+%s\s*[(]�)�start)�re�compile�escape�tokenize�open�OSError�	enumerate�match)�funcname�filenameZcre�fp�lineno�linerrr�
find_function^s
&r cCsXt�|�\}}t�|�r,|j|jkr,|dfSt�|�r>|dfSt�||d��|dfS�Nr)�inspectZ
findsourceZisframe�	f_globals�f_localsZismoduleZgetblock)�obj�linesrrrr�getsourcelinesks
r'cCs8tt�|��}|��|D]\}}||kr|SqdS�Nr)�list�disZfindlinestarts�reverse)�codeZlastiZ
linestarts�irrrr�lasti2linenots
r.c@seZdZdd�ZdS)�_rstrcCs|S�Nr��selfrrr�__repr__sz_rstr.__repr__N)rrrr3rrrrr/}sr/z
-> c@seZdZdZd�dd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�ZeZd�d8d9�Zd:d;�ZeZ eZ!eZ"d<d=�Z#eZ$d>d?�Z%d@dA�Z&dBdC�Z'eZ(dDdE�Z)eZ*dFdG�Z+eZ,dHdI�Z-eZ.dJdK�Z/e/Z0eZ1eZ2dLdM�Z3e3Z4e3Z5dNdO�Z6dPdQ�Z7e7Z8dRdS�Z9e9Z:dTdU�Z;e;Z<dVdW�Z=e=Z>dXdY�Z?e?Z@dZd[�ZAeAZBd\d]�ZCeCZDd^d_�ZEeEZFZGd`da�ZHeHZIdbdc�ZJeZKddde�ZLeLZMeLZNdfdg�ZOdhdi�ZPePZQdjdk�ZReRZSdldm�ZTd�dndo�ZUdpdq�ZVdrds�ZWeZXeZYeZZdtdu�Z[e[Z\dvdw�Z]e]Z^dxdy�Z_eZ`d�d{d|�Zad}d~�ZbeZcdd��ZdeZed�d��Zfd�d��Zgd�d��Zhd�d��Zid�d��Zjd�d��Zkd�d�d�d�d�d�gZld�d��Zmenfd�d��Zod�d��ZpepZqd�d��Zrd�d��Zsd�d��Ztd�d��Zud�d��ZvdS)�r
N�tabFTc		Cs>tjj||d�tj�||||�t�d�|r6d|_d|_i|_	i|_
d|_d|_i|_
zddl}|�d�Wntk
r�YnXd|_||_g|_|�rz,ttj�d���}|j�|�W5QRXWntk
r�YnXz$td	��}|j�|�W5QRXWntk
�rYnXi|_i|_i|_d|_d|_dS)
N)�skipzpdb.Pdbrz(Pdb) �Fz 	
`@#$%^&*()=+[{]}\|;:'",<>?z~/.pdbrcz.pdbrc)�bdb�Bdb�__init__�cmd�Cmd�sys�auditZuse_rawinput�prompt�aliases�
displaying�
mainpyfile�_wait_for_mainpyfile�	tb_lineno�readlineZset_completer_delims�ImportError�allow_kbdint�nosigint�rcLinesr�os�path�
expanduser�extendr�commands�commands_doprompt�commands_silent�commands_defining�
commands_bnum)	r2�completekey�stdin�stdoutr5rGZreadrcrDZrcFilerrrr9�sF

zPdb.__init__cCs*|jr
t�|�d�|��|�|�dS)Nz-
Program interrupted. (Use 'cont' to resume).)rF�KeyboardInterrupt�message�set_stepr)r2Zsignum�framerrr�sigint_handler�s

zPdb.sigint_handlercCstj�|�|��dSr0)r7r8�reset�forgetr1rrrrZ�sz	Pdb.resetcCs&d|_g|_d|_d|_|j��dSr()r�stack�curindex�curframerC�clearr1rrrr[�s
z
Pdb.forgetcCsh|��|�||�\|_|_|rDt|jj|j�}||j|j<|j	}q|j|jd|_
|j
j|_|�
�Sr()r[Z	get_stackr\r]r.�tb_frame�f_code�tb_lastirC�tb_nextr^r$�curframe_locals�execRcLines)r2�f�tbrrrr�setup�s
z	Pdb.setupcCsd|js
dS|j}|��g|_|r`|����}|r|ddkr|�|�r|jt|�7_dSqdS)Nr�#T)rHr+�pop�strip�onecmd�reversed)r2rHrrrrre�s
zPdb.execRcLinescCs.|jr
dS|�|�r*|�d�|�|d�dS)Nz--Call--)rBZ	stop_hererV�interaction)r2rXZ
argument_listrrr�	user_call�s


z
Pdb.user_callcCsH|jr.|j|�|jj�ks$|jdkr(dSd|_|�|�rD|�|d�dS)NrF)rBrA�canonicra�co_filename�f_lineno�bp_commandsrn)r2rXrrr�	user_line�s�
z
Pdb.user_linecCs�t|dd�r�|j|jkr�|j}d|_|j}|�|d�|j|D]}|�|�q@||_|j|sr|�|j|j	�|j
|r�|��|��dSdS)N�	currentbpFrr)
�getattrrurM�lastcmdrhrlrO�print_stack_entryr\r]rN�_cmdloopr[)r2rXruZlastcmd_backrrrrrss"
�

zPdb.bp_commandscCs.|jr
dS||jd<|�d�|�|d�dS)N�
__return__z
--Return--)rBr$rVrn)r2rXZreturn_valuerrr�user_return s


zPdb.user_returncCsh|jr
dS|\}}}||f|jd<|s2|tkr2dnd}|�d|t�||�d��f�|�||�dS)NZ
__exception__z	Internal r6z%s%s���)rBr$�
StopIterationrV�	traceback�format_exception_onlyrkrn)r2rX�exc_info�exc_type�	exc_value�
exc_traceback�prefixrrr�user_exception(s
���zPdb.user_exceptioncCsBzd|_|��d|_Wq>Wqtk
r:|�d�YqXqdS)NTFz--KeyboardInterrupt--)rF�cmdlooprUrVr1rrrry<szPdb._cmdloopcCs^|j�|j�}|rZ|��D]>\}}|�|�}||k	r||kr|||<|�d|||f�qdS)Nzdisplay %s: %r  [old: %r])r@�getr^�items�_getval_exceptrV)r2r@�exprZoldvalueZnewvaluerrr�preloopIs
�zPdb.preloopcCsttjr6zt�tjtj�Wntk
r.YnXdt_|�||�rN|��dS|�|j|j	�|�
�|��dSr0)r
�_previous_sigint_handler�signal�SIGINT�
ValueErrorrhr[rxr\r]ry)r2rXr~rrrrnVszPdb.interactioncCs|dk	r|�t|��dSr0)rV�repr)r2r%rrr�displayhookhszPdb.displayhookc	Cs�|dd�dkr|dd�}|j}|jj}zdt|ddd�}tj}tj}tj}z(|jt_|jt_|jt_t|||�W5|t_|t_|t_XWn4t�	�dd�}|�
tj|�d�
��YnXdS)Nr�!�
z<stdin>Zsingle�r|)rdr^r#rr<rTrSr��execr��errorr~rrk)	r2r�locals�globalsr,Zsave_stdoutZ
save_stdinZsave_displayhookr�rrr�defaultps(zPdb.defaultcCs�|��s|S|��}|d|jkr�|j|d}d}|dd�D] }|�dt|�|�}|d7}q@|�dd�|dd���}|��}q|ddkr�|�d�}|dkr�||dd���}|j�	|�|d|��
�}|S)	Nrr�%z%*� �aliasz;;r�)rk�splitr?�replace�str�join�find�lstrip�cmdqueue�append�rstrip)r2r�argsZiiZtmpArgZmarker�nextrrr�precmd�s(�


z
Pdb.precmdcCs"|jstj�||�S|�|�SdSr0)rPr:r;rl�handle_command_def)r2rrrrrl�sz
Pdb.onecmdcCs�|�|�\}}}|sdS|dkr0d|j|j<dS|dkrBg|_dS|j|j}|rf|�|d|�n
|�|�zt|d|�}Wntk
r�|j}YnX|j	|j
kr�d|j|j<g|_dSdS)NZsilentT�endrr��do_F)Z	parselinerOrQr�rMr�rv�AttributeErrorr�r�commands_resumingrN)r2rr:�argZcmdlist�funcrrrr��s,
zPdb.handle_command_defcCst||jd�dS)N��file��printrT�r2�msgrrrrV�szPdb.messagecCstd||jd�dS)Nz***r�r�r�rrrr��sz	Pdb.errorcCs�|���d�rgSz|�||||�}Wntk
r>g}YnXt�t�|�d�}|D]H}tj�|�rx|�	|d�qXtj�
|�rX|���d�rX|�	|d�qX|S)N)�:�,�*�/)�.pyz.pywr�)rk�endswith�_complete_expression�	Exception�globrrIrJ�isdirr��isfile�lower)r2�textr�begidx�endidxZret�globs�fnrrr�_complete_location�s
zPdb._complete_locationcs�fdd�ttjj�D�S)Ncs.g|]&\}}|dk	rt|����rt|��qSr0)r��
startswith)�.0r-�bp�r�rr�
<listcomp>�s�z*Pdb._complete_bpnumber.<locals>.<listcomp>)rr7�
Breakpoint�
bpbynumber�r2r�rr�r�rr�r�_complete_bpnumber�szPdb._complete_bpnumberc	s�|js
gS|jj|j�}d�kr���d��z,|�d}�dd�D]}t||�}qDWnttfk
rrgYSXd��dd��d���fdd�t|�D�S�fdd�|�	�D�SdS)N�.rrr|cs"g|]}|��d�r�|�qS)r|�r��r��n)�dottedr�rrr�sz,Pdb._complete_expression.<locals>.<listcomp>csg|]}|���r|�qSrr�r�r�rrr�s
)
r^r#rdr�rv�KeyErrorr�r��dir�keys)r2r�rr�r��nsr%�partr)r�r�r�rr��s

zPdb._complete_expressioncCs,|sttjj�d}n&zt|�}Wn|�d�YdSX||_||jkrj|j||j||j	|f}nd}g|j|<d|j|<d|j	|<|j
}d|_
d|_zzz|��Wnht
k
�r|r�|d|j|<|d|j|<|d|j	|<n|j|=|j|=|j	|=|�d�YnXW5d|_||_
XdS)	Nrz.Usage: commands [bnum]
        ...
        endTFz(com) rr�z1command definition aborted, old commands restored)�lenr7r�r��intr�rQrMrNrOr>rPr�rU)r2r�ZbnumZold_command_defsZprompt_backrrr�do_commands	sB%

�


zPdb.do_commandsrc
CsB|s8|jr4|�d�tjjD]}|r|�|���qdSd}d}d}|�d�}|dkrz||dd���}|d|���}|�	d�}d}	|dk�r|d|���}|�
|�}
|
s�|�d|�dS|
}||dd���}zt|�}Wn&t
k
�r|�d|�YdSXn�zt|�}Wn�t
k
�r�zt||jj|j�}Wn|}YnXz.t|d��rj|j}|j}|j}	|j}|j}WnD|�|�\}
}}|
�s�|�d	|�YYdS|
}	t|�}YnXYnX|�s�|��}|�||�}|�r>|�|||||	�}|�r|�|�n*|�||�d
}|�d|j|j|jf�dS)Nz!Num Type         Disp Enb   Wherer�rrr�z%r not found from sys.pathzBad lineno: %s�__func__zJThe specified object %r is not a function or was not found along sys.path.r|zBreakpoint %d at %s:%d) �breaksrVr7r�r�Zbpformatr�r�r��rfind�lookupmoduler�r�r��evalr^r#rd�hasattrr��__code__�co_name�co_firstlinenorq�lineinfo�defaultFile�	checklineZ	set_break�
get_breaks�numberr�r)r2r�Z	temporaryr�rr�condZcommaZcolonrrfr�r,�okZlnr�errrrr�do_breakXs�





�

��zPdb.do_breakcCs"|jjj}|dkr|jr|j}|S)Nz<string>)r^rarqrA)r2rrrrr��s
zPdb.defaultFilecCs|�|d�dSr!)r��r2r�rrr�	do_tbreak�sz
Pdb.do_tbreakc
Cs�d}|�d�}t|�dkr(|d��}nt|�dkrB|d��}n|S|dkrR|S|�d�}|ddkr~|d=t|�dkr~|S|��}t|�dkr�|d}n|�|d�}|r�|}|d}t||�}	|	p�|S)	N)NNN�'rr�r6r�r2)r�r�rkr�r�r )
r2Z
identifierZfailedZidstring�id�partsZfname�itemrfZanswerrrrr��s.



zPdb.lineinfocCs�t|d�r|jjnd}t�|||�}|s6|�d�dS|��}|rn|ddksn|dd�dksn|dd�dkr||�d�dS|S)	Nr^zEnd of filerrir�z"""z'''zBlank or comment)r�r^r#�	linecache�getlinerVrkr�)r2rrr�rrrrr��s
��
z
Pdb.checklinecCsh|��}|D]V}z|�|�}Wn,tk
rJ}z|�|�W5d}~XYqX|��|�d|�qdS)Nz
Enabled %s)r��get_bpbynumberr�r��enablerV�r2r�r�r-r�r�rrr�	do_enablesz
Pdb.do_enablecCsh|��}|D]V}z|�|�}Wn,tk
rJ}z|�|�W5d}~XYqX|��|�d|�qdS)NzDisabled %s)r�r�r�r��disablerVr�rrr�
do_disableszPdb.do_disablec
Cs�|�dd�}z|d}Wntk
r0d}YnXz|�|d���}WnHtk
rf|�d�YnXtk
r�}z|�|�W5d}~XYn.X||_|s�|�d|j�n|�d|j�dS)Nr�rr�Breakpoint number expectedz#Breakpoint %d is now unconditional.z$New condition set for breakpoint %d.)	r��
IndexErrorr�rkr�r�r�rVr�)r2r�r�r�r�r�rrr�do_condition%s
zPdb.do_conditionc
Cs�|��}zt|d���}Wnd}YnXz|�|d���}WnHtk
rb|�d�Ynvtk
r�}z|�|�W5d}~XYnLX||_|dkr�|dkr�d|}nd}|�d||j	f�n|�d|j	�dS)Nrrr�z%d crossingsz
1 crossingz%Will ignore next %s of breakpoint %d.z-Will stop next time breakpoint %d is reached.)
r�r�rkr�rr�r��ignorerVr�)r2r�r��countr�r�Zcountstrrrr�	do_ignore@s,	

��z
Pdb.do_ignorec
Cs�|stztd�}Wntk
r(d}YnX|����}|dkrpdd�tjjD�}|��|D]}|�d|�q\dSd|k�r|�	d�}|d|�}||dd�}zt
|�}Wntk
r�d	|}YnX|�||�}|�
||�}|r�|�|�n|D]}|�d|�q�dS|��}	|	D]\}z|�|�}Wn.tk
�r^}z|�|�W5d}~XYnX|�|�|�d|��qdS)
NzClear all breaks? Zno)�yZyescSsg|]}|r|�qSrr)r�r�rrrr�qsz Pdb.do_clear.<locals>.<listcomp>z
Deleted %sr�rzInvalid line number (%s))�input�EOFErrorrkr�r7r�r�Zclear_all_breaksrVr�r�r�r�Zclear_breakr�r�r�Zclear_bpbynumber)
r2r�ZreplyZbplistr�r-rrr�Z
numberlistrrr�do_clearcsF



zPdb.do_clearcCs|��dSr0)�print_stack_tracer�rrr�do_where�szPdb.do_wherecCs>||_|j|jd|_|jj|_|�|j|j�d|_dSr()r]r\r^r$rdrxr)r2r�rrr�
_select_frame�s

zPdb._select_framecCsz|jdkr|�d�dSzt|p"d�}Wn$tk
rL|�d|�YdSX|dkr\d}ntd|j|�}|�|�dS)NrzOldest framer�Invalid frame count (%s))r]r�r�r��maxr�r2r�rZnewframerrr�do_up�s

z	Pdb.do_upcCs�|jdt|j�kr"|�d�dSzt|p,d�}Wn$tk
rV|�d|�YdSX|dkrpt|j�d}ntt|j�d|j|�}|�|�dS)NrzNewest framerr)r]r�r\r�r�r��minrrrrr�do_down�s
zPdb.do_downcCsh|rRzt|�}Wn$tk
r4|�d|�YdSX||jjkrV|�d�dSnd}|�|j|�dS)N�Error in argument: %rz7"until" line number is smaller than current line numberr)r�r�r�r^rrZ	set_until)r2r�rrrr�do_until�s
zPdb.do_untilcCs|��dSr!)rWr�rrr�do_step�szPdb.do_stepcCs|�|j�dSr!)Zset_nextr^r�rrr�do_next�szPdb.do_nextcCs<|r4ddl}tjdd�}|�|�t_|tjdd�<t�dS)Nrr)�shlexr<�argvr�r)r2r�rZargv0rrr�do_run�sz
Pdb.do_runcCs|�|j�dSr!)Z
set_returnr^r�rrr�	do_returnsz
Pdb.do_returncCs>|js2zt�tj|j�t_Wntk
r0YnX|��dSr!)rGr�r�rYr
r�r�Zset_continuer�rrr�do_continues�zPdb.do_continuec
Cs�|jdt|j�kr"|�d�dSzt|�}Wntk
rL|�d�YnnXz:||j_|j|jd|f|j|j<|�|j|j�Wn0tk
r�}z|�d|�W5d}~XYnXdS)Nrz)You can only jump within the bottom framez)The 'jump' command requires a line numberrzJump failed: %s)	r]r�r\r�r�r�r^rrrx)r2r��errr�do_jump&s
zPdb.do_jumpcCs�t�d�|jj}|j}t|j|j|j�}d|j	�
�|_	|�d�zt�|j
|||f�Wn<tk
r�t��dd�}|�tj|�d�
��YnX|�d�t�|j�|j|_dS)Nz(%s) zENTERING RECURSIVE DEBUGGERr�r|zLEAVING RECURSIVE DEBUGGER)r<�settracer^r#rdr
rRrSrTr>rkrV�call_tracingrr�r�r�r~rZtrace_dispatchrw)r2r�r�r��pr�rrr�do_debugCs


zPdb.do_debugcCsd|_|��dS)NTr)�_user_requested_quit�set_quitr�rrr�do_quitZszPdb.do_quitcCs|�d�d|_|��dS)Nr6Tr)rVr!r"r�rrr�do_EOFes
z
Pdb.do_EOFcCs�|jj}|j}|j|j}|jtj@r.|d}|jtj@rB|d}t	|�D]>}|j
|}||krx|�d|||f�qJ|�d|f�qJdS)Nrz%s = %rz%s = *** undefined ***)r^rard�co_argcount�co_kwonlyargcount�co_flagsr"Z
CO_VARARGSZCO_VARKEYWORDS�range�co_varnamesrV)r2r��co�dictr�r-�namerrr�do_argsns
zPdb.do_argscCs.d|jkr |�t|jd��n
|�d�dS)NrzzNot yet returned!)rdrVr�r�r�rrr�	do_retvals
z
Pdb.do_retvalcCsPzt||jj|j�WSt��dd�}|�tj|�d�	���YnXdS)Nr�r|)
r�r^r#rdr<r�r�r~rrk)r2r�r�rrr�_getval�szPdb._getvalcCsrz2|dkrt||jj|j�WSt||j|j�WSWn:t��dd�}tj|�d�	�}t
d|�YSXdS)Nr�r|z** raised %s **)r�r^r#rdr$r<r�r~rrkr/)r2r�rXr�r�rrrr��szPdb._getval_exceptcCs*z|�t|�|���WnYnXdSr0)rVr�r/r�rrr�do_p�szPdb.do_pcCs,z|�t�|�|���WnYnXdSr0)rV�pprintZpformatr/r�rrr�do_pp�sz	Pdb.do_ppcCsfd|_d}|r�|dkr�z^d|krX|�d�\}}t|���}t|���}||krr||}nt|���}td|d�}Wq�tk
r�|�d|�YdSXn0|jdks�|dkr�td|jj	d�}n
|jd}|dkr�|d}|jj
j}|�|�}zZt
�||jj�}|�||d|�|||j�t|t|��|_t|�|k�rH|�d�Wntk
�r`YnXdS)	Nr)r�r�r�r�
z[EOF])rwr�r�rkr
r�r�rr^rrrarq�get_file_breaksr��getlinesr#�_print_linesrr�rVrU)r2r�Zlast�firstr�	breaklistr&rrr�do_list�s@




�zPdb.do_listc
Csp|jjj}|�|�}zt|j�\}}Wn2tk
rX}z|�|�WY�dSd}~XYnX|�||||j�dSr0)r^rarqr5r'rr�r7)r2r�rr9r&rr�rrr�do_longlist�s


zPdb.do_longlistc
Csvz|�|�}WnYdSXzt|�\}}Wn6ttfk
rd}z|�|�WY�dSd}~XYnX|�||�dSr0)r/r'r�	TypeErrorr�r7)r2r�r%r&rr�rrr�	do_source�s
z
Pdb.do_sourcerc
Cs�|r|j}|j�|d�}nd}}t||�D]|\}}t|��d�}	t|	�dkrV|	d7}	||krh|	d7}	n|	d7}	||kr�|	d7}	n||kr�|	d7}	|�|	d|���q,dS)	Nr|r��r��Bz->z>>�	)	rrrCr�rr��rjustr�rVr�)
r2r&rr�rXZcurrent_linenoZ
exc_linenorr�srrrr7s 

zPdb._print_linescCs�z|�|�}WnYdSXd}z|jj}Wntk
rBYnX|r\|�d|j�dSz
|j}Wntk
rzYnX|r�|�d|j�dS|jtkr�|�d|j|j	f�dS|�t|��dS)Nz	Method %szFunction %szClass %s.%s)
r/r�r�r�rVr��	__class__�typerr)r2r��valuer,rrr�	do_whatiss.

z
Pdb.do_whatiscCsl|s8|�d�|j�|ji���D]}|�d|�q"n0|�|�}||j�|ji�|<|�d||f�dS)NzCurrently displaying:z%s: %rzdisplay %s: %r)rVr@r�r^r�r��
setdefault)r2r�r��valrrr�
do_display<s

zPdb.do_displaycCsT|r@z|j�|ji�|=WqPtk
r<|�d|�YqPXn|j�|jd�dS)Nznot displaying %s)r@r�r^r�r�rjr�rrr�do_undisplayOszPdb.do_undisplaycs�fdd�|j�|ji�D�S)Ncsg|]}|���r|�qSrr�)r�rr�rrr�_s
�z*Pdb.complete_undisplay.<locals>.<listcomp>)r@r�r^r�rr�r�complete_undisplay^szPdb.complete_undisplaycCs |jj|j�}tjd|d�dS)Nz
*interactive*)Zlocal)r^r#rdr,�interact)r2r�r�rrr�do_interactbszPdb.do_interactcCs�|��}t|�dkrHt|j���}|D]}|�d||j|f�q&dS|d|jkr�t|�dkr�|�d|d|j|df�nd�|dd��|j|d<dS)Nrz%s = %srr�)r�r��sortedr?r�rVr�)r2r�r�r�r�rrr�do_aliasks"zPdb.do_aliascCs6|��}t|�dkrdS|d|jkr2|j|d=dSr()r�r�r?)r2r�r�rrr�
do_unalias�s
zPdb.do_unaliascs�fdd�|jD�S)Ncsg|]}|���r|�qSrr�)r��ar�rrr��s
z(Pdb.complete_unalias.<locals>.<listcomp>)r?r�rr�r�complete_unalias�szPdb.complete_unaliasrrrrr#rcCs4z|jD]}|�|�qWntk
r.YnXdSr0)r\rxrU)r2�frame_linenorrrr	�s

zPdb.print_stack_tracecCs6|\}}||jkrd}nd}|�||�||��dS)Nz> z  )r^rVZformat_stack_entry)r2rSZ
prompt_prefixrXrr�rrrrx�s

�zPdb.print_stack_entrycCs�|stj�||�Sz@zt|d|�}|�WWStk
rNt|d|�}YnXWn"tk
rt|�d|�Yn0Xtjjdkr�|�d|�dS|�	|j
���dS)NZhelp_r�zNo help for %rr�zJNo help for %r; please do not run Python with -OO if you need command help)r:r;�do_helprvr�r�r<�flags�optimizerV�__doc__r�)r2r�ZtopicZcommandrrrrT�s 
�zPdb.do_helpcCs|�|jjpd���dS)Nr6)rV�	help_execrWrkr1rrrrX�s
z
Pdb.help_execcCs
t�dSr0)rr1rrr�help_pdb�szPdb.help_pdbcCs�tj�|�rtj�|�r|Stj�tjd|�}tj�|�rP|�|�|jkrP|Stj�|�\}}|dkrp|d}tj�|�r�|StjD]>}tj�	|�r�t�
|�}q�tj�||�}tj�|�r�|Sq�dS)Nrr6r�)rIrJ�isabs�existsr�r<rprA�splitext�islink�readlink)r2rrf�rootZext�dirname�fullnamerrrr��s"

zPdb.lookupmodulec	Csrd|_d|_ddl}|�|�\}}}|�|j�|_ddl}|j�	�|j�
d|j|j|j|t
d��|�|�dS)NTFr�__main__)r�__file__�__package__�
__loader__�__spec__�__builtins__)rBr!�runpyZ_get_module_detailsrprqrArb�__dict__r_�update�parent�loaderrgr)r2Zmodule_namerhZmod_nameZmod_specr,rbrrr�
_runmodule�s 
�zPdb._runmodulec	Cstddl}|j��|j�d|td��d|_|�|�|_d|_t	�
|��}d|��|jf}W5QRX|�|�dS)Nrrb)rrcrgTFzexec(compile(%r, %r, 'exec')))
rbrir_rjrgrBrprAr!�io�	open_code�readr)r2rrbr�	statementrrr�
_runscript
s
�
�zPdb._runscript)r4NNNFT)r)N)rN)wrrrr�r9rYrZr[rhrerortrsr{r�ryr�rnr�r�r�rlr�rVr�r�r�r�r�Zcomplete_commandsr�r�Zdo_bZcomplete_breakZ
complete_br�Zcomplete_tbreakr�r�r�Zcomplete_enabler�Zcomplete_disablerZcomplete_conditionrZcomplete_ignorerZdo_clZcomplete_clearZcomplete_clr
Zdo_wZdo_btrrZdo_urZdo_drZdo_untrZdo_srZdo_nrZ
do_restartrZdo_rrZdo_cZdo_contrZdo_jr Zcomplete_debugr#Zdo_qZdo_exitr$r-Zdo_ar.Zdo_rvr/r�r0r2Zcomplete_printZ
complete_pZcomplete_ppr:Zdo_lr;Zdo_llr=Zcomplete_sourcer7rFZcomplete_whatisrIZcomplete_displayrJrKrMrOrPrRr�r	�line_prefixrxrTZdo_hrXrYr�rmrrrrrrr
�s��
/	


M
]!!.	
		1
!	#	��whereZdownZup�breakZtbreakr_r�r�rZ	conditionrM�stepr�ZuntilZjump�returnZretval�continuer)Zlonglistr�rZppZwhatis�sourceZdisplayZ	undisplayrLr�Zunalias�debug�quitr�z

cCst��|||�dSr0)r
r�rqr�r�rrrr<scCst��|||�Sr0)r
r)Z
expressionr�r�rrrr?scCst|||�dSr0)rr|rrrrBscOst�j||�Sr0)r
r
)r��kwdsrrrr
Fs)�headercCs,t�}|dk	r|�|�|�t��j�dSr0)r
rVrr<�	_getframe�f_back)r~�pdbrrrrIs
cCsB|dkrt��d}|dkr$td��t�}|��|�d|�dS)Nr�zAA valid traceback must be passed if no exception is being handled)r<r�r�r
rZrn)�trrrrrQscCsttj�dSr0)rr<�last_tracebackrrrrr	_szimport x; x.main()cCstt�dSr0)r�TESTCMDrrrr�testgsr�cCsddl}|�t�dSr()�pydocZpagerrW)r�rrrrksausage: pdb.py [-c command] ... [-m module | pyfile] [arg] ...

Debug the Python program given by pyfile. Alternatively,
an executable module or package to debug can be specified using
the -m switch.

Initial commands are read from .pdbrc files in your home directory
and in the current directory, if they exist.  Commands supplied with
-c are executed after commands from .pdbrc files.

To let the script run until an exception occurs, use "-c continue".
To let the script run up to a given line X in the debugged file, use
"-c 'until X'".c

Csddl}|�tjdd�dddg�\}}|s>tt�t�d�g}d}|D]B\}}|dkrltt�t��qJ|d	kr�|�|�qJ|d
krJd}qJ|d}|s�tj�	|�s�td|d
�t�d�|tjdd�<|s�tj�
|�}tj�|�tjd<t�}|j
�|�z6|�r|�|�n
|�|�|j�r*W�qtd�Wq�tk
�rrtd|d�tdd�tjdd���Yq�tk
�r�tddd�tt��d�Yq�tk
�r�t��t�d�Yq�t��td�td�t��d}	|�d|	�td|d�Yq�Xq�dS)Nrrzmhc:rzcommand=r�F)z-hz--help)z-cz	--command)z-mTzError:zdoes not existz*The program finished and will be restartedZ
Restartingzwith arguments:r@r�z/The program exited via sys.exit(). Exit status:)r�z2Uncaught exception. Entering post mortem debuggingz1Running 'cont' or 'step' will restart the programz#Post mortem debugger finished. The z will be restarted)�getoptr<rr��_usage�exitr�rIrJr[�realpathr`r
rHrLrmrrr!rr��
SystemExitr��SyntaxErrorr~�	print_excrn)
r�Zoptsr�rMZ
run_as_module�optZoptargrAr�r�rrr�main~sd 



 �r�rb)NN)NN)N)/rIrnrr<r:r7r*r,r�r1r�r"rr~r�r�r�__all__r r'r.r�r/rsr8r;r
rWZ_help_orderZ_commandrvrkrXrrrr
rrr	r�r�rr�r�rr�rrrr�<module>Fs��
		*
� 


D
__pycache__/ast.cpython-38.pyc000064400000040575151153537560012221 0ustar00U

e5d"K�@s�dZddlTd=ddd�dd	�Zd
d�Zd>d
d�Zdd�Zdd�Zd?dd�Zdd�Zdd�Z	d@dd�Z
dd�Zdd�Zdd �d!d"�Z
d#d$�ZGd%d&�d&e�ZGd'd(�d(e�Zd)d*�Zd+d,�Zeee�e_eee�e_Gd-d.�d.e�Zd/d0�ZGd1d2�d2eed3�ZGd4d5�d5eed3�ZGd6d7�d7eed3�ZGd8d9�d9eed3�ZGd:d;�d;eed3�Zee e!e"fee#fee$feed�e%feed<�fiZ&ee%fiZ'e%d9ed�d9e d2e!d2e"d2e#d5e$d7ed<�d;iZ(dS)AaH
    ast
    ~~~

    The `ast` module helps Python applications to process trees of the Python
    abstract syntax grammar.  The abstract syntax itself might change with
    each Python release; this module helps to find out programmatically what
    the current grammar looks like and allows modifications of it.

    An abstract syntax tree can be generated by passing `ast.PyCF_ONLY_AST` as
    a flag to the `compile()` builtin function or by using the `parse()`
    function from this module.  The result will be a tree of objects whose
    classes all inherit from `ast.AST`.

    A modified abstract syntax tree can be compiled into a Python code object
    using the built-in `compile()` function.

    Additionally various helper functions are provided that make working with
    the trees simpler.  The main intention of the helper functions and this
    module in general is to provide an easy to use interface for libraries
    that work tightly with the python syntax (template engines for example).


    :copyright: Copyright 2008 by Armin Ronacher.
    :license: Python License.
�)�*�	<unknown>�execFN)�
type_comments�feature_versioncCsRt}|r|tO}t|t�r4|\}}|dks.t�|}n|dkr@d}t|||||d�S)z�
    Parse the source into an AST node.
    Equivalent to compile(source, filename, mode, PyCF_ONLY_AST).
    Pass type_comments=True to get back type comments where the syntax allows.
    �N���)�_feature_version)Z
PyCF_ONLY_ASTZPyCF_TYPE_COMMENTS�
isinstance�tuple�AssertionError�compile)�source�filename�moderr�flags�major�minor�r�/usr/lib64/python3.8/ast.py�parses

�rcs`t|t�rt|dd�}t|t�r&|j}dd���fdd���fdd������fd	d
���|�S)a
    Safely evaluate an expression node or a string containing a Python
    expression.  The string or node provided may only consist of the following
    Python literal structures: strings, bytes, numbers, tuples, lists, dicts,
    sets, booleans, and None.
    �eval)rcSstd|����dS)Nzmalformed node or string: )�
ValueError��noderrr�_raise_malformed_node>sz+literal_eval.<locals>._raise_malformed_nodecs,t|t�rt|j�tttfkr&�|�|jS�N)r
�Constant�type�value�int�float�complexr)rrr�_convert_num@sz"literal_eval.<locals>._convert_numcsDt|t�r<t|jttf�r<�|j�}t|jt�r6|
S|S�|�Sr)r
ZUnaryOp�opZUAddZUSub�operand)rr%)r#rr�_convert_signed_numDs
z)literal_eval.<locals>._convert_signed_numcst|t�r|jSt|t�r*tt�|j��St|t�rDtt�|j��St|t	�r^t
t�|j��St|t�r�t|j
�t|j�kr��|�ttt�|j
�t�|j���St|t��rt|jttf��r�|j�}�|j�}t|ttf��rt|t��rt|jt��r||S||S�|�Sr)r
rrZTupler�mapZeltsZList�list�Set�setZDict�len�keys�values�dict�zipZBinOpr$ZAddZSub�left�rightr r!r")rr0r1��_convertr#r&rrrr3Ls,





�

zliteral_eval.<locals>._convert)r
�strrZ
Expression�body)Znode_or_stringrr2r�literal_eval3s

r6Tcs2���fdd��t|t�s*td|jj���|�S)a�
    Return a formatted dump of the tree in node.  This is mainly useful for
    debugging purposes.  If annotate_fields is true (by default),
    the returned string will show the names and the values for fields.
    If annotate_fields is false, the result string will be more compact by
    omitting unambiguous field names.  Attributes such as line
    numbers and column offsets are not dumped by default.  If this is wanted,
    include_attributes can be set to true.
    c	st|t�r�g}�}|jD]V}zt||�}Wntk
rBd}YqX|r`|�d|�|�f�q|��|��q�r�|jr�|jD]:}z |�d|�t||��f�Wq�tk
r�Yq�Xq�d|jjd�	|�fSt|t
�r�dd�	�fdd�|D��St|�S)NTz%s=%sz%s(%s)z, z[%s]c3s|]}�|�VqdSrr)�.0�x)�_formatrr�	<genexpr>�sz(dump.<locals>._format.<locals>.<genexpr>)r
�AST�_fields�getattr�AttributeError�append�_attributes�	__class__�__name__�joinr(�repr)r�args�keywords�fieldr�a�r9�annotate_fields�include_attributesrrr9ps*




 
zdump.<locals>._formatzexpected AST, got %r)r
r;�	TypeErrorrArB)rrJrKrrIr�dumpfs

rMcCsVdD]L}||jkr||jkrt||d�}|dk	sDt||�r|�d�rt|||�q|S)z�
    Copy source location (`lineno`, `col_offset`, `end_lineno`, and `end_col_offset`
    attributes) from *old_node* to *new_node* if possible, and return *new_node*.
    )�lineno�
col_offset�
end_lineno�end_col_offsetNZend_)r@r=�hasattr�
startswith�setattr)�new_nodeZold_node�attrrrrr�
copy_location�s��rWcs �fdd���|dddd�|S)a{
    When you compile a node tree with compile(), the compiler expects lineno and
    col_offset attributes for every node that supports them.  This is rather
    tedious to fill in for generated nodes, so this helper adds these attributes
    recursively where not already set, by setting them to the values of the
    parent node.  It works recursively starting at *node*.
    cs�d|jkr"t|d�s||_n|j}d|jkrDt|d�s>||_n|j}d|jkrft|d�s`||_n|j}d|jkr�t|d�s�||_n|j}t|�D]}�|||||�q�dS)NrNrPrOrQ)r@rRrNrPrOrQ�iter_child_nodes)rrNrOrPrQ�child��_fixrrr[�s$







z#fix_missing_locations.<locals>._fix�rrrrrZr�fix_missing_locations�sr]r\cCsVt|�D]H}d|jkr(t|dd�||_d|jkrt|dd�}dk	r|||_q|S)z�
    Increment the line number and end line number of each node in the tree
    starting at *node* by *n*. This is useful to "move code" to a different
    location in a file.
    rNrrPN)�walkr@r=rNrP)r�nrYrPrrr�increment_lineno�s
��r`c	cs:|jD].}z|t||�fVWqtk
r2YqXqdS)zs
    Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields``
    that is present on *node*.
    N)r<r=r>)rrGrrr�iter_fields�s

raccsLt|�D]>\}}t|t�r"|Vqt|t�r|D]}t|t�r0|Vq0qdS)z�
    Yield all direct child nodes of *node*, that is, all fields that are nodes
    and all items of fields that are lists of nodes.
    N)rar
r;r()r�namerG�itemrrrrX�s


rXcCs�t|ttttf�s"td|jj��|jr8t|jdt	�s<dS|jdj
}t|t�rZ|j}n"t|t
�rxt|j
t�rx|j
}ndS|r�ddl}|�|�}|S)aC
    Return the docstring for the given node or None if no docstring can
    be found.  If the node provided does not have docstrings a TypeError
    will be raised.

    If *clean* is `True`, all tabs are expanded to spaces and any whitespace
    that can be uniformly removed from the second line onwards is removed.
    z%r can't have docstringsrN)r
ZAsyncFunctionDefZFunctionDefZClassDefZModulerLrArBr5ZExprr�Str�srr4�inspectZcleandoc)rZclean�textrfrrr�
get_docstring�s	

rhcCs�d}g}d}|t|�krx||}||7}|d7}|dkr`|t|�kr`||dkr`|d7}|d7}|dkr|�|�d}q|r�|�|�|S)z}Split a string into lines ignoring form feed and other chars.

    This mimics how the Python parser splits source code.
    r�r\�
�
z
)r+r?)r�idx�linesZ	next_line�crrr�_splitlines_no_ffs  

rocCs,d}|D]}|dkr||7}q|d7}q|S)z6Replace all chars except '\f\t' in a line with spaces.riz	� r)r�resultrnrrr�_pad_whitespaces

rr)�paddedcCs�z$|jd}|jd}|j}|j}Wntk
r:YdSXt|�}||krd||��||���S|r�t||��d|����}nd}|||��|d���}	||��d|���}
||d|�}|�	d|	�|�
|
�d�|�S)aBGet source code segment of the *source* that generated *node*.

    If some location information (`lineno`, `end_lineno`, `col_offset`,
    or `end_col_offset`) is missing, return None.

    If *padded* is `True`, the first line of a multi-line statement will
    be padded with spaces to match its original position.
    r\Nrir)rNrPrOrQr>ro�encode�decoderr�insertr?rC)rrrsrNrPrOrQrmZpadding�firstZlastrrr�get_source_segment*s&	



rxccs<ddlm}||g�}|r8|��}|�t|��|VqdS)z�
    Recursively yield all descendant nodes in the tree starting at *node*
    (including *node* itself), in no specified order.  This is useful if you
    only want to modify nodes in place and don't care about the context.
    r)�dequeN)�collectionsry�popleft�extendrX)rryZtodorrrr^Ms
r^c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�NodeVisitora<
    A node visitor base class that walks the abstract syntax tree and calls a
    visitor function for every node found.  This function may return a value
    which is forwarded by the `visit` method.

    This class is meant to be subclassed, with the subclass adding visitor
    methods.

    Per default the visitor functions for the nodes are ``'visit_'`` +
    class name of the node.  So a `TryFinally` node visit function would
    be `visit_TryFinally`.  This behavior can be changed by overriding
    the `visit` method.  If no visitor function exists for a node
    (return value `None`) the `generic_visit` visitor is used instead.

    Don't use the `NodeVisitor` if you want to apply changes to nodes during
    traversing.  For this a special visitor exists (`NodeTransformer`) that
    allows modifications.
    cCs"d|jj}t|||j�}||�S)z
Visit a node.�visit_)rArBr=�
generic_visit)�selfr�method�visitorrrr�visitoszNodeVisitor.visitcCsTt|�D]F\}}t|t�r:|D]}t|t�r|�|�qqt|t�r|�|�qdS)z9Called if no explicit visitor function exists for a node.N)rar
r(r;r�)r�rrGrrcrrrrus


zNodeVisitor.generic_visitc	Cs�|j}t�t|��}|dkr@t��D]\}}t||�r$|}q@q$|dk	r�d|}zt||�}Wntk
rrYn&Xddl}|�	|�d�t
d�||�S|�|�S)Nr~rz" is deprecated; add visit_Constant�)r�_const_node_type_names�getr�itemsr
r=r>�warnings�warn�PendingDeprecationWarningr)	r�rrZ	type_name�clsrbr�r�r�rrr�visit_Constants(
�zNodeVisitor.visit_ConstantN)rB�
__module__�__qualname__�__doc__r�rr�rrrrr}[s
r}c@seZdZdZdd�ZdS)�NodeTransformeraG
    A :class:`NodeVisitor` subclass that walks the abstract syntax tree and
    allows modification of nodes.

    The `NodeTransformer` will walk the AST and use the return value of the
    visitor methods to replace or remove the old node.  If the return value of
    the visitor method is ``None``, the node will be removed from its location,
    otherwise it is replaced with the return value.  The return value may be the
    original node in which case no replacement takes place.

    Here is an example transformer that rewrites all occurrences of name lookups
    (``foo``) to ``data['foo']``::

       class RewriteName(NodeTransformer):

           def visit_Name(self, node):
               return Subscript(
                   value=Name(id='data', ctx=Load()),
                   slice=Index(value=Str(s=node.id)),
                   ctx=node.ctx
               )

    Keep in mind that if the node you're operating on has child nodes you must
    either transform the child nodes yourself or call the :meth:`generic_visit`
    method for the node first.

    For nodes that were part of a collection of statements (that applies to all
    statement nodes), the visitor may also return a list of nodes rather than
    just a single node.

    Usually you use the transformer like this::

       node = YourTransformer().visit(node)
    cCs�t|�D]�\}}t|t�rvg}|D]D}t|t�r\|�|�}|dkrFq"nt|t�s\|�|�q"|�|�q"||dd�<qt|t�r|�|�}|dkr�t||�qt|||�q|Sr)	rar
r(r;r�r|r?�delattrrT)r�rrG�	old_valueZ
new_valuesrrUrrrr�s&






zNodeTransformer.generic_visitN)rBr�r�r�rrrrrr��s#r�cCs|jSr�r)r�rrr�_getter�sr�cCs
||_dSrr�)r�rrrr�_setter�sr�c@seZdZdd�ZdS)�_ABCcCsft|t�sdS|tkrZz
|j}Wntk
r6YdSXt|t|�oXt|t�|d��St�||�S)NFr)	r
r�_const_typesrr>�_const_types_notr�r�__instancecheck__)r��instrrrrr��s

�z_ABC.__instancecheck__N)rBr�r�r�rrrrr��sr�cOsf|D]<}||jkrq|j�|�}|t|�krt|j�d|����q|tkrTt||�Stj|f|�|�S)Nz" got multiple values for argument )r<�indexr+rLrBr�r�__new__)r�rE�kwargs�key�posrrr�_new�s

r�c@seZdZdZeZdS)�Num)r_N�rBr�r�r<r�r�rrrrr��sr�)�	metaclassc@seZdZdZeZdS)rd�reNr�rrrrrd�srdc@seZdZdZeZdS)�Bytesr�Nr�rrrrr�sr�c@seZdZeZdS)�NameConstantN)rBr�r�r�r�rrrrr�sr�c@seZdZdZdd�ZdS)�EllipsisrcOs(|tkrtd|�|�Stj|f|�|�S)N.).)r�rr�)r�rEr�rrrr�szEllipsis.__new__N)rBr�r�r<r�rrrrr�sr�.)rr)TF)r\)T))r��_astrr6rMrWr]r`rarXrhrorrrxr^�objectr}r�r�r��propertyrr_rerr�r�r�rdr�r�r�r r!r"r4�bytes�boolr�r�r�rrrr�<module>sz�3
'#

#:>	
���__pycache__/zipfile.cpython-38.opt-2.pyc000064400000141176151153537560014033 0ustar00U

e5d�V�@s
ddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZzddlZejZWnek
r�dZejZYnXzddlZWnek
r�dZYnXzddlZWnek
r�dZYnXdddddddd	d
ddd
dg
ZGdd�de�ZGdd
�d
e�ZeZZdZdZdZdZdZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'e
�(e&�Z)dZ*dZ+dZ,dZ-dZ.d Z/d!Z0d"Z1dZ2d#Z3d$Z4d%Z5e
�(e4�Z6dZ7dZ8dZ9dZ:dZ;d Z<d!Z=d"Z>dZ?d#Z@d&ZAd'ZBdZCd(ZDdZEd)ZFd*ZGd+ZHd,ZId-ZJd.ZKe
�(eJ�ZLdZMdZNdZOdZPdZQd ZRd!ZSd"ZTdZUd#ZVd&ZWd'ZXd/ZYd0ZZe
�(eY�Z[d1Z\d2Z]e
�(e\�Z^dZ_dZ`dZadZbdZcd Zdd!Zed"ZfdZgd#Zhd3Zie
�jd4�Zkd5d6�Zld7d8�Zmd9d	�Znd:d;�Zod<d=�ZpGd>d
�d
eq�Zrdasd?d@�ZtdAdB�ZuGdCdD�dD�ZvGdEdF�dF�ZwdGdHdIdIdIdIdJdKdLdMdJdNdOdPdQdRdSdT�ZxdUdV�ZydsdWdX�ZzdYdZ�Z{Gd[d\�d\�Z|Gd]d^�d^�Z}Gd_d`�d`ej~�ZGdadb�dbej~�Z�Gdcd�d�Z�Gddd�de��Z�dedf�Z�dgdh�Z�e�j�Z�didj�Z�Gdkdl�dle��Z�Gdmdn�dne��Z�Gdod�d�Z�dtdpdq�Z�e�drk�re��dS)u�N�
BadZipFile�
BadZipfile�error�
ZIP_STORED�ZIP_DEFLATED�	ZIP_BZIP2�ZIP_LZMA�
is_zipfile�ZipInfo�ZipFile�	PyZipFile�LargeZipFile�Pathc@seZdZdS)rN��__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/zipfile.pyr+sc@seZdZdS)r
Nrrrrrr
/si���������-�.�?s<4s4H2LHsPK��������	z<4s4B4HL2L5H2LsPK�
��
����z<4s2B4HL2L2HsPKz<4sLQLsPKz
<4sQ2H2L4QsPKiPK�<HHc
Cs�tj}d}g}d}}|dt|�krz||||d��\}}|d|}	||krt||krl|�|||��|	}d}|	}q|s�|Sd�|�S)NFrr T�)�_EXTRA_FIELD_STRUCT�unpack�len�append�join)
�extraZxidsr/Zmodified�buffer�start�iZxidZxlen�jrrr�_strip_extra�s r8cCs,zt|�rWdSWntk
r&YnXdS)NTF)�_EndRecData�OSError��fprrr�_check_zipfile�s
r=c	CsVd}z8t|d�rt|d�}nt|d��}t|�}W5QRXWntk
rPYnX|S)NF�readr;�rb)�hasattrr=�openr:)�filename�resultr<rrrr	�s
c
Csz|�|td�Wntk
r,|YSX|�t�}t|�tkrH|St�t|�\}}}}|tkrh|S|dksx|dkr�t	d��|�|tt
d�|�t
�}t|�t
kr�|St�t|�\
}}}	}
}}}
}}}|tkr�|S||t
<||t<||t<|
|t<||t<||t<||t<|S)Nrrrz3zipfiles that span multiple disks are not supported)�seek�sizeEndCentDir64Locatorr:r>r0�structr/�structEndArchive64Locator�stringEndArchive64Locatorr�sizeEndCentDir64�structEndArchive64�stringEndArchive64�_ECD_SIGNATURE�_ECD_DISK_NUMBER�_ECD_DISK_START�_ECD_ENTRIES_THIS_DISK�_ECD_ENTRIES_TOTAL�	_ECD_SIZE�_ECD_OFFSET)�fpin�offset�endrec�dataZsigZdisknoZreloffZdisksZsz�create_versionZread_versionZdisk_numZdisk_dirZdircountZ	dircount2ZdirsizeZ	diroffsetrrr�
_EndRecData64�s@



�rXc	Csh|�dd�|��}z|�td�Wntk
r<YdSX|��}t|�tkr�|dd�tkr�|dd�dkr�t�t	|�}t
|�}|�d�|�|t�t|t|�St
|dtd�}|�|d�|��}|�t�}|dk�rd|||t�}t|�tk�rdSt
t�t	|��}|t}||t|t|�}|�|�|�||�t|||||�SdS)Nrrr ���sr-i)rD�tell�sizeEndCentDirr:r>r0�stringEndArchiverFr/�structEndArchive�listr1rX�max�rfind�_ECD_COMMENT_SIZE)	rSZfilesizerVrUZmaxCommentStartr5ZrecDataZcommentSize�commentrrrr9sD��



�r9c@sXeZdZdZddd�Zdd�Zdd	d
�Zdd�Zd
d�Ze	ddd�dd��Z
dd�ZdS)r
)�
orig_filenamerB�	date_time�
compress_type�_compresslevelrbr3�
create_systemrW�extract_version�reserved�	flag_bits�volume�
internal_attr�
external_attr�
header_offset�CRC�
compress_size�	file_size�	_raw_time�NoName��rrrrrcCs�||_|�td��}|dkr(|d|�}tjdkrJtj|krJ|�tjd�}||_||_|ddkrjtd��t	|_
d|_d|_d|_
tjdkr�d|_nd|_t|_t|_d|_d|_d|_d|_d|_dS)Nr�/ruz+ZIP does not support timestamps before 1980r-Zwin32r)rc�find�chr�os�sep�replacerBrd�
ValueErrorrrerfrbr3�sys�platformrg�DEFAULT_VERSIONrWrhrirjrkrlrm)�selfrBrdZ	null_byterrr�__init__Xs0
zZipInfo.__init__cCs�d|jj|jfg}|jtkr8|�dt�|j|j��|jd?}|jd@}|rd|�dt	�
|��|rv|�d|�|��}|r�|jr�|�d|j�|r�|j
r�|jtks�|j|j
kr�|�d|j
�|�d	�d
�|�S)Nz<%s filename=%r� compress_type=%sr)rz filemode=%rz external_attr=%#xz
 file_size=%rz compress_size=%r�>�)�	__class__rrBrerr1�compressor_names�getrm�stat�filemode�is_dirrqrpr2)r�rC�hi�lo�isdirrrr�__repr__�s0
��



�
�
zZipInfo.__repr__NcCs||j}|ddd>|dd>B|dB}|dd>|d	d>B|ddB}|jd
@rfd}}}n|j}|j}|j}|j}d}	|dkr�|tkp�|tk}|r�d}
|t�|
dt�	|
�d	||�}|tks�|tkr�|s�t
d��d
}d
}t}	|jt
k�rtt|	�}	n|jtk�rtt|	�}	t|	|j�|_t|	|j�|_|��\}}t�tt|j|j||j|||||t|�t|��
}
|
||S)Nrrur$rr!rrr&r rz<HHQQz'Filesize would require ZIP64 extensions���)rdrjrorprqr3�ZIP64_LIMITrF�pack�calcsizer
�
ZIP64_VERSIONrerr_�
BZIP2_VERSIONr�LZMA_VERSIONrhrW�_encodeFilenameFlags�structFileHeader�stringFileHeaderrir0)r��zip64�dt�dosdate�dostimerorprqr3�min_version�fmtrBrj�headerrrr�
FileHeader�s^$$
�
�zZipInfo.FileHeadercCsDz|j�d�|jfWStk
r>|j�d�|jdBfYSXdS)N�ascii�utf-8�)rB�encoderj�UnicodeEncodeError�r�rrrr��szZipInfo._encodeFilenameFlagscCs�|j}tj}t|�dk�r�|d|dd��\}}|dt|�krPtd||f��|dk�rp|dkrv|d|dd��}nV|dkr�|d	|dd
��}n:|dkr�|d|dd
��}n|dkr�d}ntd||f��d}|jdk�rt|�|kr�td��|||_|d7}|jdk�r6t|�|k�r$td��|||_|d7}|jdk�rpt|�|k�rXtd��|j}|||_|d7}||dd�}qdS)Nr r,z"Corrupt extra field %04x (size=%d)r�z<QQQ�r)z<QQrrz<Qrrr)l����r�z/Corrupt zip64 extra field. File size not found.r�z3Corrupt zip64 extra field. Compress size not found.z3Corrupt zip64 extra field. Header offset not found.)r3rFr/r0rrqrprn)r�r3r/�tpZlnZcounts�idx�oldrrr�_decodeExtra�sP
�
�
�
zZipInfo._decodeExtraT��strict_timestampsc	Cst|tj�rt�|�}t�|�}t�|j�}t�|j	�}|dd�}|sZ|ddkrZd}n|sn|ddkrnd}|dkrz|}tj
�tj
�|�d�}|dtj
tjfkr�|dd�}q�|r�|d7}|||�}|jd	@d
>|_|r�d|_|jd
O_n|j|_|S)Nrr"rurt�;)r�r���;r�rrvrr))�
isinstancery�PathLike�fspathr��S_ISDIR�st_mode�time�	localtime�st_mtime�path�normpath�
splitdriverz�altseprmrq�st_size)	�clsrB�arcnamer��str��mtimerd�zinforrr�	from_file�s0



zZipInfo.from_filecCs|jddkS)N���rv�rBr�rrrr�%szZipInfo.is_dir)rsrt)N)N)rrr�	__slots__r�r�r�r�r��classmethodr�r�rrrrr
>s
+
.2%cCs0td�D]"}|d@r"|d?dA}q|dL}q|S)Nrrl q[)�range)�crcr7rrr�_gen_crc/s

r�csld�d�d�tdkr&ttttd���at��fdd������fdd��|D]}�|�qL��fd	d
�}|S)NixV4i�gE#i�xV4�cs|d?�||Ad@AS)Nr�r)Zchr�)�crctablerr�crc32Isz_ZipDecrypter.<locals>.crc32cs<�|�����d@d@��ddd@���d?���dS)Nr�r�i�rr�r)�c)r��key0�key1�key2rr�update_keysMs
z"_ZipDecrypter.<locals>.update_keyscsNt�}|j}|D]4}�dB}|||dAd?d@N}�|�||�qt|�S)Nrrrr�)�	bytearrayr1�bytes)rVrCr1r��k)r�r�rr�	decrypterWs
z _ZipDecrypter.<locals>.decrypter)�	_crctabler^�mapr�r�)�pwd�pr�r)r�r�r�r�r�r�r�
_ZipDecrypter?s
r�c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�LZMACompressorcCs
d|_dS�N)�_compr�rrrr�gszLZMACompressor.__init__cCsFt�dtji�}tjtjt�tj|�gd�|_t�dddt	|��|S)N�id��filtersz<BBHr$r )
�lzmaZ_encode_filter_properties�FILTER_LZMA1r��
FORMAT_RAW�_decode_filter_propertiesr�rFr�r0)r�Zpropsrrr�_initjs
�
zLZMACompressor._initcCs*|jdkr|��|j�|�S|j�|�Sr�)r�r��compress)r�rVrrrr�qs
zLZMACompressor.compresscCs&|jdkr|��|j��S|j��Sr�)r�r��flushr�rrrr�vs
zLZMACompressor.flushN)rrrr�r�r�r�rrrrr�esr�c@seZdZdd�Zdd�ZdS)�LZMADecompressorcCsd|_d|_d|_dS)Nr-F)�_decomp�_unconsumed�eofr�rrrr�~szLZMADecompressor.__init__c	Cs�|jdkr�|j|7_t|j�dkr*dSt�d|jdd��\}t|j�d|krXdStjtjt�tj	|jdd|��gd�|_|jd|d�}|`|j�
|�}|jj|_|S)Nr r-z<Hrr�)r�r�r0rFr/r�r�r�r�r��
decompressr�)r�rVZpsizerCrrrr��s"
��

zLZMADecompressor.decompressN)rrrr�r�rrrrr�|sr�ZstoreZshrink�reduceZimplode�tokenizeZdeflateZ	deflate64Zbzip2r�ZterseZlz77ZwavpackZppmd)rrrrr r!r"r#rr$r%rrr+��a�bcCsX|tkr
nJ|tkr tsTtd��n4|tkr6tsTtd��n|tkrLtsTtd��ntd��dS)Nz.Compression requires the (missing) zlib modulez-Compression requires the (missing) bz2 modulez.Compression requires the (missing) lzma modulez(That compression method is not supported)	rr�zlib�RuntimeErrorr�bz2rr��NotImplementedError)�compressionrrr�_check_compression�s$���r�cCsj|tkr2|dk	r t�|tjd�St�tjtjd�S|tkrT|dk	rLt�|�St��S|tkrbt	�SdSdS)N��)
rr�ZcompressobjZDEFLATEDZZ_DEFAULT_COMPRESSIONrr�Z
BZ2Compressorrr�)re�
compresslevelrrr�_get_compressor�s
r�cCsvt|�|tkrdS|tkr&t�d�S|tkr6t��S|tkrDt	�St
�|�}|rdtd||f��ntd|f��dS)Nr�zcompression type %d (%s)zcompression type %d)
r�rrr�Z
decompressobjrr�ZBZ2Decompressorrr�r�r�r�)reZdescrrrr�_get_decompressor�s

r�c@s0eZdZdd�Zddd�Zd
dd�Zd	d
�ZdS)�_SharedFilecCs2||_||_||_||_||_|j|_|j|_dSr�)�_file�_pos�_close�_lock�_writing�seekablerZ)r��file�pos�close�lockZwritingrrrr��sz_SharedFile.__init__rc
CsN|j�>|��rtd��|j�||�|j��|_|jW5QR�SQRXdS)Nz}Can't reposition in the ZIP file while there is an open writing handle on it. Close the writing handle before trying to read.)rrr|rrDrZr)r�rT�whencerrrrD�sz_SharedFile.seekr�c
CsX|j�H|��rtd��|j�|j�|j�|�}|j��|_|W5QR�SQRXdS)N�yCan't read from the ZIP file while there is an open writing handle on it. Close the writing handle before trying to read.)rrr|rrDrr>rZ�r��nrVrrrr>�sz_SharedFile.readcCs$|jdk	r |j}d|_|�|�dSr�)rr)r��fileobjrrrr	s
z_SharedFile.closeN)r)r�)rrrr�rDr>r	rrrrr�s	


rc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�	_TellablecCs||_d|_dS�Nr)r<rT�r�r<rrrr�sz_Tellable.__init__cCs|j�|�}|j|7_|Sr�)r<�writerT)r�rVrrrrrsz_Tellable.writecCs|jSr�)rTr�rrrrZsz_Tellable.tellcCs|j��dSr�)r<r�r�rrrr�sz_Tellable.flushcCs|j��dSr�)r<r	r�rrrr	sz_Tellable.closeN)rrrr�rrZr�r	rrrrrs
rcs�eZdZdZdZdZd'dd�Zdd	�Zd
d�Zd(d
d�Z	d)dd�Z
dd�Zd*dd�Zdd�Z
dd�Zdd�Zdd�Z�fdd�Zd d!�Zd+d#d$�Zd%d&�Z�ZS),�
ZipExtFilei@iiNFcCs(||_||_||_|j|_|j|_|j|_t	|j�|_
d|_d|_d|_
d|_||_|j|_t|d�rz|j|_td�|_nd|_d|_z4|��r�|��|_|j|_|j|_|j|_d|_Wntk
r�YnXd|_|�r$|j d@r�|j!d?d@}n|jd?d@}|�"�}||k�r$t#d	|j$��dS)
NFr-rroTrr�r�zBad password for file %r)%�_fileobj�_pwd�_close_fileobjre�_compress_typerp�_compress_leftrq�_leftr��
_decompressor�_eof�_readbuffer�_offset�newlines�moderB�namer@ro�
_expected_crcr��_running_crc�	_seekablerrZ�_orig_compress_start�_orig_compress_size�_orig_file_size�_orig_start_crc�AttributeError�
_decrypterrjrr�_init_decrypterr�rc)r�rr �zipinfor�Z
close_fileobjZ
check_byte�hrrrr�)sF




zZipExtFile.__init__cCs4t|j�|_|j�d�}|jd8_|�|�dS)Nrr&)r�rr*rr>r)r�r�rrrr+\szZipExtFile._init_decryptercCsvd|jj|jjfg}|jsX|�d|j|jf�|jtkrb|�dt	�
|j|j��n
|�d�|�d�d�|�S)N�<%s.%sz name=%r mode=%rr��	 [closed]r�r�)r�rr�closedr1r!r rrr�r�r2�r�rCrrrr�gs�
��

zZipExtFile.__repr__r�cCsL|dkr>|j�d|j�d}|dkr>|j|j|�}||_|Stj�||�S)Nr�
r)rrwr�io�BufferedIOBase�readline)r��limitr6�linerrrr5uszZipExtFile.readlinercCsr|t|j�|jkr\|�|�}t|�|jkrJ||j|jd�|_d|_n|jt|�8_|j|j|jd�S)Nri)r0rrr>)r�r�chunkrrr�peek�s
zZipExtFile.peekcCsdS�NTrr�rrr�readable�szZipExtFile.readablecCs|dks|dkrH|j|jd�}d|_d|_|jsD||�|j�7}q,|S||j}|t|j�krz|j|j|�}||_|S|t|j�}|j|jd�}d|_d|_|dkr�|js�|�|�}|t|�kr�||_||_||d|�7}q�||7}|t|�8}q�|S�Nrr-�rrr�_read1�MAX_Nr0)r�r�buf�endrVrrrr>�s4

zZipExtFile.readcCs@|jdkrdSt||j�|_|jr<|j|jkr<td|j��dS)NzBad CRC-32 for file %r)r"r�r#rrr!)r��newdatarrr�_update_crc�s

zZipExtFile._update_crccCs|dks|dkrR|j|jd�}d|_d|_|jsN|�|j�}|r,||7}qNq,|S||j}|t|j�kr�|j|j|�}||_|S|t|j�}|j|jd�}d|_d|_|dk�r|j�s|�|�}|t|�kr�||_||_||d|�7}�q|r�||7}�qq�|Sr<r=)r�rr@rVrArrr�read1�s>


zZipExtFile.read1cCs"|js|dkrdS|jtkrH|jj}|t|�krR||�|t|��7}n
|�|�}|jtkrj|jdk|_nx|jtkr�t	||j
�}|j�||�}|jjp�|jdko�|jj|_|jr�||j�
�7}n |j�|�}|jjp�|jdk|_|d|j�}|jt|�8_|jdk�rd|_|�|�|S)Nrr-T)rrrrZunconsumed_tailr0�_read2rrr_�
MIN_READ_SIZEr�r�r�rrCr
rrrr>�s4




�
zZipExtFile._read1cCsd|jdkrdSt||j�}t||j�}|j�|�}|jt|�8_|sLt�|jdk	r`|�|�}|Sr<)	rr_rF�minrr>r0�EOFErrorr*r
rrrrE	s


zZipExtFile._read2cs&z|jr|j��W5t���XdSr�)�superr	rrr��r�rrr	szZipExtFile.closecCs|jSr�)r$r�rrrr szZipExtFile.seekablercCs>|jst�d��|��}|dkr&|}n.|dkr8||}n|dkrL|j|}ntd��||jkrd|j}|dkrpd}||}||j}|dkr�|t|j�kr�||_d}nf|dk�r
|j	�
|j�|j|_
|j|_|j|_d|_d|_t|j�|_d|_|}|jdk	�r
|��|dk�r6t|j|�}|�|�||8}�q
|��S)N�!underlying stream is not seekablerrrzCwhence must be os.SEEK_SET (0), os.SEEK_CUR (1), or os.SEEK_END (2)r-F)r$r3�UnsupportedOperationrZr'r|rr0rrrDr%r(r#r&rrr�rrrr*r+rG�
MAX_SEEK_READr>)r�rTrZcurr_posZnew_posZread_offsetZbuff_offsetZread_lenrrrrD#sH






zZipExtFile.seekcCs0|jst�d��|j|jt|j�|j}|S)NrK)r$r3rLr'rr0rr)r�ZfileposrrrrZSs
zZipExtFile.tell)NF)r�)r)r�)r)rrrr?rFrMr�r+r�r5r9r;r>rCrDr>rEr	rrDrZ�
__classcell__rrrJrrs(�
3



!
%$
0rcs@eZdZdd�Zedd��Zdd�Zdd�Z�fd	d
�Z�Z	S)�
_ZipWriteFilecCs8||_||_||_t|j|j�|_d|_d|_d|_	dSr)
�_zinfo�_zip64�_zipfiler�rerf�_compressor�
_file_size�_compress_size�_crc)r��zfr�r�rrrr�[s�z_ZipWriteFile.__init__cCs|jjSr�)rRr<r�rrrresz_ZipWriteFile._fileobjcCsdSr:rr�rrr�writableisz_ZipWriteFile.writablecCsf|jrtd��t|�}|j|7_t||j�|_|jrV|j�|�}|jt|�7_|j	�
|�|S)NzI/O operation on closed file.)r0r|r0rTr�rVrSr�rUrr)r�rV�nbytesrrrrlsz_ZipWriteFile.writec	sb|jr
dS�zFt���|jrR|j��}|jt|�7_|j	�
|�|j|j_n
|j
|j_|j|j_|j
|j_|jjd@r�|jr�dnd}|j	�
t�|t|jj|jj|jj��|j	��|j_nn|js�|j
tkr�td��|jtkr�td��|j	��|j_|j	�|jj�|j	�
|j�|j��|j	�|jj�|jj�|j�|j|jj|jj <W5d|j_XdS)NFrz<LLQQz<LLLLz+File size unexpectedly exceeded ZIP64 limitz1Compressed size unexpectedly exceeded ZIP64 limit)!r0rRrrIr	rSr�rUr0rrrPrprTrVrorqrjrQrFr��
_DD_SIGNATURErZ�	start_dirr�r�rDrnr��filelistr1�
NameToInforB)r�r@r�rJrrr	xsF




�
�
�z_ZipWriteFile.close)
rrrr��propertyrrXrr	rNrrrJrrOZs

rOc@s eZdZdZdZdeddfdd�dd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zd<dd�Z
dd�Zdd�Zdd�Zedd��Zejdd��Zd=dd�Zd>d d!�d"d#�Zd?d$d%�Zd@d&d'�ZdAd(d)�Zed*d+��Zd,d-�Zd.d/�ZdBd0d1�ZdCd2d3�Zd4d5�Zd6d7�Z d8d9�Z!d:d;�Z"dS)DrN�rTr�c
	CsP|dkrtd��t|�||_d|_d|_i|_g|_||_||_||_	d|_
d|_||_t
|tj�rpt�|�}t
|t�r�d|_||_dddd	dd
dd�}||}zt�||�|_Wq�tk
r�||kr�||}Yq��Yq�Xq�q�nd
|_||_t|dd�|_d
|_t��|_d|_d|_�z|dk�r4|��n�|dk�r�d|_z|j� �|_!Wn2t"tfk
�r�t#|j�|_d|_!d|_Yn6Xz|j�$|j!�Wn t"tfk
�r�d|_YnXnf|dk�rz|��|j�$|j!�Wn6t%k
�r|j�$dd�d|_|j� �|_!YnXntd��Wn$|j}	d|_|�&|	��YnXdS)N)r_�w�x�az+ZipFile requires mode 'r', 'w', 'x', or 'a'Frr-r?�w+b�x+b�r+b�wbZxb)r_r`rarbrercrdrr!Tr_)r`rarbrz"Mode must be 'r', 'w', 'x', or 'a')'r|r��_allowZip64�
_didModify�debugr]r\r�r�r r��_comment�_strict_timestampsr�ryr�r��str�_filePassedrBr3rAr<r:�getattr�_fileRefCnt�	threading�RLockrr$r�_RealGetContentsrZr[r)rrDr�_fpclose)
r�rr r��
allowZip64r�r�ZmodeDictr�r<rrrr��s�

�





zZipFile.__init__cCs|Sr�rr�rrr�	__enter__szZipFile.__enter__cCs|��dSr��r	)r��type�value�	tracebackrrr�__exit__szZipFile.__exit__cCs�d|jj|jjfg}|jdk	rd|jr8|�d|j�n|jdk	rR|�d|j�|�d|j�n
|�d�|�d�d�|�S)Nr.z file=%rz filename=%rz mode=%rr/r�r�)	r�rrr<rmr1rBr r2r1rrrr�"s�



zZipFile.__repr__cCs�|j}zt|�}Wntk
r.td��YnX|s<td��|jdkrNt|�|t}|t}|t|_	|t
||}|ttkr�|t
t8}|jdkr�||}td|||�|||_|�|jd�|�|�}t�|�}d}||k�r�|�t�}	t|	�tk�r
td��t�t|	�}	|	ttk�r,td��|jdk�r@t|	�|�|	t�}
|	d}|d	@�rl|
�d
�}
n
|
�d�}
t|
�}|�|	t�|_|�|	t �|_!|	t"|_#|	dd�\|_$|_%|_&|_'|_(|_)}
}|_*|_+|_,|j&t-k�r�t.d
|j&d��|	dd�\|_/|_0|_1|
|_2|d?d|d?d@|d@|
d?|
d?d@|
d@df|_3|�4�|j#||_#|j5�6|�||j7|j8<|t|	t|	t|	t }|jdkr�td|�q�dS)NzFile is not a zip filerrzgiven, inferred, offsetrzTruncated central directoryz&Bad magic number for central directoryr!r�r��cp437rzzip file version %.1fr%r(r+r$rur�r&r�total)9r<r9r:rri�printrQrR�_ECD_COMMENTrj�
_ECD_LOCATIONrLrKrIrEr[rDr>r3�BytesIO�sizeCentralDirr0rFr/�structCentralDir�
_CD_SIGNATURE�stringCentralDir�_CD_FILENAME_LENGTH�decoder
�_CD_EXTRA_FIELD_LENGTHr3�_CD_COMMENT_LENGTHrb�_CD_LOCAL_HEADER_OFFSETrnrWrgrhrirjrerorprq�MAX_EXTRACT_VERSIONr�rkrlrmrrrdr�r\r1r]rB)r�r<rUZsize_cdZ	offset_cd�concatZinferredrVr|�centdirrB�flagsra�t�drrrrr0s�











��

���
zZipFile._RealGetContentscCsdd�|jD�S)NcSsg|]
}|j�qSrr�)�.0rVrrr�
<listcomp>�sz$ZipFile.namelist.<locals>.<listcomp>�r\r�rrr�namelist~szZipFile.namelistcCs|jSr�r�r�rrr�infolist�szZipFile.infolistcCsLtdd|d�|jD]0}d|jdd�}td|j||jf|d�qdS)Nz%-46s %19s %12s)z	File NamezModified    ZSize�rz%d-%02d-%02d %02d:%02d:%02dr"z
%-46s %s %12d)r}r\rdrBrq)r�rr��daterrr�printdir�s�
�zZipFile.printdirc
Cs^d}|jD]N}z*|�|jd��}|�|�r,q W5QRXWq
tk
rV|jYSXq
dS)Nir_)r\rArBr>r)r�Z
chunk_sizer��frrr�testzip�s

zZipFile.testzipcCs$|j�|�}|dkr td|��|S)Nz(There is no item named %r in the archive)r]r��KeyError)r�r!�inforrr�getinfo�s�zZipFile.getinfocCs6|r t|t�s tdt|�j��|r,||_nd|_dS)N�pwd: expected bytes, got %s)r�r��	TypeErrorrwrr�)r�r�rrr�setpassword�s
zZipFile.setpasswordcCs|jSr�)rjr�rrrrb�szZipFile.commentcCs^t|t�stdt|�j��t|�tkrNddl}|jdtdd�|dt�}||_	d|_
dS)Nzcomment: expected bytes, got %srz3Archive comment is too long; truncating to %d bytesr��
stacklevelT)r�r�r�rwrr0�ZIP_MAX_COMMENT�warnings�warnrjrh)r�rbr�rrrrb�s
��c
Cs.|�|d|��}|��W5QR�SQRXdS�Nr_�rAr>)r�r!r�r<rrrr>�szZipFile.readF��force_zip64cs|dkrtd��|r0t|t�s0tdt|�j��|rD|dkrDtd���jsRtd��t|t�rb|}n,|dkr�t|�}�j|_	�j
|_n
��|�}|dkr��j
||d�S�jr�td���jd	7_t�j|j�j�j�fd
d��}�z|�t�}t|�tk�rtd��t�t|�}|ttk�r&td
��|�|t�}|t�rL|�|t�|jd@�r`t d��|jd@�rtt d��|t!d@�r�|�"d�}	n
|�"d�}	|	|j#k�r�td|j#|f��|jd	@}
|
�r�|�s҈j$}|�s�t%d|��nd}t&||||d�WS|�'��YnXdS)N>r`r_zopen() requires mode "r" or "w"r�r`z'pwd is only supported for reading filesz2Attempt to use ZIP archive that was already closedr�rrcs�jSr�)rrr�rr�<lambda>�r-zZipFile.open.<locals>.<lambda>zTruncated file headerz Bad magic number for file header� z$compressed patched data (flag bit 5)�@zstrong encryption (flag bit 6)r�r�r{z/File name in directory %r and header %r differ.z6File %r is encrypted, password required for extractionT)(r|r�r�r�rwrr<r
r�rer�rfr��_open_to_writerrorrnrsrr>�sizeFileHeaderr0rrFr/r��
_FH_SIGNATUREr��_FH_FILENAME_LENGTH�_FH_EXTRA_FIELD_LENGTHrjr��_FH_GENERAL_PURPOSE_FLAG_BITSr�rcr�r�rr	)r�r!r r�r�r�Zzef_fileZfheader�fnameZ	fname_strZis_encryptedrr�rrA�s~�




�


��
�zZipFile.opencCs�|r|jstd��|jr td��t|d�s0d|_d|_d|_d|_|jt	krZ|jdO_|j
sn|jdO_|jszd|_|jo�|p�|jdtk}|j
r�|j
�|j�|j
��|_|�|�d	|_|j
�|�|��d	|_t|||�S)
NzHforce_zip64 is True, but allowZip64 was False when opening the ZIP file.zzCan't write to the ZIP file while there is another write handle open on it. Close the first handle before opening another.rqrrr��g�������?T)rgr|rr@rqrprorjrerr$rmr�r<rDr[rZrn�_writecheckrhrr�rO)r�r�r�r�rrrr�(s8
�

�
zZipFile._open_to_writecCs*|dkrt��}n
t�|�}|�|||�Sr�)ry�getcwdr��_extract_member)r��memberr�r�rrr�extractSs

zZipFile.extractcCsH|dkr|��}|dkr"t��}n
t�|�}|D]}|�|||�q0dSr�)r�ryr�r�r�)r�r��membersr�r,rrr�
extractall`s

zZipFile.extractallcCs^|j}|s(d}t�|dt|��}||_|�|�}dd�|�|�D�}|�dd�|D��}|S)Nz:<>|"?*�_css|]}|�d�VqdS)�.N)�rstrip�r�rarrr�	<genexpr>{sz1ZipFile._sanitize_windows_name.<locals>.<genexpr>css|]}|r|VqdSr�rr�rrrr�}s)�!_windows_illegal_name_trans_tablerl�	maketransr0�	translate�splitr2)r�r��pathsep�tableZillegalrrr�_sanitize_windows_nameqs
zZipFile._sanitize_windows_namec
sLt|t�s|�|�}|j�dtjj�}tjjrB|�tjjtjj�}tj�	|�d}dtjj
tjjf�tjj��fdd�|�
tjj�D��}tjjdkr�|�|tjj�}tj�||�}tj�|�}tj�|�}|r�tj�|�s�t�|�|���rtj�|��st�|�|S|j||d��(}t|d��}t�||�W5QRXW5QRX|S)	Nrvrr�c3s|]}|�kr|VqdSr�rr��Zinvalid_path_partsrrr��s�z*ZipFile._extract_member.<locals>.<genexpr>�\)r�rf)r�r
r�rBr{ryr�rzr�r��curdir�pardirr2r�r�r��dirname�exists�makedirsr�r��mkdirrA�shutil�copyfileobj)r�r�Z
targetpathr�r�Z	upperdirs�source�targetrr�rr��s2

&


� zZipFile._extract_membercCs�|j|jkr(ddl}|jd|jdd�|jdkr:td��|jsHtd��t|j�|j	s�d}t
|j�tkrpd}n|j
tkr�d	}n|jtkr�d
}|r�t|d��dS)NrzDuplicate name: %rrr��r`rarbz&write() requires mode 'w', 'x', or 'a'z4Attempt to write ZIP archive that was already closed�Files countZFilesizezZipfile size� would require ZIP64 extensions)rBr]r�r�r r|r<r�rergr0r\�ZIP_FILECOUNT_LIMITrqr�rnr
)r�r�r��requires_zip64rrrr��s,
�


�zZipFile._writecheckc
CsP|jstd��|jrtd��tj|||jd�}|��rDd|_d|_n0|dk	rT||_	n|j
|_	|dk	rl||_n|j|_|���r|j
��|jr�|j�|j�|j��|_|j	tkr�|jdO_|�|�d|_|j�|�||j|j<|j�|�d��|j��|_W5QRXn<t|d��,}|�|d	��}t�||d
�W5QRXW5QRXdS)N�7Attempt to write to ZIP archive that was already closedz>Can't write to ZIP archive while an open writing handle existsr�rrTFr?r`i ) r<r|rr
r�rkr�rprorer�rfr�rr$rDr[rZrnrrjr�rhr\r1r]rBrr�rAr�r�)r�rBr�rer�r��src�destrrrr�sF���


z
ZipFile.writec
Cs�t|t�r|�d�}t|t�sxt|t�t���dd�d�}|j|_|j|_	|j
ddkrpd|_|jdO_q|d|_n|}|js�t
d	��|jr�t
d
��|dk	r�||_|dk	r�||_	t|�|_|j�*|j|dd��}|�|�W5QRXW5QRXdS)
Nr�r")rBrdr�rvi�Ar)r�r�z?Can't write to ZIP archive while an open writing handle exists.r`)r )r�rlr�r
r�r�r�rer�rfrBrmr<r|rr0rqrrAr)r�Zzinfo_or_arcnamerVrer�r�r�rrr�writestr�s:


���
zZipFile.writestrcCs|��dSr�rvr�rrr�__del__szZipFile.__del__c	Cs||jdkrdS|jrtd��zB|jdkr\|jr\|j�"|jrJ|j�|j	�|�
�W5QRXW5|j}d|_|�|�XdS)NzvCan't close the ZIP file while there is an open writing handle on it. Close the writing handle before closing the zip.r�)r<rr|rsr rhrr$rDr[�_write_end_recordrrrrr	s
z
ZipFile.closecCs�|jD�]D}|j}|ddd>|dd>B|dB}|dd>|d	d>B|ddB}g}|jtksr|jtkr�|�|j�|�|j�d
}d
}n|j}|j}|jtkr�|�|j�d
}n|j}|j}	d}
|�rt|	d�}	t	j
dd
t|�ddt|�f|��|	}	t}
|j
tk�r$tt|
�}
n|j
tk�r:tt|
�}
t|
|j�}t|
|j�}zZ|��\}
}t	�
tt||j||j||j
|||j||t|
�t|	�t|j�d|j|j|�}Wnltk
�rttt||j||j|j |j
|||j||t|j!�t|	�t|j�d|j|j|ft"j#d��YnX|j$�%|�|j$�%|
�|j$�%|	�|j$�%|j�q|j$�&�}t|j�}||j'}|j'}d}|t(k�r�d}n|tk�r�d}n|tk�r�d}|�r$|j)�s�t*|d��t	�
t+t,ddddd||||�}|j$�%|�t	�
t-t.d|d�}|j$�%|�t/|d�}t/|d
�}t/|d
�}t	�
t0t1dd||||t|j2��	}|j$�%|�|j$�%|j2�|j3dk�rt|j$�4�|j$�5�dS)Nrrur$rr!rrr&r r�)rr,�Qrr�r�zCentral directory offsetzCentral directory sizer��,rrrb)6r\rdrqr�rpr1rnr3r8rFr�r0r�rerr_r�rr�rhrWr�r�r�rgrirorbrlrm�DeprecationWarningr}rjrBr}�stderrr<rrZr[r�rgr
rJrKrGrHrGr]r\rjr �truncater�)r�r�r�r�r�r3rqrprnZ
extra_datar�rhrWrBrjr�Zpos2ZcentDirCountZcentDirSizeZ
centDirOffsetr�Zzip64endrecZzip64locrecrUrrrr�5s$$
�


���
���





���


�
zZipFile._write_end_recordcCs&|jd8_|js"|js"|��dS�Nr)rormr	rrrrrs�szZipFile._fpclose)N)N)r_N)F)NN)NNN)NNN)NN)#rrrr<r�rr�rurzr�rrr�r�r�r�r�r�r^rb�setterr>rAr�r�r�r�r�r�r�rr�r�r	r�rsrrrrr�sR��ZN
	
		


b
+


*�
2�
)hc@s0eZdZdeddfdd�Zddd	�Zd
d�ZdS)
rr_Tr�cCstj|||||d�||_dS)N)r r�rt)rr��	_optimize)r�rr r�rt�optimizerrrr��s�zPyZipFile.__init__r�NcCs�t�|�}|rD||�sD|jr@tj�|�r,dnd}td||f�dStj�|�\}}tj�|��rhtj�|d�}tj�|��r�|r�d||f}n|}|jr�td|d|�|�	|dd	�|�\}}	|jr�td
|	�|�
||	�tt�|��}
|
�
d�|
D]�}tj�||�}tj�|�\}
}tj�|��rRtj�tj�|d���r�|j|||d�q�|dkr�|�r~||��s~|jr�td
|�q�|�	|dd	�|�\}}	|j�r�td
|	�|�
||	�q�n�|j�r�td|�tt�|��D]�}tj�||�}tj�|�\}
}|dk�r�|�r,||��s,|j�r�td
|��q�|�	|dd	�|�\}}	|j�rVtd
|	�|�
||	��q�nP|d	d�dk�r�td��|�	|dd	�|�\}}	|j�r�td|	�|�
||	�dS)Nr�rz%s %r skipped by filterfuncz__init__.py�%s/%szAdding package in�asr���ZAdding)�
filterfunc�.pyzfile %r skipped by filterfunczAdding files from directoryz.Files added with writepy() must end with ".py"zAdding file)ryr�rir�r�r}r�r2�isfile�
_get_codenamer�sorted�listdir�remove�splitext�writepyr�)r��pathname�basenamer�Zlabel�dirr!Zinitnamer�r�ZdirlistrBr��rootZextrrrr��s�


��


�
�
zPyZipFile.writepyc
sd�fdd�	}|d}|d}tjj|dd�}tjj|dd�}tjj|d	d�}�jdk�r\tj�|�r�t�|�jt�|�jkr�|}	}
n�tj�|�r�t�|�jt�|�jkr�|}
|}	n�tj�|�r�t�|�jt�|�jkr�|}
|}	nvtj�|��rt�|�jt�|�jk�r|}
|}	nD||��rRt	j
jd
k�r4|}
nt	j
jdk�rH|}
n|}
|}	n|}
}	n��jd
k�rr|}
|}	n<|}	�jdk�r�|}
n&�jd	k�r�|}
nd��j�}t
|��tj�|
��r�t�|
�jt�|�jk�s�||�jd��s�|}
}	tj�|	�d}|�rd
||f}|
|fS)Nr�c
sfddl}�jrtd|�z|j|d|d�Wn4|jk
r`}zt|j�WY�dSd}~XYnXdS)NrZ	CompilingT)�doraiser�F)�
py_compilerir}�compile�PyCompileError�msg)rr�r��errr�rr�_compiles

z)PyZipFile._get_codename.<locals>._compiler�z.pycr�)�optimizationrrrz"invalid value for 'optimize': {!r})r�r�)r�)�	importlib�util�cache_from_sourcer�ryr�r�r�r�r}r�r��formatr|r�)
r�r�r�r�Zfile_pyZfile_pycZpycache_opt0Zpycache_opt1Zpycache_opt2r�r�r�Zarchivenamerr�rr��sj�
���

�zPyZipFile._get_codename)r�N)rrrrr�r�r�rrrrr�s�

RcCst�t|�dd�Sr�)�	itertools�islice�	_ancestry)r�rrr�_parentsRsrccs4|�tj�}|r0|tjkr0|Vt�|�\}}qdSr�)r��	posixpathrzr�)r��tailrrrresrcCst�t|�j|�Sr�)r�filterfalse�set�__contains__)ZminuendZ
subtrahendrrr�_differencesrcsDeZdZedd��Z�fdd�Zdd�Zdd�Zed	d
��Z	�Z
S)�CompleteDirscCs.tj�tt|��}dd�|D�}tt||��S)Ncss|]}|tjVqdSr�)rrz)r�r�rrrr��sz-CompleteDirs._implied_dirs.<locals>.<genexpr>)r�chain�
from_iterabler�r�_deduper)�names�parentsZas_dirsrrr�
_implied_dirs�szCompleteDirs._implied_dirscs tt|���}|t|�|��Sr�)rIr
r�r^r)r�rrJrrr��szCompleteDirs.namelistcCst|���Sr�)r
r�r�rrr�	_name_set�szCompleteDirs._name_setcCs,|��}|d}||ko||k}|r(|S|S�Nrv)r)r�r!rr�Z	dir_matchrrr�resolve_dir�szCompleteDirs.resolve_dircCsNt|t�r|St|t�s ||�Sd|jkr.t}|�|�}t|��t|��|Sr�)r�r
rr �__new__�vars�update)r�r��resrrr�make�s



zCompleteDirs.make)rrr�staticmethodrr�rrr�rrNrrrJrr
�s

r
cs(eZdZ�fdd�Z�fdd�Z�ZS)�
FastLookupc
s:t�t��|jW5QR�SQRXtt|���|_|jSr�)�
contextlib�suppressr)Z_FastLookup__namesrIrr�r�rJrrr��szFastLookup.namelistc
s:t�t��|jW5QR�SQRXtt|���|_|jSr�)rrr)Z_FastLookup__lookuprIrrr�rJrrr�szFastLookup._name_set)rrrr�rrNrrrJrr�src@s�eZdZdZd"dd�Zedd��Zedd��Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�ZeZedd ��Zd!S)#rz>{self.__class__.__name__}({self.root.filename!r}, {self.at!r})r�cCst�|�|_||_dSr�)rrr��at)r�r�r rrrr�	sz
Path.__init__cCst�|jj|j�Sr�)�	functools�partialr�rAr r�rrrrA	sz	Path.opencCst�|j�d��Sr)rr�r r�r�rrrr!	sz	Path.namec
Os6|���$}tj|f|�|���W5QR�SQRXdSr�)rAr3�
TextIOWrapperr>)r��args�kwargs�strmrrr�	read_text	s
zPath.read_textc
Cs(|���}|��W5QR�SQRXdSr�r�)r�r&rrr�
read_bytes	s
zPath.read_bytescCst�|j�d��|j�d�kSr)rr�r r�)r�r�rrr�	_is_child"	szPath._is_childcCst|j|�Sr�)rr�)r�r rrr�_next%	sz
Path._nextcCs|jp|j�d�Sr)r �endswithr�rrrr�(	szPath.is_dircCs
|��Sr�)r�r�rrr�is_file+	szPath.is_filecCs|j|j��kSr�)r r�rr�rrrr�.	szPath.existscCs.|��std��t|j|j���}t|j|�S)NzCan't listdir a file)r�r|r�r*r�r��filterr))r�Zsubsrrr�iterdir1	szPath.iterdircCst�|jj|j�Sr�)rr2r�rBr r�rrr�__str__7	szPath.__str__cCs|jj|d�S)Nr�)�_Path__reprrr�rrrr�:	sz
Path.__repr__cCs t�|j|�}|�|j�|��Sr�)rr2r r*r�r)r��add�nextrrr�joinpath=	sz
Path.joinpathcCs(t�|j�d��}|r|d7}|�|�Sr)rr�r r�r*)r�Z	parent_atrrr�parentC	szPath.parentN)r�)rrrr0r�r^rAr!r'r(r)r*r�r,r�r.r/r�r3�__truediv__r4rrrrr�s(A


c
	s�ddl}d}|j|d�}|jdd�}|jdddd	d
�|jddd
ddd�|jdddddd�|jddddd
�|�|�}|jdk	r�|j}t|d��}|��}W5QRX|r�td�	|��td�n�|j
dk	r�|j
}t|d��}|��W5QRXn�|jdk	�r,|j\}}t|d��}|�
|�W5QRXn�|jdk	�r�|j�d�}	|j}
�fdd��t|	d��\}|
D]P}tj�|�}|�s�tj�tj�|��}|dtjtjfk�r�d}�|||��qfW5QRXdS) Nrz3A simple command-line interface for zipfile module.)�descriptionT)Zrequiredz-lz--list�	<zipfile>zShow listing of a zipfile)�metavar�helpz-ez	--extractr)r7z<output_dir>zExtract zipfile into target dir)�nargsr8r9z-cz--create�+)z<name>z<file>zCreate zipfile from sourcesz-tz--testzTest if a zipfile is validr_z.The following enclosed file is corrupted: {!r}zDone testingcsptj�|�r|�||t�nPtj�|�rl|r8|�||�tt�|��D]$}�|tj�||�tj�||��qFdSr�)	ryr�r�rrr�r�r�r2)rWr��zippathZnm��addToZiprrr>s	s�zmain.<locals>.addToZipr`r�)�argparse�ArgumentParserZadd_mutually_exclusive_group�add_argument�
parse_argsZtestrr�r}rr^r�r�r�Zcreate�popryr�r�r�r�r�)
r$r?r6�parser�groupr�rWZbadfiler�Zzip_name�filesr�r<rr=r�mainK	s\
�
�
�
�




rG�__main__)N)N)�Zbinasciir!�importlib.utilr�r3rryrr�r�rFr}rpr�rr�r��ImportErrorr�r��__all__�	Exceptionrr
rrr�r�r�rrrrrr�r�r�r�r]r\r�r[rLrMrNrOrPrQrRrar~rr�r�r�r�Z_CD_CREATE_VERSIONZ_CD_CREATE_SYSTEMZ_CD_EXTRACT_VERSIONZ_CD_EXTRACT_SYSTEMZ
_CD_FLAG_BITSZ_CD_COMPRESS_TYPEZ_CD_TIMEZ_CD_DATEZ_CD_CRCZ_CD_COMPRESSED_SIZEZ_CD_UNCOMPRESSED_SIZEr�r�r�Z_CD_DISK_NUMBER_STARTZ_CD_INTERNAL_FILE_ATTRIBUTESZ_CD_EXTERNAL_FILE_ATTRIBUTESr�r�r�r�r�Z_FH_EXTRACT_VERSIONZ_FH_EXTRACT_SYSTEMr�Z_FH_COMPRESSION_METHODZ_FH_LAST_MOD_TIMEZ_FH_LAST_MOD_DATEZ_FH_CRCZ_FH_COMPRESSED_SIZEZ_FH_UNCOMPRESSED_SIZEr�r�rGrHrErJrKrIZ_CD64_SIGNATUREZ_CD64_DIRECTORY_RECSIZEZ_CD64_CREATE_VERSIONZ_CD64_EXTRACT_VERSIONZ_CD64_DISK_NUMBERZ_CD64_DISK_NUMBER_STARTZ_CD64_NUMBER_ENTRIES_THIS_DISKZ_CD64_NUMBER_ENTRIES_TOTALZ_CD64_DIRECTORY_SIZEZ_CD64_OFFSET_START_CENTDIRrZZStructr.r8r=r	rXr9�objectr
r�r�r�r�r�r�r�r�r�rrr4rrOrrrr�dict�fromkeysrrr
rrrGrrrrr�<module>sj


�






+=q&�
&AN/2
=
__pycache__/ftplib.cpython-38.opt-1.pyc000064400000066551151153537560013653 0ustar00U

e5d9��@sVdZddlZddlZddlmZdddddd	gZd
ZdZdZGd
d�de�Z	Gdd�de	�Z
Gdd�de	�ZGdd�de	�ZGdd�de	�Z
e	eefZdZdZGdd�d�ZzddlZWnek
r�dZYn0XejZGdd�de�Ze�d�e	eeejfZdadd�Zdadd�Zdd�Zdd�Z d d!�Z!d)d$d%�Z"d&d'�Z#e$d(k�rRe#�dS)*aSAn FTP client class and some helper functions.

Based on RFC 959: File Transfer Protocol (FTP), by J. Postel and J. Reynolds

Example:

>>> from ftplib import FTP
>>> ftp = FTP('ftp.python.org') # connect to host, default port
>>> ftp.login() # default, i.e.: user anonymous, passwd anonymous@
'230 Guest login ok, access restrictions apply.'
>>> ftp.retrlines('LIST') # list directory contents
total 9
drwxr-xr-x   8 root     wheel        1024 Jan  3  1994 .
drwxr-xr-x   8 root     wheel        1024 Jan  3  1994 ..
drwxr-xr-x   2 root     wheel        1024 Jan  3  1994 bin
drwxr-xr-x   2 root     wheel        1024 Jan  3  1994 etc
d-wxrwxr-x   2 ftp      wheel        1024 Sep  5 13:43 incoming
drwxr-xr-x   2 root     wheel        1024 Nov 17  1993 lib
drwxr-xr-x   6 1094     wheel        1024 Sep 13 19:07 pub
drwxr-xr-x   3 root     wheel        1024 Jan  3  1994 usr
-rw-r--r--   1 root     root          312 Aug  1  1994 welcome.msg
'226 Transfer complete.'
>>> ftp.quit()
'221 Goodbye.'
>>>

A nice test that reveals some of the network dialogue would be:
python ftplib.py -d localhost -l -p -l
�N)�_GLOBAL_DEFAULT_TIMEOUT�FTP�error_reply�
error_temp�
error_perm�error_proto�
all_errors��� c@seZdZdS)�ErrorN��__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/ftplib.pyr9src@seZdZdS)rNr
rrrrr:sc@seZdZdS)rNr
rrrrr;sc@seZdZdS)rNr
rrrrr<sc@seZdZdS)rNr
rrrrr=s�
s
c@s�eZdZdZdZdZeZeZ	dZ
dZdZdZ
dZdZddddedfdd	�Zd
d�Zdd
�Zd\dd�Zdd�Zdd�ZeZdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Z d'd(�Z!d)d*�Z"d+d,�Z#d-d.�Z$d/d0�Z%d1d2�Z&d]d3d4�Z'd^d5d6�Z(d_d7d8�Z)d`d:d;�Z*dad<d=�Z+dbd>d?�Z,dcd@dA�Z-dBdC�Z.dDdE�Z/dFdG�Z0dgfdHdI�Z1dJdK�Z2dLdM�Z3dNdO�Z4dPdQ�Z5dRdS�Z6dTdU�Z7dVdW�Z8dXdY�Z9dZd[�Z:dS)drayAn FTP client class.

    To create a connection, call the class using these arguments:
            host, user, passwd, acct, timeout

    The first four arguments are all strings, and have default value ''.
    timeout must be numeric and defaults to None if not passed,
    meaning that no timeout will be set on any ftp socket(s)
    If a timeout is passed, then this is now the default timeout for all ftp
    socket operations for this instance.

    Then use self.connect() with optional host and port argument.

    To download a file, use ftp.retrlines('RETR ' + filename),
    or ftp.retrbinary() with slightly different arguments.
    To upload a file, use ftp.storlines() or ftp.storbinary(),
    which have an open file as argument (see their definitions
    below for details).
    The download/upload functions first issue appropriate TYPE
    and PORT or PASV commands.
    r�Nr	zlatin-1FcCs0||_||_|r,|�|�|r,|�|||�dS�N)�source_address�timeout�connect�login)�self�host�user�passwd�acctrrrrr�__init__rs
zFTP.__init__cCs|Srr�rrrr�	__enter__{sz
FTP.__enter__c	GsN|jdk	rJz*z|��Wnttfk
r0YnXW5|jdk	rH|��XdSr)�sock�close�quit�OSError�EOFError)r�argsrrr�__exit__s


zFTP.__exit__����cCs�|dkr||_|dkr||_|dkr*||_|dk	r8||_t�d||j|j�tj|j|jf|j|jd�|_|jj	|_
|jjd|jd�|_
|��|_|jS)	awConnect to host.  Arguments are:
         - host: hostname to connect to (string, default previous host)
         - port: port to connect to (integer, default previous port)
         - timeout: the timeout to set against the ftp socket(s)
         - source_address: a 2-tuple (host, port) for the socket to bind
           to as its source address before connecting.
        rrr)Nzftplib.connect�r�r��encoding)r�portrr�sys�audit�socket�create_connectionr"�family�af�makefiler-�file�getresp�welcome)rrr.rrrrrr�s �

zFTP.connectcCs|jrtd|�|j��|jS)z`Get the welcome message from the server.
        (this is read and squirreled away by connect())z	*welcome*)�	debugging�print�sanitizer8r rrr�
getwelcome�szFTP.getwelcomecCs
||_dS)z�Set the debugging level.
        The required argument level means:
        0: no debugging output (default)
        1: print commands and responses but not body text etc.
        2: also print raw lines read and sent before stripping CR/LFN)r9)r�levelrrr�set_debuglevel�szFTP.set_debuglevelcCs
||_dS)z�Use passive or active mode for data transfers.
        With a false argument, use the normal PORT mode,
        With a true argument, use the PASV command.N)�
passiveserver)r�valrrr�set_pasv�szFTP.set_pasvcCsJ|dd�dkrBt|�d��}|dd�d|d||d�}t|�S)N�>�PASS �pass r�*)�len�rstrip�repr)r�s�irrrr;�s$zFTP.sanitizecCs`d|ksd|krtd��t�d||�|t}|jdkrHtd|�|��|j�|�	|j
��dS)N�
�
z4an illegal newline character should not be containedzftplib.sendcmdr	z*put*)�
ValueErrorr/r0�CRLFr9r:r;r"�sendall�encoder-�r�linerrr�putline�s
zFTP.putlinecCs$|jrtd|�|��|�|�dS)Nz*cmd*)r9r:r;rSrQrrr�putcmd�sz
FTP.putcmdcCs�|j�|jd�}t|�|jkr.td|j��|jdkrHtd|�|��|sPt�|dd�t	krn|dd�}n|dd�t	kr�|dd�}|S)Nr	�got more than %d bytesz*get*������)
r6�readline�maxlinerFrr9r:r;r&rNrQrrr�getline�s
zFTP.getlinecCs`|��}|dd�dkr\|dd�}|��}|d|}|dd�|kr$|dd�dkr$q\q$|S)N���-rL)rZ)rrR�codeZnextlinerrr�getmultiline�s�zFTP.getmultilinecCsp|��}|jrtd|�|��|dd�|_|dd�}|dkrD|S|dkrTt|��|dkrdt|��t|��dS)Nz*resp*r[r	>�1�3�2�4�5)r_r9r:r;Zlastresprrr)r�resp�crrrr7�szFTP.getrespcCs$|��}|dd�dkr t|��|S)z%Expect a response beginning with '2'.Nr	rb)r7r�rrerrr�voidresp�szFTP.voidrespcCsTdt}|jdkr"td|�|��|j�|t�|��}|dd�dkrPt|��|S)z�Abort a file transfer.  Uses out-of-band data.
        This does not follow the procedure from the RFC to send Telnet
        IP and Synch; that doesn't seem to work with the servers I've
        tried.  Instead, just send the ABOR command as OOB data.�ABORr	z*put urgent*Nr[��225�426�226)	�B_CRLFr9r:r;r"rO�MSG_OOBr_r�rrRrerrr�aborts
z	FTP.abortcCs|�|�|��S)z'Send a command and return the response.)rTr7�r�cmdrrr�sendcmds
zFTP.sendcmdcCs|�|�|��S)z8Send a command and expect a response beginning with '2'.)rTrhrrrrr�voidcmds
zFTP.voidcmdcCsB|�d�}t|d�t|d�g}||}dd�|�}|�|�S)zUSend a PORT command with the current host and the given
        port number.
        �.�zPORT �,)�splitrH�joinru)rrr.ZhbytesZpbytes�bytesrsrrr�sendports

zFTP.sendportcCsbd}|jtjkrd}|jtjkr$d}|dkr4td��dt|�|t|�dg}dd�|�}|�|�S)zESend an EPRT command with the current host and the given port number.rr	�zunsupported address familyrzEPRT �|)r4r1�AF_INETZAF_INET6rrHrzru)rrr.r4Zfieldsrsrrr�sendeprt&szFTP.sendeprtcCsltjd|jdd�}|��d}|j��d}|jtjkrF|�||�}n|�||�}|jt	k	rh|�
|j�|S)z3Create a new socket and send a PORT command for it.)rrr	)r3Zbacklogr)r1Z
create_serverr4Zgetsocknamer"rr|r�rr�
settimeout)rr"r.rrerrr�makeport3s
zFTP.makeportcCs\|jtjkr:t|�d��\}}|jr*|}qT|j��d}nt|�d�|j���\}}||fS)z<Internal: Does the PASV or EPSV handshake -> (address, port)�PASVrZEPSV)	r4r1r�parse227rt�trust_server_pasv_ipv4_addressr"Zgetpeername�parse229)rZuntrusted_hostr.rrrr�makepasv@szFTP.makepasvc
	Cs6d}|jr�|��\}}tj||f|j|jd�}zL|dk	rF|�d|�|�|�}|ddkrd|��}|ddkrxt|��Wn|�	��YnXn�|�
��r}|dk	r�|�d|�|�|�}|ddkr�|��}|ddkr�t|��|��\}}	|jtk	�r
|�
|j�W5QRX|dd�dk�r.t|�}||fS)	a�Initiate a transfer over the data connection.

        If the transfer is active, send a port command and the
        transfer command, and accept the connection.  If the server is
        passive, send a pasv command, connect to it, and start the
        transfer command.  Either way, return the socket for the
        connection and the expected size of the transfer.  The
        expected size may be None if it could not be determined.

        Optional `rest' argument can be a string that is sent as the
        argument to a REST command.  This is essentially a server
        marker used to tell the server to skip over any data up to the
        given marker.
        Nr*zREST %srrbr`r[�150)r?r�r1r2rrrtr7rr#r�Zacceptrr��parse150)
rrs�rest�sizerr.�connrer"Zsockaddrrrr�ntransfercmdLs>�



zFTP.ntransfercmdcCs|�||�dS)z0Like ntransfercmd() but returns only the socket.r)r�)rrsr�rrr�transfercmd�szFTP.transfercmdcCs�|sd}|sd}|sd}|dkr0|dkr0|d}|�d|�}|ddkrX|�d|�}|ddkrr|�d	|�}|dd
kr�t|��|S)zLogin, default anonymous.Z	anonymousr>rr]z
anonymous@zUSER rrarC�ACCT rb�rtr)rrrrrerrrr�s z	FTP.loginrc	Cs^|�d�|�||��:}|�|�}|s(q2||�qtdk	rLt|t�rL|��W5QRX|��S)a�Retrieve data in binary mode.  A new port is created for you.

        Args:
          cmd: A RETR command.
          callback: A single parameter callable to be called on each
                    block of data read.
          blocksize: The maximum number of bytes to read from the
                     socket at one time.  [default: 8192]
          rest: Passed to transfercmd().  [default: None]

        Returns:
          The response code.
        �TYPE IN)rur�Zrecv�
_SSLSocket�
isinstance�unwraprh)rrs�callback�	blocksizer�r��datarrr�
retrbinary�s


zFTP.retrbinaryc
Cs�|dkrt}|�d�}|�|���}|jd|jd���}|�|jd�}t|�|jkr`td|j��|j	dkrxt
dt|��|s~q�|d	d�tkr�|dd	�}n|d
d�dkr�|dd
�}||�q4t
dk	r�t|t
�r�|��W5QRXW5QRX|��S)ahRetrieve data in line mode.  A new port is created for you.

        Args:
          cmd: A RETR, LIST, or NLST command.
          callback: An optional single parameter callable that is called
                    for each line with the trailing CRLF stripped.
                    [default: print_line()]

        Returns:
          The response code.
        N�TYPE Ar+r,r	rUr}z*retr*rVrWrL)�
print_linertr�r5r-rXrYrFrr9r:rHrNr�r�r�rh)rrsr�rer��fprRrrr�	retrlines�s,
�

z
FTP.retrlinesc	Csl|�d�|�||��H}|�|�}|s(q@|�|�|r||�qtdk	rZt|t�rZ|��W5QRX|��S)a9Store a file in binary mode.  A new port is created for you.

        Args:
          cmd: A STOR command.
          fp: A file-like object with a read(num_bytes) method.
          blocksize: The maximum data size to read from fp and send over
                     the connection at once.  [default: 8192]
          callback: An optional single parameter callable that is called on
                    each block of data after it is sent.  [default: None]
          rest: Passed to transfercmd().  [default: None]

        Returns:
          The response code.
        r�N)rur��readrOr�r�r�rh)rrsr�r�r�r�r��bufrrr�
storbinary�s



zFTP.storbinaryc	Cs�|�d�|�|���}|�|jd�}t|�|jkrBtd|j��|sHq�|dd�tkrx|dtkrp|dd�}|t}|�|�|r||�qtdk	r�t	|t�r�|�
�W5QRX|��S)ahStore a file in line mode.  A new port is created for you.

        Args:
          cmd: A STOR command.
          fp: A file-like object with a readline() method.
          callback: An optional single parameter callable that is called on
                    each line after it is sent.  [default: None]

        Returns:
          The response code.
        r�r	rUrVNrW)rur�rXrYrFrrnrOr�r�r�rh)rrsr�r�r�r�rrr�	storlines�s"


z
FTP.storlinescCsd|}|�|�S)zSend new account name.r��ru)rZpasswordrsrrrrszFTP.acctcGs0d}|D]}|d|}qg}|�||j�|S)zBReturn a list of files in a given directory (default the current).ZNLST� )r��append)rr'rs�arg�filesrrr�nlstszFTP.nlstcGshd}d}|dd�r>t|d�td�kr>|dd�|d}}|D]}|rB|d|}qB|�||�dS)aList a directory in long form.
        By default list current directory to stdout.
        Optional last argument is callback function; all
        non-empty arguments before it are concatenated to the
        LIST command.  (This *should* only be used for a pathname.)ZLISTNrWrr�)�typer�)rr'rs�funcr�rrr�dir(s zFTP.dirc
cs�|r|�dd�|�d�|r*d|}nd}g}|�||j�|D]\}|�t��d�\}}}i}	|dd��d�D] }
|
�d�\}}}||	|��<qt||	fVqDdS)	a<List a directory in a standardized format by using MLSD
        command (RFC-3659). If path is omitted the current directory
        is assumed. "facts" is a list of strings representing the type
        of information desired (e.g. ["type", "size", "perm"]).

        Return a generator object yielding a tuple of two elements
        for every file found in path.
        First element is the file name, the second one is a dictionary
        including a variable number of "facts" depending on the server
        and whether "facts" argument has been provided.
        z
OPTS MLST �;zMLSD %sZMLSDr�NrW�=)	rtrzr�r�rGrN�	partitionry�lower)
r�pathZfactsrs�linesrRZfacts_found�_�name�entryZfact�key�valuerrr�mlsd7s
zFTP.mlsdcCs0|�d|�}|ddkr"t|��|�d|�S)zRename a file.zRNFR rrazRNTO )rtrru)rZfromnameZtonamererrr�renameSsz
FTP.renamecCs.|�d|�}|dd�dkr"|St|��dS)zDelete a file.zDELE Nr[>�250�200r�)r�filenamererrr�deleteZsz
FTP.deletec
Csp|dkrRz|�d�WStk
rN}z|jddd�dkr>�W5d}~XYq^Xn|dkr^d}d	|}|�|�S)
zChange to a directory.z..ZCDUPrNr[�500rrvzCWD )rurr')r�dirname�msgrsrrr�cwdbszFTP.cwdcCs:|�d|�}|dd�dkr6|dd���}t|�SdS)zRetrieve the size of a file.zSIZE Nr[Z213)rt�strip�int)rr�rerIrrrr�oszFTP.sizecCs$|�d|�}|�d�sdSt|�S)z+Make a directory, return its full pathname.zMKD �257r�ru�
startswith�parse257)rr�rerrr�mkdws
zFTP.mkdcCs|�d|�S)zRemove a directory.zRMD r�)rr�rrr�rmd�szFTP.rmdcCs |�d�}|�d�sdSt|�S)z!Return current working directory.ZPWDr�rr�rgrrr�pwd�s

zFTP.pwdcCs|�d�}|��|S)zQuit, and close the connection.ZQUIT)rur#rgrrrr$�s
zFTP.quitcCsDz |j}d|_|dk	r|��W5|j}d|_|dk	r>|��XdS)z8Close the connection without assuming anything about it.N)r"r#r6)rr"r6rrrr#�sz	FTP.close)rrr)N)N)N)rrr)rN)N)rNN)N);rrr�__doc__r9r�FTP_PORTr.�MAXLINErYr"r6r8r?r-r�rrr!r(rr<r>�debugrAr;rSrTrZr_r7rhrqrtrur|r�r�r�r�r�rr�r�r�r�rr�r�r�r�r�r�r�r�r�r�r$r#rrrrrJsp�
	






7



#

	
		c	@sneZdZdZejZdddddddedf	dd�Zddd�Z	d	d
�Z
dd�Zd
d�Zdd�Z
ddd�Zdd�ZdS)�FTP_TLSa�A FTP subclass which adds TLS support to FTP as described
        in RFC-4217.

        Connect as usual to port 21 implicitly securing the FTP control
        connection before authenticating.

        Securing the data connection requires user to explicitly ask
        for it by calling prot_p() method.

        Usage example:
        >>> from ftplib import FTP_TLS
        >>> ftps = FTP_TLS('ftp.python.org')
        >>> ftps.login()  # login anonymously previously securing control channel
        '230 Guest login ok, access restrictions apply.'
        >>> ftps.prot_p()  # switch to secure data connection
        '200 Protection level set to P'
        >>> ftps.retrlines('LIST')  # list directory content securely
        total 9
        drwxr-xr-x   8 root     wheel        1024 Jan  3  1994 .
        drwxr-xr-x   8 root     wheel        1024 Jan  3  1994 ..
        drwxr-xr-x   2 root     wheel        1024 Jan  3  1994 bin
        drwxr-xr-x   2 root     wheel        1024 Jan  3  1994 etc
        d-wxrwxr-x   2 ftp      wheel        1024 Sep  5 13:43 incoming
        drwxr-xr-x   2 root     wheel        1024 Nov 17  1993 lib
        drwxr-xr-x   6 1094     wheel        1024 Sep 13 19:07 pub
        drwxr-xr-x   3 root     wheel        1024 Jan  3  1994 usr
        -rw-r--r--   1 root     root          312 Aug  1  1994 welcome.msg
        '226 Transfer complete.'
        >>> ftps.quit()
        '221 Goodbye.'
        >>>
        rNc
	Cs�|dk	r|dk	rtd��|dk	r0|dk	r0td��|dk	s@|dk	rVddl}
|
�dtd�||_||_|dkr|tj|j||d�}||_	d|_
t�|||||||	�dS)Nz4context and keyfile arguments are mutually exclusivez5context and certfile arguments are mutually exclusiverzAkeyfile and certfile are deprecated, use a custom context insteadr})�certfile�keyfileF)
rM�warnings�warn�DeprecationWarningr�r��sslZ_create_stdlib_context�ssl_version�context�_prot_prr)rrrrrr�r�r�rrr�rrrr�s(��zFTP_TLS.__init__TcCs*|rt|jtj�s|��t�||||�Sr)r�r"r��	SSLSocket�authrr)rrrrZsecurerrrr�sz
FTP_TLS.logincCsft|jtj�rtd��|jtjkr.|�d�}n
|�d�}|jj	|j|j
d�|_|jjd|jd�|_
|S)z2Set up secure control connection by using TLS/SSL.zAlready using TLSzAUTH TLSzAUTH SSL�Zserver_hostnamer+)�moder-)r�r"r�r�rMr�ZPROTOCOL_TLSrur��wrap_socketrr5r-r6rgrrrr��s

�zFTP_TLS.authcCs0t|jtj�std��|�d�}|j��|_|S)z/Switch back to a clear-text control connection.z
not using TLSZCCC)r�r"r�r�rMrur�rgrrr�ccc�s

zFTP_TLS.ccccCs|�d�|�d�}d|_|S)zSet up secure data connection.zPBSZ 0zPROT PT�rur�rgrrr�prot_p�s

zFTP_TLS.prot_pcCs|�d�}d|_|S)z"Set up clear text data connection.zPROT CFr�rgrrr�prot_cs
zFTP_TLS.prot_ccCs2t�|||�\}}|jr*|jj||jd�}||fS)Nr�)rr�r�r�r�r)rrsr�r�r�rrrr�s�zFTP_TLS.ntransfercmdcCs8dt}|j�|�|��}|dd�dkr4t|��|S)Nrir[rj)rnr"rOr_rrprrrrqsz
FTP_TLS.abort)rrrT)N)rrrr�r�ZPROTOCOL_TLS_CLIENTr�rrrr�r�r�r�r�rqrrrrr��s 
�



r�cCs\|dd�dkrt|��tdkr<ddl}|�d|j|jB�at�|�}|sNdSt|�d��S)z�Parse the '150' response for a RETR request.
    Returns the expected transfer size or None; size is not guaranteed to
    be present in the 150 message.
    Nr[r�rz150 .* \((\d+) bytes\)r	)	r�_150_re�re�compile�
IGNORECASE�ASCII�matchr��group)rer��mrrrr�)s
�
r�cCs�|dd�dkrt|��tdkr6ddl}|�d|j�at�|�}|sLt|��|��}d�|dd��}t	|d�d>t	|d	�}||fS)
z�Parse the '227' response for a PASV request.
    Raises error_proto if it does not contain '(h1,h2,h3,h4,p1,p2)'
    Return ('host.addr.as.numbers', port#) tuple.Nr[Z227rz#(\d+),(\d+),(\d+),(\d+),(\d+),(\d+)rvr\�rB)
r�_227_rer�r�r��searchr�groupsrzr�)rer�r�Znumbersrr.rrrr�=s
r�cCs�|dd�dkrt|��|�d�}|dkr2t|��|�d|d�}|dkrRt|��||d||dkrrt|��||d|��||d�}t|�dkr�t|��|d}t|d�}||fS)	z�Parse the '229' response for an EPSV request.
    Raises error_proto if it does not contain '(|||port|)'
    Return ('host.addr.as.numbers', port#) tuple.Nr[Z229�(r�)r	rB)r�findrryrFr�)reZpeer�left�right�partsrr.rrrr�Qs 
r�cCs�|dd�dkrt|��|dd�dkr,dSd}d}t|�}||kr�||}|d}|dkrz||ks�||dkrrq�|d}||}q<|S)	z�Parse the '257' response for a MKD or PWD request.
    This is a response to a MKD or PWD request: a directory name.
    Returns the directoryname in the 257 reply.Nr[r�rBz "rr	�")rrF)rer�rJ�nrfrrrr�gs 
r�cCst|�dS)z+Default retrlines callback to print a line.N)r:)rRrrrr�~sr�r�Ic	Cs�|s|}d|}|�|�|�|�t|�d��\}}|�||�|�d|�}|dd�dkrdt�|�d|�}|dd�dkr�t�|��|��dS)z+Copy file from one FTP-instance to another.zTYPE r�zSTOR Nr[>�125r��RETR )rur�rtr|rrh)	�sourceZ
sourcename�targetZ
targetnamer�Z
sourcehostZ
sourceportZtreplyZsreplyrrr�ftpcp�s

r�cCs�ttj�dkr"ttj�t�d�ddl}d}d}tjddkrR|d}tjd=q2tjddd�dkr�tjddd�}tjd=tjd}t|�}|�	|�d}}}z|�|�}Wn(t
k
r�|dk	r�tj�d�Yn:Xz|�
|�\}}}Wn"tk
�rtj�d	�YnX|�|||�tjdd�D]�}	|	dd�d
k�r`|�|	dd��nt|	dd�dk�r�d}
|	dd��r�|
d|	dd�}
|�|
�}n0|	d
k�r�|�|j�n|�d|	tjjd��q6|��dS)z�Test program.
    Usage: ftp [-d] [-r[file]] host [-l[dir]] [-d[dir]] [-p] [file] ...

    -d dir
    -l list
    -p password
    r}rNr	z-dz-rrz5Could not open account file -- using anonymous login.z$No account -- using anonymous login.z-lZCWDr�z-pr�i)rFr/�argvr:�testr��exit�netrcrr>r%�stderr�writeZauthenticators�KeyErrorrr�rtrAr?r��stdoutr$)r�r9ZrcfilerZftpZuseridrrZnetrcobjr6rsrerrrr��sV	




�


�r��__main__)rr�)%r�r/r1r�__all__ror�r��	Exceptionrrrrrr%r&rrNrnrr��ImportErrorr�r�r�r�ZSSLErrorr�r�r�r�r�r�r�r�r�rrrrr�<module>sR&
�
Z
|

9
__pycache__/typing.cpython-38.pyc000064400000171726151153537560012747 0ustar00U

e5db
�G@s�dZddlmZmZddlZddlZddlZddlZddlZddl	Z
ddlZddlZddlm
Z
mZmZddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKgGZd�dMdN�ZdOdP�ZdQdR�ZdSdT�ZdUdV�ZdWdX�ZgZdYdZ�Zd[d\�ZGd]d^�d^�ZGd_d`�d`�ZGdadb�dbeedLdc�Zedddde�ZedGdfde�Zeddgde�Zeddhde�Z eddide�Z!eddjde�Z"eddkde�Z#Gdld	�d	edLdc�Z$Gdmd�deedLdc�Z%d7dd5d9d:d4d6dddn�	Z&dodp�Z'Gdqdr�dredLdc�Z(Gdsdt�dte(dLdc�Z)Gdud
�d
�Z*Gdvdw�dw�Z+Gdxdy�dy�Z,dzd{d|d}d~gZ-dd�d�d�d�d�d�d�d�d�g
Z.e-e.d�gZ/d�d��Z0d�d��Z1d�d��Z2d�d��Z3dd#ddd%dd!dd'd*g
d�d�gd��Z4Gd�d��d�e�Z5Gd�d
�d
e*e5d��Z6d�dI�Z7d�d?�Z8d�d��Z9ej:ej;ej<ej=e
eefZ>d�d�dC�Z?d�dB�Z@d�dA�ZAd�dE�ZBd�dF�ZCd�d��ZDd�dH�ZEd�d@�ZFe%d��ZGe%d��ZHe%d��ZIe%d�dLd��ZJe%d�dLd��ZKe%d�dLd��ZLe%d�dLd��ZMe%d�dLeNd��ZOe%d>ePeQ�ZRd�d�d��ZSeSejjTd��ZTeSejjUeJ�ZUeSejjVeJeMeKf�ZVeSejjWeJ�ZWeSejjXeJ�ZXeSejjYeJ�ZYeSejjZeJ�ZZeSejj[eJ�Z[eSejj\d��Z\eSejj]eJ�Z]eSejj^eJ�Z^e)ejj_d�dLd��Z_d�e__eSejj`eJ�ZaeSejjbeG�ZbeSejjceHeLf�ZceSejjdeHeIf�ZdeSejjeeJ�ZeeSejjfeG�ZfeSejjgd��Zge)ehd�d�dLd��Zid�ei_eSejeGd�d��ZkeSejleG�ZmeSeneGd�d��Z`eSeoeJd�d��ZpeSejjqeJ�ZqeSejjreH�ZreSejjseHeLf�ZseSejjteL�ZteSejueJ�ZveSejweJ�ZxeSeyeHeIfd�d��ZzeSej{eHeIf�Z|eSej}eHeIf�Z}eSej~eG�Z~eSejeHeIf�ZeSejj�eJeMeKf�Z�eSejj�eJeMf�Z�eSeNeOd�d��Z�d�e�_e7Gd�d0�d0e6��Z�e7Gd�d.�d.e6��Z�e7Gd�d-�d-e6��Z�e7Gd�d,�d,e6��Z�e7Gd�d/�d/e6��Z�e7Gd�d+�d+e6eJ��Z�e7Gd�d1�d1e6eJ��Z�d�dÄZ�d�Z�d�Z�Gd�dDŽd�eN�Z�Gd�d;�d;e�d��Z�d�dʄZ�d�dLd˜d�d̈́Z�d�dτZ�Gd�dфd�eN�Z�Gd�d<�d<eye�d��Z�d�dD�Z�eQZ�d�Z�Gd�dՄd�e*eR�Z�Gd�dׄd�e�eP�Z�Gd�dلd�e�eQ�Z�Gd�dۄdۃZ�e�d�e�_�e�ej�e�j�<eSe
j�eR�Z�eSe
j�eR�Z�Gd�dބdރZ	e�d�e	_�e	ej�e	j�<dS)�a=
The typing module: Support for gradual typing as defined by PEP 484.

At large scale, the structure of the module is following:
* Imports and exports, all public names should be explicitly added to __all__.
* Internal helper functions: these should never be used in code outside this module.
* _SpecialForm and its instances (special forms): Any, NoReturn, ClassVar, Union, Optional
* Two classes whose instances can be type arguments in addition to types: ForwardRef and TypeVar
* The core of internal generics API: _GenericAlias and _VariadicGenericAlias, the latter is
  currently only used by Tuple and Callable. All subscripted types like X[int], Union[int, str],
  etc., are instances of either of these classes.
* The public counterpart of the generics API consists of two classes: Generic and Protocol.
* Public helper functions: get_type_hints, overload, cast, no_type_check,
  no_type_check_decorator.
* Generic aliases for collections.abc ABCs and few additional protocols.
* Special types: NewType, NamedTuple, TypedDict.
* Wrapper submodules for re and io related types.
�)�abstractmethod�ABCMetaN)�WrapperDescriptorType�MethodWrapperType�MethodDescriptorType�Any�Callable�ClassVar�Final�
ForwardRef�Generic�Literal�Optional�Protocol�Tuple�Type�TypeVar�Union�AbstractSet�
ByteString�	Container�ContextManager�Hashable�	ItemsView�Iterable�Iterator�KeysView�Mapping�MappingView�MutableMapping�MutableSequence�
MutableSet�Sequence�Sized�
ValuesView�	Awaitable�
AsyncIterator�
AsyncIterable�	Coroutine�
Collection�AsyncGenerator�AsyncContextManager�
Reversible�SupportsAbs�
SupportsBytes�SupportsComplex�
SupportsFloat�
SupportsIndex�SupportsInt�
SupportsRound�ChainMap�Counter�Deque�Dict�DefaultDict�List�OrderedDict�Set�	FrozenSet�
NamedTuple�	TypedDict�	Generator�AnyStr�cast�final�get_args�
get_origin�get_type_hints�NewType�
no_type_check�no_type_check_decorator�NoReturn�overload�runtime_checkable�Text�
TYPE_CHECKINGTcCs�ttf}|r|ttf}|dkr(td�St|t�r:t|�St|t�r\|j	|kr\t
|�d���t|t�rr|tt
fks~|ttfkr�t
d|�d���t|tttf�r�|St|�s�t
|�d|d�d���|S)a�Check that the argument is a type, and return it (internal helper).

    As a special case, accept None and return type(None) instead. Also wrap strings
    into ForwardRef instances. Consider several corner cases, for example plain
    special forms like Union are not valid, while Union[int, str] is OK, etc.
    The msg argument is a human-readable error message, e.g::

        "Union[arg, ...]: arg should be a type."

    We append the repr() of the actual value (truncated to 100 chars).
    Nz is not valid as type argumentzPlain z Got z.100�.)rrr	r
�type�
isinstance�strr�
_GenericAlias�
__origin__�	TypeError�_SpecialFormrrIr�callable)�arg�msg�is_argumentZinvalid_generic_forms�rZ�/usr/lib64/python3.8/typing.py�_type_checkxs(

�
�r\cCsRt|t�r,|jdkr|jS|j�d|j��S|dkr8dSt|tj�rJ|jSt|�S)a;Return the repr() of an object, special-casing types (internal helper).

    If obj is a type, we return a shorter version than the default
    type.__repr__, based on the module and qualified name, which is
    typically enough to uniquely identify a type.  For everything
    else, we fall back on repr(obj).
    �builtinsrN.z...)rPrO�
__module__�__qualname__�types�FunctionType�__name__�repr)�objrZrZr[�
_type_repr�s

recs\g�|D]J}t|t�r(|�kr(��|�t|t�r|js���fdd�|jD��qt��S)z�Collect all type variable contained in types in order of
    first appearance (lexicographic order). For example::

        _collect_type_vars((T, List[S, T])) == (T, S)
    csg|]}|�kr|�qSrZrZ��.0�t��tvarsrZr[�
<listcomp>�sz&_collect_type_vars.<locals>.<listcomp>)rPr�appendrR�_special�extend�__parameters__�tuple)r`rhrZrir[�_collect_type_vars�s
rqcCs�t|t�s|St|j�}t|j�D]J\}}t|t�r\t|�D]\}}||kr<||||<q<q"t|||�||<q"|jtkr�tt	|�S|�
t	|��S)zjSubstitute type variables 'tvars' with substitutions 'subs'.
    These two must have the same length.
    )rPrR�list�__args__�	enumerater�_subs_tvarsrSrrp�	copy_with)�tprjZsubsZnew_args�arW�iZtvarrZrZr[ru�s



ruc	Cs^|jst|�d���t|�}t|j�}||krZtd||kr>dnd�d|�d|�d|����dS)	z�Check correct count for parameters of a generic cls (internal helper).
    This gives a nice error message in case of count mismatch.
    z is not a generic classzToo ZmanyZfewz parameters for z	; actual z, expected N)rorT�len)�cls�
parametersZalenZelenrZrZr[�_check_generic�s
r}cCs�g}|D]f}t|t�r.|jtkr.|�|j�qt|t�rdt|�dkrd|dtkrd|�|dd��q|�|�qt	|�}t|�t|�kr�g}|D] }||kr�|�|�|�
|�q�|}|r�t|��t|�S)zyAn internal helper for Union creation and substitution: flatten Unions
    among parameters, then remove duplicates.
    r�N)rPrRrSrrnrsrprzrl�set�remove�AssertionError)r|�params�pZ
all_paramsZ
new_paramsrhrZrZr[�_remove_dups_flatten�s""
r�cs4t�����t��j�t�����fdd��}|S)zInternal wrapper caching __getitem__ of generic types with a fallback to
    original function for non-hashable arguments.
    cs,z�||�WStk
r YnX�||�S�N�rT��args�kwds��cached�funcrZr[�inner�s
z_tp_cache.<locals>.inner)�	functools�	lru_cache�	_cleanupsrl�cache_clear�wraps)r�r�rZr�r[�	_tp_cache�s
r�csbt|t�r|����St|t�r^t��fdd�|jD��}||jkrH|S|�|�}|j|_|S|S)z�Evaluate all forward references in the given type t.
    For use of globalns and localns see the docstring for get_type_hints().
    c3s|]}t|���VqdSr�)�
_eval_type�rgrx��globalns�localnsrZr[�	<genexpr>sz_eval_type.<locals>.<genexpr>)rPr�	_evaluaterRrprsrvrm)rhr�r�Zev_args�resrZr�r[r�	s



r�c@seZdZdZdZdd�ZdS)�_FinalzMixin to prohibit subclassing)�__weakref__cOsd|krtd��dS)N�_rootz&Cannot subclass special typing classesr���selfr�r�rZrZr[�__init_subclass__sz_Final.__init_subclass__N)rbr^r_�__doc__�	__slots__r�rZrZrZr[r�sr�c@s eZdZdZdd�Zdd�ZdS)�
_Immutablez3Mixin to indicate that object should not be copied.cCs|Sr�rZ�r�rZrZr[�__copy__%sz_Immutable.__copy__cCs|Sr�rZ)r�ZmemorZrZr[�__deepcopy__(sz_Immutable.__deepcopy__N)rbr^r_r�r�r�rZrZrZr[r�"sr�cspeZdZdZdZ�fdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
edd��Z�ZS)rUzhInternal indicator of special typing constructs.
    See _doc instance attribute for specific docs.
    ��_nameZ_doccsBt|�dkr6t|dt�r6t|dt�r6td|����t��|�S)z�Constructor.

        This only exists to give a better error message in case
        someone tries to subclass a special typing object (not a good idea).
        �rr~zCannot subclass )rzrPrQrprT�super�__new__)r{r�r���	__class__rZr[r�3s��z_SpecialForm.__new__cCs||_||_dSr�r�)r��name�docrZrZr[�__init__@sz_SpecialForm.__init__cCst|t�stS|j|jkSr�)rPrU�NotImplementedr��r��otherrZrZr[�__eq__Ds
z_SpecialForm.__eq__cCst|jf�Sr�)�hashr�r�rZrZr[�__hash__Isz_SpecialForm.__hash__cCs
d|jS)N�typing.�r�r�rZrZr[�__repr__Lsz_SpecialForm.__repr__cCs|jSr�r�r�rZrZr[�
__reduce__Osz_SpecialForm.__reduce__cOstd|����dS)NzCannot instantiate r�r�rZrZr[�__call__Rsz_SpecialForm.__call__cCst|�d���dS)Nz! cannot be used with isinstance()r��r�rdrZrZr[�__instancecheck__Usz_SpecialForm.__instancecheck__cCst|�d���dS)Nz! cannot be used with issubclass()r��r�r{rZrZr[�__subclasscheck__Xsz_SpecialForm.__subclasscheck__cs�|jdkr(t||j�d��}t||f�S|jdkr�|dkrBtd��t|t�sR|f}d�t�fdd�|D��}t|�}t|�d	kr�|d
St||�S|jdkr�t|d�}t|t	d�fS|jd
kr�t||�St|�d���dS)N)r	r
z accepts only single type.rrZz Cannot take a Union of no types.z)Union[arg, ...]: each arg must be a type.c3s|]}t|��VqdSr��r\�rgr��rXrZr[r�fsz+_SpecialForm.__getitem__.<locals>.<genexpr>r~rrz#Optional[t] requires a single type.r
z is not subscriptable)
r�r\rRrTrPrpr�rzrrO)r�r|�itemrWrZr�r[�__getitem__[s(







z_SpecialForm.__getitem__)rbr^r_r�r�r�r�r�r�r�r�r�r�r�r�r��
__classcell__rZrZr�r[rU,s
rU)r�a`Special type indicating an unconstrained type.

    - Any is compatible with every type.
    - Any assumed to have all methods.
    - All values assumed to be instances of Any.

    Note that all the above statements are true from the point of view of
    static type checkers. At runtime, Any should not be used with instance
    or class checks.
    )r�aSpecial type indicating functions that never return.
    Example::

      from typing import NoReturn

      def stop() -> NoReturn:
          raise Exception('no way')

    This type is invalid in other positions, e.g., ``List[NoReturn]``
    will fail in static type checkers.
    a3Special type construct to mark class variables.

    An annotation wrapped in ClassVar indicates that a given
    attribute is intended to be used as a class variable and
    should not be set on instances of that class. Usage::

      class Starship:
          stats: ClassVar[Dict[str, int]] = {} # class variable
          damage: int = 10                     # instance variable

    ClassVar accepts only types and cannot be further subscribed.

    Note that ClassVar is not a class itself, and should not
    be used with isinstance() or issubclass().
    a�Special typing construct to indicate final names to type checkers.

    A final name cannot be re-assigned or overridden in a subclass.
    For example:

      MAX_SIZE: Final = 9000
      MAX_SIZE += 1  # Error reported by type checker

      class Connection:
          TIMEOUT: Final[int] = 10

      class FastConnector(Connection):
          TIMEOUT = 1  # Error reported by type checker

    There is no runtime checking of these properties.
    a'Union type; Union[X, Y] means either X or Y.

    To define a union, use e.g. Union[int, str].  Details:
    - The arguments must be types and there must be at least one.
    - None as an argument is a special case and is replaced by
      type(None).
    - Unions of unions are flattened, e.g.::

        Union[Union[int, str], float] == Union[int, str, float]

    - Unions of a single argument vanish, e.g.::

        Union[int] == int  # The constructor actually returns int

    - Redundant arguments are skipped, e.g.::

        Union[int, str, int] == Union[int, str]

    - When comparing unions, the argument order is ignored, e.g.::

        Union[int, str] == Union[str, int]

    - You cannot subclass or instantiate a union.
    - You can use Optional[X] as a shorthand for Union[X, None].
    zEOptional type.

    Optional[X] is equivalent to Union[X, None].
    a�Special typing form to define literal types (a.k.a. value types).

    This form can be used to indicate to type checkers that the corresponding
    variable or function parameter has a value equivalent to the provided
    literal (or one of several literals):

      def validate_simple(data: Any) -> Literal[True]:  # always returns True
          ...

      MODE = Literal['r', 'rb', 'w', 'wb']
      def open_helper(file: str, mode: MODE) -> str:
          ...

      open_helper('/some/path', 'r')  # Passes type check
      open_helper('/other/path', 'typo')  # Error in type checker

   Literal[...] cannot be subclassed. At runtime, an arbitrary value
   is allowed as type argument to Literal[...], but type checkers may
   impose restrictions.
    c@s>eZdZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)rz-Internal wrapper to hold a forward reference.)�__forward_arg__�__forward_code__�__forward_evaluated__�__forward_value__�__forward_is_argument__TcCsnt|t�std|����zt|dd�}Wn"tk
rJtd|����YnX||_||_d|_d|_||_	dS)Nz*Forward reference must be a string -- got z<string>�evalz/Forward reference must be an expression -- got F)
rPrQrT�compile�SyntaxErrorr�r�r�r�r�)r�rWrY�coderZrZr[r��s
zForwardRef.__init__cCsj|jr||k	rd|dkr(|dkr(i}}n|dkr6|}n|dkrB|}tt|j||�d|jd�|_d|_|jS)Nz*Forward references must evaluate to types.�rYT)r�r\r�r�r�r�)r�r�r�rZrZr[r��s
�zForwardRef._evaluatecCs>t|t�stS|jr2|jr2|j|jko0|j|jkS|j|jkSr�)rPrr�r�r�r�r�rZrZr[r�s

�zForwardRef.__eq__cCs
t|j�Sr�)r�r�r�rZrZr[r�szForwardRef.__hash__cCsd|j�d�S)NzForwardRef(�))r�r�rZrZr[r�szForwardRef.__repr__N)T)
rbr^r_r�r�r�r�r�r�r�rZrZrZr[r�s

c@s6eZdZdZdZdddd�dd�Zdd	�Zd
d�ZdS)ra�Type variable.

    Usage::

      T = TypeVar('T')  # Can be anything
      A = TypeVar('A', str, bytes)  # Must be str or bytes

    Type variables exist primarily for the benefit of static type
    checkers.  They serve as the parameters for generic types as well
    as for generic function definitions.  See class Generic for more
    information on generic types.  Generic functions work as follows:

      def repeat(x: T, n: int) -> List[T]:
          '''Return a list containing n references to x.'''
          return [x]*n

      def longest(x: A, y: A) -> A:
          '''Return the longest of two strings.'''
          return x if len(x) >= len(y) else y

    The latter example's signature is essentially the overloading
    of (str, str) -> str and (bytes, bytes) -> bytes.  Also note
    that if the arguments are instances of some subclass of str,
    the return type is still plain str.

    At runtime, isinstance(x, T) and issubclass(C, T) will raise TypeError.

    Type variables defined with covariant=True or contravariant=True
    can be used to declare covariant or contravariant generic types.
    See PEP 484 for more details. By default generic types are invariant
    in all type variables.

    Type variables can be introspected. e.g.:

      T.__name__ == 'T'
      T.__constraints__ == ()
      T.__covariant__ == False
      T.__contravariant__ = False
      A.__constraints__ == (str, bytes)

    Note that only type variables defined in global scope can be pickled.
    )rb�	__bound__�__constraints__�
__covariant__�__contravariant__NF)�bound�	covariant�
contravariantc	s�||_|r|rtd��t|�|_t|�|_|r>|dk	r>td��|rVt|�dkrVtd��d�t�fdd�|D��|_|r�t	|d�|_
nd|_
zt�d�j
�d	d
�}Wnttfk
r�d}YnX|dkr�||_dS)Nz"Bivariant types are not supported.z-Constraints cannot be combined with bound=...r~z"A single constraint is not allowedz:TypeVar(name, constraint, ...): constraints must be types.c3s|]}t|��VqdSr�r�rfr�rZr[r�Vsz#TypeVar.__init__.<locals>.<genexpr>zBound must be a type.rb�__main__�typing)rb�
ValueError�boolr�r�rTrzrpr�r\r��sys�	_getframe�	f_globals�get�AttributeErrorr^)r�r�r�r�r�ZconstraintsZdef_modrZr�r[r�Js(


zTypeVar.__init__cCs&|jrd}n|jrd}nd}||jS)N�+�-�~)r�r�rb)r��prefixrZrZr[r�bszTypeVar.__repr__cCs|jSr�)rbr�rZrZr[r�kszTypeVar.__reduce__)rbr^r_r�r�r�r�r�rZrZrZr[rs+�	)	rrrp�dictr�	frozenset�deque�defaultdictrOr;cCs|�d�o|�d�S)N�__)�
startswith�endswith)�attrrZrZr[�
_is_dunder�sr�cs�eZdZdZdddd�dd�Zedd	��Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
�fdd�Zdd�Zdd�Zdd�Z�ZS) rRa�The central part of internal API.

    This represents a generic version of type 'origin' with type arguments 'params'.
    There are two kind of these aliases: user defined and special. The special ones
    are wrappers around builtin collections and ABCs in collections.abc. These must
    have 'name' always set. If 'inst' is False, then the alias can't be instantiated,
    this is used by e.g. typing.List and typing.Dict.
    TFN)�inst�specialr�cCsz||_||_|r*|dkr*|j}t�||�}||_t|t�s@|f}||_tdd�|D��|_	t
|�|_d|_|sv|j
|_
dS)Ncss*|]"}|tkrdn|tkrdn|VqdS).rZN)�_TypingEllipsis�_TypingEmptyr�rZrZr[r��s�z)_GenericAlias.__init__.<locals>.<genexpr>)�_instrmrb�_normalize_aliasr�r�rPrprSrsrqror�r^)r��originr�r�r�r�Z	orig_namerZrZr[r��s 
�

z_GenericAlias.__init__cs^|jttfkrtd|����t|t�s,|f}d�t�fdd�|D��}t||�t||j|�S)Nz%Cannot subscript already-subscripted �*Parameters to generic types must be types.c3s|]}t|��VqdSr�r�r�r�rZr[r��sz,_GenericAlias.__getitem__.<locals>.<genexpr>)	rSrrrTrPrpr}ruro�r�r�rZr�r[r��s

z_GenericAlias.__getitem__cCst|j||j|jd�S)N)r�r�)rRrSr�r�r�rZrZr[rv�sz_GenericAlias.copy_withcCs�|jdks&t|j�dkrx|jdtkrx|jr8d|j}n
t|j�}|jshdd�dd�|jD���d	�}nd
}|�|��S|jr�dSdd�d
d�|jdd�D���dt|jd��d	�S)Nr�rr��[�, cSsg|]}t|��qSrZ�rer�rZrZr[rk�sz*_GenericAlias.__repr__.<locals>.<listcomp>�]�ztyping.Callableztyping.Callable[[cSsg|]}t|��qSrZr�r�rZrZr[rk�s���z], )r�rzrs�EllipsisrerSrm�join)r�r�r�rZrZr[r��s
��
 z_GenericAlias.__repr__cCsRt|t�stS|j|jkrdS|jtkrF|jtkrFt|j�t|j�kS|j|jkS)NF)rPrRr�rSrr�rsr�rZrZr[r��s
z_GenericAlias.__eq__cCs,|jtkrttt|j�f�St|j|jf�Sr�)rSrr�r�rsr�rZrZr[r��s
z_GenericAlias.__hash__cOsT|js$td|j�d|j���d���|j||�}z
||_Wntk
rNYnX|S)N�Type z cannot be instantiated; use z
() instead)r�rTr��lowerrS�__orig_class__r�)r�r��kwargs�resultrZrZr[r��s
z_GenericAlias.__call__cCs�|jrZg}|j|kr |�|j�|�|�}tdd�||dd�D��sR|�t�t|�S|jtkr�t|krpdS|�|�}||dd�D]}t|t	�r�||k	r�dSq�|jfS)Ncss"|]}t|t�pt|t�VqdSr�)rPrR�
issubclassr�rg�brZrZr[r��s�z0_GenericAlias.__mro_entries__.<locals>.<genexpr>r~rZ)
r�rSrl�index�anyrrprrPrR)r��basesr�ryrrZrZr[�__mro_entries__�s$

�


z_GenericAlias.__mro_entries__cCs*d|jkrt|�st|j|�St|��dS)NrS)�__dict__r��getattrrSr�)r�r�rZrZr[�__getattr__�sz_GenericAlias.__getattr__cs2t|�s|dkr t��||�nt|j||�dS)N)r�r�rm)r�r��__setattr__�setattrrS)r�r��valr�rZr[r�sz_GenericAlias.__setattr__cCs|�t|��Sr�)r�rOr�rZrZr[r�sz_GenericAlias.__instancecheck__cCs<|jr0t|t�st||j�S|jr0t|j|j�Std��dS)NzBSubscripted generics cannot be used with class and instance checks)rmrPrRrrSrTr�rZrZr[r�s
z_GenericAlias.__subclasscheck__cCs�|jr|jS|jr t�|j}n|j}|tkrht|j�dkrJ|jdtksht|jdd��|jdf}n*t	|j�}t|�dkr�t
|dt	�s�|\}tj||ffS)Nr�rr�r~)
rmr��globalsrSrrzrsr�rrrprP�operator�getitem)r�r�r�rZrZr[r�s��
z_GenericAlias.__reduce__)rbr^r_r�r�r�r�rvr�r�r�r�rrrr�r�r�r�rZrZr�r[rR�s
		rRcs,eZdZdZdd�Ze�fdd��Z�ZS)�_VariadicGenericAliasz�Same as _GenericAlias above but for variadic aliases. Currently,
    this is used only by special internal aliases: Tuple and Callable.
    cCs�|jdks|js|�|�St|t�r0t|�dkr8td��|\}}|tkrRt|f}n$t|t�sjtd|����t|�|f}|�|�S)Nrr�z6Callable must be used as Callable[[arg, ...], result].z1Callable[args, result]: args must be a list. Got )	r�rm�__getitem_inner__rPrprzrTr�rr)r�r�r�rrZrZr[r�"s


z!_VariadicGenericAlias.__getitem__cs
|jtkr�|jr�|dkr$|�tf�St|t�s4|f}t|�dkrl|ddkrld�t|d��}|�|tf�Sd�t�fdd	�|D��}|�|�S|jt	j
jkr�|jr�|\}}d
�t|��}|tkr�|�t|f�Sd�t�fdd	�|D��}||f}|�|�St
��|�S)
NrZr�r~.z Tuple[t, ...]: t must be a type.rz*Tuple[t0, t1, ...]: each t must be a type.c3s|]}t|��VqdSr�r�r�r�rZr[r�>sz:_VariadicGenericAlias.__getitem_inner__.<locals>.<genexpr>z.Callable[args, result]: result must be a type.z6Callable[[arg, ...], result]: each arg must be a type.c3s|]}t|��VqdSr�r�)rgrWr�rZr[r�Gs)rSrprmrvr�rPrzr\r��collections�abcrr�r�r�)r�r�r�r�rr�r�r[r2s.




z'_VariadicGenericAlias.__getitem_inner__)rbr^r_r�r�r�rr�rZrZr�r[rsrcs@eZdZdZdZdZ�fdd�Zedd��Z�fdd	�Z	�Z
S)
raCAbstract base class for generic types.

    A generic type is typically declared by inheriting from
    this class parameterized with one or more type variables.
    For example, a generic mapping type might be defined as::

      class Mapping(Generic[KT, VT]):
          def __getitem__(self, key: KT) -> VT:
              ...
          # Etc.

    This class can then be used as follows::

      def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
          try:
              return mapping[key]
          except KeyError:
              return default
    rZFcs^|ttfkrtd|j�d���t�jtjkrF|jtjk	rFt��|�}nt�j|f|�|�}|S)Nrz< cannot be instantiated; it can be used only as a base class)rrrTrbr�r��objectr�)r{r�r�rdr�rZr[r�dszGeneric.__new__cs�t|t�s|f}|s.|tk	r.td|j�d���d�t�fdd�|D��}|ttfkr�tdd�|D��sxtd|j�d���t	t
|��t	|�kr�td|j�d	���n
t||�t||�S)
NzParameter list to z[...] cannot be emptyr�c3s|]}t|��VqdSr�r�r�r�rZr[r�vsz,Generic.__class_getitem__.<locals>.<genexpr>css|]}t|t�VqdSr�)rPrr�rZrZr[r�yszParameters to z [...] must all be type variablesz[...] must all be unique)
rPrprrTr_rr�allrbrzrr}rR)r{r�rZr�r[�__class_getitem__ns&
���
zGeneric.__class_getitem__c
s
t�j||�g}d|jkr(t|jk}nt|jko:|jdk}|rHtd��d|jkr�t|j�}d}|jD].}t	|t
�rf|jtkrf|dk	r�td��|j}qf|dk	r�t
|�}t
|��|�ks�d��fdd�|D��}d�dd�|D��}	td	|�d
|	�d���|}t|�|_dS)N�__orig_bases__rz!Cannot inherit from plain Genericz0Cannot inherit from Generic[...] multiple types.r�c3s|]}|�krt|�VqdSr��rQrf�ZgvarsetrZr[r��sz,Generic.__init_subclass__.<locals>.<genexpr>css|]}t|�VqdSr�r)rg�grZrZr[r��szSome type variables (z) are not listed in Generic[r�)r�r�r
rr�	__bases__rbrTrqrPrRrSrorrrp)
r{r�rrj�errorZgvars�baseZtvarsetZs_varsZs_argsr�rr[r��s8




��zGeneric.__init_subclass__)rbr^r_r�r��_is_protocolr�r�rr�r�rZrZr�r[rMs

c@seZdZdZdS)r�z�Internal placeholder for () or []. Used by TupleMeta and CallableMeta
    to allow empty list/tuple in specific places, without allowing them
    to sneak in where prohibited.
    N�rbr^r_r�rZrZrZr[r��sr�c@seZdZdZdS)r�z(Internal placeholder for ... (ellipsis).Nr%rZrZrZr[r��sr�rorrr$�_is_runtime_protocol�__abstractmethods__�__annotations__r
r�r�r^r�r��__subclasshook__r��_MutableMapping__markercCsrt�}|jdd�D]X}|jdkr$qt|di�}t|j���t|���D] }|�d�sJ|tkrJ|�	|�qJq|S)z�Collect protocol members from a protocol class objects.

    This includes names actually defined in the class dictionary, as well
    as names that appear in annotations. Special names (above) are skipped.
    Nr�)rrr(Z_abc_)
r�__mro__rbrrrr
�keysr��EXCLUDED_ATTRIBUTES�add)r{�attrsr#�annotationsr�rZrZr[�_get_protocol_attrs�s
r1cst�fdd�t��D��S)Nc3s|]}tt�|d��VqdSr�)rVr�rgr��r{rZr[r��sz,_is_callable_members_only.<locals>.<genexpr>)rr1r3rZr3r[�_is_callable_members_only�sr4cOst|�jrtd��dS)Nz Protocols cannot be instantiated)rOr$rT)r�r�rrZrZr[�_no_init�s
r5c	Cs6zt�d�jddkWSttfk
r0YdSXdS)z�Allow instnance and class checks for special stdlib modules.

    The abc and functools modules indiscriminately call isinstance() and
    issubclass() on the whole MRO of a user class, which may contain protocols.
    r�rb)rr�TN)r�r�r�r�r�rZrZrZr[�_allow_reckless_class_cheks�sr6�AbstractContextManager�AbstractAsyncContextManager)zcollections.abc�
contextlibcseZdZ�fdd�Z�ZS)�
_ProtocolMetacsVt�dd�rt��r$t�j��r$dS�jrJt��fdd�t��D��rJdSt����S)Nr$FTc3s8|]0}t�|�o.tt�|d��p.t�|�dk	VqdSr�)�hasattrrVrr2�r{�instancerZr[r��s�
z2_ProtocolMeta.__instancecheck__.<locals>.<genexpr>)	rr4rr�r$rr1r�r�r<r�r<r[r��s�
��z_ProtocolMeta.__instancecheck__)rbr^r_r�r�rZrZr�r[r:�sr:cs,eZdZdZdZdZdZ�fdd�Z�ZS)raZBase class for protocol classes.

    Protocol classes are defined as::

        class Proto(Protocol):
            def meth(self) -> int:
                ...

    Such classes are primarily used with static type checkers that recognize
    structural subtyping (static duck-typing), for example::

        class C:
            def meth(self) -> int:
                return 0

        def func(x: Proto) -> int:
            return x.meth()

        func(C())  # Passes static type check

    See PEP 544 for details. Protocol classes decorated with
    @typing.runtime_checkable act as simple-minded runtime protocols that check
    only the presence of given attributes, ignoring their type signatures.
    Protocol classes can be generic, they are defined as::

        class GenProto(Protocol[T]):
            def meth(self) -> T:
                ...
    rZTFcs�t�j||��j�dd�s2tdd��jD���_�fdd�}d�jkrN|�_�jsXdS�jD]F}|tt	fks^|j
tkr�|jt|j
ks^t
|t	�r�|js^td|��q^t�_dS)	Nr$Fcss|]}|tkVqdSr�)rrrZrZr[r�)sz-Protocol.__init_subclass__.<locals>.<genexpr>cs��j�dd�stSt�dd�s0t�r(tStd��t��sJt�rBtStd��t|t�s\td��t	��D]v}|j
D]b}||jkr�|j|dkr�tSqdt|di�}t|tjj
�rn||krnt|t�rn|jrnqdqntSqddS)	Nr$Fr&zLInstance and class checks can only be used with @runtime_checkable protocolsz<Protocols with non-method members don't support issubclass()z"issubclass() arg 1 must be a classr(T)r
r�r�rr6rTr4rPrOr1r+rrrrrr$)r�r�r#r0r3rZr[�_proto_hook,s:


���
z/Protocol.__init_subclass__.<locals>._proto_hookr)z7Protocols can only inherit from other protocols, got %r)r�r�r
r�r
r!r$r)rrr^�_PROTO_WHITELISTrbrrTr5r�)r{r�rr>r#r�r3r[r�$s,&

�����zProtocol.__init_subclass__)	rbr^r_r�r�r$r&r�r�rZrZr�r[rs
)�	metaclasscCs&t|t�r|jstd|��d|_|S)a9Mark a protocol class as a runtime protocol.

    Such protocol can be used with isinstance() and issubclass().
    Raise TypeError if applied to a non-protocol class.
    This allows a simple-minded structural check very similar to
    one trick ponies in collections.abc such as Iterable.
    For example::

        @runtime_checkable
        class Closable(Protocol):
            def close(self): ...

        assert isinstance(open('/some/file'), Closable)

    Warning: this will check only the presence of the required methods,
    not their type signatures!
    zB@runtime_checkable can be only applied to protocol classes, got %rT)rrr$rTr&r3rZrZr[rKds�cCs|S)z�Cast a value to a type.

    This returns the value unchanged.  To the type checker this
    signals that the return value has the designated type, but at
    runtime we intentionally don't check anything (we want this
    to be as fast as possible).
    rZ)�typrrZrZr[rA}sc
Cs�z
|j}Wntk
r"iYSX|j}|j}|d|�}|jpDd}|j}|rXt|�ni}|t|�}t||d�|�D]\}}	||ks�t	�|	||<qz|S)z:Internal helper to extract the default arguments, by name.NrZ)
�__code__r��co_argcount�co_varnames�__defaults__�__kwdefaults__r�rz�zipr�)
r�r�Z	pos_countZ	arg_names�defaultsZ
kwdefaultsr�Z
pos_offsetr��valuerZrZr[�
_get_defaults�s



rJcCs�t|dd�riSt|t�r�i}t|j�D]z}|dkrDtj|jj}n|}|j�	di�}|�
�D]B\}}|dkrvtd�}t|t�r�t|dd�}t
|||�}|||<q^q(|S|dkr�t|tj�r�|j}n"|}	t|	d�r�|	j}	q�t|	di�}|dkr�|}n|dk�r|}t|dd�}|dk�r6t|t��r(iStd�|���t|�}
t|�}|�
�D]d\}}|dk�rhtd�}t|t��r|t|�}t
|||�}||
k�r�|
|dk�r�t|}|||<�qN|S)	a�Return type hints for an object.

    This is often the same as obj.__annotations__, but it handles
    forward references encoded as string literals, and if necessary
    adds Optional[t] if a default value equal to None is set.

    The argument may be a module, class, method, or function. The annotations
    are returned as a dictionary. For classes, annotations include also
    inherited members.

    TypeError is raised if the argument is not of a type that can contain
    annotations, and an empty dictionary is returned if no annotations are
    present.

    BEWARE -- the behavior of globalns and localns is counterintuitive
    (unless you are familiar with how eval() and exec() work).  The
    search order is locals first, then globals.

    - If no dict arguments are passed, an attempt is made to use the
      globals from obj (or the respective module's globals for classes),
      and these are also used as the locals.  If the object does not appear
      to have globals, an empty dictionary is used.

    - If one dict argument is passed, it is used for both globals and
      locals.

    - If two dict arguments are passed, they specify globals and
      locals, respectively.
    �__no_type_check__Nr(Fr��__wrapped__�__globals__z1{!r} is not a module, class, method, or function.)rrPrO�reversedr+r��modulesr^r
r��itemsrQrr�r`�
ModuleTyper;rL�_allowed_typesrT�formatrJr�r)rdr�r�Zhintsr#Zbase_globals�annr�rIZnsobjrHrZrZr[rE�s^




�
cCs t|t�r|jS|tkrtSdS)a�Get the unsubscripted version of a type.

    This supports generic types, Callable, Tuple, Union, Literal, Final and ClassVar.
    Return None for unsupported types. Examples::

        get_origin(Literal[42]) is Literal
        get_origin(int) is None
        get_origin(ClassVar[int]) is ClassVar
        get_origin(Generic) is Generic
        get_origin(Generic[T]) is Generic
        get_origin(Union[T, int]) is Union
        get_origin(List[Tuple[T, T]][int]) == list
    N)rPrRrSr)rwrZrZr[rD�s

cCsRt|t�rN|jsN|j}t|�tjjkrJ|dtk	rJt	|dd��|df}|SdS)a�Get type arguments with all substitutions performed.

    For unions, basic simplifications used by Union constructor are performed.
    Examples::
        get_args(Dict[str, int]) == (str, int)
        get_args(int) == ()
        get_args(Union[int, Union[T, int], str][int]) == (int, str)
        get_args(Union[int, Tuple[T, int]][str]) == (int, Tuple[str, int])
        get_args(Callable[[], T][int]) == ([], int)
    rNr�rZ)
rPrRrmrsrDrrrr�rr)rwr�rZrZr[rCscCs�t|t�rt|j��}|j��D]"\}}||j|fkr|�|�q|��D](}t|tj	�r`d|_
t|t�rJt|�qJz
d|_
Wntk
r�YnX|S)aIDecorator to indicate that annotations are not type hints.

    The argument must be a class or function; if it is a class, it
    applies recursively to all methods and classes defined in that class
    (but not to methods defined in its superclasses or subclasses).

    This mutates the function(s) or class(es) in place.
    T)
rPrOr
�copyrPr!�pop�valuesr`rarKrGrT)rWZ	arg_attrsr�rrdrZrZr[rGs	




cst����fdd��}|S)z�Decorator to give another decorator the @no_type_check effect.

    This wraps the decorator with something that wraps the decorated
    function in @no_type_check.
    cs�||�}t|�}|Sr�)rG)r�r�r���	decoratorrZr[�wrapped_decorator@s
z2no_type_check_decorator.<locals>.wrapped_decorator)r�r�)rYrZrZrXr[rH9scOstd��dS)z*Helper for @overload to raise when called.z�You should not call an overloaded function. A series of @overload-decorated functions outside a stub module should always be followed by an implementation that is not @overload-ed.N)�NotImplementedErrorr�rZrZr[�_overload_dummyIs�r\cCstS)a
Decorator for overloaded functions/methods.

    In a stub file, place two or more stub definitions for the same
    function in a row, each decorated with @overload.  For example:

      @overload
      def utf8(value: None) -> None: ...
      @overload
      def utf8(value: bytes) -> bytes: ...
      @overload
      def utf8(value: str) -> bytes: ...

    In a non-stub file (i.e. a regular .py file), do the same but
    follow it with an implementation.  The implementation should *not*
    be decorated with @overload.  For example:

      @overload
      def utf8(value: None) -> None: ...
      @overload
      def utf8(value: bytes) -> bytes: ...
      @overload
      def utf8(value: str) -> bytes: ...
      def utf8(value):
          # implementation goes here
    )r\)r�rZrZr[rJRscCs|S)aVA decorator to indicate final methods and final classes.

    Use this decorator to indicate to type checkers that the decorated
    method cannot be overridden, and decorated class cannot be subclassed.
    For example:

      class Base:
          @final
          def done(self) -> None:
              ...
      class Sub(Base):
          def done(self) -> None:  # Error reported by type checker
                ...

      @final
      class Leaf:
          ...
      class Other(Leaf):  # Error reported by type checker
          ...

    There is no runtime checking of these properties.
    rZ)�frZrZr[rBos�T�KT�VT�T_co)r��V_co�VT_co�T_contra)r��CT_co)r�r�cCst||d|d�S)NT)r�r�)rR)r�r�r�rZrZr[�_alias�srfrZ)r�a�Callable type; Callable[[int], str] is a function of (int) -> str.

    The subscription syntax must always be used with exactly two
    values: the argument list and the return type.  The argument list
    must be a list of types or ellipsis; the return type must be a single type.

    There is no syntax to indicate optional or keyword arguments,
    such function types are rarely used as callback types.
    F)r�r�a@Tuple type; Tuple[X, Y] is the cross-product type of X and Y.

    Example: Tuple[T1, T2] is a tuple of two elements corresponding
    to type variables T1 and T2.  Tuple[int, float, str] is a tuple
    of an int, a float and a string.

    To specify a variable-length tuple of homogeneous type, use Tuple[T, ...].
    )r�a�A special construct usable to annotate class objects.

    For example, suppose we have the following classes::

      class User: ...  # Abstract base for User classes
      class BasicUser(User): ...
      class ProUser(User): ...
      class TeamUser(User): ...

    And a function that takes a class argument that's a subclass of
    User and returns an instance of the corresponding class::

      U = TypeVar('U', bound=User)
      def new_user(user_class: Type[U]) -> U:
          user = user_class()
          # (Here we could write the user object to a database)
          return user

      joe = new_user(BasicUser)

    At this point the type checker knows that joe has type BasicUser.
    c@s&eZdZdZdZeed�dd��ZdS)r2z(An ABC with one abstract method __int__.rZ��returncCsdSr�rZr�rZrZr[�__int__�szSupportsInt.__int__N)rbr^r_r�r�r�intrirZrZrZr[r2�sc@s&eZdZdZdZeed�dd��ZdS)r0z*An ABC with one abstract method __float__.rZrgcCsdSr�rZr�rZrZr[�	__float__szSupportsFloat.__float__N)rbr^r_r�r�r�floatrkrZrZrZr[r0�sc@s&eZdZdZdZeed�dd��ZdS)r/z,An ABC with one abstract method __complex__.rZrgcCsdSr�rZr�rZrZr[�__complex__
szSupportsComplex.__complex__N)rbr^r_r�r�r�complexrmrZrZrZr[r/sc@s&eZdZdZdZeed�dd��ZdS)r.z*An ABC with one abstract method __bytes__.rZrgcCsdSr�rZr�rZrZr[�	__bytes__szSupportsBytes.__bytes__N)rbr^r_r�r�r�bytesrorZrZrZr[r.sc@s&eZdZdZdZeed�dd��ZdS)r1z*An ABC with one abstract method __index__.rZrgcCsdSr�rZr�rZrZr[�	__index__szSupportsIndex.__index__N)rbr^r_r�r�rrjrqrZrZrZr[r1sc@s&eZdZdZdZeed�dd��ZdS)r-zMAn ABC with one abstract method __abs__ that is covariant in its return type.rZrgcCsdSr�rZr�rZrZr[�__abs__(szSupportsAbs.__abs__N)rbr^r_r�r�rrarrrZrZrZr[r-#sc@s*eZdZdZdZedeed�dd��ZdS)	r3zOAn ABC with one abstract method __round__ that is covariant in its return type.rZr)�ndigitsrhcCsdSr�rZ)r�rsrZrZr[�	__round__2szSupportsRound.__round__N)r)	rbr^r_r�r�rrjrartrZrZrZr[r3-sc	std��fdd�|D�}t�|dd�|D��}t|�|_|_zt�d�j�dd�|_	Wnt
tfk
rnYnX|S)NzDNamedTuple('Name', [(f0, t0), (f1, t1), ...]); each t must be a typecsg|]\}}|t|��f�qSrZr��rg�nrhr�rZr[rk9sz!_make_nmtuple.<locals>.<listcomp>cSsg|]\}}|�qSrZrZrurZrZr[rk:sr�rbr�)r�
namedtupler�r(�_field_typesr�r�r�r�r^r�r�)r�r`�nm_tplrZr�r[�
_make_nmtuple7srz)r�r�r��__getnewargs__�_fields�_field_defaultsrx�_make�_replace�_asdictZ_source)r^rbr(cseZdZ�fdd�Z�ZS)�NamedTupleMetacs�|�dd�rt��||||�S|�di�}t||���}g}i}|D]H}||krl||}	|�|	�|	||<qD|rDtdj|d�|�	��d���qDt
|�|j_t|�|j_
||_|D]<}
|
tkr�td|
��q�|
tkr�|
|jkr�t||
||
�q�|S)Nr�Fr(zXNon-default namedtuple field {field_name} cannot follow default field(s) {default_names}r�)�
field_nameZ
default_namesz&Cannot overwrite NamedTuple attribute )r�r�r�rzrPrlrTrSrr,r�r(rprEr}�_prohibitedr�rmr|r)r{�typenamer�nsr`ryrHZ
defaults_dictr�Z
default_value�keyr�rZr[r�Os2

�
zNamedTupleMeta.__new__)rbr^r_r�r�rZrZr�r[r�Msr�c@s"eZdZdZdZdd�Zde_dS)r=a�Typed version of namedtuple.

    Usage in Python versions >= 3.6::

        class Employee(NamedTuple):
            name: str
            id: int

    This is equivalent to::

        Employee = collections.namedtuple('Employee', ['name', 'id'])

    The resulting class has an extra __annotations__ attribute, giving a
    dict that maps field names to types.  (The field names are also in
    the _fields attribute, which is part of the namedtuple API.)
    Alternative equivalent keyword syntax is also accepted::

        Employee = NamedTuple('Employee', name=str, id=int)

    In Python versions <= 3.5 use::

        Employee = NamedTuple('Employee', [('name', str), ('id', int)])
    TcOs�|std��|^}}|r"|^}}n4d|krN|�d�}ddl}|jdtdd�ntd��|r�z
|\}Wq�tk
r�tdt|�d�d	��d�Yq�Xn<d
|kr�t|�dkr�|�d
�}ddl}|jdtdd�nd}|dkr�|��}n|r�td
��t||�S)Nz*NamedTuple.__new__(): not enough argumentsr�rz4Passing 'typename' as keyword argument is deprecatedr�)�
stacklevelzGNamedTuple.__new__() missing 1 required positional argument: 'typename'z@NamedTuple.__new__() takes from 2 to 3 positional arguments but z were given�fieldsr~z2Passing 'fields' as keyword argument is deprecatedzIEither list of fields or keywords can be provided to NamedTuple, not both)	rTrV�warnings�warn�DeprecationWarningr�rzrPrz)r�rr{r�r�r�rZrZr[r��sB

�
�

�
zNamedTuple.__new__z*($cls, typename, fields=None, /, **kwargs)N)rbr^r_r�r�r��__text_signature__rZrZrZr[r=ls#cOs
t||�Sr�)r�)r{r�rrZrZr[�	_dict_new�sr�)�totalc	Ksj|dkr|}n|rtd��t|�|d�}zt�d�j�dd�|d<Wnttfk
r\YnXt|d|�S)Nz@TypedDict takes either a dict or keyword arguments, but not both)r(�	__total__r~rbr�r^rZ)	rTr�r�r�r�r�r�r��_TypedDictMeta)r{r�r�r�rr�rZrZr[�_typeddict_new�sr�cCstd��dS)Nz4TypedDict does not support instance and class checksr�)r{r�rZrZr[�_check_fails�sr�cs&eZdZd�fdd�	ZeZZ�ZS)r�Tcs�|dkrtnt|d<tt|��||tf|�}|�di�}d��fdd�|��D�}|D]}|�|j	�di��qV||_
t|d�s�||_|S)agCreate new typed dict class object.

        This method is called directly when TypedDict is subclassed,
        or via _typeddict_new when TypedDict is instantiated. This way
        TypedDict supports all three syntax forms described in its docstring.
        Subclasses and instances of TypedDict return actual dictionaries
        via _dict_new.
        r>r�r(z?TypedDict('Name', {f0: t0, f1: t1, ...}); each t must be a typecsi|]\}}|t|���qSrZr�)rgrvrwr�rZr[�
<dictcomp>�sz*_TypedDictMeta.__new__.<locals>.<dictcomp>r�)
r�r�r�r�r�r�r�rP�updater
r(r;r�)r{r�rr�r�Ztp_dictZannsr#r�r�r[r��s	
z_TypedDictMeta.__new__)T)rbr^r_r�r�r�r�r�rZrZr�r[r��sr�c@seZdZdZdS)r>a�A simple typed namespace. At runtime it is equivalent to a plain dict.

    TypedDict creates a dictionary type that expects all of its
    instances to have a certain set of keys, where each key is
    associated with a value of a consistent type. This expectation
    is not checked at runtime but is only enforced by type checkers.
    Usage::

        class Point2D(TypedDict):
            x: int
            y: int
            label: str

        a: Point2D = {'x': 1, 'y': 2, 'label': 'good'}  # OK
        b: Point2D = {'z': 3, 'label': 'bad'}           # Fails type check

        assert Point2D(x=1, y=2, label='first') == dict(x=1, y=2, label='first')

    The type info can be accessed via Point2D.__annotations__. TypedDict
    supports two additional equivalent forms::

        Point2D = TypedDict('Point2D', x=int, y=int, label=str)
        Point2D = TypedDict('Point2D', {'x': int, 'y': int, 'label': str})

    By default, all keys must be present in a TypedDict. It is possible
    to override this by specifying totality.
    Usage::

        class point2D(TypedDict, total=False):
            x: int
            y: int

    This means that a point2D TypedDict can have any of the keys omitted.A type
    checker is only expected to support a literal False or True as the value of
    the total argument. True is the default, and makes all items defined in the
    class body be required.

    The class syntax is only supported in Python 3.6+, while two other
    syntax forms work for Python 2.7 and 3.2+
    Nr%rZrZrZr[r>�scCsdd�}||_||_|S)a%NewType creates simple unique types with almost zero
    runtime overhead. NewType(name, tp) is considered a subtype of tp
    by static type checkers. At runtime, NewType(name, tp) returns
    a dummy function that simply returns its argument. Usage::

        UserId = NewType('UserId', int)

        def name_by_id(user_id: UserId) -> str:
            ...

        UserId('user')          # Fails type check

        name_by_id(42)          # Fails type check
        name_by_id(UserId(42))  # OK

        num = UserId(5) + 1     # type: int
    cSs|Sr�rZ)�xrZrZr[�new_typeszNewType.<locals>.new_type)rbZ
__supertype__)r�rwr�rZrZr[rFsc@s�eZdZdZdZeeed�dd���Zeeed�dd���Z	edd�d	d
��Z
eeed�dd���Zee
d�d
d��Zedd�dd��Zeed�dd��Zed7e
ed�dd��Zeed�dd��Zed8e
ed�dd��Zed9e
eed�dd��Zed:e
e
e
d �d!d"��Zeed�d#d$��Zee
d�d%d&��Zed;e
e
d'�d(d)��Zeed�d*d+��Zeee
d,�d-d.��Zeeedd/�d0d1��Zed2d�d3d4��Zedd�d5d6��ZdS)<�IOa�Generic base class for TextIO and BinaryIO.

    This is an abstract, generic version of the return of open().

    NOTE: This does not distinguish between the different possible
    classes (text vs. binary, read vs. write vs. read/write,
    append-only, unbuffered).  The TextIO and BinaryIO subclasses
    below capture the distinctions between text vs. binary, which is
    pervasive in the interface; however we currently do not offer a
    way to track the other distinctions in the type system.
    rZrgcCsdSr�rZr�rZrZr[�mode=szIO.modecCsdSr�rZr�rZrZr[r�BszIO.nameNcCsdSr�rZr�rZrZr[�closeGszIO.closecCsdSr�rZr�rZrZr[�closedKsz	IO.closedcCsdSr�rZr�rZrZr[�filenoPsz	IO.filenocCsdSr�rZr�rZrZr[�flushTszIO.flushcCsdSr�rZr�rZrZr[�isattyXsz	IO.isattyr�)rvrhcCsdSr�rZ)r�rvrZrZr[�read\szIO.readcCsdSr�rZr�rZrZr[�readable`szIO.readable)�limitrhcCsdSr�rZ)r�r�rZrZr[�readlinedszIO.readline)�hintrhcCsdSr�rZ)r�r�rZrZr[�	readlineshszIO.readlinesr)�offset�whencerhcCsdSr�rZ)r�r�r�rZrZr[�seeklszIO.seekcCsdSr�rZr�rZrZr[�seekablepszIO.seekablecCsdSr�rZr�rZrZr[�telltszIO.tell)�sizerhcCsdSr�rZ)r�r�rZrZr[�truncatexszIO.truncatecCsdSr�rZr�rZrZr[�writable|szIO.writable��srhcCsdSr�rZ�r�r�rZrZr[�write�szIO.write)�linesrhcCsdSr�rZ)r�r�rZrZr[�
writelines�sz
IO.writelinesz
IO[AnyStr]cCsdSr�rZr�rZrZr[�	__enter__�szIO.__enter__cCsdSr�rZ)r�rOrI�	tracebackrZrZr[�__exit__�szIO.__exit__)r�)r�)r�)r)N) rbr^r_r�r��propertyrrQr�r�r�r�r�rjr�r�r�r@r�r�r�r9r�r�r�r�r�r�r�r�r�r�rZrZrZr[r�.sZr�c@sBeZdZdZdZeeeefe	d�dd��Z
edd�dd��Zd	S)
�BinaryIOz5Typed version of the return of open() in binary mode.rZr�cCsdSr�rZr�rZrZr[r��szBinaryIO.writergcCsdSr�rZr�rZrZr[r��szBinaryIO.__enter__N)rbr^r_r�r�rrrp�	bytearrayrjr�r�rZrZrZr[r��sr�c@s�eZdZdZdZeeed�dd���Zeee	d�dd���Z
eeee	d�dd	���Zeee
d�d
d���Zeeed�dd
���Zedd�dd��ZdS)�TextIOz3Typed version of the return of open() in text mode.rZrgcCsdSr�rZr�rZrZr[�buffer�sz
TextIO.buffercCsdSr�rZr�rZrZr[�encoding�szTextIO.encodingcCsdSr�rZr�rZrZr[�errors�sz
TextIO.errorscCsdSr�rZr�rZrZr[�line_buffering�szTextIO.line_bufferingcCsdSr�rZr�rZrZr[�newlines�szTextIO.newlinescCsdSr�rZr�rZrZr[r��szTextIO.__enter__N)rbr^r_r�r�r�rr�r�rQr�rr�r�r�rr�r�rZrZrZr[r��s&r�c@s&eZdZdZdddgZeZeZeZdS)�ioz)Wrapper namespace for IO generic classes.r�r�r�N)rbr^r_r��__all__r�r�r�rZrZrZr[r��s

r�z.ioc@s eZdZdZddgZeZeZdS)�rez&Wrapper namespace for re type aliases.�Pattern�MatchN)rbr^r_r�r�r�r�rZrZrZr[r��sr�z.re)T)NN)T)N)�r�rrrrZcollections.abcr9r�rr�Z	stdlib_rer�r`rrrr�r\rerqrur}r�r�r�r�r�r�rUrrIr	r
rrr
rrr�r�rRrrr�r�Z_TYPING_INTERNALSZ_SPECIAL_NAMESr-r1r4r5r6r?r:rrKrArJra�BuiltinFunctionType�
MethodTyperQrRrErDrCrGrHr\rJrBr^r_r`rarbrcrdrOrerprQr@rfrr%r(r'r&rrr,r#rr)rr;rr!rrr"r rrprrrr9r�r6rr�r<rrrr$r7rr8r+r�r7r�r8r:r5r4r?r*rr2r0r/r.r1r-r3rzr�rmr�r=r�r�r�r�r>rFrLrMr�r�r�r�rbrOr�r�rZrZrZr[�<module>s(�X
!
	
I��
�����2a�
/[����	b�
V	
�
�	�							@+c#	

__pycache__/mailcap.cpython-38.opt-2.pyc000064400000013007151153537560013766 0ustar00U

e5dk#�@s�ddlZddlZddlZddgZdd�Ze�d�jZGdd�de�Z	d	d�Z
d
d�Zdd
�Zdd�Z
dd�Zdd�Zddgfdd�Zd"dd�Zgfdd�Zdd�Zdd�Zdd �Zed!kr�e�dS)#�N�getcaps�	findmatchcCsd|krd|dfSdSdS)N�linenor)�r�)�entryrr�/usr/lib64/python3.8/mailcap.py�lineno_sort_key
sr	z[^\xa1-\U0010FFFF\w@+=:,./-]c@seZdZdS)�UnsafeMailcapInputN)�__name__�
__module__�__qualname__rrrrr
sr
c
Cs�i}d}t�D]~}zt|d�}Wntk
r8YqYnX|�t||�\}}W5QRX|��D]*\}}||krz|||<q`|||||<q`q|S)Nr�r)�listmailcapfiles�open�OSError�_readmailcapfile�items)�capsrZmailcap�fpZmorecaps�key�valuerrrrs



cCsPdtjkr"tjd}|�tj�}n*dtjkr8tjd}nd}|ddddg}|S)NZMAILCAPS�HOME�.z	/.mailcapz/etc/mailcapz/usr/etc/mailcapz/usr/local/etc/mailcap)�os�environ�split�pathsep)ZpathstrZmailcaps�homerrrr3s


�rcCs t�dtd�t|d�\}}|S)Nz2readmailcapfile is deprecated, use getcaps instead�)�warnings�warn�DeprecationWarningr)rr�_rrr�readmailcapfileEs�r$c	Cs�i}|��}|sq�|ddks|��dkr,q|}|dd�dkrb|��}|sPd}|dd�|}q0t|�\}}|r|sxq|dk	r�||d<|d7}|�d	�}tt|��D]}||��||<q�d	�|���}||kr�||�|�q|g||<q||fS)
Nr�#����z\
�
rr�/)	�readline�strip�	parseliner�range�len�join�lower�append)	rrr�lineZnextliner�fields�types�jrrrrMs4	
rc
Cs�g}dt|�}}||kr>t|||�\}}|�|�|d}qt|�dkrNdS|d|d|dd�}}}d|i}|D]V}|�d�}|dkr�|}d}	n$|d|���}||dd���}	||kr�qz|	||<qz||fS)Nrrr�NN�view�=r&)r.�
parsefieldr1�findr+)
r2r3�i�n�fieldrr7�restZfkeyZfvaluerrrr,vs*

 

r,cCsP|}||kr<||}|dkr q<q|dkr2|d}q|d}q|||���|fS)N�;�\rr)r+)r2r;r<�start�crrrr9�s

r9r7z	/dev/nullc
Cs�t|�r"d|f}t�|t�dSt|||�}|D]`}d|krlt|d||�}|dkrXq2|rlt�|�dkrlq2t|||||�}	|	dk	r2|	|fSq2dS)NzHRefusing to use mailcap with filename %r. Use a safe temporary filename.r6�testr)�_find_unsafer r!r
�lookup�substr�system)
r�MIMEtyper�filename�plist�msg�entries�erC�commandrrrr�s 	
cslg}||kr|||}|�d�}|dd}||krB|||}�dk	r\�fdd�|D�}t|td�}|S)Nr)rz/*csg|]}�|kr|�qSrr)�.0rM�rrr�
<listcomp>�szlookup.<locals>.<listcomp>rP)r�sortedr	)rrHrrLZ	MIMEtypesrrPrrE�s
rEcCsRd}dt|�}}||k�rN||}|d}|dkr^|dkrT|||d�}|d}||}q||}|d}|dkr�||}q|dkr�||}q|dkr�t|�r�d|f}t�|t�dS||}q|d	k�r@|}	||kr�||d
kr�|d}q�||	|�}
|d}t|
|�}t|��r6d||
f}t�|t�dS||}q|d|}q|S)Nr&rr�%r@�s�tz9Refusing to substitute MIME type %r into a shell command.�{�}z=Refusing to substitute parameter %r (%s) into a shell command)r.rDr r!r
�	findparam)r=rHrIrJ�resr;r<rBrKrA�nameZparamrrrrF�sH










rFcCsF|��d}t|�}|D](}|d|���|kr||d�SqdS)Nr8r&)r0r.)rZrJr<�prrrrX�srXc	Cs�ddl}t�}|jdd�s(t|�dStdt|j�d�D]�}|j||d�}t|�dkrjtd�dS|d}|d}t||d|�\}}|s�tdt�q:td|�t	�
|�}|r:td|�q:dS)	Nrrrz"usage: mailcap [MIMEtype file] ...r7zNo viewer found forz
Executing:zExit status:)�sysr�argv�showr-r.�printr�typerrG)	r\rr;�argsrH�filerNrM�stsrrrrCs&

rCcCs�td�t�D]}td|�qt�|s0t�}td�t�t|�}|D]H}t|�||}|D].}t|�}|D]}td|||�qrt�qbqJdS)NzMailcap files:�	zMailcap entries:z  %-15s)r_rrrR)r�fnZckeysr`rLrM�keys�krrrr^s"
r^�__main__)N)rr �re�__all__r	�compile�searchrD�Warningr
rrr$rr,r9rrErFrXrCr^rrrrr�<module>s()

)__pycache__/contextlib.cpython-38.opt-2.pyc000064400000034406151153537560014541 0ustar00U

e5d�a�@sfddlZddlZddlZddlmZddlmZddlmZddddd	d
ddd
dddgZ	Gdd	�d	ej
�ZGdd
�d
ej
�ZGdd�de
�ZGdd�d�ZGdd�deee�ZGdd�dee�Zdd�Zdd�ZGdd�de�ZGdd�de�ZGdd�de�ZGd d�de�ZGd!d�de�ZGd"d#�d#�ZGd$d
�d
ee�ZGd%d�dee�ZGd&d�de�ZdS)'�N)�deque��wraps��
MethodType�asynccontextmanager�contextmanager�closing�nullcontext�AbstractContextManager�AbstractAsyncContextManager�AsyncExitStack�ContextDecorator�	ExitStack�redirect_stdout�redirect_stderr�suppressc@s.eZdZdd�Zejdd��Zedd��ZdS)rcCs|S�N���selfrr�"/usr/lib64/python3.8/contextlib.py�	__enter__sz AbstractContextManager.__enter__cCsdSrr�r�exc_type�	exc_value�	tracebackrrr�__exit__szAbstractContextManager.__exit__cCs|tkrt�|dd�StS)Nrr)r�_collections_abc�_check_methods�NotImplemented��cls�Crrr�__subclasshook__sz'AbstractContextManager.__subclasshook__N)	�__name__�
__module__�__qualname__r�abc�abstractmethodr�classmethodr$rrrrrs

c@s.eZdZdd�Zejdd��Zedd��ZdS)rc�s|Srrrrrr�
__aenter__'sz&AbstractAsyncContextManager.__aenter__c�sdSrrrrrr�	__aexit__+sz%AbstractAsyncContextManager.__aexit__cCs|tkrt�|dd�StS)Nr+r,)rrrr r!rrrr$0s
�z,AbstractAsyncContextManager.__subclasshook__N)	r%r&r'r+r(r)r,r*r$rrrrr#s

c@seZdZdd�Zdd�ZdS)rcCs|Srrrrrr�_recreate_cm;s
zContextDecorator._recreate_cmcst����fdd��}|S)Nc
s*�����||�W5QR�SQRXdSr)r-��args�kwds��funcrrr�innerHs
z(ContextDecorator.__call__.<locals>.innerr)rr2r3rr1r�__call__GszContextDecorator.__call__N)r%r&r'r-r4rrrrr8sc@seZdZdd�ZdS)�_GeneratorContextManagerBasecCsJ|||�|_||||_|_|_t|dd�}|dkr@t|�j}||_dS)N�__doc__)�genr2r/r0�getattr�typer6)rr2r/r0�docrrr�__init__Rs
z%_GeneratorContextManagerBase.__init__N)r%r&r'r;rrrrr5Osr5c@s$eZdZdd�Zdd�Zdd�ZdS)�_GeneratorContextManagercCs|�|j|j|j�Sr)�	__class__r2r/r0rrrrr-fsz%_GeneratorContextManager._recreate_cmcCs<|`|`|`zt|j�WStk
r6td�d�YnXdS�Nzgenerator didn't yield)r/r0r2�nextr7�
StopIteration�RuntimeErrorrrrrrls
z"_GeneratorContextManager.__enter__c
Cs|dkr8zt|j�Wntk
r,YdSXtd��n�|dkrF|�}z|j�|||�Wn�tk
r�}z||k	WY�Sd}~XYnttk
r�}z4||kr�WY�&dS|tkr�|j|kr�WY�
dS�W5d}~XYn$t��d|kr�YdS�YnXtd��dS)NF�generator didn't stop�z#generator didn't stop after throw())r?r7r@rA�throw�	__cause__�sys�exc_info)rr9�valuer�excrrrrus.


z!_GeneratorContextManager.__exit__N)r%r&r'r-rrrrrrr<as	r<c@seZdZdd�Zdd�ZdS)�_AsyncGeneratorContextManagerc�s6z|j��IdHWStk
r0td�d�YnXdSr>)r7�	__anext__�StopAsyncIterationrArrrrr+�sz(_AsyncGeneratorContextManager.__aenter__c
�s&|dkr>z|j��IdHWntk
r2YdSXtd��n�|dkrL|�}z"|j�|||�IdHtd��Wn�tk
r�}z||k	WY�Sd}~XYn�tk
r�}z:||kr�WY�,dSt|ttf�r�|j|kr�WY�
dS�W5d}~XYn0tk
�r }z||k	�r�W5d}~XYnXdS)NrBz$generator didn't stop after athrow()F)	r7rKrLrA�athrow�
isinstancer@rE�
BaseException)r�typrHrrIrrrr,�s.




z'_AsyncGeneratorContextManager.__aexit__N)r%r&r'r+r,rrrrrJ�srJcst���fdd��}|S)Ncst�||�Sr)r<r.�r2rr�helper�szcontextmanager.<locals>.helperr�r2rRrrQrr�scst���fdd��}|S)Ncst�||�Sr)rJr.rQrrrRsz#asynccontextmanager.<locals>.helperrrSrrQrr�sc@s$eZdZdd�Zdd�Zdd�ZdS)r	cCs
||_dSr��thing)rrUrrrr;&szclosing.__init__cCs|jSrrTrrrrr(szclosing.__enter__cGs|j��dSr)rU�close)rrGrrrr*szclosing.__exit__N�r%r&r'r;rrrrrrr	sc@s(eZdZdZdd�Zdd�Zdd�ZdS)�_RedirectStreamNcCs||_g|_dSr)�_new_target�_old_targets)r�
new_targetrrrr;2sz_RedirectStream.__init__cCs*|j�tt|j��tt|j|j�|jSr)rZ�appendr8rF�_stream�setattrrYrrrrr7sz_RedirectStream.__enter__cCstt|j|j���dSr)r^rFr]rZ�pop�r�exctype�excinst�exctbrrrr<sz_RedirectStream.__exit__)r%r&r'r]r;rrrrrrrX.srXc@seZdZdZdS)r�stdoutN�r%r&r'r]rrrrr@s
c@seZdZdZdS)r�stderrNrerrrrrPsc@s$eZdZdd�Zdd�Zdd�ZdS)rcGs
||_dSr)�_exceptions)r�
exceptionsrrrr;aszsuppress.__init__cCsdSrrrrrrrdszsuppress.__enter__cCs|dk	ot||j�Sr)�
issubclassrgr`rrrrgs
zsuppress.__exit__NrWrrrrrVsc@sdeZdZedd��Zedd��Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
de
_dd�Zddd�Z
dS)�_BaseExitStackcCs
t||�Srr��cm�cm_exitrrr�_create_exit_wrapperwsz#_BaseExitStack._create_exit_wrappercs���fdd�}|S)Ncs����dSrr�rrI�tb�r/�callbackr0rr�
_exit_wrapper}sz8_BaseExitStack._create_cb_wrapper.<locals>._exit_wrapperr�rrr/r0rsrrqr�_create_cb_wrapper{sz!_BaseExitStack._create_cb_wrappercCst�|_dSr)r�_exit_callbacksrrrrr;�sz_BaseExitStack.__init__cCst|��}|j|_t�|_|Sr)r9rvr)r�	new_stackrrr�pop_all�s
z_BaseExitStack.pop_allcCsBt|�}z
|j}Wntk
r0|�|�YnX|�||�|Sr)r9r�AttributeError�_push_exit_callback�
_push_cm_exit�r�exit�_cb_type�exit_methodrrr�push�s	
z_BaseExitStack.pushcCs(t|�}|j}|�|�}|�||�|Sr)r9rrr{�rrl�_cm_type�_exit�resultrrr�
enter_context�s

z_BaseExitStack.enter_contextcOs�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��|j|f|�|�}||_|�|�|S)	N�zBdescriptor 'callback' of '_BaseExitStack' object needs an argumentrrr�4Passing 'callback' as keyword argument is deprecated��
stacklevelz8callback expected at least 1 positional argument, got %drC)	�len�	TypeErrorr_�warnings�warn�DeprecationWarningru�__wrapped__rz�r/r0rrrr�rsrrrrr�s&

�
�
z_BaseExitStack.callback�#($self, callback, /, *args, **kwds)cCs|�||�}|�|d�dS)NT)rnrz�rrlrmrsrrrr{�sz_BaseExitStack._push_cm_exitTcCs|j�||f�dSr)rvr\)rrr�is_syncrrrrz�sz"_BaseExitStack._push_exit_callbackN)T)r%r&r'�staticmethodrnrur;rxr�r�rr�__text_signature__r{rzrrrrrjts

rjc@s$eZdZdd�Zdd�Zdd�ZdS)rcCs|Srrrrrrr�szExitStack.__enter__c
s�|ddk	}t��d��fdd�}d}d}|jr�|j��\}}z||�rVd}d}d}Wq,t��}||d|d�d}|}Yq,Xq,|r�z|dj}	|d�Wn tk
r�|	|d_�YnX|o�|S)NrrCcs4|j}||krdS|dks*|�kr$q*|}q||_dSr��__context__��new_exc�old_exc�exc_context��	frame_excrr�_fix_exception_context�sz2ExitStack.__exit__.<locals>._fix_exception_contextFT�NNN�rFrGrvr_r�rO)
r�exc_details�received_excr��suppressed_exc�
pending_raiser��cb�new_exc_details�	fixed_ctxrr�rr�s2

zExitStack.__exit__cCs|�ddd�dSr)rrrrrrVszExitStack.closeN)r%r&r'rrrVrrrrr�s1c@sbeZdZedd��Zedd��Zdd�Zdd�Zd	d
�Zde_	dd
�Z
dd�Zdd�Zdd�Z
dS)r
cCs
t||�Srrrkrrr�_create_async_exit_wrapper&sz)AsyncExitStack._create_async_exit_wrappercs���fdd�}|S)Nc�s����IdHdSrrrorqrrrs,sz>AsyncExitStack._create_async_cb_wrapper.<locals>._exit_wrapperrrtrrqr�_create_async_cb_wrapper*sz'AsyncExitStack._create_async_cb_wrapperc�s.t|�}|j}|�|�IdH}|�||�|Sr)r9r,r+�_push_async_cm_exitr�rrr�enter_async_context0s
z"AsyncExitStack.enter_async_contextcCsDt|�}z
|j}Wn tk
r2|�|d�YnX|�||�|S�NF)r9r,ryrzr�r|rrr�push_async_exit<s
zAsyncExitStack.push_async_exitcOs�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��|j|f|�|�}||_|�|d	�|S)
Nr�zMdescriptor 'push_async_callback' of 'AsyncExitStack' object needs an argumentrrrr�r�zCpush_async_callback expected at least 1 positional argument, got %drCF)	r�r�r_r�r�r�r�r�rzr�rrr�push_async_callbackNs&

�
�z"AsyncExitStack.push_async_callbackr�c�s|�ddd�IdHdSr)r,rrrr�aclosekszAsyncExitStack.aclosecCs|�||�}|�|d�dSr�)r�rzr�rrrr�osz"AsyncExitStack._push_async_cm_exitc�s|Srrrrrrr+uszAsyncExitStack.__aenter__c�s�|ddk	}t��d��fdd�}d}d}|jr�|j��\}}z0|rP||�}n||�IdH}|rnd}d}d}Wq,t��}	||	d|d�d}|	}Yq,Xq,|r�z|dj}
|d�Wn tk
r�|
|d_�YnX|o�|S)NrrCcs4|j}||krdS|dks*|�kr$q*|}q||_dSrr�r�r�rrr�~sz8AsyncExitStack.__aexit__.<locals>._fix_exception_contextFTr�r�)rr�r�r�r�r�r�r��cb_suppressr�r�rr�rr,xs8


zAsyncExitStack.__aexit__N)r%r&r'r�r�r�r�r�r�r�r�r�r+r,rrrrr
s


c@s&eZdZddd�Zdd�Zdd�ZdS)	r
NcCs
||_dSr��enter_result)rr�rrrr;�sznullcontext.__init__cCs|jSrr�rrrrr�sznullcontext.__enter__cGsdSrr)r�excinforrrr�sznullcontext.__exit__)NrWrrrrr
�s
)r(rFr�collectionsr�	functoolsr�typesr�__all__�ABCrr�objectrr5r<rJrrr	rXrrrrjrr
r
rrrr�<module>sL��D�.!!`E__pycache__/chunk.cpython-38.pyc000064400000011351151153537560012530 0ustar00U

e5d;�@sdZGdd�d�ZdS)aSimple class to read IFF chunks.

An IFF chunk (used in formats such as AIFF, TIFF, RMFF (RealMedia File
Format)) has the following structure:

+----------------+
| ID (4 bytes)   |
+----------------+
| size (4 bytes) |
+----------------+
| data           |
| ...            |
+----------------+

The ID is a 4-byte string which identifies the type of chunk.

The size field (a 32-bit value, encoded using big-endian byte order)
gives the size of the whole chunk, including the 8-byte header.

Usually an IFF-type file consists of one or more chunks.  The proposed
usage of the Chunk class defined here is to instantiate an instance at
the start of each chunk and read from the instance until it reaches
the end, after which a new instance can be instantiated.  At the end
of the file, creating a new instance will fail with an EOFError
exception.

Usage:
while True:
    try:
        chunk = Chunk(file)
    except EOFError:
        break
    chunktype = chunk.getname()
    while True:
        data = chunk.read(nbytes)
        if not data:
            pass
        # do something with data

The interface is file-like.  The implemented methods are:
read, close, seek, tell, isatty.
Extra methods are: skip() (called by close, skips to the end of the chunk),
getname() (returns the name (ID) of the chunk)

The __init__ method has one required argument, a file-like object
(including a chunk instance), and one optional argument, a flag which
specifies whether or not chunks are aligned on 2-byte boundaries.  The
default is 1, i.e. aligned.
c@sZeZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zddd�Zdd�Z	ddd�Z
dd�ZdS)�ChunkTFc	Cs�ddl}d|_||_|rd}nd}||_|�d�|_t|j�dkrFt�z |�|d|�d��d|_	Wn|j
k
r�td�YnX|r�|j	d|_	d|_z|j��|_
Wnttfk
r�d|_YnXd|_dS)	N�F�>�<��L�T)�struct�closed�align�file�read�	chunkname�len�EOFErrorZunpack_from�	chunksize�error�	size_read�tell�offset�AttributeError�OSError�seekable)�selfrr
Z	bigendianZ
inclheaderrZstrflag�r�/usr/lib64/python3.8/chunk.py�__init__4s, zChunk.__init__cCs|jS)z*Return the name (ID) of the current chunk.)r
�rrrr�getnameNsz
Chunk.getnamecCs|jS)z%Return the size of the current chunk.)rrrrr�getsizeRsz
Chunk.getsizecCs |jsz|��W5d|_XdS)NT)r	�skiprrrr�closeVszChunk.closecCs|jrtd��dS)N�I/O operation on closed fileF)r	�
ValueErrorrrrr�isatty]szChunk.isattyrcCsv|jrtd��|jstd��|dkr0||j}n|dkrB||j}|dksT||jkrXt�|j�|j	|d�||_dS)z�Seek to specified position into the chunk.
        Default position is 0 (start of chunk).
        If the file is not seekable, this will result in an error.
        r!zcannot seek��rN)
r	r"rrrr�RuntimeErrorr�seekr)r�pos�whencerrrr'bs
z
Chunk.seekcCs|jrtd��|jS)Nr!)r	r"rrrrrrusz
Chunk.tell���cCs�|jrtd��|j|jkrdS|dkr2|j|j}||j|jkrN|j|j}|j�|�}|jt|�|_|j|jkr�|jr�|jd@r�|j�d�}|jt|�|_|S)z�Read at most size bytes from the chunk.
        If size is omitted or negative, read until the end
        of the chunk.
        r!�rr$)r	r"rrrrrr
)r�size�data�dummyrrrrzs$��z
Chunk.readcCs�|jrtd��|jrnzD|j|j}|jr:|jd@r:|d}|j�|d�|j||_WdStk
rlYnX|j|jkr�t	d|j|j�}|�
|�}|snt�qndS)z�Skip the rest of the chunk.
        If you are not interested in the contents of the chunk,
        this method should be called so that the file points to
        the start of the next chunk.
        r!r$Ni )r	r"rrrr
rr'r�minrr)r�nr.rrrr�s"
z
Chunk.skipN)TTF)r)r*)�__name__�
__module__�__qualname__rrrr r#r'rrrrrrrr3s


rN)�__doc__rrrrr�<module>s2__pycache__/wave.cpython-38.pyc000064400000043347151153537560012374 0ustar00U

e5d6G�@s�dZddlZdddddgZGdd�de�Zd	Zd
ZddlZddlZddl	Z	ddl
mZddlm
Z
ddlZe
d
d�ZGdd�d�ZGdd�d�Zddd�Zddd�ZdS)a%
Stuff to parse WAVE files.

Usage.

Reading WAVE files:
      f = wave.open(file, 'r')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods read(), seek(), and close().
When the setpos() and rewind() methods are not used, the seek()
method is not  necessary.

This returns an instance of a class with the following public methods:
      getnchannels()  -- returns number of audio channels (1 for
                         mono, 2 for stereo)
      getsampwidth()  -- returns sample width in bytes
      getframerate()  -- returns sampling frequency
      getnframes()    -- returns number of audio frames
      getcomptype()   -- returns compression type ('NONE' for linear samples)
      getcompname()   -- returns human-readable version of
                         compression type ('not compressed' linear samples)
      getparams()     -- returns a namedtuple consisting of all of the
                         above in the above order
      getmarkers()    -- returns None (for compatibility with the
                         aifc module)
      getmark(id)     -- raises an error since the mark does not
                         exist (for compatibility with the aifc module)
      readframes(n)   -- returns at most n frames of audio
      rewind()        -- rewind to the beginning of the audio stream
      setpos(pos)     -- seek to the specified position
      tell()          -- return the current position
      close()         -- close the instance (make it unusable)
The position returned by tell() and the position given to setpos()
are compatible and have nothing to do with the actual position in the
file.
The close() method is called automatically when the class instance
is destroyed.

Writing WAVE files:
      f = wave.open(file, 'w')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods write(), tell(), seek(), and
close().

This returns an instance of a class with the following public methods:
      setnchannels(n) -- set the number of channels
      setsampwidth(n) -- set the sample width
      setframerate(n) -- set the frame rate
      setnframes(n)   -- set the number of frames
      setcomptype(type, name)
                      -- set the compression type and the
                         human-readable compression type
      setparams(tuple)
                      -- set all parameters at once
      tell()          -- return current position in output file
      writeframesraw(data)
                      -- write audio frames without patching up the
                         file header
      writeframes(data)
                      -- write audio frames and patch up the file header
      close()         -- patch up the file header and close the
                         output file
You should set the parameters before the first writeframesraw or
writeframes.  The total number of frames does not need to be set,
but when it is set to the correct value, the header does not have to
be patched up.
It is best to first set all parameters, perhaps possibly the
compression type, and then write audio frames using writeframesraw.
When all frames have been written, either call writeframes(b'') or
close() to patch up the sizes in the header.
The close() method is called automatically when the class instance
is destroyed.
�N�open�openfp�Error�	Wave_read�
Wave_writec@seZdZdS)rN)�__name__�
__module__�__qualname__�r
r
�/usr/lib64/python3.8/wave.pyrNs�)N�b�hN�i)�Chunk)�
namedtuple�_wave_paramsz7nchannels sampwidth framerate nframes comptype compnamec@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,S)-raPVariables used in this class:

    These variables are available to the user though appropriate
    methods of this class:
    _file -- the open file with methods read(), close(), and seek()
              set through the __init__() method
    _nchannels -- the number of audio channels
              available through the getnchannels() method
    _nframes -- the number of audio frames
              available through the getnframes() method
    _sampwidth -- the number of bytes per audio sample
              available through the getsampwidth() method
    _framerate -- the sampling frequency
              available through the getframerate() method
    _comptype -- the AIFF-C compression type ('NONE' if AIFF)
              available through the getcomptype() method
    _compname -- the human-readable AIFF-C compression type
              available through the getcomptype() method
    _soundpos -- the position in the audio stream
              available through the tell() method, set through the
              setpos() method

    These variables are used internally only:
    _fmt_chunk_read -- 1 iff the FMT chunk has been read
    _data_seek_needed -- 1 iff positioned correctly in audio
              file for readframes()
    _data_chunk -- instantiation of a chunk class for the DATA chunk
    _framesize -- size of one frame in the file
    cCs�d|_d|_t|dd�|_|j��dkr0td��|j�d�dkrHtd��d|_d|_d|_	zt|jdd�}Wnt
k
r�Yq�YnX|��}|d	kr�|�|�d|_n2|d
kr�|js�td��||_|j|j
|_d|_	q�|��qT|jr�|js�td��dS)
Nr)Z	bigendian�RIFFz file does not start with RIFF id��WAVEznot a WAVE filer�fmt �datazdata chunk before fmt chunkz#fmt chunk and/or data chunk missing)�_convert�	_soundposr�_fileZgetnamer�readZ_fmt_chunk_read�_data_chunk�_data_seek_needed�EOFError�_read_fmt_chunkZ	chunksize�
_framesize�_nframes�skip)�self�file�chunkZ	chunknamer
r
r�initfp~s8


zWave_read.initfpcCsRd|_t|t�r"t�|d�}||_z|�|�Wn|jrF|���YnXdS)N�rb��_i_opened_the_file�
isinstance�str�builtinsrr&�close�r#�fr
r
r�__init__�s
zWave_read.__init__cCs|��dS�N�r-�r#r
r
r�__del__�szWave_read.__del__cCs|Sr1r
r3r
r
r�	__enter__�szWave_read.__enter__cGs|��dSr1r2�r#�argsr
r
r�__exit__�szWave_read.__exit__cCs|jSr1)rr3r
r
r�getfp�szWave_read.getfpcCsd|_d|_dS)Nrr)rrr3r
r
r�rewind�szWave_read.rewindcCs"d|_|j}|rd|_|��dSr1)rr)r-�r#r$r
r
rr-�s
zWave_read.closecCs|jSr1)rr3r
r
r�tell�szWave_read.tellcCs|jSr1)�
_nchannelsr3r
r
r�getnchannels�szWave_read.getnchannelscCs|jSr1)r!r3r
r
r�
getnframes�szWave_read.getnframescCs|jSr1)�
_sampwidthr3r
r
r�getsampwidth�szWave_read.getsampwidthcCs|jSr1)�
_framerater3r
r
r�getframerate�szWave_read.getframeratecCs|jSr1��	_comptyper3r
r
r�getcomptype�szWave_read.getcomptypecCs|jSr1��	_compnamer3r
r
r�getcompname�szWave_read.getcompnamecCs*t|��|��|��|��|��|���Sr1)rr>rArCr?rFrIr3r
r
r�	getparams�s�zWave_read.getparamscCsdSr1r
r3r
r
r�
getmarkers�szWave_read.getmarkerscCstd��dS�Nzno marks�r�r#�idr
r
r�getmark�szWave_read.getmarkcCs*|dks||jkrtd��||_d|_dS)Nrzposition not in ranger)r!rrr)r#�posr
r
r�setpos�szWave_read.setposcCs�|jr8|j�dd�|j|j}|r2|j�|d�d|_|dkrDdS|j�||j�}|jdkrxtjdkrxt	�
||j�}|jr�|r�|�|�}|jt|�|j
|j|_|S)Nr�r�big)rr�seekrr rr@�sys�	byteorder�audioop�byteswapr�lenr=)r#�nframesrQ�datar
r
r�
readframes�s

zWave_read.readframescCs�z$t�d|�d��\}|_|_}}Wntjk
r@td�YnX|tkr�zt�d|�d��d}Wntjk
r�td�YnX|dd|_|js�t	d��nt	d	|f��|js�t	d
��|j|j|_
d|_d|_dS)
Nz<HHLLH�z<H�r���bad sample widthzunknown format: %r�bad # of channels�NONEznot compressed)
�structZunpack_fromrr=rB�errorr�WAVE_FORMAT_PCMr@rr rErH)r#r%Z
wFormatTagZdwAvgBytesPerSecZwBlockAlign�	sampwidthr
r
rr�s$$
zWave_read._read_fmt_chunkN)rrr	�__doc__r&r0r4r5r8r9r:r-r<r>r?rArCrFrIrJrKrPrRr]rr
r
r
rr_s,
c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:S);ra�Variables used in this class:

    These variables are user settable through appropriate methods
    of this class:
    _file -- the open file with methods write(), close(), tell(), seek()
              set through the __init__() method
    _comptype -- the AIFF-C compression type ('NONE' in AIFF)
              set through the setcomptype() or setparams() method
    _compname -- the human-readable AIFF-C compression type
              set through the setcomptype() or setparams() method
    _nchannels -- the number of audio channels
              set through the setnchannels() or setparams() method
    _sampwidth -- the number of bytes per audio sample
              set through the setsampwidth() or setparams() method
    _framerate -- the sampling frequency
              set through the setframerate() or setparams() method
    _nframes -- the number of audio frames written to the header
              set through the setnframes() or setparams() method

    These variables are used internally only:
    _datalength -- the size of the audio samples written to the header
    _nframeswritten -- the number of frames actually written
    _datawritten -- the size of the audio samples actually written
    cCsRd|_t|t�r"t�|d�}||_z|�|�Wn|jrF|���YnXdS)N�wbr(r.r
r
rr0.s
zWave_write.__init__cCs@||_d|_d|_d|_d|_d|_d|_d|_d|_d|_	dS)NrF)
rrr=r@rBr!�_nframeswritten�_datawritten�_datalength�_headerwrittenr;r
r
rr&:szWave_write.initfpcCs|��dSr1r2r3r
r
rr4FszWave_write.__del__cCs|Sr1r
r3r
r
rr5IszWave_write.__enter__cGs|��dSr1r2r6r
r
rr8LszWave_write.__exit__cCs(|jrtd��|dkrtd��||_dS)N�0cannot change parameters after starting to writerrc)rlrr=)r#�	nchannelsr
r
r�setnchannelsRs
zWave_write.setnchannelscCs|jstd��|jS)Nznumber of channels not set)r=rr3r
r
rr>YszWave_write.getnchannelscCs0|jrtd��|dks|dkr&td��||_dS)Nrorrrb)rlrr@)r#rhr
r
r�setsampwidth^s
zWave_write.setsampwidthcCs|jstd��|jS)Nzsample width not set)r@rr3r
r
rrAeszWave_write.getsampwidthcCs0|jrtd��|dkrtd��tt|��|_dS)Nrorzbad frame rate)rlr�int�roundrB)r#�	framerater
r
r�setframeratejs
zWave_write.setframeratecCs|jstd��|jS)Nzframe rate not set)rBrr3r
r
rrCqszWave_write.getframeratecCs|jrtd��||_dS�Nro)rlrr!)r#r[r
r
r�
setnframesvszWave_write.setnframescCs|jSr1�rkr3r
r
rr?{szWave_write.getnframescCs.|jrtd��|dkrtd��||_||_dS)Nro)rdzunsupported compression type)rlrrErH)r#�comptype�compnamer
r
r�setcomptype~szWave_write.setcomptypecCs|jSr1rDr3r
r
rrF�szWave_write.getcomptypecCs|jSr1rGr3r
r
rrI�szWave_write.getcompnamecCsV|\}}}}}}|jrtd��|�|�|�|�|�|�|�|�|�||�dSrw)rlrrqrrrvrxr|)r#Zparamsrprhrur[rzr{r
r
r�	setparams�s



zWave_write.setparamscCs8|jr|jr|jstd��t|j|j|j|j|j|j�S)Nznot all parameters set)r=r@rBrrr!rErHr3r
r
rrJ�s�zWave_write.getparamscCstd��dS)Nzsetmark() not supportedrM)r#rOrQ�namer
r
r�setmark�szWave_write.setmarkcCstd��dSrLrMrNr
r
rrP�szWave_write.getmarkcCsdSr1r
r3r
r
rrK�szWave_write.getmarkerscCs|jSr1ryr3r
r
rr<�szWave_write.tellcCs�t|ttf�st|��d�}|�t|��t|�|j|j}|j	rN|�	|�}|jdkrpt
jdkrpt�
||j�}|j�|�|jt|�7_|j||_dS)N�BrrT)r*�bytes�	bytearray�
memoryview�cast�_ensure_header_writtenrZr@r=rrVrWrXrYr�writerlrk)r#r\r[r
r
r�writeframesraw�s
zWave_write.writeframesrawcCs"|�|�|j|jkr|��dSr1)r�rmrl�_patchheader)r#r\r
r
r�writeframes�s
zWave_write.writeframescCsXz2|jr0|�d�|j|jkr&|��|j��W5d|_|j}|rRd|_|��XdS)Nr)rr)r-r�rmrlr��flushr;r
r
rr-�s
zWave_write.closecCs>|js:|jstd��|js"td��|js0td��|�|�dS)Nz# channels not specifiedzsample width not specifiedzsampling rate not specified)rnr=rr@rB�
_write_header)r#Zdatasizer
r
rr��sz!Wave_write._ensure_header_writtencCs�|jr
t�|j�d�|js.||j|j|_|j|j|j|_z|j��|_	Wnt
tfk
rpd|_	YnX|j�t�
dd|jdddt|j|j|j|j|j|j|j|jdd��|j	dk	r�|j��|_|j�t�
d	|j��d
|_dS)Nrz<L4s4sLHHLLHH4s�$rr�rar�<LT)rn�AssertionErrorrr�r!r=r@rmr<�_form_length_pos�AttributeError�OSErrorre�packrgrB�_data_length_pos)r#Z
initlengthr
r
rr��s4

�
zWave_write._write_headercCs�|js
t�|j|jkrdS|j��}|j�|jd�|j�t	�
dd|j��|j�|jd�|j�t	�
d|j��|j�|d�|j|_dS)Nrr�r�)rnr�rlrmrr<rUr�r�rer�r�)r#Zcurposr
r
rr��s

zWave_write._patchheaderN) rrr	rir0r&r4r5r8rqr>rrrArvrCrxr?r|rFrIr}rJrrPrKr<r�r�r-r�r�r�r
r
r
rrs:


cCsJ|dkrt|d�r|j}nd}|dkr.t|�S|dkr>t|�Std��dS)N�moder')�rr')�wrjz$mode must be 'r', 'rb', 'w', or 'wb')�hasattrr�rrr�r/r�r
r
rr�s
cCstjdtdd�t||d�S)NzBwave.openfp is deprecated since Python 3.7. Use wave.open instead.r_)�
stacklevel)r�)�warnings�warn�DeprecationWarningrr�r
r
rrs
�)N)N)rir,�__all__�	ExceptionrrgZ_array_fmtsrXrerVr%r�collectionsrr�rrrrrr
r
r
r�<module>s(I�6d

__pycache__/sunau.cpython-38.opt-2.pyc000064400000030314151153537560013513 0ustar00U

e5d�G�@s�ddlmZddlZedd�ZdZdZdZdZd	Zd
Z	dZ
dZd
ZdZ
dZdZdZdZeeeee	egZGdd�de�Zdd�Zdd�ZGdd�d�ZGdd�d�Zd!dd�Zd"dd �ZdS)#�)�
namedtupleN�
_sunau_paramsz7nchannels sampwidth framerate nframes comptype compnameidns.������������l��c@seZdZdS)�ErrorN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/sunau.pyr�srcCs8d}td�D]&}|�d�}|s"t�|dt|�}q|S)Nrrr�)�range�read�EOFError�ord)�file�x�iZbyterrr�	_read_u32�s
rcCsFg}td�D]&}t|d�\}}|�dt|��|}q|�t|��dS)Nrrr)r�divmod�insert�int�write�bytes)rr�datar�d�mrrr�
_write_u32�sr'c@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)S)*�Au_readcCs@t|�td�kr,ddl}|�|d�}d|_nd|_|�|�dS)N�r�rbTF��type�builtins�open�_opened�initfp��self�fr-rrr�__init__�szAu_read.__init__cCs|jr|��dS�N��_file�close�r2rrr�__del__�szAu_read.__del__cCs|Sr5rr9rrr�	__enter__�szAu_read.__enter__cGs|��dSr5�r8�r2�argsrrr�__exit__�szAu_read.__exit__c	Cs�||_d|_tt|��}|tkr(td��tt|��|_|jdkrHtd��|jdkrZtd��t|�|_|jtkrzt|j�|_tt|��|_	|j	t
kr�td��|j	ttfkr�d|_
d	|_nj|j	tkr�d	|_|_
nR|j	tkr�d|_|_
n:|j	tkr�d
|_|_
n"|j	tk�rd|_|_
ntd��tt|��|_tt|��|_|j�sLtd
��|j|j|_|jdk�r�|�|jd�|_|j�d�\|_}}nd|_z|��|_Wn ttfk
�r�d|_YnXdS)Nrzbad magic numberrzheader size too small�dzheader size ridiculously largezencoding not (yet) supportedrrrrzunknown encodingzbad # of channels��)r7�	_soundposr!r�AUDIO_FILE_MAGICrZ	_hdr_size�
_data_size�AUDIO_UNKNOWN_SIZE�	_encoding�_simple_encodings�AUDIO_FILE_ENCODING_MULAW_8�AUDIO_FILE_ENCODING_ALAW_8�
_sampwidth�
_framesize�AUDIO_FILE_ENCODING_LINEAR_8�AUDIO_FILE_ENCODING_LINEAR_16�AUDIO_FILE_ENCODING_LINEAR_24�AUDIO_FILE_ENCODING_LINEAR_32�
_framerate�
_nchannelsr�_info�	partition�tell�	_data_pos�AttributeError�OSError)r2r�magic�_rrrr0�sV




�


zAu_read.initfpcCs|jSr5)r7r9rrr�getfp�sz
Au_read.getfpcCs|jSr5)rRr9rrr�getnchannels�szAu_read.getnchannelscCs|jSr5)rKr9rrr�getsampwidth�szAu_read.getsampwidthcCs|jSr5)rQr9rrr�getframerate�szAu_read.getframeratecCs(|jtkrtS|jtkr$|j|jSdS�Nr)rErFrGrHrLr9rrr�
getnframes�s


zAu_read.getnframescCs$|jtkrdS|jtkrdSdSdS)N�ULAW�ALAW�NONE�rGrIrJr9rrr�getcomptype�s


zAu_read.getcomptypecCs$|jtkrdS|jtkrdSdSdS)N�CCITT G.711 u-law�CCITT G.711 A-law�not compressedrdr9rrr�getcompname�s


zAu_read.getcompnamecCs*t|��|��|��|��|��|���Sr5�rr\r]r^r`rerir9rrr�	getparamss�zAu_read.getparamscCsdSr5rr9rrr�
getmarkersszAu_read.getmarkerscCstd��dS)Nzno marks)r)r2�idrrr�getmarkszAu_read.getmarkcCsp|jtkrl|tkr|j��}n|j�||j�}|jt|�|j7_|jtkrhddl	}|�
||j�}|SdSr_)rGrHrFr7rrLrC�lenrI�audioopZulaw2linrK)r2�nframesr$rprrr�
readframess

zAu_read.readframescCs*|jdkrtd��|j�|j�d|_dS)N�cannot seekr)rVrXr7�seekrCr9rrr�rewinds
zAu_read.rewindcCs|jSr5)rCr9rrrrU!szAu_read.tellcCsP|dks||��krtd��|jdkr.td��|j�|j||j�||_dS)Nrzposition not in rangers)r`rrVrXr7rtrLrC)r2�posrrr�setpos$s
zAu_read.setposcCs"|j}|rd|_|jr|��dSr5)r7r/r8�r2rrrrr8,s
z
Au_read.closeN)rrrr4r:r;r?r0r[r\r]r^r`rerirkrlrnrrrurUrwr8rrrrr(�s(	.
r(c@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3S)4�Au_writecCs@t|�td�kr,ddl}|�|d�}d|_nd|_|�|�dS)Nr)r�wbTFr+r1rrrr45szAu_write.__init__cCs|jr|��d|_dSr5r6r9rrrr:>szAu_write.__del__cCs|Sr5rr9rrrr;CszAu_write.__enter__cGs|��dSr5r<r=rrrr?FszAu_write.__exit__cCsF||_d|_d|_d|_d|_t|_d|_d|_d|_	d|_
d|_dS)NrrBra)r7rQrRrKrLrF�_nframes�_nframeswritten�_datawritten�_datalengthrS�	_comptyperxrrrr0IszAu_write.initfpcCs(|jrtd��|dkrtd��||_dS)N�0cannot change parameters after starting to write)rrrz"only 1, 2, or 4 channels supported)r|rrR)r2�	nchannelsrrr�setnchannelsVs
zAu_write.setnchannelscCs|jstd��|jS)Nznumber of channels not set)rRrr9rrrr\]szAu_write.getnchannelscCs(|jrtd��|dkrtd��||_dS)Nr�)rrrrzbad sample width)r|rrK)r2�	sampwidthrrr�setsampwidthbs
zAu_write.setsampwidthcCs|jstd��|jS)N�sample width not specified)rQrrKr9rrrr]iszAu_write.getsampwidthcCs|jrtd��||_dS)Nr�)r|rrQ)r2�	frameraterrr�setframeratenszAu_write.setframeratecCs|jstd��|jS)Nzframe rate not set)rQrr9rrrr^sszAu_write.getframeratecCs(|jrtd��|dkrtd��||_dS)Nr�rz# of frames cannot be negative)r|rr{)r2rqrrr�
setnframesxs
zAu_write.setnframescCs|jSr5�r|r9rrrr`szAu_write.getnframescCs|dkr||_ntd��dS)N)rcrazunknown compression type)rr)r2r,�namerrr�setcomptype�szAu_write.setcomptypecCs|jSr5�rr9rrrre�szAu_write.getcomptypecCs$|jdkrdS|jdkrdSdSdS)Nrarfrbrgrhr�r9rrrri�s


zAu_write.getcompnamecCsH|\}}}}}}|�|�|�|�|�|�|�|�|�||�dSr5)r�r�r�r�r�)r2Zparamsr�r�r�rqZcomptypeZcompnamerrr�	setparams�s



zAu_write.setparamscCs*t|��|��|��|��|��|���Sr5rjr9rrrrk�s�zAu_write.getparamscCs|jSr5r�r9rrrrU�sz
Au_write.tellcCs~t|ttf�st|��d�}|��|jdkrDddl}|�||j	�}t
|�|j}|j�
|�|j||_|jt
|�|_dS)N�Brar)�
isinstancer#�	bytearray�
memoryview�cast�_ensure_header_writtenrrpZlin2ulawrKrorLr7r"r|r})r2r$rprqrrr�writeframesraw�s
zAu_write.writeframesrawcCs.|�|�|j|jks"|j|jkr*|��dSr5)r�r|r{r~r}�_patchheader)r2r$rrr�writeframes�s


�zAu_write.writeframescCs^|jrZz6|��|j|jks(|j|jkr0|��|j�	�W5|j}d|_|jrX|��XdSr5)
r7r/r8r�r|r{r~r}r��flushrxrrrr8�s
�zAu_write.closecCs<|js8|jstd��|js"td��|js0td��|��dS)Nz# of channels not specifiedr�zframe rate not specified)r|rRrrKrQ�
_write_headerr9rrrr��szAu_write._ensure_header_writtenc	Cs�|jdkrl|jdkr t}d|_q�|jdkr6t}d|_q�|jdkrLt}d|_q�|jdkrbt}d|_q�td��n|jdkr�t}d|_ntd��|j|j	|_t
|jt�dt
|j�}|d	d
@}t
|j|�|jtkr�t}n|j|j}z|j��|_Wn ttfk
�rd|_YnXt
|j|�||_t
|j|�t
|j|j�t
|j|j	�|j�|j�|j�d|t
|j�d�dS)
Nrcrrrrzinternal errorrar
r
i����rAr)rrKrMrLrNrOrPrrIrRr'r7rDrorSr{rFrU�_form_length_posrWrXr~rQr")r2�encoding�header_sizeZlengthrrrr��sJ







zAu_write._write_headercCsH|jdkrtd��|j�|j�t|j|j�|j|_|j�dd�dS)Nrsrr)r�rXr7rtr'r}r~r9rrrr��s
zAu_write._patchheaderN)rrrr4r:r;r?r0r�r\r�r]r�r^r�r`r�rerir�rkrUr�r�r8r�r�r�rrrrry3s2	

*rycCsJ|dkrt|d�r|j}nd}|dkr.t|�S|dkr>t|�Std��dS)N�moder*)�rr*)�wrzz$mode must be 'r', 'rb', 'w', or 'wb')�hasattrr�r(ryr�r3r�rrrr.s
r.cCstjdtdd�t||d�S)NzDsunau.openfp is deprecated since Python 3.7. Use sunau.open instead.r)�
stacklevel)r�)�warnings�warn�DeprecationWarningr.r�rrr�openfps
�r�)N)N)�collectionsrr�rrDrIrMrNrOrPZAUDIO_FILE_ENCODING_FLOATZAUDIO_FILE_ENCODING_DOUBLEZAUDIO_FILE_ENCODING_ADPCM_G721ZAUDIO_FILE_ENCODING_ADPCM_G722Z AUDIO_FILE_ENCODING_ADPCM_G723_3Z AUDIO_FILE_ENCODING_ADPCM_G723_5rJrFrH�	Exceptionrrr'r(ryr.r�rrrr�<module>jsD��	Q

__pycache__/mailbox.cpython-38.opt-2.pyc000064400000150520151153537560014015 0ustar00U

e5dE3�@sNddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Zddl
Z
ddlZzddlZWne
k
r�dZYnXdddddddd	d
ddd
dddddgZej�d�ZGdd�d�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�dejj�ZGdd	�d	e�ZGd d!�d!e�ZGd"d
�d
e�ZGd#d�de�ZGd$d�de�ZGd%d
�d
e�Z Gd&d'�d'�Z!Gd(d)�d)e!�Z"d<d+d,�Z#d-d.�Z$d/d0�Z%d1d2�Z&d3d4�Z'd5d6�Z(Gd7d�de)�Z*Gd8d�de*�Z+Gd9d�de*�Z,Gd:d�de*�Z-Gd;d�de*�Z.dS)=�N�Mailbox�Maildir�mbox�MH�Babyl�MMDF�Message�MaildirMessage�mboxMessage�	MHMessage�BabylMessage�MMDFMessage�Error�NoSuchMailboxError�
NotEmptyError�ExternalClashError�FormatError�asciic@seZdZdBdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�ZdCdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�ZdDd/d0�Zd1d2�ZdEd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Zd=d>�Z d?Z!dFd@dA�Z"dS)GrNTcCs tj�tj�|��|_||_dS�N)�os�path�abspath�
expanduser�_path�_factory��selfr�factory�create�r�/usr/lib64/python3.8/mailbox.py�__init__$szMailbox.__init__cCstd��dS�Nz&Method must be implemented by subclass��NotImplementedError�r�messagerrr �add)szMailbox.addcCstd��dSr"r#�r�keyrrr �remove-szMailbox.removecCs|�|�dSr)r*r(rrr �__delitem__1szMailbox.__delitem__cCs(z|�|�Wntk
r"YnXdSr)r*�KeyErrorr(rrr �discard4szMailbox.discardcCstd��dSr"r#�rr)r&rrr �__setitem__;szMailbox.__setitem__cCs*z|�|�WStk
r$|YSXdSr)�__getitem__r,)rr)�defaultrrr �get?szMailbox.getc
CsB|js|�|�St�|�|���}|�|�W5QR�SQRXdSr)r�get_message�
contextlib�closing�get_file)rr)�filerrr r0Fs
zMailbox.__getitem__cCstd��dSr"r#r(rrr r3NszMailbox.get_messagecCst�|�|����Sr��email�message_from_bytes�	get_bytesZ	as_stringr(rrr �
get_stringRszMailbox.get_stringcCstd��dSr"r#r(rrr r;YszMailbox.get_bytescCstd��dSr"r#r(rrr r6]szMailbox.get_filecCstd��dSr"r#�rrrr �iterkeysaszMailbox.iterkeyscCst|���Sr)�listr>r=rrr �keyseszMailbox.keysc	cs>|��D]0}z||}Wntk
r0YqYnX|VqdSr�r>r,�rr)�valuerrr �
itervaluesis
zMailbox.itervaluescCs|��Sr)rDr=rrr �__iter__rszMailbox.__iter__cCst|���Sr)r?rDr=rrr �valuesuszMailbox.valuesc	csB|��D]4}z||}Wntk
r0YqYnX||fVqdSrrArBrrr �	iteritemsys
zMailbox.iteritemscCst|���Sr)r?rGr=rrr �items�sz
Mailbox.itemscCstd��dSr"r#r(rrr �__contains__�szMailbox.__contains__cCstd��dSr"r#r=rrr �__len__�szMailbox.__len__cCs|��D]}|�|�qdSr)r@r-r(rrr �clear�sz
Mailbox.clearcCs4z||}Wntk
r$|YSX|�|�|Sr)r,r-)rr)r1�resultrrr �pop�s

zMailbox.popcCs*|��D]}||�|�fStd��dS)NzNo messages in mailbox)r>rMr,r(rrr �popitem�szMailbox.popitemc	Cstt|d�r|��}nt|d�r(|��}n|}d}|D].\}}z|||<Wq4tk
r`d}Yq4Xq4|rptd��dS)NrGrHFTzNo message with key(s))�hasattrrGrHr,)r�arg�sourceZbad_keyr)r&rrr �update�s



zMailbox.updatecCstd��dSr"r#r=rrr �flush�sz
Mailbox.flushcCstd��dSr"r#r=rrr �lock�szMailbox.lockcCstd��dSr"r#r=rrr �unlock�szMailbox.unlockcCstd��dSr"r#r=rrr �close�sz
Mailbox.closecCs.z|�d�WStk
r(td��YnXdS)Nrz?String input must be ASCII-only; use bytes or a Message instead)�encode�UnicodeError�
ValueErrorr%rrr �_string_to_bytes�szMailbox._string_to_bytesFc	Cs�t|tjj�rvt��}tj�||d�}|�|�|�	d�|�
�}|�dt�}|�
|�|jrr|�t�sr|�
t��n�t|tttjf��rt|tj�r�t�dtd�|��}t|t�r�|�|�}|r�|�dd�}|�dt�}|�
|�|j�r�|�t��s�|�
t�n�t|d��r�t|d��r2t�d	td�|j}d}|��}|�d
��r\|dd�d}n|�d��rx|dd
�d}|�s��q�|�r�|�d��r�d|dd�}|�dt�}|�
|�|}�q6|j�r�|�r�|�t��s�|�
t�ntdt|���dS)Nr�
�8Use of StringIO input is deprecated, use BytesIO instead�s
From s
>From �read�buffer�DUse of text mode files is deprecated, use a binary mode file instead�
����
����From s>From ��Invalid message type: %s)�
isinstancer9r&r�io�BytesIO�	generator�BytesGenerator�flatten�seekr^�replace�linesep�write�_append_newline�endswith�str�bytes�StringIO�warnings�warn�DeprecationWarning�getvaluerZrOr_�readline�
startswith�	TypeError�type)	rr&�targetZmangle_from_r_�gen�dataZlastline�linerrr �
_dump_message�s`


�


�
zMailbox._dump_message)NT)N)N)N)F)#�__name__�
__module__�__qualname__r!r'r*r+r-r/r2r0r3r<r;r6r>r@rDrErFrGrHrIrJrKrMrNrRrSrTrUrVrZrrr�rrrr r!s@

		
	
c@s�eZdZdZd5dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,Zd-d.�Zd/d0�Zd1d2�Zd3d4�ZdS)6r�:NTcCs�t�||||�tj�|jd�tj�|jd�tj�|jd�d�|_tj�|j�s�|r�t�|jd�|j�	�D]}t�|d�qln
t
|j��i|_ddd�|_d|_
d|_dS)	N�tmp�new�cur)r�r�r��r)r�r�g�������?)rr!rr�joinr�_paths�exists�mkdirrFr�_toc�_toc_mtimes�
_last_read�_skewfactor)r�dirnamerrrrrr r!
s�
zMaildir.__init__c
Cs~|��}z|�||�Wn*tk
rB|��t�|j��YnXt|�t|t	�r||�
�}|j|��}||jkr�d}nd}d}tj
�|j��|j�d}tj
�|j|||�}t|t	�r�t�|jtj
�|j�|��f�zLzt�|j|�Wn(ttfk
�rt�|j|�YnXt�|j�WnNtk
�rx}z.t�|j�|jtjk�rftd|��n�W5d}~XYnX|S)N�r�rz$Name clash with existing message: %s)�_create_tmpr��
BaseExceptionrVrr*�name�_sync_closerhr	�
get_subdir�colon�get_infor�basename�splitr�r�utime�getatime�get_date�link�AttributeError�PermissionError�rename�OSError�errnoZEEXISTr)rr&Ztmp_file�subdir�suffix�uniq�dest�errr r'!sF


��zMaildir.addcCs t�tj�|j|�|���dSr)rr*rr�r�_lookupr(rrr r*KszMaildir.removec	Cs,z|�|�Wnttfk
r&YnXdSr)r*r,�FileNotFoundErrorr(rrr r-OszMaildir.discardcCs�|�|�}|�|�}|�|�}t|t�r.|}n|}tj�|�}|j|kr`|j|�|j�d}nd}|�	|�tj�
|j|�}	tj�
|j|||�}
t|t�r�t�|	tj�
|	�|��f�t�|	|
�dS)Nrdr�)r�r'rhr	rrr�r�r�r-r�rr�r�r�r�)rr)r&Zold_subpathZtemp_keyZtemp_subpathZdominant_subpathr�r�Ztmp_path�new_pathrrr r/Ws$






�zMaildir.__setitem__c	Cs�|�|�}ttj�|j|�d�� }|jr4|�|�}nt|�}W5QRXtj�|�\}}|�	|�|j
|kr�|�|�|j
�d�|�tj�
tj�|j|���|S)N�rbrd)r��openrrr�rrr	r��
set_subdirr��set_info�set_date�getmtime)rr)Zsubpath�f�msgr�r�rrr r3rs


zMaildir.get_messagec
CsDttj�|j|�|��d��}|���td�W5QR�SQRXdS)Nr�r[)	r�rrr�rr�r^rorp�rr)r�rrr r;�szMaildir.get_bytescCs$ttj�|j|�|��d�}t|�S)Nr�)r�rrr�rr��
_ProxyFiler�rrr r6�szMaildir.get_filec	csF|��|jD]2}z|�|�Wntk
r8YqYnX|VqdSr)�_refreshr�r�r,r(rrr r>�s

zMaildir.iterkeyscCs|��||jkSr)r�r�r(rrr rI�szMaildir.__contains__cCs|��t|j�Sr)r��lenr�r=rrr rJ�szMaildir.__len__cCsdSrrr=rrr rS�sz
Maildir.flushcCsdSrrr=rrr rT�szMaildir.lockcCsdSrrr=rrr rU�szMaildir.unlockcCsdSrrr=rrr rV�sz
Maildir.closecCs\g}t�|j�D]F}t|�dkr|ddkrtj�tj�|j|��r|�|dd��q|S)N�r�.)r�listdirrr�r�isdirr��append�rrL�entryrrr �list_folders�s�zMaildir.list_folderscCs ttj�|jd|�|jdd�S)Nr�F�rr)rrrr�rr�r�folderrrr �
get_folder�s�zMaildir.get_foldercCs\tj�|jd|�}t||jd�}tj�|d�}tj�|�sXt�t�|tj	tj
Bd��|S)Nr��rZ
maildirfolder�)rrr�rrrr�rVr��O_CREAT�O_WRONLY)rr�rrLZmaildirfolder_pathrrr �
add_folder�s�zMaildir.add_foldercCstj�|jd|�}t�tj�|d��t�tj�|d��D](}t|�dksX|ddkr<td|��q<t�|�D]B}|dkrp|dkrp|dkrptj�tj�||��rptd||f��qptj|d	d
�D]F\}}}|D]}t�	tj�||��q�|D]}t�
tj�||��q�q�t�
|�dS)Nr�r�r�r�rzFolder contains message(s): %sr�z%Folder contains subdirectory '%s': %sF)�topdown)rrr�rr�r�rr��walkr*�rmdir)rr�rr��root�dirs�filesrrr �
remove_folder�s&���zMaildir.remove_foldercCsXt��}t�tj�|jd��D]4}tj�|jd|�}|tj�|�dkrt�|�qdS)Nr�i@�)�timerr�rr�rr�r*)r�nowr�rrrr �clean�s
z
Maildir.cleanr�cCs�t��}t��}d|kr$|�dd�}d|kr8|�dd�}dt|�t|dd�t��tj|f}tj	�
|jd|�}zt�|�WnFt
k
r�tjd7_zt|�WYStk
r�YnXYnXtd	|��dS)
N�/z\057r�z\072z%s.M%sP%sQ%s.%sr�g��.Ar�z&Name clash prevented file creation: %s)r��socket�gethostnamero�intr�getpidr�_countrr�r�statr��_create_carefully�FileExistsErrorr)rr�Zhostnamer�rrrr r��s,��zMaildir._create_tmpcCs�t��|jd|jkr^d}|jD]2}tj�|j|�}||j|krJd}||j|<q"|s^dSi|_|jD]^}|j|}t�	|�D]D}tj�
||�}tj�|�r�q�|�|j
�d}tj�
||�|j|<q�qjt��|_dS)N�FTr)r�r�r�r�rrr�r�r�r�r�r�r�r�)rZrefreshr��mtimerr��pr�rrr r��s&


zMaildir._refreshcCs�z.tj�tj�|j|j|��r,|j|WSWntk
rBYnX|��z|j|WStk
rztd|�d�YnXdS�N�No message with key: %s)rrr�r�rr�r,r�r(rrr r�#szMaildir._lookupcCsXt|d�s|��|_z|t|j�WStk
r:YdStk
rPYqYqXqdS)N�
_onetime_keys)rOr>r��next�
StopIterationr,r=rrr r�1s

zMaildir.next)NT)r�r�r�r�r!r'r*r-r/r3r;r6r>rIrJrSrTrUrVr�r�r�r�r�r�r�r�r�r�rrrr rs4
*
	
$c@s�eZdZd#dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd$dd �Zd!d"�ZdS)%�_singlefileMailboxNTc
Cs�t�||||�zt|jd�}Wnntk
r�}zP|jtjkr\|rPt|jd�}q~t|j��n"|jtjtj	fkr|t|jd�}n�W5d}~XYnX||_
d|_d|_d|_
d|_d|_d|_dS)N�rb+zwb+r�rF)rr!r�rr�r��ENOENTr�EACCES�EROFS�_filer��	_next_key�_pending�
_pending_sync�_locked�_file_length)rrrrr�r�rrr r!As$z_singlefileMailbox.__init__cCs8|��|�|�|j|j<|jd7_d|_|jdS)Nr�T)r��_append_messager�r�r�r%rrr r'Xs
z_singlefileMailbox.addcCs|�|�|j|=d|_dS�NT)r�r�r�r(rrr r*bs
z_singlefileMailbox.removecCs$|�|�|�|�|j|<d|_dSr�)r�r�r�r�r.rrr r/hs
z_singlefileMailbox.__setitem__ccs|��|j��EdHdSr)r�r�r@r=rrr r>nsz_singlefileMailbox.iterkeyscCs|��||jkSr)r�r�r(rrr rIssz_singlefileMailbox.__contains__cCs|��t|j�Sr)r�r�r�r=rrr rJxsz_singlefileMailbox.__len__cCs|jst|j�d|_dSr�)r��
_lock_filer�r=rrr rT}s
z_singlefileMailbox.lockcCs|jrt|j�d|_dS�NF)r��_unlock_filer�r=rrr rU�s
z_singlefileMailbox.unlockc
Cs�|js |jrt|j�d|_dS|j�dd�|j��}||jkrTtd|j|f��t|j	�}z�i}|�
|�t|j�
��D]x}|j|\}}|j�|�|�|�|��}|j�td||j����}|s�q�|�|�q�||��f||<|�|�q||��|_Wn"|��t�|j��YnXt|�|j��t�|j	�j}	t�|j|	�zt�|j|j	�Wn2tk
�r�t�|j	�t�|j|j	�YnXt|j	d�|_||_d|_d|_|j�r�t|jdd�dS)NFrr�z4Size of mailbox file changed (expected %i, found %i)�r�)�dotlock) r�r��_sync_flushr�rn�tellr�r�_create_temporaryr�_pre_mailbox_hook�sortedr�r@�_pre_message_hookr^�minrq�_post_message_hookrVrr*r�r�r��st_mode�chmodr�r�r�r�r�)
rZcur_lenZnew_fileZnew_tocr)�start�stopZ	new_startr_�moderrr rS�s`
	

�



�
z_singlefileMailbox.flushcCsdSrr�rr�rrr r��sz$_singlefileMailbox._pre_mailbox_hookcCsdSrrrrrr r��sz$_singlefileMailbox._pre_message_hookcCsdSrrrrrr r�sz%_singlefileMailbox._post_message_hookcCs4z|��W5z|jr|��W5|j��XXdSr)r�rVr�rUrSr=rrr rV�sz_singlefileMailbox.closecCsN|jdkr|��|dk	rJz|j|WStk
rHtd|�d�YnXdSr�)r��
_generate_tocr,r(rrr r��s
z_singlefileMailbox._lookupcCs�|j�dd�|j��}t|j�dkr8|js8|�|j�z&|�|j�|�|�}|�	|j�Wn"t
k
r�|j�|��YnX|j��|j��|_
|S)Nrr�)r�rnr�r�r�r�r�r��_install_messagerr��truncaterSr�)rr&ZbeforeZoffsetsrrr r��s


z"_singlefileMailbox._append_message)NT)N)r�r�r�r!r'r*r/r>rIrJrTrUrSr�r�rrVr�r�rrrr r�>s 

@

r�c@s>eZdZdZdd�Zddd�Zddd�Zdd	d
�Zdd�Zd
S)�	_mboxMMDFTcCsp|�|�\}}|j�|�|j���td�}|j�||j���}|�|�td��}|�	|dd��
d��|S)N�r[rfr)r�r�rnr{rorpr^r��_message_factory�set_from�decode)rr)rr�	from_line�stringr�rrr r3sz_mboxMMDF.get_messageFcCst�|�||��j|d�S)N)�unixfromr8)rr)�from_rrr r<s

��z_mboxMMDF.get_stringcCsJ|�|�\}}|j�|�|s(|j��|j�||j���}|�td�S�Nr[)r�r�rnr{r^r�rorp)rr)rrrrrrr r;s
z_mboxMMDF.get_bytescCs<|�|�\}}|j�|�|s(|j��t|j|j��|�Sr)r�r�rnr{�_PartialFiler�)rr)rrrrrr r6s

z_mboxMMDF.get_filecCsd}t|t�r|�|�}t|t�rf|�d�rf|�d�}|dkr\|d|�}||dd�}q�|}d}nJt|t�r�|���d�}d|}n(t|t	j
j�r�|��}|dk	r�|�d�}|dkr�dt
�t
�����}|j��}|j�|t�|�||j|j�|j��}||fS)Nrer[rdr�rrsFrom MAILER-DAEMON )rhrtrZrur|�find�_mboxMMDFMessage�get_fromrWr9r&r�get_unixfromr��asctime�gmtimer�r�rqrpr��
_mangle_from_)rr&r�newlineZauthorrrrrr r	&s0







z_mboxMMDF._install_messageN)F)F)F)	r�r�r�rr3r<r;r6r	rrrr rs


	
rc@s.eZdZdZdZd	dd�Zdd�Zdd�ZdS)
rTNcCst|_t�||||�dSr)r
r
rr!rrrr r!Lsz
mbox.__init__cCs|�t�dSr�rqrprrrr rQszmbox._post_message_hookcCs�gg}}d}|j�d�|j��}|j��}|�d�rzt|�t|�krj|r`|�|tt��n
|�|�|�|�d}q|s�|r�|�|tt��q�|�|�q�q|tkr�d}qd}qtt	t
||���|_t|j�|_|j��|_
dS)NFrreT)r�rnr�r{r|r�r�rp�dict�	enumerate�zipr�r�r�)r�starts�stopsZlast_was_empty�line_posr�rrr rUs.






zmbox._generate_toc)NT)r�r�r�rrrr!rrrrrr rCs

c@s.eZdZddd�Zdd�Zdd�Zd	d
�ZdS)rNTcCst|_t�||||�dSr)r
r
rr!rrrr r!zsz
MMDF.__init__cCs|�dt�dS�N�rrrrr r�szMMDF._pre_message_hookcCs|�tdt�dSr%rrrrr r�szMMDF._post_message_hookcCs�gg}}|j�d�d}|}|j��}|j��}|�dt�r�|�|�|}|j��}|j��}|dtkr�|�|tt��q�qJ|sJ|�|�q�qJq|sq�qtt	t
||���|_t|j�|_|j�dd�|j��|_
dS)Nrr&r�)r�rnr{r�r|rpr�r�rr r!r�r�r�)rr"r#�next_posr$r�rrr r�s.






zMMDF._generate_toc)NT)r�r�r�r!r�rrrrrr rws
c@s�eZdZd/dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�ZdS)0rNTcCstt�||||�tj�|j�sj|r`t�|jd�t�t�tj�	|jd�tj
tjBtjBd��n
t
|j��d|_dS)Nr��
.mh_sequencesi�F)rr!rrr�rr�rVr�r�r��O_EXCLr�rr�rrrr r!�s�
zMH.__init__cCs�|��}t|�dkrd}nt|�d}tj�|jt|��}t|�}d}z�|j
rVt|�zfz|�
||�Wn:tk
r�|j
r�t|�t	|�d}t�|��YnXt|t�r�|�||�W5|j
r�t|�XW5|s�t	|�X|S)Nrr�FT)r@r��maxrrr�rrtr�r�r�r�r�r�r�r*rhr�_dump_sequences)rr&r@Znew_keyr�r��closedrrr r'�s6


zMH.addc
Csxtj�|jt|��}zt|d�}Wn>tk
r`}z |jtjkrNt	d|��n�W5d}~XYnX|�
�t�|�dS�Nr�r�)rrr�rrtr�r�r�r�r,rVr*)rr)rr�r�rrr r*�sz	MH.removec
Cs�tj�|jt|��}zt|d�}Wn>tk
r`}z |jtjkrNt	d|��n�W5d}~XYnXzd|jrrt|�z@t�t�|tjtjB��|�||�t|t�r�|�||�W5|jr�t
|�XW5t
|�XdSr-)rrr�rrtr�r�r�r�r,r�r�r�r�rVr��O_TRUNCr�rhrr+)rr)r&rr�r�rrr r/�s$
zMH.__setitem__c
Cs�z@|jr$ttj�|jt|��d�}nttj�|jt|��d�}Wn>tk
r~}z |jtj	krlt
d|��n�W5d}~XYnX|�2|jr�t|�zt
|�}W5|jr�t|�XW5QRX|����D]\}}||kr�|�|�q�|S)Nr�r�r�)r�r�rrr�rrtr�r�r�r,r�r�r�
get_sequencesrH�add_sequence)rr)r�r�r�r��key_listrrr r3�s&zMH.get_messagec
Cs�z@|jr$ttj�|jt|��d�}nttj�|jt|��d�}Wn>tk
r~}z |jtj	krlt
d|��n�W5d}~XYnX|�F|jr�t|�z |�
��td�W�W5QR�S|jr�t|�XW5QRXdS)Nr�r�r�r[)r�r�rrr�rrtr�r�r�r,r�r�r^rorp�rr)r�r�rrr r;s zMH.get_bytesc
Csfzttj�|jt|��d�}Wn>tk
r\}z |jtjkrJt	d|��n�W5d}~XYnXt
|�S)Nr�r�)r�rrr�rrtr�r�r�r,r�r2rrr r6)szMH.get_filecCsttdd�t�|j�D���S)Ncss|]}|��rt|�VqdSr)�isdigitr�)�.0r�rrr �	<genexpr>6s�zMH.iterkeys.<locals>.<genexpr>)�iterr�rr�rr=rrr r>4szMH.iterkeyscCstj�tj�|jt|���Sr)rrr�r�rrtr(rrr rI9szMH.__contains__cCstt|����Sr)r�r?r>r=rrr rJ=sz
MH.__len__cCs2|js.ttj�|jd�d�|_t|j�d|_dS)Nr(r�T)r�r�rrr�rr�r�r=rrr rTAs
zMH.lockcCs(|jr$t|j�t|j�|`d|_dSr�)r�r�r�r�r=rrr rUHs


z	MH.unlockcCsdSrrr=rrr rSPszMH.flushcCs|jr|��dSr)r�rUr=rrr rVTszMH.closecCs<g}t�|j�D]&}tj�tj�|j|��r|�|�q|Sr)rr�rrr�r�r�r�rrr r�Ys
zMH.list_folderscCsttj�|j|�|jdd�S)NFr��rrrr�rrr�rrr r�as�z
MH.get_foldercCsttj�|j|�|jd�S)Nr�r7r�rrr r�fs�z
MH.add_foldercCs`tj�|j|�}t�|�}|dgkr:t�tj�|d��n|gkrDntd|j��t�|�dS)Nr(zFolder not empty: %s)rrr�rr�r*rr�)rr�r�entriesrrr r�ks

zMH.remove_folderc

si}ttj�|jd�ddd���}t|����|D]�}z�|�d�\}}t�}|��D]H}|��rn|�	t
|��qRdd�|�d�D�\}}	|�t||	d	��qR�fd
d�t
|�D�||<t||�dkr�||=Wq0tk
r�td
|����Yq0Xq0W5QRX|S)Nr(�r�ASCII��encodingr�css|]}t|�VqdSr)r�)r4�xrrr r5�sz#MH.get_sequences.<locals>.<genexpr>�-r�csg|]}|�kr|�qSrr)r4r)�Zall_keysrr �
<listcomp>�s�z$MH.get_sequences.<locals>.<listcomp>rz"Invalid sequence specification: %s)r�rrr�r�setr@r�r3r'r�rR�ranger�r�rYr�rstrip)
rZresultsr�r�r��contentsr@�specrrrr?r r/ws(
�zMH.get_sequencescCsttj�|jd�ddd�}z�t�t�|jtjtj	B��|�
�D]�\}}t|�dkrVq@|�|d�d}d}t
t|��D]R}|d|kr�|s�d	}|�d
�n*|r�d}|�d||f�n|�d|�|}qx|r�|�t|�d
�q@|�d
�q@W5t|�XdS)Nr(zr+r:r;rr�Fr�Tr>z%s %sz %s�
)r�rrr�rr�rVr�r�r.rHr�rqr�rArt)r�	sequencesr�r�r@�prevZ
completingr)rrr �
set_sequences�s.zMH.set_sequencesc	
Cs>|��}d}g}|��D]�}|d|kr�|�||df�z4t�tj�|jt|��tj�|jt|d���WnHt	t
fk
r�t�tj�|jt|��tj�|jt|d���YnXt�tj�|jt|���|d7}q|d|_
t|�dkr�dS|��D]0\}}|D]"\}}||k�r
|||�|�<�q
q�|�|�dS)Nrr�)r/r>r�rr�rr�rrtr�r�r��unlinkr�r�rH�indexrI)	rrGrHZchangesr)r�r1�oldr�rrr �pack�s0��



zMH.packcCst|��}|��}|��D]0\}}||kr4|�|�q||kr||�|�=q|D]}||krN|g||<qN|�|�dSr)r/rHr�rKrI)rr&r)Zpending_sequencesZ
all_sequencesr�r1�sequencerrr r+�szMH._dump_sequences)NT)r�r�r�r!r'r*r/r3r;r6r>rIrJrTrUrSrVr�r�r�r�r/rIrMr+rrrr r�s,
"c@s�eZdZedddddddh�Zd$d
d�Zdd
�Zdd�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zd d!�Zd"d#�ZdS)%r�unseen�deletedZfiled�answered�	forwardedZedited�resentNTcCst�||||�i|_dSr)r�r!�_labelsrrrr r!�szBabyl.__init__cCs(t�||�}t|t�r$|��|j|<|Sr)r�r'rhr�
get_labelsrT)rr&r)rrr r'�s
z	Babyl.addcCs"t�||�||jkr|j|=dSr)r�r*rTr(rrr r*�s
zBabyl.removecCs*t�|||�t|t�r&|��|j|<dSr)r�r/rhrrUrTr.rrr r/�s
zBabyl.__setitem__c
Cs�|�|�\}}|j�|�|j��t��}|j��}|dtks\|sHq\|�|�td��q,t��}|j��}|tks�|s|q�|�|�td��qd||j�	�}|j�
|�}|�td�}t|��|�}	|	�
|���||jkr�|	�|j|�|	S�N�*** EOOH ***r[)r�r�rnr{rirjrprqror�r^rrz�set_visiblerT�
set_labels)
rr)rr�original_headersr�Zvisible_headers�nZbodyr�rrr r3�s*



zBabyl.get_messagec	Cs�|�|�\}}|j�|�|j��t��}|j��}|dtks\|sHq\|�|�td��q,|j��}|tksv|s\qvq\|�	�}||j�
�}|j�|�}|�td�}||SrV)r�r�rnr{rirjrprqrorzr�r^)	rr)rrrZr�Zheadersr[r�rrr r;s 


zBabyl.get_bytescCst�|�|��dt��Sr)rirjr;rorpr(rrr r6%szBabyl.get_filecCs<|��t�}|j��D]}|�|�q|�|j�t|�Sr)r�rArTrFrR�difference_update�_special_labelsr?)r�labelsZ
label_listrrr rU)szBabyl.get_labelscCs:gg}}|j�d�d}g}|}|j��}|j��}|dtkr�t|�t|�krd|�|tt��|�|�dd�|j��dd��d�D�}|�|�q|dks�|dtkr�t|�t|�kr�|�|tt��q|s|�|tt��q�qtt	t
||���|_tt	|��|_t|j�|_
|j�dd�|j��|_dS)	NrscSsg|]}|��r|���qSr)�strip�r4�labelrrr r@@s�z'Babyl._generate_toc.<locals>.<listcomp>r��,�r�)r�rnr{r�rpr�r�r�rr r!r�rTr�r�)rr"r#r'Zlabel_listsr$r�r^rrr r2s4



�zBabyl._generate_toccCsVdt}|dt7}|��}dd�|D�}|dd�|�t7}|d7}|�|�dS)NsBABYL OPTIONS:s
Version: 5css|]}|��VqdSr)rWr`rrr r5Usz*Babyl._pre_mailbox_hook.<locals>.<genexpr>sLabels:rbrc)rprUr�rq)rr�Zbabylr^rrr r�PszBabyl._pre_mailbox_hookcCs|�dt�dS)N�rrrrr r�ZszBabyl._pre_message_hookcCs|�td�dS)Nrcrrrrr r^szBabyl._post_message_hookcCsx|j��}t|t�r�g}g}|��D]$}||jkr>|�|�q$|�|�q$|j�d�|D]}|j�d|���qZ|j�d�|D]}|j�d|��d�q�|j�t	�n|j�dt	�t|t
jj��rt
��}t
j�|dd�}|�|�|�d�|��}|j�|�d	t	��|d	k�s,|s��q,q�|j�d
t	�t|t��r�t
��}	t
j�|	dd�}
|
�|���|	��}|j�|�d	t	��|d	k�s�|�sn�q�qnn>|�d�|��}|j�|�d	t	��|d	k�s�|�s��q�q�|�d�}|�s��qf|j�|�d	t	���q�nTt|ttt
jf��rt|t
j��rJt�dtd
�|��}t|t��r`|�|�}|�d�d}|ddk�r�|j�|d|��d	t	��|j�d
t	�|j�|d|��d	t	��|j�||d��d	t	��n(|j�d
t	t	�|j�|�d	t	���nXt |d��rVt |d��r:t�dtd
�|j!}|��}
d}|��}|�"d��rl|dd�d	}n|�"d��r�|dd�d	}|j�|�d	t	��|d	k�s�|�sF|�r�d}|j�d
t	�|�|
�n�qڐqF|��}|�s�qf|�"d��r
|dd�t	}n:|�"d��r(|dd�t	}n|�"d	��rD|dd�t	}|j�|��q�nt#dt$|���|j��}||fS)N�1s, s,,� rbs1,,Frr[rWr�r\r]s

r�rdr{r_r`Trarbrcrg)%r�r�rhrrUr]r�rqrWrpr9r&rrirjrkrlrmrnr{ro�get_visibler^rurtrvrwrxryrzrZrrOr_rsr}r~)rr&rZspecial_labelsr^raZorig_bufferZorig_generatorr�Z
vis_bufferZ
vis_generatorr_Z
body_startZoriginal_posZ
first_passrrrr r	bs�







�
�
zBabyl._install_message)NT)r�r�r��	frozensetr]r!r'r*r/r3r;r6rUrr�r�rr	rrrr r�s$
�
	
c@s&eZdZddd�Zdd�Zdd�ZdS)	rNcCs�t|tjj�r4|�t�|��t|t�r�|�|�n�t|t�rP|�t�	|��n~t|t
�rl|�t�|��nbt|tj
�r�|�t�|��nDt|d�r�|�t�|��n(|dkr�tjj�|�ntdt|���dS)Nr^rg)rhr9r&r�_become_message�copyZdeepcopy�_explain_torur:rtZmessage_from_stringri�
TextIOWrapperZmessage_from_filerOZmessage_from_binary_filer!r}r~r%rrr r!�s



zMessage.__init__cCs4t|dg�}|jD]}||kr|j||j|<qdS)N�_type_specific_attributes)�getattr�__dict__)rr&Z
type_specificr�rrr ri�s
zMessage._become_messagecCst|t�rdStd��dS)Nz Cannot convert to specified type)rhrr}r%rrr rk�s
zMessage._explain_to)N)r�r�r�r!rirkrrrr r�s
c@sxeZdZdddgZddd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)r	�_subdir�_info�_dateNcCs&d|_d|_t��|_t�||�dS)Nr�r�)rprqr�rrrr!r%rrr r!�s
zMaildirMessage.__init__cCs|jSr)rpr=rrr r��szMaildirMessage.get_subdircCs(|dks|dkr||_ntd|��dS)Nr�r�z!subdir must be 'new' or 'cur': %s)rprY)rr�rrr r�szMaildirMessage.set_subdircCs"|j�d�r|jdd�SdSdS)N�2,r�r�)rqr|r=rrr �	get_flags
szMaildirMessage.get_flagscCsdd�t|��|_dS)Nrsr�)r�r�rq)r�flagsrrr �	set_flagsszMaildirMessage.set_flagscCs$|�d�t|���t|�B��dS�Nr��rvr�rArt�r�flagrrr �add_flagszMaildirMessage.add_flagcCs,|��r(|�d�t|���t|���dSrw)rtrvr�rAryrrr �remove_flagszMaildirMessage.remove_flagcCs|jSr)rrr=rrr r�szMaildirMessage.get_datecCs6zt|�|_Wn"tk
r0td|�d�YnXdS)Nzcan't convert to float: %s)�floatrrrYr})r�daterrr r�"szMaildirMessage.set_datecCs|jSr)rqr=rrr r�)szMaildirMessage.get_infocCs&t|t�r||_ntdt|���dS)Nzinfo must be a string: %s)rhrtrqr}r~)r�inforrr r�-s
zMaildirMessage.set_infocCs�t|t�r8|�|���|�|���|�|����nht|t�r�t	|���}d|kr`|�
d�|��dkrv|�
d�d|kr�|�
d�d|kr�|�
d�d|kr�|�
d�|�d	t�
|����n�t|t��rt	|���}d|kr�|�d
�d|k�r|�d�d|k�r�|�d�n�t|t��r�t	|���}d|k�rD|�d
�d|k�rX|�d
�d|k�rl|�d�d|k�r�|�d�nt|t��r�ntdt|���dS)N�S�Rr��O�T�D�F�A�
MAILER-DAEMONrO�replied�flaggedrPrQ�PrR�$Cannot convert to specified type: %s)rhr	rvrtr�r�r�r�rrAr{rr�rrr0r�	add_labelrr}r~)rr&rurrr rk4sP

















�zMaildirMessage._explain_to)N)r�r�r�rmr!r�r�rtrvr{r|r�r�r�r�rkrrrr r	�s

c@sVeZdZdgZddd�Zdd�Zddd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)r�_fromNcCsV|�dd�t|tjj�rF|��}|dk	rF|�d�rF|�|dd��t�||�dS)Nr�TzFrom rf)rrhr9r&rrr|r!)rr&rrrr r!esz_mboxMMDFMessage.__init__cCs|jSr)r�r=rrr rnsz_mboxMMDFMessage.get_fromcCs4|dk	r*|dkrt��}|dt�|�7}||_dS)NT� )r�rrr�)rrZtime_rrr rrs
z_mboxMMDFMessage.set_fromcCs|�dd�|�dd�S)N�Statusr��X-Status)r2r=rrr rtzsz_mboxMMDFMessage.get_flagscCs�t|�}d\}}dD]}||kr||7}|�|�qdD]}||kr8||7}|�|�q8|d�t|��7}z|�d|�Wn tk
r�|�d|�YnXz|�d|�Wn tk
r�|�d|�YnXdS)N)r�r�)r�r�)r�r�r�r�r�r�)rAr*r�r��replace_headerr,Z
add_header)rruZstatus_flagsZ
xstatus_flagsrzrrr rv~s&z_mboxMMDFMessage.set_flagscCs$|�d�t|���t|�B��dSrwrxryrrr r{�sz_mboxMMDFMessage.add_flagcCs4d|ksd|kr0|�d�t|���t|���dS)Nr�r�r�rxryrrr r|�sz_mboxMMDFMessage.remove_flagc	Cs�t|t�r�t|���}d|kr(|�d�d|kr:|�d�d|krL|�d�d|kr^|�d�d|krp|�d�|d	=|d
=d�|����dd��}z|�	t
�t�
|d
���Wnttfk
r�YnX�n
t|t�r�|�|���|�|���n�t|t��rZt|���}d|k�r$|�d�d|k�r8|�d�d|k�rL|�d�|d	=|d
=n�t|t��r�t|���}d|k�r�|�d�d|k�r�|�d�d|k�r�|�d�|d	=|d
=nt|t��r�ntdt|���dS)Nr�r�r�r�r�r�r�r�Zstatuszx-statusr����z%a %b %d %H:%M:%S %YrOr�r�rPrQr�)rhr	rArtr�r{r�rr�r��calendarZtimegmr��strptimerY�
OverflowErrorrrvrrr0rr�rr}r~)rr&ruZ
maybe_daterrr rk�sb





�













�z_mboxMMDFMessage._explain_to)N)N)r�r�r�rmr!rrrtrvr{r|rkrrrr r`s
	
rc@seZdZdS)r
N�r�r�r�rrrr r
�sc@sDeZdZdgZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)r�
_sequencesNcCsg|_t�||�dSr)r�rr!r%rrr r!�szMHMessage.__init__cCs|jdd�Sr)r�r=rrr r/�szMHMessage.get_sequencescCst|�|_dSr)r?r�)rrGrrr rI�szMHMessage.set_sequencescCs6t|t�r"||jkr2|j�|�ntdt|���dS)Nzsequence type must be str: %s)rhrtr�r�r}r~�rrNrrr r0�s

zMHMessage.add_sequencecCs*z|j�|�Wntk
r$YnXdSr)r�r*rYr�rrr �remove_sequence�szMHMessage.remove_sequencecCsFt|t�rdt|���}d|kr*|�d�n|�d�|�d�d|krP|�d�d|krb|�d�n�t|t�r�t|���}d|kr�|�d�n
|�d	�d|kr�|�d�d|kr�|�d
�n�t|t�r�|��D]}|�|�q�n`t|t	��r$t|���}d|k�r|�
d�d|k�rB|�
d�nt|t��r2ntdt
|���dS)
NrOr�r�r�r�r�r��ROr�r�rQr�)rhr	rAr/r�r{rrr0rr�rr}r~)rr&rGrNrrr rk�sB










�zMHMessage._explain_to)N)
r�r�r�rmr!r/rIr0r�rkrrrr r�s
c@s^eZdZddgZddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�ZdS)rrT�_visibleNcCsg|_t�|_t�||�dSr)rTrr�r!r%rrr r!"szBabylMessage.__init__cCs|jdd�Sr)rTr=rrr rU(szBabylMessage.get_labelscCst|�|_dSr)r?rT)rr^rrr rY,szBabylMessage.set_labelscCs6t|t�r"||jkr2|j�|�ntdt|���dS)Nzlabel must be a string: %s)rhrtrTr�r}r~�rrarrr r�0s

zBabylMessage.add_labelcCs*z|j�|�Wntk
r$YnXdSr)rTr*rYr�rrr �remove_label8szBabylMessage.remove_labelcCs
t|j�Sr�rr�r=rrr rg?szBabylMessage.get_visiblecCst|�|_dSrr�)rZvisiblerrr rXCszBabylMessage.set_visiblecCsb|j��D](}||kr*|j�|||�q
|j|=q
dD]$}||kr8||jkr8|||j|<q8dS)N)ZDateZFromzReply-ToZToZCCZSubject)r�r@r�)r�headerrrr �update_visibleGs
zBabylMessage.update_visiblecCsrt|t�r~t|���}d|kr*|�d�n|�d�|�d�d|ksNd|krX|�d�d|krj|�d�d	|kr||�d
�n�t|t�r�t|���}d|kr�|�d�n
|�d�d	|kr�|�d
�d|kr�|�d�n�t|t��rt|���}d|k�r|�d�d|k�rn|�d�nTt|t	��rP|�
|���|��D]}|�|��q<nt|t
��r^ntdt|���dS)NrOr�r�rRrSr�rQr�rPr�r�r�r�r�r�r�)rhr	rArUr�r{rrr0rrXrgr�rr}r~)rr&r^rarrr rkRsH










�zBabylMessage._explain_to)N)
r�r�r�rmr!rUrYr�r�rgrXr�rkrrrr rs
c@seZdZdS)r
Nr�rrrr r
|sc@s�eZdZd%dd�Zd&dd�Zd'dd�Zd(dd	�Zd)d
d�Zdd
�Zdd�Z	d*dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd �Zd!d"�Zed#d$��ZdS)+r�NcCs$||_|dkr|��|_n||_dSr)r�r��_pos)rr��posrrr r!�sz_ProxyFile.__init__cCs|�||jj�Sr)�_readr�r^�r�sizerrr r^�sz_ProxyFile.readcCs|�||jj�Sr)r�r��read1r�rrr r��sz_ProxyFile.read1cCs|�||jj�Sr)r�r�r{r�rrr r{�sz_ProxyFile.readlinecCs<g}|D].}|�|�|dk	r|t|�8}|dkrq8q|S)Nr)r�r�)r�sizehintrLr�rrr �	readlines�s
z_ProxyFile.readlinesccs|��}|sdS|VqdSr)r{)rr�rrr rE�sz_ProxyFile.__iter__cCs|jSr)r�r=rrr r��sz_ProxyFile.tellrcCs4|dkr|j�|j�|j�||�|j��|_dS)Nr��r�rnr�r��r�offset�whencerrr rn�sz_ProxyFile.seekcCs0t|d�r,zt|jd�r"|j��W5|`XdS)Nr�rV)rOr�rVr=rrr rV�s

z_ProxyFile.closecCs2|dkrd}|j�|j�||�}|j��|_|S)Nrdr�)rr��read_methodrLrrr r��sz_ProxyFile._readcCs|Srrr=rrr �	__enter__�sz_ProxyFile.__enter__cGs|��dSr)rV)r�excrrr �__exit__�sz_ProxyFile.__exit__cCs
|j��Sr)r��readabler=rrr r��sz_ProxyFile.readablecCs
|j��Sr)r��writabler=rrr r��sz_ProxyFile.writablecCs
|j��Sr)r��seekabler=rrr r��sz_ProxyFile.seekablecCs
|j��Sr)r�rSr=rrr rS�sz_ProxyFile.flushcCs&t|d�sdSt|jd�sdS|jjS)Nr�Tr,F)rOr�r,r=rrr r,�s

z_ProxyFile.closed)N)N)N)N)N)r)r�r�r�r!r^r�r{r�rEr�rnrVr�r�r�r�r�r�rS�propertyr,rrrr r��s$





		r�c@s8eZdZd
dd�Zdd�Zddd�Zd	d
�Zdd�ZdS)rNcCst�|||�||_||_dSr)r�r!�_start�_stop)rr�rrrrr r!�sz_PartialFile.__init__cCst�|�|jSr)r�r�r�r=rrr r��sz_PartialFile.tellrcCs<|dkr|j|_d}n|dkr*|j|_d}t�|||�dS)Nrr�r�)r�r�r�r�rnr�rrr rn�sz_PartialFile.seekcCsB|j|j}|dkrdS|dks0|dks0||kr4|}t�|||�S)Nrr)r�r�r�r�)rr�r�Z	remainingrrr r��sz_PartialFile._readcCst|d�r|`dS)Nr�)rOr�r=rrr rVs
z_PartialFile.close)NN)r)r�r�r�r!r�rnr�rVrrrr r�s



	rTc
Cs�d}�zbtrpzt�|tjtjB�WnJtk
rn}z,|jtjtjtjfkr\t	d|j
��n�W5d}~XYnX|�rfzt|j
d�}|��WnBtk
r�}z$|jtjtjfkr�WY�WdS�W5d}~XYnXz`zt
�|j
|j
d�d}Wn2ttfk
�r$t
�|j
|j
d�d}YnXt
�|j
�Wn0tk
�rdt
�|j
�t	d|j
��YnXWn8t�r�t�|tj�|�r�t
�|j
d��YnXdS)NFzlockf: lock unavailable: %s�.lockTzdot lock unavailable: %s)�fcntl�lockfZLOCK_EXZLOCK_NBr�r�ZEAGAINr�r�rr�r�rVrr�r�r�r�rJr�r*�LOCK_UN)r�r�Zdotlock_doner�Zpre_lockrrr r�
sL�
�r�cCs8trt�|tj�tj�|jd�r4t�|jd�dS)Nr�)r�r�r�rrr�r�r*�r�rrr r�4sr�c	Cs<t�|tjtjBtjBd�}zt|d�W�St�|�XdS)Nr�r�)rr�r�r)�O_RDWRrV)r�fdrrr r�;sr�cCs$td|tt���t��t��f�S)Nz%s.%s.%s.%s)r�r�r�r�r�rr�)rrrr r�Cs�r�cCs$|��ttd�r t�|���dS)N�fsync)rSrOrr��filenor�rrr r�Is
r�cCst|�|��dSr)r�rVr�rrr r�Osr�c@seZdZdS)rNr�rrrr rUsc@seZdZdS)rNr�rrrr rXsc@seZdZdS)rNr�rrrr r[sc@seZdZdS)rNr�rrrr r^sc@seZdZdS)rNr�rrrr ras)T)/rr�r�r�r�rjrwr9Z
email.messageZemail.generatorrir4r��ImportError�__all__rprWrrr�rrrrrr&rr	rr
rrr
r�rr�r�r�r�r�r��	Exceptionrrrrrrrrr �<module>	s�
�h8DB4-3z%mqH_c'
*__pycache__/csv.cpython-38.opt-1.pyc000064400000027210151153537560013153 0ustar00U

e5d?�@s@dZddlZddlmZmZmZmZmZmZm	Z	m
Z
mZmZm
Z
mZmZmZddlmZddlmZdddd	d
ddd
dddddddddddddgZGdd�d�ZGdd
�d
e�Zed
e�Gdd�de�Zede�Gdd�de�Zed e�Gd!d�d�ZGd"d�d�ZzeWnek
�r,eZYnXGd#d�d�ZdS)$z+
csv.py - read/write/investigate CSV files
�N)�Error�__version__�writer�reader�register_dialect�unregister_dialect�get_dialect�
list_dialects�field_size_limit�
QUOTE_MINIMAL�	QUOTE_ALL�QUOTE_NONNUMERIC�
QUOTE_NONE�__doc__)�Dialect)�StringIOrrr
rrrr�excel�	excel_tabr
rrrrr	�Snifferrr�
DictReader�
DictWriter�unix_dialectc@sDeZdZdZdZdZdZdZdZdZ	dZ
dZdZdd�Z
dd�ZdS)	rz�Describe a CSV dialect.

    This must be subclassed (see csv.excel).  Valid attributes are:
    delimiter, quotechar, escapechar, doublequote, skipinitialspace,
    lineterminator, quoting.

    �FNcCs|jtkrd|_|��dS)NT)�	__class__r�_valid�	_validate��self�r�/usr/lib64/python3.8/csv.py�__init__*s
zDialect.__init__c
Cs@zt|�Wn.tk
r:}ztt|���W5d}~XYnXdS�N)�_Dialect�	TypeErrorr�str)r�errrr/szDialect._validate)�__name__�
__module__�__qualname__r�_namer�	delimiter�	quotecharZ
escapechar�doublequote�skipinitialspace�lineterminator�quotingr rrrrrrsc@s(eZdZdZdZdZdZdZdZe	Z
dS)rz;Describe the usual properties of Excel-generated CSV files.�,�"TF�
N)r&r'r(rr*r+r,r-r.rr/rrrrr6sc@seZdZdZdZdS)rzEDescribe the usual properties of Excel-generated TAB-delimited files.�	N)r&r'r(rr*rrrrr@sz	excel-tabc@s(eZdZdZdZdZdZdZdZe	Z
dS)rz:Describe the usual properties of Unix-generated CSV files.r0r1TF�
N)r&r'r(rr*r+r,r-r.rr/rrrrrEsZunixc@s@eZdZddd�Zdd�Zedd��Zejd	d��Zd
d�ZdS)
rNrcOs6||_||_||_t||f|�|�|_||_d|_dS�Nr)�_fieldnames�restkey�restvalr�dialect�line_num)r�f�
fieldnamesr7r8r9�args�kwdsrrrr QszDictReader.__init__cCs|Sr!rrrrr�__iter__ZszDictReader.__iter__cCs@|jdkr0zt|j�|_Wntk
r.YnX|jj|_|jSr!)r6�nextr�
StopIterationr:rrrrr<]s

zDictReader.fieldnamescCs
||_dSr!)r6)r�valuerrrr<gscCs�|jdkr|jt|j�}|jj|_|gkr8t|j�}q$tt|j|��}t|j�}t|�}||krv||d�||j<n&||kr�|j|d�D]}|j||<q�|Sr5)	r:r<r@r�dict�zip�lenr7r8)r�row�dZlfZlr�keyrrr�__next__ks



zDictReader.__next__)NNNr)	r&r'r(r r?�propertyr<�setterrIrrrrrPs�
	
	
c@s6eZdZddd�Zdd�Zdd	�Zd
d�Zdd
�ZdS)rr�raisercOsB||_||_|��dkr$td|��||_t||f|�|�|_dS)N)rL�ignorez-extrasaction (%s) must be 'raise' or 'ignore')r<r8�lower�
ValueError�extrasactionr)rr;r<r8rPr9r=r>rrrr �s�zDictWriter.__init__cCstt|j|j��}|�|�Sr!)rCrDr<�writerow)r�headerrrr�writeheader�szDictWriter.writeheadercsN�jdkr8����j}|r8tdd�dd�|D������fdd��jD�S)NrLz(dict contains fields not in fieldnames: z, cSsg|]}t|��qSr)�repr)�.0�xrrr�
<listcomp>�sz,DictWriter._dict_to_list.<locals>.<listcomp>c3s|]}��|�j�VqdSr!)�getr8)rUrH��rowdictrrr�	<genexpr>�sz+DictWriter._dict_to_list.<locals>.<genexpr>)rP�keysr<rO�join)rrZZwrong_fieldsrrYr�
_dict_to_list�s
�zDictWriter._dict_to_listcCs|j�|�|��Sr!)rrQr^)rrZrrrrQ�szDictWriter.writerowcCs|j�t|j|��Sr!)r�	writerows�mapr^)rZrowdictsrrrr_�szDictWriter.writerowsN)rrLr)r&r'r(r rSr^rQr_rrrrr�s�

c@s:eZdZdZdd�Zd
dd�Zdd�Zd	d
�Zdd�ZdS)rze
    "Sniffs" the format of a CSV file (i.e. delimiter, quotechar)
    Returns a Dialect object.
    cCsdddddg|_dS)Nr0r3�;� �:)�	preferredrrrrr �szSniffer.__init__NcCsd|�||�\}}}}|s(|�||�\}}|s4td��Gdd�dt�}||_||_|pVd|_||_|S)zI
        Returns a dialect (or None) corresponding to the sample
        zCould not determine delimiterc@seZdZdZdZeZdS)zSniffer.sniff.<locals>.dialectZsniffedr2N)r&r'r(r)r.rr/rrrrr9�sr9r1)�_guess_quote_and_delimiter�_guess_delimiterrrr,r*r+r-)r�sample�
delimitersr+r,r*r-r9rrr�sniff�s
�
�
z
Sniffer.sniffc	Cs�g}dD]*}t�|tjtjB�}|�|�}|rq4q|s<dSi}i}d}|j}	|D]�}
|	dd}|
|}|r�|�|d�d||<z|	dd}|
|}Wntk
r�YqRYnX|r�|dks�||kr�|�|d�d||<z|	dd}Wntk
�rYqRYnX|
|rR|d7}qRt||jd	�}
|�rXt||jd	�}|||k}|d
k�r`d}nd}d}t�dt�	|�|
d
�tj�}|�
|��r�d}nd}|
|||fS)a�
        Looks for text enclosed between two identical quotes
        (the probable quotechar) which are preceded and followed
        by the same character (the probable delimiter).
        For example:
                         ,'some text',
        The quote with the most wins, same with the delimiter.
        If there is no quotechar the delimiter can't be determined
        this way.
        )zI(?P<delim>[^\w\n"\'])(?P<space> ?)(?P<quote>["\']).*?(?P=quote)(?P=delim)zG(?:^|\n)(?P<quote>["\']).*?(?P=quote)(?P<delim>[^\w\n"\'])(?P<space> ?)zG(?P<delim>[^\w\n"\'])(?P<space> ?)(?P<quote>["\']).*?(?P=quote)(?:$|\n)z-(?:^|\n)(?P<quote>["\']).*?(?P=quote)(?:$|\n))rFNrr�quote��delimNZspace�rHr4rz]((%(delim)s)|^)\W*%(quote)s[^%(delim)s\n]*%(quote)s[^%(delim)s\n]*%(quote)s\W*((%(delim)s)|$))rlrjTF)�re�compile�DOTALL�	MULTILINE�findall�
groupindexrX�KeyError�max�escape�search)r�datarhZmatchesZrestrZregexpZquotes�delimsZspacesrs�m�nrHr+rlr-Z	dq_regexpr,rrrre�s`




��z"Sniffer._guess_quote_and_delimitercCsttd|�d���}dd�td�D�}tdt|��}d}i}i}i}d|}	}
|	t|�k�rR|d7}||	|
�D]@}|D]6}|�|i�}
|�|�}|
�|d�d|
|<|
||<qxqp|��D]�}t||�	��}t|�dkr�|dddkr�q�t|�dk�rLt
|d	d
�d�||<|�||�||d||dtdd
�|D��f||<q�|d||<q�|�	�}t
t||t|���}d}d}t|�dk�r�||k�r�|D]T\}}|ddk�r�|ddk�r�|d||k�r�|dk�s�||k�r�|||<�q�|d8}�q�t|�dk�rDt|���d}|d�|�|d�d|�k}||fS|
}	|
|7}
qN|�s\dSt|�dk�r�|jD]@}||��k�rp|d�|�|d�d|�k}||fS�qpdd�|�	�D�}|��|dd}|d�|�|d�d|�k}||fS)a�
        The delimiter /should/ occur the same number of times on
        each row. However, due to malformed data, it may not. We don't want
        an all or nothing approach, so we allow for small variations in this
        number.
          1) build a table of the frequency of each character on every line.
          2) build a table of frequencies of this frequency (meta-frequency?),
             e.g.  'x occurred 5 times in 10 rows, 6 times in 1000 rows,
             7 times in 2 rows'
          3) use the mode of the meta-frequency to determine the /expected/
             frequency for that character
          4) find out how often the character actually meets that goal
          5) the character that best meets its goal is the delimiter
        For performance reasons, the data is evaluated in chunks, so it can
        try and evaluate the smallest portion of the data possible, evaluating
        additional chunks as necessary.
        Nr4cSsg|]}t|��qSr)�chr)rU�crrrrW-sz,Sniffer._guess_delimiter.<locals>.<listcomp>��
rrkcSs|dS)Nrkr)rVrrr�<lambda>G�z*Sniffer._guess_delimiter.<locals>.<lambda>rmcss|]}|dVqdS)rkNr)rU�itemrrrr[Lsz+Sniffer._guess_delimiter.<locals>.<genexpr>g�?g�������?g{�G�z�?z%c )rrcSsg|]\}}||f�qSrr)rU�k�vrrrrWvs���)�list�filter�split�range�minrErX�countr\�itemsru�remove�sum�floatrd�sort)rrxrh�asciiZchunkLengthZ	iterationZ
charFrequencyZmodesry�start�end�line�charZ
metaFrequencyZfreqr�ZmodeListZtotalZconsistencyZ	thresholdr�r�rlr-rGrrrrfs�

����

��zSniffer._guess_delimiterc
Cs�tt|�|�|��}t|�}t|�}i}t|�D]}d||<q0d}|D]�}|dkrVq�|d7}t|�|krlqFt|���D]x}	tt	t
fD]4}
z|
||	�Wq�Wq�ttfk
r�Yq�Xq�t||	�}
|
||	krx||	dkr�|
||	<qx||	=qxqFd}|�
�D]~\}	}t|�td�k�r@t||	�|k�r6|d7}n|d8}n<z|||	�Wn"ttfk
�rr|d7}Yn
X|d8}�q|dkS)Nr�rk)rrrir@rEr�r�r\�intr��complexrO�
OverflowErrorr��typer#)
rrgZrdrrR�columnsZcolumnTypes�i�checkedrF�colZthisTypeZ	hasHeaderZcolTyperrr�
has_headersJ






zSniffer.has_header)N)	r&r'r(rr rirerfr�rrrrr�s
Lg)rrnZ_csvrrrrrrrr	r
rrr
rrr"�ior�__all__rrrrrr��	NameErrorr�rrrrr�<module>sJ@�


2
__pycache__/copyreg.cpython-38.opt-1.pyc000064400000010275151153537560014033 0ustar00U

e5d��@s�dZdddddgZiZddd�Zdd�ZzeWnek
rDYnXd	d
�Zeeee�dd�Zd
Z	dd�Z
dd�Zdd�Zdd�Z
iZiZiZdd�Zdd�Zdd�ZdS)z�Helper to provide extensibility for pickle.

This is only useful to add pickle support for extension types defined in
C, not for instances of user-defined classes.
�pickle�constructor�
add_extension�remove_extension�clear_extension_cacheNcCs,t|�std��|t|<|dk	r(t|�dS)Nz$reduction functions must be callable)�callable�	TypeError�dispatch_tabler)�ob_type�pickle_function�constructor_ob�r�/usr/lib64/python3.8/copyreg.pyrs
cCst|�std��dS)Nzconstructors must be callable)rr)�objectrrr
rscCst|j|jffS�N)�complex�real�imag)�crrr
�pickle_complex"srcCs<|tkrt�|�}n$|�||�}|jtjkr8|�||�|Sr)r�__new__�__init__)�cls�base�state�objrrr
�_reconstructor)sricCs�|j}|jD]}t|d�r|jt@sq.qt}|tkr<d}n"||krVtd|j�d���||�}|||f}z
|j}Wn\t	k
r�t
|dd�r�td|j�d|���d�z
|j}Wnt	k
r�d}YnXYnX|�}|r�t||fSt|fSdS)N�	__flags__zcannot pickle z object�	__slots__zf object: a class that defines __slots__ without defining __getstate__ cannot be pickled with protocol )
�	__class__�__mro__�hasattrr�	_HEAPTYPErr�__name__�__getstate__�AttributeError�getattr�__dict__r)�self�protorrr�args�getstate�dictrrr
�
_reduce_ex6s4


�

r,cGs|j|f|��Sr�r)rr)rrr
�
__newobj__Zsr.cCs|j|f|�|�S)zUsed by pickle protocol 4, instead of __newobj__ to allow classes with
    keyword-only arguments to be pickled correctly.
    r-)rr)�kwargsrrr
�
__newobj_ex__]sr0cCs�|j�d�}|dk	r|Sg}t|d�s(n�|jD]�}d|jkr.|jd}t|t�rV|f}|D]^}|dkrjqZqZ|�d�r�|�d�s�|j�	d�}|r�|�
d||f�q�|�
|�qZ|�
|�qZq.z
||_WnYnX|S)a�Return a list of slot names for a given class.

    This needs to find slots defined by the class and its bases, so we
    can't simply return the __slots__ attribute.  We must walk down
    the Method Resolution Order and concatenate the __slots__ of each
    class found there.  (This assumes classes don't modify their
    __slots__ attribute to misrepresent their slots after the class is
    defined.)
    �
__slotnames__Nr)r&�__weakref__�__�_z_%s%s)r&�getr r�
isinstance�str�
startswith�endswithr"�lstrip�appendr1)r�namesr�slots�name�strippedrrr
�
_slotnamescs2





r@cCs�t|�}d|krdks&ntd��||f}t�|�|krNt�|�|krNdS|tkrjtd|t|f��|tkr�td|t|f��|t|<|t|<dS)zRegister an extension code.�i���zcode out of rangeNz)key %s is already registered with code %sz$code %s is already in use for key %s)�int�
ValueError�_extension_registryr5�_inverted_registry��moduler>�code�keyrrr
r�s$�
�
�cCsR||f}t�|�|ks$t�|�|kr4td||f��t|=t|=|tkrNt|=dS)z0Unregister an extension code.  For testing only.z%key %s is not registered with code %sN)rDr5rErC�_extension_cacherFrrr
r�s��cCst��dSr)rJ�clearrrrr
r�s)N)�__doc__�__all__rrrr�	NameErrorrrr!r,r.r0r@rDrErJrrrrrrr
�<module>s4�

	$<__pycache__/shlex.cpython-38.opt-1.pyc000064400000016562151153537560013513 0ustar00U

e5d
4�	@s�dZddlZddlZddlZddlmZddlmZddddgZGd	d�d�Z	ddd�Z
d
d�Ze�dej
�jZdd�Zdd�Zedkr�eej�dkr�ee	��n,ejdZee��Zee	ee��W5QRXdS)�8A lexical analyzer class for simple shell-like syntaxes.�N)�deque)�StringIO�shlex�split�quote�joinc@sreZdZdZddd�Zedd��Zdd	�Zdd
d�Zdd
�Z	dd�Z
dd�Zdd�Zddd�Z
dd�Zdd�ZdS)rrNFcCst|t�rt|�}|dk	r(||_||_ntj|_d|_||_|rHd|_nd|_d|_	d|_
|jrn|j
d7_
d|_d|_d|_
d|_d	|_d
|_t�|_d|_d|_d|_t�|_d|_|s�d}n|d
kr�d}||_|�rt�|_|j
d7_
|j
�t�|��}|j
�|�|_
dS)N��#Z?abcdfeghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_u|ßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞz 	
Fz'"�\�"� �rTz();<>|&z~-./*?=)�
isinstance�strr�instream�infile�sys�stdin�posix�eof�
commenters�	wordchars�
whitespace�whitespace_split�quotes�escape�
escapedquotes�stater�pushback�lineno�debug�token�	filestack�source�_punctuation_chars�_pushback_chars�	maketrans�dict�fromkeys�	translate)�selfrrr�punctuation_chars�t�r.�/usr/lib64/python3.8/shlex.py�__init__sJ
zshlex.__init__cCs|jS�N)r%�r+r.r.r/r,Dszshlex.punctuation_charscCs*|jdkrtdt|��|j�|�dS)z:Push a token onto the stack popped by the get_token methodrzshlex: pushing token N)r!�print�reprr�
appendleft)r+�tokr.r.r/�
push_tokenHs
zshlex.push_tokencCspt|t�rt|�}|j�|j|j|jf�||_||_d|_|jrl|dk	r\t	d|jf�nt	d|jf�dS)z9Push an input source onto the lexer's input source stack.rNzshlex: pushing to file %szshlex: pushing to stream %s)
rrrr#r5rrr r!r3)r+�	newstream�newfiler.r.r/�push_sourceNs
zshlex.push_sourcecCsD|j��|j��\|_|_|_|jr:td|j|jf�d|_dS)zPop the input source stack.zshlex: popping to %s, line %dr
N)	r�closer#�popleftrr r!r3rr2r.r.r/�
pop_source\s

�zshlex.pop_sourcecCs�|jr.|j��}|jdkr*tdt|��|S|��}|jdk	rz||jkrz|�|���}|rp|\}}|�||�|�	�}q@||j
kr�|js�|j
S|��|�	�}qz|jdkr�||j
kr�tdt|��ntd�|S)zBGet a token from the input stream (or from stack if it's nonempty)rzshlex: popping token Nz
shlex: token=zshlex: token=EOF)
rr<r!r3r4�
read_tokenr$�
sourcehookr:�	get_tokenrr#r=)r+r6�raw�specr9r8r.r.r/r@es.








zshlex.get_tokencCs�d}d}|jr |jr |j��}n|j�d�}|dkrB|jd7_|jdkr^td|j|f�|jdkrtd|_	�q�q|jdk�r�|s�d|_�q��q�||j
kr�|jdkr�td	�|j	s�|jr|r�q�nqn�||jkr�|j�
�|jd7_n�|j�r||jk�rd
}||_n�||jk�r&||_	d
|_nr||jk�r@||_	d|_nX||jk�rb|j�sZ||_	||_n6|j�rx||_	d
|_n ||_	|j	�s�|jr|r�q�nqq|j|jk�rDd}|�s�|jdk�r�td
�td��||jk�r|j�s�|j	|7_	d|_�q�nd
|_n>|j�r4||jk�r4|j|jk�r4|j}||_n|j	|7_	q|j|jk�r�|�st|jdk�rltd�td��||jk�r�||jk�r�||k�r�|j	|j7_	|j	|7_	||_q|jdkr|�s�d|_�q�q||j
k�r|jdk�r�td�d|_|j	�s�|jr|r�q�nqq||jk�rh|j�
�|jd7_|j�r�d|_|j	�s�|jr|r�q�nqq|jdk�r�||jk�r�|j	|7_	n"||j
k�r�|j�|�d|_�q�q|j�r�||jk�r�||_q|j�r�||jk�r�d
}||_q||jk�s||jk�s|j�r,||jk�r,|j	|7_	q|j�rB|j�|�n|j�|�|jdk�rbtd�d|_|j	�s�|jr|r�q�qqq|j	}d|_	|j�r�|�s�|dk�r�d}|jdk�r�|�r�tdt|��ntd�|S)NFr
r�
�z&shlex: in state %r I see character: %rr	�z+shlex: I see whitespace in whitespace state�a�cTz shlex: I see EOF in quotes statezNo closing quotationz shlex: I see EOF in escape statezNo escaped character)rFrGz%shlex: I see whitespace in word statez&shlex: I see punctuation in word statezshlex: raw token=zshlex: raw token=EOF)r,r&�popr�readr r!r3rr"rrr�readlinerrrr�
ValueErrorr�appendrr5r4)r+ZquotedZescapedstateZnextchar�resultr.r.r/r>�s

�




���

��zshlex.read_tokencCsV|ddkr|dd�}t|jt�rHtj�|�sHtj�tj�|j�|�}|t|d�fS)z(Hook called on a filename to be sourced.rrr����r)	rrr�os�path�isabsr�dirname�open)r+r9r.r.r/r?s
zshlex.sourcehookcCs(|dkr|j}|dkr|j}d||fS)z<Emit a C-compiler-like, Emacs-friendly error-message leader.Nz"%s", line %d: )rr )r+rr r.r.r/�error_leader s
zshlex.error_leadercCs|Sr1r.r2r.r.r/�__iter__(szshlex.__iter__cCs|��}||jkrt�|Sr1)r@r�
StopIteration)r+r"r.r.r/�__next__+s
zshlex.__next__)NNFF)N)NN)�__name__�
__module__�__qualname__�__doc__r0�propertyr,r7r:r=r@r>r?rUrVrXr.r.r.r/rs �
/

	 	
FTcCs$t||d�}d|_|sd|_t|�S)z-Split the string *s* using shell-like syntax.)rTr	)rrr�list)�sZcommentsrZlexr.r.r/r1s
cCsd�dd�|D��S)z3Return a shell-escaped string from *split_command*.r
css|]}t|�VqdSr1)r)�.0�argr.r.r/�	<genexpr><szjoin.<locals>.<genexpr>)r)Z
split_commandr.r.r/r:sz[^\w@%+=:,./-]cCs,|sdSt|�dkr|Sd|�dd�dS)z1Return a shell-escaped version of the string *s*.z''N�'z'"'"')�_find_unsafe�replace)r_r.r.r/rAs
cCs$|��}|sq tdt|��qdS)NzToken: )r@r3r4)ZlexerZttr.r.r/�
_print_tokensMsrf�__main__r)FT)r\rP�rer�collectionsr�ior�__all__rrr�compile�ASCII�searchrdrrfrY�len�argv�fnrT�fr.r.r.r/�<module>s(	 
	

__pycache__/_sitebuiltins.cpython-38.pyc000064400000006633151153537560014304 0ustar00U

e5d+�@s@dZddlZGdd�de�ZGdd�de�ZGdd�de�ZdS)	z=
The objects used by the site module to add custom builtins.
�Nc@s&eZdZdd�Zdd�Zddd�ZdS)	�QuittercCs||_||_dS�N��name�eof)�selfrr�r�%/usr/lib64/python3.8/_sitebuiltins.py�__init__szQuitter.__init__cCsd|j|jfS)NzUse %s() or %s to exitr�rrrr	�__repr__szQuitter.__repr__NcCs(ztj��WnYnXt|��dSr)�sys�stdin�close�
SystemExit)r�coderrr	�__call__s
zQuitter.__call__)N)�__name__�
__module__�__qualname__r
rrrrrr	r
src@s6eZdZdZdZd
dd�Zdd�Zdd	�Zd
d�ZdS)�_Printerzninteractive prompt objects for printing the license text, a list of
    contributors and the copyright notice.�rcs4ddl�||_||_d|_��fdd�|D�|_dS)Nrcs$g|]}�D]}�j�||��qqSr)�path�join)�.0�dir�filename��files�osrr	�
<listcomp>(s�z%_Printer.__init__.<locals>.<listcomp>)r�_Printer__name�_Printer__data�_Printer__lines�_Printer__filenames)rr�datar�dirsrrr	r
#s�z_Printer.__init__c
Cs~|jr
dSd}|jD]B}z(t|d��}|��}W5QRXWqXWqtk
rTYqXq|sb|j}|�d�|_t|j�|_dS)N�r�
)	r#r$�open�read�OSErrorr"�split�len�_Printer__linecnt)rr%r�fprrr	�__setup,s

z_Printer.__setupcCs8|��t|j�|jkr$d�|j�Sd|jfdSdS)Nr(z!Type %s() to see the full %s text�)�_Printer__setupr-r#�MAXLINESrr!rrrr	r<sz_Printer.__repr__cCs�|��d}d}z(t|||j�D]}t|j|�q"Wntk
rPYq�YqX||j7}d}|dkr~t|�}|dkr`d}q`|dkrq�qdS)Nz0Hit Return for more, or q (and Return) to quit: r)��qr5)r2�ranger3�printr#�
IndexError�input)r�prompt�lineno�i�keyrrr	rCs 

z_Printer.__call__N)rr)	rrr�__doc__r3r
r2rrrrrr	rs
	rc@s eZdZdZdd�Zdd�ZdS)�_Helpera3Define the builtin 'help'.

    This is a wrapper around pydoc.help that provides a helpful message
    when 'help' is typed at the Python interactive prompt.

    Calling help() at the Python prompt starts an interactive help session.
    Calling help(thing) prints help for the python object 'thing'.
    cCsdS)NzHType help() for interactive help, or help(object) for help about object.rrrrr	rbsz_Helper.__repr__cOsddl}|j||�S)Nr)�pydoc�help)r�args�kwdsr@rrr	resz_Helper.__call__N)rrrr>rrrrrr	r?Xs	r?)r>r
�objectrrr?rrrr	�<module>s
;__pycache__/smtplib.cpython-38.opt-2.pyc000064400000045462151153537560014044 0ustar00U

e5dɯ�
@snddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
Zddddddd	d
ddd
ddg
ZdZdZdZdZdZdZe�dej�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd	�d	e�Z Gdd
�d
e�Z!Gdd�de�Z"Gd d�de�Z#d!d
�Z$d"d#�Z%d$d�Z&d%d&�Z'd'd(�Z(zddl)Z)Wne*k
�r�d)Z+YnXd*Z+Gd+d�d�Z,e+�r�Gd,d-�d-e,�Z-e�.d-�d.Z/Gd/d0�d0e,�Z0e1d1k�rjd2d3�Z2e2d4�Z3e2d5��4d6�Z5e6d7�d8Z7ej8�9�Z:e:�s&�q2e7e:Z7�qe6d9e;e7��e,d:�Z<e<�=d;�e<�>e3e5e7�e<�?�dS)<�N)�body_encode�
SMTPException�SMTPNotSupportedError�SMTPServerDisconnected�SMTPResponseException�SMTPSenderRefused�SMTPRecipientsRefused�
SMTPDataError�SMTPConnectError�
SMTPHeloError�SMTPAuthenticationError�	quoteaddr�	quotedata�SMTP�i��
s
i �z	auth=(.*)c@seZdZdS)rN��__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/smtplib.pyrHsc@seZdZdS)rNrrrrrrKsc@seZdZdS)rNrrrrrrRsc@seZdZdd�ZdS)rcCs||_||_||f|_dS�N)�	smtp_code�
smtp_error�args)�self�code�msgrrr�__init__cszSMTPResponseException.__init__N�rrrr rrrrrZs	c@seZdZdd�ZdS)rcCs"||_||_||_|||f|_dSr)rr�senderr)rrrr"rrrr oszSMTPSenderRefused.__init__Nr!rrrrrhsc@seZdZdd�ZdS)rcCs||_|f|_dSr)�
recipientsr)rr#rrrr }szSMTPRecipientsRefused.__init__Nr!rrrrrusc@seZdZdS)r	Nrrrrrr	�sc@seZdZdS)r
Nrrrrrr
�sc@seZdZdS)rNrrrrrr�sc@seZdZdS)rNrrrrrr�scCs>tj�|�\}}||fdkr6|���d�r.|Sd|Sd|S)N��r%�<z<%s>)�email�utils�	parseaddr�strip�
startswith�Z
addrstringZdisplayname�addrrrrr
�scCs$tj�|�\}}||fdkr |S|S)Nr$)r'r(r)r,rrr�
_addr_only�sr.c	Cst�ddt�dt|��S)Nz(?m)^\.z..�(?:\r\n|\n|\r(?!\n))��re�sub�CRLF��datarrrr�s�cCst�dd|�S)Ns(?m)^\.s..)r1r2)Zbindatarrr�_quote_periods�sr6cCst�dt|�S)Nr/r0r4rrr�	_fix_eols�sr7FTc@sveZdZdZdZdZdZdZdZdZ	e
Zdddej
dfdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�ZdMdd�Zdd�ZdNdd�Zdd�ZdOdd�ZdPdd�ZdQdd�Zd d!�ZdRd"d#�Zd$d%�Zd&d'�Zd(d)�ZdSd+d,�Z dTd-d.�Z!d/d0�Z"d1d2�Z#e#Z$d3d4�Z%d5d6�Z&d7d8�d9d:�Z'dUd;d<�Z(dVd=d>�Z)dWd?d@�Z*d7d8�dAdB�Z+dXdCdD�Z,dYdEdF�Z-dZdGdH�Z.dIdJ�Z/dKdL�Z0dS)[rrN�ehlor%c
Cs�||_||_i|_d|_||_d|_|rR|�||�\}}|dkrR|��t||��|dk	rb||_	nPt
��}d|krz||_	n8d}	zt
�t
�
��}	Wnt
jk
r�YnXd|	|_	dS)N�asciir���.z	127.0.0.1z[%s])�_host�timeout�esmtp_features�command_encoding�source_address�_auth_challenge_count�connect�closer
�local_hostname�socketZgetfqdnZ
gethostbynameZgethostnameZgaierror)
r�host�portrDr=r@rrZfqdnr-rrrr �s,
z
SMTP.__init__cCs|Srr�rrrr�	__enter__szSMTP.__enter__cGsNz>z$|�d�\}}|dkr$t||��Wntk
r:YnXW5|��XdS)NZQUIT��)rC�docmdrr)rrr�messagerrr�__exit__s
z
SMTP.__exit__cCs
||_dSr)�
debuglevel)rrNrrr�set_debuglevel"szSMTP.set_debuglevelcGs@|jdkr,ttj����f|�dtji�nt|dtji�dS)N��file)rN�print�datetimeZnow�time�sys�stderr�rrrrr�_print_debug+s
"zSMTP._print_debugcCs2|jdkr|�d||f|j�t�||f||j�S)Nrzconnect: to)rNrXr@rE�create_connection)rrFrGr=rrr�_get_socket1s

�zSMTP._get_socket�	localhostcCs�|r
||_|s||�d�|�d�kr||�d�}|dkr||d|�||dd�}}zt|�}Wntk
rztd��YnX|s�|j}t�d|||�|�	|||j
�|_d|_|�
�\}}|jdkr�|�dt|��||fS)N�:rrPznonnumeric portzsmtplib.connect�connect:)r@�find�rfind�int�
ValueError�OSError�default_portrU�auditrZr=�sockrQ�getreplyrNrX�repr)rrFrGr@�irrrrrrB9s&

zSMTP.connectcCs�|jdkr|�dt|��|jr|t|t�r6|�|j�}t�	d||�z|j�
|�Wq�tk
rx|��t
d��Yq�Xnt
d��dS)Nrzsend:zsmtplib.send�Server not connectedzplease run connect() first)rNrXrgre�
isinstance�str�encoder?rUrdZsendallrbrCr)r�srrr�sendZs

z	SMTP.sendcCsd|dkr|}n|�d|��}d|ks,d|krN|�dd��dd�}td|����|�|�t���dS)Nr%� �
�
z\nz\rz=command and arguments contain prohibited newline characters: )�replacerarnr3)r�cmdrrmrrr�putcmdms�zSMTP.putcmdc
CsPg}|jdkr|j�d�|_z|j�td�}Wn:tk
rj}z|��tdt|���W5d}~XYnX|s�|��td��|j	dkr�|�
dt|��t|�tkr�|��t
dd��|�|d	d��d
��|dd�}zt|�}Wn tk
�rd}Y�q YnX|dd	�d
kr�q qd�|�}|j	dk�rH|�
d||f�||fS)N�rbrPz Connection unexpectedly closed: zConnection unexpectedly closedrzreply:i�zLine too long.�s 	
�����-�
zreply: retcode (%s); Msg: %a)rQreZmakefile�readline�_MAXLINErbrCrrkrNrXrg�lenr�appendr*r`ra�join)r�resp�line�erZerrcode�errmsgrrrrfzs>

�


z
SMTP.getreplycCs|�||�|��Sr�rtrf)rrsrrrrrK�sz
SMTP.docmdcCs,|�d|p|j�|��\}}||_||fS)N�helo)rtrDrf�	helo_resp)r�namerrrrrr��sz	SMTP.heloc
Cs.i|_|�|j|p|j�|��\}}|dkrJt|�dkrJ|��td��||_|dkr`||fSd|_	|j�
d��d�}|d=|D]�}t�
|�}|r�|j�dd	�d
|�d�d|jd<q�t�
d|�}|r�|�d���}|j|�d�d���}	|dk�r|j�|d	�d
|	|j|<q�|	|j|<q�||fS)
Nrxrri�rPzlatin-1rq�authr%roz((?P<feature>[A-Za-z0-9][A-Za-z0-9\-]*) ?�feature)r>rt�ehlo_msgrDrfr}rCr�	ehlo_resp�
does_esmtp�decode�split�
OLDSTYLE_AUTH�match�get�groupsr1�group�lower�string�endr*)
rr�rrr��eachZ
auth_match�mr�Zparamsrrrr8�sB
��

��z	SMTP.ehlocCs|��|jkSr)r�r>)r�optrrr�has_extn�sz
SMTP.has_extncCs|�d|�|��dS)N�helprPr�rWrrrr��sz	SMTP.helpcCsd|_|�d�S)Nr9�rset)r?rKrHrrrr��sz	SMTP.rsetcCs&z|��Wntk
r YnXdSr)r�rrHrrr�_rset�sz
SMTP._rsetcCs
|�d�S)N�noop)rKrHrrrr�	sz	SMTP.nooprcCshd}|rH|jrHtdd�|D��r:|�d�r2d|_ntd��dd�|�}|�dd	t|�|f�|��S)
Nr%css|]}|��dkVqdS)�smtputf8N)r�)�.0�xrrr�	<genexpr>szSMTP.mail.<locals>.<genexpr>r�zutf-8z SMTPUTF8 not supported by serverro�mailz	FROM:%s%s)	r��anyr�r?rrrtr
rf)rr"�options�
optionlistrrrr�
s	

�z	SMTP.mailcCs<d}|r|jrdd�|�}|�ddt|�|f�|��S)Nr%ro�rcptzTO:%s%s)r�rrtr
rf)rZrecipr�r�rrrr�"s

z	SMTP.rcptcCs�|�d�|��\}}|jdkr0|�d||f�|dkrDt||��n|t|t�r\t|��d�}t	|�}|dd�t
kr||t
}|dt
}|�|�|��\}}|jdkr�|�d||f�||fSdS)Nr5rzdata:ibr9����.)rtrfrNrXr	rjrkr7rlr6�bCRLFrn)rrr�repl�qrrrr5*s"





z	SMTP.datacCs|�dt|��|��S)N�vrfy�rtr.rf�rZaddressrrr�verifyGszSMTP.verifycCs|�dt|��|��S)N�expnr�r�rrrr�Nsz	SMTP.expncCsb|jdkr^|jdkr^d|��dkr0dks^n|��\}}d|krRdks^nt||��dS)N��ri+)r�r�r8r�r)rrr�rrr�ehlo_or_helo_if_neededUs
zSMTP.ehlo_or_helo_if_neededT��initial_response_okc	Cs�|��}|r|�nd}|dk	rPt|�d�dd�}|�d|d|�\}}d|_n|�d|�\}}d|_|dkr�|jd7_t�|�}t||��d�dd�}|�|�\}}|jtkrftd	t	||f���qf|d
kr�||fSt
||��dS)Nr9r%)ZeolZAUTHrorPriNz4Server AUTH mechanism infinite loop. Last response: ���i�)�upper�
encode_base64rlrKrA�base64Zdecodebytes�
_MAXCHALLENGErrgr)	rZ	mechanismZ
authobjectr�Zinitial_responseZresponserr��	challengerrrr�fs2
�

��z	SMTP.authcCs0|dkrdS|jdt�|j�d�|d���S)Nror9Zmd5)�user�hmacZHMAC�passwordrlZ	hexdigest�rr�rrr�
auth_cram_md5�s
�zSMTP.auth_cram_md5cCsd|j|jfS)Nz%s%s)r�r�r�rrr�
auth_plain�szSMTP.auth_plaincCs"|dks|jdkr|jS|jSdS)N�)rAr�r�r�rrr�
auth_login�szSMTP.auth_logincs�|��|�d�std��|jd���dddg}�fdd�|D�}|sPtd��|||_|_|D]t}d	|���	d
d�}z4|j
|t||�|d�\}}	|d
kr�||	fWSWqbtk
r�}
z|
}W5d}
~
XYqbXqb|�dS)Nr�z,SMTP AUTH extension not supported by server.zCRAM-MD5ZPLAINZLOGINcsg|]}|�kr|�qSrr)r�r��Zadvertised_authlistrr�
<listcomp>�s�zSMTP.login.<locals>.<listcomp>z(No suitable authentication method found.Zauth_�-�_r�r�)
r�r�rr>r�rr�r�r�rrr��getattrr)rr�r�r�Zpreferred_authsZauthlistZ
authmethodZmethod_namerr�r�Zlast_exceptionrr�r�login�s0
�
�
z
SMTP.logincCs�|��|�d�std��|�d�\}}|dkr�ts<td��|dk	rT|dk	rTtd��|dk	rl|dk	rltd��|dk	s||dk	r�ddl}|�d	t	d
�|dkr�t
j||d�}|j|j
|jd�|_
d|_d|_d|_i|_d|_n
t||��||fS)
N�starttlsz+STARTTLS extension not supported by server.ZSTARTTLSr:z&No SSL support included in this Python�4context and keyfile arguments are mutually exclusive�5context and certfile arguments are mutually exclusiver�Akeyfile and certfile are deprecated, use a custom context insteadr���certfile�keyfile�Zserver_hostname)r�r�rrK�	_have_ssl�RuntimeErrorra�warnings�warn�DeprecationWarning�ssl�_create_stdlib_context�wrap_socketrer<rQr�r�r>r�r)rr�r��contextr�Zreplyr�rrrr��sB
����
z
SMTP.starttlscCs^|��g}t|t�r$t|��d�}|jrZ|�d�rF|�dt|��|D]}|�|�qJ|�	||�\}}	|dkr�|dkr�|�
�n|��t||	|��i}
t|t�r�|g}|D]H}|�
||�\}}	|dkr�|dkr�||	f|
|<|dkr�|�
�t|
��q�t|
�t|�k�r|��t|
��|�|�\}}	|dk�rZ|dk�rH|�
�n|��t||	��|
S)Nr9�sizezsize=%dr�i��)r�rjrkr7rlr�r�r~r}r�rCr�rr�rr5r	)r�	from_addr�to_addrsr�mail_options�rcpt_optionsZ
esmtp_optsZoptionrr�Zsenderrsr�rrr�sendmail&sF@








z
SMTP.sendmailc	Cs�|��|�d�}|dkr d}nt|�dkr2d}ntd��|dkr||d|krZ||dn
||d}tj�|g�dd}|dkr�d	d
�||d||d||d
fD�}dd
�tj�|�D�}t�|�}	|	d=|	d=d}
zd�|f|���	d�Wn.t
k
�r(|�d��s td��d}
YnXt
���R}|
�r^tjj||jjdd�d�}|d�}ntj�|�}|j|	dd�|��}
W5QRX|�|||
||�S)NzResent-Dater%rPzResent-z0message has more than one 'Resent-' header blockZSender�FromrcSsg|]}|dk	r|�qSrr)r��frrrr��s�z%SMTP.send_message.<locals>.<listcomp>�ToZBccZCccSsg|]}|d�qS)rPr)r��arrrr��sz
Resent-BccFr9r�z�One or more source or delivery addresses require internationalized email support, but the server does not advertise the required SMTPUTF8 capabilityT)�utf8)�policy�SMTPUTF8�
BODY=8BITMIMEr)�linesep)r�r�)r�Zget_allr}rar'r(Zgetaddresses�copyrrl�UnicodeEncodeErrorr�r�io�BytesIO�	generatorZBytesGeneratorr�ZcloneZflatten�getvaluer�)rrr�r�r�r�ZresentZ
header_prefixZaddr_fieldsZmsg_copyZ
internationalZbytesmsg�gZflatmsgrrr�send_message�sX

�
�

�
�

�
�zSMTP.send_messagecCs<z|j}d|_|r|��W5|j}d|_|r6|��XdSr)rerCrQ)rrerQrrrrC�sz
SMTP.closecCs.|�d�}d|_|_i|_d|_|��|S)N�quitF)rKr�r�r>r�rC)r�resrrrr��s
z	SMTP.quit)r[rN)r%)r%)r%)r%)r%)r)r)N)N)N)NNN)rr)NNrr)1rrrrNrerQr�r�r�r��	SMTP_PORTrcrE�_GLOBAL_DEFAULT_TIMEOUTr rIrMrOrXrZrBrnrtrfrKr�r8r�r�r�r�r�r�r�r5r�r�r�r�r�r�r�r�r�r�r�r�rCr�rrrrr�sf�
0
	
!

1



3


0
	

B
8�
h�
M
c@s4eZdZeZdddddejddfdd�Zdd�ZdS)�SMTP_SSLr%rNc	
Cs�|dk	r|dk	rtd��|dk	r0|dk	r0td��|dk	s@|dk	rVddl}	|	�dtd�||_||_|dkrxtj||d�}||_t	�
||||||�dS)Nr�r�rr�r�r�)rar�r�r�r�r�r�r�r�rr )
rrFrGrDr�r�r=r@r�r�rrrr s(���zSMTP_SSL.__init__cCsD|jdkr|�d||f�t�||f||j�}|jj||jd�}|S)Nrr]r�)rNrXrErYr@r�r�r<)rrFrGr=Z
new_socketrrrrZs
��zSMTP_SSL._get_socket)	rrr�
SMTP_SSL_PORTrcrEr�r rZrrrrr��s�
r�i�c@s,eZdZdZdeddfdd�Zd
dd	�ZdS)�LMTPZlhlor%NcCstj|||||d�dS)N)rDr@)rr )rrFrGrDr@rrrr ;s�z
LMTP.__init__r[rcCs�|ddkrtj||||d�Sz(t�tjtj�|_d|_|j�|�WnBtk
r�|jdkrl|�	d|�|jr||j�
�d|_�YnX|��\}}|jdkr�|�	d|�||fS)Nr�/)r@z
connect fail:r])rrBrEZAF_UNIXZSOCK_STREAMrerQrbrNrXrCrf)rrFrGr@rrrrrrBAs"


zLMTP.connect)r[rN)rrrr��	LMTP_PORTr rBrrrrr�+s
�
r��__main__cCs(tj�|d�tj��tj����S)Nz: )rU�stdout�write�flush�stdinr{r*)�promptrrrr[s
rr�r��,zEnter message, end with ^D:r%zMessage length is %dr[rP)@rEr�r1Zemail.utilsr'Z
email.messageZemail.generatorr�r�r�rSrUZemail.base64mimerr��__all__r�r�r3r�r|r��compile�Ir�rbrrrrrrr	r
rrr
r.rr6r7r��ImportErrorr�rr�r~r�r�rrZfromaddrr�ZtoaddrsrRrrr{r�r}ZserverrOr�r�rrrr�<module>,s��


	
:0
/


__pycache__/ssl.cpython-38.opt-2.pyc000064400000101524151153537560013163 0ustar00U

e5dH��
@s�ddlZddlZddlmZddlmZmZm	Z
ddlZddlmZm
Z
mZddlmZmZmZddlmZmZmZmZmZmZmZddlmZmZddlmZmZmZm Z zdd	lm!Z!Wne"k
r�YnXdd
lm#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,ddlm-Z-m.Z.ej/de0d
d�ed�e
j/de0dd�ed�ej/de0dd�ed�ej/de0dd�ed�e
j/de0dd�ed�ej/de0dd�ed�e1j2Z3e1_3dd�e1j4�5�D�Z6e7e1dd�Z8Gdd�de�Z9Gdd �d e�Z:Gd!d"�d"e�Z;Gd#d$�d$e�Z<ej=d%k�rdd&lm>Z>m?Z?dd'l@m@Z@mAZAmBZBmCZCdd(l@mDZDmEZEddl@ZFddlGZGddlHZHddlIZIeJZKd)gZLeMed*�ZNe-ZOeZPd+d,�ZQd-d.�ZRd/d0�ZSd1d2�ZTed3d4�ZUd5d6�ZVGd7d8�d8ed8d9��ZWGd:d;�d;eWe�ZXGd<d=�d=e�ZYeXjZfdddd>�d?d@�Z[e2fe\dAeXjZddddddB�dCdD�Z]e[Z^e]Z_GdEdF�dF�Z`dGdH�ZaGdIdJ�dJe@�ZbebeY_ce`eY_ddddAe\e2ddKdKdf	dLdM�ZedNdO�ZfdPZgdQZhdRdS�ZidTdU�Zje2dfdVdW�ZkdXdY�ZldS)Z�N)�
namedtuple)�Enum�IntEnum�IntFlag)�OPENSSL_VERSION_NUMBER�OPENSSL_VERSION_INFO�OPENSSL_VERSION)�_SSLContext�	MemoryBIO�
SSLSession)�SSLError�SSLZeroReturnError�SSLWantReadError�SSLWantWriteError�SSLSyscallError�SSLEOFError�SSLCertVerificationError)�txt2obj�nid2obj)�RAND_status�RAND_add�
RAND_bytes�RAND_pseudo_bytes)�RAND_egd)
�HAS_SNI�HAS_ECDH�HAS_NPN�HAS_ALPN�	HAS_SSLv2�	HAS_SSLv3�	HAS_TLSv1�HAS_TLSv1_1�HAS_TLSv1_2�HAS_TLSv1_3)�_DEFAULT_CIPHERS�_OPENSSL_API_VERSION�
_SSLMethodcCs|�d�o|dkS)NZ	PROTOCOL_�PROTOCOL_SSLv23��
startswith��name�r,�/usr/lib64/python3.8/ssl.py�<lambda>|�r.)�source�OptionscCs
|�d�S)NZOP_r(r*r,r,r-r.�r/ZAlertDescriptioncCs
|�d�S)NZALERT_DESCRIPTION_r(r*r,r,r-r.�r/ZSSLErrorNumbercCs
|�d�S)NZ
SSL_ERROR_r(r*r,r,r-r.�r/�VerifyFlagscCs
|�d�S)NZVERIFY_r(r*r,r,r-r.�r/�
VerifyModecCs
|�d�S)NZCERT_r(r*r,r,r-r.�r/cCsi|]\}}||�qSr,r,)�.0r+�valuer,r,r-�
<dictcomp>�sr6ZPROTOCOL_SSLv2c@s6eZdZejZejZejZ	ej
ZejZ
ejZejZdS)�
TLSVersionN)�__name__�
__module__�__qualname__�_sslZPROTO_MINIMUM_SUPPORTEDZMINIMUM_SUPPORTEDZPROTO_SSLv3�SSLv3ZPROTO_TLSv1ZTLSv1Z
PROTO_TLSv1_1ZTLSv1_1Z
PROTO_TLSv1_2ZTLSv1_2Z
PROTO_TLSv1_3ZTLSv1_3ZPROTO_MAXIMUM_SUPPORTEDZMAXIMUM_SUPPORTEDr,r,r,r-r7�sr7c@s$eZdZdZdZdZdZdZdZdS)�_TLSContentType������N)	r8r9r:�CHANGE_CIPHER_SPEC�ALERTZ	HANDSHAKEZAPPLICATION_DATA�HEADERZINNER_CONTENT_TYPEr,r,r,r-r=�sr=c@s�eZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#d"Z$d#S)$�
_TLSAlertTyper�
r>r?r@��(�)�*�+�,�-�.�/�0�1�2�3�<�F�G�P�V�Z�d�m�n�o�p�q�r�s�t�xN)%r8r9r:ZCLOSE_NOTIFYZUNEXPECTED_MESSAGEZBAD_RECORD_MACZDECRYPTION_FAILEDZRECORD_OVERFLOWZDECOMPRESSION_FAILUREZHANDSHAKE_FAILUREZNO_CERTIFICATEZBAD_CERTIFICATEZUNSUPPORTED_CERTIFICATEZCERTIFICATE_REVOKEDZCERTIFICATE_EXPIREDZCERTIFICATE_UNKNOWNZILLEGAL_PARAMETERZ
UNKNOWN_CAZ
ACCESS_DENIEDZDECODE_ERRORZ
DECRYPT_ERRORZEXPORT_RESTRICTIONZPROTOCOL_VERSIONZINSUFFICIENT_SECURITYZINTERNAL_ERRORZINAPPROPRIATE_FALLBACKZ
USER_CANCELEDZNO_RENEGOTIATIONZMISSING_EXTENSIONZUNSUPPORTED_EXTENSIONZCERTIFICATE_UNOBTAINABLEZUNRECOGNIZED_NAMEZBAD_CERTIFICATE_STATUS_RESPONSEZBAD_CERTIFICATE_HASH_VALUEZUNKNOWN_PSK_IDENTITYZCERTIFICATE_REQUIREDZNO_APPLICATION_PROTOCOLr,r,r,r-rG�sDrGc@sdeZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZdZdZdS)�_TLSMessageTyper����������
���r>r?r@rA��C�rCN)r8r9r:Z
HELLO_REQUESTZCLIENT_HELLOZSERVER_HELLOZHELLO_VERIFY_REQUESTZNEWSESSION_TICKETZEND_OF_EARLY_DATAZHELLO_RETRY_REQUESTZENCRYPTED_EXTENSIONSZCERTIFICATEZSERVER_KEY_EXCHANGEZCERTIFICATE_REQUESTZSERVER_DONEZCERTIFICATE_VERIFYZCLIENT_KEY_EXCHANGEZFINISHEDZCERTIFICATE_URLZCERTIFICATE_STATUSZSUPPLEMENTAL_DATAZ
KEY_UPDATEZ
NEXT_PROTOZMESSAGE_HASHrDr,r,r,r-rf�s,rf�win32)�enum_certificates�	enum_crls)�socket�AF_INET�SOCK_STREAM�create_connection)�
SOL_SOCKET�SO_TYPE�
tls-unique�HOSTFLAG_NEVER_CHECK_SUBJECTcCs�|sdS|�d�}|s&|��|��kS|dkr<td�|���|�d�\}}}d|krbtd�|���|sttd�|���|dkr�td�|���|�d�\}}}|r�|s�dS|��|��kS)	NF�*rgz1too many wildcards in certificate DNS name: {!r}.�.z9wildcard can only be present in the leftmost label: {!r}.z>sole wildcard without additional labels are not support: {!r}.z<partial wildcards in leftmost label are not supported: {!r}.)�count�lower�CertificateError�format�	partition)Zdn�hostnameZ	wildcardsZdn_leftmost�sepZdn_remainderZhostname_leftmostZhostname_remainderr,r,r-�_dnsname_matchs@

�������r�cCs�zt�|�}Wntk
r"Yn"Xt�|�|kr6|Std�|���zt�tj|�WStk
rvtd�|���Yntk
r�YnXtd�|���dS)Nz'{!r} is not a quad-dotted IPv4 address.z+{!r} is neither an IPv4 nor an IP6 address.z{!r} is not an IPv4 address.)	�_socketZ	inet_aton�OSErrorZ	inet_ntoa�
ValueErrorr�Z	inet_ptonZAF_INET6�AttributeError)Zipname�addrr,r,r-�_inet_patonDs$��
r�cCst|���}||kS�N)r��rstrip)Zcert_ipaddress�host_ipZipr,r,r-�_ipaddress_matchgsr�cCsJ|std��zt|�}Wntk
r0d}YnXg}|�dd�}|D]^\}}|dkrz|dkrnt||�rndS|�|�qF|dkrF|dk	r�t||�r�dS|�|�qF|s�|�dd�D]6}|D],\}}|dkr�t||�r�dS|�|�q�q�t|�dk�rtd	|d
�t	t
|��f��n,t|�dk�r>td||df��ntd
��dS)Nztempty or no certificate, match_hostname needs a SSL socket or SSL context with either CERT_OPTIONAL or CERT_REQUIREDZsubjectAltNamer,ZDNSz
IP AddressZsubjectZ
commonNamergz&hostname %r doesn't match either of %sz, zhostname %r doesn't match %rrz=no appropriate commonName or subjectAltName fields were found)r�r��getr��appendr��lenr��join�map�repr)�certr�r�ZdnsnamesZsan�keyr5�subr,r,r-�match_hostnamessB


�
�r��DefaultVerifyPathszQcafile capath openssl_cafile_env openssl_cafile openssl_capath_env openssl_capathcCsdt��}tj�|d|d�}tj�|d|d�}ttj�|�rF|ndtj�|�rX|ndf|��S)Nrrgrhri)	r;�get_default_verify_paths�os�environr�r��path�isfile�isdir)�parts�cafile�capathr,r,r-r��s��r�cs@eZdZdZ�fdd�Ze�fdd��Ze�fdd��Z�ZS)�_ASN1Objectr,cst�j|ft|dd���S)NFr*��super�__new__�_txt2obj)�cls�oid��	__class__r,r-r��sz_ASN1Object.__new__cst�j|ft|���Sr�)r�r��_nid2obj)r�Znidr�r,r-�fromnid�sz_ASN1Object.fromnidcst�j|ft|dd���S)NTr*r�)r�r+r�r,r-�fromname�sz_ASN1Object.fromname)	r8r9r:�	__slots__r��classmethodr�r��
__classcell__r,r,r�r-r��sr�znid shortname longname oidc@seZdZdZdZdS)�Purposez1.3.6.1.5.5.7.3.1z1.3.6.1.5.5.7.3.2N)r8r9r:�SERVER_AUTHZCLIENT_AUTHr,r,r,r-r��sr�cs�eZdZdZdZdZefdd�Zdd�Zd1d	d
�Z	d2dd�Z
d
d�Zdd�Zdd�Z
dd�Zejfdd�Zeed�r�e�fdd��Zej�fdd��Ze�fdd��Zej�fdd��Ze�fdd��Zej�fd d��Zeed!��red"d#��Zejd$d#��Zned%d#��Ze�fd&d'��Zej�fd(d'��Ze�fd)d*��Ze�fd+d,��Zej�fd-d,��Ze�fd.d/��Zej�fd0d/��Z�ZS)3�
SSLContext)ZCAZROOTNcOst�||�}|Sr�)r	r�)r��protocol�args�kwargs�selfr,r,r-r��szSSLContext.__new__cCs4|dkrdSt|t�r&|�d��d�S|�d�SdS)NZidna�ascii)�
isinstance�str�encode�decode)r�r�r,r,r-�_encode_hostname�s

zSSLContext._encode_hostnameFTc	Cs|jj|||||||d�S)N)�sock�server_side�do_handshake_on_connect�suppress_ragged_eofs�server_hostname�context�session)�sslsocket_class�_create)r�r�r�r�r�r�r�r,r,r-�wrap_socket�s�zSSLContext.wrap_socketcCs|jj||||�|�||d�S)N)r�r�r�r�)�sslobject_classr�r�)r��incoming�outgoingr�r�r�r,r,r-�wrap_bio�s�zSSLContext.wrap_biocCs`t�}|D]F}t|d�}t|�dks0t|�dkr8td��|�t|��|�|�q
|�|�dS)Nr�r�z(NPN protocols must be 1 to 255 in length)�	bytearray�bytesr�rr��extendZ_set_npn_protocols)r�Z
npn_protocols�protosr��br,r,r-�set_npn_protocolss
zSSLContext.set_npn_protocolscs8�dkrd�_n$t��s td����fdd�}|�_dS)Nznot a callable objectcs��|�}�|||�Sr�)r�)�sslobjZ
servernameZsslctx�r��server_name_callbackr,r-�shim_cbs
z3SSLContext.set_servername_callback.<locals>.shim_cb)Zsni_callback�callable�	TypeError)r�r�r�r,r�r-�set_servername_callbacksz"SSLContext.set_servername_callbackcCs`t�}|D]F}t|d�}t|�dks0t|�dkr8td��|�t|��|�|�q
|�|�dS)Nr�rr�z)ALPN protocols must be 1 to 255 in length)r�r�r�rr�r�Z_set_alpn_protocols)r�Zalpn_protocolsr�r�r�r,r,r-�set_alpn_protocols s
zSSLContext.set_alpn_protocolscCsvt�}z<t|�D].\}}}|dkr|dks4|j|kr|�|�qWntk
r`t�d�YnX|rr|j|d�|S)NZx509_asnTz-unable to enumerate Windows certificate store)�cadata)r�rxr�r��PermissionError�warnings�warn�load_verify_locations)r��	storename�purposeZcertsr��encodingZtrustr,r,r-�_load_windows_store_certs+sz$SSLContext._load_windows_store_certscCs@t|t�st|��tjdkr4|jD]}|�||�q"|��dS)Nrw)r�r�r��sys�platform�_windows_cert_storesr�Zset_default_verify_paths)r�r�r�r,r,r-�load_default_certs9s


zSSLContext.load_default_certs�minimum_versioncstt�j�Sr�)r7r�r��r�r�r,r-r�BszSSLContext.minimum_versioncs4|tjkr|jtjM_ttt�j�||�dSr�)	r7r<�optionsr1ZOP_NO_SSLv3r�r�r��__set__�r�r5r�r,r-r�Fs
cstt�j�Sr�)r7r��maximum_versionr�r�r,r-r�LszSSLContext.maximum_versioncsttt�j�||�dSr�)r�r�r�r�r�r�r,r-r�Pscstt�j�Sr�)r1r�r�r�r�r,r-r�TszSSLContext.optionscsttt�j�||�dSr�)r�r�r�r�r�r�r,r-r�Xsr�cCs|jtj@}|tjkSr��Z_host_flagsr;r�)r�Zncsr,r,r-�hostname_checks_common_name]sz&SSLContext.hostname_checks_common_namecCs,|r|jtjM_n|jtjO_dSr�r�r�r,r,r-r�bscCsdS�NTr,r�r,r,r-r�iscst�j}|dk	r|jSdSdSr�)r��
_msg_callback�
user_function)r��innerr�r,r-r�ms!zSSLContext._msg_callbackcsb�dkr ttt�j�|d�dSt�d�s8t��d����fdd�}�|_ttt�j�||�dS)N�__call__z is not callable.cs�zt|�}Wntk
r YnXzt|�}Wntk
rBYnX|tjkrTt}n|tjkrdt}nt}z||�}Wntk
r�YnX�||||||�Sr�)r7r�r=rFrErGrf)Zconn�	direction�versionZcontent_typeZmsg_type�dataZmsg_enum��callbackr,r-r��s,

�z'SSLContext._msg_callback.<locals>.inner)r�r�r�r��hasattrr�r�)r�rr�r�rr-r��s
cstt�j�Sr�)r&r�r�r�r�r,r-r��szSSLContext.protocolcstt�j�Sr�)r2r��verify_flagsr�r�r,r-r�szSSLContext.verify_flagscsttt�j�||�dSr�)r�r�rr�r�r�r,r-r�scs0t�j}z
t|�WStk
r*|YSXdSr�)r��verify_moder3r�r�r�r,r-r�s

zSSLContext.verify_modecsttt�j�||�dSr�)r�r�rr�r�r�r,r-r�s)FTTNN)FNN) r8r9r:r�r�r��PROTOCOL_TLSr�r�r�r�r�r�r�r�r�r�r�rr	�propertyr��setterr�r�r;r�r�r�rrr�r,r,r�r-r��sl�
�





&%r�)r�r�r�cCs�t|t�st|��tt�}|tjkr0t|_d|_	|s<|s<|rL|�
|||�n|jtkr`|�|�t
|d�r�tj�d�}|r�tjjs�||_|S)NT�keylog_filename�
SSLKEYLOGFILE)r�r�r�r�rr�r��
CERT_REQUIREDr�check_hostnamer��	CERT_NONEr�rr�r�r�r��flags�ignore_environmentr)r�r�r�r�r��
keylogfiler,r,r-�create_default_context�s




rF)�	cert_reqsrr��certfile�keyfiler�r�r�cCs�t|t�st|��t|�}	|s$d|	_|dk	r2||	_|r<d|	_|rL|sLtd��|sT|r`|	�||�|sl|sl|r||	�|||�n|	jt	kr�|	�
|�t|	d�r�tj
�d�}
|
r�tjjs�|
|	_|	S)NFT�certfile must be specifiedrr	)r�r�r�r�rrr��load_cert_chainr�rr�rr�r�r�r�r
rr)r�rrr�rrr�r�r�r�rr,r,r-�_create_unverified_context�s,



rc@s�eZdZdd�Zed1dd��Zedd��Zejd	d��Zed
d��Z	e	jdd��Z	ed
d��Z
edd��Zedd��Zd2dd�Z
dd�Zd3dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd4d+d,�Zd-d.�Zd/d0�ZdS)5�	SSLObjectcOst|jj�d���dS)NzU does not have a public constructor. Instances are returned by SSLContext.wrap_bio().�r�r�r8�r�r�r�r,r,r-�__init__;s�zSSLObject.__init__FNc	Cs*|�|�}|j||||||d�}||_|S)N)r�r��ownerr�)r�Z	_wrap_bio�_sslobj)	r�r�r�r�r�r�r�r�r�r,r,r-r�As
�zSSLObject._createcCs|jjSr��rr�r�r,r,r-r�MszSSLObject.contextcCs||j_dSr�r�r�Zctxr,r,r-r�RscCs|jjSr��rr�r�r,r,r-r�VszSSLObject.sessioncCs||j_dSr�r�r�r�r,r,r-r�[scCs|jjSr��r�session_reusedr�r,r,r-r"_szSSLObject.session_reusedcCs|jjSr�)rr�r�r,r,r-r�dszSSLObject.server_sidecCs|jjSr�)rr�r�r,r,r-r�iszSSLObject.server_hostname�cCs(|dk	r|j�||�}n|j�|�}|Sr�)r�read)r�r��buffer�vr,r,r-r$oszSSLObject.readcCs|j�|�Sr�)r�write�r�r�r,r,r-r'{szSSLObject.writecCs|j�|�Sr�)r�getpeercert�r�Zbinary_formr,r,r-r)�szSSLObject.getpeercertcCstjr|j��SdSr�)r;rr�selected_npn_protocolr�r,r,r-r+�szSSLObject.selected_npn_protocolcCstjr|j��SdSr�)r;rr�selected_alpn_protocolr�r,r,r-r,�sz SSLObject.selected_alpn_protocolcCs
|j��Sr�)r�cipherr�r,r,r-r-�szSSLObject.ciphercCs
|j��Sr�)r�shared_ciphersr�r,r,r-r.�szSSLObject.shared_cipherscCs
|j��Sr�)r�compressionr�r,r,r-r/�szSSLObject.compressioncCs
|j��Sr�)r�pendingr�r,r,r-r0�szSSLObject.pendingcCs|j��dSr�)r�do_handshaker�r,r,r-r1�szSSLObject.do_handshakecCs
|j��Sr�)r�shutdownr�r,r,r-�unwrap�szSSLObject.unwrapr�cCs|j�|�Sr�)r�get_channel_binding�r�Zcb_typer,r,r-r4�szSSLObject.get_channel_bindingcCs
|j��Sr��rr�r�r,r,r-r��szSSLObject.versioncCs
|j��Sr�)r�verify_client_post_handshaker�r,r,r-r7�sz&SSLObject.verify_client_post_handshake)FNNN)r#N)F)r�)r8r9r:rr�r�rr�rr�r"r�r�r$r'r)r+r,r-r.r/r0r1r3r4r�r7r,r,r,r-r,sF�








	
rcCstt|j�j|_|Sr�)�getattrrr8�__doc__)�funcr,r,r-�_sslcopydoc�sr;cseZdZdd�ZedW�fdd�	�Zeedd	���Zej	d
d	��Zeedd���Z
e
j	d
d��Z
eedd���Zdd�ZdXdd�Z
dd�ZdYdd�Zdd�ZedZdd��Zedd��Zedd ��Zed!d"��Zed#d$��Zed%d&��Zd[�fd(d)�	Zd\�fd*d+�	Zd,d-�Zd]�fd.d/�	Zd^�fd0d1�	Zd_�fd2d3�	Zd`�fd4d5�	Zda�fd6d7�	Zdb�fd8d9�	Zd:d;�Z d<d=�Z!ed>d?��Z"�fd@dA�Z#edBdC��Z$edDdE��Z%�fdFdG�Z&edcdHdI��Z'�fdJdK�Z(dLdM�Z)dNdO�Z*�fdPdQ�Z+edddSdT��Z,edUdV��Z-�Z.S)e�	SSLSocketcOst|jj�d���dS)NzX does not have a public constructor. Instances are returned by SSLContext.wrap_socket().rrr,r,r-r�s�zSSLSocket.__init__FTNc

s�|�tt�tkrtd��|r8|r(td��|dk	r8td��|jrJ|sJtd��t|j|j	|j
|��d�}|j|f|�}	t
t|	�jf|�|	�|���|��||	_||	_d|	_d|	_||	_|�|�|	_||	_||	_z|	��Wn6tk
�r}
z|
jtjkr��d}W5d}
~
XYnXd}||	_ |�r�zH|	jj!|	||	j|	|	jd�|	_|�rj|	��}|d	k�rbtd
��|	�"�Wn$ttfk
�r�|	�#��YnX|	S)Nz!only stream sockets are supportedz4server_hostname can only be specified in client modez,session can only be specified in client modez'check_hostname requires server_hostname)�family�type�proto�filenoFT�rr��zHdo_handshake_on_connect should not be specified for non-blocking sockets)$Z
getsockoptr~rr|�NotImplementedErrorr�r�dictr=r>r?r@r�r�r<r�
settimeout�
gettimeout�detach�_context�_sessionZ_closedrr�r�r�r�r��getpeernamer��errnoZENOTCONN�
_connected�_wrap_socketr1�close)
r�r�r�r�r�r�r�r�r�r��eZ	connected�timeoutr�r,r-r��sj
��
zSSLSocket._createcCs|jSr�)rHr�r,r,r-r�szSSLSocket.contextcCs||_||j_dSr�)rHrr�rr,r,r-r�scCs|jdk	r|jjSdSr�rr�r,r,r-r� s
zSSLSocket.sessioncCs||_|jdk	r||j_dSr�)rIrr�r r,r,r-r�&s
cCs|jdk	r|jjSdSr�r!r�r,r,r-r",s
zSSLSocket.session_reusedcCstd|jj��dS)NzCan't dup() %s instances)rCr�r8r�r,r,r-�dup2s�z
SSLSocket.dupcCsdSr�r,)r��msgr,r,r-�_checkClosed6szSSLSocket._checkClosedcCs|js|��dSr�)rLrJr�r,r,r-�_check_connected:szSSLSocket._check_connectedr#c
Cs�|��|jdkrtd��z*|dk	r4|j�||�WS|j�|�WSWnVtk
r�}z8|jdtkr�|jr�|dk	r|WY�dSWY�dSn�W5d}~XYnXdS)Nz'Read on closed or unwrapped SSL socket.rr/)rSrr�r$rr�Z
SSL_ERROR_EOFr�)r�r�r%�xr,r,r-r$Bs

zSSLSocket.readcCs&|��|jdkrtd��|j�|�S)Nz(Write on closed or unwrapped SSL socket.)rSrr�r'r(r,r,r-r'Ws
zSSLSocket.writecCs|��|��|j�|�Sr�)rSrTrr)r*r,r,r-r)`szSSLSocket.getpeercertcCs*|��|jdkstjsdS|j��SdSr�)rSrr;rr+r�r,r,r-r+fszSSLSocket.selected_npn_protocolcCs*|��|jdkstjsdS|j��SdSr�)rSrr;rr,r�r,r,r-r,nsz SSLSocket.selected_alpn_protocolcCs$|��|jdkrdS|j��SdSr�)rSrr-r�r,r,r-r-vs
zSSLSocket.ciphercCs$|��|jdkrdS|j��SdSr�)rSrr.r�r,r,r-r.~s
zSSLSocket.shared_cipherscCs$|��|jdkrdS|j��SdSr�)rSrr/r�r,r,r-r/�s
zSSLSocket.compressionrcsF|��|jdk	r4|dkr(td|j��|j�|�St��||�SdS)Nrz3non-zero flags not allowed in calls to send() on %s)rSrr�r�r'r��send)r�r�r
r�r,r-rV�s
��zSSLSocket.sendcsL|��|jdk	r"td|j��n&|dkr8t��||�St��|||�SdS)Nz%sendto not allowed on instances of %s)rSrr�r�r��sendto)r�r�Z
flags_or_addrr�r�r,r-rW�s
�zSSLSocket.sendtocOstd|j��dS)Nz&sendmsg not allowed on instances of %s�rCr�rr,r,r-�sendmsg�s�zSSLSocket.sendmsgc
s�|��|jdk	r�|dkr(td|j��d}t|��H}|�d��2}t|�}||krn|�||d��}||7}qJW5QRXW5QRXnt��	||�SdS)Nrz6non-zero flags not allowed in calls to sendall() on %s�B)
rSrr�r��
memoryview�castr�rVr��sendall)r�r�r
r�ZviewZ	byte_viewZamountr&r�r,r-r]�s
�� zSSLSocket.sendallcs,|jdk	r|�|||�St��|||�SdSr�)rZ_sendfile_use_sendr��sendfile)r��file�offsetr�r�r,r-r^�s
zSSLSocket.sendfilecsD|��|jdk	r2|dkr(td|j��|�|�St��||�SdS)Nrz3non-zero flags not allowed in calls to recv() on %s)rSrr�r�r$r��recv�r�Zbuflenr
r�r,r-ra�s
��
zSSLSocket.recvcsj|��|r|dkrt|�}n|dkr*d}|jdk	rV|dkrJtd|j��|�||�St��|||�SdS)Nr#rz8non-zero flags not allowed in calls to recv_into() on %s)rSr�rr�r�r$r��	recv_into�r�r%�nbytesr
r�r,r-rc�s

��zSSLSocket.recv_intocs4|��|jdk	r"td|j��nt��||�SdS)Nz'recvfrom not allowed on instances of %s)rSrr�r�r��recvfromrbr�r,r-rf�s
�zSSLSocket.recvfromcs6|��|jdk	r"td|j��nt��|||�SdS)Nz,recvfrom_into not allowed on instances of %s)rSrr�r�r��
recvfrom_intordr�r,r-rg�s
�zSSLSocket.recvfrom_intocOstd|j��dS)Nz&recvmsg not allowed on instances of %srXrr,r,r-�recvmsg�s�zSSLSocket.recvmsgcOstd|j��dS)Nz+recvmsg_into not allowed on instances of %srXrr,r,r-�recvmsg_into�s�zSSLSocket.recvmsg_intocCs$|��|jdk	r|j��SdSdS)Nr)rSrr0r�r,r,r-r0�s

zSSLSocket.pendingcs|��d|_t��|�dSr�)rSrr�r2)r�Zhowr�r,r-r2�szSSLSocket.shutdowncCs.|jr|j��}d|_|Stdt|���dS�NzNo SSL wrapper around )rr2r�r�)r��sr,r,r-r3s

zSSLSocket.unwrapcCs$|jr|j��Stdt|���dSrj)rr7r�r�r�r,r,r-r7s
z&SSLSocket.verify_client_post_handshakecsd|_t���dSr�)rr��_real_closer�r�r,r-rlszSSLSocket._real_closec	CsF|��|��}z$|dkr(|r(|�d�|j��W5|�|�XdS)NrB)rTrFrErr1)r��blockrPr,r,r-r1s
zSSLSocket.do_handshakec	s�|jrtd��|js|jdk	r&td��|jj|d|j||jd�|_z@|rVt��	|�}nd}t��
|�|s~d|_|jr~|��|WSt
tfk
r�d|_�YnXdS)Nz!can't connect in server-side modez/attempt to connect already-connected SSLSocket!FrAT)r�r�rLrr�rMr�rIr��
connect_ex�connectr�r1r�)r�r�rnZrcr�r,r-�
_real_connect!s0�zSSLSocket._real_connectcCs|�|d�dS)NF�rp�r�r�r,r,r-ro;szSSLSocket.connectcCs|�|d�Sr�rqrrr,r,r-rn@szSSLSocket.connect_excs.t���\}}|jj||j|jdd�}||fS)NT)r�r�r�)r��acceptr�r�r�r�)r�Znewsockr�r�r,r-rsEs�zSSLSocket.acceptr�cCs4|jdk	r|j�|�S|tkr,td�|���dSdS)Nz({0} channel binding type not implemented)rr4�CHANNEL_BINDING_TYPESr�r�r5r,r,r-r4Qs
�zSSLSocket.get_channel_bindingcCs|jdk	r|j��SdSdSr�r6r�r,r,r-r�\s

zSSLSocket.version)FTTNNN)N)r#N)F)r)N)r)rN)r#r)Nr)r#r)Nr)F)r�)/r8r9r:rr�r�rr;r�rr�r"rQrSrTr$r'r)r+r,r-r.r/rVrWrYr]r^rarcrfrgrhrir0r2r3r7rlr1rprornrsr4r�r�r,r,r�r-r<�s��>



	











r<Tc
Csl|r|std��|r |s td��t|�}
||
_|r<|
�|�|rL|
�||�|	rZ|
�|	�|
j||||d�S)Nz5certfile must be specified for server-side operationsr)r�r�r�r�)r�r�rr�rZset_ciphersr�)r�rrr�r�ssl_version�ca_certsr�r�Zciphersr�r,r,r-r�is$

�r�cCs�ddlm}ddlm}d}d}z|�|dd����d}Wn$tk
rbtd||f��Yn0X||dd�|�}||d|f|d	d
��SdS)Nr)�strptime)�timegm)ZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDecz %d %H:%M:%S %Y GMTrirgz*time data %r does not match format "%%b%s"rhrl)�timerwZcalendarrx�index�titler�)Z	cert_timerwrxZmonthsZtime_formatZmonth_numberZttr,r,r-�cert_time_to_seconds�s
�r|z-----BEGIN CERTIFICATE-----z-----END CERTIFICATE-----csRtt�|�dd��tg}|�fdd�tdt��d�D�7}|�td�d�|�S)N�ASCII�strictcsg|]}�||d��qS)�@r,)r4�i��fr,r-�
<listcomp>�sz(DER_cert_to_PEM_cert.<locals>.<listcomp>rr�
)	r��base64Zstandard_b64encode�
PEM_HEADER�ranger�r��
PEM_FOOTERr�)Zder_cert_bytesZssr,r�r-�DER_cert_to_PEM_cert�s
"r�cCs\|�t�stdt��|���t�s0tdt��|��tt�tt��}t�|�	dd��S)Nz(Invalid PEM encoding; must start with %sz&Invalid PEM encoding; must end with %sr}r~)
r)r�r��strip�endswithr�r�r�Zdecodebytesr�)Zpem_cert_string�dr,r,r-�PEM_cert_to_DER_cert�s
��r�c

Csd|\}}|dk	rt}nt}t|||d�}t|��&}|�|��}|�d�}	W5QRXW5QRXt|	�S)N)rr�T)r
r�_create_stdlib_contextr}r�r)r�)
r�rurvZhostZportrr�r�ZsslsockZdercertr,r,r-�get_server_certificate�s�
r�cCst�|d�S)Nz	<unknown>)�_PROTOCOL_NAMESr�)Z
protocol_coder,r,r-�get_protocol_name�sr�)mr�r��collectionsr�enumrZ_EnumrZ_IntEnumrZ_IntFlagr;rrrr	r
rrr
rrrrrrr�rr�rrrrr�ImportErrorrrrrrrr r!r"r#r$r%�	_convert_r8r&rr'�__members__�itemsr�r8Z_SSLv2_IF_EXISTSr7r=rGrfr�rxryrzr{r|r}r~rr�r�rKr�r�Zsocket_errorrtrZHAS_NEVER_CHECK_COMMON_NAMEZ_RESTRICTED_SERVER_CIPHERSr�r�r�r�r�r�r�r�r�r�r�rrrZ_create_default_https_contextr�rr;r<r�r�r�r|r�r�r�r�r�r�r,r,r,r-�<module>]s�$0������
)
1#9�z�#�/�


__pycache__/antigravity.cpython-38.pyc000064400000001437151153537560013765 0ustar00U

e5d��@s&ddlZddlZe�d�dd�ZdS)�Nzhttps://xkcd.com/353/cCs\t�|���}dd�|dd�|dd�fD�\}}td||dd�||dd�f�dS)z�Compute geohash() using the Munroe algorithm.

    >>> geohash(37.421542, -122.085589, b'2005-05-26-10458.68')
    37.857713 -122.544543

    cSsg|]}dt�d|��qS)z%fz0.)�float�fromhex)�.0�x�r�#/usr/lib64/python3.8/antigravity.py�
<listcomp>szgeohash.<locals>.<listcomp>N�� z	%d%s %d%s�)�hashlibZmd5Z	hexdigest�print)ZlatitudeZ	longitudeZdatedow�h�p�qrrr�geohashs&r)Z
webbrowserr�openrrrrr�<module>s
__pycache__/abc.cpython-38.pyc000064400000012330151153537560012143 0ustar00U

e5d��@s�dZdd�ZGdd�de�ZGdd�de�ZGdd�de�Zz,d	d
lm	Z	m
Z
mZmZm
Z
mZmZmZWn*ek
r�d	dlmZm	Z	de_YnXGd
d�de�ZGdd�ded�ZdS)z3Abstract Base Classes (ABCs) according to PEP 3119.cCs
d|_|S)a<A decorator indicating abstract methods.

    Requires that the metaclass is ABCMeta or derived from it.  A
    class that has a metaclass derived from ABCMeta cannot be
    instantiated unless all of its abstract methods are overridden.
    The abstract methods can be called using any of the normal
    'super' call mechanisms.  abstractmethod() may be used to declare
    abstract methods for properties and descriptors.

    Usage:

        class C(metaclass=ABCMeta):
            @abstractmethod
            def my_abstract_method(self, ...):
                ...
    T)�__isabstractmethod__)�funcobj�r�/usr/lib64/python3.8/abc.py�abstractmethodsrcs$eZdZdZdZ�fdd�Z�ZS)�abstractclassmethodztA decorator indicating abstract classmethods.

    Deprecated, use 'classmethod' with 'abstractmethod' instead.
    Tcsd|_t��|�dS�NT�r�super�__init__��self�callable��	__class__rrr
$szabstractclassmethod.__init__��__name__�
__module__�__qualname__�__doc__rr
�
__classcell__rrrrrsrcs$eZdZdZdZ�fdd�Z�ZS)�abstractstaticmethodzvA decorator indicating abstract staticmethods.

    Deprecated, use 'staticmethod' with 'abstractmethod' instead.
    Tcsd|_t��|�dSrrrrrrr
1szabstractstaticmethod.__init__rrrrrr)src@seZdZdZdZdS)�abstractpropertyzoA decorator indicating abstract properties.

    Deprecated, use 'property' with 'abstractmethod' instead.
    TN)rrrrrrrrrr6sr�)�get_cache_token�	_abc_init�
_abc_register�_abc_instancecheck�_abc_subclasscheck�	_get_dump�_reset_registry�
_reset_caches)�ABCMetar�abccsReZdZdZ�fdd�Zdd�Zdd�Zdd	�Zddd�Zd
d�Z	dd�Z
�ZS)r!a�Metaclass for defining Abstract Base Classes (ABCs).

        Use this metaclass to create an ABC.  An ABC can be subclassed
        directly, and then acts as a mix-in class.  You can also register
        unrelated concrete classes (even built-in classes) and unrelated
        ABCs as 'virtual subclasses' -- these and their descendants will
        be considered subclasses of the registering ABC by the built-in
        issubclass() function, but the registering ABC won't show up in
        their MRO (Method Resolution Order) nor will method
        implementations defined by the registering ABC be callable (not
        even via super()).
        cs"t�j||||f|�}t|�|S)N)r	�__new__r)�mcls�name�bases�	namespace�kwargs�clsrrrr#TszABCMeta.__new__cCs
t||�S)z{Register a virtual subclass of an ABC.

            Returns the subclass, to allow usage as a class decorator.
            )r�r)�subclassrrr�registerYszABCMeta.registercCs
t||�S)z'Override for isinstance(instance, cls).)r)r)�instancerrr�__instancecheck__`szABCMeta.__instancecheck__cCs
t||�S)z'Override for issubclass(subclass, cls).)rr*rrr�__subclasscheck__dszABCMeta.__subclasscheck__NcCs�td|j�d|j��|d�tdt���|d�t|�\}}}}td|��|d�td|��|d�td|��|d�td|��|d�d	S)
z'Debug helper to print the ABC registry.zClass: �.)�filezInv. counter: z_abc_registry: z_abc_cache: z_abc_negative_cache: z_abc_negative_cache_version: N)�printrrrr)r)r1�
_abc_registry�
_abc_cache�_abc_negative_cache�_abc_negative_cache_versionrrr�_dump_registryhs�
�zABCMeta._dump_registrycCst|�dS)z.Clear the registry (for debugging or testing).N)r�r)rrr�_abc_registry_cleartszABCMeta._abc_registry_clearcCst|�dS)z,Clear the caches (for debugging or testing).N)r r8rrr�_abc_caches_clearxszABCMeta._abc_caches_clear)N)rrrrr#r,r.r/r7r9r:rrrrrr!Gs
r!c@seZdZdZdZdS)�ABCzVHelper class that provides a standard way to create an ABC using
    inheritance.
    rN)rrrr�	__slots__rrrrr;}sr;)�	metaclassN)rr�classmethodr�staticmethodr�propertyr�_abcrrrrrrrr �ImportErrorZ_py_abcr!r�typer;rrrr�<module>s

	,6__pycache__/hmac.cpython-38.pyc000064400000016352151153537560012336 0ustar00U

&�.e��@s�dZddlZddlmZzddlZWnek
r@dZdZ	YnXe
ej�Z	ddlZddlZ
ddlZedd�ed�D��Zedd�ed�D��ZdZGdd	�d	�Zd
d�ZGdd
�d
ej�Ze
��r�eZddd�Zdd�ZdS)zqHMAC (Keyed-Hashing for Message Authentication) module.

Implements the HMAC algorithm as described by RFC 2104.
�N)�_compare_digestccs|]}|dAVqdS)�\N���.0�xrr�/usr/lib64/python3.8/hmac.py�	<genexpr>sr	�ccs|]}|dAVqdS)�6Nrrrrrr	sc@sReZdZdZdZddd�Zedd��Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�ZdS)�HMACz~RFC 2104 HMAC class.  Also complies with RFC 4231.

    This supports the API for Cryptographic Hash Functions (PEP 247).
    �@N�csVt��rtd��t|ttf�s0tdt|�j���s<td��t	��rL�|_
n,t�t�rhd�fdd�	|_
nd�fdd�	|_
|�
�|_|�
�|_
|j
j|_t|j
d�r�|j
j}|d	kr�t�d
||jftd�|j}nt�d|jtd�|j}||_t|�|k�r|�
|���}|�|d
�}|j�|�t��|j
�|�t��|dk	�rR|�|�dS)a?Create a new HMAC object.

        key: bytes or buffer, key for the keyed hash object.
        msg: bytes or buffer, Initial input for the hash or None.
        digestmod: A hash name suitable for hashlib.new(). *OR*
                   A hashlib constructor returning a new hash object. *OR*
                   A module supporting PEP 247.

                   Required as of 3.8, despite its position after the optional
                   msg argument.  Passing it as a keyword argument is
                   recommended, though not required for legacy API reasons.
        z9This class is not available in FIPS mode. Use hmac.new().�,key: expected bytes or bytearray, but got %rz'Missing required parameter 'digestmod'.�cst��|�S�N��_hashlib�new��d��	digestmodrr�<lambda>?rzHMAC.__init__.<locals>.<lambda>cs
��|�Sr�rrrrrrAr�
block_size�z:block_size of %d seems too small; using our default of %d.�z<No block_size attribute on given digest object; Assuming %d.�N)r)r)�_hashlibopenssl�
get_fips_mode�
ValueError�
isinstance�bytes�	bytearray�	TypeError�type�__name__�callable�digest_cons�str�outer�inner�digest_size�hasattrr�	_warnings�warn�	blocksize�RuntimeWarning�len�digest�ljust�update�	translate�trans_5C�trans_36)�self�key�msgrr1rrr�__init__#sR
�



����
z
HMAC.__init__cCsd|jjS)Nzhmac-)r,�name)r:rrrr>asz	HMAC.namecCs t��rtd��|j�|�dS)z,Feed data from msg into this hashing object.z'hmac.HMAC is not available in FIPS modeN)rr r!r,r6)r:r<rrrr6eszHMAC.updatecCs:|j�|j�}|j|_|j|_|j��|_|j��|_|S)zyReturn a separate copy of this hashing object.

        An update to this copy won't affect the original object.
        )�	__class__�__new__r)r-r,�copyr+)r:�otherrrrrAksz	HMAC.copycCs|j��}|�|j���|S)zwReturn a hash object for the current state.

        To be used only internally with digest() and hexdigest().
        )r+rAr6r,r4�r:�hrrr�_currentxs
z
HMAC._currentcCs|��}|��S)z�Return the hash value of this hashing object.

        This returns the hmac value as bytes.  The object is
        not altered in any way by this function; you can continue
        updating the object after calling this function.
        )rEr4rCrrrr4�szHMAC.digestcCs|��}|��S)zKLike digest(), but returns a string of hexadecimal digits instead.
        )rE�	hexdigestrCrrrrF�szHMAC.hexdigest)Nr)
r'�
__module__�__qualname__�__doc__r1r=�propertyr>r6rArEr4rFrrrrrs
>

	
rcCsHt|t�r|��St|�r"|d�}t|tj�s6td��|j���dd�S)Nrz6Only OpenSSL hashlib hashes are accepted in FIPS mode.�_�-)	r"r*�lowerr(rZHASHr%r>�replacerrrr�_get_openssl_name�s
�rOc@seZdZddd�ZdS)�HMAC_opensslNcCsLt|ttf�s tdt|�j��t|�}tjj	|||d�}|rH|�
|�|S)Nrr)r"r#r$r%r&r'rO�_hmacopensslrr@r6)�clsr;r<rr>�resultrrrr@�s
zHMAC_openssl.__new__)NN)r'rGrHr@rrrrrP�srPrcCst|||�S)a�Create a new hashing object and return it.

    key: bytes or buffer, The starting key for the hash.
    msg: bytes or buffer, Initial input for the hash, or None.
    digestmod: A hash name suitable for hashlib.new(). *OR*
               A hashlib constructor returning a new hash object. *OR*
               A module supporting PEP 247.

               Required as of 3.8, despite its position after the optional
               msg argument.  Passing it as a keyword argument is
               recommended, though not required for legacy API reasons.

    You can now feed arbitrary bytes into the object using its update()
    method, and can ask for the hash value at any time by calling its digest()
    or hexdigest() methods.
    )r)r;r<rrrrr�srcs�tdk	r(t�t�r(�tkr(t�||��St��r6�}n(t�t�rPd	�fdd�	}nd
�fdd�	}|�}|�}t|dd�}t|�|kr�||���}|d|t|�}|�	|�
t��|�	|�
t��|�	|�|�	|���|��S)aJFast inline implementation of HMAC.

    key: bytes or buffer, The key for the keyed hash object.
    msg: bytes or buffer, Input message.
    digest: A hash name suitable for hashlib.new() for best performance. *OR*
            A hashlib constructor returning a new hash object. *OR*
            A module supporting PEP 247.
    Nrcst��|�Srrr�r4rrr�rzdigest.<locals>.<lambda>cs
��|�SrrrrTrrr�rrr
r)r)r)
�_hashopensslr"r*�_openssl_md_methsZhmac_digestr(�getattrr3r4r6r7r9r8)r;r<r4r)r,r+r1rrTrr4�s,	��

r4)Nr)rI�warningsr/�	_operatorrZcompare_digestrrU�ImportErrorrV�	frozensetZopenssl_md_meth_namesZhashlibrrQr#�ranger8r9r-rrOrPr rr4rrrr�<module>s*

u
__pycache__/tty.cpython-38.opt-1.pyc000064400000002066151153537560013202 0ustar00U

e5do�@sLdZddlTddgZdZdZdZdZdZd	Zd
Z	e
fdd�Ze
fdd�Zd
S)zTerminal utilities.�)�*�setraw�	setcbreak������cCs�t|�}|tttBtBtBtB@|t<|tt@|t<|t	t
tB@|t	<|t	tB|t	<|t
ttBtBtB@|t
<d|tt<d|tt<t|||�dS)zPut terminal into a raw mode.rrN)�	tcgetattr�IFLAGZBRKINTZICRNLZINPCKZISTRIPZIXON�OFLAGZOPOST�CFLAGZCSIZEZPARENBZCS8�LFLAG�ECHO�ICANONZIEXTENZISIG�CC�VMIN�VTIME�	tcsetattr��fdZwhen�mode�r�/usr/lib64/python3.8/tty.pyrs"cCsFt|�}|tttB@|t<d|tt<d|tt<t|||�dS)z Put terminal into a cbreak mode.rrN)rrrrrrrrrrrrrs
N)
�__doc__Ztermios�__all__rr
rrZISPEEDZOSPEEDrZ	TCSAFLUSHrrrrrr�<module>s__pycache__/pipes.cpython-38.opt-2.pyc000064400000011502151153537560013476 0ustar00U

e5d�"�@slddlZddlZddlZddlmZdgZdZdZdZdZ	dZ
d	Zeeee	e
egZGd
d�d�Z
dd�ZdS)
�N)�quote�TemplateZffz-fzf-�--z.-z-.c@sleZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)rcCsd|_|��dS)Nr)�	debugging�reset��self�r	�/usr/lib64/python3.8/pipes.py�__init__UszTemplate.__init__cCsd|jfS)Nz<Template instance, steps=%r>��stepsrr	r	r
�__repr__ZszTemplate.__repr__cCs
g|_dS�Nrrr	r	r
r^szTemplate.resetcCs"t�}|jdd�|_|j|_|Sr)rr
r)r�tr	r	r
�clonebszTemplate.clonecCs
||_dSr)r)r�flagr	r	r
�debugjszTemplate.debugcCs�t|�td�k	rtd��|tkr.td|f��|tkr>td��|jr^|jddtkr^td��|dd	kr~t�d
|�s~td��|dd	kr�t�d|�s�td
��|j�	||f�dS)N�z%Template.append: cmd must be a stringzTemplate.append: bad kind %rz-Template.append: SOURCE can only be prepended����z'Template.append: already ends with SINKr�f�\$IN\bz#Template.append: missing $IN in cmd�\$OUT\bz$Template.append: missing $OUT in cmd)
�type�	TypeError�	stepkinds�
ValueError�SOURCEr
�SINK�re�search�append�r�cmd�kindr	r	r
r"nszTemplate.appendcCs�t|�td�k	rtd��|tkr.td|f��|tkr>td��|jr^|jddtkr^td��|ddkr~t�d	|�s~td
��|ddkr�t�d|�s�td��|j�	d||f�dS)
Nrz&Template.prepend: cmd must be a stringzTemplate.prepend: bad kind %rz+Template.prepend: SINK can only be appendedrrz,Template.prepend: already begins with SOURCErrz$Template.prepend: missing $IN in cmdrz%Template.prepend: missing $OUT in cmd)
rrrrrr
rr r!�insertr#r	r	r
�prepend~szTemplate.prependcCs6|dkr|�|�S|dkr$|�|�Std|f��dS)N�r�wz,Template.open: rw must be 'r' or 'w', not %r)�open_r�open_wr)r�fileZrwr	r	r
�open�s

�z
Template.opencCsB|jst|d�S|jddtkr*td��|�|d�}t�|d�S)Nr(rrz)Template.open_r: pipeline ends width SINKr)r
r-rr�makepipeline�os�popen�rr,r$r	r	r
r*�s
zTemplate.open_rcCsB|jst|d�S|jddtkr*td��|�d|�}t�|d�S)Nr)rrz,Template.open_w: pipeline begins with SOURCEr)r
r-rrr.r/r0r1r	r	r
r+�s
zTemplate.open_wcCst�|�||��Sr)r/�systemr.)r�infile�outfiler	r	r
�copy�sz
Template.copycCs(t||j|�}|jr$t|�d|}|S)Nzset -x; )r.r
r�print)rr3r4r$r	r	r
r.�s
zTemplate.makepipelineN)�__name__�
__module__�__qualname__rrrrrr"r'r-r*r+r5r.r	r	r	r
rRs

cCs�g}|D]\}}|�d||dg�q|s:|�ddddg�|ddd�\}}|ddkrr|sr|�dddddg�||dd<|ddd�\}}|ddkr�|s�|�ddddg�||dd<g}tdt|��D]v}||dd	}||d	}	|ddk�s|	ddkr�t��\}
}t�|
�|�|�|||dd<||d<q�|D]�}|\}
}}}|ddk�r�d
t|�d|}|ddk�r�dt|
�d|}|dd
k�r�|
�r�|dt|
�}|dd
k�r�|�r�|dt|�}||d<�qN|dd}|dd�D]T}|dd�\}}|ddk�rTd|k�rFd|d}|d|}n|d|}�q|�r�d}|D]}|dt|�}�qrdt|d�d}|d|d|}|S)Nr�catrrr�rr�zOUT=z; zIN=�-z <z >z{ z; }z |
�
zrm -f� ztrap z; exitz 1 2 3 13 14 15)	r"r&�range�len�tempfileZmkstempr/�closer)r3r
r4�listr$r%Zgarbage�iZlkindZrkind�fdZtemp�item�infZoutfZcmdlistZrmcmdr,Ztrapcmdr	r	r
r.�s`


r.)r r/rBZshlexr�__all__ZFILEIN_FILEOUTZ
STDIN_FILEOUTZ
FILEIN_STDOUTZSTDIN_STDOUTrrrrr.r	r	r	r
�<module><s �c__pycache__/fileinput.cpython-38.opt-2.pyc000064400000017127151153537560014366 0ustar00U

e5du9�@s�ddlZddlZdddddddd	d
ddd
gZdad!ddd�dd�Zdd�Zdd�Zdd�Zdd�Zdd�Z	dd�Z
dd	�Zdd
�ZGdd�d�Z
dd�Zd"dd
�Zdd�Zed kr�e�dS)#�N�input�close�nextfile�filename�lineno�
filelineno�fileno�isfirstline�isstdin�	FileInput�hook_compressed�hook_encodedF��r��mode�openhookcCs(trtjrtd��t|||||d�atS)Nzinput() already activer)�_state�_file�RuntimeErrorr)�files�inplace�backuprr�r�!/usr/lib64/python3.8/fileinput.pyrSs
cCst}da|r|��dS�N)rr)�staterrrr`scCststd��t��S�Nzno active input())rrrrrrrrhs
cCststd��t��Sr)rrrrrrrrvscCststd��t��Sr)rrrrrrrrscCststd��t��Sr)rrrrrrrr�scCststd��t��Sr)rrrrrrrr�scCststd��t��Sr)rrr	rrrrr	�scCststd��t��Sr)rrr
rrrrr
�sc@s�eZdZd(ddd�dd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�ZdS))rNFrrrcCst|t�r|f}nBt|tj�r,t�|�f}n(|dkrBtjdd�}|sLd}nt|�}||_||_	||_
d|_d|_d|_
d|_d|_d|_d|_d|_|dkr�td��d|kr�ddl}|�dtd	�||_d|kr�|�d
d�nd|_|�r|r�td��t|��std
��||_dS)N�)�-rF)rZrU�U�rbz=FileInput opening mode must be one of 'r', 'rU', 'U' and 'rb'r z'U' mode is deprecated�r�wz4FileInput cannot use an opening hook in inplace modez#FileInput openhook must be callable)�
isinstance�str�os�PathLike�fspath�sys�argv�tuple�_files�_inplace�_backup�_savestdout�_output�	_filename�_startlineno�_filelinenor�_isstdin�_backupfilename�
ValueError�warnings�warn�DeprecationWarning�_mode�replace�_write_mode�callable�	_openhook)�selfrrrrrr7rrr�__init__�sH
�
zFileInput.__init__cCs|��dSr�r�r?rrr�__del__�szFileInput.__del__cCsz|��W5d|_XdS)Nr)r,rrBrrrr�szFileInput.closecCs|SrrrBrrr�	__enter__�szFileInput.__enter__cCs|��dSrrA)r?�type�value�	tracebackrrr�__exit__�szFileInput.__exit__cCs|SrrrBrrr�__iter__�szFileInput.__iter__cCs6|��}|r|jd7_|S|js(t�|��qdS�Nr)�	_readliner3r�
StopIterationr�r?�linerrr�__next__�szFileInput.__next__cCsXddl}|jdtdd�||��kr,td��z
|��WStk
rRtd��YnXdS)NrzTSupport for indexing FileInput objects is deprecated. Use iterator protocol instead.r")�
stacklevelzaccessing lines out of orderzend of input reached)r7r8r9rrrOrL�
IndexError)r?�ir7rrr�__getitem__s�
zFileInput.__getitem__cCs�|j}d|_|r|t_|j}d|_z|r0|�
�W5|j}d|_z|`Wntk
r\YnXz|rr|jsr|�
�W5|j}d|_|r�|js�zt	�
|�Wntk
r�YnXd|_XXdS)NF)r/r)�stdoutr0rrK�AttributeErrorr5r.r&�unlink�OSErrorr4r)r?Z
savestdout�output�fileZbackupfilenamerrrrs4

zFileInput.nextfilecCs6|��}|r|jd7_|S|js(|S|��qdSrJ)rKr3rrrMrrr�readline.szFileInput.readlinecCs�|jsd|jkrdSdS|jd|_|jdd�|_|��|_d|_d|_d|_d|_|jdkr�d|_d|jkr�t	t
jd	t
j�|_nt
j|_d
|_�nT|j�r�t
�|j�|jp�d|_zt
�|j�Wntk
r�YnXt
�|j|j�t|j|j�|_zt
�|j���j}Wn&tk
�r8t|j|j�|_YntXt
jt
jBt
jB}tt
d��rb|t
jO}t
�|j||�}t
�||j�|_zt
�|j|�Wntk
�r�YnXt
j |_!|jt
_ n,|j"�r�|�"|j|j�|_nt|j|j�|_|jj#|_$|�$�S)
N�b�rrrFrz<stdin>�bufferTz.bak�O_BINARY)%r,r:r1rr2r3rr4r5�getattrr)�stdinr-r&r(r.rVrW�rename�open�fstatr�st_moder<r0�O_CREAT�O_WRONLY�O_TRUNC�hasattrr^�fdopen�chmodrTr/r>rZrK)r?Zpermr�fdrrrrK9s\




�


zFileInput._readlinecCs|jSr)r1rBrrrrrszFileInput.filenamecCs|j|jSr)r2r3rBrrrruszFileInput.linenocCs|jSr�r3rBrrrrxszFileInput.filelinenocCs4|jr,z|j��WStk
r(YdSXndSdS)N���)rrr6rBrrrr{s
zFileInput.filenocCs
|jdkSrJrlrBrrrr	�szFileInput.isfirstlinecCs|jSr)r4rBrrrr
�szFileInput.isstdin)NFr)�__name__�
__module__�__qualname__r@rCrrDrHrIrOrSrrZrKrrrrr	r
rrrrr�s(
�)9	cCsVtj�|�d}|dkr,ddl}|�||�S|dkrHddl}|�||�St||�SdS)Nrz.gzrz.bz2)r&�path�splitext�gziprb�bz2ZBZ2File)rrZextrsrtrrrr�scs��fdd�}|S)Ncst||��d�S)N��encoding�errors)rb)rrrurrr�szhook_encoded.<locals>.openhookr)rvrwrrrurr
�scCs�ddl}d}d}|�tjdd�d�\}}|D] \}}|dkrBd}|dkr.|}q.t|||d�D]b}|d	d�d
kr~|dd	�}|d	d�dkr�|dd	�}tdt�t�t�t�r�d
p�d|f�q^tdt�t�t�f�dS)NrFrzib:z-iTz-b)rrrm�
�
z%d: %s[%d]%s %s�*rz
%d: %s[%d])	�getoptr)r*r�printrrrr	)r{rrZopts�args�o�arNrrr�_test�s&�
r��__main__)NFr)N)r)r&�__all__rrrrrrrrr	r
rrr
r�rnrrrr�<module>Ks2�
	

			^
__pycache__/binhex.cpython-38.opt-1.pyc000064400000027550151153537560013644 0ustar00U

e5d�6�@s�dZddlZddlZddlZddlZdddgZGdd�de�ZdZdZ	dZ
d	Zd
ZGdd�d�Z
d
d�ZGdd�d�ZGdd�d�ZGdd�d�ZGdd�d�Zdd�ZGdd�d�ZGdd�d�ZGdd�d�Zdd�ZdS)z�Macintosh binhex compression/decompression.

easy interface:
binhex(inputfilename, outputfilename)
hexbin(inputfilename, outputfilename)
�N�binhex�hexbin�Errorc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/binhex.pyrs�i��@��c@seZdZdd�ZdS)�FInfocCsd|_d|_d|_dS)Nz????r)�Type�Creator�Flags��selfrrr	�__init__0szFInfo.__init__N)rrrrrrrr	r
/sr
c	Cstt�}t�|d��2}|�d�}d|kr,d|_|�dd�|��}W5QRXtj�	|�\}}|�
ddd�}|||dfS)	N�rbirZTEXT��:�-r
)r
�io�open�readr�seek�tell�os�path�split�replace)�name�finfo�fp�dataZdsize�dir�filerrr	�getfileinfo5s
r'c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�openrsrccGsdS�Nr�r�argsrrr	rCszopenrsrc.__init__cGsdS�N�rr*rrr	rFsz
openrsrc.readcGsdSr)rr*rrr	�writeIszopenrsrc.writecCsdSr)rrrrr	�closeLszopenrsrc.closeN)rrrrrr.r/rrrr	r(Bsr(c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�_Hqxcoderenginez(Write data to the coder in 3-byte chunkscCs ||_d|_d|_td|_dS)Nr-r
)�ofpr$�hqxdata�LINELEN�linelen�rr1rrr	rRsz_Hqxcoderengine.__init__cCsh|j||_t|j�}|dd}|jd|�}|j|d�|_|sHdS|jt�|�|_|�d�dS)N�r)r$�lenr2�binascii�b2a_hqx�_flush)rr$ZdatalenZtodorrr	r.Xs
z_Hqxcoderengine.writecCsrd}|t|j�|jkrH||j}|j�|j||�d�t|_|}q|j|d�|_|rn|j�|jd�dS)Nr�
s:
)r7r2r4r1r.r3)rZforce�firstZlastrrr	r:cs
z_Hqxcoderengine._flushcCs6|jr|jt�|j�|_|�d�|j��|`dS)Nr
)r$r2r8r9r:r1r/rrrr	r/ns


z_Hqxcoderengine.closeN)rrr�__doc__rr.r:r/rrrr	r0Os
r0c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_Rlecoderenginez4Write data to the RLE-coder in suitably large chunkscCs||_d|_dSr,)r1r$r5rrr	rxsz_Rlecoderengine.__init__cCs@|j||_t|j�tkrdSt�|j�}|j�|�d|_dSr,)r$r7�REASONABLY_LARGEr8�rlecode_hqxr1r.)rr$�rledatarrr	r.|sz_Rlecoderengine.writecCs0|jrt�|j�}|j�|�|j��|`dSr))r$r8r@r1r.r/)rrArrr	r/�s

z_Rlecoderengine.closeN)rrrr=rr.r/rrrr	r>usr>c@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�BinHexc
Cs�|\}}}}d}t|t�r.|}t�|d�}d}zR|�d�t|�}	t|	�|_d|_|dkr`t	�}||_
||_|�||�t
|_Wn|r�|���YnXdS)NF�wbTs0(This file must be converted with BinHex 4.0)

:r)�
isinstance�strrrr.r0r>r1�crcr
�dlen�rlen�
_writeinfo�_DID_HEADER�stater/)
rZname_finfo_dlen_rlenr1r!r"rGrHZclose_on_errorZofnameZhqxerrrr	r�s*



zBinHex.__init__cCs�t|�}|dkrtd��t|g�|�d�d}|j|j}}t|t�rR|�d�}t|t�rf|�d�}||}t�	d|j
�}t�	d|j|j�}	||||	}
|�
|
�|��dS)N�?zFilename too longzlatin-1��>hz>ii)r7r�bytes�encoderrrDrE�struct�packrrGrH�_write�	_writecrc)rr!r"�nl�d�tpZcrZd2Zd3Zd4�inforrr	rI�s




zBinHex._writeinfocCs t�||j�|_|j�|�dSr))r8�crc_hqxrFr1r.�rr$rrr	rS�sz
BinHex._writecCs4|jdkrd}nd}|j�t�||j��d|_dS)NrrNz>H)rFr1r.rQrR)rZfmtrrr	rT�s

zBinHex._writecrccCs0|jtkrtd��|jt|�|_|�|�dS)NzWriting data at the wrong time)rKrJrrGr7rSrZrrr	r.�s
zBinHex.writecCs,|jdkrtd|jf��|��t|_dS)NrzIncorrect data size, diff=%r)rGrrHrT�	_DID_DATArKrrrr	�
close_data�s
zBinHex.close_datacCsB|jtkr|��|jtkr$td��|jt|�|_|�|�dS)Nz'Writing resource data at the wrong time)rKr[r\rrHr7rSrZrrr	�
write_rsrc�s

zBinHex.write_rsrccCsx|jdkrdSzJ|jtkr"|��|jtkr4td��|jdkrNtd|jf��|��W5d|_|j}|`|��XdS)NzClose at the wrong timerz$Incorrect resource-datasize, diff=%r)rKr1r/r[r\rrHrTr5rrr	r/�s



zBinHex.closeN)rrrrrIrSrTr.r\r]r/rrrr	rB�s
rBc	Cs�t|�}t||�}t�|d��*}|�d�}|s0q<|�|�q |��W5QRXt|d�}|�d�}|shqt|�|�qX|�	�|�	�dS)zEbinhex(infilename, outfilename): create binhex-encoded copy of a filer��N)
r'rBrrrr.r\r(r]r/)�inp�outr"r1�ifprVrrr	r�s



c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_Hqxdecoderenginez*Read data via the decoder in 4-byte chunkscCs||_d|_dS)Nr)ra�eof�rrarrr	rsz_Hqxdecoderengine.__init__cCs�d}|}|dkr�|jr|S|ddd}|j�|�}zt�|�\}|_Wq�Wntjk
rdYnX|j�d�}|s~td��||}q6||}|t|�}|s|jstd��q|S)z&Read at least wtd bytes (or until EOF)r-rrr6�r
zPremature EOF on binhex file)rcrarr8Za2b_hqxZ
Incompleterr7)rZtotalwtdZdecdata�wtdr$Z
decdatacur�newdatarrr	rs*


z_Hqxdecoderengine.readcCs|j��dSr)�rar/rrrr	r/%sz_Hqxdecoderengine.closeN)rrrr=rrr/rrrr	rb�s rbc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�_RledecoderenginezRead data via the RLE-codercCs||_d|_d|_d|_dS)Nr-r)ra�
pre_buffer�post_bufferrcrdrrr	r+sz_Rledecoderengine.__init__cCsD|t|j�kr"|�|t|j��|jd|�}|j|d�|_|Sr))r7rk�_fill)rrf�rvrrr	r1s
z_Rledecoderengine.readcCs�|j|j�|d�|_|jjr>|jt�|j�|_d|_dSt|j�}|jdd�tdtkrl|d}nX|jdd�tkr�|d}n<|jdd�tdkr�|d}n|jdd�tkr�n|d	}|jt�|jd|��|_|j|d�|_dS)
Nrer-���rMr6���r���r
)	rjrarrcrkr8Z
rledecode_hqxr7�RUNCHAR)rrfZmarkrrr	rl8s*
�



�z_Rledecoderengine._fillcCs|j��dSr)rhrrrr	r/[sz_Rledecoderengine.closeN)rrrr=rrrlr/rrrr	ri(s
#ric@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�HexBincCsft|t�rt�|d�}|�d�}|s,td��|dkr6q|dkrqBqt|�}t|�|_d|_	|�
�dS)Nrr
zNo binhex data foundr;�:r)rDrErrrrrbrirarF�_readheader)rraZchZhqxifprrr	r_s


zHexBin.__init__cCs |j�|�}t�||j�|_|Sr))rarr8rYrF)rr7r$rrr	�_readuszHexBin._readcCsNt�d|j�d��dd@}|jd@|_||jkrDtd|j|f��d|_dS)NrNrri��zCRC error, computed %x, read %x)rQ�unpackrarrFr)rZfilecrcrrr	�	_checkcrczs
�zHexBin._checkcrccCs�|�d�}|�t|��}|�d�}|��|dd�}|dd�}t�d|dd��d}t�d|dd	��d|_t�d|d	d��d|_||_t�|_||j_	||j_
||j_t|_
dS)
Nr
���	rN�rz>l�)ru�ordrwrQrvrGrH�FNamer
rrrrJrK)rr7Zfname�rest�typeZcreator�flagsrrr	rt�s

zHexBin._readheadercGsj|jtkrtd��|r,|d}t||j�}n|j}d}t|�|krZ||�|t|��}q6|j||_|S)NzRead data at wrong timerr-)rKrJr�minrGr7ru)r�nrmrrr	r�s
zHexBin.readcCs6|jtkrtd��|jr$|�|j�}|��t|_dS)Nzclose_data at wrong time)rKrJrrGrurwr[�rZdummyrrr	r\�s
zHexBin.close_datacGsZ|jtkr|��|jtkr$td��|r>|d}t||j�}n|j}|j||_|�|�S)Nz Read resource data at wrong timer)rKrJr\r[rr�rHru)rr�rrr	�	read_rsrc�s

zHexBin.read_rsrccCsD|jdkrdSz|jr"|�|j�}|��W5d|_|j��XdSr))rKrar/rHr�rwr�rrr	r/�s
zHexBin.closeN)rrrrrurwrtrr\r�r/rrrr	rr^s

rrc	Cs�t|�}|j}|s|j}t�|d��"}|�d�}|s6qB|�|�q&W5QRX|��|�d�}|r�t	|d�}|�|�|�d�}|s�q�|�|�qv|�
�|�
�dS)z6hexbin(infilename, outfilename) - Decode binhexed filerCr^N)rrr
r~rrrr.r\r�r(r/)r_r`rar"r1rVrrr	r�s(




)r=rrrQr8�__all__�	ExceptionrrJr[r?r3rqr
r'r(r0r>rBrrbrirrrrrrr	�<module>s,


&^*6h__pycache__/gzip.cpython-38.opt-1.pyc000064400000043412151153537560013333 0ustar00U

e5d�S�@sdZddlZddlZddlZddlZddlZddlZddlZddlZdddddgZ	d\Z
ZZZ
Zd	\ZZd
ZdZdZd
edddfdd�Zdd�ZGdd�d�ZGdd�de�ZGdd�dej�ZGdd�dej�Zefdd�dd�Zdd�Zdd�Ze dk�re�dS)z�Functions that read and write gzipped files.

The user of the file doesn't have to worry about the compression,
but random access is not allowed.�N�BadGzipFile�GzipFile�open�compress�
decompress)�����)rrr��	�rbcCs�d|kr d|krPtd|f��n0|dk	r0td��|dk	r@td��|dk	rPtd��|�dd�}t|tttjf�r|t|||�}n,t|d	�s�t|d
�r�td|||�}nt	d��d|kr�t
�||||�S|SdS)aOpen a gzip-compressed file in binary or text mode.

    The filename argument can be an actual filename (a str or bytes object), or
    an existing file object to read from or write to.

    The mode argument can be "r", "rb", "w", "wb", "x", "xb", "a" or "ab" for
    binary mode, or "rt", "wt", "xt" or "at" for text mode. The default mode is
    "rb", and the default compresslevel is 9.

    For binary mode, this function is equivalent to the GzipFile constructor:
    GzipFile(filename, mode, compresslevel). In this case, the encoding, errors
    and newline arguments must not be provided.

    For text mode, a GzipFile object is created, and wrapped in an
    io.TextIOWrapper instance with the specified encoding, error handling
    behavior, and line ending(s).

    �t�bzInvalid mode: %rNz0Argument 'encoding' not supported in binary modez.Argument 'errors' not supported in binary modez/Argument 'newline' not supported in binary mode��read�writez1filename must be a str or bytes object, or a file)�
ValueError�replace�
isinstance�str�bytes�os�PathLiker�hasattr�	TypeError�io�
TextIOWrapper)�filename�mode�
compresslevel�encoding�errors�newlineZgz_modeZbinary_file�r%�/usr/lib64/python3.8/gzip.pyrs$cCs|�t�d|��dS)Nz<L)r�structZpack)�output�valuer%r%r&�write32uEsr*c@s<eZdZdZddd�Zdd�Zddd�Zd	d
�Zdd�Zd
S)�_PaddedFilez�Minimal read-only file object that prepends a string to the contents
    of an actual file. Shouldn't be used outside of gzip.py, as it lacks
    essential functionality.�cCs ||_t|�|_||_d|_dS�Nr)�_buffer�len�_length�file�_read)�self�f�prependr%r%r&�__init__Os
z_PaddedFile.__init__cCs~|jdkr|j�|�S|j||jkrJ|j}|j|7_|j||j�S|j}d|_|j|d�|j�||j|�SdS�N)r2r1rr0r.)r3�sizerr%r%r&rUs
�z_PaddedFile.readcCs>|jdkr||_n|jt|�8_dSt|j�|_d|_dSr-)r2r.r/r0)r3r5r%r%r&r5bs
z_PaddedFile.prependcCsd|_d|_|j�|�Sr7)r2r.r1�seek)r3Zoffr%r%r&r9ksz_PaddedFile.seekcCsdS�NTr%�r3r%r%r&�seekablepsz_PaddedFile.seekableN)r,)r,)	�__name__�
__module__�__qualname__�__doc__r6rr5r9r<r%r%r%r&r+Js

	r+c@seZdZdZdS)rz6Exception raised in some cases for invalid gzip files.N)r=r>r?r@r%r%r%r&rtsc@s�eZdZdZdZddeddfdd�Zedd��Zedd��Z	d	d
�Z
dd�Zd
d�Zdd�Z
d,dd�Zd-dd�Zdd�Zedd��Zdd�Zejfdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zejfd(d)�Zd.d*d+�ZdS)/ra
The GzipFile class simulates most of the methods of a file object with
    the exception of the truncate() method.

    This class only supports opening files in binary mode. If you need to open a
    compressed file in text mode, use the gzip.open() function.

    NcCs4|r"d|ksd|kr"td�|���|r6d|kr6|d7}|dkrTt�||pJd�}|_|dkr|t|dd�}t|ttf�s�d}n
t	�
|�}|dkr�t|d	d�}|�d
�r�t|_
t|�}t�|�|_||_nN|�d��rt|_
|�|�t�|tjtjtjd�|_||_ntd�|���||_|j
tk�r0|�|�dS)
aGConstructor for the GzipFile class.

        At least one of fileobj and filename must be given a
        non-trivial value.

        The new class instance is based on fileobj, which can be a regular
        file, an io.BytesIO object, or any other object which simulates a file.
        It defaults to None, in which case filename is opened to provide
        a file object.

        When fileobj is not None, the filename argument is only used to be
        included in the gzip file header, which may include the original
        filename of the uncompressed file.  It defaults to the filename of
        fileobj, if discernible; otherwise, it defaults to the empty string,
        and in this case the original filename is not included in the header.

        The mode argument can be any of 'r', 'rb', 'a', 'ab', 'w', 'wb', 'x', or
        'xb' depending on whether the file will be read or written.  The default
        is the mode of fileobj if discernible; otherwise, the default is 'rb'.
        A mode of 'r' is equivalent to one of 'rb', and similarly for 'w' and
        'wb', 'a' and 'ab', and 'x' and 'xb'.

        The compresslevel argument is an integer from 0 to 9 controlling the
        level of compression; 1 is fastest and produces the least compression,
        and 9 is slowest and produces the most compression. 0 is no compression
        at all. The default is 9.

        The mtime argument is an optional numeric timestamp to be written
        to the last modification time field in the stream when compressing.
        If omitted or None, the current time is used.

        r�UzInvalid mode: {!r}rNr�namerr �r)�w�a�xr)r�format�builtinsr�	myfileobj�getattrrrrr�fspath�
startswith�READr �_GzipReaderr�BufferedReaderr.rB�WRITE�_init_write�zlibZcompressobjZDEFLATED�	MAX_WBITSZ
DEF_MEM_LEVELr�_write_mtime�fileobj�_write_gzip_header)r3rr r!rU�mtime�rawr%r%r&r6�s@#


�zGzipFile.__init__cCsBddl}|�dtd�|jtkr<|jdd�dkr<|jdS|jS)Nrzuse the name attributer����.gz)�warnings�warn�DeprecationWarningr rPrB)r3r[r%r%r&r�s

zGzipFile.filenamecCs
|jjjS)z0Last modification time read from stream, or None)r.rX�_last_mtimer;r%r%r&rW�szGzipFile.mtimecCs.t|j�}d|dd�dtt|��dS)Nz<gzip r���� �>)�reprrU�hex�id)r3�sr%r%r&�__repr__�s
zGzipFile.__repr__cCs.||_t�d�|_d|_g|_d|_d|_dS�Nr,r)rBrR�crc32�crcr8Zwritebuf�bufsize�offset)r3rr%r%r&rQ�szGzipFile._init_writecCs|j�d�|j�d�z<tj�|j�}t|t�s<|�d�}|�	d�rR|dd�}Wnt
k
rld}YnXd}|rzt}|j�t|��d��|j
}|dkr�t��}t|jt|��|tkr�d}n|tkr�d	}nd
}|j�|�|j�d�|�r|j�|d
�dS)N���zlatin-1s.gzrYr,r�����)rUrr�path�basenamerBrr�encode�endswith�UnicodeEncodeError�FNAME�chrrT�timer*�int�_COMPRESS_LEVEL_BEST�_COMPRESS_LEVEL_FAST)r3r!Zfname�flagsrWZxflr%r%r&rV�s6



zGzipFile._write_gzip_headercCs�|��|jtkr&ddl}t|jd��|jdkr8td��t|t	�rLt
|�}nt|�}|j}|dkr�|j�
|j�|��|j|7_t�||j�|_|j|7_|S)Nrz$write() on read-only GzipFile objectz!write() on closed GzipFile object)�_check_not_closedr rP�errno�OSError�EBADFrUrrrr/�
memoryview�nbytesrrr8rRrhrirk)r3�datarZlengthr%r%r&rs 



zGzipFile.writer_cCs2|��|jtkr&ddl}t|jd��|j�|�S)Nrz$read() on write-only GzipFile object)r~r rMrr�r�r.r�r3r8rr%r%r&rs

z
GzipFile.readcCs@|��|jtkr&ddl}t|jd��|dkr4tj}|j�	|�S)zdImplements BufferedIOBase.read1()

        Reads up to a buffer's worth of data if size is negative.rNz%read1() on write-only GzipFile object)
r~r rMrr�r�r�DEFAULT_BUFFER_SIZEr.�read1r�r%r%r&r�&s
zGzipFile.read1cCs2|��|jtkr&ddl}t|jd��|j�|�S)Nrz$peek() on write-only GzipFile object)r~r rMrr�r�r.�peek)r3�nrr%r%r&r�3s

z
GzipFile.peekcCs
|jdkSr7�rUr;r%r%r&�closed:szGzipFile.closedcCs�|j}|dkrdSd|_zP|jtkrR|�|j���t||j	�t||j
d@�n|jtkrf|j��W5|j}|r�d|_|��XdS)N���)
rUrI�closer rPrr�flushr*rir8rMr.)r3rUrIr%r%r&r�>s

zGzipFile.closecCs4|��|jtkr0|j�|j�|��|j��dSr7)r~r rPrUrrr�)r3Z	zlib_moder%r%r&r�Qs
zGzipFile.flushcCs
|j��S)z�Invoke the underlying file object's fileno() method.

        This will raise AttributeError if the underlying file object
        doesn't support fileno().
        )rU�filenor;r%r%r&r�XszGzipFile.filenocCs"|jtkrtd��|j�d�dS)z[Return the uncompressed stream file position indicator to the
        beginning of the filezCan't rewind in write moderN)r rMr�r.r9r;r%r%r&�rewind`s
zGzipFile.rewindcCs
|jtkSr7)r rMr;r%r%r&�readablegszGzipFile.readablecCs
|jtkSr7)r rPr;r%r%r&�writablejszGzipFile.writablecCsdSr:r%r;r%r%r&r<mszGzipFile.seekablecCs�|jtkr�|tjkr2|tjkr*|j|}ntd��||jkrDtd��||j}d}t|d�D]}|�	|�q^|�	d|d�n |jt
kr�|��|j�
||�S|jS)NzSeek from end not supportedzNegative seek in write modes�rp)r rPr�SEEK_SET�SEEK_CURrkrr��rangerrMr~r.r9)r3rk�whence�count�chunk�ir%r%r&r9ps 





z
GzipFile.seekcCs|��|j�|�Sr7)r~r.�readline)r3r8r%r%r&r��szGzipFile.readline)r_)r_)r_)r=r>r?r@rIr{r6�propertyrrWrfrQrVrrr�r�r�r�rRZZ_SYNC_FLUSHr�r�r�r�r�r<rr�r9r�r%r%r%r&rxs:
�
I

 



csZeZdZ�fdd�Zdd�Zdd�Zdd�Zdd
d�Zdd
�Zdd�Z	�fdd�Z
�ZS)rNcs,t�jt|�tjtjd�d|_d|_dS)N)ZwbitsT)�superr6r+rRZ
decompressobjrS�_new_memberr^)r3�fp��	__class__r%r&r6�s
�z_GzipReader.__init__cCst�d�|_d|_dSrg)rRrh�_crc�_stream_sizer;r%r%r&�
_init_read�sz_GzipReader._init_readcCsF|j�|�}t|�|krB|j�|t|��}|s8td��||7}q|S)z�Read exactly *n* bytes from `self._fp`

        This method is required because self._fp may be unbuffered,
        i.e. return short reads.
        �ACompressed file ended before the end-of-stream marker was reached)�_fprr/�EOFError)r3r�r�rr%r%r&�_read_exact�s
z_GzipReader._read_exactcCs�|j�d�}|dkrdS|dkr,td|��t�d|�d��\}}|_|dkrVtd��|t@r|t�d	|�d��\}|�|�|t@r�|j�d
�}|r�|dkr�q�q�|t	@r�|j�d
�}|r�|dkr�q�q�|t
@r�|�d�dS)
Nrr,FrlzNot a gzipped file (%r)z<BBIxxr
zUnknown compression methodz<HrrpT)r�rrr'�unpackr�r^�FEXTRArw�FCOMMENT�FHCRC)r3�magic�method�flagZ	extra_lenrer%r%r&�_read_gzip_header�s0�

z_GzipReader._read_gzip_headerr_cCs�|dkr|��S|sdS|jjr>|��d|_|jf|j�|_|jrf|��|��s`|j	|_
dSd|_|j�t
j�}|j�||�}|jjdkr�|j�|jj�n|jjdkr�|j�|jj�|dkr�q�|dkrtd��q|�|�|j	t|�7_	|S)Nrr,TFr�)�readallZ
_decompressor�eof�	_read_eofr�Z_decomp_factoryZ_decomp_argsr�r�Z_posZ_sizer�rrr�rZunconsumed_tailr5Zunused_datar��_add_read_datar/)r3r8�bufZ
uncompressr%r%r&r�s:�

z_GzipReader.readcCs$t�||j�|_|jt|�|_dSr7)rRrhr�r�r/)r3r�r%r%r&r��sz_GzipReader._add_read_datacCs�t�d|�d��\}}||jkr<tdt|�t|j�f��n||jd@krRtd��d}|dkrl|j�d�}qV|r||j�	|�dS)Nz<IIr
zCRC check failed %s != %sr�z!Incorrect length of data producedrpr)
r'r�r�r�rrcr�r�rr5)r3rhZisize�cr%r%r&r��s

�
z_GzipReader._read_eofcst���d|_dSr:)r��_rewindr�r;r�r%r&r�s
z_GzipReader._rewind)r_)r=r>r?r6r�r�r�rr�r�r��
__classcell__r%r%r�r&rN�s!
3rN)rWc	Cs6t��}t|d||d��}|�|�W5QRX|��S)z�Compress data in one shot and return the compressed string.
    Optional argument is the compression level, in range of 0-9.
    �wb)rUr r!rW)r�BytesIOrr�getvalue)r�r!rWr�r4r%r%r&rsc
Cs0tt�|�d��}|��W5QR�SQRXdS)zYDecompress a gzip compressed string in one shot.
    Return the decompressed string.
    r�N)rrr�r)r�r4r%r%r&rsc	Cs�ddlm}|dd�}|��}|jdddd�|jd	dd
d�|jdddd
d�|jdddgdd�|��}t}|jr|t}n
|jr�t	}|j
D]�}|jr�|dkr�tddt
jjd�}t
jj}n>|dd�dkr�t
�d|���t|d�}t�|dd�d�}nB|dk�r"t
jj}tddt
jj|d�}nt�|d�}t|dd�}|�d�}|�sP�q^|�|��q<|t
jjk	�rt|��|t
jjk	r�|��q�dS)Nr)�ArgumentParserzeA simple command line interface for the gzip module: act like gzip, but do not delete the input file.)Zdescriptionz--fast�
store_truezcompress faster)�action�helpz--bestzcompress betterz-dz--decompresszact like gunzip instead of gzip�args�*�-r1)�nargs�default�metavarrr)rr rUrYrZzfilename doesn't end in .gz: r�)rr rUr!r�)�argparser�Zadd_mutually_exclusive_group�add_argument�
parse_args�_COMPRESS_LEVEL_TRADEOFFZfastr|Zbestr{r�rr�sys�stdin�buffer�stdout�exitrrHrrr�)	r��parser�groupr�r!�argr4�gr�r%r%r&�main'sR�
�



�
r��__main__)!r@r'r�ryrrRrHrZ_compression�__all__ZFTEXTr�r�rwr�rMrPr|r�r{rr*r+r�rZ
BaseStreamrZDecompressReaderrNrrr�r=r%r%r%r&�<module>s: �
,*	0
__pycache__/datetime.cpython-38.opt-1.pyc000064400000155202151153537560014157 0ustar00U

e5d�X�
@sVdZddlZddlZddlZdd�ZdZdZdZ	dd	d
d	dd	dd	d	dd	dd	g
Z
dgZdZe
dd�D]Z
e�e�ee
7Zqd[[
dd
�Zdd�Zdd�Zdd�Zdd�Zed�Zed�Zed�Zdd�Zddddddd d!d"d#d$d%d&g
Zdd'd(d)d*d+d,d-gZd.d/�Zdid1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dAdB�Z#dCdD�Z$dEdF�Z%dGdH�Z&dIdJ�Z'dKdL�Z(GdMdN�dN�Z)e)dO�e)_*e)dPdQdRdRdSdT�e)_+e)ddU�e)_,GdVdW�dW�Z-e-Z.e-ddd�e-_*e-ddXd	�e-_+e)ddY�e-_,GdZd[�d[�Z/e/Z0Gd\d]�d]�ZeZ1eddd�e_*edQdRdRdS�e_+e)ddU�e_,Gd^d_�d_e-�Z2e2ddd�e2_*e2ddXd	dQdRdRdS�e2_+e)ddU�e2_,d`da�Z3Gdbdc�dce/�Z4e4�5e)d��e4_6e4�5e)dQdRdd��e4_*e4�5e)dQdRdd��e4_+e2dedde4j6df�Z7zddgl8TWne9k
�r�YnXX[[[
[[[[7[	[[[$[#[%[&[!["[['[.[[[[[[[3[[[[1[0[[[([[ [ddhl8mZdS)jz�Concrete date/time and related types.

See http://www.iana.org/time-zones/repository/tz-link.html for
time zone and DST data sources.
�NcCs||krdS||krdSdS)Nr�������x�yrr� /usr/lib64/python3.8/datetime.py�_cmpsr	ri'i۹7r���cCs$|ddko"|ddkp"|ddkS)zyear -> 1 if leap year, else 0.�r�d�r)�yearrrr�_is_leap%srcCs(|d}|d|d|d|dS)z2year -> number of days before January 1st of year.r�mr
rrr)rrrrr�_days_before_year)srcCs|dkrt|�rdSt|S)z9year, month -> number of days in that month in that year.��)r�_DAYS_IN_MONTH�r�monthrrr�_days_in_month.srcCst||dkot|�S)zCyear, month -> number of days in year preceding first day of month.r)�_DAYS_BEFORE_MONTHrrrrr�_days_before_month5srcCs t||�}t|�t||�|S)z>year, month, day -> ordinal, considering 01-Jan-0001 as day 1.)rrr�rr�day�dimrrr�_ymd2ord:s
��ri��e�c	Cs�|d8}t|t�\}}|dd}t|t�\}}t|t�\}}t|d�\}}||d|d|7}|dkst|dkr�|dddfS|dko�|d	kp�|dk}|d
d?}t||dko�|}||kr�|d8}|t||dko�|8}||8}|||dfS)
z@ordinal -> (year, month, day), considering 01-Jan-0001 as day 1.rrrrr
�r
���2r!r)�divmod�_DI400Y�_DI100Y�_DI4Yrr)	�nZn400rZn100Zn4Zn1ZleapyearrZ	precedingrrr�_ord2ymdSs"r+ZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDecZMonZTueZWedZThuZFriZSatZSunc	Cs>t|||�dd}t||�|}t�|||||||||f	�S)N��)rr�_time�struct_time)	r�m�d�hh�mm�ssZdstflagZwdayZdnumrrr�_build_struct_time�sr5�autocCstdddddd�}|dkr&|r dnd	}n|d
kr6|d}z||}Wntk
r^td��YnX|�||||�SdS)
Nz{:02d}z
{:02d}:{:02d}z{:02d}:{:02d}:{:02d}z{:02d}:{:02d}:{:02d}.{:03d}z{:02d}:{:02d}:{:02d}.{:06d})�hours�minutes�seconds�milliseconds�microsecondsr6r;r9r:��zUnknown timespec value)�KeyError�
ValueError�format)r2r3r4�us�timespecZspecs�fmtrrr�_format_time�s�rCcCs�d}|dk	r�|jdkr"d}|}nd}t|tdd��\}}t|tdd��\}}|d|||f7}|sj|jr�|d	|j7}|jr�|d
|j7}|S)N�r�-�+r�r7�r8z%s%02d:%02dz:%02d�.%06d)�daysr&�	timedeltar;r9)�off�s�signr2r3r4rrr�_format_offset�s

rOcCs�d}d}d}g}|j}dt|�}}	||	k�r�||}
|d7}|
dk�r�||	k�r�||}
|d7}|
dkr�|dkr�dt|dd�}|�|��q�|
dk�r^|dk�rRd}t|d	��rR|��}|dk	�rRd
}|jdkr�|}d}t|tdd��\}
}t|tdd
��\}}|j}|j	}|�r,d||
|||f}n&|�rDd||
||f}nd||
|f}|�|�n^|
dk�r�|dk�r�d}t|d��r�|�
�}|dk	�r�|�dd�}|�|�n|d�||
�n|d�q$||
�q$d�|�}t
�||�S)Nrr�%�fz%06d�microsecond�zrD�	utcoffsetrFrErGrHz%c%02d%02d%02d.%06dz%c%02d%02d%02dz
%c%02d%02d�Z�tznamez%%)�append�len�getattr�hasattrrTrJr&rKr9r;rV�replace�joinr.�strftime)�objectr?�	timetupleZfreplaceZzreplaceZZreplaceZ	newformat�push�ir*Zch�offsetrN�h�restr0rM�urrr�_wrap_strftime�sl


�










rfcCsjt|dd��}|ddkr,td|d��t|dd��}|ddkrPtd��t|dd	��}|||gS)
Nrr
rEzInvalid date separator: %sr!r-zInvalid date separator��
)�intr>)Zdtstrrrrrrr�_parse_isoformat_datesrjcCs
t|�}ddddg}d}tdd�D]t}||dkr:td��t|||d��||<|d7}|||d�}|rv|dkrzq�|dkr�td|��|d7}q"||k�r||dkr�td	��nN|d7}||}|d
kr�td	��t||d��|d<|dk�r|dd9<|S)Nrr#rzIncomplete time componentr�:zInvalid time separator: %c�.zInvalid microsecond component)r#r,r<)rX�ranger>ri)�tstr�len_str�
time_comps�pos�compZ	next_charZ
len_remainderrrr�_parse_hh_mm_ss_ffs2



rsc
Cs�t|�}|dkrtd��|�d�dp2|�d�d}|dkrL|d|d�n|}t|�}d}|dkr�||d�}t|�dkr�td��t|�}td	d
�|D��r�tj}nD||ddkr�dnd}t|d|d|d|dd
�}	t||	�}|�|�|S)NrzIsoformat time too shortrErrFr)r!rg�zMalformed time zone stringcss|]}|dkVqdS)rNr)�.0rrrr�	<genexpr>Tsz(_parse_isoformat_time.<locals>.<genexpr>rr#�r7r8r9r;)	rXr>�findrs�all�timezone�utcrKrW)
rnroZtz_posZtimestrrpZtziZtzstrZtz_compsZtzsignZtdrrr�_parse_isoformat_time;s,�
r|cCs&|dk	r"t|t�s"tdt|���dS)Nz4tzinfo.tzname() must return None or string, not '%s')�
isinstance�str�	TypeError�type)�namerrr�
_check_tznameds�r�cCs^|dkrdSt|t�s*td|t|�f��td�|krHtd�ksZntd||f��dS)Nz3tzinfo.%s() must return None or timedelta, not '%s'rzN%s()=%s, must be strictly between -timedelta(hours=24) and timedelta(hours=24))r}rKrr�r>)r�rbrrr�_check_utc_offsetos

� �r�cCs�t|t�r|St|t�r td��z|��}Wntk
r@Yn"Xt|t�s^tdt|�j��|S|}z|��}Wntk
r�YnDXt|t�s�tdt|�j��ddl	}|j
dt|�jtdd�|Stdt|�j��dS)Nz$integer argument expected, got floatz$__index__ returned non-int (type %s)z"__int__ returned non-int (type %s)rz$an integer is required (got type %s)r)�
stacklevel)r}ri�floatr�	__index__�AttributeErrorr��__name__�__int__�warnings�warn�DeprecationWarning)�valueZorigr�rrr�_check_int_field{sB


�
����r�cCs�t|�}t|�}t|�}t|kr,tks@ntdttf|��d|krTdks`ntd|��t||�}d|kr~|ks�ntd||��|||fS)Nzyear must be in %d..%drr"zmonth must be in 1..12zday must be in 1..%d)r��MINYEAR�MAXYEARr>rrrrr�_check_date_fields�s

r�cCs�t|�}t|�}t|�}t|�}d|kr4dks@ntd|��d|krTdks`ntd|��d|krtdks�ntd|��d|kr�dks�ntd|��|d	kr�td
|��|||||fS)Nr�zhour must be in 0..23�;zminute must be in 0..59zsecond must be in 0..59�?Bz microsecond must be in 0..999999)rrzfold must be either 0 or 1)r�r>)�hour�minute�secondrR�foldrrr�_check_time_fields�s




r�cCs|dk	rt|t�std��dS)Nz4tzinfo argument must be None or of a tzinfo subclass)r}�tzinfor)�tzrrr�_check_tzinfo_arg�sr�cCs tdt|�jt|�jf��dS)Nzcan't compare '%s' to '%s')rr�r�rrrr�	_cmperror�s�r�cCsRt||�\}}|d9}|dkr&||kn||k}|sF||krN|ddkrN|d7}|S)z�divide a by b and round result to the nearest integer

    When the ratio is exactly half-way between two integers,
    the even integer is returned.
    rrr)r&)�a�b�q�rZgreater_than_halfrrr�_divide_and_round�sr�c@seZdZdZdZd?dd�Zdd�Zdd	�Zd
d�Ze	dd
��Z
e	dd��Ze	dd��Zdd�Z
e
Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�ZeZd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Z d6d7�Z!d8d9�Z"d:d;�Z#d<d=�Z$d>S)@rKa�Represent the difference between two datetime objects.

    Supported operators:

    - add, subtract timedelta
    - unary plus, minus, abs
    - compare to timedelta
    - multiply, divide by int

    In addition, datetime supports subtraction of two datetime objects
    returning a timedelta, and addition or subtraction of a datetime
    and a timedelta giving a datetime.

    Representation: (days, seconds, microseconds).  Why?  Because I
    felt like it.
    )�_days�_seconds�
_microseconds�	_hashcodercCs�d}}	}
||d7}||d|d7}||d7}t|t�rtt�|�\}}t�|d�\}}
t|
�}	t|�}nd}|}t|t�r�t�|�\}}t|�}||7}n|}t|d�\}}||7}|	t|�7}	|d	}t|t��rt||�}t|d
�\}}t|d�\}}||7}|	|7}	n@t|�}t|d
�\}}t|d�\}}||7}|	|7}	t||�}t|d
�\}}
|	|7}	t|	d�\}}	||7}t|�dk�r�td|��t	�
|�}||_|	|_|
|_
d
|_|S)Nrr-�<�r<g�@g�Q���.A�@B�ɚ;z$timedelta # of days is too large: %dr)r}r��_math�modfrir&�round�abs�
OverflowErrorr^�__new__r�r�r�r�)�clsrJr9r;r:r8r7Zweeksr1rMr@ZdayfracZdaysecondsfracZdaysecondswholeZsecondsfracZusdouble�selfrrrr��sZ




ztimedelta.__new__cCspg}|jr|�d|j�|jr0|�d|j�|jrF|�d|j�|sT|�d�d|jj|jjd�|�fS)Nzdays=%dz
seconds=%dzmicroseconds=%d�0�	%s.%s(%s)�, )r�rWr�r��	__class__�
__module__�__qualname__r\)r��argsrrr�__repr__Ms
�ztimedelta.__repr__cCsdt|jd�\}}t|d�\}}d|||f}|jrLdd�}d||j�|}|jr`|d|j}|S)Nr�z%d:%02d:%02dcSs|t|�dkrdpdfS)NrrMrD)r�)r*rrr�plural`sz!timedelta.__str__.<locals>.pluralz
%d day%s, rI)r&r�r�r�)r�r3r4r2rMr�rrr�__str__[sztimedelta.__str__cCs|jd|jd|jdS)zTotal seconds in the duration.r�r�)rJr9r;�r�rrr�
total_secondsgs
��ztimedelta.total_secondscCs|jS�rJ�r�r�rrrrJmsztimedelta.dayscCs|jS�r9)r�r�rrrr9rsztimedelta.secondscCs|jS�r;)r�r�rrrr;wsztimedelta.microsecondscCs2t|t�r.t|j|j|j|j|j|j�StS�N�r}rKr�r�r��NotImplemented�r��otherrrr�__add__|s


�ztimedelta.__add__cCs2t|t�r.t|j|j|j|j|j|j�StSr�r�r�rrr�__sub__�s


�ztimedelta.__sub__cCst|t�r||StSr�)r}rKr�r�rrr�__rsub__�s

ztimedelta.__rsub__cCst|j|j|j�Sr�)rKr�r�r�r�rrr�__neg__�s�ztimedelta.__neg__cCs|Sr�rr�rrr�__pos__�sztimedelta.__pos__cCs|jdkr|S|SdS�Nrr�r�rrr�__abs__�s
ztimedelta.__abs__cCs`t|t�r(t|j||j||j|�St|t�r\|��}|��\}}tddt	|||��St
Sr�)r}rirKr�r�r�r��_to_microseconds�as_integer_ratior�r��r�r��usecr�r�rrr�__mul__�s

�
ztimedelta.__mul__cCs|jd|jd|jS)Nr�r��r�r�r�r�rrrr��s�ztimedelta._to_microsecondscCsNt|ttf�stS|��}t|t�r0||��St|t�rJtdd||�SdSr�)r}rirKr�r�)r�r�r�rrr�__floordiv__�s

ztimedelta.__floordiv__cCs~t|tttf�stS|��}t|t�r2||��St|t�rNtddt||��St|t�rz|��\}}tddt|||��SdSr�)r}rir�rKr�r�r�r�r�rrr�__truediv__�s


ztimedelta.__truediv__cCs*t|t�r&|��|��}tdd|�StSr�)r}rKr�r�)r�r�r�rrr�__mod__�s
ztimedelta.__mod__cCs4t|t�r0t|��|���\}}|tdd|�fStSr�)r}rKr&r�r�)r�r�r�r�rrr�
__divmod__�s
�ztimedelta.__divmod__cCs t|t�r|�|�dkStSdSr��r}rKr	r�r�rrr�__eq__�s
ztimedelta.__eq__cCs t|t�r|�|�dkStSdSr�r�r�rrr�__le__�s
ztimedelta.__le__cCs t|t�r|�|�dkStSdSr�r�r�rrr�__lt__�s
ztimedelta.__lt__cCs t|t�r|�|�dkStSdSr�r�r�rrr�__ge__�s
ztimedelta.__ge__cCs t|t�r|�|�dkStSdSr�r�r�rrr�__gt__�s
ztimedelta.__gt__cCst|��|���Sr�)r	�	_getstater�rrrr	�sztimedelta._cmpcCs|jdkrt|���|_|jS)Nr�r��hashr�r�rrr�__hash__�s
ztimedelta.__hash__cCs|jdkp|jdkp|jdkSr�r�r�rrr�__bool__s

��ztimedelta.__bool__cCs|j|j|jfSr�r�r�rrrr�
sztimedelta._getstatecCs|j|��fSr��r�r�r�rrr�
__reduce__
sztimedelta.__reduce__N)rrrrrrr)%r�r�r��__doc__�	__slots__r�r�r�r��propertyrJr9r;r��__radd__r�r�r�r�r�r��__rmul__r�r�r�r�r�r�r�r�r�r�r	r�r�r�r�rrrrrK�sR�
e


		
		rKi6e�r�r�r�r�)rJr7r8r9r;r�c@s@eZdZdZdZdDdd�Zedd��Zedd	��Zed
d��Z	edd
��Z
edd��Zdd�Zdd�Z
dd�Zdd�Zdd�ZeZedd��Zedd��Zedd��Zd d!�Zd"d#�ZdEd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Z e Z!d6d7�Z"d8d9�Z#d:d;�Z$d<d=�Z%d>d?�Z&d@dA�Z'dBdC�Z(dS)F�datea�Concrete date type.

    Constructors:

    __new__()
    fromtimestamp()
    today()
    fromordinal()

    Operators:

    __repr__, __str__
    __eq__, __le__, __lt__, __ge__, __gt__, __hash__
    __add__, __radd__, __sub__ (add/radd only with timedelta arg)

    Methods:

    timetuple()
    toordinal()
    weekday()
    isoweekday(), isocalendar(), isoformat()
    ctime()
    strftime()

    Properties (readonly):
    year, month, day
    )�_year�_month�_dayr�NcCs�|dkr�t|ttf�r�t|�dkr�dt|dd��krBdkr�nnTt|t�r|z|�d�}Wntk
rztd��YnXt�	|�}|�
|�d	|_|St|||�\}}}t�	|�}||_
||_||_d	|_|S)
zVConstructor.

        Arguments:

        year, month, day (required, base 1)
        Nr
rrr#r"�latin1znFailed to encode latin1 string when unpickling a date object. pickle.load(data, encoding='latin1') is assumed.r)r}�bytesr~rX�ord�encode�UnicodeEncodeErrorr>r^r��_date__setstater�r�r�r�r�)r�rrrr�rrrr�3s8�
���

�



zdate.__new__c	Cs(t�|�\	}}}}}}}}	}
||||�S)z;Construct a date from a POSIX timestamp (like time.time()).)r.�	localtime)r��trr0r1r2r3r4�weekday�jday�dstrrr�
fromtimestampUszdate.fromtimestampcCst��}|�|�S)z"Construct a date from time.time().�r.�timer��r�r�rrr�today[sz
date.todaycCst|�\}}}||||�S)z�Construct a date from a proleptic Gregorian ordinal.

        January 1 of year 1 is day 1.  Only the year, month and day are
        non-zero in the result.
        )r+)r�r*rr0r1rrr�fromordinalaszdate.fromordinalcCsHt|t�std��z|t|��WStk
rBtd|����YnXdS)z5Construct a date from the output of date.isoformat().�#fromisoformat: argument must be str�Invalid isoformat string: N)r}r~rrj�	Exceptionr>)r��date_stringrrr�
fromisoformatks
zdate.fromisoformatc	Cs�t|krtks$ntd|����d|kr8dks�nd}|dkrrt|dd�d}|dksn|dkrrt|�rrd	}|r�td
|����d|kr�dks�ntd|�d
���|dd|d}t|�}||}|t|��S)z|Construct a date from the ISO year, week number and weekday.

        This is the inverse of the date.isocalendar() functionzYear is out of range: r�5Trr-r
r#FzInvalid week: rgzInvalid weekday: z (range is [1, 7]))r�r�r>rr�_isoweek1mondayr+)	r�r�weekrZout_of_rangeZ
first_weekdayZ
day_offsetZday_1Zord_dayrrr�fromisocalendarws$�zdate.fromisocalendarcCs d|jj|jj|j|j|jfS)a5Convert to formal string, for repr().

        >>> dt = datetime(2010, 1, 1)
        >>> repr(dt)
        'datetime.datetime(2010, 1, 1, 0, 0)'

        >>> dt = datetime(2010, 1, 1, tzinfo=timezone.utc)
        >>> repr(dt)
        'datetime.datetime(2010, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)'
        z%s.%s(%d, %d, %d))r�r�r�r�r�r�r�rrrr��s�z
date.__repr__cCs.|��dpd}dt|t|j|j|jfS)�Return ctime() style string.r-z%s %s %2d 00:00:00 %04d)�	toordinal�	_DAYNAMES�_MONTHNAMESr�r�r��r�r�rrr�ctime�s�z
date.ctimecCst|||���S)zFormat using strftime().)rfr_�r�rBrrrr]�sz
date.strftimecCs:t|t�stdt|�j��t|�dkr2|�|�St|�S�Nzmust be str, not %sr�r}r~rr�r�rXr]rrrr�
__format__�s


zdate.__format__cCsd|j|j|jfS)z�Return the date formatted according to ISO.

        This is 'YYYY-MM-DD'.

        References:
        - http://www.w3.org/TR/NOTE-datetime
        - http://www.cl.cam.ac.uk/~mgk25/iso-time.html
        z%04d-%02d-%02d)r�r�r�r�rrr�	isoformat�s	zdate.isoformatcCs|jS)z
year (1-9999))r�r�rrrr�sz	date.yearcCs|jS)zmonth (1-12))r�r�rrrr�sz
date.monthcCs|jS)z
day (1-31))r�r�rrrr�szdate.daycCst|j|j|jdddd�S)�9Return local time tuple compatible with time.localtime().rr)r5r�r�r�r�rrrr_�s�zdate.timetuplecCst|j|j|j�S)z�Return proleptic Gregorian ordinal for the year, month and day.

        January 1 of year 1 is day 1.  Only the year, month and day values
        contribute to the result.
        )rr�r�r�r�rrrr�szdate.toordinalcCs:|dkr|j}|dkr|j}|dkr*|j}t|�|||�S)z;Return a new date with new values for the specified fields.N)r�r�r�r�)r�rrrrrrr[�szdate.replacecCst|t�r|�|�dkStSr��r}r�r	r�r�rrrr��s
zdate.__eq__cCst|t�r|�|�dkStSr�rr�rrrr�s
zdate.__le__cCst|t�r|�|�dkStSr�rr�rrrr�s
zdate.__lt__cCst|t�r|�|�dkStSr�rr�rrrr�
s
zdate.__ge__cCst|t�r|�|�dkStSr�rr�rrrr�s
zdate.__gt__cCsB|j|j|j}}}|j|j|j}}}t|||f|||f�Sr�)r�r�r�r	)r�r�rr0r1Zy2Zm2Zd2rrrr	sz	date._cmpcCs|jdkrt|���|_|jS)�Hash.rr�r�rrrr�s
z
date.__hash__cCsJt|t�rF|��|j}d|kr,tkr>nnt|��|�Std��tS)zAdd a date to a timedelta.r�result out of range)	r}rKrrJ�_MAXORDINALr�rr�r�)r�r��orrrr�%s
zdate.__add__cCsDt|t�r|t|j�St|t�r@|��}|��}t||�StS)z.Subtract two dates, or a date and a timedelta.)r}rKrJr�rr�)r�r��days1�days2rrrr�0s

zdate.__sub__cCs|��ddS)z:Return day of the week, where Monday == 0 ... Sunday == 6.r,r-�rr�rrrr�:szdate.weekdaycCs|��dpdS)z:Return day of the week, where Monday == 1 ... Sunday == 7.r-rr�rrr�
isoweekday@szdate.isoweekdaycCs�|j}t|�}t|j|j|j�}t||d�\}}|dkr^|d8}t|�}t||d�\}}n$|dkr�|t|d�kr�|d7}d}||d|dfS)a�Return a 3-tuple containing ISO year, week number, and weekday.

        The first ISO week of the year is the (Mon-Sun) week
        containing the year's first Thursday; everything else derives
        from that.

        The first week is 1; Monday is 1 ... Sunday is 7.

        ISO calendar algorithm taken from
        http://www.phys.uu.nl/~vgent/calendar/isocalendar.htm
        (used with permission)
        r-rr�4)r�rrr�r�r&)r�r�week1mondayrr	rrrr�isocalendarEs
zdate.isocalendarcCs&t|jd�\}}t|||j|jg�fS�N�)r&r�r�r�r�)r��yhi�ylorrrr�cszdate._getstatecCs"|\}}|_|_|d||_dSr#)r�r�r�)r��stringr%r&rrr�
__setstategszdate.__setstatecCs|j|��fSr�r�r�rrrr�kszdate.__reduce__)NN)NNN))r�r�r�r�r�r��classmethodr�rrrr
r�rr]rrr�r�rrrr_rr[r�r�r�r�r�r	r�r�r�r�r�rr"r�r�r�rrrrr�sX
"


	

$



	
r�r"r�c@s<eZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
S)r�z}Abstract base class for time zone info classes.

    Subclasses must override the name(), utcoffset() and dst() methods.
    rcCstd��dS)z%datetime -> string name of time zone.z&tzinfo subclass must override tzname()N��NotImplementedError�r��dtrrrrV|sz
tzinfo.tznamecCstd��dS)zIdatetime -> timedelta, positive for east of UTC, negative for west of UTCz)tzinfo subclass must override utcoffset()Nr*r,rrrrT�sztzinfo.utcoffsetcCstd��dS)z�datetime -> DST offset as timedelta, positive for east of UTC.

        Return 0 if DST not in effect.  utcoffset() must include the DST
        offset.
        z#tzinfo subclass must override dst()Nr*r,rrrr��sz
tzinfo.dstcCs�t|t�std��|j|k	r$td��|��}|dkr<td��|��}|dkrTtd��||}|r�||7}|��}|dkr�td��||S)z*datetime in UTC -> datetime in local time.z&fromutc() requires a datetime argumentzdt.tzinfo is not selfNz0fromutc() requires a non-None utcoffset() resultz*fromutc() requires a non-None dst() resultz;fromutc(): dt.dst gave inconsistent results; cannot convert)r}�datetimerr�r>rTr�)r�r-ZdtoffZdtdst�deltarrr�fromutc�s"

ztzinfo.fromutccCsft|dd�}|r|�}nd}t|dd�}|r4|�}nt|dd�pBd}|dkrV|j|fS|j||fSdS)N�__getinitargs__r�__getstate__�__dict__)rYr�)r�Zgetinitargsr��getstate�staterrrr��s
ztzinfo.__reduce__N)
r�r�r�r�r�rVrTr�r0r�rrrrr�usr�c@s*eZdZdZdZdBdd�dd�Zedd	��Zed
d��Zedd
��Z	edd��Z
edd��Zedd��Zdd�Z
dd�Zdd�Zdd�Zdd�ZdCdd �Zd!d"�Zd#d$�Zd%d&�ZdDd(d)�ZeZed*d+��Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�ZdEdd�d7d8�ZdFd:d;�Z d<d=�Z!d>d?�Z"d@dA�Z#dS)Gr�a<Time with time zone.

    Constructors:

    __new__()

    Operators:

    __repr__, __str__
    __eq__, __le__, __lt__, __ge__, __gt__, __hash__

    Methods:

    strftime()
    isoformat()
    utcoffset()
    tzname()
    dst()

    Properties (readonly):
    hour, minute, second, microsecond, tzinfo, fold
    )�_hour�_minute�_second�_microsecond�_tzinfor��_foldrN�r�cCs�t|ttf�r�t|�dkr�t|dd��d@dkr�t|t�rhz|�d�}Wntk
rftd��YnXt�	|�}|�
||p~d�d	|_|St|||||�\}}}}}t
|�t�	|�}||_||_||_||_||_d	|_||_|S)
z�Constructor.

        Arguments:

        hour, minute (required)
        second, microsecond (default to zero)
        tzinfo (default to None)
        fold (keyword only, default to zero)
        r,rr�r$r�znFailed to encode latin1 string when unpickling a time object. pickle.load(data, encoding='latin1') is assumed.Nr)r}r�r~rXr�r�r�r>r^r��_time__setstater�r�r�r6r7r8r9r:r;)r�r�r�r�rRr�r�r�rrrr��s>
�
�

�
ztime.__new__cCs|jS�zhour (0-23)�r6r�rrrr��sz	time.hourcCs|jS�z
minute (0-59)�r7r�rrrr�sztime.minutecCs|jS�z
second (0-59)�r8r�rrrr�sztime.secondcCs|jS�zmicrosecond (0-999999)�r9r�rrrrRsztime.microsecondcCs|jS�ztimezone info object�r:r�rrrr�sztime.tzinfocCs|jSr��r;r�rrrr�sz	time.foldcCs$t|t�r|j|dd�dkStSdS)NT��allow_mixedr�r}r�r	r�r�rrrr�s
ztime.__eq__cCs t|t�r|�|�dkStSdSr�rLr�rrrr�#s
ztime.__le__cCs t|t�r|�|�dkStSdSr�rLr�rrrr�)s
ztime.__lt__cCs t|t�r|�|�dkStSdSr�rLr�rrrr�/s
ztime.__ge__cCs t|t�r|�|�dkStSdSr�rLr�rrrr�5s
ztime.__gt__Fc
Cs�|j}|j}d}}||kr"d}n|��}|��}||k}|rht|j|j|j|jf|j|j|j|jf�S|dksx|dkr�|r�dStd��|jd|j|tdd�}|jd|j|tdd�}	t||j|jf|	|j|jf�S)NTrz$cannot compare naive and aware timesr�rrH)	r:rTr	r6r7r8r9rrK)
r�r�rK�mytz�ottz�myoff�otoff�base_compareZmyhhmmZothhmmrrrr	;s2����z	time._cmpcCs�|jdkr�|jr|jdd�}n|}|��}|sBt|��d�|_nztt|j|j	d�|tdd��\}}|tdd�}d|kr�dkr�nntt
|||j|j��|_nt|||j|jf�|_|jS)	rrrr<�r7r8rrGrHr$)
r�r�r[rTr�r�r&rKr�r�r�r�rR)r�r��tzoffrcr0rrrr�Ws
�z
time.__hash__cCs|��}t|�S)z=Return formatted timezone offset (+xx:xx) or an empty string.)rTrO)r�rLrrr�_tzstrnsztime._tzstrcCs�|jdkrd|j|jf}n|jdkr2d|j}nd}d|jj|jj|j|j|f}|jdk	rx|dd�d|jd	}|jr�|dd�d
}|S)�%Convert to formal string, for repr().rz, %d, %dz, %drDz%s.%s(%d, %d%s)Nr�, tzinfo=%r�)�	, fold=1))	r9r8r�r�r�r6r7r:r;�r�rMrrrr�ss 

�
z
time.__repr__r6cCs0t|j|j|j|j|�}|��}|r,||7}|S)a�Return the time formatted according to ISO.

        The full format is 'HH:MM:SS.mmmmmm+zz:zz'. By default, the fractional
        part is omitted if self.microsecond == 0.

        The optional argument timespec specifies the number of additional
        terms of the time to include. Valid options are 'auto', 'hours',
        'minutes', 'seconds', 'milliseconds' and 'microseconds'.
        )rCr6r7r8r9rT)r�rArMr�rrrr�s
�ztime.isoformatcCsHt|t�std��z|t|��WStk
rBtd|����YnXdS)z0Construct a time from the output of isoformat().rrN)r}r~rr|rr>)r�Ztime_stringrrrr�s
ztime.fromisoformatc	Cs(ddd|j|j|jdddf	}t|||�S)z{Format using strftime().  The date part of the timestamp passed
        to underlying strftime should not be used.
        ilrrr)r6r7r8rf)r�rBr_rrrr]�s�z
time.strftimecCs:t|t�stdt|�j��t|�dkr2|�|�St|�Srrrrrrr�s


ztime.__format__cCs(|jdkrdS|j�d�}td|�|S)z^Return the timezone offset as timedelta, positive east of UTC
         (negative west of UTC).NrT�r:rTr��r�rbrrrrT�s


ztime.utcoffsetcCs&|jdkrdS|j�d�}t|�|S�aReturn the timezone name.

        Note that the name is 100% informational -- there's no requirement that
        it mean anything in particular. For example, "GMT", "UTC", "-500",
        "-5:00", "EDT", "US/Eastern", "America/New York" are all valid replies.
        N�r:rVr��r�r�rrrrV�s

ztime.tznamecCs(|jdkrdS|j�d�}td|�|S�aqReturn 0 if DST is not in effect, or the DST offset (as timedelta
        positive eastward) if DST is in effect.

        This is purely informational; the DST offset has already been added to
        the UTC offset returned by utcoffset() if applicable, so there's no
        need to consult dst() unless you're interested in displaying the DST
        info.
        Nr��r:r�r�r[rrrr��s
	

ztime.dstTcCsl|dkr|j}|dkr|j}|dkr*|j}|dkr8|j}|dkrF|j}|dkrT|j}t|�||||||d�S)z;Return a new time with new values for the specified fields.NTr<)r�r�r�rRr�r;r�)r�r�r�r�rRr�r�rrrr[�sztime.replacer#cCspt|jd�\}}t|d�\}}|j}|jr:|dkr:|d7}t||j|j|||g�}|jdkrb|fS||jfSdS�Nr$r#�)r&r9r6r;r�r7r8r:)r��protocol�us2�us3�us1rc�	basestaterrrr��s�
ztime._getstatecCst|dk	rt|t�std��|\}|_|_}}}|dkrHd|_|d|_nd|_||_|d>|Bd>|B|_||_dS)N�bad tzinfo state argr=rrbrrg)	r}�
_tzinfo_classrr7r8r;r6r9r:)r�r'r�rcrfrdrerrrr(�sztime.__setstatecCs|j|�|�fSr�r��r�rcrrr�
__reduce_ex__sztime.__reduce_ex__cCs
|�d�S�Nr�rkr�rrrr�sztime.__reduce__)rrrrN)F)r6)NNNNT)r#)$r�r�r�r�r�r�r�r�r�r�rRr�r�r�r�r�r�r�r	r�rTr�rr�r)rr]rrTrVr�r[r�r>rkr�rrrrr��sT(








		
��


r�c@s�eZdZdZejejZdddd�dd�Zedd��Z	ed	d
��Z
edd��Zed
d��Zedd��Z
edd��Zedd��Zededd��Zedd��Zedfdd��Zedd��Zedgdd��Zed d!��Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zdhdd�d0d1�Zd2d3�Zdid4d5�Zd6d7�Zdjd:d;�Z d<d=�Z!d>d?�Z"ed@dA��Z#dBdC�Z$dDdE�Z%dFdG�Z&dHdI�Z'dJdK�Z(dLdM�Z)dNdO�Z*dPdQ�Z+dkdSdT�Z,dUdV�Z-e-Z.dWdX�Z/dYdZ�Z0dld\d]�Z1d^d_�Z2d`da�Z3dbdc�Z4dS)mr.z�datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]])

    The year, month and day arguments are required. tzinfo may be None, or an
    instance of a tzinfo subclass. The remaining arguments may be ints.
    Nrr<c	Cst|ttf�r�t|�dkr�dt|dd��d@kr>dkr�nnVt|t�rxzt|d�}Wntk
rvtd��YnXt�|�}
|
�	||�d	|
_
|
St|||�\}}}t|||||	�\}}}}}	t
|�t�|�}
||
_||
_||
_||
_||
_||
_||
_||
_d	|
_
|	|
_|
S)
Nrhrrr#r=r"r�zrFailed to encode latin1 string when unpickling a datetime object. pickle.load(data, encoding='latin1') is assumed.r)r}r�r~rXr�r�r>r^r��_datetime__setstater�r�r�r�r�r�r�r6r7r8r9r:r;)r�rrrr�r�r�rRr�r�r�rrrr�sL��

�

�
zdatetime.__new__cCs|jSr?r@r�rrrr�Csz
datetime.hourcCs|jSrArBr�rrrr�Hszdatetime.minutecCs|jSrCrDr�rrrr�Mszdatetime.secondcCs|jSrErFr�rrrrRRszdatetime.microsecondcCs|jSrGrHr�rrrr�Wszdatetime.tzinfocCs|jSr�rIr�rrrr�\sz
datetime.foldc	Cspt�|�\}}t|d�}|dkr4|d7}|d8}n|dkrL|d8}|d7}|rVtjntj}||�\	}}}	}
}}}
}}t|d�}||||	|
||||�}|dk�rbd}||kr�tj�	d�r�|S|||�dd	�\}}}	}
}}||||	|
||||�}||t
d|�}|jdk�rl|||t
dd��dd	�\}}}	}
}}||||	|
||||�}||k�rld|_n
|�
|�}|S)
��Construct a datetime from a POSIX timestamp (like time.time()).

        A timezone info object may be passed in as well.
        r�r�rrr�Nr��winr,)r�r�r�r.�gmtimer��min�sys�platform�
startswithrKrJr;r0)r�r�r{r�Zfracr@Z	converterrr0r1r2r3r4r�r�r��result�max_fold_secondsZprobe1ZtransZprobe2rrr�_fromtimestamp`s4


 *

zdatetime._fromtimestampcCst|�|�||dk	|�S)roN)r�rx)r�r�r�rrrr��szdatetime.fromtimestampcCs|�|dd�S)z6Construct a naive UTC datetime from a POSIX timestamp.TN)rxr�rrr�utcfromtimestamp�szdatetime.utcfromtimestampcCst��}|�||�S)zBConstruct a datetime from time.time() and optional time zone info.r�)r�r�r�rrr�now�szdatetime.nowcCst��}|�|�S)z*Construct a UTC datetime from time.time().)r.r�ryr�rrr�utcnow�szdatetime.utcnowTcCs\t|t�std��t|t�s$td��|dkr2|j}||j|j|j|j|j	|j
|j||jd�	S)z8Construct a datetime from a given date and a given time.z%date argument must be a date instancez%time argument must be a time instanceTr<)
r}�_date_classr�_time_classr�rrrr�r�r�rRr�)r�r�r�r�rrr�combine�s

�zdatetime.combinecCs�t|t�std��|dd�}|dd�}zt|�}Wn"tk
rXtd|����YnX|r�zt|�}Wq�tk
r�td|����Yq�Xndddddg}|||�S)z=Construct a datetime from the output of datetime.isoformat().rrrh�Nr)r}r~rrjr>r|)r�rZdstrrnZdate_componentsZtime_componentsrrrr�s
zdatetime.fromisoformatcCsD|��}|dkrd}n|r d}nd}t|j|j|j|j|j|j|�S)rNrrr)r�r5rrrr�r�r�)r�r�rrrr_�s�zdatetime.timetuplec
s�tddd��d}|�tdd�}�fdd�}||�|}||}||�}||kr�|||f|j}||�|}||kr�|Sn||}||}||�}	|	|kr�|S||kr�|Sttf|j||�S)zReturn integer POSIX timestamp.�rr�rcs>t�|�dd�\}}}}}}t||||||��tdd�S)Nr,rr)r.r�r.rK)rerr0r1r2r3r4�Zepochrr�local�szdatetime._mktime.<locals>.local)r.rKr��maxrr)
r�rwr�r�r�Zu1�t1Zu2r��t2rr�r�_mktime�s(zdatetime._mktimecCs0|jdkr |��}||jdS|t��SdS)zReturn POSIX timestamp as floatNr�)r:r�rR�_EPOCHr�rYrrr�	timestamp�s
zdatetime.timestampcCsT|��}|r||8}|j|j|j}}}|j|j|j}}}t||||||d�S)z4Return UTC time tuple compatible with time.gmtime().r)rTrrrr�r�r�r5)r�rbrr0r1r2r3r4rrr�utctimetupleszdatetime.utctimetuplecCst|j|j|j�S)zReturn the date part.)r�r�r�r�r�rrrr�sz
datetime.datecCst|j|j|j|j|jd�S)z'Return the time part, with tzinfo None.r<)r�r�r�r�rRr�r�rrrr�sz
datetime.timecCs t|j|j|j|j|j|jd�S)z'Return the time part, with same tzinfo.r<)r�r�r�r�rRr:r�r�rrr�timetzs�zdatetime.timetzc	
Cs�|dkr|j}|dkr|j}|dkr*|j}|dkr8|j}|dkrF|j}|dkrT|j}|dkrb|j}|dkrp|j}|	dkr~|j}	t	|�|||||||||	d�	S)z?Return a new datetime with new values for the specified fields.NTr<)
rrrr�r�r�rRr�r�r�)
r�rrrr�r�r�rRr�r�rrrr[s.�zdatetime.replacecCs\|jdkr|��}n|ttdd�}t�|�}t|dd��}|j}|j}t	t|d�|�S)Nrr�r,)
r�r�r�rKr.r�r.�	tm_gmtoff�tm_zonerz)r�ZtsZlocaltmr�ZgmtoffZzonerrr�_local_timezone4s


zdatetime._local_timezonecCs�|dkr|��}nt|t�s$td��|j}|dkrF|��}|�|�}n,|�|�}|dkrr|jdd���}|�|�}||kr~|S||j|d�}|�|�S)Nz)tz argument must be an instance of tzinfo�r�)r�r}r�rrTr[r0)r�r�rMZmyoffsetr{rrr�
astimezone@s 



zdatetime.astimezonecCs:|��dpd}dt|t|j|j|j|j|j|jfS)rr-z%s %s %2d %02d:%02d:%02d %04d)	rr
rr�r�r6r7r8r�rrrrr[s�zdatetime.ctime�Tr6cCsNd|j|j|j|ft|j|j|j|j|�}|��}t	|�}|rJ||7}|S)a�Return the time formatted according to ISO.

        The full format looks like 'YYYY-MM-DD HH:MM:SS.mmmmmm'.
        By default, the fractional part is omitted if self.microsecond == 0.

        If self.tzinfo is not None, the UTC offset is also attached, giving
        giving a full format of 'YYYY-MM-DD HH:MM:SS.mmmmmm+HH:MM'.

        Optional argument sep specifies the separator between date and
        time, default 'T'.

        The optional argument timespec specifies the number of additional
        terms of the time to include. Valid options are 'auto', 'hours',
        'minutes', 'seconds', 'milliseconds' and 'microseconds'.
        z%04d-%02d-%02d%c)
r�r�r�rCr6r7r8r9rTrO)r��seprArMrLr�rrrres��zdatetime.isoformatcCs�|j|j|j|j|j|j|jg}|ddkr2|d=|ddkrD|d=d|jj|jj	d�
tt|��f}|j
dk	r�|dd�d|j
d}|jr�|dd�d}|S)	rUrrr�r�NrVrWrX)r�r�r�r6r7r8r9r�r�r�r\�mapr~r:r;)r��LrMrrrr��s&��
zdatetime.__repr__cCs|jdd�S)zConvert to string, for str().� )r�)rr�rrrr��szdatetime.__str__cCsddl}|�|||�S)zKstring, format -> new datetime parsed from a string (like time.strptime()).rN)�	_strptimeZ_strptime_datetime)r�rr?r�rrr�strptime�szdatetime.strptimecCs(|jdkrdS|j�|�}td|�|S)z\Return the timezone offset as timedelta positive east of UTC (negative west of
        UTC).NrTrZr[rrrrT�s


zdatetime.utcoffsetcCs&|jdkrdS|j�|�}t|�|Sr\r]r^rrrrV�s

zdatetime.tznamecCs(|jdkrdS|j�|�}td|�|Sr_r`r[rrrr��s
	

zdatetime.dstcCs2t|t�r|j|dd�dkSt|t�s*tSdSdS)NTrJrF)r}r.r	r�r�r�rrrr��s


zdatetime.__eq__cCs4t|t�r|�|�dkSt|t�s&tSt||�dSr��r}r.r	r�r�r�r�rrrr��s


zdatetime.__le__cCs4t|t�r|�|�dkSt|t�s&tSt||�dSr�r�r�rrrr��s


zdatetime.__lt__cCs4t|t�r|�|�dkSt|t�s&tSt||�dSr�r�r�rrrr��s


zdatetime.__ge__cCs4t|t�r|�|�dkSt|t�s&tSt||�dSr�r�r�rrrr��s


zdatetime.__gt__Fc		Cs�|j}|j}d}}||kr"d}nT|��}|��}|rn||j|jd���krRdS||j|jd���krndS||k}|r�t|j|j|j|j|j	|j
|jf|j|j|j|j|j	|j
|jf�S|dks�|dkr�|r�dStd��||}|j
dkr�dS|r�dp�dS)NTr<rz(cannot compare naive and aware datetimesrrr)r:rTr[r�r	r�r�r�r6r7r8r9rrJ)	r�r�rKrMrNrOrPrQZdiffrrrr	�sF���
z
datetime._cmpc
Cs�t|t�stSt|��|j|j|j|jd�}||7}t|j	d�\}}t|d�\}}d|j
krhtkr�nn*t|��
t�|j
�t||||j|jd��Std��dS)zAdd a datetime and a timedelta.rwr�r�rr�rN)r}rKr�rr6r7r8r9r&r9rJrr�r~r�rr�r;r:r�)r�r�r/r�Zremr�r�rrrr�s&
���zdatetime.__add__c	Cs�t|t�s"t|t�r||StS|��}|��}|j|jd|jd}|j|jd|jd}t|||||j|j�}|j	|j	kr�|S|�
�}|�
�}||kr�|S|dks�|dkr�td��|||S)z6Subtract two datetimes, or a datetime and a timedelta.r�r�Nz(cannot mix naive and timezone-aware time)r}r.rKr�rr8r7r6r9r:rTr)	r�r�rrZsecs1Zsecs2�baserOrPrrrr�&s*



�zdatetime.__sub__cCs�|jdkr�|jr|jdd�}n|}|��}|dkrFt|��d�|_nDt|j|j|j	�}|j
d|jd|j}tt
|||j�|�|_|jS)Nrrr<r�r�)r�r�r[rTr�r�rrrrr�r�r�rKrR)r�r�rSrJr9rrrr�>s
zdatetime.__hash__r#c	Cs�t|jd�\}}t|jd�\}}t|d�\}}|j}|jrJ|dkrJ|d7}t||||j|j|j|j	|||g
�}|j
dkr~|fS||j
fSdSra)r&r�r9r�r;r�r�r6r7r8r:)	r�rcr%r&rdrerfr0rgrrrr�Os"�
zdatetime._getstatec	
Cs�|dk	rt|t�std��|\
}}}|_|_|_|_}}}|dkrTd|_|d|_nd|_||_|d||_	|d>|Bd>|B|_
||_dS)Nrhr=rrbrr$rg)r}rirr�r6r7r8r;r�r�r9r:)	r�r'r�r%r&r0rfrdrerrrr(^s"�zdatetime.__setstatecCs|j|�|�fSr�r�rjrrrrkmszdatetime.__reduce_ex__cCs
|�d�Srlrmr�rrrr�pszdatetime.__reduce__)NNrrrrN)N)N)T)NNNNNNNT)N)r�r6)F)r#)5r�r�r�r�r�r�r�r�r�r�r�r�rRr�r�r)rxr�ryrzr{r~rr_r�r�r�r�r[r�r�rrr�r�r�rTrVr�r�r�r�r�r�r	r�r�r�r�r�rnrkr�rrrrr.s���$






+	



#	��



	

%
r.cCs8d}t|dd�}|dd}||}||kr4|d7}|S)Nr#rr,r-)r)rZTHURSDAYZfirstdayZfirstweekdayr!rrrrysrc@s�eZdZdZe�Zefdd�Zeddd��Zdd�Z	d	d
�Z
dd�Zd
d�Zdd�Z
dd�Zdd�Zdd�Zdd�Zeddd�ZeZedd��ZdS)rz)�_offset�_namecCslt|t�std��||jkr,|s&|jSd}nt|t�s>td��|j|krV|jks`ntd��|�	||�S)Nzoffset must be a timedeltazname must be a stringzYoffset must be a timedelta strictly between -timedelta(hours=24) and timedelta(hours=24).)
r}rKr�_Omittedr{r~�
_minoffset�
_maxoffsetr>�_create)r�rbr�rrrr��s


ztimezone.__new__NcCst�|�}||_||_|Sr�)r�r�r�r�)r�rbr�r�rrrr��s
ztimezone._createcCs|jdkr|jfS|j|jfS)zpickle supportN)r�r�r�rrrr1�s
ztimezone.__getinitargs__cCst|t�r|j|jkStSr�)r}rzr�r�r�rrrr��s
ztimezone.__eq__cCs
t|j�Sr�)r�r�r�rrrr��sztimezone.__hash__cCsL||jkrdS|jdkr0d|jj|jj|jfSd|jj|jj|j|jfS)aConvert to formal string, for repr().

        >>> tz = timezone.utc
        >>> repr(tz)
        'datetime.timezone.utc'
        >>> tz = timezone(timedelta(hours=-5), 'EST')
        >>> repr(tz)
        "datetime.timezone(datetime.timedelta(-1, 68400), 'EST')"
        zdatetime.timezone.utcNz	%s.%s(%r)z
%s.%s(%r, %r))r{r�r�r�r�r�r�rrrr��s


��ztimezone.__repr__cCs
|�d�Sr�)rVr�rrrr��sztimezone.__str__cCs$t|t�s|dkr|jStd��dS)Nz8utcoffset() argument must be a datetime instance or None)r}r.r�rr,rrrrT�sztimezone.utcoffsetcCs:t|t�s|dkr.|jdkr(|�|j�S|jStd��dS)Nz5tzname() argument must be a datetime instance or None)r}r.r��_name_from_offsetr�rr,rrrrV�s

ztimezone.tznamecCs"t|t�s|dkrdStd��dS)Nz2dst() argument must be a datetime instance or None)r}r.rr,rrrr��sztimezone.dstcCs2t|t�r&|j|k	rtd��||jStd��dS)Nzfromutc: dt.tzinfo is not selfz6fromutc() argument must be a datetime instance or None)r}r.r�r>r�rr,rrrr0�s



ztimezone.fromutcr$r)r7r;c
Cs�|sdS|td�kr d}|}nd}t|tdd��\}}t|tdd��\}}|j}|j}|r�d|�|d�d	|d�d	|d�d
|d��	S|r�d|�|d�d	|d�d	|d��Sd|�|d�d	|d��S)NZUTCrrErFrrGrHZ02drkrlZ06d)rKr&r9r;)r/rNr7rdr8r9r;rrrr��s( ztimezone._name_from_offset)N)r�r�r�r�r^r�r�r)r�r1r�r�r�r�rTrVr�r0rKr�r��staticmethodr�rrrrrz�s$	rzrRr�r�)�*)r�)r6):r�r�r.Zmathr�rsr	r�r�rrrZdbmrrWrrrrrr'r(r)r+rr
r5rCrOrfrjrsr|r�r�r�r�r�r�r�r�rKrrr�Z
resolutionr�r|r�rir}r.rrzr�r{r�Z	_datetime�ImportErrorrrrr�<module>s�

	?�
@') 
=

�[DXatG
__pycache__/cgi.cpython-38.opt-1.pyc000064400000063655151153537560013137 0ustar00U

&�.e���@sjdZdZddlmZmZmZddlmZddlZddl	Z	ddl
Zddlm
Z
ddlmZddlZddlZddlZdd	d
ddd
ddddddgZdadadd�Zdd�Zdd�Zdd�Zeadade	jdddfdd
�Zd1d!d�Zd"d#�Zd$d�Z Gd%d�d�Z!Gd&d	�d	�Z"e	jfd'd
�Z#d2d(d�Z$e	jfd)d�Z%d*d�Z&d+d�Z'd,d�Z(d-d�Z)d.d/�Z*e+d0k�rfe#�dS)3z�Support module for CGI (Common Gateway Interface) scripts.

This module defines a number of utilities for use by CGI scripts
written in Python.
z2.6�)�StringIO�BytesIO�
TextIOWrapper)�MappingN)�
FeedParser)�Message�MiniFieldStorage�FieldStorage�parse�parse_multipart�parse_header�test�print_exception�
print_environ�
print_form�print_directory�print_arguments�print_environ_usage�cGsFtr,ts,zttd�aWntk
r*YnXts6tantat|�dS)a�Write a log message, if there is a log file.

    Even though this function is called initlog(), you should always
    use log(); log is a variable that is set either to initlog
    (initially), to dolog (once the log file has been opened), or to
    nolog (when logging is disabled).

    The first argument is a format string; the remaining arguments (if
    any) are arguments to the % operator, so e.g.
        log("%s: %s", "a", "b")
    will write "a: b" to the log file, followed by a newline.

    If the global logfp is not None, it should be a file object to
    which log data is written.

    If the global logfp is None, the global logfile may be a string
    giving a filename to open, in append mode.  This file should be
    world writable!!!  If the file can't be opened, logging is
    silently disabled (since there is no safe place where we could
    send an error message).

    �aN)�logfile�logfp�open�OSError�nolog�log�dolog�Zallargs�r�/usr/lib64/python3.8/cgi.py�initlog8sr cGst�||d�dS)z=Write a log message to the log file.  See initlog() for docs.�
N)r�write)Zfmt�argsrrrr[srcGsdS)z9Dummy function, assigned to log when logging is disabled.Nrrrrrr_srcCsdatrt��datadS)zClose the log file.rN)rr�closer rrrrr�closelogcs
r%c
Cs^|dkrtj}t|d�r |j}nd}t|t�r4|j}d|krDd|d<|ddk�rt|d�\}}|dkrxt|||d	�S|d
kr�t	|d�}t
r�|t
kr�td��|�|��
|�}	nd
}	d|kr�|	r�|	d}	|	|d}	n*tjdd��r|	r�|	d}	|	tjd}	|	|d<n<d|k�r |d}	n(tjdd��r<tjd}	nd
}	|	|d<tjj|	||||d�S)a�Parse a query in the environment or from a file (default stdin)

        Arguments, all optional:

        fp              : file pointer; default: sys.stdin.buffer

        environ         : environment dictionary; default: os.environ

        keep_blank_values: flag indicating whether blank values in
            percent-encoded forms should be treated as blank strings.
            A true value indicates that blanks should be retained as
            blank strings.  The default false value indicates that
            blank values are to be ignored and treated as if they were
            not included.

        strict_parsing: flag indicating what to do with parsing errors.
            If false (the default), errors are silently ignored.
            If true, errors raise a ValueError exception.

        separator: str. The symbol to use for separating the query arguments.
            Defaults to &.
    N�encodingzlatin-1�REQUEST_METHOD�GET�POST�CONTENT_TYPEzmultipart/form-data)�	separator�!application/x-www-form-urlencoded�CONTENT_LENGTH�Maximum content length exceededr�QUERY_STRING�&�)r&r+)�sys�stdin�hasattrr&�
isinstancer�bufferrr�int�maxlen�
ValueError�read�decode�argv�urllibr
Zparse_qs)
�fp�environ�keep_blank_values�strict_parsingr+r&�ctype�pdictZclength�qsrrrr
vsL




��utf-8�replacer0csx|d�d�}d�|�}t�}|�|�z|d|d<Wntk
rLYnXt||||ddi|d���fd	d
��D�S)a�Parse multipart input.

    Arguments:
    fp   : input file
    pdict: dictionary containing other parameters of content-type header
    encoding, errors: request encoding and error handler, passed to
        FieldStorage

    Returns a dictionary just like parse_qs(): keys are the field names, each
    value is a list of values for that field. For non-file fields, the value
    is a list of strings.
    �boundary�asciiz multipart/form-data; boundary={}zCONTENT-LENGTHzContent-Lengthr'r))�headersr&�errorsr?r+csi|]}|��|��qSr)�getlist)�.0�k�Zfsrr�
<dictcomp>�sz#parse_multipart.<locals>.<dictcomp>)r;�formatrZset_type�KeyErrorr	)r>rCr&rJr+rGrBrIrrNrr�s


�ccs�|dd�dkr�|dd�}|�d�}|dkr`|�dd|�|�dd|�dr`|�d|d�}q&|dkrpt|�}|d|�}|��V||d�}qdS)Nr1�;r�"�\"�)�find�count�len�strip)�s�end�frrr�_parseparam�s
(
r]cCs�td|�}|��}i}|D]�}|�d�}|dkr|d|�����}||dd���}t|�dkr�|d|dkr�dkr�nn |dd�}|�d	d
��dd�}|||<q||fS)zfParse a Content-type like header.

    Return the main content-type and a dictionary of options.

    rR�=rNr1rU���rSz\\�\rT)r]�__next__rVrY�lowerrXrF)�line�parts�keyrC�p�i�name�valuerrrr�s
,
c@s@eZdZdZdZdZdZdZiZdZ	iZ
iZdd�Zdd�Z
dS)rz=Like FieldStorage, for use when no file uploads are possible.NcCs||_||_dS)z&Constructor from field name and value.N�rhri��selfrhrirrr�__init__	szMiniFieldStorage.__init__cCsd|j|jfS)z Return printable representation.zMiniFieldStorage(%r, %r)rj�rlrrr�__repr__szMiniFieldStorage.__repr__)�__name__�
__module__�__qualname__�__doc__�filename�list�type�file�type_options�disposition�disposition_optionsrIrmrorrrrr�sc@s�eZdZdZdddejdddddddfdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
d:dd�Zd;dd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�ZdZd'd(�Zd)d*�Zd+Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Z dS)<r	a�Store a sequence of fields, reading multipart/form-data.

    This class provides naming, typing, files stored on disk, and
    more.  At the top level, it is accessible like a dictionary, whose
    keys are the field names.  (Note: None can occur as a field name.)
    The items are either a Python list (if there's multiple values) or
    another FieldStorage or MiniFieldStorage object.  If it's a single
    object, it has the following attributes:

    name: the field name, if specified; otherwise None

    filename: the filename, if specified; otherwise None; this is the
        client side filename, *not* the file name on which it is
        stored (that's a temporary file you don't deal with)

    value: the value as a *string*; for file uploads, this
        transparently reads the file every time you request the value
        and returns *bytes*

    file: the file(-like) object from which you can read the data *as
        bytes* ; None if the data is stored a simple string

    type: the content-type, or None if not specified

    type_options: dictionary of options specified on the content-type
        line

    disposition: content-disposition, or None if not specified

    disposition_options: dictionary of corresponding options

    headers: a dictionary(-like) object (sometimes email.message.Message or a
        subclass thereof) containing *all* headers

    The class is subclassable, mostly for the purpose of overriding
    the make_file() method, which is called internally to come up with
    a file open for reading and writing.  This makes it possible to
    override the default choice of storing all files in a temporary
    directory and unlinking them as soon as they have been opened.

    N�rrErFcCsZd}||_||_|
|_||_d|kr0|d��}d|_|dksF|dkr�d|krX|d}
ntjdd�rrtjd}
nd}
|
�t	�
�d�}
t|
�}|dkr�d	d
i}|dkr�i}|dkr�d
|d	<d|kr�|d|d	<d|kr�|d|_d
|kr�|d
|d<nt|t
tf��std��||_|dk�r*tjj|_n<t|t��r@|j|_n&t|d��rXt|d��s`td��||_||_|	|_t|t��s�tdt|�j��||_d|_||_di}}d|jk�r�t|jd�\}}||_||_ d|_!d|k�r�|d|_!d|_"d|k�r
|d|_"|j"dk	|_#d	|jk�r6t|jd	�\}}n(|j�sH|dk�rTdi}}n
d
i}}||_||_$d|k�r�|d�|j|j�|_%nd|_%d}d|jk�r�zt&|jd�}Wnt'k
�r�YnXt(�r�|t(k�r�t'd��||_)|jdk�r|dk�r||_d|_*|_+d|_,|d
k�r,|�-�n*|dd�dk�rN|�.|||�n|�/�dS)a$Constructor.  Read multipart/* until last part.

        Arguments, all optional:

        fp              : file pointer; default: sys.stdin.buffer
            (not used when the request method is GET)
            Can be :
            1. a TextIOWrapper object
            2. an object whose read() and readline() methods return bytes

        headers         : header dictionary-like object; default:
            taken from environ as per CGI spec

        outerboundary   : terminating multipart boundary
            (for internal use only)

        environ         : environment dictionary; default: os.environ

        keep_blank_values: flag indicating whether blank values in
            percent-encoded forms should be treated as blank strings.
            A true value indicates that blanks should be retained as
            blank strings.  The default false value indicates that
            blank values are to be ignored and treated as if they were
            not included.

        strict_parsing: flag indicating what to do with parsing errors.
            If false (the default), errors are silently ignored.
            If true, errors raise a ValueError exception.

        limit : used internally to read parts of multipart/form-data forms,
            to exit from the reading loop when reached. It is the difference
            between the form content-length and the number of bytes already
            read

        encoding, errors : the encoding and error handler used to decode the
            binary stream to strings. Must be the same as the charset defined
            for the page sending the form (content-type : meta http-equiv or
            header)

        max_num_fields: int. If set, then __init__ throws a ValueError
            if there are more than n fields read by parse_qsl().

        r(r'NZHEADr/r1r�surrogateescapezcontent-typer,r)r*r-�content-lengthz?headers must be mapping or an instance of email.message.Messager:�readlinezfp must be file pointerz#outerboundary must be bytes, not %srzcontent-dispositionrhrtz
text/plainrGr{r_r.�
z
multipart/)0r@rA�max_num_fieldsr+�upper�
qs_on_postr2r<�encode�localeZgetpreferredencodingrr5rr�	TypeErrorrIr3r6r>rr4r&rJ�bytesrvrp�
outerboundary�
bytes_read�limitrryrzrhrt�_binary_filerx�
innerboundaryr7r9r8�lengthrurw�done�read_urlencoded�
read_multi�read_single)rlr>rIr�r?r@rAr�r&rJr�r+�methodrDZcdisprCrBZclenrrrrm?s�/
�


�






�

zFieldStorage.__init__cCs(z|j��Wntk
r"YnXdS�N)rwr$�AttributeErrorrnrrr�__del__�szFieldStorage.__del__cCs|Sr�rrnrrr�	__enter__�szFieldStorage.__enter__cGs|j��dSr�)rwr$)rlr#rrr�__exit__�szFieldStorage.__exit__cCsd|j|j|jfS)z"Return a printable representation.zFieldStorage(%r, %r, %r))rhrtrirnrrrro�s
�zFieldStorage.__repr__cCst|���Sr�)�iter�keysrnrrr�__iter__�szFieldStorage.__iter__cCsT|dkrt|��|jr:|j�d�|j��}|j�d�n|jdk	rL|j}nd}|S)Nrir)r�rw�seekr:rurkrrr�__getattr__�s

zFieldStorage.__getattr__cCs^|jdkrtd��g}|jD]}|j|kr|�|�q|sBt|��t|�dkrV|dS|SdS)zDictionary style indexing.N�
not indexabler1r)rur�rh�appendrQrX)rlre�found�itemrrr�__getitem__s


zFieldStorage.__getitem__cCs8||kr0||}t|t�r(dd�|D�S|jSn|SdS)z8Dictionary style get() method, including 'value' lookup.cSsg|]
}|j�qSr�ri�rL�xrrr�
<listcomp>sz)FieldStorage.getvalue.<locals>.<listcomp>N�r5ruri�rlre�defaultrirrr�getvalues
zFieldStorage.getvaluecCs4||kr,||}t|t�r$|djS|jSn|SdS)z! Return the first value received.rNr�r�rrr�getfirsts

zFieldStorage.getfirstcCs:||kr2||}t|t�r(dd�|D�S|jgSngSdS)z  Return list of received values.cSsg|]
}|j�qSrr�r�rrrr�.sz(FieldStorage.getlist.<locals>.<listcomp>Nr�)rlrerirrrrK)s

zFieldStorage.getlistcCs*|jdkrtd��ttdd�|jD���S)zDictionary style keys() method.Nr�css|]}|jVqdSr��rh�rLr�rrr�	<genexpr>8sz$FieldStorage.keys.<locals>.<genexpr>)rur��setrnrrrr�4s
zFieldStorage.keyscs*|jdkrtd��t�fdd�|jD��S)z%Dictionary style __contains__ method.Nr�c3s|]}|j�kVqdSr�r�r��rerrr�>sz,FieldStorage.__contains__.<locals>.<genexpr>)rur��any)rlrerr�r�__contains__:s
zFieldStorage.__contains__cCst|���S)z Dictionary style len(x) support.)rXr�rnrrr�__len__@szFieldStorage.__len__cCs|jdkrtd��t|j�S)NzCannot be converted to bool.)rur��boolrnrrr�__bool__Ds
zFieldStorage.__bool__c	Cs�|j�|j�}t|t�s0td|jt|�jf��|�|j	|j
�}|jrT|d|j7}tj
j||j|j|j	|j
|j|jd�}dd�|D�|_|��dS)z+Internal: read data in query string format.�%s should return bytes, got %sr0�r&rJr�r+cSsg|]\}}t||��qSr�r�rLrerirrrr�Vsz0FieldStorage.read_urlencoded.<locals>.<listcomp>N)r>r:r�r5r�r9rvrpr;r&rJr�r=r
�	parse_qslr@rAr�r+ru�
skip_lines)rlrD�queryrrrr�Is&
��zFieldStorage.read_urlencodedcCsL|j}t|�std|f��g|_|jrftjj|j|j|j	|j
|j|j|j
d�}|j�dd�|D��|jpp|j}|j��}t|t�s�td|jt|�jf��|jt|�7_|��d|jkr�|r�|j��}|jt|�7_q�|j}|dk	�r|t|j�8}t�}	d}
|j��}|
|7}
|���s�q0�q|
�s:�q@|jt|
�7_|	�|
�|j
|j��|	��}d	|k�rz|d	=|jdk�r�dn
|j|j}
||j||||||
|j
|j||j
�}|dk	�r�|d
8}|j�r�|t|j�8}|dk�r�td��|j|j7_|j�|�|j �s@|j|j!k�r4dk�rnn�q@�q|�"�dS)
z/Internal: read a part that is itself multipart.z&Invalid boundary in multipart form: %rr�css|]\}}t||�VqdSr�r�r�rrrr�fsz*FieldStorage.read_multi.<locals>.<genexpr>r��--Nr{r}r1rzMax number of fields exceeded)#r��valid_boundaryr9rur�r=r
r�r@rAr&rJr�r+�extend�FieldStorageClass�	__class__r>r~r5r�rvrpr�rXrYrZfeedr;r$r�r�r�r�r�)rlr?r@rAZibr��klassZ
first_liner��parserZhdr_text�datarIr��partrrrr�[s��

��





��

(zFieldStorage.read_multicCs4|jdkr|��|��n|��|j�d�dS)zInternal: read an atomic part.rN)r��read_binaryr��
read_linesrwr�rnrrrr��s


zFieldStorage.read_singlei cCs�|��|_|j}|dkr�|dkr�|j�t||j��}t|t�sVt	d|jt
|�jf��|jt
|�7_|std|_q�|j�|�|t
|�}qdS)zInternal: read binary data.rr�r_N)�	make_filerwr�r>r:�min�bufsizer5r�r9rvrpr�rXr�r")rlZtodor�rrrr��s

�zFieldStorage.read_binarycCs@|jrt�|_|_nt�|_|_|jr4|��n|��dS)z0Internal: read lines until EOF or outerboundary.N)r�rrw�_FieldStorage__filerr��read_lines_to_outerboundary�read_lines_to_eofrnrrrr��s
zFieldStorage.read_linescCsv|jdk	rF|j��t|�dkrF|��|_|j��}|j�|�d|_|jrZ|j�|�n|j�|�|j	|j
��dS)z line is always bytes, not stringNi�)r��tellrXr�rwr�r"r�r;r&rJ)rlrcr�rrrZ__write�s


zFieldStorage.__writecCs:|j�d�}|jt|�7_|s*d|_q6|�|�qdS)zInternal: read lines until EOF.�r_N)r>r~r�rXr��_FieldStorage__write)rlrcrrrr��szFieldStorage.read_lines_to_eofc	CsJd|j}|d}d}d}d}|jdk	rFd|jkr>|krFnn�qF|j�d�}|jt|�7_|t|�7}|s~d|_�qF|dkr�||}d}|�d�r�|r�|��}||kr��qF||kr�d	|_�qF|}|�	d
�r�d
}|dd�}d}nL|�	d��rd}|dd�}d}n*|�	d��r.d}|dd�}d
}nd}d
}|�
||�qdS)z�Internal: read lines until outerboundary.
        Data is read as bytes: boundaries and line ends must be converted
        to bytes for comparisons.
        r�r{TrNr�r_�
r1s
����
F)r�r�r>r~r�rXr��
startswith�rstrip�endswithr�)	rl�
next_boundary�
last_boundaryZdelim�last_line_lfendZ_readrc�strippedlineZodelimrrrr��sN
$
z(FieldStorage.read_lines_to_outerboundarycCs�|jr|jrdSd|j}|d}d}|j�d�}|jt|�7_|sPd|_q�|�d�r�|r�|��}||krpq�||kr�d|_q�|�d�}q&dS)z5Internal: skip lines until outer boundary if defined.Nr�Tr�r_r1r�)r�r�r>r~r�rXr�rY)rlr�r�r�rcr�rrrr�s$
zFieldStorage.skip_linescCs&|jrt�d�Stjd|jdd�SdS)a�Overridable: return a readable & writable file.

        The file will be used as follows:
        - data is written to it
        - seek(0)
        - data is read from it

        The file is opened in binary mode for files, in text mode
        for other fields

        This version opens a temporary file for reading and writing,
        and immediately deletes (unlinks) it.  The trick (on Unix!) is
        that the file can still be used, but it can't be opened by
        another process, and it will automatically be deleted when it
        is closed or when the current process terminates.

        If you want a more permanent file, you derive a class which
        overrides this method.  If you want a visible temporary file
        that is nevertheless automatically deleted when the script
        terminates, try defining a __del__ method in a derived class
        which unlinks the temporary files you have created.

        zwb+zw+r!)r&�newlineN)r��tempfileZ
TemporaryFiler&rnrrrr�(s
�zFieldStorage.make_file)N)N)!rprqrrrs�osr?rmr�r�r�ror�r�r�r�r�rKr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr	sL)�
&


E	
2cCs�td�t�tjt_zNt�}t�t�t|�t|�t	�dd�}|fdd�}td�|�Wnt
�YnXtd�daz&t�}t�t�t|�t|�Wnt
�YnXd	S)
z�Robust test CGI script, usable as main program.

    Write minimal HTTP headers and dump all information provided to
    the script in HTML form.

    zContent-type: text/htmlcSstd�dS)Nz,testing print_exception() -- <I>italics?</I>)�execrrrrr\[sztest.<locals>.fcSs
|�dSr�r)r\rrr�g]sztest.<locals>.gz9<H3>What follows is a test, not an actual exception:</H3>z*<H1>Second try with a small maxlen...</H1>�2N)�printr2�stdout�stderrr	rrrrrrr8)r?�formr\r�rrrr
Js4
c	Csx|dkrt��\}}}ddl}t�td�|�||�|�||�}tdt�d�|dd���t�|d�f�~dS)Nrz+<H3>Traceback (most recent call last):</H3>z<PRE>%s<B>%s</B></PRE>rr_)	r2�exc_info�	tracebackr��	format_tb�format_exception_only�html�escape�join)rvri�tbr�r�rurrrrqs

��c	Cs\t|���}t�td�td�|D]"}tdt�|�dt�||��q&td�t�dS)z#Dump the shell environment as HTML.z<H3>Shell Environment:</H3>�<DL>�<DT>�<DD>�</DL>N)�sortedr�r�r�r�)r?r�rerrrrs cCs�t|���}t�td�|s&td�td�|D]Z}tdt�|�ddd�||}tdt�tt|���d	�td
t�t|���q2td�t�dS)
z$Dump the contents of a form as HTML.z<H3>Form Contents:</H3>z<P>No form fields.r�r��:� )r[z<i>z</i>r�r�N)r�r�r�r�r��reprrv)r�r�rerirrrr�sc
Csjt�td�zt��}Wn6tk
rP}ztdt�t|���W5d}~XYnXtt�|��t�dS)z#Dump the current directory as HTML.z#<H3>Current Working Directory:</H3>zOSError:N)r�r��getcwdrr�r��str)�pwd�msgrrrr�s&cCs(t�td�t�ttj�t�dS)Nz <H3>Command Line Arguments:</H3>)r�r2r<rrrrr�s

cCstd�dS)z9Dump a list of environment variables used by CGI as HTML.a�
<H3>These environment variables could have been set:</H3>
<UL>
<LI>AUTH_TYPE
<LI>CONTENT_LENGTH
<LI>CONTENT_TYPE
<LI>DATE_GMT
<LI>DATE_LOCAL
<LI>DOCUMENT_NAME
<LI>DOCUMENT_ROOT
<LI>DOCUMENT_URI
<LI>GATEWAY_INTERFACE
<LI>LAST_MODIFIED
<LI>PATH
<LI>PATH_INFO
<LI>PATH_TRANSLATED
<LI>QUERY_STRING
<LI>REMOTE_ADDR
<LI>REMOTE_HOST
<LI>REMOTE_IDENT
<LI>REMOTE_USER
<LI>REQUEST_METHOD
<LI>SCRIPT_NAME
<LI>SERVER_NAME
<LI>SERVER_PORT
<LI>SERVER_PROTOCOL
<LI>SERVER_ROOT
<LI>SERVER_SOFTWARE
</UL>
In addition, HTTP headers sent by the server may be passed in the
environment as well.  Here are some common variable names:
<UL>
<LI>HTTP_ACCEPT
<LI>HTTP_CONNECTION
<LI>HTTP_HOST
<LI>HTTP_PRAGMA
<LI>HTTP_REFERER
<LI>HTTP_USER_AGENT
</UL>
N)r�rrrrr�scCs(ddl}t|t�rd}nd}|�||�S)Nrs^[ -~]{0,200}[!-~]$z^[ -~]{0,200}[!-~]$)�rer5r��match)rZr�Z_vb_patternrrrr��s

r��__main__)rErFr0)NNNN),rs�__version__�iorrrZcollections.abcrr2r�Zurllib.parser=Zemail.parserrZ
email.messagerr�r�r��__all__rrr rrr%rr8r?r
rr]rrr	r
rrrrrrr�rprrrr�<module>sh�#	�
F
:'
/
__pycache__/dummy_threading.cpython-38.pyc000064400000002130151153537560014573 0ustar00U

e5d�
�	@sdZddlmZddlZdZdZdZz�dekr:edZ
dZed	ed<dekr`edZdZed=dekrzedZ	dZed=ddlZeded
<ed=eded<ed=ddlTdd
lm
Z
W5er�eed<[[er�e	ed<[	[er�e
ed<[
ned=[[[XdS)aaFaux ``threading`` version using ``dummy_thread`` instead of ``thread``.

The module ``_dummy_threading`` is added to ``sys.modules`` in order
to not have ``threading`` considered imported.  Had ``threading`` been
directly imported it would have made all subsequent imports succeed
regardless of whether ``_thread`` was available which is not desired.

�)�modulesNF�	threadingZ_threading_local�_threadT�
_dummy_thread�_dummy_threadingZ_dummy__threading_local)�*)�__all__)�__doc__�sysrZsys_modulesrZholding_threadZholding_threadingZholding__threading_localZheld_threadingZheld__threading_localZheld_threadrrr�rr�'/usr/lib64/python3.8/dummy_threading.py�<module>sP__pycache__/uu.cpython-38.opt-1.pyc000064400000007314151153537560013014 0ustar00U

��.em�@sjdZddlZddlZddlZdddgZGdd�de�Zddd�d	d�Zdd
d�Zdd�Z	e
d
krfe	�dS)z�Implementation of the UUencode and UUdecode functions.

encode(in_file, out_file [,name, mode], *, backtick=False)
decode(in_file [, out_file, mode, quiet])
�N�Error�encode�decodec@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/uu.pyr&sF��backtickc	Csjg}�zH|dkrtjj}n`t|t�rz|dkr8tj�|�}|dkrfzt�	|�j
}Wntk
rdYnXt|d�}|�
|�|dkr�tjj}nt|t�r�t|d�}|�
|�|dkr�d}|dkr�d}|�dd�}|�dd	�}|�d
|d@|f�d��|�d
�}t|�dk�r0|�tj||d��|�d
�}�q|�rB|�d�n
|�d�W5|D]}|���qTXdS)z
Uuencode file�-N�rb�wbi��
z\n�
z\rzbegin %o %s
i��ascii�-rr
s`
end
s 
end
)�close�sys�stdin�buffer�
isinstance�str�os�path�basename�stat�st_mode�AttributeError�open�append�stdout�replace�writer�read�len�binasciiZb2a_uu)�in_file�out_file�name�moder�opened_files�f�datarrr	r)sF








c

Cspg}|dkrtjj}nt|t�r4t|d�}|�|��z|��}|sLt	d��|�
d�sXq8|�dd�}t|�dkr8|ddkr8zt
|d	d
�Wq�Wq8tk
r�Yq8Xq8|dk�r:|d�d��d
�}tj�|�r�t	d|����|�
tj��s*dtj��|k�s*tj�r:|�
tj��s*dtj��|k�r:t	d|�d���|dk�rRt
|d	d
�}|dk�rftjj}n0t|t��r�t|d�}t�||�|}|�|�|��}	|	�rD|	�d�dk�rDzt�|	�}
Wnjtj	k
�r,}zH|	ddd@ddd}t�|	d|��}
|�stj�d|�W5d}~XYnX|�|
�|��}	�q�|	�sRt	d��W5|D]}|���qZXdS)zDecode uuencoded filerr
z'No valid begin line found in input filesbegin� ��r��Ns 	
rz Cannot overwrite existing file: z..zRefusing to write to z due to directory traversalrsend� �?��zWarning: %s
zTruncated input file)rrrrrrr r�readliner�
startswith�splitr%�int�
ValueError�rstriprrr�exists�sep�altsepr!�chmod�stripr&Za2b_uu�stderrr#)
r'r(r*�quietr+r,ZhdrZ	hdrfields�fp�sr-�v�nbytesrrr	rcsr





��
��




"
cCs4ddl}|jdd�}|jddddd	d
d�|jdd
ddd	d
d�|��\}}t|�dkrl|�d�t�d�tjj	}tj
j	}t|�dkr�|d}t|�dkr�|d}|jr�|jr�t
|t�r�t|d�}nttjdd�t�d�t||�nD|j�r&t
|t��rt|d�}nttjdd�t�d�t||�dS)zuuencode/uudecode main programrNz'usage: %prog [-d] [-t] [input [output]])Zusagez-dz--decoderzDecode (instead of encode)?F�
store_true)�dest�help�default�actionz-tz--text�textz2data is text, encoded format unix-compatible text?r/zincorrect number of argumentsr1rz: cannot do -t to stdoutr
z: cannot do -t from stdin)�optparseZOptionParserZ
add_option�
parse_argsr%�errorr�exitrrr!rrMrrr�print�argvr)rN�parserZoptions�args�input�outputrrr	�test�s6




rX�__main__)NN)NNF)�__doc__r&rr�__all__�	ExceptionrrrrXrrrrr	�<module>s
:
J&__pycache__/imp.cpython-38.opt-2.pyc000064400000016426151153537560013155 0ustar00U

e5d()�@s�ddlmZmZmZmZmZmZmZmZm	Z	zddlm
Z
Wnek
rTdZ
YnXddlm
Z
mZmZmZddlmZddlmZddlmZddlZddlZddlZddlZddlZddlZejded	d
�dZdZd	ZdZ d
Z!dZ"dZ#dZ$dZ%dZ&dd�Z'dd�Z(dd�Z)d7dd�Z*dd�Z+dd�Z,Gdd �d �Z-Gd!d"�d"�Z.Gd#d$�d$e.ej/�Z0d8d%d&�Z1Gd'd(�d(e.e�Z2d9d)d*�Z3d+d,�Z4d-d.�Z5d:d/d0�Z6d1d2�Z7d3d4�Z8e
�r�d;d5d6�Z9ndZ9dS)<�)	�	lock_held�acquire_lock�release_lock�get_frozen_object�is_frozen_package�init_frozen�
is_builtin�	is_frozen�_fix_co_filename)�create_dynamicN)�_ERR_MSG�_exec�_load�_builtin_from_name)�SourcelessFileLoader)�	machinery)�utilzhthe imp module is deprecated in favour of importlib; see the module's documentation for alternative uses�)�
stacklevel��������	cCs
t�|�S�N)�types�
ModuleType��name�r"�/usr/lib64/python3.8/imp.py�
new_module0sr$cCstjSr)r�MAGIC_NUMBERr"r"r"r#�	get_magic;sr&cCstjjSr)�sys�implementation�	cache_tagr"r"r"r#�get_tagCsr*c
Cs6t���$t�d�t�||�W5QR�SQRXdS)N�ignore)�warnings�catch_warnings�simplefilterr�cache_from_source)�path�debug_overrider"r"r#r/Hs

r/cCs
t�|�Sr)r�source_from_cache�r0r"r"r#r2[sr2cCs<dd�tjD�}dd�tjD�}dd�tjD�}|||S)NcSsg|]}|dtf�qS��rb)�C_EXTENSION��.0�sr"r"r#�
<listcomp>ksz get_suffixes.<locals>.<listcomp>cSsg|]}|dtf�qS)�r)�	PY_SOURCEr7r"r"r#r:lscSsg|]}|dtf�qSr4)�PY_COMPILEDr7r"r"r#r:ms)r�EXTENSION_SUFFIXES�SOURCE_SUFFIXES�BYTECODE_SUFFIXES)�
extensions�source�bytecoder"r"r#�get_suffixesisrDc@seZdZdd�Zdd�ZdS)�NullImportercCs2|dkrtddd��ntj�|�r.td|d��dS)N�zempty pathnamer3zexisting directory)�ImportError�osr0�isdir)�selfr0r"r"r#�__init__zszNullImporter.__init__cCsdSrr")rJ�fullnamer"r"r#�find_module�szNullImporter.find_moduleN)�__name__�
__module__�__qualname__rKrMr"r"r"r#rErsrEcs*eZdZd�fdd�	Z�fdd�Z�ZS)�_HackedGetDataNcst��||�||_dSr)�superrK�file)rJrLr0rS��	__class__r"r#rK�sz_HackedGetData.__init__c
s||jrl||jkrl|jjs0|j}d|jkr0|��|jjrJt|jd�|_}|�|��W5QR�SQRXnt��|�SdS)N�br5)	rSr0�closed�mode�close�open�readrR�get_data)rJr0rSrTr"r#r\�s
z_HackedGetData.get_data)N)rNrOrPrKr\�
__classcell__r"r"rTr#rQ�srQc@seZdZdS)�_LoadSourceCompatibilityN�rNrOrPr"r"r"r#r^�sr^cCs\t|||�}tj|||d�}|tjkr8t|tj|�}nt|�}t�||�|_	|j	|j
_|S�N)�loader)r^r�spec_from_file_locationr'�modulesr
rr�SourceFileLoader�
__loader__�__spec__ra�r!�pathnamerSra�spec�moduler"r"r#�load_source�s

rkc@seZdZdS)�_LoadCompiledCompatibilityNr_r"r"r"r#rl�srlcCsZt|||�}tj|||d�}|tjkr8t|tj|�}nt|�}t||�|_|j|j	_
|Sr`)rlrrbr'rcr
rrrerfrargr"r"r#�
load_compiled�s

rmcCs�tj�|�rftjdd�tjdd�}|D]*}tj�|d|�}tj�|�r,|}qfq,td�	|���t
j||gd�}|tj
kr�t|tj
|�St|�SdS)NrKz{!r} is not a package)�submodule_search_locations)rHr0rIrr?r@�join�exists�
ValueError�formatrrbr'rcr
r)r!r0rA�	extensionZ	init_pathrir"r"r#�load_package�s ��
rtc	
Cs$|\}}}|r0|�d�r d|kr0td�|���n�|dkrX|tthkrXd�|�}t|��n�|tkrlt|||�S|tkr�t|||�S|tkr�tdk	r�|dkr�t	|d��}t|||�W5QR�SQRXnt|||�SnN|t
kr�t||�S|tk�r�t
|�S|tk�rt|�Sd�||�}t||d��dS)N)r;�U�+zinvalid file open mode {!r}z.file object required for import (type code {})r5z*Don't know how to import {} (type code {})r )�
startswithrqrrr<r=rkrmr6�load_dynamicrZ�
PKG_DIRECTORYrt�	C_BUILTIN�init_builtin�	PY_FROZENrrG)	r!rS�filenameZdetails�suffixrX�type_�msgZopened_filer"r"r#�load_module�s.


 


r�c	Cs�t|t�std�t|����n$t|td�tf�sBtd�t|����|dkr�t|�rbddddtffSt	|�rzddddt
ffStj}|D]�}t
j�||�}dtjdfD]>}d|}t
j�||�}t
j�|�r�d|ddtffSq�t�D]2\}}}||}	t
j�||	�}t
j�|�r��q q�q��q:q�tt�|�|d��d}
d|k�rnt|d	��}t�|j�d}
W5QRXt|||
d
�}|||||ffS)Nz'name' must be a str, not {}z%'path' must be None or a list, not {}rFz.pyrrKr rVr5)�encoding)�
isinstance�str�	TypeErrorrr�type�list�RuntimeErrorrrzr	r|r'r0rHrorr@�isfileryrDrGrrZ�tokenize�detect_encoding�readline)r!r0�entryZpackage_directoryr~Zpackage_file_nameZ	file_pathrXr�	file_namer�rSr"r"r#rM�sB
�
rMcCs
t�|�Sr)�	importlib�reload)rjr"r"r#r�2sr�cCs&z
t|�WStk
r YdSXdSr)rrGr r"r"r#r{=s
r{cCs0ddl}|j�||�}|jj|||d�}t|�S)Nr)r!ra�origin)�importlib.machineryr�ExtensionFileLoader�
ModuleSpecr)r!r0rSr�rarir"r"r#rxJs�rx)N)N)N)N)N):�_imprrrrrrrr	r
rrGZimportlib._bootstraprr
rrZimportlib._bootstrap_externalrr�rrrHr'r�rr,�warn�DeprecationWarningZSEARCH_ERRORr<r=r6ZPY_RESOURCEryrzr|ZPY_CODERESOURCEZIMP_HOOKr$r&r*r/r2rDrErQrdr^rkrlrmrtr�rMr�r{rxr"r"r"r#�<module>	s`,
�
	

#
4__pycache__/subprocess.cpython-38.opt-2.pyc000064400000072746151153537560014567 0ustar00U

e5d�1�@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddlm
Zddddddd	d
ddd
dddgZzddl
Z
ddlZdZWn0ek
r�dZddlZddlZddlZYn�XddlmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%e�&ddddddddddddd d!d"d#d$d%d&g�Gd'd�de'�Z(Gd(d�de(�Z)Gd)d�de(�Z*e�r�Gd*d�d�Z+Gd+d,�d,e,�Z-n&e.ed-d.�Z/e0ed/��r�ej1Z2nej3Z2e�r�dZ4d0d1�Z5ngZ4d2d1�Z5d3Z6d4Z7d5Z8d6d7�Z9d8d9�Z:dd:�d;d�Z;d<d�Z<dd:�d=d
�Z=Gd>d�de>�Z?ddddd?�d@d�Z@dAdB�ZAdCd�ZBdDd	�ZCdEdF�ZDeD�ZEGdGd�de>�ZFdS)H�N)�	monotonic�Popen�PIPE�STDOUT�call�
check_call�getstatusoutput�	getoutput�check_output�run�CalledProcessError�DEVNULL�SubprocessError�TimeoutExpired�CompletedProcessTF)�CREATE_NEW_CONSOLE�CREATE_NEW_PROCESS_GROUP�STD_INPUT_HANDLE�STD_OUTPUT_HANDLE�STD_ERROR_HANDLE�SW_HIDE�STARTF_USESTDHANDLES�STARTF_USESHOWWINDOW�ABOVE_NORMAL_PRIORITY_CLASS�BELOW_NORMAL_PRIORITY_CLASS�HIGH_PRIORITY_CLASS�IDLE_PRIORITY_CLASS�NORMAL_PRIORITY_CLASS�REALTIME_PRIORITY_CLASS�CREATE_NO_WINDOW�DETACHED_PROCESS�CREATE_DEFAULT_ERROR_MODE�CREATE_BREAKAWAY_FROM_JOBrrrrrrrr�STARTUPINFOrrrrrrrr r!r"c@seZdZdS)rN)�__name__�
__module__�__qualname__�r'r'�"/usr/lib64/python3.8/subprocess.pyr`sc@s8eZdZd	dd�Zdd�Zedd��Zejdd��ZdS)
rNcCs||_||_||_||_dS�N)�
returncode�cmd�output�stderr)�selfr*r+r,r-r'r'r(�__init__jszCalledProcessError.__init__cCsh|jrT|jdkrTzd|jt�|j�fWStk
rPd|j|jfYSXnd|j|jfSdS)NrzCommand '%s' died with %r.z)Command '%s' died with unknown signal %d.z.Command '%s' returned non-zero exit status %d.)r*r+�signalZSignals�
ValueError�r.r'r'r(�__str__ps���zCalledProcessError.__str__cCs|jSr)�r,r2r'r'r(�stdout|szCalledProcessError.stdoutcCs
||_dSr)r4�r.�valuer'r'r(r5�s)NN�r$r%r&r/r3�propertyr5�setterr'r'r'r(rcs

c@s8eZdZd	dd�Zdd�Zedd��Zejdd��ZdS)
rNcCs||_||_||_||_dSr))r+�timeoutr,r-)r.r+r;r,r-r'r'r(r/�szTimeoutExpired.__init__cCsd|j|jfS)Nz'Command '%s' timed out after %s seconds)r+r;r2r'r'r(r3�s
�zTimeoutExpired.__str__cCs|jSr)r4r2r'r'r(r5�szTimeoutExpired.stdoutcCs
||_dSr)r4r6r'r'r(r5�s)NNr8r'r'r'r(r�s

c@s,eZdZddddddd�dd�Zdd�ZdS)r#rN��dwFlags�	hStdInput�
hStdOutput�	hStdError�wShowWindow�lpAttributeListcCs0||_||_||_||_||_|p(dgi|_dS)N�handle_listr<)r.r=r>r?r@rArBr'r'r(r/�szSTARTUPINFO.__init__cCs@|j��}d|kr"t|d�|d<t|j|j|j|j|j|d�S)NrCr<)	rB�copy�listr#r=r>r?r@rA)r.Z	attr_listr'r'r(rD�s
�zSTARTUPINFO.copy)r$r%r&r/rDr'r'r'r(r#�s�	c@s2eZdZdZejfdd�Zdd�Zdd�ZeZ	dS)	�HandleFcCs|jsd|_||�dS)NT)�closed)r.�CloseHandler'r'r(�Close�szHandle.ClosecCs |jsd|_t|�Std��dS)NTzalready closed)rG�intr1r2r'r'r(�Detach�sz
Handle.DetachcCsd|jjt|�fS)Nz%s(%d))�	__class__r$rJr2r'r'r(�__repr__�szHandle.__repr__N)
r$r%r&rG�_winapirHrIrKrM�__del__r'r'r'r(rF�s
rFZPIPE_BUFi�PollSelectorcCsdSr)r'r'r'r'r(�_cleanup�srQc	Cs\tdkrdStdd�D]>}|jtjd�}|dk	rzt�|�Wqtk
rTYqXqdS)N��
_deadstate)�_active�_internal_poll�sys�maxsize�remover1)�inst�resr'r'r(rQ�s���������cCs*g}tjj}|dkr&|�dd|�|S)Nr�-�O)rV�flags�optimize�append)�argsr7r'r'r(�"_optim_args_from_interpreter_flagss
rdcCsVddddddd�}t�}|��D].\}}ttj|�}|dkr |�d	||�q tjjrd|�d
�n$tjjrv|�d�tjjr�|�d�tj	dd�}tjj
}ttd
i�}d|k}|dkr�|�d�n|r�|�d�|r�|�d�|D]}|�d|�q�|�r
|�d�dD]B}||k�r||}	|	dk�r4|}
nd||	f}
|�d|
f��q|S)N�d�B�S�v�b�q)�debug�dont_write_bytecode�no_site�verbose�
bytes_warning�quietrr^z-Iz-Ez-s�	_xoptions�dev�zerror::BytesWarningzdefault::BytesWarning�defaultz-W)�-Xrr)Zfaulthandler�tracemallocZ
importtimeZshowalloccountZshowrefcount�utf8Tz%s=%sru)
rd�items�getattrrVr`rb�isolated�ignore_environment�no_user_site�warnoptionsrorX�extend)Zflag_opt_maprc�flag�optrhZwarnoptsroZxoptions�dev_moder7�argr'r'r(�_args_from_interpreter_flagssP�






r��r;c
OsLt||��8}z|j|d�WW5QR�S|���YnXW5QRXdS)Nr�)r�wait�kill)r;�	popenargs�kwargs�pr'r'r(rLscOs6t||�}|r2|�d�}|dkr(|d}t||��dS)Nrcr)r�getr)r�r��retcoder+r'r'r(r]s



cOsbd|krtd��d|krJ|ddkrJ|�d�s8|�d�r>d}nd}||d<t|t|dd	�|��jS)
Nr5z3stdout argument not allowed, it will be overridden.�input�universal_newlines�text��T)r5r;�check)r1r�rrr5)r;r�r��emptyr'r'r(r
ps#�c@s&eZdZddd�Zdd�Zdd�ZdS)	rNcCs||_||_||_||_dSr))rcr*r5r-)r.rcr*r5r-r'r'r(r/�szCompletedProcess.__init__cCshd�|j�d�|j�g}|jdk	r4|�d�|j��|jdk	rP|�d�|j��d�t|�jd�|��S)Nz	args={!r}zreturncode={!r}zstdout={!r}zstderr={!r}z{}({})z, )	�formatrcr*r5rbr-�typer$�join)r.rcr'r'r(rM�s

�

zCompletedProcess.__repr__cCs |jrt|j|j|j|j��dSr))r*rrcr5r-r2r'r'r(�check_returncode�s�z!CompletedProcess.check_returncode)NN)r$r%r&r/rMr�r'r'r'r(r�s
	)r��capture_outputr;r�cOs |dk	r&|�d�dk	rtd��t|d<|r^|�d�dk	sF|�d�dk	rNtd��t|d<t|d<t||���}z|j||d�\}}Wn^tk
r�}	z,|��tr�|��\|	_|	_	n|�
��W5d}	~	XYn|���YnX|��}
|�r|
�rt|
|j
||d��W5QRXt|j
|
||�S)N�stdinz/stdin and input arguments may not both be used.r5r-z@stdout and stderr arguments may not be used with capture_output.r��r,r-)r�r1rr�communicaterr��
_mswindowsr5r-r��pollrrcr)r�r�r;r�r�r�Zprocessr5r-�excr�r'r'r(r�s8�cCs�g}d}ttj|�D]�}g}|r*|�d�d|kp>d|kp>|}|rN|�d�|D]b}|dkrj|�|�qR|dkr�|�dt|�d�g}|�d�qR|r�|�|�g}|�|�qR|r�|�|�|r|�|�|�d�qd�|�S)	NF� �	�"�\�z\"r�)�map�os�fsdecoderb�lenr~r�)�seq�resultZ	needquoter�Zbs_buf�cr'r'r(�list2cmdline	s4




r�c
Cslzt|ddtd�}d}Wn.tk
rF}z|j}|j}W5d}~XYnX|dd�dkrd|dd�}||fS)NT)�shellr�r-rr[�
)r
rrr,r*)r+�dataZexitcodeZexr'r'r(rRscCst|�dS�Nrs)r)r+r'r'r(r	qs
c
Cs�tsttd�sdStjdkr dSzjt�d�}|jdd�}t|�dkrHt�|d	}t	t
t|d�d
���}tjdkr�|dkr�|d
kr�WdSWnttt
fk
r�YnXdS)N�posix_spawnF�darwinT�CS_GNU_LIBC_VERSIONrs)�maxsplitr�r�.ZlinuxZglibc)r��)r��hasattrr�rV�platform�confstr�splitr�r1�tupler�rJ�AttributeError�OSError)Zver�partsZlibc�versionr'r'r(�_use_posix_spawn~s 



r�c@s�eZdZdZdJdddd�dd	�Zed
d��Zejdd��Zd
d�Zdd�Z	dd�Z
eje
jfdd�Zdd�Zdd�ZdKdd�Zdd�Zdd�ZdLdd �ZdMd!d"�Zd#d$�Ze�rd%d&�Zd'd(�Zd)d*�Zd+d,�Zdejejej fd-d.�Z!d/d0�Z"d1d2�Z#d3d4�Z$d5d6�Z%d7d8�Z&e&Z'n�d9d&�Zd:d;�Z(d<d,�Ze)j*e)j+e)j,e)j-e)j.e)j/fd=d>�Z0de)j1e)j2e3j4fd?d.�Z!d@dA�Z5dBd0�Z"dCd4�Z$dDdE�Z6dFd6�Z%dGd8�Z&dHdI�Z'dS)NrFr[NTrr')�encoding�errorsr�cCslt�t��|_d|_d|_|dkr(d}t|t�s:td��t	rP|dk	r�t
d��n8|rh|sht�dt
�d}|
dk	rxt
d��|dkr�t
d	��||_d|_d|_d|_d|_d|_||_||_|dk	r�|dk	r�t|�t|�kr�td
��|�|||�\}}}}}}t	�rN|dk�rt�|��d�}|dk�r4t�|��d�}|dk�rNt�|��d�}|�pb|�pb|�pb||_d|_d|_|j�r�|dk�r�d}d}nd}z�|dk�r�t� |d
|�|_|j�r�tj!|jd|||d�|_|dk�rt� |d|�|_|j�rtj!|j||d�|_|dk�r:t� |d|�|_|j�r:tj!|j||d�|_|�"||||||
||
||	||||||||�Wn�t#d|j|j|jf�D]*}z|�$�Wnt%k
�r�YnX�q�|j�s`g}|t&k�r�|�'|�|t&k�r�|�'|�|t&k�r�|�'|�t(|d��r|�'|j)�|D]H}z*t	�r8t|t*��r8|�+�n
t,�$|�Wnt%k
�rZYnX�q�YnXdS)NFr[zbufsize must be an integerz0preexec_fn is not supported on Windows platformszpass_fds overriding close_fds.Tz2startupinfo is only supported on Windows platformsrz4creationflags is only supported on Windows platformszlCannot disambiguate when both text and universal_newlines are supplied but different. Pass one or the other.g�?rs�wb)�
write_through�line_bufferingr�r��rb)r�r��_devnull)-rQ�	threadingZLock�
_waitpid_lock�_input�_communication_started�
isinstancerJ�	TypeErrorr�r1�warnings�warn�RuntimeWarningrcr�r5r-�pidr*r�r��boolr�_get_handles�msvcrtZopen_osfhandlerK�	text_mode�_sigint_wait_secs�_closed_child_pipe_fds�io�open�
TextIOWrapper�_execute_child�filter�closer�rrbr�r�rFrIr�)r.rc�bufsize�
executabler�r5r-�
preexec_fn�	close_fdsr��cwd�envr��startupinfo�
creationflags�restore_signals�start_new_session�pass_fdsr�r�r��p2cread�p2cwrite�c2pread�c2pwrite�errread�errwriter��fZto_close�fdr'r'r(r/�s�


��





�
�
��








zPopen.__init__cCs|jSr))r�r2r'r'r(r�~szPopen.universal_newlinescCst|�|_dSr))r�r�)r.r�r'r'r(r��scCs |�||�}|�dd��dd�S)Nz
r��
)�decode�replace)r.r�r�r�r'r'r(�_translate_newlines�szPopen._translate_newlinescCs|Sr)r'r2r'r'r(�	__enter__�szPopen.__enter__cCs�|jr|j��|jr |j��dz|jr4|j��W5|tkr�|jdkrrz|j|jd�Wntk
rpYnXd|_�dS|��XdS)Nrr�)	r5r�r-�KeyboardInterruptr��_waitrr�r�)r.�exc_typer7�	tracebackr'r'r(�__exit__�s 


zPopen.__exit__cCsT|js
dS|jdkr(|d|jt|d�|j|d�|jdkrPtdk	rPt�|�dS)Nzsubprocess %s is still running)�sourcerR)�_child_createdr*r��ResourceWarningrUrTrb)r.Z_maxsizeZ_warnr'r'r(rO�s

�z
Popen.__del__cCs"t|d�st�tjtj�|_|jS)Nr�)r�r�r��devnull�O_RDWRr�r2r'r'r(�_get_devnull�s
zPopen._get_devnullc
Cs�|rZz|j�|�WnDtk
r(Yn2tk
rX}z|jtjkrFn�W5d}~XYnXz|j��WnDtk
r|Yn2tk
r�}z|jtjkr�n�W5d}~XYnXdSr))r��write�BrokenPipeErrorr��errnoZEINVALr�)r.r�r�r'r'r(�_stdin_write�s"zPopen._stdin_writecCsT|jr|rtd��|dkr�|js�|j|j|jg�d�dkr�d}d}|jrT|�|�n6|jrp|j��}|j��n|jr�|j��}|j��|�	�n�|dk	r�t
�|}nd}z�z|�|||�\}}Wnhtk
�r,|dk	r�t
|j|�|��}n|j}d|_z|j|d�Wntk
�r$YnX�YnXW5d|_X|j	|�|�d�}||fS)Nz.Cannot send input after starting communicationr�Trr�)r�r1r�r5r-�countr�readr�r��_time�_communicater��minr��_remaining_timer�r)r.r�r;r5r-�endtime�sigint_timeout�stsr'r'r(r��sH
�



�zPopen.communicatecCs|��Sr))rUr2r'r'r(r�sz
Popen.pollcCs|dkrdS|t�SdSr))r)r.r	r'r'r(r"szPopen._remaining_timecCsL|dkrdS|st�|krHt|j||r0d�|�nd|r@d�|�ndd��dS)Nr�r�)rrrcr�)r.r	�orig_timeoutZ
stdout_seqZ
stderr_seq�skip_check_and_raiser'r'r(�_check_timeout*s�zPopen._check_timeoutcCs�|dk	rt�|}z|j|d�WStk
r�|dk	rLt|j|�|��}n|j}d|_z|j|d�Wntk
r|YnX�YnXdS)Nr�r)rr�r�rr�rr)r.r;r	r
r'r'r(r�6s 
�z
Popen.waitc		Cs�t|dd�}t����}trX|dkr.|�|j�|dkrB|�|j�|dkr�|�|j�nr|dkr~|dkr~||kr~|�tj|�|dkr�|dkr�||kr�|�tj|�|dkr�|dkr�||kr�|�tj|�|dk	r�|�tj|�W5QRXd|_dS)Nr�r[T)	ry�
contextlib�	ExitStackr��callbackrIr�r�r�)	r.r�r�r�r�r�r�Z
devnull_fd�stackr'r'r(�_close_pipe_fdsMs$
zPopen._close_pipe_fdscCs~|dkr|dkr|dkrdSd\}}d\}}d\}}	|dkrtt�tj�}|dkr�t�dd�\}}
t|�}t�|
�nh|tkr�t�dd�\}}t|�t|�}}n<|tkr�t�	|�
��}n$t|t�r�t�	|�}nt�	|�
��}|�|�}|dk�r*t�tj�}|dk�r�t�dd�\}
}t|�}t�|
�nn|tk�rXt�dd�\}}t|�t|�}}n@|tk�rrt�	|�
��}n&t|t��r�t�	|�}nt�	|�
��}|�|�}|dk�r�t�tj�}	|	dk�rdt�dd�\}
}	t|	�}	t�|
�n~|tk�rt�dd�\}}	t|�t|	�}}	nP|tk�r$|}	n@|tk�r>t�	|�
��}	n&t|t��rVt�	|�}	nt�	|�
��}	|�|	�}	||||||	fS)N)r[r[r[r[r[r[�r[r[r)rNZGetStdHandlerZ
CreatePiperFrHrr
r�Z
get_osfhandler�r�rJ�fileno�_make_inheritablerrr)r.r�r5r-r�r�r�r�r�r��_r'r'r(r�nst












�zPopen._get_handlescCs&t�t��|t��ddtj�}t|�S)Nrrs)rNZDuplicateHandleZGetCurrentProcessZDUPLICATE_SAME_ACCESSrF)r.�handle�hr'r'r(r�s�zPopen._make_inheritablecCstdd�|D��S)NcSs,h|]$}|d@dks$t�|�tjkr|�qS)�)rNZGetFileTypeZFILE_TYPE_CHAR)�.0rr'r'r(�	<setcomp>�s��z,Popen._filter_handle_list.<locals>.<setcomp>)rE)r.rCr'r'r(�_filter_handle_list�szPopen._filter_handle_listcCszt|t�rnNt|t�r.|
r"td��t|g�}n,t|tj�rR|
rFtd��t|g�}nt|�}|dk	rlt�|�}|dkr|t�}n|�	�}d|||fk}|r�|j
tjO_
||_
||_||_|j}t|o�d|ko�|d�}|s�|�r^|�r^|dkr�i}|_t|�dg��}|d<|�r0|t|�t|�t|�g7}|�|�|dd�<|�r^|�sZt�dt�d}|
�r�|j
tjO_
tj|_|�s�tj�d�}|�s�tj�dd	�}tj�|d
d�}tj�|��s�t d��tj�|��r�|}n|}d
�!||�}|dk	�rt�|�}t"�#d||||�z,t�%||ddt|�|	|||�	\}}}}W5|�$|||
|||�Xd|_&t'|�|_(||_)t�*|�dS)Nz$bytes args is not allowed on Windows�0path-like args is not allowed when shell is truer[rCz?startupinfo.lpAttributeList['handle_list'] overriding close_fdsFZComSpecZ
SystemRootr�ZSystem32zcmd.exez:shell not found: neither %ComSpec% nor %SystemRoot% is setz
{} /c "{}"�subprocess.PopenT)+r��str�bytesr�r�r��PathLiker�r#rDr=rNrr>r?r@rBr�rEr�rJrr�r�r�rrrA�environ�pathr��isabs�FileNotFoundErrorr�rV�auditrZ
CreateProcessr�rF�_handler�rH)r.rcr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�Zunused_restore_signalsZunused_start_new_sessionZuse_std_handlesZattribute_listZhave_handle_listrCZcomspecZsystem_rootZhpZhtr��tidr'r'r(r��s�


��
�
�

��
zPopen._execute_childcCs,|jdkr&||jd�|kr&||j�|_|jS�Nr)r*r()r.rSZ_WaitForSingleObjectZ_WAIT_OBJECT_0Z_GetExitCodeProcessr'r'r(rUHs
zPopen._internal_pollcCs^|dkrtj}nt|d�}|jdkrXt�|j|�}|tjkrJt|j|��t�	|j�|_|jS)Ni�)
rNZINFINITErJr*�WaitForSingleObjectr(ZWAIT_TIMEOUTrrc�GetExitCodeProcess)r.r;Ztimeout_millisr�r'r'r(r�Ys
�
zPopen._waitcCs|�|���|��dSr))rbrr�)r.Zfh�bufferr'r'r(�
_readerthreadiszPopen._readerthreadcCs\|jrBt|d�sBg|_tj|j|j|jfd�|_d|j_|j��|j	r�t|d�s�g|_
tj|j|j	|j
fd�|_d|j_|j��|jr�|�
|�|jdk	r�|j�|�|��|j��r�t|j|��|j	dk	r�|j�|�|��|j��r�t|j|��d}d}|j�r|j}|j��|j	�r0|j
}|j	��|�r>|dnd}|�rP|dnd}||fS)N�_stdout_buff)�targetrcT�_stderr_buffr)r5r�r/r�ZThreadr.Z
stdout_threadZdaemon�startr-r1Z
stderr_threadr�rr�rZis_aliverrcr�)r.r�r	rr5r-r'r'r(rnsJ
��

��







zPopen._communicatecCsl|jdk	rdS|tjkr"|��nF|tjkr>t�|jtj�n*|tjkrZt�|jtj�nt	d�
|���dS)NzUnsupported signal: {})r*r0�SIGTERM�	terminateZCTRL_C_EVENTr�r�r�ZCTRL_BREAK_EVENTr1r��r.Zsigr'r'r(�send_signal�s




zPopen.send_signalcCsX|jdk	rdSzt�|jd�Wn2tk
rRt�|j�}|tjkrH�||_YnXdSr�)r*rNZTerminateProcessr(�PermissionErrorr,ZSTILL_ACTIVE)r.Zrcr'r'r(r4�s

zPopen.terminatec
Cs,d\}}d\}}d\}}	|dkr"n@|tkr8t��\}}n*|tkrJ|��}nt|t�rZ|}n|��}|dkrln@|tkr�t��\}}n*|tkr�|��}nt|t�r�|}n|��}|dkr�nf|tkr�t��\}}	nP|tkr�|dkr�|}	n
t	j
��}	n.|tk�r|��}	nt|t��r|}	n|��}	||||||	fS)Nrr[)rr��piper
r�r�rJrrrV�
__stdout__)
r.r�r5r-r�r�r�r�r�r�r'r'r(r��sP





�cCs�|dkrtj}i}|rJg}dD]"}
tt|
d�}|dk	r|�|�q||d<g}|||	fD]}|dkrX|�tj|f�qX|df|df|
dffD]"\}}|dkr�|�tj||f�q�|r�||d<tj|||f|�|_d|_	|�
|||||	|
�dS)	N)�SIGPIPEZSIGXFZ�SIGXFSZZ	setsigdefr[rrsr��file_actionsT)r�r#ryr0rb�POSIX_SPAWN_CLOSE�POSIX_SPAWN_DUP2r�r�r�r)r.rcr�r�r�r�r�r�r�r�r�r�ZsigsetZsignameZsignumr<r�Zfd2r'r'r(�_posix_spawn�s<��zPopen._posix_spawnc)s�t|ttf�r|g}n(t|tj�r6|
r.td��|g}nt|�}|
rlttd�rPdnd}|dg|}�rl�|d<�dkr||d�t�	d�|||�t
�rtj����r|dk�r|�s|�s|dk�r|dks�|d	k�r|dks�|d	k�r|dks�|d	k�r|�s|�
|�|||||
|||�
dS�}t��\}}g}|d
k�rT|�|�t�|�}�q2|D]}t�|��qX�zJz�|dk	�r�g}|��D]>\}}t�|�}d|k�r�td��|�|dt�|���q�nd}t����tj����r�f}nt�fd
d�t�|�D��}t|�}|�|�t�|||tttt|���|||||
||||||||�|_d|_W5t�|�X|� |||
|||�t!�}t�"|d�}||7}|�r�t#|�dk�r��q��q�W5t�|�X|�r�z6t�$|jd�\} }!| |jk�r�|�%|!�ntj&|_'Wnt(k
�rYnXz|�)dd	�\}"}#}$|$�*�}$Wn,tk
�rbd}"d}#d�+t|��}$YnXt,t-|"�*d�t.�}%t/|%t0��r�|#�r�t|#d�}&|$dk}'|'�r�d}$|}(n|}(|&dk�r�t�1|&�}$|%|&|$|(��|%|$��dS)NrZgetandroidapilevelz/system/bin/shz/bin/shz-crrr[r�r�=z!illegal environment variable namec3s"|]}tj�t�|���VqdSr))r�r$r��fsencode)r�dir�r�r'r(�	<genexpr>rs�z'Popen._execute_child.<locals>.<genexpr>TiP��:sSubprocessError�0z#Bad exception data from child: {!r}�ascii�Znoexecr�)2r�r r!r�r"r�rEr�rVr'�_USE_POSIX_SPAWNr$�dirnamer?r8rb�dupr�rxrAr1r��
get_exec_path�set�add�_posixsubprocessZ	fork_exec�sortedr�rJr�r�r�	bytearrayrr��waitpid�_handle_exitstatusrWr*�ChildProcessErrorr�r�r�ry�builtinsr�
issubclassr��strerror))r.rcr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�Z
unix_shellZorig_executableZerrpipe_readZ
errpipe_writeZlow_fds_to_closeZlow_fdZenv_list�krhZexecutable_listZfds_to_keepZerrpipe_data�partr�rZexception_nameZ	hex_errno�err_msgZchild_exception_typeZ	errno_numZchild_exec_never_calledZerr_filenamer'rCr(r� s"	��
�����������	�
�





�
�
�
��
�


cCsL||�r||�|_n2||�r*||�|_n||�r@||�|_ntd��dS)NzUnknown child exit status!)r*r)r.rZ_WIFSIGNALEDZ	_WTERMSIGZ
_WIFEXITEDZ_WEXITSTATUSZ_WIFSTOPPEDZ	_WSTOPSIGr'r'r(rS�szPopen._handle_exitstatusc
Cs�|jdkr�|j�d�sdSz�z>|jdk	r4|jWW�pS||j|�\}}||jkrX|�|�WnBtk
r�}z$|dk	r|||_n|j|kr�d|_W5d}~XYnXW5|j��X|jS)NFr)r*r��acquire�releaser�rSr�r)r.rSZ_waitpidZ_WNOHANGZ_ECHILDr�r�er'r'r(rU�s 	



cCs>zt�|j|�\}}Wntk
r4|j}d}YnX||fSr*)r�rRr�rT)r.Z
wait_flagsr�rr'r'r(�	_try_wait�s
zPopen._try_waitc	Cs|jdk	r|jS|dk	r�t�|}d}|j�d�r~z>|jdk	rDW�0q�|�tj�\}}||jkrn|�	|�W�q�W5|j��X|�
|�}|dkr�t|j|��t
|d|d�}t�|�q&n\|jdk�r|j�B|jdk	r�W5QR��q|�d�\}}||jk�r
|�	|�W5QRXq�|jS)Ng����Mb@?Frr�g�������?)r*rr�r[r\r^r��WNOHANGr�rSrrrcr�time�sleep)r.r;r	Zdelayr�rZ	remainingr'r'r(r��s6







c
Cs"|jrX|jsXz|j��Wntk
r.YnX|sXz|j��Wntk
rVYnXd}d}|js�i|_|jr~g|j|j<|jr�g|j|j<|jr�|j|j}|jr�|j|j}|�|�|j	r�t
|j	�}t����}|jr�|r�|�|jt
j�|j�r|jj�s|�|jt
j�|j�r6|jj�s6|�|jt
j�|���r�|�|�}|dk	�rz|dk�rz|j||||dd�td��|�|�}	|�||||�|	D]�\}
}|
j|jk�r6||j|jt�}z|jt�|
j|�7_Wn,tk
�r
|�|
j�|
j��Yn*X|jt|j	�k�r�|�|
j�|
j��nP|
j|j|jfk�r�t�|
jd�}
|
�st|�|
j�|
j��|j|
j�|
��q��q6W5QRX|j |�|�d�|dk	�r�d�!|�}|dk	�r�d�!|�}|j"�r|dk	�r�|�#||jj$|jj%�}|dk	�r|�#||jj$|jj%�}||fS)NrT)r
zN_check_timeout(..., skip_check_and_raise=True) failed to raise TimeoutExpired.i�r�r�)&r�r��flushrr�Z_fileobj2outputr5r-�_save_inputr��
memoryview�_PopenSelector�register�	selectorsZEVENT_WRITErGZ
EVENT_READZget_maprr�RuntimeError�selectZfileobj�
_input_offset�	_PIPE_BUFr�r�r�Z
unregisterr�rrbr�r�r�r�r�r�)r.r�r	rr5r-Z
input_viewZselectorr;Zready�keyZevents�chunkr�r'r'r(r's�





��
�
$




�
�cCsF|jrB|jdkrBd|_||_|dk	rB|jrB|j�|jj|jj�|_dSr*)r�r�rjr��encoder�r�)r.r�r'r'r(rc�s�zPopen._save_inputcCs|jdkrt�|j|�dSr))r*r�r�r�r5r'r'r(r6�s
cCs|�tj�dSr))r6r0r3r2r'r'r(r4�scCs|�tj�dSr))r6r0�SIGKILLr2r'r'r(r��sz
Popen.kill)r[NNNNNTFNNNNrTFr')NN)F)N)7r$r%r&r�r/r9r�r:r�r�r�rVrWr�r�rOr�rr�r�rrr�rr�r�rrr�rNr+Z
WAIT_OBJECT_0r,rUr�r.rr6r4r�r?r��WIFSIGNALED�WTERMSIG�	WIFEXITED�WEXITSTATUS�
WIFSTOPPED�WSTOPSIGrSrRr_rZECHILDr^rcr'r'r'r(r�s�.��


D	�

H	
|�
26'�
�
#
)f)GrUrr�r�r`r0rVr�r�rrr�__all__r�rNr��ModuleNotFoundErrorrOrirgrrrrrrrrrrrrrrrr r!r"r~�	Exceptionrrrr#rJrFryrkr�rPreZSelectSelectorrTrQrrr
rdr�rrr
�objectrrr�rr	r�rIrr'r'r'r(�<module>,s��P
�
%	


;3"�EI
/__pycache__/tracemalloc.cpython-38.pyc000064400000041725151153537560013716 0ustar00U

e5d�B�@sddlmZmZddlmZddlZddlZddlZddl	Z	ddl
Tddl
mZmZdd�Z
Gdd	�d	�ZGd
d�d�Zdd
�ZeGdd�d��ZeGdd�de��Zdd�ZGdd�d�ZGdd�de�Zdd�ZGdd�d�ZGdd�de�ZGdd�de�ZGd d!�d!�Zd"d#�ZdS)$�)�Sequence�Iterable)�total_orderingN)�*)�_get_object_traceback�_get_tracescCs�dD]|}t|�dkr@|dkr@|r0d||fSd||fSt|�dksT|dkrx|rhd||fSd	||fS|d
}qdS)N)�BZKiBZMiBZGiB�TiB�drz%+.1f %sz%.1f %si(r	z%+.0f %sz%.0f %si)�abs)�sizeZsignZunit�r
�#/usr/lib64/python3.8/tracemalloc.py�_format_size
src@sDeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dS)�	StatisticzS
    Statistic difference on memory allocations between two Snapshot instance.
    ��	tracebackr�countcCs||_||_||_dS�Nr)�selfrrrr
r
r�__init__%szStatistic.__init__cCst|j|j|jf�Sr)�hashrrr�rr
r
r�__hash__*szStatistic.__hash__cCs$|j|jko"|j|jko"|j|jkSrr�r�otherr
r
r�__eq__-s

�
�zStatistic.__eq__cCsBd|jt|jd�|jf}|jr>|j|j}|dt|d�7}|S)Nz%s: size=%s, count=%iF�, average=%s)rrrr�r�textZaverager
r
r�__str__2s
��zStatistic.__str__cCsd|j|j|jfS)Nz)<Statistic traceback=%r size=%i count=%i>rrr
r
r�__repr__<s�zStatistic.__repr__cCs|j|j|jfSr)rrrrr
r
r�	_sort_key@szStatistic._sort_keyN��__name__�
__module__�__qualname__�__doc__�	__slots__rrrr r!r"r
r
r
rrs
rc@sDeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dS)�
StatisticDiffzd
    Statistic difference on memory allocations between an old and a new
    Snapshot instance.
    �rr�	size_diffr�
count_diffcCs"||_||_||_||_||_dSrr*)rrrr+rr,r
r
rrKs
zStatisticDiff.__init__cCst|j|j|j|j|jf�Sr)rrrr+rr,rr
r
rrRs�zStatisticDiff.__hash__cCs<|j|jko:|j|jko:|j|jko:|j|jko:|j|jkSrr*rr
r
rrVs
�
�
�
�zStatisticDiff.__eq__cCsPd|jt|jd�t|jd�|j|jf}|jrL|j|j}|dt|d�7}|S)Nz %s: size=%s (%s), count=%i (%+i)FTr)rrrr+rr,rr
r
rr ]s

��zStatisticDiff.__str__cCsd|j|j|j|j|jfS)Nz9<StatisticDiff traceback=%r size=%i (%+i) count=%i (%+i)>r*rr
r
rr!is��zStatisticDiff.__repr__cCs t|j�|jt|j�|j|jfSr)rr+rr,rrrr
r
rr"ns
�zStatisticDiff._sort_keyNr#r
r
r
rr)Dsr)cCs�g}|��D]d\}}|�|d�}|dk	rNt||j|j|j|j|j|j�}nt||j|j|j|j�}|�|�q|��D]*\}}t|d|jd|j�}|�|�qz|S�Nr)�items�popr)rr�append)�	old_group�	new_group�
statisticsr�statZpreviousr
r
r�_compare_grouped_statsts*

��r5c@s\eZdZdZdZdd�Zedd��Zedd��Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dS)�Framez
    Frame of a traceback.
    ��_framecCs
||_dSrr7�r�framer
r
rr�szFrame.__init__cCs
|jdSr-r7rr
r
r�filename�szFrame.filenamecCs
|jdS�N�r7rr
r
r�lineno�szFrame.linenocCs|j|jkSrr7rr
r
rr�szFrame.__eq__cCs|j|jkSrr7rr
r
r�__lt__�szFrame.__lt__cCs
t|j�Sr)rr8rr
r
rr�szFrame.__hash__cCsd|j|jfS)Nz%s:%s�r;r>rr
r
rr �sz
Frame.__str__cCsd|j|jfS)Nz<Frame filename=%r lineno=%r>r@rr
r
rr!�szFrame.__repr__N)r$r%r&r'r(r�propertyr;r>rr?rr r!r
r
r
rr6�s

r6c@sfeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
ddd�ZdS)�	Tracebackz`
    Sequence of Frame instances sorted from the oldest frame
    to the most recent frame.
    ��_framescCst�|�tt|��|_dSr)rr�tuple�reversedrD)r�framesr
r
rr�s
zTraceback.__init__cCs
t|j�Sr)�lenrDrr
r
r�__len__�szTraceback.__len__cCs4t|t�r"tdd�|j|D��St|j|�SdS)Ncss|]}t|�VqdSr)r6��.0�tracer
r
r�	<genexpr>�sz(Traceback.__getitem__.<locals>.<genexpr>)�
isinstance�slicerErDr6�r�indexr
r
r�__getitem__�s
zTraceback.__getitem__cCs|j|jkSr)r8rDr9r
r
r�__contains__�szTraceback.__contains__cCs
t|j�Sr)rrDrr
r
rr�szTraceback.__hash__cCs|j|jkSrrCrr
r
rr�szTraceback.__eq__cCs|j|jkSrrCrr
r
rr?�szTraceback.__lt__cCst|d�Sr-)�strrr
r
rr �szTraceback.__str__cCsdt|�fS)Nz<Traceback %r>)rErr
r
rr!�szTraceback.__repr__NFcCs�g}|dk	r2|dkr$||d�}q6|d|�}n|}|rBt|�}|D]@}|�d|j|jf�t�|j|j���}|rF|�d|�qF|S)Nrz  File "%s", line %sz    %s)rFr0r;r>�	linecache�getline�strip)r�limitZmost_recent_first�linesZframe_slicer:�liner
r
r�format�s 
�zTraceback.format)NF)r$r%r&r'r(rrIrRrSrrr?r r!r[r
r
r
rrB�srBcCs t|�}|dk	rt|�SdSdS)z�
    Get the traceback where the Python object *obj* was allocated.
    Return a Traceback instance.

    Return None if the tracemalloc module is not tracing memory allocations or
    did not trace the allocation of the object.
    N)rrB)�objrGr
r
r�get_object_traceback�sr]c@s`eZdZdZdZdd�Zedd��Zedd��Zed	d
��Z	dd�Z
d
d�Zdd�Zdd�Z
dS)�Tracez"
    Trace of a memory block.
    ��_tracecCs
||_dSrr_�rrLr
r
rrszTrace.__init__cCs
|jdSr-r_rr
r
r�domainszTrace.domaincCs
|jdSr<r_rr
r
rr	sz
Trace.sizecCst|jd�S)N�)rBr`rr
r
rr
szTrace.tracebackcCs|j|jkSrr_rr
r
rrszTrace.__eq__cCs
t|j�Sr)rr`rr
r
rrszTrace.__hash__cCsd|jt|jd�fS)Nz%s: %sF)rrrrr
r
rr sz
Trace.__str__cCsd|jt|jd�|jfS)Nz'<Trace domain=%s size=%s, traceback=%r>F)rbrrrrr
r
rr!s�zTrace.__repr__N)r$r%r&r'r(rrArbrrrrr r!r
r
r
rr^�s


r^c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�_TracescCst�|�||_dSr)rr�_traces)r�tracesr
r
rr s
z_Traces.__init__cCs
t|j�Sr)rHrerr
r
rrI%sz_Traces.__len__cCs4t|t�r"tdd�|j|D��St|j|�SdS)Ncss|]}t|�VqdSr)r^rJr
r
rrM*sz&_Traces.__getitem__.<locals>.<genexpr>)rNrOrErer^rPr
r
rrR(s
z_Traces.__getitem__cCs|j|jkSr)r`rerar
r
rrS.sz_Traces.__contains__cCs|j|jkSr)rerr
r
rr1sz_Traces.__eq__cCsdt|�S)Nz<Traces len=%s>)rHrr
r
rr!4sz_Traces.__repr__N)	r$r%r&rrIrRrSrr!r
r
r
rrdsrdcCs&tj�|�}|�d�r"|dd�}|S)Nz.pyc���)�os�path�normcase�endswith)r;r
r
r�_normalize_filename8s
rlc@seZdZdd�Zdd�ZdS)�
BaseFiltercCs
||_dSr)�	inclusive)rrnr
r
rr@szBaseFilter.__init__cCst�dSr)�NotImplementedErrorrar
r
r�_matchCszBaseFilter._matchN)r$r%r&rrpr
r
r
rrm?srmcsJeZdZd�fdd�	Zedd��Zdd�Zd	d
�Zdd�Zd
d�Z	�Z
S)�FilterNFcs2t��|�||_t|�|_||_||_||_dSr)�superrrnrl�_filename_patternr>�
all_framesrb)rrn�filename_patternr>rtrb��	__class__r
rrHs
zFilter.__init__cCs|jSr)rsrr
r
rruQszFilter.filename_patterncCs6t|�}t�||j�sdS|jdkr(dS||jkSdS)NFT)rl�fnmatchrsr>�rr;r>r
r
r�_match_frame_implUs
zFilter._match_frame_implcCs|�||�|jASr)rzrnryr
r
r�_match_frame^szFilter._match_framecsH�jr,t�fdd�|D��r"�jS�jSn|d\}}��||�SdS)Nc3s|]\}}��||�VqdSr)rz)rKr;r>rr
rrMcs�z*Filter._match_traceback.<locals>.<genexpr>r)rt�anyrnr{)rrr;r>r
rr�_match_tracebackas�
zFilter._match_tracebackcCsD|\}}}|�|�}|jdk	r@|jr2|o0||jkS|p>||jkS|Sr)r}rbrn)rrLrbrr�resr
r
rrpls


z
Filter._match)NFN)r$r%r&rrArurzr{r}rp�
__classcell__r
r
rvrrqGs�	
	rqcs0eZdZ�fdd�Zedd��Zdd�Z�ZS)�DomainFiltercst��|�||_dSr)rrr�_domain)rrnrbrvr
rrxszDomainFilter.__init__cCs|jSr)r�rr
r
rrb|szDomainFilter.domaincCs|\}}}||jk|jASr)rbrn)rrLrbrrr
r
rrp�s
zDomainFilter._match)r$r%r&rrArbrprr
r
rvrr�ws
r�c@sXeZdZdZdd�Zdd�Zedd��Zdd	�Zd
d�Z	dd
�Z
ddd�Zddd�ZdS)�SnapshotzB
    Snapshot of traces of memory blocks allocated by Python.
    cCst|�|_||_dSr)rdrf�traceback_limit)rrfr�r
r
rr�s
zSnapshot.__init__c	Cs*t|d��}t�||tj�W5QRXdS)z1
        Write the snapshot into a file.
        �wbN)�open�pickle�dumpZHIGHEST_PROTOCOL)rr;�fpr
r
rr��sz
Snapshot.dumpc
Cs,t|d��}t�|�W5QR�SQRXdS)z.
        Load a snapshot from a file.
        �rbN)r�r��load)r;r�r
r
rr��sz
Snapshot.loadcs@|rt�fdd�|D��sdS|r<t�fdd�|D��r<dSdS)Nc3s|]}|���VqdSr�rp�rK�trace_filter�rLr
rrM�s�z)Snapshot._filter_trace.<locals>.<genexpr>Fc3s|]}|���VqdSrr�r�r�r
rrM�s�T)r|)r�include_filters�exclude_filtersrLr
r�r�
_filter_trace�s��zSnapshot._filter_tracecs�t|t�stdt|�j��|rjg�g�|D] }|jrB��|�q,��|�q,���fdd��jjD�}n�jj�	�}t
|�j�S)z�
        Create a new Snapshot instance with a filtered traces sequence, filters
        is a list of Filter or DomainFilter instances.  If filters is an empty
        list, return a new Snapshot instance with a copy of the traces.
        z)filters must be a list of filters, not %scsg|]}����|�r|�qSr
)r�rJ�r�r�rr
r�
<listcomp>�s��z*Snapshot.filter_traces.<locals>.<listcomp>)rNr�	TypeError�typer$rnr0rfre�copyr�r�)r�filtersr�Z
new_tracesr
r�r�
filter_traces�s
�zSnapshot.filter_tracesc

Cs�|dkrtd|f��|r.|dkr.td|��i}i}|�s|jjD]�}|\}}}z||}	WnZtk
r�|dkr||}
n(|dkr�|dd�}
n|dddff}
t|
�}	|	||<YnXz(||	}|j|7_|jd7_WqDtk
�rt|	|d�||	<YqDXqDn�|jjD]�}|\}}}|D]�}z||}	WnFtk
�r~|dk�r\|f}
n|ddff}
t|
�}	|	||<YnXz(||	}|j|7_|jd7_Wn&tk
�r�t|	|d�||	<YnX�q(�q|S)	N)rr;r>zunknown key_type: %r)r>r;z/cumulative mode cannot by used with key type %rrr>r=r)�
ValueErrorrfre�KeyErrorrBrrr)
r�key_type�
cumulativeZstatsZ
tracebacksrLrbrZtrace_tracebackrrGr4r:r
r
r�	_group_by�sZ�


zSnapshot._group_byFcCs,|�||�}t|���}|jdtjd�|S)zd
        Group statistics by key_type. Return a sorted list of Statistic
        instances.
        T��reverse�key)r��list�values�sortrr")rr�r�Zgroupedr3r
r
rr3�szSnapshot.statisticscCs6|�||�}|�||�}t||�}|jdtjd�|S)z�
        Compute the differences with an old snapshot old_snapshot. Get
        statistics as a sorted list of StatisticDiff instances, grouped by
        group_by.
        Tr�)r�r5r�r)r")rZold_snapshotr�r�r2r1r3r
r
r�
compare_tos

zSnapshot.compare_toN)F)F)
r$r%r&r'rr��staticmethodr�r�r�r�r3r�r
r
r
rr��s
3

r�cCs$t�std��t�}t�}t||�S)zI
    Take a snapshot of traces of memory blocks allocated by Python.
    zLthe tracemalloc module must be tracing memory allocations to take a snapshot)�
is_tracing�RuntimeErrorrZget_traceback_limitr�)rfr�r
r
r�
take_snapshot
s
r�)Zcollections.abcrr�	functoolsrrxrUZos.pathrhr�Z_tracemallocrrrrr)r5r6rBr]r^rdrlrmrqr�r�r�r
r
r
r�<module>s2&0"?%0	__pycache__/copyreg.cpython-38.opt-2.pyc000064400000006633151153537560014037 0ustar00U

e5d��@s�dddddgZiZddd�Zdd�ZzeWnek
r@YnXdd	�Zeeee�d
d�ZdZd
d�Z	dd�Z
dd�Zdd�ZiZ
iZiZdd�Zdd�Zdd�ZdS)�pickle�constructor�
add_extension�remove_extension�clear_extension_cacheNcCs,t|�std��|t|<|dk	r(t|�dS)Nz$reduction functions must be callable)�callable�	TypeError�dispatch_tabler)�ob_type�pickle_function�constructor_ob�r�/usr/lib64/python3.8/copyreg.pyrs
cCst|�std��dS)Nzconstructors must be callable)rr)�objectrrr
rscCst|j|jffS�N)�complex�real�imag)�crrr
�pickle_complex"srcCs<|tkrt�|�}n$|�||�}|jtjkr8|�||�|Sr)r�__new__�__init__)�cls�base�state�objrrr
�_reconstructor)sricCs�|j}|jD]}t|d�r|jt@sq.qt}|tkr<d}n"||krVtd|j�d���||�}|||f}z
|j}Wn\t	k
r�t
|dd�r�td|j�d|���d�z
|j}Wnt	k
r�d}YnXYnX|�}|r�t||fSt|fSdS)N�	__flags__zcannot pickle z object�	__slots__zf object: a class that defines __slots__ without defining __getstate__ cannot be pickled with protocol )
�	__class__�__mro__�hasattrr�	_HEAPTYPErr�__name__�__getstate__�AttributeError�getattr�__dict__r)�self�protorrr�args�getstate�dictrrr
�
_reduce_ex6s4


�

r,cGs|j|f|��Sr�r)rr)rrr
�
__newobj__Zsr.cCs|j|f|�|�Srr-)rr)�kwargsrrr
�
__newobj_ex__]sr0cCs�|j�d�}|dk	r|Sg}t|d�s(n�|jD]�}d|jkr.|jd}t|t�rV|f}|D]^}|dkrjqZqZ|�d�r�|�d�s�|j�	d�}|r�|�
d||f�q�|�
|�qZ|�
|�qZq.z
||_WnYnX|S)N�
__slotnames__r)r&�__weakref__�__�_z_%s%s)r&�getr r�
isinstance�str�
startswith�endswithr"�lstrip�appendr1)r�namesr�slots�name�strippedrrr
�
_slotnamescs2





r@cCs�t|�}d|krdks&ntd��||f}t�|�|krNt�|�|krNdS|tkrjtd|t|f��|tkr�td|t|f��|t|<|t|<dS)N�i���zcode out of rangez)key %s is already registered with code %sz$code %s is already in use for key %s)�int�
ValueError�_extension_registryr5�_inverted_registry��moduler>�code�keyrrr
r�s$�
�
�cCsR||f}t�|�|ks$t�|�|kr4td||f��t|=t|=|tkrNt|=dS)Nz%key %s is not registered with code %s)rDr5rErC�_extension_cacherFrrr
r�s��cCst��dSr)rJ�clearrrrr
r�s)N)�__all__rrrr�	NameErrorrrr!r,r.r0r@rDrErJrrrrrrr
�<module>s2�

	$<__pycache__/formatter.cpython-38.pyc000064400000042213151153537560013424 0ustar00U

e5d';�@s�dZddlZddlZejdedd�dZGdd�d�ZGdd	�d	�ZGd
d�d�ZGdd
�d
e�Z	Gdd�de�Z
ddd�Zedkr�e�dS)aGeneric output formatting.

Formatter objects transform an abstract flow of formatting events into
specific output events on writer objects. Formatters manage several stack
structures to allow various properties of a writer object to be changed and
restored; writers need not be able to handle relative changes nor any sort
of ``change back'' operation. Specific writer properties which may be
controlled via formatter objects are horizontal alignment, font, and left
margin indentations. A mechanism is provided which supports providing
arbitrary, non-exclusive style settings to a writer as well. Additional
interfaces facilitate formatting events which are not reversible, such as
paragraph separation.

Writer objects encapsulate device interfaces. Abstract devices, such as
file formats, are supported as well as physical devices. The provided
implementations all work with abstract devices. The interface makes
available mechanisms for setting the properties which formatter objects
manage and inserting data into the output.
�Nz"the formatter module is deprecated�)�
stacklevelc@s�eZdZdZd(dd�Zdd�Zdd�Zd	d
�Zd)dd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd*d$d%�Zd+d&d'�ZdS),�
NullFormattera=A formatter which does nothing.

    If the writer parameter is omitted, a NullWriter instance is created.
    No methods of the writer are called by NullFormatter instances.

    Implementations should inherit from this class if implementing a writer
    interface but don't need to inherit any implementation.

    NcCs|dkrt�}||_dS�N)�
NullWriter�writer��selfr�r
�!/usr/lib64/python3.8/formatter.py�__init__)szNullFormatter.__init__cCsdSrr
�r	�	blankliner
r
r�
end_paragraph-�zNullFormatter.end_paragraphcCsdSrr
�r	r
r
r�add_line_break.rzNullFormatter.add_line_breakcOsdSrr
�r	�args�kwr
r
r�add_hor_rule/rzNullFormatter.add_hor_rulecCsdSrr
�r	�format�counterrr
r
r�add_label_data0rzNullFormatter.add_label_datacCsdSrr
�r	�datar
r
r�add_flowing_data1rzNullFormatter.add_flowing_datacCsdSrr
rr
r
r�add_literal_data2rzNullFormatter.add_literal_datacCsdSrr
rr
r
r�flush_softspace3rzNullFormatter.flush_softspacecCsdSrr
�r	�alignr
r
r�push_alignment4rzNullFormatter.push_alignmentcCsdSrr
rr
r
r�
pop_alignment5rzNullFormatter.pop_alignmentcCsdSrr
)r	�xr
r
r�	push_font6rzNullFormatter.push_fontcCsdSrr
rr
r
r�pop_font7rzNullFormatter.pop_fontcCsdSrr
)r	�marginr
r
r�push_margin8rzNullFormatter.push_margincCsdSrr
rr
r
r�
pop_margin9rzNullFormatter.pop_margincCsdSrr
�r	�spacingr
r
r�set_spacing:rzNullFormatter.set_spacingcGsdSrr
�r	�stylesr
r
r�
push_style;rzNullFormatter.push_style�cCsdSrr
�r	�nr
r
r�	pop_style<rzNullFormatter.pop_stylecCsdSrr
�r	�flagr
r
r�assert_line_data=rzNullFormatter.assert_line_data)N)N)r0)r0)�__name__�
__module__�__qualname__�__doc__rrrrrrrrr"r#r%r&r(r)r,r/r3r6r
r
r
rrs&



rc@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd.dd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd/d*d+�Zd0d,d-�Zd
S)1�AbstractFormatterz�The standard formatter.

    This implementation has demonstrated wide applicability to many writers,
    and may be used directly in most circumstances.  It has been used to
    implement a full-featured World Wide Web browser.

    cCsR||_d|_g|_g|_g|_d|_g|_d|_d|_d|_	d|_
d|_d|_dS�Nr0r)
rr!�align_stack�
font_stack�margin_stackr+�style_stack�nospace�	softspace�para_end�parskip�
hard_break�
have_labelrr
r
rrNszAbstractFormatter.__init__cCs`|js|j��d|_|j|krD|jsD|j�||j�||_d|_d|_|_|_d|_dS�Nrr0)	rEr�send_line_breakrFrD�send_paragraphrArCrBr
r
r
rr]s
zAbstractFormatter.end_paragraphcCs8|js"|js"|j��d|_|_d|_|_d|_dSrG)rErCrrHrFrDrArBrr
r
rrhs

z AbstractFormatter.add_line_breakcOsF|js|j��|jj||�d|_|_d|_|_|_|_dSr<)	rErrH�
send_hor_rulerArFrCrBrDrr
r
rros

zAbstractFormatter.add_hor_ruleNcCs�|js|js|j��|js0|j�|r*dp,d�t|t�rP|j�|�	||��n|j�|�d|_
|_|_|_d|_|_dSr<)
rFrErrHrCrI�
isinstance�str�send_label_data�format_counterrArBrDrr
r
rrvs

z AbstractFormatter.add_label_datacCstd}|D]f}|dkr"|d|}q|dkrD|dkrn||�||�}q|dkrf|dkrn||�||�}q||}q|S)N��1z%dZaArZiI)�
format_letter�format_roman)r	rr�label�cr
r
rrN�s
z AbstractFormatter.format_countercCs<d}|dkr8t|dd�\}}tt|�|�}||}q|S)NrOrr0�)�divmod�chr�ord)r	�caserrSr$�sr
r
rrQ�s
zAbstractFormatter.format_letterc	Cs�ddddg}dddg}d\}}|d	kr�t|d
�\}}|dkrV||||d|}nT|d
krt|||||}n6|dkr�||}|d}nd}||||}||}|d}q|dkr�|��S|S)N�ir$rT�m�v�l�d)rOrr�
�	r0��rO�I)rV�upper)	r	rYrZonesZfivesrS�indexr$rZr
r
rrR�s&


zAbstractFormatter.format_romancCs�|sdS|dd���}|dd���}d�|���}|jrD|sDdS|sN|jrv|sh|jsdd|_d|_dS|jsvd|}d|_|_|_|_|_||_|j	�
|�dS)Nr0���� r)�isspace�join�splitrArBrDrErCrFr�send_flowing_data)r	rZprespaceZ	postspacer
r
rr�s*

�z"AbstractFormatter.add_flowing_datacCsZ|sdS|jr|j�d�|dd�dk|_d|_|_|_|_|_|j�|�dS)Nrhrg�
r)	rBrrlrErArCrDrF�send_literal_datarr
r
rr�s�z"AbstractFormatter.add_literal_datacCs:|jr6d|_|_|_|_|_d|_|j�d�dS�Nrr0rh)rBrErCrDrFrArrlrr
r
rr�s�z!AbstractFormatter.flush_softspacecCs@|r.||jkr.|j�|�||_|j�|�n|j�|j�dSr)r!r�
new_alignmentr=�appendr r
r
rr"�s
z AbstractFormatter.push_alignmentcCsH|jr|jd=|jr2|jd|_}|j�|�nd|_|j�d�dS�Nrg)r=r!rrpr r
r
rr#�szAbstractFormatter.pop_alignmentc
Cs�|\}}}}|jr6d|_|_|_d|_|j�d�|jr~|jd\}}}}	|tkrZ|}|tkrf|}|tkrr|}|tkr~|	}||||f}|j�|�|j�	|�dS)Nrr0rhrg)
rBrErCrArrlr>�AS_ISrq�new_font)
r	�font�sizer[�bZttZcsizeZci�cbZcttr
r
rr%�s$zAbstractFormatter.push_fontcCs4|jr|jd=|jr |jd}nd}|j�|�dSrr)r>rrt�r	rur
r
rr&�szAbstractFormatter.pop_fontcCsB|j�|�dd�|jD�}|s,|r,|d}|j�|t|��dS)NcSsg|]}|r|�qSr
r
��.0r\r
r
r�
<listcomp>sz1AbstractFormatter.push_margin.<locals>.<listcomp>rg)r?rqr�
new_margin�len)r	r'�fstackr
r
rr(s
zAbstractFormatter.push_margincCsF|jr|jd=dd�|jD�}|r,|d}nd}|j�|t|��dS)NrgcSsg|]}|r|�qSr
r
rzr
r
rr|
sz0AbstractFormatter.pop_margin.<locals>.<listcomp>)r?rr}r~)r	rr'r
r
rr)
s
zAbstractFormatter.pop_margincCs||_|j�|�dSr)r+r�new_spacingr*r
r
rr,szAbstractFormatter.set_spacingcGsV|jr*d|_|_|_d|_|j�d�|D]}|j�|�q.|j�t	|j��dSro)
rBrErCrArrlr@rq�
new_styles�tuple)r	r.Zstyler
r
rr/szAbstractFormatter.push_styler0cCs$|j|d�=|j�t|j��dSr)r@rr�r�r1r
r
rr3!szAbstractFormatter.pop_stylecCs$||_|_d|_|_|_dS�Nr)rArErCrDrFr4r
r
rr6%sz"AbstractFormatter.assert_line_data)N)r0)r0)r7r8r9r:rrrrrrNrQrRrrrr"r#r%r&r(r)r,r/r3r6r
r
r
rr;@s,

	
	
	
r;c@sxeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)raMinimal writer interface to use in testing & inheritance.

    A writer which only provides the interface definition; no actions are
    taken on any methods.  This should be the base class for all writers
    which do not need to inherit any implementation methods.

    cCsdSrr
rr
r
rr2rzNullWriter.__init__cCsdSrr
rr
r
r�flush3rzNullWriter.flushcCsdSrr
r r
r
rrp4rzNullWriter.new_alignmentcCsdSrr
ryr
r
rrt5rzNullWriter.new_fontcCsdSrr
�r	r'�levelr
r
rr}6rzNullWriter.new_margincCsdSrr
r*r
r
rr�7rzNullWriter.new_spacingcCsdSrr
r-r
r
rr�8rzNullWriter.new_stylescCsdSrr
r
r
r
rrI9rzNullWriter.send_paragraphcCsdSrr
rr
r
rrH:rzNullWriter.send_line_breakcOsdSrr
rr
r
rrJ;rzNullWriter.send_hor_rulecCsdSrr
rr
r
rrM<rzNullWriter.send_label_datacCsdSrr
rr
r
rrl=rzNullWriter.send_flowing_datacCsdSrr
rr
r
rrn>rzNullWriter.send_literal_dataN)r7r8r9r:rr�rprtr}r�r�rIrHrJrMrlrnr
r
r
rr*src@sheZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�AbstractWriterz�A writer which can be used in debugging formatters, but not much else.

    Each method simply announces itself by printing its name and
    arguments on standard output.

    cCstd|f�dS)Nznew_alignment(%r)��printr r
r
rrpIszAbstractWriter.new_alignmentcCstd|f�dS)Nznew_font(%r)r�ryr
r
rrtLszAbstractWriter.new_fontcCstd||f�dS)Nznew_margin(%r, %d)r�r�r
r
rr}OszAbstractWriter.new_margincCstd|f�dS)Nznew_spacing(%r)r�r*r
r
rr�RszAbstractWriter.new_spacingcCstd|f�dS)Nznew_styles(%r)r�r-r
r
rr�UszAbstractWriter.new_stylescCstd|f�dS)Nzsend_paragraph(%r)r�r
r
r
rrIXszAbstractWriter.send_paragraphcCstd�dS)Nzsend_line_break()r�rr
r
rrH[szAbstractWriter.send_line_breakcOstd�dS)Nzsend_hor_rule()r�rr
r
rrJ^szAbstractWriter.send_hor_rulecCstd|f�dS)Nzsend_label_data(%r)r�rr
r
rrMaszAbstractWriter.send_label_datacCstd|f�dS)Nzsend_flowing_data(%r)r�rr
r
rrldsz AbstractWriter.send_flowing_datacCstd|f�dS)Nzsend_literal_data(%r)r�rr
r
rrngsz AbstractWriter.send_literal_dataN)r7r8r9r:rprtr}r�r�rIrHrJrMrlrnr
r
r
rr�Asr�c@sJeZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dS)�
DumbWritera;Simple writer class which writes output on the file object passed in
    as the file parameter or, if file is omitted, on standard output.  The
    output is simply word-wrapped to the number of columns specified by
    the maxcol parameter.  This class is suitable for reflowing a sequence
    of paragraphs.

    N�HcCs(|ptj|_||_t�|�|��dSr)�sys�stdout�file�maxcolrr�reset)r	r�r�r
r
rrts
zDumbWriter.__init__cCsd|_d|_dSr�)�col�atbreakrr
r
rr�zszDumbWriter.resetcCs |j�d|�d|_d|_dS�Nrmr�r��writer�r�r
r
r
rrI~szDumbWriter.send_paragraphcCs|j�d�d|_d|_dSr�r�rr
r
rrH�szDumbWriter.send_line_breakcOs:|j�d�|j�d|j�|j�d�d|_d|_dS)Nrm�-r)r�r�r�r�r�rr
r
rrJ�s
zDumbWriter.send_hor_rulecCsV|j�|�|�d�}|dkr4d|_||dd�}|��}|jt|�|_d|_dS)Nrmrr0)r�r��rfindr��
expandtabsr~r�)r	rr[r
r
rrn�s
zDumbWriter.send_literal_datacCs�|sdS|jp|d��}|j}|j}|jj}|��D]N}|rl|t|�|kr\|d�d}n|d�|d}||�|t|�}d}q6||_|d��|_dS)Nrrmrhr0rg)r�rir�r�r�r�rkr~)r	rr�r�r�r�Zwordr
r
rrl�s$zDumbWriter.send_flowing_data)Nr�)r7r8r9r:rr�rIrHrJrnrlr
r
r
rr�ks

r�cCs�t�}t|�}|dk	r t|�}n$tjdd�r>ttjd�}ntj}z,|D]"}|dkrb|�d�qJ|�|�qJW5|tjk	r�|��X|�d�dS)Nr0rmr)	r�r;�openr��argv�stdin�closerr)r��w�f�fp�liner
r
r�test�s


r��__main__)N)
r:r��warnings�warn�DeprecationWarningrsrr;rr�r�r�r7r
r
r
r�<module>s�"k*C
__pycache__/_sysconfigdata__linux_x86_64-linux-gnu.cpython-38.opt-2.pyc000064400000070732151153537560021705 0ustar00U

��.en���@s`dddddddddddddd	dd
ddd
dddddddddddddddddddddddddd d!d"d#dddd$d%dd&d'd(d$d)dddd*d+dddddddd,d$d$d$d$dd$dd$d$d$d$d$dddddddddd$dd$d$d$d$d$d$d$d$dd$d$d$d$d$dd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$dd$d$d$dd$dd$dd$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$d$d$dd$d$d$d$d$d$dd$d$d$d$dd$d$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$d$d$dd$ddd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$dd$d$d$d$dd$d$d$d$d$ddd$d$dd$dddd$d$d$ddd$d$dddd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$d$d$dd$d$dd$d$dd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$dd$d$d$d$d$d$dd$d$d$d$d$d$d$d$ddd$d$d$dd$d$ddd$d$d$d$d$d$d$dddddd$dd$d$dddddd$ddd$d$d$d$d$d$d$d$d$d$d$ddd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$ddd$d$d$d$ddd$d$d$ddd$dd$d$d$d$d$d$d$d$d$d$d$d$d$d$ddd-ddd.d/d.d.d0d1d2dd3d4d5dd	d6ddd7dd8d9dd:d;dd<ddd=d>d?d@ddd)ddAdBddCdddd
dd$dDdEdFdGdddHddIdJd$dKddddLdMdddddddddNdOdPdddQd$d$dRdd
ddSddddTdUdddVddWd$dXdYddZd4d[d\dd]dd$ddd^d_d`dadbd7ddcddd=ded$dddfdgdhdgdfdhdfdfdgdgdfd\dfdfdfdfdgd$didjdkd$dldmddnd8d$dddddoddpdqdd$ddddrd$d6dsd$d$d$d$dddd$d$ddtdudsdvdwdwdsdx���ZdyS)z��ZarZrcsz!-Wno-unused-result -Wsign-comparez-IObjects -IInclude -IPythonz/usr/binz/usr/lib64/python3.8z-L. -lpython3.8zOgcc -pthread -shared -Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -g�pythonzx86_64-redhat-linux-gnu�\zgcc -pthreadz-fPICa-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapvz?configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.ina-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapvaK-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declarationz-Wl,-z,relro  -Wl,-z,now  -gz�-Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -ga�'--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--enable-ipv6' '--enable-shared' '--with-computed-gotos=yes' '--with-dbmliborder=gdbm:ndbm:bdb' '--with-system-expat' '--with-system-ffi' '--enable-loadable-sqlite-extensions' '--with-dtrace' '--with-lto' '--with-ssl-default-suites=openssl' '--with-valgrind' '--without-ensurepip' '--enable-optimizations' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'CFLAGS= -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv ' 'LDFLAGS= -Wl,-z,relro  -Wl,-z,now  -g ' 'CPPFLAGS=' 'PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'z/usr/includez/usr/include/python3.8zA/builddir/build/BUILD/Python-3.8.17/build/optimized/coverage.infoz?/builddir/build/BUILD/Python-3.8.17/build/optimized/lcov-reportz2--no-branch-coverage --title "CPython lcov report"zN-IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Includezg++ -pthreadzE/usr /usr/lib64 /usr/lib64/python3.8 /usr/lib64/python3.8/lib-dynloadz /usr/lib64/python3.8/lib-dynloadi�zoREADME.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in Include Lib Misc Ext-dummyzInclude Lib Misc Ext-dummyzTREADME.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in�.�z/usr/bin/dtracezInclude/pydtrace_probes.hzPython/pydtrace.ozdynload_shlib.oZnoz.cpython-38-x86_64-linux-gnu.soi�ZyeszG/usr/include /usr/include /usr/include/python3.8 /usr/include/python3.8z/usr/bin/install -cz/usr/bin/install -c -m 644z/usr/bin/install -c -m 755zlibpython3.8.so.1.0zModules/_io/_iomodule.hzg++ -pthread -sharedz:-Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -gzlibpython3.8.soz3.8z
/usr/lib64z-lmzPython/z/usr/lib64/pkgconfigz0/usr/lib64/python3.8/config-3.8-x86_64-linux-gnuzlibpython3.8.az"-lcrypt -lpthread -ldl  -lutil -lmz0tkinter tkinter/test tkinter/test/test_tkinter \Zgccz-Xlinker -export-dynamic�trueZlnZlinuxz5/builddir/build/BUILD/Python-3.8.17/Modules/makesetupz/usr/share/manz/usr/bin/mkdir -pz�posix  errno  pwd  _sre  _codecs  _weakref  _functools  _operator  _collections  _abc  itertools  atexit  _signal  _stat  time  _thread  _locale  _io  faulthandler  _tracemalloc  _symtable  xxsubtypeavModules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  Modules/_sre.o  Modules/_codecsmodule.o  Modules/_weakref.o  Modules/_functoolsmodule.o  Modules/_operator.o  Modules/_collectionsmodule.o  Modules/_abc.o  Modules/itertoolsmodule.o  Modules/atexitmodule.o  Modules/signalmodule.o  Modules/_stat.o  Modules/timemodule.o  Modules/_threadmodule.o  Modules/_localemodule.o  Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o  Modules/faulthandler.o  Modules/_tracemalloc.o Modules/hashtable.o  Modules/symtablemodule.o  Modules/xxsubtype.ozx86_64-linux-gnuz -DMULTIARCH=\"x86_64-linux-gnu\"z-Wl,--no-as-neededz-lssl -lcryptoa:-DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapvz:\ Parser/myreadline.o Parser/parsetok.o Parser/tokenizer.oz-fprofile-generatez"-fprofile-use -fprofile-correctionz
-m test --pgoz
libpython3.sozno-frameworkz./python -Ez	python3.8a-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition  -fprofile-use -fprofile-correction -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPIC -DPy_BUILD_CORE_BUILTINa.-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition  -fprofile-use -fprofile-correction -I/builddir/build/BUILD/Python-3.8.17/Include/internala-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition  -fprofile-use -fprofile-correction -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPIC -DPy_BUILD_COREaT-Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g -lcryptoz"z"a-Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g�a-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition  -fprofile-use -fprofile-correction -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPICz)-x test_subprocess test_io test_lib2to3 \ZreadelfzMac/Resources/frameworkZvoidzCLD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/optimizedz	@SGI_ABI@z/bin/shz.so���zcpython-38-x86_64-linux-gnuz2Parser Objects Python Modules Modules/_io Programsz:/builddir/build/BUILD/Python-3.8.17/Tools/gdb/libpython.pyz"/* Don't use ncurses extensions */z-szInclude Lib MisczLLD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/optimized ./pythonz�LD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/optimized ./python /builddir/build/BUILD/Python-3.8.17/Tools/scripts/run_tests.pyi�zJpython3.8 /builddir/build/BUILD/Python-3.8.17/Tools/scripts/update_file.pyz#/builddir/build/BUILD/Python-3.8.17z)xml xml/dom xml/etree xml/parsers xml/saxz3/builddir/build/BUILD/Python-3.8.17/build/optimizedz
/usr/sharez/usr(�ZABIFLAGSZAC_APPLE_UNIVERSAL_BUILDZAIX_GENUINE_CPLUSPLUSZ	ALT_SOABIZANDROID_API_LEVELZARZARFLAGSZ
BASECFLAGSZBASECPPFLAGSZBASEMODLIBSZBINDIRZ
BINLIBDESTZ
BLDLIBRARYZ	BLDSHAREDZBUILDEXEZBUILDPYTHONZBUILD_GNU_TYPEZBYTESTR_DEPSZCCZCCSHAREDZCFLAGSZCFLAGSFORSHAREDZCFLAGS_ALIASINGZCONFIGFILESZCONFIGURE_CFLAGSZCONFIGURE_CFLAGS_NODISTZCONFIGURE_CPPFLAGSZCONFIGURE_LDFLAGSZCONFIGURE_LDFLAGS_NODISTZCONFIG_ARGSZCONFINCLUDEDIRZ
CONFINCLUDEPYZCOREPYTHONPATHZ
COVERAGE_INFOZCOVERAGE_REPORTZCOVERAGE_REPORT_OPTIONSZCPPFLAGSZCXXZDESTDIRSZDESTLIBZDESTPATHZ
DESTSHAREDZDFLAGSZDIRMODEZDISTZDISTDIRSZ	DISTFILESZ	DLINCLDIRZ
DLLLIBRARYZ"DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754ZDOUBLE_IS_BIG_ENDIAN_IEEE754ZDOUBLE_IS_LITTLE_ENDIAN_IEEE754ZDTRACEZDTRACE_DEPSZDTRACE_HEADERSZDTRACE_OBJSZDYNLOADFILEZENABLE_IPV6Z	ENSUREPIPZEXEZEXEMODEZ
EXTRATESTOPTSZ
EXT_SUFFIXZFILEMODEZFLOAT_WORDS_BIGENDIANZFLOCK_NEEDS_LIBBSDZGETPGRP_HAVE_ARGZGETTIMEOFDAY_NO_TZZ	GITBRANCHZGITTAGZ
GITVERSIONZGNULDZHAVE_ACCEPT4Z
HAVE_ACOSHZ
HAVE_ADDRINFOZ
HAVE_ALARMZHAVE_ALIGNED_REQUIREDZ
HAVE_ALLOCA_HZHAVE_ALTZONEZ
HAVE_ASINHZHAVE_ASM_TYPES_HZ
HAVE_ATANHZHAVE_BIND_TEXTDOMAIN_CODESETZHAVE_BLUETOOTH_BLUETOOTH_HZHAVE_BLUETOOTH_HZHAVE_BROKEN_MBSTOWCSZHAVE_BROKEN_NICEZHAVE_BROKEN_PIPE_BUFZHAVE_BROKEN_POLLZHAVE_BROKEN_POSIX_SEMAPHORESZHAVE_BROKEN_PTHREAD_SIGMASKZHAVE_BROKEN_SEM_GETVALUEZHAVE_BROKEN_UNSETENVZHAVE_BUILTIN_ATOMICZHAVE_CHFLAGSZ
HAVE_CHOWNZHAVE_CHROOTZ
HAVE_CLOCKZHAVE_CLOCK_GETRESZHAVE_CLOCK_GETTIMEZHAVE_CLOCK_SETTIMEZHAVE_COMPUTED_GOTOSZHAVE_CONFSTRZHAVE_CONIO_HZ
HAVE_COPYSIGNZHAVE_COPY_FILE_RANGEZHAVE_CRYPT_HZHAVE_CRYPT_RZHAVE_CTERMIDZHAVE_CTERMID_RZHAVE_CURSES_FILTERZ
HAVE_CURSES_HZHAVE_CURSES_HAS_KEYZHAVE_CURSES_IMMEDOKZHAVE_CURSES_IS_PADZHAVE_CURSES_IS_TERM_RESIZEDZHAVE_CURSES_RESIZETERMZHAVE_CURSES_RESIZE_TERMZHAVE_CURSES_SYNCOKZHAVE_CURSES_TYPEAHEADZHAVE_CURSES_USE_ENVZHAVE_CURSES_WCHGATZHAVE_DECL_ISFINITEZHAVE_DECL_ISINFZHAVE_DECL_ISNANZHAVE_DECL_RTLD_DEEPBINDZHAVE_DECL_RTLD_GLOBALZHAVE_DECL_RTLD_LAZYZHAVE_DECL_RTLD_LOCALZHAVE_DECL_RTLD_MEMBERZHAVE_DECL_RTLD_NODELETEZHAVE_DECL_RTLD_NOLOADZHAVE_DECL_RTLD_NOWZHAVE_DECL_TZNAMEZHAVE_DEVICE_MACROSZHAVE_DEV_PTCZ
HAVE_DEV_PTMXZ
HAVE_DIRECT_HZHAVE_DIRENT_D_TYPEZ
HAVE_DIRENT_HZ
HAVE_DIRFDZHAVE_DLFCN_HZHAVE_DLOPENZ	HAVE_DUP2Z	HAVE_DUP3Z$HAVE_DYLD_SHARED_CACHE_CONTAINS_PATHZHAVE_DYNAMIC_LOADINGZ
HAVE_ENDIAN_HZ
HAVE_EPOLLZHAVE_EPOLL_CREATE1ZHAVE_ERFZ	HAVE_ERFCZHAVE_ERRNO_HZ
HAVE_EXECVZHAVE_EXPLICIT_BZEROZHAVE_EXPLICIT_MEMSETZ
HAVE_EXPM1ZHAVE_FACCESSATZHAVE_FCHDIRZHAVE_FCHMODZ
HAVE_FCHMODATZHAVE_FCHOWNZ
HAVE_FCHOWNATZHAVE_FCNTL_HZHAVE_FDATASYNCZHAVE_FDOPENDIRZHAVE_FDWALKZHAVE_FEXECVEZHAVE_FINITEZ
HAVE_FLOCKZ	HAVE_FORKZHAVE_FORKPTYZHAVE_FPATHCONFZHAVE_FSEEK64ZHAVE_FSEEKOZHAVE_FSTATATZ
HAVE_FSTATVFSZ
HAVE_FSYNCZHAVE_FTELL64ZHAVE_FTELLOZ
HAVE_FTIMEZHAVE_FTRUNCATEZ
HAVE_FUTIMENSZHAVE_FUTIMESZHAVE_FUTIMESATZHAVE_GAI_STRERRORZ
HAVE_GAMMAZHAVE_GCC_ASM_FOR_MC68881ZHAVE_GCC_ASM_FOR_X64ZHAVE_GCC_ASM_FOR_X87ZHAVE_GCC_UINT128_TZHAVE_GETADDRINFOZHAVE_GETC_UNLOCKEDZHAVE_GETENTROPYZHAVE_GETGRGID_RZHAVE_GETGRNAM_RZHAVE_GETGROUPLISTZHAVE_GETGROUPSZHAVE_GETHOSTBYNAMEZHAVE_GETHOSTBYNAME_RZHAVE_GETHOSTBYNAME_R_3_ARGZHAVE_GETHOSTBYNAME_R_5_ARGZHAVE_GETHOSTBYNAME_R_6_ARGZHAVE_GETITIMERZHAVE_GETLOADAVGZ
HAVE_GETLOGINZHAVE_GETNAMEINFOZHAVE_GETPAGESIZEZHAVE_GETPEERNAMEZHAVE_GETPGIDZHAVE_GETPGRPZHAVE_GETPIDZHAVE_GETPRIORITYZ
HAVE_GETPWENTZHAVE_GETPWNAM_RZHAVE_GETPWUID_RZHAVE_GETRANDOMZHAVE_GETRANDOM_SYSCALLZHAVE_GETRESGIDZHAVE_GETRESUIDZHAVE_GETSIDZ
HAVE_GETSPENTZ
HAVE_GETSPNAMZHAVE_GETTIMEOFDAYZ
HAVE_GETWDZHAVE_GLIBC_MEMMOVE_BUGZ
HAVE_GRP_HZHAVE_HSTRERRORZHAVE_HTOLE64Z
HAVE_HYPOTZ
HAVE_IEEEFP_HZHAVE_IF_NAMEINDEXZHAVE_INET_ATONZHAVE_INET_PTONZHAVE_INITGROUPSZHAVE_INTTYPES_HZ	HAVE_IO_HZHAVE_IPA_PURE_CONST_BUGZ	HAVE_KILLZHAVE_KILLPGZHAVE_KQUEUEZHAVE_LANGINFO_HZHAVE_LARGEFILE_SUPPORTZ
HAVE_LCHFLAGSZHAVE_LCHMODZHAVE_LCHOWNZHAVE_LGAMMAZ
HAVE_LIBDLZHAVE_LIBDLDZHAVE_LIBIEEEZHAVE_LIBINTL_HZHAVE_LIBREADLINEZHAVE_LIBRESOLVZHAVE_LIBSENDFILEZHAVE_LIBUTIL_HZ	HAVE_LINKZHAVE_LINKATZHAVE_LINUX_CAN_BCM_HZHAVE_LINUX_CAN_HZHAVE_LINUX_CAN_RAW_FD_FRAMESZHAVE_LINUX_CAN_RAW_HZHAVE_LINUX_MEMFD_HZHAVE_LINUX_NETLINK_HZHAVE_LINUX_QRTR_HZHAVE_LINUX_RANDOM_HZHAVE_LINUX_TIPC_HZHAVE_LINUX_VM_SOCKETS_HZ
HAVE_LOCKFZ
HAVE_LOG1PZ	HAVE_LOG2ZHAVE_LONG_DOUBLEZ
HAVE_LSTATZHAVE_LUTIMESZHAVE_MADVISEZHAVE_MAKEDEVZHAVE_MBRTOWCZHAVE_MEMFD_CREATEZ
HAVE_MEMORY_HZHAVE_MEMRCHRZHAVE_MKDIRATZHAVE_MKFIFOZ
HAVE_MKFIFOATZ
HAVE_MKNODZHAVE_MKNODATZHAVE_MKTIMEZ	HAVE_MMAPZHAVE_MREMAPZHAVE_NCURSES_HZHAVE_NDIR_HZHAVE_NETPACKET_PACKET_HZ
HAVE_NET_IF_HZ	HAVE_NICEZHAVE_OPENATZHAVE_OPENPTYZ
HAVE_PATHCONFZ
HAVE_PAUSEZ
HAVE_PIPE2Z
HAVE_PLOCKZ	HAVE_POLLZHAVE_POLL_HZHAVE_POSIX_FADVISEZHAVE_POSIX_FALLOCATEZHAVE_POSIX_SPAWNZHAVE_POSIX_SPAWNPZ
HAVE_PREADZHAVE_PREADVZHAVE_PREADV2ZHAVE_PRLIMITZHAVE_PROCESS_HZHAVE_PROTOTYPESZHAVE_PTHREAD_CONDATTR_SETCLOCKZHAVE_PTHREAD_DESTRUCTORZHAVE_PTHREAD_GETCPUCLOCKIDZHAVE_PTHREAD_HZHAVE_PTHREAD_INITZHAVE_PTHREAD_KILLZHAVE_PTHREAD_SIGMASKZ
HAVE_PTY_HZHAVE_PUTENVZHAVE_PWRITEZHAVE_PWRITEVZ
HAVE_PWRITEV2Z
HAVE_READLINKZHAVE_READLINKATZ
HAVE_READVZ
HAVE_REALPATHZ
HAVE_RENAMEATZHAVE_RL_APPEND_HISTORYZHAVE_RL_CATCH_SIGNALZ#HAVE_RL_COMPLETION_APPEND_CHARACTERZ'HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOKZHAVE_RL_COMPLETION_MATCHESZ"HAVE_RL_COMPLETION_SUPPRESS_APPENDZHAVE_RL_PRE_INPUT_HOOKZHAVE_RL_RESIZE_TERMINALZ
HAVE_ROUNDZ
HAVE_RTPSPAWNZHAVE_SCHED_GET_PRIORITY_MAXZHAVE_SCHED_HZHAVE_SCHED_RR_GET_INTERVALZHAVE_SCHED_SETAFFINITYZHAVE_SCHED_SETPARAMZHAVE_SCHED_SETSCHEDULERZHAVE_SEM_GETVALUEZ
HAVE_SEM_OPENZHAVE_SEM_TIMEDWAITZHAVE_SEM_UNLINKZ
HAVE_SENDFILEZHAVE_SETEGIDZHAVE_SETEUIDZHAVE_SETGIDZHAVE_SETGROUPSZHAVE_SETHOSTNAMEZHAVE_SETITIMERZHAVE_SETLOCALEZHAVE_SETPGIDZHAVE_SETPGRPZHAVE_SETPRIORITYZ
HAVE_SETREGIDZHAVE_SETRESGIDZHAVE_SETRESUIDZ
HAVE_SETREUIDZHAVE_SETSIDZHAVE_SETUIDZHAVE_SETVBUFZ
HAVE_SHADOW_HZ
HAVE_SHM_OPENZHAVE_SHM_UNLINKZHAVE_SIGACTIONZHAVE_SIGALTSTACKZHAVE_SIGFILLSETZHAVE_SIGINFO_T_SI_BANDZHAVE_SIGINTERRUPTZ
HAVE_SIGNAL_HZHAVE_SIGPENDINGZ
HAVE_SIGRELSEZHAVE_SIGTIMEDWAITZHAVE_SIGWAITZHAVE_SIGWAITINFOZ
HAVE_SNPRINTFZHAVE_SOCKADDR_ALGZHAVE_SOCKADDR_SA_LENZHAVE_SOCKADDR_STORAGEZHAVE_SOCKETPAIRZHAVE_SPAWN_HZHAVE_SSIZE_TZHAVE_STATVFSZHAVE_STAT_TV_NSECZHAVE_STAT_TV_NSEC2ZHAVE_STDARG_PROTOTYPESZ
HAVE_STDINT_HZ
HAVE_STDLIB_HZHAVE_STD_ATOMICZHAVE_STRDUPZ
HAVE_STRFTIMEZHAVE_STRINGS_HZ
HAVE_STRING_HZHAVE_STRLCPYZHAVE_STROPTS_HZHAVE_STRSIGNALZHAVE_STRUCT_PASSWD_PW_GECOSZHAVE_STRUCT_PASSWD_PW_PASSWDZHAVE_STRUCT_STAT_ST_BIRTHTIMEZHAVE_STRUCT_STAT_ST_BLKSIZEZHAVE_STRUCT_STAT_ST_BLOCKSZHAVE_STRUCT_STAT_ST_FLAGSZHAVE_STRUCT_STAT_ST_GENZHAVE_STRUCT_STAT_ST_RDEVZHAVE_STRUCT_TM_TM_ZONEZHAVE_SYMLINKZHAVE_SYMLINKATZ	HAVE_SYNCZHAVE_SYSCONFZHAVE_SYSEXITS_HZHAVE_SYS_AUDIOIO_HZHAVE_SYS_BSDTTY_HZHAVE_SYS_DEVPOLL_HZHAVE_SYS_DIR_HZHAVE_SYS_ENDIAN_HZHAVE_SYS_EPOLL_HZHAVE_SYS_EVENT_HZHAVE_SYS_FILE_HZHAVE_SYS_IOCTL_HZHAVE_SYS_KERN_CONTROL_HZHAVE_SYS_LOADAVG_HZHAVE_SYS_LOCK_HZHAVE_SYS_MEMFD_HZHAVE_SYS_MKDEV_HZHAVE_SYS_MMAN_HZHAVE_SYS_MODEM_HZHAVE_SYS_NDIR_HZHAVE_SYS_PARAM_HZHAVE_SYS_POLL_HZHAVE_SYS_RANDOM_HZHAVE_SYS_RESOURCE_HZHAVE_SYS_SELECT_HZHAVE_SYS_SENDFILE_HZHAVE_SYS_SOCKET_HZHAVE_SYS_STATVFS_HZHAVE_SYS_STAT_HZHAVE_SYS_SYSCALL_HZHAVE_SYS_SYSMACROS_HZHAVE_SYS_SYS_DOMAIN_HZHAVE_SYS_TERMIO_HZHAVE_SYS_TIMES_HZHAVE_SYS_TIME_HZHAVE_SYS_TYPES_HZHAVE_SYS_UIO_HZ
HAVE_SYS_UN_HZHAVE_SYS_UTSNAME_HZHAVE_SYS_WAIT_HZHAVE_SYS_XATTR_HZHAVE_TCGETPGRPZHAVE_TCSETPGRPZHAVE_TEMPNAMZHAVE_TERMIOS_HZHAVE_TERM_HZHAVE_TGAMMAZHAVE_TIMEGMZ
HAVE_TIMESZHAVE_TMPFILEZHAVE_TMPNAMZ
HAVE_TMPNAM_RZHAVE_TM_ZONEZ
HAVE_TRUNCATEZHAVE_TZNAMEZ
HAVE_UCS4_TCLZ
HAVE_UNAMEZ
HAVE_UNISTD_HZ
HAVE_UNLINKATZ
HAVE_UNSETENVZHAVE_USABLE_WCHAR_TZHAVE_UTIL_HZHAVE_UTIMENSATZHAVE_UTIMESZHAVE_UTIME_HZHAVE_UUID_CREATEZHAVE_UUID_ENC_BEZHAVE_UUID_GENERATE_TIME_SAFEZHAVE_UUID_HZHAVE_UUID_UUID_HZ
HAVE_WAIT3Z
HAVE_WAIT4ZHAVE_WAITIDZHAVE_WAITPIDZHAVE_WCHAR_HZHAVE_WCSCOLLZ
HAVE_WCSFTIMEZHAVE_WCSXFRMZHAVE_WMEMCMPZHAVE_WORKING_TZSETZHAVE_WRITEVZ HAVE_X509_VERIFY_PARAM_SET1_HOSTZHAVE_ZLIB_COPYZHAVE__GETPTYZ
HOST_GNU_TYPEZINCLDIRSTOMAKEZ
INCLUDEDIRZ	INCLUDEPYZINSTALLZINSTALL_DATAZINSTALL_PROGRAMZINSTALL_SCRIPTZINSTALL_SHAREDZ
INSTSONAMEZIO_HZIO_OBJSZLDCXXSHAREDZLDFLAGSZ	LDLIBRARYZLDLIBRARYDIRZLDSHAREDZ	LDVERSIONZLIBCZLIBDESTZLIBDIRZLIBFFI_INCLUDEDIRZLIBMZ	LIBOBJDIRZLIBOBJSZLIBPCZLIBPLZ	LIBPYTHONZLIBRARYZLIBRARY_OBJSZLIBRARY_OBJS_OMIT_FROZENZLIBSZ
LIBSUBDIRSZLINKCCZ
LINKFORSHAREDZLIPO_32BIT_FLAGSZLIPO_INTEL64_FLAGSZ
LLVM_PROF_ERRZLLVM_PROF_FILEZLLVM_PROF_MERGERZLNZLOCALMODLIBSZMACHDEPZMACHDEP_OBJSZMACHDESTLIBZMACOSX_DEPLOYMENT_TARGETZMAINCCZMAJOR_IN_MKDEVZMAJOR_IN_SYSMACROSZ	MAKESETUPZMANDIRZMKDIR_PZMODBUILT_NAMESZMODDISABLED_NAMESZMODLIBSZMODOBJSZMODULE_OBJSZ	MULTIARCHZMULTIARCH_CPPFLAGSZMVWDELCH_IS_EXPRESSIONZNO_AS_NEEDEDZOBJECT_OBJSZOPENSSL_INCLUDESZOPENSSL_LDFLAGSZOPENSSL_LIBSZOPTZOTHER_LIBTOOL_OPTZPACKAGE_BUGREPORTZPACKAGE_NAMEZPACKAGE_STRINGZPACKAGE_TARNAMEZPACKAGE_URLZPACKAGE_VERSIONZPARSER_HEADERSZPARSER_OBJSZPGO_PROF_GEN_FLAGZPGO_PROF_USE_FLAGZPOBJSZPOSIX_SEMAPHORES_NOT_ENABLEDZPROFILE_TASKZ$PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INTZPTHREAD_SYSTEM_SCHED_SUPPORTEDZ
PY3LIBRARYZPYLONG_BITS_IN_DIGITZPYTHONZPYTHONFRAMEWORKZPYTHONFRAMEWORKDIRZPYTHONFRAMEWORKINSTALLDIRZPYTHONFRAMEWORKPREFIXZ
PYTHONPATHZPYTHON_FOR_BUILDZPYTHON_FOR_REGENZPYTHON_HEADERSZPYTHON_OBJSZPY_BUILTIN_MODULE_CFLAGSZ	PY_CFLAGSZPY_CFLAGS_NODISTZPY_COERCE_C_LOCALEZPY_CORE_CFLAGSZPY_CORE_LDFLAGSZPY_CPPFLAGSZPY_FORMAT_SIZE_TZ
PY_LDFLAGSZPY_LDFLAGS_NODISTZPY_SSL_DEFAULT_CIPHERSZPY_SSL_DEFAULT_CIPHER_STRINGZPY_STDMODULE_CFLAGSZPy_DEBUGZPy_ENABLE_SHAREDZPy_HASH_ALGORITHMZ
Py_TRACE_REFSZ
QUICKTESTOPTSZREADELFZ	RESSRCDIRZ
RETSIGTYPEZ	RUNSHAREDZ	SCRIPTDIRZSETPGRP_HAVE_ARGZSGI_ABIZSHELLZSHLIBSZSHLIB_SUFFIXZSHM_NEEDS_LIBRTZSIGNED_RIGHT_SHIFT_ZERO_FILLSZSITEPATHZ
SIZEOF_DOUBLEZSIZEOF_FLOATZ
SIZEOF_FPOS_TZ
SIZEOF_INTZSIZEOF_LONGZSIZEOF_LONG_DOUBLEZSIZEOF_LONG_LONGZSIZEOF_OFF_TZSIZEOF_PID_TZSIZEOF_PTHREAD_KEY_TZSIZEOF_PTHREAD_TZSIZEOF_SHORTZ
SIZEOF_SIZE_TZ
SIZEOF_TIME_TZSIZEOF_UINTPTR_TZ
SIZEOF_VOID_PZSIZEOF_WCHAR_TZSIZEOF__BOOLZSOABIZSRCDIRSZ
SRC_GDB_HOOKSZSTDC_HEADERSZSTRICT_SYSV_CURSESZ	STRIPFLAGZSUBDIRSZ
SUBDIRSTOOZSYSLIBSZSYS_SELECT_WITH_SYS_TIMEZTCLTK_INCLUDESZ
TCLTK_LIBSZTESTOPTSZTESTPATHZ
TESTPYTHONZTESTPYTHONOPTSZ
TESTRUNNERZTESTTIMEOUTZTIMEMODULE_LIBZTIME_WITH_SYS_TIMEZTM_IN_SYS_TIMEZUNICODE_DEPSZUNIVERSALSDKZUPDATE_FILEZUSE_COMPUTED_GOTOSZVERSIONZVPATHZWINDOW_HAS_FLAGSZWITH_DECIMAL_CONTEXTVARZWITH_DOC_STRINGSZWITH_DTRACEZ	WITH_DYLDZWITH_LIBINTLZWITH_NEXT_FRAMEWORKZ
WITH_PYMALLOCZ
WITH_VALGRINDZX87_DOUBLE_ROUNDINGZ
XMLLIBSUBDIRSZabs_builddirZ
abs_srcdirZdatarootdir�exec_prefix�prefixZsrcdirN)Zbuild_time_vars�rr�>/usr/lib64/python3.8/_sysconfigdata__linux_x86_64-linux-gnu.py�<module>sb2,/��������__pycache__/sched.cpython-38.opt-2.pyc000064400000006663151153537560013460 0ustar00U

e5d*�@s�ddlZddlZddlmZddlZddlmZdgZGdd�dedd��Zdej_	d	ej
_	d
ej_	dej_	dej
_	e�ZGd
d�d�ZdS)�N)�
namedtuple)�	monotonic�	schedulerc@s8eZdZgZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�EventcCs|j|jf|j|jfkS�N��time�priority��s�o�r
�/usr/lib64/python3.8/sched.py�__eq__$�zEvent.__eq__cCs|j|jf|j|jfkSrrr
r
r
r�__lt__%rzEvent.__lt__cCs|j|jf|j|jfkSrrr
r
r
r�__le__&rzEvent.__le__cCs|j|jf|j|jfkSrrr
r
r
r�__gt__'rzEvent.__gt__cCs|j|jf|j|jfkSrrr
r
r
r�__ge__(rzEvent.__ge__N)	�__name__�
__module__�__qualname__�	__slots__rrrrrr
r
r
rr"srz(time, priority, action, argument, kwargszaNumeric type compatible with the return value of the
timefunc function passed to the constructor.zSEvents scheduled for the same time will be executed
in the order of their priority.z?Executing the event means executing
action(*argument, **kwargs)zGargument is a sequence holding the positional
arguments for the action.zDkwargs is a dictionary holding the keyword
arguments for the action.c@s^eZdZeejfdd�Zdefdd�Zdefdd�Z	dd	�Z
d
d�Zdd
d�Ze
dd��ZdS)rcCs g|_t��|_||_||_dSr)�_queue�	threading�RLock�_lock�timefunc�	delayfunc)�selfrrr
r
r�__init__9s
zscheduler.__init__r
c	Cs@|tkri}t|||||�}|j�t�|j|�W5QRX|Sr)�	_sentinelrr�heapq�heappushr)rrr	�action�argument�kwargs�eventr
r
r�enterabsAszscheduler.enterabscCs|��|}|�|||||�Sr)rr()r�delayr	r$r%r&rr
r
r�enterOszscheduler.enterc	Cs.|j�|j�|�t�|j�W5QRXdSr)rr�remover"�heapify)rr'r
r
r�cancelXszscheduler.cancelc
Cs&|j�|jW5QR�SQRXdSr)rr)rr
r
r�emptycszscheduler.emptyTc	Cs�|j}|j}|j}|j}tj}|�H|s4W5QR�q�|d\}}}	}
}|�}||krZd}
nd}
||�W5QRX|
r�|s�||S|||�q|	|
|�|d�qdS)NrTF)rrrrr"�heappop)rZblocking�lock�qrr�poprr	r$r%r&Znowr)r
r
r�runhs(
z
scheduler.runc	Cs:|j�|jdd�}W5QRXtttj|gt|���Sr)rr�list�mapr"r/�len)rZeventsr
r
r�queue�szscheduler.queueN)T)rrr�_timer�sleepr r!r(r*r-r.r3�propertyr7r
r
r
rr7s	
2)rr"�collectionsrrrr8�__all__r�__doc__r	r$r%r&�objectr!rr
r
r
r�<module>s__pycache__/this.cpython-38.opt-1.pyc000064400000002357151153537560013334 0ustar00U

e5d��@s\dZiZdD]2Zed�D]$Zeedde�eeee�<qqed�dd�eD���dS)aXGur Mra bs Clguba, ol Gvz Crgref

Ornhgvshy vf orggre guna htyl.
Rkcyvpvg vf orggre guna vzcyvpvg.
Fvzcyr vf orggre guna pbzcyrk.
Pbzcyrk vf orggre guna pbzcyvpngrq.
Syng vf orggre guna arfgrq.
Fcnefr vf orggre guna qrafr.
Ernqnovyvgl pbhagf.
Fcrpvny pnfrf nera'g fcrpvny rabhtu gb oernx gur ehyrf.
Nygubhtu cenpgvpnyvgl orngf chevgl.
Reebef fubhyq arire cnff fvyragyl.
Hayrff rkcyvpvgyl fvyraprq.
Va gur snpr bs nzovthvgl, ershfr gur grzcgngvba gb thrff.
Gurer fubhyq or bar-- naq cersrenoyl bayl bar --boivbhf jnl gb qb vg.
Nygubhtu gung jnl znl abg or boivbhf ng svefg hayrff lbh'er Qhgpu.
Abj vf orggre guna arire.
Nygubhtu arire vf bsgra orggre guna *evtug* abj.
Vs gur vzcyrzragngvba vf uneq gb rkcynva, vg'f n onq vqrn.
Vs gur vzcyrzragngvba vf rnfl gb rkcynva, vg znl or n tbbq vqrn.
Anzrfcnprf ner bar ubaxvat terng vqrn -- yrg'f qb zber bs gubfr!)�A�a��
�cCsg|]}t�||��qS�)�d�get)�.0�crr�/usr/lib64/python3.8/this.py�
<listcomp>srN)�srr
�range�i�chr�print�joinrrrr�<module>s
$__pycache__/cgi.cpython-38.opt-2.pyc000064400000043303151153537560013124 0ustar00U

&�.e���@sfdZddlmZmZmZddlmZddlZddlZddl	Z
ddlmZddl
mZddlZddlZddlZddd	d
ddd
dddddgZdadadd�Zdd�Zdd�Zdd�Zeadadejdddfdd	�Zd0d d
�Zd!d"�Zd#d�ZGd$d�d�Z Gd%d�d�Z!ejfd&d�Z"d1d'd
�Z#ejfd(d�Z$d)d�Z%d*d�Z&d+d�Z'd,d�Z(d-d.�Z)e*d/k�rbe"�dS)2z2.6�)�StringIO�BytesIO�
TextIOWrapper)�MappingN)�
FeedParser)�Message�MiniFieldStorage�FieldStorage�parse�parse_multipart�parse_header�test�print_exception�
print_environ�
print_form�print_directory�print_arguments�print_environ_usage�cGsFtr,ts,zttd�aWntk
r*YnXts6tantat|�dS)N�a)�logfile�logfp�open�OSError�nolog�log�dolog�Zallargs�r�/usr/lib64/python3.8/cgi.py�initlog8sr cGst�||d�dS)N�
)r�write)Zfmt�argsrrrr[srcGsdS�Nrrrrrr_srcCsdatrt��datadS)Nr)rr�closer rrrrr�closelogcs
r&c
Cs^|dkrtj}t|d�r |j}nd}t|t�r4|j}d|krDd|d<|ddk�rt|d�\}}|dkrxt|||d�S|d	kr�t	|d
�}t
r�|t
kr�td��|�|��
|�}	nd}	d
|kr�|	r�|	d}	|	|d
}	n*tjdd��r|	r�|	d}	|	tjd}	|	|d
<n<d
|k�r |d
}	n(tjdd��r<tjd}	nd}	|	|d
<tjj|	||||d�S)N�encodingzlatin-1�REQUEST_METHOD�GET�POST�CONTENT_TYPEzmultipart/form-data)�	separator�!application/x-www-form-urlencoded�CONTENT_LENGTH�Maximum content length exceededr�QUERY_STRING�&�)r'r,)�sys�stdin�hasattrr'�
isinstancer�bufferrr�int�maxlen�
ValueError�read�decode�argv�urllibr
Zparse_qs)
�fp�environ�keep_blank_values�strict_parsingr,r'�ctype�pdictZclength�qsrrrr
vsL




��utf-8�replacer1csx|d�d�}d�|�}t�}|�|�z|d|d<Wntk
rLYnXt||||ddi|d���fd	d
��D�S)N�boundary�asciiz multipart/form-data; boundary={}zCONTENT-LENGTHzContent-Lengthr(r*)�headersr'�errorsr@r,csi|]}|��|��qSr)�getlist)�.0�k�Zfsrr�
<dictcomp>�sz#parse_multipart.<locals>.<dictcomp>)r<�formatrZset_type�KeyErrorr	)r?rDr'rKr,rHrCrJrrOrr�s


�ccs�|dd�dkr�|dd�}|�d�}|dkr`|�dd|�|�dd|�dr`|�d|d�}q&|dkrpt|�}|d|�}|��V||d�}qdS)Nr2�;r�"�\"�)�find�count�len�strip)�s�end�frrr�_parseparam�s
(
r^cCs�td|�}|��}i}|D]�}|�d�}|dkr|d|�����}||dd���}t|�dkr�|d|dkr�dkr�nn |dd�}|�dd	��d
d�}|||<q||fS)NrS�=rr2rV���rTz\\�\rU)r^�__next__rWrZ�lowerrYrG)�line�parts�keyrD�p�i�name�valuerrrr�s
,
c@s<eZdZdZdZdZdZiZdZiZ	iZ
dd�Zdd�ZdS)rNcCs||_||_dSr$�rirj��selfrirjrrr�__init__	szMiniFieldStorage.__init__cCsd|j|jfS)NzMiniFieldStorage(%r, %r)rk�rmrrr�__repr__szMiniFieldStorage.__repr__)
�__name__�
__module__�__qualname__�filename�list�type�file�type_options�disposition�disposition_optionsrJrnrprrrrr�sc@s�eZdZdddejdddddddfdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zd9dd�Z
d:dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�ZdZd&d'�Zd(d)�Zd*Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�ZdS);r	N�rrFrGcCsZd}||_||_|
|_||_d|kr0|d��}d|_|dksF|dkr�d|krX|d}
ntjdd�rrtjd}
nd}
|
�t	�
�d�}
t|
�}|dkr�dd	i}|dkr�i}|d
kr�d	|d<d|kr�|d|d<d|kr�|d|_d|kr�|d|d
<nt|t
tf��std��||_|dk�r*tjj|_n<t|t��r@|j|_n&t|d��rXt|d��s`td��||_||_|	|_t|t��s�tdt|�j��||_d|_||_di}}d|jk�r�t|jd�\}}||_||_ d|_!d|k�r�|d|_!d|_"d|k�r
|d|_"|j"dk	|_#d|jk�r6t|jd�\}}n(|j�sH|d
k�rTdi}}n
d	i}}||_||_$d|k�r�|d�|j|j�|_%nd|_%d}d
|jk�r�zt&|jd
�}Wnt'k
�r�YnXt(�r�|t(k�r�t'd��||_)|jdk�r|dk�r||_d|_*|_+d|_,|d	k�r,|�-�n*|dd�dk�rN|�.|||�n|�/�dS)Nr)r(ZHEADr0r2r�surrogateescapezcontent-typer-r*r+r.�content-lengthz?headers must be mapping or an instance of email.message.Messager;�readlinezfp must be file pointerz#outerboundary must be bytes, not %srzcontent-dispositionrirtz
text/plainrHr{r`r/�
z
multipart/)0rArB�max_num_fieldsr,�upper�
qs_on_postr3r=�encode�localeZgetpreferredencodingrr6rr�	TypeErrorrJr4r7r?rr5r'rK�bytesrvrq�
outerboundary�
bytes_read�limitrryrzrirt�_binary_filerx�
innerboundaryr8r:r9�lengthrurw�done�read_urlencoded�
read_multi�read_single)rmr?rJr�r@rArBr�r'rKr�r,�methodrEZcdisprDrCZclenrrrrn?s�/
�


�






�

zFieldStorage.__init__cCs(z|j��Wntk
r"YnXdSr$)rwr%�AttributeErrorrorrr�__del__�szFieldStorage.__del__cCs|Sr$rrorrr�	__enter__�szFieldStorage.__enter__cGs|j��dSr$)rwr%)rmr#rrr�__exit__�szFieldStorage.__exit__cCsd|j|j|jfS)NzFieldStorage(%r, %r, %r))rirtrjrorrrrp�s
�zFieldStorage.__repr__cCst|���Sr$)�iter�keysrorrr�__iter__�szFieldStorage.__iter__cCsT|dkrt|��|jr:|j�d�|j��}|j�d�n|jdk	rL|j}nd}|S)Nrjr)r�rw�seekr;rurlrrr�__getattr__�s

zFieldStorage.__getattr__cCs^|jdkrtd��g}|jD]}|j|kr|�|�q|sBt|��t|�dkrV|dS|SdS)N�
not indexabler2r)rur�ri�appendrRrY)rmrf�found�itemrrr�__getitem__s


zFieldStorage.__getitem__cCs8||kr0||}t|t�r(dd�|D�S|jSn|SdS)NcSsg|]
}|j�qSr�rj�rM�xrrr�
<listcomp>sz)FieldStorage.getvalue.<locals>.<listcomp>�r6rurj�rmrf�defaultrjrrr�getvalues
zFieldStorage.getvaluecCs4||kr,||}t|t�r$|djS|jSn|SdS�Nrr�r�rrr�getfirsts

zFieldStorage.getfirstcCs:||kr2||}t|t�r(dd�|D�S|jgSngSdS)NcSsg|]
}|j�qSrr�r�rrrr�.sz(FieldStorage.getlist.<locals>.<listcomp>r�)rmrfrjrrrrL)s

zFieldStorage.getlistcCs*|jdkrtd��ttdd�|jD���S)Nr�css|]}|jVqdSr$�ri�rMr�rrr�	<genexpr>8sz$FieldStorage.keys.<locals>.<genexpr>)rur��setrorrrr�4s
zFieldStorage.keyscs*|jdkrtd��t�fdd�|jD��S)Nr�c3s|]}|j�kVqdSr$r�r��rfrrr�>sz,FieldStorage.__contains__.<locals>.<genexpr>)rur��any)rmrfrr�r�__contains__:s
zFieldStorage.__contains__cCst|���Sr$)rYr�rorrr�__len__@szFieldStorage.__len__cCs|jdkrtd��t|j�S)NzCannot be converted to bool.)rur��boolrorrr�__bool__Ds
zFieldStorage.__bool__c	Cs�|j�|j�}t|t�s0td|jt|�jf��|�|j	|j
�}|jrT|d|j7}tj
j||j|j|j	|j
|j|jd�}dd�|D�|_|��dS)N�%s should return bytes, got %sr1�r'rKr�r,cSsg|]\}}t||��qSr�r�rMrfrjrrrr�Vsz0FieldStorage.read_urlencoded.<locals>.<listcomp>)r?r;r�r6r�r:rvrqr<r'rKr�r>r
�	parse_qslrArBr�r,ru�
skip_lines)rmrE�queryrrrr�Is&
��zFieldStorage.read_urlencodedcCsL|j}t|�std|f��g|_|jrftjj|j|j|j	|j
|j|j|j
d�}|j�dd�|D��|jpp|j}|j��}t|t�s�td|jt|�jf��|jt|�7_|��d|jkr�|r�|j��}|jt|�7_q�|j}|dk	�r|t|j�8}t�}	d}
|j��}|
|7}
|���s�q0�q|
�s:�q@|jt|
�7_|	�|
�|j
|j��|	��}d|k�rz|d=|jdk�r�dn
|j|j}
||j||||||
|j
|j||j
�}|dk	�r�|d	8}|j�r�|t|j�8}|d
k�r�td��|j|j7_|j�|�|j �s@|j|j!k�r4d
k�rnn�q@�q|�"�dS)Nz&Invalid boundary in multipart form: %rr�css|]\}}t||�VqdSr$r�r�rrrr�fsz*FieldStorage.read_multi.<locals>.<genexpr>r��--r{r}r2rzMax number of fields exceeded)#r��valid_boundaryr:rur�r>r
r�rArBr'rKr�r,�extend�FieldStorageClass�	__class__r?r~r6r�rvrqr�rYrZrZfeedr<r%r�r�r�r�r�)rmr@rArBZibr��klassZ
first_liner��parserZhdr_text�datarJr��partrrrr�[s��

��





��

(zFieldStorage.read_multicCs4|jdkr|��|��n|��|j�d�dSr�)r��read_binaryr��
read_linesrwr�rorrrr��s


zFieldStorage.read_singlei cCs�|��|_|j}|dkr�|dkr�|j�t||j��}t|t�sVt	d|jt
|�jf��|jt
|�7_|std|_q�|j�|�|t
|�}qdS)Nrr�r`)�	make_filerwr�r?r;�min�bufsizer6r�r:rvrqr�rYr�r")rmZtodor�rrrr��s

�zFieldStorage.read_binarycCs@|jrt�|_|_nt�|_|_|jr4|��n|��dSr$)r�rrw�_FieldStorage__filerr��read_lines_to_outerboundary�read_lines_to_eofrorrrr��s
zFieldStorage.read_linescCsv|jdk	rF|j��t|�dkrF|��|_|j��}|j�|�d|_|jrZ|j�|�n|j�|�|j	|j
��dS)Ni�)r��tellrYr�rwr�r"r�r<r'rK)rmrdr�rrrZ__write�s


zFieldStorage.__writecCs:|j�d�}|jt|�7_|s*d|_q6|�|�qdS)N�r`)r?r~r�rYr��_FieldStorage__write)rmrdrrrr��szFieldStorage.read_lines_to_eofc	CsJd|j}|d}d}d}d}|jdk	rFd|jkr>|krFnn�qF|j�d�}|jt|�7_|t|�7}|s~d|_�qF|dkr�||}d}|�d�r�|r�|��}||kr��qF||kr�d|_�qF|}|�	d	�r�d	}|dd
�}d}nL|�	d��rd}|dd�}d}n*|�	d��r.d}|dd�}d}nd}d}|�
||�qdS)
Nr�r{Trr�r`�
r2s
����
F)r�r�r?r~r�rYr��
startswith�rstrip�endswithr�)	rm�
next_boundary�
last_boundaryZdelim�last_line_lfendZ_readrd�strippedlineZodelimrrrr��sN
$
z(FieldStorage.read_lines_to_outerboundarycCs�|jr|jrdSd|j}|d}d}|j�d�}|jt|�7_|sPd|_q�|�d�r�|r�|��}||krpq�||kr�d|_q�|�d�}q&dS)Nr�Tr�r`r2r�)r�r�r?r~r�rYr�rZ)rmr�r�r�rdr�rrrr�s$
zFieldStorage.skip_linescCs&|jrt�d�Stjd|jdd�SdS)Nzwb+zw+r!)r'�newline)r��tempfileZ
TemporaryFiler'rorrrr�(s
�zFieldStorage.make_file)N)N) rqrrrs�osr@rnr�r�r�rpr�r�r�r�r�rLr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr	sJ+�
&


E	
2cCs�td�t�tjt_zNt�}t�t�t|�t|�t	�dd�}|fdd�}td�|�Wnt
�YnXtd�daz&t�}t�t�t|�t|�Wnt
�YnXdS)	NzContent-type: text/htmlcSstd�dS)Nz,testing print_exception() -- <I>italics?</I>)�execrrrrr][sztest.<locals>.fcSs
|�dSr$r)r]rrr�g]sztest.<locals>.gz9<H3>What follows is a test, not an actual exception:</H3>z*<H1>Second try with a small maxlen...</H1>�2)�printr3�stdout�stderrr	rrrrrrr9)r@�formr]r�rrrr
Js4
c	Csx|dkrt��\}}}ddl}t�td�|�||�|�||�}tdt�d�|dd���t�|d�f�~dS)Nrz+<H3>Traceback (most recent call last):</H3>z<PRE>%s<B>%s</B></PRE>rr`)	r3�exc_info�	tracebackr��	format_tb�format_exception_only�html�escape�join)rvrj�tbr�r�rurrrrqs

��c	Cs\t|���}t�td�td�|D]"}tdt�|�dt�||��q&td�t�dS)Nz<H3>Shell Environment:</H3>�<DL>�<DT>�<DD>�</DL>)�sortedr�r�r�r�)r@r�rfrrrrs cCs�t|���}t�td�|s&td�td�|D]Z}tdt�|�ddd�||}tdt�tt|���d	�td
t�t|���q2td�t�dS)Nz<H3>Form Contents:</H3>z<P>No form fields.r�r��:� )r\z<i>z</i>r�r�)r�r�r�r�r��reprrv)r�r�rfrjrrrr�sc
Csjt�td�zt��}Wn6tk
rP}ztdt�t|���W5d}~XYnXtt�|��t�dS)Nz#<H3>Current Working Directory:</H3>zOSError:)r�r��getcwdrr�r��str)�pwd�msgrrrr�s&cCs(t�td�t�ttj�t�dS)Nz <H3>Command Line Arguments:</H3>)r�r3r=rrrrr�s

cCstd�dS)Na�
<H3>These environment variables could have been set:</H3>
<UL>
<LI>AUTH_TYPE
<LI>CONTENT_LENGTH
<LI>CONTENT_TYPE
<LI>DATE_GMT
<LI>DATE_LOCAL
<LI>DOCUMENT_NAME
<LI>DOCUMENT_ROOT
<LI>DOCUMENT_URI
<LI>GATEWAY_INTERFACE
<LI>LAST_MODIFIED
<LI>PATH
<LI>PATH_INFO
<LI>PATH_TRANSLATED
<LI>QUERY_STRING
<LI>REMOTE_ADDR
<LI>REMOTE_HOST
<LI>REMOTE_IDENT
<LI>REMOTE_USER
<LI>REQUEST_METHOD
<LI>SCRIPT_NAME
<LI>SERVER_NAME
<LI>SERVER_PORT
<LI>SERVER_PROTOCOL
<LI>SERVER_ROOT
<LI>SERVER_SOFTWARE
</UL>
In addition, HTTP headers sent by the server may be passed in the
environment as well.  Here are some common variable names:
<UL>
<LI>HTTP_ACCEPT
<LI>HTTP_CONNECTION
<LI>HTTP_HOST
<LI>HTTP_PRAGMA
<LI>HTTP_REFERER
<LI>HTTP_USER_AGENT
</UL>
)r�rrrrr�scCs(ddl}t|t�rd}nd}|�||�S)Nrs^[ -~]{0,200}[!-~]$z^[ -~]{0,200}[!-~]$)�rer6r��match)r[r�Z_vb_patternrrrr��s

r��__main__)rFrGr1)NNNN)+�__version__�iorrrZcollections.abcrr3r�Zurllib.parser>Zemail.parserrZ
email.messagerr�r�r��__all__rrr rrr&rr9r@r
rr^rrr	r
rrrrrrr�rqrrrr�<module>sf�#	�
F
:'
/
__pycache__/poplib.cpython-38.pyc000064400000032225151153537560012710 0ustar00U

e5d�:�@sldZddlZddlZddlZddlZzddlZdZWnek
rLdZYnXddgZGdd�de	�Z
dZd	Zd
Z
dZe
eZdZGd
d�d�Zer�Gdd�de�Ze�d�edk�rhddlZeejd�Zee���e�ejd�e�ejd�e��e��\ZZeded�D]BZ e�!e �\Z"Z#Z$ede �e#D]Z%ede%��q@ed��qe�&�dS)z@A POP3 client class.

Based on the J. Myers POP3 draft, Jan. 96
�NTF�POP3�error_protoc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/poplib.pyrs�ni��
�
ic@seZdZdZdZeejfdd�Zdd�Z	dd�Z
d	d
�Zdd�Zd
d�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd=d d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Ze�d0�Z d1d2�Z!d3d4�Z"d>d5d6�Z#d7d8�Z$d9d:�Z%d?d;d<�Z&dS)@raPThis class supports both the minimal and optional command sets.
    Arguments can be strings or integers (where appropriate)
    (e.g.: retr(1) and retr('1') both work equally well.

    Minimal Command Set:
            USER name               user(name)
            PASS string             pass_(string)
            STAT                    stat()
            LIST [msg]              list(msg = None)
            RETR msg                retr(msg)
            DELE msg                dele(msg)
            NOOP                    noop()
            RSET                    rset()
            QUIT                    quit()

    Optional Commands (some servers support these):
            RPOP name               rpop(name)
            APOP name digest        apop(name, digest)
            TOP msg n               top(msg, n)
            UIDL [msg]              uidl(msg = None)
            CAPA                    capa()
            STLS                    stls()
            UTF8                    utf8()

    Raises one exception: 'error_proto'.

    Instantiate with:
            POP3(hostname, port=110)

    NB:     the POP protocol locks the mailbox from user
            authorization until QUIT, so be sure to get in, suck
            the messages, and quit, each time you access the
            mailbox.

            POP is a line-based protocol, which means large mail
            messages consume lots of python cycles reading them
            line-by-line.

            If it's available on your mail server, use IMAP4
            instead, it doesn't suffer from the two problems
            above.
    zUTF-8cCsP||_||_d|_t�d|||�|�|�|_|j�d�|_d|_	|�
�|_dS)NFzpoplib.connect�rbr)�host�port�_tls_established�sys�audit�_create_socket�sock�makefile�file�
_debugging�_getresp�welcome)�selfr
r�timeoutrrr�__init__bsz
POP3.__init__cCst�|j|jf|�S�N)�socketZcreate_connectionr
r)rrrrrrmszPOP3._create_socketcCs:|jdkrtdt|��t�d||�|j�|t�dS)N�z*put*zpoplib.putline)r�print�reprrrrZsendall�CRLF�r�linerrr�_putlineps
z
POP3._putlinecCs.|jrtdt|��t||j�}|�|�dS)Nz*cmd*)rrr �bytes�encodingr$r"rrr�_putcmdxszPOP3._putcmdcCs�|j�td�}t|�tkr$td��|jdkr<tdt|��|sHtd��t|�}|dd�tkrp|dd�|fS|dd�t	kr�|dd�|fS|dd�|fS)Nrz
line too longz*get*z-ERR EOF������)
r�readline�_MAXLINE�lenrrrr r!�CR)rr#�octetsrrr�_getline�s
z
POP3._getlinecCs:|��\}}|jdkr$tdt|��|�d�s6t|��|S)Nrz*resp*�+)r/rrr �
startswithr)r�resp�orrrr�s

z
POP3._getrespcCsl|��}g}d}|��\}}|dkrb|�d�rB|d}|dd�}||}|�|�|��\}}q|||fS)Nr�.s..r)rr/r1�append)rr2�listr.r#r3rrr�_getlongresp�s

zPOP3._getlongrespcCs|�|�|��Sr)r'rr"rrr�	_shortcmd�s
zPOP3._shortcmdcCs|�|�|��Sr)r'r7r"rrr�_longcmd�s
z
POP3._longcmdcCs|jSr)r�rrrr�
getwelcome�szPOP3.getwelcomecCs
||_dSr)r)r�levelrrr�set_debuglevel�szPOP3.set_debuglevelcCs|�d|�S)zVSend user name, return response

        (should indicate password required).
        zUSER %s�r8�r�userrrrr@�sz	POP3.usercCs|�d|�S)z�Send password, return response

        (response includes message count, mailbox size).

        NB: mailbox is locked by server from here to 'quit()'
        zPASS %sr>)rZpswdrrr�pass_�sz
POP3.pass_cCsF|�d�}|��}|jr&tdt|��t|d�}t|d�}||fS)z]Get mailbox status.

        Result is tuple of 2 ints (message count, mailbox size)
        ZSTATz*stat*r�)r8�splitrrr �int)rZretvalZretsZnumMessagesZsizeMessagesrrr�stat�s
z	POP3.statNcCs |dk	r|�d|�S|�d�S)aRequest listing, return result.

        Result without a message number argument is in form
        ['response', ['mesg_num octets', ...], octets].

        Result when a message number argument is given is a
        single response: the "scan listing" for that message.
        NzLIST %sZLIST�r8r9�r�whichrrrr6�s	z	POP3.listcCs|�d|�S)zoRetrieve whole message number 'which'.

        Result is in form ['response', ['line', ...], octets].
        zRETR %s�r9rGrrr�retr�sz	POP3.retrcCs|�d|�S)zFDelete message number 'which'.

        Result is 'response'.
        zDELE %sr>rGrrr�dele�sz	POP3.delecCs
|�d�S)zXDoes nothing.

        One supposes the response indicates the server is alive.
        ZNOOPr>r:rrr�noopsz	POP3.noopcCs
|�d�S)z(Unmark all messages marked for deletion.ZRSETr>r:rrr�rsetsz	POP3.rsetcCs|�d�}|��|S)zDSignoff: commit changes on server, unlock mailbox, close connection.ZQUIT)r8�close)rr2rrr�quits
z	POP3.quitcCs�z |j	}d|_	|dk	r|��W5|j}d|_|dk	r�zVz|�tj�Wn@tk
r�}z"|jtjkrxt|dd�dkrx�W5d}~XYnXW5|��XXdS)z8Close the connection without assuming anything about it.NZwinerrorri&')
rrNZshutdownrZ	SHUT_RDWR�OSError�errnoZENOTCONN�getattrr)rr�excrrrrrNs �z
POP3.closecCs|�d|�S)zNot sure what this does.zRPOP %sr>r?rrr�rpop5sz	POP3.rpops\+OK.[^<]*(<.*>)cCs\t||j�}|j�|j�}|s&td��ddl}|�d�|}|�|��	�}|�
d||f�S)aAuthorisation

        - only possible if server has supplied a timestamp in initial greeting.

        Args:
                user     - mailbox user;
                password - mailbox password.

        NB: mailbox is locked by server from here to 'quit()'
        z!-ERR APOP not supported by serverrNrz
APOP %s %s)r%r&�	timestamp�matchrr�hashlib�groupZmd5Z	hexdigestr8)rr@ZpasswordZsecret�mrWZdigestrrr�apop<sz	POP3.apopcCs|�d||f�S)z�Retrieve message header of message number 'which'
        and first 'howmuch' lines of message body.

        Result is in form ['response', ['line', ...], octets].
        z	TOP %s %srI)rrHZhowmuchrrr�topQszPOP3.topcCs |dk	r|�d|�S|�d�S)z�Return message digest (unique id) list.

        If 'which', result contains unique id for that message
        in the form 'response mesgnum uid', otherwise result is
        the list ['response', ['mesgnum uid', ...], octets]
        NzUIDL %sZUIDLrFrGrrr�uidlZsz	POP3.uidlcCs
|�d�S)zITry to enter UTF-8 mode (see RFC 6856). Returns server response.
        ZUTF8r>r:rrr�utf8fsz	POP3.utf8c	
Cspdd�}i}z4|�d�}|d}|D]}||�\}}|||<q$Wn*tk
rj}ztd��W5d}~XYnX|S)aReturn server capabilities (RFC 2449) as a dictionary
        >>> c=poplib.POP3('localhost')
        >>> c.capa()
        {'IMPLEMENTATION': ['Cyrus', 'POP3', 'server', 'v2.2.12'],
         'TOP': [], 'LOGIN-DELAY': ['0'], 'AUTH-RESP-CODE': [],
         'EXPIRE': ['NEVER'], 'USER': [], 'STLS': [], 'PIPELINING': [],
         'UIDL': [], 'RESP-CODES': []}
        >>>

        Really, according to RFC 2449, the cyrus folks should avoid
        having the implementation split into multiple arguments...
        cSs"|�d���}|d|dd�fS)N�asciirr)�decoderC)r#Zlstrrr�	_parsecapyszPOP3.capa.<locals>._parsecapZCAPArz!-ERR CAPA not supported by serverN)r9r)	rr`�capsr2ZrawcapsZcaplineZcapnmZcapargsZ_errrrr�capals

z	POP3.capacCsxtstd��|jrtd��|��}d|kr2td��|dkrBt��}|�d�}|j|j|j	d�|_|j�
d�|_d|_|S)	z{Start a TLS session on the active connection as specified in RFC 2595.

                context - a ssl.SSLContext
        z-ERR TLS support missing�$-ERR TLS session already establishedZSTLSz!-ERR STLS not supported by serverN�Zserver_hostnamerT)�HAVE_SSLrrrb�ssl�_create_stdlib_contextr8�wrap_socketrr
rr)r�contextrar2rrr�stls�s 
�z	POP3.stls)N)N)N)'rrr�__doc__r&�	POP3_PORTr�_GLOBAL_DEFAULT_TIMEOUTrrr$r'r/rr7r8r9r;r=r@rArEr6rJrKrLrMrOrNrT�re�compilerUrZr[r\r]rbrjrrrrr3sB+�





	
c@s8eZdZdZeddejdfdd�Zdd�Zd	dd�Z	dS)
�POP3_SSLaPOP3 client class over SSL connection

        Instantiate with: POP3_SSL(hostname, port=995, keyfile=None, certfile=None,
                                   context=None)

               hostname - the hostname of the pop3 over ssl server
               port - port number
               keyfile - PEM formatted file that contains your private key
               certfile - PEM formatted certificate chain file
               context - a ssl.SSLContext

        See the methods of the parent class POP3 for more documentation.
        NcCs�|dk	r|dk	rtd��|dk	r0|dk	r0td��|dk	s@|dk	rVddl}|�dtd�||_||_|dkrxtj||d�}||_t	�
||||�dS)Nz4context and keyfile arguments are mutually exclusivez5context and certfile arguments are mutually exclusiverzAkeyfile and certfile are deprecated, use a custom context insteadrB)�certfile�keyfile)�
ValueError�warnings�warn�DeprecationWarningrrrqrfrgrirr)rr
rrrrqrrirtrrrr�s$��zPOP3_SSL.__init__cCs"t�||�}|jj||jd�}|S)Nrd)rrrirhr
)rrrrrrr�s
�zPOP3_SSL._create_socketcCstd��dS)z�The method unconditionally raises an exception since the
            STLS command doesn't make any sense on an already established
            SSL/TLS session.
            rcN)r)rrrrqrirrrrj�sz
POP3_SSL.stls)NNN)
rrrrk�
POP3_SSL_PORTrrmrrrjrrrrrp�s�
rp�__main__rrB�zMessage %d:z   z-----------------------)'rkrQrnrrrfre�ImportError�__all__�	Exceptionrrlrwr-ZLFr!r+rrpr5r�argv�arr;r@rAr6rEZnumMsgsZ	totalSize�range�irJ�header�msgr.r#rOrrrr�<module>sL
n0

__pycache__/queue.cpython-38.opt-1.pyc000064400000024604151153537560013510 0ustar00U

e5d\,�@sdZddlZddlmZddlmZmZddlmZzddl	m
Z
Wnek
r\dZ
YnXddd	d
ddgZzdd
l	m
Z
Wn$ek
r�Gdd�de�Z
YnXGdd�de�ZGdd	�d	�ZGdd
�d
e�ZGdd�de�ZGdd�d�Ze
dkr�eZ
dS)z'A multi-producer, multi-consumer queue.�N)�deque)�heappush�heappop)�	monotonic)�SimpleQueue�Empty�Full�Queue�
PriorityQueue�	LifoQueuer)rc@seZdZdZdS)rz4Exception raised by Queue.get(block=0)/get_nowait().N��__name__�
__module__�__qualname__�__doc__�rr�/usr/lib64/python3.8/queue.pyrsc@seZdZdZdS)rz4Exception raised by Queue.put(block=0)/put_nowait().Nrrrrrrsc@s�eZdZdZd!dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	d"dd�Z
d#dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd �ZdS)$r	zjCreate a queue object with a given maximum size.

    If maxsize is <= 0, the queue size is infinite.
    rcCsN||_|�|�t��|_t�|j�|_t�|j�|_t�|j�|_d|_	dS�Nr)
�maxsize�_init�	threadingZLock�mutexZ	Condition�	not_empty�not_full�all_tasks_done�unfinished_tasks��selfrrrr�__init__!s

zQueue.__init__c	CsH|j�8|jd}|dkr4|dkr*td��|j��||_W5QRXdS)a.Indicate that a formerly enqueued task is complete.

        Used by Queue consumer threads.  For each get() used to fetch a task,
        a subsequent call to task_done() tells the queue that the processing
        on the task is complete.

        If a join() is currently blocking, it will resume when all items
        have been processed (meaning that a task_done() call was received
        for every item that had been put() into the queue).

        Raises a ValueError if called more times than there were items
        placed in the queue.
        �rz!task_done() called too many timesN)rr�
ValueErrorZ
notify_all)rZ
unfinishedrrr�	task_done8s

zQueue.task_donec	Cs(|j�|jr|j��qW5QRXdS)a�Blocks until all items in the Queue have been gotten and processed.

        The count of unfinished tasks goes up whenever an item is added to the
        queue. The count goes down whenever a consumer thread calls task_done()
        to indicate the item was retrieved and all work on it is complete.

        When the count of unfinished tasks drops to zero, join() unblocks.
        N)rr�wait�rrrr�joinNs	z
Queue.joinc
Cs&|j�|��W5QR�SQRXdS)�9Return the approximate size of the queue (not reliable!).N�r�_qsizer#rrr�qsize[szQueue.qsizec
Cs(|j�|��W5QR�SQRXdS)a�Return True if the queue is empty, False otherwise (not reliable!).

        This method is likely to be removed at some point.  Use qsize() == 0
        as a direct substitute, but be aware that either approach risks a race
        condition where a queue can grow before the result of empty() or
        qsize() can be used.

        To create code that needs to wait for all queued tasks to be
        completed, the preferred technique is to use the join() method.
        Nr&r#rrr�empty`szQueue.emptyc
Cs<|j�,d|jko |��knW5QR�SQRXdS)aOReturn True if the queue is full, False otherwise (not reliable!).

        This method is likely to be removed at some point.  Use qsize() >= n
        as a direct substitute, but be aware that either approach risks a race
        condition where a queue can shrink before the result of full() or
        qsize() can be used.
        rN)rrr'r#rrr�fullnsz
Queue.fullTNc	Cs�|j��|jdkr�|s*|��|jkr�t�nr|dkrN|��|jkr�|j��q2nN|dkr`td��n<t�|}|��|jkr�|t�}|dkr�t�|j�|�qj|�|�|jd7_|j	�
�W5QRXdS)aPut an item into the queue.

        If optional args 'block' is true and 'timeout' is None (the default),
        block if necessary until a free slot is available. If 'timeout' is
        a non-negative number, it blocks at most 'timeout' seconds and raises
        the Full exception if no free slot was available within that time.
        Otherwise ('block' is false), put an item on the queue if a free slot
        is immediately available, else raise the Full exception ('timeout'
        is ignored in that case).
        rN�''timeout' must be a non-negative number�r)rrr'rr"r �time�_putrr�notify)r�item�block�timeout�endtime�	remainingrrr�putys&




z	Queue.putc
Cs�|j��|s|��s�t�nf|dkr8|��s�|j��q"nH|dkrJtd��n6t�|}|��s�|t�}|dkrrt�|j�|�qT|��}|j��|W5QR�SQRXdS)�Remove and return an item from the queue.

        If optional args 'block' is true and 'timeout' is None (the default),
        block if necessary until an item is available. If 'timeout' is
        a non-negative number, it blocks at most 'timeout' seconds and raises
        the Empty exception if no item was available within that time.
        Otherwise ('block' is false), return an item if one is immediately
        available, else raise the Empty exception ('timeout' is ignored
        in that case).
        Nrr+r,)	rr'rr"r r-�_getrr/)rr1r2r3r4r0rrr�get�s$



z	Queue.getcCs|j|dd�S)z�Put an item into the queue without blocking.

        Only enqueue the item if a free slot is immediately available.
        Otherwise raise the Full exception.
        F�r1�r5�rr0rrr�
put_nowait�szQueue.put_nowaitcCs|jdd�S�z�Remove and return an item from the queue without blocking.

        Only get an item if one is immediately available. Otherwise
        raise the Empty exception.
        Fr9�r8r#rrr�
get_nowait�szQueue.get_nowaitcCst�|_dS�N)r�queuerrrrr�szQueue._initcCs
t|j�Sr@��lenrAr#rrrr'�szQueue._qsizecCs|j�|�dSr@�rA�appendr;rrrr.�sz
Queue._putcCs
|j��Sr@)rA�popleftr#rrrr7�sz
Queue._get)r)TN)TN)r
rrrrr!r$r(r)r*r5r8r<r?rr'r.r7rrrrr	s


 

c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r
z�Variant of Queue that retrieves open entries in priority order (lowest first).

    Entries are typically tuples of the form:  (priority number, data).
    cCs
g|_dSr@�rArrrrr�szPriorityQueue._initcCs
t|j�Sr@rBr#rrrr'�szPriorityQueue._qsizecCst|j|�dSr@)rrAr;rrrr.�szPriorityQueue._putcCs
t|j�Sr@)rrAr#rrrr7�szPriorityQueue._getN�r
rrrrr'r.r7rrrrr
�s
c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)rzBVariant of Queue that retrieves most recently added entries first.cCs
g|_dSr@rGrrrrr�szLifoQueue._initcCs
t|j�Sr@rBr#rrrr'�szLifoQueue._qsizecCs|j�|�dSr@rDr;rrrr.�szLifoQueue._putcCs
|j��Sr@)rA�popr#rrrr7�szLifoQueue._getNrHrrrrr�s
c@sLeZdZdZdd�Zddd�Zddd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dS)�_PySimpleQueuezYSimple, unbounded FIFO queue.

    This pure Python implementation is not reentrant.
    cCst�|_t�d�|_dSr)r�_queuerZ	Semaphore�_countr#rrrr	sz_PySimpleQueue.__init__TNcCs|j�|�|j��dS)z�Put the item on the queue.

        The optional 'block' and 'timeout' arguments are ignored, as this method
        never blocks.  They are provided for compatibility with the Queue class.
        N)rKrErL�release)rr0r1r2rrrr5
sz_PySimpleQueue.putcCs4|dk	r|dkrtd��|j�||�s*t�|j��S)r6Nrr+)r rL�acquirerrKrF)rr1r2rrrr8s
z_PySimpleQueue.getcCs|j|dd�S)z�Put an item into the queue without blocking.

        This is exactly equivalent to `put(item)` and is only provided
        for compatibility with the Queue class.
        Fr9r:r;rrrr<'sz_PySimpleQueue.put_nowaitcCs|jdd�Sr=r>r#rrrr?/sz_PySimpleQueue.get_nowaitcCst|j�dkS)zCReturn True if the queue is empty, False otherwise (not reliable!).r�rCrKr#rrrr)7sz_PySimpleQueue.emptycCs
t|j�S)r%rOr#rrrr(;sz_PySimpleQueue.qsize)TN)TN)r
rrrrr5r8r<r?r)r(rrrrrJ�s	
	
rJ)rr�collectionsr�heapqrrr-rrKr�ImportError�__all__r�	Exceptionrr	r
rrJrrrr�<module>s*
BA__pycache__/_sysconfigdata__linux_x86_64-linux-gnu.cpython-38.opt-1.pyc000064400000070732151153537560021704 0ustar00U

��.en���@s`dddddddddddddd	dd
ddd
dddddddddddddddddddddddddd d!d"d#dddd$d%dd&d'd(d$d)dddd*d+dddddddd,d$d$d$d$dd$dd$d$d$d$d$dddddddddd$dd$d$d$d$d$d$d$d$dd$d$d$d$d$dd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$dd$d$d$dd$dd$dd$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$d$d$dd$d$d$d$d$d$dd$d$d$d$dd$d$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$d$d$dd$ddd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$dd$d$d$d$dd$d$d$d$d$ddd$d$dd$dddd$d$d$ddd$d$dddd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$d$d$dd$d$dd$d$dd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$dd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$dd$d$d$d$d$d$dd$d$d$d$d$d$d$d$ddd$d$d$dd$d$ddd$d$d$d$d$d$d$dddddd$dd$d$dddddd$ddd$d$d$d$d$d$d$d$d$d$d$ddd$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$d$ddd$d$d$d$ddd$d$d$ddd$dd$d$d$d$d$d$d$d$d$d$d$d$d$d$ddd-ddd.d/d.d.d0d1d2dd3d4d5dd	d6ddd7dd8d9dd:d;dd<ddd=d>d?d@ddd)ddAdBddCdddd
dd$dDdEdFdGdddHddIdJd$dKddddLdMdddddddddNdOdPdddQd$d$dRdd
ddSddddTdUdddVddWd$dXdYddZd4d[d\dd]dd$ddd^d_d`dadbd7ddcddd=ded$dddfdgdhdgdfdhdfdfdgdgdfd\dfdfdfdfdgd$didjdkd$dldmddnd8d$dddddoddpdqdd$ddddrd$d6dsd$d$d$d$dddd$d$ddtdudsdvdwdwdsdx���ZdyS)z��ZarZrcsz!-Wno-unused-result -Wsign-comparez-IObjects -IInclude -IPythonz/usr/binz/usr/lib64/python3.8z-L. -lpython3.8zOgcc -pthread -shared -Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -g�pythonzx86_64-redhat-linux-gnu�\zgcc -pthreadz-fPICa-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapvz?configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.ina-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapvaK-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declarationz-Wl,-z,relro  -Wl,-z,now  -gz�-Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -ga�'--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--enable-ipv6' '--enable-shared' '--with-computed-gotos=yes' '--with-dbmliborder=gdbm:ndbm:bdb' '--with-system-expat' '--with-system-ffi' '--enable-loadable-sqlite-extensions' '--with-dtrace' '--with-lto' '--with-ssl-default-suites=openssl' '--with-valgrind' '--without-ensurepip' '--enable-optimizations' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'CFLAGS= -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv ' 'LDFLAGS= -Wl,-z,relro  -Wl,-z,now  -g ' 'CPPFLAGS=' 'PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'z/usr/includez/usr/include/python3.8zA/builddir/build/BUILD/Python-3.8.17/build/optimized/coverage.infoz?/builddir/build/BUILD/Python-3.8.17/build/optimized/lcov-reportz2--no-branch-coverage --title "CPython lcov report"zN-IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Includezg++ -pthreadzE/usr /usr/lib64 /usr/lib64/python3.8 /usr/lib64/python3.8/lib-dynloadz /usr/lib64/python3.8/lib-dynloadi�zoREADME.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in Include Lib Misc Ext-dummyzInclude Lib Misc Ext-dummyzTREADME.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in�.�z/usr/bin/dtracezInclude/pydtrace_probes.hzPython/pydtrace.ozdynload_shlib.oZnoz.cpython-38-x86_64-linux-gnu.soi�ZyeszG/usr/include /usr/include /usr/include/python3.8 /usr/include/python3.8z/usr/bin/install -cz/usr/bin/install -c -m 644z/usr/bin/install -c -m 755zlibpython3.8.so.1.0zModules/_io/_iomodule.hzg++ -pthread -sharedz:-Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -gzlibpython3.8.soz3.8z
/usr/lib64z-lmzPython/z/usr/lib64/pkgconfigz0/usr/lib64/python3.8/config-3.8-x86_64-linux-gnuzlibpython3.8.az"-lcrypt -lpthread -ldl  -lutil -lmz0tkinter tkinter/test tkinter/test/test_tkinter \Zgccz-Xlinker -export-dynamic�trueZlnZlinuxz5/builddir/build/BUILD/Python-3.8.17/Modules/makesetupz/usr/share/manz/usr/bin/mkdir -pz�posix  errno  pwd  _sre  _codecs  _weakref  _functools  _operator  _collections  _abc  itertools  atexit  _signal  _stat  time  _thread  _locale  _io  faulthandler  _tracemalloc  _symtable  xxsubtypeavModules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  Modules/_sre.o  Modules/_codecsmodule.o  Modules/_weakref.o  Modules/_functoolsmodule.o  Modules/_operator.o  Modules/_collectionsmodule.o  Modules/_abc.o  Modules/itertoolsmodule.o  Modules/atexitmodule.o  Modules/signalmodule.o  Modules/_stat.o  Modules/timemodule.o  Modules/_threadmodule.o  Modules/_localemodule.o  Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o  Modules/faulthandler.o  Modules/_tracemalloc.o Modules/hashtable.o  Modules/symtablemodule.o  Modules/xxsubtype.ozx86_64-linux-gnuz -DMULTIARCH=\"x86_64-linux-gnu\"z-Wl,--no-as-neededz-lssl -lcryptoa:-DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapvz:\ Parser/myreadline.o Parser/parsetok.o Parser/tokenizer.oz-fprofile-generatez"-fprofile-use -fprofile-correctionz
-m test --pgoz
libpython3.sozno-frameworkz./python -Ez	python3.8a-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition  -fprofile-use -fprofile-correction -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPIC -DPy_BUILD_CORE_BUILTINa.-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition  -fprofile-use -fprofile-correction -I/builddir/build/BUILD/Python-3.8.17/Include/internala-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition  -fprofile-use -fprofile-correction -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPIC -DPy_BUILD_COREaT-Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g -lcryptoz"z"a-Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g�a-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition  -fprofile-use -fprofile-correction -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPICz)-x test_subprocess test_io test_lib2to3 \ZreadelfzMac/Resources/frameworkZvoidzCLD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/optimizedz	@SGI_ABI@z/bin/shz.so���zcpython-38-x86_64-linux-gnuz2Parser Objects Python Modules Modules/_io Programsz:/builddir/build/BUILD/Python-3.8.17/Tools/gdb/libpython.pyz"/* Don't use ncurses extensions */z-szInclude Lib MisczLLD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/optimized ./pythonz�LD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/optimized ./python /builddir/build/BUILD/Python-3.8.17/Tools/scripts/run_tests.pyi�zJpython3.8 /builddir/build/BUILD/Python-3.8.17/Tools/scripts/update_file.pyz#/builddir/build/BUILD/Python-3.8.17z)xml xml/dom xml/etree xml/parsers xml/saxz3/builddir/build/BUILD/Python-3.8.17/build/optimizedz
/usr/sharez/usr(�ZABIFLAGSZAC_APPLE_UNIVERSAL_BUILDZAIX_GENUINE_CPLUSPLUSZ	ALT_SOABIZANDROID_API_LEVELZARZARFLAGSZ
BASECFLAGSZBASECPPFLAGSZBASEMODLIBSZBINDIRZ
BINLIBDESTZ
BLDLIBRARYZ	BLDSHAREDZBUILDEXEZBUILDPYTHONZBUILD_GNU_TYPEZBYTESTR_DEPSZCCZCCSHAREDZCFLAGSZCFLAGSFORSHAREDZCFLAGS_ALIASINGZCONFIGFILESZCONFIGURE_CFLAGSZCONFIGURE_CFLAGS_NODISTZCONFIGURE_CPPFLAGSZCONFIGURE_LDFLAGSZCONFIGURE_LDFLAGS_NODISTZCONFIG_ARGSZCONFINCLUDEDIRZ
CONFINCLUDEPYZCOREPYTHONPATHZ
COVERAGE_INFOZCOVERAGE_REPORTZCOVERAGE_REPORT_OPTIONSZCPPFLAGSZCXXZDESTDIRSZDESTLIBZDESTPATHZ
DESTSHAREDZDFLAGSZDIRMODEZDISTZDISTDIRSZ	DISTFILESZ	DLINCLDIRZ
DLLLIBRARYZ"DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754ZDOUBLE_IS_BIG_ENDIAN_IEEE754ZDOUBLE_IS_LITTLE_ENDIAN_IEEE754ZDTRACEZDTRACE_DEPSZDTRACE_HEADERSZDTRACE_OBJSZDYNLOADFILEZENABLE_IPV6Z	ENSUREPIPZEXEZEXEMODEZ
EXTRATESTOPTSZ
EXT_SUFFIXZFILEMODEZFLOAT_WORDS_BIGENDIANZFLOCK_NEEDS_LIBBSDZGETPGRP_HAVE_ARGZGETTIMEOFDAY_NO_TZZ	GITBRANCHZGITTAGZ
GITVERSIONZGNULDZHAVE_ACCEPT4Z
HAVE_ACOSHZ
HAVE_ADDRINFOZ
HAVE_ALARMZHAVE_ALIGNED_REQUIREDZ
HAVE_ALLOCA_HZHAVE_ALTZONEZ
HAVE_ASINHZHAVE_ASM_TYPES_HZ
HAVE_ATANHZHAVE_BIND_TEXTDOMAIN_CODESETZHAVE_BLUETOOTH_BLUETOOTH_HZHAVE_BLUETOOTH_HZHAVE_BROKEN_MBSTOWCSZHAVE_BROKEN_NICEZHAVE_BROKEN_PIPE_BUFZHAVE_BROKEN_POLLZHAVE_BROKEN_POSIX_SEMAPHORESZHAVE_BROKEN_PTHREAD_SIGMASKZHAVE_BROKEN_SEM_GETVALUEZHAVE_BROKEN_UNSETENVZHAVE_BUILTIN_ATOMICZHAVE_CHFLAGSZ
HAVE_CHOWNZHAVE_CHROOTZ
HAVE_CLOCKZHAVE_CLOCK_GETRESZHAVE_CLOCK_GETTIMEZHAVE_CLOCK_SETTIMEZHAVE_COMPUTED_GOTOSZHAVE_CONFSTRZHAVE_CONIO_HZ
HAVE_COPYSIGNZHAVE_COPY_FILE_RANGEZHAVE_CRYPT_HZHAVE_CRYPT_RZHAVE_CTERMIDZHAVE_CTERMID_RZHAVE_CURSES_FILTERZ
HAVE_CURSES_HZHAVE_CURSES_HAS_KEYZHAVE_CURSES_IMMEDOKZHAVE_CURSES_IS_PADZHAVE_CURSES_IS_TERM_RESIZEDZHAVE_CURSES_RESIZETERMZHAVE_CURSES_RESIZE_TERMZHAVE_CURSES_SYNCOKZHAVE_CURSES_TYPEAHEADZHAVE_CURSES_USE_ENVZHAVE_CURSES_WCHGATZHAVE_DECL_ISFINITEZHAVE_DECL_ISINFZHAVE_DECL_ISNANZHAVE_DECL_RTLD_DEEPBINDZHAVE_DECL_RTLD_GLOBALZHAVE_DECL_RTLD_LAZYZHAVE_DECL_RTLD_LOCALZHAVE_DECL_RTLD_MEMBERZHAVE_DECL_RTLD_NODELETEZHAVE_DECL_RTLD_NOLOADZHAVE_DECL_RTLD_NOWZHAVE_DECL_TZNAMEZHAVE_DEVICE_MACROSZHAVE_DEV_PTCZ
HAVE_DEV_PTMXZ
HAVE_DIRECT_HZHAVE_DIRENT_D_TYPEZ
HAVE_DIRENT_HZ
HAVE_DIRFDZHAVE_DLFCN_HZHAVE_DLOPENZ	HAVE_DUP2Z	HAVE_DUP3Z$HAVE_DYLD_SHARED_CACHE_CONTAINS_PATHZHAVE_DYNAMIC_LOADINGZ
HAVE_ENDIAN_HZ
HAVE_EPOLLZHAVE_EPOLL_CREATE1ZHAVE_ERFZ	HAVE_ERFCZHAVE_ERRNO_HZ
HAVE_EXECVZHAVE_EXPLICIT_BZEROZHAVE_EXPLICIT_MEMSETZ
HAVE_EXPM1ZHAVE_FACCESSATZHAVE_FCHDIRZHAVE_FCHMODZ
HAVE_FCHMODATZHAVE_FCHOWNZ
HAVE_FCHOWNATZHAVE_FCNTL_HZHAVE_FDATASYNCZHAVE_FDOPENDIRZHAVE_FDWALKZHAVE_FEXECVEZHAVE_FINITEZ
HAVE_FLOCKZ	HAVE_FORKZHAVE_FORKPTYZHAVE_FPATHCONFZHAVE_FSEEK64ZHAVE_FSEEKOZHAVE_FSTATATZ
HAVE_FSTATVFSZ
HAVE_FSYNCZHAVE_FTELL64ZHAVE_FTELLOZ
HAVE_FTIMEZHAVE_FTRUNCATEZ
HAVE_FUTIMENSZHAVE_FUTIMESZHAVE_FUTIMESATZHAVE_GAI_STRERRORZ
HAVE_GAMMAZHAVE_GCC_ASM_FOR_MC68881ZHAVE_GCC_ASM_FOR_X64ZHAVE_GCC_ASM_FOR_X87ZHAVE_GCC_UINT128_TZHAVE_GETADDRINFOZHAVE_GETC_UNLOCKEDZHAVE_GETENTROPYZHAVE_GETGRGID_RZHAVE_GETGRNAM_RZHAVE_GETGROUPLISTZHAVE_GETGROUPSZHAVE_GETHOSTBYNAMEZHAVE_GETHOSTBYNAME_RZHAVE_GETHOSTBYNAME_R_3_ARGZHAVE_GETHOSTBYNAME_R_5_ARGZHAVE_GETHOSTBYNAME_R_6_ARGZHAVE_GETITIMERZHAVE_GETLOADAVGZ
HAVE_GETLOGINZHAVE_GETNAMEINFOZHAVE_GETPAGESIZEZHAVE_GETPEERNAMEZHAVE_GETPGIDZHAVE_GETPGRPZHAVE_GETPIDZHAVE_GETPRIORITYZ
HAVE_GETPWENTZHAVE_GETPWNAM_RZHAVE_GETPWUID_RZHAVE_GETRANDOMZHAVE_GETRANDOM_SYSCALLZHAVE_GETRESGIDZHAVE_GETRESUIDZHAVE_GETSIDZ
HAVE_GETSPENTZ
HAVE_GETSPNAMZHAVE_GETTIMEOFDAYZ
HAVE_GETWDZHAVE_GLIBC_MEMMOVE_BUGZ
HAVE_GRP_HZHAVE_HSTRERRORZHAVE_HTOLE64Z
HAVE_HYPOTZ
HAVE_IEEEFP_HZHAVE_IF_NAMEINDEXZHAVE_INET_ATONZHAVE_INET_PTONZHAVE_INITGROUPSZHAVE_INTTYPES_HZ	HAVE_IO_HZHAVE_IPA_PURE_CONST_BUGZ	HAVE_KILLZHAVE_KILLPGZHAVE_KQUEUEZHAVE_LANGINFO_HZHAVE_LARGEFILE_SUPPORTZ
HAVE_LCHFLAGSZHAVE_LCHMODZHAVE_LCHOWNZHAVE_LGAMMAZ
HAVE_LIBDLZHAVE_LIBDLDZHAVE_LIBIEEEZHAVE_LIBINTL_HZHAVE_LIBREADLINEZHAVE_LIBRESOLVZHAVE_LIBSENDFILEZHAVE_LIBUTIL_HZ	HAVE_LINKZHAVE_LINKATZHAVE_LINUX_CAN_BCM_HZHAVE_LINUX_CAN_HZHAVE_LINUX_CAN_RAW_FD_FRAMESZHAVE_LINUX_CAN_RAW_HZHAVE_LINUX_MEMFD_HZHAVE_LINUX_NETLINK_HZHAVE_LINUX_QRTR_HZHAVE_LINUX_RANDOM_HZHAVE_LINUX_TIPC_HZHAVE_LINUX_VM_SOCKETS_HZ
HAVE_LOCKFZ
HAVE_LOG1PZ	HAVE_LOG2ZHAVE_LONG_DOUBLEZ
HAVE_LSTATZHAVE_LUTIMESZHAVE_MADVISEZHAVE_MAKEDEVZHAVE_MBRTOWCZHAVE_MEMFD_CREATEZ
HAVE_MEMORY_HZHAVE_MEMRCHRZHAVE_MKDIRATZHAVE_MKFIFOZ
HAVE_MKFIFOATZ
HAVE_MKNODZHAVE_MKNODATZHAVE_MKTIMEZ	HAVE_MMAPZHAVE_MREMAPZHAVE_NCURSES_HZHAVE_NDIR_HZHAVE_NETPACKET_PACKET_HZ
HAVE_NET_IF_HZ	HAVE_NICEZHAVE_OPENATZHAVE_OPENPTYZ
HAVE_PATHCONFZ
HAVE_PAUSEZ
HAVE_PIPE2Z
HAVE_PLOCKZ	HAVE_POLLZHAVE_POLL_HZHAVE_POSIX_FADVISEZHAVE_POSIX_FALLOCATEZHAVE_POSIX_SPAWNZHAVE_POSIX_SPAWNPZ
HAVE_PREADZHAVE_PREADVZHAVE_PREADV2ZHAVE_PRLIMITZHAVE_PROCESS_HZHAVE_PROTOTYPESZHAVE_PTHREAD_CONDATTR_SETCLOCKZHAVE_PTHREAD_DESTRUCTORZHAVE_PTHREAD_GETCPUCLOCKIDZHAVE_PTHREAD_HZHAVE_PTHREAD_INITZHAVE_PTHREAD_KILLZHAVE_PTHREAD_SIGMASKZ
HAVE_PTY_HZHAVE_PUTENVZHAVE_PWRITEZHAVE_PWRITEVZ
HAVE_PWRITEV2Z
HAVE_READLINKZHAVE_READLINKATZ
HAVE_READVZ
HAVE_REALPATHZ
HAVE_RENAMEATZHAVE_RL_APPEND_HISTORYZHAVE_RL_CATCH_SIGNALZ#HAVE_RL_COMPLETION_APPEND_CHARACTERZ'HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOKZHAVE_RL_COMPLETION_MATCHESZ"HAVE_RL_COMPLETION_SUPPRESS_APPENDZHAVE_RL_PRE_INPUT_HOOKZHAVE_RL_RESIZE_TERMINALZ
HAVE_ROUNDZ
HAVE_RTPSPAWNZHAVE_SCHED_GET_PRIORITY_MAXZHAVE_SCHED_HZHAVE_SCHED_RR_GET_INTERVALZHAVE_SCHED_SETAFFINITYZHAVE_SCHED_SETPARAMZHAVE_SCHED_SETSCHEDULERZHAVE_SEM_GETVALUEZ
HAVE_SEM_OPENZHAVE_SEM_TIMEDWAITZHAVE_SEM_UNLINKZ
HAVE_SENDFILEZHAVE_SETEGIDZHAVE_SETEUIDZHAVE_SETGIDZHAVE_SETGROUPSZHAVE_SETHOSTNAMEZHAVE_SETITIMERZHAVE_SETLOCALEZHAVE_SETPGIDZHAVE_SETPGRPZHAVE_SETPRIORITYZ
HAVE_SETREGIDZHAVE_SETRESGIDZHAVE_SETRESUIDZ
HAVE_SETREUIDZHAVE_SETSIDZHAVE_SETUIDZHAVE_SETVBUFZ
HAVE_SHADOW_HZ
HAVE_SHM_OPENZHAVE_SHM_UNLINKZHAVE_SIGACTIONZHAVE_SIGALTSTACKZHAVE_SIGFILLSETZHAVE_SIGINFO_T_SI_BANDZHAVE_SIGINTERRUPTZ
HAVE_SIGNAL_HZHAVE_SIGPENDINGZ
HAVE_SIGRELSEZHAVE_SIGTIMEDWAITZHAVE_SIGWAITZHAVE_SIGWAITINFOZ
HAVE_SNPRINTFZHAVE_SOCKADDR_ALGZHAVE_SOCKADDR_SA_LENZHAVE_SOCKADDR_STORAGEZHAVE_SOCKETPAIRZHAVE_SPAWN_HZHAVE_SSIZE_TZHAVE_STATVFSZHAVE_STAT_TV_NSECZHAVE_STAT_TV_NSEC2ZHAVE_STDARG_PROTOTYPESZ
HAVE_STDINT_HZ
HAVE_STDLIB_HZHAVE_STD_ATOMICZHAVE_STRDUPZ
HAVE_STRFTIMEZHAVE_STRINGS_HZ
HAVE_STRING_HZHAVE_STRLCPYZHAVE_STROPTS_HZHAVE_STRSIGNALZHAVE_STRUCT_PASSWD_PW_GECOSZHAVE_STRUCT_PASSWD_PW_PASSWDZHAVE_STRUCT_STAT_ST_BIRTHTIMEZHAVE_STRUCT_STAT_ST_BLKSIZEZHAVE_STRUCT_STAT_ST_BLOCKSZHAVE_STRUCT_STAT_ST_FLAGSZHAVE_STRUCT_STAT_ST_GENZHAVE_STRUCT_STAT_ST_RDEVZHAVE_STRUCT_TM_TM_ZONEZHAVE_SYMLINKZHAVE_SYMLINKATZ	HAVE_SYNCZHAVE_SYSCONFZHAVE_SYSEXITS_HZHAVE_SYS_AUDIOIO_HZHAVE_SYS_BSDTTY_HZHAVE_SYS_DEVPOLL_HZHAVE_SYS_DIR_HZHAVE_SYS_ENDIAN_HZHAVE_SYS_EPOLL_HZHAVE_SYS_EVENT_HZHAVE_SYS_FILE_HZHAVE_SYS_IOCTL_HZHAVE_SYS_KERN_CONTROL_HZHAVE_SYS_LOADAVG_HZHAVE_SYS_LOCK_HZHAVE_SYS_MEMFD_HZHAVE_SYS_MKDEV_HZHAVE_SYS_MMAN_HZHAVE_SYS_MODEM_HZHAVE_SYS_NDIR_HZHAVE_SYS_PARAM_HZHAVE_SYS_POLL_HZHAVE_SYS_RANDOM_HZHAVE_SYS_RESOURCE_HZHAVE_SYS_SELECT_HZHAVE_SYS_SENDFILE_HZHAVE_SYS_SOCKET_HZHAVE_SYS_STATVFS_HZHAVE_SYS_STAT_HZHAVE_SYS_SYSCALL_HZHAVE_SYS_SYSMACROS_HZHAVE_SYS_SYS_DOMAIN_HZHAVE_SYS_TERMIO_HZHAVE_SYS_TIMES_HZHAVE_SYS_TIME_HZHAVE_SYS_TYPES_HZHAVE_SYS_UIO_HZ
HAVE_SYS_UN_HZHAVE_SYS_UTSNAME_HZHAVE_SYS_WAIT_HZHAVE_SYS_XATTR_HZHAVE_TCGETPGRPZHAVE_TCSETPGRPZHAVE_TEMPNAMZHAVE_TERMIOS_HZHAVE_TERM_HZHAVE_TGAMMAZHAVE_TIMEGMZ
HAVE_TIMESZHAVE_TMPFILEZHAVE_TMPNAMZ
HAVE_TMPNAM_RZHAVE_TM_ZONEZ
HAVE_TRUNCATEZHAVE_TZNAMEZ
HAVE_UCS4_TCLZ
HAVE_UNAMEZ
HAVE_UNISTD_HZ
HAVE_UNLINKATZ
HAVE_UNSETENVZHAVE_USABLE_WCHAR_TZHAVE_UTIL_HZHAVE_UTIMENSATZHAVE_UTIMESZHAVE_UTIME_HZHAVE_UUID_CREATEZHAVE_UUID_ENC_BEZHAVE_UUID_GENERATE_TIME_SAFEZHAVE_UUID_HZHAVE_UUID_UUID_HZ
HAVE_WAIT3Z
HAVE_WAIT4ZHAVE_WAITIDZHAVE_WAITPIDZHAVE_WCHAR_HZHAVE_WCSCOLLZ
HAVE_WCSFTIMEZHAVE_WCSXFRMZHAVE_WMEMCMPZHAVE_WORKING_TZSETZHAVE_WRITEVZ HAVE_X509_VERIFY_PARAM_SET1_HOSTZHAVE_ZLIB_COPYZHAVE__GETPTYZ
HOST_GNU_TYPEZINCLDIRSTOMAKEZ
INCLUDEDIRZ	INCLUDEPYZINSTALLZINSTALL_DATAZINSTALL_PROGRAMZINSTALL_SCRIPTZINSTALL_SHAREDZ
INSTSONAMEZIO_HZIO_OBJSZLDCXXSHAREDZLDFLAGSZ	LDLIBRARYZLDLIBRARYDIRZLDSHAREDZ	LDVERSIONZLIBCZLIBDESTZLIBDIRZLIBFFI_INCLUDEDIRZLIBMZ	LIBOBJDIRZLIBOBJSZLIBPCZLIBPLZ	LIBPYTHONZLIBRARYZLIBRARY_OBJSZLIBRARY_OBJS_OMIT_FROZENZLIBSZ
LIBSUBDIRSZLINKCCZ
LINKFORSHAREDZLIPO_32BIT_FLAGSZLIPO_INTEL64_FLAGSZ
LLVM_PROF_ERRZLLVM_PROF_FILEZLLVM_PROF_MERGERZLNZLOCALMODLIBSZMACHDEPZMACHDEP_OBJSZMACHDESTLIBZMACOSX_DEPLOYMENT_TARGETZMAINCCZMAJOR_IN_MKDEVZMAJOR_IN_SYSMACROSZ	MAKESETUPZMANDIRZMKDIR_PZMODBUILT_NAMESZMODDISABLED_NAMESZMODLIBSZMODOBJSZMODULE_OBJSZ	MULTIARCHZMULTIARCH_CPPFLAGSZMVWDELCH_IS_EXPRESSIONZNO_AS_NEEDEDZOBJECT_OBJSZOPENSSL_INCLUDESZOPENSSL_LDFLAGSZOPENSSL_LIBSZOPTZOTHER_LIBTOOL_OPTZPACKAGE_BUGREPORTZPACKAGE_NAMEZPACKAGE_STRINGZPACKAGE_TARNAMEZPACKAGE_URLZPACKAGE_VERSIONZPARSER_HEADERSZPARSER_OBJSZPGO_PROF_GEN_FLAGZPGO_PROF_USE_FLAGZPOBJSZPOSIX_SEMAPHORES_NOT_ENABLEDZPROFILE_TASKZ$PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INTZPTHREAD_SYSTEM_SCHED_SUPPORTEDZ
PY3LIBRARYZPYLONG_BITS_IN_DIGITZPYTHONZPYTHONFRAMEWORKZPYTHONFRAMEWORKDIRZPYTHONFRAMEWORKINSTALLDIRZPYTHONFRAMEWORKPREFIXZ
PYTHONPATHZPYTHON_FOR_BUILDZPYTHON_FOR_REGENZPYTHON_HEADERSZPYTHON_OBJSZPY_BUILTIN_MODULE_CFLAGSZ	PY_CFLAGSZPY_CFLAGS_NODISTZPY_COERCE_C_LOCALEZPY_CORE_CFLAGSZPY_CORE_LDFLAGSZPY_CPPFLAGSZPY_FORMAT_SIZE_TZ
PY_LDFLAGSZPY_LDFLAGS_NODISTZPY_SSL_DEFAULT_CIPHERSZPY_SSL_DEFAULT_CIPHER_STRINGZPY_STDMODULE_CFLAGSZPy_DEBUGZPy_ENABLE_SHAREDZPy_HASH_ALGORITHMZ
Py_TRACE_REFSZ
QUICKTESTOPTSZREADELFZ	RESSRCDIRZ
RETSIGTYPEZ	RUNSHAREDZ	SCRIPTDIRZSETPGRP_HAVE_ARGZSGI_ABIZSHELLZSHLIBSZSHLIB_SUFFIXZSHM_NEEDS_LIBRTZSIGNED_RIGHT_SHIFT_ZERO_FILLSZSITEPATHZ
SIZEOF_DOUBLEZSIZEOF_FLOATZ
SIZEOF_FPOS_TZ
SIZEOF_INTZSIZEOF_LONGZSIZEOF_LONG_DOUBLEZSIZEOF_LONG_LONGZSIZEOF_OFF_TZSIZEOF_PID_TZSIZEOF_PTHREAD_KEY_TZSIZEOF_PTHREAD_TZSIZEOF_SHORTZ
SIZEOF_SIZE_TZ
SIZEOF_TIME_TZSIZEOF_UINTPTR_TZ
SIZEOF_VOID_PZSIZEOF_WCHAR_TZSIZEOF__BOOLZSOABIZSRCDIRSZ
SRC_GDB_HOOKSZSTDC_HEADERSZSTRICT_SYSV_CURSESZ	STRIPFLAGZSUBDIRSZ
SUBDIRSTOOZSYSLIBSZSYS_SELECT_WITH_SYS_TIMEZTCLTK_INCLUDESZ
TCLTK_LIBSZTESTOPTSZTESTPATHZ
TESTPYTHONZTESTPYTHONOPTSZ
TESTRUNNERZTESTTIMEOUTZTIMEMODULE_LIBZTIME_WITH_SYS_TIMEZTM_IN_SYS_TIMEZUNICODE_DEPSZUNIVERSALSDKZUPDATE_FILEZUSE_COMPUTED_GOTOSZVERSIONZVPATHZWINDOW_HAS_FLAGSZWITH_DECIMAL_CONTEXTVARZWITH_DOC_STRINGSZWITH_DTRACEZ	WITH_DYLDZWITH_LIBINTLZWITH_NEXT_FRAMEWORKZ
WITH_PYMALLOCZ
WITH_VALGRINDZX87_DOUBLE_ROUNDINGZ
XMLLIBSUBDIRSZabs_builddirZ
abs_srcdirZdatarootdir�exec_prefix�prefixZsrcdirN)Zbuild_time_vars�rr�>/usr/lib64/python3.8/_sysconfigdata__linux_x86_64-linux-gnu.py�<module>sb2,/��������__pycache__/sre_constants.cpython-38.pyc000064400000014331151153537560014306 0ustar00U

e5d��@sDdZdZddlmZmZGdd�de�ZGdd�de�Zeed�Zd	d
�Z	e	d�Z
e
dd
�=e	d�Ze	d�Ze
eeeiZe
eeeiZe
eeeiZeeeeiZeeee iZ!ee"ee#iZ$e%e%e&e&e'e'e(e(e)e*e+e,e-e-e.e.iZ/e%e0e&e1e'e2e(e3e)e4e+e5e-e6e.e7iZ8dZ9dZ:dZ;dZ<dZ=dZ>dZ?dZ@dZAdZBdZCdZDeEdk�r@dd�ZFeGdd���ZHeH�Id�eH�Ide�eFeHe
d �eFeHed!�eFeHed!�eH�Id"e9�eH�Id#e:�eH�Id$e;�eH�Id%e<�eH�Id&e=�eH�Id'e>�eH�Id(e?�eH�Id)e@�eH�Id*eA�eH�Id+eB�eH�Id,eC�eH�Id-eD�W5QRXeJd.�d
S)/zInternal support module for srei��3�)�	MAXREPEAT�	MAXGROUPScs&eZdZdZdZd�fdd�	Z�ZS)�erroraiException raised for invalid regular expressions.

    Attributes:

        msg: The unformatted error message
        pattern: The regular expression pattern
        pos: The index in the pattern where compilation failed (may be None)
        lineno: The line corresponding to pos (may be None)
        colno: The column corresponding to pos (may be None)
    �reNcs�||_||_||_|dk	r�|dk	r�d||f}t|t�r>d}nd}|�|d|�d|_||�|d|�|_||kr�d||j|jf}nd|_|_t	��
|�dS)Nz%s at position %d�
�
r�z%s (line %d, column %d))�msg�pattern�pos�
isinstance�str�count�lineno�rfind�colno�super�__init__)�selfr	r
r�newline��	__class__��%/usr/lib64/python3.8/sre_constants.pyr%s
zerror.__init__)NN)�__name__�
__module__�__qualname__�__doc__r�
__classcell__rrrrrsrcs$eZdZ�fdd�Zdd�Z�ZS)�_NamedIntConstantcstt|��||�}||_|S�N)rr�__new__�name)�cls�valuer"rrrrr!9sz_NamedIntConstant.__new__cCs|jSr �r")rrrr�__repr__>sz_NamedIntConstant.__repr__)rrrr!r&rrrrrr8srrcCs8|����}dd�t|�D�}t��dd�|D��|S)NcSsg|]\}}t||��qSr)r)�.0�ir"rrr�
<listcomp>Esz_makecodes.<locals>.<listcomp>cSsi|]}|j|�qSrr%)r'�itemrrr�
<dictcomp>Fsz_makecodes.<locals>.<dictcomp>)�strip�split�	enumerate�globals�update)�names�itemsrrr�
_makecodesCsr3az
    FAILURE SUCCESS

    ANY ANY_ALL
    ASSERT ASSERT_NOT
    AT
    BRANCH
    CALL
    CATEGORY
    CHARSET BIGCHARSET
    GROUPREF GROUPREF_EXISTS
    IN
    INFO
    JUMP
    LITERAL
    MARK
    MAX_UNTIL
    MIN_UNTIL
    NOT_LITERAL
    NEGATE
    RANGE
    REPEAT
    REPEAT_ONE
    SUBPATTERN
    MIN_REPEAT_ONE

    GROUPREF_IGNORE
    IN_IGNORE
    LITERAL_IGNORE
    NOT_LITERAL_IGNORE

    GROUPREF_LOC_IGNORE
    IN_LOC_IGNORE
    LITERAL_LOC_IGNORE
    NOT_LITERAL_LOC_IGNORE

    GROUPREF_UNI_IGNORE
    IN_UNI_IGNORE
    LITERAL_UNI_IGNORE
    NOT_LITERAL_UNI_IGNORE
    RANGE_UNI_IGNORE

    MIN_REPEAT MAX_REPEAT
���Nz�
    AT_BEGINNING AT_BEGINNING_LINE AT_BEGINNING_STRING
    AT_BOUNDARY AT_NON_BOUNDARY
    AT_END AT_END_LINE AT_END_STRING

    AT_LOC_BOUNDARY AT_LOC_NON_BOUNDARY

    AT_UNI_BOUNDARY AT_UNI_NON_BOUNDARY
a�
    CATEGORY_DIGIT CATEGORY_NOT_DIGIT
    CATEGORY_SPACE CATEGORY_NOT_SPACE
    CATEGORY_WORD CATEGORY_NOT_WORD
    CATEGORY_LINEBREAK CATEGORY_NOT_LINEBREAK

    CATEGORY_LOC_WORD CATEGORY_LOC_NOT_WORD

    CATEGORY_UNI_DIGIT CATEGORY_UNI_NOT_DIGIT
    CATEGORY_UNI_SPACE CATEGORY_UNI_NOT_SPACE
    CATEGORY_UNI_WORD CATEGORY_UNI_NOT_WORD
    CATEGORY_UNI_LINEBREAK CATEGORY_UNI_NOT_LINEBREAK
r����� �@���__main__cCs*t|�}|D]}|�d|||f�qdS)Nz#define %s_%s %d
)�sorted�write)�f�d�prefixr2r*rrr�dump�srCzsre_constants.h�wao/*
 * Secret Labs' Regular Expression Engine
 *
 * regular expression matching engine
 *
 * NOTE: This file is generated by sre_constants.py.  If you need
 * to change anything in here, edit sre_constants.py and run it.
 *
 * Copyright (c) 1997-2001 by Secret Labs AB.  All rights reserved.
 *
 * See the _sre.c file for information on usage and redistribution.
 */

z#define SRE_MAGIC %d
ZSRE_OPZSREz#define SRE_FLAG_TEMPLATE %d
z#define SRE_FLAG_IGNORECASE %d
z#define SRE_FLAG_LOCALE %d
z#define SRE_FLAG_MULTILINE %d
z#define SRE_FLAG_DOTALL %d
z#define SRE_FLAG_UNICODE %d
z#define SRE_FLAG_VERBOSE %d
z#define SRE_FLAG_DEBUG %d
z#define SRE_FLAG_ASCII %d
z#define SRE_INFO_PREFIX %d
z#define SRE_INFO_LITERAL %d
z#define SRE_INFO_CHARSET %d
Zdone)Kr�MAGIC�_srerr�	Exceptionr�intrr3�OPCODES�ATCODES�CHCODES�LITERAL�LITERAL_IGNORE�NOT_LITERAL�NOT_LITERAL_IGNORE�	OP_IGNORE�LITERAL_LOC_IGNORE�NOT_LITERAL_LOC_IGNORE�OP_LOCALE_IGNORE�LITERAL_UNI_IGNORE�NOT_LITERAL_UNI_IGNORE�OP_UNICODE_IGNORE�AT_BEGINNINGZAT_BEGINNING_LINE�AT_ENDZAT_END_LINE�AT_MULTILINEZAT_BOUNDARYZAT_LOC_BOUNDARYZAT_NON_BOUNDARYZAT_LOC_NON_BOUNDARY�	AT_LOCALEZAT_UNI_BOUNDARYZAT_UNI_NON_BOUNDARY�
AT_UNICODEZCATEGORY_DIGITZCATEGORY_NOT_DIGITZCATEGORY_SPACEZCATEGORY_NOT_SPACEZ
CATEGORY_WORDZCATEGORY_LOC_WORDZCATEGORY_NOT_WORDZCATEGORY_LOC_NOT_WORDZCATEGORY_LINEBREAKZCATEGORY_NOT_LINEBREAK�	CH_LOCALEZCATEGORY_UNI_DIGITZCATEGORY_UNI_NOT_DIGITZCATEGORY_UNI_SPACEZCATEGORY_UNI_NOT_SPACEZCATEGORY_UNI_WORDZCATEGORY_UNI_NOT_WORDZCATEGORY_UNI_LINEBREAKZCATEGORY_UNI_NOT_LINEBREAK�
CH_UNICODE�SRE_FLAG_TEMPLATE�SRE_FLAG_IGNORECASE�SRE_FLAG_LOCALE�SRE_FLAG_MULTILINE�SRE_FLAG_DOTALL�SRE_FLAG_UNICODE�SRE_FLAG_VERBOSE�SRE_FLAG_DEBUG�SRE_FLAG_ASCII�SRE_INFO_PREFIX�SRE_INFO_LITERAL�SRE_INFO_CHARSETrrC�openr@r?�printrrrr�<module>s�!	
,
��������

__pycache__/binhex.cpython-38.pyc000064400000027550151153537560012705 0ustar00U

e5d�6�@s�dZddlZddlZddlZddlZdddgZGdd�de�ZdZdZ	dZ
d	Zd
ZGdd�d�Z
d
d�ZGdd�d�ZGdd�d�ZGdd�d�ZGdd�d�Zdd�ZGdd�d�ZGdd�d�ZGdd�d�Zdd�ZdS)z�Macintosh binhex compression/decompression.

easy interface:
binhex(inputfilename, outputfilename)
hexbin(inputfilename, outputfilename)
�N�binhex�hexbin�Errorc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/binhex.pyrs�i��@��c@seZdZdd�ZdS)�FInfocCsd|_d|_d|_dS)Nz????r)�Type�Creator�Flags��selfrrr	�__init__0szFInfo.__init__N)rrrrrrrr	r
/sr
c	Cstt�}t�|d��2}|�d�}d|kr,d|_|�dd�|��}W5QRXtj�	|�\}}|�
ddd�}|||dfS)	N�rbirZTEXT��:�-r
)r
�io�open�readr�seek�tell�os�path�split�replace)�name�finfo�fp�dataZdsize�dir�filerrr	�getfileinfo5s
r'c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�openrsrccGsdS�Nr�r�argsrrr	rCszopenrsrc.__init__cGsdS�N�rr*rrr	rFsz
openrsrc.readcGsdSr)rr*rrr	�writeIszopenrsrc.writecCsdSr)rrrrr	�closeLszopenrsrc.closeN)rrrrrr.r/rrrr	r(Bsr(c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�_Hqxcoderenginez(Write data to the coder in 3-byte chunkscCs ||_d|_d|_td|_dS)Nr-r
)�ofpr$�hqxdata�LINELEN�linelen�rr1rrr	rRsz_Hqxcoderengine.__init__cCsh|j||_t|j�}|dd}|jd|�}|j|d�|_|sHdS|jt�|�|_|�d�dS)N�r)r$�lenr2�binascii�b2a_hqx�_flush)rr$ZdatalenZtodorrr	r.Xs
z_Hqxcoderengine.writecCsrd}|t|j�|jkrH||j}|j�|j||�d�t|_|}q|j|d�|_|rn|j�|jd�dS)Nr�
s:
)r7r2r4r1r.r3)rZforce�firstZlastrrr	r:cs
z_Hqxcoderengine._flushcCs6|jr|jt�|j�|_|�d�|j��|`dS)Nr
)r$r2r8r9r:r1r/rrrr	r/ns


z_Hqxcoderengine.closeN)rrr�__doc__rr.r:r/rrrr	r0Os
r0c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_Rlecoderenginez4Write data to the RLE-coder in suitably large chunkscCs||_d|_dSr,)r1r$r5rrr	rxsz_Rlecoderengine.__init__cCs@|j||_t|j�tkrdSt�|j�}|j�|�d|_dSr,)r$r7�REASONABLY_LARGEr8�rlecode_hqxr1r.)rr$�rledatarrr	r.|sz_Rlecoderengine.writecCs0|jrt�|j�}|j�|�|j��|`dSr))r$r8r@r1r.r/)rrArrr	r/�s

z_Rlecoderengine.closeN)rrrr=rr.r/rrrr	r>usr>c@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�BinHexc
Cs�|\}}}}d}t|t�r.|}t�|d�}d}zR|�d�t|�}	t|	�|_d|_|dkr`t	�}||_
||_|�||�t
|_Wn|r�|���YnXdS)NF�wbTs0(This file must be converted with BinHex 4.0)

:r)�
isinstance�strrrr.r0r>r1�crcr
�dlen�rlen�
_writeinfo�_DID_HEADER�stater/)
rZname_finfo_dlen_rlenr1r!r"rGrHZclose_on_errorZofnameZhqxerrrr	r�s*



zBinHex.__init__cCs�t|�}|dkrtd��t|g�|�d�d}|j|j}}t|t�rR|�d�}t|t�rf|�d�}||}t�	d|j
�}t�	d|j|j�}	||||	}
|�
|
�|��dS)N�?zFilename too longzlatin-1��>hz>ii)r7r�bytes�encoderrrDrE�struct�packrrGrH�_write�	_writecrc)rr!r"�nl�d�tpZcrZd2Zd3Zd4�inforrr	rI�s




zBinHex._writeinfocCs t�||j�|_|j�|�dSr))r8�crc_hqxrFr1r.�rr$rrr	rS�sz
BinHex._writecCs4|jdkrd}nd}|j�t�||j��d|_dS)NrrNz>H)rFr1r.rQrR)rZfmtrrr	rT�s

zBinHex._writecrccCs0|jtkrtd��|jt|�|_|�|�dS)NzWriting data at the wrong time)rKrJrrGr7rSrZrrr	r.�s
zBinHex.writecCs,|jdkrtd|jf��|��t|_dS)NrzIncorrect data size, diff=%r)rGrrHrT�	_DID_DATArKrrrr	�
close_data�s
zBinHex.close_datacCsB|jtkr|��|jtkr$td��|jt|�|_|�|�dS)Nz'Writing resource data at the wrong time)rKr[r\rrHr7rSrZrrr	�
write_rsrc�s

zBinHex.write_rsrccCsx|jdkrdSzJ|jtkr"|��|jtkr4td��|jdkrNtd|jf��|��W5d|_|j}|`|��XdS)NzClose at the wrong timerz$Incorrect resource-datasize, diff=%r)rKr1r/r[r\rrHrTr5rrr	r/�s



zBinHex.closeN)rrrrrIrSrTr.r\r]r/rrrr	rB�s
rBc	Cs�t|�}t||�}t�|d��*}|�d�}|s0q<|�|�q |��W5QRXt|d�}|�d�}|shqt|�|�qX|�	�|�	�dS)zEbinhex(infilename, outfilename): create binhex-encoded copy of a filer��N)
r'rBrrrr.r\r(r]r/)�inp�outr"r1�ifprVrrr	r�s



c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_Hqxdecoderenginez*Read data via the decoder in 4-byte chunkscCs||_d|_dS)Nr)ra�eof�rrarrr	rsz_Hqxdecoderengine.__init__cCs�d}|}|dkr�|jr|S|ddd}|j�|�}zt�|�\}|_Wq�Wntjk
rdYnX|j�d�}|s~td��||}q6||}|t|�}|s|jstd��q|S)z&Read at least wtd bytes (or until EOF)r-rrr6�r
zPremature EOF on binhex file)rcrarr8Za2b_hqxZ
Incompleterr7)rZtotalwtdZdecdata�wtdr$Z
decdatacur�newdatarrr	rs*


z_Hqxdecoderengine.readcCs|j��dSr)�rar/rrrr	r/%sz_Hqxdecoderengine.closeN)rrrr=rrr/rrrr	rb�s rbc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�_RledecoderenginezRead data via the RLE-codercCs||_d|_d|_d|_dS)Nr-r)ra�
pre_buffer�post_bufferrcrdrrr	r+sz_Rledecoderengine.__init__cCsD|t|j�kr"|�|t|j��|jd|�}|j|d�|_|Sr))r7rk�_fill)rrf�rvrrr	r1s
z_Rledecoderengine.readcCs�|j|j�|d�|_|jjr>|jt�|j�|_d|_dSt|j�}|jdd�tdtkrl|d}nX|jdd�tkr�|d}n<|jdd�tdkr�|d}n|jdd�tkr�n|d	}|jt�|jd|��|_|j|d�|_dS)
Nrer-���rMr6���r���r
)	rjrarrcrkr8Z
rledecode_hqxr7�RUNCHAR)rrfZmarkrrr	rl8s*
�



�z_Rledecoderengine._fillcCs|j��dSr)rhrrrr	r/[sz_Rledecoderengine.closeN)rrrr=rrrlr/rrrr	ri(s
#ric@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�HexBincCsft|t�rt�|d�}|�d�}|s,td��|dkr6q|dkrqBqt|�}t|�|_d|_	|�
�dS)Nrr
zNo binhex data foundr;�:r)rDrErrrrrbrirarF�_readheader)rraZchZhqxifprrr	r_s


zHexBin.__init__cCs |j�|�}t�||j�|_|Sr))rarr8rYrF)rr7r$rrr	�_readuszHexBin._readcCsNt�d|j�d��dd@}|jd@|_||jkrDtd|j|f��d|_dS)NrNrri��zCRC error, computed %x, read %x)rQ�unpackrarrFr)rZfilecrcrrr	�	_checkcrczs
�zHexBin._checkcrccCs�|�d�}|�t|��}|�d�}|��|dd�}|dd�}t�d|dd��d}t�d|dd	��d|_t�d|d	d��d|_||_t�|_||j_	||j_
||j_t|_
dS)
Nr
���	rN�rz>l�)ru�ordrwrQrvrGrH�FNamer
rrrrJrK)rr7Zfname�rest�typeZcreator�flagsrrr	rt�s

zHexBin._readheadercGsj|jtkrtd��|r,|d}t||j�}n|j}d}t|�|krZ||�|t|��}q6|j||_|S)NzRead data at wrong timerr-)rKrJr�minrGr7ru)r�nrmrrr	r�s
zHexBin.readcCs6|jtkrtd��|jr$|�|j�}|��t|_dS)Nzclose_data at wrong time)rKrJrrGrurwr[�rZdummyrrr	r\�s
zHexBin.close_datacGsZ|jtkr|��|jtkr$td��|r>|d}t||j�}n|j}|j||_|�|�S)Nz Read resource data at wrong timer)rKrJr\r[rr�rHru)rr�rrr	�	read_rsrc�s

zHexBin.read_rsrccCsD|jdkrdSz|jr"|�|j�}|��W5d|_|j��XdSr))rKrar/rHr�rwr�rrr	r/�s
zHexBin.closeN)rrrrrurwrtrr\r�r/rrrr	rr^s

rrc	Cs�t|�}|j}|s|j}t�|d��"}|�d�}|s6qB|�|�q&W5QRX|��|�d�}|r�t	|d�}|�|�|�d�}|s�q�|�|�qv|�
�|�
�dS)z6hexbin(infilename, outfilename) - Decode binhexed filerCr^N)rrr
r~rrrr.r\r�r(r/)r_r`rar"r1rVrrr	r�s(




)r=rrrQr8�__all__�	ExceptionrrJr[r?r3rqr
r'r(r0r>rBrrbrirrrrrrr	�<module>s,


&^*6h__pycache__/reprlib.cpython-38.pyc000064400000012271151153537560013061 0ustar00U

e5d��@s^dZdddgZddlZddlmZddlmZd
d	d�ZGd
d�d�Zdd�Z	e�Z
e
jZdS)zGRedo the builtin repr() (representation) but with limits on most sizes.�Repr�repr�recursive_repr�N)�islice)�	get_ident�...cs�fdd�}|S)zGDecorator to make a repr function return fillvalue for a recursive callcsXt�����fdd�}t�d�|_t�d�|_t�d�|_t�d�|_t�di�|_|S)Nc	sBt|�t�f}|�kr�S��|�z�|�}W5��|�X|S�N)�idr�add�discard)�self�key�result)�	fillvalue�repr_running�
user_function��/usr/lib64/python3.8/reprlib.py�wrappers
z<recursive_repr.<locals>.decorating_function.<locals>.wrapper�
__module__�__doc__�__name__�__qualname__�__annotations__)�set�getattrrrrrr)rr�r)rrr�decorating_functionsz+recursive_repr.<locals>.decorating_functionr)rrrrrr	sc@s~eZdZdd�Zdd�Zdd�Zddd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS) rcCsFd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
dS)N�����()�maxlevel�maxtuple�maxlist�maxarray�maxdict�maxset�maxfrozenset�maxdeque�	maxstring�maxlong�maxother)rrrr�__init__&sz
Repr.__init__cCs|�||j�Sr)�repr1r#)r�xrrrr3sz	Repr.reprcCsVt|�j}d|kr$|��}d�|�}t|d|�rFt|d|�||�S|�||�SdS)N� �_�repr_)�typer�split�join�hasattrr�
repr_instance)rr0�level�typename�partsrrrr/6s

z
Repr.repr1�c
s�t|�}|dkr|rd}nX|d�|j���fdd�t||�D�}	||krT|	�d�d�|	�}|dkrr|rr||}d|||fS)Nrr�csg|]}�|���qSrr)�.0�elem��newlevelr/rr�
<listcomp>Gsz'Repr._repr_iterable.<locals>.<listcomp>�, z%s%s%s)�lenr/r�appendr6)
rr0r9�left�right�maxiter�trail�n�s�piecesrr@r�_repr_iterable@s

zRepr._repr_iterablecCs|�||dd|jd�S)N�(�)�,)rMr$�rr0r9rrr�
repr_tupleMszRepr.repr_tuplecCs|�||dd|j�S)N�[�])rMr%rQrrr�	repr_listPszRepr.repr_listcCs,|sd|jSd|j}|�|||d|j�S)Nzarray('%s')z
array('%s', [�]))�typecoderMr&)rr0r9�headerrrr�
repr_arraySs

zRepr.repr_arraycCs$|sdSt|�}|�||dd|j�S)Nzset()�{�})�_possibly_sortedrMr(rQrrr�repr_setYsz
Repr.repr_setcCs$|sdSt|�}|�||dd|j�S)Nzfrozenset()zfrozenset({z}))r\rMr)rQrrr�repr_frozenset_s�zRepr.repr_frozensetcCs|�||dd|j�S)Nzdeque([rV)rMr*rQrrr�
repr_dequefszRepr.repr_dequecCs�t|�}|dkrdS|dkr dS|d}|j}g}tt|�|j�D].}|||�}||||�}	|�d||	f�qB||jkr�|�d�d�|�}
d|
fS)	Nrz{}z{...}r=z%s: %srrCz{%s})rDr/rr\r'rEr6)rr0r9rJrAr/rLr
�keyrepr�valreprrKrrr�	repr_dictis 



zRepr.repr_dictcCs�t�|d|j��}t|�|jkr�td|jdd�}td|jd|�}t�|d|�|t|�|d��}|d|�d|t|�|d�}|S�Nr��r)�builtinsrr+rD�max�rr0r9rK�i�jrrr�repr_strxs&$z
Repr.repr_strcCsht�|�}t|�|jkrdtd|jdd�}td|jd|�}|d|�d|t|�|d�}|Src)rfrrDr,rgrhrrr�repr_int�s
$z
Repr.repr_intcCs�zt�|�}Wn(tk
r6d|jjt|�fYSXt|�|jkr�td|jdd�}td|jd|�}|d|�d|t|�|d�}|S)Nz<%s instance at %#x>rrdrer)	rfr�	Exception�	__class__rr	rDr-rgrhrrrr8�s$zRepr.repr_instanceN)r<)rrrr.rr/rMrRrUrYr]r^r_rbrkrlr8rrrrr$s



	cCs,z
t|�WStk
r&t|�YSXdSr)�sortedrm�list)r0rrrr\�s
r\)r)r�__all__rf�	itertoolsr�_threadrrrr\�aReprrrrrr�<module>s

s	__pycache__/webbrowser.cpython-38.opt-1.pyc000064400000041301151153537560014536 0ustar00U

e5d^�@s�dZddlZddlZddlZddlZddlZddlZddddddgZGd	d�de�Z	e�
�ZiZda
dad<d
d�dd�Zd=d
d�Zd>dd�Zdd�Zdd�Zd
d�dd�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGd d!�d!e�ZGd"d#�d#e�ZeZGd$d%�d%e�ZGd&d'�d'e�Z Gd(d)�d)e�Z!Gd*d+�d+e�Z"d,d-�Z#d.d/�Z$ej%dd0�d1k�r�Gd2d3�d3e�Z&ej%d4k�r�Gd5d6�d6e�Z'Gd7d8�d8e�Z(d9d:�Z)e*d;k�r�e)�dS)?z?Interfaces for launching and remotely controlling Web browsers.�N�Error�open�open_new�open_new_tab�get�registerc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�"/usr/lib64/python3.8/webbrowser.pyrsF��	preferredc	CsZt�Ltdkrt�||gt|��<|s4trB|tkrBt�d|�n
t�|�W5QRXdS)zRegister a browser connector.Nr)�_lock�	_tryorder�register_standard_browsers�	_browsers�lower�_os_preferred_browser�insert�append)�name�klass�instancerrrrrsc	Cs�tdkr&t�tdkrt�W5QRX|dk	r6|g}nt}|D]�}d|kr�t�|�}|ddkrtt|dd��St|�Sq>zt|��}Wnt	k
r�t
|�}YnX|ddk	r�|dS|ddk	r>|d�Sq>td��dS)zCReturn a browser launcher instance appropriate for the environment.N�%s����&�rz!could not locate runnable browser)rrr�shlex�split�BackgroundBrowser�GenericBrowserrr�KeyError�_synthesizer)ZusingZalternatives�browser�commandrrrr%s,
Tc	CsPtdkr&t�tdkrt�W5QRXtD] }t|�}|�|||�r*dSq*dS)aDisplay url using the default browser.

    If possible, open url in a location determined by new.
    - 0: the same browser window (the default).
    - 1: a new browser window.
    - 2: a new browser page ("tab").
    If possible, autoraise raises the window (the default) or not.
    NTF)rrrrr)�url�new�	autoraiserr$rrrrGs	cCs
t|d�S)zuOpen url in a new window of the default browser.

    If not possible, then open url in the only browser window.
    r�r�r&rrrrZscCs
t|d�S)z�Open url in a new page ("tab") of the default browser.

    If not possible, then the behavior becomes equivalent to open_new().
    �r)r*rrrrascCs�|��d}t�|�sddgStj�|�}zt|��}Wntk
rVddgYSX|d}|r�|��|jkr�ddl	}|�	|�}||_
tj�|�|_t|d||d�d|gSddgS)a�Attempt to synthesize a controller based on existing controllers.

    This is useful to create a controller when a user specifies a path to
    an entry in the BROWSER environment variable -- we can copy a general
    controller to operate using a specific installation of the desired
    browser in this way.

    If we can't create a controller in this way, or if there is no
    executable for the requested browser, return [None, None].

    rNr)rr)r�shutil�which�os�path�basenamerrr"�copyrr)r$r�cmdrr%Z
controllerr1rrrr#is"

r#c@s:eZdZdZdgZddd�Zddd	�Zd
d�Zdd
�ZdS)�BaseBrowserz3Parent class for all browsers. Do not use directly.r�cCs||_||_dS�N)rr0��selfrrrr�__init__�szBaseBrowser.__init__rTcCst�dSr5)�NotImplementedError�r7r&r'r(rrrr�szBaseBrowser.opencCs|�|d�S)Nrr)�r7r&rrrr�szBaseBrowser.open_newcCs|�|d�S)Nr+r)r;rrrr�szBaseBrowser.open_new_tabN)r4)rT)	rr	r
�__doc__�argsr8rrrrrrrr3�s

r3c@s"eZdZdZdd�Zd	dd�ZdS)
r!zVClass for all browsers started with a command
       and without remote functionality.cCsFt|t�r||_dg|_n|d|_|dd�|_tj�|j�|_dS)Nrrr)�
isinstance�strrr=r.r/r0r6rrrr8�s


zGenericBrowser.__init__rTcs|t�d��|jg�fdd�|jD�}z8tjdd�dkrHt�|�}ntj|dd�}|��WStk
rvYdSXdS)	N�webbrowser.opencsg|]}|�d���qS�r��replace��.0�argr*rr�
<listcomp>�s�z'GenericBrowser.open.<locals>.<listcomp>��winT)�	close_fdsF)	�sys�auditrr=�platform�
subprocess�Popen�wait�OSError�r7r&r'r(�cmdline�prr*rr�s�zGenericBrowser.openN)rT�rr	r
r<r8rrrrrr!�s
r!c@seZdZdZddd�ZdS)r zHClass for all browsers which are to be started in the
       background.rTcs�|jg�fdd�|jD�}t�d��z<tjdd�dkrHt�|�}ntj|ddd�}|��dkWStk
rzYdSXdS)	Ncsg|]}|�d���qSrArBrDr*rrrG�s�z*BackgroundBrowser.open.<locals>.<listcomp>r@rHrIT)rJ�start_new_sessionF)	rr=rKrLrMrNrO�pollrQrRrr*rr�s��zBackgroundBrowser.openN)rT�rr	r
r<rrrrrr �sr c@sDeZdZdZdZdZdZddgZdZdZ	dZ
ddd�Zd
d
d�ZdS)�UnixBrowserz=Parent class for all Unix browsers with remote functionality.NFT�%actionrcCs�g}|r*|jr*t|�}|j|}|r*|g}|jg||}|sD|jrLtj}nd}tj|d||jrd|pfd|dd�}	|r�z|	�d�}
|
WStj	k
r�YdSXn&|jr�|	�
�dkr�dSdSn
|	��SdS)NT�rJ�stdin�stdout�stderrrV�F)�
raise_opts�intr�
backgroundrN�DEVNULLrO�redirect_stdoutrPZTimeoutExpiredrW)r7r=Zremoter(r&Z	raise_opt�optrSZinoutrT�rcrrr�_invoke�s4



�

zUnixBrowser._invokercs�t�d��|dkr|j�nB|dkr,|j�n2|dkrN|jdkrF|j�q^|j�ntdd|����fdd�|jD�}d	d�|D�}|�|d
|��}|s��fdd�|jD�}|�|dd�Sd
SdS)
Nr@rrr+zBad 'new' parameter to open(); zexpected 0, 1, or 2, got %scs g|]}|�d���d���qS)rrZrBrD��actionr&rrrGs�z$UnixBrowser.open.<locals>.<listcomp>cSsg|]}|r|�qSrrrDrrrrGsTcsg|]}|�d���qSrArBrDr*rrrGsF)	rKrL�
remote_action�remote_action_newwin�remote_action_newtabr�remote_argsrgr=)r7r&r'r(r=Zsuccessrrhrrs*
��zUnixBrowser.open)N)rT)
rr	r
r<r`rbrdrmrjrkrlrgrrrrrrY�s
#rYc@s(eZdZdZddgZdZdZdZdZdS)	�Mozillaz$Launcher class for Mozilla browsers.rZrr4z-new-windowz-new-tabTN�	rr	r
r<rmrjrkrlrbrrrrrnsrnc@s0eZdZdZddgZddgZdZdZdZd	Z	d
S)�Netscapez$Launcher class for Netscape browser.�-noraisez-raise�-remote�openURL(%s%action)r4�,new-window�,new-tabTN)
rr	r
r<r`rmrjrkrlrbrrrrrp&srpc@s,eZdZdZddgZddgZdZdZdZd	S)
�Galeonz,Launcher class for Galeon/Epiphany browsers.rqr4rZr�-nz-wTN)	rr	r
r<r`rmrjrkrbrrrrrv1srvc@s(eZdZdZddgZdZdZdZdZdS)�Chromez)Launcher class for Google Chrome browser.rZrr4�--new-windowTNrorrrrrx;srxc@s(eZdZdZddgZdZdZdZdZdS)�Operaz!Launcher class for Opera browser.rZrr4ryTNrorrrrrzGsrzc@s,eZdZdZddgZdZdZdZdZdZ	dS)	�Elinksz#Launcher class for Elinks browsers.rrrsr4rtruFN)
rr	r
r<rmrjrkrlrbrdrrrrr{Qsr{c@seZdZdZddd�ZdS)�	Konquerorz�Controller for the KDE File Manager (kfm, or Konqueror).

    See the output of ``kfmclient --commands``
    for more information on the Konqueror remote-control interface.
    rTcCs�t�d|�|dkrd}nd}tj}ztjd||gd|||d�}Wntk
rVYnX|��dSz tjdd	|gd|||dd
�}Wntk
r�YnX|��dkr�dSz tjdd|gd|||dd
�}Wntk
r�Yd
SX|��dkSdS)Nr@r+ZnewTabZopenURL�	kfmclientT)rJr\r]r^�	konquerorz--silentr[�kfmz-dF)rKrLrNrcrOrQrPrW)r7r&r'r(ri�devnullrTrrrrfsN�
�
�
zKonqueror.openN)rTrXrrrrr|_sr|c@s&eZdZdd�Zdd�Zd
dd�Zd	S)�GrailcCs�ddl}ddl}ddl}ddl}tj�|��d�}|�t�	��d}tj�|�
|�|�
|�d�}|�|�}|stdS|�|j|j�}	|D]T}
z|	�
|
�Wn8tk
r�zt�|
�Wntk
r�YnXYq�X|	Sq�dS)Nrz.grail-unixz-*)�glob�pwd�socket�tempfiler.r/�joinZ
gettempdir�getpwuid�getuid�escapeZAF_UNIXZSOCK_STREAMZconnectrQ�unlink)r7r�r�r�r�Ztempdir�user�filenameZmaybes�s�fnrrr�_find_grail_rc�s,�
zGrail._find_grail_rccCs&|��}|sdS|�|�|��dS)Nrr)r��send�close)r7rir�rrr�_remote�s
z
Grail._remoterTcCs2t�d|�|r |�d|�}n|�d|�}|S)Nr@zLOADNEW zLOAD )rKrLr�)r7r&r'r(�okrrrr�s
z
Grail.openN)rT)rr	r
r�r�rrrrrr��sr�cCs�t�d�rtddtd��dtjkr>t�d�r>tddtd��dtjkrbt�d�rbtddtd��dtjkr�t�d�r�tdttd��t�d�r�tddtd��dD]}t�|�r�t|dt|��q�d	D]}t�|�r�t|dt|��q�t�d
��rtd
ttd
��nt�d��r"tdttd��dD]"}t�|��r&t|dt	|���q&t�d
��rftd
dtd
��dD]"}t�|��rjt|dt
|���qjt�d��r�tddtd��t�d��r�tddtd��t�d��r�tdtd�dS)Nzxdg-openZGNOME_DESKTOP_SESSION_IDz	gvfs-openz
gnome-openZKDE_FULL_SESSIONr}z
x-www-browser)�firefoxZ	iceweaselZiceape�	seamonkey)zmozilla-firefoxzmozilla-firebird�firebird�mozilla�netscaperr~)ZgaleonZepiphanyZ	skipstone)z
google-chrome�chromeZchromiumzchromium-browser�operaZmosaicZgrail)
r,r-rr r.�environr|rnrprvrxrzr�)r$rrr�register_X_browsers�sD



r�cCs.gatjdkrNtddtd��tddtd��tddtd��tddtd��tjdd�dkr�td	t�tj�tj	�
d
d�d�}dd
dddd|fD]}t�|�r�t|dt
|��q��ntj	�
d�s�tj	�
d��r&z(d��}tj|tjd�}|����}Wn ttjttfk
�rYnX|at�tj	�
d��r�t�d��rPtddtd��t�d��rltddtd��t�d��r�tddtd��t�d��r�tddtd��t�d��r�tddtd��dtj	k�r*tj	d�tj�}|��|D]>}|dk�r�t|dd�}|d dk�r�t|dt|�dd��q�dS)!N�darwin�MacOSX�defaultr�r�ZsafarirHrIzwindows-defaultZPROGRAMFILESzC:\Program FileszInternet Explorer\IEXPLORE.EXEr�r�r�r�r�ZDISPLAYZWAYLAND_DISPLAYz$xdg-settings get default-web-browser)r^ZTERMzwww-browserZlinksZelinksZlynxZw3mZBROWSERr4Tr
r)rrKrMr�MacOSXOSAScript�WindowsDefaultr.r/r�r�rr,r-r rrNZcheck_outputrc�decode�strip�FileNotFoundErrorZCalledProcessError�PermissionError�NotADirectoryErrorrr�r!r{�pathsep�reverser#)Ziexplorer$r2Z
raw_result�resultZuserchoicesrSrrrrs\

��

rrHrIc@seZdZddd�ZdS)r�rTcCs:t�d|�zt�|�Wntk
r0YdSXdSdS)Nr@FT)rKrLr.Z	startfilerQr:rrrrXszWindowsDefault.openN)rT)rr	r
rrrrrr�Wsr�r�c@s"eZdZdZdd�Zd	dd�ZdS)
r�a{Launcher class for Aqua browsers on Mac OS X

        Optionally specify a browser name on instantiation.  Note that this
        will not work for Aqua browsers if the user has moved the application
        package after installation.

        If no browser is specified, the default browser, as specified in the
        Internet System Preferences panel, will be used.
        cCs
||_dSr5)rr6rrrr8sszMacOSX.__init__rTc	Cs�t�d|�d|krd|}tt|��}|jdkrDd|�dd�}n<|jdkrTd	}nd
|d}d|�dd�}d
|j||f}t�dd�}|dkr�dS|�|�|�	�}|S)Nr@�:zfile:r��open location "%s"�"�%22ZOmniWebr4ztoWindow %drzOpenURL "%s"z�tell application "%s"
                                activate
                                %s %s
                            end tell�	osascript�wF)
rKrLra�boolrrCr.�popen�writer�)	r7r&r'r(�scriptZtoWindowr2�osapiperfrrrrvs&


�
zMacOSX.openN)rTrUrrrrr�is	r�c@seZdZdd�Zddd�ZdS)	r�cCs
||_dSr5)�_namer6rrrr8�szMacOSXOSAScript.__init__rTcCsb|jdkrd|�dd�}nd|j|�dd�f}t�dd�}|dkrJdS|�|�|��}|S)	Nr�r�r�r�z�
                   tell application "%s"
                       activate
                       open location "%s"
                   end
                   r�r�F)r�rCr.r�r�r�)r7r&r'r(r�r�rfrrrr�s
�
zMacOSXOSAScript.openN)rT)rr	r
r8rrrrrr��sr�c	
Cs�ddl}dtjd}z|�tjdd�d�\}}WnJ|jk
r~}z*t|tjd�t|tjd�t�d�W5d}~XYnXd}|D]"\}}|dkr�d}q�|dkr�d}q�t|�dkr�t|tjd�t�d�|d}t||�td	�dS)
NrzDUsage: %s [-n | -t] url
    -n: open new window
    -t: open new tabrZntd)�filerwz-tr+�)	�getoptrK�argv�error�printr^�exit�lenr)	r�ZusageZoptsr=�msgZnew_win�o�ar&rrr�main�s,�

r��__main__)N)N)rT)+r<r.rr,rKrNZ	threading�__all__�	Exceptionr�RLockrrrrrrrrrr#�objectr3r!r rYrnrprvrxZChromiumrzr{r|r�r�rrMr�r�r�r�rrrrr�<module>sR
"
"O

	
56AK/
__pycache__/os.cpython-38.opt-1.pyc000064400000075207151153537560013012 0ustar00U

e5dS��@s�dZddlZddlZddlZddlmZejZdddddd	d
ddd
dddddddddgZ	dd�Z
dd�Zdekr�dZdZ
ddlTzddlmZe	�d�Wnek
r�YnXddlZzdd lmZWnek
r�YnXddlZe	�ee��[n�d!ek�r�d!Zd"Z
ddlTzddlmZe	�d�Wnek
�rBYnXddlZddlZe	�ee��[zdd lmZWnek
�r�YnXned#��eejd$<dd%lmZmZmZmZmZmZm Z m!Z![e
d&��r�e"�Z#d'd(�Z$e%�Z&e$d)d*�e$d+d,�e$d-d.�e$d/d0�e$d1d2�e$d3d4�e$d5d6�e$d7d8�e$d9d:�e$d;d<�e$d=d>�e$d?d@�e$dAdB�e$dCdD�e$dCdE�e$dFd2�e&Z'e%�Z&e$d)d*�e&Z(e%�Z&e$dGdH�e$dId,�e$dJd.�e$dKdL�e$dKdM�e$dNdO�e&�)e�e$dPdQ�e$dRd2�e$dSd2�e$dTdU�e
dV��r2e
dW��r2e$dXdV�e&Z*e%�Z&e$d)d*�e$d-d.�e$d/d0�e$dYdZ�e$d[d,�e
d\��r�e$d]d.�e$d3d4�e$d^d2�e$d_d0�e$d/d0�e$dFd2�e$d`d0�e&Z+[&[[#[$dZ,daZ-dbZ.d�dedf�Z/dgdh�Z0didj�Z1e	�dfdhdjg�d�dldm�Z2e	�dm�e3ehe'k�rTe4ehe*k�rTd�ddddo�dpdq�Z5drds�Z6e	�dq�dtdu�Z7dvdw�Z8dxdy�Z9dzd{�Z:d|d}�Z;d~d�Z<e	�dudwdyd{d}dg�d�d�d��Z=d�d�d�Z>dd�lm?Z?Gd�d��d�e?�Z@zeAZBWneCk
�r�d�d��ZBYnXd�e	k�re	�d��zeDZEWneCk
�r,d�d��ZEYnXd�e	k�rBe	�d��d�d��ZFeF�ZG[Fd�d�d��ZHed!kZIe	�d��eI�r�d�d��ZJe@eGjKeJeLeJeLeBeE�ZM[Jd�d�d��ZNe	�d��d�d��ZOeO�\ZPZQ[Oe
d���r0e
d���s0e
d���r0dZRdaZSZTe	�d�d�d�g�d�d��ZUd�d��ZVd�d��ZWd�d��ZXd�d��ZYe	�d�d�d�d�g�e
d���rXd�d��ZZd�d��Z[e	�d�d�g�e
d���r�d�d��Z\d�d��Z]e	�d�d�g�d�d�d�Z^Gd�d��d��Z_d�d�Z`d�d��Zae
d���s�eaZbd�eb_cGd�d��d�ejd�Zeed!k�r�Gd�d��d��Zfd�d��ZgdS)�aNOS routines for NT or Posix depending on what system we're on.

This exports:
  - all functions from posix or nt, e.g. unlink, stat, etc.
  - os.path is either posixpath or ntpath
  - os.name is either 'posix' or 'nt'
  - os.curdir is a string representing the current directory (always '.')
  - os.pardir is a string representing the parent directory (always '..')
  - os.sep is the (or a most common) pathname separator ('/' or '\\')
  - os.extsep is the extension separator (always '.')
  - os.altsep is the alternate pathname separator (None or '/')
  - os.pathsep is the component separator used in $PATH etc
  - os.linesep is the line separator in text files ('\r' or '\n' or '\r\n')
  - os.defpath is the default search path for executables
  - os.devnull is the file path of the null device ('/dev/null', etc.)

Programs that import and use 'os' stand a better chance of being
portable between different platforms.  Of course, they must then
only use functions that are defined by all platforms (e.g., unlink
and opendir), and leave all pathname manipulation to os.path
(e.g., split and join).
�N)�_check_methods�altsep�curdir�pardir�sep�pathsep�linesep�defpath�name�path�devnull�SEEK_SET�SEEK_CUR�SEEK_END�fsencode�fsdecode�
get_exec_path�fdopen�popen�extsepcCs
|t�kS�N)�globals)r
�r�/usr/lib64/python3.8/os.py�_exists'srcCs8zt|j�WStk
r2dd�t|�D�YSXdS)NcSsg|]}|ddkr|�qS)r�_r)�.0�nrrr�
<listcomp>.sz%_get_exports_list.<locals>.<listcomp>)�list�__all__�AttributeError�dir)�modulerrr�_get_exports_list*sr$�posix�
)�*)�_exitr()�_have_functions�ntz
zno os specific module foundzos.path)rrrrr	rrrr)cCs"|tkr|tkrt�t|�dSr)�_globalsr)�_set�add)�str�fnrrr�_addfsr0ZHAVE_FACCESSAT�accessZ
HAVE_FCHMODAT�chmodZ
HAVE_FCHOWNAT�chownZHAVE_FSTATAT�statZHAVE_FUTIMESAT�utimeZHAVE_LINKAT�linkZHAVE_MKDIRAT�mkdirZ
HAVE_MKFIFOAT�mkfifoZHAVE_MKNODAT�mknodZHAVE_OPENAT�openZHAVE_READLINKAT�readlinkZ
HAVE_RENAMEAT�renameZHAVE_SYMLINKAT�symlinkZ
HAVE_UNLINKAT�unlink�rmdirZHAVE_UTIMENSATZHAVE_FCHDIR�chdirZHAVE_FCHMODZHAVE_FCHOWNZHAVE_FDOPENDIR�listdir�scandirZHAVE_FEXECVE�execveZHAVE_FTRUNCATE�truncateZ
HAVE_FUTIMENSZHAVE_FUTIMESZHAVE_FPATHCONF�pathconf�statvfs�fstatvfsZ
HAVE_FSTATVFSZ
HAVE_LCHFLAGSZchflagsZHAVE_LCHMOD�lchownZHAVE_LCHOWNZHAVE_LUTIMESZ
HAVE_LSTATZ
MS_WINDOWS���FcCs�t�|�\}}|s t�|�\}}|r||r|t�|�s|zt||d�Wntk
rVYnXt}t|t�rpttd�}||kr|dSzt||�Wn$t	k
r�|r�t�
|�s��YnXdS)a�makedirs(name [, mode=0o777][, exist_ok=False])

    Super-mkdir; create a leaf directory and all intermediate ones.  Works like
    mkdir, except that any intermediate path segment (not just the rightmost)
    will be created if it does not exist. If the target directory already
    exists, raise an OSError if exist_ok is False. Otherwise no exception is
    raised.  This is recursive.

    )�exist_ok�ASCIIN)r�split�exists�makedirs�FileExistsErrorr�
isinstance�bytesr7�OSError�isdir)r
�moderL�head�tail�cdirrrrrP�s$


rPcCsjt|�t�|�\}}|s(t�|�\}}|rf|rfzt|�Wntk
rTYqfYnXt�|�\}}q(dS)a�removedirs(name)

    Super-rmdir; remove a leaf directory and all empty intermediate
    ones.  Works like rmdir except that, if the leaf directory is
    successfully removed, directories corresponding to rightmost path
    segments will be pruned away until either the whole path is
    consumed or an error occurs.  Errors during this latter phase are
    ignored -- they generally mean that a directory was not empty.

    N)r?rrNrT)r
rWrXrrr�
removedirs�s
rZcCsnt�|�\}}|r(|r(t�|�s(t|�t||�t�|�\}}|rj|rjzt|�Wntk
rhYnXdS)a<renames(old, new)

    Super-rename; create directories as necessary and delete any left
    empty.  Works like rename, except creation of any intermediate
    directories needed to make the new pathname good is attempted
    first.  After the rename, directories corresponding to rightmost
    path segments of the old name will be pruned until either the
    whole path is consumed or a nonempty directory is found.

    Note: this function can fail with the new directory structure made
    if you lack permissions needed to unlink the leaf directory or
    file.

    N)rrNrOrPr<rZrT)�old�newrWrXrrr�renames�s
r]Tccst|�}g}g}g}zt|�}Wn8tk
rX}z|dk	rB||�WY�dSd}~XYnX|��z.zt|�}	Wntk
r�YW�qpYnXWnBtk
r�}z$|dk	r�||�WY�W5QR�dSd}~XYnXz|	��}
Wntk
�r�d}
YnX|
�r|�|	j�n|�|	j�|sb|
rb|�r0d}n.z|	��}Wntk
�rVd}YnX|}|rb|�|	j	�qbW5QRX|�r�|||fVt	j
t	j}
}|D]4}|||�}|�s�|
|��s�t||||�EdH�q�n,|D]}t||||�EdH�q�|||fVdS)aDirectory tree generator.

    For each directory in the directory tree rooted at top (including top
    itself, but excluding '.' and '..'), yields a 3-tuple

        dirpath, dirnames, filenames

    dirpath is a string, the path to the directory.  dirnames is a list of
    the names of the subdirectories in dirpath (excluding '.' and '..').
    filenames is a list of the names of the non-directory files in dirpath.
    Note that the names in the lists are just names, with no path components.
    To get a full path (which begins with top) to a file or directory in
    dirpath, do os.path.join(dirpath, name).

    If optional arg 'topdown' is true or not specified, the triple for a
    directory is generated before the triples for any of its subdirectories
    (directories are generated top down).  If topdown is false, the triple
    for a directory is generated after the triples for all of its
    subdirectories (directories are generated bottom up).

    When topdown is true, the caller can modify the dirnames list in-place
    (e.g., via del or slice assignment), and walk will only recurse into the
    subdirectories whose names remain in dirnames; this can be used to prune the
    search, or to impose a specific order of visiting.  Modifying dirnames when
    topdown is false has no effect on the behavior of os.walk(), since the
    directories in dirnames have already been generated by the time dirnames
    itself is generated. No matter the value of topdown, the list of
    subdirectories is retrieved before the tuples for the directory and its
    subdirectories are generated.

    By default errors from the os.scandir() call are ignored.  If
    optional arg 'onerror' is specified, it should be a function; it
    will be called with one argument, an OSError instance.  It can
    report the error to continue with the walk, or raise the exception
    to abort the walk.  Note that the filename is available as the
    filename attribute of the exception object.

    By default, os.walk does not follow symbolic links to subdirectories on
    systems that support them.  In order to get this functionality, set the
    optional argument 'followlinks' to true.

    Caution:  if you pass a relative pathname for top, don't change the
    current working directory between resumptions of walk.  walk never
    changes the current directory, and assumes that the client doesn't
    either.

    Example:

    import os
    from os.path import join, getsize
    for root, dirs, files in os.walk('python/Lib/email'):
        print(root, "consumes", end="")
        print(sum(getsize(join(root, name)) for name in files), end="")
        print("bytes in", len(files), "non-directory files")
        if 'CVS' in dirs:
            dirs.remove('CVS')  # don't visit CVS directories

    NFT)
�fspathrBrT�next�
StopIteration�is_dir�appendr
�
is_symlinkr�islink�join�walk)�top�topdown�onerror�followlinks�dirs�nondirs�	walk_dirs�
scandir_it�error�entryra�	walk_intorcrdre�dirname�new_pathrrrrfs^;"


rf�.��follow_symlinks�dir_fdccs�t|t�rt|d�st|�}|s.t|d|d�}t|t|d�}zB|s^t�	|j
�r|t�|t|��r|t
||t|t�|||�EdHW5t|�XdS)aDirectory tree generator.

        This behaves exactly like walk(), except that it yields a 4-tuple

            dirpath, dirnames, filenames, dirfd

        `dirpath`, `dirnames` and `filenames` are identical to walk() output,
        and `dirfd` is a file descriptor referring to the directory `dirpath`.

        The advantage of fwalk() over walk() is that it's safe against symlink
        races (when follow_symlinks is False).

        If dir_fd is not None, it should be a file descriptor open to a directory,
          and top should be relative; top will then be relative to that directory.
          (dir_fd is always supported for fwalk.)

        Caution:
        Since fwalk() yields file descriptors, those are only valid until the
        next iteration step, so you should dup() them if you want to keep them
        for a longer period.

        Example:

        import os
        for root, dirs, files, rootfd in os.fwalk('python/Lib/email'):
            print(root, "consumes", end="")
            print(sum(os.stat(name, dir_fd=rootfd).st_size for name in files),
                  end="")
            print("bytes in", len(files), "non-directory files")
            if 'CVS' in dirs:
                dirs.remove('CVS')  # don't visit CVS directories
        �	__index__Fru�rwN)rR�int�hasattrr^r4r:�O_RDONLY�close�st�S_ISDIR�st_moder�samestat�_fwalkrS)rgrhrirvrw�orig_st�topfdrrr�fwalk�s!��r�ccs�t|�}g}g}|s|rdng}	|D]�}
|
j}|r:t|�}z4|
��rb|�|�|	dk	rl|	�|
�n
|�|�Wq$tk
r�z|
��r�|�|�Wntk
r�YnXYq$Xq$|r�||||fV|	dkr�|nt||	�D]�}z@|�s|r�t||dd�}n|\}}
|
jdd�}t	|t
|d�}
Wn>tk
�r\}z|dk	�rD||�WY�q�W5d}~XYnXz@|�sxt�
|t|
���r�t�||�}t|
|||||�EdHW5t|
�Xq�|�s�||||fVdS)NF)rwrv)rvry)rBr
rrarbrTrc�zipr4r:r|r}rr�rer�)r��toppath�isbytesrhrirvrnrkrl�entriesrpr
r��dirfd�err�dirpathrrrr��sZ

�r�cGst||�dS)zpexecl(file, *args)

    Execute the executable file with argument list args, replacing the
    current process. N)�execv��file�argsrrr�execlsr�cGs |d}t||dd�|�dS)z�execle(file, *args, env)

    Execute the executable file with argument list args and
    environment env, replacing the current process. ���N)rC�r�r��envrrr�execlesr�cGst||�dS)z�execlp(file, *args)

    Execute the executable file (which is searched for along $PATH)
    with argument list args, replacing the current process. N)�execvpr�rrr�execlp"sr�cGs |d}t||dd�|�dS)z�execlpe(file, *args, env)

    Execute the executable file (which is searched for along $PATH)
    with argument list args and environment env, replacing the current
    process. r�N)�execvper�rrr�execlpe)sr�cCst||�dS)z�execvp(file, args)

    Execute the executable file (which is searched for along $PATH)
    with argument list args, replacing the current process.
    args may be a list or tuple of strings. N��_execvper�rrrr�2sr�cCst|||�dS)z�execvpe(file, args, env)

    Execute the executable file (which is searched for along $PATH)
    with argument list args and environment env, replacing the
    current process.
    args may be a list or tuple of strings. Nr�r�rrrr�:sr�cCs�|dk	rt}||f}nt}|f}t}t�|�r@||f|��dSd}t|�}tdkrft|�}tt|�}|D]~}t�	||�}z||f|��Wqjt
tfk
r�}	z|	}
W5d}	~	XYqjtk
r�}	z|	}
|dkr�|	}W5d}	~	XYqjXqj|dk	r�|�|
�dS)Nr*)
rCr��environrrrrr
r�mapre�FileNotFoundError�NotADirectoryErrorrT)r�r�r��	exec_func�argrest�	saved_exc�	path_listr"�fullname�e�last_excrrrr�Es6


r�c
Cs�ddl}|dkrt}|����|�dt�z|�d�}Wntk
rPd}YnXtr�z|d}Wnttfk
rzYnX|dk	r�t	d��|}|dk	r�t
|t�r�t|�}W5QRX|dkr�t
}|�t�S)z�Returns the sequence of directories that will be searched for the
    named executable (similar to a shell) when launching a process.

    *env* must be an environment variable dict or None.  If *env* is None,
    os.environ will be used.
    rN�ignore�PATHsPATHz*env cannot contain 'PATH' and b'PATH' keys)�warningsr��catch_warnings�simplefilter�BytesWarning�get�	TypeError�supports_bytes_environ�KeyError�
ValueErrorrRrSrr	rNr)r�r�r��
path_listbrrrres0


�)�MutableMappingc@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�_EnvironcCs.||_||_||_||_||_||_||_dSr)�	encodekey�	decodekey�encodevalue�decodevalue�putenv�unsetenv�_data)�self�datar�r�r�r�r�r�rrr�__init__�sz_Environ.__init__cCs>z|j|�|�}Wntk
r2t|�d�YnX|�|�Sr)r�r�r�r��r��key�valuerrr�__getitem__�s
z_Environ.__getitem__cCs.|�|�}|�|�}|�||�||j|<dSr)r�r�r�r�r�rrr�__setitem__�s

z_Environ.__setitem__cCsD|�|�}|�|�z|j|=Wntk
r>t|�d�YnXdSr)r�r�r�r�)r�r��
encodedkeyrrr�__delitem__�s

z_Environ.__delitem__ccs$t|j�}|D]}|�|�VqdSr)rr�r�)r��keysr�rrr�__iter__�s
z_Environ.__iter__cCs
t|j�Sr)�lenr��r�rrr�__len__�sz_Environ.__len__cs$d�d��fdd��j��D���S)Nzenviron({{{}}})z, c3s*|]"\}}d���|���|��VqdS)z
{!r}: {!r}N)�formatr�r�)rr�r�r�rr�	<genexpr>�s�z$_Environ.__repr__.<locals>.<genexpr>)r�rer��itemsr�rr�r�__repr__�s

��z_Environ.__repr__cCst|�Sr)�dictr�rrr�copy�sz
_Environ.copycCs||kr|||<||Srrr�rrr�
setdefault�sz_Environ.setdefaultN)�__name__�
__module__�__qualname__r�r�r�r�r�r�r�r�r�rrrrr��s		r�cCsdSrr)r�r�rrr�<lambda>��r�r�cCs
t|d�S)N�)�_putenv�r�rrrr��r�r�cs�tdkrHdd�}|�t}�fdd�}i}t��D]\}}||||�<q0n(t����fdd���fdd	�}�}t}t|||�|tt�S)
Nr*cSs t|t�stdt|�j��|S)N�str expected, not %s)rRr.r��typer��r�rrr�	check_str�s
z!_createenviron.<locals>.check_strcs�|���Sr)�upperr�)�encoderrr��sz!_createenviron.<locals>.encodekeycs(t|t�stdt|�j��|��d�S)Nr��surrogateescape)rRr.r�r�r�r�r���encodingrrr��s
z_createenviron.<locals>.encodecs|��d�S)Nr�)�decoder�r�rrr��sz_createenviron.<locals>.decode)	r
r.r�r��sys�getfilesystemencodingr�r��	_unsetenv)r�r�r�r�r�r�r)r�r�r�_createenviron�s*�r�cCst�||�S)z�Get an environment variable, return None if it doesn't exist.
    The optional second argument can specify an alternate default.
    key, default and the result are str.)r�r��r��defaultrrr�getenv�sr�)r�r�cCs t|t�stdt|�j��|S)Nzbytes expected, not %s)rRrSr�r�r�r�rrr�_check_bytess
r�cCst�||�S)z�Get an environment variable, return None if it doesn't exist.
        The optional second argument can specify an alternate default.
        key, default and the result are bytes.)�environbr�r�rrr�getenvbsr�)r�r�cs4t���t�����fdd�}��fdd�}||fS)Ncs&t|�}t|t�r|����S|SdS)aEncode filename (an os.PathLike, bytes, or str) to the filesystem
        encoding with 'surrogateescape' error handler, return bytes unchanged.
        On Windows, use 'strict' error handler if the file system encoding is
        'mbcs' (which is the default encoding).
        N)r^rRr.r���filename�r��errorsrrr s
z_fscodec.<locals>.fsencodecs&t|�}t|t�r|����S|SdS)aDecode filename (an os.PathLike, bytes, or str) from the filesystem
        encoding with 'surrogateescape' error handler, return str unchanged. On
        Windows, use 'strict' error handler if the file system encoding is
        'mbcs' (which is the default encoding).
        N)r^rRrSr�r�r�rrr,s
z_fscodec.<locals>.fsdecode)r�r��getfilesystemencodeerrors)rrrr�r�_fscodecs
r��fork�spawnvr��P_WAIT�P_NOWAIT�	P_NOWAITOcCs�t|ttf�std��|r"|ds*td��t�}|spz$|dkrJ|||�n||||�Wq�td�Yq�XnR|tkr||St|d�\}}t	|�r�q|q|t
|�r�t|�St|�r�t
|�Std��q|dS)Nzargv must be a tuple or a listrz"argv first element cannot be empty�z"Not stopped, signaled or exited???)rR�tuplerr�r�r�r(r��waitpid�
WIFSTOPPED�WIFSIGNALED�WTERMSIG�	WIFEXITED�WEXITSTATUSrT)rVr�r�r��func�pid�wpid�stsrrr�	_spawnvefIs,
rcCst|||dt�S)aspawnv(mode, file, args) -> integer

Execute file with arguments from args in a subprocess.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. N)rr��rVr�r�rrrr�hscCst||||t�S)a:spawnve(mode, file, args, env) -> integer

Execute file with arguments from args in a subprocess with the
specified environment.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. )rrC�rVr�r�r�rrr�spawnveqsrcCst|||dt�S)a8spawnvp(mode, file, args) -> integer

Execute file (which is looked for along $PATH) with arguments from
args in a subprocess.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. N)rr�rrrr�spawnvp}sr	cCst||||t�S)a\spawnvpe(mode, file, args, env) -> integer

Execute file (which is looked for along $PATH) with arguments from
args in a subprocess with the supplied environment.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. )rr�rrrr�spawnvpe�sr
cGst|||�S)aspawnl(mode, file, *args) -> integer

Execute file with arguments from args in a subprocess.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. )r�rrrr�spawnl�srcGs|d}t|||dd�|�S)a:spawnle(mode, file, *args, env) -> integer

Execute file with arguments from args in a subprocess with the
supplied environment.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. r�N)rrrrr�spawnle�srcGst|||�S)aWspawnlp(mode, file, *args) -> integer

Execute file (which is looked for along $PATH) with arguments from
args in a subprocess with the supplied environment.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. )r	rrrr�spawnlp�sr
cGs|d}t|||dd�|�S)a]spawnlpe(mode, file, *args, env) -> integer

Execute file (which is looked for along $PATH) with arguments from
args in a subprocess with the supplied environment.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. r�N)r
rrrr�spawnlpe�sr�rr�cCs�t|t�stdt|���|dkr.td|��|dks>|dkrFtd��ddl}ddl}|dkr�|j|d|j|d�}t	|�
|j�|�S|j|d|j|d	�}t	|�
|j�|�SdS)
Nz&invalid cmd type (%s, expected string))r�wzinvalid mode %rrz+popen() does not support unbuffered streamsrT)�shell�stdout�bufsize)r�stdinr)
rRr.r�r�r��
subprocess�io�Popen�PIPE�_wrap_close�
TextIOWrapperrr)�cmdrV�	bufferingrr�procrrrr�s(
��c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)rcCs||_||_dSr)�_stream�_proc)r��streamrrrrr��sz_wrap_close.__init__cCs8|j��|j��}|dkr dStdkr,|S|d>SdS)Nrr*�)rr}r�waitr
)r��
returncoderrrr}�s

z_wrap_close.closecCs|Srrr�rrr�	__enter__�sz_wrap_close.__enter__cGs|��dSr�r}�r�r�rrr�__exit__�sz_wrap_close.__exit__cCst|j|�Sr)�getattrr)r�r
rrr�__getattr__�sz_wrap_close.__getattr__cCs
t|j�Sr)�iterrr�rrrr��sz_wrap_close.__iter__N)	r�r�r�r�r}r$r'r)r�rrrrr�s	rcOs4t|t�stdt|���ddl}|j|f|�|�S)Nz&invalid fd type (%s, expected integer)r)rRrzr�r�rr:)�fdr��kwargsrrrrr�s
cCs�t|ttf�r|St|�}z|�|�}Wn0tk
rXt|d�rF�ntd|j��YnXt|ttf�rl|Std�	|jt|�j���dS)aaReturn the path representation of a path-like object.

    If str or bytes is passed in, it is returned unchanged. Otherwise the
    os.PathLike interface is used to get the path representation. If the
    path representation is not str or bytes, TypeError is raised. If the
    provided path is not str, bytes, or os.PathLike, TypeError is raised.
    �
__fspath__z/expected str, bytes or os.PathLike object, not z7expected {}.__fspath__() to return str or bytes, not {}N)
rRr.rSr�r-r!r{r�r�r�)r�	path_type�	path_reprrrr�_fspaths"
��r0r^c@s*eZdZdZejdd��Zedd��ZdS)�PathLikezCAbstract base class for implementing the file system path protocol.cCst�dS)z9Return the file system path representation of the object.N)�NotImplementedErrorr�rrrr-,szPathLike.__fspath__cCs|tkrt|d�StS)Nr-)r1r�NotImplemented)�cls�subclassrrr�__subclasshook__1s
zPathLike.__subclasshook__N)	r�r�r��__doc__�abc�abstractmethodr-�classmethodr6rrrrr1(s

r1c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�_AddedDllDirectorycCs||_||_||_dSr)r�_cookie�_remove_dll_directory)r�r�cookieZremove_dll_directoryrrrr�:sz_AddedDllDirectory.__init__cCs|�|j�d|_dSr)r=r<rr�rrrr}>sz_AddedDllDirectory.closecCs|Srrr�rrrr$Asz_AddedDllDirectory.__enter__cGs|��dSrr%r&rrrr'Csz_AddedDllDirectory.__exit__cCs|jrd�|j�SdS)Nz<AddedDllDirectory({!r})>z<AddedDllDirectory()>)rr�r�rrrr�Esz_AddedDllDirectory.__repr__N)r�r�r�r�r}r$r'r�rrrrr;9s
r;cCs ddl}|�|�}t|||j�S)aOAdd a path to the DLL search path.

        This search path is used when resolving dependencies for imported
        extension modules (the module itself is resolved through sys.path),
        and also by ctypes.

        Remove the directory by calling close() on the returned object or
        using it in a with statement.
        rN)r*Z_add_dll_directoryr;r=)rr*r>rrr�add_dll_directoryJs

�r?)rKF)TNF)rtTN)N)N)N)N)rr�)hr7r8r�r4r~�_collections_abcr�builtin_module_namesZ_namesr rr$r
rr%r(rb�ImportError�	posixpathrr)�extendr*Zntpath�modulesZos.pathrrrrr	rrrrr+r0�setr,�supports_dir_fd�supports_effective_idsr-�supports_fd�supports_follow_symlinksr
rrrPrZr]rfr:rBr�r�r�r�r�r�r�r�r�rr�r�r�r��	NameErrorr�r�r�r�r�r�r�r�rSr�r�r�rrr�r�r�rr�rr	r
rrr
rrrrr0r^r��ABCr1r;r?rrrr�<module>s��

(











































 

08
		
 
-7





�


	

	


	

__pycache__/__phello__.foo.cpython-38.opt-1.pyc000064400000000201151153537560015210 0ustar00U

e5d@�@sdS)N�rrr�&/usr/lib64/python3.8/__phello__.foo.py�<module>�__pycache__/tokenize.cpython-38.pyc000064400000041412151153537560013251 0ustar00U

e5d�d�@sHdZdZdZddlmZddlmZmZddl	Z	ddl
mZddlZ
ddlZddlZddlTdd	lmZe�d
ej�Ze�dej�ZddlZejdd
dddgZ[Gdd�de	�dd��Zdd�Zdd�Zdd�ZdZdZeede�ee�ZdZdZ dZ!dZ"d Z#ee e!e"e#�Z$d!Z%ed"d#�ee%�Z&d$e%Z'ee&e'�Z(ed%e(d&�Z)ee)e(e$�Z*d'd(�Z+d)d*�Z,ee+��Z-d+Z.d,Z/d-Z0d.Z1ee-d/e-d0�Z2ee-d1e-d2�Z3ee4ej5e6ed3d4���Z7ed5e7�Z8ee*e8e3e�Z9ee9Z:ee-d6ed7d�e-d8ed9d��Z;ed:ee2�Z<eee<e*e8e;e�Z=iZ>e+�D]6Z?e.e>e?d7<e/e>e?d9<e0e>e?d/<e1e>e?d0<�q,e@�ZAe@�ZBe+�D]JZCeCd9eCd7fD]ZDeA�EeD��q�eCd0eCd/fD]ZDeB�EeD��q��qvd;ZFGd<d=�d=eG�ZHGd>d?�d?eG�ZIGd@dA�dA�ZJdBd�ZKdCdD�ZLdEd�ZMdFdG�ZdHd�ZNdIdJ�ZOdKd
�ZPdLdM�ZQeRdNk�rDeQ�dS)OaoTokenization help for Python programs.

tokenize(readline) is a generator that breaks a stream of bytes into
Python tokens.  It decodes the bytes according to PEP-0263 for
determining source file encoding.

It accepts a readline-like method which is called repeatedly to get the
next line of input (or b"" for EOF).  It generates 5-tuples with these
members:

    the token type (see token.py)
    the token (a string)
    the starting (row, column) indices of the token (a 2-tuple of ints)
    the ending (row, column) indices of the token (a 2-tuple of ints)
    the original line (string)

It is designed to match the working of the Python tokenizer exactly, except
that it produces COMMENT tokens for comments and gives type OP for all
operators.  Additionally, all token lists start with an ENCODING token
which tells you which encoding was used to decode the bytes stream.
zKa-Ping Yee <ping@lfw.org>zpGvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, Skip Montanaro, Raymond Hettinger, Trent Nelson, Michael Foord�)�open)�lookup�BOM_UTF8N)�
TextIOWrapper)�*)�EXACT_TOKEN_TYPESz&^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)s^[ \t\f]*(?:[#\r\n]|$)�tokenize�generate_tokens�detect_encoding�
untokenize�	TokenInfoc@s eZdZdd�Zedd��ZdS)rcCs$d|jt|jf}d|j|d�S)Nz%d (%s)z8TokenInfo(type=%s, string=%r, start=%r, end=%r, line=%r))�type)r
�tok_name�_replace)�self�annotated_type�r� /usr/lib64/python3.8/tokenize.py�__repr__.s
�zTokenInfo.__repr__cCs(|jtkr|jtkrt|jS|jSdS�N)r
�OP�stringr�rrrr�
exact_type3s
zTokenInfo.exact_typeN)�__name__�
__module__�__qualname__r�propertyrrrrrr-sztype string start end linecGsdd�|�dS)N�(�|�))�join��choicesrrr�group:�r$cGst|�dS)Nr�r$r"rrr�any;r%r'cGst|�dS)N�?r&r"rrr�maybe<r%r)z[ \f\t]*z	#[^\r\n]*z\\\r?\nz\w+z0[xX](?:_?[0-9a-fA-F])+z0[bB](?:_?[01])+z0[oO](?:_?[0-7])+z(?:0(?:_?0)*|[1-9](?:_?[0-9])*)z[eE][-+]?[0-9](?:_?[0-9])*z)[0-9](?:_?[0-9])*\.(?:[0-9](?:_?[0-9])*)?z\.[0-9](?:_?[0-9])*z[0-9](?:_?[0-9])*z[0-9](?:_?[0-9])*[jJ]z[jJ]cCs^ddddddg}dh}|D]>}t�|�D].}tjdd	�|D��D]}|�d�|��q@q(q|S)
N�b�r�u�f�br�fr�cSsg|]}||��f�qSr)�upper)�.0�crrr�
<listcomp>^sz(_all_string_prefixes.<locals>.<listcomp>)�
_itertools�permutations�product�addr!)�_valid_string_prefixes�result�prefix�tr,rrr�_all_string_prefixesSsr=cCst�|tj�Sr)�re�compile�UNICODE)�exprrrr�_compilebsrBz[^'\\]*(?:\\.[^'\\]*)*'z[^"\\]*(?:\\.[^"\\]*)*"z%[^'\\]*(?:(?:\\.|'(?!''))[^'\\]*)*'''z%[^"\\]*(?:(?:\\.|"(?!""))[^"\\]*)*"""z'''z"""z'[^\n'\\]*(?:\\.[^\n'\\]*)*'z"[^\n"\\]*(?:\\.[^\n"\\]*)*"T)�reversez\r?\nz'[^\n'\\]*(?:\\.[^\n'\\]*)*�'z"[^\n"\\]*(?:\\.[^\n"\\]*)*�"z
\\\r?\n|\Z�c@seZdZdS)�
TokenErrorN�rrrrrrrrG�srGc@seZdZdS)�StopTokenizingNrHrrrrrI�srIc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�UntokenizercCsg|_d|_d|_d|_dS)N�r)�tokens�prev_row�prev_col�encodingrrrr�__init__�szUntokenizer.__init__cCs�|\}}||jks&||jkr>||jkr>td�|||j|j���||j}|rb|j�d|�d|_||j}|r�|j�d|�dS)Nz+start ({},{}) precedes previous end ({},{})�\
r� )rMrN�
ValueError�formatrL�append)r�start�row�col�
row_offset�
col_offsetrrr�add_whitespace�s�

zUntokenizer.add_whitespacecCs6t|�}g}d}|D�]}t|�dkr8|�||��q*|\}}}}	}
|tkrV||_q|tkrd�q*|tkrz|�|�qnl|tkr�|�	�|	\|_
|_qnL|tt
fkr�d}n:|r�|r�|d}|dt|�kr�|j�|�t|�|_d}|�|�|j�|�|	\|_
|_|tt
fkr|j
d7_
d|_qd�|j�S)NF�T���rKrr0)�iter�len�compat�ENCODINGrO�	ENDMARKER�INDENTrU�DEDENT�poprMrN�NEWLINE�NLrLr[r!)r�iterable�it�indents�	startliner<�tok_type�tokenrV�end�line�indentrrrr�sF



zUntokenizer.untokenizec
Cs�g}|jj}|dttfk}d}t�|g|�D]�}|dd�\}}	|tkrR|	|_q.|tt	fkrf|	d7}	|t
kr�|rzd|	}	d}nd}|tkr�|�|	�q.n>|tkr�|�
�q.n*|ttfkr�d}n|r�|r�||d�d}||	�q.dS)NrFr\rRTr])rLrUrfrgr5�chainrarO�NAME�NUMBER�STRINGrcrdre)
rrmrhrj�toks_appendrk�
prevstring�tok�toknum�tokvalrrrr`�s8
zUntokenizer.compatN)rrrrPr[rr`rrrrrJ�s
%rJcCs*t�}|�|�}|jdk	r&|�|j�}|S)aTransform tokens back into Python source code.
    It returns a bytes object, encoded using the ENCODING
    token, which is the first token sequence output by tokenize.

    Each element returned by the iterable must be a token sequence
    with at least two elements, a token number and token value.  If
    only two tokens are passed, the resulting output is poor.

    Round-trip invariant for full input:
        Untokenized source will match input source exactly

    Round-trip invariant for limited input:
        # Output bytes will tokenize back to the input
        t1 = [tok[:2] for tok in tokenize(f.readline)]
        newcode = untokenize(t1)
        readline = BytesIO(newcode).readline
        t2 = [tok[:2] for tok in tokenize(readline)]
        assert t1 == t2
    N)rJrrO�encode)rh�ut�outrrrrs


cCsH|dd����dd�}|dks*|�d�r.dS|dks@|�d�rDd	S|S)
z(Imitates get_normal_name in tokenizer.c.N��_�-�utf-8zutf-8-)zlatin-1�
iso-8859-1ziso-latin-1)zlatin-1-ziso-8859-1-ziso-latin-1-r�)�lower�replace�
startswith)�orig_enc�encrrr�_get_normal_names�r�cs�z�jj�Wntk
r$d�YnXd�d}d}�fdd�}��fdd�}|�}|�t�rpd�|d	d�}d
}|s||gfS||�}|r�||gfSt�|�s�||gfS|�}|s�||gfS||�}|r�|||gfS|||gfS)a
    The detect_encoding() function is used to detect the encoding that should
    be used to decode a Python source file.  It requires one argument, readline,
    in the same way as the tokenize() generator.

    It will call readline a maximum of twice, and return the encoding used
    (as a string) and a list of any lines (left as bytes) it has read in.

    It detects the encoding from the presence of a utf-8 bom or an encoding
    cookie as specified in pep-0263.  If both a bom and a cookie are present,
    but disagree, a SyntaxError will be raised.  If the encoding cookie is an
    invalid charset, raise a SyntaxError.  Note that if a utf-8 bom is found,
    'utf-8-sig' is returned.

    If no encoding is specified, then the default of 'utf-8' will be returned.
    NFr�cs$z��WStk
rYdSXdS)Nr%)�
StopIterationr��readlinerr�read_or_stop?sz%detect_encoding.<locals>.read_or_stopcs�z|�d�}Wn4tk
rBd}�dk	r6d�|��}t|��YnXt�|�}|sVdSt|�d��}zt|�}Wn:t	k
r��dkr�d|}nd��|�}t|��YnX�r�|dkr؈dkr�d}n
d���}t|��|d	7}|S)
Nr�z'invalid or missing encoding declarationz{} for {!r}rKzunknown encoding: zunknown encoding for {!r}: {}zencoding problem: utf-8z encoding problem for {!r}: utf-8z-sig)
�decode�UnicodeDecodeErrorrT�SyntaxError�	cookie_re�matchr�r$r�LookupError)ro�line_string�msgr�rO�codec)�	bom_found�filenamerr�find_cookieEs8

�
z$detect_encoding.<locals>.find_cookieT��	utf-8-sig)�__self__�name�AttributeErrorr�r�blank_rer�)r�rO�defaultr�r��first�secondr)r�r�r�rr
's8
&




cCsXt|d�}z2t|j�\}}|�d�t||dd�}d|_|WS|���YnXdS)zXOpen a file in read only mode using the encoding detected by
    detect_encoding().
    �rbrT)�line_bufferingr+N)�
_builtin_openr
r��seekr�mode�close)r��bufferrO�lines�textrrrr�s

rcCs6t|�\}}t�d�}t�|t|d�|�}t|j|�S)a�
    The tokenize() generator requires one argument, readline, which
    must be a callable object which provides the same interface as the
    readline() method of built-in file objects.  Each call to the function
    should return one line of input as bytes.  Alternatively, readline
    can be a callable function terminating with StopIteration:
        readline = open(myfile, 'rb').__next__  # Example of alternate readline

    The generator produces 5-tuples with these members: the token type; the
    token string; a 2-tuple (srow, scol) of ints specifying the row and
    column where the token begins in the source; a 2-tuple (erow, ecol) of
    ints specifying the row and column where the token ends in the source;
    and the line on which the token was found.  The line passed is the
    physical line.

    The first token sequence will always be an ENCODING token
    which tells you which encoding was used to decode the bytes stream.
    r%)r
r5�repeatrqr^�	_tokenize�__next__)r�rO�consumed�empty�rl_genrrrr�s
ccs|d}}}d}d\}}d}dg}	|dk	rH|dkr6d}tt|ddd�Vd}
d}z|}
|�}Wntk
rvd}YnX|dk	r�|�|�}|d	7}dt|�}}
|�rp|s�td
|��|�|�}|�r|�d�}}tt||d|�|||f||�Vd\}}d}nf|�rZ|dd�dk�rZ|d
d�dk�rZtt	||||t|�f|�Vd}d}qPn||}||}qP�n�|dk�r|�s|�s��q�d}||
k�r�||dk�r�|d	7}n8||dk�r�|t
d	t
}n||dk�r�d}n�q�|d	7}�q�||
k�r�q�||dk�r�||dk�r^||d��d�}tt|||f||t|�f|�V|t|�7}tt
||d�||f|t|�f|�VqP||	dk�r�|	�|�tt|d|�|df||f|�V||	dk�r.||	k�r�tdd|||f��|	dd�}	ttd||f||f|�V�q�n|�s*td|df��d}||
krPtt��||�}|�r�|�d	�\}}||f||f|}}}||k�r��q.|||�||}}||k�s�|dk�r�|dk�r�|dk�r�tt||||�V�q�|dk�r|dk�r�tt
||||�Vntt||||�V�q�|dk�rB|�d��r,t�tt||||�V�q�|tk�r�tt|�}|�||�}|�r�|�d�}|||�}tt||||f|�Vn||f}||d�}|}qP�q�|tk�s�|dd�tk�s�|dd�tk�rV|ddk�rB||f}tt�|��p$t�|d	��p$t�|d��}||d�d	}}|}qPntt||||�Vnf|���rttt||||�VnH|dk�r�d	}n8|dk�r�|d	7}n|d k�r�|d	8}tt||||�Vn*tt	||||f||d	f|�V|d	7}�q.qP|
�r0|
ddk�r0ttd|d	t|
�f|d	t|
�d	fd�V|	d	d�D] }ttd|df|dfd�V�q<tt d|df|dfd�VdS)!Nr�
0123456789)r0rr�r�)rrr0r%rKzEOF in multi-line string���rQ���z\
rR�	�z#
�#z
r]z3unindent does not match any outer indentation levelz
<tokenize>zEOF in multi-line statement�.z...�
r\r��\z([{z)]})!rrar�r�r_rGr�rnrt�
ERRORTOKEN�tabsize�rstrip�COMMENTrgrUrc�IndentationErrorrdrB�PseudoToken�spanrsrf�endswith�AssertionError�
triple_quoted�endpats�
single_quoted�get�isidentifierrrrrb)r�rO�lnum�parenlev�	continued�numchars�contstr�needcont�contlinerj�	last_linero�pos�max�strstart�endprog�endmatchrn�column�
comment_token�pseudomatchrV�spos�eposrm�initialrprrrr��s>




�*

�


�
�
"

� 

���





����






�.r�cCs
t|d�S)z�Tokenize a source reading Python code as unicode strings.

    This has the same API as tokenize(), except that it expects the *readline*
    callable to return str objects instead of bytes.
    N)r�r�rrrr	dsc

s$ddl}dd��d�fdd�	}|jdd�}|jdd	d
dd�|jd
ddddd�|��}z�|jr�|j}t|d��}tt|j��}W5QRXnd}t	t
jjd�}|D]>}|j}|j
r�|j}d|j|j}	td|	t||jf�q�W�n8tk
�r6}
z0|
jddd�\}}||
jd|||f�W5d}
~
XYn�tk
�r|}
z(|
jd\}}||
jd|||f�W5d}
~
XYn�tk
�r�}
z||
|�W5d}
~
XYnxtk
�r�}
z||
�W5d}
~
XYnNtk
�r�td�Yn2tk
�r}
z�d|
��W5d}
~
XYnXdS)NrcSstj�|�tj�d�dS)Nr�)�sys�stderr�write)�messagerrr�perrorpszmain.<locals>.perrorcsR|r"|f||f}�d|�n"|r8�d||f�n�d|�t�d�dS)Nz%s:%d:%d: error: %sz
%s: error: %sz	error: %srK)r��exit)r�r��location�args�r�rr�errortszmain.<locals>.errorzpython -m tokenize)�progr�r(zfilename.pyz'the file to tokenize; defaults to stdin)�dest�nargs�metavar�helpz-ez--exact�exact�
store_truez(display token names using the exact type)r��actionr�r�z<stdin>z%d,%d-%d,%d:z%-20s%-15s%-15rrKr�zinterrupted
zunexpected error: %s)NN)�argparse�ArgumentParser�add_argument�
parse_argsr�r��listrr�r�r��stdinr
r�rrVrn�printrrr�r�rGr��OSError�KeyboardInterrupt�	Exception)
r�r��parserr�r�r-rLrm�
token_type�token_range�errror�rr�r�mainlsT���&&r��__main__)S�__doc__�
__author__�__credits__�builtinsrr��codecsrr�collections�ior�	itertoolsr5r>r�rmrr?�ASCIIr�r��__all__�
namedtuplerr$r'r)�
Whitespace�Comment�Ignore�Name�	Hexnumber�	Binnumber�	Octnumber�	Decnumber�	Intnumber�Exponent�
Pointfloat�Expfloat�Floatnumber�
Imagnumber�Numberr=rB�StringPrefix�Single�Double�Single3�Double3�Triple�String�map�escape�sorted�Special�Funny�
PlainToken�Token�ContStr�PseudoExtrasr�r��_prefix�setr�r�r<r,r8r�r�rGrIrJrr�r
rr�r	r�rrrrr�<module>s�
�
��

�
���

_]8=
__pycache__/_weakrefset.cpython-38.opt-1.pyc000064400000016662151153537560014670 0ustar00U

e5dg�@s2ddlmZdgZGdd�d�ZGdd�d�ZdS)���ref�WeakSetc@s$eZdZdd�Zdd�Zdd�ZdS)�_IterationGuardcCst|�|_dS�N)r�
weakcontainer)�selfr�r	�#/usr/lib64/python3.8/_weakrefset.py�__init__sz_IterationGuard.__init__cCs |��}|dk	r|j�|�|Sr)r�
_iterating�add)r�wr	r	r
�	__enter__sz_IterationGuard.__enter__cCs0|��}|dk	r,|j}|�|�|s,|��dSr)rr�remove�_commit_removals)r�e�t�br�sr	r	r
�__exit__s
z_IterationGuard.__exit__N)�__name__�
__module__�__qualname__rrrr	r	r	r
r
src@seZdZd@dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZeZd d!�Zd"d#�Zd$d%�ZeZd&d'�Zd(d)�Zd*d+�ZeZd,d-�Zd.d/�ZeZd0d1�Zd2d3�Zd4d5�Z e Z!d6d7�Z"d8d9�Z#d:d;�Z$e$Z%d<d=�Z&d>d?�Z'dS)ArNcCsBt�|_t|�fdd�}||_g|_t�|_|dk	r>|�|�dS)NcSs2|�}|dk	r.|jr"|j�|�n|j�|�dSr)r�_pending_removals�append�data�discard)�itemZselfrefrr	r	r
�_remove&s
z!WeakSet.__init__.<locals>._remove)�setrrrrr�update)rrrr	r	r
r$szWeakSet.__init__cCs$|j}|jj}|r ||���qdSr)rrr�pop)r�lrr	r	r
r4szWeakSet._commit_removalsc	cs8t|��&|jD]}|�}|dk	r|VqW5QRXdSr)rr�rZitemrefrr	r	r
�__iter__:s


zWeakSet.__iter__cCst|j�t|j�Sr)�lenrr�rr	r	r
�__len__CszWeakSet.__len__cCs.zt|�}Wntk
r"YdSX||jkS)NF)r�	TypeErrorr)rrZwrr	r	r
�__contains__Fs
zWeakSet.__contains__cCs|jt|�ft|dd�fS)N�__dict__)�	__class__�list�getattrr'r	r	r
�
__reduce__Ms
�zWeakSet.__reduce__cCs&|jr|��|j�t||j��dSr)rrrr
rr�rrr	r	r
r
QszWeakSet.addcCs|jr|��|j��dSr)rrr�clearr'r	r	r
r1Vsz
WeakSet.clearcCs
|�|�Sr�r,r'r	r	r
�copy[szWeakSet.copycCsT|jr|��z|j��}Wntk
r:td�d�YnX|�}|dk	r|SqdS)Nzpop from empty WeakSet)rrrr"�KeyErrorr$r	r	r
r"^szWeakSet.popcCs"|jr|��|j�t|��dSr)rrrrrr0r	r	r
rjszWeakSet.removecCs"|jr|��|j�t|��dSr)rrrrrr0r	r	r
roszWeakSet.discardcCs&|jr|��|D]}|�|�qdSr)rrr
)r�otherZelementr	r	r
r!tszWeakSet.updatecCs|�|�|Sr)r!�rr5r	r	r
�__ior__zs
zWeakSet.__ior__cCs|��}|�|�|Sr)r3�difference_update�rr5Znewsetr	r	r
�
difference~s
zWeakSet.differencecCs|�|�dSr)�__isub__r6r	r	r
r8�szWeakSet.difference_updatecCs<|jr|��||kr"|j��n|j�dd�|D��|S)Ncss|]}t|�VqdSrr��.0rr	r	r
�	<genexpr>�sz#WeakSet.__isub__.<locals>.<genexpr>)rrrr1r8r6r	r	r
r;�szWeakSet.__isub__cs���fdd�|D��S)Nc3s|]}|�kr|VqdSrr	r<r'r	r
r>�sz'WeakSet.intersection.<locals>.<genexpr>r2r6r	r'r
�intersection�szWeakSet.intersectioncCs|�|�dSr)�__iand__r6r	r	r
�intersection_update�szWeakSet.intersection_updatecCs(|jr|��|j�dd�|D��|S)Ncss|]}t|�VqdSrrr<r	r	r
r>�sz#WeakSet.__iand__.<locals>.<genexpr>)rrrrAr6r	r	r
r@�szWeakSet.__iand__cCs|j�dd�|D��S)Ncss|]}t|�VqdSrrr<r	r	r
r>�sz#WeakSet.issubset.<locals>.<genexpr>)r�issubsetr6r	r	r
rB�szWeakSet.issubsetcCs|jttt|��kSr�rr �maprr6r	r	r
�__lt__�szWeakSet.__lt__cCs|j�dd�|D��S)Ncss|]}t|�VqdSrrr<r	r	r
r>�sz%WeakSet.issuperset.<locals>.<genexpr>)r�
issupersetr6r	r	r
rF�szWeakSet.issupersetcCs|jttt|��kSrrCr6r	r	r
�__gt__�szWeakSet.__gt__cCs$t||j�stS|jttt|��kSr)�
isinstancer,�NotImplementedrr rDrr6r	r	r
�__eq__�szWeakSet.__eq__cCs|��}|�|�|Sr)r3�symmetric_difference_updater9r	r	r
�symmetric_difference�s
zWeakSet.symmetric_differencecCs|�|�dSr)�__ixor__r6r	r	r
rK�sz#WeakSet.symmetric_difference_updatecs@�jr����|kr"�j��n�j��fdd�|D���S)Nc3s|]}t|�j�VqdSr)rrr<r'r	r
r>�sz#WeakSet.__ixor__.<locals>.<genexpr>)rrrr1rKr6r	r'r
rM�szWeakSet.__ixor__cCs|�dd�||fD��S)Ncss|]}|D]
}|Vq
qdSrr	)r=rrr	r	r
r>�sz WeakSet.union.<locals>.<genexpr>r2r6r	r	r
�union�sz
WeakSet.unioncCst|�|��dkS)Nr)r&r?r6r	r	r
�
isdisjoint�szWeakSet.isdisjointcCs
t|j�Sr)�reprrr'r	r	r
�__repr__�szWeakSet.__repr__)N)(rrrrrr%r(r*r/r
r1r3r"rrr!r7r:�__sub__r8r;r?�__and__rAr@rB�__le__rErF�__ge__rGrJrL�__xor__rKrMrN�__or__rOrQr	r	r	r
r#sJ
			N)�_weakrefr�__all__rrr	r	r	r
�<module>s__pycache__/formatter.cpython-38.opt-1.pyc000064400000042213151153537560014363 0ustar00U

e5d';�@s�dZddlZddlZejdedd�dZGdd�d�ZGdd	�d	�ZGd
d�d�ZGdd
�d
e�Z	Gdd�de�Z
ddd�Zedkr�e�dS)aGeneric output formatting.

Formatter objects transform an abstract flow of formatting events into
specific output events on writer objects. Formatters manage several stack
structures to allow various properties of a writer object to be changed and
restored; writers need not be able to handle relative changes nor any sort
of ``change back'' operation. Specific writer properties which may be
controlled via formatter objects are horizontal alignment, font, and left
margin indentations. A mechanism is provided which supports providing
arbitrary, non-exclusive style settings to a writer as well. Additional
interfaces facilitate formatting events which are not reversible, such as
paragraph separation.

Writer objects encapsulate device interfaces. Abstract devices, such as
file formats, are supported as well as physical devices. The provided
implementations all work with abstract devices. The interface makes
available mechanisms for setting the properties which formatter objects
manage and inserting data into the output.
�Nz"the formatter module is deprecated�)�
stacklevelc@s�eZdZdZd(dd�Zdd�Zdd�Zd	d
�Zd)dd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd*d$d%�Zd+d&d'�ZdS),�
NullFormattera=A formatter which does nothing.

    If the writer parameter is omitted, a NullWriter instance is created.
    No methods of the writer are called by NullFormatter instances.

    Implementations should inherit from this class if implementing a writer
    interface but don't need to inherit any implementation.

    NcCs|dkrt�}||_dS�N)�
NullWriter�writer��selfr�r
�!/usr/lib64/python3.8/formatter.py�__init__)szNullFormatter.__init__cCsdSrr
�r	�	blankliner
r
r�
end_paragraph-�zNullFormatter.end_paragraphcCsdSrr
�r	r
r
r�add_line_break.rzNullFormatter.add_line_breakcOsdSrr
�r	�args�kwr
r
r�add_hor_rule/rzNullFormatter.add_hor_rulecCsdSrr
�r	�format�counterrr
r
r�add_label_data0rzNullFormatter.add_label_datacCsdSrr
�r	�datar
r
r�add_flowing_data1rzNullFormatter.add_flowing_datacCsdSrr
rr
r
r�add_literal_data2rzNullFormatter.add_literal_datacCsdSrr
rr
r
r�flush_softspace3rzNullFormatter.flush_softspacecCsdSrr
�r	�alignr
r
r�push_alignment4rzNullFormatter.push_alignmentcCsdSrr
rr
r
r�
pop_alignment5rzNullFormatter.pop_alignmentcCsdSrr
)r	�xr
r
r�	push_font6rzNullFormatter.push_fontcCsdSrr
rr
r
r�pop_font7rzNullFormatter.pop_fontcCsdSrr
)r	�marginr
r
r�push_margin8rzNullFormatter.push_margincCsdSrr
rr
r
r�
pop_margin9rzNullFormatter.pop_margincCsdSrr
�r	�spacingr
r
r�set_spacing:rzNullFormatter.set_spacingcGsdSrr
�r	�stylesr
r
r�
push_style;rzNullFormatter.push_style�cCsdSrr
�r	�nr
r
r�	pop_style<rzNullFormatter.pop_stylecCsdSrr
�r	�flagr
r
r�assert_line_data=rzNullFormatter.assert_line_data)N)N)r0)r0)�__name__�
__module__�__qualname__�__doc__rrrrrrrrr"r#r%r&r(r)r,r/r3r6r
r
r
rrs&



rc@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd.dd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd/d*d+�Zd0d,d-�Zd
S)1�AbstractFormatterz�The standard formatter.

    This implementation has demonstrated wide applicability to many writers,
    and may be used directly in most circumstances.  It has been used to
    implement a full-featured World Wide Web browser.

    cCsR||_d|_g|_g|_g|_d|_g|_d|_d|_d|_	d|_
d|_d|_dS�Nr0r)
rr!�align_stack�
font_stack�margin_stackr+�style_stack�nospace�	softspace�para_end�parskip�
hard_break�
have_labelrr
r
rrNszAbstractFormatter.__init__cCs`|js|j��d|_|j|krD|jsD|j�||j�||_d|_d|_|_|_d|_dS�Nrr0)	rEr�send_line_breakrFrD�send_paragraphrArCrBr
r
r
rr]s
zAbstractFormatter.end_paragraphcCs8|js"|js"|j��d|_|_d|_|_d|_dSrG)rErCrrHrFrDrArBrr
r
rrhs

z AbstractFormatter.add_line_breakcOsF|js|j��|jj||�d|_|_d|_|_|_|_dSr<)	rErrH�
send_hor_rulerArFrCrBrDrr
r
rros

zAbstractFormatter.add_hor_ruleNcCs�|js|js|j��|js0|j�|r*dp,d�t|t�rP|j�|�	||��n|j�|�d|_
|_|_|_d|_|_dSr<)
rFrErrHrCrI�
isinstance�str�send_label_data�format_counterrArBrDrr
r
rrvs

z AbstractFormatter.add_label_datacCstd}|D]f}|dkr"|d|}q|dkrD|dkrn||�||�}q|dkrf|dkrn||�||�}q||}q|S)N��1z%dZaArZiI)�
format_letter�format_roman)r	rr�label�cr
r
rrN�s
z AbstractFormatter.format_countercCs<d}|dkr8t|dd�\}}tt|�|�}||}q|S)NrOrr0�)�divmod�chr�ord)r	�caserrSr$�sr
r
rrQ�s
zAbstractFormatter.format_letterc	Cs�ddddg}dddg}d\}}|d	kr�t|d
�\}}|dkrV||||d|}nT|d
krt|||||}n6|dkr�||}|d}nd}||||}||}|d}q|dkr�|��S|S)N�ir$rT�m�v�l�d)rOrr�
�	r0��rO�I)rV�upper)	r	rYrZonesZfivesrS�indexr$rZr
r
rrR�s&


zAbstractFormatter.format_romancCs�|sdS|dd���}|dd���}d�|���}|jrD|sDdS|sN|jrv|sh|jsdd|_d|_dS|jsvd|}d|_|_|_|_|_||_|j	�
|�dS)Nr0���� r)�isspace�join�splitrArBrDrErCrFr�send_flowing_data)r	rZprespaceZ	postspacer
r
rr�s*

�z"AbstractFormatter.add_flowing_datacCsZ|sdS|jr|j�d�|dd�dk|_d|_|_|_|_|_|j�|�dS)Nrhrg�
r)	rBrrlrErArCrDrF�send_literal_datarr
r
rr�s�z"AbstractFormatter.add_literal_datacCs:|jr6d|_|_|_|_|_d|_|j�d�dS�Nrr0rh)rBrErCrDrFrArrlrr
r
rr�s�z!AbstractFormatter.flush_softspacecCs@|r.||jkr.|j�|�||_|j�|�n|j�|j�dSr)r!r�
new_alignmentr=�appendr r
r
rr"�s
z AbstractFormatter.push_alignmentcCsH|jr|jd=|jr2|jd|_}|j�|�nd|_|j�d�dS�Nrg)r=r!rrpr r
r
rr#�szAbstractFormatter.pop_alignmentc
Cs�|\}}}}|jr6d|_|_|_d|_|j�d�|jr~|jd\}}}}	|tkrZ|}|tkrf|}|tkrr|}|tkr~|	}||||f}|j�|�|j�	|�dS)Nrr0rhrg)
rBrErCrArrlr>�AS_ISrq�new_font)
r	�font�sizer[�bZttZcsizeZci�cbZcttr
r
rr%�s$zAbstractFormatter.push_fontcCs4|jr|jd=|jr |jd}nd}|j�|�dSrr)r>rrt�r	rur
r
rr&�szAbstractFormatter.pop_fontcCsB|j�|�dd�|jD�}|s,|r,|d}|j�|t|��dS)NcSsg|]}|r|�qSr
r
��.0r\r
r
r�
<listcomp>sz1AbstractFormatter.push_margin.<locals>.<listcomp>rg)r?rqr�
new_margin�len)r	r'�fstackr
r
rr(s
zAbstractFormatter.push_margincCsF|jr|jd=dd�|jD�}|r,|d}nd}|j�|t|��dS)NrgcSsg|]}|r|�qSr
r
rzr
r
rr|
sz0AbstractFormatter.pop_margin.<locals>.<listcomp>)r?rr}r~)r	rr'r
r
rr)
s
zAbstractFormatter.pop_margincCs||_|j�|�dSr)r+r�new_spacingr*r
r
rr,szAbstractFormatter.set_spacingcGsV|jr*d|_|_|_d|_|j�d�|D]}|j�|�q.|j�t	|j��dSro)
rBrErCrArrlr@rq�
new_styles�tuple)r	r.Zstyler
r
rr/szAbstractFormatter.push_styler0cCs$|j|d�=|j�t|j��dSr)r@rr�r�r1r
r
rr3!szAbstractFormatter.pop_stylecCs$||_|_d|_|_|_dS�Nr)rArErCrDrFr4r
r
rr6%sz"AbstractFormatter.assert_line_data)N)r0)r0)r7r8r9r:rrrrrrNrQrRrrrr"r#r%r&r(r)r,r/r3r6r
r
r
rr;@s,

	
	
	
r;c@sxeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)raMinimal writer interface to use in testing & inheritance.

    A writer which only provides the interface definition; no actions are
    taken on any methods.  This should be the base class for all writers
    which do not need to inherit any implementation methods.

    cCsdSrr
rr
r
rr2rzNullWriter.__init__cCsdSrr
rr
r
r�flush3rzNullWriter.flushcCsdSrr
r r
r
rrp4rzNullWriter.new_alignmentcCsdSrr
ryr
r
rrt5rzNullWriter.new_fontcCsdSrr
�r	r'�levelr
r
rr}6rzNullWriter.new_margincCsdSrr
r*r
r
rr�7rzNullWriter.new_spacingcCsdSrr
r-r
r
rr�8rzNullWriter.new_stylescCsdSrr
r
r
r
rrI9rzNullWriter.send_paragraphcCsdSrr
rr
r
rrH:rzNullWriter.send_line_breakcOsdSrr
rr
r
rrJ;rzNullWriter.send_hor_rulecCsdSrr
rr
r
rrM<rzNullWriter.send_label_datacCsdSrr
rr
r
rrl=rzNullWriter.send_flowing_datacCsdSrr
rr
r
rrn>rzNullWriter.send_literal_dataN)r7r8r9r:rr�rprtr}r�r�rIrHrJrMrlrnr
r
r
rr*src@sheZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�AbstractWriterz�A writer which can be used in debugging formatters, but not much else.

    Each method simply announces itself by printing its name and
    arguments on standard output.

    cCstd|f�dS)Nznew_alignment(%r)��printr r
r
rrpIszAbstractWriter.new_alignmentcCstd|f�dS)Nznew_font(%r)r�ryr
r
rrtLszAbstractWriter.new_fontcCstd||f�dS)Nznew_margin(%r, %d)r�r�r
r
rr}OszAbstractWriter.new_margincCstd|f�dS)Nznew_spacing(%r)r�r*r
r
rr�RszAbstractWriter.new_spacingcCstd|f�dS)Nznew_styles(%r)r�r-r
r
rr�UszAbstractWriter.new_stylescCstd|f�dS)Nzsend_paragraph(%r)r�r
r
r
rrIXszAbstractWriter.send_paragraphcCstd�dS)Nzsend_line_break()r�rr
r
rrH[szAbstractWriter.send_line_breakcOstd�dS)Nzsend_hor_rule()r�rr
r
rrJ^szAbstractWriter.send_hor_rulecCstd|f�dS)Nzsend_label_data(%r)r�rr
r
rrMaszAbstractWriter.send_label_datacCstd|f�dS)Nzsend_flowing_data(%r)r�rr
r
rrldsz AbstractWriter.send_flowing_datacCstd|f�dS)Nzsend_literal_data(%r)r�rr
r
rrngsz AbstractWriter.send_literal_dataN)r7r8r9r:rprtr}r�r�rIrHrJrMrlrnr
r
r
rr�Asr�c@sJeZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dS)�
DumbWritera;Simple writer class which writes output on the file object passed in
    as the file parameter or, if file is omitted, on standard output.  The
    output is simply word-wrapped to the number of columns specified by
    the maxcol parameter.  This class is suitable for reflowing a sequence
    of paragraphs.

    N�HcCs(|ptj|_||_t�|�|��dSr)�sys�stdout�file�maxcolrr�reset)r	r�r�r
r
rrts
zDumbWriter.__init__cCsd|_d|_dSr�)�col�atbreakrr
r
rr�zszDumbWriter.resetcCs |j�d|�d|_d|_dS�Nrmr�r��writer�r�r
r
r
rrI~szDumbWriter.send_paragraphcCs|j�d�d|_d|_dSr�r�rr
r
rrH�szDumbWriter.send_line_breakcOs:|j�d�|j�d|j�|j�d�d|_d|_dS)Nrm�-r)r�r�r�r�r�rr
r
rrJ�s
zDumbWriter.send_hor_rulecCsV|j�|�|�d�}|dkr4d|_||dd�}|��}|jt|�|_d|_dS)Nrmrr0)r�r��rfindr��
expandtabsr~r�)r	rr[r
r
rrn�s
zDumbWriter.send_literal_datacCs�|sdS|jp|d��}|j}|j}|jj}|��D]N}|rl|t|�|kr\|d�d}n|d�|d}||�|t|�}d}q6||_|d��|_dS)Nrrmrhr0rg)r�rir�r�r�r�rkr~)r	rr�r�r�r�Zwordr
r
rrl�s$zDumbWriter.send_flowing_data)Nr�)r7r8r9r:rr�rIrHrJrnrlr
r
r
rr�ks

r�cCs�t�}t|�}|dk	r t|�}n$tjdd�r>ttjd�}ntj}z,|D]"}|dkrb|�d�qJ|�|�qJW5|tjk	r�|��X|�d�dS)Nr0rmr)	r�r;�openr��argv�stdin�closerr)r��w�f�fp�liner
r
r�test�s


r��__main__)N)
r:r��warnings�warn�DeprecationWarningrsrr;rr�r�r�r7r
r
r
r�<module>s�"k*C
__pycache__/this.cpython-38.pyc000064400000002357151153537560012375 0ustar00U

e5d��@s\dZiZdD]2Zed�D]$Zeedde�eeee�<qqed�dd�eD���dS)aXGur Mra bs Clguba, ol Gvz Crgref

Ornhgvshy vf orggre guna htyl.
Rkcyvpvg vf orggre guna vzcyvpvg.
Fvzcyr vf orggre guna pbzcyrk.
Pbzcyrk vf orggre guna pbzcyvpngrq.
Syng vf orggre guna arfgrq.
Fcnefr vf orggre guna qrafr.
Ernqnovyvgl pbhagf.
Fcrpvny pnfrf nera'g fcrpvny rabhtu gb oernx gur ehyrf.
Nygubhtu cenpgvpnyvgl orngf chevgl.
Reebef fubhyq arire cnff fvyragyl.
Hayrff rkcyvpvgyl fvyraprq.
Va gur snpr bs nzovthvgl, ershfr gur grzcgngvba gb thrff.
Gurer fubhyq or bar-- naq cersrenoyl bayl bar --boivbhf jnl gb qb vg.
Nygubhtu gung jnl znl abg or boivbhf ng svefg hayrff lbh'er Qhgpu.
Abj vf orggre guna arire.
Nygubhtu arire vf bsgra orggre guna *evtug* abj.
Vs gur vzcyrzragngvba vf uneq gb rkcynva, vg'f n onq vqrn.
Vs gur vzcyrzragngvba vf rnfl gb rkcynva, vg znl or n tbbq vqrn.
Anzrfcnprf ner bar ubaxvat terng vqrn -- yrg'f qb zber bs gubfr!)�A�a��
�cCsg|]}t�||��qS�)�d�get)�.0�crr�/usr/lib64/python3.8/this.py�
<listcomp>srN)�srr
�range�i�chr�print�joinrrrr�<module>s
$__pycache__/netrc.cpython-38.opt-1.pyc000064400000007303151153537560013474 0ustar00U

e5d��@sXdZddlZddlZddlZddgZGdd�de�ZGdd�d�ZedkrTe	e��dS)z-An object-oriented interface to .netrc files.�N�netrc�NetrcParseErrorc@s"eZdZdZddd�Zdd�ZdS)rz5Exception raised on syntax errors in the .netrc file.NcCs"||_||_||_t�||�dS)N)�filename�lineno�msg�	Exception�__init__)�selfrrr�r
�/usr/lib64/python3.8/netrc.pyrszNetrcParseError.__init__cCsd|j|j|jfS)Nz%s (%s, line %s))rrr)r	r
r
r�__str__szNetrcParseError.__str__)NN)�__name__�
__module__�__qualname__�__doc__rrr
r
r
rr
s
c@s.eZdZd
dd�Zdd�Zdd�Zdd	�ZdS)rNc	CsX|dk}|dkr&tj�tj�d�d�}i|_i|_t|��}|�|||�W5QRXdS)N�~z.netrc)�os�path�join�
expanduser�hosts�macros�open�_parse)r	�file�
default_netrc�fpr
r
rrs
znetrc.__init__cCs�t�|�}|jd7_|j�dd�|_|j}|��}}|sD�q�n�|ddkrt|j|kr(t|�dkr(|j��q(n�|dkr�|��}nt|dkr�d}nf|dkr�|��}g|j	|<d	|_
|j��}	|	r�|	d
kr�d|_
q(|j	|�|	�q�q(ntd|||j��d}
d}}i|j
|<|��}|�d��s.|d
k�rr|�rR|
||f|j
|<|�|�q(ntd||t|�f||j���q|dk�s�|dk�r�|��}
�q|dk�r�|��}�q|dk�r�tjdk�r�|�r�t�|���}
|
jt��k�rpddl}z|�|
j�d}Wn tk
�rd|
j}YnXz|�t���d}Wn"tk
�rXdt��}YnXtd||f||j��|
jtjtjB@�r�td||j��|��}ntd|||j���qq(dS)Nz !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~�#�r��machine�default�macdefz 	�
z 	
zbad toplevel token %r>rr"r!r z&malformed %s entry %s terminated by %s�login�user�account�password�posixzuid %sz9~/.netrc file owner (%s) does not match current user (%s)zY~/.netrc access too permissive: access permissions must restrict access to only the ownerzbad follower token %r)�shlexZ	wordcharsZ
commenters�replacerZ	get_token�lenZinstream�readlinerZ
whitespace�appendrr�
startswithZ
push_token�reprr�name�fstat�fileno�st_uid�getuid�pwd�getpwuid�KeyError�st_mode�stat�S_IRWXG�S_IRWXO)r	rrrZlexerZsaved_linenoZtoplevelZttZ	entryname�liner$r&r'Zpropr5Zfownerr%r
r
rr s�




�
�
��

���
�znetrc._parsecCs0||jkr|j|Sd|jkr(|jdSdSdS)z8Return a (user, account, password) tuple for given host.r!N)r)r	�hostr
r
r�authenticatorsqs




znetrc.authenticatorscCs�d}|j��D]X}|j|}|d|�d|d�d�7}|drR|d|d�d�7}|d|d	�d�7}q|j��D]4}|d
|�d�7}|j|D]}||7}q�|d7}qr|S)z3Dump the class data in the format of a .netrc file.rzmachine z
	login rr#rz		account z
	password �zmacdef )r�keysr)r	Zrepr=�attrsZmacror<r
r
r�__repr__zs


znetrc.__repr__)N)r
rrrrr>rBr
r
r
rrs
	Q	�__main__)
rrr)r9�__all__rrrr
�printr
r
r
r�<module>st__pycache__/timeit.cpython-38.opt-2.pyc000064400000013445151153537560013661 0ustar00U

e5d�4�@s�ddlZddlZddlZddlZddddgZdZdZdZejZ	e
Zd	Zd
d�Z
Gdd�d�Zd
d
e	edfdd�Zd
d
e	eedfdd�Zddd�dd�Zedkr�e�e��dS)�N�Timer�timeit�repeat�
default_timerz<timeit-src>i@B�z�
def inner(_it, _timer{init}):
    {setup}
    _t0 = _timer()
    for _i in _it:
        {stmt}
    _t1 = _timer()
    return _t1 - _t0
cCs|�ddd|�S)N�
� )�replace)�src�indent�r�/usr/lib64/python3.8/timeit.py�reindentOsrc@sLeZdZddedfdd�Zd
dd�Zefdd�Zeefd	d
�Z	ddd�Z
dS)r�passNcCs�||_i}|dkrt�n|}d}t|t�rJt|td�|d}t|d�}n*t|�rl||d<|d7}d}d}ntd��t|t�r�t||td�t|d	�}n&t|�r�||d
<|d7}d}ntd
��t	j
|||d�}	|	|_t|	td�}
t|
||�|d|_
dS)N��execr��_setupz, _setup=_setupz_setup()z&setup is neither a string nor callable�Z_stmtz
, _stmt=_stmtz_stmt()z%stmt is neither a string nor callable)�stmt�setup�init�inner)�timer�_globals�
isinstance�str�compile�dummy_src_namer�callable�
ValueError�template�formatr
rr)�selfrrr�globalsZlocal_nsZ	global_nsrZ
stmtprefixr
�coderrr
�__init__es6

zTimer.__init__cCsJddl}ddl}|jdk	r:t|j�d|j�d�tf|jt<|j|d�dS)Nrr��file)�	linecache�	tracebackr
�len�splitr�cache�	print_exc)r#r(r)r*rrr
r.�s

�
zTimer.print_exccCsBt�d|�}t��}t��z|�||j�}W5|r<t��X|S�N)�	itertoolsr�gcZ	isenabledZdisableZenablerr)r#�number�itZgcoldZtimingrrr
r�s

zTimer.timeitcCs*g}t|�D]}|�|�}|�|�q|Sr/)�ranger�append)r#rr2�r�i�trrr
r�s

zTimer.repeatcCsPd}dD]8}||}|�|�}|r,|||�|dkr||fSq|d9}qdS)N�)r9�rg�������?�
)r)r#�callbackr7�jr2�
time_takenrrr
�	autorange�s


zTimer.autorange)N)N)�__name__�
__module__�__qualname__rr&r.�default_numberr�default_repeatrr?rrrr
rSs�
#
rcCst||||��|�Sr/)rr)rrrr2r$rrr
r�scCst||||��||�Sr/)rr)rrrrr2r$rrr
r�s)�_wrap_timerc
s|dkrtjdd�}ddl}z(|�|ddddddd	d
ddg	�\}}Wn:|jk
r�}zt|�td
�WY�dSd}~XYnXt}d�|�p�d}d�g}t}d}	d�ddddd��d�|D]�\}
}|
dkr�t|��|
dkr�|�	|�|
dk�r|�k�r|�ntdtj
d�dS|
dk�r6t|�}|dk�r6d}|
dk�rFtj}|
dk�rf|	�r^�d7�|	d7}	|
dkr�tt
d d!�dSq�d�|��p�d}ddl}tj�d|j�|dk	�r�||�}t|||�}
�dk�rd}|	�r�fd"d#�}z|
�|�\�}Wn|
��YdSX|	�rt�z|
�|��}Wn|
��YdSX���fd$d%�}|	�rztd&d'�t||���t��fd(d)�|D�}t|�}td*��dk�r�d+nd,|||�f�t|�}t|�}||d-k�rddl}|�d.||�||�ftd,d�dS)/Nr9rz
n:u:s:r:tcpvhznumber=zsetup=zrepeat=�timeZclockZprocess�verbosezunit=�helpz#use -h/--help for command line helpr:rrg��&�.>g���ư>g����MbP?g�?)ZnsecZusecZmsecZsec�)z-nz--number)z-sz--setup)z-uz--unitz:Unrecognized unit. Please select nsec, usec, msec, or sec.r')z-rz--repeat)z-pz	--process)z-vz	--verbose)z-hz--helpr)�endcs.d}|dk}t|j||rdnd|�d��dS)Nz%{num} loop{s} -> {secs:.{prec}g} secsr9�sr)ZnumrKZsecsZprec)�printr")r2r>�msgZplural)�	precisionrr
r<?s�zmain.<locals>.callbackcs`�}|dk	r�|}n8dd����D�}|jdd�|D]\}}||kr8qNq8d�|||fS)NcSsg|]\}}||f�qSrr)�.0�unit�scalerrr
�
<listcomp>Ysz-main.<locals>.format_time.<locals>.<listcomp>T)�reversez%.*g %s)�items�sort)�dtrPrQZscales)rN�	time_unit�unitsrr
�format_timeSs
zmain.<locals>.format_timez
raw times: %sz, csg|]}|��qSrr)rOrV)r2rr
rRdszmain.<locals>.<listcomp>z"%d loop%s, best of %d: %s per looprKrrztThe test results are likely unreliable. The worst time (%s) was more than four times slower than the best time (%s).)�sys�argv�getopt�errorrLr�joinrD�intr5�stderrrF�process_time�__doc__�os�path�insert�curdirrr?r.r�map�min�max�warnings�
warn_explicit�UserWarning)�argsrEr\Zopts�errrrrrrG�o�arcr8r<�_Zraw_timingsrYZtimingsZbestZworstrjr)r2rNrWrXr
�main�s���


�





����rr�__main__)N)r1rZrFr0�__all__rrCrD�perf_counterrr$rr!rrrrrrr@�exitrrrr
�<module>4s4
�
�
__pycache__/cProfile.cpython-38.opt-1.pyc000064400000012577151153537560014135 0ustar00U

e5db�@s�dZdddgZddlZddlZddlZddd�Zddd�Zejje_ejje_Gd	d�dej�Z	d
d�Z
dd
�Zedkr~e�dS)zUPython interface for the 'lsprof' profiler.
   Compatible with the 'profile' module.
�run�runctx�Profile�N���cCst�t��|||�S�N)�
_pyprofile�_Utilsrr)�	statement�filename�sort�r� /usr/lib64/python3.8/cProfile.pyrscCst�t��|||||�Sr)rrrr)r	�globals�localsr
rrrr
rs�c@s`eZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
de
_dd�Zdd�Z
dS)ra`Profile(timer=None, timeunit=None, subcalls=True, builtins=True)

    Builds a profiler object using the specified timer function.
    The default timer is a fast built-in one based on real time.
    For custom timer functions returning integers, timeunit can
    be a float specifying a scale (i.e. how long each integer unit
    is, in seconds).
    rcCs$ddl}|�|����|���dS�Nr)�pstats�StatsZ
strip_dirsZ
sort_stats�print_stats)�selfrrrrr
r)szProfile.print_statsc	Cs8ddl}t|d��}|��|�|j|�W5QRXdS)Nr�wb)�marshal�open�create_stats�dump�stats)r�filer�frrr
�
dump_stats-szProfile.dump_statscCs|��|��dSr)�disable�snapshot_stats�rrrr
r3szProfile.create_statsc
Cs,|��}i|_i}|D]P}t|j�}|j}||j}|j}|j}i}	|	|t|j�<|||||	f|j|<q|D]�}|j	rlt|j�}|j	D]�}
z|t|
j�}	Wnt
k
r�Yq�YnX|
j}||
j}|
j}|
j}||	k�r|	|}||d7}||d7}||d7}||d7}||||f|	|<q�qldS)Nr���)Zgetstatsr�label�codeZ	callcountZreccallcountZ
inlinetimeZ	totaltime�idZcalls�KeyError)r�entriesZcallersdicts�entry�funcZncZccZttZctZcallersZsubentry�prevrrr
r7s>






zProfile.snapshot_statscCsddl}|j}|�|||�Sr)�__main__�__dict__r)r�cmdr,�dictrrr
r]szProfile.runcCs(|��zt|||�W5|��X|Sr)�enabler�exec)rr.rrrrr
rbs

zProfile.runctxcOs�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��|��z|||�W�S|��XdS)	Nr"z:descriptor 'runcall' of 'Profile' object needs an argumentr*rz0Passing 'func' as keyword argument is deprecated)�
stacklevelz7runcall expected at least 1 positional argument, got %dr!)�len�	TypeError�pop�warnings�warn�DeprecationWarningr0r)�args�kwrr*r6rrr
�runcallks&

�
�zProfile.runcallz($self, func, /, *args, **kw)cCs|��|Sr)r0r rrr
�	__enter__�szProfile.__enter__cGs|��dSr)r)r�exc_inforrr
�__exit__�szProfile.__exit__N)r)�__name__�
__module__�__qualname__�__doc__rrrrrrr;�__text_signature__r<r>rrrr
rs
&	cCs(t|t�rdd|fS|j|j|jfSdS)N�~r)�
isinstance�str�co_filename�co_firstlineno�co_name)r%rrr
r$�s

r$c
Cs�ddl}ddl}ddl}ddl}ddlm}d}||d�}d|_|jdddd	dd
�|jddd
ddt|j	j
�d�|jdddddd�|jdd�s�|��|�
d�|��\}}||jdd�<|jdk	r�|j�|j�|_t|�dk�r�|j�rd}	|j|dd�}
nR|d}|j�d|j�|��t�|��}t|��|d�}	W5QRX|dddd�}
zt|	|
d|j|j�Wn6tk
�r�}
zd|_|�
|
j�W5d}
~
XYnXn|��|S)Nr)�OptionParserzNcProfile.py [-o output_file_path] [-s sort] [-m module | scriptfile] [arg] ...)�usageFz-oz	--outfile�outfilezSave stats to <outfile>)�dest�help�defaultz-sz--sortrz?Sort order when printing to stdout, based on pstats.Stats classr)rMrNrO�choicesz-m�module�
store_truezProfile a library module)rM�actionrNrOr!r"z(run_module(modname, run_name='__main__'))�
run_module�modnamer1r,)�__file__r?�__package__�
__cached__) �os�sys�runpyrZoptparserJZallow_interspersed_argsZ
add_option�sortedrZsort_arg_dict_default�argvZprint_usage�exit�
parse_argsrL�path�abspathr3rQrT�insert�dirname�io�	open_code�compile�readrr�BrokenPipeError�stdout�errno)rYrZr[rrJrK�parserZoptionsr9r%ZglobsZprogname�fp�excrrr
�main�sd

�

�
�

�� rnr,)Nr)Nr)
rB�__all__Z_lsprofrdZprofilerrrZProfilerrr$rnr?rrrr
�<module>s




o;__pycache__/argparse.cpython-38.opt-1.pyc000064400000171262151153537560014173 0ustar00U

e5dw�@s0dZdZdddddddd	d
ddd
dddddgZddlZddlZddlZddl	Z
ddlmZm
Z
dZdZdZdZdZdZdZGdd�de�Zdd �ZGd!d�de�ZGd"d�de�ZGd#d	�d	e�ZGd$d�de�ZGd%d
�d
e�Zd&d'�ZGd(d�de�ZGd)d�de�Z Gd*d�de�Z!Gd+d,�d,e!�Z"Gd-d.�d.e!�Z#Gd/d0�d0e#�Z$Gd1d2�d2e#�Z%Gd3d4�d4e!�Z&Gd5d6�d6e!�Z'Gd7d8�d8e!�Z(Gd9d:�d:e!�Z)Gd;d<�d<e!�Z*Gd=d>�d>e!�Z+Gd?d@�d@e&�Z,GdAd�de�Z-GdBd�de�Z.GdCdD�dDe�Z/GdEdF�dFe/�Z0GdGdH�dHe0�Z1GdId�dee/�Z2dS)Ja�
Command-line parsing library

This module is an optparse-inspired command-line parsing library that:

    - handles both optional and positional arguments
    - produces highly informative usage messages
    - supports parsers that dispatch to sub-parsers

The following is a simple usage example that sums integers from the
command-line and writes the result to a file::

    parser = argparse.ArgumentParser(
        description='sum the integers at the command line')
    parser.add_argument(
        'integers', metavar='int', nargs='+', type=int,
        help='an integer to be summed')
    parser.add_argument(
        '--log', default=sys.stdout, type=argparse.FileType('w'),
        help='the file where the sum should be written')
    args = parser.parse_args()
    args.log.write('%s' % sum(args.integers))
    args.log.close()

The module contains the following public classes:

    - ArgumentParser -- The main entry point for command-line parsing. As the
        example above shows, the add_argument() method is used to populate
        the parser with actions for optional and positional arguments. Then
        the parse_args() method is invoked to convert the args at the
        command-line into an object with attributes.

    - ArgumentError -- The exception raised by ArgumentParser objects when
        there are errors with the parser's actions. Errors raised while
        parsing the command-line are caught by ArgumentParser and emitted
        as command-line messages.

    - FileType -- A factory for defining types of files to be created. As the
        example above shows, instances of FileType are typically passed as
        the type= argument of add_argument() calls.

    - Action -- The base class for parser actions. Typically actions are
        selected by passing strings like 'store_true' or 'append_const' to
        the action= argument of add_argument(). However, for greater
        customization of ArgumentParser actions, subclasses of Action may
        be defined and passed as the action= argument.

    - HelpFormatter, RawDescriptionHelpFormatter, RawTextHelpFormatter,
        ArgumentDefaultsHelpFormatter -- Formatter classes which
        may be passed as the formatter_class= argument to the
        ArgumentParser constructor. HelpFormatter is the default,
        RawDescriptionHelpFormatter and RawTextHelpFormatter tell the parser
        not to change the formatting for help text, and
        ArgumentDefaultsHelpFormatter adds information about argument defaults
        to the help.

All other classes in this module are considered implementation details.
(Also note that HelpFormatter and RawDescriptionHelpFormatter are only
considered public as object names -- the API of the formatter objects is
still considered an implementation detail.)
z1.1�ArgumentParser�
ArgumentError�ArgumentTypeError�FileType�
HelpFormatter�ArgumentDefaultsHelpFormatter�RawDescriptionHelpFormatter�RawTextHelpFormatter�MetavarTypeHelpFormatter�	Namespace�Action�ONE_OR_MORE�OPTIONAL�PARSER�	REMAINDER�SUPPRESS�ZERO_OR_MORE�N)�gettext�ngettextz==SUPPRESS==�?�*�+zA...�...Z_unrecognized_argsc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_AttributeHolderaAbstract base class that provides __repr__.

    The __repr__ method returns a string in the format::
        ClassName(attr=name, attr=name, ...)
    The attributes are determined either by a class-level attribute,
    '_kwarg_names', or by inspecting the instance __dict__.
    cCs�t|�j}g}i}|��D]}|�t|��q|��D],\}}|��rZ|�d||f�q6|||<q6|rz|�dt|��d|d�|�fS)N�%s=%rz**%s�%s(%s)�, )�type�__name__�	_get_args�append�repr�_get_kwargs�isidentifier�join)�selfZ	type_name�arg_stringsZ	star_args�arg�name�value�r*� /usr/lib64/python3.8/argparse.py�__repr__ts

z_AttributeHolder.__repr__cCst|j���S�N)�sorted�__dict__�items�r%r*r*r+r"�sz_AttributeHolder._get_kwargscCsgSr-r*r1r*r*r+r�sz_AttributeHolder._get_argsN)r�
__module__�__qualname__�__doc__r,r"rr*r*r*r+rksrcCs6|dkrgSt|�tkr$|dd�Sddl}|�|�S)Nr)r�list�copy)r0r6r*r*r+�_copy_items�sr7c@s�eZdZdZd;dd�Zdd�Zd	d
�ZGdd�de�Zd
d�Z	dd�Z
dd�Zdd�Zd<dd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�ZdS)=rz�Formatter for generating usage messages and argument help strings.

    Only the name of this class is considered a public API. All the methods
    provided by the class are considered an implementation detail.
    ��NcCs�|dkrt��j}|d8}||_||_t|t|d|d��|_||_d|_	d|_
d|_|�|d�|_
|j
|_t�dtj�|_t�d�|_dS)Nr8�rz\s+z\n\n\n+)�_shutil�get_terminal_size�columns�_prog�_indent_increment�min�max�_max_help_position�_width�_current_indent�_level�_action_max_length�_Section�
_root_section�_current_section�_re�compile�ASCII�_whitespace_matcher�_long_break_matcher)r%�progZindent_incrementZmax_help_position�widthr*r*r+�__init__�s 
�zHelpFormatter.__init__cCs"|j|j7_|jd7_dS�N��rDr?rEr1r*r*r+�_indent�szHelpFormatter._indentcCs"|j|j8_|jd8_dSrRrTr1r*r*r+�_dedent�szHelpFormatter._dedentc@seZdZddd�Zdd�ZdS)zHelpFormatter._SectionNcCs||_||_||_g|_dSr-)�	formatter�parent�headingr0)r%rWrXrYr*r*r+rQ�szHelpFormatter._Section.__init__cCs�|jdk	r|j��|jj}|dd�|jD��}|jdk	rD|j��|sLdS|jtk	rz|jdk	rz|jj}d|d|jf}nd}|d||dg�S)NcSsg|]\}}||��qSr*r*)�.0�func�argsr*r*r+�
<listcomp>�sz6HelpFormatter._Section.format_help.<locals>.<listcomp>�z%*s%s:
�
)	rXrWrU�_join_partsr0rVrYrrD)r%r$Z	item_helpZcurrent_indentrYr*r*r+�format_help�s



z"HelpFormatter._Section.format_help)N)rr2r3rQrar*r*r*r+rG�s
rGcCs|jj�||f�dSr-)rIr0r )r%r[r\r*r*r+�	_add_item�szHelpFormatter._add_itemcCs0|��|�||j|�}|�|jg�||_dSr-)rUrGrIrbra)r%rYZsectionr*r*r+�
start_section�szHelpFormatter.start_sectioncCs|jj|_|��dSr-)rIrXrVr1r*r*r+�end_section�s
zHelpFormatter.end_sectioncCs$|tk	r |dk	r |�|j|g�dSr-)rrb�_format_text)r%�textr*r*r+�add_text�szHelpFormatter.add_textcCs&|tk	r"||||f}|�|j|�dSr-)rrb�
_format_usage)r%�usage�actions�groups�prefixr\r*r*r+�	add_usage�szHelpFormatter.add_usagecCsv|jtk	rr|j}||�g}|�|�D]}|�||��q$tdd�|D��}||j}t|j|�|_|�|j	|g�dS)NcSsg|]}t|��qSr*��len�rZ�sr*r*r+r]
sz.HelpFormatter.add_argument.<locals>.<listcomp>)
�helpr�_format_action_invocation�_iter_indented_subactionsr rArDrFrb�_format_action)r%�actionZget_invocationZinvocations�	subactionZinvocation_lengthZ
action_lengthr*r*r+�add_arguments


�zHelpFormatter.add_argumentcCs|D]}|�|�qdSr-)rx)r%rjrvr*r*r+�
add_argumentsszHelpFormatter.add_argumentscCs.|j��}|r*|j�d|�}|�d�d}|S)N�

r_)rHrarN�sub�strip)r%rrr*r*r+ras

zHelpFormatter.format_helpcCsd�dd�|D��S)Nr^cSsg|]}|r|tk	r|�qSr*)r)rZ�partr*r*r+r]!s�z-HelpFormatter._join_parts.<locals>.<listcomp>)r$)r%Zpart_stringsr*r*r+r` s
�zHelpFormatter._join_partscs|dkrtd�}|dk	r,|t|jd�}�n�|dkrL|sLdt|jd�}�n�|dk�rdt|jd�}g}g}|D] }|jr�|�|�qr|�|�qr|j}	|	|||�}
d�dd�||
fD��}|j|j�t	|�t	|��k�rd}|	||�}|	||�}
t
�||�}t
�||
�}d�fdd	�	}t	|�t	|�d
�k�r�dt	|�t	|�d}|�r|||g|||�}|�|||��n |�r�||g|||�}n|g}nZdt	|�}||}|||�}t	|�dk�r�g}|�|||��|�|||��|g|}d�|�}d
||fS)Nzusage: �rOz%(prog)s� cSsg|]}|r|�qSr*r*rpr*r*r+r]Asz/HelpFormatter._format_usage.<locals>.<listcomp>z%\(.*?\)+(?=\s|$)|\[.*?\]+(?=\s|$)|\S+cs�g}g}|dk	rt|�d}nt|�d}|D]Z}|dt|��krn|rn|�|d�|��g}t|�d}|�|�|t|�d7}q.|r�|�|d�|��|dk	r�|dt|�d�|d<|S)NrSrr)ror r$)�parts�indentrl�lines�lineZline_lenr}��
text_widthr*r+�	get_linesUs"
z.HelpFormatter._format_usage.<locals>.get_linesg�?rSr_z%s%s

)N)
�_�dictr>�option_stringsr �_format_actions_usager$rCrDrorJ�findall�extend)r%rirjrkrlrO�	optionals�positionalsrv�formatZaction_usageZpart_regexpZ	opt_usageZ	pos_usageZ	opt_partsZ	pos_partsr�r�r�r�r*r�r+rh%sX
�




zHelpFormatter._format_usagec	Cs�t�}i}|D�]}z|�|jd�}Wntk
r@YqYqX|t|j�}|||�|jkr|jD]}|�|�qh|js�||kr�||d7<nd||<||kr�||d7<nd||<nF||kr�||d7<nd||<||k�r||d7<nd||<t|d|�D]}	d	||	<�qqg}
t|�D�]"\}	}|j	t
k�r�|
�d�|�|	�d	k�rr|�
|	�n"|�|	d�d	k�rX|�
|	d�n�|j�s�|�|�}|�||�}||k�r�|ddk�r�|d
dk�r�|dd
�}|
�|�nf|jd}
|jdk�rd|
}n"|�|�}|�||�}d|
|f}|j�sN||k�rNd
|}|
�|��q6t|dd�D]}	||	g|
|	|	�<�qhd�dd�|
D��}d}d}t�d|d|�}t�d|d|�}t�d||fd|�}t�dd|�}|��}|S)Nrz [�[�]z (�(�)rS�|����%s�%s %s�[%s]T)�reversercSsg|]}|dk	r|�qSr-r*)rZ�itemr*r*r+r]�sz7HelpFormatter._format_actions_usage.<locals>.<listcomp>z[\[(]z[\])]z(%s) z\1� (%s)z%s *%sr^z\(([^|]*)\))�set�index�_group_actions�
ValueErrorro�add�required�range�	enumeraterrrr �get�popr��#_get_default_metavar_for_positional�_format_args�nargs�!_get_default_metavar_for_optionalr.r$rJr{r|)r%rjrk�
group_actionsZinserts�group�start�endrv�ir��defaultr}�
option_string�args_stringrf�open�closer*r*r+r��sz










z#HelpFormatter._format_actions_usagecCsFd|kr|t|jd�}t|j|jd�}d|j}|�|||�dS)Nz%(prog)r~�rrz)r�r>rArCrD�
_fill_text)r%rfr�r�r*r*r+re�s

zHelpFormatter._format_textc
Cs:t|jd|j�}t|j|d�}||jd}|�|�}|jsV|jd|f}d|}n@t|�|kr~|jd||f}d|}d}n|jd|f}d|}|}|g}|jr�|�	|�}	|�
|	|�}
|�d|d|
df�|
dd�D]}|�d|d|f�q�n|�d��s|�d�|�
|�D]}|�|�|���q|�|�S)	Nr8r�r^z%*s%s
z	%*s%-*s  rrSr_)r@rFrBrArCrDrsrrro�_expand_help�_split_linesr �endswithrtrur`)
r%rvZ
help_positionZ
help_widthZaction_widthZ
action_header�tupZindent_firstr�Z	help_textZ
help_linesr�rwr*r*r+ru�s8
�



zHelpFormatter._format_actioncCs�|js&|�|�}|�||�d�\}|Sg}|jdkrB|�|j�n4|�|�}|�||�}|jD]}|�d||f�q^d�|�SdS)NrSrr�r)	r�r��_metavar_formatterr�r�r�r�r r$)r%rvr��metavarr�r�r�r*r*r+rs"s



z'HelpFormatter._format_action_invocationcsP|jdk	r|j�n.|jdk	r<dd�|jD�}dd�|��n|��fdd�}|S)NcSsg|]}t|��qSr*��str)rZZchoicer*r*r+r]>sz4HelpFormatter._metavar_formatter.<locals>.<listcomp>z{%s}�,cst�t�r�S�f|SdSr-)�
isinstance�tuple)Z
tuple_size��resultr*r+r�Cs
z0HelpFormatter._metavar_formatter.<locals>.format)r��choicesr$)r%rv�default_metavarZchoice_strsr�r*r�r+r�:s

z HelpFormatter._metavar_formattercCs�|�||�}|jdkr$d|d�}n�|jtkr<d|d�}n�|jtkrTd|d�}n�|jtkrld|d�}n�|jtkr|d}nt|jtkr�d|d�}n\|jtkr�d	}nLzd
d�t|j�D�}Wnt	k
r�t
d�d�YnXd
�|�||j�}|S)Nr�rSr�z
[%s [%s ...]]r8z%s [%s ...]rz%s ...r^cSsg|]}d�qS)r�r*)rZr�r*r*r+r]\sz.HelpFormatter._format_args.<locals>.<listcomp>zinvalid nargs valuer)r�r�r
rrrrrr��	TypeErrorr�r$)r%rvr�Zget_metavarr�Zformatsr*r*r+r�Js*






zHelpFormatter._format_argscCs�tt|�|jd�}t|�D]}||tkr||=qt|�D] }t||d�r:||j||<q:|�d�dk	r�d�dd�|dD��}||d<|�	|�|S)Nr~rr�rcSsg|]}t|��qSr*r�)rZ�cr*r*r+r]ksz.HelpFormatter._expand_help.<locals>.<listcomp>)
r��varsr>r5r�hasattrrr�r$�_get_help_string)r%rvZparamsr(Zchoices_strr*r*r+r�bszHelpFormatter._expand_helpccs@z
|j}Wntk
rYnX|��|�EdH|��dSr-)�_get_subactions�AttributeErrorrUrV)r%rvZget_subactionsr*r*r+rtos
z'HelpFormatter._iter_indented_subactionscCs&|j�d|���}ddl}|�||�S)Nrr)rMr{r|�textwrapZwrap)r%rfrPr�r*r*r+r�yszHelpFormatter._split_linescCs,|j�d|���}ddl}|j||||d�S)Nrr)Zinitial_indentZsubsequent_indent)rMr{r|r�Zfill)r%rfrPr�r�r*r*r+r��s�zHelpFormatter._fill_textcCs|jSr-)rr�r%rvr*r*r+r��szHelpFormatter._get_help_stringcCs
|j��Sr-)�dest�upperr�r*r*r+r��sz/HelpFormatter._get_default_metavar_for_optionalcCs|jSr-)r�r�r*r*r+r��sz1HelpFormatter._get_default_metavar_for_positional)r8r9N)N) rr2r3r4rQrUrV�objectrGrbrcrdrgrmrxryrar`rhr�rerursr�r�r�rtr�r�r�r�r�r*r*r*r+r�s>�

`g/

c@seZdZdZdd�ZdS)rz�Help message formatter which retains any formatting in descriptions.

    Only the name of this class is considered a public API. All the methods
    provided by the class are considered an implementation detail.
    cs d��fdd�|jdd�D��S)Nr^c3s|]}�|VqdSr-r*)rZr��r�r*r+�	<genexpr>�sz9RawDescriptionHelpFormatter._fill_text.<locals>.<genexpr>T)�keepends)r$�
splitlines)r%rfrPr�r*r�r+r��sz&RawDescriptionHelpFormatter._fill_textN)rr2r3r4r�r*r*r*r+r�sc@seZdZdZdd�ZdS)rz�Help message formatter which retains formatting of all help text.

    Only the name of this class is considered a public API. All the methods
    provided by the class are considered an implementation detail.
    cCs|��Sr-)r�)r%rfrPr*r*r+r��sz!RawTextHelpFormatter._split_linesN)rr2r3r4r�r*r*r*r+r�sc@seZdZdZdd�ZdS)rz�Help message formatter which adds default values to argument help.

    Only the name of this class is considered a public API. All the methods
    provided by the class are considered an implementation detail.
    cCs>|j}d|jkr:|jtk	r:ttg}|js2|j|kr:|d7}|S)Nz
%(default)z (default: %(default)s))rrr�rr
rr�r�)r%rvrrZdefaulting_nargsr*r*r+r��s

z.ArgumentDefaultsHelpFormatter._get_help_stringN)rr2r3r4r�r*r*r*r+r�sc@s eZdZdZdd�Zdd�ZdS)r	aHelp message formatter which uses the argument 'type' as the default
    metavar value (instead of the argument 'dest')

    Only the name of this class is considered a public API. All the methods
    provided by the class are considered an implementation detail.
    cCs|jjSr-�rrr�r*r*r+r��sz:MetavarTypeHelpFormatter._get_default_metavar_for_optionalcCs|jjSr-r�r�r*r*r+r��sz<MetavarTypeHelpFormatter._get_default_metavar_for_positionalN)rr2r3r4r�r�r*r*r*r+r	�scCsN|dkrdS|jrd�|j�S|jdtfkr2|jS|jdtfkrF|jSdSdS)N�/)r�r$r�rr�)�argumentr*r*r+�_get_action_name�sr�c@s eZdZdZdd�Zdd�ZdS)rz�An error from creating or using an argument (optional or positional).

    The string value of this exception is the message, augmented with
    information about the argument that caused it.
    cCst|�|_||_dSr-)r��
argument_name�message)r%r�r�r*r*r+rQ�s
zArgumentError.__init__cCs(|jdkrd}nd}|t|j|jd�S)Nz%(message)sz'argument %(argument_name)s: %(message)s)r�r�)r�r�r�)r%r�r*r*r+�__str__�s
�zArgumentError.__str__N)rr2r3r4rQr�r*r*r*r+r�sc@seZdZdZdS)rz@An error from trying to convert a command line string to a type.N)rr2r3r4r*r*r*r+r�sc@s,eZdZdZd
dd�Zdd�Zddd	�ZdS)ra\	Information about how to convert command line strings to Python objects.

    Action objects are used by an ArgumentParser to represent the information
    needed to parse a single argument from one or more strings from the
    command line. The keyword arguments to the Action constructor are also
    all attributes of Action instances.

    Keyword Arguments:

        - option_strings -- A list of command-line option strings which
            should be associated with this action.

        - dest -- The name of the attribute to hold the created object(s)

        - nargs -- The number of command-line arguments that should be
            consumed. By default, one argument will be consumed and a single
            value will be produced.  Other values include:
                - N (an integer) consumes N arguments (and produces a list)
                - '?' consumes zero or one arguments
                - '*' consumes zero or more arguments (and produces a list)
                - '+' consumes one or more arguments (and produces a list)
            Note that the difference between the default and nargs=1 is that
            with the default, a single value will be produced, while with
            nargs=1, a list containing a single value will be produced.

        - const -- The value to be produced if the option is specified and the
            option uses an action that takes no values.

        - default -- The value to be produced if the option is not specified.

        - type -- A callable that accepts a single string argument, and
            returns the converted value.  The standard Python types str, int,
            float, and complex are useful examples of such callables.  If None,
            str is used.

        - choices -- A container of values that should be allowed. If not None,
            after a command-line argument has been converted to the appropriate
            type, an exception will be raised if it is not a member of this
            collection.

        - required -- True if the action must always be specified at the
            command line. This is only meaningful for optional command-line
            arguments.

        - help -- The help string describing the argument.

        - metavar -- The name to be used for the option's argument with the
            help string. If None, the 'dest' value will be used as the name.
    NFcCs@||_||_||_||_||_||_||_||_|	|_|
|_	dSr-�
r�r�r��constr�rr�r�rrr��r%r�r�r�r�r�rr�r�rrr�r*r*r+rQ)szAction.__init__c	s(ddddddddd	g	}�fd
d�|D�S)Nr�r�r�r�r�rr�rrr�csg|]}|t�|�f�qSr*��getattr�rZr(r1r*r+r]Ksz&Action._get_kwargs.<locals>.<listcomp>r*�r%�namesr*r1r+r"?s�zAction._get_kwargscCsttd���dS)Nz.__call__() not defined)�NotImplementedErrorr��r%�parser�	namespace�valuesr�r*r*r+�__call__MszAction.__call__)NNNNNFNN)N)rr2r3r4rQr"r�r*r*r*r+r�s5�
cs(eZdZd�fdd�	Zddd�Z�ZS)	�_StoreActionNFcsT|dkrtd��|dk	r,|tkr,tdt��tt|�j|||||||||	|
d�
dS)Nrz�nargs for store actions must be != 0; if you have nothing to store, actions such as store true or store const may be more appropriate� nargs must be %r to supply constr�)r�r
�superr�rQr���	__class__r*r+rQSs 
�z_StoreAction.__init__cCst||j|�dSr-)�setattrr�r�r*r*r+r�psz_StoreAction.__call__)NNNNNFNN)N�rr2r3rQr��
__classcell__r*r*r�r+r�Qs�r�cs(eZdZd�fdd�	Zddd�Z�ZS)	�_StoreConstActionNFc	s"tt|�j||d||||d�dS)Nr)r�r�r�r�r�r�rr)r�r�rQ�r%r�r�r�r�r�rrr�r�r*r+rQvs
�z_StoreConstAction.__init__cCst||j|j�dSr-)r�r�r�r�r*r*r+r��sz_StoreConstAction.__call__)NFNN)Nr�r*r*r�r+r�ts�r�cseZdZd�fdd�	Z�ZS)�_StoreTrueActionFNcs tt|�j||d|||d�dS)NT�r�r�r�r�r�rr)r�r�rQ�r%r�r�r�r�rrr�r*r+rQ�s
�z_StoreTrueAction.__init__)FFN�rr2r3rQr�r*r*r�r+r��s�r�cseZdZd�fdd�	Z�ZS)�_StoreFalseActionTFNcs tt|�j||d|||d�dS)NFr�)r�r�rQr�r�r*r+rQ�s
�z_StoreFalseAction.__init__)TFNr�r*r*r�r+r��s�r�cs(eZdZd�fdd�	Zddd�Z�ZS)	�
_AppendActionNFcsT|dkrtd��|dk	r,|tkr,tdt��tt|�j|||||||||	|
d�
dS)Nrz�nargs for append actions must be != 0; if arg strings are not supplying the value to append, the append const action may be more appropriater�r�)r�r
r�r�rQr�r�r*r+rQ�s 
�z_AppendAction.__init__cCs2t||jd�}t|�}|�|�t||j|�dSr-)r�r�r7r r��r%r�r�r�r�r0r*r*r+r��s
z_AppendAction.__call__)NNNNNFNN)Nr�r*r*r�r+r��s�r�cs(eZdZd�fdd�	Zddd�Z�ZS)	�_AppendConstActionNFc
s$tt|�j||d|||||d�dS)Nr)r�r�r�r�r�r�rrr�)r�r�rQr�r�r*r+rQ�s
�z_AppendConstAction.__init__cCs4t||jd�}t|�}|�|j�t||j|�dSr-)r�r�r7r r�r�r�r*r*r+r��sz_AppendConstAction.__call__)NFNN)Nr�r*r*r�r+r��s�r�cs(eZdZd�fdd�	Zddd�Z�ZS)	�_CountActionNFcs tt|�j||d|||d�dS)Nr)r�r�r�r�r�rr)r�r�rQr�r�r*r+rQ�s
�z_CountAction.__init__cCs0t||jd�}|dkrd}t||j|d�dS�NrrS)r�r�r�)r%r�r�r�r��countr*r*r+r��sz_CountAction.__call__)NFN)Nr�r*r*r�r+r��s
�r�cs.eZdZeedf�fdd�	Zddd�Z�ZS)�_HelpActionNcstt|�j|||d|d�dS�Nr)r�r�r�r�rr)r�r�rQ)r%r�r�r�rrr�r*r+rQs
�z_HelpAction.__init__cCs|��|��dSr-)�
print_help�exitr�r*r*r+r�sz_HelpAction.__call__)N�rr2r3rrQr�r�r*r*r�r+r�s
�r�cs0eZdZdeedf�fdd�	Zddd�Z�ZS)�_VersionActionNz&show program's version number and exitcs$tt|�j|||d|d�||_dSr)r�rrQ�version)r%r�rr�r�rrr�r*r+rQs
�z_VersionAction.__init__cCsD|j}|dkr|j}|��}|�|�|�|��tj�|��dSr-)r�_get_formatterrg�_print_messagera�_sys�stdoutr)r%r�r�r�r�rrWr*r*r+r�(s
z_VersionAction.__call__)Nrr*r*r�r+rs�rcsPeZdZGdd�de�Zedddf�fdd�	Zdd�Zd	d
�Zd
dd�Z	�Z
S)�_SubParsersActioncseZdZ�fdd�Z�ZS)z&_SubParsersAction._ChoicesPseudoActioncs@|}}|r|dd�|�7}ttj|�}|jg|||d�dS)Nr�r)r�r�rrr�)r$r�r
�_ChoicesPseudoActionrQ)r%r(�aliasesrrr�r�Zsupr�r*r+rQ6s
�z/_SubParsersAction._ChoicesPseudoAction.__init__r�r*r*r�r+r4srFNc	s<||_||_i|_g|_tt|�j||t|j|||d�dS)N)r�r�r�r�r�rrr�)�_prog_prefix�
_parser_class�_name_parser_map�_choices_actionsr�r
rQr)r%r�rO�parser_classr�r�rrr�r�r*r+rQ>s	
�z_SubParsersAction.__init__cKs�|�d�dkr d|j|f|d<|�dd�}d|krX|�d�}|�|||�}|j�|�|jf|�}||j|<|D]}||j|<qr|S)NrOr�rr*rr)r�r
r�rrr rr)r%r(�kwargsrrrZ
choice_actionr��aliasr*r*r+�
add_parserUs

z_SubParsersAction.add_parsercCs|jSr-)rr1r*r*r+r�lsz!_SubParsersAction._get_subactionscCs�|d}|dd�}|jtk	r,t||j|�z|j|}Wn<tk
rv|d�|j�d�}td�|}t||��YnX|�|d�\}	}t	|	��
�D]\}
}t||
|�q�|r�t	|��tg�t
|t��|�dS)NrrSr)�parser_namer�z5unknown parser %(parser_name)r (choices: %(choices)s))r�rr�r�KeyErrorr$r�r�parse_known_argsr�r0�
setdefault�_UNRECOGNIZED_ARGS_ATTRr�r�)r%r�r�r�r�rr&r\�msgZsubnamespace�keyr)r*r*r+r�os$

�	z_SubParsersAction.__call__)N)rr2r3rrrrQrr�r�r�r*r*r�r+r
2s�r
c@seZdZddd�ZdS)�
_ExtendActionNcCs2t||jd�}t|�}|�|�t||j|�dSr-)r�r�r7r�r�r�r*r*r+r��s
z_ExtendAction.__call__)N)rr2r3r�r*r*r*r+r�src@s*eZdZdZddd�Zdd�Zd	d
�ZdS)ra�Factory for creating file object types

    Instances of FileType are typically passed as type= arguments to the
    ArgumentParser add_argument() method.

    Keyword Arguments:
        - mode -- A string indicating how the file is to be opened. Accepts the
            same values as the builtin open() function.
        - bufsize -- The file's desired buffer size. Accepts the same values as
            the builtin open() function.
        - encoding -- The file's encoding. Accepts the same values as the
            builtin open() function.
        - errors -- A string indicating how encoding and decoding errors are to
            be handled. Accepts the same value as the builtin open() function.
    �rr�NcCs||_||_||_||_dSr-)�_mode�_bufsize�	_encoding�_errors)r%�mode�bufsize�encoding�errorsr*r*r+rQ�szFileType.__init__c
Cs�|dkr>d|jkrtjSd|jkr(tjStd�|j}t|��zt||j|j|j|j	�WSt
k
r�}z"||d�}td�}t||��W5d}~XYnXdS)N�-r�wzargument "-" with mode %r)�filename�errorz$can't open '%(filename)s': %(error)s)rr�stdinr	r�r�r�rr r!�OSErrorr)r%�stringr�er\r�r*r*r+r��s

�
zFileType.__call__cCsT|j|jf}d|jfd|jfg}d�dd�|D�dd�|D��}dt|�j|fS)Nr$r%rcSsg|]}|dkrt|��qS)r�)r!)rZr'r*r*r+r]�sz%FileType.__repr__.<locals>.<listcomp>cSs$g|]\}}|dk	rd||f�qS)Nrr*)rZ�kwr'r*r*r+r]�s�r)rrr r!r$rr)r%r\rZargs_strr*r*r+r,�s�zFileType.__repr__)rr�NN)rr2r3r4rQr�r,r*r*r*r+r�s
c@s(eZdZdZdd�Zdd�Zdd�ZdS)	r
z�Simple object for storing attributes.

    Implements equality by attribute names and values, and provides a simple
    string representation.
    cKs|D]}t||||�qdSr-)r�)r%rr(r*r*r+rQ�szNamespace.__init__cCst|t�stSt|�t|�kSr-)r�r
�NotImplementedr�)r%�otherr*r*r+�__eq__�s
zNamespace.__eq__cCs
||jkSr-)r/)r%rr*r*r+�__contains__�szNamespace.__contains__N)rr2r3r4rQr1r2r*r*r*r+r
�scs�eZdZ�fdd�Zdd�Zd&dd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zd'dd�Zdd�Zd d!�Zd"d#�Zd$d%�Z�ZS)(�_ActionsContainercstt|���||_||_||_||_i|_|�ddt	�|�ddt	�|�ddt
�|�ddt�|�ddt�|�ddt
�|�ddt�|�ddt�|�dd	t�|�dd
t�|�ddt�|�ddt�|��g|_i|_g|_g|_i|_t�d
�|_g|_dS)NrvZstoreZstore_const�
store_trueZstore_falser Zappend_constr�rrr�parsersr�z^-\d+$|^-\d*\.\d+$)r�r3rQ�description�argument_default�prefix_chars�conflict_handler�_registries�registerr�r�r�r�r�r�r�r�rr
r�_get_handler�_actions�_option_string_actions�_action_groups�_mutually_exclusive_groups�	_defaultsrJrK�_negative_number_matcher�_has_negative_number_optionals)r%r6r8r7r9r�r*r+rQ�s4z_ActionsContainer.__init__cCs|j�|i�}|||<dSr-)r:r)r%�
registry_namer)r��registryr*r*r+r;sz_ActionsContainer.registerNcCs|j|�||�Sr-)r:r�)r%rDr)r�r*r*r+�
_registry_get sz_ActionsContainer._registry_getcKs2|j�|�|jD]}|j|kr||j|_qdSr-)rA�updater=r�r�)r%rrvr*r*r+�set_defaults&s

z_ActionsContainer.set_defaultscCs8|jD]"}|j|kr|jdk	r|jSq|j�|d�Sr-)r=r�r�rAr�)r%r�rvr*r*r+�get_default/s
z_ActionsContainer.get_defaultcOsD|j}|r&t|�dkrH|dd|krH|r:d|kr:td��|j||�}n|j||�}d|kr�|d}||jkr~|j||d<n|jdk	r�|j|d<|�|�}t|�s�td|f��|f|�}|�	d|j
|j
�}t|�s�td	|f��|tkr�td
|f��t|d��r:z|�
��|d�Wntk
�r8td��YnX|�|�S)
z�
        add_argument(dest, ..., name=value, ...)
        add_argument(option_string, option_string, ..., name=value, ...)
        rSrr�z+dest supplied twice for positional argumentr�Nzunknown action "%s"r�%r is not callablez<%r is a FileType class object, instance of it must be passedrz,length of metavar tuple does not match nargs)r8ror��_get_positional_kwargs�_get_optional_kwargsrAr7�_pop_action_class�callablerFrrr�rr�r��_add_action)r%r\r�charsr�Zaction_classrv�	type_funcr*r*r+rx9s:	 




�z_ActionsContainer.add_argumentcOs t|f|�|�}|j�|�|Sr-)�_ArgumentGroupr?r )r%r\rr�r*r*r+�add_argument_grouplsz$_ActionsContainer.add_argument_groupcKst|f|�}|j�|�|Sr-)�_MutuallyExclusiveGroupr@r )r%rr�r*r*r+�add_mutually_exclusive_groupqsz._ActionsContainer.add_mutually_exclusive_groupcCs`|�|�|j�|�||_|jD]}||j|<q"|jD]"}|j�|�r8|js8|j�d�q8|S)NT)	�_check_conflictr=r �	containerr�r>rB�matchrC)r%rvr�r*r*r+rOvs


z_ActionsContainer._add_actioncCs|j�|�dSr-)r=�remover�r*r*r+�_remove_action�sz _ActionsContainer._remove_actioncCs�i}|jD].}|j|kr.td�}t||j��|||j<q
i}|jD]D}|j|krn|j|j|j|jd�||j<|jD]}||j||<qtqD|jD]&}|j	|j
d�}|jD]}|||<q�q�|jD]}|�||��
|�q�dS)Nz.cannot merge actions - two groups are named %r)�titler6r9)r�)r?r[r�r�rSr6r9r�r@rUr�r=r�rO)r%rWZtitle_group_mapr�rZ	group_maprv�mutex_groupr*r*r+�_add_container_actions�s0



�

�

z(_ActionsContainer._add_container_actionscKs^d|krtd�}t|��|�d�ttfkr2d|d<|�d�tkrPd|krPd|d<t||gd�S)Nr�z1'required' is an invalid argument for positionalsr�Tr��r�r�)r�r�r�r
rr�)r%r�rrr*r*r+rK�sz(_ActionsContainer._get_positional_kwargsc	Os�g}g}|D]n}|d|jkr>||jd�}td�}t||��|�|�|d|jkrt|�dkr|d|jkr|�|�q|�dd�}|dkr�|r�|d}n|d}|�|j�}|s�td�}t||��|�dd�}t|||d	�S)
Nr)�optionr8zNinvalid option string %(option)r: must start with a character %(prefix_chars)rrSr�z%dest= is required for options like %rr&r�r^)	r8r�r�r ror��lstrip�replacer�)	r%r\rr�Zlong_option_stringsr�rr�Zdest_option_stringr*r*r+rL�s2�

z&_ActionsContainer._get_optional_kwargscCs|�d|�}|�d||�S)Nrv)r�rF)r%rr�rvr*r*r+rM�sz#_ActionsContainer._pop_action_classcCsFd|j}zt||�WStk
r@td�}t||j��YnXdS)Nz_handle_conflict_%sz%invalid conflict_resolution value: %r)r9r�r�r�r�)r%Zhandler_func_namerr*r*r+r<�s
z_ActionsContainer._get_handlercCsLg}|jD]&}||jkr
|j|}|�||f�q
|rH|��}|||�dSr-)r�r>r r<)r%rvZconfl_optionalsr�Zconfl_optionalr9r*r*r+rV�s


z!_ActionsContainer._check_conflictcCs6tddt|��}d�dd�|D��}t|||��dS)Nzconflicting option string: %szconflicting option strings: %srcSsg|]\}}|�qSr*r*)rZr�rvr*r*r+r]	s�z<_ActionsContainer._handle_conflict_error.<locals>.<listcomp>)rror$r)r%rv�conflicting_actionsr�Zconflict_stringr*r*r+�_handle_conflict_errors�
�z(_ActionsContainer._handle_conflict_errorcCs>|D]4\}}|j�|�|j�|d�|js|j�|�qdSr-)r�rYr>r�rWrZ)r%rvrbr�r*r*r+�_handle_conflict_resolves
z*_ActionsContainer._handle_conflict_resolve)N)N)rr2r3rQr;rFrHrIrxrSrUrOrZr]rKrLrMr<rVrcrdr�r*r*r�r+r3�s$5
	
3($
		r3cs6eZdZd�fdd�	Z�fdd�Z�fdd�Z�ZS)	rRNcs�|j}|d|j�|d|j�|d|j�tt|�j}|fd|i|��||_g|_|j	|_	|j
|_
|j|_|j|_|j
|_
|j|_dS)Nr9r8r7r6)rr9r8r7r�rRrQr[r�r:r=r>rArCr@)r%rWr[r6rrGZ
super_initr�r*r+rQs�z_ArgumentGroup.__init__cs tt|��|�}|j�|�|Sr-)r�rRrOr�r r�r�r*r+rO5sz_ArgumentGroup._add_actioncs tt|��|�|j�|�dSr-)r�rRrZr�rYr�r�r*r+rZ:sz_ArgumentGroup._remove_action)NN�rr2r3rQrOrZr�r*r*r�r+rRsrRcs.eZdZd�fdd�	Zdd�Zdd�Z�ZS)	rTFcs tt|��|�||_||_dSr-)r�rTrQr��
_container)r%rWr�r�r*r+rQAsz _MutuallyExclusiveGroup.__init__cCs2|jrtd�}t|��|j�|�}|j�|�|S)Nz-mutually exclusive arguments must be optional)r�r�r�rfrOr�r )r%rvrr*r*r+rOFsz#_MutuallyExclusiveGroup._add_actioncCs|j�|�|j�|�dSr-)rfrZr�rYr�r*r*r+rZNsz&_MutuallyExclusiveGroup._remove_action)Frer*r*r�r+rT?srTcs*eZdZdZddddgeddddddf�fdd�	Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dAdd�ZdBdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�ZdCd&d'�ZdDd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�ZdEd6d7�ZdFd8d9�ZdGd:d;�ZdHd=d>�Z d?d@�Z!�Z"S)Ira�Object for parsing command line strings into Python objects.

    Keyword Arguments:
        - prog -- The name of the program (default: sys.argv[0])
        - usage -- A usage message (default: auto-generated from arguments)
        - description -- A description of what the program does
        - epilog -- Text following the argument descriptions
        - parents -- Parsers whose arguments should be copied into this one
        - formatter_class -- HelpFormatter class for printing help messages
        - prefix_chars -- Characters that prefix optional arguments
        - fromfile_prefix_chars -- Characters that prefix files containing
            additional arguments
        - argument_default -- The default value for all arguments
        - conflict_handler -- String indicating how to handle conflicts
        - add_help -- Add a -h/-help option
        - allow_abbrev -- Allow long options to be abbreviated unambiguously
    Nr&r)Tc
	s"tt|�j}
|
|||	|
d�|dkr6tj�tjd�}||_||_	||_
||_||_||_
||_|j}|td��|_|td��|_d|_dd�}|�dd|�d|kr�dn|d}|j
r�|j|d	|d
ddttd�d
�|D]<}|�|�z
|j}Wntk
�rYq�X|j�|�q�dS)N)r6r8r7r9rzpositional argumentszoptional argumentscSs|Sr-r*)r,r*r*r+�identity�sz)ArgumentParser.__init__.<locals>.identityrr&�hr8rrzshow this help message and exit)rvr�rr)r�rrQ�_os�path�basenamer�argvrOri�epilog�formatter_class�fromfile_prefix_chars�add_help�allow_abbrevrSr��_positionals�
_optionals�_subparsersr;rxrr]rAr�rG)r%rOrir6rm�parentsrnr8ror7r9rprqZ	superinitZ	add_grouprgZdefault_prefixrX�defaultsr�r*r+rQfsJ�
�

zArgumentParser.__init__cs"ddddddg}�fdd�|D�S)	NrOrir6rnr9rpcsg|]}|t�|�f�qSr*r�r�r1r*r+r]�sz.ArgumentParser._get_kwargs.<locals>.<listcomp>r*r�r*r1r+r"�s�zArgumentParser._get_kwargsc	Ks�|jdk	r|�td��|�dt|��d|ks8d|krht|�dd��}t|�dd��}|�||�|_n|j|_|�d�dkr�|�	�}|�
�}|j}|�|j
||d�|����|d<|�|d�}|fd	gi|��}|j�|�|S)
Nz(cannot have multiple subparser argumentsrr[r6ZsubcommandsrOr^r5r�)rtr)r�rrr�rSrrr�r�_get_positional_actionsr@rmrirar|rMrO)	r%rr[r6rWr�rkZ
parsers_classrvr*r*r+�add_subparsers�s$
zArgumentParser.add_subparserscCs$|jr|j�|�n|j�|�|Sr-)r�rsrOrrr�r*r*r+rO�szArgumentParser._add_actioncCsdd�|jD�S)NcSsg|]}|jr|�qSr*�r��rZrvr*r*r+r]�s�z8ArgumentParser._get_optional_actions.<locals>.<listcomp>�r=r1r*r*r+�_get_optional_actions�s�z$ArgumentParser._get_optional_actionscCsdd�|jD�S)NcSsg|]}|js|�qSr*ryrzr*r*r+r]�s�z:ArgumentParser._get_positional_actions.<locals>.<listcomp>r{r1r*r*r+rw�s�z&ArgumentParser._get_positional_actionscCs4|�||�\}}|r0td�}|�|d�|��|S�Nzunrecognized arguments: %sr)rr�r)r$�r%r\r�rlrr*r*r+�
parse_args�s
zArgumentParser.parse_argscCs|dkrtjdd�}nt|�}|dkr.t�}|jD]4}|jtk	r4t||j�s4|jtk	r4t	||j|j�q4|j
D] }t||�spt	|||j
|�qpz>|�||�\}}t|t�r�|�
t|t��t|t�||fWStk
�rt��d}|�t|��YnXdSrR)rrlr5r
r=r�rr�r�r�rA�_parse_known_argsrr�r��delattrr�exc_infor)r�)r%r\r�rvr��errr*r*r+r�s,







zArgumentParser.parse_known_argscs�	jdk	r�	����i��	jD]R}|j}t|j�D]<\}}��|g�}|�|d|��|�||dd��q2qi�g}t��}	t|	�D]^\}}
|
dkr�|�d�|	D]}
|�d�q�q��	�	|
�}|dkr�d}n|�|<d}|�|�q�d�
|��t��t��d�����	fdd�	������	�fd	d
�}
�	�������	�fdd�}g�d
�
��r`t
��}nd}�
|k�r�t�
fdd��D��}�
|k�r�|�
�}|�
k�r�|�
�qdn|�
�
�k�r҈�
|�}��|�|�
|
�
��
�qd|�
�}���|d��g}�	jD]|}|�k�r|j�r(|�t|��nT|jdk	�rt|jt��rt�|j��r|jt�|j�k�rt�|j�	�||j���q|�r��	�td�d�
|���	jD]X}|j�r�|jD]}|�k�r��q��q�dd�|jD�}td�}�	�|d�
|���q���fS)NrS�--r&�A�Or^cs|��|���||�}||jk	rb��|���|g�D]*}|�kr6td�}t|�}t|||��q6|tk	rx|��||�dS)Nznot allowed with argument %s)r��_get_valuesr�r�r�r�rr)rvZargument_stringsr�Zargument_valuesZconflict_actionrZaction_name)�action_conflictsr��seen_actions�seen_non_default_actionsr%r*r+�take_action@s


z5ArgumentParser._parse_known_args.<locals>.take_actioncs~�|}|\}}}�j}g}|dkr:���|�|dS|dk	�r||d�}�j}|dkr�|d|kr�|�|g|f�|d}	|	|d}|dd�p�d}
�j}||kr�||}|
}ntd�}t|||��nB|dkr�|d}
|g}|�|||f��q\ntd�}t|||��q|d}�|d�}|||�}||}
�||
�}|�|||f��q\q|D]\}}}�|||��q`|
S)NrSr�rzignored explicit argument %r)�_match_argumentr r8r>r�r)�start_index�option_tuplervr��explicit_argZmatch_argumentZ
action_tuples�	arg_countrP�charZnew_explicit_argZ
optionals_mapr�stopr\r�Zselected_patterns)r&�arg_strings_pattern�extras�option_string_indicesr%r�r*r+�consume_optionalUsL



z:ArgumentParser._parse_known_args.<locals>.consume_optionalcsn�j}�|d�}|�|�}t�|�D]*\}}�|||�}||7}�||�q&�t|�d��dd�<|Sr-)�_match_arguments_partial�zipro)r�Z
match_partialZselected_patternZ
arg_countsrvr�r\)r&r�r�r%r�r*r+�consume_positionals�s
z=ArgumentParser._parse_known_args.<locals>.consume_positionalsrr�csg|]}|�kr|�qSr*r*)rZr�)r�r*r+r]�s�z4ArgumentParser._parse_known_args.<locals>.<listcomp>z(the following arguments are required: %srcSsg|]}|jtk	rt|��qSr*)rrrr�rzr*r*r+r]�s
�z#one of the arguments %s is requiredr)N)ro�_read_args_from_filesr@r�r�rr��iterr �_parse_optionalr$r�rwrAr@r=r�r�r�r�r�r�r�r�r��
_get_valuer)r�)r%r&r�r\r�r�Zmutex_actionZ	conflictsZarg_string_pattern_partsZarg_strings_iter�
arg_stringr��patternr�r�Zmax_option_string_indexZnext_option_string_indexZpositionals_end_indexZstringsZ
stop_indexZrequired_actionsrvr�r�rr*)r�r&r�r�r�r�r�r�r�r%r�r�r+r�s�





J

�






�
���
�



�z ArgumentParser._parse_known_argsc
Cs�g}|D]�}|r|d|jkr*|�|�qzdt|dd���J}g}|����D]}|�|�D]}|�|�q\qN|�|�}|�|�W5QRXWqtk
r�t	�
�d}|�t|��YqXq|Sr�)
ror r��readr��convert_arg_line_to_argsr�r�r+rr�r)r�)r%r&Znew_arg_stringsr�Z	args_file�arg_liner'r�r*r*r+r�s 
z$ArgumentParser._read_args_from_filescCs|gSr-r*)r%r�r*r*r+r�!sz'ArgumentParser.convert_arg_line_to_argscCsz|�|�}t�||�}|dkrldtd�ttd�ttd�i}|�|j�}|dkrbtdd|j�|j}t	||��t
|�d��S)Nzexpected one argumentzexpected at most one argumentzexpected at least one argumentzexpected %s argumentzexpected %s argumentsrS)�_get_nargs_patternrJrXr�r
rr�r�rrror�)r%rvr��
nargs_patternrXZnargs_errorsrr*r*r+r�$s(
���
zArgumentParser._match_argumentcsrg}tt|�dd�D]X}|d|�}d��fdd�|D��}t�||�}|dk	r|�dd�|��D��qnq|S)Nrr�r^csg|]}��|��qSr*)r�rzr1r*r+r]@s�z;ArgumentParser._match_arguments_partial.<locals>.<listcomp>cSsg|]}t|��qSr*rn)rZr,r*r*r+r]Ds)r�ror$rJrXr�rk)r%rjr�r�r�Z
actions_slicer�rXr*r1r+r�:s�z'ArgumentParser._match_arguments_partialc
Cs|sdS|d|jkrdS||jkr8|j|}||dfSt|�dkrHdSd|kr~|�dd�\}}||jkr~|j|}|||fS|�|�}t|�dkr�d�dd�|D��}||d�}td�}|�||�nt|�dkr�|\}	|	S|j�	|�r�|j
s�dSd	|k�rdSd|dfS)
NrrS�=rcSsg|]\}}}|�qSr*r*)rZrvr�r�r*r*r+r]is�z2ArgumentParser._parse_optional.<locals>.<listcomp>)r_Zmatchesz4ambiguous option: %(option)s could match %(matches)sr)r8r>ro�split�_get_option_tuplesr$r�r)rBrXrC)
r%r�rvr�r�Z
option_tuplesZoptionsr\rr�r*r*r+r�Js>







�

zArgumentParser._parse_optionalc
Cs0g}|j}|d|kr�|d|kr�|jr~d|krB|�dd�\}}n|}d}|jD],}|�|�rP|j|}|||f}|�|�qPn�|d|k�r|d|k�r|}d}|dd�}|dd�}	|jD]T}||kr�|j|}|||	f}|�|�q�|�|�r�|j|}|||f}|�|�q�n|�td�|�|S)NrrSr�r8zunexpected option string: %s)r8rqr�r>�
startswithr r)r�)
r%r�r�rPZ
option_prefixr�rvr�Zshort_option_prefixZshort_explicit_argr*r*r+r��s:









z!ArgumentParser._get_option_tuplescCs�|j}|dkrd}nf|tkr"d}nX|tkr0d}nJ|tkr>d}n<|tkrLd}n.|tkrZd}n |tkrhd}ndd	�d
|�}|jr�|�	d	d�}|�	dd�}|S)
Nz(-*A-*)z(-*A?-*)z	(-*[A-]*)z
(-*A[A-]*)z([-AO]*)z(-*A[-AO]*)z(-*-*)z(-*%s-*)z-*r�r^r&)
r�r
rrrrrr$r�ra)r%rvr�r�r*r*r+r��s(z!ArgumentParser._get_nargs_patterncCs4|�||�\}}|r0td�}|�|d�|��|Sr})�parse_known_intermixed_argsr�r)r$r~r*r*r+�parse_intermixed_args�s
z$ArgumentParser.parse_intermixed_argsc	s�|���dd��D�}|r,td|dj���fdd�|jD�rHtd���zN|j}z�|jdkrp|��dd�|_�D] }|j|_t	|_|j|_t	|_qt|�
||�\}}�D]J}t||j�r�t
||j�gkr�ddlm}|d	|j|f�t||j�q�W5�D]}|j|_|j|_q�X|��}zJ|D]}|j|_d
|_�q$|jD]}	|	j|	_d
|	_�q@|�
||�\}}
W5|D]}|j|_�qn|jD]}	|	j|	_�q�XW5||_X||
fS)NcSsg|]}|jttfkr|�qSr*)r�rrrzr*r*r+r]�s�z>ArgumentParser.parse_known_intermixed_args.<locals>.<listcomp>z3parse_intermixed_args: positional arg with nargs=%srcs&g|]}|jD]}|�kr|j�qqSr*)r�r�)rZr�rv�r�r*r+r]�s
�z;parse_intermixed_args: positional in mutuallyExclusiveGroup�)�warnzDo not expect %s in %sF)rwr�r�r@riZ
save_nargsZsave_defaultr��format_usagerrr�r�r��warningsr�r�r|Z
save_requiredr�)r%r\r��aZ
save_usagervZremaining_argsr�r�r�r�r*r�r+r��s`
�
��


�
z*ArgumentParser.parse_known_intermixed_argscs��jttfkr2z|�d�Wntk
r0YnX|sz�jtkrz�jrN�j}n�j}t	|t
�rv���|�}���|��n|s��jt
kr��js��jdk	r��j}n|}���|�n�t|�dkr�jdtfkr�|\}���|�}���|�n��jtk�r��fdd�|D�}np�jtk�r@��fdd�|D�}���|d�n>�jtk�rRt}n,��fdd�|D�}|D]}���|��qj|S)Nr�rScsg|]}���|��qSr*�r��rZ�v�rvr%r*r+r]Z	sz.ArgumentParser._get_values.<locals>.<listcomp>csg|]}���|��qSr*r�r�r�r*r+r]^	srcsg|]}���|��qSr*r�r�r�r*r+r]g	s)r�rrrYr�r
r�r�r�r�r�r��_check_valuerror)r%rvr&r)r�r�r*r�r+r�6	sD
�
zArgumentParser._get_valuesc	Cs�|�d|j|j�}t|�s0td�}t|||��z||�}Wn�tk
r~t|jdt|j��}tt	�
�d�}t||��YnLttfk
r�t|jdt|j��}||d�}td�}t|||��YnX|S)NrrJrrS)rr)z!invalid %(type)s value: %(value)r)
rFrrNr�rrr�r!r�rr�r�r�)r%rvr�rQrr�r(r\r*r*r+r�n	s 
zArgumentParser._get_valuecCsF|jdk	rB||jkrB|d�tt|j��d�}td�}t|||��dS)Nr)r)r�z3invalid choice: %(value)r (choose from %(choices)s))r�r$�mapr!r�r)r%rvr)r\rr*r*r+r��	s�zArgumentParser._check_valuecCs$|��}|�|j|j|j�|��Sr-)rrmrir=r@ra)r%rWr*r*r+r��	s
�zArgumentParser.format_usagecCst|��}|�|j|j|j�|�|j�|jD]0}|�|j	�|�|j�|�
|j�|��q.|�|j
�|��Sr-)rrmrir=r@rgr6r?rcr[ryr�rdrmra)r%rWZaction_groupr*r*r+ra�	s�

zArgumentParser.format_helpcCs|j|jd�S)Nr~)rnrOr1r*r*r+r�	szArgumentParser._get_formattercCs"|dkrtj}|�|��|�dSr-)rr	rr��r%�filer*r*r+�print_usage�	szArgumentParser.print_usagecCs"|dkrtj}|�|��|�dSr-)rr	rrar�r*r*r+r�	szArgumentParser.print_helpcCs |r|dkrtj}|�|�dSr-)r�stderr�write)r%r�r�r*r*r+r�	szArgumentParser._print_messagercCs |r|�|tj�t�|�dSr-)rrr�r)r%Zstatusr�r*r*r+r�	szArgumentParser.exitcCs0|�tj�|j|d�}|�dtd�|�dS)z�error(message: string)

        Prints a usage message incorporating the message to stderr and
        exits.

        If you override this in a subclass, it should not return -- it
        should either exit or raise an exception.
        )rOr�r8z%(prog)s: error: %(message)s
N)r�rr�rOrr�)r%r�r\r*r*r+r)�	s	zArgumentParser.error)NN)NN)NN)NN)N)N)N)rN)#rr2r3r4rrQr"rxrOr|rwrrr�r�r�r�r�r�r�r�r�r�r�r�r�r�rarr�rrrr)r�r*r*r�r+rSsV�@

#w:-1

M8


	
)3r4�__version__�__all__�osri�rerJZshutilr;�sysrrr�rrr
rrrrrr�rr7rrrrr	r��	Exceptionrrrr�r�r�r�r�r�r�r�rr
rrr
r3rRrTrr*r*r*r+�<module>s�=�z
	[#&]7:"__pycache__/fileinput.cpython-38.pyc000064400000032077151153537560013427 0ustar00U

e5du9�@s�dZddlZddlZddddddd	d
ddd
dgZdad"ddd�dd�Zdd�Zdd�Zdd�Zdd�Z	dd�Z
dd	�Zdd
�Zdd�Z
Gdd�d�Zdd
�Zd#dd�Zdd �Zed!kr�e�dS)$a
Helper class to quickly write a loop over all standard input files.

Typical use is:

    import fileinput
    for line in fileinput.input():
        process(line)

This iterates over the lines of all files listed in sys.argv[1:],
defaulting to sys.stdin if the list is empty.  If a filename is '-' it
is also replaced by sys.stdin and the optional arguments mode and
openhook are ignored.  To specify an alternative list of filenames,
pass it as the argument to input().  A single file name is also allowed.

Functions filename(), lineno() return the filename and cumulative line
number of the line that has just been read; filelineno() returns its
line number in the current file; isfirstline() returns true iff the
line just read is the first line of its file; isstdin() returns true
iff the line was read from sys.stdin.  Function nextfile() closes the
current file so that the next iteration will read the first line from
the next file (if any); lines not read from the file will not count
towards the cumulative line count; the filename is not changed until
after the first line of the next file has been read.  Function close()
closes the sequence.

Before any lines have been read, filename() returns None and both line
numbers are zero; nextfile() has no effect.  After all lines have been
read, filename() and the line number functions return the values
pertaining to the last line read; nextfile() has no effect.

All files are opened in text mode by default, you can override this by
setting the mode parameter to input() or FileInput.__init__().
If an I/O error occurs during opening or reading a file, the OSError
exception is raised.

If sys.stdin is used more than once, the second and further use will
return no lines, except perhaps for interactive use, or if it has been
explicitly reset (e.g. using sys.stdin.seek(0)).

Empty files are opened and immediately closed; the only time their
presence in the list of filenames is noticeable at all is when the
last file opened is empty.

It is possible that the last line of a file doesn't end in a newline
character; otherwise lines are returned including the trailing
newline.

Class FileInput is the implementation; its methods filename(),
lineno(), fileline(), isfirstline(), isstdin(), nextfile() and close()
correspond to the functions in the module.  In addition it has a
readline() method which returns the next input line, and a
__getitem__() method which implements the sequence behavior.  The
sequence must be accessed in strictly sequential order; sequence
access and readline() cannot be mixed.

Optional in-place filtering: if the keyword argument inplace=1 is
passed to input() or to the FileInput constructor, the file is moved
to a backup file and standard output is directed to the input file.
This makes it possible to write a filter that rewrites its input file
in place.  If the keyword argument backup=".<some extension>" is also
given, it specifies the extension for the backup file, and the backup
file remains around; by default, the extension is ".bak" and it is
deleted when the output file is closed.  In-place filtering is
disabled when standard input is read.  XXX The current implementation
does not work for MS-DOS 8+3 filesystems.

XXX Possible additions:

- optional getopt argument processing
- isatty()
- read(), read(size), even readlines()

�N�input�close�nextfile�filename�lineno�
filelineno�fileno�isfirstline�isstdin�	FileInput�hook_compressed�hook_encodedF��r��mode�openhookcCs(trtjrtd��t|||||d�atS)aReturn an instance of the FileInput class, which can be iterated.

    The parameters are passed to the constructor of the FileInput class.
    The returned instance, in addition to being an iterator,
    keeps global state for the functions of this module,.
    zinput() already activer)�_state�_file�RuntimeErrorr)�files�inplace�backuprr�r�!/usr/lib64/python3.8/fileinput.pyrSs
cCst}da|r|��dS)zClose the sequence.N)rr)�staterrrr`scCststd��t��S)a�
    Close the current file so that the next iteration will read the first
    line from the next file (if any); lines not read from the file will
    not count towards the cumulative line count. The filename is not
    changed until after the first line of the next file has been read.
    Before the first line has been read, this function has no effect;
    it cannot be used to skip the first file. After the last line of the
    last file has been read, this function has no effect.
    �no active input())rrrrrrrrhs
cCststd��t��S)zr
    Return the name of the file currently being read.
    Before the first line has been read, returns None.
    r)rrrrrrrrvscCststd��t��S)z�
    Return the cumulative line number of the line that has just been read.
    Before the first line has been read, returns 0. After the last line
    of the last file has been read, returns the line number of that line.
    r)rrrrrrrrscCststd��t��S)z�
    Return the line number in the current file. Before the first line
    has been read, returns 0. After the last line of the last file has
    been read, returns the line number of that line within the file.
    r)rrrrrrrr�scCststd��t��S)zg
    Return the file number of the current file. When no file is currently
    opened, returns -1.
    r)rrrrrrrr�scCststd��t��S)ze
    Returns true the line just read is the first line of its file,
    otherwise returns false.
    r)rrr	rrrrr	�scCststd��t��S)z]
    Returns true if the last line was read from sys.stdin,
    otherwise returns false.
    r)rrr
rrrrr
�sc@s�eZdZdZd)ddd�dd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�ZdS)*ra;FileInput([files[, inplace[, backup]]], *, mode=None, openhook=None)

    Class FileInput is the implementation of the module; its methods
    filename(), lineno(), fileline(), isfirstline(), isstdin(), fileno(),
    nextfile() and close() correspond to the functions of the same name
    in the module.
    In addition it has a readline() method which returns the next
    input line, and a __getitem__() method which implements the
    sequence behavior. The sequence must be accessed in strictly
    sequential order; random access and readline() cannot be mixed.
    NFrrrcCst|t�r|f}nBt|tj�r,t�|�f}n(|dkrBtjdd�}|sLd}nt|�}||_||_	||_
d|_d|_d|_
d|_d|_d|_d|_d|_|dkr�td��d|kr�ddl}|�dtd	�||_d|kr�|�d
d�nd|_|�r|r�td��t|��std
��||_dS)N�)�-rF)rZrU�U�rbz=FileInput opening mode must be one of 'r', 'rU', 'U' and 'rb'rz'U' mode is deprecated�r�wz4FileInput cannot use an opening hook in inplace modez#FileInput openhook must be callable)�
isinstance�str�os�PathLike�fspath�sys�argv�tuple�_files�_inplace�_backup�_savestdout�_output�	_filename�_startlineno�_filelinenor�_isstdin�_backupfilename�
ValueError�warnings�warn�DeprecationWarning�_mode�replace�_write_mode�callable�	_openhook)�selfrrrrrr6rrr�__init__�sH
�
zFileInput.__init__cCs|��dS�N�r�r>rrr�__del__�szFileInput.__del__cCsz|��W5d|_XdS)Nr)r+rrBrrrr�szFileInput.closecCs|Sr@rrBrrr�	__enter__�szFileInput.__enter__cCs|��dSr@rA)r>�type�value�	tracebackrrr�__exit__�szFileInput.__exit__cCs|Sr@rrBrrr�__iter__�szFileInput.__iter__cCs6|��}|r|jd7_|S|js(t�|��qdS�Nr)�	_readliner2r�
StopIterationr�r>�linerrr�__next__�szFileInput.__next__cCsXddl}|jdtdd�||��kr,td��z
|��WStk
rRtd��YnXdS)NrzTSupport for indexing FileInput objects is deprecated. Use iterator protocol instead.r!)�
stacklevelzaccessing lines out of orderzend of input reached)r6r7r8rrrOrL�
IndexError)r>�ir6rrr�__getitem__s�
zFileInput.__getitem__cCs�|j}d|_|r|t_|j}d|_z|r0|�
�W5|j}d|_z|`Wntk
r\YnXz|rr|jsr|�
�W5|j}d|_|r�|js�zt	�
|�Wntk
r�YnXd|_XXdS)NF)r.r(�stdoutr/rrK�AttributeErrorr4r-r%�unlink�OSErrorr3r)r>Z
savestdout�output�fileZbackupfilenamerrrrs4

zFileInput.nextfilecCs6|��}|r|jd7_|S|js(|S|��qdSrJ)rKr2rrrMrrr�readline.szFileInput.readlinecCs�|jsd|jkrdSdS|jd|_|jdd�|_|��|_d|_d|_d|_d|_|jdkr�d|_d|jkr�t	t
jd	t
j�|_nt
j|_d
|_�nT|j�r�t
�|j�|jp�d|_zt
�|j�Wntk
r�YnXt
�|j|j�t|j|j�|_zt
�|j���j}Wn&tk
�r8t|j|j�|_YntXt
jt
jBt
jB}tt
d��rb|t
jO}t
�|j||�}t
�||j�|_zt
�|j|�Wntk
�r�YnXt
j |_!|jt
_ n,|j"�r�|�"|j|j�|_nt|j|j�|_|jj#|_$|�$�S)
N�b�rrrFrz<stdin>�bufferTz.bak�O_BINARY)%r+r9r0rr1r2rr3r4�getattrr(�stdinr,r%r'r-rVrW�rename�open�fstatr�st_moder;r/�O_CREAT�O_WRONLY�O_TRUNC�hasattrr^�fdopen�chmodrTr.r=rZrK)r>Zpermr�fdrrrrK9s\




�


zFileInput._readlinecCs|jSr@)r0rBrrrrrszFileInput.filenamecCs|j|jSr@)r1r2rBrrrruszFileInput.linenocCs|jSr@�r2rBrrrrxszFileInput.filelinenocCs4|jr,z|j��WStk
r(YdSXndSdS)N���)rrr5rBrrrr{s
zFileInput.filenocCs
|jdkSrJrlrBrrrr	�szFileInput.isfirstlinecCs|jSr@)r3rBrrrr
�szFileInput.isstdin)NFr)�__name__�
__module__�__qualname__�__doc__r?rCrrDrHrIrOrSrrZrKrrrrr	r
rrrrr�s*�)9	cCsVtj�|�d}|dkr,ddl}|�||�S|dkrHddl}|�||�St||�SdS)Nrz.gzrz.bz2)r%�path�splitext�gziprb�bz2ZBZ2File)rrZextrtrurrrr�scs��fdd�}|S)Ncst||��d�S)N��encoding�errors)rb)rrrvrrr�szhook_encoded.<locals>.openhookr)rwrxrrrvrr
�scCs�ddl}d}d}|�tjdd�d�\}}|D] \}}|dkrBd}|dkr.|}q.t|||d�D]b}|d	d�d
kr~|dd	�}|d	d�dkr�|dd	�}tdt�t�t�t�r�d
p�d|f�q^tdt�t�t�f�dS)NrFrzib:z-iTz-b)rrrm�
�
z%d: %s[%d]%s %s�*rz
%d: %s[%d])	�getoptr(r)r�printrrrr	)r|rrZopts�args�o�arNrrr�_test�s&�
r��__main__)NFr)N)rqr(r%�__all__rrrrrrrrr	r
rrr
r�rnrrrr�<module>s4J�
	

			^
__pycache__/threading.cpython-38.opt-2.pyc000064400000054502151153537560014332 0ustar00U

e5d���@s.ddlZddlZddlZddlmZddlm	Z	ddl
mZm
ZzddlmZWn ek
rpddlmZYnXdddd	d
ddd
dddddddddddddddgZejZejZejZejZzejZdZe�d�Wnek
r�dZYnXejZ z
ej!Z"Wnek
�rdZ"YnXej#Z#[da$da%d d�Z&d!d�Z'eZ(d"d�Z!Gd#d$�d$�Z)e)Z*Gd%d�d�Z+Gd&d�d�Z,Gd'd�de,�Z-Gd(d
�d
�Z.Gd)d�d�Z/Gd*d�de0�Z1e�j2Z3e3�dKd,d-�Z4e�a5iZ6iZ7e	�Z8e�a9e:�a;Gd.d�d�Z<zdd/lm=a>m?Z@WnHek
�rRdd0lAmBZCdd1lmDZDeDdd2�Z?d3d�Z@d4d�a>YnXd5d6�ZEGd7d�de<�ZFGd8d9�d9e<�ZGGd:d;�d;e<�ZHd<d	�ZIeIZJd=d�ZKeKZLd>d?�ZMd@d
�ZNddAlmOZOeG�aPdBdC�ZQdDd�ZRzddElmSZTWn"ek
�rddFlUmTZTYnXdGdH�ZVeWedI��r*ejXeVdJ�dS)L�N)�	monotonic)�WeakSet)�islice�count)�deque�	get_ident�active_count�	Condition�current_thread�	enumerate�main_thread�TIMEOUT_MAX�Event�Lock�RLock�	Semaphore�BoundedSemaphore�Thread�Barrier�BrokenBarrierError�Timer�ThreadError�
setprofile�settrace�local�
stack_size�
excepthook�ExceptHookArgsT�
get_native_idFcCs|adS�N)�
_profile_hook��func�r#�!/usr/lib64/python3.8/threading.pyr9scCs|adSr)�_trace_hookr!r#r#r$rCscOstdkrt||�St||�Sr)�_CRLock�_PyRLock)�args�kwargsr#r#r$rQs	
c@sReZdZdd�Zdd�Zddd�ZeZd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�_RLockcCst�|_d|_d|_dS�Nr)�_allocate_lock�_block�_owner�_count��selfr#r#r$�__init__hsz_RLock.__init__c	Cs^|j}zt|j}Wntk
r(YnXd|j��r:dnd|jj|jj||j	t
t|��fS)Nz)<%s %s.%s object owner=%r count=%d at %s>�lockedZunlocked)r.�_active�name�KeyErrorr-r3�	__class__�
__module__�__qualname__r/�hex�id)r1�ownerr#r#r$�__repr__ms
�z_RLock.__repr__T���cCsDt�}|j|kr"|jd7_dS|j�||�}|r@||_d|_|S�N�)rr.r/r-�acquire)r1�blocking�timeout�me�rcr#r#r$rA|s
z_RLock.acquirecCs<|jt�krtd��|jd|_}|s8d|_|j��dS)N�cannot release un-acquired lockr@)r.r�RuntimeErrorr/r-�release)r1rr#r#r$rH�sz_RLock.releasecCs|��dSr�rH�r1�t�v�tbr#r#r$�__exit__�sz_RLock.__exit__cCs|j��|\|_|_dSr)r-rAr/r.)r1�stater#r#r$�_acquire_restore�s
z_RLock._acquire_restorecCs<|jdkrtd��|j}d|_|j}d|_|j��||fS)NrrF)r/rGr.r-rH)r1rr<r#r#r$�
_release_save�s

z_RLock._release_savecCs|jt�kSr)r.rr0r#r#r$�	_is_owned�sz_RLock._is_ownedN)Tr>)�__name__r8r9r2r=rA�	__enter__rHrNrPrQrRr#r#r#r$r*^s

$
r*c@speZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	ddd�Z
ddd�Zddd�Zdd�Z
e
ZdS)r	NcCs�|dkrt�}||_|j|_|j|_z|j|_Wntk
rDYnXz|j|_Wntk
rfYnXz|j|_Wntk
r�YnXt�|_	dSr)
r�_lockrArHrQ�AttributeErrorrPrR�_deque�_waiters�r1�lockr#r#r$r2�s$zCondition.__init__cCs
|j��Sr)rUrTr0r#r#r$rT�szCondition.__enter__cGs|jj|�Sr)rUrN)r1r(r#r#r$rN�szCondition.__exit__cCsd|jt|j�fS)Nz<Condition(%s, %d)>)rU�lenrXr0r#r#r$r=�szCondition.__repr__cCs|j��dSr)rUrHr0r#r#r$rQ�szCondition._release_savecCs|j��dSr)rUrA)r1�xr#r#r$rPszCondition._acquire_restorecCs"|j�d�r|j��dSdSdS)NrFT)rUrArHr0r#r#r$rRs
zCondition._is_ownedcCs�|��std��t�}|��|j�|�|��}d}z>|dkrN|��d}n |dkrd|�d|�}n
|�d�}|W�S|�|�|s�z|j�|�Wnt	k
r�YnXXdS)Nzcannot wait on un-acquired lockFTr)
rRrGr,rArX�appendrQrP�remove�
ValueError)r1rC�waiterZsaved_stateZgotitr#r#r$�waits*

zCondition.waitcCsXd}|}|�}|sT|dk	rB|dkr.t�|}n|t�}|dkrBqT|�|�|�}q|Sr+)�_timera)r1Z	predicaterC�endtimeZwaittime�resultr#r#r$�wait_for>s

zCondition.wait_forr@c	Csf|��std��|j}tt||��}|s,dS|D]0}|��z|�|�Wq0tk
r^Yq0Xq0dS)Nz!cannot notify on un-acquired lock)rRrGrXrW�_islicerHr^r_)r1�nZall_waitersZwaiters_to_notifyr`r#r#r$�notifyUs
zCondition.notifycCs|�t|j��dSr)rhr[rXr0r#r#r$�
notify_alllszCondition.notify_all)N)N)N)r@)rSr8r9r2rTrNr=rQrPrRrarerhriZ	notifyAllr#r#r#r$r	�s
	
0

	c@s4eZdZddd�Zd
dd�ZeZdd	�Zd
d�ZdS)rr@cCs&|dkrtd��tt��|_||_dS)Nrz$semaphore initial value must be >= 0)r_r	r�_cond�_value�r1�valuer#r#r$r2�szSemaphore.__init__TNc	Cs�|s|dk	rtd��d}d}|j�f|jdkrr|s4q�|dk	rd|dkrPt�|}n|t�}|dkrdq�|j�|�q$|jd8_d}W5QRX|S)Nz.can't specify timeout for non-blocking acquireFrr@T)r_rjrkrbra)r1rBrCrErcr#r#r$rA�s$

zSemaphore.acquirec	Cs.|j�|jd7_|j��W5QRXdSr?)rjrkrhr0r#r#r$rH�szSemaphore.releasecCs|��dSrrIrJr#r#r$rN�szSemaphore.__exit__)r@)TN)rSr8r9r2rArTrHrNr#r#r#r$rxs


-c@seZdZddd�Zdd�ZdS)rr@cCst�||�||_dSr)rr2�_initial_valuerlr#r#r$r2�szBoundedSemaphore.__init__c	CsB|j�2|j|jkrtd��|jd7_|j��W5QRXdS)Nz!Semaphore released too many timesr@)rjrkrnr_rhr0r#r#r$rH�s

zBoundedSemaphore.releaseN)r@)rSr8r9r2rHr#r#r#r$r�s
c@sBeZdZdd�Zdd�Zdd�ZeZdd�Zd	d
�Zddd
�Z	dS)rcCstt��|_d|_dS�NF)r	rrj�_flagr0r#r#r$r2�szEvent.__init__cCs|j�t��dSr)rjr2rr0r#r#r$�_reset_internal_locks�szEvent._reset_internal_lockscCs|jSr)rpr0r#r#r$�is_setszEvent.is_setc	Cs&|j�d|_|j��W5QRXdS�NT)rjrprir0r#r#r$�setsz	Event.setc	Cs|j�d|_W5QRXdSro)rjrpr0r#r#r$�clearszEvent.clearNc
Cs8|j�(|j}|s|j�|�}|W5QR�SQRXdSr)rjrpra)r1rCZsignaledr#r#r$ras
z
Event.wait)N)
rSr8r9r2rqrrZisSetrtrurar#r#r#r$r�s
c@s|eZdZddd�Zddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zedd��Z
edd��Zedd��ZdS)rNcCs.tt��|_||_||_||_d|_d|_dSr+)r	rrj�_action�_timeout�_parties�_stater/)r1�parties�actionrCr#r#r$r2Fs	zBarrier.__init__c
Cs�|dkr|j}|j�r|��|j}|jd7_z6|d|jkrL|��n
|�|�|W�W5QR�S|jd8_|��XW5QRXdSr?)rwrj�_enterr/�_exitrx�_release�_wait)r1rC�indexr#r#r$raVs	

zBarrier.waitcCs(|jdkr|j��q|jdkr$t�dS)N�r>r@r)ryrjrarr0r#r#r$r|ts


zBarrier._entercCs>z"|jr|��d|_|j��Wn|���YnXdSr?)rvryrjri�_breakr0r#r#r$r~szBarrier._releasecs4�j��fdd�|�s"���t��jdkr0t�dS)Ncs
�jdkSr+�ryr#r0r#r$�<lambda>��zBarrier._wait.<locals>.<lambda>r)rjrer�rry�r1rCr#r0r$r�s
z
Barrier._waitcCs(|jdkr$|jdkr$d|_|j��dS)Nrr�)r/ryrjrir0r#r#r$r}�s

z
Barrier._exitc	CsT|j�D|jdkr6|jdkr$d|_q<|jdkr<d|_nd|_|j��W5QRXdS)Nrr>���)rjr/ryrir0r#r#r$�reset�s


z
Barrier.resetc	Cs|j�|��W5QRXdSr)rjr�r0r#r#r$�abort�sz
Barrier.abortcCsd|_|j��dS�Nr�)ryrjrir0r#r#r$r��szBarrier._breakcCs|jSr)rxr0r#r#r$rz�szBarrier.partiescCs|jdkr|jSdSr+)ryr/r0r#r#r$�	n_waiting�s
zBarrier.n_waitingcCs
|jdkSr�r�r0r#r#r$�broken�szBarrier.broken)NN)N)rSr8r9r2rar|r~rr}r�r�r��propertyrzr�r�r#r#r#r$r=s	




c@seZdZdS)rN)rSr8r9r#r#r#r$r�s�	Thread-%dcCs
|t�Sr)�_counter)�templater#r#r$�_newname�sr�c@seZdZdZd9dd�dd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
erXdd�Zdd�Z
dd�Zdd�Zdd�Zd:dd�Zd;d!d"�Zed#d$��Zejd%d$��Zed&d'��Zer�ed(d)��Zd*d+�Zd,d-�Zed.d/��Zejd0d/��Zd1d2�Zd3d4�Zd5d6�Zd7d8�ZdS)<rFNr#��daemoncCs�|dkri}||_t|pt��|_||_||_|dk	r>||_n
t�j|_d|_	t
rXd|_d|_t
�|_d|_d|_tj|_t�|_t�|�dS)NFT)�_target�strr��_name�_args�_kwargs�	_daemonicr
r��_ident�_HAVE_THREAD_NATIVE_ID�
_native_id�_tstate_lockr�_started�_is_stopped�_initialized�_sys�stderr�_stderr�_make_invoke_excepthook�_invoke_excepthook�	_dangling�add)r1�group�targetr5r(r)r�r#r#r$r2�s&
zThread.__init__cCs(|j��|r|��nd|_d|_dSrs)r�rq�_set_tstate_lockr�r�)r1�is_aliver#r#r$rq(s


zThread._reset_internal_lockscCs^d}|j��rd}|��|jr$d}|jr2|d7}|jdk	rJ|d|j7}d|jj|j|fS)N�initialZstartedZstoppedz daemonz %sz<%s(%s, %s)>)	r�rrr�r�r�r�r7rSr�)r1Zstatusr#r#r$r=4s

zThread.__repr__cCs�|jstd��|j��r td��t�|t|<W5QRXzt|jd�Wn,tk
rtt�t|=W5QRX�YnX|j�	�dS)Nzthread.__init__() not calledz threads can only be started oncer#)
r�rGr�rr�_active_limbo_lock�_limbo�_start_new_thread�
_bootstrap�	Exceptionrar0r#r#r$�startBs

zThread.startcCs.z|jr|j|j|j�W5|`|`|`XdSr)r�r�r�r0r#r#r$�run[s	z
Thread.runcCs4z|��Wn"|jr(tdkr(YdS�YnXdSr)�_bootstrap_innerr�r�r0r#r#r$r�ls
zThread._bootstrapcCst�|_dSr)rr�r0r#r#r$�
_set_ident�szThread._set_identcCst�|_dSr)rr�r0r#r#r$�_set_native_id�szThread._set_native_idc	Cs8t�|_|j��|js4t�t�|j�W5QRXdSr)�
_set_sentinelr�rAr��_shutdown_locks_lock�_shutdown_locksr�r0r#r#r$r��s

zThread._set_tstate_lockcCs�z�|��|��tr|��|j��t�|t|j	<t
|=W5QRXtrVt�
t�trdt�t�z|��Wn|�|�YnXW5t� ztt�=WnYnXW5QRXXdSr)r�r4rr�r�r�r�r�rtr�r�r%r�rr rr�r�r0r#r#r$r��s,



zThread._bootstrap_innerc	Cs>|j}|dk	rd|_d|_|js:t�t�|�W5QRXdSrs)r�r�r�r�r��discardrYr#r#r$�_stop�szThread._stopc	Cst�tt�=W5QRXdSr)r�r4rr0r#r#r$�_delete�szThread._deletecCsZ|jstd��|j��s td��|t�kr2td��|dkrD|��n|jt|d�d�dS)N�Thread.__init__() not calledz'cannot join thread before it is startedzcannot join current threadr)rC)r�rGr�rrr
�_wait_for_tstate_lock�maxr�r#r#r$�join�s


zThread.joinTr>cCs0|j}|dkrn|�||�r,|��|��dSr)r�rArHr�)r1�blockrCrZr#r#r$r��szThread._wait_for_tstate_lockcCs|jSr)r�r0r#r#r$r5s	zThread.namecCst|�|_dSr)r�r��r1r5r#r#r$r5scCs|jSr)r�r0r#r#r$�idents
zThread.identcCs|jSr)r�r0r#r#r$�	native_id$s	zThread.native_idcCs&|js|j��sdS|�d�|jSro)r�r�rrr�r0r#r#r$r�/s	
zThread.is_alivecCs ddl}|jdtdd�|��S)Nrz/isAlive() is deprecated, use is_alive() instead�)�
stacklevel)�warnings�warn�DeprecationWarningr�)r1r�r#r#r$�isAlive=s�zThread.isAlivecCs|jSr)r�r0r#r#r$r�Gs
z
Thread.daemoncCs*|jstd��|j��r td��||_dS)Nr�z)cannot set daemon status of active thread)r�rGr�rrr��r1Zdaemonicr#r#r$r�Vs

cCs|jSrr�r0r#r#r$�isDaemon^szThread.isDaemoncCs
||_dSrr�r�r#r#r$�	setDaemonaszThread.setDaemoncCs|jSr�r5r0r#r#r$�getNamedszThread.getNamecCs
||_dSrr�r�r#r#r$�setNamegszThread.setName)NNNr#N)N)Tr>)rSr8r9r�r2rqr=r�r�r�r�r�r�r�r�r�r�r�r�r�r5�setterr�r�r�r�r�r�r�r�r�r#r#r#r$r�sP	��/	
&









)�_excepthook�_ExceptHookArgs)�print_exception)�
namedtuplez'exc_type exc_value exc_traceback threadcCst|�Sr)r�)r(r#r#r$rwscCs�|jtkrdStdk	r(tjdk	r(tj}n$|jdk	rH|jj}|dkrLdSndS|jdk	r`|jj}nt�}td|�d�|dd�t	|j|j
|j|d�|��dS)NzException in thread �:T��file�flush)r�)
�exc_type�
SystemExitr�r��threadr�r5r�print�_print_exception�	exc_value�
exc_tracebackr�)r(r�r5r#r#r$rzs(



��csPt�tj��dkrtd���dkr*td��tj�t�t������fdd�}|S)Nzthreading.excepthook is Nonezsys.excepthook is Nonec
s�z�z,t}|dkr�}t��|f��}||�Wn�tk
r�}zbd|_~�dk	rb�jdk	rb�j}n|j}�d|dd��dk	r��jdk	r��j}n�}|���W5d}~XYnXW5d}XdS)NTz"Exception in threading.excepthook:r�)rrr��__suppress_context__r�r�)r�r(�hook�excr�Zsys_excepthook�Zlocal_printZ	local_sysZold_excepthookZold_sys_excepthookZsys_exc_infor#r$�invoke_excepthook�s*� z2_make_invoke_excepthook.<locals>.invoke_excepthook)rr�rG�exc_infor�)r�r#r�r$r��s r�c@s&eZdZddd�Zdd�Zdd�ZdS)	rNcCsFt�|�||_||_|dk	r"|ng|_|dk	r4|ni|_t�|_dSr)rr2�interval�functionr(r)r�finished)r1r�r�r(r)r#r#r$r2�s
zTimer.__init__cCs|j��dSr)r�rtr0r#r#r$�cancel�szTimer.cancelcCs6|j�|j�|j��s(|j|j|j�|j��dSr)r�rar�rrr�r(r)rtr0r#r#r$r��s
z	Timer.run)NN)rSr8r9r2r�r�r#r#r#r$r�s	
c@seZdZdd�ZdS)�_MainThreadc	CsTtj|ddd�|��|j��|��tr6|��t�|t	|j
<W5QRXdS)NZ
MainThreadF�r5r�)rr2r�r�rtr�r�r�r�r4r�r0r#r#r$r2�s
z_MainThread.__init__N)rSr8r9r2r#r#r#r$r��sr�c@s.eZdZdd�Zdd�Zdd�Zd
dd	�ZdS)�_DummyThreadc	CsPtj|td�dd�|j��|��tr2|��t�|t	|j
<W5QRXdS)NzDummy-%dTr�)rr2r�r�rtr�r�r�r�r4r�r0r#r#r$r2s
z_DummyThread.__init__cCsdSrr#r0r#r#r$r�
sz_DummyThread._stopcCsdSrsr#r0r#r#r$r�sz_DummyThread.is_aliveNcCsdSrr#r�r#r#r$r�sz_DummyThread.join)N)rSr8r9r2r�r�r�r#r#r#r$r�s
r�cCs,ztt�WStk
r&t�YSXdSr)r4rr6r�r#r#r#r$r
sc
Cs,t�tt�tt�W5QR�SQRXdSr)r�r[r4r�r#r#r#r$r(scCstt���tt���Sr)�listr4�valuesr�r#r#r#r$�
_enumerate4sr�c
Cs4t�&tt���tt���W5QR�SQRXdSr)r�r�r4r�r�r#r#r#r$r8s)rc	Csftjr
dStj}|��t��t�tt�}t��W5QRX|sFqb|D]}|�	�|��qJq dSr)
�_main_threadr�r�rHr�r�r�r�rurA)ZtlockZlocksrZr#r#r$�	_shutdownKs	r�cCstSr)r�r#r#r#r$rss)�_local)rc	Cs�t�ai}ztt�}Wntk
r2t�}YnX|at�at�a	t�xtt
��}|�t�|D]>}||kr�|�
d�t�}||_|||<qb|�
d�|��qbt��t��t�|�W5QRXdS)NTF)r,r�r4rr6r�r�r�rtr�r��updater�rqr�r�r�ru)Z
new_activeZcurrentZthreadsr�r�r#r#r$�_after_fork�s0






r��register_at_fork)Zafter_in_child)r�)Y�os�_os�sysr��_thread�timerrbZ_weakrefsetr�	itertoolsrrfrr/�_collectionsrrW�ImportError�collections�__all__�start_new_threadr��
allocate_lockr,r�rrr�r]rV�errorrrr&r
r r%rrrr*r'r	rrrrrGr�__next__r�r�r�r4r�r�r�rtr�rr�rr�r�	tracebackr�r�r�r�rr�r�r
Z
currentThreadrZactiveCountr�rrr�r�rr�rZ_threading_localr��hasattrr�r#r#r#r$�<module>s��




q'P&O
�5
(5__pycache__/webbrowser.cpython-38.opt-2.pyc000064400000034527151153537560014553 0ustar00U

e5d^�@s�ddlZddlZddlZddlZddlZddlZddddddgZGdd�de�Ze�	�Z
iZdada
d;d	d
�dd�Zd<dd�Zd=dd�Zdd�Zdd�Zd	d
�dd�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd �d e�ZGd!d"�d"e�ZeZGd#d$�d$e�ZGd%d&�d&e�ZGd'd(�d(e�Z Gd)d*�d*e�Z!d+d,�Z"d-d.�Z#ej$dd/�d0k�r�Gd1d2�d2e�Z%ej$d3k�r�Gd4d5�d5e�Z&Gd6d7�d7e�Z'd8d9�Z(e)d:k�r�e(�dS)>�N�Error�open�open_new�open_new_tab�get�registerc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�"/usr/lib64/python3.8/webbrowser.pyrsF��	preferredc	CsZt�Ltdkrt�||gt|��<|s4trB|tkrBt�d|�n
t�|�W5QRXdS)Nr)�_lock�	_tryorder�register_standard_browsers�	_browsers�lower�_os_preferred_browser�insert�append)�name�klass�instancerrrrrsc	Cs�tdkr&t�tdkrt�W5QRX|dk	r6|g}nt}|D]�}d|kr�t�|�}|ddkrtt|dd��St|�Sq>zt|��}Wnt	k
r�t
|�}YnX|ddk	r�|dS|ddk	r>|d�Sq>td��dS)N�%s����&�rz!could not locate runnable browser)rrr�shlex�split�BackgroundBrowser�GenericBrowserrr�KeyError�_synthesizer)ZusingZalternatives�browser�commandrrrr%s,
Tc	CsPtdkr&t�tdkrt�W5QRXtD] }t|�}|�|||�r*dSq*dS)NTF)rrrrr)�url�new�	autoraiserr$rrrrGs	cCs
t|d�S�Nr�r�r&rrrrZscCs
t|d�S�N�r*r+rrrrascCs�|��d}t�|�sddgStj�|�}zt|��}Wntk
rVddgYSX|d}|r�|��|jkr�ddl	}|�	|�}||_
tj�|�|_t|d||d�d|gSddgS)Nrr)rr)r�shutil�which�os�path�basenamerrr"�copyrr)r$r�cmdrr%Z
controllerr3rrrr#is"

r#c@s6eZdZdgZddd�Zddd�Zd	d
�Zdd�Zd
S)�BaseBrowserr�cCs||_||_dS�N)rr2��selfrrrr�__init__�szBaseBrowser.__init__rTcCst�dSr7)�NotImplementedError�r9r&r'r(rrrr�szBaseBrowser.opencCs|�|d�Sr)r*�r9r&rrrr�szBaseBrowser.open_newcCs|�|d�Sr,r*r=rrrr�szBaseBrowser.open_new_tabN)r6)rT)rr	r
�argsr:rrrrrrrr5�s


r5c@seZdZdd�Zddd�ZdS)	r!cCsFt|t�r||_dg|_n|d|_|dd�|_tj�|j�|_dS)Nrrr)�
isinstance�strrr>r0r1r2r8rrrr:�s


zGenericBrowser.__init__rTcs|t�d��|jg�fdd�|jD�}z8tjdd�dkrHt�|�}ntj|dd�}|��WStk
rvYdSXdS)	N�webbrowser.opencsg|]}|�d���qS�r��replace��.0�argr+rr�
<listcomp>�s�z'GenericBrowser.open.<locals>.<listcomp>��winT)�	close_fdsF)	�sys�auditrr>�platform�
subprocess�Popen�wait�OSError�r9r&r'r(�cmdline�prr+rr�s�zGenericBrowser.openN)rT�rr	r
r:rrrrrr!�s
r!c@seZdZddd�ZdS)r rTcs�|jg�fdd�|jD�}t�d��z<tjdd�dkrHt�|�}ntj|ddd�}|��dkWStk
rzYdSXdS)	Ncsg|]}|�d���qSrBrCrEr+rrrH�s�z*BackgroundBrowser.open.<locals>.<listcomp>rArIrJT)rK�start_new_sessionF)	rr>rLrMrNrOrP�pollrRrSrr+rr�s��zBackgroundBrowser.openN)rT�rr	r
rrrrrr �sr c@s@eZdZdZdZdZddgZdZdZdZ	ddd�Z
dd	d
�ZdS)
�UnixBrowserNFT�%actionrcCs�g}|r*|jr*t|�}|j|}|r*|g}|jg||}|sD|jrLtj}nd}tj|d||jrd|pfd|dd�}	|r�z|	�d�}
|
WStj	k
r�YdSXn&|jr�|	�
�dkr�dSdSn
|	��SdS)NT�rK�stdin�stdout�stderrrW�F)�
raise_opts�intr�
backgroundrO�DEVNULLrP�redirect_stdoutrQZTimeoutExpiredrX)r9r>Zremoter(r&Z	raise_opt�optrTZinoutrU�rcrrr�_invoke�s4



�

zUnixBrowser._invokercs�t�d��|dkr|j�nB|dkr,|j�n2|dkrN|jdkrF|j�q^|j�ntdd|����fdd�|jD�}d	d�|D�}|�|d
|��}|s��fdd�|jD�}|�|dd�Sd
SdS)
NrArrr-zBad 'new' parameter to open(); zexpected 0, 1, or 2, got %scs g|]}|�d���d���qS)rr[rCrE��actionr&rrrHs�z$UnixBrowser.open.<locals>.<listcomp>cSsg|]}|r|�qSrrrErrrrHsTcsg|]}|�d���qSrBrCrEr+rrrHsF)	rLrM�
remote_action�remote_action_newwin�remote_action_newtabr�remote_argsrhr>)r9r&r'r(r>Zsuccessrrirrs*
��zUnixBrowser.open)N)rT)rr	r
rarcrernrkrlrmrhrrrrrrZ�s
#rZc@s$eZdZddgZdZdZdZdZdS)�Mozillar[rr6z-new-windowz-new-tabTN�rr	r
rnrkrlrmrcrrrrros
roc@s,eZdZddgZddgZdZdZdZdZd	S)
�Netscape�-noraisez-raise�-remote�openURL(%s%action)r6�,new-window�,new-tabTN)	rr	r
rarnrkrlrmrcrrrrrq&srqc@s(eZdZddgZddgZdZdZdZdS)	�Galeonrrr6r[r�-nz-wTN)rr	r
rarnrkrlrcrrrrrw1s
rwc@s$eZdZddgZdZdZdZdZdS)�Chromer[rr6�--new-windowTNrprrrrry;s
ryc@s$eZdZddgZdZdZdZdZdS)�Operar[rr6rzTNrprrrrr{Gs
r{c@s(eZdZddgZdZdZdZdZdZdS)�Elinksrsrtr6rurvFN)	rr	r
rnrkrlrmrcrerrrrr|Qsr|c@seZdZddd�ZdS)�	KonquerorrTcCs�t�d|�|dkrd}nd}tj}ztjd||gd|||d�}Wntk
rVYnX|��dSz tjdd	|gd|||dd
�}Wntk
r�YnX|��dkr�dSz tjdd|gd|||dd
�}Wntk
r�Yd
SX|��dkSdS)NrAr-ZnewTabZopenURL�	kfmclientT)rKr]r^r_�	konquerorz--silentr\�kfmz-dF)rLrMrOrdrPrRrQrX)r9r&r'r(rj�devnullrUrrrrfsN�
�
�
zKonqueror.openN)rTrYrrrrr}_sr}c@s&eZdZdd�Zdd�Zd
dd�Zd	S)�GrailcCs�ddl}ddl}ddl}ddl}tj�|��d�}|�t�	��d}tj�|�
|�|�
|�d�}|�|�}|stdS|�|j|j�}	|D]T}
z|	�
|
�Wn8tk
r�zt�|
�Wntk
r�YnXYq�X|	Sq�dS)Nrz.grail-unixz-*)�glob�pwd�socket�tempfiler0r1�joinZ
gettempdir�getpwuid�getuid�escapeZAF_UNIXZSOCK_STREAMZconnectrR�unlink)r9r�r�r�r�Ztempdir�user�filenameZmaybes�s�fnrrr�_find_grail_rc�s,�
zGrail._find_grail_rccCs&|��}|sdS|�|�|��dS)Nrr)r��send�close)r9rjr�rrr�_remote�s
z
Grail._remoterTcCs2t�d|�|r |�d|�}n|�d|�}|S)NrAzLOADNEW zLOAD )rLrMr�)r9r&r'r(�okrrrr�s
z
Grail.openN)rT)rr	r
r�r�rrrrrr��sr�cCs�t�d�rtddtd��dtjkr>t�d�r>tddtd��dtjkrbt�d�rbtddtd��dtjkr�t�d�r�tdttd��t�d�r�tddtd��dD]}t�|�r�t|dt|��q�d	D]}t�|�r�t|dt|��q�t�d
��rtd
ttd
��nt�d��r"tdttd��dD]"}t�|��r&t|dt	|���q&t�d
��rftd
dtd
��dD]"}t�|��rjt|dt
|���qjt�d��r�tddtd��t�d��r�tddtd��t�d��r�tdtd�dS)Nzxdg-openZGNOME_DESKTOP_SESSION_IDz	gvfs-openz
gnome-openZKDE_FULL_SESSIONr~z
x-www-browser)�firefoxZ	iceweaselZiceape�	seamonkey)zmozilla-firefoxzmozilla-firebird�firebird�mozilla�netscaper�r)ZgaleonZepiphanyZ	skipstone)z
google-chrome�chromeZchromiumzchromium-browser�operaZmosaicZgrail)
r.r/rr r0�environr}rorqrwryr{r�)r$rrr�register_X_browsers�sD



r�cCs.gatjdkrNtddtd��tddtd��tddtd��tddtd��tjdd�dkr�td	t�tj�tj	�
d
d�d�}dd
dddd|fD]}t�|�r�t|dt
|��q��ntj	�
d�s�tj	�
d��r&z(d��}tj|tjd�}|����}Wn ttjttfk
�rYnX|at�tj	�
d��r�t�d��rPtddtd��t�d��rltddtd��t�d��r�tddtd��t�d��r�tddtd��t�d��r�tddtd��dtj	k�r*tj	d�tj�}|��|D]>}|dk�r�t|dd�}|d dk�r�t|dt|�dd��q�dS)!N�darwin�MacOSX�defaultr�r�ZsafarirIrJzwindows-defaultZPROGRAMFILESzC:\Program FileszInternet Explorer\IEXPLORE.EXEr�r�r�r�r�ZDISPLAYZWAYLAND_DISPLAYz$xdg-settings get default-web-browser)r_ZTERMzwww-browserZlinksZelinksZlynxZw3mZBROWSERr6Tr
r)rrLrNr�MacOSXOSAScript�WindowsDefaultr0r1r�r�rr.r/r rrOZcheck_outputrd�decode�strip�FileNotFoundErrorZCalledProcessError�PermissionError�NotADirectoryErrorrr�r!r|�pathsep�reverser#)Ziexplorer$r4Z
raw_result�resultZuserchoicesrTrrrrs\

��

rrIrJc@seZdZddd�ZdS)r�rTcCs:t�d|�zt�|�Wntk
r0YdSXdSdS)NrAFT)rLrMr0Z	startfilerRr<rrrrXszWindowsDefault.openN)rTrYrrrrr�Wsr�r�c@seZdZdd�Zddd�ZdS)	r�cCs
||_dSr7)rr8rrrr:sszMacOSX.__init__rTc	Cs�t�d|�d|krd|}tt|��}|jdkrDd|�dd�}n<|jdkrTd	}nd
|d}d|�dd�}d
|j||f}t�dd�}|dkr�dS|�|�|�	�}|S)NrA�:zfile:r��open location "%s"�"�%22ZOmniWebr6ztoWindow %drzOpenURL "%s"z�tell application "%s"
                                activate
                                %s %s
                            end tell�	osascript�wF)
rLrMrb�boolrrDr0�popen�writer�)	r9r&r'r(�scriptZtoWindowr4�osapipergrrrrvs&


�
zMacOSX.openN)rTrVrrrrr�is
r�c@seZdZdd�Zddd�ZdS)	r�cCs
||_dSr7)�_namer8rrrr:�szMacOSXOSAScript.__init__rTcCsb|jdkrd|�dd�}nd|j|�dd�f}t�dd�}|dkrJdS|�|�|��}|S)	Nr�r�r�r�z�
                   tell application "%s"
                       activate
                       open location "%s"
                   end
                   r�r�F)r�rDr0r�r�r�)r9r&r'r(r�r�rgrrrr�s
�
zMacOSXOSAScript.openN)rTrVrrrrr��sr�c	
Cs�ddl}dtjd}z|�tjdd�d�\}}WnJ|jk
r~}z*t|tjd�t|tjd�t�d�W5d}~XYnXd}|D]"\}}|dkr�d}q�|dkr�d}q�t|�dkr�t|tjd�t�d�|d}t||�td	�dS)
NrzDUsage: %s [-n | -t] url
    -n: open new window
    -t: open new tabrZntd)�filerxz-tr-�)	�getoptrL�argv�error�printr_�exit�lenr)	r�ZusageZoptsr>�msgZnew_win�o�ar&rrr�main�s,�

r��__main__)N)N)rT)*r0rr.rLrOZ	threading�__all__�	Exceptionr�RLockrrrrrrrrrr#�objectr5r!r rZrorqrwryZChromiumr{r|r}r�r�rrNr�r�r�r�rrrrr�<module>sP
"
"O

	
56AK/
__pycache__/asynchat.cpython-38.opt-1.pyc000064400000015305151153537560014174 0ustar00U

e5d@,�@sDdZddlZddlmZGdd�dej�ZGdd�d�Zdd	�ZdS)
a�A class supporting chat-style (command/response) protocols.

This class adds support for 'chat' style protocols - where one side
sends a 'command', and the other sends a response (examples would be
the common internet protocols - smtp, nntp, ftp, etc..).

The handle_read() method looks at the input stream for the current
'terminator' (usually '\r\n' for single-line responses, '\r\n.\r\n'
for multi-line output), calling self.found_terminator() on its
receipt.

for example:
Say you build an async nntp client using this class.  At the start
of the connection, you'll have self.terminator set to '\r\n', in
order to process the single-line greeting.  Just before issuing a
'LIST' command you'll set it to '\r\n.\r\n'.  The output of the LIST
command will be accumulated (using your own 'collect_incoming_data'
method) up to the terminator, and then control will be returned to
you - by calling your self.found_terminator() method.
�N)�dequec@s�eZdZdZdZdZdZdZd(dd�Zdd	�Z	d
d�Z
dd
�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�ZdS))�
async_chatz�This is an abstract class.  You must derive from this class, and add
    the two methods collect_incoming_data() and found_terminator()irzlatin-1NcCs(d|_g|_t�|_tj�|||�dS�N�)�ac_in_buffer�incomingr�
producer_fifo�asyncore�
dispatcher�__init__)�selfZsock�map�r� /usr/lib64/python3.8/asynchat.pyrCszasync_chat.__init__cCstd��dS�Nzmust be implemented in subclass��NotImplementedError�r�datarrr�collect_incoming_dataQsz async_chat.collect_incoming_datacCs|j�|�dS�N)r�appendrrrr�_collect_incoming_dataTsz!async_chat._collect_incoming_datacCsd�|j�}|jdd�=|Sr)�joinr)r�drrr�	_get_dataWszasync_chat._get_datacCstd��dSrr�rrrr�found_terminator\szasync_chat.found_terminatorcCsBt|t�r|jrt||j�}nt|t�r8|dkr8td��||_dS)zdSet the input delimiter.

        Can be a fixed string of any length, an integer, or None.
        rz-the number of received bytes must be positiveN)�
isinstance�str�use_encoding�bytes�encoding�int�
ValueError�
terminator)rZtermrrr�set_terminator_s
zasync_chat.set_terminatorcCs|jSr)r%rrrr�get_terminatorjszasync_chat.get_terminatorc
Cs�z|�|j�}WnDtk
r&YdStk
rT}z|��WY�dSd}~XYnXt|t�rr|jrrtt|j	�}|j
||_
|j
�r�t|j
�}|��}|s�|�
|j
�d|_
q~t|t��r|}||kr�|�
|j
�d|_
|j||_n2|�
|j
d|��|j
|d�|_
d|_|��q~t|�}|j
�|�}|dk�rv|dk�rX|�
|j
d|��|j
||d�|_
|��q~t|j
|�}|�r�||k�r�|�
|j
d|��|j
|d�|_
�q�q~|�
|j
�d|_
q~dS)Nrr���)Zrecv�ac_in_buffer_size�BlockingIOError�OSError�handle_errorrrr r!r"r�lenr'rr#r%r�find�find_prefix_at_end)rrZwhyZlbr%�nZterminator_len�indexrrr�handle_readrsR

	



zasync_chat.handle_readcCs|��dSr)�
initiate_sendrrrr�handle_write�szasync_chat.handle_writecCs|��dSr)�closerrrr�handle_close�szasync_chat.handle_closecCsxt|tttf�stdt|���|j}t|�|kr`tdt|�|�D]}|j	�
||||��q@n|j	�
|�|��dS)Nz#data argument must be byte-ish (%r)r)rr!�	bytearray�
memoryview�	TypeError�type�ac_out_buffer_sizer-�rangerrr3)rrZsabs�irrr�push�s�zasync_chat.pushcCs|j�|�|��dSr)rrr3)rZproducerrrr�push_with_producer�szasync_chat.push_with_producercCsdS)z4predicate for inclusion in the readable for select()�rrrrr�readable�szasync_chat.readablecCs|jp|jS)z4predicate for inclusion in the writable for select())r�	connectedrrrr�writable�szasync_chat.writablecCs|j�d�dS)zAautomatically close this channel once the outgoing queue is emptyN)rrrrrr�close_when_done�szasync_chat.close_when_donecCs|j�r|j�r|jd}|s:|jd=|dkr:|��dS|j}z|d|�}Wn:tk
r�|��}|rz|j�|�n|jd=YqYnXt|t�r�|j	r�t
||j�}z|�|�}Wnt
k
r�|��YdSX|�r|t|�ks�|t|�k�r
||d�|jd<n|jd=dSdS)Nr)rrBr6r;r9�more�
appendleftrrr r!r"�sendr+r,r-)r�firstZobsrZnum_sentrrrr3�s8

zasync_chat.initiate_sendcCs d|_|jdd�=|j��dSr)rrr�clearrrrr�discard_buffersszasync_chat.discard_buffers)NN)�__name__�
__module__�__qualname__�__doc__r)r;r r"rrrrrr&r'r2r4r6r>r?rArCrDr3rJrrrrr4s,
H(rc@seZdZddd�Zdd�ZdS)�simple_producer�cCs||_||_dSr)r�buffer_size)rrrQrrrrszsimple_producer.__init__cCsJt|j�|jkr6|jd|j�}|j|jd�|_|S|j}d|_|SdSr)r-rrQ)r�resultrrrrEszsimple_producer.moreN)rP)rKrLrMrrErrrrrOs
rOcCs0t|�d}|r,|�|d|��s,|d8}q|S)Nr@)r-�endswith)ZhaystackZneedle�lrrrr//s
r/)rNr	�collectionsrr
rrOr/rrrr�<module>s\ __pycache__/colorsys.cpython-38.opt-1.pyc000064400000006252151153537560014240 0ustar00U

e5d��@s\dZddddddgZdZdZd	Zd
d�Zdd�Zdd�Zd
d�Zdd�Z	dd�Z
dd�ZdS)aJConversion functions between RGB and other color systems.

This modules provides two functions for each color system ABC:

  rgb_to_abc(r, g, b) --> a, b, c
  abc_to_rgb(a, b, c) --> r, g, b

All inputs and outputs are triples of floats in the range [0.0...1.0]
(with the exception of I and Q, which covers a slightly larger range).
Inputs outside the valid range may cause exceptions or invalid outputs.

Supported color systems:
RGB: Red, Green, Blue components
YIQ: Luminance, Chrominance (used by composite video signals)
HLS: Hue, Luminance, Saturation
HSV: Hue, Saturation, Value
�
rgb_to_yiq�
yiq_to_rgb�
rgb_to_hls�
hls_to_rgb�
rgb_to_hsv�
hsv_to_rgbgUUUUUU�?gUUUUUU�?gUUUUUU�?cCsRd|d|d|}d||d||}d||d||}|||fS)Ng333333�?g�z�G��?g)\��(�?g�G�z��?gH�z�G�?g���Q��?g=
ףp=�?�)�r�g�b�y�i�qrr� /usr/lib64/python3.8/colorsys.pyr(scCs�|d|d|}|d|d|}|d|d|}|dkrHd}|dkrTd}|dkr`d}|dkrld}|dkrxd}|dkr�d}|||fS)	Ng2r��L�?g����,��?g:�����?g�nєW�?g6�޷���?gJ"�X�?���?r)rrr
rr	r
rrrr.s cCs�t|||�}t|||�}||d}||kr6d|dfS|dkrP||||}n||d||}||||}||||}||||}	||kr�|	|}
n"||kr�d||	}
nd||}
|
dd}
|
||fS)N�@r��?�@�@r��max�min)rr	r
�maxc�minc�l�s�rc�gc�bc�hrrrrKs$

cCsn|dkr|||fS|dkr(|d|}n||||}d||}t|||t�t|||�t|||t�fS)Nrrrr)�_v�	ONE_THIRD)rrr�m2�m1rrrrbs
cCsT|d}|tkr$||||dS|dkr0|S|tkrP|||t|dS|S)Nrrr)�	ONE_SIXTH�	TWO_THIRD)r#r"Zhuerrrr lsr cCs�t|||�}t|||�}|}||kr.dd|fS|||}||||}||||}||||}	||kr||	|}
n"||kr�d||	}
nd||}
|
dd}
|
||fS)Nrrrrrr)rr	r
rr�vrrrrrrrrr|s 

cCs�|dkr|||fSt|d�}|d|}|d|}|d||}|d|d|}|d}|dkrt|||fS|dkr�|||fS|dkr�|||fS|dkr�|||fS|d	kr�|||fS|d
kr�|||fSdS)Nrrr�������)�int)rrr&r�f�pr
�trrrr�s(





N)�__doc__�__all__r!r$r%rrrrr rrrrrr�<module>s�	
__pycache__/_collections_abc.cpython-38.pyc000064400000070107151153537560014706 0ustar00U

e5d�e�@stdZddlmZmZddlZdddddd	d
ddd
dddddddddddddddgZdZeed��Z	eee
���Zeei����Z
eei����Zeei����Zeeg��Zeeeg���Zeeed���Zeeedd >���Zeee���Zeed!��Zeed"��Zeee���Zei���Zei���Zei���Z eej!�Z"ed#d$���Z#d%d&�Z$e$�Z$ee$�Z%e$�&�[$d'd(�Z'e'�Z'ee'�Z(['d)d*�Z)Gd+d	�d	ed,�Z*Gd-d�ded,�Z+Gd.d�de+�Z,e,�-e%�Gd/d�ded,�Z.Gd0d�de.�Z/Gd1d�de/�Z0e0�-e(�Gd2d
�d
ed,�Z1Gd3d�de1�Z2e2�-e	�e2�-e�e2�-e
�e2�-e�e2�-e�e2�-e�e2�-e�e2�-e�e2�-e�e2�-e�e2�-e�e2�-e�e2�-e�Gd4d
�d
e1�Z3Gd5d�de2�Z4e4�-e#�Gd6d�ded,�Z5Gd7d�ded,�Z6Gd8d�de5e1e6�Z7Gd9d�ded,�Z8Gd:d�de7�Z9e9�-e:�Gd;d�de9�Z;e;�-e�Gd<d�de7�Z<e<�-e"�Gd=d�de5�Z=Gd>d�de=e9�Z>e>�-e�Gd?d�de=e9�Z?e?�-e �Gd@d�de=e7�Z@e@�-e�GdAd�de<�ZAeA�-eB�GdBd�de3e7�ZCeC�-eD�eC�-eE�eC�-e�eC�-eF�GdCd�deC�ZGeG�-eH�eG�-e
�GdDd�deC�ZIeI�-eJ�eI�-e
�dS)EzjAbstract Base Classes (ABCs) for collections, according to PEP 3119.

Unit tests are in test_collections.
�)�ABCMeta�abstractmethodN�	Awaitable�	Coroutine�
AsyncIterable�
AsyncIterator�AsyncGenerator�Hashable�Iterable�Iterator�	Generator�
Reversible�Sized�	Container�Callable�
Collection�Set�
MutableSet�Mapping�MutableMapping�MappingView�KeysView�	ItemsView�
ValuesView�Sequence�MutableSequence�
ByteStringzcollections.abc��i���ccsdVS�Nr r r r �(/usr/lib64/python3.8/_collections_abc.py�<lambda>8rr#c�sdSr!r r r r r"�_coro:rr$cCs
dVdSr!r r r r r"�_ag@rr%cGsN|j}|D]>}|D],}||jkr|j|dkr:tSq
qtSq
dS)NT)�__mro__�__dict__�NotImplemented)�C�methods�mro�method�Br r r"�_check_methodsHs

r.c@s(eZdZdZedd��Zedd��ZdS)r	r cCsdS�Nrr ��selfr r r"�__hash__XszHashable.__hash__cCs|tkrt|d�StS)Nr2)r	r.r(��clsr)r r r"�__subclasshook__\s
zHashable.__subclasshook__N)�__name__�
__module__�__qualname__�	__slots__rr2�classmethodr5r r r r"r	Ts

)�	metaclassc@s(eZdZdZedd��Zedd��ZdS)rr ccs
dVdSr!r r0r r r"�	__await__gszAwaitable.__await__cCs|tkrt|d�StS)Nr<)rr.r(r3r r r"r5ks
zAwaitable.__subclasshook__N)r6r7r8r9rr<r:r5r r r r"rcs

c@s>eZdZdZedd��Zeddd��Zdd�Zed	d
��Z	dS)rr cCst�dS)zcSend a value into the coroutine.
        Return next yielded value or raise StopIteration.
        N��
StopIteration�r1�valuer r r"�sendvszCoroutine.sendNcCs4|dkr|dkr|�|�}|dk	r,|�|�}|�dS)zgRaise an exception in the coroutine.
        Return next yielded value or raise StopIteration.
        N��with_traceback�r1�typ�val�tbr r r"�throw}s
zCoroutine.throwc	Cs4z|�t�Wnttfk
r&Yn
Xtd��dS)�.Raise GeneratorExit inside coroutine.
        zcoroutine ignored GeneratorExitN�rH�
GeneratorExitr>�RuntimeErrorr0r r r"�close�s
zCoroutine.closecCs|tkrt|dddd�StS)Nr<rArHrM)rr.r(r3r r r"r5�szCoroutine.__subclasshook__)NN)
r6r7r8r9rrArHrMr:r5r r r r"rrs

c@s(eZdZdZedd��Zedd��ZdS)rr cCst�Sr!)rr0r r r"�	__aiter__�szAsyncIterable.__aiter__cCs|tkrt|d�StS)NrN)rr.r(r3r r r"r5�s
zAsyncIterable.__subclasshook__N)r6r7r8r9rrNr:r5r r r r"r�s

c@s0eZdZdZedd��Zdd�Zedd��ZdS)	rr c�st�dS)z@Return the next item or raise StopAsyncIteration when exhausted.N��StopAsyncIterationr0r r r"�	__anext__�szAsyncIterator.__anext__cCs|Sr!r r0r r r"rN�szAsyncIterator.__aiter__cCs|tkrt|dd�StS)NrQrN)rr.r(r3r r r"r5�szAsyncIterator.__subclasshook__N)	r6r7r8r9rrQrNr:r5r r r r"r�s
c@sFeZdZdZdd�Zedd��Zed
dd��Zd	d
�Ze	dd��Z
dS)rr c�s|�d�IdHS)zpReturn the next item from the asynchronous generator.
        When exhausted, raise StopAsyncIteration.
        N)�asendr0r r r"rQ�szAsyncGenerator.__anext__c�st�dS)zuSend a value into the asynchronous generator.
        Return next yielded value or raise StopAsyncIteration.
        NrOr?r r r"rR�szAsyncGenerator.asendNc�s4|dkr|dkr|�|�}|dk	r,|�|�}|�dS)zyRaise an exception in the asynchronous generator.
        Return next yielded value or raise StopAsyncIteration.
        NrBrDr r r"�athrow�s
zAsyncGenerator.athrowc	�s:z|�t�IdHWnttfk
r,Yn
Xtd��dS)rINz,asynchronous generator ignored GeneratorExit)rSrKrPrLr0r r r"�aclose�s
zAsyncGenerator.aclosecCs|tkrt|ddddd�StS)NrNrQrRrSrT)rr.r(r3r r r"r5�s�zAsyncGenerator.__subclasshook__)NN)r6r7r8r9rQrrRrSrTr:r5r r r r"r�s

c@s(eZdZdZedd��Zedd��ZdS)r
r ccsdSr!r r0r r r"�__iter__�szIterable.__iter__cCs|tkrt|d�StS)NrU)r
r.r(r3r r r"r5�s
zIterable.__subclasshook__N)r6r7r8r9rrUr:r5r r r r"r
�s

c@s0eZdZdZedd��Zdd�Zedd��ZdS)	rr cCst�dS)zKReturn the next item from the iterator. When exhausted, raise StopIterationNr=r0r r r"�__next__szIterator.__next__cCs|Sr!r r0r r r"rUszIterator.__iter__cCs|tkrt|dd�StS)NrUrV)rr.r(r3r r r"r5szIterator.__subclasshook__N)	r6r7r8r9rrVrUr:r5r r r r"rs
c@s(eZdZdZedd��Zedd��ZdS)r
r ccsdSr!r r0r r r"�__reversed__)szReversible.__reversed__cCs|tkrt|dd�StS)NrWrU)r
r.r(r3r r r"r5.szReversible.__subclasshook__N)r6r7r8r9rrWr:r5r r r r"r
%s

c@sFeZdZdZdd�Zedd��Zed
dd��Zd	d
�Ze	dd��Z
dS)rr cCs
|�d�S)z^Return the next item from the generator.
        When exhausted, raise StopIteration.
        N)rAr0r r r"rV9szGenerator.__next__cCst�dS)zcSend a value into the generator.
        Return next yielded value or raise StopIteration.
        Nr=r?r r r"rA?szGenerator.sendNcCs4|dkr|dkr|�|�}|dk	r,|�|�}|�dS)zgRaise an exception in the generator.
        Return next yielded value or raise StopIteration.
        NrBrDr r r"rHFs
zGenerator.throwc	Cs4z|�t�Wnttfk
r&Yn
Xtd��dS)z.Raise GeneratorExit inside generator.
        zgenerator ignored GeneratorExitNrJr0r r r"rMSs
zGenerator.closecCs|tkrt|ddddd�StS)NrUrVrArHrM)rr.r(r3r r r"r5]s�zGenerator.__subclasshook__)NN)r6r7r8r9rVrrArHrMr:r5r r r r"r5s

c@s(eZdZdZedd��Zedd��ZdS)rr cCsdSr/r r0r r r"�__len__ksz
Sized.__len__cCs|tkrt|d�StS)NrX)rr.r(r3r r r"r5os
zSized.__subclasshook__N)r6r7r8r9rrXr:r5r r r r"rgs

c@s(eZdZdZedd��Zedd��ZdS)rr cCsdS�NFr )r1�xr r r"�__contains__zszContainer.__contains__cCs|tkrt|d�StS)Nr[)rr.r(r3r r r"r5~s
zContainer.__subclasshook__N)r6r7r8r9rr[r:r5r r r r"rvs

c@seZdZdZedd��ZdS)rr cCs|tkrt|ddd�StS)NrXrUr[)rr.r(r3r r r"r5�szCollection.__subclasshook__N)r6r7r8r9r:r5r r r r"r�sc@s(eZdZdZedd��Zedd��ZdS)rr cOsdSrYr )r1�args�kwdsr r r"�__call__�szCallable.__call__cCs|tkrt|d�StS)Nr^)rr.r(r3r r r"r5�s
zCallable.__subclasshook__N)r6r7r8r9rr^r:r5r r r r"r�s

c@s�eZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	e
d
d��Zdd�ZeZ
dd�Zdd�ZeZdd�Zdd�Zdd�ZeZdd�ZdS)raZA set is a finite, iterable container.

    This class provides concrete generic implementations of all
    methods except for __contains__, __iter__ and __len__.

    To override the comparisons (presumably for speed, as the
    semantics are fixed), redefine __le__ and __ge__,
    then the other operations will automatically follow suit.
    r cCs>t|t�stSt|�t|�kr"dS|D]}||kr&dSq&dS�NFT��
isinstancerr(�len�r1�other�elemr r r"�__le__�s
z
Set.__le__cCs(t|t�stSt|�t|�ko&|�|�Sr!�rarr(rbrf�r1rdr r r"�__lt__�s
z
Set.__lt__cCs(t|t�stSt|�t|�ko&|�|�Sr!)rarr(rb�__ge__rhr r r"�__gt__�s
z
Set.__gt__cCs>t|t�stSt|�t|�kr"dS|D]}||kr&dSq&dSr_r`rcr r r"rj�s
z
Set.__ge__cCs(t|t�stSt|�t|�ko&|�|�Sr!rgrhr r r"�__eq__�s
z
Set.__eq__cCs||�S)z�Construct an instance of the class from any iterable input.

        Must override this method if the class constructor signature
        does not accept an iterable for an input.
        r )r4�itr r r"�_from_iterable�szSet._from_iterablecs&t|t�stS���fdd�|D��S)Nc3s|]}|�kr|VqdSr!r ��.0r@r0r r"�	<genexpr>�szSet.__and__.<locals>.<genexpr>�rar
r(rnrhr r0r"�__and__�s
zSet.__and__cCs|D]}||krdSqdS)z1Return True if two sets have a null intersection.FTr )r1rdr@r r r"�
isdisjoint�szSet.isdisjointcCs*t|t�stSdd�||fD�}|�|�S)Ncss|]}|D]
}|Vq
qdSr!r )rp�s�er r r"rq�szSet.__or__.<locals>.<genexpr>rr)r1rd�chainr r r"�__or__�s
z
Set.__or__cs:t�t�s"t�t�stS|����|��fdd�|D��S)Nc3s|]}|�kr|VqdSr!r ro�rdr r"rq�s�zSet.__sub__.<locals>.<genexpr>�rarr
r(rnrhr ryr"�__sub__�s



zSet.__sub__cs:t|t�s"t|t�stS��|�}���fdd�|D��S)Nc3s|]}|�kr|VqdSr!r ror0r r"rq�s�zSet.__rsub__.<locals>.<genexpr>rzrhr r0r"�__rsub__�s



zSet.__rsub__cCs2t|t�s"t|t�stS|�|�}||||BSr!rzrhr r r"�__xor__s



zSet.__xor__cCs�tj}d|d}t|�}d|d}||M}|D],}t|�}|||d>AdAdN}||M}q2|dd}||M}||kr�||d8}|d	kr�d
}|S)a+Compute the hash value of a set.

        Note that we don't define __hash__: not all sets are hashable.
        But if you define a hashable set type, its __hash__ should
        call this function.

        This must be compatible __eq__.

        All sets ought to compare equal if they contain the same
        elements, regardless of how they are implemented, and
        regardless of the order of the elements; so there's not much
        freedom for __eq__ or __hash__.  We match the algorithm used
        by the built-in frozenset type.
        �riM��r�i�M[l�4~2i�
i��6���i��8#)�sys�maxsizerb�hash)r1�MAX�MASK�n�hrZ�hxr r r"�_hash	s 
z	Set._hashN)r6r7r8�__doc__r9rfrirkrjrlr:rnrs�__rand__rtrx�__ror__r{r|r}�__rxor__r�r r r r"r�s&



c@sdeZdZdZdZedd��Zedd��Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�ZdS)ra�A mutable set is a finite, iterable container.

    This class provides concrete generic implementations of all
    methods except for __contains__, __iter__, __len__,
    add(), and discard().

    To override the comparisons (presumably for speed, as the
    semantics are fixed), all you have to do is redefine __le__ and
    then the other operations will automatically follow suit.
    r cCst�dS)zAdd an element.N��NotImplementedErrorr?r r r"�add:szMutableSet.addcCst�dS)z8Remove an element.  Do not raise an exception if absent.Nr�r?r r r"�discard?szMutableSet.discardcCs||krt|��|�|�dS)z5Remove an element. If not a member, raise a KeyError.N)�KeyErrorr�r?r r r"�removeDszMutableSet.removecCs>t|�}zt|�}Wntk
r.td�YnX|�|�|S)z2Return the popped value.  Raise KeyError if empty.N)�iter�nextr>r�r��r1rmr@r r r"�popJs
zMutableSet.popcCs(z|��qWntk
r"YnXdS)z6This is slow (creates N new iterators!) but effective.N)r�r�r0r r r"�clearTszMutableSet.clearcCs|D]}|�|�q|Sr!)r�r�r r r"�__ior__\szMutableSet.__ior__cCs||D]}|�|�q|Sr!)r�r�r r r"�__iand__aszMutableSet.__iand__cCsR||kr|��n<t|t�s&|�|�}|D]"}||krB|�|�q*|�|�q*|Sr!)r�rarrnr�r�r�r r r"�__ixor__fs


zMutableSet.__ixor__cCs*||kr|��n|D]}|�|�q|Sr!)r�r�r�r r r"�__isub__ss

zMutableSet.__isub__N)r6r7r8r�r9rr�r�r�r�r�r�r�r�r�r r r r"r,s



c@sReZdZdZedd��Zddd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�ZdZdS)rr cCst�dSr!�r��r1�keyr r r"�__getitem__�szMapping.__getitem__NcCs(z
||WStk
r"|YSXdS)z<D.get(k[,d]) -> D[k] if k in D, else d.  d defaults to None.Nr��r1r��defaultr r r"�get�s
zMapping.getcCs,z||Wntk
r"YdSXdSdSr_r�r�r r r"r[�s
zMapping.__contains__cCst|�S)z:D.keys() -> a set-like object providing a view on D's keys)rr0r r r"�keys�szMapping.keyscCst|�S)z<D.items() -> a set-like object providing a view on D's items)rr0r r r"�items�sz
Mapping.itemscCst|�S)z6D.values() -> an object providing a view on D's values)rr0r r r"�values�szMapping.valuescCs&t|t�stSt|���t|���kSr!)rarr(�dictr�rhr r r"rl�s
zMapping.__eq__)N)
r6r7r8r9rr�r�r[r�r�r�rlrWr r r r"r�s


c@s(eZdZdZdd�Zdd�Zdd�ZdS)	r��_mappingcCs
||_dSr!r�)r1�mappingr r r"�__init__�szMappingView.__init__cCs
t|j�Sr!)rbr�r0r r r"rX�szMappingView.__len__cCs
d�|�S)Nz&{0.__class__.__name__}({0._mapping!r}))�formatr0r r r"�__repr__�szMappingView.__repr__N)r6r7r8r9r�rXr�r r r r"r�sc@s,eZdZdZedd��Zdd�Zdd�ZdS)	rr cCst|�Sr!��set�r1rmr r r"rn�szKeysView._from_iterablecCs
||jkSr!r�r�r r r"r[�szKeysView.__contains__ccs|jEdHdSr!r�r0r r r"rU�szKeysView.__iter__N�r6r7r8r9r:rnr[rUr r r r"r�s

c@s,eZdZdZedd��Zdd�Zdd�ZdS)	rr cCst|�Sr!r�r�r r r"rn�szItemsView._from_iterablecCsB|\}}z|j|}Wntk
r,YdSX||kp<||kSdSrY)r�r�)r1�itemr�r@�vr r r"r[�szItemsView.__contains__ccs |jD]}||j|fVqdSr!r�r�r r r"rU�s
zItemsView.__iter__Nr�r r r r"r�s

	c@s eZdZdZdd�Zdd�ZdS)rr cCs0|jD]$}|j|}||ks$||krdSqdS�NTFr�)r1r@r�r�r r r"r[�s


zValuesView.__contains__ccs|jD]}|j|VqdSr!r�r�r r r"rU�s
zValuesView.__iter__N)r6r7r8r9r[rUr r r r"r�sc@s^eZdZdZedd��Zedd��Ze�Zefdd�Z	dd	�Z
d
d�Zddd
�Zddd�Z
dS)rr cCst�dSr!r��r1r�r@r r r"�__setitem__szMutableMapping.__setitem__cCst�dSr!r�r�r r r"�__delitem__szMutableMapping.__delitem__cCs@z||}Wn$tk
r0||jkr(�|YSX||=|SdS)z�D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
          If key is not found, d is returned if given, otherwise KeyError is raised.
        N)r��_MutableMapping__marker)r1r�r�r@r r r"r�s

zMutableMapping.popcCsBztt|��}Wntk
r*td�YnX||}||=||fS)z�D.popitem() -> (k, v), remove and return some (key, value) pair
           as a 2-tuple; but raise KeyError if D is empty.
        N)r�r�r>r�r�r r r"�popitem$szMutableMapping.popitemcCs(z|��qWntk
r"YnXdS)z,D.clear() -> None.  Remove all items from D.N)r�r�r0r r r"r�0szMutableMapping.clearcKs|t|t�r"|D]}||||<qn<t|d�rH|��D]}||||<q4n|D]\}}|||<qL|��D]\}}|||<qfdS)aK D.update([E, ]**F) -> None.  Update D from mapping/iterable E and F.
            If E present and has a .keys() method, does:     for k in E: D[k] = E[k]
            If E present and lacks .keys() method, does:     for (k, v) in E: D[k] = v
            In either case, this is followed by: for k, v in F.items(): D[k] = v
        r�N)rar�hasattrr�r�)r1rdr]r�r@r r r"�update8s


zMutableMapping.updateNcCs,z
||WStk
r&|||<YnX|S)z@D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in Dr�r�r r r"�
setdefaultJs

zMutableMapping.setdefault)r )N)r6r7r8r9rr�r��objectr�r�r�r�r�r�r r r r"r�s


c@sJeZdZdZdZedd��Zdd�Zdd�Zd	d
�Z	dd
d�Z
dd�ZdS)rz�All the operations on a read-only sequence.

    Concrete subclasses must override __new__ or __init__,
    __getitem__, and __len__.
    r cCst�dSr!��
IndexError�r1�indexr r r"r�bszSequence.__getitem__ccs<d}z||}|V|d7}qWntk
r6YdSXdS)Nrrr�)r1�ir�r r r"rUfszSequence.__iter__cCs$|D]}||ks||krdSqdSr�r )r1r@r�r r r"r[pszSequence.__contains__ccs$ttt|���D]}||VqdSr!)�reversed�rangerb)r1r�r r r"rWvszSequence.__reversed__rNcCs�|dk	r"|dkr"tt|�|d�}|dk	r>|dkr>|t|�7}|}|dksR||kr�z"||}||ksl||krr|WSWntk
r�Yq�YnX|d7}qBt�dS)z�S.index(value, [start, [stop]]) -> integer -- return first index of value.
           Raises ValueError if the value is not present.

           Supporting start and stop arguments is optional, but
           recommended.
        Nrr)�maxrbr��
ValueError)r1r@�start�stopr�r�r r r"r�zs


zSequence.indexcst�fdd�|D��S)zBS.count(value) -> integer -- return number of occurrences of valuec3s"|]}|�ks|�krdVqdS)rNr )rpr��r@r r"rq�sz!Sequence.count.<locals>.<genexpr>)�sumr?r r�r"�count�szSequence.count)rN)r6r7r8r�r9rr�rUr[rWr�r�r r r r"rXs


c@seZdZdZdZdS)rzMThis unifies bytes and bytearray.

    XXX Should add all their methods.
    r N)r6r7r8r�r9r r r r"r�sc@sneZdZdZedd��Zedd��Zedd��Zdd	�Zd
d�Z	dd
�Z
dd�Zddd�Zdd�Z
dd�ZdS)rr cCst�dSr!r��r1r�r@r r r"r��szMutableSequence.__setitem__cCst�dSr!r�r�r r r"r��szMutableSequence.__delitem__cCst�dS)z3S.insert(index, value) -- insert value before indexNr�r�r r r"�insert�szMutableSequence.insertcCs|�t|�|�dS)z:S.append(value) -- append value to the end of the sequenceN)r�rbr?r r r"�append�szMutableSequence.appendcCs(z|��qWntk
r"YnXdS)z,S.clear() -> None -- remove all items from SN)r�r�r0r r r"r��szMutableSequence.clearcCsHt|�}t|d�D].}|||d||||<|||d<qdS)z!S.reverse() -- reverse *IN PLACE*r~rN)rbr�)r1r�r�r r r"�reverse�szMutableSequence.reversecCs(||krt|�}|D]}|�|�qdS)zMS.extend(iterable) -- extend sequence by appending elements from the iterableN)�listr�)r1r�r�r r r"�extend�szMutableSequence.extendr�cCs||}||=|S)z�S.pop([index]) -> item -- remove and return item at index (default last).
           Raise IndexError if list is empty or index is out of range.
        r )r1r�r�r r r"r��szMutableSequence.popcCs||�|�=dS)zvS.remove(value) -- remove first occurrence of value.
           Raise ValueError if the value is not present.
        N)r�r?r r r"r��szMutableSequence.removecCs|�|�|Sr!)r�)r1r�r r r"�__iadd__�s
zMutableSequence.__iadd__N)r�)r6r7r8r9rr�r�r�r�r�r�r�r�r�r�r r r r"r�s	



)Kr��abcrrr��__all__r6�typer��bytes_iterator�	bytearray�bytearray_iteratorr��dict_keyiteratorr��dict_valueiteratorr��dict_itemiterator�
list_iteratorr��list_reverseiteratorr��range_iterator�longrange_iteratorr��set_iterator�str_iterator�tuple_iterator�zip�zip_iterator�	dict_keys�dict_values�
dict_itemsr'�mappingproxy�	generatorr$�	coroutinerMr%�async_generatorr.r	rr�registerrrrr
rr
rrrrrr�	frozensetrrrrrrrr�r�tuple�str�
memoryviewr�bytesrr�r r r r"�<module>s��	
)
0













/



O
2



S
=



	

C
__pycache__/tokenize.cpython-38.opt-2.pyc000064400000032052151153537560014211 0ustar00U

e5d�d�@sDdZdZddlmZddlmZmZddlZddl	m
Z
ddlZddl
Z
ddlZddlTddlmZe
�d	e
j�Ze
�d
e
j�ZddlZejddd
ddgZ[Gdd�de�dd��Zdd�Zdd�Zdd�ZdZdZeede�ee�ZdZdZdZ dZ!dZ"eee e!e"�Z#d Z$ed!d"�ee$�Z%d#e$Z&ee%e&�Z'ed$e'd%�Z(ee(e'e#�Z)d&d'�Z*d(d)�Z+ee*��Z,d*Z-d+Z.d,Z/d-Z0ee,d.e,d/�Z1ee,d0e,d1�Z2ee3e
j4e5ed2d3���Z6ed4e6�Z7ee)e7e2e�Z8ee8Z9ee,d5ed6d�e,d7ed8d��Z:ed9ee1�Z;eee;e)e7e:e�Z<iZ=e*�D]6Z>e-e=e>d6<e.e=e>d8<e/e=e>d.<e0e=e>d/<�q(e?�Z@e?�ZAe*�D]JZBeBd8eBd6fD]ZCe@�DeC��q�eBd/eBd.fD]ZCeA�DeC��q��qrd:ZEGd;d<�d<eF�ZGGd=d>�d>eF�ZHGd?d@�d@�ZIdAd�ZJdBdC�ZKdDd
�ZLdEdF�ZdGd�ZMdHdI�ZNdJd�ZOdKdL�ZPeQdMk�r@eP�dS)NzKa-Ping Yee <ping@lfw.org>zpGvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, Skip Montanaro, Raymond Hettinger, Trent Nelson, Michael Foord�)�open)�lookup�BOM_UTF8N)�
TextIOWrapper)�*)�EXACT_TOKEN_TYPESz&^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)s^[ \t\f]*(?:[#\r\n]|$)�tokenize�generate_tokens�detect_encoding�
untokenize�	TokenInfoc@s eZdZdd�Zedd��ZdS)rcCs$d|jt|jf}d|j|d�S)Nz%d (%s)z8TokenInfo(type=%s, string=%r, start=%r, end=%r, line=%r))�type)r
�tok_name�_replace)�self�annotated_type�r� /usr/lib64/python3.8/tokenize.py�__repr__.s
�zTokenInfo.__repr__cCs(|jtkr|jtkrt|jS|jSdS�N)r
�OP�stringr�rrrr�
exact_type3s
zTokenInfo.exact_typeN)�__name__�
__module__�__qualname__r�propertyrrrrrr-sztype string start end linecGsdd�|�dS)N�(�|�))�join��choicesrrr�group:�r$cGst|�dS)Nr�r$r"rrr�any;r%r'cGst|�dS)N�?r&r"rrr�maybe<r%r)z[ \f\t]*z	#[^\r\n]*z\\\r?\nz\w+z0[xX](?:_?[0-9a-fA-F])+z0[bB](?:_?[01])+z0[oO](?:_?[0-7])+z(?:0(?:_?0)*|[1-9](?:_?[0-9])*)z[eE][-+]?[0-9](?:_?[0-9])*z)[0-9](?:_?[0-9])*\.(?:[0-9](?:_?[0-9])*)?z\.[0-9](?:_?[0-9])*z[0-9](?:_?[0-9])*z[0-9](?:_?[0-9])*[jJ]z[jJ]cCs^ddddddg}dh}|D]>}t�|�D].}tjdd	�|D��D]}|�d�|��q@q(q|S)
N�b�r�u�f�br�fr�cSsg|]}||��f�qSr)�upper)�.0�crrr�
<listcomp>^sz(_all_string_prefixes.<locals>.<listcomp>)�
_itertools�permutations�product�addr!)�_valid_string_prefixes�result�prefix�tr,rrr�_all_string_prefixesSsr=cCst�|tj�Sr)�re�compile�UNICODE)�exprrrr�_compilebsrBz[^'\\]*(?:\\.[^'\\]*)*'z[^"\\]*(?:\\.[^"\\]*)*"z%[^'\\]*(?:(?:\\.|'(?!''))[^'\\]*)*'''z%[^"\\]*(?:(?:\\.|"(?!""))[^"\\]*)*"""z'''z"""z'[^\n'\\]*(?:\\.[^\n'\\]*)*'z"[^\n"\\]*(?:\\.[^\n"\\]*)*"T)�reversez\r?\nz'[^\n'\\]*(?:\\.[^\n'\\]*)*�'z"[^\n"\\]*(?:\\.[^\n"\\]*)*�"z
\\\r?\n|\Z�c@seZdZdS)�
TokenErrorN�rrrrrrrrG�srGc@seZdZdS)�StopTokenizingNrHrrrrrI�srIc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�UntokenizercCsg|_d|_d|_d|_dS)N�r)�tokens�prev_row�prev_col�encodingrrrr�__init__�szUntokenizer.__init__cCs�|\}}||jks&||jkr>||jkr>td�|||j|j���||j}|rb|j�d|�d|_||j}|r�|j�d|�dS)Nz+start ({},{}) precedes previous end ({},{})�\
r� )rMrN�
ValueError�formatrL�append)r�start�row�col�
row_offset�
col_offsetrrr�add_whitespace�s�

zUntokenizer.add_whitespacecCs6t|�}g}d}|D�]}t|�dkr8|�||��q*|\}}}}	}
|tkrV||_q|tkrd�q*|tkrz|�|�qnl|tkr�|�	�|	\|_
|_qnL|tt
fkr�d}n:|r�|r�|d}|dt|�kr�|j�|�t|�|_d}|�|�|j�|�|	\|_
|_|tt
fkr|j
d7_
d|_qd�|j�S)NF�T���rKrr0)�iter�len�compat�ENCODINGrO�	ENDMARKER�INDENTrU�DEDENT�poprMrN�NEWLINE�NLrLr[r!)r�iterable�it�indents�	startliner<�tok_type�tokenrV�end�line�indentrrrr�sF



zUntokenizer.untokenizec
Cs�g}|jj}|dttfk}d}t�|g|�D]�}|dd�\}}	|tkrR|	|_q.|tt	fkrf|	d7}	|t
kr�|rzd|	}	d}nd}|tkr�|�|	�q.n>|tkr�|�
�q.n*|ttfkr�d}n|r�|r�||d�d}||	�q.dS)NrFr\rRTr])rLrUrfrgr5�chainrarO�NAME�NUMBER�STRINGrcrdre)
rrmrhrj�toks_appendrk�
prevstring�tok�toknum�tokvalrrrr`�s8
zUntokenizer.compatN)rrrrPr[rr`rrrrrJ�s
%rJcCs*t�}|�|�}|jdk	r&|�|j�}|Sr)rJrrO�encode)rh�ut�outrrrrs


cCsH|dd����dd�}|dks*|�d�r.dS|dks@|�d�rDdS|S)	N��_�-�utf-8zutf-8-)zlatin-1�
iso-8859-1ziso-latin-1)zlatin-1-ziso-8859-1-ziso-latin-1-r�)�lower�replace�
startswith)�orig_enc�encrrr�_get_normal_names�r�cs�z�jj�Wntk
r$d�YnXd�d}d}�fdd�}��fdd�}|�}|�t�rpd�|dd�}d	}|s||gfS||�}|r�||gfSt�|�s�||gfS|�}|s�||gfS||�}|r�|||gfS|||gfS)
NFr�cs$z��WStk
rYdSXdS�Nr%)�
StopIterationr��readlinerr�read_or_stop?sz%detect_encoding.<locals>.read_or_stopcs�z|�d�}Wn4tk
rBd}�dk	r6d�|��}t|��YnXt�|�}|sVdSt|�d��}zt|�}Wn:t	k
r��dkr�d|}nd��|�}t|��YnX�r�|dkr؈dkr�d}n
d���}t|��|d	7}|S)
Nr�z'invalid or missing encoding declarationz{} for {!r}rKzunknown encoding: zunknown encoding for {!r}: {}zencoding problem: utf-8z encoding problem for {!r}: utf-8z-sig)
�decode�UnicodeDecodeErrorrT�SyntaxError�	cookie_re�matchr�r$r�LookupError)ro�line_string�msgr�rO�codec)�	bom_found�filenamerr�find_cookieEs8

�
z$detect_encoding.<locals>.find_cookieT��	utf-8-sig)�__self__�name�AttributeErrorr�r�blank_rer�)r�rO�defaultr�r��first�secondr)r�r�r�rr
's8
&




cCsXt|d�}z2t|j�\}}|�d�t||dd�}d|_|WS|���YnXdS)N�rbrT)�line_bufferingr+)�
_builtin_openr
r��seekr�mode�close)r��bufferrO�lines�textrrrr�s

rcCs6t|�\}}t�d�}t�|t|d�|�}t|j|�Sr�)r
r5�repeatrqr^�	_tokenize�__next__)r�rO�consumed�empty�rl_genrrrr�s
ccsld}}}d}d\}}d}dg}	|dk	rH|dkr6d}tt|ddd�Vd}
d}z|}
|�}Wntk
rvd}YnX|dk	r�|�|�}|d	7}dt|�}}
|�rp|s�td
|��|�|�}|�r|�d�}}tt||d|�|||f||�Vd\}}d}nf|�rZ|dd�dk�rZ|d
d�dk�rZtt	||||t|�f|�Vd}d}qPn||}||}qP�n�|dk�r|�s|�s��q�d}||
k�r�||dk�r�|d	7}n8||dk�r�|t
d	t
}n||dk�r�d}n�q�|d	7}�q�||
k�r�q�||dk�r�||dk�r^||d��d�}tt|||f||t|�f|�V|t|�7}tt
||d�||f|t|�f|�VqP||	dk�r�|	�|�tt|d|�|df||f|�V||	dk�r.||	k�r�tdd|||f��|	dd�}	ttd||f||f|�V�q�n|�s*td|df��d}||
krPtt��||�}|�r�|�d	�\}}||f||f|}}}||k�r��q.|||�||}}||k�s�|dk�r�|dk�r�|dk�r�tt||||�V�q�|dk�r|dk�r�tt
||||�Vntt||||�V�q�|dk�r2tt||||�V�q�|tk�r�tt|�}|�||�}|�r�|�d�}|||�}tt||||f|�Vn||f}||d�}|}qP�q�|tk�s�|dd�tk�s�|dd�tk�rF|ddk�r2||f}tt�|��pt�|d	��pt�|d��}||d�d	}}|}qPntt||||�Vnf|���rdtt||||�VnH|dk�rtd	}n8|dk�r�|d	7}n|d k�r�|d	8}tt||||�Vn*tt	||||f||d	f|�V|d	7}�q.qP|
�r |
ddk�r ttd|d	t|
�f|d	t|
�d	fd�V|	d	d�D] }ttd|df|dfd�V�q,ttd|df|dfd�VdS)!Nr�
0123456789)r0rr�r�)rrr0r%rKzEOF in multi-line string���rQ���z\
rR�	�z#
�#z
r]z3unindent does not match any outer indentation levelz
<tokenize>zEOF in multi-line statement�.z...r\r��
�\z([{z)]})rrar�r�r_rGr�rnrt�
ERRORTOKEN�tabsize�rstrip�COMMENTrgrUrc�IndentationErrorrdrB�PseudoToken�spanrsrf�
triple_quoted�endpats�
single_quoted�get�isidentifierrrrrb)r�rO�lnum�parenlev�	continued�numchars�contstr�needcont�contlinerj�	last_linero�pos�max�strstart�endprog�endmatchrn�column�
comment_token�pseudomatchrV�spos�eposrm�initialrprrrr��s<




�*

�


�
�
"

� 

���





����






�.r�cCs
t|d�Sr)r�r�rrrr	dsc

s$ddl}dd��d�fdd�	}|jdd�}|jdd	d
dd�|jd
ddddd�|��}z�|jr�|j}t|d��}tt|j��}W5QRXnd}t	t
jjd�}|D]>}|j}|j
r�|j}d|j|j}	td|	t||jf�q�W�n8tk
�r6}
z0|
jddd�\}}||
jd|||f�W5d}
~
XYn�tk
�r|}
z(|
jd\}}||
jd|||f�W5d}
~
XYn�tk
�r�}
z||
|�W5d}
~
XYnxtk
�r�}
z||
�W5d}
~
XYnNtk
�r�td�Yn2tk
�r}
z�d|
��W5d}
~
XYnXdS)NrcSstj�|�tj�d�dS)Nr�)�sys�stderr�write)�messagerrr�perrorpszmain.<locals>.perrorcsR|r"|f||f}�d|�n"|r8�d||f�n�d|�t�d�dS)Nz%s:%d:%d: error: %sz
%s: error: %sz	error: %srK)r��exit)r�r��location�args�r�rr�errortszmain.<locals>.errorzpython -m tokenize)�progr�r(zfilename.pyz'the file to tokenize; defaults to stdin)�dest�nargs�metavar�helpz-ez--exact�exact�
store_truez(display token names using the exact type)r��actionr�r�z<stdin>z%d,%d-%d,%d:z%-20s%-15s%-15rrKr�zinterrupted
zunexpected error: %s)NN)�argparse�ArgumentParser�add_argument�
parse_argsr�r��listrr�r�r��stdinr
r�rrVrn�printrrr�r�rGr��OSError�KeyboardInterrupt�	Exception)
r�r��parserr�r�r-rLrm�
token_type�token_range�errror�rr�r�mainlsT���&&r��__main__)R�
__author__�__credits__�builtinsrr��codecsrr�collections�ior�	itertoolsr5r>r�rmrr?�ASCIIr�r��__all__�
namedtuplerr$r'r)�
Whitespace�Comment�Ignore�Name�	Hexnumber�	Binnumber�	Octnumber�	Decnumber�	Intnumber�Exponent�
Pointfloat�Expfloat�Floatnumber�
Imagnumber�Numberr=rB�StringPrefix�Single�Double�Single3�Double3�Triple�String�map�escape�sorted�Special�Funny�
PlainToken�Token�ContStr�PseudoExtrasr�r��_prefix�setr�r�r<r,r8r�r�rGrIrJrr�r
rr�r	r�rrrrr�<module>s�
�
��

�
���

_]8=
__pycache__/copy.cpython-38.opt-1.pyc000064400000015515151153537560013337 0ustar00U

e5d�!�@sTdZddlZddlZddlmZGdd�de�ZeZzddlm	Z	Wne
k
r\dZ	YnXdddgZd	d�ZiZ
Zd
d�Zed�eeeeeeeeeeeeejee�ee�ejej fD]Z!eee!<q�e"edd�Z!e!dk	r�eee!<e#jee#<e$jee$<e%jee%<e&jee&<e	dk	�r e	jee	<[[!dgfd
d�Z'iZ(Zdd�Z)e)eed�<e)eee�<e)eee�<e)ee<e)ee<e)ee<e)ee<e)ee<e)ee<e)eej*<e)ee<e)eej<e)eej<e)eej <e)ee<e'fdd�Z+e+ee#<e'fdd�Z,e,ee<e'fdd�Z-e-ee$<e	dk	�re-ee	<dd�Z.e.eej/<[dd�Z0ddde'fdd�Z1[[[	dS)a�Generic (shallow and deep) copying operations.

Interface summary:

        import copy

        x = copy.copy(y)        # make a shallow copy of y
        x = copy.deepcopy(y)    # make a deep copy of y

For module specific errors, copy.Error is raised.

The difference between shallow and deep copying is only relevant for
compound objects (objects that contain other objects, like lists or
class instances).

- A shallow copy constructs a new compound object and then (to the
  extent possible) inserts *the same objects* into it that the
  original contains.

- A deep copy constructs a new compound object and then, recursively,
  inserts *copies* into it of the objects found in the original.

Two problems often exist with deep copy operations that don't exist
with shallow copy operations:

 a) recursive objects (compound objects that, directly or indirectly,
    contain a reference to themselves) may cause a recursive loop

 b) because deep copy copies *everything* it may copy too much, e.g.
    administrative data structures that should be shared even between
    copies

Python's deep copy operation avoids these problems by:

 a) keeping a table of objects already copied during the current
    copying pass

 b) letting user-defined classes override the copying operation or the
    set of components copied

This version does not copy types like module, class, function, method,
nor stack trace, stack frame, nor file, socket, window, nor array, nor
any similar types.

Classes can use the same interfaces to control copying that they use
to control pickling: they can define methods called __getinitargs__(),
__getstate__() and __setstate__().  See the documentation for module
"pickle" for information on these methods.
�N)�dispatch_tablec@seZdZdS)�ErrorN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/copy.pyr7sr)�PyStringMap�copy�deepcopycCs�t|�}t�|�}|r||�St|t�r0t|�St|dd�}|dk	rL||�St�|�}|dk	rh||�}nBt|dd�}|dk	r�|d�}n$t|dd�}|r�|�}ntd|��t|t	�r�|St
|df|��S)zlShallow copy operation on arbitrary Python objects.

    See the module's __doc__ string for more info.
    �__copy__N�
__reduce_ex__��
__reduce__z%un(shallow)copyable object of type %s)�type�_copy_dispatch�get�
issubclass�_copy_immutable�getattrrr�
isinstance�str�_reconstruct)�x�cls�copier�reductor�rvrrrr
Bs,





cCs|S�Nr)rrrrrksr�CodeTypec	Cs |dkri}t|�}|�||�}||k	r,|St|�}t�|�}|dk	rR|||�}n�t|t�rht||�}n�t|dd�}|dk	r�||�}nzt�|�}|r�||�}nBt|dd�}|dk	r�|d�}n$t|dd�}|r�|�}ntd|��t	|t
�r�|}nt||f|��}||k	�r|||<t||�|S)ziDeep copy operation on arbitrary Python objects.

    See the module's __doc__ string for more info.
    N�__deepcopy__r
rrz"un(deep)copyable object of type %s)
�idrr�_deepcopy_dispatchr�_deepcopy_atomicrrrrrr�_keep_alive)	r�memoZ_nil�d�yrrrrrrrr�sD





�


cCs|Srr�rr%rrrr#�sr#cCs2g}||t|�<|j}|D]}||||��q|Sr)r!�append)rr%rr'r)�arrr�_deepcopy_list�sr+csh��fdd�|D�}z�t|�WStk
r6YnXt||�D]\}}||k	rBt|�}qdqB|}|S)Ncsg|]}�|���qSrr)�.0r*�rr%rr�
<listcomp>�sz#_deepcopy_tuple.<locals>.<listcomp>)r!�KeyError�zip�tuple)rr%rr'�k�jrr-r�_deepcopy_tuple�sr4cCs:i}||t|�<|��D]\}}|||�||||�<q|Sr)r!�items)rr%rr'�key�valuerrr�_deepcopy_dict�s
r8cCst|�|jt|j|��Sr)r�__func__r�__self__r(rrr�_deepcopy_method�sr;cCs>z|t|��|�Wn"tk
r8|g|t|�<YnXdS)aMKeeps a reference to the object x in the memo.

    Because we remember objects by their id, we have
    to assure that possibly temporary objects are kept
    alive by referencing them.
    We store a reference at the id of the memo, which should
    normally not be used unless someone tries to deepcopy
    the memo itself...
    N)r!r)r/r(rrrr$�s
r$csb�dk	}|r$|r$��fdd�|D�}||�}	|r<|	�t|�<|dk	r�|rR�|��}t|	d�rh|	�|�n^t|t�r�t|�dkr�|\}}
nd}
|dk	r�|	j�|�|
dk	r�|
��D]\}}t	|	||�q�|dk	�r|r�|D]}
�|
��}
|	�
|
�q�n|D]}
|	�
|
�q�|dk	�r^|�rF|D]&\}}�|��}�|��}||	|<�qn|D]\}}||	|<�qJ|	S)Nc3s|]}�|��VqdSrr)r,�argr-rr�	<genexpr>sz_reconstruct.<locals>.<genexpr>�__setstate__�)r!�hasattrr>rr1�len�__dict__�updater5�setattrr))rr%�func�args�stateZlistiterZdictiterrZdeepr'Z	slotstater6r7�itemrr-rrsF







r)2�__doc__�types�weakref�copyregr�	Exceptionr�errorZorg.python.corer	�ImportError�__all__r
rr&rr�int�float�bool�complexrr1�bytes�	frozenset�range�slice�property�BuiltinFunctionType�Ellipsis�NotImplemented�FunctionType�ref�tr�list�dict�set�	bytearrayrr"r#rr+r4r8r;�
MethodTyper$rrrrr�<module>s�2

'�






4





�
-__pycache__/_collections_abc.cpython-38.opt-1.pyc000064400000070107151153537560015645 0ustar00U

e5d�e�@stdZddlmZmZddlZdddddd	d
ddd
dddddddddddddddgZdZeed��Z	eee
���Zeei����Z
eei����Zeei����Zeeg��Zeeeg���Zeeed���Zeeedd >���Zeee���Zeed!��Zeed"��Zeee���Zei���Zei���Zei���Z eej!�Z"ed#d$���Z#d%d&�Z$e$�Z$ee$�Z%e$�&�[$d'd(�Z'e'�Z'ee'�Z(['d)d*�Z)Gd+d	�d	ed,�Z*Gd-d�ded,�Z+Gd.d�de+�Z,e,�-e%�Gd/d�ded,�Z.Gd0d�de.�Z/Gd1d�de/�Z0e0�-e(�Gd2d
�d
ed,�Z1Gd3d�de1�Z2e2�-e	�e2�-e�e2�-e
�e2�-e�e2�-e�e2�-e�e2�-e�e2�-e�e2�-e�e2�-e�e2�-e�e2�-e�e2�-e�Gd4d
�d
e1�Z3Gd5d�de2�Z4e4�-e#�Gd6d�ded,�Z5Gd7d�ded,�Z6Gd8d�de5e1e6�Z7Gd9d�ded,�Z8Gd:d�de7�Z9e9�-e:�Gd;d�de9�Z;e;�-e�Gd<d�de7�Z<e<�-e"�Gd=d�de5�Z=Gd>d�de=e9�Z>e>�-e�Gd?d�de=e9�Z?e?�-e �Gd@d�de=e7�Z@e@�-e�GdAd�de<�ZAeA�-eB�GdBd�de3e7�ZCeC�-eD�eC�-eE�eC�-e�eC�-eF�GdCd�deC�ZGeG�-eH�eG�-e
�GdDd�deC�ZIeI�-eJ�eI�-e
�dS)EzjAbstract Base Classes (ABCs) for collections, according to PEP 3119.

Unit tests are in test_collections.
�)�ABCMeta�abstractmethodN�	Awaitable�	Coroutine�
AsyncIterable�
AsyncIterator�AsyncGenerator�Hashable�Iterable�Iterator�	Generator�
Reversible�Sized�	Container�Callable�
Collection�Set�
MutableSet�Mapping�MutableMapping�MappingView�KeysView�	ItemsView�
ValuesView�Sequence�MutableSequence�
ByteStringzcollections.abc��i���ccsdVS�Nr r r r �(/usr/lib64/python3.8/_collections_abc.py�<lambda>8rr#c�sdSr!r r r r r"�_coro:rr$cCs
dVdSr!r r r r r"�_ag@rr%cGsN|j}|D]>}|D],}||jkr|j|dkr:tSq
qtSq
dS)NT)�__mro__�__dict__�NotImplemented)�C�methods�mro�method�Br r r"�_check_methodsHs

r.c@s(eZdZdZedd��Zedd��ZdS)r	r cCsdS�Nrr ��selfr r r"�__hash__XszHashable.__hash__cCs|tkrt|d�StS)Nr2)r	r.r(��clsr)r r r"�__subclasshook__\s
zHashable.__subclasshook__N)�__name__�
__module__�__qualname__�	__slots__rr2�classmethodr5r r r r"r	Ts

)�	metaclassc@s(eZdZdZedd��Zedd��ZdS)rr ccs
dVdSr!r r0r r r"�	__await__gszAwaitable.__await__cCs|tkrt|d�StS)Nr<)rr.r(r3r r r"r5ks
zAwaitable.__subclasshook__N)r6r7r8r9rr<r:r5r r r r"rcs

c@s>eZdZdZedd��Zeddd��Zdd�Zed	d
��Z	dS)rr cCst�dS)zcSend a value into the coroutine.
        Return next yielded value or raise StopIteration.
        N��
StopIteration�r1�valuer r r"�sendvszCoroutine.sendNcCs4|dkr|dkr|�|�}|dk	r,|�|�}|�dS)zgRaise an exception in the coroutine.
        Return next yielded value or raise StopIteration.
        N��with_traceback�r1�typ�val�tbr r r"�throw}s
zCoroutine.throwc	Cs4z|�t�Wnttfk
r&Yn
Xtd��dS)�.Raise GeneratorExit inside coroutine.
        zcoroutine ignored GeneratorExitN�rH�
GeneratorExitr>�RuntimeErrorr0r r r"�close�s
zCoroutine.closecCs|tkrt|dddd�StS)Nr<rArHrM)rr.r(r3r r r"r5�szCoroutine.__subclasshook__)NN)
r6r7r8r9rrArHrMr:r5r r r r"rrs

c@s(eZdZdZedd��Zedd��ZdS)rr cCst�Sr!)rr0r r r"�	__aiter__�szAsyncIterable.__aiter__cCs|tkrt|d�StS)NrN)rr.r(r3r r r"r5�s
zAsyncIterable.__subclasshook__N)r6r7r8r9rrNr:r5r r r r"r�s

c@s0eZdZdZedd��Zdd�Zedd��ZdS)	rr c�st�dS)z@Return the next item or raise StopAsyncIteration when exhausted.N��StopAsyncIterationr0r r r"�	__anext__�szAsyncIterator.__anext__cCs|Sr!r r0r r r"rN�szAsyncIterator.__aiter__cCs|tkrt|dd�StS)NrQrN)rr.r(r3r r r"r5�szAsyncIterator.__subclasshook__N)	r6r7r8r9rrQrNr:r5r r r r"r�s
c@sFeZdZdZdd�Zedd��Zed
dd��Zd	d
�Ze	dd��Z
dS)rr c�s|�d�IdHS)zpReturn the next item from the asynchronous generator.
        When exhausted, raise StopAsyncIteration.
        N)�asendr0r r r"rQ�szAsyncGenerator.__anext__c�st�dS)zuSend a value into the asynchronous generator.
        Return next yielded value or raise StopAsyncIteration.
        NrOr?r r r"rR�szAsyncGenerator.asendNc�s4|dkr|dkr|�|�}|dk	r,|�|�}|�dS)zyRaise an exception in the asynchronous generator.
        Return next yielded value or raise StopAsyncIteration.
        NrBrDr r r"�athrow�s
zAsyncGenerator.athrowc	�s:z|�t�IdHWnttfk
r,Yn
Xtd��dS)rINz,asynchronous generator ignored GeneratorExit)rSrKrPrLr0r r r"�aclose�s
zAsyncGenerator.aclosecCs|tkrt|ddddd�StS)NrNrQrRrSrT)rr.r(r3r r r"r5�s�zAsyncGenerator.__subclasshook__)NN)r6r7r8r9rQrrRrSrTr:r5r r r r"r�s

c@s(eZdZdZedd��Zedd��ZdS)r
r ccsdSr!r r0r r r"�__iter__�szIterable.__iter__cCs|tkrt|d�StS)NrU)r
r.r(r3r r r"r5�s
zIterable.__subclasshook__N)r6r7r8r9rrUr:r5r r r r"r
�s

c@s0eZdZdZedd��Zdd�Zedd��ZdS)	rr cCst�dS)zKReturn the next item from the iterator. When exhausted, raise StopIterationNr=r0r r r"�__next__szIterator.__next__cCs|Sr!r r0r r r"rUszIterator.__iter__cCs|tkrt|dd�StS)NrUrV)rr.r(r3r r r"r5szIterator.__subclasshook__N)	r6r7r8r9rrVrUr:r5r r r r"rs
c@s(eZdZdZedd��Zedd��ZdS)r
r ccsdSr!r r0r r r"�__reversed__)szReversible.__reversed__cCs|tkrt|dd�StS)NrWrU)r
r.r(r3r r r"r5.szReversible.__subclasshook__N)r6r7r8r9rrWr:r5r r r r"r
%s

c@sFeZdZdZdd�Zedd��Zed
dd��Zd	d
�Ze	dd��Z
dS)rr cCs
|�d�S)z^Return the next item from the generator.
        When exhausted, raise StopIteration.
        N)rAr0r r r"rV9szGenerator.__next__cCst�dS)zcSend a value into the generator.
        Return next yielded value or raise StopIteration.
        Nr=r?r r r"rA?szGenerator.sendNcCs4|dkr|dkr|�|�}|dk	r,|�|�}|�dS)zgRaise an exception in the generator.
        Return next yielded value or raise StopIteration.
        NrBrDr r r"rHFs
zGenerator.throwc	Cs4z|�t�Wnttfk
r&Yn
Xtd��dS)z.Raise GeneratorExit inside generator.
        zgenerator ignored GeneratorExitNrJr0r r r"rMSs
zGenerator.closecCs|tkrt|ddddd�StS)NrUrVrArHrM)rr.r(r3r r r"r5]s�zGenerator.__subclasshook__)NN)r6r7r8r9rVrrArHrMr:r5r r r r"r5s

c@s(eZdZdZedd��Zedd��ZdS)rr cCsdSr/r r0r r r"�__len__ksz
Sized.__len__cCs|tkrt|d�StS)NrX)rr.r(r3r r r"r5os
zSized.__subclasshook__N)r6r7r8r9rrXr:r5r r r r"rgs

c@s(eZdZdZedd��Zedd��ZdS)rr cCsdS�NFr )r1�xr r r"�__contains__zszContainer.__contains__cCs|tkrt|d�StS)Nr[)rr.r(r3r r r"r5~s
zContainer.__subclasshook__N)r6r7r8r9rr[r:r5r r r r"rvs

c@seZdZdZedd��ZdS)rr cCs|tkrt|ddd�StS)NrXrUr[)rr.r(r3r r r"r5�szCollection.__subclasshook__N)r6r7r8r9r:r5r r r r"r�sc@s(eZdZdZedd��Zedd��ZdS)rr cOsdSrYr )r1�args�kwdsr r r"�__call__�szCallable.__call__cCs|tkrt|d�StS)Nr^)rr.r(r3r r r"r5�s
zCallable.__subclasshook__N)r6r7r8r9rr^r:r5r r r r"r�s

c@s�eZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	e
d
d��Zdd�ZeZ
dd�Zdd�ZeZdd�Zdd�Zdd�ZeZdd�ZdS)raZA set is a finite, iterable container.

    This class provides concrete generic implementations of all
    methods except for __contains__, __iter__ and __len__.

    To override the comparisons (presumably for speed, as the
    semantics are fixed), redefine __le__ and __ge__,
    then the other operations will automatically follow suit.
    r cCs>t|t�stSt|�t|�kr"dS|D]}||kr&dSq&dS�NFT��
isinstancerr(�len�r1�other�elemr r r"�__le__�s
z
Set.__le__cCs(t|t�stSt|�t|�ko&|�|�Sr!�rarr(rbrf�r1rdr r r"�__lt__�s
z
Set.__lt__cCs(t|t�stSt|�t|�ko&|�|�Sr!)rarr(rb�__ge__rhr r r"�__gt__�s
z
Set.__gt__cCs>t|t�stSt|�t|�kr"dS|D]}||kr&dSq&dSr_r`rcr r r"rj�s
z
Set.__ge__cCs(t|t�stSt|�t|�ko&|�|�Sr!rgrhr r r"�__eq__�s
z
Set.__eq__cCs||�S)z�Construct an instance of the class from any iterable input.

        Must override this method if the class constructor signature
        does not accept an iterable for an input.
        r )r4�itr r r"�_from_iterable�szSet._from_iterablecs&t|t�stS���fdd�|D��S)Nc3s|]}|�kr|VqdSr!r ��.0r@r0r r"�	<genexpr>�szSet.__and__.<locals>.<genexpr>�rar
r(rnrhr r0r"�__and__�s
zSet.__and__cCs|D]}||krdSqdS)z1Return True if two sets have a null intersection.FTr )r1rdr@r r r"�
isdisjoint�szSet.isdisjointcCs*t|t�stSdd�||fD�}|�|�S)Ncss|]}|D]
}|Vq
qdSr!r )rp�s�er r r"rq�szSet.__or__.<locals>.<genexpr>rr)r1rd�chainr r r"�__or__�s
z
Set.__or__cs:t�t�s"t�t�stS|����|��fdd�|D��S)Nc3s|]}|�kr|VqdSr!r ro�rdr r"rq�s�zSet.__sub__.<locals>.<genexpr>�rarr
r(rnrhr ryr"�__sub__�s



zSet.__sub__cs:t|t�s"t|t�stS��|�}���fdd�|D��S)Nc3s|]}|�kr|VqdSr!r ror0r r"rq�s�zSet.__rsub__.<locals>.<genexpr>rzrhr r0r"�__rsub__�s



zSet.__rsub__cCs2t|t�s"t|t�stS|�|�}||||BSr!rzrhr r r"�__xor__s



zSet.__xor__cCs�tj}d|d}t|�}d|d}||M}|D],}t|�}|||d>AdAdN}||M}q2|dd}||M}||kr�||d8}|d	kr�d
}|S)a+Compute the hash value of a set.

        Note that we don't define __hash__: not all sets are hashable.
        But if you define a hashable set type, its __hash__ should
        call this function.

        This must be compatible __eq__.

        All sets ought to compare equal if they contain the same
        elements, regardless of how they are implemented, and
        regardless of the order of the elements; so there's not much
        freedom for __eq__ or __hash__.  We match the algorithm used
        by the built-in frozenset type.
        �riM��r�i�M[l�4~2i�
i��6���i��8#)�sys�maxsizerb�hash)r1�MAX�MASK�n�hrZ�hxr r r"�_hash	s 
z	Set._hashN)r6r7r8�__doc__r9rfrirkrjrlr:rnrs�__rand__rtrx�__ror__r{r|r}�__rxor__r�r r r r"r�s&



c@sdeZdZdZdZedd��Zedd��Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�ZdS)ra�A mutable set is a finite, iterable container.

    This class provides concrete generic implementations of all
    methods except for __contains__, __iter__, __len__,
    add(), and discard().

    To override the comparisons (presumably for speed, as the
    semantics are fixed), all you have to do is redefine __le__ and
    then the other operations will automatically follow suit.
    r cCst�dS)zAdd an element.N��NotImplementedErrorr?r r r"�add:szMutableSet.addcCst�dS)z8Remove an element.  Do not raise an exception if absent.Nr�r?r r r"�discard?szMutableSet.discardcCs||krt|��|�|�dS)z5Remove an element. If not a member, raise a KeyError.N)�KeyErrorr�r?r r r"�removeDszMutableSet.removecCs>t|�}zt|�}Wntk
r.td�YnX|�|�|S)z2Return the popped value.  Raise KeyError if empty.N)�iter�nextr>r�r��r1rmr@r r r"�popJs
zMutableSet.popcCs(z|��qWntk
r"YnXdS)z6This is slow (creates N new iterators!) but effective.N)r�r�r0r r r"�clearTszMutableSet.clearcCs|D]}|�|�q|Sr!)r�r�r r r"�__ior__\szMutableSet.__ior__cCs||D]}|�|�q|Sr!)r�r�r r r"�__iand__aszMutableSet.__iand__cCsR||kr|��n<t|t�s&|�|�}|D]"}||krB|�|�q*|�|�q*|Sr!)r�rarrnr�r�r�r r r"�__ixor__fs


zMutableSet.__ixor__cCs*||kr|��n|D]}|�|�q|Sr!)r�r�r�r r r"�__isub__ss

zMutableSet.__isub__N)r6r7r8r�r9rr�r�r�r�r�r�r�r�r�r r r r"r,s



c@sReZdZdZedd��Zddd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�ZdZdS)rr cCst�dSr!�r��r1�keyr r r"�__getitem__�szMapping.__getitem__NcCs(z
||WStk
r"|YSXdS)z<D.get(k[,d]) -> D[k] if k in D, else d.  d defaults to None.Nr��r1r��defaultr r r"�get�s
zMapping.getcCs,z||Wntk
r"YdSXdSdSr_r�r�r r r"r[�s
zMapping.__contains__cCst|�S)z:D.keys() -> a set-like object providing a view on D's keys)rr0r r r"�keys�szMapping.keyscCst|�S)z<D.items() -> a set-like object providing a view on D's items)rr0r r r"�items�sz
Mapping.itemscCst|�S)z6D.values() -> an object providing a view on D's values)rr0r r r"�values�szMapping.valuescCs&t|t�stSt|���t|���kSr!)rarr(�dictr�rhr r r"rl�s
zMapping.__eq__)N)
r6r7r8r9rr�r�r[r�r�r�rlrWr r r r"r�s


c@s(eZdZdZdd�Zdd�Zdd�ZdS)	r��_mappingcCs
||_dSr!r�)r1�mappingr r r"�__init__�szMappingView.__init__cCs
t|j�Sr!)rbr�r0r r r"rX�szMappingView.__len__cCs
d�|�S)Nz&{0.__class__.__name__}({0._mapping!r}))�formatr0r r r"�__repr__�szMappingView.__repr__N)r6r7r8r9r�rXr�r r r r"r�sc@s,eZdZdZedd��Zdd�Zdd�ZdS)	rr cCst|�Sr!��set�r1rmr r r"rn�szKeysView._from_iterablecCs
||jkSr!r�r�r r r"r[�szKeysView.__contains__ccs|jEdHdSr!r�r0r r r"rU�szKeysView.__iter__N�r6r7r8r9r:rnr[rUr r r r"r�s

c@s,eZdZdZedd��Zdd�Zdd�ZdS)	rr cCst|�Sr!r�r�r r r"rn�szItemsView._from_iterablecCsB|\}}z|j|}Wntk
r,YdSX||kp<||kSdSrY)r�r�)r1�itemr�r@�vr r r"r[�szItemsView.__contains__ccs |jD]}||j|fVqdSr!r�r�r r r"rU�s
zItemsView.__iter__Nr�r r r r"r�s

	c@s eZdZdZdd�Zdd�ZdS)rr cCs0|jD]$}|j|}||ks$||krdSqdS�NTFr�)r1r@r�r�r r r"r[�s


zValuesView.__contains__ccs|jD]}|j|VqdSr!r�r�r r r"rU�s
zValuesView.__iter__N)r6r7r8r9r[rUr r r r"r�sc@s^eZdZdZedd��Zedd��Ze�Zefdd�Z	dd	�Z
d
d�Zddd
�Zddd�Z
dS)rr cCst�dSr!r��r1r�r@r r r"�__setitem__szMutableMapping.__setitem__cCst�dSr!r�r�r r r"�__delitem__szMutableMapping.__delitem__cCs@z||}Wn$tk
r0||jkr(�|YSX||=|SdS)z�D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
          If key is not found, d is returned if given, otherwise KeyError is raised.
        N)r��_MutableMapping__marker)r1r�r�r@r r r"r�s

zMutableMapping.popcCsBztt|��}Wntk
r*td�YnX||}||=||fS)z�D.popitem() -> (k, v), remove and return some (key, value) pair
           as a 2-tuple; but raise KeyError if D is empty.
        N)r�r�r>r�r�r r r"�popitem$szMutableMapping.popitemcCs(z|��qWntk
r"YnXdS)z,D.clear() -> None.  Remove all items from D.N)r�r�r0r r r"r�0szMutableMapping.clearcKs|t|t�r"|D]}||||<qn<t|d�rH|��D]}||||<q4n|D]\}}|||<qL|��D]\}}|||<qfdS)aK D.update([E, ]**F) -> None.  Update D from mapping/iterable E and F.
            If E present and has a .keys() method, does:     for k in E: D[k] = E[k]
            If E present and lacks .keys() method, does:     for (k, v) in E: D[k] = v
            In either case, this is followed by: for k, v in F.items(): D[k] = v
        r�N)rar�hasattrr�r�)r1rdr]r�r@r r r"�update8s


zMutableMapping.updateNcCs,z
||WStk
r&|||<YnX|S)z@D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in Dr�r�r r r"�
setdefaultJs

zMutableMapping.setdefault)r )N)r6r7r8r9rr�r��objectr�r�r�r�r�r�r r r r"r�s


c@sJeZdZdZdZedd��Zdd�Zdd�Zd	d
�Z	dd
d�Z
dd�ZdS)rz�All the operations on a read-only sequence.

    Concrete subclasses must override __new__ or __init__,
    __getitem__, and __len__.
    r cCst�dSr!��
IndexError�r1�indexr r r"r�bszSequence.__getitem__ccs<d}z||}|V|d7}qWntk
r6YdSXdS)Nrrr�)r1�ir�r r r"rUfszSequence.__iter__cCs$|D]}||ks||krdSqdSr�r )r1r@r�r r r"r[pszSequence.__contains__ccs$ttt|���D]}||VqdSr!)�reversed�rangerb)r1r�r r r"rWvszSequence.__reversed__rNcCs�|dk	r"|dkr"tt|�|d�}|dk	r>|dkr>|t|�7}|}|dksR||kr�z"||}||ksl||krr|WSWntk
r�Yq�YnX|d7}qBt�dS)z�S.index(value, [start, [stop]]) -> integer -- return first index of value.
           Raises ValueError if the value is not present.

           Supporting start and stop arguments is optional, but
           recommended.
        Nrr)�maxrbr��
ValueError)r1r@�start�stopr�r�r r r"r�zs


zSequence.indexcst�fdd�|D��S)zBS.count(value) -> integer -- return number of occurrences of valuec3s"|]}|�ks|�krdVqdS)rNr )rpr��r@r r"rq�sz!Sequence.count.<locals>.<genexpr>)�sumr?r r�r"�count�szSequence.count)rN)r6r7r8r�r9rr�rUr[rWr�r�r r r r"rXs


c@seZdZdZdZdS)rzMThis unifies bytes and bytearray.

    XXX Should add all their methods.
    r N)r6r7r8r�r9r r r r"r�sc@sneZdZdZedd��Zedd��Zedd��Zdd	�Zd
d�Z	dd
�Z
dd�Zddd�Zdd�Z
dd�ZdS)rr cCst�dSr!r��r1r�r@r r r"r��szMutableSequence.__setitem__cCst�dSr!r�r�r r r"r��szMutableSequence.__delitem__cCst�dS)z3S.insert(index, value) -- insert value before indexNr�r�r r r"�insert�szMutableSequence.insertcCs|�t|�|�dS)z:S.append(value) -- append value to the end of the sequenceN)r�rbr?r r r"�append�szMutableSequence.appendcCs(z|��qWntk
r"YnXdS)z,S.clear() -> None -- remove all items from SN)r�r�r0r r r"r��szMutableSequence.clearcCsHt|�}t|d�D].}|||d||||<|||d<qdS)z!S.reverse() -- reverse *IN PLACE*r~rN)rbr�)r1r�r�r r r"�reverse�szMutableSequence.reversecCs(||krt|�}|D]}|�|�qdS)zMS.extend(iterable) -- extend sequence by appending elements from the iterableN)�listr�)r1r�r�r r r"�extend�szMutableSequence.extendr�cCs||}||=|S)z�S.pop([index]) -> item -- remove and return item at index (default last).
           Raise IndexError if list is empty or index is out of range.
        r )r1r�r�r r r"r��szMutableSequence.popcCs||�|�=dS)zvS.remove(value) -- remove first occurrence of value.
           Raise ValueError if the value is not present.
        N)r�r?r r r"r��szMutableSequence.removecCs|�|�|Sr!)r�)r1r�r r r"�__iadd__�s
zMutableSequence.__iadd__N)r�)r6r7r8r9rr�r�r�r�r�r�r�r�r�r�r r r r"r�s	



)Kr��abcrrr��__all__r6�typer��bytes_iterator�	bytearray�bytearray_iteratorr��dict_keyiteratorr��dict_valueiteratorr��dict_itemiterator�
list_iteratorr��list_reverseiteratorr��range_iterator�longrange_iteratorr��set_iterator�str_iterator�tuple_iterator�zip�zip_iterator�	dict_keys�dict_values�
dict_itemsr'�mappingproxy�	generatorr$�	coroutinerMr%�async_generatorr.r	rr�registerrrrr
rr
rrrrrr�	frozensetrrrrrrrr�r�tuple�str�
memoryviewr�bytesrr�r r r r"�<module>s��	
)
0













/



O
2



S
=



	

C
__pycache__/heapq.cpython-38.opt-2.pyc000064400000025460151153537560013464 0ustar00U

e5d]Y�@sVdZddddddddgZd	d�Zd
d�Zdd�Zdd�Zd
d�Zdd�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
ddd�dd�Zd(d d�Zd)d!d�Zzd"d#lTWnek
r�YnXzd"d$lmZWnek
r�YnXzd"d%lm	Z	Wnek
�r
YnXzd"d&lmZWnek
�r2YnXed'k�rRd"dlZee���dS)*uoHeap queues

[explanation by François Pinard]

Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0.  For the sake of comparison,
non-existing elements are considered to be infinite.  The interesting
property of a heap is that a[0] is always its smallest element.

The strange invariant above is meant to be an efficient memory
representation for a tournament.  The numbers below are `k', not a[k]:

                                   0

                  1                                 2

          3               4                5               6

      7       8       9       10      11      12      13      14

    15 16   17 18   19 20   21 22   23 24   25 26   27 28   29 30


In the tree above, each cell `k' is topping `2*k+1' and `2*k+2'.  In
a usual binary tournament we see in sports, each cell is the winner
over the two cells it tops, and we can trace the winner down the tree
to see all opponents s/he had.  However, in many computer applications
of such tournaments, we do not need to trace the history of a winner.
To be more memory efficient, when a winner is promoted, we try to
replace it by something else at a lower level, and the rule becomes
that a cell and the two cells it tops contain three different items,
but the top cell "wins" over the two topped cells.

If this heap invariant is protected at all time, index 0 is clearly
the overall winner.  The simplest algorithmic way to remove it and
find the "next" winner is to move some loser (let's say cell 30 in the
diagram above) into the 0 position, and then percolate this new 0 down
the tree, exchanging values, until the invariant is re-established.
This is clearly logarithmic on the total number of items in the tree.
By iterating over all items, you get an O(n ln n) sort.

A nice feature of this sort is that you can efficiently insert new
items while the sort is going on, provided that the inserted items are
not "better" than the last 0'th element you extracted.  This is
especially useful in simulation contexts, where the tree holds all
incoming events, and the "win" condition means the smallest scheduled
time.  When an event schedule other events for execution, they are
scheduled into the future, so they can easily go into the heap.  So, a
heap is a good structure for implementing schedulers (this is what I
used for my MIDI sequencer :-).

Various structures for implementing schedulers have been extensively
studied, and heaps are good for this, as they are reasonably speedy,
the speed is almost constant, and the worst case is not much different
than the average case.  However, there are other representations which
are more efficient overall, yet the worst cases might be terrible.

Heaps are also very useful in big disk sorts.  You most probably all
know that a big sort implies producing "runs" (which are pre-sorted
sequences, which size is usually related to the amount of CPU memory),
followed by a merging passes for these runs, which merging is often
very cleverly organised[1].  It is very important that the initial
sort produces the longest runs possible.  Tournaments are a good way
to that.  If, using all the memory available to hold a tournament, you
replace and percolate items that happen to fit the current run, you'll
produce runs which are twice the size of the memory for random input,
and much better for input fuzzily ordered.

Moreover, if you output the 0'th item on disk and get an input which
may not fit in the current tournament (because the value "wins" over
the last output value), it cannot fit in the heap, so the size of the
heap decreases.  The freed memory could be cleverly reused immediately
for progressively building a second heap, which grows at exactly the
same rate the first heap is melting.  When the first heap completely
vanishes, you switch heaps and start a new run.  Clever and quite
effective!

In a word, heaps are useful memory structures to know.  I use them in
a few applications, and I think it is good to keep a `heap' module
around. :-)

--------------------
[1] The disk balancing algorithms which are current, nowadays, are
more annoying than clever, and this is a consequence of the seeking
capabilities of the disks.  On devices which cannot seek, like big
tape drives, the story was quite different, and one had to be very
clever to ensure (far in advance) that each tape movement will be the
most effective possible (that is, will best participate at
"progressing" the merge).  Some tapes were even able to read
backwards, and this was also used to avoid the rewinding time.
Believe me, real good tape sorts were quite spectacular to watch!
From all times, sorting has always been a Great Art! :-)
�heappush�heappop�heapify�heapreplace�merge�nlargest�	nsmallest�heappushpopcCs"|�|�t|dt|�d�dS)N��)�append�	_siftdown�len��heap�item�r�/usr/lib64/python3.8/heapq.pyr�s
cCs.|��}|r*|d}||d<t|d�|S|S�Nr	)�pop�_siftup�rZlastelt�
returnitemrrrr�s
cCs|d}||d<t|d�|Sr�r�rrrrrrr�s
cCs0|r,|d|kr,|d|}|d<t|d�|Srrrrrrr�s
cCs,t|�}tt|d��D]}t||�qdS�N�)r
�reversed�ranger��x�n�irrrr�scCs.|��}|r*|d}||d<t|d�|S|Sr)r�_siftup_maxrrrr�_heappop_max�s
r#cCs|d}||d<t|d�|Sr)r"rrrr�_heapreplace_max�s
r$cCs,t|�}tt|d��D]}t||�qdSr)r
rrr"rrrr�_heapify_max�sr%cCsJ||}||kr>|dd?}||}||kr>|||<|}qq>q|||<dS�Nr
r�r�startpos�pos�newitem�	parentpos�parentrrrr�srcCs�t|�}|}||}d|d}||krj|d}||krL||||ksL|}||||<|}d|d}q |||<t|||�dS�Nrr
)r
r�rr)�endposr(r*�childpos�rightposrrrrsrcCsJ||}||kr>|dd?}||}||kr>|||<|}qq>q|||<dSr&rr'rrr�
_siftdown_maxsr2cCs�t|�}|}||}d|d}||krj|d}||krL||||ksL|}||||<|}d|d}q |||<t|||�dSr-)r
r2r.rrrr"%sr"NF��key�reversec	gsg}|j}|r t}t}t}d}nt}t}t}d}|dk�rttt	|��D]<\}	}
z|
j
}||�|	||g�WqHtk
r�YqHXqH||�t|�dkr�z2|d\}}	}}
|V|�|
d<|||
�q�Wq�tk
r�||�Yq�Xq�|�r|d\}}	}|V|j
EdHdSttt	|��D]J\}	}
z(|
j
}|�}|||�|	|||g�Wntk
�rjYnX�q$||�t|�dk�r�zF|d\}}	}}}
|V|�}||�|
d<||
d<|||
��q�Wntk
�r�||�YnX�qx|�r|d\}}	}}|V|j
EdHdS)N���r
r	r)rr%r#r$rrr�	enumerate�map�iter�__next__�
StopIterationr
�__self__)r4r5�	iterables�h�h_append�_heapify�_heappop�_heapreplace�	direction�order�it�next�value�s�	key_valuerrrr:sl


c	s�|dkr6t|�}t�}t||�d�}||kr0gS|gSzt|�}Wnttfk
rZYnX||krxt|�d�d|�S�dk�rt|�}dd�tt|�|�D�}|s�|St	|�|dd}|}t
}	|D].}
|
|kr�|	||
|f�|d\}}|d7}q�|��dd�|D�St|�}�fdd�tt|�|�D�}|�s>|St	|�|dd}|}t
}	|D]>}
�|
�}||k�r^|	||||
f�|d\}}}
|d7}�q^|��d	d�|D�S)
Nr
��defaultr4�r4cSsg|]\}}||f�qSrr��.0r!�elemrrr�
<listcomp>�sznsmallest.<locals>.<listcomp>r	cSsg|]\}}|�qSrr�rNrOrDrrrrP�scsg|]\}}�|�||f�qSrrrMrLrrrP�scSsg|]\}}}|�qSrr�rN�krDrOrrrrPs)r9�object�minr
�	TypeError�AttributeError�sorted�ziprr%r$�sort�r �iterabler4rE�sentinel�result�size�toprDrBrO�_orderrS�_elemrrLrr�sV


c	s�|dkr6t|�}t�}t||�d�}||kr0gS|gSzt|�}Wnttfk
rZYn X||krzt|�dd�d|�S�dk�rt|�}dd�ttd|d�|�D�}|s�|St	|�|dd}|}t
}	|D].}
||
kr�|	||
|f�|d\}}|d8}q�|jdd	�d
d�|D�St|�}�fdd�ttd|d�|�D�}|�sR|St	|�|dd}|}t
}	|D]>}
�|
�}||k�rt|	||||
f�|d\}}}
|d8}�qt|jdd	�dd�|D�S)
Nr
rJTr3cSsg|]\}}||f�qSrrrMrrrrP"sznlargest.<locals>.<listcomp>r	r6)r5cSsg|]\}}|�qSrrrQrrrrP/scsg|]\}}�|�||f�qSrrrMrLrrrP3scSsg|]\}}}|�qSrrrRrrrrPAs)r9rT�maxr
rVrWrXrYrrrrZr[rrLrr	sV

"
r	)�*)r$)r%)r#�__main__)N)N)�	__about__�__all__rrrrrr#r$r%rrr2r"rrr�_heapq�ImportError�__name__Zdoctest�printZtestmodrrrr�<module>!sP^
�

	5
<
;
__pycache__/stat.cpython-38.opt-2.pyc000064400000007007151153537560013336 0ustar00U

e5dm�
@sHdZdZdZdZdZdZdZdZdZd	Z	d
d�Z
dd
�ZdZdZ
dZdZdZdZdZdZdZdZdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)Z d*Z!e!Z"d+Z#d,Z$d-Z%d.Z&d/Z'd,Z(d-Z)d.Z*d0Z+d1Z,d2Z-dZ.dZ/dZ0dZ1dZ2dZ3dZ4dZ5dZ6d2Z7d1Z8dZ9d3Z:d4Z;d5Z<d6Z=d7Z>ed8fed9fed:fed;fed<fe
d=fed>ffe(d?ffe)d@ffe*e Bd9fe dAfe*dBffe,d?ffe-d@ffe.e!Bd9fe!dAfe.dBffe0d?ffe1d@ffe2e#BdCfe#dDfe2dBfff
Z?dEdF�Z@d1ZAd)ZBd.ZCd2ZDdZEdZFdZGd-ZHdZId4ZJdZKdZLd*ZMd+ZNdZOd,ZPd3ZQzddGlRTWneSk
�rBYnXdHS)I����������	cCs|d@S)Ni����moderr�/usr/lib64/python3.8/stat.py�S_IMODEsrcCs|d@S)Ni�rrrrr�S_IFMTsri@i i`i�ii�i�cCst|�tkS�N)r�S_IFDIRrrrr�S_ISDIR2srcCst|�tkSr)r�S_IFCHRrrrr�S_ISCHR6srcCst|�tkSr)r�S_IFBLKrrrr�S_ISBLK:srcCst|�tkSr)r�S_IFREGrrrr�S_ISREG>srcCst|�tkSr)r�S_IFIFOrrrr�S_ISFIFOBsrcCst|�tkSr)r�S_IFLNKrrrr�S_ISLNKFsrcCst|�tkSr)r�S_IFSOCKrrrr�S_ISSOCKJsrcCsdS�NFrrrrr�S_ISDOORNsr!cCsdSr rrrrr�S_ISPORTRsr"cCsdSr rrrrr�S_ISWHTVsr#iii���@i��8� �iiiii �l�s�-�b�d�c�p�r�w�S�x�t�TcCsJg}tD]6}|D]"\}}||@|kr|�|�qq|�d�qd�|�S)Nr,�)�_filemode_table�append�join)r
Zperm�table�bit�charrrr�filemode�s
r>)�*N)T�ST_MODE�ST_INO�ST_DEV�ST_NLINK�ST_UID�ST_GID�ST_SIZE�ST_ATIME�ST_MTIME�ST_CTIMErrrrrrrrr�S_IFDOOR�S_IFPORT�S_IFWHTrrrrrrrr!r"r#�S_ISUID�S_ISGID�S_ENFMT�S_ISVTX�S_IREAD�S_IWRITE�S_IEXEC�S_IRWXU�S_IRUSR�S_IWUSR�S_IXUSR�S_IRWXG�S_IRGRP�S_IWGRP�S_IXGRP�S_IRWXO�S_IROTH�S_IWOTH�S_IXOTH�	UF_NODUMP�UF_IMMUTABLE�	UF_APPEND�	UF_OPAQUE�UF_NOUNLINK�
UF_COMPRESSED�	UF_HIDDEN�SF_ARCHIVED�SF_IMMUTABLE�	SF_APPEND�SF_NOUNLINK�SF_SNAPSHOTr8r>�FILE_ATTRIBUTE_ARCHIVE�FILE_ATTRIBUTE_COMPRESSED�FILE_ATTRIBUTE_DEVICE�FILE_ATTRIBUTE_DIRECTORY�FILE_ATTRIBUTE_ENCRYPTED�FILE_ATTRIBUTE_HIDDEN�FILE_ATTRIBUTE_INTEGRITY_STREAM�FILE_ATTRIBUTE_NORMAL�"FILE_ATTRIBUTE_NOT_CONTENT_INDEXED�FILE_ATTRIBUTE_NO_SCRUB_DATA�FILE_ATTRIBUTE_OFFLINE�FILE_ATTRIBUTE_READONLY�FILE_ATTRIBUTE_REPARSE_POINT�FILE_ATTRIBUTE_SPARSE_FILE�FILE_ATTRIBUTE_SYSTEM�FILE_ATTRIBUTE_TEMPORARY�FILE_ATTRIBUTE_VIRTUAL�_stat�ImportErrorrrrr�<module>s�	�
�
�
��__pycache__/_dummy_thread.cpython-38.opt-1.pyc000064400000013627151153537560015210 0ustar00U

e5d��@s�dZddddddddgZd	ZeZifd
d�Zdd�Zdd�Zd
d�Zddd�Z	dd�Z
Gdd�de�ZGdd�de�Z
dadadd�ZdS)a/Drop-in replacement for the thread module.

Meant to be used as a brain-dead substitute so that threaded code does
not need to be rewritten for when the thread module is not present.

Suggested usage is::

    try:
        import _thread
    except ImportError:
        import _dummy_thread as _thread

�error�start_new_thread�exit�	get_ident�
allocate_lock�interrupt_main�LockType�RLocklcCs�t|�tt��krtd��t|�tt��kr4td��daz|||�Wn.tk
rZYnddl}|��YnXdatr�dat	�dS)a�Dummy implementation of _thread.start_new_thread().

    Compatibility is maintained by making sure that ``args`` is a
    tuple and ``kwargs`` is a dictionary.  If an exception is raised
    and it is SystemExit (which can be done by _thread.exit()) it is
    caught and nothing is done; all other exceptions are printed out
    by using traceback.print_exc().

    If the executed function calls interrupt_main the KeyboardInterrupt will be
    raised when the function returns.

    z2nd arg must be a tuplez3rd arg must be a dictF�NT)
�type�tuple�	TypeError�dict�_main�
SystemExit�	traceback�	print_exc�
_interrupt�KeyboardInterrupt)Zfunction�args�kwargsr�r�%/usr/lib64/python3.8/_dummy_thread.pyrs 
cCst�dS)z'Dummy implementation of _thread.exit().N)rrrrrr=scCsdS)z�Dummy implementation of _thread.get_ident().

    Since this module should only be used when _threadmodule is not
    available, it is safe to assume that the current process is the
    only thread.  Thus a constant can be safely returned.
    �rrrrrrAscCst�S)z0Dummy implementation of _thread.allocate_lock().�rrrrrrJsNcCs|dk	rtd��dS)z-Dummy implementation of _thread.stack_size().Nz'setting thread stack size not supportedr	)r)�sizerrr�
stack_sizeNsrcCst�S)z0Dummy implementation of _thread._set_sentinel().rrrrr�
_set_sentinelTsrc@sFeZdZdZdd�Zddd�ZeZdd	�Zd
d�Zdd
�Z	dd�Z
dS)ra�Class implementing dummy implementation of _thread.LockType.

    Compatibility is maintained by maintaining self.locked_status
    which is a boolean that stores the state of the lock.  Pickling of
    the lock, though, should not be done since if the _thread module is
    then used with an unpickled ``lock()`` from here problems could
    occur from this class not having atomic methods.

    cCs
d|_dS)NF��
locked_status��selfrrr�__init__cszLockType.__init__N���cCsH|dks|rd|_dS|js&d|_dS|dkr@ddl}|�|�dSdS)a�Dummy implementation of acquire().

        For blocking calls, self.locked_status is automatically set to
        True and returned appropriately based on value of
        ``waitflag``.  If it is non-blocking, then the value is
        actually checked and not set if it is already acquired.  This
        is all done so that threading.Condition's assert statements
        aren't triggered and throw a little fit.

        NTr	F)r�time�sleep)r �waitflag�timeoutr#rrr�acquirefs
zLockType.acquirecCs|��dS�N)�release)r �typ�val�tbrrr�__exit__�szLockType.__exit__cCs|js
t�d|_dS)zRelease the dummy lock.FT)rrrrrrr)�szLockType.releasecCs|jSr(rrrrr�locked�szLockType.lockedcCs*d|jrdnd|jj|jjtt|��fS)Nz<%s %s.%s object at %s>r.Zunlocked)r�	__class__�
__module__�__qualname__�hex�idrrrr�__repr__�s
�zLockType.__repr__)Nr")�__name__r0r1�__doc__r!r'�	__enter__r-r)r.r4rrrrrXs

	cs:eZdZdZ�fdd�Zd
�fdd�	Z�fdd	�Z�ZS)raDummy implementation of threading._RLock.

    Re-entrant lock can be aquired multiple times and needs to be released
    just as many times. This dummy implemention does not check wheter the
    current thread actually owns the lock, but does accounting on the call
    counts.
    cst���d|_dS)Nr	)�superr!�_levelsr�r/rrr!�s
zRLock.__init__Nr"cs$t��||�}|r |jd7_|S)zEAquire the lock, can be called multiple times in succession.
        r)r8r'r9)r r%r&r.r:rrr'�sz
RLock.acquirecs4|jdkrt�|jdkr"t���|jd8_dS)zERelease needs to be called once for every call to acquire().
        r	rN)r9rr8r)rr:rrr)�s



z
RLock.release)Nr")r5r0r1r6r!r'r)�
__classcell__rrr:rr�sFTcCstr
t�ndadS)z^Set _interrupt flag to True to have start_new_thread raise
    KeyboardInterrupt upon exiting.TN)rrrrrrrr�s)N)r6�__all__�TIMEOUT_MAX�RuntimeErrorrrrrrrr�objectrrrrrrrrr�<module>s$
� 	
@__pycache__/lzma.cpython-38.pyc000064400000027364151153537560012376 0ustar00U

e5d�2�$@s�dZddddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$g$Zd%d&lZd%d&lZd%d&lZd%d'lTd%d(lmZmZd%d&lZd%Z	d)Z
d*ZGd+d�dej�Z
d2d&d-d&d&d&d&d&d.�d/d!�Zed-d&d&fd0d"�Zed&d&fd1d#�Zd&S)3aSInterface to the liblzma compression library.

This module provides a class for reading and writing compressed files,
classes for incremental (de)compression, and convenience functions for
one-shot (de)compression.

These classes and functions support both the XZ and legacy LZMA
container formats, as well as raw compressed data streams.
Z
CHECK_NONEZCHECK_CRC32ZCHECK_CRC64ZCHECK_SHA256ZCHECK_ID_MAXZ
CHECK_UNKNOWNZFILTER_LZMA1ZFILTER_LZMA2ZFILTER_DELTAZ
FILTER_X86ZFILTER_IA64Z
FILTER_ARMZFILTER_ARMTHUMBZFILTER_POWERPCZFILTER_SPARC�FORMAT_AUTO�	FORMAT_XZZFORMAT_ALONEZ
FORMAT_RAWZMF_HC3ZMF_HC4ZMF_BT2ZMF_BT3ZMF_BT4Z	MODE_FASTZMODE_NORMALZPRESET_DEFAULTZPRESET_EXTREME�LZMACompressor�LZMADecompressor�LZMAFile�	LZMAError�open�compress�
decompressZis_check_supported�N)�*)�_encode_filter_properties�_decode_filter_properties��c@s�eZdZdZd"ddddd�dd�Zdd	�Zed
d��Zdd
�Zdd�Z	dd�Z
dd�Zd#dd�Zd$dd�Z
d%dd�Zd&dd�Zdd�Zejfdd�Zd d!�ZdS)'ra@A file object providing transparent LZMA (de)compression.

    An LZMAFile can act as a wrapper for an existing file object, or
    refer directly to a named file on disk.

    Note that LZMAFile provides a *binary* file interface - data read
    is returned as bytes, and data to be written must be given as bytes.
    N�r�����format�check�preset�filtersc	Cs&d|_d|_t|_|dkrL|dkr*td��|dk	r:td��|dkrFt}t}n@|dkr~|dkr`t}t}t	||||d�|_
d	|_ntd
�|���t
|tttjf�r�d|kr�|d7}t�||�|_d|_||_n*t|d
�s�t|d�r�||_||_ntd��|jtk�r"tj|jtt||d�}t�|�|_dS)a�Open an LZMA-compressed file in binary mode.

        filename can be either an actual file name (given as a str,
        bytes, or PathLike object), in which case the named file is
        opened, or it can be an existing file object to read from or
        write to.

        mode can be "r" for reading (default), "w" for (over)writing,
        "x" for creating exclusively, or "a" for appending. These can
        equivalently be given as "rb", "wb", "xb" and "ab" respectively.

        format specifies the container format to use for the file.
        If mode is "r", this defaults to FORMAT_AUTO. Otherwise, the
        default is FORMAT_XZ.

        check specifies the integrity check to use. This argument can
        only be used when opening a file for writing. For FORMAT_XZ,
        the default is CHECK_CRC64. FORMAT_ALONE and FORMAT_RAW do not
        support integrity checks - for these formats, check must be
        omitted, or be CHECK_NONE.

        When opening a file for reading, the *preset* argument is not
        meaningful, and should be omitted. The *filters* argument should
        also be omitted, except when format is FORMAT_RAW (in which case
        it is required).

        When opening a file for writing, the settings used by the
        compressor can be specified either as a preset compression
        level (with the *preset* argument), or in detail as a custom
        filter chain (with the *filters* argument). For FORMAT_XZ and
        FORMAT_ALONE, the default is to use the PRESET_DEFAULT preset
        level. For FORMAT_RAW, the caller must always specify a filter
        chain; the raw compressor does not support preset compression
        levels.

        preset (if provided) should be an integer in the range 0-9,
        optionally OR-ed with the constant PRESET_EXTREME.

        filters (if provided) should be a sequence of dicts. Each dict
        should have an entry for "id" indicating ID of the filter, plus
        additional entries for options to the filter.
        NF)r�rbrzACannot specify an integrity check when opening a file for readingzICannot specify a preset compression level when opening a file for reading)�w�wb�aZab�xZxbrr
zInvalid mode: {!r}�bT�read�writez6filename must be a str, bytes, file or PathLike object)Ztrailing_errorrr)�_fp�_closefp�_MODE_CLOSED�_mode�
ValueErrorr�
_MODE_READr�_MODE_WRITEr�_compressor�_posr�
isinstance�str�bytes�os�PathLike�builtinsr�hasattr�	TypeError�_compressionZDecompressReaderrr�io�BufferedReader�_buffer)	�self�filename�moderrrrZ	mode_code�raw�r8�/usr/lib64/python3.8/lzma.py�__init__1sL,�
�zLZMAFile.__init__cCs�|jtkrdSzB|jtkr,|j��d|_n"|jtkrN|j�|j	�
��d|_	W5z|jrd|j��W5d|_d|_t|_XXdS)z�Flush and close the file.

        May be called more than once without error. Once the file is
        closed, any other operation on it will raise a ValueError.
        NF)r"r!rr �closer$r3r%rr&�flush�r4r8r8r9r;�s




zLZMAFile.closecCs
|jtkS)zTrue if this file is closed.)r"r!r=r8r8r9�closed�szLZMAFile.closedcCs|��|j��S)z3Return the file descriptor for the underlying file.)�_check_not_closedr�filenor=r8r8r9r@�szLZMAFile.filenocCs|��o|j��S)z)Return whether the file supports seeking.)�readabler3�seekabler=r8r8r9rB�szLZMAFile.seekablecCs|��|jtkS)z/Return whether the file was opened for reading.)r?r"r$r=r8r8r9rA�szLZMAFile.readablecCs|��|jtkS)z/Return whether the file was opened for writing.)r?r"r%r=r8r8r9�writable�szLZMAFile.writablecCs|��|j�|�S)z�Return buffered data without advancing the file position.

        Always returns at least one byte of data, unless at EOF.
        The exact number of bytes returned is unspecified.
        )�_check_can_readr3�peek�r4�sizer8r8r9rE�sz
LZMAFile.peekcCs|��|j�|�S)z�Read up to size uncompressed bytes from the file.

        If size is negative or omitted, read until EOF is reached.
        Returns b"" if the file is already at EOF.
        )rDr3rrFr8r8r9r�sz
LZMAFile.readcCs"|��|dkrtj}|j�|�S)z�Read up to size uncompressed bytes, while trying to avoid
        making multiple reads from the underlying stream. Reads up to a
        buffer's worth of data if size is negative.

        Returns b"" if the file is at EOF.
        r
)rDr1�DEFAULT_BUFFER_SIZEr3�read1rFr8r8r9rI�szLZMAFile.read1cCs|��|j�|�S)a
Read a line of uncompressed bytes from the file.

        The terminating newline (if present) is retained. If size is
        non-negative, no more than size bytes will be read (in which
        case the line may be incomplete). Returns b'' if already at EOF.
        )rDr3�readlinerFr8r8r9rJ�szLZMAFile.readlinecCs:|��|j�|�}|j�|�|jt|�7_t|�S)z�Write a bytes object to the file.

        Returns the number of uncompressed bytes written, which is
        always len(data). Note that due to buffering, the file on disk
        may not reflect the data written until close() is called.
        )Z_check_can_writer&rrrr'�len)r4�dataZ
compressedr8r8r9r�s
zLZMAFile.writecCs|��|j�||�S)a�Change the file position.

        The new position is specified by offset, relative to the
        position indicated by whence. Possible values for whence are:

            0: start of stream (default): offset must not be negative
            1: current stream position
            2: end of stream; offset must not be positive

        Returns the new file position.

        Note that seeking is emulated, so depending on the parameters,
        this operation may be extremely slow.
        )Z_check_can_seekr3�seek)r4�offset�whencer8r8r9rM�sz
LZMAFile.seekcCs"|��|jtkr|j��S|jS)z!Return the current file position.)r?r"r$r3�tellr'r=r8r8r9rP�s

z
LZMAFile.tell)Nr)r)r)r)r)�__name__�
__module__�__qualname__�__doc__r:r;�propertyr>r@rBrArCrErrIrJrr1�SEEK_SETrMrPr8r8r8r9r&s*	�U


	



rr)rrrr�encoding�errors�newlinecCs�d|kr d|krPtd|f��n0|dk	r0td��|dk	r@td��|dk	rPtd��|�dd�}	t||	||||d	�}
d|kr�t�|
|||�S|
SdS)
a�Open an LZMA-compressed file in binary or text mode.

    filename can be either an actual file name (given as a str, bytes,
    or PathLike object), in which case the named file is opened, or it
    can be an existing file object to read from or write to.

    The mode argument can be "r", "rb" (default), "w", "wb", "x", "xb",
    "a", or "ab" for binary mode, or "rt", "wt", "xt", or "at" for text
    mode.

    The format, check, preset and filters arguments specify the
    compression settings, as for LZMACompressor, LZMADecompressor and
    LZMAFile.

    For binary mode, this function is equivalent to the LZMAFile
    constructor: LZMAFile(filename, mode, ...). In this case, the
    encoding, errors and newline arguments must not be provided.

    For text mode, an LZMAFile object is created, and wrapped in an
    io.TextIOWrapper instance with the specified encoding, error
    handling behavior, and line ending(s).

    �trzInvalid mode: %rNz0Argument 'encoding' not supported in binary modez.Argument 'errors' not supported in binary modez/Argument 'newline' not supported in binary mode�r)r#�replacerr1�
TextIOWrapper)r5r6rrrrrWrXrYZlz_modeZbinary_filer8r8r9rs"
�cCs t||||�}|�|�|��S)z�Compress a block of data.

    Refer to LZMACompressor's docstring for a description of the
    optional arguments *format*, *check*, *preset* and *filters*.

    For incremental compression, use an LZMACompressor instead.
    )rrr<)rLrrrr�compr8r8r9r6scCspg}t|||�}z|�|�}Wn tk
r>|r8Yqfn�YnX|�|�|jsXtd��|j}|sqfqd�|�S)z�Decompress a block of data.

    Refer to LZMADecompressor's docstring for a description of the
    optional arguments *format*, *check* and *filters*.

    For incremental decompression, use an LZMADecompressor instead.
    zACompressed data ended before the end-of-stream marker was reached�)rr	r�append�eofZunused_data�join)rLrZmemlimitrZresultsZdecomp�resr8r8r9r	Bs
)r)rT�__all__r-r1r+Z_lzmarr
r0r!r$r%Z
BaseStreamrrrrrr	r8r8r8r9�<module>sv�
b�/__pycache__/pickletools.cpython-38.opt-2.pyc000064400000157607151153537560014727 0ustar00U

e5d.m�L@s�
ddlZddlZddlZddlZddlZdddgZejZdZdZdZ	dZ
d	ZGd
d�de�Z
ddlmZd
d�Ze
ddedd�Zdd�Ze
ddedd�Zdd�Ze
ddedd�Zdd�Ze
dded d�Zd!d"�Ze
d#d$ed%d�Z�d�d'd(�Ze
d)eed*d�Zd+d,�Ze
d-eed.d�Zd/d0�Ze
d1eed2d�Z d3d4�Z!e
d5ee!d6d�Z"d7d8�Z#e
d9e	e#d:d�Z$d;d<�Z%e
d=ee%d>d�Z&d?d@�Z'e
dAe
e'dBd�Z(dCdD�Z)e
dEee)dFd�Z*dGdH�Z+e
dIee+dJd�Z,dKdL�Z-e
dMee-dNd�Z.dOdP�Z/e
dQee/dRd�Z0dSdT�Z1e
dUe
e1dVd�Z2dWdX�Z3e
dYee3dZd�Z4d[d\�Z5d]d^�Z6e
d_ee5d`d�Z7e
daee6dbd�Z8dcdd�Z9e
deee9dfd�Z:dgdh�Z;e
did$e;djd�Z<ddklm=Z=dldm�Z>e
dnee>dod�Z?dpdq�Z@e
dre	e@dsd�ZAGdtdu�due�ZBeBdveCdwdx�ZDZEeBdyeCeFfdzdx�ZGeBd{eFd|dx�ZHeBd}eId~dx�ZJeBdeKeLfd�dx�ZMZNeBd�eKd�dx�ZOeBd�ePd�dx�ZQeBd�eLd�dx�ZReBd�eSd�d�dx�ZTeBd�eUd�dx�ZVeBd�eWd�dx�ZXeBd�eYd�dx�ZZeBd�e[d�dx�Z\eBd�e[d�dx�Z]eBd�ed�dx�Z^eBd�ed�dx�Z_eBd�eBd�dx�Z`eBd�eBd�dx�ZaGd�d��d�e�ZbebZcecd�d�e7geGgdd�d��ecd�d�egeDgdd�d��ecd�d�egeDgdd�d��ecd�d�egeDgdd�d��ecd�d�e8geDgdd�d��ecd�d�e?geDgdd�d��ecd�d�eAgeDgdd�d��ecd�d�egeMgdd�d��ecd�d�e$geMgdd�d��ecd�d�e"geMgdd�d��ecd�d�e(geOgd�d�d��ecd�d�e&geOgd�d�d��ecd�d�e*geOgdd�d��ecd�d�e,geQgd�d�d��ecd�d�dge^gd�d�d��ecd�d�de^ge^gd�d�d��ecd�d�dgeTgdd�d��ecd�d�dgeHgdd�d��ecd�d�dgeHgdd�d��ecd�d�e.geRgdd�d��ecd�d�e0geRgdd�d��ecd�d�e2geRgdd�d��ecd�d�e4geRgdd�d��ecd�d�e:geJgdd�d��ecd�d�e<geJgdd�d��ecd�d�dgeXgdd�d��ecd�d�deXe_geXgdd�d��ecd�d�deXe`eageXgdd�d��ecd�d�de`eageXgdd�d��ecd�d�dgeVgdd�d��ecd�d�de`eageVgdd�d��ecd�d�de_geVgdd�d��ec�d�dde_e_geVgd�dd��ec�d�dde_e_e_geVgd�dd��ec�d�ddgeZgd�dd��ec�d	�d
de`eageZgd�dd��ec�d�d
deZe_e_geZgd�dd��ec�d�ddeZe`eageZgd�dd��ec�d�ddge\gd�dd��ec�d�dde\e`eage\gd�dd��ec�d�dde`eage]gd�dd��ec�d�dde_ggd�dd��ec�d�dde_ge_e_gd�d d��ec�d!�d"dge`gd�d#d��ec�d$�d%de`eaggd�d&d��ec�d'�d(e7ge_gd�d)d��ec�d*�d+ege_gd�d,d��ec�d-�d.ege_gd�d/d��ec�d0�d1e7ggd�d2d��ec�d3�d4eggd�d5d��ec�d6�d7eggd�d8d��ec�d9�d:de_ge_gd�d;d��ec�d<�d=ege_gd�d>d��ec�d?�d@ege_gd�dAd��ec�dB�dCege_gd�dDd��ec�dE�dFe ge_gd�dGd��ec�dH�dIdeReRge_gd�dJd��ec�dK�dLde_e_ge_gd�dMd��ec�dN�dOde_e_ge_gd�dPd��ec�dQ�dRe e`eage_gd�dSd��ec�dT�dUde`e_eage_gd�dVd��ec�dW�dXde_e_ge_gd�dYd��ec�dZ�d[de_e_e_ge_gd�d\d��ec�d]�d^eggd�d_d��ec�d`�dade_ggd�dbd��ec�dc�ddeggd�ded��ec�df�dgege_gd�dhd��ec�di�djde_ge_gd�dkd��gDZd[ciZeiZfeged�D]n\ZhZieijjeek�r<ek�dleijjeeeijjehf��eijlefk�rdek�dmeijlefeijlehf��eheeeijj<ehefeijl<�q[e[f[h[iiZmedD]Zieiemeijl<�q�[i�d��do�dp�Znen�[n�d��dq�dr�Zo�dsd�Zp�dtd�Zq�d��dud�ZrG�dv�dw��dw�Zs�dxZt�dyZueteu�dz�Zv�d{�d|�Zwex�d}k�
r�ddlyZyeyjz�d~�d�Z{e{j|�d�ey�}�d���d��d��d��e{j|�d��d�ej~ey�}�d���d��d��e{j|�d��d��d��d��d��e{j|�d��d�deC�d��d��e{j|�d��d��d��d��d��e{j|�d��d��d��d��d��e{j|�d��d��d��d��d��e{j|�d��d��d��d��e{��Z�e�j��
rJew�n�e�j��
rX�d�ndZ�e�j��
sne{���n�e�e�j��dk�
r�ere�j�de�j�de�j�e��nVe�j��
r�indZ�e�j�D]>Z�e�j�j�e�jj�d��Z�e�j���e��d��ere�e�j�e�e�j�e���
q�dS(��N�dis�genops�optimize���������������c@seZdZdZdd�ZdS)�ArgumentDescriptor��name�n�reader�doccCs||_||_||_||_dS�Nr)�selfrr
rr�r�#/usr/lib64/python3.8/pickletools.py�__init__�szArgumentDescriptor.__init__N��__name__�
__module__�__qualname__�	__slots__rrrrrr
�sr
)�unpackcCs"|�d�}|r|dStd��dS)N�rz'not enough data in stream to read uint1)�read�
ValueError��f�datarrr�
read_uint1�s
r!�uint1rzOne-byte unsigned integer.rcCs0|�d�}t|�dkr$td|�dStd��dS)N�z<Hrz'not enough data in stream to read uint2�r�len�_unpackrrrrr�
read_uint2�s	
r'�uint2r#z)Two-byte unsigned integer, little-endian.cCs0|�d�}t|�dkr$td|�dStd��dS)N�z<irz&not enough data in stream to read int4r$rrrr�	read_int4�s	
r*�int4r)z8Four-byte signed integer, little-endian, 2's complement.cCs0|�d�}t|�dkr$td|�dStd��dS)Nr)z<Irz'not enough data in stream to read uint4r$rrrr�
read_uint4s	
r,�uint4z*Four-byte unsigned integer, little-endian.cCs0|�d�}t|�dkr$td|�dStd��dS)N�z<Qrz'not enough data in stream to read uint8r$rrrr�
read_uint8&s	
r/�uint8r.z+Eight-byte unsigned integer, little-endian.TcCs�|��}|�d�std��|dd�}|rtdD]8}|�|�r.|�|�sVtd||f��|dd�}qtq.td|��|r�t�|�d�d	�}|S)
N�
z-no newline found when trying to read stringnlr)�"�'z,strinq quote %r not found at both ends of %rrzno string quotes around %rr�ascii)�readline�endswithr�
startswith�codecs�
escape_decode�decode)rr:�stripquotesr �qrrr�
read_stringnl;s"


�r=�stringnlz�A newline-terminated string.

                   This is a repr-style string, with embedded escapes, and
                   bracketing quotes.
                   cCst|dd�S)NF)r;)r=�rrrr�read_stringnl_noescapetsr@�stringnl_noescapeaA newline-terminated string.

                        This is a str-style string, without embedded escapes,
                        or bracketing quotes.  It should consist solely of
                        printable ASCII characters.
                        cCsdt|�t|�fS)Nz%s %s)r@r?rrr�read_stringnl_noescape_pair�srB�stringnl_noescape_paira�A pair of newline-terminated strings.

                             These are str-style strings, without embedded
                             escapes, or bracketing quotes.  They should
                             consist solely of printable ASCII characters.
                             The pair is returned as a single string, with
                             a single blank separating the two strings.
                             cCs@t|�}|�|�}t|�|kr(|�d�Std|t|�f��dS)N�latin-1z2expected %d bytes in a string1, but only %d remain)r!rr%r:r�rr
r rrr�read_string1�s	


�rF�string1z�A counted string.

              The first argument is a 1-byte unsigned int giving the number
              of bytes in the string, and the second argument is that many
              bytes.
              cCsTt|�}|dkrtd|��|�|�}t|�|kr<|�d�Std|t|�f��dS)Nrzstring4 byte count < 0: %drDz2expected %d bytes in a string4, but only %d remain)r*rrr%r:rErrr�read_string4�s



�rH�string4z�A counted string.

              The first argument is a 4-byte little-endian signed int giving
              the number of bytes in the string, and the second argument is
              that many bytes.
              cCs:t|�}|�|�}t|�|kr"|Std|t|�f��dS)Nz1expected %d bytes in a bytes1, but only %d remain)r!rr%rrErrr�read_bytes1�s	

�rJ�bytes1z�A counted bytes string.

              The first argument is a 1-byte unsigned int giving the number
              of bytes, and the second argument is that many bytes.
              cCsPt|�}|tjkrtd|��|�|�}t|�|kr8|Std|t|�f��dS)Nz#bytes4 byte count > sys.maxsize: %dz1expected %d bytes in a bytes4, but only %d remain)r,�sys�maxsizerrr%rErrr�read_bytes4�s



�rN�bytes4z�A counted bytes string.

              The first argument is a 4-byte little-endian unsigned int giving
              the number of bytes, and the second argument is that many bytes.
              cCsPt|�}|tjkrtd|��|�|�}t|�|kr8|Std|t|�f��dS)Nz#bytes8 byte count > sys.maxsize: %dz1expected %d bytes in a bytes8, but only %d remain)r/rLrMrrr%rErrr�read_bytes8s


�rP�bytes8z�A counted bytes string.

              The first argument is an 8-byte little-endian unsigned int giving
              the number of bytes, and the second argument is that many bytes.
              cCsTt|�}|tjkrtd|��|�|�}t|�|kr<t|�Std|t|�f��dS)Nz'bytearray8 byte count > sys.maxsize: %dz5expected %d bytes in a bytearray8, but only %d remain)r/rLrMrrr%�	bytearrayrErrr�read_bytearray89s


�rS�
bytearray8z�A counted bytearray.

              The first argument is an 8-byte little-endian unsigned int giving
              the number of bytes, and the second argument is that many bytes.
              cCs0|��}|�d�std��|dd�}t|d�S)Nr1z4no newline found when trying to read unicodestringnlrzraw-unicode-escape)r5r6r�strrrrr�read_unicodestringnl[s

rV�unicodestringnlz�A newline-terminated Unicode string.

                      This is raw-unicode-escape encoded, so consists of
                      printable ASCII characters, and may contain embedded
                      escape sequences.
                      cCsBt|�}|�|�}t|�|kr*t|dd�Std|t|�f��dS)N�utf-8�
surrogatepassz9expected %d bytes in a unicodestring1, but only %d remain)r!rr%rUrrErrr�read_unicodestring1us

�rZ�unicodestring1aAA counted Unicode string.

                    The first argument is a 1-byte little-endian signed int
                    giving the number of bytes in the string, and the second
                    argument-- the UTF-8 encoding of the Unicode string --
                    contains that many bytes.
                    cCsXt|�}|tjkrtd|��|�|�}t|�|kr@t|dd�Std|t|�f��dS)Nz+unicodestring4 byte count > sys.maxsize: %drXrYz9expected %d bytes in a unicodestring4, but only %d remain)r,rLrMrrr%rUrErrr�read_unicodestring4�s


�r\�unicodestring4aAA counted Unicode string.

                    The first argument is a 4-byte little-endian signed int
                    giving the number of bytes in the string, and the second
                    argument-- the UTF-8 encoding of the Unicode string --
                    contains that many bytes.
                    cCsXt|�}|tjkrtd|��|�|�}t|�|kr@t|dd�Std|t|�f��dS)Nz+unicodestring8 byte count > sys.maxsize: %drXrYz9expected %d bytes in a unicodestring8, but only %d remain)r/rLrMrrr%rUrErrr�read_unicodestring8�s


�r^�unicodestring8aBA counted Unicode string.

                    The first argument is an 8-byte little-endian signed int
                    giving the number of bytes in the string, and the second
                    argument-- the UTF-8 encoding of the Unicode string --
                    contains that many bytes.
                    cCs.t|ddd�}|dkrdS|dkr&dSt|�S)NF�r:r;s00s01T�r=�int�r�srrr�read_decimalnl_short�srecCs2t|ddd�}|dd�dkr*|dd�}t|�S)NFr`r�Lrarcrrr�read_decimalnl_longsrg�decimalnl_shorta�A newline-terminated decimal integer literal.

                          This never has a trailing 'L', and the integer fit
                          in a short Python int on the box where the pickle
                          was written -- but there's no guarantee it will fit
                          in a short Python int on the box where the pickle
                          is read.
                          �decimalnl_longz�A newline-terminated decimal integer literal.

                         This has a trailing 'L', and can represent integers
                         of any size.
                         cCst|ddd�}t|�S)NFr`)r=�floatrcrrr�read_floatnl-srk�floatnla�A newline-terminated decimal floating literal.

              In general this requires 17 significant digits for roundtrip
              identity, and pickling then unpickling infinities, NaNs, and
              minus zero doesn't work across boxes, or on some boxes even
              on itself (e.g., Windows can't read the strings it produces
              for infinities or NaNs).
              cCs0|�d�}t|�dkr$td|�dStd��dS)Nr.z>drz(not enough data in stream to read float8r$rrrr�read_float8Cs

rm�float8aAn 8-byte binary representation of a float, big-endian.

             The format is unique to Python, and shared with the struct
             module (format string '>d') "in theory" (the struct and pickle
             implementations don't share the code -- they should).  It's
             strongly related to the IEEE-754 double format, and, in normal
             cases, is in fact identical to the big-endian 754 double format.
             On other boxes the dynamic range is limited to that of a 754
             double, and "add a half and chop" rounding is used to reduce
             the precision to 53 bits.  However, even on a 754 box,
             infinities, NaNs, and minus zero may not be handled correctly
             (may not survive roundtrip pickling intact).
             )�decode_longcCs.t|�}|�|�}t|�|kr&td��t|�S)Nz'not enough data in stream to read long1)r!rr%rrorErrr�
read_long1is

rp�long1aA binary long, little-endian, using 1-byte size.

    This first reads one byte as an unsigned size, then reads that
    many bytes and interprets them as a little-endian 2's-complement long.
    If the size is 0, that's taken as a shortcut for the long 0L.
    cCsBt|�}|dkrtd|��|�|�}t|�|kr:td��t|�S)Nrzlong4 byte count < 0: %dz'not enough data in stream to read long4)r*rrr%rorErrr�
read_long4�s
rr�long4a�A binary representation of a long, little-endian.

    This first reads four bytes as a signed size (but requires the
    size to be >= 0), then reads that many bytes and interprets them
    as a little-endian 2's-complement long.  If the size is 0, that's taken
    as a shortcut for the int 0, although LONG1 should really be used
    then instead (and in any case where # of bytes < 256).
    c@s eZdZdZdd�Zdd�ZdS)�StackObject�r�obtypercCs*||_t|t�r|D]}q||_||_dSr)r�
isinstance�tuplervr)rrrvrZ	containedrrrr�s
zStackObject.__init__cCs|jSr�r)rrrr�__repr__�szStackObject.__repr__N)rrrrrrzrrrrrt�s
rtrbzA Python integer object.ruZint_or_boolz#A Python integer or boolean object.�boolzA Python boolean object.rjzA Python float object.Zbytes_or_strz*A Python bytes or (Unicode) string object.�byteszA Python bytes object.rRzA Python bytearray object.rUz!A Python (Unicode) string object.�NonezThe Python None object.rxzA Python tuple object.�listzA Python list object.�dictzA Python dict object.�setzA Python set object.�	frozensetzA Python frozenset object.�bufferzA Python buffer-like object.�anyzAny kind of object whatsoever.Zmarkaz'The mark' is a unique object.

Opcodes that operate on a variable number of objects
generally don't embed the count of objects in the opcode,
or pull it off the stack.  Instead the MARK opcode is used
to push a special marker object on the stack, and then
some other opcodes grab all the objects from the top of
the stack down to (but not including) the topmost marker
object.
�
stackslicea�An object representing a contiguous slice of the stack.

This is used in conjunction with markobject, to represent all
of the stack following the topmost markobject.  For example,
the POP_MARK opcode changes the stack from

    [..., markobject, stackslice]
to
    [...]

No matter how many object are on the stack after the topmost
markobject, POP_MARK gets rid of all of them (including the
topmost markobject too).
c@seZdZdZdd�ZdS)�
OpcodeInfo�r�code�arg�stack_before�stack_after�protorc	CsB||_||_||_|D]}q||_|D]}q&||_||_||_dSrr�)	rrr�r�r�r�r�r�xrrrrdszOpcodeInfo.__init__Nrrrrrr�Esr�ZINT�Ia�Push an integer or bool.

      The argument is a newline-terminated decimal literal string.

      The intent may have been that this always fit in a short Python int,
      but INT can be generated in pickles written on a 64-bit box that
      require a Python long on a 32-bit box.  The difference between this
      and LONG then is that INT skips a trailing 'L', and produces a short
      int whenever possible.

      Another difference is due to that, when bool was introduced as a
      distinct type in 2.3, builtin names True and False were also added to
      2.2.2, mapping to ints 1 and 0.  For compatibility in both directions,
      True gets pickled as INT + "I01\n", and False as INT + "I00\n".
      Leading zeroes are never produced for a genuine integer.  The 2.3
      (and later) unpicklers special-case these and return bool instead;
      earlier unpicklers ignore the leading "0" and return the int.
      r�ZBININT�Ja1Push a four-byte signed integer.

      This handles the full range of Python (short) integers on a 32-bit
      box, directly as binary bytes (1 for the opcode and 4 for the integer).
      If the integer is non-negative and fits in 1 or 2 bytes, pickling via
      BININT1 or BININT2 saves space.
      ZBININT1�Kz�Push a one-byte unsigned integer.

      This is a space optimization for pickling very small non-negative ints,
      in range(256).
      ZBININT2�Mz�Push a two-byte unsigned integer.

      This is a space optimization for pickling small positive ints, in
      range(256, 2**16).  Integers in range(256) can also be pickled via
      BININT2, but BININT1 instead saves a byte.
      ZLONG�La�Push a long integer.

      The same as INT, except that the literal ends with 'L', and always
      unpickles to a Python long.  There doesn't seem a real purpose to the
      trailing 'L'.

      Note that LONG takes time quadratic in the number of digits when
      unpickling (this is simply due to the nature of decimal->binary
      conversion).  Proto 2 added linear-time (in C; still quadratic-time
      in Python) LONG1 and LONG4 opcodes.
      ZLONG1�Šz|Long integer using one-byte length.

      A more efficient encoding of a Python long; the long1 encoding
      says it all.ZLONG4�‹z~Long integer using found-byte length.

      A more efficient encoding of a Python long; the long4 encoding
      says it all.�STRING�Sa�Push a Python string object.

      The argument is a repr-style string, with bracketing quote characters,
      and perhaps embedded escapes.  The argument extends until the next
      newline character.  These are usually decoded into a str instance
      using the encoding given to the Unpickler constructor. or the default,
      'ASCII'.  If the encoding given was 'bytes' however, they will be
      decoded as bytes object instead.
      Z	BINSTRING�Ta�Push a Python string object.

      There are two arguments: the first is a 4-byte little-endian
      signed int giving the number of bytes in the string, and the
      second is that many bytes, which are taken literally as the string
      content.  These are usually decoded into a str instance using the
      encoding given to the Unpickler constructor. or the default,
      'ASCII'.  If the encoding given was 'bytes' however, they will be
      decoded as bytes object instead.
      ZSHORT_BINSTRING�Ua�Push a Python string object.

      There are two arguments: the first is a 1-byte unsigned int giving
      the number of bytes in the string, and the second is that many
      bytes, which are taken literally as the string content.  These are
      usually decoded into a str instance using the encoding given to
      the Unpickler constructor. or the default, 'ASCII'.  If the
      encoding given was 'bytes' however, they will be decoded as bytes
      object instead.
      ZBINBYTES�B�z�Push a Python bytes object.

      There are two arguments:  the first is a 4-byte little-endian unsigned int
      giving the number of bytes, and the second is that many bytes, which are
      taken literally as the bytes content.
      ZSHORT_BINBYTES�Cz�Push a Python bytes object.

      There are two arguments:  the first is a 1-byte unsigned int giving
      the number of bytes, and the second is that many bytes, which are taken
      literally as the string content.
      Z	BINBYTES8�Žz�Push a Python bytes object.

      There are two arguments:  the first is an 8-byte unsigned int giving
      the number of bytes in the string, and the second is that many bytes,
      which are taken literally as the string content.
      Z
BYTEARRAY8�–�z�Push a Python bytearray object.

      There are two arguments:  the first is an 8-byte unsigned int giving
      the number of bytes in the bytearray, and the second is that many bytes,
      which are taken literally as the bytearray content.
      ZNEXT_BUFFER�—z"Push an out-of-band buffer object.ZREADONLY_BUFFER�˜z,Make an out-of-band buffer object read-only.ZNONE�NzPush None on the stack.ZNEWTRUE�ˆzPush True onto the stack.ZNEWFALSE�‰zPush False onto the stack.�UNICODE�Vz�Push a Python Unicode string object.

      The argument is a raw-unicode-escape encoding of a Unicode string,
      and so may contain embedded escape sequences.  The argument extends
      until the next newline character.
      ZSHORT_BINUNICODE�ŒaPush a Python Unicode string object.

      There are two arguments:  the first is a 1-byte little-endian signed int
      giving the number of bytes in the string.  The second is that many
      bytes, and is the UTF-8 encoding of the Unicode string.
      Z
BINUNICODE�XaPush a Python Unicode string object.

      There are two arguments:  the first is a 4-byte little-endian unsigned int
      giving the number of bytes in the string.  The second is that many
      bytes, and is the UTF-8 encoding of the Unicode string.
      ZBINUNICODE8�aPush a Python Unicode string object.

      There are two arguments:  the first is an 8-byte little-endian signed int
      giving the number of bytes in the string.  The second is that many
      bytes, and is the UTF-8 encoding of the Unicode string.
      ZFLOAT�Fa�Newline-terminated decimal float literal.

      The argument is repr(a_float), and in general requires 17 significant
      digits for roundtrip conversion to be an identity (this is so for
      IEEE-754 double precision values, which is what Python float maps to
      on most boxes).

      In general, FLOAT cannot be used to transport infinities, NaNs, or
      minus zero across boxes (or even on a single box, if the platform C
      library can't read the strings it produces for such things -- Windows
      is like that), but may do less damage than BINFLOAT on boxes with
      greater precision or dynamic range than IEEE-754 double.
      ZBINFLOAT�Ga�Float stored in binary form, with 8 bytes of data.

      This generally requires less than half the space of FLOAT encoding.
      In general, BINFLOAT cannot be used to transport infinities, NaNs, or
      minus zero, raises an exception if the exponent exceeds the range of
      an IEEE-754 double, and retains no more than 53 bits of precision (if
      there are more than that, "add a half and chop" rounding is used to
      cut it back to 53 significant bits).
      Z
EMPTY_LIST�]zPush an empty list.ZAPPEND�az�Append an object to a list.

      Stack before:  ... pylist anyobject
      Stack after:   ... pylist+[anyobject]

      although pylist is really extended in-place.
      ZAPPENDS�ez�Extend a list by a slice of stack objects.

      Stack before:  ... pylist markobject stackslice
      Stack after:   ... pylist+stackslice

      although pylist is really extended in-place.
      ZLIST�lasBuild a list out of the topmost stack slice, after markobject.

      All the stack entries following the topmost markobject are placed into
      a single Python list, which single list object replaces all of the
      stack from the topmost markobject onward.  For example,

      Stack before: ... markobject 1 2 3 'abc'
      Stack after:  ... [1, 2, 3, 'abc']
      ZEMPTY_TUPLE�)zPush an empty tuple.ZTUPLE�tavBuild a tuple out of the topmost stack slice, after markobject.

      All the stack entries following the topmost markobject are placed into
      a single Python tuple, which single tuple object replaces all of the
      stack from the topmost markobject onward.  For example,

      Stack before: ... markobject 1 2 3 'abc'
      Stack after:  ... (1, 2, 3, 'abc')
      ZTUPLE1�…z�Build a one-tuple out of the topmost item on the stack.

      This code pops one value off the stack and pushes a tuple of
      length 1 whose one item is that value back onto it.  In other
      words:

          stack[-1] = tuple(stack[-1:])
      ZTUPLE2�†aBuild a two-tuple out of the top two items on the stack.

      This code pops two values off the stack and pushes a tuple of
      length 2 whose items are those values back onto it.  In other
      words:

          stack[-2:] = [tuple(stack[-2:])]
      ZTUPLE3�‡aBuild a three-tuple out of the top three items on the stack.

      This code pops three values off the stack and pushes a tuple of
      length 3 whose items are those values back onto it.  In other
      words:

          stack[-3:] = [tuple(stack[-3:])]
      Z
EMPTY_DICT�}zPush an empty dict.ZDICT�da�Build a dict out of the topmost stack slice, after markobject.

      All the stack entries following the topmost markobject are placed into
      a single Python dict, which single dict object replaces all of the
      stack from the topmost markobject onward.  The stack slice alternates
      key, value, key, value, ....  For example,

      Stack before: ... markobject 1 2 3 'abc'
      Stack after:  ... {1: 2, 3: 'abc'}
      ZSETITEMrdz�Add a key+value pair to an existing dict.

      Stack before:  ... pydict key value
      Stack after:   ... pydict

      where pydict has been modified via pydict[key] = value.
      ZSETITEMS�ua\Add an arbitrary number of key+value pairs to an existing dict.

      The slice of the stack following the topmost markobject is taken as
      an alternating sequence of keys and values, added to the dict
      immediately under the topmost markobject.  Everything at and after the
      topmost markobject is popped, leaving the mutated dict at the top
      of the stack.

      Stack before:  ... pydict markobject key_1 value_1 ... key_n value_n
      Stack after:   ... pydict

      where pydict has been modified via pydict[key_i] = value_i for i in
      1, 2, ..., n, and in that order.
      Z	EMPTY_SET�zPush an empty set.ZADDITEMS�a$Add an arbitrary number of items to an existing set.

      The slice of the stack following the topmost markobject is taken as
      a sequence of items, added to the set immediately under the topmost
      markobject.  Everything at and after the topmost markobject is popped,
      leaving the mutated set at the top of the stack.

      Stack before:  ... pyset markobject item_1 ... item_n
      Stack after:   ... pyset

      where pyset has been modified via pyset.add(item_i) = item_i for i in
      1, 2, ..., n, and in that order.
      Z	FROZENSET�‘azBuild a frozenset out of the topmost slice, after markobject.

      All the stack entries following the topmost markobject are placed into
      a single Python frozenset, which single frozenset object replaces all
      of the stack from the topmost markobject onward.  For example,

      Stack before: ... markobject 1 2 3
      Stack after:  ... frozenset({1, 2, 3})
      �POP�0z<Discard the top stack item, shrinking the stack by one item.ZDUP�2z=Push the top stack item onto the stack again, duplicating it.�MARK�(z�Push markobject onto the stack.

      markobject is a unique object, used by other opcodes to identify a
      region of the stack containing a variable number of objects for them
      to work on.  See markobject.doc for more detail.
      ZPOP_MARK�1aPop all the stack objects at and above the topmost markobject.

      When an opcode using a variable number of stack objects is done,
      POP_MARK is used to remove those objects, and to remove the markobject
      that delimited their starting position on the stack.
      �GET�gz�Read an object from the memo and push it on the stack.

      The index of the memo object to push is given by the newline-terminated
      decimal string following.  BINGET and LONG_BINGET are space-optimized
      versions.
      �BINGET�hz�Read an object from the memo and push it on the stack.

      The index of the memo object to push is given by the 1-byte unsigned
      integer following.
      �LONG_BINGET�jz�Read an object from the memo and push it on the stack.

      The index of the memo object to push is given by the 4-byte unsigned
      little-endian integer following.
      �PUT�pz�Store the stack top into the memo.  The stack is not popped.

      The index of the memo location to write into is given by the newline-
      terminated decimal string following.  BINPUT and LONG_BINPUT are
      space-optimized versions.
      �BINPUTr<z�Store the stack top into the memo.  The stack is not popped.

      The index of the memo location to write into is given by the 1-byte
      unsigned integer following.
      �LONG_BINPUT�rz�Store the stack top into the memo.  The stack is not popped.

      The index of the memo location to write into is given by the 4-byte
      unsigned little-endian integer following.
      �MEMOIZE�”z�Store the stack top into the memo.  The stack is not popped.

      The index of the memo location to write is the number of
      elements currently present in the memo.
      ZEXT1�‚a�Extension code.

      This code and the similar EXT2 and EXT4 allow using a registry
      of popular objects that are pickled by name, typically classes.
      It is envisioned that through a global negotiation and
      registration process, third parties can set up a mapping between
      ints and object names.

      In order to guarantee pickle interchangeability, the extension
      code registry ought to be global, although a range of codes may
      be reserved for private use.

      EXT1 has a 1-byte integer argument.  This is used to index into the
      extension registry, and the object at that index is pushed on the stack.
      ZEXT2�ƒzNExtension code.

      See EXT1.  EXT2 has a two-byte integer argument.
      ZEXT4�„zOExtension code.

      See EXT1.  EXT4 has a four-byte integer argument.
      ZGLOBAL�ca�Push a global object (module.attr) on the stack.

      Two newline-terminated strings follow the GLOBAL opcode.  The first is
      taken as a module name, and the second as a class name.  The class
      object module.class is pushed on the stack.  More accurately, the
      object returned by self.find_class(module, class) is pushed on the
      stack, so unpickling subclasses can override this form of lookup.
      ZSTACK_GLOBAL�“z7Push a global object (module.attr) on the stack.
      ZREDUCE�RaLPush an object built from a callable and an argument tuple.

      The opcode is named to remind of the __reduce__() method.

      Stack before: ... callable pytuple
      Stack after:  ... callable(*pytuple)

      The callable and the argument tuple are the first two items returned
      by a __reduce__ method.  Applying the callable to the argtuple is
      supposed to reproduce the original object, or at least get it started.
      If the __reduce__ method returns a 3-tuple, the last component is an
      argument to be passed to the object's __setstate__, and then the REDUCE
      opcode is followed by code to create setstate's argument, and then a
      BUILD opcode to apply  __setstate__ to that argument.

      If not isinstance(callable, type), REDUCE complains unless the
      callable has been registered with the copyreg module's
      safe_constructors dict, or the callable has a magic
      '__safe_for_unpickling__' attribute with a true value.  I'm not sure
      why it does this, but I've sure seen this complaint often enough when
      I didn't want to <wink>.
      ZBUILD�ba�Finish building an object, via __setstate__ or dict update.

      Stack before: ... anyobject argument
      Stack after:  ... anyobject

      where anyobject may have been mutated, as follows:

      If the object has a __setstate__ method,

          anyobject.__setstate__(argument)

      is called.

      Else the argument must be a dict, the object must have a __dict__, and
      the object is updated via

          anyobject.__dict__.update(argument)
      ZINST�iaqBuild a class instance.

      This is the protocol 0 version of protocol 1's OBJ opcode.
      INST is followed by two newline-terminated strings, giving a
      module and class name, just as for the GLOBAL opcode (and see
      GLOBAL for more details about that).  self.find_class(module, name)
      is used to get a class object.

      In addition, all the objects on the stack following the topmost
      markobject are gathered into a tuple and popped (along with the
      topmost markobject), just as for the TUPLE opcode.

      Now it gets complicated.  If all of these are true:

        + The argtuple is empty (markobject was at the top of the stack
          at the start).

        + The class object does not have a __getinitargs__ attribute.

      then we want to create an old-style class instance without invoking
      its __init__() method (pickle has waffled on this over the years; not
      calling __init__() is current wisdom).  In this case, an instance of
      an old-style dummy class is created, and then we try to rebind its
      __class__ attribute to the desired class object.  If this succeeds,
      the new instance object is pushed on the stack, and we're done.

      Else (the argtuple is not empty, it's not an old-style class object,
      or the class object does have a __getinitargs__ attribute), the code
      first insists that the class object have a __safe_for_unpickling__
      attribute.  Unlike as for the __safe_for_unpickling__ check in REDUCE,
      it doesn't matter whether this attribute has a true or false value, it
      only matters whether it exists (XXX this is a bug).  If
      __safe_for_unpickling__ doesn't exist, UnpicklingError is raised.

      Else (the class object does have a __safe_for_unpickling__ attr),
      the class object obtained from INST's arguments is applied to the
      argtuple obtained from the stack, and the resulting instance object
      is pushed on the stack.

      NOTE:  checks for __safe_for_unpickling__ went away in Python 2.3.
      NOTE:  the distinction between old-style and new-style classes does
             not make sense in Python 3.
      ZOBJ�oa�Build a class instance.

      This is the protocol 1 version of protocol 0's INST opcode, and is
      very much like it.  The major difference is that the class object
      is taken off the stack, allowing it to be retrieved from the memo
      repeatedly if several instances of the same class are created.  This
      can be much more efficient (in both time and space) than repeatedly
      embedding the module and class names in INST opcodes.

      Unlike INST, OBJ takes no arguments from the opcode stream.  Instead
      the class object is taken off the stack, immediately above the
      topmost markobject:

      Stack before: ... markobject classobject stackslice
      Stack after:  ... new_instance_object

      As for INST, the remainder of the stack above the markobject is
      gathered into an argument tuple, and then the logic seems identical,
      except that no __safe_for_unpickling__ check is done (XXX this is
      a bug).  See INST for the gory details.

      NOTE:  In Python 2.3, INST and OBJ are identical except for how they
      get the class object.  That was always the intent; the implementations
      had diverged for accidental reasons.
      ZNEWOBJ�aLBuild an object instance.

      The stack before should be thought of as containing a class
      object followed by an argument tuple (the tuple being the stack
      top).  Call these cls and args.  They are popped off the stack,
      and the value returned by cls.__new__(cls, *args) is pushed back
      onto the stack.
      Z	NEWOBJ_EX�’auBuild an object instance.

      The stack before should be thought of as containing a class
      object followed by an argument tuple and by a keyword argument dict
      (the dict being the stack top).  Call these cls and args.  They are
      popped off the stack, and the value returned by
      cls.__new__(cls, *args, *kwargs) is  pushed back  onto the stack.
      �PROTO�€z�Protocol version indicator.

      For protocol 2 and above, a pickle must start with this opcode.
      The argument is the protocol version, an int in range(2, 256).
      ZSTOP�.z�Stop the unpickling machine.

      Every pickle ends with this opcode.  The object at the top of the stack
      is popped, and that's the result of unpickling.  The stack should be
      empty then.
      �FRAME�•z�Indicate the beginning of a new frame.

      The unpickler may use this opcode to safely prefetch data from its
      underlying stream.
      ZPERSID�PaPush an object identified by a persistent ID.

      The pickle module doesn't define what a persistent ID means.  PERSID's
      argument is a newline-terminated str-style (no embedded escapes, no
      bracketing quote characters) string, which *is* "the persistent ID".
      The unpickler passes this string to self.persistent_load().  Whatever
      object that returns is pushed on the stack.  There is no implementation
      of persistent_load() in Python's unpickler:  it must be supplied by an
      unpickler subclass.
      Z	BINPERSID�QaXPush an object identified by a persistent ID.

      Like PERSID, except the persistent ID is popped off the stack (instead
      of being a string embedded in the opcode bytestream).  The persistent
      ID is passed to self.persistent_load(), and whatever object that
      returns is pushed on the stack.  See PERSID for more detail.
      z%repeated name %r at indices %d and %dz%repeated code %r at indices %d and %dFcCst��}tjD]�}t�d|�s0|rtd|�qtt|�}t|t	�rPt
|�dkrf|rtd||f�q|�d�}||kr�|r�td||f�||}|j|kr�t
d|||jf��||=qt
d||f��q|�rd	g}|��D]\}}|�d
|j|f�q�t
d�|���dS)Nz[A-Z][A-Z0-9_]+$z0skipping %r: it doesn't look like an opcode namerz5skipping %r: value %r doesn't look like a pickle coderDz+checking name %r w/ code %r for consistencyzBfor pickle code %r, pickle.py uses name %r but we're using name %rzPpickle.py appears to have a pickle opcode with name %r and code %r, but we don'tz=we appear to have pickle opcodes that pickle.py doesn't have:z    name %r with code %r�
)�code2op�copy�pickle�__all__�re�match�print�getattrrwr|r%r:rr�items�append�join)�verboser�rZ
picklecoder��msgr�rrr�assure_pickle_consistency�sJ

�
�
���r�ccs�t|t�rt�|�}t|d�r&|j}ndd�}|�}|�d�}t�|�	d��}|dkr�|dkrht
d��nt
d|dkrxd	n||f��|jdkr�d}n|j�|�}|r�||||�fVn|||fV|d
kr.q�q.dS)N�tellcSsdSrrrrrr�<lambda>��z_genops.<locals>.<lambda>rrDr�z#pickle exhausted before seeing STOPz!at position %s, opcode %r unknownz	<unknown>�.)
rw�bytes_types�io�BytesIO�hasattrr�rr��getr:rr�r)r �
yield_end_posZgetpos�posr��opcoder�rrr�_genops�s.




�
r�cCst|�Sr)r�)r�rrrr�scCsd}d}t�}i}g}d}d}t|dd�D]�\}}	}
}d|jkrZ|�|	�|�||	f�q*|jdkr�t|�}|�|�|�||f�q*d|jkr�q*d|jkr�|j|kr�|j}d||	<|�||	f�q*|jd	k�r|	|kr�|	}|
dkr�||
|�}n|�|
|f�q*|�|
|f�q*~t��}
|
�	|�t
�|
|�}|d
k�rF|j�
�d}|D]�\}}	d}||k�r�|	|k�rr�qN|�|�}|||	<|d7}n6||k�r�|�||	�}n|||	�}t|�|jjk}|jj|d
�|�r�|j�|�n
|�	|��qN|j��|
��S)Nr�r�rr�T)r�r�r�r�r)Fr)Zforce)r�r�r�addr�r%r�r�r��writer�Z_PicklerZframerZ
start_framing�putr�Z_FRAME_SIZE_TARGETZcommit_frameZ
file_writeZend_framing�getvalue)r�r�r�ZoldidsZnewids�opcodesr�Zprotoheaderr�r�r�Zend_pos�idx�outZpickler�opZ	framelessr rrrr	sl















c	Csg}|dkri}d}g}d|}d}	|}
t|�D�]�\}}}
|
dk	rVtd|
d|d�dt|j�dd�|t|�|jf}t||j�}|j}|j	}t|�}d}t
|ks�|jdk�r@|�r@|dt
k�r@|�r8|��}|dkr�d}nd	|}|dt
k	�r|��q�|��z|�t
�}Wnt
k
�r4d
}YnXnd}	}|jdk�r�|jd
k�rjt|�}d|}n|}||k�r�d|}	n,|�s�d}	n |dt
k�r�d}	n|d||<n*|jdk�r�||k�r�||g}nd|}	|dk	�s�|�r,|ddt|j�7}|dk	�r|dt|�7}|�r,|d|7}|�rv|d|
t|�7}t|�}
|
dk�r\|}
|d|j�dd�d
7}t||d�|	�r�t
|	��t|�|k�r�t
d|t|�f��|�r�||d�=t
|k�r�|�|
�|�|�q0td||d�|�rt
d|��dS)Nr� z%5d:)�end�filez	%-4s %s%srr�z(MARK at unknown opcode offset)z(MARK at %d)rzno MARK exists on stack)r�r�r�r�r�z(as %d)zmemo key %r already definedz'stack is empty -- can't store into memoz"can't store markobject in the memo)r�r�r�z&memo key %r has never been stored into�
�2r�)rz3tries to pop %d items from stack with only %d itemsz highest protocol among opcodes =zstack not empty after STOP: %r)rr��reprr�r%r�maxr�r�r��
markobject�pop�indexrr�splitr��extend)r�r�memo�indentlevel�annotate�stackZmaxprotoZ	markstackZindentchunkZerrormsgZannocolr�r�r��lineZbeforeZafterZnumtopopZmarkmsgZmarkposZmemo_idxrrrr[	s�-
��
�







�

c@seZdZdd�ZdS)�_ExamplecCs
||_dSr)�value)rrrrrr�	sz_Example.__init__N)rrrrrrrrr�	sra�
>>> import pickle
>>> x = [1, 2, (3, 4), {b'abc': "def"}]
>>> pkl0 = pickle.dumps(x, 0)
>>> dis(pkl0)
    0: (    MARK
    1: l        LIST       (MARK at 0)
    2: p    PUT        0
    5: I    INT        1
    8: a    APPEND
    9: I    INT        2
   12: a    APPEND
   13: (    MARK
   14: I        INT        3
   17: I        INT        4
   20: t        TUPLE      (MARK at 13)
   21: p    PUT        1
   24: a    APPEND
   25: (    MARK
   26: d        DICT       (MARK at 25)
   27: p    PUT        2
   30: c    GLOBAL     '_codecs encode'
   46: p    PUT        3
   49: (    MARK
   50: V        UNICODE    'abc'
   55: p        PUT        4
   58: V        UNICODE    'latin1'
   66: p        PUT        5
   69: t        TUPLE      (MARK at 49)
   70: p    PUT        6
   73: R    REDUCE
   74: p    PUT        7
   77: V    UNICODE    'def'
   82: p    PUT        8
   85: s    SETITEM
   86: a    APPEND
   87: .    STOP
highest protocol among opcodes = 0

Try again with a "binary" pickle.

>>> pkl1 = pickle.dumps(x, 1)
>>> dis(pkl1)
    0: ]    EMPTY_LIST
    1: q    BINPUT     0
    3: (    MARK
    4: K        BININT1    1
    6: K        BININT1    2
    8: (        MARK
    9: K            BININT1    3
   11: K            BININT1    4
   13: t            TUPLE      (MARK at 8)
   14: q        BINPUT     1
   16: }        EMPTY_DICT
   17: q        BINPUT     2
   19: c        GLOBAL     '_codecs encode'
   35: q        BINPUT     3
   37: (        MARK
   38: X            BINUNICODE 'abc'
   46: q            BINPUT     4
   48: X            BINUNICODE 'latin1'
   59: q            BINPUT     5
   61: t            TUPLE      (MARK at 37)
   62: q        BINPUT     6
   64: R        REDUCE
   65: q        BINPUT     7
   67: X        BINUNICODE 'def'
   75: q        BINPUT     8
   77: s        SETITEM
   78: e        APPENDS    (MARK at 3)
   79: .    STOP
highest protocol among opcodes = 1

Exercise the INST/OBJ/BUILD family.

>>> import pickletools
>>> dis(pickle.dumps(pickletools.dis, 0))
    0: c    GLOBAL     'pickletools dis'
   17: p    PUT        0
   20: .    STOP
highest protocol among opcodes = 0

>>> from pickletools import _Example
>>> x = [_Example(42)] * 2
>>> dis(pickle.dumps(x, 0))
    0: (    MARK
    1: l        LIST       (MARK at 0)
    2: p    PUT        0
    5: c    GLOBAL     'copy_reg _reconstructor'
   30: p    PUT        1
   33: (    MARK
   34: c        GLOBAL     'pickletools _Example'
   56: p        PUT        2
   59: c        GLOBAL     '__builtin__ object'
   79: p        PUT        3
   82: N        NONE
   83: t        TUPLE      (MARK at 33)
   84: p    PUT        4
   87: R    REDUCE
   88: p    PUT        5
   91: (    MARK
   92: d        DICT       (MARK at 91)
   93: p    PUT        6
   96: V    UNICODE    'value'
  103: p    PUT        7
  106: I    INT        42
  110: s    SETITEM
  111: b    BUILD
  112: a    APPEND
  113: g    GET        5
  116: a    APPEND
  117: .    STOP
highest protocol among opcodes = 0

>>> dis(pickle.dumps(x, 1))
    0: ]    EMPTY_LIST
    1: q    BINPUT     0
    3: (    MARK
    4: c        GLOBAL     'copy_reg _reconstructor'
   29: q        BINPUT     1
   31: (        MARK
   32: c            GLOBAL     'pickletools _Example'
   54: q            BINPUT     2
   56: c            GLOBAL     '__builtin__ object'
   76: q            BINPUT     3
   78: N            NONE
   79: t            TUPLE      (MARK at 31)
   80: q        BINPUT     4
   82: R        REDUCE
   83: q        BINPUT     5
   85: }        EMPTY_DICT
   86: q        BINPUT     6
   88: X        BINUNICODE 'value'
   98: q        BINPUT     7
  100: K        BININT1    42
  102: s        SETITEM
  103: b        BUILD
  104: h        BINGET     5
  106: e        APPENDS    (MARK at 3)
  107: .    STOP
highest protocol among opcodes = 1

Try "the canonical" recursive-object test.

>>> L = []
>>> T = L,
>>> L.append(T)
>>> L[0] is T
True
>>> T[0] is L
True
>>> L[0][0] is L
True
>>> T[0][0] is T
True
>>> dis(pickle.dumps(L, 0))
    0: (    MARK
    1: l        LIST       (MARK at 0)
    2: p    PUT        0
    5: (    MARK
    6: g        GET        0
    9: t        TUPLE      (MARK at 5)
   10: p    PUT        1
   13: a    APPEND
   14: .    STOP
highest protocol among opcodes = 0

>>> dis(pickle.dumps(L, 1))
    0: ]    EMPTY_LIST
    1: q    BINPUT     0
    3: (    MARK
    4: h        BINGET     0
    6: t        TUPLE      (MARK at 3)
    7: q    BINPUT     1
    9: a    APPEND
   10: .    STOP
highest protocol among opcodes = 1

Note that, in the protocol 0 pickle of the recursive tuple, the disassembler
has to emulate the stack in order to realize that the POP opcode at 16 gets
rid of the MARK at 0.

>>> dis(pickle.dumps(T, 0))
    0: (    MARK
    1: (        MARK
    2: l            LIST       (MARK at 1)
    3: p        PUT        0
    6: (        MARK
    7: g            GET        0
   10: t            TUPLE      (MARK at 6)
   11: p        PUT        1
   14: a        APPEND
   15: 0        POP
   16: 0        POP        (MARK at 0)
   17: g    GET        1
   20: .    STOP
highest protocol among opcodes = 0

>>> dis(pickle.dumps(T, 1))
    0: (    MARK
    1: ]        EMPTY_LIST
    2: q        BINPUT     0
    4: (        MARK
    5: h            BINGET     0
    7: t            TUPLE      (MARK at 4)
    8: q        BINPUT     1
   10: a        APPEND
   11: 1        POP_MARK   (MARK at 0)
   12: h    BINGET     1
   14: .    STOP
highest protocol among opcodes = 1

Try protocol 2.

>>> dis(pickle.dumps(L, 2))
    0: \x80 PROTO      2
    2: ]    EMPTY_LIST
    3: q    BINPUT     0
    5: h    BINGET     0
    7: \x85 TUPLE1
    8: q    BINPUT     1
   10: a    APPEND
   11: .    STOP
highest protocol among opcodes = 2

>>> dis(pickle.dumps(T, 2))
    0: \x80 PROTO      2
    2: ]    EMPTY_LIST
    3: q    BINPUT     0
    5: h    BINGET     0
    7: \x85 TUPLE1
    8: q    BINPUT     1
   10: a    APPEND
   11: 0    POP
   12: h    BINGET     1
   14: .    STOP
highest protocol among opcodes = 2

Try protocol 3 with annotations:

>>> dis(pickle.dumps(T, 3), annotate=1)
    0: \x80 PROTO      3 Protocol version indicator.
    2: ]    EMPTY_LIST   Push an empty list.
    3: q    BINPUT     0 Store the stack top into the memo.  The stack is not popped.
    5: h    BINGET     0 Read an object from the memo and push it on the stack.
    7: \x85 TUPLE1       Build a one-tuple out of the topmost item on the stack.
    8: q    BINPUT     1 Store the stack top into the memo.  The stack is not popped.
   10: a    APPEND       Append an object to a list.
   11: 0    POP          Discard the top stack item, shrinking the stack by one item.
   12: h    BINGET     1 Read an object from the memo and push it on the stack.
   14: .    STOP         Stop the unpickling machine.
highest protocol among opcodes = 2

a=
>>> import pickle
>>> import io
>>> f = io.BytesIO()
>>> p = pickle.Pickler(f, 2)
>>> x = [1, 2, 3]
>>> p.dump(x)
>>> p.dump(x)
>>> f.seek(0)
0
>>> memo = {}
>>> dis(f, memo=memo)
    0: \x80 PROTO      2
    2: ]    EMPTY_LIST
    3: q    BINPUT     0
    5: (    MARK
    6: K        BININT1    1
    8: K        BININT1    2
   10: K        BININT1    3
   12: e        APPENDS    (MARK at 5)
   13: .    STOP
highest protocol among opcodes = 2
>>> dis(f, memo=memo)
   14: \x80 PROTO      2
   16: h    BINGET     0
   18: .    STOP
highest protocol among opcodes = 2
)Zdisassembler_testZdisassembler_memo_testcCsddl}|��S)Nr)�doctestZtestmod)rrrr�_testsr�__main__z$disassemble one or more pickle files)Zdescription�pickle_file�br�*zthe pickle file)�type�nargs�helpz-oz--output�wz+the file where the output should be written)�defaultrrz-mz--memo�
store_truez#preserve memo between disassemblies)�actionrz-lz
--indentlevelz8the number of blanks by which to indent a new MARK levelz-az
--annotatez2annotate each line with a short opcode descriptionz-pz
--preamblez==> {name} <==zMif more than one pickle file is specified, print this before each disassembly)rrz-tz--testzrun self-test suitez-vz)run verbosely; only affects self-test run�ryr�)TT)F)F)NNr)r)�r8r�r�r�rLr�r�Z
UP_TO_NEWLINEZTAKEN_FROM_ARGUMENT1ZTAKEN_FROM_ARGUMENT4ZTAKEN_FROM_ARGUMENT4UZTAKEN_FROM_ARGUMENT8U�objectr
Zstructrr&r!r"r'r(r*r+r,r-r/r0r=r>r@rArBrCrFrGrHrIrJrKrNrOrPrQrSrTrVrWrZr[r\r]r^r_rergrhrirkrlrmrnrorprqrrrsrtrbZpyintZpylongr{Zpyinteger_or_boolZpyboolrjZpyfloatr|rUZpybytes_or_strZpystringZpybytesrRZpybytearrayZ	pyunicoderZpynonerxZpytupler~ZpylistrZpydictr�ZpysetZpyfrozensetZpybufferZ	anyobjectr	r�r�r�r�Zname2iZcode2i�	enumerater�r�rrr�r�r�r�rrrrZ	_dis_testZ
_memo_testZ__test__rr�argparse�ArgumentParser�parser�add_argumentZFileType�stdout�
parse_args�argsZtestrrZ
print_helpr%�outputrrrZpreamble�formatr�rrrr�<module>
s^
$�����/�
�	�������
��
�
�
�
�	�
����
����
�������������;����
���
����
�
����
���
�
�
�
����������������������
��
���
�����������2� ������������������
& 

C��
�
�������
�
__pycache__/inspect.cpython-38.pyc000064400000235323151153537560013074 0ustar00U

e5d��@s�dZdZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlmZddlmZmZe�Zej��D]\ZZeede<q�dZdd	�Zd
d�Z dd
�Z!dd�Z"dd�Z#e$ed��rdd�Z%ndd�Z%e$ed��r*dd�Z&ndd�Z&dd�Z'dd�Z(dd�Z)d d!�Z*d"d#�Z+d$d%�Z,d&d'�Z-d(d)�Z.d*d+�Z/d,d-�Z0d.d/�Z1d0d1�Z2d2d3�Z3d4d5�Z4d6d7�Z5d�d8d9�Z6ed:d;�Z7d<d=�Z8d>d?�Z9dd@�dAdB�Z:dCdD�Z;dEdF�Z<dGdH�Z=dIdJ�Z>dKdL�Z?dMdN�Z@dOdP�ZAdQdR�ZBd�dSdT�ZCiZDiZEd�dUdV�ZFdWdX�ZGdYdZ�ZHGd[d\�d\eI�ZJGd]d^�d^�ZKd_d`�ZLdadb�ZMdcdd�ZNdedf�ZOd�dhdi�ZPedjdk�ZQdldm�ZRedndo�ZSdpdq�ZTedrds�ZUdtdu�ZVedvdw�ZWdxdy�ZXd�dzd{�ZYd|d}�ZZdddd~iie[dd��d�d��d�d��d�d��eYfd�d��Z\e[d�d��d�d��d�d��fd�d��Z]d�d��Z^d�d��Z_d�d��Z`ed�d��Zad�d��Zbed�d��Zcd�d�d��Zdd�d��Zeed�d�ecjf�Zgd�d�d��Zhd�d�d��Zid�d��Zjd�d�d��Zkd�d�d��Zlem�Znd�d��Zod�d��Zpd�d��Zqd�d��Zrd�d��Zsenfd�d��Ztd�Zud�Zvd�Zwd�Zxd�d��Zyd�d��Zzd�Z{d�Z|d�Z}d�Z~d�d��Zd�dÄZ�e�e�j��Z�e�e�j��Z�e�e�j�d��Z�e�e�e�ej�fZ�d�dƄZ�d�d�dȄZ�d�dʄZ�d�d̄Z�d�d΄Z�d�dЄZ�d�d҄Z�d�d�dՄZ��dd�dׄZ��dd�dلZ�d�d�dڜd�d܄Z�Gd�dބdރZ�Gd�d�d�Z�Gd�d�d�ej��Z�e�j�Z�e�j�Z�e�j�Z�e�j�Z�e�j�Z�e�d�e�d�e�d�e�d�e�d�iZ�Gd�d�d�Z�Gd�d�d�Z�Gd�d�d�Z�d�d�d�d�Z�d�d�Z�e�d�k�r�e��dS(aGet useful information from live Python objects.

This module encapsulates the interface provided by the internal special
attributes (co_*, im_*, tb_*, etc.) in a friendlier fashion.
It also provides some help for examining source code and class layout.

Here are some of the useful functions provided by this module:

    ismodule(), isclass(), ismethod(), isfunction(), isgeneratorfunction(),
        isgenerator(), istraceback(), isframe(), iscode(), isbuiltin(),
        isroutine() - check object types
    getmembers() - get members of an object that satisfy a given condition

    getfile(), getsourcefile(), getsource() - find an object's source code
    getdoc(), getcomments() - get documentation on an object
    getmodule() - determine the module that an object came from
    getclasstree() - arrange classes so as to represent their hierarchy

    getargvalues(), getcallargs() - get info about function arguments
    getfullargspec() - same, with support for Python 3 features
    formatargvalues() - format an argument spec
    getouterframes(), getinnerframes() - get info about frames
    currentframe() - get the current stack frame
    stack(), trace() - get info about frames on the stack or in a traceback

    signature() - get a Signature object for the callable
)zKa-Ping Yee <ping@lfw.org>z'Yury Selivanov <yselivanov@sprymix.com>�N)�
attrgetter)�
namedtuple�OrderedDictZCO_icCst|tj�S)z�Return true if the object is a module.

    Module objects provide these attributes:
        __cached__      pathname to byte compiled file
        __doc__         documentation string
        __file__        filename (missing for built-in modules))�
isinstance�types�
ModuleType��object�r
�/usr/lib64/python3.8/inspect.py�ismodule?srcCs
t|t�S)z�Return true if the object is a class.

    Class objects provide these attributes:
        __doc__         documentation string
        __module__      name of module in which this class was defined)r�typerr
r
r�isclassHsrcCst|tj�S)a_Return true if the object is an instance method.

    Instance method objects provide these attributes:
        __doc__         documentation string
        __name__        name with which this method was defined
        __func__        function object containing implementation of method
        __self__        instance to which this method is bound)rr�
MethodTyperr
r
r�ismethodPsrcCs:t|�st|�st|�rdSt|�}t|d�o8t|d�S)a�Return true if the object is a method descriptor.

    But not if ismethod() or isclass() or isfunction() are true.

    This is new in Python 2.2, and, for example, is true of int.__add__.
    An object passing this test has a __get__ attribute but not a __set__
    attribute, but beyond that the set of attributes varies.  __name__ is
    usually sensible, and __doc__ often is.

    Methods implemented via descriptors that also pass one of the other
    tests return false from the ismethoddescriptor() test, simply because
    the other tests promise more -- you can, e.g., count on having the
    __func__ attribute (etc) when an object passes ismethod().F�__get__�__set__�rr�
isfunctionr
�hasattr�r	�tpr
r
r�ismethoddescriptorZsrcCs8t|�st|�st|�rdSt|�}t|d�p6t|d�S)a}Return true if the object is a data descriptor.

    Data descriptors have a __set__ or a __delete__ attribute.  Examples are
    properties (defined in Python) and getsets and members (defined in C).
    Typically, data descriptors will also have __name__ and __doc__ attributes
    (properties, getsets, and members have both of these attributes), but this
    is not guaranteed.Fr�
__delete__rrr
r
r�isdatadescriptornsr�MemberDescriptorTypecCst|tj�S)��Return true if the object is a member descriptor.

        Member descriptors are specialized descriptors defined in extension
        modules.)rrrrr
r
r�ismemberdescriptor~srcCsdS)rFr
rr
r
rr�s�GetSetDescriptorTypecCst|tj�S)��Return true if the object is a getset descriptor.

        getset descriptors are specialized descriptors defined in extension
        modules.)rrrrr
r
r�isgetsetdescriptor�sr cCsdS)rFr
rr
r
rr �scCst|tj�S)a(Return true if the object is a user-defined function.

    Function objects provide these attributes:
        __doc__         documentation string
        __name__        name with which this function was defined
        __code__        code object containing compiled function bytecode
        __defaults__    tuple of any default values for arguments
        __globals__     global namespace in which this function was defined
        __annotations__ dict of parameter annotations
        __kwdefaults__  dict of keyword only parameters with defaults)rr�FunctionTyperr
r
rr�srcCs6t|�r|j}qt�|�}t|�s&dSt|jj|@�S)z�Return true if ``f`` is a function (or a method or functools.partial
    wrapper wrapping a function) whose code object has the given ``flag``
    set in its flags.F)r�__func__�	functools�_unwrap_partialr�bool�__code__�co_flags)�f�flagr
r
r�_has_code_flag�s
r*cCs
t|t�S)z�Return true if the object is a user-defined generator function.

    Generator function objects provide the same attributes as functions.
    See help(isfunction) for a list of attributes.)r*ZCO_GENERATOR��objr
r
r�isgeneratorfunction�sr-cCs
t|t�S)zuReturn true if the object is a coroutine function.

    Coroutine functions are defined with "async def" syntax.
    )r*ZCO_COROUTINEr+r
r
r�iscoroutinefunction�sr.cCs
t|t�S)z�Return true if the object is an asynchronous generator function.

    Asynchronous generator functions are defined with "async def"
    syntax and have "yield" expressions in their body.
    )r*ZCO_ASYNC_GENERATORr+r
r
r�isasyncgenfunction�sr/cCst|tj�S)z7Return true if the object is an asynchronous generator.)rr�AsyncGeneratorTyperr
r
r�
isasyncgen�sr1cCst|tj�S)aReturn true if the object is a generator.

    Generator objects provide these attributes:
        __iter__        defined to support iteration over container
        close           raises a new GeneratorExit exception inside the
                        generator to terminate the iteration
        gi_code         code object
        gi_frame        frame object or possibly None once the generator has
                        been exhausted
        gi_running      set to 1 when generator is executing, 0 otherwise
        next            return the next item from the container
        send            resumes the generator and "sends" a value that becomes
                        the result of the current yield-expression
        throw           used to raise an exception inside the generator)rr�
GeneratorTyperr
r
r�isgenerator�sr3cCst|tj�S)z)Return true if the object is a coroutine.)rr�
CoroutineTyperr
r
r�iscoroutine�sr5cCs6t|tj�p4t|tj�r(t|jjt@�p4t|tj	j
�S)z?Return true if object can be passed to an ``await`` expression.)rrr4r2r%�gi_coder'ZCO_ITERABLE_COROUTINE�collections�abc�	Awaitablerr
r
r�isawaitable�s��r:cCst|tj�S)abReturn true if the object is a traceback.

    Traceback objects provide these attributes:
        tb_frame        frame object at this level
        tb_lasti        index of last attempted instruction in bytecode
        tb_lineno       current line number in Python source code
        tb_next         next inner traceback object (called by this level))rr�
TracebackTyperr
r
r�istraceback�sr<cCst|tj�S)a`Return true if the object is a frame object.

    Frame objects provide these attributes:
        f_back          next outer frame object (this frame's caller)
        f_builtins      built-in namespace seen by this frame
        f_code          code object being executed in this frame
        f_globals       global namespace seen by this frame
        f_lasti         index of last attempted instruction in bytecode
        f_lineno        current line number in Python source code
        f_locals        local namespace seen by this frame
        f_trace         tracing function for this frame, or None)rr�	FrameTyperr
r
r�isframe�sr>cCst|tj�S)a�Return true if the object is a code object.

    Code objects provide these attributes:
        co_argcount         number of arguments (not including *, ** args
                            or keyword only arguments)
        co_code             string of raw compiled bytecode
        co_cellvars         tuple of names of cell variables
        co_consts           tuple of constants used in the bytecode
        co_filename         name of file in which this code object was created
        co_firstlineno      number of first line in Python source code
        co_flags            bitmap: 1=optimized | 2=newlocals | 4=*arg | 8=**arg
                            | 16=nested | 32=generator | 64=nofree | 128=coroutine
                            | 256=iterable_coroutine | 512=async_generator
        co_freevars         tuple of names of free variables
        co_posonlyargcount  number of positional only arguments
        co_kwonlyargcount   number of keyword only arguments (not including ** arg)
        co_lnotab           encoded mapping of line numbers to bytecode indices
        co_name             name with which this code object was defined
        co_names            tuple of names of local variables
        co_nlocals          number of local variables
        co_stacksize        virtual machine stack space required
        co_varnames         tuple of names of arguments and local variables)rr�CodeTyperr
r
r�iscodesr@cCst|tj�S)a,Return true if the object is a built-in function or method.

    Built-in functions and methods provide these attributes:
        __doc__         documentation string
        __name__        original name of this function or method
        __self__        instance to which a method is bound, or None)rr�BuiltinFunctionTyperr
r
r�	isbuiltinsrBcCs t|�pt|�pt|�pt|�S)z<Return true if the object is any kind of function or method.)rBrrrrr
r
r�	isroutine&s���rCcCs�t|t�sdS|jt@rdStt|�tj�s0dSt|d�r>dS|j�	�D]\}}t
|dd�rHdSqH|jD]6}t
|dd�D]$}t
||d�}t
|dd�rzdSqzqjdS)z:Return true if the object is an abstract base class (ABC).FT�__abstractmethods__�__isabstractmethod__r
N)rr
�	__flags__�TPFLAGS_IS_ABSTRACT�
issubclassr8�ABCMetar�__dict__�items�getattr�	__bases__)r	�name�value�baser
r
r�
isabstract-s"



rQc	Cst|�r|ft|�}nd}g}t�}t|�}z:|jD].}|j��D]\}}t|tj	�rD|�
|�qDq6Wntk
r|YnX|D]~}	zt||	�}
|	|kr�t�Wn:tk
r�|D]}|	|jkr�|j|	}
q�q�Yq�YnX|r�||
�r�|�
|	|
f�|�
|	�q�|jdd�d�|S)z�Return all members of an object as (name, value) pairs sorted by name.
    Optionally, only return members that satisfy a given predicate.r
cSs|dS)Nrr
)Zpairr
r
r�<lambda>n�zgetmembers.<locals>.<lambda>��key)r�getmro�set�dirrMrJrKrr�DynamicClassAttribute�append�AttributeErrorrL�add�sort)r	Z	predicate�mro�results�	processed�namesrP�k�vrUrOr
r
r�
getmembersEs:




rd�	Attributezname kind defining_class objectcCsTt|�}tt|��}tdd�|D��}|f|}||}t|�}|D].}|j��D]\}}t|tj�rR|�	|�qRqDg}	t
�}
|D�]�}d}d}
d}||
k�rzz|dkr�td��t||�}
Wn"tk
r�}zW5d}~XYn�Xt|
d|�}||k�rzd}d}|D] }t||d�}||
k�r|}�q|D]B}z|�
||�}Wntk
�rXY�q(YnX||
k�r(|}�q(|dk	�rz|}|D]0}||jk�r~|j|}||k�r�|}�q��q~|dk�r�q�|
dk	�r�|
n|}t|ttjf��r�d}|}nFt|ttjf��rd}|}n*t|t��rd	}|}nt|��r,d
}nd}|	�	t||||��|
�|�q�|	S)aNReturn list of attribute-descriptor tuples.

    For each name in dir(cls), the return list contains a 4-tuple
    with these elements:

        0. The name (a string).

        1. The kind of attribute this is, one of these strings:
               'class method'    created via classmethod()
               'static method'   created via staticmethod()
               'property'        created via property()
               'method'          any other flavor of method or descriptor
               'data'            not a method

        2. The class which defined this attribute (a class).

        3. The object as obtained by calling getattr; if this fails, or if the
           resulting object does not live anywhere in the class' mro (including
           metaclasses) then the object is looked up in the defining class's
           dict (found by walking the mro).

    If one of the items in dir(cls) is stored in the metaclass it will now
    be discovered and not have None be listed as the class in which it was
    defined.  Any items whose home class cannot be discovered are skipped.
    css|]}|ttfkr|VqdS�N)r
r	)�.0�clsr
r
r�	<genexpr>�sz'classify_class_attrs.<locals>.<genexpr>NrJz)__dict__ is special, don't want the proxy�__objclass__z
static methodzclass method�property�method�data)rVr
�tuplerXrJrKrrrYrZrW�	ExceptionrL�__getattr__r[�staticmethod�BuiltinMethodType�classmethod�ClassMethodDescriptorTyperkrCrer\)rhr^ZmetamroZclass_basesZ	all_basesrarPrbrc�resultr`rNZhomeclsZget_objZdict_obj�excZlast_clsZsrch_clsZsrch_objr,�kindr
r
r�classify_class_attrsss�












rxcCs|jS)zHReturn tuple of base classes (including cls) in method resolution order.)�__mro__)rhr
r
rrV�srV��stopcs|�dkrdd�}n�fdd�}|}t|�|i}t��}||�rx|j}t|�}||ks`t|�|krntd�|���|||<q6|S)anGet the object wrapped by *func*.

   Follows the chain of :attr:`__wrapped__` attributes returning the last
   object in the chain.

   *stop* is an optional callback accepting an object in the wrapper chain
   as its sole argument that allows the unwrapping to be terminated early if
   the callback returns a true value. If the callback never returns a true
   value, the last object in the chain is returned as usual. For example,
   :func:`signature` uses this to stop unwrapping if any object in the
   chain has a ``__signature__`` attribute defined.

   :exc:`ValueError` is raised if a cycle is encountered.

    NcSs
t|d�S�N�__wrapped__�r�r(r
r
r�_is_wrapper�szunwrap.<locals>._is_wrappercst|d�o�|�Sr|r~rrzr
rr�sz!wrapper loop when unwrapping {!r})�id�sys�getrecursionlimitr}�len�
ValueError�format)�funcr{r�r(ZmemoZrecursion_limitZid_funcr
rzr�unwrap�s

r�cCs|��}t|�t|���S)zBReturn the indent size, in spaces, at the start of a line of text.)�
expandtabsr��lstrip)�lineZexpliner
r
r�
indentsizesr�cCsNtj�|j�}|dkrdS|j�d�dd�D]}t||�}q.t|�sJdS|S)N�.���)r��modules�get�
__module__�__qualname__�splitrLr)r�rhrNr
r
r�
_findclasssr�c	Cst|�rT|jD]@}|tk	rz
|j}Wntk
r<YqYnX|dk	r|SqdSt|�r�|jj}|j}t|�r�t	t	||d�d�|jkr�|}n|j
}�n$t|�r�|j}t|�}|dks�t	||�|k	r�dSn�t
|��r|j}|j}t|��r|jd||jk�r|}n|j
}n�t|t��rP|j}|j}t|�}|dk�sJt	||�|k	�r�dSnnt|��sdt|��r�|j}|j}t	||�|k	�r�dSt|��r�t	|dd�}t|t��r�||k�r�||SndS|jD]F}zt	||�j}Wntk
�r�Y�q�YnX|dk	�r�|S�q�dS)Nr"r��	__slots__)rryr	�__doc__r[rr"�__name__�__self__rL�	__class__rr�rBr�rrk�fgetrrrjr�dict)r,rP�docrN�selfrhr��slotsr
r
r�_finddoc sn



�


�



r�c	Cshz
|j}Wntk
r YdSX|dkrRzt|�}Wnttfk
rPYdSXt|t�s`dSt|�S)z�Get the documentation string for an object.

    All tabs are expanded to spaces.  To clean up docstrings that are
    indented to line up with blocks of code, any whitespace than can be
    uniformly removed from the second line onwards is removed.N)r�r[r��	TypeErrorr�str�cleandoc)r	r�r
r
r�getdoc^s

r�cCs�z|���d�}Wntk
r(YdSXtj}|dd�D]*}t|���}|r<t|�|}t||�}q<|r||d��|d<|tjkr�tdt|��D]}|||d�||<q�|r�|ds�|�	�q�|r�|ds�|�	d�q�d�
|�SdS)z�Clean up indentation from docstrings.

    Any whitespace that can be uniformly removed from the second line
    onwards is removed.�
N�rr�)r�r��UnicodeErrorr��maxsizer�r��min�range�pop�join)r��linesZmarginr�Zcontent�indent�ir
r
rr�qs(

r�cCs�t|�r(t|dd�r|jStd�|���t|�rht|d�rZtj�	|j
�}t|dd�rZ|jStd�|���t|�rv|j}t
|�r�|j}t|�r�|j}t|�r�|j}t|�r�|jStd�t|�j���dS)z@Work out which source or compiled file an object was defined in.�__file__Nz{!r} is a built-in moduler�z{!r} is a built-in classzVmodule, class, method, function, traceback, frame, or code object was expected, got {})rrLr�r�r�rrr�r�r�r�rr"rr&r<�tb_framer>�f_coder@�co_filenamer
r�)r	�moduler
r
r�getfile�s.
�r�cCsTtj�|�}dd�tj��D�}|��|D]"\}}|�|�r,|d|�Sq,dS)z1Return the module name for a given file, or None.cSsg|]}t|�|f�qSr
)r�)rg�suffixr
r
r�
<listcomp>�s�z!getmodulename.<locals>.<listcomp>N)�os�path�basename�	importlib�	machinery�all_suffixesr]�endswith)r�Zfname�suffixesZneglenr�r
r
r�
getmodulename�s�
r�cs�t|��tjjdd�}|tjjdd�7}t�fdd�|D��r`tj���dtjj	d�nt�fdd�tjj
D��r~dStj���r��Stt
|��dd�dk	r��S�tjkr��SdS)z�Return the filename that can be used to locate an object's source.
    Return None if no way can be identified to get the source.
    Nc3s|]}��|�VqdSrf�r��rg�s��filenamer
rri�sz getsourcefile.<locals>.<genexpr>rc3s|]}��|�VqdSrfr�r�r�r
rri�s�
__loader__)r�r�r��DEBUG_BYTECODE_SUFFIXES�OPTIMIZED_BYTECODE_SUFFIXES�anyr�r��splitext�SOURCE_SUFFIXES�EXTENSION_SUFFIXES�existsrL�	getmodule�	linecache�cache)r	Zall_bytecode_suffixesr
r�r�
getsourcefile�s"
��
r�cCs,|dkrt|�pt|�}tj�tj�|��S)z�Return an absolute path to the source or compiled file for an object.

    The idea is for each object to have a unique origin, so this routine
    normalizes the result as much as possible.N)r�r�r�r��normcase�abspath)r	�	_filenamer
r
r�
getabsfile�sr�c
Cs�t|�r|St|d�r$tj�|j�S|dk	rD|tkrDtj�t|�Szt||�}Wntk
rhYdSX|tkr�tj�t|�Stj�	��
�D]\\}}t|�r�t|d�r�|j}|t�|d�kr�q�|t|<t|�}|j
t|<ttj�|�<q�|tk�rtj�t|�Stjd}t|d��s"dSt||j
��rJt||j
�}||k�rJ|Stjd}t||j
��r|t||j
�}	|	|k�r||SdS)zAReturn the module an object was defined in, or None if not found.r�Nr��__main__r��builtins)rrr�r�r�r��
modulesbyfiler�r��copyrKr��_filesbymodnamer�r�r��realpathrL)
r	r��file�modnamer�r(�mainZ
mainobjectZbuiltinZ
builtinobjectr
r
rr��sJ
�

�




r�cCs�t|�}|rt�|�n$t|�}|�d�r4|�d�s<td��t||�}|rZt�||j	�}n
t�|�}|sptd��t
|�r�|dfSt|��r |j}t
�d|d�}g}tt|��D]F}|�||�}|r�||ddkr�||fS|�|�d	�|f�q�|�r|��||dd	fStd
��t|��r0|j}t|��r@|j}t|��rP|j}t|��r`|j}t|��r�t|d��s~td��|jd	}	t
�d
�}|	dk�r�z||	}
Wnt k
�r�td��YnX|�|
��rؐq�|	d	}	�q�||	fStd��dS)abReturn the entire source file and starting line number for an object.

    The argument may be a module, class, method, function, traceback, frame,
    or code object.  The source code is returned as a list of all the lines
    in the file and the line number indexes a line in that list.  An OSError
    is raised if the source code cannot be retrieved.�<�>zsource code not availablezcould not get source coderz^(\s*)class\s*z\b�cr�zcould not find class definition�co_firstlinenoz"could not find function definitionz>^(\s*def\s)|(\s*async\s+def\s)|(.*(?<!\w)lambda(:|\s))|^(\s*@)zlineno is out of boundszcould not find code objectN)!r�r��
checkcacher��
startswithr��OSErrorr��getlinesrJrrr��re�compiler�r��matchrZ�groupr]rr"rr&r<r�r>r�r@rr��
IndexError)r	r�r�r�rNZpatZ
candidatesr�r��lnumr�r
r
r�
findsourcesf










r�c	Cs.zt|�\}}Wnttfk
r*YdSXt|�r�d}|rT|ddd�dkrTd}|t|�krz||��dkrz|d}qT|t|�kr�||dd�dkr�g}|}|t|�kr�||dd�dkr�|�||���|d}q�d�|�S�n>|dk�r*t	||�}|d}|dk�r*||�
�dd�dk�r*t	||�|k�r*||���
�g}|dk�r�|d}||���
�}|dd�dk�r�t	||�|k�r�|g|dd�<|d}|dk�r��q�||���
�}�qt|�r�|d��dk�r�g|dd�<�q�|�r |d	��dk�r g|d	d�<�q�d�|�SdS)
zwGet lines of comments immediately preceding an object's source code.

    Returns None when source can't be found.
    Nr�z#!r�)��#r�r�r�)r�r�r�rr��striprZr�r�r�r�)r	r�r��startZcomments�endr�Zcommentr
r
r�getcommentsRsL
  

$�
$
r�c@seZdZdS)�
EndOfBlockN)r�r�r�r
r
r
rr�sr�c@s eZdZdZdd�Zdd�ZdS)�BlockFinderz@Provide a tokeneater() method to detect the end of a code block.cCs4d|_d|_d|_d|_d|_d|_d|_d|_dS)NrFr�)r��islambda�started�passline�indecorator�decoratorhasargs�last�	body_col0�r�r
r
r�__init__�szBlockFinder.__init__cCsr|jsB|jsB|dkrd|_n|dkr8|dkr2d|_d|_d|_�n,|dkrZ|jrVd|_�n|dkrv|jrtd|_d|_n�|tjkr�d|_|d|_|jr�t�|jr�|js�d|_n�|jr�n�|tj	kr�|j
dkr�|jr�|d	|_
|jd	|_d|_n�|tjk�r|jd	|_|jdk�rnt�nV|tj
k�rL|j
dk	�rn|d	|j
k�rn|d|_n"|jdk�rn|tj
tjfk�rnt�dS)
N�@T)�def�class�lambdar�(�)Frr�)r�r�r�r�r��tokenize�NEWLINEr�r��INDENTr�r��DEDENT�COMMENT�NL)r�r
�tokenZsrowcolZerowcolr�r
r
r�
tokeneater�sL





zBlockFinder.tokeneaterN)r�r�r�r�r�rr
r
r
rr��s
r�c	CsVt�}z(t�t|�j�}|D]}|j|�qWnttfk
rFYnX|d|j�S)z@Extract the block of code at the top of the given list of lines.N)	r�r�generate_tokens�iter�__next__rr��IndentationErrorr�)r�Zblockfinder�tokensZ_tokenr
r
r�getblock�srcCsbt|�}t|�\}}t|�r"|j}t|�s>t|�rF|jjdkrF|dfSt||d��|dfSdS)a�Return a list of source lines and starting line number for an object.

    The argument may be a module, class, method, function, traceback, frame,
    or code object.  The source code is returned as a list of the lines
    corresponding to the object and the line number indicates where in the
    original source file the first line of code was found.  An OSError is
    raised if the source code cannot be retrieved.z<module>rNr�)	r�r�r<r�rr>r��co_namer�r	r�r�r
r
r�getsourcelines�s�
�rcCst|�\}}d�|�S)aReturn the text of the source code for an object.

    The argument may be a module, class, method, function, traceback, frame,
    or code object.  The source code is returned as a single string.  An
    OSError is raised if the source code cannot be retrieved.r�)rr�rr
r
r�	getsource�srcCsRg}|jtdd�d�|D]2}|�||jf�||kr|�t||||��q|S)z-Recursive helper function for getclasstree().r�r�rT)r]rrZrM�walktree)�classes�children�parentr_r�r
r
rr�srFcCs�i}g}|D]d}|jr^|jD]>}||kr0g||<|||krJ||�|�|r||krqpqq||kr|�|�q|D]}||krv|�|�qvt||d�S)a�Arrange the given list of classes into a hierarchy of nested lists.

    Where a nested list appears, it contains classes derived from the class
    whose entry immediately precedes the list.  Each entry is a 2-tuple
    containing a class and a tuple of its base classes.  If the 'unique'
    argument is true, exactly one entry appears in the returned structure
    for each class in the given list.  Otherwise, classes using multiple
    inheritance and their descendants will appear multiple times.N)rMrZr)r�uniquer�rootsr�rr
r
r�getclasstree�s"	
r�	Argumentszargs, varargs, varkwc	Cs�t|�std�|���|j}|j}|j}t|d|��}t||||��}d}||7}d}|jt@rx|j|}|d}d}|jt	@r�|j|}t
||||�S)aGet information about the arguments accepted by a code object.

    Three things are returned: (args, varargs, varkw), where
    'args' is the list of argument names. Keyword-only arguments are
    appended. 'varargs' and 'varkw' are the names of the * and **
    arguments or None.z{!r} is not a code objectNrr�)r@r�r��co_varnames�co_argcount�co_kwonlyargcount�listr'�
CO_VARARGS�CO_VARKEYWORDSr)	�cora�nargsZnkwargs�args�
kwonlyargs�step�varargs�varkwr
r
r�getargss"



r,�ArgSpeczargs varargs keywords defaultscCsDtjdtdd�t|�\}}}}}}}|s.|r6td��t||||�S)aeGet the names and default values of a function's parameters.

    A tuple of four things is returned: (args, varargs, keywords, defaults).
    'args' is a list of the argument names, including keyword-only argument names.
    'varargs' and 'keywords' are the names of the * and ** parameters or None.
    'defaults' is an n-tuple of the default values of the last n parameters.

    This function is deprecated, as it does not support annotations or
    keyword-only parameters and will raise ValueError if either is present
    on the supplied callable.

    For a more structured introspection API, use inspect.signature() instead.

    Alternatively, use getfullargspec() for an API with a similar namedtuple
    based interface, but full support for annotations and keyword-only
    parameters.

    Deprecated since Python 3.5, use `inspect.getfullargspec()`.
    zhinspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()r���
stacklevelzgFunction has keyword-only parameters or annotations, use inspect.signature() API which can support them)�warnings�warn�DeprecationWarning�getfullargspecr�r-)r�r'r*r+�defaultsr(�kwonlydefaults�annr
r
r�
getargspec-s��r7�FullArgSpeczGargs, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotationsc
Cs|zt|ddtd�}Wn,tk
r@}ztd�|�W5d}~XYnXg}d}d}g}g}d}i}	d}i}
|j|jk	r||j|	d<|j��D]�}|j}|j	}
|t
kr�|�|
�|j|jk	r�||jf7}nv|t
kr�|�|
�|j|jk	r�||jf7}nJ|tkr�|
}n<|tk�r*|�|
�|j|jk	�r8|j|
|
<n|tk�r8|
}|j|jk	r�|j|	|
<q�|
�sZd}
|�sdd}t|||||||
|	�S)a$Get the names and default values of a callable object's parameters.

    A tuple of seven things is returned:
    (args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations).
    'args' is a list of the parameter names.
    'varargs' and 'varkw' are the names of the * and ** parameters or None.
    'defaults' is an n-tuple of the default values of the last n parameters.
    'kwonlyargs' is a list of keyword-only parameter names.
    'kwonlydefaults' is a dictionary mapping names from kwonlyargs to defaults.
    'annotations' is a dictionary mapping parameter names to annotations.

    Notable differences from inspect.signature():
      - the "self" parameter is always reported, even for bound methods
      - wrapper chains defined by __wrapped__ *not* unwrapped automatically
    F��follow_wrapper_chains�skip_bound_arg�sigclszunsupported callableNr
�return)�_signature_from_callable�	Signatureror��return_annotation�empty�
parameters�valuesrwrN�_POSITIONAL_ONLYrZ�default�_POSITIONAL_OR_KEYWORD�_VAR_POSITIONAL�
_KEYWORD_ONLY�_VAR_KEYWORD�
annotationr8)r��sig�exr'r*r+Zposonlyargsr(r4�annotations�
kwdefaults�paramrwrNr
r
rr3Nsb�






�r3�ArgInfozargs varargs keywords localscCs t|j�\}}}t||||j�S)a9Get information about arguments passed into a particular frame.

    A tuple of four things is returned: (args, varargs, varkw, locals).
    'args' is a list of the argument names.
    'varargs' and 'varkw' are the names of the * and ** arguments or None.
    'locals' is the locals dictionary of the given frame.)r,r�rP�f_locals)�framer'r*r+r
r
r�getargvalues�srScCsVt|dd�dkr t|��dd�St|t�rN|jd|fkr>|jS|jd|jSt|�S)Nr��typingztyping.r�r�r�)rL�repr�replacerr
r�r�)rJZbase_moduler
r
r�formatannotation�s
rWcst|dd���fdd�}|S)Nr�cs
t|��Srf)rW)rJ�r�r
r�_formatannotation�sz5formatannotationrelativeto.<locals>._formatannotation)rL)r	rYr
rXr�formatannotationrelativeto�srZr
cCsd|S�N�*r
�rNr
r
rrR�rSrRcCsd|S�N�**r
r]r
r
rrR�rScCsdt|�S�N�=�rU�rOr
r
rrR�rScCsd|S)Nz -> r
)�textr
r
rrR�rSc
s<ddlm}
|
dtdd����fdd�}g}|rBt|�t|�}t|�D]:\}}||�}|rz||krz||
|||�}|�|�qJ|dk	r�|�|||���n|r�|�d	�|r�|D]2}||�}|r�||kr�||
||�7}|�|�q�|dk	�r|�|	||���d
d�|�d}d
�k�r8||��d
��7}|S)a�Format an argument spec from the values returned by getfullargspec.

    The first seven arguments are (args, varargs, varkw, defaults,
    kwonlyargs, kwonlydefaults, annotations).  The other five arguments
    are the corresponding optional formatting functions that are called to
    turn names and values into strings.  The last argument is an optional
    function to format the sequence of arguments.

    Deprecated since Python 3.5: use the `signature` function and `Signature`
    objects.
    r)r1zc`formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directlyr�r.cs(�|�}|�kr$|d��|�7}|S)Nz: r
)�argru�rMrW�	formatargr
r�formatargandannotation�sz-formatargspec.<locals>.formatargandannotationNr\r�, rr=)r0r1r2r��	enumeraterZr�)r'r*r+r4r(r5rMrg�
formatvarargs�formatvarkw�formatvalueZ
formatreturnsrWr1rh�specsZfirstdefaultr�re�specZ	kwonlyargrur
rfr�
formatargspec�s<�


rpcCsd|Sr[r
r]r
r
rrRrScCsd|Sr^r
r]r
r
rrRrScCsdt|�Sr`rbrcr
r
rrRrScCs�|||fdd�}g}	tt|��D]}
|	�|||
��q |rV|	�||�|||��|rt|	�||�|||��dd�|	�dS)afFormat an argument spec from the 4 values returned by getargvalues.

    The first four arguments are (args, varargs, varkw, locals).  The
    next four arguments are the corresponding optional formatting functions
    that are called to turn names and values into strings.  The ninth
    argument is an optional function to format the sequence of arguments.cSs||�|||�Srfr
)rN�localsrgrmr
r
r�convertsz formatargvalues.<locals>.convertrrir)r�r�rZr�)r'r*r+rqrgrkrlrmrrrnr�r
r
r�formatargvaluess�
rscs��fdd�|D�}t|�}|dkr,|d}n>|dkr@dj|�}n*dj|dd��}|dd�=d	�|�|}td
|||rzdnd|dkr�d
nd|f��dS)Ncsg|]}|�krt|��qSr
rb)rgrN�rCr
rr�sz&_missing_arguments.<locals>.<listcomp>r�rr�z	{} and {}z, {} and {}���riz*%s() missing %i required %s argument%s: %s�
positional�keyword-onlyr�r�)r�r�r�r�)�f_nameZargnames�posrCra�missingr��tailr
rtr�_missing_argumentss 


��r|c
	s�t|�|}t�fdd�|D��}|r:|dk}	d|f}
n2|rTd}	d|t|�f}
nt|�dk}	tt|��}
d}|r�d}||dkr�d	nd||dkr�d	ndf}td
||
|	r�d	nd|||dkr�|s�dndf��dS)
Ncsg|]}|�kr|�qSr
r
)rgrertr
rr�)sz_too_many.<locals>.<listcomp>r�zat least %dTz
from %d to %dr�z7 positional argument%s (and %d keyword-only argument%s)r�z5%s() takes %s positional argument%s but %d%s %s givenZwasZwere)r�r�r�)
rxr'Zkwonlyr*ZdefcountZgivenrCZatleastZkwonly_givenZpluralrKZ
kwonly_sig�msgr
rtr�	_too_many's*���r~cOst|�}|\}}}}}}	}
|j}i}t|�rB|jdk	rB|jf|}t|�}
t|�}|r^t|�nd}t|
|�}t|�D]}|||||<qt|r�t||d��||<t||�}|r�i||<|�	�D]T\}}||kr�|s�t
d||f��||||<q�||k�rt
d||f��|||<q�|
|k�r<|�s<t||||||
|�|
|k�r�|d||�}|D]}||k�rZt||d|��qZt
|||d��D] \}}||k�r�||||<�q�d}|D]6}||k�r�|	�r�||	k�r�|	|||<n|d7}�q�|�rt||d|�|S)z�Get the mapping of arguments to values.

    A dict is returned, with keys the function argument names (including the
    names of the * and ** arguments, if any), and values the respective bound
    values from 'positional' and 'named'.Nrz*%s() got an unexpected keyword argument %rz(%s() got multiple values for argument %rTr�F)r3r�rr�r�r�r�rnrWrKr�r~r|rj)r�rvZnamedror'r*r+r4r(r5r6rxZ	arg2valueZnum_posZnum_argsZnum_defaults�nr�Zpossible_kwargs�kwrOZreqrerz�kwargr
r
r�getcallargs<sh
�
�
�



r��ClosureVarsz"nonlocals globals builtins unboundc	Cs�t|�r|j}t|�s$td�|���|j}|jdkr:i}ndd�t|j|j�D�}|j	}|�
dtj�}t
|�rt|j}i}i}t�}|jD]d}|dkr�q�z||||<Wq�tk
r�z||||<Wntk
r�|�|�YnXYq�Xq�t||||�S)a
    Get the mapping of free variables to their current values.

    Returns a named tuple of dicts mapping the current nonlocal, global
    and builtin references as seen by the body of the function. A final
    set of unbound names that could not be resolved is also provided.
    �{!r} is not a Python functionNcSsi|]\}}||j�qSr
)�
cell_contents)rg�varZcellr
r
r�
<dictcomp>�s�z"getclosurevars.<locals>.<dictcomp>�__builtins__)�None�True�False)rr"rr�r�r&�__closure__�zip�co_freevars�__globals__r�r�rJrrW�co_names�KeyErrorr\r�)	r��codeZ
nonlocal_varsZ	global_nsZ
builtin_nsZglobal_varsZbuiltin_varsZ
unbound_namesrNr
r
r�getclosurevarszs>	
�
�r��	Tracebackz+filename lineno function code_context indexr�cCs�t|�r|j}|j}n|j}t|�s2td�|���t|�p@t|�}|dkr�|d|d}zt	|�\}}Wnt
k
r�d}}Yq�Xtdt|t
|�|��}||||�}|d|}nd}}t|||jj||�S)a�Get information about a frame or traceback object.

    A tuple of five things is returned: the filename, the line number of
    the current line, the function name, a list of lines of context from
    the source code, and the index of the current line within that list.
    The optional second argument specifies the number of lines of context
    to return, which are centered around the current line.z'{!r} is not a frame or traceback objectrr�r�N)r<�	tb_linenor��f_linenor>r�r�r�r�r�r��maxr�r�r�r�r)rR�context�linenor�r�r�r��indexr
r
r�getframeinfo�s$r�cCs|jS)zCGet the line number from a frame object, allowing for optimization.)r��rRr
r
r�	getlineno�sr��	FrameInfor�cCs2g}|r.|ft||�}|�t|��|j}q|S)z�Get a list of records for a frame and all higher (calling) frames.

    Each record contains a frame object, filename, line number, function
    name, a list of lines of context, and index within the context.)r�rZr��f_back)rRr��	framelist�	frameinfor
r
r�getouterframes�sr�cCs4g}|r0|jft||�}|�t|��|j}q|S)z�Get a list of records for a traceback's frame and all lower frames.

    Each record contains a frame object, filename, line number, function
    name, a list of lines of context, and index within the context.)r�r�rZr��tb_next)�tbr�r�r�r
r
r�getinnerframes�sr�cCsttd�rt�d�SdS)z?Return the frame of the caller or None if this is not possible.�	_getframer�N)rr�r�r
r
r
r�currentframe�sr�cCstt�d�|�S)z@Return a list of records for the stack above the caller's frame.r�)r�r�r��r�r
r
r�stack�sr�cCstt��d|�S)zCReturn a list of records for the stack below the current exception.r�)r�r��exc_infor�r
r
r�trace�sr�cCstjd�|�S)Nry)r
rJr)�klassr
r
r�_static_getmrosr�cCs8i}zt�|d�}Wntk
r(YnXt�||t�S�NrJ)r	�__getattribute__r[r�r��	_sentinel)r,�attrZ
instance_dictr
r
r�_check_instancesr�c	CsHt|�D]:}tt|��tkrz|j|WStk
r@YqXqtSrf)r��_shadowed_dictr
r�rJr�)r�r��entryr
r
r�_check_class
sr�cCs(zt|�Wntk
r"YdSXdS�NFT)r�r�r+r
r
r�_is_types
r�c	Csntjd}t|�D]V}z|�|�d}Wntk
r<YqXt|�tjkr`|jdkr`|j|ks|Sqt	Sr�)
r
rJr�rr�rrr�rjr�)r��	dict_attrr�Z
class_dictr
r
rr�s
��
r�c	Cst}t|�s>t|�}t|�}|tks2t|�tjkrBt||�}n|}t||�}|tk	r�|tk	r�tt|�d�tk	r�tt|�d�tk	r�|S|tk	r�|S|tk	r�|S||kr�tt|��D]:}tt|��tkr�z|j	|WSt
k
r�Yq�Xq�|tk	r�|St|��dS)a�Retrieve attributes without triggering dynamic lookup via the
       descriptor protocol,  __getattr__ or __getattribute__.

       Note: this function may not be able to retrieve all attributes
       that getattr can fetch (like dynamically created attributes)
       and may find attributes that getattr can't (like descriptors
       that raise AttributeError). It can also return descriptor objects
       instead of instance members in some cases. See the
       documentation for details.
    rrN)r�r�r
r�rrr�r�r�rJr�r[)r,r�rEZinstance_resultr�r�Zklass_resultr�r
r
r�getattr_static+s:�
�r��GEN_CREATED�GEN_RUNNING�
GEN_SUSPENDED�
GEN_CLOSEDcCs,|jr
tS|jdkrtS|jjdkr(tStS)a#Get current state of a generator-iterator.

    Possible states are:
      GEN_CREATED: Waiting to start execution.
      GEN_RUNNING: Currently being executed by the interpreter.
      GEN_SUSPENDED: Currently suspended at a yield expression.
      GEN_CLOSED: Execution has completed.
    Nr�)�
gi_runningr��gi_framer��f_lastir�r�)�	generatorr
r
r�getgeneratorstate`s	
r�cCs:t|�std�|���t|dd�}|dk	r2|jjSiSdS)z�
    Get the mapping of generator local variables to their current values.

    A dict is returned, with the keys the local variable names and values the
    bound values.z{!r} is not a Python generatorr�N)r3r�r�rLr�rQ)r�rRr
r
r�getgeneratorlocalsrsr��CORO_CREATED�CORO_RUNNING�CORO_SUSPENDED�CORO_CLOSEDcCs,|jr
tS|jdkrtS|jjdkr(tStS)a&Get current state of a coroutine object.

    Possible states are:
      CORO_CREATED: Waiting to start execution.
      CORO_RUNNING: Currently being executed by the interpreter.
      CORO_SUSPENDED: Currently suspended at an await expression.
      CORO_CLOSED: Execution has completed.
    Nr�)�
cr_runningr��cr_framer�r�r�r�)�	coroutiner
r
r�getcoroutinestate�s	
r�cCs"t|dd�}|dk	r|jSiSdS)z�
    Get the mapping of coroutine local variables to their current values.

    A dict is returned, with the keys the local variable names and values the
    bound values.r�N)rLrQ)r�rRr
r
r�getcoroutinelocals�sr��
from_bytescCs8zt||�}Wntk
r$YdSXt|t�s4|SdS)z�Private helper. Checks if ``cls`` has an attribute
    named ``method_name`` and returns it only if it is a
    pure python function.
    N)rLr[r�_NonUserDefinedCallables)rhZmethod_nameZmethr
r
r�"_signature_get_user_defined_method�s
r�c
Cs�|j}t|���}|jpd}|jp$i}|r2||}z|j||�}Wn6tk
rx}zd�|�}	t|	�|�W5d}~XYnXd}
|��D�]\}}z|j	|}
Wnt
k
r�YnlX|jtkr�|�
|�q�|jtk�r||kr�d}
|j|
d�||<n|�
|j�q�|jtk�r|j|
d�||<|
r�|jtk	�s2t�|jtk�rb||jtd�}|||<|�|�q�|jttfk�r~|�|�q�|jtkr�|�
|j�q�|j|��d�S)	z�Private helper to calculate how 'wrapped_sig' signature will
    look like after applying a 'functools.partial' object (or alike)
    on it.
    r
z+partial object {!r} has incorrect argumentsNFT)rE�rw�rB)rBrrKr'�keywords�bind_partialr�r�r��	argumentsr�rwrDr�rFrVrNrH�AssertionError�move_to_endrIrGrC)�wrapped_sig�partialZ
extra_argsZ
old_params�
new_paramsZpartial_argsZpartial_keywordsZbarLr}Ztransform_to_kwonly�
param_namerOZ	arg_valueZ	new_paramr
r
r�_signature_get_partial�sN






r�cCslt|j���}|r$|djttfkr,td��|dj}|ttfkrP|dd�}n|t	k	r`td��|j
|d�S)zWPrivate helper to transform signatures for unbound
    functions to bound methods.
    rzinvalid method signaturer�Nzinvalid argument typer�)rnrBrCrwrIrHr�rFrDrGrV)rK�paramsrwr
r
r�_signature_bound_methods
r�cCs&t|�p$t|�p$t|t�p$|ttfkS)zxPrivate helper to test if `obj` is a callable that might
    support Argument Clinic's __text_signature__ protocol.
    )rBrrr�r
r	r+r
r
r�_signature_is_builtin.s��
�r�cCs�t|�rt|�rdSt|dd�}t|dd�}t|dt�}t|dt�}t|dd�}t|tj�o�t|t�o�|dksxt|t�o�|dks�t|t	�o�t|t	�S)z�Private helper to test if `obj` is a duck type of FunctionType.
    A good example of such objects are functions compiled with
    Cython, which have all attributes that a pure Python function
    would have, but have their code statically compiled.
    Fr�Nr&�__defaults__�__kwdefaults__�__annotations__)
�callablerrL�_voidrrr?r�rnr�)r,rNr�r4rNrMr
r
r�_signature_is_functionlike:s ����r�cCsr|�d�st�|�d�}|dkr*|�d�}|�d�}|dksH||ksHt�|�d�}|dksf||ksft�|d|�S)z� Private helper to get first parameter name from a
    __text_signature__ of a builtin method, which should
    be in the following format: '($param1, ...)'.
    Assumptions are that the first argument won't have
    a default value or an annotation.
    z($�,r�r�:rar�)r�r��find)roryZcposr
r
r�_signature_get_bound_paramSs



r�cCsd|s|ddfSd}d}dd�|�d�D�}t|�j}t�|�}d}d}g}|j}	d}
tj}tj}t|�}
|
j	tj
ksxt�|D]�}
|
j	|
j}}||kr�|dkr�|r�d}q||r�t�d}|
d	7}
q||d
kr�|r�t�|dks�t�d}|
d	}q|||k�r|dk�r|dk�s
t�|
}q||�r6d}||k�r.|dk�s6|	d
�|	|�|dkr||	d�q|d�
|�}|||fS)a�
    Private helper function. Takes a signature in Argument Clinic's
    extended signature format.

    Returns a tuple of three things:
      * that signature re-rendered in standard Python syntax,
      * the index of the "self" parameter (generally 0), or None if
        the function does not have a "self" parameter, and
      * the index of the last "positional only" parameter,
        or None if the signature has no positional-only parameters.
    NcSsg|]}|�d��qS)�ascii)�encode)rg�lr
r
rr�}sz6_signature_strip_non_python_syntax.<locals>.<listcomp>r�Frr�Tr��/�$rri� r�)r�rrrrZr�OP�
ERRORTOKEN�nextr
�ENCODINGr��stringr�)�	signature�self_parameter�last_positional_onlyr�r�Ztoken_streamZ
delayed_commaZskip_next_commardr\Zcurrent_parameterr�r��tr
r��clean_signaturer
r
r�"_signature_strip_non_python_syntaxjsZ





r�Tc	sjddl�|j�t|�\}}}d|d}z��|�}Wntk
rNd}YnXt|�j�sjtd�|���|j	d}	g��j
�t��d}i�t|dd�}
|
r�t
j�|
d�}|r�|j�t
j���	�fdd�����	fd	d
��
G��
fdd�d�j���f��������fd
d�	}t|	jj�}t|	jj�}
tj||
dd�}|dk	�rJ�j�n�j�ttt|���D](\}\}}|||�||k�r`�j��q`|	jj�r��j�||	jj���j�t|	jj |	jj!�D]\}}|||��q�|	jj"�r�j#�||	jj"��|dk	�r\��st$�t|dd�}|dk	}t%|�}|�rB|�s6|�rB��&d�n�dj'�jd�}|�d<|�|j
d�S)zdPrivate helper to parse content of '__text_signature__'
    and return a Signature based on it.
    rNzdef fooz: passz"{!r} builtin has invalid signaturer�cs(t|�j�st�|jdk	r"td��|jS)Nz'Annotations are not currently supported)rrer�rJr�)�node)�astr
r�
parse_name�s
z&_signature_fromstr.<locals>.parse_namecs|zt|��}Wn>tk
rLzt|��}Wntk
rFt��YnXYnXt|tttttt	d�f�rr��
|�St��dSrf)�eval�	NameError�RuntimeErrorrr��int�float�bytesr%r
ZConstant)r�rO)r��module_dict�sys_module_dictr
r�
wrap_value�s
z&_signature_fromstr.<locals>.wrap_valuecs(eZdZ��fdd�Z��fdd�ZdS)z,_signature_fromstr.<locals>.RewriteSymbolicscs\g}|}t|�j�r(|�|j�|j}qt|�j�s:t��|�|j�d�t	|��}�|�S)Nr�)
rrerZr�rO�Namer�r�r��reversed)r�r��arrO�r�rr
r�visit_Attribute�sz<_signature_fromstr.<locals>.RewriteSymbolics.visit_Attributecst|j�j�st���|j�Srf)rZctxZLoadr�r�)r�r�r	r
r�
visit_Name�sz7_signature_fromstr.<locals>.RewriteSymbolics.visit_NameN)r�r�r�r
rr
r	r
r�RewriteSymbolics�srcs��|�}|�krdS|rp|tk	rpz���|�}��|�}Wntk
rR�}YnX|�kr`dS|�k	rl|n|}���|�|�d��dS)N�rErJ)�_emptyZvisitZliteral_evalr�rZ)Z	name_nodeZdefault_noderErN�o)�	Parameterrr�rA�invalidrwrBr�r
r�p�s
z_signature_fromstr.<locals>.p)�	fillvaluer�r��r@)(r��_parameter_clsr��parse�SyntaxErrorrZModuler�r�ZbodyrAr	rLr�r�r�rJr�ZNodeTransformerrr'r4�	itertools�zip_longest�POSITIONAL_ONLY�POSITIONAL_OR_KEYWORDrjr"Zvararg�VAR_POSITIONAL�KEYWORD_ONLYr�r(Zkw_defaultsr��VAR_KEYWORDr�rr�rV)rhr,r�r;r�r�r�Zprogramr�r(Zmodule_namerr'r4rr�rNrEZ_selfZself_isboundZ
self_ismoduler
)rrr�rArrwrrBr�rrr�_signature_fromstr�sp�











rcCsBt|�std�|���t|dd�}|s4td�|���t||||�S)zHPrivate helper function to get signature for
    builtin callables.
    z%{!r} is not a Python builtin function�__text_signature__Nz#no signature found for builtin {!r})r�r�r�rLr�r)rhr�r;r�r
r
r�_signature_from_builtin<s�r!c	CsHd}t|�s(t|�rd}ntd�|���t|dd�}|rFt||||�S|j}|j}|j}|j	}|j
}	|d|�}
|j}||||�}|j}
|j
}|j}|r�t|�}nd}g}||}|	}|
d|�D]<}|r�tnt}|
�|t�}|�||||d��|r�|d8}q�t|
|d��D]L\}}|�r&tnt}|
�|t�}|�||||||d	��|�r|d8}�q|jt@�r�|||}|
�|t�}|�|||td��|D]B}t}|dk	�r�|�|t�}|
�|t�}|�|||t|d	���q�|jt@�r2||}|jt@�r
|d7}||}|
�|t�}|�|||td��|||
�d
t�|d�S)zCPrivate helper: constructs Signature for the given python function.FTr�r Nr)rJrwr�)rJrwrEr=�r@�__validate_parameters__)rr�r�r�rLrrr&r r�co_posonlyargcountr!r�r�r�r�rDrFr�rrZrjr'r#rGrHr$rI)rhr�r;Zis_duck_functionr�rZ	func_codeZ	pos_countZ	arg_namesZ
posonly_countrvZkeyword_only_countZkeyword_onlyrMr4rNZpos_default_countrBZnon_default_countZposonly_leftrNrwrJ�offsetrEr�r
r
r�_signature_from_functionLs�

�

�
�

�
�
�r&)r:r;c
Cs�t|�std�|���t|tj�rDt|j|||d�}|r@t|�S|S|rtt	|dd�d�}t|tj�rtt||||d�Sz
|j
}Wntk
r�Yn&X|dk	r�t|t�s�td�|���|Sz
|j
}Wntk
r�Yn�Xt|tj��rdt|j|||d�}t||d�}t|j���d	}|jtjk�r(|St|j���}|�rN||d	k	�sNt�|f|}	|j|	d
�St|��sxt|��r�t|||d�St|��r�t|||d�St|tj��r�t|j|||d�}t||�Sd}t|t ��r�t!t |�d�}
|
dk	�rt|
|||d�}nJt!|d
�}|dk	�r(t||||d�}n$t!|d�}|dk	�rLt||||d�}|dk�rX|j"dd�D]>}
z
|
j#}Wntk
�r�YnX|�rdt$|||�S�qdt |j"k�rX|j%t&j%k�r�|j't&j'k�r�|�(t&�St)d�|���nrt|t*��sXt!t |�d�}
|
dk	�rXzt|
|||d�}Wn8t)k
�rV}zd�|�}t)|�|�W5d}~XYnX|dk	�rt|�rpt|�S|St|tj+��r�d�|�}t)|��t)d�|���dS)zQPrivate helper function to get signature for arbitrary
    callable objects.
    z{!r} is not a callable objectr9cSs
t|d�S)N�
__signature__r~rr
r
rrR�rSz*_signature_from_callable.<locals>.<lambda>rzNz1unexpected object {!r} in __signature__ attributerfrr�)r;�__call__�__new__r�r�z(no signature found for builtin type {!r}zno signature found for {!r}z,no signature found for builtin function {!r}z+callable {!r} is not supported by signature),r�r�r�rrrr>r"r�r�r'r[r?�_partialmethodr#�
partialmethodr�r�rnrBrCrwrrr�rVrr�r&r�r!r�r
r�ryr rr�r	r)�
from_callabler�r�rA)r,r:r;r<rKr+r�Zfirst_wrapped_paramZ
sig_paramsr�Zcall�newZinitrPZtext_sigrLr}r
r
rr>�s
	��

��
�
�
�
��

�

�

�


�
�
�



r>c@seZdZdZdS)r�z1A private marker - used in Parameter & Signature.N�r�r�r�r�r
r
r
rr�t	sr�c@seZdZdZdS)rz6Marker object for Signature.empty and Parameter.empty.Nr.r
r
r
rrx	src@s4eZdZdZdZdZdZdZdd�Ze	dd	��Z
d
S)�_ParameterKindrr�r���cCs|jSrf)�_name_r�r
r
r�__str__�	sz_ParameterKind.__str__cCst|Srf)�_PARAM_NAME_MAPPINGr�r
r
r�description�	sz_ParameterKind.descriptionN)r�r�r�rrrrrr3rkr5r
r
r
rr/|	sr/zpositional-onlyzpositional or keywordzvariadic positionalrwzvariadic keywordc@s�eZdZdZdZeZeZe	Z
eZe
ZeZeed�dd�Zdd�Zdd	�Zed
d��Zedd
��Zedd��Zedd��Zeeeed�dd�Zdd�Zdd�Zdd�Zdd�ZdS)raRepresents a parameter in a function signature.

    Has the following public attributes:

    * name : str
        The name of the parameter as a string.
    * default : object
        The default value for the parameter if specified.  If the
        parameter has no default value, this attribute is set to
        `Parameter.empty`.
    * annotation
        The annotation for the parameter if specified.  If the
        parameter has no annotation, this attribute is set to
        `Parameter.empty`.
    * kind : str
        Describes how argument values are bound to the parameter.
        Possible values: `Parameter.POSITIONAL_ONLY`,
        `Parameter.POSITIONAL_OR_KEYWORD`, `Parameter.VAR_POSITIONAL`,
        `Parameter.KEYWORD_ONLY`, `Parameter.VAR_KEYWORD`.
    )�_name�_kind�_default�_annotationr
cCszt|�|_Wn$tk
r2td|�d���YnX|tk	rd|jttfkrdd}|�|jj�}t|��||_||_	|tkr�td��t
|t�s�d�t|�j
�}t|��|ddkr�|dd���r�|jtkr�d	}|�|jj�}t|��t|_d
�|dd��}|���std�|���||_dS)Nzvalue z is not a valid Parameter.kindz({} parameters cannot have default valuesz*name is a required attribute for Parameterzname must be a str, not a {}rr�r�zLimplicit arguments must be passed as positional or keyword arguments, not {}z
implicit{}z"{!r} is not a valid parameter name)r/r7r�rrGrIr�r5r8r9rr�r
r�r��isdigitrFrD�isidentifierr6)r�rNrwrErJr}r
r
rr��	s6

�
zParameter.__init__cCs t|�|j|jf|j|jd�fS)N�r8r9)r
r6r7r8r9r�r
r
r�
__reduce__�	s
��zParameter.__reduce__cCs|d|_|d|_dS)Nr8r9r<�r��stater
r
r�__setstate__�	s
zParameter.__setstate__cCs|jSrf)r6r�r
r
rrN�	szParameter.namecCs|jSrf)r8r�r
r
rrE�	szParameter.defaultcCs|jSrf)r9r�r
r
rrJ�	szParameter.annotationcCs|jSrf)r7r�r
r
rrw�	szParameter.kind)rNrwrJrEcCsL|tkr|j}|tkr|j}|tkr*|j}|tkr8|j}t|�||||d�S)z+Creates a customized copy of the Parameter.r
)r�r6r7r9r8r
)r�rNrwrJrEr
r
rrV�	szParameter.replacecCs�|j}|j}|jtk	r(d�|t|j��}|jtk	rb|jtk	rPd�|t|j��}nd�|t|j��}|tkrtd|}n|t	kr�d|}|S)Nz{}: {}z{} = {}z{}={}r\r_)
rwr6r9rr�rWr8rUrGrI)r�rw�	formattedr
r
rr3
s
�


zParameter.__str__cCsd�|jj|�S)Nz	<{} "{}">�r�r�r�r�r
r
r�__repr__#
szParameter.__repr__cCst|j|j|j|jf�Srf)�hashrNrwrJrEr�r
r
r�__hash__&
szParameter.__hash__cCsJ||krdSt|t�stS|j|jkoH|j|jkoH|j|jkoH|j|jkS�NT)rr�NotImplementedr6r7r8r9�r��otherr
r
r�__eq__)
s

�
�
�zParameter.__eq__N)r�r�r�r�r�rDrrFrrGrrHrrIrrrAr�r=r@rkrNrErJrwr�rVr3rCrErJr
r
r
rr�	s6(



�rc@sheZdZdZdZdd�Zedd��Zedd��Zed	d
��Z	dd�Z
d
d�Zdd�Zdd�Z
dd�ZdS)�BoundArgumentsaResult of `Signature.bind` call.  Holds the mapping of arguments
    to the function's parameters.

    Has the following public attributes:

    * arguments : OrderedDict
        An ordered mutable mapping of parameters' names to arguments' values.
        Does not contain arguments' default values.
    * signature : Signature
        The Signature object that created this instance.
    * args : tuple
        Tuple of positional arguments values.
    * kwargs : dict
        Dict of keyword arguments values.
    )r��
_signature�__weakref__cCs||_||_dSrf)r�rL)r�r�r�r
r
rr�G
szBoundArguments.__init__cCs|jSrf)rLr�r
r
rr�K
szBoundArguments.signaturec	Cs~g}|jj��D]d\}}|jttfkr*qvz|j|}Wntk
rRYqvYqX|jtkrj|�	|�q|�
|�qt|�Srf)rLrBrKrwrIrHr�r�rG�extendrZrn)r�r'r�rOrer
r
rr'O
s
zBoundArguments.argsc	Cs�i}d}|jj��D]x\}}|sD|jttfkr4d}n||jkrDd}q|sJqz|j|}Wntk
rlYqX|jtkr�|�|�q|||<q|Sr�)	rLrBrKrwrIrHr�r��update)r��kwargsZkwargs_startedr�rOrer
r
rrPf
s&


zBoundArguments.kwargsc	Cs�|j}g}|jj��D]x\}}z|�|||f�Wqtk
r�|jtk	rV|j}n$|jt	krfd}n|jt
krvi}nYq|�||f�YqXqt|�|_dS)z�Set default values for missing arguments.

        For variable-positional arguments (*args) the default is an
        empty tuple.

        For variable-keyword arguments (**kwargs) the default is an
        empty dict.
        r
N)r�rLrBrKrZr�rErrwrGrIr)r�r�Z
new_argumentsrNrO�valr
r
r�apply_defaults�
s	


zBoundArguments.apply_defaultscCs2||krdSt|t�stS|j|jko0|j|jkSrF)rrKrGr�r�rHr
r
rrJ�
s

�zBoundArguments.__eq__cCs|d|_|d|_dS)NrLr��rLr�r>r
r
rr@�
s
zBoundArguments.__setstate__cCs|j|jd�S)NrSrSr�r
r
r�__getstate__�
szBoundArguments.__getstate__cCs@g}|j��D]\}}|�d�||��qd�|jjd�|��S)Nz{}={!r}z	<{} ({})>ri)r�rKrZr�r�r�r�)r�r'rerOr
r
rrC�
szBoundArguments.__repr__N)r�r�r�r�r�r�rkr�r'rPrRrJr@rTrCr
r
r
rrK4
s


rKc@s�eZdZdZdZeZeZe	Z
d,e	dd�dd�Zedd	��Z
ed
d��Zedd�d
d��Zedd��Zedd��Zeed�dd�Zdd�Zdd�Zdd�Zdd�dd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�ZdS)-r?aA Signature object represents the overall signature of a function.
    It stores a Parameter object for each parameter accepted by the
    function, as well as information specific to the function itself.

    A Signature object has the following public attributes and methods:

    * parameters : OrderedDict
        An ordered mapping of parameters' names to the corresponding
        Parameter objects (keyword-only arguments are in the same order
        as listed in `code.co_varnames`).
    * return_annotation : object
        The annotation for the return type of the function if specified.
        If the function has no annotation for its return type, this
        attribute is set to `Signature.empty`.
    * bind(*args, **kwargs) -> BoundArguments
        Creates a mapping from positional and keyword arguments to
        parameters.
    * bind_partial(*args, **kwargs) -> BoundArguments
        Creates a partial mapping from positional and keyword arguments
        to parameters (simulating 'functools.partial' behavior.)
    )�_return_annotation�_parametersNTr"cCs�|dkrt�}n�|r�t�}t}d}t|�D]�\}}|j}	|j}
|	|krdd}|�|j|	j�}t|��n|	|krtd}|	}|	ttfkr�|j	t
kr�|r�d}t|��nd}|
|kr�d�|
�}t|��|||
<q*ntdd�|D��}t�|�|_
||_dS)	z�Constructs Signature from the given list of Parameter
        objects and 'return_annotation'.  All arguments are optional.
        NFz7wrong parameter order: {} parameter before {} parameterz-non-default argument follows default argumentTzduplicate parameter name: {!r}css|]}|j|fVqdSrfr]�rgrOr
r
rris�z%Signature.__init__.<locals>.<genexpr>)rrDrjrwrNr�r5r�rFrErr�MappingProxyTyperVrU)r�rBr@r#r�Ztop_kindZ
kind_defaults�idxrOrwrNr}r
r
rr��
sD��



�zSignature.__init__cCstjdtdd�t||�S)z�Constructs Signature for the given python function.

        Deprecated since Python 3.5, use `Signature.from_callable()`.
        z_inspect.Signature.from_function() is deprecated since Python 3.5, use Signature.from_callable()r�r.)r0r1r2r&�rhr�r
r
r�
from_functions
�zSignature.from_functioncCstjdtdd�t||�S)z�Constructs Signature for the given builtin function.

        Deprecated since Python 3.5, use `Signature.from_callable()`.
        z^inspect.Signature.from_builtin() is deprecated since Python 3.5, use Signature.from_callable()r�r.)r0r1r2r!rZr
r
r�from_builtins
�zSignature.from_builtin��follow_wrappedcCst|||d�S)z3Constructs Signature for the given callable object.)r<r:)r>)rhr,r^r
r
rr,#s�zSignature.from_callablecCs|jSrf)rVr�r
r
rrB)szSignature.parameterscCs|jSrf�rUr�r
r
rr@-szSignature.return_annotation)rBr@cCs0|tkr|j��}|tkr |j}t|�||d�S)z�Creates a customized copy of the Signature.
        Pass 'parameters' and/or 'return_annotation' arguments
        to override them in the new copy.
        r)r�rBrCrUr
)r�rBr@r
r
rrV1s
�zSignature.replacecCs8tdd�|j��D��}dd�|j��D�}|||jfS)Ncss|]}|jtkr|VqdSrf)rwrHrWr
r
rriAs
�z(Signature._hash_basis.<locals>.<genexpr>cSsi|]}|jtkr|j|�qSr
)rwrHrNrWr
r
rr�Ds
�z)Signature._hash_basis.<locals>.<dictcomp>)rnrBrCr@)r�r��
kwo_paramsr
r
r�_hash_basis@szSignature._hash_basiscCs(|��\}}}t|���}t|||f�Srf)ra�	frozensetrCrD)r�r�r`r@r
r
rrEIszSignature.__hash__cCs*||krdSt|t�stS|��|��kSrF)rr?rGrarHr
r
rrJNs

zSignature.__eq__F�r�cCs�t�}t|j���}d}t|�}zt|�}Wn�tk
�rzt|�}	Wntk
rfYY�q�Yn�X|	jtkrzY�q�n�|	j|kr�|	jt	kr�d}
|
j
|	jd�}
t|
�d�|	f}Y�q�nP|	jtks�|	j
tk	r�|	f}Y�q�n.|r�|	f}Y�q�nd}
|
j
|	jd�}
t|
�d�Yq Xzt|�}	Wn tk
�r:td�d�Yq X|	jttfk�rVtd�d�|	jtk�r�|g}|�|�t|�||	j<�q�|	j|k�r�|	jt	k�r�tdj
|	jd��d�|||	j<q d}t�||�D]�}	|	jtk�r�|	}�q�|	jtk�r�q�|	j}
z|�|
�}WnFtk
�rN|�sJ|	jtk�rJ|	j
tk�rJtdj
|
d��d�Yn(X|	jt	k�rntdj
|	jd���|||
<�q�|�r�|dk	�r�|||j<ntdj
tt|��d���|�||�S)	z#Private method. Don't use directly.r
zA{arg!r} parameter is positional only, but was passed as a keyword)reNz$missing a required argument: {arg!r}ztoo many positional argumentsz$multiple values for argument {arg!r}z*got an unexpected keyword argument {arg!r})rrrBrCr��
StopIterationrwrGrNrDr�r�rIrErrHrNrnr�chainr�r��_bound_arguments_cls)r�r'rPr�r�rBZ
parameters_exZarg_valsZarg_valrOr}rCZkwargs_paramr�r
r
r�_bindUs�




���
�������

��zSignature._bindcOs|�||�S)z�Get a BoundArguments object, that maps the passed `args`
        and `kwargs` to the function's signature.  Raises `TypeError`
        if the passed arguments can not be bound.
        �rg�r�r'rPr
r
r�bind�szSignature.bindcOs|j||dd�S)z�Get a BoundArguments object, that partially maps the
        passed `args` and `kwargs` to the function's signature.
        Raises `TypeError` if the passed arguments can not be bound.
        Trcrhrir
r
rr��szSignature.bind_partialcCs t|�t|j���fd|jifS�NrU)r
rnrVrCrUr�r
r
rr=�s�zSignature.__reduce__cCs|d|_dSrkr_r>r
r
rr@�szSignature.__setstate__cCsd�|jj|�S)Nz<{} {}>rBr�r
r
rrC�szSignature.__repr__c	Cs�g}d}d}|j��D]d}t|�}|j}|tkr6d}n|rH|�d�d}|tkrVd}n|tkrp|rp|�d�d}|�|�q|r�|�d�d�d�	|��}|j
tk	r�t|j
�}|d�|�7}|S)NFTr�r\z({})riz -> {})
rBrCr�rwrDrZrGrHr�r�r@rrW)	r�ruZrender_pos_only_separatorZrender_kw_only_separatorrOrArwZrenderedZannor
r
rr3�s0




zSignature.__str__)N)r�r�r�r�r�rrrKrfrrAr�rsr[r\r,rkrBr@r�rVrarErJrgrjr�r=r@rCr3r
r
r
rr?�
s<�7



	r?r]cCstj||d�S)z/Get a signature object for the passed callable.r])r?r,)r,r^r
r
rr�sr�c
Cs�ddl}ddl}|��}|jddd�|jdddd	d
�|��}|j}|�d�\}}}z|�|�}}	WnNtk
r�}
z0d�	|t
|
�j|
�}t|t
jd
�t
�d�W5d}
~
XYnX|r�|�d�}|	}|D]}
t||
�}q�|	jt
jk�rtdt
jd
�t
�d�|j�r�td�	|��td�	t|	���td�	|	j��||	k�rxtd�	t|	j���t|	d��r�td�	|	j��n6zt|�\}}Wntk
�r�YnXtd�	|��td�ntt|��dS)z6 Logic for inspecting an object given at command line rNr	zCThe object to be analysed. It supports the 'module:qualname' syntax)�helpz-dz	--details�
store_truez9Display info about the module rather than its source code)�actionrlr�zFailed to import {} ({}: {}))r�r�r�z#Can't get info for builtin modules.r�z
Target: {}z
Origin: {}z
Cached: {}z
Loader: {}�__path__zSubmodule search path: {}zLine: {}r�)�argparser��ArgumentParser�add_argument�
parse_argsr	�	partition�
import_moduleror�r
r��printr��stderr�exitr�rL�builtin_module_namesZdetailsr��
__cached__rUr�rror�r)rpr��parserr'�targetZmod_nameZ	has_attrs�attrsr,r�rvr}�parts�part�__r�r
r
r�_main$s`���



r�r�)N)N)N)F)N)r�)r�)r�)r�)r�)r
)T)T)T)�r��
__author__r8�disZcollections.abcr7�enum�importlib.machineryr�rr�r�r�r�rrrr0r#r��operatorrrr�globalsZmod_dictZCOMPILER_FLAG_NAMESrKrbrcrGrrrrrrrr rr*r-r.r/r1r3r5r:r<r>r@rBrCrQrdrerxrVr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�ror�r�rrrrrrr,r-r7r8r3rPrSrWrZr�rprsr|r~r�r�r�r�r�r��_fieldsr�r�r�r�r�r�r	r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r
r(Z_WrapperDescriptor�allZ_MethodWrapperrrJZ_ClassMethodWrapperrAr�r�r�r�r�r�r�r�rr!r&r>r�r�IntEnumr/rrDrrFrrGrrHrrIr4rrKr?r�r�r�r
r
r
r�<module>sz	




	
,
t$
>
	
.N->




�]


	�
;�
<
5

 



		0

�
LH
_�K�	k:
__pycache__/code.cpython-38.pyc000064400000023273151153537560012340 0ustar00U

e5d~)�@s�dZddlZddlZddlmZmZddddgZGdd�d�ZGd	d�de�Zdd
d�Z	e
dkr�ddlZe��Z
e
jdd
dd�e
��Zejs�ejjr�dZndZe	e�dS)z?Utilities needed to emulate Python's interactive interpreter.

�N)�CommandCompiler�compile_command�InteractiveInterpreter�InteractiveConsole�interactrc@sFeZdZdZddd�Zddd�Zd	d
�Zddd�Zd
d�Zdd�Z	dS)rz�Base class for InteractiveConsole.

    This class deals with parsing and interpreter state (the user's
    namespace); it doesn't deal with input buffering or prompting or
    input file naming (the filename is always passed in explicitly).

    NcCs$|dkrddd�}||_t�|_dS)aConstructor.

        The optional 'locals' argument specifies the dictionary in
        which code will be executed; it defaults to a newly created
        dictionary with key "__name__" set to "__console__" and key
        "__doc__" set to None.

        NZ__console__)�__name__�__doc__)�localsr�compile)�selfr	�r�/usr/lib64/python3.8/code.py�__init__s	
zInteractiveInterpreter.__init__�<input>�singlec
CsTz|�|||�}Wn&tttfk
r8|�|�YdSX|dkrFdS|�|�dS)a�Compile and run some source in the interpreter.

        Arguments are as for compile_command().

        One of several things can happen:

        1) The input is incorrect; compile_command() raised an
        exception (SyntaxError or OverflowError).  A syntax traceback
        will be printed by calling the showsyntaxerror() method.

        2) The input is incomplete, and more input is required;
        compile_command() returned None.  Nothing happens.

        3) The input is complete; compile_command() returned a code
        object.  The code is executed by calling self.runcode() (which
        also handles run-time exceptions, except for SystemExit).

        The return value is True in case 2, False in the other cases (unless
        an exception is raised).  The return value can be used to
        decide whether to use sys.ps1 or sys.ps2 to prompt the next
        line.

        FNT)r
�
OverflowError�SyntaxError�
ValueError�showsyntaxerror�runcode)r�source�filenameZsymbol�coderrr
�	runsource&s

z InteractiveInterpreter.runsourcecCs>zt||j�Wn(tk
r&�Yn|��YnXdS)a�Execute a code object.

        When an exception occurs, self.showtraceback() is called to
        display a traceback.  All exceptions are caught except
        SystemExit, which is reraised.

        A note about KeyboardInterrupt: this exception may occur
        elsewhere in this code, and may not always be caught.  The
        caller should be prepared to deal with it.

        N)�execr	�
SystemExit�
showtraceback)rrrrr
rMszInteractiveInterpreter.runcodecCs�t��\}}}|t_|t_|t_|rp|tkrpz|j\}\}}}}	Wntk
rVYnXt|||||	f�}|t_tjtj	kr�t
�||�}
|�d�
|
��nt�|||�dS)apDisplay the syntax error that just occurred.

        This doesn't display a stack trace because there isn't one.

        If a filename is given, it is stuffed in the exception instead
        of what was there before (because Python's parser always uses
        "<string>" when reading from a string).

        The output is written by self.write(), below.

        �N)�sys�exc_info�	last_type�
last_value�last_tracebackr�argsr�
excepthook�__excepthook__�	traceback�format_exception_only�write�join)rr�type�value�tb�msgZdummy_filename�lineno�offset�line�linesrrr
r`sz&InteractiveInterpreter.showsyntaxerrorcCs|t��\t_t_}}|t_zPt�|d|d|j�}tjtj	krT|�
d�|��nt�|d|d|�W5d}}XdS)z�Display the exception that just occurred.

        We remove the first stack item because it is our own code.

        The output is written by self.write(), below.

        Nr�r)rrr r!r"r&�format_exception�tb_nextr$r%r(r))rZlast_tbZeir1rrr
r�sz$InteractiveInterpreter.showtracebackcCstj�|�dS)z�Write a string.

        The base implementation writes to sys.stderr; a subclass may
        replace this with a different implementation.

        N)r�stderrr()r�datarrr
r(�szInteractiveInterpreter.write)N)rr)N)
r�
__module__�__qualname__rrrrrrr(rrrr
rs

'
#c@s>eZdZdZddd�Zdd�Zddd	�Zd
d�Zdd
d�ZdS)rz�Closely emulate the behavior of the interactive Python interpreter.

    This class builds on InteractiveInterpreter and adds prompting
    using the familiar sys.ps1 and sys.ps2, and input buffering.

    N�	<console>cCst�||�||_|��dS)z�Constructor.

        The optional locals argument will be passed to the
        InteractiveInterpreter base class.

        The optional filename argument should specify the (file)name
        of the input stream; it will show up in tracebacks.

        N)rrr�resetbuffer)rr	rrrr
r�s
zInteractiveConsole.__init__cCs
g|_dS)zReset the input buffer.N)�buffer)rrrr
r:�szInteractiveConsole.resetbuffercCsRz
tjWntk
r$dt_YnXz
tjWntk
rJdt_YnXd}|dkrx|�dtjtj||jjf�n|r�|�dt	|��d}zV|r�tj}ntj}z|�
|�}Wn&tk
r�|�d�YW�qYnX|�|�}Wq�t
k
�r|�d	�|��d}Yq�Xq�|dk�r6|�d
|jj�n|dk�rN|�d|�dS)a�Closely emulate the interactive Python console.

        The optional banner argument specifies the banner to print
        before the first interaction; by default it prints a banner
        similar to the one printed by the real Python interpreter,
        followed by the current class name in parentheses (so as not
        to confuse this with the real interpreter -- since it's so
        close!).

        The optional exitmsg argument specifies the exit message
        printed when exiting. Pass the empty string to suppress
        printing an exit message. If exitmsg is not given or None,
        a default message is printed.

        z>>> z... zFType "help", "copyright", "credits" or "license" for more information.NzPython %s on %s
%s
(%s)
z%s
r�
z
KeyboardInterrupt
znow exiting %s...
r)rZps1�AttributeErrorZps2r(�version�platform�	__class__r�str�	raw_input�EOFError�push�KeyboardInterruptr:)r�banner�exitmsgZcprt�more�promptr0rrr
r�sH


��



zInteractiveConsole.interactcCs6|j�|�d�|j�}|�||j�}|s2|��|S)aPush a line to the interpreter.

        The line should not have a trailing newline; it may have
        internal newlines.  The line is appended to a buffer and the
        interpreter's runsource() method is called with the
        concatenated contents of the buffer as source.  If this
        indicates that the command was executed or invalid, the buffer
        is reset; otherwise, the command is incomplete, and the buffer
        is left as it was after the line was appended.  The return
        value is 1 if more input is required, 0 if the line was dealt
        with in some way (this is the same as runsource()).

        r<)r;�appendr)rrr:)rr0rrHrrr
rD�szInteractiveConsole.pushrcCst|�S)aDWrite a prompt and read a line.

        The returned line does not include the trailing newline.
        When the user enters the EOF key sequence, EOFError is raised.

        The base implementation uses the built-in function
        input(); a subclass may replace this with a different
        implementation.

        )�input)rrIrrr
rBszInteractiveConsole.raw_input)Nr9)NN)r)	rr7r8rrr:rrDrBrrrr
r�s

6cCsJt|�}|dk	r||_n"zddl}Wntk
r8YnX|�||�dS)a&Closely emulate the interactive Python interpreter.

    This is a backwards compatible interface to the InteractiveConsole
    class.  When readfunc is not specified, it attempts to import the
    readline module to enable GNU readline if it is available.

    Arguments (all optional, all default to None):

    banner -- passed to InteractiveConsole.interact()
    readfunc -- if not None, replaces InteractiveConsole.raw_input()
    local -- passed to InteractiveInterpreter.__init__()
    exitmsg -- passed to InteractiveConsole.interact()

    Nr)rrB�readline�ImportErrorr)rFZreadfuncZlocalrGZconsolerLrrr
rs�__main__z-q�
store_truez*don't print version and copyright messages)�action�helpr)NNNN)rrr&Zcodeoprr�__all__rrrr�argparse�ArgumentParser�parser�add_argument�
parse_argsr#�q�flags�quietrFrrrr
�<module>s*�t
�__pycache__/shutil.cpython-38.opt-2.pyc000064400000062422151153537560013675 0ustar00U

e5d1��@s�ddlZddlZddlZddlZddlZddlZzddlZ[dZWnek
rZdZYnXzddl	Z	[	dZ
Wnek
r�dZ
YnXzddlZ[dZWnek
r�dZYnXzddl
mZWnek
r�dZYnXzddlmZWnek
�rdZYnXejdkZdZZejdk�r2ddlZne�r@ddlZe�rJdnd	Zeed
��odej�d�ae�oteed�Zd
Zddddddddddddddddddd d!d"d#d$d%d&gZGd'd�de�ZGd(d&�d&e�ZGd)d�de�Z Gd*d�de�Z!Gd+d,�d,e�Z"Gd-d.�d.e#�Z$Gd/d0�d0e#�Z%d1d2�Z&d3d4�Z'efd5d6�Z(d�d7d�Z)d8d9�Z*d:d;�Z+d<d=�Z,dd>�d?d�Z-dd>�d@d�Z.eedA��r�dd>�dBdC�Z/ndDdC�Z/dd>�dEd�Z0dd>�dFd�Z1dd>�dGd�Z2dHd"�Z3d�dIdJ�Z4dde2ddfdKd�Z5eej6dL��rdMdN�Z7dOdP�Z8ndQdN�Z7dRdP�Z8dSdT�Z9dUdV�Z:ej;ejej<ej=hej>k�obej?ej@k�obejejAkZBd�dWd�ZCeBeC_DdXdY�ZEe2fdZd�ZFd[d\�ZGd]d^�ZHd_d`�ZIdadb�ZJd�ddde�ZKd�dfdg�ZLdheKdigdjfiZMe�r�eKdkgdlfeMdm<eLgdnfeMdo<e
�reKdpgdqfeMdr<e�reKdsgdtfeMdu<dvd�ZNd�dxd�ZOdyd�ZPd�dzd�ZQd{d�ZRd|d}�ZSd�d~d�ZTdd �ZUd�d��ZVd�d��ZWdd��d�d��ZXd�geXgdjfd�geWgdnfd��ZYe�r�d�d�geXgdlfeYdm<e
�r�d�d�geXgdqfeYdr<e�r�d�d�geXgdtfeYdu<d�d��ZZd�dd��d�d!�Z[eed���rHe�\d��e�]d�d��Z^d�e^j__`d�e^ja_`d�e^jb_`d�d��Zcn$e�rle�\d��e�]d�d��Z^d�d��Zcd�d�d#�Zdd�d�d%�Zed�d��ZfejgejhBdfd�d$�ZidS)��NTF)�getpwnam)�getgrnam�nt�posixii�sendfileZlinux�
_fcopyfilez%.COM;.EXE;.BAT;.CMD;.VBS;.JS;.WS;.MSC�copyfileobj�copyfile�copymode�copystat�copy�copy2�copytree�move�rmtree�Error�SpecialFileError�	ExecError�make_archive�get_archive_formats�register_archive_format�unregister_archive_format�get_unpack_formats�register_unpack_format�unregister_unpack_format�unpack_archive�ignore_patterns�chown�which�get_terminal_size�
SameFileErrorc@seZdZdS)rN��__name__�
__module__�__qualname__�r%r%�/usr/lib64/python3.8/shutil.pyrEsc@seZdZdS)r Nr!r%r%r%r&r Hsc@seZdZdS)rNr!r%r%r%r&rKsc@seZdZdS)rNr!r%r%r%r&rOsc@seZdZdS)�	ReadErrorNr!r%r%r%r&r'Rsr'c@seZdZdS)�
RegistryErrorNr!r%r%r%r&r(Usr(c@seZdZdS)�_GiveupOnFastCopyNr!r%r%r%r&r)Ysr)c
Cs�z|��}|��}Wn*tk
r>}zt|��W5d}~XYnXzt�|||�WnTtk
r�}z6|j|_|j|_|j	t	j
t	jhkr�t|��n|d�W5d}~XYnXdS�N)�fileno�	Exceptionr)rr�OSError�name�filename�	filename2�errno�EINVAL�ENOTSUP)�fsrc�fdst�flags�infd�outfd�errr%r%r&�_fastcopy_fcopyfile^s
r:c
CsDz|��}|��}Wn*tk
r>}zt|��W5d}~XYnXztt�|�jd�}Wntk
rnd}YnXtj	dkr�t
|d�}d}zt�||||�}Wn�tk
�r&}zj|j|_
|j|_|jtjkr�dat|��|jtjkr�|d�|dk�rt�|dtj�dk�rt|��|�W5d}~XYq�X|dk�r6�q@||7}q�dS)Ni�ili@rF)r+r,r)�max�os�fstat�st_sizer-�sys�maxsize�minrr.r/r0r1ZENOTSOCK�_USE_CP_SENDFILEZENOSPC�lseek�SEEK_CUR)r4r5r7r8r9Z	blocksize�offsetZsentr%r%r&�_fastcopy_sendfilers8


 
rFc
Csn|j}|j}tt|���L}||�}|s*q`q||krV|d|��}|�|�W5QRXq||�qW5QRXdSr*)�readinto�write�
memoryview�	bytearray)r4r5�lengthZ
fsrc_readinto�
fdst_writeZmv�nZsmvr%r%r&�_copyfileobj_readinto�srNcCs0|st}|j}|j}||�}|s"q,||�qdSr*)�COPY_BUFSIZE�readrH)r4r5rKZ	fsrc_readrLZbufr%r%r&r�scCs�t|tj�rJttjd�rJztj�|��t�|��WStk
rHYdSXttjd�r~ztj�||�WStk
r|YdSXtj�	tj�
|��tj�	tj�
|��kS)N�samestatF�samefile)�
isinstancer<�DirEntry�hasattr�pathrQ�statr-rR�normcase�abspath��src�dstr%r%r&�	_samefile�s�r]cCst|tj�r|��St�|�Sr*)rSr<rTrW��fnr%r%r&�_stat�sr`cCs t|tj�r|��Stj�|�Sr*)rSr<rT�
is_symlinkrV�islinkr^r%r%r&�_islink�src��follow_symlinksc	Cs�t�d||�t||�r(td�||���d}t||g�D]j\}}zt|�}Wntk
r`Yq8Xt�	|j
�r�t|tj
�r�|jn|}td|��tr8|dkr8|j}q8|s�t|�r�t�t�|�|��n
t|d����}t|d���}t�r,z,t||tj�|WW5QR�W5QR�Stk
�r(YnXn�t�rtz(t||�|WW5QR�W5QR�Stk
�rpYnXn>t�r�|dk�r�t||t|t��|W5QR�W5QR�St ||�W5QRXW5QRX|S)Nzshutil.copyfilez{!r} and {!r} are the same filerz`%s` is a named pipe�rb�wb)!r?�auditr]r �format�	enumerater`r-rW�S_ISFIFO�st_moderSr<rTrVr�_WINDOWSr>rc�symlink�readlink�open�_HAS_FCOPYFILEr:rZ_COPYFILE_DATAr)rBrFrNrArOr)	r[r\re�	file_size�ir_�str4r5r%r%r&r	�sD

cCspt�d||�|sFt|�rFtj�|�rFttd�r@tjtj}}qRdSnt	tj
}}||�}||t�|j
��dS)Nzshutil.copymode�lchmod)r?rhrcr<rVrbrU�lstatrur`�chmodrW�S_IMODErl)r[r\reZ	stat_funcZ
chmod_funcrtr%r%r&r
!s
�	listxattrcCs�ztj||d�}Wn@tk
rR}z"|jtjtjtjfkr<�WY�dSd}~XYnX|D]j}z&tj|||d�}tj||||d�WqXtk
r�}z |jtj	tjtjtjfkr��W5d}~XYqXXqXdS�Nrd)
r<ryr-r1r3ZENODATAr2�getxattr�setxattrZEPERM)r[r\re�names�er.�valuer%r%r&�
_copyxattr7s	�r�cOsdSr*r%)�args�kwargsr%r%r&r�Osc	
s`t�d||�ddd�dd��|p6t|�o4tj�|�}|rJ�fdd�}n�fdd�}t|tj�rp|j|d�}n|d	�||d�}t�	|j
�}|d
�||j|jf|d�t
|||d�z|d�|||d�Wntk
r�YnXt|d��r\z|d
�||j|d�WnVtk
�rZ}z6dD]*}tt|��r|jtt|�k�r�qJ�q�W5d}~XYnXdS)Nzshutil.copystat)�nsrecWsdSr*r%)r�rer�r%r%r&�_nop`szcopystat.<locals>._nopcstt|��Sr*)�getattrr<�r.�r�r%r&�lookupgszcopystat.<locals>.lookupcstt|��}|tjkr|S�Sr*)r�r<�supports_follow_symlinks)r.r_r�r%r&r�ls
rdrW�utimerw�st_flagsZchflags)Z
EOPNOTSUPPr3)r?rhrcr<rVrbrSrTrWrxrl�st_atime_ns�st_mtime_nsr��NotImplementedErrorrUr�r-r1r�)	r[r\reZfollowr�rt�mode�whyr9r%r�r&rRs4�
cCsBtj�|�r"tj�|tj�|��}t|||d�t|||d�|Srz)r<rV�isdir�join�basenamer	r
�r[r\rer%r%r&r�s
cCsBtj�|�r"tj�|tj�|��}t|||d�t|||d�|Srz)r<rVr�r�r�r	rr�r%r%r&r
�s
cs�fdd�}|S)Ncs(g}�D]}|�t�||��qt|�Sr*)�extend�fnmatch�filter�set)rVr}�
ignored_names�pattern��patternsr%r&�_ignore_patterns�sz)ignore_patterns.<locals>._ignore_patternsr%)r�r�r%r�r&r�scCs>|dk	r$|t�|�dd�|D��}nt�}tj||d�g}	|tkpJ|tk}
|D�]~}|j|krbqPtj�||j�}tj�||j�}
|
r�|n|}z�|�	�}|r�tjdkr�|j
dd�}|jt
jkr�d}|�r8t�
|�}|r�t�||
�t||
|d�nBtj�|��s|�rWqP|���r,t||
||||d�n
|||
�n*|���rXt||
||||d�n
|||
�WqPtk
�r�}z|	�|jd�W5d}~XYqPtk
�r�}z|	�||
t|�f�W5d}~XYqPXqPzt||�WnJtk
�r*}z*t|d	d�dk�r|	�||t|�f�W5d}~XYnX|	�r:t|	��|S)
NcSsg|]
}|j�qSr%r�)�.0�xr%r%r&�
<listcomp>�sz_copytree.<locals>.<listcomp>)�exist_okrFrd)�
dirs_exist_okrZwinerror)r<�fspathr��makedirsr
rr.rVr�rarW�st_reparse_tag�IO_REPARSE_TAG_MOUNT_POINTrornr�exists�is_dirrrr�r�r-�append�strr�)�entriesr[r\�symlinks�ignore�
copy_function�ignore_dangling_symlinksr�r��errorsZuse_srcentryZsrcentryZsrcnameZdstnameZsrcobjrarv�linktor9r�r%r%r&�	_copytree�s`




�
� (&r�c	
CsDt�d||�t�|��}t|�}W5QRXt||||||||d�S)Nzshutil.copytree)r�r[r\r�r�r�r�r�)r?rhr<�scandir�listr�)	r[r\r�r�r�r�r�Zitrr�r%r%r&rs&
��st_file_attributescCsPz4|jdd�}t�|j�o2|jtj@o0|jtjkWStk
rJYdSXdS�NFrd)rW�S_ISDIRrlr��FILE_ATTRIBUTE_REPARSE_POINTr�r�r-)�entryrtr%r%r&�
_rmtree_isdir6s
�r�cCsLz0t�|�}t�|j�p.|jtj@o.|jtjkWSt	k
rFYdSXdS)NF)
r<rvrW�S_ISLNKrlr�r�r�r�r-)rVrtr%r%r&�_rmtree_islink?s

�r�cCs*z|jdd�WStk
r$YdSXdSr�)r�r-)r�r%r%r&r�HscCstj�|�Sr*)r<rVrb)rVr%r%r&r�Nsc	Cs&z"t�|��}t|�}W5QRXWn*tk
rL|tj|t���g}YnX|D]�}|j}t|�r�z|��rvtd��Wn,tk
r�|tjj	|t���YqRYnXt
||�qRzt�|�WqRtk
r�|tj|t���YqRXqRzt�|�Wn(tk
�r |tj|t���YnXdS)N�%Cannot call rmtree on a symbolic link)
r<r�r�r-r?�exc_inforVr�rarb�_rmtree_unsafe�unlink�rmdir)rV�onerror�
scandir_itr�r��fullnamer%r%r&r�Rs0

r�c
Cs.z"t�|��}t|�}W5QRXWn@tk
rb}z"||_|tj|t���WY�dSd}~XYnX|D�]�}tj�||j	�}z|j
dd�}Wntk
r�d}YnNX|r�z|jdd�}	t�|	j
�}Wn*tk
r�|tj|t���YqhYnX|�r�ztj|j	tj|d�}
Wn(tk
�r:|tj|t���Yn�Xz�tj�|	t�|
���r�t|
||�ztj|j	|d�Wn(tk
�r�|tj|t���YnXn8ztd��Wn*tk
�r�|tjj|t���YnXW5t�|
�Xqhztj|j	|d�Wqhtk
�r&|tj|t���YqhXqhdS)NFrd)�dir_fdr�)r<r�r�r-r/r?r�rVr�r.r�rWr�rlrvrp�O_RDONLY�closerQr=�_rmtree_safe_fdr�rbr�)�topfdrVr�r�r�r9r�r�r��orig_st�dirfdr%r%r&r�qsR


r�c	Cs�t�d|�|rdd�}n|dkr*dd�}t�r`t|t�rDt�|�}zt�|�}Wn(tk
rz|tj|t�	��YdSXzt�
|tj�}Wn(tk
r�|tj
|t�	��YdSXz�tj
�|t�|���rt|||�zt�|�Wn(tk
�r|tj|t�	��YnXn8ztd��Wn*tk
�rL|tj
j|t�	��YnXW5t�|�XnNzt|��rttd��Wn,tk
�r�|tj
j|t�	��YdSXt||�SdS)Nz
shutil.rmtreecWsdSr*r%�r�r%r%r&r��szrmtree.<locals>.onerrorcWs�dSr*r%r�r%r%r&r��sr�)r?rh�_use_fd_functionsrS�bytesr<�fsdecodervr,r�rpr�r�rVrQr=r�r�r-rbr�r�)rV�
ignore_errorsr�r��fdr%r%r&r�sJ



cCs&tjjtjjpd}tj�|�|��S)N�)r<rV�sep�altsepr��rstrip)rVr�r%r%r&�	_basename�sr�c	CsTt�d||�|}tj�|�rbt||�r8t�||�dStj�|t|��}tj�	|�rbt
d|��zt�||�Wn�tk
�rNtj�|�r�t�
|�}t�||�t�|�n�tj�|��r6t||�r�t
d||f��t|��st�|tj��st�|��rtjdk�rtd||f��t|||dd�t|�n|||�t�|�YnX|S)Nzshutil.movez$Destination path '%s' already existsz.Cannot move a directory '%s' into itself '%s'.�darwinzKCannot move the non-empty directory '%s': Lacking write permission to '%s'.T)r�r�)r?rhr<rVr�r]�renamer�r�r�rr-rbrornr��
_destinsrc�
_is_immutable�access�W_OK�listdir�platform�PermissionErrorrr)r[r\r�Zreal_dstr�r%r%r&r�sL


�
�����

cCsVtj�|�}tj�|�}|�tjj�s2|tjj7}|�tjj�sL|tjj7}|�|�Sr*)r<rVrY�endswithr��
startswithrZr%r%r&r�/sr�cCs(t|�}tjtjg}t|d�o&|j|kS)Nr�)r`rW�UF_IMMUTABLE�SF_IMMUTABLErUr�)r[rtZimmutable_statesr%r%r&r�8sr�cCsNtdks|dkrdSzt|�}Wntk
r8d}YnX|dk	rJ|dSdS�N�)r�KeyError�r.�resultr%r%r&�_get_gid=s
r�cCsNtdks|dkrdSzt|�}Wntk
r8d}YnX|dk	rJ|dSdSr�)rr�r�r%r%r&�_get_uidIs
r��gzipcs |dkrd}nDtr |dkr d}n2tr2|dkr2d}n trD|dkrDd}ntd�|���ddl}	|rfd	|nd}
|d
|
}tj�|�}|r�tj�	|�s�|dk	r�|�
d|�|s�t�|�|dk	r�|�
d�t���t
�������fd
d�}
|�s|	�|d|�}z|j||
d�W5|��X|S)Nr�r�Zgz�bzip2�bz2�xzzCbad value for 'compress', or compression format not supported : {0}r�.�.tar�creating %szCreating tar archivecs,�dk	r�|_�|_�dk	r(�|_�|_|Sr*)�gidZgname�uid�uname)Ztarinfo�r��group�ownerr�r%r&�_set_uid_gid�sz#_make_tarball.<locals>._set_uid_gidzw|%s�r�)�_ZLIB_SUPPORTED�_BZ2_SUPPORTED�_LZMA_SUPPORTED�
ValueErrorri�tarfiler<rV�dirnamer��infor�r�r�rpr��add)�	base_name�base_dir�compress�verbose�dry_runr�r��loggerZtar_compressionr�Zcompress_extZarchive_name�archive_dirr��tarr%r�r&�
_make_tarballUs>�

	
r
c	Csnddl}|d}tj�|�}|rNtj�|�sN|dk	r@|�d|�|sNt�|�|dk	rd|�d||�|�sj|j|d|jd���}tj�	|�}	|	tj
kr�|�|	|	�|dk	r�|�d|	�t�|�D]�\}
}}t
|�D]:}
tj�	tj�|
|
��}	|�|	|	�|dk	r�|�d|	�q�|D]L}
tj�	tj�|
|
��}	tj�|	��r|�|	|	�|dk	�r|�d|	��qq�W5QRX|S)Nr�.zipr�z#creating '%s' and adding '%s' to it�w)Zcompressionzadding '%s')�zipfiler<rVr�r�rr��ZipFileZZIP_DEFLATED�normpath�curdirrH�walk�sortedr��isfile)rrrrrr
Zzip_filenamerZzfrV�dirpathZdirnames�	filenamesr.r%r%r&�
_make_zipfile�sH
��

rr	)rNzuncompressed tar file)rr�zgzip'ed tar-fileZgztarzZIP file�zip)rr�zbzip2'ed tar-fileZbztar)rr�zxz'ed tar-fileZxztarcCsdd�t��D�}|��|S)NcSsg|]\}}||df�qS)r�r%)r�r.�registryr%r%r&r��sz'get_archive_formats.<locals>.<listcomp>)�_ARCHIVE_FORMATS�items�sort�Zformatsr%r%r&r�s
�r�cCst|dkrg}t|�s td|��t|ttf�s6td��|D]&}t|ttf�rXt|�dkr:td��q:|||ft|<dS)NzThe %s object is not callablez!extra_args needs to be a sequencer�z+extra_args elements are : (arg_name, value))�callable�	TypeErrorrS�tupler��lenr)r.�function�
extra_args�descriptionZelementr%r%r&r�s	
cCs
t|=dSr*)rr�r%r%r&r�sc	
Cst�d||||�t��}	|dk	rP|dk	r6|�d|�tj�|�}|sPt�|�|dkr^tj}||d�}
zt	|}Wn"t
k
r�td|�d�YnX|d}|dD]\}
}||
|
<q�|dkr�||
d<||
d	<z|||f|
�}W5|dk	�r|dk	�r|�d
|	�t�|	�X|S)Nzshutil.make_archivezchanging into '%s')rrzunknown archive format '%s'r�rr�r�zchanging back to '%s')r?rhr<�getcwd�debugrVrY�chdirrrr�r�)rriZroot_dirrrrr�r�rZsave_cwdr��format_info�func�arg�valr/r%r%r&r�s8




cCsdd�t��D�}|��|S)NcSs"g|]\}}||d|df�qS)r�r%)r�r.rr%r%r&r�3sz&get_unpack_formats.<locals>.<listcomp>)�_UNPACK_FORMATSrrrr%r%r&r-s
�c	Csji}t��D]\}}|dD]}|||<qq|D]$}||kr0d}t||||f��q0t|�sftd��dS)Nrz!%s is already registered for "%s"z*The registered function must be a callable)r-rr(rr)	�
extensionsr!r"Zexisting_extensionsr.r�ext�	extension�msgr%r%r&�_check_unpack_options8s�
r2cCs,|dkrg}t|||�||||ft|<dSr*)r2r-)r.r.r!r"r#r%r%r&rJscCs
t|=dSr*)r-r�r%r%r&r`scCs&tj�|�}tj�|�s"t�|�dSr*)r<rVr�r�r�)rVr�r%r%r&�_ensure_directorydsr3c		Cs�ddl}|�|�std|��|�|�}z�|��D]�}|j}|�d�s2d|krPq2tj	j
|f|�d���}|snq2t|�|�
d�s2|�|j�}t|d�}z|�|�W5|��~Xq2W5|��XdS)Nrz%s is not a zip file�/z..rg)r
Z
is_zipfiler'rr�Zinfolistr/r�r<rVr��splitr3r�rPrprH)	r/�extract_dirr
rrr.�target�data�fr%r%r&�_unpack_zipfilejs*




r:r�cCs\ddl}z|�|�}Wn"|jk
r8td|��YnXz|j||d�W5|��XdS)Nrz/%s is not a compressed or uncompressed tar filer�)r�rpZTarErrorr'r�Z
extractall)r/r6r�r�Ztarobjr%r%r&�_unpack_tarfile�s�
r;r�r)r	rz.tar.gzz.tgzz.tar.bz2z.tbz2z.tar.xzz.txzcCs:t��D],\}}|dD]}|�|�r|SqqdS)Nr)r-rr�)r/r.rr0r%r%r&�_find_unpack_format�s

r<cCs�t�d|||�|dkr t��}t�|�}t�|�}|dkrBi}nd|i}|dk	r�zt|}Wn$tk
r�td�|��d�YnX|d}|||ft	|d�|��nRt
|�}|dkr�td�|���t|d}t	t|d�}|�|�|||f|�dS)Nzshutil.unpack_archiver�zUnknown unpack format '{0}'r$r�zUnknown archive format '{0}')
r?rhr<r%r�r-r�r�ri�dictr<r'�update)r/r6rir�Z
filter_kwargsr(r)r�r%r%r&r�s,


�statvfs�
disk_usageZusageztotal used freezTotal space in byteszUsed space in byteszFree space in bytescCs@t�|�}|j|j}|j|j}|j|j|j}t|||�Sr*)r<r?�f_bavail�f_frsize�f_blocks�f_bfree�_ntuple_diskusage)rVrt�free�total�usedr%r%r&r@�s

cCs"t�|�\}}||}t|||�Sr*)rZ
_getdiskusagerE)rVrGrFrHr%r%r&r@�scCs�t�d|||�|dkr(|dkr(td��|}|}|dkr>d}n(t|t�rft|�}|dkrftd�|���|dkrtd}n(t|t�s�t	|�}|dkr�td�|���t
�|||�dS)Nzshutil.chownzuser and/or group must be set���zno such user: {!r}zno such group: {!r})r?rhr�rSr�r��LookupErrorri�intr�r<r)rV�userr�Z_userZ_groupr%r%r&rs$

��P�c
Cs�zttjd�}Wnttfk
r.d}YnXzttjd�}Wnttfk
r^d}YnX|dksp|dkr�zt�tj���}Wn$t	tt
fk
r�t�|�}YnX|dkr�|j}|dkr�|j
}t�||f�S)NZCOLUMNSrZLINES)rKr<�environr�r�rr?�
__stdout__r+�AttributeErrorr-�
terminal_size�columns�lines)ZfallbackrTrU�sizer%r%r&r(s$

cCs&tj�|�o$t�||�o$tj�|�Sr*)r<rVr�r�r�)r_r�r%r%r&�
_access_checkYs�rWc
	s�tj���rt�|�r�SdSt�t�}|dkrttj�dd�}|dkrtzt�d�}Wnt	t
fk
rrtj}YnX|s|dS|r�t�|�}|�
t�tj��}nt�|�}|�
tj�}tjdk�rTtj}|r�t�|�}||kr�|�d|�t�d�p�t}dd�|�
tj�D�}|�r dd�|D�}t�fd	d
�|D���r@�g}n�fdd�|D�}n�g}t�}|D]X}	tj�|	�}
|
|k�rd|�|
�|D],}tj�|	|�}t||��r�|S�q��qddS)N�PATH�CS_PATHZwin32rZPATHEXTcSsg|]}|r|�qSr%r%�r�r/r%r%r&r��szwhich.<locals>.<listcomp>cSsg|]}t�|��qSr%)r<�fsencoderZr%r%r&r��sc3s |]}����|���VqdSr*)�lowerr�rZ��cmdr%r&�	<genexpr>�szwhich.<locals>.<genexpr>csg|]}�|�qSr%r%rZr]r%r&r��s)r<rVr�rWrSr�rP�get�confstrrRr��defpathr[r5�pathsepr�r?r�r�insert�getenv�_WIN_DEFAULT_PATHEXT�anyr�rXrr�)
r^r�rVZ	use_bytesrZpathext_sourceZpathext�files�seen�dirZnormdirZthefiler.r%r]r&r^sV







)r)F)FN)r�rrNNN)rrN)Nr�)NNrrNNN)Nr�)NN)NN)rM)jr<r?rWr��collectionsr1�zlibr��ImportErrorr�r�Zlzmar��pwdrZgrprr.rmrrrOrUr�r�rBrqrf�__all__r-rr rrr'r,r(r)r:rFrNrr]r`rcr	r
r�rrr
rr�r�stat_resultr�r�r�r�rpr�r��supports_dir_fdr��supports_fdr�r�rZavoids_symlink_attacksr�rr�r�r�r�r
rrrrrrrr2rrr3r:r;r-r<rr��
namedtuplerErG�__doc__rHrFr@rrrW�F_OK�X_OKrr%r%r%r&�<module>sr






�
@

7B
�
A�
.	
	4�
�
�
>?	�
A
-
����

�
8�
"�
�
�
�2



 
1__pycache__/cProfile.cpython-38.opt-2.pyc000064400000011662151153537560014130 0ustar00U

e5db�@s~dddgZddlZddlZddlZddd�Zddd�Zejje_ejje_Gdd�dej�Z	d	d
�Z
dd�Zed
krze�dS)�run�runctx�Profile�N���cCst�t��|||�S�N)�
_pyprofile�_Utilsrr)�	statement�filename�sort�r� /usr/lib64/python3.8/cProfile.pyrscCst�t��|||||�Sr)rrrr)r	�globals�localsr
rrrr
rs�c@s\eZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	de	_
dd�Zdd�ZdS)rrcCs$ddl}|�|����|���dS�Nr)�pstats�StatsZ
strip_dirsZ
sort_stats�print_stats)�selfrrrrr
r)szProfile.print_statsc	Cs8ddl}t|d��}|��|�|j|�W5QRXdS)Nr�wb)�marshal�open�create_stats�dump�stats)r�filer�frrr
�
dump_stats-szProfile.dump_statscCs|��|��dSr)�disable�snapshot_stats�rrrr
r3szProfile.create_statsc
Cs,|��}i|_i}|D]P}t|j�}|j}||j}|j}|j}i}	|	|t|j�<|||||	f|j|<q|D]�}|j	rlt|j�}|j	D]�}
z|t|
j�}	Wnt
k
r�Yq�YnX|
j}||
j}|
j}|
j}||	k�r|	|}||d7}||d7}||d7}||d7}||||f|	|<q�qldS)Nr���)Zgetstatsr�label�codeZ	callcountZreccallcountZ
inlinetimeZ	totaltime�idZcalls�KeyError)r�entriesZcallersdicts�entry�funcZncZccZttZctZcallersZsubentry�prevrrr
r7s>






zProfile.snapshot_statscCsddl}|j}|�|||�Sr)�__main__�__dict__r)r�cmdr,�dictrrr
r]szProfile.runcCs(|��zt|||�W5|��X|Sr)�enabler�exec)rr.rrrrr
rbs

zProfile.runctxcOs�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��|��z|||�W�S|��XdS)	Nr"z:descriptor 'runcall' of 'Profile' object needs an argumentr*rz0Passing 'func' as keyword argument is deprecated)�
stacklevelz7runcall expected at least 1 positional argument, got %dr!)�len�	TypeError�pop�warnings�warn�DeprecationWarningr0r)�args�kwrr*r6rrr
�runcallks&

�
�zProfile.runcallz($self, func, /, *args, **kw)cCs|��|Sr)r0r rrr
�	__enter__�szProfile.__enter__cGs|��dSr)r)r�exc_inforrr
�__exit__�szProfile.__exit__N)r)
�__name__�
__module__�__qualname__rrrrrrr;�__text_signature__r<r>rrrr
rs
&	cCs(t|t�rdd|fS|j|j|jfSdS)N�~r)�
isinstance�str�co_filename�co_firstlineno�co_name)r%rrr
r$�s

r$c
Cs�ddl}ddl}ddl}ddl}ddlm}d}||d�}d|_|jdddd	dd
�|jddd
ddt|j	j
�d�|jdddddd�|jdd�s�|��|�
d�|��\}}||jdd�<|jdk	r�|j�|j�|_t|�dk�r�|j�rd}	|j|dd�}
nR|d}|j�d|j�|��t�|��}t|��|d�}	W5QRX|dddd�}
zt|	|
d|j|j�Wn6tk
�r�}
zd|_|�
|
j�W5d}
~
XYnXn|��|S)Nr)�OptionParserzNcProfile.py [-o output_file_path] [-s sort] [-m module | scriptfile] [arg] ...)�usageFz-oz	--outfile�outfilezSave stats to <outfile>)�dest�help�defaultz-sz--sortrz?Sort order when printing to stdout, based on pstats.Stats classr)rLrMrN�choicesz-m�module�
store_truezProfile a library module)rL�actionrMrNr!r"z(run_module(modname, run_name='__main__'))�
run_module�modnamer1r,)�__file__r?�__package__�
__cached__) �os�sys�runpyrZoptparserIZallow_interspersed_argsZ
add_option�sortedrZsort_arg_dict_default�argvZprint_usage�exit�
parse_argsrK�path�abspathr3rPrS�insert�dirname�io�	open_code�compile�readrr�BrokenPipeError�stdout�errno)rXrYrZrrIrJ�parserZoptionsr9r%ZglobsZprogname�fp�excrrr
�main�sd

�

�
�

�� rmr,)Nr)Nr)
�__all__Z_lsprofrcZprofilerrr�__doc__ZProfilerrr$rmr?rrrr
�<module>s




o;__pycache__/warnings.cpython-38.opt-1.pyc000064400000031612151153537560014211 0ustar00U

e5d�L�@s�dZddlZddddddd	d
gZd<dd�Zd=dd�Zd
d�Zdd�ZeZdd�ZeZ	dd�Z
dedddfdd�Zeddfdd�Z
dd�Zdd	�ZGdd�de�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd>d+d�Zd?d,d�ZGd-d.�d.e�ZGd/d
�d
e�Zd0d1�Zz0dd2lmZm Z m!Z!mZmZm"Z"e Z#e!Z$d3Z%Wn2e&k
�rngZd4Z#iZ$d*a'd5d6�Z"dZ%YnXeej(�e%�s�e)ed7��s�ed4e*d8d*d9�e
d:e*d*d;�e
d:e+d*d;�e
d:e,d*d;�e
d:e-d*d;�[%dS)@z&Python part of the warnings subsystem.�N�warn�
warn_explicit�showwarning�
formatwarning�filterwarnings�simplefilter�
resetwarnings�catch_warningscCst||||||�}t|�dS)�7Hook to write a warning to a file; replace if you like.N)�WarningMessage�_showwarnmsg_impl)�message�category�filename�lineno�file�line�msg�r� /usr/lib64/python3.8/warnings.pyr
scCst||||d|�}t|�S)�.Function to format a warning the standard way.N)r�_formatwarnmsg_impl)r
rrrrrrrrrscCsP|j}|dkr tj}|dkr dSt|�}z|�|�Wntk
rJYnXdS�N)r�sys�stderr�_formatwarnmsg�write�OSError)rr�textrrrrsrc		Cs�|jj}|j�d|j�d|�d|j�d�}|jdkrpzddl}|�|j|j�}Wqvtk
rld}d}YqvXn|j}|r�|�	�}|d|7}|j
dk	�r�zddl}Wntk
r�d}d}Yn4X|��}z|�
|j
�}Wntk
r�d}YnX|dk	�r�|d7}|D]t}|d|j|jf7}z$|dk	�rB|�|j|j�}nd}Wntk
�rbd}YnX|�r|�	�}|d	|7}�qn|�s�||�d
�7}|S)N�:z: �
rz  %s
Tz-Object allocated at (most recent call last):
z  File "%s", lineno %s
z    %s
z<: Enable tracemalloc to get the object allocation traceback
)r�__name__rrr
r�	linecache�getline�	Exception�strip�source�tracemalloc�
is_tracing�get_object_traceback)	rr�sr"rr'�tracing�tb�framerrrr#sT"




�

rcCsdzt}Wntk
rYn<X|tk	rXt|�s6td��||j|j|j|j|j	|j
�dSt|�dS)r
z:warnings.showwarning() must be set to a function or methodN)r�	NameError�_showwarning_orig�callable�	TypeErrorr
rrrrrr)r�swrrr�_showwarnmsg`s�r3cCsHzt}Wntk
rYn$X|tk	r@||j|j|j|j|j�St|�S)r)	rr.�_formatwarning_origr
rrrrr)r�fwrrrrus
�r�FcCsT|s|rddl}|r$|�||j�}nd}|r8|�|�}nd}t||||||d�dS)a�Insert an entry into the list of warnings filters (at the front).

    'action' -- one of "error", "ignore", "always", "default", "module",
                or "once"
    'message' -- a regex that the warning message must match
    'category' -- a class that the warning must be a subclass of
    'module' -- a regex that the module name must match
    'lineno' -- an integer line number, 0 matches all warnings
    'append' -- if true, append to the list of filters
    rN��append)�re�compile�I�_add_filter)�actionr
r�modulerr8r9rrrr�scCst|d|d||d�dS)a�Insert a simple entry into the list of warnings filters (at the front).

    A simple filter matches all modules and messages.
    'action' -- one of "error", "ignore", "always", "default", "module",
                or "once"
    'category' -- a class that the warning must be a subclass of
    'lineno' -- an integer line number, 0 matches all warnings
    'append' -- if true, append to the list of filters
    Nr7)r<)r=rrr8rrrr�scGsR|s6zt�|�Wntk
r&YnXt�d|�n|tkrHt�|�t�dS)Nr)�filters�remove�
ValueError�insertr8�_filters_mutated)r8�itemrrrr<�s
r<cCsgtdd�<t�dS)zAClear the list of warning filters, so that no filters are active.N)r?rCrrrrr�sc@seZdZdZdS)�_OptionErrorz,Exception used by option processing helpers.N)r!�
__module__�__qualname__�__doc__rrrrrE�srEcCsN|D]D}zt|�Wqtk
rF}ztd|tjd�W5d}~XYqXqdS)NzInvalid -W option ignored:)r)�
_setoptionrE�printrr)�args�argrrrr�_processoptions�s
rMc	Cs�|�d�}t|�dkr$td|f��t|�dkr<|�d�q$dd�|D�\}}}}}t|�}t|�}|sl|rtddl}|r�|�|�}|r�|�|�d}|r�zt|�}|dkr�t	�Wq�t	t
fk
r�td	|f�d�Yq�Xnd}t|||||�dS)
Nr�ztoo many fields (max 5): %rr6cSsg|]}|���qSr)r%)�.0r*rrr�
<listcomp>�s�z_setoption.<locals>.<listcomp>rz\Zzinvalid lineno %r)�split�lenrEr8�
_getaction�_getcategoryr9�escape�intrA�
OverflowErrorr)rL�partsr=r
rr>rr9rrrrI�s2
�
rIcCsB|sdS|dkrdSdD]}|�|�r|Sqtd|f��dS)N�default�all�always)rYr[�ignorer>�once�errorzinvalid action: %r)�
startswithrE)r=�arrrrS�s

rScCs�|stSd|krddl}|}nJ|�d�\}}}zt|dd|g�}Wn$tk
rftd|f�d�YnXzt||�}Wn$tk
r�td|f�d�YnXt|t�s�td|f��|S)N�.rzinvalid module name: %rzunknown warning category: %rzinvalid warning category: %r)	�Warning�builtins�
rpartition�
__import__�ImportErrorrE�getattr�AttributeError�
issubclass)r�m�klassr>�_�catrrrrT�s"
rTcCs|jj}d|kod|kS)zFSignal whether the frame is an internal CPython implementation detail.�	importlib�
_bootstrap)�f_code�co_filename)r-rrrr�_is_internal_framesrrcCs"|j}|dk	rt|�r|j}q|S)z;Find the next frame that doesn't involve CPython internals.N)�f_backrr)r-rrr�_next_external_framesrt�c	Cst|t�r|j}|dkrt}t|t�r0t|t�sDtd�t|�j���zV|dks\t	t
�d��rht
�|�}n0t
�d�}t|d�D]}t
|�}|dkr~t�q~Wn"tk
r�t
j}d}d}YnX|j}|jj}|j}d|kr�|d}	nd}	|�di�}
t|||||	|
||�dS)z:Issue a warning, or maybe ignore it or raise an exception.Nz/category must be a Warning subclass, not '{:s}'rurr!z<string>Z__warningregistry__)�
isinstancerb�	__class__�UserWarning�typerir1�formatr!rrr�	_getframe�rangertrA�__dict__�	f_globalsrprq�f_lineno�
setdefaultr)r
r�
stacklevelr&r-�x�globalsrrr>�registryrrrrs>
�



�cCs�t|�}|dkr8|pd}|dd���dkr8|dd�}|dkrDi}|�dd�tkrd|��t|d<t|t�r~t|�}|j}n|}||�}|||f}	|�|	�r�dSt	D]V}
|
\}}}
}}|dks�|�
|�r�t||
�r�|dks�|�
|�r�|dks�||kr��qq�t}|dk�rdSddl
}|�||�|dk�r2|�|dk�rfd	||	<||f}t�|��r\dSd	t|<nf|d
k�rrnZ|dk�r�d	||	<||df}|�|��r�dSd	||<n$|dk�r�d	||	<ntd
||
f��t|||||�}t|�dS)Nz	<unknown>���z.py�versionrr\r^r]rur[r>rYz1Unrecognized action (%r) in warnings.filters:
 %s)rV�lower�get�_filters_version�clearrvrb�strrwr?�matchri�
defaultactionr"�getlines�onceregistry�RuntimeErrorrr3)r
rrrr>r��module_globalsr&r�keyrDr=rrm�modZlnr"ZoncekeyZaltkeyrrrrGs|


�����









��c@s"eZdZdZddd�Zdd�ZdS)r)r
rrrrrr&NcCs>||_||_||_||_||_||_||_|r4|jnd|_dSr)	r
rrrrrr&r!�_category_name)�selfr
rrrrrr&rrr�__init__�szWarningMessage.__init__cCsd|j|j|j|j|jfS)NzD{message : %r, category : %r, filename : %r, lineno : %s, line : %r})r
r�rrr)r�rrr�__str__�s��zWarningMessage.__str__)NNN)r!rFrG�_WARNING_DETAILSr�r�rrrrr�s�
rc@s8eZdZdZddd�dd�Zdd�Zd	d
�Zdd�ZdS)
r	a�A context manager that copies and restores the warnings filter upon
    exiting the context.

    The 'record' argument specifies whether warnings should be captured by a
    custom implementation of warnings.showwarning() and be appended to a list
    returned by the context manager. Otherwise None is returned by the context
    manager. The objects appended to the list are arguments whose attributes
    mirror the arguments to showwarning().

    The 'module' argument is to specify an alternative module to the module
    named 'warnings' and imported under that name. This argument is only useful
    when testing the warnings module itself.

    FN)�recordr>cCs(||_|dkrtjdn||_d|_dS)z�Specify whether to record warnings and if an alternative module
        should be used other than sys.modules['warnings'].

        For compatibility with Python 3.0, please consider all arguments to be
        keyword-only.

        N�warningsF)�_recordr�modules�_module�_entered)r�r�r>rrrr��szcatch_warnings.__init__cCsPg}|jr|�d�|jtjdk	r4|�d|j�t|�j}d|d�|�fS)Nzrecord=Truer�z	module=%rz%s(%s)z, )r�r8r�rr�ryr!�join)r�rK�namerrr�__repr__�s

zcatch_warnings.__repr__cCs~|jrtd|��d|_|jj|_|jdd�|j_|j��|jj|_|jj|_|j	rvg}|j
|j_|jj|j_|SdSdS)NzCannot enter %r twiceT)r�r�r�r?�_filtersrCr�_showwarningrr�r8r/)r��logrrr�	__enter__�s




zcatch_warnings.__enter__cGs>|jstd|��|j|j_|j��|j|j_|j|j_dS)Nz%Cannot exit %r without entering first)	r�r�r�r�r?rCr�rr)r��exc_inforrr�__exit__�s


zcatch_warnings.__exit__)r!rFrGrHr�r�r�r�rrrrr	�s
	cszd�j�d�g}�jdk	rVddl�ddl}��fdd�}|�d�||�t|���7}d�|��d�}t	|t
d	�d
�dS)Nzcoroutine 'z' was never awaited
rc3s4t�j�D]$\}}}��||�}||||fVq
dSr)�reversed�	cr_originr#)rr�funcnamer��coror"rr�extract�sz*_warn_unawaited_coroutine.<locals>.extractz-Coroutine created at (most recent call last)
r6r �)rr�r&)rGr�r"�	tracebackr8�format_list�listr��rstripr�RuntimeWarning)r��	msg_linesr�r�rrr�r�_warn_unawaited_coroutine�s�

r�)r?�_defaultaction�
_onceregistryrrrCTrYcCstd7adS)Nru)r�rrrrrCsrCZgettotalrefcount�__main__)rr>r8r\)rr8)NN)N)NruN)NNNN).rHr�__all__rrrrr/r3r4rrbrrr<rr$rErMrIrSrTrrrtrr�objectrr	r��	_warningsr?r�r�rCr�r�Z_warnings_defaultsrfr��warnoptions�hasattr�DeprecationWarning�PendingDeprecationWarning�
ImportWarning�ResourceWarningrrrr�<module>s|�

;
�
#
	
)�
GC 

�__pycache__/cgi.cpython-38.pyc000064400000063655151153537560012200 0ustar00U

&�.e���@sjdZdZddlmZmZmZddlmZddlZddl	Z	ddl
Zddlm
Z
ddlmZddlZddlZddlZdd	d
ddd
ddddddgZdadadd�Zdd�Zdd�Zdd�Zeadade	jdddfdd
�Zd1d!d�Zd"d#�Zd$d�Z Gd%d�d�Z!Gd&d	�d	�Z"e	jfd'd
�Z#d2d(d�Z$e	jfd)d�Z%d*d�Z&d+d�Z'd,d�Z(d-d�Z)d.d/�Z*e+d0k�rfe#�dS)3z�Support module for CGI (Common Gateway Interface) scripts.

This module defines a number of utilities for use by CGI scripts
written in Python.
z2.6�)�StringIO�BytesIO�
TextIOWrapper)�MappingN)�
FeedParser)�Message�MiniFieldStorage�FieldStorage�parse�parse_multipart�parse_header�test�print_exception�
print_environ�
print_form�print_directory�print_arguments�print_environ_usage�cGsFtr,ts,zttd�aWntk
r*YnXts6tantat|�dS)a�Write a log message, if there is a log file.

    Even though this function is called initlog(), you should always
    use log(); log is a variable that is set either to initlog
    (initially), to dolog (once the log file has been opened), or to
    nolog (when logging is disabled).

    The first argument is a format string; the remaining arguments (if
    any) are arguments to the % operator, so e.g.
        log("%s: %s", "a", "b")
    will write "a: b" to the log file, followed by a newline.

    If the global logfp is not None, it should be a file object to
    which log data is written.

    If the global logfp is None, the global logfile may be a string
    giving a filename to open, in append mode.  This file should be
    world writable!!!  If the file can't be opened, logging is
    silently disabled (since there is no safe place where we could
    send an error message).

    �aN)�logfile�logfp�open�OSError�nolog�log�dolog�Zallargs�r�/usr/lib64/python3.8/cgi.py�initlog8sr cGst�||d�dS)z=Write a log message to the log file.  See initlog() for docs.�
N)r�write)Zfmt�argsrrrr[srcGsdS)z9Dummy function, assigned to log when logging is disabled.Nrrrrrr_srcCsdatrt��datadS)zClose the log file.rN)rr�closer rrrrr�closelogcs
r%c
Cs^|dkrtj}t|d�r |j}nd}t|t�r4|j}d|krDd|d<|ddk�rt|d�\}}|dkrxt|||d	�S|d
kr�t	|d�}t
r�|t
kr�td��|�|��
|�}	nd
}	d|kr�|	r�|	d}	|	|d}	n*tjdd��r|	r�|	d}	|	tjd}	|	|d<n<d|k�r |d}	n(tjdd��r<tjd}	nd
}	|	|d<tjj|	||||d�S)a�Parse a query in the environment or from a file (default stdin)

        Arguments, all optional:

        fp              : file pointer; default: sys.stdin.buffer

        environ         : environment dictionary; default: os.environ

        keep_blank_values: flag indicating whether blank values in
            percent-encoded forms should be treated as blank strings.
            A true value indicates that blanks should be retained as
            blank strings.  The default false value indicates that
            blank values are to be ignored and treated as if they were
            not included.

        strict_parsing: flag indicating what to do with parsing errors.
            If false (the default), errors are silently ignored.
            If true, errors raise a ValueError exception.

        separator: str. The symbol to use for separating the query arguments.
            Defaults to &.
    N�encodingzlatin-1�REQUEST_METHOD�GET�POST�CONTENT_TYPEzmultipart/form-data)�	separator�!application/x-www-form-urlencoded�CONTENT_LENGTH�Maximum content length exceededr�QUERY_STRING�&�)r&r+)�sys�stdin�hasattrr&�
isinstancer�bufferrr�int�maxlen�
ValueError�read�decode�argv�urllibr
Zparse_qs)
�fp�environ�keep_blank_values�strict_parsingr+r&�ctype�pdictZclength�qsrrrr
vsL




��utf-8�replacer0csx|d�d�}d�|�}t�}|�|�z|d|d<Wntk
rLYnXt||||ddi|d���fd	d
��D�S)a�Parse multipart input.

    Arguments:
    fp   : input file
    pdict: dictionary containing other parameters of content-type header
    encoding, errors: request encoding and error handler, passed to
        FieldStorage

    Returns a dictionary just like parse_qs(): keys are the field names, each
    value is a list of values for that field. For non-file fields, the value
    is a list of strings.
    �boundary�asciiz multipart/form-data; boundary={}zCONTENT-LENGTHzContent-Lengthr'r))�headersr&�errorsr?r+csi|]}|��|��qSr)�getlist)�.0�k�Zfsrr�
<dictcomp>�sz#parse_multipart.<locals>.<dictcomp>)r;�formatrZset_type�KeyErrorr	)r>rCr&rJr+rGrBrIrrNrr�s


�ccs�|dd�dkr�|dd�}|�d�}|dkr`|�dd|�|�dd|�dr`|�d|d�}q&|dkrpt|�}|d|�}|��V||d�}qdS)Nr1�;r�"�\"�)�find�count�len�strip)�s�end�frrr�_parseparam�s
(
r]cCs�td|�}|��}i}|D]�}|�d�}|dkr|d|�����}||dd���}t|�dkr�|d|dkr�dkr�nn |dd�}|�d	d
��dd�}|||<q||fS)zfParse a Content-type like header.

    Return the main content-type and a dictionary of options.

    rR�=rNr1rU���rSz\\�\rT)r]�__next__rVrY�lowerrXrF)�line�parts�keyrC�p�i�name�valuerrrr�s
,
c@s@eZdZdZdZdZdZdZiZdZ	iZ
iZdd�Zdd�Z
dS)rz=Like FieldStorage, for use when no file uploads are possible.NcCs||_||_dS)z&Constructor from field name and value.N�rhri��selfrhrirrr�__init__	szMiniFieldStorage.__init__cCsd|j|jfS)z Return printable representation.zMiniFieldStorage(%r, %r)rj�rlrrr�__repr__szMiniFieldStorage.__repr__)�__name__�
__module__�__qualname__�__doc__�filename�list�type�file�type_options�disposition�disposition_optionsrIrmrorrrrr�sc@s�eZdZdZdddejdddddddfdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
d:dd�Zd;dd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�ZdZd'd(�Zd)d*�Zd+Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Z dS)<r	a�Store a sequence of fields, reading multipart/form-data.

    This class provides naming, typing, files stored on disk, and
    more.  At the top level, it is accessible like a dictionary, whose
    keys are the field names.  (Note: None can occur as a field name.)
    The items are either a Python list (if there's multiple values) or
    another FieldStorage or MiniFieldStorage object.  If it's a single
    object, it has the following attributes:

    name: the field name, if specified; otherwise None

    filename: the filename, if specified; otherwise None; this is the
        client side filename, *not* the file name on which it is
        stored (that's a temporary file you don't deal with)

    value: the value as a *string*; for file uploads, this
        transparently reads the file every time you request the value
        and returns *bytes*

    file: the file(-like) object from which you can read the data *as
        bytes* ; None if the data is stored a simple string

    type: the content-type, or None if not specified

    type_options: dictionary of options specified on the content-type
        line

    disposition: content-disposition, or None if not specified

    disposition_options: dictionary of corresponding options

    headers: a dictionary(-like) object (sometimes email.message.Message or a
        subclass thereof) containing *all* headers

    The class is subclassable, mostly for the purpose of overriding
    the make_file() method, which is called internally to come up with
    a file open for reading and writing.  This makes it possible to
    override the default choice of storing all files in a temporary
    directory and unlinking them as soon as they have been opened.

    N�rrErFcCsZd}||_||_|
|_||_d|kr0|d��}d|_|dksF|dkr�d|krX|d}
ntjdd�rrtjd}
nd}
|
�t	�
�d�}
t|
�}|dkr�d	d
i}|dkr�i}|dkr�d
|d	<d|kr�|d|d	<d|kr�|d|_d
|kr�|d
|d<nt|t
tf��std��||_|dk�r*tjj|_n<t|t��r@|j|_n&t|d��rXt|d��s`td��||_||_|	|_t|t��s�tdt|�j��||_d|_||_di}}d|jk�r�t|jd�\}}||_||_ d|_!d|k�r�|d|_!d|_"d|k�r
|d|_"|j"dk	|_#d	|jk�r6t|jd	�\}}n(|j�sH|dk�rTdi}}n
d
i}}||_||_$d|k�r�|d�|j|j�|_%nd|_%d}d|jk�r�zt&|jd�}Wnt'k
�r�YnXt(�r�|t(k�r�t'd��||_)|jdk�r|dk�r||_d|_*|_+d|_,|d
k�r,|�-�n*|dd�dk�rN|�.|||�n|�/�dS)a$Constructor.  Read multipart/* until last part.

        Arguments, all optional:

        fp              : file pointer; default: sys.stdin.buffer
            (not used when the request method is GET)
            Can be :
            1. a TextIOWrapper object
            2. an object whose read() and readline() methods return bytes

        headers         : header dictionary-like object; default:
            taken from environ as per CGI spec

        outerboundary   : terminating multipart boundary
            (for internal use only)

        environ         : environment dictionary; default: os.environ

        keep_blank_values: flag indicating whether blank values in
            percent-encoded forms should be treated as blank strings.
            A true value indicates that blanks should be retained as
            blank strings.  The default false value indicates that
            blank values are to be ignored and treated as if they were
            not included.

        strict_parsing: flag indicating what to do with parsing errors.
            If false (the default), errors are silently ignored.
            If true, errors raise a ValueError exception.

        limit : used internally to read parts of multipart/form-data forms,
            to exit from the reading loop when reached. It is the difference
            between the form content-length and the number of bytes already
            read

        encoding, errors : the encoding and error handler used to decode the
            binary stream to strings. Must be the same as the charset defined
            for the page sending the form (content-type : meta http-equiv or
            header)

        max_num_fields: int. If set, then __init__ throws a ValueError
            if there are more than n fields read by parse_qsl().

        r(r'NZHEADr/r1r�surrogateescapezcontent-typer,r)r*r-�content-lengthz?headers must be mapping or an instance of email.message.Messager:�readlinezfp must be file pointerz#outerboundary must be bytes, not %srzcontent-dispositionrhrtz
text/plainrGr{r_r.�
z
multipart/)0r@rA�max_num_fieldsr+�upper�
qs_on_postr2r<�encode�localeZgetpreferredencodingrr5rr�	TypeErrorrIr3r6r>rr4r&rJ�bytesrvrp�
outerboundary�
bytes_read�limitrryrzrhrt�_binary_filerx�
innerboundaryr7r9r8�lengthrurw�done�read_urlencoded�
read_multi�read_single)rlr>rIr�r?r@rAr�r&rJr�r+�methodrDZcdisprCrBZclenrrrrm?s�/
�


�






�

zFieldStorage.__init__cCs(z|j��Wntk
r"YnXdS�N)rwr$�AttributeErrorrnrrr�__del__�szFieldStorage.__del__cCs|Sr�rrnrrr�	__enter__�szFieldStorage.__enter__cGs|j��dSr�)rwr$)rlr#rrr�__exit__�szFieldStorage.__exit__cCsd|j|j|jfS)z"Return a printable representation.zFieldStorage(%r, %r, %r))rhrtrirnrrrro�s
�zFieldStorage.__repr__cCst|���Sr�)�iter�keysrnrrr�__iter__�szFieldStorage.__iter__cCsT|dkrt|��|jr:|j�d�|j��}|j�d�n|jdk	rL|j}nd}|S)Nrir)r�rw�seekr:rurkrrr�__getattr__�s

zFieldStorage.__getattr__cCs^|jdkrtd��g}|jD]}|j|kr|�|�q|sBt|��t|�dkrV|dS|SdS)zDictionary style indexing.N�
not indexabler1r)rur�rh�appendrQrX)rlre�found�itemrrr�__getitem__s


zFieldStorage.__getitem__cCs8||kr0||}t|t�r(dd�|D�S|jSn|SdS)z8Dictionary style get() method, including 'value' lookup.cSsg|]
}|j�qSr�ri�rL�xrrr�
<listcomp>sz)FieldStorage.getvalue.<locals>.<listcomp>N�r5ruri�rlre�defaultrirrr�getvalues
zFieldStorage.getvaluecCs4||kr,||}t|t�r$|djS|jSn|SdS)z! Return the first value received.rNr�r�rrr�getfirsts

zFieldStorage.getfirstcCs:||kr2||}t|t�r(dd�|D�S|jgSngSdS)z  Return list of received values.cSsg|]
}|j�qSrr�r�rrrr�.sz(FieldStorage.getlist.<locals>.<listcomp>Nr�)rlrerirrrrK)s

zFieldStorage.getlistcCs*|jdkrtd��ttdd�|jD���S)zDictionary style keys() method.Nr�css|]}|jVqdSr��rh�rLr�rrr�	<genexpr>8sz$FieldStorage.keys.<locals>.<genexpr>)rur��setrnrrrr�4s
zFieldStorage.keyscs*|jdkrtd��t�fdd�|jD��S)z%Dictionary style __contains__ method.Nr�c3s|]}|j�kVqdSr�r�r��rerrr�>sz,FieldStorage.__contains__.<locals>.<genexpr>)rur��any)rlrerr�r�__contains__:s
zFieldStorage.__contains__cCst|���S)z Dictionary style len(x) support.)rXr�rnrrr�__len__@szFieldStorage.__len__cCs|jdkrtd��t|j�S)NzCannot be converted to bool.)rur��boolrnrrr�__bool__Ds
zFieldStorage.__bool__c	Cs�|j�|j�}t|t�s0td|jt|�jf��|�|j	|j
�}|jrT|d|j7}tj
j||j|j|j	|j
|j|jd�}dd�|D�|_|��dS)z+Internal: read data in query string format.�%s should return bytes, got %sr0�r&rJr�r+cSsg|]\}}t||��qSr�r�rLrerirrrr�Vsz0FieldStorage.read_urlencoded.<locals>.<listcomp>N)r>r:r�r5r�r9rvrpr;r&rJr�r=r
�	parse_qslr@rAr�r+ru�
skip_lines)rlrD�queryrrrr�Is&
��zFieldStorage.read_urlencodedcCsL|j}t|�std|f��g|_|jrftjj|j|j|j	|j
|j|j|j
d�}|j�dd�|D��|jpp|j}|j��}t|t�s�td|jt|�jf��|jt|�7_|��d|jkr�|r�|j��}|jt|�7_q�|j}|dk	�r|t|j�8}t�}	d}
|j��}|
|7}
|���s�q0�q|
�s:�q@|jt|
�7_|	�|
�|j
|j��|	��}d	|k�rz|d	=|jdk�r�dn
|j|j}
||j||||||
|j
|j||j
�}|dk	�r�|d
8}|j�r�|t|j�8}|dk�r�td��|j|j7_|j�|�|j �s@|j|j!k�r4dk�rnn�q@�q|�"�dS)
z/Internal: read a part that is itself multipart.z&Invalid boundary in multipart form: %rr�css|]\}}t||�VqdSr�r�r�rrrr�fsz*FieldStorage.read_multi.<locals>.<genexpr>r��--Nr{r}r1rzMax number of fields exceeded)#r��valid_boundaryr9rur�r=r
r�r@rAr&rJr�r+�extend�FieldStorageClass�	__class__r>r~r5r�rvrpr�rXrYrZfeedr;r$r�r�r�r�r�)rlr?r@rAZibr��klassZ
first_liner��parserZhdr_text�datarIr��partrrrr�[s��

��





��

(zFieldStorage.read_multicCs4|jdkr|��|��n|��|j�d�dS)zInternal: read an atomic part.rN)r��read_binaryr��
read_linesrwr�rnrrrr��s


zFieldStorage.read_singlei cCs�|��|_|j}|dkr�|dkr�|j�t||j��}t|t�sVt	d|jt
|�jf��|jt
|�7_|std|_q�|j�|�|t
|�}qdS)zInternal: read binary data.rr�r_N)�	make_filerwr�r>r:�min�bufsizer5r�r9rvrpr�rXr�r")rlZtodor�rrrr��s

�zFieldStorage.read_binarycCs@|jrt�|_|_nt�|_|_|jr4|��n|��dS)z0Internal: read lines until EOF or outerboundary.N)r�rrw�_FieldStorage__filerr��read_lines_to_outerboundary�read_lines_to_eofrnrrrr��s
zFieldStorage.read_linescCsv|jdk	rF|j��t|�dkrF|��|_|j��}|j�|�d|_|jrZ|j�|�n|j�|�|j	|j
��dS)z line is always bytes, not stringNi�)r��tellrXr�rwr�r"r�r;r&rJ)rlrcr�rrrZ__write�s


zFieldStorage.__writecCs:|j�d�}|jt|�7_|s*d|_q6|�|�qdS)zInternal: read lines until EOF.�r_N)r>r~r�rXr��_FieldStorage__write)rlrcrrrr��szFieldStorage.read_lines_to_eofc	CsJd|j}|d}d}d}d}|jdk	rFd|jkr>|krFnn�qF|j�d�}|jt|�7_|t|�7}|s~d|_�qF|dkr�||}d}|�d�r�|r�|��}||kr��qF||kr�d	|_�qF|}|�	d
�r�d
}|dd�}d}nL|�	d��rd}|dd�}d}n*|�	d��r.d}|dd�}d
}nd}d
}|�
||�qdS)z�Internal: read lines until outerboundary.
        Data is read as bytes: boundaries and line ends must be converted
        to bytes for comparisons.
        r�r{TrNr�r_�
r1s
����
F)r�r�r>r~r�rXr��
startswith�rstrip�endswithr�)	rl�
next_boundary�
last_boundaryZdelim�last_line_lfendZ_readrc�strippedlineZodelimrrrr��sN
$
z(FieldStorage.read_lines_to_outerboundarycCs�|jr|jrdSd|j}|d}d}|j�d�}|jt|�7_|sPd|_q�|�d�r�|r�|��}||krpq�||kr�d|_q�|�d�}q&dS)z5Internal: skip lines until outer boundary if defined.Nr�Tr�r_r1r�)r�r�r>r~r�rXr�rY)rlr�r�r�rcr�rrrr�s$
zFieldStorage.skip_linescCs&|jrt�d�Stjd|jdd�SdS)a�Overridable: return a readable & writable file.

        The file will be used as follows:
        - data is written to it
        - seek(0)
        - data is read from it

        The file is opened in binary mode for files, in text mode
        for other fields

        This version opens a temporary file for reading and writing,
        and immediately deletes (unlinks) it.  The trick (on Unix!) is
        that the file can still be used, but it can't be opened by
        another process, and it will automatically be deleted when it
        is closed or when the current process terminates.

        If you want a more permanent file, you derive a class which
        overrides this method.  If you want a visible temporary file
        that is nevertheless automatically deleted when the script
        terminates, try defining a __del__ method in a derived class
        which unlinks the temporary files you have created.

        zwb+zw+r!)r&�newlineN)r��tempfileZ
TemporaryFiler&rnrrrr�(s
�zFieldStorage.make_file)N)N)!rprqrrrs�osr?rmr�r�r�ror�r�r�r�r�rKr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr	sL)�
&


E	
2cCs�td�t�tjt_zNt�}t�t�t|�t|�t	�dd�}|fdd�}td�|�Wnt
�YnXtd�daz&t�}t�t�t|�t|�Wnt
�YnXd	S)
z�Robust test CGI script, usable as main program.

    Write minimal HTTP headers and dump all information provided to
    the script in HTML form.

    zContent-type: text/htmlcSstd�dS)Nz,testing print_exception() -- <I>italics?</I>)�execrrrrr\[sztest.<locals>.fcSs
|�dSr�r)r\rrr�g]sztest.<locals>.gz9<H3>What follows is a test, not an actual exception:</H3>z*<H1>Second try with a small maxlen...</H1>�2N)�printr2�stdout�stderrr	rrrrrrr8)r?�formr\r�rrrr
Js4
c	Csx|dkrt��\}}}ddl}t�td�|�||�|�||�}tdt�d�|dd���t�|d�f�~dS)Nrz+<H3>Traceback (most recent call last):</H3>z<PRE>%s<B>%s</B></PRE>rr_)	r2�exc_info�	tracebackr��	format_tb�format_exception_only�html�escape�join)rvri�tbr�r�rurrrrqs

��c	Cs\t|���}t�td�td�|D]"}tdt�|�dt�||��q&td�t�dS)z#Dump the shell environment as HTML.z<H3>Shell Environment:</H3>�<DL>�<DT>�<DD>�</DL>N)�sortedr�r�r�r�)r?r�rerrrrs cCs�t|���}t�td�|s&td�td�|D]Z}tdt�|�ddd�||}tdt�tt|���d	�td
t�t|���q2td�t�dS)
z$Dump the contents of a form as HTML.z<H3>Form Contents:</H3>z<P>No form fields.r�r��:� )r[z<i>z</i>r�r�N)r�r�r�r�r��reprrv)r�r�rerirrrr�sc
Csjt�td�zt��}Wn6tk
rP}ztdt�t|���W5d}~XYnXtt�|��t�dS)z#Dump the current directory as HTML.z#<H3>Current Working Directory:</H3>zOSError:N)r�r��getcwdrr�r��str)�pwd�msgrrrr�s&cCs(t�td�t�ttj�t�dS)Nz <H3>Command Line Arguments:</H3>)r�r2r<rrrrr�s

cCstd�dS)z9Dump a list of environment variables used by CGI as HTML.a�
<H3>These environment variables could have been set:</H3>
<UL>
<LI>AUTH_TYPE
<LI>CONTENT_LENGTH
<LI>CONTENT_TYPE
<LI>DATE_GMT
<LI>DATE_LOCAL
<LI>DOCUMENT_NAME
<LI>DOCUMENT_ROOT
<LI>DOCUMENT_URI
<LI>GATEWAY_INTERFACE
<LI>LAST_MODIFIED
<LI>PATH
<LI>PATH_INFO
<LI>PATH_TRANSLATED
<LI>QUERY_STRING
<LI>REMOTE_ADDR
<LI>REMOTE_HOST
<LI>REMOTE_IDENT
<LI>REMOTE_USER
<LI>REQUEST_METHOD
<LI>SCRIPT_NAME
<LI>SERVER_NAME
<LI>SERVER_PORT
<LI>SERVER_PROTOCOL
<LI>SERVER_ROOT
<LI>SERVER_SOFTWARE
</UL>
In addition, HTTP headers sent by the server may be passed in the
environment as well.  Here are some common variable names:
<UL>
<LI>HTTP_ACCEPT
<LI>HTTP_CONNECTION
<LI>HTTP_HOST
<LI>HTTP_PRAGMA
<LI>HTTP_REFERER
<LI>HTTP_USER_AGENT
</UL>
N)r�rrrrr�scCs(ddl}t|t�rd}nd}|�||�S)Nrs^[ -~]{0,200}[!-~]$z^[ -~]{0,200}[!-~]$)�rer5r��match)rZr�Z_vb_patternrrrr��s

r��__main__)rErFr0)NNNN),rs�__version__�iorrrZcollections.abcrr2r�Zurllib.parser=Zemail.parserrZ
email.messagerr�r�r��__all__rrr rrr%rr8r?r
rr]rrr	r
rrrrrrr�rprrrr�<module>sh�#	�
F
:'
/
__pycache__/configparser.cpython-38.pyc000064400000131230151153537560014101 0ustar00U

e5df��@s�dZddlmZddlmZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddddd	d
ddd
ddddddddddddgZ
eZdZdZGdd�de�ZGdd�de�ZGdd�de�ZGd d�de�ZGd!d�de�ZGd"d	�d	e�ZGd#d�de�ZGd$d�de�ZGd%d
�d
e�ZGd&d
�d
e�ZGd'd�de�Ze�ZGd(d�d�Z Gd)d�de �Z!Gd*d�de �Z"Gd+d�de �Z#Gd,d�de�Z$Gd-d�de$�Z%Gd.d�de%�Z&Gd/d�de�Z'Gd0d�de�Z(dS)1a�Configuration file parser.

A configuration file consists of sections, lead by a "[section]" header,
and followed by "name: value" entries, with continuations and such in
the style of RFC 822.

Intrinsic defaults can be specified by passing them into the
ConfigParser constructor as a dictionary.

class:

ConfigParser -- responsible for parsing a list of
                    configuration files, and managing the parsed database.

    methods:

    __init__(defaults=None, dict_type=_default_dict, allow_no_value=False,
             delimiters=('=', ':'), comment_prefixes=('#', ';'),
             inline_comment_prefixes=None, strict=True,
             empty_lines_in_values=True, default_section='DEFAULT',
             interpolation=<unset>, converters=<unset>):
        Create the parser. When `defaults' is given, it is initialized into the
        dictionary or intrinsic defaults. The keys must be strings, the values
        must be appropriate for %()s string interpolation.

        When `dict_type' is given, it will be used to create the dictionary
        objects for the list of sections, for the options within a section, and
        for the default values.

        When `delimiters' is given, it will be used as the set of substrings
        that divide keys from values.

        When `comment_prefixes' is given, it will be used as the set of
        substrings that prefix comments in empty lines. Comments can be
        indented.

        When `inline_comment_prefixes' is given, it will be used as the set of
        substrings that prefix comments in non-empty lines.

        When `strict` is True, the parser won't allow for any section or option
        duplicates while reading from a single source (file, string or
        dictionary). Default is True.

        When `empty_lines_in_values' is False (default: True), each empty line
        marks the end of an option. Otherwise, internal empty lines of
        a multiline option are kept as part of the value.

        When `allow_no_value' is True (default: False), options without
        values are accepted; the value presented for these is None.

        When `default_section' is given, the name of the special section is
        named accordingly. By default it is called ``"DEFAULT"`` but this can
        be customized to point to any other valid section name. Its current
        value can be retrieved using the ``parser_instance.default_section``
        attribute and may be modified at runtime.

        When `interpolation` is given, it should be an Interpolation subclass
        instance. It will be used as the handler for option value
        pre-processing when using getters. RawConfigParser objects don't do
        any sort of interpolation, whereas ConfigParser uses an instance of
        BasicInterpolation. The library also provides a ``zc.buildbot``
        inspired ExtendedInterpolation implementation.

        When `converters` is given, it should be a dictionary where each key
        represents the name of a type converter and each value is a callable
        implementing the conversion from string to the desired datatype. Every
        converter gets its corresponding get*() method on the parser object and
        section proxies.

    sections()
        Return all the configuration section names, sans DEFAULT.

    has_section(section)
        Return whether the given section exists.

    has_option(section, option)
        Return whether the given option exists in the given section.

    options(section)
        Return list of configuration options for the named section.

    read(filenames, encoding=None)
        Read and parse the iterable of named configuration files, given by
        name.  A single filename is also allowed.  Non-existing files
        are ignored.  Return list of successfully read files.

    read_file(f, filename=None)
        Read and parse one configuration file, given as a file object.
        The filename defaults to f.name; it is only used in error
        messages (if f has no `name' attribute, the string `<???>' is used).

    read_string(string)
        Read configuration from a given string.

    read_dict(dictionary)
        Read configuration from a dictionary. Keys are section names,
        values are dictionaries with keys and values that should be present
        in the section. If the used dictionary type preserves order, sections
        and their keys will be added in order. Values are automatically
        converted to strings.

    get(section, option, raw=False, vars=None, fallback=_UNSET)
        Return a string value for the named option.  All % interpolations are
        expanded in the return values, based on the defaults passed into the
        constructor and the DEFAULT section.  Additional substitutions may be
        provided using the `vars' argument, which must be a dictionary whose
        contents override any pre-existing defaults. If `option' is a key in
        `vars', the value from `vars' is used.

    getint(section, options, raw=False, vars=None, fallback=_UNSET)
        Like get(), but convert value to an integer.

    getfloat(section, options, raw=False, vars=None, fallback=_UNSET)
        Like get(), but convert value to a float.

    getboolean(section, options, raw=False, vars=None, fallback=_UNSET)
        Like get(), but convert value to a boolean (currently case
        insensitively defined as 0, false, no, off for False, and 1, true,
        yes, on for True).  Returns False or True.

    items(section=_UNSET, raw=False, vars=None)
        If section is given, return a list of tuples with (name, value) for
        each option in the section. Otherwise, return a list of tuples with
        (section_name, section_proxy) for each section, including DEFAULTSECT.

    remove_section(section)
        Remove the given file section and all its options.

    remove_option(section, option)
        Remove the given option from the given section.

    set(section, option, value)
        Set the given option.

    write(fp, space_around_delimiters=True)
        Write the configuration state in .ini format. If
        `space_around_delimiters' is True (the default), delimiters
        between keys and values are surrounded by spaces.
�)�MutableMapping)�ChainMapN�NoSectionError�DuplicateOptionError�DuplicateSectionError�
NoOptionError�InterpolationError�InterpolationDepthError�InterpolationMissingOptionError�InterpolationSyntaxError�ParsingError�MissingSectionHeaderError�ConfigParser�SafeConfigParser�RawConfigParser�
Interpolation�BasicInterpolation�ExtendedInterpolation�LegacyInterpolation�SectionProxy�ConverterMapping�DEFAULTSECT�MAX_INTERPOLATION_DEPTHZDEFAULT�
c@s&eZdZdZddd�Zdd�ZeZdS)	�Errorz'Base class for ConfigParser exceptions.�cCs||_t�||�dS�N)�message�	Exception�__init__)�self�msg�r"�$/usr/lib64/python3.8/configparser.pyr�szError.__init__cCs|jSr)r�r r"r"r#�__repr__�szError.__repr__N)r)�__name__�
__module__�__qualname__�__doc__rr%�__str__r"r"r"r#r�s
rc@seZdZdZdd�ZdS)rz2Raised when no section matches a requested option.cCs$t�|d|f�||_|f|_dS)NzNo section: %r)rr�section�args�r r+r"r"r#r�szNoSectionError.__init__N�r&r'r(r)rr"r"r"r#r�sc@seZdZdZddd�ZdS)raRaised when a section is repeated in an input source.

    Possible repetitions that raise this exception are: multiple creation
    using the API or in strict parsers when a section is found more than once
    in a single input file, string or dictionary.
    NcCs�t|�dg}|dk	rRdt|�g}|dk	r8|�d�|��|�d�|�|�|}n|�dd�t�|d�|��||_||_	||_
|||f|_dS)N� already exists�While reading from � [line {0:2d}]z
: section rzSection r)�repr�append�format�extend�insertrr�joinr+�source�linenor,)r r+r8r9r!rr"r"r#r�s

zDuplicateSectionError.__init__)NNr.r"r"r"r#r�sc@seZdZdZddd�ZdS)rz�Raised by strict parsers when an option is repeated in an input source.

    Current implementation raises this exception only when an option is found
    more than once in a single file, string or dictionary.
    NcCs�t|�dt|�dg}|dk	rZdt|�g}|dk	r@|�d�|��|�d�|�|�|}n|�dd�t�|d�|��||_||_	||_
||_||||f|_dS)	Nz in section r/r0r1z	: option rzOption r)
r2r3r4r5r6rrr7r+�optionr8r9r,)r r+r:r8r9r!rr"r"r#r�s"�

zDuplicateOptionError.__init__)NNr.r"r"r"r#r�sc@seZdZdZdd�ZdS)rz!A requested option was not found.cCs.t�|d||f�||_||_||f|_dS)NzNo option %r in section: %r�rrr:r+r,)r r:r+r"r"r#r�s�zNoOptionError.__init__Nr.r"r"r"r#r�sc@seZdZdZdd�ZdS)rz0Base class for interpolation-related exceptions.cCs(t�||�||_||_|||f|_dSrr;)r r:r+r!r"r"r#rszInterpolationError.__init__Nr.r"r"r"r#r�sc@seZdZdZdd�ZdS)r
zAA string substitution required a setting which was not available.cCs8d�||||�}t�||||�||_||||f|_dS)Nz�Bad value substitution: option {!r} in section {!r} contains an interpolation key {!r} which is not a valid option name. Raw value: {!r})r4rr�	referencer,)r r:r+�rawvalr<r!r"r"r#rs�z(InterpolationMissingOptionError.__init__Nr.r"r"r"r#r
sc@seZdZdZdS)rz�Raised when the source text contains invalid syntax.

    Current implementation raises this exception when the source text into
    which substitutions are made does not conform to the required syntax.
    N)r&r'r(r)r"r"r"r#rsc@seZdZdZdd�ZdS)r	z0Raised when substitutions are nested too deeply.cCs0d�||t|�}t�||||�|||f|_dS)Nz�Recursion limit exceeded in value substitution: option {!r} in section {!r} contains an interpolation key which cannot be substituted in {} steps. Raw value: {!r})r4rrrr,)r r:r+r=r!r"r"r#rs�z InterpolationDepthError.__init__Nr.r"r"r"r#r	sc@s<eZdZdZd
dd�Zedd��Zejdd��Zdd	�ZdS)rz>Raised when a configuration file does not follow legal syntax.NcCsT|r|rtd��n|s$|s$td��n|r,|}t�|d|�||_g|_|f|_dS)Nz:Cannot specify both `filename' and `source'. Use `source'.z%Required argument `source' not given.z"Source contains parsing errors: %r)�
ValueErrorrrr8�errorsr,)r r8�filenamer"r"r#r,s

zParsingError.__init__cCstjdtdd�|jS)zDeprecated, use `source'.�SThe 'filename' attribute will be removed in future versions.  Use 'source' instead.���
stacklevel��warnings�warn�DeprecationWarningr8r$r"r"r#r@;s�zParsingError.filenamecCstjdtdd�||_dS)zDeprecated, user `source'.rArBrCNrE�r �valuer"r"r#r@Es�cCs*|j�||f�|jd||f7_dS)Nz
	[line %2d]: %s)r?r3r)r r9�liner"r"r#r3OszParsingError.append)NN)	r&r'r(r)r�propertyr@�setterr3r"r"r"r#r)s

	
	c@seZdZdZdd�ZdS)r
z@Raised when a key-value pair is found before any section header.cCs8t�|d|||f�||_||_||_|||f|_dS)Nz7File contains no section headers.
file: %r, line: %d
%r)rrr8r9rKr,)r r@r9rKr"r"r#rWs��z"MissingSectionHeaderError.__init__Nr.r"r"r"r#r
Tsc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)rzBDummy interpolation that passes the value through with no changes.cCs|Srr")r �parserr+r:rJ�defaultsr"r"r#�
before_getkszInterpolation.before_getcCs|Srr"�r rNr+r:rJr"r"r#�
before_setnszInterpolation.before_setcCs|Srr"rQr"r"r#�before_readqszInterpolation.before_readcCs|Srr"rQr"r"r#�before_writetszInterpolation.before_writeN)r&r'r(r)rPrRrSrTr"r"r"r#rhs
c@s2eZdZdZe�d�Zdd�Zdd�Zdd�Z	d	S)
ra!Interpolation as implemented in the classic ConfigParser.

    The option values can contain format strings which refer to other values in
    the same section, or values in the special default section.

    For example:

        something: %(dir)s/whatever

    would resolve the "%(dir)s" to the value of dir.  All reference
    expansions are done late, on demand. If a user needs to use a bare % in
    a configuration file, she can escape it by writing %%. Other % usage
    is considered a user error and raises `InterpolationSyntaxError'.z
%\(([^)]+)\)sc	Cs$g}|�||||||d�d�|�S�N�r��_interpolate_somer7�r rNr+r:rJrO�Lr"r"r#rP�szBasicInterpolation.before_getcCs<|�dd�}|j�d|�}d|kr8td||�d�f��|S)Nz%%r�%�1invalid interpolation syntax in %r at position %d��replace�_KEYCRE�subr>�find�r rNr+r:rJZ	tmp_valuer"r"r#rR�s�zBasicInterpolation.before_setc
Csj|j||d|d�}|tkr&t|||��|�rf|�d�}	|	dkrL|�|�dS|	dkrr|�|d|	��||	d�}|dd�}
|
dkr�|�d�|dd�}q&|
dk�rR|j�|�}|dkr�t||d|��|�|�	d��}||�
�d�}z||}
Wn&tk
�rt||||�d�YnXd|
k�rF|�
||||
|||d�n
|�|
�q&t||d	|f��q&dS)
NT��raw�fallbackr[rrVrB�(�'bad interpolation variable reference %rz/'%%' must be followed by '%%' or '(', found: %r)�getrr	rar3r_�matchr�optionxform�group�end�KeyErrorr
rX)r rNr:�accum�restr+�map�depthr=�p�c�m�var�vr"r"r#rX�s`



���
���z$BasicInterpolation._interpolate_someN�
r&r'r(r)�re�compiler_rPrRrXr"r"r"r#rxs

c@s2eZdZdZe�d�Zdd�Zdd�Zdd�Z	d	S)
rzyAdvanced variant of interpolation, supports the syntax used by
    `zc.buildout'. Enables interpolation between sections.z
\$\{([^}]+)\}c	Cs$g}|�||||||d�d�|�SrUrWrYr"r"r#rP�sz ExtendedInterpolation.before_getcCs<|�dd�}|j�d|�}d|kr8td||�d�f��|S)Nz$$r�$r\r]rbr"r"r#rR�s�z ExtendedInterpolation.before_setcCs�|j||d|d�}|tkr&t|||��|�r�|�d�}	|	dkrL|�|�dS|	dkrr|�|d|	��||	d�}|dd�}
|
dkr�|�d�|dd�}q&|
dk�r�|j�|�}|dkr�t||d|��|�d��	d	�}||�
�d�}|}
|}zrt|�dk�r|�|d�}||}nHt|�dk�rR|d}
|�|d�}|j|
|dd
�}nt||d|f��Wn2t
ttfk
�r�t|||d	�|��d�YnXd|k�r�|�|||||
t|j|
dd
��|d�n
|�|�q&t||d|f��q&dS)
NTrcrzrrVrB�{rg�:)rdzMore than one ':' found: %rz-'$' must be followed by '$' or '{', found: %r)rhrr	rar3r_rirrk�splitrl�lenrjrmrrr
r7rX�dict�items)r rNr:rnror+rprqr=rrrsrt�pathZsect�optrvr"r"r#rX�sx



�
���
���z'ExtendedInterpolation._interpolate_someNrwr"r"r"r#r�s

c@s6eZdZdZe�d�Zdd�Zdd�Ze	dd��Z
d	S)
rz{Deprecated interpolation used in old versions of ConfigParser.
    Use BasicInterpolation or ExtendedInterpolation instead.z%\(([^)]*)\)s|.c

Cs�|}t}|r�|d8}|r�d|kr�tj|j|d�}|j�||�}z||}Wq�tk
r�}	zt||||	jd�d�W5d}	~	XYq�Xqq�q|r�d|kr�t	|||��|S)NrVz%()rNr)
r�	functools�partial�_interpolation_replacer_r`rmr
r,r	)
r rNr+r:rJ�varsr=rqr^�er"r"r#rPs0���zLegacyInterpolation.before_getcCs|Srr"rQr"r"r#rR$szLegacyInterpolation.before_setcCs,|�d�}|dkr|��Sd|�|�SdS)NrVz%%(%s)s)rkrj)rirN�sr"r"r#r�'s
z*LegacyInterpolation._interpolation_replaceN)r&r'r(r)rxryr_rPrR�staticmethodr�r"r"r"r#r
s
c
s6eZdZdZdZdZdZe�Ze	�
ee	j�Ze	�
ej
dd�e	j�Ze	�
ej
dd�e	j�Ze	�
d�Zddddd	d	d	d	d
�Zded	fdd
dddeeed�dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdddd�Zdedd�Zdfd d!�Zdgd#d$�Zdhd%d&�Zd	ded'�d(d)�Z d*d+�Z!d	ded'�d,d-�Z"d	ded'�d.d/�Z#d	ded'�d0d1�Z$d	ded'�d2d3�Z%ed	df�fd4d5�	Z&d6d7�Z'd8d9�Z(d:d;�Z)did<d=�Z*djd>d?�Z+d@dA�Z,dBdC�Z-dDdE�Z.dFdG�Z/dHdI�Z0dJdK�Z1dLdM�Z2dNdO�Z3dPdQ�Z4dRdS�Z5dTdU�Z6dVdW�Z7dXdY�Z8dZd[�Z9d\d]�Z:d^d^d^d_�d`da�Z;e<dbdc��Z=�Z>S)krz,ConfigParser that does not do interpolation.z�
        \[                                 # [
        (?P<header>[^]]+)                  # very permissive!
        \]                                 # ]
        a�
        (?P<option>.*?)                    # very permissive!
        \s*(?P<vi>{delim})\s*              # any number of space/tab,
                                           # followed by any of the
                                           # allowed delimiters,
                                           # followed by any space/tab
        (?P<value>.*)$                     # everything up to eol
        a�
        (?P<option>.*?)                    # very permissive!
        \s*(?:                             # any number of space/tab,
        (?P<vi>{delim})\s*                 # optionally followed by
                                           # any of the allowed
                                           # delimiters, followed by any
                                           # space/tab
        (?P<value>.*))?$                   # everything up to eol
        z=|:�Zdelimz\STF)�1Zyes�trueZon�0ZnoZfalseZoffN��=r|)�#�;)�
delimiters�comment_prefixes�inline_comment_prefixes�strict�empty_lines_in_values�default_section�
interpolation�
convertersc
Cs<||_|��|_|��|_t|�|_|��|_t||	�|j|	<t|�|_|dkrd|rZ|j	n|j
|_nNd�dd�|D��}|r�t
�|jj|d�t
j�|_nt
�|jj|d�t
j�|_t|p�d�|_t|p�d�|_||_||_||_|	|_|
|_|jtkr�|j|_|jdk�rt�|_|tk	�r(|j�|�|�r8|�|�dS)Nr��|css|]}t�|�VqdSr)rx�escape)�.0�dr"r"r#�	<genexpr>jsz+RawConfigParser.__init__.<locals>.<genexpr>r�r")�_dict�	_sections�	_defaultsr�_converters�_proxiesr�tuple�_delimiters�	OPTCRE_NV�OPTCRE�_optcrer7rxry�_OPT_NV_TMPLr4�VERBOSE�	_OPT_TMPL�_comment_prefixes�_inline_comment_prefixes�_strict�_allow_no_value�_empty_lines_in_valuesr��_interpolation�_UNSET�_DEFAULT_INTERPOLATIONr�update�_read_defaults)
r rOZ	dict_typeZallow_no_valuer�r�r�r�r�r�r�r�r�r"r"r#rYs@




��

zRawConfigParser.__init__cCs|jSr)r�r$r"r"r#rO�szRawConfigParser.defaultscCst|j���S)z3Return a list of section names, excluding [DEFAULT])�listr��keysr$r"r"r#�sections�szRawConfigParser.sectionscCsJ||jkrtd|��||jkr(t|��|��|j|<t||�|j|<dS)z�Create a new section in the configuration.

        Raise DuplicateSectionError if a section by the specified name
        already exists. Raise ValueError if name is DEFAULT.
        zInvalid section name: %rN)r�r>r�rr�rr�r-r"r"r#�add_section�s

zRawConfigParser.add_sectioncCs
||jkS)z~Indicate whether the named section is present in the configuration.

        The DEFAULT section is not acknowledged.
        )r�r-r"r"r#�has_section�szRawConfigParser.has_sectioncCsJz|j|��}Wntk
r0t|�d�YnX|�|j�t|���S)z9Return a list of option names for the given section name.N)r��copyrmrr�r�r�r�)r r+Zoptsr"r"r#�options�szRawConfigParser.optionsc
Cs�t|tttjf�r|g}g}|D]f}z(t||d��}|�||�W5QRXWntk
rdYq YnXt|tj�r|t�|�}|�	|�q |S)a�Read and parse a filename or an iterable of filenames.

        Files that cannot be opened are silently ignored; this is
        designed so that you can specify an iterable of potential
        configuration file locations (e.g. current directory, user's
        home directory, systemwide directory), and all existing
        configuration files in the iterable will be read.  A single
        filename may also be given.

        Return list of successfully read files.
        )�encoding)
�
isinstance�str�bytes�os�PathLike�open�_read�OSError�fspathr3)r �	filenamesr�Zread_okr@�fpr"r"r#�read�s

zRawConfigParser.readcCs<|dkr,z
|j}Wntk
r*d}YnX|�||�dS)aPLike read() but the argument must be a file-like object.

        The `f' argument must be iterable, returning one line at a time.
        Optional second argument is the `source' specifying the name of the
        file being read. If not given, it is taken from f.name. If `f' has no
        `name' attribute, `<???>' is used.
        Nz<???>)�name�AttributeErrorr�)r �fr8r"r"r#�	read_file�s

zRawConfigParser.read_file�<string>cCst�|�}|�||�dS)z'Read configuration from a given string.N)�io�StringIOr�)r �stringr8Zsfiler"r"r#�read_string�s
zRawConfigParser.read_string�<dict>c
Cs�t�}|��D]�\}}t|�}z|�|�Wn(ttfk
rT|jrP||krP�YnX|�|�|��D]`\}}|�t|��}|dk	r�t|�}|jr�||f|kr�t	|||��|�||f�|�|||�qhqdS)aRead configuration from a dictionary.

        Keys are section names, values are dictionaries with keys and values
        that should be present in the section. If the used dictionary type
        preserves order, sections and their keys will be added in order.

        All types held in the dictionary are converted to strings during
        reading, including section names, option names and keys.

        Optional second argument is the `source' specifying the name of the
        dictionary being read.
        N)
�setr�r�r�rr>r��addrjr)r Z
dictionaryr8�elements_addedr+r��keyrJr"r"r#�	read_dict�s"

zRawConfigParser.read_dictcCs"tjdtdd�|j||d�dS)z"Deprecated, use read_file instead.zRThis method will be removed in future versions.  Use 'parser.read_file()' instead.rBrC)r8N)rFrGrHr�)r r�r@r"r"r#�readfp�s�zRawConfigParser.readfp�rdr�recCs�z|�||�}Wn(tk
r8|tkr,�n|YSYnX|�|�}z||}Wn0tk
r�|tkrtt||��n|YSYnX|s�|dkr�|S|j�|||||�SdS)a]Get an option value for a given section.

        If `vars' is provided, it must be a dictionary. The option is looked up
        in `vars' (if provided), `section', and in `DEFAULTSECT' in that order.
        If the key is not found and `fallback' is provided, it is used as
        a fallback value. `None' can be provided as a `fallback' value.

        If interpolation is enabled and the optional argument `raw' is False,
        all interpolations are expanded in the return values.

        Arguments `raw', `vars', and `fallback' are keyword only.

        The section DEFAULT is special.
        N)�
_unify_valuesrr�rjrmrr�rP)r r+r:rdr�rer�rJr"r"r#rh�s$
�zRawConfigParser.getcKs||j||f|��Sr)rh)r r+�convr:�kwargsr"r"r#�_get"szRawConfigParser._getc	KsJz|j|||f||d�|��WSttfk
rD|tkr<�|YSXdS)N)rdr�)r�rrr�)r r+r:r�rdr�rer�r"r"r#�	_get_conv%s�zRawConfigParser._get_convcKs|j||tf|||d�|��S�Nr�)r��int�r r+r:rdr�rer�r"r"r#�getint0s
��zRawConfigParser.getintcKs|j||tf|||d�|��Sr�)r��floatr�r"r"r#�getfloat5s
��zRawConfigParser.getfloatcKs |j|||jf|||d�|��Sr�)r��_convert_to_booleanr�r"r"r#�
getboolean:s��zRawConfigParser.getbooleancs��tkrt���S�j���z���j��Wn&tk
rV��jkrRt	���YnXt
����}|r�|��D]\}}|���|�<qp���fdd��|r��fdd���fdd�|D�S)a�Return a list of (name, value) tuples for each option in a section.

        All % interpolations are expanded in the return values, based on the
        defaults passed into the constructor, unless the optional argument
        `raw' is true.  Additional substitutions may be provided using the
        `vars' argument, which must be a dictionary whose contents overrides
        any pre-existing defaults.

        The section DEFAULT is special.
        cs�j���|�|��Sr)r�rP�r:)r�r+r r"r#�<lambda>Ws
�z'RawConfigParser.items.<locals>.<lambda>cs�|Srr"r�)r�r"r#r�Z�csg|]}|�|�f�qSr"r")r�r:)�value_getterr"r#�
<listcomp>[sz)RawConfigParser.items.<locals>.<listcomp>)
r��superr�r�r�r�r�rmr�rr�r�rj)r r+rdr�Z	orig_keysr�rJ��	__class__)r�r+r r�r#r�?s 


zRawConfigParser.itemscCs.|��D]}||}||=||fSt�dS)z�Remove a section from the parser and return it as
        a (section_name, section_proxy) tuple. If no section is present, raise
        KeyError.

        The section DEFAULT is never returned because it cannot be removed.
        N)r�rm�r r�rJr"r"r#�popitem]s
zRawConfigParser.popitemcCs|��Sr)�lower)r Z	optionstrr"r"r#rjjszRawConfigParser.optionxformcCsV|r||jkr"|�|�}||jkS||jkr0dS|�|�}||j|kpP||jkSdS)z�Check for the existence of a given option in a given section.
        If the specified `section' is None or an empty string, DEFAULT is
        assumed. If the specified `section' does not exist, returns False.FN)r�rjr�r�)r r+r:r"r"r#�
has_optionms



�zRawConfigParser.has_optioncCsl|r|j�||||�}|r$||jkr,|j}n.z|j|}Wntk
rXt|�d�YnX|||�|�<dS)zSet an option.N)r�rRr�r�r�rmrrj)r r+r:rJ�sectdictr"r"r#r�{s�zRawConfigParser.setcCsh|rd�|jd�}n
|jd}|jr>|�||j|j��|�|jD]}|�|||j|��|�qDdS)z�Write an .ini-format representation of the configuration state.

        If `space_around_delimiters' is True (the default), delimiters
        between keys and values are surrounded by spaces.
        z {} rN)r4r�r��_write_sectionr�r�r�)r r�Zspace_around_delimitersr�r+r"r"r#�write�s

�
�zRawConfigParser.writecCsx|�d�|��|D]T\}}|j�||||�}|dk	s<|jsR|t|��dd�}nd}|�d�||��q|�d�dS)z-Write a single section to the specified `fp'.z[{}]
N�
z
	rz{}{}
)r�r4r�rTr�r�r^)r r�Zsection_nameZ
section_itemsZ	delimiterr�rJr"r"r#r��s�zRawConfigParser._write_sectioncCsd|r||jkr|j}n.z|j|}Wntk
rBt|�d�YnX|�|�}||k}|r`||=|S)zRemove an option.N)r�r�r�rmrrj)r r+r:r��existedr"r"r#�
remove_option�s
zRawConfigParser.remove_optioncCs"||jk}|r|j|=|j|=|S)zRemove a file section.)r�r�)r r+r�r"r"r#�remove_section�s

zRawConfigParser.remove_sectioncCs&||jkr|�|�st|��|j|Sr)r�r�rmr��r r�r"r"r#�__getitem__�szRawConfigParser.__getitem__cCsX||kr|||krdS||jkr.|j��n||jkrF|j|��|�||i�dSr)r�r��clearr�r�r�r"r"r#�__setitem__�s

zRawConfigParser.__setitem__cCs2||jkrtd��|�|�s$t|��|�|�dS)Nz"Cannot remove the default section.)r�r>r�rmr�r�r"r"r#�__delitem__�s


zRawConfigParser.__delitem__cCs||jkp|�|�Sr)r�r�r�r"r"r#�__contains__�szRawConfigParser.__contains__cCst|j�dS)NrV)r~r�r$r"r"r#�__len__�szRawConfigParser.__len__cCst�|jf|j���Sr)�	itertools�chainr�r�r�r$r"r"r#�__iter__�szRawConfigParser.__iter__cCs t�}d}d}d}d}d}d}	t|dd�D�]�\}}
tj}dd�|jD�}|tjkr�|r�i}
|��D]T\}}|
�||d�}|dkr�qd||
|<|dks�|dkrd|
|d��rdt||�}qd|
}qJ|j	D]}|
�
��|�r�d}q�q�|tjkr�d}|
d|��
�}|�sN|j�rF|dk�rL|dk	�rL|�rL||dk	�rL||�
d�q*tj}q*|j�|
�}|�rh|��nd}|dk	�r�|�r�||k�r�||�
|�q*|}|j�|�}|�r<|�d	�}||jk�r�|j�r�||k�r�t|||��|j|}|�|�n@||jk�r
|j}n,|��}||j|<t||�|j|<|�|�d}q*|dk�rTt|||
��q*|j�|�}|�r�|�d
dd�\}}}|�s�|�|	|||
�}	|� |�!��}|j�r�||f|k�r�t"||||��|�||f�|dk	�r�|�
�}|g||<nd||<q*|�|	|||
�}	q*|�#�|	�r|	�dS)
aParse a sectioned configuration file.

        Each section in a configuration file contains a header, indicated by
        a name in square brackets (`[]'), plus key/value options, indicated by
        `name' and `value' delimited with a specific substring (`=' or `:' by
        default).

        Values can span multiple lines, as long as they are indented deeper
        than the first line of the value. Depending on the parser's mode, blank
        lines may be treated as parts of multiline values or ignored.

        Configuration files may include comments, prefixed by specific
        characters (`#' and `;' by default). Comments may appear on their own
        in an otherwise empty line or may be entered in lines holding values or
        section names.
        NrrV)�startcSsi|]
}|d�qS)���r")r�rrr"r"r#�
<dictcomp>�sz)RawConfigParser._read.<locals>.<dictcomp>rr�headerr:�virJ)$r��	enumerate�sys�maxsizer�r�ra�isspace�minr��strip�
startswithr�r3�NONSPACECRE�searchr�SECTCRErirkr�r�rr�r�r�r�rr�r
r��
_handle_errorrj�rstripr�_join_multiline_values)r r��fpnamer�ZcursectZsectnameZoptnamer9Zindent_levelr�rKZ
comment_startZinline_prefixesZ
next_prefixes�prefix�indexrJZfirst_nonspaceZcur_indent_levelZmor	Zoptvalr"r"r#r��s� 


��
��
�




��

zRawConfigParser._readcCsr|j|jf}t�|f|j���}|D]H\}}|��D]6\}}t|t�rTd�|��	�}|j
�||||�||<q4q$dS)Nr�)r�r�rrr�r�r�r�r7rr�rS)r rOZall_sectionsr+r�r��valr"r"r#r[s�
�z&RawConfigParser._join_multiline_valuescCs&|��D]\}}||j|�|�<qdS)zTRead the defaults passed in the initializer.
        Note: values can be non-string.N)r�r�rj)r rOr�rJr"r"r#r�gszRawConfigParser._read_defaultscCs |st|�}|�|t|��|Sr)rr3r2)r �excrr9rKr"r"r#rmszRawConfigParser._handle_errorcCs�i}z|j|}Wn(tk
r:||jkr6t|�d�YnXi}|rt|��D]&\}}|dk	rdt|�}|||�|�<qLt|||j�S)z�Create a sequence of lookups with 'vars' taking priority over
        the 'section' which takes priority over the DEFAULTSECT.

        N)	r�rmr�rr�r�rj�	_ChainMapr�)r r+r�ZsectiondictZvardictr�rJr"r"r#r�ss
zRawConfigParser._unify_valuescCs(|��|jkrtd|��|j|��S)zJReturn a boolean value translating from other types if necessary.
        zNot a boolean: %s)r��BOOLEAN_STATESr>rIr"r"r#r��sz#RawConfigParser._convert_to_booleanr)r+r:rJcCsDt|t�std��t|t�s$td��|jr.|r@t|t�s@td��dS)a�Raises a TypeError for non-string values.

        The only legal non-string value if we allow valueless
        options is None, so we need to check if the value is a
        string if:
        - we do not allow valueless options, or
        - we allow valueless options but the value is not None

        For compatibility reasons this method is not used in classic set()
        for RawConfigParsers. It is invoked in every case for mapping protocol
        access and in ConfigParser.set().
        zsection names must be stringszoption keys must be stringszoption values must be stringsN)r�r��	TypeErrorr��r r+r:rJr"r"r#�_validate_value_types�s



z%RawConfigParser._validate_value_typescCs|jSr)r�r$r"r"r#r��szRawConfigParser.converters)N)N)r�)r�)N)N)T)?r&r'r(r)Z
_SECT_TMPLr�r�rr�rxryr�rr4r�r�rr�
_default_dictrr�rrOr�r�r�r�r�r�r�r�r�rhr�r�r�r�r�r�r�rjr�r�r�r�r�r�r�r�r�rrrr�rr�rr�r�r rLr��
__classcell__r"r"r�r#r0s�

���(	




	%����




zcs<eZdZdZe�Zd	�fdd�	Z�fdd�Zdd�Z�Z	S)
rz(ConfigParser implementing interpolation.Ncs"|j||d�t��|||�dS)zmSet an option.  Extends RawConfigParser.set by validating type and
        interpolation syntax on the value.�r:rJN)r r�r�rr�r"r#r��szConfigParser.setcs|j|d�t��|�dS)z�Create a new section in the configuration.  Extends
        RawConfigParser.add_section by validating if the section name is
        a string.)r+N)r r�r�r-r�r"r#r��szConfigParser.add_sectioncCs0z"|j}t�|_|�|j|i�W5||_XdS)z�Reads the defaults passed in the initializer, implicitly converting
        values to strings like the rest of the API.

        Does not perform interpolation for backwards compatibility.
        N)r�rr�r�)r rOZhold_interpolationr"r"r#r��s
zConfigParser._read_defaults)N)
r&r'r(r)rr�r�r�r�r"r"r"r�r#r�s
cs eZdZdZ�fdd�Z�ZS)rz8ConfigParser alias for backwards compatibility purposes.cs"t�j||�tjdtdd�dS)Nz�The SafeConfigParser class has been renamed to ConfigParser in Python 3.2. This alias will be removed in future versions. Use ConfigParser directly instead.rBrC)r�rrFrGrH)r r,r�r�r"r#r�s�zSafeConfigParser.__init__)r&r'r(r)rr"r"r"r�r#r�sc@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Ze
dd��Ze
dd��Zddddd�dd�ZdS)rz+A proxy for a single section from a parser.cCsF||_||_|jD].}d|}tj|jt||�d�}t|||�qdS)z@Creates a view on a section of the specified `name` in `parser`.rh��_implN)�_parser�_namer�r�r�rh�getattr�setattr)r rNr�r�r��getterr"r"r#r�s
zSectionProxy.__init__cCsd�|j�S)Nz
<Section: {}>)r4r'r$r"r"r#r%�szSectionProxy.__repr__cCs(|j�|j|�st|��|j�|j|�Sr)r&r�r'rmrhr�r"r"r#r��szSectionProxy.__getitem__cCs"|jj||d�|j�|j||�S)Nr#)r&r r�r'r�r"r"r#r��szSectionProxy.__setitem__cCs,|j�|j|�r |j�|j|�s(t|��dSr)r&r�r'r�rmr�r"r"r#r��s�zSectionProxy.__delitem__cCs|j�|j|�Sr)r&r�r'r�r"r"r#r�szSectionProxy.__contains__cCst|���Sr)r~�_optionsr$r"r"r#r�szSectionProxy.__len__cCs|����Sr)r+rr$r"r"r#r�szSectionProxy.__iter__cCs*|j|jjkr|j�|j�S|j��SdSr)r'r&r�r�rOr$r"r"r#r+�szSectionProxy._optionscCs|jSr)r&r$r"r"r#rNszSectionProxy.parsercCs|jSr)r'r$r"r"r#r�szSectionProxy.nameNF)rdr�r%cKs(|s|jj}||j|f|||d�|��S)z�Get an option value.

        Unless `fallback` is provided, `None` will be returned if the option
        is not found.

        r�)r&rhr')r r:rerdr�r%r�r"r"r#rhs
��zSectionProxy.get)N)r&r'r(r)rr%r�r�r�rrrr+rLrNr�rhr"r"r"r#r�s"	

�c@sJeZdZdZe�d�Zdd�Zdd�Zdd�Z	d	d
�Z
dd�Zd
d�ZdS)ra/Enables reuse of get*() methods between the parser and section proxies.

    If a parser class implements a getter directly, the value for the given
    key will be ``None``. The presence of the converter name here enables
    section proxies to find and use the implementation on the parser class.
    z^get(?P<name>.+)$cCsR||_i|_t|j�D]6}|j�|�}|rtt|j|��s<qd|j|�d�<qdS)Nr�)r&�_data�dir�	GETTERCREri�callabler(rk)r rNr*rtr"r"r#r%szConverterMapping.__init__cCs
|j|Sr)r,r�r"r"r#r�.szConverterMapping.__getitem__c	Cs�zd|}Wn(tk
r4td�|t|����YnX|dkrFtd��||j|<tj|jj|d�}||_	t
|j||�|j��D] }tj|j|d�}t
|||�q�dS)NrhzIncompatible key: {} (type: {})z)Incompatible key: cannot use "" as a name)r�r$)
rr>r4�typer,r�r�r&r�Z	converterr)�valuesrh)r r�rJ�k�func�proxyr*r"r"r#r�1s �
zConverterMapping.__setitem__c	Cs~zd|p
d}Wntk
r,t|��YnX|j|=t�|jf|j���D],}zt||�WqLtk
rvYqLYqLXqLdS)Nrh)	rrmr,rrr&r1�delattrr�)r r�r2�instr"r"r#r�AszConverterMapping.__delitem__cCs
t|j�Sr)�iterr,r$r"r"r#rOszConverterMapping.__iter__cCs
t|j�Sr)r~r,r$r"r"r#rRszConverterMapping.__len__N)
r&r'r(r)rxryr.rr�r�r�rrr"r"r"r#rs
	))r)Zcollections.abcr�collectionsrrr�r�rr�rxrrF�__all__rr!rrrrrrrrrr
rr	rr
�objectr�rrrrrrrrrr"r"r"r#�<module>st
�	
	

+HJ&| 
F__pycache__/profile.cpython-38.pyc000064400000034675151153537560013076 0ustar00U

e5d�[�@sxdZddlZddlZddlZddlZdddgZGdd�d�Zdd	d�Zdd
d�ZGdd�d�Z	dd
�Z
edkrte
�dS)z Class for profiling Python code.�N�run�runctx�Profilec@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�_Utilsz�Support class for utility functions which are shared by
    profile.py and cProfile.py modules.
    Not supposed to be used directly.
    cCs
||_dS�N)�profiler)�selfr�r	�/usr/lib64/python3.8/profile.py�__init__0sz_Utils.__init__cCsF|��}z(z|�|�Wntk
r,YnXW5|�|||�XdSr)r�_showr�
SystemExit)r�	statement�filename�sort�profr	r	r
r3s
z
_Utils.runcCsJ|��}z,z|�|||�Wntk
r0YnXW5|�|||�XdSr)rrrr
)rr�globals�localsrrrr	r	r
r<s
z
_Utils.runctxcCs"|dk	r|�|�n
|�|�dSr)�
dump_stats�print_stats)rrrrr	r	r
rEsz_Utils._showN)�__name__�
__module__�__qualname__�__doc__rrrrr	r	r	r
r*s
		r���cCstt��|||�S)aRun statement under profiler optionally saving results in filename

    This function takes a single argument that can be passed to the
    "exec" statement, and an optional file name.  In all cases this
    routine attempts to "exec" its first argument and gather profiling
    statistics from the execution. If no file name is present, then this
    function automatically prints a simple profiling report, sorted by the
    standard name string (file/line/function-name) that is presented in
    each line.
    )rrr)rrrr	r	r
rQscCstt��|||||�S)z�Run statement under profiler, supplying your own globals and locals,
    optionally saving results in filename.

    statement and filename have the same semantics as profile.run
    )rrr)rrrrrr	r	r
r^sc@s�eZdZdZdZd5dd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
ee
e
ee
e
d�Zdd�ZGdd�d�ZGdd�d�Zdd�Zdd �Zd6d"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0e_d7d1d2�Zd3d4�ZdS)8raProfiler class.

    self.cur is always a tuple.  Each such tuple corresponds to a stack
    frame that is currently active (self.cur[-2]).  The following are the
    definitions of its members.  We use this external "parallel stack" to
    avoid contaminating the program that we are profiling. (old profiler
    used to write into the frames local dictionary!!) Derived classes
    can change the definition of some entries, as long as they leave
    [-2:] intact (frame and previous tuple).  In case an internal error is
    detected, the -3 element is used as the function name.

    [ 0] = Time that needs to be charged to the parent frame's function.
           It is used so that a function call will not have to access the
           timing data for the parent frame.
    [ 1] = Total time spent in this frame's function, excluding time in
           subfunctions (this latter is tallied in cur[2]).
    [ 2] = Total time spent in subfunctions, excluding time executing the
           frame's function (this latter is tallied in cur[1]).
    [-3] = Name of the function that corresponds to this frame.
    [-2] = Actual frame that we correspond to (used to sync exception handling).
    [-1] = Our parent 6-tuple (corresponds to frame.f_back).

    Timing data for each function is stored as a 5-tuple in the dictionary
    self.timings[].  The index is always the name stored in self.cur[-3].
    The following are the definitions of the members:

    [0] = The number of times this function was called, not counting direct
          or indirect recursion,
    [1] = Number of times this function appears on the stack, minus one
    [2] = Total time spent internal to this function
    [3] = Cumulative time that this function was present on the stack.  In
          non-recursive functions, this is the total execution time from start
          to finish of each invocation of a function, including time spent in
          all subfunctions.
    [4] = A dictionary indicating for each function name, the number of times
          it was called by us.
    rNcCs�i|_d|_d|_d|_|dkr&|j}||_|sHtj|_|_|j	|_
nl||_|��}zt|�}Wn"tk
r�||_|j	|_
Yn0X|dkr�|j
|_
n|j|_
|tfdd�}||_|��|_|�d�dS)N��cSs
||��Srr	)�timer�sumr	r	r
�get_time_timer�sz(Profile.__init__.<locals>.get_time_timerr)�timings�cur�cmd�c_func_name�bias�time�process_timer�get_time�trace_dispatch_i�
dispatcher�len�	TypeError�trace_dispatch�trace_dispatch_lr�t�
simulate_call)rrr$r.Zlengthrr	r	r
r�s0


zProfile.__init__cCs�|j}|�}|d|d|j|j}|dkr8|j|_|j||||�rd|�}|d|d|_n|�}|d|d||_dS)Nr��c_call�rr.r$rr#�dispatch)r�frame�event�argrr.�rr	r	r
r,�szProfile.trace_dispatchcCsT|j}|�|j|j}|dkr(|j|_|j||||�rD|�|_n|�||_dS�Nr1r2�rr4r5r6rr.r	r	r
r(�s
zProfile.trace_dispatch_icCs`|j}|�d|j|j}|dkr,|j|_|j||||�rL|�d|_n|�d||_dS)NgN@r1r2r9r	r	r
�trace_dispatch_mac�szProfile.trace_dispatch_maccCsT|j}|�|j|j}|dkr(|j|_|j||||�rD|�|_n|�||_dSr8)r'r.r$rr#r3)rr4r5r6r'r.r	r	r
r-�s
zProfile.trace_dispatch_lc	CsD|j\}}}}}}||k	r*|r*|�||�S|||||||f|_dS�Nr0)r!�trace_dispatch_return)	rr4r.�rpt�rit�ret�rfn�rframe�rcurr	r	r
�trace_dispatch_exception�s
z Profile.trace_dispatch_exceptioncCs|jr�|j|jdk	r�|j\}}}}}}t|tj�s�|j|jksXtd|||j||jf��|�|d�|jdks�|j|jdks�td|jdf��|j}	|	j|	j	|	j
f}
|dd|
||jf|_|j}|
|kr�||
\}}
}}}||
d|||f||
<nddddif||
<dS)N���zBad callr���r0)r!�f_back�
isinstancer�
fake_frame�AssertionErrorr<�f_code�co_filename�co_firstlineno�co_namer )rr4r.r=r>r?r@rArBZfcode�fnr �cc�ns�tt�ct�callersr	r	r
�trace_dispatch_calls4�
���zProfile.trace_dispatch_callc
Csndd|jf}|dd|||jf|_|j}||krX||\}}}}}	||d|||	f||<nddddif||<dS)Nrrr0)r#r!r )
rr4r.rNr rOrPrQrRrSr	r	r
�trace_dispatch_c_callszProfile.trace_dispatch_c_callcCs�||jdk	rB||jdjks0td|jdf��|�|jdd�|j\}}}}}}||}||}|\}	}
}}}
}|	|
|||||
|f|_|j}||\}}}}}|s�||}|d}||kr�||d||<nd||<||d||||f||<dS)NrDz
Bad returnrErr0)r!rFrIr<r )rr4r.r=r>r?r@rBZframe_totalZpptZpitZpetZpfn�pframeZpcurr rOrPrQrRrSr	r	r
r<"s$"zProfile.trace_dispatch_return)�callZ	exception�returnr1Zc_exceptionZc_returncCs"|jdrdS||_|�|�dS)Nr)r!r"r/)rr"r	r	r
�set_cmdXs
zProfile.set_cmdc@seZdZdd�Zdd�ZdS)zProfile.fake_codecCs||_||_||_d|_dS�Nr)rK�co_linerMrL)rr�line�namer	r	r
r^szProfile.fake_code.__init__cCst|j|j|jf�Sr)�reprrKr[rM�rr	r	r
�__repr__dszProfile.fake_code.__repr__N)rrrrr`r	r	r	r
�	fake_code]srac@seZdZdd�ZdS)zProfile.fake_framecCs||_||_dSr)rJrF)r�codeZpriorr	r	r
rhszProfile.fake_frame.__init__N)rrrrr	r	r	r
rHgsrHcCsF|�dd|�}|jr |jd}nd}|�||�}|jd||d�dS)NZprofilerrDrW)rar!rHr3)rr]rbrVr4r	r	r
r/lszProfile.simulate_callcCsJ|j}|�|j}|jdr:|jd||jd|�d}q|�||_dS)NrrXrDr)r'r.r!r3)rr'r.r	r	r
�simulate_cmd_completexs
zProfile.simulate_cmd_completercCs$ddl}|�|����|���dSrZ)�pstatsZStatsZ
strip_dirsZ
sort_statsr)rrrdr	r	r
r�szProfile.print_statsc	Cs0t|d��}|��t�|j|�W5QRXdS)N�wb)�open�create_stats�marshal�dump�stats)r�file�fr	r	r
r�szProfile.dump_statscCs|��|��dSr)rc�snapshot_statsr_r	r	r
rg�szProfile.create_statsc	Cs^i|_|j��D]H\}\}}}}}|��}d}|��D]}||7}q6|||||f|j|<qdSrZ)rjr �items�copy�values)	r�funcrOrPrQrRrSZncZcallcntr	r	r
rm�s
zProfile.snapshot_statscCsddl}|j}|�|||�SrZ)�__main__�__dict__r)rr"rr�dictr	r	r
r�szProfile.runc	Cs8|�|�t�|j�zt|||�W5t�d�X|Sr)rY�sys�
setprofiler)�exec)rr"rrr	r	r
r�s
zProfile.runctxc	Os�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��|�t|��t�	|j
�z|||�W�St�	d�XdS)	Nrz:descriptor 'runcall' of 'Profile' object needs an argumentrqrz0Passing 'func' as keyword argument is deprecated)�
stacklevelz7runcall expected at least 1 positional argument, got %dr0)r*r+�pop�warnings�warn�DeprecationWarningrYr^rurvr))�args�kwrrqrzr	r	r
�runcall�s(

�
�zProfile.runcallz($self, func, /, *args, **kw)cCs<|jtk	rtd��|j}d|_z|�||�W�S||_XdS)Nz&Subclasses must override .calibrate().r)�	__class__rr+r$�_calibrate_inner)r�m�verboseZ
saved_biasr	r	r
�	calibrate�s
zProfile.calibratecCs|j}dd�}|fdd�}||�|�}||�|�}||}|rLtd|�t�}	|�}|	�dt�t��|�}||}
|r�td|
�d}d}|	j��D]0\\}
}}\}}}}}|d	kr�||7}||7}q�|r�td
|�td|�||dkr�td
|��||d|}|�rtd|�|S)NcSst|�D]}d}qdSr;��range)�n�i�xr	r	r
�f1sz$Profile._calibrate_inner.<locals>.f1cSst|�D]}|d�qdS)N�dr�)r�r�r�r	r	r
rlsz#Profile._calibrate_inner.<locals>.fz elapsed time without profiling =zf(m)zelapsed time with profiling =g)rlr�z!'CPU seconds' profiler reported =ztotal # calls =r0z internal error: total calls = %dg@z+mean stopwatch overhead per profile event =)	r'�printrrrrr rn�
ValueError)rr�r�r'r�rlZt0�t1Zelapsed_noprofile�pZelapsed_profileZtotal_callsZ
reported_timerr\�funcnamerOrPrQrRrSZmeanr	r	r
r��sB

�



zProfile._calibrate_inner)NN)r)r)rrrrr$rr,r(r:r-rCrTrUr<r3rYrarHr/rcrrrgrmrrr�__text_signature__r�r�r	r	r	r
rgsB&
''�



+
c
Cs�ddl}ddlm}d}||d�}d|_|jdddd	dd
�|jddd
ddd�|jdddddd
�tjdd�s�|��t�d�|�	�\}}|tjdd�<|j
dk	r�|j�|j
�|_
t
|�dk�r�|jr�ddl}d}|j|dd�}nR|d}	tj�d|j�|	��t�|	��}
t|
��|	d�}W5QRX|	dddd�}zt||d|j
|j�Wn6tk
�r�}zdt_t�|j�W5d}~XYnXn|��|S)Nr)�OptionParserzMprofile.py [-o output_file_path] [-s sort] [-m module | scriptfile] [arg] ...)�usageFz-oz	--outfile�outfilezSave stats to <outfile>)�dest�help�defaultz-m�module�
store_truezProfile a library module.)r��actionr�r�z-sz--sortrz?Sort order when printing to stdout, based on pstats.Stats classrr0rz(run_module(modname, run_name='__main__'))�
run_module�modnamerwrr)�__file__r�__package__�
__cached__)�osZoptparser�Zallow_interspersed_argsZ
add_optionru�argvZprint_usage�exit�
parse_argsr��path�abspathr*r��runpyr��insert�dirname�io�	open_code�compile�readrr�BrokenPipeError�stdout�errno)r�r�r��parserZoptionsr}r�rbZglobsZprogname�fp�excr	r	r
�main9s^

�
�
�

�� r�rr)Nr)Nr)rr�rur%rh�__all__rrrrr�rr	r	r	r
�<module>	s

'

	U9__pycache__/_compression.cpython-38.opt-2.pyc000064400000007536151153537560015072 0ustar00U

e5d��@s6ddlZejZGdd�dej�ZGdd�dej�ZdS)�Nc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�
BaseStreamcCs|jrtd��dS)NzI/O operation on closed file)�closed�
ValueError��self�r�$/usr/lib64/python3.8/_compression.py�_check_not_closedszBaseStream._check_not_closedcCs|��st�d��dS)NzFile not open for reading)�readable�io�UnsupportedOperationrrrr�_check_can_readszBaseStream._check_can_readcCs|��st�d��dS)NzFile not open for writing)�writablerrrrrr�_check_can_writeszBaseStream._check_can_writecCs(|��st�d��|��s$t�d��dS)Nz3Seeking is only supported on files open for readingz3The underlying file object does not support seeking)r
rr�seekablerrrr�_check_can_seeks
zBaseStream._check_can_seekN)�__name__�
__module__�__qualname__r	r
rrrrrrr	srcsfeZdZdd�Zddd�Z�fdd�Zdd	�Zd
d�Zdd
d�Zdd�Z	e
jfdd�Zdd�Z
�ZS)�DecompressReadercCsdS)NTrrrrrr
$szDecompressReader.readablercKs>||_d|_d|_d|_||_||_|jf|j�|_||_dS)NFr���)�_fp�_eof�_pos�_size�_decomp_factory�_decomp_args�
_decompressor�_trailing_error)r�fpZdecomp_factoryZtrailing_errorZdecomp_argsrrr�__init__'szDecompressReader.__init__csd|_t���S�N)r�super�closer��	__class__rrr#;szDecompressReader.closecCs
|j��Sr!)rrrrrrr?szDecompressReader.seekablec
CsPt|��:}|�d��$}|�t|��}||dt|��<W5QRXW5QRXt|�S)N�B)�
memoryview�cast�read�len)r�bZviewZ	byte_view�datarrr�readintoBs$zDecompressReader.readintorcCs�|dkr|��S|r|jrdSd}|jjr�|jjp<|j�t�}|sDq�|jf|j	�|_z|j�
||�}Wq�|jk
r�Yq�Yq�Xn4|jjr�|j�t�}|s�t
d��nd}|j�
||�}|r"q�q"|s�d|_|j|_dS|jt|�7_|S)Nr�zACompressed file ended before the end-of-stream marker was reachedT)�readallrr�eofZunused_datarr)�BUFFER_SIZErr�
decompressrZneeds_input�EOFErrorrrr*)r�sizer,Zrawblockrrrr)Hs@

��
zDecompressReader.readcCs,|j�d�d|_d|_|jf|j�|_dS)NrF)r�seekrrrrrrrrr�_rewindrszDecompressReader._rewindcCs�|tjkrnR|tjkr"|j|}n<|tjkrP|jdkrD|�tj�rDq6|j|}ntd�	|���||jkrr|�
�n
||j8}|dkr�|�ttj|��}|s�q�|t|�8}q||jS)NrzInvalid value for whence: {})
r�SEEK_SET�SEEK_CURr�SEEK_ENDrr)�DEFAULT_BUFFER_SIZEr�formatr6�minr*)r�offset�whencer,rrrr5xs&






zDecompressReader.seekcCs|jSr!)rrrrr�tell�szDecompressReader.tell)r)r)rrrr
r r#rr-r)r6rr7r5r?�
__classcell__rrr$rr!s

*r)rr:r1�BufferedIOBaser�	RawIOBaserrrrr�<module>s__pycache__/queue.cpython-38.pyc000064400000024604151153537560012551 0ustar00U

e5d\,�@sdZddlZddlmZddlmZmZddlmZzddl	m
Z
Wnek
r\dZ
YnXddd	d
ddgZzdd
l	m
Z
Wn$ek
r�Gdd�de�Z
YnXGdd�de�ZGdd	�d	�ZGdd
�d
e�ZGdd�de�ZGdd�d�Ze
dkr�eZ
dS)z'A multi-producer, multi-consumer queue.�N)�deque)�heappush�heappop)�	monotonic)�SimpleQueue�Empty�Full�Queue�
PriorityQueue�	LifoQueuer)rc@seZdZdZdS)rz4Exception raised by Queue.get(block=0)/get_nowait().N��__name__�
__module__�__qualname__�__doc__�rr�/usr/lib64/python3.8/queue.pyrsc@seZdZdZdS)rz4Exception raised by Queue.put(block=0)/put_nowait().Nrrrrrrsc@s�eZdZdZd!dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	d"dd�Z
d#dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd �ZdS)$r	zjCreate a queue object with a given maximum size.

    If maxsize is <= 0, the queue size is infinite.
    rcCsN||_|�|�t��|_t�|j�|_t�|j�|_t�|j�|_d|_	dS�Nr)
�maxsize�_init�	threadingZLock�mutexZ	Condition�	not_empty�not_full�all_tasks_done�unfinished_tasks��selfrrrr�__init__!s

zQueue.__init__c	CsH|j�8|jd}|dkr4|dkr*td��|j��||_W5QRXdS)a.Indicate that a formerly enqueued task is complete.

        Used by Queue consumer threads.  For each get() used to fetch a task,
        a subsequent call to task_done() tells the queue that the processing
        on the task is complete.

        If a join() is currently blocking, it will resume when all items
        have been processed (meaning that a task_done() call was received
        for every item that had been put() into the queue).

        Raises a ValueError if called more times than there were items
        placed in the queue.
        �rz!task_done() called too many timesN)rr�
ValueErrorZ
notify_all)rZ
unfinishedrrr�	task_done8s

zQueue.task_donec	Cs(|j�|jr|j��qW5QRXdS)a�Blocks until all items in the Queue have been gotten and processed.

        The count of unfinished tasks goes up whenever an item is added to the
        queue. The count goes down whenever a consumer thread calls task_done()
        to indicate the item was retrieved and all work on it is complete.

        When the count of unfinished tasks drops to zero, join() unblocks.
        N)rr�wait�rrrr�joinNs	z
Queue.joinc
Cs&|j�|��W5QR�SQRXdS)�9Return the approximate size of the queue (not reliable!).N�r�_qsizer#rrr�qsize[szQueue.qsizec
Cs(|j�|��W5QR�SQRXdS)a�Return True if the queue is empty, False otherwise (not reliable!).

        This method is likely to be removed at some point.  Use qsize() == 0
        as a direct substitute, but be aware that either approach risks a race
        condition where a queue can grow before the result of empty() or
        qsize() can be used.

        To create code that needs to wait for all queued tasks to be
        completed, the preferred technique is to use the join() method.
        Nr&r#rrr�empty`szQueue.emptyc
Cs<|j�,d|jko |��knW5QR�SQRXdS)aOReturn True if the queue is full, False otherwise (not reliable!).

        This method is likely to be removed at some point.  Use qsize() >= n
        as a direct substitute, but be aware that either approach risks a race
        condition where a queue can shrink before the result of full() or
        qsize() can be used.
        rN)rrr'r#rrr�fullnsz
Queue.fullTNc	Cs�|j��|jdkr�|s*|��|jkr�t�nr|dkrN|��|jkr�|j��q2nN|dkr`td��n<t�|}|��|jkr�|t�}|dkr�t�|j�|�qj|�|�|jd7_|j	�
�W5QRXdS)aPut an item into the queue.

        If optional args 'block' is true and 'timeout' is None (the default),
        block if necessary until a free slot is available. If 'timeout' is
        a non-negative number, it blocks at most 'timeout' seconds and raises
        the Full exception if no free slot was available within that time.
        Otherwise ('block' is false), put an item on the queue if a free slot
        is immediately available, else raise the Full exception ('timeout'
        is ignored in that case).
        rN�''timeout' must be a non-negative number�r)rrr'rr"r �time�_putrr�notify)r�item�block�timeout�endtime�	remainingrrr�putys&




z	Queue.putc
Cs�|j��|s|��s�t�nf|dkr8|��s�|j��q"nH|dkrJtd��n6t�|}|��s�|t�}|dkrrt�|j�|�qT|��}|j��|W5QR�SQRXdS)�Remove and return an item from the queue.

        If optional args 'block' is true and 'timeout' is None (the default),
        block if necessary until an item is available. If 'timeout' is
        a non-negative number, it blocks at most 'timeout' seconds and raises
        the Empty exception if no item was available within that time.
        Otherwise ('block' is false), return an item if one is immediately
        available, else raise the Empty exception ('timeout' is ignored
        in that case).
        Nrr+r,)	rr'rr"r r-�_getrr/)rr1r2r3r4r0rrr�get�s$



z	Queue.getcCs|j|dd�S)z�Put an item into the queue without blocking.

        Only enqueue the item if a free slot is immediately available.
        Otherwise raise the Full exception.
        F�r1�r5�rr0rrr�
put_nowait�szQueue.put_nowaitcCs|jdd�S�z�Remove and return an item from the queue without blocking.

        Only get an item if one is immediately available. Otherwise
        raise the Empty exception.
        Fr9�r8r#rrr�
get_nowait�szQueue.get_nowaitcCst�|_dS�N)r�queuerrrrr�szQueue._initcCs
t|j�Sr@��lenrAr#rrrr'�szQueue._qsizecCs|j�|�dSr@�rA�appendr;rrrr.�sz
Queue._putcCs
|j��Sr@)rA�popleftr#rrrr7�sz
Queue._get)r)TN)TN)r
rrrrr!r$r(r)r*r5r8r<r?rr'r.r7rrrrr	s


 

c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r
z�Variant of Queue that retrieves open entries in priority order (lowest first).

    Entries are typically tuples of the form:  (priority number, data).
    cCs
g|_dSr@�rArrrrr�szPriorityQueue._initcCs
t|j�Sr@rBr#rrrr'�szPriorityQueue._qsizecCst|j|�dSr@)rrAr;rrrr.�szPriorityQueue._putcCs
t|j�Sr@)rrAr#rrrr7�szPriorityQueue._getN�r
rrrrr'r.r7rrrrr
�s
c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)rzBVariant of Queue that retrieves most recently added entries first.cCs
g|_dSr@rGrrrrr�szLifoQueue._initcCs
t|j�Sr@rBr#rrrr'�szLifoQueue._qsizecCs|j�|�dSr@rDr;rrrr.�szLifoQueue._putcCs
|j��Sr@)rA�popr#rrrr7�szLifoQueue._getNrHrrrrr�s
c@sLeZdZdZdd�Zddd�Zddd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dS)�_PySimpleQueuezYSimple, unbounded FIFO queue.

    This pure Python implementation is not reentrant.
    cCst�|_t�d�|_dSr)r�_queuerZ	Semaphore�_countr#rrrr	sz_PySimpleQueue.__init__TNcCs|j�|�|j��dS)z�Put the item on the queue.

        The optional 'block' and 'timeout' arguments are ignored, as this method
        never blocks.  They are provided for compatibility with the Queue class.
        N)rKrErL�release)rr0r1r2rrrr5
sz_PySimpleQueue.putcCs4|dk	r|dkrtd��|j�||�s*t�|j��S)r6Nrr+)r rL�acquirerrKrF)rr1r2rrrr8s
z_PySimpleQueue.getcCs|j|dd�S)z�Put an item into the queue without blocking.

        This is exactly equivalent to `put(item)` and is only provided
        for compatibility with the Queue class.
        Fr9r:r;rrrr<'sz_PySimpleQueue.put_nowaitcCs|jdd�Sr=r>r#rrrr?/sz_PySimpleQueue.get_nowaitcCst|j�dkS)zCReturn True if the queue is empty, False otherwise (not reliable!).r�rCrKr#rrrr)7sz_PySimpleQueue.emptycCs
t|j�S)r%rOr#rrrr(;sz_PySimpleQueue.qsize)TN)TN)r
rrrrr5r8r<r?r)r(rrrrrJ�s	
	
rJ)rr�collectionsr�heapqrrr-rrKr�ImportError�__all__r�	Exceptionrr	r
rrJrrrr�<module>s*
BA__pycache__/mailbox.cpython-38.opt-1.pyc000064400000165432151153537560014024 0ustar00U

e5dE3�@sRdZddlZddlZddlZddlZddlZddlZddlZddlZddl	Zddl
ZddlZddlZzddl
Z
Wnek
r�dZ
YnXddddddd	d
ddd
ddddddgZej�d�ZGdd�d�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd	�d	ejj�ZGd d
�d
e�ZGd!d"�d"e�ZGd#d�de�ZGd$d�de�ZGd%d
�d
e�Z Gd&d�de�Z!Gd'd(�d(�Z"Gd)d*�d*e"�Z#d=d,d-�Z$d.d/�Z%d0d1�Z&d2d3�Z'd4d5�Z(d6d7�Z)Gd8d�de*�Z+Gd9d�de+�Z,Gd:d�de+�Z-Gd;d�de+�Z.Gd<d�de+�Z/dS)>zDRead/write support for Maildir, mbox, MH, Babyl, and MMDF mailboxes.�N�Mailbox�Maildir�mbox�MH�Babyl�MMDF�Message�MaildirMessage�mboxMessage�	MHMessage�BabylMessage�MMDFMessage�Error�NoSuchMailboxError�
NotEmptyError�ExternalClashError�FormatError�asciic@seZdZdZdCdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dDdd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�ZdEd0d1�Zd2d3�ZdFd4d5�Zd6d7�Zd8d9�Zd:d;�Zd<d=�Z d>d?�Z!d@Z"dGdAdB�Z#dS)Hrz*A group of messages in a particular place.NTcCs tj�tj�|��|_||_dS)zInitialize a Mailbox instance.N)�os�path�abspath�
expanduser�_path�_factory��selfr�factory�create�r�/usr/lib64/python3.8/mailbox.py�__init__$szMailbox.__init__cCstd��dS)�$Add message and return assigned key.�&Method must be implemented by subclassN��NotImplementedError�r�messagerrr�add)szMailbox.addcCstd��dS)�=Remove the keyed message; raise KeyError if it doesn't exist.r"Nr#�r�keyrrr�remove-szMailbox.removecCs|�|�dS�N)r+r)rrr�__delitem__1szMailbox.__delitem__cCs(z|�|�Wntk
r"YnXdS�z'If the keyed message exists, remove it.N)r+�KeyErrorr)rrr�discard4szMailbox.discardcCstd��dS)�>Replace the keyed message; raise KeyError if it doesn't exist.r"Nr#�rr*r&rrr�__setitem__;szMailbox.__setitem__cCs*z|�|�WStk
r$|YSXdS)z9Return the keyed message, or default if it doesn't exist.N)�__getitem__r/)rr*�defaultrrr�get?szMailbox.getc
CsB|js|�|�St�|�|���}|�|�W5QR�SQRXdS)z=Return the keyed message; raise KeyError if it doesn't exist.N)r�get_message�
contextlib�closing�get_file)rr*�filerrrr4Fs
zMailbox.__getitem__cCstd��dS)�4Return a Message representation or raise a KeyError.r"Nr#r)rrrr7NszMailbox.get_messagecCst�|�|����S)z�Return a string representation or raise a KeyError.

        Uses email.message.Message to create a 7bit clean string
        representation of the message.��email�message_from_bytes�	get_bytesZ	as_stringr)rrr�
get_stringRszMailbox.get_stringcCstd��dS)z8Return a byte string representation or raise a KeyError.r"Nr#r)rrrr@YszMailbox.get_bytescCstd��dS)�6Return a file-like representation or raise a KeyError.r"Nr#r)rrrr:]szMailbox.get_filecCstd��dS)�Return an iterator over keys.r"Nr#�rrrr�iterkeysaszMailbox.iterkeyscCst|���S)zReturn a list of keys.)�listrErDrrr�keyseszMailbox.keysc	cs>|��D]0}z||}Wntk
r0YqYnX|VqdS)z%Return an iterator over all messages.N�rEr/�rr*�valuerrr�
itervaluesis
zMailbox.itervaluescCs|��Sr,)rKrDrrr�__iter__rszMailbox.__iter__cCst|���S)z,Return a list of messages. Memory intensive.)rFrKrDrrr�valuesuszMailbox.valuesc	csB|��D]4}z||}Wntk
r0YqYnX||fVqdS)z.Return an iterator over (key, message) tuples.NrHrIrrr�	iteritemsys
zMailbox.iteritemscCst|���S)z9Return a list of (key, message) tuples. Memory intensive.)rFrNrDrrr�items�sz
Mailbox.itemscCstd��dS)�9Return True if the keyed message exists, False otherwise.r"Nr#r)rrr�__contains__�szMailbox.__contains__cCstd��dS)�*Return a count of messages in the mailbox.r"Nr#rDrrr�__len__�szMailbox.__len__cCs|��D]}|�|�qdS)zDelete all messages.N)rGr0r)rrr�clear�sz
Mailbox.clearcCs4z||}Wntk
r$|YSX|�|�|S)z3Delete the keyed message and return it, or default.)r/r0)rr*r5�resultrrr�pop�s

zMailbox.popcCs*|��D]}||�|�fStd��dS)z6Delete an arbitrary (key, message) pair and return it.zNo messages in mailboxN)rErVr/r)rrr�popitem�szMailbox.popitemc	Cstt|d�r|��}nt|d�r(|��}n|}d}|D].\}}z|||<Wq4tk
r`d}Yq4Xq4|rptd��dS)z4Change the messages that correspond to certain keys.rNrOFTzNo message with key(s)N)�hasattrrNrOr/)r�arg�sourceZbad_keyr*r&rrr�update�s



zMailbox.updatecCstd��dS)�&Write any pending changes to the disk.r"Nr#rDrrr�flush�sz
Mailbox.flushcCstd��dS)�Lock the mailbox.r"Nr#rDrrr�lock�szMailbox.lockcCstd��dS)�#Unlock the mailbox if it is locked.r"Nr#rDrrr�unlock�szMailbox.unlockcCstd��dS)�Flush and close the mailbox.r"Nr#rDrrr�close�sz
Mailbox.closecCs.z|�d�WStk
r(td��YnXdS)Nrz?String input must be ASCII-only; use bytes or a Message instead)�encode�UnicodeError�
ValueErrorr%rrr�_string_to_bytes�szMailbox._string_to_bytesFc	Cs�t|tjj�rvt��}tj�||d�}|�|�|�	d�|�
�}|�dt�}|�
|�|jrr|�t�sr|�
t��n�t|tttjf��rt|tj�r�t�dtd�|��}t|t�r�|�|�}|r�|�dd�}|�dt�}|�
|�|j�r�|�t��s�|�
t�n�t|d��r�t|d��r2t�d	td�|j}d
}|��}|�d��r\|d
d�d}n|�d
��rx|d
d�d}|�s��q�|�r�|�d��r�d|dd
�}|�dt�}|�
|�|}�q6|j�r�|�r�|�t��s�|�
t�ntdt|���d
S)z%Dump message contents to target file.r�
�8Use of StringIO input is deprecated, use BytesIO instead�s
From s
>From �read�buffer�DUse of text mode files is deprecated, use a binary mode file insteadN�
����
����From s>From ��Invalid message type: %s)�
isinstancer>r&r�io�BytesIO�	generator�BytesGenerator�flatten�seekrk�replace�linesep�write�_append_newline�endswith�str�bytes�StringIO�warnings�warn�DeprecationWarning�getvaluergrXrl�readline�
startswith�	TypeError�type)	rr&�targetZmangle_from_rl�gen�dataZlastline�linerrr�
_dump_message�s`


�


�
zMailbox._dump_message)NT)N)N)N)F)$�__name__�
__module__�__qualname__�__doc__r r'r+r-r0r3r6r4r7rAr@r:rErGrKrLrMrNrOrQrSrTrVrWr[r]r_rarcrgrr�rrrrr!sB

		
	
c@s�eZdZdZdZd6dd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-Zd.d/�Zd0d1�Zd2d3�Zd4d5�ZdS)7rzA qmail-style Maildir mailbox.�:NTcCs�t�||||�tj�|jd�tj�|jd�tj�|jd�d�|_tj�|j�s�|r�t�|jd�|j�	�D]}t�|d�qln
t
|j��i|_ddd�|_d|_
d|_d	S)
zInitialize a Maildir instance.�tmp�new�cur)r�r�r��r)r�r�g�������?N)rr rr�joinr�_paths�exists�mkdirrMr�_toc�_toc_mtimes�
_last_read�_skewfactor)r�dirnamerrrrrrr 
s�
zMaildir.__init__c
Cs~|��}z|�||�Wn*tk
rB|��t�|j��YnXt|�t|t	�r||�
�}|j|��}||jkr�d}nd}d}tj
�|j��|j�d}tj
�|j|||�}t|t	�r�t�|jtj
�|j�|��f�zLzt�|j|�Wn(ttfk
�rt�|j|�YnXt�|j�WnNtk
�rx}z.t�|j�|jtjk�rftd|��n�W5d}~XYnX|S)r!�r�rz$Name clash with existing message: %sN)�_create_tmpr��
BaseExceptionrcrr+�name�_sync_closerur	�
get_subdir�colon�get_infor�basename�splitr�r�utime�getatime�get_date�link�AttributeError�PermissionError�rename�OSError�errnoZEEXISTr)rr&Ztmp_file�subdir�suffix�uniq�dest�errrr'!sF


��zMaildir.addcCs t�tj�|j|�|���dS�r(N)rr+rr�r�_lookupr)rrrr+KszMaildir.removec	Cs,z|�|�Wnttfk
r&YnXdSr.)r+r/�FileNotFoundErrorr)rrrr0OszMaildir.discardcCs�|�|�}|�|�}|�|�}t|t�r.|}n|}tj�|�}|j|kr`|j|�|j�d}nd}|�	|�tj�
|j|�}	tj�
|j|||�}
t|t�r�t�|	tj�
|	�|��f�t�|	|
�dS)r1rqr�N)r�r'rur	rrr�r�r�r0r�rr�r�r�r�)rr*r&Zold_subpathZtemp_keyZtemp_subpathZdominant_subpathr�r�Ztmp_path�new_pathrrrr3Ws$






�zMaildir.__setitem__c	Cs�|�|�}ttj�|j|�d�� }|jr4|�|�}nt|�}W5QRXtj�|�\}}|�	|�|j
|kr�|�|�|j
�d�|�tj�
tj�|j|���|S)r<�rbrq)r��openrrr�rrr	r��
set_subdirr��set_info�set_date�getmtime)rr*Zsubpath�f�msgr�r�rrrr7rs


zMaildir.get_messagec
CsDttj�|j|�|��d��}|���td�W5QR�SQRXdS)�2Return a bytes representation or raise a KeyError.r�rhN)	r�rrr�rr�rkr|r}�rr*r�rrrr@�szMaildir.get_bytescCs$ttj�|j|�|��d�}t|�S)rBr�)r�rrr�rr��
_ProxyFiler�rrrr:�szMaildir.get_filec	csF|��|jD]2}z|�|�Wntk
r8YqYnX|VqdS�rCN)�_refreshr�r�r/r)rrrrE�s

zMaildir.iterkeyscCs|��||jkS�rP)r�r�r)rrrrQ�szMaildir.__contains__cCs|��t|j�S�rR)r��lenr�rDrrrrS�szMaildir.__len__cCsdS)�"Write any pending changes to disk.NrrDrrrr]�sz
Maildir.flushcCsdS)r^NrrDrrrr_�szMaildir.lockcCsdS)r`NrrDrrrra�szMaildir.unlockcCsdS�rbNrrDrrrrc�sz
Maildir.closecCs\g}t�|j�D]F}t|�dkr|ddkrtj�tj�|j|��r|�|dd��q|S)�Return a list of folder names.�r�.N)r�listdirrr�r�isdirr��append�rrU�entryrrr�list_folders�s�zMaildir.list_folderscCs ttj�|jd|�|jdd�S)z/Return a Maildir instance for the named folder.r�F�rr)rrrr�rr�r�folderrrr�
get_folder�s�zMaildir.get_foldercCs\tj�|jd|�}t||jd�}tj�|d�}tj�|�sXt�t�|tj	tj
Bd��|S)z>Create a folder and return a Maildir instance representing it.r��rZ
maildirfolder�)rrr�rrrr�rcr��O_CREAT�O_WRONLY)rr�rrUZmaildirfolder_pathrrr�
add_folder�s�zMaildir.add_foldercCstj�|jd|�}t�tj�|d��t�tj�|d��D](}t|�dksX|ddkr<td|��q<t�|�D]B}|dkrp|dkrp|dkrptj�tj�||��rptd||f��qptj|d	d
�D]F\}}}|D]}t�	tj�||��q�|D]}t�
tj�||��q�q�t�
|�dS)�-Delete the named folder, which must be empty.r�r�r�r�rzFolder contains message(s): %sr�z%Folder contains subdirectory '%s': %sF)�topdownN)rrr�rr�r�rr��walkr+�rmdir)rr�rr��root�dirs�filesrrr�
remove_folder�s&���zMaildir.remove_foldercCsXt��}t�tj�|jd��D]4}tj�|jd|�}|tj�|�dkrt�|�qdS)zDelete old files in "tmp".r�i@�N)�timerr�rr�rr�r+)r�nowr�rrrr�clean�s
z
Maildir.cleanr�cCs�t��}t��}d|kr$|�dd�}d|kr8|�dd�}dt|�t|dd�t��tj|f}tj	�
|jd|�}zt�|�WnFt
k
r�tjd7_zt|�WYStk
r�YnXYnXtd	|��d
S)z=Create a file in the tmp subdirectory and open and return it.�/z\057r�z\072z%s.M%sP%sQ%s.%sr�g��.Ar�z&Name clash prevented file creation: %sN)r��socket�gethostnamer|�intr�getpidr�_countrr�r�statr��_create_carefully�FileExistsErrorr)rr�Zhostnamer�rrrrr��s,��zMaildir._create_tmpcCs�t��|jd|jkr^d}|jD]2}tj�|j|�}||j|krJd}||j|<q"|s^dSi|_|jD]^}|j|}t�	|�D]D}tj�
||�}tj�|�r�q�|�|j
�d}tj�
||�|j|<q�qjt��|_dS)z!Update table of contents mapping.�FTNr)r�r�r�r�rrr�r�r�r�r�r�r�r�)rZrefreshr��mtimerr��pr�rrrr��s&


zMaildir._refreshcCs�z.tj�tj�|j|j|��r,|j|WSWntk
rBYnX|��z|j|WStk
rztd|�d�YnXdS)z=Use TOC to return subpath for given key, or raise a KeyError.�No message with key: %sN)rrr�r�rr�r/r�r)rrrr�#szMaildir._lookupcCsXt|d�s|��|_z|t|j�WStk
r:YdStk
rPYqYqXqdS)z0Return the next message in a one-time iteration.�
_onetime_keysN)rXrEr��next�
StopIterationr/rDrrrr�1s

zMaildir.next)NT)r�r�r�r�r�r r'r+r0r3r7r@r:rErQrSr]r_rarcr�r�r�r�r�r�r�r�r�r�rrrrrs6
*
	
$c@s�eZdZdZd$dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd%d d!�Zd"d#�ZdS)&�_singlefileMailboxzA single-file mailbox.NTc
Cs�t�||||�zt|jd�}Wnntk
r�}zP|jtjkr\|rPt|jd�}q~t|j��n"|jtjtj	fkr|t|jd�}n�W5d}~XYnX||_
d|_d|_d|_
d|_d|_d|_dS)z!Initialize a single-file mailbox.�rb+zwb+r�NrF)rr r�rr�r��ENOENTr�EACCES�EROFS�_filer��	_next_key�_pending�
_pending_sync�_locked�_file_length)rrrrr�r�rrrr As$z_singlefileMailbox.__init__cCs8|��|�|�|j|j<|jd7_d|_|jdS)r!r�T)r��_append_messager�rrr%rrrr'Xs
z_singlefileMailbox.addcCs|�|�|j|=d|_dS)r(TN)r�r�rr)rrrr+bs
z_singlefileMailbox.removecCs$|�|�|�|�|j|<d|_dS)r1TN)r�r	r�rr2rrrr3hs
z_singlefileMailbox.__setitem__ccs|��|j��EdHdSr�)r�r�rGrDrrrrEnsz_singlefileMailbox.iterkeyscCs|��||jkSr�)r�r�r)rrrrQssz_singlefileMailbox.__contains__cCs|��t|j�Sr�)r�r�r�rDrrrrSxsz_singlefileMailbox.__len__cCs|jst|j�d|_dS)r^TN)r�
_lock_filerrDrrrr_}s
z_singlefileMailbox.lockcCs|jrt|j�d|_dS�r`FN)r�_unlock_filerrDrrrra�s
z_singlefileMailbox.unlockc
Cs�|js |jrt|j�d|_dS|j�dd�|j��}||jkrTtd|j|f��t|j	�}z�i}|�
|�t|j�
��D]x}|j|\}}|j�|�|�|�|��}|j�td||j����}|s�q�|�|�q�||��f||<|�|�q||��|_Wn"|��t�|j��YnXt|�|j��t�|j	�j}	t�|j|	�zt�|j|j	�Wn2tk
�r�t�|j	�t�|j|j	�YnXt|j	d�|_||_d|_d|_|j�r�t|jdd�dS)	r�FNrr�z4Size of mailbox file changed (expected %i, found %i)�r�)�dotlock) rr�_sync_flushrr{�tellrr�_create_temporaryr�_pre_mailbox_hook�sortedr�rG�_pre_message_hookrk�minr~�_post_message_hookrcrr+r�r�r��st_mode�chmodr�r�r�rr
)
rZcur_lenZnew_fileZnew_tocr*�start�stopZ	new_startrl�moderrrr]�s`
	

�



�
z_singlefileMailbox.flushcCsdS)�,Called before writing the mailbox to file f.Nr�rr�rrrr�sz$_singlefileMailbox._pre_mailbox_hookcCsdS)�-Called before writing each message to file f.Nrrrrrr�sz$_singlefileMailbox._pre_message_hookcCsdS��,Called after writing each message to file f.Nrrrrrr�sz%_singlefileMailbox._post_message_hookcCs4z|��W5z|jr|��W5|j��XXdSr�)rrcrrar]rDrrrrc�sz_singlefileMailbox.closecCsN|jdkr|��|dk	rJz|j|WStk
rHtd|�d�YnXdS)z'Return (start, stop) or raise KeyError.Nr�)r��
_generate_tocr/r)rrrr��s
z_singlefileMailbox._lookupcCs�|j�dd�|j��}t|j�dkr8|js8|�|j�z&|�|j�|�|�}|�	|j�Wn"t
k
r�|j�|��YnX|j��|j��|_
|S)z;Append message to mailbox and return (start, stop) offsets.rr�)rr{rr�r�rrr�_install_messagerr��truncater]r)rr&ZbeforeZoffsetsrrrr	�s


z"_singlefileMailbox._append_message)NT)N)r�r�r�r�r r'r+r3rErQrSr_rar]rrrrcr�r	rrrrr�>s"

@

r�c@sBeZdZdZdZdd�Zddd�Zddd	�Zdd
d�Zdd
�Z	dS)�	_mboxMMDFzAn mbox or MMDF mailbox.TcCsp|�|�\}}|j�|�|j���td�}|j�||j���}|�|�td��}|�	|dd��
d��|S)r<�rhrsNr)r�rr{r�r|r}rkr�_message_factory�set_from�decode)rr*rr�	from_line�stringr�rrrr7sz_mboxMMDF.get_messageFcCst�|�||��j|d�S)�3Return a string representation or raise a KeyError.)�unixfromr=)rr*�from_rrrrAs

��z_mboxMMDF.get_stringcCsJ|�|�\}}|j�|�|s(|j��|j�||j���}|�td�S)r+rh)r�rr{r�rkrr|r})rr*r-rrr*rrrr@s
z_mboxMMDF.get_bytescCs<|�|�\}}|j�|�|s(|j��t|j|j��|�S)rB)r�rr{r��_PartialFiler)rr*r-rrrrrr:s

z_mboxMMDF.get_filecCsd}t|t�r|�|�}t|t�rf|�d�rf|�d�}|dkr\|d|�}||dd�}q�|}d}nJt|t�r�|���d�}d|}n(t|t	j
j�r�|��}|dk	r�|�d�}|dkr�dt
�t
�����}|j��}|j�|t�|�||j|j�|j��}||fS)	z1Format a message and blindly write to self._file.Nrrrhrqr�r%rsFrom MAILER-DAEMON )rur�rgr�r��find�_mboxMMDFMessage�get_fromrdr>r&r�get_unixfromr��asctime�gmtimerrr~r}r��
_mangle_from_)rr&r)�newlineZauthorrrrrrr"&s0







z_mboxMMDF._install_messageN)F)F)F)
r�r�r�r�r5r7rAr@r:r"rrrrr$s


	
r$c@s2eZdZdZdZdZd
dd�Zdd�Zdd	�ZdS)rzA classic mbox mailbox.TNcCst|_t�||||�dS)zInitialize an mbox mailbox.N)r
r&r$r rrrrr Lsz
mbox.__init__cCs|�t�dSr�r~r}rrrrrQszmbox._post_message_hookcCs�gg}}d}|j�d�|j��}|j��}|�d�rzt|�t|�krj|r`|�|tt��n
|�|�|�|�d}q|s�|r�|�|tt��q�|�|�q�q|tkr�d}qd}qtt	t
||���|_t|j�|_|j��|_
dS)�0Generate key-to-(start, stop) table of contents.FrrrTN)rr{rr�r�r�r�r}�dict�	enumerate�zipr�rr)r�starts�stopsZlast_was_empty�line_posr�rrrr!Us.






zmbox._generate_toc)NT)	r�r�r�r�r5rr rr!rrrrrCs
c@s2eZdZdZddd�Zdd�Zdd	�Zd
d�ZdS)
rzAn MMDF mailbox.NTcCst|_t�||||�dS)zInitialize an MMDF mailbox.N)r
r&r$r rrrrr zsz
MMDF.__init__cCs|�dt�dS)r�Nr7rrrrrszMMDF._pre_message_hookcCs|�tdt�dS)r r?Nr7rrrrr�szMMDF._post_message_hookcCs�gg}}|j�d�d}|}|j��}|j��}|�dt�r�|�|�|}|j��}|j��}|dtkr�|�|tt��q�qJ|sJ|�|�q�qJq|sq�qtt	t
||���|_t|j�|_|j�dd�|j��|_
dS)r8rr?r�N)rr{r�rr�r}r�r�r9r:r;r�rr)rr<r=�next_posr>r�rrrr!�s.






zMMDF._generate_toc)NT)r�r�r�r�r rrr!rrrrrws

c@s�eZdZdZd0dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�ZdS)1rzAn MH mailbox.NTcCstt�||||�tj�|j�sj|r`t�|jd�t�t�tj�	|jd�tj
tjBtjBd��n
t
|j��d|_dS)zInitialize an MH instance.r��
.mh_sequencesi�FN)rr rrr�rr�rcr�r�r��O_EXCLr�rrrrrrr �s�
zMH.__init__cCs�|��}t|�dkrd}nt|�d}tj�|jt|��}t|�}d}z�|j
rVt|�zfz|�
||�Wn:tk
r�|j
r�t|�t	|�d}t�|��YnXt|t�r�|�||�W5|j
r�t|�XW5|s�t	|�X|S)r!rr�FT)rGr��maxrrr�rr�r�r�rr
rr�r�r+rur�_dump_sequences)rr&rGZnew_keyr�r��closedrrrr'�s6


zMH.addc
Csxtj�|jt|��}zt|d�}Wn>tk
r`}z |jtjkrNt	d|��n�W5d}~XYnX|�
�t�|�dS)r(r�r�N)rrr�rr�r�r�r�rr/rcr+)rr*rr�r�rrrr+�sz	MH.removec
Cs�tj�|jt|��}zt|d�}Wn>tk
r`}z |jtjkrNt	d|��n�W5d}~XYnXzd|jrrt|�z@t�t�|tjtjB��|�||�t|t�r�|�||�W5|jr�t
|�XW5t
|�XdS)r1r�r�N)rrr�rr�r�r�r�rr/r�rr
rrcr��O_TRUNCr�rurrD)rr*r&rr�r�rrrr3�s$
zMH.__setitem__c
Cs�z@|jr$ttj�|jt|��d�}nttj�|jt|��d�}Wn>tk
r~}z |jtj	krlt
d|��n�W5d}~XYnX|�2|jr�t|�zt
|�}W5|jr�t|�XW5QRX|����D]\}}||kr�|�|�q�|S)r<r�r�r�N)rr�rrr�rr�r�r�rr/r
rr�
get_sequencesrO�add_sequence)rr*r�r�r�r��key_listrrrr7�s&zMH.get_messagec
Cs�z@|jr$ttj�|jt|��d�}nttj�|jt|��d�}Wn>tk
r~}z |jtj	krlt
d|��n�W5d}~XYnX|�F|jr�t|�z |�
��td�W�W5QR�S|jr�t|�XW5QRXdS)r�r�r�r�Nrh)rr�rrr�rr�r�r�rr/r
rrkr|r}�rr*r�r�rrrr@s zMH.get_bytesc
Csfzttj�|jt|��d�}Wn>tk
r\}z |jtjkrJt	d|��n�W5d}~XYnXt
|�S)rBr�r�N)r�rrr�rr�r�r�rr/r�rJrrrr:)szMH.get_filecCsttdd�t�|j�D���S)rCcss|]}|��rt|�VqdSr,)�isdigitr�)�.0r�rrr�	<genexpr>6s�zMH.iterkeys.<locals>.<genexpr>)�iterrrr�rrDrrrrE4szMH.iterkeyscCstj�tj�|jt|���Sr�)rrr�r�rr�r)rrrrQ9szMH.__contains__cCstt|����Sr�)r�rFrErDrrrrS=sz
MH.__len__cCs2|js.ttj�|jd�d�|_t|j�d|_dS)r^rAr�TN)rr�rrr�rrr
rDrrrr_As
zMH.lockcCs(|jr$t|j�t|j�|`d|_dSr)rrrr�rDrrrraHs


z	MH.unlockcCsdS)r\NrrDrrrr]PszMH.flushcCs|jr|��dSr�)rrarDrrrrcTszMH.closecCs<g}t�|j�D]&}tj�tj�|j|��r|�|�q|S)r�)rr�rrr�r�r�r�rrrr�Ys
zMH.list_folderscCsttj�|j|�|jdd�S)z+Return an MH instance for the named folder.Fr��rrrr�rrr�rrrr�as�z
MH.get_foldercCsttj�|j|�|jd�S)z:Create a folder and return an MH instance representing it.r�rOr�rrrr�fs�z
MH.add_foldercCs`tj�|j|�}t�|�}|dgkr:t�tj�|d��n|gkrDntd|j��t�|�dS)r�rAzFolder not empty: %sN)rrr�rr�r+rr�)rr�r�entriesrrrr�ks

zMH.remove_folderc

si}ttj�|jd�ddd���}t|����|D]�}z�|�d�\}}t�}|��D]H}|��rn|�	t
|��qRdd�|�d�D�\}}	|�t||	d	��qR�fd
d�t
|�D�||<t||�dkr�||=Wq0tk
r�td
|����Yq0Xq0W5QRX|S)z=Return a name-to-key-list dictionary to define each sequence.rA�r�ASCII��encodingr�css|]}t|�VqdSr,)r�)rL�xrrrrM�sz#MH.get_sequences.<locals>.<genexpr>�-r�csg|]}|�kr|�qSrr)rLr*�Zall_keysrr�
<listcomp>�s�z$MH.get_sequences.<locals>.<listcomp>rz"Invalid sequence specification: %s)r�rrr�r�setrGr�rKr'r�r[�rangerr�rfr�rstrip)
rZresultsr�r�r��contentsrG�specrrrrWrrGws(
�zMH.get_sequencescCsttj�|jd�ddd�}z�t�t�|jtjtj	B��|�
�D]�\}}t|�dkrVq@|�|d�d}d}t
t|��D]R}|d	|kr�|s�d
}|�d�n*|r�d}|�d||f�n|�d
|�|}qx|r�|�t|�d�q@|�d�q@W5t|�XdS)z:Set sequences using the given name-to-key-list dictionary.rAzr+rRrSrr�NFr�TrVz%s %sz %s�
)r�rrr�rr�rcr�r�rFrOr�r~rrYr�)r�	sequencesr�r�rG�prevZ
completingr*rrr�
set_sequences�s.zMH.set_sequencesc	
Cs>|��}d}g}|��D]�}|d|kr�|�||df�z4t�tj�|jt|��tj�|jt|d���WnHt	t
fk
r�t�tj�|jt|��tj�|jt|d���YnXt�tj�|jt|���|d7}q|d|_
t|�dkr�dS|��D]0\}}|D]"\}}||k�r
|||�|�<�q
q�|�|�dS)z?Re-name messages to eliminate numbering gaps. Invalidates keys.rr�N)rGrEr�rr�rr�rr�r�r�r��unlinkrr�rO�indexra)	rr_r`Zchangesr*r�rI�oldr�rrr�pack�s0��



zMH.packcCst|��}|��}|��D]0\}}||kr4|�|�q||kr||�|�=q|D]}||krN|g||<qN|�|�dS)z;Inspect a new MHMessage and update sequences appropriately.N)rGrOr�rcra)rr&r*Zpending_sequencesZ
all_sequencesr�rI�sequencerrrrD�szMH._dump_sequences)NT)r�r�r�r�r r'r+r3r7r@r:rErQrSr_rar]rcr�r�r�r�rGrarerDrrrrr�s.
"c@s�eZdZdZedddddddh�Zd%dd�Zd
d�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd �Zd!d"�Zd#d$�Zd	S)&rzAn Rmail-style Babyl mailbox.�unseen�deletedZfiled�answered�	forwardedZedited�resentNTcCst�||||�i|_dS)zInitialize a Babyl mailbox.N)r�r �_labelsrrrrr �szBabyl.__init__cCs(t�||�}t|t�r$|��|j|<|S)r!)r�r'rur�
get_labelsrl)rr&r*rrrr'�s
z	Babyl.addcCs"t�||�||jkr|j|=dSr�)r�r+rlr)rrrr+�s
zBabyl.removecCs*t�|||�t|t�r&|��|j|<dS)r1N)r�r3rurrmrlr2rrrr3�s
zBabyl.__setitem__c
Cs�|�|�\}}|j�|�|j��t��}|j��}|dtks\|sHq\|�|�td��q,t��}|j��}|tks�|s|q�|�|�td��qd||j�	�}|j�
|�}|�td�}t|��|�}	|	�
|���||jkr�|	�|j|�|	S)r<�*** EOOH ***rh)r�rr{r�rvrwr}r~r|rrkrr��set_visiblerl�
set_labels)
rr*rr�original_headersr�Zvisible_headers�nZbodyr�rrrr7�s*



zBabyl.get_messagec	Cs�|�|�\}}|j�|�|j��t��}|j��}|dtks\|sHq\|�|�td��q,|j��}|tksv|s\qvq\|�	�}||j�
�}|j�|�}|�td�}||S)r+rnrh)r�rr{r�rvrwr}r~r|r�rrk)	rr*rrrqr�Zheadersrrr�rrrr@s 


zBabyl.get_bytescCst�|�|��dt��S)rBrh)rvrwr@r|r}r)rrrr:%szBabyl.get_filecCs<|��t�}|j��D]}|�|�q|�|j�t|�S)z4Return a list of user-defined labels in the mailbox.)r�rYrlrMr[�difference_update�_special_labelsrF)r�labelsZ
label_listrrrrm)szBabyl.get_labelscCs:gg}}|j�d�d}g}|}|j��}|j��}|dtkr�t|�t|�krd|�|tt��|�|�dd�|j��dd��d�D�}|�|�q|dks�|dtkr�t|�t|�kr�|�|tt��q|s|�|tt��q�qtt	t
||���|_tt	|��|_t|j�|_
|j�dd	�|j��|_dS)
r8rscSsg|]}|��r|���qSr)�strip�rL�labelrrrrX@s�z'Babyl._generate_toc.<locals>.<listcomp>r�N�,�r�)rr{r�rr}r�r�r�r9r:r;r�rlrr)rr<r=r@Zlabel_listsr>r�rurrrr!2s4



�zBabyl._generate_toccCsVdt}|dt7}|��}dd�|D�}|dd�|�t7}|d7}|�|�dS)	rsBABYL OPTIONS:s
Version: 5css|]}|��VqdSr,)rdrwrrrrMUsz*Babyl._pre_mailbox_hook.<locals>.<genexpr>sLabels:ryrzN)r}rmr�r~)rr�ZbabylrurrrrPszBabyl._pre_mailbox_hookcCs|�dt�dS)r�Nr7rrrrrZszBabyl._pre_message_hookcCs|�td�dS)r rzNr7rrrrr^szBabyl._post_message_hookcCsx|j��}t|t�r�g}g}|��D]$}||jkr>|�|�q$|�|�q$|j�d�|D]}|j�d|���qZ|j�d�|D]}|j�d|��d�q�|j�t	�n|j�dt	�t|t
jj��rt
��}t
j�|dd�}|�|�|�d�|��}|j�|�d	t	��|d	k�s,|s��q,q�|j�d
t	�t|t��r�t
��}	t
j�|	dd�}
|
�|���|	��}|j�|�d	t	��|d	k�s�|�sn�q�qnn>|�d�|��}|j�|�d	t	��|d	k�s�|�s��q�q�|�d�}|�s��qf|j�|�d	t	���q�nTt|ttt
jf��rt|t
j��rJt�dtd
�|��}t|t��r`|�|�}|�d�d}|ddk�r�|j�|d|��d	t	��|j�d
t	�|j�|d|��d	t	��|j�||d��d	t	��n(|j�d
t	t	�|j�|�d	t	���nXt |d��rVt |d��r:t�dtd
�|j!}|��}
d}|��}|�"d��rl|dd�d	}n|�"d��r�|dd�d	}|j�|�d	t	��|d	k�s�|�sF|�r�d}|j�d
t	�|�|
�n�qڐqF|��}|�s�qf|�"d��r
|dd�t	}n:|�"d��r(|dd�t	}n|�"d	��rD|dd�t	}|j�|��q�nt#dt$|���|j��}||fS)z0Write message contents and return (start, stop).�1s, s,,� rys1,,Frrhrnr
rirjs

r�rqNr�rlrmTrnrorprt)%rrrurrmrtr�r~rdr}r>r&rrvrwrxryrzr{r�r|�get_visiblerkr�r�r�r�r�r�r�rgr/rXrlr�r�r�)rr&rZspecial_labelsrurxZorig_bufferZorig_generatorr�Z
vis_bufferZ
vis_generatorrlZ
body_startZoriginal_posZ
first_passrrrrr"bs�







�
�
zBabyl._install_message)NT)r�r�r�r��	frozensetrtr r'r+r3r7r@r:rmr!rrrr"rrrrr�s&
�
	
c@s*eZdZdZd	dd�Zdd�Zdd�ZdS)
rz0Message with mailbox-format-specific properties.NcCs�t|tjj�r4|�t�|��t|t�r�|�|�n�t|t�rP|�t�	|��n~t|t
�rl|�t�|��nbt|tj
�r�|�t�|��nDt|d�r�|�t�|��n(|dkr�tjj�|�ntdt|���dS)zInitialize a Message instance.rkNrt)rur>r&r�_become_message�copyZdeepcopy�_explain_tor�r?r�Zmessage_from_stringrv�
TextIOWrapperZmessage_from_filerXZmessage_from_binary_filer r�r�r%rrrr �s



zMessage.__init__cCs4t|dg�}|jD]}||kr|j||j|<qdS)z0Assume the non-format-specific state of message.�_type_specific_attributesN)�getattr�__dict__)rr&Z
type_specificr�rrrr��s
zMessage._become_messagecCst|t�rdStd��dS)z:Copy format-specific state to message insofar as possible.Nz Cannot convert to specified type)rurr�r%rrrr��s
zMessage._explain_to)N)r�r�r�r�r r�r�rrrrr�s
c@s|eZdZdZdddgZddd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)r	z)Message with Maildir-specific properties.�_subdir�_info�_dateNcCs&d|_d|_t��|_t�||�dS)z%Initialize a MaildirMessage instance.r�r�N)r�r�r�r�rr r%rrrr �s
zMaildirMessage.__init__cCs|jS)zReturn 'new' or 'cur'.)r�rDrrrr��szMaildirMessage.get_subdircCs(|dks|dkr||_ntd|��dS)zSet subdir to 'new' or 'cur'.r�r�z!subdir must be 'new' or 'cur': %sN)r�rf)rr�rrrr�szMaildirMessage.set_subdircCs"|j�d�r|jdd�SdSdS)�*Return as a string the flags that are set.�2,r�Nr�)r�r�rDrrr�	get_flags
szMaildirMessage.get_flagscCsdd�t|��|_dS)�)Set the given flags and unset all others.r�r�N)r�rr�)r�flagsrrr�	set_flagsszMaildirMessage.set_flagscCs$|�d�t|���t|�B��dS�z.Set the given flag(s) without changing others.r�N�r�r�rYr��r�flagrrr�add_flagszMaildirMessage.add_flagcCs,|��r(|�d�t|���t|���dS)�7Unset the given string flag(s) without changing others.r�N)r�r�r�rYr�rrr�remove_flagszMaildirMessage.remove_flagcCs|jS)z<Return delivery date of message, in seconds since the epoch.)r�rDrrrr�szMaildirMessage.get_datecCs6zt|�|_Wn"tk
r0td|�d�YnXdS)z9Set delivery date of message, in seconds since the epoch.zcan't convert to float: %sN)�floatr�rfr�)r�daterrrr�"szMaildirMessage.set_datecCs|jS)z%Get the message's "info" as a string.)r�rDrrrr�)szMaildirMessage.get_infocCs&t|t�r||_ntdt|���dS)z Set the message's "info" string.zinfo must be a string: %sN)rur�r�r�r�)r�inforrrr�-s
zMaildirMessage.set_infocCs�t|t�r8|�|���|�|���|�|����nht|t�r�t	|���}d|kr`|�
d�|��dkrv|�
d�d|kr�|�
d�d|kr�|�
d�d|kr�|�
d�|�d	t�
|����n�t|t��rt	|���}d|kr�|�d
�d|k�r|�d�d|k�r�|�d�n�t|t��r�t	|���}d|k�rD|�d
�d|k�rX|�d
�d|k�rl|�d�d|k�r�|�d�nt|t��r�ntdt|���dS)z;Copy Maildir-specific state to message insofar as possible.�S�Rr��O�T�D�F�A�
MAILER-DAEMONrg�replied�flaggedrhri�Prj�$Cannot convert to specified type: %sN)rur	r�r�r�r�r�r�r0rYr�r'r�r4rrHr�	add_labelrr�r�)rr&r�rrrr�4sP

















�zMaildirMessage._explain_to)N)r�r�r�r�r�r r�r�r�r�r�r�r�r�r�r�r�rrrrr	�s

c@sZeZdZdZdgZddd�Zdd�Zddd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�ZdS)r0z/Message with mbox- or MMDF-specific properties.�_fromNcCsV|�dd�t|tjj�rF|��}|dk	rF|�d�rF|�|dd��t�||�dS)z'Initialize an mboxMMDFMessage instance.r�TNzFrom rs)r'rur>r&rr2r�r )rr&r,rrrr esz_mboxMMDFMessage.__init__cCs|jS)z Return contents of "From " line.)r�rDrrrr1nsz_mboxMMDFMessage.get_fromcCs4|dk	r*|dkrt��}|dt�|�7}||_dS)z>Set "From " line, formatting and appending time_ if specified.NT� )r�r4r3r�)rr-Ztime_rrrr'rs
z_mboxMMDFMessage.set_fromcCs|�dd�|�dd�S)r��Statusr��X-Status)r6rDrrrr�zsz_mboxMMDFMessage.get_flagscCs�t|�}d\}}dD]}||kr||7}|�|�qdD]}||kr8||7}|�|�q8|d�t|��7}z|�d|�Wn tk
r�|�d|�YnXz|�d|�Wn tk
r�|�d|�YnXdS)r�)r�r�)r�r�)r�r�r�r�r�r�N)rYr+r�r�replace_headerr/Z
add_header)rr�Zstatus_flagsZ
xstatus_flagsr�rrrr�~s&z_mboxMMDFMessage.set_flagscCs$|�d�t|���t|�B��dSr�r�r�rrrr��sz_mboxMMDFMessage.add_flagcCs4d|ksd|kr0|�d�t|���t|���dS)r�r�r�r�Nr�r�rrrr��sz_mboxMMDFMessage.remove_flagc	Cs�t|t�r�t|���}d|kr(|�d�d|kr:|�d�d|krL|�d�d|kr^|�d�d|krp|�d�|d	=|d
=d�|����dd
��}z|�	t
�t�
|d���Wnttfk
r�YnX�n
t|t�r�|�|���|�|���n�t|t��rZt|���}d|k�r$|�d�d|k�r8|�d�d|k�rL|�d�|d	=|d
=n�t|t��r�t|���}d|k�r�|�d�d|k�r�|�d�d|k�r�|�d�|d	=|d
=nt|t��r�ntdt|���d
S)zACopy mbox- or MMDF-specific state to message insofar as possible.r�r�r�r�r�r�r�r�Zstatuszx-statusr����Nz%a %b %d %H:%M:%S %Yrgr�r�rhrir�)rur	rYr�r�r�r�r1r�r��calendarZtimegmr��strptimerf�
OverflowErrorr0r�r'rrHrr�rr�r�)rr&r�Z
maybe_daterrrr��sb





�













�z_mboxMMDFMessage._explain_to)N)N)
r�r�r�r�r�r r1r'r�r�r�r�r�rrrrr0`s
	
r0c@seZdZdZdS)r
z&Message with mbox-specific properties.N�r�r�r�r�rrrrr
�sc@sHeZdZdZdgZddd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)rz$Message with MH-specific properties.�
_sequencesNcCsg|_t�||�dS)z!Initialize an MHMessage instance.N)r�rr r%rrrr �szMHMessage.__init__cCs|jdd�S)z4Return a list of sequences that include the message.N)r�rDrrrrG�szMHMessage.get_sequencescCst|�|_dS)z3Set the list of sequences that include the message.N)rFr�)rr_rrrra�szMHMessage.set_sequencescCs6t|t�r"||jkr2|j�|�ntdt|���dS)z8Add sequence to list of sequences including the message.zsequence type must be str: %sN)rur�r�r�r�r��rrfrrrrH�s

zMHMessage.add_sequencecCs*z|j�|�Wntk
r$YnXdS)zARemove sequence from the list of sequences including the message.N)r�r+rfr�rrr�remove_sequence�szMHMessage.remove_sequencecCsFt|t�rdt|���}d|kr*|�d�n|�d�|�d�d|krP|�d�d|krb|�d�n�t|t�r�t|���}d|kr�|�d�n
|�d	�d|kr�|�d�d|kr�|�d
�n�t|t�r�|��D]}|�|�q�n`t|t	��r$t|���}d|k�r|�
d�d|k�rB|�
d�nt|t��r2ntdt
|���d
S)z6Copy MH-specific state to message insofar as possible.rgr�r�r�r�r�r��ROr�r�rir�N)rur	rYrGr�r�r0rrHrr�rr�r�)rr&r_rfrrrr��sB










�zMHMessage._explain_to)N)r�r�r�r�r�r rGrarHr�r�rrrrr�s
c@sbeZdZdZddgZddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dS)rz'Message with Babyl-specific properties.rl�_visibleNcCsg|_t�|_t�||�dS)z#Initialize a BabylMessage instance.N)rlrr�r r%rrrr "szBabylMessage.__init__cCs|jdd�S)z'Return a list of labels on the message.N)rlrDrrrrm(szBabylMessage.get_labelscCst|�|_dS)z&Set the list of labels on the message.N)rFrl)rrurrrrp,szBabylMessage.set_labelscCs6t|t�r"||jkr2|j�|�ntdt|���dS)z+Add label to list of labels on the message.zlabel must be a string: %sN)rur�rlr�r�r��rrxrrrr�0s

zBabylMessage.add_labelcCs*z|j�|�Wntk
r$YnXdS)z4Remove label from the list of labels on the message.N)rlr+rfr�rrr�remove_label8szBabylMessage.remove_labelcCs
t|j�S)z3Return a Message representation of visible headers.�rr�rDrrrr~?szBabylMessage.get_visiblecCst|�|_dS)z2Set the Message representation of visible headers.Nr�)rZvisiblerrrroCszBabylMessage.set_visiblecCsb|j��D](}||kr*|j�|||�q
|j|=q
dD]$}||kr8||jkr8|||j|<q8dS)z9Update and/or sensibly generate a set of visible headers.)ZDateZFromzReply-ToZToZCCZSubjectN)r�rGr�)r�headerrrr�update_visibleGs
zBabylMessage.update_visiblecCsrt|t�r~t|���}d|kr*|�d�n|�d�|�d�d|ksNd|krX|�d�d|krj|�d�d	|kr||�d
�n�t|t�r�t|���}d|kr�|�d�n
|�d�d	|kr�|�d
�d|kr�|�d�n�t|t��rt|���}d|k�r|�d�d|k�rn|�d�nTt|t	��rP|�
|���|��D]}|�|��q<nt|t
��r^ntdt|���dS)z9Copy Babyl-specific state to message insofar as possible.rgr�r�rjrkr�rir�rhr�r�r�r�r�r�r�N)rur	rYrmr�r�r0rrHrror~r�rr�r�)rr&rurxrrrr�RsH










�zBabylMessage._explain_to)N)r�r�r�r�r�r rmrpr�r�r~ror�r�rrrrrs
c@seZdZdZdS)r
z&Message with MMDF-specific properties.Nr�rrrrr
|sc@s�eZdZdZd&dd�Zd'dd�Zd(dd�Zd)d	d
�Zd*dd�Zd
d�Z	dd�Z
d+dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zed$d%��ZdS),r�zA read-only wrapper of a file.NcCs$||_|dkr|��|_n||_dS)zInitialize a _ProxyFile.N)rr�_pos)rr��posrrrr �sz_ProxyFile.__init__cCs|�||jj�S�zRead bytes.)�_readrrk�r�sizerrrrk�sz_ProxyFile.readcCs|�||jj�Sr�)r�r�read1r�rrrr��sz_ProxyFile.read1cCs|�||jj�S)zRead a line.)r�rr�r�rrrr��sz_ProxyFile.readlinecCs<g}|D].}|�|�|dk	r|t|�8}|dkrq8q|S)zRead multiple lines.Nr)r�r�)r�sizehintrUr�rrr�	readlines�s
z_ProxyFile.readlinesccs|��}|sdS|VqdS)zIterate over lines.N)r�)rr�rrrrL�sz_ProxyFile.__iter__cCs|jS)zReturn the position.)r�rDrrrr�sz_ProxyFile.tellrcCs4|dkr|j�|j�|j�||�|j��|_dS)zChange position.r�N�rr{r�r�r�offset�whencerrrr{�sz_ProxyFile.seekcCs0t|d�r,zt|jd�r"|j��W5|`XdS)zClose the file.rrcN)rXrrcrDrrrrc�s

z_ProxyFile.closecCs2|dkrd}|j�|j�||�}|j��|_|S)z"Read size bytes using read_method.Nrqr�)rr��read_methodrUrrrr��sz_ProxyFile._readcCs|S)z$Context management protocol support.rrDrrr�	__enter__�sz_ProxyFile.__enter__cGs|��dSr,)rc)r�excrrr�__exit__�sz_ProxyFile.__exit__cCs
|j��Sr,)r�readablerDrrrr��sz_ProxyFile.readablecCs
|j��Sr,)r�writablerDrrrr��sz_ProxyFile.writablecCs
|j��Sr,)r�seekablerDrrrr��sz_ProxyFile.seekablecCs
|j��Sr,)rr]rDrrrr]�sz_ProxyFile.flushcCs&t|d�sdSt|jd�sdS|jjS)NrTrEF)rXrrErDrrrrE�s

z_ProxyFile.closed)N)N)N)N)N)r)r�r�r�r�r rkr�r�r�rLrr{rcr�r�r�r�r�r�r]�propertyrErrrrr��s&





		r�c@s<eZdZdZddd�Zdd�Zddd	�Zd
d�Zdd
�ZdS)r.z&A read-only wrapper of part of a file.NcCst�|||�||_||_dS)zInitialize a _PartialFile.N)r�r �_start�_stop)rr�rrrrrr �sz_PartialFile.__init__cCst�|�|jS)z*Return the position with respect to start.)r�rr�rDrrrr�sz_PartialFile.tellrcCs<|dkr|j|_d}n|dkr*|j|_d}t�|||�dS)z8Change position, possibly with respect to start or stop.rr�r�N)r�r�r�r�r{r�rrrr{�sz_PartialFile.seekcCsB|j|j}|dkrdS|dks0|dks0||kr4|}t�|||�S)z;Read size bytes using read_method, honoring start and stop.rr%N)r�r�r�r�)rr�r�Z	remainingrrrr��sz_PartialFile._readcCst|d�r|`dS)Nr)rXrrDrrrrcs
z_PartialFile.close)NN)r)	r�r�r�r�r rr{r�rcrrrrr.�s


	r.Tc
Cs�d}�zbtrpzt�|tjtjB�WnJtk
rn}z,|jtjtjtjfkr\t	d|j
��n�W5d}~XYnX|�rfzt|j
d�}|��WnBtk
r�}z$|jtjtjfkr�WY�WdS�W5d}~XYnXz`zt
�|j
|j
d�d}Wn2ttfk
�r$t
�|j
|j
d�d}YnXt
�|j
�Wn0tk
�rdt
�|j
�t	d|j
��YnXWn8t�r�t�|tj�|�r�t
�|j
d��YnXdS)z(Lock file f using lockf and dot locking.Fzlockf: lock unavailable: %sN�.lockTzdot lock unavailable: %s)�fcntl�lockfZLOCK_EXZLOCK_NBr�r�ZEAGAINrrrr�rrcrr�r�r�r�rbr�r+�LOCK_UN)r�rZdotlock_doner�Zpre_lockrrrr

sL�
�r
cCs8trt�|tj�tj�|jd�r4t�|jd�dS)z*Unlock file f using lockf and dot locking.r�N)r�r�r�rrr�r�r+�r�rrrr4src	Cs<t�|tjtjBtjBd�}zt|d�W�St�|�XdS)zCCreate a file if it doesn't exist and open for reading and writing.r�r�N)rr�r�rB�O_RDWRrc)r�fdrrrr�;sr�cCs$td|tt���t��t��f�S)zBCreate a temp file based on path and open for reading and writing.z%s.%s.%s.%s)r�r�r�r�r�rr�)rrrrrCs�rcCs$|��ttd�r t�|���dS)z0Ensure changes to file f are physically on disk.�fsyncN)r]rXrr��filenor�rrrrIs
rcCst|�|��dS)z:Close file f, ensuring all changes are physically on disk.N)rrcr�rrrr�Osr�c@seZdZdZdS)rz"Raised for module-specific errors.Nr�rrrrrUsc@seZdZdZdS)rz:The specified mailbox does not exist and won't be created.Nr�rrrrrXsc@seZdZdZdS)rz>The specified mailbox is not empty and deletion was requested.Nr�rrrrr[sc@seZdZdZdS)rz)Another process caused an action to fail.Nr�rrrrr^sc@seZdZdZdS)rz)A file appears to have an invalid format.Nr�rrrrras)T)0r�rr�r�r�r�r�r�r>Z
email.messageZemail.generatorrvr8r��ImportError�__all__r}rdrrr�r$rrrrr&rr	r0r
rrr
r�r.r
rr�rrr��	Exceptionrrrrrrrrr�<module>s�
�h8DB4-3z%mqH_c'
*__pycache__/signal.cpython-38.opt-1.pyc000064400000005435151153537560013642 0ustar00U

e5d��@s&ddlZddlTddlmZddlmZe�Ze�	de
dd��e�	de
d	d��d
ekrle�	de
dd��d
d�Zdd�Zeej
�dd��Z
eej�dd��Zd
ekr�eej�dd
��Zejje_dekr�eej�dd��Zdek�reej�dd��Zeje_dek�reej�dd��Z[[dS)�N)�*)�wraps)�IntEnum�SignalscCs(|��r|�d�r|�d�p&|�d�S)NZSIGZSIG_ZCTRL_)�isupper�
startswith��name�r
�/usr/lib64/python3.8/signal.py�<lambda>
s�r�HandlerscCs|dkS)N)�SIG_DFL�SIG_IGNr
rr
r
rr��pthread_sigmaskZSigmaskscCs|dkS)N)�	SIG_BLOCK�SIG_UNBLOCK�SIG_SETMASKr
rr
r
rrrcCs(z
||�WStk
r"|YSXdS)zsConvert a numeric value to an IntEnum member.
    If it's not a known member, return the numeric value itself.
    N)�
ValueError)�valueZ
enum_klassr
r
r�_int_to_enums
rc	Cs,z
t|�WSttfk
r&|YSXdS)zmConvert an IntEnum member to a numeric value.
    If it's not an IntEnum member return the value itself.
    N)�intr�	TypeError)rr
r
r�_enum_to_int#s
rcCst�t|�t|��}t|t�S�N)�_signal�signalrrr
�Z	signalnumZhandlerr
r
rr-srcCst�|�}t|t�Sr)r�	getsignalrr
rr
r
rr3s
rcCst�||�}tdd�|D��S)Ncss|]}t|t�VqdSr�rr��.0�xr
r
r�	<genexpr>=sz"pthread_sigmask.<locals>.<genexpr>)rr�set)Zhow�maskZsigs_setr
r
rr:s�
sigpendingcCsdd�t��D�S)NcSsh|]}t|t��qSr
r r!r
r
r�	<setcomp>Dszsigpending.<locals>.<setcomp>)rr'r
r
r
rr'Bs�sigwaitcCst�|�}t|t�Sr)rr)rr)ZsigsetZretsigr
r
rr)Hs
�
valid_signalscCsdd�t��D�S)NcSsh|]}t|t��qSr
r r!r
r
rr(Rsz valid_signals.<locals>.<setcomp>)rr*r
r
r
rr*Ps)r�	functoolsrZ_wraps�enumrZ_IntEnum�globalsZ_globals�	_convert_�__name__rrrrr�__doc__r'r)r*r
r
r
r�<module>sR���










__pycache__/hashlib.cpython-38.opt-2.pyc000064400000011736151153537560014001 0ustar00U

&�.e� �	@svdZdZee�Zee�ZedZddddddd	d
hZzddlmZ	Wne
k
r`d
d�Z	YnXe	�stiZdd�Zdd�Z
e	�s�ddd�Zddd�Zz ddlZeZe
Ze�ej�ZWn$e
k
r�e	�r΂eZeZYnXddlmZzddlmZWne
k
�rYnXeD]DZzee�e�e<Wn*ek
�rTddlZe�de�YnX�q[[[[[
e���sp[[	dS)a3hashlib module - A common interface to many hash functions.

new(name, data=b'', **kwargs) - returns a new hash object implementing the
                                given hash function; initializing the hash
                                using the given binary data.

Named constructor functions are also available, these are faster
than using new(name):

md5(), sha1(), sha224(), sha256(), sha384(), sha512(), blake2b(), blake2s(),
sha3_224, sha3_256, sha3_384, sha3_512, shake_128, and shake_256.

More algorithms may be available on your platform but the above are guaranteed
to exist.  See the algorithms_guaranteed and algorithms_available attributes
to find out what algorithm names can be passed to new().

NOTE: If you want the adler32 or crc32 hash functions they are available in
the zlib module.

Choose your hash function wisely.  Some have known collision weaknesses.
sha384 and sha512 will be slow on 32 bit platforms.

Hash objects have these methods:
 - update(data): Update the hash object with the bytes in data. Repeated calls
                 are equivalent to a single call with the concatenation of all
                 the arguments.
 - digest():     Return the digest of the bytes passed to the update() method
                 so far as a bytes object.
 - hexdigest():  Like digest() except the digest is returned as a string
                 of double length, containing only hexadecimal digits.
 - copy():       Return a copy (clone) of the hash object. This can be used to
                 efficiently compute the digests of datas that share a common
                 initial substring.

For example, to obtain the digest of the byte string 'Nobody inspects the
spammish repetition':

    >>> import hashlib
    >>> m = hashlib.md5()
    >>> m.update(b"Nobody inspects")
    >>> m.update(b" the spammish repetition")
    >>> m.digest()
    b'\xbbd\x9c\x83\xdd\x1e\xa5\xc9\xd9\xde\xc9\xa1\x8d\xf0\xff\xe9'

More condensed:

    >>> hashlib.sha224(b"Nobody inspects the spammish repetition").hexdigest()
    'a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2'

)�md5�sha1�sha224�sha256�sha384�sha512�blake2b�blake2s�sha3_224�sha3_256�sha3_384�sha3_512�	shake_128�	shake_256)�new�algorithms_guaranteed�algorithms_available�pbkdf2_hmacr	r
rrr
rrr�)�
get_fips_modecCsdS)Nr�rrr�/usr/lib64/python3.8/hashlib.py�_hashlib_get_fips_modeQsrc	Cs�t}|�|�}|dk	r|S�zB|dkrDddl}|j|d<|d<�n|dkrhddl}|j|d<|d<n�|dkr�ddl}|j|d	<|d
<|j|d<|d<n�|d
kr�ddl	}|j
|d<|d<|j|d<|d<n�|dkr�ddl}|j
|d<|j|d<nb|dk�r6ddl}|j|d<|j|d<|j|d<|j|d<n&|dk�r\ddl}|j|d<|j|d<Wntk
�rtYnX|�|�}|dk	�r�|Std|��dS)N>r�SHA1rrr>�MD5rrr>r�SHA224r�SHA256rrrr>r�SHA512�SHA384rrrrr>rrrr>rr	rr
r	r
rr>r
rr
rzunsupported hash type )�__builtin_constructor_cache�get�_sha1r�_md5r�_sha256rr�_sha512rr�_blake2rr�_sha3r	r
rrr
r�ImportError�
ValueError)	�name�cache�constructorr r!r"r#r$r%rrr�__get_builtin_constructorWsN









r+c	Cs^t�s|tkrt|�Sz"ttd|�}t��s4|�|WSttfk
rXt|�YSXdS)NZopenssl_)r�__block_openssl_constructorr+�getattr�_hashlibr�AttributeErrorr')r(�frrr�__get_openssl_constructor�sr1�cKst|�|f|�S�N)r+�r(�data�kwargsrrr�__py_new�sr7cKsft��s |tkr t|�|f|�Sztj||f|�WStk
r`t��rL�t|�|f|�YSXdSr3)r.rr,r+rr'r4rrr�
__hash_new�sr8N)r)�scryptzcode for hash %s was not found.)r2)r2)�__doc__Z__always_supported�setrr�__all__r,r.rrr&rr+r1r7r8rZ
__get_hash�unionZopenssl_md_meth_namesrr9Z__func_name�globalsr'ZloggingZ	exceptionrrrr�<module>sh5�,

�

__pycache__/selectors.cpython-38.pyc000064400000041051151153537560013423 0ustar00U

e5d�H�@s�dZddlmZmZddlmZddlmZddlZddl	Z	ddl
Z
dZdZdd	�Z
ed
ddd
dg�Zde_e
jdkr�dej_dej_dej_dej_Gdd�de�ZGdd�ded�ZGdd�de�ZGdd�de�ZGdd�de�Zee	d ��rGd!d"�d"e�Zee	d#��r Gd$d%�d%e�Zee	d&��r<Gd'd(�d(e�Zee	d)��rXGd*d+�d+e�Zd+e�k�rjeZn:d%e�k�r|eZn(d(e�k�r�eZnd"e�k�r�eZneZdS),z|Selectors module.

This module allows high-level and efficient I/O multiplexing, built upon the
`select` module primitives.
�)�ABCMeta�abstractmethod)�
namedtuple)�MappingN��c
Csft|t�r|}n<zt|���}Wn*tttfk
rJtd�|��d�YnX|dkrbtd�|���|S)z�Return a file descriptor from a file object.

    Parameters:
    fileobj -- file object or file descriptor

    Returns:
    corresponding file descriptor

    Raises:
    ValueError if the object is invalid
    zInvalid file object: {!r}NrzInvalid file descriptor: {})�
isinstance�int�fileno�AttributeError�	TypeError�
ValueError�format)�fileobj�fd�r�!/usr/lib64/python3.8/selectors.py�_fileobj_to_fds
��r�SelectorKeyrr�events�dataz�SelectorKey(fileobj, fd, events, data)

    Object used to associate a file object to its backing
    file descriptor, selected event mask, and attached data.
)��zFile object registered.zUnderlying file descriptor.z3Events that must be waited for on this file object.zzOptional opaque data associated to this file object.
    For example, this could be used to store a per-client session ID.c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�_SelectorMappingz)Mapping of file objects to selector keys.cCs
||_dS�N)�	_selector)�selfZselectorrrr�__init__?sz_SelectorMapping.__init__cCst|jj�Sr)�lenr�
_fd_to_key�rrrr�__len__Bsz_SelectorMapping.__len__cCsDz|j�|�}|jj|WStk
r>td�|��d�YnXdS�N�{!r} is not registered)r�_fileobj_lookupr�KeyErrorr)rrrrrr�__getitem__Es
z_SelectorMapping.__getitem__cCst|jj�Sr)�iterrrr rrr�__iter__Lsz_SelectorMapping.__iter__N)�__name__�
__module__�__qualname__�__doc__rr!r&r(rrrrr<s
rc@sneZdZdZeddd��Zedd��Zddd�Zedd	d
��Zdd�Z	d
d�Z
edd��Zdd�Zdd�Z
dS)�BaseSelectora-Selector abstract base class.

    A selector supports registering file objects to be monitored for specific
    I/O events.

    A file object is a file descriptor or any object with a `fileno()` method.
    An arbitrary object can be attached to the file object, which can be used
    for example to store context information, a callback, etc.

    A selector can use various implementations (select(), poll(), epoll()...)
    depending on the platform. The default `Selector` class uses the most
    efficient implementation on the current platform.
    NcCst�dS)a3Register a file object.

        Parameters:
        fileobj -- file object or file descriptor
        events  -- events to monitor (bitwise mask of EVENT_READ|EVENT_WRITE)
        data    -- attached data

        Returns:
        SelectorKey instance

        Raises:
        ValueError if events is invalid
        KeyError if fileobj is already registered
        OSError if fileobj is closed or otherwise is unacceptable to
                the underlying system call (if a system call is made)

        Note:
        OSError may or may not be raised
        N��NotImplementedError�rrrrrrr�register_szBaseSelector.registercCst�dS)ajUnregister a file object.

        Parameters:
        fileobj -- file object or file descriptor

        Returns:
        SelectorKey instance

        Raises:
        KeyError if fileobj is not registered

        Note:
        If fileobj is registered but has since been closed this does
        *not* raise OSError (even if the wrapped syscall does)
        Nr.)rrrrr�
unregistervszBaseSelector.unregistercCs|�|�|�|||�S)ayChange a registered file object monitored events or attached data.

        Parameters:
        fileobj -- file object or file descriptor
        events  -- events to monitor (bitwise mask of EVENT_READ|EVENT_WRITE)
        data    -- attached data

        Returns:
        SelectorKey instance

        Raises:
        Anything that unregister() or register() raises
        )r2r1r0rrr�modify�s
zBaseSelector.modifycCst�dS)aqPerform the actual selection, until some monitored file objects are
        ready or a timeout expires.

        Parameters:
        timeout -- if timeout > 0, this specifies the maximum wait time, in
                   seconds
                   if timeout <= 0, the select() call won't block, and will
                   report the currently ready file objects
                   if timeout is None, select() will block until a monitored
                   file object becomes ready

        Returns:
        list of (key, events) for ready file objects
        `events` is a bitwise mask of EVENT_READ|EVENT_WRITE
        Nr.)r�timeoutrrr�select�szBaseSelector.selectcCsdS)zmClose the selector.

        This must be called to make sure that any underlying resource is freed.
        Nrr rrr�close�szBaseSelector.closecCsL|��}|dkrtd��z
||WStk
rFtd�|��d�YnXdS)zzReturn the key associated to a registered file object.

        Returns:
        SelectorKey for this file object
        NzSelector is closedr#)�get_map�RuntimeErrorr%r)rr�mappingrrr�get_key�s
zBaseSelector.get_keycCst�dS)z2Return a mapping of file objects to selector keys.Nr.r rrrr7�szBaseSelector.get_mapcCs|Srrr rrr�	__enter__�szBaseSelector.__enter__cGs|��dSr)r6)r�argsrrr�__exit__�szBaseSelector.__exit__)N)N)N)r)r*r+r,rr1r2r3r5r6r:r7r;r=rrrrr-Ps


r-)�	metaclassc@sTeZdZdZdd�Zdd�Zddd�Zd	d
�Zddd�Zd
d�Z	dd�Z
dd�ZdS)�_BaseSelectorImplzBase selector implementation.cCsi|_t|�|_dSr)rr�_mapr rrrr�sz_BaseSelectorImpl.__init__cCsNz
t|�WStk
rH|j��D]}|j|kr$|jYSq$�YnXdS)alReturn a file descriptor from a file object.

        This wraps _fileobj_to_fd() to do an exhaustive search in case
        the object is invalid but we still have it in our map.  This
        is used by unregister() so we can unregister an object that
        was previously registered even if it is closed.  It is also
        used by _SelectorMapping.
        N)rr
r�valuesrr�rr�keyrrrr$�s	

z!_BaseSelectorImpl._fileobj_lookupNcCsb|r|ttB@r td�|���t||�|�||�}|j|jkrRtd�||j���||j|j<|S)NzInvalid events: {!r}z"{!r} (FD {}) is already registered)	�
EVENT_READ�EVENT_WRITEr
rrr$rrr%�rrrrrCrrrr1�s�z_BaseSelectorImpl.registercCs@z|j�|�|��}Wn$tk
r:td�|��d�YnX|Sr")r�popr$r%rrBrrrr2�s
z_BaseSelectorImpl.unregistercCs�z|j|�|�}Wn$tk
r8td�|��d�YnX||jkr^|�|�|�|||�}n"||jkr�|j|d�}||j|j	<|S)Nr#)r)
rr$r%rrr2r1r�_replacerrFrrrr3�s


z_BaseSelectorImpl.modifycCs|j��d|_dSr)r�clearr@r rrrr6s
z_BaseSelectorImpl.closecCs|jSr)r@r rrrr7sz_BaseSelectorImpl.get_mapcCs(z|j|WStk
r"YdSXdS)z�Return the key associated to a given file descriptor.

        Parameters:
        fd -- file descriptor

        Returns:
        corresponding key, or None if not found
        N)rr%)rrrrr�_key_from_fds	z_BaseSelectorImpl._key_from_fd)N)N)r)r*r+r,rr$r1r2r3r6r7rJrrrrr?�s


r?cs`eZdZdZ�fdd�Zd�fdd�	Z�fdd�Zejd	krHdd
d�Z	ne
j
Z	ddd
�Z
�ZS)�SelectSelectorzSelect-based selector.cst���t�|_t�|_dSr)�superr�set�_readers�_writersr ��	__class__rrr%s
zSelectSelector.__init__Ncs@t��|||�}|t@r&|j�|j�|t@r<|j�|j�|Sr)rLr1rDrN�addrrErOrFrPrrr1*szSelectSelector.registercs,t��|�}|j�|j�|j�|j�|Sr)rLr2rN�discardrrOrBrPrrr22szSelectSelector.unregisterZwin32cCs$t�||||�\}}}|||gfSr)r5)r�r�w�_r4�xrrr�_select9szSelectSelector._selectc	Cs�|dkrdnt|d�}g}z|�|j|jg|�\}}}Wntk
rP|YSXt|�}t|�}||BD]J}d}||kr�|tO}||kr�|tO}|�|�}|rj|�	|||j
@f�qj|S�Nr)�maxrXrNrO�InterruptedErrorrMrDrErJ�appendr)	rr4�readyrTrUrVrrrCrrrr5?s$

zSelectSelector.select)N)N)N)r)r*r+r,rr1r2�sys�platformrXr5�
__classcell__rrrPrrK"s
rKcs^eZdZdZdZdZdZ�fdd�Zd
�fdd�	Z�fdd�Z	d�fd	d
�	Z
ddd�Z�ZS)�_PollLikeSelectorz<Base class shared between poll, epoll and devpoll selectors.Ncst���|��|_dSr)rLr�
_selector_clsrr rPrrr[s
z_PollLikeSelector.__init__cslt��|||�}d}|t@r&||jO}|t@r8||jO}z|j�|j|�Wnt��|��YnX|SrY)	rLr1rD�_EVENT_READrE�_EVENT_WRITErrr2)rrrrrCZ
poller_eventsrPrrr1_s

z_PollLikeSelector.registercs8t��|�}z|j�|j�Wntk
r2YnX|Sr)rLr2rr�OSErrorrBrPrrr2msz_PollLikeSelector.unregistercs�z|j|�|�}Wn$tk
r8t|�d��d�YnXd}||jkr�d}|t@r^||jO}|t@rp||jO}z|j�	|j
|�Wnt��|��YnXd}||j
kr�d}|r�|j||d�}||j|j
<|S)Nz is not registeredFrT)rr)rr$r%rrDrcrErdrr3rrLr2rrH)rrrrrCZchangedZselector_eventsrPrrr3ws.



z_PollLikeSelector.modifycCs�|dkrd}n|dkrd}nt�|d�}g}z|j�|�}Wntk
rV|YSX|D]V\}}d}||j@r||tO}||j@r�|tO}|�	|�}|r\|�
|||j@f�q\|S)Nr�@�@)�math�ceilr�pollr[rcrErdrDrJr\r)rr4r]�
fd_event_listr�eventrrCrrrr5�s(

z_PollLikeSelector.select)N)N)N)
r)r*r+r,rbrcrdrr1r2r3r5r`rrrPrraUs
raric@s"eZdZdZejZejZej	Z
dS)�PollSelectorzPoll-based selector.N)r)r*r+r,r5rirb�POLLINrc�POLLOUTrdrrrrrl�srl�epollcsDeZdZdZejZejZej	Z
dd�Zd	dd�Z�fdd�Z�Z
S)
�
EpollSelectorzEpoll-based selector.cCs
|j��Sr�rr
r rrrr
�szEpollSelector.filenoNc	Cs�|dkrd}n |dkrd}nt�|d�d}tt|j�d�}g}z|j�||�}Wntk
rl|YSX|D]V\}}d}|tj	@r�|t
O}|tj@r�|tO}|�
|�}|rr|�|||j@f�qr|S)N���rrfg����MbP?r)rgrhrZrrrrir[r5�EPOLLINrE�EPOLLOUTrDrJr\r)	rr4�max_evr]rjrrkrrCrrrr5�s*

zEpollSelector.selectcs|j��t���dSr�rr6rLr rPrrr6�s
zEpollSelector.close)N)r)r*r+r,r5rorbrsrcrtrdr
r6r`rrrPrrp�s
 rp�devpollcs:eZdZdZejZejZej	Z
dd�Z�fdd�Z�Z
S)�DevpollSelectorzSolaris /dev/poll selector.cCs
|j��Srrqr rrrr
�szDevpollSelector.filenocs|j��t���dSrrvr rPrrr6�s
zDevpollSelector.close)r)r*r+r,r5rwrbrmrcrnrdr
r6r`rrrPrrx�srx�kqueuecsXeZdZdZ�fdd�Zdd�Zd�fdd�	Z�fd	d
�Zddd�Z�fd
d�Z	�Z
S)�KqueueSelectorzKqueue-based selector.cst���t��|_dSr)rLrr5ryrr rPrrr�s
zKqueueSelector.__init__cCs
|j��Srrqr rrrr
szKqueueSelector.filenoNcs�t��|||�}z`|t@r@t�|jtjtj�}|j�	|gdd�|t
@rnt�|jtjtj�}|j�	|gdd�Wnt��|��YnX|SrY)
rLr1rDr5�keventr�KQ_FILTER_READZ	KQ_EV_ADDr�controlrE�KQ_FILTER_WRITEr2)rrrrrC�kevrPrrr1s ��zKqueueSelector.registercs�t��|�}|jt@rVt�|jtjtj�}z|j	�
|gdd�Wntk
rTYnX|jt@r�t�|jtj
tj�}z|j	�
|gdd�Wntk
r�YnX|SrY)rLr2rrDr5r{rr|ZKQ_EV_DELETErr}rerEr~)rrrCrrPrrr2s$
�
�zKqueueSelector.unregisterc
Cs�|dkrdnt|d�}t|j�}g}z|j�d||�}Wntk
rP|YSX|D]Z}|j}|j}d}|tj	kr||t
O}|tjkr�|tO}|�
|�}	|	rV|�|	||	j@f�qV|SrY)rZrrrr}r[Zident�filterr5r|rDr~rErJr\r)
rr4rur]Zkev_listrr�flagrrCrrrr5)s&




zKqueueSelector.selectcs|j��t���dSrrvr rPrrr6?s
zKqueueSelector.close)N)N)r)r*r+r,rr
r1r2r5r6r`rrrPrrz�s
rz) r,�abcrr�collectionsrZcollections.abcrrgr5r^rDrErr�version_inforrrrrr-r?rKra�hasattrrlrprxrz�globalsZDefaultSelectorrrrr�<module>sL
~T3Z.M__pycache__/stringprep.cpython-38.pyc000064400000025413151153537560013621 0ustar00U

e5du2��@s�dZddlmZejdkst�dd�Zedddd	d
ddd
dddgeedd���Z	dd�Z
dddddddddddd d!d"d#d$d%d&d'd(dd)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDd=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdEdFdGdHdIdJdKdLdMdNdOdPdQdNddRdSdTdUdVdSdWddXdYdZdd[d\d]d^d_d`dadbd_dcdddedfdgdhdhdhdididjdkdldmdndodododpdqdrdsdsdtdddudvdwdxd&dydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d}d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�dtdddydudvd�dhdid�d�djdwdkd�dmdndodd�d�d�d�d�d�dsd�dtdddydudvd�dhdid�d�djdwdkd�dmdndodd�d�d�d�d�d�dsd�dtdddydudvd�dhdid�d�djdwdkd�dmdndodd�d�d�d�d�d�dsd�dddyd�d�d�dkd�dmdndd�d�d�d�d�d�dsd�dtdddydudvd�dhdid�d�djdwdkd�dmdndodd�d�d�d�d�d�dsd�dtdydudvd�d�d�djdwdkd�dmdndd�d�d�d�d�d�d�dtdydudvd�did�d�djdwd�dd�d�d�d�d�d�d�dtdddydudvd�dhdid�d�djdwdkd�dmdndodd�d�d�d�d�d�dsd�dtdddydudvd�dhdid�d�djdwdkd�dmdndodd�d�d�d�d�d�dsd�dtdddydudvd�dhdid�d�djdwdkd�dmdndodd�d�d�d�d�d�dsd�dtdddydudvd�dhdid�d�djdwdkd�dmdndodd�d�d�d�d�d�dsd�dtdddydudvd�dhdid�d�djdwdkd�dmdndodd�d�d�d�d�d�dsd�dtdddydudvd�dhdid�d�djdwdkd�dmdndodd�d�d�d�d�d�dsd�d dxd�d)d�d�d!dd'd�dd�d�d�d&d(d!dd�d"d%d�d�d�dd�d dxd�d)d�d�d!dd'd�dd�d�d�d&d(d!dd�d"d%d�d�d�dd�d dxd�d)d�d�d!dd'd�dd�d�d�d&d(d!dd�d"d%d�d�d�dd�d dxd�d)d�d�d!dd'd�dd�d�d�d&d(d!dd�d"d%d�d�d�dd�d dxd�d)d�d�d!dd'd�dd�d�d�d&d(d!dd�d"d%d�d�d�ddː��Zd�d̈́Zd�dτZ
d�dфZd�dӄZd�dՄZd�dׄZed�d�d�d
dd�d�dgeedd݃�eed�d߃�eed�d��eed�d���Zd�d�Zd�d�Zd�d�Zd�d�Zd�d�Zeed�d��Zd�d�Zeed�d��Zd�d�Zed�d�d�d�geed�d���eed�d߃��Zd�d��Zed�geed�d����Z�d�d�Z�d�d�Z �d�d�Z!�dS(z�Library that exposes various tables found in the StringPrep RFC 3454.

There are two kinds of tables: sets, for which a member test is provided,
and mappings, for which a mapping function is provided.
�)�	ucd_3_2_0z3.2.0cCsBt�|�dkrdSt|�}d|kr.dkr6nndS|d@dkS)NZCnF�������r)�unicodedata�category�ord��code�c�r�"/usr/lib64/python3.8/stringprep.py�in_table_a1sr�iOiiii
i i i
 i` i��i�i�cCst|�tkS�N)r
�b1_set�rrrr�in_table_b1sruμZssui̇uʼn�suǰuιu ιuΐuΰuσuβuθuυuύuϋuφuπuκuρuεuեւuẖuẗuẘuẙuaʾuṡuὐuὒuὔuὖuἀιuἁιuἂιuἃιuἄιuἅιuἆιuἇιuἠιuἡιuἢιuἣιuἤιuἥιuἦιuἧιuὠιuὡιuὢιuὣιuὤιuὥιuὦιuὧιuὰιuαιuάιuᾶuᾶιuὴιuηιuήιuῆuῆιuῒuῖuῗuῢuῤuῦuῧuὼιuωιuώιuῶuῶιZrsr
u°cuɛu°f�h�i�l�nZno�p�q�rZsmZtelZtm�z�b�e�f�muγ�dZhpaZauZovZpaZnauμaZmaZkaZkbZmbZgbZpfZnfuμf�hzZkhzZmhzZghzZthzZkpaZmpaZgpaZpvZnvuμvZmvZkvZpwZnwuμwZmw�kwukωumωZbquc∕kgzco.ZdbZgyZhpZkkZkmZphZppmZprZsv�wbZffZfiZflZffiZffl�stuմնuմեuմիuվնuմխ�a�g�j�k�o�t�u�v�w�x�yuαuδuζuηuλuνuξuοuτuχuψuω(����i0iIii�iEizi�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�iPiRiTiVi�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i� i!i!i!i	!i!i!i
!i!i!i!i!i!i!i!i!i!i!i !i!!i"!i$!i(!i,!i-!i0!i1!i3!i>!i?!iE!iq3is3iu3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i	�i
�i�i�i
�i�i�i�i�i�i�i�i�i�i�i�i�i4�i5�i6�i7�i8�i9�i:�i;�i<�i=�i>�i?�i@�iA�iB�iC�iD�iE�iF�iG�iH�iI�iJ�iK�iL�iM�ih�ii�ij�ik�il�im�in�io�ip�iq�ir�is�it�iu�iv�iw�ix�iy�iz�i{�i|�i}�i~�i�i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i�i�i�i�i	�i
�i
�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i8�i9�i;�i<�i=�i>�i@�iA�iB�iC�iD�iF�iJ�iK�iL�iM�iN�iO�iP�il�im�in�io�ip�iq�ir�is�it�iu�iv�iw�ix�iy�iz�i{�i|�i}�i~�i�i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i�i	�i
�i�i�i
�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i �i!�i<�i=�i>�i?�i@�iA�iB�iC�iD�iE�iF�iG�iH�iI�iJ�iK�iL�iM�iN�iO�iP�iQ�iR�iS�iT�iU�ip�iq�ir�is�it�iu�iv�iw�ix�iy�iz�i{�i|�i}�i~�i�i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i
�i�i�i�i�i �i!�i"�i#�i$�i%�i&�i'�i(�i)�i*�i+�i,�i-�i.�i/�i0�i1�i2�i3�i4�iG�iV�iW�iX�iY�iZ�i[�i\�i]�i^�i_�i`�ia�ib�ic�id�ie�if�ig�ih�ii�ij�ik�il�im�in�i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��cCs"t�t|��}|dk	r|S|��Sr)�
b3_exceptions�getr
�lower)rrrrr�map_table_b3�sr8cCsHt|�}t�d|�}d�dd�|D��}t�d|�}||kr@|S|SdS)NZNFKC�cSsg|]}t|��qSr)r8)�.0Zchrrr�
<listcomp>�sz map_table_b2.<locals>.<listcomp>)r8rZ	normalize�join)r(ZalrZblr
rrr�map_table_b2�sr=cCs|dkS)N� rrrrr�in_table_c11�sr?cCst�|�dko|dkS)N�Zsr>�rr	rrrr�in_table_c12�srBcCst�|�dkS)Nr@rArrrr�in_table_c11_c12�srCcCst|�dkot�|�dkS)N��Cc)r
rr	rrrr�in_table_c21�srFi�iii( i) id ij ip i��i��is�i{�cCs.t|�}|dkrdSt�|�dkr&dS|tkS)NrDFrET)r
rr	�c22_specialsrrrr�in_table_c22�srHcCst�|�dkpt|�tkS)NrE)rr	r
rGrrrr�in_table_c21_c22�s
�rIcCst�|�dkS)NZCorArrrr�in_table_c3�srJcCs0t|�}|dkrdS|dkr dSt|�d@dkS)NrFrTrr)r
rrrr�in_table_c4�srKcCst�|�dkS)NZCsrArrrr�in_table_c5�srLrcCst|�tkSr)r
�c6_setrrrr�in_table_c6�srNi�/i�/cCst|�tkSr)r
�c7_setrrrr�in_table_c7�srPi@iAi i i* i/ cCst|�tkSr)r
�c8_setrrrr�in_table_c8srRii i�cCst|�tkSr)r
�c9_setrrrr�in_table_c9srTcCst�|�dkS)N)�RZAL�rZ
bidirectionalrrrr�in_table_d1srWcCst�|�dkS)N�LrVrrrr�in_table_d2srYN)"�__doc__rrZunidata_version�AssertionErrorr�set�list�rangerrr5r8r=r?rBrCrFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrWrYrrrr�<module>sP,��&P,__pycache__/glob.cpython-38.pyc000064400000010371151153537560012344 0ustar00U

e5dA�@s�dZddlZddlZddlZddlZdddgZdd�dd�Zdd�d	d�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Ze�d�Ze�d�Zdd�Zdd�Zd d!�Zd"d�ZdS)#zFilename globbing utility.�N�glob�iglob�escapeF��	recursivecCstt||d��S)ayReturn a list of paths matching a pathname pattern.

    The pattern may contain simple shell-style wildcards a la
    fnmatch. However, unlike fnmatch, filenames starting with a
    dot are special cases that are not matched by '*' and '?'
    patterns.

    If recursive is true, the pattern '**' will match any files and
    zero or more directories and subdirectories.
    r)�listr)�pathnamer�r	�/usr/lib64/python3.8/glob.pyr
scCs:t�d||�t||d�}|r6t|�r6t|�}|r6t�|S)a�Return an iterator which yields the paths matching a pathname pattern.

    The pattern may contain simple shell-style wildcards a la
    fnmatch. However, unlike fnmatch, filenames starting with a
    dot are special cases that are not matched by '*' and '?'
    patterns.

    If recursive is true, the pattern '**' will match any files and
    zero or more directories and subdirectories.
    z	glob.globF)�sys�audit�_iglob�_isrecursive�next�AssertionError)rr�it�sr	r	r
rsccstj�|�\}}t|�sN|r t�|r8tj�|�rJ|Vntj�|�rJ|VdS|s�|rrt|�rrt|||�EdHnt	|||�EdHdS||kr�t|�r�t
||d�}n|g}t|�r�|r�t|�r�t}q�t	}nt}|D]&}||||�D]}tj�||�Vq�q�dS)NT)
�os�path�split�	has_magicr�lexists�isdirr�_glob2�_glob1r
�_glob0�join)rr�dironly�dirname�basename�dirsZglob_in_dir�namer	r	r
r
)s2r
cCs0tt||��}t|�s$dd�|D�}t�||�S)Ncss|]}t|�s|VqdS�N)�	_ishidden)�.0�xr	r	r
�	<genexpr>Tsz_glob1.<locals>.<genexpr>)r�_iterdirr#�fnmatch�filter)r�patternr�namesr	r	r
rQsrcCs8|stj�|�r4|gSntj�tj�||��r4|gSgSr")rrrrr)rrrr	r	r
rWsrcCst||d�S�NF)r�rr*r	r	r
�glob0dsr.cCst||d�Sr,)rr-r	r	r
�glob1gsr/ccs.t|�st�|dd�Vt||�EdHdS)Nr)rr�	_rlistdir)rr*rr	r	r
rmsrc
cs�|s"t|t�rttjd�}ntj}zRt�|��>}|D]2}z|rF|��rN|jVWq4tk
rdYq4Xq4W5QRXWntk
r�YdSXdS)N�ASCII)�
isinstance�bytesr�curdir�scandir�is_dirr!�OSError)rrr�entryr	r	r
r'ts
r'ccs`tt||��}|D]H}t|�s|V|r6tj�||�n|}t||�D]}tj�||�VqDqdSr")rr'r#rrrr0)rrr+r%r�yr	r	r
r0�sr0z([*?[])s([*?[])cCs(t|t�rt�|�}n
t�|�}|dk	Sr")r2r3�magic_check_bytes�search�magic_check)r�matchr	r	r
r�s

rcCs|ddkS)Nr)�.�.r	)rr	r	r
r#�sr#cCst|t�r|dkS|dkSdS)Ns**z**)r2r3)r*r	r	r
r�s
rcCs<tj�|�\}}t|t�r(t�d|�}nt�d|�}||S)z#Escape all special characters.
    s[\1]z[\1])rr�
splitdriver2r3r:�subr<)rZdriver	r	r
r�s

)�__doc__r�rer(r�__all__rrr
rrr.r/rr'r0�compiler<r:rr#rrr	r	r	r
�<module>s*

(



__pycache__/sunau.cpython-38.opt-1.pyc000064400000041272151153537560013517 0ustar00U

e5d�G�@s�dZddlmZddlZedd�ZdZdZdZd	Zd
Z	dZ
dZd
ZdZ
dZdZdZdZdZeeee	e
egZGdd�de�Zdd�Zdd�ZGdd�d�ZGdd�d�Zd"dd�Zd#d d!�ZdS)$a�Stuff to parse Sun and NeXT audio files.

An audio file consists of a header followed by the data.  The structure
of the header is as follows.

        +---------------+
        | magic word    |
        +---------------+
        | header size   |
        +---------------+
        | data size     |
        +---------------+
        | encoding      |
        +---------------+
        | sample rate   |
        +---------------+
        | # of channels |
        +---------------+
        | info          |
        |               |
        +---------------+

The magic word consists of the 4 characters '.snd'.  Apart from the
info field, all header fields are 4 bytes in size.  They are all
32-bit unsigned integers encoded in big-endian byte order.

The header size really gives the start of the data.
The data size is the physical size of the data.  From the other
parameters the number of frames can be calculated.
The encoding gives the way in which audio samples are encoded.
Possible values are listed below.
The info field currently consists of an ASCII string giving a
human-readable description of the audio file.  The info field is
padded with NUL bytes to the header size.

Usage.

Reading audio files:
        f = sunau.open(file, 'r')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods read(), seek(), and close().
When the setpos() and rewind() methods are not used, the seek()
method is not  necessary.

This returns an instance of a class with the following public methods:
        getnchannels()  -- returns number of audio channels (1 for
                           mono, 2 for stereo)
        getsampwidth()  -- returns sample width in bytes
        getframerate()  -- returns sampling frequency
        getnframes()    -- returns number of audio frames
        getcomptype()   -- returns compression type ('NONE' or 'ULAW')
        getcompname()   -- returns human-readable version of
                           compression type ('not compressed' matches 'NONE')
        getparams()     -- returns a namedtuple consisting of all of the
                           above in the above order
        getmarkers()    -- returns None (for compatibility with the
                           aifc module)
        getmark(id)     -- raises an error since the mark does not
                           exist (for compatibility with the aifc module)
        readframes(n)   -- returns at most n frames of audio
        rewind()        -- rewind to the beginning of the audio stream
        setpos(pos)     -- seek to the specified position
        tell()          -- return the current position
        close()         -- close the instance (make it unusable)
The position returned by tell() and the position given to setpos()
are compatible and have nothing to do with the actual position in the
file.
The close() method is called automatically when the class instance
is destroyed.

Writing audio files:
        f = sunau.open(file, 'w')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods write(), tell(), seek(), and
close().

This returns an instance of a class with the following public methods:
        setnchannels(n) -- set the number of channels
        setsampwidth(n) -- set the sample width
        setframerate(n) -- set the frame rate
        setnframes(n)   -- set the number of frames
        setcomptype(type, name)
                        -- set the compression type and the
                           human-readable compression type
        setparams(tuple)-- set all parameters at once
        tell()          -- return current position in output file
        writeframesraw(data)
                        -- write audio frames without pathing up the
                           file header
        writeframes(data)
                        -- write audio frames and patch up the file header
        close()         -- patch up the file header and close the
                           output file
You should set the parameters before the first writeframesraw or
writeframes.  The total number of frames does not need to be set,
but when it is set to the correct value, the header does not have to
be patched up.
It is best to first set all parameters, perhaps possibly the
compression type, and then write audio frames using writeframesraw.
When all frames have been written, either call writeframes(b'') or
close() to patch up the sizes in the header.
The close() method is called automatically when the class instance
is destroyed.
�)�
namedtupleN�
_sunau_paramsz7nchannels sampwidth framerate nframes comptype compnameidns.������������l��c@seZdZdS)�ErrorN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/sunau.pyr�srcCs8d}td�D]&}|�d�}|s"t�|dt|�}q|S)Nrrr�)�range�read�EOFError�ord)�file�x�iZbyterrr�	_read_u32�s
rcCsFg}td�D]&}t|d�\}}|�dt|��|}q|�t|��dS)Nrrr)r�divmod�insert�int�write�bytes)rr�datar�d�mrrr�
_write_u32�sr'c@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)S)*�Au_readcCs@t|�td�kr,ddl}|�|d�}d|_nd|_|�|�dS)N�r�rbTF��type�builtins�open�_opened�initfp��self�fr-rrr�__init__�szAu_read.__init__cCs|jr|��dS�N��_file�close�r2rrr�__del__�szAu_read.__del__cCs|Sr5rr9rrr�	__enter__�szAu_read.__enter__cGs|��dSr5�r8�r2�argsrrr�__exit__�szAu_read.__exit__c	Cs�||_d|_tt|��}|tkr(td��tt|��|_|jdkrHtd��|jdkrZtd��t|�|_|jtkrzt|j�|_tt|��|_	|j	t
kr�td��|j	ttfkr�d|_
d	|_nj|j	tkr�d	|_|_
nR|j	tkr�d|_|_
n:|j	tkr�d
|_|_
n"|j	tk�rd|_|_
ntd��tt|��|_tt|��|_|j�sLtd
��|j|j|_|jdk�r�|�|jd�|_|j�d�\|_}}nd|_z|��|_Wn ttfk
�r�d|_YnXdS)Nrzbad magic numberrzheader size too small�dzheader size ridiculously largezencoding not (yet) supportedrrrrzunknown encodingzbad # of channels��)r7�	_soundposr!r�AUDIO_FILE_MAGICrZ	_hdr_size�
_data_size�AUDIO_UNKNOWN_SIZE�	_encoding�_simple_encodings�AUDIO_FILE_ENCODING_MULAW_8�AUDIO_FILE_ENCODING_ALAW_8�
_sampwidth�
_framesize�AUDIO_FILE_ENCODING_LINEAR_8�AUDIO_FILE_ENCODING_LINEAR_16�AUDIO_FILE_ENCODING_LINEAR_24�AUDIO_FILE_ENCODING_LINEAR_32�
_framerate�
_nchannelsr�_info�	partition�tell�	_data_pos�AttributeError�OSError)r2r�magic�_rrrr0�sV




�


zAu_read.initfpcCs|jSr5)r7r9rrr�getfp�sz
Au_read.getfpcCs|jSr5)rRr9rrr�getnchannels�szAu_read.getnchannelscCs|jSr5)rKr9rrr�getsampwidth�szAu_read.getsampwidthcCs|jSr5)rQr9rrr�getframerate�szAu_read.getframeratecCs(|jtkrtS|jtkr$|j|jSdS�Nr)rErFrGrHrLr9rrr�
getnframes�s


zAu_read.getnframescCs$|jtkrdS|jtkrdSdSdS)N�ULAW�ALAW�NONE�rGrIrJr9rrr�getcomptype�s


zAu_read.getcomptypecCs$|jtkrdS|jtkrdSdSdS)N�CCITT G.711 u-law�CCITT G.711 A-law�not compressedrdr9rrr�getcompname�s


zAu_read.getcompnamecCs*t|��|��|��|��|��|���Sr5�rr\r]r^r`rerir9rrr�	getparamss�zAu_read.getparamscCsdSr5rr9rrr�
getmarkersszAu_read.getmarkerscCstd��dS)Nzno marks)r)r2�idrrr�getmarkszAu_read.getmarkcCsp|jtkrl|tkr|j��}n|j�||j�}|jt|�|j7_|jtkrhddl	}|�
||j�}|SdSr_)rGrHrFr7rrLrC�lenrI�audioopZulaw2linrK)r2�nframesr$rprrr�
readframess

zAu_read.readframescCs*|jdkrtd��|j�|j�d|_dS)N�cannot seekr)rVrXr7�seekrCr9rrr�rewinds
zAu_read.rewindcCs|jSr5)rCr9rrrrU!szAu_read.tellcCsP|dks||��krtd��|jdkr.td��|j�|j||j�||_dS)Nrzposition not in rangers)r`rrVrXr7rtrLrC)r2�posrrr�setpos$s
zAu_read.setposcCs"|j}|rd|_|jr|��dSr5)r7r/r8�r2rrrrr8,s
z
Au_read.closeN)rrrr4r:r;r?r0r[r\r]r^r`rerirkrlrnrrrurUrwr8rrrrr(�s(	.
r(c@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3S)4�Au_writecCs@t|�td�kr,ddl}|�|d�}d|_nd|_|�|�dS)Nr)r�wbTFr+r1rrrr45szAu_write.__init__cCs|jr|��d|_dSr5r6r9rrrr:>szAu_write.__del__cCs|Sr5rr9rrrr;CszAu_write.__enter__cGs|��dSr5r<r=rrrr?FszAu_write.__exit__cCsF||_d|_d|_d|_d|_t|_d|_d|_d|_	d|_
d|_dS)NrrBra)r7rQrRrKrLrF�_nframes�_nframeswritten�_datawritten�_datalengthrS�	_comptyperxrrrr0IszAu_write.initfpcCs(|jrtd��|dkrtd��||_dS)N�0cannot change parameters after starting to write)rrrz"only 1, 2, or 4 channels supported)r|rrR)r2�	nchannelsrrr�setnchannelsVs
zAu_write.setnchannelscCs|jstd��|jS)Nznumber of channels not set)rRrr9rrrr\]szAu_write.getnchannelscCs(|jrtd��|dkrtd��||_dS)Nr�)rrrrzbad sample width)r|rrK)r2�	sampwidthrrr�setsampwidthbs
zAu_write.setsampwidthcCs|jstd��|jS)N�sample width not specified)rQrrKr9rrrr]iszAu_write.getsampwidthcCs|jrtd��||_dS)Nr�)r|rrQ)r2�	frameraterrr�setframeratenszAu_write.setframeratecCs|jstd��|jS)Nzframe rate not set)rQrr9rrrr^sszAu_write.getframeratecCs(|jrtd��|dkrtd��||_dS)Nr�rz# of frames cannot be negative)r|rr{)r2rqrrr�
setnframesxs
zAu_write.setnframescCs|jSr5�r|r9rrrr`szAu_write.getnframescCs|dkr||_ntd��dS)N)rcrazunknown compression type)rr)r2r,�namerrr�setcomptype�szAu_write.setcomptypecCs|jSr5�rr9rrrre�szAu_write.getcomptypecCs$|jdkrdS|jdkrdSdSdS)Nrarfrbrgrhr�r9rrrri�s


zAu_write.getcompnamecCsH|\}}}}}}|�|�|�|�|�|�|�|�|�||�dSr5)r�r�r�r�r�)r2Zparamsr�r�r�rqZcomptypeZcompnamerrr�	setparams�s



zAu_write.setparamscCs*t|��|��|��|��|��|���Sr5rjr9rrrrk�s�zAu_write.getparamscCs|jSr5r�r9rrrrU�sz
Au_write.tellcCs~t|ttf�st|��d�}|��|jdkrDddl}|�||j	�}t
|�|j}|j�
|�|j||_|jt
|�|_dS)N�Brar)�
isinstancer#�	bytearray�
memoryview�cast�_ensure_header_writtenrrpZlin2ulawrKrorLr7r"r|r})r2r$rprqrrr�writeframesraw�s
zAu_write.writeframesrawcCs.|�|�|j|jks"|j|jkr*|��dSr5)r�r|r{r~r}�_patchheader)r2r$rrr�writeframes�s


�zAu_write.writeframescCs^|jrZz6|��|j|jks(|j|jkr0|��|j�	�W5|j}d|_|jrX|��XdSr5)
r7r/r8r�r|r{r~r}r��flushrxrrrr8�s
�zAu_write.closecCs<|js8|jstd��|js"td��|js0td��|��dS)Nz# of channels not specifiedr�zframe rate not specified)r|rRrrKrQ�
_write_headerr9rrrr��szAu_write._ensure_header_writtenc	Cs�|jdkrl|jdkr t}d|_q�|jdkr6t}d|_q�|jdkrLt}d|_q�|jdkrbt}d|_q�td��n|jdkr�t}d|_ntd��|j|j	|_t
|jt�dt
|j�}|d	d
@}t
|j|�|jtkr�t}n|j|j}z|j��|_Wn ttfk
�rd|_YnXt
|j|�||_t
|j|�t
|j|j�t
|j|j	�|j�|j�|j�d|t
|j�d�dS)
Nrcrrrrzinternal errorrar
r
i����rAr)rrKrMrLrNrOrPrrIrRr'r7rDrorSr{rFrU�_form_length_posrWrXr~rQr")r2�encoding�header_sizeZlengthrrrr��sJ







zAu_write._write_headercCsH|jdkrtd��|j�|j�t|j|j�|j|_|j�dd�dS)Nrsrr)r�rXr7rtr'r}r~r9rrrr��s
zAu_write._patchheaderN)rrrr4r:r;r?r0r�r\r�r]r�r^r�r`r�rerir�rkrUr�r�r8r�r�r�rrrrry3s2	

*rycCsJ|dkrt|d�r|j}nd}|dkr.t|�S|dkr>t|�Std��dS)N�moder*)�rr*)�wrzz$mode must be 'r', 'rb', 'w', or 'wb')�hasattrr�r(ryr�r3r�rrrr.s
r.cCstjdtdd�t||d�S)NzDsunau.openfp is deprecated since Python 3.7. Use sunau.open instead.r)�
stacklevel)r�)�warnings�warn�DeprecationWarningr.r�rrr�openfps
�r�)N)N)�__doc__�collectionsrr�rrDrIrMrNrOrPZAUDIO_FILE_ENCODING_FLOATZAUDIO_FILE_ENCODING_DOUBLEZAUDIO_FILE_ENCODING_ADPCM_G721ZAUDIO_FILE_ENCODING_ADPCM_G722Z AUDIO_FILE_ENCODING_ADPCM_G723_3Z AUDIO_FILE_ENCODING_ADPCM_G723_5rJrFrH�	Exceptionrrr'r(ryr.r�rrrr�<module>sFi��	Q

__pycache__/threading.cpython-38.opt-1.pyc000064400000115003151153537560014323 0ustar00U

e5d���@s2dZddlZddlZddlZddlmZddl	m
Z
ddlmZ
mZzddlmZWn ek
rtddlmZYnXddd	d
ddd
ddddddddddddddddgZejZejZejZejZzejZdZe�d�Wnek
r�d ZYnXej Z!z
ej"Z#Wnek
�rdZ#YnXej$Z$[da%da&d!d�Z'd"d�Z(eZ)d#d�Z"Gd$d%�d%�Z*e*Z+Gd&d	�d	�Z,Gd'd�d�Z-Gd(d�de-�Z.Gd)d�d�Z/Gd*d�d�Z0Gd+d�de1�Z2e�j3Z4e4�dLd-d.�Z5e�a6iZ7iZ8e
�Z9e�a:e;�a<Gd/d�d�Z=zdd0lm>a?m@ZAWnHek
�rVdd1lBmCZDdd2lmEZEeEdd3�Z@d4d�ZAd5d�a?YnXd6d7�ZFGd8d�de=�ZGGd9d:�d:e=�ZHGd;d<�d<e=�ZId=d
�ZJeJZKd>d�ZLeLZMd?d@�ZNdAd�ZOddBlmPZPeH�aQdCdD�ZRdEd�ZSzddFlmTZUWn"ek
�rddGlVmUZUYnXdHdI�ZWeXedJ��r.ejYeWdK�dS)Mz;Thread module emulating a subset of Java's threading model.�N)�	monotonic)�WeakSet)�islice�count)�deque�	get_ident�active_count�	Condition�current_thread�	enumerate�main_thread�TIMEOUT_MAX�Event�Lock�RLock�	Semaphore�BoundedSemaphore�Thread�Barrier�BrokenBarrierError�Timer�ThreadError�
setprofile�settrace�local�
stack_size�
excepthook�ExceptHookArgsT�
get_native_idFcCs|adS)z�Set a profile function for all threads started from the threading module.

    The func will be passed to sys.setprofile() for each thread, before its
    run() method is called.

    N)�
_profile_hook��func�r"�!/usr/lib64/python3.8/threading.pyr9scCs|adS)z�Set a trace function for all threads started from the threading module.

    The func will be passed to sys.settrace() for each thread, before its run()
    method is called.

    N)�_trace_hookr r"r"r#rCscOstdkrt||�St||�S)a2Factory function that returns a new reentrant lock.

    A reentrant lock must be released by the thread that acquired it. Once a
    thread has acquired a reentrant lock, the same thread may acquire it again
    without blocking; the thread must release it once for each time it has
    acquired it.

    N)�_CRLock�_PyRLock)�args�kwargsr"r"r#rQs	
c@sVeZdZdZdd�Zdd�Zddd	�ZeZd
d�Zdd
�Z	dd�Z
dd�Zdd�ZdS)�_RLocka,This class implements reentrant lock objects.

    A reentrant lock must be released by the thread that acquired it. Once a
    thread has acquired a reentrant lock, the same thread may acquire it
    again without blocking; the thread must release it once for each time it
    has acquired it.

    cCst�|_d|_d|_dS�Nr)�_allocate_lock�_block�_owner�_count��selfr"r"r#�__init__hsz_RLock.__init__c	Cs^|j}zt|j}Wntk
r(YnXd|j��r:dnd|jj|jj||j	t
t|��fS)Nz)<%s %s.%s object owner=%r count=%d at %s>�lockedZunlocked)r-�_active�name�KeyErrorr,r2�	__class__�
__module__�__qualname__r.�hex�id)r0�ownerr"r"r#�__repr__ms
�z_RLock.__repr__T���cCsDt�}|j|kr"|jd7_dS|j�||�}|r@||_d|_|S)aAcquire a lock, blocking or non-blocking.

        When invoked without arguments: if this thread already owns the lock,
        increment the recursion level by one, and return immediately. Otherwise,
        if another thread owns the lock, block until the lock is unlocked. Once
        the lock is unlocked (not owned by any thread), then grab ownership, set
        the recursion level to one, and return. If more than one thread is
        blocked waiting until the lock is unlocked, only one at a time will be
        able to grab ownership of the lock. There is no return value in this
        case.

        When invoked with the blocking argument set to true, do the same thing
        as when called without arguments, and return true.

        When invoked with the blocking argument set to false, do not block. If a
        call without an argument would block, return false immediately;
        otherwise, do the same thing as when called without arguments, and
        return true.

        When invoked with the floating-point timeout argument set to a positive
        value, block for at most the number of seconds specified by timeout
        and as long as the lock cannot be acquired.  Return true if the lock has
        been acquired, false if the timeout has elapsed.

        �)rr-r.r,�acquire)r0�blocking�timeout�me�rcr"r"r#r?|s
z_RLock.acquirecCs<|jt�krtd��|jd|_}|s8d|_|j��dS)amRelease a lock, decrementing the recursion level.

        If after the decrement it is zero, reset the lock to unlocked (not owned
        by any thread), and if any other threads are blocked waiting for the
        lock to become unlocked, allow exactly one of them to proceed. If after
        the decrement the recursion level is still nonzero, the lock remains
        locked and owned by the calling thread.

        Only call this method when the calling thread owns the lock. A
        RuntimeError is raised if this method is called when the lock is
        unlocked.

        There is no return value.

        �cannot release un-acquired lockr>N)r-r�RuntimeErrorr.r,�release)r0rr"r"r#rF�sz_RLock.releasecCs|��dS�N�rF�r0�t�v�tbr"r"r#�__exit__�sz_RLock.__exit__cCs|j��|\|_|_dSrG)r,r?r.r-)r0�stater"r"r#�_acquire_restore�s
z_RLock._acquire_restorecCs<|jdkrtd��|j}d|_|j}d|_|j��||fS)NrrD)r.rEr-r,rF)r0rr;r"r"r#�
_release_save�s

z_RLock._release_savecCs|jt�kSrG)r-rr/r"r"r#�	_is_owned�sz_RLock._is_ownedN)Tr=)
�__name__r7r8�__doc__r1r<r?�	__enter__rFrMrOrPrQr"r"r"r#r)^s	
$
r)c@steZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
ddd�Zddd�Zddd�Z
dd�ZeZdS)r	ajClass that implements a condition variable.

    A condition variable allows one or more threads to wait until they are
    notified by another thread.

    If the lock argument is given and not None, it must be a Lock or RLock
    object, and it is used as the underlying lock. Otherwise, a new RLock object
    is created and used as the underlying lock.

    NcCs�|dkrt�}||_|j|_|j|_z|j|_Wntk
rDYnXz|j|_Wntk
rfYnXz|j|_Wntk
r�YnXt�|_	dSrG)
r�_lockr?rFrP�AttributeErrorrOrQ�_deque�_waiters�r0�lockr"r"r#r1�s$zCondition.__init__cCs
|j��SrG)rUrTr/r"r"r#rT�szCondition.__enter__cGs|jj|�SrG)rUrM)r0r'r"r"r#rM�szCondition.__exit__cCsd|jt|j�fS)Nz<Condition(%s, %d)>)rU�lenrXr/r"r"r#r<�szCondition.__repr__cCs|j��dSrG)rUrFr/r"r"r#rP�szCondition._release_savecCs|j��dSrG)rUr?)r0�xr"r"r#rOszCondition._acquire_restorecCs"|j�d�r|j��dSdSdS)NrFT)rUr?rFr/r"r"r#rQs
zCondition._is_ownedcCs�|��std��t�}|��|j�|�|��}d}z>|dkrN|��d}n |dkrd|�d|�}n
|�d�}|W�S|�|�|s�z|j�|�Wnt	k
r�YnXXdS)akWait until notified or until a timeout occurs.

        If the calling thread has not acquired the lock when this method is
        called, a RuntimeError is raised.

        This method releases the underlying lock, and then blocks until it is
        awakened by a notify() or notify_all() call for the same condition
        variable in another thread, or until the optional timeout occurs. Once
        awakened or timed out, it re-acquires the lock and returns.

        When the timeout argument is present and not None, it should be a
        floating point number specifying a timeout for the operation in seconds
        (or fractions thereof).

        When the underlying lock is an RLock, it is not released using its
        release() method, since this may not actually unlock the lock when it
        was acquired multiple times recursively. Instead, an internal interface
        of the RLock class is used, which really unlocks it even when it has
        been recursively acquired several times. Another internal interface is
        then used to restore the recursion level when the lock is reacquired.

        zcannot wait on un-acquired lockFNTr)
rQrEr+r?rX�appendrPrO�remove�
ValueError)r0rA�waiterZsaved_stateZgotitr"r"r#�waits*

zCondition.waitcCsXd}|}|�}|sT|dk	rB|dkr.t�|}n|t�}|dkrBqT|�|�|�}q|S)z�Wait until a condition evaluates to True.

        predicate should be a callable which result will be interpreted as a
        boolean value.  A timeout may be provided giving the maximum time to
        wait.

        Nr)�_timera)r0Z	predicaterA�endtimeZwaittime�resultr"r"r#�wait_for>s

zCondition.wait_forr>c	Csf|��std��|j}tt||��}|s,dS|D]0}|��z|�|�Wq0tk
r^Yq0Xq0dS)aKWake up one or more threads waiting on this condition, if any.

        If the calling thread has not acquired the lock when this method is
        called, a RuntimeError is raised.

        This method wakes up at most n of the threads waiting for the condition
        variable; it is a no-op if no threads are waiting.

        z!cannot notify on un-acquired lockN)rQrErXrW�_islicerFr^r_)r0�nZall_waitersZwaiters_to_notifyr`r"r"r#�notifyUs
zCondition.notifycCs|�t|j��dS)z�Wake up all threads waiting on this condition.

        If the calling thread has not acquired the lock when this method
        is called, a RuntimeError is raised.

        N)rhr[rXr/r"r"r#�
notify_alllszCondition.notify_all)N)N)N)r>)rRr7r8rSr1rTrMr<rPrOrQrarerhriZ	notifyAllr"r"r"r#r	�s
	
0

	c@s8eZdZdZd
dd�Zddd�ZeZd	d
�Zdd�ZdS)raGThis class implements semaphore objects.

    Semaphores manage a counter representing the number of release() calls minus
    the number of acquire() calls, plus an initial value. The acquire() method
    blocks if necessary until it can return without making the counter
    negative. If not given, value defaults to 1.

    r>cCs&|dkrtd��tt��|_||_dS)Nrz$semaphore initial value must be >= 0)r_r	r�_cond�_value�r0�valuer"r"r#r1�szSemaphore.__init__TNc	Cs�|s|dk	rtd��d}d}|j�f|jdkrr|s4q�|dk	rd|dkrPt�|}n|t�}|dkrdq�|j�|�q$|jd8_d}W5QRX|S)a�Acquire a semaphore, decrementing the internal counter by one.

        When invoked without arguments: if the internal counter is larger than
        zero on entry, decrement it by one and return immediately. If it is zero
        on entry, block, waiting until some other thread has called release() to
        make it larger than zero. This is done with proper interlocking so that
        if multiple acquire() calls are blocked, release() will wake exactly one
        of them up. The implementation may pick one at random, so the order in
        which blocked threads are awakened should not be relied on. There is no
        return value in this case.

        When invoked with blocking set to true, do the same thing as when called
        without arguments, and return true.

        When invoked with blocking set to false, do not block. If a call without
        an argument would block, return false immediately; otherwise, do the
        same thing as when called without arguments, and return true.

        When invoked with a timeout other than None, it will block for at
        most timeout seconds.  If acquire does not complete successfully in
        that interval, return false.  Return true otherwise.

        Nz.can't specify timeout for non-blocking acquireFrr>T)r_rjrkrbra)r0r@rArCrcr"r"r#r?�s$

zSemaphore.acquirec	Cs.|j�|jd7_|j��W5QRXdS)z�Release a semaphore, incrementing the internal counter by one.

        When the counter is zero on entry and another thread is waiting for it
        to become larger than zero again, wake up that thread.

        r>N)rjrkrhr/r"r"r#rF�szSemaphore.releasecCs|��dSrGrHrIr"r"r#rM�szSemaphore.__exit__)r>)TN)	rRr7r8rSr1r?rTrFrMr"r"r"r#rxs

-c@s"eZdZdZddd�Zdd�ZdS)	ra�Implements a bounded semaphore.

    A bounded semaphore checks to make sure its current value doesn't exceed its
    initial value. If it does, ValueError is raised. In most situations
    semaphores are used to guard resources with limited capacity.

    If the semaphore is released too many times it's a sign of a bug. If not
    given, value defaults to 1.

    Like regular semaphores, bounded semaphores manage a counter representing
    the number of release() calls minus the number of acquire() calls, plus an
    initial value. The acquire() method blocks if necessary until it can return
    without making the counter negative. If not given, value defaults to 1.

    r>cCst�||�||_dSrG)rr1�_initial_valuerlr"r"r#r1�szBoundedSemaphore.__init__c	CsB|j�2|j|jkrtd��|jd7_|j��W5QRXdS)a6Release a semaphore, incrementing the internal counter by one.

        When the counter is zero on entry and another thread is waiting for it
        to become larger than zero again, wake up that thread.

        If the number of releases exceeds the number of acquires,
        raise a ValueError.

        z!Semaphore released too many timesr>N)rjrkrnr_rhr/r"r"r#rF�s

zBoundedSemaphore.releaseN)r>)rRr7r8rSr1rFr"r"r"r#r�s
c@sFeZdZdZdd�Zdd�Zdd�ZeZdd	�Zd
d�Z	dd
d�Z
dS)rz�Class implementing event objects.

    Events manage a flag that can be set to true with the set() method and reset
    to false with the clear() method. The wait() method blocks until the flag is
    true.  The flag is initially false.

    cCstt��|_d|_dS)NF)r	rrj�_flagr/r"r"r#r1�szEvent.__init__cCs|j�t��dSrG)rjr1rr/r"r"r#�_reset_internal_locks�szEvent._reset_internal_lockscCs|jS)z5Return true if and only if the internal flag is true.)ror/r"r"r#�is_setszEvent.is_setc	Cs&|j�d|_|j��W5QRXdS)z�Set the internal flag to true.

        All threads waiting for it to become true are awakened. Threads
        that call wait() once the flag is true will not block at all.

        TN)rjrorir/r"r"r#�setsz	Event.setc	Cs|j�d|_W5QRXdS)z�Reset the internal flag to false.

        Subsequently, threads calling wait() will block until set() is called to
        set the internal flag to true again.

        FN)rjror/r"r"r#�clearszEvent.clearNc
Cs8|j�(|j}|s|j�|�}|W5QR�SQRXdS)aHBlock until the internal flag is true.

        If the internal flag is true on entry, return immediately. Otherwise,
        block until another thread calls set() to set the flag to true, or until
        the optional timeout occurs.

        When the timeout argument is present and not None, it should be a
        floating point number specifying a timeout for the operation in seconds
        (or fractions thereof).

        This method returns the internal flag on exit, so it will always return
        True except if a timeout is given and the operation times out.

        N)rjrora)r0rAZsignaledr"r"r#ras
z
Event.wait)N)rRr7r8rSr1rprqZisSetrrrsrar"r"r"r#r�s

c@s�eZdZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Ze
dd��Ze
dd��Ze
dd��ZdS)rz�Implements a Barrier.

    Useful for synchronizing a fixed number of threads at known synchronization
    points.  Threads block on 'wait()' and are simultaneously awoken once they
    have all made that call.

    NcCs.tt��|_||_||_||_d|_d|_dS)aWCreate a barrier, initialised to 'parties' threads.

        'action' is a callable which, when supplied, will be called by one of
        the threads after they have all entered the barrier and just prior to
        releasing them all. If a 'timeout' is provided, it is used as the
        default for all subsequent 'wait()' calls.

        rN)r	rrj�_action�_timeout�_parties�_stater.)r0�parties�actionrAr"r"r#r1Fs	zBarrier.__init__c
Cs�|dkr|j}|j�r|��|j}|jd7_z6|d|jkrL|��n
|�|�|W�W5QR�S|jd8_|��XW5QRXdS)aNWait for the barrier.

        When the specified number of threads have started waiting, they are all
        simultaneously awoken. If an 'action' was provided for the barrier, one
        of the threads will have executed that callback prior to returning.
        Returns an individual index number from 0 to 'parties-1'.

        Nr>)rurj�_enterr.�_exitrv�_release�_wait)r0rA�indexr"r"r#raVs	

zBarrier.waitcCs(|jdkr|j��q|jdkr$t�dS)N�r=r>r)rwrjrarr/r"r"r#rzts


zBarrier._entercCs>z"|jr|��d|_|j��Wn|���YnXdS)Nr>)rtrwrjri�_breakr/r"r"r#r|szBarrier._releasecs4�j��fdd�|�s"���t��jdkr0t�dS)Ncs
�jdkSr*�rwr"r/r"r#�<lambda>��zBarrier._wait.<locals>.<lambda>r)rjrer�rrw�r0rAr"r/r#r}�s
z
Barrier._waitcCs(|jdkr$|jdkr$d|_|j��dS)Nrr)r.rwrjrir/r"r"r#r{�s

z
Barrier._exitc	CsT|j�D|jdkr6|jdkr$d|_q<|jdkr<d|_nd|_|j��W5QRXdS)z�Reset the barrier to the initial state.

        Any threads currently waiting will get the BrokenBarrier exception
        raised.

        rr=���N)rjr.rwrir/r"r"r#�reset�s


z
Barrier.resetc	Cs|j�|��W5QRXdS)z�Place the barrier into a 'broken' state.

        Useful in case of error.  Any currently waiting threads and threads
        attempting to 'wait()' will have BrokenBarrierError raised.

        N)rjr�r/r"r"r#�abort�sz
Barrier.abortcCsd|_|j��dS)Nr�)rwrjrir/r"r"r#r��szBarrier._breakcCs|jS)z:Return the number of threads required to trip the barrier.)rvr/r"r"r#rx�szBarrier.partiescCs|jdkr|jSdS)z>Return the number of threads currently waiting at the barrier.r)rwr.r/r"r"r#�	n_waiting�s
zBarrier.n_waitingcCs
|jdkS)z0Return True if the barrier is in a broken state.r�r�r/r"r"r#�broken�szBarrier.broken)NN)N)rRr7r8rSr1rarzr|r}r{r�r�r��propertyrxr�r�r"r"r"r#r=s 




c@seZdZdS)rN)rRr7r8r"r"r"r#r�s�	Thread-%dcCs
|t�SrG)�_counter)�templater"r"r#�_newname�sr�c@seZdZdZdZd:dd�dd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zer\dd�Z
dd�Zdd�Zdd�Zdd�Zd;dd�Zd<d"d#�Zed$d%��Zejd&d%��Zed'd(��Zer�ed)d*��Zd+d,�Zd-d.�Zed/d0��Zejd1d0��Zd2d3�Zd4d5�Zd6d7�Zd8d9�ZdS)=raA class that represents a thread of control.

    This class can be safely subclassed in a limited fashion. There are two ways
    to specify the activity: by passing a callable object to the constructor, or
    by overriding the run() method in a subclass.

    FNr"��daemoncCs�|dkri}||_t|pt��|_||_||_|dk	r>||_n
t�j|_d|_	t
rXd|_d|_t
�|_d|_d|_tj|_t�|_t�|�dS)aKThis constructor should always be called with keyword arguments. Arguments are:

        *group* should be None; reserved for future extension when a ThreadGroup
        class is implemented.

        *target* is the callable object to be invoked by the run()
        method. Defaults to None, meaning nothing is called.

        *name* is the thread name. By default, a unique name is constructed of
        the form "Thread-N" where N is a small decimal number.

        *args* is the argument tuple for the target invocation. Defaults to ().

        *kwargs* is a dictionary of keyword arguments for the target
        invocation. Defaults to {}.

        If a subclass overrides the constructor, it must make sure to invoke
        the base class constructor (Thread.__init__()) before doing anything
        else to the thread.

        NFT)�_target�strr��_name�_args�_kwargs�	_daemonicr
r��_ident�_HAVE_THREAD_NATIVE_ID�
_native_id�_tstate_lockr�_started�_is_stopped�_initialized�_sys�stderr�_stderr�_make_invoke_excepthook�_invoke_excepthook�	_dangling�add)r0�group�targetr4r'r(r�r"r"r#r1�s&
zThread.__init__cCs(|j��|r|��nd|_d|_dS�NT)r�rp�_set_tstate_lockr�r�)r0�is_aliver"r"r#rp(s


zThread._reset_internal_lockscCs^d}|j��rd}|��|jr$d}|jr2|d7}|jdk	rJ|d|j7}d|jj|j|fS)N�initialZstartedZstoppedz daemonz %sz<%s(%s, %s)>)	r�rqr�r�r�r�r6rRr�)r0Zstatusr"r"r#r<4s

zThread.__repr__cCs�|jstd��|j��r td��t�|t|<W5QRXzt|jd�Wn,tk
rtt�t|=W5QRX�YnX|j�	�dS)a-Start the thread's activity.

        It must be called at most once per thread object. It arranges for the
        object's run() method to be invoked in a separate thread of control.

        This method will raise a RuntimeError if called more than once on the
        same thread object.

        zthread.__init__() not calledz threads can only be started oncer"N)
r�rEr�rq�_active_limbo_lock�_limbo�_start_new_thread�
_bootstrap�	Exceptionrar/r"r"r#�startBs

zThread.startcCs.z|jr|j|j|j�W5|`|`|`XdS)aXMethod representing the thread's activity.

        You may override this method in a subclass. The standard run() method
        invokes the callable object passed to the object's constructor as the
        target argument, if any, with sequential and keyword arguments taken
        from the args and kwargs arguments, respectively.

        N)r�r�r�r/r"r"r#�run[s	z
Thread.runcCs4z|��Wn"|jr(tdkr(YdS�YnXdSrG)�_bootstrap_innerr�r�r/r"r"r#r�ls
zThread._bootstrapcCst�|_dSrG)rr�r/r"r"r#�
_set_ident�szThread._set_identcCst�|_dSrG)rr�r/r"r"r#�_set_native_id�szThread._set_native_idc	Cs8t�|_|j��|js4t�t�|j�W5QRXdS)z�
        Set a lock object which will be released by the interpreter when
        the underlying thread state (see pystate.h) gets deleted.
        N)�
_set_sentinelr�r?r��_shutdown_locks_lock�_shutdown_locksr�r/r"r"r#r��s

zThread._set_tstate_lockcCs�z�|��|��tr|��|j��t�|t|j	<t
|=W5QRXtrVt�
t�trdt�t�z|��Wn|�|�YnXW5t� ztt�=WnYnXW5QRXXdSrG)r�r3rr�r�r�r�r�rrr�r�r$r�rrrr�r�r/r"r"r#r��s,



zThread._bootstrap_innerc	Cs>|j}|dk	rd|_d|_|js:t�t�|�W5QRXdSr�)r�r�r�r�r��discardrYr"r"r#�_stop�szThread._stopc	Cst�tt�=W5QRXdS)zARemove current thread from the dict of currently running threads.N)r�r3rr/r"r"r#�_delete�szThread._deletecCsZ|jstd��|j��s td��|t�kr2td��|dkrD|��n|jt|d�d�dS)aWait until the thread terminates.

        This blocks the calling thread until the thread whose join() method is
        called terminates -- either normally or through an unhandled exception
        or until the optional timeout occurs.

        When the timeout argument is present and not None, it should be a
        floating point number specifying a timeout for the operation in seconds
        (or fractions thereof). As join() always returns None, you must call
        is_alive() after join() to decide whether a timeout happened -- if the
        thread is still alive, the join() call timed out.

        When the timeout argument is not present or None, the operation will
        block until the thread terminates.

        A thread can be join()ed many times.

        join() raises a RuntimeError if an attempt is made to join the current
        thread as that would cause a deadlock. It is also an error to join() a
        thread before it has been started and attempts to do so raises the same
        exception.

        �Thread.__init__() not calledz'cannot join thread before it is startedzcannot join current threadNr)rA)r�rEr�rqr
�_wait_for_tstate_lock�maxr�r"r"r#�join�s


zThread.joinTr=cCs0|j}|dkrn|�||�r,|��|��dSrG)r�r?rFr�)r0�blockrArZr"r"r#r��szThread._wait_for_tstate_lockcCs|jS)z�A string used for identification purposes only.

        It has no semantics. Multiple threads may be given the same name. The
        initial name is set by the constructor.

        )r�r/r"r"r#r4s	zThread.namecCst|�|_dSrG)r�r��r0r4r"r"r#r4scCs|jS)a4Thread identifier of this thread or None if it has not been started.

        This is a nonzero integer. See the get_ident() function. Thread
        identifiers may be recycled when a thread exits and another thread is
        created. The identifier is available even after the thread has exited.

        )r�r/r"r"r#�idents
zThread.identcCs|jS)z�Native integral thread ID of this thread, or None if it has not been started.

            This is a non-negative integer. See the get_native_id() function.
            This represents the Thread ID as reported by the kernel.

            )r�r/r"r"r#�	native_id$s	zThread.native_idcCs&|js|j��sdS|�d�|jS)z�Return whether the thread is alive.

        This method returns True just before the run() method starts until just
        after the run() method terminates. The module function enumerate()
        returns a list of all alive threads.

        F)r�r�rqr�r/r"r"r#r�/s	
zThread.is_alivecCs ddl}|jdtdd�|��S)zhReturn whether the thread is alive.

        This method is deprecated, use is_alive() instead.
        rNz/isAlive() is deprecated, use is_alive() instead�)�
stacklevel)�warnings�warn�DeprecationWarningr�)r0r�r"r"r#�isAlive=s�zThread.isAlivecCs|jS)a�A boolean value indicating whether this thread is a daemon thread.

        This must be set before start() is called, otherwise RuntimeError is
        raised. Its initial value is inherited from the creating thread; the
        main thread is not a daemon thread and therefore all threads created in
        the main thread default to daemon = False.

        The entire Python program exits when only daemon threads are left.

        )r�r/r"r"r#r�Gs
z
Thread.daemoncCs*|jstd��|j��r td��||_dS)Nr�z)cannot set daemon status of active thread)r�rEr�rqr��r0Zdaemonicr"r"r#r�Vs

cCs|jSrGr�r/r"r"r#�isDaemon^szThread.isDaemoncCs
||_dSrGr�r�r"r"r#�	setDaemonaszThread.setDaemoncCs|jSrG�r4r/r"r"r#�getNamedszThread.getNamecCs
||_dSrGr�r�r"r"r#�setNamegszThread.setName)NNNr"N)N)Tr=) rRr7r8rSr�r1rpr<r�r�r�r�r�r�r�r�r�r�r�r�r�r4�setterr�r�r�r�r�r�r�r�r�r"r"r"r#r�sR��/	
&









)�_excepthook�_ExceptHookArgs)�print_exception)�
namedtuplez'exc_type exc_value exc_traceback threadcCst|�SrG)r�)r'r"r"r#rwscCs�|jtkrdStdk	r(tjdk	r(tj}n$|jdk	rH|jj}|dkrLdSndS|jdk	r`|jj}nt�}td|�d�|dd�t	|j|j
|j|d�|��dS)z9
        Handle uncaught Thread.run() exception.
        NzException in thread �:T��file�flush)r�)
�exc_type�
SystemExitr�r��threadr�r4r�print�_print_exception�	exc_value�
exc_tracebackr�)r'r�r4r"r"r#rzs(



��csPt�tj��dkrtd���dkr*td��tj�t�t������fdd�}|S)Nzthreading.excepthook is Nonezsys.excepthook is Nonec
s�z�z,t}|dkr�}t��|f��}||�Wn�tk
r�}zbd|_~�dk	rb�jdk	rb�j}n|j}�d|dd��dk	r��jdk	r��j}n�}|���W5d}~XYnXW5d}XdS)NTz"Exception in threading.excepthook:r�)rrr��__suppress_context__r�r�)r�r'�hook�excr�Zsys_excepthook�Zlocal_printZ	local_sysZold_excepthookZold_sys_excepthookZsys_exc_infor"r#�invoke_excepthook�s*� z2_make_invoke_excepthook.<locals>.invoke_excepthook)rr�rE�exc_infor�)r�r"r�r#r��s r�c@s*eZdZdZd	dd�Zdd�Zdd�ZdS)
rz�Call a function after a specified number of seconds:

            t = Timer(30.0, f, args=None, kwargs=None)
            t.start()
            t.cancel()     # stop the timer's action if it's still waiting

    NcCsFt�|�||_||_|dk	r"|ng|_|dk	r4|ni|_t�|_dSrG)rr1�interval�functionr'r(r�finished)r0r�r�r'r(r"r"r#r1�s
zTimer.__init__cCs|j��dS)z)Stop the timer if it hasn't finished yet.N)r�rrr/r"r"r#�cancel�szTimer.cancelcCs6|j�|j�|j��s(|j|j|j�|j��dSrG)r�rar�rqr�r'r(rrr/r"r"r#r��s
z	Timer.run)NN)rRr7r8rSr1r�r�r"r"r"r#r�s
c@seZdZdd�ZdS)�_MainThreadc	CsTtj|ddd�|��|j��|��tr6|��t�|t	|j
<W5QRXdS)NZ
MainThreadF�r4r�)rr1r�r�rrr�r�r�r�r3r�r/r"r"r#r1�s
z_MainThread.__init__N)rRr7r8r1r"r"r"r#r��sr�c@s.eZdZdd�Zdd�Zdd�Zd
dd	�ZdS)�_DummyThreadc	CsPtj|td�dd�|j��|��tr2|��t�|t	|j
<W5QRXdS)NzDummy-%dTr�)rr1r�r�rrr�r�r�r�r3r�r/r"r"r#r1s
z_DummyThread.__init__cCsdSrGr"r/r"r"r#r�
sz_DummyThread._stopcCsdSr�r"r/r"r"r#r�sz_DummyThread.is_aliveNcCsdSrGr"r�r"r"r#r�sz_DummyThread.join)N)rRr7r8r1r�r�r�r"r"r"r#r�s
r�cCs,ztt�WStk
r&t�YSXdS)z�Return the current Thread object, corresponding to the caller's thread of control.

    If the caller's thread of control was not created through the threading
    module, a dummy thread object with limited functionality is returned.

    N)r3rr5r�r"r"r"r#r
sc
Cs,t�tt�tt�W5QR�SQRXdS)z�Return the number of Thread objects currently alive.

    The returned count is equal to the length of the list returned by
    enumerate().

    N)r�r[r3r�r"r"r"r#r(scCstt���tt���SrG)�listr3�valuesr�r"r"r"r#�
_enumerate4sr�c
Cs4t�&tt���tt���W5QR�SQRXdS)z�Return a list of all Thread objects currently alive.

    The list includes daemonic threads, dummy thread objects created by
    current_thread(), and the main thread. It excludes terminated threads and
    threads that have not yet been started.

    N)r�r�r3r�r�r"r"r"r#r8s)rc	Csftjr
dStj}|��t��t�tt�}t��W5QRX|sFqb|D]}|�	�|��qJq dS)zS
    Wait until the Python thread state of all non-daemon threads get deleted.
    N)
�_main_threadr�r�rFr�r�r�r�rsr?)ZtlockZlocksrZr"r"r#�	_shutdownKs	r�cCstS)z�Return the main thread object.

    In normal conditions, the main thread is the thread from which the
    Python interpreter was started.
    )r�r"r"r"r#rss)�_local)rc	Cs�t�ai}ztt�}Wntk
r2t�}YnX|at�at�a	t�xtt
��}|�t�|D]>}||kr�|�
d�t�}||_|||<qb|�
d�|��qbt��t��t�|�W5QRXdS)zL
    Cleanup threading module state that should not exist after a fork.
    TFN)r+r�r3rr5r�r�r�rrr�r��updater�rpr�r�r�rs)Z
new_activeZcurrentZthreadsr�r�r"r"r#�_after_fork�s0






r��register_at_fork)Zafter_in_child)r�)ZrS�os�_os�sysr��_thread�timerrbZ_weakrefsetr�	itertoolsrrfrr.�_collectionsrrW�ImportError�collections�__all__�start_new_threadr��
allocate_lockr+r�rrr�r]rV�errorrrr%r
rr$rrrr)r&r	rrrrrEr�__next__r�r�r�r3r�r�r�rrr�rr�rr�r�	tracebackr�r�r�r�rr�r�r
Z
currentThreadrZactiveCountr�rrr�r�rr�rZ_threading_localr��hasattrr�r"r"r"r#�<module>s��




q'P&O
�5
(5__pycache__/pprint.cpython-38.opt-2.pyc000064400000033377151153537560013710 0ustar00U

e5d�S�
@s�ddlZddlZddlZddlZddlmZ	ddddddd	gZ
d$dd
d�dd�Zd%dd
d�dd�Zdd�dd	�Z
dd�Zdd�Zdd�ZGdd�d�Zdd�ZGdd�d�Zdd�Zeeeeeeeeed�h�Zdd�Zd&dd �Z d!d"�Z!e"d#k�r�e �dS)'�N)�StringIO�pprint�pformat�
isreadable�isrecursive�saferepr�
PrettyPrinter�pp��PFT��compact�
sort_dictscCs"t||||||d�}|�|�dS)N)�stream�indent�width�depthr
r)rr)�objectrrrrr
rZprinter�r�/usr/lib64/python3.8/pprint.pyr/s�cCst|||||d��|�S)N)rrrr
r)rr)rrrrr
rrrrr7s��)rcOst|f|�d|i|��dS)Nr)r)rr�args�kwargsrrrr	=scCst|iddd�dS)NrT��
_safe_repr�rrrrrAscCst|iddd�dS)NrTr
rrrrrrEscCst|iddd�dS)NrT�rrrrrrIsc@s"eZdZdgZdd�Zdd�ZdS)�	_safe_key�objcCs
||_dS�N)r)�selfrrrr�__init__Ysz_safe_key.__init__cCsXz|j|jkWStk
rRtt|j��t|j�ftt|j��t|j�fkYSXdSr)r�	TypeError�str�type�id)r�otherrrr�__lt__\s�z_safe_key.__lt__N)�__name__�
__module__�__qualname__�	__slots__r r&rrrrrMs
rcCst|d�t|d�fS)Nrr
)r)�trrr�_safe_tuplecsr,c@s�eZdZd;ddd�dd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�ZiZ	dd�Z
e
e	ej<dd�Z
e
e	ejj<dd�Zee	ej<dd�Zee	ej<dd�Zee	ej<ee	ej<dd�Zee	ej<dd �Zee	ej<d!d"�Zee	ej<d#d$�Zee	ejj<d%d&�Z d'd(�Z!d)d*�Z"d+d,�Z#d-d.�Z$e$e	ej%j<d/d0�Z&e&e	ej'j<d1d2�Z(e(e	ej)j<d3d4�Z*e*e	ej+j<d5d6�Z,e,e	ej-j<d7d8�Z.e.e	ej/j<d9d:�Z0e0e	ej1j<dS)<rr
rNFTrcCs�t|�}t|�}|dkr td��|dk	r8|dkr8td��|sDtd��||_||_||_|dk	rf||_ntj|_t|�|_	||_
dS)Nrzindent must be >= 0zdepth must be > 0zwidth must be != 0)�int�
ValueError�_depth�_indent_per_level�_width�_stream�_sys�stdout�bool�_compact�_sort_dicts)rrrrrr
rrrrr hs 
zPrettyPrinter.__init__cCs&|�||jddid�|j�d�dS)Nr�
)�_formatr2�write�rrrrrr�szPrettyPrinter.pprintcCs"t�}|�||ddid�|��S�Nr)�	_StringIOr9�getvalue)rrZsiorrrr�szPrettyPrinter.pformatcCs|�|idd�dS)Nrr��formatr;rrrr�szPrettyPrinter.isrecursivecCs |�|idd�\}}}|o|Sr<r?)rr�s�readable�	recursiverrrr�szPrettyPrinter.isreadablec	Cs�t|�}||kr.|�t|��d|_d|_dS|�|||�}|j||}	t|�|	kr�|j�	t
|�jd�}
|
dk	r�d||<|
|||||||d�||=dSt|t
�r�d||<|�||||||d�||=dS|�|�dS)NTFr
)r$r:�
_recursion�
_recursive�	_readable�_reprr1�len�	_dispatch�getr#�__repr__�
isinstance�dict�_pprint_dict)rrrr�	allowance�context�level�objid�rep�	max_width�prrrr9�s0
�zPrettyPrinter._formatc
Csz|j}|d�|jdkr*||jdd�t|�}|rn|jrNt|��td�}	n|��}	|�|	|||d||�|d�dS)N�{r
� ��key�})r:r0rHr7�sorted�itemsr,�_format_dict_items)
rrrrrOrPrQr:Zlengthr\rrrrN�s
�zPrettyPrinter._pprint_dictcCslt|�s|�t|��dS|j}|�|jd�|�t|���||t|j�d|d||�|�d�dS)N�(r
�))rHr:�repr�	__class__r'r9�listr\)rrrrrOrPrQ�clsrrr�_pprint_ordered_dict�s�z"PrettyPrinter._pprint_ordered_dictcCs0|�d�|�||||d||�|�d�dS)N�[r
�])r:�
_format_items�rrrrrOrPrQrrr�_pprint_list�s
�zPrettyPrinter._pprint_listcCsH|�d�t|�dkrdnd}|�||||t|�||�|�|�dS)Nr^r
z,)r_)r:rHrg)rrrrrOrPrQ�endcharrrr�
_pprint_tuple�s
�zPrettyPrinter._pprint_tuplec	Cs�t|�s|�t|��dS|j}|tkr8|�d�d}n&|�|jd�d}|t|j�d7}t|td�}|�||||t|�||�|�|�dS)NrVrZ�({�})r
rX)	rHr:r`ra�setr'r[rrg)	rrrrrOrPrQ�typrjrrr�_pprint_set�s 
�zPrettyPrinter._pprint_setcCs�|j}t|�s|t|��dSg}|�d�}	|dkrD|d7}|d7}|j|}
}t|	�D]�\}}
t|
�}|t|	�dkr�|
|8}
t|�|
kr�|�|�qZt�d|
�}|�	�|}d}t|�D]h\}}||}|t|�dkr�|t|	�dkr�||8}tt|��|k�r"|�r|�t|��|}q�|}q�|rZ|�t|��qZt|�dk�rV||�dS|dk�rh|d�t|�D],\}}|dk�r�|dd|�||��qp|dk�r�|d	�dS)
NTr
z\S*\s*�r^rr8rWr_)
r:rHr`�
splitlinesr1�	enumerate�append�re�findall�pop)rrrrrOrPrQr:Zchunks�linesZ
max_width1rT�i�linerS�partsZ
max_width2�current�j�part�	candidaterrr�_pprint_strsT
 


zPrettyPrinter._pprint_strcCs�|j}t|�dkr"|t|��dS|dk}|rF|d7}|d7}|d�d}	t||j||�D]$}
||	�||
�|	s\dd|}	q\|r�|d�dS)N�r
r^rqr8rWr_)r:rHr`�_wrap_bytes_reprr1)rrrrrOrPrQr:Zparens�delimrSrrr�
_pprint_bytes3s"zPrettyPrinter._pprint_bytesc	Cs>|j}|d�|�t|�||d|d||d�|d�dS)Nz
bytearray(�
r
r_)r:r��bytes)rrrrrOrPrQr:rrr�_pprint_bytearrayHs�zPrettyPrinter._pprint_bytearraycCs8|�d�|�|��||d|d||�|�d�dS)Nz
mappingproxy(�
r
r_)r:r9�copyrhrrr�_pprint_mappingproxyQs
�z"PrettyPrinter._pprint_mappingproxyc	Cs�|j}||j7}dd|}t|�d}	t|�D]f\}
\}}|
|	k}
|�|||�}||�|d�|�|||t|�d|
r�|nd||�|
s0||�q0dS)N�,
rWr
z: r)r:r0rHrsrGr9)rr\rrrOrPrQr:�delimnlZ
last_indexryrY�ent�lastrSrrrr]Ys 

�z PrettyPrinter._format_dict_itemscCsL|j}||j7}|jdkr,||jdd�dd|}d}	|j|d}
}t|�}zt|�}
Wntk
rxYdSXd}|�sH|
}zt|�}
Wn(tk
r�d}||8}|
|8}
YnX|j�r|�|||�}t|�d}|
|kr�|}
|	r�|}	|
|k�r|
|8}
||	�d}	||�q~||	�|}	|�	||||�r<|nd||�q~dS)	Nr
rWr�rqFTr�, )
r:r0r1�iter�next�
StopIterationr6rGrHr9)rr\rrrOrPrQr:r�r�rrT�itZnext_entr�r�rS�wrrrrgjsR



�zPrettyPrinter._format_itemscCs4|�||��|j|�\}}}|s&d|_|r0d|_|S)NFT)r@r�r/rFrE)rrrPrQr`rBrCrrrrG�s�
zPrettyPrinter._reprcCst|||||j�Sr)rr7)rrrP�	maxlevelsrQrrrr@�szPrettyPrinter.formatc	Cs�t|�s|�t|��dS|�|j||�}|j}|t|j�d7}|�d|j|d|f�|�||||d||�|�d�dS)Nr
z	%s(%s,
%srWr_)rHr:r`rG�default_factoryrar'rN)	rrrrrOrPrQZrdfrcrrr�_pprint_default_dict�sz"PrettyPrinter._pprint_default_dictc	Cs�t|�s|�t|��dS|j}|�|jd�|jdkrN|�|jdd�|��}|�|||t|j�d|d||�|�d�dS)Nrlr
rWrrm)rHr:r`rar'r0�most_commonr])	rrrrrOrPrQrcr\rrr�_pprint_counter�s
�zPrettyPrinter._pprint_counterc
	Cs�t|j�s|�t|��dS|j}|�|jd�|t|j�d7}t|j�D]d\}}	|t|j�dkr�|�|	|||d||�|�d�qN|�|	||d||�|�dd|�qNdS)Nr^r
r_r�rW)rH�mapsr:r`rar'rsr9)
rrrrrOrPrQrcry�mrrr�_pprint_chain_map�s
zPrettyPrinter._pprint_chain_mapc	Cs�t|�s|�t|��dS|j}|�|jd�|t|j�d7}|�d�|jdkrz|�||||d||�|�d�n:|�|||d||�|�|j||�}|�dd||f�dS)Nr^r
rerz])z],
%smaxlen=%s)rW)rHr:r`rar'�maxlenrgrG)	rrrrrOrPrQrcZrmlrrr�
_pprint_deque�s&

��zPrettyPrinter._pprint_dequec	Cs|�|j|||||d�dS�Nr
�r9�datarhrrr�_pprint_user_dict�szPrettyPrinter._pprint_user_dictc	Cs|�|j|||||d�dSr�r�rhrrr�_pprint_user_list�szPrettyPrinter._pprint_user_listc	Cs|�|j|||||d�dSr�r�rhrrr�_pprint_user_string�sz!PrettyPrinter._pprint_user_string)r
rNN)2r'r(r)r rrrrr9rIrNrMrKrd�_collections�OrderedDictrirbrk�tuplerprn�	frozensetr�r"r�r�r��	bytearrayr��_types�MappingProxyTyper]rgrGr@r��defaultdictr��Counterr��ChainMapr��dequer��UserDictr��UserListr��
UserStringrrrrrgs^�+




1


)	cCs�t|�}|tkrt|�ddfSt|dd�}t|t��rD|tjk�rD|sJdSt|�}|rl||krldd||kfS||kr�t|�ddfSd||<d}d}	g}
|
j	}|d7}|r�t
|��td�}n|��}|D]b\}
}t
|
||||�\}}}t
|||||�\}}}|d||f�|�o|�o|}|�s$|r�d}	q�||=d	d
�|
�||	fSt|t��r\|tjk�stt|t��rn|tjk�rnt|t��r�|�s�dSd}n"t|�dk�r�d
}n|�s�dSd}t|�}|�r�||k�r�|dd||kfS||k�r�t|�ddfSd||<d}d}	g}
|
j	}|d7}|D]8}t
|||||�\}}}||�|�sFd}|�rd}	�q||=|d
�|
�||	fSt|�}||�o�|�d�dfS)NTFrK)z{}TFz{...}r
rXz%s: %sz{%s}r�)z[]TFz[%s]z(%s,))z()TFz(%s)z...�<)r#�_builtin_scalarsr`�getattr�
issubclassrMrKr$rDrtr[r\r,r�joinrbr�rH�
startswith)rrPr�rQrro�rrRrBrCZ
componentsrtr\�k�vZkreprZ	kreadableZkrecurZvreprZ	vreadableZvrecurr@�oZoreprZ	oreadableZorecurrSrrrr�s�
��
rcCsdt|�jt|�fS)Nz<Recursion on %s with id=%s>)r#r'r$rrrrrD?s�rDcCs�ddl}|dkr,ddddgddd�fgd	}t�}|��}t|iddd
�|��}|�|�|��}td||�td||�dS)
Nr�string)r
r�r���)��i��Tz_safe_repr:zpformat:)�timer�perf_counterrr�print)rr�rU�t1�t2Zt3rrr�
_perfcheckDs
r�ccs�d}t|�dd}tdt|�d�D]T}|||d�}||}||krP||8}tt|��|krt|rnt|�V|}q$|}q$|r�t|�VdS)N�r�r)rH�ranger`)rrrOr|r�ryr~rrrrr�Qs
r��__main__)Nr
rN)r
rN)N)#�collectionsr�ru�sysr3�typesr��iorr=�__all__rrr	rrrrr,rrr�r"r�r�r-�float�complexr5r#r�rDr�r�r'rrrr�<module>%sH
���F�


__pycache__/cmd.cpython-38.pyc000064400000030524151153537560012166 0ustar00U

e5d:�@s@dZddlZddlZdgZdZejejdZGdd�d�ZdS)a	A generic class to build line-oriented command interpreters.

Interpreters constructed with this class obey the following conventions:

1. End of file on input is processed as the command 'EOF'.
2. A command is parsed out of each line by collecting the prefix composed
   of characters in the identchars member.
3. A command `foo' is dispatched to a method 'do_foo()'; the do_ method
   is passed a single argument consisting of the remainder of the line.
4. Typing an empty line repeats the last command.  (Actually, it calls the
   method `emptyline', which may be overridden in a subclass.)
5. There is a predefined `help' method.  Given an argument `topic', it
   calls the command `help_topic'.  With no arguments, it lists all topics
   with defined help_ functions, broken into up to three topics; documented
   commands, miscellaneous help topics, and undocumented commands.
6. The command '?' is a synonym for `help'.  The command '!' is a synonym
   for `shell', if a do_shell method exists.
7. If completion is enabled, completing commands will be done automatically,
   and completing of commands args is done by calling complete_foo() with
   arguments text, line, begidx, endidx.  text is string we are matching
   against, all returned matches must begin with it.  line is the current
   input line (lstripped), begidx and endidx are the beginning and end
   indexes of the text being matched, which could be used to provide
   different completion depending upon which position the argument is in.

The `default' method may be overridden to intercept commands for which there
is no do_ method.

The `completedefault' method may be overridden to intercept completions for
commands that have no complete_ method.

The data member `self.ruler' sets the character used to draw separator lines
in the help messages.  If empty, no ruler line is drawn.  It defaults to "=".

If the value of `self.intro' is nonempty when the cmdloop method is called,
it is printed out on interpreter startup.  This value may be overridden
via an optional argument to the cmdloop() method.

The data members `self.doc_header', `self.misc_header', and
`self.undoc_header' set the headers used for the help function's
listings of documented functions, miscellaneous topics, and undocumented
functions respectively.
�N�Cmdz(Cmd) �_c@s�eZdZdZeZeZdZdZ	dZ
dZdZdZ
dZdZd	Zd0dd�Zd1d
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Z d+d,�Z!d2d.d/�Z"dS)3raA simple framework for writing line-oriented command interpreters.

    These are often useful for test harnesses, administrative tools, and
    prototypes that will later be wrapped in a more sophisticated interface.

    A Cmd instance or subclass instance is a line-oriented interpreter
    framework.  There is no good reason to instantiate Cmd itself; rather,
    it's useful as a superclass of an interpreter class you define yourself
    in order to inherit Cmd's methods and encapsulate action methods.

    �=�Nz(Documented commands (type help <topic>):zMiscellaneous help topics:zUndocumented commands:z*** No help on %s��tabcCs@|dk	r||_ntj|_|dk	r(||_ntj|_g|_||_dS)a�Instantiate a line-oriented interpreter framework.

        The optional argument 'completekey' is the readline name of a
        completion key; it defaults to the Tab key. If completekey is
        not None and the readline module is available, command completion
        is done automatically. The optional arguments stdin and stdout
        specify alternate input and output file objects; if not specified,
        sys.stdin and sys.stdout are used.

        N)�stdin�sys�stdout�cmdqueue�completekey)�selfrrr
�r�/usr/lib64/python3.8/cmd.py�__init__LszCmd.__init__cCs�|��|jr\|jr\z2ddl}|��|_|�|j�|�|jd�Wnt	k
rZYnXz�|dk	rl||_
|j
r�|j�t
|j
�d�d}|�s4|jr�|j�d�}nl|jr�zt|j�}Wntk
r�d}YnXn<|j�|j�|j��|j��}t|��sd}n
|�d�}|�|�}|�|�}|�||�}q�|��W5|j�r�|j�r�zddl}|�|j�Wnt	k
�r~YnXXdS)z�Repeatedly issue a prompt, accept input, parse an initial prefix
        off the received input, and dispatch to action methods, passing them
        the remainder of the line as argument.

        rNz
: complete�
�EOFz
)�preloop�use_rawinputr�readlineZ
get_completerZ
old_completerZ
set_completer�complete�parse_and_bind�ImportError�intror
�write�strr�pop�input�prompt�EOFError�flushr�len�rstrip�precmd�onecmd�postcmd�postloop)r
rr�stop�linerrr�cmdloopbsN






zCmd.cmdloopcCs|S)z�Hook method executed just before the command line is
        interpreted, but after the input prompt is generated and issued.

        r�r
r(rrrr#�sz
Cmd.precmdcCs|S)z?Hook method executed just after a command dispatch is finished.r)r
r'r(rrrr%�szCmd.postcmdcCsdS)z>Hook method executed once when the cmdloop() method is called.Nr�r
rrrr�szCmd.preloopcCsdS)zYHook method executed once when the cmdloop() method is about to
        return.

        Nrr+rrrr&�szCmd.postloopcCs�|��}|sdd|fS|ddkr4d|dd�}n2|ddkrft|d�r\d|dd�}n
dd|fSdt|�}}||kr�|||jkr�|d}qt|d|�||d���}}|||fS)	z�Parse the line into a command name and a string containing
        the arguments.  Returns a tuple containing (command, args, line).
        'command' and 'args' may be None if the line couldn't be parsed.
        Nr�?zhelp r�!Zdo_shellzshell )�strip�hasattrr!�
identchars)r
r(�i�n�cmd�argrrr�	parseline�s



z
Cmd.parselinecCs�|�|�\}}}|s|��S|dkr.|�|�S||_|dkrBd|_|dkrT|�|�Szt|d|�}Wntk
r�|�|�YSX||�SdS)ahInterpret the argument as though it had been typed in response
        to the prompt.

        This may be overridden, but should not normally need to be;
        see the precmd() and postcmd() methods for useful execution hooks.
        The return value is a flag indicating whether interpretation of
        commands by the interpreter should stop.

        Nrr�do_)r5�	emptyline�default�lastcmd�getattr�AttributeError)r
r(r3r4�funcrrrr$�s


z
Cmd.onecmdcCs|jr|�|j�SdS)z�Called when an empty line is entered in response to the prompt.

        If this method is not overridden, it repeats the last nonempty
        command entered.

        N)r9r$r+rrrr7�sz
Cmd.emptylinecCs|j�d|�dS)z�Called on an input line when the command prefix is not recognized.

        If this method is not overridden, it prints an error message and
        returns.

        z*** Unknown syntax: %s
N)r
rr*rrrr8�szCmd.defaultcGsgS)z�Method called to complete an input line when no command-specific
        complete_*() method is available.

        By default, it returns an empty list.

        r)r
�ignoredrrr�completedefault�szCmd.completedefaultcsd|��fdd�|��D�S)Nr6cs"g|]}|���r|dd��qS)�N��
startswith��.0�a�Zdotextrr�
<listcomp>�s
z%Cmd.completenames.<locals>.<listcomp>)�	get_names)r
�textr=rrEr�
completenames�szCmd.completenamesc
Cs�|dkr�ddl}|��}|��}t|�t|�}|��|}|��|}|dkr�|�|�\}	}
}|	dkrp|j}q�zt|d|	�}Wq�t	k
r�|j}Yq�Xn|j
}|||||�|_z|j|WStk
r�YdSXdS)z�Return the next possible completion for 'text'.

        If a command has not been entered, then complete against command list.
        Otherwise try to call complete_<command> to get list of completions.
        rNrZ	complete_)
rZget_line_buffer�lstripr!Z
get_begidxZ
get_endidxr5r>r:r;rIZcompletion_matches�
IndexError)
r
rH�staterZorigliner(�strippedZbegidxZendidxr3�argsZfooZcompfuncrrrr�s*zCmd.completecCs
t|j�S)N)�dir�	__class__r+rrrrGsz
Cmd.get_namescs4t|j���}t�fdd�|��D��}t||B�S)Nc3s,|]$}|�d�d�r|dd�VqdS)�help_r�Nr@rB�rNrr�	<genexpr> s�z$Cmd.complete_help.<locals>.<genexpr>)�setrIrG�list)r
rNZcommandsZtopicsrrSr�
complete_helpszCmd.complete_helpcCs�|r�zt|d|�}Wn|tk
r�z4t|d|�j}|rX|j�dt|��WYdSWntk
rnYnX|j�dt|j|f��YdSX|��n|��}g}g}i}|D]$}|dd�dkr�d||dd�<q�|��d}	|D]p}|dd�dkr�||	k�rq�|}	|dd�}
|
|k�r8|�	|
�||
=q�t||�j�rR|�	|
�q�|�	|
�q�|j�dt|j
��|�|j|d	d
�|�|j
t|���d	d
�|�|j|d	d
�dS)zEList available commands with "help" or detailed help with "help cmd".rQr6�%s
NrRrrr?��P)r:r;�__doc__r
rr�nohelprG�sort�append�
doc_leader�print_topics�
doc_header�misc_headerrV�keys�undoc_header)r
r4r<�doc�namesZcmds_docZ
cmds_undoc�help�nameZprevnamer3rrr�do_help$sN



zCmd.do_helpcCs\|rX|j�dt|��|jr<|j�dt|jt|���|�||d�|j�d�dS)NrXrr)r
rr�rulerr!�	columnize)r
�headerZcmdsZcmdlenZmaxcolrrrr`RszCmd.print_topicsrZcs��s|j�d�dS�fdd�tt���D�}|rJtdd�tt|����t��}|dkrv|j�dt�d	��dStdt���D]�}||d|}g}d
}t|�D]h}	d	}
t|�D]2}|||	}||kr�q�|}
t|
t|
��}
q�|�	|
�||
d7}||kr��qq�||kr��q4q�t��}d}d	g}t|�D]�}g}t|�D]4}	|||	}||k�rld}
n�|}
|�	|
��qL|�r�|d
�s�|d
=�q�tt|��D]}	||	�
||	�||	<�q�|j�dtd�|����q<dS)z�Display a list of strings as a compact set of columns.

        Each column is only as wide as necessary.
        Columns are separated by two spaces (one was not legible enough).
        z<empty>
Ncsg|]}t�|t�s|�qSr)�
isinstancer)rCr1�rVrrrFds�z!Cmd.columnize.<locals>.<listcomp>z list[i] not a string for i in %sz, rrXr����r���z  )r
r�ranger!�	TypeError�join�mapr�maxr^�ljust)r
rVZdisplaywidthZ
nonstrings�sizeZnrowsZncolsZ	colwidthsZtotwidth�colZcolwidth�rowr1�xZtextsrrnrrkZs\�


z
Cmd.columnize)rNN)N)rZ)#�__name__�
__module__�__qualname__r[�PROMPTr�
IDENTCHARSr0rjr9rr_rarbrdr\rrr)r#r%rr&r5r$r7r8r>rIrrGrWrir`rkrrrrr4s<

4
		.)	r[�stringr	�__all__rZ
ascii_lettersZdigitsr�rrrrr�<module>s
,__pycache__/heapq.cpython-38.opt-1.pyc000064400000033370151153537560013462 0ustar00U

e5d]Y�@sZdZdZdddddddd	gZd
d�Zdd�Zdd�Zd
d	�Zdd�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zddd�d d�Zd)d!d�Zd*d"d�Zzd#d$lTWnek
r�YnXzd#d%lm	Z	Wnek
r�YnXzd#d&lm
Z
Wnek
�rYnXzd#d'lmZWnek
�r6YnXed(k�rVd#dlZee���dS)+a�Heap queue algorithm (a.k.a. priority queue).

Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0.  For the sake of comparison,
non-existing elements are considered to be infinite.  The interesting
property of a heap is that a[0] is always its smallest element.

Usage:

heap = []            # creates an empty heap
heappush(heap, item) # pushes a new item on the heap
item = heappop(heap) # pops the smallest item from the heap
item = heap[0]       # smallest item on the heap without popping it
heapify(x)           # transforms list into a heap, in-place, in linear time
item = heapreplace(heap, item) # pops and returns smallest item, and adds
                               # new item; the heap size is unchanged

Our API differs from textbook heap algorithms as follows:

- We use 0-based indexing.  This makes the relationship between the
  index for a node and the indexes for its children slightly less
  obvious, but is more suitable since Python uses 0-based indexing.

- Our heappop() method returns the smallest item, not the largest.

These two make it possible to view the heap as a regular Python list
without surprises: heap[0] is the smallest item, and heap.sort()
maintains the heap invariant!
uoHeap queues

[explanation by François Pinard]

Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0.  For the sake of comparison,
non-existing elements are considered to be infinite.  The interesting
property of a heap is that a[0] is always its smallest element.

The strange invariant above is meant to be an efficient memory
representation for a tournament.  The numbers below are `k', not a[k]:

                                   0

                  1                                 2

          3               4                5               6

      7       8       9       10      11      12      13      14

    15 16   17 18   19 20   21 22   23 24   25 26   27 28   29 30


In the tree above, each cell `k' is topping `2*k+1' and `2*k+2'.  In
a usual binary tournament we see in sports, each cell is the winner
over the two cells it tops, and we can trace the winner down the tree
to see all opponents s/he had.  However, in many computer applications
of such tournaments, we do not need to trace the history of a winner.
To be more memory efficient, when a winner is promoted, we try to
replace it by something else at a lower level, and the rule becomes
that a cell and the two cells it tops contain three different items,
but the top cell "wins" over the two topped cells.

If this heap invariant is protected at all time, index 0 is clearly
the overall winner.  The simplest algorithmic way to remove it and
find the "next" winner is to move some loser (let's say cell 30 in the
diagram above) into the 0 position, and then percolate this new 0 down
the tree, exchanging values, until the invariant is re-established.
This is clearly logarithmic on the total number of items in the tree.
By iterating over all items, you get an O(n ln n) sort.

A nice feature of this sort is that you can efficiently insert new
items while the sort is going on, provided that the inserted items are
not "better" than the last 0'th element you extracted.  This is
especially useful in simulation contexts, where the tree holds all
incoming events, and the "win" condition means the smallest scheduled
time.  When an event schedule other events for execution, they are
scheduled into the future, so they can easily go into the heap.  So, a
heap is a good structure for implementing schedulers (this is what I
used for my MIDI sequencer :-).

Various structures for implementing schedulers have been extensively
studied, and heaps are good for this, as they are reasonably speedy,
the speed is almost constant, and the worst case is not much different
than the average case.  However, there are other representations which
are more efficient overall, yet the worst cases might be terrible.

Heaps are also very useful in big disk sorts.  You most probably all
know that a big sort implies producing "runs" (which are pre-sorted
sequences, which size is usually related to the amount of CPU memory),
followed by a merging passes for these runs, which merging is often
very cleverly organised[1].  It is very important that the initial
sort produces the longest runs possible.  Tournaments are a good way
to that.  If, using all the memory available to hold a tournament, you
replace and percolate items that happen to fit the current run, you'll
produce runs which are twice the size of the memory for random input,
and much better for input fuzzily ordered.

Moreover, if you output the 0'th item on disk and get an input which
may not fit in the current tournament (because the value "wins" over
the last output value), it cannot fit in the heap, so the size of the
heap decreases.  The freed memory could be cleverly reused immediately
for progressively building a second heap, which grows at exactly the
same rate the first heap is melting.  When the first heap completely
vanishes, you switch heaps and start a new run.  Clever and quite
effective!

In a word, heaps are useful memory structures to know.  I use them in
a few applications, and I think it is good to keep a `heap' module
around. :-)

--------------------
[1] The disk balancing algorithms which are current, nowadays, are
more annoying than clever, and this is a consequence of the seeking
capabilities of the disks.  On devices which cannot seek, like big
tape drives, the story was quite different, and one had to be very
clever to ensure (far in advance) that each tape movement will be the
most effective possible (that is, will best participate at
"progressing" the merge).  Some tapes were even able to read
backwards, and this was also used to avoid the rewinding time.
Believe me, real good tape sorts were quite spectacular to watch!
From all times, sorting has always been a Great Art! :-)
�heappush�heappop�heapify�heapreplace�merge�nlargest�	nsmallest�heappushpopcCs"|�|�t|dt|�d�dS)z4Push item onto heap, maintaining the heap invariant.��N)�append�	_siftdown�len��heap�item�r�/usr/lib64/python3.8/heapq.pyr�s
cCs.|��}|r*|d}||d<t|d�|S|S)zCPop the smallest item off the heap, maintaining the heap invariant.r	)�pop�_siftup�rZlastelt�
returnitemrrrr�s
cCs|d}||d<t|d�|S)a�Pop and return the current smallest value, and add the new item.

    This is more efficient than heappop() followed by heappush(), and can be
    more appropriate when using a fixed-size heap.  Note that the value
    returned may be larger than item!  That constrains reasonable uses of
    this routine unless written as part of a conditional replacement:

        if item > heap[0]:
            item = heapreplace(heap, item)
    r	�r�rrrrrrr�s
cCs0|r,|d|kr,|d|}|d<t|d�|S)z1Fast version of a heappush followed by a heappop.r	rrrrrr�s
cCs,t|�}tt|d��D]}t||�qdS)z8Transform list into a heap, in-place, in O(len(x)) time.�N)r
�reversed�ranger��x�n�irrrr�scCs.|��}|r*|d}||d<t|d�|S|S)zMaxheap version of a heappop.r	)r�_siftup_maxrrrr�_heappop_max�s
r!cCs|d}||d<t|d�|S)z4Maxheap version of a heappop followed by a heappush.r	)r rrrr�_heapreplace_max�s
r"cCs,t|�}tt|d��D]}t||�qdS)z;Transform list into a maxheap, in-place, in O(len(x)) time.rN)r
rrr rrrr�_heapify_max�sr#cCsJ||}||kr>|dd?}||}||kr>|||<|}qq>q|||<dS)Nr
r�r�startpos�pos�newitem�	parentpos�parentrrrr�srcCs�t|�}|}||}d|d}||krj|d}||krL||||ksL|}||||<|}d|d}q |||<t|||�dS)Nrr
)r
r�rr&�endposr%r'�childpos�rightposrrrrsrcCsJ||}||kr>|dd?}||}||kr>|||<|}qq>q|||<dS)zMaxheap variant of _siftdownr
Nrr$rrr�
_siftdown_maxsr.cCs�t|�}|}||}d|d}||krj|d}||krL||||ksL|}||||<|}d|d}q |||<t|||�dS)zMaxheap variant of _siftuprr
N)r
r.r*rrrr %sr NF��key�reversec	gsg}|j}|r t}t}t}d}nt}t}t}d}|dk�rttt	|��D]<\}	}
z|
j
}||�|	||g�WqHtk
r�YqHXqH||�t|�dkr�z2|d\}}	}}
|V|�|
d<|||
�q�Wq�tk
r�||�Yq�Xq�|�r|d\}}	}|V|j
EdHdSttt	|��D]J\}	}
z(|
j
}|�}|||�|	|||g�Wntk
�rjYnX�q$||�t|�dk�r�zF|d\}}	}}}
|V|�}||�|
d<||
d<|||
��q�Wntk
�r�||�YnX�qx|�r|d\}}	}}|V|j
EdHdS)akMerge multiple sorted inputs into a single sorted output.

    Similar to sorted(itertools.chain(*iterables)) but returns a generator,
    does not pull the data into memory all at once, and assumes that each of
    the input streams is already sorted (smallest to largest).

    >>> list(merge([1,3,5,7], [0,2,4,8], [5,10,15,20], [], [25]))
    [0, 1, 2, 3, 4, 5, 5, 7, 8, 10, 15, 20, 25]

    If *key* is not None, applies a key function to each element to determine
    its sort order.

    >>> list(merge(['dog', 'horse'], ['cat', 'fish', 'kangaroo'], key=len))
    ['dog', 'cat', 'fish', 'horse', 'kangaroo']

    ���r
Nr	r)rr#r!r"rrr�	enumerate�map�iter�__next__�
StopIterationr
�__self__)r0r1�	iterables�h�h_append�_heapify�_heappop�_heapreplace�	direction�order�it�next�value�s�	key_valuerrrr:sl


c	s�|dkr6t|�}t�}t||�d�}||kr0gS|gSzt|�}Wnttfk
rZYnX||krxt|�d�d|�S�dk�rt|�}dd�tt|�|�D�}|s�|St	|�|dd}|}t
}	|D].}
|
|kr�|	||
|f�|d\}}|d7}q�|��dd�|D�St|�}�fd	d�tt|�|�D�}|�s>|St	|�|dd}|}t
}	|D]>}
�|
�}||k�r^|	||||
f�|d\}}}
|d7}�q^|��d
d�|D�S)zbFind the n smallest elements in a dataset.

    Equivalent to:  sorted(iterable, key=key)[:n]
    r
��defaultr0�r0NcSsg|]\}}||f�qSrr��.0r�elemrrr�
<listcomp>�sznsmallest.<locals>.<listcomp>r	cSsg|]\}}|�qSrr�rJrKr@rrrrL�scsg|]\}}�|�||f�qSrrrIrHrrrL�scSsg|]\}}}|�qSrr�rJ�kr@rKrrrrLs)r5�object�minr
�	TypeError�AttributeError�sorted�ziprr#r"�sort�r�iterabler0rA�sentinel�result�size�topr@r>rK�_orderrO�_elemrrHrr�sV


c	s�|dkr6t|�}t�}t||�d�}||kr0gS|gSzt|�}Wnttfk
rZYn X||krzt|�dd�d|�S�dk�rt|�}dd�ttd|d	�|�D�}|s�|St	|�|dd}|}t
}	|D].}
||
kr�|	||
|f�|d\}}|d8}q�|jdd
�dd�|D�St|�}�fdd�ttd|d	�|�D�}|�sR|St	|�|dd}|}t
}	|D]>}
�|
�}||k�rt|	||||
f�|d\}}}
|d8}�qt|jdd
�d
d�|D�S)zoFind the n largest elements in a dataset.

    Equivalent to:  sorted(iterable, key=key, reverse=True)[:n]
    r
rFTr/NcSsg|]\}}||f�qSrrrIrrrrL"sznlargest.<locals>.<listcomp>r	r2)r1cSsg|]\}}|�qSrrrMrrrrL/scsg|]\}}�|�||f�qSrrrIrHrrrL3scSsg|]\}}}|�qSrrrNrrrrLAs)r5rP�maxr
rRrSrTrUrrrrVrWrrHrr	sV

"
r	)�*)r")r#)r!�__main__)N)N)�__doc__�	__about__�__all__rrrrrr!r"r#rrr.r rrr�_heapq�ImportError�__name__Zdoctest�printZtestmodrrrr�<module>sR ^
�

	5
<
;
__pycache__/smtpd.cpython-38.pyc000064400000063541151153537560012557 0ustar00U

e5d���@s^dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddlm
Z
mZddddd	gZejdZd
ZGdd�d�Ze�ad
ZdZdZd%dd�ZGdd�dej�ZGdd�dej�ZGdd�de�ZGdd�de�ZGdd	�d	e�ZGdd�d�Z dd�Z!e"dk�rZe!�Z#e#j$Z$de$k�rpe$�%d�Z&e'e$de&�e(�e)�dg�Z*e$e&dd�Z$nddl+Z*e,e*e$�Z-e-e#j.e#j/fe#j0e#j1fe#j2e#j3d�Z4e#j5�r6zddl6Z6Wn.e7k
�r�e8d ej9d!�e�:d�YnXe6�;d"�d#Z<ze�5e<�Wn.e=k
�r4e8d$ej9d!�e�:d�YnXze�>�Wne?k
�rXYnXdS)&a�An RFC 5321 smtp proxy with optional RFC 1870 and RFC 6531 extensions.

Usage: %(program)s [options] [localhost:localport [remotehost:remoteport]]

Options:

    --nosetuid
    -n
        This program generally tries to setuid `nobody', unless this flag is
        set.  The setuid call will fail if this program is not run as root (in
        which case, use this flag).

    --version
    -V
        Print the version number and exit.

    --class classname
    -c classname
        Use `classname' as the concrete SMTP proxy class.  Uses `PureProxy' by
        default.

    --size limit
    -s limit
        Restrict the total size of the incoming message to "limit" number of
        bytes via the RFC 1870 SIZE extension.  Defaults to 33554432 bytes.

    --smtputf8
    -u
        Enable the SMTPUTF8 extension and behave as an RFC 6531 smtp proxy.

    --debug
    -d
        Turn on debugging prints.

    --help
    -h
        Print this message and exit.

Version: %(__version__)s

If localhost is not given then `localhost' is used, and if localport is not
given then 8025 is used.  If remotehost is not given then `localhost' is used,
and if remoteport is not given, then 25 is used.
�N)�warn)�
get_addr_spec�get_angle_addr�SMTPChannel�
SMTPServer�DebuggingServer�	PureProxy�MailmanProxyzPython SMTP proxy version 0.3c@seZdZdd�Zdd�ZdS)�DevnullcCsdS�N���self�msgrr�/usr/lib64/python3.8/smtpd.py�writef�z
Devnull.writecCsdSrr�rrrr�flushgrz
Devnull.flushN)�__name__�
__module__�__qualname__rrrrrrr
esr
�
z, i�cCs4ttt�tjd�|r&t|tjd�t�|�dS)N��file)�print�__doc__�globals�sys�stderr�exit)�coderrrr�usagepsr#c@s�eZdZdZdZdZe�efdd��Ze	dd��Z
edd	d	fd
d�Zdd
�Z
dd�Ze	dd��Zejdd��Ze	dd��Zejdd��Ze	dd��Zejdd��Ze	dd��Zejdd��Ze	dd��Zejdd��Ze	dd ��Zejd!d ��Ze	d"d#��Zejd$d#��Ze	d%d&��Zejd'd&��Ze	d(d)��Zejd*d)��Ze	d+d,��Zejd-d,��Ze	d.d/��Zejd0d/��Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dAdB�Z#dCdD�Z$dEdF�Z%dGdH�Z&dIdJ�Z'dKdL�Z(dMdN�Z)dOdP�Z*dQdR�Z+dS)Srr�icCs|Srr)�xrrr�<lambda>|rzSMTPChannel.<lambda>cCs0zt|j���WStk
r*|jYSXdSr)�max�command_size_limits�values�
ValueError�command_size_limitrrrr�max_command_size_limit~sz"SMTPChannel.max_command_size_limitNFc	
Cs&tjj|||d�||_||_||_||_||_||_|rF|rFt	d��|rdd|_
d|_d|_t
|_nd|_
d|_td�|_d	|_|��d|_d
|_|j��t��|_z|��|_WnBtk
r�}z$|��|jdtjkr�WY�dSd}~XYnXtdt |j�t!d
�|�"d|jt#f�dS)N��map�Fdecode_data and enable_SMTPUTF8 cannot be set to True at the same timer�
�.r�
�.�
FrzPeer:rz	220 %s %s)$�asynchat�
async_chat�__init__�smtp_server�conn�addr�data_size_limit�enable_SMTPUTF8�_decode_datar*�_emptystring�_linesep�_dotsep�NEWLINE�_newline�ord�_set_rset_state�
seen_greeting�
extended_smtpr(�clear�socketZgetfqdn�fqdnZgetpeername�peer�OSError�close�args�errnoZENOTCONNr�repr�DEBUGSTREAM�push�__version__)	rZserverr9r:r;r.r<�decode_data�errrrrr7�s@


zSMTPChannel.__init__cCs.|j|_d|_g|_d|_d|_|�d�dS)z/Reset state variables to their post-DATA state.NFrr2)�COMMAND�
smtp_state�mailfrom�rcpttos�require_SMTPUTF8�	num_bytes�set_terminatorrrrr�_set_post_data_state�sz SMTPChannel._set_post_data_statecCs|��d|_g|_dS)z.Reset all state variables except the greeting.rN)r\�
received_data�received_linesrrrrrD�szSMTPChannel._set_rset_statecCstdtd�|jS)NzTAccess to __server attribute on SMTPChannel is deprecated, use 'smtp_server' instead��r�DeprecationWarningr8rrrr�__server�s
�zSMTPChannel.__servercCstdtd�||_dS)NzRSetting __server attribute on SMTPChannel is deprecated, set 'smtp_server' insteadr_r`�r�valuerrrrb�s
�cCstdtd�|jS)NzUAccess to __line attribute on SMTPChannel is deprecated, use 'received_lines' insteadr_�rrar^rrrr�__line�s
�zSMTPChannel.__linecCstdtd�||_dS)NzSSetting __line attribute on SMTPChannel is deprecated, set 'received_lines' insteadr_rercrrrrf�s
�cCstdtd�|jS)NzRAccess to __state attribute on SMTPChannel is deprecated, use 'smtp_state' insteadr_�rrarVrrrr�__state�s
�zSMTPChannel.__statecCstdtd�||_dS)NzPSetting __state attribute on SMTPChannel is deprecated, set 'smtp_state' insteadr_rgrcrrrrh�s
�cCstdtd�|jS)NzXAccess to __greeting attribute on SMTPChannel is deprecated, use 'seen_greeting' insteadr_�rrarErrrr�
__greeting�s
�zSMTPChannel.__greetingcCstdtd�||_dS)NzVSetting __greeting attribute on SMTPChannel is deprecated, set 'seen_greeting' insteadr_rircrrrrj�s
�cCstdtd�|jS)NzSAccess to __mailfrom attribute on SMTPChannel is deprecated, use 'mailfrom' insteadr_�rrarWrrrr�
__mailfrom�s
�zSMTPChannel.__mailfromcCstdtd�||_dS)NzQSetting __mailfrom attribute on SMTPChannel is deprecated, set 'mailfrom' insteadr_rkrcrrrrl�s
�cCstdtd�|jS)NzQAccess to __rcpttos attribute on SMTPChannel is deprecated, use 'rcpttos' insteadr_�rrarXrrrr�	__rcpttos�s
�zSMTPChannel.__rcpttoscCstdtd�||_dS)NzOSetting __rcpttos attribute on SMTPChannel is deprecated, set 'rcpttos' insteadr_rmrcrrrrn�s
�cCstdtd�|jS)NzTAccess to __data attribute on SMTPChannel is deprecated, use 'received_data' insteadr_�rrar]rrrr�__data�s
�zSMTPChannel.__datacCstdtd�||_dS)NzRSetting __data attribute on SMTPChannel is deprecated, set 'received_data' insteadr_rorcrrrrps
�cCstdtd�|jS)NzKAccess to __fqdn attribute on SMTPChannel is deprecated, use 'fqdn' insteadr_�rrarIrrrr�__fqdn
s
�zSMTPChannel.__fqdncCstdtd�||_dS)NzISetting __fqdn attribute on SMTPChannel is deprecated, set 'fqdn' insteadr_rqrcrrrrrs
�cCstdtd�|jS)NzKAccess to __peer attribute on SMTPChannel is deprecated, use 'peer' insteadr_�rrarJrrrr�__peers
�zSMTPChannel.__peercCstdtd�||_dS)NzISetting __peer attribute on SMTPChannel is deprecated, set 'peer' insteadr_rsrcrrrrts
�cCstdtd�|jS)NzKAccess to __conn attribute on SMTPChannel is deprecated, use 'conn' insteadr_�rrar9rrrr�__conn s
�zSMTPChannel.__conncCstdtd�||_dS)NzISetting __conn attribute on SMTPChannel is deprecated, set 'conn' insteadr_rurcrrrrv%s
�cCstdtd�|jS)NzKAccess to __addr attribute on SMTPChannel is deprecated, use 'addr' insteadr_�rrar:rrrr�__addr+s
�zSMTPChannel.__addrcCstdtd�||_dS)NzISetting __addr attribute on SMTPChannel is deprecated, set 'addr' insteadr_rwrcrrrrx0s
�cCs&tj�|t|d|jrdnd��dS)Nr0�utf-8�ascii)r5r6rQ�bytesrYr
rrrrQ7s
�zSMTPChannel.pushcCs|d}|j|jkr|j}n|j|jkr*|j}|r<|j|kr<dS|rR|jt|�7_|jrl|j�	t
|d��n|j�	|�dS)Nry)rVrUr,�DATAr;rZ�lenr=r^�append�str)r�data�limitrrr�collect_incoming_data<sz!SMTPChannel.collect_incoming_datac
Cs|j�|j�}tdt|�td�g|_|j|jk�r|jd}|_|sT|�	d�dS|j
sdt|d�}|�d�}|dkr�|�
�}d}n$|d|��
�}||dd���}|jr�|j|n|j}||kr�|�	d�dSt|d	|d�}|s�|�	d
|�dS||�dS|j|jk�r(|�	d�d|_dS|j�rR|j|jk�rR|�	d�d|_dSg}|�|j�D]:}	|	�r�|	d|jk�r�|�|	dd��n
|�|	��qb|j�|�|_|j|j|j|jf}
i}|j
�s�|j|jd
�}|j j!|
|�}|�"�|�s|�	d�n
|�	|�dS)NzData:rrz500 Error: bad syntaxry� r$z500 Error: line too longZsmtp_z&500 Error: command "%s" not recognizedz451 Internal confusionz552 Error: Too much mail data)�mail_options�rcpt_options�250 OK)#r>�joinr^rrOrPrVrUrZrQr=r�find�upper�striprFr(r+�getattrr|r;�splitr?r@r~rBr]rJrWrXr�r�r8�process_messager\)
r�lineZsz�i�command�argZmax_sz�methodr��textrM�kwargsZstatusrrr�found_terminatorLsl


��


�zSMTPChannel.found_terminatorcCsH|s|�d�dS|jr&|�d�dS|��||_|�d|j�dS)Nz501 Syntax: HELO hostname�503 Duplicate HELO/EHLOz250 %s)rQrErDrI�rr�rrr�	smtp_HELO�s

zSMTPChannel.smtp_HELOcCs�|s|�d�dS|jr&|�d�dS|��||_d|_|�d|j�|jrr|�d|j�|jdd7<|js�|�d�|jr�|�d	�|jdd
7<|�d�dS)Nz501 Syntax: EHLO hostnamer�Tz250-%sz250-SIZE %s�MAIL�z250-8BITMIMEz250-SMTPUTF8�
z250 HELP)	rQrErDrFrIr;r(r=r<r�rrr�	smtp_EHLO�s&



zSMTPChannel.smtp_EHLOcCs|r|�d�n
|�d�dS)Nz501 Syntax: NOOPr��rQr�rrr�	smtp_NOOP�szSMTPChannel.smtp_NOOPcCs|�d�|��dS)Nz221 Bye)rQZclose_when_doner�rrr�	smtp_QUIT�s
zSMTPChannel.smtp_QUITcCs0t|�}|d|���|kr,||d���SdS)Nr)r}r�r�)r�keywordr�Zkeylenrrr�_strip_command_keyword�sz"SMTPChannel._strip_command_keywordcCsF|sdS|���d�r$t|�\}}nt|�\}}|s<||fS|j|fS)N)rr�<)�lstrip�
startswithrrZ	addr_spec)rr��address�restrrr�_getaddr�szSMTPChannel._getaddrcCsHi}|D]:}|�d�\}}}|��r,|r2|s2dS|r:|nd||<q|S)N�=T)�	partition�isalnum)r�params�resultZparam�eqrdrrr�
_getparams�szSMTPChannel._getparamscCs|r�d}|��}|dkr$|�d�q�|dkr8|�d�q�|dkr^d}|jrR||7}|�|�q�|dkr�d	}|jrx||7}|�|�q�|d
kr�|�d�q�|dkr�|�d
�q�|dkr�|�d�q�|dkr�|�d�q�|dkr�|�d�q�|�d�n
|�d�dS)N� [SP <mail-parameters>]ZEHLOz250 Syntax: EHLO hostnameZHELOz250 Syntax: HELO hostnamer�z 250 Syntax: MAIL FROM: <address>ZRCPTz250 Syntax: RCPT TO: <address>r|z250 Syntax: DATAZRSETz250 Syntax: RSETZNOOPz250 Syntax: NOOPZQUITz250 Syntax: QUITZVRFYz250 Syntax: VRFY <address>zD501 Supported commands: EHLO HELO MAIL RCPT DATA RSET NOOP QUIT VRFYzD250 Supported commands: EHLO HELO MAIL RCPT DATA RSET NOOP QUIT VRFY)r�rQrF)rr�ZextendedZlc_argrrrr�	smtp_HELP�s:zSMTPChannel.smtp_HELPcCs@|r2|�|�\}}|r"|�d�q<|�d|�n
|�d�dS)NzB252 Cannot VRFY user, but will accept message and attempt deliveryz502 Could not VRFY %sz501 Syntax: VRFY <address>)r�rQ)rr�r�r�rrr�	smtp_VRFY�szSMTPChannel.smtp_VRFYcCs�|js|�d�dStd|td�d}|jr4|d7}|dkrJ|�|�dS|�d|�}|�|�\}}|sv|�|�dS|js�|r�|�|�dS|jr�|�d�dS|���	�|_
|�|j
�}|dkr�|�|�dS|js�|�
dd	�}|d
kr�|�d�dS|j�r8|�
dd
�}|dk�r d|_n|d
k	�r8|�d�dS|�
dd�}|�r�|���sb|�|�dS|j�r�t|�|jk�r�|�d�dSt|���dk�r�|�d�dS||_td|jtd�|�d�dS)N�503 Error: send HELO firstz	===> MAILrz 501 Syntax: MAIL FROM: <address>r�zFROM:z503 Error: nested MAIL commandZBODY�7BIT)r�Z8BITMIMEz1501 Error: BODY can only be one of 7BIT, 8BITMIMEZSMTPUTF8FTz&501 Error: SMTPUTF8 takes no argumentsZSIZEz:552 Error: message size exceeds fixed maximum message sizerz:555 MAIL FROM parameters not recognized or not implementedzsender:r�)rErQrrPrFr�r�rWr�r�r�r�r=�popr<rY�isdigitr;�intr}�keys)rr��	syntaxerrr�r�Zbody�smtputf8�sizerrr�	smtp_MAILsh














zSMTPChannel.smtp_MAILcCs|js|�d�dStd|td�|js6|�d�dSd}|jrH|d7}|dkr^|�|�dS|�d|�}|�|�\}}|s�|�|�dS|js�|r�|�|�dS|���	�|_
|�|j
�}|dkr�|�|�dSt|�
��dkr�|�d	�dS|j�|�td
|jtd�|�d�dS)Nr�z	===> RCPTrz503 Error: need MAIL commandz501 Syntax: RCPT TO: <address>r�zTO:rz8555 RCPT TO parameters not recognized or not implementedzrecips:r�)rErQrrPrWrFr�r�r�r�r�r�r}r�rXr~)rr�r�r�r�rrr�	smtp_RCPT7s@







zSMTPChannel.smtp_RCPTcCs(|r|�d�dS|��|�d�dS)Nz501 Syntax: RSETr�)rQrDr�rrr�	smtp_RSETZs

zSMTPChannel.smtp_RSETcCsZ|js|�d�dS|js(|�d�dS|r:|�d�dS|j|_|�d�|�d�dS)Nr�z503 Error: need RCPT commandz501 Syntax: DATAs
.
z#354 End data with <CR><LF>.<CR><LF>)rErQrXr|rVr[r�rrr�	smtp_DATAas



zSMTPChannel.smtp_DATAcCs|�d�dS)Nz502 EXPN not implementedr�r�rrr�	smtp_EXPNpszSMTPChannel.smtp_EXPN),rrrrUr|r+�collections�defaultdictr(�propertyr,�DATA_SIZE_DEFAULTr7r\rDZ_SMTPChannel__server�setterZ_SMTPChannel__lineZ_SMTPChannel__stateZ_SMTPChannel__greetingZ_SMTPChannel__mailfromZ_SMTPChannel__rcpttosZ_SMTPChannel__dataZ_SMTPChannel__fqdnZ_SMTPChannel__peerZ_SMTPChannel__connZ_SMTPChannel__addrrQr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrws�
�
'	





















>#6#c@s2eZdZeZedddfdd�Zdd�Zdd�ZdS)	rNFcCs�||_||_||_||_||_|r.|r.td��tjj||d�zNt	j
|dt	ji�}|�|dd|dd�|�
�|�|�|�d�Wn|���Yn(Xtd|jjt�t���||ftd�dS)	Nr/r-�typerr$�z0%s started at %s
	Local addr: %s
	Remote addr:%sr)Z
_localaddr�_remoteaddrr;r<r=r*�asyncore�
dispatcherr7rHZgetaddrinfoZSOCK_STREAMZ
create_socketZset_reuse_addrZbindZlistenrLr�	__class__r�time�ctimerP)rZ	localaddrZ
remoteaddrr;r.r<rSZgai_resultsrrrr7xs6�
��zSMTPServer.__init__c	Cs6tdt|�td�|�||||j|j|j|j�}dS)NzIncoming connection from %sr)rrOrP�
channel_classr;�_mapr<r=)rr9r:Zchannelrrr�handle_accepted�s�zSMTPServer.handle_acceptedcKst�dS)aOverride this abstract method to handle messages from the client.

        peer is a tuple containing (ipaddr, port) of the client that made the
        socket connection to our smtp port.

        mailfrom is the raw address the client claims the message is coming
        from.

        rcpttos is a list of raw addresses the client wishes to deliver the
        message to.

        data is a string containing the entire full text of the message,
        headers (if supplied) and all.  It has been `de-transparencied'
        according to RFC 821, Section 4.5.2.  In other words, a line
        containing a `.' followed by other text has had the leading dot
        removed.

        kwargs is a dictionary containing additional information.  It is
        empty if decode_data=True was given as init parameter, otherwise
        it will contain the following keys:
            'mail_options': list of parameters to the mail command.  All
                            elements are uppercase strings.  Example:
                            ['BODY=8BITMIME', 'SMTPUTF8'].
            'rcpt_options': same, for the rcpt command.

        This function should return None for a normal `250 Ok' response;
        otherwise, it should return the desired response string in RFC 821
        format.

        N)�NotImplementedError�rrJrWrXr�r�rrrr��szSMTPServer.process_message)	rrrrr�r�r7r�r�rrrrrts�
c@seZdZdd�Zdd�ZdS)rcCsld}|��}|D]V}|rL|sLd|d}t|t�s@t|�d��}t|�d}t|t�s^t|�}t|�qdS)Nr$zX-Peer: rry)�
splitlines�
isinstancerrO�encoder)rrJr�Z	inheaders�linesr�Z
peerheaderrrr�_print_message_content�s

z&DebuggingServer._print_message_contentcKsXtd�|r@|�d�r&td|d�|�d�r@td|d�|�||�td�dS)Nz%---------- MESSAGE FOLLOWS ----------r�zmail options: %sr�zrcpt options: %s
z%------------ END MESSAGE ------------)r�getr�r�rrrr��s

zDebuggingServer.process_messageN)rrrr�r�rrrrr�scs,eZdZ�fdd�Zdd�Zdd�Z�ZS)rcs.d|kr|drtd��tt|�j||�dS)Nr<z$PureProxy does not support SMTPUTF8.�r*�superrr7�rrMr��r�rrr7�szPureProxy.__init__c	Csf|�d�}d}|D]}|sq(|d7}q|�|d|d�t�|�}|�|||�}td|td�dS)Nrrr$z
X-Peer: %szwe got some refusals:r)r��insertrAr��_deliverrrP)	rrJrWrXr�r�r�r��refusedrrrr��s


zPureProxy.process_messagec
Cs�ddl}i}zB|��}|�|jd|jd�z|�|||�}W5|��XWn�|jk
r�}ztdtd�|j	}W5d}~XYnft
|jfk
r�}zBtd|jtd�t
|dd�}t
|dd	�}	|D]}
||	f||
<q�W5d}~XYnX|S)
Nrr$zgot SMTPRecipientsRefusedrZgotZ	smtp_code���Z
smtp_error�ignore)�smtplibZSMTPZconnectr��quitZsendmailZSMTPRecipientsRefusedrrPZ
recipientsrKZ
SMTPExceptionr�r�)rrWrXr�r�r��s�eZerrcode�errmsg�rrrrr��s$ zPureProxy._deliver)rrrr7r�r��
__classcell__rrr�rr�scs$eZdZ�fdd�Zdd�Z�ZS)r	cs.d|kr|drtd��tt|�j||�dS)Nr<z'MailmanProxy does not support SMTPUTF8.r�r�r�rrr7
szMailmanProxy.__init__cCs*ddlm}ddlm}ddlm}ddlm}g}	|D]t}
|
���d�d}|�d�}t|�dkrfq8|d}
t|�dkr�|d	}nd
}|�	|
�r8|dkr�q8|	�
|
|
|f�q8|	D]\}
}
}|�|
�q�tdd
�
|�td�|r�|�|||�}td|td�i}||�}|�|�}|�d��s&||d<|�d��sDt�t���|d<|	D]�\}
}
}td|
td�|�|
�}|�s�|j|
dd�}|||
<|d
k�r�|j|d	d�n�|dk�r�|j|d	d�nh|dk�r�|j|d	d�nN|dk�r�|j|d	d�n4|dk�rH|dk�rd|d <nd!|d <|j|d	d��qHdS)"Nr)�StringIO)�Utils)�Message)�MailList�@�-r_r$r)r�admin�owner�requestr��leavezforwarding recips:r�rzwe got refusals:�fromZFrom�dateZDatezsending message to)�lock)�tolistr�)Ztoadminr�)Ztoownerr�)Z	torequest)r�r�r�Z	subscribeZSubjectZunsubscribe)�ior�ZMailmanr�r�r��lowerr�r}Zlist_existsr~�removerr�rPr�r�r�r�ZEnqueue)rrJrWrXr�r�r�r�r�Z	listnamesZrcptZlocal�partsZlistnamer�r�Zmlistsr�rZmlistrrrr�sb










zMailmanProxy.process_message)rrrr7r�r�rrr�rr	sc@seZdZdZdZdZdZdS)�OptionsTrNF)rrr�setuid�	classname�
size_limitr<rrrrr�_sr�c
Cspz.t�tjdd�dddddddd	g�\}}Wn.tjk
r\}ztd|�W5d}~XYnXt�}|D]�\}}|d
kr�td�qh|dkr�tt�t�d�qh|d
kr�d|_	qh|dkr�||_
qh|dkr�tjaqh|dkr�d|_
qh|dkrhzt|�}||_Wqhtd|tjd�t�d�YqhXqht|�dk�r<d}d}nPt|�dk�rX|d}d}n4t|�dk�rx|d}|d}ntddt�|��|�d�}	|	dk�r�tdd|�|d|	�|_zt||	dd��|_Wn$tk
�r�tdd|�YnX|�d�}	|	dk�rtdd|�|d|	�|_zt||	dd��|_Wn$tk
�rjtdd|�YnX|S) Nr$z	nVhc:s:duzclass=Znosetuid�version�helpzsize=�debugr�)z-hz--helpr)z-Vz	--version)z-nz
--nosetuidF)z-cz--class)z-dz--debug)z-uz
--smtputf8T)z-sz--sizezInvalid size: rzlocalhost:8025zlocalhost:25r_�zInvalid arguments: %s�:zBad local spec: %szBad local port: %szBad remote spec: %szBad remote port: %s)�getoptr�argv�errorr#r�rrRr!r�r�r rPr<r�r�r}�
COMMASPACEr�r��	localhost�	localportr*�
remotehost�
remoteport)
ZoptsrMr��options�optr�Zint_sizeZ	localspecZ
remotespecr�rrr�	parseargsfsv��






r
�__main__r1r$)r<z7Cannot import module "pwd"; try running with -n option.r�nobodyr_z3Cannot setuid "nobody"; try running with -n option.)r)@rr�osrNrr�rHr�r5r��warningsrZemail._header_value_parserrr�__all__rZprogramrRr
rPrArr�r#r6rr�rrrr	r�r
rrr��rfindZlastdot�
__import__r�locals�modrr�Zclass_rrr	r
r�r<�proxyr��pwd�ImportErrorrr r!�getpwnamr�PermissionErrorZloop�KeyboardInterruptrrrr�<module>s�N�

M-SB




�__pycache__/genericpath.cpython-38.opt-1.pyc000064400000007643151153537560014661 0ustar00U

e5do�@s�dZddlZddlZddddddd	d
ddd
gZdd�Zdd
�Zdd	�Zdd�Zdd�Zdd�Z	dd�Z
dd�Zdd
�Zdd�Z
dd�Zdd�Zdd�ZdS)z�
Path operations common to more than one OS
Do not use directly.  The OS specific modules import the appropriate
functions from this module themselves.
�N�commonprefix�exists�getatime�getctime�getmtime�getsize�isdir�isfile�samefile�sameopenfile�samestatc	Cs.zt�|�Wnttfk
r(YdSXdS)zDTest whether a path exists.  Returns False for broken symbolic linksFT)�os�stat�OSError�
ValueError)�path�r�#/usr/lib64/python3.8/genericpath.pyrs
c	Cs6zt�|�}Wnttfk
r(YdSXt�|j�S)z%Test whether a path is a regular fileF)r
rrr�S_ISREG�st_mode)r�strrrr	s
c	Cs6zt�|�}Wnttfk
r(YdSXt�|j�S)z<Return true if the pathname refers to an existing directory.F)r
rrr�S_ISDIRr)�srrrrr's
cCst�|�jS)z1Return the size of a file, reported by os.stat().)r
r�st_size��filenamerrrr0scCst�|�jS)zCReturn the last modification time of a file, reported by os.stat().)r
r�st_mtimerrrrr5scCst�|�jS)z=Return the last access time of a file, reported by os.stat().)r
r�st_atimerrrrr:scCst�|�jS)zAReturn the metadata change time of a file, reported by os.stat().)r
r�st_ctimerrrrr?scCsl|sdSt|dttf�s*tttj|��}t|�}t|�}t|�D]$\}}|||krB|d|�SqB|S)zGGiven a list of pathnames, returns the longest common leading component�rN)	�
isinstance�list�tuple�mapr
�fspath�min�max�	enumerate)�m�s1�s2�i�crrrrEscCs|j|jko|j|jkS)z5Test whether two stat buffers reference the same file)�st_ino�st_dev)r)r*rrrrWs
�cCst�|�}t�|�}t||�S)z�Test whether two pathnames reference the same actual file or directory

    This is determined by the device number and i-node number and
    raises an exception if an os.stat() call on either pathname fails.
    )r
rr)�f1�f2r)r*rrrr
^s

cCst�|�}t�|�}t||�S)z:Test whether two open file objects reference the same file)r
�fstatr)�fp1�fp2r)r*rrrrks

cCs�|�|�}|r"|�|�}t||�}|�|�}||krz|d}||krz|||d�|krp|d|�||d�fS|d7}q<||dd�fS)z�Split the extension from a pathname.

    Extension is everything from the last dot to the end, ignoring
    leading dots.  Returns "(root, ext)"; ext may be empty.�Nr)�rfindr&)�p�sep�altsep�extsep�sepIndex�altsepIndex�dotIndex�
filenameIndexrrr�	_splitextys




r>cGs`d}}|D]<}t|t�r d}qt|t�r0d}qt|�d|jj���d�q|r\|r\td�d�dS)NFTz;() argument must be str, bytes, or os.PathLike object, not z.Can't mix strings and bytes in path components)r �str�bytes�	TypeError�	__class__�__name__)�funcname�args�hasstr�hasbytesrrrr�_check_arg_types�s

�rH)�__doc__r
r�__all__rr	rrrrrrrr
rr>rHrrrr�<module>s.
�	
__pycache__/zipimport.cpython-38.opt-2.pyc000064400000032527151153537560014425 0ustar00U

e5d-x�@sNddlZddlmZmZddlZddlZddlZddlZddl	Z	ddl
Z
ddgZejZej
dd�ZGdd�de�ZiZee	�ZdZdZd	ZGd
d�d�Zedddfed
ddfddfZdd�Zdd�Zdd�Zdd�ZdZdadd�Zdd�Z dd�Z!d d!�Z"ee"j#�Z$d"d#�Z%d$d%�Z&d&d'�Z'd(d)�Z(d*d+�Z)d,d-�Z*Gd.d/�d/�Z+dS)0�N)�_unpack_uint16�_unpack_uint32�ZipImportError�zipimporter�c@seZdZdS)rN)�__name__�
__module__�__qualname__�r
r
�!/usr/lib64/python3.8/zipimport.pyr!s�sPKi��c@sheZdZdd�Zddd�Zddd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dS)rc	Cs$t|t�sddl}|�|�}|s,td|d��tr<|�tt�}g}zt�	|�}WnHt
tfk
r�t�|�\}}||kr�td|d��|}|�
|�Yq@X|jd@dkr�td|d��q�q@zt|}Wn$tk
r�t|�}|t|<YnX||_||_tj|ddd��|_|j�r |jt7_dS)Nrzarchive path is empty��pathznot a Zip filei�i����)�
isinstance�str�os�fsdecoder�alt_path_sep�replace�path_sep�_bootstrap_external�
_path_stat�OSError�
ValueError�_path_split�append�st_mode�_zip_directory_cache�KeyError�_read_directory�_files�archive�
_path_join�prefix)�selfrrr$�st�dirname�basename�filesr
r
r�__init__?s:

zzipimporter.__init__NcCsNt||�}|dk	r|gfSt||�}t||�rFd|j�t�|��gfSdgfS�N)�_get_module_info�_get_module_path�_is_dirr"r)r%�fullnamer�mi�modpathr
r
r�find_loaderms



zzipimporter.find_loadercCs|�||�dS)Nr)r2)r%r/rr
r
r�find_module�s	zzipimporter.find_modulecCst||�\}}}|Sr+��_get_module_code�r%r/�code�	ispackager1r
r
r�get_code�szzipimporter.get_codecCsvtr|�tt�}|}|�|jt�r:|t|jt�d�}z|j|}Wn tk
rhtdd|��YnXt	|j|�S)Nr�)
rrr�
startswithr"�lenr!rr�	_get_data)r%�pathname�key�	toc_entryr
r
r�get_data�szzipimporter.get_datacCst||�\}}}|Sr+r4r6r
r
r�get_filename�szzipimporter.get_filenamecCs�t||�}|dkr$td|��|d��t||�}|r@t�|d�}n
|�d�}z|j|}Wntk
rnYdSXt|j|��	�S)N�can't find module ��name�__init__.py�.py)
r,rr-rr#r!rr=r"�decode)r%r/r0r�fullpathr@r
r
r�
get_source�s


zzipimporter.get_sourcecCs(t||�}|dkr$td|��|d��|S)NrCrD)r,r)r%r/r0r
r
r�
is_package�s
zzipimporter.is_packagecCs�t||�\}}}tj�|�}|dks.t|t�s@t|�}|tj|<||_zT|rlt||�}t�	|j
|�}|g|_t|d�s|t
|_
t�|j||�t||j�Wntj|=�YnXztj|}Wn$tk
r�td|�d���YnXt�d||�|S)N�__builtins__zLoaded module z not found in sys.moduleszimport {} # loaded from Zip {})r5�sys�modules�getr�_module_type�
__loader__r-rr#r"�__path__�hasattrrL�_fix_up_module�__dict__�execr�ImportError�
_bootstrap�_verbose_message)r%r/r7r8r1�modrrIr
r
r�load_module�s0


zzipimporter.load_modulecCsXz|�|�sWdSWntk
r*YdSXtjsNddlm}|�t�dt_t||�S)Nr)�ResourceReaderT)rKr�_ZipImportResourceReader�_registered�
importlib.abcr\�register)r%r/r\r
r
r�get_resource_readers


zzipimporter.get_resource_readercCsd|j�t�|j�d�S)Nz<zipimporter object "z">)r"rr$)r%r
r
r�__repr__"szzipimporter.__repr__)N)N)rrr	r*r2r3r9rArBrJrKr[rarbr
r
r
rr-s.
 


&z__init__.pycTrFF)z.pycTF)rGFFcCs|j|�d�dS)N�.�)r$�
rpartition)r%r/r
r
rr-4sr-cCs|t}||jkSr+)rr!)r%r�dirpathr
r
rr.8sr.cCs8t||�}tD]$\}}}||}||jkr|SqdSr+)r-�_zip_searchorderr!)r%r/r�suffix�
isbytecoder8rIr
r
rr,As


r,c	Cs�zt�|�}Wn&tk
r4td|��|d��YnX|���z$|�td�|��}|�t�}Wn&tk
r�td|��|d��YnXt|�tkr�td|��|d��|dd�t	k�r�z|�dd�|��}Wn&tk
r�td|��|d��YnXt
|ttd�}z|�|�|��}Wn(tk
�rJtd|��|d��YnX|�t	�}|dk�rrtd|��|d��|||t�}t|�tk�r�td|��|d��|t|�|}t
|d	d
��}t
|d
d��}	||k�r�td|��|d��||	k�r
td
|��|d��||8}||	}
|
dk�r6td|��|d��i}d}z|�|�Wn(tk
�rttd|��|d��YnX|�d�}t|�dk�r�td��|dd�dk�r��q�t|�dk�r�td��t|dd��}
t|dd	��}t|d	d��}t|dd
��}t
|d
d��}t
|dd��}t
|dd��}t|dd��}t|dd��}t|dd��}t
|dd��}|||}||	k�r�td|��|d��||
7}z|�|�}Wn(tk
�r�td|��|d��YnXt|�|k�r�td|��|d��z2t|�||��||k�r*td|��|d��Wn(tk
�rTtd|��|d��YnX|
d@�rj|��}n6z|�d�}Wn&tk
�r�|�d��t�}YnX|�dt�}t�||�}||||||||f}|||<|d 7}�qvW5QRXt�d!||�|S)"Nzcan't open Zip file: r
rd�can't read Zip file: �rznot a Zip file: zcorrupt Zip file: ���zbad central directory size: zbad central directory offset: z&bad central directory size or offset: �.�EOF read where not expectedsPK��
����� �"�*zbad local header offset: i�ascii�latin1�/rz!zipimport: found {} names in {!r})�_io�	open_coderr�seek�END_CENTRAL_DIR_SIZE�tell�readr<�STRING_END_ARCHIVE�max�MAX_COMMENT_LEN�rfindr�EOFErrorrrH�UnicodeDecodeError�	translate�cp437_tablerrrr#rXrY)r"�fp�header_position�buffer�	file_size�max_comment_start�data�pos�header_size�
header_offset�
arc_offsetr)�count�flags�compress�time�date�crc�	data_size�	name_size�
extra_size�comment_size�file_offsetrEr�tr
r
rr `s�
���

�


�
�






r u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ cCsltrt�d�td��daz<zddlm}Wn&tk
rRt�d�td��YnXW5daXt�d�|S)Nzzipimport: zlib UNAVAILABLE�)can't decompress data; zlib not availableTFr��
decompresszzipimport: zlib available)�_importing_zlibrXrYr�zlibr��	Exceptionr�r
r
r�_get_decompress_func�s


r�c	Cs�|\}}}}}}}}	|dkr$td��t�|���}
z|
�|�Wn&tk
rftd|��|d��YnX|
�d�}t|�dkr�td��|dd�dkr�td	|��|d��t|d
d��}t|dd��}
d||
}||7}z|
�|�Wn(tk
�rtd|��|d��YnX|
�|�}t|�|k�r4td��W5QRX|dk�rL|Sz
t	�}Wnt
k
�rttd
��YnX||d�S)Nrznegative data sizerjr
rvrprksPKzbad local file header: �ruzzipimport: can't read datar�i�)rr}r~rrr�r<r�rr�r�)r"r@�datapathr�r�r�r�r�r�r�r�r�r�r�r��raw_datar�r
r
rr=s>



r=cCst||�dkS)Nr)�abs)�t1�t2r
r
r�	_eq_mtimeAsr�cCs<||d�}zt�|||�}Wntk
r2YdSX|d@dk}|r�|d@dk}tjdkr�|shtjdkr�t||�}	|	dk	r�t�tj|	�}
zt�||
||�Wntk
r�YdSXnTt	||�\}}|�r
t
t|dd��|�r�t|dd	��|k�r
t�
d
|���dSt�|d	d��}
t|
t��s8td|�d���|
S)
N)rErrrrd�never�alwaysrqrlrmzbytecode is stale for zcompiled module z is not a code object)r�
_classify_pycrW�_imp�check_hash_based_pycs�_get_pyc_source�source_hash�_RAW_MAGIC_NUMBER�_validate_hash_pyc�_get_mtime_and_size_of_sourcer�rrXrY�marshal�loadsr�
_code_type�	TypeError)r%r>rIr/r��exc_detailsr��
hash_based�check_source�source_bytesr��source_mtime�source_sizer7r
r
r�_unmarshal_codeKsX�
��
��
���r�cCs|�dd�}|�dd�}|S)Ns
�
�
)r)�sourcer
r
r�_normalize_line_endings~sr�cCst|�}t||ddd�S)NrVT)�dont_inherit)r��compile)r>r�r
r
r�_compile_source�sr�cCsDt�|d?d|d?d@|d@|d?|d?d@|d@dd	d	d	f	�S)
N�	i������?rdr)r��mktime)�dr�r
r
r�_parse_dostime�s



�r�c
Cs`z>|dd�}|j|}|d}|d}|d}t||�|fWStttfk
rZYdSXdS)Nrr���)rr)r!r�r�
IndexErrorr�)r%rr@r�r��uncompressed_sizer
r
rr��s
r�cCsB|dd�}z|j|}Wntk
r0YdSXt|j|�SdS)Nr)r!rr=r")r%rr@r
r
rr��sr�c	Cs�t||�}tD]�\}}}||}tjd|jt|dd�z|j|}Wntk
rXYqX|d}t|j|�}	|r�t	|||||	�}
n
t
||	�}
|
dkr�q|d}|
||fSqtd|��|d��dS)Nz
trying {}{}{}rd)�	verbosityrrCrD)r-rgrXrYr"rr!rr=r�r�r)r%r/rrhrir8rIr@r1r�r7r
r
rr5�s$

r5c@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
r]FcCs||_||_dSr+)rr/)r%rr/r
r
rr*�sz!_ZipImportResourceReader.__init__cCs\|j�dd�}|�d|��}ddlm}z||j�|��WStk
rVt|��YnXdS)Nrcr|r)�BytesIO)r/r�ior�rrAr�FileNotFoundError)r%�resource�fullname_as_pathrr�r
r
r�
open_resource�sz&_ZipImportResourceReader.open_resourcecCst�dSr+)r�)r%r�r
r
r�
resource_path�sz&_ZipImportResourceReader.resource_pathcCsH|j�dd�}|�d|��}z|j�|�Wntk
rBYdSXdS)Nrcr|FT)r/rrrAr)r%rEr�rr
r
r�is_resource�sz$_ZipImportResourceReader.is_resourcec		cs�ddlm}||j�|j��}|�|jj�}|j}t�}|jj	D]f}z||��|�}Wnt
k
rnYq@YnX|jj}t|�dkr�|jVq@||kr@|�
|�|Vq@dS)Nr)�Path)�pathlibr�rrBr/�relative_tor"�parent�setr!rrEr<�add)	r%r��
fullname_path�
relative_path�package_path�subdirs_seen�filename�relative�parent_namer
r
r�contents�s 


z!_ZipImportResourceReader.contentsN)	rrr	r^r*r�r�r�r�r
r
r
rr]�s	r]),�_frozen_importlib_externalrrr�_frozen_importlibrXr�r}r�rMr��__all__r�path_separatorsrrWrr�typerPr�r�r�rrgr-r.r,r r�r�r�r=r�r��__code__r�r�r�r�r�r�r5r]r
r
r
r�<module>sV�		~�.
.

__pycache__/_threading_local.cpython-38.opt-1.pyc000064400000014460151153537560015641 0ustar00U

e5d4�@s^dZddlmZddlmZdgZGdd�d�Zedd��ZGd	d�d�Zdd
l	m
Z
mZdS)a(Thread-local objects.

(Note that this module provides a Python version of the threading.local
 class.  Depending on the version of Python you're using, there may be a
 faster one available.  You should always import the `local` class from
 `threading`.)

Thread-local objects support the management of thread-local data.
If you have data that you want to be local to a thread, simply create
a thread-local object and use its attributes:

  >>> mydata = local()
  >>> mydata.number = 42
  >>> mydata.number
  42

You can also access the local-object's dictionary:

  >>> mydata.__dict__
  {'number': 42}
  >>> mydata.__dict__.setdefault('widgets', [])
  []
  >>> mydata.widgets
  []

What's important about thread-local objects is that their data are
local to a thread. If we access the data in a different thread:

  >>> log = []
  >>> def f():
  ...     items = sorted(mydata.__dict__.items())
  ...     log.append(items)
  ...     mydata.number = 11
  ...     log.append(mydata.number)

  >>> import threading
  >>> thread = threading.Thread(target=f)
  >>> thread.start()
  >>> thread.join()
  >>> log
  [[], 11]

we get different data.  Furthermore, changes made in the other thread
don't affect data seen in this thread:

  >>> mydata.number
  42

Of course, values you get from a local object, including a __dict__
attribute, are for whatever thread was current at the time the
attribute was read.  For that reason, you generally don't want to save
these values across threads, as they apply only to the thread they
came from.

You can create custom local objects by subclassing the local class:

  >>> class MyLocal(local):
  ...     number = 2
  ...     def __init__(self, /, **kw):
  ...         self.__dict__.update(kw)
  ...     def squared(self):
  ...         return self.number ** 2

This can be useful to support default values, methods and
initialization.  Note that if you define an __init__ method, it will be
called each time the local object is used in a separate thread.  This
is necessary to initialize each thread's dictionary.

Now if we create a local object:

  >>> mydata = MyLocal(color='red')

Now we have a default number:

  >>> mydata.number
  2

an initial color:

  >>> mydata.color
  'red'
  >>> del mydata.color

And a method that operates on the data:

  >>> mydata.squared()
  4

As before, we can access the data in a separate thread:

  >>> log = []
  >>> thread = threading.Thread(target=f)
  >>> thread.start()
  >>> thread.join()
  >>> log
  [[('color', 'red')], 11]

without affecting this thread's data:

  >>> mydata.number
  2
  >>> mydata.color
  Traceback (most recent call last):
  ...
  AttributeError: 'MyLocal' object has no attribute 'color'

Note that subclasses can define slots, but they are not thread
local. They are shared across threads:

  >>> class MyLocal(local):
  ...     __slots__ = 'number'

  >>> mydata = MyLocal()
  >>> mydata.number = 42
  >>> mydata.color = 'red'

So, the separate thread:

  >>> thread = threading.Thread(target=f)
  >>> thread.start()
  >>> thread.join()

affects what we see:

  >>> mydata.number
  11

>>> del mydata
�)�ref)�contextmanager�localc@s,eZdZdZdZdd�Zdd�Zdd�Zd	S)
�
_localimplz#A class managing thread-local dicts)�key�dicts�	localargs�	locallock�__weakref__cCsdtt|��|_i|_dS)Nz_threading_local._localimpl.)�str�idrr)�self�r�(/usr/lib64/python3.8/_threading_local.py�__init__�sz_localimpl.__init__cCst�}|jt|�dS)zPReturn the dict for the current thread. Raises KeyError if none
        defined.�)�current_threadrr)r
�threadrrr�get_dict�sz_localimpl.get_dictcshi}|j}t�}t|�}|f�fdd�	}|f�fdd�	}t||��t||���|j|<�|f|j|<|S)z8Create a new dict for the current thread, and return it.cs��}|dk	r|j|=dS�N)�__dict__)�_rr)�wrthreadrr�
local_deleted�sz-_localimpl.create_dict.<locals>.local_deletedcs��}|dk	r|j�|�}dSr)r�pop)r�idtr�dct)�wrlocalrr�thread_deleted�sz._localimpl.create_dict.<locals>.thread_deleted)rrrrrr)r
Z	localdictrrrrrr)rrr�create_dict�s


z_localimpl.create_dictN)�__name__�
__module__�__qualname__�__doc__�	__slots__rrrrrrrr�s
rc	csvt�|d�}z|��}Wn2tk
rJ|��}|j\}}|j||�YnX|j�t�|d|�dVW5QRXdS)N�_local__implr)	�object�__getattribute__r�KeyErrorrrrr	�__setattr__)r
�implr�args�kwrrr�_patch�s
r-c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r)r%rcOsX|s|r|jtjkrtd��t�|�}t�}||f|_t�|_t�|d|�|�	�|S)Nz*Initialization arguments are not supportedr%)
rr&�	TypeError�__new__rr�RLockr	r)r)�clsr+r,r
r*rrrr/�s

z
local.__new__c
Cs,t|��t�||�W5QR�SQRXdSr)r-r&r'�r
�namerrrr'�s
zlocal.__getattribute__c
CsF|dkrtd|jj��t|��t�|||�W5QR�SQRXdS�Nrz+%r object attribute '__dict__' is read-only)�AttributeError�	__class__r r-r&r))r
r3�valuerrrr)�s��
zlocal.__setattr__c
CsD|dkrtd|jj��t|��t�||�W5QR�SQRXdSr4)r5r6r r-r&�__delattr__r2rrrr8�s��
zlocal.__delattr__N)r r!r"r$r/r'r)r8rrrrr�s
)rr0N)r#�weakrefr�
contextlibr�__all__rr-rZ	threadingrr0rrrr�<module>s,

&__pycache__/textwrap.cpython-38.pyc000064400000032321151153537560013276 0ustar00U

e5d�K�@s�dZddlZddddddgZd	ZGd
d�d�Zddd�Zdd
d�Zdd�Ze�dej	�Z
e�dej	�Zdd�Zddd�Z
edkr�eed��dS)zText wrapping and filling.
�N�TextWrapper�wrap�fill�dedent�indent�shortenz	

 c
@s�eZdZdZiZed�ZeD]Zeeee�<qdZ	dZ
de�e�Z
de
dd�Ze�d	e	e
e
ed
�ej�Z[	[
[e�de
�Z[
e�d�Zd&ddd�dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�ZdS)'ra	
    Object for wrapping/filling text.  The public interface consists of
    the wrap() and fill() methods; the other methods are just there for
    subclasses to override in order to tweak the default behaviour.
    If you want to completely replace the main wrapping algorithm,
    you'll probably have to override _wrap_chunks().

    Several instance attributes control various aspects of wrapping:
      width (default: 70)
        the maximum width of wrapped lines (unless break_long_words
        is false)
      initial_indent (default: "")
        string that will be prepended to the first line of wrapped
        output.  Counts towards the line's width.
      subsequent_indent (default: "")
        string that will be prepended to all lines save the first
        of wrapped output; also counts towards each line's width.
      expand_tabs (default: true)
        Expand tabs in input text to spaces before further processing.
        Each tab will become 0 .. 'tabsize' spaces, depending on its position
        in its line.  If false, each tab is treated as a single character.
      tabsize (default: 8)
        Expand tabs in input text to 0 .. 'tabsize' spaces, unless
        'expand_tabs' is false.
      replace_whitespace (default: true)
        Replace all whitespace characters in the input text by spaces
        after tab expansion.  Note that if expand_tabs is false and
        replace_whitespace is true, every tab will be converted to a
        single space!
      fix_sentence_endings (default: false)
        Ensure that sentence-ending punctuation is always followed
        by two spaces.  Off by default because the algorithm is
        (unavoidably) imperfect.
      break_long_words (default: true)
        Break words longer than 'width'.  If false, those words will not
        be broken, and some lines might be longer than 'width'.
      break_on_hyphens (default: true)
        Allow breaking hyphenated words. If true, wrapping will occur
        preferably on whitespaces and right after hyphens part of
        compound words.
      drop_whitespace (default: true)
        Drop leading and trailing whitespace from lines.
      max_lines (default: None)
        Truncate wrapped lines.
      placeholder (default: ' [...]')
        Append to the last line of truncated text.
    � z[\w!"\'&.,?]z[^\d\W]z[%s]z[^�Na�
        ( # any whitespace
          %(ws)s+
        | # em-dash between words
          (?<=%(wp)s) -{2,} (?=\w)
        | # word, possibly hyphenated
          %(nws)s+? (?:
            # hyphenated word
              -(?: (?<=%(lt)s{2}-) | (?<=%(lt)s-%(lt)s-))
              (?= %(lt)s -? %(lt)s)
            | # end of word
              (?=%(ws)s|\Z)
            | # em-dash
              (?<=%(wp)s) (?=-{2,}\w)
            )
        ))Zwp�ltZwsZnwsz(%s+)z[a-z][\.\!\?][\"\']?\Z�F�TF�z [...])�	max_lines�placeholderc
CsL||_||_||_||_||_||_||_||_|	|_|
|_	||_
||_dS�N)�width�initial_indent�subsequent_indent�expand_tabs�replace_whitespace�fix_sentence_endings�break_long_words�drop_whitespace�break_on_hyphens�tabsizerr)
�selfrrrrrrrrrrrr�r� /usr/lib64/python3.8/textwrap.py�__init__sszTextWrapper.__init__cCs(|jr|�|j�}|jr$|�|j�}|S)z�_munge_whitespace(text : string) -> string

        Munge whitespace in text: expand tabs and convert all other
        whitespace characters to spaces.  Eg. " foo\tbar\n\nbaz"
        becomes " foo    bar  baz".
        )r�
expandtabsrr�	translate�unicode_whitespace_trans�r�textrrr�_munge_whitespace�s
zTextWrapper._munge_whitespacecCs6|jdkr|j�|�}n|j�|�}dd�|D�}|S)aN_split(text : string) -> [string]

        Split the text to wrap into indivisible chunks.  Chunks are
        not quite the same as words; see _wrap_chunks() for full
        details.  As an example, the text
          Look, goof-ball -- use the -b option!
        breaks into the following chunks:
          'Look,', ' ', 'goof-', 'ball', ' ', '--', ' ',
          'use', ' ', 'the', ' ', '-b', ' ', 'option!'
        if break_on_hyphens is True, or in:
          'Look,', ' ', 'goof-ball', ' ', '--', ' ',
          'use', ' ', 'the', ' ', '-b', ' ', option!'
        otherwise.
        TcSsg|]}|r|�qSrr)�.0�crrr�
<listcomp>�sz&TextWrapper._split.<locals>.<listcomp>)r�
wordsep_re�split�wordsep_simple_re�rr#�chunksrrr�_split�s

zTextWrapper._splitcCs\d}|jj}|t|�dkrX||ddkrN|||�rNd||d<|d7}q|d7}qdS)ag_fix_sentence_endings(chunks : [string])

        Correct for sentence endings buried in 'chunks'.  Eg. when the
        original text contains "... foo.\nBar ...", munge_whitespace()
        and split() will convert that to [..., "foo.", " ", "Bar", ...]
        which has one too few spaces; this method simply changes the one
        space to two.
        rr	rz  �N)�sentence_end_re�search�len)rr,�iZ	patsearchrrr�_fix_sentence_endings�s	
z!TextWrapper._fix_sentence_endingscCs^|dkrd}n||}|jrH|�|dd|��|d|d�|d<n|sZ|�|���dS)a
_handle_long_word(chunks : [string],
                             cur_line : [string],
                             cur_len : int, width : int)

        Handle a chunk of text (most likely a word, not whitespace) that
        is too long to fit in any line.
        r	���N)r�append�pop)rZreversed_chunks�cur_line�cur_lenrZ
space_leftrrr�_handle_long_word�s
zTextWrapper._handle_long_wordc	Cs�g}|jdkrtd|j��|jdk	rb|jdkr8|j}n|j}t|�t|j���|jkrbtd��|��|�r�g}d}|r�|j}n|j}|jt|�}|j	r�|d�
�dkr�|r�|d=|r�t|d�}|||kr�|�|���||7}q�q�q�|�r&t|d�|k�r&|�
||||�ttt|��}|j	�r\|�r\|d�
�dk�r\|t|d�8}|d=|rj|jdk�s�t|�d|jk�s�|�r�|j	�r�t|�dk�r�|d�
��s�||k�r�|�|d�|��qj|�r0|d�
��r|t|j�|k�r|�|j�|�|d�|���q�|t|d�8}|d=�q�|�rn|d��}t|�t|j�|jk�rn||j|d<�q�|�||j����q�qj|S)a�_wrap_chunks(chunks : [string]) -> [string]

        Wrap a sequence of text chunks and return a list of lines of
        length 'self.width' or less.  (If 'break_long_words' is false,
        some lines may be longer than this.)  Chunks correspond roughly
        to words and the whitespace between them: each chunk is
        indivisible (modulo 'break_long_words'), but a line break can
        come between any two chunks.  Chunks should not have internal
        whitespace; ie. a chunk is either all whitespace or a "word".
        Whitespace chunks will be removed from the beginning and end of
        lines, but apart from that whitespace is preserved.
        rzinvalid width %r (must be > 0)Nr	z#placeholder too large for max widthr4r)r�
ValueErrorrrrr1r�lstrip�reverser�stripr5r6r9�sum�map�join�rstrip)	rr,�linesrr7r8r�lZ	prev_linerrr�_wrap_chunks�s�




 ���
�
���
�zTextWrapper._wrap_chunkscCs|�|�}|�|�Sr)r$r-r"rrr�
_split_chunksPs
zTextWrapper._split_chunkscCs$|�|�}|jr|�|�|�|�S)a^wrap(text : string) -> [string]

        Reformat the single paragraph in 'text' so it fits in lines of
        no more than 'self.width' columns, and return a list of wrapped
        lines.  Tabs in 'text' are expanded with string.expandtabs(),
        and all other whitespace characters (including newline) are
        converted to space.
        )rErr3rDr+rrrrVs	

zTextWrapper.wrapcCsd�|�|��S)z�fill(text : string) -> string

        Reformat the single paragraph in 'text' to fit in lines of no
        more than 'self.width' columns, and return a new string
        containing the entire wrapped paragraph.
        �
)r@rr"rrrrdszTextWrapper.fill)
rrrTTFTTTr
)�__name__�
__module__�__qualname__�__doc__r!�ordZuspace�_whitespace�xZ
word_punctZletter�re�escapeZ
whitespaceZnowhitespace�compile�VERBOSEr(r*r/rr$r-r3r9rDrErrrrrrrsV0���
��!grcKstfd|i|��}|�|�S)a�Wrap a single paragraph of text, returning a list of wrapped lines.

    Reformat the single paragraph in 'text' so it fits in lines of no
    more than 'width' columns, and return a list of wrapped lines.  By
    default, tabs in 'text' are expanded with string.expandtabs(), and
    all other whitespace characters (including newline) are converted to
    space.  See TextWrapper class for available keyword args to customize
    wrapping behaviour.
    r)rr�r#r�kwargs�wrrrrps
cKstfd|i|��}|�|�S)a�Fill a single paragraph of text, returning a new string.

    Reformat the single paragraph in 'text' to fit in lines of no more
    than 'width' columns, and return a new string containing the entire
    wrapped paragraph.  As with wrap(), tabs are expanded and other
    whitespace characters converted to space.  See TextWrapper class for
    available keyword args to customize wrapping behaviour.
    r)rrrRrrrr}s	cKs,tf|dd�|��}|�d�|������S)a�Collapse and truncate the given text to fit in the given width.

    The text first has its whitespace collapsed.  If it then fits in
    the *width*, it is returned as is.  Otherwise, as many words
    as possible are joined and then the placeholder is appended::

        >>> textwrap.shorten("Hello  world!", width=12)
        'Hello world!'
        >>> textwrap.shorten("Hello  world!", width=11)
        'Hello [...]'
    r	)rrr)rrr@r=r)rRrrrr�sz^[ 	]+$z(^[ 	]*)(?:[^ 	
])cCs�d}t�d|�}t�|�}|D]b}|dkr0|}q|�|�r<q|�|�rL|}qtt||��D]$\}\}}||krZ|d|�}qqZqdr�|r�|�d�D]"}|r�|�|�s�td||f��q�|r�t	�d|d|�}|S)a�Remove any common leading whitespace from every line in `text`.

    This can be used to make triple-quoted strings line up with the left
    edge of the display, while still presenting them in the source code
    in indented form.

    Note that tabs and spaces are both treated as whitespace, but they
    are not equal: the lines "  hello" and "\thello" are
    considered to have no common leading whitespace.

    Entirely blank lines are normalized to a newline character.
    NrrrFzline = %r, margin = %rz(?m)^)
�_whitespace_only_re�sub�_leading_whitespace_re�findall�
startswith�	enumerate�zipr)�AssertionErrorrN)r#Zmargin�indentsrr2rM�y�linerrrr�s,



�cs,�dkrdd�����fdd�}d�|��S)aFAdds 'prefix' to the beginning of selected lines in 'text'.

    If 'predicate' is provided, 'prefix' will only be added to the lines
    where 'predicate(line)' is True. If 'predicate' is not provided,
    it will default to adding 'prefix' to all non-empty lines that do not
    consist solely of whitespace characters.
    NcSs|��Sr)r=�r_rrr�	predicate�szindent.<locals>.predicatec3s*��d�D]}�|�r�|n|Vq
dS)NT)�
splitlinesr`�ra�prefixr#rr�prefixed_lines�szindent.<locals>.prefixed_linesr)r@)r#rdrarerrcrr�s�__main__z Hello there.
  This is indented.)r)r)N)rJrN�__all__rLrrrrrP�	MULTILINErUrWrrrG�printrrrr�<module>sa

3
__pycache__/selectors.cpython-38.opt-1.pyc000064400000041051151153537560014362 0ustar00U

e5d�H�@s�dZddlmZmZddlmZddlmZddlZddl	Z	ddl
Z
dZdZdd	�Z
ed
ddd
dg�Zde_e
jdkr�dej_dej_dej_dej_Gdd�de�ZGdd�ded�ZGdd�de�ZGdd�de�ZGdd�de�Zee	d ��rGd!d"�d"e�Zee	d#��r Gd$d%�d%e�Zee	d&��r<Gd'd(�d(e�Zee	d)��rXGd*d+�d+e�Zd+e�k�rjeZn:d%e�k�r|eZn(d(e�k�r�eZnd"e�k�r�eZneZdS),z|Selectors module.

This module allows high-level and efficient I/O multiplexing, built upon the
`select` module primitives.
�)�ABCMeta�abstractmethod)�
namedtuple)�MappingN��c
Csft|t�r|}n<zt|���}Wn*tttfk
rJtd�|��d�YnX|dkrbtd�|���|S)z�Return a file descriptor from a file object.

    Parameters:
    fileobj -- file object or file descriptor

    Returns:
    corresponding file descriptor

    Raises:
    ValueError if the object is invalid
    zInvalid file object: {!r}NrzInvalid file descriptor: {})�
isinstance�int�fileno�AttributeError�	TypeError�
ValueError�format)�fileobj�fd�r�!/usr/lib64/python3.8/selectors.py�_fileobj_to_fds
��r�SelectorKeyrr�events�dataz�SelectorKey(fileobj, fd, events, data)

    Object used to associate a file object to its backing
    file descriptor, selected event mask, and attached data.
)��zFile object registered.zUnderlying file descriptor.z3Events that must be waited for on this file object.zzOptional opaque data associated to this file object.
    For example, this could be used to store a per-client session ID.c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�_SelectorMappingz)Mapping of file objects to selector keys.cCs
||_dS�N)�	_selector)�selfZselectorrrr�__init__?sz_SelectorMapping.__init__cCst|jj�Sr)�lenr�
_fd_to_key�rrrr�__len__Bsz_SelectorMapping.__len__cCsDz|j�|�}|jj|WStk
r>td�|��d�YnXdS�N�{!r} is not registered)r�_fileobj_lookupr�KeyErrorr)rrrrrr�__getitem__Es
z_SelectorMapping.__getitem__cCst|jj�Sr)�iterrrr rrr�__iter__Lsz_SelectorMapping.__iter__N)�__name__�
__module__�__qualname__�__doc__rr!r&r(rrrrr<s
rc@sneZdZdZeddd��Zedd��Zddd�Zedd	d
��Zdd�Z	d
d�Z
edd��Zdd�Zdd�Z
dS)�BaseSelectora-Selector abstract base class.

    A selector supports registering file objects to be monitored for specific
    I/O events.

    A file object is a file descriptor or any object with a `fileno()` method.
    An arbitrary object can be attached to the file object, which can be used
    for example to store context information, a callback, etc.

    A selector can use various implementations (select(), poll(), epoll()...)
    depending on the platform. The default `Selector` class uses the most
    efficient implementation on the current platform.
    NcCst�dS)a3Register a file object.

        Parameters:
        fileobj -- file object or file descriptor
        events  -- events to monitor (bitwise mask of EVENT_READ|EVENT_WRITE)
        data    -- attached data

        Returns:
        SelectorKey instance

        Raises:
        ValueError if events is invalid
        KeyError if fileobj is already registered
        OSError if fileobj is closed or otherwise is unacceptable to
                the underlying system call (if a system call is made)

        Note:
        OSError may or may not be raised
        N��NotImplementedError�rrrrrrr�register_szBaseSelector.registercCst�dS)ajUnregister a file object.

        Parameters:
        fileobj -- file object or file descriptor

        Returns:
        SelectorKey instance

        Raises:
        KeyError if fileobj is not registered

        Note:
        If fileobj is registered but has since been closed this does
        *not* raise OSError (even if the wrapped syscall does)
        Nr.)rrrrr�
unregistervszBaseSelector.unregistercCs|�|�|�|||�S)ayChange a registered file object monitored events or attached data.

        Parameters:
        fileobj -- file object or file descriptor
        events  -- events to monitor (bitwise mask of EVENT_READ|EVENT_WRITE)
        data    -- attached data

        Returns:
        SelectorKey instance

        Raises:
        Anything that unregister() or register() raises
        )r2r1r0rrr�modify�s
zBaseSelector.modifycCst�dS)aqPerform the actual selection, until some monitored file objects are
        ready or a timeout expires.

        Parameters:
        timeout -- if timeout > 0, this specifies the maximum wait time, in
                   seconds
                   if timeout <= 0, the select() call won't block, and will
                   report the currently ready file objects
                   if timeout is None, select() will block until a monitored
                   file object becomes ready

        Returns:
        list of (key, events) for ready file objects
        `events` is a bitwise mask of EVENT_READ|EVENT_WRITE
        Nr.)r�timeoutrrr�select�szBaseSelector.selectcCsdS)zmClose the selector.

        This must be called to make sure that any underlying resource is freed.
        Nrr rrr�close�szBaseSelector.closecCsL|��}|dkrtd��z
||WStk
rFtd�|��d�YnXdS)zzReturn the key associated to a registered file object.

        Returns:
        SelectorKey for this file object
        NzSelector is closedr#)�get_map�RuntimeErrorr%r)rr�mappingrrr�get_key�s
zBaseSelector.get_keycCst�dS)z2Return a mapping of file objects to selector keys.Nr.r rrrr7�szBaseSelector.get_mapcCs|Srrr rrr�	__enter__�szBaseSelector.__enter__cGs|��dSr)r6)r�argsrrr�__exit__�szBaseSelector.__exit__)N)N)N)r)r*r+r,rr1r2r3r5r6r:r7r;r=rrrrr-Ps


r-)�	metaclassc@sTeZdZdZdd�Zdd�Zddd�Zd	d
�Zddd�Zd
d�Z	dd�Z
dd�ZdS)�_BaseSelectorImplzBase selector implementation.cCsi|_t|�|_dSr)rr�_mapr rrrr�sz_BaseSelectorImpl.__init__cCsNz
t|�WStk
rH|j��D]}|j|kr$|jYSq$�YnXdS)alReturn a file descriptor from a file object.

        This wraps _fileobj_to_fd() to do an exhaustive search in case
        the object is invalid but we still have it in our map.  This
        is used by unregister() so we can unregister an object that
        was previously registered even if it is closed.  It is also
        used by _SelectorMapping.
        N)rr
r�valuesrr�rr�keyrrrr$�s	

z!_BaseSelectorImpl._fileobj_lookupNcCsb|r|ttB@r td�|���t||�|�||�}|j|jkrRtd�||j���||j|j<|S)NzInvalid events: {!r}z"{!r} (FD {}) is already registered)	�
EVENT_READ�EVENT_WRITEr
rrr$rrr%�rrrrrCrrrr1�s�z_BaseSelectorImpl.registercCs@z|j�|�|��}Wn$tk
r:td�|��d�YnX|Sr")r�popr$r%rrBrrrr2�s
z_BaseSelectorImpl.unregistercCs�z|j|�|�}Wn$tk
r8td�|��d�YnX||jkr^|�|�|�|||�}n"||jkr�|j|d�}||j|j	<|S)Nr#)r)
rr$r%rrr2r1r�_replacerrFrrrr3�s


z_BaseSelectorImpl.modifycCs|j��d|_dSr)r�clearr@r rrrr6s
z_BaseSelectorImpl.closecCs|jSr)r@r rrrr7sz_BaseSelectorImpl.get_mapcCs(z|j|WStk
r"YdSXdS)z�Return the key associated to a given file descriptor.

        Parameters:
        fd -- file descriptor

        Returns:
        corresponding key, or None if not found
        N)rr%)rrrrr�_key_from_fds	z_BaseSelectorImpl._key_from_fd)N)N)r)r*r+r,rr$r1r2r3r6r7rJrrrrr?�s


r?cs`eZdZdZ�fdd�Zd�fdd�	Z�fdd�Zejd	krHdd
d�Z	ne
j
Z	ddd
�Z
�ZS)�SelectSelectorzSelect-based selector.cst���t�|_t�|_dSr)�superr�set�_readers�_writersr ��	__class__rrr%s
zSelectSelector.__init__Ncs@t��|||�}|t@r&|j�|j�|t@r<|j�|j�|Sr)rLr1rDrN�addrrErOrFrPrrr1*szSelectSelector.registercs,t��|�}|j�|j�|j�|j�|Sr)rLr2rN�discardrrOrBrPrrr22szSelectSelector.unregisterZwin32cCs$t�||||�\}}}|||gfSr)r5)r�r�w�_r4�xrrr�_select9szSelectSelector._selectc	Cs�|dkrdnt|d�}g}z|�|j|jg|�\}}}Wntk
rP|YSXt|�}t|�}||BD]J}d}||kr�|tO}||kr�|tO}|�|�}|rj|�	|||j
@f�qj|S�Nr)�maxrXrNrO�InterruptedErrorrMrDrErJ�appendr)	rr4�readyrTrUrVrrrCrrrr5?s$

zSelectSelector.select)N)N)N)r)r*r+r,rr1r2�sys�platformrXr5�
__classcell__rrrPrrK"s
rKcs^eZdZdZdZdZdZ�fdd�Zd
�fdd�	Z�fdd�Z	d�fd	d
�	Z
ddd�Z�ZS)�_PollLikeSelectorz<Base class shared between poll, epoll and devpoll selectors.Ncst���|��|_dSr)rLr�
_selector_clsrr rPrrr[s
z_PollLikeSelector.__init__cslt��|||�}d}|t@r&||jO}|t@r8||jO}z|j�|j|�Wnt��|��YnX|SrY)	rLr1rD�_EVENT_READrE�_EVENT_WRITErrr2)rrrrrCZ
poller_eventsrPrrr1_s

z_PollLikeSelector.registercs8t��|�}z|j�|j�Wntk
r2YnX|Sr)rLr2rr�OSErrorrBrPrrr2msz_PollLikeSelector.unregistercs�z|j|�|�}Wn$tk
r8t|�d��d�YnXd}||jkr�d}|t@r^||jO}|t@rp||jO}z|j�	|j
|�Wnt��|��YnXd}||j
kr�d}|r�|j||d�}||j|j
<|S)Nz is not registeredFrT)rr)rr$r%rrDrcrErdrr3rrLr2rrH)rrrrrCZchangedZselector_eventsrPrrr3ws.



z_PollLikeSelector.modifycCs�|dkrd}n|dkrd}nt�|d�}g}z|j�|�}Wntk
rV|YSX|D]V\}}d}||j@r||tO}||j@r�|tO}|�	|�}|r\|�
|||j@f�q\|S)Nr�@�@)�math�ceilr�pollr[rcrErdrDrJr\r)rr4r]�
fd_event_listr�eventrrCrrrr5�s(

z_PollLikeSelector.select)N)N)N)
r)r*r+r,rbrcrdrr1r2r3r5r`rrrPrraUs
raric@s"eZdZdZejZejZej	Z
dS)�PollSelectorzPoll-based selector.N)r)r*r+r,r5rirb�POLLINrc�POLLOUTrdrrrrrl�srl�epollcsDeZdZdZejZejZej	Z
dd�Zd	dd�Z�fdd�Z�Z
S)
�
EpollSelectorzEpoll-based selector.cCs
|j��Sr�rr
r rrrr
�szEpollSelector.filenoNc	Cs�|dkrd}n |dkrd}nt�|d�d}tt|j�d�}g}z|j�||�}Wntk
rl|YSX|D]V\}}d}|tj	@r�|t
O}|tj@r�|tO}|�
|�}|rr|�|||j@f�qr|S)N���rrfg����MbP?r)rgrhrZrrrrir[r5�EPOLLINrE�EPOLLOUTrDrJr\r)	rr4�max_evr]rjrrkrrCrrrr5�s*

zEpollSelector.selectcs|j��t���dSr�rr6rLr rPrrr6�s
zEpollSelector.close)N)r)r*r+r,r5rorbrsrcrtrdr
r6r`rrrPrrp�s
 rp�devpollcs:eZdZdZejZejZej	Z
dd�Z�fdd�Z�Z
S)�DevpollSelectorzSolaris /dev/poll selector.cCs
|j��Srrqr rrrr
�szDevpollSelector.filenocs|j��t���dSrrvr rPrrr6�s
zDevpollSelector.close)r)r*r+r,r5rwrbrmrcrnrdr
r6r`rrrPrrx�srx�kqueuecsXeZdZdZ�fdd�Zdd�Zd�fdd�	Z�fd	d
�Zddd�Z�fd
d�Z	�Z
S)�KqueueSelectorzKqueue-based selector.cst���t��|_dSr)rLrr5ryrr rPrrr�s
zKqueueSelector.__init__cCs
|j��Srrqr rrrr
szKqueueSelector.filenoNcs�t��|||�}z`|t@r@t�|jtjtj�}|j�	|gdd�|t
@rnt�|jtjtj�}|j�	|gdd�Wnt��|��YnX|SrY)
rLr1rDr5�keventr�KQ_FILTER_READZ	KQ_EV_ADDr�controlrE�KQ_FILTER_WRITEr2)rrrrrC�kevrPrrr1s ��zKqueueSelector.registercs�t��|�}|jt@rVt�|jtjtj�}z|j	�
|gdd�Wntk
rTYnX|jt@r�t�|jtj
tj�}z|j	�
|gdd�Wntk
r�YnX|SrY)rLr2rrDr5r{rr|ZKQ_EV_DELETErr}rerEr~)rrrCrrPrrr2s$
�
�zKqueueSelector.unregisterc
Cs�|dkrdnt|d�}t|j�}g}z|j�d||�}Wntk
rP|YSX|D]Z}|j}|j}d}|tj	kr||t
O}|tjkr�|tO}|�
|�}	|	rV|�|	||	j@f�qV|SrY)rZrrrr}r[Zident�filterr5r|rDr~rErJr\r)
rr4rur]Zkev_listrr�flagrrCrrrr5)s&




zKqueueSelector.selectcs|j��t���dSrrvr rPrrr6?s
zKqueueSelector.close)N)N)r)r*r+r,rr
r1r2r5r6r`rrrPrrz�s
rz) r,�abcrr�collectionsrZcollections.abcrrgr5r^rDrErr�version_inforrrrrr-r?rKra�hasattrrlrprxrz�globalsZDefaultSelectorrrrr�<module>sL
~T3Z.M__pycache__/calendar.cpython-38.opt-2.pyc000064400000053712151153537560014140 0ustar00U

e5da�@s0ddlZddlZddlZddlmZddddddd	d
ddd
dddddddddddddgZeZGdd�de�Z	Gdd�de�Z
dZdZddd dd!dd!ddd!dd!dg
Z
Gd"d#�d#�ZGd$d%�d%�Zed&�Zed'�Zed(�Zed)�Zed*�\ZZZZZZZd+d�Zd,d�Zd-d	�Zd.d
�Zd/d0�Z d1d2�Z!d3d4�Z"Gd5d�de#�Z$Gd6d�de$�Z%Gd7d�de$�Z&Gd8d9�d9�Z'Gd:d�de%�Z(Gd;d�de&�Z)e%�Z*e*j+Z,d<d�Z-e*j.Z/e*j0Z0e*j1Z2e*j3Z4e*j5Z5e*j6Z7e*j8Z9e*j:Z;d=Z<d>Z=e<e=fd?d@�Z>e<e=fdAdB�Z?dCZ@e�Ae@dd��B�ZCdDd�ZDdEdF�ZEeFdGk�r,eEejG�dS)H�N)�repeat�IllegalMonthError�IllegalWeekdayError�setfirstweekday�firstweekday�isleap�leapdays�weekday�
monthrange�
monthcalendar�prmonth�month�prcal�calendar�timegm�
month_name�
month_abbr�day_name�day_abbr�Calendar�TextCalendar�HTMLCalendar�LocaleTextCalendar�LocaleHTMLCalendar�
weekheaderc@seZdZdd�Zdd�ZdS)rcCs
||_dS�N�r
)�selfr
�r� /usr/lib64/python3.8/calendar.py�__init__szIllegalMonthError.__init__cCs
d|jS)Nz!bad month number %r; must be 1-12r�rrrr�__str__szIllegalMonthError.__str__N��__name__�
__module__�__qualname__r r"rrrrrsc@seZdZdd�Zdd�ZdS)rcCs
||_dSr�r	)rr	rrrr  szIllegalWeekdayError.__init__cCs
d|jS)Nz7bad weekday number %r; must be 0 (Monday) to 6 (Sunday)r'r!rrrr""szIllegalWeekdayError.__str__Nr#rrrrrs�����c@sFeZdZdd�ed�D�Ze�ddd��dd�Zd	d
�Zdd�Zd
S)�_localized_monthcCs g|]}t�d|dd�j�qS�i�r(��datetime�date�strftime��.0�irrr�
<listcomp>4sz_localized_month.<listcomp>�rcCsdS)N�r)�xrrr�<lambda>5�z_localized_month.<lambda>cCs
||_dSr��format�rr=rrrr 7sz_localized_month.__init__cs4�j|}t|t�r&�fdd�|D�S|�j�SdS)Ncsg|]}|�j��qSrr<�r4�fr!rrr6=sz0_localized_month.__getitem__.<locals>.<listcomp>)�_months�
isinstance�slicer=�rr5Zfuncsrr!r�__getitem__:s

z_localized_month.__getitem__cCsdS)N�
rr!rrr�__len__Asz_localized_month.__len__N)	r$r%r&�rangerA�insertr rErGrrrrr-2s
r-c@s6eZdZdd�ed�D�Zdd�Zdd�Zdd	�Zd
S)�_localized_daycCs g|]}t�dd|d�j�qSr.r/r3rrrr6Hsz_localized_day.<listcomp>�cCs
||_dSrr<r>rrrr Jsz_localized_day.__init__cs4�j|}t|t�r&�fdd�|D�S|�j�SdS)Ncsg|]}|�j��qSrr<r?r!rrr6Psz._localized_day.__getitem__.<locals>.<listcomp>)�_daysrBrCr=rDrr!rrEMs

z_localized_day.__getitem__cCsdS�NrKrr!rrrrGTsz_localized_day.__len__N)r$r%r&rHrLr rErGrrrrrJEsrJz%Az%az%Bz%brKcCs$|ddko"|ddkp"|ddkS)N�r�d�r)�yearrrrrdscCs@|d8}|d8}|d|d|d|d|d|dS)Nr(rNrOrPr)Zy1Zy2rrrriscCs8tj|krtjks&nd|d}t�|||���S)Ni�rP)r0ZMINYEARZMAXYEARr1r	)rQr
�dayrrrr	qscCsJd|krdksnt|��t||d�}t||tko>t|�}||fS�Nr(r7)rr	�mdays�Februaryr)rQr
�day1�ndaysrrrr
xs
cCst||tkot|�Sr)rTrUr�rQr
rrr�	_monthlen�srYcCs$|dkr|ddfS||dfSdSrSrrXrrr�
_prevmonth�srZcCs$|dkr|ddfS||dfSdS)Nr7r(rrXrrr�
_nextmonth�sr[c@s�eZdZd"dd�Zdd�Zdd�Zeee�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd#dd�Zd$dd�Zd%dd �Zd!S)&rrcCs
||_dSr�r�rrrrrr �szCalendar.__init__cCs
|jdSrM�Z
_firstweekdayr!rrr�getfirstweekday�szCalendar.getfirstweekdaycCs
||_dSrr^r]rrrr�szCalendar.setfirstweekdayccs&t|j|jd�D]}|dVqdSrM)rHr)rr5rrr�iterweekdays�szCalendar.iterweekdaysccs,|�||�D]\}}}t�|||�VqdSr)�itermonthdays3r0r1)rrQr
�y�m�drrr�itermonthdates�szCalendar.itermonthdatesccsft||�\}}||jd}td|�EdHtd|d�EdH|j||d}td|�EdHdS)NrKrr()r
rrrH)rrQr
rVrW�days_before�
days_afterrrr�
itermonthdays�szCalendar.itermonthdaysccs0t|�||�|j�D]\}}||dfVqdSrM)�	enumeraterhr)rrQr
r5rdrrr�itermonthdays2�szCalendar.itermonthdays2ccs�t||�\}}||jd}|j||d}t||�\}}t||�d}	t|	||	�D]}
|||
fVqXtd|d�D]}
|||
fVqxt||�\}}td|d�D]}
|||
fVq�dS)NrKr()r
rrZrYrHr[)rrQr
rVrWrfrgrbrc�endrdrrrra�szCalendar.itermonthdays3ccs<t|�||��D]&\}\}}}||||j|dfVqdSrM)rirar)rrQr
r5rbrcrdrrr�itermonthdays4�szCalendar.itermonthdays4cs.t|�||����fdd�tdt��d�D�S)Ncsg|]}�||d��qS�rKrr3�Zdatesrrr6�sz/Calendar.monthdatescalendar.<locals>.<listcomp>rrK)�listrerH�len�rrQr
rrnr�monthdatescalendar�szCalendar.monthdatescalendarcs.t|�||����fdd�tdt��d�D�S)Ncsg|]}�||d��qSrmrr3��daysrrr6�sz/Calendar.monthdays2calendar.<locals>.<listcomp>rrK)rorjrHrprqrrsr�monthdays2calendar�szCalendar.monthdays2calendarcs.t|�||����fdd�tdt��d�D�S)Ncsg|]}�||d��qSrmrr3rsrrr6�sz.Calendar.monthdayscalendar.<locals>.<listcomp>rrK)rorhrHrprqrrsr�monthdayscalendar�szCalendar.monthdayscalendar�cs>��fdd�tttd�D����fdd�tdt����D�S)Ncsg|]}���|��qSr)rrr3�rrQrrr6s�z.Calendar.yeardatescalendar.<locals>.<listcomp>r7csg|]}�||���qSrrr3��months�widthrrr6	sr�rH�Januaryrp�rrQr{r�rzrr{rQr�yeardatescalendar�s�zCalendar.yeardatescalendarcs>��fdd�tttd�D����fdd�tdt����D�S)Ncsg|]}���|��qSr)rur3rxrrr6s�z.Calendar.yeardays2calendar.<locals>.<listcomp>r7csg|]}�||���qSrrr3ryrrr6srr|r~rrr�yeardays2calendars�zCalendar.yeardays2calendarcs>��fdd�tttd�D����fdd�tdt����D�S)Ncsg|]}���|��qSr)rvr3rxrrr6s�z-Calendar.yeardayscalendar.<locals>.<listcomp>r7csg|]}�||���qSrrr3ryrrr6"srr|r~rrr�yeardayscalendars�zCalendar.yeardayscalendarN)r)rw)rw)rw)r$r%r&r r_r�propertyrr`rerhrjrarlrrrurvr�r�r�rrrrr�s 

	



c@sfeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zddd
�Zddd�Z	ddd�Z
ddd�Zd dd�ZdS)!rcCst|�||�dd�dS�Nr8)rk)�print�
formatweek�r�theweekr{rrr�prweek+szTextCalendar.prweekcCs |dkrd}nd|}|�|�S)Nrr8z%2i��center)rrRr	r{�srrr�	formatday1szTextCalendar.formatdaycsd���fdd�|D��S)N� c3s |]\}}��||��VqdSr�r��r4rdZwd�rr{rr�	<genexpr>?sz*TextCalendar.formatweek.<locals>.<genexpr>��joinr�rr�rr�;szTextCalendar.formatweekcCs(|dkrt}nt}||d|��|�S�N�	)rrr�)rrRr{�namesrrr�
formatweekdayAszTextCalendar.formatweekdaycsd���fdd����D��S)Nr�c3s|]}��|��VqdSr�r�r3r�rrr�Osz0TextCalendar.formatweekheader.<locals>.<genexpr>�r�r`r�rr�r�formatweekheaderKszTextCalendar.formatweekheaderTcCs"t|}|rd||f}|�|�S�Nz%s %r)rr��r�theyear�themonthr{�withyearr�rrr�formatmonthnameQszTextCalendar.formatmonthnamercCst|�||||�dd�dSr�)r��formatmonth)rr�r��w�lrrrrZszTextCalendar.prmonthcCs�td|�}td|�}|�||d|dd�}|��}|d|7}||�|���7}|d|7}|�||�D]$}||�||���7}|d|7}ql|S)Nr)r(rK�
)�maxr��rstripr�rur�)rr�r�r�r�r��weekrrrr�`s

zTextCalendar.formatmonthr)r(�rwc	s�td|�}td|�}td|�}|ddd�g}|j}|t����|||d����|d|���|��t���|��D�]"\}}	t||dt	||ddd��}
|d|����fdd�|
D�}|t
|�|����|d|��fdd�|
D�}|t
|�|����|d|�td	d�|	D��}
t|
�D]f}g}|	D]6}|t|�k�rj|�d
�n|���|||���qL|t
|�|����|d|��q@q�d
�
|�S)Nr)r(rKr�rFc3s|]}���|�d�VqdS)FN)r��r4�k)�colwidthrr�rrr��s�z*TextCalendar.formatyear.<locals>.<genexpr>c3s|]
}�VqdSrrr�)�headerrrr��scss|]}t|�VqdSr)rp)r4�calrrrr��sr8)r��append�reprr�r�r�rir�rH�min�formatstringrpr�r�)rr�r�r��crc�v�ar5�rowrzr�ZheadersZheight�jZweeksr�r)r�r�rr�r�
formatyearps<


&
$�zTextCalendar.formatyearcCst|�|||||�dd�dSr�)r�r�)rr�r�r�r�rcrrr�pryear�szTextCalendar.pryearN)T)rr)rr)r)r(r�rw)rrr�rw)
r$r%r&r�r�r�r�r�r�rr�r�r�rrrrr%s


	


%c@s~eZdZdddddddgZeZdZd	Zd	Zd
Zd
Z	dd�Z
d
d�Zdd�Zdd�Z
ddd�Zd dd�Zd!dd�Zd"dd�ZdS)#rZmonZtueZwedZthuZfriZsatZsunZnodayr
rQcCs(|dkrd|jSd|j||fSdS)Nrz<td class="%s">&nbsp;</td>z<td class="%s">%d</td>)�cssclass_noday�
cssclasses)rrRr	rrrr��s
zHTMLCalendar.formatdaycs d��fdd�|D��}d|S)Nr8c3s|]\}}��||�VqdSrr�r�r!rrr��sz*HTMLCalendar.formatweek.<locals>.<genexpr>�<tr>%s</tr>r�)rr�r�rr!rr��szHTMLCalendar.formatweekcCsd|j|t|fS�Nz<th class="%s">%s</th>)�cssclasses_weekday_headr)rrRrrrr��s�zHTMLCalendar.formatweekdaycs$d��fdd����D��}d|S)Nr8c3s|]}��|�VqdSrr�r3r!rrr��sz0HTMLCalendar.formatweekheader.<locals>.<genexpr>r�r�)rr�rr!rr��szHTMLCalendar.formatweekheaderTcCs0|rdt||f}ndt|}d|j|fS)N�%s %sz%sz+<tr><th colspan="7" class="%s">%s</th></tr>)r�cssclass_month_head�rr�r�r�r�rrrr��s�zHTMLCalendar.formatmonthnamecCs�g}|j}|d|j�|d�||j|||d��|d�||���|d�|�||�D]}||�|��|d�q\|d�|d�d�|�S)N�=<table border="0" cellpadding="0" cellspacing="0" class="%s">r��r��</table>r8)r��cssclass_monthr�r�rur�r�)rr�r�r�r�r�r�rrrr��s �
zHTMLCalendar.formatmonthrwcCs�g}|j}t|d�}|d|j�|d�|d||j|f�tttd|�D]V}t|t||d��}|d�|D](}|d�||j||d	d
��|d�qr|d�qN|d
�d�|�S)Nr(r�r�z,<tr><th colspan="%d" class="%s">%s</th></tr>r7rFz<tr>z<td>Fr�z</td>z</tr>r�r8)	r�r��
cssclass_year�cssclass_year_headrHr}r�r�r�)rr�r{r�r�r5rzrcrrrr��s,
��

zHTMLCalendar.formatyear�calendar.cssNcCs�|dkrt��}g}|j}|d|�|d�|d�|d�|d|�|dk	r^|d|�|d|�|d�|d	�||�||��|d
�|d�d�|��|d
�S)Nz$<?xml version="1.0" encoding="%s"?>
zn<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
z<html>
z<head>
zC<meta http-equiv="Content-Type" content="text/html; charset=%s" />
z4<link rel="stylesheet" type="text/css" href="%s" />
z<title>Calendar for %d</title>
z</head>
z<body>
z</body>
z</html>
r8�xmlcharrefreplace)�sys�getdefaultencodingr�r�r��encode)rr�r{�css�encodingr�r�rrr�formatyearpage
s$zHTMLCalendar.formatyearpage)T)T)rw)rwr�N)r$r%r&r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr�s



c@s$eZdZdd�Zdd�Zdd�ZdS)�different_localecCs
||_dSr��locale)rr�rrrr #szdifferent_locale.__init__cCs"t�tj�|_t�tj|j�dSr)�_localeZ	getlocale�LC_TIME�	oldlocale�	setlocaler�r!rrr�	__enter__&szdifferent_locale.__enter__cGst�tj|j�dSr)r�r�r�r�)r�argsrrr�__exit__*szdifferent_locale.__exit__N)r$r%r&r r�r�rrrrr�"sr�c@s(eZdZd
dd�Zdd�Zddd	�ZdS)rrNcCs&t�||�|dkrt��}||_dSr)rr r��getdefaultlocaler��rrr�rrrr 6szLocaleTextCalendar.__init__c
CsNt|j��:|dkrt}nt}||}|d|��|�W5QR�SQRXdSr�)r�r�rrr�)rrRr{r��namerrrr�<sz LocaleTextCalendar.formatweekdayTc
CsDt|j��0t|}|r$d||f}|�|�W5QR�SQRXdSr�)r�r�rr�r�rrrr�Es
z"LocaleTextCalendar.formatmonthname)rN)T�r$r%r&r r�r�rrrrr.s
	c@s(eZdZd
dd�Zdd�Zddd	�ZdS)rrNcCs&t�||�|dkrt��}||_dSr)rr r�r�r�r�rrrr TszLocaleHTMLCalendar.__init__c
Cs<t|j��(t|}d|j||fW5QR�SQRXdSr�)r�r�rr�)rrRr�rrrr�Zsz LocaleHTMLCalendar.formatweekdayTc
CsBt|j��.t|}|r$d||f}d|W5QR�SQRXdS)Nr�z.<tr><th colspan="7" class="month">%s</th></tr>)r�r�rr�rrrr�_s
z"LocaleHTMLCalendar.formatmonthname)rN)Tr�rrrrrMs
cCs(t|krtksnt|��|t_dSr)�MONDAY�SUNDAYrr�rr\rrrrls�r�cCstt|||��dSr)r�r��Zcolsr��spacingrrrr=�sr=cs |d9}|��fdd�|D��S)Nr�c3s|]}|���VqdSrr�)r4r��r�rrr��szformatstring.<locals>.<genexpr>r�r�rr�rr��sr�i�cCs^|dd�\}}}}}}t�||d���t|d}|d|}|d|}	|	d|}
|
S)Nr�r(��<)r0r1�	toordinal�
_EPOCH_ORD)�tuplerQr
rRZhourZminute�secondrtZhoursZminutesZsecondsrrrr�scCs�ddl}|��}|�d�}|�d�}|jddtddd�|jd	d
tddd�|jd
dtddd�|jddtddd�|jddddd�|jddddd�|jddddd�|jd d!d"d#d$d%�|jd&d'td(d)�|jd*d'td+d)�|�|dd��}|j�r|j�s|�d,�t	�
d�|j|jf}|jd-k�r�|j�rDt|d.�}nt
�}|j}|dk�rbt	��}t||jd/�}	t	jjj}
|jdk�r�|
|jtj��jf|	��n6|jdk�r�|
|j|jf|	��n|�d0�t	�
d�n�|j�r�t|d.�}nt�}t|j|jd1�}	|jdk�r$|j|	d2<|j|	d3<|jdk�rH|j tj��jf|	�}n2|jdk�rf|j |jf|	�}n|j!|j|jf|	�}t	jj}
|j�r�|�"|j�}t	jjj}
|
|�dS)4Nrztext only argumentszhtml only argumentsz-wz--widthr)z width of date column (default 2))�type�default�helpz-lz--linesr(z)number of lines for each week (default 1)z-sz	--spacingr�z"spacing between months (default 6)z-mz--monthsrwzmonths per row (default 3)z-cz--cssr�zCSS to use for page)r�r�z-Lz--localez.locale to be used from month and weekday namesz-ez
--encodingzencoding to use for outputz-tz--type�text)r��htmlzoutput type (text or html))r��choicesr�rQ�?zyear number (1-9999))�nargsr�r�r
zmonth number (1-12, text only)z/if --locale is specified --encoding is requiredr�r�)r�r�zincorrect number of arguments)r�r�r�rc)#�argparse�ArgumentParserZadd_argument_group�add_argument�int�
parse_argsr�r��errorr��exitr�rrr��dictr��stdout�buffer�writerQr�r0r1Ztodayr
rrr{�linesr�rzr�r�r�)r�r��parserZ	textgroupZ	htmlgroupZoptionsr�r�r�Zoptdictr��resultrrr�main�s�

����������







r�__main__)Hr�r0r�r��	itertoolsr�__all__�
ValueErrorr�rrr}rUrTr-rJrrrrrHr�ZTUESDAYZ	WEDNESDAYZTHURSDAYZFRIDAYZSATURDAYr�rrr	r
rYrZr[�objectrrrr�rrr�r_rrrvrr�r�r�r�rrr�r
r�rr�rZ	_colwidthZ_spacingr=r�ZEPOCHr1r�r�rrr$�argvrrrr�<module>s��
u	
h
__pycache__/shutil.cpython-38.opt-1.pyc000064400000111044151153537560013667 0ustar00U

e5d1��@s�dZddlZddlZddlZddlZddlZddlZzddlZ[dZWne	k
r^dZYnXzddl
Z
[
dZWne	k
r�dZYnXzddlZ[dZ
Wne	k
r�dZ
YnXzddlmZWne	k
r�dZYnXzddlmZWne	k
�rdZYnXejdkZdZZejdk�r6ddlZne�rDddlZe�rNd	nd
Zeed��ohej�d�ae�oxeed
�ZdZdddddddddddddddddd d!d"d#d$d%d&d'gZGd(d�de�ZGd)d'�d'e�Z Gd*d�de�Z!Gd+d�de�Z"Gd,d-�d-e�Z#Gd.d/�d/e$�Z%Gd0d1�d1e$�Z&d2d3�Z'd4d5�Z(efd6d7�Z)d�d8d�Z*d9d:�Z+d;d<�Z,d=d>�Z-dd?�d@d�Z.dd?�dAd�Z/eedB��r�dd?�dCdD�Z0ndEdD�Z0dd?�dFd�Z1dd?�dGd�Z2dd?�dHd�Z3dId#�Z4d�dJdK�Z5dde3ddfdLd�Z6eej7dM��rdNdO�Z8dPdQ�Z9ndRdO�Z8dSdQ�Z9dTdU�Z:dVdW�Z;ej<ejej=ej>hej?k�ofej@ejAk�ofejejBkZCd�dXd�ZDeCeD_EdYdZ�ZFe3fd[d�ZGd\d]�ZHd^d_�ZId`da�ZJdbdc�ZKd�dedf�ZLd�dgdh�ZMdieLdjgdkfiZNe�r�eLdlgdmfeNdn<eMgdofeNdp<e�r
eLdqgdrfeNds<e
�r eLdtgdufeNdv<dwd�ZOd�dyd�ZPdzd�ZQd�d{d�ZRd|d�ZSd}d~�ZTd�dd �ZUd�d!�ZVd�d��ZWd�d��ZXdd��d�d��ZYd�geYgdkfd�geXgdofd��ZZe�r�d�d�geYgdmfeZdn<e�r�d�d�geYgdrfeZds<e
�r�d�d�geYgdufeZdv<d�d��Z[d�dd��d�d"�Z\eed���rLe�]d��e�^d�d��Z_d�e_j`_d�e_ja_d�e_jb_d�d��Zcn$e�rpe�]d��e�^d�d��Z_d�d��Zcd�d�d$�Zdd�d�d&�Zed�d��ZfejgejhBdfd�d%�ZidS)�z�Utility functions for copying and archiving files and directory trees.

XXX The functions here don't copy the resource fork or other metadata on Mac.

�NTF)�getpwnam)�getgrnam�nt�posixii�sendfileZlinux�
_fcopyfilez%.COM;.EXE;.BAT;.CMD;.VBS;.JS;.WS;.MSC�copyfileobj�copyfile�copymode�copystat�copy�copy2�copytree�move�rmtree�Error�SpecialFileError�	ExecError�make_archive�get_archive_formats�register_archive_format�unregister_archive_format�get_unpack_formats�register_unpack_format�unregister_unpack_format�unpack_archive�ignore_patterns�chown�which�get_terminal_size�
SameFileErrorc@seZdZdS)rN)�__name__�
__module__�__qualname__�r$r$�/usr/lib64/python3.8/shutil.pyrEsc@seZdZdZdS)r z5Raised when source and destination are the same file.N�r!r"r#�__doc__r$r$r$r%r Hsc@seZdZdZdS)rz|Raised when trying to do a kind of operation (e.g. copying) which is
    not supported on a special file (e.g. a named pipe)Nr&r$r$r$r%rKsc@seZdZdZdS)rz+Raised when a command could not be executedNr&r$r$r$r%rOsc@seZdZdZdS)�	ReadErrorz%Raised when an archive cannot be readNr&r$r$r$r%r(Rsr(c@seZdZdZdS)�
RegistryErrorzVRaised when a registry operation with the archiving
    and unpacking registries failsNr&r$r$r$r%r)Usr)c@seZdZdZdS)�_GiveupOnFastCopyzuRaised as a signal to fallback on using raw read()/write()
    file copy when fast-copy functions fail to do so.
    Nr&r$r$r$r%r*Ysr*c
Cs�z|��}|��}Wn*tk
r>}zt|��W5d}~XYnXzt�|||�WnTtk
r�}z6|j|_|j|_|j	t	j
t	jhkr�t|��n|d�W5d}~XYnXdS)zhCopy a regular file content or metadata by using high-performance
    fcopyfile(3) syscall (macOS).
    N)�fileno�	Exceptionr*rr�OSError�name�filename�	filename2�errno�EINVAL�ENOTSUP)�fsrc�fdst�flags�infd�outfd�errr$r$r%�_fastcopy_fcopyfile^s
r:c
CsDz|��}|��}Wn*tk
r>}zt|��W5d}~XYnXztt�|�jd�}Wntk
rnd}YnXtj	dkr�t
|d�}d}zt�||||�}Wn�tk
�r&}zj|j|_
|j|_|jtjkr�dat|��|jtjkr�|d�|dk�rt�|dtj�dk�rt|��|�W5d}~XYq�X|dk�r6�q@||7}q�dS)z�Copy data from one regular mmap-like fd to another by using
    high-performance sendfile(2) syscall.
    This should work on Linux >= 2.6.33 only.
    Ni�ili@rF)r+r,r*�max�os�fstat�st_sizer-�sys�maxsize�minrr.r/r0r1ZENOTSOCK�_USE_CP_SENDFILEZENOSPC�lseek�SEEK_CUR)r4r5r7r8r9Z	blocksize�offsetZsentr$r$r%�_fastcopy_sendfilers8


 
rFc
Csn|j}|j}tt|���L}||�}|s*q`q||krV|d|��}|�|�W5QRXq||�qW5QRXdS)z�readinto()/memoryview() based variant of copyfileobj().
    *fsrc* must support readinto() method and both files must be
    open in binary mode.
    N)�readinto�write�
memoryview�	bytearray)r4r5�lengthZ
fsrc_readinto�
fdst_writeZmv�nZsmvr$r$r%�_copyfileobj_readinto�srNcCs0|st}|j}|j}||�}|s"q,||�qdS)z=copy data from file-like object fsrc to file-like object fdstN)�COPY_BUFSIZE�readrH)r4r5rKZ	fsrc_readrLZbufr$r$r%r�scCs�t|tj�rJttjd�rJztj�|��t�|��WStk
rHYdSXttjd�r~ztj�||�WStk
r|YdSXtj�	tj�
|��tj�	tj�
|��kS)N�samestatF�samefile)�
isinstancer<�DirEntry�hasattr�pathrQ�statr-rR�normcase�abspath��src�dstr$r$r%�	_samefile�s�r]cCst|tj�r|��St�|�S�N)rSr<rTrW��fnr$r$r%�_stat�sracCs t|tj�r|��Stj�|�Sr^)rSr<rT�
is_symlinkrV�islinkr_r$r$r%�_islink�srd��follow_symlinksc	Cs�t�d||�t||�r(td�||���d}t||g�D]j\}}zt|�}Wntk
r`Yq8Xt�	|j
�r�t|tj
�r�|jn|}td|��tr8|dkr8|j}q8|s�t|�r�t�t�|�|��n
t|d����}t|d���}t�r,z,t||tj�|WW5QR�W5QR�Stk
�r(YnXn�t�rtz(t||�|WW5QR�W5QR�Stk
�rpYnXn>t�r�|dk�r�t||t|t��|W5QR�W5QR�St ||�W5QRXW5QRX|S)z�Copy data from src to dst in the most efficient way possible.

    If follow_symlinks is not set and src is a symbolic link, a new
    symlink will be created instead of copying the file it points to.

    zshutil.copyfilez{!r} and {!r} are the same filerz`%s` is a named pipe�rb�wb)!r?�auditr]r �format�	enumeraterar-rW�S_ISFIFO�st_moderSr<rTrVr�_WINDOWSr>rd�symlink�readlink�open�_HAS_FCOPYFILEr:rZ_COPYFILE_DATAr*rBrFrNrArOr)	r[r\rf�	file_size�ir`�str4r5r$r$r%r	�sD

cCspt�d||�|sFt|�rFtj�|�rFttd�r@tjtj}}qRdSnt	tj
}}||�}||t�|j
��dS)z�Copy mode bits from src to dst.

    If follow_symlinks is not set, symlinks aren't followed if and only
    if both `src` and `dst` are symlinks.  If `lchmod` isn't available
    (e.g. Linux) this method does nothing.

    zshutil.copymode�lchmodN)r?rirdr<rVrcrU�lstatrvra�chmodrW�S_IMODErm)r[r\rfZ	stat_funcZ
chmod_funcrur$r$r%r
!s
�	listxattrcCs�ztj||d�}Wn@tk
rR}z"|jtjtjtjfkr<�WY�dSd}~XYnX|D]j}z&tj|||d�}tj||||d�WqXtk
r�}z |jtj	tjtjtjfkr��W5d}~XYqXXqXdS)z�Copy extended filesystem attributes from `src` to `dst`.

        Overwrite existing attributes.

        If `follow_symlinks` is false, symlinks won't be followed.

        reN)
r<rzr-r1r3ZENODATAr2�getxattr�setxattrZEPERM)r[r\rf�names�er.�valuer$r$r%�
_copyxattr7s	�r�cOsdSr^r$)�args�kwargsr$r$r%r�Osc	
s`t�d||�ddd�dd��|p6t|�o4tj�|�}|rJ�fdd�}n�fdd�}t|tj�rp|j|d	�}n|d
�||d	�}t�	|j
�}|d�||j|jf|d�t
|||d	�z|d�|||d	�Wntk
r�YnXt|d
��r\z|d�||j|d	�WnVtk
�rZ}z6dD]*}tt|��r|jtt|�k�r�qJ�q�W5d}~XYnXdS)a�Copy file metadata

    Copy the permission bits, last access time, last modification time, and
    flags from `src` to `dst`. On Linux, copystat() also copies the "extended
    attributes" where possible. The file contents, owner, and group are
    unaffected. `src` and `dst` are path-like objects or path names given as
    strings.

    If the optional flag `follow_symlinks` is not set, symlinks aren't
    followed if and only if both `src` and `dst` are symlinks.
    zshutil.copystatN)�nsrfcWsdSr^r$)r�rfr�r$r$r%�_nop`szcopystat.<locals>._nopcstt|��Sr^)�getattrr<�r.�r�r$r%�lookupgszcopystat.<locals>.lookupcstt|��}|tjkr|S�Sr^)r�r<�supports_follow_symlinks)r.r`r�r$r%r�ls
rerW�utimerx�st_flagsZchflags)Z
EOPNOTSUPPr3)r?rirdr<rVrcrSrTrWryrm�st_atime_ns�st_mtime_nsr��NotImplementedErrorrUr�r-r1r�)	r[r\rfZfollowr�ru�mode�whyr9r$r�r%rRs4�
cCsBtj�|�r"tj�|tj�|��}t|||d�t|||d�|S)a3Copy data and mode bits ("cp src dst"). Return the file's destination.

    The destination may be a directory.

    If follow_symlinks is false, symlinks won't be followed. This
    resembles GNU's "cp -P src dst".

    If source and destination are the same file, a SameFileError will be
    raised.

    re)r<rV�isdir�join�basenamer	r
�r[r\rfr$r$r%r�s
cCsBtj�|�r"tj�|tj�|��}t|||d�t|||d�|S)a0Copy data and metadata. Return the file's destination.

    Metadata is copied with copystat(). Please see the copystat function
    for more information.

    The destination may be a directory.

    If follow_symlinks is false, symlinks won't be followed. This
    resembles GNU's "cp -P src dst".
    re)r<rVr�r�r�r	rr�r$r$r%r
�s
cs�fdd�}|S)z�Function that can be used as copytree() ignore parameter.

    Patterns is a sequence of glob-style patterns
    that are used to exclude filescs(g}�D]}|�t�||��qt|�Sr^)�extend�fnmatch�filter�set)rVr}�
ignored_names�pattern��patternsr$r%�_ignore_patterns�sz)ignore_patterns.<locals>._ignore_patternsr$)r�r�r$r�r%r�scCs>|dk	r$|t�|�dd�|D��}nt�}tj||d�g}	|tkpJ|tk}
|D�]~}|j|krbqPtj�||j�}tj�||j�}
|
r�|n|}z�|�	�}|r�tjdkr�|j
dd�}|jt
jkr�d}|�r8t�
|�}|r�t�||
�t||
|d�nBtj�|��s|�rWqP|���r,t||
||||d�n
|||
�n*|���rXt||
||||d�n
|||
�WqPtk
�r�}z|	�|jd�W5d}~XYqPtk
�r�}z|	�||
t|�f�W5d}~XYqPXqPzt||�WnJtk
�r*}z*t|d	d�dk�r|	�||t|�f�W5d}~XYnX|	�r:t|	��|S)
NcSsg|]
}|j�qSr$r�)�.0�xr$r$r%�
<listcomp>�sz_copytree.<locals>.<listcomp>)�exist_okrFre)�
dirs_exist_okrZwinerror)r<�fspathr��makedirsr
rr.rVr�rbrW�st_reparse_tag�IO_REPARSE_TAG_MOUNT_POINTrpror�exists�is_dirrrr�r�r-�append�strr�)�entriesr[r\�symlinks�ignore�
copy_function�ignore_dangling_symlinksr�r��errorsZuse_srcentryZsrcentryZsrcnameZdstnameZsrcobjrbrw�linktor9r�r$r$r%�	_copytree�s`




�
� (&r�c	
CsDt�d||�t�|��}t|�}W5QRXt||||||||d�S)aeRecursively copy a directory tree and return the destination directory.

    dirs_exist_ok dictates whether to raise an exception in case dst or any
    missing parent directory already exists.

    If exception(s) occur, an Error is raised with a list of reasons.

    If the optional symlinks flag is true, symbolic links in the
    source tree result in symbolic links in the destination tree; if
    it is false, the contents of the files pointed to by symbolic
    links are copied. If the file pointed by the symlink doesn't
    exist, an exception will be added in the list of errors raised in
    an Error exception at the end of the copy process.

    You can set the optional ignore_dangling_symlinks flag to true if you
    want to silence this exception. Notice that this has no effect on
    platforms that don't support os.symlink.

    The optional ignore argument is a callable. If given, it
    is called with the `src` parameter, which is the directory
    being visited by copytree(), and `names` which is the list of
    `src` contents, as returned by os.listdir():

        callable(src, names) -> ignored_names

    Since copytree() is called recursively, the callable will be
    called once for each directory that is copied. It returns a
    list of names relative to the `src` directory that should
    not be copied.

    The optional copy_function argument is a callable that will be used
    to copy each file. It will be called with the source path and the
    destination path as arguments. By default, copy2() is used, but any
    function that supports the same signature (like copy()) can be used.

    zshutil.copytree)r�r[r\r�r�r�r�r�)r?rir<�scandir�listr�)	r[r\r�r�r�r�r�Zitrr�r$r$r%rs&
��st_file_attributescCsPz4|jdd�}t�|j�o2|jtj@o0|jtjkWStk
rJYdSXdS�NFre)rW�S_ISDIRrmr��FILE_ATTRIBUTE_REPARSE_POINTr�r�r-)�entryrur$r$r%�
_rmtree_isdir6s
�r�cCsLz0t�|�}t�|j�p.|jtj@o.|jtjkWSt	k
rFYdSXdS)NF)
r<rwrW�S_ISLNKrmr�r�r�r�r-)rVrur$r$r%�_rmtree_islink?s

�r�cCs*z|jdd�WStk
r$YdSXdSr�)r�r-)r�r$r$r%r�HscCstj�|�Sr^)r<rVrc)rVr$r$r%r�Nsc	Cs&z"t�|��}t|�}W5QRXWn*tk
rL|tj|t���g}YnX|D]�}|j}t|�r�z|��rvtd��Wn,tk
r�|tjj	|t���YqRYnXt
||�qRzt�|�WqRtk
r�|tj|t���YqRXqRzt�|�Wn(tk
�r |tj|t���YnXdS)N�%Cannot call rmtree on a symbolic link)
r<r�r�r-r?�exc_inforVr�rbrc�_rmtree_unsafe�unlink�rmdir)rV�onerror�
scandir_itr�r��fullnamer$r$r%r�Rs0

r�c
Cs.z"t�|��}t|�}W5QRXWn@tk
rb}z"||_|tj|t���WY�dSd}~XYnX|D�]�}tj�||j	�}z|j
dd�}Wntk
r�d}YnNX|r�z|jdd�}	t�|	j
�}Wn*tk
r�|tj|t���YqhYnX|�r�ztj|j	tj|d�}
Wn(tk
�r:|tj|t���Yn�Xz�tj�|	t�|
���r�t|
||�ztj|j	|d�Wn(tk
�r�|tj|t���YnXn8ztd��Wn*tk
�r�|tjj|t���YnXW5t�|
�Xqhztj|j	|d�Wqhtk
�r&|tj|t���YqhXqhdS)NFre)�dir_fdr�)r<r�r�r-r/r?r�rVr�r.r�rWr�rmrwrq�O_RDONLY�closerQr=�_rmtree_safe_fdr�rcr�)�topfdrVr�r�r�r9r�r�r��orig_st�dirfdr$r$r%r�qsR


r�c	Cs�t�d|�|rdd�}n|dkr*dd�}t�r`t|t�rDt�|�}zt�|�}Wn(tk
rz|tj|t�	��YdSXzt�
|tj�}Wn(tk
r�|tj
|t�	��YdSXz�tj
�|t�|���rt|||�zt�|�Wn(tk
�r|tj|t�	��YnXn8ztd��Wn*tk
�rL|tj
j|t�	��YnXW5t�|�XnNzt|��rttd��Wn,tk
�r�|tj
j|t�	��YdSXt||�SdS)a�Recursively delete a directory tree.

    If ignore_errors is set, errors are ignored; otherwise, if onerror
    is set, it is called to handle the error with arguments (func,
    path, exc_info) where func is platform and implementation dependent;
    path is the argument to that function that caused it to fail; and
    exc_info is a tuple returned by sys.exc_info().  If ignore_errors
    is false and onerror is None, an exception is raised.

    z
shutil.rmtreecWsdSr^r$�r�r$r$r%r��szrmtree.<locals>.onerrorNcWs�dSr^r$r�r$r$r%r��sr�)r?ri�_use_fd_functionsrS�bytesr<�fsdecoderwr,r�rqr�r�rVrQr=r�r�r-rcr�r�)rV�
ignore_errorsr�r��fdr$r$r%r�sJ



cCs&tjjtjjpd}tj�|�|��S)N�)r<rV�sep�altsepr��rstrip)rVr�r$r$r%�	_basename�sr�c	CsTt�d||�|}tj�|�rbt||�r8t�||�dStj�|t|��}tj�	|�rbt
d|��zt�||�Wn�tk
�rNtj�|�r�t�
|�}t�||�t�|�n�tj�|��r6t||�r�t
d||f��t|��st�|tj��st�|��rtjdk�rtd||f��t|||dd�t|�n|||�t�|�YnX|S)	a+Recursively move a file or directory to another location. This is
    similar to the Unix "mv" command. Return the file or directory's
    destination.

    If the destination is a directory or a symlink to a directory, the source
    is moved inside the directory. The destination path must not already
    exist.

    If the destination already exists but is not a directory, it may be
    overwritten depending on os.rename() semantics.

    If the destination is on our current filesystem, then rename() is used.
    Otherwise, src is copied to the destination and then removed. Symlinks are
    recreated under the new name if os.rename() fails because of cross
    filesystem renames.

    The optional `copy_function` argument is a callable that will be used
    to copy the source or it will be delegated to `copytree`.
    By default, copy2() is used, but any function that supports the same
    signature (like copy()) can be used.

    A lot more could be done here...  A look at a mv.c shows a lot of
    the issues this implementation glosses over.

    zshutil.moveNz$Destination path '%s' already existsz.Cannot move a directory '%s' into itself '%s'.�darwinzKCannot move the non-empty directory '%s': Lacking write permission to '%s'.T)r�r�)r?rir<rVr�r]�renamer�r�r�rr-rcrpror��
_destinsrc�
_is_immutable�access�W_OK�listdir�platform�PermissionErrorrr)r[r\r�Zreal_dstr�r$r$r%r�sL


�
�����

cCsVtj�|�}tj�|�}|�tjj�s2|tjj7}|�tjj�sL|tjj7}|�|�Sr^)r<rVrY�endswithr��
startswithrZr$r$r%r�/sr�cCs(t|�}tjtjg}t|d�o&|j|kS)Nr�)rarW�UF_IMMUTABLE�SF_IMMUTABLErUr�)r[ruZimmutable_statesr$r$r%r�8sr�cCsNtdks|dkrdSzt|�}Wntk
r8d}YnX|dk	rJ|dSdS)z"Returns a gid, given a group name.N�)r�KeyError�r.�resultr$r$r%�_get_gid=s
r�cCsNtdks|dkrdSzt|�}Wntk
r8d}YnX|dk	rJ|dSdS)z"Returns an uid, given a user name.Nr�)rr�r�r$r$r%�_get_uidIs
r��gzipcs |dkrd}nDtr |dkr d}n2tr2|dkr2d}n trD|dkrDd}ntd�|���d	dl}	|rfd
|nd}
|d|
}tj�|�}|r�tj�	|�s�|dk	r�|�
d|�|s�t�|�|dk	r�|�
d
�t���t
�������fdd�}
|�s|	�|d|�}z|j||
d�W5|��X|S)a�Create a (possibly compressed) tar file from all the files under
    'base_dir'.

    'compress' must be "gzip" (the default), "bzip2", "xz", or None.

    'owner' and 'group' can be used to define an owner and a group for the
    archive that is being built. If not provided, the current owner and group
    will be used.

    The output tar file will be named 'base_name' +  ".tar", possibly plus
    the appropriate compression extension (".gz", ".bz2", or ".xz").

    Returns the output filename.
    Nr�r�Zgz�bzip2�bz2�xzzCbad value for 'compress', or compression format not supported : {0}r�.�.tar�creating %szCreating tar archivecs,�dk	r�|_�|_�dk	r(�|_�|_|Sr^)�gidZgname�uid�uname)Ztarinfo�r��group�ownerr�r$r%�_set_uid_gid�sz#_make_tarball.<locals>._set_uid_gidzw|%s�r�)�_ZLIB_SUPPORTED�_BZ2_SUPPORTED�_LZMA_SUPPORTED�
ValueErrorrj�tarfiler<rV�dirnamer��infor�r�r�rqr��add)�	base_name�base_dir�compress�verbose�dry_runr�r��loggerZtar_compressionr�Zcompress_extZarchive_name�archive_dirr��tarr$r�r%�
_make_tarballUs>�

	
r	c	Csnddl}|d}tj�|�}|rNtj�|�sN|dk	r@|�d|�|sNt�|�|dk	rd|�d||�|�sj|j|d|jd���}tj�	|�}	|	tj
kr�|�|	|	�|dk	r�|�d|	�t�|�D]�\}
}}t
|�D]:}
tj�	tj�|
|
��}	|�|	|	�|dk	r�|�d|	�q�|D]L}
tj�	tj�|
|
��}	tj�|	��r|�|	|	�|dk	�r|�d|	��qq�W5QRX|S)	z�Create a zip file from all the files under 'base_dir'.

    The output zip file will be named 'base_name' + ".zip".  Returns the
    name of the output zip file.
    rN�.zipr�z#creating '%s' and adding '%s' to it�w)Zcompressionzadding '%s')�zipfiler<rVr�r�r�r��ZipFileZZIP_DEFLATED�normpath�curdirrH�walk�sortedr��isfile)rrrrrrZzip_filenamerZzfrV�dirpathZdirnames�	filenamesr.r$r$r%�
_make_zipfile�sH
��

rr)rNzuncompressed tar file)rr�zgzip'ed tar-fileZgztarzZIP file�zip)rr�zbzip2'ed tar-fileZbztar)rr�zxz'ed tar-fileZxztarcCsdd�t��D�}|��|S)z�Returns a list of supported formats for archiving and unarchiving.

    Each element of the returned sequence is a tuple (name, description)
    cSsg|]\}}||df�qS)r�r$)r�r.�registryr$r$r%r��sz'get_archive_formats.<locals>.<listcomp>)�_ARCHIVE_FORMATS�items�sort�Zformatsr$r$r%r�s
�r�cCst|dkrg}t|�s td|��t|ttf�s6td��|D]&}t|ttf�rXt|�dkr:td��q:|||ft|<dS)auRegisters an archive format.

    name is the name of the format. function is the callable that will be
    used to create archives. If provided, extra_args is a sequence of
    (name, value) tuples that will be passed as arguments to the callable.
    description can be provided to describe the format, and will be returned
    by the get_archive_formats() function.
    NzThe %s object is not callablez!extra_args needs to be a sequencer�z+extra_args elements are : (arg_name, value))�callable�	TypeErrorrS�tupler��lenr)r.�function�
extra_args�descriptionZelementr$r$r%r�s	
cCs
t|=dSr^)rr�r$r$r%r�sc	
Cst�d||||�t��}	|dk	rP|dk	r6|�d|�tj�|�}|sPt�|�|dkr^tj}||d�}
zt	|}Wn"t
k
r�td|�d�YnX|d}|dD]\}
}||
|
<q�|dkr�||
d	<||
d
<z|||f|
�}W5|dk	�r|dk	�r|�d|	�t�|	�X|S)aCreate an archive file (eg. zip or tar).

    'base_name' is the name of the file to create, minus any format-specific
    extension; 'format' is the archive format: one of "zip", "tar", "gztar",
    "bztar", or "xztar".  Or any other registered format.

    'root_dir' is a directory that will be the root directory of the
    archive; ie. we typically chdir into 'root_dir' before creating the
    archive.  'base_dir' is the directory where we start archiving from;
    ie. 'base_dir' will be the common prefix of all files and
    directories in the archive.  'root_dir' and 'base_dir' both default
    to the current directory.  Returns the name of the archive file.

    'owner' and 'group' are used when creating a tar archive. By default,
    uses the current owner and group.
    zshutil.make_archiveNzchanging into '%s')rrzunknown archive format '%s'r�rr�r�zchanging back to '%s')r?rir<�getcwd�debugrVrY�chdirrrr�r�)rrjZroot_dirrrrr�r�rZsave_cwdr��format_info�func�arg�valr/r$r$r%r�s8




cCsdd�t��D�}|��|S)z�Returns a list of supported formats for unpacking.

    Each element of the returned sequence is a tuple
    (name, extensions, description)
    cSs"g|]\}}||d|df�qS)r�r$)r�r.r�r$r$r%r�3sz&get_unpack_formats.<locals>.<listcomp>)�_UNPACK_FORMATSrrrr$r$r%r-s
�c	Csji}t��D]\}}|dD]}|||<qq|D]$}||kr0d}t||||f��q0t|�sftd��dS)z+Checks what gets registered as an unpacker.rz!%s is already registered for "%s"z*The registered function must be a callableN)r,rr)rr)	�
extensionsr r!Zexisting_extensionsr.r��ext�	extension�msgr$r$r%�_check_unpack_options8s�
r1cCs,|dkrg}t|||�||||ft|<dS)aMRegisters an unpack format.

    `name` is the name of the format. `extensions` is a list of extensions
    corresponding to the format.

    `function` is the callable that will be
    used to unpack archives. The callable will receive archives to unpack.
    If it's unable to handle an archive, it needs to raise a ReadError
    exception.

    If provided, `extra_args` is a sequence of
    (name, value) tuples that will be passed as arguments to the callable.
    description can be provided to describe the format, and will be returned
    by the get_unpack_formats() function.
    N)r1r,)r.r-r r!r"r$r$r%rJscCs
t|=dS)z*Removes the pack format from the registry.N)r,r�r$r$r%r`scCs&tj�|�}tj�|�s"t�|�dS)z1Ensure that the parent directory of `path` existsN)r<rVr�r�r�)rVr�r$r$r%�_ensure_directorydsr2c		Cs�ddl}|�|�std|��|�|�}z�|��D]�}|j}|�d�s2d|krPq2tj	j
|f|�d���}|snq2t|�|�
d�s2|�|j�}t|d�}z|�|�W5|��~Xq2W5|��XdS)z+Unpack zip `filename` to `extract_dir`
    rNz%s is not a zip file�/z..rh)rZ
is_zipfiler(r
r�Zinfolistr/r�r<rVr��splitr2r�rPrqrH)	r/�extract_dirrrr�r.�target�data�fr$r$r%�_unpack_zipfilejs*




r9r�cCs\ddl}z|�|�}Wn"|jk
r8td|��YnXz|j||d�W5|��XdS)zAUnpack tar/tar.gz/tar.bz2/tar.xz `filename` to `extract_dir`
    rNz/%s is not a compressed or uncompressed tar filer�)r�rqZTarErrorr(r�Z
extractall)r/r5r�r�Ztarobjr$r$r%�_unpack_tarfile�s�
r:r�r
)rrz.tar.gzz.tgzz.tar.bz2z.tbz2z.tar.xzz.txzcCs:t��D],\}}|dD]}|�|�r|SqqdS)Nr)r,rr�)r/r.r�r/r$r$r%�_find_unpack_format�s

r;cCs�t�d|||�|dkr t��}t�|�}t�|�}|dkrBi}nd|i}|dk	r�zt|}Wn$tk
r�td�|��d�YnX|d}|||ft	|d�|��nRt
|�}|dkr�td�|���t|d}t	t|d�}|�|�|||f|�dS)a]Unpack an archive.

    `filename` is the name of the archive.

    `extract_dir` is the name of the target directory, where the archive
    is unpacked. If not provided, the current working directory is used.

    `format` is the archive format: one of "zip", "tar", "gztar", "bztar",
    or "xztar".  Or any other registered format.  If not provided,
    unpack_archive will use the filename extension and see if an unpacker
    was registered for that extension.

    In case none is found, a ValueError is raised.

    If `filter` is given, it is passed to the underlying
    extraction function.
    zshutil.unpack_archiveNr�zUnknown unpack format '{0}'r#r�zUnknown archive format '{0}')
r?rir<r$r�r,r�r�rj�dictr;r(�update)r/r5rjr�Z
filter_kwargsr'r(r�r$r$r%r�s,


�statvfs�
disk_usageZusageztotal used freezTotal space in byteszUsed space in byteszFree space in bytescCs@t�|�}|j|j}|j|j}|j|j|j}t|||�S)z�Return disk usage statistics about the given path.

        Returned value is a named tuple with attributes 'total', 'used' and
        'free', which are the amount of total, used and free space, in bytes.
        )r<r>�f_bavail�f_frsize�f_blocks�f_bfree�_ntuple_diskusage)rVru�free�total�usedr$r$r%r?�s

cCs"t�|�\}}||}t|||�S)z�Return disk usage statistics about the given path.

        Returned values is a named tuple with attributes 'total', 'used' and
        'free', which are the amount of total, used and free space, in bytes.
        )rZ
_getdiskusagerD)rVrFrErGr$r$r%r?�scCs�t�d|||�|dkr(|dkr(td��|}|}|dkr>d}n(t|t�rft|�}|dkrftd�|���|dkrtd}n(t|t�s�t	|�}|dkr�td�|���t
�|||�dS)z�Change owner user and group of the given path.

    user and group can be the uid/gid or the user/group names, and in that case,
    they are converted to their respective uid/gid.
    zshutil.chownNzuser and/or group must be set���zno such user: {!r}zno such group: {!r})r?rir�rSr�r��LookupErrorrj�intr�r<r)rV�userr�Z_userZ_groupr$r$r%rs$

��P�c
Cs�zttjd�}Wnttfk
r.d}YnXzttjd�}Wnttfk
r^d}YnX|dksp|dkr�zt�tj���}Wn$t	tt
fk
r�t�|�}YnX|dkr�|j}|dkr�|j
}t�||f�S)aGet the size of the terminal window.

    For each of the two dimensions, the environment variable, COLUMNS
    and LINES respectively, is checked. If the variable is defined and
    the value is a positive integer, it is used.

    When COLUMNS or LINES is not defined, which is the common case,
    the terminal connected to sys.__stdout__ is queried
    by invoking os.get_terminal_size.

    If the terminal size cannot be successfully queried, either because
    the system doesn't support querying, or because we are not
    connected to a terminal, the value given in fallback parameter
    is used. Fallback defaults to (80, 24) which is the default
    size used by many terminal emulators.

    The value returned is a named tuple of type os.terminal_size.
    ZCOLUMNSrZLINES)rJr<�environr�r�rr?�
__stdout__r+�AttributeErrorr-�
terminal_size�columns�lines)ZfallbackrSrT�sizer$r$r%r(s$

cCs&tj�|�o$t�||�o$tj�|�Sr^)r<rVr�r�r�)r`r�r$r$r%�
_access_checkYs�rVc
	s�tj���rt�|�r�SdSt�t�}|dkrttj�dd�}|dkrtzt�d�}Wnt	t
fk
rrtj}YnX|s|dS|r�t�|�}|�
t�tj��}nt�|�}|�
tj�}tjdk�rTtj}|r�t�|�}||kr�|�d|�t�d�p�t}dd�|�
tj�D�}|�r d	d�|D�}t�fd
d�|D���r@�g}n�fdd�|D�}n�g}t�}|D]X}	tj�|	�}
|
|k�rd|�|
�|D],}tj�|	|�}t||��r�|S�q��qddS)
a3Given a command, mode, and a PATH string, return the path which
    conforms to the given mode on the PATH, or None if there is no such
    file.

    `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result
    of os.environ.get("PATH"), or can be overridden with a custom search
    path.

    N�PATH�CS_PATHZwin32rZPATHEXTcSsg|]}|r|�qSr$r$�r�r.r$r$r%r��szwhich.<locals>.<listcomp>cSsg|]}t�|��qSr$)r<�fsencoderYr$r$r%r��sc3s |]}����|���VqdSr^)�lowerr�rY��cmdr$r%�	<genexpr>�szwhich.<locals>.<genexpr>csg|]}�|�qSr$r$rYr\r$r%r��s)r<rVr�rVrSr�rO�get�confstrrQr��defpathrZr4�pathsepr�r?r�r�insert�getenv�_WIN_DEFAULT_PATHEXT�anyr�rXrr�)
r]r�rVZ	use_bytesrZpathext_sourceZpathext�files�seen�dirZnormdirZthefiler.r$r\r%r^sV







)r)F)FN)r�rrNNN)rrN)Nr�)NNrrNNN)Nr�)NN)NN)rL)jr'r<r?rWr��collectionsr1�zlibr��ImportErrorr�r�Zlzmar��pwdrZgrprr.rnrrrOrUr�r�rBrrre�__all__r-rr rrr(r,r)r*r:rFrNrr]rardr	r
r�rrr
rr�r�stat_resultr�r�r�r�rqr�r��supports_dir_fdr��supports_fdr�r�rZavoids_symlink_attacksr�rr�r�r�r�r	rrrrrrrr1rrr2r9r:r,r;rr��
namedtuplerDrFrGrEr?rrrV�F_OK�X_OKrr$r$r$r%�<module>st






�
@

7B
�
A�
.	
	4�
�
�
>?	�
A
-
����

�
8�
"�
�
�
�2



 
1__pycache__/operator.cpython-38.pyc000064400000032575151153537570013267 0ustar00U

e5d�)�6@s(dZddddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6g6Zd7d8lmZd9d&�Zd:d#�Zd;d	�Zd<d+�Zd=d�Z	d>d
�Z
d?d-�Zd@d5�ZdAd�Z
dBd�ZdCd�ZdDd�ZdEd�ZdFd
�ZdGd�ZdHd�ZeZdId%�ZdJd)�ZdKd*�ZdLd'�ZdMd,�ZdNd.�ZdOd/�ZdPd0�ZdQd1�ZdRd3�ZdSd4�ZdTd6�Z dUd�Z!dVd�Z"dWd�Z#dXd�Z$dYd�Z%dZd�Z&d[d2�Z'dqd\d$�Z(Gd]d�d�Z)Gd^d �d �Z*Gd_d(�d(�Z+d`d�Z,dad�Z-dbd�Z.dcd�Z/ddd�Z0ded�Z1dfd�Z2dgd�Z3dhd�Z4did�Z5djd�Z6dkd�Z7dld!�Z8dmd"�Z9zd7dnl:TWne;k
�rbYnXd7dol:mZeZ<eZ=eZ>eZ?e	Z@e
ZAeZBeZCeZDeZEeZFeZGeZHeZIeZJeZKeZLeZMeZNeZOeZPeZQeZReZSeZTe ZUe!ZVe"ZWe$ZXe%ZYe'ZZe,Z[e-Z\e.Z]e/Z^e0Z_e1Z`e2Zae3Zbe4Zce5Zde6Zee7Zfe8Zge9ZhdpS)ras
Operator Interface

This module exports a set of functions corresponding to the intrinsic
operators of Python.  For example, operator.add(x, y) is equivalent
to the expression x+y.  The function names are those used for special
methods; variants without leading and trailing '__' are also provided
for convenience.

This is the pure Python implementation of the module.
�abs�add�and_�
attrgetter�concat�contains�countOf�delitem�eq�floordiv�ge�getitem�gt�iadd�iand�iconcat�	ifloordiv�ilshift�imatmul�imod�imul�index�indexOf�inv�invert�ior�ipow�irshift�is_�is_not�isub�
itemgetter�itruediv�ixor�le�length_hint�lshift�lt�matmul�methodcaller�mod�mul�ne�neg�not_�or_�pos�pow�rshift�setitem�sub�truediv�truth�xor�)rcCs||kS)zSame as a < b.���a�br8r8� /usr/lib64/python3.8/operator.pyr&scCs||kS)zSame as a <= b.r8r9r8r8r<r#scCs||kS)zSame as a == b.r8r9r8r8r<r	#scCs||kS)zSame as a != b.r8r9r8r8r<r+'scCs||kS)zSame as a >= b.r8r9r8r8r<r+scCs||kS)zSame as a > b.r8r9r8r8r<r
/scCs|S)zSame as not a.r8�r:r8r8r<r-5scCs|rdSdS)z*Return True if a is true, False otherwise.TFr8r=r8r8r<r59scCs||kS)zSame as a is b.r8r9r8r8r<r=scCs||k	S)zSame as a is not b.r8r9r8r8r<rAscCst|�S)zSame as abs(a).)�_absr=r8r8r<rGscCs||S)zSame as a + b.r8r9r8r8r<rKscCs||@S)zSame as a & b.r8r9r8r8r<rOscCs||S)zSame as a // b.r8r9r8r8r<r
SscCs|��S)zSame as a.__index__().)�	__index__r=r8r8r<rWscCs|S)zSame as ~a.r8r=r8r8r<r[scCs||>S)zSame as a << b.r8r9r8r8r<r%`scCs||S)zSame as a % b.r8r9r8r8r<r)dscCs||S)zSame as a * b.r8r9r8r8r<r*hscCs||S)zSame as a @ b.r8r9r8r8r<r'lscCs|S)zSame as -a.r8r=r8r8r<r,pscCs||BS)zSame as a | b.r8r9r8r8r<r.tscCs|
S)zSame as +a.r8r=r8r8r<r/xscCs||S)zSame as a ** b.r8r9r8r8r<r0|scCs||?S)zSame as a >> b.r8r9r8r8r<r1�scCs||S)zSame as a - b.r8r9r8r8r<r3�scCs||S)zSame as a / b.r8r9r8r8r<r4�scCs||AS)zSame as a ^ b.r8r9r8r8r<r6�scCs(t|d�s dt|�j}t|��||S)z%Same as a + b, for a and b sequences.�__getitem__�!'%s' object can't be concatenated��hasattr�type�__name__�	TypeError�r:r;�msgr8r8r<r�s
cCs||kS)z(Same as b in a (note reversed operands).r8r9r8r8r<r�scCs"d}|D]}||kr|d7}q|S)z)Return the number of times b occurs in a.r7�r8)r:r;�count�ir8r8r<r�s

cCs
||=dS)zSame as del a[b].Nr8r9r8r8r<r�scCs||S)z
Same as a[b].r8r9r8r8r<r�scCs.t|�D]\}}||kr|Sqtd��dS)z!Return the first index of b in a.z$sequence.index(x): x not in sequenceN)�	enumerate�
ValueError)r:r;rK�jr8r8r<r�s
cCs|||<dS)zSame as a[b] = c.Nr8)r:r;�cr8r8r<r2�scCs�t|t�s dt|�j}t|��z
t|�WStk
r>YnXzt|�j}Wntk
rf|YSXz||�}Wntk
r�|YSX|tkr�|St|t�s�dt|�j}t|��|dkr�d}t	|��|S)a2
    Return an estimate of the number of items in obj.
    This is useful for presizing containers when building from an iterable.

    If the object supports len(), the result will be exact. Otherwise, it may
    over- or under-estimate by an arbitrary amount. The result will be an
    integer >= 0.
    z/'%s' object cannot be interpreted as an integerz'__length_hint__ must be integer, not %sr7z$__length_hint__() should return >= 0)
�
isinstance�intrDrErF�len�__length_hint__�AttributeError�NotImplementedrM)�obj�defaultrHZhint�valr8r8r<r$�s8	
�



�c@s4eZdZdZdZdd�Zdd�Zdd�Zd	d
�ZdS)raV
    Return a callable object that fetches the given attribute(s) from its operand.
    After f = attrgetter('name'), the call f(r) returns r.name.
    After g = attrgetter('name', 'date'), the call g(r) returns (r.name, r.date).
    After h = attrgetter('name.first', 'name.last'), the call h(r) returns
    (r.name.first, r.name.last).
    )�_attrs�_callcsn|s<t|t�std��|f|_|�d���fdd�}||_n.|f||_ttt|j����fdd�}||_dS)Nzattribute name must be a string�.cs�D]}t||�}q|S�N)�getattr)rV�name)�namesr8r<�func�sz!attrgetter.__init__.<locals>.funccst�fdd��D��S)Nc3s|]}|��VqdSr\r8)�.0�getter�rVr8r<�	<genexpr>�sz4attrgetter.__init__.<locals>.func.<locals>.<genexpr>��tuplerc)�gettersrcr<r`�s)	rP�strrFrY�splitrZrf�mapr)�self�attr�attrsr`r8)rgr_r<�__init__�s

zattrgetter.__init__cCs
|�|�Sr\�rZ�rkrVr8r8r<�__call__�szattrgetter.__call__cCs$d|jj|jjd�tt|j��fS�N�	%s.%s(%s)�, )�	__class__�
__module__�__qualname__�joinrj�reprrY�rkr8r8r<�__repr__s�zattrgetter.__repr__cCs|j|jfSr\)rurYrzr8r8r<�
__reduce__szattrgetter.__reduce__N�	rErvrw�__doc__�	__slots__rnrqr{r|r8r8r8r<r�sc@s4eZdZdZdZdd�Zdd�Zdd�Zd	d
�ZdS)r z�
    Return a callable object that fetches the given item(s) from its operand.
    After f = itemgetter(2), the call f(r) returns r[2].
    After g = itemgetter(2, 5, 3), the call g(r) returns (r[2], r[5], r[3])
    ��_itemsrZcsF�s �f|_�fdd�}||_n"�f�|_��fdd�}||_dS)Ncs|�Sr\r8rc)�itemr8r<r`sz!itemgetter.__init__.<locals>.funccst�fdd��D��S)Nc3s|]}�|VqdSr\r8)rarKrcr8r<rdsz4itemgetter.__init__.<locals>.func.<locals>.<genexpr>rerc)�itemsrcr<r`sr�)rkr�r�r`r8)r�r�r<rnszitemgetter.__init__cCs
|�|�Sr\rorpr8r8r<rqszitemgetter.__call__cCs$d|jj|jjd�tt|j��fSrr)rurvrErxrjryr�rzr8r8r<r{ s�zitemgetter.__repr__cCs|j|jfSr\)rur�rzr8r8r<r|%szitemgetter.__reduce__Nr}r8r8r8r<r 	sc@s4eZdZdZdZdd�Zdd�Zdd�Zd	d
�ZdS)r(z�
    Return a callable object that calls the given method on its operand.
    After f = methodcaller('name'), the call f(r) returns r.name().
    After g = methodcaller('name', 'date', foo=1), the call g(r) returns
    r.name('date', foo=1).
    )�_name�_args�_kwargscOs*||_t|jt�std��||_||_dS)Nzmethod name must be a string)r�rPrhrFr�r�)rkr^�args�kwargsr8r8r<rn1s
zmethodcaller.__init__cCst||j�|j|j�Sr\)r]r�r�r�rpr8r8r<rq8szmethodcaller.__call__cCsTt|j�g}|�tt|j��|�dd�|j��D��d|jj|jj	d�
|�fS)Ncss|]\}}d||fVqdS)z%s=%rNr8)ra�k�vr8r8r<rd>sz(methodcaller.__repr__.<locals>.<genexpr>rsrt)ryr��extendrjr�r�r�rurvrErx)rkr�r8r8r<r{;s�zmethodcaller.__repr__cCsD|js|j|jf|jfSddlm}||j|jf|j�|jfSdS)Nr7)�partial)r�rur�r��	functoolsr�)rkr�r8r8r<r|Cszmethodcaller.__reduce__Nr}r8r8r8r<r((scCs||7}|S)zSame as a += b.r8r9r8r8r<rMscCs||M}|S)zSame as a &= b.r8r9r8r8r<rRscCs,t|d�s dt|�j}t|��||7}|S)z&Same as a += b, for a and b sequences.r@rArBrGr8r8r<rWs

cCs||}|S)zSame as a //= b.r8r9r8r8r<r_scCs||K}|S)zSame as a <<= b.r8r9r8r8r<rdscCs||;}|S)zSame as a %= b.r8r9r8r8r<riscCs||9}|S)zSame as a *= b.r8r9r8r8r<rnscCs||}|S)zSame as a @= b.r8r9r8r8r<rsscCs||O}|S)zSame as a |= b.r8r9r8r8r<rxscCs||C}|S)zSame as a **= b.r8r9r8r8r<r}scCs||L}|S)zSame as a >>= b.r8r9r8r8r<r�scCs||8}|S)zSame as a -= b.r8r9r8r8r<r�scCs||}|S)zSame as a /= b.r8r9r8r8r<r!�scCs||N}|S)zSame as a ^= b.r8r9r8r8r<r"�s)�*)r~N)r7)ir~�__all__�builtinsrr>r&r#r	r+rr
r-r5rrrrr
rrrr%r)r*r'r,r.r/r0r1r3r4r6rrrrrrr2r$rr r(rrrrrrrrrrrrr!r"�	_operator�ImportError�__lt__�__le__�__eq__�__ne__�__ge__�__gt__�__not__�__abs__�__add__�__and__�__floordiv__r?�__inv__�
__invert__�
__lshift__�__mod__�__mul__�
__matmul__�__neg__�__or__�__pos__�__pow__�
__rshift__�__sub__�__truediv__�__xor__�
__concat__�__contains__�__delitem__r@�__setitem__�__iadd__�__iand__�__iconcat__�
__ifloordiv__�__ilshift__�__imod__�__imul__�__imatmul__�__ior__�__ipow__�__irshift__�__isub__�__itruediv__�__ixor__r8r8r8r<�<module>s4�	
)'%__pycache__/crypt.cpython-38.pyc000064400000006475151153537570012575 0ustar00U

e5d�@s0dZddlZzddlZWn0ek
rHejdkr<ed��ned��YnXddlZddl	m
Zddlm
ZejejdZe�ZGd	d
�d
ed
d��Zd&dd�d
d�Zd'dd�ZgZdd�dd�Zedddd�edddd�dD](Zeddeddee�dd�r��qq�edd d!d"�ed#dd$d%�[[dS)(zEWrapper to the POSIX crypt library call and associated functionality.�NZwin32z,The crypt module is not supported on Windowsz;The required _crypt module was not built as part of CPython)�SystemRandom)�
namedtuplez./c@seZdZdZdd�ZdS)�_MethodziClass representing a salt method per the Modular Crypt Format or the
    legacy 2-character crypt method.cCsd�|j�S)Nz<crypt.METHOD_{}>)�format�name)�self�r�/usr/lib64/python3.8/crypt.py�__repr__sz_Method.__repr__N)�__name__�
__module__�__qualname__�__doc__r
rrrr	rsrz name ident salt_chars total_size��roundscCsB|dkrtd}|dk	r4t|t�s4t|jj�d���|js@d}nd|j�d�}|jr�|jddkr�|dkrpd}n@t�|d�}|d|>kr�td	��d
|kr�dks�ntd��||d
�d�7}n^|jdk�r|dk	�r d|kr�dks�ntd��|d|�d�7}n|dk	�r t|�d���|d�	dd�t
|j�D��7}|S)zsGenerate a salt for the specified method.

    If not specified, the strongest available method will be used.

    Nrz+ object cannot be interpreted as an integer��$�2��zrounds must be a power of 2��z%rounds out of the range 2**4 to 2**31Z02d)�5�6i�i�ɚ;z+rounds out of the range 1000 to 999_999_999zrounds=z$ doesn't support the rounds argumentcss|]}t�t�VqdS)N)�_srZchoice�
_saltchars)�.0�charrrr	�	<genexpr>Aszmksalt.<locals>.<genexpr>)�methods�
isinstance�int�	TypeError�	__class__rZident�
bit_length�
ValueError�join�rangeZ
salt_chars)�methodr�sZ
log_roundsrrr	�mksalts2

r*cCs&|dkst|t�rt|�}t�||�S)aRReturn a string representing the one-way hash of a password, with a salt
    prepended.

    If ``salt`` is not specified or is ``None``, the strongest
    available method will be selected and a salt generated.  Otherwise,
    ``salt`` may be one of the ``crypt.METHOD_*`` values, or a string as
    returned by ``crypt.mksalt()``.

    N)r rr*�_crypt�crypt)Zword�saltrrr	r,Es
r,cGsVt|f|��}|t�d|<t||d�}td|�}|rRt|�|jkrRt�|�dSdS)NZMETHOD_rrTF)r�globalsr*r,�lenZ
total_sizer�append)rr�argsr(r-�resultrrr	�_add_methodWs

r3ZSHA512r��jZSHA256r�?)�b�y�arZBLOWFISHr��;ZMD5�1��"ZCRYPT��
)N)N)r�sys�_sysr+�ModuleNotFoundError�platform�ImportError�stringZ_stringZrandomrZ
_SystemRandom�collectionsrZ_namedtupleZ
ascii_lettersZdigitsrrrr*r,rr3Z_vr/rrrr	�<module>s2

	&

__pycache__/opcode.cpython-38.pyc000064400000012456151153537570012701 0ustar00U

e5d��
@s�dZddddddddd	d
ddd
g
ZzddlmZe�d�Wnek
rPYnXdZgZgZgZ	gZ
gZgZgZ
gZiZdd�ed�D�Zdd�Zdd�Zdd�Zdd�Zedd�edd �ed!d"�ed#d$�ed%d&�ed'd(�ed)d*�ed+d,�ed-d.�ed/d0�ed1d2�ed3d4�ed5d6�ed7d8�ed9d:�ed;d<�ed=d>�ed?d@�edAdB�edCdD�edEdF�edGdH�edIdJ�edKdL�edMdN�edOdP�edQdR�edSdT�edUdV�edWdX�edYdZ�ed[d\�ed]d^�ed_d`�edadb�edcdd�ededf�edgdh�edidj�edkdl�edmdn�edodp�edqdr�edsdt�edudv�edwdx�edydz�ed{d|�ed}d~�edd��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��d�Zed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��e�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��e�d��ed�d��ed�d��ed�d��ed�d��ed�d��ed�dƒed�dăed�dƃed�dȃed�dʃed�d̃e�d̡ed�d΃e�dΡed�dЃe�dСed�d҃ed�dԃed�dփed�d؃ed�dڃe
�dڡed�d܃e
�dܡed�dރe
�dޡed�d�e
�d�ed�d�ed�d�ed�d�ed�d�ed�d�ed�d�ed�d�e
�d�edd�d�Zed�d�ed�d�ed�d��ed�d��ed�d��ed�d��ed�d��ed�d��e�d�d�e�d�d�e�d�d�e�d�d�e�d�d	�e�d
�d�[[[[�dS(
zy
opcode module - potentially shared between dis and other modules which
operate on bytecodes (e.g. peephole optimizers).
�cmp_op�hasconst�hasname�hasjrel�hasjabs�haslocal�
hascompare�hasfree�opname�opmap�
HAVE_ARGUMENT�EXTENDED_ARG�hasnargs�)�stack_effectr)�<z<=z==z!=�>z>=�inznot in�iszis notzexception matchZBADcCsg|]}d|f�qS)z<%r>�)�.0�oprr�/usr/lib64/python3.8/opcode.py�
<listcomp>%sr�cCs|t|<|t|<dS�N)r	r
��namerrrr�def_op'srcCst||�t�|�dSr)rr�appendrrrr�name_op+s
rcCst||�t�|�dSr)rrrrrrr�jrel_op/s
r cCst||�t�|�dSr)rrrrrrr�jabs_op3s
r!ZPOP_TOP�ZROT_TWO�Z	ROT_THREE�ZDUP_TOP�ZDUP_TOP_TWO�ZROT_FOUR�ZNOP�	ZUNARY_POSITIVE�
ZUNARY_NEGATIVE�Z	UNARY_NOT�ZUNARY_INVERT�ZBINARY_MATRIX_MULTIPLY�ZINPLACE_MATRIX_MULTIPLY�ZBINARY_POWER�ZBINARY_MULTIPLY�Z
BINARY_MODULO�Z
BINARY_ADD�ZBINARY_SUBTRACT�Z
BINARY_SUBSCR�ZBINARY_FLOOR_DIVIDE�ZBINARY_TRUE_DIVIDE�ZINPLACE_FLOOR_DIVIDE�ZINPLACE_TRUE_DIVIDE�Z	GET_AITER�2Z	GET_ANEXT�3ZBEFORE_ASYNC_WITH�4Z
BEGIN_FINALLY�5Z
END_ASYNC_FOR�6ZINPLACE_ADD�7ZINPLACE_SUBTRACT�8ZINPLACE_MULTIPLY�9ZINPLACE_MODULO�;ZSTORE_SUBSCR�<Z
DELETE_SUBSCR�=Z
BINARY_LSHIFT�>Z
BINARY_RSHIFT�?Z
BINARY_AND�@Z
BINARY_XOR�AZ	BINARY_OR�BZ
INPLACE_POWER�CZGET_ITER�DZGET_YIELD_FROM_ITER�EZ
PRINT_EXPR�FZLOAD_BUILD_CLASS�GZ
YIELD_FROM�HZ
GET_AWAITABLE�IZINPLACE_LSHIFT�KZINPLACE_RSHIFT�LZINPLACE_AND�MZINPLACE_XOR�NZ
INPLACE_OR�OZWITH_CLEANUP_START�QZWITH_CLEANUP_FINISH�RZRETURN_VALUE�SZIMPORT_STAR�TZSETUP_ANNOTATIONS�UZYIELD_VALUE�VZ	POP_BLOCK�WZEND_FINALLY�XZ
POP_EXCEPT�Y�ZZ
STORE_NAMEZDELETE_NAME�[ZUNPACK_SEQUENCE�\ZFOR_ITER�]Z	UNPACK_EX�^Z
STORE_ATTR�_ZDELETE_ATTR�`ZSTORE_GLOBAL�aZ
DELETE_GLOBAL�bZ
LOAD_CONST�dZ	LOAD_NAME�eZBUILD_TUPLE�fZ
BUILD_LIST�gZ	BUILD_SET�hZ	BUILD_MAP�iZ	LOAD_ATTR�jZ
COMPARE_OP�kZIMPORT_NAME�lZIMPORT_FROM�mZJUMP_FORWARD�nZJUMP_IF_FALSE_OR_POP�oZJUMP_IF_TRUE_OR_POP�pZ
JUMP_ABSOLUTE�qZPOP_JUMP_IF_FALSE�rZPOP_JUMP_IF_TRUE�sZLOAD_GLOBAL�tZ
SETUP_FINALLY�zZ	LOAD_FAST�|Z
STORE_FAST�}ZDELETE_FAST�~Z
RAISE_VARARGS�Z
CALL_FUNCTION�Z
MAKE_FUNCTION�ZBUILD_SLICE�ZLOAD_CLOSURE�Z
LOAD_DEREF�ZSTORE_DEREF�ZDELETE_DEREF�ZCALL_FUNCTION_KW�ZCALL_FUNCTION_EX�Z
SETUP_WITH�ZLIST_APPEND�ZSET_ADD�ZMAP_ADD�ZLOAD_CLASSDEREF��ZBUILD_LIST_UNPACK�ZBUILD_MAP_UNPACK�ZBUILD_MAP_UNPACK_WITH_CALL�ZBUILD_TUPLE_UNPACK�ZBUILD_SET_UNPACK�ZSETUP_ASYNC_WITH�ZFORMAT_VALUE�ZBUILD_CONST_KEY_MAP�ZBUILD_STRING�ZBUILD_TUPLE_UNPACK_WITH_CALL�ZLOAD_METHOD�ZCALL_METHOD�ZCALL_FINALLY�ZPOP_FINALLY�N)�__doc__�__all__Z_opcoderr�ImportErrorrrrrrrrrr
r
�ranger	rrr r!rrrrrr�<module>sF
�



























































































































__pycache__/pipes.cpython-38.pyc000064400000017165151153537570012552 0ustar00U

e5d�"�@spdZddlZddlZddlZddlmZdgZdZdZdZ	dZ
d	Zd
Zeee	e
eegZ
Gdd�d�Zdd
�ZdS)a�Conversion pipeline templates.

The problem:
------------

Suppose you have some data that you want to convert to another format,
such as from GIF image format to PPM image format.  Maybe the
conversion involves several steps (e.g. piping it through compress or
uuencode).  Some of the conversion steps may require that their input
is a disk file, others may be able to read standard input; similar for
their output.  The input to the entire conversion may also be read
from a disk file or from an open file, and similar for its output.

The module lets you construct a pipeline template by sticking one or
more conversion steps together.  It will take care of creating and
removing temporary files if they are necessary to hold intermediate
data.  You can then use the template to do conversions from many
different sources to many different destinations.  The temporary
file names used are different each time the template is used.

The templates are objects so you can create templates for many
different conversion steps and store them in a dictionary, for
instance.


Directions:
-----------

To create a template:
    t = Template()

To add a conversion step to a template:
   t.append(command, kind)
where kind is a string of two characters: the first is '-' if the
command reads its standard input or 'f' if it requires a file; the
second likewise for the output. The command must be valid /bin/sh
syntax.  If input or output files are required, they are passed as
$IN and $OUT; otherwise, it must be  possible to use the command in
a pipeline.

To add a conversion step at the beginning:
   t.prepend(command, kind)

To convert a file to another file using a template:
  sts = t.copy(infile, outfile)
If infile or outfile are the empty string, standard input is read or
standard output is written, respectively.  The return value is the
exit status of the conversion pipeline.

To open a file for reading or writing through a conversion pipeline:
   fp = t.open(file, mode)
where mode is 'r' to read the file, or 'w' to write it -- just like
for the built-in function open() or for os.popen().

To create a new template object initialized to a given one:
   t2 = t.clone()
�N)�quote�TemplateZffz-fzf-�--z.-z-.c@speZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)rz'Class representing a pipeline template.cCsd|_|��dS)z-Template() returns a fresh pipeline template.rN)�	debugging�reset��self�r	�/usr/lib64/python3.8/pipes.py�__init__UszTemplate.__init__cCsd|jfS)z t.__repr__() implements repr(t).z<Template instance, steps=%r>��stepsrr	r	r
�__repr__ZszTemplate.__repr__cCs
g|_dS)z<t.reset() restores a pipeline template to its initial state.Nrrr	r	r
r^szTemplate.resetcCs"t�}|jdd�|_|j|_|S)zbt.clone() returns a new pipeline template with identical
        initial state as the current one.N)rr
r)r�tr	r	r
�clonebszTemplate.clonecCs
||_dS)z(t.debug(flag) turns debugging on or off.N)r)r�flagr	r	r
�debugjszTemplate.debugcCs�t|�td�k	rtd��|tkr.td|f��|tkr>td��|jr^|jddtkr^td��|dd	kr~t�d
|�s~td��|dd	kr�t�d|�s�td
��|j�	||f�dS)z/t.append(cmd, kind) adds a new step at the end.�z%Template.append: cmd must be a stringzTemplate.append: bad kind %rz-Template.append: SOURCE can only be prepended����z'Template.append: already ends with SINKr�f�\$IN\bz#Template.append: missing $IN in cmd�\$OUT\bz$Template.append: missing $OUT in cmdN)
�type�	TypeError�	stepkinds�
ValueError�SOURCEr
�SINK�re�search�append�r�cmd�kindr	r	r
r!nszTemplate.appendcCs�t|�td�k	rtd��|tkr.td|f��|tkr>td��|jr^|jddtkr^td��|ddkr~t�d	|�s~td
��|ddkr�t�d|�s�td��|j�	d||f�d
S)z2t.prepend(cmd, kind) adds a new step at the front.rz&Template.prepend: cmd must be a stringzTemplate.prepend: bad kind %rz+Template.prepend: SINK can only be appendedrrz,Template.prepend: already begins with SOURCErrz$Template.prepend: missing $IN in cmdrz%Template.prepend: missing $OUT in cmdN)
rrrrrr
rrr �insertr"r	r	r
�prepend~szTemplate.prependcCs6|dkr|�|�S|dkr$|�|�Std|f��dS)z~t.open(file, rw) returns a pipe or file object open for
        reading or writing; the file is the other end of the pipeline.�r�wz,Template.open: rw must be 'r' or 'w', not %rN)�open_r�open_wr)r�fileZrwr	r	r
�open�s

�z
Template.opencCsB|jst|d�S|jddtkr*td��|�|d�}t�|d�S)zit.open_r(file) and t.open_w(file) implement
        t.open(file, 'r') and t.open(file, 'w') respectively.r'rrz)Template.open_r: pipeline ends width SINKr)r
r,rr�makepipeline�os�popen�rr+r#r	r	r
r)�s
zTemplate.open_rcCsB|jst|d�S|jddtkr*td��|�d|�}t�|d�S)Nr(rrz,Template.open_w: pipeline begins with SOURCEr)r
r,rrr-r.r/r0r	r	r
r*�s
zTemplate.open_wcCst�|�||��S)N)r.�systemr-)r�infile�outfiler	r	r
�copy�sz
Template.copycCs(t||j|�}|jr$t|�d|}|S)Nzset -x; )r-r
r�print)rr2r3r#r	r	r
r-�s
zTemplate.makepipelineN)�__name__�
__module__�__qualname__�__doc__rrrrrr!r&r,r)r*r4r-r	r	r	r
rRs

cCs�g}|D]\}}|�d||dg�q|s:|�ddddg�|ddd�\}}|ddkrr|sr|�dddddg�||dd<|ddd�\}}|ddkr�|s�|�ddddg�||dd<g}tdt|��D]v}||dd	}||d	}	|ddk�s|	ddkr�t��\}
}t�|
�|�|�|||dd<||d<q�|D]�}|\}
}}}|ddk�r�d
t|�d|}|ddk�r�dt|
�d|}|dd
k�r�|
�r�|dt|
�}|dd
k�r�|�r�|dt|�}||d<�qN|dd}|dd�D]T}|dd�\}}|ddk�rTd|k�rFd|d}|d|}n|d|}�q|�r�d}|D]}|dt|�}�qrdt|d�d}|d|d|}|S)Nr�catrrr�rr�zOUT=z; zIN=�-z <z >z{ z; }z |
�
zrm -f� ztrap z; exitz 1 2 3 13 14 15)	r!r%�range�len�tempfileZmkstempr.�closer)r2r
r3�listr#r$Zgarbage�iZlkindZrkind�fdZtemp�item�infZoutfZcmdlistZrmcmdr+Ztrapcmdr	r	r
r-�s`


r-)r9rr.rBZshlexr�__all__ZFILEIN_FILEOUTZ
STDIN_FILEOUTZ
FILEIN_STDOUTZSTDIN_STDOUTrrrrr-r	r	r	r
�<module>s";�c__pycache__/code.cpython-38.opt-1.pyc000064400000023273151153537570013300 0ustar00U

e5d~)�@s�dZddlZddlZddlmZmZddddgZGdd�d�ZGd	d�de�Zdd
d�Z	e
dkr�ddlZe��Z
e
jdd
dd�e
��Zejs�ejjr�dZndZe	e�dS)z?Utilities needed to emulate Python's interactive interpreter.

�N)�CommandCompiler�compile_command�InteractiveInterpreter�InteractiveConsole�interactrc@sFeZdZdZddd�Zddd�Zd	d
�Zddd�Zd
d�Zdd�Z	dS)rz�Base class for InteractiveConsole.

    This class deals with parsing and interpreter state (the user's
    namespace); it doesn't deal with input buffering or prompting or
    input file naming (the filename is always passed in explicitly).

    NcCs$|dkrddd�}||_t�|_dS)aConstructor.

        The optional 'locals' argument specifies the dictionary in
        which code will be executed; it defaults to a newly created
        dictionary with key "__name__" set to "__console__" and key
        "__doc__" set to None.

        NZ__console__)�__name__�__doc__)�localsr�compile)�selfr	�r�/usr/lib64/python3.8/code.py�__init__s	
zInteractiveInterpreter.__init__�<input>�singlec
CsTz|�|||�}Wn&tttfk
r8|�|�YdSX|dkrFdS|�|�dS)a�Compile and run some source in the interpreter.

        Arguments are as for compile_command().

        One of several things can happen:

        1) The input is incorrect; compile_command() raised an
        exception (SyntaxError or OverflowError).  A syntax traceback
        will be printed by calling the showsyntaxerror() method.

        2) The input is incomplete, and more input is required;
        compile_command() returned None.  Nothing happens.

        3) The input is complete; compile_command() returned a code
        object.  The code is executed by calling self.runcode() (which
        also handles run-time exceptions, except for SystemExit).

        The return value is True in case 2, False in the other cases (unless
        an exception is raised).  The return value can be used to
        decide whether to use sys.ps1 or sys.ps2 to prompt the next
        line.

        FNT)r
�
OverflowError�SyntaxError�
ValueError�showsyntaxerror�runcode)r�source�filenameZsymbol�coderrr
�	runsource&s

z InteractiveInterpreter.runsourcecCs>zt||j�Wn(tk
r&�Yn|��YnXdS)a�Execute a code object.

        When an exception occurs, self.showtraceback() is called to
        display a traceback.  All exceptions are caught except
        SystemExit, which is reraised.

        A note about KeyboardInterrupt: this exception may occur
        elsewhere in this code, and may not always be caught.  The
        caller should be prepared to deal with it.

        N)�execr	�
SystemExit�
showtraceback)rrrrr
rMszInteractiveInterpreter.runcodecCs�t��\}}}|t_|t_|t_|rp|tkrpz|j\}\}}}}	Wntk
rVYnXt|||||	f�}|t_tjtj	kr�t
�||�}
|�d�
|
��nt�|||�dS)apDisplay the syntax error that just occurred.

        This doesn't display a stack trace because there isn't one.

        If a filename is given, it is stuffed in the exception instead
        of what was there before (because Python's parser always uses
        "<string>" when reading from a string).

        The output is written by self.write(), below.

        �N)�sys�exc_info�	last_type�
last_value�last_tracebackr�argsr�
excepthook�__excepthook__�	traceback�format_exception_only�write�join)rr�type�value�tb�msgZdummy_filename�lineno�offset�line�linesrrr
r`sz&InteractiveInterpreter.showsyntaxerrorcCs|t��\t_t_}}|t_zPt�|d|d|j�}tjtj	krT|�
d�|��nt�|d|d|�W5d}}XdS)z�Display the exception that just occurred.

        We remove the first stack item because it is our own code.

        The output is written by self.write(), below.

        Nr�r)rrr r!r"r&�format_exception�tb_nextr$r%r(r))rZlast_tbZeir1rrr
r�sz$InteractiveInterpreter.showtracebackcCstj�|�dS)z�Write a string.

        The base implementation writes to sys.stderr; a subclass may
        replace this with a different implementation.

        N)r�stderrr()r�datarrr
r(�szInteractiveInterpreter.write)N)rr)N)
r�
__module__�__qualname__rrrrrrr(rrrr
rs

'
#c@s>eZdZdZddd�Zdd�Zddd	�Zd
d�Zdd
d�ZdS)rz�Closely emulate the behavior of the interactive Python interpreter.

    This class builds on InteractiveInterpreter and adds prompting
    using the familiar sys.ps1 and sys.ps2, and input buffering.

    N�	<console>cCst�||�||_|��dS)z�Constructor.

        The optional locals argument will be passed to the
        InteractiveInterpreter base class.

        The optional filename argument should specify the (file)name
        of the input stream; it will show up in tracebacks.

        N)rrr�resetbuffer)rr	rrrr
r�s
zInteractiveConsole.__init__cCs
g|_dS)zReset the input buffer.N)�buffer)rrrr
r:�szInteractiveConsole.resetbuffercCsRz
tjWntk
r$dt_YnXz
tjWntk
rJdt_YnXd}|dkrx|�dtjtj||jjf�n|r�|�dt	|��d}zV|r�tj}ntj}z|�
|�}Wn&tk
r�|�d�YW�qYnX|�|�}Wq�t
k
�r|�d	�|��d}Yq�Xq�|dk�r6|�d
|jj�n|dk�rN|�d|�dS)a�Closely emulate the interactive Python console.

        The optional banner argument specifies the banner to print
        before the first interaction; by default it prints a banner
        similar to the one printed by the real Python interpreter,
        followed by the current class name in parentheses (so as not
        to confuse this with the real interpreter -- since it's so
        close!).

        The optional exitmsg argument specifies the exit message
        printed when exiting. Pass the empty string to suppress
        printing an exit message. If exitmsg is not given or None,
        a default message is printed.

        z>>> z... zFType "help", "copyright", "credits" or "license" for more information.NzPython %s on %s
%s
(%s)
z%s
r�
z
KeyboardInterrupt
znow exiting %s...
r)rZps1�AttributeErrorZps2r(�version�platform�	__class__r�str�	raw_input�EOFError�push�KeyboardInterruptr:)r�banner�exitmsgZcprt�more�promptr0rrr
r�sH


��



zInteractiveConsole.interactcCs6|j�|�d�|j�}|�||j�}|s2|��|S)aPush a line to the interpreter.

        The line should not have a trailing newline; it may have
        internal newlines.  The line is appended to a buffer and the
        interpreter's runsource() method is called with the
        concatenated contents of the buffer as source.  If this
        indicates that the command was executed or invalid, the buffer
        is reset; otherwise, the command is incomplete, and the buffer
        is left as it was after the line was appended.  The return
        value is 1 if more input is required, 0 if the line was dealt
        with in some way (this is the same as runsource()).

        r<)r;�appendr)rrr:)rr0rrHrrr
rD�szInteractiveConsole.pushrcCst|�S)aDWrite a prompt and read a line.

        The returned line does not include the trailing newline.
        When the user enters the EOF key sequence, EOFError is raised.

        The base implementation uses the built-in function
        input(); a subclass may replace this with a different
        implementation.

        )�input)rrIrrr
rBszInteractiveConsole.raw_input)Nr9)NN)r)	rr7r8rrr:rrDrBrrrr
r�s

6cCsJt|�}|dk	r||_n"zddl}Wntk
r8YnX|�||�dS)a&Closely emulate the interactive Python interpreter.

    This is a backwards compatible interface to the InteractiveConsole
    class.  When readfunc is not specified, it attempts to import the
    readline module to enable GNU readline if it is available.

    Arguments (all optional, all default to None):

    banner -- passed to InteractiveConsole.interact()
    readfunc -- if not None, replaces InteractiveConsole.raw_input()
    local -- passed to InteractiveInterpreter.__init__()
    exitmsg -- passed to InteractiveConsole.interact()

    Nr)rrB�readline�ImportErrorr)rFZreadfuncZlocalrGZconsolerLrrr
rs�__main__z-q�
store_truez*don't print version and copyright messages)�action�helpr)NNNN)rrr&Zcodeoprr�__all__rrrr�argparse�ArgumentParser�parser�add_argument�
parse_argsr#�q�flags�quietrFrrrr
�<module>s*�t
�__pycache__/turtle.cpython-38.opt-1.pyc000064400000375750151153537570013717 0ustar00U

e5dd1�O@s6dZdZddlZddlZddlZddlZddlZddlZddl	m
Z
mZmZddl
mZddlmZddd	d
ddd
ddg	Zddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.gZd/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}gOZd~dgZeeeed�gZdd0d3d@dMdQdUd[d]dbdcdedfdqdvdydzgZd�d�d�d�ddd�d�d�d�d�d�d�d�d�d�d�d�d�d�d��Zd�d��Zd�d��Zzee�Wnek
�r
ed��YnXGd�d�de�Zd�d��Zd�d��Zd�Zd�d�d��Z Gd�d�dej!�Z"e e"ej#d��Gd�d��d�ej$�Z%ej#Z#Gd�d��d�e&�Z'Gd�d��d�e�Z(Gd�d��d�e�Z)Gd�d�de&�Z*Gd�d��d�e&�Z+Gd�d�de'�Z,Gd�d��d�e&�Z-Gd�d��d�e&�Z.Gd�d��d�e&�Z/Gd�d
�d
e.e-�Z0e0Z1d�d	�Z2Gd�d��d�e,�Z3Gd�d�de0�Z4e4Z5d�d�d~�Z6d�d��Z7ed�Z8ze8d�k�rre7e8�Wn@e9k
�r�ed�e8�Yn"ek
�r�ed�e8�YnXd�d��Z:d�dÄZ;d�dńZ<d�Z=d�dȄZ>e>ee3d�d�e<�e>ee4d�d�e;�e?Z@eAd�k�r2d�dτZBd�dфZCd�dӄZDeC�eD�eE�dS)�a�

Turtle graphics is a popular way for introducing programming to
kids. It was part of the original Logo programming language developed
by Wally Feurzig and Seymour Papert in 1966.

Imagine a robotic turtle starting at (0, 0) in the x-y plane. After an ``import turtle``, give it
the command turtle.forward(15), and it moves (on-screen!) 15 pixels in
the direction it is facing, drawing a line as it moves. Give it the
command turtle.right(25), and it rotates in-place 25 degrees clockwise.

By combining together these and similar commands, intricate shapes and
pictures can easily be drawn.

----- turtle.py

This module is an extended reimplementation of turtle.py from the
Python standard distribution up to Python 2.5. (See: http://www.python.org)

It tries to keep the merits of turtle.py and to be (nearly) 100%
compatible with it. This means in the first place to enable the
learning programmer to use all the commands, classes and methods
interactively when using the module from within IDLE run with
the -n switch.

Roughly it has the following features added:

- Better animation of the turtle movements, especially of turning the
  turtle. So the turtles can more easily be used as a visual feedback
  instrument by the (beginning) programmer.

- Different turtle shapes, gif-images as turtle shapes, user defined
  and user controllable turtle shapes, among them compound
  (multicolored) shapes. Turtle shapes can be stretched and tilted, which
  makes turtles very versatile geometrical objects.

- Fine control over turtle movement and screen updates via delay(),
  and enhanced tracer() and speed() methods.

- Aliases for the most commonly used commands, like fd for forward etc.,
  following the early Logo traditions. This reduces the boring work of
  typing long sequences of commands, which often occur in a natural way
  when kids try to program fancy pictures on their first encounter with
  turtle graphics.

- Turtles now have an undo()-method with configurable undo-buffer.

- Some simple commands/methods for creating event driven programs
  (mouse-, key-, timer-events). Especially useful for programming games.

- A scrollable Canvas class. The default scrollable Canvas can be
  extended interactively as needed while playing around with the turtle(s).

- A TurtleScreen class with methods controlling background color or
  background image, window and canvas size and other properties of the
  TurtleScreen.

- There is a method, setworldcoordinates(), to install a user defined
  coordinate-system for the TurtleScreen.

- The implementation uses a 2-vector class named Vec2D, derived from tuple.
  This class is public, so it can be imported by the application programmer,
  which makes certain types of computations very natural and compact.

- Appearance of the TurtleScreen and the Turtles at startup/import can be
  configured by means of a turtle.cfg configuration file.
  The default configuration mimics the appearance of the old turtle module.

- If configured appropriately the module reads in docstrings from a docstring
  dictionary in some different language, supplied separately  and replaces
  the English ones by those read in. There is a utility function
  write_docstringdict() to write a dictionary with the original (English)
  docstrings to disc, so it can serve as a template for translations.

Behind the scenes there are some features included with possible
extensions in mind. These will be commented and documented elsewhere.

z-turtle 1.1b- - for Python 3.1   -  4. 5. 2009�N)�isfile�split�join)�deepcopy)�simpledialog�ScrolledCanvas�TurtleScreen�Screen�	RawTurtle�Turtle�RawPen�Pen�Shape�Vec2D�addshape�bgcolor�bgpic�bye�clearscreen�	colormode�delay�exitonclick�	getcanvas�	getshapes�listen�mainloop�mode�numinput�onkey�
onkeypress�onkeyrelease�
onscreenclick�ontimer�register_shape�resetscreen�
screensize�setup�setworldcoordinates�	textinput�title�tracer�turtles�update�
window_height�window_width�back�backward�
begin_fill�
begin_poly�bk�circle�clear�
clearstamp�clearstamps�clone�color�degrees�distance�dot�down�end_fill�end_poly�fd�	fillcolor�filling�forward�get_poly�getpen�	getscreen�
get_shapepoly�	getturtle�goto�heading�
hideturtle�home�ht�isdown�	isvisible�left�lt�onclick�ondrag�	onrelease�pd�pen�pencolor�pendown�pensize�penup�pos�position�pu�radians�right�reset�
resizemode�rt�seth�
setheading�setpos�setposition�settiltangle�
setundobuffer�setx�sety�shape�	shapesize�shapetransform�shearfactor�
showturtle�speed�st�stamp�tilt�	tiltangle�towards�
turtlesize�undo�undobufferentries�up�width�write�xcor�ycor�write_docstringdict�done�
Terminator��?g�?i�i,�standard��?�
i��classic�black�noresizeTZenglish�turtle�screenzPython Turtle GraphicsF)rz�height�	canvwidth�
canvheight�	leftright�	topbottomrrr�undobuffersizerkrWrAra�visible�language�
exampleturtle�
examplescreenr)�
using_IDLEc	Cs�t|d��}|��}W5QRXi}|D]�}|��}|r&|�d�rBq&z|�d�\}}Wn(tk
r|td||f�Yq&YnX|��}|��}|dkr�t|�}n4zd|kr�t|�}nt	|�}Wntk
r�YnX|||<q&|S)z/Convert content of config-file into dictionary.�r�#�=zBad line in config-file %s:
%s)�True�False�Nonez''z""�.)
�open�	readlines�strip�
startswithr�
ValueError�print�eval�float�int)�filename�fZcfglines�cfgdict�line�key�value�r��/usr/lib64/python3.8/turtle.py�config_dict�s0



r�cCs�d}i}i}t|�rt|�}d|kr0d|d}ztt�\}}t||�}Wntk
rbd}YnXt|�rtt|�}t�|�t�|�dS)a@Read config-files, change configuration-dict accordingly.

    If there is a turtle.cfg file in the current working directory,
    read it from there. If this contains an importconfig-value,
    say 'myway', construct filename turtle_mayway.cfg else use
    turtle.cfg and read it from the import-directory, where
    turtle.py is located.
    Update configuration dictionary first according to config-file,
    in the import directory, then according to config-file in the
    current working directory.
    If no config-file is found, the default configuration is used.
    z
turtle.cfgZimportconfigz
turtle_%s.cfg�N)rr�r�__file__r�	Exception�_CFGr,)r�Zdefault_cfgZcfgdict1Zcfgdict2�head�tailZ	cfg_file2r�r�r��
readconfig�s 


r�z"No configfile read, reason unknownc@s`eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dS)ra�A 2 dimensional vector class, used as a helper class
    for implementing turtle graphics.
    May be useful for turtle graphics programs also.
    Derived from tuple, so a vector is a tuple!

    Provides (for a, b vectors, k number):
       a+b vector addition
       a-b vector subtraction
       a*b inner product
       k*a and a*k multiplication with scalar
       |a| absolute value of a
       a.rotate(angle) rotation
    cCst�|||f�S�N)�tuple�__new__)�cls�x�yr�r�r�r��sz
Vec2D.__new__cCs"t|d|d|d|d�S�Nr��r��self�otherr�r�r��__add__�sz
Vec2D.__add__cCsDt|t�r*|d|d|d|dSt|d||d|�Sr�)�
isinstancerr�r�r�r��__mul__�s
 z
Vec2D.__mul__cCs2t|t�st|t�r.t|d||d|�StSr�)r�r�r�r�NotImplementedr�r�r�r��__rmul__szVec2D.__rmul__cCs"t|d|d|d|d�Sr�r�r�r�r�r��__sub__sz
Vec2D.__sub__cCst|d|d�Sr�r��r�r�r�r��__neg__sz
Vec2D.__neg__cCs|dd|dddS)Nr�r�r�r�r�r�r�r��__abs__
sz
Vec2D.__abs__cCsjt|d|d�}|tjd}t�|�t�|�}}t|d||d||d||d|�S)z.rotate self counterclockwise by angle
        r�r��f@)r�math�pi�cos�sin)r��angleZperp�c�sr�r�r��rotateszVec2D.rotatecCs|d|dfSr�r�r�r�r�r��__getnewargs__szVec2D.__getnewargs__cCsd|S)Nz(%.2f,%.2f)r�r�r�r�r��__repr__szVec2D.__repr__N)�__name__�
__module__�__qualname__�__doc__r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�s
cCsTt|j�}|��|D]}t||�q|j��D]\}}t|�tjkr0|||<q0dS)�#helper function for Scrolled CanvasN)	�list�	__bases__�reverse�__methodDict�__dict__�items�type�types�FunctionType)r��_dictZbaseListZ_superr�r�r�r�r�r�!s
r�cCsi}t||�|��S)r�)r��keys)r�r�r�r�r��	__methods+s
r�zTdef %(method)s(self, *args, **kw): return self.%(attribute)s.%(method)s(*args, **kw)r�cCs�i}t||�i}t|�}|��D]B}|dd�dksd|dd�dksd||ksd||krXq"||||<q"|��D]D\}}	||	d�}
t|t�r�t||d�}t||
�t|||
|�qndS)Nr��_���)�method�func)r�Z	attribute)	r�r�r�r�r��str�__stringBody�exec�setattr)Z	fromClassZtoClassZtoPartZexcludeZ_dict_1r�ZmfcZexr�r��dZ
execStringr�r�r��__forwardmethods5s
0

�
r�c@sdeZdZdZddd�Zddd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dS)rz�Modeled after the scrolled canvas class from Grayons's Tkinter book.

    Used as the default canvas, which pops up automatically when
    using turtle graphics functions or the Turtle class.
    ���^�Xc
Cs0tjj||||d�|��|_|||_|_|||_|_d|_	tj
||||j	tjdd�|_tj
||jjtjd�|_tj
||jjd�|_|jj|jj|jjd�|jdd	dd
�|jdd	dd
�|jjd	|d	ddd	d	dd�|jjd	|d	dd	d	d	dd�|jjd	|d	d	dd	d	dd�|��|j�d
|j�dS)N)rzr��whiter�)rzr��bgZreliefZborderwidth)�commandZorient)r�)ZxscrollcommandZyscrollcommandrr�)ZweightZminsize�news�ZpadxZin_Zpady�row�columnZrowspanZ
columnspanZstickyz<Configure>)�TK�Frame�__init__�winfo_toplevelZ_rootwindowrzr�r�r�r��CanvasZSUNKEN�_canvasZ	ScrollbarZxviewZ
HORIZONTAL�hscrollZyview�vscrollZ	configure�setZrowconfigureZcolumnconfigure�gridr`�bind�onResize)r��masterrzr�r�r�r�r�r�r�PsN

������zScrolledCanvas.__init__NcCs�|r
||_|r||_|r||_|jj||jd|jd|jd|jdfd�|j�d|j|jd|j�|j�d|j|jd|j�|�	�dS)z<Adjust canvas and scrollbars according to given canvas size.r�)r��scrollregionr��N)
r�r�r�r�config�xview_movetorz�yview_movetor��
adjustScrolls�r�r�r�r�r�r�r�r`is&����zScrolledCanvas.resetc
Cs�|j��}|j��}|j�d|j||j�|j�d|j||j�||jks`||jkr�|jjd|ddddddd�|j	jd|ddddddd�n|j�
�|j	�
�dS)zA Adjust scrollbars according to window- and canvas-size.
        r�r�rr�r�N)r�winfo_width�winfo_heightrr�rr�rrrZgrid_forget)r��cwidth�cheightr�r�r�r
{s&

��
zScrolledCanvas.adjustScrollscCs|��dS)zself-explanatoryN)r
)r��eventr�r�r�r�szScrolledCanvas.onResizecGs|jj|�S��@ 'forward' method, which canvas itself has inherited...
        )r�bbox�r��argsr�r�r�r�szScrolledCanvas.bboxcOs|jj||�Sr)r�cget�r�r�kwargsr�r�r�r�szScrolledCanvas.cgetcOs|jj||�dS�rN)rr
rr�r�r�r
�szScrolledCanvas.configcOs|jj||�dSr)rrrr�r�r�r�szScrolledCanvas.bindcOs|jj||�dSr)r�unbindrr�r�r�r�szScrolledCanvas.unbindcCs|j��dSr)r�focus_forcer�r�r�r�r�szScrolledCanvas.focus_force)r�r�r�r�)NNN)r�r�r�r�r�r`r
rrrr
rrrr�r�r�r�rJs�

rc@sHeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)�_Rootz'Root class for Screen based on Tkinter.cCstj�|�dSr�)r��Tkr�r�r�r�r�r��sz_Root.__init__cCs&t|||||�|_|jjddd�dS)Nr�Zboth)�expand�fill)rrZpack)r�rzr�rrr�r�r��setupcanvas�sz_Root.setupcanvascCs|jSr�)rr�r�r�r��
_getcanvas�sz_Root._getcanvascCs|�d||||f�dS)Nz%dx%d%+d%+d)Zgeometry)r�rzr��startx�startyr�r�r��set_geometry�sz_Root.set_geometrycCs|�d|�dS)NZWM_DELETE_WINDOW)Zwm_protocol)r��destroyr�r�r��	ondestroy�sz_Root.ondestroycCs|��Sr�)Zwinfo_screenwidthr�r�r�r��	win_width�sz_Root.win_widthcCs|��Sr�)Zwinfo_screenheightr�r�r�r��
win_height�sz_Root.win_heightN)r�r�r�r�r�r#r$r'r)r*r+r�r�r�r�r�src@s,eZdZdZdd�Zdd�Zdd�Zdd	�ZdGdd
�Zdd�Z	dHdd�Z
dd�Zdd�Zdd�Z
dd�ZdIdd�Zdd�ZdJdd �ZdKd!d"�ZdLd#d$�ZdMd%d&�Zd'd(�ZdNd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�ZdOd=d>�Z d?d@�Z!dAdB�Z"dCdD�Z#dPdEdF�Z$d
S)Q�TurtleScreenBasez�Provide the basic graphics functionality.
       Interface between Tkinter and turtle.py.

       To port turtle.py to some different graphics toolkit
       a corresponding TurtleScreenBase class has to be implemented.
    cCstjdd|jd�}|��|S)z$return a blank image object
        r�)rzr�r)r��
PhotoImage�cv�blank)r�Zimgr�r�r��_blankimage�szTurtleScreenBase._blankimagecCstj||jd�S)z`return an image object containing the
        imagedata from a gif-file named filename.
        )�filer)r�r-r.)r�r�r�r�r��_image�szTurtleScreenBase._imagecCs�||_t|t�r"|jj}|jj}nJt|j�d��}t|j�d��}|jj|d|d|d|dfd�||_||_d|_|_	dS)Nrzr�r��rr�)
r.r�rr�r�r�rr
�xscale�yscale)r�r.�w�hr�r�r�r��s

*zTurtleScreenBase.__init__cCs|jjdddd�S)z<Create an invisible polygon item on canvas self.cv)
        )rrrrrrr��r"�outline)r.Zcreate_polygonr�r�r�r��_createpoly�szTurtleScreenBase._createpolyNFc
Cs�g}|D]*\}}	|�||j�|�|	|j�q|jj|f|��|dk	r^|jj||d�|dk	rv|jj||d�|dk	r�|jj||d�|r�|j�|�dS)a`Configure polygonitem polyitem according to provided
        arguments:
        coordlist is sequence of coordinates
        fill is filling color
        outline is outline color
        top is a boolean value, which specifies if polyitem
        will be put on top of the canvas' displaylist so it
        will not be covered by other items.
        N�r")r9�rz��appendr4r5r.�coordsZ
itemconfigureZ	tag_raise)
r�Zpolyitem�	coordlistr"r9rz�top�clr�r�r�r�r��	_drawpoly�szTurtleScreenBase._drawpolyc	Cs|jjddddddtjd�S)z9Create an invisible line item on canvas self.cv)
        rr�r�)r"rzZcapstyle)r.Zcreate_liner�ZROUNDr�r�r�r��_createlines�zTurtleScreenBase._createlinec	Cs�|dk	rNg}|D]*\}}|�||j�|�||j�q|jj|f|��|dk	rf|jj||d�|dk	r~|jj||d�|r�|j�|�dS)aQConfigure lineitem according to provided arguments:
        coordlist is sequence of coordinates
        fill is drawing color
        width is width of drawn line.
        top is a boolean value, which specifies if polyitem
        will be put on top of the canvas' displaylist so it
        will not be covered by other items.
        Nr;r<r=)	r�Zlineitemr@r"rzrArBr�r�r�r�r��	_drawlines
zTurtleScreenBase._drawlinecCs|j�|�dS)z]Delete graphics item from canvas.
        If item is"all" delete all graphics items.
        N)r.�delete�r��itemr�r�r��_delete(szTurtleScreenBase._deletecCs|j��dS)z(Redraw graphics items on canvas
        N)r.r,r�r�r�r��_update.szTurtleScreenBase._updatecCs|j�|�dS)z-Delay subsequent canvas actions for delay ms.N)r.�after�r�rr�r�r��_delay3szTurtleScreenBase._delaycCs4z|j�|�}d}Wntjk
r.d}YnX|S)zCCheck if the string color is a legal Tkinter color string.
        TF)r.Z	winfo_rgbr�ZTclError)r�r9Zrgb�okr�r�r��_iscolorstring7s
zTurtleScreenBase._iscolorstringcCs0|dk	r |jj|d�|��n|j�d�SdS)zVSet canvas' backgroundcolor if color is not None,
        else return backgroundcolor.N)r�r�)r.r
rJr)r�r9r�r�r��_bgcolorAs
zTurtleScreenBase._bgcolorcCst|\}}||j}||j}dddd�}|jj|d||||||d�}	|j�|	�\}
}}}
|j��|	|dfS)z�Write txt at pos in canvas with specified font
        and color.
        Return text item and x-coord of right bottom corner
        of text's bounding box.�swr�Zse)rP�centerr_r�)�text�anchorr"�font)r4r5r.Zcreate_textrr,)r�r[�txt�alignrUrWr�r�rTrHZx0Zy0Zx1Zy1r�r�r��_writeJs

�
zTurtleScreenBase._writer�csD�dkr�j�|d|�n$��fdd�}�j�|d|||�dS)z�Bind fun to mouse-click event on turtle.
        fun must be a function with two arguments, the coordinates
        of the clicked point on the canvas.
        num, the number of the mouse-button defaults to 1
        N�<Button-%s>cs:�j�|j��j�j�|j��j}}�||�dSr��r.�canvasxr�r4�canvasyr�r5�rr�r���funr�r�r��eventfunes�z+TurtleScreenBase._onclick.<locals>.eventfun�r.Z
tag_unbindZtag_bind�r�rHr_�num�addr`r�r^r��_onclick\szTurtleScreenBase._onclickcsD�dkr�j�|d|�n$��fdd�}�j�|d|||�dS)agBind fun to mouse-button-release event on turtle.
        fun must be a function with two arguments, the coordinates
        of the point on the canvas where mouse button is released.
        num, the number of the mouse-button defaults to 1

        If a turtle is clicked, first _onclick-event will be performed,
        then _onscreensclick-event.
        Nz<Button%s-ButtonRelease>cs:�j�|j��j�j�|j��j}}�||�dSr�rZr]r^r�r�r`ws�z-TurtleScreenBase._onrelease.<locals>.eventfunrarbr�r^r��
_onreleaseks	�zTurtleScreenBase._onreleasecsD�dkr�j�|d|�n$��fdd�}�j�|d|||�dS)aqBind fun to mouse-move-event (with pressed mouse button) on turtle.
        fun must be a function with two arguments, the coordinates of the
        actual mouse position on the canvas.
        num, the number of the mouse-button defaults to 1

        Every sequence of mouse-move-events on a turtle is preceded by a
        mouse-click event on that turtle.
        Nz<Button%s-Motion>csTz:�j�|j��j�j�|j��j}}�||�Wntk
rNYnXdSr�)r.r[r�r4r\r�r5r�r]r^r�r�r`�s�z*TurtleScreenBase._ondrag.<locals>.eventfunrarbr�r^r��_ondrag~s	zTurtleScreenBase._ondragcs@�dkr�j�d|�n"��fdd�}�j�d|||�dS)aGBind fun to mouse-click event on canvas.
        fun must be a function with two arguments, the coordinates
        of the clicked point on the canvas.
        num, the number of the mouse-button defaults to 1

        If a turtle is clicked, first _onclick-event will be performed,
        then _onscreensclick-event.
        NrYcs:�j�|j��j�j�|j��j}}�||�dSr�rZr]r^r�r�r`�s�z1TurtleScreenBase._onscreenclick.<locals>.eventfun�r.rr)r�r_rcrdr`r�r^r��_onscreenclick�s	zTurtleScreenBase._onscreenclickcs>�dkr|j�d|d�n�fdd�}|j�d||�dS)z`Bind fun to key-release event of key.
        Canvas must have focus. See method listen
        Nz<KeyRelease-%s>cs
��dSr�r��r�r_r�r�r`�sz0TurtleScreenBase._onkeyrelease.<locals>.eventfunrh�r�r_r�r`r�rkr��
_onkeyrelease�szTurtleScreenBase._onkeyreleasecsn�dkr4|dkr |j�dd�qj|j�d|d�n6�fdd�}|dkrX|j�d|�n|j�d||�dS)z�If key is given, bind fun to key-press event of key.
        Otherwise bind fun to any key-press.
        Canvas must have focus. See method listen.
        Nz
<KeyPress>z
<KeyPress-%s>cs
��dSr�r�rjrkr�r�r`�sz.TurtleScreenBase._onkeypress.<locals>.eventfunrhrlr�rkr��_onkeypress�szTurtleScreenBase._onkeypresscCs|j��dS)z=Set focus on canvas (in order to collect key-events)
        N)r.rr�r�r�r��_listen�szTurtleScreenBase._listencCs(|dkr|j�|�n|j�||�dS)z?Install a timer, which calls fun after t milliseconds.
        rN)r.Z
after_idlerK�r�r_�tr�r�r��_ontimer�szTurtleScreenBase._ontimercCs|jjdd|d�S)z0Create and return image item on canvas.
        r��image)r.Zcreate_image)r�rtr�r�r��_createimage�szTurtleScreenBase._createimagecCs<|\}}|j�|||j||jf�|jj||d�dS)zZConfigure image item as to draw image object
        at position (x,y) on canvas)
        rsN)r.r?r4r5�
itemconfig)r�rHr[rtr�r�r�r�r��
_drawimage�s zTurtleScreenBase._drawimagecCs |jj||d�|j�|�dS)z�Configure image item as to draw image object
        at center of canvas. Set item to the first item
        in the displaylist, so it will be drawn below
        any other item .rsN)r.rvZ	tag_lower)r�rHrtr�r�r��	_setbgpic�szTurtleScreenBase._setbgpiccCs|j�|�S)zQReturn 'line' or 'polygon' or 'image' depending on
        type of item.
        )r.r�rGr�r�r��_type�szTurtleScreenBase._typecs.|j�|���fdd�tdt��d�D�}|S)a returns list of coordinate-pairs of points of item
        Example (for insiders):
        >>> from turtle import *
        >>> getscreen()._pointlist(getturtle().turtle._item)
        [(0.0, 9.9999999999999982), (0.0, -9.9999999999999982),
        (9.9999999999999982, 0.0)]
        >>> cs"g|]}�|�|df�qS)r�r���.0�i�rBr�r��
<listcomp>�sz/TurtleScreenBase._pointlist.<locals>.<listcomp>rr�)r.r?�range�len)r�rH�plr�r}r��
_pointlist�szTurtleScreenBase._pointlistcCs|jj||||fd�dS)Nr3)r.r
)r��srx1�sry1�srx2�sry2r�r�r��_setscrollregion�sz!TurtleScreenBase._setscrollregionc	Cs||j��}|D]h}t|j�|��}g}|rd|dd�\}}|�||�|�||�|dd�}q&|jj|f|��qdS)Nr�)r.Zfind_allr�r?r>)	r�ZxscalefactorZyscalefactorr�rHZcoordinatesZnewcoordlistr�r�r�r�r��_rescale�s
zTurtleScreenBase._rescalecCszt|jt�s|j|jfS||kr6|kr6dkrJnn|jj|jjfS|dk	rX||_|dk	rf||_|j�|||�dS)zaResize the canvas the turtles are drawing on. Does
        not alter the drawing window.
        N)r�r.rr�r�r`rr�r�r��_resizes"zTurtleScreenBase._resizecCs@|j��}|dkr|jd}|j��}|dkr8|jd}||fS)z; Return the width and height of the turtle window.
        r�rzr�)r.rr)r�rzr�r�r�r��_window_sizes



zTurtleScreenBase._window_sizecCs|jj��dS)a{Starts event loop - calling Tkinter's mainloop function.

        No argument.

        Must be last statement in a turtle graphics program.
        Must NOT be used if a script is run from within IDLE in -n mode
        (No subprocess) - for interactive use of turtle graphics.

        Example (for a TurtleScreen instance named screen):
        >>> screen.mainloop()

        N)r.Ztkrr�r�r�r�rs
zTurtleScreenBase.mainloopcCstj|||jd�S)a�Pop up a dialog window for input of a string.

        Arguments: title is the title of the dialog window,
        prompt is a text mostly describing what information to input.

        Return the string input
        If the dialog is canceled, return None.

        Example (for a TurtleScreen instance named screen):
        >>> screen.textinput("NIM", "Name of first player:")

        )�parent)rZ	askstringr.)r�r)�promptr�r�r�r(.s
zTurtleScreenBase.textinputcCstj||||||jd�S)a�Pop up a dialog window for input of a number.

        Arguments: title is the title of the dialog window,
        prompt is a text mostly describing what numerical information to input.
        default: default value
        minval: minimum value for input
        maxval: maximum value for input

        The number input must be in the range minval .. maxval if these are
        given. If not, a hint is issued and the dialog remains open for
        correction. Return the number input.
        If the dialog is canceled,  return None.

        Example (for a TurtleScreen instance named screen):
        >>> screen.numinput("Poker", "Your stakes:", 1000, minval=10, maxval=10000)

        )ZinitialvalueZminvalueZmaxvaluer�)rZaskfloatr.)r�r)r��defaultZminvalZmaxvalr�r�r�r=s

�zTurtleScreenBase.numinput)NNNF)NNNF)N)r�N)r�N)r�N)r�N)N)NNN)NNN)%r�r�r�r�r0r2r�r:rCrDrErIrJrMrOrPrXrerfrgrirmrnrorrrurwrxryr�r�r�r�r�rr(rr�r�r�r�r,�sT
�
�


	





r,c@seZdZdZdS)r�z�Will be raised in TurtleScreen.update, if _RUNNING becomes False.

    This stops execution of a turtle graphics script.
    Main purpose: use in the Demo-Viewer turtle.Demo.py.
    N�r�r�r�r�r�r�r�r�r�Ysc@seZdZdZdS)�TurtleGraphicsErrorzSome TurtleGraphics Error
    Nr�r�r�r�r�r�bsr�c@s$eZdZdZddd�Zddd�ZdS)	rz�Data structure modeling shapes.

    attribute _type is one of "polygon", "image", "compound"
    attribute _data is - depending on _type a poygon-tuple,
    an image or a list constructed using the addcomponent method.
    NcCsz||_|dkr"t|t�rpt|�}nN|dkrVt|t�rp|���d�rpt|�rpt�	|�}n|dkrdg}nt
d|��||_dS)N�polygonrt�.gif�compoundzThere is no shape type %s)ryr�r�r�r��lower�endswithrrr2r��_data)r�Ztype_�datar�r�r�r�ns


zShape.__init__cCs:|jdkrtd|j��|dkr$|}|j�|||g�dS)a-Add component to a shape of type compound.

        Arguments: poly is a polygon, i. e. a tuple of number pairs.
        fill is the fillcolor of the component,
        outline is the outline color of the component.

        call (for a Shapeobject namend s):
        --   s.addcomponent(((0,0), (10,10), (-10,10)), "red", "blue")

        Example:
        >>> poly = ((0,0),(10,-5),(0,10),(-10,-5))
        >>> s = Shape("compound")
        >>> s.addcomponent(poly, "red", "blue")
        >>> # .. add more components and then use register_shape()
        r�z Cannot add component to %s ShapeN)ryr�r�r>)r��polyr"r9r�r�r��addcomponent~s
�zShape.addcomponent)N)N)r�r�r�r�r�r�r�r�r�r�rgs
c@sDeZdZdZddd�Zddd�Zdd	�Zd
d�Zdd
�Zdd�Z	dS)�Tbufferz5Ring buffer used as undobuffer for RawTurtle objects.r�cCs$||_dgg||_d|_d|_dS)Nr�F)�bufsize�buffer�ptr�cumulate)r�r�r�r�r�r��szTbuffer.__init__NcCsD|dkr&t|j�D]}dg|j|<qn||_dgg||_d|_dS)Nr�)rr�r�r�)r�r�r|r�r�r�r`�sz
Tbuffer.resetcCsF|jdkrB|js0|jd|j|_||j|j<n|j|j�|�dSr�)r�r�r�r�r>rGr�r�r��push�s

zTbuffer.pushcCsJ|jdkrF|j|j}|dkr"dSdg|j|j<|jd|j|_|SdSr�)r�r�r�rGr�r�r��pop�s
zTbuffer.popcCs|j|j�dg�Sr�)r�r��countr�r�r�r��nr_of_items�szTbuffer.nr_of_itemscCst|j�dt|j�S)N� )r�r�r�r�r�r�r�r��szTbuffer.__repr__)r�)N)
r�r�r�r�r�r`r�r�r�r�r�r�r�r�r��s

	r�c@s"eZdZdZdZedededfdd�Zdd	�Zd=dd�Zd
d�Z	d>dd�Z
dd�Zdd�Zd?dd�Z
dd�Zdd�Zdd�Zd@dd�ZdAdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�ZdBd.d/�Zd0d1�ZdCd2d3�ZdDd4d5�ZdEd7d8�ZdFd9d:�ZdGd;d<�ZeZ eZ!eZ"e
Z#eZ$d
S)Hrz�Provides screen oriented methods like setbg etc.

    Only relies upon the methods of TurtleScreenBase and NOT
    upon components of the underlying graphics toolkit -
    which is Tkinter in this case.
    Trrrc
Cs�t�||�tdd�tdd�tdd�tdd�tdd�tdd�td|���d	�|_d
di|_||_||_td|_	g|_
|��tj
d
kr�|��}|�ddddd�|�ddddd�dS)Nr�)����r�r�r�rr�))r�)����)r�r�)����)����	)����)����)r�r�)������)���r�)r�r�)r�r��rr�)�r�)�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�r�)r�)��Q�#@���Q�@)�G�z. @��Q��@)r�r�)r�r�r�)���Q��r�)��Q���r�)�G�z. �r�)��Q�#�r�r�)r�r�)r�r�)r�r�)r�r�)g�g$�)r�r�)r�r�)r�r�)r�r�))r�r�)r�r�)r�r�)r�r�))r���G�z�)rg�����'@)r�r�)�rr)r�r�r�)r�r�rt)Zarrowr�r4ZsquareZtriangler�r/�nopicr�r�darwinZwmZ
attributesr�z-topmost�1�0)r,r�rr0�_shapes�_bgpics�_mode�_delayvaluer��
_colormode�_keysr5�sys�platformr�Zcall)r�r.rrrZ
rootwindowr�r�r�r��s&�


zTurtleScreen.__init__cCs�td|_td|_|�d�|�d�|_d|_d|_d|_g|_	|�
d�d	D]}|�d
|�qP|�d
�|j
d
d
�D]}|�d
|�|�d
|�qzd
t_d
S)aqDelete all drawings and all turtles from the TurtleScreen.

        No argument.

        Reset empty TurtleScreen to its initial state: white background,
        no backgroundimage, no eventbindings and tracing on.

        Example (for a TurtleScreen instance named screen):
        >>> screen.clear()

        Note: this method is not available as function.
        rr�allr�r�r�rr�)r�r��N)r�r�r�rIru�_bgpic�
_bgpicname�_tracing�_updatecounter�_turtlesrrRrr�rr�_pen)r��btnr�r�r�r�r5�s 




zTurtleScreen.clearNcCs||dkr|jS|��}|dkr*td|��||_|dkrp|�|jd|jd|jd|jd�d|_|_|��dS)ahSet turtle-mode ('standard', 'logo' or 'world') and perform reset.

        Optional argument:
        mode -- one of the strings 'standard', 'logo' or 'world'

        Mode 'standard' is compatible with turtle.py.
        Mode 'logo' is compatible with most Logo-Turtle-Graphics.
        Mode 'world' uses userdefined 'worldcoordinates'. *Attention*: in
        this mode angles appear distorted if x/y unit-ratio doesn't equal 1.
        If mode is not given, return the current mode.

             Mode      Initial turtle heading     positive angles
         ------------|-------------------------|-------------------
          'standard'    to the right (east)       counterclockwise
            'logo'        upward    (north)         clockwise

        Examples:
        >>> mode('logo')   # resets turtle heading to north
        >>> mode()
        'logo'
        N�r��logo�worldzNo turtle-graphics-mode %s)r�r�r�r�)	r�r�r�r�r�r�r4r5r`�r�rr�r�r�rs�zTurtleScreen.modecCs�|��dkr|�d�t||�}t||�}|��\}}|�|d|d�|j|j}	}
|j||_|j||_||j}||j}|j|}
|j|}|�|||
|�|�	|j|	|j|
�|�
�dS)asSet up a user defined coordinate-system.

        Arguments:
        llx -- a number, x-coordinate of lower left corner of canvas
        lly -- a number, y-coordinate of lower left corner of canvas
        urx -- a number, x-coordinate of upper right corner of canvas
        ury -- a number, y-coordinate of upper right corner of canvas

        Set up user coodinat-system and switch to mode 'world' if necessary.
        This performs a screen.reset. If mode 'world' is already active,
        all drawings are redrawn according to the new coordinates.

        But ATTENTION: in user-defined coordinatesystems angles may appear
        distorted. (see Screen.mode())

        Example (for a TurtleScreen instance named screen):
        >>> screen.setworldcoordinates(-10,-0.5,50,1.5)
        >>> for _ in range(36):
        ...     left(10)
        ...     forward(0.5)
        r��N)rr�r�r%r4r5r�r�r�r�r,)r�ZllxZllyZurxZuryZxspanZyspanZwxZwyZ	oldxscaleZ	oldyscaler�r�r�r�r�r�r�r'-s 



z TurtleScreen.setworldcoordinatescCsT|dkr2|���d�r(td|�|��}qFtd��nt|t�rFtd|�}||j|<dS)a�Adds a turtle shape to TurtleScreen's shapelist.

        Arguments:
        (1) name is the name of a gif-file and shape is None.
            Installs the corresponding image shape.
            !! Image-shapes DO NOT rotate when turning the turtle,
            !! so they do not display the heading of the turtle!
        (2) name is an arbitrary string and shape is a tuple
            of pairs of coordinates. Installs the corresponding
            polygon shape
        (3) name is an arbitrary string and shape is a
            (compound) Shape object. Installs the corresponding
            compound shape.
        To use a shape, you have to issue the command shape(shapename).

        call: register_shape("turtle.gif")
        --or: register_shape("tri", ((0,0), (10,10), (-10,10)))

        Example (for a TurtleScreen instance named screen):
        >>> screen.register_shape("triangle", ((5,-3),(0,5),(-5,-3)))

        Nr�rtz;Bad arguments for register_shape.
Use  help(register_shape)r�)r�r�rr2r�r�r�r�)r��namerkr�r�r�r#Ts


zTurtleScreen.register_shapec	Cst|�dkr|d}t|t�rD|�|�s0|dkr4|Stdt|���z|\}}}Wn(ttfk
rztdt|���YnX|jdkr�dd�|||fD�\}}}d|kr�d	kr�nn.d|kr�d	kr�nnd|kr�d	ks�ntd
t|���d|||fS)aReturn color string corresponding to args.

        Argument may be a string or a tuple of three
        numbers corresponding to actual colormode,
        i.e. in the range 0<=n<=colormode.

        If the argument doesn't represent a color,
        an error is raised.
        r�rr�zbad color string: %s�bad color arguments: %sr�cSsg|]}td|��qS�g�o@��round�r{r�r�r�r�r~�sz*TurtleScreen._colorstr.<locals>.<listcomp>��bad color sequence: %s�
#%02x%02x%02x)r�r�r�rOr��	TypeErrorr�r�)r�r9r��g�br�r�r��	_colorstrws


FzTurtleScreen._colorstrcsx��d�s�St��dkr.�fdd�dD�}n4t��dkrV�fdd��dd�D�}ntd	���t�fd
d�|D��S)Nr�r�cs"g|]}t�||d�d��qS)r�r��r�rz��cstrr�r�r~�sz'TurtleScreen._color.<locals>.<listcomp>)r�r�r�r�csg|]}dt�|d��qS)r�r�)r{r7r�r�r�r~�sr�zbad colorstring: %sc3s|]}|�jdVqdS)r�N)r�)r{r�r�r�r��	<genexpr>�sz&TurtleScreen._color.<locals>.<genexpr>)r�r�r�r�)r�r�rBr�)r�r�r��_color�s
zTurtleScreen._colorcCs8|dkr|jS|dkr"t|�|_n|dkr4t|�|_dS)aqReturn the colormode or set it to 1.0 or 255.

        Optional argument:
        cmode -- one of the values 1.0 or 255

        r, g, b values of colortriples have to be in range 0..cmode.

        Example (for a TurtleScreen instance named screen):
        >>> screen.colormode()
        1.0
        >>> screen.colormode(255)
        >>> pencolor(240,160,80)
        Nr�r�)r�r�r�)r�Zcmoder�r�r�r�szTurtleScreen.colormodecCs$|jD]}|�|j�|��qdS)z�Reset all Turtles on the Screen to their initial state.

        No argument.

        Example (for a TurtleScreen instance named screen):
        >>> screen.reset()
        N)r��_setmoder�r`)r�r�r�r�r�r`�s
zTurtleScreen.resetcCs|jS)z�Return the list of turtles on the screen.

        Example (for a TurtleScreen instance named screen):
        >>> screen.turtles()
        [<turtle.Turtle object at 0x00E11FB0>]
        )r�r�r�r�r�r+�szTurtleScreen.turtlescGs4|r|�|�}nd}|�|�}|dk	r0|�|�}|S)a�Set or return backgroundcolor of the TurtleScreen.

        Arguments (if given): a color string or three numbers
        in the range 0..colormode or a 3-tuple of such numbers.

        Example (for a TurtleScreen instance named screen):
        >>> screen.bgcolor("orange")
        >>> screen.bgcolor()
        'orange'
        >>> screen.bgcolor(0.5,0,0.5)
        >>> screen.bgcolor()
        '#800080'
        N)r�rPr��r�rr9r�r�r�r�s

zTurtleScreen.bgcolorcCsB|dkr|jSt|�|_d|_|dk	r0t|�|_|jr>|��dS)aeTurns turtle animation on/off and set delay for update drawings.

        Optional arguments:
        n -- nonnegative  integer
        delay -- nonnegative  integer

        If n is given, only each n-th regular screen update is really performed.
        (Can be used to accelerate the drawing of complex graphics.)
        Second arguments sets delay value (see RawTurtle.delay())

        Example (for a TurtleScreen instance named screen):
        >>> screen.tracer(8, 25)
        >>> dist = 2
        >>> for i in range(200):
        ...     fd(dist)
        ...     rt(90)
        ...     dist += 2
        Nr)r�r�r�r�r,)r��nrr�r�r�r*�s

zTurtleScreen.tracercCs|dkr|jSt|�|_dS)z� Return or set the drawing delay in milliseconds.

        Optional argument:
        delay -- positive integer

        Example (for a TurtleScreen instance named screen):
        >>> screen.delay(15)
        >>> screen.delay()
        15
        N)r�r�rLr�r�r�r�szTurtleScreen.delaycCs<tjsdt_t�|jdkr8|jd7_|j|j;_dS)zIncrement update counter.Trr�N)r�_RUNNINGr�r�r�r�r�r�r��
_incrementudc	s
zTurtleScreen._incrementudccCs<|j}d|_|��D]}|��|��q||_|��dS)z'Perform a TurtleScreen update.
        TN)r�r+�_update_data�_drawturtlerJ)r��tracingrqr�r�r�r,s
zTurtleScreen.updatecCs|��dS)z� Return the width of the turtle window.

        Example (for a TurtleScreen instance named screen):
        >>> screen.window_width()
        640
        r�r�r�r�r�r�r.szTurtleScreen.window_widthcCs|��dS)z� Return the height of the turtle window.

        Example (for a TurtleScreen instance named screen):
        >>> screen.window_height()
        480
        r�r�r�r�r�r�r-&szTurtleScreen.window_heightcCs|jS)z�Return the Canvas of this TurtleScreen.

        No argument.

        Example (for a Screen instance named screen):
        >>> cv = screen.getcanvas()
        >>> cv
        <turtle.ScrolledCanvas instance at 0x010742D8>
        )r.r�r�r�r�r/s
zTurtleScreen.getcanvascCst|j���S)z�Return a list of names of all currently available turtle shapes.

        No argument.

        Example (for a TurtleScreen instance named screen):
        >>> screen.getshapes()
        ['arrow', 'blank', 'circle', ... , 'turtle']
        )�sortedr�r�r�r�r�r�r;s	zTurtleScreen.getshapesr�cCs|�|||�dS)a�Bind fun to mouse-click event on canvas.

        Arguments:
        fun -- a function with two arguments, the coordinates of the
               clicked point on the canvas.
        btn -- the number of the mouse-button, defaults to 1

        Example (for a TurtleScreen instance named screen)

        >>> screen.onclick(goto)
        >>> # Subsequently clicking into the TurtleScreen will
        >>> # make the turtle move to the clicked point.
        >>> screen.onclick(None)
        N)ri�r�r_r�rdr�r�r�rRFszTurtleScreen.onclickcCsF|dkr ||jkr6|j�|�n||jkr6|j�|�|�||�dS)amBind fun to key-release event of key.

        Arguments:
        fun -- a function with no arguments
        key -- a string: key (e.g. "a") or key-symbol (e.g. "space")

        In order to be able to register key-events, TurtleScreen
        must have focus. (See method listen.)

        Example (for a TurtleScreen instance named screen):

        >>> def f():
        ...     fd(50)
        ...     lt(60)
        ...
        >>> screen.onkey(f, "Up")
        >>> screen.listen()

        Subsequently the turtle can be moved by repeatedly pressing
        the up-arrow key, consequently drawing a hexagon

        N)r��remover>rm�r�r_r�r�r�r�rWs

zTurtleScreen.onkeycCsN|dkr ||jkr>|j�|�n|dk	r>||jkr>|j�|�|�||�dS)aBind fun to key-press event of key if key is given,
        or to any key-press-event if no key is given.

        Arguments:
        fun -- a function with no arguments
        key -- a string: key (e.g. "a") or key-symbol (e.g. "space")

        In order to be able to register key-events, TurtleScreen
        must have focus. (See method listen.)

        Example (for a TurtleScreen instance named screen
        and a Turtle instance named turtle):

        >>> def f():
        ...     fd(50)
        ...     lt(60)
        ...
        >>> screen.onkeypress(f, "Up")
        >>> screen.listen()

        Subsequently the turtle can be moved by repeatedly pressing
        the up-arrow key, or by keeping pressed the up-arrow key.
        consequently drawing a hexagon.
        N)r�r�r>rnr�r�r�r�rus
zTurtleScreen.onkeypresscCs|��dS)aSet focus on TurtleScreen (in order to collect key-events)

        No arguments.
        Dummy arguments are provided in order
        to be able to pass listen to the onclick method.

        Example (for a TurtleScreen instance named screen):
        >>> screen.listen()
        N)ro)r��xdummy�ydummyr�r�r�r�s
zTurtleScreen.listenrcCs|�||�dS)a�Install a timer, which calls fun after t milliseconds.

        Arguments:
        fun -- a function with no arguments.
        t -- a number >= 0

        Example (for a TurtleScreen instance named screen):

        >>> running = True
        >>> def f():
        ...     if running:
        ...             fd(50)
        ...             lt(60)
        ...             screen.ontimer(f, 250)
        ...
        >>> f()   # makes the turtle marching around
        >>> running = False
        N)rrrpr�r�r�r"�szTurtleScreen.ontimercCsF|dkr|jS||jkr(|�|�|j|<|�|j|j|�||_dS)aFSet background image or return name of current backgroundimage.

        Optional argument:
        picname -- a string, name of a gif-file or "nopic".

        If picname is a filename, set the corresponding image as background.
        If picname is "nopic", delete backgroundimage, if present.
        If picname is None, return the filename of the current backgroundimage.

        Example (for a TurtleScreen instance named screen):
        >>> screen.bgpic()
        'nopic'
        >>> screen.bgpic("landscape.gif")
        >>> screen.bgpic()
        'landscape.gif'
        N)r�r�r2rxr�)r�Zpicnamer�r�r�r�s
zTurtleScreen.bgpiccCs|�|||�S)a�Resize the canvas the turtles are drawing on.

        Optional arguments:
        canvwidth -- positive integer, new width of canvas in pixels
        canvheight --  positive integer, new height of canvas in pixels
        bg -- colorstring or color-tuple, new backgroundcolor
        If no arguments are given, return current (canvaswidth, canvasheight)

        Do not alter the drawing window. To observe hidden parts of
        the canvas use the scrollbars. (Can make visible those parts
        of a drawing, which were outside the canvas before!)

        Example (for a Turtle instance named turtle):
        >>> turtle.screensize(2000,1500)
        >>> # e.g. to search for an erroneously escaped turtle ;-)
        )r�rr�r�r�r%�szTurtleScreen.screensize)N)N)N)NN)N)r�N)N)NN)r)N)NNN)%r�r�r�r�r�r�r�r5rr'r#r�r�rr`r+rr*rr�r,r.r-rrrRrrrr"rr%r!r$rrr r�r�r�r�r�sH�
(
"'
#
	

			

 



c@sTeZdZdZedd�edd�edd�d�ZdZdZdZefdd	�Z	d
d�Z
dBd
d�Zdd�ZdCdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�ZdDd*d+�Zd,d-�Zd.d/�Zd0d1�ZdEd2d3�ZdFd4d5�Zd6d7�Zd8d9�Z dGd:d;�Z!dHd<d=�Z"dId>d?�Z#dJd@dA�Z$eZ%eZ&eZ'eZ(eZ)eZ*eZ+eZ,e Z-dS)K�
TNavigatorzRNavigation part of the RawTurtle.
    Implements methods for turtle movement.
    r��)r�r�r�r�rr�cCsB|j|_|j|_||_d|_|��d|_|�|�t�	|�dSr�)
�DEFAULT_ANGLEOFFSET�_angleOffset�DEFAULT_ANGLEORIENT�_angleOrientr��
undobufferr:r�r�r`r�r�r�r�r��s
zTNavigator.__init__cCstdd�|_tj|j|_dS)zXreset turtle to its initial values

        Will be overwritten by parent class
        r�N)r�	_positionr��START_ORIENTATIONr��_orientr�r�r�r�r`�szTNavigator.resetNcCsL|dkr|jS|dkrdS||_|dkr6d|_d|_n|jd|_d|_dS)z:Set turtle-mode to 'standard', 'world' or 'logo'.
        Nr�)r�r�rr��@r�)r�rr�_fullcircler�r�r�r�r�szTNavigator._setmodecCs0||_d||_|jdkr"d|_n
|d|_dS)z+Helper function for degrees() and radians()ihr�rrN)r�
_degreesPerAUr�r�r�Z
fullcircler�r�r��_setDegreesPerAUs


zTNavigator._setDegreesPerAU��v@cCs|�|�dS)a> Set angle measurement units to degrees.

        Optional argument:
        fullcircle -  a number

        Set angle measurement units, i. e. set number
        of 'degrees' for a full circle. Default value is
        360 degrees.

        Example (for a Turtle instance named turtle):
        >>> turtle.left(90)
        >>> turtle.heading()
        90

        Change angle measurement unit to grad (also known as gon,
        grade, or gradian and equals 1/100-th of the right angle.)
        >>> turtle.degrees(400.0)
        >>> turtle.heading()
        100

        N)rr
r�r�r�r:szTNavigator.degreescCs|�dtj�dS)a Set the angle measurement units to radians.

        No arguments.

        Example (for a Turtle instance named turtle):
        >>> turtle.heading()
        90
        >>> turtle.radians()
        >>> turtle.heading()
        1.5707963267948966
        r�N)rr�r�r�r�r�r�r^5szTNavigator.radianscCs|j|j|}|�|�dS)z)move turtle forward by specified distanceN)rr�_goto)r�r;Zender�r�r��_goCszTNavigator._gocCs||j9}|j�|�|_dS)z=Turn turtle counterclockwise by specified angle if angle > 0.N)r	rr��r�r�r�r�r��_rotateHs
zTNavigator._rotatecCs
||_dS)zmove turtle to position end.N�r)r��endr�r�r�r
MszTNavigator._gotocCs|�|�dS)aMove the turtle forward by the specified distance.

        Aliases: forward | fd

        Argument:
        distance -- a number (integer or float)

        Move the turtle forward by the specified distance, in the direction
        the turtle is headed.

        Example (for a Turtle instance named turtle):
        >>> turtle.position()
        (0.00, 0.00)
        >>> turtle.forward(25)
        >>> turtle.position()
        (25.00,0.00)
        >>> turtle.forward(-75)
        >>> turtle.position()
        (-50.00,0.00)
        N�r�r�r;r�r�r�rCQszTNavigator.forwardcCs|�|�dS)a�Move the turtle backward by distance.

        Aliases: back | backward | bk

        Argument:
        distance -- a number

        Move the turtle backward by distance, opposite to the direction the
        turtle is headed. Do not change the turtle's heading.

        Example (for a Turtle instance named turtle):
        >>> turtle.position()
        (0.00, 0.00)
        >>> turtle.backward(30)
        >>> turtle.position()
        (-30.00, 0.00)
        Nrrr�r�r�r/hszTNavigator.backcCs|�|�dS)a�Turn turtle right by angle units.

        Aliases: right | rt

        Argument:
        angle -- a number (integer or float)

        Turn turtle right by angle units. (Units are by default degrees,
        but can be set via the degrees() and radians() functions.)
        Angle orientation depends on mode. (See this.)

        Example (for a Turtle instance named turtle):
        >>> turtle.heading()
        22.0
        >>> turtle.right(45)
        >>> turtle.heading()
        337.0
        N�rrr�r�r�r_|szTNavigator.rightcCs|�|�dS)a�Turn turtle left by angle units.

        Aliases: left | lt

        Argument:
        angle -- a number (integer or float)

        Turn turtle left by angle units. (Units are by default degrees,
        but can be set via the degrees() and radians() functions.)
        Angle orientation depends on mode. (See this.)

        Example (for a Turtle instance named turtle):
        >>> turtle.heading()
        22.0
        >>> turtle.left(45)
        >>> turtle.heading()
        67.0
        Nrrr�r�r�rP�szTNavigator.leftcCs|jS)z�Return the turtle's current location (x,y), as a Vec2D-vector.

        Aliases: pos | position

        No arguments.

        Example (for a Turtle instance named turtle):
        >>> turtle.pos()
        (0.00, 240.00)
        rr�r�r�r�r[�szTNavigator.poscCs
|jdS)z� Return the turtle's x coordinate.

        No arguments.

        Example (for a Turtle instance named turtle):
        >>> reset()
        >>> turtle.left(60)
        >>> turtle.forward(100)
        >>> print turtle.xcor()
        50.0
        rrr�r�r�r�r|�szTNavigator.xcorcCs
|jdS)a	 Return the turtle's y coordinate
        ---
        No arguments.

        Example (for a Turtle instance named turtle):
        >>> reset()
        >>> turtle.left(60)
        >>> turtle.forward(100)
        >>> print turtle.ycor()
        86.6025403784
        r�rr�r�r�r�r}�szTNavigator.ycorcCs,|dkr|�t|��n|�t||��dS)atMove turtle to an absolute position.

        Aliases: setpos | setposition | goto:

        Arguments:
        x -- a number      or     a pair/vector of numbers
        y -- a number             None

        call: goto(x, y)         # two coordinates
        --or: goto((x, y))       # a pair (tuple) of coordinates
        --or: goto(vec)          # e.g. as returned by pos()

        Move turtle to an absolute position. If the pen is down,
        a line will be drawn. The turtle's orientation does not change.

        Example (for a Turtle instance named turtle):
        >>> tp = turtle.pos()
        >>> tp
        (0.00, 0.00)
        >>> turtle.setpos(60,30)
        >>> turtle.pos()
        (60.00,30.00)
        >>> turtle.setpos((20,80))
        >>> turtle.pos()
        (20.00,80.00)
        >>> turtle.setpos(tp)
        >>> turtle.pos()
        (0.00,0.00)
        N)r
r)r�r�r�r�r�r�rI�szTNavigator.gotocCs|�dd�|�d�dS)a$Move turtle to the origin - coordinates (0,0).

        No arguments.

        Move turtle to the origin - coordinates (0,0) and set its
        heading to its start-orientation (which depends on mode).

        Example (for a Turtle instance named turtle):
        >>> turtle.home()
        rN)rIrdr�r�r�r�rL�szTNavigator.homecCs|�t||jd��dS)a�Set the turtle's first coordinate to x

        Argument:
        x -- a number (integer or float)

        Set the turtle's first coordinate to x, leave second coordinate
        unchanged.

        Example (for a Turtle instance named turtle):
        >>> turtle.position()
        (0.00, 240.00)
        >>> turtle.setx(10)
        >>> turtle.position()
        (10.00, 240.00)
        r�N�r
rr)r�r�r�r�r�riszTNavigator.setxcCs|�t|jd|��dS)a�Set the turtle's second coordinate to y

        Argument:
        y -- a number (integer or float)

        Set the turtle's first coordinate to x, second coordinate remains
        unchanged.

        Example (for a Turtle instance named turtle):
        >>> turtle.position()
        (0.00, 40.00)
        >>> turtle.sety(-10)
        >>> turtle.position()
        (0.00, -10.00)
        rNr)r�r�r�r�r�rjszTNavigator.setycCsT|dk	rt||�}t|t�r"|}n$t|t�r6t|�}nt|t�rF|j}t||j�S)a�Return the distance from the turtle to (x,y) in turtle step units.

        Arguments:
        x -- a number   or  a pair/vector of numbers   or   a turtle instance
        y -- a number       None                            None

        call: distance(x, y)         # two coordinates
        --or: distance((x, y))       # a pair (tuple) of coordinates
        --or: distance(vec)          # e.g. as returned by pos()
        --or: distance(mypen)        # where mypen is another turtle

        Example (for a Turtle instance named turtle):
        >>> turtle.pos()
        (0.00, 0.00)
        >>> turtle.distance(30,40)
        50.0
        >>> pen = Turtle()
        >>> pen.forward(77)
        >>> turtle.distance(pen)
        77.0
        N)rr�r�r�r�abs)r�r�r�r[r�r�r�r;%s




zTNavigator.distancecCs�|dk	rt||�}t|t�r"|}n$t|t�r6t|�}nt|t�rF|j}||j\}}tt�||�dtjd�d}||j	}|j
|j||jS)aCReturn the angle of the line from the turtle's position to (x, y).

        Arguments:
        x -- a number   or  a pair/vector of numbers   or   a turtle instance
        y -- a number       None                            None

        call: distance(x, y)         # two coordinates
        --or: distance((x, y))       # a pair (tuple) of coordinates
        --or: distance(vec)          # e.g. as returned by pos()
        --or: distance(mypen)        # where mypen is another turtle

        Return the angle, between the line from turtle-position to position
        specified by x, y and the turtle's start orientation. (Depends on
        modes - "standard" or "logo")

        Example (for a Turtle instance named turtle):
        >>> turtle.pos()
        (10.00, 10.00)
        >>> turtle.towards(0,0)
        225.0
        Nr�r�r)
rr�r�r�rr�r��atan2r�r	rrr)r�r�r�r[�resultr�r�r�ruEs




 
zTNavigator.towardscCsJ|j\}}tt�||�dtjd�d}||j}|j|j||jS)z� Return the turtle's current heading.

        No arguments.

        Example (for a Turtle instance named turtle):
        >>> turtle.left(67)
        >>> turtle.heading()
        67.0
        r�r�r)	rr�r�rr�r	rrr)r�r�r�rr�r�r�rJhs

 
zTNavigator.headingcCs>||��|j}|j}||d||d}|�|�dS)a�Set the orientation of the turtle to to_angle.

        Aliases:  setheading | seth

        Argument:
        to_angle -- a number (integer or float)

        Set the orientation of the turtle to to_angle.
        Here are some common directions in degrees:

         standard - mode:          logo-mode:
        -------------------|--------------------
           0 - east                0 - north
          90 - north              90 - east
         180 - west              180 - south
         270 - south             270 - west

        Example (for a Turtle instance named turtle):
        >>> turtle.setheading(90)
        >>> turtle.heading()
        90
        �@N)rJrrr)r�Zto_angler�Zfullr�r�r�rdwszTNavigator.setheadingcCsp|jr|j�dg�d|j_|��}|dkr2|j}|dkrjt|�|j}dttdt|�dd�|�}d||}d	|}d
|t�	|tj
d|j�}|dkr�|||}}}|��}	|�
�}
|dkr�|�dd�n
|�d�|�|�t|�D].}|�|�|�|�|�d�|�|��q|�|�|dk�rR|�|	|
�|�|�|j�rld
|j_dS)a� Draw a circle with given radius.

        Arguments:
        radius -- a number
        extent (optional) -- a number
        steps (optional) -- an integer

        Draw a circle with given radius. The center is radius units left
        of the turtle; extent - an angle - determines which part of the
        circle is drawn. If extent is not given, draw the entire circle.
        If extent is not a full circle, one endpoint of the arc is the
        current pen position. Draw the arc in counterclockwise direction
        if radius is positive, otherwise in clockwise direction. Finally
        the direction of the turtle is changed by the amount of extent.

        As the circle is approximated by an inscribed regular polygon,
        steps determines the number of steps to use. If not given,
        it will be calculated automatically. Maybe used to draw regular
        polygons.

        call: circle(radius)                  # full circle
        --or: circle(radius, extent)          # arc
        --or: circle(radius, extent, steps)
        --or: circle(radius, steps=6)         # 6-sided polygon

        Example (for a Turtle instance named turtle):
        >>> turtle.circle(50)
        >>> turtle.circle(120, 180)  # semicircle
        �seqTNr��g@g�M@r�r�rr�rF)rr�r�rprrr��minr�r�r�r	�_tracerrMrrr)r��radiusZextent�stepsrpZfracr6Zw2�lZtrZdlr|r�r�r�r4�s>""






zTNavigator.circlecCsdS�z/dummy method - to be overwritten by child classNr�)r�r�r�r�r�rp�szTNavigator.speedcCsdSr"r�)r��ar�r�r�r�r�szTNavigator._tracercCsdSr"r�)r�r�r�r�r�rM�szTNavigator._delay)N)r)N)N)N)NN)r)NN)N).r�r�r�r�rrZDEFAULT_MODEr�rr�r`r�rr:r^rrr
rCr/r_rPr[r|r}rIrLrirjr;rurJrdr4rprrMr@r3r0rbrQr\rerfrcr�r�r�r�r��sZ�

	


#
 
#
A


r�c@s�eZdZdZedfdd�Zededfdd�Zd.d
d�Zd/dd
�Zdd�Z	dd�Z
dd�Zd0dd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd1d"d#�Zd2d%d&�Zd3d(d)�Zd*d+�Zd,d-�ZeZe	Ze	Ze
Ze
ZeZeZd	S)4�TPenzFDrawing part of the RawTurtle.
    Implements drawing properties.
    racCs||_d|_t�|�dSr�)�_resizemoderr$�_reset)r�rar�r�r�r��sz
TPen.__init__rWrAcCsFd|_d|_||_||_d|_d|_d|_d|_d|_d|_	d|_
dS)Nr�Tr�)r�r�r�)r�r�r�r�)�_pensize�_shown�	_pencolor�
_fillcolor�_drawing�_speed�_stretchfactor�_shearfactor�_tilt�_shapetrafo�
_outlinewidth)r�rWrAr�r�r�r&�szTPen._resetNcCs.|dkr|jS|��}|dkr*|j|d�dS)azSet resizemode to one of the values: "auto", "user", "noresize".

        (Optional) Argument:
        rmode -- one of the strings "auto", "user", "noresize"

        Different resizemodes have the following effects:
          - "auto" adapts the appearance of the turtle
                   corresponding to the value of pensize.
          - "user" adapts the appearance of the turtle according to the
                   values of stretchfactor and outlinewidth (outline),
                   which are set by shapesize()
          - "noresize" no adaption of the turtle's appearance takes place.
        If no argument is given, return current resizemode.
        resizemode("user") is called by a call of shapesize with arguments.


        Examples (for a Turtle instance named turtle):
        >>> turtle.resizemode("noresize")
        >>> turtle.resizemode()
        'noresize'
        N)�auto�userr��ra)r%r�rV)r�Zrmoder�r�r�ra�s
zTPen.resizemodecCs|dkr|jS|j|d�dS)a!Set or return the line thickness.

        Aliases:  pensize | width

        Argument:
        width -- positive number

        Set the line thickness to width or return it. If resizemode is set
        to "auto" and turtleshape is a polygon, that polygon is drawn with
        the same line thickness. If no argument is given, current pensize
        is returned.

        Example (for a Turtle instance named turtle):
        >>> turtle.pensize()
        1
        >>> turtle.pensize(10)   # from here on lines of width 10 are drawn
        N)rY)r'rV)r�rzr�r�r�rYszTPen.pensizecCs|js
dS|jdd�dS)z�Pull the pen up -- no drawing when moving.

        Aliases: penup | pu | up

        No argument

        Example (for a Turtle instance named turtle):
        >>> turtle.penup()
        NF�rX�r+rVr�r�r�r�rZ0s
z
TPen.penupcCs|jr
dS|jdd�dS)z�Pull the pen down -- drawing when moving.

        Aliases: pendown | pd | down

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.pendown()
        NTr5r6r�r�r�r�rX>s
zTPen.pendowncCs|jS)aReturn True if pen is down, False if it's up.

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.penup()
        >>> turtle.isdown()
        False
        >>> turtle.pendown()
        >>> turtle.isdown()
        True
        )r+r�r�r�r�rNLs
zTPen.isdowncCsjdddddd�}|dkr|jS||kr0||}n*d|krDd	krVnntt|��}nd}|j|d
�dS)a� Return or set the turtle's speed.

        Optional argument:
        speed -- an integer in the range 0..10 or a speedstring (see below)

        Set the turtle's speed to an integer value in the range 0 .. 10.
        If no argument is given: return current speed.

        If input is a number greater than 10 or smaller than 0.5,
        speed is set to 0.
        Speedstrings  are mapped to speedvalues in the following way:
            'fastest' :  0
            'fast'    :  10
            'normal'  :  6
            'slow'    :  3
            'slowest' :  1
        speeds from 1 to 10 enforce increasingly faster animation of
        line drawing and turtle turning.

        Attention:
        speed = 0 : *no* animation takes place. forward/back makes turtle jump
        and likewise left/right make the turtle turn instantly.

        Example (for a Turtle instance named turtle):
        >>> turtle.speed(3)
        rr�r�r�r�)ZfastestZfast�normalZslowZslowestNr�g%@)rp)r,r�r�rV)r�rpZspeedsr�r�r�rp[s
z
TPen.speedcGs�|rht|�}|dkr"|d}}n"|dkr4|\}}n|dkrD|}}|�|�}|�|�}|j||d�n|�|j�|�|j�fSdS)a�Return or set the pencolor and fillcolor.

        Arguments:
        Several input formats are allowed.
        They use 0, 1, 2, or 3 arguments as follows:

        color()
            Return the current pencolor and the current fillcolor
            as a pair of color specification strings as are returned
            by pencolor and fillcolor.
        color(colorstring), color((r,g,b)), color(r,g,b)
            inputs as in pencolor, set both, fillcolor and pencolor,
            to the given value.
        color(colorstring1, colorstring2),
        color((r1,g1,b1), (r2,g2,b2))
            equivalent to pencolor(colorstring1) and fillcolor(colorstring2)
            and analogously, if the other input format is used.

        If turtleshape is a polygon, outline and interior of that polygon
        is drawn with the newly set colors.
        For more info see: pencolor, fillcolor

        Example (for a Turtle instance named turtle):
        >>> turtle.color('red', 'green')
        >>> turtle.color()
        ('red', 'green')
        >>> colormode(255)
        >>> color((40, 80, 120), (160, 200, 240))
        >>> color()
        ('#285078', '#a0c8f0')
        r�rr�r�)rWrAN)r�r�rVr�r)r*)r�rr!ZpcolorZfcolorr�r�r�r9�s 


z
TPen.colorcGs:|r*|�|�}||jkrdS|j|d�n|�|j�SdS)aZ Return or set the pencolor.

        Arguments:
        Four input formats are allowed:
          - pencolor()
            Return the current pencolor as color specification string,
            possibly in hex-number format (see example).
            May be used as input to another color/pencolor/fillcolor call.
          - pencolor(colorstring)
            s is a Tk color specification string, such as "red" or "yellow"
          - pencolor((r, g, b))
            *a tuple* of r, g, and b, which represent, an RGB color,
            and each of r, g, and b are in the range 0..colormode,
            where colormode is either 1.0 or 255
          - pencolor(r, g, b)
            r, g, and b represent an RGB color, and each of r, g, and b
            are in the range 0..colormode

        If turtleshape is a polygon, the outline of that polygon is drawn
        with the newly set pencolor.

        Example (for a Turtle instance named turtle):
        >>> turtle.pencolor('brown')
        >>> tup = (0.2, 0.8, 0.55)
        >>> turtle.pencolor(tup)
        >>> turtle.pencolor()
        '#33cc8c'
        N)rW)r�r)rVr�r�r�r�r�rW�s

z
TPen.pencolorcGs:|r*|�|�}||jkrdS|j|d�n|�|j�SdS)a] Return or set the fillcolor.

        Arguments:
        Four input formats are allowed:
          - fillcolor()
            Return the current fillcolor as color specification string,
            possibly in hex-number format (see example).
            May be used as input to another color/pencolor/fillcolor call.
          - fillcolor(colorstring)
            s is a Tk color specification string, such as "red" or "yellow"
          - fillcolor((r, g, b))
            *a tuple* of r, g, and b, which represent, an RGB color,
            and each of r, g, and b are in the range 0..colormode,
            where colormode is either 1.0 or 255
          - fillcolor(r, g, b)
            r, g, and b represent an RGB color, and each of r, g, and b
            are in the range 0..colormode

        If turtleshape is a polygon, the interior of that polygon is drawn
        with the newly set fillcolor.

        Example (for a Turtle instance named turtle):
        >>> turtle.fillcolor('violet')
        >>> col = turtle.pencolor()
        >>> turtle.fillcolor(col)
        >>> turtle.fillcolor(0, .5, 0)
        N)rA)r�r*rVr�r�r�r�r�rA�s

zTPen.fillcolorcCs|jdd�dS)z�Makes the turtle visible.

        Aliases: showturtle | st

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.hideturtle()
        >>> turtle.showturtle()
        T��shownN�rVr�r�r�r�ro�szTPen.showturtlecCs|jdd�dS)aYMakes the turtle invisible.

        Aliases: hideturtle | ht

        No argument.

        It's a good idea to do this while you're in the
        middle of a complicated drawing, because hiding
        the turtle speeds up the drawing observably.

        Example (for a Turtle instance named turtle):
        >>> turtle.hideturtle()
        Fr8Nr:r�r�r�r�rK	szTPen.hideturtlecCs|jS)z�Return True if the Turtle is shown, False if it's hidden.

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.hideturtle()
        >>> print turtle.isvisible():
        False
        )r(r�r�r�r�rO	s
zTPen.isvisiblecKs�|j|j|j|j|j|j|j|j|j|j	|j
d�}|s>|s>|St|t�rN|}ni}|�
|�i}|D]}||||<qd|jr�|j�d|f�d}d|kr�|j|dkr�d}d|kr�t|dt�r�|�|df�|d<|j|dkr�d}d|k�r|j|dk�rd}|�r|��d|k�r&|d|_d|k�r:|d|_d|k�rN|d|_d|k�r�t|dt��r||�|df�|d<|d|_d	|k�r�|d	|_d
|k�r�|d
|_d|k�r�|d}t|ttf��r�||f}||_d|k�r�|d|_d
|k�r|d
|_	d|k�r|d|_d|k�r.|d|_
d|k�sLd|k�sLd|k�r�|j\}	}
|j}t�|j
�t�|j
�}}
|	|
|
||
||	||
|
||f|_|��dS)aLReturn or set the pen's attributes.

        Arguments:
            pen -- a dictionary with some or all of the below listed keys.
            **pendict -- one or more keyword-arguments with the below
                         listed keys as keywords.

        Return or set the pen's attributes in a 'pen-dictionary'
        with the following key/value pairs:
           "shown"      :   True/False
           "pendown"    :   True/False
           "pencolor"   :   color-string or color-tuple
           "fillcolor"  :   color-string or color-tuple
           "pensize"    :   positive number
           "speed"      :   number in range 0..10
           "resizemode" :   "auto" or "user" or "noresize"
           "stretchfactor": (positive number, positive number)
           "shearfactor":   number
           "outline"    :   positive number
           "tilt"       :   number

        This dictionary can be used as argument for a subsequent
        pen()-call to restore the former pen-state. Moreover one
        or more of these attributes can be provided as keyword-arguments.
        This can be used to set several pen attributes in one statement.


        Examples (for a Turtle instance named turtle):
        >>> turtle.pen(fillcolor="black", pencolor="red", pensize=10)
        >>> turtle.pen()
        {'pensize': 10, 'shown': True, 'resizemode': 'auto', 'outline': 1,
        'pencolor': 'red', 'pendown': True, 'fillcolor': 'black',
        'stretchfactor': (1,1), 'speed': 3, 'shearfactor': 0.0}
        >>> penstate=turtle.pen()
        >>> turtle.color("yellow","")
        >>> turtle.penup()
        >>> turtle.pen()
        {'pensize': 10, 'shown': True, 'resizemode': 'auto', 'outline': 1,
        'pencolor': 'yellow', 'pendown': False, 'fillcolor': '',
        'stretchfactor': (1,1), 'speed': 3, 'shearfactor': 0.0}
        >>> p.pen(penstate, fillcolor="green")
        >>> p.pen()
        {'pensize': 10, 'shown': True, 'resizemode': 'auto', 'outline': 1,
        'pencolor': 'red', 'pendown': True, 'fillcolor': 'green',
        'stretchfactor': (1,1), 'speed': 3, 'shearfactor': 0.0}
        )r9rXrWrArYrpra�
stretchfactorrnr9rsrVFrXTrWrYrArprar;rnr9r9rsN)r(r+r)r*r'r,r%r-r.r1r/r��dictr,rr�r�r��_newLiner�r�r�r�r�r0rJ)r�rVZpendictZ_pd�pZ_p_bufr�ZnewLineZsfZscxZscyZshf�sa�car�r�r�rV!	s�/�

























�zTPen.penTcCsdSr"r��r�ZusePosr�r�r�r=�	sz
TPen._newLineFcCsdSr"r�)r�r�Zforcedr�r�r�rJ�	szTPen._updatecCsdSr"r�rr�r�r�r��	szTPen._colorcCsdSr"r�rr�r�r�r��	szTPen._colorstr)N)N)N)N)T)TF)r�r�r�r�r�r�r&rarYrZrXrNrpr9rWrArorKrOrVr=rJr�r�rzryr]rUr=rqrMr�r�r�r�r$�s:�



&.%$



r$c@s eZdZdZdd�Zdd�ZdS)�_TurtleImagez6Helper class: Datatype to store Turtle attributes
    cCs||_d|_|�|�dSr�)r�ry�	_setshape)r�r��
shapeIndexr�r�r�r��	sz_TurtleImage.__init__cs�|j�||_|jdkr*�j|jkr2nndS|jdkrP�j|jkrXnndS|jdkrp��|j�n |jdkr�|jD]}��|�q��j|j|_|jdkr����|_nF|jdkrԈ��jdj�|_n&|jdkr��fdd��j|jD�|_dS)Nr�rt)rtr�r�r/csg|]}����qSr��r:�r{rH�r�r�r�r~�	sz*_TurtleImage._setshape.<locals>.<listcomp>)	r�rDryr�rI�_itemr:rur�)r�rDrHr�rGr�rC�	s(""







�z_TurtleImage._setshapeN)r�r�r�r�r�rCr�r�r�r�rB�	srBc@s�eZdZdZgZdedededfdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dmdd�Zdd�Zdd�Zdd�Zdd�Zdnd d!�Zdod"d#�Zdpd$d%�Zd&d'�Zdqd(d)�Zd*d+�Zdrd,d-�Zd.d/�Zd0d1�Zdsd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z dtd=d>�Z!d?d@�Z"dAdB�Z#dCdD�Z$dudFdG�Z%dHdI�Z&dJdK�Z'dLdM�Z(dvdNdO�Z)dPdQ�Z*dwdTdU�Z+dVdW�Z,dXdY�Z-dZd[�Z.d\d]�Z/d^d_�Z0e0Z1dxd`da�Z2dydcdd�Z3dzdedf�Z4d{dgdh�Z5didj�Z6dkdl�Z7eZ8dS)|r
zvAnimation part of the RawTurtle.
    Puts RawTurtle upon a TurtleScreen and provides tools for
    its animation.
    Nrkr�r�cCs4t|t�r||_n|t|t�r:|tjkr2tj�|�||_nTt|ttf�r�tjD]}|j	|krN||_q�qNt|�|_tj�|j�nt
d|��|j}t�||�
��t�|�|j�|�|��|_t||�|_d|_d|_d|_|_||_d|_|��|_|jg|_|jg|_g|_||_t |�|_!|�"�dS)Nzbad canvas argument %sF)#r��_Screenr�rr
�screensr>rr�r.r�r�r�rr$r�rD�drawingLineItemrBr��_poly�
_creatingPoly�	_fillitem�	_fillpathr(�_hidden_from_screen�currentLineItemr�currentLiner��
stampItems�_undobuffersizer�rrJ)r�Zcanvasrkr�r�r�r�r�r�r��	s@











zRawTurtle.__init__cCs0t�|�t�|�|��|��|��dS)a�Delete the turtle's drawings and restore its default values.

        No argument.

        Delete the turtle's drawings from the screen, re-center the turtle
        and set variables to the default values.

        Example (for a Turtle instance named turtle):
        >>> turtle.position()
        (0.00,-22.00)
        >>> turtle.heading()
        100.0
        >>> turtle.reset()
        >>> turtle.position()
        (0.00,0.00)
        >>> turtle.heading()
        0.0
        N)r�r`r$r&�_clearr�rJr�r�r�r�r`
s


zRawTurtle.resetcCs&|dks|dkrd|_n
t|�|_dS)a�Set or disable undobuffer.

        Argument:
        size -- an integer or None

        If size is an integer an empty undobuffer of given size is installed.
        Size gives the maximum number of turtle-actions that can be undone
        by the undo() function.
        If size is None, no undobuffer is present.

        Example (for a Turtle instance named turtle):
        >>> turtle.setundobuffer(42)
        Nr)rr�)r��sizer�r�r�rh
szRawTurtle.setundobuffercCs|jdkrdS|j��S)z�Return count of entries in the undobuffer.

        No argument.

        Example (for a Turtle instance named turtle):
        >>> while undobufferentries():
        ...     undo()
        Nr)rr�r�r�r�r�rx,
s	
zRawTurtle.undobufferentriescCsld|_|_|jD]}|j�|�q|j��|_g|_|jrJ|j�	|j
�|jg|_|��|�|j
�dS)zDelete all of pen's drawingsN)rNrOr�r�rIrDrQrRr+r>rr7rhrTrGr�r�r�rU9
s

zRawTurtle._clearcCs|��|��dS)agDelete the turtle's drawings from the screen. Do not move turtle.

        No arguments.

        Delete the turtle's drawings from the screen. Do not move turtle.
        State and position of the turtle as well as drawings of other
        turtles are not affected.

        Examples (for a Turtle instance named turtle):
        >>> turtle.clear()
        N)rUrJr�r�r�r�r5G
szRawTurtle.clearcCsF|j��|jjdkrdSt|j�dkrB|j�|j|j|j|j�dSr�)	r�r�r�r�rRrErQr)r'r�r�r�r�r�V
s
�zRawTurtle._update_datacCsx|j}|jdkrdS|jdkrD|��|��|��|�|j�n0|��|jdkrt|��D]}|��q^|��dS)z&Perform a Turtle-data update.
        rNr�)	r�r�r�r�rJrMr�r�r+)r�r�rqr�r�r�rJ^
s



zRawTurtle._updatecCs|j�||�S)amTurns turtle animation on/off and set delay for update drawings.

        Optional arguments:
        n -- nonnegative  integer
        delay -- nonnegative  integer

        If n is given, only each n-th regular screen update is really performed.
        (Can be used to accelerate the drawing of complex graphics.)
        Second arguments sets delay value (see RawTurtle.delay())

        Example (for a Turtle instance named turtle):
        >>> turtle.tracer(8, 25)
        >>> dist = 2
        >>> for i in range(200):
        ...     turtle.fd(dist)
        ...     turtle.rt(90)
        ...     dist += 2
        )r�r*)r��flagrr�r�r�rp
szRawTurtle._tracercCs|j�|�Sr�)r�r�rr�r�r�r��
szRawTurtle._colorcCs|j�|�Sr�)r�r�rr�r�r�r��
szRawTurtle._colorstrc	Cs�t|t�r|Sz|\}}}Wn(ttfk
rDtdt|���YnX|jjdkrldd�|||fD�\}}}d|kr�dkr�nn.d|kr�dkr�nnd|kr�dks�ntdt|���d|||fS)	z,Convert colortriples to hexstrings.
        r�r�cSsg|]}td|��qSr�r�r�r�r�r�r~�
sz!RawTurtle._cc.<locals>.<listcomp>rr�r�r�)r�r�r�r�r�r�r�)r�rr�r�r�r�r�r��_cc�
s
Fz
RawTurtle._cccs�|j�|�|j�|j}d|_d|_t|�}�|_||_�|_t�|jj�|_�j�|��j	|jjj
}|dkr����|j_nJ|dkr���
�j	dj�|j_n*|dkrʇfdd��j	|jjjD�|j_���|_|��|S)aCreate and return a clone of the turtle.

        No argument.

        Create and return a clone of the turtle with same position, heading
        and turtle properties.

        Example (for a Turtle instance named mick):
        mick = Turtle()
        joe = mick.clone()
        Nr�rtr/r�csg|]}����qSr�rErFrGr�r�r~�
sz#RawTurtle.clone.<locals>.<listcomp>)r�r=r+r�rrBrDr�r>r�ryr:rHrur�rDrQrJ)r�r��q�ttyper�rGr�r8�
s.
�

zRawTurtle.clonecCsB|dkr|jjS||j��kr*td|��|j�|�|��dS)a�Set turtle shape to shape with given name / return current shapename.

        Optional argument:
        name -- a string, which is a valid shapename

        Set turtle shape to shape with given name or, if name is not given,
        return name of current shape.
        Shape with name must exist in the TurtleScreen's shape dictionary.
        Initially there are the following polygon shapes:
        'arrow', 'turtle', 'circle', 'square', 'triangle', 'classic'.
        To learn about how to deal with shapes see Screen-method register_shape.

        Example (for a Turtle instance named turtle):
        >>> turtle.shape()
        'arrow'
        >>> turtle.shape("turtle")
        >>> turtle.shape()
        'turtle'
        NzThere is no shape named %s)r�rDr�rr�rCrJ)r�r�r�r�r�rk�
szRawTurtle.shapecCs�||kr|krdkr8nn|j\}}|||jfS|dksH|dkrPtd��|dk	rt|dkrj||f}q�||f}n|dk	r�|jd|f}n|j}|dkr�|j}|jd||d�dS)aOSet/return turtle's stretchfactors/outline. Set resizemode to "user".

        Optional arguments:
           stretch_wid : positive number
           stretch_len : positive number
           outline  : positive number

        Return or set the pen's attributes x/y-stretchfactors and/or outline.
        Set resizemode to "user".
        If and only if resizemode is set to "user", the turtle will be displayed
        stretched according to its stretchfactors:
        stretch_wid is stretchfactor perpendicular to orientation
        stretch_len is stretchfactor in direction of turtles orientation.
        outline determines the width of the shapes's outline.

        Examples (for a Turtle instance named turtle):
        >>> turtle.resizemode("user")
        >>> turtle.shapesize(5, 5, 12)
        >>> turtle.shapesize(outline=8)
        Nrz(stretch_wid/stretch_len must not be zeror3)rar;r9)r-r1r�rV)r�Zstretch_widZstretch_lenr9r;r�r�r�rl�
s$"


�zRawTurtle.shapesizecCs |dkr|jS|jd|d�dS)a�Set or return the current shearfactor.

        Optional argument: shear -- number, tangent of the shear angle

        Shear the turtleshape according to the given shearfactor shear,
        which is the tangent of the shear angle. DO NOT change the
        turtle's heading (direction of movement).
        If shear is not given: return the current shearfactor, i. e. the
        tangent of the shear angle, by which lines parallel to the
        heading of the turtle are sheared.

        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("circle")
        >>> turtle.shapesize(5,2)
        >>> turtle.shearfactor(0.5)
        >>> turtle.shearfactor()
        >>> 0.5
        Nr3)rarn)r.rV)r�Zshearr�r�r�rnszRawTurtle.shearfactorcCs<||j|j}|tjddtj}|jd|d�dS)aIRotate the turtleshape to point in the specified direction

        Argument: angle -- number

        Rotate the turtleshape to point in the direction specified by angle,
        regardless of its current tilt-angle. DO NOT change the turtle's
        heading (direction of movement).


        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("circle")
        >>> turtle.shapesize(5,2)
        >>> turtle.settiltangle(45)
        >>> stamp()
        >>> turtle.fd(50)
        >>> turtle.settiltangle(-45)
        >>> stamp()
        >>> turtle.fd(50)
        r�r�r3)rarsN)r	rr�r�rV�r�r�rsr�r�r�rgszRawTurtle.settiltanglecCs>|dkr0|jdtj|j}||j|jS|�|�dS)a�Set or return the current tilt-angle.

        Optional argument: angle -- number

        Rotate the turtleshape to point in the direction specified by angle,
        regardless of its current tilt-angle. DO NOT change the turtle's
        heading (direction of movement).
        If angle is not given: return the current tilt-angle, i. e. the angle
        between the orientation of the turtleshape and the heading of the
        turtle (its direction of movement).

        Deprecated since Python 3.1

        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("circle")
        >>> turtle.shapesize(5,2)
        >>> turtle.tilt(45)
        >>> turtle.tiltangle()
        Nr�)r/r�r�rr	rrgr[r�r�r�rt4szRawTurtle.tiltanglecCs|�||���dS)a�Rotate the turtleshape by angle.

        Argument:
        angle - a number

        Rotate the turtleshape by angle from its current tilt-angle,
        but do NOT change the turtle's heading (direction of movement).

        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("circle")
        >>> turtle.shapesize(5,2)
        >>> turtle.tilt(30)
        >>> turtle.fd(50)
        >>> turtle.tilt(30)
        >>> turtle.fd(50)
        N)rgrtrr�r�r�rsNszRawTurtle.tiltcCs6||kr(|kr(|kr(dkr2nn|jS|j\}}}}|dk	rL|}|dk	rX|}|dk	rd|}|dk	rp|}||||dkr�td��||||f|_t�||�dtj}	t�|	�t�|	�}
}|||
||||
||
||||
|||f\}}
}}||f|_|
||_|	|_	|j
dd�dS)a�Set or return the current transformation matrix of the turtle shape.

        Optional arguments: t11, t12, t21, t22 -- numbers.

        If none of the matrix elements are given, return the transformation
        matrix.
        Otherwise set the given elements and transform the turtleshape
        according to the matrix consisting of first row t11, t12 and
        second row t21, 22.
        Modify stretchfactor, shearfactor and tiltangle according to the
        given matrix.

        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("square")
        >>> turtle.shapesize(4,2)
        >>> turtle.shearfactor(-0.5)
        >>> turtle.shapetransform()
        (4.0, -1.0, -0.0, 2.0)
        Nrz0Bad shape transform matrix: must not be singularr�r3r4)r0r�r�rr�r�r�r-r.r/rV)r��t11�t12�t21�t22Zm11Zm12Zm21Zm22Zalfar?r@Za11Za12Za21Za22r�r�r�rmas0,�

zRawTurtle.shapetransformcs^|j�|j\��|j\��t���j�j�}dt|�|\�������fdd�|D�S)zlComputes transformed polygon shapes from a shape
        according to current position and heading.
        r�csFg|]>\}}��|�|�j��|�|�jf�qSr�)r4r5�r{r�r��Ze0Ze1Zp0Zp1r�r�r�r~�s�z(RawTurtle._polytrafo.<locals>.<listcomp>)r�rrrr5r4r)r�r��er�rar��
_polytrafo�s

�zRawTurtle._polytrafocCs2|jj|jj}|jdkr.|�|j|jdk�SdS)a@Return the current shape polygon as tuple of coordinate pairs.

        No argument.

        Examples (for a Turtle instance named turtle):
        >>> turtle.shape("square")
        >>> turtle.shapetransform(4, -1, 0, 2)
        >>> turtle.get_shapepoly()
        ((50, -20), (30, 20), (-50, 20), (-30, -20))

        r�r�N)r�r�r�rDry�
_getshapepolyr�)r�rkr�r�r�rG�s
zRawTurtle.get_shapepolyFcsx|jdks|r|j\����n>|jdkrNtd|jd�}|dd|f\����n|jdkr\|St����fdd�|D��S)	z`Calculate transformed shape polygon according to resizemode
        and shapetransform.
        r3r2r�g@rr�c3s2|]*\}}�|�|�|�|fVqdSr�r�r`�r\r]r^r_r�r�r��sz*RawTurtle._getshapepoly.<locals>.<genexpr>)r%r0�maxr'r�)r�r�r�r!r�rer�rd�s

zRawTurtle._getshapepolyc	Cs�|j}|j|jj}|j}|jj}|j�r*|jdk�r*|jdk�r*d|_	|j
}|dkr�|jdkrfd}n|jdkrx|j}n|j
}|�|�|��}|j|j}}|j|||||dd�nt|d	kr�|�||j|�nZ|d
k�r�t||�D]D\}	\}
}}|�|�|
d��}
|j|	|
|�|�|�|�|j
dd�q�nx|j	�r6dS|dk�rR|�|dd
d
�nJ|d	k�rv|�||j|jdj
�n&|d
k�r�|D]}	|�|	dd
d
��q�d|_	dS)zpManages the correct rendering of the turtle with respect to
        its shape, resizemode, stretch and tilt etc.rFr�r�r�r2T�r"r9rzrArtr�N�r�r�r�r�r/)r�r�r�rDryrHr(r�r�rPr�r%r'r1rcrdr*r)rCrwr�ziprX)r�r�rkrZZtitem�tshaper6�fc�ocrHr�r�r�r�r��sR 

�
�




�
zRawTurtle._drawturtlec	CsT|j}|j|jj}|j}|j}|dkr�|��}|jdkr@d}n|jdkrR|j}n|j	}|�
|�|��}|j|j
}}|j|||||dd�n�|dkr�|�d�}|�||j|�n�|d	k�r4g}|D]}	|��}
|�|
�q�t|�}t||�D]D\}
\}}}|�
|�|d��}|j|
||�|�|�|�|j	dd�q�|j�|�|j�d
|f�|S)a�Stamp a copy of the turtleshape onto the canvas and return its id.

        No argument.

        Stamp a copy of the turtle shape onto the canvas at the current
        turtle position. Return a stamp_id for that stamp, which can be
        used to delete it by calling clearstamp(stamp_id).

        Example (for a Turtle instance named turtle):
        >>> turtle.color("blue")
        >>> turtle.stamp()
        13
        >>> turtle.fd(50)
        r�r�r�r2Trgrtr�r�rr)r�r�r�rDryr�r:r%r'r1rcrdr*r)rCrurwrr>r�rirXrSrr�)r�r�rkrZrj�stitemr6rkrlZelementrHr�r�r�r�rr�sH

�

�zRawTurtle.stampcCs�||jkrDt|t�r,|D]}|j�|�qn|j�|�|j�|�d|f}|j}||jkr`dS|j�|�}|j�|�||j	kr�|j	d|j
|_	|j�|j	d|j
dg�dS)z9does the work for clearstamp() and clearstamps()
        rrNr�)rSr�r�r�rIr�rr��indexr�r��insert)r��stampidZsubitemrHZbufrnr�r�r��_clearstamps



zRawTurtle._clearstampcCs|�|�|��dS)aDDelete stamp with given stampid

        Argument:
        stampid - an integer, must be return value of previous stamp() call.

        Example (for a Turtle instance named turtle):
        >>> turtle.color("blue")
        >>> astamp = turtle.stamp()
        >>> turtle.fd(50)
        >>> turtle.clearstamp(astamp)
        N)rqrJ)r�rpr�r�r�r6s
zRawTurtle.clearstampcCs^|dkr|jdd�}n&|dkr0|jd|�}n|j|d�}|D]}|�|�qB|��dS)a�Delete all or first/last n of turtle's stamps.

        Optional argument:
        n -- an integer

        If n is None, delete all of pen's stamps,
        else if n > 0 delete first n stamps
        else if n < 0 delete last n stamps.

        Example (for a Turtle instance named turtle):
        >>> for i in range(8):
        ...     turtle.stamp(); turtle.fd(30)
        ...
        >>> turtle.clearstamps(2)
        >>> turtle.clearstamps(-2)
        >>> turtle.clearstamps()
        Nr)rSrqrJ)r�r�ZtoDeleterHr�r�r�r7-szRawTurtle.clearstampsc
Cs�|j|j|jt|jt�f}|j}d|j|||j|j	dd�|�
|j�|jdd�ff}|jrh|j�
|�|j}|j�rZ|jdk�rZ||}|d|jd|d|jd}dt|ddd|j|j�}|d	|}	td|�D]R}
|
dkr�d
}nd}||	|
|_|j�r2|�|j||jf|j|j|�|��q�|j�rZ|j|jdd
|jd�|j�rn|j	�|�t|jt��r�|j�|�||_|j�r�|j�|�t|j	�dk�r�|��|��dS)z�Move the pen to the point end, thereby drawing a line
        if pen is down. All other methods for turtle movement depend
        on this one.
        �goNr�rr�r�r�皙�����?r�TF�r�r�r��r"rz�*)r+r)r'r�rOr�r�rrQrRr�r�rr�r,r�r4r5r�rrErKrJr>rMrLr�r=)r�r�go_modesr�Z
undo_entry�start�diff�diffsq�nhops�deltar�rAr�r�r�r
Isb
�

��$$�

�zRawTurtle._gotocs|\}}}}|\}}}}	|\}
}}�|j�t|j|�dkrDtd�|
|_||_|ddgkrbd}
n|}
�j|
||
|d���fdd�|jD�}|D]}��|�|j�	|�q�|}|j
�r��jdk�r�||}|d	�jd
|d�j
d
}dt|ddd|j
|j
�}|d
|}td|�D]P}|dk�r@d}nd}||||_|�rr��|j||jf|||�|���q,|�r��j|jdd|d�||_|j�r�t|j�d	k�r�|j��|jgk�r�d|_d|_|	�r|jgk�r�d|_td�n|jdk	�r|j��|��dS)z)Reverse a _goto. Used for undo()
        r�z$undogoto: HALLO-DA-STIMMT-WAS-NICHT!r�r�rucs&g|]}|�kr��|�dkr|�qS)r�)ryrz�r�r�r�r�r~�s�z'RawTurtle._undogoto.<locals>.<listcomp>r�rr�r�rsr�TFrtNzUnwahrscheinlich in _undogoto!)r�rrr�rQrRrEr�rIr�r,r�r4r5r�rrKrJrMr�rLr�rO)r��entry�old�newrwZcoodataZdrawingZpcZpsrBZcLIZcLr�ZusepcZtodeleter|rxryrzr{r|r�rAr�r}r��	_undogoto~sl
$$
�
�


zRawTurtle._undogotocCs�|jr|j�d||jf�||j9}|j�|�}|jj}|dkr�|jdkr�d|j}dtt	|�|�}d||}t
|�D]}|j�|�|_|��q|||_|��dS)z&Turns pen clockwise by angle.
        �rotr�rg@r�N)rr�r	rr�r�r�r,r�rrrJ)r�r�Z	neworientr�Zanglevelr r|r�r�r�r�r�s


zRawTurtle._rotateTcCsnt|j�dkrD|j�|j|j|j|j�|j��|_|j�	|j�n|jj|jdd�g|_|rj|j
g|_dS)z�Closes current line item and starts a new one.
           Remark: if current line became too long, animation
           performance (via _drawline) slowed down considerably.
        r�T)rAN)r�rRr�rErQr)r'rDr�r>rrAr�r�r�r=�s�zRawTurtle._newLinecCst|jt�S)aReturn fillstate (True if filling, False else).

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.begin_fill()
        >>> if turtle.filling():
        ...     turtle.pensize(5)
        ... else:
        ...     turtle.pensize(3)
        )r�rOr�r�r�r�r�rB�szRawTurtle.fillingcCsX|��s"|j��|_|j�|j�|jg|_|��|j	rL|j	�
d|jf�|��dS)aCalled just before drawing a shape to be filled.

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.color("black", "red")
        >>> turtle.begin_fill()
        >>> turtle.circle(60)
        >>> turtle.end_fill()
        �	beginfillN)rBr�r:rNr�r>rrOr=rr�rJr�r�r�r�r1�s
zRawTurtle.begin_fillcCs^|��rZt|j�dkrF|jj|j|j|jd�|jrF|j�d|jf�d|_|_|�	�dS)aFill the shape drawn after the call begin_fill().

        No argument.

        Example (for a Turtle instance named turtle):
        >>> turtle.color("black", "red")
        >>> turtle.begin_fill()
        >>> turtle.circle(60)
        >>> turtle.end_fill()
        r�r;�dofillN)
rBr�rOr�rCrNr*rr�rJr�r�r�r�r>
s�zRawTurtle.end_fillc	Gs8|sNt|ttf�r0|�|�}|jt|jd�}qr|j}|sr|jt|jd�}n$|dkrh|jt|jd�}|�|�}t|jd�r�|j�	|j
||�}|j�|�|j
r�|j
�d|f�n�|��}|j
r�|j
�dg�d|j
_z>|��dkr�|��|��|�|�|�|�|�d�W5|�|�X|j
�r4d	|j
_dS)
a�Draw a dot with diameter size, using color.

        Optional arguments:
        size -- an integer >= 1 (if given)
        color -- a colorstring or a numeric color tuple

        Draw a circular dot with diameter size, using color.
        If size is not given, the maximum of pensize+4 and 2*pensize is used.

        Example (for a Turtle instance named turtle):
        >>> turtle.dot()
        >>> turtle.fd(50); turtle.dot(20, "blue"); turtle.fd(50)
        r�N�_dotr<rTr2rF)r�r�r�r�r'rfr)�hasattrr�r�rr�r>rr�rVr�rarMrXrYrWrC)r�rVr9rHrVr�r�r�r<
s:



z
RawTurtle.dotcCsB|j�|j||||j�\}}|j�|�|jr>|j�d|f�|S)z)Performs the writing for write()
        �wri)r�rXrr)r�r>rr�)r�rVrWrUrHrr�r�r�rXH
s�zRawTurtle._writerP��Arialr�r7cCs`|jr|j�dg�d|j_|�t|�|��|�}|rN|��\}}|�||�|jr\d|j_dS)a�Write text at the current turtle position.

        Arguments:
        arg -- info, which is to be written to the TurtleScreen
        move (optional) -- True/False
        align (optional) -- one of the strings "left", "center" or right"
        font (optional) -- a triple (fontname, fontsize, fonttype)

        Write text - the string representation of arg - at the current
        turtle position according to align ("left", "center" or right")
        and with the given font.
        If move is True, the pen is moved to the bottom-right corner
        of the text. By default, move is False.

        Example (for a Turtle instance named turtle):
        >>> turtle.write('Home = ', True, align="center")
        >>> turtle.write((0,0), True)
        rTFN)rr�r�rXr�r�r[re)r��argZmoverWrUrr�r�r�r�r�r{R
szRawTurtle.writecCs|jg|_d|_dS)aStart recording the vertices of a polygon.

        No argument.

        Start recording the vertices of a polygon. Current turtle position
        is first point of polygon.

        Example (for a Turtle instance named turtle):
        >>> turtle.begin_poly()
        TN)rrLrMr�r�r�r�r2o
s
zRawTurtle.begin_polycCs
d|_dS)a7Stop recording the vertices of a polygon.

        No argument.

        Stop recording the vertices of a polygon. Current turtle position is
        last point of polygon. This will be connected with the first point.

        Example (for a Turtle instance named turtle):
        >>> turtle.end_poly()
        FN)rMr�r�r�r�r?}
szRawTurtle.end_polycCs|jdk	rt|j�SdS)z�Return the lastly recorded polygon.

        No argument.

        Example (for a Turtle instance named turtle):
        >>> p = turtle.get_poly()
        >>> turtle.register_shape("myFavouriteShape", p)
        N)rLr�r�r�r�r�rD�
s

zRawTurtle.get_polycCs|jS)a�Return the TurtleScreen object, the turtle is drawing  on.

        No argument.

        Return the TurtleScreen object, the turtle is drawing  on.
        So TurtleScreen-methods can be called for that object.

        Example (for a Turtle instance named turtle):
        >>> ts = turtle.getscreen()
        >>> ts
        <turtle.TurtleScreen object at 0x0106B770>
        >>> ts.bgcolor("pink")
        rGr�r�r�r�rF�
szRawTurtle.getscreencCs|S)aUReturn the Turtleobject itself.

        No argument.

        Only reasonable use: as a function to return the 'anonymous turtle':

        Example:
        >>> pet = getturtle()
        >>> pet.fd(50)
        >>> pet
        <turtle.Turtle object at 0x0187D810>
        >>> turtles()
        [<turtle.Turtle object at 0x0187D810>]
        r�r�r�r�r�rH�
szRawTurtle.getturtlecCs|j�|�S)zDSet delay value which determines speed of turtle animation.
        )r�rrLr�r�r�rM�
szRawTurtle._delayr�cCs"|j�|jj|||�|��dS)a�Bind fun to mouse-click event on this turtle on canvas.

        Arguments:
        fun --  a function with two arguments, to which will be assigned
                the coordinates of the clicked point on the canvas.
        btn --  number of the mouse-button defaults to 1 (left mouse button).
        add --  True or False. If True, new binding will be added, otherwise
                it will replace a former binding.

        Example for the anonymous turtle, i. e. the procedural way:

        >>> def turn(x, y):
        ...     left(360)
        ...
        >>> onclick(turn)  # Now clicking into the turtle will turn it.
        >>> onclick(None)  # event-binding will be removed
        N)r�rer�rHrJr�r�r�r�rR�
szRawTurtle.onclickcCs"|j�|jj|||�|��dS)a�Bind fun to mouse-button-release event on this turtle on canvas.

        Arguments:
        fun -- a function with two arguments, to which will be assigned
                the coordinates of the clicked point on the canvas.
        btn --  number of the mouse-button defaults to 1 (left mouse button).

        Example (for a MyTurtle instance named joe):
        >>> class MyTurtle(Turtle):
        ...     def glow(self,x,y):
        ...             self.fillcolor("red")
        ...     def unglow(self,x,y):
        ...             self.fillcolor("")
        ...
        >>> joe = MyTurtle()
        >>> joe.onclick(joe.glow)
        >>> joe.onrelease(joe.unglow)

        Clicking on joe turns fillcolor red, unclicking turns it to
        transparent.
        N)r�rfr�rHrJr�r�r�r�rT�
szRawTurtle.onreleasecCs|j�|jj|||�dS)a�Bind fun to mouse-move event on this turtle on canvas.

        Arguments:
        fun -- a function with two arguments, to which will be assigned
               the coordinates of the clicked point on the canvas.
        btn -- number of the mouse-button defaults to 1 (left mouse button).

        Every sequence of mouse-move-events on a turtle is preceded by a
        mouse-click event on that turtle.

        Example (for a Turtle instance named turtle):
        >>> turtle.ondrag(turtle.goto)

        Subsequently clicking and dragging a Turtle will move it
        across the screen thereby producing handdrawings (if pen is
        down).
        N)r�rgr�rHr�r�r�r�rS�
szRawTurtle.ondragcCs,|jdkrdS|dkr@|\}}|�|||j�|j��}n�|dkr\|d}|�|�n�|dkrp|�|�n�|dkr�|d}|j�|�|j�	|�n�|dkr�|d}|jj
|dd	d	d
�nh|dk�r|d}d|_|_||jk�r(|j�|�|j�	|�n$|dk�r(t
�||d�|j��dS)
z2Does the main part of the work for undo()
        Nr�rrrrr)r�r<r�rhr�r8r�rV)rrr	r�r6r�r�rIr�r�rCrNrOr$rV)r��actionr�r�ZdegPAUZdummyrmrHr�r�r��_undos<

�

zRawTurtle._undocCsl|jdkrdS|j��}|d}|dd�}|dkr\|rh|��}|�|d|dd��q4n|�||�dS)a�undo (repeatedly) the last turtle action.

        No argument.

        undo (repeatedly) the last turtle action.
        Number of available undo actions is determined by the size of
        the undobuffer.

        Example (for a Turtle instance named turtle):
        >>> for i in range(4):
        ...     turtle.fd(50); turtle.lt(80)
        ...
        >>> for i in range(8):
        ...     turtle.undo()
        ...
        Nrr�r)rr�r�)r�rHr�r�r�r�r�rw's

zRawTurtle.undo)NN)N)NNN)N)N)NNNN)F)N)T)N)FrPr�)N)r�N)r�N)r�N)9r�r�r�r�rJr�r�r`rhrxrUr5r�rJrr�r�rXr8rkrlrnrgrtrsrmrcrGrdr�rrrqr6r7r
r�rr=rBr1r>r<rXr{r2r?rDrFrHrErMrRrTrSr�rwrvr�r�r�r�r
�	sr�
(

(

(


(

(-
5A

0







 cCstjdkrt�t_tjS)z�Return the singleton screen object.
    If none exists at the moment, create a new one and return it,
    else return the existing one.N)r�_screenrIr�r�r�r�r	Js
c@sfeZdZdZdZedZdd�Zededededfd	d
�Zdd�Z	d
d�Z
dd�Zdd�ZdS)rINr)cCs�tjdkr4t�t_|_|j�tj�|j�|j�tjdkr�td}td}td}td}td}td}|j�	||||�|j�
�t_t�|tj�|�
||||�dS)Nrzr�r�r�r�r�)rI�_rootrr)�_titler)�_destroyrr�r#r$rr�r&)r�rzr�r�r�r�r�r�r�r�r�Xs

z_Screen.__init__rzr�r�r�cCs�t|jd�sdS|j��}|j��}t|t�rNd|krBdkrNnn||}|dkrb||d}t|t�r�d|kr�dkr�nn||}|dkr�||d}|j�||||�|��dS)a Set the size and position of the main window.

        Arguments:
        width: as integer a size in pixels, as float a fraction of the screen.
          Default is 50% of screen.
        height: as integer the height in pixels, as float a fraction of the
          screen. Default is 75% of screen.
        startx: if positive, starting position in pixels from the left
          edge of the screen, if negative from the right edge
          Default, startx=None is to center window horizontally.
        starty: if positive, starting position in pixels from the top
          edge of the screen, if negative from the bottom edge
          Default, starty=None is to center window vertically.

        Examples (for a Screen instance named screen):
        >>> screen.setup (width=200, height=200, startx=0, starty=0)

        sets window to 200x200 pixels, in upper left of screen

        >>> screen.setup(width=.75, height=0.5, startx=None, starty=None)

        sets window to 75% of screen by 50% of screen and centers
        r'Nrr�r�)r�r�r*r+r�r�r'r,)r�rzr�r%r&rQZshr�r�r�r&ns

""z
_Screen.setupcCs tjdk	rtj�|�|t_dS)aqSet title of turtle-window

        Argument:
        titlestring -- a string, to appear in the titlebar of the
                       turtle graphics window.

        This is a method of Screen-class. Not available for TurtleScreen-
        objects.

        Example (for a Screen instance named screen):
        >>> screen.title("Welcome to the turtle-zoo!")
        N)rIr�r)r�)r�Ztitlestringr�r�r�r)�s
z
_Screen.titlecCs:|j}|tjkr(dt_dt_dt_dt_dt_|��dS)NF)	r�rIrr�r�rrr�r()r��rootr�r�r�r��s
z_Screen._destroycCs|��dS)z~Shut the turtlegraphics window.

        Example (for a TurtleScreen instance named screen):
        >>> screen.bye()
        N)r�r�r�r�r�r�sz_Screen.byecsN�fdd�}��|�tdr"dSz
t�Wntk
rHtd�YnXdS)alGo into mainloop until the mouse is clicked.

        No arguments.

        Bind bye() method to mouseclick on TurtleScreen.
        If "using_IDLE" - value in configuration dictionary is False
        (default value), enter mainloop.
        If IDLE with -n switch (no subprocess) is used, this value should be
        set to True in turtle.cfg. In this case IDLE's mainloop
        is active also for the client script.

        This is a method of the Screen-class and not available for
        TurtleScreen instances.

        Example (for a Screen instance named screen):
        >>> screen.exitonclick()

        cs���dS)z&Screen.bye() with two dummy-parametersN)r)r�r�r�r�r��exitGracefully�sz+_Screen.exitonclick.<locals>.exitGracefullyr�Nr)rRr�r�AttributeError�exit)r�r�r�r�r�r�s

z_Screen.exitonclick)
r�r�r�r�rr�r�r�r&r)r�rrr�r�r�r�rIRs�
(
rIc@s4eZdZdZdZdZedededfdd�ZdS)rz�RawTurtle auto-creating (scrolled) canvas.

    When a Turtle object is created or a function derived from some
    Turtle method is called a TurtleScreen object is automatically created.
    Nrkr�r�cCs,tjdkrt�t_tj|tj|||d�dS)N)rkr�r�)rr�r	r
r�)r�rkr�r�r�r�r�r��s

�zTurtle.__init__)r�r�r�r�r�r�r�r�r�r�r�r�r�s��turtle_docstringdictc	Cs�i}tD]}d|}t|�j||<qtD]}d|}t|�j||<q(td|d���}tdd�|D��}|�d�|dd	�D](}|�d
t|��|�d||�q||d	}|�d
t|��|�d||�|�d
�|��W5QRXdS)a�Create and write docstring-dictionary to file.

    Optional argument:
    filename -- a string, used as filename
                default value is turtle_docstringdict

    Has to be called explicitly, (not used by the turtle-graphics classes)
    The docstring dictionary will be written to the Python script <filname>.py
    It is intended to serve as a template for translation of the docstrings
    into different languages.
    z_Screen.zTurtle.z%s.pyr6css$|]}|�d�dtkr|VqdS)r�r�N)r�_alias_listr�r�r�r�r�s�z&write_docstringdict.<locals>.<genexpr>zdocsdict = {

Nr�z%s :
z        """%s
""",

z        """%s
"""

z}
)	�_tg_screen_functionsr�r��_tg_turtle_functionsr�r�r{�repr�close)r��docsdict�
methodnamer�r�r�r�r�r�r~�s$

c	Cs`dd|��i}t|�}|j}|D]8}z||t|�_Wq"tk
rXtd|�Yq"Xq"dS)z�Read in docstrings from lang-specific docstring dictionary.

    Transfer docstrings, translated to lang, from a dictionary-file
    to the methods of classes Screen and Turtle and - in revised form -
    to the corresponding functions.
    z!turtle_docstringdict_%(language)sr�zBad docstring-entry: %sN)r��
__import__r�r�r�r�r�)Zlang�modname�moduler�r�r�r�r��read_docstringssr�r�zCannot find docsdict forz;Unknown Error when trying to import %s-docstring-dictionaryc
Cs�d}}t�|j�\}}}|dd�}|dd�}|jp:g}dd�|D�}dgt|�t|�|}dd�t||�D�}	|dk	r�|	�d|�|�d|�|dk	r�|	�d|�|�d|�d	�|	�}d
|}d	�|�}d
|}||fS)a?Get strings describing the arguments for the given object

    Returns a pair of strings representing function parameter lists
    including parenthesis.  The first string is suitable for use in
    function definition and the second is suitable for use in function
    call.  The "self" parameter is not included.
    r�r�NcSsg|]}d|f�qS)z=%rr�)r{r�r�r�r�r~<sz"getmethparlist.<locals>.<listcomp>cSsg|]\}}||�qSr�r�)r{r�Zdfltr�r�r�r~>s�*z**z, z(%s))�inspectZgetargs�__code__�__defaults__r�rir>r)
ZobZdefTextZcallTextrZvarargsZvarkwZitems2ZrealArgs�defaultsZitems1r�r�r��getmethparlist,s&


r�cCsJddl}|dkrdStd}|�d|d�}|�d|�}|�d|�}|S)z<To reduce docstrings from RawTurtle class for functions
    rNr��%s.r�� \(.+ %s\):�:��rer��replace�compile�sub)�docstrr�Z
turtlename�	newdocstr�parexpr�r�r��_turtle_docreviseKsr�cCsJddl}|dkrdStd}|�d|d�}|�d|�}|�d|�}|S)z?To reduce docstrings from TurtleScreen class for functions
    rNr�r�r�r�r�r�)r�r�Z
screennamer�r�r�r�r��_screen_docreviseWsr�ardef {name}{paramslist}:
    if {obj} is None:
        if not TurtleScreen._RUNNING:
            TurtleScreen._RUNNING = True
            raise Terminator
        {obj} = {init}
    try:
        return {obj}.{name}{argslist}
    except TK.TclError:
        if not TurtleScreen._RUNNING:
            TurtleScreen._RUNNING = True
            raise Terminator
        raise
c
Csl|D]b}t||�}t|�\}}|dkr4td||�qtj|||||d�}	t|	t��||j�t�|_qdS)Nr�z>>>>>>)�obj�initr�Z
paramslistZargslist)�getattrr�r��__func_body�formatr��globalsr�)
Z	functionsr�r�r�Z	docreviser�r�Zpl1Zpl2Zdefstrr�r�r��_make_global_funcsws

�r�zTurtle._screenzScreen()zTurtle._penzTurtle()�__main__cCst�rt�nt�dSr�)rNr]rUr�r�r�r��	switchpen�sr�cCslt�td�t�td�t�td�td�D]Z}|dkrDt�td�D]}td�t	d�qL|dkrxt
d�t�t�td	�t�q2td
�t
d�td�t�td�td�td�td�td
�t�t
dd
�t
dd
�t
d�td�D]$}td�t	d�td�td�q�td�t�td�D]&}td�t	d�td�td��q:t�dS)zDemo of old turtle.py - moduleT�dr�r�r�r��ZZmaroonr	r�r�F�Z
startstartrx�redr�N)r`r*ryr0r=rzrr1rCrPr9r>r_r{)r|r�r�r�r��demo1�sX



r�cCsBtd�t�td�ttdd��tdd�d}td�td�D]}t�t	|d�qBt
d�t�rnt�q`t
�td�td	�d}td
�td�td�tdd
�D]p}|dkr�t�td	d|dd|�td�D]}t|�td�q�t�|d7}td�tt�dd�q�td�t�td�td�t�tdd�td�t�td�D](}t	dd�td�td�td��q`t�td�t�td�t�td�t�}|�d�t�}|�d�|�d�|�
�|�d�|�d�|��|�dd�|�d�|��|�d�|�dd�|�d�|�d�tt|��d}|�|�dk�r�|�d�|�d �|�|�|��|�d�|d!dk�r�|� �|� �t�|d7}�qZ|j
d"d#d$d%�|�d&�|�d�d'd(�}t!�"d�t��r|��|���q�|�d�|j
d)d*d+�|�#|d�d,S)-zDemo of some new features.r�r�rrr��r�zwait a moment...r�Zgreenr�r�r���x��Fr	r�Zyellowr��2r�r2i�(r�ZblueZoranger�g@g333333�?r�zCAUGHT! )r�r��boldr_)rUrWr�cSst�t�dSr�)rr)r�r�r�r�r��babaszdemo2.<locals>.babaz  Click me!)ZCourierr�r�)rUN)$rprqrYrdrur;rbrr�r4r{rxrwr`rQrrWr1rAr@r>r]rUr9rkrHrarrPryrIr=rr�time�sleeprR)rr�Zlaenger|Ztrir�r�r�r�r�r��demo2�s�


















r�)r�)r�)Fr�Z_verZtkinterr�r�r�r�r�r�Zos.pathrrr�copyrrZ_tg_classesr�r�Z
_tg_utilities�__all__r�r�r�r�r�r�r�rr�r�r�r�r�rr�r r�objectr,r�r�rr�rr�r$rBr
rr	rIrr
r~r�Z	_LANGUAGE�ImportErrorr�r�r�r�r�rrr�r�r�r�rr�r�r�r��<module>s�N��
�

����5
�
c	/&/O}
"
���
5c__pycache__/poplib.cpython-38.opt-2.pyc000064400000020522151153537570013646 0ustar00U

e5d�:�@shddlZddlZddlZddlZzddlZdZWnek
rHdZYnXddgZGdd�de�Z	dZ
dZd	Zd
Z
ee
ZdZGdd�d�Zer�Gd
d�de�Ze�d�edk�rdddlZeejd�Zee���e�ejd�e�ejd�e��e��\ZZeded�D]BZe� e�\Z!Z"Z#ede�e"D]Z$ede$��q<ed��qe�%�dS)�NTF�POP3�error_protoc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/poplib.pyrs�ni��
�
ic@seZdZdZeejfdd�Zdd�Zdd�Z	dd	�Z
d
d�Zdd
�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd<dd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Ze�d/�Zd0d1�Z d2d3�Z!d=d4d5�Z"d6d7�Z#d8d9�Z$d>d:d;�Z%dS)?rzUTF-8cCsP||_||_d|_t�d|||�|�|�|_|j�d�|_d|_	|�
�|_dS)NFzpoplib.connect�rbr)�host�port�_tls_established�sys�audit�_create_socket�sock�makefile�file�
_debugging�_getresp�welcome)�selfr
r�timeoutrrr�__init__bsz
POP3.__init__cCst�|j|jf|�S�N)�socketZcreate_connectionr
r)rrrrrrmszPOP3._create_socketcCs:|jdkrtdt|��t�d||�|j�|t�dS)N�z*put*zpoplib.putline)r�print�reprrrrZsendall�CRLF�r�linerrr�_putlineps
z
POP3._putlinecCs.|jrtdt|��t||j�}|�|�dS)Nz*cmd*)rrr �bytes�encodingr$r"rrr�_putcmdxszPOP3._putcmdcCs�|j�td�}t|�tkr$td��|jdkr<tdt|��|sHtd��t|�}|dd�tkrp|dd�|fS|dd�t	kr�|dd�|fS|dd�|fS)Nrz
line too longz*get*z-ERR EOF������)
r�readline�_MAXLINE�lenrrrr r!�CR)rr#�octetsrrr�_getline�s
z
POP3._getlinecCs:|��\}}|jdkr$tdt|��|�d�s6t|��|S)Nrz*resp*�+)r/rrr �
startswithr)r�resp�orrrr�s

z
POP3._getrespcCsl|��}g}d}|��\}}|dkrb|�d�rB|d}|dd�}||}|�|�|��\}}q|||fS)Nr�.s..r)rr/r1�append)rr2�listr.r#r3rrr�_getlongresp�s

zPOP3._getlongrespcCs|�|�|��Sr)r'rr"rrr�	_shortcmd�s
zPOP3._shortcmdcCs|�|�|��Sr)r'r7r"rrr�_longcmd�s
z
POP3._longcmdcCs|jSr)r�rrrr�
getwelcome�szPOP3.getwelcomecCs
||_dSr)r)r�levelrrr�set_debuglevel�szPOP3.set_debuglevelcCs|�d|�S)NzUSER %s�r8�r�userrrrr@�sz	POP3.usercCs|�d|�S)NzPASS %sr>)rZpswdrrr�pass_�sz
POP3.pass_cCsF|�d�}|��}|jr&tdt|��t|d�}t|d�}||fS)NZSTATz*stat*r�)r8�splitrrr �int)rZretvalZretsZnumMessagesZsizeMessagesrrr�stat�s
z	POP3.statNcCs |dk	r|�d|�S|�d�S)NzLIST %sZLIST�r8r9�r�whichrrrr6�s	z	POP3.listcCs|�d|�S)NzRETR %s�r9rGrrr�retr�sz	POP3.retrcCs|�d|�S)NzDELE %sr>rGrrr�dele�sz	POP3.delecCs
|�d�S)NZNOOPr>r:rrr�noopsz	POP3.noopcCs
|�d�S)NZRSETr>r:rrr�rsetsz	POP3.rsetcCs|�d�}|��|S)NZQUIT)r8�close)rr2rrr�quits
z	POP3.quitcCs�z |j	}d|_	|dk	r|��W5|j}d|_|dk	r�zVz|�tj�Wn@tk
r�}z"|jtjkrxt|dd�dkrx�W5d}~XYnXW5|��XXdS)NZwinerrorri&')
rrNZshutdownrZ	SHUT_RDWR�OSError�errnoZENOTCONN�getattrr)rr�excrrrrrNs �z
POP3.closecCs|�d|�S)NzRPOP %sr>r?rrr�rpop5sz	POP3.rpops\+OK.[^<]*(<.*>)cCs\t||j�}|j�|j�}|s&td��ddl}|�d�|}|�|��	�}|�
d||f�S)Nz!-ERR APOP not supported by serverrrz
APOP %s %s)r%r&�	timestamp�matchrr�hashlib�groupZmd5Z	hexdigestr8)rr@ZpasswordZsecret�mrWZdigestrrr�apop<sz	POP3.apopcCs|�d||f�S)Nz	TOP %s %srI)rrHZhowmuchrrr�topQszPOP3.topcCs |dk	r|�d|�S|�d�S)NzUIDL %sZUIDLrFrGrrr�uidlZsz	POP3.uidlcCs
|�d�S)NZUTF8r>r:rrr�utf8fsz	POP3.utf8c	
Cspdd�}i}z4|�d�}|d}|D]}||�\}}|||<q$Wn*tk
rj}ztd��W5d}~XYnX|S)NcSs"|�d���}|d|dd�fS)N�asciirr)�decoderC)r#Zlstrrr�	_parsecapyszPOP3.capa.<locals>._parsecapZCAPArz!-ERR CAPA not supported by server)r9r)	rr`�capsr2ZrawcapsZcaplineZcapnmZcapargsZ_errrrr�capals

z	POP3.capacCsxtstd��|jrtd��|��}d|kr2td��|dkrBt��}|�d�}|j|j|j	d�|_|j�
d�|_d|_|S)Nz-ERR TLS support missing�$-ERR TLS session already establishedZSTLSz!-ERR STLS not supported by server�Zserver_hostnamerT)�HAVE_SSLrrrb�ssl�_create_stdlib_contextr8�wrap_socketrr
rr)r�contextrar2rrr�stls�s 
�z	POP3.stls)N)N)N)&rrrr&�	POP3_PORTr�_GLOBAL_DEFAULT_TIMEOUTrrr$r'r/rr7r8r9r;r=r@rArEr6rJrKrLrMrOrNrT�re�compilerUrZr[r\r]rbrjrrrrr3s@-�





	
c@s4eZdZeddejdfdd�Zdd�Zddd�ZdS)	�POP3_SSLNcCs�|dk	r|dk	rtd��|dk	r0|dk	r0td��|dk	s@|dk	rVddl}|�dtd�||_||_|dkrxtj||d�}||_t	�
||||�dS)Nz4context and keyfile arguments are mutually exclusivez5context and certfile arguments are mutually exclusiverzAkeyfile and certfile are deprecated, use a custom context insteadrB)�certfile�keyfile)�
ValueError�warnings�warn�DeprecationWarningrqrprfrgrirr)rr
rrqrprrirsrrrr�s$��zPOP3_SSL.__init__cCs"t�||�}|jj||jd�}|S)Nrd)rrrirhr
)rrrrrrr�s
�zPOP3_SSL._create_socketcCstd��dS)Nrc)r)rrqrprirrrrj�sz
POP3_SSL.stls)NNN)	rrr�
POP3_SSL_PORTrrlrrrjrrrrro�s�
ro�__main__rrB�zMessage %d:z   z-----------------------)&rQrmrrrfre�ImportError�__all__�	Exceptionrrkrvr-ZLFr!r+rror5r�argv�arr;r@rAr6rEZnumMsgsZ	totalSize�range�irJ�header�msgr.r#rOrrrr�<module>sJ
n0

__pycache__/codeop.cpython-38.pyc000064400000014423151153537570012675 0ustar00U

e5d��@sldZddlZddlZdd�ejD�ZdddgZdZd	d
�Zdd�Zddd�Z	Gdd�d�Z
Gdd�d�ZdS)a[Utilities to compile possibly incomplete Python source code.

This module provides two interfaces, broadly similar to the builtin
function compile(), which take program text, a filename and a 'mode'
and:

- Return code object if the command is complete and valid
- Return None if the command is incomplete
- Raise SyntaxError, ValueError or OverflowError if the command is a
  syntax error (OverflowError and ValueError can be produced by
  malformed literals).

Approach:

First, check if the source consists entirely of blank lines and
comments; if so, replace it with 'pass', because the built-in
parser doesn't always do the right thing for these.

Compile three times: as is, with \n, and with \n\n appended.  If it
compiles as is, it's complete.  If it compiles with one \n appended,
we expect more.  If it doesn't compile either way, we compare the
error we get when compiling with \n or \n\n appended.  If the errors
are the same, the code is broken.  But if the errors are different, we
expect more.  Not intuitive; not even guaranteed to hold in future
releases; but this matches the compiler's behavior from Python 1.4
through 2.2, at least.

Caveat:

It is possible (but not likely) that the parser stops parsing with a
successful outcome before reaching the end of the source; in this
case, trailing symbols may be ignored instead of causing an error.
For example, a backslash followed by two newlines may be followed by
arbitrary garbage.  This will be fixed once the API for the parser is
better.

The two interfaces are:

compile_command(source, filename, symbol):

    Compiles a single command in the manner described above.

CommandCompiler():

    Instances of this class have __call__ methods identical in
    signature to compile_command; the difference is that if the
    instance compiles program text containing a __future__ statement,
    the instance 'remembers' and compiles all subsequent program texts
    with the statement in force.

The module also provides another class:

Compile():

    Instances of this class act like the built-in function compile,
    but with 'memory' in the sense described above.
�NcCsg|]}tt|��qS�)�getattr�
__future__)�.0Zfnamerr�/usr/lib64/python3.8/codeop.py�
<listcomp>>s�r�compile_command�Compile�CommandCompilericCsZ|�d�D] }|��}|r
|ddkr
q8q
|dkr8d}d}}}d}}	}
z||||�}Wn"tk
r�}zW5d}~XYnXt����t�d�z||d||�}	Wn&tk
r�}z|}W5d}~XYnXz||d||�}
Wn(tk
�r}z|}W5d}~XYnXW5QRXz.|�r,|W�"S|	�sHt|�t|�k�rH|�W5d}}XdS)N�
r�#�eval�pass�errorz

)�split�strip�SyntaxError�warnings�catch_warnings�simplefilter�repr)�compiler�source�filename�symbol�line�errZerr1Zerr2�code�code1�code2�errr�_maybe_compileEs8

 r!cCst|||t�S�N)�compile�PyCF_DONT_IMPLY_DEDENT�rrrrrr�_compilensr&�<input>�singlecCstt|||�S)a�Compile a command and determine whether it is incomplete.

    Arguments:

    source -- the source string; may contain \n characters
    filename -- optional filename from which source was read; default
                "<input>"
    symbol -- optional grammar start symbol; "single" (default), "exec"
              or "eval"

    Return value / exceptions raised:

    - Return a code object if the command is complete and valid
    - Return None if the command is incomplete
    - Raise SyntaxError, ValueError or OverflowError if the command is a
      syntax error (OverflowError and ValueError can be produced by
      malformed literals).
    )r!r&r%rrrrqsc@s eZdZdZdd�Zdd�ZdS)r	z�Instances of this class behave much like the built-in compile
    function, but if one is used to compile text containing a future
    statement, it "remembers" and compiles all subsequent program texts
    with the statement in force.cCs
t|_dSr")r$�flags��selfrrr�__init__�szCompile.__init__cCs<t||||jd�}tD] }|j|j@r|j|jO_q|S)N�)r#r)�	_features�co_flagsZ
compiler_flag)r+rrrZcodeobZfeaturerrr�__call__�s
zCompile.__call__N��__name__�
__module__�__qualname__�__doc__r,r0rrrrr	�sc@s"eZdZdZdd�Zd	dd�ZdS)
r
a(Instances of this class have __call__ methods identical in
    signature to compile_command; the difference is that if the
    instance compiles program text containing a __future__ statement,
    the instance 'remembers' and compiles all subsequent program texts
    with the statement in force.cCst�|_dSr")r	rr*rrrr,�szCommandCompiler.__init__r'r(cCst|j|||�S)a�Compile a command and determine whether it is incomplete.

        Arguments:

        source -- the source string; may contain \n characters
        filename -- optional filename from which source was read;
                    default "<input>"
        symbol -- optional grammar start symbol; "single" (default) or
                  "eval"

        Return value / exceptions raised:

        - Return a code object if the command is complete and valid
        - Return None if the command is incomplete
        - Raise SyntaxError, ValueError or OverflowError if the command is a
          syntax error (OverflowError and ValueError can be produced by
          malformed literals).
        )r!r)r+rrrrrrr0�szCommandCompiler.__call__N)r'r(r1rrrrr
�s)r'r()r5rrZall_feature_namesr.�__all__r$r!r&rr	r
rrrr�<module>s:�
)
__pycache__/_osx_support.cpython-38.opt-1.pyc000064400000026513151153537570015132 0ustar00U

e5dU�@s�dZddlZddlZddlZddddgZdZdZd	Zd-d
d�Zd.d
d�Z	dd�Z
dadd�Zda
dd�Zdd�Zdd�Zdadd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d�Zd*d�Zd+d�Zd,d�ZdS)/zShared OS X support functions.�N�compiler_fixup�customize_config_vars�customize_compiler�get_platform_osx)
�CFLAGSZLDFLAGSZCPPFLAGSZ
BASECFLAGS�	BLDSHARED�LDSHARED�CC�CXXZ	PY_CFLAGSZ
PY_LDFLAGSZPY_CPPFLAGSZPY_CORE_CFLAGSZPY_CORE_LDFLAGS)rrr	r
Z_OSX_SUPPORT_INITIAL_cCs�|dkrtjd}|�tj�}tj�|�\}}tjdkrH|dkrH|d}tj�|�s�|D]&}tj�	||�}tj�|�rX|SqXdS|SdS)z�Tries to find 'executable' in the directories listed in 'path'.

    A string listing directories separated by 'os.pathsep'; defaults to
    os.environ['PATH'].  Returns the complete filename or None if not found.
    N�PATHZwin32z.exe)
�os�environ�split�pathsep�path�splitext�sys�platform�isfile�join)�
executabler�paths�baseZext�p�f�r�$/usr/lib64/python3.8/_osx_support.py�_find_executables

rFc
Cs�ddl}zddl}|��}Wn(tk
rDtdt��fd�}YnX|�|��P}|rfd||jf}nd||jf}t�	|�s�|�
��d���ndW5QR�SQRXdS)z0Output from successful command execution or NonerNz/tmp/_osx_support.%szw+bz
%s >'%s' 2>&1z%s 2>/dev/null >'%s'zutf-8)
�
contextlib�tempfileZNamedTemporaryFile�ImportError�openr�getpid�closing�name�system�read�decode�strip)Z
commandstringZcapture_stderrrr�fp�cmdrrr�_read_output7s��
r+cCst|�ptd|f�pdS)z0Find a build tool on current path or using xcrunz/usr/bin/xcrun -find %s�)rr+)Ztoolnamerrr�_find_build_toolMs
��r-cCsxtdkrtdaztd�}Wntk
r,YnHXzt�d|���}W5|��X|dk	rtd�|�d��	d�dd��atS)z*Return the OS X system version as a stringNr,z0/System/Library/CoreServices/SystemVersion.plistz=<key>ProductUserVisibleVersion</key>\s*<string>(.*?)</string>�.��)
�_SYSTEM_VERSIONr!�OSError�close�re�searchr&r�groupr)r�mrrr�_get_system_versionVs
�
r8cCsLtdkrHt�}|rHztdd�|�d�D��aWntk
rFdaYnXtS)z}
    Return the macOS system version as a tuple

    The return value is safe to use to compare
    two version numbers.
    Ncss|]}t|�VqdS�N��int��.0�irrr�	<genexpr>�sz,_get_system_version_tuple.<locals>.<genexpr>r.r)�_SYSTEM_VERSION_TUPLEr8�tupler�
ValueError�Zosx_versionrrr�_get_system_version_tupleus
rDcCs"t|�D]}|�t�r||=qdS)z-Remove original unmodified values for testingN)�list�
startswith�_INITPRE)�_config_vars�krrr�_remove_original_values�s
rJcCs8|�|d�}||kr,t||kr,||t|<|||<dS)z@Save modified and original unmodified value of configuration varr,N)�getrG)rH�cvZnewvalueZoldvaluerrr�_save_modified_value�srMcCs�tdk	rtStd|fd�}d}|��D]T}|�d�r<d}q(|�d�rLd}q(|r(|��}|dkrfdaq(|�d	�r(|dd
�aq(tdkr�datS)z= Returns the root of the default SDK for this system, or '/' Nz%s -c -E -v - </dev/nullTFz#include <...>zEnd of search listz/usr/include�/z.sdk/usr/includei�)�_cache_default_sysrootr+�
splitlinesrFr(�endswith)�cc�contentsZ
in_incdirs�linerrr�_default_sysroot�s$


rUcCst�}|rt|dk�SdS)z=Returns True if universal builds are supported on this system��
�F)rD�boolrCrrr�_supports_universal_builds�srZcCst�}|r|dkSdS)z9Returns True if arm64 builds are supported on this system)�rF)rDrCrrr�_supports_arm64_builds�sr\cCs�dtjkr|S|d��d}}t|�s4td�}n<tj�|��d�rptd|�	dd�f�}|rpd|krptd�}|s|t
d	��||kr�tD]L}||kr�|tjkr�||��}|d
kr�|n|d|d<t||d�
|��q�|S)
z7Find appropriate C compiler for extension module buildsr	rZclangZgccz'%s' --version�'�'"'"'zllvm-gcczCannot locate working compilerr
z++� )rr
rrr-r�basenamerFr+�replace�SystemError�_COMPILER_CONFIG_VARSrMr)rHrRZoldcc�datarLZcv_splitrrr�_find_appropriate_compiler�s,

��recCsVtD]L}||kr|tjkr||}tjdd|tjd�}t�dd|�}t|||�q|S)z5Remove all universal build arguments from config vars�
-arch\s+\w+\sr_)�flagsz-isysroot\s*\S+)�_UNIVERSAL_CONFIG_VARSrr
r4�sub�ASCIIrM)rHrLrgrrr�_remove_universal_flagssrkcCs�dtjkr|St�d|d�dk	r�t�d|d�dd�f�}|r�tD]8}||krF|tjkrF||}t�dd	|�}t|||�qF|S)
z-Remove any unsupported archs from config varsr	z-arch\s+ppcrNzNecho 'int main{};' | '%s' -c -arch ppc -x c -o /dev/null /dev/null 2>/dev/nullr]r^z-arch\s+ppc\w*\sr_)	rr
r4r5r%rarhrirM)rHZstatusrLrgrrr�_remove_unsupported_archss
��	rlcCsddtjkr`tjd}tD]F}||krd||kr||}t�dd|�}|d|}t|||�q|S)z2Allow override of all archs with ARCHFLAGS env var�	ARCHFLAGS�-archrfr_)rr
rhr4rirM)rHZarchrLrgrrr�_override_all_archs:s

rocCsx|�dd�}t�d|�}|dk	rt|�d�}tj�|�sttD]8}||kr:|tjkr:||}t�	dd|�}t
|||�q:|S)z+Remove references to any SDKs not availablerr,z-isysroot\s*(\S+)Nr/z-isysroot\s*\S+(?:\s|$)r_)rKr4r5r6rr�existsrhr
rirM)rH�cflagsr7ZsdkrLrgrrr�_check_for_unavailable_sdkKs
rrc
Cs�d}}t|�}t�s d}}nd|k}tdd�|D��}|sHdtjkr�z|�d�}|||d�=WqHtk
r|Yq�YqHXqHnFt�s�tt	t
|���D].}||dkr�||dd	kr�|||d�=q�dtjkr�|s�|tjd��}|�r@d
d�t|�D�}|�s
�q@|d}||d
k�r0|||d�=q�|||d�=q�d}|}dd�t|�D�}|�sv|}dd�t|�D�}|D]B}||d
k�r�||d}�q�n||t
d
�d�}�q��qz|�r�tj
�|��s�ddlm}	|	�d|�|	�d�|S)ae
    This function will strip '-isysroot PATH' and '-arch ARCH' from the
    compile flags if the user has specified one them in extra_compile_flags.

    This is needed because '-arch ARCH' adds another architecture to the
    build, without a way to remove an architecture. Furthermore GCC will
    barf if multiple '-isysroot' arguments are present.
    FTrncss|]}|�d�r|VqdS)�	-isysrootN�rF)r=�argrrrr?ys
z!compiler_fixup.<locals>.<genexpr>rmr0r/�arm64cSsg|]\}}|�d�r|�qS�rsrt�r=r>�xrrr�
<listcomp>�s
z"compiler_fixup.<locals>.<listcomp>rrsNcSsg|]\}}|�d�r|�qSrwrtrxrrrrz�s
cSsg|]\}}|�d�r|�qSrwrtrxrrrrz�s
)�logz4Compiling with an SDK that doesn't seem to exist: %sz$Please check your Xcode installation)rErZ�anyrr
�indexrBr\�reversed�range�lenr�	enumerater�isdirZ	distutilsr{�warn)
Zcompiler_soZcc_argsZ	stripArchZstripSysrootr}�idx�indicesZsysrootZargvarr{rrrrfsZ	


�
cCs"t�st|�t|�t|�|S)a�Customize Python build configuration variables.

    Called internally from sysconfig with a mutable mapping
    containing name/value pairs parsed from the configured
    makefile used to build this interpreter.  Returns
    the mapping updated as needed to reflect the environment
    in which the interpreter is running; in the case of
    a Python from a binary installer, the installed
    environment may be very different from the build
    environment, i.e. different OS levels, different
    built tools, different available CPU architectures.

    This customization is performed whenever
    distutils.sysconfig.get_config_vars() is first
    called.  It may be used in environments where no
    compilers are present, i.e. when installing pure
    Python dists.  Customization of compiler paths
    and detection of unavailable archs is deferred
    until the first extension module build is
    requested (in distutils.sysconfig.customize_compiler).

    Currently called from distutils.sysconfig
    )rZrkrorr�rHrrrr�s
cCst|�t|�t|�|S)z�Customize compiler path and configuration variables.

    This customization is performed when the first
    extension module build is requested
    in distutils.sysconfig.customize_compiler).
    )rerlror�rrrr�s	cCs�|�dd�}t�p|}|p|}|�r�|}d}|�td|�dd��}|r�z$tdd�|�d�dd	�D��}Wq�tk
r�d
}Yq�Xnd
}|dk�rFd|��k�rFd
}t�d|�}tt	t
|���}t|�dkr�|d}nj|dkr�d}n\|dkr�d
}nN|dk�rd}n>|dk�rd}n.|dk�r&d}n|dk�r6d}ntd|f��n<|dk�rbtj
dk�r�d}n |dk�r�tj
dk�r~d }nd!}|||fS)"z Filter values for get_platform()ZMACOSX_DEPLOYMENT_TARGETr,Zmacosxrcss|]}t|�VqdSr9r:r<rrrr?sz#get_platform_osx.<locals>.<genexpr>r.rr0)rWrrVrnZfatz
-arch\s+(\S+)r/)rv�x86_64Z
universal2)�i386�ppc)r�r�Zintel)r�r�r�Zfat3)�ppc64r�Zfat64)r�r�r�r�Z	universalz%Don't know machine value for archs=%rr�lr�)ZPowerPCZPower_Macintoshr�r�)rKr8rGrArrBr(r4�findall�sorted�setr�r�maxsize)rHZosname�release�machineZmacverZ
macreleaserqZarchsrrrr�sX



�$




�

)N)F)�__doc__rr4r�__all__rhrcrGrr+r-r1r8r@rDrJrMrOrUrZr\rerkrlrorrrrrrrrrr�<module>sB�


	

>(Q)__pycache__/_pyio.cpython-38.opt-2.pyc000064400000143740151153537570013510 0ustar00U

e5d�k�@sxddlZddlZddlZddlZddlZddlZddlmZej	dkrTddl
mZndZddl
Z
ddl
mZmZmZmZdddhZeed�r�e�ej�e�ej�d	ZeZeed
�p�ejjZd6dd�Zdd�Zz
e
jZWnek
�r�eZYnXGdd�d�Z Gdd�d�Z!z
e
j"Z"Wn(ek
�rDGdd�de#e$�Z"YnXGdd�dej%d�Z&e
j&�'e&�Gdd�de&�Z(e
j(�'e(�ddl)m*Z*e(�'e*�Gdd�de&�Z+e
j+�'e+�Gd d!�d!e+�Z,Gd"d#�d#e+�Z-Gd$d%�d%e,�Z.Gd&d'�d'e,�Z/Gd(d)�d)e+�Z0Gd*d+�d+e/e.�Z1Gd,d-�d-e(�Z*Gd.d/�d/e&�Z2e
j2�'e2�Gd0d1�d1ej3�Z4Gd2d3�d3e2�Z5Gd4d5�d5e5�Z6dS)7�N)�
allocate_lock>�win32�cygwin)�setmode)�__all__�SEEK_SET�SEEK_CUR�SEEK_END���	SEEK_HOLEi Zgettotalrefcount�r���Tc	Cs�t|t�st�|�}t|tttf�s0td|��t|t�sFtd|��t|t�s\td|��|dk	rzt|t�sztd|��|dk	r�t|t�s�td|��t|�}|td�s�t|�t|�kr�t	d|��d|k}	d|k}
d	|k}d
|k}d|k}
d|k}d
|k}d|k�rD|	�s"|�s"|�s"|
�r*t	d��ddl
}|�dtd�d}
|�rX|�rXt	d��|	|
||dk�rvt	d��|	�s�|
�s�|�s�|�s�t	d��|�r�|dk	�r�t	d��|�r�|dk	�r�t	d��|�r�|dk	�r�t	d��|�r|dk�rddl
}|�dt
d�t||	�rd�pd|
�r"d�p$d|�r2d	�p4d|�rBd
�pDd|
�rRd�pTd||d�}|}�z$d}|dk�s�|dk�r�|���r�d}d}|dk�r�t}zt�|���j}Wnttfk
�r�YnX|dk�r�|}|dk�r�t	d ��|dk�r|�r|WSt	d!��|
�r t||�}n<|	�s2|�s2|�r>t||�}n|
�rPt||�}nt	d"|��|}|�rl|WSt|||||�}|}||_|WS|���YnXdS)#Nzinvalid file: %rzinvalid mode: %rzinvalid buffering: %r�invalid encoding: %r�invalid errors: %rzaxrwb+tU�xr
�w�a�+�t�b�Uz4mode U cannot be combined with 'x', 'w', 'a', or '+'rz'U' mode is deprecatedrTz'can't have text and binary mode at oncer
z)can't have read/write/append mode at oncez/must have exactly one of read/write/append modez-binary mode doesn't take an encoding argumentz+binary mode doesn't take an errors argumentz+binary mode doesn't take a newline argumentzaline buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used�)�openerFrzinvalid buffering sizezcan't have unbuffered text I/Ozunknown mode: %r)�
isinstance�int�os�fspath�str�bytes�	TypeError�set�len�
ValueError�warnings�warn�DeprecationWarning�RuntimeWarning�FileIO�isatty�DEFAULT_BUFFER_SIZE�fstat�fileno�
st_blksize�OSError�AttributeError�BufferedRandom�BufferedWriter�BufferedReader�
TextIOWrapper�mode�close)�filer4�	buffering�encoding�errors�newline�closefdrZmodesZcreatingZreadingZwritingZ	appendingZupdating�textZbinaryr$�raw�result�line_bufferingZbs�buffer�rA�/usr/lib64/python3.8/_pyio.py�open)s�{




�������



rCcCs ddl}|�dtd�t|d�S)Nrz(_pyio.open_code() may not be using hooksr�rb)r$r%r'rC)�pathr$rArArB�_open_code_with_warnings�rFc@seZdZddd�ZdS)�
DocDescriptorNcCs
dtjS)Nz\open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True)

)rC�__doc__)�self�obj�typrArArB�__get__s��zDocDescriptor.__get__)N)�__name__�
__module__�__qualname__rLrArArArBrGsrGc@seZdZe�Zdd�ZdS)�OpenWrappercOs
t||�S�N)rC)�cls�args�kwargsrArArB�__new__,szOpenWrapper.__new__N)rMrNrOrGrHrUrArArArBrP"srPc@seZdZdS)�UnsupportedOperationN)rMrNrOrArArArBrV5srVc@s�eZdZdd�Zd5dd�Zdd�Zd6d	d
�Zdd�Zd
Zdd�Z	dd�Z
dd�Zd7dd�Zdd�Z
d8dd�Zdd�Zd9dd�Zedd��Zd:d d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd;d+d,�Zd-d.�Zd/d0�Zd<d1d2�Zd3d4�ZdS)=�IOBasecCstd|jj|f��dS)Nz%s.%s() not supported)rV�	__class__rM)rI�namerArArB�_unsupported\s
�zIOBase._unsupportedrcCs|�d�dS)N�seek�rZ�rI�pos�whencerArArBr[cszIOBase.seekcCs|�dd�S�Nrr
)r[�rIrArArB�tellsszIOBase.tellNcCs|�d�dS�N�truncater\�rIr^rArArBrdwszIOBase.truncatecCs|��dSrQ��_checkClosedrarArArB�flush�szIOBase.flushFcCs |jsz|��W5d|_XdS)NT)�_IOBase__closedrhrarArArBr5�szIOBase.closecCsVz
|j}Wntk
r YdSX|r*dStr8|��nz|��WnYnXdSrQ)�closedr/�_IOBASE_EMITS_UNRAISABLEr5)rIrjrArArB�__del__�s

zIOBase.__del__cCsdS�NFrArarArArB�seekable�szIOBase.seekablecCs |��st|dkrdn|��dS)NzFile or stream is not seekable.)rnrV�rI�msgrArArB�_checkSeekable�s��zIOBase._checkSeekablecCsdSrmrArarArArB�readable�szIOBase.readablecCs |��st|dkrdn|��dS)NzFile or stream is not readable.)rrrVrorArArB�_checkReadable�s��zIOBase._checkReadablecCsdSrmrArarArArB�writable�szIOBase.writablecCs |��st|dkrdn|��dS)NzFile or stream is not writable.)rtrVrorArArB�_checkWritable�s��zIOBase._checkWritablecCs|jSrQ)rirarArArBrj�sz
IOBase.closedcCs|jrt|dkrdn|��dS�N�I/O operation on closed file.�rjr#rorArArBrg�s��zIOBase._checkClosedcCs|��|SrQrfrarArArB�	__enter__�szIOBase.__enter__cGs|��dSrQ)r5)rIrSrArArB�__exit__�szIOBase.__exit__cCs|�d�dS)Nr,r\rarArArBr,�sz
IOBase.filenocCs|��dSrmrfrarArArBr)sz
IOBase.isattyrcs�t�d�r��fdd�}ndd�}�dkr0d�n4z
�j}Wn"tk
r\t��d���YnX|��t�}�dks~t|��kr���|��}|s�q�||7}|�d�rjq�qjt|�S)	N�peekcs>��d�}|sdS|�d�dp&t|�}�dkr:t|��}|S)Nr
�
r)r{�findr"�min)Z	readahead�n�rI�sizerArB�
nreadaheads

z#IOBase.readline.<locals>.nreadaheadcSsdS�Nr
rArArArArBr� sr� is not an integerrr|)	�hasattr�	__index__r/r �	bytearrayr"�read�endswithr)rIr�r��
size_index�resrrAr�rB�readlines&
	

zIOBase.readlinecCs|��|SrQrfrarArArB�__iter__5szIOBase.__iter__cCs|��}|st�|SrQ)r��
StopIteration�rI�linerArArB�__next__9szIOBase.__next__cCsP|dks|dkrt|�Sd}g}|D]&}|�|�|t|�7}||kr$qLq$|S�Nr)�list�appendr")rIZhintr�linesr�rArArB�	readlines?s
zIOBase.readlinescCs |��|D]}|�|�qdSrQ)rg�write)rIr�r�rArArB�
writelinesQszIOBase.writelines)r)N)N)N)N)N)r)N)rMrNrOrZr[rbrdrhrir5rlrnrqrrrsrtru�propertyrjrgryrzr,r)r�r�r�r�r�rArArArBrW9s4#







	

*
rW)�	metaclassc@s.eZdZddd�Zdd�Zdd�Zdd	�Zd
S)�	RawIOBasercCsP|dkrd}|dkr|��St|���}|�|�}|dkr>dS||d�=t|�S)Nrr)�readallr�r��readintor)rIr�rrrArArBr�ls

zRawIOBase.readcCs4t�}|�t�}|sq ||7}q|r,t|�S|SdSrQ)r�r�r*r)rIr��datarArArBr�}s

zRawIOBase.readallcCs|�d�dS)Nr�r\�rIrrArArBr��szRawIOBase.readintocCs|�d�dS�Nr�r\r�rArArBr��szRawIOBase.writeN)r)rMrNrOr�r�r�r�rArArArBr�^s
r�)r(c@sHeZdZddd�Zddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dS)�BufferedIOBasercCs|�d�dS�Nr�r\r�rArArBr��szBufferedIOBase.readcCs|�d�dS)N�read1r\r�rArArBr��szBufferedIOBase.read1cCs|j|dd�S)NF�r���	_readintor�rArArBr��szBufferedIOBase.readintocCs|j|dd�S)NTr�r�r�rArArB�	readinto1�s	zBufferedIOBase.readinto1cCsVt|t�st|�}|�d�}|r0|�t|��}n|�t|��}t|�}||d|�<|S�N�B)r�
memoryview�castr�r"r�)rIrr�r�rrArArBr��s

zBufferedIOBase._readintocCs|�d�dSr�r\r�rArArBr��s	zBufferedIOBase.writecCs|�d�dS�N�detachr\rarArArBr��szBufferedIOBase.detachN)r)r)
rMrNrOr�r�r�r�r�r�r�rArArArBr��s

r�c@s�eZdZdd�Zd#dd�Zdd�Zd$d	d
�Zdd�Zd
d�Zdd�Z	dd�Z
edd��Zedd��Z
edd��Zedd��Zdd�Zdd�Zdd �Zd!d"�ZdS)%�_BufferedIOMixincCs
||_dSrQ��_raw�rIr=rArArB�__init__sz_BufferedIOMixin.__init__rcCs"|j�||�}|dkrtd��|S)Nrz#seek() returned an invalid position)r=r[r.)rIr^r_Znew_positionrArArBr[sz_BufferedIOMixin.seekcCs|j��}|dkrtd��|S)Nrz#tell() returned an invalid position)r=rbr.rerArArBrbs
z_BufferedIOMixin.tellNcCs$|��|dkr|��}|j�|�SrQ)rhrbr=rdrerArArBrd$sz_BufferedIOMixin.truncatecCs|jrtd��|j��dS)N�flush on closed file)rjr#r=rhrarArArBrh2sz_BufferedIOMixin.flushcCs.|jdk	r*|js*z|��W5|j��XdSrQ)r=rjr5rhrarArArBr57sz_BufferedIOMixin.closecCs*|jdkrtd��|��|j}d|_|S)Nzraw stream already detached)r=r#rhr�r�rArArBr�?s
z_BufferedIOMixin.detachcCs
|j��SrQ)r=rnrarArArBrnIsz_BufferedIOMixin.seekablecCs|jSrQr�rarArArBr=Lsz_BufferedIOMixin.rawcCs|jjSrQ)r=rjrarArArBrjPsz_BufferedIOMixin.closedcCs|jjSrQ)r=rYrarArArBrYTsz_BufferedIOMixin.namecCs|jjSrQ)r=r4rarArArBr4Xsz_BufferedIOMixin.modecCstd|jj�d���dS�Nzcannot pickle z object�r rXrMrarArArB�__getstate__\sz_BufferedIOMixin.__getstate__cCsN|jj}|jj}z
|j}Wn tk
r:d�||�YSXd�|||�SdS)Nz<{}.{}>z<{}.{} name={!r}>)rXrNrOrYr/�format)rI�modnameZclsnamerYrArArB�__repr___s
z_BufferedIOMixin.__repr__cCs
|j��SrQ)r=r,rarArArBr,ksz_BufferedIOMixin.filenocCs
|j��SrQ)r=r)rarArArBr)nsz_BufferedIOMixin.isatty)r)N)rMrNrOr�r[rbrdrhr5r�rnr�r=rjrYr4r�r�r,r)rArArArBr�
s(	






r�cs�eZdZdZd dd�Zdd�Zdd�Zdd	�Z�fd
d�Zd!d
d�Z	d"dd�Z
dd�Zd#dd�Zdd�Z
d$dd�Zdd�Zdd�Zdd�Z�ZS)%�BytesIONcCs&t�}|dk	r||7}||_d|_dSr�)r��_buffer�_pos)rIZ
initial_bytes�bufrArArBr�zs
zBytesIO.__init__cCs|jrtd��|j��S)Nz__getstate__ on closed file)rjr#�__dict__�copyrarArArBr��szBytesIO.__getstate__cCs|jrtd��t|j�S)Nzgetvalue on closed file)rjr#rr�rarArArB�getvalue�szBytesIO.getvaluecCs|jrtd��t|j�S)Nzgetbuffer on closed file)rjr#r�r�rarArArB�	getbuffer�szBytesIO.getbuffercs"|jdk	r|j��t���dSrQ)r��clear�superr5ra�rXrArBr5�s

z
BytesIO.closercCs�|jrtd��|dkrd}n4z
|j}Wn"tk
rHt|�d���YnX|�}|dkrbt|j�}t|j�|jkrvdStt|j�|j|�}|j|j|�}||_t	|�S)N�read from closed filerr�r�)
rjr#r�r/r r"r�r�r~r)rIr�r�ZnewposrrArArBr��s"

zBytesIO.readcCs
|�|�SrQ)r�r�rArArBr��sz
BytesIO.read1c	Cs�|jrtd��t|t�r td��t|��}|j}W5QRX|dkrFdS|j}|t|j	�krzd|t|j	�}|j	|7_	||j	|||�<|j|7_|S)N�write to closed file� can't write str to binary streamr�)
rjr#rrr r��nbytesr�r"r�)rIrZviewrr^ZpaddingrArArBr��s

z
BytesIO.writercCs�|jrtd��z
|j}Wn"tk
r:t|�d���YnX|�}|dkrh|dkr`td|f��||_nD|dkr�td|j|�|_n(|dkr�tdt|j�|�|_ntd��|jS)Nzseek on closed filer�r�negative seek position %rr
rzunsupported whence value)	rjr#r�r/r r��maxr"r�)rIr^r_�	pos_indexrArArBr[�s"
zBytesIO.seekcCs|jrtd��|jS)N�tell on closed file)rjr#r�rarArArBrb�szBytesIO.tellcCsx|jrtd��|dkr|j}nJz
|j}Wn"tk
rJt|�d���YnX|�}|dkrhtd|f��|j|d�=|S)Nztruncate on closed filer�rznegative truncate position %r)rjr#r�r�r/r r�)rIr^r�rArArBrd�s
zBytesIO.truncatecCs|jrtd��dS�NrwTrxrarArArBrr�szBytesIO.readablecCs|jrtd��dSr�rxrarArArBrt�szBytesIO.writablecCs|jrtd��dSr�rxrarArArBrn�szBytesIO.seekable)N)r)r)r)N)rMrNrOr�r�r�r�r�r5r�r�r�r[rbrdrrrtrn�
__classcell__rArAr�rBr�rs




r�c@steZdZefdd�Zdd�Zdd�Zddd	�Zdd
d�Zdd
d�Z	ddd�Z
ddd�Zdd�Zdd�Z
ddd�ZdS) r2cCsF|��std��t�||�|dkr,td��||_|��t�|_dS)Nz "raw" argument must be readable.r�invalid buffer size)	rrr.r�r�r#�buffer_size�_reset_read_buf�Lock�
_read_lock�rIr=r�rArArBr�szBufferedReader.__init__cCs
|j��SrQ)r=rrrarArArBrrszBufferedReader.readablecCsd|_d|_dS)Nr�r)�	_read_buf�	_read_posrarArArBr�szBufferedReader._reset_read_bufNc
Cs@|dk	r|dkrtd��|j�|�|�W5QR�SQRXdS)Nrzinvalid number of bytes to read)r#r��_read_unlockedr�rArArBr� szBufferedReader.readcCs�d}d}|j}|j}|dks$|dkr�|��t|jd�rj|j��}|dkrZ||d�pXdS||d�|S||d�g}d}|j��}||kr�|}q�|t|�7}|�|�q|d�	|�p�|St|�|}	||	kr�|j|7_||||�S||d�g}t
|j|�}
|	|k�rH|j�|
�}||k�r.|}�qH|	t|�7}	|�|��qt||	�}d�	|�}||d�|_d|_|�r�|d|�S|S)Nr�)r�Nrr�r)
r�r�r�r�r=r�r�r"r��joinr�r�r~)rIrZ
nodata_valZempty_valuesr�r^�chunkZchunksZcurrent_size�availZwanted�outrArArBr�-sL





zBufferedReader._read_unlockedrc
Cs(|j�|�|�W5QR�SQRXdSrQ)r��_peek_unlockedr�rArArBr{aszBufferedReader.peekcCsrt||j�}t|j�|j}||ks,|dkrb|j|}|j�|�}|rb|j|jd�||_d|_|j|jd�Sr�)r~r�r"r�r�r=r�)rIrZwantZhaveZto_readZcurrentrArArBr�ks
zBufferedReader._peek_unlockedrc
Cs^|dkr|j}|dkrdS|j�4|�d�|�t|t|j�|j��W5QR�SQRXdS)Nrr�r
)r�r�r�r�r~r"r�r�r�rArArBr�vs
�zBufferedReader.read1c	Cs
t|t�st|�}|jdkr dS|�d�}d}|j��|t|�kr�tt|j�|jt|��}|r�|j|j|j|�||||�<|j|7_||7}|t|�kr�q�t|�||j	kr�|j
�||d��}|s�q�||7}n|r�|s�|�d�s�q�|r6|r6q�q6W5QRX|S)Nrr�r
)
rr�r�r�r�r"r~r�r�r�r=r�r�)rIr�r��writtenr�rrArArBr��s6


�

zBufferedReader._readintocCst�|�t|j�|jSrQ)r�rbr"r�r�rarArArBrb�szBufferedReader.tellc
Csd|tkrtd��|j�D|dkr4|t|j�|j8}t�|||�}|��|W5QR�SQRXdS)N�invalid whence valuer
)	�valid_seek_flagsr#r�r"r�r�r�r[r�r]rArArBr[�szBufferedReader.seek)N)N)r)r)r)r)rMrNrOr*r�rrr�r�r�r{r�r�r�rbr[rArArArBr2s


4



.r2c@s\eZdZefdd�Zdd�Zdd�Zddd	�Zd
d�Zdd
�Z	dd�Z
ddd�Zdd�ZdS)r1cCsF|��std��t�||�|dkr,td��||_t�|_t�|_	dS)Nz "raw" argument must be writable.rr�)
rtr.r�r�r#r�r��
_write_bufr��_write_lockr�rArArBr��szBufferedWriter.__init__cCs
|j��SrQ)r=rtrarArArBrt�szBufferedWriter.writablecCst|t�rtd��|j��|jr(td��t|j�|jkr@|�	�t|j�}|j�
|�t|j�|}t|j�|jkr�z|�	�Wnltk
r�}zNt|j�|jkr�t|j�|j}||8}|jd|j�|_t|j|j
|��W5d}~XYnX|W5QR�SQRXdS)Nr�r�)rrr r�rjr#r"r�r��_flush_unlocked�extend�BlockingIOError�errno�strerror)rIrZbeforer��eZoveragerArArBr��s(

"zBufferedWriter.writeNc
CsD|j�4|��|dkr"|j��}|j�|�W5QR�SQRXdSrQ)r�r�r=rbrdrerArArBrd�s

zBufferedWriter.truncatec	Cs|j�|��W5QRXdSrQ)r�r�rarArArBrh�szBufferedWriter.flushcCs�|jrtd��|jr�z|j�|j�}Wntk
rBtd��YnX|dkrZttjdd��|t	|j�ksp|dkrxt
d��|jd|�=qdS)Nr�zHself.raw should implement RawIOBase: it should not raise BlockingIOErrorz)write could not complete without blockingrz*write() returned incorrect number of bytes)rjr#r�r=r�r��RuntimeErrorr�ZEAGAINr"r.�rIrrArArBr�s �zBufferedWriter._flush_unlockedcCst�|�t|j�SrQ)r�rbr"r�rarArArBrbszBufferedWriter.tellrc
CsD|tkrtd��|j�$|��t�|||�W5QR�SQRXdS)Nr�)r�r#r�r�r�r[r]rArArBr[s
zBufferedWriter.seekcCs`|j�$|jdks|jr&W5QR�dSW5QRXz|��W5|j�|j��W5QRXXdSrQ)r�r=rjr5rhrarArArBr5szBufferedWriter.close)N)r)
rMrNrOr*r�rtr�rdrhr�rbr[r5rArArArBr1�s	

r1c@s�eZdZefdd�Zddd�Zdd�Zdd	�Zddd�Zd d
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zedd��ZdS)!�BufferedRWPaircCs<|��std��|��s td��t||�|_t||�|_dS)Nz#"reader" argument must be readable.z#"writer" argument must be writable.)rrr.rtr2�readerr1�writer)rIr�r�r�rArArBr�<szBufferedRWPair.__init__rcCs|dkrd}|j�|�S�Nr)r�r�r�rArArBr�JszBufferedRWPair.readcCs|j�|�SrQ)r�r�r�rArArBr�OszBufferedRWPair.readintocCs|j�|�SrQ)r�r�r�rArArBr�RszBufferedRWPair.writercCs|j�|�SrQ)r�r{r�rArArBr{UszBufferedRWPair.peekcCs|j�|�SrQ)r�r�r�rArArBr�XszBufferedRWPair.read1cCs|j�|�SrQ)r�r�r�rArArBr�[szBufferedRWPair.readinto1cCs
|j��SrQ)r�rrrarArArBrr^szBufferedRWPair.readablecCs
|j��SrQ)r�rtrarArArBrtaszBufferedRWPair.writablecCs
|j��SrQ)r�rhrarArArBrhdszBufferedRWPair.flushcCs z|j��W5|j��XdSrQ)r�r5r�rarArArBr5gszBufferedRWPair.closecCs|j��p|j��SrQ)r�r)r�rarArArBr)mszBufferedRWPair.isattycCs|jjSrQ)r�rjrarArArBrjpszBufferedRWPair.closedN)r)r)r)rMrNrOr*r�r�r�r�r{r�r�rrrtrhr5r)r�rjrArArArBr�,s


r�c@sjeZdZefdd�Zddd�Zdd�Zdd	d
�Zddd�Zd
d�Z	ddd�Z
ddd�Zdd�Zdd�Z
dS)r0cCs(|��t�|||�t�|||�dSrQ)rqr2r�r1r�rArArBr�~szBufferedRandom.__init__rc	Cs�|tkrtd��|��|jrJ|j� |j�|jt|j�d�W5QRX|j�||�}|j�|�	�W5QRX|dkr�t
d��|S)Nr�r
rz seek() returned invalid position)r�r#rhr�r�r=r[r�r"r�r.r]rArArBr[�s$zBufferedRandom.seekcCs|jrt�|�St�|�SdSrQ)r�r1rbr2rarArArBrb�s
zBufferedRandom.tellNcCs|dkr|��}t�||�SrQ)rbr1rdrerArArBrd�szBufferedRandom.truncatecCs |dkrd}|��t�||�Sr�)rhr2r�r�rArArBr��szBufferedRandom.readcCs|��t�||�SrQ)rhr2r�r�rArArBr��szBufferedRandom.readintocCs|��t�||�SrQ)rhr2r{r�rArArBr{�szBufferedRandom.peekrcCs|��t�||�SrQ)rhr2r�r�rArArBr��szBufferedRandom.read1cCs|��t�||�SrQ)rhr2r�r�rArArBr��szBufferedRandom.readinto1c	CsF|jr:|j�(|j�|jt|j�d�|��W5QRXt�||�Sr�)	r�r�r=r[r�r"r�r1r�r�rArArBr��s
zBufferedRandom.write)r)N)N)r)r)rMrNrOr*r�r[rbrdr�r�r{r�r�r�rArArArBr0us	




r0cs�eZdZdZdZdZdZdZdZdZ	d0dd�Z
dd	�Zd
d�Zdd
�Z
dd�Zd1dd�Zd2dd�Zdd�Zdd�Zdd�Zefdd�Zdd�Zd3dd�Z�fd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zed,d-��Zed.d/��Z �Z!S)4r(rFNTr
c
CsB|jdkr*z|jrt�|j�W5d|_Xt|t�r<td��t|t�r\|}|dkr`td��nd}t|t	�sxtd|f��t
|�t
d�ks�td|f��tdd�|D��d	ks�|�d
�d	kr�td��d|kr�d
|_
d
|_tjtjB}nTd|kr�d
|_d}n@d|k�rd
|_tjtjB}n"d|k�r8d
|_d
|_tjtjB}d
|k�rNd
|_d
|_|j�rj|j�rj|tjO}n|j�r~|tjO}n
|tjO}|ttdd�O}ttdd��p�ttdd�}||O}d}�zT|dk�r:|�s�td��|dk�r�t�||d�}n0|||�}t|t��std��|dk�r$td��|}|�s:t�|d�||_t�|�}	z(t�|	j��rpt t!j"t�#t!j"�|��Wnt$k
�r�YnXt|	dd�|_%|j%d	k�r�t&|_%t'�r�t'|tj(�||_)|j�rzt�*|dt+�Wn4tk
�r}
z|
j!t!j,k�r�W5d}
~
XYnXWn"|dk	�r0t�|��YnX||_dS)Nrrz$integer argument expected, got floatznegative file descriptorzinvalid mode: %szxrwab+css|]}|dkVqdS)ZrwaxNrA)�.0�crArArB�	<genexpr>�sz"FileIO.__init__.<locals>.<genexpr>r
rzKMust have exactly one of create/read/write/append mode and at most one plusrTr
rr�O_BINARYZO_NOINHERIT�	O_CLOEXECz'Cannot use closefd=False with file namei�zexpected integer from openerzNegative file descriptorFr-)-�_fd�_closefdrr5r�floatr rr#rr!�sum�count�_created�	_writable�O_EXCL�O_CREAT�	_readable�O_TRUNC�
_appending�O_APPEND�O_RDWR�O_RDONLY�O_WRONLY�getattrrCr.�set_inheritabler+�stat�S_ISDIR�st_mode�IsADirectoryErrorr�ZEISDIRr�r/�_blksizer*�_setmoder�rY�lseekr	ZESPIPE)rIr6r4r;r�fd�flagsZnoinherit_flagZowned_fdZfdfstatr�rArArBr��s�




$




�





�

zFileIO.__init__cCsB|jdkr>|jr>|js>ddl}|jd|ftd|d�|��dS)Nrzunclosed file %rr)�
stacklevel�source)r�r�rjr$r%�ResourceWarningr5)rIr$rArArBrlAs�zFileIO.__del__cCstd|jj�d���dSr�r�rarArArBr�HszFileIO.__getstate__cCspd|jj|jjf}|jr"d|Sz
|j}Wn*tk
rVd||j|j|jfYSXd|||j|jfSdS)Nz%s.%sz
<%s [closed]>z<%s fd=%d mode=%r closefd=%r>z<%s name=%r mode=%r closefd=%r>)	rXrNrOrjrYr/r�r4r�)rI�
class_namerYrArArBr�Ks�
�
�zFileIO.__repr__cCs|jstd��dS)NzFile not open for reading)r�rVrarArArBrsYszFileIO._checkReadablecCs|jstd��dS)NzFile not open for writing)r�rVrorArArBru]szFileIO._checkWritablecCsT|��|��|dks |dkr(|��Szt�|j|�WStk
rNYdSXdSr�)rgrsr�rr�r�r�r�rArArBr�aszFileIO.readcCs�|��|��t}z6t�|jdt�}t�|j�j}||krH||d}Wnt	k
r^YnXt
�}t|�|kr�t|�}|t|t�7}|t|�}zt�
|j|�}Wntk
r�|r�Yq�YdSX|s�q�||7}qft|�Sr`)rgrsr*rr
r�rr+�st_sizer.r�r"r�r�r�r)rI�bufsizer^�endr>rr�rArArBr�qs2
zFileIO.readallcCs4t|��d�}|�t|��}t|�}||d|�<|Sr�)r�r�r�r")rIr�mr�rrArArBr��s
zFileIO.readintocCs<|��|��zt�|j|�WStk
r6YdSXdSrQ)rgrurr�r�r�r�rArArBr��szFileIO.writecCs*t|t�rtd��|��t�|j||�S)Nzan integer is required)rr�r rgrr
r�r]rArArBr[�s
zFileIO.seekcCs|��t�|jdt�Sr�)rgrr
r�rrarArArBrb�szFileIO.tellcCs2|��|��|dkr |��}t�|j|�|SrQ)rgrurbr�	ftruncater�r�rArArBrd�szFileIO.truncatecs.|js*z|jrt�|j�W5t���XdSrQ)rjr�r5r�rr�rar�rArBr5�s
zFileIO.closecCsF|��|jdkr@z|��Wntk
r8d|_YnXd|_|jS)NFT)rg�	_seekablerbr.rarArArBrn�s
zFileIO.seekablecCs|��|jSrQ)rgr�rarArArBrr�szFileIO.readablecCs|��|jSrQ)rgr�rarArArBrt�szFileIO.writablecCs|��|jSrQ)rgr�rarArArBr,�sz
FileIO.filenocCs|��t�|j�SrQ)rgrr)r�rarArArBr)�sz
FileIO.isattycCs|jSrQ)r�rarArArBr;�szFileIO.closefdcCsJ|jr|jrdSdSn0|jr,|jr&dSdSn|jrB|jr<dSdSndSdS)Nzxb+Zxbzab+Zabzrb+rD�wb)r�r�rr�rarArArBr4szFileIO.mode)r
TN)N)N)N)"rMrNrOr�r�r�r�rrr�r�rlr�r�rsrur�r�r�r�rr[rbrdr5rnrrrtr,r)r�r;r4r�rArAr�rBr(�s<
y

#



r(c@s\eZdZddd�Zdd�Zddd�Zd	d
�Zdd�Zed
d��Z	edd��Z
edd��ZdS)�
TextIOBasercCs|�d�dSr�r\r�rArArBr�szTextIOBase.readcCs|�d�dSr�r\)rI�srArArBr�(szTextIOBase.writeNcCs|�d�dSrcr\rerArArBrd,szTextIOBase.truncatecCs|�d�dS)Nr�r\rarArArBr�0szTextIOBase.readlinecCs|�d�dSr�r\rarArArBr�7szTextIOBase.detachcCsdSrQrArarArArBr8@szTextIOBase.encodingcCsdSrQrArarArArB�newlinesEszTextIOBase.newlinescCsdSrQrArarArArBr9OszTextIOBase.errors)r)N)rMrNrOr�r�rdr�r�r�r8rr9rArArArBrs


	

	rc@sPeZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
ZdZ	dZ
edd��ZdS)�IncrementalNewlineDecoder�strictcCs,tjj||d�||_||_d|_d|_dS)N)r9rF)�codecs�IncrementalDecoderr��	translate�decoder�seennl�	pendingcr)rIr#r"r9rArArBr�`s
z"IncrementalNewlineDecoder.__init__FcCs�|jdkr|}n|jj||d�}|jr<|s.|r<d|}d|_|�d�r\|s\|dd�}d|_|�d�}|�d�|}|�d�|}|j|o�|j|o�|jB|o�|jBO_|j	r�|r�|�
dd�}|r�|�
dd�}|S)N��final�
FrT�
�
)r#�decoder%r�r�r$�_LF�_CR�_CRLFr"�replace)rI�inputr'�outputZcrlfZcrZlfrArArBr+gs*

�z IncrementalNewlineDecoder.decodecCs@|jdkrd}d}n|j��\}}|dK}|jr8|dO}||fS)Nr�rr
)r#�getstater%)rIr��flagrArArBr2�s
z"IncrementalNewlineDecoder.getstatecCs8|\}}t|d@�|_|jdk	r4|j�||d?f�dSr�)�boolr%r#�setstate)rI�stater�r3rArArBr5�s
z"IncrementalNewlineDecoder.setstatecCs$d|_d|_|jdk	r |j��dS)NrF)r$r%r#�resetrarArArBr7�s
zIncrementalNewlineDecoder.resetr
r�cCs
d|jS)N)Nr*r()r(r*r))r*r))r(r))r(r*r))r$rarArArBr�s�z"IncrementalNewlineDecoder.newlinesN)r)F)
rMrNrOr�r+r2r5r7r,r-r.r�rrArArArBrYs

rc@sreZdZdZdZdNdd�Zdd�ZdOdd	�Zd
d�Ze	dd
��Z
e	dd��Ze	dd��Ze	dd��Z
e	dd��Zddeddd�dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Ze	d#d$��Ze	d%d&��Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�ZdPd3d4�Zd5d6�Zd7d8�Z dQd:d;�Z!d<d=�Z"d>d?�Z#dRd@dA�Z$dBdC�Z%dSdDdE�Z&dTdFdG�Z'dHdI�Z(dUdJdK�Z)e	dLdM��Z*dS)Vr3iNFc		Cs|�|�|dkrvzt�|���}Wnttfk
r<YnX|dkrvzddl}Wntk
rjd}YnX|�d�}t	|t
�s�td|��t�
|�js�d}t||��|dkr�d}nt	|t
�s�td|��||_d|_d|_d|_|j��|_|_t|jd	�|_|�|||||�dS)
Nr�asciiFrzG%r is not a text encoding; use codecs.open() to handle arbitrary codecsrrrr�)�_check_newliner�device_encodingr,r/rV�locale�ImportErrorZgetpreferredencodingrrr#r �lookup�_is_text_encoding�LookupErrorr��_decoded_chars�_decoded_chars_used�	_snapshotr@rnr�_tellingr��
_has_read1�
_configure)	rIr@r8r9r:r?�
write_throughr<rprArArBr��s>





�zTextIOWrapper.__init__cCs>|dk	r$t|t�s$tdt|�f��|dkr:td|f��dS)Nzillegal newline type: %r)Nrr*r(r)zillegal newline value: %r)rrr �typer#)rIr:rArArBr:�szTextIOWrapper._check_newlinecCs�||_||_d|_d|_d|_||_|dk|_||_|dk|_|pHt	j
|_||_||_
|jr�|��r�|j��}|dkr�z|���d�Wntk
r�YnXdS)N�rr)�	_encoding�_errors�_encoder�_decoder�	_b2cratio�_readuniversal�_readtranslate�_readnl�_writetranslater�linesep�_writenl�_line_buffering�_write_throughrrtr@rb�_get_encoderr5r@)rIr8r9r:r?rG�positionrArArBrF�s&


zTextIOWrapper._configurecCs�d�|jj|jj�}z
|j}Wntk
r2YnX|d�|�7}z
|j}Wntk
r`YnX|d�|�7}|d�|j�S)Nz<{}.{}z name={0!r}z mode={0!r}z encoding={0!r}>)r�rXrNrOrYr/r4r8)rIr>rYr4rArArBr�!s
�

zTextIOWrapper.__repr__cCs|jSrQ)rJrarArArBr82szTextIOWrapper.encodingcCs|jSrQ)rKrarArArBr96szTextIOWrapper.errorscCs|jSrQ)rUrarArArBr?:szTextIOWrapper.line_bufferingcCs|jSrQ)rVrarArArBrG>szTextIOWrapper.write_throughcCs|jSrQ)r�rarArArBr@BszTextIOWrapper.buffer)r8r9r:r?rGcCs�|jdk	r*|dk	s"|dk	s"|tk	r*td��|dkrH|dkrB|j}q^d}nt|t�s^td|��|dkrn|j}nt|t�s�td|��|tkr�|j}|�	|�|dkr�|j
}|dkr�|j}|��|�
|||||�dS)NzPIt is not possible to set the encoding or newline of stream after the first readrrr)rM�EllipsisrVrKrrr rJrQr:r?rGrhrF)rIr8r9r:r?rGrArArB�reconfigureFs@
����



�zTextIOWrapper.reconfigurecCs|jrtd��|jSrv)rjr#rrarArArBrnoszTextIOWrapper.seekablecCs
|j��SrQ)r@rrrarArArBrrtszTextIOWrapper.readablecCs
|j��SrQ)r@rtrarArArBrtwszTextIOWrapper.writablecCs|j��|j|_dSrQ)r@rhrrDrarArArBrhzs
zTextIOWrapper.flushcCs.|jdk	r*|js*z|��W5|j��XdSrQ)r@rjr5rhrarArArBr5~szTextIOWrapper.closecCs|jjSrQ)r@rjrarArArBrj�szTextIOWrapper.closedcCs|jjSrQ)r@rYrarArArBrY�szTextIOWrapper.namecCs
|j��SrQ)r@r,rarArArBr,�szTextIOWrapper.filenocCs
|j��SrQ)r@r)rarArArBr)�szTextIOWrapper.isattycCs�|jrtd��t|t�s(td|jj��t|�}|js<|j	oBd|k}|rf|jrf|j
dkrf|�d|j
�}|jpr|�
�}|�|�}|j�|�|j	r�|s�d|kr�|��|�d�d|_|jr�|j��|S)Nr�zcan't write %s to text streamr*r(r)rjr#rrr rXrMr"rRrUrTr/rLrW�encoder@r�rh�_set_decoded_charsrCrMr7)rIrZlengthZhaslf�encoderrrArArBr��s(
�


zTextIOWrapper.writecCst�|j�}||j�|_|jSrQ)r �getincrementalencoderrJrKrL)rIZmake_encoderrArArBrW�szTextIOWrapper._get_encodercCs2t�|j�}||j�}|jr(t||j�}||_|SrQ)r �getincrementaldecoderrJrKrOrrPrM)rIZmake_decoderr#rArArB�_get_decoder�s
zTextIOWrapper._get_decodercCs||_d|_dSr�)rArB)rI�charsrArArBr\�sz TextIOWrapper._set_decoded_charscCsF|j}|dkr|j|d�}n|j|||�}|jt|�7_|SrQ)rBrAr")rIr�offsetrarArArB�_get_decoded_chars�sz TextIOWrapper._get_decoded_charscCs$|j|krtd��|j|8_dS)Nz"rewind decoded_chars out of bounds)rB�AssertionErrorr�rArArB�_rewind_decoded_chars�s
z#TextIOWrapper._rewind_decoded_charscCs�|jdkrtd��|jr&|j��\}}|jr<|j�|j�}n|j�|j�}|}|j�	||�}|�
|�|r�t|�t|j�|_
nd|_
|jr�|||f|_|S)Nz
no decoderrI)rMr#rDr2rEr@r��_CHUNK_SIZEr�r+r\r"rArNrC)rI�
dec_buffer�	dec_flags�input_chunk�eofZ
decoded_charsrArArB�_read_chunk�s 

zTextIOWrapper._read_chunkrcCs(||d>B|d>B|d>Bt|�d>BS)N�@���)r4)rIrXrh�
bytes_to_feed�need_eof�
chars_to_skiprArArB�_pack_cookie�s
�
�zTextIOWrapper._pack_cookiecCsFt|d�\}}t|d�\}}t|d�\}}t|d�\}}|||||fS)Nl)�divmod)rIZbigint�restrXrhrprqrrrArArB�_unpack_cookie	s
zTextIOWrapper._unpack_cookiec	Cs@|jstd��|jstd��|��|j��}|j}|dksF|jdkrX|j	rTt
d��|S|j\}}|t|�8}|j}|dkr�|�
||�S|��}�z�t|j|�}d}|dk�r"|�d|f�t|�|d|���}	|	|k�r|��\}
}|
s�|}||	8}�q4|t|
�8}d}q�||8}|d}q�d}|�d|f�||}|}
|dk�rZ|�
||
�W��Sd}d}d}t|t|��D]x}|d7}|t|�|||d���7}|��\}}|�s�||k�r�||7}||8}|dd}
}}||k�rt�q�qt|t|jddd	��7}d}||k�rtd
��|�
||
|||�W�S|�|�XdS)N�!underlying stream is not seekablez(telling position disabled by next() callzpending decoded textrr
r�rTr&z'can't reconstruct logical file position)rrVrDr.rhr@rbrMrCrArdr"rBrsr2r5rrNr+�range)rIrXr#rhZ
next_inputrrZsaved_stateZ
skip_bytesZ	skip_backrr�d�	start_posZstart_flagsZ	bytes_fedrqZ
chars_decoded�irgrArArBrb
	s�








�zTextIOWrapper.tellcCs$|��|dkr|��}|j�|�SrQ)rhrbr@rdrerArArBrdm	szTextIOWrapper.truncatecCs*|jdkrtd��|��|j}d|_|S)Nzbuffer is already detached)r@r#rhr�)rIr@rArArBr�s	s
zTextIOWrapper.detachcs��fdd�}�jrtd���js(td��|tkrN|dkr@td��d}���}nZ|tkr�|dkrftd������j�	d|�}��
d�d�_�jr��j�
�||�|S|dkr�td	|f��|dkr�td
|f�������|�\}}}}}	�j�	|���
d�d�_|dk�r*�j�r*�j�
�n@�j�s>|�s>|	�rj�j�pL����_�j�d|f�|df�_|	�r��j�|�}
��
�j�|
|��||
f�_t�j�|	k�r�td��|	�_||�|S)
NcsHz�jp���}Wntk
r&YnX|dkr<|�d�n|��dSr�)rLrWr@r5r7)rXr]rarArB�_reset_encoder|	sz*TextIOWrapper.seek.<locals>._reset_encoderr�rwrz#can't do nonzero cur-relative seeksz#can't do nonzero end-relative seeksrzunsupported whence (%r)r�r�z#can't restore logical file position)rjr#rrVrrbr	rhr@r[r\rCrMr7rvr`r5r�r+r"rAr.rB)rIZcookier_r|rXrzrhrprqrrrirArarBr[{	s`



�

�
zTextIOWrapper.seekcCs�|��|dkrd}n4z
|j}Wn"tk
rBt|�d���YnX|�}|jpV|��}|dkr�|��|j|j�	�dd�}|�
d�d|_|Sd}|�|�}t|�|kr�|s�|�
�}||�|t|��7}q�|SdS)Nrr�rTr&rF)rsr�r/r rMr`rcr+r@r�r\rCr"rk)rIr�r�r#r>rjrArArBr��	s,
�


zTextIOWrapper.readcCs(d|_|��}|s$d|_|j|_t�|Srm)rDr�rCrr�r�rArArBr��	szTextIOWrapper.__next__c	Cs
|jrtd��|dkrd}n4z
|j}Wn"tk
rHt|�d���YnX|�}|��}d}|jsj|��d}}|jr�|�	d|�}|dkr�|d}�q�nt
|�}n�|j�rF|�	d|�}|�	d|�}|dkr�|dkr�t
|�}n|d}�q�nX|dk�r|d}�q�n@||k�r|d}�q�n(||dk�r8|d}�q�n|d}�q�n(|�	|j�}|dk�rn|t
|j�}�q�|dk�r�t
|�|k�r�|}�q�|�
��r�|j�r��q��q�|j�r�||��7}qr|�d	�d|_|Sqr|dk�r�||k�r�|}|�t
|�|�|d|�S)
Nr�rr�rr*r
r(rr)rjr#r�r/r rcrMr`rPr}r"rOrQrkrAr\rCre)	rIr�r�r��startr^�endposZnlposZcrposrArArBr��	st







zTextIOWrapper.readlinecCs|jr|jjSdSrQ)rMrrarArArBrH
szTextIOWrapper.newlines)NNNFF)NNNFF)N)rrrr)N)r)N)N)+rMrNrOrfr�r�r:rFr�r�r8r9r?rGr@rYrZrnrrrtrhr5rjrYr,r)r�rWr`r\rcrerkrsrvrbrdr�r[r�r�r�rrArArArBr3�sz�
(�
$




�)



*�

c

K
	
]r3csNeZdZd�fdd�	Zdd�Zdd�Zed	d
��Zedd��Zd
d�Z	�Z
S)�StringIOrr*csftt|�jt�dd|d�|dkr(d|_|dk	rbt|t�sNtd�t	|�j
���|�|�|�d�dS)Nzutf-8�
surrogatepass)r8r9r:Fz*initial_value must be str or None, not {0}r)
r�rr�r�rRrrr r�rHrMr�r[)rIZ
initial_valuer:r�rArBr�T
s�
�
zStringIO.__init__c	CsP|��|jp|��}|��}|��z|j|j��dd�W�S|�|�XdS)NTr&)	rhrMr`r2r7r5r+r@r�)rIr#Z	old_staterArArBr�d
szStringIO.getvaluecCs
t�|�SrQ)�objectr�rarArArBr�n
szStringIO.__repr__cCsdSrQrArarArArBr9s
szStringIO.errorscCsdSrQrArarArArBr8w
szStringIO.encodingcCs|�d�dSr�r\rarArArBr�{
szStringIO.detach)rr*)rMrNrOr�r�r�r�r9r8r�r�rArAr�rBrM
s


r)r
rNNNTN)7r�abcr r�r�sys�_threadrr��platformZmsvcrtrr�iorrrr	r�r��addr�	SEEK_DATAr*r�r�dev_moderkrCrF�	open_coder/rGrPrVr.r#�ABCMetarW�registerr��_ior(r�r�r�r2r1r�r0rr!rr3rrArArArB�<module>s�


�
[

	
$=
ghCiIJY@U$__pycache__/__future__.cpython-38.opt-1.pyc000064400000010100151153537570014455 0ustar00U

e5d�
@s�dZddddddddd	d
g
ZdgeZdZd
ZdZdZdZdZdZ	dZ
dZdZGdd�d�Z
e
dde�Ze
dde�Ze
dde�Ze
dde�Ze
dde�Ze
d de�Ze
d de	�Ze
d!d"e
�Ze
d#d$e�Ze
d%d&e�Zd'S)(afRecord of phased-in incompatible language changes.

Each line is of the form:

    FeatureName = "_Feature(" OptionalRelease "," MandatoryRelease ","
                              CompilerFlag ")"

where, normally, OptionalRelease < MandatoryRelease, and both are 5-tuples
of the same form as sys.version_info:

    (PY_MAJOR_VERSION, # the 2 in 2.1.0a3; an int
     PY_MINOR_VERSION, # the 1; an int
     PY_MICRO_VERSION, # the 0; an int
     PY_RELEASE_LEVEL, # "alpha", "beta", "candidate" or "final"; string
     PY_RELEASE_SERIAL # the 3; an int
    )

OptionalRelease records the first release in which

    from __future__ import FeatureName

was accepted.

In the case of MandatoryReleases that have not yet occurred,
MandatoryRelease predicts the release in which the feature will become part
of the language.

Else MandatoryRelease records when the feature became part of the language;
in releases at or after that, modules no longer need

    from __future__ import FeatureName

to use the feature in question, but may continue to use such imports.

MandatoryRelease may also be None, meaning that a planned feature got
dropped.

Instances of class _Feature have two corresponding methods,
.getOptionalRelease() and .getMandatoryRelease().

CompilerFlag is the (bitfield) flag that should be passed in the fourth
argument to the builtin function compile() to enable the feature in
dynamically compiled code.  This flag is stored in the .compiler_flag
attribute on _Future instances.  These values must match the appropriate
#defines of CO_xxx flags in Include/compile.h.

No feature line is ever to be deleted from this file.
�
nested_scopes�
generators�division�absolute_import�with_statement�print_function�unicode_literals�barry_as_FLUFL�generator_stop�annotations�all_feature_names��iiiii i@i�ic@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�_FeaturecCs||_||_||_dS)N)�optional�	mandatory�
compiler_flag)�selfZoptionalReleaseZmandatoryReleaser�r�"/usr/lib64/python3.8/__future__.py�__init__Ssz_Feature.__init__cCs|jS)z�Return first release in which this feature was recognized.

        This is a 5-tuple, of the same form as sys.version_info.
        )r�rrrr�getOptionalReleaseXsz_Feature.getOptionalReleasecCs|jS)z�Return release in which this feature will become mandatory.

        This is a 5-tuple, of the same form as sys.version_info, or, if
        the feature was dropped, is None.
        )rrrrr�getMandatoryRelease_sz_Feature.getMandatoryReleasecCsdt|j|j|jf�S)Nr)�reprrrrrrrr�__repr__gs�z_Feature.__repr__N)�__name__�
__module__�__qualname__rrrrrrrrrQsr)��r
�betar)rrr
�alphar
)rrr
r!r)r�r
�finalr
)rrr
r!r)r"r
r
r!r
)r�r
r!r)r�r
r!r
)rr%r
r!r)r"rr
r!r)�r
r
r!r
)r"r$r
r r)r"�r
r!r
)r"r'r
r r)r"�
r
r!r
N)�__doc__r�__all__Z	CO_NESTEDZCO_GENERATOR_ALLOWEDZCO_FUTURE_DIVISIONZCO_FUTURE_ABSOLUTE_IMPORTZCO_FUTURE_WITH_STATEMENTZCO_FUTURE_PRINT_FUNCTIONZCO_FUTURE_UNICODE_LITERALSZCO_FUTURE_BARRY_AS_BDFLZCO_FUTURE_GENERATOR_STOPZCO_FUTURE_ANNOTATIONSrrrrrrrrrr	r
rrrr�<module>s~2�
����������__pycache__/socket.cpython-38.pyc000064400000066215151153537570012722 0ustar00U

e5d���@sdZddlZddlTddlZddlZddlZddlZddlmZmZzddl	Z	Wne
k
rhdZ	YnXee	dd�Zee	dd�Z
ee	d	d�Zd
ddd
dddgZe�e�e��e�dedd��e�dedd��e�dedd��e�dedd��dZdZdd�ZeZej���d��r$iZded<ded <d!ed"<d#ed$<d%ed&<d'ed(<d)ed*<d+ed,<d-ed.<d/ed0<d1ed2<d3ed4<d5ed6<d7ed8<d9ed:<d;ed<<d=ed><d?ed@<dAedB<dCedD<dEedF<dGedH<dIedJ<dKedL<dMedN<dOedP<dQedR<dSedT<dUedV<dWedX<dYedZ<d[ed\<d]ed^<d_ed`<daedb<dcedd<deedf<dgedh<diedj<dkedl<dmedn<doedp<dqedr<dsedt<duedv<dwedx<dyedz<d{ed|<d}ed~<ded�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<e�d١Gd�dۄd�e�ZGd�d݄d�ej�Zd�d�d
�Z e!ejd߃�rpd�d�Z"e�d�e!ed��r�de#dfd�d�Z$ne%e#dfd�d�Z$e�d�d�e$_e
ehZ&Gd�d�d�ej'�Z(d�d�d�Z)e*�Z+e+dfd�d�Z,d�d�Z-e%dd�d�d�d�d
�Z.d�d�d�Z/dS)�a0This module provides socket operations and some related functions.
On Unix, it supports IP (Internet Protocol) and Unix domain sockets.
On other systems, it only supports IP. Functions specific for a
socket are available as methods of the socket object.

Functions:

socket() -- create a new socket object
socketpair() -- create a pair of new socket objects [*]
fromfd() -- create a socket object from an open file descriptor [*]
fromshare() -- create a socket object from data received from socket.share() [*]
gethostname() -- return the current hostname
gethostbyname() -- map a hostname to its IP number
gethostbyaddr() -- map an IP number or hostname to DNS info
getservbyname() -- map a service name and a protocol name to a port number
getprotobyname() -- map a protocol name (e.g. 'tcp') to a number
ntohs(), ntohl() -- convert 16, 32 bit int from network to host byte order
htons(), htonl() -- convert 16, 32 bit int from host to network byte order
inet_aton() -- convert IP addr string (123.45.67.89) to 32-bit packed format
inet_ntoa() -- convert 32-bit packed format IP to string (123.45.67.89)
socket.getdefaulttimeout() -- get the default timeout value
socket.setdefaulttimeout() -- set the default timeout value
create_connection() -- connects to an address, with an optional timeout and
                       optional source address.

 [*] not available on all platforms!

Special objects:

SocketType -- type object for socket objects
error -- exception raised for I/O errors
has_ipv6 -- boolean value indicating if IPv6 is supported

IntEnum constants:

AF_INET, AF_UNIX -- socket domains (first argument to socket() call)
SOCK_STREAM, SOCK_DGRAM, SOCK_RAW -- socket types (second argument)

Integer constants:

Many other constants may be defined; these may be used in calls to
the setsockopt() and getsockopt() methods.
�N)�*)�IntEnum�IntFlag�EBADF�	�EAGAIN��EWOULDBLOCK�fromfd�getfqdn�create_connection�
create_server�has_dualstack_ipv6�
AddressFamily�
SocketKindcCs|��o|�d�S)NZAF_��isupper�
startswith��C�r�/usr/lib64/python3.8/socket.py�<lambda>L�rcCs|��o|�d�S)NZSOCK_rrrrrrQrZMsgFlagcCs|��o|�d�S)NZMSG_rrrrrrVrZAddressInfocCs|��o|�d�S)NZAI_rrrrrr[rz	127.0.0.1z::1cCs(z
||�WStk
r"|YSXdS)z{Convert a numeric family value to an IntEnum member.

    If it's not a known member, return the numeric value itself.
    N)�
ValueError)�valueZ
enum_klassrrr�_intenum_converteras
r�winz)Specified event object handle is invalid.�zInsufficient memory available.�z#One or more parameters are invalid.�WzOverlapped operation aborted.i�z2Overlapped I/O event object not in signaled state.i�z)Overlapped operation will complete later.i�zThe operation was interrupted.i'zA bad file handle was passed.i'zPermission denied.i'z!A fault occurred on the network??i'z#An invalid operation was attempted.i&'zToo many open files.i('z The socket operation would blocki3'z,A blocking operation is already in progress.i4'zOperation already in progress.i5'zSocket operation on nonsocket.i6'zDestination address required.i7'zMessage too long.i8'zProtocol wrong type for socket.i9'zBad protocol option.i:'zProtocol not supported.i;'zSocket type not supported.i<'zOperation not supported.i='zProtocol family not supported.i>'z0Address family not supported by protocol family.i?'zThe network address is in use.i@'z Cannot assign requested address.iA'zNetwork is down.iB'zNetwork is unreachable.iC'z$Network dropped connection on reset.iD'z!Software caused connection abort.iE'zThe connection has been reset.iF'zNo buffer space available.iG'zSocket is already connected.iH'zSocket is not connected.iI'zThe network has been shut down.iJ'zToo many references.iK'zThe operation timed out.iL'zConnection refused.iM'zCannot translate name.iN'zThe name is too long.iO'zThe host is down.iP'zThe host is unreachable.iQ'zDirectory not empty.iR'zToo many processes.iS'zUser quota exceeded.iT'zDisk quota exceeded.iU'zStale file handle reference.iV'zItem is remote.iW'z!Network subsystem is unavailable.ik'z!Winsock.dll version out of range.il'z(Successful WSAStartup not yet performed.im'zGraceful shutdown in progress.iu'z*No more results from WSALookupServiceNext.iv'zCall has been canceled.iw'z Procedure call table is invalid.ix'zService provider is invalid.iy'z&Service provider failed to initialize.iz'zSystem call failure.i{'zService not found.i|'zClass type not found.i}'i~'zCall was canceled.i'zDatabase query was refused.i�'zHost not found.i�*z Nonauthoritative host not found.i�*zThis is a nonrecoverable error.i�*z*Valid name, no data record requested type.i�*zQoS receivers.i�*zQoS senders.i�*zNo QoS senders.i�*zQoS no receivers.i+zQoS request confirmed.i+zQoS admission error.i+zQoS policy failure.i+zQoS bad style.i+zQoS bad object.i+zQoS traffic control error.i+zQoS generic error.i+zQoS service type error.i+zQoS flowspec error.i	+zInvalid QoS provider buffer.i
+zInvalid QoS filter style.i+i+zIncorrect QoS filter count.i
+zInvalid QoS object length.i+zIncorrect QoS flow count.i+zUnrecognized QoS object.i+zInvalid QoS policy object.i+zInvalid QoS flow descriptor.i+z'Invalid QoS provider-specific flowspec.i+z)Invalid QoS provider-specific filterspec.i+z&Invalid QoS shape discard mode object.i+z Invalid QoS shaping rate object.i+z!Reserved policy QoS element type.i+�errorTabc@seZdZdS)�_GiveupOnSendfileN)�__name__�
__module__�__qualname__rrrrr"�sr"cs,eZdZdZdddgZd9dd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zd:dddd�dd�Ze
ed�rzd;dd�Zn
d<dd�Zd=dd�Zd d!�Zd>d"d#�Zd$d%�Zejfd&d'�Zd(d)�Z�fd*d+�Ze�fd,d-��Ze�fd.d/��Zejd0k�rd1d2�Zd3d4�Znd5d2�Zd6d4�Zd7e_d8e_�ZS)?�socketz:A subclass of _socket.socket adding the makefile() method.�__weakref__�_io_refs�_closed���NcCsP|dkr,|dkrt}|dkr t}|dkr,d}tj�|||||�d|_d|_dS)Nr*rF)�AF_INET�SOCK_STREAM�_socketr&�__init__r(r))�self�family�type�proto�filenorrrr.�szsocket.__init__cCs|S�Nr�r/rrr�	__enter__�szsocket.__enter__cGs|js|��dSr4)r)�close)r/�argsrrr�__exit__�szsocket.__exit__cCs�t|dd�}d|jj|jj|r"dnd|��|j|j|jf}|s�z |��}|r^|dt	|�7}Wnt
k
rtYnXz |��}|r�|dt	|�7}Wnt
k
r�YnX|d7}|S)	zVWrap __repr__() to reveal the real class name and socket
        address(es).
        r)Fz,<%s.%s%s fd=%i, family=%s, type=%s, proto=%iz	 [closed]�z
, laddr=%sz
, raddr=%s�>)�getattr�	__class__r$r%r3r0r1r2�getsockname�str�errorZgetpeername)r/�closed�sZladdrZraddrrrr�__repr__�s4
��zsocket.__repr__cCstd|jj�d���dS)Nzcannot pickle z object)�	TypeErrorr=r#r5rrr�__getstate__szsocket.__getstate__cCs6t|���}|j|j|j|j|d�}|�|���|S)z�dup() -> socket object

        Duplicate the socket. Return a new socket object connected to the same
        system resource. The new socket is non-inheritable.
        �r3)�dupr3r=r0r1r2�
settimeout�
gettimeout)r/�fd�sockrrrrGsz
socket.dupcCsF|��\}}t|j|j|j|d�}t�dkr>|��r>|�d�||fS)z�accept() -> (socket object, address info)

        Wait for an incoming connection.  Return a new socket
        representing the connection, and the address of the client.
        For IP sockets, the address info is a pair (hostaddr, port).
        rFNT)Z_acceptr&r0r1r2ZgetdefaulttimeoutrI�setblocking)r/rJ�addrrKrrr�accepts

z
socket.accept�r)�encoding�errors�newlinec
Cst|�dddhks td|f��d|k}d|kp4|}|sB|sBt�d|k}d}	|rZ|	d7}	|rf|	d7}	t||	�}
|jd7_|dkr�d}|d	kr�tj}|d	kr�|s�td
��|
S|r�|r�t�|
|
|�}n&|r�t�|
|�}n|s�t�t�	|
|�}|r�|St�
||||�}||_|S)z�makefile(...) -> an I/O stream connected to the socket

        The arguments are as for io.open() after the filename, except the only
        supported mode values are 'r' (default), 'w' and 'b'.
        rO�w�bz&invalid mode %r (only r, w, b allowed)r:�Nr*rz!unbuffered streams must be binary)�setr�AssertionError�SocketIOr(�io�DEFAULT_BUFFER_SIZE�BufferedRWPair�BufferedReader�BufferedWriter�
TextIOWrapper�mode)
r/r_�	bufferingrPrQrRZwritingZreadingZbinaryZrawmode�raw�buffer�textrrr�makefile-s@
zsocket.makefile�sendfilerc
Cs�|�|||�|��}z|��}Wn0ttjfk
rR}zt|��W5d}~XYnXzt�|�j}Wn*t	k
r�}zt|��W5d}~XYnX|s�dSt
|p�|d�}|��}	|	dkr�td��t
td�r�t��}
nt��}
|
�|tj�d}|
j}tj}
z�|	�r||	��st�d��|�r0||}|dk�r0�q�z|
||||�}Wn`tk
�rh|	�s`|�Yq�Yq�t	k
�r�}z|dk�r�t|��|d�W5d}~XYq�X|dk�r��q�||7}||7}q�|W�S|dk�r�t
|d��r�|�|�XdS)Nri@�&non-blocking sockets are not supported�PollSelector�seekz	timed out)�_check_sendfile_paramsr3�AttributeErrorrY�UnsupportedOperationr"�os�fstat�st_size�OSError�minrIr�hasattr�	selectorsrgZSelectSelector�registerZEVENT_WRITEZselectrerhr-�timeout�BlockingIOError)r/�file�offset�countZsocknor3�errZfsize�	blocksizertZselector�
total_sentZselector_selectZos_sendfile�sentrrr�_sendfile_use_sendfileYs^






zsocket._sendfile_use_sendfilecCstd��dS)Nz,os.sendfile() not available on this platform)r"�r/rvrwrxrrrr}�s�c

Cs�|�|||�|��dkr"td��|r0|�|�|r>t|d�nd}d}|j}|j}z�|rpt|||�}|dkrpq�t||��}|s�q�z||�}	Wnt	k
r�Yq�Yq�X||	7}|	t
|�kr�||	d�}q�qTq�qT|W�S|dkr�t|d�r�|�||�XdS)Nrrfi rh)rirIrrhrp�read�sendrq�
memoryviewru�len)
r/rvrwrxrzr{Z	file_readZ	sock_send�datar|rrr�_sendfile_use_send�s8

zsocket._sendfile_use_sendcCsddt|dd�krtd��|jt@s*td��|dk	r`t|t�sJtd�|���|dkr`td�|���dS)NrTr_z$file should be opened in binary modez+only SOCK_STREAM type sockets are supportedz+count must be a positive integer (got {!r})r)r<rr1r,�
isinstance�intrD�formatr~rrrri�s

��zsocket._check_sendfile_paramscCs8z|�|||�WStk
r2|�|||�YSXdS)a_sendfile(file[, offset[, count]]) -> sent

        Send a file until EOF is reached by using high-performance
        os.sendfile() and return the total number of bytes which
        were sent.
        *file* must be a regular file object opened in binary mode.
        If os.sendfile() is not available (e.g. Windows) or file is
        not a regular file socket.send() will be used instead.
        *offset* tells from where to start reading the file.
        If specified, *count* is the total number of bytes to transmit
        as opposed to sending the file until EOF is reached.
        File position is updated on return or also in case of error in
        which case file.tell() can be used to figure out the number of
        bytes which were sent.
        The socket must be of SOCK_STREAM type.
        Non-blocking sockets are not supported.
        N)r}r"r�r~rrrre�szsocket.sendfilecCs*|jdkr|jd8_|jr&|��dS)NrrU)r(r)r7r5rrr�_decref_socketios�s
zsocket._decref_socketioscCs|�|�dSr4)r7)r/Z_ssrrr�_real_close�szsocket._real_closecCsd|_|jdkr|��dS)NTr)r)r(r�r5rrrr7�s
zsocket.closecsd|_t���S)adetach() -> file descriptor

        Close the socket object without closing the underlying file descriptor.
        The object cannot be used after this call, but the file descriptor
        can be reused for other purposes.  The file descriptor is returned.
        T)r)�super�detachr5�r=rrr��sz
socket.detachcstt�jt�S)z@Read-only access to the address family for this socket.
        )rr�r0rr5r�rrr0sz
socket.familycstt�jt�S)z-Read-only access to the socket type.
        )rr�r1rr5r�rrr1szsocket.type�ntcCst�|���Sr4)rlZget_handle_inheritabler3r5rrr�get_inheritable
szsocket.get_inheritablecCst�|��|�dSr4)rlZset_handle_inheritabler3�r/Zinheritablerrr�set_inheritableszsocket.set_inheritablecCst�|���Sr4)rlr�r3r5rrrr�scCst�|��|�dSr4)rlr�r3r�rrrr�sz&Get the inheritable flag of the socketz&Set the inheritable flag of the socket)r*r*r*N)rON)rN)rN)rN)rN) r#r$r%�__doc__�	__slots__r.r6r9rCrErGrNrdrqrlr}r�rirer�r-r&r�r7r��propertyr0r1�namer�r��
__classcell__rrr�rr&�sF

�*
A

$


r&cCst|�}t||||�S)z� fromfd(fd, family, type[, proto]) -> socket object

    Create a socket object from a duplicate of the given file
    descriptor.  The remaining arguments are the same as for socket().
    )rGr&)rJr0r1r2Znfdrrrr
sZsharecCstddd|�S)z� fromshare(info) -> socket object

        Create a socket object from the bytes object returned by
        socket.share(pid).
        r)r&)�inforrr�	fromshare#sr��
socketpaircCsh|dkr*zt}Wntk
r(t}YnXt�|||�\}}t||||���}t||||���}||fS)aasocketpair([family[, type[, proto]]]) -> (socket object, socket object)

        Create a pair of socket objects from the sockets returned by the platform
        socketpair() function.
        The arguments are the same as for socket() except the default family is
        AF_UNIX if defined on the platform; otherwise, the default is AF_INET.
        N)ZAF_UNIX�	NameErrorr+r-r�r&r�)r0r1r2�arTrrrr�.s
c
	Cs|tkrt}n|tkrt}ntd��|tkr4td��|dkrDtd��t|||�}z�|�|df�|�	�|�
�dd�\}}t|||�}zP|�d�z|�||f�Wnt
tfk
r�YnX|�d�|��\}}	Wn|���YnXW5|��X||fS)Nz?Only AF_INET and AF_INET6 socket address families are supportedz)Only SOCK_STREAM socket type is supportedrzOnly protocol zero is supported�FT)r+�
_LOCALHOST�AF_INET6�
_LOCALHOST_V6rr,r&r7�bind�listenr>rL�connectru�InterruptedErrorrN)
r0r1r2�hostZlsockrM�portZcsockZssock�_rrrr�Cs8


a8socketpair([family[, type[, proto]]]) -> (socket object, socket object)
Create a pair of socket objects from the sockets returned by the platform
socketpair() function.
The arguments are the same as for socket() except the default family is AF_UNIX
if defined on the platform; otherwise, the default is AF_INET.
cspeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Z�fdd
�Z	dd�Z
edd��Zedd��Z
dd�Z�ZS)rXz�Raw I/O implementation for stream sockets.

    This class supports the makefile() method on sockets.  It provides
    the raw I/O interface on top of a socket object.
    cCsZ|dkrtd|��tj�|�||_d|kr6|d7}||_d|k|_d|k|_d|_dS)N)rOrSZrw�rb�wbZrwbzinvalid mode: %rrTrOrSF)	rrY�	RawIOBaser.�_sock�_mode�_reading�_writing�_timeout_occurred)r/rKr_rrrr.�s

zSocketIO.__init__c
Cs�|��|��|jrtd��z|j�|�WStk
rHd|_�Yqtk
r�}z|jdt	krpWY�
dS�W5d}~XYqXqdS)a3Read up to len(b) bytes into the writable buffer *b* and return
        the number of bytes read.  If the socket is non-blocking and no bytes
        are available, None is returned.

        If *b* is non-empty, a 0 return value indicates that the connection
        was shutdown at the other end.
        z!cannot read from timed out objectTrN)
�_checkClosed�_checkReadabler�ror�Z	recv_intortr@r8�_blocking_errnos�r/rT�errr�readinto�s
zSocketIO.readintoc
Cs`|��|��z|j�|�WStk
rZ}z|jdtkrHWY�
dS�W5d}~XYnXdS)aWrite the given bytes or bytearray object *b* to the socket
        and return the number of bytes written.  This can be less than
        len(b) if not all data could be written.  If the socket is
        non-blocking and no bytes could be written None is returned.
        rN)r��_checkWritabler�r�r@r8r�r�rrr�write�s
zSocketIO.writecCs|jrtd��|jS)z2True if the SocketIO is open for reading.
        �I/O operation on closed socket.)rArr�r5rrr�readable�szSocketIO.readablecCs|jrtd��|jS)z2True if the SocketIO is open for writing.
        r�)rArr�r5rrr�writable�szSocketIO.writablecs|jrtd��t���S)z2True if the SocketIO is open for seeking.
        r�)rArr��seekabler5r�rrr��szSocketIO.seekablecCs|��|j��S)z=Return the file descriptor of the underlying socket.
        )r�r�r3r5rrrr3�szSocketIO.filenocCs|js|��SdSdS)Nr*)rAr3r5rrrr��sz
SocketIO.namecCs|jSr4)r�r5rrrr_�sz
SocketIO.modecCs*|jr
dStj�|�|j��d|_dS)z�Close the SocketIO object.  This doesn't close the underlying
        socket, except if all references to it have disappeared.
        N)rArYr�r7r�r�r5rrrr7�s

zSocketIO.close)r#r$r%r�r.r�r�r�r�r�r3r�r�r_r7r�rrr�rrXrs

rXr:cCsl|��}|r|dkrt�}zt|�\}}}Wntk
r@Yn(X|�d|�|D]}d|krRqhqR|}|S)aGet fully qualified domain name from name.

    An empty argument is interpreted as meaning the local host.

    First the hostname returned by gethostbyaddr() is checked, then
    possibly existing aliases. In case no FQDN is available, hostname
    from gethostname() is returned.
    z0.0.0.0r�.)�stripZgethostnameZ
gethostbyaddrr@�insert)r�Zhostname�aliasesZipaddrsrrrr�s	cCs�|\}}d}t||dt�D]�}|\}}}	}
}d}zDt|||	�}|tk	rP|�|�|r^|�|�|�|�d}|WStk
r�}
z|
}|dk	r�|��W5d}
~
XYqXq|dk	r�z|�W5d}Xntd��dS)acConnect to *address* and return the socket object.

    Convenience function.  Connect to *address* (a 2-tuple ``(host,
    port)``) and return the socket object.  Passing the optional
    *timeout* parameter will set the timeout on the socket instance
    before attempting to connect.  If no *timeout* is supplied, the
    global default timeout setting returned by :func:`getdefaulttimeout`
    is used.  If *source_address* is set it must be a tuple of (host, port)
    for the socket to bind as a source address before making the connection.
    A host of '' or port 0 tells the OS to use the default.
    Nrz!getaddrinfo returns an empty list)	�getaddrinfor,r&�_GLOBAL_DEFAULT_TIMEOUTrHr�r�r@r7)�addressrtZsource_addressr�r�ry�res�af�socktyper2�	canonname�sarKr�rrrrs.



c	Csltrttd�rttd�sdSz4ttt�� }|�ttd�W5QR�WdSQRXWnt	k
rfYdSXdS)z�Return True if the platform supports creating a SOCK_STREAM socket
    which can handle both AF_INET and AF_INET6 (IPv4 / IPv6) connections.
    �IPPROTO_IPV6�IPV6_V6ONLYFrTN)
�has_ipv6rqr-r&r�r,�
setsockoptr�r�r@)rKrrrr0s��F)r0�backlog�
reuse_port�dualstack_ipv6c
Csn|rttd�std��|r8t�s(td��|tkr8td��t|t�}�ztjdkr�ttd�r�z|�	t
td�Wntk
r�YnX|r�|�	t
t
d�tr�|tkr�|r�|�	ttd�n"ttd	�r�ttd
�r�|�	ttd�z|�|�Wn@tk
�r$}z d|j|f}t|j|�d�W5d}~XYnX|dk�r:|��n
|�|�|WStk
�rh|���YnXdS)
a�Convenience function which creates a SOCK_STREAM type socket
    bound to *address* (a 2-tuple (host, port)) and return the socket
    object.

    *family* should be either AF_INET or AF_INET6.
    *backlog* is the queue size passed to socket.listen().
    *reuse_port* dictates whether to use the SO_REUSEPORT socket option.
    *dualstack_ipv6*: if true and the platform supports it, it will
    create an AF_INET6 socket able to accept both IPv4 or IPv6
    connections. When false it will explicitly disable this option on
    platforms that enable it by default (e.g. Linux).

    >>> with create_server(('', 8000)) as server:
    ...     while True:
    ...         conn, addr = server.accept()
    ...         # handle new connection
    �SO_REUSEPORTz+SO_REUSEPORT not supported on this platformz-dualstack_ipv6 not supported on this platformz'dualstack_ipv6 requires AF_INET6 family)r��cygwin�SO_REUSEADDRrUrr�r�z+%s (while attempting to bind on address %r)N)rqr-rrr�r&r,rlr�r�Z
SOL_SOCKETr�r@r�r�r�r�r��strerror�errnor�r7)r�r0r�r�r�rKry�msgrrrr
@sN


�
�� 


cCsPg}t�||||||�D]2}|\}}	}}
}|�t|t�t|	t�||
|f�q|S)a�Resolve host and port into list of address info entries.

    Translate the host/port argument into a sequence of 5-tuples that contain
    all the necessary arguments for creating a socket connected to that service.
    host is a domain name, a string representation of an IPv4/v6 address or
    None. port is a string service name such as 'http', a numeric port number or
    None. By passing None as the value of host and port, you can pass NULL to
    the underlying C API.

    The family, type and proto arguments can be optionally specified in order to
    narrow the list of addresses returned. Passing zero as a value for each of
    these arguments selects the full range of results.
    )r-r��appendrrr)r�r�r0r1r2�flagsZaddrlistr�r�r�r�r�rrrr��s�r�)r)r:)rrrr)0r�r-rl�sysrYrr�enumrrr��ImportErrorr<rrr	�__all__�extend�_get_exports_list�	_convert_r#r�r�rr&Z_realsocket�platform�lowerrr!r��	Exceptionr"r
rqr�r,r�r+r�r�rXr�objectr�rrr
r�rrrr�<module>sH- 
�����

F
	
$
u
�
-�E__pycache__/_py_abc.cpython-38.opt-2.pyc000064400000006535151153537570013765 0ustar00U

e5d-�@s(ddlmZdd�ZGdd�de�ZdS)�)�WeakSetcCstjS�N)�ABCMeta�_abc_invalidation_counter�rr�/usr/lib64/python3.8/_py_abc.py�get_cache_tokensrcsReZdZdZ�fdd�Zdd�Zddd�Zd	d
�Zdd�Zd
d�Z	dd�Z
�ZS)rrc	s�t�j||||f|�}dd�|��D�}|D]:}t|dt��D]&}t||d�}t|dd�r>|�|�q>q,t|�|_t�|_	t�|_
t�|_tj
|_|S)NcSs h|]\}}t|dd�r|�qS)�__isabstractmethod__F)�getattr)�.0�name�valuerrr�	<setcomp>&s�z"ABCMeta.__new__.<locals>.<setcomp>�__abstractmethods__r	F)�super�__new__�itemsr
�set�add�	frozensetrr�
_abc_registry�
_abc_cache�_abc_negative_cacherr�_abc_negative_cache_version)	�mclsr�bases�	namespace�kwargs�clsZ	abstracts�baser
��	__class__rrr#s�
zABCMeta.__new__cCsPt|t�std��t||�r |St||�r2td��|j�|�tjd7_|S)NzCan only register classesz'Refusing to create an inheritance cycle�)	�
isinstance�type�	TypeError�
issubclass�RuntimeErrorrrrr)r�subclassrrr�register6s


zABCMeta.registerNcCs|td|j�d|j��|d�tdt���|d�|jD]@}|�d�r6t||�}t|t�r`t	|�}t|�d|��|d�q6dS)NzClass: �.)�filezInv. counter: Z_abc_z: )
�print�
__module__�__qualname__r�__dict__�
startswithr
r#rr)rr+rr
rrr�_dump_registryHs



zABCMeta._dump_registrycCs|j��dSr)r�clear�rrrr�_abc_registry_clearSszABCMeta._abc_registry_clearcCs|j��|j��dSr)rr2rr3rrr�_abc_caches_clearWs
zABCMeta._abc_caches_clearcsb|j}|�jkrdSt|�}||krH�jtjkr>|�jkr>dS��|�St�fdd�||fD��S)NTFc3s|]}��|�VqdSr)�__subclasscheck__)r�cr3rr�	<genexpr>jsz,ABCMeta.__instancecheck__.<locals>.<genexpr>)	r!rr$rrrrr6�any)r�instancer(Zsubtyperr3r�__instancecheck__\s
��
zABCMeta.__instancecheck__cCst|t�std��||jkr dS|jtjkr>t�|_tj|_n||jkrLdS|�	|�}|t
k	r�|rp|j�|�n|j�|�|S|t|dd�kr�|j�|�dS|j
D] }t||�r�|j�|�dSq�|��D] }t||�r�|j�|�dSq�|j�|�dS)Nz"issubclass() arg 1 must be a classTF�__mro__r)r#r$r%rrrrrr�__subclasshook__�NotImplementedrr
rr&�__subclasses__)rr(�okZrclsZsclsrrrr6ls8







zABCMeta.__subclasscheck__)N)�__name__r-r.rrr)r1r4r5r;r6�
__classcell__rrr rrs
rN)Z_weakrefsetrrr$rrrrr�<module>s
__pycache__/subprocess.cpython-38.opt-1.pyc000064400000122200151153537570014544 0ustar00U

e5d�1�@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZdddddd	d
ddd
ddddgZ
zddlZddlZdZWn0ek
r�dZddlZddlZddlZYn�XddlmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&e
�'dddddddddddd d!d"d#d$d%d&d'g�Gd(d�de(�Z)Gd)d
�d
e)�Z*Gd*d�de)�Z+e�r�Gd+d�d�Z,Gd,d-�d-e-�Z.n&e/ed.d/�Z0e1ed0��r�ej2Z3nej4Z3e�r�dZ5d1d2�Z6ngZ5d3d2�Z6d4Z7d5Z8d6Z9d7d8�Z:d9d:�Z;dd;�d<d�Z<d=d�Z=dd;�d>d�Z>Gd?d�de?�Z@ddddd@�dAd�ZAdBdC�ZBdDd	�ZCdEd
�ZDdFdG�ZEeE�ZFGdHd�de?�ZGdS)Ia�Subprocesses with accessible I/O streams

This module allows you to spawn processes, connect to their
input/output/error pipes, and obtain their return codes.

For a complete description of this module see the Python documentation.

Main API
========
run(...): Runs a command, waits for it to complete, then returns a
          CompletedProcess instance.
Popen(...): A class for flexibly executing a command in a new process

Constants
---------
DEVNULL: Special value that indicates that os.devnull should be used
PIPE:    Special value that indicates a pipe should be created
STDOUT:  Special value that indicates that stderr should go to stdout


Older API
=========
call(...): Runs a command, waits for it to complete, then returns
    the return code.
check_call(...): Same as call() but raises CalledProcessError()
    if return code is not 0
check_output(...): Same as check_call() but returns the contents of
    stdout instead of a return code
getoutput(...): Runs a command in the shell, waits for it to complete,
    then returns the output
getstatusoutput(...): Runs a command in the shell, waits for it to complete,
    then returns a (exitcode, output) tuple
�N)�	monotonic�Popen�PIPE�STDOUT�call�
check_call�getstatusoutput�	getoutput�check_output�run�CalledProcessError�DEVNULL�SubprocessError�TimeoutExpired�CompletedProcessTF)�CREATE_NEW_CONSOLE�CREATE_NEW_PROCESS_GROUP�STD_INPUT_HANDLE�STD_OUTPUT_HANDLE�STD_ERROR_HANDLE�SW_HIDE�STARTF_USESTDHANDLES�STARTF_USESHOWWINDOW�ABOVE_NORMAL_PRIORITY_CLASS�BELOW_NORMAL_PRIORITY_CLASS�HIGH_PRIORITY_CLASS�IDLE_PRIORITY_CLASS�NORMAL_PRIORITY_CLASS�REALTIME_PRIORITY_CLASS�CREATE_NO_WINDOW�DETACHED_PROCESS�CREATE_DEFAULT_ERROR_MODE�CREATE_BREAKAWAY_FROM_JOBrrrrrrrr�STARTUPINFOrrrrrrrr r!r"c@seZdZdS)rN)�__name__�
__module__�__qualname__�r'r'�"/usr/lib64/python3.8/subprocess.pyr`sc@s<eZdZdZd
dd�Zdd�Zedd��Zejd	d��ZdS)rz�Raised when run() is called with check=True and the process
    returns a non-zero exit status.

    Attributes:
      cmd, returncode, stdout, stderr, output
    NcCs||_||_||_||_dS�N)�
returncode�cmd�output�stderr)�selfr*r+r,r-r'r'r(�__init__jszCalledProcessError.__init__cCsh|jrT|jdkrTzd|jt�|j�fWStk
rPd|j|jfYSXnd|j|jfSdS)NrzCommand '%s' died with %r.z)Command '%s' died with unknown signal %d.z.Command '%s' returned non-zero exit status %d.)r*r+�signalZSignals�
ValueError�r.r'r'r(�__str__ps���zCalledProcessError.__str__cCs|jS)z+Alias for output attribute, to match stderr�r,r2r'r'r(�stdout|szCalledProcessError.stdoutcCs
||_dSr)r4�r.�valuer'r'r(r5�s)NN�	r$r%r&�__doc__r/r3�propertyr5�setterr'r'r'r(rcs

c@s<eZdZdZd
dd�Zdd�Zedd��Zejd	d��ZdS)rz�This exception is raised when the timeout expires while waiting for a
    child process.

    Attributes:
        cmd, output, stdout, stderr, timeout
    NcCs||_||_||_||_dSr))r+�timeoutr,r-)r.r+r<r,r-r'r'r(r/�szTimeoutExpired.__init__cCsd|j|jfS)Nz'Command '%s' timed out after %s seconds)r+r<r2r'r'r(r3�s
�zTimeoutExpired.__str__cCs|jSr)r4r2r'r'r(r5�szTimeoutExpired.stdoutcCs
||_dSr)r4r6r'r'r(r5�s)NNr8r'r'r'r(r�s

c@s,eZdZddddddd�dd�Zdd�ZdS)r#rN��dwFlags�	hStdInput�
hStdOutput�	hStdError�wShowWindow�lpAttributeListcCs0||_||_||_||_||_|p(dgi|_dS)N�handle_listr=)r.r>r?r@rArBrCr'r'r(r/�szSTARTUPINFO.__init__cCs@|j��}d|kr"t|d�|d<t|j|j|j|j|j|d�S)NrDr=)	rC�copy�listr#r>r?r@rArB)r.Z	attr_listr'r'r(rE�s
�zSTARTUPINFO.copy)r$r%r&r/rEr'r'r'r(r#�s�	c@s2eZdZdZejfdd�Zdd�Zdd�ZeZ	dS)	�HandleFcCs|jsd|_||�dS)NT)�closed)r.�CloseHandler'r'r(�Close�szHandle.ClosecCs |jsd|_t|�Std��dS)NTzalready closed)rH�intr1r2r'r'r(�Detach�sz
Handle.DetachcCsd|jjt|�fS)Nz%s(%d))�	__class__r$rKr2r'r'r(�__repr__�szHandle.__repr__N)
r$r%r&rH�_winapirIrJrLrN�__del__r'r'r'r(rG�s
rGZPIPE_BUFi�PollSelectorcCsdSr)r'r'r'r'r(�_cleanup�srRc	Cs\tdkrdStdd�D]>}|jtjd�}|dk	rzt�|�Wqtk
rTYqXqdS)N��
_deadstate)�_active�_internal_poll�sys�maxsize�remover1)�inst�resr'r'r(rR�s���������cCs*g}tjj}|dkr&|�dd|�|S)zgReturn a list of command-line arguments reproducing the current
    optimization settings in sys.flags.r�-�O)rW�flags�optimize�append)�argsr7r'r'r(�"_optim_args_from_interpreter_flagss
recCsVddddddd�}t�}|��D].\}}ttj|�}|dkr |�d	||�q tjjrd|�d
�n$tjjrv|�d�tjjr�|�d�tj	d
d
�}tjj
}ttdi�}d|k}|dkr�|�d�n|r�|�d�|r�|�d�|D]}|�d|�q�|�r
|�d�dD]B}||k�r||}	|	dk�r4|}
nd||	f}
|�d|
f��q|S)z}Return a list of command-line arguments reproducing the current
    settings in sys.flags, sys.warnoptions and sys._xoptions.�d�B�S�v�b�q)�debug�dont_write_bytecode�no_site�verbose�
bytes_warning�quietrr_z-Iz-Ez-sN�	_xoptions�dev�zerror::BytesWarningzdefault::BytesWarning�defaultz-W)�-Xrs)Zfaulthandler�tracemallocZ
importtimeZshowalloccountZshowrefcount�utf8Tz%s=%srv)
re�items�getattrrWrarc�isolated�ignore_environment�no_user_site�warnoptionsrprY�extend)Zflag_opt_maprd�flag�optriZwarnoptsrpZxoptions�dev_moder7�argr'r'r(�_args_from_interpreter_flagssP�






r��r<c
OsLt||��8}z|j|d�WW5QR�S|���YnXW5QRXdS)z�Run command with arguments.  Wait for command to complete or
    timeout, then return the returncode attribute.

    The arguments are the same as for the Popen constructor.  Example:

    retcode = call(["ls", "-l"])
    r�N)r�wait�kill)r<�	popenargs�kwargs�pr'r'r(rLscOs6t||�}|r2|�d�}|dkr(|d}t||��dS)aORun command with arguments.  Wait for command to complete.  If
    the exit code was zero then return, otherwise raise
    CalledProcessError.  The CalledProcessError object will have the
    return code in the returncode attribute.

    The arguments are the same as for the call function.  Example:

    check_call(["ls", "-l"])
    rdNr)r�getr)r�r��retcoder+r'r'r(r]s



cOsbd|krtd��d|krJ|ddkrJ|�d�s8|�d�r>d}nd}||d<t|t|d	d
�|��jS)aRun command with arguments and return its output.

    If the exit code was non-zero it raises a CalledProcessError.  The
    CalledProcessError object will have the return code in the returncode
    attribute and output in the output attribute.

    The arguments are the same as for the Popen constructor.  Example:

    >>> check_output(["ls", "-l", "/dev/null"])
    b'crw-rw-rw- 1 root root 1, 3 Oct 18  2007 /dev/null\n'

    The stdout argument is not allowed as it is used internally.
    To capture standard error in the result, use stderr=STDOUT.

    >>> check_output(["/bin/sh", "-c",
    ...               "ls -l non_existent_file ; exit 0"],
    ...              stderr=STDOUT)
    b'ls: non_existent_file: No such file or directory\n'

    There is an additional optional argument, "input", allowing you to
    pass a string to the subprocess's stdin.  If you use this argument
    you may not also use the Popen constructor's "stdin" argument, as
    it too will be used internally.  Example:

    >>> check_output(["sed", "-e", "s/foo/bar/"],
    ...              input=b"when in the course of fooman events\n")
    b'when in the course of barman events\n'

    By default, all communication is in bytes, and therefore any "input"
    should be bytes, and the return value will be bytes.  If in text mode,
    any "input" should be a string, and the return value will be a string
    decoded according to locale encoding, or by "encoding" if set. Text mode
    is triggered by setting any of text, encoding, errors or universal_newlines.
    r5z3stdout argument not allowed, it will be overridden.�inputN�universal_newlines�text��T)r5r<�check)r1r�rrr5)r<r�r��emptyr'r'r(r
ps#�c@s*eZdZdZd	dd�Zdd�Zdd�ZdS)
raEA process that has finished running.

    This is returned by run().

    Attributes:
      args: The list or str args passed to run().
      returncode: The exit code of the process, negative for signals.
      stdout: The standard output (None if not captured).
      stderr: The standard error (None if not captured).
    NcCs||_||_||_||_dSr))rdr*r5r-)r.rdr*r5r-r'r'r(r/�szCompletedProcess.__init__cCshd�|j�d�|j�g}|jdk	r4|�d�|j��|jdk	rP|�d�|j��d�t|�jd�|��S)Nz	args={!r}zreturncode={!r}zstdout={!r}zstderr={!r}z{}({})z, )	�formatrdr*r5rcr-�typer$�join)r.rdr'r'r(rN�s

�

zCompletedProcess.__repr__cCs |jrt|j|j|j|j��dS)z6Raise CalledProcessError if the exit code is non-zero.N)r*rrdr5r-r2r'r'r(�check_returncode�s�z!CompletedProcess.check_returncode)NN)r$r%r&r9r/rNr�r'r'r'r(r�s

	)r��capture_outputr<r�cOs |dk	r&|�d�dk	rtd��t|d<|r^|�d�dk	sF|�d�dk	rNtd��t|d<t|d<t||���}z|j||d�\}}Wn^tk
r�}	z,|��tr�|��\|	_|	_	n|�
��W5d}	~	XYn|���YnX|��}
|�r|
�rt|
|j
||d��W5QRXt|j
|
||�S)	aKRun command with arguments and return a CompletedProcess instance.

    The returned instance will have attributes args, returncode, stdout and
    stderr. By default, stdout and stderr are not captured, and those attributes
    will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them.

    If check is True and the exit code was non-zero, it raises a
    CalledProcessError. The CalledProcessError object will have the return code
    in the returncode attribute, and output & stderr attributes if those streams
    were captured.

    If timeout is given, and the process takes too long, a TimeoutExpired
    exception will be raised.

    There is an optional argument "input", allowing you to
    pass bytes or a string to the subprocess's stdin.  If you use this argument
    you may not also use the Popen constructor's "stdin" argument, as
    it will be used internally.

    By default, all communication is in bytes, and therefore any "input" should
    be bytes, and the stdout and stderr will be bytes. If in text mode, any
    "input" should be a string, and stdout and stderr will be strings decoded
    according to locale encoding, or by "encoding" if set. Text mode is
    triggered by setting any of text, encoding, errors or universal_newlines.

    The other arguments are the same as for the Popen constructor.
    N�stdinz/stdin and input arguments may not both be used.r5r-z@stdout and stderr arguments may not be used with capture_output.r��r,r-)r�r1rr�communicaterr��
_mswindowsr5r-r��pollrrdr)r�r�r<r�r�r�Zprocessr5r-�excr�r'r'r(r�s8�cCs�g}d}ttj|�D]�}g}|r*|�d�d|kp>d|kp>|}|rN|�d�|D]b}|dkrj|�|�qR|dkr�|�dt|�d�g}|�d�qR|r�|�|�g}|�|�qR|r�|�|�|r|�|�|�d�qd�|�S)	a�
    Translate a sequence of arguments into a command line
    string, using the same rules as the MS C runtime:

    1) Arguments are delimited by white space, which is either a
       space or a tab.

    2) A string surrounded by double quotation marks is
       interpreted as a single argument, regardless of white space
       contained within.  A quoted string can be embedded in an
       argument.

    3) A double quotation mark preceded by a backslash is
       interpreted as a literal double quotation mark.

    4) Backslashes are interpreted literally, unless they
       immediately precede a double quotation mark.

    5) If backslashes immediately precede a double quotation mark,
       every pair of backslashes is interpreted as a literal
       backslash.  If the number of backslashes is odd, the last
       backslash escapes the next double quotation mark as
       described in rule 3.
    F� �	�"�\�z\"r�)�map�os�fsdecoderc�lenrr�)�seq�resultZ	needquoter�Zbs_buf�cr'r'r(�list2cmdline	s4




r�c
Cslzt|ddtd�}d}Wn.tk
rF}z|j}|j}W5d}~XYnX|dd�dkrd|dd�}||fS)a�Return (exitcode, output) of executing cmd in a shell.

    Execute the string 'cmd' in a shell with 'check_output' and
    return a 2-tuple (status, output). The locale encoding is used
    to decode the output and process newlines.

    A trailing newline is stripped from the output.
    The exit status for the command can be interpreted
    according to the rules for the function 'wait'. Example:

    >>> import subprocess
    >>> subprocess.getstatusoutput('ls /bin/ls')
    (0, '/bin/ls')
    >>> subprocess.getstatusoutput('cat /bin/junk')
    (1, 'cat: /bin/junk: No such file or directory')
    >>> subprocess.getstatusoutput('/bin/junk')
    (127, 'sh: /bin/junk: not found')
    >>> subprocess.getstatusoutput('/bin/kill $$')
    (-15, '')
    T)�shellr�r-rNr\�
)r
rrr,r*)r+�dataZexitcodeZexr'r'r(rRscCst|�dS)a%Return output (stdout or stderr) of executing cmd in a shell.

    Like getstatusoutput(), except the exit status is ignored and the return
    value is a string containing the command's output.  Example:

    >>> import subprocess
    >>> subprocess.getoutput('ls /bin/ls')
    '/bin/ls'
    rt)r)r+r'r'r(r	qs
c
Cs�tsttd�sdStjdkr dSzjt�d�}|jdd�}t|�dkrHt�|d	}t	t
t|d�d
���}tjdkr�|dkr�|d
kr�WdSWnttt
fk
r�YnXdS)a�Check if posix_spawn() can be used for subprocess.

    subprocess requires a posix_spawn() implementation that properly reports
    errors to the parent process, & sets errno on the following failures:

    * Process attribute actions failed.
    * File actions failed.
    * exec() failed.

    Prefer an implementation which can use vfork() in some cases for best
    performance.
    �posix_spawnF�darwinT�CS_GNU_LIBC_VERSIONrt)�maxsplitr�r�.ZlinuxZglibc)r��)r��hasattrr�rW�platform�confstr�splitr�r1�tupler�rK�AttributeError�OSError)Zver�partsZlibc�versionr'r'r(�_use_posix_spawn~s 



r�c@s�eZdZdZdZdKdddd�d	d
�Zedd��Zejd
d��Zdd�Z	dd�Z
dd�Zej
ejfdd�Zdd�Zdd�ZdLdd�Zdd�Zdd�ZdMd d!�ZdNd"d#�Zd$d%�Ze�rd&d'�Zd(d)�Zd*d+�Zd,d-�Zdejej ej!fd.d/�Z"d0d1�Z#d2d3�Z$d4d5�Z%d6d7�Z&d8d9�Z'e'Z(n�d:d'�Zd;d<�Z)d=d-�Ze*j+e*j,e*j-e*j.e*j/e*j0fd>d?�Z1de*j2e*j3e4j5fd@d/�Z"dAdB�Z6dCd1�Z#dDd5�Z%dEdF�Z7dGd7�Z&dHd9�Z'dIdJ�Z(dS)Ora� Execute a child program in a new process.

    For a complete description of the arguments see the Python documentation.

    Arguments:
      args: A string, or a sequence of program arguments.

      bufsize: supplied as the buffering argument to the open() function when
          creating the stdin/stdout/stderr pipe file objects

      executable: A replacement program to execute.

      stdin, stdout and stderr: These specify the executed programs' standard
          input, standard output and standard error file handles, respectively.

      preexec_fn: (POSIX only) An object to be called in the child process
          just before the child is executed.

      close_fds: Controls closing or inheriting of file descriptors.

      shell: If true, the command will be executed through the shell.

      cwd: Sets the current directory before the child is executed.

      env: Defines the environment variables for the new process.

      text: If true, decode stdin, stdout and stderr using the given encoding
          (if set) or the system default otherwise.

      universal_newlines: Alias of text, provided for backwards compatibility.

      startupinfo and creationflags (Windows only)

      restore_signals (POSIX only)

      start_new_session (POSIX only)

      pass_fds (POSIX only)

      encoding and errors: Text mode encoding and error handling to use for
          file objects stdin, stdout and stderr.

    Attributes:
        stdin, stdout, stderr, pid, returncode
    Fr\NTrr')�encoding�errorsr�cCslt�t��|_d|_d|_|dkr(d}t|t�s:td��t	rP|dk	r�t
d��n8|rh|sht�dt
�d}|
dk	rxt
d��|d	kr�t
d
��||_d|_d|_d|_d|_d|_||_||_|dk	r�|dk	r�t|�t|�kr�td��|�|||�\}}}}}}t	�rN|dk�rt�|��d	�}|dk�r4t�|��d	�}|dk�rNt�|��d	�}|�pb|�pb|�pb||_d|_d|_|j�r�|d
k�r�d}d}nd}z�|dk�r�t� |d|�|_|j�r�tj!|jd|||d�|_|dk�rt� |d|�|_|j�rtj!|j||d�|_|dk�r:t� |d|�|_|j�r:tj!|j||d�|_|�"||||||
||
||	||||||||�Wn�t#d|j|j|jf�D]*}z|�$�Wnt%k
�r�YnX�q�|j�s`g}|t&k�r�|�'|�|t&k�r�|�'|�|t&k�r�|�'|�t(|d��r|�'|j)�|D]H}z*t	�r8t|t*��r8|�+�n
t,�$|�Wnt%k
�rZYnX�q�YnXdS)zCreate new Popen instance.NFr\zbufsize must be an integerz0preexec_fn is not supported on Windows platformszpass_fds overriding close_fds.Tz2startupinfo is only supported on Windows platformsrz4creationflags is only supported on Windows platformszlCannot disambiguate when both text and universal_newlines are supplied but different. Pass one or the other.g�?rt�wb)�
write_through�line_bufferingr�r��rb)r�r��_devnull)-rR�	threadingZLock�
_waitpid_lock�_input�_communication_started�
isinstancerK�	TypeErrorr�r1�warnings�warn�RuntimeWarningrdr�r5r-�pidr*r�r��boolr�_get_handles�msvcrtZopen_osfhandlerL�	text_mode�_sigint_wait_secs�_closed_child_pipe_fds�io�open�
TextIOWrapper�_execute_child�filter�closer�rrcr�r�rGrJr�)r.rd�bufsize�
executabler�r5r-�
preexec_fn�	close_fdsr��cwd�envr��startupinfo�
creationflags�restore_signals�start_new_session�pass_fdsr�r�r��p2cread�p2cwrite�c2pread�c2pwrite�errread�errwriter��fZto_close�fdr'r'r(r/�s�


��





�
�
��








zPopen.__init__cCs|jSr))r�r2r'r'r(r�~szPopen.universal_newlinescCst|�|_dSr))r�r�)r.r�r'r'r(r��scCs |�||�}|�dd��dd�S)Nz
r��
)�decode�replace)r.r�r�r�r'r'r(�_translate_newlines�szPopen._translate_newlinescCs|Sr)r'r2r'r'r(�	__enter__�szPopen.__enter__cCs�|jr|j��|jr |j��dz|jr4|j��W5|tkr�|jdkrrz|j|jd�Wntk
rpYnXd|_�dS|��XdS)Nrr�)	r5r�r-�KeyboardInterruptr��_waitrr�r�)r.�exc_typer7�	tracebackr'r'r(�__exit__�s 


zPopen.__exit__cCsT|js
dS|jdkr(|d|jt|d�|j|d�|jdkrPtdk	rPt�|�dS)Nzsubprocess %s is still running)�sourcerS)�_child_createdr*r��ResourceWarningrVrUrc)r.Z_maxsizeZ_warnr'r'r(rP�s

�z
Popen.__del__cCs"t|d�st�tjtj�|_|jS)Nr�)r�r�r��devnull�O_RDWRr�r2r'r'r(�_get_devnull�s
zPopen._get_devnullc
Cs�|rZz|j�|�WnDtk
r(Yn2tk
rX}z|jtjkrFn�W5d}~XYnXz|j��WnDtk
r|Yn2tk
r�}z|jtjkr�n�W5d}~XYnXdSr))r��write�BrokenPipeErrorr��errnoZEINVALr�)r.r�r�r'r'r(�_stdin_write�s"zPopen._stdin_writecCsT|jr|rtd��|dkr�|js�|j|j|jg�d�dkr�d}d}|jrT|�|�n6|jrp|j��}|j��n|jr�|j��}|j��|�	�n�|dk	r�t
�|}nd}z�z|�|||�\}}Wnhtk
�r,|dk	r�t
|j|�|��}n|j}d|_z|j|d�Wntk
�r$YnX�YnXW5d|_X|j	|�|�d�}||fS)a9Interact with process: Send data to stdin and close it.
        Read data from stdout and stderr, until end-of-file is
        reached.  Wait for process to terminate.

        The optional "input" argument should be data to be sent to the
        child process, or None, if no data should be sent to the child.
        communicate() returns a tuple (stdout, stderr).

        By default, all communication is in bytes, and therefore any
        "input" should be bytes, and the (stdout, stderr) will be bytes.
        If in text mode (indicated by self.text_mode), any "input" should
        be a string, and (stdout, stderr) will be strings decoded
        according to locale encoding, or by "encoding" if set. Text mode
        is triggered by setting any of text, encoding, errors or
        universal_newlines.
        z.Cannot send input after starting communicationNr�Trr�)r�r1r�r5r-�countr�readr�r��_time�_communicater��minr��_remaining_timer�r)r.r�r<r5r-�endtime�sigint_timeout�stsr'r'r(r��sH
�



�zPopen.communicatecCs|��S)zSCheck if child process has terminated. Set and return returncode
        attribute.)rVr2r'r'r(r�sz
Popen.pollcCs|dkrdS|t�SdS)z5Convenience for _communicate when computing timeouts.N)r)r.r	r'r'r(r"szPopen._remaining_timecCsL|dkrdS|st�|krHt|j||r0d�|�nd|r@d�|�ndd��dS)z2Convenience for checking if a timeout has expired.Nr�r�)rrrdr�)r.r	�orig_timeoutZ
stdout_seqZ
stderr_seq�skip_check_and_raiser'r'r(�_check_timeout*s�zPopen._check_timeoutcCs�|dk	rt�|}z|j|d�WStk
r�|dk	rLt|j|�|��}n|j}d|_z|j|d�Wntk
r|YnX�YnXdS)z=Wait for child process to terminate; returns self.returncode.Nr�r)rr�r�rr�rr)r.r<r	r
r'r'r(r�6s 
�z
Popen.waitc		Cs�t|dd�}t����}trX|dkr.|�|j�|dkrB|�|j�|dkr�|�|j�nr|dkr~|dkr~||kr~|�tj|�|dkr�|dkr�||kr�|�tj|�|dkr�|dkr�||kr�|�tj|�|dk	r�|�tj|�W5QRXd|_dS)Nr�r\T)	rz�
contextlib�	ExitStackr��callbackrJr�r�r�)	r.r�r�r�r�r�r�Z
devnull_fd�stackr'r'r(�_close_pipe_fdsMs$
zPopen._close_pipe_fdscCs~|dkr|dkr|dkrdSd\}}d\}}d\}}	|dkrtt�tj�}|dkr�t�dd�\}}
t|�}t�|
�nh|tkr�t�dd�\}}t|�t|�}}n<|tkr�t�	|�
��}n$t|t�r�t�	|�}nt�	|�
��}|�|�}|dk�r*t�tj�}|dk�r�t�dd�\}
}t|�}t�|
�nn|tk�rXt�dd�\}}t|�t|�}}n@|tk�rrt�	|�
��}n&t|t��r�t�	|�}nt�	|�
��}|�|�}|dk�r�t�tj�}	|	dk�rdt�dd�\}
}	t|	�}	t�|
�n~|tk�rt�dd�\}}	t|�t|	�}}	nP|tk�r$|}	n@|tk�r>t�	|�
��}	n&t|t��rVt�	|�}	nt�	|�
��}	|�|	�}	||||||	fS)�|Construct and return tuple with IO objects:
            p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite
            N)r\r\r\r\r\r\�r\r\r)rOZGetStdHandlerZ
CreatePiperGrIrr
r�Z
get_osfhandler�r�rK�fileno�_make_inheritablerrr)r.r�r5r-r�r�r�r�r�r��_r'r'r(r�nst












�zPopen._get_handlescCs&t�t��|t��ddtj�}t|�S)z2Return a duplicate of handle, which is inheritablerrt)rOZDuplicateHandleZGetCurrentProcessZDUPLICATE_SAME_ACCESSrG)r.�handle�hr'r'r(r�s�zPopen._make_inheritablecCstdd�|D��S)z�Filter out console handles that can't be used
            in lpAttributeList["handle_list"] and make sure the list
            isn't empty. This also removes duplicate handles.cSs,h|]$}|d@dks$t�|�tjkr|�qS)�)rOZGetFileTypeZFILE_TYPE_CHAR)�.0rr'r'r(�	<setcomp>�s��z,Popen._filter_handle_list.<locals>.<setcomp>)rF)r.rDr'r'r(�_filter_handle_list�szPopen._filter_handle_listcCszt|t�rnNt|t�r.|
r"td��t|g�}n,t|tj�rR|
rFtd��t|g�}nt|�}|dk	rlt�|�}|dkr|t�}n|�	�}d|||fk}|r�|j
tjO_
||_
||_||_|j}t|o�d|ko�|d�}|s�|�r^|�r^|dkr�i}|_t|�dg��}|d<|�r0|t|�t|�t|�g7}|�|�|dd�<|�r^|�sZt�dt�d}|
�r�|j
tjO_
tj|_|�s�tj�d�}|�s�tj�d	d
�}tj�|dd�}tj�|��s�t d
��tj�|��r�|}n|}d�!||�}|dk	�rt�|�}t"�#d||||�z,t�%||ddt|�|	|||�	\}}}}W5|�$|||
|||�Xd|_&t'|�|_(||_)t�*|�dS)z$Execute program (MS Windows version)z$bytes args is not allowed on Windows�0path-like args is not allowed when shell is trueNr\rDz?startupinfo.lpAttributeList['handle_list'] overriding close_fdsFZComSpecZ
SystemRootr�ZSystem32zcmd.exez:shell not found: neither %ComSpec% nor %SystemRoot% is setz
{} /c "{}"�subprocess.PopenT)+r��str�bytesr�r�r��PathLiker�r#rEr>rOrr?r@rArCr�rFr�rKrr�r�r�rrrB�environ�pathr��isabs�FileNotFoundErrorr�rW�auditrZ
CreateProcessr�rG�_handler�rI)r.rdr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�Zunused_restore_signalsZunused_start_new_sessionZuse_std_handlesZattribute_listZhave_handle_listrDZcomspecZsystem_rootZhpZhtr��tidr'r'r(r��s�


��
�
�

��
zPopen._execute_childcCs,|jdkr&||jd�|kr&||j�|_|jS)z�Check if child process has terminated.  Returns returncode
            attribute.

            This method is called by __del__, so it can only refer to objects
            in its local scope.

            Nr)r*r))r.rTZ_WaitForSingleObjectZ_WAIT_OBJECT_0Z_GetExitCodeProcessr'r'r(rVHs
zPopen._internal_pollcCs^|dkrtj}nt|d�}|jdkrXt�|j|�}|tjkrJt|j|��t�	|j�|_|jS)z-Internal implementation of wait() on Windows.Ni�)
rOZINFINITErKr*�WaitForSingleObjectr)ZWAIT_TIMEOUTrrd�GetExitCodeProcess)r.r<Ztimeout_millisr�r'r'r(r�Ys
�
zPopen._waitcCs|�|���|��dSr))rcrr�)r.Zfh�bufferr'r'r(�
_readerthreadiszPopen._readerthreadcCs\|jrBt|d�sBg|_tj|j|j|jfd�|_d|j_|j��|j	r�t|d�s�g|_
tj|j|j	|j
fd�|_d|j_|j��|jr�|�
|�|jdk	r�|j�|�|��|j��r�t|j|��|j	dk	r�|j�|�|��|j��r�t|j|��d}d}|j�r|j}|j��|j	�r0|j
}|j	��|�r>|dnd}|�rP|dnd}||fS)N�_stdout_buff)�targetrdT�_stderr_buffr)r5r�r/r�ZThreadr.Z
stdout_threadZdaemon�startr-r1Z
stderr_threadr�rr�rZis_aliverrdr�)r.r�r	rr5r-r'r'r(rnsJ
��

��







zPopen._communicatecCsl|jdk	rdS|tjkr"|��nF|tjkr>t�|jtj�n*|tjkrZt�|jtj�nt	d�
|���dS)�Send a signal to the process.NzUnsupported signal: {})r*r0�SIGTERM�	terminateZCTRL_C_EVENTr�r�r�ZCTRL_BREAK_EVENTr1r��r.Zsigr'r'r(�send_signal�s




zPopen.send_signalcCsX|jdk	rdSzt�|jd�Wn2tk
rRt�|j�}|tjkrH�||_YnXdS)zTerminates the process.Nrt)r*rOZTerminateProcessr)�PermissionErrorr,ZSTILL_ACTIVE)r.Zrcr'r'r(r5�s

zPopen.terminatec
Cs,d\}}d\}}d\}}	|dkr"n@|tkr8t��\}}n*|tkrJ|��}nt|t�rZ|}n|��}|dkrln@|tkr�t��\}}n*|tkr�|��}nt|t�r�|}n|��}|dkr�nf|tkr�t��\}}	nP|tkr�|dkr�|}	n
t	j
��}	n.|tk�r|��}	nt|t��r|}	n|��}	||||||	fS)rrNr\)rr��piper
r�r�rKrrrW�
__stdout__)
r.r�r5r-r�r�r�r�r�r�r'r'r(r��sP





�cCs�|dkrtj}i}|rJg}dD]"}
tt|
d�}|dk	r|�|�q||d<g}|||	fD]}|dkrX|�tj|f�qX|df|df|
dffD]"\}}|dkr�|�tj||f�q�|r�||d<tj|||f|�|_d	|_	|�
|||||	|
�dS)
z'Execute program using os.posix_spawn().N)�SIGPIPEZSIGXFZ�SIGXFSZZ	setsigdefr\rrtr��file_actionsT)r�r$rzr0rc�POSIX_SPAWN_CLOSE�POSIX_SPAWN_DUP2r�r�r�r)r.rdr�r�r�r�r�r�r�r�r�r�ZsigsetZsignameZsignumr=r�Zfd2r'r'r(�_posix_spawn�s<��zPopen._posix_spawnc)s�t|ttf�r|g}n(t|tj�r6|
r.td��|g}nt|�}|
rlttd�rPdnd}|dg|}�rl�|d<�dkr||d�t�	d�|||�t
�rtj����r|dk�r|�s|�s|dk�r|d	ks�|d
k�r|d	ks�|d
k�r|d	ks�|d
k�r|�s|�
|�|||||
|||�
dS�}t��\}}g}|dk�rT|�|�t�|�}�q2|D]}t�|��qX�zJz�|dk	�r�g}|��D]>\}}t�|�}d|k�r�td
��|�|dt�|���q�nd}t����tj����r�f}nt�fdd�t�|�D��}t|�}|�|�t�|||tttt|���|||||
||||||||�|_d|_W5t�|�X|� |||
|||�t!�}t�"|d�}||7}|�r�t#|�dk�r��q��q�W5t�|�X|�r�z6t�$|jd�\} }!| |jk�r�|�%|!�ntj&|_'Wnt(k
�rYnXz|�)dd
�\}"}#}$|$�*�}$Wn,tk
�rbd}"d}#d�+t|��}$YnXt,t-|"�*d�t.�}%t/|%t0��r�|#�r�t|#d�}&|$dk}'|'�r�d}$|}(n|}(|&dk�r�t�1|&�}$|%|&|$|(��|%|$��dS)zExecute program (POSIX version)rZgetandroidapilevelz/system/bin/shz/bin/shz-crNr r\r�r�=z!illegal environment variable namec3s"|]}tj�t�|���VqdSr))r�r%r��fsencode)r�dir�r�r'r(�	<genexpr>rs�z'Popen._execute_child.<locals>.<genexpr>TiP��:sSubprocessError�0z#Bad exception data from child: {!r}�ascii�Znoexecr�)2r�r!r"r�r#r�rFr�rWr(�_USE_POSIX_SPAWNr%�dirnamer@r9rc�dupr�ryrBr1r��
get_exec_path�set�add�_posixsubprocessZ	fork_exec�sortedr�rKr�r�r�	bytearrayrr��waitpid�_handle_exitstatusrXr*�ChildProcessErrorr�r�r�rz�builtinsr�
issubclassr��strerror))r.rdr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�Z
unix_shellZorig_executableZerrpipe_readZ
errpipe_writeZlow_fds_to_closeZlow_fdZenv_list�kriZexecutable_listZfds_to_keepZerrpipe_data�partr�rZexception_nameZ	hex_errno�err_msgZchild_exception_typeZ	errno_numZchild_exec_never_calledZerr_filenamer'rDr(r� s"	��
�����������	�
�





�
�
�
��
�


cCsL||�r||�|_n2||�r*||�|_n||�r@||�|_ntd��dS)�:All callers to this function MUST hold self._waitpid_lock.zUnknown child exit status!N)r*r)r.rZ_WIFSIGNALEDZ	_WTERMSIGZ
_WIFEXITEDZ_WEXITSTATUSZ_WIFSTOPPEDZ	_WSTOPSIGr'r'r(rT�szPopen._handle_exitstatusc
Cs�|jdkr�|j�d�sdSz�z>|jdk	r4|jWW�pS||j|�\}}||jkrX|�|�WnBtk
r�}z$|dk	r|||_n|j|kr�d|_W5d}~XYnXW5|j��X|jS)z�Check if child process has terminated.  Returns returncode
            attribute.

            This method is called by __del__, so it cannot reference anything
            outside of the local scope (nor can any methods it calls).

            NFr)r*r��acquire�releaser�rTr�r)r.rTZ_waitpidZ_WNOHANGZ_ECHILDr�r�er'r'r(rV�s 	



cCs>zt�|j|�\}}Wntk
r4|j}d}YnX||fS)r\r)r�rSr�rU)r.Z
wait_flagsr�rr'r'r(�	_try_wait�s
zPopen._try_waitc	Cs|jdk	r|jS|dk	r�t�|}d}|j�d�r~z>|jdk	rDW�0q�|�tj�\}}||jkrn|�	|�W�q�W5|j��X|�
|�}|dkr�t|j|��t
|d|d�}t�|�q&n\|jdk�r|j�B|jdk	r�W5QR��q|�d�\}}||jk�r
|�	|�W5QRXq�|jS)z+Internal implementation of wait() on POSIX.Ng����Mb@?Frr�g�������?)r*rr�r]r^r`r��WNOHANGr�rTrrrdr�time�sleep)r.r<r	Zdelayr�rZ	remainingr'r'r(r��s6







c
Cs"|jrX|jsXz|j��Wntk
r.YnX|sXz|j��Wntk
rVYnXd}d}|js�i|_|jr~g|j|j<|jr�g|j|j<|jr�|j|j}|jr�|j|j}|�|�|j	r�t
|j	�}t����}|jr�|r�|�|jt
j�|j�r|jj�s|�|jt
j�|j�r6|jj�s6|�|jt
j�|���r�|�|�}|dk	�rz|dk�rz|j||||dd�td��|�|�}	|�||||�|	D]�\}
}|
j|jk�r6||j|jt�}z|jt�|
j|�7_Wn,tk
�r
|�|
j�|
j��Yn*X|jt|j	�k�r�|�|
j�|
j��nP|
j|j|jfk�r�t�|
jd�}
|
�st|�|
j�|
j��|j|
j�|
��q��q6W5QRX|j |�|�d�|dk	�r�d�!|�}|dk	�r�d�!|�}|j"�r|dk	�r�|�#||jj$|jj%�}|dk	�r|�#||jj$|jj%�}||fS)NrT)r
zN_check_timeout(..., skip_check_and_raise=True) failed to raise TimeoutExpired.i�r�r�)&r�r��flushrr�Z_fileobj2outputr5r-�_save_inputr��
memoryview�_PopenSelector�register�	selectorsZEVENT_WRITErHZ
EVENT_READZget_maprr�RuntimeError�selectZfileobj�
_input_offset�	_PIPE_BUFr�r�r�Z
unregisterr�rrcr�r�r�r�r�r�)r.r�r	rr5r-Z
input_viewZselectorr<Zready�keyZevents�chunkr�r'r'r(r's�





��
�
$




�
�cCsF|jrB|jdkrBd|_||_|dk	rB|jrB|j�|jj|jj�|_dS)Nr)r�r�rlr��encoder�r�)r.r�r'r'r(re�s�zPopen._save_inputcCs|jdkrt�|j|�dS)r3N)r*r�r�r�r6r'r'r(r7�s
cCs|�tj�dS)z/Terminate the process with SIGTERM
            N)r7r0r4r2r'r'r(r5�scCs|�tj�dS)z*Kill the process with SIGKILL
            N)r7r0�SIGKILLr2r'r'r(r��sz
Popen.kill)r\NNNNNTFNNNNrTFr')NN)F)N)8r$r%r&r9r�r/r:r�r;r�r�r�rWrXr�r�rPr�rr�r�rrr�rr�r�rrr�rOr+Z
WAIT_OBJECT_0r,rVr�r.rr7r5r�r@r��WIFSIGNALED�WTERMSIG�	WIFEXITED�WEXITSTATUS�
WIFSTOPPED�WSTOPSIGrTrSrarZECHILDr`rer'r'r'r(r�s�-��


D	�

H	
|�
26'�
�
#
)f)Hr9rVrr�r�rbr0rWr�r�rrr�__all__r�rOr��ModuleNotFoundErrorrPrkrirrrrrrrrrrrrrrrr r!r"r�	Exceptionrrrr#rKrGrzrmr�rQrgZSelectSelectorrUrRrrr
rer�rrr
�objectrrr�rr	r�rJrr'r'r'r(�<module>
s�"�P
�
%	


;3"�EI
/__pycache__/codecs.cpython-38.opt-2.pyc000064400000043730151153537570013627 0ustar00U

e5d;��,@s�ddlZddlZzddlTWn.ek
rJZzede��W5dZ[XYnXdddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/g,Zd0Zd1ZZ	d2Z
Zd3Zd4Z
ejd5kr�e	ZZeZneZZe
Ze	ZeZeZe
ZGd6d�de�ZGd7d�d�ZGd8d�de�ZGd9d:�d:e�ZGd;d�de�ZGd<d=�d=e�ZGd>d�de�ZGd?d�de�ZGd@d�d�Z GdAd�d�Z!d[dEd�Z"d\dFd�Z#dGd�Z$dHd�Z%dId �Z&dJd!�Z'dKd"�Z(dLd#�Z)d]dMd&�Z*d^dNd'�Z+dOdP�Z,dQdR�Z-z4e.dC�Z/e.dS�Z0e.dT�Z1e.dU�Z2e.dV�Z3e.dW�Z4Wn.e5k
�r\dZ/dZ0dZ1dZ2dZ3dZ4YnXdZ6e6�rpddl7Z7e8dXk�r�e#ej9dYdZ�e_9e#ej:dZdY�e_:dS)_�N)�*z%Failed to load the builtin codecs: %s�register�lookup�open�EncodedFile�BOM�BOM_BE�BOM_LE�BOM32_BE�BOM32_LE�BOM64_BE�BOM64_LE�BOM_UTF8�	BOM_UTF16�BOM_UTF16_LE�BOM_UTF16_BE�	BOM_UTF32�BOM_UTF32_LE�BOM_UTF32_BE�	CodecInfo�Codec�IncrementalEncoder�IncrementalDecoder�StreamReader�StreamWriter�StreamReaderWriter�
StreamRecoder�
getencoder�
getdecoder�getincrementalencoder�getincrementaldecoder�	getreader�	getwriter�encode�decode�
iterencode�
iterdecode�
strict_errors�
ignore_errors�replace_errors�xmlcharrefreplace_errors�backslashreplace_errors�namereplace_errors�register_error�lookup_errorss��s��s��s���littlec@s(eZdZdZddd�dd�Zdd�ZdS)	rTN)�_is_text_encodingc
CsPt�|||||f�}	||	_||	_||	_||	_||	_||	_||	_|dk	rL||	_	|	S�N)
�tuple�__new__�namer#r$�incrementalencoder�incrementaldecoder�streamwriter�streamreaderr0)
�clsr#r$r8r7r5r6r4r0�self�r;�/usr/lib64/python3.8/codecs.pyr3^szCodecInfo.__new__cCsd|jj|jj|jt|�fS)Nz%<%s.%s object for encoding %s at %#x>)�	__class__�
__module__�__qualname__r4�id�r:r;r;r<�__repr__ms��zCodecInfo.__repr__)NNNNN)�__name__r>r?r0r3rBr;r;r;r<rSs	��c@s eZdZddd�Zddd�ZdS)	r�strictcCst�dSr1��NotImplementedError�r:�input�errorsr;r;r<r#�szCodec.encodecCst�dSr1rErGr;r;r<r$�szCodec.decodeN)rD)rD)rCr>r?r#r$r;r;r;r<rrs
c@s8eZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
S)rrDcCs||_d|_dS�N�)rI�buffer�r:rIr;r;r<�__init__�szIncrementalEncoder.__init__FcCst�dSr1rE�r:rH�finalr;r;r<r#�szIncrementalEncoder.encodecCsdSr1r;rAr;r;r<�reset�szIncrementalEncoder.resetcCsdS�Nrr;rAr;r;r<�getstate�szIncrementalEncoder.getstatecCsdSr1r;�r:�stater;r;r<�setstate�szIncrementalEncoder.setstateN)rD)F)rCr>r?rNr#rQrSrVr;r;r;r<r�s


c@s@eZdZddd�Zdd�Zddd�Zd	d
�Zdd�Zd
d�ZdS)�BufferedIncrementalEncoderrDcCst�||�d|_dSrJ)rrNrLrMr;r;r<rN�sz#BufferedIncrementalEncoder.__init__cCst�dSr1rE�r:rHrIrPr;r;r<�_buffer_encode�sz)BufferedIncrementalEncoder._buffer_encodeFcCs0|j|}|�||j|�\}}||d�|_|Sr1)rLrYrI�r:rHrP�data�result�consumedr;r;r<r#�s
z!BufferedIncrementalEncoder.encodecCst�|�d|_dSrJ)rrQrLrAr;r;r<rQ�s
z BufferedIncrementalEncoder.resetcCs
|jpdSrR�rLrAr;r;r<rS�sz#BufferedIncrementalEncoder.getstatecCs|pd|_dSrJr^rTr;r;r<rV�sz#BufferedIncrementalEncoder.setstateN)rD)F)	rCr>r?rNrYr#rQrSrVr;r;r;r<rW�s

rWc@s8eZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
S)rrDcCs
||_dSr1)rIrMr;r;r<rNszIncrementalDecoder.__init__FcCst�dSr1rErOr;r;r<r$szIncrementalDecoder.decodecCsdSr1r;rAr;r;r<rQszIncrementalDecoder.resetcCsdS)N)�rr;rAr;r;r<rSszIncrementalDecoder.getstatecCsdSr1r;rTr;r;r<rV'szIncrementalDecoder.setstateN)rD)F)rCr>r?rNr$rQrSrVr;r;r;r<r�s



c@s@eZdZddd�Zdd�Zddd�Zd	d
�Zdd�Zd
d�ZdS)�BufferedIncrementalDecoderrDcCst�||�d|_dS�Nr_)rrNrLrMr;r;r<rN5sz#BufferedIncrementalDecoder.__init__cCst�dSr1rErXr;r;r<�_buffer_decode:sz)BufferedIncrementalDecoder._buffer_decodeFcCs0|j|}|�||j|�\}}||d�|_|Sr1)rLrbrIrZr;r;r<r$?s
z!BufferedIncrementalDecoder.decodecCst�|�d|_dSra)rrQrLrAr;r;r<rQGs
z BufferedIncrementalDecoder.resetcCs
|jdfSrRr^rAr;r;r<rSKsz#BufferedIncrementalDecoder.getstatecCs|d|_dSrRr^rTr;r;r<rVOsz#BufferedIncrementalDecoder.setstateN)rD)F)	rCr>r?rNrbr$rQrSrVr;r;r;r<r`/s

r`c@sTeZdZddd�Zdd�Zdd�Zdd	�Zddd�Zefd
d�Z	dd�Z
dd�ZdS)rrDcCs||_||_dSr1)�streamrI�r:rcrIr;r;r<rN\szStreamWriter.__init__cCs"|�||j�\}}|j�|�dSr1)r#rIrc�write)r:�objectr[r]r;r;r<reuszStreamWriter.writecCs|�d�|��dSrJ)re�join�r:�listr;r;r<�
writelines|szStreamWriter.writelinescCsdSr1r;rAr;r;r<rQ�s
zStreamWriter.resetrcCs*|j�||�|dkr&|dkr&|��dSrR�rc�seekrQ�r:�offset�whencer;r;r<rl�szStreamWriter.seekcCs||j|�Sr1�rc�r:r4�getattrr;r;r<�__getattr__�szStreamWriter.__getattr__cCs|Sr1r;rAr;r;r<�	__enter__�szStreamWriter.__enter__cCs|j��dSr1�rc�close�r:�type�value�tbr;r;r<�__exit__�szStreamWriter.__exit__N)rD)r)rCr>r?rNrerjrQrlrrrsrtr{r;r;r;r<rZs

�
c@s�eZdZeZddd�Zd dd�Zd!dd	�Zd"dd
�Zd#dd�Z	dd�Z
d$dd�Zdd�Zdd�Z
efdd�Zdd�Zdd�Zd
S)%rrDcCs.||_||_d|_|��|_|j|_d|_dSra)rcrI�
bytebuffer�charbuffertype�_empty_charbuffer�
charbuffer�
linebufferrdr;r;r<rN�s
zStreamReader.__init__cCst�dSr1rErGr;r;r<r$�szStreamReader.decode���Fc
CsN|jr|j�|j�|_d|_|dkr(|}|dkrBt|j�|krB�q|dkrV|j��}n|j�|�}|j|}|st�qz|�||j	�\}}Wn`t
k
r�}zB|r�|�|d|j�|j	�\}}|jdd�}	t|	�dkrڂn�W5d}~XYnX||d�|_|j|7_|s(�qq(|dk�r,|j}
|j|_n|jd|�}
|j|d�|_|
S)NrT��keepends�)
r�r~rgr�lenrc�readr|r$rI�UnicodeDecodeError�start�
splitlines)r:�size�chars�	firstline�newdatar[�newchars�decodedbytes�exc�linesr\r;r;r<r��sD
�

zStreamReader.readNTc	Cs�|jrP|jd}|jd=t|j�dkr8|jd|_d|_|sL|jdd�d}|S|pVd}|j}|j|dd�}|r�t|t�r�|�d�s�t|t	�r�|�d	�r�||jddd
�7}||7}|jdd�}|�r�t|�dk�r8|d}|d=t|�dk�r|d|j7<||_d|_n|d|j|_|�s�|jdd�d}�q�|d}|djdd�d}||k�r�|j�
|dd��|j|_|�r�|}n|}�q�|�r�|dk	�r�|�r�|�s�|jdd�d}�q�|dkr^|d
9}q^|S)Nrr�Fr��HT)r��
�
)r�r�r�i@�)r�r�rr�r~r��
isinstance�str�endswith�bytesrg)	r:r�r��line�readsizer[r��line0withend�line0withoutendr;r;r<�readlinesd
��
�
zStreamReader.readlinecCs|��}|�|�Sr1)r�r�)r:�sizehintr�r[r;r;r<�	readlines^szStreamReader.readlinescCsd|_|j|_d|_dSra)r|r~rr�rAr;r;r<rQms	zStreamReader.resetrcCs|j�||�|��dSr1rkrmr;r;r<rlzszStreamReader.seekcCs|��}|r|St�dSr1)r��
StopIteration)r:r�r;r;r<�__next__�szStreamReader.__next__cCs|Sr1r;rAr;r;r<�__iter__�szStreamReader.__iter__cCs||j|�Sr1rprqr;r;r<rs�szStreamReader.__getattr__cCs|Sr1r;rAr;r;r<rt�szStreamReader.__enter__cCs|j��dSr1rurwr;r;r<r{�szStreamReader.__exit__)rD)rD)r�r�F)NT)NT)r)rCr>r?r�r}rNr$r�r�r�rQrlr�r�rrrsrtr{r;r;r;r<r�s


P
K

�
c@s�eZdZdZd dd�Zd!dd�Zd"d	d
�Zd#dd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zd$dd�Z
efdd�Zdd�Zdd�ZdS)%r�unknownrDcCs(||_|||�|_|||�|_||_dSr1)rc�reader�writerrI)r:rc�Reader�WriterrIr;r;r<rN�s
zStreamReaderWriter.__init__r�cCs|j�|�Sr1)r�r��r:r�r;r;r<r��szStreamReaderWriter.readNcCs|j�|�Sr1)r�r�r�r;r;r<r��szStreamReaderWriter.readlinecCs|j�|�Sr1)r�r�)r:r�r;r;r<r��szStreamReaderWriter.readlinescCs
t|j�Sr1)�nextr�rAr;r;r<r��szStreamReaderWriter.__next__cCs|Sr1r;rAr;r;r<r��szStreamReaderWriter.__iter__cCs|j�|�Sr1)r�re)r:r[r;r;r<re�szStreamReaderWriter.writecCs|j�|�Sr1)r�rjrhr;r;r<rj�szStreamReaderWriter.writelinescCs|j��|j��dSr1�r�rQr�rAr;r;r<rQ�s
zStreamReaderWriter.resetrcCs6|j�||�|j��|dkr2|dkr2|j��dSrR)rcrlr�rQr�rmr;r;r<rl�s
zStreamReaderWriter.seekcCs||j|�Sr1rprqr;r;r<rs�szStreamReaderWriter.__getattr__cCs|Sr1r;rAr;r;r<rt�szStreamReaderWriter.__enter__cCs|j��dSr1rurwr;r;r<r{�szStreamReaderWriter.__exit__)rD)r�)N)N)r)rCr>r?�encodingrNr�r�r�r�r�rerjrQrlrrrsrtr{r;r;r;r<r�s




�
	c@s�eZdZdZdZd dd�Zd!dd�Zd"d	d
�Zd#dd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
d$dd�Zefdd�Zdd�Zdd�ZdS)%rr�rDcCs4||_||_||_|||�|_|||�|_||_dSr1)rcr#r$r�r�rI)r:rcr#r$r�r�rIr;r;r<rNszStreamRecoder.__init__r�cCs"|j�|�}|�||j�\}}|Sr1)r�r�r#rI�r:r�r[�bytesencodedr;r;r<r�#szStreamRecoder.readNcCs6|dkr|j��}n|j�|�}|�||j�\}}|Sr1)r�r�r#rIr�r;r;r<r�)s
zStreamRecoder.readlinecCs(|j��}|�||j�\}}|jdd�S)NTr�)r�r�r#rIr�)r:r�r[r�r;r;r<r�2s
zStreamRecoder.readlinescCs t|j�}|�||j�\}}|Sr1)r�r�r#rI)r:r[r�r;r;r<r�8s
zStreamRecoder.__next__cCs|Sr1r;rAr;r;r<r�?szStreamRecoder.__iter__cCs|�||j�\}}|j�|�Sr1)r$rIr�re)r:r[�bytesdecodedr;r;r<reBszStreamRecoder.writecCs(d�|�}|�||j�\}}|j�|�Sra)rgr$rIr�re)r:rir[r�r;r;r<rjGs
zStreamRecoder.writelinescCs|j��|j��dSr1r�rAr;r;r<rQMs
zStreamRecoder.resetrcCs |j�||�|j�||�dSr1)r�rlr�rmr;r;r<rlRszStreamRecoder.seekcCs||j|�Sr1rprqr;r;r<rsXszStreamRecoder.__getattr__cCs|Sr1r;rAr;r;r<rt_szStreamRecoder.__enter__cCs|j��dSr1rurwr;r;r<r{bszStreamRecoder.__exit__)rD)r�)N)N)r)rCr>r?�
data_encoding�
file_encodingrNr�r�r�r�r�rerjrQrlrrrsrtr{r;r;r;r<r�s"�


	

�
�rrDr�cCst|dk	rd|kr|d}t�|||�}|dkr2|Sz&t|�}t||j|j|�}||_|WS|���YnXdS)N�b)�builtinsrrrr8r7r�rv)�filename�moder�rI�	buffering�file�info�srwr;r;r<rgs�cCsF|dkr|}t|�}t|�}t||j|j|j|j|�}||_||_|Sr1)rrr#r$r8r7r�r�)r�r�r�rI�	data_info�	file_info�srr;r;r<r�s�cCs
t|�jSr1)rr#�r�r;r;r<r�scCs
t|�jSr1)rr$r�r;r;r<r�scCst|�j}|dkrt|��|Sr1)rr5�LookupError)r��encoderr;r;r<r�s	
cCst|�j}|dkrt|��|Sr1)rr6r�)r��decoderr;r;r<r �s	
cCs
t|�jSr1)rr8r�r;r;r<r!�scCs
t|�jSr1)rr7r�r;r;r<r"�scksHt|�|f|�}|D]}|�|�}|r|Vq|�dd�}|rD|VdS)NrKT)rr#)�iteratorr�rI�kwargsr�rH�outputr;r;r<r%s	
cksHt|�|f|�}|D]}|�|�}|r|Vq|�dd�}|rD|VdS)Nr_T)r r$)r�r�rIr�r�rHr�r;r;r<r&s	
cCsdd�|D�S)NcSsi|]
}||�qSr;r;)�.0�ir;r;r<�
<dictcomp>/sz&make_identity_dict.<locals>.<dictcomp>r;)�rngr;r;r<�make_identity_dict'sr�cCs4i}|��D]"\}}||kr&|||<qd||<q|Sr1)�items)�decoding_map�m�k�vr;r;r<�make_encoding_map1s


r��ignore�replace�xmlcharrefreplace�backslashreplace�namereplace�__main__zlatin-1zutf-8)r�NrDr�)NrD)rD)rD);r��sys�_codecs�ImportErrorZwhy�SystemError�__all__rr	rrrrr�	byteorderrrrrr
r
rr2rrrfrrWrr`rrrrrrrrrr r!r"r%r&r�r�r.r'r(r)r*r+r,r��_falseZ	encodingsrC�stdout�stdinr;r;r;r<�<module>
s��
B("1+IzWt
0
&








__pycache__/token.cpython-38.pyc000064400000004667151153537570012555 0ustar00U

e5d@	�0@s�dZddddgZdZdZdZdZd	Zd
ZdZdZ	d
Z
dZdZdZ
dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZd Zd!Zd"Zd#Z d$Z!d%Z"d&Z#d'Z$d(Z%d)Z&d*Z'd+Z(d,Z)d-Z*d.Z+d/Z,d0Z-d1Z.d2Z/d3Z0d4Z1d5Z2d6Z3d7Z4d8Z5d9Z6d:Z7d;Z8d<Z9d=Z:d>Z;d?Z<d@Z=dAZ>dBZ?dCZ@dDZAdEZBdFdG�eC��D�D�ZEe�FeE�G��eee*ee+e	e
ee%e0e(ee&eee'e5ee6ee1e2e)e
e7eee#e.eeeee e$e/e3e4eee"e-eee,ee!dH�/ZHdId�ZIdJd�ZJdKd�ZKdLS)MzToken constants.�tok_name�
ISTERMINAL�
ISNONTERMINAL�ISEOF����������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�cCs*i|]"\}}t|t�r|�d�s||�qS)�_)�
isinstance�int�
startswith)�.0�name�value�rM�/usr/lib64/python3.8/token.py�
<dictcomp>Js


�rO)/z!=�%z%=�&z&=�(�)�*z**z**=z*=�+z+=�,�-z-=z->�.z...�/z//z//=z/=�:z:=�;�<z<<z<<=z<=�=z==�>z>=z>>z>>=�@z@=�[�]�^z^=�{�|z|=�}�~cCs|tkS�N��	NT_OFFSET��xrMrMrNr�scCs|tkSrgrhrjrMrMrNr�scCs|tkSrg)�	ENDMARKERrjrMrMrNr�sN)L�__doc__�__all__rl�NAME�NUMBER�STRING�NEWLINE�INDENT�DEDENT�LPAR�RPAR�LSQB�RSQB�COLON�COMMA�SEMI�PLUS�MINUS�STAR�SLASH�VBAR�AMPER�LESS�GREATER�EQUAL�DOT�PERCENT�LBRACE�RBRACE�EQEQUAL�NOTEQUAL�	LESSEQUAL�GREATEREQUAL�TILDE�
CIRCUMFLEX�	LEFTSHIFT�
RIGHTSHIFT�
DOUBLESTAR�	PLUSEQUAL�MINEQUAL�	STAREQUAL�
SLASHEQUAL�PERCENTEQUAL�
AMPEREQUAL�	VBAREQUAL�CIRCUMFLEXEQUAL�LEFTSHIFTEQUAL�RIGHTSHIFTEQUAL�DOUBLESTAREQUAL�DOUBLESLASH�DOUBLESLASHEQUAL�AT�ATEQUAL�RARROW�ELLIPSIS�
COLONEQUAL�OP�AWAIT�ASYNC�TYPE_IGNORE�TYPE_COMMENT�
ERRORTOKEN�COMMENT�NL�ENCODING�N_TOKENSri�globals�itemsr�extend�values�EXACT_TOKEN_TYPESrrrrMrMrMrN�<module>s���2__pycache__/zipimport.cpython-38.pyc000064400000041575151153537570013471 0ustar00U

e5d-x�@sRdZddlZddlmZmZddlZddlZddlZddl	Z	ddl
Z
ddlZddgZej
Z
ejdd�ZGdd�de�ZiZee
�ZdZd	Zd
ZGdd�d�Ze
dd
d
fe
ddd
fddfZdd�Zdd�Zdd�Zdd�ZdZdadd�Z dd�Z!dd �Z"d!d"�Z#ee#j$�Z%d#d$�Z&d%d&�Z'd'd(�Z(d)d*�Z)d+d,�Z*d-d.�Z+Gd/d0�d0�Z,dS)1aPzipimport provides support for importing Python modules from Zip archives.

This module exports three objects:
- zipimporter: a class; its constructor takes a path to a Zip archive.
- ZipImportError: exception raised by zipimporter objects. It's a
  subclass of ImportError, so it can be caught as ImportError, too.
- _zip_directory_cache: a dict, mapping archive paths to zip directory
  info dicts, as used in zipimporter._files.

It is usually not needed to use the zipimport module explicitly; it is
used by the builtin import mechanism for sys.path items that are paths
to Zip archives.
�N)�_unpack_uint16�_unpack_uint32�ZipImportError�zipimporter�c@seZdZdS)rN)�__name__�
__module__�__qualname__�r
r
�!/usr/lib64/python3.8/zipimport.pyr!s�sPKi��c@sleZdZdZdd�Zddd�Zddd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)ra�zipimporter(archivepath) -> zipimporter object

    Create a new zipimporter instance. 'archivepath' must be a path to
    a zipfile, or to a specific path inside a zipfile. For example, it can be
    '/tmp/myimport.zip', or '/tmp/myimport.zip/mydirectory', if mydirectory is a
    valid directory inside the archive.

    'ZipImportError is raised if 'archivepath' doesn't point to a valid Zip
    archive.

    The 'archive' attribute of zipimporter objects contains the name of the
    zipfile targeted.
    c	Cs$t|t�sddl}|�|�}|s,td|d��tr<|�tt�}g}zt�	|�}WnHt
tfk
r�t�|�\}}||kr�td|d��|}|�
|�Yq@X|jd@dkr�td|d��q�q@zt|}Wn$tk
r�t|�}|t|<YnX||_||_tj|ddd��|_|j�r |jt7_dS)Nrzarchive path is empty��pathznot a Zip filei�i����)�
isinstance�str�os�fsdecoder�alt_path_sep�replace�path_sep�_bootstrap_external�
_path_stat�OSError�
ValueError�_path_split�append�st_mode�_zip_directory_cache�KeyError�_read_directory�_files�archive�
_path_join�prefix)�selfrrr$�st�dirname�basename�filesr
r
r�__init__?s:

zzipimporter.__init__NcCsNt||�}|dk	r|gfSt||�}t||�rFd|j�t�|��gfSdgfS)a�find_loader(fullname, path=None) -> self, str or None.

        Search for a module specified by 'fullname'. 'fullname' must be the
        fully qualified (dotted) module name. It returns the zipimporter
        instance itself if the module was found, a string containing the
        full path name if it's possibly a portion of a namespace package,
        or None otherwise. The optional 'path' argument is ignored -- it's
        there for compatibility with the importer protocol.
        N)�_get_module_info�_get_module_path�_is_dirr"r)r%�fullnamer�mi�modpathr
r
r�find_loaderms



zzipimporter.find_loadercCs|�||�dS)a�find_module(fullname, path=None) -> self or None.

        Search for a module specified by 'fullname'. 'fullname' must be the
        fully qualified (dotted) module name. It returns the zipimporter
        instance itself if the module was found, or None if it wasn't.
        The optional 'path' argument is ignored -- it's there for compatibility
        with the importer protocol.
        r)r1)r%r.rr
r
r�find_module�s	zzipimporter.find_modulecCst||�\}}}|S)z�get_code(fullname) -> code object.

        Return the code object for the specified module. Raise ZipImportError
        if the module couldn't be found.
        ��_get_module_code�r%r.�code�	ispackager0r
r
r�get_code�szzipimporter.get_codecCsvtr|�tt�}|}|�|jt�r:|t|jt�d�}z|j|}Wn tk
rhtdd|��YnXt	|j|�S)z�get_data(pathname) -> string with file data.

        Return the data associated with 'pathname'. Raise OSError if
        the file wasn't found.
        Nr�)
rrr�
startswithr"�lenr!rr�	_get_data)r%�pathname�key�	toc_entryr
r
r�get_data�szzipimporter.get_datacCst||�\}}}|S)zjget_filename(fullname) -> filename string.

        Return the filename for the specified module.
        r3r5r
r
r�get_filename�szzipimporter.get_filenamecCs�t||�}|dkr$td|��|d��t||�}|r@t�|d�}n
|�d�}z|j|}Wntk
rnYdSXt|j|��	�S)z�get_source(fullname) -> source string.

        Return the source code for the specified module. Raise ZipImportError
        if the module couldn't be found, return None if the archive does
        contain the module, but has no source for it.
        N�can't find module ��name�__init__.py�.py)
r+rr,rr#r!rr<r"�decode)r%r.r/r�fullpathr?r
r
r�
get_source�s


zzipimporter.get_sourcecCs(t||�}|dkr$td|��|d��|S)z�is_package(fullname) -> bool.

        Return True if the module specified by fullname is a package.
        Raise ZipImportError if the module couldn't be found.
        NrBrC)r+r)r%r.r/r
r
r�
is_package�s
zzipimporter.is_packagecCs�t||�\}}}tj�|�}|dks.t|t�s@t|�}|tj|<||_zT|rlt||�}t�	|j
|�}|g|_t|d�s|t
|_
t�|j||�t||j�Wntj|=�YnXztj|}Wn$tk
r�td|�d���YnXt�d||�|S)z�load_module(fullname) -> module.

        Load the module specified by 'fullname'. 'fullname' must be the
        fully qualified (dotted) module name. It returns the imported
        module, or raises ZipImportError if it wasn't found.
        N�__builtins__zLoaded module z not found in sys.moduleszimport {} # loaded from Zip {})r4�sys�modules�getr�_module_type�
__loader__r,rr#r"�__path__�hasattrrK�_fix_up_module�__dict__�execr�ImportError�
_bootstrap�_verbose_message)r%r.r6r7r0�modrrHr
r
r�load_module�s0


zzipimporter.load_modulecCsXz|�|�sWdSWntk
r*YdSXtjsNddlm}|�t�dt_t||�S)z�Return the ResourceReader for a package in a zip file.

        If 'fullname' is a package within the zip file, return the
        'ResourceReader' object for the package.  Otherwise return None.
        Nr)�ResourceReaderT)rJr�_ZipImportResourceReader�_registered�
importlib.abcr[�register)r%r.r[r
r
r�get_resource_readers


zzipimporter.get_resource_readercCsd|j�t�|j�d�S)Nz<zipimporter object "z">)r"rr$)r%r
r
r�__repr__"szzipimporter.__repr__)N)N)rrr	�__doc__r*r1r2r8r@rArIrJrZr`rar
r
r
rr-s.
 


&z__init__.pycTrEF)z.pycTF)rFFFcCs|j|�d�dS)N�.�)r$�
rpartition)r%r.r
r
rr,4sr,cCs|t}||jkS�N)rr!)r%r�dirpathr
r
rr-8sr-cCs8t||�}tD]$\}}}||}||jkr|SqdSrf)r,�_zip_searchorderr!)r%r.r�suffix�
isbytecoder7rHr
r
rr+As


r+c	Cs�zt�|�}Wn&tk
r4td|��|d��YnX|���z$|�td�|��}|�t�}Wn&tk
r�td|��|d��YnXt|�tkr�td|��|d��|dd�t	k�r�z|�dd�|��}Wn&tk
r�td|��|d��YnXt
|ttd�}z|�|�|��}Wn(tk
�rJtd|��|d��YnX|�t	�}|dk�rrtd|��|d��|||t�}t|�tk�r�td|��|d��|t|�|}t
|d	d
��}t
|d
d��}	||k�r�td|��|d��||	k�r
td
|��|d��||8}||	}
|
dk�r6td|��|d��i}d}z|�|�Wn(tk
�rttd|��|d��YnX|�d�}t|�dk�r�td��|dd�dk�r��q�t|�dk�r�td��t|dd��}
t|dd	��}t|d	d��}t|dd
��}t
|d
d��}t
|dd��}t
|dd��}t|dd��}t|dd��}t|dd��}t
|dd��}|||}||	k�r�td|��|d��||
7}z|�|�}Wn(tk
�r�td|��|d��YnXt|�|k�r�td|��|d��z2t|�||��||k�r*td|��|d��Wn(tk
�rTtd|��|d��YnX|
d@�rj|��}n6z|�d�}Wn&tk
�r�|�d��t�}YnX|�dt�}t�||�}||||||||f}|||<|d 7}�qvW5QRXt�d!||�|S)"Nzcan't open Zip file: r
rd�can't read Zip file: �rznot a Zip file: zcorrupt Zip file: ���zbad central directory size: zbad central directory offset: z&bad central directory size or offset: �.�EOF read where not expectedsPK��
����� �"�*zbad local header offset: i�ascii�latin1�/rz!zipimport: found {} names in {!r})�_io�	open_coderr�seek�END_CENTRAL_DIR_SIZE�tell�readr;�STRING_END_ARCHIVE�max�MAX_COMMENT_LEN�rfindr�EOFErrorrrG�UnicodeDecodeError�	translate�cp437_tablerrrr#rWrX)r"�fp�header_position�buffer�	file_size�max_comment_start�data�pos�header_size�
header_offset�
arc_offsetr)�count�flags�compress�time�date�crc�	data_size�	name_size�
extra_size�comment_size�file_offsetrDr�tr
r
rr `s�
���

�


�
�






r u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ cCsltrt�d�td��daz<zddlm}Wn&tk
rRt�d�td��YnXW5daXt�d�|S)Nzzipimport: zlib UNAVAILABLE�)can't decompress data; zlib not availableTFr��
decompresszzipimport: zlib available)�_importing_zlibrWrXr�zlibr��	Exceptionr�r
r
r�_get_decompress_func�s


r�c	Cs�|\}}}}}}}}	|dkr$td��t�|���}
z|
�|�Wn&tk
rftd|��|d��YnX|
�d�}t|�dkr�td��|dd�dkr�td	|��|d��t|d
d��}t|dd��}
d||
}||7}z|
�|�Wn(tk
�rtd|��|d��YnX|
�|�}t|�|k�r4td��W5QRX|dk�rL|Sz
t	�}Wnt
k
�rttd
��YnX||d�S)Nrznegative data sizerkr
rwrqrlsPKzbad local file header: �rvzzipimport: can't read datar�i�)rr~rr�rr�r;r�rr�r�)r"r?�datapathr�r�r�r�r�r�r�r�r�r�r�r��raw_datar�r
r
rr<s>



r<cCst||�dkS)Nr)�abs)�t1�t2r
r
r�	_eq_mtimeAsr�cCs<||d�}zt�|||�}Wntk
r2YdSX|d@dk}|r�|d@dk}tjdkr�|shtjdkr�t||�}	|	dk	r�t�tj|	�}
zt�||
||�Wntk
r�YdSXnTt	||�\}}|�r
t
t|dd��|�r�t|dd	��|k�r
t�
d
|���dSt�|d	d��}
t|
t��s8td|�d���|
S)
N)rDrrrrd�never�alwaysrrrmrnzbytecode is stale for zcompiled module z is not a code object)r�
_classify_pycrV�_imp�check_hash_based_pycs�_get_pyc_source�source_hash�_RAW_MAGIC_NUMBER�_validate_hash_pyc�_get_mtime_and_size_of_sourcer�rrWrX�marshal�loadsr�
_code_type�	TypeError)r%r=rHr.r��exc_detailsr��
hash_based�check_source�source_bytesr��source_mtime�source_sizer6r
r
r�_unmarshal_codeKsX�
��
��
���r�cCs|�dd�}|�dd�}|S)Ns
�
�
)r)�sourcer
r
r�_normalize_line_endings~sr�cCst|�}t||ddd�S)NrUT)�dont_inherit)r��compile)r=r�r
r
r�_compile_source�sr�cCsDt�|d?d|d?d@|d@|d?|d?d@|d@dd	d	d	f	�S)
N�	i������?rdr)r��mktime)�dr�r
r
r�_parse_dostime�s



�r�c
CstzR|dd�dkst�|dd�}|j|}|d}|d}|d}t||�|fWStttfk
rnYdSXdS)Nr��c�or���)rr)�AssertionErrorr!r�r�
IndexErrorr�)r%rr?r�r��uncompressed_sizer
r
rr��s
r�cCsV|dd�dkst�|dd�}z|j|}Wntk
rDYdSXt|j|�SdS)Nrr�)r�r!rr<r")r%rr?r
r
rr��sr�c	Cs�t||�}tD]�\}}}||}tjd|jt|dd�z|j|}Wntk
rXYqX|d}t|j|�}	|r�t	|||||	�}
n
t
||	�}
|
dkr�q|d}|
||fSqtd|��|d��dS)Nz
trying {}{}{}rd)�	verbosityrrBrC)r,rhrWrXr"rr!rr<r�r�r)r%r.rrirjr7rHr?r0r�r6r
r
rr4�s$

r4c@s<eZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
S)r\z�Private class used to support ZipImport.get_resource_reader().

    This class is allowed to reference all the innards and private parts of
    the zipimporter.
    FcCs||_||_dSrf)rr.)r%rr.r
r
rr*�sz!_ZipImportResourceReader.__init__cCs\|j�dd�}|�d|��}ddlm}z||j�|��WStk
rVt|��YnXdS)Nrcr}r)�BytesIO)r.r�ior�rr@r�FileNotFoundError)r%�resource�fullname_as_pathrr�r
r
r�
open_resource�sz&_ZipImportResourceReader.open_resourcecCst�dSrf)r�)r%r�r
r
r�
resource_path�sz&_ZipImportResourceReader.resource_pathcCsH|j�dd�}|�d|��}z|j�|�Wntk
rBYdSXdS)Nrcr}FT)r.rrr@r)r%rDr�rr
r
r�is_resource�sz$_ZipImportResourceReader.is_resourcec		cs�ddlm}||j�|j��}|�|jj�}|jdks:t�|j	}t
�}|jjD]f}z||��|�}Wntk
r|YqNYnX|j	j}t
|�dkr�|jVqN||krN|�|�|VqNdS)Nr)�PathrE)�pathlibr�rrAr.�relative_tor"rDr��parent�setr!rr;�add)	r%r��
fullname_path�
relative_path�package_path�subdirs_seen�filename�relative�parent_namer
r
r�contents�s"


z!_ZipImportResourceReader.contentsN)
rrr	rbr]r*r�r�r�r�r
r
r
rr\�s	r\)-rb�_frozen_importlib_externalrrr�_frozen_importlibrWr�r~r�rLr��__all__r�path_separatorsrrVrr�typerOr�r�r�rrhr,r-r+r r�r�r�r<r�r��__code__r�r�r�r�r�r�r4r\r
r
r
r�<module>sX�		~�.
.

__pycache__/locale.cpython-38.opt-2.pyc000064400000072574151153537570013636 0ustar00U

e5do1�M@s*ddlZddlZddlZddlZddlZddlmZddlZddddddd	d
ddd
ddddddddddddgZ	dd�Z
dd�ZzddlTWnLe
k
r�dZd Zd!ZdZd"Zd#Zd$Zd%ZeZd&d	�Z�d�d'd�ZYnXde�kr�eZd
e�kr�e
ZeZiZe�e�d(d	��Zd)d*�Z �d�d,d-�Z!d.d/�Z"e�#d0�Z$�d�d1d2�Z%�d�d3d�Z&�d�d4d�Z'�d�d6d�Z(d7d�Zd8d9�Z)e*fd:d
�Z+d;d�Z,d<d=�Z-eZ.d>d?�Z/d@dA�Z0dBd�Z1dCdD�Z2dEdF�Z3�d�dHd�Z4efdId�Z5�d�dJd�ZefdKd�Z6ej7�8dL��r�d�dMd�Z9nRze:Wn<e;k
�rLe<edN��r<�d�dOd�Z9n�d�dPd�Z9YnX�d�dQd�Z9dRdRdSdTdTdUdVdWdXdYdSdZd[d\dSdSdSd]d^d_d`d\dadZdbdcd[dddedfdgdTdhdidUdjdkdldmdndodWdXdYdp�,Z=e>e=�?��D]"\Z@ZAe@�Bdqdr�Z@e=�Ce@eA��q�dsdsdsdtdudvdwdwdxdydzdzd{d|d}d~d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d~d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�dRd�dRdRd{d�dRdRd�d�d�d�d�d�d�d�d{d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d{d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d{d�d�d�d�d�d�d�d{d�d{dRd{d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d̐d�d�d�d�d�d�d�d�d�d�d�d�d�d	�d	�d
�dd��d�d
�d
�d
�d
�d
�d�d
�d�d�d�d�d�d�d�d�dd�d�d�d��d�d�d�dd͐d�d�d�d�d�d�d�d�d�d�d�d�d�dd�d�d��d�d�d �d �d �d!�d"�d#�d$�d%�d&�d&�d'�d(�d&�d&�d%�d%d{d�d{d�d{d�d)�d*�d)�d)�d+�d+�d+�d�d�d,�d-�d-�d-�d.�d.�d-�d-�d-�d-�d-�d/�d/�d/�d0�d/�d1�d2�d3�d3�d4�d5�d5�d6�d6�d6�d7�d6�d6�d8�d8�d9�d:�d;�d;�d<�d<�d=�d>�d?�d@�dA�dB�dC�dD�dD�dE�dE�dD�dB�dB�dF�dF�dG�dH�dI�dI�dJ�dK�dL�dM�dN�dN�dO�dP�dQ�dQ�dR�dR�dS�dT�dU�dU�dV�dV�dW�dW�dX�dYd�d��dZ�d[�d\�d]�d^�d_dǐd`d�dǐda�da�db�dc�db�db�db�db�dd�dd�de�de�dc�dc�da�df�df�dg�dh�di�di�dj�dk�dk�dl�dm�dn�do�dp�dq�dp�dr�dr�ds�ds�ds�dt�dudRdR�dv�dv�dw�dt�du�dt�dx�dy�dz�dz�dz�d{�d{�d|�dz�d}�d~�d~�d�d��d��d��d��d��d��d��d��d��d��d��d�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d�d�d�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d�d��d��d��d��d��d��d��d��d��d��dddddÐdÐdĐdĐdŐdƐdǐdȐdȐdɐdɐdʐdːd�d��d͐d�d��dϐdϐdАdѐd�d�d��dҐdҐdӐ�LZD�dԐdՐd֐dאdؐdِdڐdېdܐdݐdސdߐd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d��d��d��d��d��d��d��d��d��d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d �d!�d"�d#�d$�d%�d&�d'�d(�d)�d*�d+�d,�d-�d-�d.�d/�d0�d1�d2�d3�d4�d5�d6�d7�d8�d9�d:�d;�d<�d=�d>�d?�d@�dA�dB�dC�dD�dE�dF�dG�dH�dI�dJ�dK�dL�dM�dN�dO�dP�dQ�dR�dS�dT�dU�dV�dW�dX�dY�dZ�d[�d\�d]�d^�d_�d`�da�db�dc�dd�de�df�de�df�dg�dh�di�dj�dk�dl�dm�dl�dn�do�dp�dq�dr�ds�dt�du�dv�dw�dx�dy�dz�d{�d|�d}�d~�d�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d���ZE�d��d��ZFzeWne;k
�
r�YnXe	�G�d��eH�d�k�r&eI�d��eI�eF�eI�eI�d��eI�e-�dS(��N)�str�	getlocale�getdefaultlocale�getpreferredencoding�Error�	setlocale�resetlocale�
localeconv�strcoll�strxfrmr�atof�atoi�format�
format_string�currency�	normalize�LC_CTYPE�
LC_COLLATE�LC_TIME�LC_MONETARY�
LC_NUMERIC�LC_ALL�CHAR_MAXcCs||k||kS�N�)�a�brr�/usr/lib64/python3.8/locale.py�_strcoll!srcCs|Srr)�srrr�_strxfrm'sr )�*�������cCs,dgddddgddddddddddddd�S)Nr"��.)�grouping�currency_symbol�n_sign_posn�
p_cs_precedes�
n_cs_precedes�mon_grouping�n_sep_by_space�
decimal_point�
negative_sign�
positive_sign�p_sep_by_space�int_curr_symbol�p_sign_posn�
thousands_sep�mon_thousands_sep�frac_digits�mon_decimal_point�int_frac_digitsrrrrrr	?s&�cCs|dkrtd��dS)N)Nr)�Cz*_locale emulation only supports "C" localer=)r)�category�valuerrrrWscCst�}tr|�t�|Sr)�_localeconv�_override_localeconv�update)�drrrr	ls
ccsJd}|D]<}|tkrdS|dkr:|dkr2td��|Vq2|V|}qdS)Nrzinvalid grouping)r�
ValueError)r+Z
last_interval�intervalrrr�_grouping_intervalszsrFFc
Cs�t�}||rdpd}||r dp"d}|s2|dfS|ddkr\|��}|t|�d�}|}nd}d}g}t|�D]B}	|r�|dd	kr�|}d}q�|�||	d��|d|	�}qp|r�|�|�|��||�|�|t|�t|�d
fS)Nr9r8r0r+r���� r)�
0123456789r')r	�rstrip�lenrF�append�reverse�join)
r�monetary�convr8r+�strippedZright_spacesZleft_spaces�groupsrErrr�_group�s2
�rScCsdd}|r&||dkr&|d7}|d8}qt|�d}|rT||dkrT|d8}|d8}q2|||d�S)NrrHr')rK)rZamountZlposZrposrrr�_strip_padding�s

rTzG%(?:\((?P<key>.*?)\))?(?P<modifiers>[-#0-9 +*.hlL]*?)[eEfFgGdiouxXcrs%]c	Gs�|r||f|}n||}|ddkr~d}|�d�}|rRt|d|d�\|d<}t�|r^dp`d}|�|�}|r�t||�}n2|ddkr�d}|r�t||d�\}}|r�t||�}|S)	NrGZeEfFgGrr*�rOr;r2Zdiu)�splitrSr	rNrT)	�percentr?r+rO�
additionalZ	formattedZseps�partsr2rrr�_format�s*
�

rZc
	Cs
tt�|��}t�d|�}t|tj�rjg}|D]8}|��ddkrN|�d�q.|�t	|��|||��q.n�t|t
�sz|f}g}d}|D]r}|��ddkr�|�d�q�|�d��d�}	|�t	|��||||f||d|d|	����|d|	7}q�t
|�}||S)Nz%srG�%rZ	modifiersr!r')�list�_percent_re�finditer�sub�
isinstance�_collections_abc�Mapping�grouprLrZ�tuple�count)
�f�valr+rOZpercentsZnew_fZnew_valZperc�iZ	starcountrrrr�s4
��cGs^ddl}|jdtdd�t�|�}|r:t|���t|�krJtdt|���t	||||f|��S)Nrz`This method will be removed in a future version of Python. Use 'locale.format_string()' instead.r()�
stacklevelzHformat() must be given exactly one %%char format specifier, %s not valid)
�warnings�warn�DeprecationWarningr]�matchrKrcrD�reprrZ)rWr?r+rOrXrjrmrrrr�s�
�TcCsft�}||rdpd}|dkr&td��td|t|�|dd�}d|d	}|r�||rXd
pZd}||dkrld
pnd}||dkr�dp�d}	|r�||	r�dp�d|}n||	r�dp�d|}||dkr�dp�d}
||dkr�dp�d}|
dkr�d|d}n`|
dk�r||}nL|
dk�r||}n8|
dk�r2|�d|�}n |
dk�rJ|�d	|�}n||}|�dd��d	d�S)Nr<r:r"z9Currency formatting is not possible using the 'C' locale.z%%.%ifTrU�<�>r6r,rr/r.r1r5rHr)r-r7r3r4�(�)r'r(r$r&)r	rDrZ�abs�replace)rgZsymbolr+Z
internationalrPZdigitsrZsmbZprecedesZ	separatedZsign_posZsignrrrrs6





cCs
td|�S)Nz%.12g)rZ)rgrrrr0scCs:t�}|d}|r|�|d�}|d}|r6|�|d�}|S)Nr8r)r2r*)r	rt)�stringrP�tsZddrrr�
delocalize4srwcCs|t|��Sr)rw)ru�funcrrrrDscCstt|��Sr)�intrw)rurrrr
HscCsBttd�tddd�}t|dt|��td�}t|dt|��dS)Nr)z%di�[r'�isg��Q�	@)rrr�printr
rr)�s1rrr�_testLs

r}cCs�d|kr|d|�d��}n|}t�|�}tjj�|��|�}|}|��}|tkr\t|}n(|�dd�}|�dd�}|tkr�t|}|d|S)Nr*�_r)�-)�index�	encodings�normalize_encoding�aliases�get�lower�locale_encoding_aliasrt)�code�encoding�langname�
norm_encodingrrr�_replace_encoding^s 
�
r�cCsR|dkrFd|kr|dS|�d�\}}}|dkr4|S|dkrFt|d�S|d|S)N�euror*z.ISO8859-15)�
ISO8859-15�UTF-8�	ISO8859-1r��@)�	partitionr�)r��modifierr~r�rrr�_append_modifierus
r�c	Cs�|��}d|kr|�dd�}d|kr6|�dd�\}}nd}d|krZ|�d�dd�\}}n|}d}|}|r�|�dd�}|�dd�}|d|7}|}|r�|d|7}t�|d�}|dk	r�|S|�rt�|d�}|dk	�rd|kr�t||�S|�dd�d��|k�r|S|�r�|}|�r"|d|7}t�|d�}|dk	�rnd|k�rLt||�S|�dd�\}}t||�d|S|�r�t�|d�}|dk	�r�d|k�r�t||�}t||�S|�dd�\}}|��|k�r�t||�d|S|S)	N�:r*r�r'r)r(rr~)r�rtrV�locale_aliasr�r�r�)	�
localenamer�r�r�r�Zlang_encr�Zlookup_nameZdefmodrrrr�s`








cCs~t|�}d|kr8|�dd�\}}|dkr8d|kr8|dfSd|krVt|�d�dd��S|dkrbdS|d	krnd
Std|��dS)Nr�r'r�r*�iso-8859-15r(r=)NNr��Nr�zunknown locale: %s)rrVrdrD)r�r�r�rrr�_parse_localename�sr�c	Cs\z4|\}}|dkrd}|dkr$|WS|d|WSWn"ttfk
rVtd�d�YnXdS)Nr=r*zXLocale must be None, a string, or an iterable of two strings -- language code, encoding.)�	TypeErrorrD)ZlocaletupleZlanguager�rrr�_build_localename�s�r��rrZLANG�LANGUAGEc	Cs�zddl}|��\}}Wnttfk
r0Yn8Xtjdkr`|r`|dd�dkr`t�t|d��}||fSddl	}|j
j}|D],}||d�}|r||dkr�|�d�d}q�q|d}t|�S)NrZwin32r(Z0xr�r�r=)
�_localeZ_getdefaultlocale�ImportError�AttributeError�sys�platform�windows_localer�ry�os�environrVr�)Zenvvarsr�r�r�r��lookupZvariabler�rrrr
s$
cCs(t|�}|tkr d|kr td��t|�S)N�;z category LC_ALL is not supported)�
_setlocalerr�r�)r>r�rrrr?s
cCs$|rt|t�stt|��}t||�Sr)r`�_builtin_strrr�r�)r>ZlocalerrrrQscCst|tt���dSr)r�r�r)r>rrrrbs�wincCstjjrdSddl}|�d�S)Nr�rF)r��flags�	utf8_mode�_bootlocaler)�do_setlocaler�rrrrnsZgetandroidapilevelcCsdSr�r)r�rrrr|scCs&tjjrdSt�d}|dkr"d}|S)Nr�r'�ascii)r�r�r�r)r��resrrrr�s
cCs`tjjrdSddl}|rDtt�}zttd�Wntk
rBYnX|�d�}|r\tt|�|S)Nr�rr)F)r�r�r�r�rrrr)r�r�Zoldloc�resultrrrr�s

r=r�ZJIS7ZeucJPzKOI8-CZCP1251ZCP1255ZCP1256z	ISO8859-2z	ISO8859-5r�z
ISO8859-10z
ISO8859-11z
ISO8859-13z
ISO8859-14z
ISO8859-16z	ISO8859-3z	ISO8859-4z	ISO8859-6z	ISO8859-7z	ISO8859-8z	ISO8859-9ZSJISZTACTISZeucKRr�zKOI8-RzKOI8-TzKOI8-UZRK1048),�437�c�enZjisZjis7ZajecZkoi8cZmicrosoftcp1251Zmicrosoftcp1255Zmicrosoftcp1256Z88591Z88592Z88595Z885915r��latin_1�	iso8859_1�
iso8859_10�
iso8859_11�
iso8859_13�
iso8859_14�
iso8859_15�
iso8859_16�	iso8859_2�	iso8859_3�	iso8859_4�	iso8859_5�	iso8859_6�	iso8859_7�	iso8859_8�	iso8859_9�
iso2022_jp�	shift_jis�tactis�euc_jp�euc_kr�utf_8�koi8_rZkoi8_tZkoi8_u�kz1048�cp1251�cp1255�cp1256r~r)zaz_AZ.KOI8-Czaa_DJ.ISO8859-1zaa_ER.UTF-8zaa_ET.UTF-8zaf_ZA.ISO8859-1zagr_PE.UTF-8zak_GH.UTF-8zam_ET.UTF-8zen_US.ISO8859-1zan_ES.ISO8859-15zanp_IN.UTF-8zar_AA.ISO8859-6zar_AE.ISO8859-6zar_BH.ISO8859-6zar_DZ.ISO8859-6zar_EG.ISO8859-6zar_IN.UTF-8zar_IQ.ISO8859-6zar_JO.ISO8859-6zar_KW.ISO8859-6zar_LB.ISO8859-6zar_LY.ISO8859-6zar_MA.ISO8859-6zar_OM.ISO8859-6zar_QA.ISO8859-6zar_SA.ISO8859-6zar_SD.ISO8859-6zar_SS.UTF-8zar_SY.ISO8859-6zar_TN.ISO8859-6zar_YE.ISO8859-6zas_IN.UTF-8zast_ES.ISO8859-15zayc_PE.UTF-8zaz_AZ.ISO8859-9Ezaz_IR.UTF-8zbe_BY.CP1251zbe_BY.UTF-8@latinzbg_BG.UTF-8zbem_ZM.UTF-8zber_DZ.UTF-8zber_MA.UTF-8zbg_BG.CP1251zbhb_IN.UTF-8zbho_IN.UTF-8zbho_NP.UTF-8zbi_VU.UTF-8zbn_BD.UTF-8zbn_IN.UTF-8zbo_CN.UTF-8zbo_IN.UTF-8znb_NO.ISO8859-1zbr_FR.ISO8859-1zbrx_IN.UTF-8zbs_BA.ISO8859-2zbyn_ER.UTF-8zfr_CA.ISO8859-1zen_US.UTF-8zca_ES.ISO8859-1zca_AD.ISO8859-1zca_ES.UTF-8@valenciazca_FR.ISO8859-1zca_IT.ISO8859-1zce_RU.UTF-8zzh_CN.eucCNzzh_TW.eucTWzchr_US.UTF-8zckb_IQ.UTF-8zcmn_TW.UTF-8zcrh_UA.UTF-8zhr_HR.ISO8859-2zcs_CZ.ISO8859-2zcsb_PL.UTF-8zcv_RU.UTF-8zcy_GB.ISO8859-1zda_DK.ISO8859-1zde_DE.ISO8859-1zde_AT.ISO8859-1zde_BE.ISO8859-1zde_CH.ISO8859-1zde_IT.ISO8859-1zde_LI.UTF-8zde_LU.ISO8859-1zdoi_IN.UTF-8znl_NL.ISO8859-1znl_BE.ISO8859-1zdv_MV.UTF-8zdz_BT.UTF-8zee_EE.ISO8859-4zet_EE.ISO8859-1zel_GR.ISO8859-7zel_CY.ISO8859-7zel_GR.ISO8859-15zen_AG.UTF-8zen_AU.ISO8859-1zen_BE.ISO8859-1zen_BW.ISO8859-1zen_CA.ISO8859-1zen_DK.ISO8859-1zen_DL.UTF-8zen_GB.ISO8859-1zen_HK.ISO8859-1zen_IE.ISO8859-1zen_IL.UTF-8zen_IN.ISO8859-1zen_NG.UTF-8zen_NZ.ISO8859-1zen_PH.ISO8859-1zen_SC.UTF-8zen_SG.ISO8859-1zen_US.ISO8859-15zen_ZA.ISO8859-1zen_ZM.UTF-8zen_ZW.ISO8859-1zen_ZS.UTF-8zen_EN.ISO8859-1zeo_XX.ISO8859-3zeo.UTF-8zeo_EO.ISO8859-3zeo_US.UTF-8zes_ES.ISO8859-1zes_AR.ISO8859-1zes_BO.ISO8859-1zes_CL.ISO8859-1zes_CO.ISO8859-1zes_CR.ISO8859-1zes_CU.UTF-8zes_DO.ISO8859-1zes_EC.ISO8859-1zes_GT.ISO8859-1zes_HN.ISO8859-1zes_MX.ISO8859-1zes_NI.ISO8859-1zes_PA.ISO8859-1zes_PE.ISO8859-1zes_PR.ISO8859-1zes_PY.ISO8859-1zes_SV.ISO8859-1zes_US.ISO8859-1zes_UY.ISO8859-1zes_VE.ISO8859-1zet_EE.ISO8859-15zeu_ES.ISO8859-1zeu_FR.ISO8859-1zfa_IR.UTF-8zfa_IR.ISIRI-3342zff_SN.UTF-8zfi_FI.ISO8859-15zfil_PH.UTF-8zfi_FI.ISO8859-1zfo_FO.ISO8859-1zfr_FR.ISO8859-1zfr_BE.ISO8859-1zfr_CH.ISO8859-1zfr_LU.ISO8859-1zfur_IT.UTF-8zfy_DE.UTF-8zfy_NL.UTF-8zga_IE.ISO8859-1zgl_ES.ISO8859-1zgd_GB.ISO8859-1zgez_ER.UTF-8zgez_ET.UTF-8zgu_IN.UTF-8zgv_GB.ISO8859-1zha_NG.UTF-8zhak_TW.UTF-8zhe_IL.ISO8859-8zhi_IN.ISCII-DEVzhif_FJ.UTF-8zhne_IN.UTF-8zhsb_DE.ISO8859-2zht_HT.UTF-8zhu_HU.ISO8859-2zhy_AM.UTF-8zhy_AM.ARMSCII_8zia.UTF-8zia_FR.UTF-8zis_IS.ISO8859-1zid_ID.ISO8859-1zig_NG.UTF-8zik_CA.UTF-8zit_IT.ISO8859-1zit_CH.ISO8859-1ziu_CA.NUNACOM-8ziw_IL.UTF-8zja_JP.eucJPz
ja_JP.SJISzka_GE.GEORGIAN-ACADEMYzka_GE.GEORGIAN-PSzkab_DZ.UTF-8z
kk_KZ.ptcp154zkl_GL.ISO8859-1zkm_KH.UTF-8zkn_IN.UTF-8zko_KR.eucKRzkok_IN.UTF-8zks_IN.UTF-8zks_IN.UTF-8@devanagarizku_TR.ISO8859-9zkw_GB.ISO8859-1zky_KG.UTF-8zlb_LU.UTF-8zlg_UG.ISO8859-10zli_BE.UTF-8zli_NL.UTF-8zlij_IT.UTF-8zlt_LT.ISO8859-13zln_CD.UTF-8zlo_LA.MULELAO-1zlo_LA.IBM-CP1133zlv_LV.ISO8859-13zlzh_TW.UTF-8zmag_IN.UTF-8zmai_IN.UTF-8zmai_NP.UTF-8zmfe_MU.UTF-8zmg_MG.ISO8859-15zmhr_RU.UTF-8zmi_NZ.ISO8859-1zmiq_NI.UTF-8zmjw_IN.UTF-8zmk_MK.ISO8859-5zml_IN.UTF-8zmn_MN.UTF-8zmni_IN.UTF-8zmr_IN.UTF-8zms_MY.ISO8859-1zmt_MT.ISO8859-3zmy_MM.UTF-8znan_TW.UTF-8znds_DE.UTF-8znds_NL.UTF-8zne_NP.UTF-8znhn_MX.UTF-8zniu_NU.UTF-8zniu_NZ.UTF-8znl_AW.UTF-8znn_NO.ISO8859-1zno_NO.ISO8859-1zny_NO.ISO8859-1znr_ZA.ISO8859-1znso_ZA.ISO8859-15zoc_FR.ISO8859-1zom_ET.UTF-8zom_KE.ISO8859-1zor_IN.UTF-8zos_RU.UTF-8zpa_IN.UTF-8zpa_PK.UTF-8zpap_AN.UTF-8zpap_AW.UTF-8zpap_CW.UTF-8zpd_US.ISO8859-1zpd_DE.ISO8859-1zph_PH.ISO8859-1zpl_PL.ISO8859-2zpt_PT.ISO8859-1zpt_BR.ISO8859-1zpp_AN.ISO8859-1zps_AF.UTF-8zquz_PE.UTF-8zraj_IN.UTF-8zro_RO.ISO8859-2zru_RU.UTF-8zru_UA.KOI8-Uzru_RU.KOI8-Rzrw_RW.ISO8859-1zsa_IN.UTF-8zsat_IN.UTF-8zsc_IT.UTF-8zsd_IN.UTF-8zsd_IN.UTF-8@devanagarizsd_PK.UTF-8zse_NO.UTF-8zsr_RS.UTF-8@latinzsgs_LT.UTF-8zsr_CS.ISO8859-2zsh_HR.ISO8859-2zshn_MM.UTF-8zshs_CA.UTF-8zsi_LK.UTF-8zsid_ET.UTF-8zsk_SK.ISO8859-2zsl_SI.ISO8859-2zsl_CS.ISO8859-2zsm_WS.UTF-8zso_DJ.ISO8859-1zso_ET.UTF-8zso_KE.ISO8859-1zso_SO.ISO8859-1zsr_CS.ISO8859-5zsq_AL.ISO8859-2zsq_MK.UTF-8zsr_RS.UTF-8zsr_CS.UTF-8@latinzsr_CS.UTF-8zsr_ME.UTF-8zsr_CS.CP1251zss_ZA.ISO8859-1zst_ZA.ISO8859-1zsv_SE.ISO8859-1zsv_FI.ISO8859-1zsw_KE.UTF-8zsw_TZ.UTF-8zszl_PL.UTF-8z
ta_IN.TSCII-0zta_LK.UTF-8ztcy_IN.UTF-8zte_IN.UTF-8ztg_TJ.KOI8-Czth_TH.ISO8859-11zth_TH.TIS620zthe_NP.UTF-8zti_ER.UTF-8zti_ET.UTF-8ztig_ER.UTF-8ztk_TM.UTF-8ztl_PH.ISO8859-1ztn_ZA.ISO8859-15zto_TO.UTF-8ztpi_PG.UTF-8ztr_TR.ISO8859-9ztr_CY.ISO8859-9zts_ZA.ISO8859-1ztt_RU.TATAR-CYRztt_RU.UTF-8@iqtelifzug_CN.UTF-8zuk_UA.KOI8-Uz	en_US.utfzunm_US.UTF-8zur_PK.CP1256zur_IN.UTF-8zuz_UZ.UTF-8zve_ZA.UTF-8z
vi_VN.TCVNzvi_VN.VISCIIzwa_BE.ISO8859-1zwae_CH.UTF-8zwal_ET.UTF-8zwo_SN.UTF-8zxh_ZA.ISO8859-1zyi_US.CP1255zyo_NG.UTF-8zyue_HK.UTF-8zyuw_PG.UTF-8zzh_CN.gb2312z
zh_TW.big5zzh_HK.big5hkscszzh_SG.GB2312z	zh_SG.GBKzzu_ZA.ISO8859-1(LZa3Za3_azz
a3_az.koicZaa_djZaa_erZaa_etZafZaf_zaZagr_peZak_ghZamZam_etZamericanZan_esZanp_inZarZar_aaZar_aeZar_bhZar_dzZar_egZar_inZar_iqZar_joZar_kwZar_lbZar_lyZar_maZar_omZar_qaZar_saZar_sdZar_ssZar_syZar_tnZar_ye�arabic�asZas_inZast_esZayc_peZazZaz_azzaz_az.iso88599eZaz_irZbezbe@latinz
be_bg.utf8Zbe_byzbe_by@latinZbem_zmZber_dzZber_maZbgZbg_bgzbhb_in.utf8Zbho_inZbho_npZbi_vuZbn_bdZbn_inZbo_cnZbo_inZbokmalubokmål�brZbr_frZbrx_inZbsZbs_baZ	bulgarianZbyn_err�zc-frenchzc.asciizc.enz
c.iso88591zc.utf8Zc_czc_c.cZcaZca_adZca_eszca_es@valenciaZca_frZca_itZcatalanZce_ruZcextendz	chinese-sz	chinese-tZchr_usZckb_iqZcmn_twZcrh_uaZcroatianZcsZcs_csZcs_czZcsb_plZcv_ruZcyZcy_gbZczZcz_czZczechZdaZda_dkZdanishZdanskZdeZde_atZde_beZde_chZde_deZde_itz
de_li.utf8Zde_luZdeutschZdoi_inZdutchzdutch.iso88591Zdv_mvZdz_btZeeZee_eeZeestiZelZel_cyZel_grz
el_gr@euror�Zen_agZen_auZen_beZen_bwZen_caZen_dkz
en_dl.utf8Zen_gbZen_hkZen_ieZen_ilZen_inZen_ngZen_nzZen_phz
en_sc.utf8Zen_sgZen_ukZen_uszen_us@euro@euroZen_zaZen_zmZen_zwz
en_zw.utf8Zeng_gbZenglishzenglish.iso88591Z
english_ukzenglish_united-stateszenglish_united-states.437Z
english_usZeozeo.utf8Zeo_eoz
eo_us.utf8Zeo_xxZesZes_arZes_boZes_clZes_coZes_crZes_cuZes_doZes_ecZes_esZes_gtZes_hnZes_mxZes_niZes_paZes_peZes_prZes_pyZes_svZes_usZes_uyZes_veZestonianZetZet_eeZeuZeu_esZeu_frZfaZfa_irzfa_ir.isiri3342Zff_snZfiZfi_fiZfil_phZfinnishZfoZfo_fo�frZfr_beZfr_caZfr_chZfr_frZfr_luu	françaisZfre_frZfrenchzfrench.iso88591Z
french_franceZfur_itZfy_deZfy_nlZgaZga_ieZgalegoZgalicianZgdZgd_gbZger_deZgermanzgerman.iso88591Zgerman_germanyZgez_erZgez_etZglZgl_es�greekZgu_inZgvZgv_gbZha_ngZhak_twZheZhe_il�hebrew�hiZhi_inzhi_in.isciidevZhif_fjZhneZhne_inZhrZhr_hrZhrvatskiZhsb_deZht_htZhuZhu_huZ	hungarianZhy_amzhy_am.armscii8ZiaZia_frZ	icelandic�idZid_idZig_ngZik_ca�inZin_idrzZis_isz
iso-8859-1r�z	iso8859-1z
iso8859-15�
iso_8859_1�iso_8859_15�itZit_chZit_itZitalianZiuZiu_caziu_ca.nunacom8ZiwZiw_ilz
iw_il.utf8ZjaZja_jpz	ja_jp.euczja_jp.mscodez	ja_jp.pckZjapanZjapanesezjapanese-euczjapanese.eucZjp_jpZkaZka_gezka_ge.georgianacademyzka_ge.georgianpszka_ge.georgianrsZkab_dzZkk_kzZklZkl_glZkm_khZknZkn_inZkoZko_krz	ko_kr.eucZkok_in�koreanz
korean.eucZksZks_inzks_in@devanagari.utf8Zku_tr�kwZkw_gbZkyZky_kgZlb_luZlg_ugZli_beZli_nlZlij_itZ
lithuanianZln_cd�loZlo_lazlo_la.cp1133zlo_la.ibmcp1133zlo_la.mulelao1�ltZlt_ltZlvZlv_lvZlzh_twZmag_inZmaiZmai_inZmai_npZmfe_muZmg_mgZmhr_ru�miZmi_nzZmiq_niZmjw_inZmkZmk_mkZmlZml_inZmn_mnZmni_inZmrZmr_inZmsZms_myZmtZmt_mtZmy_mmZnan_twZnbZnb_noZnds_deZnds_nlZne_npZnhn_mxZniu_nuZniu_nz�nlZnl_awZnl_beZnl_nlZnnZnn_noZnoz
no@nynorskZno_nozno_no.iso88591@bokmalzno_no.iso88591@nynorskZ	norwegianZnrZnr_zaZnsoZnso_zaZnyZny_noZnynorskZocZoc_frZom_etZom_ke�orZor_inZos_ruZpaZpa_inZpa_pkZpap_anZpap_awZpap_cwZpdZpd_deZpd_usZphZph_phZplZpl_plZpolishZ
portugueseZportuguese_brazil�posixz
posix-utf2ZppZpp_anZps_afZptZpt_brZpt_ptZquz_peZraj_inZroZro_roZromanianZruZru_ruZru_uaZrumanianZrussianZrwZrw_rwZsa_inZsat_inZsc_itZsdZsd_inzsd_in@devanagari.utf8Zsd_pkZse_noZ
serbocroatianZsgs_ltZshzsh_ba.iso88592@bosniaZsh_hrzsh_hr.iso88592Zsh_spZsh_yuZshn_mmZshs_caZsiZsi_lkZsid_etZsinhalaZskZsk_skZslZsl_csZsl_siZslovakZsloveneZ	slovenianZsm_wsZso_djZso_etZso_keZso_soZspZsp_yuZspanishZ
spanish_spainZsqZsq_alZsq_mk�srzsr@cyrilliczsr@latnZsr_cszsr_cs.iso88592@latnz
sr_cs@latnZsr_meZsr_rsz
sr_rs@latnZsr_spZsr_yuzsr_yu.cp1251@cyrilliczsr_yu.iso88592zsr_yu.iso88595zsr_yu.iso88595@cyrilliczsr_yu.microsoftcp1251@cyrillicz
sr_yu.utf8zsr_yu.utf8@cyrilliczsr_yu@cyrillicZssZss_za�stZst_zaZsvZsv_fiZsv_seZsw_keZsw_tzZswedishZszl_plZtaZta_inzta_in.tsciizta_in.tscii0Zta_lkztcy_in.utf8ZteZte_inZtgZtg_tjZthZth_thzth_th.tactiszth_th.tis620�thaiZthe_npZti_erZti_etZtig_erZtk_tmZtlZtl_phZtnZtn_zaZto_toZtpi_pgZtrZtr_cyZtr_trrvZts_zaZttZtt_ruztt_ru.tatarcyrz
tt_ru@iqtelifZturkishZug_cnZukZuk_uaZunivZ	universalzuniversal.utf8@ucs4Zunm_usZurZur_inZur_pkZuzZuz_uzzuz_uz@cyrillicZveZve_zaZviZvi_vnz
vi_vn.tcvnzvi_vn.tcvn5712zvi_vn.visciizvi_vn.viscii111ZwaZwa_beZwae_chZwal_etZwo_snZxhZxh_zaZyiZyi_usZyo_ngZyue_hkZyuw_pgZzhZzh_cnz
zh_cn.big5z	zh_cn.eucZzh_hkzzh_hk.big5hkZzh_sgz	zh_sg.gbkZzh_twz	zh_tw.euczzh_tw.euctwZzuZzu_zaZaf_ZAZsq_ALZgsw_FRZam_ETZar_SAZar_IQZar_EGZar_LYZar_DZZar_MAZar_TNZar_OMZar_YEZar_SYZar_JOZar_LBZar_KWZar_AEZar_BHZar_QAZhy_AMZas_INZaz_AZZba_RUZeu_ESZbe_BYZbn_INZbs_BAZbr_FRZbg_BGZca_ESZzh_CHSZzh_TWZzh_CNZzh_HKZzh_SGZzh_MOZzh_CHTZco_FRZhr_HRZhr_BAZcs_CZZda_DKZgbz_AFZdiv_MVZnl_NLZnl_BEZen_USZen_GBZen_AUZen_CAZen_NZZen_IEZen_ZAZen_JAZen_CBZen_BZZen_TTZen_ZWZen_PHZen_INZen_MYZet_EEZfo_FOZfil_PHZfi_FIZfr_FRZfr_BEZfr_CAZfr_CHZfr_LUZfr_MCZfy_NLZgl_ESZka_GEZde_DEZde_CHZde_ATZde_LUZde_LIZel_GRZkl_GLZgu_INZha_NGZhe_ILZhi_INZhu_HUZis_ISZid_IDZiu_CAZga_IEZit_ITZit_CHZja_JPZkn_INZkk_KZZkh_KHZqut_GTZrw_RWZkok_INZko_KRZky_KGZlo_LAZlv_LVZlt_LTZdsb_DEZlb_LUZmk_MKZms_MYZms_BNZml_INZmt_MTZmi_NZZarn_CLZmr_INZmoh_CAZmn_MNZmn_CNZne_NPZnb_NOZnn_NOZoc_FRZor_INZps_AFZfa_IRZpl_PLZpt_BRZpt_PTZpa_INZquz_BOZquz_ECZquz_PEZro_ROZrm_CHZru_RUZsmn_FIZsmj_NOZsmj_SEZse_NOZse_SEZse_FIZsms_FIZsma_NOZsma_SEZsa_INZsr_SPZsr_BAZsi_LKZns_ZAZtn_ZAZsk_SKZsl_SIZes_ESZes_MXZes_GTZes_CRZes_PAZes_DOZes_VEZes_COZes_PEZes_ARZes_ECZes_CLZes_URZes_PYZes_BOZes_SVZes_HNZes_NIZes_PRZes_USZsw_KEZsv_SEZsv_FIZsyr_SYZtg_TJZtmz_DZZta_INZtt_RUZte_INZth_THZbo_BTZbo_CNZtr_TRZtk_TMZug_CNZuk_UAZwen_DEZur_PKZur_INZuz_UZZvi_VNZcy_GBZwo_SNZxh_ZAZsah_RUZii_CNZyo_NGZzu_ZA)�i6ii�i^iiiiiiii i$i(i,i0i4i8i<i@i+iMi,i,imi-i#iEi ii~iir&iiiiii|i�iiiii�ieiii	i	i	i	i	i	i	i	 i	$i	(i	,i	0i	4i	@i	Di	Hi%i8idiiiiiiiibiVi7iiiiiiioiGihi
i9iii!i]i]i<iiiiKi?iSi�i�iWii@iTi&i'i.ini/i>i>iLi:i�iziNi|iPiPiaiii�iHici)iiiiFikikikiiii;$i;i;i;i;i;i; i;i;iOiiiii[ili2ii$i
i
i
i
i
i
i
i
 i
$i
(i
,i
0i
4i
8i
<i
@i
Di
Hi
Li
Pi
TiAiiiZi(i_iIiDiJiiQiQiiBi�i"i.i i iCiCi*iRi�i4i�ixiji5cCs�i}|fdd�}|�|d=td�td�t�\}}td|p@d�td|pNd�t�td	�td�|��D]@\}}t|d
�t|�\}}td|p�d�td|p�d�t�qpt�td
�td�t�|��D]B\}}t|d
�t|�\}}td|p�d�td|�pd�t�q�zttd�Wn$td�td�td�YnhXt�td�td�|��D]F\}}t|d
�t|�\}}td|�p�d�td|�p�d�t��qldS)NcSs0t���D] \}}|dd�dkr
|||<q
dS)Nr$ZLC_)�globals�items)�
categories�k�vrrr�_init_categories�sz'_print_locale.<locals>._init_categoriesrz4Locale defaults as determined by getdefaultlocale():zH------------------------------------------------------------------------z
Language: z(undefined)z
Encoding: zLocale settings on startup:z...z
   Language: z
   Encoding: z,Locale settings after calling resetlocale():r)zNOTE:z9setlocale(LC_ALL, "") does not support the default localez&given in the OS environment variables.z4Locale settings after calling setlocale(LC_ALL, ""):)r{rr�rrrr)r�r�Zlang�enc�namer>rrr�
_print_locale�sV



r��LC_MESSAGES�__main__zLocale aliasing:zNumber formatting:)N)F)FF)FF)FF)TFF)r�)N)T)T)T)T)Jr�r�Zencodings.aliases�rera�builtinsrr��	functools�__all__rr r�r�rrrrr�rrrrDrr	rr�rr
r@rA�wrapsrFrSrT�compiler]rZrrrrw�floatrr
r}r�r�r�rr�r�rrrr��
startswithr�CODESET�	NameError�hasattrr��sortedr�r�r�rt�
setdefaultr�r�r�rL�__name__r{rrrr�<module>
sr�	




%-S"5
$�6}�����
a��V:

__pycache__/shelve.cpython-38.opt-1.pyc000064400000022424151153537570013651 0ustar00U

e5dO!�@s�dZddlmZmZddlmZddlZddddgZGd	d
�d
ej	j
�ZGdd�dej	j
�ZGdd�de�Z
Gd
d�de�Zddd�ZdS)a�
Manage shelves of pickled objects.

A "shelf" is a persistent, dictionary-like object.  The difference
with dbm databases is that the values (not the keys!) in a shelf can
be essentially arbitrary Python objects -- anything that the "pickle"
module can handle.  This includes most class instances, recursive data
types, and objects containing lots of shared sub-objects.  The keys
are ordinary strings.

To summarize the interface (key is a string, data is an arbitrary
object):

        import shelve
        d = shelve.open(filename) # open, with (g)dbm filename -- no suffix

        d[key] = data   # store data at key (overwrites old data if
                        # using an existing key)
        data = d[key]   # retrieve a COPY of the data at key (raise
                        # KeyError if no such key) -- NOTE that this
                        # access returns a *copy* of the entry!
        del d[key]      # delete data stored at key (raises KeyError
                        # if no such key)
        flag = key in d # true if the key exists
        list = d.keys() # a list of all existing keys (slow!)

        d.close()       # close it

Dependent on the implementation, closing a persistent dictionary may
or may not be necessary to flush changes to disk.

Normally, d[key] returns a COPY of the entry.  This needs care when
mutable entries are mutated: for example, if d[key] is a list,
        d[key].append(anitem)
does NOT modify the entry d[key] itself, as stored in the persistent
mapping -- it only modifies the copy, which is then immediately
discarded, so that the append has NO effect whatsoever.  To append an
item to d[key] in a way that will affect the persistent mapping, use:
        data = d[key]
        data.append(anitem)
        d[key] = data

To avoid the problem with mutable entries, you may pass the keyword
argument writeback=True in the call to shelve.open.  When you use:
        d = shelve.open(filename, writeback=True)
then d keeps a cache of all entries you access, and writes them all back
to the persistent mapping when you call d.close().  This ensures that
such usage as d[key].append(anitem) works as intended.

However, using keyword argument writeback=True may consume vast amount
of memory for the cache, and it may make d.close() very slow, if you
access many of d's entries after opening it in this way: d has no way to
check which of the entries you access are mutable and/or which ones you
actually mutate, so it must cache, and write back at close, all of the
entries that you access.  You can call d.sync() to write back all the
entries in the cache, and empty the cache (d.sync() also synchronizes
the persistent dictionary on disk, if feasible).
�)�Pickler�	Unpickler)�BytesION�Shelf�
BsdDbShelf�DbfilenameShelf�openc@s8eZdZdZdd�ZeZZZZZ	Z
dd�ZdS)�_ClosedDictz>Marker for a closed dict.  Access attempts raise a ValueError.cGstd��dS)Nz!invalid operation on closed shelf)�
ValueError)�self�args�r
�/usr/lib64/python3.8/shelve.py�closedEsz_ClosedDict.closedcCsdS)Nz<Closed Dictionary>r
�rr
r
r�__repr__Isz_ClosedDict.__repr__N)�__name__�
__module__�__qualname__�__doc__r�__iter__�__len__�__getitem__�__setitem__�__delitem__�keysrr
r
r
rr	Bsr	c@s|eZdZdZddd�Zdd�Zd	d
�Zdd�Zd d
d�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)!rz�Base class for shelf implementations.

    This is initialized with a dictionary-like object.
    See the module's __doc__ string for an overview of the interface.
    NF�utf-8cCs.||_|dkrd}||_||_i|_||_dS)N�)�dict�	_protocol�	writeback�cache�keyencoding�rr�protocolr r"r
r
r�__init__TszShelf.__init__ccs"|j��D]}|�|j�Vq
dS�N)rr�decoder")r�kr
r
rr^szShelf.__iter__cCs
t|j�Sr&)�lenrrr
r
rrbsz
Shelf.__len__cCs|�|j�|jkSr&��encoder"r�r�keyr
r
r�__contains__eszShelf.__contains__cCs|�|j�|jkr||S|Sr&r*)rr-�defaultr
r
r�gethsz	Shelf.getcCsZz|j|}WnFtk
rTt|j|�|j��}t|���}|jrP||j|<YnX|Sr&)	r!�KeyErrorrrr+r"r�loadr �rr-�value�fr
r
rrmszShelf.__getitem__cCsF|jr||j|<t�}t||j�}|�|�|��|j|�|j	�<dSr&)
r r!rrr�dump�getvaluerr+r")rr-r4r5�pr
r
rrws

zShelf.__setitem__cCs6|j|�|j�=z|j|=Wntk
r0YnXdSr&)rr+r"r!r1r,r
r
rrs
zShelf.__delitem__cCs|Sr&r
rr
r
r�	__enter__�szShelf.__enter__cCs|��dSr&)�close)r�typer4�	tracebackr
r
r�__exit__�szShelf.__exit__cCsf|jdkrdSz0|��z|j��Wntk
r:YnXW5zt�|_Wnd|_YnXXdSr&)rr	�syncr:�AttributeErrorrr
r
rr:�s

zShelf.closecCst|d�sdS|��dS)Nr )�hasattrr:rr
r
r�__del__�s
z
Shelf.__del__cCsT|jr:|jr:d|_|j��D]\}}|||<qd|_i|_t|jd�rP|j��dS)NFTr>)r r!�itemsr@rr>)rr-�entryr
r
rr>�s
z
Shelf.sync)NFr)N)rrrrr%rrr.r0rrrr9r=r:rAr>r
r
r
rrMs �



c@sBeZdZdZddd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dS)ra�Shelf implementation using the "BSD" db interface.

    This adds methods first(), next(), previous(), last() and
    set_location() that have no counterpart in [g]dbm databases.

    The actual database must be opened using one of the "bsddb"
    modules "open" routines (i.e. bsddb.hashopen, bsddb.btopen or
    bsddb.rnopen) and passed to the constructor.

    See the module's __doc__ string for an overview of the interface.
    NFrcCst�|||||�dSr&)rr%r#r
r
rr%�szBsdDbShelf.__init__cCs0|j�|�\}}t|�}|�|j�t|���fSr&)r�set_locationrr'r"rr2r3r
r
rrD�szBsdDbShelf.set_locationcCs.t|j�\}}t|�}|�|j�t|���fSr&)�nextrrr'r"rr2r3r
r
rrE�szBsdDbShelf.nextcCs.|j��\}}t|�}|�|j�t|���fSr&)r�previousrr'r"rr2r3r
r
rrF�szBsdDbShelf.previouscCs.|j��\}}t|�}|�|j�t|���fSr&)r�firstrr'r"rr2r3r
r
rrG�szBsdDbShelf.firstcCs.|j��\}}t|�}|�|j�t|���fSr&)r�lastrr'r"rr2r3r
r
rrH�szBsdDbShelf.last)NFr)
rrrrr%rDrErFrGrHr
r
r
rr�s�
c@seZdZdZddd�ZdS)rz�Shelf implementation using the "dbm" generic dbm interface.

    This is initialized with the filename for the dbm database.
    See the module's __doc__ string for an overview of the interface.
    �cNFcCs$ddl}t�||�||�||�dS)Nr)�dbmrr%r)r�filename�flagr$r rJr
r
rr%�szDbfilenameShelf.__init__)rINF)rrrrr%r
r
r
rr�srIFcCst||||�S)a�Open a persistent dictionary for reading and writing.

    The filename parameter is the base filename for the underlying
    database.  As a side-effect, an extension may be added to the
    filename and more than one file may be created.  The optional flag
    parameter has the same interpretation as the flag parameter of
    dbm.open(). The optional protocol parameter specifies the
    version of the pickle protocol.

    See the module's __doc__ string for an overview of the interface.
    )r)rKrLr$r r
r
rr�s
)rINF)r�picklerr�iorZcollections.abc�collections�__all__�abc�MutableMappingr	rrrrr
r
r
r�<module>s:b+__pycache__/__future__.cpython-38.pyc000064400000010100151153537570013516 0ustar00U

e5d�
@s�dZddddddddd	d
g
ZdgeZdZd
ZdZdZdZdZdZ	dZ
dZdZGdd�d�Z
e
dde�Ze
dde�Ze
dde�Ze
dde�Ze
dde�Ze
d de�Ze
d de	�Ze
d!d"e
�Ze
d#d$e�Ze
d%d&e�Zd'S)(afRecord of phased-in incompatible language changes.

Each line is of the form:

    FeatureName = "_Feature(" OptionalRelease "," MandatoryRelease ","
                              CompilerFlag ")"

where, normally, OptionalRelease < MandatoryRelease, and both are 5-tuples
of the same form as sys.version_info:

    (PY_MAJOR_VERSION, # the 2 in 2.1.0a3; an int
     PY_MINOR_VERSION, # the 1; an int
     PY_MICRO_VERSION, # the 0; an int
     PY_RELEASE_LEVEL, # "alpha", "beta", "candidate" or "final"; string
     PY_RELEASE_SERIAL # the 3; an int
    )

OptionalRelease records the first release in which

    from __future__ import FeatureName

was accepted.

In the case of MandatoryReleases that have not yet occurred,
MandatoryRelease predicts the release in which the feature will become part
of the language.

Else MandatoryRelease records when the feature became part of the language;
in releases at or after that, modules no longer need

    from __future__ import FeatureName

to use the feature in question, but may continue to use such imports.

MandatoryRelease may also be None, meaning that a planned feature got
dropped.

Instances of class _Feature have two corresponding methods,
.getOptionalRelease() and .getMandatoryRelease().

CompilerFlag is the (bitfield) flag that should be passed in the fourth
argument to the builtin function compile() to enable the feature in
dynamically compiled code.  This flag is stored in the .compiler_flag
attribute on _Future instances.  These values must match the appropriate
#defines of CO_xxx flags in Include/compile.h.

No feature line is ever to be deleted from this file.
�
nested_scopes�
generators�division�absolute_import�with_statement�print_function�unicode_literals�barry_as_FLUFL�generator_stop�annotations�all_feature_names��iiiii i@i�ic@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�_FeaturecCs||_||_||_dS)N)�optional�	mandatory�
compiler_flag)�selfZoptionalReleaseZmandatoryReleaser�r�"/usr/lib64/python3.8/__future__.py�__init__Ssz_Feature.__init__cCs|jS)z�Return first release in which this feature was recognized.

        This is a 5-tuple, of the same form as sys.version_info.
        )r�rrrr�getOptionalReleaseXsz_Feature.getOptionalReleasecCs|jS)z�Return release in which this feature will become mandatory.

        This is a 5-tuple, of the same form as sys.version_info, or, if
        the feature was dropped, is None.
        )rrrrr�getMandatoryRelease_sz_Feature.getMandatoryReleasecCsdt|j|j|jf�S)Nr)�reprrrrrrrr�__repr__gs�z_Feature.__repr__N)�__name__�
__module__�__qualname__rrrrrrrrrQsr)��r
�betar)rrr
�alphar
)rrr
r!r)r�r
�finalr
)rrr
r!r)r"r
r
r!r
)r�r
r!r)r�r
r!r
)rr%r
r!r)r"rr
r!r)�r
r
r!r
)r"r$r
r r)r"�r
r!r
)r"r'r
r r)r"�
r
r!r
N)�__doc__r�__all__Z	CO_NESTEDZCO_GENERATOR_ALLOWEDZCO_FUTURE_DIVISIONZCO_FUTURE_ABSOLUTE_IMPORTZCO_FUTURE_WITH_STATEMENTZCO_FUTURE_PRINT_FUNCTIONZCO_FUTURE_UNICODE_LITERALSZCO_FUTURE_BARRY_AS_BDFLZCO_FUTURE_GENERATOR_STOPZCO_FUTURE_ANNOTATIONSrrrrrrrrrr	r
rrrr�<module>s~2�
����������__pycache__/getopt.cpython-38.pyc000064400000014201151153537570012720 0ustar00U

e5dA�@s�dZddddgZddlZzddlmZWnek
rDdd	�ZYnXGd
d�de�ZeZgfdd�Z	gfdd�Z
d
d�Zdd�Zdd�Z
dd�Zedkr�ddlZee	ejdd�dddg��dS)a�Parser for command line options.

This module helps scripts to parse the command line arguments in
sys.argv.  It supports the same conventions as the Unix getopt()
function (including the special meanings of arguments of the form `-'
and `--').  Long options similar to those supported by GNU software
may be used as well via an optional third argument.  This module
provides two functions and an exception:

getopt() -- Parse command line options
gnu_getopt() -- Like getopt(), but allow option and non-option arguments
to be intermixed.
GetoptError -- exception (class) raised with 'opt' attribute, which is the
option involved with the exception.
�GetoptError�error�getopt�
gnu_getopt�N)�gettextcCs|S�N�)�srr�/usr/lib64/python3.8/getopt.py�_)�rc@s&eZdZdZdZddd�Zdd�ZdS)r�cCs||_||_t�|||�dSr)�msg�opt�	Exception�__init__)�selfrrrrr
r.szGetoptError.__init__cCs|jSr)r)rrrr
�__str__3szGetoptError.__str__N)r
)�__name__�
__module__�__qualname__rrrrrrrr
r+s
cCs�g}t|�td�kr|g}nt|�}|r�|d�d�r�|ddkr�|ddkr\|dd�}q�|d�d�r�t||ddd�||dd��\}}q$t||ddd�||dd��\}}q$||fS)a@getopt(args, options[, long_options]) -> opts, args

    Parses command line options and parameter list.  args is the
    argument list to be parsed, without the leading reference to the
    running program.  Typically, this means "sys.argv[1:]".  shortopts
    is the string of option letters that the script wants to
    recognize, with options that require an argument followed by a
    colon (i.e., the same format that Unix getopt() uses).  If
    specified, longopts is a list of strings with the names of the
    long options which should be supported.  The leading '--'
    characters should not be included in the option name.  Options
    which require an argument should be followed by an equal sign
    ('=').

    The return value consists of two elements: the first is a list of
    (option, value) pairs; the second is the list of program arguments
    left after the option list was stripped (this is a trailing slice
    of the first argument).  Each option-and-value pair returned has
    the option as its first element, prefixed with a hyphen (e.g.,
    '-x'), and the option argument as its second element, or an empty
    string if the option has no argument.  The options occur in the
    list in the same order in which they were found, thus allowing
    multiple occurrences.  Long and short options may be mixed.

    r
r�-�--�N�)�type�list�
startswith�do_longs�	do_shorts)�args�	shortopts�longopts�optsrrr
r8s((cCs6g}g}t|t�r|g}nt|�}|�d�r>|dd�}d}ntj�d�rPd}nd}|�r.|ddkrz||dd�7}�q.|ddd	�dkr�t||dd	d�||dd��\}}qT|ddd�d
kr�|dd
kr�t||ddd�||dd��\}}qT|�r||7}�q.qT|�	|d�|dd�}qT||fS)agetopt(args, options[, long_options]) -> opts, args

    This function works like getopt(), except that GNU style scanning
    mode is used by default. This means that option and non-option
    arguments may be intermixed. The getopt() function stops
    processing options as soon as a non-option argument is
    encountered.

    If the first character of the option string is `+', or if the
    environment variable POSIXLY_CORRECT is set, then option
    processing stops as soon as a non-option argument is encountered.

    �+rNTZPOSIXLY_CORRECTFrrrr)
�
isinstance�strrr�os�environ�getrr�append)r r!r"r#Z	prog_argsZall_options_firstrrr
rcs2

( (cCs�z|�d�}Wntk
r&d}Yn X|d|�||dd�}}t||�\}}|r�|dkr�|svttd�||��|d|dd�}}n|dk	r�ttd�||��|�d||p�df�||fS)N�=rzoption --%s requires argumentrz%option --%s must not have an argumentrr
)�index�
ValueError�
long_has_argsrrr*)r#rr"r �i�optarg�has_argrrr
r�s
rcs��fdd�|D�}|s(ttd������|kr8d�fS�d|krLd�fSt|�dkrjttd�����t|�dkszt�|d	}|�d�}|r�|dd
�}||fS)Ncsg|]}|���r|�qSr)r)�.0�o�rrr
�
<listcomp>�s
z!long_has_args.<locals>.<listcomp>zoption --%s not recognizedFr+Trzoption --%s not a unique prefixr���)rr�len�AssertionError�endswith)rr"Z
possibilitiesZunique_matchr1rr4r
r.�s
r.cCs�|dkr�|d|dd�}}t||�rh|dkr\|sFttd�||��|d|dd�}}|d}}nd}|�d||f�q||fS)Nr
rrzoption -%s requires argumentr)�
short_has_argrrr*)r#Z	optstringr!r rr0rrr
r�s
�rcCsXtt|��D]4}|||kr(dkrnq|�d|d�Sqttd�||��dS)N�:rzoption -%s not recognized)�ranger7rrr)rr!r/rrr
r:�sr:�__main__rza:bzalpha=Zbeta)�__doc__�__all__r'rr�ImportErrorrrrrrrr.rr:r�sys�print�argvrrrr
�<module>s"!+2__pycache__/difflib.cpython-38.opt-2.pyc000064400000060533151153537570013766 0ustar00U

e5dZH�@s4dddddddddd	d
dgZdd
lmZddlmZedd�Zdd�ZGdd�d�Z	d7dd�Z
dd�ZGdd�d�Zddl
Z
e
�d�jfdd�Zd8dd�Zdd�Zd9d"d�Zd#d$�Zd:d%d�Zd&d'�Zd;d*d	�Zdefd+d�Zddefd,d-�Zd.Zd/Zd0Zd1ZGd2d
�d
e�Z[
d3d�Z d4d5�Z!e"d6k�r0e!�dS)<�get_close_matches�ndiff�restore�SequenceMatcher�Differ�IS_CHARACTER_JUNK�IS_LINE_JUNK�context_diff�unified_diff�
diff_bytes�HtmlDiff�Match�)�nlargest)�
namedtupleza b sizecCs|rd||SdS)Ng@��?�)�matches�lengthrr�/usr/lib64/python3.8/difflib.py�_calculate_ratio&src@speZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
ddd�Zdd�Zdd�Z
dd�ZdS)rN�TcCs(||_d|_|_||_|�||�dS�N)�isjunk�a�b�autojunk�set_seqs)�selfrrrrrrr�__init__�s;zSequenceMatcher.__init__cCs|�|�|�|�dSr)�set_seq1�set_seq2)rrrrrrr�s	
zSequenceMatcher.set_seqscCs$||jkrdS||_d|_|_dSr)r�matching_blocks�opcodes)rrrrrr�s
zSequenceMatcher.set_seq1cCs2||jkrdS||_d|_|_d|_|��dSr)rr!r"�
fullbcount�_SequenceMatcher__chain_b)rrrrrr �s
zSequenceMatcher.set_seq2cCs�|j}i|_}t|�D]\}}|�|g�}|�|�qt�|_}|j}|r~|��D]}||�rV|�	|�qV|D]
}||=qrt�|_
}t|�}	|jr�|	dkr�|	dd}
|�
�D]\}}t|�|
kr�|�	|�q�|D]
}||=q�dS)N���d�)r�b2j�	enumerate�
setdefault�append�set�bjunkr�keys�addZbpopular�lenr�items)rrr(�i�elt�indicesZjunkrZpopular�nZntestZidxsrrrZ	__chain_b)s,
zSequenceMatcher.__chain_bcCs4|j|j|j|jjf\}}}}||d}	}
}i}g}
t||�D]�}|j}i}|�|||
�D]\}||krlq^||krxq�||dd�d}||<||kr^||d||d|}	}
}q^|}q@|	|k�r |
|k�r |||
d��s ||	d||
dk�r |	d|
d|d}	}
}q�|	||k�rt|
||k�rt|||
|��st||	|||
|k�rt|d7}�q |	|k�r�|
|k�r�|||
d��r�||	d||
dk�r�|	d|
d|d}	}
}�qt|	||k�r(|
||k�r(|||
|��r(||	|||
|k�r(|d}�q�t|	|
|�S�Nr
r')rrr(r-�__contains__�range�getr)r�alo�ahi�blo�bhirrr(ZisbjunkZbestiZbestjZbestsizeZj2lenZnothingr2Zj2lengetZnewj2len�j�krrr�find_longest_matchPsR8"����	�� ��z"SequenceMatcher.find_longest_matchcCs||jdk	r|jSt|j�t|j�}}d|d|fg}g}|r�|��\}}}}|�||||�\}	}
}}|r8|�|�||	kr�||
kr�|�||	||
f�|	||kr8|
||kr8|�|	|||
||f�q8|��d}
}}g}|D]V\}}}|
||k�r|||k�r||7}q�|�r,|�|
||f�|||}
}}q�|�rT|�|
||f�|�||df�tt	t
j|��|_|jS�Nr
)r!r0rr�popr@r+�sort�list�mapr�_make)r�la�lbZqueuer!r:r;r<r=r2r>r?�x�i1�j1Zk1Znon_adjacent�i2�j2Zk2rrr�get_matching_blocks�s8


z#SequenceMatcher.get_matching_blockscCs�|jdk	r|jSd}}g|_}|��D]�\}}}d}||krN||krNd}n||kr\d}n||krhd}|r�|�|||||f�||||}}|r*|�d||||f�q*|S)Nr
r�replace�delete�insert�equal)r"rNr+)rr2r>Zanswer�ai�bj�size�tagrrr�get_opcodess$

zSequenceMatcher.get_opcodes�c
csn|��}|sdg}|dddkrZ|d\}}}}}|t|||�|t|||�|f|d<|dddkr�|d\}}}}}||t|||�|t|||�f|d<||}g}	|D]�\}}}}}|dk�r(|||k�r(|	�||t|||�|t|||�f�|	Vg}	t|||�t|||�}}|	�|||||f�q�|	�rjt|	�dk�rd|	dddk�sj|	VdS)N)rRr
r'r
r'r
rR���r')rW�max�minr+r0)
rr5ZcodesrVrJrLrKrMZnn�grouprrr�get_grouped_opcodes<s(&&(&z#SequenceMatcher.get_grouped_opcodescCs0tdd�|��D��}t|t|j�t|j��S)Ncss|]}|dVqdS)rYNr)�.0Ztriplerrr�	<genexpr>�sz(SequenceMatcher.ratio.<locals>.<genexpr>)�sumrNrr0rr)rrrrr�rationszSequenceMatcher.ratiocCs�|jdkr4i|_}|jD]}|�|d�d||<q|j}i}|jd}}|jD]>}||�rf||}n|�|d�}|d||<|dkrP|d}qPt|t|j�t|j��Sr6)r#rr9r7rrr0)rr#r3ZavailZavailhasrZnumbrrr�quick_ratio�s






zSequenceMatcher.quick_ratiocCs*t|j�t|j�}}tt||�||�Sr)r0rrrr[)rrGrHrrr�real_quick_ratio�sz SequenceMatcher.real_quick_ratio)NrrT)rX)�__name__�
__module__�__qualname__rrrr r$r@rNrWr]rarbrcrrrrr+sl
@,'nG7
2rX�333333�?cCs�|dkstd|f��d|kr*dks:ntd|f��g}t�}|�|�|D]D}|�|�|��|krR|��|krR|��|krR|�|��|f�qRt||�}dd�|D�S)Nr
zn must be > 0: %rgrz cutoff must be in [0.0, 1.0]: %rcSsg|]\}}|�qSrr)r^ZscorerIrrr�
<listcomp>�sz%get_close_matches.<locals>.<listcomp>)	�
ValueErrorrr rrcrbrar+�	_nlargest)ZwordZ
possibilitiesr5�cutoff�result�srIrrrr�s"


�
�
cCsd�dd�t||�D��S)Nrcss*|]"\}}|dkr|��r|n|VqdS)� N)�isspace)r^�cZtag_crrrr_�s�z$_keep_original_ws.<locals>.<genexpr>)�join�zip)rmZtag_srrr�_keep_original_ws�s
�rsc@sFeZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dS)rNcCs||_||_dSr��linejunk�charjunk)rrurvrrrrHszDiffer.__init__c
	cs�t|j||�}|��D]�\}}}}}|dkrB|�||||||�}	n\|dkr\|�d|||�}	nB|dkrv|�d|||�}	n(|dkr�|�d|||�}	ntd|f��|	EdHqdS)	NrOrP�-rQ�+rRrn�unknown tag %r)rrurW�_fancy_replace�_dumpri)
rrr�cruncherrVr:r;r<r=�grrr�compare_szDiffer.compareccs&t||�D]}d|||fVq
dS)Nz%s %s)r8)rrVrI�lo�hir2rrrr{�szDiffer._dumpc
csn||||kr2|�d|||�}|�d|||�}n |�d|||�}|�d|||�}||fD]}	|	EdHqZdS)Nrxrw)r{)
rrr:r;rr<r=�first�secondr}rrr�_plain_replace�szDiffer._plain_replaceccs:d\}}t|j�}	d\}
}t||�D]�}||}
|	�|
�t||�D]j}||}||
krl|
dkrD||}
}qD|	�|�|	��|krD|	��|krD|	��|krD|	��||}}}qDq$||kr�|
dkr�|�||||||�EdHdS|
|d}}}nd}
|�	||||||�EdH||||}}|
dk�r
d}}|	�
||�|	��D]�\}}}}}||||}}|dk�r�|d|7}|d|7}nb|dk�r�|d|7}nJ|d	k�r�|d
|7}n2|dk�r�|d|7}|d|7}ntd
|f���qH|�
||||�EdHn
d|V|�	||d|||d|�EdHdS)N)g�G�z��?g�?)NNrrrO�^rPrwrQrxrRrnry�  r')rrvr8r rrcrbrar��
_fancy_helperrrWri�_qformat)rrr:r;rr<r=Z
best_ratiorkr|ZeqiZeqjr>rTr2rSZbest_iZbest_jZaeltZbelt�atags�btagsrVZai1Zai2Zbj1Zbj2rGrHrrrrz�s\




�
�





zDiffer._fancy_replaceccsbg}||kr<||kr*|�||||||�}qT|�d|||�}n||krT|�d|||�}|EdHdS)Nrwrx)rzr{)rrr:r;rr<r=r}rrrr��szDiffer._fancy_helperccsXt||���}t||���}d|V|r8d|�d�Vd|V|rTd|�d�VdS)N�- z? �
�+ )rs�rstrip)rZalineZbliner�r�rrrr�s

zDiffer._qformat)NN)
rdrerfrr~r{r�rzr�r�rrrrr�s^
)^Nz
\s*(?:#\s*)?$cCs||�dk	Srr)�lineZpatrrrr3s� 	cCs||kSrr)ZchZwsrrrrCscCs:|d}||}|dkr"d�|�S|s.|d8}d�||�S�Nr'z{}z{},{}��format��start�stopZ	beginningrrrr�_format_range_unifiedZs
r�rr�ccsPt|||||||�d}td||��|�D�]}	|s|d}|rFd�|�nd}
|rXd�|�nd}d�||
|�Vd�|||�V|	d|	d}}
t|d	|
d
�}t|d|
d�}d
�|||�V|	D]�\}}}}}|dkr�|||�D]}d|Vq�q�|dk�r"|||�D]}d|V�q|dkr�|||�D]}d|V�q6q�q*dS)NFT�	{}r�
--- {}{}{}z
+++ {}{}{}r
rYr'�rX�z@@ -{} +{} @@{}rRrn>rPrOrw>rOrQrx)�_check_typesrr]r�r�)rr�fromfile�tofile�fromfiledate�
tofiledater5�lineterm�startedr\�fromdate�todater��last�file1_range�file2_rangerVrJrLrKrMr�rrrr	es0)
cCsB|d}||}|s|d8}|dkr.d�|�Sd�|||d�Sr�r�r�rrr�_format_range_context�s
r�ccs�t|||||||�tddddd�}d}	td||��|�D�]R}
|	s�d}	|rVd�|�nd	}|rhd�|�nd	}d
�|||�Vd�|||�V|
d|
d
}
}d|Vt|
d|d�}d�||�Vtdd�|
D���r|
D]8\}}}}}|dkr�|||�D]}|||V�qq�t|
d|d�}d�||�Vtdd�|
D��r:|
D]<\}}}}}|dk�rP|||�D]}|||V�qt�qPq:dS)Nr�r�z! r�)rQrPrOrRFTr�rz
*** {}{}{}r�r
rYz***************r'r�z
*** {} ****{}css |]\}}}}}|dkVqdS)>rPrONr�r^rV�_rrrr_�szcontext_diff.<locals>.<genexpr>rQrXr�z
--- {} ----{}css |]\}}}}}|dkVqdS)>rOrQNrr�rrrr_srP)r��dictrr]r�r��any)rrr�r�r�r�r5r��prefixr�r\r�r�r�r�r�rVrJrLr�r�r�rKrMrrrr�s4,

cGs�|r0t|dt�s0tdt|d�j|df��|r`t|dt�s`tdt|d�j|df��|D]}t|t�sdtd|f��qddS)Nr
z)lines to compare must be str, not %s (%r)z"all arguments must be str, not: %r)�
isinstance�str�	TypeError�typerd)rr�args�argrrrr�s��
r���
c		cs~dd�}	tt|	|��}tt|	|��}|	|�}|	|�}|	|�}|	|�}|	|�}|||||||||�}
|
D]}|�dd�VqfdS)Nc
SsRz|�dd�WStk
rL}z dt|�j|f}t|�|�W5d}~XYnXdS)N�ascii�surrogateescapez(all arguments must be bytes, not %s (%r))�decode�AttributeErrorr�rdr�)rm�err�msgrrrr�"s�zdiff_bytes.<locals>.decoder�r�)rDrE�encode)Zdfuncrrr�r�r�r�r5r�r��linesr�rrrr
scCst||��||�Sr)rr~)rrrurvrrrr5s#c#s�ddl}|�d��t||||��ddgf�fdd�	���fdd���fdd�}|�}|dkrj|EdH�n|d	7}d}ddg|}	}
d
}|d
kr�zt|�\}}
}Wntk
r�YdSX|	|}||
|f|
|<|	d	7}	q�|	|kr�dV|}n|	}d}	|�r"|	|}|	d	7}	|
|V|d	8}q�|d	}z@|�rht|�\}}
}|�rP|d	}n|d	8}||
|fV�q,Wqvtk
�r�YdSXqvdS)Nr
z
(\++|\-+|\^+)cs�||d7<|dkr2|||�d�dd�fS|dkr�|�d�|�d�}}g}|fdd�}��||�t|�D]<\}\}	}
|d|	�d|||	|
�d||
d�}qt|dd�}n*|�d�dd�}|s�d	}d||d}|||fS)
Nr'r
r��?cSs&|�|�d�d|��g�|�d�S)Nr'r
)r+r\�span)Zmatch_object�sub_inforrr�record_sub_info�sz3_mdiff.<locals>._make_line.<locals>.record_sub_info��rn)rB�sub�reversed)r�Z
format_key�sideZ	num_lines�textZmarkersr�r��keyZbegin�end)�	change_rerr�
_make_line�s 2z_mdiff.<locals>._make_linec3sng}d\}}t|�dkr*|�t�d��qd�dd�|D��}|�d�rP|}�n�|�d�r|�|dd	��|dd
�dfVq�n�|�d�r�|d
8}�|d
d	�ddfVq�nl|�d�rֈ|d
d	�d}}|d
d	}}�n>|�d��r�|dd	��|dd
�dfVq�n|�d��r0�|dd	��|dd
�dfVqn�|�d
��r\|d
8}�|d
d	�ddfVqn�|�d��r�|d
7}d�|dd
�dfVqn�|�d��r�d�|dd
�}}|d
d	}}n^|�d��r�|d
7}d�|dd
�dfVqn2|�d��r�|dd�dd	��|dd
�dfVq|d	k�r0|d
7}dV�q|d	k�rL|d
8}dV�q0|�d��r\dS||dfVqdS)N)r
r
r��XrcSsg|]}|d�qS)r
r�r^r�rrrrh�sz2_mdiff.<locals>._line_iterator.<locals>.<listcomp>z-?+?r�r
r'Tz--++rw)z--?+z--+r�z-+?z-?+z+--rx)r�z+-rnF)N�rr�T)r�NT)r0r+�nextrq�
startswith)r�Znum_blanks_pendingZnum_blanks_to_yieldrm�	from_line�to_line)r��diff_lines_iteratorrr�_line_iterator�sd



$



z_mdiff.<locals>._line_iteratorc3s���}gg}}t|�dks(t|�dkr�zt|�\}}}Wntk
rPYdSX|dk	rh|�||f�|dk	r|�||f�q|�d�\}}|�d�\}}|||p�|fVqdSrA)r0r��
StopIterationr+rB)Z
line_iterator�	fromlines�tolinesr�r��
found_diffZfromDiffZto_diff)r�rr�_line_pair_iterators

z#_mdiff.<locals>._line_pair_iteratorr'F)NNN)�re�compilerr�r�)r�r��contextrurvr�r�Zline_pair_iteratorZlines_to_write�indexZcontextLinesr�r�r�r2r)r�r�r�r�r�_mdiffZsR"
8X!



r�an
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>

<head>
    <meta http-equiv="Content-Type"
          content="text/html; charset=%(charset)s" />
    <title></title>
    <style type="text/css">%(styles)s
    </style>
</head>

<body>
    %(table)s%(legend)s
</body>

</html>aH
        table.diff {font-family:Courier; border:medium;}
        .diff_header {background-color:#e0e0e0}
        td.diff_header {text-align:right}
        .diff_next {background-color:#c0c0c0}
        .diff_add {background-color:#aaffaa}
        .diff_chg {background-color:#ffff77}
        .diff_sub {background-color:#ffaaaa}aZ
    <table class="diff" id="difflib_chg_%(prefix)s_top"
           cellspacing="0" cellpadding="0" rules="groups" >
        <colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
        <colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
        %(header_row)s
        <tbody>
%(data_rows)s        </tbody>
    </table>a�
    <table class="diff" summary="Legends">
        <tr> <th colspan="2"> Legends </th> </tr>
        <tr> <td> <table border="" summary="Colors">
                      <tr><th> Colors </th> </tr>
                      <tr><td class="diff_add">&nbsp;Added&nbsp;</td></tr>
                      <tr><td class="diff_chg">Changed</td> </tr>
                      <tr><td class="diff_sub">Deleted</td> </tr>
                  </table></td>
             <td> <table border="" summary="Links">
                      <tr><th colspan="2"> Links </th> </tr>
                      <tr><td>(f)irst change</td> </tr>
                      <tr><td>(n)ext change</td> </tr>
                      <tr><td>(t)op</td> </tr>
                  </table></td> </tr>
    </table>c@s�eZdZeZeZeZeZdZdddefdd�Z	dd	d
�dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zddd�ZdS)rr
�NcCs||_||_||_||_dSr)�_tabsize�_wrapcolumn�	_linejunk�	_charjunk)r�tabsizeZ
wrapcolumnrurvrrrr�szHtmlDiff.__init__rF�zutf-8)�charsetcCs:|jt|j|j|j||||||d�|d��|d��|�S)N)r��numlines)ZstylesZlegend�tabler��xmlcharrefreplace)�_file_templater��_styles�_legend�
make_tabler�r�)rr�r��fromdesc�todescr�r�r�rrr�	make_file�s����zHtmlDiff.make_filecs8�fdd���fdd�|D�}�fdd�|D�}||fS)Ncs6|�dd�}|��j�}|�dd�}|�dd��d�S)Nrnr��	r�)rO�
expandtabsr�r�)r�)rrr�expand_tabs�sz2HtmlDiff._tab_newline_replace.<locals>.expand_tabscsg|]}�|��qSrrr��r�rrrh�sz1HtmlDiff._tab_newline_replace.<locals>.<listcomp>csg|]}�|��qSrrr�r�rrrh�sr)rr�r�r)r�rr�_tab_newline_replace�s
	zHtmlDiff._tab_newline_replacecCs|s|�||f�dSt|�}|j}||ksB||�d�d|krT|�||f�dSd}d}d}||kr�||kr�||dkr�|d7}||}|d7}q`||dkr�|d7}d}q`|d7}|d7}q`|d|�}	||d�}
|r�|	d}	d||
}
|�||	f�|�|d|
�dS)Nr�rXr
rr'r��>)r+r0r��count�_split_line)rZ	data_listZline_numr�rUrZr2r5ZmarkZline1Zline2rrrr��s8


zHtmlDiff._split_lineccs�|D]�\}}}|dkr$|||fVq||\}}\}}gg}	}
|�|	||�|�|
||�|	sd|
r|	rt|	�d�}nd}|
r�|
�d�}nd}|||fVq\qdS)Nr
)rrn)r�rB)r�diffs�fromdata�todata�flagZfromlineZfromtextZtolineZtotext�fromlist�tolistrrr�
_line_wrapper0s 
zHtmlDiff._line_wrapperc	Cs�ggg}}}|D]r\}}}z4|�|jd|f|���|�|jd|f|���Wn(tk
rz|�d�|�d�YnX|�|�q|||fSr6)r+�_format_liner�)rr�r�r��flaglistr�r�r�rrr�_collect_linesLs
zHtmlDiff._collect_linescCsrzd|}d|j||f}Wntk
r6d}YnX|�dd��dd��dd	�}|�d
d���}d|||fS)
Nz%dz
 id="%s%s"r�&z&amp;r�z&gt;�<z&lt;rn�&nbsp;z<<td class="diff_header"%s>%s</td><td nowrap="nowrap">%s</td>)�_prefixr�rOr�)rr�r�Zlinenumr��idrrrr�as
�zHtmlDiff._format_linecCs0dtj}dtj}tjd7_||g|_dS)Nzfrom%d_zto%d_r')r�_default_prefixr)rZ
fromprefix�toprefixrrr�_make_prefixxs

zHtmlDiff._make_prefixcCs�|jd}dgt|�}dgt|�}d\}	}
d}t|�D]V\}}
|
r�|
s�d}
|}td||g�}d||	f||<|	d7}	d||	f||<q:d}
q:|s�dg}dg}dg}d}|r�d	g}|}n
d
g}}|ds�d||d<d|||<|||||fS)
Nr'r)r
Fr
Tz id="difflib_chg_%s_%d"z"<a href="#difflib_chg_%s_%d">n</a>Fz2<td></td><td>&nbsp;No Differences Found&nbsp;</td>z(<td></td><td>&nbsp;Empty File&nbsp;</td>z!<a href="#difflib_chg_%s_0">f</a>z#<a href="#difflib_chg_%s_top">t</a>)rr0r)rZ)rr�r�rr�r�r�next_id�	next_hrefZnum_chgZ	in_changer�r2r�rrr�_convert_flags�s>
�
zHtmlDiff._convert_flagsc
CsR|��|�||�\}}|r"|}nd}t||||j|jd�}|jrL|�|�}|�|�\}	}
}|�|	|
|||�\}	}
}}}
g}d}t	t
|��D]P}||dkr�|dkr�|�d�q�|�||
||||	||||
|f�q�|s�|�rddd|dd|f}nd}|jt
d�|�||jd	d
�}|�dd��d
d��dd��dd��dd�S)NrtzV            <tr><td class="diff_next"%s>%s</td>%s<td class="diff_next">%s</td>%s</tr>
r
z)        </tbody>        
        <tbody>
z <thead><tr>%s%s%s%s</tr></thead>z!<th class="diff_next"><br /></th>z+<th colspan="2" class="diff_header">%s</th>rr')Z	data_rows�
header_rowr�z+z<span class="diff_add">z-z<span class="diff_sub">z^z<span class="diff_chg">r�z</span>r�r)r	r�r�r�r�r�r�rrr8r0r+�_table_templater�rqrrO)rr�r�r�r�r�r�Z
context_linesr�r�r�rrr
rmZfmtr2r
r�rrrr��sl�
��

������zHtmlDiff.make_table)rrFr�)rrFr�)rdrerfr�r�rr�rrrr�r�r�r�rr�r	rr�rrrrr�s0�
��7/�ccsnzddd�t|�}Wn"tk
r8td|�d�YnXd|f}|D]"}|dd�|krF|dd�VqFdS)Nr�r�)r'r�z)unknown delta choice (must be 1 or 2): %rr�r�)�int�KeyErrorri)ZdeltaZwhichrV�prefixesr�rrrrs��cCsddl}ddl}|�|�SrA)�doctest�difflibZtestmod)rrrrr�_test!sr�__main__)rXrg)r�)rrrrrXr�)rrrrrXr�)r�r�r�r�rXr�)#�__all__�heapqrrj�collectionsrZ_namedtuplerrrrrsrr�r��matchrrr�r	r�rr�r
rr�r�r�rr��objectrrrrdrrrr�<module>s��


1	I
�
I�
L�
%�
	
a 
__pycache__/locale.cpython-38.opt-1.pyc000064400000103603151153537570013621 0ustar00U

e5do1�M@s0dZddlZddlZddlZddlZddlZddlmZddl	Z	dddddd	d
ddd
dddddddddddddgZ
dd�Zdd�Zzddl
TWnLek
r�d Zd!Zd"ZdZd#Zd$Zd%Zd&ZeZd'd
�Z�d�d(d�ZYnXde�kr�eZde�kr�eZeZiZe	� e�d)d
��Zd*d+�Z!�d�d-d.�Z"d/d0�Z#e�$d1�Z%�d�d2d3�Z&�d�d4d�Z'�d�d5d�Z(�d�d7d�Z)d8d
�Zd9d:�Z*e+fd;d�Z,d<d�Z-d=d>�Z.eZ/d?d@�Z0dAdB�Z1dCd�Z2dDdE�Z3dFdG�Z4�d�dId�Z5efdJd�Z6�d�dKd�ZefdLd	�Z7ej8�9dM��r�d�dNd�Z:nRze;Wn<e<k
�rPe=edO��r@�d�dPd�Z:n�d�dQd�Z:YnX�d�dRd�Z:dSdSdTdUdUdVdWdXdYdZdTd[d\d]dTdTdTd^d_d`dad]dbd[dcddd\dedfdgdhdUdidjdVdkdldmdndodpdXdYdZdq�,Z>e?e>�@��D]"\ZAZBeA�Cdrds�ZAe>�DeAeB��q�dtdtdtdudvdwdxdxdydzd{d{d|d}d~ddd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�dSd�dSdSd|d�dSdSd�d�d�d�d�d�d�d�d|d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d|d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d|d�d�d�d�d�d�d�d|d�d|dSd|d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��dd͐d�d�d�d�d�d�d�d�d�d�d�d�d	�d
�d
�d�dd��d
�d�d�d�d�d�d
�d�d�d�d�d�d�d�d�d�dd�d�d�d��d�d�d�ddΐd�d�d�d�d�d�d�d�d�d�d�d�d�dd�d�d��d�d �d!�d!�d!�d"�d#�d$�d%�d&�d'�d'�d(�d)�d'�d'�d&�d&d|d�d|d�d|d�d*�d+�d*�d*�d,�d,�d,�d�d�d-�d.�d.�d.�d/�d/�d.�d.�d.�d.�d.�d0�d0�d0�d1�d0�d2�d3�d4�d4�d5�d6�d6�d7�d7�d7�d8�d7�d7�d9�d9�d:�d;�d<�d<�d=�d=�d>�d?�d@�dA�dB�dC�dD�dE�dE�dF�dF�dE�dC�dC�dG�dG�dH�dI�dJ�dJ�dK�dL�dM�dN�dO�dO�dP�dQ�dR�dR�dS�dS�dT�dU�dV�dV�dW�dW�dX�dX�dY�dZd�d��d[�d\�d]�d^�d_�d`dȐdad�dȐdb�db�dc�dd�dc�dc�dc�dc�de�de�df�df�dd�dd�db�dg�dg�dh�di�dj�dj�dk�dl�dl�dm�dn�do�dp�dq�dr�dq�ds�ds�dt�dt�dt�du�dvdSdS�dw�dw�dx�du�dv�du�dy�dz�d{�d{�d{�d|�d|�d}�d{�d~�d�d�d��d��d��d��d��d��d��d��d��d��d��d��d�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d�d�d�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d�d��d��d��d��d��d��d��d��dddÐdÐdÐdÐdĐdĐdŐdŐdƐdǐdȐdɐdɐdʐdʐdːd̐d�d��dΐd�d��dАdАdѐdҐd�d�d��dӐdӐdԐ�LZE�dՐd֐dאdؐdِdڐdېdܐdݐdސdߐd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d��d��d��d��d��d��d��d��d��d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d �d!�d"�d#�d$�d%�d&�d'�d(�d)�d*�d+�d,�d-�d.�d.�d/�d0�d1�d2�d3�d4�d5�d6�d7�d8�d9�d:�d;�d<�d=�d>�d?�d@�dA�dB�dC�dD�dE�dF�dG�dH�dI�dJ�dK�dL�dM�dN�dO�dP�dQ�dR�dS�dT�dU�dV�dW�dX�dY�dZ�d[�d\�d]�d^�d_�d`�da�db�dc�dd�de�df�dg�df�dg�dh�di�dj�dk�dl�dm�dn�dm�do�dp�dq�dr�ds�dt�du�dv�dw�dx�dy�dz�d{�d|�d}�d~�d�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d��d���ZF�d��d��ZGzeWne<k
�
r�YnXe
�H�d��eI�d�k�r,eJ�d��eJ�eG�eJ�eJ�d��eJ�e.�dS(�a�Locale support module.

The module provides low-level access to the C lib's locale APIs and adds high
level number formatting APIs as well as a locale aliasing engine to complement
these.

The aliasing engine includes support for many commonly used locale names and
maps them to values suitable for passing to the C lib's setlocale() function. It
also includes default encodings for all supported locale names.

�N)�str�	getlocale�getdefaultlocale�getpreferredencoding�Error�	setlocale�resetlocale�
localeconv�strcoll�strxfrmr�atof�atoi�format�
format_string�currency�	normalize�LC_CTYPE�
LC_COLLATE�LC_TIME�LC_MONETARY�
LC_NUMERIC�LC_ALL�CHAR_MAXcCs||k||kS)zZ strcoll(string,string) -> int.
        Compares two strings according to the locale.
    �)�a�brr�/usr/lib64/python3.8/locale.py�_strcoll!srcCs|S)z\ strxfrm(string) -> string.
        Returns a string that behaves for cmp locale-aware.
    r)�srrr�_strxfrm'sr)�*�������cCs,dgddddgddddddddddddd�S)zd localeconv() -> dict.
            Returns numeric and monetary locale-specific parameters.
        r!��.)�grouping�currency_symbol�n_sign_posn�
p_cs_precedes�
n_cs_precedes�mon_grouping�n_sep_by_space�
decimal_point�
negative_sign�
positive_sign�p_sep_by_space�int_curr_symbol�p_sign_posn�
thousands_sep�mon_thousands_sep�frac_digits�mon_decimal_point�int_frac_digitsrrrrrr	?s&�cCs|dkrtd��dS)zd setlocale(integer,string=None) -> string.
            Activates/queries locale processing.
        )Nr(�Cz*_locale emulation only supports "C" localer<)r)�category�valuerrrrWscCst�}tr|�t�|S)N)�_localeconv�_override_localeconv�update)�drrrr	ls
ccsJd}|D]<}|tkrdS|dkr:|dkr2td��|Vq2|V|}qdS)Nrzinvalid grouping)r�
ValueError)r*Z
last_interval�intervalrrr�_grouping_intervalszsrEFc
Cs�t�}||rdpd}||r dp"d}|s2|dfS|ddkr\|��}|t|�d�}|}nd}d}g}t|�D]B}	|r�|dd	kr�|}d}q�|�||	d��|d|	�}qp|r�|�|�|��||�|�|t|�t|�d
fS)Nr8r7r/r*r���� r(�
0123456789r&)r	�rstrip�lenrE�append�reverse�join)
r�monetary�convr7r*�strippedZright_spacesZleft_spaces�groupsrDrrr�_group�s2
�rRcCsdd}|r&||dkr&|d7}|d8}qt|�d}|rT||dkrT|d8}|d8}q2|||d�S)NrrGr&)rJ)rZamountZlposZrposrrr�_strip_padding�s

rSzG%(?:\((?P<key>.*?)\))?(?P<modifiers>[-#0-9 +*.hlL]*?)[eEfFgGdiouxXcrs%]c	Gs�|r||f|}n||}|ddkr~d}|�d�}|rRt|d|d�\|d<}t�|r^dp`d}|�|�}|r�t||�}n2|ddkr�d}|r�t||d�\}}|r�t||�}|S)	NrFZeEfFgGrr)�rNr:r1Zdiu)�splitrRr	rMrS)	�percentr>r*rN�
additionalZ	formattedZseps�partsr1rrr�_format�s*
�

rYc
	Cs
tt�|��}t�d|�}t|tj�rjg}|D]8}|��ddkrN|�d�q.|�t	|��|||��q.n�t|t
�sz|f}g}d}|D]r}|��ddkr�|�d�q�|�d��d�}	|�t	|��||||f||d|d|	����|d|	7}q�t
|�}||S)aFormats a string in the same way that the % formatting would use,
    but takes the current locale into account.

    Grouping is applied if the third parameter is true.
    Conversion uses monetary thousands separator and grouping strings if
    forth parameter monetary is true.z%srF�%rZ	modifiersr r&)�list�_percent_re�finditer�sub�
isinstance�_collections_abc�Mapping�grouprKrY�tuple�count)
�f�valr*rNZpercentsZnew_fZnew_valZperc�iZ	starcountrrrr�s4
��cGs^ddl}|jdtdd�t�|�}|r:t|���t|�krJtdt|���t	||||f|��S)z&Deprecated, use format_string instead.rNz`This method will be removed in a future version of Python. Use 'locale.format_string()' instead.r')�
stacklevelzHformat() must be given exactly one %%char format specifier, %s not valid)
�warnings�warn�DeprecationWarningr\�matchrJrbrC�reprrY)rVr>r*rNrWrirlrrrr�s�
�TcCsft�}||rdpd}|dkr&td��td|t|�|dd�}d|d	}|r�||rXd
pZd}||dkrld
pnd}||dkr�dp�d}	|r�||	r�dp�d|}n||	r�dp�d|}||dkr�dp�d}
||dkr�dp�d}|
dkr�d|d}n`|
dk�r||}nL|
dk�r||}n8|
dk�r2|�d|�}n |
dk�rJ|�d	|�}n||}|�dd��d	d�S)zIFormats val according to the currency settings
    in the current locale.r;r9r!z9Currency formatting is not possible using the 'C' locale.z%%.%ifTrT�<�>r5r+rr.r-r0r4rGr(r,r6r2r3�(�)r&r'r#r%)r	rCrY�abs�replace)rfZsymbolr*Z
internationalrOZdigitsrZsmbZprecedesZ	separatedZsign_posZsignrrrrs6





cCs
td|�S)z8Convert float to string, taking the locale into account.z%.12g)rY)rfrrrr0scCs:t�}|d}|r|�|d�}|d}|r6|�|d�}|S)zHParses a string as a normalized number according to the locale settings.r7r(r1r))r	rs)�stringrO�tsZddrrr�
delocalize4srvcCs|t|��S)z<Parses a string as a float according to the locale settings.)rv)rt�funcrrrrDscCstt|��S)zAConverts a string to an integer according to the locale settings.)�intrv)rtrrrr
HscCsBttd�tddd�}t|dt|��td�}t|dt|��dS)Nr(z%di�[r&�isg��Q�	@)rrr�printr
rr)�s1rrr�_testLs

r|cCs�d|kr|d|�d��}n|}t�|�}tjj�|��|�}|}|��}|tkr\t|}n(|�dd�}|�dd�}|tkr�t|}|d|S)Nr)�_r(�-)�index�	encodings�normalize_encoding�aliases�get�lower�locale_encoding_aliasrs)�code�encoding�langname�
norm_encodingrrr�_replace_encoding^s 
�
r�cCsR|dkrFd|kr|dS|�d�\}}}|dkr4|S|dkrFt|d�S|d|S)N�euror)z.ISO8859-15)�
ISO8859-15�UTF-8�	ISO8859-1r��@)�	partitionr�)r��modifierr}r�rrr�_append_modifierus
r�c	Cs�|��}d|kr|�dd�}d|kr6|�dd�\}}nd}d|krZ|�d�dd�\}}n|}d}|}|r�|�dd�}|�d	d�}|d|7}|}|r�|d|7}t�|d�}|dk	r�|S|�rt�|d�}|dk	�rd|kr�t||�S|�dd�d��|k�r|S|�r�|}|�r"|d|7}t�|d�}|dk	�rnd|k�rLt||�S|�dd�\}}t||�d|S|�r�t�|d�}|dk	�r�d|k�r�t||�}t||�S|�dd�\}}|��|k�r�t||�d|S|S)
a� Returns a normalized locale code for the given locale
        name.

        The returned locale code is formatted for use with
        setlocale().

        If normalization fails, the original name is returned
        unchanged.

        If the given encoding is not known, the function defaults to
        the default encoding for the locale code just like setlocale()
        does.

    �:r)r�r&r(Nr'r~r})r�rsrU�locale_aliasr�r�r�)	�
localenamer�r�r�r�Zlang_encr�Zlookup_nameZdefmodrrrr�s`








cCs~t|�}d|kr8|�dd�\}}|dkr8d|kr8|dfSd|krVt|�d�dd��S|dkrbd	S|d
krndStd|��dS)
a� Parses the locale code for localename and returns the
        result as tuple (language code, encoding).

        The localename is normalized and passed through the locale
        alias engine. A ValueError is raised in case the locale name
        cannot be parsed.

        The language code corresponds to RFC 1766.  code and encoding
        can be None in case the values cannot be determined or are
        unknown to this implementation.

    r�r&r�r)�iso-8859-15Nr'r<)NNr��Nr�zunknown locale: %s)rrUrcrC)r�r�r�rrr�_parse_localename�sr�c	Cs\z4|\}}|dkrd}|dkr$|WS|d|WSWn"ttfk
rVtd�d�YnXdS)z� Builds a locale code from the given tuple (language code,
        encoding).

        No aliasing or normalizing takes place.

    Nr<r)zXLocale must be None, a string, or an iterable of two strings -- language code, encoding.)�	TypeErrorrC)ZlocaletupleZlanguager�rrr�_build_localename�s�r��rrZLANG�LANGUAGEc	Cs�zddl}|��\}}Wnttfk
r0Yn8Xtjdkr`|r`|dd�dkr`t�t|d��}||fSddl	}|j
j}|D],}||d�}|r||dkr�|�d�d}q�q|d}t|�S)	a� Tries to determine the default locale settings and returns
        them as tuple (language code, encoding).

        According to POSIX, a program which has not called
        setlocale(LC_ALL, "") runs using the portable 'C' locale.
        Calling setlocale(LC_ALL, "") lets it use the default locale as
        defined by the LANG variable. Since we don't want to interfere
        with the current locale setting we thus emulate the behavior
        in the way described above.

        To maintain compatibility with other platforms, not only the
        LANG variable is tested, but a list of variables given as
        envvars parameter. The first found to be defined will be
        used. envvars defaults to the search path used in GNU gettext;
        it must always contain the variable name 'LANG'.

        Except for the code 'C', the language code corresponds to RFC
        1766.  code and encoding can be None in case the values cannot
        be determined.

    rNZwin32r'Z0xr�r�r<)
�_localeZ_getdefaultlocale�ImportError�AttributeError�sys�platform�windows_localer�rx�os�environrUr�)Zenvvarsr�r�r�r��lookupZvariabler�rrrr
s$
cCs(t|�}|tkr d|kr td��t|�S)ap Returns the current setting for the given locale category as
        tuple (language code, encoding).

        category may be one of the LC_* value except LC_ALL. It
        defaults to LC_CTYPE.

        Except for the code 'C', the language code corresponds to RFC
        1766.  code and encoding can be None in case the values cannot
        be determined.

    �;z category LC_ALL is not supported)�
_setlocalerr�r�)r=r�rrrr?s
cCs$|rt|t�stt|��}t||�S)a^ Set the locale for the given category.  The locale can be
        a string, an iterable of two strings (language code and encoding),
        or None.

        Iterables are converted to strings using the locale aliasing
        engine.  Locale strings are passed directly to the C lib.

        category may be given as one of the LC_* values.

    )r_�_builtin_strrr�r�)r=ZlocalerrrrQscCst|tt���dS)z� Sets the locale for category to the default setting.

        The default setting is determined by calling
        getdefaultlocale(). category defaults to LC_ALL.

    N)r�r�r)r=rrrrbs�wincCstjjrdSddl}|�d�S)z1Return the charset that the user is likely using.r�rNF)r��flags�	utf8_mode�_bootlocaler)�do_setlocaler�rrrrnsZgetandroidapilevelcCsdSr�r)r�rrrr|scCs&tjjrdSt�d}|dkr"d}|S)zfReturn the charset that the user is likely using,
                by looking at environment variables.r�r&N�ascii)r�r�r�r)r��resrrrr�s
cCs`tjjrdSddl}|rDtt�}zttd�Wntk
rBYnX|�d�}|r\tt|�|S)zdReturn the charset that the user is likely using,
            according to the system configuration.r�rNr(F)r�r�r�r�rrrr)r�r�Zoldloc�resultrrrr�s

r<r�ZJIS7ZeucJPzKOI8-CZCP1251ZCP1255ZCP1256z	ISO8859-2z	ISO8859-5r�z
ISO8859-10z
ISO8859-11z
ISO8859-13z
ISO8859-14z
ISO8859-16z	ISO8859-3z	ISO8859-4z	ISO8859-6z	ISO8859-7z	ISO8859-8z	ISO8859-9ZSJISZTACTISZeucKRr�zKOI8-RzKOI8-TzKOI8-UZRK1048),�437�c�enZjisZjis7ZajecZkoi8cZmicrosoftcp1251Zmicrosoftcp1255Zmicrosoftcp1256Z88591Z88592Z88595Z885915r��latin_1�	iso8859_1�
iso8859_10�
iso8859_11�
iso8859_13�
iso8859_14�
iso8859_15�
iso8859_16�	iso8859_2�	iso8859_3�	iso8859_4�	iso8859_5�	iso8859_6�	iso8859_7�	iso8859_8�	iso8859_9�
iso2022_jp�	shift_jis�tactis�euc_jp�euc_kr�utf_8�koi8_rZkoi8_tZkoi8_u�kz1048�cp1251�cp1255�cp1256r}r(zaz_AZ.KOI8-Czaa_DJ.ISO8859-1zaa_ER.UTF-8zaa_ET.UTF-8zaf_ZA.ISO8859-1zagr_PE.UTF-8zak_GH.UTF-8zam_ET.UTF-8zen_US.ISO8859-1zan_ES.ISO8859-15zanp_IN.UTF-8zar_AA.ISO8859-6zar_AE.ISO8859-6zar_BH.ISO8859-6zar_DZ.ISO8859-6zar_EG.ISO8859-6zar_IN.UTF-8zar_IQ.ISO8859-6zar_JO.ISO8859-6zar_KW.ISO8859-6zar_LB.ISO8859-6zar_LY.ISO8859-6zar_MA.ISO8859-6zar_OM.ISO8859-6zar_QA.ISO8859-6zar_SA.ISO8859-6zar_SD.ISO8859-6zar_SS.UTF-8zar_SY.ISO8859-6zar_TN.ISO8859-6zar_YE.ISO8859-6zas_IN.UTF-8zast_ES.ISO8859-15zayc_PE.UTF-8zaz_AZ.ISO8859-9Ezaz_IR.UTF-8zbe_BY.CP1251zbe_BY.UTF-8@latinzbg_BG.UTF-8zbem_ZM.UTF-8zber_DZ.UTF-8zber_MA.UTF-8zbg_BG.CP1251zbhb_IN.UTF-8zbho_IN.UTF-8zbho_NP.UTF-8zbi_VU.UTF-8zbn_BD.UTF-8zbn_IN.UTF-8zbo_CN.UTF-8zbo_IN.UTF-8znb_NO.ISO8859-1zbr_FR.ISO8859-1zbrx_IN.UTF-8zbs_BA.ISO8859-2zbyn_ER.UTF-8zfr_CA.ISO8859-1zen_US.UTF-8zca_ES.ISO8859-1zca_AD.ISO8859-1zca_ES.UTF-8@valenciazca_FR.ISO8859-1zca_IT.ISO8859-1zce_RU.UTF-8zzh_CN.eucCNzzh_TW.eucTWzchr_US.UTF-8zckb_IQ.UTF-8zcmn_TW.UTF-8zcrh_UA.UTF-8zhr_HR.ISO8859-2zcs_CZ.ISO8859-2zcsb_PL.UTF-8zcv_RU.UTF-8zcy_GB.ISO8859-1zda_DK.ISO8859-1zde_DE.ISO8859-1zde_AT.ISO8859-1zde_BE.ISO8859-1zde_CH.ISO8859-1zde_IT.ISO8859-1zde_LI.UTF-8zde_LU.ISO8859-1zdoi_IN.UTF-8znl_NL.ISO8859-1znl_BE.ISO8859-1zdv_MV.UTF-8zdz_BT.UTF-8zee_EE.ISO8859-4zet_EE.ISO8859-1zel_GR.ISO8859-7zel_CY.ISO8859-7zel_GR.ISO8859-15zen_AG.UTF-8zen_AU.ISO8859-1zen_BE.ISO8859-1zen_BW.ISO8859-1zen_CA.ISO8859-1zen_DK.ISO8859-1zen_DL.UTF-8zen_GB.ISO8859-1zen_HK.ISO8859-1zen_IE.ISO8859-1zen_IL.UTF-8zen_IN.ISO8859-1zen_NG.UTF-8zen_NZ.ISO8859-1zen_PH.ISO8859-1zen_SC.UTF-8zen_SG.ISO8859-1zen_US.ISO8859-15zen_ZA.ISO8859-1zen_ZM.UTF-8zen_ZW.ISO8859-1zen_ZS.UTF-8zen_EN.ISO8859-1zeo_XX.ISO8859-3zeo.UTF-8zeo_EO.ISO8859-3zeo_US.UTF-8zes_ES.ISO8859-1zes_AR.ISO8859-1zes_BO.ISO8859-1zes_CL.ISO8859-1zes_CO.ISO8859-1zes_CR.ISO8859-1zes_CU.UTF-8zes_DO.ISO8859-1zes_EC.ISO8859-1zes_GT.ISO8859-1zes_HN.ISO8859-1zes_MX.ISO8859-1zes_NI.ISO8859-1zes_PA.ISO8859-1zes_PE.ISO8859-1zes_PR.ISO8859-1zes_PY.ISO8859-1zes_SV.ISO8859-1zes_US.ISO8859-1zes_UY.ISO8859-1zes_VE.ISO8859-1zet_EE.ISO8859-15zeu_ES.ISO8859-1zeu_FR.ISO8859-1zfa_IR.UTF-8zfa_IR.ISIRI-3342zff_SN.UTF-8zfi_FI.ISO8859-15zfil_PH.UTF-8zfi_FI.ISO8859-1zfo_FO.ISO8859-1zfr_FR.ISO8859-1zfr_BE.ISO8859-1zfr_CH.ISO8859-1zfr_LU.ISO8859-1zfur_IT.UTF-8zfy_DE.UTF-8zfy_NL.UTF-8zga_IE.ISO8859-1zgl_ES.ISO8859-1zgd_GB.ISO8859-1zgez_ER.UTF-8zgez_ET.UTF-8zgu_IN.UTF-8zgv_GB.ISO8859-1zha_NG.UTF-8zhak_TW.UTF-8zhe_IL.ISO8859-8zhi_IN.ISCII-DEVzhif_FJ.UTF-8zhne_IN.UTF-8zhsb_DE.ISO8859-2zht_HT.UTF-8zhu_HU.ISO8859-2zhy_AM.UTF-8zhy_AM.ARMSCII_8zia.UTF-8zia_FR.UTF-8zis_IS.ISO8859-1zid_ID.ISO8859-1zig_NG.UTF-8zik_CA.UTF-8zit_IT.ISO8859-1zit_CH.ISO8859-1ziu_CA.NUNACOM-8ziw_IL.UTF-8zja_JP.eucJPz
ja_JP.SJISzka_GE.GEORGIAN-ACADEMYzka_GE.GEORGIAN-PSzkab_DZ.UTF-8z
kk_KZ.ptcp154zkl_GL.ISO8859-1zkm_KH.UTF-8zkn_IN.UTF-8zko_KR.eucKRzkok_IN.UTF-8zks_IN.UTF-8zks_IN.UTF-8@devanagarizku_TR.ISO8859-9zkw_GB.ISO8859-1zky_KG.UTF-8zlb_LU.UTF-8zlg_UG.ISO8859-10zli_BE.UTF-8zli_NL.UTF-8zlij_IT.UTF-8zlt_LT.ISO8859-13zln_CD.UTF-8zlo_LA.MULELAO-1zlo_LA.IBM-CP1133zlv_LV.ISO8859-13zlzh_TW.UTF-8zmag_IN.UTF-8zmai_IN.UTF-8zmai_NP.UTF-8zmfe_MU.UTF-8zmg_MG.ISO8859-15zmhr_RU.UTF-8zmi_NZ.ISO8859-1zmiq_NI.UTF-8zmjw_IN.UTF-8zmk_MK.ISO8859-5zml_IN.UTF-8zmn_MN.UTF-8zmni_IN.UTF-8zmr_IN.UTF-8zms_MY.ISO8859-1zmt_MT.ISO8859-3zmy_MM.UTF-8znan_TW.UTF-8znds_DE.UTF-8znds_NL.UTF-8zne_NP.UTF-8znhn_MX.UTF-8zniu_NU.UTF-8zniu_NZ.UTF-8znl_AW.UTF-8znn_NO.ISO8859-1zno_NO.ISO8859-1zny_NO.ISO8859-1znr_ZA.ISO8859-1znso_ZA.ISO8859-15zoc_FR.ISO8859-1zom_ET.UTF-8zom_KE.ISO8859-1zor_IN.UTF-8zos_RU.UTF-8zpa_IN.UTF-8zpa_PK.UTF-8zpap_AN.UTF-8zpap_AW.UTF-8zpap_CW.UTF-8zpd_US.ISO8859-1zpd_DE.ISO8859-1zph_PH.ISO8859-1zpl_PL.ISO8859-2zpt_PT.ISO8859-1zpt_BR.ISO8859-1zpp_AN.ISO8859-1zps_AF.UTF-8zquz_PE.UTF-8zraj_IN.UTF-8zro_RO.ISO8859-2zru_RU.UTF-8zru_UA.KOI8-Uzru_RU.KOI8-Rzrw_RW.ISO8859-1zsa_IN.UTF-8zsat_IN.UTF-8zsc_IT.UTF-8zsd_IN.UTF-8zsd_IN.UTF-8@devanagarizsd_PK.UTF-8zse_NO.UTF-8zsr_RS.UTF-8@latinzsgs_LT.UTF-8zsr_CS.ISO8859-2zsh_HR.ISO8859-2zshn_MM.UTF-8zshs_CA.UTF-8zsi_LK.UTF-8zsid_ET.UTF-8zsk_SK.ISO8859-2zsl_SI.ISO8859-2zsl_CS.ISO8859-2zsm_WS.UTF-8zso_DJ.ISO8859-1zso_ET.UTF-8zso_KE.ISO8859-1zso_SO.ISO8859-1zsr_CS.ISO8859-5zsq_AL.ISO8859-2zsq_MK.UTF-8zsr_RS.UTF-8zsr_CS.UTF-8@latinzsr_CS.UTF-8zsr_ME.UTF-8zsr_CS.CP1251zss_ZA.ISO8859-1zst_ZA.ISO8859-1zsv_SE.ISO8859-1zsv_FI.ISO8859-1zsw_KE.UTF-8zsw_TZ.UTF-8zszl_PL.UTF-8z
ta_IN.TSCII-0zta_LK.UTF-8ztcy_IN.UTF-8zte_IN.UTF-8ztg_TJ.KOI8-Czth_TH.ISO8859-11zth_TH.TIS620zthe_NP.UTF-8zti_ER.UTF-8zti_ET.UTF-8ztig_ER.UTF-8ztk_TM.UTF-8ztl_PH.ISO8859-1ztn_ZA.ISO8859-15zto_TO.UTF-8ztpi_PG.UTF-8ztr_TR.ISO8859-9ztr_CY.ISO8859-9zts_ZA.ISO8859-1ztt_RU.TATAR-CYRztt_RU.UTF-8@iqtelifzug_CN.UTF-8zuk_UA.KOI8-Uz	en_US.utfzunm_US.UTF-8zur_PK.CP1256zur_IN.UTF-8zuz_UZ.UTF-8zve_ZA.UTF-8z
vi_VN.TCVNzvi_VN.VISCIIzwa_BE.ISO8859-1zwae_CH.UTF-8zwal_ET.UTF-8zwo_SN.UTF-8zxh_ZA.ISO8859-1zyi_US.CP1255zyo_NG.UTF-8zyue_HK.UTF-8zyuw_PG.UTF-8zzh_CN.gb2312z
zh_TW.big5zzh_HK.big5hkscszzh_SG.GB2312z	zh_SG.GBKzzu_ZA.ISO8859-1(LZa3Za3_azz
a3_az.koicZaa_djZaa_erZaa_etZafZaf_zaZagr_peZak_ghZamZam_etZamericanZan_esZanp_inZarZar_aaZar_aeZar_bhZar_dzZar_egZar_inZar_iqZar_joZar_kwZar_lbZar_lyZar_maZar_omZar_qaZar_saZar_sdZar_ssZar_syZar_tnZar_ye�arabic�asZas_inZast_esZayc_peZazZaz_azzaz_az.iso88599eZaz_irZbezbe@latinz
be_bg.utf8Zbe_byzbe_by@latinZbem_zmZber_dzZber_maZbgZbg_bgzbhb_in.utf8Zbho_inZbho_npZbi_vuZbn_bdZbn_inZbo_cnZbo_inZbokmalubokmål�brZbr_frZbrx_inZbsZbs_baZ	bulgarianZbyn_err�zc-frenchzc.asciizc.enz
c.iso88591zc.utf8Zc_czc_c.cZcaZca_adZca_eszca_es@valenciaZca_frZca_itZcatalanZce_ruZcextendz	chinese-sz	chinese-tZchr_usZckb_iqZcmn_twZcrh_uaZcroatianZcsZcs_csZcs_czZcsb_plZcv_ruZcyZcy_gbZczZcz_czZczechZdaZda_dkZdanishZdanskZdeZde_atZde_beZde_chZde_deZde_itz
de_li.utf8Zde_luZdeutschZdoi_inZdutchzdutch.iso88591Zdv_mvZdz_btZeeZee_eeZeestiZelZel_cyZel_grz
el_gr@euror�Zen_agZen_auZen_beZen_bwZen_caZen_dkz
en_dl.utf8Zen_gbZen_hkZen_ieZen_ilZen_inZen_ngZen_nzZen_phz
en_sc.utf8Zen_sgZen_ukZen_uszen_us@euro@euroZen_zaZen_zmZen_zwz
en_zw.utf8Zeng_gbZenglishzenglish.iso88591Z
english_ukzenglish_united-stateszenglish_united-states.437Z
english_usZeozeo.utf8Zeo_eoz
eo_us.utf8Zeo_xxZesZes_arZes_boZes_clZes_coZes_crZes_cuZes_doZes_ecZes_esZes_gtZes_hnZes_mxZes_niZes_paZes_peZes_prZes_pyZes_svZes_usZes_uyZes_veZestonianZetZet_eeZeuZeu_esZeu_frZfaZfa_irzfa_ir.isiri3342Zff_snZfiZfi_fiZfil_phZfinnishZfoZfo_fo�frZfr_beZfr_caZfr_chZfr_frZfr_luu	françaisZfre_frZfrenchzfrench.iso88591Z
french_franceZfur_itZfy_deZfy_nlZgaZga_ieZgalegoZgalicianZgdZgd_gbZger_deZgermanzgerman.iso88591Zgerman_germanyZgez_erZgez_etZglZgl_es�greekZgu_inZgvZgv_gbZha_ngZhak_twZheZhe_il�hebrew�hiZhi_inzhi_in.isciidevZhif_fjZhneZhne_inZhrZhr_hrZhrvatskiZhsb_deZht_htZhuZhu_huZ	hungarianZhy_amzhy_am.armscii8ZiaZia_frZ	icelandic�idZid_idZig_ngZik_ca�inZin_idryZis_isz
iso-8859-1r�z	iso8859-1z
iso8859-15�
iso_8859_1�iso_8859_15�itZit_chZit_itZitalianZiuZiu_caziu_ca.nunacom8ZiwZiw_ilz
iw_il.utf8ZjaZja_jpz	ja_jp.euczja_jp.mscodez	ja_jp.pckZjapanZjapanesezjapanese-euczjapanese.eucZjp_jpZkaZka_gezka_ge.georgianacademyzka_ge.georgianpszka_ge.georgianrsZkab_dzZkk_kzZklZkl_glZkm_khZknZkn_inZkoZko_krz	ko_kr.eucZkok_in�koreanz
korean.eucZksZks_inzks_in@devanagari.utf8Zku_tr�kwZkw_gbZkyZky_kgZlb_luZlg_ugZli_beZli_nlZlij_itZ
lithuanianZln_cd�loZlo_lazlo_la.cp1133zlo_la.ibmcp1133zlo_la.mulelao1�ltZlt_ltZlvZlv_lvZlzh_twZmag_inZmaiZmai_inZmai_npZmfe_muZmg_mgZmhr_ru�miZmi_nzZmiq_niZmjw_inZmkZmk_mkZmlZml_inZmn_mnZmni_inZmrZmr_inZmsZms_myZmtZmt_mtZmy_mmZnan_twZnbZnb_noZnds_deZnds_nlZne_npZnhn_mxZniu_nuZniu_nz�nlZnl_awZnl_beZnl_nlZnnZnn_noZnoz
no@nynorskZno_nozno_no.iso88591@bokmalzno_no.iso88591@nynorskZ	norwegianZnrZnr_zaZnsoZnso_zaZnyZny_noZnynorskZocZoc_frZom_etZom_ke�orZor_inZos_ruZpaZpa_inZpa_pkZpap_anZpap_awZpap_cwZpdZpd_deZpd_usZphZph_phZplZpl_plZpolishZ
portugueseZportuguese_brazil�posixz
posix-utf2ZppZpp_anZps_afZptZpt_brZpt_ptZquz_peZraj_inZroZro_roZromanianZruZru_ruZru_uaZrumanianZrussianZrwZrw_rwZsa_inZsat_inZsc_itZsdZsd_inzsd_in@devanagari.utf8Zsd_pkZse_noZ
serbocroatianZsgs_ltZshzsh_ba.iso88592@bosniaZsh_hrzsh_hr.iso88592Zsh_spZsh_yuZshn_mmZshs_caZsiZsi_lkZsid_etZsinhalaZskZsk_skZslZsl_csZsl_siZslovakZsloveneZ	slovenianZsm_wsZso_djZso_etZso_keZso_soZspZsp_yuZspanishZ
spanish_spainZsqZsq_alZsq_mk�srzsr@cyrilliczsr@latnZsr_cszsr_cs.iso88592@latnz
sr_cs@latnZsr_meZsr_rsz
sr_rs@latnZsr_spZsr_yuzsr_yu.cp1251@cyrilliczsr_yu.iso88592zsr_yu.iso88595zsr_yu.iso88595@cyrilliczsr_yu.microsoftcp1251@cyrillicz
sr_yu.utf8zsr_yu.utf8@cyrilliczsr_yu@cyrillicZssZss_za�stZst_zaZsvZsv_fiZsv_seZsw_keZsw_tzZswedishZszl_plZtaZta_inzta_in.tsciizta_in.tscii0Zta_lkztcy_in.utf8ZteZte_inZtgZtg_tjZthZth_thzth_th.tactiszth_th.tis620�thaiZthe_npZti_erZti_etZtig_erZtk_tmZtlZtl_phZtnZtn_zaZto_toZtpi_pgZtrZtr_cyZtr_trruZts_zaZttZtt_ruztt_ru.tatarcyrz
tt_ru@iqtelifZturkishZug_cnZukZuk_uaZunivZ	universalzuniversal.utf8@ucs4Zunm_usZurZur_inZur_pkZuzZuz_uzzuz_uz@cyrillicZveZve_zaZviZvi_vnz
vi_vn.tcvnzvi_vn.tcvn5712zvi_vn.visciizvi_vn.viscii111ZwaZwa_beZwae_chZwal_etZwo_snZxhZxh_zaZyiZyi_usZyo_ngZyue_hkZyuw_pgZzhZzh_cnz
zh_cn.big5z	zh_cn.eucZzh_hkzzh_hk.big5hkZzh_sgz	zh_sg.gbkZzh_twz	zh_tw.euczzh_tw.euctwZzuZzu_zaZaf_ZAZsq_ALZgsw_FRZam_ETZar_SAZar_IQZar_EGZar_LYZar_DZZar_MAZar_TNZar_OMZar_YEZar_SYZar_JOZar_LBZar_KWZar_AEZar_BHZar_QAZhy_AMZas_INZaz_AZZba_RUZeu_ESZbe_BYZbn_INZbs_BAZbr_FRZbg_BGZca_ESZzh_CHSZzh_TWZzh_CNZzh_HKZzh_SGZzh_MOZzh_CHTZco_FRZhr_HRZhr_BAZcs_CZZda_DKZgbz_AFZdiv_MVZnl_NLZnl_BEZen_USZen_GBZen_AUZen_CAZen_NZZen_IEZen_ZAZen_JAZen_CBZen_BZZen_TTZen_ZWZen_PHZen_INZen_MYZet_EEZfo_FOZfil_PHZfi_FIZfr_FRZfr_BEZfr_CAZfr_CHZfr_LUZfr_MCZfy_NLZgl_ESZka_GEZde_DEZde_CHZde_ATZde_LUZde_LIZel_GRZkl_GLZgu_INZha_NGZhe_ILZhi_INZhu_HUZis_ISZid_IDZiu_CAZga_IEZit_ITZit_CHZja_JPZkn_INZkk_KZZkh_KHZqut_GTZrw_RWZkok_INZko_KRZky_KGZlo_LAZlv_LVZlt_LTZdsb_DEZlb_LUZmk_MKZms_MYZms_BNZml_INZmt_MTZmi_NZZarn_CLZmr_INZmoh_CAZmn_MNZmn_CNZne_NPZnb_NOZnn_NOZoc_FRZor_INZps_AFZfa_IRZpl_PLZpt_BRZpt_PTZpa_INZquz_BOZquz_ECZquz_PEZro_ROZrm_CHZru_RUZsmn_FIZsmj_NOZsmj_SEZse_NOZse_SEZse_FIZsms_FIZsma_NOZsma_SEZsa_INZsr_SPZsr_BAZsi_LKZns_ZAZtn_ZAZsk_SKZsl_SIZes_ESZes_MXZes_GTZes_CRZes_PAZes_DOZes_VEZes_COZes_PEZes_ARZes_ECZes_CLZes_URZes_PYZes_BOZes_SVZes_HNZes_NIZes_PRZes_USZsw_KEZsv_SEZsv_FIZsyr_SYZtg_TJZtmz_DZZta_INZtt_RUZte_INZth_THZbo_BTZbo_CNZtr_TRZtk_TMZug_CNZuk_UAZwen_DEZur_PKZur_INZuz_UZZvi_VNZcy_GBZwo_SNZxh_ZAZsah_RUZii_CNZyo_NGZzu_ZA)�i6ii�i^iiiiiiii i$i(i,i0i4i8i<i@i+iMi,i,imi-i#iEi ii~iir%iiiiii|i�iiiii�ieiii	i	i	i	i	i	i	i	 i	$i	(i	,i	0i	4i	@i	Di	Hi%i8idiiiiiiiibiVi7iiiiiiioiGihi
i9iii!i]i]i<iiiiKi?iSi�i�iWii@iTi&i'i.ini/i>i>iLi:i�iziNi|iPiPiaiii�iHici)iiiiFikikikiiii;$i;i;i;i;i;i; i;i;iOiiiii[ili2ii$i
i
i
i
i
i
i
i
 i
$i
(i
,i
0i
4i
8i
<i
@i
Di
Hi
Li
Pi
TiAiiiZi(i_iIiDiJiiQiQiiBi�i"i.i i iCiCi*iRi�i4i�ixiji5cCs�i}|fdd�}|�|d=td�td�t�\}}td|p@d�td|pNd�t�td	�td�|��D]@\}}t|d
�t|�\}}td|p�d�td|p�d�t�qpt�td
�td�t�|��D]B\}}t|d
�t|�\}}td|p�d�td|�pd�t�q�zttd�Wn$td�td�td�YnhXt�td�td�|��D]F\}}t|d
�t|�\}}td|�p�d�td|�p�d�t��qldS)z Test function.
    cSs0t���D] \}}|dd�dkr
|||<q
dS)Nr#ZLC_)�globals�items)�
categories�k�vrrr�_init_categories�sz'_print_locale.<locals>._init_categoriesrz4Locale defaults as determined by getdefaultlocale():zH------------------------------------------------------------------------z
Language: z(undefined)z
Encoding: zLocale settings on startup:z...z
   Language: z
   Encoding: z,Locale settings after calling resetlocale():r(zNOTE:z9setlocale(LC_ALL, "") does not support the default localez&given in the OS environment variables.z4Locale settings after calling setlocale(LC_ALL, ""):N)rzrr�rrrr)r�r�Zlang�enc�namer=rrr�
_print_locale�sV



r��LC_MESSAGES�__main__zLocale aliasing:zNumber formatting:)N)F)FF)FF)FF)TFF)r�)N)T)T)T)T)K�__doc__r�r�Zencodings.aliases�rer`�builtinsrr��	functools�__all__rrr�r�rrrrr�rrrrCrr	rr�rr
r?r@�wrapsrErRrS�compiler\rYrrrrv�floatrr
r|r�r�r�rr�r�rrrr��
startswithr�CODESET�	NameError�hasattrr��sortedr�r�r�rs�
setdefaultr�r�r�rK�__name__rzrrrr�<module>st�	




%-S"5
$�6}�����
a��V:

__pycache__/code.cpython-38.opt-2.pyc000064400000011044151153537570013272 0ustar00U

e5d~)�@s�ddlZddlZddlmZmZddddgZGdd�d�ZGdd�de�Zdd	d�Ze	d
kr�ddl
Z
e
��Zej
ddd
d�e��Zejs�ejjr�dZndZee�dS)�N)�CommandCompiler�compile_command�InteractiveInterpreter�InteractiveConsole�interactrc@sBeZdZddd�Zddd�Zdd	�Zdd
d�Zdd
�Zdd�ZdS)rNcCs$|dkrddd�}||_t�|_dS)NZ__console__)�__name__�__doc__)�localsr�compile)�selfr	�r�/usr/lib64/python3.8/code.py�__init__s	
zInteractiveInterpreter.__init__�<input>�singlec
CsTz|�|||�}Wn&tttfk
r8|�|�YdSX|dkrFdS|�|�dS)NFT)r
�
OverflowError�SyntaxError�
ValueError�showsyntaxerror�runcode)r�source�filenameZsymbol�coderrr
�	runsource&s

z InteractiveInterpreter.runsourcecCs>zt||j�Wn(tk
r&�Yn|��YnXdS�N)�execr	�
SystemExit�
showtraceback)rrrrr
rMszInteractiveInterpreter.runcodecCs�t��\}}}|t_|t_|t_|rp|tkrpz|j\}\}}}}	Wntk
rVYnXt|||||	f�}|t_tjtj	kr�t
�||�}
|�d�
|
��nt�|||�dS)N�)�sys�exc_info�	last_type�
last_value�last_tracebackr�argsr�
excepthook�__excepthook__�	traceback�format_exception_only�write�join)rr�type�value�tb�msgZdummy_filename�lineno�offset�line�linesrrr
r`sz&InteractiveInterpreter.showsyntaxerrorcCs|t��\t_t_}}|t_zPt�|d|d|j�}tjtj	krT|�
d�|��nt�|d|d|�W5d}}XdS)Nr�r)rr r!r"r#r'�format_exception�tb_nextr%r&r)r*)rZlast_tbZeir2rrr
r�sz$InteractiveInterpreter.showtracebackcCstj�|�dSr)r�stderrr))r�datarrr
r)�szInteractiveInterpreter.write)N)rr)N)	r�
__module__�__qualname__rrrrrr)rrrr
rs	

'
#c@s:eZdZddd�Zdd�Zddd�Zd	d
�Zddd
�ZdS)rN�	<console>cCst�||�||_|��dSr)rrr�resetbuffer)rr	rrrr
r�s
zInteractiveConsole.__init__cCs
g|_dSr)�buffer)rrrr
r;�szInteractiveConsole.resetbuffercCsRz
tjWntk
r$dt_YnXz
tjWntk
rJdt_YnXd}|dkrx|�dtjtj||jjf�n|r�|�dt	|��d}zV|r�tj}ntj}z|�
|�}Wn&tk
r�|�d�YW�qYnX|�|�}Wq�t
k
�r|�d�|��d}Yq�Xq�|dk�r6|�d	|jj�n|d
k�rN|�d|�dS)Nz>>> z... zFType "help", "copyright", "credits" or "license" for more information.zPython %s on %s
%s
(%s)
z%s
r�
z
KeyboardInterrupt
znow exiting %s...
r)rZps1�AttributeErrorZps2r)�version�platform�	__class__r�str�	raw_input�EOFError�push�KeyboardInterruptr;)r�banner�exitmsgZcprt�more�promptr1rrr
r�sH


��



zInteractiveConsole.interactcCs6|j�|�d�|j�}|�||j�}|s2|��|S)Nr=)r<�appendr*rrr;)rr1rrIrrr
rE�szInteractiveConsole.pushrcCst|�Sr)�input)rrJrrr
rCszInteractiveConsole.raw_input)Nr:)NN)r)rr8r9rr;rrErCrrrr
r�s


6cCsJt|�}|dk	r||_n"zddl}Wntk
r8YnX|�||�dS)Nr)rrC�readline�ImportErrorr)rGZreadfuncZlocalrHZconsolerMrrr
rs�__main__z-q�
store_truez*don't print version and copyright messages)�action�helpr)NNNN)rr'Zcodeoprr�__all__rrrr�argparse�ArgumentParser�parser�add_argument�
parse_argsr$�q�flags�quietrGrrrr
�<module>s(�t
�__pycache__/selectors.cpython-38.opt-2.pyc000064400000031146151153537570014370 0ustar00U

e5d�H�@s�ddlmZmZddlmZddlmZddlZddlZddl	Z	dZ
dZdd�Zed	d
ddd
g�Z
de
_e	jdkr�de
j_de
j_de
j_de
j_Gdd�de�ZGdd�ded�ZGdd�de�ZGdd�de�ZGdd�de�Zeed�r�Gd d!�d!e�Zeed"��rGd#d$�d$e�Zeed%��r6Gd&d'�d'e�Zeed(��rRGd)d*�d*e�Zd*e�k�rdeZn:d$e�k�rveZn(d'e�k�r�eZnd!e�k�r�eZneZdS)+�)�ABCMeta�abstractmethod)�
namedtuple)�MappingN��c
Csft|t�r|}n<zt|���}Wn*tttfk
rJtd�|��d�YnX|dkrbtd�|���|S)NzInvalid file object: {!r}rzInvalid file descriptor: {})�
isinstance�int�fileno�AttributeError�	TypeError�
ValueError�format)�fileobj�fd�r�!/usr/lib64/python3.8/selectors.py�_fileobj_to_fds
��r�SelectorKeyrr�events�dataz�SelectorKey(fileobj, fd, events, data)

    Object used to associate a file object to its backing
    file descriptor, selected event mask, and attached data.
)��zFile object registered.zUnderlying file descriptor.z3Events that must be waited for on this file object.zzOptional opaque data associated to this file object.
    For example, this could be used to store a per-client session ID.c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�_SelectorMappingcCs
||_dS�N)�	_selector)�selfZselectorrrr�__init__?sz_SelectorMapping.__init__cCst|jj�Sr)�lenr�
_fd_to_key�rrrr�__len__Bsz_SelectorMapping.__len__cCsDz|j�|�}|jj|WStk
r>td�|��d�YnXdS�N�{!r} is not registered)r�_fileobj_lookupr�KeyErrorr)rrrrrr�__getitem__Es
z_SelectorMapping.__getitem__cCst|jj�Sr)�iterrrr rrr�__iter__Lsz_SelectorMapping.__iter__N)�__name__�
__module__�__qualname__rr!r&r(rrrrr<src@sjeZdZeddd��Zedd��Zddd�Zeddd	��Zd
d�Zdd
�Z	edd��Z
dd�Zdd�ZdS)�BaseSelectorNcCst�dSr��NotImplementedError�rrrrrrr�register_szBaseSelector.registercCst�dSrr-)rrrrr�
unregistervszBaseSelector.unregistercCs|�|�|�|||�Sr)r1r0r/rrr�modify�s
zBaseSelector.modifycCst�dSrr-)r�timeoutrrr�select�szBaseSelector.selectcCsdSrrr rrr�close�szBaseSelector.closecCsL|��}|dkrtd��z
||WStk
rFtd�|��d�YnXdS)NzSelector is closedr#)�get_map�RuntimeErrorr%r)rr�mappingrrr�get_key�s
zBaseSelector.get_keycCst�dSrr-r rrrr6�szBaseSelector.get_mapcCs|Srrr rrr�	__enter__�szBaseSelector.__enter__cGs|��dSr)r5)r�argsrrr�__exit__�szBaseSelector.__exit__)N)N)N)
r)r*r+rr0r1r2r4r5r9r6r:r<rrrrr,Ps


r,)�	metaclassc@sPeZdZdd�Zdd�Zddd�Zdd	�Zdd
d�Zdd
�Zdd�Z	dd�Z
dS)�_BaseSelectorImplcCsi|_t|�|_dSr)rr�_mapr rrrr�sz_BaseSelectorImpl.__init__cCsNz
t|�WStk
rH|j��D]}|j|kr$|jYSq$�YnXdSr)rr
r�valuesrr�rr�keyrrrr$�s	

z!_BaseSelectorImpl._fileobj_lookupNcCsb|r|ttB@r td�|���t||�|�||�}|j|jkrRtd�||j���||j|j<|S)NzInvalid events: {!r}z"{!r} (FD {}) is already registered)	�
EVENT_READ�EVENT_WRITEr
rrr$rrr%�rrrrrBrrrr0�s�z_BaseSelectorImpl.registercCs@z|j�|�|��}Wn$tk
r:td�|��d�YnX|Sr")r�popr$r%rrArrrr1�s
z_BaseSelectorImpl.unregistercCs�z|j|�|�}Wn$tk
r8td�|��d�YnX||jkr^|�|�|�|||�}n"||jkr�|j|d�}||j|j	<|S)Nr#)r)
rr$r%rrr1r0r�_replacerrErrrr2�s


z_BaseSelectorImpl.modifycCs|j��d|_dSr)r�clearr?r rrrr5s
z_BaseSelectorImpl.closecCs|jSr)r?r rrrr6sz_BaseSelectorImpl.get_mapcCs(z|j|WStk
r"YdSXdSr)rr%)rrrrr�_key_from_fds	z_BaseSelectorImpl._key_from_fd)N)N)r)r*r+rr$r0r1r2r5r6rIrrrrr>�s


r>cs\eZdZ�fdd�Zd
�fdd�	Z�fdd�ZejdkrDdd	d
�Zne	j	Zddd�Z	�Z
S)�SelectSelectorcst���t�|_t�|_dSr)�superr�set�_readers�_writersr ��	__class__rrr%s
zSelectSelector.__init__Ncs@t��|||�}|t@r&|j�|j�|t@r<|j�|j�|Sr)rKr0rCrM�addrrDrNrErOrrr0*szSelectSelector.registercs,t��|�}|j�|j�|j�|j�|Sr)rKr1rM�discardrrNrArOrrr12szSelectSelector.unregisterZwin32cCs$t�||||�\}}}|||gfSr)r4)r�r�w�_r3�xrrr�_select9szSelectSelector._selectc	Cs�|dkrdnt|d�}g}z|�|j|jg|�\}}}Wntk
rP|YSXt|�}t|�}||BD]J}d}||kr�|tO}||kr�|tO}|�|�}|rj|�	|||j
@f�qj|S�Nr)�maxrWrMrN�InterruptedErrorrLrCrDrI�appendr)	rr3�readyrSrTrUrrrBrrrr4?s$

zSelectSelector.select)N)N)N)r)r*r+rr0r1�sys�platformrWr4�
__classcell__rrrOrrJ"s
rJcsZeZdZdZdZdZ�fdd�Zd�fdd�	Z�fdd�Zd
�fdd	�	Z	dd
d�Z
�ZS)�_PollLikeSelectorNcst���|��|_dSr)rKr�
_selector_clsrr rOrrr[s
z_PollLikeSelector.__init__cslt��|||�}d}|t@r&||jO}|t@r8||jO}z|j�|j|�Wnt��|��YnX|SrX)	rKr0rC�_EVENT_READrD�_EVENT_WRITErrr1)rrrrrBZ
poller_eventsrOrrr0_s

z_PollLikeSelector.registercs8t��|�}z|j�|j�Wntk
r2YnX|Sr)rKr1rr�OSErrorrArOrrr1msz_PollLikeSelector.unregistercs�z|j|�|�}Wn$tk
r8t|�d��d�YnXd}||jkr�d}|t@r^||jO}|t@rp||jO}z|j�	|j
|�Wnt��|��YnXd}||j
kr�d}|r�|j||d�}||j|j
<|S)Nz is not registeredFrT)rr)rr$r%rrCrbrDrcrr2rrKr1rrG)rrrrrBZchangedZselector_eventsrOrrr2ws.



z_PollLikeSelector.modifycCs�|dkrd}n|dkrd}nt�|d�}g}z|j�|�}Wntk
rV|YSX|D]V\}}d}||j@r||tO}||j@r�|tO}|�	|�}|r\|�
|||j@f�q\|S)Nr�@�@)�math�ceilr�pollrZrbrDrcrCrIr[r)rr3r\�
fd_event_listr�eventrrBrrrr4�s(

z_PollLikeSelector.select)N)N)N)r)r*r+rarbrcrr0r1r2r4r_rrrOrr`Us
r`rhc@seZdZejZejZejZ	dS)�PollSelectorN)
r)r*r+r4rhra�POLLINrb�POLLOUTrcrrrrrk�srk�epollcs@eZdZejZejZejZ	dd�Z
ddd�Z�fdd�Z�ZS)	�
EpollSelectorcCs
|j��Sr�rr
r rrrr
�szEpollSelector.filenoNc	Cs�|dkrd}n |dkrd}nt�|d�d}tt|j�d�}g}z|j�||�}Wntk
rl|YSX|D]V\}}d}|tj	@r�|t
O}|tj@r�|tO}|�
|�}|rr|�|||j@f�qr|S)N���rreg����MbP?r)rfrgrYrrrrhrZr4�EPOLLINrD�EPOLLOUTrCrIr[r)	rr3�max_evr\rirrjrrBrrrr4�s*

zEpollSelector.selectcs|j��t���dSr�rr5rKr rOrrr5�s
zEpollSelector.close)N)
r)r*r+r4rnrarrrbrsrcr
r5r_rrrOrro�s
 ro�devpollcs6eZdZejZejZejZ	dd�Z
�fdd�Z�ZS)�DevpollSelectorcCs
|j��Srrpr rrrr
�szDevpollSelector.filenocs|j��t���dSrrur rOrrr5�s
zDevpollSelector.close)
r)r*r+r4rvrarlrbrmrcr
r5r_rrrOrrw�s
rw�kqueuecsTeZdZ�fdd�Zdd�Zd�fdd�	Z�fdd	�Zdd
d�Z�fdd
�Z�Z	S)�KqueueSelectorcst���t��|_dSr)rKrr4rxrr rOrrr�s
zKqueueSelector.__init__cCs
|j��Srrpr rrrr
szKqueueSelector.filenoNcs�t��|||�}z`|t@r@t�|jtjtj�}|j�	|gdd�|t
@rnt�|jtjtj�}|j�	|gdd�Wnt��|��YnX|SrX)
rKr0rCr4�keventr�KQ_FILTER_READZ	KQ_EV_ADDr�controlrD�KQ_FILTER_WRITEr1)rrrrrB�kevrOrrr0s ��zKqueueSelector.registercs�t��|�}|jt@rVt�|jtjtj�}z|j	�
|gdd�Wntk
rTYnX|jt@r�t�|jtj
tj�}z|j	�
|gdd�Wntk
r�YnX|SrX)rKr1rrCr4rzrr{ZKQ_EV_DELETErr|rdrDr})rrrBr~rOrrr1s$
�
�zKqueueSelector.unregisterc
Cs�|dkrdnt|d�}t|j�}g}z|j�d||�}Wntk
rP|YSX|D]Z}|j}|j}d}|tj	kr||t
O}|tjkr�|tO}|�
|�}	|	rV|�|	||	j@f�qV|SrX)rYrrrr|rZZident�filterr4r{rCr}rDrIr[r)
rr3rtr\Zkev_listr~r�flagrrBrrrr4)s&




zKqueueSelector.selectcs|j��t���dSrrur rOrrr5?s
zKqueueSelector.close)N)N)
r)r*r+rr
r0r1r4r5r_rrrOrry�s
ry) �abcrr�collectionsrZcollections.abcrrfr4r]rCrDrr�__doc__�version_inforrrrrr,r>rJr`�hasattrrkrorwry�globalsZDefaultSelectorrrrr�<module>sJ
~T3Z
.M__pycache__/pprint.cpython-38.pyc000064400000037633151153537570012750 0ustar00U

e5d�S�
@sdZddlZddlZddlZddlZddlm	Z
dddddd	d
gZd%d
dd�dd�Zd&d
dd�dd�Z
d
d�dd
�Zdd�Zdd�Zdd�ZGdd�d�Zdd�ZGdd	�d	�Zdd�Zeeeeeeeeed�h�Zdd�Z d'd d!�Z!d"d#�Z"e#d$k�r�e!�dS)(a/Support to pretty-print lists, tuples, & dictionaries recursively.

Very simple, but useful, especially in debugging data structures.

Classes
-------

PrettyPrinter()
    Handle pretty-printing operations onto a stream using a configured
    set of formatting parameters.

Functions
---------

pformat()
    Format a Python object into a pretty-printed representation.

pprint()
    Pretty-print a Python object to a stream [default is sys.stdout].

saferepr()
    Generate a 'standard' repr()-like value, but protect against recursive
    data structures.

�N)�StringIO�pprint�pformat�
isreadable�isrecursive�saferepr�
PrettyPrinter�pp��PFT��compact�
sort_dictscCs"t||||||d�}|�|�dS)zAPretty-print a Python object to a stream [default is sys.stdout].)�stream�indent�width�depthr
rN)rr)�objectrrrrr
rZprinter�r�/usr/lib64/python3.8/pprint.pyr/s�cCst|||||d��|�S)z<Format a Python object into a pretty-printed representation.)rrrr
r)rr)rrrrr
rrrrr7s��)rcOst|f|�d|i|��dS)zPretty-print a Python objectrN)r)rr�args�kwargsrrrr	=scCst|iddd�dS)z=Version of repr() which can handle recursive data structures.NrT��
_safe_repr�rrrrrAscCst|iddd�dS)z4Determine if saferepr(object) is readable by eval().NrTr
rrrrrrEscCst|iddd�dS)z8Determine if object requires a recursive representation.NrT�rrrrrrIsc@s&eZdZdZdgZdd�Zdd�ZdS)�	_safe_keyaUHelper function for key functions when sorting unorderable objects.

    The wrapped-object will fallback to a Py2.x style comparison for
    unorderable types (sorting first comparing the type name and then by
    the obj ids).  Does not work recursively, so dict.items() must have
    _safe_key applied to both the key and the value.

    �objcCs
||_dS�N)r)�selfrrrr�__init__Ysz_safe_key.__init__cCsXz|j|jkWStk
rRtt|j��t|j�ftt|j��t|j�fkYSXdSr)r�	TypeError�str�type�id)r�otherrrr�__lt__\s�z_safe_key.__lt__N)�__name__�
__module__�__qualname__�__doc__�	__slots__r r&rrrrrMs	rcCst|d�t|d�fS)z&Helper function for comparing 2-tuplesrr
)r)�trrr�_safe_tuplecsr-c@s�eZdZd;ddd�dd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�ZiZ	dd�Z
e
e	ej<dd�Z
e
e	ejj<dd�Zee	ej<dd�Zee	ej<dd�Zee	ej<ee	ej<dd�Zee	ej<dd �Zee	ej<d!d"�Zee	ej<d#d$�Zee	ejj<d%d&�Z d'd(�Z!d)d*�Z"d+d,�Z#d-d.�Z$e$e	ej%j<d/d0�Z&e&e	ej'j<d1d2�Z(e(e	ej)j<d3d4�Z*e*e	ej+j<d5d6�Z,e,e	ej-j<d7d8�Z.e.e	ej/j<d9d:�Z0e0e	ej1j<dS)<rr
rNFTrcCs�t|�}t|�}|dkr td��|dk	r8|dkr8td��|sDtd��||_||_||_|dk	rf||_ntj|_t|�|_	||_
dS)a�Handle pretty printing operations onto a stream using a set of
        configured parameters.

        indent
            Number of spaces to indent for each level of nesting.

        width
            Attempted maximum number of columns in the output.

        depth
            The maximum depth to print out nested structures.

        stream
            The desired output stream.  If omitted (or false), the standard
            output stream available at construction will be used.

        compact
            If true, several items will be combined in one line.

        sort_dicts
            If true, dict keys are sorted.

        rzindent must be >= 0Nzdepth must be > 0zwidth must be != 0)�int�
ValueError�_depth�_indent_per_level�_width�_stream�_sys�stdout�bool�_compact�_sort_dicts)rrrrrr
rrrrr hs 
zPrettyPrinter.__init__cCs&|�||jddid�|j�d�dS)Nr�
)�_formatr3�write�rrrrrr�szPrettyPrinter.pprintcCs"t�}|�||ddid�|��S�Nr)�	_StringIOr:�getvalue)rrZsiorrrr�szPrettyPrinter.pformatcCs|�|idd�dS)Nrr��formatr<rrrr�szPrettyPrinter.isrecursivecCs |�|idd�\}}}|o|Sr=r@)rr�s�readable�	recursiverrrr�szPrettyPrinter.isreadablec	Cs�t|�}||kr.|�t|��d|_d|_dS|�|||�}|j||}	t|�|	kr�|j�	t
|�jd�}
|
dk	r�d||<|
|||||||d�||=dSt|t
�r�d||<|�||||||d�||=dS|�|�dS)NTFr
)r$r;�
_recursion�
_recursive�	_readable�_reprr2�len�	_dispatch�getr#�__repr__�
isinstance�dict�_pprint_dict)rrrr�	allowance�context�level�objid�rep�	max_width�prrrr:�s0
�zPrettyPrinter._formatc
Csz|j}|d�|jdkr*||jdd�t|�}|rn|jrNt|��td�}	n|��}	|�|	|||d||�|d�dS)N�{r
� ��key�})r;r1rIr8�sorted�itemsr-�_format_dict_items)
rrrrrPrQrRr;Zlengthr]rrrrO�s
�zPrettyPrinter._pprint_dictcCslt|�s|�t|��dS|j}|�|jd�|�t|���||t|j�d|d||�|�d�dS)N�(r
�))rIr;�repr�	__class__r'r:�listr])rrrrrPrQrR�clsrrr�_pprint_ordered_dict�s�z"PrettyPrinter._pprint_ordered_dictcCs0|�d�|�||||d||�|�d�dS)N�[r
�])r;�
_format_items�rrrrrPrQrRrrr�_pprint_list�s
�zPrettyPrinter._pprint_listcCsH|�d�t|�dkrdnd}|�||||t|�||�|�|�dS)Nr_r
z,)r`)r;rIrh)rrrrrPrQrR�endcharrrr�
_pprint_tuple�s
�zPrettyPrinter._pprint_tuplec	Cs�t|�s|�t|��dS|j}|tkr8|�d�d}n&|�|jd�d}|t|j�d7}t|td�}|�||||t|�||�|�|�dS)NrWr[�({�})r
rY)	rIr;rarb�setr'r\rrh)	rrrrrPrQrR�typrkrrr�_pprint_set�s 
�zPrettyPrinter._pprint_setcCs�|j}t|�s|t|��dSg}|�d�}	|dkrD|d7}|d7}|j|}
}t|	�D]�\}}
t|
�}|t|	�dkr�|
|8}
t|�|
kr�|�|�qZt�d|
�}|s�t	�|dr�t	�|�
�|}d}t|�D]l\}}||}|t|�dk�r|t|	�dk�r||8}tt|��|k�r:|�r4|�t|��|}q�|}q�|rZ|�t|��qZt|�dk�rn||�dS|dk�r�|d�t|�D],\}}|dk�r�|dd	|�||��q�|dk�r�|d
�dS)NTr
z\S*\s*����r_rr9rXr`)r;rIra�
splitlinesr2�	enumerate�append�re�findall�AssertionError�pop)rrrrrPrQrRr;Zchunks�linesZ
max_width1rU�i�linerT�partsZ
max_width2�current�j�part�	candidaterrr�_pprint_strsX
$


zPrettyPrinter._pprint_strcCs�|j}t|�dkr"|t|��dS|dk}|rF|d7}|d7}|d�d}	t||j||�D]$}
||	�||
�|	s\dd|}	q\|r�|d�dS)N�r
r_rsr9rXr`)r;rIra�_wrap_bytes_reprr2)rrrrrPrQrRr;Zparens�delimrTrrr�
_pprint_bytes3s"zPrettyPrinter._pprint_bytesc	Cs>|j}|d�|�t|�||d|d||d�|d�dS)Nz
bytearray(�
r
r`)r;r��bytes)rrrrrPrQrRr;rrr�_pprint_bytearrayHs�zPrettyPrinter._pprint_bytearraycCs8|�d�|�|��||d|d||�|�d�dS)Nz
mappingproxy(�
r
r`)r;r:�copyrirrr�_pprint_mappingproxyQs
�z"PrettyPrinter._pprint_mappingproxyc	Cs�|j}||j7}dd|}t|�d}	t|�D]f\}
\}}|
|	k}
|�|||�}||�|d�|�|||t|�d|
r�|nd||�|
s0||�q0dS)N�,
rXr
z: r)r;r1rIrurHr:)rr]rrrPrQrRr;�delimnlZ
last_indexr|rZ�ent�lastrTrrrr^Ys 

�z PrettyPrinter._format_dict_itemscCsL|j}||j7}|jdkr,||jdd�dd|}d}	|j|d}
}t|�}zt|�}
Wntk
rxYdSXd}|�sH|
}zt|�}
Wn(tk
r�d}||8}|
|8}
YnX|j�r|�|||�}t|�d}|
|kr�|}
|	r�|}	|
|k�r|
|8}
||	�d}	||�q~||	�|}	|�	||||�r<|nd||�q~dS)	Nr
rXr�rsFTr�, )
r;r1r2�iter�next�
StopIterationr7rHrIr:)rr]rrrPrQrRr;r�r�rrU�itZnext_entr�r�rT�wrrrrhjsR



�zPrettyPrinter._format_itemscCs4|�||��|j|�\}}}|s&d|_|r0d|_|S)NFT)rAr�r0rGrF)rrrQrRrarCrDrrrrH�s�
zPrettyPrinter._reprcCst|||||j�S)z�Format object for a specific context, returning a string
        and flags indicating whether the representation is 'readable'
        and whether the object represents a recursive construct.
        )rr8)rrrQ�	maxlevelsrRrrrrA�szPrettyPrinter.formatc	Cs�t|�s|�t|��dS|�|j||�}|j}|t|j�d7}|�d|j|d|f�|�||||d||�|�d�dS)Nr
z	%s(%s,
%srXr`)rIr;rarH�default_factoryrbr'rO)	rrrrrPrQrRZrdfrdrrr�_pprint_default_dict�sz"PrettyPrinter._pprint_default_dictc	Cs�t|�s|�t|��dS|j}|�|jd�|jdkrN|�|jdd�|��}|�|||t|j�d|d||�|�d�dS)Nrmr
rXrrn)rIr;rarbr'r1�most_commonr^)	rrrrrPrQrRrdr]rrr�_pprint_counter�s
�zPrettyPrinter._pprint_counterc
	Cs�t|j�s|�t|��dS|j}|�|jd�|t|j�d7}t|j�D]d\}}	|t|j�dkr�|�|	|||d||�|�d�qN|�|	||d||�|�dd|�qNdS)Nr_r
r`r�rX)rI�mapsr;rarbr'rur:)
rrrrrPrQrRrdr|�mrrr�_pprint_chain_map�s
zPrettyPrinter._pprint_chain_mapc	Cs�t|�s|�t|��dS|j}|�|jd�|t|j�d7}|�d�|jdkrz|�||||d||�|�d�n:|�|||d||�|�|j||�}|�dd||f�dS)Nr_r
rfrz])z],
%smaxlen=%s)rX)rIr;rarbr'�maxlenrhrH)	rrrrrPrQrRrdZrmlrrr�
_pprint_deque�s&

��zPrettyPrinter._pprint_dequec	Cs|�|j|||||d�dS�Nr
�r:�datarirrr�_pprint_user_dict�szPrettyPrinter._pprint_user_dictc	Cs|�|j|||||d�dSr�r�rirrr�_pprint_user_list�szPrettyPrinter._pprint_user_listc	Cs|�|j|||||d�dSr�r�rirrr�_pprint_user_string�sz!PrettyPrinter._pprint_user_string)r
rNN)2r'r(r)r rrrrr:rJrOrNrLre�_collections�OrderedDictrjrcrl�tuplerqro�	frozensetr�r"r�r�r��	bytearrayr��_types�MappingProxyTyper^rhrHrAr��defaultdictr��Counterr��ChainMapr��dequer��UserDictr��UserListr��
UserStringrrrrrgs^�+




1


)	cCs�t|�}|tkrt|�ddfSt|dd�}t|t��rD|tjk�rD|sJdSt|�}|rl||krldd||kfS||kr�t|�ddfSd||<d}d}	g}
|
j	}|d7}|r�t
|��td�}n|��}|D]b\}
}t
|
||||�\}}}t
|||||�\}}}|d||f�|�o|�o|}|�s$|r�d}	q�||=d	d
�|
�||	fSt|t��r\|tjk�stt|t��rn|tjk�rnt|t��r�|�s�dSd}n"t|�dk�r�d
}n|�s�dSd}t|�}|�r�||k�r�|dd||kfS||k�r�t|�ddfSd||<d}d}	g}
|
j	}|d7}|D]8}t
|||||�\}}}||�|�sFd}|�rd}	�q||=|d
�|
�||	fSt|�}||�o�|�d�dfS)NTFrL)z{}TFz{...}r
rYz%s: %sz{%s}r�)z[]TFz[%s]z(%s,))z()TFz(%s)z...�<)r#�_builtin_scalarsra�getattr�
issubclassrNrLr$rErvr\r]r-r�joinrcr�rI�
startswith)rrQr�rRrrp�rrSrCrDZ
componentsrvr]�k�vZkreprZ	kreadableZkrecurZvreprZ	vreadableZvrecurrA�oZoreprZ	oreadableZorecurrTrrrr�s�
��
rcCsdt|�jt|�fS)Nz<Recursion on %s with id=%s>)r#r'r$rrrrrE?s�rEcCs�ddl}|dkr,ddddgddd�fgd	}t�}|��}t|iddd
�|��}|�|�|��}td||�td||�dS)
Nr�string)r
r�r���)��i��Tz_safe_repr:zpformat:)�timer�perf_counterrr�print)rr�rV�t1�t2Zt3rrr�
_perfcheckDs
r�ccs�d}t|�dd}tdt|�d�D]T}|||d�}||}||krP||8}tt|��|krt|rnt|�V|}q$|}q$|r�t|�VdS)N�r�r)rI�rangera)rrrPrr�r|r�r�rrrr�Qs
r��__main__)Nr
rN)r
rN)N)$r*�collectionsr�rw�sysr4�typesr��iorr>�__all__rrr	rrrrr-rrr�r"r�r�r.�float�complexr6r#r�rEr�r�r'rrrr�<module>sJ
���F�


__pycache__/base64.cpython-38.pyc000064400000041261151153537570012510 0ustar00U

e5d�O�@s�dZddlZddlZddlZddddddd	d
ddd
dddddddgZeefZdd�ZdCdd�Z	dDdd�Z
dd�Zdd�Ze�
dd�Ze�
dd�Zdd�Zdd�Zd Zdadad!d	�ZdEd"d
�Zd#d�ZdFd$d�Zdadad%Zd&ZdGd'd(�Zddddd)�d*d�Zddd+d,�d-d�Zd.Z da!da"da#dHd/d
�Z$d0d�Z%d1Z&e&d2d3Z'd4d�Z(d5d�Z)d6d7�Z*d8d�Z+d9d:�Z,d;d�Z-d<d=�Z.d>d?�Z/d@dA�Z0e1dBk�r�e/�dS)IzDBase16, Base32, Base64 (RFC 3548), Base85 and Ascii85 data encodings�N�encode�decode�encodebytes�decodebytes�	b64encode�	b64decode�	b32encode�	b32decode�	b16encode�	b16decode�	b85encode�	b85decode�	a85encode�	a85decode�standard_b64encode�standard_b64decode�urlsafe_b64encode�urlsafe_b64decodecCs|t|t�r4z|�d�WStk
r2td��YnXt|t�rB|Szt|���WStk
rvtd|j	j
�d�YnXdS)N�asciiz4string argument should contain only ASCII charactersz>argument should be a bytes-like object or ASCII string, not %r)�
isinstance�strr�UnicodeEncodeError�
ValueError�bytes_types�
memoryview�tobytes�	TypeError�	__class__�__name__��s�r!�/usr/lib64/python3.8/base64.py�_bytes_from_decode_data"s

��r#cCsDtj|dd�}|dk	r@t|�dks.tt|���|�t�d|��S|S)a*Encode the bytes-like object s using Base64 and return a bytes object.

    Optional altchars should be a byte string of length 2 which specifies an
    alternative alphabet for the '+' and '/' characters.  This allows an
    application to e.g. generate url or filesystem safe Base64 strings.
    F)�newlineN��+/)�binascii�
b2a_base64�len�AssertionError�repr�	translate�bytes�	maketrans)r �altchars�encodedr!r!r"r3s
FcCsft|�}|dk	rBt|�}t|�dks0tt|���|�t�|d��}|r\t�d|�s\t	�
d��t	�|�S)anDecode the Base64 encoded bytes-like object or ASCII string s.

    Optional altchars must be a bytes-like object or ASCII string of length 2
    which specifies the alternative alphabet used instead of the '+' and '/'
    characters.

    The result is returned as a bytes object.  A binascii.Error is raised if
    s is incorrectly padded.

    If validate is False (the default), characters that are neither in the
    normal base-64 alphabet nor the alternative alphabet are discarded prior
    to the padding check.  If validate is True, these non-alphabet characters
    in the input result in a binascii.Error.
    Nr%r&s[A-Za-z0-9+/]*={0,2}zNon-base64 digit found)r#r)r*r+r,r-r.�re�	fullmatchr'�Error�
a2b_base64)r r/Zvalidater!r!r"rAs
cCst|�S)zrEncode bytes-like object s using the standard Base64 alphabet.

    The result is returned as a bytes object.
    )rrr!r!r"rZscCst|�S)aQDecode bytes encoded with the standard Base64 alphabet.

    Argument s is a bytes-like object or ASCII string to decode.  The result
    is returned as a bytes object.  A binascii.Error is raised if the input
    is incorrectly padded.  Characters that are not in the standard alphabet
    are discarded prior to the padding check.
    )rrr!r!r"rasr&s-_cCst|��t�S)z�Encode bytes using the URL- and filesystem-safe Base64 alphabet.

    Argument s is a bytes-like object to encode.  The result is returned as a
    bytes object.  The alphabet uses '-' instead of '+' and '_' instead of
    '/'.
    )rr,�_urlsafe_encode_translationrr!r!r"roscCst|�}|�t�}t|�S)a�Decode bytes using the URL- and filesystem-safe Base64 alphabet.

    Argument s is a bytes-like object or ASCII string to decode.  The result
    is returned as a bytes object.  A binascii.Error is raised if the input
    is incorrectly padded.  Characters that are not in the URL-safe base-64
    alphabet, and are not a plus '+' or slash '/', are discarded prior to the
    padding check.

    The alphabet uses '-' instead of '+' and '_' instead of '/'.
    )r#r,�_urlsafe_decode_translationrrr!r!r"rxs
s ABCDEFGHIJKLMNOPQRSTUVWXYZ234567cs>tdkr,dd�tD���fdd��D�ad�t|t�sBt|���}t|�d}|rb|dd|}t�}tj	}t}t
dt|�d�D]V}||||d�d�}|||d	?||d
?d@||d?d@||d@7}q�|d
kr�d|dd�<nF|dk�rd|dd�<n.|dk�r d|dd�<n|dk�r6d|dd�<t|�S)zKEncode the bytes-like object s using Base32 and return a bytes object.
    NcSsg|]}t|f��qSr!�r-��.0�ir!r!r"�
<listcomp>�szb32encode.<locals>.<listcomp>csg|]}�D]}||�qqSr!r!�r9�a�b�Zb32tabr!r"r;�s��r�big��i��
�s======i����r%s====����s===�����=���)�_b32tab2�_b32alphabetrrrrr)�	bytearray�int�
from_bytes�ranger-)r �leftoverr0rQZb32tab2r:�cr!r?r"r�s<
��
�


c
	Cs�tdkrdd�tt�D�at|�}t|�dr8t�d��|dk	rvt|�}t|�dks`tt|���|�	t
�dd|��}|r�|��}t|�}|�
d	�}|t|�}t�}t}td
t|�d�D]j}|||d�}d
}	z|D]}
|	d>||
}	q�Wn"tk
�rt�d�d�YnX||	�dd
�7}q�|d�s:|dk�rDt�d��|�r�|�r�|	d|K}	|	�dd
�}dd|d}|d|�|dd�<t
|�S)aZDecode the Base32 encoded bytes-like object or ASCII string s.

    Optional casefold is a flag specifying whether a lowercase alphabet is
    acceptable as input.  For security purposes, the default is False.

    RFC 3548 allows for optional mapping of the digit 0 (zero) to the
    letter O (oh), and for optional mapping of the digit 1 (one) to
    either the letter I (eye) or letter L (el).  The optional argument
    map01 when not None, specifies which letter the digit 1 should be
    mapped to (when map01 is not None, the digit 0 is always mapped to
    the letter O).  For security purposes the default is None, so that
    0 and 1 are not allowed in the input.

    The result is returned as a bytes object.  A binascii.Error is raised if
    the input is incorrectly padded or if there are non-alphabet
    characters present in the input.
    NcSsi|]\}}||�qSr!r!)r9�k�vr!r!r"�
<dictcomp>�szb32decode.<locals>.<dictcomp>�zIncorrect paddingrFs01�OrKrr@zNon-base32 digit foundrB>rrFrHrJ��+���)�_b32rev�	enumeraterNr#r)r'r3r*r+r,r-r.�upper�rstriprOrR�KeyError�to_bytes)
r �casefoldZmap01�lZpadchars�decodedZb32revr:Zquanta�accrTZlastrSr!r!r"r	�sB


cCst�|���S)zKEncode the bytes-like object s using Base16 and return a bytes object.
    )r'Zhexlifyr_rr!r!r"r
�scCs4t|�}|r|��}t�d|�r*t�d��t�|�S)a�Decode the Base16 encoded bytes-like object or ASCII string s.

    Optional casefold is a flag specifying whether a lowercase alphabet is
    acceptable as input.  For security purposes, the default is False.

    The result is returned as a bytes object.  A binascii.Error is raised if
    s is incorrectly padded or if there are non-alphabet characters present
    in the input.
    s	[^0-9A-F]zNon-base16 digit found)r#r_r1�searchr'r3Z	unhexlify)r rcr!r!r"r�s

s<~s~>c	s�t|t�st|���}t|�d}|r4|d|}t�dt|�d��|�}����fdd�|D�}|r�|s�|ddkr��dd	|d<|dd|�|d<d
�|�S)NrJrAz!%dIcsPg|]H}�r|sdn6�r$|dkr$dn&�|d�|dd�|d�qS)�zi    �yi�^	�Ui9r!)r9Zword��chars�chars2�foldnuls�
foldspacesr!r"r;!s�
�
�z_85encode.<locals>.<listcomp>rLrhrr@�)	rrrrr)�struct�StructZunpack�join)	r>rlrm�padrnro�paddingZwords�chunksr!rkr"�	_85encodes
�rw)ro�wrapcolrt�adobecs�tdkr*dd�tdd�D�add�tD�at|tt|d|��|rHt���r�t|rVdnd	�����fd
d�tdt����D�}|r�t|d�d�kr�|�d
�d�|��|r��t	7��S)a�Encode bytes-like object b using Ascii85 and return a bytes object.

    foldspaces is an optional flag that uses the special short sequence 'y'
    instead of 4 consecutive spaces (ASCII 0x20) as supported by 'btoa'. This
    feature is not supported by the "standard" Adobe encoding.

    wrapcol controls whether the output should have newline (b'\n') characters
    added to it. If this is non-zero, each output line will be at most this
    many characters long.

    pad controls whether the input is padded to a multiple of 4 before
    encoding. Note that the btoa implementation always pads.

    adobe controls whether the encoded byte sequence is framed with <~ and ~>,
    which is used by the Adobe implementation.
    NcSsg|]}t|f��qSr!r7r8r!r!r"r;Dsza85encode.<locals>.<listcomp>�!�vcSsg|]}tD]}||�qqSr!)�	_a85charsr<r!r!r"r;EsTr%rFcsg|]}�||���qSr!r!r8��resultrxr!r"r;Ms�rrLrp�
)
�
_a85chars2rRr|rw�	_A85START�maxr)�appendrs�_A85END)r>rorxrtryrvr!r}r"r/s$�

s 	

)rory�ignorecharsc	Cs�t|�}|rH|�t�s$td�t���|�t�r<|dd�}n|dd�}t�d�j	}g}|j
}g}|j
}|j}	|dD]�}
d|
kr�dkr�nnl||
�t|�d	kr�d
}|D]}
d||
d}q�z|||��Wn tj
k
r�td�d�YnX|	�qv|
d
k�r |�rtd��|d�qv|�rH|
dk�rH|�r>td��|d�qv|
|k�rVqvqvtd|
��qvd�|�}dt|�}
|
�r�|d|
�}|S)a�Decode the Ascii85 encoded bytes-like object or ASCII string b.

    foldspaces is a flag that specifies whether the 'y' short sequence should be
    accepted as shorthand for 4 consecutive spaces (ASCII 0x20). This feature is
    not supported by the "standard" Adobe encoding.

    adobe controls whether the input sequence is in Adobe Ascii85 format (i.e.
    is framed with <~ and ~>).

    ignorechars should be a byte string containing characters to ignore from the
    input. This should only contain whitespace characters, and by default
    contains all whitespace characters in ASCII.

    The result is returned as a bytes object.
    z1Ascii85 encoded byte sequences must end with {!r}r%���N�!Isuuuurz�ur@rrjzAscii85 overflow�zzz inside Ascii85 5-tuples�yzy inside Ascii85 5-tuples    zNon-Ascii85 digit found: %crprJ)r#�endswithr�r�format�
startswithr�rqrr�packr��clearr)�errorrs)r>roryr��packIreZdecoded_appendZcurrZcurr_appendZ
curr_clear�xrfr~rur!r!r"rXsZ
��





sU0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~cCs2tdkr$dd�tD�add�tD�at|tt|�S)z�Encode bytes-like object b in base85 format and return a bytes object.

    If pad is true, the input is padded with b'\0' so its length is a multiple of
    4 bytes before encoding.
    NcSsg|]}t|f��qSr!r7r8r!r!r"r;�szb85encode.<locals>.<listcomp>cSsg|]}tD]}||�qqSr!)�	_b85charsr<r!r!r"r;�s)�
_b85chars2�_b85alphabetr�rw)r>rtr!r!r"r�s	c
	CsJtdkr,dgdatt�D]\}}|t|<qt|�}t|�d}|d|}g}t�d�j}tdt|�d�D]�}|||d�}d}z|D]}|dt|}q�WnFt	k
r�t|�D]&\}}t|dkr�t
d||�d�q��YnXz|�||��Wqntjk
�r$t
d	|�d�YqnXqnd
�
|�}	|�rF|	d|�}	|	S)zqDecode the base85-encoded bytes-like object or ASCII string b

    The result is returned as a bytes object.
    N�r@�~r�rrjz#bad base85 character at position %dz+base85 overflow in hunk starting at byte %drp)�_b85decr^r�r#r)rqrrr�rRrrr�r�rs)
r>r:rTru�outr��chunkrf�jr~r!r!r"r
�sH

����

�LrJrHcCsX|�t�}|sqTt|�tkr>|�tt|��}|s4q>||7}qt�|�}|�|�qdS)z1Encode a file; input and output are binary files.N)�read�
MAXBINSIZEr)r'r(�write)�input�outputr �ns�liner!r!r"r�s


cCs(|��}|sq$t�|�}|�|�qdS)z1Decode a file; input and output are binary files.N)�readliner'r4r�)r�r�r�r r!r!r"r�s

c
Cs�zt|�}Wn8tk
rD}zd|jj}t|�|�W5d}~XYnX|jdkrjd|j|jjf}t|��|jdkr�d|j|jjf}t|��dS)Nz"expected bytes-like object, not %s)rTr>�Bz-expected single byte elements, not %r from %srFz(expected 1-D data, not %d-D data from %s)rrrrr��ndim)r �m�err�msgr!r!r"�_input_type_check�s
�
�r�cCsLt|�g}tdt|�t�D]$}|||t�}|�t�|��qd�|�S)zVEncode a bytestring into a bytes object containing multiple lines
    of base-64 data.rrp)r�rRr)r�r�r'r(rs)r �piecesr:r�r!r!r"rscCsddl}|�dtd�t|�S)zLegacy alias of encodebytes().rNzAencodestring() is a deprecated alias since 3.1, use encodebytes()r%)�warnings�warn�DeprecationWarningr�r r�r!r!r"�encodestrings�r�cCst|�t�|�S)z8Decode a bytestring of base-64 data into a bytes object.)r�r'r4rr!r!r"rscCsddl}|�dtd�t|�S)zLegacy alias of decodebytes().rNzHdecodestring() is a deprecated alias since Python 3.1, use decodebytes()r%)r�r�r�rr�r!r!r"�decodestring$s�r�c	
Csddl}ddl}z|�|jdd�d�\}}WnP|jk
r~}z0|j|_t|�td|jd�|�d�W5d}~XYnXt}|D]@\}}|dkr�t}|dkr�t	}|d	kr�t	}|d
kr�t
�dSq�|�r|ddk�rt|dd��}|||jj�W5QRXn||j
j|jj�dS)
zSmall main programrNrFZdeutz�usage: %s [-d|-e|-u|-t] [file|-]
        -d, -u: decode
        -e: encode (default)
        -t: encode and decode string 'Aladdin:open sesame'r%z-ez-dz-uz-t�-�rb)�sys�getopt�argvr��stderr�stdout�print�exitrr�test�open�buffer�stdin)	r�r�Zopts�argsr��func�or=�fr!r!r"�main.s2�r�cCsHd}tt|��t|�}tt|��t|�}tt|��||ksDt�dS)NsAladdin:open sesame)r�r+rrr*)Zs0�s1�s2r!r!r"r�Hsr��__main__)N)NF)FN)F)FFF)F)2�__doc__r1rqr'�__all__r-rOrr#rrrrr.r5r6rrrNrMr]rr	r
rr|r�r�r�rwrrr�r�r�r�rr
ZMAXLINESIZEr�rrr�rr�rr�r�r�rr!r!r!r"�<module>s��

	&
C

)H
-	
	


__pycache__/chunk.cpython-38.opt-1.pyc000064400000011351151153537570013470 0ustar00U

e5d;�@sdZGdd�d�ZdS)aSimple class to read IFF chunks.

An IFF chunk (used in formats such as AIFF, TIFF, RMFF (RealMedia File
Format)) has the following structure:

+----------------+
| ID (4 bytes)   |
+----------------+
| size (4 bytes) |
+----------------+
| data           |
| ...            |
+----------------+

The ID is a 4-byte string which identifies the type of chunk.

The size field (a 32-bit value, encoded using big-endian byte order)
gives the size of the whole chunk, including the 8-byte header.

Usually an IFF-type file consists of one or more chunks.  The proposed
usage of the Chunk class defined here is to instantiate an instance at
the start of each chunk and read from the instance until it reaches
the end, after which a new instance can be instantiated.  At the end
of the file, creating a new instance will fail with an EOFError
exception.

Usage:
while True:
    try:
        chunk = Chunk(file)
    except EOFError:
        break
    chunktype = chunk.getname()
    while True:
        data = chunk.read(nbytes)
        if not data:
            pass
        # do something with data

The interface is file-like.  The implemented methods are:
read, close, seek, tell, isatty.
Extra methods are: skip() (called by close, skips to the end of the chunk),
getname() (returns the name (ID) of the chunk)

The __init__ method has one required argument, a file-like object
(including a chunk instance), and one optional argument, a flag which
specifies whether or not chunks are aligned on 2-byte boundaries.  The
default is 1, i.e. aligned.
c@sZeZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zddd�Zdd�Z	ddd�Z
dd�ZdS)�ChunkTFc	Cs�ddl}d|_||_|rd}nd}||_|�d�|_t|j�dkrFt�z |�|d|�d��d|_	Wn|j
k
r�td�YnX|r�|j	d|_	d|_z|j��|_
Wnttfk
r�d|_YnXd|_dS)	N�F�>�<��L�T)�struct�closed�align�file�read�	chunkname�len�EOFErrorZunpack_from�	chunksize�error�	size_read�tell�offset�AttributeError�OSError�seekable)�selfrr
Z	bigendianZ
inclheaderrZstrflag�r�/usr/lib64/python3.8/chunk.py�__init__4s, zChunk.__init__cCs|jS)z*Return the name (ID) of the current chunk.)r
�rrrr�getnameNsz
Chunk.getnamecCs|jS)z%Return the size of the current chunk.)rrrrr�getsizeRsz
Chunk.getsizecCs |jsz|��W5d|_XdS)NT)r	�skiprrrr�closeVszChunk.closecCs|jrtd��dS)N�I/O operation on closed fileF)r	�
ValueErrorrrrr�isatty]szChunk.isattyrcCsv|jrtd��|jstd��|dkr0||j}n|dkrB||j}|dksT||jkrXt�|j�|j	|d�||_dS)z�Seek to specified position into the chunk.
        Default position is 0 (start of chunk).
        If the file is not seekable, this will result in an error.
        r!zcannot seek��rN)
r	r"rrrr�RuntimeErrorr�seekr)r�pos�whencerrrr'bs
z
Chunk.seekcCs|jrtd��|jS)Nr!)r	r"rrrrrrusz
Chunk.tell���cCs�|jrtd��|j|jkrdS|dkr2|j|j}||j|jkrN|j|j}|j�|�}|jt|�|_|j|jkr�|jr�|jd@r�|j�d�}|jt|�|_|S)z�Read at most size bytes from the chunk.
        If size is omitted or negative, read until the end
        of the chunk.
        r!�rr$)r	r"rrrrrr
)r�size�data�dummyrrrrzs$��z
Chunk.readcCs�|jrtd��|jrnzD|j|j}|jr:|jd@r:|d}|j�|d�|j||_WdStk
rlYnX|j|jkr�t	d|j|j�}|�
|�}|snt�qndS)z�Skip the rest of the chunk.
        If you are not interested in the contents of the chunk,
        this method should be called so that the file points to
        the start of the next chunk.
        r!r$Ni )r	r"rrrr
rr'r�minrr)r�nr.rrrr�s"
z
Chunk.skipN)TTF)r)r*)�__name__�
__module__�__qualname__rrrr r#r'rrrrrrrr3s


rN)�__doc__rrrrr�<module>s2__pycache__/_threading_local.cpython-38.pyc000064400000014460151153537570014703 0ustar00U

e5d4�@s^dZddlmZddlmZdgZGdd�d�Zedd��ZGd	d�d�Zdd
l	m
Z
mZdS)a(Thread-local objects.

(Note that this module provides a Python version of the threading.local
 class.  Depending on the version of Python you're using, there may be a
 faster one available.  You should always import the `local` class from
 `threading`.)

Thread-local objects support the management of thread-local data.
If you have data that you want to be local to a thread, simply create
a thread-local object and use its attributes:

  >>> mydata = local()
  >>> mydata.number = 42
  >>> mydata.number
  42

You can also access the local-object's dictionary:

  >>> mydata.__dict__
  {'number': 42}
  >>> mydata.__dict__.setdefault('widgets', [])
  []
  >>> mydata.widgets
  []

What's important about thread-local objects is that their data are
local to a thread. If we access the data in a different thread:

  >>> log = []
  >>> def f():
  ...     items = sorted(mydata.__dict__.items())
  ...     log.append(items)
  ...     mydata.number = 11
  ...     log.append(mydata.number)

  >>> import threading
  >>> thread = threading.Thread(target=f)
  >>> thread.start()
  >>> thread.join()
  >>> log
  [[], 11]

we get different data.  Furthermore, changes made in the other thread
don't affect data seen in this thread:

  >>> mydata.number
  42

Of course, values you get from a local object, including a __dict__
attribute, are for whatever thread was current at the time the
attribute was read.  For that reason, you generally don't want to save
these values across threads, as they apply only to the thread they
came from.

You can create custom local objects by subclassing the local class:

  >>> class MyLocal(local):
  ...     number = 2
  ...     def __init__(self, /, **kw):
  ...         self.__dict__.update(kw)
  ...     def squared(self):
  ...         return self.number ** 2

This can be useful to support default values, methods and
initialization.  Note that if you define an __init__ method, it will be
called each time the local object is used in a separate thread.  This
is necessary to initialize each thread's dictionary.

Now if we create a local object:

  >>> mydata = MyLocal(color='red')

Now we have a default number:

  >>> mydata.number
  2

an initial color:

  >>> mydata.color
  'red'
  >>> del mydata.color

And a method that operates on the data:

  >>> mydata.squared()
  4

As before, we can access the data in a separate thread:

  >>> log = []
  >>> thread = threading.Thread(target=f)
  >>> thread.start()
  >>> thread.join()
  >>> log
  [[('color', 'red')], 11]

without affecting this thread's data:

  >>> mydata.number
  2
  >>> mydata.color
  Traceback (most recent call last):
  ...
  AttributeError: 'MyLocal' object has no attribute 'color'

Note that subclasses can define slots, but they are not thread
local. They are shared across threads:

  >>> class MyLocal(local):
  ...     __slots__ = 'number'

  >>> mydata = MyLocal()
  >>> mydata.number = 42
  >>> mydata.color = 'red'

So, the separate thread:

  >>> thread = threading.Thread(target=f)
  >>> thread.start()
  >>> thread.join()

affects what we see:

  >>> mydata.number
  11

>>> del mydata
�)�ref)�contextmanager�localc@s,eZdZdZdZdd�Zdd�Zdd�Zd	S)
�
_localimplz#A class managing thread-local dicts)�key�dicts�	localargs�	locallock�__weakref__cCsdtt|��|_i|_dS)Nz_threading_local._localimpl.)�str�idrr)�self�r�(/usr/lib64/python3.8/_threading_local.py�__init__�sz_localimpl.__init__cCst�}|jt|�dS)zPReturn the dict for the current thread. Raises KeyError if none
        defined.�)�current_threadrr)r
�threadrrr�get_dict�sz_localimpl.get_dictcshi}|j}t�}t|�}|f�fdd�	}|f�fdd�	}t||��t||���|j|<�|f|j|<|S)z8Create a new dict for the current thread, and return it.cs��}|dk	r|j|=dS�N)�__dict__)�_rr)�wrthreadrr�
local_deleted�sz-_localimpl.create_dict.<locals>.local_deletedcs��}|dk	r|j�|�}dSr)r�pop)r�idtr�dct)�wrlocalrr�thread_deleted�sz._localimpl.create_dict.<locals>.thread_deleted)rrrrrr)r
Z	localdictrrrrrr)rrr�create_dict�s


z_localimpl.create_dictN)�__name__�
__module__�__qualname__�__doc__�	__slots__rrrrrrrr�s
rc	csvt�|d�}z|��}Wn2tk
rJ|��}|j\}}|j||�YnX|j�t�|d|�dVW5QRXdS)N�_local__implr)	�object�__getattribute__r�KeyErrorrrrr	�__setattr__)r
�implr�args�kwrrr�_patch�s
r-c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r)r%rcOsX|s|r|jtjkrtd��t�|�}t�}||f|_t�|_t�|d|�|�	�|S)Nz*Initialization arguments are not supportedr%)
rr&�	TypeError�__new__rr�RLockr	r)r)�clsr+r,r
r*rrrr/�s

z
local.__new__c
Cs,t|��t�||�W5QR�SQRXdSr)r-r&r'�r
�namerrrr'�s
zlocal.__getattribute__c
CsF|dkrtd|jj��t|��t�|||�W5QR�SQRXdS�Nrz+%r object attribute '__dict__' is read-only)�AttributeError�	__class__r r-r&r))r
r3�valuerrrr)�s��
zlocal.__setattr__c
CsD|dkrtd|jj��t|��t�||�W5QR�SQRXdSr4)r5r6r r-r&�__delattr__r2rrrr8�s��
zlocal.__delattr__N)r r!r"r$r/r'r)r8rrrrr�s
)rr0N)r#�weakrefr�
contextlibr�__all__rr-rZ	threadingrr0rrrr�<module>s,

&__pycache__/ntpath.cpython-38.opt-1.pyc000064400000034503151153537570013662 0ustar00U

e5dVl�&@s(dZdZdZdZdZdZdZdZdZdd	l	Z	dd	l
Z
dd	lZdd	lZdd
lTddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0g&Z
d1d2�Zd3d�Zd4d�Zd5d
�Zd6d�Zd7d�Zd8d�Zejje_d9d�Zd:d�Zd;d�Zd<d�Zzdd=lmZWnek
�r(d	ZYnXd>d�Zd?d�Zd@d�ZdAd �Z dBdC�Z!zddDlm"Z"Wnek
�r|e!Z#Yn
XdEd!�Z#zddFlm$Z$m%Z&Wnek
�r�e#Z'YnXdGdH�Z(dIdJ�Z)dKd*�Z'e*e
dL��o�e
�+�dMdNkZ,dRdOd,�Z-dPd0�Z.zddQlm/Z0Wnek
�r"YnXd	S)Sz�Common pathname manipulations, WindowsNT/95 version.

Instead of importing this module directly, import os and refer to this
module as os.path.
�.�..�\�;�/z.;C:\binZnul�N)�*�normcase�isabs�join�
splitdrive�split�splitext�basename�dirname�commonprefix�getsize�getmtime�getatime�getctime�islink�exists�lexists�isdir�isfile�ismount�
expanduser�
expandvars�normpath�abspath�curdir�pardir�sep�pathsep�defpath�altsep�extsep�devnull�realpath�supports_unicode_filenames�relpath�samefile�sameopenfile�samestat�
commonpathcCst|t�rdSdSdS)N�\/�\/)�
isinstance�bytes��path�r4�/usr/lib64/python3.8/ntpath.py�
_get_bothseps"s
r6cCs8t�|�}t|t�r$|�dd���S|�dd���SdS)zaNormalize case of pathname.

    Makes all characters lowercase and all slashes into backslashes.�/�\rrN)�os�fspathr0r1�replace�lower��sr4r4r5r,s

cCsjt�|�}t|t�r,|�dd��d�rBdSn|�dd��d�rBdSt|�d}t|�d	koh|d	t|�kS)
zTest whether a path is absoluter7r8�\\?\Trr�\\?\�r)	r9r:r0r1r;�
startswithr�lenr6r=r4r4r5r	=s

c

GsTt�|�}t|t�r"d}d}d}nd}d}d}z�|sD|dd�|t|�\}}ttj|�D]~}t|�\}}	|	r�|	d|kr�|s�|s�|}|	}q\n*|r�||kr�|��|��kr�|}|	}q\|}|r�|d|kr�||}||	}q\|�r|d|k�r|�r|dd�|k�r|||WS||WSttt	fk
�rNt
jd	|f|���YnXdS)
Nr8r.�:rr/�:r���r
)r9r:r0r1r�mapr<�	TypeError�AttributeError�BytesWarning�genericpath�_check_arg_types)
r3�pathsr!�seps�colonZresult_driveZresult_path�pZp_driveZp_pathr4r4r5r
MsL


��
cCst�|�}t|�dk�rt|t�r0d}d}d}nd}d}d}|�||�}|dd�|dkr�|dd	�|kr�|�|d�}|d
kr�|dd�|fS|�||d�}||dkr�|dd�|fS|d
kr�t|�}|d|�||d�fS|dd�|k�r|dd�|dd�fS|dd�|fS)
a�Split a pathname into drive/UNC sharepoint and relative path specifiers.
    Returns a 2-tuple (drive_or_unc, path); either part may be empty.

    If you assign
        result = splitdrive(p)
    It is always true that:
        result[0] + result[1] == p

    If the path contained a drive letter, drive_or_unc will contain everything
    up to and including the colon.  e.g. splitdrive("c:/dir") returns ("c:", "/dir")

    If the path contained a UNC path, the drive_or_unc will contain the host name
    and share up to but not including the fourth directory separator character.
    e.g. splitdrive("//host/computer/dir") returns ("//host/computer", "/dir")

    Paths cannot contain both a drive letter and a UNC path.

    �r8r7rDrrrEr�rFNrA)r9r:rCr0r1r;�find)rPr!r$rOZnormp�indexZindex2r4r4r5r|s.

$cCsxt�|�}t|�}t|�\}}t|�}|rD||d|krD|d8}q&|d|�||d�}}|�|�pj|}|||fS)z~Split a pathname.

    Return tuple (head, tail) where tail is everything after the final slash.
    Either part may be empty.rAN)r9r:r6rrC�rstrip)rPrN�d�i�head�tailr4r4r5r�s

cCs8t�|�}t|t�r$t�|ddd�St�|ddd�SdS)Nr8r7�.rrr)r9r:r0r1rK�	_splitext�rPr4r4r5r
�s

cCst|�dS)z)Returns the final component of a pathnamerA�rr\r4r4r5r�scCst|�dS)z-Returns the directory component of a pathnamerr]r\r4r4r5r�sc
Cs8zt�|�}Wntttfk
r*YdSXt�|j�S)zhTest whether a path is a symbolic link.
    This will always return false for Windows prior to 6.0.
    F)r9�lstat�OSError�
ValueErrorrI�stat�S_ISLNK�st_mode�r3�str4r4r5r�s
c	Cs.zt�|�}Wnttfk
r(YdSXdS)zCTest whether a path exists.  Returns True for broken symbolic linksFT)r9r^r_r`rdr4r4r5r�s
)�_getvolumepathnamecCstt�|�}t|�}t|�}t|�\}}|rD|d|krD|pB||kS||krPdStrl|�|�t|��|�kSdSdS)zaTest whether a path is a mount point (a drive root, the root of a
    share, or a mounted volume)rTFN)r9r:r6rrrfrU)r3rN�root�restr4r4r5rs
cCs�t�|�}t|t�rd}nd}|�|�s,|Sdt|�}}||kr\||t|�kr\|d7}q:dtjkrrtjd}nFdtjkr�|Sztjd}Wntk
r�d}YnXt	|tjd�}t|t�r�t�
|�}|dkr�t	t|�|d|��}|||d�S)	zLExpand ~ and ~user constructs.

    If user or $HOME is unknown, do nothing.�~�~rAZUSERPROFILEZHOMEPATHZ	HOMEDRIVE�N)r9r:r0r1rBrCr6�environ�KeyErrorr
�fsencoder)r3�tilderW�n�userhome�driver4r4r5r!s.








cCs2t�|�}t|t�rhd|kr(d|kr(|Sddl}t|j|jdd�}d}d}d}d	}d}ttd
d�}nFd|kr|d|kr||Sddl}|j|jd}d
}d}d}d}d}tj}|dd�}	d}
t	|�}|
|k�r.||
|
d�}||k�rX||
dd�}t	|�}z&|�
|�}
|	||d|
d�7}	Wn*tk
�rR|	||7}	|d}
YnX�n�||k�rJ||
d|
d�|k�r�|	|7}	|
d7}
n�||
dd�}t	|�}z|�
|�}
Wn*tk
�r�|	||7}	|d}
YnhX|d|
�}
z.|dk�rt�tjt�
|
��}n||
}Wn"tk
�r<||
|}YnX|	|7}	�n�||k�r||
d|
d�|k�r�|	|7}	|
d7}
�q$||
d|
d�|k�r^||
dd�}t	|�}z|�
|�}
Wn.tk
�r�|	|||7}	|d}
YnlX|d|
�}
z.|dk�r"t�tjt�
|
��}n||
}Wn&tk
�rR|||
|}YnX|	|7}	n�|dd�}
|
d7}
||
|
d�}|�r�||k�r�|
|7}
|
d7}
||
|
d�}�q�z.|dk�r�t�tjt�
|
��}n||
}Wntk
�r||
}YnX|	|7}	|�r$|
d8}
n|	|7}	|
d7}
q�|	S)zfExpand shell variables of the forms $var, ${var} and %var%.

    Unknown variables are left unchanged.�$�%rNz_-�ascii�'�{�}�environb�$�%�'�{�}rArQ)r9r:r0r1�stringZ
ascii_lettersZdigits�getattrrlrCrTr`rn�fsdecoderm)r3rZvarcharsZquoteZpercentZbraceZrbraceZdollarrl�resrTZpathlen�c�var�valuer4r4r5rQs�













c	CsPt�|�}t|t�r*d}d}d}d}d}nd}d}d}d	}d
}|�|�rL|S|�||�}t|�\}}|�|�r�||7}|�|�}|�|�}d}|t	|�k�r,||r�|||kr�||=q�|||k�r"|dkr�||d|kr�||d|d�=|d8}n&|dk�r|�
|��r||=n|d7}q�|d7}q�|�sB|�sB|�|�||�|�S)
z0Normalize path, eliminating double slashes, etc.r8r7rZ�..)s\\.\r?rrrr)z\\.\r@rrA)
r9r:r0r1rBr;r�lstriprrC�endswith�appendr
)	r3r!r$rr Zspecial_prefixes�prefix�compsrWr4r4r5r�sF









cCs@t�|�}t|�s8t|t�r&t��}nt��}t||�}t|�S)z�Return the absolute version of a path as a fallback function in case
    `nt._getfullpathname` is not available or raises OSError. See bpo-31047 for
    more.

    )	r9r:r	r0r1�getcwdb�getcwdr
r)r3�cwdr4r4r5�_abspath_fallback�s



r�)�_getfullpathnamec	Cs4ztt|��WSttfk
r.t|�YSXdS)z&Return the absolute version of a path.N)rr�r_r`r�r2r4r4r5rs)�_getfinalpathname�readlinkc
Cs�d}t�}t|�|kr�|�t|��z:|}t|�}t|�s\t|�sJ|}Wq�ttt|�|��}Wq
t	k
r�}z|j
|kr�WY�q��W5d}~XYq
tk
r�Yq�Yq
Xq
|S)N)rArQrR��� �2�C�Wi&i(i))�setr�add�_nt_readlinkr	rrr
rr_�winerrorr`)r3�allowed_winerror�seenZold_path�exr4r4r5�_readlink_deeps&
r�cCs�d}d}|r�zt|�}|r$t||�n|WStk
r�}z�|j|krF�z0t|�}||krt|rft||�n|WWY�TSWntk
r�YnXt|�\}}|r�|s�||WY�S|r�t||�n|}W5d}~XYqXq|S)N)rArQrRr�r�r�r�r�r��{i�i�rk)r�r
r_r�r�r)r3r�rYr��new_path�namer4r4r5�_getfinalpathname_nonstrictCs(
 &r�c	
Cs^t|�}t|t�rBd}d}d}t��}t|�tt�t��krjdSn(d}d}d}t��}t|�tt�krjdS|�	|�}|s�t
|�s�t||�}zt|�}d	}Wn0t
k
r�}z|j}t|�}W5d}~XYnX|�sZ|�	|��rZ|�	|�r�||t|�d�}n|t|�d�}zt|�|k�r"|}Wn4t
k
�rX}z|j|k�rH|}W5d}~XYnX|S)
Nr?s\\?\UNC\s\\s\\.\NULr@z\\?\UNC\z\\z\\.\NULr)rr0r1r9r�rrnr&r�rBr	r
r�r_r�r�rC)	r3r�Z
unc_prefixZnew_unc_prefixr�Z
had_prefixZinitial_winerrorr�Zspathr4r4r5r'qsD



�getwindowsversionrRrQcCsft�|�}t|t�r"d}d}d}nd}d}d}|dkr:|}|sFtd��t�|�}z�tt|��}tt|��}t|�\}}t|�\}	}
t|�t|	�kr�td	|	|f��d
d�|�	|�D�}dd�|
�	|�D�}d
}
t
||�D]$\}}t|�t|�kr�q�|
d7}
q�|gt|�|
||
d�}|�s(|WSt|�WSt
ttttfk
�r`t�d||��YnXdS)z#Return a relative version of a pathr8rZr�rrrNzno path specifiedz&path is on mount %r, start on mount %rcSsg|]}|r|�qSr4r4��.0�xr4r4r5�
<listcomp>�szrelpath.<locals>.<listcomp>cSsg|]}|r|�qSr4r4r�r4r4r5r��srrAr))r9r:r0r1r`rrrrr�ziprCr
rHrIrJ�DeprecationWarningrKrL)r3�startr!rr Z	start_absZpath_absZstart_driveZ
start_restZ
path_driveZ	path_rest�
start_list�	path_listrWZe1Ze2�rel_listr4r4r5r)�sJ


�

c	s�|std��tttj|��}t|dt�r8d�d�d�nd�d�d��z@��fd	d
�|D�}�fdd
�|D�}zt�fdd
�|D��\}Wntk
r�td�d�YnXttdd
�|D���dkr�td��t	|d�
����\}}|���}�fdd
�|D�}�fdd
�|D�}t|�}t
|�}t|�D]*\}	}
|
||	k�r*|d|	�}�qf�q*|dt|��}|�rt|�n|}|��|�WSttfk
�r�tjd|���YnXdS)zDGiven a sequence of path names, returns the longest common sub-path.z%commonpath() arg is an empty sequencerr8r7rZrrrcs g|]}t|��������qSr4)rr;r<)r�rP)r$r!r4r5r��szcommonpath.<locals>.<listcomp>csg|]\}}|����qSr4r]�r�rVrP�r!r4r5r��sc3s"|]\}}|dd��kVqdS)NrAr4r�r�r4r5�	<genexpr>�szcommonpath.<locals>.<genexpr>z%Can't mix absolute and relative pathsNcss|]\}}|VqdS)Nr4r�r4r4r5r��srAzPaths don't have the same drivecsg|]}|r|�kr|�qSr4r4�r�r��rr4r5r��scsg|]}�fdd�|D��qS)csg|]}|r|�kr|�qSr4r4r�r�r4r5r�sz)commonpath.<locals>.<listcomp>.<listcomp>r4)r�r>r�r4r5r�sr-)r-)r`�tuplerGr9r:r0r1r�rCrr;r�min�max�	enumerater
rHrIrKrL)rMZdrivesplits�split_pathsr	rrr3�common�s1�s2rWr�r�r4)r$rr!r5r-�sF

)�_isdir)N)1�__doc__rr r%r!r"r$r#r&r9�sysrarK�__all__r6rr	r
rrr
r[rrrr�ntrf�ImportErrorrrrrr�r�rr�r�r�r'r�r��hasattrr�r(r)r-r�rr4r4r4r5�<module>s�	�
/8

0q2

*.2�
84__pycache__/uu.cpython-38.pyc000064400000007314151153537570012056 0ustar00U

��.em�@sjdZddlZddlZddlZdddgZGdd�de�Zddd�d	d�Zdd
d�Zdd�Z	e
d
krfe	�dS)z�Implementation of the UUencode and UUdecode functions.

encode(in_file, out_file [,name, mode], *, backtick=False)
decode(in_file [, out_file, mode, quiet])
�N�Error�encode�decodec@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/uu.pyr&sF��backtickc	Csjg}�zH|dkrtjj}n`t|t�rz|dkr8tj�|�}|dkrfzt�	|�j
}Wntk
rdYnXt|d�}|�
|�|dkr�tjj}nt|t�r�t|d�}|�
|�|dkr�d}|dkr�d}|�dd�}|�dd	�}|�d
|d@|f�d��|�d
�}t|�dk�r0|�tj||d��|�d
�}�q|�rB|�d�n
|�d�W5|D]}|���qTXdS)z
Uuencode file�-N�rb�wbi��
z\n�
z\rzbegin %o %s
i��ascii�-rr
s`
end
s 
end
)�close�sys�stdin�buffer�
isinstance�str�os�path�basename�stat�st_mode�AttributeError�open�append�stdout�replace�writer�read�len�binasciiZb2a_uu)�in_file�out_file�name�moder�opened_files�f�datarrr	r)sF








c

Cspg}|dkrtjj}nt|t�r4t|d�}|�|��z|��}|sLt	d��|�
d�sXq8|�dd�}t|�dkr8|ddkr8zt
|d	d
�Wq�Wq8tk
r�Yq8Xq8|dk�r:|d�d��d
�}tj�|�r�t	d|����|�
tj��s*dtj��|k�s*tj�r:|�
tj��s*dtj��|k�r:t	d|�d���|dk�rRt
|d	d
�}|dk�rftjj}n0t|t��r�t|d�}t�||�|}|�|�|��}	|	�rD|	�d�dk�rDzt�|	�}
Wnjtj	k
�r,}zH|	ddd@ddd}t�|	d|��}
|�stj�d|�W5d}~XYnX|�|
�|��}	�q�|	�sRt	d��W5|D]}|���qZXdS)zDecode uuencoded filerr
z'No valid begin line found in input filesbegin� ��r��Ns 	
rz Cannot overwrite existing file: z..zRefusing to write to z due to directory traversalrsend� �?��zWarning: %s
zTruncated input file)rrrrrrr r�readliner�
startswith�splitr%�int�
ValueError�rstriprrr�exists�sep�altsepr!�chmod�stripr&Za2b_uu�stderrr#)
r'r(r*�quietr+r,ZhdrZ	hdrfields�fp�sr-�v�nbytesrrr	rcsr





��
��




"
cCs4ddl}|jdd�}|jddddd	d
d�|jdd
ddd	d
d�|��\}}t|�dkrl|�d�t�d�tjj	}tj
j	}t|�dkr�|d}t|�dkr�|d}|jr�|jr�t
|t�r�t|d�}nttjdd�t�d�t||�nD|j�r&t
|t��rt|d�}nttjdd�t�d�t||�dS)zuuencode/uudecode main programrNz'usage: %prog [-d] [-t] [input [output]])Zusagez-dz--decoderzDecode (instead of encode)?F�
store_true)�dest�help�default�actionz-tz--text�textz2data is text, encoded format unix-compatible text?r/zincorrect number of argumentsr1rz: cannot do -t to stdoutr
z: cannot do -t from stdin)�optparseZOptionParserZ
add_option�
parse_argsr%�errorr�exitrrr!rrMrrr�print�argvr)rN�parserZoptions�args�input�outputrrr	�test�s6




rX�__main__)NN)NNF)�__doc__r&rr�__all__�	ExceptionrrrrXrrrrr	�<module>s
:
J&__pycache__/uuid.cpython-38.opt-1.pyc000064400000056035151153537570013336 0ustar00U

&�.e3w�@s dZddlZddlZddlmZdZejdkr8dZZn ddlZe�	�Z
e
dkZe
dkZd	d
ddg\ZZZ
ZeZeZGd
d�de�ZGdd�d�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zdaa da!zddl"Z"Wne#k
�rdZ"YnXd%d&�Z$d'd(�Z%d)d*�Z&d+d,�Z'e�rFeegZ(nJejd-k�r^eeegZ(n2ejd.k�rteegZ(ne�r�egZ(neeeeegZ(ej)d/k�r�e%ge(Z*nej)d0k�r�e&ge(Z*ne(Z*da+dd1�d2d3�Z,da-d@d4d5�Z.d6d7�Z/d8d9�Z0d:d;�Z1ed<�Z2ed=�Z3ed>�Z4ed?�Z5dS)AaQUUID objects (universally unique identifiers) according to RFC 4122.

This module provides immutable UUID objects (class UUID) and the functions
uuid1(), uuid3(), uuid4(), uuid5() for generating version 1, 3, 4, and 5
UUIDs as specified in RFC 4122.

If all you want is a unique ID, you should probably call uuid1() or uuid4().
Note that uuid1() may compromise privacy since it creates a UUID containing
the computer's network address.  uuid4() creates a random UUID.

Typical usage:

    >>> import uuid

    # make a UUID based on the host ID and current time
    >>> uuid.uuid1()    # doctest: +SKIP
    UUID('a8098c1a-f86e-11da-bd1a-00112444be1e')

    # make a UUID using an MD5 hash of a namespace UUID and a name
    >>> uuid.uuid3(uuid.NAMESPACE_DNS, 'python.org')
    UUID('6fa459ea-ee8a-3ca4-894e-db77e160355e')

    # make a random UUID
    >>> uuid.uuid4()    # doctest: +SKIP
    UUID('16fd2706-8baf-433b-82eb-8c7fada847da')

    # make a UUID using a SHA-1 hash of a namespace UUID and a name
    >>> uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org')
    UUID('886313e1-3b8a-5372-9b90-0c9aee199e5d')

    # make a UUID from a string of hex digits (braces and hyphens ignored)
    >>> x = uuid.UUID('{00010203-0405-0607-0809-0a0b0c0d0e0f}')

    # convert a UUID to a string of hex digits in standard form
    >>> str(x)
    '00010203-0405-0607-0809-0a0b0c0d0e0f'

    # get the raw 16 bytes of the UUID
    >>> x.bytes
    b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f'

    # make a UUID from a 16-byte string
    >>> uuid.UUID(bytes=x.bytes)
    UUID('00010203-0405-0607-0809-0a0b0c0d0e0f')
�N)�EnumzKa-Ping Yee <ping@zesty.ca>)�win32�darwinFZAIXZLinuxzreserved for NCS compatibilityzspecified in RFC 4122z$reserved for Microsoft compatibilityzreserved for future definitionc@seZdZdZdZdZdS)�SafeUUIDr���N)�__name__�
__module__�__qualname__ZsafeZunsafe�unknown�rr�/usr/lib64/python3.8/uuid.pyrHsrc@s:eZdZdZdZd=ejd�dd�Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zedd ��Zed!d"��Zed#d$��Zed%d&��Zed'd(��Zed)d*��Zed+d,��Zed-d.��Zed/d0��Zed1d2��Zed3d4��Zed5d6��Z ed7d8��Z!ed9d:��Z"ed;d<��Z#dS)>�UUIDa�	Instances of the UUID class represent UUIDs as specified in RFC 4122.
    UUID objects are immutable, hashable, and usable as dictionary keys.
    Converting a UUID to a string with str() yields something in the form
    '12345678-1234-1234-1234-123456789abc'.  The UUID constructor accepts
    five possible forms: a similar string of hexadecimal digits, or a tuple
    of six integer fields (with 32-bit, 16-bit, 16-bit, 8-bit, 8-bit, and
    48-bit values respectively) as an argument named 'fields', or a string
    of 16 bytes (with all the integer fields in big-endian order) as an
    argument named 'bytes', or a string of 16 bytes (with the first three
    fields in little-endian order) as an argument named 'bytes_le', or a
    single 128-bit integer as an argument named 'int'.

    UUIDs have these read-only attributes:

        bytes       the UUID as a 16-byte string (containing the six
                    integer fields in big-endian byte order)

        bytes_le    the UUID as a 16-byte string (with time_low, time_mid,
                    and time_hi_version in little-endian byte order)

        fields      a tuple of the six integer fields of the UUID,
                    which are also available as six individual attributes
                    and two derived attributes:

            time_low                the first 32 bits of the UUID
            time_mid                the next 16 bits of the UUID
            time_hi_version         the next 16 bits of the UUID
            clock_seq_hi_variant    the next 8 bits of the UUID
            clock_seq_low           the next 8 bits of the UUID
            node                    the last 48 bits of the UUID

            time                    the 60-bit timestamp
            clock_seq               the 14-bit sequence number

        hex         the UUID as a 32-character hexadecimal string

        int         the UUID as a 128-bit integer

        urn         the UUID as a URN as specified in RFC 4122

        variant     the UUID variant (one of the constants RESERVED_NCS,
                    RFC_4122, RESERVED_MICROSOFT, or RESERVED_FUTURE)

        version     the UUID version number (1 through 5, meaningful only
                    when the variant is RFC_4122)

        is_safe     An enum indicating whether the UUID has been generated in
                    a way that is safe for multiprocessing applications, via
                    uuid_generate_time_safe(3).
    )�int�is_safe�__weakref__N)rcCs�|||||g�d�dkr td��|dk	rl|�dd��dd�}|�d��dd�}t|�d	krbtd
��t|d�}|dk	r�t|�dkr�td��|d
dd�|dd
d�|ddd�|dd�}|dk	r�t|�dkr�td��tj|dd�}|dk	�rt|�dk�rtd��|\}}	}
}}}
d|k�r0dk�s:ntd��d|	k�rRdk�s\ntd��d|
k�rtdk�s~ntd��d|k�r�dk�s�ntd��d|k�r�dk�s�ntd��d|
k�r�d k�s�ntd!��|d>|B}|d">|	d#>B|
d$>B|d%>B|
B}|dk	�rDd|k�r:d&d'>k�sDntd(��|dk	�r�d&|k�rfdk�spntd)��|d*M}|d+O}|d,M}||d->O}t�	|d.|�t�	|d/|�dS)0aLCreate a UUID from either a string of 32 hexadecimal digits,
        a string of 16 bytes as the 'bytes' argument, a string of 16 bytes
        in little-endian order as the 'bytes_le' argument, a tuple of six
        integers (32-bit time_low, 16-bit time_mid, 16-bit time_hi_version,
        8-bit clock_seq_hi_variant, 8-bit clock_seq_low, 48-bit node) as
        the 'fields' argument, or a single 128-bit integer as the 'int'
        argument.  When a string of hex digits is given, curly braces,
        hyphens, and a URN prefix are all optional.  For example, these
        expressions all yield the same UUID:

        UUID('{12345678-1234-5678-1234-567812345678}')
        UUID('12345678123456781234567812345678')
        UUID('urn:uuid:12345678-1234-5678-1234-567812345678')
        UUID(bytes='\x12\x34\x56\x78'*4)
        UUID(bytes_le='\x78\x56\x34\x12\x34\x12\x78\x56' +
                      '\x12\x34\x56\x78\x12\x34\x56\x78')
        UUID(fields=(0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x567812345678))
        UUID(int=0x12345678123456781234567812345678)

        Exactly one of 'hex', 'bytes', 'bytes_le', 'fields', or 'int' must
        be given.  The 'version' argument is optional; if given, the resulting
        UUID will have its variant and version set according to RFC 4122,
        overriding the given 'hex', 'bytes', 'bytes_le', 'fields', or 'int'.

        is_safe is an enum exposed as an attribute on the instance.  It
        indicates whether the UUID has been generated in a way that is safe
        for multiprocessing applications, via uuid_generate_time_safe(3).
        N�zGone of the hex, bytes, bytes_le, fields, or int arguments must be givenzurn:�zuuid:z{}�-� z$badly formed hexadecimal UUID string�z bytes_le is not a 16-char string�r���zbytes is not a 16-char string�big)�	byteorder�zfields is not a 6-tuplerlz*field 1 out of range (need a 32-bit value)iz*field 2 out of range (need a 16-bit value)z*field 3 out of range (need a 16-bit value)�z*field 4 out of range (need an 8-bit value)z*field 5 out of range (need an 8-bit value)�z*field 6 out of range (need a 48-bit value)�`�P�@�0��z*int is out of range (need a 128-bit value)zillegal version numberl�����l�����Lrr)
�count�	TypeError�replace�strip�len�
ValueError�int_�
from_bytes�object�__setattr__)�self�hex�bytes�bytes_le�fieldsr�versionr�time_low�time_mid�time_hi_version�clock_seq_hi_variant�
clock_seq_low�node�	clock_seqrrr�__init__�sx 
�
�
����

z
UUID.__init__cCs&d|ji}|jtjkr"|jj|d<|S�Nrr)rrrr
�value)r1�drrr�__getstate__�s
zUUID.__getstate__cCs:t�|d|d�t�|dd|kr.t|d�ntj�dSr?)r/r0rr
)r1�staterrr�__setstate__�s��zUUID.__setstate__cCst|t�r|j|jkStS�N��
isinstancer
r�NotImplemented�r1�otherrrr�__eq__�s
zUUID.__eq__cCst|t�r|j|jkStSrErFrIrrr�__lt__�s
zUUID.__lt__cCst|t�r|j|jkStSrErFrIrrr�__gt__�s
zUUID.__gt__cCst|t�r|j|jkStSrErFrIrrr�__le__�s
zUUID.__le__cCst|t�r|j|jkStSrErFrIrrr�__ge__s
zUUID.__ge__cCs
t|j�SrE)�hashr�r1rrr�__hash__sz
UUID.__hash__cCs|jSrE�rrQrrr�__int__szUUID.__int__cCsd|jjt|�fS)Nz%s(%r))�	__class__r�strrQrrr�__repr__sz
UUID.__repr__cCstd��dS)NzUUID objects are immutable)r()r1�namer@rrrr0szUUID.__setattr__cCsDd|j}d|dd�|dd�|dd�|dd�|dd�fS)N�%032xz%s-%s-%s-%s-%sr�r�rS)r1r2rrr�__str__s





�zUUID.__str__cCs|j�dd�S)Nrr)r�to_bytesrQrrrr3sz
UUID.bytescCs<|j}|ddd�|ddd�|ddd�|dd�S)Nrrrrr�r3)r1r3rrrr4s(
�z
UUID.bytes_lecCs|j|j|j|j|j|jfSrE)r7r8r9r:r;r<rQrrrr5 s
�zUUID.fieldscCs
|jd?S)NrrSrQrrrr7%sz
UUID.time_lowcCs|jd?d@S)Nr �rSrQrrrr8)sz
UUID.time_midcCs|jd?d@S)Nr!r_rSrQrrrr9-szUUID.time_hi_versioncCs|jd?d@S)N�8�rSrQrrrr:1szUUID.clock_seq_hi_variantcCs|jd?d@S)Nr"rarSrQrrrr;5szUUID.clock_seq_lowcCs|jd@d>|jd>B|jBS)N�r"r)r9r8r7rQrrr�time9s
��z	UUID.timecCs|jd@d>|jBS)N�?r)r:r;rQrrrr=>s�zUUID.clock_seqcCs
|jd@S)Nl���rSrQrrrr<Csz	UUID.nodecCs
d|jS)NrYrSrQrrrr2GszUUID.hexcCsdt|�S)Nz	urn:uuid:)rVrQrrr�urnKszUUID.urncCs2|jd@stS|jd@stS|jd@s*tStSdS)Nr%ll)r�RESERVED_NCS�RFC_4122�RESERVED_MICROSOFT�RESERVED_FUTURErQrrr�variantOs


zUUID.variantcCs |jtkrt|jd?d@�SdS)Nr&�)rjrgrrQrrrr6Zs
zUUID.version)NNNNNN)$rrr	�__doc__�	__slots__rr
r>rBrDrKrLrMrNrOrRrTrWr0r\�propertyr3r4r5r7r8r9r:r;rcr=r<r2rerjr6rrrrr
Nsd3��V














r
c	Gs�ddl}ddl}ddl}|�|�}|dkrP|j�d�}|j||d�}|dkrPdSt|j�}d|d<|j|f||j	|j
|d�}|S)Nr)z/sbinz	/usr/sbin)�path�C�LC_ALL)�stdout�stderr�env)�os�shutil�
subprocessZwhich�pathsep�join�dict�environ�Popen�PIPEZDEVNULL)	�command�argsrurvrw�
executablerort�procrrr�_popen`s

�r�cCs
|d@S)Nlr��macrrr�
_is_universal�sr�cCs�d}z�t|f|����}|s"WdS|��|jD]�}|������}tt|��D]x}|||krNzN|||�}	t|	�dd�d�}
t	|
�r�|
WW5QR�WS|p�|
}WqNt
tfk
r�YqNXqNq.W5QRXWntk
r�YnX|p�dS)N�:�r)
r��splitrr�lower�rstrip�ranger+rr)r�r,�
IndexError�OSError)r~rZhw_identifiersZ	get_index�first_local_macr��line�words�i�wordr�rrr�	_find_mac�s*
r�cCs4d}dD]&}td||dd��}|r*|SdSdS)z5Get the hardware address on Unix by running ifconfig.)shwaddrsethersaddress:slladdr)rz-az-avZifconfigcSs|dS�Nr#r�r�rrr�<lambda>�r�z#_ifconfig_getnode.<locals>.<lambda>N�r�)�keywordsrr�rrr�_ifconfig_getnode�sr�cCs tdddgdd��}|r|SdS)z/Get the hardware address on Unix by running ip.Zip�links
link/ethercSs|dSr�rr�rrrr��r�z_ip_getnode.<locals>.<lambda>Nr�r�rrr�_ip_getnode�sr�cCs�ddl}ddl}z|�|���}Wntk
r8YdSXtdd|�|�gdd��}|r\|Stdd|�|�gdd��}|r~|Stdd|�d|�gd	d��}|r�|SdS)
z0Get the hardware address on Unix by running arp.rNZarpz-ancSsdS)Nrrr�rrrr��r�z_arp_getnode.<locals>.<lambda>cSs|dSr�rr�rrrr��r�z(%s)cSs|dS)N�rr�rrrr��r�)ru�socketZ
gethostbynameZgethostnamer�r��fsencode)rur�Zip_addrr�rrr�_arp_getnode�s"�r�cCstdddgdd��S)z4Get the hardware address on Unix by running lanscan.Zlanscanz-aislan0cSsdS)Nrrr�rrrr��r�z"_lanscan_getnode.<locals>.<lambda>r�rrrr�_lanscan_getnode�sr�cCs&d}�z�tdd�}|sWdS|��|j������}z|�d�}Wn"tk
rdYW5QR�WdSX|jD]�}zl|����}||}t|�dkr�|�d�dkr�t	|�
dd�d	�}t|�r�|WW5QR�WS|p�|}Wqlttfk
r�YqlXqlW5QRXWnt
k
�rYnX|�p$dS)
z4Get the hardware address on Unix by running netstat.NZnetstatz-iasAddress�r�rr�r)r�rr�readliner�r��indexr,r+r'rr)r�r�r�)r�r�r�r�r�r�r�rrr�_netstat_getnode�s2

r�cCs<ddl}ddl}ddl}d}dddg}z:ddl}|�d�}|jj�|d�|�d|j	�
d��WnYnX|D]�}z$|j|j�
|d�d	g|jd
d�}Wntk
r�YqrYnX|�r|jD]d}	|	�d�d
����}
|�d|
�r�t|
�dd�d�}t|��r|W5QR�S|�p"|}q�W5QRXqr|�p:dS)z<Get the hardware address on Windows by running ipconfig.exe.rNrzc:\windows\system32zc:\winnt\system32i,�mbcsZipconfigz/allZoem)rr�encoding�:rz((?:[0-9a-f][0-9a-f]-){5}[0-9a-f][0-9a-f]rr)ru�rerw�ctypes�create_string_buffer�windllZkernel32ZGetSystemDirectoryA�insertr@�decoder|roryr}r�rrr�r*r��	fullmatchrr)r�)rur�rwr��dirsr��buffer�dirr�r�r@r�rrr�_ipconfig_getnode�s6

�



r�c	Cs6ddl}ddl}d}|��}|j|_|��|_}|��|�|�dkrLdS|�	�t
|j�D]�}|��|j
|_t|j|�|_|�|�dkr�q^|��|j|_t|j|�|_d�d�|_|��|_}|�|�dkr�q^|�	�|jdd�}t|�dk�rq^t�|d�}t|��r |S|�p(|}q^|�p4dS)ztGet the hardware address on Windows using NetBIOS calls.
    See http://support.microsoft.com/kb/118623 for details.rN�*rrr)�	win32wnet�netbiosZNCBZNCBENUMZCommandZ	LANA_ENUMZBufferZ_packZNetbiosZ_unpackr�ZlengthZResetZNCBRESET�ordZlanaZLana_numZNCBASTAT�ljustZCallnameZADAPTER_STATUSZadapter_addressr+rr.r�)	r�r�r�ZncbZadaptersr�Zstatusr3r�rrr�_netbios_getnodes>
r�c
s�tdk	rdSdatjdkr8tt��j�d�d�dkr8ntdk	rPtj	a
tjadSz�ddl�ddl
�dg}tj�d�s~|�d	�|D]�}z���j�|��}Wntk
r�Yq�YnXt|d
�r�|j���fdd�a
d
a�qq�t|d�r�|j�d�_��fdd�a
�qq�z�jj}Wnd}YnXt|dt|dd��aWn>tk
�r~}zddl}|�d|��t�W5d}~XYnXdS)zG
    Try to load platform-specific functions for generating uuids.
    NFr�.r�	Zuuid�win�c�uuid_generate_time_safecs ��d�}�|�}t|j�|fS�Nr�r�r3�raw)�_buffer�res)�_uuid_generate_time_safer�rr�_generate_time_safehs
r�T�uuid_generate_timecs ��d�}�|�t|j�dfSr�r�)r�)�_uuid_generate_timer�rrr�ss
ZUuidCreateSequentialZ
UuidCreatez/Could not find fallback ctypes uuid functions: )�_has_uuid_generate_time_safe�sys�platformrru�uname�releaser��_uuidZgenerate_time_safer�Zhas_uuid_generate_time_safer�Zctypes.util�
startswith�appendZCDLL�utilZfind_library�	Exception�hasattrr�r�Zrestyper�Zrpcrt4�getattr�_UuidCreate�warnings�warn�
ImportWarning)Z	_libnamesZlibname�lib�excr�r)r�r�r�r�_load_system_functions:sT&






��r�cCst�t�\}}t|d�jS)zPGet the hardware address on Unix using the _uuid extension module
    or ctypes.r^)r�r�r
r<)�	uuid_time�_rrr�
_unix_getnode�s
r�cCs:ddl}t�|�d�}t|�dkr6tt|j�d�jSdS)z1Get the hardware address on Windows using ctypes.rNrr^)r�r�r�r�r
�bytes_r�r<)r�r�rrr�_windll_getnode�s

r�cCsddl}|�d�dBS)zGet a random node ID.rNr"l)�random�getrandbits)r�rrr�_random_getnode�sr�rr�posix�nt)�getterscCsdtdk	rtSttgD]H}z
|�aWnYqYnXtdk	rdtkrRdkrnqtSqdS)a3Get the hardware address as a 48-bit positive integer.

    The first time this runs, it may launch a separate program, which could
    be quite slow.  If all attempts to obtain the hardware address fail, we
    choose a random 48-bit number with its eighth bit set to 1 as recommended
    in RFC 4122.
    Nrr)�_node�_GETTERSr�)r��getterrrr�getnode�s	

 
r�cCst�tdk	rd||kr"dkrdnn>t�\}}zt|�}Wntk
rVtj}YnXt||d�Sddl}|��}|dd}tdk	r�|tkr�td}|a|dkr�ddl	}|�
d�}|d@}	|d	?d
@}
|d?d@}|d
@}|d?d@}
|dkr�t�}t|	|
||
||fdd�S)aGenerate a UUID from a host ID, sequence number, and the current time.
    If 'node' is not given, getnode() is used to obtain the hardware
    address.  If 'clock_seq' is given, it is used as the sequence number;
    otherwise a random 14-bit sequence number is chosen.N)r3rr�dl@'Hw�
r#�l��rr_r"rbrarrd)r5r6)r�r�rr,r
r
rc�time_ns�_last_timestampr�r�r�)r<r=r�Zsafely_generatedrrcZnanosecondsZ	timestampr�r7r8r9r;r:rrr�uuid1�s> 

��r�cCs<ddlm}||jt|d�dd���}t|dd�dd	�S)
zAGenerate a UUID from the MD5 hash of a namespace UUID and a name.r)�md5�utf-8F)ZusedforsecurityNrr�r3r6)�hashlibr�r3�digestr
)�	namespacerXr�r�rrr�uuid3s�
r�cCstt�d�dd�S)zGenerate a random UUID.rrr�)r
ru�urandomrrrr�uuid4sr�cCs8ddlm}||jt|d����}t|dd�dd�S)zCGenerate a UUID from the SHA-1 hash of a namespace UUID and a name.r)�sha1r�Nrrr�)r�r�r3r�r
)r�rXr�rPrrr�uuid5sr�z$6ba7b810-9dad-11d1-80b4-00c04fd430c8z$6ba7b811-9dad-11d1-80b4-00c04fd430c8z$6ba7b812-9dad-11d1-80b4-00c04fd430c8z$6ba7b814-9dad-11d1-80b4-00c04fd430c8)NN)6rlrur��enumr�
__author__r�Z_AIXZ_LINUX�systemZ_platform_systemrfrgrhrirr-r3r�rr
r�r�r�r�r�r�r�r�r�r�r�r�r�r��ImportErrorr�r�r�r�Z_OS_GETTERSrXr�r�r�r�r�r�r�r�Z
NAMESPACE_DNSZ
NAMESPACE_URLZ
NAMESPACE_OIDZNAMESPACE_X500rrrr�<module>s�.

�"
$
T

�
'	__pycache__/zipapp.cpython-38.pyc000064400000013340151153537570012724 0ustar00U

e5do�@s�ddlZddlZddlZddlZddlZddlZddlZdddgZdZej	�
d�rXdZne��ZGdd�de
�Zejd	d
��Zdd�Zdd
d�Zddd�Zdd�Zddd�Zedkr�e�dS)�N�ZipAppError�create_archive�get_interpreterz8# -*- coding: utf-8 -*-
import {module}
{module}.{fn}()
�win�utf-8c@seZdZdS)rN)�__name__�
__module__�__qualname__�r
r
�/usr/lib64/python3.8/zipapp.pyr!sc	cs8t|ttjf�r.t||��}|VW5QRXn|VdS�N)�
isinstance�str�os�PathLike�open)�archive�mode�fr
r
r�_maybe_open%srcCs$|r d|�t�d}|�|�dS)zWrite a shebang line.�#!�
N)�encode�shebang_encoding�write)r�interpreterZshebangr
r
r�_write_file_prefix.src
Cs�t|d��Z}|�d�}|dkr*d}|��t|d��&}t||�|�|�t�||�W5QRXW5QRX|r�t|t�r�t	�
|t	�|�jtj
B�dS)z8Copy an application archive, modifying the shebang line.�rb�r��wbN)r�read�readlinerr�shutilZcopyfileobjr
rr�chmod�stat�st_mode�S_IEXEC)rZnew_archiver�srcZfirst_2Zdstr
r
r�
_copy_archive5s


 r)Fc
Cs�d}t|d�rt|d�rd}nt�|�}|��r4d}|rHt|||�dS|��sXtd��|d��}|rt|rttd��|s�|s�td	��d}|r�|�d
�\}	}
}tdd�|	�	d
�D��}tdd�|�	d
�D��}
|
d
kr�|r�|
s�td|��t
j|	|d�}|dk�r|�d�}nt|d��s"t�|�}t
|d���}t||�|�rDtjntj}tj|d|d��^}|�d�D]4}|�|�}|dk�s�||��rf|�||����qf|�r�|�d|�d��W5QRXW5QRX|�r�t|d��s�|�|��jtjB�dS)abCreate an application archive from SOURCE.

    The SOURCE can be the name of a directory, or a filename or a file-like
    object referring to an existing archive.

    The content of SOURCE is packed into an application archive in TARGET,
    which can be a filename or a file-like object.  If SOURCE is a directory,
    TARGET can be omitted and will default to the name of SOURCE with .pyz
    appended.

    The created application archive will have a shebang line specifying
    that it should run with INTERPRETER (there will be no shebang line if
    INTERPRETER is None), and a __main__.py which runs MAIN (if MAIN is
    not specified, an existing __main__.py will be used).  It is an error
    to specify MAIN for anything other than a directory source with no
    __main__.py, and it is an error to omit MAIN if the directory has no
    __main__.py.
    Fr!r"TNzSource does not existz__main__.pyz8Cannot specify entry point if the source has __main__.pyzArchive has no entry point�:css|]}|��VqdSr��isidentifier��.0�partr
r
r�	<genexpr>{sz!create_archive.<locals>.<genexpr>�.css|]}|��VqdSrr+r-r
r
rr0|szInvalid entry point: )�module�fnz.pyzrr �w)�compression�*r)�hasattr�pathlib�Path�is_filer)�existsr�	partition�all�split�
MAIN_TEMPLATE�formatZwith_suffixrr�zipfileZZIP_DEFLATEDZ
ZIP_STOREDZZipFileZrglob�relative_torZas_posixZwritestrrr$r%r&r')�source�targetr�main�filter�
compressedZsource_is_fileZhas_mainZmain_py�mod�sepr3Zmod_okZfn_ok�fdr5�zZchildZarcnamer
r
rrLsX
�


�
&c
CsFt|d��2}|�d�dkr8|�����t�W5QR�SW5QRXdS)Nrrr)rr!r"�strip�decoder)rrr
r
rr�scCs<ddl}|��}|jddddd�|jdddd	d�|jd
dddd�|jd
dddd�|jddddd�|jddd�|�|�}|jr�tj�|j�s�t	d��t
|j�}td�|p�d��t
�d�tj�|j��r|jdk�stj�|j��rtj�|j|j��rt	d��|j�rt	d��t|j|j|j|j|jd�dS)z�Run the zipapp command line interface.

    The ARGS parameter lets you specify the argument list directly.
    Omitting ARGS (or setting it to None) works as for argparse, using
    sys.argv[1:] as the argument list.
    rNz--outputz-ozAThe name of the output archive. Required if SOURCE is an archive.)�default�helpz--pythonz-pzEThe name of the Python interpreter to use (default: no shebang line).z--mainz-mzLThe main function of the application (default: use an existing __main__.py).z
--compressz-c�
store_truezQCompress files with the deflate method. Files are stored uncompressed by default.)�actionrOz--infoFz)Display the interpreter from the archive.)rNrQrOrCz'Source directory (or existing archive).)rOz%Can only get info for an archive filezInterpreter: {}z<none>z-In-place editing of archives is not supportedz,Cannot change the main function when copying)rrErG)�argparse�ArgumentParser�add_argument�
parse_args�infor�path�isfilerC�
SystemExitr�printr@�sys�exit�outputr;�samefilerEr�python�compress)�argsrR�parserrr
r
rrE�sN
�
�
�
�
��


�
�rE�__main__)N)NNNNF)N)�
contextlibrr8r#r%r[rA�__all__r?�platform�
startswithr�getfilesystemencoding�
ValueErrorr�contextmanagerrrr)rrrErr
r
r
r�<module>s0



�
J
1__pycache__/tempfile.cpython-38.opt-2.pyc000064400000040751151153537570014174 0ustar00U

e5d�k�
@s�dddddddddd	d
ddg
Zd
dlZd
dlZd
dlZd
dlZd
dl	Z
d
dlZd
dl
mZd
dlZd
dlZd
dlZejZejejBejBZeed�r�eejOZeZeed�r�eejOZeed�r�ejZndZdZ e�Z!dd�Z"dd�Z#dd�Z$Gdd�d�Z%dd�Z&dd�Z'da(d d!�Z)d"d#�Z*d$d�Z+d%d�Z,da-d&d
�Z.d'd�Z/d<d)d�Z0d=d*d�Z1d+e dfd,d�Z2Gd-d.�d.�Z3Gd/d0�d0�Z4d>dd4�d5d�Z5ej6d6k�s�ej7d7k�r�e5Z8need8�a9d?dd4�d9d�Z8Gd:d�d�Z:Gd;d�de;�Z<dS)@�NamedTemporaryFile�
TemporaryFile�SpooledTemporaryFile�TemporaryDirectory�mkstemp�mkdtemp�mktemp�TMP_MAX�
gettempprefix�tempdir�
gettempdir�gettempprefixb�gettempdirb�N)�Random�
O_NOFOLLOW�O_BINARYi'ZtmpcCs.zt�|�Wntk
r$YdSXdSdS)NFT)�_os�lstat�OSError)�fn�r� /usr/lib64/python3.8/tempfile.py�_existsKs
rcGs\d}|D]B}|dkrqt|t�r6|tkr0td��t}q|tkrFtd��t}q|dkrXtS|S)Nz1Can't mix bytes and non-bytes in path components.)�
isinstance�bytes�str�	TypeError)�argsZreturn_type�argrrr�_infer_return_typeTs
rcCsdt|||�}|dkr|�}|dkr:|tkr0t}n
t�t�}|dkrX|tkrRt�}nt�}||||fS�N)rr�templater�fsencoderr
)�prefix�suffix�dir�output_typerrr�_sanitize_paramsis
r'c@s,eZdZdZedd��Zdd�Zdd�ZdS)	�_RandomNameSequenceZ%abcdefghijklmnopqrstuvwxyz0123456789_cCs,t��}|t|dd�kr&t�|_||_|jS)N�_rng_pid)r�getpid�getattr�_RandomZ_rngr))�selfZcur_pidrrr�rng�s
z_RandomNameSequence.rngcCs|Sr r�r-rrr�__iter__�sz_RandomNameSequence.__iter__cs0|j�|jj���fdd�td�D�}d�|�S)Ncsg|]}����qSrr)�.0Zdummy��cZchooserr�
<listcomp>�sz0_RandomNameSequence.__next__.<locals>.<listcomp>��)�
charactersr.Zchoice�range�join)r-Zlettersrr2r�__next__�sz_RandomNameSequence.__next__N)�__name__�
__module__�__qualname__r7�propertyr.r0r:rrrrr({s

r(c	Cs�g}dD]}t�|�}|r|�|�qtjdkrX|�tj�d�tj�d�ddddg�n|�d	d
dg�z|�t���Wn$t	t
fk
r�|�tj�YnX|S)N)ZTMPDIRZTEMPZTMP�ntz~\AppData\Local\Tempz%SYSTEMROOT%\Tempzc:\tempzc:\tmpz\tempz\tmpz/tmpz/var/tmpz/usr/tmp)r�getenv�append�name�extend�path�
expanduser�
expandvars�getcwd�AttributeErrorr�curdir)�dirlistZenvname�dirnamerrr�_candidate_tempdir_list�s&


�rLcCsFt�}t�}|D�]}|tjkr,tj�|�}td�D�]�}t|�}tj�||�}zft�	|t
d�}z<z*t
j	|ddd��}|�d�W5QRXW5t�|�XW5t�|�X|WStk
r�Yq4tk
�rtjdk�rtj�|��rt�|tj��rYq4YqYq4tk
�r,YqYq4Xq4qttjd|��dS)	N�d��wbF)�closefdsblatr?z)No usable temporary directory found in %s)r(rLrrIrD�abspathr8�nextr9�open�_bin_openflags�unlink�close�_io�write�FileExistsError�PermissionErrorrB�isdir�access�W_OKr�FileNotFoundError�_errnoZENOENT)ZnamerrJr%�seqrB�filename�fd�fprrr�_get_default_tempdir�s@	

�
��rdcCs2tdkr.t��ztdkr t�aW5t��XtSr )�_name_sequence�
_once_lock�acquire�releaser(rrrr�_get_candidate_names�s

ric
	Cs�t�}|tkrttj|�}tt�D]�}t|�}tj�	||||�}t
�d|�zt�||d�}	WnVt
k
rzYq"Yn@tk
r�tjdkr�tj�|�r�t�|tj�r�Yq"n�YnX|	tj�|�fSt
tjd��dS)Nztempfile.mkstemprNr?z#No usable temporary file name found)rir�maprr"r8rrRrDr9�_sys�auditrSrYrZrBr[r\r]rQr_�EEXIST)
r%ZpreZsuf�flagsr&�namesr`rB�filerbrrr�_mkstemp_inner�s*��rqcCstSr )r!rrrrr	
scCst�t��Sr )rr"r	rrrrrscCs2tdkr.t��ztdkr t�aW5t��XtSr )r
rfrgrhrdrrrrrs

cCst�t��Sr )rr"rrrrrr
#sFcCs2t|||�\}}}}|rt}nt}t|||||�Sr )r'�_text_openflagsrTrq)r$r#r%�textr&rnrrrr's
c	Cs�t|||�\}}}}t�}|tkr.ttj|�}tt�D]�}t|�}tj	�
||||�}t�d|�zt�
|d�WnVtk
r�Yq6Yn@tk
r�tjdkr�tj	�|�r�t�|tj�r�Yq6n�YnX|Sttjd��dS)Nztempfile.mkdtemp�r?z(No usable temporary directory name found)r'rirrjrr"r8rrRrDr9rkrl�mkdirrYrZrBr[r\r]r_rm)r$r#r%r&ror`rBrprrrrNs,
��r6cCs`|dkrt�}t�}tt�D]2}t|�}tj�||||�}t|�s|Sqt	t
jd��dS)Nz"No usable temporary filename found)rrir8rrRrrDr9rrYr_rm)r$r#r%ror`rBrprrrrvs
�c@sHeZdZdZdZddd�Zejdkr<ejfdd�Z	d	d
�Z
ndd�Z	dS)
�_TemporaryFileCloserNFTcCs||_||_||_dSr )rprB�delete�r-rprBrwrrr�__init__�sz_TemporaryFileCloser.__init__r?cCs<|js8|jdk	r8d|_z|j��W5|jr6||j�XdS�NT)�close_calledrprwrBrV)r-rUrrrrV�sz_TemporaryFileCloser.closecCs|��dSr )rVr/rrr�__del__�sz_TemporaryFileCloser.__del__cCs|jsd|_|j��dSrz)r{rprVr/rrrrV�s)T)r;r<r=rpr{ryrrBrUrVr|rrrrrv�s



rvc@s>eZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�ZdS)�_TemporaryFileWrapperTcCs$||_||_||_t|||�|_dSr )rprBrwrv�_closerrxrrrry�sz_TemporaryFileWrapper.__init__cs^|jd}t||�}t|d�rD|�t����fdd��}|j|_|}t|t�sZt|||�|S)Nrp�__call__cs
�||�Sr r)r�kwargs��funcrr�func_wrapper�sz7_TemporaryFileWrapper.__getattr__.<locals>.func_wrapper)	�__dict__r+�hasattr�
_functools�wrapsr~r�int�setattr)r-rBrp�ar�rr�r�__getattr__�s



z!_TemporaryFileWrapper.__getattr__cCs|j��|Sr )rp�	__enter__r/rrrr��s
z_TemporaryFileWrapper.__enter__cCs|j�|||�}|��|Sr )rp�__exit__rV)r-�exc�value�tb�resultrrrr��sz_TemporaryFileWrapper.__exit__cCs|j��dSr )r~rVr/rrrrV�sz_TemporaryFileWrapper.closeccs|jD]
}|VqdSr )rp)r-�linerrrr0�s
z_TemporaryFileWrapper.__iter__N)T)	r;r<r=ryr�r�r�rVr0rrrrr}�s
r}�w+b���T��errorscCs�t|||�\}}}}	t}
tjdkr0|r0|
tjO}
t||||
|	�\}}z$tj||||||d�}
t|
||�WSt	k
r�t�
|�t�|��YnXdS)Nr?��	buffering�newline�encodingr�)r'rTrrBZO_TEMPORARYrqrWrSr}�
BaseExceptionrUrV)�moder�r�r�r$r#r%rwr�r&rnrbrBrprrrrs 

�

�posix�cygwin�	O_TMPFILEc
Cs�t|||�\}}}}t}	tr�z$|	tjBtj@}
t�||
d�}Wn*tk
rXdaYnFtk
rjYn4Xzt	j||||||d�WSt�
|��YnXt||||	|�\}}z"t�|�t	j||||||d�WSt�
|��YnXdS)NrNFr�)
r'rT�_O_TMPFILE_WORKSrr��O_CREATrS�IsADirectoryErrorrrWrVrqrU)
r�r�r�r�r$r#r%r�r&rnZflags2rbrBrrrr2s<
�


�
c@s�eZdZdZd9dd�dd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�Z	dd�Z
edd��Zedd��Z
edd��Zdd�Zdd�Zdd �Zed!d"��Zed#d$��Zed%d&��Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zed/d0��Zd1d2�Zd:d3d4�Zd5d6�Zd7d8�ZdS);rFrr�r�Nr�c	
	CsTd|krt��|_ntjt��||	|d�|_||_d|_||||||||	d�|_dS)N�b)r�r�r�F)r�r�r$r#r�r�r%r�)rW�BytesIO�_file�
TextIOWrapper�	_max_size�_rolled�_TemporaryFileArgs)
r-�max_sizer�r�r�r�r$r#r%r�rrrryus"
��zSpooledTemporaryFile.__init__cCs,|jr
dS|j}|r(|��|kr(|��dSr )r�r��tell�rollover)r-rpr�rrr�_check�s
zSpooledTemporaryFile._checkcCsr|jr
dS|j}tf|j�}|_|`|��}t|d�rN|j�|���	��n|�|�	��|�
|d�d|_dS)N�bufferrT)r�r�rr�r�r�r�rX�detach�getvalue�seek)r-rpZnewfile�posrrrr��s
zSpooledTemporaryFile.rollovercCs|jjrtd��|S)Nz%Cannot enter context with closed file)r��closed�
ValueErrorr/rrrr��szSpooledTemporaryFile.__enter__cCs|j��dSr �r�rV�r-r�r�r�rrrr��szSpooledTemporaryFile.__exit__cCs
|j��Sr )r�r0r/rrrr0�szSpooledTemporaryFile.__iter__cCs|j��dSr r�r/rrrrV�szSpooledTemporaryFile.closecCs|jjSr )r�r�r/rrrr��szSpooledTemporaryFile.closedcCs|jjSr )r�r�r/rrrr��szSpooledTemporaryFile.encodingcCs|jjSr )r�r�r/rrrr��szSpooledTemporaryFile.errorscCs|��|j��Sr )r�r��filenor/rrrr��szSpooledTemporaryFile.filenocCs|j��dSr )r��flushr/rrrr��szSpooledTemporaryFile.flushcCs
|j��Sr )r��isattyr/rrrr��szSpooledTemporaryFile.isattycCs.z
|jjWStk
r(|jdYSXdS)Nr�)r�r�rHr�r/rrrr��s
zSpooledTemporaryFile.modecCs&z
|jjWStk
r YdSXdSr )r�rBrHr/rrrrB�s
zSpooledTemporaryFile.namecCs|jjSr )r��newlinesr/rrrr��szSpooledTemporaryFile.newlinescGs|jj|�Sr )r��read�r-rrrrr��szSpooledTemporaryFile.readcGs|jj|�Sr )r��readliner�rrrr��szSpooledTemporaryFile.readlinecGs|jj|�Sr )r��	readlinesr�rrrr��szSpooledTemporaryFile.readlinescGs|jj|�Sr )r�r�r�rrrr��szSpooledTemporaryFile.seekcCs|jjSr )r��	softspacer/rrrr��szSpooledTemporaryFile.softspacecCs
|j��Sr )r�r�r/rrrr��szSpooledTemporaryFile.tellcCs6|dkr|j��n||jkr&|��|j�|�dSr )r��truncater�r�)r-�sizerrrr��s

zSpooledTemporaryFile.truncatecCs|j}|�|�}|�|�|Sr )r�rXr�)r-�srp�rvrrrrX�s

zSpooledTemporaryFile.writecCs|j}|�|�}|�|�|Sr )r��
writelinesr�)r-�iterablerpr�rrrr��s

zSpooledTemporaryFile.writelines)rr�r�NNNNN)N)r;r<r=r�ryr�r�r�r�r0rVr>r�r�r�r�r�r�r�rBr�r�r�r�r�r�r�r�rXr�rrrrrnsR��







c@sNeZdZddd�Zedd��Zedd��Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)rNcCs0t|||�|_tj||j|jd�|�d�|_dS)NzImplicitly cleaning up {!r})�warn_message)rrB�_weakrefZfinalize�_cleanup�format�
_finalizer)r-r$r#r%rrrrys�zTemporaryDirectory.__init__cs ��fdd�}tj�|d�dS)Nc	s�t|dt�r�dd�}zV|�kr0|tj�|��||�zt�|�Wn"ttfk
rh��|�YnXWq�tk
r�Yq�Xnt|dt�r�n�dS)NrcSs6zt�|d�Wntk
r$YnXt�|d�dS)Nrrt)rZchflagsrH�chmod)rDrrr�
resetpermss
z?TemporaryDirectory._rmtree.<locals>.onerror.<locals>.resetperms)	�
issubclassrZrrDrKrUr��_rmtreer^)r�rD�exc_infor���clsrBrr�onerrorsz+TemporaryDirectory._rmtree.<locals>.onerror)r�)�_shutilZrmtree)r�rBr�rr�rr�szTemporaryDirectory._rmtreecCs|�|�t�|t�dSr )r��	_warnings�warn�ResourceWarning)r�rBr�rrrr�/s
zTemporaryDirectory._cleanupcCsd�|jj|j�S)Nz	<{} {!r}>)r��	__class__r;rBr/rrr�__repr__4szTemporaryDirectory.__repr__cCs|jSr )rBr/rrrr�7szTemporaryDirectory.__enter__cCs|��dSr )�cleanupr�rrrr�:szTemporaryDirectory.__exit__cCs|j��r|�|j�dSr )r�r�r�rBr/rrrr�=s
zTemporaryDirectory.cleanup)NNN)r;r<r=ry�classmethodr�r�r�r�r�r�rrrrr�s


)NNNF)NNN)r�r�NNNNNT)r�r�NNNNN)=�__all__�	functoolsr��warningsr��iorW�osrZshutilr��errnor_Zrandomrr,�sysrk�weakrefr��_thread�
allocate_lockZ_allocate_lock�O_RDWRr��O_EXCLrrr�rrTrrr!rfrrr'r(rLrdrerirqr	rr
rr
rrrrvr}rrB�platformrr�r�objectrrrrr�<module>s��





	-
'
( +?��'
��<__pycache__/__phello__.foo.cpython-38.pyc000064400000000201151153537570014252 0ustar00U

e5d@�@sdS)N�rrr�&/usr/lib64/python3.8/__phello__.foo.py�<module>�__pycache__/base64.cpython-38.opt-2.pyc000064400000026076151153537570013457 0ustar00U

e5d�O�@s�ddlZddlZddlZdddddddd	d
ddd
ddddddgZeefZdd�ZdBdd�ZdCdd�Z	dd�Z
dd�Ze�dd�Z
e�dd�Zdd�Zdd�ZdZdadad d�ZdDd!d	�Zd"d
�ZdEd#d�Zdadad$Zd%ZdFd&d'�Zddddd(�d)d�Zddd*d+�d,d�Zd-Zda da!da"dGd.d�Z#d/d
�Z$d0Z%e%d1d2Z&d3d�Z'd4d�Z(d5d6�Z)d7d�Z*d8d9�Z+d:d�Z,d;d<�Z-d=d>�Z.d?d@�Z/e0dAk�r�e.�dS)H�N�encode�decode�encodebytes�decodebytes�	b64encode�	b64decode�	b32encode�	b32decode�	b16encode�	b16decode�	b85encode�	b85decode�	a85encode�	a85decode�standard_b64encode�standard_b64decode�urlsafe_b64encode�urlsafe_b64decodecCs|t|t�r4z|�d�WStk
r2td��YnXt|t�rB|Szt|���WStk
rvtd|j	j
�d�YnXdS)N�asciiz4string argument should contain only ASCII charactersz>argument should be a bytes-like object or ASCII string, not %r)�
isinstance�strr�UnicodeEncodeError�
ValueError�bytes_types�
memoryview�tobytes�	TypeError�	__class__�__name__��s�r!�/usr/lib64/python3.8/base64.py�_bytes_from_decode_data"s

��r#cCs,tj|dd�}|dk	r(|�t�d|��S|S)NF)�newline�+/)�binascii�
b2a_base64�	translate�bytes�	maketrans)r �altchars�encodedr!r!r"r3sFcCsNt|�}|dk	r*t|�}|�t�|d��}|rDt�d|�sDt�d��t�|�S)Nr%s[A-Za-z0-9+/]*={0,2}zNon-base64 digit found)	r#r(r)r*�re�	fullmatchr&�Error�
a2b_base64)r r+Zvalidater!r!r"rAs
cCst|�S�N)rrr!r!r"rZscCst|�Sr1)rrr!r!r"rasr%s-_cCst|��t�Sr1)rr(�_urlsafe_encode_translationrr!r!r"roscCst|�}|�t�}t|�Sr1)r#r(�_urlsafe_decode_translationrrr!r!r"rxs
s ABCDEFGHIJKLMNOPQRSTUVWXYZ234567cs>tdkr,dd�tD���fdd��D�ad�t|t�sBt|���}t|�d}|rb|dd|}t�}tj	}t}t
dt|�d�D]V}||||d�d�}|||d?||d	?d
@||d?d
@||d
@7}q�|dkr�d
|dd�<nF|dk�rd|dd�<n.|dk�r d|dd�<n|dk�r6d|dd�<t|�S)NcSsg|]}t|f��qSr!�r)��.0�ir!r!r"�
<listcomp>�szb32encode.<locals>.<listcomp>csg|]}�D]}||�qqSr!r!�r6�a�b�Zb32tabr!r"r8�s��r�big��i��
�s======i�����s====����s===�����=���)�_b32tab2�_b32alphabetrrrr�len�	bytearray�int�
from_bytes�ranger))r �leftoverr,rPZb32tab2r7�cr!r<r"r�s<
��
�


c
	Csztdkrdd�tt�D�at|�}t|�dr8t�d��|dk	r^t|�}|�t�	dd|��}|rj|�
�}t|�}|�d�}|t|�}t�}t}t
dt|�d�D]h}|||d�}d}	z|D]}
|	d	>||
}	q�Wn tk
r�t�d
�d�YnX||	�d	d�7}q�|d�s |dk�r*t�d��|�rr|�rr|	d	|K}	|	�d	d�}d
d	|d}|d|�|dd�<t|�S)NcSsi|]\}}||�qSr!r!)r6�k�vr!r!r"�
<dictcomp>�szb32decode.<locals>.<dictcomp>�zIncorrect paddings01�OrIrr=zNon-base32 digit foundr?>rrCrFrH��+���)�_b32rev�	enumeraterLr#rMr&r/r(r)r*�upper�rstriprNrQ�KeyError�to_bytes)
r �casefoldZmap01�lZpadchars�decodedZb32revr7Zquanta�accrSZlastrRr!r!r"r	�s@


cCst�|���Sr1)r&Zhexlifyr^rr!r!r"r
�scCs4t|�}|r|��}t�d|�r*t�d��t�|�S)Ns	[^0-9A-F]zNon-base16 digit found)r#r^r-�searchr&r/Z	unhexlify)r rbr!r!r"r�s

s<~s~>c	s�t|t�st|���}t|�d}|r4|d|}t�dt|�d��|�}����fdd�|D�}|r�|s�|ddkr��dd	|d<|dd|�|d<d
�|�S)NrHr>z!%dIcsPg|]H}�r|sdn6�r$|dkr$dn&�|d�|dd�|d�qS)�zi    �yi�^	�Ui9r!)r6Zword��chars�chars2�foldnuls�
foldspacesr!r"r8!s�
�
�z_85encode.<locals>.<listcomp>rJrgrr=�)	rrrrrM�struct�StructZunpack�join)	r;rkrl�padrmrn�paddingZwords�chunksr!rjr"�	_85encodes
�rv)rn�wrapcolrs�adobecs�tdkr*dd�tdd�D�add�tD�at|tt|d|��|rHt���r�t|rVdnd�����fd	d�td
t����D�}|r�t|d�d�kr�|�d�d
�|��|r��t	7��S)NcSsg|]}t|f��qSr!r4r5r!r!r"r8Dsza85encode.<locals>.<listcomp>�!�vcSsg|]}tD]}||�qqSr!)�	_a85charsr9r!r!r"r8EsTrDrCcsg|]}�||���qSr!r!r5��resultrwr!r"r8Ms�rrJro�
)
�
_a85chars2rQr{rv�	_A85START�maxrM�appendrr�_A85END)r;rnrwrsrxrur!r|r"r/s$�

s 	

)rnrx�ignorecharsc	Cs�t|�}|rH|�t�s$td�t���|�t�r<|dd�}n|dd�}t�d�j	}g}|j
}g}|j
}|j}	|dD]�}
d|
kr�dkr�nnl||
�t|�dkr�d	}|D]}
d
||
d}q�z|||��Wn tj
k
r�td�d�YnX|	�qv|
dk�r |�rtd
��|d�qv|�rH|
dk�rH|�r>td��|d�qv|
|k�rVqvqvtd|
��qvd�|�}dt|�}
|
�r�|d|
�}|S)Nz1Ascii85 encoded byte sequences must end with {!r}rD����!Isuuuury�ur=rrizAscii85 overflow�zzz inside Ascii85 5-tuples�yzy inside Ascii85 5-tuples    zNon-Ascii85 digit found: %crorH)r#�endswithr�r�format�
startswithr�rprq�packr��clearrM�errorrr)r;rnrxr��packIrdZdecoded_appendZcurrZcurr_appendZ
curr_clear�xrer}rtr!r!r"rXsZ
��





sU0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~cCs2tdkr$dd�tD�add�tD�at|tt|�S)NcSsg|]}t|f��qSr!r4r5r!r!r"r8�szb85encode.<locals>.<listcomp>cSsg|]}tD]}||�qqSr!)�	_b85charsr9r!r!r"r8�s)�
_b85chars2�_b85alphabetr�rv)r;rsr!r!r"r�s	c
	CsJtdkr,dgdatt�D]\}}|t|<qt|�}t|�d}|d|}g}t�d�j}tdt|�d�D]�}|||d�}d}z|D]}|dt|}q�WnFt	k
r�t|�D]&\}}t|dkr�t
d||�d�q��YnXz|�||��Wqntjk
�r$t
d|�d�YqnXqnd	�
|�}	|�rF|	d|�}	|	S)
N�r=�~r�rriz#bad base85 character at position %dz+base85 overflow in hunk starting at byte %dro)�_b85decr]r�r#rMrprqr�rQrrr�r�rr)
r;r7rSrt�outr��chunkre�jr}r!r!r"r
�sH

����

�LrHrFcCsX|�t�}|sqTt|�tkr>|�tt|��}|s4q>||7}qt�|�}|�|�qdSr1)�read�
MAXBINSIZErMr&r'�write)�input�outputr �ns�liner!r!r"r�s


cCs(|��}|sq$t�|�}|�|�qdSr1)�readliner&r0r�)r�r�r�r r!r!r"r�s

c
Cs�zt|�}Wn8tk
rD}zd|jj}t|�|�W5d}~XYnX|jdkrjd|j|jjf}t|��|jdkr�d|j|jjf}t|��dS)Nz"expected bytes-like object, not %s)rSr;�Bz-expected single byte elements, not %r from %srCz(expected 1-D data, not %d-D data from %s)rrrrr��ndim)r �m�err�msgr!r!r"�_input_type_check�s
�
�r�cCsLt|�g}tdt|�t�D]$}|||t�}|�t�|��qd�|�S)Nrro)r�rQrMr�r�r&r'rr)r �piecesr7r�r!r!r"rscCsddl}|�dtd�t|�S)NrzAencodestring() is a deprecated alias since 3.1, use encodebytes()rD)�warnings�warn�DeprecationWarningr�r r�r!r!r"�encodestrings�r�cCst|�t�|�Sr1)r�r&r0rr!r!r"rscCsddl}|�dtd�t|�S)NrzHdecodestring() is a deprecated alias since Python 3.1, use decodebytes()rD)r�r�r�rr�r!r!r"�decodestring$s�r�c	
Csddl}ddl}z|�|jdd�d�\}}WnP|jk
r~}z0|j|_t|�td|jd�|�d�W5d}~XYnXt}|D]@\}}|dkr�t}|dkr�t	}|dkr�t	}|d	kr�t
�dSq�|�r|dd
k�rt|dd��}|||jj�W5QRXn||j
j|jj�dS)NrrCZdeutz�usage: %s [-d|-e|-u|-t] [file|-]
        -d, -u: decode
        -e: encode (default)
        -t: encode and decode string 'Aladdin:open sesame'rDz-ez-dz-uz-t�-�rb)�sys�getopt�argvr��stderr�stdout�print�exitrr�test�open�buffer�stdin)	r�r�Zopts�argsr��func�or:�fr!r!r"�main.s2�r�cCs<d}tt|��t|�}tt|��t|�}tt|��dS)NsAladdin:open sesame)r��reprrr)Zs0�s1�s2r!r!r"r�Hsr��__main__)N)NF)FN)F)FFF)F)1r-rpr&�__all__r)rNrr#rrrrr*r2r3rrrLrKr\rr	r
rr{rr�r�rvrrr�r�r�r�rr
ZMAXLINESIZEr�rrr�rr�rr�r�r�rr!r!r!r"�<module>	s��

	&
C

)H
-	
	


__pycache__/base64.cpython-38.opt-1.pyc000064400000041016151153537570013445 0ustar00U

e5d�O�@s�dZddlZddlZddlZddddddd	d
ddd
dddddddgZeefZdd�ZdCdd�Z	dDdd�Z
dd�Zdd�Ze�
dd�Ze�
dd�Zdd�Zdd�Zd Zdadad!d	�ZdEd"d
�Zd#d�ZdFd$d�Zdadad%Zd&ZdGd'd(�Zddddd)�d*d�Zddd+d,�d-d�Zd.Z da!da"da#dHd/d
�Z$d0d�Z%d1Z&e&d2d3Z'd4d�Z(d5d�Z)d6d7�Z*d8d�Z+d9d:�Z,d;d�Z-d<d=�Z.d>d?�Z/d@dA�Z0e1dBk�r�e/�dS)IzDBase16, Base32, Base64 (RFC 3548), Base85 and Ascii85 data encodings�N�encode�decode�encodebytes�decodebytes�	b64encode�	b64decode�	b32encode�	b32decode�	b16encode�	b16decode�	b85encode�	b85decode�	a85encode�	a85decode�standard_b64encode�standard_b64decode�urlsafe_b64encode�urlsafe_b64decodecCs|t|t�r4z|�d�WStk
r2td��YnXt|t�rB|Szt|���WStk
rvtd|j	j
�d�YnXdS)N�asciiz4string argument should contain only ASCII charactersz>argument should be a bytes-like object or ASCII string, not %r)�
isinstance�strr�UnicodeEncodeError�
ValueError�bytes_types�
memoryview�tobytes�	TypeError�	__class__�__name__��s�r!�/usr/lib64/python3.8/base64.py�_bytes_from_decode_data"s

��r#cCs,tj|dd�}|dk	r(|�t�d|��S|S)a*Encode the bytes-like object s using Base64 and return a bytes object.

    Optional altchars should be a byte string of length 2 which specifies an
    alternative alphabet for the '+' and '/' characters.  This allows an
    application to e.g. generate url or filesystem safe Base64 strings.
    F)�newlineN�+/)�binascii�
b2a_base64�	translate�bytes�	maketrans)r �altchars�encodedr!r!r"r3sFcCsNt|�}|dk	r*t|�}|�t�|d��}|rDt�d|�sDt�d��t�|�S)anDecode the Base64 encoded bytes-like object or ASCII string s.

    Optional altchars must be a bytes-like object or ASCII string of length 2
    which specifies the alternative alphabet used instead of the '+' and '/'
    characters.

    The result is returned as a bytes object.  A binascii.Error is raised if
    s is incorrectly padded.

    If validate is False (the default), characters that are neither in the
    normal base-64 alphabet nor the alternative alphabet are discarded prior
    to the padding check.  If validate is True, these non-alphabet characters
    in the input result in a binascii.Error.
    Nr%s[A-Za-z0-9+/]*={0,2}zNon-base64 digit found)	r#r(r)r*�re�	fullmatchr&�Error�
a2b_base64)r r+Zvalidater!r!r"rAs
cCst|�S)zrEncode bytes-like object s using the standard Base64 alphabet.

    The result is returned as a bytes object.
    )rrr!r!r"rZscCst|�S)aQDecode bytes encoded with the standard Base64 alphabet.

    Argument s is a bytes-like object or ASCII string to decode.  The result
    is returned as a bytes object.  A binascii.Error is raised if the input
    is incorrectly padded.  Characters that are not in the standard alphabet
    are discarded prior to the padding check.
    )rrr!r!r"rasr%s-_cCst|��t�S)z�Encode bytes using the URL- and filesystem-safe Base64 alphabet.

    Argument s is a bytes-like object to encode.  The result is returned as a
    bytes object.  The alphabet uses '-' instead of '+' and '_' instead of
    '/'.
    )rr(�_urlsafe_encode_translationrr!r!r"roscCst|�}|�t�}t|�S)a�Decode bytes using the URL- and filesystem-safe Base64 alphabet.

    Argument s is a bytes-like object or ASCII string to decode.  The result
    is returned as a bytes object.  A binascii.Error is raised if the input
    is incorrectly padded.  Characters that are not in the URL-safe base-64
    alphabet, and are not a plus '+' or slash '/', are discarded prior to the
    padding check.

    The alphabet uses '-' instead of '+' and '_' instead of '/'.
    )r#r(�_urlsafe_decode_translationrrr!r!r"rxs
s ABCDEFGHIJKLMNOPQRSTUVWXYZ234567cs>tdkr,dd�tD���fdd��D�ad�t|t�sBt|���}t|�d}|rb|dd|}t�}tj	}t}t
dt|�d�D]V}||||d�d�}|||d	?||d
?d@||d?d@||d@7}q�|d
kr�d|dd�<nF|dk�rd|dd�<n.|dk�r d|dd�<n|dk�r6d|dd�<t|�S)zKEncode the bytes-like object s using Base32 and return a bytes object.
    NcSsg|]}t|f��qSr!�r)��.0�ir!r!r"�
<listcomp>�szb32encode.<locals>.<listcomp>csg|]}�D]}||�qqSr!r!�r5�a�b�Zb32tabr!r"r7�s��r�big��i��
�s======i�����s====����s===�����=���)�_b32tab2�_b32alphabetrrrr�len�	bytearray�int�
from_bytes�ranger))r �leftoverr,rOZb32tab2r6�cr!r;r"r�s<
��
�


c
	Csztdkrdd�tt�D�at|�}t|�dr8t�d��|dk	r^t|�}|�t�	dd|��}|rj|�
�}t|�}|�d�}|t|�}t�}t}t
d	t|�d�D]h}|||d�}d	}	z|D]}
|	d
>||
}	q�Wn tk
r�t�d�d�YnX||	�d
d�7}q�|d�s |d
k�r*t�d��|�rr|�rr|	d
|K}	|	�d
d�}dd
|d}|d|�|dd�<t|�S)aZDecode the Base32 encoded bytes-like object or ASCII string s.

    Optional casefold is a flag specifying whether a lowercase alphabet is
    acceptable as input.  For security purposes, the default is False.

    RFC 3548 allows for optional mapping of the digit 0 (zero) to the
    letter O (oh), and for optional mapping of the digit 1 (one) to
    either the letter I (eye) or letter L (el).  The optional argument
    map01 when not None, specifies which letter the digit 1 should be
    mapped to (when map01 is not None, the digit 0 is always mapped to
    the letter O).  For security purposes the default is None, so that
    0 and 1 are not allowed in the input.

    The result is returned as a bytes object.  A binascii.Error is raised if
    the input is incorrectly padded or if there are non-alphabet
    characters present in the input.
    NcSsi|]\}}||�qSr!r!)r5�k�vr!r!r"�
<dictcomp>�szb32decode.<locals>.<dictcomp>�zIncorrect paddings01�OrHrr<zNon-base32 digit foundr>>rrBrErG��+���)�_b32rev�	enumeraterKr#rLr&r/r(r)r*�upper�rstriprMrP�KeyError�to_bytes)
r �casefoldZmap01�lZpadchars�decodedZb32revr6Zquanta�accrRZlastrQr!r!r"r	�s@


cCst�|���S)zKEncode the bytes-like object s using Base16 and return a bytes object.
    )r&Zhexlifyr]rr!r!r"r
�scCs4t|�}|r|��}t�d|�r*t�d��t�|�S)a�Decode the Base16 encoded bytes-like object or ASCII string s.

    Optional casefold is a flag specifying whether a lowercase alphabet is
    acceptable as input.  For security purposes, the default is False.

    The result is returned as a bytes object.  A binascii.Error is raised if
    s is incorrectly padded or if there are non-alphabet characters present
    in the input.
    s	[^0-9A-F]zNon-base16 digit found)r#r]r-�searchr&r/Z	unhexlify)r rar!r!r"r�s

s<~s~>c	s�t|t�st|���}t|�d}|r4|d|}t�dt|�d��|�}����fdd�|D�}|r�|s�|ddkr��dd	|d<|dd|�|d<d
�|�S)NrGr=z!%dIcsPg|]H}�r|sdn6�r$|dkr$dn&�|d�|dd�|d�qS)�zi    �yi�^	�Ui9r!)r5Zword��chars�chars2�foldnuls�
foldspacesr!r"r7!s�
�
�z_85encode.<locals>.<listcomp>rIrfrr<�)	rrrrrL�struct�StructZunpack�join)	r:rjrk�padrlrm�paddingZwords�chunksr!rir"�	_85encodes
�ru)rm�wrapcolrr�adobecs�tdkr*dd�tdd�D�add�tD�at|tt|d|��|rHt���r�t|rVdnd	�����fd
d�tdt����D�}|r�t|d�d�kr�|�d
�d�|��|r��t	7��S)a�Encode bytes-like object b using Ascii85 and return a bytes object.

    foldspaces is an optional flag that uses the special short sequence 'y'
    instead of 4 consecutive spaces (ASCII 0x20) as supported by 'btoa'. This
    feature is not supported by the "standard" Adobe encoding.

    wrapcol controls whether the output should have newline (b'\n') characters
    added to it. If this is non-zero, each output line will be at most this
    many characters long.

    pad controls whether the input is padded to a multiple of 4 before
    encoding. Note that the btoa implementation always pads.

    adobe controls whether the encoded byte sequence is framed with <~ and ~>,
    which is used by the Adobe implementation.
    NcSsg|]}t|f��qSr!r3r4r!r!r"r7Dsza85encode.<locals>.<listcomp>�!�vcSsg|]}tD]}||�qqSr!)�	_a85charsr8r!r!r"r7EsTrCrBcsg|]}�||���qSr!r!r4��resultrvr!r"r7Ms�rrIrn�
)
�
_a85chars2rPrzru�	_A85START�maxrL�appendrq�_A85END)r:rmrvrrrwrtr!r{r"r/s$�

s 	

)rmrw�ignorecharsc	Cs�t|�}|rH|�t�s$td�t���|�t�r<|dd�}n|dd�}t�d�j	}g}|j
}g}|j
}|j}	|dD]�}
d|
kr�dkr�nnl||
�t|�d	kr�d
}|D]}
d||
d}q�z|||��Wn tj
k
r�td�d�YnX|	�qv|
d
k�r |�rtd��|d�qv|�rH|
dk�rH|�r>td��|d�qv|
|k�rVqvqvtd|
��qvd�|�}dt|�}
|
�r�|d|
�}|S)a�Decode the Ascii85 encoded bytes-like object or ASCII string b.

    foldspaces is a flag that specifies whether the 'y' short sequence should be
    accepted as shorthand for 4 consecutive spaces (ASCII 0x20). This feature is
    not supported by the "standard" Adobe encoding.

    adobe controls whether the input sequence is in Adobe Ascii85 format (i.e.
    is framed with <~ and ~>).

    ignorechars should be a byte string containing characters to ignore from the
    input. This should only contain whitespace characters, and by default
    contains all whitespace characters in ASCII.

    The result is returned as a bytes object.
    z1Ascii85 encoded byte sequences must end with {!r}rC���N�!Isuuuurx�ur<rrhzAscii85 overflow�zzz inside Ascii85 5-tuples�yzy inside Ascii85 5-tuples    zNon-Ascii85 digit found: %crnrG)r#�endswithr�r�format�
startswithrrorp�packr��clearrL�errorrq)r:rmrwr��packIrcZdecoded_appendZcurrZcurr_appendZ
curr_clear�xrdr|rsr!r!r"rXsZ
��





sU0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~cCs2tdkr$dd�tD�add�tD�at|tt|�S)z�Encode bytes-like object b in base85 format and return a bytes object.

    If pad is true, the input is padded with b'\0' so its length is a multiple of
    4 bytes before encoding.
    NcSsg|]}t|f��qSr!r3r4r!r!r"r7�szb85encode.<locals>.<listcomp>cSsg|]}tD]}||�qqSr!)�	_b85charsr8r!r!r"r7�s)�
_b85chars2�_b85alphabetr�ru)r:rrr!r!r"r�s	c
	CsJtdkr,dgdatt�D]\}}|t|<qt|�}t|�d}|d|}g}t�d�j}tdt|�d�D]�}|||d�}d}z|D]}|dt|}q�WnFt	k
r�t|�D]&\}}t|dkr�t
d||�d�q��YnXz|�||��Wqntjk
�r$t
d	|�d�YqnXqnd
�
|�}	|�rF|	d|�}	|	S)zqDecode the base85-encoded bytes-like object or ASCII string b

    The result is returned as a bytes object.
    N�r<�~r�rrhz#bad base85 character at position %dz+base85 overflow in hunk starting at byte %drn)�_b85decr\r�r#rLrorpr�rPrrr�r�rq)
r:r6rRrs�outr��chunkrd�jr|r!r!r"r
�sH

����

�LrGrEcCsX|�t�}|sqTt|�tkr>|�tt|��}|s4q>||7}qt�|�}|�|�qdS)z1Encode a file; input and output are binary files.N)�read�
MAXBINSIZErLr&r'�write)�input�outputr �ns�liner!r!r"r�s


cCs(|��}|sq$t�|�}|�|�qdS)z1Decode a file; input and output are binary files.N)�readliner&r0r�)r�r�r�r r!r!r"r�s

c
Cs�zt|�}Wn8tk
rD}zd|jj}t|�|�W5d}~XYnX|jdkrjd|j|jjf}t|��|jdkr�d|j|jjf}t|��dS)Nz"expected bytes-like object, not %s)rRr:�Bz-expected single byte elements, not %r from %srBz(expected 1-D data, not %d-D data from %s)rrrrr��ndim)r �m�err�msgr!r!r"�_input_type_check�s
�
�r�cCsLt|�g}tdt|�t�D]$}|||t�}|�t�|��qd�|�S)zVEncode a bytestring into a bytes object containing multiple lines
    of base-64 data.rrn)r�rPrLr�r�r&r'rq)r �piecesr6r�r!r!r"rscCsddl}|�dtd�t|�S)zLegacy alias of encodebytes().rNzAencodestring() is a deprecated alias since 3.1, use encodebytes()rC)�warnings�warn�DeprecationWarningr�r r�r!r!r"�encodestrings�r�cCst|�t�|�S)z8Decode a bytestring of base-64 data into a bytes object.)r�r&r0rr!r!r"rscCsddl}|�dtd�t|�S)zLegacy alias of decodebytes().rNzHdecodestring() is a deprecated alias since Python 3.1, use decodebytes()rC)r�r�r�rr�r!r!r"�decodestring$s�r�c	
Csddl}ddl}z|�|jdd�d�\}}WnP|jk
r~}z0|j|_t|�td|jd�|�d�W5d}~XYnXt}|D]@\}}|dkr�t}|dkr�t	}|d	kr�t	}|d
kr�t
�dSq�|�r|ddk�rt|dd��}|||jj�W5QRXn||j
j|jj�dS)
zSmall main programrNrBZdeutz�usage: %s [-d|-e|-u|-t] [file|-]
        -d, -u: decode
        -e: encode (default)
        -t: encode and decode string 'Aladdin:open sesame'rCz-ez-dz-uz-t�-�rb)�sys�getopt�argvr��stderr�stdout�print�exitrr�test�open�buffer�stdin)	r�r�Zopts�argsr��func�or9�fr!r!r"�main.s2�r�cCs<d}tt|��t|�}tt|��t|�}tt|��dS)NsAladdin:open sesame)r��reprrr)Zs0�s1�s2r!r!r"r�Hsr��__main__)N)NF)FN)F)FFF)F)2�__doc__r-ror&�__all__r)rMrr#rrrrr*r1r2rrrKrJr[rr	r
rrzr~rr�rurrr�r�r�r�rr
ZMAXLINESIZEr�rrr�rr�rr�r�r�rr!r!r!r"�<module>s��

	&
C

)H
-	
	


__pycache__/types.cpython-38.pyc000064400000021733151153537570012572 0ustar00U

e5d�%�@s�dZddlZdd�Zee�Zedd��Zeej�Zeej�Z	eej
�Zdd�Zee��Z
d	d
�Zee��Zdd�Ze�Zee�Ze��d
d�Ze�Zee�ZGdd�d�Zee�j�Zee�Zegj�Zeej�Zee�j�Z ee!j"�Z#ee$jd�Z%ee�Z&ze'�Wn:e'k
�rBe�(�dZ)ee)�Z*ee)j+�Z,dZ)[)YnXeej�Z-eej.�Z/[[[[[[d$dd�Z0dd�Z1d%dd�Z2dd�Z3Gdd�d�Z4Gdd�d�Z5d d!�Z6d"d#�e7�D�Z8dS)&zO
Define names for built-in types that aren't directly accessible as a builtin.
�NcCsdS�N�rrr�/usr/lib64/python3.8/types.py�_f�rcCsdSrrrrrr�<lambda>
rrcsd��fdd�}|jdS)N�csdSrrr��arr�fsz_cell_factory.<locals>.fr)�__closure__)rrr	r�
_cell_factorysr
ccs
dVdS)Nrrrrrr�_gsrc�sdSrrrrrr�_crrcCs
dVdSrrrrrr�_ag"src@seZdZdd�ZdS)�_CcCsdSrr��selfrrr�_m(rz_C._mN)�__name__�
__module__�__qualname__rrrrrr'sr�fromkeys�rcCsJt|�}t|||�\}}}|dk	r*||�||k	r:||d<||||f|�S)zBCreate a class object dynamically using the appropriate metaclass.N�__orig_bases__)�
resolve_bases�
prepare_class)�name�bases�kwds�	exec_body�resolved_bases�meta�nsrrr�	new_classEsr$cCs�t|�}d}d}t|�D]j\}}t|t�r,qt|d�s8q|�|�}d}t|t�sZtd��q||||||d�<|t|�d7}q|s�|St|�S)z8Resolve MRO entries dynamically as specified by PEP 560.Fr�__mro_entries__Tz#__mro_entries__ must return a tupler)	�list�	enumerate�
isinstance�type�hasattrr%�tuple�	TypeError�len)r�	new_bases�updated�shift�i�base�new_baserrrrOs"




rcCs~|dkri}nt|�}d|kr*|�d�}n|r<t|d�}nt}t|t�rTt||�}t|d�rp|j||f|�}ni}|||fS)azCall the __prepare__ method of the appropriate metaclass.

    Returns (metaclass, namespace, kwds) as a 3-tuple

    *metaclass* is the appropriate metaclass
    *namespace* is the prepared class namespace
    *kwds* is an updated copy of the passed in kwds argument with any
    'metaclass' entry removed. If no kwds argument is passed in, this will
    be an empty dict.
    N�	metaclassr�__prepare__)�dict�popr)r(�_calculate_metar*r5)rrrr"r#rrrrds


rcCs>|}|D]0}t|�}t||�r qt||�r0|}qtd��q|S)z%Calculate the most derived metaclass.zxmetaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases)r)�
issubclassr,)r"r�winnerr2�	base_metarrrr8�s


r8c@sLeZdZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�DynamicClassAttributeaRoute attribute access on a class to __getattr__.

    This is a descriptor, used to define attributes that act differently when
    accessed through an instance and through a class.  Instance access remains
    normal, but access to an attribute through a class will be routed to the
    class's __getattr__ method; this is done by raising AttributeError.

    This allows one to have properties active on an instance, and have virtual
    attributes on the class with the same name (see Enum for an example).

    NcCs>||_||_||_|p|j|_|dk|_tt|dd��|_dS)N�__isabstractmethod__F)�fget�fset�fdel�__doc__�
overwrite_doc�bool�getattrr=)rr>r?r@�docrrr�__init__�s
zDynamicClassAttribute.__init__cCs6|dkr|jr|St��n|jdkr,td��|�|�S)Nzunreadable attribute)r=�AttributeErrorr>)r�instance�
ownerclassrrr�__get__�s
zDynamicClassAttribute.__get__cCs"|jdkrtd��|�||�dS)Nzcan't set attribute)r?rG)rrH�valuerrr�__set__�s
zDynamicClassAttribute.__set__cCs |jdkrtd��|�|�dS)Nzcan't delete attribute)r@rG)rrHrrr�
__delete__�s
z DynamicClassAttribute.__delete__cCs8|jr|jnd}t|�||j|j|p(|j�}|j|_|Sr)rBrAr)r?r@)rr>�fdoc�resultrrr�getter�szDynamicClassAttribute.gettercCs$t|�|j||j|j�}|j|_|Sr)r)r>r@rArB)rr?rOrrr�setter�szDynamicClassAttribute.settercCs$t|�|j|j||j�}|j|_|Sr)r)r>r?rArB)rr@rOrrr�deleter�szDynamicClassAttribute.deleter)NNNN)N)rrrrArFrJrLrMrPrQrRrrrrr<�s


	r<c@s�eZdZdd�Zdd�Zdd�Zdd�Zed	d
��Zedd��Z	ed
d��Z
edd��ZeZe	Z
e
ZeZdd�Zdd�ZeZdS)�_GeneratorWrappercCs2||_|jtk|_t|dd�|_t|dd�|_dS)Nrr)�_GeneratorWrapper__wrapped�	__class__�
GeneratorType�_GeneratorWrapper__isgenrDrr)r�genrrrrF�sz_GeneratorWrapper.__init__cCs|j�|�Sr)rT�send)r�valrrrrY�sz_GeneratorWrapper.sendcGs|jj|f|��Sr)rT�throw)r�tp�restrrrr[�sz_GeneratorWrapper.throwcCs
|j��Sr)rT�closerrrrr^�sz_GeneratorWrapper.closecCs|jjSr)rT�gi_coderrrrr_�sz_GeneratorWrapper.gi_codecCs|jjSr)rT�gi_framerrrrr`�sz_GeneratorWrapper.gi_framecCs|jjSr)rT�
gi_runningrrrrra�sz_GeneratorWrapper.gi_runningcCs|jjSr)rT�gi_yieldfromrrrrrb�sz_GeneratorWrapper.gi_yieldfromcCs
t|j�Sr)�nextrTrrrr�__next__�sz_GeneratorWrapper.__next__cCs|jr|jS|Sr)rWrTrrrr�__iter__�sz_GeneratorWrapper.__iter__N)rrrrFrYr[r^�propertyr_r`rarb�cr_code�cr_frame�
cr_running�cr_awaitrdre�	__await__rrrrrS�s&



rScs�t��std���jtkrft�dd�jtkrf�jj}|d@r@�S|d@rf�j}|j|jdBd��_�Sddl	}ddl
�|�����fd	d
��}|S)z2Convert regular generator function to a coroutine.z$types.coroutine() expects a callable�__code__Ni�� �)�co_flagsrcsR�||�}|jtks*|jtkr.|jjd@r.|St|�j�rNt|�j�sNt|�S|S)Nrn)	rU�
CoroutineTyperVr_ror(�	Generator�	CoroutinerS)�args�kwargs�coro��_collections_abc�funcrr�wrappeds

�
�
�zcoroutine.<locals>.wrapped)�callabler,rU�FunctionTyperD�CodeTyperlro�replace�	functoolsrw�wraps)rxro�cor~ryrrvr�	coroutine�s"
�r�cCs g|]}|dd�dkr|�qS)Nr�_r)�.0�nrrr�
<listcomp>(sr�)rNN)rN)9rA�sysrr)r{�
LambdaTyperlr|�__dict__�MappingProxyType�implementation�SimpleNamespacer
�CellTyperrVrrpr^r�AsyncGeneratorTyperr�
MethodTyper-�BuiltinFunctionType�append�BuiltinMethodType�objectrF�WrapperDescriptorType�__str__�MethodWrapperType�str�join�MethodDescriptorTyper6�ClassMethodDescriptorType�
ModuleTyper,�exc_info�tb�
TracebackType�tb_frame�	FrameType�GetSetDescriptorType�__globals__�MemberDescriptorTyper$rrr8r<rSr��globals�__all__rrrr�<module>s\













 :%4__pycache__/nntplib.cpython-38.opt-1.pyc000064400000102270151153537570014027 0ustar00U

e5d���@s�dZddlZddlZddlZddlZddlZddlZzddlZWnek
rXdZ	YnXdZ	ddl
mZddlm
Z
ddd	d
ddd
dgZdZGdd�de�ZGdd	�d	e�ZGdd
�d
e�ZGdd�de�ZGdd�de�ZGdd
�d
e�ZdZdZddddddddd d!d"d#hZd$d%d&d'd(d)d*gZd)d*d+�Zd,Ze�d-d.d/d0d1g�Ze�d2d3d4d5g�Zd6d�Zd7d8�Z dmd9d:�Z!dnd;d<�Z"dod=d>�Z#e	�r�d?d@�Z$GdAdB�dB�Z%GdCd�de%�Z&e	�r�GdDdE�dEe%�Z'e�(dE�e)dFk�r�ddl*Z*e*j+dGdH�Z,e,j-dIdJdKdLdM�e,j-dNdOdPdQdM�e,j-dRdSdTe.dUeefdV�e,j-dWdXdYe.dZdV�e,j-d[d\d]dd^d_�e,�/�Z0e0j1Z1e0j�s�e1dTk�r|eZ1e&e0j2e1d`�Z3ne1dTk�r�eZ1e'e0j2e1d`�Z3e3�4�Z5dae5k�r�e3�6�e3�7e0j7�\Z8Z9Z:Z;Z<e=dbe<dce9dde:dee;�dfdg�Z>e?e.e;�e0j@dh�Z:e3�Ae:e;�\Z8ZBeBD]Z\ZCZDeeDd%��Edidh�dZFeeDd$�ZGe.eDd*�ZHe=dj�IeCe>eFdk�e>eGdl�eH���q e3�J�dS)pa�An NNTP client class based on:
- RFC 977: Network News Transfer Protocol
- RFC 2980: Common NNTP Extensions
- RFC 3977: Network News Transfer Protocol (version 2)

Example:

>>> from nntplib import NNTP
>>> s = NNTP('news')
>>> resp, count, first, last, name = s.group('comp.lang.python')
>>> print('Group', name, 'has', count, 'articles, range', first, 'to', last)
Group comp.lang.python has 51 articles, range 5770 to 5821
>>> resp, subs = s.xhdr('subject', '{0}-{1}'.format(first, last))
>>> resp = s.quit()
>>>

Here 'resp' is the server response line.
Error responses are turned into exceptions.

To post an article from a file:
>>> f = open(filename, 'rb') # file containing article, including header
>>> resp = s.post(f)
>>>

For descriptions of all methods, read the comments in the code below.
Note that all arguments and return values representing article numbers
are strings, not numbers, since they are rarely used for calculations.
�NFT)�
decode_header)�_GLOBAL_DEFAULT_TIMEOUT�NNTP�	NNTPError�NNTPReplyError�NNTPTemporaryError�NNTPPermanentError�NNTPProtocolError�
NNTPDataErrorric@seZdZdZdd�ZdS)rz%Base class for all nntplib exceptionscGs>tj|f|��z|d|_Wntk
r8d|_YnXdS)NrzNo response given)�	Exception�__init__�response�
IndexError)�self�args�r�/usr/lib64/python3.8/nntplib.pyrcs
zNNTPError.__init__N)�__name__�
__module__�__qualname__�__doc__rrrrrrasc@seZdZdZdS)rzUnexpected [123]xx replyN�rrrrrrrrrjsc@seZdZdZdS)rz
4xx errorsNrrrrrrnsc@seZdZdZdS)rz
5xx errorsNrrrrrrrsc@seZdZdZdS)r	z"Response does not begin with [1-5]Nrrrrrr	vsc@seZdZdZdS)r
zError in response dataNrrrrrr
zs�wi3Z100Z101�211�215Z220Z221Z222Z224Z225Z230Z231Z282�subject�from�datez
message-idZ
referencesz:bytesz:lines)�bytes�lines�
�	GroupInfo�group�last�first�flag�ArticleInfoZnumber�
message_idrcCsJg}t|�D]2\}}t|t�r4|�|�|p,d��q|�|�qd�|�S)zvTakes a unicode string representing a munged header value
    and decodes it as a (possibly non-ASCII) readable value.�ascii�)�_email_decode_header�
isinstancer�append�decode�join)Z
header_str�parts�v�encrrrr�s
cCs�g}|D]`}|ddkr:|dd��d�\}}}d|}n|�d�\}}}|��}t�||�}|�|�qt}t|�t|�kr�td��|dt|��|kr�td��|S)z�Parse a list of string representing the response to LIST OVERVIEW.FMT
    and return a list of header/metadata names.
    Raises NNTPDataError if the response is not compliant
    (cf. RFC 3977, section 8.4).r�:�Nz$LIST OVERVIEW.FMT response too shortz*LIST OVERVIEW.FMT redefines default fields)�	partition�lower�_OVERVIEW_FMT_ALTERNATIVES�getr,�_DEFAULT_OVERVIEW_FMT�lenr
)r�fmt�line�name�_�suffix�defaultsrrr�_parse_overview_fmt�s
r@cCs�tt�}g}|D]�}i}|�d�^}}t|�}t|�D]�\}	}
|	t|�krLq6||	}|�d�}|	|kr�|s�|d}
|
r�|
dt|
����|
kr�td��|
r�|
t|
�d�nd}
|
|||	<q6|�||f�q|S)zZParse the response to an OVER or XOVER command according to the
    overview format `fmt`.�	r2z: Nz?OVER/XOVER response doesn't include names of additional headers)	r9r8�split�int�	enumerate�
startswithr5r
r,)rr:Zdata_process_funcZ
n_defaultsZoverviewr;ZfieldsZarticle_number�tokens�i�tokenZ
field_nameZis_metadata�hrrr�_parse_overview�s&
rJcCs�|dkr |dd�}|dd�}t|dd��}t|dd��}t|dd��}t|dd��}t|dd��}t|dd��}|dkr�|d7}n|d	kr�|d
7}t�||||||�S)z�Parse a pair of (date, time) strings, and return a datetime object.
    If only the date is given, it is assumed to be date and time
    concatenated together (e.g. response to the DATE command).
    Ni�������������Fi��dil)rC�datetime)�date_str�time_strZhoursZminutesZseconds�yearZmonthZdayrrr�_parse_datetime�s
rUcCsPt|tj�sd}n
d�|�}|j}|r<|d}d�||�}nd�||�}||fS)aPFormat a date or datetime object as a pair of (date, time) strings
    in the format required by the NEWNEWS and NEWGROUPS commands.  If a
    date object is passed, the time is assumed to be midnight (00h00).

    The returned representation depends on the legacy flag:
    * if legacy is False (the default):
      date has the YYYYMMDD format and time the HHMMSS format
    * if legacy is True:
      date has the YYMMDD format and time the HHMMSS format.
    RFC 3977 compliant servers should understand both formats; therefore,
    legacy is only needed when talking to old servers.
    Z000000z({0.hour:02d}{0.minute:02d}{0.second:02d}rPz{0:02d}{1.month:02d}{1.day:02d}z{0:04d}{1.month:02d}{1.day:02d})r+rQ�formatrT)ZdtZlegacyrS�yrRrrr�_unparse_datetime�s

rXcCs|dkrt��}|j||d�S)z�Wrap a socket in SSL/TLS. Arguments:
        - sock: Socket to wrap
        - context: SSL context to use for the encrypted connection
        Returns:
        - sock: New, encrypted socket.
        N)Zserver_hostname)�sslZ_create_stdlib_contextZwrap_socket)�sock�contextZhostnamerrr�_encrypt_onsr\c@seZdZdZdZdefdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�ZeZdd�Z
dd�Zdhdd�Zdd�Zdidd�Zdd�Zdjdd�Zdkdd �Zd!d"�Zd#d$�Zd%d&�Zdd'�d(d)�Zdd'�d*d+�Zdldd'�d,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zdd'�d6d7�Zd8d9�Z d:d;�Z!dmd<d=�Z"d>d?�Z#d@dA�Z$dndBdC�Z%dodd'�dDdE�Z&dpdd'�dFdG�Z'dqdd'�dHdI�Z(dJdK�Z)dd'�dLdM�Z*dd'�dNdO�Z+dd'�dPdQ�Z,dd'�dRdS�Z-dTdU�Z.dVdW�Z/dXdY�Z0dZd[�Z1d\d]�Z2d^d_�Z3d`da�Z4drdbdc�Z5ddde�Z6e7�rdsdfdg�Z8dS)t�	_NNTPBasezutf-8�surrogateescapeNcCsj||_||_d|_|��|_d|_|��d|_|rZd|jkrZ|��|jsZd|_|��d|_	d|_
dS)aSInitialize an instance.  Arguments:
        - file: file-like object (open for read/write in binary mode)
        - host: hostname of the server
        - readermode: if true, send 'mode reader' command after
                      connecting.
        - timeout: timeout (in seconds) used for socket connections

        readermode is sometimes necessary if you are connecting to an
        NNTP server on the local machine and intend to call
        reader-specific commands, such as `group'.  If you get
        unexpected NNTPPermanentErrors, you might need to set
        readermode.
        rNF�READER)�host�file�	debugging�_getresp�welcome�_caps�getcapabilities�readermode_afterauth�_setreadermode�tls_on�
authenticated)rrar`�
readermode�timeoutrrrr9s
	z_NNTPBase.__init__cCs|S�Nr�rrrr�	__enter__hsz_NNTPBase.__enter__c	sR�fdd�}|�rNz*z���Wnttfk
r8YnXW5|�rL���XdS)Ncs
t�d�S)Nra)�hasattrrrnrr�<lambda>l�z$_NNTPBase.__exit__.<locals>.<lambda>)�_close�quit�OSError�EOFError)rrZis_connectedrrnr�__exit__ks
z_NNTPBase.__exit__cCs|jrtdt|j��|jS)z�Get the welcome message from the server
        (this is read and squirreled away by __init__()).
        If the response code is 200, posting is allowed;
        if it 201, posting is not allowed.z	*welcome*)rb�print�reprrdrnrrr�
getwelcomevsz_NNTPBase.getwelcomec	Cs�|jdkr�d|_d|_z|��\}}Wnttfk
rDi|_Yn<X||_d|krhttt|d��|_d|kr�d�	|d�|_|jS)z�Get the server capabilities, as read by __init__().
        If the CAPABILITIES command is not supported, an empty dict is
        returned.Nr3ZVERSIONZIMPLEMENTATION� )
re�nntp_versionZnntp_implementation�capabilitiesrr�max�maprCr.)r�resp�capsrrrrfs
z_NNTPBase.getcapabilitiescCs
||_dS)z�Set the debugging level.  Argument 'level' means:
        0: no debugging output (default)
        1: print commands and responses but not body text etc.
        2: also print raw lines read and sent before stripping CR/LFN)rb)r�levelrrr�set_debuglevel�sz_NNTPBase.set_debuglevelcCsHt�d||�|t}|jdkr.tdt|��|j�|�|j��dS)zfInternal: send one line to the server, appending CRLF.
        The `line` must be a bytes-like object.znntplib.putliner3z*put*N)	�sys�audit�_CRLFrbrxryra�write�flush�rr;rrr�_putline�s
z_NNTPBase._putlinecCs2|jrtdt|��|�|j|j�}|�|�dS)zkInternal: send one command to the server (through _putline()).
        The `line` must be a unicode string.z*cmd*N)rbrxry�encode�encoding�errorsr�r�rrr�_putcmd�sz_NNTPBase._putcmdTcCs�|j�td�}t|�tkr$td��|jdkr<tdt|��|sDt�|r�|dd�t	krf|dd�}n|dd�t	kr�|dd�}|S)z�Internal: return one line from the server, stripping _CRLF.
        Raise EOFError if the connection is closed.
        Returns a bytes object.r3z
line too longz*get*rNN���)
ra�readline�_MAXLINEr9r
rbrxryrvr�)rZ
strip_crlfr;rrr�_getline�s
z_NNTPBase._getlinecCsl|��}|jrtdt|��|�|j|j�}|dd�}|dkrHt|��|dkrXt|��|dkrht	|��|S)z�Internal: get a response from the server.
        Raise various errors if the response indicates an error.
        Returns a unicode string.z*resp*Nr3�4�5Z123)
r�rbrxryr-r�r�rrr	)rr��crrrrc�sz_NNTPBase._getrespcCs�d}z�t|ttf�r"t|d�}}|��}|dd�tkrBt|��g}|dk	r�dtdf}|�	d�}||krnq�|�
d�r�|dd�}|�|�qZn8d}|�	�}||kr�q�|�
d�r�|dd�}|�|�q�W5|r�|��X||fS)	aPInternal: get a response plus following text from the server.
        Raise various errors if the response indicates an error.

        Returns a (response, lines) tuple where `response` is a unicode
        string and `lines` is a list of bytes objects.
        If `file` is a file-like object, it must be open in binary mode.
        N�wb��.s.
Fs..r3)
�closer+�strr�openrc�	_LONGRESPrr�r�rEr�r,)rraZ
openedFiler�rZterminatorsr;�
terminatorrrr�_getlongresp�s4	



z_NNTPBase._getlongrespcCs|�|�|��S)zWInternal: send a command and get the response.
        Same return value as _getresp().)r�rcr�rrr�	_shortcmd�s
z_NNTPBase._shortcmdcCs|�|�|�|�S)zoInternal: send a command and get the response plus following text.
        Same return value as _getlongresp().�r�r�)rr;rarrr�_longcmds
z_NNTPBase._longcmdcs.��|���|�\}}|�fdd�|D�fS)z�Internal: send a command and get the response plus following text.
        Same as _longcmd() and _getlongresp(), except that the returned `lines`
        are unicode strings rather than bytes objects.
        csg|]}|��j�j��qSr)r-r�r���.0r;rnrr�
<listcomp>s�z,_NNTPBase._longcmdstring.<locals>.<listcomp>r�)rr;rar��listrrnr�_longcmdstring	s

�z_NNTPBase._longcmdstringcCsdz|jWStk
rYnXz|�d�\}}Wn tk
rPtdd�}Yn
Xt|�}||_|S)zqInternal: get the overview format. Queries the server if not
        already done, else returns the cached value.zLIST OVERVIEW.FMTN)Z_cachedoverviewfmt�AttributeErrorr�rr8r@)rr�rr:rrr�_getoverviewfmtsz_NNTPBase._getoverviewfmtcCsdd�|D�S)NcSsg|]}t|����qSr)r!rBr�rrrr�&sz(_NNTPBase._grouplist.<locals>.<listcomp>r)rrrrr�
_grouplist$sz_NNTPBase._grouplistcCs8i}|�d�\}}|D]}|��^}}|||<q||fS)a!Process a CAPABILITIES command.  Not supported by all servers.
        Return:
        - resp: server response if successful
        - caps: a dictionary mapping capability names to lists of tokens
        (for example {'VERSION': ['2'], 'OVER': [], LIST: ['ACTIVE', 'HEADERS'] })
        ZCAPABILITIES)r�rB)rr�r�rr;r<rFrrrr}(s
z_NNTPBase.capabilities)racCsbt|tjtjf�s$td�|jj���t||jdk�\}}d�||�}|�	||�\}}||�
|�fS)z�Process a NEWGROUPS command.  Arguments:
        - date: a date or datetime object
        Return:
        - resp: server response if successful
        - list: list of newsgroup names
        �Athe date parameter must be a date or datetime object, not '{:40}'rKzNEWGROUPS {0} {1})r+rQr�	TypeErrorrV�	__class__rrXr|r�r�)rrrarRrS�cmdr�rrrr�	newgroups6s��z_NNTPBase.newgroupscCsRt|tjtjf�s$td�|jj���t||jdk�\}}d�|||�}|�	||�S)z�Process a NEWNEWS command.  Arguments:
        - group: group name or '*'
        - date: a date or datetime object
        Return:
        - resp: server response if successful
        - list: list of message ids
        r�rKzNEWNEWS {0} {1} {2})
r+rQrr�rVr�rrXr|r�)rr"rrarRrSr�rrr�newnewsFs��z_NNTPBase.newnewscCs4|dk	rd|}nd}|�||�\}}||�|�fS)a@Process a LIST or LIST ACTIVE command. Arguments:
        - group_pattern: a pattern indicating which groups to query
        - file: Filename string or file object to store the result in
        Returns:
        - resp: server response if successful
        - list: list of (group, last, first, flag) (strings)
        NzLIST ACTIVE ZLIST)r�r�)r�
group_patternra�commandr�rrrrr�Vs

z_NNTPBase.listcCs�t�d�}|�d|�\}}|�d�s8|�d|�\}}i}|D]:}|�|���}|r@|�dd�\}	}
|sr|
S|
||	<q@|r�||fSdSdS)Nz^(?P<group>[^ 	]+)[ 	]+(.*)$zLIST NEWSGROUPS r�XGTITLE r3rKr))�re�compiler�rE�search�stripr")rr�Z
return_all�line_patr�r�groups�raw_line�matchr<Zdescrrr�_getdescriptionses


z_NNTPBase._getdescriptionscCs|�|d�S)a�Get a description for a single group.  If more than one
        group matches ('group' is a pattern), return the first.  If no
        group matches, return an empty string.

        This elides the response code from the server, since it can
        only be '215' or '285' (for xgtitle) anyway.  If the response
        code is needed, use the 'descriptions' method.

        NOTE: This neither checks for a wildcard in 'group' nor does
        it check whether the group actually exists.F�r�)rr"rrr�description|sz_NNTPBase.descriptioncCs|�|d�S)z'Get descriptions for a range of groups.Tr�)rr�rrr�descriptions�sz_NNTPBase.descriptionscCs�|�d|�}|�d�s t|��|��}d}}}t|�}|dkr�|d}|dkr�|d}|dkr�|d}|dkr�|d��}|t|�t|�t|�|fS)aProcess a GROUP command.  Argument:
        - group: the group name
        Returns:
        - resp: server response if successful
        - count: number of articles
        - first: first article number
        - last: last article number
        - name: the group name
        zGROUP rrr3rKr�rL)r�rErrBr9r5rC)rr<r��words�countr$r#�nrrrr"�s

z_NNTPBase.groupcCs|�d|�S)aProcess a HELP command. Argument:
        - file: Filename string or file object to store the result in
        Returns:
        - resp: server response if successful
        - list: list of strings returned by the server in response to the
                HELP command
        ZHELP)r�)rrarrr�help�sz_NNTPBase.helpcCs8|�d�st|��|��}t|d�}|d}|||fS)z_Internal: parse the response line of a STAT, NEXT, LAST,
        ARTICLE, HEAD or BODY command.Z22r3rK)rErrBrC)rr�r��art_numr'rrr�
_statparse�s
z_NNTPBase._statparsecCs|�|�}|�|�S)z/Internal: process a STAT, NEXT or LAST command.)r�r�)rr;r�rrr�_statcmd�s
z_NNTPBase._statcmdcCs"|r|�d�|��S|�d�SdS)a(Process a STAT command.  Argument:
        - message_spec: article number or message id (if not specified,
          the current article is selected)
        Returns:
        - resp: server response if successful
        - art_num: the article number
        - message_id: the message id
        zSTAT {0}ZSTATN)r�rV)r�message_specrrr�stat�s	z_NNTPBase.statcCs
|�d�S)z;Process a NEXT command.  No arguments.  Return as for STAT.ZNEXT�r�rnrrr�next�sz_NNTPBase.nextcCs
|�d�S)z;Process a LAST command.  No arguments.  Return as for STAT.ZLASTr�rnrrrr#�sz_NNTPBase.lastcCs0|�||�\}}|�|�\}}}|t|||�fS)z2Internal: process a HEAD, BODY or ARTICLE command.)r�r�r&)rr;rar�rr�r'rrr�_artcmd�sz_NNTPBase._artcmdcCs$|dk	rd�|�}nd}|�||�S)a0Process a HEAD command.  Argument:
        - message_spec: article number or message id
        - file: filename string or file object to store the headers in
        Returns:
        - resp: server response if successful
        - ArticleInfo: (article number, message id, list of header lines)
        NzHEAD {0}ZHEAD�rVr��rr�rar�rrr�head�sz_NNTPBase.headcCs$|dk	rd�|�}nd}|�||�S)a+Process a BODY command.  Argument:
        - message_spec: article number or message id
        - file: filename string or file object to store the body in
        Returns:
        - resp: server response if successful
        - ArticleInfo: (article number, message id, list of body lines)
        NzBODY {0}ZBODYr�r�rrr�body�sz_NNTPBase.bodycCs$|dk	rd�|�}nd}|�||�S)a5Process an ARTICLE command.  Argument:
        - message_spec: article number or message id
        - file: filename string or file object to store the article in
        Returns:
        - resp: server response if successful
        - ArticleInfo: (article number, message id, list of article lines)
        NzARTICLE {0}ZARTICLEr�r�rrr�article�sz_NNTPBase.articlecCs
|�d�S)zYProcess a SLAVE command.  Returns:
        - resp: server response if successful
        ZSLAVE)r�rnrrr�slavesz_NNTPBase.slavecsDt�d��|�d�||�|�\}}�fdd��|�fdd�|D�fS)aiProcess an XHDR command (optional server extension).  Arguments:
        - hdr: the header type (e.g. 'subject')
        - str: an article nr, a message id, or a range nr1-nr2
        - file: Filename string or file object to store the result in
        Returns:
        - resp: server response if successful
        - list: list of (nr, value) strings
        z^([0-9]+) ?(.*)
?zXHDR {0} {1}cs��|�}|r|�dd�S|S)Nr3rK)r�r")r;�m)�patrr�
remove_numbers
z%_NNTPBase.xhdr.<locals>.remove_numbercsg|]}�|��qSrrr�)r�rrr�sz"_NNTPBase.xhdr.<locals>.<listcomp>)r�r�r�rV)rZhdrr�rar�rr)r�r�r�xhdrs	
z_NNTPBase.xhdrcCs.|�d�||�|�\}}|��}|t||�fS)aFProcess an XOVER command (optional server extension) Arguments:
        - start: start of range
        - end: end of range
        - file: Filename string or file object to store the result in
        Returns:
        - resp: server response if successful
        - list: list of dicts containing the response fields
        z
XOVER {0}-{1})r�rVr�rJ)r�start�endrar�rr:rrr�xovers
	�z_NNTPBase.xoverc	Csxd|jkrdnd}t|ttf�r>|\}}|d�||p6d�7}n|dk	rR|d|}|�||�\}}|��}|t||�fS)a�Process an OVER command.  If the command isn't supported, fall
        back to XOVER. Arguments:
        - message_spec:
            - either a message id, indicating the article to fetch
              information about
            - or a (start, end) tuple, indicating a range of article numbers;
              if end is None, information up to the newest message will be
              retrieved
            - or None, indicating the current article number must be used
        - file: Filename string or file object to store the result in
        Returns:
        - resp: server response if successful
        - list: list of dicts containing the response fields

        NOTE: the "message id" form isn't supported by XOVER
        ZOVERZXOVERz {0}-{1}r)Nr{)rer+�tupler�rVr�r�rJ)	rr�rar�r�r�r�rr:rrr�over*sz_NNTPBase.overc	Csft�dtd�t�d�}|�d||�\}}g}|D](}|�|���}|r4|�|�	dd��q4||fS)z�Process an XGTITLE command (optional server extension) Arguments:
        - group: group name wildcard (i.e. news.*)
        Returns:
        - resp: server response if successful
        - list: list of (name,title) stringszFThe XGTITLE extension is not actively used, use descriptions() insteadrKz^([^ 	]+)[ 	]+(.*)$r�r3)
�warnings�warn�DeprecationWarningr�r�r�r�r�r,r")	rr"rar�r�Z	raw_linesrr�r�rrr�xgtitleEs�
z_NNTPBase.xgtitlecCslt�dtd�|�d�|��}|�d�s0t|��z|��\}}Wntk
r^t|�d�Yn
X||fSdS)z�Process an XPATH command (optional server extension) Arguments:
        - id: Message id of article
        Returns:
        resp: server response if successful
        path: directory path to article
        z(The XPATH extension is not actively usedrKz	XPATH {0}Z223N)	r�r�r�r�rVrErrB�
ValueError)r�idr�Zresp_num�pathrrr�xpathWs�
z_NNTPBase.xpathcCsb|�d�}|�d�st|��|��}t|�dkr8t|��|d}t|�dkrTt|��|t|d�fS)z�Process the DATE command.
        Returns:
        - resp: server response if successful
        - date: datetime object
        ZDATEZ111rKr3�N)r�rErrBr9r
rU)rr��elemrrrrrks

z_NNTPBase.datecCs�|�|�}|�d�st|��t|ttf�r2|��}|D]:}|�t�sR|�	d�t}|�d�rdd|}|j
�|�q6|j
�d�|j
��|�
�S)N�3r r�s.
)r�rErr+r�	bytearray�
splitlines�endswithr��rstriprar�r�rc)rr��fr�r;rrr�_post|s




z_NNTPBase._postcCs|�d|�S)z�Process a POST command.  Arguments:
        - data: bytes object, iterable or file containing the article
        Returns:
        - resp: server response if successfulZPOST)r�)r�datarrr�post�sz_NNTPBase.postcCs|�d�|�|�S)aProcess an IHAVE command.  Arguments:
        - message_id: message-id of the article
        - data: file containing the article
        Returns:
        - resp: server response if successful
        Note that if the server refuses the article an exception is raised.z	IHAVE {0})r�rV)rr'r�rrr�ihave�sz_NNTPBase.ihavecCs|j��|`dSrm)rar�rnrrrrs�s
z_NNTPBase._closecCsz|�d�}W5|��X|S)zdProcess a QUIT command and close the socket.  Returns:
        - resp: server response if successfulZQUIT)rsr�)rr�rrrrt�s
z_NNTPBase.quitcCs�|jrtd��|s|std��z<|rX|sXddl}|��}|�|j�}|rX|d}|d}Wntk
rnYnX|sxdS|�d|�}|�d�r�|s�t|��n |�d|�}|�d�s�t	|��d|_
|��|jr�d	|j
kr�|�
�d|_
|��dS)
NzAlready logged in.z7At least one of `user` and `usenetrc` must be specifiedrrKzauthinfo user Z381zauthinfo pass Z281r_)rjr��netrcZauthenticatorsr`rur�rErrrerfrgrh)r�user�password�usenetrcr�ZcredentialsZauthr�rrr�login�s>�


z_NNTPBase.loginc
Cs`z|�d�|_WnJtk
r$Yn8tk
rZ}z|j�d�rHd|_n�W5d}~XYnXdS)Nzmode readerZ480T)r�rdrrr
rErg)r�errrrh�sz_NNTPBase._setreadermodecCs||jrtd��|jrtd��|�d�}|�d�rp|j��t|j||j	�|_|j�
d�|_d|_d|_|��nt
d��dS)	zzProcess a STARTTLS command. Arguments:
            - context: SSL context to use for the encrypted connection
            zTLS is already enabled.z+TLS cannot be started after authentication.�STARTTLSZ382�rwbTNzTLS failed to start.)rir�rjr�rErar�r\rZr`�makefilererfr)rr[r�rrr�starttls�s



z_NNTPBase.starttls)T)N)N)N)N)N)N)N)N)N)NNT)N)9rrrr�r�rrrorwrzrfr��debugr�r�r�rcr�r�r�r�r�r�r}r�r�r�r�r�r�r"r�r�r�r�r�r#r�r�r�r�r�r�r�r�r�r�rr�r�r�rsrtr�rh�	_have_sslr�rrrrr])sn
�
/		

.







		
)
r]c@s*eZdZeddddefdd�Zdd�ZdS)rNFc	Cs�||_||_t�d|||�t�||f|�|_d}z8|j�d�}t�	|||||�|sZ|rh|�
|||�Wn$|r~|��|j���YnXdS)a,Initialize an instance.  Arguments:
        - host: hostname to connect to
        - port: port to connect to (default the standard NNTP port)
        - user: username to authenticate with
        - password: password to use with username
        - readermode: if true, send 'mode reader' command after
                      connecting.
        - usenetrc: allow loading username and password from ~/.netrc file
                    if not specified explicitly
        - timeout: timeout (in seconds) used for socket connections

        readermode is sometimes necessary if you are connecting to an
        NNTP server on the local machine and intend to call
        reader-specific commands, such as `group'.  If you get
        unexpected NNTPPermanentErrors, you might need to set
        readermode.
        �nntplib.connectNr�)r`�portr�r��socket�create_connectionrZr�r]rr�r�)	rr`r�r�r�rkr�rlrarrrr�s$
�
z
NNTP.__init__cCs zt�|�W5|j��XdSrm�rZr�r]rsrnrrrrs$szNNTP._close)rrr�	NNTP_PORTrrrsrrrrr�s�
%c@s,eZdZedddddefdd�Zdd�ZdS)�NNTP_SSLNFc	
Cs�t�d|||�t�||f|�|_d}	zJt|j||�|_|j�d�}	tj||	|||d�|s`|rn|�	|||�Wn$|	r�|	�
�|j�
��YnXdS)z�This works identically to NNTP.__init__, except for the change
            in default port and the `ssl_context` argument for SSL connections.
            r�Nr�)rkrl)r�r�r�r�rZr\r�r]rr�r�)
rr`r�r�r�Zssl_contextrkr�rlrarrrr.s"
�
zNNTP_SSL.__init__cCs zt�|�W5|j��XdSrmr�rnrrrrsEszNNTP_SSL._close)rrr�
NNTP_SSL_PORTrrrsrrrrr,s�
r�__main__zJ        nntplib built-in demo - display the latest articles in a newsgroup)r�z-gz--groupzgmane.comp.python.generalz3group to fetch messages from (default: %(default)s))�defaultr�z-sz--serverz
news.gmane.ioz+NNTP server hostname (default: %(default)s)z-pz--portr�z#NNTP port number (default: %s / %s))r�typer�z-nz
--nb-articles�
z2number of articles to fetch (default: %(default)s)z-Sz--ssl�
store_truezuse NNTP over SSL)�actionrr�)r`r�r�ZGroupZhaszarticles, range�tocCs$t|�|kr |d|d�d}|S)NrLz...)r9)�sZlimrrr�cutpsr
r3�<z{:7} {:20} {:42} ({})��*)N)N)F)Krr�r��collectionsrQr�r�rY�ImportErrorr�Zemail.headerrr*r�__all__r�rrrrrr	r
r�rr�r8r6r��
namedtupler!r&r@rJrUrXr\r]rrr,r�argparse�ArgumentParser�parser�add_argumentrC�
parse_argsrr�Zserverr	rfr�r�r"r�r�r$r#r<rxr
r�Znb_articlesr�Z	overviewsZartnumr�rBZauthorrrrVrtrrrr�<module>s�A
�
	���
��


Y.


�
�
���


�
__pycache__/_bootlocale.cpython-38.opt-1.pyc000064400000002303151153537570014637 0ustar00U

e5d	�@szdZddlZddlZej�d�r,ddd�ZnJz
ejWn4ek
rjeed�r\ddd�Zn
d
d	d�ZYnXdd
d�ZdS)z�A minimal subset of the locale module used at interpreter startup
(imported by the _io module), in order to reduce startup time.

Don't import directly from third-party code; use the `locale` module instead!
�N�winTcCstjjrdSt��dS)N�UTF-8�)�sys�flags�	utf8_mode�_localeZ_getdefaultlocale��do_setlocale�r�#/usr/lib64/python3.8/_bootlocale.py�getpreferredencodingsr
ZgetandroidapilevelcCsdS)Nrrr	rrrr
scCstjjrdSddl}|�|�S)Nrr)rrr�localer
)r
rrrrr
scCs.tjjrdSt�tj�}|s*tjdkr*d}|S)Nr�darwin)rrrr�nl_langinfo�CODESET�platform)r
�resultrrrr
!s)T)T)T)T)	�__doc__rrr�
startswithr
r�AttributeError�hasattrrrrr�<module>s

__pycache__/_threading_local.cpython-38.opt-2.pyc000064400000006070151153537570015641 0ustar00U

e5d4�@sZddlmZddlmZdgZGdd�d�Zedd��ZGdd�d�Zdd	lm	Z	m
Z
d
S)�)�ref)�contextmanager�localc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�
_localimpl)�key�dicts�	localargs�	locallock�__weakref__cCsdtt|��|_i|_dS)Nz_threading_local._localimpl.)�str�idrr)�self�r�(/usr/lib64/python3.8/_threading_local.py�__init__�sz_localimpl.__init__cCst�}|jt|�dS)N�)�current_threadrr)r
�threadrrr�get_dict�sz_localimpl.get_dictcshi}|j}t�}t|�}|f�fdd�	}|f�fdd�	}t||��t||���|j|<�|f|j|<|S)Ncs��}|dk	r|j|=dS�N)�__dict__)�_rr)�wrthreadrr�
local_deleted�sz-_localimpl.create_dict.<locals>.local_deletedcs��}|dk	r|j�|�}dSr)r�pop)r�idtr�dct)�wrlocalrr�thread_deleted�sz._localimpl.create_dict.<locals>.thread_deleted)rrrrrr)r
Z	localdictrrrrrr)rrr�create_dict�s


z_localimpl.create_dictN)�__name__�
__module__�__qualname__�	__slots__rrrrrrrr�src	csvt�|d�}z|��}Wn2tk
rJ|��}|j\}}|j||�YnX|j�t�|d|�dVW5QRXdS)N�_local__implr)	�object�__getattribute__r�KeyErrorrrrr	�__setattr__)r
�implr�args�kwrrr�_patch�s
r,c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r)r$rcOsX|s|r|jtjkrtd��t�|�}t�}||f|_t�|_t�|d|�|�	�|S)Nz*Initialization arguments are not supportedr$)
rr%�	TypeError�__new__rr�RLockr	r(r)�clsr*r+r
r)rrrr.�s

z
local.__new__c
Cs,t|��t�||�W5QR�SQRXdSr)r,r%r&�r
�namerrrr&�s
zlocal.__getattribute__c
CsF|dkrtd|jj��t|��t�|||�W5QR�SQRXdS�Nrz+%r object attribute '__dict__' is read-only)�AttributeError�	__class__r r,r%r()r
r2�valuerrrr(�s��
zlocal.__setattr__c
CsD|dkrtd|jj��t|��t�||�W5QR�SQRXdSr3)r4r5r r,r%�__delattr__r1rrrr7�s��
zlocal.__delattr__N)r r!r"r#r.r&r(r7rrrrr�s
)rr/N)�weakrefr�
contextlibr�__all__rr,rZ	threadingrr/rrrr�<module>�s,

&__pycache__/_bootlocale.cpython-38.opt-2.pyc000064400000001742151153537570014646 0ustar00U

e5d	�@svddlZddlZej�d�r(d
dd�ZnJz
ejWn4ek
rfeed�rXddd�Zn
ddd�ZYnXd
d	d�ZdS)�N�winTcCstjjrdSt��dS)N�UTF-8�)�sys�flags�	utf8_mode�_localeZ_getdefaultlocale��do_setlocale�r�#/usr/lib64/python3.8/_bootlocale.py�getpreferredencodingsr
ZgetandroidapilevelcCsdS)Nrrr	rrrr
scCstjjrdSddl}|�|�S)Nrr)rrr�localer
)r
rrrrr
scCs.tjjrdSt�tj�}|s*tjdkr*d}|S)Nr�darwin)rrrr�nl_langinfo�CODESET�platform)r
�resultrrrr
!s)T)T)T)T)rrr�
startswithr
r�AttributeError�hasattrrrrr�<module>s

__pycache__/functools.cpython-38.opt-1.pyc000064400000066377151153537570014416 0ustar00U

e5d��
@s�dZddddddddd	d
ddd
g
ZddlmZddlmZddlmZddlm	Z	dZ
dZe
efdd�Ze
efdd�Z
efdd�Zefdd�Zefdd�Zefdd�Zefdd �Zefd!d"�Zefd#d$�Zefd%d&�Zefd'd(�Zefd)d*�Zefd+d,�Zefd-d.�Zd/efd0efd1efgd1efd2efd/efgd2efd1efd0efgd0efd/efd2efgd3�Zd4d�Zd5d�Zzdd6lmZWnek
�r�YnXe �Z!e!fd7d�Z"zdd8lm"Z"Wnek
�r�YnXGd9d	�d	�Z#zdd:lm#Z#Wnek
�rYnXGd;d
�d
e �Z$d<d=�Z%ed>d?d@dAdBg�Z&GdCdD�dDe'�Z(e �fe)e*he+e,e-fdEdF�Z.dYdId�Z/dJdK�Z0zddLlm0Z0Wnek
�r�YnXdMdN�Z1dZdPdQ�Z2dRdS�Z3dTdU�Z4dVd�Z5GdWd�d�Z6e �Z7GdXd
�d
�Z8dOS)[zEfunctools.py - Tools for working with functions and callable objects
�update_wrapper�wraps�WRAPPER_ASSIGNMENTS�WRAPPER_UPDATES�total_ordering�
cmp_to_key�	lru_cache�reduce�partial�
partialmethod�singledispatch�singledispatchmethod�cached_property�)�get_cache_token)�
namedtuple)�recursive_repr)�RLock)�
__module__�__name__�__qualname__�__doc__�__annotations__)�__dict__c	Csf|D]4}zt||�}Wntk
r*YqXt|||�q|D]}t||��t||i��q>||_|S)aUpdate a wrapper function to look like the wrapped function

       wrapper is the function to be updated
       wrapped is the original function
       assigned is a tuple naming the attributes assigned directly
       from the wrapped function to the wrapper function (defaults to
       functools.WRAPPER_ASSIGNMENTS)
       updated is a tuple naming the attributes of the wrapper that
       are updated with the corresponding attribute from the wrapped
       function (defaults to functools.WRAPPER_UPDATES)
    )�getattr�AttributeError�setattr�update�__wrapped__)�wrapper�wrapped�assigned�updated�attr�value�r$�!/usr/lib64/python3.8/functools.pyr"scCstt|||d�S)a�Decorator factory to apply update_wrapper() to a wrapper function

       Returns a decorator that invokes update_wrapper() with the decorated
       function as the wrapper argument and the arguments to wraps() as the
       remaining arguments. Default arguments are as for update_wrapper().
       This is a convenience function to simplify applying partial() to
       update_wrapper().
    �rr r!)r	rr&r$r$r%r@s�cCs$|�|�}||kr|S|o"||kS)zIReturn a > b.  Computed by @total_ordering from (not a < b) and (a != b).��__lt__��self�other�NotImplemented�	op_resultr$r$r%�_gt_from_ltXs
r.cCs|�|�}|p||kS)zEReturn a <= b.  Computed by @total_ordering from (a < b) or (a == b).r'r)r$r$r%�_le_from_lt_s
r/cCs|�|�}||kr|S|S)z=Return a >= b.  Computed by @total_ordering from (not a < b).r'r)r$r$r%�_ge_from_ltds
r0cCs$|�|�}||kr|S|p"||kS)zJReturn a >= b.  Computed by @total_ordering from (not a <= b) or (a == b).��__le__r)r$r$r%�_ge_from_leks
r3cCs"|�|�}||kr|S|o ||kS)zFReturn a < b.  Computed by @total_ordering from (a <= b) and (a != b).r1r)r$r$r%�_lt_from_lers
r4cCs|�|�}||kr|S|S)z=Return a > b.  Computed by @total_ordering from (not a <= b).r1r)r$r$r%�_gt_from_leys
r5cCs$|�|�}||kr|S|o"||kS)zIReturn a < b.  Computed by @total_ordering from (not a > b) and (a != b).��__gt__r)r$r$r%�_lt_from_gt�s
r8cCs|�|�}|p||kS)zEReturn a >= b.  Computed by @total_ordering from (a > b) or (a == b).r6r)r$r$r%�_ge_from_gt�s
r9cCs|�|�}||kr|S|S)z=Return a <= b.  Computed by @total_ordering from (not a > b).r6r)r$r$r%�_le_from_gt�s
r:cCs$|�|�}||kr|S|p"||kS)zJReturn a <= b.  Computed by @total_ordering from (not a >= b) or (a == b).��__ge__r)r$r$r%�_le_from_ge�s
r=cCs"|�|�}||kr|S|o ||kS)zFReturn a > b.  Computed by @total_ordering from (a >= b) and (a != b).r;r)r$r$r%�_gt_from_ge�s
r>cCs|�|�}||kr|S|S)z=Return a < b.  Computed by @total_ordering from (not a >= b).r;r)r$r$r%�_lt_from_ge�s
r?r7r2r<r()r(r2r7r<csV�fdd�tD�}|std��t|�}t|D]"\}}||kr.||_t�||�q.�S)z6Class decorator that fills in missing ordering methodscs(h|] }t�|d�tt|d�k	r|�qS�N)r�object)�.0�op��clsr$r%�	<setcomp>�sz!total_ordering.<locals>.<setcomp>z6must define at least one ordering operation: < > <= >=)�_convert�
ValueError�maxrr)rE�roots�root�opname�opfuncr$rDr%r�scsG�fdd�dt�}|S)z,Convert a cmp= function into a key= functioncsZeZdZdgZdd�Z�fdd�Z�fdd�Z�fdd	�Z�fd
d�Z�fdd
�Z	dZ
dS)zcmp_to_key.<locals>.K�objcSs
||_dSr@�rN)r*rNr$r$r%�__init__�szcmp_to_key.<locals>.K.__init__cs�|j|j�dkS�NrrO�r*r+��mycmpr$r%r(�szcmp_to_key.<locals>.K.__lt__cs�|j|j�dkSrQrOrRrSr$r%r7�szcmp_to_key.<locals>.K.__gt__cs�|j|j�dkSrQrOrRrSr$r%�__eq__�szcmp_to_key.<locals>.K.__eq__cs�|j|j�dkSrQrOrRrSr$r%r2�szcmp_to_key.<locals>.K.__le__cs�|j|j�dkSrQrOrRrSr$r%r<�szcmp_to_key.<locals>.K.__ge__N)rrr�	__slots__rPr(r7rUr2r<�__hash__r$rSr$r%�K�srX)rA)rTrXr$rSr%r�s)rcCsZt|�}|tkr>zt|�}WqBtk
r:td�d�YqBXn|}|D]}|||�}qF|S)a�
    reduce(function, sequence[, initial]) -> value

    Apply a function of two arguments cumulatively to the items of a sequence,
    from left to right, so as to reduce the sequence to a single value.
    For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates
    ((((1+2)+3)+4)+5).  If initial is present, it is placed before the items
    of the sequence in the calculation, and serves as a default when the
    sequence is empty.
    z0reduce() of empty sequence with no initial valueN)�iter�_initial_missing�next�
StopIteration�	TypeError)ZfunctionZsequence�initial�itr#Zelementr$r$r%r�s)rcsJeZdZdZdZ�fdd�Zdd�Ze�dd��Zd	d
�Z	dd�Z
�ZS)
r	zSNew function with partial application of the given arguments
    and keywords.
    )�func�args�keywordsr�__weakref__csZt|�std��t|d�r4|j|}|j|�}|j}tt|��|�}||_||_||_|S)Nz#the first argument must be callabler`)	�callabler]�hasattrrarbr`�superr	�__new__)rEr`rarbr*��	__class__r$r%rgs


zpartial.__new__cOs|j|�}|j|j|�|�Sr@�rbr`ra)r*rarbr$r$r%�__call__%s
zpartial.__call__cCs�t|�j}t|j�g}|�dd�|jD��|�dd�|j��D��t|�jdkrld|�dd�	|��d�S|�dd�	|��d�S)	Ncss|]}t|�VqdSr@)�repr)rB�xr$r$r%�	<genexpr>-sz#partial.__repr__.<locals>.<genexpr>css |]\}}|�d|��VqdS)�=Nr$�rB�k�vr$r$r%rn.s�	functoolsz
functools.�(�, �))
�typerrlr`�extendrarb�itemsr�join)r*�qualnamerar$r$r%�__repr__)s
zpartial.__repr__cCs*t|�|jf|j|j|jpd|jp$dffSr@)rwr`rarbr�r*r$r$r%�
__reduce__3s�zpartial.__reduce__cCs�t|t�std��t|�dkr0tdt|�����|\}}}}t|�rrt|t�rr|dk	r`t|t�rr|dk	rzt|t�sztd��t|�}|dkr�i}nt|�tk	r�t|�}|dkr�i}||_||_||_	||_
dS)Nz(argument to __setstate__ must be a tuple�zexpected 4 items in state, got zinvalid partial state)�
isinstance�tupler]�lenrd�dictrwrr`rarb)r*�stater`ra�kwds�	namespacer$r$r%�__setstate__7s4
����zpartial.__setstate__)rrrrrVrgrkrr|r~r��
__classcell__r$r$rhr%r	s
	)r	c@sDeZdZdZdd�Zde_dd�Zdd�Zdd
d�Ze	dd
��Z
d	S)r
z�Method descriptor with partial application of the given arguments
    and keywords.

    Supports wrapping existing descriptors and handles non-descriptor
    callables as instance methods.
    cOs�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��t|�}t|�s�t|d	�s�td
�	|���t
|t�r�|j|_|j
||_
|j|�|_n||_||_
||_dS)N�z8descriptor '__init__' of partialmethod needs an argumentr`rz0Passing 'func' as keyword argument is deprecated)�
stacklevelz8type 'partialmethod' takes at least one argument, got %d��__get__z${!r} is not callable or a descriptor)r�r]�pop�warnings�warn�DeprecationWarningr�rdre�formatr�r
r`rarb)rarbr*r`r�r$r$r%rP]s6

�
��
zpartialmethod.__init__z#($self, func, /, *args, **keywords)cCsNd�tt|j��}d�dd�|j��D��}d}|j|jj|jj	|j
||d�S)Nrucss|]\}}d�||�VqdS)z{}={!r}N)r�rpr$r$r%rn�s�z)partialmethod.__repr__.<locals>.<genexpr>z*{module}.{cls}({func}, {args}, {keywords}))�modulerEr`rarb)rz�maprlrarbryr�rirrr`)r*rarb�
format_stringr$r$r%r|�s
�
�zpartialmethod.__repr__cs�fdd�}�j|_�|_|S)Ncs �j|�}�j|f�j|�|�Sr@rj)�cls_or_selfrarbr}r$r%�_method�s
z3partialmethod._make_unbound_method.<locals>._method)�__isabstractmethod__�_partialmethod)r*r�r$r}r%�_make_unbound_method�sz"partialmethod._make_unbound_methodNcCs�t|jdd�}d}|dk	rd|||�}||jk	rdt|f|j�|j�}z|j|_Wntk
rbYnX|dkr||���||�}|S)Nr�)	rr`r	rarb�__self__rr�r�)r*rNrE�get�result�new_funcr$r$r%r��s

zpartialmethod.__get__cCst|jdd�S�Nr�F�rr`r}r$r$r%r��sz"partialmethod.__isabstractmethod__)N)rrrrrP�__text_signature__r|r�r��propertyr�r$r$r$r%r
Us"
cCst|t�r|j}q|Sr@)r�r	r`�r`r$r$r%�_unwrap_partial�s
r��	CacheInfo�hits�misses�maxsize�currsizec@s(eZdZdZdZefdd�Zdd�ZdS)�
_HashedSeqz� This class guarantees that hash() will be called no more than once
        per element.  This is important because the lru_cache() will hash
        the key multiple times on a cache miss.

    �	hashvaluecCs||dd�<||�|_dSr@�r�)r*�tup�hashr$r$r%rP�sz_HashedSeq.__init__cCs|jSr@r�r}r$r$r%rW�sz_HashedSeq.__hash__N)rrrrrVr�rPrWr$r$r$r%r��sr�c
s�|}|r&||7}|��D]}	||	7}q|rh||�fdd�|D��7}|r�||�fdd�|��D��7}n$||�dkr��|d�|kr�|dSt|�S)a�Make a cache key from optionally typed positional and keyword arguments

    The key is constructed in a way that is flat as possible rather than
    as a nested structure that would take more memory.

    If there is only a single argument and its data type is known to cache
    its hash value, then that argument is returned without a wrapper.  This
    saves space and improves lookup speed.

    c3s|]}�|�VqdSr@r$�rBrr�rwr$r%rn�sz_make_key.<locals>.<genexpr>c3s|]}�|�VqdSr@r$r�r�r$r%rn�sr�r)ry�valuesr�)
rar��typed�kwd_mark�	fasttypesr�rwr��key�itemr$r�r%�	_make_key�s
 r��Fcsnt�t�r�dkr\d�nDt��rLt�t�rL�d}�t|��t�}t||�S�dk	r\td����fdd�}|S)a�Least-recently-used cache decorator.

    If *maxsize* is set to None, the LRU features are disabled and the cache
    can grow without bound.

    If *typed* is True, arguments of different types will be cached separately.
    For example, f(3.0) and f(3) will be treated as distinct calls with
    distinct results.

    Arguments to the cached function must be hashable.

    View the cache statistics named tuple (hits, misses, maxsize, currsize)
    with f.cache_info().  Clear the cache and statistics with f.cache_clear().
    Access the underlying function with f.__wrapped__.

    See:  http://en.wikipedia.org/wiki/Cache_replacement_policies#Least_recently_used_(LRU)

    rr�Nz=Expected first argument to be an integer, a callable, or Nonecst|��t�}t||�Sr@)�_lru_cache_wrapper�
_CacheInfor)�
user_functionr�r�r�r$r%�decorating_function
sz&lru_cache.<locals>.decorating_function)r��intrd�boolr�r�rr])r�r�r�rr�r$r�r%r�s


�cs�t��t�d\����i�d�	�
d��j��j�t��
g���ddg�dd�<�dkrh�
�fdd�}nN�dkr����	��
���fdd�}n*���������	�
���
���fdd�}���	�
��
fdd	�}���	�
�
�fd
d�}||_||_|S)N)rr�r��rFcs�d7��||�}|S�Nr�r$)rar�r�)r�r�r$r%r$s
z#_lru_cache_wrapper.<locals>.wrappercsH�||��}�|��}|�k	r*�d7�|S�d7��||�}|�|<|Sr�r$)rar�r�r�)�cache�	cache_getr��make_keyr��sentinelr�r�r$r%r-s

c
s>�
||��}�	�z�|�}|dk	r~|\}}}}||�<||�<�
�}||�<�
�<||�<�
|�<�d7�|W5QR�S�d7�W5QRX�||�}�	��|�kr�n��r��
}	||	�<||	�<|	��
�
�}
�
�}d�
�<�
�<�|
=|	�|<n6�
�}|�
||g}||�<�
�<�|<���k�W5QRX|Sr�r$)rar�r��linkZ	link_prevZ	link_nextZ_keyr�ZlastZoldrootZoldkeyZ	oldresult)�KEY�NEXT�PREV�RESULTr�r��	cache_len�fullr��lockr�r�r�rKr�r�r$r%r<sB

c
s,���������W5QR�SQRXdS)zReport cache statisticsNr$r$)r�r�r�r�r�r�r$r%�
cache_infousz&_lru_cache_wrapper.<locals>.cache_infoc	s<��.�����ddg�dd�<d��d�W5QRXdS)z$Clear the cache and cache statisticsNrF)�clearr$)r�r�r�r�r�rKr$r%�cache_clearzs
z'_lru_cache_wrapper.<locals>.cache_clear)rAr�r��__len__rr�r�)r�r�r�r�rr�r�r$)r�r�r�r�r�r�r�r�r�r�r�r�r�r�rKr�r�r�r%r�s**9	r�)r�cCs�g}dd�|D�}|s|S|D]2}|d}|D]}||dd�kr.d}qq.qRq|dkrbtd��|�|�|D]}|d|krp|d=qpqdS)z�Merges MROs in *sequences* to a single MRO using the C3 algorithm.

    Adapted from http://www.python.org/download/releases/2.3/mro/.

    cSsg|]}|r|�qSr$r$�rB�sr$r$r%�
<listcomp>�sz_c3_merge.<locals>.<listcomp>rr�NzInconsistent hierarchy)�RuntimeError�append)�	sequencesr��s1�	candidate�s2�seqr$r$r%�	_c3_merge�s"
r�Nc
stt|j��D]$\}�t�d�rt|j�|}q8qd}�rDt��ng�t|jd|��}g}t|j|d��}�D]0�t|��rtt�fdd�|jD��st|���qt|D]���	��q��fdd�|D�}�fdd�|D�}�fd	d�|D�}	t
|gg|||	|g|g|g�S)
a�Computes the method resolution order using extended C3 linearization.

    If no *abcs* are given, the algorithm works exactly like the built-in C3
    linearization used for method resolution.

    If given, *abcs* is a list of abstract base classes that should be inserted
    into the resulting MRO. Unrelated ABCs are ignored and don't end up in the
    result. The algorithm inserts ABCs where their functionality is introduced,
    i.e. issubclass(cls, abc) returns True for the class itself but returns
    False for all its direct base classes. Implicit ABCs for a given class
    (either registered or inferred from the presence of a special method like
    __len__) are inserted directly after the last ABC explicitly listed in the
    MRO of said class. If two implicit ABCs end up next to each other in the
    resulting MRO, their ordering depends on the order of types in *abcs*.

    �__abstractmethods__rNc3s|]}t|��VqdSr@)�
issubclass)rB�b)�baser$r%rn�sz_c3_mro.<locals>.<genexpr>csg|]}t|�d��qS���abcs��_c3_mro�rBr�r�r$r%r��sz_c3_mro.<locals>.<listcomp>csg|]}t|�d��qSr�r�r�r�r$r%r��scsg|]}t|�d��qSr�r�r�r�r$r%r��s)�	enumerate�reversed�	__bases__rer��listr��anyr��remover�)
rEr��i�boundary�explicit_bases�abstract_bases�other_bases�explicit_c3_mros�abstract_c3_mros�
other_c3_mrosr$)r�r�r%r��sD
��������r�cs�t�j����fdd���fdd��D���fdd���fdd��D��t���g}�D]�}g}|��D]0}|�krht�|�rh|��fdd�|jD��qh|s�|�|�qX|jtd	d
�|D] }|D]}||kr�|�|�q�q�qXt�|d�S)z�Calculates the method resolution order for a given class *cls*.

    Includes relevant abstract base classes (with their respective bases) from
    the *types* iterable. Uses a modified C3 linearization algorithm.

    cs|�kot|d�ot�|�S)N�__mro__)rer�)�typ)�basesrEr$r%�
is_related�s�z _compose_mro.<locals>.is_relatedcsg|]}�|�r|�qSr$r$�rB�n)r�r$r%r��sz _compose_mro.<locals>.<listcomp>cs&�D]}||kr||jkrdSqdS)NTF)r�)r�r+)�typesr$r%�is_strict_base�sz$_compose_mro.<locals>.is_strict_basecsg|]}�|�s|�qSr$r$r�)r�r$r%r��scsg|]}|�kr|�qSr$r$r�)�type_setr$r%r��sT)r��reverser�)�setr��__subclasses__r�r��sortr�r�)rEr��mror��found�sub�subclsr$)r�rEr�r�r�r�r%�_compose_mro�s*

rcCstt||���}d}|D]R}|dk	r\||krX||jkrX||jkrXt||�sXtd�||���qj||kr|}q|�|�S)a^Returns the best matching implementation from *registry* for type *cls*.

    Where there is no registered implementation for a specific type, its method
    resolution order is used to find a more generic implementation.

    Note: if *registry* does not contain an implementation for the base
    *object* type, this function may return None.

    NzAmbiguous dispatch: {} or {})r�keysr�r�r�r�r�)rE�registryr�match�tr$r$r%�
_find_impls"
���r
cs�ddl}ddl}i�|���d����fdd��d����fdd�	���fdd�}t|d	d
��|�t<�|_�|_|���|_�j	|_
t||�|S)akSingle-dispatch generic function decorator.

    Transforms a function into a generic function, which can have different
    behaviours depending upon the type of its first argument. The decorated
    function acts as the default implementation, and additional
    implementations can be registered using the register() attribute of the
    generic function.
    rNcs|�dk	r"t�}�|kr"���|�z�|}WnHtk
rvz�|}Wntk
rht|��}YnX|�|<YnX|S)z�generic_func.dispatch(cls) -> <function implementation>

        Runs the dispatch algorithm to return the best available implementation
        for the given *cls* registered on *generic_func*.

        N)rr��KeyErrorr
)rE�
current_token�impl)�cache_token�dispatch_cacherr$r%�dispatch.sz singledispatch.<locals>.dispatchcs�|dkr�t�t�r ��fdd�St�di�}|s@td��d����}ddlm}tt||�����\}�t�t�s�td	|�d
��d���|��<�dkr�t	�d�r�t
�����|S)
z�generic_func.register(cls, func) -> func

        Registers a new implementation for the given *cls* on a *generic_func*.

        Ncs
��|�Sr@r$)�f)rE�registerr$r%�<lambda>N�z2singledispatch.<locals>.register.<locals>.<lambda>rz(Invalid first argument to `register()`: zS. Use either `@register(some_class)` or plain `@register` on an annotated function.r)�get_type_hintszInvalid annotation for z. z is not a class.r�)r�rwrr]�typingrr[rYryrerr�)rEr`�annr�argname)rrrrrDr%rEs(

�
�z singledispatch.<locals>.registercs&|st��d����|dj�||�S)Nz( requires at least 1 positional argumentr)r]ri)ra�kw)r�funcnamer$r%rfszsingledispatch.<locals>.wrapperrzsingledispatch function)N)r��weakref�WeakKeyDictionaryrrArr�MappingProxyTyperr��_clear_cacher)r`r�rrr$)rrrrrrr%rs!
c@s8eZdZdZdd�Zddd�Zddd�Zed	d
��ZdS)
rz�Single-dispatch generic method descriptor.

    Supports wrapping existing descriptors and handles non-descriptor
    callables as instance methods.
    cCs4t|�s t|d�s t|�d���t|�|_||_dS)Nr�z  is not callable or a descriptor)rdrer]r�
dispatcherr`�r*r`r$r$r%rPs
zsingledispatchmethod.__init__NcCs|jj||d�S)z�generic_method.register(cls, func) -> func

        Registers a new implementation for the given *cls* on a *generic_method*.
        r�)rr)r*rE�methodr$r$r%r�szsingledispatchmethod.registercs0���fdd�}�j|_�j|_t|�j�|S)Ncs$�j�|dj�}|����||�SrQ)rrrir�)ra�kwargsr!�rErNr*r$r%r��sz-singledispatchmethod.__get__.<locals>._method)r�rrr`)r*rNrEr�r$r#r%r��s
zsingledispatchmethod.__get__cCst|jdd�Sr�r�r}r$r$r%r��sz)singledispatchmethod.__isabstractmethod__)N)N)	rrrrrPrr�r�r�r$r$r$r%rxs


c@s&eZdZdd�Zdd�Zddd�ZdS)	r
cCs ||_d|_|j|_t�|_dSr@)r`�attrnamerrr�r r$r$r%rP�szcached_property.__init__cCs8|jdkr||_n"||jkr4td|j�d|�d���dS)Nz?Cannot assign the same cached_property to two different names (z and z).)r$r])r*�owner�namer$r$r%�__set_name__�s

�zcached_property.__set_name__Nc	Cs�|dkr|S|jdkrtd��z
|j}Wn8tk
r`dt|�j�d|j�d�}t|�d�YnX|�|jt�}|tkr�|j�n|�|jt�}|tkr�|�	|�}z|||j<Wn8tk
r�dt|�j�d|j�d�}t|�d�YnXW5QRX|S)NzGCannot use cached_property instance without calling __set_name__ on it.zNo '__dict__' attribute on z instance to cache z
 property.zThe '__dict__' attribute on z7 instance does not support item assignment for caching )
r$r]rrrwrr��
_NOT_FOUNDr�r`)r*�instancer%r��msg�valr$r$r%r��s2
�
�
�zcached_property.__get__)N)rrrrPr'r�r$r$r$r%r
�s	)r�F)N)9r�__all__�abcr�collectionsr�reprlibr�_threadrrrrrr,r.r/r0r3r4r5r8r9r:r=r>r?rGrr�
_functools�ImportErrorrArZrr	r
r�r�r�r�r��strr�rwr�r�rr�r�r�rr
rrr(r
r$r$r$r%�<module>s��
�
�
�����AX	�

,t
-)\(__pycache__/_osx_support.cpython-38.opt-2.pyc000064400000021310151153537570015121 0ustar00U

e5dU�@s�ddlZddlZddlZddddgZdZdZdZd,d	d
�Zd-dd
�Zdd�Z	da
dd�Zdadd�Z
dd�Zdd�Zdadd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d�Zd)d�Zd*d�Zd+d�ZdS).�N�compiler_fixup�customize_config_vars�customize_compiler�get_platform_osx)
�CFLAGSZLDFLAGSZCPPFLAGSZ
BASECFLAGS�	BLDSHARED�LDSHARED�CC�CXXZ	PY_CFLAGSZ
PY_LDFLAGSZPY_CPPFLAGSZPY_CORE_CFLAGSZPY_CORE_LDFLAGS)rrr	r
Z_OSX_SUPPORT_INITIAL_cCs�|dkrtjd}|�tj�}tj�|�\}}tjdkrH|dkrH|d}tj�|�s�|D]&}tj�	||�}tj�|�rX|SqXdS|SdS)N�PATHZwin32z.exe)
�os�environ�split�pathsep�path�splitext�sys�platform�isfile�join)�
executabler�paths�baseZext�p�f�r�$/usr/lib64/python3.8/_osx_support.py�_find_executables

rFc
Cs�ddl}zddl}|��}Wn(tk
rDtdt��fd�}YnX|�|��P}|rfd||jf}nd||jf}t�	|�s�|�
��d���ndW5QR�SQRXdS)Nrz/tmp/_osx_support.%szw+bz
%s >'%s' 2>&1z%s 2>/dev/null >'%s'zutf-8)
�
contextlib�tempfileZNamedTemporaryFile�ImportError�openr�getpid�closing�name�system�read�decode�strip)Z
commandstringZcapture_stderrrr�fp�cmdrrr�_read_output7s��
r+cCst|�ptd|f�pdS)Nz/usr/bin/xcrun -find %s�)rr+)Ztoolnamerrr�_find_build_toolMs
��r-cCsxtdkrtdaztd�}Wntk
r,YnHXzt�d|���}W5|��X|dk	rtd�|�d��	d�dd��atS)Nr,z0/System/Library/CoreServices/SystemVersion.plistz=<key>ProductUserVisibleVersion</key>\s*<string>(.*?)</string>�.��)
�_SYSTEM_VERSIONr!�OSError�close�re�searchr&r�groupr)r�mrrr�_get_system_versionVs
�
r8cCsLtdkrHt�}|rHztdd�|�d�D��aWntk
rFdaYnXtS)Ncss|]}t|�VqdS�N��int��.0�irrr�	<genexpr>�sz,_get_system_version_tuple.<locals>.<genexpr>r.r)�_SYSTEM_VERSION_TUPLEr8�tupler�
ValueError�Zosx_versionrrr�_get_system_version_tupleus
rDcCs"t|�D]}|�t�r||=qdSr9)�list�
startswith�_INITPRE)�_config_vars�krrr�_remove_original_values�s
rJcCs8|�|d�}||kr,t||kr,||t|<|||<dS)Nr,)�getrG)rH�cvZnewvalueZoldvaluerrr�_save_modified_value�srMcCs�tdk	rtStd|fd�}d}|��D]T}|�d�r<d}q(|�d�rLd}q(|r(|��}|dkrfdaq(|�d�r(|dd	�aq(tdkr�datS)
Nz%s -c -E -v - </dev/nullTFz#include <...>zEnd of search listz/usr/include�/z.sdk/usr/includei�)�_cache_default_sysrootr+�
splitlinesrFr(�endswith)�cc�contentsZ
in_incdirs�linerrr�_default_sysroot�s$


rUcCst�}|rt|dk�SdS)N��
�F)rD�boolrCrrr�_supports_universal_builds�srZcCst�}|r|dkSdS)N)�rF)rDrCrrr�_supports_arm64_builds�sr\cCs�dtjkr|S|d��d}}t|�s4td�}n<tj�|��d�rptd|�	dd�f�}|rpd|krptd�}|s|t
d	��||kr�tD]L}||kr�|tjkr�||��}|d
kr�|n|d|d<t||d�
|��q�|S)
Nr	rZclangZgccz'%s' --version�'�'"'"'zllvm-gcczCannot locate working compilerr
z++� )rr
rrr-r�basenamerFr+�replace�SystemError�_COMPILER_CONFIG_VARSrMr)rHrRZoldcc�datarLZcv_splitrrr�_find_appropriate_compiler�s,

��recCsVtD]L}||kr|tjkr||}tjdd|tjd�}t�dd|�}t|||�q|S)N�
-arch\s+\w+\sr_)�flagsz-isysroot\s*\S+)�_UNIVERSAL_CONFIG_VARSrr
r4�sub�ASCIIrM)rHrLrgrrr�_remove_universal_flagssrkcCs�dtjkr|St�d|d�dk	r�t�d|d�dd�f�}|r�tD]8}||krF|tjkrF||}t�dd|�}t|||�qF|S)	Nr	z-arch\s+ppcrzNecho 'int main{};' | '%s' -c -arch ppc -x c -o /dev/null /dev/null 2>/dev/nullr]r^z-arch\s+ppc\w*\sr_)	rr
r4r5r%rarhrirM)rHZstatusrLrgrrr�_remove_unsupported_archss
��	rlcCsddtjkr`tjd}tD]F}||krd||kr||}t�dd|�}|d|}t|||�q|S)N�	ARCHFLAGS�-archrfr_)rr
rhr4rirM)rHZarchrLrgrrr�_override_all_archs:s

rocCsx|�dd�}t�d|�}|dk	rt|�d�}tj�|�sttD]8}||kr:|tjkr:||}t�	dd|�}t
|||�q:|S)Nrr,z-isysroot\s*(\S+)r/z-isysroot\s*\S+(?:\s|$)r_)rKr4r5r6rr�existsrhr
rirM)rH�cflagsr7ZsdkrLrgrrr�_check_for_unavailable_sdkKs
rrc
Cs�d}}t|�}t�s d}}nd|k}tdd�|D��}|sHdtjkr�z|�d�}|||d�=WqHtk
r|Yq�YqHXqHnFt�s�tt	t
|���D].}||dkr�||dd	kr�|||d�=q�dtjkr�|s�|tjd��}|�r@d
d�t|�D�}|�s
�q@|d}||d
k�r0|||d�=q�|||d�=q�d}|}dd�t|�D�}|�sv|}dd�t|�D�}|D]B}||d
k�r�||d}�q�n||t
d
�d�}�q��qz|�r�tj
�|��s�ddlm}	|	�d|�|	�d�|S)NFTrncss|]}|�d�r|VqdS)�	-isysrootN�rF)r=�argrrrr?ys
z!compiler_fixup.<locals>.<genexpr>rmr0r/�arm64cSsg|]\}}|�d�r|�qS�rsrt�r=r>�xrrr�
<listcomp>�s
z"compiler_fixup.<locals>.<listcomp>rrscSsg|]\}}|�d�r|�qSrwrtrxrrrrz�s
cSsg|]\}}|�d�r|�qSrwrtrxrrrrz�s
)�logz4Compiling with an SDK that doesn't seem to exist: %sz$Please check your Xcode installation)rErZ�anyrr
�indexrBr\�reversed�range�lenr�	enumerater�isdirZ	distutilsr{�warn)
Zcompiler_soZcc_argsZ	stripArchZstripSysrootr}�idx�indicesZsysrootZargvarr{rrrrfsZ	


�
cCs"t�st|�t|�t|�|Sr9)rZrkrorr�rHrrrr�s
cCst|�t|�t|�|Sr9)rerlror�rrrr�s	cCs�|�dd�}t�p|}|p|}|�r�|}d}|�td|�dd��}|r�z$tdd�|�d�dd	�D��}Wq�tk
r�d
}Yq�Xnd
}|dk�rFd|��k�rFd
}t�d|�}tt	t
|���}t|�dkr�|d}nj|dkr�d}n\|dkr�d
}nN|dk�rd}n>|dk�rd}n.|dk�r&d}n|dk�r6d}ntd|f��n<|dk�rbtj
dk�r�d}n |dk�r�tj
dk�r~d }nd!}|||fS)"NZMACOSX_DEPLOYMENT_TARGETr,Zmacosxrcss|]}t|�VqdSr9r:r<rrrr?sz#get_platform_osx.<locals>.<genexpr>r.rr0)rWrrVrnZfatz
-arch\s+(\S+)r/)rv�x86_64Z
universal2)�i386�ppc)r�r�Zintel)r�r�r�Zfat3)�ppc64r�Zfat64)r�r�r�r�Z	universalz%Don't know machine value for archs=%rr�lr�)ZPowerPCZPower_Macintoshr�r�)rKr8rGrArrBr(r4�findall�sorted�setr�r�maxsize)rHZosname�release�machineZmacverZ
macreleaserqZarchsrrrr�sX



�$




�

)N)F)rr4r�__all__rhrcrGrr+r-r1r8r@rDrJrMrOrUrZr\rerkrlrorrrrrrrrrr�<module>s@�


	

>(Q)__pycache__/pkgutil.cpython-38.opt-2.pyc000064400000025512151153537570014044 0ustar00U

e5d�S�@stddlmZddlmZddlZddlZddlZddlZddl	Zddl
Z
ddlmZddl
Z
ddddd	d
ddd
dddgZedd�Zde_dd�Zdd�Zd*dd	�Zd+dd
�Zed,dd��Zd-dd�Ze�ejje�dd�ZGdd�d�ZGd d
�d
�Zz.ddlZdd!lmZd.d"d#�Ze�ee�Wne k
�r<YnXd$d�Z!d/d%d�Z"d&d�Z#d'd�Z$d(d�Z%d)d�Z&dS)0�)�
namedtuple)�singledispatchN)�
ModuleType�get_importer�iter_importers�
get_loader�find_loader�
walk_packages�iter_modules�get_data�ImpImporter�	ImpLoader�	read_code�extend_path�
ModuleInfozmodule_finder name ispkgz.A namedtuple with minimal info about a module.cCsRz
|j}Wn:tk
rD|�|�}|dkr2YdStj�||�YSX||�SdS�N)�	find_spec�AttributeError�find_module�	importlib�util�spec_from_loader)�finder�namer�loader�r�/usr/lib64/python3.8/pkgutil.py�	_get_specs

rcCs6ddl}|�d�}|tjjkr"dS|�d�|�|�S)Nr��)�marshal�readrr�MAGIC_NUMBER�load)�streamr �magicrrrr(s

�c	#s�ifdd��t||�D]�}|V|jrzt|j�WnNtk
rZ|dk	rV||j�Yqtk
r�|dk	r|||j�n�YqXttj|jdd�p�g}�fdd�|D�}t	||jd|�EdHqdS)NcSs||krdSd||<dS)NTr)�p�mrrr�seenRszwalk_packages.<locals>.seen�__path__csg|]}�|�s|�qSrr)�.0r'�r)rr�
<listcomp>isz!walk_packages.<locals>.<listcomp>�.)
r
�ispkg�
__import__r�ImportError�	Exception�getattr�sys�modulesr	)�path�prefix�onerror�inforr,rr	5s ccsr|dkrt�}nt|t�r$td��n
tt|�}i}|D]6}t||�D]&\}}||krDd||<t|||�VqDq6dS)Nz9path must be None or list of paths to look for modules in�)r�
isinstance�str�
ValueError�mapr�iter_importer_modulesr)r6r7Z	importers�yielded�irr/rrrr
ns



cCst|d�sgS|�|�S)Nr
)�hasattrr
)�importerr7rrrr?�s
r?c	cs$|jdkstj�|j�sdSi}ddl}zt�|j�}Wntk
rPg}YnX|��|D]�}|�|�}|dks^||kr~q^tj�|j|�}d}|s�tj�|�r�d|kr�|}zt�|�}	Wntk
r�g}	YnX|	D]}|�|�}
|
dkr�d}q�q�q^|r^d|kr^d||<|||fVq^dS�Nr�__init__Fr.Tr:�	r6�os�isdir�inspect�listdir�OSError�sort�
getmodulename�join)rCr7r@rI�	filenames�fn�modnamer6r/�dircontents�subnamerrr�_iter_file_finder_modules�s<



rTc	Cs.t���t�dt�t�d�aW5QRXdS)N�ignore�imp)�warnings�catch_warnings�simplefilter�DeprecationWarningr�
import_modulerVrrrr�_import_imp�s
r\c@s*eZdZd	dd�Zd
dd�Zddd�ZdS)rNcCst�dt�t�||_dS�Nz5This emulation is deprecated, use 'importlib' instead)rW�warnrZr\r6)�selfr6rrrrE�s
�zImpImporter.__init__cCs�|�d�d}||kr$|jdkr$dS|jdkr4d}ntj�|j�g}zt�||�\}}}Wntk
rpYdSXt||||�S)Nr.���)�splitr6rG�realpathrVrr1r
)r_�fullnamer6rS�file�filename�etcrrrr�s
zImpImporter.find_moduler&c	cs$|jdkstj�|j�sdSi}ddl}zt�|j�}Wntk
rPg}YnX|��|D]�}|�|�}|dks^||kr~q^tj�|j|�}d}|s�tj�|�r�d|kr�|}zt�|�}	Wntk
r�g}	YnX|	D]}|�|�}
|
dkr�d}q�q�q^|r^d|kr^d||<|||fVq^dSrDrF)r_r7r@rIrOrPrQr6r/rRrSrrrr
�s<



zImpImporter.iter_modules)N)N)r&)�__name__�
__module__�__qualname__rErr
rrrrr�s

c@sjeZdZdZZdd�Zdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
ddd�Zddd�Zdd�Z
ddd�ZdS)r
NcCs.t�dt�t�||_||_||_||_dSr])rWr^rZr\rdrercrf)r_rcrdrerfrrrrEs�zImpLoader.__init__cCs:|��zt�||j|j|j�}W5|jr4|j��X|Sr)�_reopenrd�closerV�load_modulererf)r_rc�modrrrrlszImpLoader.load_modulec
Cs*t|d��}|��W5QR�SQRXdS)N�rb)�openr!)r_�pathnamerdrrrr%szImpLoader.get_datacCsT|jrP|jjrP|jd}|tjkr2t|jd�|_n|tjtjfkrPt|jd�|_dS)N��rrn)	rd�closedrfrV�	PY_SOURCErore�PY_COMPILED�C_EXTENSION)r_�mod_typerrrrj)s

zImpLoader._reopencCs0|dkr|j}n||jkr,td|j|f��|S)Nz,Loader for module %s cannot handle module %s)rcr1�r_rcrrr�	_fix_name1s
�zImpLoader._fix_namecCs|�|�}|jdtjkS�Nrq)ryrfrV�
PKG_DIRECTORYrxrrr�
is_package9s
zImpLoader.is_packagecCs�|�|�}|jdkr�|jd}|tjkrD|�|�}t||jd�|_nJ|tjkrv|�	�zt|j
�|_W5|j
��Xn|tj
kr�|����|_|jS)Nrq�exec)ry�coderfrVrt�
get_source�compilererurjrdrkrr{�
_get_delegate�get_code)r_rcrw�sourcerrrr�=s






zImpLoader.get_codec	Cs�|�|�}|jdkr�|jd}|tjkrP|��z|j��|_W5|j��Xnd|tj	kr�t
j�|j
dd��r�t|j
dd�d��}|��|_W5QRXn|tjkr�|����|_|jS)Nrqr`rr)ryr�rfrVrtrjrdrkr!rurGr6�existsreror{r�r)r_rcrw�frrrrNs





zImpLoader.get_sourcecCst|j�}t|d�}|jS)NrE)rrerr)r_r�specrrrr�`s

zImpLoader._get_delegatecCsH|�|�}|jd}|tjkr*|����S|tjtjtjfkrD|j	SdSrz)
ryrfrVr{r��get_filenamertrurvre)r_rcrwrrrr�es


zImpLoader.get_filename)N)N)N)rgrhrir~r�rErlrrjryr|r�rr�r�rrrrr
s	

)�zipimporterc	cs�ttj|j�}|j}t|�}i}ddl}|D]�}|�|�s>q.||d��t	j
�}t|�dkr�|d�d�r�|d|kr�d||d<||ddfVt|�dkr�q.|�|d�}|dkr�q.|r.d|kr.||kr.d||<||dfVq.dS)	Nrrqr:z__init__.pyTrEr.F)�sorted�	zipimport�_zip_directory_cache�archiver7�lenrI�
startswithrarG�seprM)	rCr7Zdirlist�_prefixZplenr@rIrPrQrrr�iter_zipimport_modulesss*
r�cCsxt�|�}ztj|}WnZtk
rrtjD]:}z ||�}tj�||�WqnWq.tk
rfYq.Xq.d}YnX|Sr)rG�fsdecoder4�path_importer_cache�KeyError�
path_hooks�
setdefaultr1)Z	path_itemrC�	path_hookrrrr�s	



ccs�|�d�rd�|�}t|��d|krV|�d�d}t�|�}t|dd�}|dkrhdSntjEdHtj	}|D]}t
|�VqldS)Nr.�'Relative module name {!r} not supportedrr*)r��formatr1�
rpartitionrr[r3r4�	meta_pathr6r)rc�msgZpkg_nameZpkgr6�itemrrrr�s


cCsn|tjkr tj|}|dkr dSt|t�rb|}t|dd�}|dk	rF|St|dd�dkrZdS|j}n|}t|�S)N�
__loader__�__spec__)r4r5r;rr3rgr)Zmodule_or_name�modulerrcrrrr�s


cCs�|�d�rd�|�}t|��ztj�|�}WnFttttfk
rr}z d}t|�|t	|�|��|�W5d}~XYnX|dk	r�|j
SdS)Nr.r�z,Error while finding loader for {!r} ({}: {}))r�r�r1rrrr�	TypeErrorr=�typer)rcr�r�Zexrrrr�s

*cCs�t|t�s|S|d}|dd�}|�d�\}}}|rfztj|j}Wqlttfk
rb|YSXntj}|D�]&}t|t	�s�qpt
|�}|dk	r�g}	t|d�r�|�|�}
|
dk	r�|
j
p�g}	nt|d�r�|�|�\}}	|	D]}||kr�|�|�q�tj�||�}tj�|�rpzt|�}
Wn8tk
�rP}ztj�d||f�W5d}~XYqpX|
�<|
D]0}|�d�}|�r\|�d��r��q\|�|��q\W5QRXqp|S)Nz.pkgr.rrzCan't open %s: %s
�
�#)r;�listr�r4r5r*r�rr6r<rrBr�submodule_search_locationsr�appendrGrN�isfilerorK�stderr�write�rstripr�)r6rZ	sname_pkgZparent_package�_Z
final_nameZsearch_path�dirr�portionsr�ZportionZpkgfiler�r��linerrrr�sR!





�
cCs�tj�|�}|dkrdS|j}|dks0t|d�s4dStj�|�pJtj�	|�}|dks^t|d�sbdS|�
d�}|�dtj
�|j��tj
j|�}|�|�S)Nr�__file__�/r)rrrrrBr4r5�get�
_bootstrap�_loadra�insertrGr6�dirnamer�rNr)�package�resourcer�rrm�partsZ
resource_namerrrrVs
�
)Nr&N)Nr&)r&)r&)r&)r&)'�collectionsr�	functoolsrZ
simplegenericr�importlib.util�importlib.machineryrGZos.pathr4�typesrrW�__all__r�__doc__rrr	r
r?rT�register�	machinery�
FileFinderr\rr
r�r�r�r1rrrrrrrrrr�<module>sf�

9

(�Jc

^__pycache__/tarfile.cpython-38.pyc000064400000211663151153537570013057 0ustar00U

&�.e��@sdZdZdZdZddlmZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZzddlZWnek
r�dZYnXzddlZWnek
r�dZYnXeefZzeef7ZWnek
r�YnXddd	d
ddd
ddddddddgZdZdZdZdZedZdZdZ dZ!dZ"dZ#dZ$dZ%d Z&d!Z'd"Z(d#Z)d$Z*d%Z+d&Z,d'Z-d(Z.d)Z/d*Z0d+Z1d,Z2dZ3d-Z4d.Z5e5Z6e$e%e&e'e*e+e,e(e)e-e.e/fZ7e$e%e,e/fZ8e-e.e/fZ9d/Z:d0d1d2d3hZ;e<e<e<e=e=e=d4�Z>ej?d5k�r�d6Z@ne�A�Z@d7d8�ZBd9d:�ZCd;d<�ZDd=e6fd>d?�ZEd@dA�ZFdedfdBdC�ZGdDdE�ZHGdFd
�d
eI�ZJGdGd�deJ�ZKGdHd�deJ�ZLGdId�deJ�ZMGdJd
�d
eJ�ZNGdKd�deJ�ZOGdLdM�dMeO�ZPGdNdO�dOeO�ZQGdPdQ�dQeO�ZRGdRdS�dSeO�ZSGdTdU�dUeO�ZTGdVdW�dW�ZUGdXdY�dY�ZVGdZd[�d[eW�ZXGd\d]�d]eW�ZYGd^d_�d_e	jZ�Z[Gd`da�daeJ�Z\Gdbdc�dce\�Z]Gddde�dee\�Z^Gdfdg�dge\�Z_Gdhdi�die\�Z`Gdjdk�dke\�Zad{dldm�Zbdndo�Zcdpdq�Zddrds�Zeecedeedt�ZfeW�ZgGdud�deW�ZhGdvd�deW�Zidwd	�ZjeijZdxdy�Zkeldzk�r
ek�dS)|z,Read from and write to tar format archives.
z0.9.0u"Lars Gustäbel (lars@gustaebel.de)u4Gustavo Niemeyer, Niels Gustäbel, Richard Townsend.�)�openN�TarFile�TarInfo�
is_tarfile�TarError�	ReadError�CompressionError�StreamError�ExtractError�HeaderError�ENCODING�USTAR_FORMAT�
GNU_FORMAT�
PAX_FORMAT�DEFAULT_FORMATrTz/etc/python/tarfile.cfg�i�sustar  sustar00�d��0�1�2�3�4�5�6�7�L�K�S�x�g�X��)�path�linkpath�size�mtime�uid�gid�uname�gnamer%r&r+r,)Zatime�ctimer(r)r*r'�nt�utf-8cCs8|dkrtd��|�||�}|d|�|t|�tS)z8Convert a string to a null-terminated bytes object.
    Nzmetadata cannot contain None)�
ValueError�encode�len�NUL)�s�length�encoding�errors�r8�/usr/lib64/python3.8/tarfile.py�stn�sr:cCs*|�d�}|dkr|d|�}|�||�S)z8Convert a null-terminated bytes object to a string.
    r���N)�find�decode)r4r6r7�pr8r8r9�nts�s
r?cCs�|ddkrbd}tt|�d�D]}|dK}|||d7}q |ddkr�dt|�d|}n@z"t|dd�}t|��p|d	d�}Wntk
r�td
��YnX|S)z/Convert a number field to a python number.
    r)��r#�rA��ascii�strict�0�invalid header)�ranger2r?�int�stripr0�InvalidHeaderError)r4�n�ir8r8r9�nti�srNrBcCs�t|�}d|kr$d|dkrDnntd|d|fd�t}n�|tkr�d|d|krrd|dkr�nnV|dkr�tdg�}ntdg�}d||}t|d�D]}|�d|d@�|dL}q�ntd	��|S)
z/Convert a python number to a number field.
    rrBr#z%0*orDrCr@rAzoverflow in number field)rI�bytesr3r�	bytearrayrH�insertr0)rL�digits�formatr4rMr8r8r9�itn�s 2
rTcCs0dtt�d|��}dtt�d|��}||fS)a�Calculate the checksum for a member's header by summing up all
       characters except for the chksum field which is treated as if
       it was filled with spaces. According to the GNU tar sources,
       some tars (Sun and NeXT) calculate chksum with signed char,
       which will be different if there are chars in the buffer with
       the high bit set. So we calculate two checksums, unsigned and
       signed.
    rCZ
148B8x356BZ
148b8x356b)�sum�structZunpack_from)�bufZunsigned_chksumZ
signed_chksumr8r8r9�calc_chksums�s	rXc	Cs�|pd}|dkrdS|dkr.t�|||�dSt||�\}}t|�D],}|�|�}t|�|krf|d��|�|�qD|dkr�|�|�}t|�|kr�|d��|�|�dS)zjCopy length bytes from fileobj src to fileobj dst.
       If length is None, copy the entire content.
    i@rN�unexpected end of data)�shutil�copyfileobj�divmodrH�readr2�write)	�srcZdstr5�	exception�bufsize�blocks�	remainder�brWr8r8r9r[�s$


r[cCs8ttjdd�}|dk	r(|�|d��|�}t|dd�dS)Nr6�backslashreplace� )�end)�getattr�sys�stdoutr1r=�print)r4r6r8r8r9�_safe_printsrlc@seZdZdZdS)rzBase exception.N��__name__�
__module__�__qualname__�__doc__r8r8r8r9rsc@seZdZdZdS)r
z%General exception for extract errors.Nrmr8r8r8r9r
sc@seZdZdZdS)rz&Exception for unreadable tar archives.Nrmr8r8r8r9rsc@seZdZdZdS)rz.Exception for unavailable compression methods.Nrmr8r8r8r9rsc@seZdZdZdS)r	z=Exception for unsupported operations on stream-like TarFiles.Nrmr8r8r8r9r	!sc@seZdZdZdS)rz!Base exception for header errors.Nrmr8r8r8r9r$sc@seZdZdZdS)�EmptyHeaderErrorzException for empty headers.Nrmr8r8r8r9rr'srrc@seZdZdZdS)�TruncatedHeaderErrorz Exception for truncated headers.Nrmr8r8r8r9rs*srsc@seZdZdZdS)�EOFHeaderErrorz"Exception for end of file headers.Nrmr8r8r8r9rt-srtc@seZdZdZdS)rKzException for invalid headers.Nrmr8r8r8r9rK0srKc@seZdZdZdS)�SubsequentHeaderErrorz3Exception for missing and invalid extended headers.Nrmr8r8r8r9ru3sruc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�
_LowLevelFilez�Low-level file object. Supports reading and writing.
       It is used instead of a regular file object for streaming
       access.
    cCsFtjtjtjBtjBd�|}ttd�r2|tjO}t�||d�|_dS)N��r�w�O_BINARYi�)	�os�O_RDONLY�O_WRONLY�O_CREAT�O_TRUNC�hasattrrzr�fd)�self�name�moder8r8r9�__init__@s��

z_LowLevelFile.__init__cCst�|j�dS�N)r{�closer��r�r8r8r9r�Isz_LowLevelFile.closecCst�|j|�Sr�)r{r]r��r�r'r8r8r9r]Lsz_LowLevelFile.readcCst�|j|�dSr�)r{r^r��r�r4r8r8r9r^Osz_LowLevelFile.writeN)rnrorprqr�r�r]r^r8r8r8r9rv:s
	rvc@sreZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zddd�Zdd�Z
dd�Zdd�ZdS)�_Streama�Class that serves as an adapter between TarFile and
       a stream-like object.  The stream-like object only
       needs to have a read() or write() method and is accessed
       blockwise.  Use of gzip or bzip2 compression is possible.
       A stream-like object could be for example: sys.stdin,
       sys.stdout, a socket, a tape device etc.

       _Stream is intended to be used only internally.
    c	Cs�d|_|dkrt||�}d|_|dkr6t|�}|��}|p<d|_||_||_||_||_d|_	d|_
d|_�zL|dkr�zddl}Wnt
k
r�td	��YnX||_|�d�|_|d
kr�|��|j|_n|��n�|dk�r:zddl}Wnt
k
�r
td��YnX|d
k�r.d|_|��|_t|_n
|��|_n||d
k�r�zddl}Wnt
k
�rntd��YnX|d
k�r�d|_|��|_|j|_n
|��|_n|dk�r�td|��Wn&|j�s�|j��d|_�YnXdS)z$Construct a _Stream object.
        TNF�*��r�gzzzlib module is not availablerx�bz2�bz2 module is not available�xz�lzma module is not available�tar�unknown compression type %r) �_extfileobjrv�_StreamProxy�getcomptyper�r��comptype�fileobjrarW�pos�closed�zlib�ImportErrorr�crc32�crc�
_init_read_gz�errorr`�_init_write_gzr��dbufZBZ2Decompressor�cmp�OSErrorZ
BZ2Compressor�lzmaZLZMADecompressor�	LZMAErrorZLZMACompressorr�)	r�r�r�r�r�rar�r�r�r8r8r9r�]sl












z_Stream.__init__cCst|d�r|js|��dS)Nr�)r�r�r�r�r8r8r9�__del__�sz_Stream.__del__cCs�|j�d|jj|jj|jjd�|_t�dtt	�	���}|�
d|d�|j�d�rf|jdd�|_t
j�|j�|_|�
|j�d	d
�t�dS)z6Initialize for writing with gzip compression.
        �	r�<Ls�s��.gzN���z
iso-8859-1�replace)r�ZcompressobjZDEFLATED�	MAX_WBITSZ
DEF_MEM_LEVELr�rV�packrI�time�_Stream__writer��endswithr{r%�basenamer1r3)r�Z	timestampr8r8r9r��s�z_Stream._init_write_gzcCsR|jdkr|j�||j�|_|jt|�7_|jdkrD|j�|�}|�|�dS)z&Write string s to the stream.
        r�r�N)	r�r�r�r�r�r2r��compressr�r�r8r8r9r^�s

z
_Stream.writecCsN|j|7_t|j�|jkrJ|j�|jd|j��|j|jd�|_qdS)z]Write string s to the stream if a whole new block
           is ready to be written.
        N)rWr2rar�r^r�r8r8r9Z__write�sz_Stream.__writecCs�|jr
dSd|_z�|jdkr:|jdkr:|j|j��7_|jdkr�|jr�|j�	|j�d|_|jdkr�|j�	t
�d|j��|j�	t
�d|j
d@��W5|js�|j��XdS)	z[Close the _Stream object. No operation should be
           done on it afterwards.
        NTryr�r�r�r�l��)r�r�r�r�r�r�rWr��flushr^rVr�r�r�r�r8r8r9r��s
z
_Stream.closecCs�|j�|jj�|_d|_|�d�dkr0td��|�d�dkrFtd��t|�d��}|�d�|d	@r�t|�d��d
t|�d��}|�	|�|d@r�|�d�}|r�|t
kr�q�q�|d@r�|�d�}|r�|t
kr�q�q�|d@r�|�d�d
S)z:Initialize for reading a gzip compressed fileobj.
        r�r$s��not a gzip filer#�zunsupported compression method��rCrB�N)r�Z
decompressobjr�r�r��
_Stream__readrr�ordr]r3)r��flagZxlenr4r8r8r9r��s*
 


z_Stream._init_read_gzcCs|jS)z3Return the stream's file pointer position.
        )r�r�r8r8r9�tell�sz_Stream.tellrcCsX||jdkrJt||j|j�\}}t|�D]}|�|j�q,|�|�ntd��|jS)zXSet the stream's file pointer to pos. Negative seeking
           is forbidden.
        rz seeking backwards is not allowed)r�r\rarHr]r	)r�r�rbrcrMr8r8r9�seeksz_Stream.seekcCs,|dk	st�|�|�}|jt|�7_|S)z5Return the next size number of bytes from the stream.N)�AssertionError�_readr�r2)r�r'rWr8r8r9r]s
z_Stream.readcCs�|jdkr|�|�St|j�}|jg}||kr�|jrB|j}d|_n|j�|j�}|sVq�z|j�	|�}Wn|j
k
r�td��YnX|�|�|t|�7}q&d�
|�}||d�|_|d|�S)z+Return size bytes from the stream.
        r�r�zinvalid compressed dataN)r�r�r2r�rWr�r]rar��
decompressr`r�append�join�r�r'�c�trWr8r8r9r�s(




z
_Stream._readcCsjt|j�}|jg}||krF|j�|j�}|s.qF|�|�|t|�7}qd�|�}||d�|_|d|�S)zsReturn size bytes from stream. If internal buffer is empty,
           read another block from the stream.
        r�N)r2rWr�r]rar�r�r�r8r8r9Z__read3s


z_Stream.__readN)r)rnrorprqr�r�r�r^r�r�r�r�r�r]r�r�r8r8r8r9r�Rs
F
	

r�c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r�zsSmall proxy class that enables transparent compression
       detection for the Stream interface (mode 'r|*').
    cCs||_|j�t�|_dSr�)r�r]�	BLOCKSIZErW)r�r�r8r8r9r�Isz_StreamProxy.__init__cCs|jj|_|jSr�)r�r]rWr�r8r8r9r]Ms
z_StreamProxy.readcCsP|j�d�rdS|jdd�dkr8|jdd�dkr8d	S|j�d
�rHdSdSdS)
Ns�r�r�sBZhr��
s1AY&SYr�)s]�s�7zXZr�r�)rW�
startswithr�r8r8r9r�Qs$z_StreamProxy.getcomptypecCs|j��dSr�)r�r�r�r8r8r9r�[sz_StreamProxy.closeN)rnrorprqr�r]r�r�r8r8r8r9r�Ds

r�c@sjeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	e
jfdd�Zddd�Z
dd�Zdd�ZdS)�_FileInFilezA thin wrapper around an existing file object that
       provides a part of its data as an individual file
       object.
    NcCs�||_||_||_d|_t|dd�|_d|_|dkr>d|fg}d|_g|_d}|j}|D]L\}}||kr||j�	d||df�|j�	d||||f�||7}||}qX||jkr�|j�	d||jdf�dS)Nrr�FT)
r��offsetr'�positionrhr�r��	map_index�mapr�)r�r�r�r'Z	blockinfoZlastposZrealposr8r8r9r�hs(


z_FileInFile.__init__cCsdSr�r8r�r8r8r9r��sz_FileInFile.flushcCsdS�NTr8r�r8r8r9�readable�sz_FileInFile.readablecCsdS)NFr8r�r8r8r9�writable�sz_FileInFile.writablecCs
|j��Sr�)r��seekabler�r8r8r9r��sz_FileInFile.seekablecCs|jS)z*Return the current file position.
        )r�r�r8r8r9r��sz_FileInFile.tellcCs�|tjkr tt|d�|j�|_nj|tjkr\|dkrFt|j|d�|_q�t|j||j�|_n.|tjkr�tt|j||j�d�|_ntd��|jS)z(Seek to a position in the file.
        rzInvalid argument)	�io�SEEK_SET�min�maxr'r��SEEK_CUR�SEEK_ENDr0)r�r��whencer8r8r9r��s


z_FileInFile.seekc	Cs
|dkr|j|j}nt||j|j�}d}|dk�r|j|j\}}}}||jkr`|krhq�nq�q6|jd7_|jt|j�kr6d|_q6t|||j�}|r�|j�||j|�|j�|�}t|�|kr�t	d��||7}n|t
|7}||8}|j|7_q,|S)z!Read data from the file.
        Nr�rr#rY)r'r�r�r�r�r2r�r�r]rr3)	r�r'rW�data�start�stopr�r5rdr8r8r9r]�s,

z_FileInFile.readcCs&|�t|��}||dt|��<t|�Sr�)r]r2)r�rdrWr8r8r9�readinto�sz_FileInFile.readintocCs
d|_dSr�)r�r�r8r8r9r��sz_FileInFile.close)N)N)rnrorprqr�r�r�r�r�r�r�r�r�r]r�r�r8r8r8r9r�bs

r�cseZdZ�fdd�Z�ZS)�ExFileObjectcs&t|j|j|j|j�}t��|�dSr�)r�r��offset_datar'�sparse�superr�)r��tarfile�tarinfor���	__class__r8r9r��s

�zExFileObject.__init__�rnrorpr��
__classcell__r8r8r�r9r��sr�c@seZdZdS)�FilterErrorN)rnrorpr8r8r8r9r��sr�cseZdZ�fdd�Z�ZS)�AbsolutePathErrorcs ||_t��d|j�d��dS)Nzmember z has an absolute path�r�r�r�r��r�r�r�r8r9r��szAbsolutePathError.__init__r�r8r8r�r9r��sr�cseZdZ�fdd�Z�ZS)�OutsideDestinationErrorcs.||_||_t��|j�d|�d�d�dS)Nz would be extracted to �, � which is outside the destination�r��_pathr�r�r��r�r�r%r�r8r9r��s
�z OutsideDestinationError.__init__r�r8r8r�r9r��sr�cseZdZ�fdd�Z�ZS)�SpecialFileErrorcs||_t��|j�d��dS)Nz is a special filer�r�r�r8r9r��szSpecialFileError.__init__r�r8r8r�r9r��sr�cseZdZ�fdd�Z�ZS)�AbsoluteLinkErrorcs||_t��|j�d��dS)Nz! is a symlink to an absolute pathr�r�r�r8r9r��szAbsoluteLinkError.__init__r�r8r8r�r9r��sr�cseZdZ�fdd�Z�ZS)�LinkOutsideDestinationErrorcs.||_||_t��|j�d|�d�d�dS)Nz would link to r�r�r�r�r�r8r9r��s
�z$LinkOutsideDestinationError.__init__r�r8r8r�r9r��sr�cCs�i}|j}tj�|�}|�dtjf�r@|j�dtj�}|d<tj�|�rTt|��tj�tj�	||��}tj�
||g�|kr�t||��|j}|dk	r�|d@}|r�|�
�s�|��r�|d@s�|dM}|dO}n|��s�|��r�d}nt|��||jkr�||d<|�r�|jdk	�rd|d<|jdk	�r*d|d	<|jdk	�r>d|d
<|jdk	�rRd|d<|���sf|���r�tj�|j��r~t|��|���r�tj�	|tj�|�|j�}ntj�	||j�}tj�|�}tj�
||g�|k�r�t||��|S)N�/r�i��@i�����r�r)r*r+r,)r�r{r%�realpathr��sep�lstrip�isabsr�r��
commonpathr�r��isreg�islnk�isdir�issymr�r)r*r+r,�linknamer��dirnamer�)�member�	dest_pathZfor_data�	new_attrsr�Ztarget_pathr�r8r8r9�_get_filtered_attrs�s^




��
r	cCs|Sr�r8)rrr8r8r9�fully_trusted_filter6sr
cCs(t||d�}|r$|jf|ddi��S|S)NF�deep�r	r��rrrr8r8r9�
tar_filter9srcCs(t||d�}|r$|jf|ddi��S|S)NTrFrr
r8r8r9�data_filter?sr)Z
fully_trustedr�r�c@s�eZdZdZedddddddd	d
ddd
ddddddddd�Zdidd�Zedd��Zej	dd��Zedd��Z
e
j	dd��Z
dd�Zeeeeeeeed ed!�
d"d#�Z
d$d%�Zeed&fd'd(�Zd)d*�Zd+d,�Zd-d.�Zed/d0��Zd1d2�Zed3d4��Zed5d6��Zed7d8��Zed9d:��Zed;d<��Zed=d>��Zd?d@�ZdAdB�Z dCdD�Z!dEdF�Z"dGdH�Z#dIdJ�Z$dKdL�Z%dMdN�Z&dOdP�Z'dQdR�Z(dSdT�Z)dUdV�Z*dWdX�Z+dYdZ�Z,d[d\�Z-d]d^�Z.d_d`�Z/dadb�Z0dcdd�Z1dedf�Z2dgdh�Z3dS)jraInformational class which holds the details about an
       archive member given by a tar header block.
       TarInfo objects are returned by TarFile.getmember(),
       TarFile.getmembers() and TarFile.gettarinfo() and are
       usually created internally.
    zName of the archive member.zPermission bits.z6User ID of the user who originally stored this member.z7Group ID of the user who originally stored this member.zSize in bytes.zTime of last modification.zHeader checksum.z�File type. type is usually one of these constants: REGTYPE, AREGTYPE, LNKTYPE, SYMTYPE, DIRTYPE, FIFOTYPE, CONTTYPE, CHRTYPE, BLKTYPE, GNUTYPE_SPARSE.zcName of the target file name, which is only present in TarInfo objects of type LNKTYPE and SYMTYPE.z
User name.zGroup name.zDevice major number.zDevice minor number.zThe tar header starts here.zThe file's data starts here.zMA dictionary containing key-value pairs of an associated pax extended header.zSparse member information.N)r�r�r)r*r'r(�chksum�typerr+r,�devmajor�devminorr�r��pax_headersr�r��_sparse_structs�_link_targetr�cCsj||_d|_d|_d|_d|_d|_d|_t|_d|_	d|_
d|_d|_d|_
d|_d|_d|_i|_dS)zXConstruct a TarInfo object. name is the optional name
           of the member.
        i�rr�N)r�r�r)r*r'r(r�REGTYPErrr+r,rrr�r�r�r�r�r�r8r8r9r�us"zTarInfo.__init__cCs|jS)z(In pax headers, "name" is called "path".�r�r�r8r8r9r%�szTarInfo.pathcCs
||_dSr�rrr8r8r9r%�scCs|jS)z0In pax headers, "linkname" is called "linkpath".�rr�r8r8r9r&�szTarInfo.linkpathcCs
||_dSr�r)r�rr8r8r9r&�scCsd|jj|jt|�fS)Nz<%s %r at %#x>)r�rnr��idr�r8r8r9�__repr__�szTarInfo.__repr__T)
r�r(r�rr)r*r+r,r�_KEEPc
Cs�|	rt�|�}n
t�|�}||
k	r(||_||
k	r6||_||
k	rD||_||
k	rR||_||
k	r`||_||
k	rn||_||
k	r|||_||
k	r�||_	|S)zGReturn a deep copy of self with the given attributes replaced.
        )
�copyZdeepcopyr�r(r�rr)r*r+r,)r�r�r(r�rr)r*r+r,rr�resultr8r8r9r��s(
zTarInfo.replacecCs�|jdkrd}n
|jd@}|j||j|j|j|j|j|j|j|j	|j
|j|jd�
}|dt
kr||d�d�s||dd7<|S)z9Return the TarInfo's attributes as a dictionary.
        N�)
r�r�r)r*r'r(rrrr+r,rrrr�r�)r�r�r)r*r'r(rrrr+r,rr�DIRTYPEr�)r�r��infor8r8r9�get_info�s(

�zTarInfo.get_info�surrogateescapecCsz|��}|��D]\}}|dkrtd|��q|tkrD|�|||�S|tkrZ|�|||�S|tkrn|�||�Std��dS)z<Return a tar header as a string of 512 byte blocks.
        Nz%s may not be Nonezinvalid format)	r#�itemsr0r
�create_ustar_headerr�create_gnu_headerr�create_pax_header)r�rSr6r7r"r��valuer8r8r9�tobuf�sz
TarInfo.tobufcCsnt|d<t|d�||��tkr(td��t|d�||��tkr^|�|d||�\|d<|d<|�|t||�S)z3Return the object as a ustar header block.
        �magicrzlinkname is too longr��prefix)	�POSIX_MAGICr2r1�LENGTH_LINKr0�LENGTH_NAME�_posix_split_name�_create_headerr
)r�r"r6r7r8r8r9r&�szTarInfo.create_ustar_headercCs�t|d<d}t|d�||��tkr<||�|dt||�7}t|d�||��tkrl||�|dt||�7}||�|t	||�S)z:Return the object as a GNU header block sequence.
        r+r�rr�)
�	GNU_MAGICr2r1r.�_create_gnu_long_header�GNUTYPE_LONGLINKr/�GNUTYPE_LONGNAMEr1r)r�r"r6r7rWr8r8r9r'�szTarInfo.create_gnu_headerc
	Cs*t|d<|j��}ddtfddtfddfD]j\}}}||kr>q*z||�dd	�Wn$tk
rv||||<Yq*YnXt||�|kr*||||<q*d
D]`\}}||kr�d||<q�||}d|kr�d|d
kr�nn
t|t	�r�t
|�||<d||<q�|�r|�|t|�}	nd}	|	|�
|tdd�S)z�Return the object as a ustar header block. If it cannot be
           represented this way, prepend a pax extended header sequence
           with supplement information.
        r+r�r%rr&)r+r+� )r,r,r6rDrE))r)rB)r*rB)r'�)r(r7rrBr#r�r�)r-rrr/r.r1�UnicodeEncodeErrorr2�
isinstance�float�str�_create_pax_generic_header�XHDTYPEr1r
)
r�r"r6rr�Zhnamer5rR�valrWr8r8r9r(s8
�
*
zTarInfo.create_pax_headercCs|�|td�S)zAReturn the object as a pax global header block sequence.
        r/)r<�XGLTYPE)�clsrr8r8r9�create_pax_global_header7sz TarInfo.create_pax_global_headercCs~|�d�}tdt|��D]T}d�|d|��}d�||d��}t|�||��tkrt|�||��tkrqvqtd��||fS)zUSplit a name longer than 100 chars into a prefix
           and a name part.
        r�r#Nzname is too long)�splitrHr2r�r1�
LENGTH_PREFIXr/r0)r�r�r6r7Z
componentsrMr,r8r8r9r0=s
�zTarInfo._posix_split_namecCs�|�d�ttfk}|r@t|�dd�d|�}t|�dd�d|�}ntdd||�}tdd||�}|�dt�}|dkrxtd��t|�d	d�d
||�t|�dd�d@d|�t|�d
d�d|�t|�dd�d|�t|�dd�d|�t|�dd�d|�d|t|�dd�d
||�|�dt�t|�dd�d||�t|�dd�d||�t|�dd�d|�t|�dd�d|�t|�dd�d||�g}t�	dt
d�|��}	t|	t
d��d}
|	dd�t
d|
d�|	dd�}	|	S) z�Return a header block. info is a dictionary with file
           information, format must be one of the *_FORMAT constants.
        rrrrBrr�NzTarInfo.type must not be Noner�rr�r r)r*r'r7r(s        rr+r+r6r,r,rz%dsr�i����z%06orDi����)�get�CHRTYPE�BLKTYPErTr:rr0r-rVr�r�r�rXrO)r"rSr6r7Zhas_device_fieldsrrZfiletype�partsrWrr8r8r9r1Ms:
�&zTarInfo._create_headercCs.tt|�t�\}}|dkr*|t|t7}|S)zdReturn the string payload filled with zero bytes
           up to the next 512 byte border.
        r)r\r2r�r3)Zpayloadrbrcr8r8r9�_create_payloadwszTarInfo._create_payloadcCsR|�||�t}i}d|d<||d<t|�|d<t|d<|�|t||�|�|�S)zTReturn a GNUTYPE_LONGNAME or GNUTYPE_LONGLINK sequence
           for name.
        z
././@LongLinkr�rr'r+)r1r3r2r2r1r
rH)r@r�rr6r7r"r8r8r9r3�s�zTarInfo._create_gnu_long_headerc	Cs2d}|��D]8\}}z|�dd�Wqtk
rBd}YqFYqXqd}|rV|d7}|��D]�\}}|�d�}|r�|�|d�}n
|�d�}t|�t|�d}d	}	}
|tt|
��}	|	|
kr�q�|	}
q�|tt|
�d
�d|d|d
7}q^i}d|d<||d<t|�|d<t|d<|�|td
d�|�	|�S)z�Return a POSIX.1-2008 extended or global header sequence
           that contains a list of keyword, value pairs. The values
           must be strings.
        Fr/rETr�s21 hdrcharset=BINARY
r$r�rrD� �=�
z././@PaxHeaderr�rr'r+r�)
r%r1r8r2r;rOr-r1r
rH)r@rrr6Zbinary�keywordr)Zrecords�lrLr>r"r8r8r9r<�s<

(�z"TarInfo._create_pax_generic_headerc	Csvt|�dkrtd��t|�tkr(td��|�t�tkr>td��t|dd��}|t|�krbt	d��|�}t
|dd�||�|_t|dd	��|_t|d	d
��|_
t|d
d��|_t|dd��|_t|dd��|_||_|dd
�|_t
|d
d�||�|_t
|dd�||�|_t
|dd�||�|_t|dd��|_t|dd��|_t
|dd�||�}|jtk�r�|j�d��r�t|_|jtk�r8d}g}td�D]l}	z0t|||d��}
t||d|d��}Wntk
�r�Y�qYnX|�|
|f�|d7}�q�t|d�}t|dd��}
|||
f|_ |�!��rP|j�"d�|_|�rr|jt#k�rr|d|j|_|S)zAConstruct a TarInfo object from a 512 byte bytes object.
        rzempty headerztruncated headerzend of file header��zbad checksumr�l�t�|��ii	i)iIiQiYi�r�i�r�r7�i�i�i�)$r2rrr�rs�countr3rtrNrXrKr?r�r�r)r*r'r(rrrr+r,rr�AREGTYPEr�r!�GNUTYPE_SPARSErHr0r��boolrr�rstrip�	GNU_TYPES)r@rWr6r7r�objr,r��structsrMr��numbytes�
isextended�origsizer8r8r9�frombuf�sZ
zTarInfo.frombufcCs8|j�t�}|�||j|j�}|j��t|_|�|�S)zOReturn the next TarInfo object from TarFile object
           tarfile.
        )	r�r]r�rar6r7r�r��_proc_member)r@r�rWr\r8r8r9�fromtarfileszTarInfo.fromtarfilecCsT|jttfkr|�|�S|jtkr,|�|�S|jtttfkrF|�	|�S|�
|�SdS)zYChoose the right processing method depending on
           the type and call it.
        N)rr5r4�
_proc_gnulongrX�_proc_sparser=r?�SOLARIS_XHDTYPE�	_proc_pax�
_proc_builtin)r�r�r8r8r9rbs



zTarInfo._proc_membercCsR|j��|_|j}|��s$|jtkr4||�|j�7}||_|�	|j
|j|j�|S)zfProcess a builtin type or an unknown type which
           will be treated as a regular file.
        )
r�r�r�rr�SUPPORTED_TYPES�_blockr'r��_apply_pax_inforr6r7)r�r�r�r8r8r9rh&szTarInfo._proc_builtincCs�|j�|�|j��}z|�|�}Wntk
r>td��YnX|j|_|jt	krft
||j|j�|_
n|jtkr�t
||j|j�|_|S)zSProcess the blocks that hold a GNU longname
           or longlink member.
        � missing or bad subsequent header)r�r]rjr'rcrrur�rr5r?r6r7r�r4r)r�r�rW�nextr8r8r9rd7s

zTarInfo._proc_gnulongc
	Cs�|j\}}}|`|r�|j�t�}d}td�D]n}z0t|||d��}t||d|d��}	Wntk
rzYq�YnX|r�|	r�|�||	f�|d7}q,t|d�}q||_	|j�
�|_|j|�|j
�|_||_
|S)z8Process a GNU sparse header plus extra headers.
        r�r7rUi�)rr�r]r�rHrNr0r�rYr�r�r�rjr'r�)
r�r�r]r_r`rWr�rMr�r^r8r8r9reMs(
zTarInfo._proc_sparsecCs.|j�|�|j��}|jtkr&|j}n
|j��}t�	d|�}|dk	rX|�
d��d�|d<|�d�}|dkrr|j
}nd}t�d�}d}|�||�}|s��q6|��\}	}
t|	�}	|	dkr�td	��||�d
�d|�d�|	d�}|�|
dd|j�}
|
tk�r|�|||j
|j�}n|�|dd|j�}|||
<||	7}q�z|�|�}Wntk
�rbtd��YnXd|k�r||�||�nHd
|k�r�|�|||�n.|�d�dk�r�|�d�dk�r�|�|||�|jttfk�r*|� ||j
|j�|j!|_!d|k�r*|j"}
|�#��s|jt$k�r$|
|�|j�7}
|
|_!|S)zVProcess an extended or global header as described in
           POSIX.1-2008.
        s\d+ hdrcharset=([^\n]+)\nNr#r/�
hdrcharsetZBINARYs(\d+) ([^=]+)=rrGr$rl�GNU.sparse.map�GNU.sparse.sizezGNU.sparse.major�1zGNU.sparse.minorrFr')%r�r]rjr'rr?rr�re�search�groupr=rDr6�compile�match�groupsrIrKrgr��_decode_pax_fieldr7�PAX_NAME_FIELDSrcrru�_proc_gnusparse_01�_proc_gnusparse_00�_proc_gnusparse_10r=rfrkr�r�rri)r�r�rWrrwror6Zregexr�r5rLr)rmr�r8r8r9rgish



$	
�
�
�


 
zTarInfo._proc_paxcCshg}t�d|�D]}|�t|�d���qg}t�d|�D]}|�t|�d���q:tt||��|_dS)z?Process a GNU tar extended sparse header, version 0.0.
        s\d+ GNU.sparse.offset=(\d+)\nr#s\d+ GNU.sparse.numbytes=(\d+)\nN)rs�finditerr�rIru�list�zipr�)r�rmrrWZoffsetsrwr^r8r8r9r|�szTarInfo._proc_gnusparse_00cCs@dd�|d�d�D�}tt|ddd�|ddd���|_dS)z?Process a GNU tar extended sparse header, version 0.1.
        cSsg|]}t|��qSr8)rI)�.0�xr8r8r9�
<listcomp>�sz.TarInfo._proc_gnusparse_01.<locals>.<listcomp>rp�,Nr$r#)rBrr�r�)r�rmrr�r8r8r9r{�szTarInfo._proc_gnusparse_01cCs�d}g}|j�t�}|�dd�\}}t|�}t|�|dkrtd|krT||j�t�7}|�dd�\}}|�t|��q,|j��|_t	t
|ddd�|ddd���|_dS)z?Process a GNU tar extended sparse header, version 1.0.
        NrKr#r$)r�r]r�rBrIr2r�r�r�rr�r�)r�rmrr�Zfieldsr�rWZnumberr8r8r9r}�szTarInfo._proc_gnusparse_10c	Cs�|��D]�\}}|dkr&t|d|�q|dkr@t|dt|��q|dkrZt|dt|��q|tkr|tkr�zt||�}Wntk
r�d}YnX|dkr�|�d�}t|||�q|��|_dS)	zoReplace fields with supplemental information from a previous
           pax extended or global header.
        zGNU.sparse.namer%rqr'zGNU.sparse.realsizerr�N)	r%�setattrrI�
PAX_FIELDS�PAX_NUMBER_FIELDSr0rZrr)r�rr6r7rLr)r8r8r9rk�s"

zTarInfo._apply_pax_infocCs4z|�|d�WStk
r.|�||�YSXdS)z1Decode a single field from a pax record.
        rEN)r=�UnicodeDecodeError)r�r)r6Zfallback_encodingZfallback_errorsr8r8r9ry	szTarInfo._decode_pax_fieldcCs"t|t�\}}|r|d7}|tS)z_Round up a byte count by BLOCKSIZE and return it,
           e.g. _block(834) => 1024.
        r#)r\r�)r�rVrbrcr8r8r9rjszTarInfo._blockcCs
|jtkS�z4Return True if the Tarinfo object is a regular file.)r�
REGULAR_TYPESr�r8r8r9rsz
TarInfo.isregcCs|��Sr�)rr�r8r8r9�isfileszTarInfo.isfilecCs
|jtkS)z!Return True if it is a directory.)rr!r�r8r8r9r"sz
TarInfo.isdircCs
|jtkS)z%Return True if it is a symbolic link.)r�SYMTYPEr�r8r8r9r&sz
TarInfo.issymcCs
|jtkS)z!Return True if it is a hard link.)r�LNKTYPEr�r8r8r9r*sz
TarInfo.islnkcCs
|jtkS)z(Return True if it is a character device.)rrEr�r8r8r9�ischr.sz
TarInfo.ischrcCs
|jtkS)z$Return True if it is a block device.)rrFr�r8r8r9�isblk2sz
TarInfo.isblkcCs
|jtkS)zReturn True if it is a FIFO.)r�FIFOTYPEr�r8r8r9�isfifo6szTarInfo.isfifocCs
|jdk	Sr�)r�r�r8r8r9�issparse:szTarInfo.issparsecCs|jtttfkS)zCReturn True if it is one of character device, block device or FIFO.)rrErFr�r�r8r8r9�isdev=sz
TarInfo.isdev)r�)4rnrorprq�dict�	__slots__r��propertyr%�setterr&rrr�r#rrr*r&r'r(�classmethodrAr0�staticmethodr1rHr3r<rarcrbrhrdrergr|r{r}rkryrjrr�rrrr�r�r�r�r�r8r8r8r9rRs��




�
1

)
	

2
>

h	c
@s�eZdZdZdZdZdZdZeZ	e
ZdZe
ZeZdZdfdd	�Zedddefd
d��Zedgdd
��Zedhdd��Zedidd��Zedjdd��Zddddd�Zdd�Zdd�Zdd�Zd d!�Zdkd"d#�Zdldd%�d&d'�Z dmdd(�d)d*�Z!dnd+d,�Z"d-d.�Z#doddd0�d1d2�Z$dpddd0�d4d5�Z%d6d7�Z&d8d9�Z'd:d;�Z(d<d=�Z)d>d?�Z*dqd@dA�Z+dBdC�Z,dDdE�Z-dFdG�Z.dHdI�Z/dJdK�Z0dLdM�Z1dNdO�Z2dPdQ�Z3dRdS�Z4dTdU�Z5drdVdW�Z6dXdY�Z7dsdZd[�Z8d\d]�Z9d^d_�Z:d`da�Z;dbdc�Z<ddde�Z=dS)trz=The TarFile Class provides an interface to tar archives.
    rFr#Nrxr$c
Cs�ddddd�}||krtd��||_|||_|sh|jdkrTtj�|�sTd|_d|_t||j�}d	|_n@|d
kr�t|d�r�t	|j
ttf�r�|j
}t|d�r�|j|_d
|_|r�tj�
|�nd
|_
||_|d
k	r�||_|d
k	r�||_|d
k	r�||_|d
k	r�||_|d
k	�r||_|	|_|
d
k	�r0|jtk�r0|
|_ni|_|d
k	�rF||_|d
k	�rV||_|
|_d	|_g|_d	|_|j��|_i|_z�|jdk�r�d
|_ |�!�|_ |jdk�r2|j�"|j�z|j�#|�}|j�$|�WnXt%k
�r�|j�"|j�Y�q2Yn0t&k
�r,}zt't|���W5d
}~XYnX�q�|jdk�r|d
|_|j�r||j�(|j�)��}|j�*|�|jt+|�7_Wn&|j�s�|j�,�d
|_�YnXd
S)a�Open an (uncompressed) tar archive `name'. `mode' is either 'r' to
           read from an existing archive, 'a' to append data to an existing
           file or 'w' to create a new file overwriting an existing one. `mode'
           defaults to 'r'.
           If `fileobj' is given, it is used for reading or writing data. If it
           can be determined, `mode' is overridden by `fileobj's mode.
           `fileobj' is not closed, when TarFile is closed.
        �rbzr+b�wbZxb�rx�aryr��!mode must be 'r', 'a', 'w' or 'x'r�ryFNr�r�Trx�r�ryr�)-r0r��_moder{r%�exists�	bltn_openr�r�r9r�r;rO�abspathr�rSr��dereference�ignore_zerosr6r7rr�debug�
errorlevel�copybufsizer��members�_loadedr�r��inodes�firstmemberrmr�rcr�rtrrrArr^r2r�)r�r�r�r�rSr�r�r�r6r7rr�r�r�Zmodes�erWr8r8r9r�^s�
�





"
zTarFile.__init__c

s�|s|std��|dkr��fdd�}t�j|d�D]j}t��j|�}|dk	rV|��}	z||d|f|�WSttfk
r�|dk	r�|�|	�Yq2Yq2Xq2td���nd	|k�r|�d	d
�\}
}|
p�d}
|p�d}|�jkr�t��j|�}ntd|��|||
|f|�Sd
|k�r�|�d
d
�\}
}|
�p.d}
|�p8d}|
dk�rLtd��t	||
|||�}z�||
|f|�}Wn|�
��YnXd|_|S|dk�r��j|||f|�Std��dS)a�Open a tar archive for reading, writing or appending. Return
           an appropriate TarFile class.

           mode:
           'r' or 'r:*' open for reading with transparent compression
           'r:'         open for reading exclusively uncompressed
           'r:gz'       open for reading with gzip compression
           'r:bz2'      open for reading with bzip2 compression
           'r:xz'       open for reading with lzma compression
           'a' or 'a:'  open for appending, creating the file if necessary
           'w' or 'w:'  open for writing without compression
           'w:gz'       open for writing with gzip compression
           'w:bz2'      open for writing with bzip2 compression
           'w:xz'       open for writing with lzma compression

           'x' or 'x:'  create a tarfile exclusively without compression, raise
                        an exception if the file is already created
           'x:gz'       create a gzip compressed tarfile, raise an exception
                        if the file is already created
           'x:bz2'      create a bzip2 compressed tarfile, raise an exception
                        if the file is already created
           'x:xz'       create an lzma compressed tarfile, raise an exception
                        if the file is already created

           'r|*'        open a stream of tar blocks with transparent compression
           'r|'         open an uncompressed stream of tar blocks for reading
           'r|gz'       open a gzip compressed stream of tar blocks
           'r|bz2'      open a bzip2 compressed stream of tar blocks
           'r|xz'       open an lzma compressed stream of tar blocks
           'w|'         open an uncompressed stream for writing
           'w|gz'       open a gzip compressed stream for writing
           'w|bz2'      open a bzip2 compressed stream for writing
           'w|xz'       open an lzma compressed stream for writing
        znothing to open)rx�r:*cs�j|dkS)N�taropen)�	OPEN_METH)r��r@r8r9�not_compressed�sz$TarFile.open.<locals>.not_compressed)�keyNrxz%file could not be opened successfully�:r#r�r��|rwzmode must be 'r' or 'w'Fr�zundiscernible mode)
r0�sortedr�rhr�rrr�rBr�r�r�r�)
r@r�r�r�ra�kwargsr�r��funcZ	saved_pos�filemode�streamr�r8r�r9r�sP%







zTarFile.opencKs |dkrtd��||||f|�S)zCOpen uncompressed tar archive name for reading or writing.
        r�r�)r0)r@r�r�r�r�r8r8r9r�(szTarFile.taropenr�cKs�|dkrtd��zddlm}Wntk
r<td��YnXz|||d||�}Wn.tk
r�|dk	r||dkr|td	���YnXz|j|||f|�}WnBtk
r�|��|dkr�td	���Yn|���YnXd
|_	|S)zkOpen gzip compressed tar archive name for reading or writing.
           Appending is not allowed.
        �rxryr��mode must be 'r', 'w' or 'x'r)�GzipFilezgzip module is not availablerdNrxr�F)
r0Zgzipr�r�rr�rr�r�r�)r@r�r�r��
compresslevelr�r�r�r8r8r9�gzopen0s0zTarFile.gzopenc	Ks�|dkrtd��zddlm}Wntk
r<td��YnX||pF|||d�}z|j|||f|�}WnFttfk
r�|��|dkr�t	d���Yn|���YnXd	|_
|S)
zlOpen bzip2 compressed tar archive name for reading or writing.
           Appending is not allowed.
        r�r�r)�BZ2Filer�)r�rxznot a bzip2 fileF)r0r�r�r�rr�r��EOFErrorr�rr�)r@r�r�r�r�r�r�r�r8r8r9�bz2openQs&zTarFile.bz2openc		Ks�|dkrtd��zddlm}m}Wntk
r@td��YnX||pJ|||d�}z|j|||f|�}WnF|tfk
r�|��|dkr�t	d���Yn|���YnXd	|_
|S)
zkOpen lzma compressed tar archive name for reading or writing.
           Appending is not allowed.
        r�r�r)�LZMAFiler�r�)�presetrxznot an lzma fileF)r0r�r�r�r�rr�r�r�rr�)	r@r�r�r�r�r�r�r�r�r8r8r9�xzopenms&zTarFile.xzopenr�r�r�r�)r�r�r�r�cCs�|jr
dSd|_z`|jdkrn|j�ttd�|jtd7_t	|jt
�\}}|dkrn|j�tt
|�W5|js�|j��XdS)zlClose the TarFile. In write-mode, two finishing zero blocks are
           appended to the archive.
        NTr�r$r)r�r�r�r�r�r^r3r�r�r\�
RECORDSIZE)r�rbrcr8r8r9r��s
z
TarFile.closecCs"|�|�}|dkrtd|��|S)aReturn a TarInfo object for member `name'. If `name' can not be
           found in the archive, KeyError is raised. If a member occurs more
           than once in the archive, its last occurrence is assumed to be the
           most up-to-date version.
        Nzfilename %r not found)�
_getmember�KeyError)r�r�r�r8r8r9�	getmember�s
zTarFile.getmembercCs|��|js|��|jS)z�Return the members of the archive as a list of TarInfo objects. The
           list has the same order as the members in the archive.
        )�_checkr��_loadr�r�r8r8r9�
getmembers�szTarFile.getmemberscCsdd�|��D�S)z�Return the members of the archive as a list of their names. It has
           the same order as the list returned by getmembers().
        cSsg|]
}|j�qSr8r)r�r�r8r8r9r��sz$TarFile.getnames.<locals>.<listcomp>)r�r�r8r8r9�getnames�szTarFile.getnamescCs^|�d�|dk	r|j}|dkr$|}tj�|�\}}|�tjd�}|�d�}|��}||_	|dkr�|j
stt�|�}q�t�|�}nt�
|���}d}|j}t�|�r�|j|jf}	|j
s�|jdkr�|	|jkr�||j|	kr�t}
|j|	}nt}
|	dr�||j|	<nht�|��rt}
nVt�|��r"t}
nDt�|��r>t}
t�|�}n(t�|��rPt}
nt� |��rbt!}
ndS||_||_"|j#|_$|j%|_&|
tk�r�|j'|_(nd|_(|j)|_*|
|_+||_,t-�r�zt-�.|j$�d|_/Wnt0k
�r�YnXt1�rzt1�2|j&�d|_3Wnt0k
�rYnX|
tt!fk�rZt4td��rZt4td��rZt�5|j6�|_7t�8|j6�|_9|S)	a�Create a TarInfo object from the result of os.stat or equivalent
           on an existing file. The file is either named by `name', or
           specified as a file object `fileobj' with a file descriptor. If
           given, `arcname' specifies an alternative name for the file in the
           archive, otherwise, the name is taken from the 'name' attribute of
           'fileobj', or the 'name' argument. The name should be a text
           string.
        �awxNr�r�r#r�major�minor):r�r�r{r%�
splitdriver�r�r�r�r�r��lstat�stat�fstat�fileno�st_mode�S_ISREG�st_ino�st_dev�st_nlinkr�r�r�S_ISDIRr!�S_ISFIFOr��S_ISLNKr��readlink�S_ISCHRrE�S_ISBLKrFr��st_uidr)�st_gidr*�st_sizer'�st_mtimer(rr�pwd�getpwuidr+r��grpZgetgrgidr,r�r��st_rdevrr�r)r�r��arcnamer�Zdrvr�ZstatresrZstmd�inoderr8r8r9�
gettarinfo�s�	


��

zTarFile.gettarinfoT)r�cCs*|��|dkr|}|D�]
}|r�|jdkr6td�ntt�|j��td|jpT|j|jp^|jf�|�	�sv|�
�r�tdd|j|jf�ntd|j
�|jdkr�td�ntdt�|j�dd	��t|j|��r�d
nd�|�r|���rtd|j�|���rtd
|j�t�qdS)aPrint a table of contents to sys.stdout. If `verbose' is False, only
           the names of the members are printed. If it is True, an `ls -l'-like
           output is produced. `members' is optional and must be a subset of the
           list returned by getmembers().
        Nz
??????????z%s/%sz%10sz%d,%dz%10dz????-??-?? ??:??:??z%d-%02d-%02d %02d:%02d:%02dr�r�r�z-> zlink to )r�r�rlr�r�r+r)r,r*r�r�rrr'r(r��	localtimer�rrrrrk)r��verboser�r�r8r8r9r's8



��

�

zTarFile.list��filterc	Cs6|�d�|dkr|}|jdk	rFtj�|�|jkrF|�dd|�dS|�d|�|�||�}|dkrz|�dd|�dS|dk	r�||�}|dkr�|�dd|�dS|��r�t|d��}|�	||�W5QRXn`|�
��r(|�	|�|�r2tt�|��D]*}|j
tj�||�tj�||�||d	�q�n
|�	|�dS)
a!Add the file `name' to the archive. `name' may be any type of file
           (directory, fifo, symbolic link, etc.). If given, `arcname'
           specifies an alternative name for the file in the archive.
           Directories are added recursively by default. This can be avoided by
           setting `recursive' to False. `filter' is a function
           that expects a TarInfo object argument and returns the changed
           TarInfo object, if it returns None the TarInfo object will be
           excluded from the archive.
        r�Nr$ztarfile: Skipped %rr#ztarfile: Unsupported type %r�tarfile: Excluded %rr�r�)r�r�r{r%r��_dbgr�rr��addfilerr��listdir�addr�)r�r�r��	recursiver�r��fr8r8r9r�Ms8



�
zTarFile.addcCs�|�d�t�|�}|�|j|j|j�}|j�|�|jt	|�7_|j
}|dk	r�t||j|j|d�t
|jt�\}}|dkr�|j�tt|�|d7}|j|t7_|j�|�dS)aAdd the TarInfo object `tarinfo' to the archive. If `fileobj' is
           given, it should be a binary file, and tarinfo.size bytes are read
           from it and added to the archive. You can create TarInfo objects
           directly, or by using gettarinfo().
        r�N)rarr#)r�rr*rSr6r7r�r^r�r2r�r[r'r\r�r3r�r�)r�r�r�rWrarbrcr8r8r9r��s

zTarFile.addfilec	CsB|dkr�|j}|dkr�tj�d�}|dkr�ztt�}Wntk
rJYnBXddl}|jddd�}|�|�	|�W5QRX|jdddd�}|r�zt
|}Wn&tk
r�td|�d	��d�YnX||_|St
r�t�d
t�tStSt|t�r�td��|St|��r
|Sz
t
|WStk
�r<td|�d	��d�YnXdS)NZ PYTHON_TARFILE_EXTRACTION_FILTERr)�#)Z
interpolationZcomment_prefixesr�r�)Zfallbackzfilter z
 not foundaThe default behavior of tarfile extraction has been changed to disallow common exploits (including CVE-2007-4559). By default, absolute/parent paths are disallowed and some mode bits are cleared. See https://access.redhat.com/articles/7004769 for more details.zrString names are not supported for TarFile.extraction_filter. Use a function such as tarfile.data_filter directly.)�extraction_filterr{�environrDr��_CONFIG_FILENAME�FileNotFoundError�configparserZConfigParserZ	read_file�_NAMED_FILTERSr�r0�_RH_SAFER_DEFAULT�warnings�warn�RuntimeWarningrr
r9r;�	TypeError�callable)r�r�r��filer�Zconfr8r8r9�_get_filter_function�sZ���	
�

zTarFile._get_filter_function�.)�
numeric_ownerr�cCs�g}|�|�}|dkr|}|D]F}|�|||�}|dkr:q|��rL|�|�|j|||��|d�q|jdd�dd�|D]n}tj�||j	�}	z,|j
||	|d�|�||	�|�||	�Wq|t
k
r�}
z|�|
�W5d}
~
XYq|Xq|dS)a�Extract all members from the archive to the current working
           directory and set owner, modification time and permissions on
           directories afterwards. `path' specifies a different directory
           to extract to. `members' is optional and must be a subset of the
           list returned by getmembers(). If `numeric_owner` is True, only
           the numbers for user/group names are used and not the names.

           The `filter` function will be called on each member just
           before extraction.
           It can return a changed TarInfo or None to skip the member.
           String names of common filters are accepted.
        N��	set_attrsrcSs|jSr�r)r�r8r8r9�<lambda>�r�z$TarFile.extractall.<locals>.<lambda>T)r��reverse)r)r�_get_extract_tarinforr��_extract_one�sortr{r%r�r��chown�utime�chmodr
�_handle_nonfatal_error)r�r%r�rr�Zdirectories�filter_functionrr��dirpathr�r8r8r9�
extractall�s,

�zTarFile.extractallr�cCs4|�|�}|�|||�}|dk	r0|�||||�dS)a�Extract a member from the archive to the current working directory,
           using its full name. Its file information is extracted as accurately
           as possible. `member' may be a filename or a TarInfo object. You can
           specify a different directory using `path'. File attributes (owner,
           mtime, mode) are set unless `set_attrs' is False. If `numeric_owner`
           is True, only the numbers for user/group names are used and not
           the names.

           The `filter` function will be called before extraction.
           It can return a changed TarInfo or None to skip the member.
           String names of common filters are accepted.
        N)rrr
)r�rr%r	rr�rr�r8r8r9�extract�s
zTarFile.extractc
Cs�t|t�r|�|�}n|}|}z|||�}WnZttfk
r\}z|�|�W5d}~XYn,tk
r�}z|�|�W5d}~XYnX|dkr�|�dd|j	�dS|�
�r�t�|�}tj
�||j�|_|S)z@Get filtered TarInfo (or None) from member, which might be a strNr$r�)r9r;r�r�r��_handle_fatal_errorr
rr�r�rrr{r%r�rr)r�rrr%r�Z
unfilteredr�r8r8r9r	s"

zTarFile._get_extract_tarinfoc
Cs�|�d�z"|j|tj�||j�||d�WnVtk
rX}z|�|�W5d}~XYn,tk
r�}z|�	|�W5d}~XYnXdS)z%Extract from filtered tarinfo to diskrxrN)
r��_extract_memberr{r%r�r�r�rr
r)r�r�r%r	rr�r8r8r9r
%	s
�
zTarFile._extract_onecCs"|jdkr�n|�dd|�dS)z=Handle non-fatal error (ExtractError) according to errorlevelr#�tarfile: %sN)r�r��r�r�r8r8r9r2	s
zTarFile._handle_nonfatal_errorcCsn|jdkr�n\t|t�rP|jdkr6|�dd|j�qj|�dd|j|jf�n|�ddt|�j|f�dS)z1Handle "fatal" error according to self.errorlevelrNr#rztarfile: %s %rztarfile: %s %s)r�r9r��filenamer��strerrorrrnrr8r8r9r9	s


zTarFile._handle_fatal_errorcCs�|�d�t|t�r |�|�}n|}|��s6|jtkrB|�||�S|��sR|�	�rzt|j
t�rhtd��q~|�
|�|��SndSdS)z�Extract a member from the archive as a file object. `member' may be
           a filename or a TarInfo object. If `member' is a regular file or a
           link, an io.BufferedReader object is returned. Otherwise, None is
           returned.
        rxz'cannot extract (sym)link as file objectN)r�r9r;r�rrri�
fileobjectrrr�r�r	�extractfile�_find_link_target)r�rr�r8r8r9rE	s


zTarFile.extractfilecCsT|�d�}|�dtj�}tj�|�}|r>tj�|�s>t�|�|��sN|�	�rh|�
dd|j|jf�n|�
d|j�|�
�r�|�||�n�|��r�|�||�nx|��r�|�||�nb|��s�|��r�|�||�nD|��s�|�	�r�|�||�n&|jtk�r|�||�n|�||�|�rP|�|||�|�	��sP|�||�|�||�dS)z\Extract the TarInfo object tarinfo to a physical
           file called targetpath.
        r�r#z%s -> %sN)rZr�r{r�r%rr��makedirsrrr�r�rr�makefiler�makedirr��makefifor�r��makedev�makelinkrri�makeunknownrrr)r�r��
targetpathr	rZ	upperdirsr8r8r9rd	s4


zTarFile._extract_membercCs@z&|jdkrt�|�nt�|d�Wntk
r:YnXdS)z,Make a directory called targetpath.
        Ni�)r�r{�mkdir�FileExistsError�r�r�r'r8r8r9r"�	s
zTarFile.makedirc	Cs�|j}|�|j�|j}t|d��b}|jdk	rn|jD]"\}}|�|�t|||t|�q4|�|j�|�	�nt|||jt|�W5QRXdS)z'Make a file called targetpath.
        r�N)
r�r�r�r�r�r�r[rr'�truncate)r�r�r'�sourcera�targetr�r'r8r8r9r!�	s


zTarFile.makefilecCs"|�||�|�dd|j�dS)zYMake a file from a TarInfo object with an unknown type
           at targetpath.
        r#z9tarfile: Unknown file type %r, extracted as regular file.N)r!r�rr*r8r8r9r&�	s�zTarFile.makeunknowncCs"ttd�rt�|�ntd��dS)z'Make a fifo called targetpath.
        �mkfifozfifo not supported by systemN)r�r{r.r
r*r8r8r9r#�	s
zTarFile.makefifocCsjttd�rttd�std��|j}|dkr.d}|��rB|tjO}n
|tjO}t�||t�	|j
|j��dS)z<Make a character or block device called targetpath.
        �mknodr$z'special devices not supported by systemNr�)r�r{r
r�r�r��S_IFBLK�S_IFCHRr/r$rr)r�r�r'r�r8r8r9r$�	s
�zTarFile.makedevcCs�zb|��r0tj�|�r t�|�t�|j|�n0tj�|j�rNt�	|j|�n|�
|�|�|�WnHtk
r�z|�
|�|�|�Wnt
k
r�td��YnXYnXdS)z�Make a (symbolic) link called targetpath. If it cannot be created
          (platform limitation), we try to make a copy of the referenced file
          instead of a link.
        z%unable to resolve link inside archiveN)rr{r%�lexists�unlink�symlinkrr�r�linkrr�symlink_exceptionr�r
r*r8r8r9r%�	s"
��zTarFile.makelinkcCs�ttd�r�t��dkr�|j}|j}|s�ztrB|jrBt�|j�d}Wntk
rXYnXzt	rv|j
rvt	�|j
�d}Wntk
r�YnX|dkr�d}|dkr�d}z4|��r�ttd�r�t�
|||�nt�|||�Wntk
r�td��YnXdS)z�Set owner of targetpath according to tarinfo. If numeric_owner
           is True, use .gid/.uid instead of .gname/.uname. If numeric_owner
           is False, fall back to .gid/.uid when the search based on name
           fails.
        �geteuidrr$Nr;�lchownzcould not change owner)r�r{r7r*r)r�r,Zgetgrnamr�r�r+�getpwnamrr8rr�r
)r�r�r'r�g�ur8r8r9r�	s0

z
TarFile.chowncCsB|jdkrdSzt�||j�Wntk
r<td��YnXdS)zASet file permissions of targetpath according to tarinfo.
        Nzcould not change mode)r�r{rr�r
r*r8r8r9r
s
z
TarFile.chmodcCsV|j}|dkrdSttd�s dSzt�|||f�Wntk
rPtd��YnXdS)zBSet modification time of targetpath according to tarinfo.
        Nrz"could not change modification time)r(r�r{rr�r
)r�r�r'r(r8r8r9r
s
z
TarFile.utimec
Cs�|�d�|jdk	r$|j}d|_|S|j|j��krZ|j�|jd�|j�d�sZtd��d}z|j�	|�}W�q�t
k
r�}z6|jr�|�dd|j|f�|jt
7_WY�q^W5d}~XY�q�tk
�r6}zR|j�r|�dd|j|f�|jt
7_WY� q^n|jdk�r&tt|���W5d}~XYn�tk
�r^|jdk�rZtd��Ynjtk
�r�}z|jdk�r�tt|���W5d}~XYn0tk
�r�}ztt|���W5d}~XYnX�q�q^|dk	�r�|j�|�nd	|_|S)
z�Return the next member of the archive as a TarInfo object, when
           TarFile is opened for reading. Return None if there is no more
           available.
        ZraNr#rYr$z0x%X: %srz
empty fileT)r�r�r�r�r�r�r]rr�rcrtr�r�r�rKr;rrrsrur�r�r�)r��mr�r�r8r8r9rm'
sJ



zTarFile.nextc	Cs�|��}d}|dk	rHz|�|�}Wntk
r:d}YnX|d|�}|rXtj�|�}t|�D]D}|rz|j|jkr`d}q`|r�tj�|j�}n|j}||kr`|Sq`|r�t|��dS)z}Find an archive member by name from bottom to top.
           If tarinfo is given, it is used as the starting point.
        FNT)	r��indexr0r{r%�normpath�reversedr�r�)	r�r�r��	normalizer�Zskippingr=r�member_namer8r8r9r�]
s,

zTarFile._getmembercCs|��}|dkrqqd|_dS)zWRead through the entire archive file and look for readable
           members.
        NT)rmr�r�r8r8r9r��
sz
TarFile._loadcCs:|jrtd|jj��|dk	r6|j|kr6td|j��dS)znCheck if TarFile is still open, and if the operation's mode
           corresponds to TarFile's mode.
        z%s is closedNzbad operation for mode %r)r�r�r�rnr�)r�r�r8r8r9r��
szTarFile._checkcCs`|��r.d�tdtj�|j�|jf��}d}n
|j}|}|j||dd�}|dkr\t	d|��|S)zZFind the target member of a symlink or hardlink member in the
           archive.
        r�NT)r�r@zlinkname %r not found)
rr�r�r{r%rr�rr�r�)r�r�r�limitrr8r8r9r�
s zTarFile._find_link_targetccs�|jr|jEdHdSd}|jdk	r:|��}|d7}|V|t|j�krT|j|}n"|jsr|��}|svd|_dSndS|d7}|Vq:dS)z$Provide an iterator object.
        Nrr#T)r�r�r�rmr2)r�r=r�r8r8r9�__iter__�
s$
zTarFile.__iter__cCs||jkrt|tjd�dS)z.Write debugging output to sys.stderr.
        �rN)r�rkri�stderr)r��level�msgr8r8r9r��
s
zTarFile._dbgcCs|��|Sr�)r�r�r8r8r9�	__enter__�
szTarFile.__enter__cCs,|dkr|��n|js"|j��d|_dSr�)r�r�r�r�)r�rr)�	tracebackr8r8r9�__exit__�
s


zTarFile.__exit__)
NrxNNNNNNr$NNNN)rxN)rxNr�)rxNr�)rxNN)NNN)T)NT)N)rN)r�T)TF)NF)N)>rnrorprqr�r�r�r�rrSrr6r7rr�r�rr�r�r�r�rr�r�r�r�r�r�r�r�r�r�rr�r�rrrrr
rrrrr"r!r&r#r$r%rrrrmr�r�r�rrCr�rHrJr8r8r8r9rBs��
oZ �


c&3
5�-�
�
1!
6
(

	cCs2zt|�}|��WdStk
r,YdSXdS)zfReturn True if name points to a tar archive that we
       are able to handle, else return False.
    TFN)rr�r)r�r�r8r8r9r�
sc	Csddl}d}|j|d�}|jdddddd	�|jd
dtdd
�|jdd�}|jddddd�|jdddddd�|jdddddd�|jdd dd!d�|��}|jr�|jdkr�|�d"d#�|j	dk	�r4|j	}t
|��rt|d$�� }|��t
|��tjd%�W5QRX|j�r0t
d&�|��n|�d"d'�|���n�|jdk	�r�|j}t
|��rxt�|d(��}|j|jd)�W5QRXn|�d"d'�|���nv|jdk	�rbt|j�d"k�r�|jd}tj}n,t|j�d*k�r�|j\}}n|�d"|���t
|��rNt�|d(��}|j||jd+�W5QRX|j�r`|d,k�r8d-�|�}	nd.�||�}	t
|	�n|�d"d'�|��n�|jdk	�r|j�d�}
tj�|
�\}}d/d/d0d0d1d1d1d1d2�}
||
k�r�d3|
|nd4}|j}t�|
|��}|D]}|�|��q�W5QRX|j�rt
d5�|
��dS)6Nrz3A simple command-line interface for tarfile module.)�descriptionz-vz	--verbose�
store_trueFzVerbose output)�action�default�helpz--filterz<filtername>zFilter for extraction)�metavar�choicesrOT)Zrequiredz-lz--list�	<tarfile>zShow listing of a tarfile)rPrOz-ez	--extract�+)rRz<output_dir>zExtract tarfile into target dir)�nargsrPrOz-cz--create)z<name>z<file>zCreate tarfile from sourcesz-tz--testzTest if a tarfile is validr#z&--filter is only valid for extraction
rxrDz{!r} is a tar archive.z{!r} is not a tar archive.
r�)r�r$)r%r�rz{!r} file is extracted.z+{!r} file is extracted into {!r} directory.r�r�r�)r�z.tgzz.xzz.txzz.bz2z.tbzz.tbz2z.tb2zw:ryz{!r} file created.)�argparse�ArgumentParser�add_argumentr�Zadd_mutually_exclusive_group�
parse_argsr�r�exitZtestrrr�rkrirEr�rSrrr2r{�curdirZformat_helprZcreate�popr%�splitextr�)rUrK�parserru�argsr_r�ZtfrZrGZtar_name�_ZextZcompressionsZtar_modeZ	tar_files�	file_namer8r8r9�main�
s���
�
�
�
�




�
�
ra�__main__)T)mrq�version�
__author__�__credits__�builtinsrr�rir{r�rZr�r�rVrrsr�r�r�r��AttributeError�NotImplementedErrorr6r��	NameError�__all__r�r�r3r�r�r2r-r/r.rCrrWr�r�rErFr!r�ZCONTTYPEr5r4rXr=r?rfr
rrrrir�r[r�rzr:rIr�r�r�getfilesystemencodingr:r?rNrTrXr[rl�	Exceptionrr
rrr	rrrrsrtrKrurvr��objectr�r��BufferedReaderr�r�r�r�r�r�r�r	r
rrr�rrrrrarnr8r8r8r9�<module>s<


�����
sh

?�u)_
__pycache__/pprint.cpython-38.opt-1.pyc000064400000037552151153537570013707 0ustar00U

e5d�S�
@sdZddlZddlZddlZddlZddlm	Z
dddddd	d
gZd%d
dd�dd�Zd&d
dd�dd�Z
d
d�dd
�Zdd�Zdd�Zdd�ZGdd�d�Zdd�ZGdd	�d	�Zdd�Zeeeeeeeeed�h�Zdd�Z d'd d!�Z!d"d#�Z"e#d$k�r�e!�dS)(a/Support to pretty-print lists, tuples, & dictionaries recursively.

Very simple, but useful, especially in debugging data structures.

Classes
-------

PrettyPrinter()
    Handle pretty-printing operations onto a stream using a configured
    set of formatting parameters.

Functions
---------

pformat()
    Format a Python object into a pretty-printed representation.

pprint()
    Pretty-print a Python object to a stream [default is sys.stdout].

saferepr()
    Generate a 'standard' repr()-like value, but protect against recursive
    data structures.

�N)�StringIO�pprint�pformat�
isreadable�isrecursive�saferepr�
PrettyPrinter�pp��PFT��compact�
sort_dictscCs"t||||||d�}|�|�dS)zAPretty-print a Python object to a stream [default is sys.stdout].)�stream�indent�width�depthr
rN)rr)�objectrrrrr
rZprinter�r�/usr/lib64/python3.8/pprint.pyr/s�cCst|||||d��|�S)z<Format a Python object into a pretty-printed representation.)rrrr
r)rr)rrrrr
rrrrr7s��)rcOst|f|�d|i|��dS)zPretty-print a Python objectrN)r)rr�args�kwargsrrrr	=scCst|iddd�dS)z=Version of repr() which can handle recursive data structures.NrT��
_safe_repr�rrrrrAscCst|iddd�dS)z4Determine if saferepr(object) is readable by eval().NrTr
rrrrrrEscCst|iddd�dS)z8Determine if object requires a recursive representation.NrT�rrrrrrIsc@s&eZdZdZdgZdd�Zdd�ZdS)�	_safe_keyaUHelper function for key functions when sorting unorderable objects.

    The wrapped-object will fallback to a Py2.x style comparison for
    unorderable types (sorting first comparing the type name and then by
    the obj ids).  Does not work recursively, so dict.items() must have
    _safe_key applied to both the key and the value.

    �objcCs
||_dS�N)r)�selfrrrr�__init__Ysz_safe_key.__init__cCsXz|j|jkWStk
rRtt|j��t|j�ftt|j��t|j�fkYSXdSr)r�	TypeError�str�type�id)r�otherrrr�__lt__\s�z_safe_key.__lt__N)�__name__�
__module__�__qualname__�__doc__�	__slots__r r&rrrrrMs	rcCst|d�t|d�fS)z&Helper function for comparing 2-tuplesrr
)r)�trrr�_safe_tuplecsr-c@s�eZdZd;ddd�dd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�ZiZ	dd�Z
e
e	ej<dd�Z
e
e	ejj<dd�Zee	ej<dd�Zee	ej<dd�Zee	ej<ee	ej<dd�Zee	ej<dd �Zee	ej<d!d"�Zee	ej<d#d$�Zee	ejj<d%d&�Z d'd(�Z!d)d*�Z"d+d,�Z#d-d.�Z$e$e	ej%j<d/d0�Z&e&e	ej'j<d1d2�Z(e(e	ej)j<d3d4�Z*e*e	ej+j<d5d6�Z,e,e	ej-j<d7d8�Z.e.e	ej/j<d9d:�Z0e0e	ej1j<dS)<rr
rNFTrcCs�t|�}t|�}|dkr td��|dk	r8|dkr8td��|sDtd��||_||_||_|dk	rf||_ntj|_t|�|_	||_
dS)a�Handle pretty printing operations onto a stream using a set of
        configured parameters.

        indent
            Number of spaces to indent for each level of nesting.

        width
            Attempted maximum number of columns in the output.

        depth
            The maximum depth to print out nested structures.

        stream
            The desired output stream.  If omitted (or false), the standard
            output stream available at construction will be used.

        compact
            If true, several items will be combined in one line.

        sort_dicts
            If true, dict keys are sorted.

        rzindent must be >= 0Nzdepth must be > 0zwidth must be != 0)�int�
ValueError�_depth�_indent_per_level�_width�_stream�_sys�stdout�bool�_compact�_sort_dicts)rrrrrr
rrrrr hs 
zPrettyPrinter.__init__cCs&|�||jddid�|j�d�dS)Nr�
)�_formatr3�write�rrrrrr�szPrettyPrinter.pprintcCs"t�}|�||ddid�|��S�Nr)�	_StringIOr:�getvalue)rrZsiorrrr�szPrettyPrinter.pformatcCs|�|idd�dS)Nrr��formatr<rrrr�szPrettyPrinter.isrecursivecCs |�|idd�\}}}|o|Sr=r@)rr�s�readable�	recursiverrrr�szPrettyPrinter.isreadablec	Cs�t|�}||kr.|�t|��d|_d|_dS|�|||�}|j||}	t|�|	kr�|j�	t
|�jd�}
|
dk	r�d||<|
|||||||d�||=dSt|t
�r�d||<|�||||||d�||=dS|�|�dS)NTFr
)r$r;�
_recursion�
_recursive�	_readable�_reprr2�len�	_dispatch�getr#�__repr__�
isinstance�dict�_pprint_dict)rrrr�	allowance�context�level�objid�rep�	max_width�prrrr:�s0
�zPrettyPrinter._formatc
Csz|j}|d�|jdkr*||jdd�t|�}|rn|jrNt|��td�}	n|��}	|�|	|||d||�|d�dS)N�{r
� ��key�})r;r1rIr8�sorted�itemsr-�_format_dict_items)
rrrrrPrQrRr;Zlengthr]rrrrO�s
�zPrettyPrinter._pprint_dictcCslt|�s|�t|��dS|j}|�|jd�|�t|���||t|j�d|d||�|�d�dS)N�(r
�))rIr;�repr�	__class__r'r:�listr])rrrrrPrQrR�clsrrr�_pprint_ordered_dict�s�z"PrettyPrinter._pprint_ordered_dictcCs0|�d�|�||||d||�|�d�dS)N�[r
�])r;�
_format_items�rrrrrPrQrRrrr�_pprint_list�s
�zPrettyPrinter._pprint_listcCsH|�d�t|�dkrdnd}|�||||t|�||�|�|�dS)Nr_r
z,)r`)r;rIrh)rrrrrPrQrR�endcharrrr�
_pprint_tuple�s
�zPrettyPrinter._pprint_tuplec	Cs�t|�s|�t|��dS|j}|tkr8|�d�d}n&|�|jd�d}|t|j�d7}t|td�}|�||||t|�||�|�|�dS)NrWr[�({�})r
rY)	rIr;rarb�setr'r\rrh)	rrrrrPrQrR�typrkrrr�_pprint_set�s 
�zPrettyPrinter._pprint_setcCs�|j}t|�s|t|��dSg}|�d�}	|dkrD|d7}|d7}|j|}
}t|	�D]�\}}
t|
�}|t|	�dkr�|
|8}
t|�|
kr�|�|�qZt�d|
�}|�	�|}d}t|�D]h\}}||}|t|�dkr�|t|	�dkr�||8}tt|��|k�r"|�r|�t|��|}q�|}q�|rZ|�t|��qZt|�dk�rV||�dS|dk�rh|d�t|�D],\}}|dk�r�|dd|�||��qp|dk�r�|d	�dS)
NTr
z\S*\s*�r_rr9rXr`)
r;rIra�
splitlinesr2�	enumerate�append�re�findall�pop)rrrrrPrQrRr;Zchunks�linesZ
max_width1rU�i�linerT�partsZ
max_width2�current�j�part�	candidaterrr�_pprint_strsT
 


zPrettyPrinter._pprint_strcCs�|j}t|�dkr"|t|��dS|dk}|rF|d7}|d7}|d�d}	t||j||�D]$}
||	�||
�|	s\dd|}	q\|r�|d�dS)N�r
r_rrr9rXr`)r;rIra�_wrap_bytes_reprr2)rrrrrPrQrRr;Zparens�delimrTrrr�
_pprint_bytes3s"zPrettyPrinter._pprint_bytesc	Cs>|j}|d�|�t|�||d|d||d�|d�dS)Nz
bytearray(�
r
r`)r;r��bytes)rrrrrPrQrRr;rrr�_pprint_bytearrayHs�zPrettyPrinter._pprint_bytearraycCs8|�d�|�|��||d|d||�|�d�dS)Nz
mappingproxy(�
r
r`)r;r:�copyrirrr�_pprint_mappingproxyQs
�z"PrettyPrinter._pprint_mappingproxyc	Cs�|j}||j7}dd|}t|�d}	t|�D]f\}
\}}|
|	k}
|�|||�}||�|d�|�|||t|�d|
r�|nd||�|
s0||�q0dS)N�,
rXr
z: r)r;r1rIrtrHr:)rr]rrrPrQrRr;�delimnlZ
last_indexrzrZ�ent�lastrTrrrr^Ys 

�z PrettyPrinter._format_dict_itemscCsL|j}||j7}|jdkr,||jdd�dd|}d}	|j|d}
}t|�}zt|�}
Wntk
rxYdSXd}|�sH|
}zt|�}
Wn(tk
r�d}||8}|
|8}
YnX|j�r|�|||�}t|�d}|
|kr�|}
|	r�|}	|
|k�r|
|8}
||	�d}	||�q~||	�|}	|�	||||�r<|nd||�q~dS)	Nr
rXr�rrFTr�, )
r;r1r2�iter�next�
StopIterationr7rHrIr:)rr]rrrPrQrRr;r�r�rrU�itZnext_entr�r�rT�wrrrrhjsR



�zPrettyPrinter._format_itemscCs4|�||��|j|�\}}}|s&d|_|r0d|_|S)NFT)rAr�r0rGrF)rrrQrRrarCrDrrrrH�s�
zPrettyPrinter._reprcCst|||||j�S)z�Format object for a specific context, returning a string
        and flags indicating whether the representation is 'readable'
        and whether the object represents a recursive construct.
        )rr8)rrrQ�	maxlevelsrRrrrrA�szPrettyPrinter.formatc	Cs�t|�s|�t|��dS|�|j||�}|j}|t|j�d7}|�d|j|d|f�|�||||d||�|�d�dS)Nr
z	%s(%s,
%srXr`)rIr;rarH�default_factoryrbr'rO)	rrrrrPrQrRZrdfrdrrr�_pprint_default_dict�sz"PrettyPrinter._pprint_default_dictc	Cs�t|�s|�t|��dS|j}|�|jd�|jdkrN|�|jdd�|��}|�|||t|j�d|d||�|�d�dS)Nrmr
rXrrn)rIr;rarbr'r1�most_commonr^)	rrrrrPrQrRrdr]rrr�_pprint_counter�s
�zPrettyPrinter._pprint_counterc
	Cs�t|j�s|�t|��dS|j}|�|jd�|t|j�d7}t|j�D]d\}}	|t|j�dkr�|�|	|||d||�|�d�qN|�|	||d||�|�dd|�qNdS)Nr_r
r`r�rX)rI�mapsr;rarbr'rtr:)
rrrrrPrQrRrdrz�mrrr�_pprint_chain_map�s
zPrettyPrinter._pprint_chain_mapc	Cs�t|�s|�t|��dS|j}|�|jd�|t|j�d7}|�d�|jdkrz|�||||d||�|�d�n:|�|||d||�|�|j||�}|�dd||f�dS)Nr_r
rfrz])z],
%smaxlen=%s)rX)rIr;rarbr'�maxlenrhrH)	rrrrrPrQrRrdZrmlrrr�
_pprint_deque�s&

��zPrettyPrinter._pprint_dequec	Cs|�|j|||||d�dS�Nr
�r:�datarirrr�_pprint_user_dict�szPrettyPrinter._pprint_user_dictc	Cs|�|j|||||d�dSr�r�rirrr�_pprint_user_list�szPrettyPrinter._pprint_user_listc	Cs|�|j|||||d�dSr�r�rirrr�_pprint_user_string�sz!PrettyPrinter._pprint_user_string)r
rNN)2r'r(r)r rrrrr:rJrOrNrLre�_collections�OrderedDictrjrcrl�tuplerqro�	frozensetr�r"r�r�r��	bytearrayr��_types�MappingProxyTyper^rhrHrAr��defaultdictr��Counterr��ChainMapr��dequer��UserDictr��UserListr��
UserStringrrrrrgs^�+




1


)	cCs�t|�}|tkrt|�ddfSt|dd�}t|t��rD|tjk�rD|sJdSt|�}|rl||krldd||kfS||kr�t|�ddfSd||<d}d}	g}
|
j	}|d7}|r�t
|��td�}n|��}|D]b\}
}t
|
||||�\}}}t
|||||�\}}}|d||f�|�o|�o|}|�s$|r�d}	q�||=d	d
�|
�||	fSt|t��r\|tjk�stt|t��rn|tjk�rnt|t��r�|�s�dSd}n"t|�dk�r�d
}n|�s�dSd}t|�}|�r�||k�r�|dd||kfS||k�r�t|�ddfSd||<d}d}	g}
|
j	}|d7}|D]8}t
|||||�\}}}||�|�sFd}|�rd}	�q||=|d
�|
�||	fSt|�}||�o�|�d�dfS)NTFrL)z{}TFz{...}r
rYz%s: %sz{%s}r�)z[]TFz[%s]z(%s,))z()TFz(%s)z...�<)r#�_builtin_scalarsra�getattr�
issubclassrNrLr$rErur\r]r-r�joinrcr�rI�
startswith)rrQr�rRrrp�rrSrCrDZ
componentsrur]�k�vZkreprZ	kreadableZkrecurZvreprZ	vreadableZvrecurrA�oZoreprZ	oreadableZorecurrTrrrr�s�
��
rcCsdt|�jt|�fS)Nz<Recursion on %s with id=%s>)r#r'r$rrrrrE?s�rEcCs�ddl}|dkr,ddddgddd�fgd	}t�}|��}t|iddd
�|��}|�|�|��}td||�td||�dS)
Nr�string)r
r�r���)��i��Tz_safe_repr:zpformat:)�timer�perf_counterrr�print)rr�rV�t1�t2Zt3rrr�
_perfcheckDs
r�ccs�d}t|�dd}tdt|�d�D]T}|||d�}||}||krP||8}tt|��|krt|rnt|�V|}q$|}q$|r�t|�VdS)N�r�r)rI�rangera)rrrPr}r�rzrr�rrrr�Qs
r��__main__)Nr
rN)r
rN)N)$r*�collectionsr�rv�sysr4�typesr��iorr>�__all__rrr	rrrrr-rrr�r"r�r�r.�float�complexr6r#r�rEr�r�r'rrrr�<module>sJ
���F�


__pycache__/timeit.cpython-38.pyc000064400000027003151153537570012715 0ustar00U

e5d�4�@s�dZddlZddlZddlZddlZddddgZdZdZd	Zej	Z
eZd
Z
dd�ZGd
d�d�Zdde
edfdd�Zdde
eedfdd�Zddd�dd�Zedkr�e�e��dS)a9Tool for measuring execution time of small code snippets.

This module avoids a number of common traps for measuring execution
times.  See also Tim Peters' introduction to the Algorithms chapter in
the Python Cookbook, published by O'Reilly.

Library usage: see the Timer class.

Command line usage:
    python timeit.py [-n N] [-r N] [-s S] [-p] [-h] [--] [statement]

Options:
  -n/--number N: how many times to execute 'statement' (default: see below)
  -r/--repeat N: how many times to repeat the timer (default 5)
  -s/--setup S: statement to be executed once initially (default 'pass').
                Execution time of this setup statement is NOT timed.
  -p/--process: use time.process_time() (default is time.perf_counter())
  -v/--verbose: print raw timing results; repeat for more digits precision
  -u/--unit: set the output time unit (nsec, usec, msec, or sec)
  -h/--help: print this usage message and exit
  --: separate options from statement, use when statement starts with -
  statement: statement to be timed (default 'pass')

A multi-line statement may be given by specifying each line as a
separate argument; indented lines are possible by enclosing an
argument in quotes and using leading spaces.  Multiple -s options are
treated similarly.

If -n is not given, a suitable number of loops is calculated by trying
increasing numbers from the sequence 1, 2, 5, 10, 20, 50, ... until the
total time is at least 0.2 seconds.

Note: there is a certain baseline overhead associated with executing a
pass statement.  It differs between versions.  The code here doesn't try
to hide it, but you should be aware of it.  The baseline overhead can be
measured by invoking the program without arguments.

Classes:

    Timer

Functions:

    timeit(string, string) -> float
    repeat(string, string) -> list
    default_timer() -> float

�N�Timer�timeit�repeat�
default_timerz<timeit-src>i@B�z�
def inner(_it, _timer{init}):
    {setup}
    _t0 = _timer()
    for _i in _it:
        {stmt}
    _t1 = _timer()
    return _t1 - _t0
cCs|�ddd|�S)z*Helper to reindent a multi-line statement.�
� )�replace)�src�indent�r�/usr/lib64/python3.8/timeit.py�reindentOsrc@sPeZdZdZddedfdd�Zddd�Zefdd	�Ze	efd
d�Z
ddd
�ZdS)ra�Class for timing execution speed of small code snippets.

    The constructor takes a statement to be timed, an additional
    statement used for setup, and a timer function.  Both statements
    default to 'pass'; the timer function is platform-dependent (see
    module doc string).  If 'globals' is specified, the code will be
    executed within that namespace (as opposed to inside timeit's
    namespace).

    To measure the execution time of the first statement, use the
    timeit() method.  The repeat() method is a convenience to call
    timeit() multiple times and return a list of results.

    The statements may contain newlines, as long as they don't contain
    multi-line string literals.
    �passNcCs�||_i}|dkrt�n|}d}t|t�rJt|td�|d}t|d�}n*t|�rl||d<|d7}d}d}ntd	��t|t�r�t||td�t|d
�}n&t|�r�||d<|d7}d
}ntd��t	j
|||d�}	|	|_t|	td�}
t|
||�|d|_
dS)z#Constructor.  See class doc string.N��execr��_setupz, _setup=_setupz_setup()z&setup is neither a string nor callable�Z_stmtz
, _stmt=_stmtz_stmt()z%stmt is neither a string nor callable)�stmt�setup�init�inner)�timer�_globals�
isinstance�str�compile�dummy_src_namer�callable�
ValueError�template�formatr
rr)�selfrrr�globalsZlocal_nsZ	global_nsrZ
stmtprefixr
�coderrr
�__init__es6

zTimer.__init__cCsJddl}ddl}|jdk	r:t|j�d|j�d�tf|jt<|j|d�dS)a�Helper to print a traceback from the timed code.

        Typical use:

            t = Timer(...)       # outside the try/except
            try:
                t.timeit(...)    # or t.repeat(...)
            except:
                t.print_exc()

        The advantage over the standard traceback is that source lines
        in the compiled template will be displayed.

        The optional file argument directs where the traceback is
        sent; it defaults to sys.stderr.
        rNr��file)�	linecache�	tracebackr
�len�splitr�cache�	print_exc)r#r(r)r*rrr
r.�s

�
zTimer.print_exccCsBt�d|�}t��}t��z|�||j�}W5|r<t��X|S)a�Time 'number' executions of the main statement.

        To be precise, this executes the setup statement once, and
        then returns the time it takes to execute the main statement
        a number of times, as a float measured in seconds.  The
        argument is the number of times through the loop, defaulting
        to one million.  The main statement, the setup statement and
        the timer function to be used are passed to the constructor.
        N)�	itertoolsr�gcZ	isenabledZdisableZenablerr)r#�number�itZgcoldZtimingrrr
r�s

zTimer.timeitcCs*g}t|�D]}|�|�}|�|�q|S)a�Call timeit() a few times.

        This is a convenience function that calls the timeit()
        repeatedly, returning a list of results.  The first argument
        specifies how many times to call timeit(), defaulting to 5;
        the second argument specifies the timer argument, defaulting
        to one million.

        Note: it's tempting to calculate mean and standard deviation
        from the result vector and report these.  However, this is not
        very useful.  In a typical case, the lowest value gives a
        lower bound for how fast your machine can run the given code
        snippet; higher values in the result vector are typically not
        caused by variability in Python's speed, but by other
        processes interfering with your timing accuracy.  So the min()
        of the result is probably the only number you should be
        interested in.  After that, you should look at the entire
        vector and apply common sense rather than statistics.
        )�ranger�append)r#rr1�r�i�trrr
r�s

zTimer.repeatcCsPd}dD]8}||}|�|�}|r,|||�|dkr||fSq|d9}qdS)a�Return the number of loops and time taken so that total time >= 0.2.

        Calls the timeit method with increasing numbers from the sequence
        1, 2, 5, 10, 20, 50, ... until the time taken is at least 0.2
        second.  Returns (number, time_taken).

        If *callback* is given and is not None, it will be called after
        each trial with two arguments: ``callback(number, time_taken)``.
        �)r8�rg�������?�
N)r)r#�callbackr6�jr1�
time_takenrrr
�	autorange�s


zTimer.autorange)N)N)�__name__�
__module__�__qualname__�__doc__rr&r.�default_numberr�default_repeatrr>rrrr
rSs�
#
rcCst||||��|�S)zCConvenience function to create Timer object and call timeit method.)rr)rrrr1r$rrr
r�scCst||||��||�S)zCConvenience function to create Timer object and call repeat method.)rr)rrrrr1r$rrr
r�s)�_wrap_timerc
s|dkrtjdd�}ddl}z(|�|dddddd	d
ddd
g	�\}}Wn:|jk
r�}zt|�td�WY�dSd}~XYnXt}d�|�p�d}d�g}t}d}	d�ddddd��d�|D]�\}
}|
dkr�t|��|
dkr�|�	|�|
dk�r|�k�r|�ntdtj
d�dS|
dk�r6t|�}|dk�r6d}|
dk�rFtj}|
dk�rf|	�r^�d7�|	d7}	|
d kr�tt
d!d"�dSq�d�|��p�d}ddl}tj�d|j�|dk	�r�||�}t|||�}
�dk�rd}|	�r�fd#d$�}z|
�|�\�}Wn|
��YdSX|	�rt�z|
�|��}Wn|
��YdSX���fd%d&�}|	�rztd'd(�t||���t��fd)d*�|D�}t|�}td+��dk�r�d,nd-|||�f�t|�}t|�}||d.k�rddl}|�d/||�||�ftd-d�dS)0a�Main program, used when run as a script.

    The optional 'args' argument specifies the command line to be parsed,
    defaulting to sys.argv[1:].

    The return value is an exit code to be passed to sys.exit(); it
    may be None to indicate success.

    When an exception happens during timing, a traceback is printed to
    stderr and the return value is 1.  Exceptions at other times
    (including the template compilation) are not caught.

    '_wrap_timer' is an internal interface used for unit testing.  If it
    is not None, it must be a callable that accepts a timer function
    and returns another timer function (used for unit testing).
    Nr8rz
n:u:s:r:tcpvhznumber=zsetup=zrepeat=�timeZclockZprocess�verbosezunit=�helpz#use -h/--help for command line helpr9rrg��&�.>g���ư>g����MbP?g�?)ZnsecZusecZmsecZsec�)z-nz--number)z-sz--setup)z-uz--unitz:Unrecognized unit. Please select nsec, usec, msec, or sec.r')z-rz--repeat)z-pz	--process)z-vz	--verbose)z-hz--helpr)�endcs.d}|dk}t|j||rdnd|�d��dS)Nz%{num} loop{s} -> {secs:.{prec}g} secsr8�sr)ZnumrKZsecsZprec)�printr")r1r=�msgZplural)�	precisionrr
r;?s�zmain.<locals>.callbackcs`�}|dk	r�|}n8dd����D�}|jdd�|D]\}}||kr8qNq8d�|||fS)NcSsg|]\}}||f�qSrr)�.0�unit�scalerrr
�
<listcomp>Ysz-main.<locals>.format_time.<locals>.<listcomp>T)�reversez%.*g %s)�items�sort)�dtrPrQZscales)rN�	time_unit�unitsrr
�format_timeSs
zmain.<locals>.format_timez
raw times: %sz, csg|]}|��qSrr)rOrV)r1rr
rRdszmain.<locals>.<listcomp>z"%d loop%s, best of %d: %s per looprKrrztThe test results are likely unreliable. The worst time (%s) was more than four times slower than the best time (%s).)�sys�argv�getopt�errorrLr�joinrD�intr4�stderrrF�process_timerB�os�path�insert�curdirrr>r.r�map�min�max�warnings�
warn_explicit�UserWarning)�argsrEr\Zopts�errrrrrrG�o�arbr7r;�_Zraw_timingsrYZtimingsZbestZworstrir)r1rNrWrXr
�main�s���


�





����rq�__main__)N)rBr0rZrFr/�__all__rrCrD�perf_counterrr$rr!rrrrrqr?�exitrrrr
�<module>s61
�
�
__pycache__/bisect.cpython-38.pyc000064400000004464151153537570012701 0ustar00U

e5d��@sZdZddd�Zd
dd�Zddd�Zdd	d
�ZzddlTWnek
rLYnXeZeZdS)zBisection algorithms.�NcCst||||�}|�||�dS)z�Insert item x in list a, and keep it sorted assuming a is sorted.

    If x is already in a, insert it to the right of the rightmost x.

    Optional args lo (default 0) and hi (default len(a)) bound the
    slice of a to be searched.
    N)�bisect_right�insert��a�x�lo�hi�r	�/usr/lib64/python3.8/bisect.py�insort_rights	rcCsT|dkrtd��|dkr t|�}||krP||d}|||krF|}q |d}q |S)a�Return the index where to insert item x in list a, assuming a is sorted.

    The return value i is such that all e in a[:i] have e <= x, and all e in
    a[i:] have e > x.  So if x already appears in the list, a.insert(x) will
    insert just after the rightmost x already there.

    Optional args lo (default 0) and hi (default len(a)) bound the
    slice of a to be searched.
    r�lo must be non-negativeN����
ValueError�len�rrrrZmidr	r	r
rs
rcCst||||�}|�||�dS)z�Insert item x in list a, and keep it sorted assuming a is sorted.

    If x is already in a, insert it to the left of the leftmost x.

    Optional args lo (default 0) and hi (default len(a)) bound the
    slice of a to be searched.
    N)�bisect_leftrrr	r	r
�insort_left$s	rcCsT|dkrtd��|dkr t|�}||krP||d}|||krJ|d}q |}q |S)a�Return the index where to insert item x in list a, assuming a is sorted.

    The return value i is such that all e in a[:i] have e < x, and all e in
    a[i:] have e >= x.  So if x already appears in the list, a.insert(x) will
    insert just before the leftmost x already there.

    Optional args lo (default 0) and hi (default len(a)) bound the
    slice of a to be searched.
    rrNr
rrrr	r	r
r1s
r)�*)rN)rN)rN)rN)	�__doc__rrrrZ_bisect�ImportErrorZbisectZinsortr	r	r	r
�<module>s



__pycache__/lzma.cpython-38.opt-2.pyc000064400000013333151153537570013326 0ustar00U

e5d�2�$@s�dddddddddd	d
ddd
ddddddddddddddddddd d!d"d#g$Zd$d%lZd$d%lZd$d%lZd$d&lTd$d'lmZmZd$d%lZd$Zd(Z	d)Z
Gd*d�dej�Zd1d%d,d%d%d%d%d%d-�d.d �Z
ed,d%d%fd/d!�Zed%d%fd0d"�Zd%S)2Z
CHECK_NONEZCHECK_CRC32ZCHECK_CRC64ZCHECK_SHA256ZCHECK_ID_MAXZ
CHECK_UNKNOWNZFILTER_LZMA1ZFILTER_LZMA2ZFILTER_DELTAZ
FILTER_X86ZFILTER_IA64Z
FILTER_ARMZFILTER_ARMTHUMBZFILTER_POWERPCZFILTER_SPARC�FORMAT_AUTO�	FORMAT_XZZFORMAT_ALONEZ
FORMAT_RAWZMF_HC3ZMF_HC4ZMF_BT2ZMF_BT3ZMF_BT4Z	MODE_FASTZMODE_NORMALZPRESET_DEFAULTZPRESET_EXTREME�LZMACompressor�LZMADecompressor�LZMAFile�	LZMAError�open�compress�
decompressZis_check_supported�N)�*)�_encode_filter_properties�_decode_filter_properties��c@s�eZdZd!ddddd�dd�Zdd�Zed	d
��Zdd�Zd
d�Zdd�Z	dd�Z
d"dd�Zd#dd�Zd$dd�Z
d%dd�Zdd�Zejfdd�Zdd �ZdS)&rN�r�����format�check�preset�filtersc	Cs&d|_d|_t|_|dkrL|dkr*td��|dk	r:td��|dkrFt}t}n@|dkr~|dkr`t}t}t	||||d�|_
d|_ntd	�|���t
|tttjf�r�d
|kr�|d
7}t�||�|_d|_||_n*t|d�s�t|d
�r�||_||_ntd��|jtk�r"tj|jtt||d�}t�|�|_dS)NF)r�rbrzACannot specify an integrity check when opening a file for readingzICannot specify a preset compression level when opening a file for reading)�w�wb�aZab�xZxbrr
zInvalid mode: {!r}�bT�read�writez6filename must be a str, bytes, file or PathLike object)Ztrailing_errorrr)�_fp�_closefp�_MODE_CLOSED�_mode�
ValueErrorr�
_MODE_READr�_MODE_WRITEr�_compressor�_posr�
isinstance�str�bytes�os�PathLike�builtinsr�hasattr�	TypeError�_compressionZDecompressReaderrr�io�BufferedReader�_buffer)	�self�filename�moderrrrZ	mode_code�raw�r8�/usr/lib64/python3.8/lzma.py�__init__1sL,�
�zLZMAFile.__init__cCs�|jtkrdSzB|jtkr,|j��d|_n"|jtkrN|j�|j	�
��d|_	W5z|jrd|j��W5d|_d|_t|_XXdS)NF)r"r!rr �closer$r3r%rr&�flush�r4r8r8r9r;�s




zLZMAFile.closecCs
|jtkS�N)r"r!r=r8r8r9�closed�szLZMAFile.closedcCs|��|j��Sr>)�_check_not_closedr�filenor=r8r8r9rA�szLZMAFile.filenocCs|��o|j��Sr>)�readabler3�seekabler=r8r8r9rC�szLZMAFile.seekablecCs|��|jtkSr>)r@r"r$r=r8r8r9rB�szLZMAFile.readablecCs|��|jtkSr>)r@r"r%r=r8r8r9�writable�szLZMAFile.writablecCs|��|j�|�Sr>)�_check_can_readr3�peek�r4�sizer8r8r9rF�sz
LZMAFile.peekcCs|��|j�|�Sr>)rEr3rrGr8r8r9r�sz
LZMAFile.readcCs"|��|dkrtj}|j�|�S)Nr
)rEr1�DEFAULT_BUFFER_SIZEr3�read1rGr8r8r9rJ�szLZMAFile.read1cCs|��|j�|�Sr>)rEr3�readlinerGr8r8r9rK�szLZMAFile.readlinecCs:|��|j�|�}|j�|�|jt|�7_t|�Sr>)Z_check_can_writer&rrrr'�len)r4�dataZ
compressedr8r8r9r�s
zLZMAFile.writecCs|��|j�||�Sr>)Z_check_can_seekr3�seek)r4�offset�whencer8r8r9rN�sz
LZMAFile.seekcCs"|��|jtkr|j��S|jSr>)r@r"r$r3�tellr'r=r8r8r9rQ�s

z
LZMAFile.tell)Nr)r)r)r)r)�__name__�
__module__�__qualname__r:r;�propertyr?rArCrBrDrFrrJrKrr1�SEEK_SETrNrQr8r8r8r9r&s(�U


	



rr)rrrr�encoding�errors�newlinecCs�d|kr d|krPtd|f��n0|dk	r0td��|dk	r@td��|dk	rPtd��|�dd�}	t||	||||d�}
d|kr�t�|
|||�S|
SdS)	N�trzInvalid mode: %rz0Argument 'encoding' not supported in binary modez.Argument 'errors' not supported in binary modez/Argument 'newline' not supported in binary mode�r)r#�replacerr1�
TextIOWrapper)r5r6rrrrrWrXrYZlz_modeZbinary_filer8r8r9rs"
�cCs t||||�}|�|�|��Sr>)rrr<)rMrrrr�compr8r8r9r6scCspg}t|||�}z|�|�}Wn tk
r>|r8Yqfn�YnX|�|�|jsXtd��|j}|sqfqd�|�S)NzACompressed data ended before the end-of-stream marker was reached�)rr	r�append�eofZunused_data�join)rMrZmemlimitrZresultsZdecomp�resr8r8r9r	Bs
)r)�__all__r-r1r+Z_lzmarr
r0r!r$r%Z
BaseStreamrrrrrr	r8r8r8r9�<module>st�
b�/__pycache__/zipfile.cpython-38.opt-1.pyc000064400000162157151153537570014035 0ustar00U

e5d�V�@sdZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZzddlZejZWnek
r�dZejZYnXzddlZWnek
r�dZYnXzddlZWnek
r�dZYnXddddddd	d
ddd
ddg
ZGdd�de�ZGdd�de�ZeZZdZdZdZdZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'dZ(e�)e'�Z*dZ+dZ,dZ-dZ.d Z/d!Z0d"Z1d#Z2dZ3d$Z4d%Z5d&Z6e�)e5�Z7dZ8dZ9dZ:dZ;d Z<d!Z=d"Z>d#Z?dZ@d$ZAd'ZBd(ZCdZDd)ZEdZFd*ZGd+ZHd,ZId-ZJd.ZKd/ZLe�)eK�ZMdZNdZOdZPdZQd ZRd!ZSd"ZTd#ZUdZVd$ZWd'ZXd(ZYd0ZZd1Z[e�)eZ�Z\d2Z]d3Z^e�)e]�Z_dZ`dZadZbdZcd Zdd!Zed"Zfd#ZgdZhd$Zid4Zje�kd5�Zld6d7�Zmd8d9�Znd:d
�Zod;d<�Zpd=d>�ZqGd?d�der�Zsdatd@dA�ZudBdC�ZvGdDdE�dE�ZwGdFdG�dG�ZxdHdIdJdJdJdJdKdLdMdNdKdOdPdQdRdSdTdU�ZydVdW�ZzdtdXdY�Z{dZd[�Z|Gd\d]�d]�Z}Gd^d_�d_�Z~Gd`da�daej�Z�Gdbdc�dcej�Z�Gddd�d�Z�Gded
�d
e��Z�dfdg�Z�dhdi�Z�e�j�Z�djdk�Z�Gdldm�dme��Z�Gdndo�doe��Z�Gdpd�d�Z�dudqdr�Z�e�dsk�r
e��dS)vzP
Read and write ZIP files.

XXX references to utf-8 need further investigation.
�N�
BadZipFile�
BadZipfile�error�
ZIP_STORED�ZIP_DEFLATED�	ZIP_BZIP2�ZIP_LZMA�
is_zipfile�ZipInfo�ZipFile�	PyZipFile�LargeZipFile�Pathc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/zipfile.pyr+sc@seZdZdZdS)r
zu
    Raised when writing a zipfile, the zipfile requires ZIP64 extensions
    and those extensions are disabled.
    N)rrr�__doc__rrrrr
/si���������-�.�?s<4s4H2LHsPK��������	z<4s4B4HL2L5H2LsPK�
��
����z<4s2B4HL2L2HsPKz<4sLQLsPKz
<4sQ2H2L4QsPKiPK�<HHc
Cs�tj}d}g}d}}|dt|�krz||||d��\}}|d|}	||krt||krl|�|||��|	}d}|	}q|s�|Sd�|�S)NFrr T�)�_EXTRA_FIELD_STRUCT�unpack�len�append�join)
�extraZxidsr/Zmodified�buffer�start�iZxidZxlen�jrrr�_strip_extra�s r8cCs,zt|�rWdSWntk
r&YnXdS)NTF)�_EndRecData�OSError��fprrr�_check_zipfile�s
r=c	CsVd}z8t|d�rt|d�}nt|d��}t|�}W5QRXWntk
rPYnX|S)z�Quickly see if a file is a ZIP file by checking the magic number.

    The filename argument may be a file or file-like object too.
    F�readr;�rb)�hasattrr=�openr:)�filename�resultr<rrrr	�s
c
Csz|�|td�Wntk
r,|YSX|�t�}t|�tkrH|St�t|�\}}}}|tkrh|S|dksx|dkr�t	d��|�|tt
d�|�t
�}t|�t
kr�|St�t|�\
}}}	}
}}}
}}}|tkr�|S||t
<||t<||t<|
|t<||t<||t<||t<|S)zM
    Read the ZIP64 end-of-archive records and use that to update endrec
    rrrz3zipfiles that span multiple disks are not supported)�seek�sizeEndCentDir64Locatorr:r>r0�structr/�structEndArchive64Locator�stringEndArchive64Locatorr�sizeEndCentDir64�structEndArchive64�stringEndArchive64�_ECD_SIGNATURE�_ECD_DISK_NUMBER�_ECD_DISK_START�_ECD_ENTRIES_THIS_DISK�_ECD_ENTRIES_TOTAL�	_ECD_SIZE�_ECD_OFFSET)�fpin�offset�endrec�dataZsigZdisknoZreloffZdisksZsz�create_versionZread_versionZdisk_numZdisk_dirZdircountZ	dircount2ZdirsizeZ	diroffsetrrr�
_EndRecData64�s@



�rXc	Csh|�dd�|��}z|�td�Wntk
r<YdSX|��}t|�tkr�|dd�tkr�|dd�dkr�t�t	|�}t
|�}|�d�|�|t�t|t|�St
|dtd�}|�|d�|��}|�t�}|dk�rd|||t�}t|�tk�rdSt
t�t	|��}|t}||t|t|�}|�|�|�||�t|||||�SdS)	z�Return data from the "End of Central Directory" record, or None.

    The data is a list of the nine items in the ZIP "End of central dir"
    record followed by a tenth item, the file seek offset of this record.rrNr ���sr-i)rD�tell�sizeEndCentDirr:r>r0�stringEndArchiverFr/�structEndArchive�listr1rX�max�rfind�_ECD_COMMENT_SIZE)	rSZfilesizerVrUZmaxCommentStartr5ZrecDataZcommentSize�commentrrrr9sD��



�r9c@s\eZdZdZdZddd�Zdd�Zdd
d�Zdd
�Zdd�Z	e
ddd�dd��Zdd�Zd	S)r
z>Class with attributes describing each file in the ZIP archive.)�
orig_filenamerB�	date_time�
compress_type�_compresslevelrbr3�
create_systemrW�extract_version�reserved�	flag_bits�volume�
internal_attr�
external_attr�
header_offset�CRC�
compress_size�	file_size�	_raw_time�NoName��rrrrrcCs�||_|�td��}|dkr(|d|�}tjdkrJtj|krJ|�tjd�}||_||_|ddkrjtd��t	|_
d|_d|_d|_
tjdkr�d|_nd|_t|_t|_d|_d|_d|_d|_d|_dS)Nr�/ruz+ZIP does not support timestamps before 1980r-Zwin32r)rc�find�chr�os�sep�replacerBrd�
ValueErrorrrerfrbr3�sys�platformrg�DEFAULT_VERSIONrWrhrirjrkrlrm)�selfrBrdZ	null_byterrr�__init__Xs0
zZipInfo.__init__cCs�d|jj|jfg}|jtkr8|�dt�|j|j��|jd?}|jd@}|rd|�dt	�
|��|rv|�d|�|��}|r�|jr�|�d|j�|r�|j
r�|jtks�|j|j
kr�|�d|j
�|�d	�d
�|�S)Nz<%s filename=%r� compress_type=%sr)rz filemode=%rz external_attr=%#xz
 file_size=%rz compress_size=%r�>�)�	__class__rrBrerr1�compressor_names�getrm�stat�filemode�is_dirrqrpr2)r�rC�hi�lo�isdirrrr�__repr__�s0
��



�
�
zZipInfo.__repr__NcCs||j}|ddd>|dd>B|dB}|dd>|d	d>B|ddB}|jd
@rfd}}}n|j}|j}|j}|j}d}	|dkr�|tkp�|tk}|r�d}
|t�|
dt�	|
�d	||�}|tks�|tkr�|s�t
d
��d}d}t}	|jt
k�rtt|	�}	n|jtk�rtt|	�}	t|	|j�|_t|	|j�|_|��\}}t�tt|j|j||j|||||t|�t|��
}
|
||S)z-Return the per-file header as a bytes object.rrur$rr!rrr&r rNz<HHQQz'Filesize would require ZIP64 extensions���)rdrjrorprqr3�ZIP64_LIMITrF�pack�calcsizer
�
ZIP64_VERSIONrerr_�
BZIP2_VERSIONr�LZMA_VERSIONrhrW�_encodeFilenameFlags�structFileHeader�stringFileHeaderrir0)r��zip64�dt�dosdate�dostimerorprqr3�min_version�fmtrBrj�headerrrr�
FileHeader�s^$$
�
�zZipInfo.FileHeadercCsDz|j�d�|jfWStk
r>|j�d�|jdBfYSXdS)N�ascii�utf-8�)rB�encoderj�UnicodeEncodeError�r�rrrr��szZipInfo._encodeFilenameFlagscCs�|j}tj}t|�dk�r�|d|dd��\}}|dt|�krPtd||f��|dk�rp|dkrv|d|dd��}nV|dkr�|d	|dd
��}n:|dkr�|d|dd
��}n|dkr�d}ntd||f��d}|jdk�rt|�|kr�td��|||_|d7}|jdk�r6t|�|k�r$td��|||_|d7}|jdk�rpt|�|k�rXtd��|j}|||_|d7}||dd�}qdS)Nr r,z"Corrupt extra field %04x (size=%d)r�z<QQQ�r)z<QQrrz<Qrrr)l����r�z/Corrupt zip64 extra field. File size not found.r�z3Corrupt zip64 extra field. Compress size not found.z3Corrupt zip64 extra field. Header offset not found.)r3rFr/r0rrqrprn)r�r3r/�tpZlnZcounts�idx�oldrrr�_decodeExtra�sP
�
�
�
zZipInfo._decodeExtraT��strict_timestampsc	Cst|tj�rt�|�}t�|�}t�|j�}t�|j	�}|dd�}|sZ|ddkrZd}n|sn|ddkrnd}|dkrz|}tj
�tj
�|�d�}|dtj
tjfkr�|dd�}q�|r�|d	7}|||�}|jd
@d>|_|r�d|_|jdO_n|j|_|S)a_Construct an appropriate ZipInfo for a file on the filesystem.

        filename should be the path to a file or directory on the filesystem.

        arcname is the name which it will have within the archive (by default,
        this will be the same as filename, but without a drive letter and with
        leading path separators removed).
        rr"rurt�;)r�r���;r�Nrrvrr))�
isinstancery�PathLike�fspathr��S_ISDIR�st_mode�time�	localtime�st_mtime�path�normpath�
splitdriverz�altseprmrq�st_size)	�clsrB�arcnamer��str��mtimerd�zinforrr�	from_file�s0



zZipInfo.from_filecCs|jddkS)z2Return True if this archive member is a directory.���rv�rBr�rrrr�%szZipInfo.is_dir)rsrt)N)N)
rrrr�	__slots__r�r�r�r�r��classmethodr�r�rrrrr
>s
+
.2%cCs0td�D]"}|d@r"|d?dA}q|dL}q|S)Nrrl q[)�range)�crcr7rrr�_gen_crc/s

r�csld�d�d�tdkr&ttttd���at��fdd������fdd��|D]}�|�qL��fd	d
�}|S)NixV4i�gE#i�xV4�cs|d?�||Ad@AS)z(Compute the CRC32 primitive on one byte.r�r)Zchr�)�crctablerr�crc32Isz_ZipDecrypter.<locals>.crc32cs<�|�����d@d@��ddd@���d?���dS)Nr�r�i�rr�r)�c)r��key0�key1�key2rr�update_keysMs
z"_ZipDecrypter.<locals>.update_keyscsNt�}|j}|D]4}�dB}|||dAd?d@N}�|�||�qt|�S)zDecrypt a bytes object.rrrr�)�	bytearrayr1�bytes)rVrCr1r��k)r�r�rr�	decrypterWs
z _ZipDecrypter.<locals>.decrypter)�	_crctabler^�mapr�r�)�pwd�pr�r)r�r�r�r�r�r�r�
_ZipDecrypter?s
r�c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�LZMACompressorcCs
d|_dS�N)�_compr�rrrr�gszLZMACompressor.__init__cCsFt�dtji�}tjtjt�tj|�gd�|_t�dddt	|��|S)N�id��filtersz<BBHr$r )
�lzmaZ_encode_filter_properties�FILTER_LZMA1r��
FORMAT_RAW�_decode_filter_propertiesr�rFr�r0)r�Zpropsrrr�_initjs
�
zLZMACompressor._initcCs*|jdkr|��|j�|�S|j�|�Sr�)r�r��compress)r�rVrrrr�qs
zLZMACompressor.compresscCs&|jdkr|��|j��S|j��Sr�)r�r��flushr�rrrr�vs
zLZMACompressor.flushN)rrrr�r�r�r�rrrrr�esr�c@seZdZdd�Zdd�ZdS)�LZMADecompressorcCsd|_d|_d|_dS)Nr-F)�_decomp�_unconsumed�eofr�rrrr�~szLZMADecompressor.__init__c	Cs�|jdkr�|j|7_t|j�dkr*dSt�d|jdd��\}t|j�d|krXdStjtjt�tj	|jdd|��gd�|_|jd|d�}|`|j�
|�}|jj|_|S)Nr r-z<Hrr�)r�r�r0rFr/r�r�r�r�r��
decompressr�)r�rVZpsizerCrrrr��s"
��

zLZMADecompressor.decompressN)rrrr�r�rrrrr�|sr�ZstoreZshrink�reduceZimplode�tokenizeZdeflateZ	deflate64Zbzip2r�ZterseZlz77ZwavpackZppmd)rrrrr r!r"r#rr$r%rrr+��a�bcCsX|tkr
nJ|tkr tsTtd��n4|tkr6tsTtd��n|tkrLtsTtd��ntd��dS)Nz.Compression requires the (missing) zlib modulez-Compression requires the (missing) bz2 modulez.Compression requires the (missing) lzma modulez(That compression method is not supported)	rr�zlib�RuntimeErrorr�bz2rr��NotImplementedError)�compressionrrr�_check_compression�s$���r�cCsj|tkr2|dk	r t�|tjd�St�tjtjd�S|tkrT|dk	rLt�|�St��S|tkrbt	�SdSdS)N��)
rr�ZcompressobjZDEFLATEDZZ_DEFAULT_COMPRESSIONrr�Z
BZ2Compressorrr�)re�
compresslevelrrr�_get_compressor�s
r�cCsvt|�|tkrdS|tkr&t�d�S|tkr6t��S|tkrDt	�St
�|�}|rdtd||f��ntd|f��dS)Nr�zcompression type %d (%s)zcompression type %d)
r�rrr�Z
decompressobjrr�ZBZ2Decompressorrr�r�r�r�)reZdescrrrr�_get_decompressor�s

r�c@s0eZdZdd�Zddd�Zd
dd�Zd	d
�ZdS)�_SharedFilecCs2||_||_||_||_||_|j|_|j|_dSr�)�_file�_pos�_close�_lock�_writing�seekablerZ)r��file�pos�close�lockZwritingrrrr��sz_SharedFile.__init__rc
CsN|j�>|��rtd��|j�||�|j��|_|jW5QR�SQRXdS)Nz}Can't reposition in the ZIP file while there is an open writing handle on it. Close the writing handle before trying to read.)rrr|rrDrZr)r�rT�whencerrrrD�sz_SharedFile.seekr�c
CsX|j�H|��rtd��|j�|j�|j�|�}|j��|_|W5QR�SQRXdS)N�yCan't read from the ZIP file while there is an open writing handle on it. Close the writing handle before trying to read.)rrr|rrDrr>rZ�r��nrVrrrr>�sz_SharedFile.readcCs$|jdk	r |j}d|_|�|�dSr�)rr)r��fileobjrrrr	s
z_SharedFile.closeN)r)r�)rrrr�rDr>r	rrrrr�s	


rc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�	_TellablecCs||_d|_dS�Nr)r<rT�r�r<rrrr�sz_Tellable.__init__cCs|j�|�}|j|7_|Sr�)r<�writerT)r�rVrrrrrsz_Tellable.writecCs|jSr�)rTr�rrrrZsz_Tellable.tellcCs|j��dSr�)r<r�r�rrrr�sz_Tellable.flushcCs|j��dSr�)r<r	r�rrrr	sz_Tellable.closeN)rrrr�rrZr�r	rrrrrs
rcs�eZdZdZdZdZdZd(dd�Zd	d
�Zdd�Z	d)dd�Z
d*dd�Zdd�Zd+dd�Z
dd�Zdd�Zdd�Zdd�Z�fdd �Zd!d"�Zd,d$d%�Zd&d'�Z�ZS)-�
ZipExtFilezZFile-like object for reading an archive member.
       Is returned by ZipFile.open().
    i@iiNFcCs(||_||_||_|j|_|j|_|j|_t	|j�|_
d|_d|_d|_
d|_||_|j|_t|d�rz|j|_td�|_nd|_d|_z4|��r�|��|_|j|_|j|_|j|_d|_Wntk
r�YnXd|_|�r$|j d@r�|j!d?d@}n|jd?d@}|�"�}||k�r$t#d	|j$��dS)
NFr-rroTrr�r�zBad password for file %r)%�_fileobj�_pwd�_close_fileobjre�_compress_typerp�_compress_leftrq�_leftr��
_decompressor�_eof�_readbuffer�_offset�newlines�moderB�namer@ro�
_expected_crcr��_running_crc�	_seekablerrZ�_orig_compress_start�_orig_compress_size�_orig_file_size�_orig_start_crc�AttributeError�
_decrypterrjrr�_init_decrypterr�rc)r�rr �zipinfor�Z
close_fileobjZ
check_byte�hrrrr�)sF




zZipExtFile.__init__cCs4t|j�|_|j�d�}|jd8_|�|�dS)Nrr&)r�rr*rr>r)r�r�rrrr+\szZipExtFile._init_decryptercCsvd|jj|jjfg}|jsX|�d|j|jf�|jtkrb|�dt	�
|j|j��n
|�d�|�d�d�|�S)N�<%s.%sz name=%r mode=%rr��	 [closed]r�r�)r�rr�closedr1r!r rrr�r�r2�r�rCrrrr�gs�
��

zZipExtFile.__repr__r�cCsL|dkr>|j�d|j�d}|dkr>|j|j|�}||_|Stj�||�S)zrRead and return a line from the stream.

        If limit is specified, at most limit bytes will be read.
        r�
r)rrwr�io�BufferedIOBase�readline)r��limitr6�linerrrr5uszZipExtFile.readlinercCsr|t|j�|jkr\|�|�}t|�|jkrJ||j|jd�|_d|_n|jt|�8_|j|j|jd�S)z6Returns buffered bytes without advancing the position.Nri)r0rrr>)r�r�chunkrrr�peek�s
zZipExtFile.peekcCsdS�NTrr�rrr�readable�szZipExtFile.readablecCs|dks|dkrH|j|jd�}d|_d|_|jsD||�|j�7}q,|S||j}|t|j�krz|j|j|�}||_|S|t|j�}|j|jd�}d|_d|_|dkr�|js�|�|�}|t|�kr�||_||_||d|�7}q�||7}|t|�8}q�|S)z�Read and return up to n bytes.
        If the argument is omitted, None, or negative, data is read and returned until EOF is reached.
        Nrr-�rrr�_read1�MAX_Nr0)r�r�buf�endrVrrrr>�s4

zZipExtFile.readcCs@|jdkrdSt||j�|_|jr<|j|jkr<td|j��dS)NzBad CRC-32 for file %r)r"r�r#rrr!)r��newdatarrr�_update_crc�s

zZipExtFile._update_crccCs|dks|dkrR|j|jd�}d|_d|_|jsN|�|j�}|r,||7}qNq,|S||j}|t|j�kr�|j|j|�}||_|S|t|j�}|j|jd�}d|_d|_|dk�r|j�s|�|�}|t|�kr�||_||_||d|�7}�q|r�||7}�qq�|S)z7Read up to n bytes with at most one read() system call.Nrr-r<)r�rr?rVr@rrr�read1�s>


zZipExtFile.read1cCs"|js|dkrdS|jtkrH|jj}|t|�krR||�|t|��7}n
|�|�}|jtkrj|jdk|_nx|jtkr�t	||j
�}|j�||�}|jjp�|jdko�|jj|_|jr�||j�
�7}n |j�|�}|jjp�|jdk|_|d|j�}|jt|�8_|jdk�rd|_|�|�|S)Nrr-T)rrrrZunconsumed_tailr0�_read2rrr_�
MIN_READ_SIZEr�r�r�rrBr
rrrr=�s4




�
zZipExtFile._read1cCsd|jdkrdSt||j�}t||j�}|j�|�}|jt|�8_|sLt�|jdk	r`|�|�}|S)Nrr-)	rr_rE�minrr>r0�EOFErrorr*r
rrrrD	s


zZipExtFile._read2cs&z|jr|j��W5t���XdSr�)�superr	rrr��r�rrr	szZipExtFile.closecCs|jSr�)r$r�rrrr szZipExtFile.seekablercCs>|jst�d��|��}|dkr&|}n.|dkr8||}n|dkrL|j|}ntd��||jkrd|j}|dkrpd}||}||j}|dkr�|t|j�kr�||_d}nf|dk�r
|j	�
|j�|j|_
|j|_|j|_d|_d|_t|j�|_d|_|}|jdk	�r
|��|dk�r6t|j|�}|�|�||8}�q
|��S)N�!underlying stream is not seekablerrrzCwhence must be os.SEEK_SET (0), os.SEEK_CUR (1), or os.SEEK_END (2)r-F)r$r3�UnsupportedOperationrZr'r|rr0rrrDr%r(r#r&rrr�rrrr*r+rF�
MAX_SEEK_READr>)r�rTrZcurr_posZnew_posZread_offsetZbuff_offsetZread_lenrrrrD#sH






zZipExtFile.seekcCs0|jst�d��|j|jt|j�|j}|S)NrJ)r$r3rKr'rr0rr)r�ZfileposrrrrZSs
zZipExtFile.tell)NF)r�)r)r�)r)rrrrr>rErLr�r+r�r5r9r;r>rBrCr=rDr	rrDrZ�
__classcell__rrrIrrs*�
3



!
%$
0rcs@eZdZdd�Zedd��Zdd�Zdd�Z�fd	d
�Z�Z	S)�
_ZipWriteFilecCs8||_||_||_t|j|j�|_d|_d|_d|_	dSr)
�_zinfo�_zip64�_zipfiler�rerf�_compressor�
_file_size�_compress_size�_crc)r��zfr�r�rrrr�[s�z_ZipWriteFile.__init__cCs|jjSr�)rQr<r�rrrresz_ZipWriteFile._fileobjcCsdSr:rr�rrr�writableisz_ZipWriteFile.writablecCsf|jrtd��t|�}|j|7_t||j�|_|jrV|j�|�}|jt|�7_|j	�
|�|S)NzI/O operation on closed file.)r0r|r0rSr�rUrRr�rTrr)r�rV�nbytesrrrrlsz_ZipWriteFile.writec	sb|jr
dS�zFt���|jrR|j��}|jt|�7_|j	�
|�|j|j_n
|j
|j_|j|j_|j
|j_|jjd@r�|jr�dnd}|j	�
t�|t|jj|jj|jj��|j	��|j_nn|js�|j
tkr�td��|jtkr�td��|j	��|j_|j	�|jj�|j	�
|j�|j��|j	�|jj�|jj�|j�|j|jj|jj <W5d|j_XdS)NFrz<LLQQz<LLLLz+File size unexpectedly exceeded ZIP64 limitz1Compressed size unexpectedly exceeded ZIP64 limit)!r0rQrrHr	rRr�rTr0rrrOrprSrUrorqrjrPrFr��
_DD_SIGNATURErZ�	start_dirr�r�rDrnr��filelistr1�
NameToInforB)r�r?r�rIrrr	xsF




�
�
�z_ZipWriteFile.close)
rrrr��propertyrrWrr	rMrrrIrrNZs

rNc@s$eZdZdZdZdZdeddfdd�dd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
d=dd�Zdd�Zdd�Zdd�Zedd��Zejdd��Zd>dd �Zd?d!d"�d#d$�Zd@d%d&�ZdAd'd(�ZdBd)d*�Zed+d,��Zd-d.�Zd/d0�ZdCd1d2�ZdDd3d4�Zd5d6�Z d7d8�Z!d9d:�Z"d;d<�Z#dS)Erai Class with methods to open, read, write, close, list zip files.

    z = ZipFile(file, mode="r", compression=ZIP_STORED, allowZip64=True,
                compresslevel=None)

    file: Either the path to the file, or a file-like object.
          If it is a path, the file will be opened and closed by ZipFile.
    mode: The mode can be either read 'r', write 'w', exclusive create 'x',
          or append 'a'.
    compression: ZIP_STORED (no compression), ZIP_DEFLATED (requires zlib),
                 ZIP_BZIP2 (requires bz2) or ZIP_LZMA (requires lzma).
    allowZip64: if True ZipFile will create files with ZIP64 extensions when
                needed, otherwise it will raise an exception when this would
                be necessary.
    compresslevel: None (default for the given compression type) or an integer
                   specifying the level to pass to the compressor.
                   When using ZIP_STORED or ZIP_LZMA this keyword has no effect.
                   When using ZIP_DEFLATED integers 0 through 9 are accepted.
                   When using ZIP_BZIP2 integers 1 through 9 are accepted.

    N�rTr�c
	CsP|dkrtd��t|�||_d|_d|_i|_g|_||_||_||_	d|_
d|_||_t
|tj�rpt�|�}t
|t�r�d|_||_ddd	d
dddd
�}||}zt�||�|_Wq�tk
r�||kr�||}Yq��Yq�Xq�q�nd|_||_t|dd�|_d|_t��|_d|_d|_�z|dk�r4|��n�|dk�r�d|_z|j� �|_!Wn2t"tfk
�r�t#|j�|_d|_!d|_Yn6Xz|j�$|j!�Wn t"tfk
�r�d|_YnXnf|dk�rz|��|j�$|j!�Wn6t%k
�r|j�$dd�d|_|j� �|_!YnXntd��Wn$|j}	d|_|�&|	��YnXdS)z]Open the ZIP file with mode read 'r', write 'w', exclusive create 'x',
        or append 'a'.)r^�w�x�az+ZipFile requires mode 'r', 'w', 'x', or 'a'FrNr-r?�w+b�x+b�r+b�wbZxb)r^r_r`rardrbrcrr!Tr^)r_r`rarz"Mode must be 'r', 'w', 'x', or 'a')'r|r��_allowZip64�
_didModify�debugr\r[r�r�r r��_comment�_strict_timestampsr�ryr�r��str�_filePassedrBr3rAr<r:�getattr�_fileRefCnt�	threading�RLockrr$r�_RealGetContentsrZrZr)rrDr�_fpclose)
r�rr r��
allowZip64r�r�ZmodeDictr�r<rrrr��s�

�





zZipFile.__init__cCs|Sr�rr�rrr�	__enter__szZipFile.__enter__cCs|��dSr��r	)r��type�value�	tracebackrrr�__exit__szZipFile.__exit__cCs�d|jj|jjfg}|jdk	rd|jr8|�d|j�n|jdk	rR|�d|j�|�d|j�n
|�d�|�d�d�|�S)Nr.z file=%rz filename=%rz mode=%rr/r�r�)	r�rrr<rlr1rBr r2r1rrrr�"s�



zZipFile.__repr__cCs�|j}zt|�}Wntk
r.td��YnX|s<td��|jdkrNt|�|t}|t}|t|_	|t
||}|ttkr�|t
t8}|jdkr�||}td|||�|||_|�|jd�|�|�}t�|�}d}||k�r�|�t�}	t|	�tk�r
td��t�t|	�}	|	ttk�r,td��|jdk�r@t|	�|�|	t�}
|	d}|d	@�rl|
�d
�}
n
|
�d�}
t|
�}|�|	t�|_|�|	t �|_!|	t"|_#|	dd�\|_$|_%|_&|_'|_(|_)}
}|_*|_+|_,|j&t-k�r�t.d
|j&d��|	dd�\|_/|_0|_1|
|_2|d?d|d?d@|d@|
d?|
d?d@|
d@df|_3|�4�|j#||_#|j5�6|�||j7|j8<|t|	t|	t|	t }|jdkr�td|�q�dS)z/Read in the table of contents for the ZIP file.zFile is not a zip filerrzgiven, inferred, offsetrzTruncated central directoryz&Bad magic number for central directoryr!r�r��cp437rzzip file version %.1fr%r(r+r$rur�r&r�totalN)9r<r9r:rrh�printrQrR�_ECD_COMMENTri�
_ECD_LOCATIONrLrKrIrErZrDr>r3�BytesIO�sizeCentralDirr0rFr/�structCentralDir�
_CD_SIGNATURE�stringCentralDir�_CD_FILENAME_LENGTH�decoder
�_CD_EXTRA_FIELD_LENGTHr3�_CD_COMMENT_LENGTHrb�_CD_LOCAL_HEADER_OFFSETrnrWrgrhrirjrerorprq�MAX_EXTRACT_VERSIONr�rkrlrmrrrdr�r[r1r\rB)r�r<rUZsize_cdZ	offset_cd�concatZinferredrVr{�centdirrB�flagsr`�t�drrrrq0s�











��

���
zZipFile._RealGetContentscCsdd�|jD�S)z+Return a list of file names in the archive.cSsg|]
}|j�qSrr�)�.0rVrrr�
<listcomp>�sz$ZipFile.namelist.<locals>.<listcomp>�r[r�rrr�namelist~szZipFile.namelistcCs|jS)zJReturn a list of class ZipInfo instances for files in the
        archive.r�r�rrr�infolist�szZipFile.infolistcCsLtdd|d�|jD]0}d|jdd�}td|j||jf|d�qdS)z+Print a table of contents for the zip file.z%-46s %19s %12s)z	File NamezModified    ZSize�rz%d-%02d-%02d %02d:%02d:%02dNr"z
%-46s %s %12d)r|r[rdrBrq)r�rr��daterrr�printdir�s�
�zZipFile.printdirc
Cs^d}|jD]N}z*|�|jd��}|�|�r,q W5QRXWq
tk
rV|jYSXq
dS)z%Read all the files and check the CRC.ir^N)r[rArBr>r)r�Z
chunk_sizer��frrr�testzip�s

zZipFile.testzipcCs$|j�|�}|dkr td|��|S)z,Return the instance of ZipInfo given 'name'.Nz(There is no item named %r in the archive)r\r��KeyError)r�r!�inforrr�getinfo�s�zZipFile.getinfocCs6|r t|t�s tdt|�j��|r,||_nd|_dS)z)Set default password for encrypted files.�pwd: expected bytes, got %sN)r�r��	TypeErrorrvrr�)r�r�rrr�setpassword�s
zZipFile.setpasswordcCs|jS)z.The comment text associated with the ZIP file.)rir�rrrrb�szZipFile.commentcCs^t|t�stdt|�j��t|�tkrNddl}|jdtdd�|dt�}||_	d|_
dS)Nzcomment: expected bytes, got %srz3Archive comment is too long; truncating to %d bytesr��
stacklevelT)r�r�r�rvrr0�ZIP_MAX_COMMENT�warnings�warnrirg)r�rbr�rrrrb�s
��c
Cs.|�|d|��}|��W5QR�SQRXdS)zReturn file bytes for name.r^N�rAr>)r�r!r�r<rrrr>�szZipFile.readF��force_zip64cs|dkrtd��|r0t|t�s0tdt|�j��|rD|dkrDtd���jsRtd��t|t�rb|}n,|dkr�t|�}�j|_	�j
|_n
��|�}|dkr��j
||d�S�jr�td���jd	7_t�j|j�j�j�fd
d��}�z|�t�}t|�tk�rtd��t�t|�}|ttk�r&td
��|�|t�}|t�rL|�|t�|jd@�r`t d��|jd@�rtt d��|t!d@�r�|�"d�}	n
|�"d�}	|	|j#k�r�td|j#|f��|jd	@}
|
�r�|�s҈j$}|�s�t%d|��nd}t&||||d�WS|�'��YnXdS)auReturn file-like object for 'name'.

        name is a string for the file name within the ZIP file, or a ZipInfo
        object.

        mode should be 'r' to read a file already in the ZIP file, or 'w' to
        write to a file newly added to the archive.

        pwd is the password to decrypt files (only used for reading).

        When writing, if the file size is not known in advance but may exceed
        2 GiB, pass force_zip64 to use the ZIP64 format, which can handle large
        files.  If the size is known in advance, it is best to pass a ZipInfo
        instance for name, with zinfo.file_size set.
        >r_r^zopen() requires mode "r" or "w"r�r_z'pwd is only supported for reading filesz2Attempt to use ZIP archive that was already closedr�rrcs�jSr�)rrr�rr�<lambda>�r-zZipFile.open.<locals>.<lambda>zTruncated file headerz Bad magic number for file header� z$compressed patched data (flag bit 5)�@zstrong encryption (flag bit 6)r�r�rzz/File name in directory %r and header %r differ.z6File %r is encrypted, password required for extractionNT)(r|r�r�r�rvrr<r
r�rer�rfr��_open_to_writerrnrrnrrrr>�sizeFileHeaderr0rrFr/r��
_FH_SIGNATUREr��_FH_FILENAME_LENGTH�_FH_EXTRA_FIELD_LENGTHrjr��_FH_GENERAL_PURPOSE_FLAG_BITSr�rcr�r�rr	)r�r!r r�r�r�Zzef_fileZfheader�fnameZ	fname_strZis_encryptedrr�rrA�s~�




�


��
�zZipFile.opencCs�|r|jstd��|jr td��t|d�s0d|_d|_d|_d|_|jt	krZ|jdO_|j
sn|jdO_|jszd|_|jo�|p�|jdtk}|j
r�|j
�|j�|j
��|_|�|�d	|_|j
�|�|��d	|_t|||�S)
NzHforce_zip64 is True, but allowZip64 was False when opening the ZIP file.zzCan't write to the ZIP file while there is another write handle open on it. Close the first handle before opening another.rqrrr��g�������?T)rfr|rr@rqrprorjrerr$rmr�r<rDrZrZrn�_writecheckrgrr�rN)r�r�r�r�rrrr�(s8
�

�
zZipFile._open_to_writecCs*|dkrt��}n
t�|�}|�|||�S)a#Extract a member from the archive to the current working directory,
           using its full name. Its file information is extracted as accurately
           as possible. `member' may be a filename or a ZipInfo object. You can
           specify a different directory using `path'.
        N)ry�getcwdr��_extract_member)r��memberr�r�rrr�extractSs

zZipFile.extractcCsH|dkr|��}|dkr"t��}n
t�|�}|D]}|�|||�q0dS)z�Extract all members from the archive to the current working
           directory. `path' specifies a different directory to extract to.
           `members' is optional and must be a subset of the list returned
           by namelist().
        N)r�ryr�r�r�)r�r��membersr�r,rrr�
extractall`s

zZipFile.extractallcCs^|j}|s(d}t�|dt|��}||_|�|�}dd�|�|�D�}|�dd�|D��}|S)z;Replace bad characters and remove trailing dots from parts.z:<>|"?*�_css|]}|�d�VqdS)�.N)�rstrip�r�r`rrr�	<genexpr>{sz1ZipFile._sanitize_windows_name.<locals>.<genexpr>css|]}|r|VqdSr�rr�rrrr�}s)�!_windows_illegal_name_trans_tablerk�	maketransr0�	translate�splitr2)r�r��pathsep�tableZillegalrrr�_sanitize_windows_nameqs
zZipFile._sanitize_windows_namec
sLt|t�s|�|�}|j�dtjj�}tjjrB|�tjjtjj�}tj�	|�d}dtjj
tjjf�tjj��fdd�|�
tjj�D��}tjjdkr�|�|tjj�}tj�||�}tj�|�}tj�|�}|r�tj�|�s�t�|�|���rtj�|��st�|�|S|j||d��(}t|d��}t�||�W5QRXW5QRX|S)	zbExtract the ZipInfo object 'member' to a physical
           file on the path targetpath.
        rvrr�c3s|]}|�kr|VqdSr�rr��Zinvalid_path_partsrrr��s�z*ZipFile._extract_member.<locals>.<genexpr>�\)r�re)r�r
r�rBr{ryr�rzr�r��curdir�pardirr2r�r�r��dirname�exists�makedirsr�r��mkdirrA�shutil�copyfileobj)r�r�Z
targetpathr�r�Z	upperdirs�source�targetrr�rr��s2

&


� zZipFile._extract_membercCs�|j|jkr(ddl}|jd|jdd�|jdkr:td��|jsHtd��t|j�|j	s�d}t
|j�tkrpd	}n|j
tkr�d
}n|jtkr�d}|r�t|d��dS)
z6Check for errors before writing a file to the archive.rNzDuplicate name: %rrr��r_r`raz&write() requires mode 'w', 'x', or 'a'z4Attempt to write ZIP archive that was already closed�Files countZFilesizezZipfile size� would require ZIP64 extensions)rBr\r�r�r r|r<r�rerfr0r[�ZIP_FILECOUNT_LIMITrqr�rnr
)r�r�r��requires_zip64rrrr��s,
�


�zZipFile._writecheckc
CsP|jstd��|jrtd��tj|||jd�}|��rDd|_d|_n0|dk	rT||_	n|j
|_	|dk	rl||_n|j|_|���r|j
��|jr�|j�|j�|j��|_|j	tkr�|jdO_|�|�d|_|j�|�||j|j<|j�|�d��|j��|_W5QRXn<t|d	��,}|�|d
��}t�||d�W5QRXW5QRXdS)zLPut the bytes from filename into the archive under the name
        arcname.�7Attempt to write to ZIP archive that was already closedz>Can't write to ZIP archive while an open writing handle existsr�rNrTFr?r_i ) r<r|rr
r�rjr�rprorer�rfr�rr$rDrZrZrnrrjr�rgr[r1r\rBrr�rAr�r�)r�rBr�rer�r��src�destrrrr�sF���


z
ZipFile.writec
Cs�t|t�r|�d�}t|t�sxt|t�t���dd�d�}|j|_|j|_	|j
ddkrpd|_|jdO_q|d	|_n|}|js�t
d
��|jr�t
d��|dk	r�||_|dk	r�||_	t|�|_|j�*|j|dd
��}|�|�W5QRXW5QRXdS)aWrite a file into the archive.  The contents is 'data', which
        may be either a 'str' or a 'bytes' instance; if it is a 'str',
        it is encoded as UTF-8 first.
        'zinfo_or_arcname' is either a ZipInfo instance or
        the name of the file in the archive.r�Nr")rBrdr�rvi�Ar)r�r�z?Can't write to ZIP archive while an open writing handle exists.r_)r )r�rkr�r
r�r�r�rer�rfrBrmr<r|rr0rqrrAr)r�Zzinfo_or_arcnamerVrer�r�r�rrr�writestr�s:


���
zZipFile.writestrcCs|��dS)z2Call the "close()" method in case the user forgot.Nrur�rrr�__del__szZipFile.__del__c	Cs||jdkrdS|jrtd��zB|jdkr\|jr\|j�"|jrJ|j�|j	�|�
�W5QRXW5|j}d|_|�|�XdS)zOClose the file, and for mode 'w', 'x' and 'a' write the ending
        records.NzvCan't close the ZIP file while there is an open writing handle on it. Close the writing handle before closing the zip.r�)r<rr|rrr rgrr$rDrZ�_write_end_recordrrrrr	s
z
ZipFile.closecCs�|jD�]D}|j}|ddd>|dd>B|dB}|dd>|d	d>B|ddB}g}|jtksr|jtkr�|�|j�|�|j�d
}d
}n|j}|j}|jtkr�|�|j�d
}n|j}|j}	d}
|�rt|	d�}	t	j
dd
t|�ddt|�f|��|	}	t}
|j
tk�r$tt|
�}
n|j
tk�r:tt|
�}
t|
|j�}t|
|j�}zZ|��\}
}t	�
tt||j||j||j
|||j||t|
�t|	�t|j�d|j|j|�}Wnltk
�rttt||j||j|j |j
|||j||t|j!�t|	�t|j�d|j|j|ft"j#d��YnX|j$�%|�|j$�%|
�|j$�%|	�|j$�%|j�q|j$�&�}t|j�}||j'}|j'}d}|t(k�r�d}n|tk�r�d}n|tk�r�d}|�r$|j)�s�t*|d��t	�
t+t,ddddd||||�}|j$�%|�t	�
t-t.d|d�}|j$�%|�t/|d�}t/|d
�}t/|d
�}t	�
t0t1dd||||t|j2��	}|j$�%|�|j$�%|j2�|j3dk�rt|j$�4�|j$�5�dS)Nrrur$rr!rrr&r r�)rr,�Qrr�r�zCentral directory offsetzCentral directory sizer��,rrra)6r[rdrqr�rpr1rnr3r8rFr�r0r�rerr_r�rr�rhrWr�r�r�rgrirorbrlrm�DeprecationWarningr|rjrBr}�stderrr<rrZrZr�rfr
rJrKrGrHrFr]r\rir �truncater�)r�r�r�r�r�r3rqrprnZ
extra_datar�rhrWrBrjr�Zpos2ZcentDirCountZcentDirSizeZ
centDirOffsetr�Zzip64endrecZzip64locrecrUrrrr�5s$$
�


���
���





���


�
zZipFile._write_end_recordcCs&|jd8_|js"|js"|��dS)Nr)rnrlr	rrrrrr�szZipFile._fpclose)N)N)r^N)F)NN)NNN)NNN)NN)$rrrrr<r�rr�rtryr�rqr�r�r�r�r�r�r]rb�setterr>rAr�r�r�r�r�r�r�rr�r�r	r�rrrrrrr�sT��ZN
	
		


b
+


*�
2�
)hc@s4eZdZdZdeddfdd�Zd
d	d
�Zdd�ZdS)rzDClass to create ZIP archives with Python library files and packages.r^Tr�cCstj|||||d�||_dS)N)r r�rs)rr��	_optimize)r�rr r�rs�optimizerrrr��s�zPyZipFile.__init__r�NcCs�t�|�}|rD||�sD|jr@tj�|�r,dnd}td||f�dStj�|�\}}tj�|��rhtj�|d�}tj�|��r�|r�d||f}n|}|jr�td|d|�|�	|d	d
�|�\}}	|jr�td|	�|�
||	�tt�|��}
|
�
d�|
D]�}tj�||�}tj�|�\}
}tj�|��rRtj�tj�|d���r�|j|||d�q�|d
kr�|�r~||��s~|jr�td|�q�|�	|d	d
�|�\}}	|j�r�td|	�|�
||	�q�n�|j�r�td|�tt�|��D]�}tj�||�}tj�|�\}
}|d
k�r�|�r,||��s,|j�r�td|��q�|�	|d	d
�|�\}}	|j�rVtd|	�|�
||	��q�nP|d
d�d
k�r�td��|�	|d	d
�|�\}}	|j�r�td|	�|�
||	�dS)a�Add all files from "pathname" to the ZIP archive.

        If pathname is a package directory, search the directory and
        all package subdirectories recursively for all *.py and enter
        the modules into the archive.  If pathname is a plain
        directory, listdir *.py and enter all modules.  Else, pathname
        must be a Python *.py file and the module will be put into the
        archive.  Added modules are always module.pyc.
        This method will compile the module.py into module.pyc if
        necessary.
        If filterfunc(pathname) is given, it is called with every argument.
        When it is False, the file or directory is skipped.
        r�rz%s %r skipped by filterfuncNz__init__.py�%s/%szAdding package in�asr���ZAdding)�
filterfunc�.pyzfile %r skipped by filterfunczAdding files from directoryz.Files added with writepy() must end with ".py"zAdding file)ryr�rhr�r�r|r�r2�isfile�
_get_codenamer�sorted�listdir�remove�splitext�writepyr�)r��pathname�basenamer�Zlabel�dirr!Zinitnamer�r�ZdirlistrBr��rootZextrrrr��s�


��


�
�
zPyZipFile.writepyc
sd�fdd�	}|d}|d}tjj|dd�}tjj|dd�}tjj|d	d�}�jdk�r\tj�|�r�t�|�jt�|�jkr�|}	}
n�tj�|�r�t�|�jt�|�jkr�|}
|}	n�tj�|�r�t�|�jt�|�jkr�|}
|}	nvtj�|��rt�|�jt�|�jk�r|}
|}	nD||��rRt	j
jd
k�r4|}
nt	j
jdk�rH|}
n|}
|}	n|}
}	n��jd
k�rr|}
|}	n<|}	�jdk�r�|}
n&�jd	k�r�|}
nd��j�}t
|��tj�|
��r�t�|
�jt�|�jk�s�||�jd��s�|}
}	tj�|	�d}|�rd
||f}|
|fS)aReturn (filename, archivename) for the path.

        Given a module name path, return the correct file path and
        archive name, compiling if necessary.  For example, given
        /python/lib/string, return (/python/lib/string.pyc, string).
        r�c
sfddl}�jrtd|�z|j|d|d�Wn4|jk
r`}zt|j�WY�dSd}~XYnXdS)NrZ	CompilingT)�doraiser�F)�
py_compilerhr|�compile�PyCompileError�msg)rr�r��errr�rr�_compiles

z)PyZipFile._get_codename.<locals>._compiler�z.pycr�)�optimizationrrrz"invalid value for 'optimize': {!r})r�r�)r�)�	importlib�util�cache_from_sourcer�ryr�r�r�r�r}r�r��formatr|r�)
r�r�r�r�Zfile_pyZfile_pycZpycache_opt0Zpycache_opt1Zpycache_opt2r�r�r�Zarchivenamerr�rr��sj�
���

�zPyZipFile._get_codename)r�N)rrrrrr�r�r�rrrrr�s�

RcCst�t|�dd�S)a2
    Given a path with elements separated by
    posixpath.sep, generate all parents of that path.

    >>> list(_parents('b/d'))
    ['b']
    >>> list(_parents('/b/d/'))
    ['/b']
    >>> list(_parents('b/d/f/'))
    ['b/d', 'b']
    >>> list(_parents('b'))
    []
    >>> list(_parents(''))
    []
    rN)�	itertools�islice�	_ancestry)r�rrr�_parentsRsrccs4|�tj�}|r0|tjkr0|Vt�|�\}}qdS)aR
    Given a path with elements separated by
    posixpath.sep, generate all elements of that path

    >>> list(_ancestry('b/d'))
    ['b/d', 'b']
    >>> list(_ancestry('/b/d/'))
    ['/b/d', '/b']
    >>> list(_ancestry('b/d/f/'))
    ['b/d/f', 'b/d', 'b']
    >>> list(_ancestry('b'))
    ['b']
    >>> list(_ancestry(''))
    []
    N)r��	posixpathrzr�)r��tailrrrresrcCst�t|�j|�S)zZ
    Return items in minuend not in subtrahend, retaining order
    with O(1) lookup.
    )r�filterfalse�set�__contains__)ZminuendZ
subtrahendrrr�_differencesr	csHeZdZdZedd��Z�fdd�Zdd�Zdd	�Ze	d
d��Z
�ZS)�CompleteDirszk
    A ZipFile subclass that ensures that implied directories
    are always included in the namelist.
    cCs.tj�tt|��}dd�|D�}tt||��S)Ncss|]}|tjVqdSr�)rrz)r�r�rrrr��sz-CompleteDirs._implied_dirs.<locals>.<genexpr>)r�chain�
from_iterabler�r�_deduper	)�names�parentsZas_dirsrrr�
_implied_dirs�szCompleteDirs._implied_dirscs tt|���}|t|�|��Sr�)rHr
r�r^r)r�rrIrrr��szCompleteDirs.namelistcCst|���Sr�)rr�r�rrr�	_name_set�szCompleteDirs._name_setcCs,|��}|d}||ko||k}|r(|S|S)zx
        If the name represents a directory, return that name
        as a directory (with the trailing slash).
        rv)r)r�r!rr�Z	dir_matchrrr�resolve_dir�szCompleteDirs.resolve_dircCsNt|t�r|St|t�s ||�Sd|jkr.t}|�|�}t|��t|��|S)zl
        Given a source (filename or zipfile), return an
        appropriate CompleteDirs subclass.
        r^)r�r
rr �__new__�vars�update)r�r��resrrr�make�s



zCompleteDirs.make)rrrr�staticmethodrr�rrr�rrMrrrIrr
�s

r
cs,eZdZdZ�fdd�Z�fdd�Z�ZS)�
FastLookupzV
    ZipFile subclass to ensure implicit
    dirs exist and are resolved rapidly.
    c
s:t�t��|jW5QR�SQRXtt|���|_|jSr�)�
contextlib�suppressr)Z_FastLookup__namesrHrr�r�rIrrr��szFastLookup.namelistc
s:t�t��|jW5QR�SQRXtt|���|_|jSr�)rrr)Z_FastLookup__lookuprHrrr�rIrrr�szFastLookup._name_set)rrrrr�rrMrrrIrr�src@s�eZdZdZdZd#dd�Zedd��Zedd	��Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�ZeZed d!��Zd"S)$ru�
    A pathlib-compatible interface for zip files.

    Consider a zip file with this structure::

        .
        ├── a.txt
        └── b
            ├── c.txt
            └── d
                └── e.txt

    >>> data = io.BytesIO()
    >>> zf = ZipFile(data, 'w')
    >>> zf.writestr('a.txt', 'content of a')
    >>> zf.writestr('b/c.txt', 'content of c')
    >>> zf.writestr('b/d/e.txt', 'content of e')
    >>> zf.filename = 'abcde.zip'

    Path accepts the zipfile object itself or a filename

    >>> root = Path(zf)

    From there, several path operations are available.

    Directory iteration (including the zip file itself):

    >>> a, b = root.iterdir()
    >>> a
    Path('abcde.zip', 'a.txt')
    >>> b
    Path('abcde.zip', 'b/')

    name property:

    >>> b.name
    'b'

    join with divide operator:

    >>> c = b / 'c.txt'
    >>> c
    Path('abcde.zip', 'b/c.txt')
    >>> c.name
    'c.txt'

    Read text:

    >>> c.read_text()
    'content of c'

    existence:

    >>> c.exists()
    True
    >>> (b / 'missing.txt').exists()
    False

    Coercion to string:

    >>> str(c)
    'abcde.zip/b/c.txt'
    z>{self.__class__.__name__}({self.root.filename!r}, {self.at!r})r�cCst�|�|_||_dSr�)rrr��at)r�r�rrrrr�	sz
Path.__init__cCst�|jj|j�Sr�)�	functools�partialr�rArr�rrrrA	sz	Path.opencCst�|j�d��S�Nrv)rr�rr�r�rrrr!	sz	Path.namec
Os6|���$}tj|f|�|���W5QR�SQRXdSr�)rAr3�
TextIOWrapperr>)r��args�kwargs�strmrrr�	read_text	s
zPath.read_textc
Cs(|���}|��W5QR�SQRXdSr�r�)r�r#rrr�
read_bytes	s
zPath.read_bytescCst�|j�d��|j�d�kSr)rr�rr�)r�r�rrr�	_is_child"	szPath._is_childcCst|j|�Sr�)rr�)r�rrrr�_next%	sz
Path._nextcCs|jp|j�d�Sr)r�endswithr�rrrr�(	szPath.is_dircCs
|��Sr�)r�r�rrr�is_file+	szPath.is_filecCs|j|j��kSr�)rr�rr�rrrr�.	szPath.existscCs.|��std��t|j|j���}t|j|�S)NzCan't listdir a file)r�r|r�r'r�r��filterr&)r�Zsubsrrr�iterdir1	szPath.iterdircCst�|jj|j�Sr�)rr2r�rBrr�rrr�__str__7	szPath.__str__cCs|jj|d�S)Nr�)�_Path__reprr�r�rrrr�:	sz
Path.__repr__cCs t�|j|�}|�|j�|��Sr�)rr2rr'r�r)r��add�nextrrr�joinpath=	sz
Path.joinpathcCs(t�|j�d��}|r|d7}|�|�Sr)rr�rr�r')r�Z	parent_atrrr�parentC	szPath.parentN)r�)rrrrr-r�r]rAr!r$r%r&r'r�r)r�r+r,r�r0�__truediv__r1rrrrr�s*@


c
	s�ddl}d}|j|d�}|jdd�}|jdddd	d
�|jddd
ddd�|jdddddd�|jddddd
�|�|�}|jdk	r�|j}t|d��}|��}W5QRX|r�td�	|��td�n�|j
dk	r�|j
}t|d��}|��W5QRXn�|jdk	�r,|j\}}t|d��}|�
|�W5QRXn�|jdk	�r�|j�d�}	|j}
�fdd��t|	d��\}|
D]P}tj�|�}|�s�tj�tj�|��}|dtjtjfk�r�d}�|||��qfW5QRXdS) Nrz3A simple command-line interface for zipfile module.)�descriptionT)Zrequiredz-lz--list�	<zipfile>zShow listing of a zipfile)�metavar�helpz-ez	--extractr)r4z<output_dir>zExtract zipfile into target dir)�nargsr5r6z-cz--create�+)z<name>z<file>zCreate zipfile from sourcesz-tz--testzTest if a zipfile is validr^z.The following enclosed file is corrupted: {!r}zDone testingcsptj�|�r|�||t�nPtj�|�rl|r8|�||�tt�|��D]$}�|tj�||�tj�||��qFdSr�)	ryr�r�rrr�r�r�r2)rVr��zippathZnm��addToZiprrr;s	s�zmain.<locals>.addToZipr_r�)�argparse�ArgumentParserZadd_mutually_exclusive_group�add_argument�
parse_argsZtestrr�r|r�r^r�r�r�Zcreate�popryr�r�r�r�r�)
r!r<r3�parser�groupr�rVZbadfiler�Zzip_name�filesr�r9rr:r�mainK	s\
�
�
�
�




rD�__main__)N)N)�rZbinasciir�importlib.utilr�r3rryrr�r�rFr}ror�rr�r��ImportErrorr�r��__all__�	Exceptionrr
rrr�r�r�rrrrrr�r�r�r�r]r\r�r[rLrMrNrOrPrQrRrar}r~r�r�r�r�Z_CD_CREATE_VERSIONZ_CD_CREATE_SYSTEMZ_CD_EXTRACT_VERSIONZ_CD_EXTRACT_SYSTEMZ
_CD_FLAG_BITSZ_CD_COMPRESS_TYPEZ_CD_TIMEZ_CD_DATEZ_CD_CRCZ_CD_COMPRESSED_SIZEZ_CD_UNCOMPRESSED_SIZEr�r�r�Z_CD_DISK_NUMBER_STARTZ_CD_INTERNAL_FILE_ATTRIBUTESZ_CD_EXTERNAL_FILE_ATTRIBUTESr�r�r�r�r�Z_FH_EXTRACT_VERSIONZ_FH_EXTRACT_SYSTEMr�Z_FH_COMPRESSION_METHODZ_FH_LAST_MOD_TIMEZ_FH_LAST_MOD_DATEZ_FH_CRCZ_FH_COMPRESSED_SIZEZ_FH_UNCOMPRESSED_SIZEr�r�rGrHrErJrKrIZ_CD64_SIGNATUREZ_CD64_DIRECTORY_RECSIZEZ_CD64_CREATE_VERSIONZ_CD64_EXTRACT_VERSIONZ_CD64_DISK_NUMBERZ_CD64_DISK_NUMBER_STARTZ_CD64_NUMBER_ENTRIES_THIS_DISKZ_CD64_NUMBER_ENTRIES_TOTALZ_CD64_DIRECTORY_SIZEZ_CD64_OFFSET_START_CENTDIRrYZStructr.r8r=r	rXr9�objectr
r�r�r�r�r�r�r�r�r�rrr4rrNrrrr�dict�fromkeysr
r	r
rrrDrrrrr�<module>sl


�






+=q&�
&AN/2
=
__pycache__/secrets.cpython-38.opt-1.pyc000064400000004220151153537570014025 0ustar00U

e5d��@s�dZddddddddgZd	d
lZd	d
lZd	d
lZd	dlmZd	dlmZe�Z	e	j
Ze	jZd
d�Z
dZddd�Zddd�Zddd�Zd
S)z�Generate cryptographically strong pseudo-random numbers suitable for
managing secrets such as account authentication, tokens, and similar.

See PEP 506 for more information.
https://www.python.org/dev/peps/pep-0506/

�choice�	randbelow�randbits�SystemRandom�token_bytes�	token_hex�
token_urlsafe�compare_digest�N)r)rcCs|dkrtd��t�|�S)z(Return a random int in the range [0, n).r	zUpper bound must be positive.)�
ValueError�_sysrandZ
_randbelow)Zexclusive_upper_bound�r�/usr/lib64/python3.8/secrets.pyrs� cCs|dkrt}t�|�S)z�Return a random byte string containing *nbytes* bytes.

    If *nbytes* is ``None`` or not supplied, a reasonable
    default is used.

    >>> token_bytes(16)  #doctest:+SKIP
    b'\xebr\x17D*t\xae\xd4\xe3S\xb6\xe2\xebP1\x8b'

    N)�DEFAULT_ENTROPY�os�urandom��nbytesrrr
r#s
cCst�t|���d�S)a"Return a random text string, in hexadecimal.

    The string has *nbytes* random bytes, each byte converted to two
    hex digits.  If *nbytes* is ``None`` or not supplied, a reasonable
    default is used.

    >>> token_hex(16)  #doctest:+SKIP
    'f9bf78b9a18ce6d46a0cd2b0b86df9da'

    �ascii)�binasciiZhexlifyr�decoderrrr
r1scCst|�}t�|��d��d�S)z�Return a random URL-safe text string, in Base64 encoding.

    The string has *nbytes* random bytes.  If *nbytes* is ``None``
    or not supplied, a reasonable default is used.

    >>> token_urlsafe(16)  #doctest:+SKIP
    'Drmhze6EPcv0fN_81Bj-nA'

    �=r)r�base64Zurlsafe_b64encode�rstripr)r�tokrrr
r>s
)N)N)N)�__doc__�__all__rrrZhmacrZrandomrrZgetrandbitsrrrrrrrrrrr
�<module>s&�


__pycache__/imghdr.cpython-38.opt-1.pyc000064400000010030151153537570013623 0ustar00U

e5d��@s2dZddlmZdgZd%dd�ZgZdd�Ze�e�dd	�Ze�e�d
d�Z	e�e	�dd
�Z
e�e
�dd�Ze�e�dd�Ze�e�dd�Z
e�e
�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�d d!�Zd"d#�Zed$k�r.e�dS)&z<Recognize image file formats based on their first few bytes.�)�PathLike�whatNcCs�d}zp|dkrNt|ttf�r2t|d�}|�d�}n|��}|�d�}|�|�tD]}|||�}|rR|W�SqRW5|r�|��XdS)N�rb� )	�close�
isinstance�strr�open�read�tell�seek�tests)�file�h�f�locationZtf�res�r�/usr/lib64/python3.8/imghdr.pyrs 




cCs|dd�dkrdSdS)z JPEG data in JFIF or Exif format��
)sJFIFsExifZjpegNr�rrrrr�	test_jpeg%srcCs|�d�rdSdS)Ns�PNG

Zpng��
startswithrrrr�test_png,s
rcCs|dd�dkrdSdS)zGIF ('87 and '89 variants)Nr)sGIF87asGIF89aZgifrrrrr�test_gif2srcCs|dd�dkrdSdS)z-TIFF (can be in Motorola or Intel byte order)N�)sMMsIIZtiffrrrrr�	test_tiff9srcCs|�d�rdSdS)zSGI image librarys�ZrgbNrrrrr�test_rgb@s
rcCs<t|�dkr8|dtd�kr8|ddkr8|ddkr8dSd	S)
zPBM (portable bitmap)�r�P�s14r� 	

ZpbmN��len�ordrrrr�test_pbmGs�
�
�r'cCs<t|�dkr8|dtd�kr8|ddkr8|ddkr8dSd	S)
zPGM (portable graymap)r rr!r"s25rr#ZpgmNr$rrrr�test_pgmOs�
�
�r(cCs<t|�dkr8|dtd�kr8|ddkr8|ddkr8dSd	S)
zPPM (portable pixmap)r rr!r"s36rr#ZppmNr$rrrr�test_ppmWs�
�
�r)cCs|�d�rdSdS)zSun raster filesY�j�ZrastNrrrrr�	test_rast_s
r*cCs|�d�rdSdS)zX bitmap (X10 or X11)s#define ZxbmNrrrrr�test_xbmfs
r+cCs|�d�rdSdS)NsBMZbmprrrrr�test_bmpms
r,cCs"|�d�r|dd�dkrdSdS)NsRIFF��sWEBPZwebprrrrr�	test_webpssr/cCs|�d�rdSdS)Nsv/1Zexrrrrrr�test_exrys
r0cCs�ddl}d}|jdd�r8|jddkr8|jdd�=d}z8|jdd�r`t|jdd�|d�ntdg|d�Wn*tk
r�|j�d�|�d�YnXdS)Nrr"z-rr�.z
[Interrupted]
)�sys�argv�testall�KeyboardInterrupt�stderr�write�exit)r2�	recursiverrr�test�sr:c	Cs�ddl}ddl}|D]�}|j�|�r~t|ddd�|s<|rttd�ddl}|�|j�|�|�d��}t||d�q�td�qt|ddd�|j	�
�ztt|��Wqtk
r�td	�YqXqdS)
Nrz/:� )�endzrecursing down:�*z*** directory (use -r) ***�:z*** not found ***)
r2�os�path�isdir�print�glob�join�escaper4�stdout�flushr�OSError)�listr9Ztoplevelr2r?�filenamerC�namesrrrr4�s"

r4�__main__)N)�__doc__r?r�__all__rr
r�appendrrrrr'r(r)r*r+r,r/r0r:r4�__name__rrrr�<module>sD














__pycache__/re.cpython-38.pyc000064400000034130151153537570012027 0ustar00U

e5d�=�@s�dZddlZddlZddlZddlZzddlZWnek
rHdZYnXddddddd	d
ddd
ddddddddddddddddddgZd ZGd!d"�d"ej	�Z
e��e
j
�ejZd@d#d�ZdAd$d�ZdBd%d�ZdCd&d�ZdDd'd�ZdEd(d�ZdFd)d	�ZdGd*d
�ZdHd+d�Zd,d�ZdId-d
�Zd.d/�d0D�Zd1d�Zee�d2d��Zee�d2d��d2��ZiZd3Z d4d5�Z!e�"e �d6d7��Z#d8d9�Z$d:d;�Z%ddl&Z&d<d=�Z'e&�(ee'e!�Gd>d?�d?�Z)dS)Ja�Support for regular expressions (RE).

This module provides regular expression matching operations similar to
those found in Perl.  It supports both 8-bit and Unicode strings; both
the pattern and the strings being processed can contain null bytes and
characters outside the US ASCII range.

Regular expressions can contain both special and ordinary characters.
Most ordinary characters, like "A", "a", or "0", are the simplest
regular expressions; they simply match themselves.  You can
concatenate ordinary characters, so last matches the string 'last'.

The special characters are:
    "."      Matches any character except a newline.
    "^"      Matches the start of the string.
    "$"      Matches the end of the string or just before the newline at
             the end of the string.
    "*"      Matches 0 or more (greedy) repetitions of the preceding RE.
             Greedy means that it will match as many repetitions as possible.
    "+"      Matches 1 or more (greedy) repetitions of the preceding RE.
    "?"      Matches 0 or 1 (greedy) of the preceding RE.
    *?,+?,?? Non-greedy versions of the previous three special characters.
    {m,n}    Matches from m to n repetitions of the preceding RE.
    {m,n}?   Non-greedy version of the above.
    "\\"     Either escapes special characters or signals a special sequence.
    []       Indicates a set of characters.
             A "^" as the first character indicates a complementing set.
    "|"      A|B, creates an RE that will match either A or B.
    (...)    Matches the RE inside the parentheses.
             The contents can be retrieved or matched later in the string.
    (?aiLmsux) The letters set the corresponding flags defined below.
    (?:...)  Non-grouping version of regular parentheses.
    (?P<name>...) The substring matched by the group is accessible by name.
    (?P=name)     Matches the text matched earlier by the group named name.
    (?#...)  A comment; ignored.
    (?=...)  Matches if ... matches next, but doesn't consume the string.
    (?!...)  Matches if ... doesn't match next.
    (?<=...) Matches if preceded by ... (must be fixed length).
    (?<!...) Matches if not preceded by ... (must be fixed length).
    (?(id/name)yes|no) Matches yes pattern if the group with id/name matched,
                       the (optional) no pattern otherwise.

The special sequences consist of "\\" and a character from the list
below.  If the ordinary character is not on the list, then the
resulting RE will match the second character.
    \number  Matches the contents of the group of the same number.
    \A       Matches only at the start of the string.
    \Z       Matches only at the end of the string.
    \b       Matches the empty string, but only at the start or end of a word.
    \B       Matches the empty string, but not at the start or end of a word.
    \d       Matches any decimal digit; equivalent to the set [0-9] in
             bytes patterns or string patterns with the ASCII flag.
             In string patterns without the ASCII flag, it will match the whole
             range of Unicode digits.
    \D       Matches any non-digit character; equivalent to [^\d].
    \s       Matches any whitespace character; equivalent to [ \t\n\r\f\v] in
             bytes patterns or string patterns with the ASCII flag.
             In string patterns without the ASCII flag, it will match the whole
             range of Unicode whitespace characters.
    \S       Matches any non-whitespace character; equivalent to [^\s].
    \w       Matches any alphanumeric character; equivalent to [a-zA-Z0-9_]
             in bytes patterns or string patterns with the ASCII flag.
             In string patterns without the ASCII flag, it will match the
             range of Unicode alphanumeric characters (letters plus digits
             plus underscore).
             With LOCALE, it will match the set [0-9_] plus characters defined
             as letters for the current locale.
    \W       Matches the complement of \w.
    \\       Matches a literal backslash.

This module exports the following functions:
    match     Match a regular expression pattern to the beginning of a string.
    fullmatch Match a regular expression pattern to all of a string.
    search    Search a string for the presence of a pattern.
    sub       Substitute occurrences of a pattern found in a string.
    subn      Same as sub, but also return the number of substitutions made.
    split     Split a string by the occurrences of a pattern.
    findall   Find all occurrences of a pattern in a string.
    finditer  Return an iterator yielding a Match object for each match.
    compile   Compile a pattern into a Pattern object.
    purge     Clear the regular expression cache.
    escape    Backslash all non-alphanumerics in a string.

Each function other than purge and escape can take an optional 'flags' argument
consisting of one or more of the following module constants, joined by "|".
A, L, and U are mutually exclusive.
    A  ASCII       For string patterns, make \w, \W, \b, \B, \d, \D
                   match the corresponding ASCII character categories
                   (rather than the whole Unicode categories, which is the
                   default).
                   For bytes patterns, this flag is the only available
                   behaviour and needn't be specified.
    I  IGNORECASE  Perform case-insensitive matching.
    L  LOCALE      Make \w, \W, \b, \B, dependent on the current locale.
    M  MULTILINE   "^" matches the beginning of lines (after a newline)
                   as well as the string.
                   "$" matches the end of lines (before a newline) as well
                   as the end of the string.
    S  DOTALL      "." matches any character at all, including the newline.
    X  VERBOSE     Ignore whitespace and comments for nicer looking RE's.
    U  UNICODE     For compatibility only. Ignored for string patterns (it
                   is the default), and forbidden for bytes patterns.

This module also defines an exception 'error'.

�N�match�	fullmatch�search�sub�subn�split�findall�finditer�compile�purge�template�escape�error�Pattern�Match�A�I�L�M�S�X�U�ASCII�
IGNORECASE�LOCALE�	MULTILINE�DOTALL�VERBOSE�UNICODEz2.2.1c@speZdZejZZejZZ	ej
ZZej
ZZejZZejZZejZZejZZejZdd�Zej Z dS)�	RegexFlagcCs�|jdk	rd|j��S|j}g}|dk}|r2|}|jD],}||j@r8||jM}|�d|j���q8|rx|�t|��d�|�}|r�t|�dkr�d|�d�}n
d|��}|S)Nzre.r�|�z~(�)�~)�_name_�_value_�	__class__�append�hex�join�len)�self�value�members�negative�m�res�r1�/usr/lib64/python3.8/re.py�__repr__�s&




zRegexFlag.__repr__N)!�__name__�
__module__�__qualname__�sre_compile�SRE_FLAG_ASCIIrr�SRE_FLAG_IGNORECASErr�SRE_FLAG_LOCALErr�SRE_FLAG_UNICODErr�SRE_FLAG_MULTILINErr�SRE_FLAG_DOTALLrr�SRE_FLAG_VERBOSErr�SRE_FLAG_TEMPLATE�TEMPLATE�T�SRE_FLAG_DEBUG�DEBUGr3�object�__str__r1r1r1r2r�s







rcCst||��|�S)zqTry to apply the pattern at the start of the string, returning
    a Match object, or None if no match was found.)�_compiler��pattern�string�flagsr1r1r2r�scCst||��|�S)zkTry to apply the pattern to all of the string, returning
    a Match object, or None if no match was found.)rFrrGr1r1r2r�scCst||��|�S)ztScan through string looking for a match to the pattern, returning
    a Match object, or None if no match was found.)rFrrGr1r1r2r�scCst||��|||�S)aZReturn the string obtained by replacing the leftmost
    non-overlapping occurrences of the pattern in string by the
    replacement repl.  repl can be either a string or a callable;
    if a string, backslash escapes in it are processed.  If it is
    a callable, it's passed the Match object and must return
    a replacement string to be used.)rFr�rH�replrI�countrJr1r1r2r�scCst||��|||�S)a�Return a 2-tuple containing (new_string, number).
    new_string is the string obtained by replacing the leftmost
    non-overlapping occurrences of the pattern in the source
    string by the replacement repl.  number is the number of
    substitutions that were made. repl can be either a string or a
    callable; if a string, backslash escapes in it are processed.
    If it is a callable, it's passed the Match object and must
    return a replacement string to be used.)rFrrKr1r1r2r�s	cCst||��||�S)a�Split the source string by the occurrences of the pattern,
    returning a list containing the resulting substrings.  If
    capturing parentheses are used in pattern, then the text of all
    groups in the pattern are also returned as part of the resulting
    list.  If maxsplit is nonzero, at most maxsplit splits occur,
    and the remainder of the string is returned as the final element
    of the list.)rFr)rHrI�maxsplitrJr1r1r2r�scCst||��|�S)aReturn a list of all non-overlapping matches in the string.

    If one or more capturing groups are present in the pattern, return
    a list of groups; this will be a list of tuples if the pattern
    has more than one group.

    Empty matches are included in the result.)rFrrGr1r1r2r�scCst||��|�S)z�Return an iterator over all non-overlapping matches in the
    string.  For each match, the iterator returns a Match object.

    Empty matches are included in the result.)rFr	rGr1r1r2r	�scCs
t||�S)zACompile a regular expression pattern, returning a Pattern object.)rF�rHrJr1r1r2r
�scCst��t��dS)z#Clear the regular expression cachesN)�_cache�clear�
_compile_repl�cache_clearr1r1r1r2r�scCst||tB�S)z6Compile a template pattern, returning a Pattern object)rFrArOr1r1r2rscCsi|]}|dt|��qS)�\)�chr)�.0�ir1r1r2�
<dictcomp>srXs()[]{}?*+-|^$\.&~# 	

cCs2t|t�r|�t�St|d�}|�t��d�SdS)z0
    Escape special characters in a string.
    �latin1N)�
isinstance�str�	translate�_special_chars_map�encode)rHr1r1r2r
s


�ic
Cs�t|t�r|j}ztt|�||fWStk
r8YnXt|t�rT|rPtd��|St�	|�sft
d��t�||�}|t@s�t
t�tkr�ztttt��=Wntttfk
r�YnX|tt|�||f<|S)Nz5cannot process flags argument with a compiled patternz1first argument must be string or compiled pattern)rZrr,rP�type�KeyErrorr�
ValueErrorr7�isstring�	TypeErrorr
rCr*�	_MAXCACHE�next�iter�
StopIteration�RuntimeError)rHrJ�pr1r1r2rF!s.

�
rFcCst�||�S�N)�	sre_parse�parse_template)rLrHr1r1r2rR;srRcCst�||�}t�||�Srk)rlrm�expand_template)rHrrr1r1r2�_expand@srocCs>t||�}|ds.t|d�dkr.|ddS|fdd�}|S)Nrr!cSst�||�Srk)rlrn)rrr1r1r2�filterKsz_subx.<locals>.filter)rRr*)rHrrpr1r1r2�_subxEs

rqcCst|j|jffSrk)rFrHrJ)rjr1r1r2�_pickleSsrrc@seZdZddd�Zdd�ZdS)�Scannerrc
Cs�ddlm}m}t|t�r |j}||_g}t��}||_	|D]H\}}|�
�}	|�t�|||	ddt�
||�ffg��|�|	|d�q<t�||d|ffg�}t�|�|_dS)Nr)�BRANCH�
SUBPATTERN���)�
sre_constantsrtrurZrr,�lexiconrl�StaterJ�	opengroupr'�
SubPattern�parse�
closegroupr7r
�scanner)
r+rxrJrtrurj�s�phrase�action�gidr1r1r2�__init__\s

�zScanner.__init__c	Cs�g}|j}|j�|�j}d}|�}|s(q�|��}||kr:q�|j|jdd}t|�rj||_|||���}|dk	rz||�|}q|||d�fS)Nrr!)r'r~r�endrx�	lastindex�callable�group)	r+rI�resultr'rrWr/�jr�r1r1r2�scanms$zScanner.scanN)r)r4r5r6r�r�r1r1r1r2rs[s
rs)r)r)r)rr)rr)rr)r)r)r)r)*�__doc__�enumr7rl�	functools�_locale�ImportError�__all__�__version__�IntFlagr�globals�update�__members__rrrrrrrrr	r
rrr]r
r`rrrPrerF�	lru_cacherRrorq�copyregrr�picklersr1r1r1r2�<module>s�k
�#



	







	

__pycache__/_pydecimal.cpython-38.opt-1.pyc000064400000471741151153537570014503 0ustar00U

e5d:}�%@s�dZddddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%g%ZeZd&Zd'Zd(Zd)d*lZd)d*lZ	d)d*l
Z
zd)d+lmZ
e
dd,�ZWnek
r�d-d.�ZYnXdZdZdZdZdZdZdZdZd/Zd/Ze
jd0kr�d1Zd1Zd2Znd3Zd3Zd4Zeed5ZGd6d�de�Z Gd7d�de �Z!Gd8d	�d	e �Z"Gd9d�de"�Z#Gd:d
�d
e e$�Z%Gd;d�de"�Z&Gd<d�de"e$�Z'Gd=d�de �Z(Gd>d�de"�Z)Gd?d�de �Z*Gd@d
�d
e �Z+GdAd�de(e*�Z,GdBd�de(e*e+�Z-GdCd�de e.�Z/e!e%e(e,e*e-e"e+e/g	Z0e#e"e&e"e'e"e)e"iZ1eeeeeeeefZ2d)d*l3Z3e3�4dD�Z5dEd�Z6dFd�Z7[3d�dGd�Z8GdHd�de9�Z:d�dJdK�Z;e	j<�=e:�GdLdM�dMe9�Z>GdNd�de9�Z?GdOdP�dPe9�Z@d�dQdR�ZAeBjCZDdSdT�ZEdUdV�ZFdWdX�ZGdYdZ�ZHd�d\d]�ZId^d_�ZJd`da�ZKGdbdc�dce9�ZLeL�jMZNd�ddde�ZOdfdg�ZPdhdi�ZQdjdkdldmdndodpdqdrds�	fdtdu�ZRd�dvdw�ZSd�dxdy�ZTe?dzee%e,e"ggd{d|d5d)d}�ZUe?d~ee%e,e"e!e-ggd�ZVe?d~eggd�ZWd)d*lXZXeX�Yd�eXjZeXj[B�j\Z]eX�Yd��j\Z^eX�Yd��j\Z_eX�Yd�eXjZeXj`B�Za[Xzd)d*lbZcWnek
�rYnXd�d�d��Zdd�d��Zed�d��Zfd�d�d��Zgd�d��Zhd�d��Zie:d��Zje:d��Zke:d��Zle:d)�Zme:d5�Zne:d��ZoejekfZpe
jqjrZse
jqjtZue
jqjvZwexdqesd�es�Zy[
d*S)�a�	
This is an implementation of decimal floating point arithmetic based on
the General Decimal Arithmetic Specification:

    http://speleotrove.com/decimal/decarith.html

and IEEE standard 854-1987:

    http://en.wikipedia.org/wiki/IEEE_854-1987

Decimal floating point has finite precision with arbitrarily large bounds.

The purpose of this module is to support arithmetic using familiar
"schoolhouse" rules and to avoid some of the tricky representation
issues associated with binary floating point.  The package is especially
useful for financial applications or for contexts where users have
expectations that are at odds with binary floating point (for instance,
in binary floating point, 1.00 % 0.1 gives 0.09999999999999995 instead
of 0.0; Decimal('1.00') % Decimal('0.1') returns the expected
Decimal('0.00')).

Here are some examples of using the decimal module:

>>> from decimal import *
>>> setcontext(ExtendedContext)
>>> Decimal(0)
Decimal('0')
>>> Decimal('1')
Decimal('1')
>>> Decimal('-.0123')
Decimal('-0.0123')
>>> Decimal(123456)
Decimal('123456')
>>> Decimal('123.45e12345678')
Decimal('1.2345E+12345680')
>>> Decimal('1.33') + Decimal('1.27')
Decimal('2.60')
>>> Decimal('12.34') + Decimal('3.87') - Decimal('18.41')
Decimal('-2.20')
>>> dig = Decimal(1)
>>> print(dig / Decimal(3))
0.333333333
>>> getcontext().prec = 18
>>> print(dig / Decimal(3))
0.333333333333333333
>>> print(dig.sqrt())
1
>>> print(Decimal(3).sqrt())
1.73205080756887729
>>> print(Decimal(3) ** 123)
4.85192780976896427E+58
>>> inf = Decimal(1) / Decimal(0)
>>> print(inf)
Infinity
>>> neginf = Decimal(-1) / Decimal(0)
>>> print(neginf)
-Infinity
>>> print(neginf + inf)
NaN
>>> print(neginf * inf)
-Infinity
>>> print(dig / 0)
Infinity
>>> getcontext().traps[DivisionByZero] = 1
>>> print(dig / 0)
Traceback (most recent call last):
  ...
  ...
  ...
decimal.DivisionByZero: x / 0
>>> c = Context()
>>> c.traps[InvalidOperation] = 0
>>> print(c.flags[InvalidOperation])
0
>>> c.divide(Decimal(0), Decimal(0))
Decimal('NaN')
>>> c.traps[InvalidOperation] = 1
>>> print(c.flags[InvalidOperation])
1
>>> c.flags[InvalidOperation] = 0
>>> print(c.flags[InvalidOperation])
0
>>> print(c.divide(Decimal(0), Decimal(0)))
Traceback (most recent call last):
  ...
  ...
  ...
decimal.InvalidOperation: 0 / 0
>>> print(c.flags[InvalidOperation])
1
>>> c.flags[InvalidOperation] = 0
>>> c.traps[InvalidOperation] = 0
>>> print(c.divide(Decimal(0), Decimal(0)))
NaN
>>> print(c.flags[InvalidOperation])
1
>>>
�Decimal�Context�DecimalTuple�DefaultContext�BasicContext�ExtendedContext�DecimalException�Clamped�InvalidOperation�DivisionByZero�Inexact�Rounded�	Subnormal�Overflow�	Underflow�FloatOperation�DivisionImpossible�InvalidContext�ConversionSyntax�DivisionUndefined�
ROUND_DOWN�
ROUND_HALF_UP�ROUND_HALF_EVEN�
ROUND_CEILING�ROUND_FLOOR�ROUND_UP�ROUND_HALF_DOWN�
ROUND_05UP�
setcontext�
getcontext�localcontext�MAX_PREC�MAX_EMAX�MIN_EMIN�	MIN_ETINY�HAVE_THREADS�HAVE_CONTEXTVARZdecimalz1.70z2.4.2�N)�
namedtuplezsign digits exponentcGs|S�N�)�argsr)r)�"/usr/lib64/python3.8/_pydecimal.py�<lambda>��r,Tl����l��N�Zol������N�Zoi@�Ti����c@seZdZdZdd�ZdS)ra1Base exception class.

    Used exceptions derive from this.
    If an exception derives from another exception besides this (such as
    Underflow (Inexact, Rounded, Subnormal) that indicates that it is only
    called if the others are present.  This isn't actually used for
    anything, though.

    handle  -- Called when context._raise_error is called and the
               trap_enabler is not set.  First argument is self, second is the
               context.  More arguments can be given, those being after
               the explanation in _raise_error (For example,
               context._raise_error(NewError, '(-x)!', self._sign) would
               call NewError().handle(context, self._sign).)

    To define a new exception, it should be sufficient to have it derive
    from DecimalException.
    cGsdSr(r)��self�contextr*r)r)r+�handle�szDecimalException.handleN��__name__�
__module__�__qualname__�__doc__r2r)r)r)r+r�sc@seZdZdZdS)ra)Exponent of a 0 changed to fit bounds.

    This occurs and signals clamped if the exponent of a result has been
    altered in order to fit the constraints of a specific concrete
    representation.  This may occur when the exponent of a zero result would
    be outside the bounds of a representation, or when a large normal
    number would have an encoded exponent that cannot be represented.  In
    this latter case, the exponent is reduced to fit and the corresponding
    number of zero digits are appended to the coefficient ("fold-down").
    N�r4r5r6r7r)r)r)r+r�sc@seZdZdZdd�ZdS)r	a0An invalid operation was performed.

    Various bad things cause this:

    Something creates a signaling NaN
    -INF + INF
    0 * (+-)INF
    (+-)INF / (+-)INF
    x % 0
    (+-)INF % x
    x._rescale( non-integer )
    sqrt(-x) , x > 0
    0 ** 0
    x ** (non-integer)
    x ** (+-)INF
    An operand is invalid

    The result of the operation after these is a quiet positive NaN,
    except when the cause is a signaling NaN, in which case the result is
    also a quiet NaN, but with the original sign, and an optional
    diagnostic information.
    cGs,|r(t|dj|djdd�}|�|�StS)Nr&�nT)�_dec_from_triple�_sign�_int�_fix_nan�_NaN)r0r1r*�ansr)r)r+r2�s
zInvalidOperation.handleNr3r)r)r)r+r	�sc@seZdZdZdd�ZdS)rz�Trying to convert badly formed string.

    This occurs and signals invalid-operation if a string is being
    converted to a number and it does not conform to the numeric string
    syntax.  The result is [0,qNaN].
    cGstSr(�r>r/r)r)r+r2szConversionSyntax.handleNr3r)r)r)r+rsc@seZdZdZdd�ZdS)r
a�Division by 0.

    This occurs and signals division-by-zero if division of a finite number
    by zero was attempted (during a divide-integer or divide operation, or a
    power operation with negative right-hand operand), and the dividend was
    not zero.

    The result of the operation is [sign,inf], where sign is the exclusive
    or of the signs of the operands for divide, or is 1 for an odd power of
    -0, for power.
    cGst|Sr()�_SignedInfinity�r0r1�signr*r)r)r+r2szDivisionByZero.handleNr3r)r)r)r+r

sc@seZdZdZdd�ZdS)rz�Cannot perform the division adequately.

    This occurs and signals invalid-operation if the integer result of a
    divide-integer or remainder operation had too many digits (would be
    longer than precision).  The result is [0,qNaN].
    cGstSr(r@r/r)r)r+r2"szDivisionImpossible.handleNr3r)r)r)r+rsc@seZdZdZdd�ZdS)rz�Undefined result of division.

    This occurs and signals invalid-operation if division by zero was
    attempted (during a divide-integer, divide, or remainder operation), and
    the dividend is also zero.  The result is [0,qNaN].
    cGstSr(r@r/r)r)r+r2-szDivisionUndefined.handleNr3r)r)r)r+r%sc@seZdZdZdS)ra�Had to round, losing information.

    This occurs and signals inexact whenever the result of an operation is
    not exact (that is, it needed to be rounded and any discarded digits
    were non-zero), or if an overflow or underflow condition occurs.  The
    result in all cases is unchanged.

    The inexact signal may be tested (or trapped) to determine if a given
    operation (or sequence of operations) was inexact.
    Nr8r)r)r)r+r0sc@seZdZdZdd�ZdS)ra�Invalid context.  Unknown rounding, for example.

    This occurs and signals invalid-operation if an invalid context was
    detected during an operation.  This can occur if contexts are not checked
    on creation and either the precision exceeds the capability of the
    underlying concrete representation or an unknown or unsupported rounding
    was specified.  These aspects of the context need only be checked when
    the values are required to be used.  The result is [0,qNaN].
    cGstSr(r@r/r)r)r+r2GszInvalidContext.handleNr3r)r)r)r+r<s
c@seZdZdZdS)ra�Number got rounded (not  necessarily changed during rounding).

    This occurs and signals rounded whenever the result of an operation is
    rounded (that is, some zero or non-zero digits were discarded from the
    coefficient), or if an overflow or underflow condition occurs.  The
    result in all cases is unchanged.

    The rounded signal may be tested (or trapped) to determine if a given
    operation (or sequence of operations) caused a loss of precision.
    Nr8r)r)r)r+rJsc@seZdZdZdS)r
a�Exponent < Emin before rounding.

    This occurs and signals subnormal whenever the result of a conversion or
    operation is subnormal (that is, its adjusted exponent is less than
    Emin, before any rounding).  The result in all cases is unchanged.

    The subnormal signal may be tested (or trapped) to determine if a given
    or operation (or sequence of operations) yielded a subnormal result.
    Nr8r)r)r)r+r
Vsc@seZdZdZdd�ZdS)raNumerical overflow.

    This occurs and signals overflow if the adjusted exponent of a result
    (from a conversion or from an operation that is not an attempt to divide
    by zero), after rounding, would be greater than the largest value that
    can be handled by the implementation (the value Emax).

    The result depends on the rounding mode:

    For round-half-up and round-half-even (and for round-half-down and
    round-up, if implemented), the result of the operation is [sign,inf],
    where sign is the sign of the intermediate result.  For round-down, the
    result is the largest finite number that can be represented in the
    current precision, with the sign of the intermediate result.  For
    round-ceiling, the result is the same as for round-down if the sign of
    the intermediate result is 1, or is [0,inf] otherwise.  For round-floor,
    the result is the same as for round-down if the sign of the intermediate
    result is 0, or is [1,inf] otherwise.  In all cases, Inexact and Rounded
    will also be raised.
    cGs�|jttttfkrt|S|dkrR|jtkr4t|St|d|j|j	|jd�S|dkr�|jt
krlt|St|d|j|j	|jd�SdS)Nr&�9r.)�roundingrrrrrArr:�prec�EmaxrrBr)r)r+r2ws"�
�
�zOverflow.handleNr3r)r)r)r+rasc@seZdZdZdS)raxNumerical underflow with result rounded to 0.

    This occurs and signals underflow if a result is inexact and the
    adjusted exponent of the result would be smaller (more negative) than
    the smallest value that can be handled by the implementation (the value
    Emin).  That is, the result is both inexact and subnormal.

    The result after an underflow will be a subnormal number rounded, if
    necessary, so that its exponent is not less than Etiny.  This may result
    in 0 with the sign of the intermediate result and an exponent of Etiny.

    In all cases, Inexact, Rounded, and Subnormal will also be raised.
    Nr8r)r)r)r+r�sc@seZdZdZdS)ra�Enable stricter semantics for mixing floats and Decimals.

    If the signal is not trapped (default), mixing floats and Decimals is
    permitted in the Decimal() constructor, context.create_decimal() and
    all comparison operators. Both conversion and comparisons are exact.
    Any occurrence of a mixed operation is silently recorded by setting
    FloatOperation in the context flags.  Explicit conversions with
    Decimal.from_float() or context.create_decimal_from_float() do not
    set the flag.

    Otherwise (the signal is trapped), only equality comparisons and explicit
    conversions are silent. All other mixed operations raise FloatOperation.
    Nr8r)r)r)r+r�sZdecimal_contextcCs8z
t��WStk
r2t�}t�|�|YSXdS)z�Returns this thread's context.

    If this thread does not yet have a context, returns
    a new context and sets this thread's context.
    New contexts are copies of DefaultContext.
    N)�_current_context_var�get�LookupErrorr�set�r1r)r)r+r�s

cCs,|tttfkr|��}|��t�|�dS)z%Set this thread's context to context.N)rrr�copy�clear_flagsrHrKrLr)r)r+r�scCs|dkrt�}t|�S)abReturn a context manager for a copy of the supplied context

    Uses a copy of the current context if no context is specified
    The returned context manager creates a local decimal context
    in a with statement:
        def sin(x):
             with localcontext() as ctx:
                 ctx.prec += 2
                 # Rest of sin calculation algorithm
                 # uses a precision 2 greater than normal
             return +s  # Convert result to normal precision

         def sin(x):
             with localcontext(ExtendedContext):
                 # Rest of sin calculation algorithm
                 # uses the Extended Context from the
                 # General Decimal Arithmetic Specification
             return +s  # Convert result to normal context

    >>> setcontext(DefaultContext)
    >>> print(getcontext().prec)
    28
    >>> with localcontext():
    ...     ctx = getcontext()
    ...     ctx.prec += 2
    ...     print(ctx.prec)
    ...
    30
    >>> with localcontext(ExtendedContext):
    ...     print(getcontext().prec)
    ...
    9
    >>> print(getcontext().prec)
    28
    N)r�_ContextManager)Zctxr)r)r+r�s$c
@s�eZdZdZdZd�dd�Zedd��Zd	d
�Zdd�Z	d�d
d�Z
dd�Zdd�Zdd�Z
d�dd�Zd�dd�Zd�dd�Zd�dd�Zd�dd�Zd�dd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd�d*d+�Zd�d,d-�Zd�d.d/�Zd�d0d1�Zd�d3d4�Zd�d5d6�ZeZ�dd7d8�Z�dd9d:�Z �dd;d<�Z!e!Z"�dd=d>�Z#d?d@�Z$�ddAdB�Z%�ddCdD�Z&�ddEdF�Z'�ddGdH�Z(�ddIdJ�Z)�d	dKdL�Z*�d
dMdN�Z+�ddOdP�Z,dQdR�Z-dSdT�Z.e.Z/e0dUdV��Z1e0dWdX��Z2dYdZ�Z3d[d\�Z4d]d^�Z5d_d`�Z6dadb�Z7dcdd�Z8dedf�Z9dgdh�Z:didj�Z;dkdl�Z<dmdn�Z=dodp�Z>e?e7e8e9e:e;e<e=e>dq�Z@�ddrds�ZAdtdu�ZBdvdw�ZC�d
dxdy�ZD�ddzd{�ZEd|d}�ZF�dd~d�ZG�dd�d��ZH�dd�d��ZI�dd�d��ZJ�dd�d��ZKd�d��ZLd�d��ZM�dd�d��ZN�dd�d��ZOeOZP�dd�d��ZQ�dd�d��ZR�dd�d��ZSd�d��ZTd�d��ZUd�d��ZVd�d��ZW�dd�d��ZX�dd�d��ZY�dd�d��ZZd�d��Z[d�d��Z\�dd�d��Z]�dd�d��Z^d�d��Z_d�d��Z`d�d��Zad�d��Zb�dd�d��Zcd�d��Zdd�d��Zed�d��Zf�dd�d��Zgd�d��Zhd�d��Zi�d d�dÄZjd�dńZk�d!d�dDŽZl�d"d�dɄZmd�d˄Znd�d̈́Zo�d#d�dτZp�d$d�dфZq�d%d�dӄZr�d&d�dՄZs�d'd�dׄZt�d(d�dلZu�d)d�dۄZv�d*d�d݄Zw�d+d�d߄Zx�d,d�d�Zyd�d�Zz�d-d�d�Z{�d.d�d�Z|�d/d�d�Z}d�d�Z~d�d�Zd�d�Z��d0d�d�Z�dS(1rz,Floating point class for decimal arithmetic.)�_expr<r;�_is_special�0NcCs�t�|�}t|t��r$t|���dd��}|dkrP|dkr@t�}|�t	d|�S|�
d�dkrfd|_nd|_|�
d	�}|dk	r�|�
d
�p�d}t|�
d�p�d�}tt||��|_
|t|�|_d
|_nZ|�
d�}|dk	�rtt|p�d���d�|_
|�
d��rd|_nd|_nd|_
d|_d|_|St|t��rf|dk�rBd|_nd|_d|_tt|��|_
d
|_|St|t��r�|j|_|j|_|j
|_
|j|_|St|t��r�|j|_t|j�|_
t|j�|_d
|_|St|ttf��r"t|�dk�r�td��t|dt��r|ddk�std��|d|_|ddk�rHd|_
|d|_d|_n�g}	|dD]R}
t|
t��r�d|
k�r|dk�r�nn|	�s�|
dk�r�|	�|
�ntd���qT|ddk�r�d�tt|	��|_
|d|_d|_nDt|dt��rd�tt|	�p�dg��|_
|d|_d
|_ntd��|St|t��rx|dk�r>t�}|�td�t�|�}|j|_|j|_|j
|_
|j|_|St d|��dS)a�Create a decimal point instance.

        >>> Decimal('3.14')              # string input
        Decimal('3.14')
        >>> Decimal((0, (3, 1, 4), -2))  # tuple (sign, digit_tuple, exponent)
        Decimal('3.14')
        >>> Decimal(314)                 # int
        Decimal('314')
        >>> Decimal(Decimal(314))        # another decimal instance
        Decimal('314')
        >>> Decimal('  3.14  \n')        # leading and trailing whitespace okay
        Decimal('3.14')
        �_�NzInvalid literal for Decimal: %rrC�-r.r&�intZfrac�exprRF�diag�signal�Nr9�FT�ztInvalid tuple size in creation of Decimal from list or tuple.  The list or tuple should have exactly three elements.�r&r.z|Invalid sign.  The first value in the tuple should be an integer; either 0 for a positive number or 1 for a negative number.��	zTThe second value in the tuple must be composed of integers in the range 0 through 9.�r9rZzUThe third value in the tuple must be an integer, or one of the strings 'F', 'n', 'N'.�;strict semantics for mixing floats and Decimals are enabledzCannot convert %r to Decimal)!�object�__new__�
isinstance�str�_parser�strip�replacer�_raise_errorr�groupr;rVr<�lenrPrQ�lstrip�absr�_WorkReprCrW�list�tuple�
ValueError�append�join�map�floatr�
from_float�	TypeError)�cls�valuer1r0�m�intpart�fracpartrWrX�digitsZdigitr)r)r+rc
s�
�





(


�
zDecimal.__new__cCs�t|t�r,|dkrdnd}d}tt|��}nzt|t�r�t�|�sJt�|�rV|t|��St�	d|�dkrld}nd}t|��
�\}}|��d}t|d|�}ntd��t
|||�}|tkr�|S||�SdS)a.Converts a float to a decimal number, exactly.

        Note that Decimal.from_float(0.1) is not the same as Decimal('0.1').
        Since 0.1 is not exactly representable in binary floating point, the
        value is stored as the nearest representable value which is
        0x1.999999999999ap-4.  The exact equivalent of the value in decimal
        is 0.1000000000000000055511151231257827021181583404541015625.

        >>> Decimal.from_float(0.1)
        Decimal('0.1000000000000000055511151231257827021181583404541015625')
        >>> Decimal.from_float(float('nan'))
        Decimal('NaN')
        >>> Decimal.from_float(float('inf'))
        Decimal('Infinity')
        >>> Decimal.from_float(-float('inf'))
        Decimal('-Infinity')
        >>> Decimal.from_float(-0.0)
        Decimal('-0')

        r&r.g�?�zargument must be int or float.N)rdrVrermru�_mathZisinfZisnan�reprZcopysign�as_integer_ratio�
bit_lengthrwr:r)rx�frC�k�coeffr9�d�resultr)r)r+rv�s$

zDecimal.from_floatcCs(|jr$|j}|dkrdS|dkr$dSdS)zrReturns whether the number is not actually one.

        0 if a number
        1 if NaN
        2 if sNaN
        r9r.rZr^r&)rQrP)r0rWr)r)r+�_isnan�szDecimal._isnancCs|jdkr|jrdSdSdS)zyReturns whether the number is infinite

        0 if finite or not a number
        1 if +INF
        -1 if -INF
        r[���r.r&)rPr;�r0r)r)r+�_isinfinity�s

zDecimal._isinfinitycCs||��}|dkrd}n|��}|s&|rx|dkr4t�}|dkrJ|�td|�S|dkr`|�td|�S|rn|�|�S|�|�SdS)z�Returns whether the number is not actually one.

        if self, other are sNaN, signal
        if self, other are NaN return nan
        return 0

        Done before operations.
        NFr^�sNaNr&)r�rrir	r=)r0�otherr1�self_is_nan�other_is_nanr)r)r+�_check_nans�s&
��

zDecimal._check_nanscCsv|dkrt�}|js|jrr|��r0|�td|�S|��rF|�td|�S|��r\|�td|�S|��rr|�td|�SdS)aCVersion of _check_nans used for the signaling comparisons
        compare_signal, __le__, __lt__, __ge__, __gt__.

        Signal InvalidOperation if either self or other is a (quiet
        or signaling) NaN.  Signaling NaNs take precedence over quiet
        NaNs.

        Return 0 if neither operand is a NaN.

        Nzcomparison involving sNaNzcomparison involving NaNr&)rrQ�is_snanrir	�is_qnan�r0r�r1r)r)r+�_compare_check_nans	s0����zDecimal._compare_check_nanscCs|jp|jdkS)zuReturn True if self is nonzero; otherwise return False.

        NaNs and infinities are considered nonzero.
        rR�rQr<r�r)r)r+�__bool__*szDecimal.__bool__cCs|js|jr8|��}|��}||kr(dS||kr4dSdS|sP|sDdSd|jS|s^d|jS|j|jkrndS|j|jkr~dS|��}|��}||kr�|jd|j|j}|jd|j|j}||kr�dS||kr�d|jSd|jSn ||k�rd|jSd|jSdS)z�Compare the two non-NaN decimal instances self and other.

        Returns -1 if self < other, 0 if self == other and 1
        if self > other.  This routine is for internal use only.r&r�r.rRN)rQr�r;�adjustedr<rP)r0r�Zself_infZ	other_inf�
self_adjustedZother_adjusted�self_paddedZother_paddedr)r)r+�_cmp1s>


zDecimal._cmpcCs<t||dd�\}}|tkr|S|�||�r.dS|�|�dkS)NT)�equality_opFr&)�_convert_for_comparison�NotImplementedr�r�r�r)r)r+�__eq__qszDecimal.__eq__cCs<t||�\}}|tkr|S|�||�}|r.dS|�|�dkS�NFr&�r�r�r�r��r0r�r1r?r)r)r+�__lt__yszDecimal.__lt__cCs<t||�\}}|tkr|S|�||�}|r.dS|�|�dkSr�r�r�r)r)r+�__le__�szDecimal.__le__cCs<t||�\}}|tkr|S|�||�}|r.dS|�|�dkSr�r�r�r)r)r+�__gt__�szDecimal.__gt__cCs<t||�\}}|tkr|S|�||�}|r.dS|�|�dkSr�r�r�r)r)r+�__ge__�szDecimal.__ge__cCs>t|dd�}|js|r0|jr0|�||�}|r0|St|�|��S)z�Compare self to other.  Return a decimal value:

        a or b is a NaN ==> Decimal('NaN')
        a < b           ==> Decimal('-1')
        a == b          ==> Decimal('0')
        a > b           ==> Decimal('1')
        T��raiseit)�_convert_otherrQr�rr�r�r)r)r+�compare�szDecimal.comparecCs�|jr4|��rtd��n|��r$tS|jr0tStS|jdkrNtd|jt	�}ntt
|jt	�}t|j�|t	}|dkr||n|}|dkr�dS|S)zx.__hash__() <==> hash(x)z"Cannot hash a signaling NaN value.r&�
r����)
rQr�rw�is_nan�_PyHASH_NANr;�_PyHASH_INFrP�pow�_PyHASH_MODULUS�
_PyHASH_10INVrVr<)r0Zexp_hashZhash_r?r)r)r+�__hash__�s

zDecimal.__hash__cCst|jttt|j��|j�S)zeRepresents the number as a triple tuple.

        To show the internals exactly as they are.
        )rr;rprtrVr<rPr�r)r)r+�as_tuple�szDecimal.as_tuplecCs�|jr |��rtd��ntd��|s(dSt|j�}|jdkrR|d|jd}}nn|j}|dkr�|ddkr�|d}|d8}qZ|j}t||@��d|�}|r�||L}||8}d||>}|j	r�|}||fS)a�Express a finite Decimal instance in the form n / d.

        Returns a pair (n, d) of integers.  When called on an infinity
        or NaN, raises OverflowError or ValueError respectively.

        >>> Decimal('3.14').as_integer_ratio()
        (157, 50)
        >>> Decimal('-123e5').as_integer_ratio()
        (-12300000, 1)
        >>> Decimal('0.00').as_integer_ratio()
        (0, 1)

        z#cannot convert NaN to integer ratioz(cannot convert Infinity to integer ratior]r&r�r.r~)
rQr�rq�
OverflowErrorrVr<rP�minr�r;)r0r9r�Zd5Zd2Zshift2r)r)r+r��s,



zDecimal.as_integer_ratiocCsdt|�S)z0Represents the number as an instance of Decimal.z
Decimal('%s'))rer�r)r)r+�__repr__szDecimal.__repr__Fc	Csbddg|j}|jrL|jdkr&|dS|jdkr>|d|jS|d|jS|jt|j�}|jdkrt|d	krt|}n6|s~d
}n,|jdkr�|d
dd
}n|d
dd
}|dkr�d}d
d||j}nL|t|j�kr�|jd|t|j�}d}n |jd|�}d
|j|d�}||k�r(d}n*|dk�r8t�}ddg|jd||}||||S)z�Return string representation of the number in scientific notation.

        Captures all of the information in the underlying representation.
        rTrUr[ZInfinityr9�NaNr�r&���r.rRr\�.N�e�Ez%+d)r;rQrPr<rkr�capitals)	r0�engr1rC�
leftdigits�dotplacer{r|rWr)r)r+�__str__s:




zDecimal.__str__cCs|jd|d�S)a,Convert to a string, using engineering notation if an exponent is needed.

        Engineering notation has an exponent which is a multiple of 3.  This
        can leave up to 3 digits to the left of the decimal place and may
        require the addition of either one or two trailing zeros.
        T)r�r1)r��r0r1r)r)r+�
to_eng_string;szDecimal.to_eng_stringcCsR|jr|j|d�}|r|S|dkr(t�}|s@|jtkr@|��}n|��}|�|�S)zRReturns a copy with the sign switched.

        Rounds, if it has reason.
        rLN)rQr�rrEr�copy_abs�copy_negate�_fix�r0r1r?r)r)r+�__neg__Ds
zDecimal.__neg__cCsR|jr|j|d�}|r|S|dkr(t�}|s@|jtkr@|��}nt|�}|�|�S)zhReturns a copy, unless it is a sNaN.

        Rounds the number (if more than precision digits)
        rLN)rQr�rrErr�rr�r�r)r)r+�__pos__Zs
zDecimal.__pos__TcCsJ|s|��S|jr&|j|d�}|r&|S|jr:|j|d�}n|j|d�}|S)z�Returns the absolute value of self.

        If the keyword argument 'round' is false, do not round.  The
        expression self.__abs__(round=False) is equivalent to
        self.copy_abs().
        rL)r�rQr�r;r�r�)r0�roundr1r?r)r)r+�__abs__oszDecimal.__abs__c
Csht|�}|tkr|S|dkr"t�}|js.|jr�|�||�}|rB|S|��rr|j|jkrj|��rj|�td�St	|�S|��r�t	|�St
|j|j�}d}|jt
kr�|j|jkr�d}|s�|s�t
|j|j�}|r�d}t|d|�}|�|�}|S|�st||j|jd�}|�||j�}|�|�}|S|�sVt||j|jd�}|�||j�}|�|�}|St|�}t|�}t|||j�\}}t�}	|j|jk�r�|j|jk�r�t|d|�}|�|�}|S|j|jk�r�||}}|jdk�r�d|	_|j|j|_|_nd|	_n&|jdk�rd|	_d\|_|_nd|	_|jdk�r<|j|j|	_n|j|j|	_|j|	_t	|	�}|�|�}|S)zbReturns self + other.

        -INF + INF (or the reverse) cause InvalidOperation errors.
        Nz
-INF + INFr&r.rR)r&r&)r�r�rrQr�r�r;rir	rr�rPrErr:r��maxrF�_rescalern�
_normalizerCrVrW)
r0r�r1r?rWZnegativezerorC�op1�op2r�r)r)r+�__add__�s|





zDecimal.__add__cCsHt|�}|tkr|S|js |jr6|j||d�}|r6|S|j|��|d�S)zReturn self - otherrL)r�r�rQr�r�r�r�r)r)r+�__sub__�szDecimal.__sub__cCs"t|�}|tkr|S|j||d�S)zReturn other - selfrL)r�r�r�r�r)r)r+�__rsub__�szDecimal.__rsub__cCs@t|�}|tkr|S|dkr"t�}|j|jA}|js:|jr�|�||�}|rN|S|��rn|sf|�td�St	|S|��r�|s�|�td�St	|S|j
|j
}|r�|s�t|d|�}|�|�}|S|j
dkr�t||j
|�}|�|�}|S|j
dk�r
t||j
|�}|�|�}|St|�}t|�}t|t|j|j�|�}|�|�}|S)z\Return self * other.

        (+-) INF * 0 (or its reverse) raise InvalidOperation.
        Nz(+-)INF * 0z0 * (+-)INFrR�1)r�r�rr;rQr�r�rir	rArPr:r�r<rnrerV)r0r�r1Z
resultsignr?Z	resultexpr�r�r)r)r+�__mul__�sH




zDecimal.__mul__cCs�t|�}|tkrtS|dkr"t�}|j|jA}|js:|jr�|�||�}|rN|S|��rj|��rj|�td�S|��rzt	|S|��r�|�t
d�t|d|���S|s�|s�|�t
d�S|�td|�S|s�|j|j}d}n�t|j�t|j�|jd}|j|j|}t|�}t|�}	|dk�r:t|jd	||	j�\}}
nt|j|	jd	|�\}}
|
�rt|d
dk�r�|d7}n8|j|j}||k�r�|d	dk�r�|d	}|d7}�q�t|t|�|�}|�|�S)zReturn self / other.Nz(+-)INF/(+-)INFzDivision by infinityrRz0 / 0zx / 0r&r.r�r~)r�r�rr;rQr�r�rir	rArr:�Etinyrr
rPrkr<rFrn�divmodrVrer�)r0r�r1rCr?rWr��shiftr�r��	remainder�	ideal_expr)r)r+�__truediv__,sP

zDecimal.__truediv__cCs|j|jA}|��r|j}nt|j|j�}|��|��}|rN|��sN|dkrht|dd�|�||j�fS||jk�r
t	|�}t	|�}|j
|j
kr�|jd|j
|j
9_n|jd|j
|j
9_t|j|j�\}}	|d|jk�r
t|t
|�d�t|jt
|	�|�fS|�td�}
|
|
fS)z�Return (self // other, self % other), to context.prec precision.

        Assumes that neither self nor other is a NaN, that self is not
        infinite and that other is nonzero.
        r�rRr&r�z%quotient too large in //, % or divmod)r;r�rPr�r�r:r�rErFrnrWrVr�rerir)r0r�r1rCr��expdiffr�r��q�rr?r)r)r+�_dividegs0
���zDecimal._dividecCs"t|�}|tkr|S|j||d�S)z)Swaps self/other and returns __truediv__.rL)r�r�r�r�r)r)r+�__rtruediv__�szDecimal.__rtruediv__cCs�t|�}|tkr|S|dkr"t�}|�||�}|r:||fS|j|jA}|��r~|��rj|�td�}||fSt||�td�fS|s�|s�|�t	d�}||fS|�t
d|�|�td�fS|�||�\}}|�|�}||fS)z6
        Return (self // other, self % other)
        Nzdivmod(INF, INF)�INF % xzdivmod(0, 0)�x // 0�x % 0)
r�r�rr�r;r�rir	rArr
r�r�)r0r�r1r?rCZquotientr�r)r)r+�
__divmod__�s4
�
�
zDecimal.__divmod__cCs"t|�}|tkr|S|j||d�S)z(Swaps self/other and returns __divmod__.rL)r�r�r�r�r)r)r+�__rdivmod__�szDecimal.__rdivmod__cCs�t|�}|tkr|S|dkr"t�}|�||�}|r6|S|��rJ|�td�S|sj|r^|�td�S|�td�S|�||�d}|�	|�}|S)z
        self % other
        Nr�r�z0 % 0r.)
r�r�rr�r�rir	rr�r�)r0r�r1r?r�r)r)r+�__mod__�s"
zDecimal.__mod__cCs"t|�}|tkr|S|j||d�S)z%Swaps self/other and returns __mod__.rL)r�r�r�r�r)r)r+�__rmod__�szDecimal.__rmod__cCs�|dkrt�}t|dd�}|�||�}|r.|S|��rB|�td�S|sb|rV|�td�S|�td�S|��r|t|�}|�|�St	|j
|j
�}|s�t|jd|�}|�|�S|�
�|�
�}||jdkr�|�t�S|d	kr�|�||j�}|�|�St|�}t|�}|j|jk�r(|jd
|j|j9_n|jd
|j|j9_t|j|j�\}}	d|	|d@|jk�r~|	|j8}	|d7}|d
|jk�r�|�t�S|j}
|	dk�r�d|
}
|	}	t|
t|	�|�}|�|�S)
zI
        Remainder nearest to 0-  abs(remainder-near) <= other/2
        NTr�zremainder_near(infinity, x)zremainder_near(x, 0)zremainder_near(0, 0)rRr.r�r�r^r&)rr�r�r�rir	rrr�r�rPr:r;r�rFrr�rErnrWrVr�re)r0r�r1r?�ideal_exponentr�r�r�r�r�rCr)r)r+�remainder_near�s`���






zDecimal.remainder_nearcCs�t|�}|tkr|S|dkr"t�}|�||�}|r6|S|��rb|��rR|�td�St|j|jAS|s�|r�|�t	d|j|jA�S|�t
d�S|�||�dS)z
self // otherNz
INF // INFr�z0 // 0r&)r�r�rr�r�rir	rAr;r
rr�r�r)r)r+�__floordiv__'s&
�zDecimal.__floordiv__cCs"t|�}|tkr|S|j||d�S)z*Swaps self/other and returns __floordiv__.rL)r�r�r�r�r)r)r+�
__rfloordiv__CszDecimal.__rfloordiv__cCs8|��r(|��rtd��|jr"dnd}nt|�}t|�S)zFloat representation.z%Cannot convert signaling NaN to floatz-nan�nan)r�r�rqr;reru�r0�sr)r)r+�	__float__JszDecimal.__float__cCst|jr(|��rtd��n|��r(td��d|j}|jdkrT|t|j�d|jS|t|jd|j�pjd�SdS)z1Converts self to an int, truncating if necessary.zCannot convert NaN to integerz"Cannot convert infinity to integerr�r&r�NrR)	rQr�rqr�r�r;rPrVr<r�r)r)r+�__int__Ts


zDecimal.__int__cCs|Sr(r)r�r)r)r+�realcszDecimal.realcCstd�S)Nr&�rr�r)r)r+�imaggszDecimal.imagcCs|Sr(r)r�r)r)r+�	conjugatekszDecimal.conjugatecCstt|��Sr()�complexrur�r)r)r+�__complex__nszDecimal.__complex__cCsR|j}|j|j}t|�|krJ|t|�|d��d�}t|j||jd�St|�S)z2Decapitate the payload of a NaN to fit the contextNrRT)	r<rF�clamprkrlr:r;rPr)r0r1ZpayloadZmax_payload_lenr)r)r+r=qszDecimal._fix_nancCsX|jr |��r|�|�St|�S|��}|��}|s�|j|g|j}tt	|j
|�|�}||j
krx|�t�t
|jd|�St|�St|j�|j
|j}||kr�|�td|j�}|�t�|�t�|S||k}|r�|}|j
|k�r�t|j�|j
|}	|	dk�rt
|jd|d�}d}	|j|j}
|
||	�}|jd|	��p>d}|dk�r~tt|�d�}t|�|jk�r~|dd�}|d7}||k�r�|�td|j�}nt
|j||�}|�r�|�r�|�t�|�r�|�t�|�r�|�t�|�t�|�s�|�t�|S|�r|�t�|jdk�rP|j
|k�rP|�t�|jd|j
|}
t
|j|
|�St|�S)z�Round if it is necessary to keep self within prec precision.

        Rounds and fixes the exponent.  Does not raise on a sNaN.

        Arguments:
        self - Decimal instance
        context - context used.
        rR�
above Emaxr&r�r.Nr�)rQr�r=rr��EtoprGr�r�r�rPrirr:r;rkr<rFrrr�_pick_rounding_functionrErerVrr
)r0r1r�r��exp_maxZnew_expZexp_minr?Zself_is_subnormalr}Zrounding_method�changedr�r�r)r)r+r�}sn
















zDecimal._fixcCst|j|�rdSdSdS)z(Also known as round-towards-0, truncate.r&r�N)�
_all_zerosr<�r0rFr)r)r+�_round_down�szDecimal._round_downcCs|�|�S)zRounds away from 0.)r�r�r)r)r+�	_round_up�szDecimal._round_upcCs*|j|dkrdSt|j|�r"dSdSdS)zRounds 5 up (away from 0)Z56789r.r&r�N)r<r�r�r)r)r+�_round_half_up�s
zDecimal._round_half_upcCst|j|�rdS|�|�SdS)zRound 5 downr�N��_exact_halfr<rr�r)r)r+�_round_half_down�szDecimal._round_half_downcCs8t|j|�r*|dks&|j|ddkr*dS|�|�SdS)z!Round 5 to even, rest to nearest.r&r.�02468r�Nrr�r)r)r+�_round_half_even�s��zDecimal._round_half_evencCs |jr|�|�S|�|�SdS)z(Rounds up (not away from 0 if negative.)N�r;r�r�r)r)r+�_round_ceilings
zDecimal._round_ceilingcCs |js|�|�S|�|�SdS)z'Rounds down (not towards 0 if negative)Nrr�r)r)r+�_round_floor
s
zDecimal._round_floorcCs0|r |j|ddkr |�|�S|�|�SdS)z)Round down unless digit prec-1 is 0 or 5.r.Z05N)r<r�r�r)r)r+�_round_05ups
zDecimal._round_05up)rrrrrrrrcCsb|dk	r2t|t�std��tdd|�}|�|�S|jrR|��rJtd��ntd��t|�	dt
��S)a�Round self to the nearest integer, or to a given precision.

        If only one argument is supplied, round a finite Decimal
        instance self to the nearest integer.  If self is infinite or
        a NaN then a Python exception is raised.  If self is finite
        and lies exactly halfway between two integers then it is
        rounded to the integer with even last digit.

        >>> round(Decimal('123.456'))
        123
        >>> round(Decimal('-456.789'))
        -457
        >>> round(Decimal('-3.0'))
        -3
        >>> round(Decimal('2.5'))
        2
        >>> round(Decimal('3.5'))
        4
        >>> round(Decimal('Inf'))
        Traceback (most recent call last):
          ...
        OverflowError: cannot round an infinity
        >>> round(Decimal('NaN'))
        Traceback (most recent call last):
          ...
        ValueError: cannot round a NaN

        If a second argument n is supplied, self is rounded to n
        decimal places using the rounding mode for the current
        context.

        For an integer n, round(self, -n) is exactly equivalent to
        self.quantize(Decimal('1En')).

        >>> round(Decimal('123.456'), 0)
        Decimal('123')
        >>> round(Decimal('123.456'), 2)
        Decimal('123.46')
        >>> round(Decimal('123.456'), -2)
        Decimal('1E+2')
        >>> round(Decimal('-Infinity'), 37)
        Decimal('NaN')
        >>> round(Decimal('sNaN123'), 0)
        Decimal('NaN123')

        Nz+Second argument to round should be integralr&r��cannot round a NaN�cannot round an infinity)rdrVrwr:�quantizerQr�rqr�r�r)r0r9rWr)r)r+�	__round__&s/


zDecimal.__round__cCs0|jr |��rtd��ntd��t|�dt��S)z�Return the floor of self, as an integer.

        For a finite Decimal instance self, return the greatest
        integer n such that n <= self.  If self is infinite or a NaN
        then a Python exception is raised.

        r
rr&)rQr�rqr�rVr�rr�r)r)r+�	__floor__ds

zDecimal.__floor__cCs0|jr |��rtd��ntd��t|�dt��S)z�Return the ceiling of self, as an integer.

        For a finite Decimal instance self, return the least integer n
        such that n >= self.  If self is infinite or a NaN then a
        Python exception is raised.

        r
rr&)rQr�rqr�rVr�rr�r)r)r+�__ceil__ss

zDecimal.__ceil__cCst|dd�}t|dd�}|js$|jr�|dkr2t�}|jdkrJ|�td|�S|jdkrb|�td|�S|jdkrr|}nf|jdkr�|}nV|jdkr�|s�|�td�St|j|jA}n*|jdkr�|s�|�td	�St|j|jA}n0t|j|jAt	t
|j�t
|j��|j|j�}|�||�S)
a:Fused multiply-add.

        Returns self*other+third with no rounding of the intermediate
        product self*other.

        self and other are multiplied together, with no rounding of
        the result.  The third operand is then added to the result,
        and a single final rounding is performed.
        Tr�NrZr�r9r[zINF * 0 in fmaz0 * INF in fma)
r�rQrrPrir	rAr;r:rerVr<r�)r0r�Zthirdr1�productr)r)r+�fma�s<




�
�
�zDecimal.fmacCs�t|�}|tkr|St|�}|tkr(|S|dkr6t�}|��}|��}|��}|sZ|sZ|r�|dkrp|�td|�S|dkr�|�td|�S|dkr�|�td|�S|r�|�|�S|r�|�|�S|�|�S|��r�|��r�|��s�|�td�S|dkr�|�td�S|�s|�td�S|��|j	k�r(|�td�S|�s@|�s@|�td	�S|�
��rPd}n|j}tt
|��}t|���}t|���}	|j
|td
|j|�|}t|	j�D]}
t|d
|�}�q�t||	j
|�}t|t|�d�S)z!Three argument version of __pow__Nr^r�z@pow() 3rd argument not allowed unless all arguments are integersr&zApow() 2nd argument cannot be negative when 3rd argument specifiedzpow() 3rd argument cannot be 0zSinsufficient precision: pow() 3rd argument must not have more than precision digitszXat least one of pow() 1st argument and 2nd argument must be nonzero; 0**0 is not definedr�)r�r�rr�rir	r=�
_isintegerr�rF�_isevenr;rmrVrn�to_integral_valuer�rW�ranger:re)r0r��modulor1r�r�Z
modulo_is_nanrC�base�exponent�ir)r)r+�
_power_modulo�s����


�������
zDecimal._power_modulocCs�t|�}|j|j}}|ddkr4|d}|d7}qt|�}|j|j}}|ddkrh|d}|d7}qJ|dk�r||9}|ddkr�|d}|d7}qz|dkr�dS|d|}	|jdkr�|	}	|��r�|jdkr�|jt|�}
t|	|
|d�}nd}tddd||	|�S|jdk�r�|d}|dk�r�||@|k�rBdSt	|�d}
|dd	}|t
t|��k�rpdSt|
||�}
t|||�}|
dk�s�|dk�r�dS|
|k�r�dSd
|
}n�|d
k�r�t	|�dd	}
t
d
|
|�\}}|�r�dS|d
dk�r|d
}|
d8}
�q�|dd}|t
t|��k�r6dSt|
||�}
t|||�}|
dk�sf|dk�rjdS|
|k�rxdSd
|
}ndS|d|k�r�dS|
|}tdt|�|�S|dk�r�|d|d}}n�|dk�r�t
tt||���|k�r�dSt	|�}|dk�r,t
tt|�|��|k�r,dS|d|}}|d
|d
k�r\dk�rtnn|d
}|d
}�q<|d
|d
k�r�dk�r�nn|d
}|d
}�qt|dk�rX|dk�r�||k�r�dSt
||�\}}|dk�r�dSdt	|�|>}t
|||d�\}}||k�r$�q<n||d||}�q�||k�rP|dk�sTdS|}|dk�r|||dt|�k�r|dS||}||9}|d|k�r�dSt|�}|���r�|jdk�r�|jt|�}
t||
|t
|��}nd}td|d|||�S)ahAttempt to compute self**other exactly.

        Given Decimals self and other and an integer p, attempt to
        compute an exact result for the power self**other, with p
        digits of precision.  Return None if self**other is not
        exactly representable in p digits.

        Assumes that elimination of special cases has already been
        performed: self and other must both be nonspecial; self must
        be positive and not numerically equal to 1; other must be
        nonzero.  For efficiency, other._exp should not be too large,
        so that 10**abs(other._exp) is a feasible calculation.r�r&r.Nr�rR)r^����]�Ar~�r\r^�d)rnrVrWrCrr;rPr�r:�_nbitsrkre�_decimal_lshift_exactr�rm�	_log10_lb)r0r��p�x�xc�xe�y�yc�yerr�ZzerosZ
last_digitr�Zemaxr�rzr9Zxc_bits�rem�ar�r�Zstr_xcr)r)r+�_power_exacts�:












&&$$


 zDecimal._power_exactcCs4|dk	r|�|||�St|�}|tkr*|S|dkr8t�}|�||�}|rL|S|sd|s`|�td�StSd}|jdkr�|�	�r�|�
�s�d}n|r�|�td�S|��}|s�|jdkr�t|dd�St
|S|��r�|jdkr�t
|St|dd�S|tk�r�|�	��rZ|jdk�rd}n||jk�r"|j}nt|�}|j|}|d|jk�rxd|j}|�t�n|�t�|�t�d|j}t|dd||�S|��}|���r�|jdk|dkk�r�t|dd�St
|Sd}d}	|��|��}
|dk|jdkk�r|
tt|j��k�rHt|d|jd�}n,|��}|
tt|��k�rHt|d|d�}|dk�r�|�||jd�}|dk	�r�|dk�r�td|j|j�}d	}	|dk�r8|j}t|�}
|
j|
j}}t|�}|j|j}}|jdk�r�|}d
}t||||||�\}}|ddtt|��|d�r�q(|d
7}�q�t|t|�|�}|	�r&|�	��s&t|j�|jk�r�|jdt|j�}t|j|jd||j|�}|� �}|�!�t"D]}d|j#|<�q�|�$|�}|�t�|j%t&�r�|�t'�|j%t(�r�|�t(d
|j�t't&ttt)fD]}|j%|�r|�|��qn
|�$|�}|S)aHReturn self ** other [ % modulo].

        With two arguments, compute self**other.

        With three arguments, compute (self**other) % modulo.  For the
        three argument form, the following restrictions on the
        arguments hold:

         - all three arguments must be integral
         - other must be nonnegative
         - either self or other (or both) must be nonzero
         - modulo must be nonzero and must have at most p digits,
           where p is the context precision.

        If any of these restrictions is violated the InvalidOperation
        flag is raised.

        The result of pow(self, other, modulo) is identical to the
        result that would be obtained by computing (self**other) %
        modulo with unbounded precision, but is computed more
        efficiently.  It is always exact.
        Nz0 ** 0r&r.z+x ** y with x negative and y not an integerrRr�FTr\r~r�r�)*rr�r�rr�rir	�_Oner;rrr�r:rAr�rFrVrPrrr��_log10_exp_boundrkrerGr�r.r<rnrWrC�_dpowerrMrN�_signals�trapsr��flagsr
rrr)r0r�rr1r?Zresult_signZ
multiplierrWZself_adj�exactZboundr�r%r&r'r(r)r*r+�extrar�r�Z
newcontextZ	exceptionr)r)r+�__pow__�s�
�













"�



zDecimal.__pow__cCs"t|�}|tkr|S|j||d�S)z%Swaps self/other and returns __pow__.rL)r�r�r7r�r)r)r+�__rpow__�	szDecimal.__rpow__cCs�|dkrt�}|jr(|j|d�}|r(|S|�|�}|��r>|S|sPt|jdd�S|j|��g|j	}t
|j�}|j}|j|ddkr�||kr�|d7}|d8}qtt|j|jd|�|�S)z?Normalize- strip trailing 0s, change anything equal to 0 to 0e0NrLrRr&r.)
rrQr�r�r�r:r;rGr�r�rkr<rP)r0r1r?�dupr��endrWr)r)r+�	normalize�	s$


zDecimal.normalizecCs�t|dd�}|dkrt�}|dkr(|j}|js4|jr||�||�}|rH|S|��sX|��r||��rp|��rpt|�S|�td�S|�	�|j
kr�|jks�n|�td�S|s�t|j
d|j
�}|�|�S|��}||jkr�|�td�S||j
d|jk�r|�td	�S|�|j
|�}|��|jk�r.|�td�St|j�|jk�rL|�td	�S|�rl|��|jk�rl|�t�|j
|j
k�r�||k�r�|�t�|�t�|�|�}|S)
z�Quantize self so its exponent is the same as that of exp.

        Similar to self._rescale(exp._exp) but with error checking.
        Tr�Nzquantize with one INFz)target exponent out of bounds in quantizerRz9exponent of quantize result too large for current contextr.z7quantize result has too many digits for current context)r�rrErQr�r�rrir	r�rPrGr:r;r�r�rFr�rkr<�Eminr
rr)r0rWrEr1r?r�r)r)r+r�	s`��

����




zDecimal.quantizecCsDt|dd�}|js|jr8|��r(|��p6|��o6|��S|j|jkS)a=Return True if self and other have the same exponent; otherwise
        return False.

        If either operand is a special value, the following rules are used:
           * return True if both operands are infinities
           * return True if both operands are NaNs
           * otherwise, return False.
        Tr�)r�rQr��is_infiniterPr�r)r)r+�same_quantum%
s	�zDecimal.same_quantumcCs�|jrt|�S|s t|jd|�S|j|krHt|j|jd|j||�St|j�|j|}|dkrzt|jd|d�}d}|j|}|||�}|jd|�p�d}|dkr�tt	|�d�}t|j||�S)asRescale self so that the exponent is exp, either by padding with zeros
        or by truncating digits, using the given rounding mode.

        Specials are returned without change.  This operation is
        quiet: it raises no flags, and uses no information from the
        context.

        exp = exp to scale to (an integer)
        rounding = rounding mode
        rRr&r�r.N)
rQrr:r;rPr<rkr�rerV)r0rWrEr}Z
this_functionr�r�r)r)r+r�4
s&
�

zDecimal._rescalecCsf|dkrtd��|js|s"t|�S|�|��d||�}|��|��krb|�|��d||�}|S)a"Round a nonzero, nonspecial Decimal to a fixed number of
        significant figures, using the given rounding mode.

        Infinities, NaNs and zeros are returned unaltered.

        This operation is quiet: it raises no flags, and uses no
        information from the context.

        r&z'argument should be at least 1 in _roundr.)rqrQrr�r�)r0�placesrEr?r)r)r+�_roundV
s

zDecimal._roundcCs�|jr"|j|d�}|r|St|�S|jdkr4t|�S|sFt|jdd�S|dkrTt�}|dkrb|j}|�d|�}||kr�|�	t
�|�	t�|S)aVRounds to a nearby integer.

        If no rounding mode is specified, take the rounding mode from
        the context.  This method raises the Rounded and Inexact flags
        when appropriate.

        See also: to_integral_value, which does exactly the same as
        this method except that it doesn't raise Inexact or Rounded.
        rLr&rRN)rQr�rrPr:r;rrEr�rirr�r0rEr1r?r)r)r+�to_integral_exactm
s$



zDecimal.to_integral_exactcCs`|dkrt�}|dkr|j}|jr>|j|d�}|r6|St|�S|jdkrPt|�S|�d|�SdS)z@Rounds to the nearest integer, without raising inexact, rounded.NrLr&)rrErQr�rrPr�rAr)r)r+r�
s
zDecimal.to_integral_valuecCs�|dkrt�}|jrB|j|d�}|r(|S|��rB|jdkrBt|�S|sdt|jd|jd�}|�|�S|jdkrz|�	t
d�S|jd}t|�}|j
d?}|j
d@r�|jd}t|j�d?d}n|j}t|j�dd?}||}|dkr�|d	|9}d
}	nt|d	|�\}}
|
}	||8}d|}||}||k�r:�qJn||d?}�q"|	�oZ|||k}	|	�r�|dk�rz|d|}n|d|9}||7}n|ddk�r�|d7}tdt|�|�}|��}|�t�}
|�|�}|
|_|S)zReturn the square root of self.NrLr&rRr^r.zsqrt(-x), x > 0r�r!Tr~)rrQr�r�r;rr:rPr�rir	rFrnrWrVrkr<r�re�
_shallow_copy�
_set_roundingrrE)r0r1r?rF�opr��c�lr�r5r�r9r�rEr)r)r+�sqrt�
s^










zDecimal.sqrtcCs�t|dd�}|dkrt�}|js&|jr~|��}|��}|s>|r~|dkrX|dkrX|�|�S|dkrr|dkrr|�|�S|�||�S|�|�}|dkr�|�|�}|dkr�|}n|}|�|�S)z�Returns the larger value.

        Like max(self, other) except if one is not a number, returns
        NaN (and signals if one is sNaN).  Also rounds.
        Tr�Nr.r&r��r�rrQr�r�r�r��
compare_total�r0r�r1ZsnZonrFr?r)r)r+r�s&


	
zDecimal.maxcCs�t|dd�}|dkrt�}|js&|jr~|��}|��}|s>|r~|dkrX|dkrX|�|�S|dkrr|dkrr|�|�S|�||�S|�|�}|dkr�|�|�}|dkr�|}n|}|�|�S)z�Returns the smaller value.

        Like min(self, other) except if one is not a number, returns
        NaN (and signals if one is sNaN).  Also rounds.
        Tr�Nr.r&r�rIrKr)r)r+r�*s&



zDecimal.mincCs8|jr
dS|jdkrdS|j|jd�}|dt|�kS)z"Returns whether self is an integerFr&TNrR)rQrPr<rk)r0�restr)r)r+rLs
zDecimal._isintegercCs&|r|jdkrdS|jd|jdkS)z:Returns True if self is even.  Assumes self is an integer.r&Tr�r)rPr<r�r)r)r+rUszDecimal._isevencCs2z|jt|j�dWStk
r,YdSXdS)z$Return the adjusted exponent of selfr.r&N)rPrkr<rwr�r)r)r+r�[szDecimal.adjustedcCs|S)z�Returns the same Decimal object.

        As we do not have different encodings for the same number, the
        received object already is in its canonical form.
        r)r�r)r)r+�	canonicalcszDecimal.canonicalcCs.t|dd�}|�||�}|r |S|j||d�S)z�Compares self to the other operand numerically.

        It's pretty much like compare(), but all NaNs signal, with signaling
        NaNs taking precedence over quiet NaNs.
        Tr�rL)r�r�r�r�r)r)r+�compare_signalks
zDecimal.compare_signalcCs`t|dd�}|jr|jstS|js,|jr,tS|j}|��}|��}|sL|�r||kr�t|j�|jf}t|j�|jf}||kr�|r�tStS||kr�|r�tStStS|r�|dkr�tS|dkr�tS|dkr�tS|dkr�tSn2|dkr�tS|dkr�tS|dkr�tS|dk�rtS||k�rtS||k�r$tS|j|jk�r@|�r<tStS|j|jk�r\|�rXtStStS)z�Compares self to other using the abstract representations.

        This is not like the standard compare, which use their numerical
        value. Note that a total ordering is defined for all possible abstract
        representations.
        Tr�r.r^)	r�r;�_NegativeOner/r�rkr<�_ZerorP)r0r�r1rCZself_nanZ	other_nanZself_keyZ	other_keyr)r)r+rJwsf



zDecimal.compare_totalcCs&t|dd�}|��}|��}|�|�S)z�Compares self to other using abstract repr., ignoring sign.

        Like compare_total, but with operand's sign ignored and assumed to be 0.
        Tr�)r�r�rJ)r0r�r1r��or)r)r+�compare_total_mag�szDecimal.compare_total_magcCstd|j|j|j�S)z'Returns a copy with the sign set to 0. r&)r:r<rPrQr�r)r)r+r��szDecimal.copy_abscCs2|jrtd|j|j|j�Std|j|j|j�SdS)z&Returns a copy with the sign inverted.r&r.N)r;r:r<rPrQr�r)r)r+r��szDecimal.copy_negatecCs"t|dd�}t|j|j|j|j�S)z$Returns self with the sign of other.Tr�)r�r:r;r<rPrQr�r)r)r+�	copy_sign�s

�zDecimal.copy_signcCs�|dkrt�}|j|d�}|r"|S|��dkr2tS|s:tS|��dkrNt|�S|j}|��}|jdkr�|t	t
|jdd��kr�tdd|jd�}�n0|jdkr�|t	t
|�
�dd��kr�tdd|�
�d�}n�|jdk�r||k�rtddd|dd|�}n�|jdk�rD||dk�rDtdd	|d|d�}n�t|�}|j|j}}|jdk�rl|}d}t||||�\}	}
|	d
dt	t
|	��|d�r��q�|d7}�qptdt
|	�|
�}|��}|�t�}|�|�}||_|S)zReturns e ** self.NrLr�r.r&r\r�rRrDr~r�)rr�r�rPr/rrFr�r;rkrerGr:r�rnrVrWrC�_dexprCrDrr�rE)r0r1r?r%�adjrErFr�r6r�rWrEr)r)r+rW�sH$( "

zDecimal.expcCsdS)z�Return True if self is canonical; otherwise return False.

        Currently, the encoding of a Decimal instance is always
        canonical, so this method returns True for any Decimal.
        Tr)r�r)r)r+�is_canonical'szDecimal.is_canonicalcCs|jS)z�Return True if self is finite; otherwise return False.

        A Decimal instance is considered finite if it is neither
        infinite nor a NaN.
        )rQr�r)r)r+�	is_finite/szDecimal.is_finitecCs
|jdkS)z8Return True if self is infinite; otherwise return False.r[�rPr�r)r)r+r=7szDecimal.is_infinitecCs
|jdkS)z>Return True if self is a qNaN or sNaN; otherwise return False.r`rXr�r)r)r+r�;szDecimal.is_nancCs*|js
|sdS|dkrt�}|j|��kS)z?Return True if self is a normal number; otherwise return False.FN)rQrr<r�r�r)r)r+�	is_normal?s

zDecimal.is_normalcCs
|jdkS)z;Return True if self is a quiet NaN; otherwise return False.r9rXr�r)r)r+r�GszDecimal.is_qnancCs
|jdkS)z8Return True if self is negative; otherwise return False.r.)r;r�r)r)r+�	is_signedKszDecimal.is_signedcCs
|jdkS)z?Return True if self is a signaling NaN; otherwise return False.rZrXr�r)r)r+r�OszDecimal.is_snancCs*|js
|sdS|dkrt�}|��|jkS)z9Return True if self is subnormal; otherwise return False.FN)rQrr�r<r�r)r)r+�is_subnormalSs

zDecimal.is_subnormalcCs|jo|jdkS)z6Return True if self is a zero; otherwise return False.rRr�r�r)r)r+�is_zero[szDecimal.is_zerocCs�|jt|j�d}|dkr4tt|dd��dS|dkrXttd|dd��dSt|�}|j|j}}|dkr�t|d|�}t|�}t|�t|�||kS|ttd||��dS)z�Compute a lower bound for the adjusted exponent of self.ln().
        In other words, compute r such that self.ln() >= 10**r.  Assumes
        that self is finite and positive and that self != 1.
        r.�r�r�r�r&�rPrkr<rernrVrW�r0rUrErFr��numZdenr)r)r+�
_ln_exp_bound_szDecimal._ln_exp_boundc
Cs|dkrt�}|j|d�}|r"|S|s*tS|��dkr:tS|tkrFtS|jdkr\|�t	d�St
|�}|j|j}}|j
}||��d}t|||�}|ddttt|���|dr�q�|d7}q�tt|d	k�tt|��|�}|��}|�t�}	|�|�}|	|_|S)
z/Returns the natural (base e) logarithm of self.NrLr.zln of a negative valuer^r~r�r\r&)rr��_NegativeInfinityr��	_Infinityr/rPr;rir	rnrVrWrFra�_dlogrkrermr:rCrDrr�rE�
r0r1r?rErFr�r%r?r�rEr)r)r+�lnxs:
�$


z
Decimal.lncCs�|jt|j�d}|dkr,tt|��dS|dkrHttd|��dSt|�}|j|j}}|dkr�t|d|�}td|�}t|�t|�||kdStd||�}t|�||dkdS)	z�Compute a lower bound for the adjusted exponent of self.log10().
        In other words, find r such that self.log10() >= 10**r.
        Assumes that self is finite and positive and that self != 1.
        r.r�r�r&r���r^Z231r^r_r)r)r+r0�szDecimal._log10_exp_boundc
CsF|dkrt�}|j|d�}|r"|S|s*tS|��dkr:tS|jdkrP|�td�S|jddkr�|jdd�dt	|j�dkr�t
|jt	|j�d�}n�t|�}|j
|j}}|j}||��d}t|||�}|d	d
t	tt|���|dr��q|d7}q�tt
|dk�tt|��|�}|��}|�t�}	|�|�}|	|_|S)z&Returns the base 10 logarithm of self.NrLr.zlog10 of a negative valuer&r�rRr^r~r�r\)rr�rbr�rcr;rir	r<rkrrPrnrVrWrFr0�_dlog10rermr:rCrDrr�rErer)r)r+�log10�s:
�.$


z
Decimal.log10cCsV|j|d�}|r|S|dkr"t�}|��r.tS|s@|�tdd�St|���}|�|�S)aM Returns the exponent of the magnitude of self's MSD.

        The result is the integer which is the exponent of the magnitude
        of the most significant digit of self (as though it were truncated
        to a single digit while maintaining the value of that digit and
        without limiting the resulting exponent).
        rLNzlogb(0)r.)	r�rr�rcrir
rr�r�r�r)r)r+�logb�s	zDecimal.logbcCs6|jdks|jdkrdS|jD]}|dkrdSqdS)z�Return True if self is a logical operand.

        For being logical, it must be a finite number with a sign of 0,
        an exponent of 0, and a coefficient whose digits must all be
        either 0 or 1.
        r&FZ01T)r;rPr<)r0�digr)r)r+�
_islogical
s
zDecimal._islogicalcCs�|jt|�}|dkr$d||}n|dkr<||jd�}|jt|�}|dkr`d||}n|dkrx||jd�}||fS)Nr&rR)rFrk)r0r1�opa�opbZdifr)r)r+�
_fill_logical'
szDecimal._fill_logicalcCsz|dkrt�}t|dd�}|��r*|��s4|�t�S|�||j|j�\}}d�dd�t||�D��}t	d|�
d�ptdd�S)	z;Applies an 'and' operation between self and other's digits.NTr�rTcSs$g|]\}}tt|�t|�@��qSr)�rerV��.0r-�br)r)r+�
<listcomp>B
sz'Decimal.logical_and.<locals>.<listcomp>r&rR�rr�rlrir	ror<rs�zipr:rl�r0r�r1rmrnr�r)r)r+�logical_and4
s
zDecimal.logical_andcCs(|dkrt�}|�tdd|jd�|�S)zInvert all its digits.Nr&r�)r�logical_xorr:rFr�r)r)r+�logical_invertE
s
�zDecimal.logical_invertcCsz|dkrt�}t|dd�}|��r*|��s4|�t�S|�||j|j�\}}d�dd�t||�D��}t	d|�
d�ptdd�S)	z:Applies an 'or' operation between self and other's digits.NTr�rTcSs$g|]\}}tt|�t|�B��qSr)rprqr)r)r+rtZ
sz&Decimal.logical_or.<locals>.<listcomp>r&rRrurwr)r)r+�
logical_orL
s
zDecimal.logical_orcCsz|dkrt�}t|dd�}|��r*|��s4|�t�S|�||j|j�\}}d�dd�t||�D��}t	d|�
d�ptdd�S)	z;Applies an 'xor' operation between self and other's digits.NTr�rTcSs$g|]\}}tt|�t|�A��qSr)rprqr)r)r+rtk
sz'Decimal.logical_xor.<locals>.<listcomp>r&rRrurwr)r)r+ry]
s
zDecimal.logical_xorcCs�t|dd�}|dkrt�}|js&|jr~|��}|��}|s>|r~|dkrX|dkrX|�|�S|dkrr|dkrr|�|�S|�||�S|���|���}|dkr�|�|�}|dkr�|}n|}|�|�S�z8Compares the values numerically with their sign ignored.Tr�Nr.r&r��	r�rrQr�r�r�r�r�rJrKr)r)r+�max_magn
s&


zDecimal.max_magcCs�t|dd�}|dkrt�}|js&|jr~|��}|��}|s>|r~|dkrX|dkrX|�|�S|dkrr|dkrr|�|�S|�||�S|���|���}|dkr�|�|�}|dkr�|}n|}|�|�Sr|r}rKr)r)r+�min_mag�
s&


zDecimal.min_magcCs�|dkrt�}|j|d�}|r"|S|��dkr2tS|��dkrTtdd|j|���S|��}|�t	�|�
�|�|�}||kr�|S|�tdd|�
�d�|�S)z=Returns the largest representable number smaller than itself.NrLr�r.r&rDr�)rr�r�rbr:rFr�rMrDr�_ignore_all_flagsr�r�r��r0r1r?Znew_selfr)r)r+�
next_minus�
s$

�zDecimal.next_minuscCs�|dkrt�}|j|d�}|r"|S|��dkr2tS|��dkrTtdd|j|���S|��}|�t	�|�
�|�|�}||kr�|S|�tdd|�
�d�|�S)z=Returns the smallest representable number larger than itself.NrLr.r�rDr&r�)rr�r�rcr:rFr�rMrDrr�r�r�r�r�r)r)r+�	next_plus�
s$

�zDecimal.next_pluscCs�t|dd�}|dkrt�}|�||�}|r.|S|�|�}|dkrJ|�|�S|dkr^|�|�}n
|�|�}|��r�|�t	d|j
�|�t�|�t�nD|�
�|jkr�|�t�|�t�|�t�|�t�|s�|�t�|S)a�Returns the number closest to self, in the direction towards other.

        The result is the closest representable number to self
        (excluding self) that is in the direction towards other,
        unless both have the same value.  If the two operands are
        numerically equal, then the result is a copy of self with the
        sign set to be the same as the sign of other.
        Tr�Nr&r�z Infinite result from next_toward)r�rr�r�rSr�r�r�rirr;rrr�r<rr
r)r0r�r1r?Z
comparisonr)r)r+�next_toward�
s6	


�





zDecimal.next_towardcCs�|��rdS|��rdS|��}|dkr,dS|dkr8dS|��rN|jrJdSdS|d	kr\t�}|j|d
�rv|jrrdSdS|jr�d
SdSd	S)aReturns an indication of the class of self.

        The class is one of the following strings:
          sNaN
          NaN
          -Infinity
          -Normal
          -Subnormal
          -Zero
          +Zero
          +Subnormal
          +Normal
          +Infinity
        r�r�r.z	+Infinityr�z	-Infinityz-Zeroz+ZeroNrLz
-Subnormalz
+Subnormalz-Normalz+Normal)r�r�r�r\r;rr[)r0r1�infr)r)r+�number_classs,zDecimal.number_classcCstd�S)z'Just returns 10, as this is Decimal, :)r�r�r�r)r)r+�radix0sz
Decimal.radixcCs�|dkrt�}t|dd�}|�||�}|r.|S|jdkrB|�t�S|jt|�kr`|jksln|�t�S|��r|t	|�St|�}|j
}|jt|�}|dkr�d||}n|dkr�||d�}||d�|d|�}t|j
|�d�p�d|j�S)z5Returns a rotated copy of self, value-of-other times.NTr�r&rR�rr�r�rPrir	rFrVr�rr<rkr:r;rl)r0r�r1r?�torot�rotdig�topadZrotatedr)r)r+�rotate4s0

 
�zDecimal.rotatecCs�|dkrt�}t|dd�}|�||�}|r.|S|jdkrB|�t�Sd|j|j}d|j|j}|t|�krz|ks�n|�t�S|�	�r�t
|�St|j|j
|jt|��}|�|�}|S)z>Returns self operand after adding the second value to its exp.NTr�r&r�r^)rr�r�rPrir	rGrFrVr�rr:r;r<r�)r0r�r1r?ZliminfZlimsupr�r)r)r+�scalebUs"



zDecimal.scalebcCs|dkrt�}t|dd�}|�||�}|r.|S|jdkrB|�t�S|jt|�kr`|jksln|�t�S|��r|t	|�St|�}|j
}|jt|�}|dkr�d||}n|dkr�||d�}|dkr�|d|�}n|d|}||jd�}t|j
|�d��p
d|j�S)z5Returns a shifted copy of self, value-of-other times.NTr�r&rRr�)r0r�r1r?r�r�r�Zshiftedr)r)r+r�ns6

 
�z
Decimal.shiftcCs|jt|�ffSr()�	__class__rer�r)r)r+�
__reduce__�szDecimal.__reduce__cCst|�tkr|S|�t|��Sr(��typerr�rer�r)r)r+�__copy__�szDecimal.__copy__cCst|�tkr|S|�t|��Sr(r�)r0Zmemor)r)r+�__deepcopy__�szDecimal.__deepcopy__cCsJ|dkrt�}t||d�}|jrXt|j|�}t|���}|ddkrL|d7}t|||�S|ddkrvddg|j|d<|ddkr�t	|j|j
|jd�}|j}|d}|dk	�r|dd	kr�|�
|d
|�}nF|ddkr�|�||�}n*|ddk�rt|j
�|k�r|�
||�}|�s@|jd
k�r@|ddk�r@|�d
|�}|jt|j
�}	|dd	k�r~|�sx|dk	�rxd
|}
nd
}
nB|ddk�r�|	}
n.|ddk�r�|jd
k�r�|	dk�r�|	}
nd
}
|
d
k�r�d}d|
|j
}nP|
t|j
�k�r|j
d|
t|j
�}d}n"|j
d|
��p d}|j
|
d�}|	|
}
t|j|||
|�S)a|Format a Decimal instance according to the given specifier.

        The specifier should be a standard format specifier, with the
        form described in PEP 3101.  Formatting types 'e', 'E', 'f',
        'F', 'g', 'G', 'n' and '%' are supported.  If the formatting
        type is omitted it defaults to 'g' or 'G', depending on the
        value of context.capitals.
        N)�_localeconvr��%�g�Gr^�	precision�eEr.zfF%ZgGr&r�rRrT)r�_parse_format_specifierrQ�_format_signr;rer��
_format_alignr�r:r<rPrEr@r�rk�_format_number)r0Z	specifierr1r��specrC�bodyrEr�r�r�r{r|rWr)r)r+�
__format__�sZ
 

zDecimal.__format__)rRN)NN)N)N)N)N)N)N)FN)N)N)N)TN)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)NN)N)N)NN)N)NN)NN)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)NN)�r4r5r6r7�	__slots__rc�classmethodrvr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��__radd__r�r�r��__rmul__r�r�r�r�r�r�r�r�r�r�r�r��	__trunc__�propertyr�r�r�r�r=r�r�r�rrrrrr	�dictr�r
rrrrr.r7r8r;rr>r�r@rBr�to_integralrHr�r�rrr�rMrNrJrRr�r�rSrWrVrWr=r�rYr�rZr�r[r\rarfr0rirjrlrorxrzr{ryr~rr�r�r�r�r�r�r�r�r�r�r�r�r)r)r)r+rs

,
 !@

	
	
	
	
2
4
	



V7;!$K



f	�>,UnY="c*"	IK23
.*!'FcCs&t�t�}||_||_||_||_|S)z�Create a decimal instance directly, without any validation,
    normalization (e.g. removal of leading zeros) or argument
    conversion.

    This function is for *internal use only*.
    )rbrcrr;r<rPrQ)rCZcoefficientrZspecialr0r)r)r+r:�s
r:c@s(eZdZdZdd�Zdd�Zdd�ZdS)	rOz�Context manager class to support localcontext().

      Sets a copy of the supplied context in __enter__() and restores
      the previous decimal context in __exit__()
    cCs|��|_dSr()rM�new_context)r0r�r)r)r+�__init__sz_ContextManager.__init__cCst�|_t|j�|jSr()r�
saved_contextrr�r�r)r)r+�	__enter__s
z_ContextManager.__enter__cCst|j�dSr()rr�)r0�t�v�tbr)r)r+�__exit__sz_ContextManager.__exit__N)r4r5r6r7r�r�r�r)r)r)r+rOsrOc	@s�eZdZdZd�dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZeZd�dd�Zdd�Zdd�Zdd �ZdZd!d"�Zd#d$�Zd%d&�Zd�d(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Z d:d;�Z!d<d=�Z"d>d?�Z#d@dA�Z$dBdC�Z%dDdE�Z&dFdG�Z'dHdI�Z(dJdK�Z)dLdM�Z*dNdO�Z+dPdQ�Z,dRdS�Z-dTdU�Z.dVdW�Z/dXdY�Z0dZd[�Z1d\d]�Z2d^d_�Z3d`da�Z4dbdc�Z5ddde�Z6dfdg�Z7dhdi�Z8djdk�Z9dldm�Z:dndo�Z;dpdq�Z<drds�Z=dtdu�Z>dvdw�Z?dxdy�Z@dzd{�ZAd|d}�ZBd~d�ZCd�d��ZDd�d��ZEd�d��ZFd�d��ZGd�d�d��ZHd�d��ZId�d��ZJd�d��ZKd�d��ZLd�d��ZMd�d��ZNd�d��ZOd�d��ZPd�d��ZQd�d��ZRd�d��ZSd�d��ZTd�d��ZUd�d��ZVeVZWdS)�ra�Contains the context for a Decimal instance.

    Contains:
    prec - precision (for use in rounding, division, square roots..)
    rounding - rounding type (how you round)
    traps - If traps[exception] = 1, then the exception is
                    raised when it is caused.  Otherwise, a value is
                    substituted in.
    flags  - When an exception is caused, flags[exception] is set.
             (Whether or not the trap_enabler is set)
             Should be reset by user of Decimal instance.
    Emin -   Minimum exponent
    Emax -   Maximum exponent
    capitals -      If 1, 1*10^1 is printed as 1E+1.
                    If 0, printed as 1e1
    clamp -  If 1, change exponents if too high (Default 0)
    Nc
s>zt}
Wntk
rYnX|dk	r*|n|
j|_|dk	r>|n|
j|_|dk	rR|n|
j|_|dk	rf|n|
j|_|dk	rz|n|
j|_|dk	r�|n|
j|_|	dkr�g|_n|	|_�dkr�|
j	�
�|_	n.t�t�s�t�fdd�t
�D��|_	n�|_	�dk�r
t�t
d�|_n0t�t��s4t�fdd�t
�D��|_n�|_dS)Nc3s|]}|t|�k�fVqdSr(�rV�rrr��r3r)r+�	<genexpr>Isz#Context.__init__.<locals>.<genexpr>r&c3s|]}|t|�k�fVqdSr(r�r��r4r)r+r�Ps)r�	NameErrorrFrEr<rGr�r��_ignored_flagsr3rMrdr�r2�fromkeysr4)r0rFrEr<rGr�r�r4r3r�Zdcr))r4r3r+r�0s.

zContext.__init__cCs�t|t�std|��|dkr<||kr�td||||f��nJ|dkrb||kr�td||||f��n$||ksr||kr�td||||f��t�|||�S)Nz%s must be an integer�-infz%s must be in [%s, %d]. got: %sr�z%s must be in [%d, %s]. got: %sz%s must be in [%d, %d]. got %s)rdrVrwrqrb�__setattr__)r0�nameryZvminZvmaxr)r)r+�_set_integer_checkTs
zContext._set_integer_checkcCs`t|t�std|��|D]}|tkrtd|��qtD]}||kr8td|��q8t�|||�S)Nz%s must be a signal dictz%s is not a valid signal dict)rdr�rwr2�KeyErrorrbr�)r0r�r��keyr)r)r+�_set_signal_dictbs
zContext._set_signal_dictcCs�|dkr|�||dd�S|dkr0|�||dd�S|dkrH|�||dd�S|dkr`|�||dd�S|d	krx|�||dd�S|d
kr�|tkr�td|��t�|||�S|dks�|d
kr�|�||�S|dkr�t�|||�Std|��dS)NrFr.r�r<r�r&rGr�r�rEz%s: invalid rounding moder4r3r�z.'decimal.Context' object has no attribute '%s')r��_rounding_modesrwrbr�r��AttributeError)r0r�ryr)r)r+r�ms*�zContext.__setattr__cCstd|��dS)Nz%s cannot be deleted)r�)r0r�r)r)r+�__delattr__�szContext.__delattr__c	CsNdd�|j��D�}dd�|j��D�}|j|j|j|j|j|j|j	||ffS)NcSsg|]\}}|r|�qSr)r)�rrZsigr�r)r)r+rt�sz&Context.__reduce__.<locals>.<listcomp>cSsg|]\}}|r|�qSr)r)r�r)r)r+rt�s)
r4�itemsr3r�rFrEr<rGr�r�)r0r4r3r)r)r+r��s��zContext.__reduce__cCs|g}|�dt|��dd�|j��D�}|�dd�|�d�dd�|j��D�}|�dd�|�d�d�|�d	S)
zShow the current context.zrContext(prec=%(prec)d, rounding=%(rounding)s, Emin=%(Emin)d, Emax=%(Emax)d, capitals=%(capitals)d, clamp=%(clamp)dcSsg|]\}}|r|j�qSr)�r4)rrr�r�r)r)r+rt�sz$Context.__repr__.<locals>.<listcomp>zflags=[z, �]cSsg|]\}}|r|j�qSr)r�)rrr�r�r)r)r+rt�sztraps=[�))rr�varsr4r�rsr3)r0r��namesr)r)r+r��s�zContext.__repr__cCs|jD]}d|j|<qdS)zReset all flags to zeror&Nr��r0�flagr)r)r+rN�s
zContext.clear_flagscCs|jD]}d|j|<qdS)zReset all traps to zeror&Nr�r�r)r)r+�clear_traps�s
zContext.clear_trapsc
Cs.t|j|j|j|j|j|j|j|j|j	�	}|S)z!Returns a shallow copy from self.)
rrFrEr<rGr�r�r4r3r��r0Zncr)r)r+rC�s�zContext._shallow_copyc
Cs6t|j|j|j|j|j|j|j��|j	��|j
�	}|S)zReturns a deep copy from self.)rrFrEr<rGr�r�r4rMr3r�r�r)r)r+rM�s�zContext.copycGsZt�||�}||jkr(|�j|f|��Sd|j|<|j|sN|�j|f|��S||��dS)a#Handles an error

        If the flag is in _ignored_flags, returns the default response.
        Otherwise, it sets the flag, then, if the corresponding
        trap_enabler is set, it reraises the exception.  Otherwise, it returns
        the default value after setting the flag.
        r.N)�_condition_maprIr�r2r4r3)r0Z	conditionZexplanationr*�errorr)r)r+ri�s


zContext._raise_errorcCs
|jt�S)z$Ignore all flags, if they are raised)�
_ignore_flagsr2r�r)r)r+r��szContext._ignore_all_flagscGs|jt|�|_t|�S)z$Ignore the flags, if they are raised)r�ro)r0r4r)r)r+r��szContext._ignore_flagscGs8|rt|dttf�r|d}|D]}|j�|�q"dS)z+Stop ignoring the flags, if they are raisedr&N)rdrpror��remove)r0r4r�r)r)r+�
_regard_flags�szContext._regard_flagscCst|j|jd�S)z!Returns Etiny (= Emin - prec + 1)r.)rVr<rFr�r)r)r+r��sz
Context.EtinycCst|j|jd�S)z,Returns maximum exponent (= Emax - prec + 1)r.)rVrGrFr�r)r)r+r��szContext.EtopcCs|j}||_|S)a�Sets the rounding type.

        Sets the rounding type, and returns the current (previous)
        rounding type.  Often used like:

        context = context.copy()
        # so you don't change the calling context
        # if an error occurs in the middle.
        rounding = context._set_rounding(ROUND_UP)
        val = self.__sub__(other, context=context)
        context._set_rounding(rounding)

        This will make it round up for that operation.
        )rE)r0r�rEr)r)r+rD�szContext._set_roundingrRcCsjt|t�r*||��ksd|kr*|�td�St||d�}|��r`t|j�|j	|j
kr`|�td�S|�|�S)z�Creates a new Decimal instance but using self as context.

        This method implements the to-number operation of the
        IBM Decimal specification.rSzAtrailing or leading whitespace and underscores are not permitted.rLzdiagnostic info too long in NaN)rdrergrirrr�rkr<rFr�r�)r0r`r�r)r)r+�create_decimal�s��zContext.create_decimalcCst�|�}|�|�S)a�Creates a new Decimal instance from a float but rounding using self
        as the context.

        >>> context = Context(prec=5, rounding=ROUND_DOWN)
        >>> context.create_decimal_from_float(3.1415926535897932)
        Decimal('3.1415')
        >>> context = Context(prec=5, traps=[Inexact])
        >>> context.create_decimal_from_float(3.1415926535897932)
        Traceback (most recent call last):
            ...
        decimal.Inexact: None

        )rrvr�)r0r�r�r)r)r+�create_decimal_from_floats
z!Context.create_decimal_from_floatcCst|dd�}|j|d�S)a[Returns the absolute value of the operand.

        If the operand is negative, the result is the same as using the minus
        operation on the operand.  Otherwise, the result is the same as using
        the plus operation on the operand.

        >>> ExtendedContext.abs(Decimal('2.1'))
        Decimal('2.1')
        >>> ExtendedContext.abs(Decimal('-100'))
        Decimal('100')
        >>> ExtendedContext.abs(Decimal('101.5'))
        Decimal('101.5')
        >>> ExtendedContext.abs(Decimal('-101.5'))
        Decimal('101.5')
        >>> ExtendedContext.abs(-1)
        Decimal('1')
        Tr�rL)r�r��r0r-r)r)r+rm!szContext.abscCs8t|dd�}|j||d�}|tkr0td|��n|SdS)a�Return the sum of the two operands.

        >>> ExtendedContext.add(Decimal('12'), Decimal('7.00'))
        Decimal('19.00')
        >>> ExtendedContext.add(Decimal('1E+2'), Decimal('1.01E+4'))
        Decimal('1.02E+4')
        >>> ExtendedContext.add(1, Decimal(2))
        Decimal('3')
        >>> ExtendedContext.add(Decimal(8), 5)
        Decimal('13')
        >>> ExtendedContext.add(5, 5)
        Decimal('10')
        Tr�rL�Unable to convert %s to DecimalN)r�r�r�rw�r0r-rsr�r)r)r+�add6s
zContext.addcCst|�|��Sr()rer�r�r)r)r+�_applyKszContext._applycCst|t�std��|��S)z�Returns the same Decimal object.

        As we do not have different encodings for the same number, the
        received object already is in its canonical form.

        >>> ExtendedContext.canonical(Decimal('2.50'))
        Decimal('2.50')
        z,canonical requires a Decimal as an argument.)rdrrwrMr�r)r)r+rMNs	
zContext.canonicalcCst|dd�}|j||d�S)a�Compares values numerically.

        If the signs of the operands differ, a value representing each operand
        ('-1' if the operand is less than zero, '0' if the operand is zero or
        negative zero, or '1' if the operand is greater than zero) is used in
        place of that operand for the comparison instead of the actual
        operand.

        The comparison is then effected by subtracting the second operand from
        the first and then returning a value according to the result of the
        subtraction: '-1' if the result is less than zero, '0' if the result is
        zero or negative zero, or '1' if the result is greater than zero.

        >>> ExtendedContext.compare(Decimal('2.1'), Decimal('3'))
        Decimal('-1')
        >>> ExtendedContext.compare(Decimal('2.1'), Decimal('2.1'))
        Decimal('0')
        >>> ExtendedContext.compare(Decimal('2.1'), Decimal('2.10'))
        Decimal('0')
        >>> ExtendedContext.compare(Decimal('3'), Decimal('2.1'))
        Decimal('1')
        >>> ExtendedContext.compare(Decimal('2.1'), Decimal('-3'))
        Decimal('1')
        >>> ExtendedContext.compare(Decimal('-3'), Decimal('2.1'))
        Decimal('-1')
        >>> ExtendedContext.compare(1, 2)
        Decimal('-1')
        >>> ExtendedContext.compare(Decimal(1), 2)
        Decimal('-1')
        >>> ExtendedContext.compare(1, Decimal(2))
        Decimal('-1')
        Tr�rL)r�r��r0r-rsr)r)r+r�[s!zContext.comparecCst|dd�}|j||d�S)aCompares the values of the two operands numerically.

        It's pretty much like compare(), but all NaNs signal, with signaling
        NaNs taking precedence over quiet NaNs.

        >>> c = ExtendedContext
        >>> c.compare_signal(Decimal('2.1'), Decimal('3'))
        Decimal('-1')
        >>> c.compare_signal(Decimal('2.1'), Decimal('2.1'))
        Decimal('0')
        >>> c.flags[InvalidOperation] = 0
        >>> print(c.flags[InvalidOperation])
        0
        >>> c.compare_signal(Decimal('NaN'), Decimal('2.1'))
        Decimal('NaN')
        >>> print(c.flags[InvalidOperation])
        1
        >>> c.flags[InvalidOperation] = 0
        >>> print(c.flags[InvalidOperation])
        0
        >>> c.compare_signal(Decimal('sNaN'), Decimal('2.1'))
        Decimal('NaN')
        >>> print(c.flags[InvalidOperation])
        1
        >>> c.compare_signal(-1, 2)
        Decimal('-1')
        >>> c.compare_signal(Decimal(-1), 2)
        Decimal('-1')
        >>> c.compare_signal(-1, Decimal(2))
        Decimal('-1')
        Tr�rL)r�rNr�r)r)r+rNs zContext.compare_signalcCst|dd�}|�|�S)a+Compares two operands using their abstract representation.

        This is not like the standard compare, which use their numerical
        value. Note that a total ordering is defined for all possible abstract
        representations.

        >>> ExtendedContext.compare_total(Decimal('12.73'), Decimal('127.9'))
        Decimal('-1')
        >>> ExtendedContext.compare_total(Decimal('-127'),  Decimal('12'))
        Decimal('-1')
        >>> ExtendedContext.compare_total(Decimal('12.30'), Decimal('12.3'))
        Decimal('-1')
        >>> ExtendedContext.compare_total(Decimal('12.30'), Decimal('12.30'))
        Decimal('0')
        >>> ExtendedContext.compare_total(Decimal('12.3'),  Decimal('12.300'))
        Decimal('1')
        >>> ExtendedContext.compare_total(Decimal('12.3'),  Decimal('NaN'))
        Decimal('-1')
        >>> ExtendedContext.compare_total(1, 2)
        Decimal('-1')
        >>> ExtendedContext.compare_total(Decimal(1), 2)
        Decimal('-1')
        >>> ExtendedContext.compare_total(1, Decimal(2))
        Decimal('-1')
        Tr�)r�rJr�r)r)r+rJ�szContext.compare_totalcCst|dd�}|�|�S)z�Compares two operands using their abstract representation ignoring sign.

        Like compare_total, but with operand's sign ignored and assumed to be 0.
        Tr�)r�rRr�r)r)r+rR�szContext.compare_total_magcCst|dd�}|��S)aReturns a copy of the operand with the sign set to 0.

        >>> ExtendedContext.copy_abs(Decimal('2.1'))
        Decimal('2.1')
        >>> ExtendedContext.copy_abs(Decimal('-100'))
        Decimal('100')
        >>> ExtendedContext.copy_abs(-1)
        Decimal('1')
        Tr�)r�r�r�r)r)r+r��s
zContext.copy_abscCst|dd�}t|�S)aReturns a copy of the decimal object.

        >>> ExtendedContext.copy_decimal(Decimal('2.1'))
        Decimal('2.1')
        >>> ExtendedContext.copy_decimal(Decimal('-1.00'))
        Decimal('-1.00')
        >>> ExtendedContext.copy_decimal(1)
        Decimal('1')
        Tr�)r�rr�r)r)r+�copy_decimal�s
zContext.copy_decimalcCst|dd�}|��S)a(Returns a copy of the operand with the sign inverted.

        >>> ExtendedContext.copy_negate(Decimal('101.5'))
        Decimal('-101.5')
        >>> ExtendedContext.copy_negate(Decimal('-101.5'))
        Decimal('101.5')
        >>> ExtendedContext.copy_negate(1)
        Decimal('-1')
        Tr�)r�r�r�r)r)r+r��s
zContext.copy_negatecCst|dd�}|�|�S)aCopies the second operand's sign to the first one.

        In detail, it returns a copy of the first operand with the sign
        equal to the sign of the second operand.

        >>> ExtendedContext.copy_sign(Decimal( '1.50'), Decimal('7.33'))
        Decimal('1.50')
        >>> ExtendedContext.copy_sign(Decimal('-1.50'), Decimal('7.33'))
        Decimal('1.50')
        >>> ExtendedContext.copy_sign(Decimal( '1.50'), Decimal('-7.33'))
        Decimal('-1.50')
        >>> ExtendedContext.copy_sign(Decimal('-1.50'), Decimal('-7.33'))
        Decimal('-1.50')
        >>> ExtendedContext.copy_sign(1, -2)
        Decimal('-1')
        >>> ExtendedContext.copy_sign(Decimal(1), -2)
        Decimal('-1')
        >>> ExtendedContext.copy_sign(1, Decimal(-2))
        Decimal('-1')
        Tr�)r�rSr�r)r)r+rS�szContext.copy_signcCs8t|dd�}|j||d�}|tkr0td|��n|SdS)a�Decimal division in a specified context.

        >>> ExtendedContext.divide(Decimal('1'), Decimal('3'))
        Decimal('0.333333333')
        >>> ExtendedContext.divide(Decimal('2'), Decimal('3'))
        Decimal('0.666666667')
        >>> ExtendedContext.divide(Decimal('5'), Decimal('2'))
        Decimal('2.5')
        >>> ExtendedContext.divide(Decimal('1'), Decimal('10'))
        Decimal('0.1')
        >>> ExtendedContext.divide(Decimal('12'), Decimal('12'))
        Decimal('1')
        >>> ExtendedContext.divide(Decimal('8.00'), Decimal('2'))
        Decimal('4.00')
        >>> ExtendedContext.divide(Decimal('2.400'), Decimal('2.0'))
        Decimal('1.20')
        >>> ExtendedContext.divide(Decimal('1000'), Decimal('100'))
        Decimal('10')
        >>> ExtendedContext.divide(Decimal('1000'), Decimal('1'))
        Decimal('1000')
        >>> ExtendedContext.divide(Decimal('2.40E+6'), Decimal('2'))
        Decimal('1.20E+6')
        >>> ExtendedContext.divide(5, 5)
        Decimal('1')
        >>> ExtendedContext.divide(Decimal(5), 5)
        Decimal('1')
        >>> ExtendedContext.divide(5, Decimal(5))
        Decimal('1')
        Tr�rLr�N)r�r�r�rwr�r)r)r+�divides
zContext.dividecCs8t|dd�}|j||d�}|tkr0td|��n|SdS)a/Divides two numbers and returns the integer part of the result.

        >>> ExtendedContext.divide_int(Decimal('2'), Decimal('3'))
        Decimal('0')
        >>> ExtendedContext.divide_int(Decimal('10'), Decimal('3'))
        Decimal('3')
        >>> ExtendedContext.divide_int(Decimal('1'), Decimal('0.3'))
        Decimal('3')
        >>> ExtendedContext.divide_int(10, 3)
        Decimal('3')
        >>> ExtendedContext.divide_int(Decimal(10), 3)
        Decimal('3')
        >>> ExtendedContext.divide_int(10, Decimal(3))
        Decimal('3')
        Tr�rLr�N)r�r�r�rwr�r)r)r+�
divide_int+s
zContext.divide_intcCs8t|dd�}|j||d�}|tkr0td|��n|SdS)a�Return (a // b, a % b).

        >>> ExtendedContext.divmod(Decimal(8), Decimal(3))
        (Decimal('2'), Decimal('2'))
        >>> ExtendedContext.divmod(Decimal(8), Decimal(4))
        (Decimal('2'), Decimal('0'))
        >>> ExtendedContext.divmod(8, 4)
        (Decimal('2'), Decimal('0'))
        >>> ExtendedContext.divmod(Decimal(8), 4)
        (Decimal('2'), Decimal('0'))
        >>> ExtendedContext.divmod(8, Decimal(4))
        (Decimal('2'), Decimal('0'))
        Tr�rLr�N)r�r�r�rwr�r)r)r+r�Bs
zContext.divmodcCst|dd�}|j|d�S)a#Returns e ** a.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.exp(Decimal('-Infinity'))
        Decimal('0')
        >>> c.exp(Decimal('-1'))
        Decimal('0.367879441')
        >>> c.exp(Decimal('0'))
        Decimal('1')
        >>> c.exp(Decimal('1'))
        Decimal('2.71828183')
        >>> c.exp(Decimal('0.693147181'))
        Decimal('2.00000000')
        >>> c.exp(Decimal('+Infinity'))
        Decimal('Infinity')
        >>> c.exp(10)
        Decimal('22026.4658')
        Tr�rL)r�rWr�r)r)r+rWWszContext.expcCst|dd�}|j|||d�S)aReturns a multiplied by b, plus c.

        The first two operands are multiplied together, using multiply,
        the third operand is then added to the result of that
        multiplication, using add, all with only one final rounding.

        >>> ExtendedContext.fma(Decimal('3'), Decimal('5'), Decimal('7'))
        Decimal('22')
        >>> ExtendedContext.fma(Decimal('3'), Decimal('-5'), Decimal('7'))
        Decimal('-8')
        >>> ExtendedContext.fma(Decimal('888565290'), Decimal('1557.96930'), Decimal('-86087.7578'))
        Decimal('1.38435736E+12')
        >>> ExtendedContext.fma(1, 3, 4)
        Decimal('7')
        >>> ExtendedContext.fma(1, Decimal(3), 4)
        Decimal('7')
        >>> ExtendedContext.fma(1, 3, Decimal(4))
        Decimal('7')
        Tr�rL)r�r)r0r-rsrFr)r)r+roszContext.fmacCst|t�std��|��S)aReturn True if the operand is canonical; otherwise return False.

        Currently, the encoding of a Decimal instance is always
        canonical, so this method returns True for any Decimal.

        >>> ExtendedContext.is_canonical(Decimal('2.50'))
        True
        z/is_canonical requires a Decimal as an argument.)rdrrwrVr�r)r)r+rV�s	
zContext.is_canonicalcCst|dd�}|��S)a,Return True if the operand is finite; otherwise return False.

        A Decimal instance is considered finite if it is neither
        infinite nor a NaN.

        >>> ExtendedContext.is_finite(Decimal('2.50'))
        True
        >>> ExtendedContext.is_finite(Decimal('-0.3'))
        True
        >>> ExtendedContext.is_finite(Decimal('0'))
        True
        >>> ExtendedContext.is_finite(Decimal('Inf'))
        False
        >>> ExtendedContext.is_finite(Decimal('NaN'))
        False
        >>> ExtendedContext.is_finite(1)
        True
        Tr�)r�rWr�r)r)r+rW�szContext.is_finitecCst|dd�}|��S)aUReturn True if the operand is infinite; otherwise return False.

        >>> ExtendedContext.is_infinite(Decimal('2.50'))
        False
        >>> ExtendedContext.is_infinite(Decimal('-Inf'))
        True
        >>> ExtendedContext.is_infinite(Decimal('NaN'))
        False
        >>> ExtendedContext.is_infinite(1)
        False
        Tr�)r�r=r�r)r)r+r=�szContext.is_infinitecCst|dd�}|��S)aOReturn True if the operand is a qNaN or sNaN;
        otherwise return False.

        >>> ExtendedContext.is_nan(Decimal('2.50'))
        False
        >>> ExtendedContext.is_nan(Decimal('NaN'))
        True
        >>> ExtendedContext.is_nan(Decimal('-sNaN'))
        True
        >>> ExtendedContext.is_nan(1)
        False
        Tr�)r�r�r�r)r)r+r��s
zContext.is_nancCst|dd�}|j|d�S)a�Return True if the operand is a normal number;
        otherwise return False.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.is_normal(Decimal('2.50'))
        True
        >>> c.is_normal(Decimal('0.1E-999'))
        False
        >>> c.is_normal(Decimal('0.00'))
        False
        >>> c.is_normal(Decimal('-Inf'))
        False
        >>> c.is_normal(Decimal('NaN'))
        False
        >>> c.is_normal(1)
        True
        Tr�rL)r�rYr�r)r)r+rY�szContext.is_normalcCst|dd�}|��S)aHReturn True if the operand is a quiet NaN; otherwise return False.

        >>> ExtendedContext.is_qnan(Decimal('2.50'))
        False
        >>> ExtendedContext.is_qnan(Decimal('NaN'))
        True
        >>> ExtendedContext.is_qnan(Decimal('sNaN'))
        False
        >>> ExtendedContext.is_qnan(1)
        False
        Tr�)r�r�r�r)r)r+r��szContext.is_qnancCst|dd�}|��S)a�Return True if the operand is negative; otherwise return False.

        >>> ExtendedContext.is_signed(Decimal('2.50'))
        False
        >>> ExtendedContext.is_signed(Decimal('-12'))
        True
        >>> ExtendedContext.is_signed(Decimal('-0'))
        True
        >>> ExtendedContext.is_signed(8)
        False
        >>> ExtendedContext.is_signed(-8)
        True
        Tr�)r�rZr�r)r)r+rZ�szContext.is_signedcCst|dd�}|��S)aTReturn True if the operand is a signaling NaN;
        otherwise return False.

        >>> ExtendedContext.is_snan(Decimal('2.50'))
        False
        >>> ExtendedContext.is_snan(Decimal('NaN'))
        False
        >>> ExtendedContext.is_snan(Decimal('sNaN'))
        True
        >>> ExtendedContext.is_snan(1)
        False
        Tr�)r�r�r�r)r)r+r��s
zContext.is_snancCst|dd�}|j|d�S)a�Return True if the operand is subnormal; otherwise return False.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.is_subnormal(Decimal('2.50'))
        False
        >>> c.is_subnormal(Decimal('0.1E-999'))
        True
        >>> c.is_subnormal(Decimal('0.00'))
        False
        >>> c.is_subnormal(Decimal('-Inf'))
        False
        >>> c.is_subnormal(Decimal('NaN'))
        False
        >>> c.is_subnormal(1)
        False
        Tr�rL)r�r[r�r)r)r+r[szContext.is_subnormalcCst|dd�}|��S)auReturn True if the operand is a zero; otherwise return False.

        >>> ExtendedContext.is_zero(Decimal('0'))
        True
        >>> ExtendedContext.is_zero(Decimal('2.50'))
        False
        >>> ExtendedContext.is_zero(Decimal('-0E+2'))
        True
        >>> ExtendedContext.is_zero(1)
        False
        >>> ExtendedContext.is_zero(0)
        True
        Tr�)r�r\r�r)r)r+r\%szContext.is_zerocCst|dd�}|j|d�S)a�Returns the natural (base e) logarithm of the operand.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.ln(Decimal('0'))
        Decimal('-Infinity')
        >>> c.ln(Decimal('1.000'))
        Decimal('0')
        >>> c.ln(Decimal('2.71828183'))
        Decimal('1.00000000')
        >>> c.ln(Decimal('10'))
        Decimal('2.30258509')
        >>> c.ln(Decimal('+Infinity'))
        Decimal('Infinity')
        >>> c.ln(1)
        Decimal('0')
        Tr�rL)r�rfr�r)r)r+rf6sz
Context.lncCst|dd�}|j|d�S)a�Returns the base 10 logarithm of the operand.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.log10(Decimal('0'))
        Decimal('-Infinity')
        >>> c.log10(Decimal('0.001'))
        Decimal('-3')
        >>> c.log10(Decimal('1.000'))
        Decimal('0')
        >>> c.log10(Decimal('2'))
        Decimal('0.301029996')
        >>> c.log10(Decimal('10'))
        Decimal('1')
        >>> c.log10(Decimal('70'))
        Decimal('1.84509804')
        >>> c.log10(Decimal('+Infinity'))
        Decimal('Infinity')
        >>> c.log10(0)
        Decimal('-Infinity')
        >>> c.log10(1)
        Decimal('0')
        Tr�rL)r�rir�r)r)r+riLsz
Context.log10cCst|dd�}|j|d�S)a4 Returns the exponent of the magnitude of the operand's MSD.

        The result is the integer which is the exponent of the magnitude
        of the most significant digit of the operand (as though the
        operand were truncated to a single digit while maintaining the
        value of that digit and without limiting the resulting exponent).

        >>> ExtendedContext.logb(Decimal('250'))
        Decimal('2')
        >>> ExtendedContext.logb(Decimal('2.50'))
        Decimal('0')
        >>> ExtendedContext.logb(Decimal('0.03'))
        Decimal('-2')
        >>> ExtendedContext.logb(Decimal('0'))
        Decimal('-Infinity')
        >>> ExtendedContext.logb(1)
        Decimal('0')
        >>> ExtendedContext.logb(10)
        Decimal('1')
        >>> ExtendedContext.logb(100)
        Decimal('2')
        Tr�rL)r�rjr�r)r)r+rjhszContext.logbcCst|dd�}|j||d�S)a�Applies the logical operation 'and' between each operand's digits.

        The operands must be both logical numbers.

        >>> ExtendedContext.logical_and(Decimal('0'), Decimal('0'))
        Decimal('0')
        >>> ExtendedContext.logical_and(Decimal('0'), Decimal('1'))
        Decimal('0')
        >>> ExtendedContext.logical_and(Decimal('1'), Decimal('0'))
        Decimal('0')
        >>> ExtendedContext.logical_and(Decimal('1'), Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.logical_and(Decimal('1100'), Decimal('1010'))
        Decimal('1000')
        >>> ExtendedContext.logical_and(Decimal('1111'), Decimal('10'))
        Decimal('10')
        >>> ExtendedContext.logical_and(110, 1101)
        Decimal('100')
        >>> ExtendedContext.logical_and(Decimal(110), 1101)
        Decimal('100')
        >>> ExtendedContext.logical_and(110, Decimal(1101))
        Decimal('100')
        Tr�rL)r�rxr�r)r)r+rx�szContext.logical_andcCst|dd�}|j|d�S)aInvert all the digits in the operand.

        The operand must be a logical number.

        >>> ExtendedContext.logical_invert(Decimal('0'))
        Decimal('111111111')
        >>> ExtendedContext.logical_invert(Decimal('1'))
        Decimal('111111110')
        >>> ExtendedContext.logical_invert(Decimal('111111111'))
        Decimal('0')
        >>> ExtendedContext.logical_invert(Decimal('101010101'))
        Decimal('10101010')
        >>> ExtendedContext.logical_invert(1101)
        Decimal('111110010')
        Tr�rL)r�rzr�r)r)r+rz�szContext.logical_invertcCst|dd�}|j||d�S)a�Applies the logical operation 'or' between each operand's digits.

        The operands must be both logical numbers.

        >>> ExtendedContext.logical_or(Decimal('0'), Decimal('0'))
        Decimal('0')
        >>> ExtendedContext.logical_or(Decimal('0'), Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.logical_or(Decimal('1'), Decimal('0'))
        Decimal('1')
        >>> ExtendedContext.logical_or(Decimal('1'), Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.logical_or(Decimal('1100'), Decimal('1010'))
        Decimal('1110')
        >>> ExtendedContext.logical_or(Decimal('1110'), Decimal('10'))
        Decimal('1110')
        >>> ExtendedContext.logical_or(110, 1101)
        Decimal('1111')
        >>> ExtendedContext.logical_or(Decimal(110), 1101)
        Decimal('1111')
        >>> ExtendedContext.logical_or(110, Decimal(1101))
        Decimal('1111')
        Tr�rL)r�r{r�r)r)r+r{�szContext.logical_orcCst|dd�}|j||d�S)a�Applies the logical operation 'xor' between each operand's digits.

        The operands must be both logical numbers.

        >>> ExtendedContext.logical_xor(Decimal('0'), Decimal('0'))
        Decimal('0')
        >>> ExtendedContext.logical_xor(Decimal('0'), Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.logical_xor(Decimal('1'), Decimal('0'))
        Decimal('1')
        >>> ExtendedContext.logical_xor(Decimal('1'), Decimal('1'))
        Decimal('0')
        >>> ExtendedContext.logical_xor(Decimal('1100'), Decimal('1010'))
        Decimal('110')
        >>> ExtendedContext.logical_xor(Decimal('1111'), Decimal('10'))
        Decimal('1101')
        >>> ExtendedContext.logical_xor(110, 1101)
        Decimal('1011')
        >>> ExtendedContext.logical_xor(Decimal(110), 1101)
        Decimal('1011')
        >>> ExtendedContext.logical_xor(110, Decimal(1101))
        Decimal('1011')
        Tr�rL)r�ryr�r)r)r+ry�szContext.logical_xorcCst|dd�}|j||d�S)a�max compares two values numerically and returns the maximum.

        If either operand is a NaN then the general rules apply.
        Otherwise, the operands are compared as though by the compare
        operation.  If they are numerically equal then the left-hand operand
        is chosen as the result.  Otherwise the maximum (closer to positive
        infinity) of the two operands is chosen as the result.

        >>> ExtendedContext.max(Decimal('3'), Decimal('2'))
        Decimal('3')
        >>> ExtendedContext.max(Decimal('-10'), Decimal('3'))
        Decimal('3')
        >>> ExtendedContext.max(Decimal('1.0'), Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.max(Decimal('7'), Decimal('NaN'))
        Decimal('7')
        >>> ExtendedContext.max(1, 2)
        Decimal('2')
        >>> ExtendedContext.max(Decimal(1), 2)
        Decimal('2')
        >>> ExtendedContext.max(1, Decimal(2))
        Decimal('2')
        Tr�rL)r�r�r�r)r)r+r��szContext.maxcCst|dd�}|j||d�S)a�Compares the values numerically with their sign ignored.

        >>> ExtendedContext.max_mag(Decimal('7'), Decimal('NaN'))
        Decimal('7')
        >>> ExtendedContext.max_mag(Decimal('7'), Decimal('-10'))
        Decimal('-10')
        >>> ExtendedContext.max_mag(1, -2)
        Decimal('-2')
        >>> ExtendedContext.max_mag(Decimal(1), -2)
        Decimal('-2')
        >>> ExtendedContext.max_mag(1, Decimal(-2))
        Decimal('-2')
        Tr�rL)r�r~r�r)r)r+r~szContext.max_magcCst|dd�}|j||d�S)a�min compares two values numerically and returns the minimum.

        If either operand is a NaN then the general rules apply.
        Otherwise, the operands are compared as though by the compare
        operation.  If they are numerically equal then the left-hand operand
        is chosen as the result.  Otherwise the minimum (closer to negative
        infinity) of the two operands is chosen as the result.

        >>> ExtendedContext.min(Decimal('3'), Decimal('2'))
        Decimal('2')
        >>> ExtendedContext.min(Decimal('-10'), Decimal('3'))
        Decimal('-10')
        >>> ExtendedContext.min(Decimal('1.0'), Decimal('1'))
        Decimal('1.0')
        >>> ExtendedContext.min(Decimal('7'), Decimal('NaN'))
        Decimal('7')
        >>> ExtendedContext.min(1, 2)
        Decimal('1')
        >>> ExtendedContext.min(Decimal(1), 2)
        Decimal('1')
        >>> ExtendedContext.min(1, Decimal(29))
        Decimal('1')
        Tr�rL)r�r�r�r)r)r+r�szContext.mincCst|dd�}|j||d�S)a�Compares the values numerically with their sign ignored.

        >>> ExtendedContext.min_mag(Decimal('3'), Decimal('-2'))
        Decimal('-2')
        >>> ExtendedContext.min_mag(Decimal('-3'), Decimal('NaN'))
        Decimal('-3')
        >>> ExtendedContext.min_mag(1, -2)
        Decimal('1')
        >>> ExtendedContext.min_mag(Decimal(1), -2)
        Decimal('1')
        >>> ExtendedContext.min_mag(1, Decimal(-2))
        Decimal('1')
        Tr�rL)r�rr�r)r)r+r-szContext.min_magcCst|dd�}|j|d�S)a�Minus corresponds to unary prefix minus in Python.

        The operation is evaluated using the same rules as subtract; the
        operation minus(a) is calculated as subtract('0', a) where the '0'
        has the same exponent as the operand.

        >>> ExtendedContext.minus(Decimal('1.3'))
        Decimal('-1.3')
        >>> ExtendedContext.minus(Decimal('-1.3'))
        Decimal('1.3')
        >>> ExtendedContext.minus(1)
        Decimal('-1')
        Tr�rL)r�r�r�r)r)r+�minus>sz
Context.minuscCs8t|dd�}|j||d�}|tkr0td|��n|SdS)a�multiply multiplies two operands.

        If either operand is a special value then the general rules apply.
        Otherwise, the operands are multiplied together
        ('long multiplication'), resulting in a number which may be as long as
        the sum of the lengths of the two operands.

        >>> ExtendedContext.multiply(Decimal('1.20'), Decimal('3'))
        Decimal('3.60')
        >>> ExtendedContext.multiply(Decimal('7'), Decimal('3'))
        Decimal('21')
        >>> ExtendedContext.multiply(Decimal('0.9'), Decimal('0.8'))
        Decimal('0.72')
        >>> ExtendedContext.multiply(Decimal('0.9'), Decimal('-0'))
        Decimal('-0.0')
        >>> ExtendedContext.multiply(Decimal('654321'), Decimal('654321'))
        Decimal('4.28135971E+11')
        >>> ExtendedContext.multiply(7, 7)
        Decimal('49')
        >>> ExtendedContext.multiply(Decimal(7), 7)
        Decimal('49')
        >>> ExtendedContext.multiply(7, Decimal(7))
        Decimal('49')
        Tr�rLr�N)r�r�r�rwr�r)r)r+�multiplyOs
zContext.multiplycCst|dd�}|j|d�S)a"Returns the largest representable number smaller than a.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> ExtendedContext.next_minus(Decimal('1'))
        Decimal('0.999999999')
        >>> c.next_minus(Decimal('1E-1007'))
        Decimal('0E-1007')
        >>> ExtendedContext.next_minus(Decimal('-1.00000003'))
        Decimal('-1.00000004')
        >>> c.next_minus(Decimal('Infinity'))
        Decimal('9.99999999E+999')
        >>> c.next_minus(1)
        Decimal('0.999999999')
        Tr�rL)r�r�r�r)r)r+r�oszContext.next_minuscCst|dd�}|j|d�S)aReturns the smallest representable number larger than a.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> ExtendedContext.next_plus(Decimal('1'))
        Decimal('1.00000001')
        >>> c.next_plus(Decimal('-1E-1007'))
        Decimal('-0E-1007')
        >>> ExtendedContext.next_plus(Decimal('-1.00000003'))
        Decimal('-1.00000002')
        >>> c.next_plus(Decimal('-Infinity'))
        Decimal('-9.99999999E+999')
        >>> c.next_plus(1)
        Decimal('1.00000001')
        Tr�rL)r�r�r�r)r)r+r��szContext.next_pluscCst|dd�}|j||d�S)a�Returns the number closest to a, in direction towards b.

        The result is the closest representable number from the first
        operand (but not the first operand) that is in the direction
        towards the second operand, unless the operands have the same
        value.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.next_toward(Decimal('1'), Decimal('2'))
        Decimal('1.00000001')
        >>> c.next_toward(Decimal('-1E-1007'), Decimal('1'))
        Decimal('-0E-1007')
        >>> c.next_toward(Decimal('-1.00000003'), Decimal('0'))
        Decimal('-1.00000002')
        >>> c.next_toward(Decimal('1'), Decimal('0'))
        Decimal('0.999999999')
        >>> c.next_toward(Decimal('1E-1007'), Decimal('-100'))
        Decimal('0E-1007')
        >>> c.next_toward(Decimal('-1.00000003'), Decimal('-10'))
        Decimal('-1.00000004')
        >>> c.next_toward(Decimal('0.00'), Decimal('-0.0000'))
        Decimal('-0.00')
        >>> c.next_toward(0, 1)
        Decimal('1E-1007')
        >>> c.next_toward(Decimal(0), 1)
        Decimal('1E-1007')
        >>> c.next_toward(0, Decimal(1))
        Decimal('1E-1007')
        Tr�rL)r�r�r�r)r)r+r��s zContext.next_towardcCst|dd�}|j|d�S)a�normalize reduces an operand to its simplest form.

        Essentially a plus operation with all trailing zeros removed from the
        result.

        >>> ExtendedContext.normalize(Decimal('2.1'))
        Decimal('2.1')
        >>> ExtendedContext.normalize(Decimal('-2.0'))
        Decimal('-2')
        >>> ExtendedContext.normalize(Decimal('1.200'))
        Decimal('1.2')
        >>> ExtendedContext.normalize(Decimal('-120'))
        Decimal('-1.2E+2')
        >>> ExtendedContext.normalize(Decimal('120.00'))
        Decimal('1.2E+2')
        >>> ExtendedContext.normalize(Decimal('0.00'))
        Decimal('0')
        >>> ExtendedContext.normalize(6)
        Decimal('6')
        Tr�rL)r�r;r�r)r)r+r;�szContext.normalizecCst|dd�}|j|d�S)a�Returns an indication of the class of the operand.

        The class is one of the following strings:
          -sNaN
          -NaN
          -Infinity
          -Normal
          -Subnormal
          -Zero
          +Zero
          +Subnormal
          +Normal
          +Infinity

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.number_class(Decimal('Infinity'))
        '+Infinity'
        >>> c.number_class(Decimal('1E-10'))
        '+Normal'
        >>> c.number_class(Decimal('2.50'))
        '+Normal'
        >>> c.number_class(Decimal('0.1E-999'))
        '+Subnormal'
        >>> c.number_class(Decimal('0'))
        '+Zero'
        >>> c.number_class(Decimal('-0'))
        '-Zero'
        >>> c.number_class(Decimal('-0.1E-999'))
        '-Subnormal'
        >>> c.number_class(Decimal('-1E-10'))
        '-Normal'
        >>> c.number_class(Decimal('-2.50'))
        '-Normal'
        >>> c.number_class(Decimal('-Infinity'))
        '-Infinity'
        >>> c.number_class(Decimal('NaN'))
        'NaN'
        >>> c.number_class(Decimal('-NaN'))
        'NaN'
        >>> c.number_class(Decimal('sNaN'))
        'sNaN'
        >>> c.number_class(123)
        '+Normal'
        Tr�rL)r�r�r�r)r)r+r��s/zContext.number_classcCst|dd�}|j|d�S)a�Plus corresponds to unary prefix plus in Python.

        The operation is evaluated using the same rules as add; the
        operation plus(a) is calculated as add('0', a) where the '0'
        has the same exponent as the operand.

        >>> ExtendedContext.plus(Decimal('1.3'))
        Decimal('1.3')
        >>> ExtendedContext.plus(Decimal('-1.3'))
        Decimal('-1.3')
        >>> ExtendedContext.plus(-1)
        Decimal('-1')
        Tr�rL)r�r�r�r)r)r+�plusszContext.pluscCs:t|dd�}|j|||d�}|tkr2td|��n|SdS)aRaises a to the power of b, to modulo if given.

        With two arguments, compute a**b.  If a is negative then b
        must be integral.  The result will be inexact unless b is
        integral and the result is finite and can be expressed exactly
        in 'precision' digits.

        With three arguments, compute (a**b) % modulo.  For the
        three argument form, the following restrictions on the
        arguments hold:

         - all three arguments must be integral
         - b must be nonnegative
         - at least one of a or b must be nonzero
         - modulo must be nonzero and have at most 'precision' digits

        The result of pow(a, b, modulo) is identical to the result
        that would be obtained by computing (a**b) % modulo with
        unbounded precision, but is computed more efficiently.  It is
        always exact.

        >>> c = ExtendedContext.copy()
        >>> c.Emin = -999
        >>> c.Emax = 999
        >>> c.power(Decimal('2'), Decimal('3'))
        Decimal('8')
        >>> c.power(Decimal('-2'), Decimal('3'))
        Decimal('-8')
        >>> c.power(Decimal('2'), Decimal('-3'))
        Decimal('0.125')
        >>> c.power(Decimal('1.7'), Decimal('8'))
        Decimal('69.7575744')
        >>> c.power(Decimal('10'), Decimal('0.301029996'))
        Decimal('2.00000000')
        >>> c.power(Decimal('Infinity'), Decimal('-1'))
        Decimal('0')
        >>> c.power(Decimal('Infinity'), Decimal('0'))
        Decimal('1')
        >>> c.power(Decimal('Infinity'), Decimal('1'))
        Decimal('Infinity')
        >>> c.power(Decimal('-Infinity'), Decimal('-1'))
        Decimal('-0')
        >>> c.power(Decimal('-Infinity'), Decimal('0'))
        Decimal('1')
        >>> c.power(Decimal('-Infinity'), Decimal('1'))
        Decimal('-Infinity')
        >>> c.power(Decimal('-Infinity'), Decimal('2'))
        Decimal('Infinity')
        >>> c.power(Decimal('0'), Decimal('0'))
        Decimal('NaN')

        >>> c.power(Decimal('3'), Decimal('7'), Decimal('16'))
        Decimal('11')
        >>> c.power(Decimal('-3'), Decimal('7'), Decimal('16'))
        Decimal('-11')
        >>> c.power(Decimal('-3'), Decimal('8'), Decimal('16'))
        Decimal('1')
        >>> c.power(Decimal('3'), Decimal('7'), Decimal('-16'))
        Decimal('11')
        >>> c.power(Decimal('23E12345'), Decimal('67E189'), Decimal('123456789'))
        Decimal('11729830')
        >>> c.power(Decimal('-0'), Decimal('17'), Decimal('1729'))
        Decimal('-0')
        >>> c.power(Decimal('-23'), Decimal('0'), Decimal('65537'))
        Decimal('1')
        >>> ExtendedContext.power(7, 7)
        Decimal('823543')
        >>> ExtendedContext.power(Decimal(7), 7)
        Decimal('823543')
        >>> ExtendedContext.power(7, Decimal(7), 2)
        Decimal('1')
        Tr�rLr�N)r�r7r�rw)r0r-rsrr�r)r)r+�powers
Iz
Context.powercCst|dd�}|j||d�S)a
Returns a value equal to 'a' (rounded), having the exponent of 'b'.

        The coefficient of the result is derived from that of the left-hand
        operand.  It may be rounded using the current rounding setting (if the
        exponent is being increased), multiplied by a positive power of ten (if
        the exponent is being decreased), or is unchanged (if the exponent is
        already equal to that of the right-hand operand).

        Unlike other operations, if the length of the coefficient after the
        quantize operation would be greater than precision then an Invalid
        operation condition is raised.  This guarantees that, unless there is
        an error condition, the exponent of the result of a quantize is always
        equal to that of the right-hand operand.

        Also unlike other operations, quantize will never raise Underflow, even
        if the result is subnormal and inexact.

        >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('0.001'))
        Decimal('2.170')
        >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('0.01'))
        Decimal('2.17')
        >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('0.1'))
        Decimal('2.2')
        >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('1e+0'))
        Decimal('2')
        >>> ExtendedContext.quantize(Decimal('2.17'), Decimal('1e+1'))
        Decimal('0E+1')
        >>> ExtendedContext.quantize(Decimal('-Inf'), Decimal('Infinity'))
        Decimal('-Infinity')
        >>> ExtendedContext.quantize(Decimal('2'), Decimal('Infinity'))
        Decimal('NaN')
        >>> ExtendedContext.quantize(Decimal('-0.1'), Decimal('1'))
        Decimal('-0')
        >>> ExtendedContext.quantize(Decimal('-0'), Decimal('1e+5'))
        Decimal('-0E+5')
        >>> ExtendedContext.quantize(Decimal('+35236450.6'), Decimal('1e-2'))
        Decimal('NaN')
        >>> ExtendedContext.quantize(Decimal('-35236450.6'), Decimal('1e-2'))
        Decimal('NaN')
        >>> ExtendedContext.quantize(Decimal('217'), Decimal('1e-1'))
        Decimal('217.0')
        >>> ExtendedContext.quantize(Decimal('217'), Decimal('1e-0'))
        Decimal('217')
        >>> ExtendedContext.quantize(Decimal('217'), Decimal('1e+1'))
        Decimal('2.2E+2')
        >>> ExtendedContext.quantize(Decimal('217'), Decimal('1e+2'))
        Decimal('2E+2')
        >>> ExtendedContext.quantize(1, 2)
        Decimal('1')
        >>> ExtendedContext.quantize(Decimal(1), 2)
        Decimal('1')
        >>> ExtendedContext.quantize(1, Decimal(2))
        Decimal('1')
        Tr�rL)r�rr�r)r)r+res7zContext.quantizecCstd�S)zkJust returns 10, as this is Decimal, :)

        >>> ExtendedContext.radix()
        Decimal('10')
        r�r�r�r)r)r+r��sz
Context.radixcCs8t|dd�}|j||d�}|tkr0td|��n|SdS)aReturns the remainder from integer division.

        The result is the residue of the dividend after the operation of
        calculating integer division as described for divide-integer, rounded
        to precision digits if necessary.  The sign of the result, if
        non-zero, is the same as that of the original dividend.

        This operation will fail under the same conditions as integer division
        (that is, if integer division on the same two operands would fail, the
        remainder cannot be calculated).

        >>> ExtendedContext.remainder(Decimal('2.1'), Decimal('3'))
        Decimal('2.1')
        >>> ExtendedContext.remainder(Decimal('10'), Decimal('3'))
        Decimal('1')
        >>> ExtendedContext.remainder(Decimal('-10'), Decimal('3'))
        Decimal('-1')
        >>> ExtendedContext.remainder(Decimal('10.2'), Decimal('1'))
        Decimal('0.2')
        >>> ExtendedContext.remainder(Decimal('10'), Decimal('0.3'))
        Decimal('0.1')
        >>> ExtendedContext.remainder(Decimal('3.6'), Decimal('1.3'))
        Decimal('1.0')
        >>> ExtendedContext.remainder(22, 6)
        Decimal('4')
        >>> ExtendedContext.remainder(Decimal(22), 6)
        Decimal('4')
        >>> ExtendedContext.remainder(22, Decimal(6))
        Decimal('4')
        Tr�rLr�N)r�r�r�rwr�r)r)r+r��s
zContext.remaindercCst|dd�}|j||d�S)aGReturns to be "a - b * n", where n is the integer nearest the exact
        value of "x / b" (if two integers are equally near then the even one
        is chosen).  If the result is equal to 0 then its sign will be the
        sign of a.

        This operation will fail under the same conditions as integer division
        (that is, if integer division on the same two operands would fail, the
        remainder cannot be calculated).

        >>> ExtendedContext.remainder_near(Decimal('2.1'), Decimal('3'))
        Decimal('-0.9')
        >>> ExtendedContext.remainder_near(Decimal('10'), Decimal('6'))
        Decimal('-2')
        >>> ExtendedContext.remainder_near(Decimal('10'), Decimal('3'))
        Decimal('1')
        >>> ExtendedContext.remainder_near(Decimal('-10'), Decimal('3'))
        Decimal('-1')
        >>> ExtendedContext.remainder_near(Decimal('10.2'), Decimal('1'))
        Decimal('0.2')
        >>> ExtendedContext.remainder_near(Decimal('10'), Decimal('0.3'))
        Decimal('0.1')
        >>> ExtendedContext.remainder_near(Decimal('3.6'), Decimal('1.3'))
        Decimal('-0.3')
        >>> ExtendedContext.remainder_near(3, 11)
        Decimal('3')
        >>> ExtendedContext.remainder_near(Decimal(3), 11)
        Decimal('3')
        >>> ExtendedContext.remainder_near(3, Decimal(11))
        Decimal('3')
        Tr�rL)r�r�r�r)r)r+r��szContext.remainder_nearcCst|dd�}|j||d�S)aNReturns a rotated copy of a, b times.

        The coefficient of the result is a rotated copy of the digits in
        the coefficient of the first operand.  The number of places of
        rotation is taken from the absolute value of the second operand,
        with the rotation being to the left if the second operand is
        positive or to the right otherwise.

        >>> ExtendedContext.rotate(Decimal('34'), Decimal('8'))
        Decimal('400000003')
        >>> ExtendedContext.rotate(Decimal('12'), Decimal('9'))
        Decimal('12')
        >>> ExtendedContext.rotate(Decimal('123456789'), Decimal('-2'))
        Decimal('891234567')
        >>> ExtendedContext.rotate(Decimal('123456789'), Decimal('0'))
        Decimal('123456789')
        >>> ExtendedContext.rotate(Decimal('123456789'), Decimal('+2'))
        Decimal('345678912')
        >>> ExtendedContext.rotate(1333333, 1)
        Decimal('13333330')
        >>> ExtendedContext.rotate(Decimal(1333333), 1)
        Decimal('13333330')
        >>> ExtendedContext.rotate(1333333, Decimal(1))
        Decimal('13333330')
        Tr�rL)r�r�r�r)r)r+r��szContext.rotatecCst|dd�}|�|�S)a�Returns True if the two operands have the same exponent.

        The result is never affected by either the sign or the coefficient of
        either operand.

        >>> ExtendedContext.same_quantum(Decimal('2.17'), Decimal('0.001'))
        False
        >>> ExtendedContext.same_quantum(Decimal('2.17'), Decimal('0.01'))
        True
        >>> ExtendedContext.same_quantum(Decimal('2.17'), Decimal('1'))
        False
        >>> ExtendedContext.same_quantum(Decimal('Inf'), Decimal('-Inf'))
        True
        >>> ExtendedContext.same_quantum(10000, -1)
        True
        >>> ExtendedContext.same_quantum(Decimal(10000), -1)
        True
        >>> ExtendedContext.same_quantum(10000, Decimal(-1))
        True
        Tr�)r�r>r�r)r)r+r>szContext.same_quantumcCst|dd�}|j||d�S)a3Returns the first operand after adding the second value its exp.

        >>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('-2'))
        Decimal('0.0750')
        >>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('0'))
        Decimal('7.50')
        >>> ExtendedContext.scaleb(Decimal('7.50'), Decimal('3'))
        Decimal('7.50E+3')
        >>> ExtendedContext.scaleb(1, 4)
        Decimal('1E+4')
        >>> ExtendedContext.scaleb(Decimal(1), 4)
        Decimal('1E+4')
        >>> ExtendedContext.scaleb(1, Decimal(4))
        Decimal('1E+4')
        Tr�rL)r�r�r�r)r)r+r�$szContext.scalebcCst|dd�}|j||d�S)a{Returns a shifted copy of a, b times.

        The coefficient of the result is a shifted copy of the digits
        in the coefficient of the first operand.  The number of places
        to shift is taken from the absolute value of the second operand,
        with the shift being to the left if the second operand is
        positive or to the right otherwise.  Digits shifted into the
        coefficient are zeros.

        >>> ExtendedContext.shift(Decimal('34'), Decimal('8'))
        Decimal('400000000')
        >>> ExtendedContext.shift(Decimal('12'), Decimal('9'))
        Decimal('0')
        >>> ExtendedContext.shift(Decimal('123456789'), Decimal('-2'))
        Decimal('1234567')
        >>> ExtendedContext.shift(Decimal('123456789'), Decimal('0'))
        Decimal('123456789')
        >>> ExtendedContext.shift(Decimal('123456789'), Decimal('+2'))
        Decimal('345678900')
        >>> ExtendedContext.shift(88888888, 2)
        Decimal('888888800')
        >>> ExtendedContext.shift(Decimal(88888888), 2)
        Decimal('888888800')
        >>> ExtendedContext.shift(88888888, Decimal(2))
        Decimal('888888800')
        Tr�rL)r�r�r�r)r)r+r�7sz
Context.shiftcCst|dd�}|j|d�S)a�Square root of a non-negative number to context precision.

        If the result must be inexact, it is rounded using the round-half-even
        algorithm.

        >>> ExtendedContext.sqrt(Decimal('0'))
        Decimal('0')
        >>> ExtendedContext.sqrt(Decimal('-0'))
        Decimal('-0')
        >>> ExtendedContext.sqrt(Decimal('0.39'))
        Decimal('0.624499800')
        >>> ExtendedContext.sqrt(Decimal('100'))
        Decimal('10')
        >>> ExtendedContext.sqrt(Decimal('1'))
        Decimal('1')
        >>> ExtendedContext.sqrt(Decimal('1.0'))
        Decimal('1.0')
        >>> ExtendedContext.sqrt(Decimal('1.00'))
        Decimal('1.0')
        >>> ExtendedContext.sqrt(Decimal('7'))
        Decimal('2.64575131')
        >>> ExtendedContext.sqrt(Decimal('10'))
        Decimal('3.16227766')
        >>> ExtendedContext.sqrt(2)
        Decimal('1.41421356')
        >>> ExtendedContext.prec
        9
        Tr�rL)r�rHr�r)r)r+rHUszContext.sqrtcCs8t|dd�}|j||d�}|tkr0td|��n|SdS)a&Return the difference between the two operands.

        >>> ExtendedContext.subtract(Decimal('1.3'), Decimal('1.07'))
        Decimal('0.23')
        >>> ExtendedContext.subtract(Decimal('1.3'), Decimal('1.30'))
        Decimal('0.00')
        >>> ExtendedContext.subtract(Decimal('1.3'), Decimal('2.07'))
        Decimal('-0.77')
        >>> ExtendedContext.subtract(8, 5)
        Decimal('3')
        >>> ExtendedContext.subtract(Decimal(8), 5)
        Decimal('3')
        >>> ExtendedContext.subtract(8, Decimal(5))
        Decimal('3')
        Tr�rLr�N)r�r�r�rwr�r)r)r+�subtractus
zContext.subtractcCst|dd�}|j|d�S)a�Convert to a string, using engineering notation if an exponent is needed.

        Engineering notation has an exponent which is a multiple of 3.  This
        can leave up to 3 digits to the left of the decimal place and may
        require the addition of either one or two trailing zeros.

        The operation is not affected by the context.

        >>> ExtendedContext.to_eng_string(Decimal('123E+1'))
        '1.23E+3'
        >>> ExtendedContext.to_eng_string(Decimal('123E+3'))
        '123E+3'
        >>> ExtendedContext.to_eng_string(Decimal('123E-10'))
        '12.3E-9'
        >>> ExtendedContext.to_eng_string(Decimal('-123E-12'))
        '-123E-12'
        >>> ExtendedContext.to_eng_string(Decimal('7E-7'))
        '700E-9'
        >>> ExtendedContext.to_eng_string(Decimal('7E+1'))
        '70'
        >>> ExtendedContext.to_eng_string(Decimal('0E+1'))
        '0.00E+3'

        Tr�rL)r�r�r�r)r)r+r��szContext.to_eng_stringcCst|dd�}|j|d�S)zyConverts a number to a string, using scientific notation.

        The operation is not affected by the context.
        Tr�rL)r�r�r�r)r)r+�
to_sci_string�szContext.to_sci_stringcCst|dd�}|j|d�S)akRounds to an integer.

        When the operand has a negative exponent, the result is the same
        as using the quantize() operation using the given operand as the
        left-hand-operand, 1E+0 as the right-hand-operand, and the precision
        of the operand as the precision setting; Inexact and Rounded flags
        are allowed in this operation.  The rounding mode is taken from the
        context.

        >>> ExtendedContext.to_integral_exact(Decimal('2.1'))
        Decimal('2')
        >>> ExtendedContext.to_integral_exact(Decimal('100'))
        Decimal('100')
        >>> ExtendedContext.to_integral_exact(Decimal('100.0'))
        Decimal('100')
        >>> ExtendedContext.to_integral_exact(Decimal('101.5'))
        Decimal('102')
        >>> ExtendedContext.to_integral_exact(Decimal('-101.5'))
        Decimal('-102')
        >>> ExtendedContext.to_integral_exact(Decimal('10E+5'))
        Decimal('1.0E+6')
        >>> ExtendedContext.to_integral_exact(Decimal('7.89E+77'))
        Decimal('7.89E+77')
        >>> ExtendedContext.to_integral_exact(Decimal('-Inf'))
        Decimal('-Infinity')
        Tr�rL)r�rBr�r)r)r+rB�szContext.to_integral_exactcCst|dd�}|j|d�S)aLRounds to an integer.

        When the operand has a negative exponent, the result is the same
        as using the quantize() operation using the given operand as the
        left-hand-operand, 1E+0 as the right-hand-operand, and the precision
        of the operand as the precision setting, except that no flags will
        be set.  The rounding mode is taken from the context.

        >>> ExtendedContext.to_integral_value(Decimal('2.1'))
        Decimal('2')
        >>> ExtendedContext.to_integral_value(Decimal('100'))
        Decimal('100')
        >>> ExtendedContext.to_integral_value(Decimal('100.0'))
        Decimal('100')
        >>> ExtendedContext.to_integral_value(Decimal('101.5'))
        Decimal('102')
        >>> ExtendedContext.to_integral_value(Decimal('-101.5'))
        Decimal('-102')
        >>> ExtendedContext.to_integral_value(Decimal('10E+5'))
        Decimal('1.0E+6')
        >>> ExtendedContext.to_integral_value(Decimal('7.89E+77'))
        Decimal('7.89E+77')
        >>> ExtendedContext.to_integral_value(Decimal('-Inf'))
        Decimal('-Infinity')
        Tr�rL)r�rr�r)r)r+r�szContext.to_integral_value)	NNNNNNNNN)N)rR)N)Xr4r5r6r7r�r�r�r�r�r�r�rNr�rCrMr�rir�r�r�r�r�r�rDr�r�rmr�r�rMr�rNrJrRr�r�r�rSr�r�r�rWrrVrWr=r�rYr�rZr�r[r\rfrirjrxrzr{ryr�r~r�rr�r�r�r�r�r;r�r�r�rr�r�r�r�r>r�r�rHr�r�r�rBrr�r)r)r)r+rs��
$



$#


%
 #2
P:&" c@s"eZdZdZddd�Zdd�ZdS)rn�rCrVrWNcCsf|dkrd|_d|_d|_nFt|t�rD|j|_t|j�|_|j|_n|d|_|d|_|d|_dS)Nr&r.r^)rCrVrWrdrr;r<rP)r0ryr)r)r+r��s



z_WorkRep.__init__cCsd|j|j|jfS)Nz(%r, %r, %r)r�r�r)r)r+r�sz_WorkRep.__repr__)N)r4r5r6r�r�r�r)r)r)r+rn�s
rncCs�|j|jkr|}|}n|}|}tt|j��}tt|j��}|jtd||d�}||jd|krpd|_||_|jd|j|j9_|j|_||fS)zcNormalizes op1, op2 to have the same exp and length of coefficient.

    Done during addition.
    r�r^r.r�)rWrkrerVr�)r�r�rFZtmpr�Ztmp_lenZ	other_lenrWr)r)r+r�sr�cCsb|dkrdS|dkr |d|Stt|��}t|�t|�d��}||krPdS|d|SdS)a Given integers n and e, return n * 10**e if it's an integer, else None.

    The computation is designed to avoid computing large powers of 10
    unnecessarily.

    >>> _decimal_lshift_exact(3, 4)
    30000
    >>> _decimal_lshift_exact(300, -999999999)  # returns None

    r&r�rRN)rermrk�rstrip)r9r�Zstr_nZval_nr)r)r+r#(sr#cCsB|dks|dkrtd��d}||kr>||||d?}}q|S)z�Closest integer to the square root of the positive integer n.  a is
    an initial approximation to the square root.  Any positive integer
    will do for a, but the closer a is to the square root of n the
    faster convergence will be.

    r&z3Both arguments to _sqrt_nearest should be positive.r.)rq)r9r-rsr)r)r+�
_sqrt_nearest=sr�cCs2d|>||?}}|d||d@|d@|kS)z�Given an integer x and a nonnegative integer shift, return closest
    integer to x / 2**shift; use round-to-even in case of a tie.

    r.r^r))r&r�rsr�r)r)r+�_rshift_nearestLsr�cCs&t||�\}}|d||d@|kS)zaClosest integer to a/b, a and b positive integers; rounds to even
    in the case of a tie.

    r^r.)r�)r-rsr�r�r)r)r+�_div_nearestTsr�rc		Cs�||}d}||kr(t|�||>|ksD||krxt|�||?|krxt||d>|t||t||�|��}|d7}qtdtt|��d|�}t||�}t||�}t|ddd�D]}t||�t|||�}q�t|||�S)a�Integer approximation to M*log(x/M), with absolute error boundable
    in terms only of x/M.

    Given positive integers x and M, return an integer approximation to
    M * log(x/M).  For L = 8 and 0.1 <= x/M <= 10 the difference
    between the approximation and the exact result is at most 22.  For
    L = 8 and 1.0 <= x/M <= 10.0 the difference is at most 15.  In
    both cases these are upper bounds on the error; it will usually be
    much smaller.r&r.���r\r�)rmr�r�r�rVrkrer)	r&�M�Lr)�R�TZyshift�wr�r)r)r+�_ilog\s"���


r�c
Cs�|d7}tt|��}||||dk}|dkr�d|}|||}|dkrZ|d|9}nt|d|�}t||�}t|�}t|||�}||}	nd}t|d|�}	t|	|d�S)z�Given integers c, e and p with c > 0, p >= 0, compute an integer
    approximation to 10**p * log10(c*10**e), with an absolute error of
    at most 1.  Assumes that c*10**e is not exactly 1.r^r.r&r�r!)rkrer�r��
_log10_digits)
rFr�r%rGr�r�r��log_dZlog_10Zlog_tenpowerr)r)r+rh�s 

rhc	Cs�|d7}tt|��}||||dk}|dkrr|||}|dkrR|d|9}nt|d|�}t|d|�}nd}|r�ttt|���d}||dkr�t|t||�d|�}q�d}nd}t||d�S)z�Given integers c, e and p with c > 0, compute an integer
    approximation to 10**p * log(c*10**e), with an absolute error of
    at most 1.  Assumes that c*10**e is not exactly 1.r^r.r&r�r!)rkrer�r�rmr�)	rFr�r%rGr�r�r�r6Z	f_log_tenr)r)r+rd�s"rdc@s eZdZdZdd�Zdd�ZdS)�
_Log10Memoizez�Class to compute, store, and allow retrieval of, digits of the
    constant log(10) = 2.302585....  This constant is needed by
    Decimal.ln, Decimal.log10, Decimal.exp and Decimal.__pow__.cCs
d|_dS)NZ/23025850929940456840179914546843642076011014886)r}r�r)r)r+r��sz_Log10Memoize.__init__cCs�|dkrtd��|t|j�kr�d}d||d}tttd||�d��}||d�d|krbql|d7}q"|�d�dd	�|_t|jd|d
��S)ztGiven an integer p >= 0, return floor(10**p)*log(10).

        For example, self.getdigits(3) returns 2302.
        r&zp should be nonnegativer\r�r^r!NrRr�r.)rqrkr}rer�r�r�rV)r0r%r6r�r}r)r)r+�	getdigits�s	
z_Log10Memoize.getdigitsN)r4r5r6r7r�r�r)r)r)r+r��sr�c	Cs�t||>|�}tdtt|��d|�}t||�}||>}t|ddd�D]}t|||||�}qPt|ddd�D]"}||d>}t||||�}q|||S)z�Given integers x and M, M > 0, such that x/M is small in absolute
    value, compute an integer approximation to M*exp(x/M).  For 0 <=
    x/M <= 2.4, the absolute error in the result is bounded by 60 (and
    is usually much smaller).r�r\r.r&r�r^)r"rVrkrer�r)	r&r�r�r�r�r)ZMshiftrr�r)r)r+�_iexp�s
r�c	Cs�|d7}td|tt|��d�}||}||}|dkrH|d|}n|d|}t|t|��\}}t|d|�}tt|d|�d�||dfS)a�Compute an approximation to exp(c*10**e), with p decimal places of
    precision.

    Returns integers d, f such that:

      10**(p-1) <= d <= 10**p, and
      (d-1)*10**f < exp(c*10**e) < (d+1)*10**f

    In other words, d*10**f is an approximation to exp(c*10**e) with p
    digits of precision, and with an error in d of at most 1.  This is
    almost, but not quite, the same as the error being < 1ulp: when d
    = 10**(p-1) the error could be up to 10 ulp.r^r&r.r�i�r\)r�rkrer�r�r�r�)	rFr�r%r6r�r�ZcshiftZquotr,r)r)r+rT$srTcCs�ttt|���|}t||||d�}||}|dkrJ||d|}nt||d|�}|dkr�tt|��|dk|dkkr�d|ddd|}	}
q�d|d|}	}
n,t||d|d�\}	}
t|	d�}	|
d7}
|	|
fS)a5Given integers xc, xe, yc and ye representing Decimals x = xc*10**xe and
    y = yc*10**ye, compute x**y.  Returns a pair of integers (c, e) such that:

      10**(p-1) <= c <= 10**p, and
      (c-1)*10**e < x**y < (c+1)*10**e

    in other words, c*10**e is an approximation to x**y with p digits
    of precision, and with an error in c of at most 1.  (This is
    almost, but not quite, the same as the error being < 1ulp: when c
    == 10**(p-1) we can only guarantee error < 10ulp.)

    We assume that: x is positive and not equal to 1, and y is nonzero.
    r.r&r�)rkrermrdr�rT)r'r(r*r+r%rsZlxcr�Zpcr�rWr)r)r+r1Hs
r1r!�F�5�(�r]�r�r~)	r��2�3�4�5�6�7�8rDcCs0|dkrtd��t|�}dt|�||dS)z@Compute a lower bound for 100*log10(c) for a positive integer c.r&z0The argument to _log10_lb should be nonnegative.r!)rqrerk)rFZ
correctionZstr_cr)r)r+r$rsr$cCsLt|t�r|St|t�r t|�S|r8t|t�r8t�|�S|rHtd|��tS)z�Convert other to Decimal.

    Verifies that it's ok to use in an implicit construction.
    If allow_float is true, allow conversion from float;  this
    is used in the comparison methods (__eq__ and friends).

    r�)rdrrVrurvrwr�)r�r�Zallow_floatr)r)r+r�}s


r�cCs�t|t�r||fSt|tj�rR|jsDt|jtt|j	�|j
�|j�}|t|j�fS|rrt|tj
�rr|jdkrr|j}t|t�r�t�}|r�d|jt<n|�td�|t�|�fSttfS)z�Given a Decimal instance self and a Python object other, return
    a pair (s, o) of Decimal instances such that "s op o" is
    equivalent to "self op other" for any of the 6 comparison
    operators "op".

    r&r.ra)rdr�_numbersZRationalrQr:r;rerVr<�denominatorrP�	numeratorZComplexr�r�rurr4rrirvr�)r0r�r�r1r)r)r+r��s(
�
�r�r i?Bi���)rFrEr3r4rGr<r�r�r_)rFrEr3r4a�        # A numeric string consists of:
#    \s*
    (?P<sign>[-+])?              # an optional sign, followed by either...
    (
        (?=\d|\.\d)              # ...a number (with at least one digit)
        (?P<int>\d*)             # having a (possibly empty) integer part
        (\.(?P<frac>\d*))?       # followed by an optional fractional part
        (E(?P<exp>[-+]?\d+))?    # followed by an optional exponent, or...
    |
        Inf(inity)?              # ...an infinity, or...
    |
        (?P<signal>s)?           # ...an (optionally signaling)
        NaN                      # NaN
        (?P<diag>\d*)            # with (possibly empty) diagnostic info.
    )
#    \s*
    \Z
z0*$z50*$z�\A
(?:
   (?P<fill>.)?
   (?P<align>[<>=^])
)?
(?P<sign>[-+ ])?
(?P<alt>\#)?
(?P<zeropad>0)?
(?P<minimumwidth>(?!0)\d+)?
(?P<thousands_sep>,)?
(?:\.(?P<precision>0|(?!0)\d+))?
(?P<type>[eEfFgGn%])?
\Z
cCs�t�|�}|dkrtd|��|��}|d}|d}|ddk	|d<|drv|dk	rbtd|��|dk	rvtd|��|p|d|d<|p�d	|d<|d
dkr�d|d
<t|dp�d
�|d<|ddk	r�t|d�|d<|ddkr�|ddks�|ddkr�d|d<|ddk�rfd|d<|dk�r&t��}|ddk	�r@td|��|d|d<|d|d<|d|d<n*|ddk�r|d|d<ddg|d<d|d<|S)a�Parse and validate a format specifier.

    Turns a standard numeric format specifier into a dict, with the
    following entries:

      fill: fill character to pad field to minimum width
      align: alignment type, either '<', '>', '=' or '^'
      sign: either '+', '-' or ' '
      minimumwidth: nonnegative integer giving minimum width
      zeropad: boolean, indicating whether to pad with zeros
      thousands_sep: string to use as thousands separator, or ''
      grouping: grouping for thousands separators, in format
        used by localeconv
      decimal_point: string to use for decimal point
      precision: nonnegative integer giving precision, or None
      type: one of the characters 'eEfFgG%', or None

    NzInvalid format specifier: �fill�align�zeropadz7Fill character conflicts with '0' in format specifier: z2Alignment conflicts with '0' in format specifier: � �>rCrU�minimumwidthrRr�r&r�ZgGnr.r9r��
thousands_sepzJExplicit thousands separator conflicts with 'n' type in format specifier: �grouping�
decimal_pointrTr\r�)�_parse_format_specifier_regex�matchrq�	groupdictrV�_locale�
localeconv)�format_specr�rzZformat_dictrrr)r)r+r�sT
��
�r�c	Cs�|d}|d}||t|�t|�}|d}|dkrF|||}nj|dkr\|||}nT|dkrr|||}n>|dkr�t|�d}|d	|�||||d	�}ntd
��|S)z�Given an unpadded, non-aligned numeric string 'body' and sign
    string 'sign', add padding and alignment conforming to the given
    format specifier dictionary 'spec' (as produced by
    parse_format_specifier).

    r	rr�<r�=�^r^NzUnrecognised alignment field)rkrq)	rCr�r�r	rZpaddingrr�Zhalfr)r)r+r�ms"r�cCspddlm}m}|sgS|ddkrJt|�dkrJ||dd�||d��S|dtjkrd|dd�Std��dS)zyConvert a localeconv-style grouping into a (possibly infinite)
    iterable of integers representing group lengths.

    r&)�chain�repeatr�r^Nr�z unrecognised format for grouping)�	itertoolsrrrkr�CHAR_MAXrq)rrrr)r)r+�_group_lengths�s
rcCs�|d}|d}g}t|�D]�}|dkr0td��ttt|�|d�|�}|�d|t|�||d��|d|�}||8}|s�|dkr�q�|t|�8}qtt|�|d�}|�d|t|�||d��|�t|��S)anInsert thousands separators into a digit string.

    spec is a dictionary whose keys should include 'thousands_sep' and
    'grouping'; typically it's the result of parsing the format
    specifier using _parse_format_specifier.

    The min_width keyword argument gives the minimum length of the
    result, which will be padded on the left with zeros if necessary.

    If necessary, the zero padding adds an extra '0' on the left to
    avoid a leading thousands separator.  For example, inserting
    commas every three digits in '123456', with min_width=8, gives
    '0,123,456', even though that has length 9.

    r
rr&zgroup length should be positiver.rRN)rrqr�r�rkrrrs�reversed)r}r��	min_width�sepr�groupsrGr)r)r+�_insert_thousands_sep�s $$rcCs$|rdS|ddkr|dSdSdS)zDetermine sign character.rUrCz +rTNr))�is_negativer�r)r)r+r��s
r�cCs�t||�}|s|dr"|d|}|dks6|ddkr\ddddd�|d}|d	�||�7}|dd
krp|d
7}|dr�|dt|�t|�}nd}t|||�}t||||�S)
acFormat a number, given the following data:

    is_negative: true if the number is negative, else false
    intpart: string of digits that must appear before the decimal point
    fracpart: string of digits that must come after the point
    exp: exponent, as an integer
    spec: dictionary resulting from parsing the format specifier

    This function uses the information in spec to:
      insert separators (decimal separator and thousands separators)
      format the sign
      format the exponent
      add trailing '%' for the '%' type
      zero-pad if necessary
      fill and align if necessary
    Zaltrr&r�r�r�r�)r�r�r�r�z{0}{1:+}r�rr	)r��formatrkrr�)r r{r|rWr�rCZecharrr)r)r+r��s
r�ZInfz-Infr�r�r^)N)F)r&)r)r)FF)F)N)r.)zr7�__all__r4Z	__xname__�__version__Z__libmpdec_version__ZmathrZnumbersr�sys�collectionsr'Z_namedtupler�ImportErrorrrrrrrrrr$r%�maxsizer r!r"r#�ArithmeticErrorrrr	r�ZeroDivisionErrorr
rrrrrr
rrrwrr2r�r�ZcontextvarsZ
ContextVarrHrrrrbrr:�Number�registerrOrrnr�rVr�r"r#r�r�r�r�rhrdr�r�r�r�rTr1r$r�r�rrr�re�compile�VERBOSE�
IGNORECASErrfr�r�DOTALLr
Zlocalerr�r�rrr�r�rcrbr>rPr/rOrA�	hash_info�modulusr�r�r�r�r�r�r�r)r)r)r+�<module>s�e�#

&
���

.
^

0",#
%$+�

*���
�
�
P
%
)__pycache__/typing.cpython-38.opt-1.pyc000064400000171645151153537570013707 0ustar00U

e5db
�G@s�dZddlmZmZddlZddlZddlZddlZddlZddl	Z
ddlZddlZddlm
Z
mZmZddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKgGZd�dMdN�ZdOdP�ZdQdR�ZdSdT�ZdUdV�ZdWdX�ZgZdYdZ�Zd[d\�ZGd]d^�d^�ZGd_d`�d`�ZGdadb�dbeedLdc�Zedddde�ZedGdfde�Zeddgde�Zeddhde�Z eddide�Z!eddjde�Z"eddkde�Z#Gdld	�d	edLdc�Z$Gdmd�deedLdc�Z%d7dd5d9d:d4d6dddn�	Z&dodp�Z'Gdqdr�dredLdc�Z(Gdsdt�dte(dLdc�Z)Gdud
�d
�Z*Gdvdw�dw�Z+Gdxdy�dy�Z,dzd{d|d}d~gZ-dd�d�d�d�d�d�d�d�d�g
Z.e-e.d�gZ/d�d��Z0d�d��Z1d�d��Z2d�d��Z3dd#ddd%dd!dd'd*g
d�d�gd��Z4Gd�d��d�e�Z5Gd�d
�d
e*e5d��Z6d�dI�Z7d�d?�Z8d�d��Z9ej:ej;ej<ej=e
eefZ>d�d�dC�Z?d�dB�Z@d�dA�ZAd�dE�ZBd�dF�ZCd�d��ZDd�dH�ZEd�d@�ZFe%d��ZGe%d��ZHe%d��ZIe%d�dLd��ZJe%d�dLd��ZKe%d�dLd��ZLe%d�dLd��ZMe%d�dLeNd��ZOe%d>ePeQ�ZRd�d�d��ZSeSejjTd��ZTeSejjUeJ�ZUeSejjVeJeMeKf�ZVeSejjWeJ�ZWeSejjXeJ�ZXeSejjYeJ�ZYeSejjZeJ�ZZeSejj[eJ�Z[eSejj\d��Z\eSejj]eJ�Z]eSejj^eJ�Z^e)ejj_d�dLd��Z_d�e__eSejj`eJ�ZaeSejjbeG�ZbeSejjceHeLf�ZceSejjdeHeIf�ZdeSejjeeJ�ZeeSejjfeG�ZfeSejjgd��Zge)ehd�d�dLd��Zid�ei_eSejeGd�d��ZkeSejleG�ZmeSeneGd�d��Z`eSeoeJd�d��ZpeSejjqeJ�ZqeSejjreH�ZreSejjseHeLf�ZseSejjteL�ZteSejueJ�ZveSejweJ�ZxeSeyeHeIfd�d��ZzeSej{eHeIf�Z|eSej}eHeIf�Z}eSej~eG�Z~eSejeHeIf�ZeSejj�eJeMeKf�Z�eSejj�eJeMf�Z�eSeNeOd�d��Z�d�e�_e7Gd�d0�d0e6��Z�e7Gd�d.�d.e6��Z�e7Gd�d-�d-e6��Z�e7Gd�d,�d,e6��Z�e7Gd�d/�d/e6��Z�e7Gd�d+�d+e6eJ��Z�e7Gd�d1�d1e6eJ��Z�d�dÄZ�d�Z�d�Z�Gd�dDŽd�eN�Z�Gd�d;�d;e�d��Z�d�dʄZ�d�dLd˜d�d̈́Z�d�dτZ�Gd�dфd�eN�Z�Gd�d<�d<eye�d��Z�d�dD�Z�eQZ�d�Z�Gd�dՄd�e*eR�Z�Gd�dׄd�e�eP�Z�Gd�dلd�e�eQ�Z�Gd�dۄdۃZ�e�d�e�_�e�ej�e�j�<eSe
j�eR�Z�eSe
j�eR�Z�Gd�dބdރZ	e�d�e	_�e	ej�e	j�<dS)�a=
The typing module: Support for gradual typing as defined by PEP 484.

At large scale, the structure of the module is following:
* Imports and exports, all public names should be explicitly added to __all__.
* Internal helper functions: these should never be used in code outside this module.
* _SpecialForm and its instances (special forms): Any, NoReturn, ClassVar, Union, Optional
* Two classes whose instances can be type arguments in addition to types: ForwardRef and TypeVar
* The core of internal generics API: _GenericAlias and _VariadicGenericAlias, the latter is
  currently only used by Tuple and Callable. All subscripted types like X[int], Union[int, str],
  etc., are instances of either of these classes.
* The public counterpart of the generics API consists of two classes: Generic and Protocol.
* Public helper functions: get_type_hints, overload, cast, no_type_check,
  no_type_check_decorator.
* Generic aliases for collections.abc ABCs and few additional protocols.
* Special types: NewType, NamedTuple, TypedDict.
* Wrapper submodules for re and io related types.
�)�abstractmethod�ABCMetaN)�WrapperDescriptorType�MethodWrapperType�MethodDescriptorType�Any�Callable�ClassVar�Final�
ForwardRef�Generic�Literal�Optional�Protocol�Tuple�Type�TypeVar�Union�AbstractSet�
ByteString�	Container�ContextManager�Hashable�	ItemsView�Iterable�Iterator�KeysView�Mapping�MappingView�MutableMapping�MutableSequence�
MutableSet�Sequence�Sized�
ValuesView�	Awaitable�
AsyncIterator�
AsyncIterable�	Coroutine�
Collection�AsyncGenerator�AsyncContextManager�
Reversible�SupportsAbs�
SupportsBytes�SupportsComplex�
SupportsFloat�
SupportsIndex�SupportsInt�
SupportsRound�ChainMap�Counter�Deque�Dict�DefaultDict�List�OrderedDict�Set�	FrozenSet�
NamedTuple�	TypedDict�	Generator�AnyStr�cast�final�get_args�
get_origin�get_type_hints�NewType�
no_type_check�no_type_check_decorator�NoReturn�overload�runtime_checkable�Text�
TYPE_CHECKINGTcCs�ttf}|r|ttf}|dkr(td�St|t�r:t|�St|t�r\|j	|kr\t
|�d���t|t�rr|tt
fks~|ttfkr�t
d|�d���t|tttf�r�|St|�s�t
|�d|d�d���|S)a�Check that the argument is a type, and return it (internal helper).

    As a special case, accept None and return type(None) instead. Also wrap strings
    into ForwardRef instances. Consider several corner cases, for example plain
    special forms like Union are not valid, while Union[int, str] is OK, etc.
    The msg argument is a human-readable error message, e.g::

        "Union[arg, ...]: arg should be a type."

    We append the repr() of the actual value (truncated to 100 chars).
    Nz is not valid as type argumentzPlain z Got z.100�.)rrr	r
�type�
isinstance�strr�
_GenericAlias�
__origin__�	TypeError�_SpecialFormrrIr�callable)�arg�msg�is_argumentZinvalid_generic_forms�rZ�/usr/lib64/python3.8/typing.py�_type_checkxs(

�
�r\cCsRt|t�r,|jdkr|jS|j�d|j��S|dkr8dSt|tj�rJ|jSt|�S)a;Return the repr() of an object, special-casing types (internal helper).

    If obj is a type, we return a shorter version than the default
    type.__repr__, based on the module and qualified name, which is
    typically enough to uniquely identify a type.  For everything
    else, we fall back on repr(obj).
    �builtinsrN.z...)rPrO�
__module__�__qualname__�types�FunctionType�__name__�repr)�objrZrZr[�
_type_repr�s

recs\g�|D]J}t|t�r(|�kr(��|�t|t�r|js���fdd�|jD��qt��S)z�Collect all type variable contained in types in order of
    first appearance (lexicographic order). For example::

        _collect_type_vars((T, List[S, T])) == (T, S)
    csg|]}|�kr|�qSrZrZ��.0�t��tvarsrZr[�
<listcomp>�sz&_collect_type_vars.<locals>.<listcomp>)rPr�appendrR�_special�extend�__parameters__�tuple)r`rhrZrir[�_collect_type_vars�s
rqcCs�t|t�s|St|j�}t|j�D]J\}}t|t�r\t|�D]\}}||kr<||||<q<q"t|||�||<q"|jtkr�tt	|�S|�
t	|��S)zjSubstitute type variables 'tvars' with substitutions 'subs'.
    These two must have the same length.
    )rPrR�list�__args__�	enumerater�_subs_tvarsrSrrp�	copy_with)�tprjZsubsZnew_args�arW�iZtvarrZrZr[ru�s



ruc	Cs^|jst|�d���t|�}t|j�}||krZtd||kr>dnd�d|�d|�d|����dS)	z�Check correct count for parameters of a generic cls (internal helper).
    This gives a nice error message in case of count mismatch.
    z is not a generic classzToo ZmanyZfewz parameters for z	; actual z, expected N)rorT�len)�cls�
parametersZalenZelenrZrZr[�_check_generic�s
r}cCs�g}|D]f}t|t�r.|jtkr.|�|j�qt|t�rdt|�dkrd|dtkrd|�|dd��q|�|�qt	|�}t|�t|�kr�g}|D] }||kr�|�|�|�
|�q�|}t|�S)zyAn internal helper for Union creation and substitution: flatten Unions
    among parameters, then remove duplicates.
    r�N)rPrRrSrrnrsrprzrl�set�remove)r|�params�pZ
all_paramsZ
new_paramsrhrZrZr[�_remove_dups_flatten�s "
r�cs4t�����t��j�t�����fdd��}|S)zInternal wrapper caching __getitem__ of generic types with a fallback to
    original function for non-hashable arguments.
    cs,z�||�WStk
r YnX�||�S�N�rT��args�kwds��cached�funcrZr[�inner�s
z_tp_cache.<locals>.inner)�	functools�	lru_cache�	_cleanupsrl�cache_clear�wraps)r�r�rZr�r[�	_tp_cache�s
r�csbt|t�r|����St|t�r^t��fdd�|jD��}||jkrH|S|�|�}|j|_|S|S)z�Evaluate all forward references in the given type t.
    For use of globalns and localns see the docstring for get_type_hints().
    c3s|]}t|���VqdSr�)�
_eval_type�rgrx��globalns�localnsrZr[�	<genexpr>sz_eval_type.<locals>.<genexpr>)rPr�	_evaluaterRrprsrvrm)rhr�r�Zev_args�resrZr�r[r�	s



r�c@seZdZdZdZdd�ZdS)�_FinalzMixin to prohibit subclassing)�__weakref__cOsd|krtd��dS)N�_rootz&Cannot subclass special typing classesr���selfr�r�rZrZr[�__init_subclass__sz_Final.__init_subclass__N)rbr^r_�__doc__�	__slots__r�rZrZrZr[r�sr�c@s eZdZdZdd�Zdd�ZdS)�
_Immutablez3Mixin to indicate that object should not be copied.cCs|Sr�rZ�r�rZrZr[�__copy__%sz_Immutable.__copy__cCs|Sr�rZ)r�ZmemorZrZr[�__deepcopy__(sz_Immutable.__deepcopy__N)rbr^r_r�r�r�rZrZrZr[r�"sr�cspeZdZdZdZ�fdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
edd��Z�ZS)rUzhInternal indicator of special typing constructs.
    See _doc instance attribute for specific docs.
    ��_nameZ_doccsBt|�dkr6t|dt�r6t|dt�r6td|����t��|�S)z�Constructor.

        This only exists to give a better error message in case
        someone tries to subclass a special typing object (not a good idea).
        �rr~zCannot subclass )rzrPrQrprT�super�__new__)r{r�r���	__class__rZr[r�3s��z_SpecialForm.__new__cCs||_||_dSr�r�)r��name�docrZrZr[�__init__@sz_SpecialForm.__init__cCst|t�stS|j|jkSr�)rPrU�NotImplementedr��r��otherrZrZr[�__eq__Ds
z_SpecialForm.__eq__cCst|jf�Sr�)�hashr�r�rZrZr[�__hash__Isz_SpecialForm.__hash__cCs
d|jS)N�typing.�r�r�rZrZr[�__repr__Lsz_SpecialForm.__repr__cCs|jSr�r�r�rZrZr[�
__reduce__Osz_SpecialForm.__reduce__cOstd|����dS)NzCannot instantiate r�r�rZrZr[�__call__Rsz_SpecialForm.__call__cCst|�d���dS)Nz! cannot be used with isinstance()r��r�rdrZrZr[�__instancecheck__Usz_SpecialForm.__instancecheck__cCst|�d���dS)Nz! cannot be used with issubclass()r��r�r{rZrZr[�__subclasscheck__Xsz_SpecialForm.__subclasscheck__cs�|jdkr(t||j�d��}t||f�S|jdkr�|dkrBtd��t|t�sR|f}d�t�fdd�|D��}t|�}t|�d	kr�|d
St||�S|jdkr�t|d�}t|t	d�fS|jd
kr�t||�St|�d���dS)N)r	r
z accepts only single type.rrZz Cannot take a Union of no types.z)Union[arg, ...]: each arg must be a type.c3s|]}t|��VqdSr��r\�rgr��rXrZr[r�fsz+_SpecialForm.__getitem__.<locals>.<genexpr>r~rrz#Optional[t] requires a single type.r
z is not subscriptable)
r�r\rRrTrPrpr�rzrrO)r�r|�itemrWrZr�r[�__getitem__[s(







z_SpecialForm.__getitem__)rbr^r_r�r�r�r�r�r�r�r�r�r�r�r�r��
__classcell__rZrZr�r[rU,s
rU)r�a`Special type indicating an unconstrained type.

    - Any is compatible with every type.
    - Any assumed to have all methods.
    - All values assumed to be instances of Any.

    Note that all the above statements are true from the point of view of
    static type checkers. At runtime, Any should not be used with instance
    or class checks.
    )r�aSpecial type indicating functions that never return.
    Example::

      from typing import NoReturn

      def stop() -> NoReturn:
          raise Exception('no way')

    This type is invalid in other positions, e.g., ``List[NoReturn]``
    will fail in static type checkers.
    a3Special type construct to mark class variables.

    An annotation wrapped in ClassVar indicates that a given
    attribute is intended to be used as a class variable and
    should not be set on instances of that class. Usage::

      class Starship:
          stats: ClassVar[Dict[str, int]] = {} # class variable
          damage: int = 10                     # instance variable

    ClassVar accepts only types and cannot be further subscribed.

    Note that ClassVar is not a class itself, and should not
    be used with isinstance() or issubclass().
    a�Special typing construct to indicate final names to type checkers.

    A final name cannot be re-assigned or overridden in a subclass.
    For example:

      MAX_SIZE: Final = 9000
      MAX_SIZE += 1  # Error reported by type checker

      class Connection:
          TIMEOUT: Final[int] = 10

      class FastConnector(Connection):
          TIMEOUT = 1  # Error reported by type checker

    There is no runtime checking of these properties.
    a'Union type; Union[X, Y] means either X or Y.

    To define a union, use e.g. Union[int, str].  Details:
    - The arguments must be types and there must be at least one.
    - None as an argument is a special case and is replaced by
      type(None).
    - Unions of unions are flattened, e.g.::

        Union[Union[int, str], float] == Union[int, str, float]

    - Unions of a single argument vanish, e.g.::

        Union[int] == int  # The constructor actually returns int

    - Redundant arguments are skipped, e.g.::

        Union[int, str, int] == Union[int, str]

    - When comparing unions, the argument order is ignored, e.g.::

        Union[int, str] == Union[str, int]

    - You cannot subclass or instantiate a union.
    - You can use Optional[X] as a shorthand for Union[X, None].
    zEOptional type.

    Optional[X] is equivalent to Union[X, None].
    a�Special typing form to define literal types (a.k.a. value types).

    This form can be used to indicate to type checkers that the corresponding
    variable or function parameter has a value equivalent to the provided
    literal (or one of several literals):

      def validate_simple(data: Any) -> Literal[True]:  # always returns True
          ...

      MODE = Literal['r', 'rb', 'w', 'wb']
      def open_helper(file: str, mode: MODE) -> str:
          ...

      open_helper('/some/path', 'r')  # Passes type check
      open_helper('/other/path', 'typo')  # Error in type checker

   Literal[...] cannot be subclassed. At runtime, an arbitrary value
   is allowed as type argument to Literal[...], but type checkers may
   impose restrictions.
    c@s>eZdZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)rz-Internal wrapper to hold a forward reference.)�__forward_arg__�__forward_code__�__forward_evaluated__�__forward_value__�__forward_is_argument__TcCsnt|t�std|����zt|dd�}Wn"tk
rJtd|����YnX||_||_d|_d|_||_	dS)Nz*Forward reference must be a string -- got z<string>�evalz/Forward reference must be an expression -- got F)
rPrQrT�compile�SyntaxErrorr�r�r�r�r�)r�rWrY�coderZrZr[r��s
zForwardRef.__init__cCsj|jr||k	rd|dkr(|dkr(i}}n|dkr6|}n|dkrB|}tt|j||�d|jd�|_d|_|jS)Nz*Forward references must evaluate to types.�rYT)r�r\r�r�r�r�)r�r�r�rZrZr[r��s
�zForwardRef._evaluatecCs>t|t�stS|jr2|jr2|j|jko0|j|jkS|j|jkSr�)rPrr�r�r�r�r�rZrZr[r�s

�zForwardRef.__eq__cCs
t|j�Sr�)r�r�r�rZrZr[r�szForwardRef.__hash__cCsd|j�d�S)NzForwardRef(�))r�r�rZrZr[r�szForwardRef.__repr__N)T)
rbr^r_r�r�r�r�r�r�r�rZrZrZr[r�s

c@s6eZdZdZdZdddd�dd�Zdd	�Zd
d�ZdS)ra�Type variable.

    Usage::

      T = TypeVar('T')  # Can be anything
      A = TypeVar('A', str, bytes)  # Must be str or bytes

    Type variables exist primarily for the benefit of static type
    checkers.  They serve as the parameters for generic types as well
    as for generic function definitions.  See class Generic for more
    information on generic types.  Generic functions work as follows:

      def repeat(x: T, n: int) -> List[T]:
          '''Return a list containing n references to x.'''
          return [x]*n

      def longest(x: A, y: A) -> A:
          '''Return the longest of two strings.'''
          return x if len(x) >= len(y) else y

    The latter example's signature is essentially the overloading
    of (str, str) -> str and (bytes, bytes) -> bytes.  Also note
    that if the arguments are instances of some subclass of str,
    the return type is still plain str.

    At runtime, isinstance(x, T) and issubclass(C, T) will raise TypeError.

    Type variables defined with covariant=True or contravariant=True
    can be used to declare covariant or contravariant generic types.
    See PEP 484 for more details. By default generic types are invariant
    in all type variables.

    Type variables can be introspected. e.g.:

      T.__name__ == 'T'
      T.__constraints__ == ()
      T.__covariant__ == False
      T.__contravariant__ = False
      A.__constraints__ == (str, bytes)

    Note that only type variables defined in global scope can be pickled.
    )rb�	__bound__�__constraints__�
__covariant__�__contravariant__NF)�bound�	covariant�
contravariantc	s�||_|r|rtd��t|�|_t|�|_|r>|dk	r>td��|rVt|�dkrVtd��d�t�fdd�|D��|_|r�t	|d�|_
nd|_
zt�d�j
�d	d
�}Wnttfk
r�d}YnX|dkr�||_dS)Nz"Bivariant types are not supported.z-Constraints cannot be combined with bound=...r~z"A single constraint is not allowedz:TypeVar(name, constraint, ...): constraints must be types.c3s|]}t|��VqdSr�r�rfr�rZr[r�Vsz#TypeVar.__init__.<locals>.<genexpr>zBound must be a type.rb�__main__�typing)rb�
ValueError�boolr�r�rTrzrpr�r\r��sys�	_getframe�	f_globals�get�AttributeErrorr^)r�r�r�r�r�ZconstraintsZdef_modrZr�r[r�Js(


zTypeVar.__init__cCs&|jrd}n|jrd}nd}||jS)N�+�-�~)r�r�rb)r��prefixrZrZr[r�bszTypeVar.__repr__cCs|jSr�)rbr�rZrZr[r�kszTypeVar.__reduce__)rbr^r_r�r�r�r�r�rZrZrZr[rs+�	)	rrrp�dictr�	frozenset�deque�defaultdictrOr;cCs|�d�o|�d�S)N�__)�
startswith�endswith)�attrrZrZr[�
_is_dunder�sr�cs�eZdZdZdddd�dd�Zedd	��Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
�fdd�Zdd�Zdd�Zdd�Z�ZS) rRa�The central part of internal API.

    This represents a generic version of type 'origin' with type arguments 'params'.
    There are two kind of these aliases: user defined and special. The special ones
    are wrappers around builtin collections and ABCs in collections.abc. These must
    have 'name' always set. If 'inst' is False, then the alias can't be instantiated,
    this is used by e.g. typing.List and typing.Dict.
    TFN)�inst�specialr�cCsz||_||_|r*|dkr*|j}t�||�}||_t|t�s@|f}||_tdd�|D��|_	t
|�|_d|_|sv|j
|_
dS)Ncss*|]"}|tkrdn|tkrdn|VqdS).rZN)�_TypingEllipsis�_TypingEmptyr�rZrZr[r��s�z)_GenericAlias.__init__.<locals>.<genexpr>)�_instrmrb�_normalize_aliasr�r�rPrprSrsrqror�r^)r��originr�r�r�r�Z	orig_namerZrZr[r��s 
�

z_GenericAlias.__init__cs^|jttfkrtd|����t|t�s,|f}d�t�fdd�|D��}t||�t||j|�S)Nz%Cannot subscript already-subscripted �*Parameters to generic types must be types.c3s|]}t|��VqdSr�r�r�r�rZr[r��sz,_GenericAlias.__getitem__.<locals>.<genexpr>)	rSrrrTrPrpr}ruro�r�r�rZr�r[r��s

z_GenericAlias.__getitem__cCst|j||j|jd�S)N)r�r�)rRrSr�r�r�rZrZr[rv�sz_GenericAlias.copy_withcCs�|jdks&t|j�dkrx|jdtkrx|jr8d|j}n
t|j�}|jshdd�dd�|jD���d	�}nd
}|�|��S|jr�dSdd�d
d�|jdd�D���dt|jd��d	�S)Nr�rr��[�, cSsg|]}t|��qSrZ�rer�rZrZr[rk�sz*_GenericAlias.__repr__.<locals>.<listcomp>�]�ztyping.Callableztyping.Callable[[cSsg|]}t|��qSrZr�r�rZrZr[rk�s���z], )r�rzrs�EllipsisrerSrm�join)r�r�r�rZrZr[r��s
��
 z_GenericAlias.__repr__cCsRt|t�stS|j|jkrdS|jtkrF|jtkrFt|j�t|j�kS|j|jkS)NF)rPrRr�rSrr�rsr�rZrZr[r��s
z_GenericAlias.__eq__cCs,|jtkrttt|j�f�St|j|jf�Sr�)rSrr�r�rsr�rZrZr[r��s
z_GenericAlias.__hash__cOsT|js$td|j�d|j���d���|j||�}z
||_Wntk
rNYnX|S)N�Type z cannot be instantiated; use z
() instead)r�rTr��lowerrS�__orig_class__r�)r�r��kwargs�resultrZrZr[r��s
z_GenericAlias.__call__cCs�|jrZg}|j|kr |�|j�|�|�}tdd�||dd�D��sR|�t�t|�S|jtkr�t|krpdS|�|�}||dd�D]}t|t	�r�||k	r�dSq�|jfS)Ncss"|]}t|t�pt|t�VqdSr�)rPrR�
issubclassr�rg�brZrZr[r��s�z0_GenericAlias.__mro_entries__.<locals>.<genexpr>r~rZ)
r�rSrl�index�anyrrprrPrR)r��basesr�ryrrZrZr[�__mro_entries__�s$

�


z_GenericAlias.__mro_entries__cCs*d|jkrt|�st|j|�St|��dS)NrS)�__dict__r��getattrrSr�)r�r�rZrZr[�__getattr__�sz_GenericAlias.__getattr__cs2t|�s|dkr t��||�nt|j||�dS)N)r�r�rm)r�r��__setattr__�setattrrS)r�r��valr�rZr[r�sz_GenericAlias.__setattr__cCs|�t|��Sr�)r�rOr�rZrZr[r�sz_GenericAlias.__instancecheck__cCs<|jr0t|t�st||j�S|jr0t|j|j�Std��dS)NzBSubscripted generics cannot be used with class and instance checks)rmrPrRrrSrTr�rZrZr[r�s
z_GenericAlias.__subclasscheck__cCs�|jr|jS|jr t�|j}n|j}|tkrht|j�dkrJ|jdtksht|jdd��|jdf}n*t	|j�}t|�dkr�t
|dt	�s�|\}tj||ffS)Nr�rr�r~)
rmr��globalsrSrrzrsr�rrrprP�operator�getitem)r�r�r�rZrZr[r�s��
z_GenericAlias.__reduce__)rbr^r_r�r�r�r�rvr�r�r�r�rrrr�r�r�r�rZrZr�r[rR�s
		rRcs,eZdZdZdd�Ze�fdd��Z�ZS)�_VariadicGenericAliasz�Same as _GenericAlias above but for variadic aliases. Currently,
    this is used only by special internal aliases: Tuple and Callable.
    cCs�|jdks|js|�|�St|t�r0t|�dkr8td��|\}}|tkrRt|f}n$t|t�sjtd|����t|�|f}|�|�S)Nrr�z6Callable must be used as Callable[[arg, ...], result].z1Callable[args, result]: args must be a list. Got )	r�rm�__getitem_inner__rPrprzrTr�rr)r�r�r�rrZrZr[r�"s


z!_VariadicGenericAlias.__getitem__cs
|jtkr�|jr�|dkr$|�tf�St|t�s4|f}t|�dkrl|ddkrld�t|d��}|�|tf�Sd�t�fdd	�|D��}|�|�S|jt	j
jkr�|jr�|\}}d
�t|��}|tkr�|�t|f�Sd�t�fdd	�|D��}||f}|�|�St
��|�S)
NrZr�r~.z Tuple[t, ...]: t must be a type.rz*Tuple[t0, t1, ...]: each t must be a type.c3s|]}t|��VqdSr�r�r�r�rZr[r�>sz:_VariadicGenericAlias.__getitem_inner__.<locals>.<genexpr>z.Callable[args, result]: result must be a type.z6Callable[[arg, ...], result]: each arg must be a type.c3s|]}t|��VqdSr�r�)rgrWr�rZr[r�Gs)rSrprmrvr�rPrzr\r��collections�abcrr�r�r�)r�r�r�r�rr�r�r[r2s.




z'_VariadicGenericAlias.__getitem_inner__)rbr^r_r�r�r�rr�rZrZr�r[rsrcs@eZdZdZdZdZ�fdd�Zedd��Z�fdd	�Z	�Z
S)
raCAbstract base class for generic types.

    A generic type is typically declared by inheriting from
    this class parameterized with one or more type variables.
    For example, a generic mapping type might be defined as::

      class Mapping(Generic[KT, VT]):
          def __getitem__(self, key: KT) -> VT:
              ...
          # Etc.

    This class can then be used as follows::

      def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
          try:
              return mapping[key]
          except KeyError:
              return default
    rZFcs^|ttfkrtd|j�d���t�jtjkrF|jtjk	rFt��|�}nt�j|f|�|�}|S)Nrz< cannot be instantiated; it can be used only as a base class)rrrTrbr�r��objectr�)r{r�r�rdr�rZr[r�dszGeneric.__new__cs�t|t�s|f}|s.|tk	r.td|j�d���d�t�fdd�|D��}|ttfkr�tdd�|D��sxtd|j�d���t	t
|��t	|�kr�td|j�d	���n
t||�t||�S)
NzParameter list to z[...] cannot be emptyr�c3s|]}t|��VqdSr�r�r�r�rZr[r�vsz,Generic.__class_getitem__.<locals>.<genexpr>css|]}t|t�VqdSr�)rPrr�rZrZr[r�yszParameters to z [...] must all be type variablesz[...] must all be unique)
rPrprrTr_rr�allrbrzrr}rR)r{r�rZr�r[�__class_getitem__ns&
���
zGeneric.__class_getitem__c
s
t�j||�g}d|jkr(t|jk}nt|jko:|jdk}|rHtd��d|jkr�t|j�}d}|jD].}t	|t
�rf|jtkrf|dk	r�td��|j}qf|dk	r�t
|�}t
|��|�ks�d��fdd�|D��}d�dd�|D��}	td	|�d
|	�d���|}t|�|_dS)N�__orig_bases__rz!Cannot inherit from plain Genericz0Cannot inherit from Generic[...] multiple types.r�c3s|]}|�krt|�VqdSr��rQrf�ZgvarsetrZr[r��sz,Generic.__init_subclass__.<locals>.<genexpr>css|]}t|�VqdSr�r)rg�grZrZr[r��szSome type variables (z) are not listed in Generic[r�)r�r�rrr�	__bases__rbrTrqrPrRrSrorr�rp)
r{r�rrj�errorZgvars�baseZtvarsetZs_varsZs_argsr�rr[r��s8




��zGeneric.__init_subclass__)rbr^r_r�r��_is_protocolr�r�rr�r�rZrZr�r[rMs

c@seZdZdZdS)r�z�Internal placeholder for () or []. Used by TupleMeta and CallableMeta
    to allow empty list/tuple in specific places, without allowing them
    to sneak in where prohibited.
    N�rbr^r_r�rZrZrZr[r��sr�c@seZdZdZdS)r�z(Internal placeholder for ... (ellipsis).Nr$rZrZrZr[r��sr�rorrr#�_is_runtime_protocol�__abstractmethods__�__annotations__rr�r�r^r�r��__subclasshook__r��_MutableMapping__markercCsrt�}|jdd�D]X}|jdkr$qt|di�}t|j���t|���D] }|�d�sJ|tkrJ|�	|�qJq|S)z�Collect protocol members from a protocol class objects.

    This includes names actually defined in the class dictionary, as well
    as names that appear in annotations. Special names (above) are skipped.
    Nr�)rrr'Z_abc_)
r�__mro__rbr
rrr�keysr��EXCLUDED_ATTRIBUTES�add)r{�attrsr"�annotationsr�rZrZr[�_get_protocol_attrs�s
r0cst�fdd�t��D��S)Nc3s|]}tt�|d��VqdSr�)rVr
�rgr��r{rZr[r��sz,_is_callable_members_only.<locals>.<genexpr>)rr0r2rZr2r[�_is_callable_members_only�sr3cOst|�jrtd��dS)Nz Protocols cannot be instantiated)rOr#rT)r�r�rrZrZr[�_no_init�s
r4c	Cs6zt�d�jddkWSttfk
r0YdSXdS)z�Allow instnance and class checks for special stdlib modules.

    The abc and functools modules indiscriminately call isinstance() and
    issubclass() on the whole MRO of a user class, which may contain protocols.
    r�rb)rr�TN)r�r�r�r�r�rZrZrZr[�_allow_reckless_class_cheks�sr5�AbstractContextManager�AbstractAsyncContextManager)zcollections.abc�
contextlibcseZdZ�fdd�Z�ZS)�
_ProtocolMetacsVt�dd�rt��r$t�j��r$dS�jrJt��fdd�t��D��rJdSt����S)Nr#FTc3s8|]0}t�|�o.tt�|d��p.t�|�dk	VqdSr�)�hasattrrVr
r1�r{�instancerZr[r��s�
z2_ProtocolMeta.__instancecheck__.<locals>.<genexpr>)	r
r3rr�r#rr0r�r�r;r�r;r[r��s�
��z_ProtocolMeta.__instancecheck__)rbr^r_r�r�rZrZr�r[r9�sr9cs,eZdZdZdZdZdZ�fdd�Z�ZS)raZBase class for protocol classes.

    Protocol classes are defined as::

        class Proto(Protocol):
            def meth(self) -> int:
                ...

    Such classes are primarily used with static type checkers that recognize
    structural subtyping (static duck-typing), for example::

        class C:
            def meth(self) -> int:
                return 0

        def func(x: Proto) -> int:
            return x.meth()

        func(C())  # Passes static type check

    See PEP 544 for details. Protocol classes decorated with
    @typing.runtime_checkable act as simple-minded runtime protocols that check
    only the presence of given attributes, ignoring their type signatures.
    Protocol classes can be generic, they are defined as::

        class GenProto(Protocol[T]):
            def meth(self) -> T:
                ...
    rZTFcs�t�j||��j�dd�s2tdd��jD���_�fdd�}d�jkrN|�_�jsXdS�jD]F}|tt	fks^|j
tkr�|jt|j
ks^t
|t	�r�|js^td|��q^t�_dS)	Nr#Fcss|]}|tkVqdSr�)rrrZrZr[r�)sz-Protocol.__init_subclass__.<locals>.<genexpr>cs��j�dd�stSt�dd�s0t�r(tStd��t��sJt�rBtStd��t|t�s\td��t	��D]v}|j
D]b}||jkr�|j|dkr�tSqdt|di�}t|tjj
�rn||krnt|t�rn|jrnqdqntSqddS)	Nr#Fr%zLInstance and class checks can only be used with @runtime_checkable protocolsz<Protocols with non-method members don't support issubclass()z"issubclass() arg 1 must be a classr'T)rr�r�r
r5rTr3rPrOr0r*rrrrrr#)r�r�r"r/r2rZr[�_proto_hook,s:


���
z/Protocol.__init_subclass__.<locals>._proto_hookr(z7Protocols can only inherit from other protocols, got %r)r�r�rr�r	r r#r(rrr^�_PROTO_WHITELISTrbrrTr4r�)r{r�rr=r"r�r2r[r�$s,&

�����zProtocol.__init_subclass__)	rbr^r_r�r�r#r%r�r�rZrZr�r[rs
)�	metaclasscCs&t|t�r|jstd|��d|_|S)a9Mark a protocol class as a runtime protocol.

    Such protocol can be used with isinstance() and issubclass().
    Raise TypeError if applied to a non-protocol class.
    This allows a simple-minded structural check very similar to
    one trick ponies in collections.abc such as Iterable.
    For example::

        @runtime_checkable
        class Closable(Protocol):
            def close(self): ...

        assert isinstance(open('/some/file'), Closable)

    Warning: this will check only the presence of the required methods,
    not their type signatures!
    zB@runtime_checkable can be only applied to protocol classes, got %rT)rrr#rTr%r2rZrZr[rKds�cCs|S)z�Cast a value to a type.

    This returns the value unchanged.  To the type checker this
    signals that the return value has the designated type, but at
    runtime we intentionally don't check anything (we want this
    to be as fast as possible).
    rZ)�typrrZrZr[rA}sc
Cs�z
|j}Wntk
r"iYSX|j}|j}|d|�}|jpDd}|j}|rXt|�ni}|t|�}t||d�|�D]\}}	|	||<qz|S)z:Internal helper to extract the default arguments, by name.NrZ)	�__code__r��co_argcount�co_varnames�__defaults__�__kwdefaults__r�rz�zip)
r�r�Z	pos_countZ	arg_names�defaultsZ
kwdefaultsr�Z
pos_offsetr��valuerZrZr[�
_get_defaults�s



rIcCs�t|dd�riSt|t�r�i}t|j�D]z}|dkrDtj|jj}n|}|j�	di�}|�
�D]B\}}|dkrvtd�}t|t�r�t|dd�}t
|||�}|||<q^q(|S|dkr�t|tj�r�|j}n"|}	t|	d�r�|	j}	q�t|	di�}|dkr�|}n|dk�r|}t|dd�}|dk�r6t|t��r(iStd�|���t|�}
t|�}|�
�D]d\}}|dk�rhtd�}t|t��r|t|�}t
|||�}||
k�r�|
|dk�r�t|}|||<�qN|S)	a�Return type hints for an object.

    This is often the same as obj.__annotations__, but it handles
    forward references encoded as string literals, and if necessary
    adds Optional[t] if a default value equal to None is set.

    The argument may be a module, class, method, or function. The annotations
    are returned as a dictionary. For classes, annotations include also
    inherited members.

    TypeError is raised if the argument is not of a type that can contain
    annotations, and an empty dictionary is returned if no annotations are
    present.

    BEWARE -- the behavior of globalns and localns is counterintuitive
    (unless you are familiar with how eval() and exec() work).  The
    search order is locals first, then globals.

    - If no dict arguments are passed, an attempt is made to use the
      globals from obj (or the respective module's globals for classes),
      and these are also used as the locals.  If the object does not appear
      to have globals, an empty dictionary is used.

    - If one dict argument is passed, it is used for both globals and
      locals.

    - If two dict arguments are passed, they specify globals and
      locals, respectively.
    �__no_type_check__Nr'Fr��__wrapped__�__globals__z1{!r} is not a module, class, method, or function.)r
rPrO�reversedr*r��modulesr^rr��itemsrQrr�r`�
ModuleTyper:rK�_allowed_typesrT�formatrIr�r)rdr�r�Zhintsr"Zbase_globals�annr�rHZnsobjrGrZrZr[rE�s^




�
cCs t|t�r|jS|tkrtSdS)a�Get the unsubscripted version of a type.

    This supports generic types, Callable, Tuple, Union, Literal, Final and ClassVar.
    Return None for unsupported types. Examples::

        get_origin(Literal[42]) is Literal
        get_origin(int) is None
        get_origin(ClassVar[int]) is ClassVar
        get_origin(Generic) is Generic
        get_origin(Generic[T]) is Generic
        get_origin(Union[T, int]) is Union
        get_origin(List[Tuple[T, T]][int]) == list
    N)rPrRrSr)rwrZrZr[rD�s

cCsRt|t�rN|jsN|j}t|�tjjkrJ|dtk	rJt	|dd��|df}|SdS)a�Get type arguments with all substitutions performed.

    For unions, basic simplifications used by Union constructor are performed.
    Examples::
        get_args(Dict[str, int]) == (str, int)
        get_args(int) == ()
        get_args(Union[int, Union[T, int], str][int]) == (int, str)
        get_args(Union[int, Tuple[T, int]][str]) == (int, Tuple[str, int])
        get_args(Callable[[], T][int]) == ([], int)
    rNr�rZ)
rPrRrmrsrDrrrr�rr)rwr�rZrZr[rCscCs�t|t�rt|j��}|j��D]"\}}||j|fkr|�|�q|��D](}t|tj	�r`d|_
t|t�rJt|�qJz
d|_
Wntk
r�YnX|S)aIDecorator to indicate that annotations are not type hints.

    The argument must be a class or function; if it is a class, it
    applies recursively to all methods and classes defined in that class
    (but not to methods defined in its superclasses or subclasses).

    This mutates the function(s) or class(es) in place.
    T)
rPrOr�copyrOr �pop�valuesr`rarJrGrT)rWZ	arg_attrsr�rrdrZrZr[rGs	




cst����fdd��}|S)z�Decorator to give another decorator the @no_type_check effect.

    This wraps the decorator with something that wraps the decorated
    function in @no_type_check.
    cs�||�}t|�}|Sr�)rG)r�r�r���	decoratorrZr[�wrapped_decorator@s
z2no_type_check_decorator.<locals>.wrapped_decorator)r�r�)rXrYrZrWr[rH9scOstd��dS)z*Helper for @overload to raise when called.z�You should not call an overloaded function. A series of @overload-decorated functions outside a stub module should always be followed by an implementation that is not @overload-ed.N)�NotImplementedErrorr�rZrZr[�_overload_dummyIs�r[cCstS)a
Decorator for overloaded functions/methods.

    In a stub file, place two or more stub definitions for the same
    function in a row, each decorated with @overload.  For example:

      @overload
      def utf8(value: None) -> None: ...
      @overload
      def utf8(value: bytes) -> bytes: ...
      @overload
      def utf8(value: str) -> bytes: ...

    In a non-stub file (i.e. a regular .py file), do the same but
    follow it with an implementation.  The implementation should *not*
    be decorated with @overload.  For example:

      @overload
      def utf8(value: None) -> None: ...
      @overload
      def utf8(value: bytes) -> bytes: ...
      @overload
      def utf8(value: str) -> bytes: ...
      def utf8(value):
          # implementation goes here
    )r[)r�rZrZr[rJRscCs|S)aVA decorator to indicate final methods and final classes.

    Use this decorator to indicate to type checkers that the decorated
    method cannot be overridden, and decorated class cannot be subclassed.
    For example:

      class Base:
          @final
          def done(self) -> None:
              ...
      class Sub(Base):
          def done(self) -> None:  # Error reported by type checker
                ...

      @final
      class Leaf:
          ...
      class Other(Leaf):  # Error reported by type checker
          ...

    There is no runtime checking of these properties.
    rZ)�frZrZr[rBos�T�KT�VT�T_co)r��V_co�VT_co�T_contra)r��CT_co)r�r�cCst||d|d�S)NT)r�r�)rR)r�r�r�rZrZr[�_alias�srerZ)r�a�Callable type; Callable[[int], str] is a function of (int) -> str.

    The subscription syntax must always be used with exactly two
    values: the argument list and the return type.  The argument list
    must be a list of types or ellipsis; the return type must be a single type.

    There is no syntax to indicate optional or keyword arguments,
    such function types are rarely used as callback types.
    F)r�r�a@Tuple type; Tuple[X, Y] is the cross-product type of X and Y.

    Example: Tuple[T1, T2] is a tuple of two elements corresponding
    to type variables T1 and T2.  Tuple[int, float, str] is a tuple
    of an int, a float and a string.

    To specify a variable-length tuple of homogeneous type, use Tuple[T, ...].
    )r�a�A special construct usable to annotate class objects.

    For example, suppose we have the following classes::

      class User: ...  # Abstract base for User classes
      class BasicUser(User): ...
      class ProUser(User): ...
      class TeamUser(User): ...

    And a function that takes a class argument that's a subclass of
    User and returns an instance of the corresponding class::

      U = TypeVar('U', bound=User)
      def new_user(user_class: Type[U]) -> U:
          user = user_class()
          # (Here we could write the user object to a database)
          return user

      joe = new_user(BasicUser)

    At this point the type checker knows that joe has type BasicUser.
    c@s&eZdZdZdZeed�dd��ZdS)r2z(An ABC with one abstract method __int__.rZ��returncCsdSr�rZr�rZrZr[�__int__�szSupportsInt.__int__N)rbr^r_r�r�r�intrhrZrZrZr[r2�sc@s&eZdZdZdZeed�dd��ZdS)r0z*An ABC with one abstract method __float__.rZrfcCsdSr�rZr�rZrZr[�	__float__szSupportsFloat.__float__N)rbr^r_r�r�r�floatrjrZrZrZr[r0�sc@s&eZdZdZdZeed�dd��ZdS)r/z,An ABC with one abstract method __complex__.rZrfcCsdSr�rZr�rZrZr[�__complex__
szSupportsComplex.__complex__N)rbr^r_r�r�r�complexrlrZrZrZr[r/sc@s&eZdZdZdZeed�dd��ZdS)r.z*An ABC with one abstract method __bytes__.rZrfcCsdSr�rZr�rZrZr[�	__bytes__szSupportsBytes.__bytes__N)rbr^r_r�r�r�bytesrnrZrZrZr[r.sc@s&eZdZdZdZeed�dd��ZdS)r1z*An ABC with one abstract method __index__.rZrfcCsdSr�rZr�rZrZr[�	__index__szSupportsIndex.__index__N)rbr^r_r�r�rrirprZrZrZr[r1sc@s&eZdZdZdZeed�dd��ZdS)r-zMAn ABC with one abstract method __abs__ that is covariant in its return type.rZrfcCsdSr�rZr�rZrZr[�__abs__(szSupportsAbs.__abs__N)rbr^r_r�r�rr`rqrZrZrZr[r-#sc@s*eZdZdZdZedeed�dd��ZdS)	r3zOAn ABC with one abstract method __round__ that is covariant in its return type.rZr)�ndigitsrgcCsdSr�rZ)r�rrrZrZr[�	__round__2szSupportsRound.__round__N)r)	rbr^r_r�r�rrir`rsrZrZrZr[r3-sc	std��fdd�|D�}t�|dd�|D��}t|�|_|_zt�d�j�dd�|_	Wnt
tfk
rnYnX|S)NzDNamedTuple('Name', [(f0, t0), (f1, t1), ...]); each t must be a typecsg|]\}}|t|��f�qSrZr��rg�nrhr�rZr[rk9sz!_make_nmtuple.<locals>.<listcomp>cSsg|]\}}|�qSrZrZrtrZrZr[rk:sr�rbr�)r�
namedtupler�r'�_field_typesr�r�r�r�r^r�r�)r�r`�nm_tplrZr�r[�
_make_nmtuple7sry)r�r�r��__getnewargs__�_fields�_field_defaultsrw�_make�_replace�_asdictZ_source)r^rbr'cseZdZ�fdd�Z�ZS)�NamedTupleMetacs�|�dd�rt��||||�S|�di�}t||���}g}i}|D]H}||krl||}	|�|	�|	||<qD|rDtdj|d�|�	��d���qDt
|�|j_t|�|j_
||_|D]<}
|
tkr�td|
��q�|
tkr�|
|jkr�t||
||
�q�|S)Nr�Fr'zXNon-default namedtuple field {field_name} cannot follow default field(s) {default_names}r�)�
field_nameZ
default_namesz&Cannot overwrite NamedTuple attribute )r�r�r�ryrOrlrTrRr�r+r�r'rprDr|�_prohibitedr�rmr{r)r{�typenamer
�nsr`rxrGZ
defaults_dictr�Z
default_value�keyr�rZr[r�Os2

�
zNamedTupleMeta.__new__)rbr^r_r�r�rZrZr�r[r�Msr�c@s"eZdZdZdZdd�Zde_dS)r=a�Typed version of namedtuple.

    Usage in Python versions >= 3.6::

        class Employee(NamedTuple):
            name: str
            id: int

    This is equivalent to::

        Employee = collections.namedtuple('Employee', ['name', 'id'])

    The resulting class has an extra __annotations__ attribute, giving a
    dict that maps field names to types.  (The field names are also in
    the _fields attribute, which is part of the namedtuple API.)
    Alternative equivalent keyword syntax is also accepted::

        Employee = NamedTuple('Employee', name=str, id=int)

    In Python versions <= 3.5 use::

        Employee = NamedTuple('Employee', [('name', str), ('id', int)])
    TcOs�|std��|^}}|r"|^}}n4d|krN|�d�}ddl}|jdtdd�ntd��|r�z
|\}Wq�tk
r�tdt|�d�d	��d�Yq�Xn<d
|kr�t|�dkr�|�d
�}ddl}|jdtdd�nd}|dkr�|��}n|r�td
��t||�S)Nz*NamedTuple.__new__(): not enough argumentsr�rz4Passing 'typename' as keyword argument is deprecatedr�)�
stacklevelzGNamedTuple.__new__() missing 1 required positional argument: 'typename'z@NamedTuple.__new__() takes from 2 to 3 positional arguments but z were given�fieldsr~z2Passing 'fields' as keyword argument is deprecatedzIEither list of fields or keywords can be provided to NamedTuple, not both)	rTrU�warnings�warn�DeprecationWarningr�rzrOry)r�rr{r�r�r�rZrZr[r��sB

�
�

�
zNamedTuple.__new__z*($cls, typename, fields=None, /, **kwargs)N)rbr^r_r�r�r��__text_signature__rZrZrZr[r=ls#cOs
t||�Sr�)r�)r{r�rrZrZr[�	_dict_new�sr�)�totalc	Ksj|dkr|}n|rtd��t|�|d�}zt�d�j�dd�|d<Wnttfk
r\YnXt|d|�S)Nz@TypedDict takes either a dict or keyword arguments, but not both)r'�	__total__r~rbr�r^rZ)	rTr�r�r�r�r�r�r��_TypedDictMeta)r{r�r�r�rr�rZrZr[�_typeddict_new�sr�cCstd��dS)Nz4TypedDict does not support instance and class checksr�)r{r�rZrZr[�_check_fails�sr�cs&eZdZd�fdd�	ZeZZ�ZS)r�Tcs�|dkrtnt|d<tt|��||tf|�}|�di�}d��fdd�|��D�}|D]}|�|j	�di��qV||_
t|d�s�||_|S)agCreate new typed dict class object.

        This method is called directly when TypedDict is subclassed,
        or via _typeddict_new when TypedDict is instantiated. This way
        TypedDict supports all three syntax forms described in its docstring.
        Subclasses and instances of TypedDict return actual dictionaries
        via _dict_new.
        r>r�r'z?TypedDict('Name', {f0: t0, f1: t1, ...}); each t must be a typecsi|]\}}|t|���qSrZr�)rgrurwr�rZr[�
<dictcomp>�sz*_TypedDictMeta.__new__.<locals>.<dictcomp>r�)
r�r�r�r�r�r�r�rO�updaterr'r:r�)r{r�r
r�r�Ztp_dictZannsr"r�r�r[r��s	
z_TypedDictMeta.__new__)T)rbr^r_r�r�r�r�r�rZrZr�r[r��sr�c@seZdZdZdS)r>a�A simple typed namespace. At runtime it is equivalent to a plain dict.

    TypedDict creates a dictionary type that expects all of its
    instances to have a certain set of keys, where each key is
    associated with a value of a consistent type. This expectation
    is not checked at runtime but is only enforced by type checkers.
    Usage::

        class Point2D(TypedDict):
            x: int
            y: int
            label: str

        a: Point2D = {'x': 1, 'y': 2, 'label': 'good'}  # OK
        b: Point2D = {'z': 3, 'label': 'bad'}           # Fails type check

        assert Point2D(x=1, y=2, label='first') == dict(x=1, y=2, label='first')

    The type info can be accessed via Point2D.__annotations__. TypedDict
    supports two additional equivalent forms::

        Point2D = TypedDict('Point2D', x=int, y=int, label=str)
        Point2D = TypedDict('Point2D', {'x': int, 'y': int, 'label': str})

    By default, all keys must be present in a TypedDict. It is possible
    to override this by specifying totality.
    Usage::

        class point2D(TypedDict, total=False):
            x: int
            y: int

    This means that a point2D TypedDict can have any of the keys omitted.A type
    checker is only expected to support a literal False or True as the value of
    the total argument. True is the default, and makes all items defined in the
    class body be required.

    The class syntax is only supported in Python 3.6+, while two other
    syntax forms work for Python 2.7 and 3.2+
    Nr$rZrZrZr[r>�scCsdd�}||_||_|S)a%NewType creates simple unique types with almost zero
    runtime overhead. NewType(name, tp) is considered a subtype of tp
    by static type checkers. At runtime, NewType(name, tp) returns
    a dummy function that simply returns its argument. Usage::

        UserId = NewType('UserId', int)

        def name_by_id(user_id: UserId) -> str:
            ...

        UserId('user')          # Fails type check

        name_by_id(42)          # Fails type check
        name_by_id(UserId(42))  # OK

        num = UserId(5) + 1     # type: int
    cSs|Sr�rZ)�xrZrZr[�new_typeszNewType.<locals>.new_type)rbZ
__supertype__)r�rwr�rZrZr[rFsc@s�eZdZdZdZeeed�dd���Zeeed�dd���Z	edd�d	d
��Z
eeed�dd���Zee
d�d
d��Zedd�dd��Zeed�dd��Zed7e
ed�dd��Zeed�dd��Zed8e
ed�dd��Zed9e
eed�dd��Zed:e
e
e
d �d!d"��Zeed�d#d$��Zee
d�d%d&��Zed;e
e
d'�d(d)��Zeed�d*d+��Zeee
d,�d-d.��Zeeedd/�d0d1��Zed2d�d3d4��Zedd�d5d6��ZdS)<�IOa�Generic base class for TextIO and BinaryIO.

    This is an abstract, generic version of the return of open().

    NOTE: This does not distinguish between the different possible
    classes (text vs. binary, read vs. write vs. read/write,
    append-only, unbuffered).  The TextIO and BinaryIO subclasses
    below capture the distinctions between text vs. binary, which is
    pervasive in the interface; however we currently do not offer a
    way to track the other distinctions in the type system.
    rZrfcCsdSr�rZr�rZrZr[�mode=szIO.modecCsdSr�rZr�rZrZr[r�BszIO.nameNcCsdSr�rZr�rZrZr[�closeGszIO.closecCsdSr�rZr�rZrZr[�closedKsz	IO.closedcCsdSr�rZr�rZrZr[�filenoPsz	IO.filenocCsdSr�rZr�rZrZr[�flushTszIO.flushcCsdSr�rZr�rZrZr[�isattyXsz	IO.isattyr�)rurgcCsdSr�rZ)r�rurZrZr[�read\szIO.readcCsdSr�rZr�rZrZr[�readable`szIO.readable)�limitrgcCsdSr�rZ)r�r�rZrZr[�readlinedszIO.readline)�hintrgcCsdSr�rZ)r�r�rZrZr[�	readlineshszIO.readlinesr)�offset�whencergcCsdSr�rZ)r�r�r�rZrZr[�seeklszIO.seekcCsdSr�rZr�rZrZr[�seekablepszIO.seekablecCsdSr�rZr�rZrZr[�telltszIO.tell)�sizergcCsdSr�rZ)r�r�rZrZr[�truncatexszIO.truncatecCsdSr�rZr�rZrZr[�writable|szIO.writable��srgcCsdSr�rZ�r�r�rZrZr[�write�szIO.write)�linesrgcCsdSr�rZ)r�r�rZrZr[�
writelines�sz
IO.writelinesz
IO[AnyStr]cCsdSr�rZr�rZrZr[�	__enter__�szIO.__enter__cCsdSr�rZ)r�rOrH�	tracebackrZrZr[�__exit__�szIO.__exit__)r�)r�)r�)r)N) rbr^r_r�r��propertyrrQr�r�r�r�r�rir�r�r�r@r�r�r�r9r�r�r�r�r�r�r�r�r�r�rZrZrZr[r�.sZr�c@sBeZdZdZdZeeeefe	d�dd��Z
edd�dd��Zd	S)
�BinaryIOz5Typed version of the return of open() in binary mode.rZr�cCsdSr�rZr�rZrZr[r��szBinaryIO.writerfcCsdSr�rZr�rZrZr[r��szBinaryIO.__enter__N)rbr^r_r�r�rrro�	bytearrayrir�r�rZrZrZr[r��sr�c@s�eZdZdZdZeeed�dd���Zeee	d�dd���Z
eeee	d�dd	���Zeee
d�d
d���Zeeed�dd
���Zedd�dd��ZdS)�TextIOz3Typed version of the return of open() in text mode.rZrfcCsdSr�rZr�rZrZr[�buffer�sz
TextIO.buffercCsdSr�rZr�rZrZr[�encoding�szTextIO.encodingcCsdSr�rZr�rZrZr[�errors�sz
TextIO.errorscCsdSr�rZr�rZrZr[�line_buffering�szTextIO.line_bufferingcCsdSr�rZr�rZrZr[�newlines�szTextIO.newlinescCsdSr�rZr�rZrZr[r��szTextIO.__enter__N)rbr^r_r�r�r�rr�r�rQr�rr�r�r�rr�r�rZrZrZr[r��s&r�c@s&eZdZdZdddgZeZeZeZdS)�ioz)Wrapper namespace for IO generic classes.r�r�r�N)rbr^r_r��__all__r�r�r�rZrZrZr[r��s

r�z.ioc@s eZdZdZddgZeZeZdS)�rez&Wrapper namespace for re type aliases.�Pattern�MatchN)rbr^r_r�r�r�r�rZrZrZr[r��sr�z.re)T)NN)T)N)�r�rrrrZcollections.abcr8r�rr�Z	stdlib_rer�r`rrrr�r\rerqrur}r�r�r�r�r�r�rUrrIr	r
rrr
rrr�r�rRrrr�r�Z_TYPING_INTERNALSZ_SPECIAL_NAMESr,r0r3r4r5r>r9rrKrArIra�BuiltinFunctionType�
MethodTyperPrQrErDrCrGrHr[rJrBr]r^r_r`rarbrcrOrdrorQr@rerr%r(r'r&rrr,r#rr)rr;rr!rrr"r rrprrrr9r�r6rr�r<rrrr$r6rr7r+r�r7r�r8r:r5r4r?r*rr2r0r/r.r1r-r3ryr�rmr�r=r�r�r�r�r>rFrLrMr�r�r�r�rbrNr�r�rZrZrZr[�<module>s(�X
!
	
I��
�����2a�
/[����	b�
V	
�
�	�							@+c#	

__pycache__/io.cpython-38.opt-2.pyc000064400000003657151153537570013002 0ustar00U

e5d�
�@sfdZddddddddd	d
ddd
ddddddgZddlZddlZddlmZmZmZmZmZm	Z	m
Z
mZmZm
Z
mZmZmZmZejZde_dZdZdZGdd�dejejd�ZGdd�deje�ZGdd	�d	eje�ZGdd�deje�Ze� e	�e
ee
eefD]Z!e� e!��qeefD]Z!e� e!��q[!zddlm"Z"Wne#k
�rVYnXe� e"�dS) z�Guido van Rossum <guido@python.org>, Mike Verdone <mike.verdone@gmail.com>, Mark Russell <mark.russell@zen.co.uk>, Antoine Pitrou <solipsis@pitrou.net>, Amaury Forgeot d'Arc <amauryfa@gmail.com>, Benjamin Peterson <benjamin@python.org>�BlockingIOError�open�	open_code�IOBase�	RawIOBase�FileIO�BytesIO�StringIO�BufferedIOBase�BufferedReader�BufferedWriter�BufferedRWPair�BufferedRandom�
TextIOBase�
TextIOWrapper�UnsupportedOperation�SEEK_SET�SEEK_CUR�SEEK_END�N)�DEFAULT_BUFFER_SIZErrrrrrrr
rrr
�IncrementalNewlineDecoderr�io��c@seZdZejjZdS)rN)�__name__�
__module__�__qualname__�_io�_IOBase�__doc__�r r �/usr/lib64/python3.8/io.pyrHs)�	metaclassc@seZdZejjZdS)rN)rrrr�
_RawIOBaserr r r r!rKsc@seZdZejjZdS)r	N)rrrr�_BufferedIOBaserr r r r!r	Nsc@seZdZejjZdS)rN)rrrr�_TextIOBaserr r r r!rQs)�_WindowsConsoleIO)$�
__author__�__all__r�abcrrrrrrrrr
rrr
rr�OpenWrapperrrrrr�ABCMetarr#rr$r	r%r�register�klassr&�ImportErrorr r r r!�<module>%sR
�@
�__pycache__/pathlib.cpython-38.opt-2.pyc000064400000105313151153537570014006 0ustar00U

e5d���@sjddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZmZm
Z
mZmZddlmZddlmZmZmZmZmZmZmZddlmZdZejdkr�ddlZe� �dd	�d
kr�ddlm!Z!q�dZdZ!ndZd
dddddgZ"ee
eefZ#dZ$dd�Z%dd�Z&Gdd�de'�Z(Gdd�de(�Z)Gdd�de(�Z*e)�Z+e*�Z,Gdd�d�Z-Gd d!�d!e-�Z.e.�Z/d"d#�Z0e1ed$��r�e�2�e0�Z0Gd%d&�d&�Z3Gd'd(�d(�Z4Gd)d*�d*e3�Z5Gd+d,�d,e3�Z6Gd-d.�d.e3�Z7Gd/d0�d0e	�Z8Gd1d
�d
e'�Z9ej:�;e9�Gd2d�de9�Z<Gd3d�de9�Z=Gd4d�de9�Z>Gd5d�de>e<�Z?Gd6d�de>e=�Z@dS)7�N)�Sequence)�EINVAL�ENOENT�ENOTDIR�EBADF�ELOOP)�
attrgetter)�S_ISDIR�S_ISLNK�S_ISREG�S_ISSOCK�S_ISBLK�S_ISCHR�S_ISFIFO)�quote_from_bytesT�nt�)�r)�_getfinalpathnameF�PurePath�
PurePosixPath�PureWindowsPath�Path�	PosixPath�WindowsPath)��{i�cCs t|dd�tkpt|dd�tkS)N�errnoZwinerror)�getattr�_IGNORED_ERROS�_IGNORED_WINERRORS)Z	exception�r!�/usr/lib64/python3.8/pathlib.py�
_ignore_error.s�r#cCsd|kpd|kpd|kS)N�*�?�[r!)�patr!r!r"�_is_wildcard_pattern3sr(c@s$eZdZdd�Zdd�Zdd�ZdS)�_FlavourcCs|jj|_dS�N)�sep�join��selfr!r!r"�__init__=sz_Flavour.__init__cCsg}|j}|j}d}}t|�}|D]�}|s.q$|r>|�||�}|�|�\}}}	||	kr�t|	�|��D] }
|
rd|
dkrd|�t�|
��qdn|	r�|	dkr�|�t�|	��|s�|r$|s�|D]0}|s�q�|r�|�||�}|�|�d}|r�q�q�q�q$|s�|�r|�||�|�	�|||fS)N��.r)
r+�altsep�reversed�replace�	splitroot�split�append�sys�intern�reverse)r.�partsZparsedr+r2�drv�root�it�partZrel�xr!r!r"�parse_parts@s@
z_Flavour.parse_partscCsz|r*|sp|rp||||g|dd�fSnF|rb||ksJ|�|�|�|�krp||||dd�fSn||||fS|||fS�N�)�casefold)r.r<r=r;Zdrv2Zroot2Zparts2r!r!r"�join_parsed_partsfsz_Flavour.join_parsed_partsN)�__name__�
__module__�__qualname__r/rArEr!r!r!r"r)9s&r)c@s�eZdZdZdZdZeZej	dkZ
ed�ZdZ
ddd	d
hdd�ed
d�D�Bdd�ed
d�D�BZefdd�Zdd�Zdd�Zdd�Zd&dd�Ze
fdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%S)'�_WindowsFlavour�\�/TrZ4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZz\\?\ZCONZPRNZAUXZNULcCsh|]}d|�qS)zCOM%dr!��.0�ir!r!r"�	<setcomp>�sz_WindowsFlavour.<setcomp>rC�
cCsh|]}d|�qS)zLPT%dr!rLr!r!r"rO�scCs\|dd�}|dd�}||krP||krP|�|�\}}|dd�}|dd�}nd}|dd�}||kr�||kr�||kr�|�|d�}|dkr�|�||d�}||dkr�|dkr�t|�}|r�||d|�|||dd�fS|d|�|||dd�fSd}	}
|dk�r6||jk�r6|dd�}	|dd�}|}||k�rN|}
|�|�}||	|
|fS)NrrCrr0�����:)�_split_extended_path�find�len�
drive_letters�lstrip)r.r?r+�first�second�prefixZthird�indexZindex2r<r=r!r!r"r5�s6"

z_WindowsFlavour.splitrootcCs|��Sr*��lower�r.�sr!r!r"rD�sz_WindowsFlavour.casefoldcCsdd�|D�S)NcSsg|]}|���qSr!r])rM�pr!r!r"�
<listcomp>�sz2_WindowsFlavour.casefold_parts.<locals>.<listcomp>r!�r.r;r!r!r"�casefold_parts�sz_WindowsFlavour.casefold_partscCst�t�|�tj�jSr*)�re�compile�fnmatch�	translate�
IGNORECASE�	fullmatch�r.�patternr!r!r"�compile_pattern�sz_WindowsFlavour.compile_patternFcCs�t|�}|st��Sd}tdk	r�|r2|�t|��Sg}z|�t|��}WnBtk
r�|}tj�|�\}}|�|�||kr�|YSYq6Xtjj	|ft
|���Sq6dSr*)�str�os�getcwdr�_ext_to_normal�FileNotFoundError�pathr6r7r,r3)r.rs�strictr`Z
previous_sZ
tail_parts�tailr!r!r"�resolve�s$
z_WindowsFlavour.resolvecCsXd}|�|�rP|dd�}|dd�}|�d�rP||dd�7}d|dd�}||fS)Nr0�zUNC\rQrJ)�
startswith)r.r`Z
ext_prefixr[r!r!r"rT�s

z$_WindowsFlavour._split_extended_pathcCs|�|�dSrB)rTr_r!r!r"rq�sz_WindowsFlavour._ext_to_normalcCs6|sdS|d�d�rdS|d�d�d��|jkS)NFrz\\rRr1)rx�	partition�upper�reserved_namesrcr!r!r"�is_reserved�s
z_WindowsFlavour.is_reservedcCsd|j}t|�dkrJ|ddkrJ|��dd��d�}d|t|�d��fSdt|���d��SdS)NrrCrSrKz
file:///%s/%szutf-8zfile:)�driverV�as_posixrX�urlquote_from_bytes�encode)r.rsr}�restr!r!r"�make_uri�s�z_WindowsFlavour.make_uricCs�dtjkrtjd}nJdtjkrXztjd}Wntk
rFd}YnX|tjd}ntd��|r�tjd|kr�|�|f�\}}}|dtjdkr�td|��||d<|s�|r�|||�|d	d��}n
|�|�}|S)
NZUSERPROFILEZHOMEPATHZ	HOMEDRIVEr0zCan't determine home directoryZUSERNAMErR�%Can't determine home directory for %rrC)ro�environ�KeyError�RuntimeErrorrAr,)r.�username�userhomer<r=r;r!r!r"�
gethomedirs*


�
z_WindowsFlavour.gethomedirN)F)rFrGrHr+r2�has_drv�ntpath�pathmodro�name�is_supported�setrWZext_namespace_prefix�ranger{r5rDrdrmrvrTrqr|r�r�r!r!r!r"rIxs.

���'

rIc@sleZdZdZdZdZeZej	dkZ
efdd�Zdd�Zd	d
�Z
dd�Zdd
d�Zdd�Zdd�Zdd�ZdS)�
_PosixFlavourrKr0FrcCsV|rH|d|krH|�|�}t|�t|�dkr<d|d|fSd||fSn
dd|fSdS)Nrrr0)rXrV)r.r?r+Z
stripped_partr!r!r"r5%s
z_PosixFlavour.splitrootcCs|Sr*r!r_r!r!r"rD4sz_PosixFlavour.casefoldcCs|Sr*r!rcr!r!r"rd7sz_PosixFlavour.casefold_partscCst�t�|��jSr*)rerfrgrhrjrkr!r!r"rm:sz_PosixFlavour.compile_patterncsJ|j�|j�i������fdd��|��r0dnt��}�|t|��pH�S)Ncs�|���rd}|���D]�}|r|dkr*q|dkrD|���\}}}q|���rX||}n|�|}|�kr��|}|dk	r~qtd|��z��|�}Wn6tk
r�}z|jtkr��r��|}W5d}~XYqXd�|<�||�}|�|<q|S)Nr0r1�..zSymlink loop from %r)	rxr6�
rpartition�endswithr��readlink�OSErrorrr)rsr�r��_�newpath�target�e��_resolveZaccessor�seenr+rtr!r"r�As4




z'_PosixFlavour.resolve.<locals>._resolver0)r+�	_accessor�is_absoluterorprn)r.rsrt�baser!r�r"rv=s)z_PosixFlavour.resolvecCsdS�NFr!rcr!r!r"r|msz_PosixFlavour.is_reservedcCst|�}dt|�S)Nzfile://)�bytesr)r.rsZbpathr!r!r"r�psz_PosixFlavour.make_uricCs||s@ztjdWStk
r<ddl}|�t���jYSXn8ddl}z|�|�jWStk
rvtd|��YnXdS)N�HOMErr�)	ror�r��pwd�getpwuid�getuid�pw_dir�getpwnamr�)r.r�r�r!r!r"r�vs�z_PosixFlavour.gethomedirN)F)rFrGrHr+r2r��	posixpathr�ror�r�r5rDrdrmrvr|r�r�r!r!r!r"r�s

0r�c@seZdZdS)�	_AccessorN)rFrGrHr!r!r!r"r��sr�c@s�eZdZejZejZejZejZejZej	Z	e
ed�r>ejZndd�ZejZej
Z
e
ed�rdejZnedd��ZejZejZejZer�er�ejZq�dd�Zned	d��ZejZd
d�ZdS)
�_NormalAccessor�lchmodcCstd��dS)Nz%lchmod() not available on this system��NotImplementedError)r.Zpathobj�moder!r!r"r��sz_NormalAccessor.lchmod�linkcCstd��dS)Nz&os.link() not available on this systemr��r.r�r!r!r"�link_to�sz_NormalAccessor.link_tocCstd��dS)Nz&symlink() not available on this systemr���a�b�target_is_directoryr!r!r"�symlink�sz_NormalAccessor.symlinkcCst�||�Sr*)ror�r�r!r!r"r��scCs
t�|�Sr*)ror��r.rsr!r!r"r��sz_NormalAccessor.readlinkN)rFrGrHro�stat�lstat�open�listdir�scandir�chmod�hasattrr��mkdir�unlinkr�r��staticmethod�rmdir�renamer4r�supports_symlinksr��utimer�r!r!r!r"r��s4




r�cCsR|d}|dd�}|dkr"t}n$d|kr4td��nt|�rBt}nt}||||�S)NrrC�**z:Invalid pattern: '**' can only be an entire path component)�_RecursiveWildcardSelector�
ValueErrorr(�_WildcardSelector�_PreciseSelector)�
pattern_parts�flavourr'�child_parts�clsr!r!r"�_make_selector�s
r��	lru_cachec@seZdZdd�Zdd�ZdS)�	_SelectorcCs0||_|rt||�|_d|_nt�|_d|_dS)NTF)r�r��	successor�dironly�_TerminatingSelector)r.r�r�r!r!r"r/�sz_Selector.__init__cCs<t|�}|j}|j}|jj}||�s,tg�S|�||||�Sr*)�type�is_dir�existsr�r��iter�_select_from)r.�parent_pathZpath_clsr�r�r�r!r!r"�select_from�sz_Selector.select_fromN)rFrGrHr/r�r!r!r!r"r��s	r�c@seZdZdd�ZdS)r�ccs
|VdSr*r!)r.r�r�r�r�r!r!r"r��sz!_TerminatingSelector._select_fromN)rFrGrHr�r!r!r!r"r��sr�c@seZdZdd�Zdd�ZdS)r�cCs||_t�|||�dSr*)r�r�r/)r.r�r�r�r!r!r"r/sz_PreciseSelector.__init__ccs\z@|�|j�}|jr|n||�r>|j�||||�D]
}|Vq2Wntk
rVYdSXdSr*)�_make_child_relpathr�r�r�r��PermissionError)r.r�r�r�r�rsrar!r!r"r�sz_PreciseSelector._select_fromN�rFrGrHr/r�r!r!r!r"r��sr�c@seZdZdd�Zdd�ZdS)r�cCs|�|�|_t�|||�dSr*)rm�matchr�r/�r.r'r�r�r!r!r"r/sz_WildcardSelector.__init__ccs�z�||��}t|�}W5QRX|D]�}|jrrz|��s:Wq"Wn4tk
rp}zt|�sX�WY�q"W5d}~XYnX|j}	|�|	�r"|�|	�}
|j�	|
|||�D]
}|Vq�q"Wnt
k
r�YdSXdSr*)�listr�r�r�r#r�r�r�r�r�r�)r.r�r�r�r��
scandir_it�entries�entryr�r�rsrar!r!r"r�s&


z_WildcardSelector._select_fromNr�r!r!r!r"r�sr�c@s$eZdZdd�Zdd�Zdd�ZdS)r�cCst�|||�dSr*)r�r/r�r!r!r"r//sz#_RecursiveWildcardSelector.__init__ccs�|Vz�||��}t|�}W5QRX|D]t}d}z|��}Wn,tk
rh}zt|�sX�W5d}~XYnX|r(|��s(|�|j�}	|�|	||�D]
}
|
Vq�q(Wntk
r�YdSXdSr�)	r�r�r�r#�
is_symlinkr�r��_iterate_directoriesr�)r.r�r�r�r�r�r�Zentry_is_dirr�rsrar!r!r"r�2s"
z/_RecursiveWildcardSelector._iterate_directoriesc	cs~zbt�}zL|jj}|�|||�D]0}|||||�D]}||kr2|V|�|�q2q W5|��XWntk
rxYdSXdSr*)r��clearr�r�r��addr�)	r.r�r�r�r�ZyieldedZsuccessor_selectZstarting_pointrar!r!r"r�Esz'_RecursiveWildcardSelector._select_fromN)rFrGrHr/r�r�r!r!r!r"r�-sr�c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�_PathParents)�_pathcls�_drv�_root�_partscCs&t|�|_|j|_|j|_|j|_dSr*)r�r�r�r�r�r�r!r!r"r/^s
z_PathParents.__init__cCs(|js|jrt|j�dSt|j�SdSrB)r�r�rVr�r-r!r!r"�__len__esz_PathParents.__len__cCs@|dks|t|�krt|��|j�|j|j|jd|d��S)NrrC)rV�
IndexErrorr��_from_parsed_partsr�r�r�)r.�idxr!r!r"�__getitem__ks
�z_PathParents.__getitem__cCsd�|jj�S)Nz<{}.parents>)�formatr�rFr-r!r!r"�__repr__qsz_PathParents.__repr__N)rFrGrH�	__slots__r/r�r�r�r!r!r!r"r�Ys
r�c@s�eZdZdZdd�Zdd�Zedd��ZedUd	d
��ZedVdd��Z	ed
d��Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zedd ��Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zeed-�d.d/�Zeed0�d1d/�Zed2d3��Zed4d5��Zed6d7��Z ed8d9��Z!ed:d;��Z"d<d=�Z#d>d?�Z$d@dA�Z%edBdC��Z&dDdE�Z'dFdG�Z(dHdI�Z)edJdK��Z*edLdM��Z+dNdO�Z,dPdQ�Z-dRdS�Z.dTS)Wr)r�r�r��_str�_hash�_pparts�_cached_cpartscGs$|tkrtjdkrtnt}|�|�S)Nr)rror�rr�_from_parts)r��argsr!r!r"�__new__�szPurePath.__new__cCs|jt|j�fSr*)�	__class__�tupler�r-r!r!r"�
__reduce__�szPurePath.__reduce__cCsdg}|D]N}t|t�r"||j7}qt�|�}t|t�rF|�t|��qtdt|���q|j	�
|�S)NzNargument should be a str object or an os.PathLike object returning str, not %r)�
isinstancerr�ro�fspathrnr7�	TypeErrorr��_flavourrA)r�r�r;r�r!r!r"�_parse_args�s


��zPurePath._parse_argsTcCs<t�|�}|�|�\}}}||_||_||_|r8|��|Sr*)�objectr�rr�r�r��_init)r�r��initr.r<r=r;r!r!r"r��s
zPurePath._from_partscCs,t�|�}||_||_||_|r(|��|Sr*)rr�r�r�r�r)r�r<r=r;rr.r!r!r"r��s
zPurePath._from_parsed_partscCs4|s|r$|||j�|dd��S|j�|�SdSrB)rr,)r�r<r=r;r!r!r"�_format_parsed_parts�szPurePath._format_parsed_partscCsdSr*r!r-r!r!r"r�szPurePath._initcCs@|�|�\}}}|j�|j|j|j|||�\}}}|�|||�Sr*)rrrEr�r�r�r�)r.r�r<r=r;r!r!r"�_make_child�s�
zPurePath._make_childcCsBz|jWStk
r<|�|j|j|j�p.d|_|jYSXdS)Nr1)r��AttributeErrorr	r�r�r�r-r!r!r"�__str__�s��zPurePath.__str__cCst|�Sr*)rnr-r!r!r"�
__fspath__�szPurePath.__fspath__cCs|j}t|��|jd�S)NrK)rrnr4r+�r.�fr!r!r"r~�szPurePath.as_posixcCs
t�|�Sr*)ro�fsencoder-r!r!r"�	__bytes__�szPurePath.__bytes__cCsd�|jj|���S)Nz{}({!r}))r�r�rFr~r-r!r!r"r��szPurePath.__repr__cCs|��std��|j�|�S)Nz.relative path can't be expressed as a file URI)r�r�rr�r-r!r!r"�as_uri�szPurePath.as_uricCs8z|jWStk
r2|j�|j�|_|jYSXdSr*)r�rrrdr�r-r!r!r"�_cparts�s
zPurePath._cpartscCs&t|t�stS|j|jko$|j|jkSr*)rr�NotImplementedrr�r.�otherr!r!r"�__eq__�s
zPurePath.__eq__cCs8z|jWStk
r2tt|j��|_|jYSXdSr*)r�r�hashr�rr-r!r!r"�__hash__�s
zPurePath.__hash__cCs&t|t�r|j|jk	rtS|j|jkSr*�rrrrrrr!r!r"�__lt__szPurePath.__lt__cCs&t|t�r|j|jk	rtS|j|jkSr*rrr!r!r"�__le__	szPurePath.__le__cCs&t|t�r|j|jk	rtS|j|jkSr*rrr!r!r"�__gt__szPurePath.__gt__cCs&t|t�r|j|jk	rtS|j|jkSr*rrr!r!r"�__ge__szPurePath.__ge__r�z.The drive prefix (letter or UNC path), if any.)�docr�zThe root of the path, if any.cCs|j|j}|Sr*)r�r�)r.�anchorr!r!r"r szPurePath.anchorcCs.|j}t|�|js|jrdndkr&dS|dS)NrCrr0rR)r�rVr�r�rcr!r!r"r�$sz
PurePath.namecCsD|j}|�d�}d|kr,t|�dkr<nn||d�SdSdS)Nr1rrCr0�r��rfindrV�r.r�rNr!r!r"�suffix,s

 zPurePath.suffixcCs:|j}|�d�rgS|�d�}dd�|�d�dd�D�S)Nr1cSsg|]}d|�qS)r1r!)rMr$r!r!r"rbEsz%PurePath.suffixes.<locals>.<listcomp>rC)r�r�rXr6�r.r�r!r!r"�suffixes:s


zPurePath.suffixescCsD|j}|�d�}d|kr,t|�dkr<nn|d|�S|SdS)Nr1rrCr!r#r!r!r"�stemGs

 z
PurePath.stemcCs�|jstd|f��|j�|f�\}}}|rX|d|jj|jjfksX|sX|sXt|�dkrdtd|��|�|j|j	|j
dd�|g�S)N�%r has an empty namerRrCzInvalid name %r)r�r�rrAr+r2rVr�r�r�r�)r.r�r<r=r;r!r!r"�	with_nameQs��
��zPurePath.with_namecCs�|j}|j|ks |jr.|j|kr.td|f��|r<|�d�rD|dkrPtd|��|j}|shtd|f��|j}|s|||}n|dt|��|}|�|j	|j
|jdd�|g�S)NzInvalid suffix %rr1r(rR)rr+r2r�rxr�r$rVr�r�r�r�)r.r$rr�Z
old_suffixr!r!r"�with_suffix\s
�zPurePath.with_suffixc
Gs�|std��|j}|j}|j}|r8||g|dd�}n|}|�|�\}}}|rf||g|dd�}	n|}	t|	�}
|jj}|
dkr�|s�|r�n||d|
��||	�kr�|�|||�}t	d�
t|�t|����|�d|
dkr�|nd||
d��S)Nzneed at least one argumentrCrz{!r} does not start with {!r}r0)
rr�r�r�rrVrrdr	r�r�rnr�)
r.rr;r<r=Z	abs_partsZto_drvZto_rootZto_partsZto_abs_parts�n�cfZ	formattedr!r!r"�relative_toqs.	*�
�zPurePath.relative_tocCs4z|jWStk
r.t|j�|_|jYSXdSr*)r�rr�r�r-r!r!r"r;�s
zPurePath.partscGs
|�|�Sr*)r
)r.r�r!r!r"�joinpath�szPurePath.joinpathcCs,z|�|f�WStk
r&tYSXdSr*)r
rr�r.�keyr!r!r"�__truediv__�szPurePath.__truediv__cCs2z|�|g|j�WStk
r,tYSXdSr*)r�r�rrr/r!r!r"�__rtruediv__�szPurePath.__rtruediv__cCs@|j}|j}|j}t|�dkr*|s&|r*|S|�|||dd��S)NrCrR)r�r�r�rVr�)r.r<r=r;r!r!r"�parent�szPurePath.parentcCst|�Sr*)r�r-r!r!r"�parents�szPurePath.parentscCs|js
dS|jjpt|j�Sr�)r�rr��boolr�r-r!r!r"r��szPurePath.is_absolutecCs|j�|j�Sr*)rr|r�r-r!r!r"r|�szPurePath.is_reservedc	Cs�|jj}||�}|j�|f�\}}}|s0td��|rF|||j�krFdS|r\|||j�kr\dS|j}|sj|r�t|�t|�kr~dS|dd�}nt|�t|�kr�dStt	|�t	|��D]\}}t
�||�s�dSq�dS)Nz
empty patternFrCT)rrDrAr�r�r�rrV�zipr3rgZfnmatchcase)	r.Zpath_patternr,r<r=Z	pat_partsr;r?r'r!r!r"r��s(zPurePath.matchN)T)T)/rFrGrHr�r�r�classmethodrr�r�r	rr
rr
r~rr�r�propertyrrrrrrrrr}r=r r�r$r&r'r)r*r-r;r.r1r2r3r4r�r|r�r!r!r!r"rust	

	


��





	 

	
c@seZdZeZdZdS)rr!N)rFrGrH�_posix_flavourrr�r!r!r!r"r�sc@seZdZeZdZdS)rr!N)rFrGrH�_windows_flavourrr�r!r!r!r"r�sc@s�eZdZdZdd�Zdcdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dddd�Z
dedd�Zedd��Z
edd��Zdd�Zdd�Zdd�Zdd �Zd!d"�Zdfd$d%�Zd&d'�Zd(d)�Zd*d+�Zdgd.d/�Zd0d1�Zdhd2d3�Zd4d5�Zdid6d7�Zdjd9d:�Zdkd;d<�Zd=d>�Zd?d@�Z dldAdB�Z!dCdD�Z"dEdF�Z#dGdH�Z$dIdJ�Z%dmdKdL�Z&dMdN�Z'dOdP�Z(dQdR�Z)dSdT�Z*dUdV�Z+dWdX�Z,dYdZ�Z-d[d\�Z.d]d^�Z/d_d`�Z0dadb�Z1dS)nr)r��_closedcOsL|tkrtjdkrtnt}|j|dd�}|jjs@td|j	f��|�
�|S)NrF�rz$cannot instantiate %r on your system)rror�rrr�rr�r�rFr)r�r��kwargsr.r!r!r"r�s�zPath.__new__NcCs"d|_|dk	r|j|_nt|_dSr�)r;r��_normal_accessor)r.�templater!r!r"rs
z
Path._initcCs|j|g}|�|j|j|�Sr*)r�r�r�r�)r.r?r;r!r!r"r�#szPath._make_child_relpathcCs|jr|��|Sr*)r;�
_raise_closedr-r!r!r"�	__enter__)szPath.__enter__cCs
d|_dS)NT)r;)r.�t�v�tbr!r!r"�__exit__.sz
Path.__exit__cCstd��dS)NzI/O operation on closed path)r�r-r!r!r"r@1szPath._raise_closed�cCs|j�|||�Sr*)r�r�)r.r��flagsr�r!r!r"�_opener4szPath._opener�cCs|jr|��|j�|||�Sr*)r;r@r�r�)r.rGr�r!r!r"�	_raw_open8szPath._raw_opencCs|t���Sr*)rorp�r�r!r!r"�cwdCszPath.cwdcCs||�j�d��Sr*)rr�rKr!r!r"�homeJsz	Path.homecCsB|��}z|��}Wntk
r2t�|�}YnXtj�||�Sr*)r�rrors�samestat)r.Z
other_path�stZother_str!r!r"�samefileQsz
Path.samefileccsH|jr|��|j�|�D](}|dkr(q|�|�V|jr|��qdS)N>r1r�)r;r@r�r�r�r%r!r!r"�iterdir\szPath.iterdirccs`|std�|���|j�|f�\}}}|s.|r6td��tt|�|j�}|�|�D]
}|VqPdS)NzUnacceptable pattern: {!r}�%Non-relative patterns are unsupported)r�r�rrAr�r�r�r��r.rlr<r=r�Zselectorrar!r!r"�globjsz	Path.globccsR|j�|f�\}}}|s|r$td��tdt|�|j�}|�|�D]
}|VqBdS)NrR)r�)rrAr�r�r�r�rSr!r!r"�rglobwsz
Path.rglobcCsD|jr|��|��r|S|jt��g|jdd�}|j|d�|S)NFr<�r?)r;r@r�r�rorpr�r)r.�objr!r!r"�absolute�sz
Path.absoluteFcCsh|jr|��|jj||d�}|dkr:|��t|���}|jj�|�}|j	|fdd�}|j
|d�|S)N)rtFr<rV)r;r@rrvr�rnrXr��normpathr�r)r.rtr`ZnormedrWr!r!r"rv�szPath.resolvecCs|j�|�Sr*)r�r�r-r!r!r"r��sz	Path.statcCsddl}|�|��j�jS�Nr)r�r�r��st_uidZpw_name)r.r�r!r!r"�owner�sz
Path.ownercCsddl}|�|��j�jSrZ)�grpZgetgrgidr��st_gidZgr_name)r.r]r!r!r"�group�sz
Path.group�rrRc	Cs(|jr|��tj|||||||jd�S)N)Zopener)r;r@�ior�rH)r.r��	buffering�encoding�errors�newliner!r!r"r��s
�z	Path.openc
Cs,|jdd��}|��W5QR�SQRXdS)N�rb�r��r��readrr!r!r"�
read_bytes�szPath.read_bytesc
Cs0|jd||d��}|��W5QR�SQRXdS)Nr`�r�rcrdrh)r.rcrdrr!r!r"�	read_text�szPath.read_textc
Cs6t|�}|jdd��}|�|�W5QR�SQRXdS)N�wbrg)�
memoryviewr��write)r.�dataZviewrr!r!r"�write_bytes�szPath.write_bytesc
CsLt|t�std|jj��|jd||d��}|�|�W5QR�SQRXdS)Nzdata must be str, not %s�wrk)rrnrr�rFr�ro)r.rprcrdrr!r!r"�
write_text�s
�zPath.write_textTcCsr|jr|��|r>z|j�|d�Wntk
r8YnXdStjtjB}|sX|tjO}|�	||�}t�
|�dSr*)r;r@r�r�r�ro�O_CREAT�O_WRONLY�O_EXCLrJ�close)r.r��exist_okrG�fdr!r!r"�touch�s
z
Path.touchcCs�|jr|��z|j�||�Wndtk
rd|r>|j|kr@�|jjddd�|j|d|d�Yn"tk
r�|r~|��s��YnXdS)NT)r4rxF)r;r@r�r�rrr3r�r�)r.r�r4rxr!r!r"r�sz
Path.mkdircCs |jr|��|j�||�dSr*)r;r@r�r��r.r�r!r!r"r�sz
Path.chmodcCs |jr|��|j�||�dSr*)r;r@r�r�r{r!r!r"r�szPath.lchmodcCs>|jr|��z|j�|�Wntk
r8|s4�YnXdSr*)r;r@r�r�rr)r.Z
missing_okr!r!r"r�%szPath.unlinkcCs|jr|��|j�|�dSr*)r;r@r�r�r-r!r!r"r�2sz
Path.rmdircCs|jr|��|j�|�Sr*)r;r@r�r�r-r!r!r"r�:sz
Path.lstatcCs&|jr|��|j�||�|�|�Sr*)r;r@r�r�r�r�r!r!r"r�Cs
zPath.renamecCs&|jr|��|j�||�|�|�Sr*)r;r@r�r4r�r�r!r!r"r4Rs
zPath.replacecCs"|jr|��|j�|||�dSr*)r;r@r�r�)r.r�r�r!r!r"�
symlink_toaszPath.symlink_tocCs |jr|��|j�||�dSr*)r;r@r�r�r�r!r!r"r�js
zPath.link_toc
CsXz|��WnFtk
r>}zt|�s(�WY�dSd}~XYntk
rRYdSXdS�NFT)r�r�r#r��r.r�r!r!r"r�zszPath.existsc
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdSr�)r	r��st_moder�r#r�r~r!r!r"r��szPath.is_dirc
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdSr�)rr�rr�r#r�r~r!r!r"�is_file�szPath.is_filecCsv|��r|��sdSt|j�}z|��j}Wntk
rBYdSX|��j}||krZdS|��j}|��j}||kSr})r�r�rr3r��st_devr��st_ino)r.r3Z
parent_devZdevZinoZ
parent_inor!r!r"�is_mount�s



z
Path.is_mountc
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdSr�)r
r�rr�r#r�r~r!r!r"r��szPath.is_symlinkc
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdSr�)r
r�rr�r#r�r~r!r!r"�is_block_device�szPath.is_block_devicec
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdSr�)rr�rr�r#r�r~r!r!r"�is_char_device�szPath.is_char_devicec
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdSr�)rr�rr�r#r�r~r!r!r"�is_fifo�szPath.is_fifoc
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdSr�)rr�rr�r#r�r~r!r!r"�	is_socket�szPath.is_socketcCs`|js\|js\|jr\|jddd�dkr\|j�|jddd��}|�|g|jdd��S|S)NrrC�~)r�r�r�rr�r�)r.Zhomedirr!r!r"�
expandusers��zPath.expanduser)N)rF)rI)F)r`rRNNN)NN)NN)rFT)rIFF)F)F)2rFrGrHr�r�rr�rArEr@rHrJr7rLrMrPrQrTrUrXrvr�r\r_r�rjrlrqrsrzr�r�r�r�r�r�r�r4r|r�r�r�r�r�r�r�r�r�r�r�r!r!r!r"rsh	�







�

	



	

	
	c@seZdZdZdS)rr!N)rFrGrHr�r!r!r!r"rsc@s(eZdZdZdd�Zdd�Zdd�ZdS)	rr!cCstd��dS)Nz*Path.owner() is unsupported on this systemr�r-r!r!r"r\(szWindowsPath.ownercCstd��dS)Nz*Path.group() is unsupported on this systemr�r-r!r!r"r_+szWindowsPath.groupcCstd��dS)Nz-Path.is_mount() is unsupported on this systemr�r-r!r!r"r�.szWindowsPath.is_mountN)rFrGrHr�r\r_r�r!r!r!r"r!s)Arg�	functoolsrar�ror�rer8�_collections_abcrrrrrrr�operatorrr�r	r
rrr
rrZurllib.parserrr�r�rZgetwindowsversionr�__all__rr r#r(rr)rIr�r:r9r�r�r>r�r�r�r�r�r�r�r�r�r�PathLike�registerrrrrrr!r!r!r"�<module>s|$
�
?&i8
,t

__pycache__/numbers.cpython-38.opt-2.pyc000064400000020225151153537570014034 0ustar00U

e5d(�@s�ddlmZmZdddddgZGdd�ded�ZGd	d�de�Ze�e�Gd
d�de�Ze�e	�Gdd�de�Z
Gdd�de
�Ze�e�d
S)�)�ABCMeta�abstractmethod�Number�Complex�Real�Rational�Integralc@seZdZdZdZdS)r�N)�__name__�
__module__�__qualname__�	__slots__�__hash__r	r	r	�/usr/lib64/python3.8/numbers.pyrs)�	metaclassc@s�eZdZdZedd��Zdd�Zeedd���Zeedd	���Z	ed
d��Z
edd
��Zedd��Zedd��Z
dd�Zdd�Zedd��Zedd��Zedd��Zedd��Zedd��Zed d!��Zed"d#��Zed$d%��Zed&d'��Zd(S))rr	cCsdS�Nr	��selfr	r	r�__complex__-szComplex.__complex__cCs|dkS�Nrr	rr	r	r�__bool__1szComplex.__bool__cCst�dSr��NotImplementedErrorrr	r	r�real5szComplex.realcCst�dSrrrr	r	r�imag>szComplex.imagcCst�dSrr�r�otherr	r	r�__add__GszComplex.__add__cCst�dSrrrr	r	r�__radd__LszComplex.__radd__cCst�dSrrrr	r	r�__neg__QszComplex.__neg__cCst�dSrrrr	r	r�__pos__VszComplex.__pos__cCs
||Srr	rr	r	r�__sub__[szComplex.__sub__cCs
||Srr	rr	r	r�__rsub___szComplex.__rsub__cCst�dSrrrr	r	r�__mul__cszComplex.__mul__cCst�dSrrrr	r	r�__rmul__hszComplex.__rmul__cCst�dSrrrr	r	r�__truediv__mszComplex.__truediv__cCst�dSrrrr	r	r�__rtruediv__rszComplex.__rtruediv__cCst�dSrr)r�exponentr	r	r�__pow__wszComplex.__pow__cCst�dSrr)r�baser	r	r�__rpow__|szComplex.__rpow__cCst�dSrrrr	r	r�__abs__�szComplex.__abs__cCst�dSrrrr	r	r�	conjugate�szComplex.conjugatecCst�dSrrrr	r	r�__eq__�szComplex.__eq__N)r
rrr
rrr�propertyrrrrrr r!r"r#r$r%r&r(r*r+r,r-r	r	r	rr sL












c@s�eZdZdZedd��Zedd��Zedd��Zedd	��Zed%dd��Z	d
d�Z
dd�Zedd��Zedd��Z
edd��Zedd��Zedd��Zedd��Zdd�Zedd ��Zed!d"��Zd#d$�Zd
S)&rr	cCst�dSrrrr	r	r�	__float__�szReal.__float__cCst�dSrrrr	r	r�	__trunc__�szReal.__trunc__cCst�dSrrrr	r	r�	__floor__�szReal.__floor__cCst�dSrrrr	r	r�__ceil__�sz
Real.__ceil__NcCst�dSrr)rZndigitsr	r	r�	__round__�szReal.__round__cCs||||fSrr	rr	r	r�
__divmod__�szReal.__divmod__cCs||||fSrr	rr	r	r�__rdivmod__�szReal.__rdivmod__cCst�dSrrrr	r	r�__floordiv__�szReal.__floordiv__cCst�dSrrrr	r	r�
__rfloordiv__�szReal.__rfloordiv__cCst�dSrrrr	r	r�__mod__�szReal.__mod__cCst�dSrrrr	r	r�__rmod__�sz
Real.__rmod__cCst�dSrrrr	r	r�__lt__�szReal.__lt__cCst�dSrrrr	r	r�__le__�szReal.__le__cCstt|��Sr)�complex�floatrr	r	rr�szReal.__complex__cCs|
Srr	rr	r	rr�sz	Real.realcCsdSrr	rr	r	rr�sz	Real.imagcCs|
Srr	rr	r	rr,szReal.conjugate)N)r
rrr
rr/r0r1r2r3r4r5r6r7r8r9r:r;rr.rrr,r	r	r	rr�s>	











c@s8eZdZdZeedd���Zeedd���Zdd�ZdS)	rr	cCst�dSrrrr	r	r�	numeratorszRational.numeratorcCst�dSrrrr	r	r�denominatorszRational.denominatorcCs|j|jSr)r>r?rr	r	rr/szRational.__float__N)	r
rrr
r.rr>r?r/r	r	r	rrsc@s�eZdZdZedd��Zdd�Zed%dd��Zed	d
��Zedd��Z	ed
d��Z
edd��Zedd��Zedd��Z
edd��Zedd��Zedd��Zedd��Zedd��Zdd �Zed!d"��Zed#d$��ZdS)&rr	cCst�dSrrrr	r	r�__int__+szIntegral.__int__cCst|�Sr)�intrr	r	r�	__index__0szIntegral.__index__NcCst�dSrr)rr'�modulusr	r	rr(4s	zIntegral.__pow__cCst�dSrrrr	r	r�
__lshift__?szIntegral.__lshift__cCst�dSrrrr	r	r�__rlshift__DszIntegral.__rlshift__cCst�dSrrrr	r	r�
__rshift__IszIntegral.__rshift__cCst�dSrrrr	r	r�__rrshift__NszIntegral.__rrshift__cCst�dSrrrr	r	r�__and__SszIntegral.__and__cCst�dSrrrr	r	r�__rand__XszIntegral.__rand__cCst�dSrrrr	r	r�__xor__]szIntegral.__xor__cCst�dSrrrr	r	r�__rxor__bszIntegral.__rxor__cCst�dSrrrr	r	r�__or__gszIntegral.__or__cCst�dSrrrr	r	r�__ror__lszIntegral.__ror__cCst�dSrrrr	r	r�
__invert__qszIntegral.__invert__cCstt|��Sr)r=rArr	r	rr/wszIntegral.__float__cCs|
Srr	rr	r	rr>{szIntegral.numeratorcCsdS)N�r	rr	r	rr?�szIntegral.denominator)N)r
rrr
rr@rBr(rDrErFrGrHrIrJrKrLrMrNr/r.r>r?r	r	r	rr&sB













N)
�abcrr�__all__rr�registerr<rr=rrrAr	r	r	r�<module>sp
u
___pycache__/colorsys.cpython-38.opt-2.pyc000064400000005114151153537570014236 0ustar00U

e5d��@sXddddddgZdZdZdZd	d�Zd
d�Zdd�Zdd�Zd
d�Zdd�Z	dd�Z
dS)�
rgb_to_yiq�
yiq_to_rgb�
rgb_to_hls�
hls_to_rgb�
rgb_to_hsv�
hsv_to_rgbgUUUUUU�?gUUUUUU�?gUUUUUU�?cCsRd|d|d|}d||d||}d||d||}|||fS)Ng333333�?g�z�G��?g)\��(�?g�G�z��?gH�z�G�?g���Q��?g=
ףp=�?�)�r�g�b�y�i�qrr� /usr/lib64/python3.8/colorsys.pyr(scCs�|d|d|}|d|d|}|d|d|}|dkrHd}|dkrTd}|dkr`d}|dkrld}|dkrxd}|dkr�d}|||fS)	Ng2r��L�?g����,��?g:�����?g�nєW�?g6�޷���?gJ"�X�?���?r)rrr
rr	r
rrrr.s cCs�t|||�}t|||�}||d}||kr6d|dfS|dkrP||||}n||d||}||||}||||}||||}	||kr�|	|}
n"||kr�d||	}
nd||}
|
dd}
|
||fS)N�@r��?�@�@r��max�min)rr	r
�maxc�minc�l�s�rc�gc�bc�hrrrrKs$

cCsn|dkr|||fS|dkr(|d|}n||||}d||}t|||t�t|||�t|||t�fS)Nrrrr)�_v�	ONE_THIRD)rrr�m2�m1rrrrbs
cCsT|d}|tkr$||||dS|dkr0|S|tkrP|||t|dS|S)Nrrr)�	ONE_SIXTH�	TWO_THIRD)r#r"Zhuerrrr lsr cCs�t|||�}t|||�}|}||kr.dd|fS|||}||||}||||}||||}	||kr||	|}
n"||kr�d||	}
nd||}
|
dd}
|
||fS)Nrrrrrr)rr	r
rr�vrrrrrrrrr|s 

cCs�|dkr|||fSt|d�}|d|}|d|}|d||}|d|d|}|d}|dkrt|||fS|dkr�|||fS|dkr�|||fS|dkr�|||fS|d	kr�|||fS|d
kr�|||fSdS)Nrrr�������)�int)rrr&r�f�pr
�trrrr�s(





N)�__all__r!r$r%rrrrr rrrrrr�<module>s�	
__pycache__/threading.cpython-38.pyc000064400000116052151153537570013372 0ustar00U

e5d���@s2dZddlZddlZddlZddlmZddl	m
Z
ddlmZ
mZzddlmZWn ek
rtddlmZYnXddd	d
ddd
ddddddddddddddddgZejZejZejZejZzejZdZe�d�Wnek
r�d ZYnXej Z!z
ej"Z#Wnek
�rdZ#YnXej$Z$[da%da&d!d�Z'd"d�Z(eZ)d#d�Z"Gd$d%�d%�Z*e*Z+Gd&d	�d	�Z,Gd'd�d�Z-Gd(d�de-�Z.Gd)d�d�Z/Gd*d�d�Z0Gd+d�de1�Z2e�j3Z4e4�dLd-d.�Z5e�a6iZ7iZ8e
�Z9e�a:e;�a<Gd/d�d�Z=zdd0lm>a?m@ZAWnHek
�rVdd1lBmCZDdd2lmEZEeEdd3�Z@d4d�ZAd5d�a?YnXd6d7�ZFGd8d�de=�ZGGd9d:�d:e=�ZHGd;d<�d<e=�ZId=d
�ZJeJZKd>d�ZLeLZMd?d@�ZNdAd�ZOddBlmPZPeH�aQdCdD�ZRdEd�ZSzddFlmTZUWn"ek
�rddGlVmUZUYnXdHdI�ZWeXedJ��r.ejYeWdK�dS)Mz;Thread module emulating a subset of Java's threading model.�N)�	monotonic)�WeakSet)�islice�count)�deque�	get_ident�active_count�	Condition�current_thread�	enumerate�main_thread�TIMEOUT_MAX�Event�Lock�RLock�	Semaphore�BoundedSemaphore�Thread�Barrier�BrokenBarrierError�Timer�ThreadError�
setprofile�settrace�local�
stack_size�
excepthook�ExceptHookArgsT�
get_native_idFcCs|adS)z�Set a profile function for all threads started from the threading module.

    The func will be passed to sys.setprofile() for each thread, before its
    run() method is called.

    N)�
_profile_hook��func�r"�!/usr/lib64/python3.8/threading.pyr9scCs|adS)z�Set a trace function for all threads started from the threading module.

    The func will be passed to sys.settrace() for each thread, before its run()
    method is called.

    N)�_trace_hookr r"r"r#rCscOstdkrt||�St||�S)a2Factory function that returns a new reentrant lock.

    A reentrant lock must be released by the thread that acquired it. Once a
    thread has acquired a reentrant lock, the same thread may acquire it again
    without blocking; the thread must release it once for each time it has
    acquired it.

    N)�_CRLock�_PyRLock)�args�kwargsr"r"r#rQs	
c@sVeZdZdZdd�Zdd�Zddd	�ZeZd
d�Zdd
�Z	dd�Z
dd�Zdd�ZdS)�_RLocka,This class implements reentrant lock objects.

    A reentrant lock must be released by the thread that acquired it. Once a
    thread has acquired a reentrant lock, the same thread may acquire it
    again without blocking; the thread must release it once for each time it
    has acquired it.

    cCst�|_d|_d|_dS�Nr)�_allocate_lock�_block�_owner�_count��selfr"r"r#�__init__hsz_RLock.__init__c	Cs^|j}zt|j}Wntk
r(YnXd|j��r:dnd|jj|jj||j	t
t|��fS)Nz)<%s %s.%s object owner=%r count=%d at %s>�lockedZunlocked)r-�_active�name�KeyErrorr,r2�	__class__�
__module__�__qualname__r.�hex�id)r0�ownerr"r"r#�__repr__ms
�z_RLock.__repr__T���cCsDt�}|j|kr"|jd7_dS|j�||�}|r@||_d|_|S)aAcquire a lock, blocking or non-blocking.

        When invoked without arguments: if this thread already owns the lock,
        increment the recursion level by one, and return immediately. Otherwise,
        if another thread owns the lock, block until the lock is unlocked. Once
        the lock is unlocked (not owned by any thread), then grab ownership, set
        the recursion level to one, and return. If more than one thread is
        blocked waiting until the lock is unlocked, only one at a time will be
        able to grab ownership of the lock. There is no return value in this
        case.

        When invoked with the blocking argument set to true, do the same thing
        as when called without arguments, and return true.

        When invoked with the blocking argument set to false, do not block. If a
        call without an argument would block, return false immediately;
        otherwise, do the same thing as when called without arguments, and
        return true.

        When invoked with the floating-point timeout argument set to a positive
        value, block for at most the number of seconds specified by timeout
        and as long as the lock cannot be acquired.  Return true if the lock has
        been acquired, false if the timeout has elapsed.

        �)rr-r.r,�acquire)r0�blocking�timeout�me�rcr"r"r#r?|s
z_RLock.acquirecCs<|jt�krtd��|jd|_}|s8d|_|j��dS)amRelease a lock, decrementing the recursion level.

        If after the decrement it is zero, reset the lock to unlocked (not owned
        by any thread), and if any other threads are blocked waiting for the
        lock to become unlocked, allow exactly one of them to proceed. If after
        the decrement the recursion level is still nonzero, the lock remains
        locked and owned by the calling thread.

        Only call this method when the calling thread owns the lock. A
        RuntimeError is raised if this method is called when the lock is
        unlocked.

        There is no return value.

        �cannot release un-acquired lockr>N)r-r�RuntimeErrorr.r,�release)r0rr"r"r#rF�sz_RLock.releasecCs|��dS�N�rF�r0�t�v�tbr"r"r#�__exit__�sz_RLock.__exit__cCs|j��|\|_|_dSrG)r,r?r.r-)r0�stater"r"r#�_acquire_restore�s
z_RLock._acquire_restorecCs<|jdkrtd��|j}d|_|j}d|_|j��||fS)NrrD)r.rEr-r,rF)r0rr;r"r"r#�
_release_save�s

z_RLock._release_savecCs|jt�kSrG)r-rr/r"r"r#�	_is_owned�sz_RLock._is_ownedN)Tr=)
�__name__r7r8�__doc__r1r<r?�	__enter__rFrMrOrPrQr"r"r"r#r)^s	
$
r)c@steZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
ddd�Zddd�Zddd�Z
dd�ZeZdS)r	ajClass that implements a condition variable.

    A condition variable allows one or more threads to wait until they are
    notified by another thread.

    If the lock argument is given and not None, it must be a Lock or RLock
    object, and it is used as the underlying lock. Otherwise, a new RLock object
    is created and used as the underlying lock.

    NcCs�|dkrt�}||_|j|_|j|_z|j|_Wntk
rDYnXz|j|_Wntk
rfYnXz|j|_Wntk
r�YnXt�|_	dSrG)
r�_lockr?rFrP�AttributeErrorrOrQ�_deque�_waiters�r0�lockr"r"r#r1�s$zCondition.__init__cCs
|j��SrG)rUrTr/r"r"r#rT�szCondition.__enter__cGs|jj|�SrG)rUrM)r0r'r"r"r#rM�szCondition.__exit__cCsd|jt|j�fS)Nz<Condition(%s, %d)>)rU�lenrXr/r"r"r#r<�szCondition.__repr__cCs|j��dSrG)rUrFr/r"r"r#rP�szCondition._release_savecCs|j��dSrG)rUr?)r0�xr"r"r#rOszCondition._acquire_restorecCs"|j�d�r|j��dSdSdS)NrFT)rUr?rFr/r"r"r#rQs
zCondition._is_ownedcCs�|��std��t�}|��|j�|�|��}d}z>|dkrN|��d}n |dkrd|�d|�}n
|�d�}|W�S|�|�|s�z|j�|�Wnt	k
r�YnXXdS)akWait until notified or until a timeout occurs.

        If the calling thread has not acquired the lock when this method is
        called, a RuntimeError is raised.

        This method releases the underlying lock, and then blocks until it is
        awakened by a notify() or notify_all() call for the same condition
        variable in another thread, or until the optional timeout occurs. Once
        awakened or timed out, it re-acquires the lock and returns.

        When the timeout argument is present and not None, it should be a
        floating point number specifying a timeout for the operation in seconds
        (or fractions thereof).

        When the underlying lock is an RLock, it is not released using its
        release() method, since this may not actually unlock the lock when it
        was acquired multiple times recursively. Instead, an internal interface
        of the RLock class is used, which really unlocks it even when it has
        been recursively acquired several times. Another internal interface is
        then used to restore the recursion level when the lock is reacquired.

        zcannot wait on un-acquired lockFNTr)
rQrEr+r?rX�appendrPrO�remove�
ValueError)r0rA�waiterZsaved_stateZgotitr"r"r#�waits*

zCondition.waitcCsXd}|}|�}|sT|dk	rB|dkr.t�|}n|t�}|dkrBqT|�|�|�}q|S)z�Wait until a condition evaluates to True.

        predicate should be a callable which result will be interpreted as a
        boolean value.  A timeout may be provided giving the maximum time to
        wait.

        Nr)�_timera)r0Z	predicaterA�endtimeZwaittime�resultr"r"r#�wait_for>s

zCondition.wait_forr>c	Csf|��std��|j}tt||��}|s,dS|D]0}|��z|�|�Wq0tk
r^Yq0Xq0dS)aKWake up one or more threads waiting on this condition, if any.

        If the calling thread has not acquired the lock when this method is
        called, a RuntimeError is raised.

        This method wakes up at most n of the threads waiting for the condition
        variable; it is a no-op if no threads are waiting.

        z!cannot notify on un-acquired lockN)rQrErXrW�_islicerFr^r_)r0�nZall_waitersZwaiters_to_notifyr`r"r"r#�notifyUs
zCondition.notifycCs|�t|j��dS)z�Wake up all threads waiting on this condition.

        If the calling thread has not acquired the lock when this method
        is called, a RuntimeError is raised.

        N)rhr[rXr/r"r"r#�
notify_alllszCondition.notify_all)N)N)N)r>)rRr7r8rSr1rTrMr<rPrOrQrarerhriZ	notifyAllr"r"r"r#r	�s
	
0

	c@s8eZdZdZd
dd�Zddd�ZeZd	d
�Zdd�ZdS)raGThis class implements semaphore objects.

    Semaphores manage a counter representing the number of release() calls minus
    the number of acquire() calls, plus an initial value. The acquire() method
    blocks if necessary until it can return without making the counter
    negative. If not given, value defaults to 1.

    r>cCs&|dkrtd��tt��|_||_dS)Nrz$semaphore initial value must be >= 0)r_r	r�_cond�_value�r0�valuer"r"r#r1�szSemaphore.__init__TNc	Cs�|s|dk	rtd��d}d}|j�f|jdkrr|s4q�|dk	rd|dkrPt�|}n|t�}|dkrdq�|j�|�q$|jd8_d}W5QRX|S)a�Acquire a semaphore, decrementing the internal counter by one.

        When invoked without arguments: if the internal counter is larger than
        zero on entry, decrement it by one and return immediately. If it is zero
        on entry, block, waiting until some other thread has called release() to
        make it larger than zero. This is done with proper interlocking so that
        if multiple acquire() calls are blocked, release() will wake exactly one
        of them up. The implementation may pick one at random, so the order in
        which blocked threads are awakened should not be relied on. There is no
        return value in this case.

        When invoked with blocking set to true, do the same thing as when called
        without arguments, and return true.

        When invoked with blocking set to false, do not block. If a call without
        an argument would block, return false immediately; otherwise, do the
        same thing as when called without arguments, and return true.

        When invoked with a timeout other than None, it will block for at
        most timeout seconds.  If acquire does not complete successfully in
        that interval, return false.  Return true otherwise.

        Nz.can't specify timeout for non-blocking acquireFrr>T)r_rjrkrbra)r0r@rArCrcr"r"r#r?�s$

zSemaphore.acquirec	Cs.|j�|jd7_|j��W5QRXdS)z�Release a semaphore, incrementing the internal counter by one.

        When the counter is zero on entry and another thread is waiting for it
        to become larger than zero again, wake up that thread.

        r>N)rjrkrhr/r"r"r#rF�szSemaphore.releasecCs|��dSrGrHrIr"r"r#rM�szSemaphore.__exit__)r>)TN)	rRr7r8rSr1r?rTrFrMr"r"r"r#rxs

-c@s"eZdZdZddd�Zdd�ZdS)	ra�Implements a bounded semaphore.

    A bounded semaphore checks to make sure its current value doesn't exceed its
    initial value. If it does, ValueError is raised. In most situations
    semaphores are used to guard resources with limited capacity.

    If the semaphore is released too many times it's a sign of a bug. If not
    given, value defaults to 1.

    Like regular semaphores, bounded semaphores manage a counter representing
    the number of release() calls minus the number of acquire() calls, plus an
    initial value. The acquire() method blocks if necessary until it can return
    without making the counter negative. If not given, value defaults to 1.

    r>cCst�||�||_dSrG)rr1�_initial_valuerlr"r"r#r1�szBoundedSemaphore.__init__c	CsB|j�2|j|jkrtd��|jd7_|j��W5QRXdS)a6Release a semaphore, incrementing the internal counter by one.

        When the counter is zero on entry and another thread is waiting for it
        to become larger than zero again, wake up that thread.

        If the number of releases exceeds the number of acquires,
        raise a ValueError.

        z!Semaphore released too many timesr>N)rjrkrnr_rhr/r"r"r#rF�s

zBoundedSemaphore.releaseN)r>)rRr7r8rSr1rFr"r"r"r#r�s
c@sFeZdZdZdd�Zdd�Zdd�ZeZdd	�Zd
d�Z	dd
d�Z
dS)rz�Class implementing event objects.

    Events manage a flag that can be set to true with the set() method and reset
    to false with the clear() method. The wait() method blocks until the flag is
    true.  The flag is initially false.

    cCstt��|_d|_dS)NF)r	rrj�_flagr/r"r"r#r1�szEvent.__init__cCs|j�t��dSrG)rjr1rr/r"r"r#�_reset_internal_locks�szEvent._reset_internal_lockscCs|jS)z5Return true if and only if the internal flag is true.)ror/r"r"r#�is_setszEvent.is_setc	Cs&|j�d|_|j��W5QRXdS)z�Set the internal flag to true.

        All threads waiting for it to become true are awakened. Threads
        that call wait() once the flag is true will not block at all.

        TN)rjrorir/r"r"r#�setsz	Event.setc	Cs|j�d|_W5QRXdS)z�Reset the internal flag to false.

        Subsequently, threads calling wait() will block until set() is called to
        set the internal flag to true again.

        FN)rjror/r"r"r#�clearszEvent.clearNc
Cs8|j�(|j}|s|j�|�}|W5QR�SQRXdS)aHBlock until the internal flag is true.

        If the internal flag is true on entry, return immediately. Otherwise,
        block until another thread calls set() to set the flag to true, or until
        the optional timeout occurs.

        When the timeout argument is present and not None, it should be a
        floating point number specifying a timeout for the operation in seconds
        (or fractions thereof).

        This method returns the internal flag on exit, so it will always return
        True except if a timeout is given and the operation times out.

        N)rjrora)r0rAZsignaledr"r"r#ras
z
Event.wait)N)rRr7r8rSr1rprqZisSetrrrsrar"r"r"r#r�s

c@s�eZdZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Ze
dd��Ze
dd��Ze
dd��ZdS)rz�Implements a Barrier.

    Useful for synchronizing a fixed number of threads at known synchronization
    points.  Threads block on 'wait()' and are simultaneously awoken once they
    have all made that call.

    NcCs.tt��|_||_||_||_d|_d|_dS)aWCreate a barrier, initialised to 'parties' threads.

        'action' is a callable which, when supplied, will be called by one of
        the threads after they have all entered the barrier and just prior to
        releasing them all. If a 'timeout' is provided, it is used as the
        default for all subsequent 'wait()' calls.

        rN)r	rrj�_action�_timeout�_parties�_stater.)r0�parties�actionrAr"r"r#r1Fs	zBarrier.__init__c
Cs�|dkr|j}|j�r|��|j}|jd7_z6|d|jkrL|��n
|�|�|W�W5QR�S|jd8_|��XW5QRXdS)aNWait for the barrier.

        When the specified number of threads have started waiting, they are all
        simultaneously awoken. If an 'action' was provided for the barrier, one
        of the threads will have executed that callback prior to returning.
        Returns an individual index number from 0 to 'parties-1'.

        Nr>)rurj�_enterr.�_exitrv�_release�_wait)r0rA�indexr"r"r#raVs	

zBarrier.waitcCs6|jdkr|j��q|jdkr$t�|jdks2t�dS)N�r=r>r)rwrjrar�AssertionErrorr/r"r"r#rzts


zBarrier._entercCs>z"|jr|��d|_|j��Wn|���YnXdS)Nr>)rtrwrjri�_breakr/r"r"r#r|szBarrier._releasecsB�j��fdd�|�s"���t��jdkr0t��jdks>t�dS)Ncs
�jdkSr*�rwr"r/r"r#�<lambda>��zBarrier._wait.<locals>.<lambda>rr>)rjrer�rrwr��r0rAr"r/r#r}�s
z
Barrier._waitcCs(|jdkr$|jdkr$d|_|j��dS)Nrr)r.rwrjrir/r"r"r#r{�s

z
Barrier._exitc	CsT|j�D|jdkr6|jdkr$d|_q<|jdkr<d|_nd|_|j��W5QRXdS)z�Reset the barrier to the initial state.

        Any threads currently waiting will get the BrokenBarrier exception
        raised.

        rr=���N)rjr.rwrir/r"r"r#�reset�s


z
Barrier.resetc	Cs|j�|��W5QRXdS)z�Place the barrier into a 'broken' state.

        Useful in case of error.  Any currently waiting threads and threads
        attempting to 'wait()' will have BrokenBarrierError raised.

        N)rjr�r/r"r"r#�abort�sz
Barrier.abortcCsd|_|j��dS)Nr�)rwrjrir/r"r"r#r��szBarrier._breakcCs|jS)z:Return the number of threads required to trip the barrier.)rvr/r"r"r#rx�szBarrier.partiescCs|jdkr|jSdS)z>Return the number of threads currently waiting at the barrier.r)rwr.r/r"r"r#�	n_waiting�s
zBarrier.n_waitingcCs
|jdkS)z0Return True if the barrier is in a broken state.r�r�r/r"r"r#�broken�szBarrier.broken)NN)N)rRr7r8rSr1rarzr|r}r{r�r�r��propertyrxr�r�r"r"r"r#r=s 




c@seZdZdS)rN)rRr7r8r"r"r"r#r�s�	Thread-%dcCs
|t�SrG)�_counter)�templater"r"r#�_newname�sr�c@seZdZdZdZd:dd�dd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zer\dd�Z
dd�Zdd�Zdd�Zdd�Zd;dd�Zd<d"d#�Zed$d%��Zejd&d%��Zed'd(��Zer�ed)d*��Zd+d,�Zd-d.�Zed/d0��Zejd1d0��Zd2d3�Zd4d5�Zd6d7�Zd8d9�ZdS)=raA class that represents a thread of control.

    This class can be safely subclassed in a limited fashion. There are two ways
    to specify the activity: by passing a callable object to the constructor, or
    by overriding the run() method in a subclass.

    FNr"��daemoncCs�|dkstd��|dkri}||_t|p,t��|_||_||_|dk	rN||_n
t�j	|_d|_
trhd|_d|_
t�|_d|_d|_tj|_t�|_t�|�dS)aKThis constructor should always be called with keyword arguments. Arguments are:

        *group* should be None; reserved for future extension when a ThreadGroup
        class is implemented.

        *target* is the callable object to be invoked by the run()
        method. Defaults to None, meaning nothing is called.

        *name* is the thread name. By default, a unique name is constructed of
        the form "Thread-N" where N is a small decimal number.

        *args* is the argument tuple for the target invocation. Defaults to ().

        *kwargs* is a dictionary of keyword arguments for the target
        invocation. Defaults to {}.

        If a subclass overrides the constructor, it must make sure to invoke
        the base class constructor (Thread.__init__()) before doing anything
        else to the thread.

        Nz#group argument must be None for nowFT)r��_target�strr��_name�_args�_kwargs�	_daemonicr
r��_ident�_HAVE_THREAD_NATIVE_ID�
_native_id�_tstate_lockr�_started�_is_stopped�_initialized�_sys�stderr�_stderr�_make_invoke_excepthook�_invoke_excepthook�	_dangling�add)r0�group�targetr4r'r(r�r"r"r#r1�s(
zThread.__init__cCs(|j��|r|��nd|_d|_dS�NT)r�rp�_set_tstate_lockr�r�)r0�is_aliver"r"r#rp(s


zThread._reset_internal_lockscCsl|jstd��d}|j��r d}|��|jr2d}|jr@|d7}|jdk	rX|d|j7}d|jj	|j
|fS)Nz Thread.__init__() was not called�initialZstartedZstoppedz daemonz %sz<%s(%s, %s)>)r�r�r�rqr�r�r�r�r6rRr�)r0Zstatusr"r"r#r<4s

zThread.__repr__cCs�|jstd��|j��r td��t�|t|<W5QRXzt|jd�Wn,tk
rtt�t|=W5QRX�YnX|j�	�dS)a-Start the thread's activity.

        It must be called at most once per thread object. It arranges for the
        object's run() method to be invoked in a separate thread of control.

        This method will raise a RuntimeError if called more than once on the
        same thread object.

        zthread.__init__() not calledz threads can only be started oncer"N)
r�rEr�rq�_active_limbo_lock�_limbo�_start_new_thread�
_bootstrap�	Exceptionrar/r"r"r#�startBs

zThread.startcCs.z|jr|j|j|j�W5|`|`|`XdS)aXMethod representing the thread's activity.

        You may override this method in a subclass. The standard run() method
        invokes the callable object passed to the object's constructor as the
        target argument, if any, with sequential and keyword arguments taken
        from the args and kwargs arguments, respectively.

        N)r�r�r�r/r"r"r#�run[s	z
Thread.runcCs4z|��Wn"|jr(tdkr(YdS�YnXdSrG)�_bootstrap_innerr�r�r/r"r"r#r�ls
zThread._bootstrapcCst�|_dSrG)rr�r/r"r"r#�
_set_ident�szThread._set_identcCst�|_dSrG)rr�r/r"r"r#�_set_native_id�szThread._set_native_idc	Cs8t�|_|j��|js4t�t�|j�W5QRXdS)z�
        Set a lock object which will be released by the interpreter when
        the underlying thread state (see pystate.h) gets deleted.
        N)�
_set_sentinelr�r?r��_shutdown_locks_lock�_shutdown_locksr�r/r"r"r#r��s

zThread._set_tstate_lockcCs�z�|��|��tr|��|j��t�|t|j	<t
|=W5QRXtrVt�
t�trdt�t�z|��Wn|�|�YnXW5t� ztt�=WnYnXW5QRXXdSrG)r�r3rr�r�r�r�r�rrr�r�r$r�rrrr�r�r/r"r"r#r��s,



zThread._bootstrap_innerc	CsJ|j}|dk	r|��rt�d|_d|_|jsFt�t�|�W5QRXdSr�)r�r2r�r�r�r�r��discardrYr"r"r#�_stop�szThread._stopc	Cst�tt�=W5QRXdS)zARemove current thread from the dict of currently running threads.N)r�r3rr/r"r"r#�_delete�szThread._deletecCsZ|jstd��|j��s td��|t�kr2td��|dkrD|��n|jt|d�d�dS)aWait until the thread terminates.

        This blocks the calling thread until the thread whose join() method is
        called terminates -- either normally or through an unhandled exception
        or until the optional timeout occurs.

        When the timeout argument is present and not None, it should be a
        floating point number specifying a timeout for the operation in seconds
        (or fractions thereof). As join() always returns None, you must call
        is_alive() after join() to decide whether a timeout happened -- if the
        thread is still alive, the join() call timed out.

        When the timeout argument is not present or None, the operation will
        block until the thread terminates.

        A thread can be join()ed many times.

        join() raises a RuntimeError if an attempt is made to join the current
        thread as that would cause a deadlock. It is also an error to join() a
        thread before it has been started and attempts to do so raises the same
        exception.

        �Thread.__init__() not calledz'cannot join thread before it is startedzcannot join current threadNr)rA)r�rEr�rqr
�_wait_for_tstate_lock�maxr�r"r"r#�join�s


zThread.joinTr=cCs:|j}|dkr|js6t�n|�||�r6|��|��dSrG)r�r�r�r?rFr�)r0�blockrArZr"r"r#r��szThread._wait_for_tstate_lockcCs|jstd��|jS)z�A string used for identification purposes only.

        It has no semantics. Multiple threads may be given the same name. The
        initial name is set by the constructor.

        r�)r�r�r�r/r"r"r#r4szThread.namecCs|jstd��t|�|_dS)Nr�)r�r�r�r��r0r4r"r"r#r4scCs|jstd��|jS)a4Thread identifier of this thread or None if it has not been started.

        This is a nonzero integer. See the get_ident() function. Thread
        identifiers may be recycled when a thread exits and another thread is
        created. The identifier is available even after the thread has exited.

        r�)r�r�r�r/r"r"r#�idents	zThread.identcCs|jstd��|jS)z�Native integral thread ID of this thread, or None if it has not been started.

            This is a non-negative integer. See the get_native_id() function.
            This represents the Thread ID as reported by the kernel.

            r�)r�r�r�r/r"r"r#�	native_id$szThread.native_idcCs4|jstd��|js|j��s"dS|�d�|jS)z�Return whether the thread is alive.

        This method returns True just before the run() method starts until just
        after the run() method terminates. The module function enumerate()
        returns a list of all alive threads.

        r�F)r�r�r�r�rqr�r/r"r"r#r�/s

zThread.is_alivecCs ddl}|jdtdd�|��S)zhReturn whether the thread is alive.

        This method is deprecated, use is_alive() instead.
        rNz/isAlive() is deprecated, use is_alive() instead�)�
stacklevel)�warnings�warn�DeprecationWarningr�)r0r�r"r"r#�isAlive=s�zThread.isAlivecCs|jstd��|jS)a�A boolean value indicating whether this thread is a daemon thread.

        This must be set before start() is called, otherwise RuntimeError is
        raised. Its initial value is inherited from the creating thread; the
        main thread is not a daemon thread and therefore all threads created in
        the main thread default to daemon = False.

        The entire Python program exits when only daemon threads are left.

        r�)r�r�r�r/r"r"r#r�Gsz
Thread.daemoncCs*|jstd��|j��r td��||_dS)Nr�z)cannot set daemon status of active thread)r�rEr�rqr��r0Zdaemonicr"r"r#r�Vs

cCs|jSrGr�r/r"r"r#�isDaemon^szThread.isDaemoncCs
||_dSrGr�r�r"r"r#�	setDaemonaszThread.setDaemoncCs|jSrG�r4r/r"r"r#�getNamedszThread.getNamecCs
||_dSrGr�r�r"r"r#�setNamegszThread.setName)NNNr"N)N)Tr=) rRr7r8rSr�r1rpr<r�r�r�r�r�r�r�r�r�r�r�r�r�r4�setterr�r�r�r�r�r�r�r�r�r"r"r"r#r�sR��/	
&









)�_excepthook�_ExceptHookArgs)�print_exception)�
namedtuplez'exc_type exc_value exc_traceback threadcCst|�SrG)r�)r'r"r"r#rwscCs�|jtkrdStdk	r(tjdk	r(tj}n$|jdk	rH|jj}|dkrLdSndS|jdk	r`|jj}nt�}td|�d�|dd�t	|j|j
|j|d�|��dS)z9
        Handle uncaught Thread.run() exception.
        NzException in thread �:T��file�flush)r�)
�exc_type�
SystemExitr�r��threadr�r4r�print�_print_exception�	exc_value�
exc_tracebackr�)r'r�r4r"r"r#rzs(



��csPt�tj��dkrtd���dkr*td��tj�t�t������fdd�}|S)Nzthreading.excepthook is Nonezsys.excepthook is Nonec
s�z�z,t}|dkr�}t��|f��}||�Wn�tk
r�}zbd|_~�dk	rb�jdk	rb�j}n|j}�d|dd��dk	r��jdk	r��j}n�}|���W5d}~XYnXW5d}XdS)NTz"Exception in threading.excepthook:r�)rrr��__suppress_context__r�r�)r�r'�hook�excr�Zsys_excepthook�Zlocal_printZ	local_sysZold_excepthookZold_sys_excepthookZsys_exc_infor"r#�invoke_excepthook�s*� z2_make_invoke_excepthook.<locals>.invoke_excepthook)rr�rE�exc_infor�)r�r"r�r#r��s r�c@s*eZdZdZd	dd�Zdd�Zdd�ZdS)
rz�Call a function after a specified number of seconds:

            t = Timer(30.0, f, args=None, kwargs=None)
            t.start()
            t.cancel()     # stop the timer's action if it's still waiting

    NcCsFt�|�||_||_|dk	r"|ng|_|dk	r4|ni|_t�|_dSrG)rr1�interval�functionr'r(r�finished)r0r�r�r'r(r"r"r#r1�s
zTimer.__init__cCs|j��dS)z)Stop the timer if it hasn't finished yet.N)r�rrr/r"r"r#�cancel�szTimer.cancelcCs6|j�|j�|j��s(|j|j|j�|j��dSrG)r�rar�rqr�r'r(rrr/r"r"r#r��s
z	Timer.run)NN)rRr7r8rSr1r�r�r"r"r"r#r�s
c@seZdZdd�ZdS)�_MainThreadc	CsTtj|ddd�|��|j��|��tr6|��t�|t	|j
<W5QRXdS)NZ
MainThreadF�r4r�)rr1r�r�rrr�r�r�r�r3r�r/r"r"r#r1�s
z_MainThread.__init__N)rRr7r8r1r"r"r"r#r��sr�c@s.eZdZdd�Zdd�Zdd�Zd
dd	�ZdS)�_DummyThreadc	CsPtj|td�dd�|j��|��tr2|��t�|t	|j
<W5QRXdS)NzDummy-%dTr�)rr1r�r�rrr�r�r�r�r3r�r/r"r"r#r1s
z_DummyThread.__init__cCsdSrGr"r/r"r"r#r�
sz_DummyThread._stopcCs|js|j��st�dSr�)r�r�rqr�r/r"r"r#r�sz_DummyThread.is_aliveNcCsdstd��dS)NFzcannot join a dummy thread)r�r�r"r"r#r�sz_DummyThread.join)N)rRr7r8r1r�r�r�r"r"r"r#r�s
r�cCs,ztt�WStk
r&t�YSXdS)z�Return the current Thread object, corresponding to the caller's thread of control.

    If the caller's thread of control was not created through the threading
    module, a dummy thread object with limited functionality is returned.

    N)r3rr5r�r"r"r"r#r
sc
Cs,t�tt�tt�W5QR�SQRXdS)z�Return the number of Thread objects currently alive.

    The returned count is equal to the length of the list returned by
    enumerate().

    N)r�r[r3r�r"r"r"r#r(scCstt���tt���SrG)�listr3�valuesr�r"r"r"r#�
_enumerate4sr�c
Cs4t�&tt���tt���W5QR�SQRXdS)z�Return a list of all Thread objects currently alive.

    The list includes daemonic threads, dummy thread objects created by
    current_thread(), and the main thread. It excludes terminated threads and
    threads that have not yet been started.

    N)r�r�r3r�r�r"r"r"r#r8s)rc	Cs~tjr
dStj}|dk	st�|��s(t�|��t��t�tt	�}t	�
�W5QRX|s^qz|D]}|��|��qbq8dS)zS
    Wait until the Python thread state of all non-daemon threads get deleted.
    N)�_main_threadr�r�r�r2rFr�r�r�r�rsr?)ZtlockZlocksrZr"r"r#�	_shutdownKs	r�cCstS)z�Return the main thread object.

    In normal conditions, the main thread is the thread from which the
    Python interpreter was started.
    )r�r"r"r"r#rss)�_local)rc	Cs�t�ai}ztt�}Wntk
r2t�}YnX|at�at�a	t��tt
��}|�t�|D]>}||kr�|�
d�t�}||_|||<qb|�
d�|��qbt��t��t�|�tt�dks�t�W5QRXdS)zL
    Cleanup threading module state that should not exist after a fork.
    TFr>N)r+r�r3rr5r�r�r�rrr�r��updater�rpr�r�r�rsr[r�)Z
new_activeZcurrentZthreadsr�r�r"r"r#�_after_fork�s0






r��register_at_fork)Zafter_in_child)r�)ZrS�os�_os�sysr��_thread�timerrbZ_weakrefsetr�	itertoolsrrfrr.�_collectionsrrW�ImportError�collections�__all__�start_new_threadr��
allocate_lockr+r�rrr�r]rV�errorrrr%r
rr$rrrr)r&r	rrrrrEr�__next__r�r�r�r3r�r�r�rrr�rr�rr�r�	tracebackr�r�r�r�rr�r�r
Z
currentThreadrZactiveCountr�rrr�r�rr�rZ_threading_localr��hasattrr�r"r"r"r#�<module>s��




q'P&O
�5
(5__pycache__/symtable.cpython-38.opt-2.pyc000064400000024315151153537570014205 0ustar00U

e5dU�	@sFddlZddlmZmZmZmZmZmZmZmZm	Z	m
Z
mZmZm
Z
mZmZddlZdddddgZdd�ZGd	d
�d
�Ze�ZGdd�d�ZGdd�de�ZGd
d�de�ZGdd�d�Zedk�rBddlZddlZeejd��Ze��Z W5QRXee ej!�"ejd�dd�Z#e#�$�D]$Z%e#�&e%�Z'e(e'e'�)�e'�*���qdS)�N)�USE�
DEF_GLOBAL�DEF_NONLOCAL�	DEF_LOCAL�	DEF_PARAM�
DEF_IMPORT�	DEF_BOUND�	DEF_ANNOT�	SCOPE_OFF�
SCOPE_MASK�FREE�LOCAL�GLOBAL_IMPLICIT�GLOBAL_EXPLICIT�CELL�symtable�SymbolTable�Class�Function�SymbolcCst�|||�}t||�S�N)�	_symtabler�_newSymbolTable)�code�filenameZcompile_type�top�r� /usr/lib64/python3.8/symtable.pyrsc@s$eZdZdd�Zdd�Zdd�ZdS)�SymbolTableFactorycCst��|_dSr)�weakrefZWeakValueDictionary�_SymbolTableFactory__memo��selfrrr�__init__szSymbolTableFactory.__init__cCs6|jtjkrt||�S|jtjkr,t||�St||�Sr)�typer�
TYPE_FUNCTIONr�
TYPE_CLASSrr)r"�tablerrrr�news


zSymbolTableFactory.newcCs8||f}|j�|d�}|dkr4|�||�}|j|<|Sr)r �getr()r"r'r�key�objrrr�__call__s
zSymbolTableFactory.__call__N)�__name__�
__module__�__qualname__r#r(r,rrrrrsrc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZdS) rcCs||_||_i|_dSr)�_table�	_filename�_symbols)r"Z	raw_tablerrrrr#'szSymbolTable.__init__cCsN|jtkrd}nd|jj}|jjdkr6d�||j�Sd�||jj|j�SdS)N�z%s rz<{0}SymbolTable for module {1}>z<{0}SymbolTable for {1} in {2}>)�	__class__rr-r0�name�formatr1)r"Zkindrrr�__repr__,s
�zSymbolTable.__repr__cCs:|jjtjkrdS|jjtjkr$dS|jjtjkr6dSdS)N�moduleZfunction�class)r0r$rZTYPE_MODULEr%r&r!rrr�get_type9szSymbolTable.get_typecCs|jjSr)r0�idr!rrr�get_idCszSymbolTable.get_idcCs|jjSr)r0r5r!rrr�get_nameFszSymbolTable.get_namecCs|jjSr)r0�linenor!rrr�
get_linenoIszSymbolTable.get_linenocCst|jjtjk�Sr)�boolr0r$rr%r!rrr�is_optimizedLszSymbolTable.is_optimizedcCst|jj�Sr)r@r0�nestedr!rrr�	is_nestedOszSymbolTable.is_nestedcCst|jj�Sr)r@r0�childrenr!rrr�has_childrenRszSymbolTable.has_childrencCsdS)NFrr!rrr�has_execUszSymbolTable.has_execcCs|jj��Sr)r0�symbols�keysr!rrr�get_identifiersYszSymbolTable.get_identifierscCsT|j�|�}|dkrP|jj|}|�|�}|jjdk}t||||d�}|j|<|S)Nr��module_scope)r2r)r0rG�_SymbolTable__check_childrenr5r)r"r5Zsym�flags�
namespacesrKrrr�lookup\s
�zSymbolTable.lookupcs�fdd����D�S)Ncsg|]}��|��qSr)rO��.0�identr!rr�
<listcomp>gsz+SymbolTable.get_symbols.<locals>.<listcomp>)rIr!rr!r�get_symbolsfszSymbolTable.get_symbolscs��fdd��jjD�S)Ncs"g|]}|j�krt|�j��qSr)r5rr1�rQ�st�r5r"rrrSjs
�z0SymbolTable.__check_children.<locals>.<listcomp>�r0rD)r"r5rrWrZ__check_childrenis�zSymbolTable.__check_childrencs�fdd��jjD�S)Ncsg|]}t|�j��qSr)rr1rUr!rrrSos�z,SymbolTable.get_children.<locals>.<listcomp>rXr!rr!r�get_childrenns
�zSymbolTable.get_childrenN)r-r.r/r#r7r:r<r=r?rArCrErFrIrOrTrLrYrrrrr%s


c@sPeZdZdZdZdZdZdZdd�Zdd�Z	dd�Z
dd	�Zd
d�Zdd
�Z
dS)rNcst��fdd����D��S)Nc3s"|]}��jj|�r|VqdSr)r0rGrP�r"Z	test_funcrr�	<genexpr>}s�z-Function.__idents_matching.<locals>.<genexpr>)�tuplerIrZrrZrZ__idents_matching|szFunction.__idents_matchingcCs |jdkr|�dd��|_|jS)NcSs|t@Sr)r��xrrr�<lambda>��z)Function.get_parameters.<locals>.<lambda>)�_Function__params�_Function__idents_matchingr!rrr�get_parameters�s
zFunction.get_parameterscs0|jdkr*ttf��fdd�}|�|�|_|jS)Ncs|t?t@�kSr�r
rr]�Zlocsrrr_�r`z%Function.get_locals.<locals>.<lambda>)�_Function__localsr
rrb�r"Ztestrrer�
get_locals�s

zFunction.get_localscs0|jdkr*ttf��fdd�}|�|�|_|jS)Ncs|t?t@�kSrrdr]�Zglobrrr_�r`z&Function.get_globals.<locals>.<lambda>)�_Function__globalsrrrbrgrrir�get_globals�s

zFunction.get_globalscCs |jdkr|�dd��|_|jS)NcSs|t@Sr)rr]rrrr_�r`z(Function.get_nonlocals.<locals>.<lambda>)�_Function__nonlocalsrbr!rrr�
get_nonlocals�s
zFunction.get_nonlocalscCs$|jdkrdd�}|�|�|_|jS)NcSs|t?t@tkSr)r
rrr]rrrr_�r`z$Function.get_frees.<locals>.<lambda>)�_Function__freesrb)r"�is_freerrr�	get_frees�s
zFunction.get_frees)r-r.r/rarfrnrjrlrbrcrhrkrmrprrrrrssc@seZdZdZdd�ZdS)rNcCs6|jdkr0i}|jjD]}d||j<qt|�|_|jS)N�)�_Class__methodsr0rDr5r\)r"�drVrrr�get_methods�s

zClass.get_methods)r-r.r/rrrtrrrrr�sc@s�eZdZd$dd�dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd d!�Zd"d#�ZdS)%rNFrJcCs.||_||_|t?t@|_|p d|_||_dS)Nr)�
_Symbol__name�_Symbol__flagsr
r�_Symbol__scope�_Symbol__namespaces�_Symbol__module_scope)r"r5rMrNrKrrrr#�s

zSymbol.__init__cCsd�|j�S)Nz<symbol {0!r}>)r6rur!rrrr7�szSymbol.__repr__cCs|jSr)rur!rrrr=�szSymbol.get_namecCst|jtj@�Sr)r@rvrrr!rrr�
is_referenced�szSymbol.is_referencedcCst|jt@�Sr)r@rvrr!rrr�is_parameter�szSymbol.is_parametercCs"t|jttfkp|jo|jt@�Sr)r@rwrrryrvrr!rrr�	is_global�s�zSymbol.is_globalcCst|jt@�Sr)r@rvrr!rrr�is_nonlocal�szSymbol.is_nonlocalcCst|jtk�Sr)r@rwrr!rrr�is_declared_global�szSymbol.is_declared_globalcCs"t|jttfkp|jo|jt@�Sr)r@rwr
rryrvrr!rrr�is_local�s�zSymbol.is_localcCst|jt@�Sr)r@rvr	r!rrr�is_annotated�szSymbol.is_annotatedcCst|jtk�Sr)r@rwrr!rrrro�szSymbol.is_freecCst|jt@�Sr)r@rvrr!rrr�is_imported�szSymbol.is_importedcCst|jt@�Sr)r@rvrr!rrr�is_assigned�szSymbol.is_assignedcCs
t|j�Sr)r@rxr!rrr�is_namespace�szSymbol.is_namespacecCs|jSr)rxr!rrr�get_namespaces�szSymbol.get_namespacescCs t|j�dkrtd��|jdS)Nrqz$name is bound to multiple namespacesr)�lenrx�
ValueErrorr!rrr�
get_namespace�szSymbol.get_namespace)N)r-r.r/r#r7r=rzr{r|r}r~rr�ror�r�r�r�r�rrrrr�s 
�__main__rq�exec)+rrrrrrrrr	r
rrr
rrrr�__all__rrrrrrrr-�os�sys�open�argv�f�read�src�path�split�modrIrRrO�info�printrr�rrrr�<module>s$DN,
M

__pycache__/ftplib.cpython-38.opt-2.pyc000064400000043447151153537570013654 0ustar00U

e5d9��@sRddlZddlZddlmZddddddgZd	Zd
ZdZGdd
�d
e�ZGdd�de�Z	Gdd�de�Z
Gdd�de�ZGdd�de�Zee
efZdZdZGdd�d�ZzddlZWnek
r�dZYn0XejZGdd�de�Ze�d�ee
eejfZdadd�Zdadd�Zdd�Zdd�Zdd �Z d(d#d$�Z!d%d&�Z"e#d'k�rNe"�dS))�N)�_GLOBAL_DEFAULT_TIMEOUT�FTP�error_reply�
error_temp�
error_perm�error_proto�
all_errors��� c@seZdZdS)�ErrorN��__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/ftplib.pyr9src@seZdZdS)rNr
rrrrr:sc@seZdZdS)rNr
rrrrr;sc@seZdZdS)rNr
rrrrr<sc@seZdZdS)rNr
rrrrr=s�
s
c@s�eZdZdZdZeZeZdZ	dZ
dZdZdZ
dZddddedfdd�Zd	d
�Zdd�Zd[dd�Zdd�Zdd�ZeZdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Z d(d)�Z!d*d+�Z"d,d-�Z#d.d/�Z$d0d1�Z%d\d2d3�Z&d]d4d5�Z'd^d6d7�Z(d_d9d:�Z)d`d;d<�Z*dad=d>�Z+dbd?d@�Z,dAdB�Z-dCdD�Z.dEdF�Z/dgfdGdH�Z0dIdJ�Z1dKdL�Z2dMdN�Z3dOdP�Z4dQdR�Z5dSdT�Z6dUdV�Z7dWdX�Z8dYdZ�Z9dS)crr�Nr	zlatin-1FcCs0||_||_|r,|�|�|r,|�|||�dS�N)�source_address�timeout�connect�login)�self�host�user�passwd�acctrrrrr�__init__rs
zFTP.__init__cCs|Srr�rrrr�	__enter__{sz
FTP.__enter__c	GsN|jdk	rJz*z|��Wnttfk
r0YnXW5|jdk	rH|��XdSr)�sock�close�quit�OSError�EOFError)r�argsrrr�__exit__s


zFTP.__exit__����cCs�|dkr||_|dkr||_|dkr*||_|dk	r8||_t�d||j|j�tj|j|jf|j|jd�|_|jj	|_
|jjd|jd�|_
|��|_|jS)Nrrr)zftplib.connect�r�r��encoding)r�portrr�sys�audit�socket�create_connectionr"�family�af�makefiler-�file�getresp�welcome)rrr.rrrrrr�s �

zFTP.connectcCs|jrtd|�|j��|jS)Nz	*welcome*)�	debugging�print�sanitizer8r rrr�
getwelcome�szFTP.getwelcomecCs
||_dSr)r9)r�levelrrr�set_debuglevel�szFTP.set_debuglevelcCs
||_dSr)�
passiveserver)r�valrrr�set_pasv�szFTP.set_pasvcCsJ|dd�dkrBt|�d��}|dd�d|d||d�}t|�S)N�>�PASS �pass r�*)�len�rstrip�repr)r�s�irrrr;�s$zFTP.sanitizecCs`d|ksd|krtd��t�d||�|t}|jdkrHtd|�|��|j�|�	|j
��dS)N�
�
z4an illegal newline character should not be containedzftplib.sendcmdr	z*put*)�
ValueErrorr/r0�CRLFr9r:r;r"�sendall�encoder-�r�linerrr�putline�s
zFTP.putlinecCs$|jrtd|�|��|�|�dS)Nz*cmd*)r9r:r;rSrQrrr�putcmd�sz
FTP.putcmdcCs�|j�|jd�}t|�|jkr.td|j��|jdkrHtd|�|��|sPt�|dd�t	krn|dd�}n|dd�t	kr�|dd�}|S)Nr	�got more than %d bytesz*get*������)
r6�readline�maxlinerFrr9r:r;r&rNrQrrr�getline�s
zFTP.getlinecCs`|��}|dd�dkr\|dd�}|��}|d|}|dd�|kr$|dd�dkr$q\q$|S)N���-rL)rZ)rrR�codeZnextlinerrr�getmultiline�s�zFTP.getmultilinecCsp|��}|jrtd|�|��|dd�|_|dd�}|dkrD|S|dkrTt|��|dkrdt|��t|��dS)Nz*resp*r[r	>�1�3�2�4�5)r_r9r:r;Zlastresprrr)r�resp�crrrr7�szFTP.getrespcCs$|��}|dd�dkr t|��|S)Nr	rb)r7r�rrerrr�voidresp�szFTP.voidrespcCsTdt}|jdkr"td|�|��|j�|t�|��}|dd�dkrPt|��|S)N�ABORr	z*put urgent*r[��225�426�226)	�B_CRLFr9r:r;r"rO�MSG_OOBr_r�rrRrerrr�aborts
z	FTP.abortcCs|�|�|��Sr)rTr7�r�cmdrrr�sendcmds
zFTP.sendcmdcCs|�|�|��Sr)rTrhrrrrr�voidcmds
zFTP.voidcmdcCsB|�d�}t|d�t|d�g}||}dd�|�}|�|�S)N�.�zPORT �,)�splitrH�joinru)rrr.ZhbytesZpbytes�bytesrsrrr�sendports

zFTP.sendportcCsbd}|jtjkrd}|jtjkr$d}|dkr4td��dt|�|t|�dg}dd�|�}|�|�S)Nrr	�zunsupported address familyrzEPRT �|)r4r1�AF_INETZAF_INET6rrHrzru)rrr.r4Zfieldsrsrrr�sendeprt&szFTP.sendeprtcCsltjd|jdd�}|��d}|j��d}|jtjkrF|�||�}n|�||�}|jt	k	rh|�
|j�|S)N)rrr	)r3Zbacklogr)r1Z
create_serverr4Zgetsocknamer"rr|r�rr�
settimeout)rr"r.rrerrr�makeport3s
zFTP.makeportcCs\|jtjkr:t|�d��\}}|jr*|}qT|j��d}nt|�d�|j���\}}||fS)N�PASVrZEPSV)	r4r1r�parse227rt�trust_server_pasv_ipv4_addressr"Zgetpeername�parse229)rZuntrusted_hostr.rrrr�makepasv@szFTP.makepasvc
	Cs6d}|jr�|��\}}tj||f|j|jd�}zL|dk	rF|�d|�|�|�}|ddkrd|��}|ddkrxt|��Wn|�	��YnXn�|�
��r}|dk	r�|�d|�|�|�}|ddkr�|��}|ddkr�t|��|��\}}	|jtk	�r
|�
|j�W5QRX|dd�dk�r.t|�}||fS)Nr*zREST %srrbr`r[�150)r?r�r1r2rrrtr7rr#r�Zacceptrr��parse150)
rrs�rest�sizerr.�connrer"Zsockaddrrrr�ntransfercmdLs>�



zFTP.ntransfercmdcCs|�||�dS)Nr)r�)rrsr�rrr�transfercmd�szFTP.transfercmdcCs�|sd}|sd}|sd}|dkr0|dkr0|d}|�d|�}|ddkrX|�d|�}|ddkrr|�d	|�}|dd
kr�t|��|S)NZ	anonymousr>rr]z
anonymous@zUSER rrarC�ACCT rb�rtr)rrrrrerrrr�s z	FTP.loginrc	Cs^|�d�|�||��:}|�|�}|s(q2||�qtdk	rLt|t�rL|��W5QRX|��S�NzTYPE I)rur�Zrecv�
_SSLSocket�
isinstance�unwraprh)rrs�callback�	blocksizer�r��datarrr�
retrbinary�s


zFTP.retrbinaryc
Cs�|dkrt}|�d�}|�|���}|jd|jd���}|�|jd�}t|�|jkr`td|j��|j	dkrxt
dt|��|s~q�|dd�tkr�|dd�}n|d	d�d
kr�|dd	�}||�q4t
dk	r�t|t
�r�|��W5QRXW5QRX|��S)N�TYPE Ar+r,r	rUr}z*retr*rVrWrL)�
print_linertr�r5r-rXrYrFrr9r:rHrNr�r�r�rh)rrsr�rer��fprRrrr�	retrlines�s,
�

z
FTP.retrlinesc	Csl|�d�|�||��H}|�|�}|s(q@|�|�|r||�qtdk	rZt|t�rZ|��W5QRX|��Sr�)rur��readrOr�r�r�rh)rrsr�r�r�r�r��bufrrr�
storbinary�s



zFTP.storbinaryc	Cs�|�d�|�|���}|�|jd�}t|�|jkrBtd|j��|sHq�|dd�tkrx|dtkrp|dd�}|t}|�|�|r||�qtdk	r�t	|t�r�|�
�W5QRX|��S)Nr�r	rUrVrW)rur�rXrYrFrrnrOr�r�r�rh)rrsr�r�r�r�rrr�	storlines�s"


z
FTP.storlinescCsd|}|�|�S)Nr��ru)rZpasswordrsrrrrszFTP.acctcGs0d}|D]}|d|}qg}|�||j�|S)NZNLST� )r��append)rr'rs�arg�filesrrr�nlstszFTP.nlstcGshd}d}|dd�r>t|d�td�kr>|dd�|d}}|D]}|rB|d|}qB|�||�dS)NZLISTrWrr�)�typer�)rr'rs�funcr�rrr�dir(s zFTP.dirc
cs�|r|�dd�|�d�|r*d|}nd}g}|�||j�|D]\}|�t��d�\}}}i}	|dd��d�D] }
|
�d�\}}}||	|��<qt||	fVqDdS)Nz
OPTS MLST �;zMLSD %sZMLSDr�rW�=)	rtrzr�r�rGrN�	partitionry�lower)
r�pathZfactsrs�linesrRZfacts_found�_�name�entryZfact�key�valuerrr�mlsd7s
zFTP.mlsdcCs0|�d|�}|ddkr"t|��|�d|�S)NzRNFR rrazRNTO )rtrru)rZfromnameZtonamererrr�renameSsz
FTP.renamecCs.|�d|�}|dd�dkr"|St|��dS)NzDELE r[>�250�200r�)r�filenamererrr�deleteZsz
FTP.deletec
Csp|dkrRz|�d�WStk
rN}z|jddd�dkr>�W5d}~XYq^Xn|dkr^d}d|}|�|�S)	Nz..ZCDUPrr[�500rrvzCWD )rurr')r�dirname�msgrsrrr�cwdbszFTP.cwdcCs:|�d|�}|dd�dkr6|dd���}t|�SdS)NzSIZE r[Z213)rt�strip�int)rr�rerIrrrr�oszFTP.sizecCs$|�d|�}|�d�sdSt|�S)NzMKD �257r�ru�
startswith�parse257)rr�rerrr�mkdws
zFTP.mkdcCs|�d|�S)NzRMD r�)rr�rrr�rmd�szFTP.rmdcCs |�d�}|�d�sdSt|�S)NZPWDr�rr�rgrrr�pwd�s

zFTP.pwdcCs|�d�}|��|S)NZQUIT)rur#rgrrrr$�s
zFTP.quitcCsDz |j}d|_|dk	r|��W5|j}d|_|dk	r>|��XdSr)r"r#r6)rr"r6rrrr#�sz	FTP.close)rrr)N)N)N)rrr)rN)N)rNN)N):rrrr9r�FTP_PORTr.�MAXLINErYr"r6r8r?r-r�rrr!r(rr<r>�debugrAr;rSrTrZr_r7rhrqrtrur|r�r�r�r�r�rr�r�r�r�rr�r�r�r�r�r�r�r�r�r�r$r#rrrrrJsn�
	






7



#

	
		c	@sjeZdZejZdddddddedf	dd�Zddd�Zdd	�Z	d
d�Z
dd
�Zdd�Zddd�Z
dd�ZdS)�FTP_TLSrNc
	Cs�|dk	r|dk	rtd��|dk	r0|dk	r0td��|dk	s@|dk	rVddl}
|
�dtd�||_||_|dkr|tj|j||d�}||_	d|_
t�|||||||	�dS)Nz4context and keyfile arguments are mutually exclusivez5context and certfile arguments are mutually exclusiverzAkeyfile and certfile are deprecated, use a custom context insteadr})�certfile�keyfileF)
rM�warnings�warn�DeprecationWarningr�r��sslZ_create_stdlib_context�ssl_version�context�_prot_prr)rrrrrr�r�r�rrr�rrrr�s(��zFTP_TLS.__init__TcCs*|rt|jtj�s|��t�||||�Sr)r�r"r��	SSLSocket�authrr)rrrrZsecurerrrr�sz
FTP_TLS.logincCsft|jtj�rtd��|jtjkr.|�d�}n
|�d�}|jj	|j|j
d�|_|jjd|jd�|_
|S)NzAlready using TLSzAUTH TLSzAUTH SSL�Zserver_hostnamer+)�moder-)r�r"r�r�rMr�ZPROTOCOL_TLSrur��wrap_socketrr5r-r6rgrrrr��s

�zFTP_TLS.authcCs0t|jtj�std��|�d�}|j��|_|S)Nz
not using TLSZCCC)r�r"r�r�rMrur�rgrrr�ccc�s

zFTP_TLS.ccccCs|�d�|�d�}d|_|S)NzPBSZ 0zPROT PT�rur�rgrrr�prot_p�s

zFTP_TLS.prot_pcCs|�d�}d|_|S)NzPROT CFr�rgrrr�prot_cs
zFTP_TLS.prot_ccCs2t�|||�\}}|jr*|jj||jd�}||fS)Nr�)rr�r�r�r�r)rrsr�r�r�rrrr�s�zFTP_TLS.ntransfercmdcCs8dt}|j�|�|��}|dd�dkr4t|��|S)Nrir[rj)rnr"rOr_rrprrrrqsz
FTP_TLS.abort)rrrT)N)rrrr�ZPROTOCOL_TLS_CLIENTr�rrrr�r�r�r�r�rqrrrrr��s!
�



r�cCs\|dd�dkrt|��tdkr<ddl}|�d|j|jB�at�|�}|sNdSt|�d��S)Nr[r�rz150 .* \((\d+) bytes\)r	)	r�_150_re�re�compile�
IGNORECASE�ASCII�matchr��group)rer��mrrrr�)s
�
r�cCs�|dd�dkrt|��tdkr6ddl}|�d|j�at�|�}|sLt|��|��}d�|dd��}t	|d�d>t	|d�}||fS)	Nr[Z227rz#(\d+),(\d+),(\d+),(\d+),(\d+),(\d+)rvr\�rB)
r�_227_rer�r�r��searchr�groupsrzr�)rer�r�Znumbersrr.rrrr�=s
r�cCs�|dd�dkrt|��|�d�}|dkr2t|��|�d|d�}|dkrRt|��||d||dkrrt|��||d|��||d�}t|�dkr�t|��|d}t|d�}||fS)Nr[Z229�(r�)r	rB)r�findrryrFr�)reZpeer�left�right�partsrr.rrrr�Qs 
r�cCs�|dd�dkrt|��|dd�dkr,dSd}d}t|�}||kr�||}|d}|dkrz||ks�||dkrrq�|d}||}q<|S)Nr[r�rBz "rr	�")rrF)rer�rJ�nrfrrrr�gs 
r�cCst|�dSr)r:)rRrrrr�~sr�r�Ic	Cs�|s|}d|}|�|�|�|�t|�d��\}}|�||�|�d|�}|dd�dkrdt�|�d|�}|dd�dkr�t�|��|��dS)NzTYPE r�zSTOR r[>�125r��RETR )rur�rtr|rrh)	�sourceZ
sourcename�targetZ
targetnamer�Z
sourcehostZ
sourceportZtreplyZsreplyrrr�ftpcp�s

r�cCs�ttj�dkr"ttj�t�d�ddl}d}d}tjddkrR|d}tjd=q2tjddd�dkr�tjddd�}tjd=tjd}t|�}|�	|�d}}}z|�|�}Wn(t
k
r�|dk	r�tj�d�Yn:Xz|�
|�\}}}Wn"tk
�rtj�d�YnX|�|||�tjdd�D]�}	|	dd�d	k�r`|�|	dd��nt|	dd�dk�r�d
}
|	dd��r�|
d|	dd�}
|�|
�}n0|	dk�r�|�|j�n|�d
|	tjjd��q6|��dS)Nr}rr	z-dz-rrz5Could not open account file -- using anonymous login.z$No account -- using anonymous login.z-lZCWDr�z-pr�i)rFr/�argvr:�test�__doc__�exit�netrcrr>r%�stderr�writeZauthenticators�KeyErrorrr�rtrAr?r��stdoutr$)r�r9ZrcfilerZftpZuseridrrZnetrcobjr6rsrerrrr��sV	




�


�r��__main__)rr�)$r/r1r�__all__ror�r��	Exceptionrrrrrr%r&rrNrnrr��ImportErrorr�r�r�r�ZSSLErrorr�r�r�r�r�r�r�r�r�rrrrr�<module>'sP
�
Z
|

9
__pycache__/genericpath.cpython-38.pyc000064400000007643151153537570013723 0ustar00U

e5do�@s�dZddlZddlZddddddd	d
ddd
gZdd�Zdd
�Zdd	�Zdd�Zdd�Zdd�Z	dd�Z
dd�Zdd
�Zdd�Z
dd�Zdd�Zdd�ZdS)z�
Path operations common to more than one OS
Do not use directly.  The OS specific modules import the appropriate
functions from this module themselves.
�N�commonprefix�exists�getatime�getctime�getmtime�getsize�isdir�isfile�samefile�sameopenfile�samestatc	Cs.zt�|�Wnttfk
r(YdSXdS)zDTest whether a path exists.  Returns False for broken symbolic linksFT)�os�stat�OSError�
ValueError)�path�r�#/usr/lib64/python3.8/genericpath.pyrs
c	Cs6zt�|�}Wnttfk
r(YdSXt�|j�S)z%Test whether a path is a regular fileF)r
rrr�S_ISREG�st_mode)r�strrrr	s
c	Cs6zt�|�}Wnttfk
r(YdSXt�|j�S)z<Return true if the pathname refers to an existing directory.F)r
rrr�S_ISDIRr)�srrrrr's
cCst�|�jS)z1Return the size of a file, reported by os.stat().)r
r�st_size��filenamerrrr0scCst�|�jS)zCReturn the last modification time of a file, reported by os.stat().)r
r�st_mtimerrrrr5scCst�|�jS)z=Return the last access time of a file, reported by os.stat().)r
r�st_atimerrrrr:scCst�|�jS)zAReturn the metadata change time of a file, reported by os.stat().)r
r�st_ctimerrrrr?scCsl|sdSt|dttf�s*tttj|��}t|�}t|�}t|�D]$\}}|||krB|d|�SqB|S)zGGiven a list of pathnames, returns the longest common leading component�rN)	�
isinstance�list�tuple�mapr
�fspath�min�max�	enumerate)�m�s1�s2�i�crrrrEscCs|j|jko|j|jkS)z5Test whether two stat buffers reference the same file)�st_ino�st_dev)r)r*rrrrWs
�cCst�|�}t�|�}t||�S)z�Test whether two pathnames reference the same actual file or directory

    This is determined by the device number and i-node number and
    raises an exception if an os.stat() call on either pathname fails.
    )r
rr)�f1�f2r)r*rrrr
^s

cCst�|�}t�|�}t||�S)z:Test whether two open file objects reference the same file)r
�fstatr)�fp1�fp2r)r*rrrrks

cCs�|�|�}|r"|�|�}t||�}|�|�}||krz|d}||krz|||d�|krp|d|�||d�fS|d7}q<||dd�fS)z�Split the extension from a pathname.

    Extension is everything from the last dot to the end, ignoring
    leading dots.  Returns "(root, ext)"; ext may be empty.�Nr)�rfindr&)�p�sep�altsep�extsep�sepIndex�altsepIndex�dotIndex�
filenameIndexrrr�	_splitextys




r>cGs`d}}|D]<}t|t�r d}qt|t�r0d}qt|�d|jj���d�q|r\|r\td�d�dS)NFTz;() argument must be str, bytes, or os.PathLike object, not z.Can't mix strings and bytes in path components)r �str�bytes�	TypeError�	__class__�__name__)�funcname�args�hasstr�hasbytesrrrr�_check_arg_types�s

�rH)�__doc__r
r�__all__rr	rrrrrrrr
rr>rHrrrr�<module>s.
�	
__pycache__/getpass.cpython-38.pyc000064400000010124151153537570013064 0ustar00U

e5dj�@s�dZddlZddlZddlZddlZddlZdddgZGdd�de�Zddd	�Z	dd
d�Z
ddd
�Zddd�Zdd�Z
zddlZejejfWnBeefk
r�zddlZWnek
r�eZYnXe
ZYnXe	ZdS)a�Utilities to get a password and/or the current user name.

getpass(prompt[, stream]) - Prompt for a password, with echo turned off.
getuser() - Get the user name from the environment or password database.

GetPassWarning - This UserWarning is issued when getpass() cannot prevent
                 echoing of the password contents while reading.

On Windows, the msvcrt module will be used.

�N�getpass�getuser�GetPassWarningc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/getpass.pyrs�
Password: c
Cs�d}t�����}zJt�dtjtjB�}t�|d�}|�|�t�	|�}|�|�|sX|}Wnpt
k
r�}zR|��ztj
��}Wn&ttfk
r�d}t||�}YnXtj
}|s�tj}W5d}~XYnX|dk	�r�z�t�|�}|dd�}	|	dtjM<tj}
ttd��r|
tjO}
z t�||
|	�t|||d�}W5t�||
|�|��XWn@tjk
�r�|dk	�rz�||k	�r�|��t||�}YnX|�d�|W5QR�SQRXdS)aPrompt for a password, with echo turned off.

    Args:
      prompt: Written on stream to ask for the input.  Default: 'Password: '
      stream: A writable file object to display the prompt.  Defaults to
              the tty.  If no tty is available defaults to sys.stderr.
    Returns:
      The seKr3t input.
    Raises:
      EOFError: If our input tty or stdin was closed.
      GetPassWarning: When we were unable to turn echo off on the input.

    Always restores terminal settings before returning.
    Nz/dev/ttyzw+��TCSASOFT)�input�
)�
contextlib�	ExitStack�os�open�O_RDWR�O_NOCTTY�io�FileIO�
enter_context�
TextIOWrapper�OSError�close�sys�stdin�fileno�AttributeError�
ValueError�fallback_getpass�stderr�termios�	tcgetattrZECHOZ	TCSAFLUSH�hasattrr�	tcsetattr�flush�
_raw_input�error�write)�prompt�streamZpasswd�stack�fdZttyr
�e�old�newZtcsetattr_flagsrrr	�unix_getpasssR








r1cCs�tjtjk	rt||�S|D]}t�|�qd}t��}|dkst|dkrHqt|dkrTt�|dkrj|dd�}q.||}q.t�d�t�d�|S)z9Prompt for password with echo off, using Windows getch().��
r��N���)rr�	__stdin__r �msvcrtZputwchZgetwch�KeyboardInterrupt)r*r+�cZpwrrr	�win_getpassas 



r;cCs0tjdtdd�|stj}td|d�t||�S)Nz%Can not control echo on the terminal.�)�
stacklevelz&Warning: Password input may be echoed.)�file)�warnings�warnrrr!�printr')r*r+rrr	r xs�r r2cCs�|s
tj}|stj}t|�}|rpz|�|�Wn8tk
rf|�|jd�}|�|j�}|�|�YnX|�	�|�
�}|s�t�|ddkr�|dd�}|S)N�replacer6r)rr!r�strr)�UnicodeEncodeError�encode�encoding�decoder&�readline�EOFError)r*r+r
�linerrr	r'�s&r'cCs<dD]}tj�|�}|r|Sqddl}|�t���dS)z�Get the username from the environment or password database.

    First try various environment variables, then the password
    database.  This works on Windows as long as USERNAME is set.

    )ZLOGNAMEZUSERZLNAMEZUSERNAMErN)r�environ�get�pwd�getpwuid�getuid)�name�userrMrrr	r�s
)r
N)r
N)r
N)r2NN)�__doc__rrrrr?�__all__�UserWarningrr1r;r r'rr"r#r%�ImportErrorrr8rrrrr	�<module>s,

D

	


__pycache__/socketserver.cpython-38.opt-2.pyc000064400000034467151153537570015115 0ustar00U

e5d�j�	@sdZddlZddlZddlZddlZddlZddlmZddlm	Zddddd	d
ddd
g	Z
eed�rte
�dddg�eed�r�e
�ddddg�eed�r�ej
ZnejZGdd�d�ZGdd�de�ZGdd�de�Zeed�r�Gdd�d�ZGdd�de�ZGdd�d�ZGd d
�d
�Zeed��rJGd!d�dee�ZGd"d�dee�ZGd#d�dee�ZGd$d	�d	ee�Zeed��r�Gd%d�de�ZGd&d�de�ZGd'd�dee�ZGd(d�dee�ZGd)d
�d
�Z Gd*d�de �Z!Gd+d,�d,e�Z"Gd-d�de �Z#dS).z0.4�N)�BufferedIOBase)�	monotonic�
BaseServer�	TCPServer�	UDPServer�ThreadingUDPServer�ThreadingTCPServer�BaseRequestHandler�StreamRequestHandler�DatagramRequestHandler�ThreadingMixIn�fork�ForkingUDPServer�ForkingTCPServer�ForkingMixIn�AF_UNIX�UnixStreamServer�UnixDatagramServer�ThreadingUnixStreamServer�ThreadingUnixDatagramServer�PollSelectorc@s�eZdZdZdd�Zdd�Zd%dd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�ZdS)&rNcCs ||_||_t��|_d|_dS�NF)�server_address�RequestHandlerClass�	threadingZEvent�_BaseServer__is_shut_down�_BaseServer__shutdown_request)�selfrr�r�$/usr/lib64/python3.8/socketserver.py�__init__�s
zBaseServer.__init__cCsdS�Nr�rrrr�server_activate�szBaseServer.server_activate��?c	Cst|j��zRt��B}|�|tj�|jsP|�|�}|jr:qP|rF|�	�|�
�q"W5QRXW5d|_|j��XdSr)r�clearr�set�_ServerSelector�register�	selectors�
EVENT_READ�select�_handle_request_noblock�service_actions)rZ
poll_interval�selector�readyrrr�
serve_forever�s

zBaseServer.serve_forevercCsd|_|j��dS�NT)rr�waitr"rrr�shutdown�szBaseServer.shutdowncCsdSr!rr"rrrr-�szBaseServer.service_actionsc
Cs�|j��}|dkr|j}n|jdk	r0t||j�}|dk	rBt�|}t��f}|�|tj�|�	|�}|rz|�
�W5QR�S|dk	rX|t�}|dkrX|��W5QR�SqXW5QRXdS)Nr)�socketZ
gettimeout�timeout�min�timer'r(r)r*r+r,�handle_timeout)rr5Zdeadliner.r/rrr�handle_requests 




zBaseServer.handle_requestcCs�z|��\}}Wntk
r&YdSX|�||�r�z|�||�Wq�tk
rn|�||�|�|�Yq�|�|��Yq�Xn
|�|�dSr!)�get_request�OSError�verify_request�process_request�	Exception�handle_error�shutdown_request�r�request�client_addressrrrr,/s

z"BaseServer._handle_request_noblockcCsdSr!rr"rrrr8FszBaseServer.handle_timeoutcCsdSr1rrArrrr<MszBaseServer.verify_requestcCs|�||�|�|�dSr!)�finish_requestr@rArrrr=UszBaseServer.process_requestcCsdSr!rr"rrr�server_close^szBaseServer.server_closecCs|�|||�dSr!)rrArrrrDfszBaseServer.finish_requestcCs|�|�dSr!��
close_request�rrBrrrr@jszBaseServer.shutdown_requestcCsdSr!rrHrrrrGnszBaseServer.close_requestcCs@tdtjd�td|tjd�ddl}|��tdtjd�dS)Nz(----------------------------------------)�filez4Exception happened during processing of request fromr)�print�sys�stderr�	traceback�	print_exc)rrBrCrMrrrr?rs�zBaseServer.handle_errorcCs|Sr!rr"rrr�	__enter__szBaseServer.__enter__cGs|��dSr!)rE)r�argsrrr�__exit__�szBaseServer.__exit__)r$)�__name__�
__module__�__qualname__r5r r#r0r3r-r9r,r8r<r=rErDr@rGr?rOrQrrrrr�s$-

	
c@sbeZdZejZejZdZdZ	ddd�Z
dd�Zdd	�Zd
d�Z
dd
�Zdd�Zdd�Zdd�ZdS)r�FTcCsTt�|||�t�|j|j�|_|rPz|��|��Wn|���YnXdSr!)rr r4�address_family�socket_type�server_bindr#rE)rrrZbind_and_activaterrrr �s�zTCPServer.__init__cCs8|jr|j�tjtjd�|j�|j�|j��|_dS)N�)�allow_reuse_addressr4�
setsockoptZ
SOL_SOCKETZSO_REUSEADDRZbindrZgetsocknamer"rrrrX�szTCPServer.server_bindcCs|j�|j�dSr!)r4Zlisten�request_queue_sizer"rrrr#�szTCPServer.server_activatecCs|j��dSr!)r4�closer"rrrrE�szTCPServer.server_closecCs
|j��Sr!)r4�filenor"rrrr^�szTCPServer.filenocCs
|j��Sr!)r4Zacceptr"rrrr:�szTCPServer.get_requestcCs4z|�tj�Wntk
r$YnX|�|�dSr!)r3r4ZSHUT_WRr;rGrHrrrr@�s
zTCPServer.shutdown_requestcCs|��dSr!)r]rHrrrrG�szTCPServer.close_requestN)T)rRrSrTr4ZAF_INETrVZSOCK_STREAMrWr\rZr rXr#rEr^r:r@rGrrrrr�s/


c@s:eZdZdZejZdZdd�Zdd�Z	dd�Z
d	d
�ZdS)rFi cCs |j�|j�\}}||jf|fSr!)r4Zrecvfrom�max_packet_size)r�dataZclient_addrrrrr:szUDPServer.get_requestcCsdSr!rr"rrrr#szUDPServer.server_activatecCs|�|�dSr!rFrHrrrr@szUDPServer.shutdown_requestcCsdSr!rrHrrrrGszUDPServer.close_requestN)rRrSrTrZr4Z
SOCK_DGRAMrWr_r:r#r@rGrrrrrscsReZdZdZdZdZdZdd�dd�Zd	d
�Zdd�Z	d
d�Z
�fdd�Z�ZS)ri,N�(TF��blockingc	Cs�|jdkrdSt|j�|jkrvz t�dd�\}}|j�|�Wqtk
r\|j��Yqtk
rrYqvYqXq|j�	�D]f}z.|r�dntj
}t�||�\}}|j�|�Wq�tk
r�|j�|�Yq�tk
r�Yq�Xq�dS)N���r)�active_children�len�max_children�os�waitpid�discard�ChildProcessErrorr%r;�copy�WNOHANG)rrc�pid�_�flagsrrr�collect_children(s&
zForkingMixIn.collect_childrencCs|��dSr!�rqr"rrrr8KszForkingMixIn.handle_timeoutcCs|��dSr!rrr"rrrr-RszForkingMixIn.service_actionscCs�t��}|r8|jdkrt�|_|j�|�|�|�dSd}z:z|�||�d}Wn t	k
rr|�
||�YnXW5z|�|�W5t�|�XXdS)NrYr)rhr
rer&�addrG�_exitr@rDr>r?)rrBrCrnZstatusrrrr=Ys 

zForkingMixIn.process_requestcst���|j|jd�dS)Nrb)�superrErq�block_on_closer"��	__class__rrrErs
zForkingMixIn.server_close)
rRrSrTr5rergrvrqr8r-r=rE�
__classcell__rrrwrrs#cs4eZdZ�fdd�Zdd�Zdd�Zdd�Z�ZS)	�_Threadscs"|��|jrdSt��|�dSr!)�reap�daemonru�append�r�threadrwrrr}{sz_Threads.appendcCsg|dd�|dd�<}|Sr!r)r�resultrrr�pop_all�sz_Threads.pop_allcCs|��D]}|��qdSr!)r��joinr~rrrr��sz
_Threads.joincCsdd�|D�|dd�<dS)Ncss|]}|��r|VqdSr!)Zis_alive)�.0rrrr�	<genexpr>�sz _Threads.reap.<locals>.<genexpr>rr"rrrr{�sz
_Threads.reap)rRrSrTr}r�r�r{ryrrrwrrzwsrzc@seZdZdd�Zdd�ZdS)�
_NoThreadscCsdSr!rr~rrrr}�sz_NoThreads.appendcCsdSr!rr"rrrr��sz_NoThreads.joinN)rRrSrTr}r�rrrrr��sr�cs:eZdZdZdZe�Zdd�Zdd�Z�fdd�Z	�Z
S)	rFTc	CsHz6z|�||�Wn tk
r2|�||�YnXW5|�|�XdSr!)r@rDr>r?rArrr�process_request_thread�s
z%ThreadingMixIn.process_request_threadcCsL|jrt|��dt��tj|j||fd�}|j|_|j	�
|�|��dS)N�_threads)�targetrP)rv�vars�
setdefaultrzrZThreadr��daemon_threadsr|r�r}�start)rrBrC�trrrr=�s�zThreadingMixIn.process_requestcst���|j��dSr!)rurEr�r�r"rwrrrE�s
zThreadingMixIn.server_close)rRrSrTr�rvr�r�r�r=rEryrrrwrr�s

c@seZdZdS)rN�rRrSrTrrrrr�sc@seZdZdS)rNr�rrrrr�sc@seZdZdS)rNr�rrrrr�sc@seZdZdS)rNr�rrrrr�sc@seZdZejZdS)rN�rRrSrTr4rrVrrrrr�sc@seZdZejZdS)rNr�rrrrr�sc@seZdZdS)rNr�rrrrr�sc@seZdZdS)rNr�rrrrr�sc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
r	cCs6||_||_||_|��z|��W5|��XdSr!)rBrC�server�setup�finish�handle)rrBrCr�rrrr �szBaseRequestHandler.__init__cCsdSr!rr"rrrr��szBaseRequestHandler.setupcCsdSr!rr"rrrr��szBaseRequestHandler.handlecCsdSr!rr"rrrr��szBaseRequestHandler.finishN)rRrSrTr r�r�r�rrrrr	�s
c@s,eZdZdZdZdZdZdd�Zdd�ZdS)	r
rdrNFcCsz|j|_|jdk	r |j�|j�|jr:|j�tjtjd�|j�	d|j
�|_|jdkrdt
|j�|_n|j�	d|j�|_dS)NT�rbr�wb)rBZ
connectionr5Z
settimeout�disable_nagle_algorithmr[r4ZIPPROTO_TCPZTCP_NODELAYZmakefile�rbufsize�rfile�wbufsize�
_SocketWriter�wfiler"rrrr�s

�
zStreamRequestHandler.setupcCsF|jjs.z|j��Wntjk
r,YnX|j��|j��dSr!)r��closed�flushr4�errorr]r�r"rrrr�#s
zStreamRequestHandler.finish)	rRrSrTr�r�r5r�r�r�rrrrr
s
c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
r�cCs
||_dSr!)�_sock)rZsockrrrr 3sz_SocketWriter.__init__cCsdSr1rr"rrr�writable6sz_SocketWriter.writablec
Cs2|j�|�t|��}|jW5QR�SQRXdSr!)r�Zsendall�
memoryview�nbytes)r�bZviewrrr�write9s
z_SocketWriter.writecCs
|j��Sr!)r�r^r"rrrr^>sz_SocketWriter.filenoN)rRrSrTr r�r�r^rrrrr�.sr�c@seZdZdd�Zdd�ZdS)rcCs2ddlm}|j\|_|_||j�|_|�|_dS)Nr)�BytesIO)�ior�rBZpacketr4r�r�)rr�rrrr�EszDatagramRequestHandler.setupcCs|j�|j��|j�dSr!)r4Zsendtor��getvaluerCr"rrrr�KszDatagramRequestHandler.finishN)rRrSrTr�r�rrrrrAs)$�__version__r4r)rhrKrr�rr7r�__all__�hasattr�extendrr'ZSelectSelectorrrrr�listrzr�rrrrrrrrrr	r
r�rrrrr�<module>{s`�

�
n~
X(.-__pycache__/sndhdr.cpython-38.opt-2.pyc000064400000013124151153537570013643 0ustar00U

e5d��@s.ddgZddlmZedd�Zdej_dej_dej_d	ej_d
ej	_dd�Z
dd�ZgZd
d�Z
e�e
�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zed)k�r*e�d*S)+�what�whathdr�)�
namedtuple�
SndHeadersz.filetype framerate nchannels nframes sampwidthz�The value for type indicates the data type
and will be one of the strings 'aifc', 'aiff', 'au','hcom',
'sndr', 'sndt', 'voc', 'wav', '8svx', 'sb', 'ub', or 'ul'.zYThe sampling_rate will be either the actual
value or 0 if unknown or difficult to decode.z^The number of channels or 0 if it cannot be
determined or if the value is difficult to decode.z?The value for frames will be either the number
of frames or -1.zAEither the sample size in bits or
'A' for A-LAW or 'U' for u-LAW.cCst|�}|S)N)r)�filename�res�r�/usr/lib64/python3.8/sndhdr.pyr4sc
Cs^t|d��J}|�d�}tD]*}|||�}|rt|�W5QR�SqW5QR�dSQRXdS)N�rbi)�open�read�testsr)r�f�hZtfrrrr	r:s

c	Cs�ddl}|�d�sdS|dd�dkr,d}n|dd�dkrBd}ndS|�d�z|�|d	�}Wnt|jfk
r|YdSX||��|��|��d|�	�fS)
Nr�FORM��sAIFC�aifcsAIFFZaiff�r)
r�
startswith�seekr�EOFError�Error�getframerate�getnchannels�
getnframes�getsampwidth)rrrZfmt�arrr	�	test_aifcKs"


�rc
Cs�|�d�rt}n|dd�dkr&t}ndSd}||dd��}||dd��}||dd��}||dd��}||dd	��}d
}	|d
kr�d}
n$|dkr�d}
n|d
kr�d}
d}	nd}
|	|}|r�||}nd}|||||
fS)Ns.snd�)sds.sdns.Zaurr�����U���?���)r�get_long_be�get_long_le)
rr�func�filetypeZhdr_size�	data_size�encoding�rate�	nchannelsZsample_sizeZsample_bitsZ
frame_sizeZnframerrr	�test_au`s2

r1cCsT|dd�dks |dd�dkr$dSt|dd��}|rBd	|}nd
}d|dd
dfS)N�A�EsFSSD��sHCOM��i"VrZhcomr#r(r)r))rrZdivisorr/rrr	�	test_hcom�s 
r8cCst|�d�sdSt|dd��}d}d|kr6dkrfnn,||dkrfd||d}|rftd	|�}d
|dddfS)
NsCreative Voice Filer!�ri�r#�rg��.AZvocr(r)r�get_short_le�int)rrZsbseekr/Zratecoderrr	�test_voc�s
$r=c	Cs�ddl}|�d�r2|dd�dks2|dd�dkr6dS|�d�z|�|d�}Wnt|jfk
rlYdSXd	|��|��|��d|�	�fS)
NrsRIFFrrsWAVEr sfmt rZwav)
�waverrrrrrrrr)rrr>�wrrr	�test_wav�s*

�r@cCs"|�d�r|dd�dkrdSdS)Nrrrs8SVX)Z8svxrr#rr)r)rrrrr	�	test_8svx�srAcCs<|�d�r8t|dd��}t|dd��}d|d|dfSdS)NsSOUNDrrr!r9Zsndtr#)rr*r;)rrZnsamplesr/rrr	�	test_sndt�s
rBcCsD|�d�r@t|dd��}d|kr.dkr@nnd|ddd	fSdS)
Nsr%ri�i�aZsndrr#r(r)rr;)rrr/rrr	�	test_sndr�s
rCcCs,|dd>|dd>B|dd>B|dBS)Nrr"r#r r%rr&r��brrr	r)�sr)cCs,|dd>|dd>B|dd>B|dBS)Nr&r"r%r r#rrrrDrrr	r*�sr*cCs|dd>|dBS)Nrrr#rrDrrr	�get_short_be�srFcCs|dd>|dBS)Nr#rrrrDrrr	r;�sr;cCs�ddl}d}|jdd�r8|jddkr8|jdd�=d}z8|jdd�r`t|jdd�|d�ntdg|d�Wn*tk
r�|j�d�|�d�YnXdS)Nrr#z-rr%�.z
[Interrupted]
)�sys�argv�testall�KeyboardInterrupt�stderr�write�exit)rH�	recursiverrr	�test�srPc	Cs�ddl}ddl}|D]�}|j�|�r~t|ddd�|s<|rttd�ddl}|�|j�|�|�d��}t||d�q�td�qt|ddd�|j	�
�ztt|��Wqtk
r�td	�YqXqdS)
Nrz/:� )�endzrecursing down:�*z*** directory (use -r) ***�:z*** not found ***)
rH�os�path�isdir�print�glob�join�escaperJ�stdout�flushr�OSError)�listrOZtoplevelrHrUrrY�namesrrr	rJ�s"

rJ�__main__N)�__all__�collectionsrrr,�__doc__Z	framerater0ZnframesZ	sampwidthrrr
r�appendr1r8r=r@rArBrCr)r*rFr;rPrJ�__name__rrrr	�<module>!sH�









__pycache__/doctest.cpython-38.opt-1.pyc000064400000223725151153537570014037 0ustar00U

e5d_��!@stdZdZdddddddd	d
ddd
ddddddddddddddddddd d!d"g!Zd#d$lZd#d$lZd#d$lZd#d$lZd#d$lZd#d$lZd#d$l	Z	d#d$l
Z
d#d$lZd#d$lZd#d%l
mZd#d&lmZed'd(�ZiZd)d�Zed�Zed�Zed�Zed�Zed�Zed�ZeeBeBeBeBeBZed
�Zed�Zed�Zed
�Zed�ZeeBeBeBeBZ d*Z!d+Z"d,d-�Z#dsd/d0�Z$d1d2�Z%d3d4�Z&dtd6d7�Z'd8d9�Z(Gd:d;�d;e�Z)d<d=�Z*d>d?�Z+d@dA�Z,GdBdC�dCej-�Z.dDdE�Z/GdFd�d�Z0GdGd�d�Z1GdHd�d�Z2GdId�d�Z3GdJd�d�Z4GdKd�d�Z5GdLd�de6�Z7GdMd�de6�Z8GdNd�de4�Z9d$a:dudQd�Z;dOd$d$d$d$dOd#d$dPe2�d$fdRd�Z<dvdTd�Z=d#a>dUd�Z?GdVdW�dWej@�ZAGdXdY�dYeA�ZBGdZd[�d[ejC�ZDdwd\d�ZEGd]d^�d^eA�ZFdOd$d$e2�d$fd_d`�ZGdad�ZHdbd�ZIdcd �ZJdxddd!�ZKdydedf�ZLdzdgd"�ZMGdhdi�di�ZNeNdjdkdldmdndo�ZOdpdq�ZPeQdrk�rpe
�ReP��d$S){a�Module doctest -- a framework for running examples in docstrings.

In simplest use, end each module M to be tested with:

def _test():
    import doctest
    doctest.testmod()

if __name__ == "__main__":
    _test()

Then running the module as a script will cause the examples in the
docstrings to get executed and verified:

python M.py

This won't display anything unless an example fails, in which case the
failing example(s) and the cause(s) of the failure(s) are printed to stdout
(why not stderr? because stderr is a lame hack <0.2 wink>), and the final
line of output is "Test failed.".

Run it with the -v switch instead:

python M.py -v

and a detailed report of all examples tried is printed to stdout, along
with assorted summaries at the end.

You can force verbose mode by passing "verbose=True" to testmod, or prohibit
it by passing "verbose=False".  In either of those cases, sys.argv is not
examined by testmod.

There are a variety of other ways to run doctests, including integration
with the unittest framework, and support for running non-Python text
files containing doctests.  There are also many ways to override parts
of doctest's default behaviors.  See the Library Reference Manual for
details.
zreStructuredText en�register_optionflag�DONT_ACCEPT_TRUE_FOR_1�DONT_ACCEPT_BLANKLINE�NORMALIZE_WHITESPACE�ELLIPSIS�SKIP�IGNORE_EXCEPTION_DETAIL�COMPARISON_FLAGS�REPORT_UDIFF�REPORT_CDIFF�REPORT_NDIFF�REPORT_ONLY_FIRST_FAILURE�REPORTING_FLAGS�	FAIL_FAST�Example�DocTest�
DocTestParser�
DocTestFinder�
DocTestRunner�
OutputChecker�DocTestFailure�UnexpectedException�DebugRunner�testmod�testfile�run_docstring_examples�DocTestSuite�DocFileSuite�set_unittest_reportflags�script_from_examples�
testsource�	debug_src�debug�N)�StringIO)�
namedtuple�TestResultszfailed attemptedcCst�|dtt�>�S)N�)�OPTIONFLAGS_BY_NAME�
setdefault�len��name�r,�/usr/lib64/python3.8/doctest.pyr�sz<BLANKLINE>z...cCs8d}tjD](}|�|d�}|tt|�kr
||jO}q
|S)z�
    Return the compiler-flags associated with the future features that
    have been imported into the given namespace (globs).
    r"N)�
__future__Zall_feature_names�get�getattrZ
compiler_flag)�globs�flagsZfnameZfeaturer,r,r-�_extract_future_flags�s
r3�cCsVt�|�r|St|t�r,t|t�t�dg�S|dkrJtjt�	|�j
dStd��dS)a�
    Return the module specified by `module`.  In particular:
      - If `module` is a module, then return module.
      - If `module` is a string, then import and return the
        module with that name.
      - If `module` is None, then return the calling module.
        The calling module is assumed to be the module of
        the stack frame at the given depth in the call stack.
    �*N�__name__z"Expected a module, string, or None)�inspect�ismodule�
isinstance�str�
__import__�globals�locals�sys�modules�	_getframe�	f_globals�	TypeError)�moduleZdepthr,r,r-�_normalize_module�s


rDcCsdD]}|�|d�}q|S)N)z
�
�
)�replace)�data�newliner,r,r-�_newline_convert�srJc
Cs�|rVt|d�}t||�}t|dd�dk	rVt|jd�rV|j�|�}|�|�}t|�|fSt||d��}|�	�|fW5QR�SQRXdS)N��
__loader__�get_data)�encoding)
rD�_module_relative_pathr0�hasattrrLrM�decoderJ�open�read)�filename�package�module_relativerNZ
file_contents�fr,r,r-�_load_testfile�s


rX�cCst�d|d|�S)z~
    Add the given number of space characters to the beginning of
    every non-blank line in `s`, and return the result.
    z
(?m)^(?!$)� )�re�sub)�s�indentr,r,r-�_indent�sr_cCs*t�}|\}}}tj||||d�|��S)zz
    Return a string containing a traceback message for the given
    exc_info tuple (as returned by sys.exc_info()).
    )�file)r#�	traceback�print_exception�getvalue)�exc_infoZexcout�exc_typeZexc_valZexc_tbr,r,r-�_exception_traceback�s
rfc@seZdZdd�Zddd�ZdS)�	_SpoofOutcCs$t�|�}|r |�d�s |d7}|S�NrF)r#rc�endswith)�self�resultr,r,r-rcs
z_SpoofOut.getvalueNcCs|�|�t�|�dS�N)�seekr#�truncate)rj�sizer,r,r-rn	s
z_SpoofOut.truncate)N)r6�
__module__�__qualname__rcrnr,r,r,r-rg�s	rgcCs�t|kr||kS|�t�}dt|�}}|d}|rR|�|�rNt|�}|d=ndS|d}|r�|�|�r||t|�8}|d=ndS||kr�dS|D],}|�|||�}|dkr�dS|t|�7}q�dS)z_
    Essentially the only subtle case:
    >>> _ellipsis_match('aa...aa', 'aaa')
    False
    r"F���T)�ELLIPSIS_MARKER�splitr)�
startswithri�find)�want�gotZws�startpos�endpos�wr,r,r-�_ellipsis_matchs0


r|cCs|��}|rd|SdSdS)z)Return a commented form of the given linez# �#N)�rstrip)�liner,r,r-�
_comment_line?sr�cCshdt|�}}|�d�}|dkr$|}|�dd|�}|dkr>|}|�dd|�}|dkr\|d}|||�S)Nr"rF�:�.r&)r)rv�rfind)�msg�start�end�ir,r,r-�_strip_exception_detailsGs
r�c@s2eZdZdZdd�Zddd�Zdd�Zd	d
�ZdS)�_OutputRedirectingPdbz�
    A specialized version of the python debugger that redirects stdout
    to a given stream when interacting with the user.  Stdout is *not*
    redirected when traced code is executed.
    cCs(||_d|_tjj||dd�d|_dS)NFT)�stdout�nosigintr&)�_OutputRedirectingPdb__out�$_OutputRedirectingPdb__debugger_used�pdb�Pdb�__init__Zuse_rawinput)rj�outr,r,r-r�gsz_OutputRedirectingPdb.__init__NcCs*d|_|dkrt��j}tj�||�dS)NT)r�r>r@�f_backr�r��	set_trace)rj�framer,r,r-r�os
z_OutputRedirectingPdb.set_tracecCs|jrtj�|�dSrl)r�r�r��set_continue�rjr,r,r-r�usz"_OutputRedirectingPdb.set_continuecGs2tj}|jt_ztjj|f|��W�S|t_XdSrl)r>r�r�r�r��trace_dispatch)rj�args�save_stdoutr,r,r-r�{s
z$_OutputRedirectingPdb.trace_dispatch)N)r6rprq�__doc__r�r�r�r�r,r,r,r-r�as

r�cCs�t�|�std|��|�d�r(td��tjj|�d��}t	|d�rXtj�|j
�d}n�|jdkr�tt
j�dkr�t
jddkr�tj�t
jd�d}q�tj}nFt	|d�r�|jD]&}tj�||�}tj�|�r�|Sq�td	|j��tj�||�S)
NzExpected a module: %r�/z1Module-relative files may not have absolute paths�__file__r"�__main__��__path__zBCan't resolve paths relative to the module %r (it has no __file__))r7r8rBru�
ValueError�os�path�joinrtrPr�r6r)r>�argv�curdirr��exists)rCZ	test_pathZbasedirZ	directory�fullpathr,r,r-rO�s(






�rOc@s*eZdZdZd
dd�Zdd�Zdd	�ZdS)ran
    A single doctest example, consisting of source code and expected
    output.  `Example` defines the following attributes:

      - source: A single Python statement, always ending with a newline.
        The constructor adds a newline if needed.

      - want: The expected output from running the source code (either
        from stdout, or a traceback in case of exception).  `want` ends
        with a newline unless it's empty, in which case it's an empty
        string.  The constructor adds a newline if needed.

      - exc_msg: The exception message generated by the example, if
        the example is expected to generate an exception; or `None` if
        it is not expected to generate an exception.  This exception
        message is compared against the return value of
        `traceback.format_exception_only()`.  `exc_msg` ends with a
        newline unless it's `None`.  The constructor adds a newline
        if needed.

      - lineno: The line number within the DocTest string containing
        this Example where the Example begins.  This line number is
        zero-based, with respect to the beginning of the DocTest.

      - indent: The example's indentation in the DocTest string.
        I.e., the number of space characters that precede the
        example's first prompt.

      - options: A dictionary mapping from option flags to True or
        False, which is used to override default options for this
        example.  Any option flags not contained in this dictionary
        are left at their default value (as specified by the
        DocTestRunner's optionflags).  By default, no options are set.
    Nr"cCsv|�d�s|d7}|r(|�d�s(|d7}|dk	rB|�d�sB|d7}||_||_||_||_|dkrfi}||_||_dSrh)ri�sourcerw�linenor^�options�exc_msg)rjr�rwr�r�r^r�r,r,r-r��s
zExample.__init__cCs\t|�t|�k	rtS|j|jkoZ|j|jkoZ|j|jkoZ|j|jkoZ|j|jkoZ|j|jkSrl)�type�NotImplementedr�rwr�r^r�r��rj�otherr,r,r-�__eq__�s
�
�
�
�
�zExample.__eq__cCst|j|j|j|j|jf�Srl)�hashr�rwr�r^r�r�r,r,r-�__hash__�s�zExample.__hash__)Nr"r"N)r6rprqr�r�r�r�r,r,r,r-r�s"�
c@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
rae
    A collection of doctest examples that should be run in a single
    namespace.  Each `DocTest` defines the following attributes:

      - examples: the list of examples.

      - globs: The namespace (aka globals) that the examples should
        be run in.

      - name: A name identifying the DocTest (typically, the name of
        the object whose docstring this DocTest was extracted from).

      - filename: The name of the file that this DocTest was extracted
        from, or `None` if the filename is unknown.

      - lineno: The line number within filename where this DocTest
        begins, or `None` if the line number is unavailable.  This
        line number is zero-based, with respect to the beginning of
        the file.

      - docstring: The string that the examples were extracted from,
        or `None` if the string is unavailable.
    cCs,||_||_|��|_||_||_||_dS)z�
        Create a new DocTest containing the given examples.  The
        DocTest's globals are initialized with a copy of `globs`.
        N)�examples�	docstring�copyr1r+rTr�)rjr�r1r+rTr�r�r,r,r-r�s
zDocTest.__init__cCsRt|j�dkrd}n"t|j�dkr(d}ndt|j�}d|jj|j|j|j|fS)Nr"zno examplesr&z	1 examplez%d examplesz<%s %s from %s:%s (%s)>)r)r��	__class__r6r+rTr�)rjr�r,r,r-�__repr__s��zDocTest.__repr__cCs\t|�t|�k	rtS|j|jkoZ|j|jkoZ|j|jkoZ|j|jkoZ|j|jkoZ|j|jkSrl)r�r�r�r�r1r+rTr�r�r,r,r-r�)s
�
�
�
�
�zDocTest.__eq__cCst|j|j|j|jf�Srl)r�r�r+rTr�r�r,r,r-r�4szDocTest.__hash__cCs:t|t�stS|j|j|jt|�f|j|j|jt|�fkSrl)r9rr�r+rTr��idr�r,r,r-�__lt__8s

�zDocTest.__lt__N)	r6rprqr�r�r�r�r�r�r,r,r,r-r�sc@s�eZdZdZe�dejejB�Ze�dejejBej	B�Z
e�d�jZddd�Z
dd	�Zdd
d�Zdd
�Ze�dej�Zdd�Ze�dej�Zdd�Zdd�Zdd�ZdS)rzD
    A class used to parse strings containing doctest examples.
    a�
        # Source consists of a PS1 line followed by zero or more PS2 lines.
        (?P<source>
            (?:^(?P<indent> [ ]*) >>>    .*)    # PS1 line
            (?:\n           [ ]*  \.\.\. .*)*)  # PS2 lines
        \n?
        # Want consists of any non-blank lines that do not start with PS1.
        (?P<want> (?:(?![ ]*$)    # Not a blank line
                     (?![ ]*>>>)  # Not a line starting with PS1
                     .+$\n?       # But any other line
                  )*)
        a�
        # Grab the traceback header.  Different versions of Python have
        # said different things on the first traceback line.
        ^(?P<hdr> Traceback\ \(
            (?: most\ recent\ call\ last
            |   innermost\ last
            ) \) :
        )
        \s* $                # toss trailing whitespace on the header.
        (?P<stack> .*?)      # don't blink: absorb stuff until...
        ^ (?P<msg> \w+ .*)   #     a line *starts* with alphanum.
        z^[ ]*(#.*)?$�<string>c
s|��}|�|���dkr8d��fdd�|�d�D��}g}d\}}|j�|�D]�}|�|||����||�d||���7}|�	|||�\}}}	}
|�
|�s�|�t||	|
|�t|�
d��|d��||�d|��|���7}|��}qP|�||d��|S)	a=
        Divide the given string into examples and intervening text,
        and return them as a list of alternating Examples and strings.
        Line numbers for the Examples are 0-based.  The optional
        argument `name` is a name identifying this string, and is only
        used for error messages.
        r"rFcsg|]}|�d��qSrlr,��.0�l�Z
min_indentr,r-�
<listcomp>sz'DocTestParser.parse.<locals>.<listcomp>�r"r"r^)r�r^r�N)�
expandtabs�_min_indentr�rt�_EXAMPLE_RE�finditer�appendr��count�_parse_example�_IS_BLANK_OR_COMMENTrr)�groupr�)rj�stringr+�outputZcharnor��mr�r�rwr�r,r�r-�parsess*
�

�
zDocTestParser.parsecCst|�||�|||||�S)a"
        Extract all doctest examples from the given string, and
        collect them into a `DocTest` object.

        `globs`, `name`, `filename`, and `lineno` are attributes for
        the new `DocTest` object.  See the documentation for `DocTest`
        for more information.
        )r�get_examples)rjr�r1r+rTr�r,r,r-�get_doctest�s	�zDocTestParser.get_doctestcCsdd�|�||�D�S)a�
        Extract all doctest examples from the given string, and return
        them as a list of `Example` objects.  Line numbers are
        0-based, because it's most common in doctests that nothing
        interesting appears on the same line as opening triple-quote,
        and so the first interesting line is called "line 1" then.

        The optional argument `name` is a name identifying this
        string, and is only used for error messages.
        cSsg|]}t|t�r|�qSr,)r9r)r��xr,r,r-r��s
�z.DocTestParser.get_examples.<locals>.<listcomp>)r�)rjr�r+r,r,r-r��szDocTestParser.get_examplesc
s
t|�d���|�d��d�}|�|�||�|�|dd�d�d||�d��fdd	�|D��}|�d
�}|�d�}t|�dkr�t�d|d�r�|d=|�|d�||t|��d��fd
d	�|D��}|j�|�}|r�|�d�}nd}|�	|||�}	||	||fS)a�
        Given a regular expression match from `_EXAMPLE_RE` (`m`),
        return a pair `(source, want)`, where `source` is the matched
        example's source code (with prompts and indentation stripped);
        and `want` is the example's expected output (with indentation
        stripped).

        `name` is the string's name, and `lineno` is the line number
        where the example starts; both are used for error messages.
        r^r�rFr&NrZr�csg|]}|�dd��qS)rYNr,)r�Zsl�r^r,r-r��sz0DocTestParser._parse_example.<locals>.<listcomp>rwz *$rrcsg|]}|�d��qSrlr,)r�Zwlr�r,r-r��sr�)
r)r�rt�_check_prompt_blank�
_check_prefixr�r[�match�
_EXCEPTION_RE�
_find_options)
rjr�r+r��source_linesr�rw�
want_linesr�r�r,r�r-r��s& 


�zDocTestParser._parse_examplez#\s*doctest:\s*([^\n\'"]*)$c	Cs�i}|j�|�D]v}|�d��dd���}|D]V}|ddksN|dd�tkrdtd|d||f��t|dd�}|ddk||<q.q|r�|�|�r�td	|||f��|S)
a
        Return a dictionary containing option overrides extracted from
        option directives in the given source string.

        `name` is the string's name, and `lineno` is the line number
        where the example starts; both are used for error messages.
        r&�,rZr"z+-Nz7line %r of the doctest for %s has an invalid option: %r�+zSline %r of the doctest for %s has an option directive on a line with no example: %r)�_OPTION_DIRECTIVE_REr�r�rGrtr'r�r�)	rjr�r+r�r�r�Zoption_strings�option�flagr,r,r-r��s"���zDocTestParser._find_optionsz
^([ ]*)(?=\S)cCs2dd�|j�|�D�}t|�dkr*t|�SdSdS)z;Return the minimum indentation of any non-blank line in `s`cSsg|]}t|��qSr,)r))r�r^r,r,r-r�
sz-DocTestParser._min_indent.<locals>.<listcomp>r"N)�
_INDENT_RE�findallr)�min)rjr]�indentsr,r,r-r�szDocTestParser._min_indentc	Cs^t|�D]P\}}t|�|dkr||ddkrtd||d||||d�|f��qdS)a

        Given the lines of a source string (including prompts and
        leading indentation), check to make sure that every prompt is
        followed by a space character.  If any line is not followed by
        a space character, then raise ValueError.
        rYrKrZz8line %r of the docstring for %s lacks blank after %s: %rr&N)�	enumerater)r�)rj�linesr^r+r�r�rr,r,r-r�s ��z!DocTestParser._check_prompt_blankcCs>t|�D]0\}}|r|�|�std||d||f��qdS)z�
        Check that every line in the given list starts with the given
        prefix; if any line does not, then raise a ValueError.
        zGline %r of the docstring for %s has inconsistent leading whitespace: %rr&N)r�rur�)rjr��prefixr+r�r�rr,r,r-r�s
�zDocTestParser._check_prefixN)r�)r�)r6rprqr�r[�compile�	MULTILINE�VERBOSEr��DOTALLr�r�r�r�r�r�r�r�r�r�r�r�r�r,r,r,r-rCs(
��
'
3�c@sNeZdZdZde�ddfdd�Zddd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)ra<
    A class used to extract the DocTests that are relevant to a given
    object, from its docstring and the docstrings of its contained
    objects.  Doctests can currently be extracted from the following
    object types: modules, functions, classes, methods, staticmethods,
    classmethods, and properties.
    FTcCs||_||_||_||_dS)at
        Create a new doctest finder.

        The optional argument `parser` specifies a class or
        function that should be used to create new DocTest objects (or
        objects that implement the same interface as DocTest).  The
        signature for this factory function should match the signature
        of the DocTest constructor.

        If the optional argument `recurse` is false, then `find` will
        only examine the given object, and not any contained objects.

        If the optional argument `exclude_empty` is false, then `find`
        will include tests for objects with empty docstrings.
        N)�_parser�_verbose�_recurse�_exclude_empty)rj�verbose�parser�recurse�
exclude_emptyr,r,r-r�7szDocTestFinder.__init__Nc		CsN|dkr.t|dd�}|dkr.tdt|�f��|dkr<d}n|dkrNt�|�}zt�|�}Wntk
rtd}YndX|s�t�|�}|d|dd�dks�d}|dkr�d}n*|dk	r�t�	||j
�}n
t�	|�}|s�d}|dkr�|dkr�i}n
|j
��}n|��}|dk	�r|�|�d|k�r(d|d<g}|�
||||||i�|��|S)	aj
        Return a list of the DocTests that are defined by the given
        object's docstring, or by any of its contained objects'
        docstrings.

        The optional parameter `module` is the module that contains
        the given object.  If the module is not specified or is None, then
        the test finder will attempt to automatically determine the
        correct module.  The object's module is used:

            - As a default namespace, if `globs` is not specified.
            - To prevent the DocTestFinder from extracting DocTests
              from objects that are imported from other modules.
            - To find the name of the file containing the object.
            - To help find the line number of the object within its
              file.

        Contained objects whose module does not match `module` are ignored.

        If `module` is False, no attempt to find the module will be made.
        This is obscure, of use mostly in tests:  if `module` is False, or
        is None but cannot be found automatically, then all objects are
        considered to belong to the (non-existent) module, so all contained
        objects will (recursively) be searched for doctests.

        The globals for each DocTest is formed by combining `globs`
        and `extraglobs` (bindings in `extraglobs` override bindings
        in `globs`).  A new copy of the globals dictionary is created
        for each DocTest.  If `globs` is not specified, then it
        defaults to the module's `__dict__`, if specified, or {}
        otherwise.  If `extraglobs` is not specified, then it defaults
        to {}.

        Nr6zJDocTestFinder.find: name must be given when obj.__name__ doesn't exist: %rFr"���z<]>r�)r0r�r�r7�	getmoduleZ
getsourcefilerBZgetfile�	linecache�getlines�__dict__r��update�_find�sort)	rj�objr+rCr1�
extraglobsr`r��testsr,r,r-rvMsL$�






zDocTestFinder.findcCs�|dkrdSt�|�dk	r(|t�|�kSt�|�r>|j|jkSt�|�r|t|d�r\|jj}nt|d�rn|j}ndS|j	|kSt�
|�r�|j	|jkSt|d�r�|j	|jkSt|t�r�dSt
d��dS)zY
        Return true if the given object is defined in the given
        module.
        NT�__objclass__rpz"object must be a class or function)r7r��
isfunctionr��__globals__ZismethoddescriptorrPr�rpr6�isclassr9�propertyr�)rjrC�objectZobj_modr,r,r-�_from_module�s(








zDocTestFinder._from_modulec
Cs|jrtd|�t|�|kr"dSd|t|�<|�|||||�}|dk	rR|�|�t�|�r�|jr�|j�	�D]P\}	}
d||	f}	t�
t�|
��s�t�|
�rl|�
||
�rl|�||
|	||||�qlt�|��rn|j�rnt|di��	�D]�\}	}
t|	t��stdt|	�f��t�
|
��sJt�|
��sJt�|
��sJt|
t��sJtdt|
�f��d||	f}	|�||
|	||||�q�t�|��r|j�r|j�	�D]�\}	}
t|
t��r�t||	�}
t|
t��r�t||	�j}
t�
|
��s�t�|
��s�t|
t��r�|�
||
��r�d||	f}	|�||
|	||||��q�dS)	zm
        Find tests for the given object and any contained objects, and
        add them to `tests`.
        zFinding tests in %sNr&z%s.%s�__test__z5DocTestFinder.find: __test__ keys must be strings: %rz`DocTestFinder.find: __test__ values must be strings, functions, methods, classes, or modules: %rz%s.__test__.%s)r��printr��	_get_testr�r7r8r�r��itemsZ	isroutineZunwrapr�rr�r0r9r:r�r��staticmethod�classmethod�__func__r)rjr�r�r+rCr�r1�seen�testZvalname�valr,r,r-r��sn
�
�������
�
��zDocTestFinder._findc		Cs�t|t�r|}nJz,|jdkr"d}n|j}t|t�s:t|�}Wnttfk
rXd}YnX|�||�}|jrt|stdS|dkr�d}n.t|dd�p�|j}|dd�dkr�|dd�}|j	�
|||||�S)zs
        Return a DocTest for the given object, if it defines a docstring;
        otherwise, return None.
        Nr�r�����.pycrr)r9r:r�rB�AttributeError�_find_linenor�r0r6r�r�)	rjr�r+rCr1r�r�r�rTr,r,r-rs,




�zDocTestFinder._get_testcCsd}t�|�rd}t�|�rb|dkr(dSt�dt|dd��}t|�D]\}}|�|�rF|}qbqFt�|�rr|j	}t�
|�r�|j}t�|�r�|j
}t�|�r�|j}t�|�r�t|dd�d}|dk	�r
|dkr�|dSt�d�}t|t|��D]}|�||�r�|Sq�dS)	z�
        Return a line number of the given object's docstring.  Note:
        this method assumes that the object has a docstring.
        Nr"z^\s*class\s*%s\br6�-�co_firstlinenor&z(^|.*:)\s*\w*("|\'))r7r8r�r[r�r0r�r�Zismethodr	r��__code__Zistraceback�tb_frameZisframe�f_codeZiscode�ranger))rjr�r�r�Zpatr�rr,r,r-r4s>


�








zDocTestFinder._find_lineno)NNNN)r6rprqr�rr�rvrr�rrr,r,r,r-r.s�

f?&c@s�eZdZdZdZddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Ze
�d�Zd dd�Zd!dd�Zd"dd�Zdd�ZdS)#ra3	
    A class used to run DocTest test cases, and accumulate statistics.
    The `run` method is used to process a single DocTest case.  It
    returns a tuple `(f, t)`, where `t` is the number of test cases
    tried, and `f` is the number of test cases that failed.

        >>> tests = DocTestFinder().find(_TestClass)
        >>> runner = DocTestRunner(verbose=False)
        >>> tests.sort(key = lambda test: test.name)
        >>> for test in tests:
        ...     print(test.name, '->', runner.run(test))
        _TestClass -> TestResults(failed=0, attempted=2)
        _TestClass.__init__ -> TestResults(failed=0, attempted=2)
        _TestClass.get -> TestResults(failed=0, attempted=2)
        _TestClass.square -> TestResults(failed=0, attempted=1)

    The `summarize` method prints a summary of all the test cases that
    have been run by the runner, and returns an aggregated `(f, t)`
    tuple:

        >>> runner.summarize(verbose=1)
        4 items passed all tests:
           2 tests in _TestClass
           2 tests in _TestClass.__init__
           2 tests in _TestClass.get
           1 tests in _TestClass.square
        7 tests in 4 items.
        7 passed and 0 failed.
        Test passed.
        TestResults(failed=0, attempted=7)

    The aggregated number of tried examples and failed examples is
    also available via the `tries` and `failures` attributes:

        >>> runner.tries
        7
        >>> runner.failures
        0

    The comparison between expected outputs and actual outputs is done
    by an `OutputChecker`.  This comparison may be customized with a
    number of option flags; see the documentation for `testmod` for
    more information.  If the option flags are insufficient, then the
    comparison may also be customized by passing a subclass of
    `OutputChecker` to the constructor.

    The test runner's display output can be controlled in two ways.
    First, an output function (`out) can be passed to
    `TestRunner.run`; this function will be called with strings that
    should be displayed.  It defaults to `sys.stdout.write`.  If
    capturing the output is not sufficient, then the display output
    can be also customized by subclassing DocTestRunner, and
    overriding the methods `report_start`, `report_success`,
    `report_unexpected_exception`, and `report_failure`.
    zF**********************************************************************Nr"cCsN|pt�|_|dkrdtjk}||_||_||_d|_d|_i|_	t
�|_dS)ac
        Create a new test runner.

        Optional keyword arg `checker` is the `OutputChecker` that
        should be used to compare the expected outputs and actual
        outputs of doctest examples.

        Optional keyword arg 'verbose' prints lots of stuff if true,
        only failures if false; by default, it's true iff '-v' is in
        sys.argv.

        Optional argument `optionflags` can be used to control how the
        test runner compares expected output to actual output, and how
        it displays failures.  See the documentation for `testmod` for
        more information.
        N�-vr")r�_checkerr>r�r��optionflags�original_optionflags�tries�failures�_name2ftrg�_fakeout)rj�checkerr�rr,r,r-r��s
zDocTestRunner.__init__cCsH|jrD|jr.|dt|j�dt|j��n|dt|j�d�dS)z�
        Report that the test runner is about to process the given
        example.  (Only displays a message if verbose=True)
        zTrying:
zExpecting:
zExpecting nothing
N)r�rwr_r�)rjr�r�exampler,r,r-�report_start�s���zDocTestRunner.report_startcCs|jr|d�dS)zt
        Report that the given example ran successfully.  (Only
        displays a message if verbose=True)
        zok
N)r��rjr�rr rxr,r,r-�report_success�szDocTestRunner.report_successcCs&||�||�|j�|||j��dS)z7
        Report that the given example failed.
        N)�_failure_headerr�output_differencerr"r,r,r-�report_failure�s�zDocTestRunner.report_failurecCs$||�||�dtt|���dS)zO
        Report that the given example raised an unexpected exception.
        zException raised:
N)r$r_rf�rjr�rr rdr,r,r-�report_unexpected_exception�s
�
�z)DocTestRunner.report_unexpected_exceptioncCs�|jg}|jrR|jdk	r4|jdk	r4|j|jd}nd}|�d|j||jf�n|�d|jd|jf�|�d�|j}|�t|��d�|�S)Nr&�?zFile "%s", line %s, in %szLine %s, in %szFailed example:rF)�DIVIDERrTr�r�r+r�r_r�)rjrr r�r�r�r,r,r-r$�s�
zDocTestRunner._failure_headerc	Cs�d}}|j}td�\}}}	|jj}
t|j�D�]6\}}|jt@oH|dk}
||_|jr�|j��D],\}}|r||j|O_q`|j|M_q`|jt	@r�q.|d7}|
s�|�
|||�d|j|f}z,tt
|j|d|d�|j�|j��d}Wn4tk
�r�Ynt��}|j��YnX|j��}|j�d�|}|dk�r`|
|j||j��r�|}n|tj|dd��d}|
�s�|t|�7}|jdk�r�|	}nB|
|j||j��r�|}n*|jt@�r�|
t|j�t|�|j��r�|}||k�r�|
�sR|�||||�nT||k�r(|
�s|� ||||�|d7}n*||	k�rR|
�sH|�!||||�|d7}n|r.|jt"@r.�qhq.||_|�#|||�t$||�S)	a�
        Run the examples in `test`.  Write the outcome of each example
        with one of the `DocTestRunner.report_*` methods, using the
        writer function `out`.  `compileflags` is the set of compiler
        flags that should be used to execute examples.  Return a tuple
        `(f, t)`, where `t` is the number of examples tried, and `f`
        is the number of examples that failed.  The examples are run
        in the namespace `test.globs`.
        r"rKr&z<doctest %s[%d]>ZsingleNr4rr)%rrr�check_outputr�r�rr�rrr!r+�execr�r�r1�debuggerr��KeyboardInterruptr>rdrrcrnrwra�format_exception_onlyrfr�rr�r#r&r(r�_DocTestRunner__record_outcomer%)rjr�compileflagsr�rrr�SUCCESS�FAILUREZBOOMZcheck�
examplenumr �quietZ
optionflagrrTZ	exceptionrxZoutcomer�r,r,r-Z__run�s�
�
��



�




�
zDocTestRunner.__runcCsL|j�|jd�\}}||||f|j|j<|j|7_|j|7_dS)z{
        Record the fact that the given DocTest (`test`) generated `f`
        failures out of `t` tried examples.
        r�N)rr/r+rr)rjrrW�t�f2�t2r,r,r-Z__record_outcome|szDocTestRunner.__record_outcomez.<doctest (?P<name>.+)\[(?P<examplenum>\d+)\]>$cCsV|j�|�}|rF|�d�|jjkrF|jjt|�d��}|jjdd�S|�	||�SdS)Nr+r4T��keepends)
�%_DocTestRunner__LINECACHE_FILENAME_REr�r�rr+r��intr��
splitlines�save_linecache_getlines)rjrT�module_globalsr�r r,r,r-Z__patched_linecache_getlines�s
z*DocTestRunner.__patched_linecache_getlinesTc		s||_|dkrt|j�}tj�|dkrV�j��dks@���dkrH�j}n��fdd�}|jt_t�	�}t
j}t��|_
|j
��|j
jt
_tj|_|jt_tj}tjt_z|�|||�W�S�t_|t
_t�|�|jt_|t_|�r�|j��ddl}d|_XdS)aJ
        Run the examples in `test`, and display the results using the
        writer function `out`.

        The examples are run in the namespace `test.globs`.  If
        `clear_globs` is true (the default), then this namespace will
        be cleared after the test runs, to help with garbage
        collection.  If you would like to examine the namespace after
        the test completes, then use `clear_globs=False`.

        `compileflags` gives the set of flags that should be used by
        the Python compiler when running the examples.  If not
        specified, then it will default to the set of future-import
        flags that apply to `globs`.

        The output of each example is checked using
        `DocTestRunner.check_output`, and the results are formatted by
        the `DocTestRunner.report_*` methods.
        N�utf-8cs t|��d���}��|�dS)N�backslashreplace)r:�encode�write)r]�rNr�r,r-r��szDocTestRunner.run.<locals>.outr")rr3r1r>r�rN�lowerrCr�gettracer�r�r�r-�resetr�r�r>�*_DocTestRunner__patched_linecache_getlines�displayhook�__displayhook__�settrace�clear�builtins�_�_DocTestRunner__run)	rjrr1r��clear_globsZ
save_traceZsave_set_traceZsave_displayhookrMr,rDr-�run�s<





zDocTestRunner.runc
Cs�|dkr|j}g}g}g}d}}|j��D]V}|\}\}	}
||
7}||	7}|
dkr`|�|�q,|	dkrx|�||
f�q,|�|�q,|r�|r�tt|�d�|��|D]}td|�q�|r�tt|�d�|��|D]\}}td||f�q�|�r:t|j�tt|�d�|��|D] \}\}	}
td|	|
|f��q|�rft|d	t|j�d
�t||d|d�|�rztd
|d�n|�r�td�t||�S)a�
        Print a summary of all the test cases that have been run by
        this DocTestRunner, and return a tuple `(f, t)`, where `f` is
        the total number of failed examples, and `t` is the total
        number of tried examples.

        The optional `verbose` argument controls how detailed the
        summary is.  If the verbosity is not specified, then the
        DocTestRunner's verbosity is used.
        Nr"zitems had no tests:z   zitems passed all tests:z %3d tests in %szitems had failures:z %3d of %3d in %sztests inzitems.z
passed andzfailed.z***Test Failed***z	failures.zTest passed.)	r�rrr�rr)r�r*r%)
rjr�ZnotestsZpassedZfailedZtotaltZtotalfr�r+rWr6�thingr�r,r,r-�	summarize�sP
zDocTestRunner.summarizecCsR|j}|j��D]<\}\}}||kr@||\}}||}||}||f||<qdSrl)rr)rjr��dr+rWr6r7r8r,r,r-�mergeszDocTestRunner.merge)NNr")N)NNT)N)r6rprqr�r*r�r!r#r&r(r$rOr0r[r�r;rHrQrSrUr,r,r,r-rhs9
$
}



I
9c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)ra_
    A class used to check the whether the actual output from a doctest
    example matches the expected output.  `OutputChecker` defines two
    methods: `check_output`, which compares a given pair of outputs,
    and returns true if they match; and `output_difference`, which
    returns a string describing the differences between two outputs.
    cCst|�dd�d�S)z=
        Convert string to hex-escaped ASCII string.
        �ASCIIrA)r:rB)rjr]r,r,r-�_toAscii(szOutputChecker._toAsciicCs�|�|�}|�|�}||kr dS|t@sH||fdkr8dS||fdkrHdS|t@s�t�dt�t�d|�}t�dd|�}||kr�dS|t@r�d�|�	��}d�|�	��}||kr�dS|t
@r�t||�r�dSdS)	a�
        Return True iff the actual output from an example (`got`)
        matches the expected output (`want`).  These strings are
        always considered to match if they are identical; but
        depending on what option flags the test runner is using,
        several non-exact match types are also possible.  See the
        documentation for `TestRunner` for more information about
        option flags.
        T)zTrue
z1
)zFalse
z0
z(?m)^%s\s*?$r�z(?m)^[^\S\n]+$rZF)rWrrr[r\�escape�BLANKLINE_MARKERrr�rtrr|�rjrwrxrr,r,r-r+.s4

�
zOutputChecker.check_outputcCs<|ttBtB@sdS|t@r dS|�d�dko:|�d�dkS)NFTrFr4)r	r
rr�rZr,r,r-�_do_a_fancy_diffms��zOutputChecker._do_a_fancy_diffc
Cs(|j}|t@st�dt|�}|�|||�r�|jdd�}|jdd�}|t@rptj	||dd�}t
|�dd�}d}nZ|t@r�tj||dd�}t
|�dd�}d}n,|t
@r�tjtjd	�}	t
|	�||��}d
}nd|td�|��S|r�|r�d
t|�t|�fS|�rdt|�S|�r dt|�SdSdS)z�
        Return a string describing the differences between the
        expected output for a given example (`example`) and the actual
        output (`got`).  `optionflags` is the set of option flags used
        to compare `want` and `got`.
        z(?m)^[ ]*(?=
)Tr9r4)�nNz#unified diff with -expected +actualz-context diff with expected followed by actual)Zcharjunkzndiff with -expected +actualzDifferences (%s):
r�zExpected:
%sGot:
%szExpected:
%sGot nothing
zExpected nothing
Got:
%szExpected nothing
Got nothing
)rwrr[r\rYr[r=r	�difflibZunified_diff�listr
Zcontext_diffrZDifferZIS_CHARACTER_JUNKZcomparer_r�)
rjr rxrrwr�Z	got_linesZdiffZkindZenginer,r,r-r%�s4zOutputChecker.output_differenceN)r6rprqr�rWr+r[r%r,r,r,r-r s
?c@s eZdZdZdd�Zdd�ZdS)rz�A DocTest example has failed in debugging mode.

    The exception instance has variables:

    - test: the DocTest object being run

    - example: the Example object that failed

    - got: the actual output
    cCs||_||_||_dSrl)rr rx)rjrr rxr,r,r-r��szDocTestFailure.__init__cCs
t|j�Srl�r:rr�r,r,r-�__str__�szDocTestFailure.__str__N�r6rprqr�r�r`r,r,r,r-r�s
c@s eZdZdZdd�Zdd�ZdS)rz�A DocTest example has encountered an unexpected exception

    The exception instance has variables:

    - test: the DocTest object being run

    - example: the Example object that failed

    - exc_info: the exception info
    cCs||_||_||_dSrl)rr rd)rjrr rdr,r,r-r��szUnexpectedException.__init__cCs
t|j�Srlr_r�r,r,r-r`�szUnexpectedException.__str__Nrar,r,r,r-r�s
c@s*eZdZdZd
dd�Zdd�Zdd	�ZdS)ra�	Run doc tests but raise an exception as soon as there is a failure.

       If an unexpected exception occurs, an UnexpectedException is raised.
       It contains the test, the example, and the original exception:

         >>> runner = DebugRunner(verbose=False)
         >>> test = DocTestParser().get_doctest('>>> raise KeyError\n42',
         ...                                    {}, 'foo', 'foo.py', 0)
         >>> try:
         ...     runner.run(test)
         ... except UnexpectedException as f:
         ...     failure = f

         >>> failure.test is test
         True

         >>> failure.example.want
         '42\n'

         >>> exc_info = failure.exc_info
         >>> raise exc_info[1] # Already has the traceback
         Traceback (most recent call last):
         ...
         KeyError

       We wrap the original exception to give the calling application
       access to the test and example information.

       If the output doesn't match, then a DocTestFailure is raised:

         >>> test = DocTestParser().get_doctest('''
         ...      >>> x = 1
         ...      >>> x
         ...      2
         ...      ''', {}, 'foo', 'foo.py', 0)

         >>> try:
         ...    runner.run(test)
         ... except DocTestFailure as f:
         ...    failure = f

       DocTestFailure objects provide access to the test:

         >>> failure.test is test
         True

       As well as to the example:

         >>> failure.example.want
         '2\n'

       and the actual output:

         >>> failure.got
         '1\n'

       If a failure or error occurs, the globals are left intact:

         >>> del test.globs['__builtins__']
         >>> test.globs
         {'x': 1}

         >>> test = DocTestParser().get_doctest('''
         ...      >>> x = 2
         ...      >>> raise KeyError
         ...      ''', {}, 'foo', 'foo.py', 0)

         >>> runner.run(test)
         Traceback (most recent call last):
         ...
         doctest.UnexpectedException: <DocTest foo from foo.py:0 (2 examples)>

         >>> del test.globs['__builtins__']
         >>> test.globs
         {'x': 2}

       But the globals are cleared if there is no error:

         >>> test = DocTestParser().get_doctest('''
         ...      >>> x = 2
         ...      ''', {}, 'foo', 'foo.py', 0)

         >>> runner.run(test)
         TestResults(failed=0, attempted=1)

         >>> test.globs
         {}

       NTcCs$t�||||d�}|r |j��|S)NF)rrQr1rL)rjrr1r�rP�rr,r,r-rQ3s
zDebugRunner.runcCst|||��dSrl)rr'r,r,r-r(9sz'DebugRunner.report_unexpected_exceptioncCst|||��dSrl)rr"r,r,r-r&<szDebugRunner.report_failure)NNT)r6rprqr�rQr(r&r,r,r,r-r�sZ
TFc	Cs�|dkrtj�d�}t�|�s,td|f��|dkr:|j}t|d�}	|rVt||d�}
nt	||d�}
|	j
||||d�D]}|
�|�qt|r�|
��t
dkr�|
a
n
t
�|
�t|
j|
j�S)a*
m=None, name=None, globs=None, verbose=None, report=True,
       optionflags=0, extraglobs=None, raise_on_error=False,
       exclude_empty=False

    Test examples in docstrings in functions and classes reachable
    from module m (or the current module if m is not supplied), starting
    with m.__doc__.

    Also test examples reachable from dict m.__test__ if it exists and is
    not None.  m.__test__ maps names to functions, classes and strings;
    function and class docstrings are tested even if the name is private;
    strings are tested directly, as if they were docstrings.

    Return (#failures, #tests).

    See help(doctest) for an overview.

    Optional keyword arg "name" gives the name of the module; by default
    use m.__name__.

    Optional keyword arg "globs" gives a dict to be used as the globals
    when executing examples; by default, use m.__dict__.  A copy of this
    dict is actually used for each docstring, so that each docstring's
    examples start with a clean slate.

    Optional keyword arg "extraglobs" gives a dictionary that should be
    merged into the globals that are used to execute examples.  By
    default, no extra globals are used.  This is new in 2.4.

    Optional keyword arg "verbose" prints lots of stuff if true, prints
    only failures if false; by default, it's true iff "-v" is in sys.argv.

    Optional keyword arg "report" prints a summary at the end when true,
    else prints nothing at the end.  In verbose mode, the summary is
    detailed, else very brief (in fact, empty if all tests passed).

    Optional keyword arg "optionflags" or's together module constants,
    and defaults to 0.  This is new in 2.3.  Possible values (see the
    docs for details):

        DONT_ACCEPT_TRUE_FOR_1
        DONT_ACCEPT_BLANKLINE
        NORMALIZE_WHITESPACE
        ELLIPSIS
        SKIP
        IGNORE_EXCEPTION_DETAIL
        REPORT_UDIFF
        REPORT_CDIFF
        REPORT_NDIFF
        REPORT_ONLY_FIRST_FAILURE

    Optional keyword arg "raise_on_error" raises an exception on the
    first unexpected exception or failure. This allows failures to be
    post-mortem debugged.

    Advanced tomfoolery:  testmod runs methods of a local instance of
    class doctest.Tester, then merges the results into (or creates)
    global Tester instance doctest.master.  Methods of doctest.master
    can be called directly too, if you want to do something unusual.
    Passing report=0 to testmod is especially useful then, to delay
    displaying a summary.  Invoke doctest.master.summarize(verbose)
    when you're done fiddling.
    Nr�ztestmod: module required; %r)r��r�r�r1r�)r>r?r/r7r8rBr6rrrrvrQrS�masterrUr%rr)r�r+r1r��reportrr��raise_on_errorr��finder�runnerrr,r,r-rHs$E


cCs�|r|std��t||||pd�\}}|dkr:tj�|�}|dkrHi}n|��}|dk	rb|�|�d|krrd|d<|	r�t||d�}
nt||d�}
|
�	||||d�}|
�
|�|r�|
��tdkr�|
an
t�
|
�t|
j|
j�S)a


    Test examples in the given file.  Return (#failures, #tests).

    Optional keyword arg "module_relative" specifies how filenames
    should be interpreted:

      - If "module_relative" is True (the default), then "filename"
         specifies a module-relative path.  By default, this path is
         relative to the calling module's directory; but if the
         "package" argument is specified, then it is relative to that
         package.  To ensure os-independence, "filename" should use
         "/" characters to separate path segments, and should not
         be an absolute path (i.e., it may not begin with "/").

      - If "module_relative" is False, then "filename" specifies an
        os-specific path.  The path may be absolute or relative (to
        the current working directory).

    Optional keyword arg "name" gives the name of the test; by default
    use the file's basename.

    Optional keyword argument "package" is a Python package or the
    name of a Python package whose directory should be used as the
    base directory for a module relative filename.  If no package is
    specified, then the calling module's directory is used as the base
    directory for module relative filenames.  It is an error to
    specify "package" if "module_relative" is False.

    Optional keyword arg "globs" gives a dict to be used as the globals
    when executing examples; by default, use {}.  A copy of this dict
    is actually used for each docstring, so that each docstring's
    examples start with a clean slate.

    Optional keyword arg "extraglobs" gives a dictionary that should be
    merged into the globals that are used to execute examples.  By
    default, no extra globals are used.

    Optional keyword arg "verbose" prints lots of stuff if true, prints
    only failures if false; by default, it's true iff "-v" is in sys.argv.

    Optional keyword arg "report" prints a summary at the end when true,
    else prints nothing at the end.  In verbose mode, the summary is
    detailed, else very brief (in fact, empty if all tests passed).

    Optional keyword arg "optionflags" or's together module constants,
    and defaults to 0.  Possible values (see the docs for details):

        DONT_ACCEPT_TRUE_FOR_1
        DONT_ACCEPT_BLANKLINE
        NORMALIZE_WHITESPACE
        ELLIPSIS
        SKIP
        IGNORE_EXCEPTION_DETAIL
        REPORT_UDIFF
        REPORT_CDIFF
        REPORT_NDIFF
        REPORT_ONLY_FIRST_FAILURE

    Optional keyword arg "raise_on_error" raises an exception on the
    first unexpected exception or failure. This allows failures to be
    post-mortem debugged.

    Optional keyword arg "parser" specifies a DocTestParser (or
    subclass) that should be used to extract tests from the files.

    Optional keyword arg "encoding" specifies an encoding that should
    be used to convert the file to unicode.

    Advanced tomfoolery:  testmod runs methods of a local instance of
    class doctest.Tester, then merges the results into (or creates)
    global Tester instance doctest.master.  Methods of doctest.master
    can be called directly too, if you want to do something unusual.
    Passing report=0 to testmod is especially useful then, to delay
    displaying a summary.  Invoke doctest.master.summarize(verbose)
    when you're done fiddling.
    �8Package may only be specified for module-relative paths.r@Nr6r�rcr")r�rXr�r��basenamer�r�rrr�rQrSrerUr%rr)rTrVr+rUr1r�rfrr�rgr�rN�textrirr,r,r-r�s2R�


�NoNamec	Cs@t|dd�}t||d�}|j|||d�D]}|j||d�q(dS)ar
    Test examples in the given object's docstring (`f`), using `globs`
    as globals.  Optional argument `name` is used in failure messages.
    If the optional argument `verbose` is true, then generate output
    even if there are no failures.

    `compileflags` gives the set of flags that should be used by the
    Python compiler when running the examples.  If not specified, then
    it will default to the set of future-import flags that apply to
    `globs`.

    Optional keyword arg `optionflags` specifies options for the
    testing and output.  See the documentation for `testmod` for more
    information.
    F)r�r�rc)r1)r1N)rrrvrQ)	rWr1r�r+r1rrhrirr,r,r-r+scCs"|t@|krtd|��t}|a|S)a?Sets the unittest option flags.

    The old flag is returned so that a runner could restore the old
    value if it wished to:

      >>> import doctest
      >>> old = doctest._unittest_reportflags
      >>> doctest.set_unittest_reportflags(REPORT_NDIFF |
      ...                          REPORT_ONLY_FIRST_FAILURE) == old
      True

      >>> doctest._unittest_reportflags == (REPORT_NDIFF |
      ...                                   REPORT_ONLY_FIRST_FAILURE)
      True

    Only reporting flags can be set:

      >>> doctest.set_unittest_reportflags(ELLIPSIS)
      Traceback (most recent call last):
      ...
      ValueError: ('Only reporting flags allowed', 8)

      >>> doctest.set_unittest_reportflags(old) == (REPORT_NDIFF |
      ...                                   REPORT_ONLY_FIRST_FAILURE)
      True
    zOnly reporting flags allowed)r
r��_unittest_reportflags)r2�oldr,r,r-rHs

c@sleZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Ze
jZdd�ZdS)�DocTestCaser"NcCs.tj�|�||_||_||_||_||_dSrl)�unittest�TestCaser��_dt_optionflags�_dt_checker�_dt_test�	_dt_setUp�_dt_tearDown)rjrr�setUp�tearDownrr,r,r-r�nszDocTestCase.__init__cCs|j}|jdk	r|�|�dSrl)rurv�rjrr,r,r-rxxs
zDocTestCase.setUpcCs(|j}|jdk	r|�|�|j��dSrl)rurwr1rLrzr,r,r-ry~s

zDocTestCase.tearDowncCs~|j}tj}t�}|j}|t@s(|tO}t||jdd�}z d|_	|j
||jdd�\}}W5|t_X|rz|�|�
|�����dS)NF�rrr�zF----------------------------------------------------------------------)r�rP)rur>r�r#rsr
rnrrtr*rQrCZfailureException�format_failurerc)rjrro�newrrirrr,r,r-�runTest�s(��zDocTestCase.runTestcCsP|j}|jdkrd}n
d|j}d�|j�d�dd��}d|j|j|||fS)Nzunknown line numberz%sr�rrz:Failed doctest test for %s
  File "%s", line %s, in %s

%s)rur�r�r+rtrT)rj�errrr�Zlnamer,r,r-r|�s

�zDocTestCase.format_failurecCs6|��t|j|jdd�}|j|jdd�|��dS)a�Run the test case without results and without catching exceptions

           The unit test framework includes a debug method on test cases
           and test suites to support post-mortem debugging.  The test code
           is run in such a way that errors are not caught.  This way a
           caller can catch the errors and initiate post-mortem debugging.

           The DocTestCase provides a debug method that raises
           UnexpectedException errors if there is an unexpected
           exception:

             >>> test = DocTestParser().get_doctest('>>> raise KeyError\n42',
             ...                {}, 'foo', 'foo.py', 0)
             >>> case = DocTestCase(test)
             >>> try:
             ...     case.debug()
             ... except UnexpectedException as f:
             ...     failure = f

           The UnexpectedException contains the test, the example, and
           the original exception:

             >>> failure.test is test
             True

             >>> failure.example.want
             '42\n'

             >>> exc_info = failure.exc_info
             >>> raise exc_info[1] # Already has the traceback
             Traceback (most recent call last):
             ...
             KeyError

           If the output doesn't match, then a DocTestFailure is raised:

             >>> test = DocTestParser().get_doctest('''
             ...      >>> x = 1
             ...      >>> x
             ...      2
             ...      ''', {}, 'foo', 'foo.py', 0)
             >>> case = DocTestCase(test)

             >>> try:
             ...    case.debug()
             ... except DocTestFailure as f:
             ...    failure = f

           DocTestFailure objects provide access to the test:

             >>> failure.test is test
             True

           As well as to the example:

             >>> failure.example.want
             '2\n'

           and the actual output:

             >>> failure.got
             '1\n'

           Fr{)rPN)rxrrsrtrQrury)rjrir,r,r-r!�sB�zDocTestCase.debugcCs|jjSrl�rur+r�r,r,r-r��szDocTestCase.idcCsPt|�t|�k	rtS|j|jkoN|j|jkoN|j|jkoN|j|jkoN|j|jkSrl)r�r�rursrvrwrtr�r,r,r-r��s
�
�
�
�zDocTestCase.__eq__cCst|j|j|j|jf�Srl)r�rsrvrwrtr�r,r,r-r��s�zDocTestCase.__hash__cCs,|jj�d�}d|dd�|dd��fS)Nr�z%s (%s)rr)rur+rtr�)rjr+r,r,r-r�	szDocTestCase.__repr__cCsd|jjS)Nz	Doctest: r�r�r,r,r-�shortDescription		szDocTestCase.shortDescription)r"NNN)r6rprqr�rxryr~r|r!r�r�r�r�rr`r�r,r,r,r-rpls�

H
rpc@s0eZdZdd�Zdd�Zdd�Zdd�ZeZd	S)
�SkipDocTestCasecCs||_t�|d�dSrl)rCrpr�)rjrCr,r,r-r�
	szSkipDocTestCase.__init__cCs|�d�dS)Nz-DocTestSuite will not work with -O2 and above)ZskipTestr�r,r,r-rx	szSkipDocTestCase.setUpcCsdSrlr,r�r,r,r-�	test_skip	szSkipDocTestCase.test_skipcCsd|jjS)NzSkipping tests from %s)rCr6r�r,r,r-r�	sz SkipDocTestCase.shortDescriptionN)r6rprqr�rxr�r�r`r,r,r,r-r�	s
r�c@seZdZdd�ZdS)�
_DocTestSuitecCsdSrlr,)rj�indexr,r,r-�_removeTestAtIndex	sz _DocTestSuite._removeTestAtIndexN)r6rprqr�r,r,r,r-r�	sr�c	Ks�|dkrt�}t|�}|j|||d�}|sNtjjdkrNt�}|�t|��|S|�	�t�}|D]T}t
|j�dkrtq`|js�|j
}|dd�dkr�|dd�}||_|�t|f|��q`|S)a
    Convert doctest tests for a module to a unittest test suite.

    This converts each documentation string in a module that
    contains doctest tests to a unittest test case.  If any of the
    tests in a doc string fail, then the test case fails.  An exception
    is raised showing the name of the file containing the test and a
    (sometimes approximate) line number.

    The `module` argument provides the module to be tested.  The argument
    can be either a module or a module name.

    If no argument is given, the calling module is used.

    A number of options may be provided as keyword arguments:

    setUp
      A set-up function.  This is called before running the
      tests in each file. The setUp function will be passed a DocTest
      object.  The setUp function can access the test globals as the
      globs attribute of the test passed.

    tearDown
      A tear-down function.  This is called after running the
      tests in each file.  The tearDown function will be passed a DocTest
      object.  The tearDown function can access the test globals as the
      globs attribute of the test passed.

    globs
      A dictionary containing initial global variables for the tests.

    optionflags
       A set of doctest option flags expressed as an integer.
    Nrdr4r"r
rrr)rrDrvr>r2�optimizer��addTestr�r�r)r�rTr�rp)	rCr1r�Ztest_finderr�r��suiterrTr,r,r-r#	s(%c@s$eZdZdd�Zdd�Zdd�ZdS)�DocFileCasecCsd�|jj�d��S)NrNr�)r�rur+rtr�r,r,r-r�e	szDocFileCase.idcCs|jjSrl)rurTr�r,r,r-r�h	szDocFileCase.__repr__cCsd|jj|jj|fS)Nz2Failed doctest test for %s
  File "%s", line 0

%s)rur+rT)rjrr,r,r-r|k	s�zDocFileCase.format_failureN)r6rprqr�r�r|r,r,r,r-r�c	sr�c
Ksv|dkri}n|��}|r&|s&td��t||||p4d�\}}d|krL||d<tj�|�}|�||||d�}	t|	f|�S)Nrjr@r�r")r�r�rXr�r�rkr�r�)
r�rVrUr1r�rNr��docr+rr,r,r-�DocFileTestp	s�r�cOsDt�}|�dd�r$t|�d��|d<|D]}|�t|f|��q(|S)a�A unittest suite for one or more doctest files.

    The path to each doctest file is given as a string; the
    interpretation of that string depends on the keyword argument
    "module_relative".

    A number of options may be provided as keyword arguments:

    module_relative
      If "module_relative" is True, then the given file paths are
      interpreted as os-independent module-relative paths.  By
      default, these paths are relative to the calling module's
      directory; but if the "package" argument is specified, then
      they are relative to that package.  To ensure os-independence,
      "filename" should use "/" characters to separate path
      segments, and may not be an absolute path (i.e., it may not
      begin with "/").

      If "module_relative" is False, then the given file paths are
      interpreted as os-specific paths.  These paths may be absolute
      or relative (to the current working directory).

    package
      A Python package or the name of a Python package whose directory
      should be used as the base directory for module relative paths.
      If "package" is not specified, then the calling module's
      directory is used as the base directory for module relative
      filenames.  It is an error to specify "package" if
      "module_relative" is False.

    setUp
      A set-up function.  This is called before running the
      tests in each file. The setUp function will be passed a DocTest
      object.  The setUp function can access the test globals as the
      globs attribute of the test passed.

    tearDown
      A tear-down function.  This is called after running the
      tests in each file.  The tearDown function will be passed a DocTest
      object.  The tearDown function can access the test globals as the
      globs attribute of the test passed.

    globs
      A dictionary containing initial global variables for the tests.

    optionflags
      A set of doctest option flags expressed as an integer.

    parser
      A DocTestParser (or subclass) that should be used to extract
      tests from the files.

    encoding
      An encoding that will be used to convert the files to unicode.
    rVTrU)r�r/rDr�r�)�paths�kwr�r�r,r,r-r�	s8cCs�g}t��|�D]x}t|t�rh|�|jdd��|j}|r�|�d�|dd�|�d�dd�D�7}q|dd�|�d�dd�D�7}q|r�|ddkr�|��q�|r�|d	dkr�|�d	�q�d�	|�dS)
awExtract script from text with examples.

       Converts text with examples to a Python script.  Example input is
       converted to regular code.  Example output and all other words
       are converted to comments:

       >>> text = '''
       ...       Here are examples of simple math.
       ...
       ...           Python has super accurate integer addition
       ...
       ...           >>> 2 + 2
       ...           5
       ...
       ...           And very friendly error messages:
       ...
       ...           >>> 1/0
       ...           To Infinity
       ...           And
       ...           Beyond
       ...
       ...           You can use logic if you want:
       ...
       ...           >>> if 0:
       ...           ...    blah
       ...           ...    blah
       ...           ...
       ...
       ...           Ho hum
       ...           '''

       >>> print(script_from_examples(text))
       # Here are examples of simple math.
       #
       #     Python has super accurate integer addition
       #
       2 + 2
       # Expected:
       ## 5
       #
       #     And very friendly error messages:
       #
       1/0
       # Expected:
       ## To Infinity
       ## And
       ## Beyond
       #
       #     You can use logic if you want:
       #
       if 0:
          blah
          blah
       #
       #     Ho hum
       <BLANKLINE>
       Nrrz# Expected:cSsg|]}d|�qS)z## r,r�r,r,r-r�
sz(script_from_examples.<locals>.<listcomp>rFcSsg|]}t|��qSr,)r�r�r,r,r-r�
s�r}r")
rr�r9rr�r�rwrt�popr�)r]r�Zpiecerwr,r,r-r�	s :

"�

csJt|�}t��|�}�fdd�|D�}|s4t�d��|d}t|j�}|S)aExtract the test sources from a doctest docstring as a script.

    Provide the module (or dotted name of the module) containing the
    test to be debugged and the name (within the module) of the object
    with the doc string with tests to be debugged.
    csg|]}|j�kr|�qSr,r*)r�r6r*r,r-r�.
s
ztestsource.<locals>.<listcomp>znot found in testsr")rDrrvr�rr�)rCr+r�r�testsrcr,r*r-r%
s

cCst|�}t|||�dS)z4Debug a single doctest docstring, in argument `src`'N)r�debug_script)�src�pmr1r�r,r,r-r 5
scCs�ddl}|r|��}ni}|rvzt|||�Wq�tt��d�|jdd�}|��|�dt��d�Yq�Xn|jdd��	d|||�dS)z7Debug a test script.  `src` is the script, as a string.r"Nr&T)r�r4zexec(%r))
r�r�r,rr>rdr�rGZinteractionrQ)r�r�r1r��pr,r,r-r�:
s
r�cCs$t|�}t||�}t|||j�dS)z�Debug a single doctest docstring.

    Provide the module (or dotted name of the module) containing the
    test to be debugged and the name (within the module) of the object
    with the docstring with tests to be debugged.
    N)rDrr�r�)rCr+r�r�r,r,r-r!N
s
c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�
_TestClassz�
    A pointless class, for sanity-checking of docstring testing.

    Methods:
        square()
        get()

    >>> _TestClass(13).get() + _TestClass(-12).get()
    1
    >>> hex(_TestClass(13).square().get())
    '0xa9'
    cCs
||_dS)z�val -> _TestClass object with associated value val.

        >>> t = _TestClass(123)
        >>> print(t.get())
        123
        N�r)rjrr,r,r-r�j
sz_TestClass.__init__cCs|jd|_|S)zosquare() -> square TestClass's associated value

        >>> _TestClass(13).square().get()
        169
        r4r�r�r,r,r-�squaret
sz_TestClass.squarecCs|jS)z~get() -> return TestClass's associated value.

        >>> x = _TestClass(-42)
        >>> print(x.get())
        -42
        r�r�r,r,r-r/~
sz_TestClass.getN)r6rprqr�r�r�r/r,r,r,r-r�\
s


r�z�
                      Example of a string object, searched as-is.
                      >>> x = 1; y = 2
                      >>> x + y, x * y
                      (3, 2)
                      a�
                                    In 2.2, boolean expressions displayed
                                    0 or 1.  By default, we still accept
                                    them.  This can be disabled by passing
                                    DONT_ACCEPT_TRUE_FOR_1 to the new
                                    optionflags argument.
                                    >>> 4 == 4
                                    1
                                    >>> 4 == 4
                                    True
                                    >>> 4 > 4
                                    0
                                    >>> 4 > 4
                                    False
                                    z�
                Blank lines can be marked with <BLANKLINE>:
                    >>> print('foo\n\nbar\n')
                    foo
                    <BLANKLINE>
                    bar
                    <BLANKLINE>
            z�
                If the ellipsis flag is used, then '...' can be used to
                elide substrings in the desired output:
                    >>> print(list(range(1000))) #doctest: +ELLIPSIS
                    [0, 1, 2, ..., 999]
            a�
                If the whitespace normalization flag is used, then
                differences in whitespace are ignored.
                    >>> print(list(range(30))) #doctest: +NORMALIZE_WHITESPACE
                    [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
                     15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
                     27, 28, 29]
            )r�r�zbool-int equivalencezblank linesZellipsiszwhitespace normalizationcCs"ddl}|jdd�}|jdddddd	�|jd
ddt��gd
d�|jddddd�|jdddd�|��}|j}|j}d}|jD]}|t|O}q�|j	r�|t
O}|D]v}|�d�r�tj
�|�\}}tj
�d|�t|dd��}	tj
d=t|	||d�\}
}nt|d||d�\}
}|
r�dSq�dS)Nr"zdoctest runner)Zdescriptionrz	--verbose�
store_trueFz'print very verbose output for all tests)�action�default�helpz-oz--optionr�zqspecify a doctest option flag to apply to the test run; may be specified more than once to apply multiple options)r��choicesr�r�z-fz--fail-fastzystop running tests after first failure (this is a shorthand for -o FAIL_FAST, and is in addition to any other -o options))r�r�r`r�z file containing the tests to run)�nargsr�z.py���rc)rVr�rr&)�argparse�ArgumentParser�add_argumentr'�keys�
parse_argsr`r�r�Z	fail_fastrrir�r�rtr>�insertr;rr)r�r�r�Z	testfilesr�r�r�rT�dirnamer�rrNr,r,r-�_test�
sL�
�
��

�
r�r�)r4)rY)	NNNNTr"NFF)FrmNr")NNNN)FN)FN)F)Sr�Z
__docformat__�__all__r.r]r7r�r�r�r[r>rarq�ior#�collectionsr$r%r'rrrrrrrrr	r
rrrr
rYrsr3rDrJrXr_rfrgr|r�r�r�r�rOrrrrrr�	Exceptionrrrrerrrrnrrrrpr�Z	TestSuiter�rr�r�rrrr r�r!r�rr�r6�exitr,r,r,r-�<module>	sF'�-
���������

1%.DKl<;n�
h�
{�
$!
@
�
IR


,	�3-
__pycache__/filecmp.cpython-38.opt-1.pyc000064400000020355151153537570014003 0ustar00U

e5df&�@s�dZddlZddlZddlmZdddddgZiZd	Zd
ddd
ddddgZdd�Z	d"dd�Z
dd�Zdd�ZGdd�d�Z
d#dd�Zee
fdd�Zdd�Zdd �Zed!kr�e�dS)$z�Utilities for comparing files and directories.

Classes:
    dircmp

Functions:
    cmp(f1, f2, shallow=True) -> int
    cmpfiles(a, b, common) -> ([], [], [])
    clear_cache()

�N)�filterfalse�clear_cache�cmp�dircmp�cmpfiles�DEFAULT_IGNORESi ZRCSZCVSZtagsz.gitz.hgz.bzrZ_darcs�__pycache__cCst��dS)zClear the filecmp cache.N)�_cache�clear�rr�/usr/lib64/python3.8/filecmp.pyrsTcCs�tt�|��}tt�|��}|dtjks8|dtjkr<dS|rL||krLdS|d|dkr`dSt�||||f�}|dkr�t||�}tt�dkr�t�|t||||f<|S)a�Compare two files.

    Arguments:

    f1 -- First file name

    f2 -- Second file name

    shallow -- Just check stat signature (do not read the files).
               defaults to True.

    Return value:

    True if the files are the same, False otherwise.

    This function uses a cache for past comparisons and the results,
    with cache entries invalidated if their stat information
    changes.  The cache may be cleared by calling clear_cache().

    rFT�N�d)	�_sig�os�stat�S_IFREGr	�get�_do_cmp�lenr)�f1�f2�shallow�s1�s2Zoutcomerrrrs
cCst�|j�|j|jfS�N)r�S_IFMT�st_mode�st_size�st_mtime)�strrrrDs
�rc
Cs�t}t|d��n}t|d��X}|�|�}|�|�}||krPW5QR�W5QR�dS|sW5QR�W5QR�dSqW5QRXW5QRXdS)N�rbFT)�BUFSIZE�open�read)rr�bufsize�fp1�fp2Zb1Zb2rrrrIs

rc@s�eZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
ee	eeeeeeeeeeed�Zdd�ZdS)raMA class that manages the comparison of 2 directories.

    dircmp(a, b, ignore=None, hide=None)
      A and B are directories.
      IGNORE is a list of names to ignore,
        defaults to DEFAULT_IGNORES.
      HIDE is a list of names to hide,
        defaults to [os.curdir, os.pardir].

    High level usage:
      x = dircmp(dir1, dir2)
      x.report() -> prints a report on the differences between dir1 and dir2
       or
      x.report_partial_closure() -> prints report on differences between dir1
            and dir2, and reports on common immediate subdirectories.
      x.report_full_closure() -> like report_partial_closure,
            but fully recursive.

    Attributes:
     left_list, right_list: The files in dir1 and dir2,
        filtered by hide and ignore.
     common: a list of names in both dir1 and dir2.
     left_only, right_only: names only in dir1, dir2.
     common_dirs: subdirectories in both dir1 and dir2.
     common_files: files in both dir1 and dir2.
     common_funny: names in both dir1 and dir2 where the type differs between
        dir1 and dir2, or the name is not stat-able.
     same_files: list of identical files.
     diff_files: list of filenames which differ.
     funny_files: list of files which could not be compared.
     subdirs: a dictionary of dircmp objects, keyed by names in common_dirs.
     NcCsD||_||_|dkr$tjtjg|_n||_|dkr:t|_n||_dSr)�left�rightr�curdir�pardir�hider�ignore)�self�a�br-r,rrr�__init__xszdircmp.__init__cCsPtt�|j�|j|j�|_tt�|j�|j|j�|_|j�	�|j�	�dSr)
�_filterr�listdirr(r,r-�	left_listr)�
right_list�sort�r.rrr�phase0�s
�
�
z
dircmp.phase0cCs�ttttjj|j�|j��}ttttjj|j�|j��}tt|j	t
|j|���|_tt|j	t
|j|���|_tt|j	t
|j|���|_dSr)�dict�zip�mapr�path�normcaser4r5�list�__getitem__�filter�__contains__�commonr�	left_only�
right_only)r.r/r0rrr�phase1�s
z
dircmp.phase1c
Cs4g|_g|_g|_|jD�]}tj�|j|�}tj�|j|�}d}zt�	|�}Wn&t
k
rv}zd}W5d}~XYnXzt�	|�}Wn&t
k
r�}zd}W5d}~XYnX|�r"t	�|j�}t	�|j�}	||	kr�|j�
|�n>t	�|�r�|j�
|�n&t	�|��r|j�
|�n|j�
|�q|j�
|�qdS)Nr
r)�common_dirs�common_files�common_funnyrBrr<�joinr(r)r�OSErrorrr�append�S_ISDIR�S_ISREG)
r.�xZa_pathZb_path�okZa_statZwhyZb_statZa_typeZb_typerrr�phase2�s4
z
dircmp.phase2cCs&t|j|j|j�}|\|_|_|_dSr)rr(r)rG�
same_files�
diff_files�funny_files)r.Zxxrrr�phase3�sz
dircmp.phase3cCsNi|_|jD]<}tj�|j|�}tj�|j|�}t|||j|j	�|j|<qdSr)
�subdirsrFrr<rIr(r)rr-r,)r.rNZa_xZb_xrrr�phase4�s

z
dircmp.phase4cCs$|��|j��D]}|��qdSr)rVrU�values�phase4_closure�r.ZsdrrrrX�szdircmp.phase4_closurecCs�td|j|j�|jr2|j��td|jd|j�|jrT|j��td|jd|j�|jrp|j��td|j�|jr�|j��td|j�|jr�|j��td|j�|j	r�|j	��td|j	�|j
r�|j
��td|j
�dS)	NZdiffzOnly in�:zIdentical files :zDiffering files :zTrouble with common files :zCommon subdirectories :zCommon funny cases :)�printr(r)rCr6rDrQrRrSrFrHr7rrr�report�s,






z
dircmp.reportcCs*|��|j��D]}t�|��qdSr)r\rUrWr[rYrrr�report_partial_closure�szdircmp.report_partial_closurecCs*|��|j��D]}t�|��qdSr)r\rUrWr[�report_full_closurerYrrrr^�szdircmp.report_full_closure)rUrQrRrSrFrGrHrBrCrDr4r5cCs*||jkrt|��|j||�t||�Sr)�	methodmap�AttributeError�getattr)r.�attrrrr�__getattr__�s
zdircmp.__getattr__)NN)�__name__�
__module__�__qualname__�__doc__r1r8rErPrTrVrXr\r]r^r9r_rcrrrrrVs2!
#
�cCsJgggf}|D]6}tj�||�}tj�||�}|t|||��|�q|S)a]Compare common files in two directories.

    a, b -- directory names
    common -- list of file names found in both directories
    shallow -- if true, do comparison based solely on stat() information

    Returns a tuple of three lists:
      files that compare equal
      files that are different
      filenames that aren't regular files.

    )rr<rI�_cmprK)r/r0rBr�resrNZaxZbxrrrr�s
cCs0z|||||��WStk
r*YdSXdS)N�)rJ)r/r0Zsh�absrrrrrhsrhcCstt|j|��Sr)r>rrA)Zflist�skiprrrr2sr2cCsrddl}ddl}|�|jdd�d�\}}t|�dkrB|�dd��t|d|d�}d|krf|��n|��dS)Nrr
�rrjzneed exactly two args)z-r�)�sys�getopt�argvrZGetoptErrorrr^r\)rorpZoptions�argsZddrrr�demo$s
rs�__main__)T)T)rgrr�	itertoolsr�__all__r	r"rrrrrrrrkrhr2rsrdrrrr�<module>s6�
'
%
	__pycache__/pydoc.cpython-38.opt-1.pyc000064400000242752151153537570013511 0ustar00U

��.e̠�@s�dZdgZdZdZdZddlZddlZddlZddl	Zddl
ZddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlZddlZddlZddlmZddlmZdd	lmZd
d�Zdd
�Zdd�Z dd�Z!dd�Z"dd�Z#dd�Z$e�%dej&�Z'dd�Z(dd�Z)dd�Z*dd �Z+dxd!d"�Z,d#d$�Z-d%d&�Z.d'd(�Z/d)d*�Z0ifd+d,�Z1Gd-d.�d.e2�Z3d/d0�Z4difd1d2�Z5Gd3d4�d4�Z6Gd5d6�d6e�Z7Gd7d8�d8e6�Z8Gd9d:�d:e�Z9Gd;d<�d<e6�Z:Gd=d>�d>e:�Z;d?d@�a<dAdB�Z=dCdD�Z>dEdF�Z?dGdH�Z@dIdJ�ZAdKdL�ZBdMdN�ZCdOdP�ZDdydQdR�ZEe:�ZFe;�ZGe8�ZHdzdSdT�ZId{dVdW�ZJd|dXdY�ZKd}dZd[�ZLd~d]d^�ZMGd_d`�d`�ZNeN�ZOGdadb�db�ZPdcdd�ZQdedf�ZRddhdi�ZSd�djdkdl�dmdn�ZTdodp�ZUdqdr�ZVdsdt�ZWdudv�ZXeYdwk�r�eX�dS)�aGenerate Python documentation in HTML or text for interactive use.

At the Python interactive prompt, calling help(thing) on a Python object
documents the object, and calling help() starts up an interactive
help session.

Or, at the shell command line outside of Python:

Run "pydoc <name>" to show documentation on something.  <name> may be
the name of a function, module, package, or a dotted reference to a
class or function within a module or module in a package.  If the
argument contains a path segment delimiter (e.g. slash on Unix,
backslash on Windows) it is treated as the path to a Python source file.

Run "pydoc -k <keyword>" to search for a keyword in the synopsis lines
of all available modules.

Run "pydoc -n <hostname>" to start an HTTP server with the given
hostname (default: localhost) on the local machine.

Run "pydoc -p <port>" to start an HTTP server on the given port on the
local machine.  Port number 0 can be used to get an arbitrary unused port.

Run "pydoc -b" to start an HTTP server on an arbitrary unused port and
open a Web browser to interactively browse documentation.  Combine with
the -n and -p options to control the hostname and port used.

Run "pydoc -w <name>" to write out the HTML documentation for a module
to a file named "<name>.html".

Module docs for core modules are assumed to be in

    https://docs.python.org/X.Y/library/

This can be overridden by setting the PYTHONDOCS environment variable
to a different URL or to a local directory containing the Library
Reference Manual pages.
�helpzKa-Ping Yee <ping@lfw.org>z26 February 2001z�Guido van Rossum, for an excellent programming language.
Tommy Burnette, the original creator of manpy.
Paul Prescod, for all his work on onlinehelp.
Richard Chamberlain, for the first implementation of textdoc.
�N)�deque)�Repr)�format_exception_onlycCs\g}g}tjD]H}tj�|pd�}tj�|�}||krtj�|�r|�|�|�|�q|S)zAConvert sys.path into a list of absolute, existing, unique paths.�.)�sys�path�os�abspath�normcase�isdir�append)�dirsZnormdirs�dirZnormdir�r�/usr/lib64/python3.8/pydoc.py�pathdirsPs

rcCs.t�|�pt�|�}|r*t�dd|���p,dS)z-Get the doc string or comments for an object.z^ *
�)�inspect�getdocZgetcomments�re�sub�rstrip)�object�resultrrrr\srcCsf|���d�}t|�dkr&|ddfSt|�dkrX|d��sX|dd�|dd��fSdd�|�fS)z>Split a doc string into a synopsis line (if any) and the rest.�
�rr�N)�strip�split�lenr�join)�doc�linesrrr�splitdocasr$cCs"|j}|j|kr|jd|}|S)z@Get a class name and qualify it with a module name if necessary.r)�__name__�
__module__)r�modname�namerrr�	classnamejs
r)cCs>t�|�p:t�|�p:t�|�p:t�|�p:t�|�p:t�|�S)z>Check if an object is of a type that probably means it's data.)r�ismodule�isclass�	isroutineZisframeZistracebackZiscode�rrrr�isdataqs����r.cGs.|r*|d�|�|d��}|dd�}q|S)z/Do a series of global replacements on a string.rrrN)r!r)�textZpairsrrr�replacewsr0cCsXt|�|krTtd|dd�}td|d|�}|d|�d|t|�|d�S|S)zCOmit part of a string if needed to make it fit in a maximum length.r�rN�...)r �max)r/�maxlenZpreZpostrrr�cram~s
$r5z at 0x[0-9a-f]{6,16}(>+)$cCst�d|�S)z>Remove the hexadecimal id from a Python object representation.z\1)�_re_stripidr�r/rrr�stripid�sr8cCs<t�|�rdSt�|�r8t|dd�}t�|�p4|dkSdS)zo
    Returns True if fn is a bound method, regardless of whether
    fn was implemented in Python or in C.
    T�__self__NF)r�ismethod�	isbuiltin�getattrr*)�fn�selfrrr�_is_bound_method�s

r?cCs^i}t�|tj�D]\}}d||<q|jD]}|�t|��q*|��D]}t||�||<qF|S�Nr)r�
getmembersr,�	__bases__�update�
allmethods�keysr<)�cl�methods�key�value�baserrrrD�s

rDcCs8g}g}|D]"}||�r$|�|�q|�|�q||fS)z�Split sequence s via predicate, and return pair ([true], [false]).

    The return value is a 2-tuple of lists,
        ([x for x in s if predicate(x)],
         [x for x in s if not predicate(x)])
    �r
)�s�	predicateZyesZno�xrrr�_split_list�srOcCs\|dkrdS|�d�r$|�d�r$dS|�d�r<t|d�r<dS|dk	rL||kS|�d�SdS)	z3Decide whether to show documentation on a variable.>�	__slots__�__date__�__path__�__qualname__�__builtins__�__credits__�__doc__�
__author__�__version__�__file__r%�
__cached__r&�
__loader__�__spec__�__package__r�__r�_�_fieldsTN)�
startswith�endswith�hasattr)r(�all�objrrr�visiblename�srfcCsXg}t�|�D]D\}}}}t�|�r@d}t|t�r@|jdkr@d}|�||||f�q|S)zCWrap inspect.classify_class_attrs, with fixup for data descriptors.�data descriptorN�readonly property)r�classify_class_attrs�isdatadescriptor�
isinstance�property�fsetr
)r�resultsr(�kind�clsrIrrrri�s
rics\t|dg��z�fdd�t��D��Wntk
r>i�YnX�fdd�}|j|d�dS)zGSort the attrs list in-place by _fields and then alphabetically by namer`csi|]\}}||t���qSr)r )�.0�ir()�fieldsrr�
<dictcomp>�sz#sort_attributes.<locals>.<dictcomp>cs��|dd�|dfS�Nr)�get)�attr)�field_orderrr�<lambda>��z!sort_attributes.<locals>.<lambda>�rHN)r<�	enumerate�	TypeError�sort)�attrsrZkeyfuncr)rxrsr�sort_attributes�s
r�cCs:tj�|�r6dD]$}tj�tj�|d|��rdSqdS)z3Guess whether a path refers to a package directory.)z.pyz.pyc�__init__TF)r	rr�isfiler!)r�extrrr�	ispackage�s
r�cCs�|��}|dd�dks |��s0|��}|sq0q|��}|dd�dkrT|dd�}|dd�dkr�|dd�}|dd�dkr�|dd�}|��s�|��}|s�q�q�|�d�d	��}nd}|S)
Nr�#�zr"""r1�"""����\r)�readlinerr)�file�linerrrr�source_synopsis�s&r�c
	Cs t�|�j}|�|d�\}}|dks.||k�r|�ttjj��rJtjj	}n |�ttjj
��rftjj}nd}|dkr�zt�
|�}Wntk
r�YdSX|�t|�}W5QRXn^|d|�}tjjd||d�}ztj�|�}	WnYdSXtjd=|	j�r|	j��dnd}||f||<|S)z.Get the one-line summary out of a module file.)NNNZ__temp__��loaderr)r	�stat�st_mtimervrb�tuple�	importlib�	machinery�BYTECODE_SUFFIXES�SourcelessFileLoader�EXTENSION_SUFFIXES�ExtensionFileLoader�tokenize�open�OSErrorr��util�spec_from_file_location�
_bootstrap�_loadr�modulesrV�
splitlines)
�filename�cache�mtimeZ
lastupdaterZ
loader_clsr�r��spec�modulerrr�synopsis�s6



�r�c@s eZdZdZdd�Zdd�ZdS)�ErrorDuringImportzEErrors that occurred while trying to import something to document it.cCs||_|\|_|_|_dS�N)r��excrI�tb)r>r��exc_inforrrr�#szErrorDuringImport.__init__cCs|jj}d|j||jfS)Nzproblem in %s - %s: %s)r�r%r�rI)r>r�rrr�__str__'szErrorDuringImport.__str__N)r%r&rSrVr�r�rrrrr�!sr�c		Cs�tjj}t|d��}||�t|��k}W5QRXtj�|�}tj�	|�\}}|r`tj
�||�}ntj
�||�}tjj
|||d�}ztj�|�WSt|t����YnXdS)z<Import a Python source file or compiled file given its path.�rbr�N)r�r��MAGIC_NUMBERr��readr r	r�basename�splitext�_bootstrap_externalr��SourceFileLoaderr�r�r�r�rr�)	r�magicr�Zis_bytecoder�r(r�r�r�rrr�
importfile+sr�c	s z^|rT�tjkrT�tjkrT�fdd�tjD�}�g|D]}tj|||<tj|=q8t��}Wnzt��\}}}}	�tjkr�ttj�j|	��n>|tkr�t|j|	��n(t	|t
�r�|j�kr�YdSt�t����YnX��d�dd�D].}
zt
||
�}Wq�tk
�rYdSXq�|S)a�Import a module; handle errors; return None if the module isn't found.

    If the module *is* found but an exception occurs, it's wrapped in an
    ErrorDuringImport exception and reraised.  Unlike __import__, if a
    package path is specified, the module at the end of the path is returned,
    not the package at the beginning.  If the optional 'forceload' argument
    is 1, we reload the module from disk (unless it's a dynamic extension).csg|]}|��d�r|�qS)r)ra)rq�m�rrr�
<listcomp>Qszsafeimport.<locals>.<listcomp>Nrr)rr��builtin_module_names�
__import__r�r�rY�SyntaxErrorr��
issubclass�ImportErrorr(rr<�AttributeError)r�	forceloadr�ZsubsrHr�r�rIr��info�partrr�r�
safeimport=s.


r�c@sfeZdZej�ddejdd��Zddd�Z	d
dd�Z
e
ZZZ
ZZZe�d	�fd
d�ZdS)�Doc�
PYTHONDOCSz%https://docs.python.org/%d.%d/libraryNrcGs�||f|}zFt�|�r$|j|�WSt�|�r:|j|�WSt�|�rP|j|�WSWntk
rfYnXt�|�r||j	|�S|j
|�S)z%Generate documentation for an object.)rr*�	docmoduler+�docclassr,�
docroutiner�rj�docdata�docother)r>rr(�argsrrr�documentss




zDoc.documentcGs*d|odt|�t|�jf}t|��dS)z+Raise an exception for unimplemented types.z.don't know how to document object%s of type %s� N)�repr�typer%r})r>rr(r��messagerrr�fail�s
�zDoc.failZstdlibcCs�zt�|�}Wntk
r&d}YnXtj�d|j�}tj�|�}t	|t
t��r�|jdksz|�|�r�|�tj�
|d��s�|jdkr�|�d�r�d|�d�|j��f}q�tj�
||j��d	�}nd
}|S)z*Return the location of module docs or None�
(built-in)r�)
�errno�
exceptionsZgcZimp�marshal�posix�signalr�_threadZ	zipimportz
site-packages)z	xml.etreeztest.pydoc_mod)zhttp://zhttps://z%s/%s�/�.htmlN)r�
getabsfiler}r	�environrvr�rrrkr�r%rar!r�lower)r>rZbasedirr��doclocrrr�	getdocloc�s(
����
z
Doc.getdocloc)N)N)r%r&rSr	r�rvr�version_infor�r�r�r�r�r�r��docpropertyr��	sysconfigZget_pathr�rrrrr�ms��

r�c@sHeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZeZ	dd
�Z
eZdS)�HTMLReprzBClass for safely making an HTML representation of a Python object.cCs,t�|�d|_|_d|_d|_|_dS�N��
�d�rr��maxlist�maxtuple�maxdict�	maxstring�maxother�r>rrrr��s
zHTMLRepr.__init__cCst|dddddd�S)N�&z&amp;�<z&lt;�>z&gt;)r0�r>r/rrr�escape�szHTMLRepr.escapecCst�||�Sr�)rr��r>rrrrr��sz
HTMLRepr.reprcCsZtt|�d�r@dd�t|�j���}t||�r@t||�||�S|�ttt	|��|j
��S�Nr%�repr_r_)rcr�r!r%rr<r�r5r8r�r��r>rN�levelZ
methodnamerrr�repr1�s

zHTMLRepr.repr1cCs^t||j�}t|�}d|krJdt|dd�krJd|d|�|�|dSt�dd|�|��S)Nr��\\r�rrz-((\\[\\abfnrtv\'"]|\\[0-9]..|\\x..|\\u....)+)z<font color="#c040c0">\1</font>)r5r�r�r0r�rr�r>rNr�ZtestZtestreprrrr�repr_string�s�zHTMLRepr.repr_stringcCs@z|�ttt|��|j��WS|�d|jj�YSXdS�Nz
<%s instance>)r�r5r8r�r��	__class__r%�r>rNr�rrr�
repr_instance�szHTMLRepr.repr_instanceN)r%r&rSrVr�r�r�r�r��repr_strrZrepr_unicoderrrrr��sr�c@seZdZdZe�ZejZejZdd�Zd1dd�Z	d2d
d�Z
dd
�Zdd�Zd3dd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdiiifdd �Zd4d!d"�Zd5d#d$�Zddiifd%d&�Zd'd(�Zddiiidfd)d*�Zd6d+d,�ZeZd7d-d.�Zd8d/d0�ZdS)9�HTMLDocz'Formatter class for HTML documentation.cCsd||fS)�Format an HTML page.z�<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: %s</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body bgcolor="#f0f0f8">
%s
</body></html>r)r>�title�contentsrrr�page�s�zHTMLDoc.pagercCsd|||||pdfS)zFormat a page heading.a'
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="%s">
<td valign=bottom>&nbsp;<br>
<font color="%s" face="helvetica, arial">&nbsp;<br>%s</font></td
><td align=right valign=bottom
><font color="%s" face="helvetica, arial">%s</font></td></tr></table>
    �&nbsp;r)r>r�fgcol�bgcolZextrasrrr�heading�s�zHTMLDoc.heading�Nrc	
Cs^|dkrdd|d}d|||f}	|r@|	d||||f}	n|	d|||f}	|	d|S)	z Format a section with a heading.Nz<tt>rz</tt>z�<p>
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="%s">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="%s" face="helvetica, arial">%s</font></td></tr>
    zR
<tr bgcolor="%s"><td rowspan=2>%s</td>
<td colspan=2>%s</td></tr>
<tr><td>%s</td>z(
<tr><td bgcolor="%s">%s</td><td>%s</td>z'
<td width="100%%">%s</td></tr></table>r)
r>rr	r
r�widthZpreludeZ
marginaliaZgaprrrr�section�s�
��zHTMLDoc.sectioncGsd|}|j|f|��S)z$Format a section with a big heading.z<big><strong>%s</strong></big>)r)r>rr�rrr�
bigsectionszHTMLDoc.bigsectionc
Cs&|�|���}t|dddddddd�	S)z!Format literal preformatted text.�

z
 
r�rr�<br>
)r��
expandtabsr0r�rrr�	preformat
s�zHTMLDoc.preformatr�cCs�d}t|�|d|}t|�D]X}|dd|}t|||||�D]$}|t|�krJ||||�d}qJ|d}q d|S)z0Format a list of items into a multi-column list.rrz<td width="%d%%" valign=top>r�rz</td>z7<table width="100%%" summary="list"><tr>%s</tr></table>)r �range)r>�list�formatZcolsr�rows�colrrrrr�multicolumns
zHTMLDoc.multicolumncCsd|S)Nz<font color="#909090">%s</font>rr�rrr�greyrzzHTMLDoc.greycGs*|D] }||krd|||fSq|S)z:Make a link for an identifier, given name-to-URL mappings.�<a href="%s">%s</a>r)r>r(Zdicts�dictrrr�namelinkszHTMLDoc.namelinkcCsN|jtj�|j�}}t||�rDt||�|krDd|j|t||�fSt||�S)zMake a link for a class.z<a href="%s.html#%s">%s</a>)r%rr�rvr&rcr<r))r>rr'r(r�rrr�	classlink%s�zHTMLDoc.classlinkcCsd|j|jfS)zMake a link for a module.�<a href="%s.html">%s</a>)r%r�rrr�
modulelink-szHTMLDoc.modulelinkcCsR|\}}}}|r|�|�S|r,d||f}nd|}|rBd|}n|}d||fS)z;Make a link for a module or package to display in an index.z
%s.%s.htmlz%s.htmlz"<strong>%s</strong>&nbsp;(package)r)r)r>Z
modpkginfor(rr��shadowed�urlr/rrr�
modpkglink1s

zHTMLDoc.modpkglinkcCsd||fS)zMake a link to source file.z<a href="file:%s">%s</a>r)r>r"rrrr�filelink@szHTMLDoc.filelinkcCs�|p|j}g}d}t�d�}|�||�}	|	s0�qh|	��\}
}|�||||
���|	��\}}
}}}}|
r�||��dd�}|�d||f�n�|r�dt|�}|�d|||�f�n�|r�dt|�}|�d|||�f�n�|�r"|||d�d	k�r|�d
|�	||��n|�d|�n@|||d�d	k�rP|�|�	||||��n|�|�	||��|}q|�|||d���d
�
|�S)z�Mark up some plain text, given a context of symbols to look for.
        Each context dictionary maps object names to anchor names.rzD\b((http|ftp)://\S+[\w/]|RFC[- ]?(\d+)|PEP[- ]?(\d+)|(self\.)?(\w+))�"z&quot;rz'http://www.rfc-editor.org/rfc/rfc%d.txtz(http://www.python.org/dev/peps/pep-%04d/r�(zself.zself.<strong>%s</strong>Nr)r�r�compile�search�spanr
�groupsr0�intrr!)r>r/r��funcs�classesrGrn�here�pattern�match�start�endrdZschemeZrfcZpepZselfdotr(r"rrr�markupDs:

zHTMLDoc.markupc
Cs�d}|D]�}t|�td�kr�|\}}|d}||�||�}|r�||fkr�g}|D]}	|�|�|	|��qR|dd�|�d}|d}qt|�tg�kr|d|�|||�}qd	|S)
zAProduce HTML for a class tree as given by inspect.getclasstree().rrz"<dt><font face="helvetica, arial">r&�, �)z
</font></dt>z
<dd>
%s</dd>
z
<dl>
%s</dl>
)r�rr
r!�
formattree)
r>�treer'�parentr�entry�c�bases�parentsrJrrrr6os&
�
zHTMLDoc.formattreec#
s�|j}z
|j}Wntk
r(d}YnX|�d�}g}tt|�d�D],}|�dd�|d|d��||f�qHd�||dd��}	d|	}
z&t�	|�}t
j�|�}��
||�}
Wntk
r�d}
YnXg}t|d��r6t|j�}|dd	�d
k�r"|dd�dk�r"|d	d���}|�d��|��t|d
��rX|���t|j���|�rp|
dd�|�}
��|�}|dk	�r�dt�}nd}��|
ddd|
|�}t�|tj�}gi}}t�|tj�D]Z\}}|dk	�s�t�|��p�||k�r�t|||��r�|�||f�d|||<||<�q�|D]�\}}|jD]n}|j|j}}tj �!|�}||k�r@|�r@t||��r@t"||�|k�r@||k�r@|d|||<||<�q@�q2gi}}t�|tj#�D]p\}}|dk	�s�t�$|��s�t�|�|k�r�t|||��r�|�||f�d|||<t�%|��r�||||<�q�g}t�|t&�D]&\}}t|||��rN|�||f��qN��'t(|��j)||�}|�o�d|}|d|}t|d��rg}t*�+|j,�D]\}}} |�||| df��q�|�-���.|�j/�}!|��0ddd|!�}n.|�r<��.|�fdd��}!|��0d dd|!�}|�r�d!d"�|D�}"��1t�2|"d�|�g}!|D]"\}}|!���3|||||���qj|��0d#dd$d%�|!��}|�r�g}!|D]"\}}|!���3|||||���q�|��0d&dd'd%�|!��}|�r:g}!|D]\}}|!���3||���q|��0d(dd)d*�|!��}t|d+��rn��'t|j4��j)�}!|��0d,dd|!�}t|d-��r���'t|j5��j)�}!|��0d.dd|!�}|S)/z/Produce HTML documentation for a module object.Nrrz5<a href="%s.html"><font color="#ffffff">%s</font></a>r��)<big><big><strong>%s</strong></big></big>r�rX��$Revision: �$z
version %srQz (%s)r4z-<br><a href="%(docloc)s">Module Reference</a>r�#ffffff�#7799eez<a href=".">index</a><br>r�z.html#z#-z<tt>%s</tt>z
<p>%s</p>
rRrzPackage Contentsz#aa55cccs��|d�Sr@)r ��tr�rrry�rzz#HTMLDoc.docmodule.<locals>.<lambda>ZModulescSsg|]\}}|�qSrr�rqrHrIrrrr��sz%HTMLDoc.docmodule.<locals>.<listcomp>ZClasses�#ee77aar�Z	Functionsz#eeaa77ZDataz#55aa55rrWZAuthorrUZCredits)6r%�__all__r�rrr r
r!rr��urllib�parseZquoter$r}rc�strrXrr�rQr��localsrrAr*r+�	getmodulerfrBr&rr�rvr<r,r;�
isfunctionr.r3rr�pkgutil�iter_modulesrRr~rr#rr6�getclasstreer�rWrU)#r>rr(�mod�ignoredrd�partsZlinksrrZ
linkedname�headrr"r$r��versionr�rr�r-ZcdictrHrIrJr'r�r,Zfdict�datar"�modpkgs�importer�ispkgr�	classlistrr�rr��s*


��


$


�

�

 

���
��������zHTMLDoc.docmodulec	s��j}|p|}�j}g}	|	j�G�fdd�d�}
|
��tt����}t|�dkr�����d�|D]}�d��|�j	��qd�d���������fdd�}
����fd	d
�}��������fdd�}�fd
d�t
��D�}i�|D]n\}}}}d|d|�|<}zt�|�}Wntk
�r4YnXz|�|<Wq�t
k
�rXYq�Xq�|�rj|�rr|���n|dd�t|�fdd��\}}�tjk	�r��tjk�r�|}�q\n"��k�r�d}nd����j	�}|d7}t|��|
d||dd��}|
d||dd��}|
d||dd��}|d||dd��}|d||d d��}|d!||d"d��}|}�q\d#�|	�}	||k�r�d$||f}nd%|||f}|�r�g}|D]}|���|�j	���q�|d&d'�|�}d#}zt���}Wntt
fk
�rd(}YnX|�r8t|�}|�r8|d)k�r8|��|�d*}t��}|�rT||�pPd#}��|�j����}|�otd+|}��|d,d-|	d.|�S)/z.Produce HTML documentation for a class object.cs eZdZdd�Z�fdd�ZdS)z(HTMLDoc.docclass.<locals>.HorizontalRulecSs
d|_dSru�Zneedoner�rrrr�sz1HTMLDoc.docclass.<locals>.HorizontalRule.__init__cs|jr�d�d|_dS)Nz<hr>
rr[r���pushrr�maybe	sz.HTMLDoc.docclass.<locals>.HorizontalRule.maybeN�r%r&rSr�r^rr\rr�HorizontalRulesr`rz&<dl><dt>Method resolution order:</dt>
z<dd>%s</dd>
�</dl>
cs�t||�\}}|r�����|�|D]d\}}}}zt�|�}Wn&tk
rf���||���YnX���||��������d�q&|S)Nr�rOr^r<�	Exceptionr�r���msgrrM�okr(ro�homeclsrI�r-r,�hr�mdictrQrr]r>rr�spills"�
zHTMLDoc.docclass.<locals>.spillcsJt||�\}}|rF����|�|D]\}}}}���||���q&|Sr��rOr^r�rd�rirQr]r>rr�spilldescriptors+sz*HTMLDoc.docclass.<locals>.spilldescriptorsc
s�t||�\}}|r�����|�|D]�\}}}}��t�|�|��}t|�sXt�|�rft|dd�}	nd}	|	dkr��d|�n0��t|��j	����}	d|	}	�d||	f��d�q&|S)NrVz<dl><dt>%s</dl>
z<dd><tt>%s</tt>z<dl><dt>%s%s</dl>
r)
rOr^r�r<�callablerrjr3rr)
rerrMrfr(rorgrIrJr"rhrr�	spilldata4s(�
z#HTMLDoc.docclass.<locals>.spilldatacs,g|]$\}}}}t|�d�r||||f�qS�)re�rf�rqr(rorprIr-rrr�Is
�z$HTMLDoc.docclass.<locals>.<listcomp>r��-rcs|d�kS�NrrrC��	thisclassrrrybrzz"HTMLDoc.docclass.<locals>.<lambda>�defined here�inherited from %sz:<br>
z
Methods %scSs|ddkS�Nr�methodrrCrrrryrrzzClass methods %scSs|ddkS�Nrzclass methodrrCrrrrytrzzStatic methods %scSs|ddkS�Nrz
static methodrrCrrrryvrzzReadonly properties %scSs|ddkS�NrrhrrCrrrryxrzzData descriptors %scSs|ddkS�NrrgrrCrrrryzrzzData and other attributes %scSs|ddkS�NrrVrrCrrrry|rzrz*<a name="%s">class <strong>%s</strong></a>z/<strong>%s</strong> = <a name="%s">class %s</a>�(%s)r4N�()rz<tt>%s<br>&nbsp;</tt>z#000000z#ffc8d8r1)r%rBr
rr�getmror r^rr&rir<rcr}�popleftrO�builtinsrr�r!�	signature�
ValueErrorrJr�rr3rr)r>rr(rQr,r-rR�realnamer;rr`�mrorJrkrnrprrHrorgrI�anchor�	inherited�tagrr<�declr��argspecr"r)	r-r,rirjrQrr]r>rwrr��s�
�
	
�

�

�
�
�
�
�
�

��
zHTMLDoc.docclasscCs|�d|�|��S�z)Format an argument default value as text.�=)rr�r�rrr�formatvalue�szHTMLDoc.formatvaluec	Cs�|j}|p|}|r|jpdd|}	d}
d}t|�r�|jj}|rZ||k	r�d|�||�}
n0|jdk	rzd|�|jj|�}
nd|�||�}
t�|�s�t�|�r�d}
nd}
||kr�d	|	|f}nD|r�t�||g�|kr�d
|jd||f}d}n|}d|	||f}d}t�	|��rlzt�
|�}Wnttfk
�r>d}YnX|�rlt
|�}|d
k�rld|}|dd�}|�svd}|
||�|�|
�o�|�d|
�}|�r�d|S|�t|�|j|||�}|�o�d|}d||fSdS)z;Produce HTML documentation for a function or method object.rrtr� from N� method of %s instance� unbound %s method�async z$<a name="%s"><strong>%s</strong></a>z<a href="#%s">%s</a>rz)<a name="%s"><strong>%s</strong></a> = %s�<lambda>z$<strong>%s</strong> <em>lambda</em> r��(...)z'<font face="helvetica, arial">%s</font>z<dl><dt>%s</dt></dl>
z<dd><tt>%s</tt></dd>z<dl><dt>%s</dt>%s</dl>
)r%r?r9r�rr�iscoroutinefunction�isasyncgenfunction�getattr_staticr,r�r�r}rJr�rr3rr)r>rr(rQr,r-rGrFr�r��note�skipdocs�imclass�asyncqualifierrZreallinkr�r�r�r"rrrr��s|
�
���

��zHTMLDoc.docroutinecCsNg}|j}|r|d|�|�t|�|j�}|r<|d|�|d�d�|�S)z1Produce html documentation for a data descriptor.z!<dl><dt><strong>%s</strong></dt>
z<dd><tt>%s</tt></dd>
rar)r
r3rrr!�r>rr(rQrFrnr]r"rrrr��szHTMLDoc.docdatacGs|rd|pd}||�|�S)z-Produce HTML documentation for a data object.z<strong>%s</strong> = r�r�)r>rr(rQrRZlhsrrrr��szHTMLDoc.docothercCs�g}|dkri}t�|g�D]<\}}}tdd�|D��r:q|�|d|||kf�d||<q|��|�||j�}|�|dd|�S)z2Generate an HTML index for a directory of modules.Ncss*|]"}dt|�kodknVqdS)i�i��N)�ord�rqZchrrr�	<genexpr>�sz HTMLDoc.index.<locals>.<genexpr>rrrArF)rNrO�anyr
r~rr#r)r>rr!rWrXr(rYrrrr�index�s
z
HTMLDoc.index)r)rrNr)r�)N)NN)NNN)NN)N)r%r&rSrVr��_repr_instancer�r�rrrrrrrrrr r#r$r3r6r�r�r�r�r�r�r�r�rrrrr�sH

�

+

y&�
A

rc@s4eZdZdZdd�Zdd�Zdd�ZeZdd	�Zd
S)�TextReprzAClass for safely making a text representation of a Python object.cCs,t�|�d|_|_d|_d|_|_dSr�r�r�rrrr�
s
zTextRepr.__init__cCsTtt|�d�r@dd�t|�j���}t||�r@t||�||�Sttt|��|j	�Sr�)
rcr�r!r%rr<r5r8r�r�r�rrrr�s

zTextRepr.repr1cCsHt||j�}t|�}d|krDdt|dd�krDd|d||dS|S)Nr�r�rr�r)r5r�r�r0r�rrrr�s
zTextRepr.repr_stringcCs4zttt|��|j�WSd|jjYSXdSr�)r5r8r�r�r�r%rrrrr%szTextRepr.repr_instanceN)	r%r&rSrVr�r�r�rrrrrrr�s	r�c@s~eZdZdZe�ZejZdd�Zddd�Zdd�Z	ddd�Z
dd
d�Zddd�Zdd�Z
ddd�Zddd�ZeZddd�Zd	S) �TextDocz'Formatter class for text documentation.cCsd�dd�|D��S)z(Format a string in bold by overstriking.rcss|]}|d|VqdS)�Nrr�rrrr�5szTextDoc.bold.<locals>.<genexpr>)r!r�rrr�bold3szTextDoc.bold�    cs>|sdS�fdd�|�d�D�}|r4|d��|d<d�|�S)z6Indent text by prepending a given prefix to each line.rcsg|]}�|�qSrr�rqr���prefixrrr�:sz"TextDoc.indent.<locals>.<listcomp>rr�)rrr!)r>r/r�r#rr�r�indent7szTextDoc.indentcCs$|�|���}|�|�d|dS)z&Format a section with a given heading.rr)r�rr�)r>rrZclean_contentsrrrr>szTextDoc.sectionNrc
	s�d}|D]�}t|�td�krr|\}}||t|��}|rh||fkrh�fdd�|D�}	|dd�|	�}|d}qt|�tg�kr||�|�||d�}q|S)	zBRender in text a class tree as returned by inspect.getclasstree().rrc3s|]}t|��VqdSr��r))rqr:�r'rrr�Msz%TextDoc.formattree.<locals>.<genexpr>r�r4rr�)r�r)r!r6)
r>r7r'r8r�rr9r:r;r<rr�rr6Es"
�zTextDoc.formattreec	Cs$|j}tt|��\}}|�d||o(d|�}t|dd�}|�|�}|dk	r`||�d|d�}|rt||�d|�}g}	t�|tj�D]<\}
}|dk	s�t�	|�p�||kr�t
|
||�r�|	�|
|f�q�g}t�|tj�D]F\}
}|dk	�st�
|��st�	|�|kr�t
|
||�r�|�|
|f�q�g}
t�|t�D]&\}
}t
|
||��r.|
�|
|f��q.g}t�}t|d��r�t�|j�D]6\}}}|�|�|�r�|�|d	�n
|�|��qx|��||�d
d�|��}g}t�|tj�D]0\}
}|j�|d��r�|
|k�r�|�|
��q�|�r6|��||�d
d�|��}|	�r�dd�|	D�}|�t�|d�|�g}|	D]\}
}|�|�||
|���qd||�dd�|��}|�r�g}|D]\}
}|�|�||
|���q�||�dd�|��}|
�r&g}|
D]"\}
}|�|j||
|dd���q�||�dd�|��}t|d��r�t|j�}|dd�dk�rp|dd�dk�rp|dd���}||�d|�}t|d��r�||�dt|j ��}t|d��r�||�dt|j!��}t|d ��r�||�d!t|j"��}zt�#|�}Wnt$k
�rd"}YnX||�d#|�}|S)$z5Produce text documentation for a given module object.�NAME� - rGNzMODULE REFERENCEa.

The following documentation is automatically generated from the Python
source files.  It may be incomplete, incorrect or include features that
are considered implementation detail and may vary between Python
implementations.  When in doubt, consult the module reference at the
location listed above.
ZDESCRIPTIONrR�
 (package)zPACKAGE CONTENTSrrZ
SUBMODULEScSsg|]\}}|�qSrrrErrrr��sz%TextDoc.docmodule.<locals>.<listcomp>r�CLASSES�	FUNCTIONS�F)r4ZDATArXr>r?r�r@ZVERSIONrQZDATErWZAUTHORrUZCREDITSr�ZFILE)%r%r$rrr<r�rrAr+rLrfr
r,r;r.�setrcrNrOrR�addr~r!r*rar6rPr�r�rJrXrrQrWrUr�r})r>rr(rQZsynop�descrrdr�r-rHrIr,rVrWZ
modpkgs_namesrXr'rYZ
submodulesrZrrUr�rrrr�Us�
	�
��
��
�
$
zTextDoc.docmodulec	sL�j}|p|}�j}�jfdd�}||kr:d��|�}n��|�d|}|rlt||�}	|dd�|	�}g}
|
j�zt���}Wnt	t
fk
r�d}YnX|r�t|�}|r�|dkrʈ||d	�t��}
|
r�|
d	�t
t����}t|�d
k�r*�d�|D]}�d||���q
�d
�tdd�t���D�tjd�}t|�}d}|�r��d�|d|�D]}�d|��qn||k�r��dt||�d��d
�G�fdd�d�}|�������fdd�}����fdd�}�����fdd�}�fdd�t��D�}|�r|�r*|���n|dd
�t|�fd d!��\}}�tjk	�rn�tjk�rn|}�qn ��k�r~d"}nd#t��j�}t|��|d$||d%d!��}|d&||d'd!��}|d(||d)d!��}|d*||d+d!��}|d,||d-d!��}|d.||d/d!��}|}�qd	�|
�}
|
�s0|d	S|d	��|
��d0�d	S)1z4Produce text documentation for a given class object.cSs
t||�Sr�r�)r:r�rrr�makename�sz"TextDoc.docclass.<locals>.makename�class z	 = class r�r4Nr�rrzMethod resolution order:r�rcss.|]&}|j�d�s|jdkrt|j�VqdS)r_r�N)r%rar&rJ)rqrprrrr��s
�z#TextDoc.docclass.<locals>.<genexpr>r{r�zBuilt-in subclasses:z    ... and z other subclassescs eZdZdd�Z�fdd�ZdS)z(TextDoc.docclass.<locals>.HorizontalRulecSs
d|_dSrur[r�rrrr��sz1TextDoc.docclass.<locals>.HorizontalRule.__init__cs|jr�d�d|_dS)NzF----------------------------------------------------------------------rr[r�r\rrr^�sz.TextDoc.docclass.<locals>.HorizontalRule.maybeNr_rr\rrr`�sr`c
s�t||�\}}|r~����|�|D]V\}}}}zt�|�}Wn&tk
rf���||���Yq&X���||����q&|Sr�rbrd�rirQrr]r>rrrk�s�zTextDoc.docclass.<locals>.spillcsJt||�\}}|rF����|�|D]\}}}}���||���q&|Sr�rlrdrmrrrnsz*TextDoc.docclass.<locals>.spilldescriptorsc
	s�t||�\}}|r�����|�|D]v\}}}}t|�sDt�|�rNt|�}nd}zt�|�}	Wntk
r~|j|}	YnX��j	|	|�d|d�d�q&|S)Nr�)r4r"r)
rOr^rorrjrr<r��__dict__r�)
rerrMrfr(rorgrIr"rer�rrrps 
�z#TextDoc.docclass.<locals>.spilldatacs,g|]$\}}}}t|�d�r||||f�qSrqrrrsr-rrr�+s
�z$TextDoc.docclass.<locals>.<listcomp>rcs|d�kSrurrCrvrrry4rzz"TextDoc.docclass.<locals>.<lambda>rxryzMethods %s:
cSs|ddkSrzrrCrrrryCrzzClass methods %s:
cSs|ddkSr|rrCrrrryErzzStatic methods %s:
cSs|ddkSr}rrCrrrryGrzzReadonly properties %s:
cSs|ddkSr~rrCrrrryIrzzData descriptors %s:
cSs|ddkSrrrCrrrryKrzzData and other attributes %s:
cSs|ddkSr�rrCrrrryMrzz |  )r%rBr&r��mapr!r
rr�r�r}rJrrr�r �sortedr��__subclasses__r�rir�rOr�rr)r�r�r)r>rr(rQrRr�r;r�rr<rr�r�r"r�rJZ
subclassesZno_of_subclassesZMAX_SUBCLASSES_TO_DISPLAYZsubclassnamer`rkrnrprr�r�r)rirQrr]r>rwrr��s�

�

��	
�

�

�
�
�
�
�
�
zTextDoc.docclasscCsd|�|�Sr�r�r�rrrr�WszTextDoc.formatvaluec	Cs�|j}|p|}d}d}t|�rn|jj}|rB||k	rndt||�}n,|jdk	r`dt|jj|�}ndt||�}t�|�s�t�|�r�d}	nd}	||kr�|�|�}
n,|r�t�	||g�|kr�d}|�|�d	|}
d}t�
|��r<zt�|�}Wntt
fk
�rd}YnX|�r<t|�}|d
k�r<|�|�d}
|dd�}|�sFd
}|	|
||}
|�rd|
dSt|��ppd}|
d|�o�|�|���dSdS)z;Produce text documentation for a function or method object.rrr�Nr�r�r�r� = r�z lambda r�r�r)r%r?r9r�r)rr�r�r�r�r,r�r�r}rJrr�r)r>rr(rQrFr�r�r�r�r�rr�r�r�r"rrrr�[sV
�
�

zTextDoc.docroutinecCsTg}|j}|r$||�|��|d�t|�p.d}|rJ||�|��|d�d�|�S)z1Produce text documentation for a data descriptor.rr)r
r�rr�r!r�rrrr��szTextDoc.docdatac
Cs�|�|�}|rF|r|dpd|}|t|�}	|	dkrF|d|	�d}|rX|�|�dpZd|}|dk	r~|d|�t|��7}|S)z-Produce text documentation for a data object.r�rrNr2r)r�r r�r�rJ)
r>rr(rQr8r4r"r�r�Zchoprrrr��s
zTextDoc.docother)r�)Nr)NN)NN)NNN)NNN)NNNNN)r%r&rSrVr�r�r�r�r�rr6r�r�r�r�r�r�r�rrrrr�+s


e

7
r�c@seZdZdZdd�ZdS)�
_PlainTextDocz2Subclass of TextDoc which overrides string stylingcCs|Sr�rr�rrrr��sz_PlainTextDoc.boldN)r%r&rSrVr�rrrrr��sr�cCst�at|�dS)zCThe first time this is called, determine what kind of pager to use.N)�getpager�pagerr7rrrr��sr�c	s@ttjd�stSttjd�s tStj��r4tj��s8tStj�d�pNtj�d���r�tj	dkrj�fdd�Stj�d�dkr��fd	d�S�fd
d�Stj�d�dkr�tStj	dkr�dd�Sttd�r�t�
d
�dkr�dd�Sddl}|��\}}t�
|�z8ttd��r$t�
d|�dk�r$dd�W�StW�SW5t�|�XdS)z2Decide what method to use for paging through text.�isattyZMANPAGERZPAGER�win32cstt|���Sr���
tempfilepager�plainr7�Z	use_pagerrrry�rzzgetpager.<locals>.<lambda>ZTERM)ZdumbZemacscstt|���Sr�)�	pipepagerr�r7r�rrry�rzcs
t|��Sr��r�r7r�rrry�rzcSstt|�d�S)Nzmore <r�r7rrrry�rz�systemz(less) 2>/dev/nullrcSs
t|d�S)NZlessr�r7rrrry�rzNz	more "%s"cSs
t|d�S)NZmorer�r7rrrry�rz)rcr�stdin�
plainpager�stdoutr�r	r�rv�platformr��tempfileZmkstemp�close�unlink�ttypager)r��fdr�rr�rr��s6


 r�cCst�dd|�S)z%Remove boldface formatting from text.z.r)rrr7rrrr��sr�c	Cs�ddl}|j|d|jd�}zDtj|jdd��*}z|�|�Wntk
rPYnXW5QRXWntk
rrYnXz|�	�Wq�Wqttk
r�YqtXqtdS)z3Page through text by feeding it to another program.rNT)�shellr��backslashreplace)�errors)
�
subprocess�Popen�PIPE�io�
TextIOWrapperr��write�KeyboardInterruptr��wait)r/�cmdr��proc�piperrrr��sr�c
Cs~ddl}|���d}tj�|d�}t|ddtjdkr<t�d�ndd��}|�	|�W5QRXt�
|d|d	�W5QRXdS)
z<Page through text by invoking a program on a temporary file.rNz	pydoc.out�wr�r�)r��encodingz "r%)r�ZTemporaryDirectoryr	rr!r�rr��device_encodingr�r�)r/r�r�Ztempdirr�r�rrrr��s
��r�cCs$ttjdd�pd}|�|d��|�S)Nr��utf-8r�)r<rr��encode�decode)r/r�rrr�_escape_stdoutsr�c
Cs�tt|���d�}z2ddl}tj��}|�|�}|�|�dd�}Wn(t	t
tjfk
rld}dd�}YnX�z0zttj�dd��}Wntk
r�d}YnX|dkr�d	}|d}}tj�d�|d|��d�||d��r�tj�d
�tj��|�}	|	dk�rtj�d��q�n,|	d
k�rJtj�d||d�|d}q�|	dk�rn|||}|dk�rnd}tj�dd�||||��d�||}q�W5|�r�|�
||j|�XdS)z%Page through text on a text terminal.rrNcSstj�d�Sr@)rr�r�rrrrryrzzttypager.<locals>.<lambda>cSstj��dd�dd�S)Nr�r)rr�r�rrrrryrzZLINESr�z
-- more --)�q�Qz
          
)�
r)�b�B�)r�r�r�ttyrr��filenoZ	tcgetattrZ	setcbreakr�r�r��UnsupportedOperationZ	tcsetattrZ	TCSAFLUSHr+r	r�rvr�r�r�r!�flush)
r/r#r�r��oldZgetchar�hr�Zincr:rrrr�	sL








&r�cCstj�tt|���dS)z>Simply print unformatted text.  This is the ultimate fallback.N)rr�r�r�r�r7rrrr�5sr�cCs�t�|�r>|jtjkr d|jSt|d�r4d|jSd|jSt�|�rRd|jSt�|�rtd|jj	|jj|jfSt�
|�r�d|jj	|jj|jfSt�|�r�d|jSt�|�r�d	|jSt�
|�r�d
|jSt|�jS)z/Produce a short description of the given thing.zbuilt-in module rRzpackage zmodule zbuilt-in function zgetset descriptor %s.%s.%szmember descriptor %s.%s.%sr�z	function zmethod )rr*r%rr�rcr;Zisgetsetdescriptor�__objclass__r&Zismemberdescriptorr+rMr:r�)�thingrrr�describe9s6







�
�





r�c	Cs�dd�|�d�D�}d\}}|t|�kr\td�|d|d��|�}|r\||d}}qq\q|rf|}nt}||d�D],}zt||�}Wqvtk
r�YdSXqv|S)z@Locate an object by name or dotted path, importing as necessary.cSsg|]}|r|�qSrr)rqr�rrrr�Vszlocate.<locals>.<listcomp>rruNr)rr r�r!r�r<r�)rr�rSr��nZ
nextmodulerr�rrr�locateTs r�cCsVt|t�r0t||�}|dkr(td|��||fSt|dd�}|t|t�rL|ndfSdS)zDGiven an object or a path to an object, get the object and its name.Nz~No Python documentation found for %r.
Use help() to get the interactive help utility.
Use help(str) for help on the str class.r%)rkrJr�r�r<)r�r�rr(rrr�resolvems

�r�� Python Library Documentation: %scCs�|dkrt}t||�\}}t|�}t�|�}|rTd|krT|d|d|�d��7}n|rn||k	rn|d|j7}t�|�s�t�|�s�t�	|�s�t�
|�s�t|�}|d7}||d|�||�S)zBRender text documentation, given an object or a path to an object.Nrz in z in module z objectr)
r/r�r�rrL�rfindr%r*r+r,rjr�r�)r�rr�Zrendererrr(r�r�rrr�
render_doc{s&

���rc
Csfz2|dkrtt|||��n|�t|||t��Wn.ttfk
r`}zt|�W5d}~XYnXdS)zCDisplay text documentation, given an object or a path to an object.N)r�rr��	plaintextr�r��print)r�rr��outputrIrrrr"�sr"c
Cs�z`t||�\}}t�t|�t�||��}t|dddd��}|�|�W5QRXtd|d�Wn.tt	fk
r�}zt|�W5d}~XYnXdS)z<Write HTML documentation to a file in the current directory.r�r�r�)r�ZwroteN)
r��htmlrr�r�r�r�rr�r�)r�r�rr(rr�rIrrr�writedoc�srrcCs2|dkri}t�|g|�D]\}}}t|�qdS)zAWrite out HTML documentation for all modules in a directory tree.N)rN�
walk_packagesr)r�pkgpathZdonerXr'rYrrr�	writedocs�s

r
cJ@s"eZdZddddddddddd	d
ddd
ddddddddddddddddddddd�#Zd d!�d"D�Zd�e�d'd(d)d*d+d,d-�Zd.d/d0d1d2d3d4d5d6d7d8d9d9d:d:d;�Ze��D]:\ZZ	e	D],Z
e�e
e�Zeekr�ed<eZeee
<q�q�d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdLdMdNdOdPdQddRdSdSdTdUdVdWdXdYdZd[d\d]d^d_d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{ddd|d}d~dd��IZd�d�d��Z
ed�d���Zed�d���Zd�d��Ze�Zefd�d��Zd�d��Zd�d��Zd�d��Zd�d��Zd�d�d��Zd�d��Zd�d��Zd�d��Zd�d�d��Zd�d�d��Zd�d��Zd�d�d��Z d�S)��Helperr�BOOLEAN�with)�assertr)�asyncr)�awaitr)�break�	while for)�classzCLASSES SPECIALMETHODS)�continuer)Zfunctionr)�del�BASICMETHODS�if)�elser�try)�forzbreak continue while�import)�globalznonlocal NAMESPACES)r�
TRUTHVALUE)r�MODULES)�in�SEQUENCEMETHODS�
COMPARISON)�lambdar�)�nonlocalzglobal NAMESPACES)�passr)�raise�
EXCEPTIONS)�returnr�)rr&)�whilezbreak continue if TRUTHVALUE)r
z CONTEXTMANAGERS EXCEPTIONS yield)�yieldr)#�False�None�True�and�asrrrrrr�defr�elifr�except�finallyr�fromrrrr�isr"r#�not�orr$r%r'rr(r
r)cCsg|]}dD]}||�qqS)��'r%r)rq�pr�rrrr��szHelper.<listcomp>)r��fr��ur8�'''r%r�)�+rt�*�**r�z//�%�<<�>>r��|�^�~r�r��<=�>=�==�!=�<>)r�r�rFrGrHrIrJ)rtrE)z+=z-=z*=z/=z%=z&=z|=z^=z<<=z>>=z**=z//=)rArBr�rCrDrE)�j�J)�STRINGS�	OPERATORSr!�UNARY�AUGMENTEDASSIGNMENT�BITWISE�COMPLEXzOPERATORS FORMATTING�POWERzTUPLES LISTS FUNCTIONSz ATTRIBUTES FLOAT MODULES OBJECTS�ELLIPSISzSLICINGS DICTIONARYLITERALSz	def classrM�PRIVATENAMESzPRIVATENAMES SPECIALMETHODSZ
BACKQUOTESzTUPLES FUNCTIONS CALLSzLISTS SUBSCRIPTS SLICINGS)r@r?�,rr2�:�@r�r_r^�`r&r5�[�]r�)�typeszRSTRINGS UNICODE NUMBERS SEQUENCES MAPPINGS FUNCTIONS CLASSES MODULES FILES inspect)�stringsz4str UNICODE SEQUENCES STRINGMETHODS FORMATTING TYPES)zstring-methodszSTRINGS FORMATTING)Z
formatstringsrN)r]z:encodings unicode SEQUENCES STRINGMETHODS FORMATTING TYPES)ZnumberszINTEGER FLOAT COMPLEX TYPES)Zintegersz	int range)Zfloatingz
float math)Z	imaginaryz
complex cmath)Ztypesseqz$STRINGMETHODS FORMATTING range LISTS�DICTIONARIES)Ztypesfunctionsz	def TYPES)Ztypesmethodszclass def CLASSES TYPES)zbltin-code-objectszcompile FUNCTIONS TYPES)zbltin-type-objectsztypes TYPES�TYPES)zbltin-null-objectr)zbltin-ellipsis-object�SLICINGS)Zspecialattrsr)r\z!class SPECIALMETHODS PRIVATENAMES)Ztypesmodulesr)zoperator-summaryz�lambda or and not in is BOOLEAN COMPARISON BITWISE SHIFTING BINARY FORMATTING POWER UNARY ATTRIBUTES SUBSCRIPTS SLICINGS CALLS TUPLES LISTS DICTIONARIES�EXPRESSIONS)Zobjectsr_)ZspecialnameszbBASICMETHODS ATTRIBUTEMETHODS CALLABLEMETHODS SEQUENCEMETHODS MAPPINGMETHODS NUMBERMETHODS CLASSES)Z
customizationzhash repr str SPECIALMETHODS)zattribute-accesszATTRIBUTES SPECIALMETHODS)zcallable-typeszCALLS SPECIALMETHODS)�sequence-typesz(SEQUENCES SEQUENCEMETHODS SPECIALMETHODS)rbzMAPPINGS SPECIALMETHODS)z
numeric-typesz*NUMBERS AUGMENTEDASSIGNMENT SPECIALMETHODS)Z	execmodelz%NAMESPACES DYNAMICFEATURES EXCEPTIONS)Znamingz3global nonlocal ASSIGNMENT DELETION DYNAMICFEATURES)zdynamic-featuresr�
NAMESPACES)r�ztry except finally raise)Zconversionsr)Zidentifierszkeywords SPECIALIDENTIFIERS)z
id-classesr)zatom-identifiersr)z
atom-literalsz=STRINGS NUMBERS TUPLELITERALS LISTLITERALS DICTIONARYLITERALS�	SEQUENCES)Z	exprlistszTUPLES LITERALS)ztypesseq-mutable�LISTLITERALS)ZlistszLISTS LITERALS)Ztypesmapping�DICTIONARYLITERALS)rzDICTIONARIES LITERALS)zattribute-referencesz(getattr hasattr setattr ATTRIBUTEMETHODS)Z
subscriptionsr )Zslicingsr )Zcallsra)Zpowerra)Zunaryra)Zbinaryra)Zshiftingra)Zbitwisera)ZcomparisonszEXPRESSIONS BASICMETHODS)ZbooleanszEXPRESSIONS TRUTHVALUEr)Z
assignmentrP)Z	augassign�
NUMBERMETHODSrr')Zcompoundzfor while break continue)�truthz if while and or not BASICMETHODS)ZdebuggerZpdb)zcontext-managersr
)Ir_rMZ
STRINGMETHODSZ
FORMATTING�UNICODEZNUMBERSZINTEGERZFLOATrRrdZMAPPINGSr�ZMETHODSZCODEOBJECTSZTYPEOBJECTSZFRAMEOBJECTSZ
TRACEBACKSZNONErTZSPECIALATTRIBUTESr�rZPACKAGESrarNZ
PRECEDENCEZOBJECTSZSPECIALMETHODSrZATTRIBUTEMETHODSZCALLABLEMETHODSr ZMAPPINGMETHODSrgZ	EXECUTIONrcZDYNAMICFEATURESZSCOPINGZFRAMESr&ZCONVERSIONSZIDENTIFIERSZSPECIALIDENTIFIERSrUZLITERALSZTUPLESZ
TUPLELITERALSZLISTSrer^rfZ
ATTRIBUTESZ
SUBSCRIPTSr`ZCALLSrSrOZBINARYZSHIFTINGrQr!rZ	ASSERTIONZ
ASSIGNMENTrPZDELETIONZ	RETURNINGZ	IMPORTINGZCONDITIONALZLOOPINGrZ	DEBUGGINGZCONTEXTMANAGERSNcCs||_||_dSr�)�_input�_output)r>�inputrrrrr�^szHelper.__init__cCs|jp
tjSr�)rjrr�r�rrrrlbszHelper.inputcCs|jp
tjSr�)rkrr�r�rrrrfsz
Helper.outputcCs2t��dddkr|�dSd|jj|jjfS)Nrr1�?rz<%s.%s instance>)r�stackr�r&rSr�rrr�__repr__js�zHelper.__repr__cCs6||jk	r|�|�n|��|��|j�d�dS)Na
You are now leaving help and returning to the Python interpreter.
If you want to ask for help on a particular object directly from the
interpreter, you can type "help(object)".  Executing "help('string')"
has the same effect as typing a particular string at the help> prompt.
)�_GoInteractiver�intro�interactrr��r>Zrequestrrr�__call__rs

zHelper.__call__c	Cs�|j�d�z|�d�}|s Wq�Wnttfk
r>Yq�YnX|��}t|�dkr�|d|dkrpdkr�nn |d|dd�kr�|dd�}|��dkr�q�|d	kr�|��q|�	|�qdS)
Nrzhelp> rrr�r7r)r��quitr)
rr��getliner��EOFErrorrr r�rqrrsrrrrrs"

,�
zHelper.interactcCs8|jtjkrt|�S|j�|�|j��|j��SdS)z.Read one line, using input() when appropriate.N)rlrr�rr�r�r�)r>�promptrrrrv�s

zHelper.getlinecCs<t|�td�k�r|��}|dkr,|��n�|dkr>|��n�|dkrP|��n�|dkrb|��n�|dd�dkr�|�|��d�n�||jkr�|�|�nj|d	kr�t	t
|�d
�nR||jkr�|�|�n<||j
kr�|�|�n&|r�t	|d
|jd�nt	td
|jd�n$t|t��r|�nt	|d
|jd�|j�d�dS)
Nr�keywords�symbols�topicsr��zmodules r)r,r*r+zHelp on %s:)rr)r�r�listkeywords�listsymbols�
listtopics�listmodulesrrz�
showsymbolr"�evalry�	showtopicr{rkrJrkrrr�rsrrrr�s6






zHelper.helpcCs$|j�d�dtjdd���dS)Na�
Welcome to Python {0}'s help utility!

If this is your first time using Python, you should definitely check out
the tutorial on the Internet at https://docs.python.org/{0}/tutorial/.

Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules.  To quit this help utility and
return to the interpreter, just type "quit".

To get a list of available modules, keywords, symbols, or topics, type
"modules", "keywords", "symbols", or "topics".  Each module also comes
with a one-line summary of what it does; to list the modules whose name
or summary contain a given string such as "spam", type "modules spam".
z%d.%dr)rr�rrr�r�rrrrq�s
�zHelper.intror��Pc	
Cs�tt|��}||}t|�|d|}t|�D]v}t|�D]\}|||}|t|�kr<|j�||�||dkr<|j�dd|dt||��q<|j�d�q0dS)Nrr�r)rr�r rrr�)	r>�items�columnsr
Zcolwr�rowrrrrrrr�s&zHelper.listcCs |j�d�|�|j���dS)NzN
Here is a list of the Python keywords.  Enter any keyword to get more help.

)rr�rryrEr�rrrr}�szHelper.listkeywordscCs |j�d�|�|j���dS)Nzx
Here is a list of the punctuation symbols which Python assigns special meaning
to. Enter any symbol to get more help.

)rr�rrzrEr�rrrr~�szHelper.listsymbolscCs |j�d�|�|j���dS)NzN
Here is a list of available topics.  Enter any topic name to get more help.

)rr�rr{rEr�rrrr�szHelper.listtopicscCs0zddl}Wn"tk
r.|j�d�YdSX|j�||j�|��}|sb|j�dt|��dSt|�td�kr~|�	||�S|\}}z|jj|}Wn*t
k
r�|j�dt|��YdSX|��d}|r�|p�dd|}|�r$ddl}dd�
|���d}	|�|	d	�}
|d
d�
|
�7}t|�dS)Nr�t
Sorry, topic and keyword documentation is not available because the
module "pydoc_data.topics" could not be found.
zno documentation found for %s
rrr��Related help topics: r4�Hz
%s
)�pydoc_data.topicsr�rr�r{rvryr�r�r��KeyErrorr�textwrapr!rZwrapr�)r>�topic�
more_xrefs�
pydoc_data�target�label�xrefsr"r�r/Zwrapped_textrrrr��s4zHelper.showtopiccCs�zddl}Wntk
r"YdSX|j�||j�|��}|sFtd��t|t�r\|�||�S|\}}|jj|}|r�|pzdd|}||fS)a*Return unbuffered tuple of (topic, xrefs).

        If an error occurs here, the exception is caught and displayed by
        the url handler.

        This function duplicates the showtopic method but returns its
        result directly so it can be formatted for display in an html page.
        rN)r�rzcould not find topicrr�)	r�r�r{rvryr�rkrJ�	_gettopic)r>r�r�r�r�r�r�r"rrrr�s	
zHelper._gettopiccCs*|j|}|�d�\}}}|�||�dS)Nr�)rz�	partitionr�)r>�symbolr�r�r_r�rrrr�!s
zHelper.showsymbolcsv|r |j�d�|��t|�nR|j�d�i}|fdd���fdd�}t�j�|d�|�|���|j�d�dS)	Nzy
Here is a list of modules whose name or summary contains '{}'.
If there are any, enter a module name to get more help.

zI
Please wait a moment while I gather a list of all available modules...

cSs>|r$|dd�dkr$|dd�d}|�d�dkr:d||<dS)N����	.__init__r�rrr)�find)rr'r�r�rrr�callback4sz$Helper.listmodules.<locals>.callbackcs�d|d�dSr�rr��r�rr�onerror9sz#Helper.listmodules.<locals>.onerror�r�z�
Enter any module name to get more help.  Or, type "modules spam" to search
for modules whose name or summary contain the string "spam".
)rr�r�apropos�
ModuleScanner�runrrE)r>rHr�r�rr�rr�&s
�
zHelper.listmodules)r8r<r%r�)NN)r�r�)r)r)r)!r%r&rSryZ_strprefixesZ_symbols_inverserzr�r�Zsymbols_r�rvr{r�rlrlrrorrprtrrrvrrqrr}r~rr�r�r�r�rrrrr�sB�'���W



	


 
rc@seZdZdZddd�ZdS)r�z7An interruptible scanner that searches module synopses.Nc	Cs
|r|��}d|_i}tjD]p}|dkrd||<|dkrF|d|d�qt|�jpRd}|�d�d}|d|}|���|�dkr|d||�qtj	|d�D�]\\}	}}
|jr��q�|dkr�|d|d�q�zt�
|	|�}Wntk
r�Yq�YnX|j}t
|d	��rnz|�|�}
Wn(tk
�r:|�r2||�Yq�YnXtt�|
���pNd}t
|d
��rh|�|�}nd}n`ztj�|�}Wn(tk
�r�|�r�||�Yq�YnX|j�r�|j��dnd}t|dd�}|d|}|���|�dkr�||||�q�|�r|�dS)NF�__main__rrrrr�r��
get_source�get_filenamerY)r�rurr�r�rVrr�rNr�	_get_specr�r�rcr�rcr�r��StringIOr�r�r�r�r�r�r<)r>r�rHZ	completerr��seenr'r(r�rXrYr�r��sourcerr�rrrr�Gs`



zModuleScanner.run)NNN)r%r&rSrVr�rrrrr�Dsr�c	CsDdd�}dd�}t���"t�d�t�j|||d�W5QRXdS)zAPrint all the one-line module summaries that contain a substring.cSs6|dd�dkr |dd�d}t||o.d|�dS�Nr�r�r�z- )r�rr'r�rrrr��szapropos.<locals>.callbackcSsdSr�rr�rrrr��szapropos.<locals>.onerror�ignorer�N)�warnings�catch_warnings�filterwarningsr�r�)rHr�r�rrrr��s


r�cs�ddl�ddl�ddl�ddl�Gdd�d�jj��G�fdd�d�jj��G�����fdd�d�j�}||||�}|��|j	s�|j
s�t�d	�q~|S)
aAStart an HTTP server thread on a specific port.

    Start an HTML/text server thread, so HTML or text documents can be
    browsed dynamically and interactively with a Web browser.  Example use:

        >>> import time
        >>> import pydoc

        Define a URL handler.  To determine what the client is asking
        for, check the URL and content_type.

        Then get or generate some text or HTML code and return it.

        >>> def my_url_handler(url, content_type):
        ...     text = 'the URL sent was: (%s, %s)' % (url, content_type)
        ...     return text

        Start server thread on port 0.
        If you use port 0, the server will pick a random port number.
        You can then use serverthread.port to get the port number.

        >>> port = 0
        >>> serverthread = pydoc._start_server(my_url_handler, port)

        Check that the server is really started.  If it is, open browser
        and get first page.  Use serverthread.url as the starting page.

        >>> if serverthread.serving:
        ...    import webbrowser

        The next two lines are commented out so a browser doesn't open if
        doctest is run on this module.

        #...    webbrowser.open(serverthread.url)
        #True

        Let the server do its thing. We just need to monitor its status.
        Use time.sleep so the loop doesn't hog the CPU.

        >>> starttime = time.monotonic()
        >>> timeout = 1                    #seconds

        This is a short timeout for testing purposes.

        >>> while serverthread.serving:
        ...     time.sleep(.01)
        ...     if serverthread.serving and time.monotonic() - starttime > timeout:
        ...          serverthread.stop()
        ...          break

        Print any errors that may have occurred.

        >>> print(serverthread.error)
        None
   rNc@seZdZdd�Zdd�ZdS)z!_start_server.<locals>.DocHandlercSsX|j�d�rd}nd}|�d�|�dd|�|��|j�|�|j|��d��dS)	z�Process a request from an HTML browser.

            The URL received is in self.path.
            Get an HTML page from self.urlhandler and send it.
            z.css�text/css�	text/html��zContent-Typez%s; charset=UTF-8r�N)	rrbZ
send_responseZsend_headerZend_headersZwfiler��
urlhandlerr�)r>�content_typerrr�do_GET�s

��z(_start_server.<locals>.DocHandler.do_GETcWsdSr�r)r>r�rrr�log_message�sz-_start_server.<locals>.DocHandler.log_messageN)r%r&rSr�r�rrrr�
DocHandler�sr�cs(eZdZdd�Z�fdd�Zdd�ZdS)z _start_server.<locals>.DocServercSs6||_|j|f|_||_|j�||j|j�d|_dS�NF)�hostZaddressr�rJr��handlerru)r>r��portr�rrrr��s
z)_start_server.<locals>.DocServer.__init__cs>|js2��|j��gggd�\}}}|r|��q|��dSr@)ru�selectZsocketr�Zhandle_requestZserver_close)r>ZrdZwrZex�r�rr�serve_until_quit�s

z1_start_server.<locals>.DocServer.serve_until_quitcSs |j�|�|jr|�|�dSr�)rJ�server_activater�r�rrrr��sz0_start_server.<locals>.DocServer.server_activateN)r%r&rSr�r�r�rr�rr�	DocServer�sr�cs:eZdZ�fdd�Z����fdd�Zdd�Zdd�Zd	S)
z#_start_server.<locals>.ServerThreadcs2||_||_t|�|_�j�|�d|_d|_dSr�)r�r�r+r��Threadr��serving�error)r>r�r�r�)�	threadingrrr��s
z,_start_server.<locals>.ServerThread.__init__c
sxzJ�jj�_��_�jj�_t|j��_�|j	|j
|j�}||_|�
�Wn(tk
rr}z
||_W5d}~XYnXdS)zStart the server.N)�server�
HTTPServerrJr�r�ZMessageZMessageClass�staticmethodr�r�r��ready�	docserverr�rcr�)r>Zdocsvr�e)r�r��email�httprrr�	s

z'_start_server.<locals>.ServerThread.runcSs,d|_|j|_|j|_d|j|jf|_dS)NTz
http://%s:%d/)r�r�Zserver_portr�r")r>r�rrrr�	sz)_start_server.<locals>.ServerThread.readycSs&d|j_|��d|_d|_d|_dS)z&Stop the server and this thread nicelyTNF)r�rur!r�r"r�rrr�stop	s
z(_start_server.<locals>.ServerThread.stopN)r%r&rSr�r�r�r�r)r�r�r�r�r�rr�ServerThread�s
r�g{�G�z�?)
Zhttp.serverZ
email.messager�r�r�ZBaseHTTPRequestHandlerr�r�r1r�r��time�sleep)r��hostnamer�r��threadr)r�r�r�r�r�r�r�
_start_server�s8'r�r�c
s(G�fdd�dt�}|���fdd���fdd���fdd���fd	d
���fdd���fd
d���fdd���fdd����������fdd�}|�d�r�|dd�}|dk�rtj�tj�t��}tj�||�}t|��}d�|�	��W5QR�SQRXn|dk�r||�St
d||f��dS)aThe pydoc url handler for use with the pydoc server.

    If the content_type is 'text/css', the _pydoc.css style
    sheet is read and returned if it exits.

    If the content_type is 'text/html', then the result of
    get_html_page(url) is returned.
    cseZdZ�fdd�ZdS)z_url_handler.<locals>._HTMLDoccsd}d|}d||��|fS)rzpydoc_data/_pydoc.cssz1<link rel="stylesheet" type="text/css" href="%s">a<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Pydoc: %s</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
%s</head><body bgcolor="#f0f0f8">%s<div style="clear:both;padding-top:.5em;">%s</div>
</body></html>r)r>rr�css_pathZcss_link��html_navbarrrr2	s���z#_url_handler.<locals>._HTMLDoc.pageN)r%r&rSrrr�rr�_HTMLDoc0	sr�cs>��dt��t��dt��f�}d|��tjdd��fS)Nz%s [%s, %s]raZ
            <div style='float:left'>
                Python %s<br>%s
            </div>
            <div style='float:right'>
                <div style='text-align:center'>
                  <a href="index.html">Module Index</a>
                  : <a href="topics.html">Topics</a>
                  : <a href="keywords.html">Keywords</a>
                </div>
                <div>
                    <form action="get" style='display:inline;'>
                      <input type=text name=key size=15>
                      <input type=submit value="Get">
                    </form>&nbsp;
                    <form action="search" style='display:inline;'>
                      <input type=text name=key size=15>
                      <input type=submit value="Search">
                    </form>
                </div>
            </div>
            T)Zterse)r�r�Zpython_versionZpython_buildZpython_compiler)rU�rrrr�B	s
��z!_url_handler.<locals>.html_navbarcs�dd�}��ddd�}dd�tjD�}��||�}|d��d	dd
|�g}i}tjD]}|���||��qT|�d�dd
�|�fS)zModule Index page.cSsd||fS�Nrr�r(rrr�	bltinlink`	sz3_url_handler.<locals>.html_index.<locals>.bltinlinkz7<big><big><strong>Index of Modules</strong></big></big>rArBcSsg|]}|dkr|�qS)r�r)rqr(rrrr�f	s�z4_url_handler.<locals>.html_index.<locals>.<listcomp>z<p>zBuilt-in ModulesrFz|<p align=right><font color="#909090" face="helvetica,arial"><strong>pydoc</strong> by Ka-Ping Yee&lt;ping@lfw.org&gt;</font>zIndex of Modulesr)	rrr�rrrr
r�r!)r�r�namesrr�rr�rr�
html_index]	s*��
�z _url_handler.<locals>.html_indexc		s�g��fdd�}t���*t�d�dd�}t�j|||d�W5QRXdd�}g}��d	d
d�}�D]\}}|�||�|�qf|��d|d
d
d�|��}d|fS)zSearch results page.cs:|dd�dkr |dd�d}��||o0d|f�dSr�rKr��Z
search_resultrrr�{	sz3_url_handler.<locals>.html_search.<locals>.callbackr�cSsdSr�rr�rrrr��	sz2_url_handler.<locals>.html_search.<locals>.onerrorr�cSsd||fSr�rr�rrrr��	sz4_url_handler.<locals>.html_search.<locals>.bltinlinkz5<big><big><strong>Search Results</strong></big></big>rArBzkey = %srF�<br>zSearch Results)	r�r�r�r�r�rr
rr!)	rHr�r�r�rnrr(r�rr�r�r�html_searchv	s,

��z!_url_handler.<locals>.html_searchcsLdd�}��ddd�}ttj���}��||�}|��ddd|�}d|fS)zIndex of topic texts available.cSsd||fS�Nz<a href="topic?key=%s">%s</a>rr�rrrr��	sz4_url_handler.<locals>.html_topics.<locals>.bltinlink�,<big><big><strong>INDEX</strong></big></big>rArBZTopicsrF)rr�rr{rErr)r�rr�rr�rr�html_topics�	s��z!_url_handler.<locals>.html_topicscsL��ddd�}ttj���}dd�}��||�}|��ddd|�}d|fS)zIndex of keywords.r�rArBcSsd||fSr�rr�rrrr��	sz6_url_handler.<locals>.html_keywords.<locals>.bltinlinkZKeywordsrF)rr�rryrErr)rr�r�rr�rr�
html_keywords�	s��z#_url_handler.<locals>.html_keywordscs�t��}t||�}|�|�\}}||jkr0d}nd}��d|dd�}d��|�}��|dd|�}|r�t|�	��}dd	�}��
||�}��d
dd|�}d||fd�|||f�fS)
zTopic or keyword help page.ZKEYWORDZTOPICr=rArBz
<pre>%s</pre>rFcSsd||fSr�rr�rrrr��	sz7_url_handler.<locals>.html_topicpage.<locals>.bltinlinkr�z%s %sr)
r�r�rr�ryrr3rr�rrrr!)r�ZbufZhtmlhelprr�rrr�r�rr�html_topicpage�	s2

��
�z$_url_handler.<locals>.html_topicpagecs@t|dd�}|dkr$|dkr$td��t|�}��||�}||fS)Nr)r�r+zcould not find object)r�r�r�r�)r"rer�contentr�rr�html_getobj�	sz!_url_handler.<locals>.html_getobjcsP��ddd�}d��fdd�tt|�|�D��}|��|dd|�}d||fS)	Nz,<big><big><strong>Error</strong></big></big>rArBr�c3s|]}��|�VqdSr�)r�r�r�rrr��	sz3_url_handler.<locals>.html_error.<locals>.<genexpr>z#bb0000z
Error - %s)rr!rr�r)r"r�rrr�rr�
html_error�	s���z _url_handler.<locals>.html_errorc
sr|}|�d�r|dd�}�z|dkr2��\}}n�|dkrF��\}}n�|dkrZ��\}}n�d|k�r$|�d�\}}}|dkr��|�\}}n�|d	kr�z�|�\}}Wn tk
r��|�\}}YnXn\|d
k�r|dkr��\}}n4z�|�\}}Wn"tk
�r�|�\}}YnXntd��n�|�\}}Wn2tk
�rd}z�||�\}}W5d}~XYnX��||�S)zGenerate an HTML page for url.r�N���)rr�r{ryr�z
search?keyz	topic?keyzget?keyz
bad pydoc url)rbr�r�rcr)r"Zcomplete_urlrr��opr_r�)rr�r�r�r�r�r�r�rr�
get_html_page�	s>



 z#_url_handler.<locals>.get_html_pager�rNr�rr�z"unknown content type %r for url %s)rrar	r�dirname�realpathrYr!r��	readlinesr})r"r�r�r�Z	path_herer��fpr)	rr�r�r�r�r�r�r�r�r�_url_handler'	s*	
(


"
r�T�	localhost)�open_browserr�c	Cs�ddl}tt||�}|jr(t|j�dS|jr�d}|rB|�|j�z~zZtd|j�t|�|jr�t	d�}|�
�}|dkr|q�qZ|dkr�|�|j�qZt|�qZWnttfk
r�t�YnXW5|jr�|��td�XdS)	z�Start the enhanced pydoc Web server and open a Web browser.

    Use port '0' to start the server on an arbitrary port.
    Set open_browser to False to suppress opening a browser.
    rNz"Server commands: [b]rowser, [q]uitzServer stoppedzServer ready atzserver> r�r�)
�
webbrowserr�r�r�rr�r�r"r�rlr�r�rw)r�r�r�r�ZserverthreadZserver_help_msgr�rrr�browse
s2
r�cCst|t�o|�tj�dkSru)rkrJr�r	�sep)rNrrr�ispath9
sr�cCsvd|kstj|kst��|kr"dStj�t�}tj�|�}|��}||krbtj�||�sb|�|�|�	dt���|S)z�Ensures current directory is on returned path, and argv0 directory is not

    Exception: argv0 dir is left alone if it's also pydoc's directory.

    Returns a new path entry list, or None if no adjustment is needed.
    rNr)
r	�curdir�getcwdrr�rY�copy�samefile�remove�insert)Z
given_pathZargv0Z
stdlib_dirZ
script_dir�revised_pathrrr�_get_revised_path<
s

r�cCs,ttjtjd�}|dk	r(|tjdd�<dS)z�Ensures current directory is on sys.path, and __main__ directory is not.

    Exception: __main__ dir is left alone if it's also pydoc's directory.
    rN)r�rr�argv)r�rrr�_adjust_cli_sys_pathX
sr�cCs�ddl}Gdd�dt�}t��zv|�tjdd�d�\}}d}d}d}d}d}|D]\\}	}
|	d	krld
}d
}|	dkr�t|
�WdS|	dkr�d
}|
}|	d
kr�d
}|	dkrTd
}|
}qT|r�t|||d�WdS|s�|�|D]�}t|��rtj	�
|��std|��q�z`t|��r&tj	�|��r&t
|�}|�rXt|��rNtj	�|��rNt|�nt|�n
t�|�Wq�tk
�r�}zt|�W5d}~XYq�Xq�WnN|j|fk
�r�tj	�tj	�tjd��d}
tdj|
tjd��YnXdS)z@Command-line interface (looks at sys.argv to decide what to do).rNc@seZdZdS)zcli.<locals>.BadUsageN)r%r&rSrrrr�BadUsagee
sr�rzbk:n:p:wFr�z-bTz-kz-pz-wz-n)r�r�zfile %r does not exista�pydoc - the Python documentation tool

{cmd} <name> ...
    Show text documentation on something.  <name> may be the name of a
    Python keyword, topic, function, module, or package, or a dotted
    reference to a class or function within a module or module in a
    package.  If <name> contains a '{sep}', it is used as the path to a
    Python source file to document. If name is 'keywords', 'topics',
    or 'modules', a listing of these things is displayed.

{cmd} -k <keyword>
    Search for a keyword in the synopsis lines of all available modules.

{cmd} -n <hostname>
    Start an HTTP server with the given hostname (default: localhost).

{cmd} -p <port>
    Start an HTTP server on the given port on the local machine.  Port
    number 0 can be used to get an arbitrary unused port.

{cmd} -b
    Start an HTTP server on an arbitrary unused port and open a Web browser
    to interactively browse documentation.  This option can be used in
    combination with -n and/or -p.

{cmd} -w <name> ...
    Write out the HTML documentation for a module to a file in the current
    directory.  If <name> contains a '{sep}', it is treated as a filename; if
    it names a directory, documentation is written for all the contents.
)r�r�)�getoptrcr�rr�r�r�r�r	r�existsrr�r�rr
rrr�r�r�r�rr�)rr�Zoptsr�ZwritingZstart_serverr�r�r��opt�val�argrIr�rrr�clib
sd

 �rr�)NN)r)r)rrN)rrN)r)rN)r�)r)ZrVrGrWrQrUr�Zimportlib._bootstrapr�Zimportlib._bootstrap_external�importlib.machinery�importlib.utilrr�r	rNr�rrr�r�r�Zurllib.parserHr��collectionsr�reprlibr�	tracebackrrrr$r)r.r0r5r'�
IGNORECASEr6r8r?rDrOrfrir�r�r�r�rcr�r�r�r�r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r/rrr�rr"rr
rrr�r�r�r�r�r�r�r�rr%rrrr�<module>s�&
	


'
0:*> ",

�
�


=
n%
U
__pycache__/socketserver.cpython-38.pyc000064400000061423151153537570014145 0ustar00U

e5d�j�	@sdZdZddlZddlZddlZddlZddlZddlmZddl	m
Z	dddd	d
ddd
dg	Zeed�rxe�
dddg�eed�r�e�
ddddg�eed�r�ejZnejZGdd�d�ZGdd�de�ZGdd�de�Zeed�r�Gdd�d�ZGdd�de�ZGdd �d �ZGd!d�d�Zeed��rNGd"d�dee�ZGd#d�dee�ZGd$d	�d	ee�ZGd%d
�d
ee�Zeed��r�Gd&d�de�ZGd'd�de�ZGd(d�dee�ZGd)d�dee�Z Gd*d�d�Z!Gd+d�de!�Z"Gd,d-�d-e�Z#Gd.d
�d
e!�Z$dS)/aqGeneric socket server classes.

This module tries to capture the various aspects of defining a server:

For socket-based servers:

- address family:
        - AF_INET{,6}: IP (Internet Protocol) sockets (default)
        - AF_UNIX: Unix domain sockets
        - others, e.g. AF_DECNET are conceivable (see <socket.h>
- socket type:
        - SOCK_STREAM (reliable stream, e.g. TCP)
        - SOCK_DGRAM (datagrams, e.g. UDP)

For request-based servers (including socket-based):

- client address verification before further looking at the request
        (This is actually a hook for any processing that needs to look
         at the request before anything else, e.g. logging)
- how to handle multiple requests:
        - synchronous (one request is handled at a time)
        - forking (each request is handled by a new process)
        - threading (each request is handled by a new thread)

The classes in this module favor the server type that is simplest to
write: a synchronous TCP/IP server.  This is bad class design, but
saves some typing.  (There's also the issue that a deep class hierarchy
slows down method lookups.)

There are five classes in an inheritance diagram, four of which represent
synchronous servers of four types:

        +------------+
        | BaseServer |
        +------------+
              |
              v
        +-----------+        +------------------+
        | TCPServer |------->| UnixStreamServer |
        +-----------+        +------------------+
              |
              v
        +-----------+        +--------------------+
        | UDPServer |------->| UnixDatagramServer |
        +-----------+        +--------------------+

Note that UnixDatagramServer derives from UDPServer, not from
UnixStreamServer -- the only difference between an IP and a Unix
stream server is the address family, which is simply repeated in both
unix server classes.

Forking and threading versions of each type of server can be created
using the ForkingMixIn and ThreadingMixIn mix-in classes.  For
instance, a threading UDP server class is created as follows:

        class ThreadingUDPServer(ThreadingMixIn, UDPServer): pass

The Mix-in class must come first, since it overrides a method defined
in UDPServer! Setting the various member variables also changes
the behavior of the underlying server mechanism.

To implement a service, you must derive a class from
BaseRequestHandler and redefine its handle() method.  You can then run
various versions of the service by combining one of the server classes
with your request handler class.

The request handler class must be different for datagram or stream
services.  This can be hidden by using the request handler
subclasses StreamRequestHandler or DatagramRequestHandler.

Of course, you still have to use your head!

For instance, it makes no sense to use a forking server if the service
contains state in memory that can be modified by requests (since the
modifications in the child process would never reach the initial state
kept in the parent process and passed to each child).  In this case,
you can use a threading server, but you will probably have to use
locks to avoid two requests that come in nearly simultaneous to apply
conflicting changes to the server state.

On the other hand, if you are building e.g. an HTTP server, where all
data is stored externally (e.g. in the file system), a synchronous
class will essentially render the service "deaf" while one request is
being handled -- which may be for a very long time if a client is slow
to read all the data it has requested.  Here a threading or forking
server is appropriate.

In some cases, it may be appropriate to process part of a request
synchronously, but to finish processing in a forked child depending on
the request data.  This can be implemented by using a synchronous
server and doing an explicit fork in the request handler class
handle() method.

Another approach to handling multiple simultaneous requests in an
environment that supports neither threads nor fork (or where these are
too expensive or inappropriate for the service) is to maintain an
explicit table of partially finished requests and to use a selector to
decide which request to work on next (or whether to handle a new
incoming request).  This is particularly important for stream services
where each client can potentially be connected for a long time (if
threads or subprocesses cannot be used).

Future work:
- Standard classes for Sun RPC (which uses either UDP or TCP)
- Standard mix-in classes to implement various authentication
  and encryption schemes

XXX Open problems:
- What to do with out-of-band data?

BaseServer:
- split generic "request" functionality out into BaseServer class.
  Copyright (C) 2000  Luke Kenneth Casson Leighton <lkcl@samba.org>

  example: read entries from a SQL database (requires overriding
  get_request() to return a table entry from the database).
  entry is processed by a RequestHandlerClass.

z0.4�N)�BufferedIOBase)�	monotonic�
BaseServer�	TCPServer�	UDPServer�ThreadingUDPServer�ThreadingTCPServer�BaseRequestHandler�StreamRequestHandler�DatagramRequestHandler�ThreadingMixIn�fork�ForkingUDPServer�ForkingTCPServer�ForkingMixIn�AF_UNIX�UnixStreamServer�UnixDatagramServer�ThreadingUnixStreamServer�ThreadingUnixDatagramServer�PollSelectorc@s�eZdZdZdZdd�Zdd�Zd&dd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�ZdS)'ra�Base class for server classes.

    Methods for the caller:

    - __init__(server_address, RequestHandlerClass)
    - serve_forever(poll_interval=0.5)
    - shutdown()
    - handle_request()  # if you do not use serve_forever()
    - fileno() -> int   # for selector

    Methods that may be overridden:

    - server_bind()
    - server_activate()
    - get_request() -> request, client_address
    - handle_timeout()
    - verify_request(request, client_address)
    - server_close()
    - process_request(request, client_address)
    - shutdown_request(request)
    - close_request(request)
    - service_actions()
    - handle_error()

    Methods for derived classes:

    - finish_request(request, client_address)

    Class variables that may be overridden by derived classes or
    instances:

    - timeout
    - address_family
    - socket_type
    - allow_reuse_address

    Instance variables:

    - RequestHandlerClass
    - socket

    NcCs ||_||_t��|_d|_dS)�/Constructor.  May be extended, do not override.FN)�server_address�RequestHandlerClass�	threadingZEvent�_BaseServer__is_shut_down�_BaseServer__shutdown_request)�selfrr�r�$/usr/lib64/python3.8/socketserver.py�__init__�s
zBaseServer.__init__cCsdS�zSCalled by constructor to activate the server.

        May be overridden.

        Nr�rrrr�server_activate�szBaseServer.server_activate��?c	Cst|j��zRt��B}|�|tj�|jsP|�|�}|jr:qP|rF|�	�|�
�q"W5QRXW5d|_|j��XdS)z�Handle one request at a time until shutdown.

        Polls for shutdown every poll_interval seconds. Ignores
        self.timeout. If you need to do periodic tasks, do them in
        another thread.
        FN)r�clearr�set�_ServerSelector�register�	selectors�
EVENT_READ�select�_handle_request_noblock�service_actions)rZ
poll_interval�selector�readyrrr�
serve_forever�s

zBaseServer.serve_forevercCsd|_|j��dS)z�Stops the serve_forever loop.

        Blocks until the loop has finished. This must be called while
        serve_forever() is running in another thread, or it will
        deadlock.
        TN)rr�waitr"rrr�shutdown�szBaseServer.shutdowncCsdS)z�Called by the serve_forever() loop.

        May be overridden by a subclass / Mixin to implement any code that
        needs to be run during the loop.
        Nrr"rrrr-�szBaseServer.service_actionsc
Cs�|j��}|dkr|j}n|jdk	r0t||j�}|dk	rBt�|}t��f}|�|tj�|�	|�}|rz|�
�W5QR�S|dk	rX|t�}|dkrX|��W5QR�SqXW5QRXdS)zOHandle one request, possibly blocking.

        Respects self.timeout.
        Nr)�socketZ
gettimeout�timeout�min�timer'r(r)r*r+r,�handle_timeout)rr4Zdeadliner.r/rrr�handle_requests 




zBaseServer.handle_requestcCs�z|��\}}Wntk
r&YdSX|�||�r�z|�||�Wq�tk
rn|�||�|�|�Yq�|�|��Yq�Xn
|�|�dS)z�Handle one request, without blocking.

        I assume that selector.select() has returned that the socket is
        readable before this function was called, so there should be no risk of
        blocking in get_request().
        N)�get_request�OSError�verify_request�process_request�	Exception�handle_error�shutdown_request�r�request�client_addressrrrr,/s

z"BaseServer._handle_request_noblockcCsdS)zcCalled if no new request arrives within self.timeout.

        Overridden by ForkingMixIn.
        Nrr"rrrr7FszBaseServer.handle_timeoutcCsdS)znVerify the request.  May be overridden.

        Return True if we should proceed with this request.

        Trr@rrrr;MszBaseServer.verify_requestcCs|�||�|�|�dS)zVCall finish_request.

        Overridden by ForkingMixIn and ThreadingMixIn.

        N)�finish_requestr?r@rrrr<UszBaseServer.process_requestcCsdS�zDCalled to clean-up the server.

        May be overridden.

        Nrr"rrr�server_close^szBaseServer.server_closecCs|�|||�dS)z8Finish one request by instantiating RequestHandlerClass.N)rr@rrrrCfszBaseServer.finish_requestcCs|�|�dS�z3Called to shutdown and close an individual request.N��
close_request�rrArrrr?jszBaseServer.shutdown_requestcCsdS�z)Called to clean up an individual request.NrrIrrrrHnszBaseServer.close_requestcCs@tdtjd�td|tjd�ddl}|��tdtjd�dS)ztHandle an error gracefully.  May be overridden.

        The default is to print a traceback and continue.

        z(----------------------------------------)�filez4Exception happened during processing of request fromrN)�print�sys�stderr�	traceback�	print_exc)rrArBrOrrrr>rs�zBaseServer.handle_errorcCs|S�Nrr"rrr�	__enter__szBaseServer.__enter__cGs|��dSrQ)rE)r�argsrrr�__exit__�szBaseServer.__exit__)r$)�__name__�
__module__�__qualname__�__doc__r4r r#r0r2r-r8r,r7r;r<rErCr?rHr>rRrTrrrrr�s&+

	
c@sfeZdZdZejZejZdZ	dZ
ddd�Zdd�Zd	d
�Z
dd�Zd
d�Zdd�Zdd�Zdd�ZdS)ra3Base class for various socket-based server classes.

    Defaults to synchronous IP stream (i.e., TCP).

    Methods for the caller:

    - __init__(server_address, RequestHandlerClass, bind_and_activate=True)
    - serve_forever(poll_interval=0.5)
    - shutdown()
    - handle_request()  # if you don't use serve_forever()
    - fileno() -> int   # for selector

    Methods that may be overridden:

    - server_bind()
    - server_activate()
    - get_request() -> request, client_address
    - handle_timeout()
    - verify_request(request, client_address)
    - process_request(request, client_address)
    - shutdown_request(request)
    - close_request(request)
    - handle_error()

    Methods for derived classes:

    - finish_request(request, client_address)

    Class variables that may be overridden by derived classes or
    instances:

    - timeout
    - address_family
    - socket_type
    - request_queue_size (only for stream sockets)
    - allow_reuse_address

    Instance variables:

    - server_address
    - RequestHandlerClass
    - socket

    �FTcCsTt�|||�t�|j|j�|_|rPz|��|��Wn|���YnXdS)rN)rr r3�address_family�socket_type�server_bindr#rE)rrrZbind_and_activaterrrr �s�zTCPServer.__init__cCs8|jr|j�tjtjd�|j�|j�|j��|_dS)zOCalled by constructor to bind the socket.

        May be overridden.

        �N)�allow_reuse_addressr3�
setsockoptZ
SOL_SOCKETZSO_REUSEADDRZbindrZgetsocknamer"rrrr\�szTCPServer.server_bindcCs|j�|j�dSr!)r3Zlisten�request_queue_sizer"rrrr#�szTCPServer.server_activatecCs|j��dSrD)r3�closer"rrrrE�szTCPServer.server_closecCs
|j��S)zMReturn socket file number.

        Interface required by selector.

        )r3�filenor"rrrrb�szTCPServer.filenocCs
|j��S)zYGet the request and client address from the socket.

        May be overridden.

        )r3Zacceptr"rrrr9�szTCPServer.get_requestcCs4z|�tj�Wntk
r$YnX|�|�dSrF)r2r3ZSHUT_WRr:rHrIrrrr?�s
zTCPServer.shutdown_requestcCs|��dSrJ)rarIrrrrH�szTCPServer.close_requestN)T)rUrVrWrXr3ZAF_INETrZZSOCK_STREAMr[r`r^r r\r#rErbr9r?rHrrrrr�s-


c@s>eZdZdZdZejZdZdd�Z	dd�Z
dd	�Zd
d�ZdS)
rzUDP server class.Fi cCs |j�|j�\}}||jf|fSrQ)r3Zrecvfrom�max_packet_size)r�dataZclient_addrrrrr9szUDPServer.get_requestcCsdSrQrr"rrrr#szUDPServer.server_activatecCs|�|�dSrQrGrIrrrr?szUDPServer.shutdown_requestcCsdSrQrrIrrrrHszUDPServer.close_requestN)
rUrVrWrXr^r3Z
SOCK_DGRAMr[rcr9r#r?rHrrrrrscsVeZdZdZdZdZdZdZdd�dd	�Zd
d�Z	dd
�Z
dd�Z�fdd�Z�Z
S)rz5Mix-in class to handle each request in a new process.i,N�(TF��blockingc	Cs�|jdkrdSt|j�|jkrvz t�dd�\}}|j�|�Wqtk
r\|j��Yqtk
rrYqvYqXq|j�	�D]f}z.|r�dntj
}t�||�\}}|j�|�Wq�tk
r�|j�|�Yq�tk
r�Yq�Xq�dS)z7Internal routine to wait for children that have exited.N���r)�active_children�len�max_children�os�waitpid�discard�ChildProcessErrorr%r:�copy�WNOHANG)rrg�pid�_�flagsrrr�collect_children(s&
zForkingMixIn.collect_childrencCs|��dS)zvWait for zombies after self.timeout seconds of inactivity.

            May be extended, do not override.
            N�rur"rrrr7KszForkingMixIn.handle_timeoutcCs|��dS)z�Collect the zombie child processes regularly in the ForkingMixIn.

            service_actions is called in the BaseServer's serve_forever loop.
            Nrvr"rrrr-RszForkingMixIn.service_actionscCs�t��}|r8|jdkrt�|_|j�|�|�|�dSd}z:z|�||�d}Wn t	k
rr|�
||�YnXW5z|�|�W5t�|�XXdS)z-Fork a new subprocess to process the request.Nr]r)rlr
rir&�addrH�_exitr?rCr=r>)rrArBrrZstatusrrrr<Ys 

zForkingMixIn.process_requestcst���|j|jd�dS)Nrf)�superrEru�block_on_closer"��	__class__rrrErs
zForkingMixIn.server_close)rUrVrWrXr4rirkrzrur7r-r<rE�
__classcell__rrr{rrs#cs8eZdZdZ�fdd�Zdd�Zdd�Zdd	�Z�ZS)
�_Threadsz2
    Joinable list of all non-daemon threads.
    cs"|��|jrdSt��|�dSrQ)�reap�daemonry�append�r�threadr{rrr�{sz_Threads.appendcCsg|dd�|dd�<}|SrQr)r�resultrrr�pop_all�sz_Threads.pop_allcCs|��D]}|��qdSrQ)r��joinr�rrrr��sz
_Threads.joincCsdd�|D�|dd�<dS)Ncss|]}|��r|VqdSrQ)Zis_alive)�.0r�rrr�	<genexpr>�sz _Threads.reap.<locals>.<genexpr>rr"rrrr�sz
_Threads.reap)	rUrVrWrXr�r�r�rr}rrr{rr~ws
r~c@s eZdZdZdd�Zdd�ZdS)�
_NoThreadsz)
    Degenerate version of _Threads.
    cCsdSrQrr�rrrr��sz_NoThreads.appendcCsdSrQrr"rrrr��sz_NoThreads.joinN)rUrVrWrXr�r�rrrrr��sr�cs>eZdZdZdZdZe�Zdd�Zdd�Z	�fdd	�Z
�ZS)
rz4Mix-in class to handle each request in a new thread.FTc	CsHz6z|�||�Wn tk
r2|�||�YnXW5|�|�XdS)zgSame as in BaseServer but as a thread.

        In addition, exception handling is done here.

        N)r?rCr=r>r@rrr�process_request_thread�s
z%ThreadingMixIn.process_request_threadcCsL|jrt|��dt��tj|j||fd�}|j|_|j	�
|�|��dS)z*Start a new thread to process the request.�_threads)�targetrSN)rz�vars�
setdefaultr~rZThreadr��daemon_threadsr�r�r��start)rrArB�trrrr<�s�zThreadingMixIn.process_requestcst���|j��dSrQ)ryrEr�r�r"r{rrrE�s
zThreadingMixIn.server_close)rUrVrWrXr�rzr�r�r�r<rEr}rrr{rr�s

c@seZdZdS)rN�rUrVrWrrrrr�sc@seZdZdS)rNr�rrrrr�sc@seZdZdS)rNr�rrrrr�sc@seZdZdS)rNr�rrrrr�sc@seZdZejZdS)rN�rUrVrWr3rrZrrrrr�sc@seZdZejZdS)rNr�rrrrr�sc@seZdZdS)rNr�rrrrr�sc@seZdZdS)rNr�rrrrr�sc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r	a�Base class for request handler classes.

    This class is instantiated for each request to be handled.  The
    constructor sets the instance variables request, client_address
    and server, and then calls the handle() method.  To implement a
    specific service, all you need to do is to derive a class which
    defines a handle() method.

    The handle() method can find the request as self.request, the
    client address as self.client_address, and the server (in case it
    needs access to per-server information) as self.server.  Since a
    separate instance is created for each request, the handle() method
    can define other arbitrary instance variables.

    cCs6||_||_||_|��z|��W5|��XdSrQ)rArB�server�setup�finish�handle)rrArBr�rrrr �szBaseRequestHandler.__init__cCsdSrQrr"rrrr��szBaseRequestHandler.setupcCsdSrQrr"rrrr��szBaseRequestHandler.handlecCsdSrQrr"rrrr��szBaseRequestHandler.finishN)rUrVrWrXr r�r�r�rrrrr	�s

c@s0eZdZdZdZdZdZdZdd�Zdd	�Z	dS)
r
z4Define self.rfile and self.wfile for stream sockets.rhrNFcCsz|j|_|jdk	r |j�|j�|jr:|j�tjtjd�|j�	d|j
�|_|jdkrdt
|j�|_n|j�	d|j�|_dS)NT�rbr�wb)rAZ
connectionr4Z
settimeout�disable_nagle_algorithmr_r3ZIPPROTO_TCPZTCP_NODELAYZmakefile�rbufsize�rfile�wbufsize�
_SocketWriter�wfiler"rrrr�s

�
zStreamRequestHandler.setupcCsF|jjs.z|j��Wntjk
r,YnX|j��|j��dSrQ)r��closed�flushr3�errorrar�r"rrrr�#s
zStreamRequestHandler.finish)
rUrVrWrXr�r�r4r�r�r�rrrrr
s	
c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r�z�Simple writable BufferedIOBase implementation for a socket

    Does not hold data in a buffer, avoiding any need to call flush().cCs
||_dSrQ)�_sock)rZsockrrrr 3sz_SocketWriter.__init__cCsdS)NTrr"rrr�writable6sz_SocketWriter.writablec
Cs2|j�|�t|��}|jW5QR�SQRXdSrQ)r�Zsendall�
memoryview�nbytes)r�bZviewrrr�write9s
z_SocketWriter.writecCs
|j��SrQ)r�rbr"rrrrb>sz_SocketWriter.filenoN)rUrVrWrXr r�r�rbrrrrr�.s
r�c@s eZdZdZdd�Zdd�ZdS)rz6Define self.rfile and self.wfile for datagram sockets.cCs2ddlm}|j\|_|_||j�|_|�|_dS)Nr)�BytesIO)�ior�rAZpacketr3r�r�)rr�rrrr�EszDatagramRequestHandler.setupcCs|j�|j��|j�dSrQ)r3Zsendtor��getvaluerBr"rrrr�KszDatagramRequestHandler.finishN)rUrVrWrXr�r�rrrrrAs)%rX�__version__r3r)rlrMrr�rr6r�__all__�hasattr�extendrr'ZSelectSelectorrrrr�listr~r�rrrrrrrrrr	r
r�rrrrr�<module>sbz�

�
n~
X(.-__pycache__/typing.cpython-38.opt-2.pyc000064400000131071151153537570013675 0ustar00U

e5db
�G@s�ddlmZmZddlZddlZddlZddlZddlZddlZ	ddl
Z
ddlZddlmZm
Z
mZdddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJgGZd�dLdM�ZdNdO�ZdPdQ�ZdRdS�ZdTdU�ZdVdW�ZgZdXdY�ZdZd[�ZGd\d]�d]�ZGd^d_�d_�ZGd`da�daeedKdb�Zeddcdd�ZedFdedd�Zeddfdd�Zeddgdd�Zeddhdd�Z eddidd�Z!ed
djdd�Z"Gdkd�dedKdb�Z#Gdld�deedKdb�Z$d6d
d4d8d9d3d5dddm�	Z%dndo�Z&Gdpdq�dqedKdb�Z'Gdrds�dse'dKdb�Z(Gdtd	�d	�Z)Gdudv�dv�Z*Gdwdx�dx�Z+dydzd{d|d}gZ,d~dd�d�d�d�d�d�d�d�g
Z-e,e-d�gZ.d�d��Z/d�d��Z0d�d��Z1d�d��Z2dd"ddd$dd dd&d)g
d�d�gd��Z3Gd�d��d�e�Z4Gd�d�de)e4d��Z5d�dH�Z6d�d>�Z7d�d��Z8ej9ej:ej;ej<ee
efZ=d�d�dB�Z>d�dA�Z?d�d@�Z@d�dD�ZAd�dE�ZBd�d��ZCd�dG�ZDd�d?�ZEe$d��ZFe$d��ZGe$d��ZHe$d�dKd��ZIe$d�dKd��ZJe$d�dKd��ZKe$d�dKd��ZLe$d�dKeMd��ZNe$d=eOeP�ZQd�d�d��ZReRejjSd��ZSeRejjTeI�ZTeRejjUeIeLeJf�ZUeRejjVeI�ZVeRejjWeI�ZWeRejjXeI�ZXeRejjYeI�ZYeRejjZeI�ZZeRejj[d��Z[eRejj\eI�Z\eRejj]eI�Z]e(ejj^d�dKd��Z^d�e^__eRejj`eI�ZaeRejjbeF�ZbeRejjceGeKf�ZceRejjdeGeHf�ZdeRejjeeI�ZeeRejjfeF�ZfeRejjgd��Zge(ehd�d�dKd��Zid�ei__eRejeFd�d��ZkeRejleF�ZmeReneFd�d��Z`eReoeId�d��ZpeRejjqeI�ZqeRejjreG�ZreRejjseGeKf�ZseRejjteK�ZteRejueI�ZveRejweI�ZxeReyeGeHfd�d��ZzeRej{eGeHf�Z|eRej}eGeHf�Z}eRej~eF�Z~eRejeGeHf�ZeRejj�eIeLeJf�Z�eRejj�eIeLf�Z�eReMeNd�d��Z�d�e�__e6Gd�d/�d/e5��Z�e6Gd�d-�d-e5��Z�e6Gd�d,�d,e5��Z�e6Gd�d+�d+e5��Z�e6Gd�d.�d.e5��Z�e6Gd�d*�d*e5eI��Z�e6Gd�d0�d0e5eI��Z�d�d„Z�d�Z�d�Z�Gd�dƄd�eM�Z�Gd�d:�d:e�d��Z�d�dɄZ�d�dKdʜd�d̄Z�d�d΄Z�Gd�dЄd�eM�Z�Gd�d;�d;eye�d��Z�d�dC�Z�ePZ�d�Z�Gd�dԄd�e)eQ�Z�Gd�dքd�e�eO�Z�Gd�d؄d�e�eP�Z�Gd�dڄdڃZ�e�d�e�_�e�e
j�e�j�<eRe	j�eQ�Z�eRe	j�eQ�Z�Gd�d݄d݃Ze�d�e_�ee
j�ej�<dS)��)�abstractmethod�ABCMetaN)�WrapperDescriptorType�MethodWrapperType�MethodDescriptorType�Any�Callable�ClassVar�Final�
ForwardRef�Generic�Literal�Optional�Protocol�Tuple�Type�TypeVar�Union�AbstractSet�
ByteString�	Container�ContextManager�Hashable�	ItemsView�Iterable�Iterator�KeysView�Mapping�MappingView�MutableMapping�MutableSequence�
MutableSet�Sequence�Sized�
ValuesView�	Awaitable�
AsyncIterator�
AsyncIterable�	Coroutine�
Collection�AsyncGenerator�AsyncContextManager�
Reversible�SupportsAbs�
SupportsBytes�SupportsComplex�
SupportsFloat�
SupportsIndex�SupportsInt�
SupportsRound�ChainMap�Counter�Deque�Dict�DefaultDict�List�OrderedDict�Set�	FrozenSet�
NamedTuple�	TypedDict�	Generator�AnyStr�cast�final�get_args�
get_origin�get_type_hints�NewType�
no_type_check�no_type_check_decorator�NoReturn�overload�runtime_checkable�Text�
TYPE_CHECKINGTcCs�ttf}|r|ttf}|dkr(td�St|t�r:t|�St|t�r\|j	|kr\t
|�d���t|t�rr|tt
fks~|ttfkr�t
d|�d���t|tttf�r�|St|�s�t
|�d|d�d���|S)Nz is not valid as type argumentzPlain z Got z.100�.)rrr	r
�type�
isinstance�strr�
_GenericAlias�
__origin__�	TypeError�_SpecialFormrrIr�callable)�arg�msg�is_argumentZinvalid_generic_forms�rZ�/usr/lib64/python3.8/typing.py�_type_checkxs(

�
�r\cCsRt|t�r,|jdkr|jS|j�d|j��S|dkr8dSt|tj�rJ|jSt|�S)N�builtinsrN.z...)rPrO�
__module__�__qualname__�types�FunctionType�__name__�repr)�objrZrZr[�
_type_repr�s

recs\g�|D]J}t|t�r(|�kr(��|�t|t�r|js���fdd�|jD��qt��S)Ncsg|]}|�kr|�qSrZrZ��.0�t��tvarsrZr[�
<listcomp>�sz&_collect_type_vars.<locals>.<listcomp>)rPr�appendrR�_special�extend�__parameters__�tuple)r`rhrZrir[�_collect_type_vars�s
rqcCs�t|t�s|St|j�}t|j�D]J\}}t|t�r\t|�D]\}}||kr<||||<q<q"t|||�||<q"|jtkr�tt	|�S|�
t	|��S�N)rPrR�list�__args__�	enumerater�_subs_tvarsrSrrp�	copy_with)�tprjZsubsZnew_args�arW�iZtvarrZrZr[rv�s



rvc	Cs^|jst|�d���t|�}t|j�}||krZtd||kr>dnd�d|�d|�d|����dS)Nz is not a generic classzToo ZmanyZfewz parameters for z	; actual z, expected )rorT�len)�cls�
parametersZalenZelenrZrZr[�_check_generic�s
r~cCs�g}|D]f}t|t�r.|jtkr.|�|j�qt|t�rdt|�dkrd|dtkrd|�|dd��q|�|�qt	|�}t|�t|�kr�g}|D] }||kr�|�|�|�
|�q�|}t|�S)Nr�)rPrRrSrrnrtrpr{rl�set�remove)r}�params�pZ
all_paramsZ
new_paramsrhrZrZr[�_remove_dups_flatten�s "
r�cs4t�����t��j�t�����fdd��}|S)Ncs,z�||�WStk
r YnX�||�Srr�rT��args�kwds��cached�funcrZr[�inner�s
z_tp_cache.<locals>.inner)�	functools�	lru_cache�	_cleanupsrl�cache_clear�wraps)r�r�rZr�r[�	_tp_cache�s
r�csbt|t�r|����St|t�r^t��fdd�|jD��}||jkrH|S|�|�}|j|_|S|S)Nc3s|]}t|���VqdSrr)�
_eval_type�rgry��globalns�localnsrZr[�	<genexpr>sz_eval_type.<locals>.<genexpr>)rPr�	_evaluaterRrprtrwrm)rhr�r�Zev_args�resrZr�r[r�	s



r�c@seZdZdZdd�ZdS)�_Final)�__weakref__cOsd|krtd��dS)N�_rootz&Cannot subclass special typing classesr���selfr�r�rZrZr[�__init_subclass__sz_Final.__init_subclass__N)rbr^r_�	__slots__r�rZrZrZr[r�sr�c@seZdZdd�Zdd�ZdS)�
_ImmutablecCs|SrrrZ�r�rZrZr[�__copy__%sz_Immutable.__copy__cCs|SrrrZ)r�ZmemorZrZr[�__deepcopy__(sz_Immutable.__deepcopy__N)rbr^r_r�r�rZrZrZr[r�"sr�csleZdZdZ�fdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Ze
dd��Z�ZS)rU��_nameZ_doccsBt|�dkr6t|dt�r6t|dt�r6td|����t��|�S)N�rrzCannot subclass )r{rPrQrprT�super�__new__)r|r�r���	__class__rZr[r�3s��z_SpecialForm.__new__cCs||_||_dSrrr�)r��name�docrZrZr[�__init__@sz_SpecialForm.__init__cCst|t�stS|j|jkSrr)rPrU�NotImplementedr��r��otherrZrZr[�__eq__Ds
z_SpecialForm.__eq__cCst|jf�Srr)�hashr�r�rZrZr[�__hash__Isz_SpecialForm.__hash__cCs
d|jS)N�typing.�r�r�rZrZr[�__repr__Lsz_SpecialForm.__repr__cCs|jSrrr�r�rZrZr[�
__reduce__Osz_SpecialForm.__reduce__cOstd|����dS)NzCannot instantiate r�r�rZrZr[�__call__Rsz_SpecialForm.__call__cCst|�d���dS)Nz! cannot be used with isinstance()r��r�rdrZrZr[�__instancecheck__Usz_SpecialForm.__instancecheck__cCst|�d���dS)Nz! cannot be used with issubclass()r��r�r|rZrZr[�__subclasscheck__Xsz_SpecialForm.__subclasscheck__cs�|jdkr(t||j�d��}t||f�S|jdkr�|dkrBtd��t|t�sR|f}d�t�fdd�|D��}t|�}t|�d	kr�|d
St||�S|jdkr�t|d�}t|t	d�fS|jd
kr�t||�St|�d���dS)N)r	r
z accepts only single type.rrZz Cannot take a Union of no types.z)Union[arg, ...]: each arg must be a type.c3s|]}t|��VqdSrr�r\�rgr��rXrZr[r�fsz+_SpecialForm.__getitem__.<locals>.<genexpr>rrrz#Optional[t] requires a single type.r
z is not subscriptable)
r�r\rRrTrPrpr�r{rrO)r�r}�itemrWrZr�r[�__getitem__[s(







z_SpecialForm.__getitem__)rbr^r_r�r�r�r�r�r�r�r�r�r�r�r��
__classcell__rZrZr�r[rU,s
rU)r�a`Special type indicating an unconstrained type.

    - Any is compatible with every type.
    - Any assumed to have all methods.
    - All values assumed to be instances of Any.

    Note that all the above statements are true from the point of view of
    static type checkers. At runtime, Any should not be used with instance
    or class checks.
    )r�aSpecial type indicating functions that never return.
    Example::

      from typing import NoReturn

      def stop() -> NoReturn:
          raise Exception('no way')

    This type is invalid in other positions, e.g., ``List[NoReturn]``
    will fail in static type checkers.
    a3Special type construct to mark class variables.

    An annotation wrapped in ClassVar indicates that a given
    attribute is intended to be used as a class variable and
    should not be set on instances of that class. Usage::

      class Starship:
          stats: ClassVar[Dict[str, int]] = {} # class variable
          damage: int = 10                     # instance variable

    ClassVar accepts only types and cannot be further subscribed.

    Note that ClassVar is not a class itself, and should not
    be used with isinstance() or issubclass().
    a�Special typing construct to indicate final names to type checkers.

    A final name cannot be re-assigned or overridden in a subclass.
    For example:

      MAX_SIZE: Final = 9000
      MAX_SIZE += 1  # Error reported by type checker

      class Connection:
          TIMEOUT: Final[int] = 10

      class FastConnector(Connection):
          TIMEOUT = 1  # Error reported by type checker

    There is no runtime checking of these properties.
    a'Union type; Union[X, Y] means either X or Y.

    To define a union, use e.g. Union[int, str].  Details:
    - The arguments must be types and there must be at least one.
    - None as an argument is a special case and is replaced by
      type(None).
    - Unions of unions are flattened, e.g.::

        Union[Union[int, str], float] == Union[int, str, float]

    - Unions of a single argument vanish, e.g.::

        Union[int] == int  # The constructor actually returns int

    - Redundant arguments are skipped, e.g.::

        Union[int, str, int] == Union[int, str]

    - When comparing unions, the argument order is ignored, e.g.::

        Union[int, str] == Union[str, int]

    - You cannot subclass or instantiate a union.
    - You can use Optional[X] as a shorthand for Union[X, None].
    zEOptional type.

    Optional[X] is equivalent to Union[X, None].
    a�Special typing form to define literal types (a.k.a. value types).

    This form can be used to indicate to type checkers that the corresponding
    variable or function parameter has a value equivalent to the provided
    literal (or one of several literals):

      def validate_simple(data: Any) -> Literal[True]:  # always returns True
          ...

      MODE = Literal['r', 'rb', 'w', 'wb']
      def open_helper(file: str, mode: MODE) -> str:
          ...

      open_helper('/some/path', 'r')  # Passes type check
      open_helper('/other/path', 'typo')  # Error in type checker

   Literal[...] cannot be subclassed. At runtime, an arbitrary value
   is allowed as type argument to Literal[...], but type checkers may
   impose restrictions.
    c@s:eZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)r)�__forward_arg__�__forward_code__�__forward_evaluated__�__forward_value__�__forward_is_argument__TcCsnt|t�std|����zt|dd�}Wn"tk
rJtd|����YnX||_||_d|_d|_||_	dS)Nz*Forward reference must be a string -- got z<string>�evalz/Forward reference must be an expression -- got F)
rPrQrT�compile�SyntaxErrorr�r�r�r�r�)r�rWrY�coderZrZr[r��s
zForwardRef.__init__cCsj|jr||k	rd|dkr(|dkr(i}}n|dkr6|}n|dkrB|}tt|j||�d|jd�|_d|_|jS)Nz*Forward references must evaluate to types.�rYT)r�r\r�r�r�r�)r�r�r�rZrZr[r��s
�zForwardRef._evaluatecCs>t|t�stS|jr2|jr2|j|jko0|j|jkS|j|jkSrr)rPrr�r�r�r�r�rZrZr[r�s

�zForwardRef.__eq__cCs
t|j�Srr)r�r�r�rZrZr[r�szForwardRef.__hash__cCsd|j�d�S)NzForwardRef(�))r�r�rZrZr[r�szForwardRef.__repr__N)T)	rbr^r_r�r�r�r�r�r�rZrZrZr[r�s

c@s2eZdZdZdddd�dd�Zdd�Zd	d
�ZdS)r)rb�	__bound__�__constraints__�
__covariant__�__contravariant__NF)�bound�	covariant�
contravariantc	s�||_|r|rtd��t|�|_t|�|_|r>|dk	r>td��|rVt|�dkrVtd��d�t�fdd�|D��|_|r�t	|d�|_
nd|_
zt�d�j
�d	d
�}Wnttfk
r�d}YnX|dkr�||_dS)Nz"Bivariant types are not supported.z-Constraints cannot be combined with bound=...rz"A single constraint is not allowedz:TypeVar(name, constraint, ...): constraints must be types.c3s|]}t|��VqdSrrr�rfr�rZr[r�Vsz#TypeVar.__init__.<locals>.<genexpr>zBound must be a type.rb�__main__�typing)rb�
ValueError�boolr�r�rTr{rpr�r\r��sys�	_getframe�	f_globals�get�AttributeErrorr^)r�r�r�r�r�ZconstraintsZdef_modrZr�r[r�Js(


zTypeVar.__init__cCs&|jrd}n|jrd}nd}||jS)N�+�-�~)r�r�rb)r��prefixrZrZr[r�bszTypeVar.__repr__cCs|jSrr)rbr�rZrZr[r�kszTypeVar.__reduce__)rbr^r_r�r�r�r�rZrZrZr[rs,�	)	rsrp�dictr��	frozenset�deque�defaultdictrOr;cCs|�d�o|�d�S)N�__)�
startswith�endswith)�attrrZrZr[�
_is_dunder�sr�cs�eZdZdddd�dd�Zedd��Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Z�fdd�Z
dd�Zdd�Zdd�Z�ZS)rRTFN)�inst�specialr�cCsz||_||_|r*|dkr*|j}t�||�}||_t|t�s@|f}||_tdd�|D��|_	t
|�|_d|_|sv|j
|_
dS)Ncss*|]"}|tkrdn|tkrdn|VqdS).rZN)�_TypingEllipsis�_TypingEmptyr�rZrZr[r��s�z)_GenericAlias.__init__.<locals>.<genexpr>)�_instrmrb�_normalize_aliasr�r�rPrprSrtrqror�r^)r��originr�r�r�r�Z	orig_namerZrZr[r��s 
�

z_GenericAlias.__init__cs^|jttfkrtd|����t|t�s,|f}d�t�fdd�|D��}t||�t||j|�S)Nz%Cannot subscript already-subscripted �*Parameters to generic types must be types.c3s|]}t|��VqdSrrr�r�r�rZr[r��sz,_GenericAlias.__getitem__.<locals>.<genexpr>)	rSrrrTrPrpr~rvro�r�r�rZr�r[r��s

z_GenericAlias.__getitem__cCst|j||j|jd�S)N)r�r�)rRrSr�r�r�rZrZr[rw�sz_GenericAlias.copy_withcCs�|jdks&t|j�dkrx|jdtkrx|jr8d|j}n
t|j�}|jshdd�dd�|jD���d	�}nd
}|�|��S|jr�dSdd�d
d�|jdd�D���dt|jd��d	�S)Nr�rr��[�, cSsg|]}t|��qSrZ�rer�rZrZr[rk�sz*_GenericAlias.__repr__.<locals>.<listcomp>�]�ztyping.Callableztyping.Callable[[cSsg|]}t|��qSrZr�r�rZrZr[rk�s���z], )r�r{rt�EllipsisrerSrm�join)r�r�r�rZrZr[r��s
��
 z_GenericAlias.__repr__cCsRt|t�stS|j|jkrdS|jtkrF|jtkrFt|j�t|j�kS|j|jkS)NF)rPrRr�rSrr�rtr�rZrZr[r��s
z_GenericAlias.__eq__cCs,|jtkrttt|j�f�St|j|jf�Srr)rSrr�r�rtr�rZrZr[r��s
z_GenericAlias.__hash__cOsT|js$td|j�d|j���d���|j||�}z
||_Wntk
rNYnX|S)N�Type z cannot be instantiated; use z
() instead)r�rTr��lowerrS�__orig_class__r�)r�r��kwargs�resultrZrZr[r��s
z_GenericAlias.__call__cCs�|jrZg}|j|kr |�|j�|�|�}tdd�||dd�D��sR|�t�t|�S|jtkr�t|krpdS|�|�}||dd�D]}t|t	�r�||k	r�dSq�|jfS)Ncss"|]}t|t�pt|t�VqdSrr)rPrR�
issubclassr�rg�brZrZr[r��s�z0_GenericAlias.__mro_entries__.<locals>.<genexpr>rrZ)
r�rSrl�index�anyrrprrPrR)r��basesr�rzrrZrZr[�__mro_entries__�s$

�


z_GenericAlias.__mro_entries__cCs*d|jkrt|�st|j|�St|��dS)NrS)�__dict__r��getattrrSr�)r�r�rZrZr[�__getattr__�sz_GenericAlias.__getattr__cs2t|�s|dkr t��||�nt|j||�dS)N)r�r�rm)r�r��__setattr__�setattrrS)r�r��valr�rZr[r�sz_GenericAlias.__setattr__cCs|�t|��Srr)r�rOr�rZrZr[r�sz_GenericAlias.__instancecheck__cCs<|jr0t|t�st||j�S|jr0t|j|j�Std��dS)NzBSubscripted generics cannot be used with class and instance checks)rmrPrRrrSrTr�rZrZr[r�s
z_GenericAlias.__subclasscheck__cCs�|jr|jS|jr t�|j}n|j}|tkrht|j�dkrJ|jdtksht|jdd��|jdf}n*t	|j�}t|�dkr�t
|dt	�s�|\}tj||ffS)Nr�rr�r)
rmr��globalsrSrr{rtr�rsrprP�operator�getitem)r�r�r�rZrZr[r�s��
z_GenericAlias.__reduce__)rbr^r_r�r�r�rwr�r�r�r�r
r
rr�r�r�r�rZrZr�r[rR�s	
		rRcs(eZdZdd�Ze�fdd��Z�ZS)�_VariadicGenericAliascCs�|jdks|js|�|�St|t�r0t|�dkr8td��|\}}|tkrRt|f}n$t|t�sjtd|����t|�|f}|�|�S)Nrr�z6Callable must be used as Callable[[arg, ...], result].z1Callable[args, result]: args must be a list. Got )	r�rm�__getitem_inner__rPrpr{rTr�rs)r�r�r�rrZrZr[r�"s


z!_VariadicGenericAlias.__getitem__cs
|jtkr�|jr�|dkr$|�tf�St|t�s4|f}t|�dkrl|ddkrld�t|d��}|�|tf�Sd�t�fdd	�|D��}|�|�S|jt	j
jkr�|jr�|\}}d
�t|��}|tkr�|�t|f�Sd�t�fdd	�|D��}||f}|�|�St
��|�S)
NrZr�r.z Tuple[t, ...]: t must be a type.rz*Tuple[t0, t1, ...]: each t must be a type.c3s|]}t|��VqdSrrr�r�r�rZr[r�>sz:_VariadicGenericAlias.__getitem_inner__.<locals>.<genexpr>z.Callable[args, result]: result must be a type.z6Callable[[arg, ...], result]: each arg must be a type.c3s|]}t|��VqdSrrr�)rgrWr�rZr[r�Gs)rSrprmrwr�rPr{r\r��collections�abcrr�r�r�)r�r�r�r�rr�r�r[r2s.




z'_VariadicGenericAlias.__getitem_inner__)rbr^r_r�r�rr�rZrZr�r[rsrcs<eZdZdZdZ�fdd�Zedd��Z�fdd�Z�Z	S)	rrZFcs^|ttfkrtd|j�d���t�jtjkrF|jtjk	rFt��|�}nt�j|f|�|�}|S)Nr�z< cannot be instantiated; it can be used only as a base class)rrrTrbr�r��objectr�)r|r�r�rdr�rZr[r�dszGeneric.__new__cs�t|t�s|f}|s.|tk	r.td|j�d���d�t�fdd�|D��}|ttfkr�tdd�|D��sxtd|j�d���t	t
|��t	|�kr�td|j�d	���n
t||�t||�S)
NzParameter list to z[...] cannot be emptyr�c3s|]}t|��VqdSrrr�r�r�rZr[r�vsz,Generic.__class_getitem__.<locals>.<genexpr>css|]}t|t�VqdSrr)rPrr�rZrZr[r�yszParameters to z [...] must all be type variablesz[...] must all be unique)
rPrprrTr_rr�allrbr{r�r~rR)r|r�rZr�r[�__class_getitem__ns&
���
zGeneric.__class_getitem__c
s
t�j||�g}d|jkr(t|jk}nt|jko:|jdk}|rHtd��d|jkr�t|j�}d}|jD].}t	|t
�rf|jtkrf|dk	r�td��|j}qf|dk	r�t
|�}t
|��|�ks�d��fdd�|D��}d�dd�|D��}	td	|�d
|	�d���|}t|�|_dS)N�__orig_bases__rz!Cannot inherit from plain Genericz0Cannot inherit from Generic[...] multiple types.r�c3s|]}|�krt|�VqdSrr�rQrf�ZgvarsetrZr[r��sz,Generic.__init_subclass__.<locals>.<genexpr>css|]}t|�VqdSrrr)rg�grZrZr[r��szSome type variables (z) are not listed in Generic[r�)r�r�rrr�	__bases__rbrTrqrPrRrSror�r�rp)
r|r�rrj�errorZgvars�baseZtvarsetZs_varsZs_argsr�rr[r��s8




��zGeneric.__init_subclass__)
rbr^r_r��_is_protocolr�r�rr�r�rZrZr�r[rMs

c@seZdZdS)r�N�rbr^r_rZrZrZr[r��sr�c@seZdZdS)r�Nr#rZrZrZr[r��sr�rorrr"�_is_runtime_protocol�__abstractmethods__�__annotations__r�__doc__r�r^r�r��__subclasshook__r��_MutableMapping__markercCsrt�}|jdd�D]X}|jdkr$qt|di�}t|j���t|���D] }|�d�sJ|tkrJ|�	|�qJq|S)Nr�)rrr&Z_abc_)
r��__mro__rbrrsr�keysr��EXCLUDED_ATTRIBUTES�add)r|�attrsr!�annotationsr�rZrZr[�_get_protocol_attrs�s
r0cst�fdd�t��D��S)Nc3s|]}tt�|d��VqdSrr)rVr�rgr��r|rZr[r��sz,_is_callable_members_only.<locals>.<genexpr>)rr0r2rZr2r[�_is_callable_members_only�sr3cOst|�jrtd��dS)Nz Protocols cannot be instantiated)rOr"rT)r�r�rrZrZr[�_no_init�s
r4c	Cs6zt�d�jddkWSttfk
r0YdSXdS)Nr�rb)rr�T)r�r�r�r�r�rZrZrZr[�_allow_reckless_class_cheks�sr5�AbstractContextManager�AbstractAsyncContextManager)zcollections.abc�
contextlibcseZdZ�fdd�Z�ZS)�
_ProtocolMetacsVt�dd�rt��r$t�j��r$dS�jrJt��fdd�t��D��rJdSt����S)Nr"FTc3s8|]0}t�|�o.tt�|d��p.t�|�dk	VqdSrr)�hasattrrVrr1�r|�instancerZr[r��s�
z2_ProtocolMeta.__instancecheck__.<locals>.<genexpr>)	rr3rr�r"rr0r�r�r;r�r;r[r��s�
��z_ProtocolMeta.__instancecheck__)rbr^r_r�r�rZrZr�r[r9�sr9cs(eZdZdZdZdZ�fdd�Z�ZS)rrZTFcs�t�j||��j�dd�s2tdd��jD���_�fdd�}d�jkrN|�_�jsXdS�jD]F}|tt	fks^|j
tkr�|jt|j
ks^t
|t	�r�|js^td|��q^t�_dS)	Nr"Fcss|]}|tkVqdSrr)rrrZrZr[r�)sz-Protocol.__init_subclass__.<locals>.<genexpr>cs��j�dd�stSt�dd�s0t�r(tStd��t��sJt�rBtStd��t|t�s\td��t	��D]v}|j
D]b}||jkr�|j|dkr�tSqdt|di�}t|tjj
�rn||krnt|t�rn|jrnqdqntSqddS)	Nr"Fr$zLInstance and class checks can only be used with @runtime_checkable protocolsz<Protocols with non-method members don't support issubclass()z"issubclass() arg 1 must be a classr&T)rr�r�rr5rTr3rPrOr0r*rrrrrr")r�r�r!r/r2rZr[�_proto_hook,s:


���
z/Protocol.__init_subclass__.<locals>._proto_hookr(z7Protocols can only inherit from other protocols, got %r)r�r�rr�rrr"r(rrr^�_PROTO_WHITELISTrbrrTr4r�)r|r�rr=r!r�r2r[r�$s,&

�����zProtocol.__init_subclass__)rbr^r_r�r"r$r�r�rZrZr�r[rs)�	metaclasscCs&t|t�r|jstd|��d|_|S)NzB@runtime_checkable can be only applied to protocol classes, got %rT)rrr"rTr$r2rZrZr[rKds�cCs|SrrrZ)�typrrZrZr[rA}sc
Cs�z
|j}Wntk
r"iYSX|j}|j}|d|�}|jpDd}|j}|rXt|�ni}|t|�}t||d�|�D]\}}	|	||<qz|S)NrZ)	�__code__r��co_argcount�co_varnames�__defaults__�__kwdefaults__r�r{�zip)
r�r�Z	pos_countZ	arg_names�defaultsZ
kwdefaultsr�Z
pos_offsetr��valuerZrZr[�
_get_defaults�s



rIcCs�t|dd�riSt|t�r�i}t|j�D]z}|dkrDtj|jj}n|}|j�	di�}|�
�D]B\}}|dkrvtd�}t|t�r�t|dd�}t
|||�}|||<q^q(|S|dkr�t|tj�r�|j}n"|}	t|	d�r�|	j}	q�t|	di�}|dkr�|}n|dk�r|}t|dd�}|dk�r6t|t��r(iStd�|���t|�}
t|�}|�
�D]d\}}|dk�rhtd�}t|t��r|t|�}t
|||�}||
k�r�|
|dk�r�t|}|||<�qN|S)N�__no_type_check__r&Fr��__wrapped__�__globals__z1{!r} is not a module, class, method, or function.)rrPrO�reversedr*r��modulesr^rr��itemsrQrr�r`�
ModuleTyper:rK�_allowed_typesrT�formatrIr�r)rdr�r�Zhintsr!Zbase_globals�annr�rHZnsobjrGrZrZr[rE�s^




�
cCs t|t�r|jS|tkrtSdSrr)rPrRrSr)rxrZrZr[rD�s

cCsRt|t�rN|jsN|j}t|�tjjkrJ|dtk	rJt	|dd��|df}|SdS)Nrr�rZ)
rPrRrmrtrDrrrr�rs)rxr�rZrZr[rCscCs�t|t�rt|j��}|j��D]"\}}||j|fkr|�|�q|��D](}t|tj	�r`d|_
t|t�rJt|�qJz
d|_
Wntk
r�YnX|S)NT)
rPrOr�copyrOr�pop�valuesr`rarJrGrT)rWZ	arg_attrsr�rrdrZrZr[rGs	




cst����fdd��}|S)Ncs�||�}t|�}|Srr)rG)r�r�r���	decoratorrZr[�wrapped_decorator@s
z2no_type_check_decorator.<locals>.wrapped_decorator)r�r�)rXrYrZrWr[rH9scOstd��dS)Nz�You should not call an overloaded function. A series of @overload-decorated functions outside a stub module should always be followed by an implementation that is not @overload-ed.)�NotImplementedErrorr�rZrZr[�_overload_dummyIs�r[cCstSrr)r[)r�rZrZr[rJRscCs|SrrrZ)�frZrZr[rBos�T�KT�VT�T_co)r��V_co�VT_co�T_contra)r��CT_co)r�r�cCst||d|d�S)NT)r�r�)rR)r�r�r�rZrZr[�_alias�srerZ)r�a�Callable type; Callable[[int], str] is a function of (int) -> str.

    The subscription syntax must always be used with exactly two
    values: the argument list and the return type.  The argument list
    must be a list of types or ellipsis; the return type must be a single type.

    There is no syntax to indicate optional or keyword arguments,
    such function types are rarely used as callback types.
    F)r�r�a@Tuple type; Tuple[X, Y] is the cross-product type of X and Y.

    Example: Tuple[T1, T2] is a tuple of two elements corresponding
    to type variables T1 and T2.  Tuple[int, float, str] is a tuple
    of an int, a float and a string.

    To specify a variable-length tuple of homogeneous type, use Tuple[T, ...].
    )r�a�A special construct usable to annotate class objects.

    For example, suppose we have the following classes::

      class User: ...  # Abstract base for User classes
      class BasicUser(User): ...
      class ProUser(User): ...
      class TeamUser(User): ...

    And a function that takes a class argument that's a subclass of
    User and returns an instance of the corresponding class::

      U = TypeVar('U', bound=User)
      def new_user(user_class: Type[U]) -> U:
          user = user_class()
          # (Here we could write the user object to a database)
          return user

      joe = new_user(BasicUser)

    At this point the type checker knows that joe has type BasicUser.
    c@s"eZdZdZeed�dd��ZdS)r2rZ��returncCsdSrrrZr�rZrZr[�__int__�szSupportsInt.__int__N)rbr^r_r�r�intrhrZrZrZr[r2�sc@s"eZdZdZeed�dd��ZdS)r0rZrfcCsdSrrrZr�rZrZr[�	__float__szSupportsFloat.__float__N)rbr^r_r�r�floatrjrZrZrZr[r0�sc@s"eZdZdZeed�dd��ZdS)r/rZrfcCsdSrrrZr�rZrZr[�__complex__
szSupportsComplex.__complex__N)rbr^r_r�r�complexrlrZrZrZr[r/sc@s"eZdZdZeed�dd��ZdS)r.rZrfcCsdSrrrZr�rZrZr[�	__bytes__szSupportsBytes.__bytes__N)rbr^r_r�r�bytesrnrZrZrZr[r.sc@s"eZdZdZeed�dd��ZdS)r1rZrfcCsdSrrrZr�rZrZr[�	__index__szSupportsIndex.__index__N)rbr^r_r�rrirprZrZrZr[r1sc@s"eZdZdZeed�dd��ZdS)r-rZrfcCsdSrrrZr�rZrZr[�__abs__(szSupportsAbs.__abs__N)rbr^r_r�rr`rqrZrZrZr[r-#sc@s&eZdZdZedeed�dd��ZdS)r3rZr)�ndigitsrgcCsdSrrrZ)r�rrrZrZr[�	__round__2szSupportsRound.__round__N)r)rbr^r_r�rrir`rsrZrZrZr[r3-sc	std��fdd�|D�}t�|dd�|D��}t|�|_|_zt�d�j�dd�|_	Wnt
tfk
rnYnX|S)NzDNamedTuple('Name', [(f0, t0), (f1, t1), ...]); each t must be a typecsg|]\}}|t|��f�qSrZr��rg�nrhr�rZr[rk9sz!_make_nmtuple.<locals>.<listcomp>cSsg|]\}}|�qSrZrZrtrZrZr[rk:sr�rbr�)r�
namedtupler�r&�_field_typesr�r�r�r�r^r�r�)r�r`�nm_tplrZr�r[�
_make_nmtuple7sry)r�r�r��__getnewargs__�_fields�_field_defaultsrw�_make�_replace�_asdictZ_source)r^rbr&cseZdZ�fdd�Z�ZS)�NamedTupleMetacs�|�dd�rt��||||�S|�di�}t||���}g}i}|D]H}||krl||}	|�|	�|	||<qD|rDtdj|d�|�	��d���qDt
|�|j_t|�|j_
||_|D]<}
|
tkr�td|
��q�|
tkr�|
|jkr�t||
||
�q�|S)Nr�Fr&zXNon-default namedtuple field {field_name} cannot follow default field(s) {default_names}r�)�
field_nameZ
default_namesz&Cannot overwrite NamedTuple attribute )r�r�r�ryrOrlrTrRr�r+r�r&rprDr|�_prohibitedr�rmr{r)r|�typenamer	�nsr`rxrGZ
defaults_dictr�Z
default_value�keyr�rZr[r�Os2

�
zNamedTupleMeta.__new__)rbr^r_r�r�rZrZr�r[r�Msr�c@seZdZdZdd�Zde_dS)r=TcOs�|std��|^}}|r"|^}}n4d|krN|�d�}ddl}|jdtdd�ntd��|r�z
|\}Wq�tk
r�tdt|�d�d	��d�Yq�Xn<d
|kr�t|�dkr�|�d
�}ddl}|jdtdd�nd}|dkr�|��}n|r�td
��t||�S)Nz*NamedTuple.__new__(): not enough argumentsr�rz4Passing 'typename' as keyword argument is deprecatedr�)�
stacklevelzGNamedTuple.__new__() missing 1 required positional argument: 'typename'z@NamedTuple.__new__() takes from 2 to 3 positional arguments but z were given�fieldsrz2Passing 'fields' as keyword argument is deprecatedzIEither list of fields or keywords can be provided to NamedTuple, not both)	rTrU�warnings�warn�DeprecationWarningr�r{rOry)r�rr|r�r�r�rZrZr[r��sB

�
�

�
zNamedTuple.__new__z*($cls, typename, fields=None, /, **kwargs)N)rbr^r_r�r��__text_signature__rZrZrZr[r=ls#cOs
t||�Srr)r�)r|r�rrZrZr[�	_dict_new�sr�)�totalc	Ksj|dkr|}n|rtd��t|�|d�}zt�d�j�dd�|d<Wnttfk
r\YnXt|d|�S)Nz@TypedDict takes either a dict or keyword arguments, but not both)r&�	__total__rrbr�r^rZ)	rTr�r�r�r�r�r�r��_TypedDictMeta)r|r�r�r�rr�rZrZr[�_typeddict_new�sr�cCstd��dS)Nz4TypedDict does not support instance and class checksr�)r|r�rZrZr[�_check_fails�sr�cs&eZdZd�fdd�	ZeZZ�ZS)r�Tcs�|dkrtnt|d<tt|��||tf|�}|�di�}d��fdd�|��D�}|D]}|�|j	�di��qV||_
t|d�s�||_|S)Nr>r�r&z?TypedDict('Name', {f0: t0, f1: t1, ...}); each t must be a typecsi|]\}}|t|���qSrZr�)rgrurxr�rZr[�
<dictcomp>�sz*_TypedDictMeta.__new__.<locals>.<dictcomp>r�)
r�r�r�r�r�r�r�rO�updaterr&r:r�)r|r�r	r�r�Ztp_dictZannsr!r�r�r[r��s	
z_TypedDictMeta.__new__)T)rbr^r_r�r�r�r�r�rZrZr�r[r��sr�c@seZdZdS)r>Nr#rZrZrZr[r>�scCsdd�}||_||_|S)NcSs|SrrrZ)�xrZrZr[�new_typeszNewType.<locals>.new_type)rbZ
__supertype__)r�rxr�rZrZr[rFsc@s�eZdZdZeeed�dd���Zeeed�dd���Zedd�dd	��Z	eee
d�d
d���Zeed�dd
��Z
edd�dd��Zee
d�dd��Zed6eed�dd��Zee
d�dd��Zed7eed�dd��Zed8eeed�dd��Zed9eeed�d d!��Zee
d�d"d#��Zeed�d$d%��Zed:eed&�d'd(��Zee
d�d)d*��Zeeed+�d,d-��Zeeedd.�d/d0��Zed1d�d2d3��Zedd�d4d5��ZdS);�IOrZrfcCsdSrrrZr�rZrZr[�mode=szIO.modecCsdSrrrZr�rZrZr[r�BszIO.nameNcCsdSrrrZr�rZrZr[�closeGszIO.closecCsdSrrrZr�rZrZr[�closedKsz	IO.closedcCsdSrrrZr�rZrZr[�filenoPsz	IO.filenocCsdSrrrZr�rZrZr[�flushTszIO.flushcCsdSrrrZr�rZrZr[�isattyXsz	IO.isattyr�)rurgcCsdSrrrZ)r�rurZrZr[�read\szIO.readcCsdSrrrZr�rZrZr[�readable`szIO.readable)�limitrgcCsdSrrrZ)r�r�rZrZr[�readlinedszIO.readline)�hintrgcCsdSrrrZ)r�r�rZrZr[�	readlineshszIO.readlinesr)�offset�whencergcCsdSrrrZ)r�r�r�rZrZr[�seeklszIO.seekcCsdSrrrZr�rZrZr[�seekablepszIO.seekablecCsdSrrrZr�rZrZr[�telltszIO.tell)�sizergcCsdSrrrZ)r�r�rZrZr[�truncatexszIO.truncatecCsdSrrrZr�rZrZr[�writable|szIO.writable��srgcCsdSrrrZ�r�r�rZrZr[�write�szIO.write)�linesrgcCsdSrrrZ)r�r�rZrZr[�
writelines�sz
IO.writelinesz
IO[AnyStr]cCsdSrrrZr�rZrZr[�	__enter__�szIO.__enter__cCsdSrrrZ)r�rOrH�	tracebackrZrZr[�__exit__�szIO.__exit__)r�)r�)r�)r)N)rbr^r_r��propertyrrQr�r�r�r�r�rir�r�r�r@r�r�r�r9r�r�r�r�r�r�r�r�r�r�rZrZrZr[r�.sX
r�c@s>eZdZdZeeeefed�dd��Z	edd�dd��Z
dS)	�BinaryIOrZr�cCsdSrrrZr�rZrZr[r��szBinaryIO.writerfcCsdSrrrZr�rZrZr[r��szBinaryIO.__enter__N)rbr^r_r�rrro�	bytearrayrir�r�rZrZrZr[r��s
r�c@s�eZdZdZeeed�dd���Zeeed�dd���Z	eee
ed�dd���Zeeed�d	d
���Z
eeed�dd���Zedd�d
d��ZdS)�TextIOrZrfcCsdSrrrZr�rZrZr[�buffer�sz
TextIO.buffercCsdSrrrZr�rZrZr[�encoding�szTextIO.encodingcCsdSrrrZr�rZrZr[�errors�sz
TextIO.errorscCsdSrrrZr�rZrZr[�line_buffering�szTextIO.line_bufferingcCsdSrrrZr�rZrZr[�newlines�szTextIO.newlinescCsdSrrrZr�rZrZr[r��szTextIO.__enter__N)rbr^r_r�r�rr�r�rQr�rr�r�r�rr�r�rZrZrZr[r��s$r�c@s"eZdZdddgZeZeZeZdS)�ior�r�r�N)rbr^r_�__all__r�r�r�rZrZrZr[r��s
r�z.ioc@seZdZddgZeZeZdS)�re�Pattern�MatchN)rbr^r_r�r�r�rZrZrZr[r��sr�z.re)T)NN)T)N)�rrrrZcollections.abcr8r�rr�Z	stdlib_rer�r`rrrr�r\rerqrvr~r�r�r�r�r�r�rUrrIr	r
rrr
rrr�r�rRrrr�r�Z_TYPING_INTERNALSZ_SPECIAL_NAMESr,r0r3r4r5r>r9rrKrArIra�BuiltinFunctionType�
MethodTyperPrQrErDrCrGrHr[rJrBr]r^r_r`rarbrcrOrdrorQr@rerr%r(r'r&rrr,r#rr)rr'r;rr!rrr"r rrprrsr9r�r6r�r�r<rrrr$r6rr7r+r�r7r�r8r:r5r4r?r*rr2r0r/r.r1r-r3ryr�rmr�r=r�r�r�r�r>rFrLrMr�r�r�r�rbrNr�r�rZrZrZr[�<module>s&�X
!
	
I��
�����2a�
/[����	b�
V	
�
�	�							@+c#	

__pycache__/hmac.cpython-38.opt-2.pyc000064400000011423151153537570013271 0ustar00U

&�.e��@s�ddlZddlmZzddlZWnek
r<dZdZYnXe	ej
�ZddlZddlZddl
Z
edd�ed�D��Zedd�ed�D��ZdZGdd�d�Zd	d
�ZGdd�de
j�Ze��r�eZddd�Zdd�ZdS)�N)�_compare_digestccs|]}|dAVqdS)�\N���.0�xrr�/usr/lib64/python3.8/hmac.py�	<genexpr>sr	�ccs|]}|dAVqdS)�6Nrrrrrr	sc@sNeZdZdZddd�Zedd��Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�ZdS)�HMAC�@N�csVt��rtd��t|ttf�s0tdt|�j���s<td��t	��rL�|_
n,t�t�rhd�fdd�	|_
nd�fdd�	|_
|�
�|_|�
�|_
|j
j|_t|j
d�r�|j
j}|d	kr�t�d
||jftd�|j}nt�d|jtd�|j}||_t|�|k�r|�
|���}|�|d
�}|j�|�t��|j
�|�t��|dk	�rR|�|�dS)Nz9This class is not available in FIPS mode. Use hmac.new().�,key: expected bytes or bytearray, but got %rz'Missing required parameter 'digestmod'.�cst��|�S�N��_hashlib�new��d��	digestmodrr�<lambda>?rzHMAC.__init__.<locals>.<lambda>cs
��|�Sr�rrrrrrAr�
block_size�z:block_size of %d seems too small; using our default of %d.�z<No block_size attribute on given digest object; Assuming %d.�)r)r)�_hashlibopenssl�
get_fips_mode�
ValueError�
isinstance�bytes�	bytearray�	TypeError�type�__name__�callable�digest_cons�str�outer�inner�digest_size�hasattrr�	_warnings�warn�	blocksize�RuntimeWarning�len�digest�ljust�update�	translate�trans_5C�trans_36)�self�key�msgrr1rrr�__init__#sR
�



����
z
HMAC.__init__cCsd|jjS)Nzhmac-)r,�name)r:rrrr>asz	HMAC.namecCs t��rtd��|j�|�dS)Nz'hmac.HMAC is not available in FIPS mode)rr r!r,r6)r:r<rrrr6eszHMAC.updatecCs:|j�|j�}|j|_|j|_|j��|_|j��|_|Sr)�	__class__�__new__r)r-r,�copyr+)r:�otherrrrrAksz	HMAC.copycCs|j��}|�|j���|Sr)r+rAr6r,r4�r:�hrrr�_currentxs
z
HMAC._currentcCs|��}|��Sr)rEr4rCrrrr4�szHMAC.digestcCs|��}|��Sr)rE�	hexdigestrCrrrrF�szHMAC.hexdigest)Nr)r'�
__module__�__qualname__r1r=�propertyr>r6rArEr4rFrrrrrs
>

	
rcCsHt|t�r|��St|�r"|d�}t|tj�s6td��|j���dd�S)Nrz6Only OpenSSL hashlib hashes are accepted in FIPS mode.�_�-)	r"r*�lowerr(rZHASHr%r>�replacerrrr�_get_openssl_name�s
�rNc@seZdZddd�ZdS)�HMAC_opensslNcCsLt|ttf�s tdt|�j��t|�}tjj	|||d�}|rH|�
|�|S)Nrr)r"r#r$r%r&r'rN�_hmacopensslrr@r6)�clsr;r<rr>�resultrrrr@�s
zHMAC_openssl.__new__)NN)r'rGrHr@rrrrrO�srOrcCst|||�Sr)r)r;r<rrrrr�srcs�tdk	r(t�t�r(�tkr(t�||��St��r6�}n(t�t�rPd�fdd�	}nd	�fdd�	}|�}|�}t|dd�}t|�|kr�||���}|d|t|�}|�	|�
t��|�	|�
t��|�	|�|�	|���|��S)
Nrcst��|�Srrr�r4rrr�rzdigest.<locals>.<lambda>cs
��|�SrrrrSrrr�rrr
r)r)r)
�_hashopensslr"r*�_openssl_md_methsZhmac_digestr(�getattrr3r4r6r7r9r8)r;r<r4r)r,r+r1rrSrr4�s,	��

r4)Nr)�warningsr/�	_operatorrZcompare_digestrrT�ImportErrorrU�	frozensetZopenssl_md_meth_namesZhashlibrrPr#�ranger8r9r-rrNrOr rr4rrrr�<module>s(

u
__pycache__/pstats.cpython-38.opt-2.pyc000064400000046130151153537570013702 0ustar00U

e5d�j�@s�ddlZddlZddlZddlZddlZddlmZddlmZddgZ	Gdd�de
e�ZGdd�d�ZGdd	�d	�Z
d
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zedk�r|ddlZzddlZWnek
r�YnXGdd�dej�Zeej�dk�rejdZndZzPee�Zejdd�D]Ze� e��q,e!dej"d�e�#�e!dej"d�Wne$k
�rzYnXdS) �N)�Enum)�
cmp_to_key�Stats�SortKeyc@s8eZdZdZdZdZdZdZdZdZ	dZ
d	Zd
d�ZdS)
r)�calls�ncalls)�
cumulative�cumtime)�filename�module�line�name�nfl�pcalls�stdname)�time�tottimecGs@|d}t�||�}||_|dd�D]}||j|<q&||_|S�Nr�)�str�__new__�_value_�_value2member_map_Z_all_values)�cls�values�value�objZother_value�r�/usr/lib64/python3.8/pstats.pyr-szSortKey.__new__N)
�__name__�
__module__�__qualname__ZCALLSZ
CUMULATIVEZFILENAMEZLINE�NAMEZNFLZPCALLSZSTDNAMEZTIMErrrrrr"sc@s�eZdZdd�dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdddddddddddddd�
Z	dd�Z
dd�Zdd�Zdd �Z
d!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd6d0d1�Zd2d3�Zd4d5�ZdS)7rN)�streamcGsF|ptj|_t|�sd}n|d}|dd�}|�|�|j|�dSr)�sys�stdoutr#�len�init�add)�selfr#�args�argrrr�__init__Ys
zStats.__init__cCs�d|_g|_d|_d|_d|_d|_d|_t�|_i|_	i|_
|�|�z|��Wn8t
k
r�td|jrx|jdnd|jd��YnXdS)NrzInvalid timing data %s������file)�all_callees�files�fcn_list�total_tt�total_calls�
prim_calls�max_name_len�set�	top_level�stats�
sort_arg_dict�
load_stats�get_top_level_stats�	Exception�printr#)r)r+rrrr'cs(
��z
Stats.initc	Cs�|dkri|_dSt|t�rxt|d��}t�|�|_W5QRXz"t�|�}t�	|j
�d|}WnYnX|g|_n t|d�r�|�
�|j|_i|_|js�td|j|f��dS)N�rbz    �create_statsz.Cannot create or construct a %r object from %r)r:�
isinstancer�open�marshal�load�os�statr�ctime�st_mtimer2�hasattrrA�	TypeError�	__class__)r)r+�fZ
file_statsrrrr<vs*



�zStats.load_statscCs�|j��D]p\}\}}}}}|j|7_|j|7_|j|7_d|krZ|j�|�tt|��|j	kr
tt|��|_	q
dS)N)ZjprofilerZprofiler)
r:�itemsr5r6r4r9r(r&�func_std_stringr7)r)�func�cc�nc�tt�ct�callersrrrr=�szStats.get_top_level_statscGs�|s|St|�D]�}t|�t|�kr,t|�}|j|j7_|j|j7_|j|j7_|j|j7_|jD]}|j�|�qr|j	|j	kr�|j	|_	d|_
|j��D]<\}}||jkr�|j|}nddddif}t
||�|j|<q�q|S�Nr)�reversed�typerr2r5r6r4r9r(r7r3r:rN�add_func_stats)r)�arg_list�itemrPrGZ
old_func_statrrrr(�s(

z	Stats.addc	Cs(t|d��}t�|j|�W5QRXdS)N�wb)rCrD�dumpr:)r)r
rMrrr�
dump_stats�szStats.dump_stats)))rr-z
call count)))�r-zcumulative time))��rz	file name))��rzline number))��rz
function name))rdr`rbzname/file/line)))rr-zprimitive call count)))�rz
standard name)))�r-z
internal time)
rrr	rr
rrr
rrrrrcCst|jsni|_}i}|j��D]>\}}|}|r|s4q||krFd||<q|||<|dd�}q*q|D]
}||=qb|jS)Nrr-)r;�sort_arg_dict_defaultrN)r)�dictZbad_list�word�tupZfragmentrrr�get_sort_arg_defs�s 
zStats.get_sort_arg_defscGs\|sd|_|St|�dkrBt|dt�rBddddd�|dg}n:t|�dkr||dd�D] }t|�t|d�krZtd	��qZ|��}d
}d|_d}|D]B}t|t�r�|j	}|||d}|j|||d7_d}q�g}|j
��D]4\}\}	}
}}}
|�|	|
||f|t
|�|f�q�|jtt|�j�d
�g|_}|D]}|�|d��qB|S)Nrrrrrr)r-rrrgrgzCan't have mixed argument typerr.z, )�keyr-)r3r&rB�intrXrKrl�	sort_typerrr:rN�appendrO�sortr�	TupleComp�compare)r)Zfieldr+Z
sort_arg_defsZ
sort_tupleZ	connectorrjZ
stats_listrPrQrRrSrTrUr3�tuplerrr�
sort_stats�sF��


�
zStats.sort_statscCs|jr|j��|S�N)r3�reverse�r)rrr�
reverse_orders
zStats.reverse_ordercCs�|j}i|_}d}|��D]�\}\}}}}}	t|�}
tt|
��|krRtt|
��}i}|	��D]\}}
|
|t|�<q^|
|kr�t||
|||||f�||
<q|||||f||
<q|j}t�|_}|D]}|�t|��q�||_	d|_
d|_|SrV)r:rN�func_strip_pathr&rOrYr9r8r(r7r3r1)r)ZoldstatsZnewstatsr7rPrQrRrSrTrUZnewfuncZ
newcallers�func2�callerZold_topZnew_toprrr�
strip_dirss0
�
zStats.strip_dirsc
Cst|jr
dSi|_}|j��D]P\}\}}}}}||kr@i||<|��D]$\}}	||kr`i||<|	|||<qHqdSrv)r1r:rN)
r)r1rPrQrRrSrTrUr{r|rrr�calc_callees#s
zStats.calc_calleescCs|}t|t�rpzt�|�}Wn*tjk
rF|d|7}||fYSXg}|D]}|�t|��rP|�|�qPnzt|�}t|t	�r�d|kr�dkr�nnt
||d�}|d|�}n2t|t
�r�d|kr�|kr�nn|}|d|�}t|�t|�k�r|dt|�t|�|f7}||fS)Nz#   <Invalid regular expression %r>
gg�?g�?rz6   List reduced from %r to %r due to restriction <%r>
)rBr�re�compile�error�searchrOrpr&�floatrn)r)Zsel�list�msgZnew_listZrexrP�countrrr�eval_print_amount6s2
""�zStats.eval_print_amountcCs�|j}|jr*|jdd�}d|jd}nt|j���}d}|D]}|�|||�\}}q@t|�}|sld|fSt||j	d�|t|j�kr�d}|D] }tt
|��|kr�tt
|��}q�|d|fS)Nz   Ordered by: �
z!   Random listing order was used
rr/rg)r7r3ror�r:�keysr�r&r?r#rO)r)Zsel_list�widthZ	stat_listr�Z	selectionr�rPrrr�get_print_listPs$zStats.get_print_listcGs�|jD]}t||jd�q|jr,t|jd�d}|jD]}t|t|�|jd�q6t||jdd|jd�|j|jkr�td|jd|jd�td|j|jd�t|jd�|�|�\}}|r�|�	�|D]}|�
|�q�t|jd�t|jd�|S)Nr/�        zfunction calls� ��endr0z(%d primitive calls)zin %.3f seconds)r2r?r#r9�func_get_function_namer5r6r4r��print_title�
print_line)r)�amountr
�indentrPr�r�rrr�print_statshs(

zStats.print_statscGsz|�|�\}}|rv|��|�|d�|D]2}||jkrN|�|||j|�q*|�||i�q*t|jd�t|jd�|S)Nz	called...r/)r�r~�print_call_headingr1�print_call_liner?r#)r)r�r�r�rPrrr�
print_calleess
zStats.print_calleesc
Gsh|�|�\}}|rd|�|d�|D](}|j|\}}}}}	|�|||	d�q"t|jd�t|jd�|S)Nzwas called by...z<-r/)r�r�r:r�r?r#)
r)r�r�r�rPrQrRrSrTrUrrr�
print_callers�szStats.print_callersc
Csvtd�|�||jd�d}|j��D]0\}}}}}|r&tt|����}	t|	t�}qXq&|rrtd|d|jd�dS)Nz	Function r/Fr�z    ncalls  tottime  cumtime)	r?�ljustr#r:r�next�iterrBrt)
r)�	name_sizeZcolumn_titleZ	subheaderrQrRrSrTrUrrrrr��s
zStats.print_call_heading�->cCstt|��|�|d|jd�|s2t|jd�dSt|���}d}|D]�}t|�}||}	t|	t�r�|	\}
}}}
|
|kr�d|
|f}n
d|
f}d|�dd	t	|��t
|�t
|
�|f}|d
}n$d||	t
|j|d�f}|d}t||||jd�d}qFdS)
Nr�r�r/r.z%d/%dz%dz%s %s %s  %srfrgrz	%s(%r) %sr_)r?rOr�r#�sortedr�rBrt�rjustr&�f8r:)r)r��sourceZ	call_dictZarrowZclistr�rPr
rrRrQrSrTZsubstatsZ
left_widthrrrr��s0

�
zStats.print_call_linecCs"tdd|jd�td|jd�dS)Nz-   ncalls  tottime  percall  cumtime  percallr�r�zfilename:lineno(function)r/�r?r#rxrrrr��szStats.print_titlecCs�|j|\}}}}}t|�}||kr4|dt|�}t|�d�d|jd�tt|�d|jd�|dkrxtdd|jd�ntt||�d|jd�tt|�d|jd�|dkr�tdd|jd�ntt||�d|jd�tt|�|jd�dS)N�/�	r�r�rr�r/)r:rr?r�r#r�rO)r)rPrQrRrSrTrU�crrrr��szStats.print_line)r�)rr r!r,r'r<r=r(r^rhrlruryr}r~r�r�r�r�r�r�r�r�r�rrrrr7sD"

�'
c@seZdZdd�Zdd�ZdS)rrcCs
||_dSrv��comp_select_list)r)r�rrrr,�szTupleComp.__init__cCsF|jD]:\}}||}||}||kr0|S||kr|SqdSrVr�)r)�left�right�index�	direction�l�rrrrrs�s

zTupleComp.compareN)rr r!r,rsrrrrrr�srrcCs|\}}}tj�|�||fSrv)rF�path�basename)�	func_namer
rr
rrrrz�s
rzcCs|dS)Nrgr)rPrrrr��sr�cCsN|dd�dkrB|d}|�d�r<|�d�r<d|dd�S|Snd|SdS)	Nrg)�~r�<�>z{%s}rr-z	%s:%d(%s))�
startswith�endswith)r�r
rrrrO�srOcCs@|\}}}}}|\}}}	}
}||||||	||
t||�fSrv)�add_callers)�targetr�rQrRrSrTrUZt_ccZt_ncZt_ttZt_ctZ	t_callersrrrrYs
�rYcCs�i}|��D]\}}|||<q|��D]V\}}||krtt|t�rbtdd�t|||�D��||<q||||7<q&|||<q&|S)Ncss|]\}}||VqdSrvr)�.0�i�jrrr�	<genexpr>szadd_callers.<locals>.<genexpr>)rNrBrt�zip)r�r�Znew_callersrPr|rrrr�s

"
r�cCsd}|��D]}||7}q|SrV)r)rUrRrrrr�count_callss
r�cCsd|S)Nz%8.3fr)�xrrrr�(sr��__main__c@s�eZdZd6dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�ZdS)7�ProfileBrowserNcCs6tj�|�d|_d|_tj|_|dk	r2|�|�dS)N�% )	�cmd�Cmdr,�promptr:r$r%r#�do_read)r)�profilerrrr,7szProfileBrowser.__init__c	Cs�|��}g}|D]�}z|�t|��WqWntk
r>YnXz<t|�}|dksZ|dkrltd|jd�Wq|�|�WqWntk
r�YnX|�|�q|jr�t|j|�|�ntd|jd�dS)Nrrz#Fraction argument must be in [0, 1]r/�No statistics object is loaded.)	�splitrprn�
ValueErrorr�r?r#r:�getattr)r)�fnrr*Z	processedZtermZfracrrr�generic?s,
zProfileBrowser.genericcCsXtd|jd�td|jd�td|jd�td|jd�td|jd�td|jd�dS)NzArguments may be:r/z0* An integer maximum number of entries to print.z:* A decimal fractional number between 0 and 1, controllingz-  what fraction of selected entries to print.z8* A regular expression; only entries with function namesz  that match it are printed.r�rxrrr�generic_helpWszProfileBrowser.generic_helpc
Csd|jrRz|j�|�Wq`tk
rN}ztd||f|jd�W5d}~XYq`Xntd|jd�dS)Nz$Failed to load statistics for %s: %sr/r�r)r:r(�OSErrorr?r#)r)r�errr�do_add_s*zProfileBrowser.do_addcCstd|jd�dS)Nz>Add profile info from given file to current statistics object.r/r�rxrrr�help_addhszProfileBrowser.help_addcCs|�d|�S)Nr��r��r)rrrr�
do_calleeskszProfileBrowser.do_calleescCstd|jd�|��dS)Nz6Print callees statistics from the current stat object.r/�r?r#r�rxrrr�help_calleesmszProfileBrowser.help_calleescCs|�d|�S)Nr�r�r�rrr�
do_callersqszProfileBrowser.do_callerscCstd|jd�|��dS)Nz6Print callers statistics from the current stat object.r/r�rxrrr�help_callerssszProfileBrowser.help_callerscCstd|jd�dS)Nr.r/rr�r�rrr�do_EOFwszProfileBrowser.do_EOFcCstd|jd�dS�NzLeave the profile browser.r/r�rxrrr�help_EOFzszProfileBrowser.help_EOFcCsdS)Nrrr�rrr�do_quit}szProfileBrowser.do_quitcCstd|jd�dSr�r�rxrrr�	help_quitszProfileBrowser.help_quitc
Cs�|r�zt|�|_Wnztk
rN}zt|jd|jd�WY�dSd}~XYn@tk
r�}z"t|jjd||jd�WY�dSd}~XYnX|d|_	n6t
|j	�dkr�|j	dd�}|�|�ntd|jd�dS)	Nrr/�:r�rg���z1No statistics object is current -- cannot reload.r)rr:r�r?r*r#r>rLrr�r&r�)r)r�errrrrr��szProfileBrowser.do_readcCs td|jd�td|jd�dS)Nz+Read in profile data from a specified file.r/z*Without argument, reload the current file.r�rxrrr�	help_read�szProfileBrowser.help_readcCs$|jr|j��ntd|jd�dS)Nr�r/r)r:ryr?r#r�rrr�
do_reverse�szProfileBrowser.do_reversecCstd|jd�dS)Nz/Reverse the sort order of the profiling report.r/r�rxrrr�help_reverse�szProfileBrowser.help_reversecs�|jstd|jd�dS|j���|rRt�fdd�|��D��rR|jj|���n<td|jd�tj�	�D]"\}}td||df|jd�qjdS)	Nr�r/c3s|]}|�kVqdSrvr)r�r��Zabbrevsrrr��sz)ProfileBrowser.do_sort.<locals>.<genexpr>z/Valid sort keys (unique prefixes are accepted):z%s -- %srr)
r:r?r#rl�allr�rurrhrN)r)rrmrrr�r�do_sort�s
zProfileBrowser.do_sortcCs td|jd�td|jd�dS)Nz.Sort profile data according to specified keys.r/z3(Typing `sort' without arguments lists valid keys.)r�rxrrr�	help_sort�szProfileBrowser.help_sortcs�fdd�tjD�S)Ncsg|]}|���r|�qSr)r�)r��a��textrr�
<listcomp>�s
z0ProfileBrowser.complete_sort.<locals>.<listcomp>)rrh)r)r�r*rr�r�
complete_sort�szProfileBrowser.complete_sortcCs|�d|�S)Nr�r�r�rrr�do_stats�szProfileBrowser.do_statscCstd|jd�|��dS)Nz.Print statistics from the current stat object.r/r�rxrrr�
help_stats�szProfileBrowser.help_statscCs$|jr|j��ntd|jd�dS)Nr�r/)r:r}r?r#r�rrr�do_strip�szProfileBrowser.do_stripcCstd|jd�dS)Nz<Strip leading path information from filenames in the report.r/r�rxrrr�
help_strip�szProfileBrowser.help_stripcCstd|jd�dS)NzShow help for a given command.r/r�rxrrr�	help_help�szProfileBrowser.help_helpcCs|r|SdSrvr)r)�stoprrrr�postcmd�szProfileBrowser.postcmd)N)rr r!r,r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr�6s4
	r�rrgz*Welcome to the profile statistics browser.r/zGoodbye.)%r$rFrrDr�enumr�	functoolsr�__all__rrrrrrzr�rOrYr�r�r�rr��readline�ImportErrorr�r�r&�argvZinitprofileZbrowserr�r�r?r#Zcmdloop�KeyboardInterruptrrrr�<module>sP 
__pycache__/smtpd.cpython-38.opt-2.pyc000064400000056445151153537570013525 0ustar00U

e5d���@sZddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddlmZm
Z
dddddgZejdZd	ZGd
d�d�Ze�adZd
ZdZd$dd�ZGdd�dej�ZGdd�dej�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�d�Zdd�Z e!dk�rVe �Z"e"j#Z#de#k�rle#�$d�Z%e&e#de%�e'�e(�dg�Z)e#e%dd�Z#nddl*Z)e+e)e#�Z,e,e"j-e"j.fe"j/e"j0fe"j1e"j2d�Z3e"j4�r2zddl5Z5Wn.e6k
�r�e7dej8d �e�9d�YnXe5�:d!�d"Z;ze�4e;�Wn.e<k
�r0e7d#ej8d �e�9d�YnXze�=�Wne>k
�rTYnXdS)%�N)�warn)�
get_addr_spec�get_angle_addr�SMTPChannel�
SMTPServer�DebuggingServer�	PureProxy�MailmanProxyzPython SMTP proxy version 0.3c@seZdZdd�Zdd�ZdS)�DevnullcCsdS�N���self�msgrr�/usr/lib64/python3.8/smtpd.py�writef�z
Devnull.writecCsdSrr�rrrr�flushgrz
Devnull.flushN)�__name__�
__module__�__qualname__rrrrrrr
esr
�
z, i�cCs4ttt�tjd�|r&t|tjd�t�|�dS)N��file)�print�__doc__�globals�sys�stderr�exit)�coderrrr�usagepsr#c@s�eZdZdZdZdZe�efdd��Ze	dd��Z
edd	d	fd
d�Zdd
�Z
dd�Ze	dd��Zejdd��Ze	dd��Zejdd��Ze	dd��Zejdd��Ze	dd��Zejdd��Ze	dd��Zejdd��Ze	dd ��Zejd!d ��Ze	d"d#��Zejd$d#��Ze	d%d&��Zejd'd&��Ze	d(d)��Zejd*d)��Ze	d+d,��Zejd-d,��Ze	d.d/��Zejd0d/��Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dAdB�Z#dCdD�Z$dEdF�Z%dGdH�Z&dIdJ�Z'dKdL�Z(dMdN�Z)dOdP�Z*dQdR�Z+dS)Srr�icCs|Srr)�xrrr�<lambda>|rzSMTPChannel.<lambda>cCs0zt|j���WStk
r*|jYSXdSr)�max�command_size_limits�values�
ValueError�command_size_limitrrrr�max_command_size_limit~sz"SMTPChannel.max_command_size_limitNFc	
Cs&tjj|||d�||_||_||_||_||_||_|rF|rFt	d��|rdd|_
d|_d|_t
|_nd|_
d|_td�|_d	|_|��d|_d
|_|j��t��|_z|��|_WnBtk
r�}z$|��|jdtjkr�WY�dSd}~XYnXtdt |j�t!d
�|�"d|jt#f�dS)N��map�Fdecode_data and enable_SMTPUTF8 cannot be set to True at the same timer�
�.r�
�.�
FrzPeer:rz	220 %s %s)$�asynchat�
async_chat�__init__�smtp_server�conn�addr�data_size_limit�enable_SMTPUTF8�_decode_datar*�_emptystring�_linesep�_dotsep�NEWLINE�_newline�ord�_set_rset_state�
seen_greeting�
extended_smtpr(�clear�socketZgetfqdn�fqdnZgetpeername�peer�OSError�close�args�errnoZENOTCONNr�repr�DEBUGSTREAM�push�__version__)	rZserverr9r:r;r.r<�decode_data�errrrrr7�s@


zSMTPChannel.__init__cCs.|j|_d|_g|_d|_d|_|�d�dS)NFrr2)�COMMAND�
smtp_state�mailfrom�rcpttos�require_SMTPUTF8�	num_bytes�set_terminatorrrrr�_set_post_data_state�sz SMTPChannel._set_post_data_statecCs|��d|_g|_dS�Nr)r\�
received_data�received_linesrrrrrD�szSMTPChannel._set_rset_statecCstdtd�|jS)NzTAccess to __server attribute on SMTPChannel is deprecated, use 'smtp_server' instead��r�DeprecationWarningr8rrrr�__server�s
�zSMTPChannel.__servercCstdtd�||_dS)NzRSetting __server attribute on SMTPChannel is deprecated, set 'smtp_server' insteadr`ra�r�valuerrrrc�s
�cCstdtd�|jS)NzUAccess to __line attribute on SMTPChannel is deprecated, use 'received_lines' insteadr`�rrbr_rrrr�__line�s
�zSMTPChannel.__linecCstdtd�||_dS)NzSSetting __line attribute on SMTPChannel is deprecated, set 'received_lines' insteadr`rfrdrrrrg�s
�cCstdtd�|jS)NzRAccess to __state attribute on SMTPChannel is deprecated, use 'smtp_state' insteadr`�rrbrVrrrr�__state�s
�zSMTPChannel.__statecCstdtd�||_dS)NzPSetting __state attribute on SMTPChannel is deprecated, set 'smtp_state' insteadr`rhrdrrrri�s
�cCstdtd�|jS)NzXAccess to __greeting attribute on SMTPChannel is deprecated, use 'seen_greeting' insteadr`�rrbrErrrr�
__greeting�s
�zSMTPChannel.__greetingcCstdtd�||_dS)NzVSetting __greeting attribute on SMTPChannel is deprecated, set 'seen_greeting' insteadr`rjrdrrrrk�s
�cCstdtd�|jS)NzSAccess to __mailfrom attribute on SMTPChannel is deprecated, use 'mailfrom' insteadr`�rrbrWrrrr�
__mailfrom�s
�zSMTPChannel.__mailfromcCstdtd�||_dS)NzQSetting __mailfrom attribute on SMTPChannel is deprecated, set 'mailfrom' insteadr`rlrdrrrrm�s
�cCstdtd�|jS)NzQAccess to __rcpttos attribute on SMTPChannel is deprecated, use 'rcpttos' insteadr`�rrbrXrrrr�	__rcpttos�s
�zSMTPChannel.__rcpttoscCstdtd�||_dS)NzOSetting __rcpttos attribute on SMTPChannel is deprecated, set 'rcpttos' insteadr`rnrdrrrro�s
�cCstdtd�|jS)NzTAccess to __data attribute on SMTPChannel is deprecated, use 'received_data' insteadr`�rrbr^rrrr�__data�s
�zSMTPChannel.__datacCstdtd�||_dS)NzRSetting __data attribute on SMTPChannel is deprecated, set 'received_data' insteadr`rprdrrrrqs
�cCstdtd�|jS)NzKAccess to __fqdn attribute on SMTPChannel is deprecated, use 'fqdn' insteadr`�rrbrIrrrr�__fqdn
s
�zSMTPChannel.__fqdncCstdtd�||_dS)NzISetting __fqdn attribute on SMTPChannel is deprecated, set 'fqdn' insteadr`rrrdrrrrss
�cCstdtd�|jS)NzKAccess to __peer attribute on SMTPChannel is deprecated, use 'peer' insteadr`�rrbrJrrrr�__peers
�zSMTPChannel.__peercCstdtd�||_dS)NzISetting __peer attribute on SMTPChannel is deprecated, set 'peer' insteadr`rtrdrrrrus
�cCstdtd�|jS)NzKAccess to __conn attribute on SMTPChannel is deprecated, use 'conn' insteadr`�rrbr9rrrr�__conn s
�zSMTPChannel.__conncCstdtd�||_dS)NzISetting __conn attribute on SMTPChannel is deprecated, set 'conn' insteadr`rvrdrrrrw%s
�cCstdtd�|jS)NzKAccess to __addr attribute on SMTPChannel is deprecated, use 'addr' insteadr`�rrbr:rrrr�__addr+s
�zSMTPChannel.__addrcCstdtd�||_dS)NzISetting __addr attribute on SMTPChannel is deprecated, set 'addr' insteadr`rxrdrrrry0s
�cCs&tj�|t|d|jrdnd��dS)Nr0�utf-8�ascii)r5r6rQ�bytesrYr
rrrrQ7s
�zSMTPChannel.pushcCs|d}|j|jkr|j}n|j|jkr*|j}|r<|j|kr<dS|rR|jt|�7_|jrl|j�	t
|d��n|j�	|�dS)Nrz)rVrUr,�DATAr;rZ�lenr=r_�append�str)r�data�limitrrr�collect_incoming_data<sz!SMTPChannel.collect_incoming_datac
Cs|j�|j�}tdt|�td�g|_|j|jk�r|jd}|_|sT|�	d�dS|j
sdt|d�}|�d�}|dkr�|�
�}d}n$|d|��
�}||dd���}|jr�|j|n|j}||kr�|�	d�dSt|d	|d�}|s�|�	d
|�dS||�dS|j|jk�r(|�	d�d|_dS|j�rR|j|jk�rR|�	d�d|_dSg}|�|j�D]:}	|	�r�|	d|jk�r�|�|	dd��n
|�|	��qb|j�|�|_|j|j|j|jf}
i}|j
�s�|j|jd
�}|j j!|
|�}|�"�|�s|�	d�n
|�	|�dS)NzData:rrz500 Error: bad syntaxrz� r$z500 Error: line too longZsmtp_z&500 Error: command "%s" not recognizedz451 Internal confusionz552 Error: Too much mail data)�mail_options�rcpt_options�250 OK)#r>�joinr_rrOrPrVrUrZrQr=r��find�upper�striprFr(r+�getattrr}r;�splitr?r@rrBr^rJrWrXr�r�r8�process_messager\)
r�lineZsz�i�command�argZmax_sz�methodr��textrM�kwargsZstatusrrr�found_terminatorLsl


��


�zSMTPChannel.found_terminatorcCsH|s|�d�dS|jr&|�d�dS|��||_|�d|j�dS)Nz501 Syntax: HELO hostname�503 Duplicate HELO/EHLOz250 %s)rQrErDrI�rr�rrr�	smtp_HELO�s

zSMTPChannel.smtp_HELOcCs�|s|�d�dS|jr&|�d�dS|��||_d|_|�d|j�|jrr|�d|j�|jdd7<|js�|�d�|jr�|�d	�|jdd
7<|�d�dS)Nz501 Syntax: EHLO hostnamer�Tz250-%sz250-SIZE %s�MAIL�z250-8BITMIMEz250-SMTPUTF8�
z250 HELP)	rQrErDrFrIr;r(r=r<r�rrr�	smtp_EHLO�s&



zSMTPChannel.smtp_EHLOcCs|r|�d�n
|�d�dS)Nz501 Syntax: NOOPr��rQr�rrr�	smtp_NOOP�szSMTPChannel.smtp_NOOPcCs|�d�|��dS)Nz221 Bye)rQZclose_when_doner�rrr�	smtp_QUIT�s
zSMTPChannel.smtp_QUITcCs0t|�}|d|���|kr,||d���SdSr])r~r�r�)r�keywordr�Zkeylenrrr�_strip_command_keyword�sz"SMTPChannel._strip_command_keywordcCsF|sdS|���d�r$t|�\}}nt|�\}}|s<||fS|j|fS)N)rr�<)�lstrip�
startswithrrZ	addr_spec)rr��address�restrrr�_getaddr�szSMTPChannel._getaddrcCsHi}|D]:}|�d�\}}}|��r,|r2|s2dS|r:|nd||<q|S)N�=T)�	partition�isalnum)r�params�resultZparam�eqrerrr�
_getparams�szSMTPChannel._getparamscCs|r�d}|��}|dkr$|�d�q�|dkr8|�d�q�|dkr^d}|jrR||7}|�|�q�|dkr�d	}|jrx||7}|�|�q�|d
kr�|�d�q�|dkr�|�d
�q�|dkr�|�d�q�|dkr�|�d�q�|dkr�|�d�q�|�d�n
|�d�dS)N� [SP <mail-parameters>]ZEHLOz250 Syntax: EHLO hostnameZHELOz250 Syntax: HELO hostnamer�z 250 Syntax: MAIL FROM: <address>ZRCPTz250 Syntax: RCPT TO: <address>r}z250 Syntax: DATAZRSETz250 Syntax: RSETZNOOPz250 Syntax: NOOPZQUITz250 Syntax: QUITZVRFYz250 Syntax: VRFY <address>zD501 Supported commands: EHLO HELO MAIL RCPT DATA RSET NOOP QUIT VRFYzD250 Supported commands: EHLO HELO MAIL RCPT DATA RSET NOOP QUIT VRFY)r�rQrF)rr�ZextendedZlc_argrrrr�	smtp_HELP�s:zSMTPChannel.smtp_HELPcCs@|r2|�|�\}}|r"|�d�q<|�d|�n
|�d�dS)NzB252 Cannot VRFY user, but will accept message and attempt deliveryz502 Could not VRFY %sz501 Syntax: VRFY <address>)r�rQ)rr�r�r�rrr�	smtp_VRFY�szSMTPChannel.smtp_VRFYcCs�|js|�d�dStd|td�d}|jr4|d7}|dkrJ|�|�dS|�d|�}|�|�\}}|sv|�|�dS|js�|r�|�|�dS|jr�|�d�dS|���	�|_
|�|j
�}|dkr�|�|�dS|js�|�
dd	�}|d
kr�|�d�dS|j�r8|�
dd
�}|dk�r d|_n|d
k	�r8|�d�dS|�
dd�}|�r�|���sb|�|�dS|j�r�t|�|jk�r�|�d�dSt|���dk�r�|�d�dS||_td|jtd�|�d�dS)N�503 Error: send HELO firstz	===> MAILrz 501 Syntax: MAIL FROM: <address>r�zFROM:z503 Error: nested MAIL commandZBODY�7BIT)r�Z8BITMIMEz1501 Error: BODY can only be one of 7BIT, 8BITMIMEZSMTPUTF8FTz&501 Error: SMTPUTF8 takes no argumentsZSIZEz:552 Error: message size exceeds fixed maximum message sizerz:555 MAIL FROM parameters not recognized or not implementedzsender:r�)rErQrrPrFr�r�rWr�r�r�r�r=�popr<rY�isdigitr;�intr~�keys)rr��	syntaxerrr�r�Zbody�smtputf8�sizerrr�	smtp_MAILsh














zSMTPChannel.smtp_MAILcCs|js|�d�dStd|td�|js6|�d�dSd}|jrH|d7}|dkr^|�|�dS|�d|�}|�|�\}}|s�|�|�dS|js�|r�|�|�dS|���	�|_
|�|j
�}|dkr�|�|�dSt|�
��dkr�|�d	�dS|j�|�td
|jtd�|�d�dS)Nr�z	===> RCPTrz503 Error: need MAIL commandz501 Syntax: RCPT TO: <address>r�zTO:rz8555 RCPT TO parameters not recognized or not implementedzrecips:r�)rErQrrPrWrFr�r�r�r�r�r�r~r�rXr)rr�r�r�r�rrr�	smtp_RCPT7s@







zSMTPChannel.smtp_RCPTcCs(|r|�d�dS|��|�d�dS)Nz501 Syntax: RSETr�)rQrDr�rrr�	smtp_RSETZs

zSMTPChannel.smtp_RSETcCsZ|js|�d�dS|js(|�d�dS|r:|�d�dS|j|_|�d�|�d�dS)Nr�z503 Error: need RCPT commandz501 Syntax: DATAs
.
z#354 End data with <CR><LF>.<CR><LF>)rErQrXr}rVr[r�rrr�	smtp_DATAas



zSMTPChannel.smtp_DATAcCs|�d�dS)Nz502 EXPN not implementedr�r�rrr�	smtp_EXPNpszSMTPChannel.smtp_EXPN),rrrrUr}r+�collections�defaultdictr(�propertyr,�DATA_SIZE_DEFAULTr7r\rDZ_SMTPChannel__server�setterZ_SMTPChannel__lineZ_SMTPChannel__stateZ_SMTPChannel__greetingZ_SMTPChannel__mailfromZ_SMTPChannel__rcpttosZ_SMTPChannel__dataZ_SMTPChannel__fqdnZ_SMTPChannel__peerZ_SMTPChannel__connZ_SMTPChannel__addrrQr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrws�
�
'	





















>#6#c@s2eZdZeZedddfdd�Zdd�Zdd�ZdS)	rNFcCs�||_||_||_||_||_|r.|r.td��tjj||d�zNt	j
|dt	ji�}|�|dd|dd�|�
�|�|�|�d�Wn|���Yn(Xtd|jjt�t���||ftd�dS)	Nr/r-�typerr$�z0%s started at %s
	Local addr: %s
	Remote addr:%sr)Z
_localaddr�_remoteaddrr;r<r=r*�asyncore�
dispatcherr7rHZgetaddrinfoZSOCK_STREAMZ
create_socketZset_reuse_addrZbindZlistenrLr�	__class__r�time�ctimerP)rZ	localaddrZ
remoteaddrr;r.r<rSZgai_resultsrrrr7xs6�
��zSMTPServer.__init__c	Cs6tdt|�td�|�||||j|j|j|j�}dS)NzIncoming connection from %sr)rrOrP�
channel_classr;�_mapr<r=)rr9r:Zchannelrrr�handle_accepted�s�zSMTPServer.handle_acceptedcKst�dSr)�NotImplementedError�rrJrWrXr�r�rrrr��szSMTPServer.process_message)	rrrrr�r�r7r�r�rrrrrts�
c@seZdZdd�Zdd�ZdS)rcCsld}|��}|D]V}|rL|sLd|d}t|t�s@t|�d��}t|�d}t|t�s^t|�}t|�qdS)Nr$zX-Peer: rrz)�
splitlines�
isinstancer�rO�encoder)rrJr�Z	inheaders�linesr�Z
peerheaderrrr�_print_message_content�s

z&DebuggingServer._print_message_contentcKsXtd�|r@|�d�r&td|d�|�d�r@td|d�|�||�td�dS)Nz%---------- MESSAGE FOLLOWS ----------r�zmail options: %sr�zrcpt options: %s
z%------------ END MESSAGE ------------)r�getr�r�rrrr��s

zDebuggingServer.process_messageN)rrrr�r�rrrrr�scs,eZdZ�fdd�Zdd�Zdd�Z�ZS)rcs.d|kr|drtd��tt|�j||�dS)Nr<z$PureProxy does not support SMTPUTF8.�r*�superrr7�rrMr��r�rrr7�szPureProxy.__init__c	Csf|�d�}d}|D]}|sq(|d7}q|�|d|d�t�|�}|�|||�}td|td�dS)Nrrr$z
X-Peer: %szwe got some refusals:r)r��insertrAr��_deliverrrP)	rrJrWrXr�r�r�r��refusedrrrr��s


zPureProxy.process_messagec
Cs�ddl}i}zB|��}|�|jd|jd�z|�|||�}W5|��XWn�|jk
r�}ztdtd�|j	}W5d}~XYnft
|jfk
r�}zBtd|jtd�t
|dd�}t
|dd	�}	|D]}
||	f||
<q�W5d}~XYnX|S)
Nrr$zgot SMTPRecipientsRefusedrZgotZ	smtp_code���Z
smtp_error�ignore)�smtplibZSMTPZconnectr��quitZsendmailZSMTPRecipientsRefusedrrPZ
recipientsrKZ
SMTPExceptionr�r�)rrWrXr�r�r��s�eZerrcode�errmsg�rrrrr��s$ zPureProxy._deliver)rrrr7r�r��
__classcell__rrr�rr�scs$eZdZ�fdd�Zdd�Z�ZS)r	cs.d|kr|drtd��tt|�j||�dS)Nr<z'MailmanProxy does not support SMTPUTF8.r�r�r�rrr7
szMailmanProxy.__init__cCs*ddlm}ddlm}ddlm}ddlm}g}	|D]t}
|
���d�d}|�d�}t|�dkrfq8|d}
t|�dkr�|d	}nd
}|�	|
�r8|dkr�q8|	�
|
|
|f�q8|	D]\}
}
}|�|
�q�tdd
�
|�td�|r�|�|||�}td|td�i}||�}|�|�}|�d��s&||d<|�d��sDt�t���|d<|	D]�\}
}
}td|
td�|�|
�}|�s�|j|
dd�}|||
<|d
k�r�|j|d	d�n�|dk�r�|j|d	d�nh|dk�r�|j|d	d�nN|dk�r�|j|d	d�n4|dk�rH|dk�rd|d <nd!|d <|j|d	d��qHdS)"Nr)�StringIO)�Utils)�Message)�MailList�@�-r`r$r)r�admin�owner�requestr��leavezforwarding recips:r�rzwe got refusals:�fromZFrom�dateZDatezsending message to)�lock)�tolistr�)Ztoadminr�)Ztoownerr�)Z	torequest)r�r�r�Z	subscribeZSubjectZunsubscribe)�ior�ZMailmanr�r�r��lowerr�r~Zlist_existsr�removerr�rPr�r�r�r�ZEnqueue)rrJrWrXr�r�r�r�r�Z	listnamesZrcptZlocal�partsZlistnamer�r�Zmlistsr�rZmlistrrrr�sb










zMailmanProxy.process_message)rrrr7r�r�rrr�rr	sc@seZdZdZdZdZdZdS)�OptionsTrNF)rrr�setuid�	classname�
size_limitr<rrrrr�_sr�c
Cspz.t�tjdd�dddddddd	g�\}}Wn.tjk
r\}ztd|�W5d}~XYnXt�}|D]�\}}|d
kr�td�qh|dkr�tt�t�d�qh|d
kr�d|_	qh|dkr�||_
qh|dkr�tjaqh|dkr�d|_
qh|dkrhzt|�}||_Wqhtd|tjd�t�d�YqhXqht|�dk�r<d}d}nPt|�dk�rX|d}d}n4t|�dk�rx|d}|d}ntddt�|��|�d�}	|	dk�r�tdd|�|d|	�|_zt||	dd��|_Wn$tk
�r�tdd|�YnX|�d�}	|	dk�rtdd|�|d|	�|_zt||	dd��|_Wn$tk
�rjtdd|�YnX|S) Nr$z	nVhc:s:duzclass=Znosetuid�version�helpzsize=�debugr�)z-hz--helpr)z-Vz	--version)z-nz
--nosetuidF)z-cz--class)z-dz--debug)z-uz
--smtputf8T)z-sz--sizezInvalid size: rzlocalhost:8025zlocalhost:25r`�zInvalid arguments: %s�:zBad local spec: %szBad local port: %szBad remote spec: %szBad remote port: %s)�getoptr�argv�errorr#r�rrRr!r�r�r rPr<r�r�r~�
COMMASPACEr�r��	localhost�	localportr*�
remotehost�
remoteport)
ZoptsrMr��options�optr�Zint_sizeZ	localspecZ
remotespecr�rrr�	parseargsfsv��






r�__main__r1r$)r<z7Cannot import module "pwd"; try running with -n option.r�nobodyr`z3Cannot setuid "nobody"; try running with -n option.)r)?r�osrNrr�rHr�r5r��warningsrZemail._header_value_parserrr�__all__rZprogramrRr
rPrArr�r#r6rr�rrrr	r�rrrr��rfindZlastdot�
__import__r�locals�modrr�Zclass_rr	r
rr�r<�proxyr��pwd�ImportErrorrr r!�getpwnamr�PermissionErrorZloop�KeyboardInterruptrrrr�<module>Ps��

M-SB




�__pycache__/socket.cpython-38.opt-2.pyc000064400000045742151153537570013664 0ustar00U

e5d���@sddlZddlTddlZddlZddlZddlZddlmZmZzddlZWne	k
rddZYnXe
edd�Ze
edd�Ze
edd�Z
d	d
ddd
ddgZe�e�e��e�dedd��e�dedd��e�dedd��e�dedd��dZdZdd�ZeZej���d��r iZded<ded<d ed!<d"ed#<d$ed%<d&ed'<d(ed)<d*ed+<d,ed-<d.ed/<d0ed1<d2ed3<d4ed5<d6ed7<d8ed9<d:ed;<d<ed=<d>ed?<d@edA<dBedC<dDedE<dFedG<dHedI<dJedK<dLedM<dNedO<dPedQ<dRedS<dTedU<dVedW<dXedY<dZed[<d\ed]<d^ed_<d`eda<dbedc<ddede<dfedg<dhedi<djedk<dledm<dnedo<dpedq<dreds<dtedu<dvedw<dxedy<dzed{<d|ed}<d~ed<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<d�ed�<e�dءGd�dڄd�e�ZGd�d܄d�ej�Zd�d�d	�Ze ejdރ�rld�d�Z!e�d�e ed��r�de"dfd�d�Z#ne$e"dfd�d�Z#e�d�d�e#_%ee
hZ&Gd�d�d�ej'�Z(d�d�d
�Z)e*�Z+e+dfd�d�Z,d�d
�Z-e$dd�d�d�d�d�Z.d�d�d�Z/dS)��N)�*)�IntEnum�IntFlag�EBADF�	�EAGAIN��EWOULDBLOCK�fromfd�getfqdn�create_connection�
create_server�has_dualstack_ipv6�
AddressFamily�
SocketKindcCs|��o|�d�S)NZAF_��isupper�
startswith��C�r�/usr/lib64/python3.8/socket.py�<lambda>L�rcCs|��o|�d�S)NZSOCK_rrrrrrQrZMsgFlagcCs|��o|�d�S)NZMSG_rrrrrrVrZAddressInfocCs|��o|�d�S)NZAI_rrrrrr[rz	127.0.0.1z::1cCs(z
||�WStk
r"|YSXdS�N)�
ValueError)�valueZ
enum_klassrrr�_intenum_converteras
r�winz)Specified event object handle is invalid.�zInsufficient memory available.�z#One or more parameters are invalid.�WzOverlapped operation aborted.i�z2Overlapped I/O event object not in signaled state.i�z)Overlapped operation will complete later.i�zThe operation was interrupted.i'zA bad file handle was passed.i'zPermission denied.i'z!A fault occurred on the network??i'z#An invalid operation was attempted.i&'zToo many open files.i('z The socket operation would blocki3'z,A blocking operation is already in progress.i4'zOperation already in progress.i5'zSocket operation on nonsocket.i6'zDestination address required.i7'zMessage too long.i8'zProtocol wrong type for socket.i9'zBad protocol option.i:'zProtocol not supported.i;'zSocket type not supported.i<'zOperation not supported.i='zProtocol family not supported.i>'z0Address family not supported by protocol family.i?'zThe network address is in use.i@'z Cannot assign requested address.iA'zNetwork is down.iB'zNetwork is unreachable.iC'z$Network dropped connection on reset.iD'z!Software caused connection abort.iE'zThe connection has been reset.iF'zNo buffer space available.iG'zSocket is already connected.iH'zSocket is not connected.iI'zThe network has been shut down.iJ'zToo many references.iK'zThe operation timed out.iL'zConnection refused.iM'zCannot translate name.iN'zThe name is too long.iO'zThe host is down.iP'zThe host is unreachable.iQ'zDirectory not empty.iR'zToo many processes.iS'zUser quota exceeded.iT'zDisk quota exceeded.iU'zStale file handle reference.iV'zItem is remote.iW'z!Network subsystem is unavailable.ik'z!Winsock.dll version out of range.il'z(Successful WSAStartup not yet performed.im'zGraceful shutdown in progress.iu'z*No more results from WSALookupServiceNext.iv'zCall has been canceled.iw'z Procedure call table is invalid.ix'zService provider is invalid.iy'z&Service provider failed to initialize.iz'zSystem call failure.i{'zService not found.i|'zClass type not found.i}'i~'zCall was canceled.i'zDatabase query was refused.i�'zHost not found.i�*z Nonauthoritative host not found.i�*zThis is a nonrecoverable error.i�*z*Valid name, no data record requested type.i�*zQoS receivers.i�*zQoS senders.i�*zNo QoS senders.i�*zQoS no receivers.i+zQoS request confirmed.i+zQoS admission error.i+zQoS policy failure.i+zQoS bad style.i+zQoS bad object.i+zQoS traffic control error.i+zQoS generic error.i+zQoS service type error.i+zQoS flowspec error.i	+zInvalid QoS provider buffer.i
+zInvalid QoS filter style.i+i+zIncorrect QoS filter count.i
+zInvalid QoS object length.i+zIncorrect QoS flow count.i+zUnrecognized QoS object.i+zInvalid QoS policy object.i+zInvalid QoS flow descriptor.i+z'Invalid QoS provider-specific flowspec.i+z)Invalid QoS provider-specific filterspec.i+z&Invalid QoS shape discard mode object.i+z Invalid QoS shaping rate object.i+z!Reserved policy QoS element type.i+�errorTabc@seZdZdS)�_GiveupOnSendfileN)�__name__�
__module__�__qualname__rrrrr#�sr#cs(eZdZdddgZd8dd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
d9dddd�dd�Zee
d�rvd:dd�Zn
d;dd�Zd<dd�Zdd �Zd=d!d"�Zd#d$�Zejfd%d&�Zd'd(�Z�fd)d*�Ze�fd+d,��Ze�fd-d.��Ze
jd/k�rd0d1�Zd2d3�Znd4d1�Zd5d3�Zd6e_d7e_�ZS)>�socket�__weakref__�_io_refs�_closed���NcCsP|dkr,|dkrt}|dkr t}|dkr,d}tj�|||||�d|_d|_dS)Nr+rF)�AF_INET�SOCK_STREAM�_socketr'�__init__r)r*)�self�family�type�proto�filenorrrr/�szsocket.__init__cCs|Srr�r0rrr�	__enter__�szsocket.__enter__cGs|js|��dSr)r*�close)r0�argsrrr�__exit__�szsocket.__exit__cCs�t|dd�}d|jj|jj|r"dnd|��|j|j|jf}|s�z |��}|r^|dt	|�7}Wnt
k
rtYnXz |��}|r�|dt	|�7}Wnt
k
r�YnX|d7}|S)	Nr*Fz,<%s.%s%s fd=%i, family=%s, type=%s, proto=%iz	 [closed]�z
, laddr=%sz
, raddr=%s�>)�getattr�	__class__r%r&r4r1r2r3�getsockname�str�errorZgetpeername)r0�closed�sZladdrZraddrrrr�__repr__�s4
��zsocket.__repr__cCstd|jj�d���dS)Nzcannot pickle z object)�	TypeErrorr=r$r5rrr�__getstate__szsocket.__getstate__cCs6t|���}|j|j|j|j|d�}|�|���|S)N�r4)�dupr4r=r1r2r3�
settimeout�
gettimeout)r0�fd�sockrrrrGsz
socket.dupcCsF|��\}}t|j|j|j|d�}t�dkr>|��r>|�d�||fS)NrFT)Z_acceptr'r1r2r3ZgetdefaulttimeoutrI�setblocking)r0rJ�addrrKrrr�accepts

z
socket.accept�r)�encoding�errors�newlinec
Cs�t|�dddhks td|f��d|k}d|kp4|}d|k}d}	|rN|	d7}	|rZ|	d7}	t||	�}
|jd7_|dkr~d}|dkr�tj}|dkr�|s�td	��|
S|r�|r�t�|
|
|�}n|r�t�|
|�}nt�|
|�}|r�|St�	||||�}||_
|S)
NrO�w�bz&invalid mode %r (only r, w, b allowed)r:�r+rz!unbuffered streams must be binary)�setr�SocketIOr)�io�DEFAULT_BUFFER_SIZE�BufferedRWPair�BufferedReader�BufferedWriter�
TextIOWrapper�mode)
r0r^�	bufferingrPrQrRZwritingZreadingZbinaryZrawmode�raw�buffer�textrrr�makefile-s<
zsocket.makefile�sendfilerc
Cs�|�|||�|��}z|��}Wn0ttjfk
rR}zt|��W5d}~XYnXzt�|�j}Wn*t	k
r�}zt|��W5d}~XYnX|s�dSt
|p�|d�}|��}	|	dkr�td��t
td�r�t��}
nt��}
|
�|tj�d}|
j}tj}
z�|	�r||	��st�d��|�r0||}|dk�r0�q�z|
||||�}Wn`tk
�rh|	�s`|�Yq�Yq�t	k
�r�}z|dk�r�t|��|d�W5d}~XYq�X|dk�r��q�||7}||7}q�|W�S|dk�r�t
|d��r�|�|�XdS)Nri@�&non-blocking sockets are not supported�PollSelector�seekz	timed out)�_check_sendfile_paramsr4�AttributeErrorrX�UnsupportedOperationr#�os�fstat�st_size�OSError�minrIr�hasattr�	selectorsrfZSelectSelector�registerZEVENT_WRITEZselectrdrgr.�timeout�BlockingIOError)r0�file�offset�countZsocknor4�errZfsize�	blocksizersZselector�
total_sentZselector_selectZos_sendfile�sentrrr�_sendfile_use_sendfileYs^






zsocket._sendfile_use_sendfilecCstd��dS)Nz,os.sendfile() not available on this platform)r#�r0rurvrwrrrr|�s�c

Cs�|�|||�|��dkr"td��|r0|�|�|r>t|d�nd}d}|j}|j}z�|rpt|||�}|dkrpq�t||��}|s�q�z||�}	Wnt	k
r�Yq�Yq�X||	7}|	t
|�kr�||	d�}q�qTq�qT|W�S|dkr�t|d�r�|�||�XdS)Nrrei rg)rhrIrrgro�read�sendrp�
memoryviewrt�len)
r0rurvrwryrzZ	file_readZ	sock_send�datar{rrr�_sendfile_use_send�s8

zsocket._sendfile_use_sendcCsddt|dd�krtd��|jt@s*td��|dk	r`t|t�sJtd�|���|dkr`td�|���dS)NrTr^z$file should be opened in binary modez+only SOCK_STREAM type sockets are supportedz+count must be a positive integer (got {!r})r)r<rr2r-�
isinstance�intrD�formatr}rrrrh�s

��zsocket._check_sendfile_paramscCs8z|�|||�WStk
r2|�|||�YSXdSr)r|r#r�r}rrrrd�szsocket.sendfilecCs*|jdkr|jd8_|jr&|��dS)NrrU)r)r*r7r5rrr�_decref_socketios�s
zsocket._decref_socketioscCs|�|�dSr)r7)r0Z_ssrrr�_real_close�szsocket._real_closecCsd|_|jdkr|��dS)NTr)r*r)r�r5rrrr7�s
zsocket.closecsd|_t���S)NT)r*�super�detachr5�r=rrr��sz
socket.detachcstt�jt�Sr)rr�r1rr5r�rrr1sz
socket.familycstt�jt�Sr)rr�r2rr5r�rrr2szsocket.type�ntcCst�|���Sr)rkZget_handle_inheritabler4r5rrr�get_inheritable
szsocket.get_inheritablecCst�|��|�dSr)rkZset_handle_inheritabler4�r0Zinheritablerrr�set_inheritableszsocket.set_inheritablecCst�|���Sr)rkr�r4r5rrrr�scCst�|��|�dSr)rkr�r4r�rrrr�sz&Get the inheritable flag of the socketz&Set the inheritable flag of the socket)r+r+r+N)rON)rN)rN)rN)rN) r$r%r&�	__slots__r/r6r9rCrErGrNrcrprkr|r�rhrdr�r.r'r�r7r��propertyr1r2�namer�r��__doc__�
__classcell__rrr�rr'�sD

�*
A

$


r'cCst|�}t||||�Sr)rGr')rJr1r2r3Znfdrrrr
sZsharecCstddd|�S�Nr)r')�inforrr�	fromshare#sr��
socketpaircCsh|dkr*zt}Wntk
r(t}YnXt�|||�\}}t||||���}t||||���}||fSr)ZAF_UNIX�	NameErrorr,r.r�r'r�)r1r2r3�arTrrrr�.s
c
	Cs|tkrt}n|tkrt}ntd��|tkr4td��|dkrDtd��t|||�}z�|�|df�|�	�|�
�dd�\}}t|||�}zP|�d�z|�||f�Wnt
tfk
r�YnX|�d�|��\}}	Wn|���YnXW5|��X||fS)Nz?Only AF_INET and AF_INET6 socket address families are supportedz)Only SOCK_STREAM socket type is supportedrzOnly protocol zero is supported�FT)r,�
_LOCALHOST�AF_INET6�
_LOCALHOST_V6rr-r'r7�bind�listenr>rL�connectrt�InterruptedErrorrN)
r1r2r3�hostZlsockrM�portZcsockZssock�_rrrr�Cs8


a8socketpair([family[, type[, proto]]]) -> (socket object, socket object)
Create a pair of socket objects from the sockets returned by the platform
socketpair() function.
The arguments are the same as for socket() except the default family is AF_UNIX
if defined on the platform; otherwise, the default is AF_INET.
csleZdZdd�Zdd�Zdd�Zdd�Zd	d
�Z�fdd�Zd
d�Z	e
dd��Ze
dd��Zdd�Z
�ZS)rWcCsZ|dkrtd|��tj�|�||_d|kr6|d7}||_d|k|_d|k|_d|_dS)N)rOrSZrw�rb�wbZrwbzinvalid mode: %rrTrOrSF)	rrX�	RawIOBaser/�_sock�_mode�_reading�_writing�_timeout_occurred)r0rKr^rrrr/�s

zSocketIO.__init__c
Cs�|��|��|jrtd��z|j�|�WStk
rHd|_�Yqtk
r�}z|jdt	krpWY�
dS�W5d}~XYqXqdS)Nz!cannot read from timed out objectTr)
�_checkClosed�_checkReadabler�rnr�Z	recv_intorsr@r8�_blocking_errnos�r0rT�errr�readinto�s
zSocketIO.readintoc
Cs`|��|��z|j�|�WStk
rZ}z|jdtkrHWY�
dS�W5d}~XYnXdSr�)r��_checkWritabler�rr@r8r�r�rrr�write�s
zSocketIO.writecCs|jrtd��|jS�NzI/O operation on closed socket.)rArr�r5rrr�readable�szSocketIO.readablecCs|jrtd��|jSr�)rArr�r5rrr�writable�szSocketIO.writablecs|jrtd��t���Sr�)rArr��seekabler5r�rrr��szSocketIO.seekablecCs|��|j��Sr)r�r�r4r5rrrr4�szSocketIO.filenocCs|js|��SdSdS)Nr+)rAr4r5rrrr��sz
SocketIO.namecCs|jSr)r�r5rrrr^�sz
SocketIO.modecCs*|jr
dStj�|�|j��d|_dSr)rArXr�r7r�r�r5rrrr7�s

zSocketIO.close)r$r%r&r/r�r�r�r�r�r4r�r�r^r7r�rrr�rrWrs

rWr:cCsl|��}|r|dkrt�}zt|�\}}}Wntk
r@Yn(X|�d|�|D]}d|krRqhqR|}|S)Nz0.0.0.0r�.)�stripZgethostnameZ
gethostbyaddrr@�insert)r�Zhostname�aliasesZipaddrsrrrr�s	cCs�|\}}d}t||dt�D]�}|\}}}	}
}d}zDt|||	�}|tk	rP|�|�|r^|�|�|�|�d}|WStk
r�}
z|
}|dk	r�|��W5d}
~
XYqXq|dk	r�z|�W5d}Xntd��dS)Nrz!getaddrinfo returns an empty list)	�getaddrinfor-r'�_GLOBAL_DEFAULT_TIMEOUTrHr�r�r@r7)�addressrsZsource_addressr�r�rx�res�af�socktyper3�	canonname�sarKr�rrrrs.



c	Csltrttd�rttd�sdSz4ttt�� }|�ttd�W5QR�WdSQRXWnt	k
rfYdSXdS)N�IPPROTO_IPV6�IPV6_V6ONLYFrT)
�has_ipv6rpr.r'r�r-�
setsockoptr�r�r@)rKrrrr0s��F)r1�backlog�
reuse_port�dualstack_ipv6c
Csn|rttd�std��|r8t�s(td��|tkr8td��t|t�}�ztjdkr�ttd�r�z|�	t
td�Wntk
r�YnX|r�|�	t
t
d�tr�|tkr�|r�|�	ttd�n"ttd	�r�ttd
�r�|�	ttd�z|�|�Wn@tk
�r$}z d|j|f}t|j|�d�W5d}~XYnX|dk�r:|��n
|�|�|WStk
�rh|���YnXdS)N�SO_REUSEPORTz+SO_REUSEPORT not supported on this platformz-dualstack_ipv6 not supported on this platformz'dualstack_ipv6 requires AF_INET6 family)r��cygwin�SO_REUSEADDRrUrr�r�z+%s (while attempting to bind on address %r))rpr.rrr�r'r-rkr�r�Z
SOL_SOCKETr�r@r�r�r�r�r��strerror�errnor�r7)r�r1r�r�r�rKrx�msgrrrr
@sN


�
�� 


cCsPg}t�||||||�D]2}|\}}	}}
}|�t|t�t|	t�||
|f�q|Sr)r.r��appendrrr)r�r�r1r2r3�flagsZaddrlistr�r�r�r�r�rrrr��s�r�)r)r:)rrrr)0r.rk�sysrXrq�enumrrr��ImportErrorr<rrr	�__all__�extend�_get_exports_list�	_convert_r$r�r�rr'Z_realsocket�platform�lowerrr"r��	Exceptionr#r
rpr�r-r�r,r�r�r�rWr�objectr�rrr
r�rrrr�<module>1sF 
�����

F
	
$
u
�
-�E__pycache__/telnetlib.cpython-38.opt-2.pyc000064400000024761151153537570014354 0ustar00U

e5d�Z�@sFddlZddlZddlZddlmZdgZdZdZe	dg�Z
e	dg�Ze	dg�Ze	dg�Z
e	d	g�Ze	dg�Ze	d
g�Ze	dg�Ze	dg�Ze	d
g�Ze	dg�Ze	dg�Ze	dg�Ze	dg�Ze	dg�Ze	dg�Ze	dg�Ze	dg�Ze	dg�Ze	dg�Ze	dg�Ze	dg�Ze	dg�Z e	dg�Z!e	dg�Z"e	dg�Z#e	dg�Z$e	dg�Z%e	dg�Z&e	d g�Z'e	d!g�Z(e	d"g�Z)e	d#g�Z*e	d$g�Z+e	d%g�Z,e	d&g�Z-e	d'g�Z.e	d(g�Z/e	d)g�Z0e	d*g�Z1e	dg�Z2e	d+g�Z3e	d,g�Z4e	d-g�Z5e	d.g�Z6e	d/g�Z7e	d0g�Z8e	d1g�Z9e	d2g�Z:e	d3g�Z;e	d4g�Z<e	d5g�Z=e	d6g�Z>e	d7g�Z?e	d8g�Z@e	d9g�ZAe	d:g�ZBe	d;g�ZCe	d<g�ZDe	d=g�ZEe	d>g�ZFe	d?g�ZGe	d@g�ZHe	dAg�ZIe	dBg�ZJe	dCg�ZKe	dDg�ZLe	dEg�ZMe	dFg�ZNe	dGg�ZOe	dg�ZPe	dg�ZQeRedH��rejSZTnejUZTGdId�d�ZVdJdK�ZWeXdLk�rBeW�dS)M�N)�	monotonic�Telnet�������������������������������	�
���
������������������ �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1����PollSelectorc@seZdZddejfdd�Zdejfdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
d;dd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd<d5d6�Zd7d8�Zd9d:�Z dS)=rNrcCsht|_||_||_||_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
|dk	rd|�|||�dS)N�r)�
DEBUGLEVEL�
debuglevel�host�port�timeout�sock�rawq�irawq�cookedq�eof�iacseq�sb�sbdataq�option_callback�open��selfrLrMrN�r[�!/usr/lib64/python3.8/telnetlib.py�__init__�szTelnet.__init__cCsFd|_|st}||_||_||_t�d|||�t�||f|�|_	dS)Nrztelnetlib.Telnet.open)
rS�TELNET_PORTrLrMrN�sys�audit�socketZcreate_connectionrOrYr[r[r\rX�szTelnet.opencCs|��dS�N��close�rZr[r[r\�__del__�szTelnet.__del__cGs@|jdkr<td|j|jfdd�|r4t||�nt|�dS)NrzTelnet(%s,%s):� )�end)rK�printrLrM)rZ�msg�argsr[r[r\rj�s

z
Telnet.msgcCs
||_dSrb)rK)rZrKr[r[r\�set_debuglevel�szTelnet.set_debuglevelcCs.|j}d|_d|_d|_d|_|r*|��dS)NTrIr)rOrSrTrUrd)rZrOr[r[r\rdszTelnet.closecCs|jSrb)rOrer[r[r\�
get_socketszTelnet.get_socketcCs
|j��Srb)rO�filenorer[r[r\rnsz
Telnet.filenocCsBt|kr|�ttt�}t�d||�|�d|�|j�|�dS)Nztelnetlib.Telnet.writezsend %r)�IAC�replacer_r`rjrO�sendall)rZ�bufferr[r[r\�writes
zTelnet.writec
Cs*t|�}|��|j�|�}|dkrN||}|jd|�}|j|d�|_|S|dk	r`t�|}t���}|�|tj�|j	�s|�
|�r�tdt|j�|�}|��|��|j�||�}|dkr�||}|jd|�}|j|d�|_|W5QR�S|dk	rv|t�}|dkrv�qqvW5QRX|�
�S�Nr)�len�process_rawqrR�find�_time�_TelnetSelector�register�	selectors�
EVENT_READrS�select�max�	fill_rawq�read_very_lazy)rZ�matchrN�n�i�buf�deadline�selectorr[r[r\�
read_until&s8


zTelnet.read_untilcCs0|��|js |��|��q|j}d|_|S�NrI)rvrSrrR�rZr�r[r[r\�read_allKs
zTelnet.read_allcCs6|��|js&|js&|��|��q|j}d|_|Sr�)rvrRrSrr�r[r[r\�	read_someUs
zTelnet.read_somecCs0|��|js(|��r(|��|��q|��Srb)rvrS�
sock_availrr�rer[r[r\�read_very_eagerds

zTelnet.read_very_eagercCs6|��|js.|js.|��r.|��|��q|��Srb)rvrRrSr�rr�rer[r[r\�
read_eagerrs

zTelnet.read_eagercCs|��|��Srb)rvr�rer[r[r\�	read_lazy�szTelnet.read_lazycCs(|j}d|_|s$|jr$|js$td��|S)NrIztelnet connection closed)rRrSrP�EOFErrorr�r[r[r\r��s
zTelnet.read_very_lazycCs|j}d|_|Sr�)rVr�r[r[r\�read_sb_data�szTelnet.read_sb_datacCs
||_dSrb)rW)rZ�callbackr[r[r\�set_option_negotiation_callback�sz&Telnet.set_option_negotiation_callbackcCsRddg}�z|j�r|��}|jsf|tkr,q|dkr6q|tkrV||j|||j<qn|j|7_qt|j�dk�r$|ttt	t
fkr�|j|7_qd|_|tkr�||j|||j<nh|tkr�d|_d|_n&|t
kr�d|_|j|d|_d|d<|j�r|�|j|t�n|�dt|��qt|j�dkr|jdd�}d|_|}|ttfk�r�|�d|tk�rnd�ppd	t|��|j�r�|�|j||�n|j�tt
|�q|t	t
fkr|�d|t	k�r�d
�p�dt|��|j�r�|�|j||�q|j�tt|�qWn"tk
�r,d|_d|_YnX|j|d|_|j|d|_dS)NrI�rrzIAC %d not recognizedrz	IAC %s %d�DO�DONT�WILL�WONT)rP�rawq_getcharrT�theNULLrorUrur�r�r�r��SBrV�SErWrO�NOOPTrj�ordrqr�rR)rZr��c�cmd�optr[r[r\rv�sp��zTelnet.process_rawqcCsZ|js|��|jrt�|j|j|jd�}|jd|_|jt|j�krVd|_d|_|S)NrrIr)rPrrSr�rQru)rZr�r[r[r\r��szTelnet.rawq_getcharcCsL|jt|j�krd|_d|_|j�d�}|�d|�||_|j||_dS)NrIr�2zrecv %r)rQrurPrOZrecvrjrSr�r[r[r\rszTelnet.fill_rawqc
Cs:t��*}|�|tj�t|�d��W5QR�SQRXdSrt)ryrzr{r|�boolr})rZr�r[r[r\r�szTelnet.sock_availc
Cs�tjdkr|��dSt���}|�|tj�|�tjtj�|��D]�\}}|j	|kr�z|�
�}Wn*tk
r�td�YW5QR�dSX|r�tj
�|�d��tj
��qD|j	tjkrDtj���d�}|s�W5QR�dS|�|�qDq<W5QRXdS)NZwin32�(*** Connection closed by remote host ***�ascii)r_�platform�mt_interactryrzr{r|�stdinr}Zfileobjr�r�ri�stdoutrs�decode�flush�readline�encode)rZr��keyZevents�text�liner[r[r\�interacts*

zTelnet.interactcCs<ddl}|�|jd�tj��}|s&q8|�|�d��qdS)Nrr[r�)�_thread�start_new_thread�listenerr_r�r�rsr�)rZr�r�r[r[r\r�3s
zTelnet.mt_interactcCsTz|��}Wntk
r*td�YdSX|rDtj�|�d��qtj��qdS)Nr�r�)r�r�rir_r�rsr�r�)rZ�datar[r[r\r�=szTelnet.listenerc
CsTd}|dd�}tt|��}|D]0}t||d�s |s>ddl}|�||�||<q |dk	rdt�|}t���}|�|tj	�|j
�s&|��|D]X}||�|j
�}|r�|��}	|j
d|	�}
|j
|	d�|_
|||
fW5QR�Sq�|dk	�r|�|�}|t�}|�s|dkrz�q&nqz|��qzW5QRX|��}
|
�sJ|j
�rJt�dd|
fS)N�searchr���)�rangeru�hasattr�re�compilerxryrzr{r|rSrvr�rRrhr}rr�r�)rZ�listrNr��indicesr�r�r��m�er�Zreadyr[r[r\�expectJsB



z
Telnet.expectcCs|Srbr[rer[r[r\�	__enter__�szTelnet.__enter__cCs|��dSrbrc)rZ�type�value�	tracebackr[r[r\�__exit__�szTelnet.__exit__)N)N)!�__name__�
__module__�__qualname__raZ_GLOBAL_DEFAULT_TIMEOUTr]rXrfrjrlrdrmrnrsr�r�r�r�r�r�r�r�r�rvr�rr�r�r�r�r�r�r�r[r[r[r\r�s<7�


%

H

8c	Cs�d}tjdd�r2tjddkr2|d}tjd=qd}tjdd�rNtjd}d}tjdd�r�tjd}zt|�}Wn tk
r�t�|d�}YnXt��(}|�|�|j||dd�|�	�W5QRXdS)	Nrrz-dZ	localhostrZtcpg�?)rN)
r_�argv�int�
ValueErrorraZ
getservbynamerrlrXr�)rKrLrMZportstrZtnr[r[r\�test�s$



r��__main__)Yr_rar{�timerrx�__all__rJr^�bytesror�r�r�r�r�r�ZNOPZDMZBRKZIPZAOZAYTZECZELZGAr�ZBINARYZECHOZRCPZSGAZNAMSZSTATUSZTMZRCTEZNAOLZNAOPZNAOCRDZNAOHTSZNAOHTDZNAOFFDZNAOVTSZNAOVTDZNAOLFDZXASCIIZLOGOUTZBMZDETZSUPDUPZSUPDUPOUTPUTZSNDLOCZTTYPEZEORZTUIDZOUTMRKZTTYLOCZVT3270REGIMEZX3PADZNAWSZTSPEEDZLFLOWZLINEMODEZXDISPLOCZOLD_ENVIRONZAUTHENTICATIONZENCRYPTZNEW_ENVIRONZTN3270EZXAUTH�CHARSETZRSPZCOM_PORT_OPTIONZSUPPRESS_LOCAL_ECHOZTLSZKERMITZSEND_URLZ	FORWARD_XZPRAGMA_LOGONZ
SSPI_LOGONZPRAGMA_HEARTBEATZEXOPLr�r�rHryZSelectSelectorrr�r�r[r[r[r\�<module>$s�








































































__pycache__/filecmp.cpython-38.pyc000064400000020355151153537570013044 0ustar00U

e5df&�@s�dZddlZddlZddlmZdddddgZiZd	Zd
ddd
ddddgZdd�Z	d"dd�Z
dd�Zdd�ZGdd�d�Z
d#dd�Zee
fdd�Zdd�Zdd �Zed!kr�e�dS)$z�Utilities for comparing files and directories.

Classes:
    dircmp

Functions:
    cmp(f1, f2, shallow=True) -> int
    cmpfiles(a, b, common) -> ([], [], [])
    clear_cache()

�N)�filterfalse�clear_cache�cmp�dircmp�cmpfiles�DEFAULT_IGNORESi ZRCSZCVSZtagsz.gitz.hgz.bzrZ_darcs�__pycache__cCst��dS)zClear the filecmp cache.N)�_cache�clear�rr�/usr/lib64/python3.8/filecmp.pyrsTcCs�tt�|��}tt�|��}|dtjks8|dtjkr<dS|rL||krLdS|d|dkr`dSt�||||f�}|dkr�t||�}tt�dkr�t�|t||||f<|S)a�Compare two files.

    Arguments:

    f1 -- First file name

    f2 -- Second file name

    shallow -- Just check stat signature (do not read the files).
               defaults to True.

    Return value:

    True if the files are the same, False otherwise.

    This function uses a cache for past comparisons and the results,
    with cache entries invalidated if their stat information
    changes.  The cache may be cleared by calling clear_cache().

    rFT�N�d)	�_sig�os�stat�S_IFREGr	�get�_do_cmp�lenr)�f1�f2�shallow�s1�s2Zoutcomerrrrs
cCst�|j�|j|jfS�N)r�S_IFMT�st_mode�st_size�st_mtime)�strrrrDs
�rc
Cs�t}t|d��n}t|d��X}|�|�}|�|�}||krPW5QR�W5QR�dS|sW5QR�W5QR�dSqW5QRXW5QRXdS)N�rbFT)�BUFSIZE�open�read)rr�bufsize�fp1�fp2Zb1Zb2rrrrIs

rc@s�eZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
ee	eeeeeeeeeeed�Zdd�ZdS)raMA class that manages the comparison of 2 directories.

    dircmp(a, b, ignore=None, hide=None)
      A and B are directories.
      IGNORE is a list of names to ignore,
        defaults to DEFAULT_IGNORES.
      HIDE is a list of names to hide,
        defaults to [os.curdir, os.pardir].

    High level usage:
      x = dircmp(dir1, dir2)
      x.report() -> prints a report on the differences between dir1 and dir2
       or
      x.report_partial_closure() -> prints report on differences between dir1
            and dir2, and reports on common immediate subdirectories.
      x.report_full_closure() -> like report_partial_closure,
            but fully recursive.

    Attributes:
     left_list, right_list: The files in dir1 and dir2,
        filtered by hide and ignore.
     common: a list of names in both dir1 and dir2.
     left_only, right_only: names only in dir1, dir2.
     common_dirs: subdirectories in both dir1 and dir2.
     common_files: files in both dir1 and dir2.
     common_funny: names in both dir1 and dir2 where the type differs between
        dir1 and dir2, or the name is not stat-able.
     same_files: list of identical files.
     diff_files: list of filenames which differ.
     funny_files: list of files which could not be compared.
     subdirs: a dictionary of dircmp objects, keyed by names in common_dirs.
     NcCsD||_||_|dkr$tjtjg|_n||_|dkr:t|_n||_dSr)�left�rightr�curdir�pardir�hider�ignore)�self�a�br-r,rrr�__init__xszdircmp.__init__cCsPtt�|j�|j|j�|_tt�|j�|j|j�|_|j�	�|j�	�dSr)
�_filterr�listdirr(r,r-�	left_listr)�
right_list�sort�r.rrr�phase0�s
�
�
z
dircmp.phase0cCs�ttttjj|j�|j��}ttttjj|j�|j��}tt|j	t
|j|���|_tt|j	t
|j|���|_tt|j	t
|j|���|_dSr)�dict�zip�mapr�path�normcaser4r5�list�__getitem__�filter�__contains__�commonr�	left_only�
right_only)r.r/r0rrr�phase1�s
z
dircmp.phase1c
Cs4g|_g|_g|_|jD�]}tj�|j|�}tj�|j|�}d}zt�	|�}Wn&t
k
rv}zd}W5d}~XYnXzt�	|�}Wn&t
k
r�}zd}W5d}~XYnX|�r"t	�|j�}t	�|j�}	||	kr�|j�
|�n>t	�|�r�|j�
|�n&t	�|��r|j�
|�n|j�
|�q|j�
|�qdS)Nr
r)�common_dirs�common_files�common_funnyrBrr<�joinr(r)r�OSErrorrr�append�S_ISDIR�S_ISREG)
r.�xZa_pathZb_path�okZa_statZwhyZb_statZa_typeZb_typerrr�phase2�s4
z
dircmp.phase2cCs&t|j|j|j�}|\|_|_|_dSr)rr(r)rG�
same_files�
diff_files�funny_files)r.Zxxrrr�phase3�sz
dircmp.phase3cCsNi|_|jD]<}tj�|j|�}tj�|j|�}t|||j|j	�|j|<qdSr)
�subdirsrFrr<rIr(r)rr-r,)r.rNZa_xZb_xrrr�phase4�s

z
dircmp.phase4cCs$|��|j��D]}|��qdSr)rVrU�values�phase4_closure�r.ZsdrrrrX�szdircmp.phase4_closurecCs�td|j|j�|jr2|j��td|jd|j�|jrT|j��td|jd|j�|jrp|j��td|j�|jr�|j��td|j�|jr�|j��td|j�|j	r�|j	��td|j	�|j
r�|j
��td|j
�dS)	NZdiffzOnly in�:zIdentical files :zDiffering files :zTrouble with common files :zCommon subdirectories :zCommon funny cases :)�printr(r)rCr6rDrQrRrSrFrHr7rrr�report�s,






z
dircmp.reportcCs*|��|j��D]}t�|��qdSr)r\rUrWr[rYrrr�report_partial_closure�szdircmp.report_partial_closurecCs*|��|j��D]}t�|��qdSr)r\rUrWr[�report_full_closurerYrrrr^�szdircmp.report_full_closure)rUrQrRrSrFrGrHrBrCrDr4r5cCs*||jkrt|��|j||�t||�Sr)�	methodmap�AttributeError�getattr)r.�attrrrr�__getattr__�s
zdircmp.__getattr__)NN)�__name__�
__module__�__qualname__�__doc__r1r8rErPrTrVrXr\r]r^r9r_rcrrrrrVs2!
#
�cCsJgggf}|D]6}tj�||�}tj�||�}|t|||��|�q|S)a]Compare common files in two directories.

    a, b -- directory names
    common -- list of file names found in both directories
    shallow -- if true, do comparison based solely on stat() information

    Returns a tuple of three lists:
      files that compare equal
      files that are different
      filenames that aren't regular files.

    )rr<rI�_cmprK)r/r0rBr�resrNZaxZbxrrrr�s
cCs0z|||||��WStk
r*YdSXdS)N�)rJ)r/r0Zsh�absrrrrrhsrhcCstt|j|��Sr)r>rrA)Zflist�skiprrrr2sr2cCsrddl}ddl}|�|jdd�d�\}}t|�dkrB|�dd��t|d|d�}d|krf|��n|��dS)Nrr
�rrjzneed exactly two args)z-r�)�sys�getopt�argvrZGetoptErrorrr^r\)rorpZoptions�argsZddrrr�demo$s
rs�__main__)T)T)rgrr�	itertoolsr�__all__r	r"rrrrrrrrkrhr2rsrdrrrr�<module>s6�
'
%
	__pycache__/numbers.cpython-38.opt-1.pyc000064400000027654151153537570014050 0ustar00U

e5d(�@s�dZddlmZmZdddddgZGdd�ded	�ZGd
d�de�Ze�e�Gdd�de�Z	e	�e
�Gdd�de	�ZGd
d�de�Ze�e
�dS)z~Abstract Base Classes (ABCs) for numbers, according to PEP 3141.

TODO: Fill out more detailed documentation on the operators.�)�ABCMeta�abstractmethod�Number�Complex�Real�Rational�Integralc@seZdZdZdZdZdS)rz�All numbers inherit from this class.

    If you just want to check if an argument x is a number, without
    caring what kind, use isinstance(x, Number).
    �N)�__name__�
__module__�__qualname__�__doc__�	__slots__�__hash__r	r	r	�/usr/lib64/python3.8/numbers.pyrs)�	metaclassc@s�eZdZdZdZedd��Zdd�Zeedd���Z	eed	d
���Z
edd��Zed
d��Zedd��Z
edd��Zdd�Zdd�Zedd��Zedd��Zedd��Zedd��Zedd ��Zed!d"��Zed#d$��Zed%d&��Zed'd(��Zd)S)*rabComplex defines the operations that work on the builtin complex type.

    In short, those are: a conversion to complex, .real, .imag, +, -,
    *, /, abs(), .conjugate, ==, and !=.

    If it is given heterogeneous arguments, and doesn't have special
    knowledge about them, it should fall back to the builtin complex
    type as described below.
    r	cCsdS)z<Return a builtin complex instance. Called for complex(self).Nr	��selfr	r	r�__complex__-szComplex.__complex__cCs|dkS)z)True if self != 0. Called for bool(self).rr	rr	r	r�__bool__1szComplex.__bool__cCst�dS)zXRetrieve the real component of this number.

        This should subclass Real.
        N��NotImplementedErrorrr	r	r�real5szComplex.realcCst�dS)z]Retrieve the imaginary component of this number.

        This should subclass Real.
        Nrrr	r	r�imag>szComplex.imagcCst�dS)zself + otherNr�r�otherr	r	r�__add__GszComplex.__add__cCst�dS)zother + selfNrrr	r	r�__radd__LszComplex.__radd__cCst�dS)z-selfNrrr	r	r�__neg__QszComplex.__neg__cCst�dS)z+selfNrrr	r	r�__pos__VszComplex.__pos__cCs
||S)zself - otherr	rr	r	r�__sub__[szComplex.__sub__cCs
||S)zother - selfr	rr	r	r�__rsub___szComplex.__rsub__cCst�dS)zself * otherNrrr	r	r�__mul__cszComplex.__mul__cCst�dS)zother * selfNrrr	r	r�__rmul__hszComplex.__rmul__cCst�dS)z5self / other: Should promote to float when necessary.Nrrr	r	r�__truediv__mszComplex.__truediv__cCst�dS)zother / selfNrrr	r	r�__rtruediv__rszComplex.__rtruediv__cCst�dS)zBself**exponent; should promote to float or complex when necessary.Nr)r�exponentr	r	r�__pow__wszComplex.__pow__cCst�dS)zbase ** selfNr)r�baser	r	r�__rpow__|szComplex.__rpow__cCst�dS)z7Returns the Real distance from 0. Called for abs(self).Nrrr	r	r�__abs__�szComplex.__abs__cCst�dS)z$(x+y*i).conjugate() returns (x-y*i).Nrrr	r	r�	conjugate�szComplex.conjugatecCst�dS)z
self == otherNrrr	r	r�__eq__�szComplex.__eq__N)r
rrr
rrrr�propertyrrrrrrr r!r"r#r$r%r'r)r*r+r,r	r	r	rr sN













c@s�eZdZdZdZedd��Zedd��Zedd��Zed	d
��Z	ed&dd
��Z
dd�Zdd�Zedd��Z
edd��Zedd��Zedd��Zedd��Zedd��Zdd�Zed d!��Zed"d#��Zd$d%�ZdS)'rz�To Complex, Real adds the operations that work on real numbers.

    In short, those are: a conversion to float, trunc(), divmod,
    %, <, <=, >, and >=.

    Real also provides defaults for the derived operations.
    r	cCst�dS)zTAny Real can be converted to a native float object.

        Called for float(self).Nrrr	r	r�	__float__�szReal.__float__cCst�dS)aGtrunc(self): Truncates self to an Integral.

        Returns an Integral i such that:
          * i>0 iff self>0;
          * abs(i) <= abs(self);
          * for any Integral j satisfying the first two conditions,
            abs(i) >= abs(j) [i.e. i has "maximal" abs among those].
        i.e. "truncate towards 0".
        Nrrr	r	r�	__trunc__�szReal.__trunc__cCst�dS)z$Finds the greatest Integral <= self.Nrrr	r	r�	__floor__�szReal.__floor__cCst�dS)z!Finds the least Integral >= self.Nrrr	r	r�__ceil__�sz
Real.__ceil__NcCst�dS)z�Rounds self to ndigits decimal places, defaulting to 0.

        If ndigits is omitted or None, returns an Integral, otherwise
        returns a Real. Rounds half toward even.
        Nr)rZndigitsr	r	r�	__round__�szReal.__round__cCs||||fS)z�divmod(self, other): The pair (self // other, self % other).

        Sometimes this can be computed faster than the pair of
        operations.
        r	rr	r	r�
__divmod__�szReal.__divmod__cCs||||fS)z�divmod(other, self): The pair (self // other, self % other).

        Sometimes this can be computed faster than the pair of
        operations.
        r	rr	r	r�__rdivmod__�szReal.__rdivmod__cCst�dS)z)self // other: The floor() of self/other.Nrrr	r	r�__floordiv__�szReal.__floordiv__cCst�dS)z)other // self: The floor() of other/self.Nrrr	r	r�
__rfloordiv__�szReal.__rfloordiv__cCst�dS)zself % otherNrrr	r	r�__mod__�szReal.__mod__cCst�dS)zother % selfNrrr	r	r�__rmod__�sz
Real.__rmod__cCst�dS)zRself < other

        < on Reals defines a total ordering, except perhaps for NaN.Nrrr	r	r�__lt__�szReal.__lt__cCst�dS)z
self <= otherNrrr	r	r�__le__�szReal.__le__cCstt|��S)z(complex(self) == complex(float(self), 0))�complex�floatrr	r	rr�szReal.__complex__cCs|
S)z&Real numbers are their real component.r	rr	r	rr�sz	Real.realcCsdS)z)Real numbers have no imaginary component.rr	rr	r	rr�sz	Real.imagcCs|
S)zConjugate is a no-op for Reals.r	rr	r	rr+szReal.conjugate)N)r
rrr
rrr.r/r0r1r2r3r4r5r6r7r8r9r:rr-rrr+r	r	r	rr�s@











c@s<eZdZdZdZeedd���Zeedd���Zdd�Z	d	S)
rz6.numerator and .denominator should be in lowest terms.r	cCst�dS�Nrrr	r	r�	numeratorszRational.numeratorcCst�dSr=rrr	r	r�denominatorszRational.denominatorcCs|j|jS)afloat(self) = self.numerator / self.denominator

        It's important that this conversion use the integer's "true"
        division rather than casting one side to float before dividing
        so that ratios of huge integers convert without overflowing.

        )r>r?rr	r	rr.szRational.__float__N)
r
rrr
rr-rr>r?r.r	r	r	rrsc@s�eZdZdZdZedd��Zdd�Zed&dd	��Zed
d��Z	edd
��Z
edd��Zedd��Zedd��Z
edd��Zedd��Zedd��Zedd��Zedd��Zedd��Zd d!�Zed"d#��Zed$d%��ZdS)'rz@Integral adds a conversion to int and the bit-string operations.r	cCst�dS)z	int(self)Nrrr	r	r�__int__+szIntegral.__int__cCst|�S)z6Called whenever an index is needed, such as in slicing)�intrr	r	r�	__index__0szIntegral.__index__NcCst�dS)a4self ** exponent % modulus, but maybe faster.

        Accept the modulus argument if you want to support the
        3-argument version of pow(). Raise a TypeError if exponent < 0
        or any argument isn't Integral. Otherwise, just implement the
        2-argument version described in Complex.
        Nr)rr&�modulusr	r	rr'4s	zIntegral.__pow__cCst�dS)z
self << otherNrrr	r	r�
__lshift__?szIntegral.__lshift__cCst�dS)z
other << selfNrrr	r	r�__rlshift__DszIntegral.__rlshift__cCst�dS)z
self >> otherNrrr	r	r�
__rshift__IszIntegral.__rshift__cCst�dS)z
other >> selfNrrr	r	r�__rrshift__NszIntegral.__rrshift__cCst�dS)zself & otherNrrr	r	r�__and__SszIntegral.__and__cCst�dS)zother & selfNrrr	r	r�__rand__XszIntegral.__rand__cCst�dS)zself ^ otherNrrr	r	r�__xor__]szIntegral.__xor__cCst�dS)zother ^ selfNrrr	r	r�__rxor__bszIntegral.__rxor__cCst�dS)zself | otherNrrr	r	r�__or__gszIntegral.__or__cCst�dS)zother | selfNrrr	r	r�__ror__lszIntegral.__ror__cCst�dS)z~selfNrrr	r	r�
__invert__qszIntegral.__invert__cCstt|��S)zfloat(self) == float(int(self)))r<rArr	r	rr.wszIntegral.__float__cCs|
S)z"Integers are their own numerators.r	rr	r	rr>{szIntegral.numeratorcCsdS)z!Integers have a denominator of 1.�r	rr	r	rr?�szIntegral.denominator)N)r
rrr
rrr@rBr'rDrErFrGrHrIrJrKrLrMrNr.r-r>r?r	r	r	rr&sD













N)r
�abcrr�__all__rr�registerr;rr<rrrAr	r	r	r�<module>sp
u
___pycache__/datetime.cpython-38.pyc000064400000157527151153537570013235 0ustar00U

e5d�X�
@s�dZddlZddlZddlZdd�ZdZdZdZ	dd	d
d	dd	dd	d	dd	dd	g
Z
dgZdZe
dd�D]Z
e�e�ee
7Zqd[[
dd
�Zdd�Zdd�Zdd�Zdd�Zed�Zed�Zed�Zedks�t�ededks�t�ededks�t�dd�Zdddd d!d"d#d$d%d&d'd(d)g
Zdd*d+d,d-d.d/d0gZd1d2�Zdld4d5�Zd6d7�Zd8d9�Zd:d;�Zd<d=�Z d>d?�Z!d@dA�Z"dBdC�Z#dDdE�Z$dFdG�Z%dHdI�Z&dJdK�Z'dLdM�Z(dNdO�Z)GdPdQ�dQ�Z*e*dR�e*_+e*dSdTdUdUdVdW�e*_,e*ddX�e*_-GdYdZ�dZ�Z.e.Z/e.ddd�e._+e.dd[d	�e._,e*dd\�e._-Gd]d^�d^�Z0e0Z1Gd_d`�d`�ZeZ2eddd�e_+edTdUdUdV�e_,e*ddX�e_-Gdadb�dbe.�Z3e3ddd�e3_+e3dd[d	dTdUdUdV�e3_,e*ddX�e3_-dcdd�Z4Gdedf�dfe0�Z5e5�6e*d��e5_7e5�6e*dTdUdg��e5_+e5�6e*dTdUdg��e5_,e3dhdde5j7di�Z8zddjl9TWne:k
�r.YnXX[[[
[[[[8[	[[[%[$[&['["[#[[([/[[[[[[[4[[[[2[1[[[)[[![ ddkl9mZdS)mz�Concrete date/time and related types.

See http://www.iana.org/time-zones/repository/tz-link.html for
time zone and DST data sources.
�NcCs||krdS||krdSdS)Nr�������x�yrr� /usr/lib64/python3.8/datetime.py�_cmpsr	ri'i۹7r���cCs$|ddko"|ddkp"|ddkS)zyear -> 1 if leap year, else 0.�r�d�r)�yearrrr�_is_leap%srcCs(|d}|d|d|d|dS)z2year -> number of days before January 1st of year.r�mr
rrr)rrrrr�_days_before_year)srcCs:d|krdksnt|��|dkr2t|�r2dSt|S)z9year, month -> number of days in that month in that year.r���)�AssertionErrorr�_DAYS_IN_MONTH�r�monthrrr�_days_in_month.srcCs6d|krdksntd��t||dko2t|�S)zCyear, month -> number of days in year preceding first day of month.rr�month must be in 1..12r)r�_DAYS_BEFORE_MONTHrrrrr�_days_before_month5srcCs`d|krdksntd��t||�}d|kr<|ksJntd|��t|�t||�|S)z>year, month, day -> ordinal, considering 01-Jan-0001 as day 1.rrr�day must be in 1..%d)rrrr�rr�day�dimrrr�_ymd2ord:s
"��r#i��e�i�r
�c	Cs8|d8}t|t�\}}|dd}t|t�\}}t|t�\}}t|d�\}}||d|d|7}|dkst|dkr�|dks�t�|dddfS|d	ko�|d
kp�|d	k}|t|�ks�t�|dd?}t||d
ko�|}||kr�|d8}|t||d
ko�|8}||8}d|k�r$t||�k�s*nt�|||dfS)z@ordinal -> (year, month, day), considering 01-Jan-0001 as day 1.rrrrr
rrr
���2r%r)	�divmod�_DI400Y�_DI100Y�_DI4Yrrrrr)	�nZn400rZn100Zn4Zn1ZleapyearrZ	precedingrrr�_ord2ymdSs($r/ZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDecZMonZTueZWedZThuZFriZSatZSunc	Cs>t|||�dd}t||�|}t�|||||||||f	�S)N��)r#r�_time�struct_time)	r�m�d�hh�mm�ssZdstflagZwdayZdnumrrr�_build_struct_time�sr9�autocCstdddddd�}|dkr&|r dnd	}n|d
kr6|d}z||}Wntk
r^td��YnX|�||||�SdS)
Nz{:02d}z
{:02d}:{:02d}z{:02d}:{:02d}:{:02d}z{:02d}:{:02d}:{:02d}.{:03d}z{:02d}:{:02d}:{:02d}.{:06d})�hours�minutes�seconds�milliseconds�microsecondsr:r?r=r>��zUnknown timespec value)�KeyError�
ValueError�format)r6r7r8�us�timespecZspecs�fmtrrr�_format_time�s�rGcCs�d}|dk	r�|jdkr"d}|}nd}t|tdd��\}}t|tdd��\}}|d|||f7}|sj|jr�|d	|j7}|jr�|d
|j7}|S)N�r�-�+r�r;�r<z%s%02d:%02dz:%02d�.%06d)�daysr*�	timedeltar?r=)�off�s�signr6r7r8rrr�_format_offset�s

rScCs�d}d}d}g}|j}dt|�}}	||	k�r�||}
|d7}|
dk�r�||	k�r�||}
|d7}|
dkr�|dkr�dt|dd�}|�|��q�|
dk�rl|dk�rRd}t|d	��rR|��}|dk	�rRd
}|jdkr�|}d}t|tdd��\}
}t|tdd
��\}}|j}|j	}|�r,d||
|||f}n&|�rDd||
||f}nd||
|f}d|k�s`t
�|�|�n^|
dk�r�|dk�r�d}t|d��r�|��}|dk	�r�|�dd�}|�|�n|d�||
�n|d�q$||
�q$d�
|�}t�||�S)Nrr�%�fz%06d�microsecond�zrH�	utcoffsetrJrIrKrLz%c%02d%02d%02d.%06dz%c%02d%02d%02dz
%c%02d%02d�Z�tznamez%%)�append�len�getattr�hasattrrXrNr*rOr=r?rrZ�replace�joinr2�strftime)�objectrC�	timetupleZfreplaceZzreplaceZZreplaceZ	newformat�push�ir.Zch�offsetrR�h�restr4rQ�urrr�_wrap_strftime�sn


�










rjcCsjt|dd��}|ddkr,td|d��t|dd��}|ddkrPtd��t|dd	��}|||gS)
Nrr
rIzInvalid date separator: %sr%r1zInvalid date separator��
)�intrB)Zdtstrrrr!rrr�_parse_isoformat_datesrncCs
t|�}ddddg}d}tdd�D]t}||dkr:td��t|||d��||<|d7}|||d�}|rv|dkrzq�|dkr�td|��|d7}q"||k�r||dkr�td	��nN|d7}||}|d
kr�td	��t||d��|d<|dk�r|dd9<|S)Nrr'rzIncomplete time componentr�:zInvalid time separator: %c�.zInvalid microsecond component)r'r0r@)r\�rangerBrm)�tstr�len_str�
time_comps�pos�compZ	next_charZ
len_remainderrrr�_parse_hh_mm_ss_ffs2



rwc
Cs�t|�}|dkrtd��|�d�dp2|�d�d}|dkrL|d|d�n|}t|�}d}|dkr�||d�}t|�dkr�td��t|�}td	d
�|D��r�tj}nD||ddkr�dnd}t|d|d|d|dd
�}	t||	�}|�|�|S)NrzIsoformat time too shortrIrrJr)r%rk�zMalformed time zone stringcss|]}|dkVqdS)rNr)�.0rrrr�	<genexpr>Tsz(_parse_isoformat_time.<locals>.<genexpr>rr'�r;r<r=r?)	r\rB�findrw�all�timezone�utcrOr[)
rrrsZtz_posZtimestrrtZtziZtzstrZtz_compsZtzsignZtdrrr�_parse_isoformat_time;s,�
r�cCs&|dk	r"t|t�s"tdt|���dS)Nz4tzinfo.tzname() must return None or string, not '%s')�
isinstance�str�	TypeError�type)�namerrr�
_check_tznameds�r�cCsj|dkst�|dkrdSt|t�s6td|t|�f��td�|krTtd�ksfntd||f��dS)N)rX�dstz3tzinfo.%s() must return None or timedelta, not '%s'rzN%s()=%s, must be strictly between -timedelta(hours=24) and timedelta(hours=24))rr�rOr�r�rB)r�rfrrr�_check_utc_offsetos

� �r�cCs�t|t�r|St|t�r td��z|��}Wntk
r@Yn"Xt|t�s^tdt|�j��|S|}z|��}Wntk
r�YnDXt|t�s�tdt|�j��ddl	}|j
dt|�jtdd�|Stdt|�j��dS)Nz$integer argument expected, got floatz$__index__ returned non-int (type %s)z"__int__ returned non-int (type %s)rz$an integer is required (got type %s)r)�
stacklevel)r�rm�floatr��	__index__�AttributeErrorr��__name__�__int__�warnings�warn�DeprecationWarning)�valueZorigr�rrr�_check_int_field{sB


�
����r�cCs�t|�}t|�}t|�}t|kr,tks@ntdttf|��d|krTdks`ntd|��t||�}d|kr~|ks�ntd||��|||fS)Nzyear must be in %d..%drrrr)r��MINYEAR�MAXYEARrBrr rrr�_check_date_fields�s

r�cCs�t|�}t|�}t|�}t|�}d|kr4dks@ntd|��d|krTdks`ntd|��d|krtdks�ntd|��d|kr�dks�ntd|��|d	kr�td
|��|||||fS)Nr�zhour must be in 0..23�;zminute must be in 0..59zsecond must be in 0..59�?Bz microsecond must be in 0..999999)rrzfold must be either 0 or 1)r�rB)�hour�minute�secondrV�foldrrr�_check_time_fields�s




r�cCs|dk	rt|t�std��dS)Nz4tzinfo argument must be None or of a tzinfo subclass)r��tzinfor�)�tzrrr�_check_tzinfo_arg�sr�cCs tdt|�jt|�jf��dS)Nzcan't compare '%s' to '%s')r�r�r�rrrr�	_cmperror�s�r�cCsRt||�\}}|d9}|dkr&||kn||k}|sF||krN|ddkrN|d7}|S)z�divide a by b and round result to the nearest integer

    When the ratio is exactly half-way between two integers,
    the even integer is returned.
    rrr)r*)�a�b�q�rZgreater_than_halfrrr�_divide_and_round�sr�c@seZdZdZdZd?dd�Zdd�Zdd	�Zd
d�Ze	dd
��Z
e	dd��Ze	dd��Zdd�Z
e
Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�ZeZd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Z d6d7�Z!d8d9�Z"d:d;�Z#d<d=�Z$d>S)@rOa�Represent the difference between two datetime objects.

    Supported operators:

    - add, subtract timedelta
    - unary plus, minus, abs
    - compare to timedelta
    - multiply, divide by int

    In addition, datetime supports subtraction of two datetime objects
    returning a timedelta, and addition or subtraction of a datetime
    and a timedelta giving a datetime.

    Representation: (days, seconds, microseconds).  Why?  Because I
    felt like it.
    )�_days�_seconds�
_microseconds�	_hashcodercCsVd}}	}
||d7}||d|d7}||d7}t|t�r�t�|�\}}t�|d�\}}
|
t|
�ksrt�t|
�}	|t|�ks�t�t|�}nd}|}t|t�s�t�t|�dks�t�t|t�s�t�t|	�d	ks�t�t|t��r(t�|�\}}|t|�k�st�t|�}||7}t|�d
k�s,t�n|}t|t��s<t�t|�d
k�sNt�t|t��s^t�t|d	�\}}||7}|	t|�7}	t|	t��s�t�t|	�dk�s�t�|d}t|�d
k�s�t�t|t��rt||�}t|d�\}}t|d	�\}}||7}|	|7}	n@t|�}t|d�\}}t|d	�\}}||7}|	|7}	t||�}t|	t��sRt�t|t��sbt�t|	�dk�stt�t|�dk�s�t�t|d�\}}
|	|7}	t|	d	�\}}	||7}t|t��s�t�t|	t��r�d|	k�r�d	k�s�nt�t|
t��rd|
k�rdk�snt�t|�dk�r0t	d|��t
�|�}||_|	|_
|
|_d|_|S)Nrr1�<�r@g�@gg�?�Qg@i����.Ag�@A�@Bi��g��GA�ɚ;z$timedelta # of days is too large: %dr)r�r��_math�modfrmr�absr*�round�
OverflowErrorrb�__new__r�r�r�r�)�clsrNr=r?r>r<r;Zweeksr5rQrDZdayfracZdaysecondsfracZdaysecondswholeZsecondsfracZusdouble�selfrrrr��s�


**
ztimedelta.__new__cCspg}|jr|�d|j�|jr0|�d|j�|jrF|�d|j�|sT|�d�d|jj|jjd�|�fS)Nzdays=%dz
seconds=%dzmicroseconds=%d�0�	%s.%s(%s)�, )r�r[r�r��	__class__�
__module__�__qualname__r`)r��argsrrr�__repr__Ms
�ztimedelta.__repr__cCsdt|jd�\}}t|d�\}}d|||f}|jrLdd�}d||j�|}|jr`|d|j}|S)Nr�z%d:%02d:%02dcSs|t|�dkrdpdfS)NrrQrH)r�)r.rrr�plural`sz!timedelta.__str__.<locals>.pluralz
%d day%s, rM)r*r�r�r�)r�r7r8r6rQr�rrr�__str__[sztimedelta.__str__cCs|jd|jd|jdS)zTotal seconds in the duration.r�r�)rNr=r?�r�rrr�
total_secondsgs
��ztimedelta.total_secondscCs|jS�rN�r�r�rrrrNmsztimedelta.dayscCs|jS�r=)r�r�rrrr=rsztimedelta.secondscCs|jS�r?)r�r�rrrr?wsztimedelta.microsecondscCs2t|t�r.t|j|j|j|j|j|j�StS�N�r�rOr�r�r��NotImplemented�r��otherrrr�__add__|s


�ztimedelta.__add__cCs2t|t�r.t|j|j|j|j|j|j�StSr�r�r�rrr�__sub__�s


�ztimedelta.__sub__cCst|t�r||StSr�)r�rOr�r�rrr�__rsub__�s

ztimedelta.__rsub__cCst|j|j|j�Sr�)rOr�r�r�r�rrr�__neg__�s�ztimedelta.__neg__cCs|Sr�rr�rrr�__pos__�sztimedelta.__pos__cCs|jdkr|S|SdS�Nrr�r�rrr�__abs__�s
ztimedelta.__abs__cCs`t|t�r(t|j||j||j|�St|t�r\|��}|��\}}tddt	|||��St
Sr�)r�rmrOr�r�r�r��_to_microseconds�as_integer_ratior�r��r�r��usecr�r�rrr�__mul__�s

�
ztimedelta.__mul__cCs|jd|jd|jS)Nr�r��r�r�r�r�rrrr��s�ztimedelta._to_microsecondscCsNt|ttf�stS|��}t|t�r0||��St|t�rJtdd||�SdSr�)r�rmrOr�r�)r�r�r�rrr�__floordiv__�s

ztimedelta.__floordiv__cCs~t|tttf�stS|��}t|t�r2||��St|t�rNtddt||��St|t�rz|��\}}tddt|||��SdSr�)r�rmr�rOr�r�r�r�r�rrr�__truediv__�s


ztimedelta.__truediv__cCs*t|t�r&|��|��}tdd|�StSr�)r�rOr�r�)r�r�r�rrr�__mod__�s
ztimedelta.__mod__cCs4t|t�r0t|��|���\}}|tdd|�fStSr�)r�rOr*r�r�)r�r�r�r�rrr�
__divmod__�s
�ztimedelta.__divmod__cCs t|t�r|�|�dkStSdSr��r�rOr	r�r�rrr�__eq__�s
ztimedelta.__eq__cCs t|t�r|�|�dkStSdSr�r�r�rrr�__le__�s
ztimedelta.__le__cCs t|t�r|�|�dkStSdSr�r�r�rrr�__lt__�s
ztimedelta.__lt__cCs t|t�r|�|�dkStSdSr�r�r�rrr�__ge__�s
ztimedelta.__ge__cCs t|t�r|�|�dkStSdSr�r�r�rrr�__gt__�s
ztimedelta.__gt__cCs t|t�st�t|��|���Sr�)r�rOrr	�	_getstater�rrrr	�sztimedelta._cmpcCs|jdkrt|���|_|jS)Nr�r��hashr�r�rrr�__hash__�s
ztimedelta.__hash__cCs|jdkp|jdkp|jdkSr�r�r�rrr�__bool__s

��ztimedelta.__bool__cCs|j|j|jfSr�r�r�rrrr�
sztimedelta._getstatecCs|j|��fSr��r�r�r�rrr�
__reduce__
sztimedelta.__reduce__N)rrrrrrr)%r�r�r��__doc__�	__slots__r�r�r�r��propertyrNr=r?r��__radd__r�r�r�r�r�r��__rmul__r�r�r�r�r�r�r�r�r�r�r	r�r�r�r�rrrrrO�sR�
e


		
		rOi6e�r�r�r�r�)rNr;r<r=r?r�c@s@eZdZdZdZdDdd�Zedd��Zedd	��Zed
d��Z	edd
��Z
edd��Zdd�Zdd�Z
dd�Zdd�Zdd�ZeZedd��Zedd��Zedd��Zd d!�Zd"d#�ZdEd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Z e Z!d6d7�Z"d8d9�Z#d:d;�Z$d<d=�Z%d>d?�Z&d@dA�Z'dBdC�Z(dS)F�datea�Concrete date type.

    Constructors:

    __new__()
    fromtimestamp()
    today()
    fromordinal()

    Operators:

    __repr__, __str__
    __eq__, __le__, __lt__, __ge__, __gt__, __hash__
    __add__, __radd__, __sub__ (add/radd only with timedelta arg)

    Methods:

    timetuple()
    toordinal()
    weekday()
    isoweekday(), isocalendar(), isoformat()
    ctime()
    strftime()

    Properties (readonly):
    year, month, day
    )�_year�_month�_dayr�NcCs�|dkr�t|ttf�r�t|�dkr�dt|dd��krBdkr�nnTt|t�r|z|�d�}Wntk
rztd��YnXt�	|�}|�
|�d	|_|St|||�\}}}t�	|�}||_
||_||_d	|_|S)
zVConstructor.

        Arguments:

        year, month, day (required, base 1)
        Nr
rrr'r�latin1znFailed to encode latin1 string when unpickling a date object. pickle.load(data, encoding='latin1') is assumed.r)r��bytesr�r\�ord�encode�UnicodeEncodeErrorrBrbr��_date__setstater�r�r�r�r�)r�rrr!r�rrrr�3s8�
���

�



zdate.__new__c	Cs(t�|�\	}}}}}}}}	}
||||�S)z;Construct a date from a POSIX timestamp (like time.time()).)r2�	localtime)r��trr4r5r6r7r8�weekday�jdayr�rrr�
fromtimestampUszdate.fromtimestampcCst��}|�|�S)z"Construct a date from time.time().�r2�timer�r�r�rrr�today[sz
date.todaycCst|�\}}}||||�S)z�Construct a date from a proleptic Gregorian ordinal.

        January 1 of year 1 is day 1.  Only the year, month and day are
        non-zero in the result.
        )r/)r�r.rr4r5rrr�fromordinalaszdate.fromordinalcCsXt|t�std��zt|�dks$t�|t|��WStk
rRtd|����YnXdS)z5Construct a date from the output of date.isoformat().�#fromisoformat: argument must be strrl�Invalid isoformat string: N)r�r�r�r\rrn�	ExceptionrB)r��date_stringrrr�
fromisoformatks
zdate.fromisoformatc	Cs�t|krtks$ntd|����d|kr8dks�nd}|dkrrt|dd�d}|dksn|dkrrt|�rrd	}|r�td
|����d|kr�dks�ntd|�d
���|dd|d}t|�}||}|t|��S)z|Construct a date from the ISO year, week number and weekday.

        This is the inverse of the date.isocalendar() functionzYear is out of range: r�5Trr1r
r'FzInvalid week: rkzInvalid weekday: z (range is [1, 7]))r�r�rBr#r�_isoweek1mondayr/)	r�r�weekr!Zout_of_rangeZ
first_weekdayZ
day_offsetZday_1Zord_dayrrr�fromisocalendarws$�zdate.fromisocalendarcCs d|jj|jj|j|j|jfS)a5Convert to formal string, for repr().

        >>> dt = datetime(2010, 1, 1)
        >>> repr(dt)
        'datetime.datetime(2010, 1, 1, 0, 0)'

        >>> dt = datetime(2010, 1, 1, tzinfo=timezone.utc)
        >>> repr(dt)
        'datetime.datetime(2010, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)'
        z%s.%s(%d, %d, %d))r�r�r�r�r�r�r�rrrr��s�z
date.__repr__cCs.|��dpd}dt|t|j|j|jfS)�Return ctime() style string.r1z%s %s %2d 00:00:00 %04d)�	toordinal�	_DAYNAMES�_MONTHNAMESr�r�r��r�r�rrr�ctime�s�z
date.ctimecCst|||���S)zFormat using strftime().)rjrc�r�rFrrrra�sz
date.strftimecCs:t|t�stdt|�j��t|�dkr2|�|�St|�S�Nzmust be str, not %sr�r�r�r�r�r�r\rarrrr�
__format__�s


zdate.__format__cCsd|j|j|jfS)z�Return the date formatted according to ISO.

        This is 'YYYY-MM-DD'.

        References:
        - http://www.w3.org/TR/NOTE-datetime
        - http://www.cl.cam.ac.uk/~mgk25/iso-time.html
        z%04d-%02d-%02d)r�r�r�r�rrr�	isoformat�s	zdate.isoformatcCs|jS)z
year (1-9999))r�r�rrrr�sz	date.yearcCs|jS)zmonth (1-12))r�r�rrrr�sz
date.monthcCs|jS)z
day (1-31))r�r�rrrr!�szdate.daycCst|j|j|jdddd�S)�9Return local time tuple compatible with time.localtime().rr)r9r�r�r�r�rrrrc�s�zdate.timetuplecCst|j|j|j�S)z�Return proleptic Gregorian ordinal for the year, month and day.

        January 1 of year 1 is day 1.  Only the year, month and day values
        contribute to the result.
        )r#r�r�r�r�rrrr�szdate.toordinalcCs:|dkr|j}|dkr|j}|dkr*|j}t|�|||�S)z;Return a new date with new values for the specified fields.N)r�r�r�r�)r�rrr!rrrr_�szdate.replacecCst|t�r|�|�dkStSr��r�r�r	r�r�rrrr��s
zdate.__eq__cCst|t�r|�|�dkStSr�rr�rrrr�s
zdate.__le__cCst|t�r|�|�dkStSr�rr�rrrr�s
zdate.__lt__cCst|t�r|�|�dkStSr�rr�rrrr�
s
zdate.__ge__cCst|t�r|�|�dkStSr�rr�rrrr�s
zdate.__gt__cCsPt|t�st�|j|j|j}}}|j|j|j}}}t|||f|||f�Sr�)r�r�rr�r�r�r	)r�r�rr4r5Zy2Zm2Zd2rrrr	sz	date._cmpcCs|jdkrt|���|_|jS)�Hash.rr�r�rrrr�s
z
date.__hash__cCsJt|t�rF|��|j}d|kr,tkr>nnt|��|�Std��tS)zAdd a date to a timedelta.r�result out of range)	r�rOrrN�_MAXORDINALr�rr�r�)r�r��orrrr�%s
zdate.__add__cCsDt|t�r|t|j�St|t�r@|��}|��}t||�StS)z.Subtract two dates, or a date and a timedelta.)r�rOrNr�rr�)r�r��days1�days2rrrr�0s

zdate.__sub__cCs|��ddS)z:Return day of the week, where Monday == 0 ... Sunday == 6.r0r1�rr�rrrr�:szdate.weekdaycCs|��dpdS)z:Return day of the week, where Monday == 1 ... Sunday == 7.r1r"r�rrr�
isoweekday@szdate.isoweekdaycCs�|j}t|�}t|j|j|j�}t||d�\}}|dkr^|d8}t|�}t||d�\}}n$|dkr�|t|d�kr�|d7}d}||d|dfS)a�Return a 3-tuple containing ISO year, week number, and weekday.

        The first ISO week of the year is the (Mon-Sun) week
        containing the year's first Thursday; everything else derives
        from that.

        The first week is 1; Monday is 1 ... Sunday is 7.

        ISO calendar algorithm taken from
        http://www.phys.uu.nl/~vgent/calendar/isocalendar.htm
        (used with permission)
        r1rr�4)r�rr#r�r�r*)r�r�week1mondayrr
r!rrr�isocalendarEs
zdate.isocalendarcCs&t|jd�\}}t|||j|jg�fS�N�)r*r�r�r�r�)r��yhi�ylorrrr�cszdate._getstatecCs"|\}}|_|_|d||_dSr')r�r�r�)r��stringr)r*rrr�
__setstategszdate.__setstatecCs|j|��fSr�r�r�rrrr�kszdate.__reduce__)NN)NNN))r�r�r�r�r�r��classmethodrrrr
rr�rrarrr�r�rrr!rcrr_r�r�r�r�r�r	r�r�r�r�r�r#r&r�r�r�rrrrr�sX
"


	

$



	
r�rr�c@s<eZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
S)r�z}Abstract base class for time zone info classes.

    Subclasses must override the name(), utcoffset() and dst() methods.
    rcCstd��dS)z%datetime -> string name of time zone.z&tzinfo subclass must override tzname()N��NotImplementedError�r��dtrrrrZ|sz
tzinfo.tznamecCstd��dS)zIdatetime -> timedelta, positive for east of UTC, negative for west of UTCz)tzinfo subclass must override utcoffset()Nr.r0rrrrX�sztzinfo.utcoffsetcCstd��dS)z�datetime -> DST offset as timedelta, positive for east of UTC.

        Return 0 if DST not in effect.  utcoffset() must include the DST
        offset.
        z#tzinfo subclass must override dst()Nr.r0rrrr��sz
tzinfo.dstcCs�t|t�std��|j|k	r$td��|��}|dkr<td��|��}|dkrTtd��||}|r�||7}|��}|dkr�td��||S)z*datetime in UTC -> datetime in local time.z&fromutc() requires a datetime argumentzdt.tzinfo is not selfNz0fromutc() requires a non-None utcoffset() resultz*fromutc() requires a non-None dst() resultz;fromutc(): dt.dst gave inconsistent results; cannot convert)r��datetimer�r�rBrXr�)r�r1ZdtoffZdtdst�deltarrr�fromutc�s"

ztzinfo.fromutccCsft|dd�}|r|�}nd}t|dd�}|r4|�}nt|dd�pBd}|dkrV|j|fS|j||fSdS)N�__getinitargs__r�__getstate__�__dict__)r]r�)r�Zgetinitargsr��getstate�staterrrr��s
ztzinfo.__reduce__N)
r�r�r�r�r�rZrXr�r4r�rrrrr�usr�c@s*eZdZdZdZdBdd�dd�Zedd	��Zed
d��Zedd
��Z	edd��Z
edd��Zedd��Zdd�Z
dd�Zdd�Zdd�Zdd�ZdCdd �Zd!d"�Zd#d$�Zd%d&�ZdDd(d)�ZeZed*d+��Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�ZdEdd�d7d8�ZdFd:d;�Z d<d=�Z!d>d?�Z"d@dA�Z#dS)Gra<Time with time zone.

    Constructors:

    __new__()

    Operators:

    __repr__, __str__
    __eq__, __le__, __lt__, __ge__, __gt__, __hash__

    Methods:

    strftime()
    isoformat()
    utcoffset()
    tzname()
    dst()

    Properties (readonly):
    hour, minute, second, microsecond, tzinfo, fold
    )�_hour�_minute�_second�_microsecond�_tzinfor��_foldrN�r�cCs�t|ttf�r�t|�dkr�t|dd��d@dkr�t|t�rhz|�d�}Wntk
rftd��YnXt�	|�}|�
||p~d�d	|_|St|||||�\}}}}}t
|�t�	|�}||_||_||_||_||_d	|_||_|S)
z�Constructor.

        Arguments:

        hour, minute (required)
        second, microsecond (default to zero)
        tzinfo (default to None)
        fold (keyword only, default to zero)
        r0rr�r(r�znFailed to encode latin1 string when unpickling a time object. pickle.load(data, encoding='latin1') is assumed.Nr)r�r�r�r\r�r�r�rBrbr��_time__setstater�r�r�r:r;r<r=r>r?)r�r�r�r�rVr�r�r�rrrr��s>
�
�

�
ztime.__new__cCs|jS�zhour (0-23)�r:r�rrrr��sz	time.hourcCs|jS�z
minute (0-59)�r;r�rrrr�sztime.minutecCs|jS�z
second (0-59)�r<r�rrrr�sztime.secondcCs|jS�zmicrosecond (0-999999)�r=r�rrrrVsztime.microsecondcCs|jS�ztimezone info object�r>r�rrrr�sztime.tzinfocCs|jSr��r?r�rrrr�sz	time.foldcCs$t|t�r|j|dd�dkStSdS)NT��allow_mixedr�r�rr	r�r�rrrr�s
ztime.__eq__cCs t|t�r|�|�dkStSdSr�rPr�rrrr�#s
ztime.__le__cCs t|t�r|�|�dkStSdSr�rPr�rrrr�)s
ztime.__lt__cCs t|t�r|�|�dkStSdSr�rPr�rrrr�/s
ztime.__ge__cCs t|t�r|�|�dkStSdSr�rPr�rrrr�5s
ztime.__gt__Fc
Cs�t|t�st�|j}|j}d}}||kr0d}n|��}|��}||k}|rvt|j|j|j|j	f|j|j|j|j	f�S|dks�|dkr�|r�dSt
d��|jd|j|tdd�}|jd|j|tdd�}	t||j|j	f|	|j|j	f�S)NTrz$cannot compare naive and aware timesr�rrL)r�rrr>rXr	r:r;r<r=r�rO)
r�r�rO�mytz�ottz�myoff�otoff�base_compareZmyhhmmZothhmmrrrr	;s4����z	time._cmpcCs�|jdkr�|jr|jdd�}n|}|��}|sBt|��d�|_n�tt|j|j	d�|tdd��\}}|tdd�r|t
d��|tdd�}d|kr�d	kr�nntt|||j|j
��|_nt|||j|j
f�|_|jS)
rrrr@�r;r<rrKrLzwhole minuter()r�r�r_rXr�r�r*rOr�r�rrr�rV)r�r��tzoffrgr4rrrr�Ws 
�z
time.__hash__cCs|��}t|�S)z=Return formatted timezone offset (+xx:xx) or an empty string.)rXrS)r�rPrrr�_tzstrnsztime._tzstrcCs�|jdkrd|j|jf}n|jdkr2d|j}nd}d|jj|jj|j|j|f}|jdk	r�|dd�dksrt�|dd�d	|jd}|j	r�|dd�dks�t�|dd�d
}|S)�%Convert to formal string, for repr().rz, %d, %dz, %drHz%s.%s(%d, %d%s)Nr�)�, tzinfo=%r�	, fold=1))
r=r<r�r�r�r:r;r>rr?�r�rQrrrr�ss$

�
z
time.__repr__r:cCs0t|j|j|j|j|�}|��}|r,||7}|S)a�Return the time formatted according to ISO.

        The full format is 'HH:MM:SS.mmmmmm+zz:zz'. By default, the fractional
        part is omitted if self.microsecond == 0.

        The optional argument timespec specifies the number of additional
        terms of the time to include. Valid options are 'auto', 'hours',
        'minutes', 'seconds', 'milliseconds' and 'microseconds'.
        )rGr:r;r<r=rX)r�rErQr�rrrr�s
�ztime.isoformatcCsHt|t�std��z|t|��WStk
rBtd|����YnXdS)z0Construct a time from the output of isoformat().rrN)r�r�r�r�rrB)r�Ztime_stringrrrr
�s
ztime.fromisoformatc	Cs(ddd|j|j|jdddf	}t|||�S)z{Format using strftime().  The date part of the timestamp passed
        to underlying strftime should not be used.
        ilrrr)r:r;r<rj)r�rFrcrrrra�s�z
time.strftimecCs:t|t�stdt|�j��t|�dkr2|�|�St|�Srrrrrrr�s


ztime.__format__cCs(|jdkrdS|j�d�}td|�|S)z^Return the timezone offset as timedelta, positive east of UTC
         (negative west of UTC).NrX�r>rXr��r�rfrrrrX�s


ztime.utcoffsetcCs&|jdkrdS|j�d�}t|�|S�aReturn the timezone name.

        Note that the name is 100% informational -- there's no requirement that
        it mean anything in particular. For example, "GMT", "UTC", "-500",
        "-5:00", "EDT", "US/Eastern", "America/New York" are all valid replies.
        N�r>rZr��r�r�rrrrZ�s

ztime.tznamecCs(|jdkrdS|j�d�}td|�|S�aqReturn 0 if DST is not in effect, or the DST offset (as timedelta
        positive eastward) if DST is in effect.

        This is purely informational; the DST offset has already been added to
        the UTC offset returned by utcoffset() if applicable, so there's no
        need to consult dst() unless you're interested in displaying the DST
        info.
        Nr��r>r�r�r_rrrr��s
	

ztime.dstTcCsl|dkr|j}|dkr|j}|dkr*|j}|dkr8|j}|dkrF|j}|dkrT|j}t|�||||||d�S)z;Return a new time with new values for the specified fields.NTr@)r�r�r�rVr�r?r�)r�r�r�r�rVr�r�rrrr_�sztime.replacer'cCspt|jd�\}}t|d�\}}|j}|jr:|dkr:|d7}t||j|j|||g�}|jdkrb|fS||jfSdS�Nr(r'�)r*r=r:r?r�r;r<r>)r��protocol�us2�us3�us1rg�	basestaterrrr��s�
ztime._getstatecCst|dk	rt|t�std��|\}|_|_}}}|dkrHd|_|d|_nd|_||_|d>|Bd>|B|_||_dS)N�bad tzinfo state argrArrfrrk)	r��
_tzinfo_classr�r;r<r?r:r=r>)r�r+r�rgrjrhrirrrr,�sztime.__setstatecCs|j|�|�fSr�r��r�rgrrr�
__reduce_ex__sztime.__reduce_ex__cCs
|�d�S�Nr�ror�rrrr�sztime.__reduce__)rrrrN)F)r:)NNNNT)r')$r�r�r�r�r�r�r�r�r�r�rVr�r�r�r�r�r�r�r	r�rXr�rr�r-r
rarrXrZr�r_r�rBror�rrrrr�sT(








		
��


rc@s�eZdZdZejejZdddd�dd�Zedd��Z	ed	d
��Z
edd��Zed
d��Zedd��Z
edd��Zedd��Zededd��Zedd��Zedfdd��Zedd��Zedgdd��Zed d!��Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zdhdd�d0d1�Zd2d3�Zdid4d5�Zd6d7�Zdjd:d;�Z d<d=�Z!d>d?�Z"ed@dA��Z#dBdC�Z$dDdE�Z%dFdG�Z&dHdI�Z'dJdK�Z(dLdM�Z)dNdO�Z*dPdQ�Z+dkdSdT�Z,dUdV�Z-e-Z.dWdX�Z/dYdZ�Z0dld\d]�Z1d^d_�Z2d`da�Z3dbdc�Z4dS)mr2z�datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]])

    The year, month and day arguments are required. tzinfo may be None, or an
    instance of a tzinfo subclass. The remaining arguments may be ints.
    Nrr@c	Cst|ttf�r�t|�dkr�dt|dd��d@kr>dkr�nnVt|t�rxzt|d�}Wntk
rvtd��YnXt�|�}
|
�	||�d	|
_
|
St|||�\}}}t|||||	�\}}}}}	t
|�t�|�}
||
_||
_||
_||
_||
_||
_||
_||
_d	|
_
|	|
_|
S)
Nrlrrr'rArr�zrFailed to encode latin1 string when unpickling a datetime object. pickle.load(data, encoding='latin1') is assumed.r)r�r�r�r\r�r�rBrbr��_datetime__setstater�r�r�r�r�r�r�r:r;r<r=r>r?)r�rrr!r�r�r�rVr�r�r�rrrr�sL��

�

�
zdatetime.__new__cCs|jSrCrDr�rrrr�Csz
datetime.hourcCs|jSrErFr�rrrr�Hszdatetime.minutecCs|jSrGrHr�rrrr�Mszdatetime.secondcCs|jSrIrJr�rrrrVRszdatetime.microsecondcCs|jSrKrLr�rrrr�Wszdatetime.tzinfocCs|jSr�rMr�rrrr�\sz
datetime.foldc	Cspt�|�\}}t|d�}|dkr4|d7}|d8}n|dkrL|d8}|d7}|rVtjntj}||�\	}}}	}
}}}
}}t|d�}||||	|
||||�}|dk�rbd}||kr�tj�	d�r�|S|||�dd	�\}}}	}
}}||||	|
||||�}||t
d|�}|jdk�rl|||t
dd��dd	�\}}}	}
}}||||	|
||||�}||k�rld|_n
|�
|�}|S)
��Construct a datetime from a POSIX timestamp (like time.time()).

        A timezone info object may be passed in as well.
        r�r�rrr�Nr��winr0)r�r�r�r2�gmtimer��min�sys�platform�
startswithrOrNr?r4)r�r�rr�ZfracrDZ	converterrr4r5r6r7r8r�r�r��result�max_fold_secondsZprobe1ZtransZprobe2rrr�_fromtimestamp`s4


 *

zdatetime._fromtimestampcCst|�|�||dk	|�S)rsN)r�r|)r�r�r�rrrr�szdatetime.fromtimestampcCs|�|dd�S)z6Construct a naive UTC datetime from a POSIX timestamp.TN)r|rrrr�utcfromtimestamp�szdatetime.utcfromtimestampcCst��}|�||�S)zBConstruct a datetime from time.time() and optional time zone info.r)r�r�r�rrr�now�szdatetime.nowcCst��}|�|�S)z*Construct a UTC datetime from time.time().)r2rr}rrrr�utcnow�szdatetime.utcnowTcCs\t|t�std��t|t�s$td��|dkr2|j}||j|j|j|j|j	|j
|j||jd�	S)z8Construct a datetime from a given date and a given time.z%date argument must be a date instancez%time argument must be a time instanceTr@)
r��_date_classr��_time_classr�rrr!r�r�r�rVr�)r�r�rr�rrr�combine�s

�zdatetime.combinecCs�t|t�std��|dd�}|dd�}zt|�}Wn"tk
rXtd|����YnX|r�zt|�}Wq�tk
r�td|����Yq�Xndddddg}|||�S)z=Construct a datetime from the output of datetime.isoformat().rrrl�Nr)r�r�r�rnrBr�)r�r	ZdstrrrZdate_componentsZtime_componentsrrrr
�s
zdatetime.fromisoformatcCsD|��}|dkrd}n|r d}nd}t|j|j|j|j|j|j|�S)rNrrr)r�r9rrr!r�r�r�)r�r�rrrrc�s�zdatetime.timetuplec
s�tddd��d}|�tdd�}�fdd�}||�|}||}||�}||kr�|||f|j}||�|}||kr�|Sn||}||ks�t�||}||�}	|	|kr�|S||kr�|Sttf|j||�S)zReturn integer POSIX timestamp.�rr�rcs>t�|�dd�\}}}}}}t||||||��tdd�S)Nr0rr)r2r�r2rO)rirr4r5r6r7r8�Zepochrr�local�szdatetime._mktime.<locals>.local)r2rOr�r�maxrv)
r�r{r�r�r�Zu1�t1Zu2r��t2rr�r�_mktime�s*zdatetime._mktimecCs0|jdkr |��}||jdS|t��SdS)zReturn POSIX timestamp as floatNr�)r>r�rV�_EPOCHr�r]rrr�	timestamp�s
zdatetime.timestampcCsT|��}|r||8}|j|j|j}}}|j|j|j}}}t||||||d�S)z4Return UTC time tuple compatible with time.gmtime().r)rXrrr!r�r�r�r9)r�rfrr4r5r6r7r8rrr�utctimetupleszdatetime.utctimetuplecCst|j|j|j�S)zReturn the date part.)r�r�r�r�r�rrrr�sz
datetime.datecCst|j|j|j|j|jd�S)z'Return the time part, with tzinfo None.r@)rr�r�r�rVr�r�rrrrsz
datetime.timecCs t|j|j|j|j|j|jd�S)z'Return the time part, with same tzinfo.r@)rr�r�r�rVr>r�r�rrr�timetzs�zdatetime.timetzc	
Cs�|dkr|j}|dkr|j}|dkr*|j}|dkr8|j}|dkrF|j}|dkrT|j}|dkrb|j}|dkrp|j}|	dkr~|j}	t	|�|||||||||	d�	S)z?Return a new datetime with new values for the specified fields.NTr@)
rrr!r�r�r�rVr�r�r�)
r�rrr!r�r�r�rVr�r�rrrr_s.�zdatetime.replacecCs\|jdkr|��}n|ttdd�}t�|�}t|dd��}|j}|j}t	t|d�|�S)Nrr�r0)
r�r�r�rOr2r�r2�	tm_gmtoff�tm_zoner~)r�ZtsZlocaltmr�ZgmtoffZzonerrr�_local_timezone4s


zdatetime._local_timezonecCs�|dkr|��}nt|t�s$td��|j}|dkrF|��}|�|�}n,|�|�}|dkrr|jdd���}|�|�}||kr~|S||j|d�}|�|�S)Nz)tz argument must be an instance of tzinfo�r�)r�r�r�r�rXr_r4)r�r�rQZmyoffsetrrrr�
astimezone@s 



zdatetime.astimezonecCs:|��dpd}dt|t|j|j|j|j|j|jfS)rr1z%s %s %2d %02d:%02d:%02d %04d)	rrrr�r�r:r;r<r�rrrrr[s�zdatetime.ctime�Tr:cCsNd|j|j|j|ft|j|j|j|j|�}|��}t	|�}|rJ||7}|S)a�Return the time formatted according to ISO.

        The full format looks like 'YYYY-MM-DD HH:MM:SS.mmmmmm'.
        By default, the fractional part is omitted if self.microsecond == 0.

        If self.tzinfo is not None, the UTC offset is also attached, giving
        giving a full format of 'YYYY-MM-DD HH:MM:SS.mmmmmm+HH:MM'.

        Optional argument sep specifies the separator between date and
        time, default 'T'.

        The optional argument timespec specifies the number of additional
        terms of the time to include. Valid options are 'auto', 'hours',
        'minutes', 'seconds', 'milliseconds' and 'microseconds'.
        z%04d-%02d-%02d%c)
r�r�r�rGr:r;r<r=rXrS)r��seprErQrPr�rrrres��zdatetime.isoformatcCs�|j|j|j|j|j|j|jg}|ddkr2|d=|ddkrD|d=d|jj|jj	d�
tt|��f}|j
dk	r�|dd�dks�t�|dd�d|j
d}|jr�|dd�dks�t�|dd�d}|S)	rYrrr�r�NrZr[r\)r�r�r�r:r;r<r=r�r�r�r`�mapr�r>rr?)r��LrQrrrr��s*��
zdatetime.__repr__cCs|jdd�S)zConvert to string, for str().� )r�)rr�rrrr��szdatetime.__str__cCsddl}|�|||�S)zKstring, format -> new datetime parsed from a string (like time.strptime()).rN)�	_strptimeZ_strptime_datetime)r�r	rCr�rrr�strptime�szdatetime.strptimecCs(|jdkrdS|j�|�}td|�|S)z\Return the timezone offset as timedelta positive east of UTC (negative west of
        UTC).NrXr^r_rrrrX�s


zdatetime.utcoffsetcCs&|jdkrdS|j�|�}t|�|Sr`rarbrrrrZ�s

zdatetime.tznamecCs(|jdkrdS|j�|�}td|�|Srcrdr_rrrr��s
	

zdatetime.dstcCs2t|t�r|j|dd�dkSt|t�s*tSdSdS)NTrNrF)r�r2r	r�r�r�rrrr��s


zdatetime.__eq__cCs4t|t�r|�|�dkSt|t�s&tSt||�dSr��r�r2r	r�r�r�r�rrrr��s


zdatetime.__le__cCs4t|t�r|�|�dkSt|t�s&tSt||�dSr�r�r�rrrr��s


zdatetime.__lt__cCs4t|t�r|�|�dkSt|t�s&tSt||�dSr�r�r�rrrr��s


zdatetime.__ge__cCs4t|t�r|�|�dkSt|t�s&tSt||�dSr�r�r�rrrr��s


zdatetime.__gt__Fc		Cst|t�st�|j}|j}d}}||kr0d}nT|��}|��}|r|||j|jd���kr`dS||j|jd���kr|dS||k}|r�t|j|j	|j
|j|j|j
|jf|j|j	|j
|j|j|j
|jf�S|dks�|dkr�|r�dStd��||}|jdk�rdS|�rd�pdS)NTr@rz(cannot compare naive and aware datetimesrrr)r�r2rr>rXr_r�r	r�r�r�r:r;r<r=r�rN)	r�r�rOrQrRrSrTrUZdiffrrrr	�sH���z
datetime._cmpc
Cs�t|t�stSt|��|j|j|j|jd�}||7}t|j	d�\}}t|d�\}}d|j
krhtkr�nn*t|��
t�|j
�t||||j|jd��Std��dS)zAdd a datetime and a timedelta.r{r�r�rr�rN)r�rOr�rr:r;r<r=r*r=rNrr�r�r�rrr?r>r�)r�r�r3r�Zremr�r�rrrr�s&
���zdatetime.__add__c	Cs�t|t�s"t|t�r||StS|��}|��}|j|jd|jd}|j|jd|jd}t|||||j|j�}|j	|j	kr�|S|�
�}|�
�}||kr�|S|dks�|dkr�td��|||S)z6Subtract two datetimes, or a datetime and a timedelta.r�r�Nz(cannot mix naive and timezone-aware time)r�r2rOr�rr<r;r:r=r>rXr�)	r�r�r r!Zsecs1Zsecs2�baserSrTrrrr�&s*



�zdatetime.__sub__cCs�|jdkr�|jr|jdd�}n|}|��}|dkrFt|��d�|_nDt|j|j|j	�}|j
d|jd|j}tt
|||j�|�|_|jS)Nrrr@r�r�)r�r�r_rXr�r�r#rrr!r�r�r�rOrV)r�r�rWrNr=rrrr�>s
zdatetime.__hash__r'c	Cs�t|jd�\}}t|jd�\}}t|d�\}}|j}|jrJ|dkrJ|d7}t||||j|j|j|j	|||g
�}|j
dkr~|fS||j
fSdSre)r*r�r=r�r?r�r�r:r;r<r>)	r�rgr)r*rhrirjr4rkrrrr�Os"�
zdatetime._getstatec	
Cs�|dk	rt|t�std��|\
}}}|_|_|_|_}}}|dkrTd|_|d|_nd|_||_|d||_	|d>|Bd>|B|_
||_dS)NrlrArrfrr(rk)r�rmr�r�r:r;r<r?r�r�r=r>)	r�r+r�r)r*r4rjrhrirrrr,^s"�zdatetime.__setstatecCs|j|�|�fSr�r�rnrrrromszdatetime.__reduce_ex__cCs
|�d�Srprqr�rrrr�pszdatetime.__reduce__)NNrrrrN)N)N)T)NNNNNNNT)N)r�r:)F)r')5r�r�r�r�r�r�rr�r�r�r�r�rVr�r�r-r|rr}r~rr�r
rcr�r�r�r�r_r�r�rrr�r�r�rXrZr�r�r�r�r�r�r	r�r�r�r�r�rrror�rrrrr2s���$






+	



#	��



	

%
r2cCs8d}t|dd�}|dd}||}||kr4|d7}|S)Nr'rr0r1)r#)rZTHURSDAYZfirstdayZfirstweekdayr%rrrrysrc@s�eZdZdZe�Zefdd�Zeddd��Zdd�Z	d	d
�Z
dd�Zd
d�Zdd�Z
dd�Zdd�Zdd�Zdd�Zeddd�ZeZedd��ZdS)r~)�_offset�_namecCslt|t�std��||jkr,|s&|jSd}nt|t�s>td��|j|krV|jks`ntd��|�	||�S)Nzoffset must be a timedeltazname must be a stringzYoffset must be a timedelta strictly between -timedelta(hours=24) and timedelta(hours=24).)
r�rOr��_Omittedrr��
_minoffset�
_maxoffsetrB�_create)r�rfr�rrrr��s


ztimezone.__new__NcCst�|�}||_||_|Sr�)r�r�r�r�)r�rfr�r�rrrr��s
ztimezone._createcCs|jdkr|jfS|j|jfS)zpickle supportN)r�r�r�rrrr5�s
ztimezone.__getinitargs__cCst|t�r|j|jkStSr�)r�r~r�r�r�rrrr��s
ztimezone.__eq__cCs
t|j�Sr�)r�r�r�rrrr��sztimezone.__hash__cCsL||jkrdS|jdkr0d|jj|jj|jfSd|jj|jj|j|jfS)aConvert to formal string, for repr().

        >>> tz = timezone.utc
        >>> repr(tz)
        'datetime.timezone.utc'
        >>> tz = timezone(timedelta(hours=-5), 'EST')
        >>> repr(tz)
        "datetime.timezone(datetime.timedelta(-1, 68400), 'EST')"
        zdatetime.timezone.utcNz	%s.%s(%r)z
%s.%s(%r, %r))rr�r�r�r�r�r�rrrr��s


��ztimezone.__repr__cCs
|�d�Sr�)rZr�rrrr��sztimezone.__str__cCs$t|t�s|dkr|jStd��dS)Nz8utcoffset() argument must be a datetime instance or None)r�r2r�r�r0rrrrX�sztimezone.utcoffsetcCs:t|t�s|dkr.|jdkr(|�|j�S|jStd��dS)Nz5tzname() argument must be a datetime instance or None)r�r2r��_name_from_offsetr�r�r0rrrrZ�s

ztimezone.tznamecCs"t|t�s|dkrdStd��dS)Nz2dst() argument must be a datetime instance or None)r�r2r�r0rrrr��sztimezone.dstcCs2t|t�r&|j|k	rtd��||jStd��dS)Nzfromutc: dt.tzinfo is not selfz6fromutc() argument must be a datetime instance or None)r�r2r�rBr�r�r0rrrr4�s



ztimezone.fromutcr(r)r;r?c
Cs�|sdS|td�kr d}|}nd}t|tdd��\}}t|tdd��\}}|j}|j}|r�d|�|d�d	|d�d	|d�d
|d��	S|r�d|�|d�d	|d�d	|d��Sd|�|d�d	|d��S)NZUTCrrIrJrrKrLZ02drorpZ06d)rOr*r=r?)r3rRr;rhr<r=r?rrrr��s( ztimezone._name_from_offset)N)r�r�r�r�rbr�r�r-r�r5r�r�r�r�rXrZr�r4rOr�r��staticmethodr�rrrrr~�s$	r~rVr�r�)�*)r�)r:);r�rr2Zmathr�rwr	r�r�rrrZdbmr"r[rrrrr#r+r,r-rr/rrr9rGrSrjrnrwr�r�r�r�r�r�r�r�r�rOrvr�Z
resolutionr�r�r�rmr�r2rr~r�rr�Z	_datetime�ImportErrorrrrr�<module>s�

	?�
@') 
=

�[DXatG
__pycache__/asynchat.cpython-38.opt-2.pyc000064400000012546151153537570014202 0ustar00U

e5d@,�@s@ddlZddlmZGdd�dej�ZGdd�d�Zdd�ZdS)	�N)�dequec@s�eZdZdZdZdZdZd'dd�Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�ZdS)(�
async_chatirzlatin-1NcCs(d|_g|_t�|_tj�|||�dS�N�)�ac_in_buffer�incomingr�
producer_fifo�asyncore�
dispatcher�__init__)�selfZsock�map�r� /usr/lib64/python3.8/asynchat.pyrCszasync_chat.__init__cCstd��dS�Nzmust be implemented in subclass��NotImplementedError�r�datarrr�collect_incoming_dataQsz async_chat.collect_incoming_datacCs|j�|�dS�N)r�appendrrrr�_collect_incoming_dataTsz!async_chat._collect_incoming_datacCsd�|j�}|jdd�=|Sr)�joinr)r�drrr�	_get_dataWszasync_chat._get_datacCstd��dSrr�rrrr�found_terminator\szasync_chat.found_terminatorcCsBt|t�r|jrt||j�}nt|t�r8|dkr8td��||_dS)Nrz-the number of received bytes must be positive)�
isinstance�str�use_encoding�bytes�encoding�int�
ValueError�
terminator)rZtermrrr�set_terminator_s
zasync_chat.set_terminatorcCs|jSr)r%rrrr�get_terminatorjszasync_chat.get_terminatorc
Cs�z|�|j�}WnDtk
r&YdStk
rT}z|��WY�dSd}~XYnXt|t�rr|jrrtt|j	�}|j
||_
|j
�r�t|j
�}|��}|s�|�
|j
�d|_
q~t|t��r|}||kr�|�
|j
�d|_
|j||_n2|�
|j
d|��|j
|d�|_
d|_|��q~t|�}|j
�|�}|dk�rv|dk�rX|�
|j
d|��|j
||d�|_
|��q~t|j
|�}|�r�||k�r�|�
|j
d|��|j
|d�|_
�q�q~|�
|j
�d|_
q~dS)Nrr���)Zrecv�ac_in_buffer_size�BlockingIOError�OSError�handle_errorrrr r!r"r�lenr'rr#r%r�find�find_prefix_at_end)rrZwhyZlbr%�nZterminator_len�indexrrr�handle_readrsR

	



zasync_chat.handle_readcCs|��dSr)�
initiate_sendrrrr�handle_write�szasync_chat.handle_writecCs|��dSr)�closerrrr�handle_close�szasync_chat.handle_closecCsxt|tttf�stdt|���|j}t|�|kr`tdt|�|�D]}|j	�
||||��q@n|j	�
|�|��dS)Nz#data argument must be byte-ish (%r)r)rr!�	bytearray�
memoryview�	TypeError�type�ac_out_buffer_sizer-�rangerrr3)rrZsabs�irrr�push�s�zasync_chat.pushcCs|j�|�|��dSr)rrr3)rZproducerrrr�push_with_producer�szasync_chat.push_with_producercCsdS�N�rrrrr�readable�szasync_chat.readablecCs|jp|jSr)r�	connectedrrrr�writable�szasync_chat.writablecCs|j�d�dSr)rrrrrr�close_when_done�szasync_chat.close_when_donecCs|j�r|j�r|jd}|s:|jd=|dkr:|��dS|j}z|d|�}Wn:tk
r�|��}|rz|j�|�n|jd=YqYnXt|t�r�|j	r�t
||j�}z|�|�}Wnt
k
r�|��YdSX|�r|t|�ks�|t|�k�r
||d�|jd<n|jd=dSdS)Nr)rrCr6r;r9�more�
appendleftrrr r!r"�sendr+r,r-)r�firstZobsrZnum_sentrrrr3�s8

zasync_chat.initiate_sendcCs d|_|jdd�=|j��dSr)rrr�clearrrrr�discard_buffersszasync_chat.discard_buffers)NN)�__name__�
__module__�__qualname__r)r;r r"rrrrrr&r'r2r4r6r>r?rBrDrEr3rKrrrrr4s*
H(rc@seZdZddd�Zdd�ZdS)�simple_producer�cCs||_||_dSr)r�buffer_size)rrrQrrrrszsimple_producer.__init__cCsJt|j�|jkr6|jd|j�}|j|jd�|_|S|j}d|_|SdSr)r-rrQ)r�resultrrrrFszsimple_producer.moreN)rP)rLrMrNrrFrrrrrOs
rOcCs0t|�d}|r,|�|d|��s,|d8}q|Sr@)r-�endswith)ZhaystackZneedle�lrrrr//s
r/)r	�collectionsrr
rrOr/rrrr�<module>0s
\ __pycache__/posixpath.cpython-38.opt-1.pyc000064400000024276151153537570014411 0ustar00U

e5d=�&@s^dZdZdZdZdZdZdZdZdZddl	Z	ddl
Z
ddlZddlZdd	lTd
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/g&Z
d0d1�Zd2d
�Zd3d�Zd4d�Zd5d�Zd6d�Zejje_d7d
�Zd8d�Zd9d�Zd:d�Zd;d�Zd<d�Zd=d�Zdadad>d�Zd?d�Zd@d �Z dAd,�Z!dBdC�Z"e
j#dDkZ$dGdEd.�Z%dFd/�Z&dS)Ha�Common operations on Posix pathnames.

Instead of importing this module directly, import os and refer to
this module as os.path.  The "os.path" name is an alias for this
module on Posix systems; on other systems (e.g. Windows),
os.path provides the same operations in a manner specific to that
platform, and is an alias to another module (e.g. ntpath).

Some of this can actually be useful on non-Posix systems too, e.g.
for manipulation of the pathname component of URLs.
�.�..�/�:z
/bin:/usr/binNz	/dev/null�)�*�normcase�isabs�join�
splitdrive�split�splitext�basename�dirname�commonprefix�getsize�getmtime�getatime�getctime�islink�exists�lexists�isdir�isfile�ismount�
expanduser�
expandvars�normpath�abspath�samefile�sameopenfile�samestat�curdir�pardir�sep�pathsep�defpath�altsep�extsep�devnull�realpath�supports_unicode_filenames�relpath�
commonpathcCst|t�rdSdSdS)N�/r)�
isinstance�bytes��path�r2�!/usr/lib64/python3.8/posixpath.py�_get_sep)s
r4cCs
t�|�S)z6Normalize case of pathname.  Has no effect under Posix��os�fspath)�sr2r2r3r4scCst�|�}t|�}|�|�S)zTest whether a path is absolute)r6r7r4�
startswith)r8r#r2r2r3r<s
c
Gs�t�|�}t|�}|}z^|s,|dd�|ttj|�D]8}|�|�rL|}q8|rZ|�|�rd||7}q8|||7}q8Wn.tttfk
r�t	j
d|f|���YnX|S)z�Join two or more pathname components, inserting '/' as needed.
    If any component is an absolute path, all previous path components
    will be discarded.  An empty last part will result in a path that
    ends with a separator.Nrr	)r6r7r4�mapr9�endswith�	TypeError�AttributeError�BytesWarning�genericpath�_check_arg_types)�a�pr#r1�br2r2r3r	Gs 


cCs`t�|�}t|�}|�|�d}|d|�||d�}}|rX||t|�krX|�|�}||fS)z�Split a pathname.  Returns tuple "(head, tail)" where "tail" is
    everything after the final slash.  Either part may be empty.�N�r6r7r4�rfind�len�rstrip)rBr#�i�head�tailr2r2r3rds

cCs6t�|�}t|t�rd}d}nd}d}t�||d|�S)Nr-�.rr)r6r7r.r/r?�	_splitext)rBr#r'r2r2r3rus

cCst�|�}|dd�|fS)zJSplit a pathname into drive and path. On Posix, drive is always
    empty.Nrr5)rBr2r2r3r
�s
cCs,t�|�}t|�}|�|�d}||d�S)z)Returns the final component of a pathnamerDN)r6r7r4rF)rBr#rIr2r2r3r
�s
cCsNt�|�}t|�}|�|�d}|d|�}|rJ||t|�krJ|�|�}|S)z-Returns the directory component of a pathnamerDNrE)rBr#rIrJr2r2r3r�s

c
Cs8zt�|�}Wntttfk
r*YdSXt�|j�S)z&Test whether a path is a symbolic linkF)r6�lstat�OSError�
ValueErrorr=�stat�S_ISLNK�st_mode)r1�str2r2r3r�s
c	Cs.zt�|�Wnttfk
r(YdSXdS)zCTest whether a path exists.  Returns True for broken symbolic linksFT)r6rNrOrPr0r2r2r3r�s
c	Cs�zt�|�}Wnttfk
r(YdSXt�|j�r:dSt|t�rPt	|d�}n
t	|d�}t
|�}zt�|�}Wnttfk
r�YdSX|j}|j}||kr�dS|j}|j}||kr�dSdS)z$Test whether a path is a mount pointF�..rT)
r6rNrOrPrQrRrSr.r/r	r)�st_dev�st_ino)r1�s1�parent�s2�dev1�dev2�ino1�ino2r2r2r3r�s.

c	Cs<t�|�}t|t�rd}nd}|�|�s,|St|�}|�|d�}|dkrPt|�}|dkr�dtjkr�ddl	}z|�
t���j}Wq�t
k
r�|YSXn
tjd}nVddl	}|d|�}t|t�r�t|d�}z|�|�}Wnt
k
r�|YSX|j}t|t��rt�|�}d}nd	}|�|�}|||d��p:|S)
zOExpand ~ and ~user constructions.  If user or $HOME is unknown,
    do nothing.�~�~rDr�HOMEN�ASCIIr-r)r6r7r.r/r9r4�findrG�environ�pwd�getpwuid�getuid�pw_dir�KeyError�str�getpwnam�fsencoderH)	r1�tilder#rIre�userhome�name�pwent�rootr2r2r3r�sB








cCsZt�|�}t|t�rVd|kr |Sts:ddl}|�d|j�atj}d}d}t	tdd�}n:d|krb|St
s|ddl}|�d	|j�a
t
j}d
}d}tj}d}|||�}|s��qV|�d�\}}|�
d�}	|	�|�r�|	�|�r�|	dd
�}	z.|dk�rt�tjt�|	��}
n||	}
Wntk
�r&|}Yq�X||d�}|d|�|
}t|�}||7}q�|S)zZExpand shell variables of form $var and ${var}.  Unknown variables
    are left unchanged.�$rNs\$(\w+|\{[^}]*\})�{�}�environb�$z\$(\w+|\{[^}]*\})�{�}rD���)r6r7r.r/�	_varprogb�re�compilerb�search�getattr�_varprogrd�span�groupr9r;rl�fsdecoderirG)r1r{r}�start�endrdrI�m�jro�valuerKr2r2r3rsN






c	Cs�t�|�}t|t�r&d}d}d}d}nd}d}d}d}||krB|S|�|�}|rp|�|d	�rp|�|d
�spd	}|�|�}g}|D]J}|||fkr�q�||ks�|s�|r�|r�|d|kr�|�|�q�|r�|��q�|}|�|�}|r�|||}|p�|S)z0Normalize path, eliminating double slashes, etc.r-�rLrUr�rr��ry)	r6r7r.r/r9r�append�popr	)	r1r#�empty�dot�dotdot�initial_slashes�comps�	new_comps�compr2r2r3rNsJ


��
�
�

cCs@t�|�}t|�s8t|t�r&t��}nt��}t||�}t|�S)zReturn an absolute path.)	r6r7rr.r/�getcwdb�getcwdr	r)r1�cwdr2r2r3rts



cCs*t�|�}t|dd�|i�\}}t|�S)zlReturn the canonical path of the specified filename, eliminating any
symbolic links encountered in the path.Nr)r6r7�
_joinrealpathr)�filenamer1�okr2r2r3r)�s
c
Cst|t�rd}d}d}nd}d}d}t|�r<|dd�}|}|�r|�|�\}}}|r<||kr`q<||kr�|r�t|�\}}||kr�t|||�}q<|}q<t||�}t|�s�|}q<||kr�||}|dk	r�q<t||�dfSd||<t|t�	|�|�\}}	|	�st||�dfS|||<q<|d	fS)
Nr-rLrUrrrrDFT)
r.r/r�	partitionrr	rr�r6�readlink)
r1�rest�seenr#r!r"ro�_�newpathr�r2r2r3r��sH


r��darwinc	Cs�|std��t�|�}t|t�r.d}d}d}nd}d}d}|dkrH|}n
t�|�}zrd	d
�t|��|�D�}dd
�t|��|�D�}tt||g��}|gt|�|||d�}|s�|WSt	|�WSt
ttt
fk
r�t�d||��YnXdS)
z#Return a relative version of a pathzno path specifiedrLr-rUrrrNcSsg|]}|r|�qSr2r2��.0�xr2r2r3�
<listcomp>�szrelpath.<locals>.<listcomp>cSsg|]}|r|�qSr2r2r�r2r2r3r��sr+)rPr6r7r.r/rrrGrr	r<r=r>�DeprecationWarningr?r@)	r1r�r!r#r"�
start_list�	path_listrI�rel_listr2r2r3r+�s0



c		s2|std��tttj|��}t|dt�r4d�d�nd�d�zƇfdd�|D�}zt�fd	d
�|D��\}Wntk
r�td�d�YnX�fd
d�|D�}t|�}t	|�}|}t
|�D]$\}}|||kr�|d|�}q�q�|r�n
�dd�}|��|�WStt
fk
�r,tjd|���YnXdS)zDGiven a sequence of path names, returns the longest common sub-path.z%commonpath() arg is an empty sequencerr-rLrrcsg|]}|����qSr2)r)r�r1�r#r2r3r��szcommonpath.<locals>.<listcomp>c3s|]}|dd��kVqdS)NrDr2)r�rBr�r2r3�	<genexpr>�szcommonpath.<locals>.<genexpr>z%Can't mix absolute and relative pathsNcsg|]}�fdd�|D��qS)csg|]}|r|�kr|�qSr2r2)r��c�r!r2r3r�sz)commonpath.<locals>.<listcomp>.<listcomp>r2)r�r8r�r2r3r�sr,)r,)rP�tupler:r6r7r.r/�set�min�max�	enumerater	r<r=r?r@)	�paths�split_pathsrrXrZ�commonrIr��prefixr2)r!r#r3r,�s6)N)'�__doc__r!r"r'r#r$r%r&r(r6�sysrQr?�__all__r4rrr	rrrMr
r
rrrrrrrzrrrr)r��platformr*r+r,r2r2r2r3�<module>s��
	
	

*25&	3

)__pycache__/tracemalloc.cpython-38.opt-2.pyc000064400000037120151153537570014651 0ustar00U

e5d�B�@sddlmZmZddlmZddlZddlZddlZddl	Z	ddl
Tddl
mZmZdd�Z
Gdd	�d	�ZGd
d�d�Zdd
�ZeGdd�d��ZeGdd�de��Zdd�ZGdd�d�ZGdd�de�Zdd�ZGdd�d�ZGdd�de�ZGdd�de�ZGd d!�d!�Zd"d#�ZdS)$�)�Sequence�Iterable)�total_orderingN)�*)�_get_object_traceback�_get_tracescCs�dD]|}t|�dkr@|dkr@|r0d||fSd||fSt|�dksT|dkrx|rhd||fSd	||fS|d
}qdS)N)�BZKiBZMiBZGiB�TiB�drz%+.1f %sz%.1f %si(r	z%+.0f %sz%.0f %si)�abs)�sizeZsignZunit�r
�#/usr/lib64/python3.8/tracemalloc.py�_format_size
src@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�	Statistic��	tracebackr�countcCs||_||_||_dS�Nr)�selfrrrr
r
r�__init__%szStatistic.__init__cCst|j|j|jf�Sr)�hashrrr�rr
r
r�__hash__*szStatistic.__hash__cCs$|j|jko"|j|jko"|j|jkSrr�r�otherr
r
r�__eq__-s

�
�zStatistic.__eq__cCsBd|jt|jd�|jf}|jr>|j|j}|dt|d�7}|S)Nz%s: size=%s, count=%iF�, average=%s)rrrr�r�textZaverager
r
r�__str__2s
��zStatistic.__str__cCsd|j|j|jfS)Nz)<Statistic traceback=%r size=%i count=%i>rrr
r
r�__repr__<s�zStatistic.__repr__cCs|j|j|jfSr)rrrrr
r
r�	_sort_key@szStatistic._sort_keyN�
�__name__�
__module__�__qualname__�	__slots__rrrr r!r"r
r
r
rrs
rc@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�
StatisticDiff�rr�	size_diffr�
count_diffcCs"||_||_||_||_||_dSrr))rrrr*rr+r
r
rrKs
zStatisticDiff.__init__cCst|j|j|j|j|jf�Sr)rrrr*rr+rr
r
rrRs�zStatisticDiff.__hash__cCs<|j|jko:|j|jko:|j|jko:|j|jko:|j|jkSrr)rr
r
rrVs
�
�
�
�zStatisticDiff.__eq__cCsPd|jt|jd�t|jd�|j|jf}|jrL|j|j}|dt|d�7}|S)Nz %s: size=%s (%s), count=%i (%+i)FTr)rrrr*rr+rr
r
rr ]s

��zStatisticDiff.__str__cCsd|j|j|j|j|jfS)Nz9<StatisticDiff traceback=%r size=%i (%+i) count=%i (%+i)>r)rr
r
rr!is��zStatisticDiff.__repr__cCs t|j�|jt|j�|j|jfSr)rr*rr+rrrr
r
rr"ns
�zStatisticDiff._sort_keyNr#r
r
r
rr(Dsr(cCs�g}|��D]d\}}|�|d�}|dk	rNt||j|j|j|j|j|j�}nt||j|j|j|j�}|�|�q|��D]*\}}t|d|jd|j�}|�|�qz|S�Nr)�items�popr(rr�append)�	old_group�	new_group�
statisticsr�statZpreviousr
r
r�_compare_grouped_statsts*

��r4c@sXeZdZdZdd�Zedd��Zedd��Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�ZdS)�Frame��_framecCs
||_dSrr6�r�framer
r
rr�szFrame.__init__cCs
|jdSr,r6rr
r
r�filename�szFrame.filenamecCs
|jdS�N�r6rr
r
r�lineno�szFrame.linenocCs|j|jkSrr6rr
r
rr�szFrame.__eq__cCs|j|jkSrr6rr
r
r�__lt__�szFrame.__lt__cCs
t|j�Sr)rr7rr
r
rr�szFrame.__hash__cCsd|j|jfS)Nz%s:%s�r:r=rr
r
rr �sz
Frame.__str__cCsd|j|jfS)Nz<Frame filename=%r lineno=%r>r?rr
r
rr!�szFrame.__repr__N)
r$r%r&r'r�propertyr:r=rr>rr r!r
r
r
rr5�s

r5c@sbeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zddd�Z
dS)�	Traceback��_framescCst�|�tt|��|_dSr)rr�tuple�reversedrC)r�framesr
r
rr�s
zTraceback.__init__cCs
t|j�Sr)�lenrCrr
r
r�__len__�szTraceback.__len__cCs4t|t�r"tdd�|j|D��St|j|�SdS)Ncss|]}t|�VqdSr)r5��.0�tracer
r
r�	<genexpr>�sz(Traceback.__getitem__.<locals>.<genexpr>)�
isinstance�slicerDrCr5�r�indexr
r
r�__getitem__�s
zTraceback.__getitem__cCs|j|jkSr)r7rCr8r
r
r�__contains__�szTraceback.__contains__cCs
t|j�Sr)rrCrr
r
rr�szTraceback.__hash__cCs|j|jkSrrBrr
r
rr�szTraceback.__eq__cCs|j|jkSrrBrr
r
rr>�szTraceback.__lt__cCst|d�Sr,)�strrr
r
rr �szTraceback.__str__cCsdt|�fS)Nz<Traceback %r>)rDrr
r
rr!�szTraceback.__repr__NFcCs�g}|dk	r2|dkr$||d�}q6|d|�}n|}|rBt|�}|D]@}|�d|j|jf�t�|j|j���}|rF|�d|�qF|S)Nrz  File "%s", line %sz    %s)rEr/r:r=�	linecache�getline�strip)r�limitZmost_recent_first�linesZframe_slicer9�liner
r
r�format�s 
�zTraceback.format)NF)r$r%r&r'rrHrQrRrrr>r r!rZr
r
r
rrA�srAcCs t|�}|dk	rt|�SdSdSr)rrA)�objrFr
r
r�get_object_traceback�sr\c@s\eZdZdZdd�Zedd��Zedd��Zedd	��Zd
d�Z	dd
�Z
dd�Zdd�ZdS)�Trace��_tracecCs
||_dSrr^�rrKr
r
rrszTrace.__init__cCs
|jdSr,r^rr
r
r�domainszTrace.domaincCs
|jdSr;r^rr
r
rr	sz
Trace.sizecCst|jd�S)N�)rAr_rr
r
rr
szTrace.tracebackcCs|j|jkSrr^rr
r
rrszTrace.__eq__cCs
t|j�Sr)rr_rr
r
rrszTrace.__hash__cCsd|jt|jd�fS)Nz%s: %sF)rrrrr
r
rr sz
Trace.__str__cCsd|jt|jd�|jfS)Nz'<Trace domain=%s size=%s, traceback=%r>F)rarrrrr
r
rr!s�zTrace.__repr__N)
r$r%r&r'rr@rarrrrr r!r
r
r
rr]�s


r]c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�_TracescCst�|�||_dSr)rr�_traces)r�tracesr
r
rr s
z_Traces.__init__cCs
t|j�Sr)rGrdrr
r
rrH%sz_Traces.__len__cCs4t|t�r"tdd�|j|D��St|j|�SdS)Ncss|]}t|�VqdSr)r]rIr
r
rrL*sz&_Traces.__getitem__.<locals>.<genexpr>)rMrNrDrdr]rOr
r
rrQ(s
z_Traces.__getitem__cCs|j|jkSr)r_rdr`r
r
rrR.sz_Traces.__contains__cCs|j|jkSr)rdrr
r
rr1sz_Traces.__eq__cCsdt|�S)Nz<Traces len=%s>)rGrr
r
rr!4sz_Traces.__repr__N)	r$r%r&rrHrQrRrr!r
r
r
rrcsrccCs&tj�|�}|�d�r"|dd�}|S)Nz.pyc���)�os�path�normcase�endswith)r:r
r
r�_normalize_filename8s
rkc@seZdZdd�Zdd�ZdS)�
BaseFiltercCs
||_dSr)�	inclusive)rrmr
r
rr@szBaseFilter.__init__cCst�dSr)�NotImplementedErrorr`r
r
r�_matchCszBaseFilter._matchN)r$r%r&rror
r
r
rrl?srlcsJeZdZd�fdd�	Zedd��Zdd�Zd	d
�Zdd�Zd
d�Z	�Z
S)�FilterNFcs2t��|�||_t|�|_||_||_||_dSr)�superrrmrk�_filename_patternr=�
all_framesra)rrm�filename_patternr=rsra��	__class__r
rrHs
zFilter.__init__cCs|jSr)rrrr
r
rrtQszFilter.filename_patterncCs6t|�}t�||j�sdS|jdkr(dS||jkSdS)NFT)rk�fnmatchrrr=�rr:r=r
r
r�_match_frame_implUs
zFilter._match_frame_implcCs|�||�|jASr)ryrmrxr
r
r�_match_frame^szFilter._match_framecsH�jr,t�fdd�|D��r"�jS�jSn|d\}}��||�SdS)Nc3s|]\}}��||�VqdSr)ry)rJr:r=rr
rrLcs�z*Filter._match_traceback.<locals>.<genexpr>r)rs�anyrmrz)rrr:r=r
rr�_match_tracebackas�
zFilter._match_tracebackcCsD|\}}}|�|�}|jdk	r@|jr2|o0||jkS|p>||jkS|Sr)r|rarm)rrKrarr�resr
r
rrols


z
Filter._match)NFN)r$r%r&rr@rtryrzr|ro�
__classcell__r
r
rurrpGs�	
	rpcs0eZdZ�fdd�Zedd��Zdd�Z�ZS)�DomainFiltercst��|�||_dSr)rqr�_domain)rrmrarur
rrxszDomainFilter.__init__cCs|jSr)r�rr
r
rra|szDomainFilter.domaincCs|\}}}||jk|jASr)rarm)rrKrarrr
r
rro�s
zDomainFilter._match)r$r%r&rr@raror~r
r
rurrws
rc@sTeZdZdd�Zdd�Zedd��Zdd�Zd	d
�Zdd�Z	ddd�Z
ddd�ZdS)�SnapshotcCst|�|_||_dSr)rcre�traceback_limit)rrer�r
r
rr�s
zSnapshot.__init__c	Cs*t|d��}t�||tj�W5QRXdS)N�wb)�open�pickle�dumpZHIGHEST_PROTOCOL)rr:�fpr
r
rr��sz
Snapshot.dumpc
Cs,t|d��}t�|�W5QR�SQRXdS)N�rb)r�r��load)r:r�r
r
rr��sz
Snapshot.loadcs@|rt�fdd�|D��sdS|r<t�fdd�|D��r<dSdS)Nc3s|]}|���VqdSr�ro�rJ�trace_filter�rKr
rrL�s�z)Snapshot._filter_trace.<locals>.<genexpr>Fc3s|]}|���VqdSrr�r�r�r
rrL�s�T)r{)r�include_filters�exclude_filtersrKr
r�r�
_filter_trace�s��zSnapshot._filter_tracecs�t|t�stdt|�j��|rjg�g�|D] }|jrB��|�q,��|�q,���fdd��jjD�}n�jj�	�}t
|�j�S)Nz)filters must be a list of filters, not %scsg|]}����|�r|�qSr
)r�rI�r�r�rr
r�
<listcomp>�s��z*Snapshot.filter_traces.<locals>.<listcomp>)rMr�	TypeError�typer$rmr/rerd�copyr�r�)r�filtersr�Z
new_tracesr
r�r�
filter_traces�s
�zSnapshot.filter_tracesc

Cs�|dkrtd|f��|r.|dkr.td|��i}i}|�s|jjD]�}|\}}}z||}	WnZtk
r�|dkr||}
n(|dkr�|dd�}
n|dddff}
t|
�}	|	||<YnXz(||	}|j|7_|jd7_WqDtk
�rt|	|d�||	<YqDXqDn�|jjD]�}|\}}}|D]�}z||}	WnFtk
�r~|dk�r\|f}
n|ddff}
t|
�}	|	||<YnXz(||	}|j|7_|jd7_Wn&tk
�r�t|	|d�||	<YnX�q(�q|S)	N)rr:r=zunknown key_type: %r)r=r:z/cumulative mode cannot by used with key type %rrr=r<r)�
ValueErrorrerd�KeyErrorrArrr)
r�key_type�
cumulativeZstatsZ
tracebacksrKrarZtrace_tracebackrrFr3r9r
r
r�	_group_by�sZ�


zSnapshot._group_byFcCs,|�||�}t|���}|jdtjd�|S�NT)�reverse�key)r��list�values�sortrr")rr�r�Zgroupedr2r
r
rr2�szSnapshot.statisticscCs6|�||�}|�||�}t||�}|jdtjd�|Sr�)r�r4r�r(r")rZold_snapshotr�r�r1r0r2r
r
r�
compare_tos

zSnapshot.compare_toN)F)F)r$r%r&rr��staticmethodr�r�r�r�r2r�r
r
r
rr��s
3

r�cCs$t�std��t�}t�}t||�S)NzLthe tracemalloc module must be tracing memory allocations to take a snapshot)�
is_tracing�RuntimeErrorrZget_traceback_limitr�)rer�r
r
r�
take_snapshot
s
r�)Zcollections.abcrr�	functoolsrrwrTZos.pathrgr�Z_tracemallocrrrrr(r4r5rAr\r]rcrkrlrprr�r�r
r
r
r�<module>s2&0"?%0	__pycache__/antigravity.cpython-38.opt-2.pyc000064400000001217151153537570014722 0ustar00U

e5d��@s&ddlZddlZe�d�dd�ZdS)�Nzhttps://xkcd.com/353/cCs\t�|���}dd�|dd�|dd�fD�\}}td||dd�||dd�f�dS)NcSsg|]}dt�d|��qS)z%fz0.)�float�fromhex)�.0�x�r�#/usr/lib64/python3.8/antigravity.py�
<listcomp>szgeohash.<locals>.<listcomp>�� z	%d%s %d%s�)�hashlibZmd5Z	hexdigest�print)ZlatitudeZ	longitudeZdatedow�h�p�qrrr�geohashs&r)Z
webbrowserr�openrrrrr�<module>s
__pycache__/reprlib.cpython-38.opt-2.pyc000064400000012035151153537570014020 0ustar00U

e5d��@sZdddgZddlZddlmZddlmZddd�ZGd	d�d�Zd
d�Ze�Z	e	j
Z
dS)
�Repr�repr�recursive_repr�N)�islice)�	get_ident�...cs�fdd�}|S)NcsXt�����fdd�}t�d�|_t�d�|_t�d�|_t�d�|_t�di�|_|S)Nc	sBt|�t�f}|�kr�S��|�z�|�}W5��|�X|S�N)�idr�add�discard)�self�key�result)�	fillvalue�repr_running�
user_function��/usr/lib64/python3.8/reprlib.py�wrappers
z<recursive_repr.<locals>.decorating_function.<locals>.wrapper�
__module__�__doc__�__name__�__qualname__�__annotations__)�set�getattrrrrrr)rr�r)rrr�decorating_functionsz+recursive_repr.<locals>.decorating_functionr)rrrrrr	sc@s~eZdZdd�Zdd�Zdd�Zddd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS) rcCsFd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
dS)N�����()�maxlevel�maxtuple�maxlist�maxarray�maxdict�maxset�maxfrozenset�maxdeque�	maxstring�maxlong�maxother)rrrr�__init__&sz
Repr.__init__cCs|�||j�Sr)�repr1r#)r�xrrrr3sz	Repr.reprcCsVt|�j}d|kr$|��}d�|�}t|d|�rFt|d|�||�S|�||�SdS)N� �_�repr_)�typer�split�join�hasattrr�
repr_instance)rr0�level�typename�partsrrrr/6s

z
Repr.repr1�c
s�t|�}|dkr|rd}nX|d�|j���fdd�t||�D�}	||krT|	�d�d�|	�}|dkrr|rr||}d|||fS)Nrr�csg|]}�|���qSrr)�.0�elem��newlevelr/rr�
<listcomp>Gsz'Repr._repr_iterable.<locals>.<listcomp>�, z%s%s%s)�lenr/r�appendr6)
rr0r9�left�right�maxiter�trail�n�s�piecesrr@r�_repr_iterable@s

zRepr._repr_iterablecCs|�||dd|jd�S)N�(�)�,)rMr$�rr0r9rrr�
repr_tupleMszRepr.repr_tuplecCs|�||dd|j�S)N�[�])rMr%rQrrr�	repr_listPszRepr.repr_listcCs,|sd|jSd|j}|�|||d|j�S)Nzarray('%s')z
array('%s', [�]))�typecoderMr&)rr0r9�headerrrr�
repr_arraySs

zRepr.repr_arraycCs$|sdSt|�}|�||dd|j�S)Nzset()�{�})�_possibly_sortedrMr(rQrrr�repr_setYsz
Repr.repr_setcCs$|sdSt|�}|�||dd|j�S)Nzfrozenset()zfrozenset({z}))r\rMr)rQrrr�repr_frozenset_s�zRepr.repr_frozensetcCs|�||dd|j�S)Nzdeque([rV)rMr*rQrrr�
repr_dequefszRepr.repr_dequecCs�t|�}|dkrdS|dkr dS|d}|j}g}tt|�|j�D].}|||�}||||�}	|�d||	f�qB||jkr�|�d�d�|�}
d|
fS)	Nrz{}z{...}r=z%s: %srrCz{%s})rDr/rr\r'rEr6)rr0r9rJrAr/rLr
�keyrepr�valreprrKrrr�	repr_dictis 



zRepr.repr_dictcCs�t�|d|j��}t|�|jkr�td|jdd�}td|jd|�}t�|d|�|t|�|d��}|d|�d|t|�|d�}|S�Nr��r)�builtinsrr+rD�max�rr0r9rK�i�jrrr�repr_strxs&$z
Repr.repr_strcCsht�|�}t|�|jkrdtd|jdd�}td|jd|�}|d|�d|t|�|d�}|Src)rfrrDr,rgrhrrr�repr_int�s
$z
Repr.repr_intcCs�zt�|�}Wn(tk
r6d|jjt|�fYSXt|�|jkr�td|jdd�}td|jd|�}|d|�d|t|�|d�}|S)Nz<%s instance at %#x>rrdrer)	rfr�	Exception�	__class__rr	rDr-rgrhrrrr8�s$zRepr.repr_instanceN)r<)rrrr.rr/rMrRrUrYr]r^r_rbrkrlr8rrrrr$s



	cCs,z
t|�WStk
r&t|�YSXdSr)�sortedrm�list)r0rrrr\�s
r\)r)�__all__rf�	itertoolsr�_threadrrrr\�aReprrrrrr�<module>s

s	__pycache__/pstats.cpython-38.opt-1.pyc000064400000053064151153537570013705 0ustar00U

e5d�j�@s�dZddlZddlZddlZddlZddlZddlmZddlm	Z	ddgZ
Gdd�dee�ZGdd�d�Z
Gd	d
�d
�Zdd�Zd
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zedk�r�ddlZzddlZWnek
r�YnXGdd�dej�Zeej�dk�rejdZndZzPee�Zejdd�D]Z e�!e ��q0e"dej#d�e�$�e"d ej#d�Wne%k
�r~YnXdS)!z3Class for printing reports on profiled python code.�N)�Enum)�
cmp_to_key�Stats�SortKeyc@s8eZdZdZdZdZdZdZdZdZ	dZ
d	Zd
d�ZdS)
r)�calls�ncalls)�
cumulative�cumtime)�filename�module�line�name�nfl�pcalls�stdname)�time�tottimecGs@|d}t�||�}||_|dd�D]}||j|<q&||_|S�Nr�)�str�__new__�_value_�_value2member_map_Z_all_values)�cls�values�value�objZother_value�r�/usr/lib64/python3.8/pstats.pyr-szSortKey.__new__N)
�__name__�
__module__�__qualname__ZCALLSZ
CUMULATIVEZFILENAMEZLINE�NAMEZNFLZPCALLSZSTDNAMEZTIMErrrrrr"sc@s�eZdZdZdd�dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dddddddddddddd�
Z
dd�Zdd�Zdd�Z
d d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd7d1d2�Zd3d4�Zd5d6�ZdS)8ra�This class is used for creating reports from data generated by the
    Profile class.  It is a "friend" of that class, and imports data either
    by direct access to members of Profile class, or by reading in a dictionary
    that was emitted (via marshal) from the Profile class.

    The big change from the previous Profiler (in terms of raw functionality)
    is that an "add()" method has been provided to combine Stats from
    several distinct profile runs.  Both the constructor and the add()
    method now take arbitrarily many file names as arguments.

    All the print methods now take an argument that indicates how many lines
    to print.  If the arg is a floating point number between 0 and 1.0, then
    it is taken as a decimal percentage of the available lines to be printed
    (e.g., .1 means print 10% of all available lines).  If it is an integer,
    it is taken to mean the number of lines of data that you wish to have
    printed.

    The sort_stats() method now processes some additional options (i.e., in
    addition to the old -1, 0, 1, or 2 that are respectively interpreted as
    'stdname', 'calls', 'time', and 'cumulative').  It takes either an
    arbitrary number of quoted strings or SortKey enum to select the sort
    order.

    For example sort_stats('time', 'name') or sort_stats(SortKey.TIME,
    SortKey.NAME) sorts on the major key of 'internal function time', and on
    the minor key of 'the name of the function'.  Look at the two tables in
    sort_stats() and get_sort_arg_defs(self) for more examples.

    All methods return self, so you can string together commands like:
        Stats('foo', 'goo').strip_dirs().sort_stats('calls').                            print_stats(5).print_callers(5)
    N)�streamcGsF|ptj|_t|�sd}n|d}|dd�}|�|�|j|�dSr)�sys�stdoutr#�len�init�add)�selfr#�args�argrrr�__init__Ys
zStats.__init__cCs�d|_g|_d|_d|_d|_d|_d|_t�|_i|_	i|_
|�|�z|��Wn8t
k
r�td|jrx|jdnd|jd��YnXdS)NrzInvalid timing data %s������file)�all_callees�files�fcn_list�total_tt�total_calls�
prim_calls�max_name_len�set�	top_level�stats�
sort_arg_dict�
load_stats�get_top_level_stats�	Exception�printr#)r)r+rrrr'cs(
��z
Stats.initc	Cs�|dkri|_dSt|t�rxt|d��}t�|�|_W5QRXz"t�|�}t�	|j
�d|}WnYnX|g|_n t|d�r�|�
�|j|_i|_|js�td|j|f��dS)N�rbz    �create_statsz.Cannot create or construct a %r object from %r)r:�
isinstancer�open�marshal�load�os�statr�ctime�st_mtimer2�hasattrrA�	TypeError�	__class__)r)r+�fZ
file_statsrrrr<vs*



�zStats.load_statscCs�|j��D]p\}\}}}}}|j|7_|j|7_|j|7_d|krZ|j�|�tt|��|j	kr
tt|��|_	q
dS)N)ZjprofilerZprofiler)
r:�itemsr5r6r4r9r(r&�func_std_stringr7)r)�func�cc�nc�tt�ct�callersrrrr=�szStats.get_top_level_statscGs�|s|St|�D]�}t|�t|�kr,t|�}|j|j7_|j|j7_|j|j7_|j|j7_|jD]}|j�|�qr|j	|j	kr�|j	|_	d|_
|j��D]<\}}||jkr�|j|}nddddif}t
||�|j|<q�q|S�Nr)�reversed�typerr2r5r6r4r9r(r7r3r:rN�add_func_stats)r)�arg_list�itemrPrGZ
old_func_statrrrr(�s(

z	Stats.addc	Cs(t|d��}t�|j|�W5QRXdS)z:Write the profile data to a file we know how to load back.�wbN)rCrD�dumpr:)r)r
rMrrr�
dump_stats�szStats.dump_stats)))rr-z
call count)))�r-zcumulative time))��rz	file name))��rzline number))��rz
function name))rdr`rbzname/file/line)))rr-zprimitive call count)))�rz
standard name)))�r-z
internal time)
rrr	rr
rrr
rrrrrcCst|jsni|_}i}|j��D]>\}}|}|r|s4q||krFd||<q|||<|dd�}q*q|D]
}||=qb|jS)z)Expand all abbreviations that are unique.rNr-)r;�sort_arg_dict_defaultrN)r)�dictZbad_list�word�tupZfragmentrrr�get_sort_arg_defs�s 
zStats.get_sort_arg_defscGs\|sd|_|St|�dkrBt|dt�rBddddd�|dg}n:t|�dkr||dd�D] }t|�t|d�krZtd	��qZ|��}d
}d|_d}|D]B}t|t�r�|j	}|||d}|j|||d7_d}q�g}|j
��D]4\}\}	}
}}}
|�|	|
||f|t
|�|f�q�|jtt|�j�d
�g|_}|D]}|�|d��qB|S)Nrrrrrr)r-rrrgrgzCan't have mixed argument typerr.z, )�keyr-)r3r&rB�intrXrKrl�	sort_typerrr:rN�appendrO�sortr�	TupleComp�compare)r)Zfieldr+Z
sort_arg_defsZ
sort_tupleZ	connectorrjZ
stats_listrPrQrRrSrTrUr3�tuplerrr�
sort_stats�sF��


�
zStats.sort_statscCs|jr|j��|S�N)r3�reverse�r)rrr�
reverse_orders
zStats.reverse_ordercCs�|j}i|_}d}|��D]�\}\}}}}}	t|�}
tt|
��|krRtt|
��}i}|	��D]\}}
|
|t|�<q^|
|kr�t||
|||||f�||
<q|||||f||
<q|j}t�|_}|D]}|�t|��q�||_	d|_
d|_|SrV)r:rN�func_strip_pathr&rOrYr9r8r(r7r3r1)r)ZoldstatsZnewstatsr7rPrQrRrSrTrUZnewfuncZ
newcallers�func2�callerZold_topZnew_toprrr�
strip_dirss0
�
zStats.strip_dirsc
Cst|jr
dSi|_}|j��D]P\}\}}}}}||kr@i||<|��D]$\}}	||kr`i||<|	|||<qHqdSrv)r1r:rN)
r)r1rPrQrRrSrTrUr{r|rrr�calc_callees#s
zStats.calc_calleescCs|}t|t�rpzt�|�}Wn*tjk
rF|d|7}||fYSXg}|D]}|�t|��rP|�|�qPnzt|�}t|t	�r�d|kr�dkr�nnt
||d�}|d|�}n2t|t
�r�d|kr�|kr�nn|}|d|�}t|�t|�k�r|dt|�t|�|f7}||fS)Nz#   <Invalid regular expression %r>
gg�?g�?rz6   List reduced from %r to %r due to restriction <%r>
)rBr�re�compile�error�searchrOrpr&�floatrn)r)Zsel�list�msgZnew_listZrexrP�countrrr�eval_print_amount6s2
""�zStats.eval_print_amountcCs�|j}|jr*|jdd�}d|jd}nt|j���}d}|D]}|�|||�\}}q@t|�}|sld|fSt||j	d�|t|j�kr�d}|D] }tt
|��|kr�tt
|��}q�|d|fS)Nz   Ordered by: �
z!   Random listing order was used
rr/rg)r7r3ror�r:�keysr�r&r?r#rO)r)Zsel_list�widthZ	stat_listr�Z	selectionr�rPrrr�get_print_listPs$zStats.get_print_listcGs�|jD]}t||jd�q|jr,t|jd�d}|jD]}t|t|�|jd�q6t||jdd|jd�|j|jkr�td|jd|jd�td|j|jd�t|jd�|�|�\}}|r�|�	�|D]}|�
|�q�t|jd�t|jd�|S)Nr/�        zfunction calls� ��endr0z(%d primitive calls)zin %.3f seconds)r2r?r#r9�func_get_function_namer5r6r4r��print_title�
print_line)r)�amountr
�indentrPr�r�rrr�print_statshs(

zStats.print_statscGsz|�|�\}}|rv|��|�|d�|D]2}||jkrN|�|||j|�q*|�||i�q*t|jd�t|jd�|S)Nz	called...r/)r�r~�print_call_headingr1�print_call_liner?r#)r)r�r�r�rPrrr�
print_calleess
zStats.print_calleesc
Gsh|�|�\}}|rd|�|d�|D](}|j|\}}}}}	|�|||	d�q"t|jd�t|jd�|S)Nzwas called by...z<-r/)r�r�r:r�r?r#)
r)r�r�r�rPrQrRrSrTrUrrr�
print_callers�szStats.print_callersc
Csvtd�|�||jd�d}|j��D]0\}}}}}|r&tt|����}	t|	t�}qXq&|rrtd|d|jd�dS)Nz	Function r/Fr�z    ncalls  tottime  cumtime)	r?�ljustr#r:r�next�iterrBrt)
r)�	name_sizeZcolumn_titleZ	subheaderrQrRrSrTrUrrrrr��s
zStats.print_call_heading�->cCstt|��|�|d|jd�|s2t|jd�dSt|���}d}|D]�}t|�}||}	t|	t�r�|	\}
}}}
|
|kr�d|
|f}n
d|
f}d|�dd	t	|��t
|�t
|
�|f}|d
}n$d||	t
|j|d�f}|d}t||||jd�d}qFdS)
Nr�r�r/r.z%d/%dz%dz%s %s %s  %srfrgrz	%s(%r) %sr_)r?rOr�r#�sortedr�rBrt�rjustr&�f8r:)r)r��sourceZ	call_dictZarrowZclistr�rPr
rrRrQrSrTZsubstatsZ
left_widthrrrr��s0

�
zStats.print_call_linecCs"tdd|jd�td|jd�dS)Nz-   ncalls  tottime  percall  cumtime  percallr�r�zfilename:lineno(function)r/�r?r#rxrrrr��szStats.print_titlecCs�|j|\}}}}}t|�}||kr4|dt|�}t|�d�d|jd�tt|�d|jd�|dkrxtdd|jd�ntt||�d|jd�tt|�d|jd�|dkr�tdd|jd�ntt||�d|jd�tt|�|jd�dS)N�/�	r�r�rr�r/)r:rr?r�r#r�rO)r)rPrQrRrSrTrU�crrrr��szStats.print_line)r�)rr r!�__doc__r,r'r<r=r(r^rhrlruryr}r~r�r�r�r�r�r�r�r�r�rrrrr7sF!

�'
c@s eZdZdZdd�Zdd�ZdS)rra�This class provides a generic function for comparing any two tuples.
    Each instance records a list of tuple-indices (from most significant
    to least significant), and sort direction (ascending or decending) for
    each tuple-index.  The compare functions can then be used as the function
    argument to the system sort() function when a list of tuples need to be
    sorted in the instances order.cCs
||_dSrv��comp_select_list)r)r�rrrr,�szTupleComp.__init__cCsF|jD]:\}}||}||}||kr0|S||kr|SqdSrVr�)r)�left�right�index�	direction�l�rrrrrs�s

zTupleComp.compareN)rr r!r�r,rsrrrrrr�srrcCs|\}}}tj�|�||fSrv)rF�path�basename)�	func_namer
rr
rrrrz�s
rzcCs|dS)Nrgr)rPrrrr��sr�cCsN|dd�dkrB|d}|�d�r<|�d�r<d|dd�S|Snd|SdS)	Nrg)�~r�<�>z{%s}rr-z	%s:%d(%s))�
startswith�endswith)r�r
rrrrO�srOcCs@|\}}}}}|\}}}	}
}||||||	||
t||�fS)z3Add together all the stats for two profile entries.)�add_callers)�targetr�rQrRrSrTrUZt_ccZt_ncZt_ttZt_ctZ	t_callersrrrrYs
�rYcCs�i}|��D]\}}|||<q|��D]V\}}||krtt|t�rbtdd�t|||�D��||<q||||7<q&|||<q&|S)z*Combine two caller lists in a single list.css|]\}}||VqdSrvr)�.0�i�jrrr�	<genexpr>szadd_callers.<locals>.<genexpr>)rNrBrt�zip)r�r�Znew_callersrPr|rrrr�s

"
r�cCsd}|��D]}||7}q|S)z@Sum the caller statistics to get total number of calls received.r)r)rUrRrrrr�count_callss
r�cCsd|S)Nz%8.3fr)�xrrrr�(sr��__main__c@s�eZdZd6dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�ZdS)7�ProfileBrowserNcCs6tj�|�d|_d|_tj|_|dk	r2|�|�dS)N�% )	�cmd�Cmdr,�promptr:r$r%r#�do_read)r)�profilerrrr,7szProfileBrowser.__init__c	Cs�|��}g}|D]�}z|�t|��WqWntk
r>YnXz<t|�}|dksZ|dkrltd|jd�Wq|�|�WqWntk
r�YnX|�|�q|jr�t|j|�|�ntd|jd�dS)Nrrz#Fraction argument must be in [0, 1]r/�No statistics object is loaded.)	�splitrprn�
ValueErrorr�r?r#r:�getattr)r)�fnrr*Z	processedZtermZfracrrr�generic?s,
zProfileBrowser.genericcCsXtd|jd�td|jd�td|jd�td|jd�td|jd�td|jd�dS)NzArguments may be:r/z0* An integer maximum number of entries to print.z:* A decimal fractional number between 0 and 1, controllingz-  what fraction of selected entries to print.z8* A regular expression; only entries with function namesz  that match it are printed.r�rxrrr�generic_helpWszProfileBrowser.generic_helpc
Csd|jrRz|j�|�Wq`tk
rN}ztd||f|jd�W5d}~XYq`Xntd|jd�dS)Nz$Failed to load statistics for %s: %sr/r�r)r:r(�OSErrorr?r#)r)r�errr�do_add_s*zProfileBrowser.do_addcCstd|jd�dS)Nz>Add profile info from given file to current statistics object.r/r�rxrrr�help_addhszProfileBrowser.help_addcCs|�d|�S)Nr��r��r)rrrr�
do_calleeskszProfileBrowser.do_calleescCstd|jd�|��dS)Nz6Print callees statistics from the current stat object.r/�r?r#r�rxrrr�help_calleesmszProfileBrowser.help_calleescCs|�d|�S)Nr�r�r�rrr�
do_callersqszProfileBrowser.do_callerscCstd|jd�|��dS)Nz6Print callers statistics from the current stat object.r/r�rxrrr�help_callerssszProfileBrowser.help_callerscCstd|jd�dS)Nr.r/rr�r�rrr�do_EOFwszProfileBrowser.do_EOFcCstd|jd�dS�NzLeave the profile browser.r/r�rxrrr�help_EOFzszProfileBrowser.help_EOFcCsdS)Nrrr�rrr�do_quit}szProfileBrowser.do_quitcCstd|jd�dSr�r�rxrrr�	help_quitszProfileBrowser.help_quitc
Cs�|r�zt|�|_Wnztk
rN}zt|jd|jd�WY�dSd}~XYn@tk
r�}z"t|jjd||jd�WY�dSd}~XYnX|d|_	n6t
|j	�dkr�|j	dd�}|�|�ntd|jd�dS)	Nrr/�:r�rg���z1No statistics object is current -- cannot reload.r)rr:r�r?r*r#r>rLrr�r&r�)r)r�errrrrr��szProfileBrowser.do_readcCs td|jd�td|jd�dS)Nz+Read in profile data from a specified file.r/z*Without argument, reload the current file.r�rxrrr�	help_read�szProfileBrowser.help_readcCs$|jr|j��ntd|jd�dS)Nr�r/r)r:ryr?r#r�rrr�
do_reverse�szProfileBrowser.do_reversecCstd|jd�dS)Nz/Reverse the sort order of the profiling report.r/r�rxrrr�help_reverse�szProfileBrowser.help_reversecs�|jstd|jd�dS|j���|rRt�fdd�|��D��rR|jj|���n<td|jd�tj�	�D]"\}}td||df|jd�qjdS)	Nr�r/c3s|]}|�kVqdSrvr)r�r��Zabbrevsrrr��sz)ProfileBrowser.do_sort.<locals>.<genexpr>z/Valid sort keys (unique prefixes are accepted):z%s -- %srr)
r:r?r#rl�allr�rurrhrN)r)rrmrrr�r�do_sort�s
zProfileBrowser.do_sortcCs td|jd�td|jd�dS)Nz.Sort profile data according to specified keys.r/z3(Typing `sort' without arguments lists valid keys.)r�rxrrr�	help_sort�szProfileBrowser.help_sortcs�fdd�tjD�S)Ncsg|]}|���r|�qSr)r�)r��a��textrr�
<listcomp>�s
z0ProfileBrowser.complete_sort.<locals>.<listcomp>)rrh)r)r�r*rr�r�
complete_sort�szProfileBrowser.complete_sortcCs|�d|�S)Nr�r�r�rrr�do_stats�szProfileBrowser.do_statscCstd|jd�|��dS)Nz.Print statistics from the current stat object.r/r�rxrrr�
help_stats�szProfileBrowser.help_statscCs$|jr|j��ntd|jd�dS)Nr�r/)r:r}r?r#r�rrr�do_strip�szProfileBrowser.do_stripcCstd|jd�dS)Nz<Strip leading path information from filenames in the report.r/r�rxrrr�
help_strip�szProfileBrowser.help_stripcCstd|jd�dS)NzShow help for a given command.r/r�rxrrr�	help_help�szProfileBrowser.help_helpcCs|r|SdSrvr)r)�stoprrrr�postcmd�szProfileBrowser.postcmd)N)rr r!r,r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr�6s4
	r�rrgz*Welcome to the profile statistics browser.r/zGoodbye.)&r�r$rFrrDr�enumr�	functoolsr�__all__rrrrrrzr�rOrYr�r�r�rr��readline�ImportErrorr�r�r&�argvZinitprofileZbrowserr�r�r?r#Zcmdloop�KeyboardInterruptrrrr�<module>sR 
__pycache__/_py_abc.cpython-38.opt-1.pyc000064400000011032151153537570013750 0ustar00U

e5d-�@s(ddlmZdd�ZGdd�de�ZdS)�)�WeakSetcCstjS)z�Returns the current ABC cache token.

    The token is an opaque object (supporting equality testing) identifying the
    current version of the ABC cache for virtual subclasses. The token changes
    with every call to ``register()`` on any ABC.
    )�ABCMeta�_abc_invalidation_counter�rr�/usr/lib64/python3.8/_py_abc.py�get_cache_tokensrcsVeZdZdZdZ�fdd�Zdd�Zddd	�Zd
d�Zdd
�Z	dd�Z
dd�Z�ZS)rahMetaclass for defining Abstract Base Classes (ABCs).

    Use this metaclass to create an ABC.  An ABC can be subclassed
    directly, and then acts as a mix-in class.  You can also register
    unrelated concrete classes (even built-in classes) and unrelated
    ABCs as 'virtual subclasses' -- these and their descendants will
    be considered subclasses of the registering ABC by the built-in
    issubclass() function, but the registering ABC won't show up in
    their MRO (Method Resolution Order) nor will method
    implementations defined by the registering ABC be callable (not
    even via super()).
    rc	s�t�j||||f|�}dd�|��D�}|D]:}t|dt��D]&}t||d�}t|dd�r>|�|�q>q,t|�|_t�|_	t�|_
t�|_tj
|_|S)NcSs h|]\}}t|dd�r|�qS)�__isabstractmethod__F)�getattr)�.0�name�valuerrr�	<setcomp>&s�z"ABCMeta.__new__.<locals>.<setcomp>�__abstractmethods__rF)�super�__new__�itemsr	�set�add�	frozensetrr�
_abc_registry�
_abc_cache�_abc_negative_cacherr�_abc_negative_cache_version)	�mclsr�bases�	namespace�kwargs�clsZ	abstracts�baser��	__class__rrr#s�
zABCMeta.__new__cCsPt|t�std��t||�r |St||�r2td��|j�|�tjd7_|S)zsRegister a virtual subclass of an ABC.

        Returns the subclass, to allow usage as a class decorator.
        zCan only register classesz'Refusing to create an inheritance cycle�)	�
isinstance�type�	TypeError�
issubclass�RuntimeErrorrrrr)r�subclassrrr�register6s


zABCMeta.registerNcCs|td|j�d|j��|d�tdt���|d�|jD]@}|�d�r6t||�}t|t�r`t	|�}t|�d|��|d�q6dS)z'Debug helper to print the ABC registry.zClass: �.)�filezInv. counter: Z_abc_z: N)
�print�
__module__�__qualname__r�__dict__�
startswithr	r"rr)rr*rrrrr�_dump_registryHs



zABCMeta._dump_registrycCs|j��dS)z.Clear the registry (for debugging or testing).N)r�clear�rrrr�_abc_registry_clearSszABCMeta._abc_registry_clearcCs|j��|j��dS)z,Clear the caches (for debugging or testing).N)rr1rr2rrr�_abc_caches_clearWs
zABCMeta._abc_caches_clearcsb|j}|�jkrdSt|�}||krH�jtjkr>|�jkr>dS��|�St�fdd�||fD��S)z'Override for isinstance(instance, cls).TFc3s|]}��|�VqdS)N)�__subclasscheck__)r
�cr2rr�	<genexpr>jsz,ABCMeta.__instancecheck__.<locals>.<genexpr>)	r rr#rrrrr5�any)r�instancer'Zsubtyperr2r�__instancecheck__\s
��
zABCMeta.__instancecheck__cCst|t�std��||jkr dS|jtjkr>t�|_tj|_n||jkrLdS|�	|�}|t
k	r�|rp|j�|�n|j�|�|S|t|dd�kr�|j�|�dS|j
D] }t||�r�|j�|�dSq�|��D] }t||�r�|j�|�dSq�|j�|�dS)z'Override for issubclass(subclass, cls).z"issubclass() arg 1 must be a classTF�__mro__r)r"r#r$rrrrrr�__subclasshook__�NotImplementedrr	rr%�__subclasses__)rr'�okZrclsZsclsrrrr5ls8







zABCMeta.__subclasscheck__)N)
�__name__r,r-�__doc__rrr(r0r3r4r:r5�
__classcell__rrrrrs
rN)Z_weakrefsetrrr#rrrrr�<module>s
__pycache__/mailcap.cpython-38.pyc000064400000016050151153537570013030 0ustar00U

e5dk#�@s�dZddlZddlZddlZddgZdd�Ze�d�jZGdd	�d	e	�Z
d
d�Zdd�Zd
d�Z
dd�Zdd�Zdd�Zddgfdd�Zd#dd�Zgfdd�Zdd�Zdd�Zd d!�Zed"kr�e�dS)$z%Mailcap file handling.  See RFC 1524.�N�getcaps�	findmatchcCsd|krd|dfSdSdS)N�linenor)�r�)�entryrr�/usr/lib64/python3.8/mailcap.py�lineno_sort_key
sr	z[^\xa1-\U0010FFFF\w@+=:,./-]c@seZdZdZdS)�UnsafeMailcapInputz)Warning raised when refusing unsafe inputN)�__name__�
__module__�__qualname__�__doc__rrrrr
sr
c
Cs�i}d}t�D]~}zt|d�}Wntk
r8YqYnX|�t||�\}}W5QRX|��D]*\}}||krz|||<q`|||||<q`q|S)a�Return a dictionary containing the mailcap database.

    The dictionary maps a MIME type (in all lowercase, e.g. 'text/plain')
    to a list of dictionaries corresponding to mailcap entries.  The list
    collects all the entries for that MIME type from all available mailcap
    files.  Each dictionary contains key-value pairs for that MIME type,
    where the viewing command is stored with the key "view".

    r�r)�listmailcapfiles�open�OSError�_readmailcapfile�items)�capsrZmailcap�fpZmorecaps�key�valuerrrrs



cCsPdtjkr"tjd}|�tj�}n*dtjkr8tjd}nd}|ddddg}|S)z7Return a list of all mailcap files found on the system.ZMAILCAPS�HOME�.z	/.mailcapz/etc/mailcapz/usr/etc/mailcapz/usr/local/etc/mailcap)�os�environ�split�pathsep)ZpathstrZmailcaps�homerrrr3s


�rcCs t�dtd�t|d�\}}|S)z?Read a mailcap file and return a dictionary keyed by MIME type.z2readmailcapfile is deprecated, use getcaps instead�N)�warnings�warn�DeprecationWarningr)rr�_rrr�readmailcapfileEs�r%c	Cs�i}|��}|sq�|ddks|��dkr,q|}|dd�dkrb|��}|sPd}|dd�|}q0t|�\}}|r|sxq|dk	r�||d<|d	7}|�d
�}tt|��D]}||��||<q�d
�|���}||kr�||�|�q|g||<q||fS)a�Read a mailcap file and return a dictionary keyed by MIME type.

    Each MIME type is mapped to an entry consisting of a list of
    dictionaries; the list will contain more than one such dictionary
    if a given MIME type appears more than once in the mailcap file.
    Each dictionary contains key-value pairs for that MIME type, where
    the viewing command is stored with the key "view".
    r�#����Nz\
�
rr�/)	�readline�strip�	parseliner�range�len�join�lower�append)	rrr�lineZnextliner�fields�types�jrrrrMs4	
rc
Cs�g}dt|�}}||kr>t|||�\}}|�|�|d}qt|�dkrNdS|d|d|dd�}}}d|i}|D]V}|�d�}|dkr�|}d}	n$|d|���}||dd���}	||kr�qz|	||<qz||fS)	z�Parse one entry in a mailcap file and return a dictionary.

    The viewing command is stored as the value with the key "view",
    and the rest of the fields produce key-value pairs in the dict.
    rrr �NNN�view�=r')r/�
parsefieldr2�findr,)
r3r4�i�n�fieldrr8�restZfkeyZfvaluerrrr-vs*

 

r-cCsP|}||kr<||}|dkr q<q|dkr2|d}q|d}q|||���|fS)z/Separate one key-value pair in a mailcap entry.�;�\r r)r,)r3r<r=�start�crrrr:�s

r:r8z	/dev/nullc
Cs�t|�r"d|f}t�|t�dSt|||�}|D]`}d|krlt|d||�}|dkrXq2|rlt�|�dkrlq2t|||||�}	|	dk	r2|	|fSq2dS)aFind a match for a mailcap entry.

    Return a tuple containing the command line, and the mailcap entry
    used; (None, None) if no match is found.  This may invoke the
    'test' command of several matching entries before deciding which
    entry to use.

    zHRefusing to use mailcap with filename %r. Use a safe temporary filename.r7�testNr)�_find_unsafer!r"r
�lookup�substr�system)
r�MIMEtyper�filename�plist�msg�entries�erD�commandrrrr�s 	
cslg}||kr|||}|�d�}|dd}||krB|||}�dk	r\�fdd�|D�}t|td�}|S)Nr*rz/*csg|]}�|kr|�qSrr)�.0rN�rrr�
<listcomp>�szlookup.<locals>.<listcomp>rQ)r�sortedr	)rrIrrMZ	MIMEtypesrrQrrF�s
rFcCsRd}dt|�}}||k�rN||}|d}|dkr^|dkrT|||d�}|d}||}q||}|d}|dkr�||}q|dkr�||}q|dkr�t|�r�d|f}t�|t�dS||}q|d	k�r@|}	||kr�||d
kr�|d}q�||	|�}
|d}t|
|�}t|��r6d||
f}t�|t�dS||}q|d|}q|S)Nr'rr�%rA�s�tz9Refusing to substitute MIME type %r into a shell command.�{�}z=Refusing to substitute parameter %r (%s) into a shell command)r/rEr!r"r
�	findparam)r>rIrJrK�resr<r=rCrLrB�nameZparamrrrrG�sH










rGcCsF|��d}t|�}|D](}|d|���|kr||d�SqdS)Nr9r')r1r/)r[rKr=�prrrrY�srYc	Cs�ddl}t�}|jdd�s(t|�dStdt|j�d�D]�}|j||d�}t|�dkrjtd�dS|d}|d}t||d|�\}}|s�tdt�q:td|�t	�
|�}|r:td|�q:dS)	Nrrr z"usage: mailcap [MIMEtype file] ...r8zNo viewer found forz
Executing:zExit status:)�sysr�argv�showr.r/�printr�typerrH)	r]rr<�argsrI�filerOrN�stsrrrrDs&

rDcCs�td�t�D]}td|�qt�|s0t�}td�t�t|�}|D]H}t|�||}|D].}t|�}|D]}td|||�qrt�qbqJdS)NzMailcap files:�	zMailcap entries:z  %-15s)r`rrrS)r�fnZckeysrarMrN�keys�krrrr_s"
r_�__main__)N)rrr!�re�__all__r	�compile�searchrE�Warningr
rrr%rr-r:rrFrGrYrDr_rrrrr�<module>s*)

)__pycache__/fileinput.cpython-38.opt-1.pyc000064400000032077151153537570014367 0ustar00U

e5du9�@s�dZddlZddlZddddddd	d
ddd
dgZdad"ddd�dd�Zdd�Zdd�Zdd�Zdd�Z	dd�Z
dd	�Zdd
�Zdd�Z
Gdd�d�Zdd
�Zd#dd�Zdd �Zed!kr�e�dS)$a
Helper class to quickly write a loop over all standard input files.

Typical use is:

    import fileinput
    for line in fileinput.input():
        process(line)

This iterates over the lines of all files listed in sys.argv[1:],
defaulting to sys.stdin if the list is empty.  If a filename is '-' it
is also replaced by sys.stdin and the optional arguments mode and
openhook are ignored.  To specify an alternative list of filenames,
pass it as the argument to input().  A single file name is also allowed.

Functions filename(), lineno() return the filename and cumulative line
number of the line that has just been read; filelineno() returns its
line number in the current file; isfirstline() returns true iff the
line just read is the first line of its file; isstdin() returns true
iff the line was read from sys.stdin.  Function nextfile() closes the
current file so that the next iteration will read the first line from
the next file (if any); lines not read from the file will not count
towards the cumulative line count; the filename is not changed until
after the first line of the next file has been read.  Function close()
closes the sequence.

Before any lines have been read, filename() returns None and both line
numbers are zero; nextfile() has no effect.  After all lines have been
read, filename() and the line number functions return the values
pertaining to the last line read; nextfile() has no effect.

All files are opened in text mode by default, you can override this by
setting the mode parameter to input() or FileInput.__init__().
If an I/O error occurs during opening or reading a file, the OSError
exception is raised.

If sys.stdin is used more than once, the second and further use will
return no lines, except perhaps for interactive use, or if it has been
explicitly reset (e.g. using sys.stdin.seek(0)).

Empty files are opened and immediately closed; the only time their
presence in the list of filenames is noticeable at all is when the
last file opened is empty.

It is possible that the last line of a file doesn't end in a newline
character; otherwise lines are returned including the trailing
newline.

Class FileInput is the implementation; its methods filename(),
lineno(), fileline(), isfirstline(), isstdin(), nextfile() and close()
correspond to the functions in the module.  In addition it has a
readline() method which returns the next input line, and a
__getitem__() method which implements the sequence behavior.  The
sequence must be accessed in strictly sequential order; sequence
access and readline() cannot be mixed.

Optional in-place filtering: if the keyword argument inplace=1 is
passed to input() or to the FileInput constructor, the file is moved
to a backup file and standard output is directed to the input file.
This makes it possible to write a filter that rewrites its input file
in place.  If the keyword argument backup=".<some extension>" is also
given, it specifies the extension for the backup file, and the backup
file remains around; by default, the extension is ".bak" and it is
deleted when the output file is closed.  In-place filtering is
disabled when standard input is read.  XXX The current implementation
does not work for MS-DOS 8+3 filesystems.

XXX Possible additions:

- optional getopt argument processing
- isatty()
- read(), read(size), even readlines()

�N�input�close�nextfile�filename�lineno�
filelineno�fileno�isfirstline�isstdin�	FileInput�hook_compressed�hook_encodedF��r��mode�openhookcCs(trtjrtd��t|||||d�atS)aReturn an instance of the FileInput class, which can be iterated.

    The parameters are passed to the constructor of the FileInput class.
    The returned instance, in addition to being an iterator,
    keeps global state for the functions of this module,.
    zinput() already activer)�_state�_file�RuntimeErrorr)�files�inplace�backuprr�r�!/usr/lib64/python3.8/fileinput.pyrSs
cCst}da|r|��dS)zClose the sequence.N)rr)�staterrrr`scCststd��t��S)a�
    Close the current file so that the next iteration will read the first
    line from the next file (if any); lines not read from the file will
    not count towards the cumulative line count. The filename is not
    changed until after the first line of the next file has been read.
    Before the first line has been read, this function has no effect;
    it cannot be used to skip the first file. After the last line of the
    last file has been read, this function has no effect.
    �no active input())rrrrrrrrhs
cCststd��t��S)zr
    Return the name of the file currently being read.
    Before the first line has been read, returns None.
    r)rrrrrrrrvscCststd��t��S)z�
    Return the cumulative line number of the line that has just been read.
    Before the first line has been read, returns 0. After the last line
    of the last file has been read, returns the line number of that line.
    r)rrrrrrrrscCststd��t��S)z�
    Return the line number in the current file. Before the first line
    has been read, returns 0. After the last line of the last file has
    been read, returns the line number of that line within the file.
    r)rrrrrrrr�scCststd��t��S)zg
    Return the file number of the current file. When no file is currently
    opened, returns -1.
    r)rrrrrrrr�scCststd��t��S)ze
    Returns true the line just read is the first line of its file,
    otherwise returns false.
    r)rrr	rrrrr	�scCststd��t��S)z]
    Returns true if the last line was read from sys.stdin,
    otherwise returns false.
    r)rrr
rrrrr
�sc@s�eZdZdZd)ddd�dd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�ZdS)*ra;FileInput([files[, inplace[, backup]]], *, mode=None, openhook=None)

    Class FileInput is the implementation of the module; its methods
    filename(), lineno(), fileline(), isfirstline(), isstdin(), fileno(),
    nextfile() and close() correspond to the functions of the same name
    in the module.
    In addition it has a readline() method which returns the next
    input line, and a __getitem__() method which implements the
    sequence behavior. The sequence must be accessed in strictly
    sequential order; random access and readline() cannot be mixed.
    NFrrrcCst|t�r|f}nBt|tj�r,t�|�f}n(|dkrBtjdd�}|sLd}nt|�}||_||_	||_
d|_d|_d|_
d|_d|_d|_d|_d|_|dkr�td��d|kr�ddl}|�dtd	�||_d|kr�|�d
d�nd|_|�r|r�td��t|��std
��||_dS)N�)�-rF)rZrU�U�rbz=FileInput opening mode must be one of 'r', 'rU', 'U' and 'rb'rz'U' mode is deprecated�r�wz4FileInput cannot use an opening hook in inplace modez#FileInput openhook must be callable)�
isinstance�str�os�PathLike�fspath�sys�argv�tuple�_files�_inplace�_backup�_savestdout�_output�	_filename�_startlineno�_filelinenor�_isstdin�_backupfilename�
ValueError�warnings�warn�DeprecationWarning�_mode�replace�_write_mode�callable�	_openhook)�selfrrrrrr6rrr�__init__�sH
�
zFileInput.__init__cCs|��dS�N�r�r>rrr�__del__�szFileInput.__del__cCsz|��W5d|_XdS)Nr)r+rrBrrrr�szFileInput.closecCs|Sr@rrBrrr�	__enter__�szFileInput.__enter__cCs|��dSr@rA)r>�type�value�	tracebackrrr�__exit__�szFileInput.__exit__cCs|Sr@rrBrrr�__iter__�szFileInput.__iter__cCs6|��}|r|jd7_|S|js(t�|��qdS�Nr)�	_readliner2r�
StopIterationr�r>�linerrr�__next__�szFileInput.__next__cCsXddl}|jdtdd�||��kr,td��z
|��WStk
rRtd��YnXdS)NrzTSupport for indexing FileInput objects is deprecated. Use iterator protocol instead.r!)�
stacklevelzaccessing lines out of orderzend of input reached)r6r7r8rrrOrL�
IndexError)r>�ir6rrr�__getitem__s�
zFileInput.__getitem__cCs�|j}d|_|r|t_|j}d|_z|r0|�
�W5|j}d|_z|`Wntk
r\YnXz|rr|jsr|�
�W5|j}d|_|r�|js�zt	�
|�Wntk
r�YnXd|_XXdS)NF)r.r(�stdoutr/rrK�AttributeErrorr4r-r%�unlink�OSErrorr3r)r>Z
savestdout�output�fileZbackupfilenamerrrrs4

zFileInput.nextfilecCs6|��}|r|jd7_|S|js(|S|��qdSrJ)rKr2rrrMrrr�readline.szFileInput.readlinecCs�|jsd|jkrdSdS|jd|_|jdd�|_|��|_d|_d|_d|_d|_|jdkr�d|_d|jkr�t	t
jd	t
j�|_nt
j|_d
|_�nT|j�r�t
�|j�|jp�d|_zt
�|j�Wntk
r�YnXt
�|j|j�t|j|j�|_zt
�|j���j}Wn&tk
�r8t|j|j�|_YntXt
jt
jBt
jB}tt
d��rb|t
jO}t
�|j||�}t
�||j�|_zt
�|j|�Wntk
�r�YnXt
j |_!|jt
_ n,|j"�r�|�"|j|j�|_nt|j|j�|_|jj#|_$|�$�S)
N�b�rrrFrz<stdin>�bufferTz.bak�O_BINARY)%r+r9r0rr1r2rr3r4�getattrr(�stdinr,r%r'r-rVrW�rename�open�fstatr�st_moder;r/�O_CREAT�O_WRONLY�O_TRUNC�hasattrr^�fdopen�chmodrTr.r=rZrK)r>Zpermr�fdrrrrK9s\




�


zFileInput._readlinecCs|jSr@)r0rBrrrrrszFileInput.filenamecCs|j|jSr@)r1r2rBrrrruszFileInput.linenocCs|jSr@�r2rBrrrrxszFileInput.filelinenocCs4|jr,z|j��WStk
r(YdSXndSdS)N���)rrr5rBrrrr{s
zFileInput.filenocCs
|jdkSrJrlrBrrrr	�szFileInput.isfirstlinecCs|jSr@)r3rBrrrr
�szFileInput.isstdin)NFr)�__name__�
__module__�__qualname__�__doc__r?rCrrDrHrIrOrSrrZrKrrrrr	r
rrrrr�s*�)9	cCsVtj�|�d}|dkr,ddl}|�||�S|dkrHddl}|�||�St||�SdS)Nrz.gzrz.bz2)r%�path�splitext�gziprb�bz2ZBZ2File)rrZextrtrurrrr�scs��fdd�}|S)Ncst||��d�S)N��encoding�errors)rb)rrrvrrr�szhook_encoded.<locals>.openhookr)rwrxrrrvrr
�scCs�ddl}d}d}|�tjdd�d�\}}|D] \}}|dkrBd}|dkr.|}q.t|||d�D]b}|d	d�d
kr~|dd	�}|d	d�dkr�|dd	�}tdt�t�t�t�r�d
p�d|f�q^tdt�t�t�f�dS)NrFrzib:z-iTz-b)rrrm�
�
z%d: %s[%d]%s %s�*rz
%d: %s[%d])	�getoptr(r)r�printrrrr	)r|rrZopts�args�o�arNrrr�_test�s&�
r��__main__)NFr)N)rqr(r%�__all__rrrrrrrrr	r
rrr
r�rnrrrr�<module>s4J�
	

			^
__pycache__/contextlib.cpython-38.pyc000064400000047407151153537570013607 0ustar00U

e5d�a�@sjdZddlZddlZddlZddlmZddlmZddlm	Z	dddd	d
ddd
ddddgZ
Gdd
�d
ej�ZGdd�dej�Z
Gdd
�d
e�ZGdd�d�ZGdd�deee�ZGdd�dee
�Zdd�Zdd�ZGdd�de�ZGdd�de�ZGd d�de�ZGd!d�de�ZGd"d�de�ZGd#d$�d$�ZGd%d�dee�ZGd&d�dee
�ZGd'd	�d	e�ZdS)(z4Utilities for with-statement contexts.  See PEP 343.�N)�deque��wraps��
MethodType�asynccontextmanager�contextmanager�closing�nullcontext�AbstractContextManager�AbstractAsyncContextManager�AsyncExitStack�ContextDecorator�	ExitStack�redirect_stdout�redirect_stderr�suppressc@s2eZdZdZdd�Zejdd��Zedd��Z	dS)	rz,An abstract base class for context managers.cCs|S�z0Return `self` upon entering the runtime context.���selfrr�"/usr/lib64/python3.8/contextlib.py�	__enter__sz AbstractContextManager.__enter__cCsdS�z9Raise any exception triggered within the runtime context.Nr�r�exc_type�	exc_value�	tracebackrrr�__exit__szAbstractContextManager.__exit__cCs|tkrt�|dd�StS)Nrr)r�_collections_abc�_check_methods�NotImplemented��cls�Crrr�__subclasshook__sz'AbstractContextManager.__subclasshook__N)
�__name__�
__module__�__qualname__�__doc__r�abc�abstractmethodr�classmethodr%rrrrrs
c@s2eZdZdZdd�Zejdd��Zedd��Z	dS)	rz9An abstract base class for asynchronous context managers.c�s|Srrrrrr�
__aenter__'sz&AbstractAsyncContextManager.__aenter__c�sdSrrrrrr�	__aexit__+sz%AbstractAsyncContextManager.__aexit__cCs|tkrt�|dd�StS)Nr-r.)rrr r!r"rrrr%0s
�z,AbstractAsyncContextManager.__subclasshook__N)
r&r'r(r)r-r*r+r.r,r%rrrrr#s
c@s eZdZdZdd�Zdd�ZdS)rzJA base class or mixin that enables context managers to work as decorators.cCs|S)a6Return a recreated instance of self.

        Allows an otherwise one-shot context manager like
        _GeneratorContextManager to support use as
        a decorator via implicit recreation.

        This is a private interface just for _GeneratorContextManager.
        See issue #11647 for details.
        rrrrr�_recreate_cm;s
zContextDecorator._recreate_cmcst����fdd��}|S)Nc
s*�����||�W5QR�SQRXdS�N)r/��args�kwds��funcrrr�innerHs
z(ContextDecorator.__call__.<locals>.innerr)rr5r6rr4r�__call__GszContextDecorator.__call__N)r&r'r(r)r/r7rrrrr8sc@seZdZdZdd�ZdS)�_GeneratorContextManagerBasezBShared functionality for @contextmanager and @asynccontextmanager.cCsJ|||�|_||||_|_|_t|dd�}|dkr@t|�j}||_dS)Nr))�genr5r2r3�getattr�typer))rr5r2r3�docrrr�__init__Rs
z%_GeneratorContextManagerBase.__init__N)r&r'r(r)r=rrrrr8Osr8c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_GeneratorContextManagerz%Helper for @contextmanager decorator.cCs|�|j|j|j�Sr0)�	__class__r5r2r3rrrrr/fsz%_GeneratorContextManager._recreate_cmcCs<|`|`|`zt|j�WStk
r6td�d�YnXdS�Nzgenerator didn't yield)r2r3r5�nextr9�
StopIteration�RuntimeErrorrrrrrls
z"_GeneratorContextManager.__enter__c
Cs|dkr8zt|j�Wntk
r,YdSXtd��n�|dkrF|�}z|j�|||�Wn�tk
r�}z||k	WY�Sd}~XYnttk
r�}z4||kr�WY�&dS|tkr�|j|kr�WY�
dS�W5d}~XYn$t��d|kr�YdS�YnXtd��dS)NF�generator didn't stop�z#generator didn't stop after throw())rAr9rBrC�throw�	__cause__�sys�exc_info)rr;�valuer�excrrrrus.


z!_GeneratorContextManager.__exit__N)r&r'r(r)r/rrrrrrr>as	r>c@s eZdZdZdd�Zdd�ZdS)�_AsyncGeneratorContextManagerz Helper for @asynccontextmanager.c�s6z|j��IdHWStk
r0td�d�YnXdSr@)r9�	__anext__�StopAsyncIterationrCrrrrr-�sz(_AsyncGeneratorContextManager.__aenter__c
�s&|dkr>z|j��IdHWntk
r2YdSXtd��n�|dkrL|�}z"|j�|||�IdHtd��Wn�tk
r�}z||k	WY�Sd}~XYn�tk
r�}z:||kr�WY�,dSt|ttf�r�|j|kr�WY�
dS�W5d}~XYn0tk
�r }z||k	�r�W5d}~XYnXdS)NrDz$generator didn't stop after athrow()F)	r9rMrNrC�athrow�
isinstancerBrG�
BaseException)r�typrJrrKrrrr.�s.




z'_AsyncGeneratorContextManager.__aexit__N)r&r'r(r)r-r.rrrrrL�srLcst���fdd��}|S)a�@contextmanager decorator.

    Typical usage:

        @contextmanager
        def some_generator(<arguments>):
            <setup>
            try:
                yield <value>
            finally:
                <cleanup>

    This makes this:

        with some_generator(<arguments>) as <variable>:
            <body>

    equivalent to this:

        <setup>
        try:
            <variable> = <value>
            <body>
        finally:
            <cleanup>
    cst�||�Sr0)r>r1�r5rr�helper�szcontextmanager.<locals>.helperr�r5rTrrSrr�scst���fdd��}|S)a�@asynccontextmanager decorator.

    Typical usage:

        @asynccontextmanager
        async def some_async_generator(<arguments>):
            <setup>
            try:
                yield <value>
            finally:
                <cleanup>

    This makes this:

        async with some_async_generator(<arguments>) as <variable>:
            <body>

    equivalent to this:

        <setup>
        try:
            <variable> = <value>
            <body>
        finally:
            <cleanup>
    cst�||�Sr0)rLr1rSrrrTsz#asynccontextmanager.<locals>.helperrrUrrSrr�sc@s(eZdZdZdd�Zdd�Zdd�ZdS)	r	a2Context to automatically close something at the end of a block.

    Code like this:

        with closing(<module>.open(<arguments>)) as f:
            <block>

    is equivalent to this:

        f = <module>.open(<arguments>)
        try:
            <block>
        finally:
            f.close()

    cCs
||_dSr0��thing)rrWrrrr=&szclosing.__init__cCs|jSr0rVrrrrr(szclosing.__enter__cGs|j��dSr0)rW�close)rrIrrrr*szclosing.__exit__N�r&r'r(r)r=rrrrrrr	sc@s(eZdZdZdd�Zdd�Zdd�ZdS)�_RedirectStreamNcCs||_g|_dSr0)�_new_target�_old_targets)r�
new_targetrrrr=2sz_RedirectStream.__init__cCs*|j�tt|j��tt|j|j�|jSr0)r\�appendr:rH�_stream�setattrr[rrrrr7sz_RedirectStream.__enter__cCstt|j|j���dSr0)r`rHr_r\�pop�r�exctype�excinst�exctbrrrr<sz_RedirectStream.__exit__)r&r'r(r_r=rrrrrrrZ.srZc@seZdZdZdZdS)raAContext manager for temporarily redirecting stdout to another file.

        # How to send help() to stderr
        with redirect_stdout(sys.stderr):
            help(dir)

        # How to write help() to a file
        with open('help.txt', 'w') as f:
            with redirect_stdout(f):
                help(pow)
    �stdoutN�r&r'r(r)r_rrrrr@sc@seZdZdZdZdS)rzCContext manager for temporarily redirecting stderr to another file.�stderrNrgrrrrrPsc@s(eZdZdZdd�Zdd�Zdd�ZdS)	ra?Context manager to suppress specified exceptions

    After the exception is suppressed, execution proceeds with the next
    statement following the with statement.

         with suppress(FileNotFoundError):
             os.remove(somefile)
         # Execution still resumes here if the file was already removed
    cGs
||_dSr0)�_exceptions)r�
exceptionsrrrr=aszsuppress.__init__cCsdSr0rrrrrrdszsuppress.__enter__cCs|dk	ot||j�Sr0)�
issubclassrirbrrrrgs
zsuppress.__exit__NrYrrrrrVs
c@sheZdZdZedd��Zedd��Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zde_dd�Z
ddd�ZdS)�_BaseExitStackz.A base class for ExitStack and AsyncExitStack.cCs
t||�Sr0r��cm�cm_exitrrr�_create_exit_wrapperwsz#_BaseExitStack._create_exit_wrappercs���fdd�}|S)Ncs����dSr0r�rrK�tb�r2�callbackr3rr�
_exit_wrapper}sz8_BaseExitStack._create_cb_wrapper.<locals>._exit_wrapperr�rtr2r3rurrsr�_create_cb_wrapper{sz!_BaseExitStack._create_cb_wrappercCst�|_dSr0)r�_exit_callbacksrrrrr=�sz_BaseExitStack.__init__cCst|��}|j|_t�|_|S)z@Preserve the context stack by transferring it to a new instance.)r;rxr)r�	new_stackrrr�pop_all�s
z_BaseExitStack.pop_allcCsBt|�}z
|j}Wntk
r0|�|�YnX|�||�|S)aRegisters a callback with the standard __exit__ method signature.

        Can suppress exceptions the same way __exit__ method can.
        Also accepts any object with an __exit__ method (registering a call
        to the method instead of the object itself).
        )r;r�AttributeError�_push_exit_callback�
_push_cm_exit�r�exit�_cb_type�exit_methodrrr�push�s	
z_BaseExitStack.pushcCs(t|�}|j}|�|�}|�||�|S)z�Enters the supplied context manager.

        If successful, also pushes its __exit__ method as a callback and
        returns the result of the __enter__ method.
        )r;rrr}�rrn�_cm_type�_exit�resultrrr�
enter_context�s

z_BaseExitStack.enter_contextcOs�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d	��|j|f|�|�}||_|�|�|S)
z\Registers an arbitrary callback and arguments.

        Cannot suppress exceptions.
        �zBdescriptor 'callback' of '_BaseExitStack' object needs an argumentrtrN�4Passing 'callback' as keyword argument is deprecated��
stacklevelz8callback expected at least 1 positional argument, got %drE)	�len�	TypeErrorra�warnings�warn�DeprecationWarningrw�__wrapped__r|�r2r3rrtr�rurrrrt�s&

�
�
z_BaseExitStack.callback�#($self, callback, /, *args, **kwds)cCs|�||�}|�|d�dS)z;Helper to correctly register callbacks to __exit__ methods.TN)rpr|�rrnrorurrrr}�sz_BaseExitStack._push_cm_exitTcCs|j�||f�dSr0)rxr^)rrt�is_syncrrrr|�sz"_BaseExitStack._push_exit_callbackN)T)r&r'r(r)�staticmethodrprwr=rzr�r�rt�__text_signature__r}r|rrrrrlts

rlc@s(eZdZdZdd�Zdd�Zdd�ZdS)	ra�Context manager for dynamic management of a stack of exit callbacks.

    For example:
        with ExitStack() as stack:
            files = [stack.enter_context(open(fname)) for fname in filenames]
            # All opened files will automatically be closed at the end of
            # the with statement, even if attempts to open files later
            # in the list raise an exception.
    cCs|Sr0rrrrrr�szExitStack.__enter__c
s�|ddk	}t��d��fdd�}d}d}|jr�|j��\}}|sHt�z||�r^d}d}d}Wq,t��}||d|d�d}|}Yq,Xq,|r�z|dj}	|d�Wn tk
r�|	|d_�YnX|o�|S)NrrEcs4|j}||krdS|dks*|�kr$q*|}q||_dSr0��__context__��new_exc�old_exc�exc_context��	frame_excrr�_fix_exception_context�sz2ExitStack.__exit__.<locals>._fix_exception_contextFT�NNN)rHrIrxra�AssertionErrorr�rQ)
r�exc_details�received_excr��suppressed_exc�
pending_raiser��cb�new_exc_details�	fixed_ctxrr�rr�s4

zExitStack.__exit__cCs|�ddd�dS�z%Immediately unwind the context stack.N)rrrrrrXszExitStack.closeN)r&r'r(r)rrrXrrrrr�s
1c@sfeZdZdZedd��Zedd��Zdd�Zdd	�Zd
d�Z	de	_
d
d�Zdd�Zdd�Z
dd�ZdS)r
a�Async context manager for dynamic management of a stack of exit
    callbacks.

    For example:
        async with AsyncExitStack() as stack:
            connections = [await stack.enter_async_context(get_connection())
                for i in range(5)]
            # All opened connections will automatically be released at the
            # end of the async with statement, even if attempts to open a
            # connection later in the list raise an exception.
    cCs
t||�Sr0rrmrrr�_create_async_exit_wrapper&sz)AsyncExitStack._create_async_exit_wrappercs���fdd�}|S)Nc�s����IdHdSr0rrqrsrrru,sz>AsyncExitStack._create_async_cb_wrapper.<locals>._exit_wrapperrrvrrsr�_create_async_cb_wrapper*sz'AsyncExitStack._create_async_cb_wrapperc�s.t|�}|j}|�|�IdH}|�||�|S)z�Enters the supplied async context manager.

        If successful, also pushes its __aexit__ method as a callback and
        returns the result of the __aenter__ method.
        N)r;r.r-�_push_async_cm_exitr�rrr�enter_async_context0s
z"AsyncExitStack.enter_async_contextcCsDt|�}z
|j}Wn tk
r2|�|d�YnX|�||�|S)a#Registers a coroutine function with the standard __aexit__ method
        signature.

        Can suppress exceptions the same way __aexit__ method can.
        Also accepts any object with an __aexit__ method (registering a call
        to the method instead of the object itself).
        F)r;r.r{r|r�r~rrr�push_async_exit<s
zAsyncExitStack.push_async_exitcOs�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d	��|j|f|�|�}||_|�|d
�|S)zfRegisters an arbitrary coroutine function and arguments.

        Cannot suppress exceptions.
        r�zMdescriptor 'push_async_callback' of 'AsyncExitStack' object needs an argumentrtrNr�r�zCpush_async_callback expected at least 1 positional argument, got %drEF)	r�r�rar�r�r�r�r�r|r�rrr�push_async_callbackNs&

�
�z"AsyncExitStack.push_async_callbackr�c�s|�ddd�IdHdSr�)r.rrrr�aclosekszAsyncExitStack.aclosecCs|�||�}|�|d�dS)zLHelper to correctly register coroutine function to __aexit__
        method.FN)r�r|r�rrrr�osz"AsyncExitStack._push_async_cm_exitc�s|Sr0rrrrrr-uszAsyncExitStack.__aenter__c�s�|ddk	}t��d��fdd�}d}d}|jr�|j��\}}z0|rP||�}n||�IdH}|rnd}d}d}Wq,t��}	||	d|d�d}|	}Yq,Xq,|r�z|dj}
|d�Wn tk
r�|
|d_�YnX|o�|S)NrrEcs4|j}||krdS|dks*|�kr$q*|}q||_dSr0r�r�r�rrr�~sz8AsyncExitStack.__aexit__.<locals>._fix_exception_contextFTr�)rHrIrxrar�rQ)rr�r�r�r�r�r�r��cb_suppressr�r�rr�rr.xs8


zAsyncExitStack.__aexit__N)r&r'r(r)r�r�r�r�r�r�r�r�r�r-r.rrrrr
s

c@s*eZdZdZd	dd�Zdd�Zdd�ZdS)
r
aOContext manager that does no additional processing.

    Used as a stand-in for a normal context manager, when a particular
    block of code is only sometimes used with a normal context manager:

    cm = optional_cm if condition else nullcontext()
    with cm:
        # Perform operation, using optional_cm if condition is True
    NcCs
||_dSr0��enter_result)rr�rrrr=�sznullcontext.__init__cCs|jSr0r�rrrrr�sznullcontext.__enter__cGsdSr0r)r�excinforrrr�sznullcontext.__exit__)NrYrrrrr
�s

)r)r*rHr�collectionsr�	functoolsr�typesr�__all__�ABCrr�objectrr8r>rLrrr	rZrrrrlrr
r
rrrr�<module>sN��D�.!!`E__pycache__/nntplib.cpython-38.pyc000064400000102270151153537570013070 0ustar00U

e5d���@s�dZddlZddlZddlZddlZddlZddlZzddlZWnek
rXdZ	YnXdZ	ddl
mZddlm
Z
ddd	d
ddd
dgZdZGdd�de�ZGdd	�d	e�ZGdd
�d
e�ZGdd�de�ZGdd�de�ZGdd
�d
e�ZdZdZddddddddd d!d"d#hZd$d%d&d'd(d)d*gZd)d*d+�Zd,Ze�d-d.d/d0d1g�Ze�d2d3d4d5g�Zd6d�Zd7d8�Z dmd9d:�Z!dnd;d<�Z"dod=d>�Z#e	�r�d?d@�Z$GdAdB�dB�Z%GdCd�de%�Z&e	�r�GdDdE�dEe%�Z'e�(dE�e)dFk�r�ddl*Z*e*j+dGdH�Z,e,j-dIdJdKdLdM�e,j-dNdOdPdQdM�e,j-dRdSdTe.dUeefdV�e,j-dWdXdYe.dZdV�e,j-d[d\d]dd^d_�e,�/�Z0e0j1Z1e0j�s�e1dTk�r|eZ1e&e0j2e1d`�Z3ne1dTk�r�eZ1e'e0j2e1d`�Z3e3�4�Z5dae5k�r�e3�6�e3�7e0j7�\Z8Z9Z:Z;Z<e=dbe<dce9dde:dee;�dfdg�Z>e?e.e;�e0j@dh�Z:e3�Ae:e;�\Z8ZBeBD]Z\ZCZDeeDd%��Edidh�dZFeeDd$�ZGe.eDd*�ZHe=dj�IeCe>eFdk�e>eGdl�eH���q e3�J�dS)pa�An NNTP client class based on:
- RFC 977: Network News Transfer Protocol
- RFC 2980: Common NNTP Extensions
- RFC 3977: Network News Transfer Protocol (version 2)

Example:

>>> from nntplib import NNTP
>>> s = NNTP('news')
>>> resp, count, first, last, name = s.group('comp.lang.python')
>>> print('Group', name, 'has', count, 'articles, range', first, 'to', last)
Group comp.lang.python has 51 articles, range 5770 to 5821
>>> resp, subs = s.xhdr('subject', '{0}-{1}'.format(first, last))
>>> resp = s.quit()
>>>

Here 'resp' is the server response line.
Error responses are turned into exceptions.

To post an article from a file:
>>> f = open(filename, 'rb') # file containing article, including header
>>> resp = s.post(f)
>>>

For descriptions of all methods, read the comments in the code below.
Note that all arguments and return values representing article numbers
are strings, not numbers, since they are rarely used for calculations.
�NFT)�
decode_header)�_GLOBAL_DEFAULT_TIMEOUT�NNTP�	NNTPError�NNTPReplyError�NNTPTemporaryError�NNTPPermanentError�NNTPProtocolError�
NNTPDataErrorric@seZdZdZdd�ZdS)rz%Base class for all nntplib exceptionscGs>tj|f|��z|d|_Wntk
r8d|_YnXdS)NrzNo response given)�	Exception�__init__�response�
IndexError)�self�args�r�/usr/lib64/python3.8/nntplib.pyrcs
zNNTPError.__init__N)�__name__�
__module__�__qualname__�__doc__rrrrrrasc@seZdZdZdS)rzUnexpected [123]xx replyN�rrrrrrrrrjsc@seZdZdZdS)rz
4xx errorsNrrrrrrnsc@seZdZdZdS)rz
5xx errorsNrrrrrrrsc@seZdZdZdS)r	z"Response does not begin with [1-5]Nrrrrrr	vsc@seZdZdZdS)r
zError in response dataNrrrrrr
zs�wi3Z100Z101�211�215Z220Z221Z222Z224Z225Z230Z231Z282�subject�from�datez
message-idZ
referencesz:bytesz:lines)�bytes�lines�
�	GroupInfo�group�last�first�flag�ArticleInfoZnumber�
message_idrcCsJg}t|�D]2\}}t|t�r4|�|�|p,d��q|�|�qd�|�S)zvTakes a unicode string representing a munged header value
    and decodes it as a (possibly non-ASCII) readable value.�ascii�)�_email_decode_header�
isinstancer�append�decode�join)Z
header_str�parts�v�encrrrr�s
cCs�g}|D]`}|ddkr:|dd��d�\}}}d|}n|�d�\}}}|��}t�||�}|�|�qt}t|�t|�kr�td��|dt|��|kr�td��|S)z�Parse a list of string representing the response to LIST OVERVIEW.FMT
    and return a list of header/metadata names.
    Raises NNTPDataError if the response is not compliant
    (cf. RFC 3977, section 8.4).r�:�Nz$LIST OVERVIEW.FMT response too shortz*LIST OVERVIEW.FMT redefines default fields)�	partition�lower�_OVERVIEW_FMT_ALTERNATIVES�getr,�_DEFAULT_OVERVIEW_FMT�lenr
)r�fmt�line�name�_�suffix�defaultsrrr�_parse_overview_fmt�s
r@cCs�tt�}g}|D]�}i}|�d�^}}t|�}t|�D]�\}	}
|	t|�krLq6||	}|�d�}|	|kr�|s�|d}
|
r�|
dt|
����|
kr�td��|
r�|
t|
�d�nd}
|
|||	<q6|�||f�q|S)zZParse the response to an OVER or XOVER command according to the
    overview format `fmt`.�	r2z: Nz?OVER/XOVER response doesn't include names of additional headers)	r9r8�split�int�	enumerate�
startswithr5r
r,)rr:Zdata_process_funcZ
n_defaultsZoverviewr;ZfieldsZarticle_number�tokens�i�tokenZ
field_nameZis_metadata�hrrr�_parse_overview�s&
rJcCs�|dkr |dd�}|dd�}t|dd��}t|dd��}t|dd��}t|dd��}t|dd��}t|dd��}|dkr�|d7}n|d	kr�|d
7}t�||||||�S)z�Parse a pair of (date, time) strings, and return a datetime object.
    If only the date is given, it is assumed to be date and time
    concatenated together (e.g. response to the DATE command).
    Ni�������������Fi��dil)rC�datetime)�date_str�time_strZhoursZminutesZseconds�yearZmonthZdayrrr�_parse_datetime�s
rUcCsPt|tj�sd}n
d�|�}|j}|r<|d}d�||�}nd�||�}||fS)aPFormat a date or datetime object as a pair of (date, time) strings
    in the format required by the NEWNEWS and NEWGROUPS commands.  If a
    date object is passed, the time is assumed to be midnight (00h00).

    The returned representation depends on the legacy flag:
    * if legacy is False (the default):
      date has the YYYYMMDD format and time the HHMMSS format
    * if legacy is True:
      date has the YYMMDD format and time the HHMMSS format.
    RFC 3977 compliant servers should understand both formats; therefore,
    legacy is only needed when talking to old servers.
    Z000000z({0.hour:02d}{0.minute:02d}{0.second:02d}rPz{0:02d}{1.month:02d}{1.day:02d}z{0:04d}{1.month:02d}{1.day:02d})r+rQ�formatrT)ZdtZlegacyrS�yrRrrr�_unparse_datetime�s

rXcCs|dkrt��}|j||d�S)z�Wrap a socket in SSL/TLS. Arguments:
        - sock: Socket to wrap
        - context: SSL context to use for the encrypted connection
        Returns:
        - sock: New, encrypted socket.
        N)Zserver_hostname)�sslZ_create_stdlib_contextZwrap_socket)�sock�contextZhostnamerrr�_encrypt_onsr\c@seZdZdZdZdefdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�ZeZdd�Z
dd�Zdhdd�Zdd�Zdidd�Zdd�Zdjdd�Zdkdd �Zd!d"�Zd#d$�Zd%d&�Zdd'�d(d)�Zdd'�d*d+�Zdldd'�d,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zdd'�d6d7�Zd8d9�Z d:d;�Z!dmd<d=�Z"d>d?�Z#d@dA�Z$dndBdC�Z%dodd'�dDdE�Z&dpdd'�dFdG�Z'dqdd'�dHdI�Z(dJdK�Z)dd'�dLdM�Z*dd'�dNdO�Z+dd'�dPdQ�Z,dd'�dRdS�Z-dTdU�Z.dVdW�Z/dXdY�Z0dZd[�Z1d\d]�Z2d^d_�Z3d`da�Z4drdbdc�Z5ddde�Z6e7�rdsdfdg�Z8dS)t�	_NNTPBasezutf-8�surrogateescapeNcCsj||_||_d|_|��|_d|_|��d|_|rZd|jkrZ|��|jsZd|_|��d|_	d|_
dS)aSInitialize an instance.  Arguments:
        - file: file-like object (open for read/write in binary mode)
        - host: hostname of the server
        - readermode: if true, send 'mode reader' command after
                      connecting.
        - timeout: timeout (in seconds) used for socket connections

        readermode is sometimes necessary if you are connecting to an
        NNTP server on the local machine and intend to call
        reader-specific commands, such as `group'.  If you get
        unexpected NNTPPermanentErrors, you might need to set
        readermode.
        rNF�READER)�host�file�	debugging�_getresp�welcome�_caps�getcapabilities�readermode_afterauth�_setreadermode�tls_on�
authenticated)rrar`�
readermode�timeoutrrrr9s
	z_NNTPBase.__init__cCs|S�Nr�rrrr�	__enter__hsz_NNTPBase.__enter__c	sR�fdd�}|�rNz*z���Wnttfk
r8YnXW5|�rL���XdS)Ncs
t�d�S)Nra)�hasattrrrnrr�<lambda>l�z$_NNTPBase.__exit__.<locals>.<lambda>)�_close�quit�OSError�EOFError)rrZis_connectedrrnr�__exit__ks
z_NNTPBase.__exit__cCs|jrtdt|j��|jS)z�Get the welcome message from the server
        (this is read and squirreled away by __init__()).
        If the response code is 200, posting is allowed;
        if it 201, posting is not allowed.z	*welcome*)rb�print�reprrdrnrrr�
getwelcomevsz_NNTPBase.getwelcomec	Cs�|jdkr�d|_d|_z|��\}}Wnttfk
rDi|_Yn<X||_d|krhttt|d��|_d|kr�d�	|d�|_|jS)z�Get the server capabilities, as read by __init__().
        If the CAPABILITIES command is not supported, an empty dict is
        returned.Nr3ZVERSIONZIMPLEMENTATION� )
re�nntp_versionZnntp_implementation�capabilitiesrr�max�maprCr.)r�resp�capsrrrrfs
z_NNTPBase.getcapabilitiescCs
||_dS)z�Set the debugging level.  Argument 'level' means:
        0: no debugging output (default)
        1: print commands and responses but not body text etc.
        2: also print raw lines read and sent before stripping CR/LFN)rb)r�levelrrr�set_debuglevel�sz_NNTPBase.set_debuglevelcCsHt�d||�|t}|jdkr.tdt|��|j�|�|j��dS)zfInternal: send one line to the server, appending CRLF.
        The `line` must be a bytes-like object.znntplib.putliner3z*put*N)	�sys�audit�_CRLFrbrxryra�write�flush�rr;rrr�_putline�s
z_NNTPBase._putlinecCs2|jrtdt|��|�|j|j�}|�|�dS)zkInternal: send one command to the server (through _putline()).
        The `line` must be a unicode string.z*cmd*N)rbrxry�encode�encoding�errorsr�r�rrr�_putcmd�sz_NNTPBase._putcmdTcCs�|j�td�}t|�tkr$td��|jdkr<tdt|��|sDt�|r�|dd�t	krf|dd�}n|dd�t	kr�|dd�}|S)z�Internal: return one line from the server, stripping _CRLF.
        Raise EOFError if the connection is closed.
        Returns a bytes object.r3z
line too longz*get*rNN���)
ra�readline�_MAXLINEr9r
rbrxryrvr�)rZ
strip_crlfr;rrr�_getline�s
z_NNTPBase._getlinecCsl|��}|jrtdt|��|�|j|j�}|dd�}|dkrHt|��|dkrXt|��|dkrht	|��|S)z�Internal: get a response from the server.
        Raise various errors if the response indicates an error.
        Returns a unicode string.z*resp*Nr3�4�5Z123)
r�rbrxryr-r�r�rrr	)rr��crrrrc�sz_NNTPBase._getrespcCs�d}z�t|ttf�r"t|d�}}|��}|dd�tkrBt|��g}|dk	r�dtdf}|�	d�}||krnq�|�
d�r�|dd�}|�|�qZn8d}|�	�}||kr�q�|�
d�r�|dd�}|�|�q�W5|r�|��X||fS)	aPInternal: get a response plus following text from the server.
        Raise various errors if the response indicates an error.

        Returns a (response, lines) tuple where `response` is a unicode
        string and `lines` is a list of bytes objects.
        If `file` is a file-like object, it must be open in binary mode.
        N�wb��.s.
Fs..r3)
�closer+�strr�openrc�	_LONGRESPrr�r�rEr�r,)rraZ
openedFiler�rZterminatorsr;�
terminatorrrr�_getlongresp�s4	



z_NNTPBase._getlongrespcCs|�|�|��S)zWInternal: send a command and get the response.
        Same return value as _getresp().)r�rcr�rrr�	_shortcmd�s
z_NNTPBase._shortcmdcCs|�|�|�|�S)zoInternal: send a command and get the response plus following text.
        Same return value as _getlongresp().�r�r�)rr;rarrr�_longcmds
z_NNTPBase._longcmdcs.��|���|�\}}|�fdd�|D�fS)z�Internal: send a command and get the response plus following text.
        Same as _longcmd() and _getlongresp(), except that the returned `lines`
        are unicode strings rather than bytes objects.
        csg|]}|��j�j��qSr)r-r�r���.0r;rnrr�
<listcomp>s�z,_NNTPBase._longcmdstring.<locals>.<listcomp>r�)rr;rar��listrrnr�_longcmdstring	s

�z_NNTPBase._longcmdstringcCsdz|jWStk
rYnXz|�d�\}}Wn tk
rPtdd�}Yn
Xt|�}||_|S)zqInternal: get the overview format. Queries the server if not
        already done, else returns the cached value.zLIST OVERVIEW.FMTN)Z_cachedoverviewfmt�AttributeErrorr�rr8r@)rr�rr:rrr�_getoverviewfmtsz_NNTPBase._getoverviewfmtcCsdd�|D�S)NcSsg|]}t|����qSr)r!rBr�rrrr�&sz(_NNTPBase._grouplist.<locals>.<listcomp>r)rrrrr�
_grouplist$sz_NNTPBase._grouplistcCs8i}|�d�\}}|D]}|��^}}|||<q||fS)a!Process a CAPABILITIES command.  Not supported by all servers.
        Return:
        - resp: server response if successful
        - caps: a dictionary mapping capability names to lists of tokens
        (for example {'VERSION': ['2'], 'OVER': [], LIST: ['ACTIVE', 'HEADERS'] })
        ZCAPABILITIES)r�rB)rr�r�rr;r<rFrrrr}(s
z_NNTPBase.capabilities)racCsbt|tjtjf�s$td�|jj���t||jdk�\}}d�||�}|�	||�\}}||�
|�fS)z�Process a NEWGROUPS command.  Arguments:
        - date: a date or datetime object
        Return:
        - resp: server response if successful
        - list: list of newsgroup names
        �Athe date parameter must be a date or datetime object, not '{:40}'rKzNEWGROUPS {0} {1})r+rQr�	TypeErrorrV�	__class__rrXr|r�r�)rrrarRrS�cmdr�rrrr�	newgroups6s��z_NNTPBase.newgroupscCsRt|tjtjf�s$td�|jj���t||jdk�\}}d�|||�}|�	||�S)z�Process a NEWNEWS command.  Arguments:
        - group: group name or '*'
        - date: a date or datetime object
        Return:
        - resp: server response if successful
        - list: list of message ids
        r�rKzNEWNEWS {0} {1} {2})
r+rQrr�rVr�rrXr|r�)rr"rrarRrSr�rrr�newnewsFs��z_NNTPBase.newnewscCs4|dk	rd|}nd}|�||�\}}||�|�fS)a@Process a LIST or LIST ACTIVE command. Arguments:
        - group_pattern: a pattern indicating which groups to query
        - file: Filename string or file object to store the result in
        Returns:
        - resp: server response if successful
        - list: list of (group, last, first, flag) (strings)
        NzLIST ACTIVE ZLIST)r�r�)r�
group_patternra�commandr�rrrrr�Vs

z_NNTPBase.listcCs�t�d�}|�d|�\}}|�d�s8|�d|�\}}i}|D]:}|�|���}|r@|�dd�\}	}
|sr|
S|
||	<q@|r�||fSdSdS)Nz^(?P<group>[^ 	]+)[ 	]+(.*)$zLIST NEWSGROUPS r�XGTITLE r3rKr))�re�compiler�rE�search�stripr")rr�Z
return_all�line_patr�r�groups�raw_line�matchr<Zdescrrr�_getdescriptionses


z_NNTPBase._getdescriptionscCs|�|d�S)a�Get a description for a single group.  If more than one
        group matches ('group' is a pattern), return the first.  If no
        group matches, return an empty string.

        This elides the response code from the server, since it can
        only be '215' or '285' (for xgtitle) anyway.  If the response
        code is needed, use the 'descriptions' method.

        NOTE: This neither checks for a wildcard in 'group' nor does
        it check whether the group actually exists.F�r�)rr"rrr�description|sz_NNTPBase.descriptioncCs|�|d�S)z'Get descriptions for a range of groups.Tr�)rr�rrr�descriptions�sz_NNTPBase.descriptionscCs�|�d|�}|�d�s t|��|��}d}}}t|�}|dkr�|d}|dkr�|d}|dkr�|d}|dkr�|d��}|t|�t|�t|�|fS)aProcess a GROUP command.  Argument:
        - group: the group name
        Returns:
        - resp: server response if successful
        - count: number of articles
        - first: first article number
        - last: last article number
        - name: the group name
        zGROUP rrr3rKr�rL)r�rErrBr9r5rC)rr<r��words�countr$r#�nrrrr"�s

z_NNTPBase.groupcCs|�d|�S)aProcess a HELP command. Argument:
        - file: Filename string or file object to store the result in
        Returns:
        - resp: server response if successful
        - list: list of strings returned by the server in response to the
                HELP command
        ZHELP)r�)rrarrr�help�sz_NNTPBase.helpcCs8|�d�st|��|��}t|d�}|d}|||fS)z_Internal: parse the response line of a STAT, NEXT, LAST,
        ARTICLE, HEAD or BODY command.Z22r3rK)rErrBrC)rr�r��art_numr'rrr�
_statparse�s
z_NNTPBase._statparsecCs|�|�}|�|�S)z/Internal: process a STAT, NEXT or LAST command.)r�r�)rr;r�rrr�_statcmd�s
z_NNTPBase._statcmdcCs"|r|�d�|��S|�d�SdS)a(Process a STAT command.  Argument:
        - message_spec: article number or message id (if not specified,
          the current article is selected)
        Returns:
        - resp: server response if successful
        - art_num: the article number
        - message_id: the message id
        zSTAT {0}ZSTATN)r�rV)r�message_specrrr�stat�s	z_NNTPBase.statcCs
|�d�S)z;Process a NEXT command.  No arguments.  Return as for STAT.ZNEXT�r�rnrrr�next�sz_NNTPBase.nextcCs
|�d�S)z;Process a LAST command.  No arguments.  Return as for STAT.ZLASTr�rnrrrr#�sz_NNTPBase.lastcCs0|�||�\}}|�|�\}}}|t|||�fS)z2Internal: process a HEAD, BODY or ARTICLE command.)r�r�r&)rr;rar�rr�r'rrr�_artcmd�sz_NNTPBase._artcmdcCs$|dk	rd�|�}nd}|�||�S)a0Process a HEAD command.  Argument:
        - message_spec: article number or message id
        - file: filename string or file object to store the headers in
        Returns:
        - resp: server response if successful
        - ArticleInfo: (article number, message id, list of header lines)
        NzHEAD {0}ZHEAD�rVr��rr�rar�rrr�head�sz_NNTPBase.headcCs$|dk	rd�|�}nd}|�||�S)a+Process a BODY command.  Argument:
        - message_spec: article number or message id
        - file: filename string or file object to store the body in
        Returns:
        - resp: server response if successful
        - ArticleInfo: (article number, message id, list of body lines)
        NzBODY {0}ZBODYr�r�rrr�body�sz_NNTPBase.bodycCs$|dk	rd�|�}nd}|�||�S)a5Process an ARTICLE command.  Argument:
        - message_spec: article number or message id
        - file: filename string or file object to store the article in
        Returns:
        - resp: server response if successful
        - ArticleInfo: (article number, message id, list of article lines)
        NzARTICLE {0}ZARTICLEr�r�rrr�article�sz_NNTPBase.articlecCs
|�d�S)zYProcess a SLAVE command.  Returns:
        - resp: server response if successful
        ZSLAVE)r�rnrrr�slavesz_NNTPBase.slavecsDt�d��|�d�||�|�\}}�fdd��|�fdd�|D�fS)aiProcess an XHDR command (optional server extension).  Arguments:
        - hdr: the header type (e.g. 'subject')
        - str: an article nr, a message id, or a range nr1-nr2
        - file: Filename string or file object to store the result in
        Returns:
        - resp: server response if successful
        - list: list of (nr, value) strings
        z^([0-9]+) ?(.*)
?zXHDR {0} {1}cs��|�}|r|�dd�S|S)Nr3rK)r�r")r;�m)�patrr�
remove_numbers
z%_NNTPBase.xhdr.<locals>.remove_numbercsg|]}�|��qSrrr�)r�rrr�sz"_NNTPBase.xhdr.<locals>.<listcomp>)r�r�r�rV)rZhdrr�rar�rr)r�r�r�xhdrs	
z_NNTPBase.xhdrcCs.|�d�||�|�\}}|��}|t||�fS)aFProcess an XOVER command (optional server extension) Arguments:
        - start: start of range
        - end: end of range
        - file: Filename string or file object to store the result in
        Returns:
        - resp: server response if successful
        - list: list of dicts containing the response fields
        z
XOVER {0}-{1})r�rVr�rJ)r�start�endrar�rr:rrr�xovers
	�z_NNTPBase.xoverc	Csxd|jkrdnd}t|ttf�r>|\}}|d�||p6d�7}n|dk	rR|d|}|�||�\}}|��}|t||�fS)a�Process an OVER command.  If the command isn't supported, fall
        back to XOVER. Arguments:
        - message_spec:
            - either a message id, indicating the article to fetch
              information about
            - or a (start, end) tuple, indicating a range of article numbers;
              if end is None, information up to the newest message will be
              retrieved
            - or None, indicating the current article number must be used
        - file: Filename string or file object to store the result in
        Returns:
        - resp: server response if successful
        - list: list of dicts containing the response fields

        NOTE: the "message id" form isn't supported by XOVER
        ZOVERZXOVERz {0}-{1}r)Nr{)rer+�tupler�rVr�r�rJ)	rr�rar�r�r�r�rr:rrr�over*sz_NNTPBase.overc	Csft�dtd�t�d�}|�d||�\}}g}|D](}|�|���}|r4|�|�	dd��q4||fS)z�Process an XGTITLE command (optional server extension) Arguments:
        - group: group name wildcard (i.e. news.*)
        Returns:
        - resp: server response if successful
        - list: list of (name,title) stringszFThe XGTITLE extension is not actively used, use descriptions() insteadrKz^([^ 	]+)[ 	]+(.*)$r�r3)
�warnings�warn�DeprecationWarningr�r�r�r�r�r,r")	rr"rar�r�Z	raw_linesrr�r�rrr�xgtitleEs�
z_NNTPBase.xgtitlecCslt�dtd�|�d�|��}|�d�s0t|��z|��\}}Wntk
r^t|�d�Yn
X||fSdS)z�Process an XPATH command (optional server extension) Arguments:
        - id: Message id of article
        Returns:
        resp: server response if successful
        path: directory path to article
        z(The XPATH extension is not actively usedrKz	XPATH {0}Z223N)	r�r�r�r�rVrErrB�
ValueError)r�idr�Zresp_num�pathrrr�xpathWs�
z_NNTPBase.xpathcCsb|�d�}|�d�st|��|��}t|�dkr8t|��|d}t|�dkrTt|��|t|d�fS)z�Process the DATE command.
        Returns:
        - resp: server response if successful
        - date: datetime object
        ZDATEZ111rKr3�N)r�rErrBr9r
rU)rr��elemrrrrrks

z_NNTPBase.datecCs�|�|�}|�d�st|��t|ttf�r2|��}|D]:}|�t�sR|�	d�t}|�d�rdd|}|j
�|�q6|j
�d�|j
��|�
�S)N�3r r�s.
)r�rErr+r�	bytearray�
splitlines�endswithr��rstriprar�r�rc)rr��fr�r;rrr�_post|s




z_NNTPBase._postcCs|�d|�S)z�Process a POST command.  Arguments:
        - data: bytes object, iterable or file containing the article
        Returns:
        - resp: server response if successfulZPOST)r�)r�datarrr�post�sz_NNTPBase.postcCs|�d�|�|�S)aProcess an IHAVE command.  Arguments:
        - message_id: message-id of the article
        - data: file containing the article
        Returns:
        - resp: server response if successful
        Note that if the server refuses the article an exception is raised.z	IHAVE {0})r�rV)rr'r�rrr�ihave�sz_NNTPBase.ihavecCs|j��|`dSrm)rar�rnrrrrs�s
z_NNTPBase._closecCsz|�d�}W5|��X|S)zdProcess a QUIT command and close the socket.  Returns:
        - resp: server response if successfulZQUIT)rsr�)rr�rrrrt�s
z_NNTPBase.quitcCs�|jrtd��|s|std��z<|rX|sXddl}|��}|�|j�}|rX|d}|d}Wntk
rnYnX|sxdS|�d|�}|�d�r�|s�t|��n |�d|�}|�d�s�t	|��d|_
|��|jr�d	|j
kr�|�
�d|_
|��dS)
NzAlready logged in.z7At least one of `user` and `usenetrc` must be specifiedrrKzauthinfo user Z381zauthinfo pass Z281r_)rjr��netrcZauthenticatorsr`rur�rErrrerfrgrh)r�user�password�usenetrcr�ZcredentialsZauthr�rrr�login�s>�


z_NNTPBase.loginc
Cs`z|�d�|_WnJtk
r$Yn8tk
rZ}z|j�d�rHd|_n�W5d}~XYnXdS)Nzmode readerZ480T)r�rdrrr
rErg)r�errrrh�sz_NNTPBase._setreadermodecCs||jrtd��|jrtd��|�d�}|�d�rp|j��t|j||j	�|_|j�
d�|_d|_d|_|��nt
d��dS)	zzProcess a STARTTLS command. Arguments:
            - context: SSL context to use for the encrypted connection
            zTLS is already enabled.z+TLS cannot be started after authentication.�STARTTLSZ382�rwbTNzTLS failed to start.)rir�rjr�rErar�r\rZr`�makefilererfr)rr[r�rrr�starttls�s



z_NNTPBase.starttls)T)N)N)N)N)N)N)N)N)N)NNT)N)9rrrr�r�rrrorwrzrfr��debugr�r�r�rcr�r�r�r�r�r�r}r�r�r�r�r�r�r"r�r�r�r�r�r#r�r�r�r�r�r�r�r�r�r�rr�r�r�rsrtr�rh�	_have_sslr�rrrrr])sn
�
/		

.







		
)
r]c@s*eZdZeddddefdd�Zdd�ZdS)rNFc	Cs�||_||_t�d|||�t�||f|�|_d}z8|j�d�}t�	|||||�|sZ|rh|�
|||�Wn$|r~|��|j���YnXdS)a,Initialize an instance.  Arguments:
        - host: hostname to connect to
        - port: port to connect to (default the standard NNTP port)
        - user: username to authenticate with
        - password: password to use with username
        - readermode: if true, send 'mode reader' command after
                      connecting.
        - usenetrc: allow loading username and password from ~/.netrc file
                    if not specified explicitly
        - timeout: timeout (in seconds) used for socket connections

        readermode is sometimes necessary if you are connecting to an
        NNTP server on the local machine and intend to call
        reader-specific commands, such as `group'.  If you get
        unexpected NNTPPermanentErrors, you might need to set
        readermode.
        �nntplib.connectNr�)r`�portr�r��socket�create_connectionrZr�r]rr�r�)	rr`r�r�r�rkr�rlrarrrr�s$
�
z
NNTP.__init__cCs zt�|�W5|j��XdSrm�rZr�r]rsrnrrrrs$szNNTP._close)rrr�	NNTP_PORTrrrsrrrrr�s�
%c@s,eZdZedddddefdd�Zdd�ZdS)�NNTP_SSLNFc	
Cs�t�d|||�t�||f|�|_d}	zJt|j||�|_|j�d�}	tj||	|||d�|s`|rn|�	|||�Wn$|	r�|	�
�|j�
��YnXdS)z�This works identically to NNTP.__init__, except for the change
            in default port and the `ssl_context` argument for SSL connections.
            r�Nr�)rkrl)r�r�r�r�rZr\r�r]rr�r�)
rr`r�r�r�Zssl_contextrkr�rlrarrrr.s"
�
zNNTP_SSL.__init__cCs zt�|�W5|j��XdSrmr�rnrrrrsEszNNTP_SSL._close)rrr�
NNTP_SSL_PORTrrrsrrrrr,s�
r�__main__zJ        nntplib built-in demo - display the latest articles in a newsgroup)r�z-gz--groupzgmane.comp.python.generalz3group to fetch messages from (default: %(default)s))�defaultr�z-sz--serverz
news.gmane.ioz+NNTP server hostname (default: %(default)s)z-pz--portr�z#NNTP port number (default: %s / %s))r�typer�z-nz
--nb-articles�
z2number of articles to fetch (default: %(default)s)z-Sz--ssl�
store_truezuse NNTP over SSL)�actionrr�)r`r�r�ZGroupZhaszarticles, range�tocCs$t|�|kr |d|d�d}|S)NrLz...)r9)�sZlimrrr�cutpsr
r3�<z{:7} {:20} {:42} ({})��*)N)N)F)Krr�r��collectionsrQr�r�rY�ImportErrorr�Zemail.headerrr*r�__all__r�rrrrrr	r
r�rr�r8r6r��
namedtupler!r&r@rJrUrXr\r]rrr,r�argparse�ArgumentParser�parser�add_argumentrC�
parse_argsrr�Zserverr	rfr�r�r"r�r�r$r#r<rxr
r�Znb_articlesr�Z	overviewsZartnumr�rBZauthorrrrVrtrrrr�<module>s�A
�
	���
��


Y.


�
�
���


�
__pycache__/asyncore.cpython-38.opt-2.pyc000064400000034752151153537570014216 0ustar00U

e5d~N�@sdddlZddlZddlZddlZddlZddlZddlmZmZm	Z	m
Z
mZmZm
Z
mZmZmZmZmZmZee
ee
eeeh�ZzeWnek
r�iZYnXdd�ZGdd�de�ZeeefZdd�Zd	d
�Zdd�Z d
d�Z!d%dd�Z"d&dd�Z#e#Z$d'dd�Z%Gdd�d�Z&Gdd�de&�Z'dd�Z(d(dd�Z)ej*d k�r`Gd!d"�d"�Z+Gd#d$�d$e&�Z,dS))�N)
�EALREADY�EINPROGRESS�EWOULDBLOCK�
ECONNRESET�EINVAL�ENOTCONN�	ESHUTDOWN�EISCONN�EBADF�ECONNABORTED�EPIPE�EAGAIN�	errorcodec
CsHzt�|�WStttfk
rB|tkr6t|YSd|YSXdS)NzUnknown error %s)�os�strerror�
ValueError�
OverflowError�	NameErrorr)�err�r� /usr/lib64/python3.8/asyncore.py�	_strerrorDsrc@seZdZdS)�ExitNowN)�__name__�
__module__�__qualname__rrrrrLsrcCs:z|��Wn(tk
r"�Yn|��YnXdS�N)�handle_read_event�_reraised_exceptions�handle_error��objrrr�readQsr"cCs:z|��Wn(tk
r"�Yn|��YnXdSr)�handle_write_eventrrr rrr�writeYsr$cCs:z|��Wn(tk
r"�Yn|��YnXdSr)�handle_expt_eventrrr rrr�
_exceptionasr&c
Cs�zX|tj@r|��|tj@r&|��|tj@r8|��|tjtjBtj	B@rV|�
�Wnhtk
r�}z$|jdt
kr�|��n|�
�W5d}~XYn(tk
r��Yn|��YnXdS�Nr)�select�POLLINr�POLLOUTr#�POLLPRIr%ZPOLLHUPZPOLLERRZPOLLNVAL�handle_close�OSError�args�
_DISCONNECTEDrr)r!�flags�errr�	readwriteis"



r2�c	Cs<|dkrt}|�r8g}g}g}t|���D]L\}}|��}|��}|rP|�|�|rd|jsd|�|�|sl|r*|�|�q*g|kr�|kr�|kr�nnt�|�dSt	�	||||�\}}}|D] }|�
|�}|dkr�q�t|�q�|D]"}|�
|�}|dk�rq�t|�q�|D]&}|�
|�}|dk�r,�qt
|��qdSr)�
socket_map�list�items�readable�writable�append�	accepting�time�sleepr(�getr"r$r&)	�timeout�map�r�wr1�fdr!Zis_rZis_wrrr�poll}sD


"







rCcCs�|dkrt}|dk	r t|d�}t��}|r�t|���D]L\}}d}|��r\|tjtjBO}|�	�rt|j
st|tjO}|r8|�||�q8|�|�}|D]&\}}|�
|�}|dkr�q�t||�q�dS)Ni�r)r4�intr(rCr5r6r7r)r+r8r:r*�registerr=r2)r>r?ZpollsterrBr!r0r@rrr�poll2�s(


rF�>@FcCsb|dkrt}|r ttd�r t}nt}|dkr>|r^|||�q,n |r^|dkr^|||�|d}q>dS)NrCr�)r4�hasattrr(rFrC)r>Zuse_pollr?�countZpoll_funrrr�loop�s
rKc@s2eZdZdZdZdZdZdZdZe	dh�Z
dAdd�Zdd�ZdBdd	�Z
dCd
d�Zejejfdd
�ZdDdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�ZdEd'd(�Zd)d*�Z d+d,�Z!d-d.�Z"d/d0�Z#d1d2�Z$d3d4�Z%d5d6�Z&d7d8�Z'd9d:�Z(d;d<�Z)d=d>�Z*d?d@�Z+dS)F�
dispatcherFN�warningc
Cs�|dkrt|_n||_d|_|r�|�d�|�||�d|_z|��|_Wq�tk
r�}z*|j	dt
tfkrvd|_n|�|��W5d}~XYq�Xnd|_
dS�NrTF)r4�_map�_fileno�setblocking�
set_socket�	connectedZgetpeername�addrr-r.rr�del_channel�socket)�self�sockr?rrrr�__init__�s 

zdispatcher.__init__cCs�|jjd|jjg}|jr.|jr.|�d�n|jr>|�d�|jdk	r�z|�d|j�Wn$tk
r�|�t|j��YnXdd�	|�t
|�fS)N�.Z	listeningrSz%s:%dz<%s at %#x>� )�	__class__rrr:rTr9rS�	TypeError�repr�join�id)rWZstatusrrr�__repr__�s

zdispatcher.__repr__cCs|dkr|j}|||j<dSr)rOrP)rWr?rrr�add_channel	szdispatcher.add_channelcCs,|j}|dkr|j}||kr"||=d|_dSr)rPrO)rWr?rBrrrrUszdispatcher.del_channelcCs.||f|_t�||�}|�d�|�|�dSr')Zfamily_and_typerVrQrR)rWZfamily�typerXrrr�
create_sockets

zdispatcher.create_socketcCs||_|��|_|�|�dSr)rV�filenorPrb�rWrXr?rrrrRs
zdispatcher.set_socketcCsDz*|j�tjtj|j�tjtj�dB�Wntk
r>YnXdS)NrH)rVZ
setsockopt�
SOL_SOCKETZSO_REUSEADDR�
getsockoptr-�rWrrr�set_reuse_addr#s
���zdispatcher.set_reuse_addrcCsdS�NTrrirrrr74szdispatcher.readablecCsdSrkrrirrrr87szdispatcher.writablecCs(d|_tjdkr|dkrd}|j�|�S)NT�nt�)r:r�namerV�listen)rWZnumrrrro>szdispatcher.listencCs||_|j�|�Sr)rTrV�bind)rWrTrrrrpDszdispatcher.bindcCspd|_d|_|j�|�}|tttfks8|tkrBtj	dkrB||_
dS|dtfkr^||_
|��nt
|t|��dS)NFTrlr)rS�
connectingrVZ
connect_exrrrrrrnrTr	�handle_connect_eventr-r)rWZaddressrrrr�connectHs��
zdispatcher.connectc
Csvz|j��\}}WnVtk
r(YdStk
rh}z$|jdtttfkrVWY�
dS�W5d}~XYn
X||fSdSr')rV�acceptr]r-r.rrr
)rWZconnrT�whyrrrrtVs
zdispatcher.acceptc
Cstz|j�|�}|WStk
rn}z>|jdtkr<WY�*dS|jdtkr\|��WY�
dS�W5d}~XYnXdSr')rV�sendr-r.rr/r,)rW�data�resultrurrrrvds

zdispatcher.sendc
Csrz(|j�|�}|s |��WdS|WSWnDtk
rl}z&|jdtkrZ|��WY�
dS�W5d}~XYnXdS)N�r)rV�recvr,r-r.r/)rWZbuffer_sizerwrurrrrzqs

zdispatcher.recvc
Csnd|_d|_d|_|��|jdk	rjz|j��Wn6tk
rh}z|jdtt	fkrX�W5d}~XYnXdS)NFr)
rSr:rqrUrV�closer-r.rr
)rWrurrrr{�s
zdispatcher.closecCstj�dt|��dS)Nzlog: %s
)�sys�stderrr$�str)rW�messagerrr�log�szdispatcher.log�infocCs||jkrtd||f�dS)Nz%s: %s)�ignore_log_types�print)rWrrcrrr�log_info�s
zdispatcher.log_infocCs:|jr|��n&|js.|jr$|��|��n|��dSr)r:�
handle_acceptrSrqrr�handle_readrirrrr�s

zdispatcher.handle_read_eventcCs@|j�tjtj�}|dkr(t|t|���|��d|_d|_dSrN)	rVrhrg�SO_ERRORr-r�handle_connectrSrq�rWrrrrrr�szdispatcher.handle_connect_eventcCs*|jr
dS|js|jr|��|��dSr)r:rSrqrr�handle_writerirrrr#�szdispatcher.handle_write_eventcCs0|j�tjtj�}|dkr$|��n|��dSr')rVrhrgr�r,�handle_exptr�rrrr%�s
zdispatcher.handle_expt_eventcCsXt�\}}}}zt|�}Wndt|�}YnX|�d||||fd�|��dS)Nz)<__repr__(self) failed for object at %0x>z:uncaptured python exception, closing channel %s (%s:%s %s)�error)�compact_tracebackr^r`r�r,)rWZnil�t�v�tbinfoZ	self_reprrrrr�s��	zdispatcher.handle_errorcCs|�dd�dS)Nz!unhandled incoming priority eventrM�r�rirrrr��szdispatcher.handle_exptcCs|�dd�dS)Nzunhandled read eventrMr�rirrrr��szdispatcher.handle_readcCs|�dd�dS)Nzunhandled write eventrMr�rirrrr��szdispatcher.handle_writecCs|�dd�dS)Nzunhandled connect eventrMr�rirrrr��szdispatcher.handle_connectcCs|��}|dk	r|j|�dSr)rt�handle_accepted)rWZpairrrrr��szdispatcher.handle_acceptcCs|��|�dd�dS)Nzunhandled accepted eventrM)r{r�)rWrXrTrrrr��szdispatcher.handle_acceptedcCs|�dd�|��dS)Nzunhandled close eventrM)r�r{rirrrr,�szdispatcher.handle_close)NN)N)N)N)r�),rrr�debugrSr:rq�closingrT�	frozensetr�rYrarbrUrVZAF_INETZSOCK_STREAMrdrRrjr7r8rorprsrtrvrzr{r�r�rrrr#r%rr�r�r�r�r�r�r,rrrrrL�sJ

 

	


rLc@s6eZdZddd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�dispatcher_with_sendNcCst�|||�d|_dS)Nry)rLrY�
out_bufferrfrrrrY�szdispatcher_with_send.__init__cCs.d}t�||jdd��}|j|d�|_dS)Nri)rLrvr�)rWZnum_sentrrr�
initiate_sendsz"dispatcher_with_send.initiate_sendcCs|��dSr)r�rirrrr�sz!dispatcher_with_send.handle_writecCs|jpt|j�Sr)rS�lenr�rirrrr8szdispatcher_with_send.writablecCs0|jr|�dt|��|j||_|��dS)Nz
sending %s)r�r�r^r�r�)rWrwrrrrvszdispatcher_with_send.send)NN)rrrrYr�r�r8rvrrrrr��s

r�cCs�t��\}}}g}|std��|rL|�|jjj|jjjt|j	�f�|j
}q~|d\}}}d�dd�|D��}|||f|||fS)Nztraceback does not exist���r[cSsg|]}d|�qS)z
[%s|%s|%s]r)�.0�xrrr�
<listcomp>&sz%compact_traceback.<locals>.<listcomp>)r|�exc_info�AssertionErrorr9�tb_frame�f_code�co_filename�co_namer~�	tb_lineno�tb_nextr_)r�r��tbr��fileZfunction�liner�rrrr�s�r�cCs�|dkrt}t|���D]n}z|��Wqtk
r`}z|jdtkrJn|sP�W5d}~XYqtk
rt�Yq|s��YqXq|��dSr')	r4r5�valuesr{r-r.r
r�clear)r?Z
ignore_allr�rrr�	close_all)s 
r��posixc@sNeZdZdd�Zdd�Zdd�Zdd�Zdd
d�ZeZeZ	dd
�Z
dd�Zd	S)�file_wrappercCst�|�|_dSr)r�duprB�rWrBrrrrYNszfile_wrapper.__init__cCs*|jdkrtjd|t|d�|��dS)Nrzunclosed file %r)�source)rB�warnings�warn�ResourceWarningr{rirrr�__del__Qs

�zfile_wrapper.__del__cGstj|jf|��Sr)rr"rB�rWr.rrrrzWszfile_wrapper.recvcGstj|jf|��Sr)rr$rBr�rrrrvZszfile_wrapper.sendNcCs(|tjkr|tjkr|sdStd��dS)Nrz-Only asyncore specific behaviour implemented.)rVrgr��NotImplementedError)rW�levelZoptnameZbuflenrrrrh]s
��zfile_wrapper.getsockoptcCs(|jdkrdS|j}d|_t�|�dS)Nrr�)rBrr{r�rrrr{hs

zfile_wrapper.closecCs|jSr)rBrirrrreoszfile_wrapper.fileno)N)rrrrYr�rzrvrhr"r$r{rerrrrr�Is
r�c@seZdZddd�Zdd�ZdS)�file_dispatcherNcCsPt�|d|�d|_z|��}Wntk
r4YnX|�|�t�|d�dS)NTF)rLrYrSre�AttributeError�set_filer�set_blocking)rWrBr?rrrrYts
zfile_dispatcher.__init__cCs"t|�|_|j��|_|��dSr)r�rVrerPrbr�rrrr�s
zfile_dispatcher.set_file)N)rrrrYr�rrrrr�rs
r�)r3N)r3N)rGFNN)NF)-r(rVr|r;r�r�errnorrrrrrrr	r
rrr
rr�r/r4rr�	Exceptionr�KeyboardInterrupt�
SystemExitrr"r$r&r2rCrFZpoll3rKrLr�r�r�rnr�r�rrrr�<module>1sB<�


'

*
)__pycache__/_strptime.cpython-38.pyc000064400000037256151153537570013443 0ustar00U

e5d�b�@s�dZddlZddlZddlZddlmZddlmZddlmZ	ddl
mZm
ZmZddlmZgZdd	�ZGd
d�de�ZGdd
�d
e�Ze�Ze�adZiadd�Zdd�Zddd�Z ddd�Z!ddd�Z"dS)a�Strptime-related classes and functions.

CLASSES:
    LocaleTime -- Discovers and stores locale-specific time information
    TimeRE -- Creates regexes for pattern matching a string of text containing
                time information

FUNCTIONS:
    _getlang -- Figure out what language is being used for the locale
    strptime -- Calculates the time struct represented by the passed-in string

�N)�compile)�
IGNORECASE)�escape)�date�	timedelta�timezone)�
allocate_lockcCst�tj�S�N)�localeZ	getlocale�LC_TIME�rr�!/usr/lib64/python3.8/_strptime.py�_getlangsrc@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�
LocaleTimeakStores and handles locale-specific information related to time.

    ATTRIBUTES:
        f_weekday -- full weekday names (7-item list)
        a_weekday -- abbreviated weekday names (7-item list)
        f_month -- full month names (13-item list; dummy value in [0], which
                    is added by code)
        a_month -- abbreviated month names (13-item list, dummy value in
                    [0], which is added by code)
        am_pm -- AM/PM representation (2-item list)
        LC_date_time -- format string for date/time representation (string)
        LC_date -- format string for date representation (string)
        LC_time -- format string for time representation (string)
        timezone -- daylight- and non-daylight-savings timezone representation
                    (2-item list of sets)
        lang -- Language used by instance (2-item tuple)
    cCsht�|_|��|��|��|��|��t�|jkrDtd��tj	|j	ks\tj
|j
krdtd��dS)a�Set all attributes.

        Order of methods called matters for dependency reasons.

        The locale language is set at the offset and then checked again before
        exiting.  This is to make sure that the attributes were not set with a
        mix of information from more than one locale.  This would most likely
        happen when using threads where one thread calls a locale-dependent
        function while another thread changes the locale while the function in
        the other thread is still running.  Proper coding would call for
        locks to prevent changing the locale while locale-dependent code is
        running.  The check here is done in case someone does not think about
        doing this.

        Only other possible issue is if someone changed the timezone and did
        not call tz.tzset .  That is an issue for the programmer, though,
        since changing the timezone is worthless without that call.

        z$locale changed during initializationz&timezone changed during initializationN)r�lang�_LocaleTime__calc_weekday�_LocaleTime__calc_month�_LocaleTime__calc_am_pm�_LocaleTime__calc_timezone�_LocaleTime__calc_date_time�
ValueError�time�tzname�daylight)�selfrrr
�__init__1szLocaleTime.__init__cCs4dd�td�D�}dd�td�D�}||_||_dS)NcSsg|]}tj|���qSr)�calendarZday_abbr�lower��.0�irrr
�
<listcomp>Ssz-LocaleTime.__calc_weekday.<locals>.<listcomp>�cSsg|]}tj|���qSr)rZday_namerrrrr
r!Ts)�range�	a_weekday�	f_weekday)rr$r%rrr
Z__calc_weekdayPszLocaleTime.__calc_weekdaycCs4dd�td�D�}dd�td�D�}||_||_dS)NcSsg|]}tj|���qSr)rZ
month_abbrrrrrr
r!Zsz+LocaleTime.__calc_month.<locals>.<listcomp>�
cSsg|]}tj|���qSr)rZ
month_namerrrrr
r![s)r#�a_month�f_month)rr'r(rrr
Z__calc_monthXszLocaleTime.__calc_monthcCsJg}dD]6}t�ddd|ddddd	f	�}|�t�d
|����q||_dS)N)�������,�7��Lr�%p)r�struct_time�append�strftimer�am_pm)rr6�hour�
time_tuplerrr
Z__calc_am_pm_s
zLocaleTime.__calc_am_pmc
CsJt�d�}dddg}t�d|���|d<t�d|���|d<t�d|���|d<d|jdd	f|jd
df|jddf|jd
d
f|jddfdddddddddddg}|�	dd�|j
D��dD]d\}}||}|D]\}}|r�|�||�}q�t�d�}dt�||�k�rd}	nd }	|�d!|	�||<q�|d|_|d|_
|d|_dS)"N)	r+r,r-r*r.r/r0r1r�%cr�%xr)�%Xr0)�%z%%z%Ar,z%Bz%az%br2)Z1999z%Y)Z99z%y)Z22z%H)Z44z%M)Z55z%S)Z76z%j)Z17z%d)Z03�%m)�3r=)�2z%w)Z10z%IcSsg|]}|D]}|df�qqS)z%Zr)r�	tz_values�tzrrr
r!�s�z/LocaleTime.__calc_date_time.<locals>.<listcomp>))rr9)r)r:)r0r;)	r+r)r,r)r)r)�r,rZ00z%Wz%UZ11)rr3r5rr%r(r$r'r6�extendr�replace�LC_date_time�LC_date�LC_time)
rr8Z	date_timeZreplacement_pairs�offset�	directiveZcurrent_format�old�newZU_Wrrr
Z__calc_date_timeksH

�


zLocaleTime.__calc_date_timecCszzt��Wntk
r YnXtj|_tj|_tdd|jd��h�}|jrft|jd��h�}nt�}||f|_dS)N�utc�gmtrr))r�tzset�AttributeErrorrr�	frozensetrr)rZ	no_savingZ
has_savingrrr
Z__calc_timezone�szLocaleTime.__calc_timezoneN)
�__name__�
__module__�__qualname__�__doc__rrrrrrrrrr
rs-rcs:eZdZdZd�fdd�	Zdd�Zdd�Zd	d
�Z�ZS)�TimeREz4Handle conversion from format directives to regexes.Ncs|r||_nt�|_t�}|�ddddddddd	d
ddd
ddd|�|jjd�|�|jjd�|�|jjdd�d�|�|jjdd�d�|�|jj	d�|�dd�|jj
D�d�dd��|�d|�d��
dd��|�d|�|jj��|�d |�|jj��|�d!|�|jj��dS)"z^Create keys/values.

        Order of execution is important for dependency reasons.

        z)(?P<d>3[0-1]|[1-2]\d|0[1-9]|[1-9]| [1-9])z(?P<f>[0-9]{1,6})z(?P<H>2[0-3]|[0-1]\d|\d)z(?P<I>1[0-2]|0[1-9]|[1-9])z(?P<G>\d\d\d\d)zG(?P<j>36[0-6]|3[0-5]\d|[1-2]\d\d|0[1-9]\d|00[1-9]|[1-9]\d|0[1-9]|[1-9])z(?P<m>1[0-2]|0[1-9]|[1-9])z(?P<M>[0-5]\d|\d)z(?P<S>6[0-1]|[0-5]\d|\d)z(?P<U>5[0-3]|[0-4]\d|\d)z(?P<w>[0-6])z(?P<u>[1-7])z(?P<V>5[0-3]|0[1-9]|[1-4]\d|\d)z(?P<y>\d\d)z(?P<Y>\d\d\d\d)z2(?P<z>[+-]\d\d:?[0-5]\d(:?[0-5]\d(\.\d{1,6})?)?|Z)�A�ar)N�B�b�pcss|]}|D]
}|Vq
qdSr	r)rZtz_namesrArrr
�	<genexpr>�s�z"TimeRE.__init__.<locals>.<genexpr>�Zr<)�d�f�H�I�G�j�m�M�S�U�w�u�V�y�Y�zrVrWrXrYrZr\r<�Wrf�c�x�X)�locale_timer�superr�_TimeRE__seqToREr%r$r(r'r6r�__setitem__�__getitem__rD�patternrErFrG)rrq�base��	__class__rr
r�sF��zTimeRE.__init__cCsPt|tdd�}|D]}|dkrq(qdSd�dd�|D��}d||f}d|S)	aeConvert a list to a regex string for matching a directive.

        Want possible matching values to be from longest to shortest.  This
        prevents the possibility of a match occurring for a value that also
        a substring of a larger value that should have matched (e.g., 'abc'
        matching when 'abcdef' should have been the match).

        T)�key�reverse��|css|]}t|�VqdSr	)�	re_escape)rZstuffrrr
r[�sz#TimeRE.__seqToRE.<locals>.<genexpr>z	(?P<%s>%sz%s))�sorted�len�join)rZ
to_convertrI�valueZregexrrr
Z	__seqToRE�s	zTimeRE.__seqToREcCs�d}td�}|�d|�}td�}|�d|�}d|krv|�d�d}d||d	|d�|||f}||dd	�}q,d
||fS)z�Return regex pattern for the format string.

        Need to make sure that any characters that might be interpreted as
        regex syntax are escaped.

        r|z([\\.^$*+?\(\){}\[\]|])z\\\1z\s+z\\s+r<r)z%s%s%sNz%s%s)�
re_compile�sub�index)r�formatZprocessed_formatZregex_charsZwhitespace_replacementZdirective_indexrrr
rv�s
�zTimeRE.patterncCst|�|�t�S)z2Return a compiled re object for the format string.)r�rvr)rr�rrr
rszTimeRE.compile)N)	rQrRrSrTrrsrvr�
__classcell__rrrxr
rU�s
.rU�cCslt|dd���}|s,|dd}|dd}d|d}|dkrLd||S|d|d}d||SdS)z�Calculate the Julian day based on the year, week of the year, and day of
    the week, with week_start_day representing whether the week of the year
    assumes the week starts on Sunday or Monday (6 or 0).r)r"rN)�
datetime_date�weekday)�year�week_of_yearZday_of_week�week_starts_MonZ
first_weekdayZ
week_0_lengthZdays_to_weekrrr
�_calc_julian_from_U_or_Wsr�cCsdt|dd���d}|d||}|dkr\|t|dd���7}|d8}|t|dd���8}||fS)z�Calculate the Julian day based on the ISO 8601 year, week, and weekday.
    ISO weeks start on Mondays, with week 01 being the week containing 4 Jan.
    ISO week days range from 1 (Monday) to 7 (Sunday).
    r)�r,r")r�Z
isoweekday�	toordinal)�iso_year�iso_weekZiso_weekdayZ
correctionZordinalrrr
�_calc_julian_from_V%sr��%a %b %d %H:%M:%S %Yc,Cs.t||g�D]*\}}t|t�sd}t|�|t|����qt��tj}t	�|j
kshtj|jkshtj
|j
kr|t�at��tj}tt�tkr�t��t�|�}|�s&zt�|�}Wnntk
r�}z.|jd}|dkr�d}~td||f�d�W5d}~XYn$tk
�rtd|�d�YnX|t|<W5QRX|�|�}	|	�sPtd||f��t|�|	��k�rztd	||	��d���d}
}d
}}
d}}}}d}d}d}d}}d}d}}|	��}|��D�]d}|dk�rt|d�}|d
k�r�|d7}n|d7}�q�|dk�r t|d�}�q�|dk�r:t|d�}
�q�|dk�rTt|d�}�q�|dk�rv|j�|d� ��}�q�|dk�r�|j!�|d� ��}�q�|dk�r�t|d�}
�q�|dk�r�t|d�}�q�|dk�r<t|d�}|�dd�� �}|d|j"dfk�r|dk�r8d}n"||j"d
k�r.|dk�r.|d7}�q�|dk�rVt|d�}�q�|dk�rpt|d�}�q�|dk�r�|d}|ddt|�7}t|�}�q�|d k�r�|j#�|d � ��}�q�|d!k�r�|j$�|d!� ��}�q�|d"k�rt|d"�}|dk�rd}n|d
8}�q�|d#k�r:t|d#�}|d
8}�q�|d$k�rTt|d$�}�q�|d%k�r�t||�}|d&k�rzd}nd}�q�|d'k�r�t|d'�}�q�|d(k�r�|d(}|d)k�r�d}n�|d*d+k�r.|dd*�|d,d�}t|�d-k�r.|d-d+k�rd.|d(��}t|��|dd-�|dd�}t|d
d*��}t|d*d-��} t|d-d/��p`d�}!|d0d0| d0|!}|d1d�}"ddt|"�}#t|"|#�}|�%d2��r.|}|}np|d)k�r�|d)� �}$t|j&�D]N\}%}&|$|&k�r�tjdtjd
k�r tj
�r |$d3k�r �q�n
|%}�qʐqސq�|dk�rv|
dk	�rv|dk�sZ|dk�rbtd4��|dk	�r�td5��n0|dk�r�|dk	�r�|dk�r�td6��ntd7��d8}'|dk�r�|d9k�r�|
d:k�r�d;}d<}'n|dk�r�d}|dk�r�|dk	�r�|dk	�r |dk�rd<nd8}(t'||||(�}n(|
dk	�rH|dk	�rHt(|
||d
�\}}|dk	�r�|dk�r�|d
8}t)�*|��rtd=nd>})||)7}|dk�r�t+|||
��,�t+|d
d
��,�d
}n0t+�-|d
t+|d
d
��,��}*|*j.}|*j/}|*j0}
|dk�r�t+|||
��1�}|�d)�}+|'�rd}|||
|||||||+|f||fS)?z�Return a 2-tuple consisting of a time struct and an int containing
    the number of microseconds based on the input string and the
    format string.z*strptime() argument {} must be str, not {}r�\r<z&'%s' is a bad directive in format '%s'Nzstray %% in format '%s'z%time data %r does not match format %rzunconverted data remains: %sr)���rj�Di�ilrkrarcrXrYr]r_r`rZr|�rdrer^�0rBrVrWrgrhrb)rfrmrfrirlr\r,�:r�r�zInconsistent use of : in r"�<��-)rLrMzzISO year directive '%G' must be used with the ISO week directive '%V' and a weekday directive ('%A', '%a', '%w', or '%u').z`Day of the year directive '%j' is not compatible with ISO year directive '%G'. Use '%Y' instead.zzISO week directive '%V' must be used with the ISO year directive '%G' and a weekday directive ('%A', '%a', '%w', or '%u').zdISO week directive '%V' is incompatible with the year directive '%Y'. Use the ISO year '%G' instead.Fr0�ipTinim)2�	enumerate�
isinstance�str�	TypeErrorr��type�_cache_lock�
_TimeRE_cacherqrrrrrrU�_regex_cache�clearr��_CACHE_MAX_SIZE�getr�KeyError�argsr�
IndexError�match�end�	groupdict�keys�intr(r�rr'r6r%r$�
startswithrr�r�rZisleapr�r�Zfromordinalr��month�dayr�),�data_stringr�r��arg�msgrqZformat_regex�errZ
bad_directive�foundr�r�r�r�r7Zminute�second�fractionrA�gmtoff�gmtoff_fractionr�r�Zweek_of_year_startr�ZjulianZ
found_dictZ	group_keyZampm�srlZhoursZminutes�secondsZgmtoff_remainderZgmtoff_remainder_paddingZ
found_zoner�r@Z
leap_year_fixr�ZydayZdatetime_resultrrrr
�	_strptime5s�

�
�

��
��




























��





�
����

��r�cCs"t||�d}t�|dtj��S)zIReturn a time struct based on the input string and the
    format string.rN)r�rr3�_STRUCT_TM_ITEMS)r�r��ttrrr
�_strptime_time/sr�cCspt||�\}}}|dd�\}}|dd�|f}|dk	rht||d�}	|rVt|	|�}
nt|	�}
||
f7}||�S)zPReturn a class cls instance based on the input string and the
    format string.���NrB)r�Zmicroseconds)r��datetime_timedelta�datetime_timezone)�clsr�r�r�r�r�rr�r�ZtzdeltarArrr
�_strptime_datetime5s
r�)r�)r�)r�)#rTrr
r�rerr�rrr~Zdatetimerr�rr�rr��_threadrZ_thread_allocate_lock�__all__r�objectr�dictrUr�r�r�r�r�r�r�r�r�rrrr
�<module>s.
_
{
__pycache__/bdb.cpython-38.opt-2.pyc000064400000037015151153537570013115 0ustar00U

e5d8}�@s�ddlZddlZddlZddlmZmZmZdddgZeeBeBZGdd�de	�Z
Gdd�d�Zdd	�ZGd
d�d�Z
dd�Zd
d�ZGdd�de�Zdd�Zdd�Zdd�ZdS)�N)�CO_GENERATOR�CO_COROUTINE�CO_ASYNC_GENERATOR�BdbQuit�Bdb�
Breakpointc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/bdb.pyr
sc@sreZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd[d%d&�Zd\d'd(�Zd)d*�Zd+d,�Zd-d.�Zd]d/d0�Zd1d2�Zd3d4�Zd^d6d7�Zd8d9�Zd:d;�Zd<d=�Zd>d?�Z d@dA�Z!dBdC�Z"dDdE�Z#dFdG�Z$dHdI�Z%dJdK�Z&dLdM�Z'd_dOdP�Z(d`dQdR�Z)dadSdT�Z*dUdV�Z+dWdX�Z,dYe,_-dS)brNcCs(|rt|�nd|_i|_i|_d|_dS�N)�set�skip�breaks�fncache�frame_returning)�selfrrrr�__init__szBdb.__init__cCsR|d|dd�dkr|S|j�|�}|sNtj�|�}tj�|�}||j|<|S)N�<�����>)r�get�os�path�abspath�normcase)r�filename�canonicrrrr%s
zBdb.canoniccCs&ddl}|��d|_|�dd�dS)Nr)�	linecache�
checkcache�botframe�
_set_stopinfo)rr rrr�reset6sz	Bdb.resetcCs�|jr
dS|dkr|�|�S|dkr0|�||�S|dkrD|�||�S|dkrX|�||�S|dkrf|jS|dkrt|jS|dkr�|jStdt|��|jS)	N�lineZcall�returnZ	exceptionZc_callZc_exceptionZc_returnz*bdb.Bdb.dispatch: unknown debugging event:)�quitting�
dispatch_line�
dispatch_call�dispatch_return�dispatch_exception�trace_dispatch�print�repr)r�frameZevent�argrrrr,=s$
zBdb.trace_dispatchcCs.|�|�s|�|�r(|�|�|jr(t�|jSr
)�	stop_here�
break_here�	user_liner'rr,�rr/rrrr(hs

zBdb.dispatch_linecCsd|jdkr|j|_|jS|�|�s0|�|�s0dS|jrH|jjt@rH|jS|�	||�|j
r^t�|jSr
)r"�f_backr,r1�break_anywhere�	stopframe�f_code�co_flags�GENERATOR_AND_COROUTINE_FLAGS�	user_callr'r�rr/r0rrrr)ts
zBdb.dispatch_callcCs||�|�s||jkrv|jr,|jjt@r,|jSz||_|�||�W5d|_X|j	rVt
�|j|krv|jdkrv|�dd�|jS�Nr)
r1�returnframer7r8r9r:r,r�user_returnr'r�
stoplinenor#r<rrrr*�szBdb.dispatch_returncCs�|�|�rF|jjt@r.|dtkr.|ddks�|�||�|jr�t�nD|jr�||jk	r�|jjjt@r�|dtt	fkr�|�||�|jr�t�|j
S)Nr�)r1r8r9r:�
StopIteration�user_exceptionr'rr7�
GeneratorExitr,r<rrrr+�s$

�
���zBdb.dispatch_exceptioncCs.|dkrdS|jD]}t�||�rdSqdS�NFT)r�fnmatch)rZmodule_name�patternrrr�is_skipped_module�s
zBdb.is_skipped_modulecCsN|jr|�|j�d��rdS||jkr@|jdkr4dS|j|jkS|jsJdSdS)NrFrT)rrH�	f_globalsrr7r@�f_linenor4rrrr1�s�

z
Bdb.stop_herecCs�|�|jj�}||jkrdS|j}||j|krJ|jj}||j|krJdSt|||�\}}|r�|j|_|r�|j	r�|�
t|j��dSdSdSrE)rr8�co_filenamerrJ�co_firstlineno�	effective�numberZ	currentbp�	temporary�do_clear�str)rr/r�lineno�bp�flagrrrr2�s

zBdb.break_herecCstd��dS)Nz)subclass of bdb must implement do_clear())�NotImplementedError)rr0rrrrP�szBdb.do_clearcCs|�|jj�|jkSr
)rr8rKrr4rrrr6�szBdb.break_anywherecCsdSr
r)rr/Z
argument_listrrrr;sz
Bdb.user_callcCsdSr
rr4rrrr3sz
Bdb.user_linecCsdSr
r)rr/Zreturn_valuerrrr?	szBdb.user_returncCsdSr
r)rr/�exc_inforrrrC
szBdb.user_exceptionrcCs||_||_d|_||_dS�NF)r7r>r'r@)rr7r>r@rrrr#szBdb._set_stopinfocCs$|dkr|jd}|�|||�dS)Nr)rJr#)rr/rRrrr�	set_until"s
z
Bdb.set_untilcCs0|jr |jj}|r |js |j|_|�dd�dSr
)rr5�f_tracer,r#)rZcaller_framerrr�set_step*s

zBdb.set_stepcCs|�|d�dSr
)r#r4rrr�set_next6szBdb.set_nextcCs.|jjt@r|�|dd�n|�|j|�dSr=)r8r9r:r#r5r4rrr�
set_return:szBdb.set_returncCsL|dkrt��j}|��|r4|j|_||_|j}q|��t�|j�dSr
)	�sys�	_getframer5r$r,rYr"rZ�settracer4rrr�	set_traceAs
z
Bdb.set_tracecCsH|�|jdd�|jsDt�d�t��j}|rD||jk	rD|`|j}q*dSr=)r#r"rr]r_r^r5rYr4rrr�set_continuePs

zBdb.set_continuecCs"|j|_d|_d|_t�d�dS�NT)r"r7r>r'r]r_�rrrr�set_quit_szBdb.set_quitFc
Csb|�|�}ddl}|�||�}|s.d||fS|j�|g�}||krN|�|�t|||||�}	dS)NrzLine %s:%d does not exist)rr �getliner�
setdefault�appendr)
rrrRrO�cond�funcnamer r%�listrSrrr�	set_breakps

z
Bdb.set_breakcCs4||ftjkr|j|�|�|j|s0|j|=dSr
)r�bplistr�remove�rrrRrrr�
_prune_breaks�s
zBdb._prune_breakscCsj|�|�}||jkrd|S||j|kr6d||fStj||fdd�D]}|��qL|�||�dS)N�There are no breakpoints in %szThere is no breakpoint at %s:%d)rrrrl�deleteMero)rrrRrSrrr�clear_break�s


zBdb.clear_breakc
CsZz|�|�}Wn.tk
r<}zt|�WY�Sd}~XYnX|��|�|j|j�dSr
)�get_bpbynumber�
ValueErrorrQrqro�filer%)rr0rS�errrrr�clear_bpbynumber�szBdb.clear_bpbynumbercCsX|�|�}||jkrd|S|j|D]$}tj||f}|D]}|��q<q&|j|=dS)Nrp)rrrrlrq)rrr%ZblistrSrrr�clear_all_file_breaks�s

zBdb.clear_all_file_breakscCs,|js
dStjD]}|r|��qi|_dS)NzThere are no breakpoints)rr�
bpbynumberrq)rrSrrr�clear_all_breaks�s

zBdb.clear_all_breakscCs�|std��zt|�}Wn"tk
r:td|�d�YnXztj|}Wn"tk
rltd|�d�YnX|dkr�td|��|S)NzBreakpoint number expectedz Non-numeric breakpoint number %sz!Breakpoint number %d out of rangezBreakpoint %d already deleted)rt�intrry�
IndexError)rr0rNrSrrrrs�szBdb.get_bpbynumbercCs"|�|�}||jko ||j|kSr
�rrrnrrr�	get_break�s

�z
Bdb.get_breakcCs4|�|�}||jkr0||j|kr0tj||fp2gSr
)rrrrlrnrrr�
get_breaks�s

���zBdb.get_breakscCs&|�|�}||jkr|j|SgSdSr
r})rrrrr�get_file_breaks�s


zBdb.get_file_breakscCs|jSr
)rrcrrr�get_all_breaks�szBdb.get_all_breakscCs�g}|r|j|kr|j}|dk	rD|�||jf�||jkr<qD|j}q|��tdt|�d�}|dk	r�|�|j|j	f�|j}q^|dkr�tdt|�d�}||fS)Nrr)
�tb_frame�tb_nextrgrJr"r5�reverse�max�len�	tb_lineno)r�f�t�stack�irrr�	get_stack�s 
z
Bdb.get_stack�: cCs�ddl}ddl}|\}}|�|jj�}d||f}|jjrH||jj7}n|d7}|d7}d|jkr�|jd}	|d7}||�|	�7}|�|||j	�}
|
r�|||
�
�7}|S)Nrz%s(%r)z<lambda>z()Z
__return__z->)r �reprlibrr8rK�co_name�f_localsr.rerI�strip)rZframe_linenoZlprefixr r�r/rRr�s�rvr%rrr�format_stack_entrys 	

zBdb.format_stack_entryc	Cs�|dkrddl}|j}|dkr"|}|��t|t�r@t|dd�}t�|j�z*zt
|||�Wntk
rrYnXW5d|_	t�d�XdS)Nrz<string>�execT)�__main__�__dict__r$�
isinstancerQ�compiler]r_r,r'r�r)r�cmd�globals�localsr�rrr�run5s

zBdb.runc	Csz|dkrddl}|j}|dkr"|}|��t�|j�z,zt|||�WW�Stk
r^YnXW5d|_t�d�XdS)NrT)	r�r�r$r]r_r,r'�evalr)r�exprr�r�r�rrr�runevalKs
zBdb.runevalcCs|�|||�dSr
)r�)rr�r�r�rrr�runctx_sz
Bdb.runctxc	Os�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��|��t�|j	�d}z(z|||�}Wntk
r�YnXW5d	|_
t�d�X|S)
NrAz6descriptor 'runcall' of 'Bdb' object needs an argument�funcrz0Passing 'func' as keyword argument is deprecated)�
stacklevelz7runcall expected at least 1 positional argument, got %drT)r��	TypeError�pop�warnings�warn�DeprecationWarningr$r]r_r,r'r)�args�kwdsrr�r��resrrr�runcallfs2

�
�
zBdb.runcallz($self, func, /, *args, **kwds))N)r)N)N)FNN)r�)NN)NN).rr	r
rrr$r,r(r)r*r+rHr1r2rPr6r;r3r?rCr#rXrZr[r\r`rardrkrorrrwrxrzrsr~rr�r�r�r�r�r�r�r��__text_signature__rrrrrsZ
+	


�







cCst���dSr
)rr`rrrrr`�sr`c@sVeZdZdZiZdgZddd�Zdd�Zdd	�Zd
d�Z	ddd
�Z
dd�Zdd�ZdS)rrNFcCs�||_d|_||_||_||_||_d|_d|_d|_t	j
|_t	j
d7_
|j�
|�||f|jkr||j||f�
|�n|g|j||f<dS)NTrr)ri�func_first_executable_linerur%rOrh�enabled�ignore�hitsr�nextrNryrgrl)rrur%rOrhrirrrr�szBreakpoint.__init__cCs>|j|jf}d|j|j<|j|�|�|j|s:|j|=dSr
)rur%ryrNrlrm)r�indexrrrrq�s

zBreakpoint.deleteMecCs
d|_dSrb�r�rcrrr�enable�szBreakpoint.enablecCs
d|_dSrWr�rcrrr�disable�szBreakpoint.disablecCs"|dkrtj}t|��|d�dS)N)ru)r]�stdoutr-�bpformat)r�outrrr�bpprint�szBreakpoint.bpprintcCs�|jrd}nd}|jr |d}n|d}d|j||j|jf}|jrT|d|jf7}|jrj|d|jf7}|jr�|jdkr�d	}nd
}|d|j|f7}|S)Nzdel  zkeep zyes  zno   z%-4dbreakpoint   %s at %s:%dz
	stop only if %sz
	ignore next %d hitsrr��z"
	breakpoint already hit %d time%s)rOr�rNrur%rhr�r�)rZdispZretZssrrrr��s(
�
zBreakpoint.bpformatcCsd|j|j|jfS)Nzbreakpoint %s at %s:%s)rNrur%rcrrr�__str__�szBreakpoint.__str__)FNN)N)
rr	r
r�rlryrrqr�r�r�r�r�rrrrr�s


cCsN|js|j|jkrdSdS|jj|jkr,dS|js:|j|_|j|jkrJdSdSrE)rir%rJr8r�r�)�br/rrr�
checkfuncnamesr�cCs�tj||f}|D]�}|jsqt||�s*q|jd7_|jsh|jdkrZ|jd8_qq�|dfSqzBt|j|j|j	�}|r�|jdkr�|jd8_n|dfWSWq|dfYSXqdS)NrrTF)NN)
rrlr�r�r�rhr�r�rIr�)rur%r/Z	possiblesr��valrrrrM#s*


rMc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�TdbcCs |jj}|sd}td||�dS)N�???z+++ call)r8r�r-)rr/r��namerrrr;Tsz
Tdb.user_callcCsTddl}|jj}|sd}|�|jj�}|�||j|j�}td||j|d|�	��dS)Nrr�z+++�:)
r r8r�rrKrerJrIr-r�)rr/r r��fnr%rrrr3Xsz
Tdb.user_linecCstd|�dS)Nz
+++ return�r-)rr/Zretvalrrrr?_szTdb.user_returncCstd|�|��dS)Nz
+++ exception)r-ra)rr/Z	exc_stuffrrrrCas
zTdb.user_exceptionN)rr	r
r;r3r?rCrrrrr�Ssr�cCs&td|d�t|d�}td|�dS)Nzfoo(�)�
zbar returned)r-�bar)�n�xrrr�fooesr�cCstd|d�|dS)Nzbar(r�rAr�)�arrrr�jsr�cCst�}|�d�dS)Nzimport bdb; bdb.foo(10))r�r�)r�rrr�testnsr�)rFr]r�inspectrrr�__all__r:�	Exceptionrrr`rr�rMr�r�r�r�rrrr�<module>s&
{t"0__pycache__/io.cpython-38.pyc000064400000006600151153537570012031 0ustar00U

e5d�
�@sjdZdZdddddddd	d
ddd
dddddddgZddlZddlZddlmZmZmZmZm	Z	m
Z
mZmZm
Z
mZmZmZmZmZejZde_dZdZdZGdd�dejejd�ZGdd�deje�ZGdd
�d
eje�ZGdd�deje�Z e�!e
�ee
eeefD]Z"e�!e"��qeefD]Z"e �!e"��q ["zdd lm#Z#Wne$k
�rZYnXe�!e#�dS)!a�The io module provides the Python interfaces to stream handling. The
builtin open function is defined in this module.

At the top of the I/O hierarchy is the abstract base class IOBase. It
defines the basic interface to a stream. Note, however, that there is no
separation between reading and writing to streams; implementations are
allowed to raise an OSError if they do not support a given operation.

Extending IOBase is RawIOBase which deals simply with the reading and
writing of raw bytes to a stream. FileIO subclasses RawIOBase to provide
an interface to OS files.

BufferedIOBase deals with buffering on a raw byte stream (RawIOBase). Its
subclasses, BufferedWriter, BufferedReader, and BufferedRWPair buffer
streams that are readable, writable, and both respectively.
BufferedRandom provides a buffered interface to random access
streams. BytesIO is a simple stream of in-memory bytes.

Another IOBase subclass, TextIOBase, deals with the encoding and decoding
of streams into text. TextIOWrapper, which extends it, is a buffered text
interface to a buffered raw stream (`BufferedIOBase`). Finally, StringIO
is an in-memory stream for text.

Argument names are not part of the specification, and only the arguments
of open() are intended to be used as keyword arguments.

data:

DEFAULT_BUFFER_SIZE

   An int containing the default buffer size used by the module's buffered
   I/O classes. open() uses the file's blksize (as obtained by os.stat) if
   possible.
z�Guido van Rossum <guido@python.org>, Mike Verdone <mike.verdone@gmail.com>, Mark Russell <mark.russell@zen.co.uk>, Antoine Pitrou <solipsis@pitrou.net>, Amaury Forgeot d'Arc <amauryfa@gmail.com>, Benjamin Peterson <benjamin@python.org>�BlockingIOError�open�	open_code�IOBase�	RawIOBase�FileIO�BytesIO�StringIO�BufferedIOBase�BufferedReader�BufferedWriter�BufferedRWPair�BufferedRandom�
TextIOBase�
TextIOWrapper�UnsupportedOperation�SEEK_SET�SEEK_CUR�SEEK_END�N)�DEFAULT_BUFFER_SIZErrrrrrrr
rrr
�IncrementalNewlineDecoderr�io��c@seZdZejjZdS)rN)�__name__�
__module__�__qualname__�_io�_IOBase�__doc__�r r �/usr/lib64/python3.8/io.pyrHs)�	metaclassc@seZdZejjZdS)rN)rrrr�
_RawIOBaserr r r r!rKsc@seZdZejjZdS)r	N)rrrr�_BufferedIOBaserr r r r!r	Nsc@seZdZejjZdS)rN)rrrr�_TextIOBaserr r r r!rQs)�_WindowsConsoleIO)%r�
__author__�__all__r�abcrrrrrrrrr
rrr
rr�OpenWrapperrrrrr�ABCMetarr#rr$r	r%r�register�klassr&�ImportErrorr r r r!�<module>sT$
�@
�__pycache__/warnings.cpython-38.opt-2.pyc000064400000025247151153537570014222 0ustar00U

e5d�L�@s�ddlZdddddddd	gZd;d
d�Zd<dd�Zdd
�Zdd�ZeZdd�ZeZdd�Z	de
dddfdd�Ze
ddfdd�Zdd�Z
dd�ZGdd�de�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd=d*d�Zd>d+d�ZGd,d-�d-e�ZGd.d	�d	e�Zd/d0�Zz0dd1lmZmZm Z mZmZm!Z!eZ"e Z#d2Z$Wn2e%k
�rjgZd3Z"iZ#d)a&d4d5�Z!dZ$YnXeej'�e$�s�e(ed6��s�ed3e)d7d)d8�ed9e)d)d:�ed9e*d)d:�ed9e+d)d:�ed9e,d)d:�[$dS)?�N�warn�
warn_explicit�showwarning�
formatwarning�filterwarnings�simplefilter�
resetwarnings�catch_warningscCst||||||�}t|�dS�N)�WarningMessage�_showwarnmsg_impl)�message�category�filename�lineno�file�line�msg�r� /usr/lib64/python3.8/warnings.pyr
scCst||||d|�}t|�Sr
)r�_formatwarnmsg_impl)r
rrrrrrrrrscCsP|j}|dkr tj}|dkr dSt|�}z|�|�Wntk
rJYnXdSr
)r�sys�stderr�_formatwarnmsg�write�OSError)rr�textrrrrsrc		Cs�|jj}|j�d|j�d|�d|j�d�}|jdkrpzddl}|�|j|j�}Wqvtk
rld}d}YqvXn|j}|r�|�	�}|d|7}|j
dk	�r�zddl}Wntk
r�d}d}Yn4X|��}z|�
|j
�}Wntk
r�d}YnX|dk	�r�|d7}|D]t}|d|j|jf7}z$|dk	�rB|�|j|j�}nd}Wntk
�rbd}YnX|�r|�	�}|d	|7}�qn|�s�||�d
�7}|S)N�:z: �
rz  %s
Tz-Object allocated at (most recent call last):
z  File "%s", lineno %s
z    %s
z<: Enable tracemalloc to get the object allocation traceback
)r�__name__rrr
r�	linecache�getline�	Exception�strip�source�tracemalloc�
is_tracing�get_object_traceback)	rr�sr rr%�tracing�tb�framerrrr#sT"




�

rcCsdzt}Wntk
rYn<X|tk	rXt|�s6td��||j|j|j|j|j	|j
�dSt|�dS)Nz:warnings.showwarning() must be set to a function or method)r�	NameError�_showwarning_orig�callable�	TypeErrorr
rrrrrr)r�swrrr�_showwarnmsg`s�r1cCsHzt}Wntk
rYn$X|tk	r@||j|j|j|j|j�St|�Sr
)	rr,�_formatwarning_origr
rrrrr)r�fwrrrrus
�r�FcCsT|s|rddl}|r$|�||j�}nd}|r8|�|�}nd}t||||||d�dS)Nr��append)�re�compile�I�_add_filter)�actionr
r�modulerr6r7rrrr�scCst|d|d||d�dS)Nr5)r:)r;rrr6rrrr�scGsR|s6zt�|�Wntk
r&YnXt�d|�n|tkrHt�|�t�dS)Nr)�filters�remove�
ValueError�insertr6�_filters_mutated)r6�itemrrrr:�s
r:cCsgtdd�<t�dSr
)r=rArrrrr�sc@seZdZdS)�_OptionErrorN)r�
__module__�__qualname__rrrrrC�srCcCsN|D]D}zt|�Wqtk
rF}ztd|tjd�W5d}~XYqXqdS)NzInvalid -W option ignored:)r)�
_setoptionrC�printrr)�args�argrrrr�_processoptions�s
rJc	Cs�|�d�}t|�dkr$td|f��t|�dkr<|�d�q$dd�|D�\}}}}}t|�}t|�}|sl|rtddl}|r�|�|�}|r�|�|�d}|r�zt|�}|dkr�t	�Wq�t	t
fk
r�td	|f�d�Yq�Xnd}t|||||�dS)
Nr�ztoo many fields (max 5): %rr4cSsg|]}|���qSr)r#)�.0r(rrr�
<listcomp>�s�z_setoption.<locals>.<listcomp>rz\Zzinvalid lineno %r)�split�lenrCr6�
_getaction�_getcategoryr7�escape�intr?�
OverflowErrorr)rI�partsr;r
rr<rr7rrrrF�s2
�
rFcCsB|sdS|dkrdSdD]}|�|�r|Sqtd|f��dS)N�default�all�always)rVrX�ignorer<�once�errorzinvalid action: %r)�
startswithrC)r;�arrrrP�s

rPcCs�|stSd|krddl}|}nJ|�d�\}}}zt|dd|g�}Wn$tk
rftd|f�d�YnXzt||�}Wn$tk
r�td|f�d�YnXt|t�s�td|f��|S)N�.rzinvalid module name: %rzunknown warning category: %rzinvalid warning category: %r)	�Warning�builtins�
rpartition�
__import__�ImportErrorrC�getattr�AttributeError�
issubclass)r�m�klassr<�_�catrrrrQ�s"
rQcCs|jj}d|kod|kS)N�	importlib�
_bootstrap)�f_code�co_filename)r+rrrr�_is_internal_framesrocCs"|j}|dk	rt|�r|j}q|Sr
)�f_backro)r+rrr�_next_external_framesrq�c	Cst|t�r|j}|dkrt}t|t�r0t|t�sDtd�t|�j���zV|dks\t	t
�d��rht
�|�}n0t
�d�}t|d�D]}t
|�}|dkr~t�q~Wn"tk
r�t
j}d}d}YnX|j}|jj}|j}d|kr�|d}	nd}	|�di�}
t|||||	|
||�dS)Nz/category must be a Warning subclass, not '{:s}'rrrrz<string>Z__warningregistry__)�
isinstancer_�	__class__�UserWarning�typerfr/�formatrror�	_getframe�rangerqr?�__dict__�	f_globalsrmrn�f_lineno�
setdefaultr)r
r�
stacklevelr$r+�x�globalsrrr<�registryrrrrs>
�



�cCs�t|�}|dkr8|pd}|dd���dkr8|dd�}|dkrDi}|�dd�tkrd|��t|d<t|t�r~t|�}|j}n|}||�}|||f}	|�|	�r�dSt	D]V}
|
\}}}
}}|dks�|�
|�r�t||
�r�|dks�|�
|�r�|dks�||kr��qq�t}|dk�rdSddl
}|�||�|dk�r2|�|dk�rfd	||	<||f}t�|��r\dSd	t|<nf|d
k�rrnZ|dk�r�d	||	<||df}|�|��r�dSd	||<n$|dk�r�d	||	<ntd
||
f��t|||||�}t|�dS)Nz	<unknown>���z.py�versionrrYr[rZrrrXr<rVz1Unrecognized action (%r) in warnings.filters:
 %s)rS�lower�get�_filters_version�clearrsr_�strrtr=�matchrf�
defaultactionr �getlines�onceregistry�RuntimeErrorrr1)r
rrrr<r��module_globalsr$r�keyrBr;rrj�modZlnr ZoncekeyZaltkeyrrrrGs|


�����









��c@s"eZdZdZddd�Zdd�ZdS)r)r
rrrrrr$NcCs>||_||_||_||_||_||_||_|r4|jnd|_dSr
)	r
rrrrrr$r�_category_name)�selfr
rrrrrr$rrr�__init__�szWarningMessage.__init__cCsd|j|j|j|j|jfS)NzD{message : %r, category : %r, filename : %r, lineno : %s, line : %r})r
r�rrr)r�rrr�__str__�s��zWarningMessage.__str__)NNN)rrDrE�_WARNING_DETAILSr�r�rrrrr�s�
rc@s4eZdZddd�dd�Zdd�Zdd	�Zd
d�ZdS)r	FN)�recordr<cCs(||_|dkrtjdn||_d|_dS)N�warningsF)�_recordr�modules�_module�_entered)r�r�r<rrrr��szcatch_warnings.__init__cCsPg}|jr|�d�|jtjdk	r4|�d|j�t|�j}d|d�|�fS)Nzrecord=Truer�z	module=%rz%s(%s)z, )r�r6r�rr�rvr�join)r�rH�namerrr�__repr__�s

zcatch_warnings.__repr__cCs~|jrtd|��d|_|jj|_|jdd�|j_|j��|jj|_|jj|_|j	rvg}|j
|j_|jj|j_|SdSdS)NzCannot enter %r twiceT)r�r�r�r=�_filtersrAr�_showwarningrr�r6r-)r��logrrr�	__enter__�s




zcatch_warnings.__enter__cGs>|jstd|��|j|j_|j��|j|j_|j|j_dS)Nz%Cannot exit %r without entering first)	r�r�r�r�r=rAr�rr)r��exc_inforrr�__exit__�s


zcatch_warnings.__exit__)rrDrEr�r�r�r�rrrrr	�s	cszd�j�d�g}�jdk	rVddl�ddl}��fdd�}|�d�||�t|���7}d�|��d�}t	|t
d	�d
�dS)Nzcoroutine 'z' was never awaited
rc3s4t�j�D]$\}}}��||�}||||fVq
dSr
)�reversed�	cr_originr!)rr�funcnamer��coror rr�extract�sz*_warn_unawaited_coroutine.<locals>.extractz-Coroutine created at (most recent call last)
r4r�)rr~r$)rEr�r �	tracebackr6�format_list�listr��rstripr�RuntimeWarning)r��	msg_linesr�r�rrr�r�_warn_unawaited_coroutine�s�

r�)r=�_defaultaction�
_onceregistryrrrATrVcCstd7adS)Nrr)r�rrrrrAsrAZgettotalrefcount�__main__)rr<r6rY)rr6)NN)N)NrrN)NNNN)-r�__all__rrrrr-r1r2rr_rrr:rr"rCrJrFrPrQrorqrr�objectrr	r��	_warningsr=r�r�rAr�r�Z_warnings_defaultsrcr��warnoptions�hasattr�DeprecationWarning�PendingDeprecationWarning�
ImportWarning�ResourceWarningrrrr�<module>sz�

;
�
#
	
)�
GC 

�__pycache__/site.cpython-38.pyc000064400000041121151153537570012363 0ustar00U

&�.eNU�@s&dZddlZddlZddlZddlZddlZejejgada	da
dadd�Zdd�Z
dd�Zd	d
�Zdd�Zd2d
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd3dd�Zd4dd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Z d-d.�Z!ej"j#�s
e!�d/d0�Z$e%d1k�r"e$�dS)5a�Append module search paths for third-party packages to sys.path.

****************************************************************
* This module is automatically imported during initialization. *
****************************************************************

This will append site-specific paths to the module search path.  On
Unix (including Mac OSX), it starts with sys.prefix and
sys.exec_prefix (if different) and appends
lib/python<version>/site-packages.
On other platforms (such as Windows), it tries each of the
prefixes directly, as well as with lib/site-packages appended.  The
resulting directories, if they exist, are appended to sys.path, and
also inspected for path configuration files.

If a file named "pyvenv.cfg" exists one directory above sys.executable,
sys.prefix and sys.exec_prefix are set to that directory and
it is also checked for site-packages (sys.base_prefix and
sys.base_exec_prefix will always be the "real" prefixes of the Python
installation). If "pyvenv.cfg" (a bootstrap configuration file) contains
the key "include-system-site-packages" set to anything other than "false"
(case-insensitive), the system-level prefixes will still also be
searched for site-packages; otherwise they won't.

All of the resulting site-specific directories, if they exist, are
appended to sys.path, and also inspected for path configuration
files.

A path configuration file is a file whose name has the form
<package>.pth; its contents are additional directories (one per line)
to be added to sys.path.  Non-existing directories (or
non-directories) are never added to sys.path; no directory is added to
sys.path more than once.  Blank lines and lines beginning with
'#' are skipped. Lines starting with 'import' are executed.

For example, suppose sys.prefix and sys.exec_prefix are set to
/usr/local and there is a directory /usr/local/lib/python2.5/site-packages
with three subdirectories, foo, bar and spam, and two path
configuration files, foo.pth and bar.pth.  Assume foo.pth contains the
following:

  # foo package configuration
  foo
  bar
  bletch

and bar.pth contains:

  # bar package configuration
  bar

Then the following directories are added to sys.path, in this order:

  /usr/local/lib/python2.5/site-packages/bar
  /usr/local/lib/python2.5/site-packages/foo

Note that bletch is omitted because it doesn't exist; bar precedes foo
because bar.pth comes alphabetically before foo.pth; and spam is
omitted because it is not mentioned in either path configuration file.

The readline module is also automatically configured to enable
completion for systems that support it.  This can be overridden in
sitecustomize, usercustomize or PYTHONSTARTUP.  Starting Python in
isolated mode (-I) disables automatic readline configuration.

After these operations, an attempt is made to import a module
named sitecustomize, which can perform arbitrary additional
site-specific customizations.  If this import fails with an
ImportError exception, it is silently ignored.
�NcGsBtjj|�}ztj�|�}Wntk
r0YnX|tj�|�fS�N)�os�path�join�abspath�OSError�normcase)�paths�dir�r�/usr/lib64/python3.8/site.py�makepath[sr
cCs�ttj���D]~}tt|dd�dd�dkr,qztj�|j�|_Wnt	t
tfk
rZYnXztj�|j�|_Wqt	t
tfk
r�YqXqdS)zESet all module __file__ and __cached__ attributes to an absolute path�
__loader__N�
__module__)�_frozen_importlib�_frozen_importlib_external)
�set�sys�modules�values�getattrrrr�__file__�AttributeErrorr�	TypeError�
__cached__)�mrrr�	abs_pathsds�rcCsPg}t�}tjD],}t|�\}}||kr|�|�|�|�q|tjdd�<|S)zK Remove duplicate entries from sys.path along with making them
    absoluteN)rrrr
�append�add)�L�known_pathsr
�dircaserrr�removeduppathsts

r"c	CsVt�}tjD]D}z&tj�|�r4t|�\}}|�|�Wqtk
rNYqYqXq|S)zEReturn a set containing all existing file system items from sys.path.)rrrr�existsr
rr)�d�item�_�itemcaserrr�_init_pathinfo�s
r(cCsr|dkrt�}d}nd}tj�||�}zt�t�|��}Wntk
rPYdSX|��t|�D]�\}}|�	d�rvqbzZ|�	d�r�t
|�Wqb|��}t||�\}}	|	|kr�tj�
|�r�tj�|�|�|	�Wqbtk
�rVtd�|d|�tjd�d	dl}
|
jt���D](}|��D]}td
|tjd��q�qtdtjd�Y�qZYqbXqbW5QRX|�rnd}|S)z�Process a .pth file within the site-packages directory:
       For each line in the file, either combine it with sitedir to a path
       and add that to known_paths, or execute it if it starts with 'import '.
    NTF�#)zimport zimport	z"Error processing line {:d} of {}:
�)�filerz  z
Remainder of file ignored)r(rrr�io�
TextIOWrapper�	open_coder�	enumerate�
startswith�exec�rstripr
r#rrr�	Exception�print�format�stderr�	traceback�format_exception�exc_info�
splitlines)�sitedir�namer �reset�fullname�f�n�liner
r!r7�recordrrr�
addpackage�sF

�rCcCs�|dkrt�}d}nd}t|�\}}||krBtj�|�|�|�zt�|�}Wntk
rfYdSXdd�|D�}t	|�D]}t
|||�q~|r�d}|S)zTAdd 'sitedir' argument to sys.path if missing and handle .pth files in
    'sitedir'NTFcSsg|]}|�d�r|�qS)z.pth)�endswith)�.0r<rrr�
<listcomp>�s
zaddsitedir.<locals>.<listcomp>)r(r
rrrrr�listdirr�sortedrC)r;r r=�sitedircase�namesr<rrr�
addsitedir�s$
rKcCs`tjjrdSttd�r4ttd�r4t��t��kr4dSttd�r\ttd�r\t��t��kr\dSdS)a,Check if user site directory is safe for inclusion

    The function tests for the command line flag (including environment var),
    process uid/gid equal to effective uid/gid.

    None: Disabled for security reasons
    False: Disabled by user (command line option)
    True: Safe and enabled
    F�getuid�geteuidN�getgid�getegidT)	r�flags�no_user_site�hasattrrrMrLrOrNrrrr�check_enableusersite�s
rScCsztj�dd�}|r|Sdd�}tjdkrBtj�d�p6d}||d�Stjdkrptjrp|dd	tjd
tjdd��S|dd�S)
N�PYTHONUSERBASEcWstj�tjj|��Sr)rr�
expanduserr)�argsrrr�joinuser�sz_getuserbase.<locals>.joinuser�nt�APPDATA�~�Python�darwin�Libraryz%d.%d�z.local)r�environ�getr<r�platform�
_framework�version_info)�env_baserW�baserrr�_getuserbase�s


�rfcCsdtj}tjdkr,|�d|d�|d�d�StjdkrFtjrF|�d�S|�d|d�d	|d�d
�S)NrXz\Pythonrr*z\site-packagesr\z/lib/python/site-packagesz/lib/python�.z/site-packages)rrcrr<rarb)�userbase�versionrrr�	_get_path
s

rjcCstdkrt�atS)z�Returns the `user base` directory path.

    The `user base` directory can be used to store data. If the global
    variable ``USER_BASE`` is not initialized yet, this function will also set
    it.
    N)�	USER_BASErfrrrr�getuserbasesrlcCst�}tdkrt|�atS)z�Returns the user-specific site-packages directory path.

    If the global variable ``USER_SITE`` is not initialized yet, this
    function will also set it.
    N)rl�	USER_SITErj)rhrrr�getusersitepackages#srncCs$t�}tr tj�|�r t||�|S)z�Add a per user site-package to sys.path

    Each user has its own python directory with site-packages in the
    home directory.
    )rn�ENABLE_USER_SITErr�isdirrK)r �	user_siterrr�addusersitepackages1s
rrcCs�g}t�}|dkrt}|D]�}|r||kr,q|�|�tjdkr�|�tj�|ddtj	dd�d��|�tj�|ddtj
dd	�d��q|�|�|�tj�|dd��|�tj�|dd��q|S)
aReturns a list containing all global site-packages directories.

    For each directory present in ``prefixes`` (or the global ``PREFIXES``),
    this function will find its `site-packages` subdirectory depending on the
    system environment, and will return a list of full paths.
    N�/�lib64�python�z
site-packages�libzpython%d.%dr^)r�PREFIXESrr�seprrrrrirc)�prefixes�sitepackages�seen�prefixrrr�getsitepackages?s*

��
r~cCsBtrdtjkrt�dd�t|�D]}tj�|�r"t||�q"|S)z�Add site-packages to sys.path

    '/usr/local' is included in PREFIXES if RPM build is not detected
    to make packages installed into this location visible.

    �RPM_BUILD_ROOTrz
/usr/local)	rorr_rx�insertr~rrprK)r rzr;rrr�addsitepackages^sr�cCs4tjdkrd}nd}t�d|�t_t�d|�t_dS)z�Define new builtins 'quit' and 'exit'.

    These are objects which make the interpreter exit when called.
    The repr of each object contains a hint at how it works.

    �\zCtrl-Z plus ReturnzCtrl-D (i.e. EOF)�quit�exitN)rry�
_sitebuiltins�Quitter�builtinsr�r�)�eofrrr�setquitms

r�cCs�t�dtj�t_tjdd�dkr2t�dd�t_nt�dd�t_gg}}ttd�r�tj	�
tj�}|�d	d
g�|�tj	�
|tj�|tjg�t�dd||�t_dS)
z)Set 'copyright' and 'credits' in builtins�	copyrightN��java�creditsz?Jython is maintained by the Jython developers (www.jython.org).z�    Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
    for supporting Python development.  See www.python.org for more information.rzLICENSE.txt�LICENSE�licensez'See https://www.python.org/psf/license/)r��_Printerrr�r�rar�rRrr�dirnamer�extendr�pardir�curdirr�)�files�dirs�hererrr�setcopyright}s$�

�r�cCst��t_dSr)r��_Helperr��helprrrr�	sethelper�sr�cCsdd�}|t_dS)ajEnable default readline configuration on interactive prompts, by
    registering a sys.__interactivehook__.

    If the readline module can be imported, the hook will set the Tab key
    as completion key and register ~/.python_history as history file.
    This can be overridden in the sitecustomize or usercustomize module,
    or in a PYTHONSTARTUP file.
    cs�ddl}zddl�ddl}Wntk
r2YdSXt�dd�}|dk	r\d|kr\��d�n
��d�z���Wntk
r�YnX���dkr�t	j
�t	j
�d�d��z��
��Wntk
r�YnX��fd	d
�}|�|�dS)Nr�__doc__��libeditzbind ^I rl_completez
tab: completerZz.python_historycs(z����Wntk
r"YnXdSr)�write_history_filerr��history�readlinerr�
write_history�szCenablerlcompleter.<locals>.register_readline.<locals>.write_history)�atexitr��rlcompleter�ImportErrorr�parse_and_bind�read_init_filer�get_current_history_lengthrrrrU�read_history_file�register)r�r��readline_docr�rr�r�register_readline�s0
�z,enablerlcompleter.<locals>.register_readlineN)r�__interactivehook__)r�rrr�enablerlcompleter�s	0r�c	CsHtj}tjdkr*d|kr*tjd}t_ntj}tj�tj�|��\}}tj�	|�}dt_
d}dd�tj�||�tj�||�fD�}|�rD|d}d}	t|dd	��\}
|
D]P}d
|kr�|�
d
�\}}}
|����}|
��}
|dkr�|
��}	q�|dkr�|
t_
q�W5QRX|t_t_t|tjg�|	dk�r8t�dtj�ntjgad
a|S)Nr\�__PYVENV_LAUNCHER__z
pyvenv.cfgcSsg|]}tj�|�r|�qSr)rr�isfile)rE�conffilerrrrF�s�zvenv.<locals>.<listcomp>r�truezutf-8)�encoding�=zinclude-system-site-packages�homeF)rr_rra�_base_executable�
executabler�splitrr��_homer�open�	partition�strip�lowerr}�exec_prefixr�rxr�ro)r �envr��exe_dirr&�site_prefix�
conf_basename�candidate_confs�virtual_conf�system_siter?rA�key�valuerrr�venv�sB��

r�c
Cs�zBzddl}Wn0tk
r>}z|jdkr,n�W5d}~XYnXWnRtk
r�}z4tjjrltjt���ntj	�
d|jj|f�W5d}~XYnXdS)z,Run custom site specific code, if available.rN�
sitecustomizez@Error in sitecustomize; set PYTHONVERBOSE for traceback:
%s: %s
)
r�r�r<r3rrP�verbose�
excepthookr9r6�write�	__class__�__name__)r��exc�errrrr�execsitecustomizes

��r�c
Cs�zBzddl}Wn0tk
r>}z|jdkr,n�W5d}~XYnXWnRtk
r�}z4tjjrltjt���ntj	�
d|jj|f�W5d}~XYnXdS)z,Run custom user specific code, if available.rN�
usercustomizez@Error in usercustomize; set PYTHONVERBOSE for traceback:
%s: %s
)
r�r�r<r3rrPr�r�r9r6r�r�r�)r�r�r�rrr�execusercustomizes

��r�cCs~tjdd�}t�}|tjkr$t�t|�}tdkr:t�at|�}t|�}t	�t
�t�tjj
sjt�t�trzt�dS)z�Add standard site-specific directories to the module search path.

    This function is called automatically when this module is imported,
    unless the python interpreter was started with the -S flag.
    N)rrr"rr�rorSrrr�r�r�r�rP�isolatedr�r�r�)�	orig_pathr rrr�main/s"
r�cCs\d}tjdd�}|s�t�}t�}td�tjD]}td|f�q0td�td|tj�|�rbdndf�td	|tj�|�r�dndf�td
t�t�	d�g}d|kr�|�
t�d
|kr�|�
t�|�r(ttj
�|��tr�t�	d�n6tdk�rt�	d�n tdk�rt�	d�n
t�	d�n0ddl}t|�|tjdtj
f��t�	d�dS)Na�    %s [--user-base] [--user-site]

    Without arguments print some useful information
    With arguments print the value of USER_BASE and/or USER_SITE separated
    by '%s'.

    Exit codes with --user-base or --user-site:
      0 - user site directory is enabled
      1 - user site directory is disabled by user
      2 - uses site directory is disabled by super user
          or for security reasons
     >2 - unknown error
    r*zsys.path = [z    %r,�]zUSER_BASE: %r (%s)r#z
doesn't existzUSER_SITE: %r (%s)zENABLE_USER_SITE: %rrz--user-basez--user-siteFr^rv�
)r�argvrlrnr4rrrpror�rrkrm�pathsepr�textwrap�dedent)r�rV�	user_baserqr
�bufferr�rrr�_scriptQsD
��




r��__main__)N)N)N)&r�rrr�r�r,r}r�rxrormrkr
rr"r(rCrKrSrfrjrlrnrrr~r�r�r�r�r�r�r�r�r�rP�no_siter�r�rrrr�<module>sHG	
*
 


;4
3
__pycache__/__phello__.foo.cpython-38.opt-2.pyc000064400000000201151153537570015212 0ustar00U

e5d@�@sdS)N�rrr�&/usr/lib64/python3.8/__phello__.foo.py�<module>�__pycache__/argparse.cpython-38.opt-2.pyc000064400000147231151153537570014174 0ustar00U

e5dw�@s,dZddddddddd	d
ddd
ddddgZddlZddlZddlZddlZ	ddl
m
ZmZdZ
dZdZdZdZdZdZGdd�de�Zdd�ZGd d�de�ZGd!d�de�ZGd"d�de�ZGd#d�de�ZGd$d	�d	e�Zd%d&�ZGd'd�de�ZGd(d�de�ZGd)d�de�Z Gd*d+�d+e �Z!Gd,d-�d-e �Z"Gd.d/�d/e"�Z#Gd0d1�d1e"�Z$Gd2d3�d3e �Z%Gd4d5�d5e �Z&Gd6d7�d7e �Z'Gd8d9�d9e �Z(Gd:d;�d;e �Z)Gd<d=�d=e �Z*Gd>d?�d?e%�Z+Gd@d�de�Z,GdAd
�d
e�Z-GdBdC�dCe�Z.GdDdE�dEe.�Z/GdFdG�dGe/�Z0GdHd�dee.�Z1dS)Iz1.1�ArgumentParser�
ArgumentError�ArgumentTypeError�FileType�
HelpFormatter�ArgumentDefaultsHelpFormatter�RawDescriptionHelpFormatter�RawTextHelpFormatter�MetavarTypeHelpFormatter�	Namespace�Action�ONE_OR_MORE�OPTIONAL�PARSER�	REMAINDER�SUPPRESS�ZERO_OR_MORE�N)�gettext�ngettextz==SUPPRESS==�?�*�+zA...�...Z_unrecognized_argsc@s$eZdZdd�Zdd�Zdd�ZdS)�_AttributeHoldercCs�t|�j}g}i}|��D]}|�t|��q|��D],\}}|��rZ|�d||f�q6|||<q6|rz|�dt|��d|d�|�fS)N�%s=%rz**%s�%s(%s)�, )�type�__name__�	_get_args�append�repr�_get_kwargs�isidentifier�join)�selfZ	type_name�arg_stringsZ	star_args�arg�name�value�r*� /usr/lib64/python3.8/argparse.py�__repr__ts

z_AttributeHolder.__repr__cCst|j���S�N)�sorted�__dict__�items�r%r*r*r+r"�sz_AttributeHolder._get_kwargscCsgSr-r*r1r*r*r+r�sz_AttributeHolder._get_argsN)r�
__module__�__qualname__r,r"rr*r*r*r+rks	rcCs6|dkrgSt|�tkr$|dd�Sddl}|�|�S)Nr)r�list�copy)r0r5r*r*r+�_copy_items�sr6c@s�eZdZd:dd�Zdd�Zdd	�ZGd
d�de�Zdd
�Zdd�Z	dd�Z
dd�Zd;dd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�ZdS)<r��NcCs�|dkrt��j}|d8}||_||_t|t|d|d��|_||_d|_	d|_
d|_|�|d�|_
|j
|_t�dtj�|_t�d�|_dS)Nr7�rz\s+z\n\n\n+)�_shutil�get_terminal_size�columns�_prog�_indent_increment�min�max�_max_help_position�_width�_current_indent�_level�_action_max_length�_Section�
_root_section�_current_section�_re�compile�ASCII�_whitespace_matcher�_long_break_matcher)r%�progZindent_incrementZmax_help_position�widthr*r*r+�__init__�s 
�zHelpFormatter.__init__cCs"|j|j7_|jd7_dS�N��rCr>rDr1r*r*r+�_indent�szHelpFormatter._indentcCs"|j|j8_|jd8_dSrQrSr1r*r*r+�_dedent�szHelpFormatter._dedentc@seZdZddd�Zdd�ZdS)zHelpFormatter._SectionNcCs||_||_||_g|_dSr-)�	formatter�parent�headingr0)r%rVrWrXr*r*r+rP�szHelpFormatter._Section.__init__cCs�|jdk	r|j��|jj}|dd�|jD��}|jdk	rD|j��|sLdS|jtk	rz|jdk	rz|jj}d|d|jf}nd}|d||dg�S)NcSsg|]\}}||��qSr*r*)�.0�func�argsr*r*r+�
<listcomp>�sz6HelpFormatter._Section.format_help.<locals>.<listcomp>�z%*s%s:
�
)	rWrVrT�_join_partsr0rUrXrrC)r%r$Z	item_helpZcurrent_indentrXr*r*r+�format_help�s



z"HelpFormatter._Section.format_help)N)rr2r3rPr`r*r*r*r+rF�s
rFcCs|jj�||f�dSr-)rHr0r )r%rZr[r*r*r+�	_add_item�szHelpFormatter._add_itemcCs0|��|�||j|�}|�|jg�||_dSr-)rTrFrHrar`)r%rXZsectionr*r*r+�
start_section�szHelpFormatter.start_sectioncCs|jj|_|��dSr-)rHrWrUr1r*r*r+�end_section�s
zHelpFormatter.end_sectioncCs$|tk	r |dk	r |�|j|g�dSr-)rra�_format_text)r%�textr*r*r+�add_text�szHelpFormatter.add_textcCs&|tk	r"||||f}|�|j|�dSr-)rra�
_format_usage)r%�usage�actions�groups�prefixr[r*r*r+�	add_usage�szHelpFormatter.add_usagecCsv|jtk	rr|j}||�g}|�|�D]}|�||��q$tdd�|D��}||j}t|j|�|_|�|j	|g�dS)NcSsg|]}t|��qSr*��len�rY�sr*r*r+r\
sz.HelpFormatter.add_argument.<locals>.<listcomp>)
�helpr�_format_action_invocation�_iter_indented_subactionsr r@rCrEra�_format_action)r%�actionZget_invocationZinvocations�	subactionZinvocation_lengthZ
action_lengthr*r*r+�add_arguments


�zHelpFormatter.add_argumentcCs|D]}|�|�qdSr-)rw)r%rirur*r*r+�
add_argumentsszHelpFormatter.add_argumentscCs.|j��}|r*|j�d|�}|�d�d}|S)N�

r^)rGr`rM�sub�strip)r%rqr*r*r+r`s

zHelpFormatter.format_helpcCsd�dd�|D��S)Nr]cSsg|]}|r|tk	r|�qSr*)r)rY�partr*r*r+r\!s�z-HelpFormatter._join_parts.<locals>.<listcomp>)r$)r%Zpart_stringsr*r*r+r_ s
�zHelpFormatter._join_partscs|dkrtd�}|dk	r,|t|jd�}�n�|dkrL|sLdt|jd�}�n�|dk�rdt|jd�}g}g}|D] }|jr�|�|�qr|�|�qr|j}	|	|||�}
d�dd�||
fD��}|j|j�t	|�t	|��k�rd}|	||�}|	||�}
t
�||�}t
�||
�}d�fdd	�	}t	|�t	|�d
�k�r�dt	|�t	|�d}|�r|||g|||�}|�|||��n |�r�||g|||�}n|g}nZdt	|�}||}|||�}t	|�dk�r�g}|�|||��|�|||��|g|}d�|�}d
||fS)Nzusage: �rNz%(prog)s� cSsg|]}|r|�qSr*r*ror*r*r+r\Asz/HelpFormatter._format_usage.<locals>.<listcomp>z%\(.*?\)+(?=\s|$)|\[.*?\]+(?=\s|$)|\S+cs�g}g}|dk	rt|�d}nt|�d}|D]Z}|dt|��krn|rn|�|d�|��g}t|�d}|�|�|t|�d7}q.|r�|�|d�|��|dk	r�|dt|�d�|d<|S)NrRr~r)rnr r$)�parts�indentrk�lines�lineZline_lenr|��
text_widthr*r+�	get_linesUs"
z.HelpFormatter._format_usage.<locals>.get_linesg�?rRr^z%s%s

)N)
�_�dictr=�option_stringsr �_format_actions_usager$rBrCrnrI�findall�extend)r%rhrirjrkrN�	optionals�positionalsru�formatZaction_usageZpart_regexpZ	opt_usageZ	pos_usageZ	opt_partsZ	pos_partsr�r�r�rr*r�r+rg%sX
�




zHelpFormatter._format_usagec	Cs�t�}i}|D�]}z|�|jd�}Wntk
r@YqYqX|t|j�}|||�|jkr|jD]}|�|�qh|js�||kr�||d7<nd||<||kr�||d7<nd||<nF||kr�||d7<nd||<||k�r||d7<nd||<t|d|�D]}	d	||	<�qqg}
t|�D�]"\}	}|j	t
k�r�|
�d�|�|	�d	k�rr|�
|	�n"|�|	d�d	k�rX|�
|	d�n�|j�s�|�|�}|�||�}||k�r�|ddk�r�|d
dk�r�|dd
�}|
�|�nf|jd}
|jdk�rd|
}n"|�|�}|�||�}d|
|f}|j�sN||k�rNd
|}|
�|��q6t|dd�D]}	||	g|
|	|	�<�qhd�dd�|
D��}d}d}t�d|d|�}t�d|d|�}t�d||fd|�}t�dd|�}|��}|S)Nrz [�[�]z (�(�)rR�|����%s�%s %s�[%s]T)�reverser~cSsg|]}|dk	r|�qSr-r*)rY�itemr*r*r+r\�sz7HelpFormatter._format_actions_usage.<locals>.<listcomp>z[\[(]z[\])]z(%s) z\1� (%s)z%s *%sr]z\(([^|]*)\))�set�index�_group_actions�
ValueErrorrn�add�required�range�	enumeraterqrr �get�popr��#_get_default_metavar_for_positional�_format_args�nargs�!_get_default_metavar_for_optionalr.r$rIrzr{)r%rirj�
group_actionsZinserts�group�start�endru�ir�defaultr|�
option_string�args_stringre�open�closer*r*r+r��sz










z#HelpFormatter._format_actions_usagecCsFd|kr|t|jd�}t|j|jd�}d|j}|�|||�dS)Nz%(prog)r}�r~ry)r�r=r@rBrC�
_fill_text)r%rer�r�r*r*r+rd�s

zHelpFormatter._format_textc
Cs:t|jd|j�}t|j|d�}||jd}|�|�}|jsV|jd|f}d|}n@t|�|kr~|jd||f}d|}d}n|jd|f}d|}|}|g}|jr�|�	|�}	|�
|	|�}
|�d|d|
df�|
dd�D]}|�d|d|f�q�n|�d��s|�d�|�
|�D]}|�|�|���q|�|�S)	Nr7r�r]z%*s%s
z	%*s%-*s  rrRr^)r?rErAr@rBrCrrrqrn�_expand_help�_split_linesr �endswithrsrtr_)
r%ruZ
help_positionZ
help_widthZaction_widthZ
action_header�tupZindent_firstrZ	help_textZ
help_linesr�rvr*r*r+rt�s8
�



zHelpFormatter._format_actioncCs�|js&|�|�}|�||�d�\}|Sg}|jdkrB|�|j�n4|�|�}|�||�}|jD]}|�d||f�q^d�|�SdS)NrRrr�r)	r�r��_metavar_formatterr�r�r�r�r r$)r%rur��metavarrr�r�r*r*r+rr"s



z'HelpFormatter._format_action_invocationcsP|jdk	r|j�n.|jdk	r<dd�|jD�}dd�|��n|��fdd�}|S)NcSsg|]}t|��qSr*��str)rYZchoicer*r*r+r\>sz4HelpFormatter._metavar_formatter.<locals>.<listcomp>z{%s}�,cst�t�r�S�f|SdSr-)�
isinstance�tuple)Z
tuple_size��resultr*r+r�Cs
z0HelpFormatter._metavar_formatter.<locals>.format)r��choicesr$)r%ru�default_metavarZchoice_strsr�r*r�r+r�:s

z HelpFormatter._metavar_formattercCs�|�||�}|jdkr$d|d�}n�|jtkr<d|d�}n�|jtkrTd|d�}n�|jtkrld|d�}n�|jtkr|d}nt|jtkr�d|d�}n\|jtkr�d	}nLzd
d�t|j�D�}Wnt	k
r�t
d�d�YnXd
�|�||j�}|S)Nr�rRr�z
[%s [%s ...]]r7z%s [%s ...]rz%s ...r]cSsg|]}d�qS)r�r*)rYr�r*r*r+r\\sz.HelpFormatter._format_args.<locals>.<listcomp>zinvalid nargs valuer~)r�r�r
rrrrrr��	TypeErrorr�r$)r%rur�Zget_metavarr�Zformatsr*r*r+r�Js*






zHelpFormatter._format_argscCs�tt|�|jd�}t|�D]}||tkr||=qt|�D] }t||d�r:||j||<q:|�d�dk	r�d�dd�|dD��}||d<|�	|�|S)Nr}rr�rcSsg|]}t|��qSr*r�)rY�cr*r*r+r\ksz.HelpFormatter._expand_help.<locals>.<listcomp>)
r��varsr=r4r�hasattrrr�r$�_get_help_string)r%ruZparamsr(Zchoices_strr*r*r+r�bszHelpFormatter._expand_helpccs@z
|j}Wntk
rYnX|��|�EdH|��dSr-)�_get_subactions�AttributeErrorrTrU)r%ruZget_subactionsr*r*r+rsos
z'HelpFormatter._iter_indented_subactionscCs&|j�d|���}ddl}|�||�S)Nr~r)rLrzr{�textwrapZwrap)r%rerOr�r*r*r+r�yszHelpFormatter._split_linescCs,|j�d|���}ddl}|j||||d�S)Nr~r)Zinitial_indentZsubsequent_indent)rLrzr{r�Zfill)r%rerOr�r�r*r*r+r��s�zHelpFormatter._fill_textcCs|jSr-)rq�r%rur*r*r+r��szHelpFormatter._get_help_stringcCs
|j��Sr-)�dest�upperr�r*r*r+r��sz/HelpFormatter._get_default_metavar_for_optionalcCs|jSr-)r�r�r*r*r+r��sz1HelpFormatter._get_default_metavar_for_positional)r7r8N)N)rr2r3rPrTrU�objectrFrarbrcrfrlrwrxr`r_rgr�rdrtrrr�r�r�rsr�r�r�r�r�r*r*r*r+r�s<	�

`g/

c@seZdZdd�ZdS)rcs d��fdd�|jdd�D��S)Nr]c3s|]}�|VqdSr-r*)rYr��r�r*r+�	<genexpr>�sz9RawDescriptionHelpFormatter._fill_text.<locals>.<genexpr>T)�keepends)r$�
splitlines)r%rerOr�r*r�r+r��sz&RawDescriptionHelpFormatter._fill_textN)rr2r3r�r*r*r*r+r�sc@seZdZdd�ZdS)rcCs|��Sr-)r�)r%rerOr*r*r+r��sz!RawTextHelpFormatter._split_linesN)rr2r3r�r*r*r*r+r�sc@seZdZdd�ZdS)rcCs>|j}d|jkr:|jtk	r:ttg}|js2|j|kr:|d7}|S)Nz
%(default)z (default: %(default)s))rqr�rr
rr�r�)r%rurqZdefaulting_nargsr*r*r+r��s

z.ArgumentDefaultsHelpFormatter._get_help_stringN)rr2r3r�r*r*r*r+r�sc@seZdZdd�Zdd�ZdS)r	cCs|jjSr-�rrr�r*r*r+r��sz:MetavarTypeHelpFormatter._get_default_metavar_for_optionalcCs|jjSr-r�r�r*r*r+r��sz<MetavarTypeHelpFormatter._get_default_metavar_for_positionalN)rr2r3r�r�r*r*r*r+r	�scCsN|dkrdS|jrd�|j�S|jdtfkr2|jS|jdtfkrF|jSdSdS)N�/)r�r$r�rr�)�argumentr*r*r+�_get_action_name�sr�c@seZdZdd�Zdd�ZdS)rcCst|�|_||_dSr-)r��
argument_name�message)r%r�r�r*r*r+rP�s
zArgumentError.__init__cCs(|jdkrd}nd}|t|j|jd�S)Nz%(message)sz'argument %(argument_name)s: %(message)s)r�r�)r�r�r�)r%r�r*r*r+�__str__�s
�zArgumentError.__str__N)rr2r3rPr�r*r*r*r+r�sc@seZdZdS)rN)rr2r3r*r*r*r+r�sc@s(eZdZd	dd�Zdd�Zd
dd�ZdS)rNFcCs@||_||_||_||_||_||_||_||_|	|_|
|_	dSr-�
r�r�r��constr�rr�r�rqr��r%r�r�r�r�r�rr�r�rqr�r*r*r+rP)szAction.__init__c	s(ddddddddd	g	}�fd
d�|D�S)Nr�r�r�r�r�rr�rqr�csg|]}|t�|�f�qSr*��getattr�rYr(r1r*r+r\Ksz&Action._get_kwargs.<locals>.<listcomp>r*�r%�namesr*r1r+r"?s�zAction._get_kwargscCsttd���dS)Nz.__call__() not defined)�NotImplementedErrorr��r%�parser�	namespace�valuesr�r*r*r+�__call__MszAction.__call__)NNNNNFNN)N)rr2r3rPr"r�r*r*r*r+r�s6�
cs(eZdZd�fdd�	Zddd�Z�ZS)	�_StoreActionNFcsT|dkrtd��|dk	r,|tkr,tdt��tt|�j|||||||||	|
d�
dS)Nrz�nargs for store actions must be != 0; if you have nothing to store, actions such as store true or store const may be more appropriate� nargs must be %r to supply constr�)r�r
�superr�rPr���	__class__r*r+rPSs 
�z_StoreAction.__init__cCst||j|�dSr-)�setattrr�r�r*r*r+r�psz_StoreAction.__call__)NNNNNFNN)N�rr2r3rPr��
__classcell__r*r*r�r+r�Qs�r�cs(eZdZd�fdd�	Zddd�Z�ZS)	�_StoreConstActionNFc	s"tt|�j||d||||d�dS)Nr)r�r�r�r�r�r�rq)r�r�rP�r%r�r�r�r�r�rqr�r�r*r+rPvs
�z_StoreConstAction.__init__cCst||j|j�dSr-)r�r�r�r�r*r*r+r��sz_StoreConstAction.__call__)NFNN)Nr�r*r*r�r+r�ts�r�cseZdZd�fdd�	Z�ZS)�_StoreTrueActionFNcs tt|�j||d|||d�dS)NT�r�r�r�r�r�rq)r�r�rP�r%r�r�r�r�rqr�r*r+rP�s
�z_StoreTrueAction.__init__)FFN�rr2r3rPr�r*r*r�r+r��s�r�cseZdZd�fdd�	Z�ZS)�_StoreFalseActionTFNcs tt|�j||d|||d�dS)NFr�)r�r�rPr�r�r*r+rP�s
�z_StoreFalseAction.__init__)TFNr�r*r*r�r+r��s�r�cs(eZdZd�fdd�	Zddd�Z�ZS)	�
_AppendActionNFcsT|dkrtd��|dk	r,|tkr,tdt��tt|�j|||||||||	|
d�
dS)Nrz�nargs for append actions must be != 0; if arg strings are not supplying the value to append, the append const action may be more appropriater�r�)r�r
r�r�rPr�r�r*r+rP�s 
�z_AppendAction.__init__cCs2t||jd�}t|�}|�|�t||j|�dSr-)r�r�r6r r��r%r�r�r�r�r0r*r*r+r��s
z_AppendAction.__call__)NNNNNFNN)Nr�r*r*r�r+r��s�r�cs(eZdZd�fdd�	Zddd�Z�ZS)	�_AppendConstActionNFc
s$tt|�j||d|||||d�dS)Nr)r�r�r�r�r�r�rqr�)r�r�rPr�r�r*r+rP�s
�z_AppendConstAction.__init__cCs4t||jd�}t|�}|�|j�t||j|�dSr-)r�r�r6r r�r�r�r*r*r+r��sz_AppendConstAction.__call__)NFNN)Nr�r*r*r�r+r��s�r�cs(eZdZd�fdd�	Zddd�Z�ZS)	�_CountActionNFcs tt|�j||d|||d�dS)Nr)r�r�r�r�r�rq)r�r�rPr�r�r*r+rP�s
�z_CountAction.__init__cCs0t||jd�}|dkrd}t||j|d�dS�NrrR)r�r�r�)r%r�r�r�r��countr*r*r+r��sz_CountAction.__call__)NFN)Nr�r*r*r�r+r��s
�r�cs.eZdZeedf�fdd�	Zddd�Z�ZS)�_HelpActionNcstt|�j|||d|d�dS�Nr)r�r�r�r�rq)r�r�rP)r%r�r�r�rqr�r*r+rPs
�z_HelpAction.__init__cCs|��|��dSr-)�
print_help�exitr�r*r*r+r�sz_HelpAction.__call__)N�rr2r3rrPr�r�r*r*r�r+r�s
�r�cs0eZdZdeedf�fdd�	Zddd�Z�ZS)�_VersionActionNz&show program's version number and exitcs$tt|�j|||d|d�||_dSr�)r�rrP�version)r%r�rr�r�rqr�r*r+rPs
�z_VersionAction.__init__cCsD|j}|dkr|j}|��}|�|�|�|��tj�|��dSr-)r�_get_formatterrf�_print_messager`�_sys�stdoutr)r%r�r�r�r�rrVr*r*r+r�(s
z_VersionAction.__call__)Nrr*r*r�r+rs�rcsPeZdZGdd�de�Zedddf�fdd�	Zdd�Zd	d
�Zd
dd�Z	�Z
S)�_SubParsersActioncseZdZ�fdd�Z�ZS)z&_SubParsersAction._ChoicesPseudoActioncs@|}}|r|dd�|�7}ttj|�}|jg|||d�dS)Nr�r)r�r�rqr�)r$r�r	�_ChoicesPseudoActionrP)r%r(�aliasesrqr�r�Zsupr�r*r+rP6s
�z/_SubParsersAction._ChoicesPseudoAction.__init__r�r*r*r�r+r
4sr
FNc	s<||_||_i|_g|_tt|�j||t|j|||d�dS)N)r�r�r�r�r�rqr�)�_prog_prefix�
_parser_class�_name_parser_map�_choices_actionsr�r	rPr)r%r�rN�parser_classr�r�rqr�r�r*r+rP>s	
�z_SubParsersAction.__init__cKs�|�d�dkr d|j|f|d<|�dd�}d|krX|�d�}|�|||�}|j�|�|jf|�}||j|<|D]}||j|<qr|S)NrNr�rr*rq)r�rr�r
rr r
r)r%r(�kwargsrrqZ
choice_actionr��aliasr*r*r+�
add_parserUs

z_SubParsersAction.add_parsercCs|jSr-)rr1r*r*r+r�lsz!_SubParsersAction._get_subactionscCs�|d}|dd�}|jtk	r,t||j|�z|j|}Wn<tk
rv|d�|j�d�}td�|}t||��YnX|�|d�\}	}t	|	��
�D]\}
}t||
|�q�|r�t	|��tg�t
|t��|�dS)NrrRr)�parser_namer�z5unknown parser %(parser_name)r (choices: %(choices)s))r�rr�r�KeyErrorr$r�r�parse_known_argsr�r0�
setdefault�_UNRECOGNIZED_ARGS_ATTRr�r�)r%r�r�r�r�rr&r[�msgZsubnamespace�keyr)r*r*r+r�os$

�	z_SubParsersAction.__call__)N)rr2r3rr
rrPrr�r�r�r*r*r�r+r	2s�r	c@seZdZddd�ZdS)�
_ExtendActionNcCs2t||jd�}t|�}|�|�t||j|�dSr-)r�r�r6r�r�r�r*r*r+r��s
z_ExtendAction.__call__)N)rr2r3r�r*r*r*r+r�src@s&eZdZd
dd�Zdd�Zdd	�ZdS)r�rr�NcCs||_||_||_||_dSr-)�_mode�_bufsize�	_encoding�_errors)r%�mode�bufsize�encoding�errorsr*r*r+rP�szFileType.__init__c
Cs�|dkr>d|jkrtjSd|jkr(tjStd�|j}t|��zt||j|j|j|j	�WSt
k
r�}z"||d�}td�}t||��W5d}~XYnXdS)N�-r�wzargument "-" with mode %r)�filename�errorz$can't open '%(filename)s': %(error)s)rr�stdinrr�r�r�rrr �OSErrorr)r%�stringr�er[r�r*r*r+r��s

�
zFileType.__call__cCsT|j|jf}d|jfd|jfg}d�dd�|D�dd�|D��}dt|�j|fS)Nr#r$rcSsg|]}|dkrt|��qS)r�)r!)rYr'r*r*r+r\�sz%FileType.__repr__.<locals>.<listcomp>cSs$g|]\}}|dk	rd||f�qS)Nrr*)rY�kwr'r*r*r+r\�s�r)rrrr r$rr)r%r[rZargs_strr*r*r+r,�s�zFileType.__repr__)rr�NN)rr2r3rPr�r,r*r*r*r+r�s
c@s$eZdZdd�Zdd�Zdd�ZdS)r
cKs|D]}t||||�qdSr-)r�)r%rr(r*r*r+rP�szNamespace.__init__cCst|t�stSt|�t|�kSr-)r�r
�NotImplementedr�)r%�otherr*r*r+�__eq__�s
zNamespace.__eq__cCs
||jkSr-)r/)r%rr*r*r+�__contains__�szNamespace.__contains__N)rr2r3rPr0r1r*r*r*r+r
�scs�eZdZ�fdd�Zdd�Zd&dd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zd'dd�Zdd�Zd d!�Zd"d#�Zd$d%�Z�ZS)(�_ActionsContainercstt|���||_||_||_||_i|_|�ddt	�|�ddt	�|�ddt
�|�ddt�|�ddt�|�ddt
�|�ddt�|�ddt�|�dd	t�|�dd
t�|�ddt�|�ddt�|��g|_i|_g|_g|_i|_t�d
�|_g|_dS)NruZstoreZstore_const�
store_trueZstore_falser Zappend_constr�rqr�parsersr�z^-\d+$|^-\d*\.\d+$)r�r2rP�description�argument_default�prefix_chars�conflict_handler�_registries�registerr�r�r�r�r�r�r�r�rr	r�_get_handler�_actions�_option_string_actions�_action_groups�_mutually_exclusive_groups�	_defaultsrIrJ�_negative_number_matcher�_has_negative_number_optionals)r%r5r7r6r8r�r*r+rP�s4z_ActionsContainer.__init__cCs|j�|i�}|||<dSr-)r9r)r%�
registry_namer)r��registryr*r*r+r:sz_ActionsContainer.registerNcCs|j|�||�Sr-)r9r�)r%rCr)r�r*r*r+�
_registry_get sz_ActionsContainer._registry_getcKs2|j�|�|jD]}|j|kr||j|_qdSr-)r@�updater<r�r�)r%rrur*r*r+�set_defaults&s

z_ActionsContainer.set_defaultscCs8|jD]"}|j|kr|jdk	r|jSq|j�|d�Sr-)r<r�r�r@r�)r%r�rur*r*r+�get_default/s
z_ActionsContainer.get_defaultcOsD|j}|r&t|�dkrH|dd|krH|r:d|kr:td��|j||�}n|j||�}d|kr�|d}||jkr~|j||d<n|jdk	r�|j|d<|�|�}t|�s�td|f��|f|�}|�	d|j
|j
�}t|�s�td|f��|tkr�td	|f��t|d
��r:z|�
��|d�Wntk
�r8td��YnX|�|�S)NrRrr�z+dest supplied twice for positional argumentr�zunknown action "%s"r�%r is not callablez<%r is a FileType class object, instance of it must be passedrz,length of metavar tuple does not match nargs)r7rnr��_get_positional_kwargs�_get_optional_kwargsr@r6�_pop_action_class�callablerErrr�rr�r��_add_action)r%r[r�charsr�Zaction_classru�	type_funcr*r*r+rw9s:	 




�z_ActionsContainer.add_argumentcOs t|f|�|�}|j�|�|Sr-)�_ArgumentGroupr>r )r%r[rr�r*r*r+�add_argument_grouplsz$_ActionsContainer.add_argument_groupcKst|f|�}|j�|�|Sr-)�_MutuallyExclusiveGroupr?r )r%rr�r*r*r+�add_mutually_exclusive_groupqsz._ActionsContainer.add_mutually_exclusive_groupcCs`|�|�|j�|�||_|jD]}||j|<q"|jD]"}|j�|�r8|js8|j�d�q8|S)NT)	�_check_conflictr<r �	containerr�r=rA�matchrB)r%rur�r*r*r+rNvs


z_ActionsContainer._add_actioncCs|j�|�dSr-)r<�remover�r*r*r+�_remove_action�sz _ActionsContainer._remove_actioncCs�i}|jD].}|j|kr.td�}t||j��|||j<q
i}|jD]D}|j|krn|j|j|j|jd�||j<|jD]}||j||<qtqD|jD]&}|j	|j
d�}|jD]}|||<q�q�|jD]}|�||��
|�q�dS)Nz.cannot merge actions - two groups are named %r)�titler5r8)r�)r>rZr�r�rRr5r8r�r?rTr�r<r�rN)r%rVZtitle_group_mapr�rZ	group_mapru�mutex_groupr*r*r+�_add_container_actions�s0



�

�

z(_ActionsContainer._add_container_actionscKs^d|krtd�}t|��|�d�ttfkr2d|d<|�d�tkrPd|krPd|d<t||gd�S)Nr�z1'required' is an invalid argument for positionalsr�Tr��r�r�)r�r�r�r
rr�)r%r�rrr*r*r+rJ�sz(_ActionsContainer._get_positional_kwargsc	Os�g}g}|D]n}|d|jkr>||jd�}td�}t||��|�|�|d|jkrt|�dkr|d|jkr|�|�q|�dd�}|dkr�|r�|d}n|d}|�|j�}|s�td�}t||��|�dd�}t|||d	�S)
Nr)�optionr7zNinvalid option string %(option)r: must start with a character %(prefix_chars)rrRr�z%dest= is required for options like %rr%r�r])	r7r�r�r rnr��lstrip�replacer�)	r%r[rr�Zlong_option_stringsr�rr�Zdest_option_stringr*r*r+rK�s2�

z&_ActionsContainer._get_optional_kwargscCs|�d|�}|�d||�S)Nru)r�rE)r%rr�rur*r*r+rL�sz#_ActionsContainer._pop_action_classcCsFd|j}zt||�WStk
r@td�}t||j��YnXdS)Nz_handle_conflict_%sz%invalid conflict_resolution value: %r)r8r�r�r�r�)r%Zhandler_func_namerr*r*r+r;�s
z_ActionsContainer._get_handlercCsLg}|jD]&}||jkr
|j|}|�||f�q
|rH|��}|||�dSr-)r�r=r r;)r%ruZconfl_optionalsr�Zconfl_optionalr8r*r*r+rU�s


z!_ActionsContainer._check_conflictcCs6tddt|��}d�dd�|D��}t|||��dS)Nzconflicting option string: %szconflicting option strings: %srcSsg|]\}}|�qSr*r*)rYr�rur*r*r+r\	s�z<_ActionsContainer._handle_conflict_error.<locals>.<listcomp>)rrnr$r)r%ru�conflicting_actionsr�Zconflict_stringr*r*r+�_handle_conflict_errors�
�z(_ActionsContainer._handle_conflict_errorcCs>|D]4\}}|j�|�|j�|d�|js|j�|�qdSr-)r�rXr=r�rVrY)r%rurar�r*r*r+�_handle_conflict_resolves
z*_ActionsContainer._handle_conflict_resolve)N)N)rr2r3rPr:rErGrHrwrRrTrNrYr\rJrKrLr;rUrbrcr�r*r*r�r+r2�s$5
	
3($
		r2cs6eZdZd�fdd�	Z�fdd�Z�fdd�Z�ZS)	rQNcs�|j}|d|j�|d|j�|d|j�tt|�j}|fd|i|��||_g|_|j	|_	|j
|_
|j|_|j|_|j
|_
|j|_dS)Nr8r7r6r5)rr8r7r6r�rQrPrZr�r9r<r=r@rBr?)r%rVrZr5rrFZ
super_initr�r*r+rPs�z_ArgumentGroup.__init__cs tt|��|�}|j�|�|Sr-)r�rQrNr�r r�r�r*r+rN5sz_ArgumentGroup._add_actioncs tt|��|�|j�|�dSr-)r�rQrYr�rXr�r�r*r+rY:sz_ArgumentGroup._remove_action)NN�rr2r3rPrNrYr�r*r*r�r+rQsrQcs.eZdZd�fdd�	Zdd�Zdd�Z�ZS)	rSFcs tt|��|�||_||_dSr-)r�rSrPr��
_container)r%rVr�r�r*r+rPAsz _MutuallyExclusiveGroup.__init__cCs2|jrtd�}t|��|j�|�}|j�|�|S)Nz-mutually exclusive arguments must be optional)r�r�r�rerNr�r )r%rurr*r*r+rNFsz#_MutuallyExclusiveGroup._add_actioncCs|j�|�|j�|�dSr-)rerYr�rXr�r*r*r+rYNsz&_MutuallyExclusiveGroup._remove_action)Frdr*r*r�r+rS?srScs&eZdZddddgeddddddf�fdd�	Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	d@dd�Z
dAdd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�ZdBd%d&�ZdCd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�ZdDd5d6�ZdEd7d8�ZdFd9d:�ZdGd<d=�Zd>d?�Z �Z!S)HrNr%r(Tc
	s"tt|�j}
|
|||	|
d�|dkr6tj�tjd�}||_||_	||_
||_||_||_
||_|j}|td��|_|td��|_d|_dd�}|�dd|�d|kr�dn|d}|j
r�|j|d	|d
ddttd�d
�|D]<}|�|�z
|j}Wntk
�rYq�X|j�|�q�dS)N)r5r7r6r8rzpositional argumentszoptional argumentscSs|Sr-r*)r+r*r*r+�identity�sz)ArgumentParser.__init__.<locals>.identityrr%�hr7rqzshow this help message and exit)rur�rq)r�rrP�_os�path�basenamer�argvrNrh�epilog�formatter_class�fromfile_prefix_chars�add_help�allow_abbrevrRr��_positionals�
_optionals�_subparsersr:rwrr\r@r�rF)r%rNrhr5rl�parentsrmr7rnr6r8rorpZ	superinitZ	add_grouprfZdefault_prefixrW�defaultsr�r*r+rPfsJ�
�

zArgumentParser.__init__cs"ddddddg}�fdd�|D�S)	NrNrhr5rmr8rocsg|]}|t�|�f�qSr*r�r�r1r*r+r\�sz.ArgumentParser._get_kwargs.<locals>.<listcomp>r*r�r*r1r+r"�s�zArgumentParser._get_kwargsc	Ks�|jdk	r|�td��|�dt|��d|ks8d|krht|�dd��}t|�dd��}|�||�|_n|j|_|�d�dkr�|�	�}|�
�}|j}|�|j
||d�|����|d<|�|d�}|fd	gi|��}|j�|�|S)
Nz(cannot have multiple subparser argumentsrrZr5ZsubcommandsrNr]r4r�)rsr(r�rrr�rRrqr�r�_get_positional_actionsr?rlrhr`r{rLrN)	r%rrZr5rVr�rjZ
parsers_classrur*r*r+�add_subparsers�s$
zArgumentParser.add_subparserscCs$|jr|j�|�n|j�|�|Sr-)r�rrrNrqr�r*r*r+rN�szArgumentParser._add_actioncCsdd�|jD�S)NcSsg|]}|jr|�qSr*�r��rYrur*r*r+r\�s�z8ArgumentParser._get_optional_actions.<locals>.<listcomp>�r<r1r*r*r+�_get_optional_actions�s�z$ArgumentParser._get_optional_actionscCsdd�|jD�S)NcSsg|]}|js|�qSr*rxryr*r*r+r\�s�z:ArgumentParser._get_positional_actions.<locals>.<listcomp>rzr1r*r*r+rv�s�z&ArgumentParser._get_positional_actionscCs4|�||�\}}|r0td�}|�|d�|��|S�Nzunrecognized arguments: %sr~)rr�r(r$�r%r[r�rkrr*r*r+�
parse_args�s
zArgumentParser.parse_argscCs|dkrtjdd�}nt|�}|dkr.t�}|jD]4}|jtk	r4t||j�s4|jtk	r4t	||j|j�q4|j
D] }t||�spt	|||j
|�qpz>|�||�\}}t|t�r�|�
t|t��t|t�||fWStk
�rt��d}|�t|��YnXdSrQ)rrkr4r
r<r�rr�r�r�r@�_parse_known_argsrr�r��delattrr�exc_infor(r�)r%r[r�rur��errr*r*r+r�s,







zArgumentParser.parse_known_argscs�	jdk	r�	����i��	jD]R}|j}t|j�D]<\}}��|g�}|�|d|��|�||dd��q2qi�g}t��}	t|	�D]^\}}
|
dkr�|�d�|	D]}
|�d�q�q��	�	|
�}|dkr�d}n|�|<d}|�|�q�d�
|��t��t��d�����	fdd�	������	�fd	d
�}
�	�������	�fdd�}g�d
�
��r`t
��}nd}�
|k�r�t�
fdd��D��}�
|k�r�|�
�}|�
k�r�|�
�qdn|�
�
�k�r҈�
|�}��|�|�
|
�
��
�qd|�
�}���|d��g}�	jD]|}|�k�r|j�r(|�t|��nT|jdk	�rt|jt��rt�|j��r|jt�|j�k�rt�|j�	�||j���q|�r��	�td�d�
|���	jD]X}|j�r�|jD]}|�k�r��q��q�dd�|jD�}td�}�	�|d�
|���q���fS)NrR�--r%�A�Or]cs|��|���||�}||jk	rb��|���|g�D]*}|�kr6td�}t|�}t|||��q6|tk	rx|��||�dS)Nznot allowed with argument %s)r��_get_valuesr�r�r�r�rr)ruZargument_stringsr�Zargument_valuesZconflict_actionrZaction_name)�action_conflictsr��seen_actions�seen_non_default_actionsr%r*r+�take_action@s


z5ArgumentParser._parse_known_args.<locals>.take_actioncs~�|}|\}}}�j}g}|dkr:���|�|dS|dk	�r||d�}�j}|dkr�|d|kr�|�|g|f�|d}	|	|d}|dd�p�d}
�j}||kr�||}|
}ntd�}t|||��nB|dkr�|d}
|g}|�|||f��q\ntd�}t|||��q|d}�|d�}|||�}||}
�||
�}|�|||f��q\q|D]\}}}�|||��q`|
S)NrRr�rzignored explicit argument %r)�_match_argumentr r7r=r�r)�start_index�option_tuplerur��explicit_argZmatch_argumentZ
action_tuples�	arg_countrO�charZnew_explicit_argZ
optionals_mapr�stopr[r�Zselected_patterns)r&�arg_strings_pattern�extras�option_string_indicesr%r�r*r+�consume_optionalUsL



z:ArgumentParser._parse_known_args.<locals>.consume_optionalcsn�j}�|d�}|�|�}t�|�D]*\}}�|||�}||7}�||�q&�t|�d��dd�<|Sr-)�_match_arguments_partial�ziprn)r�Z
match_partialZselected_patternZ
arg_countsrur�r[)r&r�r�r%r�r*r+�consume_positionals�s
z=ArgumentParser._parse_known_args.<locals>.consume_positionalsrr�csg|]}|�kr|�qSr*r*)rYr�)r�r*r+r\�s�z4ArgumentParser._parse_known_args.<locals>.<listcomp>z(the following arguments are required: %srcSsg|]}|jtk	rt|��qSr*)rqrr�ryr*r*r+r\�s
�z#one of the arguments %s is requiredr~)N)rn�_read_args_from_filesr?r�r�rr��iterr �_parse_optionalr$r�rvr@r?r<r�r�r�r�r�r�r�r�r��
_get_valuer(r�)r%r&r�r[r�r�Zmutex_actionZ	conflictsZarg_string_pattern_partsZarg_strings_iter�
arg_stringr��patternr�r�Zmax_option_string_indexZnext_option_string_indexZpositionals_end_indexZstringsZ
stop_indexZrequired_actionsrur�r�rr*)r�r&r�r�r�r�r�r�r�r%r�r�r+rs�





J

�






�
���
�



�z ArgumentParser._parse_known_argsc
Cs�g}|D]�}|r|d|jkr*|�|�qzdt|dd���J}g}|����D]}|�|�D]}|�|�q\qN|�|�}|�|�W5QRXWqtk
r�t	�
�d}|�t|��YqXq|Sr�)
rnr r��readr��convert_arg_line_to_argsr�r�r*rr�r(r�)r%r&Znew_arg_stringsr�Z	args_file�arg_liner'r�r*r*r+r�s 
z$ArgumentParser._read_args_from_filescCs|gSr-r*)r%r�r*r*r+r�!sz'ArgumentParser.convert_arg_line_to_argscCsz|�|�}t�||�}|dkrldtd�ttd�ttd�i}|�|j�}|dkrbtdd|j�|j}t	||��t
|�d��S)Nzexpected one argumentzexpected at most one argumentzexpected at least one argumentzexpected %s argumentzexpected %s argumentsrR)�_get_nargs_patternrIrWr�r
rr�r�rrrnr�)r%rur��
nargs_patternrWZnargs_errorsrr*r*r+r�$s(
���
zArgumentParser._match_argumentcsrg}tt|�dd�D]X}|d|�}d��fdd�|D��}t�||�}|dk	r|�dd�|��D��qnq|S)Nrr�r]csg|]}��|��qSr*)r�ryr1r*r+r\@s�z;ArgumentParser._match_arguments_partial.<locals>.<listcomp>cSsg|]}t|��qSr*rm)rYr+r*r*r+r\Ds)r�rnr$rIrWr�rj)r%rir�r�r�Z
actions_slicer�rWr*r1r+r�:s�z'ArgumentParser._match_arguments_partialc
Cs|sdS|d|jkrdS||jkr8|j|}||dfSt|�dkrHdSd|kr~|�dd�\}}||jkr~|j|}|||fS|�|�}t|�dkr�d�dd�|D��}||d�}td�}|�||�nt|�dkr�|\}	|	S|j�	|�r�|j
s�dSd	|k�rdSd|dfS)
NrrR�=rcSsg|]\}}}|�qSr*r*)rYrur�r�r*r*r+r\is�z2ArgumentParser._parse_optional.<locals>.<listcomp>)r^Zmatchesz4ambiguous option: %(option)s could match %(matches)sr~)r7r=rn�split�_get_option_tuplesr$r�r(rArWrB)
r%r�rur�r�Z
option_tuplesZoptionsr[rr�r*r*r+r�Js>







�

zArgumentParser._parse_optionalc
Cs0g}|j}|d|kr�|d|kr�|jr~d|krB|�dd�\}}n|}d}|jD],}|�|�rP|j|}|||f}|�|�qPn�|d|k�r|d|k�r|}d}|dd�}|dd�}	|jD]T}||kr�|j|}|||	f}|�|�q�|�|�r�|j|}|||f}|�|�q�n|�td�|�|S)NrrRr�r7zunexpected option string: %s)r7rpr�r=�
startswithr r(r�)
r%r�r�rOZ
option_prefixr�rur�Zshort_option_prefixZshort_explicit_argr*r*r+r��s:









z!ArgumentParser._get_option_tuplescCs�|j}|dkrd}nf|tkr"d}nX|tkr0d}nJ|tkr>d}n<|tkrLd}n.|tkrZd}n |tkrhd}ndd	�d
|�}|jr�|�	d	d�}|�	dd�}|S)
Nz(-*A-*)z(-*A?-*)z	(-*[A-]*)z
(-*A[A-]*)z([-AO]*)z(-*A[-AO]*)z(-*-*)z(-*%s-*)z-*r�r]r%)
r�r
rrrrrr$r�r`)r%rur�r�r*r*r+r��s(z!ArgumentParser._get_nargs_patterncCs4|�||�\}}|r0td�}|�|d�|��|Sr|)�parse_known_intermixed_argsr�r(r$r}r*r*r+�parse_intermixed_args�s
z$ArgumentParser.parse_intermixed_argsc	s�|���dd��D�}|r,td|dj���fdd�|jD�rHtd���zN|j}z�|jdkrp|��dd�|_�D] }|j|_t	|_|j|_t	|_qt|�
||�\}}�D]J}t||j�r�t
||j�gkr�ddlm}|d	|j|f�t||j�q�W5�D]}|j|_|j|_q�X|��}zJ|D]}|j|_d
|_�q$|jD]}	|	j|	_d
|	_�q@|�
||�\}}
W5|D]}|j|_�qn|jD]}	|	j|	_�q�XW5||_X||
fS)NcSsg|]}|jttfkr|�qSr*)r�rrryr*r*r+r\�s�z>ArgumentParser.parse_known_intermixed_args.<locals>.<listcomp>z3parse_intermixed_args: positional arg with nargs=%srcs&g|]}|jD]}|�kr|j�qqSr*)r�r�)rYr�ru�r�r*r+r\�s
�z;parse_intermixed_args: positional in mutuallyExclusiveGroup�)�warnzDo not expect %s in %sF)rvr�r�r?rhZ
save_nargsZsave_defaultr��format_usagerrr�r�r��warningsr�r�r{Z
save_requiredr�)r%r[r��aZ
save_usageruZremaining_argsr�r�r�r�r*r�r+r��s`
�
��


�
z*ArgumentParser.parse_known_intermixed_argscs��jttfkr2z|�d�Wntk
r0YnX|sz�jtkrz�jrN�j}n�j}t	|t
�rv���|�}���|��n|s��jt
kr��js��jdk	r��j}n|}���|�n�t|�dkr�jdtfkr�|\}���|�}���|�n��jtk�r��fdd�|D�}np�jtk�r@��fdd�|D�}���|d�n>�jtk�rRt}n,��fdd�|D�}|D]}���|��qj|S)Nr�rRcsg|]}���|��qSr*�r��rY�v�rur%r*r+r\Z	sz.ArgumentParser._get_values.<locals>.<listcomp>csg|]}���|��qSr*r�r�r�r*r+r\^	srcsg|]}���|��qSr*r�r�r�r*r+r\g	s)r�rrrXr�r
r�r�r�r�r�r��_check_valuerrnr)r%rur&r)r�r�r*r�r+r�6	sD
�
zArgumentParser._get_valuesc	Cs�|�d|j|j�}t|�s0td�}t|||��z||�}Wn�tk
r~t|jdt|j��}tt	�
�d�}t||��YnLttfk
r�t|jdt|j��}||d�}td�}t|||��YnX|S)NrrIrrR)rr)z!invalid %(type)s value: %(value)r)
rErrMr�rrr�r!r�rr�r�r�)r%rur�rPrr�r(r[r*r*r+r�n	s 
zArgumentParser._get_valuecCsF|jdk	rB||jkrB|d�tt|j��d�}td�}t|||��dS)Nr)r)r�z3invalid choice: %(value)r (choose from %(choices)s))r�r$�mapr!r�r)r%rur)r[rr*r*r+r��	s�zArgumentParser._check_valuecCs$|��}|�|j|j|j�|��Sr-)rrlrhr<r?r`)r%rVr*r*r+r��	s
�zArgumentParser.format_usagecCst|��}|�|j|j|j�|�|j�|jD]0}|�|j	�|�|j�|�
|j�|��q.|�|j
�|��Sr-)rrlrhr<r?rfr5r>rbrZrxr�rcrlr`)r%rVZaction_groupr*r*r+r`�	s�

zArgumentParser.format_helpcCs|j|jd�S)Nr})rmrNr1r*r*r+r�	szArgumentParser._get_formattercCs"|dkrtj}|�|��|�dSr-)rrrr��r%�filer*r*r+�print_usage�	szArgumentParser.print_usagecCs"|dkrtj}|�|��|�dSr-)rrrr`r�r*r*r+r�	szArgumentParser.print_helpcCs |r|dkrtj}|�|�dSr-)r�stderr�write)r%r�r�r*r*r+r�	szArgumentParser._print_messagercCs |r|�|tj�t�|�dSr-)rrr�r)r%Zstatusr�r*r*r+r�	szArgumentParser.exitcCs0|�tj�|j|d�}|�dtd�|�dS)N)rNr�r7z%(prog)s: error: %(message)s
)r�rr�rNrr�)r%r�r[r*r*r+r(�	s	zArgumentParser.error)NN)NN)NN)NN)N)N)N)rN)"rr2r3rrPr"rwrNr{rvr~rrr�r�r�r�r�r�r�r�r�r�r�r�r�r`rr�rrrr(r�r*r*r�r+rSsT�@

#w:-1

M8


	
)2�__version__�__all__�osrh�rerIZshutilr:�sysrrr�rrr
rrrrrr�rr6rrrrr	r��	Exceptionrrrr�r�r�r�r�r�r�r�rr	rrr
r2rQrSrr*r*r*r+�<module>As~�z
	[#&]7:"__pycache__/warnings.cpython-38.pyc000064400000032526151153537570013260 0ustar00U

e5d�L�@s�dZddlZddddddd	d
gZd<dd�Zd=dd�Zd
d�Zdd�ZeZdd�ZeZ	dd�Z
dedddfdd�Zeddfdd�Z
dd�Zdd	�ZGdd�de�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd>d+d�Zd?d,d�ZGd-d.�d.e�ZGd/d
�d
e�Zd0d1�Zz0dd2lmZm Z m!Z!mZmZm"Z"e Z#e!Z$d3Z%Wn2e&k
�rngZd4Z#iZ$d*a'd5d6�Z"dZ%YnXeej(�e%�s�e)ed7��s�ed4e*d8d*d9�e
d:e*d*d;�e
d:e+d*d;�e
d:e,d*d;�e
d:e-d*d;�[%dS)@z&Python part of the warnings subsystem.�N�warn�
warn_explicit�showwarning�
formatwarning�filterwarnings�simplefilter�
resetwarnings�catch_warningscCst||||||�}t|�dS)�7Hook to write a warning to a file; replace if you like.N)�WarningMessage�_showwarnmsg_impl)�message�category�filename�lineno�file�line�msg�r� /usr/lib64/python3.8/warnings.pyr
scCst||||d|�}t|�S)�.Function to format a warning the standard way.N)r�_formatwarnmsg_impl)r
rrrrrrrrrscCsP|j}|dkr tj}|dkr dSt|�}z|�|�Wntk
rJYnXdS�N)r�sys�stderr�_formatwarnmsg�write�OSError)rr�textrrrrsrc		Cs�|jj}|j�d|j�d|�d|j�d�}|jdkrpzddl}|�|j|j�}Wqvtk
rld}d}YqvXn|j}|r�|�	�}|d|7}|j
dk	�r�zddl}Wntk
r�d}d}Yn4X|��}z|�
|j
�}Wntk
r�d}YnX|dk	�r�|d7}|D]t}|d|j|jf7}z$|dk	�rB|�|j|j�}nd}Wntk
�rbd}YnX|�r|�	�}|d	|7}�qn|�s�||�d
�7}|S)N�:z: �
rz  %s
Tz-Object allocated at (most recent call last):
z  File "%s", lineno %s
z    %s
z<: Enable tracemalloc to get the object allocation traceback
)r�__name__rrr
r�	linecache�getline�	Exception�strip�source�tracemalloc�
is_tracing�get_object_traceback)	rr�sr"rr'�tracing�tb�framerrrr#sT"




�

rcCsdzt}Wntk
rYn<X|tk	rXt|�s6td��||j|j|j|j|j	|j
�dSt|�dS)r
z:warnings.showwarning() must be set to a function or methodN)r�	NameError�_showwarning_orig�callable�	TypeErrorr
rrrrrr)r�swrrr�_showwarnmsg`s�r3cCsHzt}Wntk
rYn$X|tk	r@||j|j|j|j|j�St|�S)r)	rr.�_formatwarning_origr
rrrrr)r�fwrrrrus
�r�FcCs�|dkstd|f��t|t�s(td��t|t�s:td��t|t�sLtd��t|t�s^td��t|t�rp|dksxtd��|s�|r�dd	l}|r�|�||j	�}nd	}|r�|�|�}nd	}t
||||||d
�d	S)a�Insert an entry into the list of warnings filters (at the front).

    'action' -- one of "error", "ignore", "always", "default", "module",
                or "once"
    'message' -- a regex that the warning message must match
    'category' -- a class that the warning must be a subclass of
    'module' -- a regex that the module name must match
    'lineno' -- an integer line number, 0 matches all warnings
    'append' -- if true, append to the list of filters
    ��error�ignore�always�default�module�once�invalid action: %rzmessage must be a stringzcategory must be a classz#category must be a Warning subclasszmodule must be a stringr�lineno must be an int >= 0N��append)�AssertionError�
isinstance�str�type�
issubclass�Warning�int�re�compile�I�_add_filter)�actionr
rr<rrArIrrrr�s&
��cCsH|dkstd|f��t|t�r(|dks0td��t|d|d||d�dS)a�Insert a simple entry into the list of warnings filters (at the front).

    A simple filter matches all modules and messages.
    'action' -- one of "error", "ignore", "always", "default", "module",
                or "once"
    'category' -- a class that the warning must be a subclass of
    'lineno' -- an integer line number, 0 matches all warnings
    'append' -- if true, append to the list of filters
    r7r>rr?Nr@)rBrCrHrL)rMrrrArrrr�s

��cGsR|s6zt�|�Wntk
r&YnXt�d|�n|tkrHt�|�t�dS)Nr)�filters�remove�
ValueError�insertrA�_filters_mutated)rA�itemrrrrL�s
rLcCsgtdd�<t�dS)zAClear the list of warning filters, so that no filters are active.N)rNrRrrrrr�sc@seZdZdZdS)�_OptionErrorz,Exception used by option processing helpers.N)r!�
__module__�__qualname__�__doc__rrrrrT�srTcCsN|D]D}zt|�Wqtk
rF}ztd|tjd�W5d}~XYqXqdS)NzInvalid -W option ignored:)r)�
_setoptionrT�printrr)�args�argrrrr�_processoptions�s
r\c	Cs�|�d�}t|�dkr$td|f��t|�dkr<|�d�q$dd�|D�\}}}}}t|�}t|�}|sl|rtddl}|r�|�|�}|r�|�|�d}|r�zt|�}|dkr�t	�Wq�t	t
fk
r�td	|f�d�Yq�Xnd}t|||||�dS)
Nr�ztoo many fields (max 5): %rr6cSsg|]}|���qSr)r%)�.0r*rrr�
<listcomp>�s�z_setoption.<locals>.<listcomp>rz\Zzinvalid lineno %r)�split�lenrTrA�
_getaction�_getcategoryrI�escaperHrP�
OverflowErrorr)r[�partsrMr
rr<rrIrrrrX�s2
�
rXcCsB|sdS|dkrdSdD]}|�|�r|Sqtd|f��dS)Nr;�allr:)r;r:r9r<r=r8r>)�
startswithrT)rM�arrrrb�s

rbcCs�|stSd|krddl}|}nJ|�d�\}}}zt|dd|g�}Wn$tk
rftd|f�d�YnXzt||�}Wn$tk
r�td|f�d�YnXt|t�s�td|f��|S)N�.rzinvalid module name: %rzunknown warning category: %rzinvalid warning category: %r)	rG�builtins�
rpartition�
__import__�ImportErrorrT�getattr�AttributeErrorrF)r�m�klassr<�_�catrrrrc�s"
rccCs|jj}d|kod|kS)zFSignal whether the frame is an internal CPython implementation detail.�	importlib�
_bootstrap)�f_code�co_filename)r-rrrr�_is_internal_framesrycCs"|j}|dk	rt|�r|j}q|S)z;Find the next frame that doesn't involve CPython internals.N)�f_backry)r-rrr�_next_external_framesr{�c	Cst|t�r|j}|dkrt}t|t�r0t|t�sDtd�t|�j���zV|dks\t	t
�d��rht
�|�}n0t
�d�}t|d�D]}t
|�}|dkr~t�q~Wn"tk
r�t
j}d}d}YnX|j}|jj}|j}d|kr�|d}	nd}	|�di�}
t|||||	|
||�dS)z:Issue a warning, or maybe ignore it or raise an exception.Nz/category must be a Warning subclass, not '{:s}'r|rr!z<string>Z__warningregistry__)rCrG�	__class__�UserWarningrErFr1�formatr!ryr�	_getframe�ranger{rP�__dict__�	f_globalsrwrx�f_lineno�
setdefaultr)r
r�
stacklevelr&r-�x�globalsrrr<�registryrrrrs>
�



�cCs�t|�}|dkr8|pd}|dd���dkr8|dd�}|dkrDi}|�dd�tkrd|��t|d<t|t�r~t|�}|j}n|}||�}|||f}	|�|	�r�dSt	D]V}
|
\}}}
}}|dks�|�
|�r�t||
�r�|dks�|�
|�r�|dks�||kr��qq�t}|dk�rdSddl
}|�||�|dk�r2|�|dk�rfd	||	<||f}t�|��r\dSd	t|<nf|d
k�rrnZ|dk�r�d	||	<||df}|�|��r�dSd	||<n$|dk�r�d	||	<ntd
||
f��t|||||�}t|�dS)Nz	<unknown>���z.py�versionrr9r8r=r|r:r<r;z1Unrecognized action (%r) in warnings.filters:
 %s)rH�lower�get�_filters_version�clearrCrGrDr}rN�matchrF�
defaultactionr"�getlines�onceregistry�RuntimeErrorrr3)r
rrrr<r��module_globalsr&r�keyrSrMrrt�modZlnr"ZoncekeyZaltkeyrrrrGs|


�����









��c@s"eZdZdZddd�Zdd�ZdS)r)r
rrrrrr&NcCs>||_||_||_||_||_||_||_|r4|jnd|_dSr)	r
rrrrrr&r!�_category_name)�selfr
rrrrrr&rrr�__init__�szWarningMessage.__init__cCsd|j|j|j|j|jfS)NzD{message : %r, category : %r, filename : %r, lineno : %s, line : %r})r
r�rrr)r�rrr�__str__�s��zWarningMessage.__str__)NNN)r!rUrV�_WARNING_DETAILSr�r�rrrrr�s�
rc@s8eZdZdZddd�dd�Zdd�Zd	d
�Zdd�ZdS)
r	a�A context manager that copies and restores the warnings filter upon
    exiting the context.

    The 'record' argument specifies whether warnings should be captured by a
    custom implementation of warnings.showwarning() and be appended to a list
    returned by the context manager. Otherwise None is returned by the context
    manager. The objects appended to the list are arguments whose attributes
    mirror the arguments to showwarning().

    The 'module' argument is to specify an alternative module to the module
    named 'warnings' and imported under that name. This argument is only useful
    when testing the warnings module itself.

    FN)�recordr<cCs(||_|dkrtjdn||_d|_dS)z�Specify whether to record warnings and if an alternative module
        should be used other than sys.modules['warnings'].

        For compatibility with Python 3.0, please consider all arguments to be
        keyword-only.

        N�warningsF)�_recordr�modules�_module�_entered)r�r�r<rrrr��szcatch_warnings.__init__cCsPg}|jr|�d�|jtjdk	r4|�d|j�t|�j}d|d�|�fS)Nzrecord=Truer�z	module=%rz%s(%s)z, )r�rAr�rr�rEr!�join)r�rZ�namerrr�__repr__�s

zcatch_warnings.__repr__cCs~|jrtd|��d|_|jj|_|jdd�|j_|j��|jj|_|jj|_|j	rvg}|j
|j_|jj|j_|SdSdS)NzCannot enter %r twiceT)r�r�r�rN�_filtersrRr�_showwarningrr�rAr/)r��logrrr�	__enter__�s




zcatch_warnings.__enter__cGs>|jstd|��|j|j_|j��|j|j_|j|j_dS)Nz%Cannot exit %r without entering first)	r�r�r�r�rNrRr�rr)r��exc_inforrr�__exit__�s


zcatch_warnings.__exit__)r!rUrVrWr�r�r�r�rrrrr	�s
	cszd�j�d�g}�jdk	rVddl�ddl}��fdd�}|�d�||�t|���7}d�|��d�}t	|t
d	�d
�dS)Nzcoroutine 'z' was never awaited
rc3s4t�j�D]$\}}}��||�}||||fVq
dSr)�reversed�	cr_originr#)rr�funcnamer��coror"rr�extract�sz*_warn_unawaited_coroutine.<locals>.extractz-Coroutine created at (most recent call last)
r6r �)rr�r&)rVr�r"�	tracebackrA�format_list�listr��rstripr�RuntimeWarning)r��	msg_linesr�r�rrr�r�_warn_unawaited_coroutine�s�

r�)rN�_defaultaction�
_onceregistryrrrRTr;cCstd7adS)Nr|)r�rrrrrRsrRZgettotalrefcount�__main__)rr<rAr9)rrA)NN)N)Nr|N)NNNN).rWr�__all__rrrrr/r3r4rrGrrrLrr$rTr\rXrbrcryr{rr�objectrr	r��	_warningsrNr�r�rRr�r�Z_warnings_defaultsrnr��warnoptions�hasattr�DeprecationWarning�PendingDeprecationWarning�
ImportWarning�ResourceWarningrrrr�<module>s|�

;
�
#
	
)�
GC 

�__pycache__/sysconfig.cpython-38.opt-2.pyc000064400000032237151153537570014373 0ustar00U

��.e@a�
@sddlZddlZddlmZmZddddddd	d
ddd
gZdhZddddddddd�ddddddddd�ddddddddd�d d d!d!d"d#d$d%�d&d&d'd(d)d*d$d%�d+d+d,d,d-d*d$d%�d.�Zd%Zej	�
�dZd/ejdd0�Z
d1ejdd0�Zej�ej�Zej�ej�Zej�ej�Zej�ej�ZdadZd2d3�Zej�rRej�eej��Znee���Zej d4k�r�e�!��"d5��r�eej�#eee��Zd6ej$k�r�eej$d6�Zd7d8�Z%e&ed9d�Z'ej d4k�r�d:d;�Z(e(e�Ze(e'�Z'did=d>�Z)e)d?�Z*e*�rd@D]Z+dAee+dB<dCee+dD<�q�dEdF�Z,dGdH�Z-dIdJ�Z.dKdL�Z/dMdN�Z0djdOdP�Z1dQd�Z2dRdS�Z3dTdU�Z4dVdW�Z5dXdY�Z6dkdZd
�Z7d[d�Z8d\d�Z9d]d�Z:e/�dd?fd^d	�Z;e/�dd?fd_d�Z<d`d�Z=dad�Z>dbd
�Z?dcd�Z@ddde�ZAdfdg�ZBeCdhk�r�eB�dS)l�N)�pardir�realpath�get_config_h_filename�get_config_var�get_config_vars�get_makefile_filename�get_path�get_path_names�	get_paths�get_platform�get_python_version�get_scheme_names�parse_config_hZMACOSX_DEPLOYMENT_TARGETz/{installed_base}/lib64/python{py_version_short}z){platbase}/lib64/python{py_version_short}z1{base}/lib/python{py_version_short}/site-packagesz7{platbase}/lib64/python{py_version_short}/site-packagesz;{installed_base}/include/python{py_version_short}{abiflags}z?{installed_platbase}/include/python{py_version_short}{abiflags}z
{base}/binz{base})�stdlib�
platstdlib�purelib�platlib�include�platinclude�scripts�dataz{installed_base}/lib/pythonz{base}/lib/pythonz{installed_base}/include/pythonz{installed_base}/Libz
{base}/Libz{base}/Lib/site-packagesz{installed_base}/Includez{base}/Scriptsz#{userbase}/Python{py_version_nodot}z1{userbase}/Python{py_version_nodot}/site-packagesz+{userbase}/Python{py_version_nodot}/Includez+{userbase}/Python{py_version_nodot}/Scriptsz
{userbase})rrrrrrrz){userbase}/lib64/python{py_version_short}z5{userbase}/lib/python{py_version_short}/site-packagesz7{userbase}/lib64/python{py_version_short}/site-packagesz+{userbase}/include/python{py_version_short}z{userbase}/binz{userbase}/lib/pythonz#{userbase}/lib/python/site-packagesz{userbase}/include)�posix_prefix�
posix_home�ntZnt_userZ
posix_userZosx_framework_user�%d.%d�z%d%dcCs(z
t|�WStk
r"|YSXdS�N)r�OSError)�path�r�!/usr/lib64/python3.8/sysconfig.py�_safe_realpathis
r!r)z\pcbuild\win32z\pcbuild\amd64Z_PYTHON_PROJECT_BASEcCs,dD]"}tj�tj�|d|��rdSqdS)N)ZSetupzSetup.localZModulesTF)�osr�isfile�join)�d�fnrrr �_is_python_source_dir~sr'�_homecCs0|r,tj�|��tj�tj�td���r,tS|S)NZPCbuild)r"r�normcase�
startswithr$�_PREFIX)r%rrr �_fix_pcbuild�s
�r,FcCs|rtrtt�Stt�Sr)�	_sys_homer'�
_PROJECT_BASE)Z
check_homerrr �is_python_build�sr/T)rrz{srcdir}/Includerz{projectbase}/.rc
Csnz|jf|�WStk
rhz|jftj�WYStk
rb}ztd|�d�W5d}~XYnXYnXdS)Nz{%s})�format�KeyErrorr"�environ�AttributeError)�sZ
local_vars�varrrr �_subst_vars�sr6cCs0|��}|��D]\}}||kr"q|||<qdSr)�keys�items)Ztarget_dictZ
other_dictZtarget_keys�key�valuerrr �_extend_dict�s
r;cCsbi}|dkri}t|t��t|��D]4\}}tjdkrFtj�|�}tj�t	||��||<q(|S)N)�posixr)
r;r�_INSTALL_SCHEMESr8r"�namer�
expanduser�normpathr6)�scheme�vars�resr9r:rrr �_expand_vars�s
rDcCstjdkrdStjS)Nr<r)r"r>rrrr �_get_default_scheme�s
rEcCsztj�dd�}|r|Sdd�}tjdkrBtj�d�p6d}||d�Stjdkrptjrp|dd	tjd
tjdd��S|dd�S)
N�PYTHONUSERBASEcWstj�tjj|��Sr)r"rr?r$)�argsrrr �joinuser�sz_getuserbase.<locals>.joinuserr�APPDATA�~�Python�darwin�Libraryrrz.local)r"r2�getr>�sys�platform�
_framework�version_info)�env_baserH�baserrr �_getuserbase�s


�rUc	Cs`ddl}|�d�}|�d�}|�d�}|dkr2i}i}i}t|dd��}|��}	W5QRX|	D]�}
|
�d�s^|
��dkrzq^|�|
�}|r^|�d	d
�\}}
|
��}
|
�dd�}d|kr�|
||<q^z|t	kr�t
�t|
�}
Wn$t
k
r�|
�dd�||<Yq^X|
||<q^t|�
��}d
}t|�dk�r&t|�D�]�}||}|�|�}|�|�}|�rv|�rv|��|��k�rp|n|}n|�r�|n|}|dk	�r|�d	�}d}||k�r�t||�}n�||k�r�d}nx|tjk�r�tj|}n`||k�r0|�d��r
|dd�|k�r
d}n$d||k�rd}nt|d|�}nd||<}|�r||��d�}|d|���||}d|k�r~|||<n�z|t	k�r�t
�t|�}Wn"t
k
�r�|��||<Yn
X|||<|�|�|�d��r|dd�|k�r|dd�}||k�r|||<n|||<|�|��q,�q|��D]"\}}
t|
t��r.|
��||<�q.|�|�|S)Nrz"([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)z\$\(([A-Za-z][A-Za-z0-9_]*)\)z\${([A-Za-z][A-Za-z0-9_]*)}�surrogateescape)�errors�#��rz$$�$)ZCFLAGSZLDFLAGSZCPPFLAGSTFZPY_�)�re�compile�open�	readlinesr*�strip�match�group�replace�_ALWAYS_STR�
ValueError�int�listr7�len�tuple�search�start�strr"r2�end�remover8�
isinstance�update)�filenamerBr]Z_variable_rxZ_findvar1_rxZ_findvar2_rxZdoneZnotdone�f�lines�line�m�n�vZtmpvZ	variablesZrenamed_variablesr>r:Zm1Zm2�found�itemZafter�krrr �_parse_makefile�s�	












�



�


r|cCsdtrtj�tptd�Sttd�r0dttj	f}nd}ttj
d�rP|dtj
j7}tj�td�|d�S)NZMakefile�abiflagszconfig-%s%sZconfig�
_multiarchz-%sr)
�
_PYTHON_BUILDr"rr$r-r.�hasattrrO�_PY_VERSION_SHORTr}�implementationr~r)Zconfig_dir_namerrr rWs
c
Cs(tj�ddjtjtjttjdd�d��S)NZ_PYTHON_SYSCONFIGDATA_NAMEz+_sysconfigdata_{abi}_{platform}_{multiarch}r~rY)ZabirPZ	multiarch)	r"r2rNr0rOr}rP�getattrr�rrrr �_get_sysconfigdata_nameds��r�c
Cs�ddl}i}t�}zt||�WnJtk
rj}z,d|}t|d�rR|d|j}t|��W5d}~XYnXt�}z"t|��}t||�W5QRXWnJtk
r�}z,d|}t|d�r�|d|j}t|��W5d}~XYnXt	r�|d|d<t
�}dtjk�r$ddl
}|�|�}	||	_|	tj|<dt�tf}
ttd	��rF|
d
7}
tj|
dd�tj�|
|d
�}t|ddd��(}|�d�|�d�|j||d�W5QRXtdddd��}|�|
�W5QRXdS)Nrz.invalid Python installation: unable to open %s�strerrorz (%s)ZLDSHAREDZ	BLDSHAREDrLzbuild/lib.%s-%sZgettotalrefcountz-pydebugT)�exist_okz.py�w�utf8)�encodingzB# system configuration generated and used by the sysconfig module
zbuild_time_vars = )�streamzpybuilddir.txt)�pprintrr|rr�r�rr_rrr�rOrP�types�
ModuleType�build_time_vars�modulesrr�r"�makedirsrr$�write)r�rBZmakefile�e�msgZconfig_hrsr>r��moduleZ
pybuilddirZdestfilerrr �_generate_posix_varsmsL







r�cCs0t�}t|t�t�dgd�}|j}|�|�dS)Nr�r)r��
__import__�globals�localsr�rq)rBr>Z_tempr�rrr �_init_posix�sr�cCsfddl}td�|d<td�|d<td�|d<|��d|d<d	|d
<t|d<tj�ttj	��|d<dS)
NrrZLIBDESTrZ
BINLIBDESTrZ	INCLUDEPY�
EXT_SUFFIXz.exeZEXEZVERSIONZBINDIR)
�_impr�extension_suffixes�_PY_VERSION_SHORT_NO_DOTr"r�dirnamer!rO�
executable)rBr�rrr �_init_non_posix�sr�c	Cs�|dkri}ddl}|�d�}|�d�}|��}|s6q�|�|�}|r�|�dd�\}}z|tkrbt�t|�}Wntk
r�YnX|||<q(|�|�}|r(d||�d�<q(|S)Nrz"#define ([A-Z][A-Za-z0-9_]+) (.*)
z&/[*] #undef ([A-Z][A-Za-z0-9_]+) [*]/
rZr)r]r^�readlinerbrcrerfrg)	�fprBr]Z	define_rxZundef_rxrurvrwrxrrr r�s,




cCsBtr,tjdkr"tj�tptd�}q4tp(t}ntd�}tj�|d�S)NrZPCrz
pyconfig-64.h)rr"r>rr$r-r.r)Zinc_dirrrr r�s

cCsttt��Sr)rj�sortedr=rrrr r
�scCstSr)�_SCHEME_KEYSrrrr r	�scCs|rt||�St|SdSr)rDr=)rArB�expandrrr r
�s
cCst|||�|Sr)r
)r>rArBr�rrr r	scGsxtdk�rFiattd<ttd<ttd<ttd<ttd<ttd<ttd<ttd<ttd	<ttd
<zt	j
td<Wntk
r�dtd<YnXtj
d
kr�tt�tj
dkr�tt�t�d�}|dk	r�|td<t�td<t�dt�}tj
dk�rt�rtj�t��}tj�||�}ntj�t��}t|�td<t	jdk�rFddl}|�t�|�rpg}|D]}|�t�|���qT|StSdS)N�prefix�exec_prefixZ
py_versionZpy_version_shortZpy_version_nodotZinstalled_baserTZinstalled_platbaseZplatbaseZprojectbaser}rYrr<r��SO�userbase�srcdirrLr)�_CONFIG_VARSr+�_EXEC_PREFIX�_PY_VERSIONr�r��_BASE_PREFIX�_BASE_EXEC_PREFIXr.rOr}r3r"r>r�r�rNrUrrr�rr$r!rP�_osx_supportZcustomize_config_vars�append)rGr�r�rTr�Zvalsr>rrr rsP





cCs*|dkrddl}|�dtd�t��|�S)Nr�rz SO is deprecated, use EXT_SUFFIXr)�warnings�warn�DeprecationWarningrrN)r>r�rrr r^sc
Cs�tjdkrFdtj��krdSdtj��kr.dSdtj��kr@dStjStjdksZttd	�s`tjSd
tjkrttjd
St��\}}}}}|���	dd�}|�	d
d�}|�	dd�}|dd�dkr�d||fS|dd�dk�r,|ddk�r�d}dt
|d�d|dd�f}ddd�}|d|tj7}n�|dd�dk�rLd|||fS|dd �d!k�r�d!}ddl}|�
d"�}|�|�}|�r�|��}n2|dd �d#k�r�ddl}	|	�t�|||�\}}}d$|||fS)%NrZamd64z	win-amd64z(arm)z	win-arm32z(arm64)z	win-arm64r<�unameZ_PYTHON_HOST_PLATFORM�/rY� �_�-�Zlinuxz%s-%sZsunosr�5Zsolarisz%d.%sr\rZ32bitZ64bit)i���l����z.%sZaixz%s-%s.%s��cygwinz[\d.]+rLz%s-%s-%s)r"r>rO�version�lowerrPr�r2r�rdrg�maxsizer]r^rbrcr�Zget_platform_osxr)
ZosnameZhost�releaser��machineZbitnessr]Zrel_rervr�rrr rjsT


 



�
cCstSr)r�rrrr r�scCsFtt|����D]0\}\}}|dkr0td|�td||f�qdS)Nrz%s: z
	%s = "%s")�	enumerater�r8�print)�titler�indexr9r:rrr �_print_dict�sr�cCsfdtjkrt�dStdt��tdt��tdt��t�tdt��t�tdt	��dS)Nz--generate-posix-varszPlatform: "%s"zPython version: "%s"z!Current installation scheme: "%s"ZPathsZ	Variables)
rO�argvr�r�rrrEr�r
rrrrr �_main�s
r��__main__)F)N)N)Dr"rOZos.pathrr�__all__rer=r�r��splitr�rRr�r�rr@r�r+�base_prefixr�r�r��base_exec_prefixr�r�Z
_USER_BASEr!r�r�r.�getcwdr>r��endswithr$r2r'r�r-r,r/rrAr6r;rDrErUr|rr�r�r�r�rrr
r	r
rrrrrr�r��__name__rrrr �<module>s����
���
�
��?�
	
	

	?
"MP
__pycache__/quopri.cpython-38.opt-2.pyc000064400000010673151153537570013706 0ustar00U

e5dT�@s�ddddgZdZdZdZdZzdd	lmZmZWnek
rLd
Zd
ZYnXdd�Z	d
d�Z
ddd�Zddd�Zddd�Z
ddd�Zdd�Zdd�Zdd�Zedkr�e�d
S)�encode�decode�encodestring�decodestring�=�Ls0123456789ABCDEF��)�a2b_qp�b2a_qpNcCs:|dkr|S|dkr|S|tkp8d|ko2dknS)N� 	�_� �~)�ESCAPE)�c�	quotetabs�header�r�/usr/lib64/python3.8/quopri.py�needsquotings
rcCs(t|�}ttt|dt|df�S)N�)�ordr�bytes�HEX�rrrr�quote$srFc
Cs2tdk	r,|��}t|||d�}|�|�dS|dfdd�}d}|��}|sN�qg}	d}
|dd�dkrv|dd�}d}
|D]D}t|f�}t|||�r�t|�}|r�|dkr�|	�d�qz|	�|�qz|dk	r�||�t�	|	�}t
|�tk�r||dtd	�d
d�|td	d�}q�|}q>|dk	�r.|||
d�dS)N�rr�
cSsj|r<|dd�dkr<|�|dd�t|dd��|�n*|dkrX|�t|�|�n|�||�dS)N���r�.)�writer)�s�output�lineEndrrrr ;s
(zencode.<locals>.writerrr
r�s=
)r#)r
�readr �readlinerrr�append�EMPTYSTRING�join�len�MAXLINESIZE)
�inputr"rr�data�odatar Zprevline�lineZoutline�strippedrZthislinerrrr,s>	




cCsFtdk	rt|||d�Sddlm}||�}|�}t||||�|��S)Nrr��BytesIO)r
�ior2r�getvalue)r!rrr2�infp�outfprrrrjscCs�tdk	r*|��}t||d�}|�|�dSd}|��}|s>�q�dt|�}}|dkr�||d|�dkr�d}	|d}|dkr�||d|�dkr�|d}qtnd}	||k�r�|||d�}
|
dkr�|r�|d}|d}q�|
tkr�||
}|d}q�|d|k�r|	�sd}	�q�q�|d|k�rJ||d|d	�tk�rJ|t}|d	}q�|d	|k�r�t||d|d	���r�t||d	|d
���r�|tt||d|d
��f�}|d
}q�||
}|d}q�|	s.|�|d�d}q.|�r�|�|�dS)N�rrrr$rs 	
rr
��)	r	r%r r&r*r�ishexr�unhex)r,r"rr-r.�newr/�i�n�partialrrrrrusP



(
B"

cCsDtdk	rt||d�Sddlm}||�}|�}t|||d�|��S)Nr7rr1)r	r3r2rr4)r!rr2r5r6rrrr�scCsHd|kodknpFd|ko*dknpFd|koBdkSS)N�0�9�a�f�A�Frrrrrr:�sr:cCs�d}|D]�}t|f�}d|kr*dkr8nn
td�}nLd|krLdkr^nntd�d}n&d	|krrd
kr�nntd	�d}n|dt|�|}q|S)Nrr@rA�0rBrC�a�
rDrEr)rr)r!�bitsrr=rrrr;�s

r;cCs�ddl}ddl}z|�|jdd�d�\}}WnV|jk
r�}z6|j|_t|�td�td�td�|�d�W5d}~XYnXd}d}|D] \}}|dkr�d}|d	kr�d}q�|r�|r�|j|_td
�|�d�|s�dg}d}	|D]�}
|
dkr�|jj	}nTzt
|
d�}WnDtk
�rP}z$|j�d
|
|f�d}	WY�q�W5d}~XYnXz*|�rjt||jj	�nt||jj	|�W5|
dk�r�|�
�Xq�|	�r�|�|	�dS)Nrr$Ztdz"usage: quopri [-t | -d] [file] ...z-t: quote tabsz-d: decode; default encoder8z-tz-dz -t and -d are mutually exclusive�-�rbz%s: can't open (%s)
)�sys�getopt�argv�error�stderr�stdout�print�exit�stdin�buffer�open�OSErrorr �closerr)rLrMZopts�args�msgZdecoZtabs�orG�sts�file�fprrr�main�sT


r_�__main__)F)FF)F)F)�__all__rr+rr(Zbinasciir	r
�ImportErrorrrrrrrr:r;r_�__name__rrrr�<module>s(

>

+
.__pycache__/keyword.cpython-38.pyc000064400000001750151153537570013107 0ustar00U

e5d��#@sddZddgZddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%g#Zee�jZd&S)'a�Keywords (from "Grammar/Grammar")

This file is automatically generated; please don't muck it up!

To update the symbols in this file, 'cd' to the top directory of
the python source tree and run:

    python3 -m Parser.pgen.keywordgen Grammar/Grammar                                       Grammar/Tokens                                       Lib/keyword.py

Alternatively, you can run 'make regen-keyword'.
�	iskeyword�kwlist�False�None�True�and�as�assert�async�await�break�class�continue�def�del�elif�else�except�finally�for�from�global�if�import�in�is�lambda�nonlocal�not�or�pass�raise�return�try�while�with�yieldN)�__doc__�__all__r�	frozenset�__contains__r�r*r*�/usr/lib64/python3.8/keyword.py�<module>sL�&__pycache__/copy.cpython-38.opt-2.pyc000064400000011103151153537570013326 0ustar00U

e5d�!�@sPddlZddlZddlmZGdd�de�ZeZzddlmZWne	k
rXdZYnXdddgZ
dd�ZiZZ
d	d
�Zed�eeeeeeeeeeeeejee�ee�ejejfD]Z ee
e <q�e!edd�Z e dk	r�ee
e <e"je
e"<e#je
e#<e$je
e$<e%je
e%<edk	�reje
e<[
[ dgfdd�Z&iZ'Z
d
d�Z(e(e
ed�<e(e
ee�<e(e
ee�<e(e
e<e(e
e<e(e
e<e(e
e<e(e
e<e(e
e<e(e
ej)<e(e
e<e(e
ej<e(e
ej<e(e
ej<e(e
e<e&fdd�Z*e*e
e"<e&fdd�Z+e+e
e<e&fdd�Z,e,e
e#<edk	�re,e
e<dd�Z-e-e
ej.<[
dd�Z/ddde&fdd�Z0[[[dS)�N)�dispatch_tablec@seZdZdS)�ErrorN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/copy.pyr7sr)�PyStringMap�copy�deepcopycCs�t|�}t�|�}|r||�St|t�r0t|�St|dd�}|dk	rL||�St�|�}|dk	rh||�}nBt|dd�}|dk	r�|d�}n$t|dd�}|r�|�}ntd|��t|t	�r�|St
|df|��S)N�__copy__�
__reduce_ex__��
__reduce__z%un(shallow)copyable object of type %s)�type�_copy_dispatch�get�
issubclass�_copy_immutable�getattrrr�
isinstance�str�_reconstruct)�x�cls�copier�reductor�rvrrrr
Bs,





cCs|S�Nr)rrrrrksr�CodeTypec	Cs |dkri}t|�}|�||�}||k	r,|St|�}t�|�}|dk	rR|||�}n�t|t�rht||�}n�t|dd�}|dk	r�||�}nzt�|�}|r�||�}nBt|dd�}|dk	r�|d�}n$t|dd�}|r�|�}ntd|��t	|t
�r�|}nt||f|��}||k	�r|||<t||�|S)N�__deepcopy__r
rrz"un(deep)copyable object of type %s)
�idrr�_deepcopy_dispatchr�_deepcopy_atomicrrrrrr�_keep_alive)	r�memoZ_nil�d�yrrrrrrrr�sD





�


cCs|Srr�rr%rrrr#�sr#cCs2g}||t|�<|j}|D]}||||��q|Sr)r!�append)rr%rr'r)�arrr�_deepcopy_list�sr+csh��fdd�|D�}z�t|�WStk
r6YnXt||�D]\}}||k	rBt|�}qdqB|}|S)Ncsg|]}�|���qSrr)�.0r*�rr%rr�
<listcomp>�sz#_deepcopy_tuple.<locals>.<listcomp>)r!�KeyError�zip�tuple)rr%rr'�k�jrr-r�_deepcopy_tuple�sr4cCs:i}||t|�<|��D]\}}|||�||||�<q|Sr)r!�items)rr%rr'�key�valuerrr�_deepcopy_dict�s
r8cCst|�|jt|j|��Sr)r�__func__r�__self__r(rrr�_deepcopy_method�sr;cCs>z|t|��|�Wn"tk
r8|g|t|�<YnXdSr)r!r)r/r(rrrr$�s
r$csb�dk	}|r$|r$��fdd�|D�}||�}	|r<|	�t|�<|dk	r�|rR�|��}t|	d�rh|	�|�n^t|t�r�t|�dkr�|\}}
nd}
|dk	r�|	j�|�|
dk	r�|
��D]\}}t	|	||�q�|dk	�r|r�|D]}
�|
��}
|	�
|
�q�n|D]}
|	�
|
�q�|dk	�r^|�rF|D]&\}}�|��}�|��}||	|<�qn|D]\}}||	|<�qJ|	S)Nc3s|]}�|��VqdSrr)r,�argr-rr�	<genexpr>sz_reconstruct.<locals>.<genexpr>�__setstate__�)r!�hasattrr>rr1�len�__dict__�updater5�setattrr))rr%�func�args�stateZlistiterZdictiterrZdeepr'Z	slotstater6r7�itemrr-rrsF







r)1�types�weakref�copyregr�	Exceptionr�errorZorg.python.corer	�ImportError�__all__r
rr&rr�int�float�bool�complexrr1�bytes�	frozenset�range�slice�property�BuiltinFunctionType�Ellipsis�NotImplemented�FunctionType�ref�tr�list�dict�set�	bytearrayrr"r#rr+r4r8r;�
MethodTyper$rrrrr�<module>3s�

'�






4





�
-__pycache__/stringprep.cpython-38.opt-2.pyc000064400000024765151153537570014573 0ustar00U

e5du2��@s�ddlmZdd�Zedddddd	d
ddd
dgeedd���Zdd�Zdddddddddddddd d!d"d#d$d%d&dd'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBd;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdCdDdEdFdGdHdIdJdKdLdMdNdOdLddPdQdRdSdTdQdUddVdWdXddYdZd[d\d]d^d_d`d]dadbdcdddedfdfdfdgdgdhdidjdkdldmdmdmdndodpdqdqdrdbdsdtdudvd$dwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d{d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�drdbdwdsdtd�dfdgd�d�dhdudid�dkdldmdd�d�d�d�d�d�dqd�drdbdwdsdtd�dfdgd�d�dhdudid�dkdldmdd�d�d�d�d�d�dqd�drdbdwdsdtd�dfdgd�d�dhdudid�dkdldmdd�d�d�d�d�d�dqd�dbdwd�d�d�did�dkdldd�d�d�d�d�d�dqd�drdbdwdsdtd�dfdgd�d�dhdudid�dkdldmdd�d�d�d�d�d�dqd�drdwdsdtd�d�d�dhdudid�dkdldd�d�d�d�d�d�d�drdwdsdtd�dgd�d�dhdud�dd�d�d�d�d�d�d�drdbdwdsdtd�dfdgd�d�dhdudid�dkdldmdd�d�d�d�d�d�dqd�drdbdwdsdtd�dfdgd�d�dhdudid�dkdldmdd�d�d�d�d�d�dqd�drdbdwdsdtd�dfdgd�d�dhdudid�dkdldmdd�d�d�d�d�d�dqd�drdbdwdsdtd�dfdgd�d�dhdudid�dkdldmdd�d�d�d�d�d�dqd�drdbdwdsdtd�dfdgd�d�dhdudid�dkdldmdd�d�d�d�d�d�dqd�drdbdwdsdtd�dfdgd�d�dhdudid�dkdldmdd�d�d�d�d�d�dqd�ddvd�d'd�d�ddd%d�dd�d�d�d$d&ddd�d d#d�d�d�dd�ddvd�d'd�d�ddd%d�dd�d�d�d$d&ddd�d d#d�d�d�dd�ddvd�d'd�d�ddd%d�dd�d�d�d$d&ddd�d d#d�d�d�dd�ddvd�d'd�d�ddd%d�dd�d�d�d$d&ddd�d d#d�d�d�dd�ddvd�d'd�d�ddd%d�dd�d�d�d$d&ddd�d d#d�d�d�ddɐ��Zd�d˄Z	d�d̈́Z
d�dτZd�dфZd�dӄZ
d�dՄZed�d�d�ddd�d�dgeed
dۃ�eed�d݃�eed�d߃�eed�d���Zd�d�Zd�d�Zd�d�Zd�d�Zd�d�Zeed�d��Zd�d�Zeed�d��Zd�d�Zed�d�d�d�geed�d���eed�d݃��Zd�d��Zed�geed�d����Zd�d��Z�d�d�Z�d�d�Z�dS(�)�	ucd_3_2_0cCsBt�|�dkrdSt|�}d|kr.dkr6nndS|d@dkS)NZCnF�������r)�unicodedata�category�ord��code�c�r�"/usr/lib64/python3.8/stringprep.py�in_table_a1sr�iOiiii
i i i
 i` i��i�i�cCst|�tkS�N)r
�b1_set�rrrr�in_table_b1sruμZssui̇uʼn�suǰuιu ιuΐuΰuσuβuθuυuύuϋuφuπuκuρuεuեւuẖuẗuẘuẙuaʾuṡuὐuὒuὔuὖuἀιuἁιuἂιuἃιuἄιuἅιuἆιuἇιuἠιuἡιuἢιuἣιuἤιuἥιuἦιuἧιuὠιuὡιuὢιuὣιuὤιuὥιuὦιuὧιuὰιuαιuάιuᾶuᾶιuὴιuηιuήιuῆuῆιuῒuῖuῗuῢuῤuῦuῧuὼιuωιuώιuῶuῶιZrsr
u°cuɛu°f�h�i�l�nZno�p�q�rZsmZtelZtm�z�b�e�f�muγ�dZhpaZauZovZpaZnauμaZmaZkaZkbZmbZgbZpfZnfuμf�hzZkhzZmhzZghzZthzZkpaZmpaZgpaZpvZnvuμvZmvZkvZpwZnwuμwZmw�kwukωumωZbquc∕kgzco.ZdbZgyZhpZkkZkmZphZppmZprZsv�wbZffZfiZflZffiZffl�stuմնuմեuմիuվնuմխ�a�g�j�k�o�t�u�v�w�x�yuαuδuζuηuλuνuξuοuτuχuψuω(����i0iIii�iEizi�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�iPiRiTiVi�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i� i!i!i!i	!i!i!i
!i!i!i!i!i!i!i!i!i!i!i !i!!i"!i$!i(!i,!i-!i0!i1!i3!i>!i?!iE!iq3is3iu3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�3i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i	�i
�i�i�i
�i�i�i�i�i�i�i�i�i�i�i�i�i4�i5�i6�i7�i8�i9�i:�i;�i<�i=�i>�i?�i@�iA�iB�iC�iD�iE�iF�iG�iH�iI�iJ�iK�iL�iM�ih�ii�ij�ik�il�im�in�io�ip�iq�ir�is�it�iu�iv�iw�ix�iy�iz�i{�i|�i}�i~�i�i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i�i�i�i�i	�i
�i
�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i8�i9�i;�i<�i=�i>�i@�iA�iB�iC�iD�iF�iJ�iK�iL�iM�iN�iO�iP�il�im�in�io�ip�iq�ir�is�it�iu�iv�iw�ix�iy�iz�i{�i|�i}�i~�i�i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i�i	�i
�i�i�i
�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i�i �i!�i<�i=�i>�i?�i@�iA�iB�iC�iD�iE�iF�iG�iH�iI�iJ�iK�iL�iM�iN�iO�iP�iQ�iR�iS�iT�iU�ip�iq�ir�is�it�iu�iv�iw�ix�iy�iz�i{�i|�i}�i~�i�i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i
�i�i�i�i�i �i!�i"�i#�i$�i%�i&�i'�i(�i)�i*�i+�i,�i-�i.�i/�i0�i1�i2�i3�i4�iG�iV�iW�iX�iY�iZ�i[�i\�i]�i^�i_�i`�ia�ib�ic�id�ie�if�ig�ih�ii�ij�ik�il�im�in�i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��i��cCs"t�t|��}|dk	r|S|��Sr)�
b3_exceptions�getr
�lower)rrrrr�map_table_b3�sr8cCsHt|�}t�d|�}d�dd�|D��}t�d|�}||kr@|S|SdS)NZNFKC�cSsg|]}t|��qSr)r8)�.0Zchrrr�
<listcomp>�sz map_table_b2.<locals>.<listcomp>)r8rZ	normalize�join)r(ZalrZblr
rrr�map_table_b2�sr=cCs|dkS)N� rrrrr�in_table_c11�sr?cCst�|�dko|dkS)N�Zsr>�rr	rrrr�in_table_c12�srBcCst�|�dkS)Nr@rArrrr�in_table_c11_c12�srCcCst|�dkot�|�dkS)N��Cc)r
rr	rrrr�in_table_c21�srFi�iii( i) id ij ip i��i��is�i{�cCs.t|�}|dkrdSt�|�dkr&dS|tkS)NrDFrET)r
rr	�c22_specialsrrrr�in_table_c22�srHcCst�|�dkpt|�tkS)NrE)rr	r
rGrrrr�in_table_c21_c22�s
�rIcCst�|�dkS)NZCorArrrr�in_table_c3�srJcCs0t|�}|dkrdS|dkr dSt|�d@dkS)NrFrTrr)r
rrrr�in_table_c4�srKcCst�|�dkS)NZCsrArrrr�in_table_c5�srLrcCst|�tkSr)r
�c6_setrrrr�in_table_c6�srNi�/i�/cCst|�tkSr)r
�c7_setrrrr�in_table_c7�srPi@iAi i i* i/ cCst|�tkSr)r
�c8_setrrrr�in_table_c8srRii i�cCst|�tkSr)r
�c9_setrrrr�in_table_c9srTcCst�|�dkS)N)�RZAL�rZ
bidirectionalrrrr�in_table_d1srWcCst�|�dkS)N�LrVrrrr�in_table_d2srYN)rrr�set�list�rangerrr5r8r=r?rBrCrFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrWrYrrrr�<module>sL,��&P,__pycache__/tty.cpython-38.pyc000064400000002066151153537570012244 0ustar00U

e5do�@sLdZddlTddgZdZdZdZdZdZd	Zd
Z	e
fdd�Ze
fdd�Zd
S)zTerminal utilities.�)�*�setraw�	setcbreak������cCs�t|�}|tttBtBtBtB@|t<|tt@|t<|t	t
tB@|t	<|t	tB|t	<|t
ttBtBtB@|t
<d|tt<d|tt<t|||�dS)zPut terminal into a raw mode.rrN)�	tcgetattr�IFLAGZBRKINTZICRNLZINPCKZISTRIPZIXON�OFLAGZOPOST�CFLAGZCSIZEZPARENBZCS8�LFLAG�ECHO�ICANONZIEXTENZISIG�CC�VMIN�VTIME�	tcsetattr��fdZwhen�mode�r�/usr/lib64/python3.8/tty.pyrs"cCsFt|�}|tttB@|t<d|tt<d|tt<t|||�dS)z Put terminal into a cbreak mode.rrN)rrrrrrrrrrrrrs
N)
�__doc__Ztermios�__all__rr
rrZISPEEDZOSPEEDrZ	TCSAFLUSHrrrrrr�<module>s__pycache__/argparse.cpython-38.pyc000064400000171507151153537570013237 0ustar00U

e5dw�@s0dZdZdddddddd	d
ddd
dddddgZddlZddlZddlZddl	Z
ddlmZm
Z
dZdZdZdZdZdZdZGdd�de�Zdd �ZGd!d�de�ZGd"d�de�ZGd#d	�d	e�ZGd$d�de�ZGd%d
�d
e�Zd&d'�ZGd(d�de�ZGd)d�de�Z Gd*d�de�Z!Gd+d,�d,e!�Z"Gd-d.�d.e!�Z#Gd/d0�d0e#�Z$Gd1d2�d2e#�Z%Gd3d4�d4e!�Z&Gd5d6�d6e!�Z'Gd7d8�d8e!�Z(Gd9d:�d:e!�Z)Gd;d<�d<e!�Z*Gd=d>�d>e!�Z+Gd?d@�d@e&�Z,GdAd�de�Z-GdBd�de�Z.GdCdD�dDe�Z/GdEdF�dFe/�Z0GdGdH�dHe0�Z1GdId�dee/�Z2dS)Ja�
Command-line parsing library

This module is an optparse-inspired command-line parsing library that:

    - handles both optional and positional arguments
    - produces highly informative usage messages
    - supports parsers that dispatch to sub-parsers

The following is a simple usage example that sums integers from the
command-line and writes the result to a file::

    parser = argparse.ArgumentParser(
        description='sum the integers at the command line')
    parser.add_argument(
        'integers', metavar='int', nargs='+', type=int,
        help='an integer to be summed')
    parser.add_argument(
        '--log', default=sys.stdout, type=argparse.FileType('w'),
        help='the file where the sum should be written')
    args = parser.parse_args()
    args.log.write('%s' % sum(args.integers))
    args.log.close()

The module contains the following public classes:

    - ArgumentParser -- The main entry point for command-line parsing. As the
        example above shows, the add_argument() method is used to populate
        the parser with actions for optional and positional arguments. Then
        the parse_args() method is invoked to convert the args at the
        command-line into an object with attributes.

    - ArgumentError -- The exception raised by ArgumentParser objects when
        there are errors with the parser's actions. Errors raised while
        parsing the command-line are caught by ArgumentParser and emitted
        as command-line messages.

    - FileType -- A factory for defining types of files to be created. As the
        example above shows, instances of FileType are typically passed as
        the type= argument of add_argument() calls.

    - Action -- The base class for parser actions. Typically actions are
        selected by passing strings like 'store_true' or 'append_const' to
        the action= argument of add_argument(). However, for greater
        customization of ArgumentParser actions, subclasses of Action may
        be defined and passed as the action= argument.

    - HelpFormatter, RawDescriptionHelpFormatter, RawTextHelpFormatter,
        ArgumentDefaultsHelpFormatter -- Formatter classes which
        may be passed as the formatter_class= argument to the
        ArgumentParser constructor. HelpFormatter is the default,
        RawDescriptionHelpFormatter and RawTextHelpFormatter tell the parser
        not to change the formatting for help text, and
        ArgumentDefaultsHelpFormatter adds information about argument defaults
        to the help.

All other classes in this module are considered implementation details.
(Also note that HelpFormatter and RawDescriptionHelpFormatter are only
considered public as object names -- the API of the formatter objects is
still considered an implementation detail.)
z1.1�ArgumentParser�
ArgumentError�ArgumentTypeError�FileType�
HelpFormatter�ArgumentDefaultsHelpFormatter�RawDescriptionHelpFormatter�RawTextHelpFormatter�MetavarTypeHelpFormatter�	Namespace�Action�ONE_OR_MORE�OPTIONAL�PARSER�	REMAINDER�SUPPRESS�ZERO_OR_MORE�N)�gettext�ngettextz==SUPPRESS==�?�*�+zA...�...Z_unrecognized_argsc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_AttributeHolderaAbstract base class that provides __repr__.

    The __repr__ method returns a string in the format::
        ClassName(attr=name, attr=name, ...)
    The attributes are determined either by a class-level attribute,
    '_kwarg_names', or by inspecting the instance __dict__.
    cCs�t|�j}g}i}|��D]}|�t|��q|��D],\}}|��rZ|�d||f�q6|||<q6|rz|�dt|��d|d�|�fS)N�%s=%rz**%s�%s(%s)�, )�type�__name__�	_get_args�append�repr�_get_kwargs�isidentifier�join)�selfZ	type_name�arg_stringsZ	star_args�arg�name�value�r*� /usr/lib64/python3.8/argparse.py�__repr__ts

z_AttributeHolder.__repr__cCst|j���S�N)�sorted�__dict__�items�r%r*r*r+r"�sz_AttributeHolder._get_kwargscCsgSr-r*r1r*r*r+r�sz_AttributeHolder._get_argsN)r�
__module__�__qualname__�__doc__r,r"rr*r*r*r+rksrcCs6|dkrgSt|�tkr$|dd�Sddl}|�|�S)Nr)r�list�copy)r0r6r*r*r+�_copy_items�sr7c@s�eZdZdZd;dd�Zdd�Zd	d
�ZGdd�de�Zd
d�Z	dd�Z
dd�Zdd�Zd<dd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�ZdS)=rz�Formatter for generating usage messages and argument help strings.

    Only the name of this class is considered a public API. All the methods
    provided by the class are considered an implementation detail.
    ��NcCs�|dkrt��j}|d8}||_||_t|t|d|d��|_||_d|_	d|_
d|_|�|d�|_
|j
|_t�dtj�|_t�d�|_dS)Nr8�rz\s+z\n\n\n+)�_shutil�get_terminal_size�columns�_prog�_indent_increment�min�max�_max_help_position�_width�_current_indent�_level�_action_max_length�_Section�
_root_section�_current_section�_re�compile�ASCII�_whitespace_matcher�_long_break_matcher)r%�progZindent_incrementZmax_help_position�widthr*r*r+�__init__�s 
�zHelpFormatter.__init__cCs"|j|j7_|jd7_dS�N�)rDr?rEr1r*r*r+�_indent�szHelpFormatter._indentcCs4|j|j8_|jdks"td��|jd8_dS)NrzIndent decreased below 0.rS)rDr?�AssertionErrorrEr1r*r*r+�_dedent�szHelpFormatter._dedentc@seZdZddd�Zdd�ZdS)zHelpFormatter._SectionNcCs||_||_||_g|_dSr-)�	formatter�parent�headingr0)r%rWrXrYr*r*r+rQ�szHelpFormatter._Section.__init__cCs�|jdk	r|j��|jj}|dd�|jD��}|jdk	rD|j��|sLdS|jtk	rz|jdk	rz|jj}d|d|jf}nd}|d||dg�S)NcSsg|]\}}||��qSr*r*)�.0�func�argsr*r*r+�
<listcomp>�sz6HelpFormatter._Section.format_help.<locals>.<listcomp>�z%*s%s:
�
)	rXrWrT�_join_partsr0rVrYrrD)r%r$Z	item_helpZcurrent_indentrYr*r*r+�format_help�s



z"HelpFormatter._Section.format_help)N)rr2r3rQrar*r*r*r+rG�s
rGcCs|jj�||f�dSr-)rIr0r )r%r[r\r*r*r+�	_add_item�szHelpFormatter._add_itemcCs0|��|�||j|�}|�|jg�||_dSr-)rTrGrIrbra)r%rYZsectionr*r*r+�
start_section�szHelpFormatter.start_sectioncCs|jj|_|��dSr-)rIrXrVr1r*r*r+�end_section�s
zHelpFormatter.end_sectioncCs$|tk	r |dk	r |�|j|g�dSr-)rrb�_format_text)r%�textr*r*r+�add_text�szHelpFormatter.add_textcCs&|tk	r"||||f}|�|j|�dSr-)rrb�
_format_usage)r%�usage�actions�groups�prefixr\r*r*r+�	add_usage�szHelpFormatter.add_usagecCsv|jtk	rr|j}||�g}|�|�D]}|�||��q$tdd�|D��}||j}t|j|�|_|�|j	|g�dS)NcSsg|]}t|��qSr*��len�rZ�sr*r*r+r]
sz.HelpFormatter.add_argument.<locals>.<listcomp>)
�helpr�_format_action_invocation�_iter_indented_subactionsr rArDrFrb�_format_action)r%�actionZget_invocationZinvocations�	subactionZinvocation_lengthZ
action_lengthr*r*r+�add_arguments


�zHelpFormatter.add_argumentcCs|D]}|�|�qdSr-)rx)r%rjrvr*r*r+�
add_argumentsszHelpFormatter.add_argumentscCs.|j��}|r*|j�d|�}|�d�d}|S)N�

r_)rHrarN�sub�strip)r%rrr*r*r+ras

zHelpFormatter.format_helpcCsd�dd�|D��S)Nr^cSsg|]}|r|tk	r|�qSr*)r)rZ�partr*r*r+r]!s�z-HelpFormatter._join_parts.<locals>.<listcomp>)r$)r%Zpart_stringsr*r*r+r` s
�zHelpFormatter._join_partscs6|dkrtd�}|dk	r,|t|jd�}�n�|dkrL|sLdt|jd�}�n�|dk�r*dt|jd�}g}g}|D] }|jr�|�|�qr|�|�qr|j}	|	|||�}
d�dd�||
fD��}|j|j�t	|�t	|��k�r*d}|	||�}|	||�}
t
�||�}t
�||
�}d�|�|k�s&t�d�|�|
k�s:t�d�fdd	�	}t	|�t	|�d
�k�r�dt	|�t	|�d}|�r�||g|||�}|�
|||��n |�r�||g|||�}n|g}nZdt	|�}||}|||�}t	|�dk�rg}|�
|||��|�
|||��|g|}d�|�}d
||fS)Nzusage: �rOz%(prog)s� cSsg|]}|r|�qSr*r*rpr*r*r+r]Asz/HelpFormatter._format_usage.<locals>.<listcomp>z%\(.*?\)+(?=\s|$)|\[.*?\]+(?=\s|$)|\S+cs�g}g}|dk	rt|�d}nt|�d}|D]Z}|dt|��krn|rn|�|d�|��g}t|�d}|�|�|t|�d7}q.|r�|�|d�|��|dk	r�|dt|�d�|d<|S)NrSrr)ror r$)�parts�indentrl�lines�lineZline_lenr}��
text_widthr*r+�	get_linesUs"
z.HelpFormatter._format_usage.<locals>.get_linesg�?rSr_z%s%s

)N)�_�dictr>�option_stringsr �_format_actions_usager$rCrDrorJ�findallrU�extend)r%rirjrkrlrO�	optionals�positionalsrv�formatZaction_usageZpart_regexpZ	opt_usageZ	pos_usageZ	opt_partsZ	pos_partsr�r�r�r�r*r�r+rh%s\
�




zHelpFormatter._format_usagec	Cs�t�}i}|D�]}z|�|jd�}Wntk
r@YqYqX|t|j�}|||�|jkr|jD]}|�|�qh|js�||kr�||d7<nd||<||kr�||d7<nd||<nF||kr�||d7<nd||<||k�r||d7<nd||<t|d|�D]}	d	||	<�qqg}
t|�D�]"\}	}|j	t
k�r�|
�d�|�|	�d	k�rr|�
|	�n"|�|	d�d	k�rX|�
|	d�n�|j�s�|�|�}|�||�}||k�r�|ddk�r�|d
dk�r�|dd
�}|
�|�nf|jd}
|jdk�rd|
}n"|�|�}|�||�}d|
|f}|j�sN||k�rNd
|}|
�|��q6t|dd�D]}	||	g|
|	|	�<�qhd�dd�|
D��}d}d}t�d|d|�}t�d|d|�}t�d||fd|�}t�dd|�}|��}|S)Nrz [�[�]z (�(�)rS�|����%s�%s %s�[%s]T)�reversercSsg|]}|dk	r|�qSr-r*)rZ�itemr*r*r+r]�sz7HelpFormatter._format_actions_usage.<locals>.<listcomp>z[\[(]z[\])]z(%s) z\1� (%s)z%s *%sr^z\(([^|]*)\))�set�index�_group_actions�
ValueErrorro�add�required�range�	enumeraterrrr �get�popr��#_get_default_metavar_for_positional�_format_args�nargs�!_get_default_metavar_for_optionalr.r$rJr{r|)r%rjrk�
group_actionsZinserts�group�start�endrv�ir��defaultr}�
option_string�args_stringrf�open�closer*r*r+r��sz










z#HelpFormatter._format_actions_usagecCsFd|kr|t|jd�}t|j|jd�}d|j}|�|||�dS)Nz%(prog)r~�rrz)r�r>rArCrD�
_fill_text)r%rfr�r�r*r*r+re�s

zHelpFormatter._format_textc
Cs:t|jd|j�}t|j|d�}||jd}|�|�}|jsV|jd|f}d|}n@t|�|kr~|jd||f}d|}d}n|jd|f}d|}|}|g}|jr�|�	|�}	|�
|	|�}
|�d|d|
df�|
dd�D]}|�d|d|f�q�n|�d��s|�d�|�
|�D]}|�|�|���q|�|�S)	Nr8r�r^z%*s%s
z	%*s%-*s  rrSr_)r@rFrBrArCrDrsrrro�_expand_help�_split_linesr �endswithrtrur`)
r%rvZ
help_positionZ
help_widthZaction_widthZ
action_header�tupZindent_firstr�Z	help_textZ
help_linesr�rwr*r*r+ru�s8
�



zHelpFormatter._format_actioncCs�|js&|�|�}|�||�d�\}|Sg}|jdkrB|�|j�n4|�|�}|�||�}|jD]}|�d||f�q^d�|�SdS)NrSrr�r)	r�r��_metavar_formatterr�r�r�r�r r$)r%rvr��metavarr�r�r�r*r*r+rs"s



z'HelpFormatter._format_action_invocationcsP|jdk	r|j�n.|jdk	r<dd�|jD�}dd�|��n|��fdd�}|S)NcSsg|]}t|��qSr*��str)rZZchoicer*r*r+r]>sz4HelpFormatter._metavar_formatter.<locals>.<listcomp>z{%s}�,cst�t�r�S�f|SdSr-)�
isinstance�tuple)Z
tuple_size��resultr*r+r�Cs
z0HelpFormatter._metavar_formatter.<locals>.format)r��choicesr$)r%rv�default_metavarZchoice_strsr�r*r�r+r�:s

z HelpFormatter._metavar_formattercCs�|�||�}|jdkr$d|d�}n�|jtkr<d|d�}n�|jtkrTd|d�}n�|jtkrld|d�}n�|jtkr|d}nt|jtkr�d|d�}n\|jtkr�d	}nLzd
d�t|j�D�}Wnt	k
r�t
d�d�YnXd
�|�||j�}|S)Nr�rSr�z
[%s [%s ...]]r8z%s [%s ...]rz%s ...r^cSsg|]}d�qS)r�r*)rZr�r*r*r+r]\sz.HelpFormatter._format_args.<locals>.<listcomp>zinvalid nargs valuer)r�r�r
rrrrrr��	TypeErrorr�r$)r%rvr�Zget_metavarr�Zformatsr*r*r+r�Js*






zHelpFormatter._format_argscCs�tt|�|jd�}t|�D]}||tkr||=qt|�D] }t||d�r:||j||<q:|�d�dk	r�d�dd�|dD��}||d<|�	|�|S)Nr~rr�rcSsg|]}t|��qSr*r�)rZ�cr*r*r+r]ksz.HelpFormatter._expand_help.<locals>.<listcomp>)
r��varsr>r5r�hasattrrr�r$�_get_help_string)r%rvZparamsr(Zchoices_strr*r*r+r�bszHelpFormatter._expand_helpccs@z
|j}Wntk
rYnX|��|�EdH|��dSr-)�_get_subactions�AttributeErrorrTrV)r%rvZget_subactionsr*r*r+rtos
z'HelpFormatter._iter_indented_subactionscCs&|j�d|���}ddl}|�||�S)Nrr)rMr{r|�textwrapZwrap)r%rfrPr�r*r*r+r�yszHelpFormatter._split_linescCs,|j�d|���}ddl}|j||||d�S)Nrr)Zinitial_indentZsubsequent_indent)rMr{r|r�Zfill)r%rfrPr�r�r*r*r+r��s�zHelpFormatter._fill_textcCs|jSr-)rr�r%rvr*r*r+r��szHelpFormatter._get_help_stringcCs
|j��Sr-)�dest�upperr�r*r*r+r��sz/HelpFormatter._get_default_metavar_for_optionalcCs|jSr-)r�r�r*r*r+r��sz1HelpFormatter._get_default_metavar_for_positional)r8r9N)N) rr2r3r4rQrTrV�objectrGrbrcrdrgrmrxryrar`rhr�rerursr�r�r�rtr�r�r�r�r�r*r*r*r+r�s>�

`g/

c@seZdZdZdd�ZdS)rz�Help message formatter which retains any formatting in descriptions.

    Only the name of this class is considered a public API. All the methods
    provided by the class are considered an implementation detail.
    cs d��fdd�|jdd�D��S)Nr^c3s|]}�|VqdSr-r*)rZr��r�r*r+�	<genexpr>�sz9RawDescriptionHelpFormatter._fill_text.<locals>.<genexpr>T)�keepends)r$�
splitlines)r%rfrPr�r*r�r+r��sz&RawDescriptionHelpFormatter._fill_textN)rr2r3r4r�r*r*r*r+r�sc@seZdZdZdd�ZdS)rz�Help message formatter which retains formatting of all help text.

    Only the name of this class is considered a public API. All the methods
    provided by the class are considered an implementation detail.
    cCs|��Sr-)r�)r%rfrPr*r*r+r��sz!RawTextHelpFormatter._split_linesN)rr2r3r4r�r*r*r*r+r�sc@seZdZdZdd�ZdS)rz�Help message formatter which adds default values to argument help.

    Only the name of this class is considered a public API. All the methods
    provided by the class are considered an implementation detail.
    cCs>|j}d|jkr:|jtk	r:ttg}|js2|j|kr:|d7}|S)Nz
%(default)z (default: %(default)s))rrr�rr
rr�r�)r%rvrrZdefaulting_nargsr*r*r+r��s

z.ArgumentDefaultsHelpFormatter._get_help_stringN)rr2r3r4r�r*r*r*r+r�sc@s eZdZdZdd�Zdd�ZdS)r	aHelp message formatter which uses the argument 'type' as the default
    metavar value (instead of the argument 'dest')

    Only the name of this class is considered a public API. All the methods
    provided by the class are considered an implementation detail.
    cCs|jjSr-�rrr�r*r*r+r��sz:MetavarTypeHelpFormatter._get_default_metavar_for_optionalcCs|jjSr-r�r�r*r*r+r��sz<MetavarTypeHelpFormatter._get_default_metavar_for_positionalN)rr2r3r4r�r�r*r*r*r+r	�scCsN|dkrdS|jrd�|j�S|jdtfkr2|jS|jdtfkrF|jSdSdS)N�/)r�r$r�rr�)�argumentr*r*r+�_get_action_name�sr�c@s eZdZdZdd�Zdd�ZdS)rz�An error from creating or using an argument (optional or positional).

    The string value of this exception is the message, augmented with
    information about the argument that caused it.
    cCst|�|_||_dSr-)r��
argument_name�message)r%r�r�r*r*r+rQ�s
zArgumentError.__init__cCs(|jdkrd}nd}|t|j|jd�S)Nz%(message)sz'argument %(argument_name)s: %(message)s)r�r�)r�r�r�)r%r�r*r*r+�__str__�s
�zArgumentError.__str__N)rr2r3r4rQr�r*r*r*r+r�sc@seZdZdZdS)rz@An error from trying to convert a command line string to a type.N)rr2r3r4r*r*r*r+r�sc@s,eZdZdZd
dd�Zdd�Zddd	�ZdS)ra\	Information about how to convert command line strings to Python objects.

    Action objects are used by an ArgumentParser to represent the information
    needed to parse a single argument from one or more strings from the
    command line. The keyword arguments to the Action constructor are also
    all attributes of Action instances.

    Keyword Arguments:

        - option_strings -- A list of command-line option strings which
            should be associated with this action.

        - dest -- The name of the attribute to hold the created object(s)

        - nargs -- The number of command-line arguments that should be
            consumed. By default, one argument will be consumed and a single
            value will be produced.  Other values include:
                - N (an integer) consumes N arguments (and produces a list)
                - '?' consumes zero or one arguments
                - '*' consumes zero or more arguments (and produces a list)
                - '+' consumes one or more arguments (and produces a list)
            Note that the difference between the default and nargs=1 is that
            with the default, a single value will be produced, while with
            nargs=1, a list containing a single value will be produced.

        - const -- The value to be produced if the option is specified and the
            option uses an action that takes no values.

        - default -- The value to be produced if the option is not specified.

        - type -- A callable that accepts a single string argument, and
            returns the converted value.  The standard Python types str, int,
            float, and complex are useful examples of such callables.  If None,
            str is used.

        - choices -- A container of values that should be allowed. If not None,
            after a command-line argument has been converted to the appropriate
            type, an exception will be raised if it is not a member of this
            collection.

        - required -- True if the action must always be specified at the
            command line. This is only meaningful for optional command-line
            arguments.

        - help -- The help string describing the argument.

        - metavar -- The name to be used for the option's argument with the
            help string. If None, the 'dest' value will be used as the name.
    NFcCs@||_||_||_||_||_||_||_||_|	|_|
|_	dSr-�
r�r�r��constr�rr�r�rrr��r%r�r�r�r�r�rr�r�rrr�r*r*r+rQ)szAction.__init__c	s(ddddddddd	g	}�fd
d�|D�S)Nr�r�r�r�r�rr�rrr�csg|]}|t�|�f�qSr*��getattr�rZr(r1r*r+r]Ksz&Action._get_kwargs.<locals>.<listcomp>r*�r%�namesr*r1r+r"?s�zAction._get_kwargscCsttd���dS)Nz.__call__() not defined)�NotImplementedErrorr��r%�parser�	namespace�valuesr�r*r*r+�__call__MszAction.__call__)NNNNNFNN)N)rr2r3r4rQr"r�r*r*r*r+r�s5�
cs(eZdZd�fdd�	Zddd�Z�ZS)	�_StoreActionNFcsT|dkrtd��|dk	r,|tkr,tdt��tt|�j|||||||||	|
d�
dS)Nrz�nargs for store actions must be != 0; if you have nothing to store, actions such as store true or store const may be more appropriate� nargs must be %r to supply constr�)r�r
�superr�rQr���	__class__r*r+rQSs 
�z_StoreAction.__init__cCst||j|�dSr-)�setattrr�r�r*r*r+r�psz_StoreAction.__call__)NNNNNFNN)N�rr2r3rQr��
__classcell__r*r*r�r+r�Qs�r�cs(eZdZd�fdd�	Zddd�Z�ZS)	�_StoreConstActionNFc	s"tt|�j||d||||d�dS)Nr)r�r�r�r�r�r�rr)r�r�rQ�r%r�r�r�r�r�rrr�r�r*r+rQvs
�z_StoreConstAction.__init__cCst||j|j�dSr-)r�r�r�r�r*r*r+r��sz_StoreConstAction.__call__)NFNN)Nr�r*r*r�r+r�ts�r�cseZdZd�fdd�	Z�ZS)�_StoreTrueActionFNcs tt|�j||d|||d�dS)NT�r�r�r�r�r�rr)r�r�rQ�r%r�r�r�r�rrr�r*r+rQ�s
�z_StoreTrueAction.__init__)FFN�rr2r3rQr�r*r*r�r+r��s�r�cseZdZd�fdd�	Z�ZS)�_StoreFalseActionTFNcs tt|�j||d|||d�dS)NFr�)r�r�rQr�r�r*r+rQ�s
�z_StoreFalseAction.__init__)TFNr�r*r*r�r+r��s�r�cs(eZdZd�fdd�	Zddd�Z�ZS)	�
_AppendActionNFcsT|dkrtd��|dk	r,|tkr,tdt��tt|�j|||||||||	|
d�
dS)Nrz�nargs for append actions must be != 0; if arg strings are not supplying the value to append, the append const action may be more appropriater�r�)r�r
r�r�rQr�r�r*r+rQ�s 
�z_AppendAction.__init__cCs2t||jd�}t|�}|�|�t||j|�dSr-)r�r�r7r r��r%r�r�r�r�r0r*r*r+r��s
z_AppendAction.__call__)NNNNNFNN)Nr�r*r*r�r+r��s�r�cs(eZdZd�fdd�	Zddd�Z�ZS)	�_AppendConstActionNFc
s$tt|�j||d|||||d�dS)Nr)r�r�r�r�r�r�rrr�)r�r�rQr�r�r*r+rQ�s
�z_AppendConstAction.__init__cCs4t||jd�}t|�}|�|j�t||j|�dSr-)r�r�r7r r�r�r�r*r*r+r��sz_AppendConstAction.__call__)NFNN)Nr�r*r*r�r+r��s�r�cs(eZdZd�fdd�	Zddd�Z�ZS)	�_CountActionNFcs tt|�j||d|||d�dS)Nr)r�r�r�r�r�rr)r�r�rQr�r�r*r+rQ�s
�z_CountAction.__init__cCs0t||jd�}|dkrd}t||j|d�dS�NrrS)r�r�r�)r%r�r�r�r��countr*r*r+r��sz_CountAction.__call__)NFN)Nr�r*r*r�r+r��s
�r�cs.eZdZeedf�fdd�	Zddd�Z�ZS)�_HelpActionNcstt|�j|||d|d�dS�Nr)r�r�r�r�rr)r�r�rQ)r%r�r�r�rrr�r*r+rQs
�z_HelpAction.__init__cCs|��|��dSr-)�
print_help�exitr�r*r*r+r�sz_HelpAction.__call__)N�rr2r3rrQr�r�r*r*r�r+r�s
�r�cs0eZdZdeedf�fdd�	Zddd�Z�ZS)�_VersionActionNz&show program's version number and exitcs$tt|�j|||d|d�||_dSr)r�rrQ�version)r%r�rr�r�rrr�r*r+rQs
�z_VersionAction.__init__cCsD|j}|dkr|j}|��}|�|�|�|��tj�|��dSr-)r�_get_formatterrg�_print_messagera�_sys�stdoutr)r%r�r�r�r�rrWr*r*r+r�(s
z_VersionAction.__call__)Nrr*r*r�r+rs�rcsPeZdZGdd�de�Zedddf�fdd�	Zdd�Zd	d
�Zd
dd�Z	�Z
S)�_SubParsersActioncseZdZ�fdd�Z�ZS)z&_SubParsersAction._ChoicesPseudoActioncs@|}}|r|dd�|�7}ttj|�}|jg|||d�dS)Nr�r)r�r�rrr�)r$r�r
�_ChoicesPseudoActionrQ)r%r(�aliasesrrr�r�Zsupr�r*r+rQ6s
�z/_SubParsersAction._ChoicesPseudoAction.__init__r�r*r*r�r+r4srFNc	s<||_||_i|_g|_tt|�j||t|j|||d�dS)N)r�r�r�r�r�rrr�)�_prog_prefix�
_parser_class�_name_parser_map�_choices_actionsr�r
rQr)r%r�rO�parser_classr�r�rrr�r�r*r+rQ>s	
�z_SubParsersAction.__init__cKs�|�d�dkr d|j|f|d<|�dd�}d|krX|�d�}|�|||�}|j�|�|jf|�}||j|<|D]}||j|<qr|S)NrOr�rr*rr)r�r
r�rrr rr)r%r(�kwargsrrrZ
choice_actionr��aliasr*r*r+�
add_parserUs

z_SubParsersAction.add_parsercCs|jSr-)rr1r*r*r+r�lsz!_SubParsersAction._get_subactionscCs�|d}|dd�}|jtk	r,t||j|�z|j|}Wn<tk
rv|d�|j�d�}td�|}t||��YnX|�|d�\}	}t	|	��
�D]\}
}t||
|�q�|r�t	|��tg�t
|t��|�dS)NrrSr)�parser_namer�z5unknown parser %(parser_name)r (choices: %(choices)s))r�rr�r�KeyErrorr$r�r�parse_known_argsr�r0�
setdefault�_UNRECOGNIZED_ARGS_ATTRr�r�)r%r�r�r�r�rr&r\�msgZsubnamespace�keyr)r*r*r+r�os$

�	z_SubParsersAction.__call__)N)rr2r3rrrrQrr�r�r�r*r*r�r+r
2s�r
c@seZdZddd�ZdS)�
_ExtendActionNcCs2t||jd�}t|�}|�|�t||j|�dSr-)r�r�r7r�r�r�r*r*r+r��s
z_ExtendAction.__call__)N)rr2r3r�r*r*r*r+r�src@s*eZdZdZddd�Zdd�Zd	d
�ZdS)ra�Factory for creating file object types

    Instances of FileType are typically passed as type= arguments to the
    ArgumentParser add_argument() method.

    Keyword Arguments:
        - mode -- A string indicating how the file is to be opened. Accepts the
            same values as the builtin open() function.
        - bufsize -- The file's desired buffer size. Accepts the same values as
            the builtin open() function.
        - encoding -- The file's encoding. Accepts the same values as the
            builtin open() function.
        - errors -- A string indicating how encoding and decoding errors are to
            be handled. Accepts the same value as the builtin open() function.
    �rr�NcCs||_||_||_||_dSr-)�_mode�_bufsize�	_encoding�_errors)r%�mode�bufsize�encoding�errorsr*r*r+rQ�szFileType.__init__c
Cs�|dkr>d|jkrtjSd|jkr(tjStd�|j}t|��zt||j|j|j|j	�WSt
k
r�}z"||d�}td�}t||��W5d}~XYnXdS)N�-r�wzargument "-" with mode %r)�filename�errorz$can't open '%(filename)s': %(error)s)rr�stdinr	r�r�r�rr r!�OSErrorr)r%�stringr�er\r�r*r*r+r��s

�
zFileType.__call__cCsT|j|jf}d|jfd|jfg}d�dd�|D�dd�|D��}dt|�j|fS)Nr$r%rcSsg|]}|dkrt|��qS)r�)r!)rZr'r*r*r+r]�sz%FileType.__repr__.<locals>.<listcomp>cSs$g|]\}}|dk	rd||f�qS)Nrr*)rZ�kwr'r*r*r+r]�s�r)rrr r!r$rr)r%r\rZargs_strr*r*r+r,�s�zFileType.__repr__)rr�NN)rr2r3r4rQr�r,r*r*r*r+r�s
c@s(eZdZdZdd�Zdd�Zdd�ZdS)	r
z�Simple object for storing attributes.

    Implements equality by attribute names and values, and provides a simple
    string representation.
    cKs|D]}t||||�qdSr-)r�)r%rr(r*r*r+rQ�szNamespace.__init__cCst|t�stSt|�t|�kSr-)r�r
�NotImplementedr�)r%�otherr*r*r+�__eq__�s
zNamespace.__eq__cCs
||jkSr-)r/)r%rr*r*r+�__contains__�szNamespace.__contains__N)rr2r3r4rQr1r2r*r*r*r+r
�scs�eZdZ�fdd�Zdd�Zd&dd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zd'dd�Zdd�Zd d!�Zd"d#�Zd$d%�Z�ZS)(�_ActionsContainercstt|���||_||_||_||_i|_|�ddt	�|�ddt	�|�ddt
�|�ddt�|�ddt�|�ddt
�|�ddt�|�ddt�|�dd	t�|�dd
t�|�ddt�|�ddt�|��g|_i|_g|_g|_i|_t�d
�|_g|_dS)NrvZstoreZstore_const�
store_trueZstore_falser Zappend_constr�rrr�parsersr�z^-\d+$|^-\d*\.\d+$)r�r3rQ�description�argument_default�prefix_chars�conflict_handler�_registries�registerr�r�r�r�r�r�r�r�rr
r�_get_handler�_actions�_option_string_actions�_action_groups�_mutually_exclusive_groups�	_defaultsrJrK�_negative_number_matcher�_has_negative_number_optionals)r%r6r8r7r9r�r*r+rQ�s4z_ActionsContainer.__init__cCs|j�|i�}|||<dSr-)r:r)r%�
registry_namer)r��registryr*r*r+r;sz_ActionsContainer.registerNcCs|j|�||�Sr-)r:r�)r%rDr)r�r*r*r+�
_registry_get sz_ActionsContainer._registry_getcKs2|j�|�|jD]}|j|kr||j|_qdSr-)rA�updater=r�r�)r%rrvr*r*r+�set_defaults&s

z_ActionsContainer.set_defaultscCs8|jD]"}|j|kr|jdk	r|jSq|j�|d�Sr-)r=r�r�rAr�)r%r�rvr*r*r+�get_default/s
z_ActionsContainer.get_defaultcOsD|j}|r&t|�dkrH|dd|krH|r:d|kr:td��|j||�}n|j||�}d|kr�|d}||jkr~|j||d<n|jdk	r�|j|d<|�|�}t|�s�td|f��|f|�}|�	d|j
|j
�}t|�s�td	|f��|tkr�td
|f��t|d��r:z|�
��|d�Wntk
�r8td��YnX|�|�S)
z�
        add_argument(dest, ..., name=value, ...)
        add_argument(option_string, option_string, ..., name=value, ...)
        rSrr�z+dest supplied twice for positional argumentr�Nzunknown action "%s"r�%r is not callablez<%r is a FileType class object, instance of it must be passedrz,length of metavar tuple does not match nargs)r8ror��_get_positional_kwargs�_get_optional_kwargsrAr7�_pop_action_class�callablerFrrr�rr�r��_add_action)r%r\r�charsr�Zaction_classrv�	type_funcr*r*r+rx9s:	 




�z_ActionsContainer.add_argumentcOs t|f|�|�}|j�|�|Sr-)�_ArgumentGroupr?r )r%r\rr�r*r*r+�add_argument_grouplsz$_ActionsContainer.add_argument_groupcKst|f|�}|j�|�|Sr-)�_MutuallyExclusiveGroupr@r )r%rr�r*r*r+�add_mutually_exclusive_groupqsz._ActionsContainer.add_mutually_exclusive_groupcCs`|�|�|j�|�||_|jD]}||j|<q"|jD]"}|j�|�r8|js8|j�d�q8|S)NT)	�_check_conflictr=r �	containerr�r>rB�matchrC)r%rvr�r*r*r+rOvs


z_ActionsContainer._add_actioncCs|j�|�dSr-)r=�remover�r*r*r+�_remove_action�sz _ActionsContainer._remove_actioncCs�i}|jD].}|j|kr.td�}t||j��|||j<q
i}|jD]D}|j|krn|j|j|j|jd�||j<|jD]}||j||<qtqD|jD]&}|j	|j
d�}|jD]}|||<q�q�|jD]}|�||��
|�q�dS)Nz.cannot merge actions - two groups are named %r)�titler6r9)r�)r?r[r�r�rSr6r9r�r@rUr�r=r�rO)r%rWZtitle_group_mapr�rZ	group_maprv�mutex_groupr*r*r+�_add_container_actions�s0



�

�

z(_ActionsContainer._add_container_actionscKs^d|krtd�}t|��|�d�ttfkr2d|d<|�d�tkrPd|krPd|d<t||gd�S)Nr�z1'required' is an invalid argument for positionalsr�Tr��r�r�)r�r�r�r
rr�)r%r�rrr*r*r+rK�sz(_ActionsContainer._get_positional_kwargsc	Os�g}g}|D]n}|d|jkr>||jd�}td�}t||��|�|�|d|jkrt|�dkr|d|jkr|�|�q|�dd�}|dkr�|r�|d}n|d}|�|j�}|s�td�}t||��|�dd�}t|||d	�S)
Nr)�optionr8zNinvalid option string %(option)r: must start with a character %(prefix_chars)rrSr�z%dest= is required for options like %rr&r�r^)	r8r�r�r ror��lstrip�replacer�)	r%r\rr�Zlong_option_stringsr�rr�Zdest_option_stringr*r*r+rL�s2�

z&_ActionsContainer._get_optional_kwargscCs|�d|�}|�d||�S)Nrv)r�rF)r%rr�rvr*r*r+rM�sz#_ActionsContainer._pop_action_classcCsFd|j}zt||�WStk
r@td�}t||j��YnXdS)Nz_handle_conflict_%sz%invalid conflict_resolution value: %r)r9r�r�r�r�)r%Zhandler_func_namerr*r*r+r<�s
z_ActionsContainer._get_handlercCsLg}|jD]&}||jkr
|j|}|�||f�q
|rH|��}|||�dSr-)r�r>r r<)r%rvZconfl_optionalsr�Zconfl_optionalr9r*r*r+rV�s


z!_ActionsContainer._check_conflictcCs6tddt|��}d�dd�|D��}t|||��dS)Nzconflicting option string: %szconflicting option strings: %srcSsg|]\}}|�qSr*r*)rZr�rvr*r*r+r]	s�z<_ActionsContainer._handle_conflict_error.<locals>.<listcomp>)rror$r)r%rv�conflicting_actionsr�Zconflict_stringr*r*r+�_handle_conflict_errors�
�z(_ActionsContainer._handle_conflict_errorcCs>|D]4\}}|j�|�|j�|d�|js|j�|�qdSr-)r�rYr>r�rWrZ)r%rvrbr�r*r*r+�_handle_conflict_resolves
z*_ActionsContainer._handle_conflict_resolve)N)N)rr2r3rQr;rFrHrIrxrSrUrOrZr]rKrLrMr<rVrcrdr�r*r*r�r+r3�s$5
	
3($
		r3cs6eZdZd�fdd�	Z�fdd�Z�fdd�Z�ZS)	rRNcs�|j}|d|j�|d|j�|d|j�tt|�j}|fd|i|��||_g|_|j	|_	|j
|_
|j|_|j|_|j
|_
|j|_dS)Nr9r8r7r6)rr9r8r7r�rRrQr[r�r:r=r>rArCr@)r%rWr[r6rrGZ
super_initr�r*r+rQs�z_ArgumentGroup.__init__cs tt|��|�}|j�|�|Sr-)r�rRrOr�r r�r�r*r+rO5sz_ArgumentGroup._add_actioncs tt|��|�|j�|�dSr-)r�rRrZr�rYr�r�r*r+rZ:sz_ArgumentGroup._remove_action)NN�rr2r3rQrOrZr�r*r*r�r+rRsrRcs.eZdZd�fdd�	Zdd�Zdd�Z�ZS)	rTFcs tt|��|�||_||_dSr-)r�rTrQr��
_container)r%rWr�r�r*r+rQAsz _MutuallyExclusiveGroup.__init__cCs2|jrtd�}t|��|j�|�}|j�|�|S)Nz-mutually exclusive arguments must be optional)r�r�r�rfrOr�r )r%rvrr*r*r+rOFsz#_MutuallyExclusiveGroup._add_actioncCs|j�|�|j�|�dSr-)rfrZr�rYr�r*r*r+rZNsz&_MutuallyExclusiveGroup._remove_action)Frer*r*r�r+rT?srTcs*eZdZdZddddgeddddddf�fdd�	Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dAdd�ZdBdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�ZdCd&d'�ZdDd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�ZdEd6d7�ZdFd8d9�ZdGd:d;�ZdHd=d>�Z d?d@�Z!�Z"S)Ira�Object for parsing command line strings into Python objects.

    Keyword Arguments:
        - prog -- The name of the program (default: sys.argv[0])
        - usage -- A usage message (default: auto-generated from arguments)
        - description -- A description of what the program does
        - epilog -- Text following the argument descriptions
        - parents -- Parsers whose arguments should be copied into this one
        - formatter_class -- HelpFormatter class for printing help messages
        - prefix_chars -- Characters that prefix optional arguments
        - fromfile_prefix_chars -- Characters that prefix files containing
            additional arguments
        - argument_default -- The default value for all arguments
        - conflict_handler -- String indicating how to handle conflicts
        - add_help -- Add a -h/-help option
        - allow_abbrev -- Allow long options to be abbreviated unambiguously
    Nr&r)Tc
	s"tt|�j}
|
|||	|
d�|dkr6tj�tjd�}||_||_	||_
||_||_||_
||_|j}|td��|_|td��|_d|_dd�}|�dd|�d|kr�dn|d}|j
r�|j|d	|d
ddttd�d
�|D]<}|�|�z
|j}Wntk
�rYq�X|j�|�q�dS)N)r6r8r7r9rzpositional argumentszoptional argumentscSs|Sr-r*)r,r*r*r+�identity�sz)ArgumentParser.__init__.<locals>.identityrr&�hr8rrzshow this help message and exit)rvr�rr)r�rrQ�_os�path�basenamer�argvrOri�epilog�formatter_class�fromfile_prefix_chars�add_help�allow_abbrevrSr��_positionals�
_optionals�_subparsersr;rxrr]rAr�rG)r%rOrir6rm�parentsrnr8ror7r9rprqZ	superinitZ	add_grouprgZdefault_prefixrX�defaultsr�r*r+rQfsJ�
�

zArgumentParser.__init__cs"ddddddg}�fdd�|D�S)	NrOrir6rnr9rpcsg|]}|t�|�f�qSr*r�r�r1r*r+r]�sz.ArgumentParser._get_kwargs.<locals>.<listcomp>r*r�r*r1r+r"�s�zArgumentParser._get_kwargsc	Ks�|jdk	r|�td��|�dt|��d|ks8d|krht|�dd��}t|�dd��}|�||�|_n|j|_|�d�dkr�|�	�}|�
�}|j}|�|j
||d�|����|d<|�|d�}|fd	gi|��}|j�|�|S)
Nz(cannot have multiple subparser argumentsrr[r6ZsubcommandsrOr^r5r�)rtr)r�rrr�rSrrr�r�_get_positional_actionsr@rmrirar|rMrO)	r%rr[r6rWr�rkZ
parsers_classrvr*r*r+�add_subparsers�s$
zArgumentParser.add_subparserscCs$|jr|j�|�n|j�|�|Sr-)r�rsrOrrr�r*r*r+rO�szArgumentParser._add_actioncCsdd�|jD�S)NcSsg|]}|jr|�qSr*�r��rZrvr*r*r+r]�s�z8ArgumentParser._get_optional_actions.<locals>.<listcomp>�r=r1r*r*r+�_get_optional_actions�s�z$ArgumentParser._get_optional_actionscCsdd�|jD�S)NcSsg|]}|js|�qSr*ryrzr*r*r+r]�s�z:ArgumentParser._get_positional_actions.<locals>.<listcomp>r{r1r*r*r+rw�s�z&ArgumentParser._get_positional_actionscCs4|�||�\}}|r0td�}|�|d�|��|S�Nzunrecognized arguments: %sr)rr�r)r$�r%r\r�rlrr*r*r+�
parse_args�s
zArgumentParser.parse_argscCs|dkrtjdd�}nt|�}|dkr.t�}|jD]4}|jtk	r4t||j�s4|jtk	r4t	||j|j�q4|j
D] }t||�spt	|||j
|�qpz>|�||�\}}t|t�r�|�
t|t��t|t�||fWStk
�rt��d}|�t|��YnXdSrR)rrlr5r
r=r�rr�r�r�rA�_parse_known_argsrr�r��delattrr�exc_infor)r�)r%r\r�rvr��errr*r*r+r�s,







zArgumentParser.parse_known_argscs�	jdk	r�	����i��	jD]R}|j}t|j�D]<\}}��|g�}|�|d|��|�||dd��q2qi�g}t��}	t|	�D]^\}}
|
dkr�|�d�|	D]}
|�d�q�q��	�	|
�}|dkr�d}n|�|<d}|�|�q�d�
|��t��t��d�����	fdd�	������	�fd	d
�}
�	�������	�fdd�}g�d
�
��r`t
��}nd}�
|k�r�t�
fdd��D��}�
|k�r�|�
�}|�
k�r�|�
�qdn|�
�
�k�r҈�
|�}��|�|�
|
�
��
�qd|�
�}���|d��g}�	jD]|}|�k�r|j�r(|�t|��nT|jdk	�rt|jt��rt�|j��r|jt�|j�k�rt�|j�	�||j���q|�r��	�td�d�
|���	jD]X}|j�r�|jD]}|�k�r��q��q�dd�|jD�}td�}�	�|d�
|���q���fS)NrS�--r&�A�Or^cs|��|���||�}||jk	rb��|���|g�D]*}|�kr6td�}t|�}t|||��q6|tk	rx|��||�dS)Nznot allowed with argument %s)r��_get_valuesr�r�r�r�rr)rvZargument_stringsr�Zargument_valuesZconflict_actionrZaction_name)�action_conflictsr��seen_actions�seen_non_default_actionsr%r*r+�take_action@s


z5ArgumentParser._parse_known_args.<locals>.take_actioncs��|}|\}}}�j}g}|dkr:���|�|dS|dk	�r||d�}�j}|dkr�|d|kr�|�|g|f�|d}	|	|d}|dd�p�d}
�j}||kr�||}|
}ntd�}t|||��nB|dkr�|d}
|g}|�|||f��q\ntd�}t|||��q|d}�|d�}|||�}||}
�||
�}|�|||f��q\q|�sft�|D]\}}}�|||��qj|
S)NrSr�rzignored explicit argument %r)�_match_argumentr r8r>r�rrU)�start_index�option_tuplervr��explicit_argZmatch_argumentZ
action_tuples�	arg_countrP�charZnew_explicit_argZ
optionals_mapr�stopr\r�Zselected_patterns)r&�arg_strings_pattern�extras�option_string_indicesr%r�r*r+�consume_optionalUsN




z:ArgumentParser._parse_known_args.<locals>.consume_optionalcsn�j}�|d�}|�|�}t�|�D]*\}}�|||�}||7}�||�q&�t|�d��dd�<|Sr-)�_match_arguments_partial�zipro)r�Z
match_partialZselected_patternZ
arg_countsrvr�r\)r&r�r�r%r�r*r+�consume_positionals�s
z=ArgumentParser._parse_known_args.<locals>.consume_positionalsrr�csg|]}|�kr|�qSr*r*)rZr�)r�r*r+r]�s�z4ArgumentParser._parse_known_args.<locals>.<listcomp>z(the following arguments are required: %srcSsg|]}|jtk	rt|��qSr*)rrrr�rzr*r*r+r]�s
�z#one of the arguments %s is requiredr)N)ro�_read_args_from_filesr@r�r�rr��iterr �_parse_optionalr$r�rwrAr@r=r�r�r�r�r�r�r�r�r��
_get_valuer)r�)r%r&r�r\r�r�Zmutex_actionZ	conflictsZarg_string_pattern_partsZarg_strings_iter�
arg_stringr��patternr�r�Zmax_option_string_indexZnext_option_string_indexZpositionals_end_indexZstringsZ
stop_indexZrequired_actionsrvr�r�rr*)r�r&r�r�r�r�r�r�r�r%r�r�r+r�s�





J

�






�
���
�



�z ArgumentParser._parse_known_argsc
Cs�g}|D]�}|r|d|jkr*|�|�qzdt|dd���J}g}|����D]}|�|�D]}|�|�q\qN|�|�}|�|�W5QRXWqtk
r�t	�
�d}|�t|��YqXq|Sr�)
ror r��readr��convert_arg_line_to_argsr�r�r+rr�r)r�)r%r&Znew_arg_stringsr�Z	args_file�arg_liner'r�r*r*r+r�s 
z$ArgumentParser._read_args_from_filescCs|gSr-r*)r%r�r*r*r+r�!sz'ArgumentParser.convert_arg_line_to_argscCsz|�|�}t�||�}|dkrldtd�ttd�ttd�i}|�|j�}|dkrbtdd|j�|j}t	||��t
|�d��S)Nzexpected one argumentzexpected at most one argumentzexpected at least one argumentzexpected %s argumentzexpected %s argumentsrS)�_get_nargs_patternrJrXr�r
rr�r�rrror�)r%rvr��
nargs_patternrXZnargs_errorsrr*r*r+r�$s(
���
zArgumentParser._match_argumentcsrg}tt|�dd�D]X}|d|�}d��fdd�|D��}t�||�}|dk	r|�dd�|��D��qnq|S)Nrr�r^csg|]}��|��qSr*)r�rzr1r*r+r]@s�z;ArgumentParser._match_arguments_partial.<locals>.<listcomp>cSsg|]}t|��qSr*rn)rZr,r*r*r+r]Ds)r�ror$rJrXr�rk)r%rjr�r�r�Z
actions_slicer�rXr*r1r+r�:s�z'ArgumentParser._match_arguments_partialc
Cs|sdS|d|jkrdS||jkr8|j|}||dfSt|�dkrHdSd|kr~|�dd�\}}||jkr~|j|}|||fS|�|�}t|�dkr�d�dd�|D��}||d�}td�}|�||�nt|�dkr�|\}	|	S|j�	|�r�|j
s�dSd	|k�rdSd|dfS)
NrrS�=rcSsg|]\}}}|�qSr*r*)rZrvr�r�r*r*r+r]is�z2ArgumentParser._parse_optional.<locals>.<listcomp>)r_Zmatchesz4ambiguous option: %(option)s could match %(matches)sr)r8r>ro�split�_get_option_tuplesr$r�r)rBrXrC)
r%r�rvr�r�Z
option_tuplesZoptionsr\rr�r*r*r+r�Js>







�

zArgumentParser._parse_optionalc
Cs0g}|j}|d|kr�|d|kr�|jr~d|krB|�dd�\}}n|}d}|jD],}|�|�rP|j|}|||f}|�|�qPn�|d|k�r|d|k�r|}d}|dd�}|dd�}	|jD]T}||kr�|j|}|||	f}|�|�q�|�|�r�|j|}|||f}|�|�q�n|�td�|�|S)NrrSr�r8zunexpected option string: %s)r8rqr�r>�
startswithr r)r�)
r%r�r�rPZ
option_prefixr�rvr�Zshort_option_prefixZshort_explicit_argr*r*r+r��s:









z!ArgumentParser._get_option_tuplescCs�|j}|dkrd}nf|tkr"d}nX|tkr0d}nJ|tkr>d}n<|tkrLd}n.|tkrZd}n |tkrhd}ndd	�d
|�}|jr�|�	d	d�}|�	dd�}|S)
Nz(-*A-*)z(-*A?-*)z	(-*[A-]*)z
(-*A[A-]*)z([-AO]*)z(-*A[-AO]*)z(-*-*)z(-*%s-*)z-*r�r^r&)
r�r
rrrrrr$r�ra)r%rvr�r�r*r*r+r��s(z!ArgumentParser._get_nargs_patterncCs4|�||�\}}|r0td�}|�|d�|��|Sr})�parse_known_intermixed_argsr�r)r$r~r*r*r+�parse_intermixed_args�s
z$ArgumentParser.parse_intermixed_argsc	s�|���dd��D�}|r,td|dj���fdd�|jD�rHtd���zN|j}z�|jdkrp|��dd�|_�D] }|j|_t	|_|j|_t	|_qt|�
||�\}}�D]J}t||j�r�t
||j�gkr�ddlm}|d	|j|f�t||j�q�W5�D]}|j|_|j|_q�X|��}zJ|D]}|j|_d
|_�q$|jD]}	|	j|	_d
|	_�q@|�
||�\}}
W5|D]}|j|_�qn|jD]}	|	j|	_�q�XW5||_X||
fS)NcSsg|]}|jttfkr|�qSr*)r�rrrzr*r*r+r]�s�z>ArgumentParser.parse_known_intermixed_args.<locals>.<listcomp>z3parse_intermixed_args: positional arg with nargs=%srcs&g|]}|jD]}|�kr|j�qqSr*)r�r�)rZr�rv�r�r*r+r]�s
�z;parse_intermixed_args: positional in mutuallyExclusiveGroup�)�warnzDo not expect %s in %sF)rwr�r�r@riZ
save_nargsZsave_defaultr��format_usagerrr�r�r��warningsr�r�r|Z
save_requiredr�)r%r\r��aZ
save_usagervZremaining_argsr�r�r�r�r*r�r+r��s`
�
��


�
z*ArgumentParser.parse_known_intermixed_argscs��jttfkr2z|�d�Wntk
r0YnX|sz�jtkrz�jrN�j}n�j}t	|t
�rv���|�}���|��n|s��jt
kr��js��jdk	r��j}n|}���|�n�t|�dkr�jdtfkr�|\}���|�}���|�n��jtk�r��fdd�|D�}np�jtk�r@��fdd�|D�}���|d�n>�jtk�rRt}n,��fdd�|D�}|D]}���|��qj|S)Nr�rScsg|]}���|��qSr*�r��rZ�v�rvr%r*r+r]Z	sz.ArgumentParser._get_values.<locals>.<listcomp>csg|]}���|��qSr*r�r�r�r*r+r]^	srcsg|]}���|��qSr*r�r�r�r*r+r]g	s)r�rrrYr�r
r�r�r�r�r�r��_check_valuerror)r%rvr&r)r�r�r*r�r+r�6	sD
�
zArgumentParser._get_valuesc	Cs�|�d|j|j�}t|�s0td�}t|||��z||�}Wn�tk
r~t|jdt|j��}tt	�
�d�}t||��YnLttfk
r�t|jdt|j��}||d�}td�}t|||��YnX|S)NrrJrrS)rr)z!invalid %(type)s value: %(value)r)
rFrrNr�rrr�r!r�rr�r�r�)r%rvr�rQrr�r(r\r*r*r+r�n	s 
zArgumentParser._get_valuecCsF|jdk	rB||jkrB|d�tt|j��d�}td�}t|||��dS)Nr)r)r�z3invalid choice: %(value)r (choose from %(choices)s))r�r$�mapr!r�r)r%rvr)r\rr*r*r+r��	s�zArgumentParser._check_valuecCs$|��}|�|j|j|j�|��Sr-)rrmrir=r@ra)r%rWr*r*r+r��	s
�zArgumentParser.format_usagecCst|��}|�|j|j|j�|�|j�|jD]0}|�|j	�|�|j�|�
|j�|��q.|�|j
�|��Sr-)rrmrir=r@rgr6r?rcr[ryr�rdrmra)r%rWZaction_groupr*r*r+ra�	s�

zArgumentParser.format_helpcCs|j|jd�S)Nr~)rnrOr1r*r*r+r�	szArgumentParser._get_formattercCs"|dkrtj}|�|��|�dSr-)rr	rr��r%�filer*r*r+�print_usage�	szArgumentParser.print_usagecCs"|dkrtj}|�|��|�dSr-)rr	rrar�r*r*r+r�	szArgumentParser.print_helpcCs |r|dkrtj}|�|�dSr-)r�stderr�write)r%r�r�r*r*r+r�	szArgumentParser._print_messagercCs |r|�|tj�t�|�dSr-)rrr�r)r%Zstatusr�r*r*r+r�	szArgumentParser.exitcCs0|�tj�|j|d�}|�dtd�|�dS)z�error(message: string)

        Prints a usage message incorporating the message to stderr and
        exits.

        If you override this in a subclass, it should not return -- it
        should either exit or raise an exception.
        )rOr�r8z%(prog)s: error: %(message)s
N)r�rr�rOrr�)r%r�r\r*r*r+r)�	s	zArgumentParser.error)NN)NN)NN)NN)N)N)N)rN)#rr2r3r4rrQr"rxrOr|rwrrr�r�r�r�r�r�r�r�r�r�r�r�r�r�rarr�rrrr)r�r*r*r�r+rSsV�@

#w:-1

M8


	
)3r4�__version__�__all__�osri�rerJZshutilr;�sysrrr�rrr
rrrrrr�rr7rrrrr	r��	Exceptionrrrr�r�r�r�r�r�r�r�rr
rrr
r3rRrTrr*r*r*r+�<module>s�=�z
	[#&]7:"__pycache__/tabnanny.cpython-38.pyc000064400000015570151153537570013242 0ustar00U

e5d�,�@s�dZdZddlZddlZddlZeed�s2ed��dddgZdada	d	d
�Z
dd�ZGd
d�de�Z
dd�ZGdd�d�Zdd�Zdd�Zedkr�e�dS)a�The Tab Nanny despises ambiguous indentation.  She knows no mercy.

tabnanny -- Detection of ambiguous indentation

For the time being this module is intended to be called as a script.
However it is possible to import it into an IDE and use the function
check() described below.

Warning: The API provided by this module is likely to change in future
releases; such changes may not be backward compatible.
�6�N�NLz4tokenize.NL doesn't exist -- tokenize module too old�check�NannyNag�process_tokenscGs6d}|D]}tj�|t|��d}qtj�d�dS)N�� �
)�sys�stderr�write�str)�args�sep�arg�r� /usr/lib64/python3.8/tabnanny.py�errprint"s
rc
Cs�ddl}z|�tjdd�d�\}}Wn2|jk
rX}zt|�WY�dSd}~XYnX|D](\}}|dkrvtda|dkr^tdaq^|s�tdtjdd�dS|D]}t|�q�dS)Nr�Zqvz-qz-vzUsage:z[-v] file_or_directory ...)�getoptr
�argv�errorr�
filename_only�verboser)rZoptsr�msg�o�arrrr�main)s 
rc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)rzk
    Raised by process_tokens() if detecting an ambiguous indent.
    Captured and handled in check().
    cCs||||_|_|_dS�N)�linenor�line)�selfrrr rrr�__init__BszNannyNag.__init__cCs|jSr)r�r!rrr�
get_linenoDszNannyNag.get_linenocCs|jSr)rr#rrr�get_msgFszNannyNag.get_msgcCs|jSr)r r#rrr�get_lineHszNannyNag.get_lineN)�__name__�
__module__�__qualname__�__doc__r"r$r%r&rrrrr=s
c	
CsHtj�|�r�tj�|�s�tr*td|f�t�|�}|D]J}tj�||�}tj�|�rbtj�|�rztj�|dd��dkr8t	|�q8dSzt
�|�}Wn8tk
r�}zt
d||f�WY�dSd}~XYnXtdkr�td|��z>ztt
�|j��W�n"t
jk
�r@}z t
d||f�WY�
W���dSd}~XYn�tk
�r|}zt
d	||f�WY�W��dSd}~XYn�tk
�r }z�|��}|��}t�r�td
||f�td|f�t|���n6d|k�r�d
|d
}t�r�t|�nt||t|��WY�W�dSd}~XYnXW5|��Xt�rDtd|f�dS)a~check(file_or_dir)

    If file_or_dir is a directory and not a symbolic link, then recursively
    descend the directory tree named by file_or_dir, checking all .py files
    along the way. If file_or_dir is an ordinary Python source file, it is
    checked for whitespace related problems. The diagnostic messages are
    written to standard output using the print statement.
    z%r: listing directory���Nz.pyz%r: I/O Error: %srzchecking %r ...z%r: Token Error: %sz%r: Indentation Error: %sz)%r: *** Line %d: trouble in tab city! ***zoffending line: %rr�"z%r: Clean bill of health.)�os�path�isdir�islinkr�print�listdir�join�normcaser�tokenize�open�OSErrorr�closer�generate_tokens�readline�
TokenError�IndentationErrorrr$r&r%r�repr)	�file�names�name�fullname�frZnag�badliner rrrrKsX


��


 
c@sLeZdZd\ZZdd�Zdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�ZdS)�
Whitespacez 	c	Cs�||_tjtj}}g}d}}}|jD]v}||krH|d}|d}q*||kr�|d}|d}|t|�kr�|dg|t|�d}||d||<d}q*q�q*||_||_t|�|f|_t|�dk|_	dS)Nrr)
�rawrD�S�T�len�n�nt�tuple�norm�	is_simple)	r!ZwsrFrG�count�brIrJZchrrrr"�s(

zWhitespace.__init__cCs|j\}}tt|�d|�S�Nr)rL�maxrH)r!rN�trailingrrr�longest_run_of_spaces�s
z Whitespace.longest_run_of_spacescCsH|j\}}d}t|t|��D]}|||||}q||||jS)Nr)rL�rangerHrJ)r!�tabsizerNrRZil�irrr�indent_level�s

zWhitespace.indent_levelcCs|j|jkSr)rL)r!�otherrrr�equal�szWhitespace.equalcCsbt|��|���d}g}td|d�D]4}|�|�|�|�kr(|�||�|�|�|�f�q(|SrP�rQrSrTrW�append�r!rXrIr�tsrrr�not_equal_witness�s���zWhitespace.not_equal_witnesscCsp|j|jkrdS|jr(|jr(|j|jkSt|��|���d}td|d�D]}|�|�|�|�krLdSqLdS)NFr�T)rIrMrJrQrSrTrW)r!rXrIr]rrr�less�s��zWhitespace.lesscCsbt|��|���d}g}td|d�D]4}|�|�|�|�kr(|�||�|�|�|�f�q(|SrPrZr\rrr�not_less_witnesss���zWhitespace.not_less_witnessN)r'r(r)rFrGr"rSrWrYr^r`rarrrrrD�srDcCs8dd�|D�}d}t|�dkr&|d}|dd�|�S)Ncss|]}t|d�VqdS)rN)r
)�.0�tuprrr�	<genexpr>sz#format_witnesses.<locals>.<genexpr>zat tab sizer�srz, )rHr3)�wZfirsts�prefixrrr�format_witnessess
rhcCstj}tj}tj}tjtjf}td�g}d}|D]�\}}}	}
}||krLd}q0||kr�d}t|�}|d�|�s�|d�|�}
dt	|
�}t
|	d||��|�|�q0||kr�d}|d=q0|r0||kr0d}t|�}|d�|�s0|d�
|�}
dt	|
�}t
|	d||��q0dS)Nrrr���zindent not greater e.g. zindent not equal e.g. )r5�INDENT�DEDENT�NEWLINE�COMMENTrrDr`rarhrr[rYr^)�tokensrjrkrlZJUNK�indentsZcheck_equal�type�token�start�endr ZthisguyZwitnessrrrrrs6

�__main__)r*�__version__r-r
r5�hasattr�
ValueError�__all__rrrr�	ExceptionrrrDrhrr'rrrr�<module>s&

=7__pycache__/_markupbase.cpython-38.pyc000064400000017160151153537570013716 0ustar00U

e5d9�@sVdZddlZe�d�jZe�d�jZe�d�Ze�d�Ze�d�Z[Gdd	�d	�Z	dS)
z�Shared support for scanning document type declarations in HTML and XHTML.

This module is used as a foundation for the html.parser module.  It has no
documented public API and should not be used directly.

�Nz[a-zA-Z][-_.a-zA-Z0-9]*\s*z(\'[^\']*\'|"[^"]*")\s*z--\s*>z	]\s*]\s*>z]\s*>c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdZ	d
d�Z
d#dd�Zd$dd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"S)%�
ParserBaseziParser base class which provides some common support methods used
    by the SGML/HTML and XHTML parsers.cCs|jtkrtd��dS)Nz)_markupbase.ParserBase must be subclassed)�	__class__r�RuntimeError��self�r�#/usr/lib64/python3.8/_markupbase.py�__init__s
�zParserBase.__init__cCstd��dS)Nz.subclasses of ParserBase must override error())�NotImplementedError)r�messagerrr�error s�zParserBase.errorcCsd|_d|_dS)N�r��lineno�offsetrrrr�reset$szParserBase.resetcCs|j|jfS)z&Return current line number and offset.rrrrr�getpos(szParserBase.getposcCsb||kr|S|j}|�d||�}|rN|j||_|�d||�}||d|_n|j|||_|S)N�
r
)�rawdata�countr�rindexr)r�i�jrZnlines�posrrr�	updatepos0szParserBase.updatepos�c
Cs�|j}|d}|||�dks&td��|||d�dkrB|dS|||d�dkrZdSt|�}|||d�dkr�|�|�S||d	kr�|�|�S|�||�\}}|d
kr�|S|dkr�d|_||k�r�||}|dk�r||d|�}|dk�r|�|�n
|�|�|dS|d
k�r<t	||�}|�s2dS|�
�}n�|dk�rX|�||�\}	}nt||jk�rn|d}n^|d	k�r�|dk�r�|�|d|�}n$|dk�r�|�d|�n
|�d�n|�d||�|d
kr�|Sq�dS)N��<!z$unexpected call to parse_declarationr
�>)�-r���z--�[rZdoctyperz"'Z4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ>�linktype�attlist�element�linkz&unsupported '[' char in %s declarationz"unexpected '[' char in declarationz!unexpected %r char in declaration)
r�AssertionError�len�
parse_comment�parse_marked_section�
_scan_name�_decl_othercharsZhandle_decl�unknown_decl�_declstringlit_match�end�_parse_doctype_subsetr)
rrrr�nZdecltype�c�data�m�namerrr�parse_declaration@s\














�zParserBase.parse_declarationr
cCs�|j}|||d�dks"td��|�|d|�\}}|dkrB|S|dkr\t�||d�}n4|dkrvt�||d�}n|�d||d|��|s�dS|r�|�d�}|�||d|��|�	d�S)	N�z<![z)unexpected call to parse_marked_section()r>�rcdata�temp�ignore�cdata�include>�endif�else�ifz+unknown status keyword %r in marked sectionr )
rr&r*�_markedsectionclose�search�_msmarkedsectioncloser�startr,r.)rr�reportrZsectNamer�matchrrrr)�s 
zParserBase.parse_marked_sectioncCsj|j}|||d�dkr$|�d�t�||d�}|s<dS|r`|�d�}|�||d|��|�d�S)N��<!--z"unexpected call to parse_comment()r r)rr�
_commentcloser@rBZhandle_commentr.)rrrCrrDrrrrr(�s

zParserBase.parse_commentc
Cs*|j}t|�}|}||k�r&||}|dk�r0|||d�}|dkrJdS|dkrp|�||d�|�d|�|d|kr�dS|d|kr�dS|||d�dkr�|j|d	d
�}|d	kr|Sq|�|d|�\}}|dkr�dS|dk�r|�||d�|�d|�t|d
|�}	|	||�}|d	k�r$|Sq|dk�r�|d|k�rLdS|�|d|�\}}|d	k�rn|S||dk�r$|d}q|dk�r�|d}||k�r�||���r�|d}�q�||k�r�||dk�r�|S|�||�|�d�ndSq|���r
|d}q|�||�|�d|�qdS)N�<rr rr
z*unexpected char in internal subset (in %r)rErFr)rC>r$r#�notation�entityz)unknown declaration %r in internal subsetZ_parse_doctype_�%�;�]rz%unexpected char after internal subsetz%unexpected char %r in internal subset)rr'rrr(r*�getattr�isspace)
rr�declstartposrr0rr1�sr4Zmethrrrr/�sp


�








z ParserBase._parse_doctype_subsetcCsF|�||�\}}|dkrdS|j}d||d�krB|�d|�dSdS)Nr rr
)r*r�find)rrrPr4rrrrr�_parse_doctype_element�sz!ParserBase._parse_doctype_elementcCs�|j}|�||�\}}|||d�}|dkr2dS|dkrB|dS|�||�\}}|dkr^|S|||d�}|dkrzdS|dkr�d||d�kr�|�d|�d}ndS|||d���r�|d}q�||d�s�dSn|�||�\}}|||d�}|�sdS|dk�rDt||�}|�r&|��}ndS|||d�}|�sDdS|d	k�r�||d�d	k�rddS|�|d|�\}}|dk�r�|S|||d�}|�s�dS|dkrB|dSqBdS)
Nr
rr rr�(�)�'"�#)rr*rRrOr-r.)rrrPrr4rr1r3rrr�_parse_doctype_attlistsX





z!ParserBase._parse_doctype_attlistcCs�|�||�\}}|dkr|S|j}|||d�}|s:dS|dkrJ|dS|dkrnt||�}|sddS|��}q"|�||�\}}|dkr"|Sq"dS)Nrr
r rrV)r*rr-r.)rrrPr4rrr1r3rrr�_parse_doctype_notation=s"

z"ParserBase._parse_doctype_notationcCs�|j}|||d�dkrR|d}|||d�}|s:dS|��rP|d}q"qVq"n|}|�||�\}}|dkrr|S|j||d�}|s�dS|dkr�t||�}|r�|��}q�dSqr|dkr�|dS|�||�\}}|dkrr|SqrdS)Nr
rKr rrVr)rrOr*r-r.)rrrPrrr1r4r3rrr�_parse_doctype_entityTs4


z ParserBase._parse_doctype_entitycCs�|j}t|�}||krdSt||�}|r\|��}|��}|t|�|krLdS|��|��fS|�||�|�d|||d��dS)N)Nr zexpected name token at %r�)	rr'�_declname_match�group�strip�lowerr.rr)rrrPrr0r3rQr4rrrr*xs
�zParserBase._scan_namecCsdS)Nr)rr2rrrr,�szParserBase.unknown_declN)r
)r
)�__name__�
__module__�__qualname__�__doc__r	rrrrr+r5r)r(r/rSrXrYrZr*r,rrrrrs"
R

C9$r)
rc�re�compilerDr\r-rGr?rArrrrr�<module>s


__pycache__/pstats.cpython-38.pyc000064400000053064151153537570012746 0ustar00U

e5d�j�@s�dZddlZddlZddlZddlZddlZddlmZddlm	Z	ddgZ
Gdd�dee�ZGdd�d�Z
Gd	d
�d
�Zdd�Zd
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zedk�r�ddlZzddlZWnek
r�YnXGdd�dej�Zeej�dk�rejdZndZzPee�Zejdd�D]Z e�!e ��q0e"dej#d�e�$�e"d ej#d�Wne%k
�r~YnXdS)!z3Class for printing reports on profiled python code.�N)�Enum)�
cmp_to_key�Stats�SortKeyc@s8eZdZdZdZdZdZdZdZdZ	dZ
d	Zd
d�ZdS)
r)�calls�ncalls)�
cumulative�cumtime)�filename�module�line�name�nfl�pcalls�stdname)�time�tottimecGs@|d}t�||�}||_|dd�D]}||j|<q&||_|S�Nr�)�str�__new__�_value_�_value2member_map_Z_all_values)�cls�values�value�objZother_value�r�/usr/lib64/python3.8/pstats.pyr-szSortKey.__new__N)
�__name__�
__module__�__qualname__ZCALLSZ
CUMULATIVEZFILENAMEZLINE�NAMEZNFLZPCALLSZSTDNAMEZTIMErrrrrr"sc@s�eZdZdZdd�dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dddddddddddddd�
Z
dd�Zdd�Zdd�Z
d d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd7d1d2�Zd3d4�Zd5d6�ZdS)8ra�This class is used for creating reports from data generated by the
    Profile class.  It is a "friend" of that class, and imports data either
    by direct access to members of Profile class, or by reading in a dictionary
    that was emitted (via marshal) from the Profile class.

    The big change from the previous Profiler (in terms of raw functionality)
    is that an "add()" method has been provided to combine Stats from
    several distinct profile runs.  Both the constructor and the add()
    method now take arbitrarily many file names as arguments.

    All the print methods now take an argument that indicates how many lines
    to print.  If the arg is a floating point number between 0 and 1.0, then
    it is taken as a decimal percentage of the available lines to be printed
    (e.g., .1 means print 10% of all available lines).  If it is an integer,
    it is taken to mean the number of lines of data that you wish to have
    printed.

    The sort_stats() method now processes some additional options (i.e., in
    addition to the old -1, 0, 1, or 2 that are respectively interpreted as
    'stdname', 'calls', 'time', and 'cumulative').  It takes either an
    arbitrary number of quoted strings or SortKey enum to select the sort
    order.

    For example sort_stats('time', 'name') or sort_stats(SortKey.TIME,
    SortKey.NAME) sorts on the major key of 'internal function time', and on
    the minor key of 'the name of the function'.  Look at the two tables in
    sort_stats() and get_sort_arg_defs(self) for more examples.

    All methods return self, so you can string together commands like:
        Stats('foo', 'goo').strip_dirs().sort_stats('calls').                            print_stats(5).print_callers(5)
    N)�streamcGsF|ptj|_t|�sd}n|d}|dd�}|�|�|j|�dSr)�sys�stdoutr#�len�init�add)�selfr#�args�argrrr�__init__Ys
zStats.__init__cCs�d|_g|_d|_d|_d|_d|_d|_t�|_i|_	i|_
|�|�z|��Wn8t
k
r�td|jrx|jdnd|jd��YnXdS)NrzInvalid timing data %s������file)�all_callees�files�fcn_list�total_tt�total_calls�
prim_calls�max_name_len�set�	top_level�stats�
sort_arg_dict�
load_stats�get_top_level_stats�	Exception�printr#)r)r+rrrr'cs(
��z
Stats.initc	Cs�|dkri|_dSt|t�rxt|d��}t�|�|_W5QRXz"t�|�}t�	|j
�d|}WnYnX|g|_n t|d�r�|�
�|j|_i|_|js�td|j|f��dS)N�rbz    �create_statsz.Cannot create or construct a %r object from %r)r:�
isinstancer�open�marshal�load�os�statr�ctime�st_mtimer2�hasattrrA�	TypeError�	__class__)r)r+�fZ
file_statsrrrr<vs*



�zStats.load_statscCs�|j��D]p\}\}}}}}|j|7_|j|7_|j|7_d|krZ|j�|�tt|��|j	kr
tt|��|_	q
dS)N)ZjprofilerZprofiler)
r:�itemsr5r6r4r9r(r&�func_std_stringr7)r)�func�cc�nc�tt�ct�callersrrrr=�szStats.get_top_level_statscGs�|s|St|�D]�}t|�t|�kr,t|�}|j|j7_|j|j7_|j|j7_|j|j7_|jD]}|j�|�qr|j	|j	kr�|j	|_	d|_
|j��D]<\}}||jkr�|j|}nddddif}t
||�|j|<q�q|S�Nr)�reversed�typerr2r5r6r4r9r(r7r3r:rN�add_func_stats)r)�arg_list�itemrPrGZ
old_func_statrrrr(�s(

z	Stats.addc	Cs(t|d��}t�|j|�W5QRXdS)z:Write the profile data to a file we know how to load back.�wbN)rCrD�dumpr:)r)r
rMrrr�
dump_stats�szStats.dump_stats)))rr-z
call count)))�r-zcumulative time))��rz	file name))��rzline number))��rz
function name))rdr`rbzname/file/line)))rr-zprimitive call count)))�rz
standard name)))�r-z
internal time)
rrr	rr
rrr
rrrrrcCst|jsni|_}i}|j��D]>\}}|}|r|s4q||krFd||<q|||<|dd�}q*q|D]
}||=qb|jS)z)Expand all abbreviations that are unique.rNr-)r;�sort_arg_dict_defaultrN)r)�dictZbad_list�word�tupZfragmentrrr�get_sort_arg_defs�s 
zStats.get_sort_arg_defscGs\|sd|_|St|�dkrBt|dt�rBddddd�|dg}n:t|�dkr||dd�D] }t|�t|d�krZtd	��qZ|��}d
}d|_d}|D]B}t|t�r�|j	}|||d}|j|||d7_d}q�g}|j
��D]4\}\}	}
}}}
|�|	|
||f|t
|�|f�q�|jtt|�j�d
�g|_}|D]}|�|d��qB|S)Nrrrrrr)r-rrrgrgzCan't have mixed argument typerr.z, )�keyr-)r3r&rB�intrXrKrl�	sort_typerrr:rN�appendrO�sortr�	TupleComp�compare)r)Zfieldr+Z
sort_arg_defsZ
sort_tupleZ	connectorrjZ
stats_listrPrQrRrSrTrUr3�tuplerrr�
sort_stats�sF��


�
zStats.sort_statscCs|jr|j��|S�N)r3�reverse�r)rrr�
reverse_orders
zStats.reverse_ordercCs�|j}i|_}d}|��D]�\}\}}}}}	t|�}
tt|
��|krRtt|
��}i}|	��D]\}}
|
|t|�<q^|
|kr�t||
|||||f�||
<q|||||f||
<q|j}t�|_}|D]}|�t|��q�||_	d|_
d|_|SrV)r:rN�func_strip_pathr&rOrYr9r8r(r7r3r1)r)ZoldstatsZnewstatsr7rPrQrRrSrTrUZnewfuncZ
newcallers�func2�callerZold_topZnew_toprrr�
strip_dirss0
�
zStats.strip_dirsc
Cst|jr
dSi|_}|j��D]P\}\}}}}}||kr@i||<|��D]$\}}	||kr`i||<|	|||<qHqdSrv)r1r:rN)
r)r1rPrQrRrSrTrUr{r|rrr�calc_callees#s
zStats.calc_calleescCs|}t|t�rpzt�|�}Wn*tjk
rF|d|7}||fYSXg}|D]}|�t|��rP|�|�qPnzt|�}t|t	�r�d|kr�dkr�nnt
||d�}|d|�}n2t|t
�r�d|kr�|kr�nn|}|d|�}t|�t|�k�r|dt|�t|�|f7}||fS)Nz#   <Invalid regular expression %r>
gg�?g�?rz6   List reduced from %r to %r due to restriction <%r>
)rBr�re�compile�error�searchrOrpr&�floatrn)r)Zsel�list�msgZnew_listZrexrP�countrrr�eval_print_amount6s2
""�zStats.eval_print_amountcCs�|j}|jr*|jdd�}d|jd}nt|j���}d}|D]}|�|||�\}}q@t|�}|sld|fSt||j	d�|t|j�kr�d}|D] }tt
|��|kr�tt
|��}q�|d|fS)Nz   Ordered by: �
z!   Random listing order was used
rr/rg)r7r3ror�r:�keysr�r&r?r#rO)r)Zsel_list�widthZ	stat_listr�Z	selectionr�rPrrr�get_print_listPs$zStats.get_print_listcGs�|jD]}t||jd�q|jr,t|jd�d}|jD]}t|t|�|jd�q6t||jdd|jd�|j|jkr�td|jd|jd�td|j|jd�t|jd�|�|�\}}|r�|�	�|D]}|�
|�q�t|jd�t|jd�|S)Nr/�        zfunction calls� ��endr0z(%d primitive calls)zin %.3f seconds)r2r?r#r9�func_get_function_namer5r6r4r��print_title�
print_line)r)�amountr
�indentrPr�r�rrr�print_statshs(

zStats.print_statscGsz|�|�\}}|rv|��|�|d�|D]2}||jkrN|�|||j|�q*|�||i�q*t|jd�t|jd�|S)Nz	called...r/)r�r~�print_call_headingr1�print_call_liner?r#)r)r�r�r�rPrrr�
print_calleess
zStats.print_calleesc
Gsh|�|�\}}|rd|�|d�|D](}|j|\}}}}}	|�|||	d�q"t|jd�t|jd�|S)Nzwas called by...z<-r/)r�r�r:r�r?r#)
r)r�r�r�rPrQrRrSrTrUrrr�
print_callers�szStats.print_callersc
Csvtd�|�||jd�d}|j��D]0\}}}}}|r&tt|����}	t|	t�}qXq&|rrtd|d|jd�dS)Nz	Function r/Fr�z    ncalls  tottime  cumtime)	r?�ljustr#r:r�next�iterrBrt)
r)�	name_sizeZcolumn_titleZ	subheaderrQrRrSrTrUrrrrr��s
zStats.print_call_heading�->cCstt|��|�|d|jd�|s2t|jd�dSt|���}d}|D]�}t|�}||}	t|	t�r�|	\}
}}}
|
|kr�d|
|f}n
d|
f}d|�dd	t	|��t
|�t
|
�|f}|d
}n$d||	t
|j|d�f}|d}t||||jd�d}qFdS)
Nr�r�r/r.z%d/%dz%dz%s %s %s  %srfrgrz	%s(%r) %sr_)r?rOr�r#�sortedr�rBrt�rjustr&�f8r:)r)r��sourceZ	call_dictZarrowZclistr�rPr
rrRrQrSrTZsubstatsZ
left_widthrrrr��s0

�
zStats.print_call_linecCs"tdd|jd�td|jd�dS)Nz-   ncalls  tottime  percall  cumtime  percallr�r�zfilename:lineno(function)r/�r?r#rxrrrr��szStats.print_titlecCs�|j|\}}}}}t|�}||kr4|dt|�}t|�d�d|jd�tt|�d|jd�|dkrxtdd|jd�ntt||�d|jd�tt|�d|jd�|dkr�tdd|jd�ntt||�d|jd�tt|�|jd�dS)N�/�	r�r�rr�r/)r:rr?r�r#r�rO)r)rPrQrRrSrTrU�crrrr��szStats.print_line)r�)rr r!�__doc__r,r'r<r=r(r^rhrlruryr}r~r�r�r�r�r�r�r�r�r�rrrrr7sF!

�'
c@s eZdZdZdd�Zdd�ZdS)rra�This class provides a generic function for comparing any two tuples.
    Each instance records a list of tuple-indices (from most significant
    to least significant), and sort direction (ascending or decending) for
    each tuple-index.  The compare functions can then be used as the function
    argument to the system sort() function when a list of tuples need to be
    sorted in the instances order.cCs
||_dSrv��comp_select_list)r)r�rrrr,�szTupleComp.__init__cCsF|jD]:\}}||}||}||kr0|S||kr|SqdSrVr�)r)�left�right�index�	direction�l�rrrrrs�s

zTupleComp.compareN)rr r!r�r,rsrrrrrr�srrcCs|\}}}tj�|�||fSrv)rF�path�basename)�	func_namer
rr
rrrrz�s
rzcCs|dS)Nrgr)rPrrrr��sr�cCsN|dd�dkrB|d}|�d�r<|�d�r<d|dd�S|Snd|SdS)	Nrg)�~r�<�>z{%s}rr-z	%s:%d(%s))�
startswith�endswith)r�r
rrrrO�srOcCs@|\}}}}}|\}}}	}
}||||||	||
t||�fS)z3Add together all the stats for two profile entries.)�add_callers)�targetr�rQrRrSrTrUZt_ccZt_ncZt_ttZt_ctZ	t_callersrrrrYs
�rYcCs�i}|��D]\}}|||<q|��D]V\}}||krtt|t�rbtdd�t|||�D��||<q||||7<q&|||<q&|S)z*Combine two caller lists in a single list.css|]\}}||VqdSrvr)�.0�i�jrrr�	<genexpr>szadd_callers.<locals>.<genexpr>)rNrBrt�zip)r�r�Znew_callersrPr|rrrr�s

"
r�cCsd}|��D]}||7}q|S)z@Sum the caller statistics to get total number of calls received.r)r)rUrRrrrr�count_callss
r�cCsd|S)Nz%8.3fr)�xrrrr�(sr��__main__c@s�eZdZd6dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�ZdS)7�ProfileBrowserNcCs6tj�|�d|_d|_tj|_|dk	r2|�|�dS)N�% )	�cmd�Cmdr,�promptr:r$r%r#�do_read)r)�profilerrrr,7szProfileBrowser.__init__c	Cs�|��}g}|D]�}z|�t|��WqWntk
r>YnXz<t|�}|dksZ|dkrltd|jd�Wq|�|�WqWntk
r�YnX|�|�q|jr�t|j|�|�ntd|jd�dS)Nrrz#Fraction argument must be in [0, 1]r/�No statistics object is loaded.)	�splitrprn�
ValueErrorr�r?r#r:�getattr)r)�fnrr*Z	processedZtermZfracrrr�generic?s,
zProfileBrowser.genericcCsXtd|jd�td|jd�td|jd�td|jd�td|jd�td|jd�dS)NzArguments may be:r/z0* An integer maximum number of entries to print.z:* A decimal fractional number between 0 and 1, controllingz-  what fraction of selected entries to print.z8* A regular expression; only entries with function namesz  that match it are printed.r�rxrrr�generic_helpWszProfileBrowser.generic_helpc
Csd|jrRz|j�|�Wq`tk
rN}ztd||f|jd�W5d}~XYq`Xntd|jd�dS)Nz$Failed to load statistics for %s: %sr/r�r)r:r(�OSErrorr?r#)r)r�errr�do_add_s*zProfileBrowser.do_addcCstd|jd�dS)Nz>Add profile info from given file to current statistics object.r/r�rxrrr�help_addhszProfileBrowser.help_addcCs|�d|�S)Nr��r��r)rrrr�
do_calleeskszProfileBrowser.do_calleescCstd|jd�|��dS)Nz6Print callees statistics from the current stat object.r/�r?r#r�rxrrr�help_calleesmszProfileBrowser.help_calleescCs|�d|�S)Nr�r�r�rrr�
do_callersqszProfileBrowser.do_callerscCstd|jd�|��dS)Nz6Print callers statistics from the current stat object.r/r�rxrrr�help_callerssszProfileBrowser.help_callerscCstd|jd�dS)Nr.r/rr�r�rrr�do_EOFwszProfileBrowser.do_EOFcCstd|jd�dS�NzLeave the profile browser.r/r�rxrrr�help_EOFzszProfileBrowser.help_EOFcCsdS)Nrrr�rrr�do_quit}szProfileBrowser.do_quitcCstd|jd�dSr�r�rxrrr�	help_quitszProfileBrowser.help_quitc
Cs�|r�zt|�|_Wnztk
rN}zt|jd|jd�WY�dSd}~XYn@tk
r�}z"t|jjd||jd�WY�dSd}~XYnX|d|_	n6t
|j	�dkr�|j	dd�}|�|�ntd|jd�dS)	Nrr/�:r�rg���z1No statistics object is current -- cannot reload.r)rr:r�r?r*r#r>rLrr�r&r�)r)r�errrrrr��szProfileBrowser.do_readcCs td|jd�td|jd�dS)Nz+Read in profile data from a specified file.r/z*Without argument, reload the current file.r�rxrrr�	help_read�szProfileBrowser.help_readcCs$|jr|j��ntd|jd�dS)Nr�r/r)r:ryr?r#r�rrr�
do_reverse�szProfileBrowser.do_reversecCstd|jd�dS)Nz/Reverse the sort order of the profiling report.r/r�rxrrr�help_reverse�szProfileBrowser.help_reversecs�|jstd|jd�dS|j���|rRt�fdd�|��D��rR|jj|���n<td|jd�tj�	�D]"\}}td||df|jd�qjdS)	Nr�r/c3s|]}|�kVqdSrvr)r�r��Zabbrevsrrr��sz)ProfileBrowser.do_sort.<locals>.<genexpr>z/Valid sort keys (unique prefixes are accepted):z%s -- %srr)
r:r?r#rl�allr�rurrhrN)r)rrmrrr�r�do_sort�s
zProfileBrowser.do_sortcCs td|jd�td|jd�dS)Nz.Sort profile data according to specified keys.r/z3(Typing `sort' without arguments lists valid keys.)r�rxrrr�	help_sort�szProfileBrowser.help_sortcs�fdd�tjD�S)Ncsg|]}|���r|�qSr)r�)r��a��textrr�
<listcomp>�s
z0ProfileBrowser.complete_sort.<locals>.<listcomp>)rrh)r)r�r*rr�r�
complete_sort�szProfileBrowser.complete_sortcCs|�d|�S)Nr�r�r�rrr�do_stats�szProfileBrowser.do_statscCstd|jd�|��dS)Nz.Print statistics from the current stat object.r/r�rxrrr�
help_stats�szProfileBrowser.help_statscCs$|jr|j��ntd|jd�dS)Nr�r/)r:r}r?r#r�rrr�do_strip�szProfileBrowser.do_stripcCstd|jd�dS)Nz<Strip leading path information from filenames in the report.r/r�rxrrr�
help_strip�szProfileBrowser.help_stripcCstd|jd�dS)NzShow help for a given command.r/r�rxrrr�	help_help�szProfileBrowser.help_helpcCs|r|SdSrvr)r)�stoprrrr�postcmd�szProfileBrowser.postcmd)N)rr r!r,r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr�6s4
	r�rrgz*Welcome to the profile statistics browser.r/zGoodbye.)&r�r$rFrrDr�enumr�	functoolsr�__all__rrrrrrzr�rOrYr�r�r�rr��readline�ImportErrorr�r�r&�argvZinitprofileZbrowserr�r�r?r#Zcmdloop�KeyboardInterruptrrrr�<module>sR 
__pycache__/_strptime.cpython-38.opt-1.pyc000064400000037256151153537570014402 0ustar00U

e5d�b�@s�dZddlZddlZddlZddlmZddlmZddlmZ	ddl
mZm
ZmZddlmZgZdd	�ZGd
d�de�ZGdd
�d
e�Ze�Ze�adZiadd�Zdd�Zddd�Z ddd�Z!ddd�Z"dS)a�Strptime-related classes and functions.

CLASSES:
    LocaleTime -- Discovers and stores locale-specific time information
    TimeRE -- Creates regexes for pattern matching a string of text containing
                time information

FUNCTIONS:
    _getlang -- Figure out what language is being used for the locale
    strptime -- Calculates the time struct represented by the passed-in string

�N)�compile)�
IGNORECASE)�escape)�date�	timedelta�timezone)�
allocate_lockcCst�tj�S�N)�localeZ	getlocale�LC_TIME�rr�!/usr/lib64/python3.8/_strptime.py�_getlangsrc@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�
LocaleTimeakStores and handles locale-specific information related to time.

    ATTRIBUTES:
        f_weekday -- full weekday names (7-item list)
        a_weekday -- abbreviated weekday names (7-item list)
        f_month -- full month names (13-item list; dummy value in [0], which
                    is added by code)
        a_month -- abbreviated month names (13-item list, dummy value in
                    [0], which is added by code)
        am_pm -- AM/PM representation (2-item list)
        LC_date_time -- format string for date/time representation (string)
        LC_date -- format string for date representation (string)
        LC_time -- format string for time representation (string)
        timezone -- daylight- and non-daylight-savings timezone representation
                    (2-item list of sets)
        lang -- Language used by instance (2-item tuple)
    cCsht�|_|��|��|��|��|��t�|jkrDtd��tj	|j	ks\tj
|j
krdtd��dS)a�Set all attributes.

        Order of methods called matters for dependency reasons.

        The locale language is set at the offset and then checked again before
        exiting.  This is to make sure that the attributes were not set with a
        mix of information from more than one locale.  This would most likely
        happen when using threads where one thread calls a locale-dependent
        function while another thread changes the locale while the function in
        the other thread is still running.  Proper coding would call for
        locks to prevent changing the locale while locale-dependent code is
        running.  The check here is done in case someone does not think about
        doing this.

        Only other possible issue is if someone changed the timezone and did
        not call tz.tzset .  That is an issue for the programmer, though,
        since changing the timezone is worthless without that call.

        z$locale changed during initializationz&timezone changed during initializationN)r�lang�_LocaleTime__calc_weekday�_LocaleTime__calc_month�_LocaleTime__calc_am_pm�_LocaleTime__calc_timezone�_LocaleTime__calc_date_time�
ValueError�time�tzname�daylight)�selfrrr
�__init__1szLocaleTime.__init__cCs4dd�td�D�}dd�td�D�}||_||_dS)NcSsg|]}tj|���qSr)�calendarZday_abbr�lower��.0�irrr
�
<listcomp>Ssz-LocaleTime.__calc_weekday.<locals>.<listcomp>�cSsg|]}tj|���qSr)rZday_namerrrrr
r!Ts)�range�	a_weekday�	f_weekday)rr$r%rrr
Z__calc_weekdayPszLocaleTime.__calc_weekdaycCs4dd�td�D�}dd�td�D�}||_||_dS)NcSsg|]}tj|���qSr)rZ
month_abbrrrrrr
r!Zsz+LocaleTime.__calc_month.<locals>.<listcomp>�
cSsg|]}tj|���qSr)rZ
month_namerrrrr
r![s)r#�a_month�f_month)rr'r(rrr
Z__calc_monthXszLocaleTime.__calc_monthcCsJg}dD]6}t�ddd|ddddd	f	�}|�t�d
|����q||_dS)N)�������,�7��Lr�%p)r�struct_time�append�strftimer�am_pm)rr6�hour�
time_tuplerrr
Z__calc_am_pm_s
zLocaleTime.__calc_am_pmc
CsJt�d�}dddg}t�d|���|d<t�d|���|d<t�d|���|d<d|jdd	f|jd
df|jddf|jd
d
f|jddfdddddddddddg}|�	dd�|j
D��dD]d\}}||}|D]\}}|r�|�||�}q�t�d�}dt�||�k�rd}	nd }	|�d!|	�||<q�|d|_|d|_
|d|_dS)"N)	r+r,r-r*r.r/r0r1r�%cr�%xr)�%Xr0)�%z%%z%Ar,z%Bz%az%br2)Z1999z%Y)Z99z%y)Z22z%H)Z44z%M)Z55z%S)Z76z%j)Z17z%d)Z03�%m)�3r=)�2z%w)Z10z%IcSsg|]}|D]}|df�qqS)z%Zr)r�	tz_values�tzrrr
r!�s�z/LocaleTime.__calc_date_time.<locals>.<listcomp>))rr9)r)r:)r0r;)	r+r)r,r)r)r)�r,rZ00z%Wz%UZ11)rr3r5rr%r(r$r'r6�extendr�replace�LC_date_time�LC_date�LC_time)
rr8Z	date_timeZreplacement_pairs�offset�	directiveZcurrent_format�old�newZU_Wrrr
Z__calc_date_timeksH

�


zLocaleTime.__calc_date_timecCszzt��Wntk
r YnXtj|_tj|_tdd|jd��h�}|jrft|jd��h�}nt�}||f|_dS)N�utc�gmtrr))r�tzset�AttributeErrorrr�	frozensetrr)rZ	no_savingZ
has_savingrrr
Z__calc_timezone�szLocaleTime.__calc_timezoneN)
�__name__�
__module__�__qualname__�__doc__rrrrrrrrrr
rs-rcs:eZdZdZd�fdd�	Zdd�Zdd�Zd	d
�Z�ZS)�TimeREz4Handle conversion from format directives to regexes.Ncs|r||_nt�|_t�}|�ddddddddd	d
ddd
ddd|�|jjd�|�|jjd�|�|jjdd�d�|�|jjdd�d�|�|jj	d�|�dd�|jj
D�d�dd��|�d|�d��
dd��|�d|�|jj��|�d |�|jj��|�d!|�|jj��dS)"z^Create keys/values.

        Order of execution is important for dependency reasons.

        z)(?P<d>3[0-1]|[1-2]\d|0[1-9]|[1-9]| [1-9])z(?P<f>[0-9]{1,6})z(?P<H>2[0-3]|[0-1]\d|\d)z(?P<I>1[0-2]|0[1-9]|[1-9])z(?P<G>\d\d\d\d)zG(?P<j>36[0-6]|3[0-5]\d|[1-2]\d\d|0[1-9]\d|00[1-9]|[1-9]\d|0[1-9]|[1-9])z(?P<m>1[0-2]|0[1-9]|[1-9])z(?P<M>[0-5]\d|\d)z(?P<S>6[0-1]|[0-5]\d|\d)z(?P<U>5[0-3]|[0-4]\d|\d)z(?P<w>[0-6])z(?P<u>[1-7])z(?P<V>5[0-3]|0[1-9]|[1-4]\d|\d)z(?P<y>\d\d)z(?P<Y>\d\d\d\d)z2(?P<z>[+-]\d\d:?[0-5]\d(:?[0-5]\d(\.\d{1,6})?)?|Z)�A�ar)N�B�b�pcss|]}|D]
}|Vq
qdSr	r)rZtz_namesrArrr
�	<genexpr>�s�z"TimeRE.__init__.<locals>.<genexpr>�Zr<)�d�f�H�I�G�j�m�M�S�U�w�u�V�y�Y�zrVrWrXrYrZr\r<�Wrf�c�x�X)�locale_timer�superr�_TimeRE__seqToREr%r$r(r'r6r�__setitem__�__getitem__rD�patternrErFrG)rrq�base��	__class__rr
r�sF��zTimeRE.__init__cCsPt|tdd�}|D]}|dkrq(qdSd�dd�|D��}d||f}d|S)	aeConvert a list to a regex string for matching a directive.

        Want possible matching values to be from longest to shortest.  This
        prevents the possibility of a match occurring for a value that also
        a substring of a larger value that should have matched (e.g., 'abc'
        matching when 'abcdef' should have been the match).

        T)�key�reverse��|css|]}t|�VqdSr	)�	re_escape)rZstuffrrr
r[�sz#TimeRE.__seqToRE.<locals>.<genexpr>z	(?P<%s>%sz%s))�sorted�len�join)rZ
to_convertrI�valueZregexrrr
Z	__seqToRE�s	zTimeRE.__seqToREcCs�d}td�}|�d|�}td�}|�d|�}d|krv|�d�d}d||d	|d�|||f}||dd	�}q,d
||fS)z�Return regex pattern for the format string.

        Need to make sure that any characters that might be interpreted as
        regex syntax are escaped.

        r|z([\\.^$*+?\(\){}\[\]|])z\\\1z\s+z\\s+r<r)z%s%s%sNz%s%s)�
re_compile�sub�index)r�formatZprocessed_formatZregex_charsZwhitespace_replacementZdirective_indexrrr
rv�s
�zTimeRE.patterncCst|�|�t�S)z2Return a compiled re object for the format string.)r�rvr)rr�rrr
rszTimeRE.compile)N)	rQrRrSrTrrsrvr�
__classcell__rrrxr
rU�s
.rU�cCslt|dd���}|s,|dd}|dd}d|d}|dkrLd||S|d|d}d||SdS)z�Calculate the Julian day based on the year, week of the year, and day of
    the week, with week_start_day representing whether the week of the year
    assumes the week starts on Sunday or Monday (6 or 0).r)r"rN)�
datetime_date�weekday)�year�week_of_yearZday_of_week�week_starts_MonZ
first_weekdayZ
week_0_lengthZdays_to_weekrrr
�_calc_julian_from_U_or_Wsr�cCsdt|dd���d}|d||}|dkr\|t|dd���7}|d8}|t|dd���8}||fS)z�Calculate the Julian day based on the ISO 8601 year, week, and weekday.
    ISO weeks start on Mondays, with week 01 being the week containing 4 Jan.
    ISO week days range from 1 (Monday) to 7 (Sunday).
    r)�r,r")r�Z
isoweekday�	toordinal)�iso_year�iso_weekZiso_weekdayZ
correctionZordinalrrr
�_calc_julian_from_V%sr��%a %b %d %H:%M:%S %Yc,Cs.t||g�D]*\}}t|t�sd}t|�|t|����qt��tj}t	�|j
kshtj|jkshtj
|j
kr|t�at��tj}tt�tkr�t��t�|�}|�s&zt�|�}Wnntk
r�}z.|jd}|dkr�d}~td||f�d�W5d}~XYn$tk
�rtd|�d�YnX|t|<W5QRX|�|�}	|	�sPtd||f��t|�|	��k�rztd	||	��d���d}
}d
}}
d}}}}d}d}d}d}}d}d}}|	��}|��D�]d}|dk�rt|d�}|d
k�r�|d7}n|d7}�q�|dk�r t|d�}�q�|dk�r:t|d�}
�q�|dk�rTt|d�}�q�|dk�rv|j�|d� ��}�q�|dk�r�|j!�|d� ��}�q�|dk�r�t|d�}
�q�|dk�r�t|d�}�q�|dk�r<t|d�}|�dd�� �}|d|j"dfk�r|dk�r8d}n"||j"d
k�r.|dk�r.|d7}�q�|dk�rVt|d�}�q�|dk�rpt|d�}�q�|dk�r�|d}|ddt|�7}t|�}�q�|d k�r�|j#�|d � ��}�q�|d!k�r�|j$�|d!� ��}�q�|d"k�rt|d"�}|dk�rd}n|d
8}�q�|d#k�r:t|d#�}|d
8}�q�|d$k�rTt|d$�}�q�|d%k�r�t||�}|d&k�rzd}nd}�q�|d'k�r�t|d'�}�q�|d(k�r�|d(}|d)k�r�d}n�|d*d+k�r.|dd*�|d,d�}t|�d-k�r.|d-d+k�rd.|d(��}t|��|dd-�|dd�}t|d
d*��}t|d*d-��} t|d-d/��p`d�}!|d0d0| d0|!}|d1d�}"ddt|"�}#t|"|#�}|�%d2��r.|}|}np|d)k�r�|d)� �}$t|j&�D]N\}%}&|$|&k�r�tjdtjd
k�r tj
�r |$d3k�r �q�n
|%}�qʐqސq�|dk�rv|
dk	�rv|dk�sZ|dk�rbtd4��|dk	�r�td5��n0|dk�r�|dk	�r�|dk�r�td6��ntd7��d8}'|dk�r�|d9k�r�|
d:k�r�d;}d<}'n|dk�r�d}|dk�r�|dk	�r�|dk	�r |dk�rd<nd8}(t'||||(�}n(|
dk	�rH|dk	�rHt(|
||d
�\}}|dk	�r�|dk�r�|d
8}t)�*|��rtd=nd>})||)7}|dk�r�t+|||
��,�t+|d
d
��,�d
}n0t+�-|d
t+|d
d
��,��}*|*j.}|*j/}|*j0}
|dk�r�t+|||
��1�}|�d)�}+|'�rd}|||
|||||||+|f||fS)?z�Return a 2-tuple consisting of a time struct and an int containing
    the number of microseconds based on the input string and the
    format string.z*strptime() argument {} must be str, not {}r�\r<z&'%s' is a bad directive in format '%s'Nzstray %% in format '%s'z%time data %r does not match format %rzunconverted data remains: %sr)���rj�Di�ilrkrarcrXrYr]r_r`rZr|�rdrer^�0rBrVrWrgrhrb)rfrmrfrirlr\r,�:r�r�zInconsistent use of : in r"�<��-)rLrMzzISO year directive '%G' must be used with the ISO week directive '%V' and a weekday directive ('%A', '%a', '%w', or '%u').z`Day of the year directive '%j' is not compatible with ISO year directive '%G'. Use '%Y' instead.zzISO week directive '%V' must be used with the ISO year directive '%G' and a weekday directive ('%A', '%a', '%w', or '%u').zdISO week directive '%V' is incompatible with the year directive '%Y'. Use the ISO year '%G' instead.Fr0�ipTinim)2�	enumerate�
isinstance�str�	TypeErrorr��type�_cache_lock�
_TimeRE_cacherqrrrrrrU�_regex_cache�clearr��_CACHE_MAX_SIZE�getr�KeyError�argsr�
IndexError�match�end�	groupdict�keys�intr(r�rr'r6r%r$�
startswithrr�r�rZisleapr�r�Zfromordinalr��month�dayr�),�data_stringr�r��arg�msgrqZformat_regex�errZ
bad_directive�foundr�r�r�r�r7Zminute�second�fractionrA�gmtoff�gmtoff_fractionr�r�Zweek_of_year_startr�ZjulianZ
found_dictZ	group_keyZampm�srlZhoursZminutes�secondsZgmtoff_remainderZgmtoff_remainder_paddingZ
found_zoner�r@Z
leap_year_fixr�ZydayZdatetime_resultrrrr
�	_strptime5s�

�
�

��
��




























��





�
����

��r�cCs"t||�d}t�|dtj��S)zIReturn a time struct based on the input string and the
    format string.rN)r�rr3�_STRUCT_TM_ITEMS)r�r��ttrrr
�_strptime_time/sr�cCspt||�\}}}|dd�\}}|dd�|f}|dk	rht||d�}	|rVt|	|�}
nt|	�}
||
f7}||�S)zPReturn a class cls instance based on the input string and the
    format string.���NrB)r�Zmicroseconds)r��datetime_timedelta�datetime_timezone)�clsr�r�r�r�r�rr�r�ZtzdeltarArrr
�_strptime_datetime5s
r�)r�)r�)r�)#rTrr
r�rerr�rrr~Zdatetimerr�rr�rr��_threadrZ_thread_allocate_lock�__all__r�objectr�dictrUr�r�r�r�r�r�r�r�r�rrrr
�<module>s.
_
{
__pycache__/statistics.cpython-38.opt-2.pyc000064400000042242151153537570014556 0ustar00U

e5d
��@sjdddddddddd	d
ddd
dddgZddlZddlZddlZddlmZddlmZddlm	Z	ddl
mZmZddlm
Z
mZmZmZmZmZmZmZddlmZddlmZGdd�de�Zdcdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Z d'd(�Z!ddd*d+�Z"d,d�Z#d-d�Z$d.d�Z%d/d�Z&d0d�Z'd1d	�Z(d2d�Z)ded4d�Z*d5d
�Z+d6d�Z,d7d8d9�d:d�Z-dfd;d<�Z.dgd=d�Z/dhd>d
�Z0did?d�Z1djd@d�Z2dAdB�Z3GdCd�d�Z4zddDl5m3Z3Wne6k
�r�YnXe7dEk�rfddFlm8Z8ddGlm9Z9m:Z:m;Z;m<Z<ddHlm=Z=ddl>Z>e4dIdJ�Z?e4dKdL�Z@dMZAe?�BeA�ZCe@�BeA�ZDe9e:fD]<ZEeFdNeEj7�dO��eFeEe?e@��eFe4�GeHeEeCeD����qNdPZIe9e:e;e<fD]@ZEeFdNeEj7�dQ��eFeEe?eI��eFe4�GeHeEeCe=eI�����q�dRZIe9e:e;fD]@ZEeFdSeEj7�dT��eFeEeIe?��eFe4�GeHeEe=eI�eC����q�dUdV�ZJe4dWdX�ZKe4dYdZ�ZLd[ZMdMZAe4�Gd\d]�eK�BeA�D��ZNeJeKeMeN�e4�Gd^d]�eK�BeA�D��ZNeJeKeMeN�e4�Gd_d]�eK�BeA�D��ZNeJeKeMeN�e4�Gd`d]�eK�BeA�D��ZNeJeKeMeN�e4�Gdad]�eOeK�BeA�eL�BeA��D��ZNeJeKeLeN�e4�Gdbd]�eOeK�BeA�eL�BeA��D��ZNeJeKeLeN�eFe>�P��dS)k�
NormalDist�StatisticsError�fmean�geometric_mean�
harmonic_mean�mean�median�median_grouped�median_high�
median_low�mode�	multimode�pstdev�	pvariance�	quantiles�stdev�variance�N��Fraction)�Decimal)�groupby)�bisect_left�bisect_right)�hypot�sqrt�fabs�exp�erf�tau�log�fsum)�
itemgetter)�Counterc@seZdZdS)rN)�__name__�
__module__�__qualname__�r&r&�"/usr/lib64/python3.8/statistics.pyruscCs�d}t|�\}}||i}|j}ttt|��}t|t�D]@\}}	t||�}tt|	�D]"\}}|d7}||d�|||<qRq6d|kr�|d}
ntdd�t|�	��D��}
||
|fS)Nr�css|]\}}t||�VqdS�Nr)�.0�d�nr&r&r'�	<genexpr>�sz_sum.<locals>.<genexpr>)
�_exact_ratio�get�_coerce�int�typer�map�sum�sorted�items)�data�start�countr,r+ZpartialsZpartials_get�T�typ�values�totalr&r&r'�_sum{s$
r>cCs.z
|��WStk
r(t�|�YSXdSr))Z	is_finite�AttributeError�mathZisfinite)�xr&r&r'�	_isfinite�s
rBcCs�||kr|S|tks|tkr |S|tkr,|St||�r:|St||�rH|St|t�rV|St|t�rd|St|t�r|t|t�r||St|t�r�t|t�r�|Sd}t||j|jf��dS)Nz"don't know how to coerce %s and %s)r1�bool�
issubclassr�float�	TypeErrorr#)r:�S�msgr&r&r'r0�s(



r0cCs�zrt|�tkst|�tkr$|��WSz|j|jfWWStk
rnz|��WYWStk
rhYnXYnXWn ttfk
r�|dfYSXd}t	|�
t|�j���dS)Nz0can't convert type '{}' to numerator/denominator)r2rEr�as_integer_ratio�	numerator�denominatorr?�
OverflowError�
ValueErrorrF�formatr#)rArHr&r&r'r.�s
r.cCspt|�|kr|St|t�r(|jdkr(t}z
||�WStk
rjt|t�rd||j�||j�YS�YnXdS)Nr()r2rDr1rKrErFrrJ)�valuer:r&r&r'�_convert�s

rPcCs.t||�}|t|�kr&|||kr&|St�dSr))r�lenrM)�arA�ir&r&r'�
_find_lteq
s
rTcCs>t|||d�}|t|�dkr6||d|kr6|dSt�dS)N)�lor()rrQrM)rR�lrArSr&r&r'�
_find_rteqs rW�negative valueccs$|D]}|dkrt|��|VqdS)Nr)r)r<�errmsgrAr&r&r'�	_fail_negsrZcCsHt|�|krt|�}t|�}|dkr,td��t|�\}}}t|||�S)Nr(z%mean requires at least one data point)�iter�listrQrr>rP)r7r,r:r=r9r&r&r'r'scstzt|��Wn0tk
r<d��fdd�}t||��}Yn
Xt|�}z
|�WStk
rntd�d�YnXdS)Nrc3s t|dd�D]\�}|VqdS)Nr()r8)�	enumerate)�iterablerA�r,r&r'r9Oszfmean.<locals>.countz&fmean requires at least one data point)rQrFr �ZeroDivisionErrorr)r7r9r=r&r_r'rAs	
cCs8ztttt|���WStk
r2td�d�YnXdS)NzHgeometric mean requires a non-empty dataset  containing positive numbers)rrr3rrMr)r7r&r&r'r\s�cCs�t|�|krt|�}d}t|�}|dkr2td��n<|dkrn|d}t|tjtf�rf|dkrbt|��|Std��z"t	dd�t
||�D��\}}}Wntk
r�YdSXt|||�S)Nz.harmonic mean does not support negative valuesr(z.harmonic_mean requires at least one data pointrzunsupported typecss|]}d|VqdS)r(Nr&�r*rAr&r&r'r-�sz harmonic_mean.<locals>.<genexpr>)
r[r\rQr�
isinstance�numbersZRealrrFr>rZr`rP)r7rYr,rAr:r=r9r&r&r'ros$
"cCs\t|�}t|�}|dkr td��|ddkr8||dS|d}||d||dSdS�Nr�no median for empty data�r(�r5rQr)r7r,rSr&r&r'r�s
cCsLt|�}t|�}|dkr td��|ddkr8||dS||ddSdSrdrg�r7r,r&r&r'r
�scCs,t|�}t|�}|dkr td��||dS)Nrrerfrgrhr&r&r'r	�s
r(c
Cs�t|�}t|�}|dkr"td��n|dkr2|dS||d}||fD]}t|ttf�rFtd|��qFz||d}Wn(tk
r�t|�t|�d}YnXt||�}t	|||�}|}||d}	|||d||	S)Nrrer(rfzexpected number but got %r)
r5rQrrb�str�bytesrFrErTrW)
r7Zintervalr,rA�obj�L�l1�l2Zcf�fr&r&r'r�s&

cCsHt|�}t|��d�}z|ddWStk
rBtd�d�YnXdS)Nr(rzno mode for empty data)r[r"�most_common�
IndexErrorr)r7Zpairsr&r&r'rscCs@tt|����}tt|td�d�dgf�\}}tttd�|��S)Nr()�keyr)r"r[rp�nextrr!r\r3)r7ZcountsZmaxcountZ
mode_itemsr&r&r'r5s
��	exclusive)r,�methodc
CsL|dkrtd��t|�}t|�}|dkr0td��|dkr�|d}g}td|�D]N}|||}||||}||||||d||}	|�|	�qN|S|dk�r:|d}g}td|�D]r}|||}|dkr�dn||dkr�|dn|}||||}||d||||||}	|�|	�q�|Std|����dS)Nr(zn must be at least 1rfz"must have at least two data pointsZ	inclusiveruzUnknown method: )rr5rQ�range�appendrM)
r7r,rvZld�m�resultrS�jZdeltaZinterpolatedr&r&r'rls4$
$$cs��dk	r,t�fdd�|D��\}}}||fSt|��t�fdd�|D��\}}}t�fdd�|D��\}}}||dt|�8}||fS)Nc3s|]}|�dVqdS�rfNr&ra��cr&r'r-�sz_ss.<locals>.<genexpr>c3s|]}|�dVqdSr|r&rar}r&r'r-�sc3s|]}|�VqdSr)r&rar}r&r'r-�srf)r>rrQ)r7r~r:r=r9�UZtotal2Zcount2r&r}r'�_ss�sr�cCsLt|�|krt|�}t|�}|dkr,td��t||�\}}t||d|�S)Nrfz*variance requires at least two data pointsr(�r[r\rQrr�rP)r7�xbarr,r:�ssr&r&r'r�s&cCsHt|�|krt|�}t|�}|dkr,td��t||�\}}t|||�S)Nr(z*pvariance requires at least one data pointr�)r7�mur,r:r�r&r&r'r�s#cCs8t||�}z
|��WStk
r2t�|�YSXdSr))rrr?r@)r7r��varr&r&r'rs
	

cCs8t||�}z
|��WStk
r2t�|�YSXdSr))rrr?r@)r7r�r�r&r&r'r
&s
	

cCs|d}t|�dkr�d||}d|d|d|d|d|d	|d
|d|}d|d
|d|d|d|d|d|d}||}|||S|dkr�|nd|}tt|��}|dk�r^|d}d|d|d|d|d|d|d|d}d|d |d!|d"|d#|d$|d%|d}n�|d}d&|d'|d(|d)|d*|d+|d,|d-}d.|d/|d0|d1|d2|d3|d4|d}||}|dk�r�|}|||S)5N��?g333333�?g��Q��?g^�}o)��@g�E.k�R�@g ��Ul�@g*u��>l�@g�N����@g�"]Ξ@gnC���`@gu��@giK��~j�@gv��|E�@g��d�|1�@gfR��r��@g��u.2�@g���~y�@g�n8(E@��?�g@g�������?g鬷�ZaI?gg�El�D�?g7\�����?g�uS�S�?g�=�.
@gj%b�@g���Hw�@gjR�e�?g�9dh?
>g('߿��A?g��~z �?g@�3��?gɅ3��?g3fR�x�?gI�F��l@g����t��>g*�Y��n�>gESB\T?g�N;A+�?g�UR1��?gE�F���?gP�n��@g&�>���@g����i�<g�@�F�>g�tcI,\�>g�ŝ���I?g*F2�v�?g�C4�?g��O�1�?)rrr)�pr��sigma�q�rZnumZdenrAr&r&r'�_normal_dist_inv_cdf9sd���������������������������
��������������������������	��������������������������
r�c@s�eZdZddd�Zd7dd�Zedd	��Zd
d�dd
�Zdd�Zdd�Z	dd�Z
d8dd�Zdd�Ze
dd��Ze
dd��Ze
dd��Ze
dd ��Ze
d!d"��Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�ZeZd/d0�ZeZd1d2�Zd3d4�Zd5d6�Zd
S)9rz(Arithmetic mean of a normal distributionz+Standard deviation of a normal distribution)�_mu�_sigmar�r�cCs(|dkrtd��t|�|_t|�|_dS)Nr�zsigma must be non-negative)rrEr�r�)�selfr�r�r&r&r'�__init__�s
zNormalDist.__init__cCs.t|ttf�st|�}t|�}||t||��Sr))rbr\�tuplerr)�clsr7r�r&r&r'�from_samples�szNormalDist.from_samplesN)�seedcsB|dkrtjn
t�|�j�|j|j�����fdd�t|�D�S)Ncsg|]}�����qSr&r&�r*rS��gaussr�r�r&r'�
<listcomp>�sz&NormalDist.samples.<locals>.<listcomp>)�randomr�ZRandomr�r�rw)r�r,r�r&r�r'�samples�szNormalDist.samplescCs<|jd}|std��t||jdd|�tt|�S)N�@z$pdf() not defined when sigma is zerog�)r�rrr�rr)r�rArr&r&r'�pdf�s
zNormalDist.pdfcCs2|jstd��ddt||j|jtd��S)Nz$cdf() not defined when sigma is zeror�r�r�)r�rrr�r)r�rAr&r&r'�cdf�szNormalDist.cdfcCs:|dks|dkrtd��|jdkr*td��t||j|j�S)Nr�r�z$p must be in the range 0.0 < p < 1.0z-cdf() not defined when sigma at or below zero)rr�r�r�)r�r�r&r&r'�inv_cdf�s


zNormalDist.inv_cdfrtcs��fdd�td��D�S)Ncsg|]}��|���qSr&)r�r��r,r�r&r'r��sz(NormalDist.quantiles.<locals>.<listcomp>r()rw)r�r,r&r�r'r�s	zNormalDist.quantilescCst|t�std��||}}|j|jf|j|jfkr>||}}|j|j}}|rT|s\td��||}t|j|j�}|s�dt|d|jt	d��S|j||j|}|j|jt	|d|t
||��}	||	|}
||	|}dt|�|
�|�|
��t|�|�|�|��S)Nz$Expected another NormalDist instancez(overlap() not defined when sigma is zeror�r�)rbrrFr�r�rrrrrrr�)r��other�X�YZX_varZY_varZdvZdmrR�b�x1�x2r&r&r'�overlap�s"


(zNormalDist.overlapcCs|jSr)�r��r�r&r&r'r�szNormalDist.meancCs|jSr)r�r�r&r&r'r�szNormalDist.mediancCs|jSr)r�r�r&r&r'r�szNormalDist.modecCs|jSr)�r�r�r&r&r'r�szNormalDist.stdevcCs
|jdS)Nr�r�r�r&r&r'rszNormalDist.variancecCs8t|t�r&t|j|jt|j|j��St|j||j�Sr)�rbrr�rr��r�r�r&r&r'�__add__	s

zNormalDist.__add__cCs8t|t�r&t|j|jt|j|j��St|j||j�Sr)r�r�r&r&r'�__sub__s

zNormalDist.__sub__cCst|j||jt|��Sr)�rr�r�rr�r&r&r'�__mul__%szNormalDist.__mul__cCst|j||jt|��Sr)r�r�r&r&r'�__truediv__-szNormalDist.__truediv__cCst|j|j�Sr)�rr�r��r�r&r&r'�__pos__5szNormalDist.__pos__cCst|j|j�Sr)r�r�r&r&r'�__neg__9szNormalDist.__neg__cCs
||Sr)r&r�r&r&r'�__rsub__?szNormalDist.__rsub__cCs&t|t�stS|j|jko$|j|jkSr))rbr�NotImplementedr�r�r�r&r&r'�__eq__Es
zNormalDist.__eq__cCst|j|jf�Sr))�hashr�r�r�r&r&r'�__hash__KszNormalDist.__hash__cCs t|�j�d|j�d|j�d�S)Nz(mu=z, sigma=�))r2r#r�r�r�r&r&r'�__repr__OszNormalDist.__repr__)r�r�)rt)r#r$r%�	__slots__r��classmethodr�r�r�r�r�rr��propertyrrrrrr�r�r�r�r�r��__radd__r��__rmul__r�r�r�r&r&r&r'r�sD�


"




)r��__main__)�isclose)�add�sub�mul�truediv)�repeat�
�����i��z
Test z with another NormalDist:�z with a constant:�z
Test constant with �:cCsdSr)r&)�G1�G2r&r&r'�assert_closesr�i�����I��/g`@@cCsg|]}|t�qSr&��srar&r&r'r��sr�cCsg|]}|t�qSr&r�rar&r&r'r��scCsg|]}|t�qSr&r�rar&r&r'r��scCsg|]}|t�qSr&r�rar&r&r'r��scCsg|]\}}||�qSr&r&�r*rA�yr&r&r'r��scCsg|]\}}||�qSr&r&r�r&r&r'r��s)r)rX)r()N)N)N)N)N)Q�__all__r@rcr�Z	fractionsrZdecimalr�	itertoolsrZbisectrrrrrrrrrr �operatorr!�collectionsr"rMrr>rBr0r.rPrTrWrZrrrrrr
r	rrrrr�rrrr
r�rZ_statistics�ImportErrorr#r�r�r�r�r�r�ZdoctestZg1Zg2r,r�r�r��func�printr�r3Zconstr�r�r�r�rG�zipZtestmodr&r&r&r'�<module>Ts��(
: 

/
779

/
,

JQ






�
�
__pycache__/token.cpython-38.opt-1.pyc000064400000004667151153537570013514 0ustar00U

e5d@	�0@s�dZddddgZdZdZdZdZd	Zd
ZdZdZ	d
Z
dZdZdZ
dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZd Zd!Zd"Zd#Z d$Z!d%Z"d&Z#d'Z$d(Z%d)Z&d*Z'd+Z(d,Z)d-Z*d.Z+d/Z,d0Z-d1Z.d2Z/d3Z0d4Z1d5Z2d6Z3d7Z4d8Z5d9Z6d:Z7d;Z8d<Z9d=Z:d>Z;d?Z<d@Z=dAZ>dBZ?dCZ@dDZAdEZBdFdG�eC��D�D�ZEe�FeE�G��eee*ee+e	e
ee%e0e(ee&eee'e5ee6ee1e2e)e
e7eee#e.eeeee e$e/e3e4eee"e-eee,ee!dH�/ZHdId�ZIdJd�ZJdKd�ZKdLS)MzToken constants.�tok_name�
ISTERMINAL�
ISNONTERMINAL�ISEOF����������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�cCs*i|]"\}}t|t�r|�d�s||�qS)�_)�
isinstance�int�
startswith)�.0�name�value�rM�/usr/lib64/python3.8/token.py�
<dictcomp>Js


�rO)/z!=�%z%=�&z&=�(�)�*z**z**=z*=�+z+=�,�-z-=z->�.z...�/z//z//=z/=�:z:=�;�<z<<z<<=z<=�=z==�>z>=z>>z>>=�@z@=�[�]�^z^=�{�|z|=�}�~cCs|tkS�N��	NT_OFFSET��xrMrMrNr�scCs|tkSrgrhrjrMrMrNr�scCs|tkSrg)�	ENDMARKERrjrMrMrNr�sN)L�__doc__�__all__rl�NAME�NUMBER�STRING�NEWLINE�INDENT�DEDENT�LPAR�RPAR�LSQB�RSQB�COLON�COMMA�SEMI�PLUS�MINUS�STAR�SLASH�VBAR�AMPER�LESS�GREATER�EQUAL�DOT�PERCENT�LBRACE�RBRACE�EQEQUAL�NOTEQUAL�	LESSEQUAL�GREATEREQUAL�TILDE�
CIRCUMFLEX�	LEFTSHIFT�
RIGHTSHIFT�
DOUBLESTAR�	PLUSEQUAL�MINEQUAL�	STAREQUAL�
SLASHEQUAL�PERCENTEQUAL�
AMPEREQUAL�	VBAREQUAL�CIRCUMFLEXEQUAL�LEFTSHIFTEQUAL�RIGHTSHIFTEQUAL�DOUBLESTAREQUAL�DOUBLESLASH�DOUBLESLASHEQUAL�AT�ATEQUAL�RARROW�ELLIPSIS�
COLONEQUAL�OP�AWAIT�ASYNC�TYPE_IGNORE�TYPE_COMMENT�
ERRORTOKEN�COMMENT�NL�ENCODING�N_TOKENSri�globals�itemsr�extend�values�EXACT_TOKEN_TYPESrrrrMrMrMrN�<module>s���2__pycache__/_dummy_thread.cpython-38.opt-2.pyc000064400000006502151153537570015204 0ustar00U

e5d��@s�ddddddddgZdZeZifd	d�Zd
d�Zdd�Zdd�Zddd�Zdd�Z	Gdd�de
�ZGdd�de�Zda
dadd�Zd
S)�error�start_new_thread�exit�	get_ident�
allocate_lock�interrupt_main�LockType�RLocklcCs�t|�tt��krtd��t|�tt��kr4td��daz|||�Wn.tk
rZYnddl}|��YnXdatr�dat	�dS)Nz2nd arg must be a tuplez3rd arg must be a dictF�T)
�type�tuple�	TypeError�dict�_main�
SystemExit�	traceback�	print_exc�
_interrupt�KeyboardInterrupt)Zfunction�args�kwargsr�r�%/usr/lib64/python3.8/_dummy_thread.pyrs 
cCst�dS�N)rrrrrr=scCsdS�N�rrrrrrAscCst�Sr�rrrrrrJsNcCs|dk	rtd��dS)Nz'setting thread stack size not supportedr	)r)�sizerrr�
stack_sizeNsrcCst�Srrrrrr�
_set_sentinelTsrc@sBeZdZdd�Zddd�ZeZdd�Zd	d
�Zdd�Zd
d�Z	dS)rcCs
d|_dS)NF��
locked_status��selfrrr�__init__cszLockType.__init__N���cCsH|dks|rd|_dS|js&d|_dS|dkr@ddl}|�|�dSdS)NTr	F)r �time�sleep)r"�waitflag�timeoutr%rrr�acquirefs
zLockType.acquirecCs|��dSr)�release)r"�typ�val�tbrrr�__exit__�szLockType.__exit__cCs|js
t�d|_dS)NFT)r rr!rrrr*�szLockType.releasecCs|jSrrr!rrr�locked�szLockType.lockedcCs*d|jrdnd|jj|jjtt|��fS)Nz<%s %s.%s object at %s>r/Zunlocked)r �	__class__�
__module__�__qualname__�hex�idr!rrr�__repr__�s
�zLockType.__repr__)Nr$)
�__name__r1r2r#r)�	__enter__r.r*r/r5rrrrrXs
	cs6eZdZ�fdd�Zd	�fdd�	Z�fdd�Z�ZS)
rcst���d|_dS)Nr	)�superr#�_levelsr!�r0rrr#�s
zRLock.__init__Nr$cs$t��||�}|r |jd7_|Sr)r8r)r9)r"r'r(r/r:rrr)�sz
RLock.acquirecs4|jdkrt�|jdkr"t���|jd8_dS)Nr	r)r9rr8r*r!r:rrr*�s



z
RLock.release)Nr$)r6r1r2r#r)r*�
__classcell__rrr:rr�sFTcCstr
t�ndadS)NT)rrrrrrrr�s)N)�__all__�TIMEOUT_MAX�RuntimeErrorrrrrrrr�objectrrrrrrrrr�<module>s"
� 	
@__pycache__/operator.cpython-38.opt-1.pyc000064400000032575151153537570014226 0ustar00U

e5d�)�6@s(dZddddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6g6Zd7d8lmZd9d&�Zd:d#�Zd;d	�Zd<d+�Zd=d�Z	d>d
�Z
d?d-�Zd@d5�ZdAd�Z
dBd�ZdCd�ZdDd�ZdEd�ZdFd
�ZdGd�ZdHd�ZeZdId%�ZdJd)�ZdKd*�ZdLd'�ZdMd,�ZdNd.�ZdOd/�ZdPd0�ZdQd1�ZdRd3�ZdSd4�ZdTd6�Z dUd�Z!dVd�Z"dWd�Z#dXd�Z$dYd�Z%dZd�Z&d[d2�Z'dqd\d$�Z(Gd]d�d�Z)Gd^d �d �Z*Gd_d(�d(�Z+d`d�Z,dad�Z-dbd�Z.dcd�Z/ddd�Z0ded�Z1dfd�Z2dgd�Z3dhd�Z4did�Z5djd�Z6dkd�Z7dld!�Z8dmd"�Z9zd7dnl:TWne;k
�rbYnXd7dol:mZeZ<eZ=eZ>eZ?e	Z@e
ZAeZBeZCeZDeZEeZFeZGeZHeZIeZJeZKeZLeZMeZNeZOeZPeZQeZReZSeZTe ZUe!ZVe"ZWe$ZXe%ZYe'ZZe,Z[e-Z\e.Z]e/Z^e0Z_e1Z`e2Zae3Zbe4Zce5Zde6Zee7Zfe8Zge9ZhdpS)ras
Operator Interface

This module exports a set of functions corresponding to the intrinsic
operators of Python.  For example, operator.add(x, y) is equivalent
to the expression x+y.  The function names are those used for special
methods; variants without leading and trailing '__' are also provided
for convenience.

This is the pure Python implementation of the module.
�abs�add�and_�
attrgetter�concat�contains�countOf�delitem�eq�floordiv�ge�getitem�gt�iadd�iand�iconcat�	ifloordiv�ilshift�imatmul�imod�imul�index�indexOf�inv�invert�ior�ipow�irshift�is_�is_not�isub�
itemgetter�itruediv�ixor�le�length_hint�lshift�lt�matmul�methodcaller�mod�mul�ne�neg�not_�or_�pos�pow�rshift�setitem�sub�truediv�truth�xor�)rcCs||kS)zSame as a < b.���a�br8r8� /usr/lib64/python3.8/operator.pyr&scCs||kS)zSame as a <= b.r8r9r8r8r<r#scCs||kS)zSame as a == b.r8r9r8r8r<r	#scCs||kS)zSame as a != b.r8r9r8r8r<r+'scCs||kS)zSame as a >= b.r8r9r8r8r<r+scCs||kS)zSame as a > b.r8r9r8r8r<r
/scCs|S)zSame as not a.r8�r:r8r8r<r-5scCs|rdSdS)z*Return True if a is true, False otherwise.TFr8r=r8r8r<r59scCs||kS)zSame as a is b.r8r9r8r8r<r=scCs||k	S)zSame as a is not b.r8r9r8r8r<rAscCst|�S)zSame as abs(a).)�_absr=r8r8r<rGscCs||S)zSame as a + b.r8r9r8r8r<rKscCs||@S)zSame as a & b.r8r9r8r8r<rOscCs||S)zSame as a // b.r8r9r8r8r<r
SscCs|��S)zSame as a.__index__().)�	__index__r=r8r8r<rWscCs|S)zSame as ~a.r8r=r8r8r<r[scCs||>S)zSame as a << b.r8r9r8r8r<r%`scCs||S)zSame as a % b.r8r9r8r8r<r)dscCs||S)zSame as a * b.r8r9r8r8r<r*hscCs||S)zSame as a @ b.r8r9r8r8r<r'lscCs|S)zSame as -a.r8r=r8r8r<r,pscCs||BS)zSame as a | b.r8r9r8r8r<r.tscCs|
S)zSame as +a.r8r=r8r8r<r/xscCs||S)zSame as a ** b.r8r9r8r8r<r0|scCs||?S)zSame as a >> b.r8r9r8r8r<r1�scCs||S)zSame as a - b.r8r9r8r8r<r3�scCs||S)zSame as a / b.r8r9r8r8r<r4�scCs||AS)zSame as a ^ b.r8r9r8r8r<r6�scCs(t|d�s dt|�j}t|��||S)z%Same as a + b, for a and b sequences.�__getitem__�!'%s' object can't be concatenated��hasattr�type�__name__�	TypeError�r:r;�msgr8r8r<r�s
cCs||kS)z(Same as b in a (note reversed operands).r8r9r8r8r<r�scCs"d}|D]}||kr|d7}q|S)z)Return the number of times b occurs in a.r7�r8)r:r;�count�ir8r8r<r�s

cCs
||=dS)zSame as del a[b].Nr8r9r8r8r<r�scCs||S)z
Same as a[b].r8r9r8r8r<r�scCs.t|�D]\}}||kr|Sqtd��dS)z!Return the first index of b in a.z$sequence.index(x): x not in sequenceN)�	enumerate�
ValueError)r:r;rK�jr8r8r<r�s
cCs|||<dS)zSame as a[b] = c.Nr8)r:r;�cr8r8r<r2�scCs�t|t�s dt|�j}t|��z
t|�WStk
r>YnXzt|�j}Wntk
rf|YSXz||�}Wntk
r�|YSX|tkr�|St|t�s�dt|�j}t|��|dkr�d}t	|��|S)a2
    Return an estimate of the number of items in obj.
    This is useful for presizing containers when building from an iterable.

    If the object supports len(), the result will be exact. Otherwise, it may
    over- or under-estimate by an arbitrary amount. The result will be an
    integer >= 0.
    z/'%s' object cannot be interpreted as an integerz'__length_hint__ must be integer, not %sr7z$__length_hint__() should return >= 0)
�
isinstance�intrDrErF�len�__length_hint__�AttributeError�NotImplementedrM)�obj�defaultrHZhint�valr8r8r<r$�s8	
�



�c@s4eZdZdZdZdd�Zdd�Zdd�Zd	d
�ZdS)raV
    Return a callable object that fetches the given attribute(s) from its operand.
    After f = attrgetter('name'), the call f(r) returns r.name.
    After g = attrgetter('name', 'date'), the call g(r) returns (r.name, r.date).
    After h = attrgetter('name.first', 'name.last'), the call h(r) returns
    (r.name.first, r.name.last).
    )�_attrs�_callcsn|s<t|t�std��|f|_|�d���fdd�}||_n.|f||_ttt|j����fdd�}||_dS)Nzattribute name must be a string�.cs�D]}t||�}q|S�N)�getattr)rV�name)�namesr8r<�func�sz!attrgetter.__init__.<locals>.funccst�fdd��D��S)Nc3s|]}|��VqdSr\r8)�.0�getter�rVr8r<�	<genexpr>�sz4attrgetter.__init__.<locals>.func.<locals>.<genexpr>��tuplerc)�gettersrcr<r`�s)	rP�strrFrY�splitrZrf�mapr)�self�attr�attrsr`r8)rgr_r<�__init__�s

zattrgetter.__init__cCs
|�|�Sr\�rZ�rkrVr8r8r<�__call__�szattrgetter.__call__cCs$d|jj|jjd�tt|j��fS�N�	%s.%s(%s)�, )�	__class__�
__module__�__qualname__�joinrj�reprrY�rkr8r8r<�__repr__s�zattrgetter.__repr__cCs|j|jfSr\)rurYrzr8r8r<�
__reduce__szattrgetter.__reduce__N�	rErvrw�__doc__�	__slots__rnrqr{r|r8r8r8r<r�sc@s4eZdZdZdZdd�Zdd�Zdd�Zd	d
�ZdS)r z�
    Return a callable object that fetches the given item(s) from its operand.
    After f = itemgetter(2), the call f(r) returns r[2].
    After g = itemgetter(2, 5, 3), the call g(r) returns (r[2], r[5], r[3])
    ��_itemsrZcsF�s �f|_�fdd�}||_n"�f�|_��fdd�}||_dS)Ncs|�Sr\r8rc)�itemr8r<r`sz!itemgetter.__init__.<locals>.funccst�fdd��D��S)Nc3s|]}�|VqdSr\r8)rarKrcr8r<rdsz4itemgetter.__init__.<locals>.func.<locals>.<genexpr>rerc)�itemsrcr<r`sr�)rkr�r�r`r8)r�r�r<rnszitemgetter.__init__cCs
|�|�Sr\rorpr8r8r<rqszitemgetter.__call__cCs$d|jj|jjd�tt|j��fSrr)rurvrErxrjryr�rzr8r8r<r{ s�zitemgetter.__repr__cCs|j|jfSr\)rur�rzr8r8r<r|%szitemgetter.__reduce__Nr}r8r8r8r<r 	sc@s4eZdZdZdZdd�Zdd�Zdd�Zd	d
�ZdS)r(z�
    Return a callable object that calls the given method on its operand.
    After f = methodcaller('name'), the call f(r) returns r.name().
    After g = methodcaller('name', 'date', foo=1), the call g(r) returns
    r.name('date', foo=1).
    )�_name�_args�_kwargscOs*||_t|jt�std��||_||_dS)Nzmethod name must be a string)r�rPrhrFr�r�)rkr^�args�kwargsr8r8r<rn1s
zmethodcaller.__init__cCst||j�|j|j�Sr\)r]r�r�r�rpr8r8r<rq8szmethodcaller.__call__cCsTt|j�g}|�tt|j��|�dd�|j��D��d|jj|jj	d�
|�fS)Ncss|]\}}d||fVqdS)z%s=%rNr8)ra�k�vr8r8r<rd>sz(methodcaller.__repr__.<locals>.<genexpr>rsrt)ryr��extendrjr�r�r�rurvrErx)rkr�r8r8r<r{;s�zmethodcaller.__repr__cCsD|js|j|jf|jfSddlm}||j|jf|j�|jfSdS)Nr7)�partial)r�rur�r��	functoolsr�)rkr�r8r8r<r|Cszmethodcaller.__reduce__Nr}r8r8r8r<r((scCs||7}|S)zSame as a += b.r8r9r8r8r<rMscCs||M}|S)zSame as a &= b.r8r9r8r8r<rRscCs,t|d�s dt|�j}t|��||7}|S)z&Same as a += b, for a and b sequences.r@rArBrGr8r8r<rWs

cCs||}|S)zSame as a //= b.r8r9r8r8r<r_scCs||K}|S)zSame as a <<= b.r8r9r8r8r<rdscCs||;}|S)zSame as a %= b.r8r9r8r8r<riscCs||9}|S)zSame as a *= b.r8r9r8r8r<rnscCs||}|S)zSame as a @= b.r8r9r8r8r<rsscCs||O}|S)zSame as a |= b.r8r9r8r8r<rxscCs||C}|S)zSame as a **= b.r8r9r8r8r<r}scCs||L}|S)zSame as a >>= b.r8r9r8r8r<r�scCs||8}|S)zSame as a -= b.r8r9r8r8r<r�scCs||}|S)zSame as a /= b.r8r9r8r8r<r!�scCs||N}|S)zSame as a ^= b.r8r9r8r8r<r"�s)�*)r~N)r7)ir~�__all__�builtinsrr>r&r#r	r+rr
r-r5rrrrr
rrrr%r)r*r'r,r.r/r0r1r3r4r6rrrrrrr2r$rr r(rrrrrrrrrrrrr!r"�	_operator�ImportError�__lt__�__le__�__eq__�__ne__�__ge__�__gt__�__not__�__abs__�__add__�__and__�__floordiv__r?�__inv__�
__invert__�
__lshift__�__mod__�__mul__�
__matmul__�__neg__�__or__�__pos__�__pow__�
__rshift__�__sub__�__truediv__�__xor__�
__concat__�__contains__�__delitem__r@�__setitem__�__iadd__�__iand__�__iconcat__�
__ifloordiv__�__ilshift__�__imod__�__imul__�__imatmul__�__ior__�__ipow__�__irshift__�__isub__�__itruediv__�__ixor__r8r8r8r<�<module>s4�	
)'%__pycache__/smtplib.cpython-38.pyc000064400000105531151153537570013077 0ustar00U

e5dɯ�
@srdZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
mZdddddd	d
ddd
dddg
ZdZdZdZdZdZdZe�dej�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd	�d	e�Z Gdd
�d
e�Z!Gdd�de�Z"Gd d�de�Z#Gd!d
�d
e�Z$d"d�Z%d#d$�Z&d%d�Z'd&d'�Z(d(d)�Z)zddl*Z*Wne+k
�r�d*Z,YnXd+Z,Gd,d�d�Z-e,�r�Gd-d.�d.e-�Z.e�/d.�d/Z0Gd0d1�d1e-�Z1e2d2k�rnd3d4�Z3e3d5�Z4e3d6��5d7�Z6e7d8�d9Z8ej9�:�Z;e;�s*�q6e8e;Z8�qe7d:e<e8��e-d;�Z=e=�>d<�e=�?e4e6e8�e=�@�dS)=aSMTP/ESMTP client class.

This should follow RFC 821 (SMTP), RFC 1869 (ESMTP), RFC 2554 (SMTP
Authentication) and RFC 2487 (Secure SMTP over TLS).

Notes:

Please remember, when doing ESMTP, that the names of the SMTP service
extensions are NOT the same thing as the option keywords for the RCPT
and MAIL commands!

Example:

  >>> import smtplib
  >>> s=smtplib.SMTP("localhost")
  >>> print(s.help())
  This is Sendmail version 8.8.4
  Topics:
      HELO    EHLO    MAIL    RCPT    DATA
      RSET    NOOP    QUIT    HELP    VRFY
      EXPN    VERB    ETRN    DSN
  For more info use "HELP <topic>".
  To report bugs in the implementation send email to
      sendmail-bugs@sendmail.org.
  For local information send email to Postmaster at your site.
  End of HELP info
  >>> s.putcmd("vrfy","someone@here")
  >>> s.getreply()
  (250, "Somebody OverHere <somebody@here.my.org>")
  >>> s.quit()
�N)�body_encode�
SMTPException�SMTPNotSupportedError�SMTPServerDisconnected�SMTPResponseException�SMTPSenderRefused�SMTPRecipientsRefused�
SMTPDataError�SMTPConnectError�
SMTPHeloError�SMTPAuthenticationError�	quoteaddr�	quotedata�SMTP�i��
s
i �z	auth=(.*)c@seZdZdZdS)rz4Base class for all exceptions raised by this module.N��__name__�
__module__�__qualname__�__doc__�rr�/usr/lib64/python3.8/smtplib.pyrHsc@seZdZdZdS)rz�The command or option is not supported by the SMTP server.

    This exception is raised when an attempt is made to run a command or a
    command with an option which is not supported by the server.
    NrrrrrrKsc@seZdZdZdS)rz�Not connected to any SMTP server.

    This exception is raised when the server unexpectedly disconnects,
    or when an attempt is made to use the SMTP instance before
    connecting it to a server.
    NrrrrrrRsc@seZdZdZdd�ZdS)ra2Base class for all exceptions that include an SMTP error code.

    These exceptions are generated in some instances when the SMTP
    server returns an error code.  The error code is stored in the
    `smtp_code' attribute of the error, and the `smtp_error' attribute
    is set to the error message.
    cCs||_||_||f|_dS�N)�	smtp_code�
smtp_error�args)�self�code�msgrrr�__init__cszSMTPResponseException.__init__N�rrrrr!rrrrrZsc@seZdZdZdd�ZdS)rz�Sender address refused.

    In addition to the attributes set by on all SMTPResponseException
    exceptions, this sets `sender' to the string that the SMTP refused.
    cCs"||_||_||_|||f|_dSr)rr�senderr)rrr r#rrrr!oszSMTPSenderRefused.__init__Nr"rrrrrhsc@seZdZdZdd�ZdS)rz�All recipient addresses refused.

    The errors for each recipient are accessible through the attribute
    'recipients', which is a dictionary of exactly the same sort as
    SMTP.sendmail() returns.
    cCs||_|f|_dSr)�
recipientsr)rr$rrrr!}szSMTPRecipientsRefused.__init__Nr"rrrrrusc@seZdZdZdS)r	z'The SMTP server didn't accept the data.Nrrrrrr	�sc@seZdZdZdS)r
z&Error during connection establishment.Nrrrrrr
�sc@seZdZdZdS)rz"The server refused our HELO reply.Nrrrrrr�sc@seZdZdZdS)rzvAuthentication error.

    Most probably the server didn't accept the username/password
    combination provided.
    Nrrrrrr�scCs>tj�|�\}}||fdkr6|���d�r.|Sd|Sd|S)z�Quote a subset of the email addresses defined by RFC 821.

    Should be able to handle anything email.utils.parseaddr can handle.
    ��r&�<z<%s>)�email�utils�	parseaddr�strip�
startswith�Z
addrstringZdisplayname�addrrrrr
�scCs$tj�|�\}}||fdkr |S|S)Nr%)r(r)r*r-rrr�
_addr_only�sr/c	Cst�ddt�dt|��S)z�Quote data for email.

    Double leading '.', and change Unix newline '\n', or Mac '\r' into
    Internet CRLF end-of-line.
    z(?m)^\.z..�(?:\r\n|\n|\r(?!\n))��re�sub�CRLF��datarrrr�s�cCst�dd|�S)Ns(?m)^\.s..)r2r3)Zbindatarrr�_quote_periods�sr7cCst�dt|�S)Nr0r1r5rrr�	_fix_eols�sr8FTc@szeZdZdZdZdZdZdZdZdZ	dZ
eZddde
jdfdd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�ZdNdd�Zdd�ZdOdd�Zdd�ZdPdd�ZdQdd�ZdRdd �Zd!d"�ZdSd#d$�Zd%d&�Zd'd(�Zd)d*�Z dTd,d-�Z!dUd.d/�Z"d0d1�Z#d2d3�Z$e$Z%d4d5�Z&d6d7�Z'd8d9�d:d;�Z(dVd<d=�Z)dWd>d?�Z*dXd@dA�Z+d8d9�dBdC�Z,dYdDdE�Z-dZdFdG�Z.d[dHdI�Z/dJdK�Z0dLdM�Z1dS)\ra�This class manages a connection to an SMTP or ESMTP server.
    SMTP Objects:
        SMTP objects have the following attributes:
            helo_resp
                This is the message given by the server in response to the
                most recent HELO command.

            ehlo_resp
                This is the message given by the server in response to the
                most recent EHLO command. This is usually multiline.

            does_esmtp
                This is a True value _after you do an EHLO command_, if the
                server supports ESMTP.

            esmtp_features
                This is a dictionary, which, if the server supports ESMTP,
                will _after you do an EHLO command_, contain the names of the
                SMTP service extensions this server supports, and their
                parameters (if any).

                Note, all extension names are mapped to lower case in the
                dictionary.

        See each method's docstrings for details.  In general, there is a
        method of the same name to perform each SMTP command.  There is also a
        method called 'sendmail' that will do an entire mail transaction.
        rN�ehlor&c
Cs�||_||_i|_d|_||_d|_|rR|�||�\}}|dkrR|��t||��|dk	rb||_	nPt
��}d|krz||_	n8d}	zt
�t
�
��}	Wnt
jk
r�YnXd|	|_	dS)aInitialize a new instance.

        If specified, `host` is the name of the remote host to which to
        connect.  If specified, `port` specifies the port to which to connect.
        By default, smtplib.SMTP_PORT is used.  If a host is specified the
        connect method is called, and if it returns anything other than a
        success code an SMTPConnectError is raised.  If specified,
        `local_hostname` is used as the FQDN of the local host in the HELO/EHLO
        command.  Otherwise, the local hostname is found using
        socket.getfqdn(). The `source_address` parameter takes a 2-tuple (host,
        port) for the socket to bind to as its source address before
        connecting. If the host is '' and port is 0, the OS default behavior
        will be used.

        �asciir��N�.z	127.0.0.1z[%s])�_host�timeout�esmtp_features�command_encoding�source_address�_auth_challenge_count�connect�closer
�local_hostname�socketZgetfqdnZ
gethostbynameZgethostnameZgaierror)
r�host�portrEr>rArr Zfqdnr.rrrr!�s,
z
SMTP.__init__cCs|Srr�rrrr�	__enter__szSMTP.__enter__cGsNz>z$|�d�\}}|dkr$t||��Wntk
r:YnXW5|��XdS)NZQUIT��)rD�docmdrr)rrr�messagerrr�__exit__s
z
SMTP.__exit__cCs
||_dS)z�Set the debug output level.

        A non-false value results in debug messages for connection and for all
        messages sent to and received from the server.

        N)�
debuglevel)rrOrrr�set_debuglevel"szSMTP.set_debuglevelcGs@|jdkr,ttj����f|�dtji�nt|dtji�dS)N��file)rO�print�datetimeZnow�time�sys�stderr�rrrrr�_print_debug+s
"zSMTP._print_debugcCs2|jdkr|�d||f|j�t�||f||j�S)Nrzconnect: to)rOrYrArF�create_connection)rrGrHr>rrr�_get_socket1s

�zSMTP._get_socket�	localhostcCs�|r
||_|s||�d�|�d�kr||�d�}|dkr||d|�||dd�}}zt|�}Wntk
rztd��YnX|s�|j}t�d|||�|�	|||j
�|_d|_|�
�\}}|jdkr�|�dt|��||fS)apConnect to a host on a given port.

        If the hostname ends with a colon (`:') followed by a number, and
        there is no port specified, that suffix will be stripped off and the
        number interpreted as the port number to use.

        Note: This method is automatically invoked by __init__, if a host is
        specified during instantiation.

        �:rNrQznonnumeric portzsmtplib.connect�connect:)rA�find�rfind�int�
ValueError�OSError�default_portrV�auditr[r>�sockrR�getreplyrOrY�repr)rrGrHrA�irr rrrrC9s&

zSMTP.connectcCs�|jdkr|�dt|��|jr|t|t�r6|�|j�}t�	d||�z|j�
|�Wq�tk
rx|��t
d��Yq�Xnt
d��dS)zSend `s' to the server.rzsend:zsmtplib.send�Server not connectedzplease run connect() firstN)rOrYrhrf�
isinstance�str�encoder@rVreZsendallrcrDr)r�srrr�sendZs

z	SMTP.sendcCsd|dkr|}n|�d|��}d|ks,d|krN|�dd��dd�}td|����|�|�t���dS)	zSend a command to the server.r&� �
�
z\nz\rz=command and arguments contain prohibited newline characters: N)�replacerbror4)r�cmdrrnrrr�putcmdms�zSMTP.putcmdc
CsPg}|jdkr|j�d�|_z|j�td�}Wn:tk
rj}z|��tdt|���W5d}~XYnX|s�|��td��|j	dkr�|�
dt|��t|�tkr�|��t
dd	��|�|d
d��d��|dd�}zt|�}Wn tk
�rd
}Y�q YnX|dd
�dkr�q qd�|�}|j	dk�rH|�
d||f�||fS)a�Get a reply from the server.

        Returns a tuple consisting of:

          - server response code (e.g. '250', or such, if all goes well)
            Note: returns -1 if it can't read response code.

          - server response string corresponding to response code (multiline
            responses are converted to a single, multiline string).

        Raises SMTPServerDisconnected if end-of-file is reached.
        N�rbrQz Connection unexpectedly closed: zConnection unexpectedly closedrzreply:i�zLine too long.�s 	
�����-�
zreply: retcode (%s); Msg: %a)rRrfZmakefile�readline�_MAXLINErcrDrrlrOrYrh�lenr�appendr+rarb�join)r�resp�line�erZerrcode�errmsgrrrrgzs>

�


z
SMTP.getreplycCs|�||�|��S)z-Send a command, and return its response code.�rurg)rrtrrrrrL�sz
SMTP.docmdcCs,|�d|p|j�|��\}}||_||fS)zwSMTP 'helo' command.
        Hostname to send for this command defaults to the FQDN of the local
        host.
        �helo)rurErg�	helo_resp)r�namerr rrrr��sz	SMTP.heloc
CsHi|_|�|j|p|j�|��\}}|dkrJt|�dkrJ|��td��||_|dkr`||fSd|_	t
|jt�s�tt
|j���|j�d��d�}|d=|D]�}t�|�}|r�|j�dd	�d
|�d�d|jd<q�t�d|�}|r�|�d���}|j|�d�d
���}	|dk�r4|j�|d	�d
|	|j|<q�|	|j|<q�||fS)zx SMTP 'ehlo' command.
        Hostname to send for this command defaults to the FQDN of the local
        host.
        ryrrj�rQzlatin-1rr�authr&rpz((?P<feature>[A-Za-z0-9][A-Za-z0-9\-]*) ?�featureN)r?ru�ehlo_msgrErgr~rDr�	ehlo_resp�
does_esmtprk�bytes�AssertionErrorrh�decode�split�
OLDSTYLE_AUTH�match�get�groupsr2�group�lower�string�endr+)
rr�rr r��eachZ
auth_match�mr�Zparamsrrrr9�sD
��

��z	SMTP.ehlocCs|��|jkS)z7Does the server support a given SMTP service extension?)r�r?)r�optrrr�has_extn�sz
SMTP.has_extncCs|�d|�|��dS)z;SMTP 'help' command.
        Returns help text from server.�helprQr�rXrrrr��sz	SMTP.helpcCsd|_|�d�S)z&SMTP 'rset' command -- resets session.r:�rset)r@rLrIrrrr��sz	SMTP.rsetcCs&z|��Wntk
r YnXdS)aInternal 'rset' command which ignores any SMTPServerDisconnected error.

        Used internally in the library, since the server disconnected error
        should appear to the application when the *next* command is issued, if
        we are doing an internal "safety" reset.
        N)r�rrIrrr�_rset�sz
SMTP._rsetcCs
|�d�S)z-SMTP 'noop' command -- doesn't do anything :>�noop)rLrIrrrr�	sz	SMTP.nooprcCshd}|rH|jrHtdd�|D��r:|�d�r2d|_ntd��dd�|�}|�dd	t|�|f�|��S)
a8SMTP 'mail' command -- begins mail xfer session.

        This method may raise the following exceptions:

         SMTPNotSupportedError  The options parameter includes 'SMTPUTF8'
                                but the SMTPUTF8 extension is not supported by
                                the server.
        r&css|]}|��dkVqdS)�smtputf8N)r�)�.0�xrrr�	<genexpr>szSMTP.mail.<locals>.<genexpr>r�zutf-8z SMTPUTF8 not supported by serverrp�mailz	FROM:%s%s)	r��anyr�r@rr�rur
rg)rr#�options�
optionlistrrrr�
s	

�z	SMTP.mailcCs<d}|r|jrdd�|�}|�ddt|�|f�|��S)z;SMTP 'rcpt' command -- indicates 1 recipient for this mail.r&rp�rcptzTO:%s%s)r�r�rur
rg)rZrecipr�r�rrrr�"s

z	SMTP.rcptcCs�|�d�|��\}}|jdkr0|�d||f�|dkrDt||��n|t|t�r\t|��d�}t	|�}|dd�t
kr||t
}|dt
}|�|�|��\}}|jdkr�|�d||f�||fSdS)	a�SMTP 'DATA' command -- sends message data to server.

        Automatically quotes lines beginning with a period per rfc821.
        Raises SMTPDataError if there is an unexpected reply to the
        DATA command; the return value from this method is the final
        response code received when the all data is sent.  If msg
        is a string, lone '\r' and '\n' characters are converted to
        '\r\n' characters.  If msg is bytes, it is transmitted as is.
        r6rzdata:ibr:���N�.)rurgrOrYr	rkrlr8rmr7�bCRLFro)rr r�repl�qrrrr6*s"





z	SMTP.datacCs|�dt|��|��S)z5SMTP 'verify' command -- checks for address validity.�vrfy�rur/rg�rZaddressrrr�verifyGszSMTP.verifycCs|�dt|��|��S)z.SMTP 'expn' command -- expands a mailing list.�expnr�r�rrrr�Nsz	SMTP.expncCsb|jdkr^|jdkr^d|��dkr0dks^n|��\}}d|krRdks^nt||��dS)abCall self.ehlo() and/or self.helo() if needed.

        If there has been no previous EHLO or HELO command this session, this
        method tries ESMTP EHLO first.

        This method may raise the following exceptions:

         SMTPHeloError            The server didn't reply properly to
                                  the helo greeting.
        N��ri+)r�r�r9r�r)rrr�rrr�ehlo_or_helo_if_neededUs
zSMTP.ehlo_or_helo_if_neededT��initial_response_okc	Cs�|��}|r|�nd}|dk	rPt|�d�dd�}|�d|d|�\}}d|_n|�d|�\}}d|_|d	kr�|jd7_t�|�}t||��d�dd�}|�|�\}}|jtkrftd
t	||f���qf|dkr�||fSt
||��dS)a�Authentication command - requires response processing.

        'mechanism' specifies which authentication mechanism is to
        be used - the valid values are those listed in the 'auth'
        element of 'esmtp_features'.

        'authobject' must be a callable object taking a single argument:

                data = authobject(challenge)

        It will be called to process the server's challenge response; the
        challenge argument it is passed will be a bytes.  It should return
        an ASCII string that will be base64 encoded and sent to the server.

        Keyword arguments:
            - initial_response_ok: Allow sending the RFC 4954 initial-response
              to the AUTH command, if the authentication methods supports it.
        Nr:r&)ZeolZAUTHrprQriNz4Server AUTH mechanism infinite loop. Last response: ���i�)�upper�
encode_base64rmrLrB�base64Zdecodebytes�
_MAXCHALLENGErrhr)	rZ	mechanismZ
authobjectr�Zinitial_responseZresponserr��	challengerrrr�fs2
�

��z	SMTP.authcCs0|dkrdS|jdt�|j�d�|d���S)zh Authobject to use with CRAM-MD5 authentication. Requires self.user
        and self.password to be set.Nrpr:Zmd5)�user�hmacZHMAC�passwordrmZ	hexdigest�rr�rrr�
auth_cram_md5�s
�zSMTP.auth_cram_md5cCsd|j|jfS)ze Authobject to use with PLAIN authentication. Requires self.user and
        self.password to be set.z%s%s)r�r�r�rrr�
auth_plain�szSMTP.auth_plaincCs"|dks|jdkr|jS|jSdS)ze Authobject to use with LOGIN authentication. Requires self.user and
        self.password to be set.N�)rBr�r�r�rrr�
auth_login�szSMTP.auth_logincs�|��|�d�std��|jd���dddg}�fdd�|D�}|sPtd��|||_|_|D]t}d	|���	d
d�}z4|j
|t||�|d�\}}	|d
kr�||	fWSWqbtk
r�}
z|
}W5d}
~
XYqbXqb|�dS)awLog in on an SMTP server that requires authentication.

        The arguments are:
            - user:         The user name to authenticate with.
            - password:     The password for the authentication.

        Keyword arguments:
            - initial_response_ok: Allow sending the RFC 4954 initial-response
              to the AUTH command, if the authentication methods supports it.

        If there has been no previous EHLO or HELO command this session, this
        method tries ESMTP EHLO first.

        This method will return normally if the authentication was successful.

        This method may raise the following exceptions:

         SMTPHeloError            The server didn't reply properly to
                                  the helo greeting.
         SMTPAuthenticationError  The server didn't accept the username/
                                  password combination.
         SMTPNotSupportedError    The AUTH command is not supported by the
                                  server.
         SMTPException            No suitable authentication method was
                                  found.
        r�z,SMTP AUTH extension not supported by server.zCRAM-MD5ZPLAINZLOGINcsg|]}|�kr|�qSrr)r�r��Zadvertised_authlistrr�
<listcomp>�s�zSMTP.login.<locals>.<listcomp>z(No suitable authentication method found.Zauth_�-�_r�r�N)
r�r�rr?r�rr�r�r�rsr��getattrr)rr�r�r�Zpreferred_authsZauthlistZ
authmethodZmethod_namerr�r�Zlast_exceptionrr�r�login�s0
�
�
z
SMTP.logincCs�|��|�d�std��|�d�\}}|dkr�ts<td��|dk	rT|dk	rTtd��|dk	rl|dk	rltd��|dk	s||dk	r�d	dl}|�d
t	d�|dkr�t
j||d�}|j|j
|jd
�|_
d|_d|_d|_i|_d	|_n
t||��||fS)a�Puts the connection to the SMTP server into TLS mode.

        If there has been no previous EHLO or HELO command this session, this
        method tries ESMTP EHLO first.

        If the server supports TLS, this will encrypt the rest of the SMTP
        session. If you provide the keyfile and certfile parameters,
        the identity of the SMTP server and client can be checked. This,
        however, depends on whether the socket module really checks the
        certificates.

        This method may raise the following exceptions:

         SMTPHeloError            The server didn't reply properly to
                                  the helo greeting.
        �starttlsz+STARTTLS extension not supported by server.ZSTARTTLSr;z&No SSL support included in this PythonN�4context and keyfile arguments are mutually exclusive�5context and certfile arguments are mutually exclusiver�Akeyfile and certfile are deprecated, use a custom context insteadr���certfile�keyfile�Zserver_hostname)r�r�rrL�	_have_ssl�RuntimeErrorrb�warnings�warn�DeprecationWarning�ssl�_create_stdlib_context�wrap_socketrfr=rRr�r�r?r�r)rr�r��contextr�Zreplyr�rrrr��sB
����
z
SMTP.starttlscCs^|��g}t|t�r$t|��d�}|jrZ|�d�rF|�dt|��|D]}|�|�qJ|�	||�\}}	|dkr�|dkr�|�
�n|��t||	|��i}
t|t�r�|g}|D]H}|�
||�\}}	|dkr�|dkr�||	f|
|<|dkr�|�
�t|
��q�t|
�t|�k�r|��t|
��|�|�\}}	|dk�rZ|dk�rH|�
�n|��t||	��|
S)a|This command performs an entire mail transaction.

        The arguments are:
            - from_addr    : The address sending this mail.
            - to_addrs     : A list of addresses to send this mail to.  A bare
                             string will be treated as a list with 1 address.
            - msg          : The message to send.
            - mail_options : List of ESMTP options (such as 8bitmime) for the
                             mail command.
            - rcpt_options : List of ESMTP options (such as DSN commands) for
                             all the rcpt commands.

        msg may be a string containing characters in the ASCII range, or a byte
        string.  A string is encoded to bytes using the ascii codec, and lone
        \r and \n characters are converted to \r\n characters.

        If there has been no previous EHLO or HELO command this session, this
        method tries ESMTP EHLO first.  If the server does ESMTP, message size
        and each of the specified options will be passed to it.  If EHLO
        fails, HELO will be tried and ESMTP options suppressed.

        This method will return normally if the mail is accepted for at least
        one recipient.  It returns a dictionary, with one entry for each
        recipient that was refused.  Each entry contains a tuple of the SMTP
        error code and the accompanying error message sent by the server.

        This method may raise the following exceptions:

         SMTPHeloError          The server didn't reply properly to
                                the helo greeting.
         SMTPRecipientsRefused  The server rejected ALL recipients
                                (no mail was sent).
         SMTPSenderRefused      The server didn't accept the from_addr.
         SMTPDataError          The server replied with an unexpected
                                error code (other than a refusal of
                                a recipient).
         SMTPNotSupportedError  The mail_options parameter includes 'SMTPUTF8'
                                but the SMTPUTF8 extension is not supported by
                                the server.

        Note: the connection will be open even after an exception is raised.

        Example:

         >>> import smtplib
         >>> s=smtplib.SMTP("localhost")
         >>> tolist=["one@one.org","two@two.org","three@three.org","four@four.org"]
         >>> msg = '''\
         ... From: Me@my.org
         ... Subject: testin'...
         ...
         ... This is a test '''
         >>> s.sendmail("me@my.org",tolist,msg)
         { "three@three.org" : ( 550 ,"User unknown" ) }
         >>> s.quit()

        In the above example, the message was accepted for delivery to three
        of the four addresses, and one was rejected, with the error code
        550.  If all addresses are accepted, then the method will return an
        empty dictionary.

        r:�sizezsize=%dr�i��)r�rkrlr8rmr�r�rr~r�rDr�rr�rr6r	)r�	from_addr�to_addrsr �mail_options�rcpt_optionsZ
esmtp_optsZoptionrr�Zsenderrsr�rrr�sendmail&sF@








z
SMTP.sendmailc	Cs�|��|�d�}|dkr d}nt|�dkr2d}ntd��|dkr||d|krZ||dn
||d}tj�|g�d	d}|dkr�d
d�||d||d
||dfD�}dd�tj�|�D�}t�|�}	|	d
=|	d=d}
zd�|f|���	d�Wn.t
k
�r(|�d��s td��d}
YnXt
���R}|
�r^tjj||jjdd�d�}|d�}ntj�|�}|j|	dd�|��}
W5QRX|�|||
||�S)a~Converts message to a bytestring and passes it to sendmail.

        The arguments are as for sendmail, except that msg is an
        email.message.Message object.  If from_addr is None or to_addrs is
        None, these arguments are taken from the headers of the Message as
        described in RFC 2822 (a ValueError is raised if there is more than
        one set of 'Resent-' headers).  Regardless of the values of from_addr and
        to_addr, any Bcc field (or Resent-Bcc field, when the Message is a
        resent) of the Message object won't be transmitted.  The Message
        object is then serialized using email.generator.BytesGenerator and
        sendmail is called to transmit the message.  If the sender or any of
        the recipient addresses contain non-ASCII and the server advertises the
        SMTPUTF8 capability, the policy is cloned with utf8 set to True for the
        serialization, and SMTPUTF8 and BODY=8BITMIME are asserted on the send.
        If the server does not support SMTPUTF8, an SMTPNotSupported error is
        raised.  Otherwise the generator is called without modifying the
        policy.

        zResent-DateNr&rQzResent-z0message has more than one 'Resent-' header blockZSender�FromrcSsg|]}|dk	r|�qSrr)r��frrrr��s�z%SMTP.send_message.<locals>.<listcomp>�ToZBccZCccSsg|]}|d�qS)rQr)r��arrrr��sz
Resent-BccFr:r�z�One or more source or delivery addresses require internationalized email support, but the server does not advertise the required SMTPUTF8 capabilityT)�utf8)�policy�SMTPUTF8�
BODY=8BITMIMEr)�linesep)r�r�)r�Zget_allr~rbr(r)Zgetaddresses�copyr�rm�UnicodeEncodeErrorr�r�io�BytesIO�	generatorZBytesGeneratorr�ZcloneZflatten�getvaluer�)rr r�r�r�r�ZresentZ
header_prefixZaddr_fieldsZmsg_copyZ
internationalZbytesmsg�gZflatmsgrrr�send_message�sX

�
�

�
�

�
�zSMTP.send_messagecCs<z|j}d|_|r|��W5|j}d|_|r6|��XdS)z(Close the connection to the SMTP server.N)rfrDrR)rrfrRrrrrD�sz
SMTP.closecCs.|�d�}d|_|_i|_d|_|��|S)zTerminate the SMTP session.�quitNF)rLr�r�r?r�rD)r�resrrrr��s
z	SMTP.quit)r\rN)r&)r&)r&)r&)r&)r)r)N)N)N)NNN)rr)NNrr)2rrrrrOrfrRr�r�r�r��	SMTP_PORTrdrF�_GLOBAL_DEFAULT_TIMEOUTr!rJrNrPrYr[rCrorurgrLr�r9r�r�r�r�r�r�r�r6r�r�r�r�r�r�r�r�r�r�r�r�rDr�rrrrr�sh�
0
	
!

1



3


0
	

B
8�
h�
M
c@s8eZdZdZeZdddddejddfdd�Zdd�Z	dS)	�SMTP_SSLa� This is a subclass derived from SMTP that connects over an SSL
        encrypted socket (to use this class you need a socket module that was
        compiled with SSL support). If host is not specified, '' (the local
        host) is used. If port is omitted, the standard SMTP-over-SSL port
        (465) is used.  local_hostname and source_address have the same meaning
        as they do in the SMTP class.  keyfile and certfile are also optional -
        they can contain a PEM formatted private key and certificate chain file
        for the SSL connection. context also optional, can contain a
        SSLContext, and is an alternative to keyfile and certfile; If it is
        specified both keyfile and certfile must be None.

        r&rNc	
Cs�|dk	r|dk	rtd��|dk	r0|dk	r0td��|dk	s@|dk	rVddl}	|	�dtd�||_||_|dkrxtj||d�}||_t	�
||||||�dS)Nr�r�rr�r�r�)rbr�r�r�r�r�r�r�r�rr!)
rrGrHrEr�r�r>rAr�r�rrrr!s(���zSMTP_SSL.__init__cCsD|jdkr|�d||f�t�||f||j�}|jj||jd�}|S)Nrr^r�)rOrYrFrZrAr�r�r=)rrGrHr>Z
new_socketrrrr[s
��zSMTP_SSL._get_socket)
rrrr�
SMTP_SSL_PORTrdrFr�r!r[rrrrr��s
�
r�i�c@s0eZdZdZdZdeddfdd�Zdd	d
�ZdS)�LMTPa�LMTP - Local Mail Transfer Protocol

    The LMTP protocol, which is very similar to ESMTP, is heavily based
    on the standard SMTP client. It's common to use Unix sockets for
    LMTP, so our connect() method must support that as well as a regular
    host:port server.  local_hostname and source_address have the same
    meaning as they do in the SMTP class.  To specify a Unix socket,
    you must use an absolute path as the host, starting with a '/'.

    Authentication is supported, using the regular SMTP mechanism. When
    using a Unix socket, LMTP generally don't support or require any
    authentication, but your mileage might vary.Zlhlor&NcCstj|||||d�dS)zInitialize a new instance.)rErAN)rr!)rrGrHrErArrrr!;s�z
LMTP.__init__r\rcCs�|ddkrtj||||d�Sz(t�tjtj�|_d|_|j�|�WnBtk
r�|jdkrl|�	d|�|jr||j�
�d|_�YnX|��\}}|jdkr�|�	d|�||fS)z=Connect to the LMTP daemon, on either a Unix or a TCP socket.r�/)rANz
connect fail:r^)rrCrFZAF_UNIXZSOCK_STREAMrfrRrcrOrYrDrg)rrGrHrArr rrrrCAs"


zLMTP.connect)r\rN)rrrrr��	LMTP_PORTr!rCrrrrr�+s
�
r��__main__cCs(tj�|d�tj��tj����S)Nz: )rV�stdout�write�flush�stdinr|r+)�promptrrrr[s
rr�r��,zEnter message, end with ^D:r&zMessage length is %dr\rQ)ArrFr�r2Zemail.utilsr(Z
email.messageZemail.generatorr�r�r�rTrVZemail.base64mimerr��__all__r�r�r4r�r}r��compile�Ir�rcrrrrrrr	r
rrr
r/rr7r8r��ImportErrorr�rr�rrr�rrZfromaddrr�ZtoaddrsrSr rr|r�r~ZserverrPr�r�rrrr�<module>s�)�


	
:0
/


__pycache__/ipaddress.cpython-38.opt-1.pyc000064400000165113151153537570014344 0ustar00U

e5d��@s�dZdZddlZdZdZGdd�de�ZGdd	�d	e�Zd
d�Zd=d
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�ZGd#d$�d$�ZejGd%d&�d&e��ZejGd'd(�d(e��ZGd)d*�d*�ZGd+d,�d,ee�ZGd-d.�d.e�ZGd/d0�d0ee�ZGd1d2�d2�Zee_Gd3d4�d4�ZGd5d6�d6ee�ZGd7d8�d8e�Z Gd9d:�d:ee�Z!Gd;d<�d<�Z"e"e_dS)>z�A fast, lightweight IPv4/IPv6 manipulation library in Python.

This library is used to create/poke/manipulate IPv4 and IPv6 addresses
and networks.

z1.0�N� �c@seZdZdZdS)�AddressValueErrorz%A Value Error related to the address.N��__name__�
__module__�__qualname__�__doc__�r
r
�!/usr/lib64/python3.8/ipaddress.pyrsrc@seZdZdZdS)�NetmaskValueErrorz%A Value Error related to the netmask.Nrr
r
r
rrsrc	CsXz
t|�WSttfk
r"YnXz
t|�WSttfk
rFYnXtd|��dS)a�Take an IP string/int and return an object of the correct type.

    Args:
        address: A string or integer, the IP address.  Either IPv4 or
          IPv6 addresses may be supplied; integers less than 2**32 will
          be considered to be IPv4 by default.

    Returns:
        An IPv4Address or IPv6Address object.

    Raises:
        ValueError: if the *address* passed isn't either a v4 or a v6
          address

    z0%r does not appear to be an IPv4 or IPv6 addressN)�IPv4Addressrr�IPv6Address�
ValueError��addressr
r
r�
ip_addresss

�rTc	Cs\zt||�WSttfk
r$YnXzt||�WSttfk
rJYnXtd|��dS)a�Take an IP string/int and return an object of the correct type.

    Args:
        address: A string or integer, the IP network.  Either IPv4 or
          IPv6 networks may be supplied; integers less than 2**32 will
          be considered to be IPv4 by default.

    Returns:
        An IPv4Network or IPv6Network object.

    Raises:
        ValueError: if the string passed isn't either a v4 or a v6
          address. Or if the network has host bits set.

    z0%r does not appear to be an IPv4 or IPv6 networkN)�IPv4Networkrr�IPv6Networkr)r�strictr
r
r�
ip_network9s�rc	CsXz
t|�WSttfk
r"YnXz
t|�WSttfk
rFYnXtd|��dS)agTake an IP string/int and return an object of the correct type.

    Args:
        address: A string or integer, the IP address.  Either IPv4 or
          IPv6 addresses may be supplied; integers less than 2**32 will
          be considered to be IPv4 by default.

    Returns:
        An IPv4Interface or IPv6Interface object.

    Raises:
        ValueError: if the string passed isn't either a v4 or a v6
          address.

    Notes:
        The IPv?Interface classes describe an Address on a particular
        Network, so they're basically a combination of both the Address
        and Network classes.

    z2%r does not appear to be an IPv4 or IPv6 interfaceN)�
IPv4Interfacerr�
IPv6Interfacerrr
r
r�ip_interfaceWs

�rcCs0z|�dd�WStk
r*td��YnXdS)a`Represent an address as 4 packed bytes in network (big-endian) order.

    Args:
        address: An integer representation of an IPv4 IP address.

    Returns:
        The integer address packed as 4 bytes in network (big-endian) order.

    Raises:
        ValueError: If the integer is negative or too large to be an
          IPv4 IP address.

    ��bigz&Address negative or too large for IPv4N��to_bytes�
OverflowErrorrrr
r
r�v4_int_to_packedzsrcCs0z|�dd�WStk
r*td��YnXdS)z�Represent an address as 16 packed bytes in network (big-endian) order.

    Args:
        address: An integer representation of an IPv6 IP address.

    Returns:
        The integer address packed as 16 bytes in network (big-endian) order.

    �rz&Address negative or too large for IPv6Nrrr
r
r�v6_int_to_packed�s
r!cCs*t|��d�}t|�dkr&td|��|S)zAHelper to split the netmask and raise AddressValueError if needed�/�zOnly one '/' permitted in %r)�str�split�lenr)r�addrr
r
r�_split_optional_netmask�sr(ccsNt|�}t|�}}|D]&}|j|jdkr:||fV|}|}q||fVdS)z�Find a sequence of sorted deduplicated IPv#Address.

    Args:
        addresses: a list of IPv#Address objects.

    Yields:
        A tuple containing the first and last IP addresses in the sequence.

    �N)�iter�next�_ip)�	addresses�it�first�last�ipr
r
r�_find_address_range�s

r2cCs$|dkr|St|||d@���S)z�Count the number of zero bits on the right hand side.

    Args:
        number: an integer.
        bits: maximum number of bits to count.

    Returns:
        The number of zero bits on the right hand side of the number.

    rr))�min�
bit_length)Znumber�bitsr
r
r�_count_righthand_zero_bits�sr6ccs�t|t�rt|t�std��|j|jkr8td||f��||krHtd��|jdkrXt}n|jdkrht}ntd��|j}|j}|j}||kr�t	t
||�||d��d�}||||f�}|V|d|>7}|d|jkr�q�q�dS)	a�Summarize a network range given the first and last IP addresses.

    Example:
        >>> list(summarize_address_range(IPv4Address('192.0.2.0'),
        ...                              IPv4Address('192.0.2.130')))
        ...                                #doctest: +NORMALIZE_WHITESPACE
        [IPv4Network('192.0.2.0/25'), IPv4Network('192.0.2.128/31'),
         IPv4Network('192.0.2.130/32')]

    Args:
        first: the first IPv4Address or IPv6Address in the range.
        last: the last IPv4Address or IPv6Address in the range.

    Returns:
        An iterator of the summarized IPv(4|6) network objects.

    Raise:
        TypeError:
            If the first and last objects are not IP addresses.
            If the first and last objects are not the same version.
        ValueError:
            If the last object is not greater than the first.
            If the version of the first address is not 4 or 6.

    z1first and last must be IP addresses, not networks�%%s and %s are not of the same versionz*last IP address must be greater than firstr�zunknown IP versionr)N)
�
isinstance�_BaseAddress�	TypeError�versionrrr�_max_prefixlenr,r3r6r4�	_ALL_ONES)r/r0r1Zip_bitsZ	first_intZlast_intZnbits�netr
r
r�summarize_address_range�s8
��


�r@ccs�t|�}i}|rV|��}|��}|�|�}|dkr<|||<q||kr||=|�|�qd}t|���D]$}|dk	r�|j|jkr�qf|V|}qfdS)auLoops through the addresses, collapsing concurrent netblocks.

    Example:

        ip1 = IPv4Network('192.0.2.0/26')
        ip2 = IPv4Network('192.0.2.64/26')
        ip3 = IPv4Network('192.0.2.128/26')
        ip4 = IPv4Network('192.0.2.192/26')

        _collapse_addresses_internal([ip1, ip2, ip3, ip4]) ->
          [IPv4Network('192.0.2.0/24')]

        This shouldn't be called directly; it is called via
          collapse_addresses([]).

    Args:
        addresses: A list of IPv4Network's or IPv6Network's

    Returns:
        A list of IPv4Network's or IPv6Network's depending on what we were
        passed.

    N)�list�pop�supernet�get�append�sorted�values�broadcast_address)r-Zto_merge�subnetsr?rCZexistingr0r
r
r�_collapse_addresses_internals$

rJc	Cs0g}g}g}|D]�}t|t�rR|rF|dj|jkrFtd||df��|�|�q|j|jkr�|r�|dj|jkr�td||df��z|�|j�Wq�tk
r�|�|j	�Yq�Xq|r�|dj|jkr�td||df��|�|�qt
t|��}|�r$t|�D]\}}|�
t||���qt||�S)a�Collapse a list of IP objects.

    Example:
        collapse_addresses([IPv4Network('192.0.2.0/25'),
                            IPv4Network('192.0.2.128/25')]) ->
                           [IPv4Network('192.0.2.0/24')]

    Args:
        addresses: An iterator of IPv4Network or IPv6Network objects.

    Returns:
        An iterator of the collapsed IPv(4|6)Network objects.

    Raises:
        TypeError: If passed a list of mixed version objects.

    ���r7)r9r:�_versionr;rE�
_prefixlenr=r1�AttributeError�network_addressrF�setr2�extendr@rJ)r-ZaddrsZipsZnetsr1r/r0r
r
r�collapse_addresses2s@
���rRcCs(t|t�r|��St|t�r$|��StS)a2Return a key suitable for sorting between networks and addresses.

    Address and Network objects are not sortable by default; they're
    fundamentally different so the expression

        IPv4Address('192.0.2.0') <= IPv4Network('192.0.2.0/24')

    doesn't make any sense.  There are some times however, where you may wish
    to have ipaddress sort these for you anyway. If you need to do this, you
    can use this function as the key= argument to sorted().

    Args:
      obj: either a Network or Address object.
    Returns:
      appropriate key.

    )r9�_BaseNetwork�_get_networks_keyr:�_get_address_key�NotImplemented)�objr
r
r�get_mixed_type_keyhs


rXc@s�eZdZdZdZedd��Zedd��Zedd��Zed	d
��Z	dd�Z
d
d�Zedd��Z
edd��Zedd��Zedd��Zedd��Zedd��Zdd�ZdS)�_IPAddressBasezThe mother class.r
cCs|��S)z:Return the longhand version of the IP address as a string.)�_explode_shorthand_ip_string��selfr
r
r�exploded�sz_IPAddressBase.explodedcCst|�S)z;Return the shorthand version of the IP address as a string.�r$r[r
r
r�
compressed�sz_IPAddressBase.compressedcCs|��S)aIThe name of the reverse DNS pointer for the IP address, e.g.:
            >>> ipaddress.ip_address("127.0.0.1").reverse_pointer
            '1.0.0.127.in-addr.arpa'
            >>> ipaddress.ip_address("2001:db8::1").reverse_pointer
            '1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa'

        )�_reverse_pointerr[r
r
r�reverse_pointer�s	z_IPAddressBase.reverse_pointercCsdt|�f}t|��dS)Nz%200s has no version specified��type�NotImplementedError�r\�msgr
r
rr<�sz_IPAddressBase.versioncCsF|dkrd}t|||jf��||jkrBd}t|||j|jf��dS)Nrz-%d (< 0) is not permitted as an IPv%d addressz2%d (>= 2**%d) is not permitted as an IPv%d address)rrLr>r=)r\rrfr
r
r�_check_int_address�s

�z!_IPAddressBase._check_int_addresscCs.t|�}||kr*d}t|||||jf��dS)Nz6%r (len %d != %d) is not permitted as an IPv%d address)r&rrL)r\rZexpected_lenZaddress_lenrfr
r
r�_check_packed_address�s�z$_IPAddressBase._check_packed_addresscCs|j|j|?AS)z�Turn the prefix length into a bitwise netmask

        Args:
            prefixlen: An integer, the prefix length.

        Returns:
            An integer.

        )r>)�cls�	prefixlenr
r
r�_ip_int_from_prefix�sz"_IPAddressBase._ip_int_from_prefixc	Cs\t||j�}|j|}||?}d|>d}||krX|jd}|�|d�}d}t||��|S)aReturn prefix length from the bitwise netmask.

        Args:
            ip_int: An integer, the netmask in expanded bitwise format

        Returns:
            An integer, the prefix length.

        Raises:
            ValueError: If the input intermingles zeroes & ones
        r)�rz&Netmask pattern %r mixes zeroes & ones)r6r=rr)	ri�ip_intZtrailing_zeroesrjZleading_onesZall_onesZbyteslenZdetailsrfr
r
r�_prefix_from_ip_int�s
�

z"_IPAddressBase._prefix_from_ip_intcCsd|}t|�d�dS)Nz%r is not a valid netmask)r)riZnetmask_strrfr
r
r�_report_invalid_netmask�sz&_IPAddressBase._report_invalid_netmaskcCsl|��r|��s|�|�zt|�}Wntk
rD|�|�YnXd|kr\|jkshn|�|�|S)a	Return prefix length from a numeric string

        Args:
            prefixlen_str: The string to be converted

        Returns:
            An integer, the prefix length.

        Raises:
            NetmaskValueError: If the input is not a valid netmask
        r)�isascii�isdigitro�intrr=)riZ
prefixlen_strrjr
r
r�_prefix_from_prefix_string�s

z)_IPAddressBase._prefix_from_prefix_stringcCs�z|�|�}Wntk
r,|�|�YnXz|�|�WStk
rNYnX||jN}z|�|�WStk
r�|�|�YnXdS)aTurn a netmask/hostmask string into a prefix length

        Args:
            ip_str: The netmask/hostmask to be converted

        Returns:
            An integer, the prefix length.

        Raises:
            NetmaskValueError: If the input is not a valid netmask/hostmask
        N)�_ip_int_from_stringrrornrr>)ri�ip_strrmr
r
r�_prefix_from_ip_string�s
z%_IPAddressBase._prefix_from_ip_stringcCsHt|ttf�r||jfSt|t�s*t|�}t|�dkr:|S|d|jfS)z�Helper function to parse address of Network/Interface.

        Arg:
            address: Argument of Network/Interface.

        Returns:
            (addr, prefix) tuple.
        r)r)r9�bytesrrr=�tupler(r&)rirr
r
r�_split_addr_prefixs

z!_IPAddressBase._split_addr_prefixcCs|jt|�ffS�N)�	__class__r$r[r
r
r�
__reduce__/sz_IPAddressBase.__reduce__N)rrrr	�	__slots__�propertyr]r_rar<rgrh�classmethodrkrnrorsrvryr|r
r
r
rrY�s2




	




!
rYc@sdeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�ZdS)r:z�A generic IP object.

    This IP class contains the version independent methods which are
    used by single IP addresses.
    r
cCs|jSrz�r,r[r
r
r�__int__>sz_BaseAddress.__int__cCs8z|j|jko|j|jkWStk
r2tYSXdSrz)r,rLrNrV�r\�otherr
r
r�__eq__As
�z_BaseAddress.__eq__cCsFt|t�stS|j|jkr*td||f��|j|jkrB|j|jkSdS�Nr7F)r9r:rVrLr;r,r�r
r
r�__lt__Hs
�z_BaseAddress.__lt__cCs t|t�stS|�t|�|�Srz�r9rrrVr{r�r
r
r�__add__Ts
z_BaseAddress.__add__cCs t|t�stS|�t|�|�Srzr�r�r
r
r�__sub__Ys
z_BaseAddress.__sub__cCsd|jjt|�fS�Nz%s(%r)�r{rr$r[r
r
r�__repr__^sz_BaseAddress.__repr__cCst|�|j��Srz)r$�_string_from_ip_intr,r[r
r
r�__str__asz_BaseAddress.__str__cCsttt|j���Srz)�hash�hexrrr,r[r
r
r�__hash__dsz_BaseAddress.__hash__cCs
|j|fSrz�rLr[r
r
rrUgsz_BaseAddress._get_address_keycCs|j|jffSrz)r{r,r[r
r
rr|jsz_BaseAddress.__reduce__N)rrrr	r}r�r�r�r�r�r�r�r�rUr|r
r
r
rr:3sr:c@s`eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
ejdd��Zejdd��Zedd��Zedd��Zedd��Zed d!��Zed"d#��Zed$d%��Zd&d'�Zd(d)�Zd*d+�ZdFd.d/�ZdGd0d1�Zed2d3��Zed4d5��Z d6d7�Z!d8d9�Z"ed:d;��Z#ed<d=��Z$ed>d?��Z%ed@dA��Z&edBdC��Z'edDdE��Z(d-S)HrSz}A generic IP network object.

    This IP class contains the version independent methods which are
    used by networks.
    cCsd|jjt|�fSr�r�r[r
r
rr�vsz_BaseNetwork.__repr__cCsd|j|jfS�N�%s/%d)rOrjr[r
r
rr�ysz_BaseNetwork.__str__ccs8t|j�}t|j�}t|d|�D]}|�|�Vq"dS)z�Generate Iterator over usable hosts in a network.

        This is like __iter__ except it doesn't return the network
        or broadcast addresses.

        r)N�rrrOrH�range�_address_class�r\�network�	broadcast�xr
r
r�hosts|s

z_BaseNetwork.hostsccs8t|j�}t|j�}t||d�D]}|�|�Vq"dS�Nr)r�r�r
r
r�__iter__�s

z_BaseNetwork.__iter__cCslt|j�}t|j�}|dkr>|||kr0td��|�||�S|d7}|||krZtd��|�||�SdS)Nrzaddress out of ranger))rrrOrH�
IndexErrorr�)r\�nr�r�r
r
r�__getitem__�s

z_BaseNetwork.__getitem__cCs^t|t�stS|j|jkr*td||f��|j|jkrB|j|jkS|j|jkrZ|j|jkSdSr�)r9rSrVrLr;rO�netmaskr�r
r
rr��s
�z_BaseNetwork.__lt__cCsLz.|j|jko,|j|jko,t|j�t|j�kWStk
rFtYSXdSrz)rLrOrrr�rNrVr�r
r
rr��s
��z_BaseNetwork.__eq__cCstt|j�t|j�A�Srz)r�rrrOr�r[r
r
rr��sz_BaseNetwork.__hash__cCs8|j|jkrdSt|t�rdS|j|jj@|jjkSdS�NF)rLr9rSr,r�rOr�r
r
r�__contains__�s

z_BaseNetwork.__contains__cCs(|j|kp&|j|kp&|j|kp&|j|kS)z*Tell if self is partly contained in other.)rOrHr�r
r
r�overlaps�s



�z_BaseNetwork.overlapscCs|�t|j�t|j�B�Srz)r�rrrO�hostmaskr[r
r
rrH�s�z_BaseNetwork.broadcast_addresscCs|�t|j�|jA�Srz)r�rrr�r>r[r
r
rr��sz_BaseNetwork.hostmaskcCsd|j|jfSr�)rOrMr[r
r
r�with_prefixlen�sz_BaseNetwork.with_prefixlencCsd|j|jfS�N�%s/%s)rOr�r[r
r
r�with_netmask�sz_BaseNetwork.with_netmaskcCsd|j|jfSr�)rOr�r[r
r
r�
with_hostmask�sz_BaseNetwork.with_hostmaskcCst|j�t|j�dS)z&Number of hosts in the current subnet.r))rrrHrOr[r
r
r�
num_addresses�sz_BaseNetwork.num_addressescCsdt|�f}t|��dS)Nz%%200s has no associated address classrbrer
r
rr��sz_BaseNetwork._address_classcCs|jSrz)rMr[r
r
rrj�sz_BaseNetwork.prefixlenccs|j|jkstd||f��t|t�s2td|��|�|�sLtd||f��||krXdS|�d|j|jf�}|�	�\}}||kr�||kr�|�|�r�|V|�	�\}}qz|�|�r�|V|�	�\}}qzt
d|||f��qz||kr�|Vn"||kr�|Vnt
d|||f��dS)a�Remove an address from a larger block.

        For example:

            addr1 = ip_network('192.0.2.0/28')
            addr2 = ip_network('192.0.2.1/32')
            list(addr1.address_exclude(addr2)) =
                [IPv4Network('192.0.2.0/32'), IPv4Network('192.0.2.2/31'),
                 IPv4Network('192.0.2.4/30'), IPv4Network('192.0.2.8/29')]

        or IPv6:

            addr1 = ip_network('2001:db8::1/32')
            addr2 = ip_network('2001:db8::1/128')
            list(addr1.address_exclude(addr2)) =
                [ip_network('2001:db8::1/128'),
                 ip_network('2001:db8::2/127'),
                 ip_network('2001:db8::4/126'),
                 ip_network('2001:db8::8/125'),
                 ...
                 ip_network('2001:db8:8000::/33')]

        Args:
            other: An IPv4Network or IPv6Network object of the same type.

        Returns:
            An iterator of the IPv(4|6)Network objects which is self
            minus other.

        Raises:
            TypeError: If self and other are of differing address
              versions, or if other is not a network object.
            ValueError: If other is not completely contained by self.

        r7z%s is not a network objectz%s not contained in %sNr�z3Error performing exclusion: s1: %s s2: %s other: %s)rLr;r9rS�	subnet_ofrr{rOrjrI�AssertionError)r\r��s1�s2r
r
r�address_exclude�s@$�


�

��z_BaseNetwork.address_excludecCs`|j|jkrtd||f��|j|jkr,dS|j|jkr<dS|j|jkrLdS|j|jkr\dSdS)a�Compare two IP objects.

        This is only concerned about the comparison of the integer
        representation of the network addresses.  This means that the
        host bits aren't considered at all in this method.  If you want
        to compare host bits, you can easily enough do a
        'HostA._ip < HostB._ip'

        Args:
            other: An IP object.

        Returns:
            If the IP versions of self and other are the same, returns:

            -1 if self < other:
              eg: IPv4Network('192.0.2.0/25') < IPv4Network('192.0.2.128/25')
              IPv6Network('2001:db8::1000/124') <
                  IPv6Network('2001:db8::2000/124')
            0 if self == other
              eg: IPv4Network('192.0.2.0/24') == IPv4Network('192.0.2.0/24')
              IPv6Network('2001:db8::1000/124') ==
                  IPv6Network('2001:db8::1000/124')
            1 if self > other
              eg: IPv4Network('192.0.2.128/25') > IPv4Network('192.0.2.0/25')
                  IPv6Network('2001:db8::2000/124') >
                      IPv6Network('2001:db8::1000/124')

          Raises:
              TypeError if the IP versions are different.

        z"%s and %s are not of the same typerKr)r)rLr;rOr�r�r
r
r�compare_networks6s!�z_BaseNetwork.compare_networkscCs|j|j|jfS)z�Network-only key function.

        Returns an object that identifies this address' network and
        netmask. This function is a suitable "key" argument for sorted()
        and list.sort().

        )rLrOr�r[r
r
rrTfsz_BaseNetwork._get_networks_keyr)Nc	cs�|j|jkr|VdS|dk	rJ||jkr0td��|dkr@td��||j}|dkrZtd��|j|}||jkr~td||f��t|j�}t|j�d}t|j�d|?}t|||�D]}|�||f�}|Vq�dS)a�The subnets which join to make the current subnet.

        In the case that self contains only one IP
        (self._prefixlen == 32 for IPv4 or self._prefixlen == 128
        for IPv6), yield an iterator with just ourself.

        Args:
            prefixlen_diff: An integer, the amount the prefix length
              should be increased by. This should not be set if
              new_prefix is also set.
            new_prefix: The desired new prefix length. This must be a
              larger number (smaller prefix) than the existing prefix.
              This should not be set if prefixlen_diff is also set.

        Returns:
            An iterator of IPv(4|6) objects.

        Raises:
            ValueError: The prefixlen_diff is too small or too large.
                OR
            prefixlen_diff and new_prefix are both set or new_prefix
              is a smaller number than the current prefix (smaller
              number means a larger network)

        Nznew prefix must be longerr)�(cannot set prefixlen_diff and new_prefixrzprefix length diff must be > 0z0prefix length diff %d is invalid for netblock %s)	rMr=rrrrOrHr�r�r{)	r\�prefixlen_diff�
new_prefix�
new_prefixlen�start�end�stepZnew_addrZcurrentr
r
rrIps2



��
z_BaseNetwork.subnetscCs�|jdkr|S|dk	rB||jkr(td��|dkr8td��|j|}|j|}|dkrftd|j|f��|�t|j�t|j�|>@|f�S)a�The supernet containing the current network.

        Args:
            prefixlen_diff: An integer, the amount the prefix length of
              the network should be decreased by.  For example, given a
              /24 network and a prefixlen_diff of 3, a supernet with a
              /21 netmask is returned.

        Returns:
            An IPv4 network object.

        Raises:
            ValueError: If self.prefixlen - prefixlen_diff < 0. I.e., you have
              a negative prefix length.
                OR
            If prefixlen_diff and new_prefix are both set or new_prefix is a
              larger number than the current prefix (larger number means a
              smaller network)

        rNznew prefix must be shorterr)r�z;current prefixlen is %d, cannot have a prefixlen_diff of %d)rMrrjr{rrrOr�)r\r�r�r�r
r
rrC�s&



���z_BaseNetwork.supernetcCs|jjo|jjS�z�Test if the address is reserved for multicast use.

        Returns:
            A boolean, True if the address is a multicast address.
            See RFC 2373 2.7 for details.

        )rO�is_multicastrHr[r
r
rr��s	�z_BaseNetwork.is_multicastcCshz:|j|jkr"t|�d|�d���|j|jko8|j|jkWStk
rbtd|�d|����YnXdS)Nz and z are not of the same versionz*Unable to test subnet containment between )rLr;rOrHrN)�a�br
r
r�
_is_subnet_of�s
�z_BaseNetwork._is_subnet_ofcCs|�||�S)z1Return True if this network is a subnet of other.�r�r�r
r
rr��sz_BaseNetwork.subnet_ofcCs|�||�S)z3Return True if this network is a supernet of other.r�r�r
r
r�supernet_of�sz_BaseNetwork.supernet_ofcCs|jjo|jjS)��Test if the address is otherwise IETF reserved.

        Returns:
            A boolean, True if the address is within one of the
            reserved IPv6 Network ranges.

        )rO�is_reservedrHr[r
r
rr��s	�z_BaseNetwork.is_reservedcCs|jjo|jjS�z�Test if the address is reserved for link-local.

        Returns:
            A boolean, True if the address is reserved per RFC 4291.

        )rO�
is_link_localrHr[r
r
rr��s�z_BaseNetwork.is_link_localcCs|jjo|jjS)z�Test if this address is allocated for private networks.

        Returns:
            A boolean, True if the address is reserved per
            iana-ipv4-special-registry or iana-ipv6-special-registry.

        )rO�
is_privaterHr[r
r
rr�s	�z_BaseNetwork.is_privatecCs|jS)z�Test if this address is allocated for public networks.

        Returns:
            A boolean, True if the address is not reserved per
            iana-ipv4-special-registry or iana-ipv6-special-registry.

        �r�r[r
r
r�	is_globals	z_BaseNetwork.is_globalcCs|jjo|jjS)��Test if the address is unspecified.

        Returns:
            A boolean, True if this is the unspecified address as defined in
            RFC 2373 2.5.2.

        )rO�is_unspecifiedrHr[r
r
rr�s	�z_BaseNetwork.is_unspecifiedcCs|jjo|jjS)��Test if the address is a loopback address.

        Returns:
            A boolean, True if the address is a loopback address as defined in
            RFC 2373 2.5.3.

        )rO�is_loopbackrHr[r
r
rr�(s	�z_BaseNetwork.is_loopback)r)N)r)N))rrrr	r�r�r�r�r�r�r�r�r�r��	functools�cached_propertyrHr�r~r�r�r�r�r�rjr�r�rTrIrCr��staticmethodr�r�r�r�r�r�r�r�r�r
r
r
rrSnsd








K0

5
)








rSc@s�eZdZdZdZdZdedZeZiZ	dd�Z
edd	��Zed
d��Z
edd
��Zedd��Zdd�Zedd��Zedd��ZdS)�_BaseV4zyBase IPv4 object.

    The following methods are used by IPv4 objects in both single IP
    addresses and networks.

    r
rr#r)cCst|�Srzr^r[r
r
rrZHsz$_BaseV4._explode_shorthand_ip_stringcCs�||jkr�t|t�r<|}d|kr.|jksjn|�|�n.z|�|�}Wntk
rh|�|�}YnXt|�	|��}||f|j|<|j|S�aMake a (netmask, prefix_len) tuple from the given argument.

        Argument can be:
        - an integer (the prefix length)
        - a string representing the prefix length (e.g. "24")
        - a string representing the prefix netmask (e.g. "255.255.255.0")
        r)
�_netmask_cacher9rrr=rorsrrvr
rk�ri�argrjr�r
r
r�
_make_netmaskKs	

z_BaseV4._make_netmaskc
Cs~|std��|�d�}t|�dkr.td|��zt�t|j|�d�WStk
rx}ztd||f�d�W5d}~XYnXdS)aTurn the given IP string into an integer for comparison.

        Args:
            ip_str: A string, the IP ip_str.

        Returns:
            The IP ip_str as an integer.

        Raises:
            AddressValueError: if ip_str isn't a valid IPv4 Address.

        �Address cannot be empty�.rzExpected 4 octets in %rr�%s in %rN)rr%r&rr�
from_bytes�map�_parse_octetr)riruZoctets�excr
r
rrtes
z_BaseV4._ip_int_from_stringcCs�|std��|��r|��s,d}t||��t|�dkrHd}t||��|dkrl|ddkrld}t||��t|d�}|d	kr�td
|��|S)aConvert a decimal octet into an integer.

        Args:
            octet_str: A string, the number to parse.

        Returns:
            The octet as an integer.

        Raises:
            ValueError: if the octet isn't strictly a decimal from [0..255].

        zEmpty octet not permittedz#Only decimal digits permitted in %r�z$At most 3 characters permitted in %r�0rz%Leading zeros are not permitted in %r�
�zOctet %d (> 255) not permitted)rrprqr&rr)riZ	octet_strrfZ	octet_intr
r
rr�s
z_BaseV4._parse_octetcCsd�tt|�dd���S)z�Turns a 32-bit integer into dotted decimal notation.

        Args:
            ip_int: An integer, the IP address.

        Returns:
            The IP address as a string in dotted decimal notation.

        r�rr)�joinr�r$r)rirmr
r
rr��sz_BaseV4._string_from_ip_intcCs&t|��d�ddd�}d�|�dS)z�Return the reverse DNS pointer name for the IPv4 address.

        This implements the method described in RFC1035 3.5.

        r�NrKz
.in-addr.arpa)r$r%r�)r\Zreverse_octetsr
r
rr`�sz_BaseV4._reverse_pointercCs|jSrz�r=r[r
r
r�
max_prefixlen�sz_BaseV4.max_prefixlencCs|jSrzr�r[r
r
rr<�sz_BaseV4.versionN)rrrr	r}rL�
IPV4LENGTHr>r=r�rZrr�rtr�r�r`r~r�r<r
r
r
rr�5s(


#
	
r�c@s�eZdZdZdZdd�Zedd��Zedd��Zee	�
�d	d
���Zee	�
�dd���Zed
d��Z
edd��Zedd��Zedd��ZdS)r
z/Represent and manipulate single IPv4 Addresses.�r,�__weakref__cCsrt|t�r|�|�||_dSt|t�rF|�|d�t�|d�|_dSt|�}d|krbtd|��|�	|�|_dS)a�
        Args:
            address: A string or integer representing the IP

              Additionally, an integer can be passed, so
              IPv4Address('192.0.2.1') == IPv4Address(3221225985).
              or, more generally
              IPv4Address(int(IPv4Address('192.0.2.1'))) ==
                IPv4Address('192.0.2.1')

        Raises:
            AddressValueError: If ipaddress isn't a valid IPv4 address.

        Nrrr"�Unexpected '/' in %r�
r9rrrgr,rwrhr�r$rrt�r\rZaddr_strr
r
r�__init__�s


zIPv4Address.__init__cCs
t|j�S�z*The binary representation of this address.)rr,r[r
r
r�packed�szIPv4Address.packedcCs||jjkS)z�Test if the address is otherwise IETF reserved.

         Returns:
             A boolean, True if the address is within the
             reserved IPv4 Network range.

        )�
_constants�_reserved_networkr[r
r
rr��s	zIPv4Address.is_reservedcst�fdd��jjD��S)z�Test if this address is allocated for private networks.

        Returns:
            A boolean, True if the address is reserved per
            iana-ipv4-special-registry.

        c3s|]}�|kVqdSrzr
��.0r?r[r
r�	<genexpr>sz)IPv4Address.is_private.<locals>.<genexpr>��anyr��_private_networksr[r
r[rr��s
zIPv4Address.is_privatecCs||jjko|jSrz)r��_public_networkr�r[r
r
rr�szIPv4Address.is_globalcCs||jjkS)z�Test if the address is reserved for multicast use.

        Returns:
            A boolean, True if the address is multicast.
            See RFC 3171 for details.

        �r��_multicast_networkr[r
r
rr�s	zIPv4Address.is_multicastcCs||jjkS)z�Test if the address is unspecified.

        Returns:
            A boolean, True if this is the unspecified address as defined in
            RFC 5735 3.

        )r��_unspecified_addressr[r
r
rr�s	zIPv4Address.is_unspecifiedcCs||jjkS)z�Test if the address is a loopback address.

        Returns:
            A boolean, True if the address is a loopback per RFC 3330.

        )r��_loopback_networkr[r
r
rr�"szIPv4Address.is_loopbackcCs||jjkS)z�Test if the address is reserved for link-local.

        Returns:
            A boolean, True if the address is link-local per RFC 3927.

        �r��_linklocal_networkr[r
r
rr�,szIPv4Address.is_link_localN)rrrr	r}r�r~r�r�r��	lru_cacher�r�r�r�r�r�r
r
r
rr
�s*#








	r
c@sxeZdZdd�Zejdd��Zdd�Zdd�Zd	d
�Z	dd�Z
ejZe
d
d��Ze
dd��Ze
dd��Ze
dd��ZdS)rcCsD|�|�\}}t�||�t||fdd�|_|jj|_|jj|_dS�NF)r)ryr
r�rr�r�rM�r\rr'�maskr
r
rr�9s

zIPv4Interface.__init__cCs|jjSrz�r�r�r[r
r
rr�AszIPv4Interface.hostmaskcCsd|�|j�|jfSr��r�r,rMr[r
r
rr�Es�zIPv4Interface.__str__cCsFt�||�}|r|tkr|Sz|j|jkWStk
r@YdSXdSr�)r
r�rVr�rN�r\r�Z
address_equalr
r
rr�IszIPv4Interface.__eq__cCsRt�||�}|tkrtSz|j|jkp4|j|jko4|WStk
rLYdSXdSr�)r
r�rVr�rN�r\r�Zaddress_lessr
r
rr�Us�zIPv4Interface.__lt__cCst|j|jt|jj�f�Srz�r�r,rMrrr�rOr[r
r
rr�aszIPv4Interface.__hash__cCs
t|j�Srz)r
r,r[r
r
rr1fszIPv4Interface.ipcCsd|�|j�|jfSr�rr[r
r
rr�js�zIPv4Interface.with_prefixlencCsd|�|j�|jfSr��r�r,r�r[r
r
rr�os�zIPv4Interface.with_netmaskcCsd|�|j�|jfSr��r�r,r�r[r
r
rr�ts�zIPv4Interface.with_hostmaskN)rrrr�r�r�r�r�r�r�r�rYr|r~r1r�r�r�r
r
r
rr7s 



rc@s2eZdZdZeZddd�Zee�	�dd���Z
dS)	raeThis class represents and manipulates 32-bit IPv4 network + addresses..

    Attributes: [examples for IPv4Network('192.0.2.0/27')]
        .network_address: IPv4Address('192.0.2.0')
        .hostmask: IPv4Address('0.0.0.31')
        .broadcast_address: IPv4Address('192.0.2.32')
        .netmask: IPv4Address('255.255.255.224')
        .prefixlen: 27

    Tcs�|�|�\�}t��|_|�|�\|_|_t|j�}|t|j�@|krl|rXtd|��nt|t|j�@�|_|j|jdkr�|j	|_
n|j|jkr��fdd�|_
dS)aInstantiate a new IPv4 network object.

        Args:
            address: A string or integer representing the IP [& network].
              '192.0.2.0/24'
              '192.0.2.0/255.255.255.0'
              '192.0.2.0/0.0.0.255'
              are all functionally the same in IPv4. Similarly,
              '192.0.2.1'
              '192.0.2.1/255.255.255.255'
              '192.0.2.1/32'
              are also functionally equivalent. That is to say, failing to
              provide a subnetmask will create an object with a mask of /32.

              If the mask (portion after the / in the argument) is given in
              dotted quad form, it is treated as a netmask if it starts with a
              non-zero field (e.g. /255.0.0.0 == /8) and as a hostmask if it
              starts with a zero field (e.g. 0.255.255.255 == /8), with the
              single exception of an all-zero mask which is treated as a
              netmask == /0. If no mask is given, a default of /32 is used.

              Additionally, an integer can be passed, so
              IPv4Network('192.0.2.1') == IPv4Network(3221225985)
              or, more generally
              IPv4Interface(int(IPv4Interface('192.0.2.1'))) ==
                IPv4Interface('192.0.2.1')

        Raises:
            AddressValueError: If ipaddress isn't a valid IPv4 address.
            NetmaskValueError: If the netmask isn't valid for
              an IPv4 address.
            ValueError: If strict is True and a network address is not
              supplied.
        �%s has host bits setr)cs
t��gSrz)r
r
�r'r
r�<lambda>��z&IPv4Network.__init__.<locals>.<lambda>N)ryr
rOr�r�rMrrrr=r�r��r\rrr�r�r
rrr��s#

�
zIPv4Network.__init__cCs&|jtd�ko|jtd�ko$|jS)z�Test if this address is allocated for public networks.

        Returns:
            A boolean, True if the address is not reserved per
            iana-ipv4-special-registry.

        �
100.64.0.0/10)rOrrHr�r[r
r
rr��s

��zIPv4Network.is_globalN)T)rrrr	r
r�r�r~r�r�r�r
r
r
rrzs
4rc@s�eZdZed�Zed�Zed�Zed�Zed�ed�ed�ed�ed�ed�ed	�ed
�ed�ed�ed
�ed�ed�ed�gZed�Z	e
d�ZdS)�_IPv4Constantsz169.254.0.0/16z127.0.0.0/8z224.0.0.0/4rz	0.0.0.0/8z
10.0.0.0/8z
172.16.0.0/12z192.0.0.0/29z192.0.0.170/31z192.0.2.0/24z192.168.0.0/16z
198.18.0.0/15z198.51.100.0/24z203.0.113.0/24z240.0.0.0/4z255.255.255.255/32z0.0.0.0N)rrrrr�r�r�r�r�r�r
r�r
r
r
rr�s*�rc@s�eZdZdZdZdZdedZdZe	d�Z
eZiZe
dd	��Ze
d
d��Ze
dd
��Ze
dd��Ze
ddd��Zdd�Zdd�Zedd��Zedd��ZdS)�_BaseV6zyBase IPv6 object.

    The following methods are used by IPv6 objects in both single IP
    addresses and networks.

    r
r8r#r)rlZ0123456789ABCDEFabcdefcCsl||jkrbt|t�r<|}d|kr.|jksFn|�|�n
|�|�}t|�|��}||f|j|<|j|Sr�)r�r9rrr=rorsrrkr�r
r
rr�s	


z_BaseV6._make_netmaskc
Cs�|std��|�d�}d}t|�|kr:d||f}t|��d|dkr�zt|���j}Wn4tk
r�}ztd||f�d�W5d}~XYnX|�d	|d
?d@�|�d	|d@�|jd}t|�|kr�d
|d|f}t|��d}tdt|�d�D]*}	||	s�|dk	�r d|}t|��|	}q�|dk	�r�|}
t|�|d}|d�sl|
d8}
|
�rld}t||��|d�s�|d8}|�r�d}t||��|j|
|}|dk�r2d}t||jd|f��njt|�|jk�r�d}t||j|f��|d�sd}t||��|d�s"d}t||��t|�}
d}d}znd}
t|
�D] }	|
d
K}
|
|�	||	�O}
�q@|
d
|K}
t|d�D] }	|
d
K}
|
|�	||	�O}
�qz|
WSt
k
�r�}ztd||f�d�W5d}~XYnXdS)z�Turn an IPv6 ip_str into an integer.

        Args:
            ip_str: A string, the IPv6 ip_str.

        Returns:
            An int, the IPv6 address

        Raises:
            AddressValueError: if ip_str isn't a valid IPv6 Address.

        r��:r�z At least %d parts expected in %rr�rKr�N�%xr �r)z!At most %d colons permitted in %rz At most one '::' permitted in %rrz0Leading ':' only permitted as part of '::' in %rz1Trailing ':' only permitted as part of '::' in %rz/Expected at most %d other parts with '::' in %rz,Exactly %d parts expected without '::' in %r)rr%r&r
rBr,rE�
_HEXTET_COUNTr��
_parse_hextetr)riru�partsZ
_min_partsrfZipv4_intr�Z
_max_partsZ
skip_index�iZparts_hiZparts_loZ
parts_skippedrmr
r
rrts�
$







z_BaseV6._ip_int_from_stringcCs>|j�|�std|��t|�dkr4d}t||��t|d�S)a&Convert an IPv6 hextet string into an integer.

        Args:
            hextet_str: A string, the number to parse.

        Returns:
            The hextet as an integer.

        Raises:
            ValueError: if the input isn't strictly a hex number from
              [0..FFFF].

        zOnly hex digits permitted in %rrz$At most 4 characters permitted in %rr )�_HEX_DIGITS�
issupersetrr&rr)riZ
hextet_strrfr
r
rr~sz_BaseV6._parse_hextetc	Cs�d}d}d}d}t|�D]>\}}|dkrN|d7}|dkr<|}||krV|}|}qd}d}q|dkr�||}|t|�kr~|dg7}dg|||�<|dkr�dg|}|S)a�Compresses a list of hextets.

        Compresses a list of strings, replacing the longest continuous
        sequence of "0" in the list with "" and adding empty strings at
        the beginning or at the end of the string such that subsequently
        calling ":".join(hextets) will produce the compressed version of
        the IPv6 address.

        Args:
            hextets: A list of strings, the hextets to compress.

        Returns:
            A list of strings.

        rKrr�r)�)�	enumerater&)	ri�hextetsZbest_doublecolon_startZbest_doublecolon_lenZdoublecolon_startZdoublecolon_len�indexZhextetZbest_doublecolon_endr
r
r�_compress_hextets�s0�

z_BaseV6._compress_hextetsNcsZ|dkrt|j�}||jkr$td��d|��fdd�tddd�D�}|�|�}d	�|�S)
a,Turns a 128-bit integer into hexadecimal notation.

        Args:
            ip_int: An integer, the IP address.

        Returns:
            A string, the hexadecimal representation of the address.

        Raises:
            ValueError: The address is bigger than 128 bits of all ones.

        NzIPv6 address is too large�%032xcs&g|]}dt�||d�d��qS)rrr )rr�r�r��Zhex_strr
r�
<listcomp>�sz/_BaseV6._string_from_ip_int.<locals>.<listcomp>rrrr)rrr,r>rr�rr�)rirmrr
rrr��s


z_BaseV6._string_from_ip_intcs�t|t�rt|j�}nt|t�r,t|j�}nt|�}|�|�}d|��fdd�tddd�D�}t|ttf�r�dd�	|�|j
fSd�	|�S)	z�Expand a shortened IPv6 address.

        Args:
            ip_str: A string, the IPv6 address.

        Returns:
            A string, the expanded IPv6 address.

        rcsg|]}�||d��qS)rr
rrr
rr�sz8_BaseV6._explode_shorthand_ip_string.<locals>.<listcomp>rrrr�r)r9rr$rOrr1rtr�rSr�rM)r\rurmrr
rrrZ�s



z$_BaseV6._explode_shorthand_ip_stringcCs&|jddd��dd�}d�|�dS)z�Return the reverse DNS pointer name for the IPv6 address.

        This implements the method described in RFC3596 2.5.

        NrKrrr�z	.ip6.arpa)r]�replacer�)r\Z
reverse_charsr
r
rr`�sz_BaseV6._reverse_pointercCs|jSrzr�r[r
r
rr�sz_BaseV6.max_prefixlencCs|jSrzr�r[r
r
rr<sz_BaseV6.version)N)rrrr	r}rL�
IPV6LENGTHr>r�	frozensetrr=r�rr�rtrrr�rZr`r~r�r<r
r
r
rr
�s0

g

/	
r
c@s�eZdZdZdZdd�Zedd��Zedd��Zed	d
��Z	edd��Z
ed
d��Zee�
�dd���Zedd��Zedd��Zedd��Zedd��Zedd��Zedd��ZdS)rz/Represent and manipulate single IPv6 Addresses.r�cCsrt|t�r|�|�||_dSt|t�rF|�|d�t�|d�|_dSt|�}d|krbtd|��|�	|�|_dS)aInstantiate a new IPv6 address object.

        Args:
            address: A string or integer representing the IP

              Additionally, an integer can be passed, so
              IPv6Address('2001:db8::') ==
                IPv6Address(42540766411282592856903984951653826560)
              or, more generally
              IPv6Address(int(IPv6Address('2001:db8::'))) ==
                IPv6Address('2001:db8::')

        Raises:
            AddressValueError: If address isn't a valid IPv6 address.

        Nr rr"r�r�r�r
r
rr�s


zIPv6Address.__init__cCs
t|j�Sr�)r!r,r[r
r
rr�6szIPv6Address.packedcCs||jjkSr�r�r[r
r
rr�;s	zIPv6Address.is_multicastcst�fdd��jjD��S)r�c3s|]}�|kVqdSrzr
rr[r
rr�Osz*IPv6Address.is_reserved.<locals>.<genexpr>)r�r��_reserved_networksr[r
r[rr�Fs	zIPv6Address.is_reservedcCs||jjkSr�r�r[r
r
rr�QszIPv6Address.is_link_localcCs||jjkS�a`Test if the address is reserved for site-local.

        Note that the site-local address space has been deprecated by RFC 3879.
        Use is_private to test if this address is in the space of unique local
        addresses as defined by RFC 4193.

        Returns:
            A boolean, True if the address is reserved per RFC 3513 2.5.6.

        )r��_sitelocal_networkr[r
r
r�
is_site_local[szIPv6Address.is_site_localcst�fdd��jjD��S)z�Test if this address is allocated for private networks.

        Returns:
            A boolean, True if the address is reserved per
            iana-ipv6-special-registry.

        c3s|]}�|kVqdSrzr
r�r[r
rr�ssz)IPv6Address.is_private.<locals>.<genexpr>r�r[r
r[rr�is
zIPv6Address.is_privatecCs|jS)z�Test if this address is allocated for public networks.

        Returns:
            A boolean, true if the address is not reserved per
            iana-ipv6-special-registry.

        r�r[r
r
rr�us	zIPv6Address.is_globalcCs
|jdkS)r�rr�r[r
r
rr��s	zIPv6Address.is_unspecifiedcCs
|jdkS)r�r)r�r[r
r
rr��s	zIPv6Address.is_loopbackcCs |jd?dkrdSt|jd@�S)z�Return the IPv4 mapped address.

        Returns:
            If the IPv6 address is a v4 mapped address, return the
            IPv4 mapped address. Return None otherwise.

        rrN����r,r
r[r
r
r�ipv4_mapped�s	zIPv6Address.ipv4_mappedcCs4|jd?dkrdSt|jd?d@�t|jd@�fS)z�Tuple of embedded teredo IPs.

        Returns:
            Tuple of the (server, client) IPs or None if the address
            doesn't appear to be a teredo address (doesn't start with
            2001::/32)

        �`i N�@r'r(r[r
r
r�teredo�s

�zIPv6Address.teredocCs$|jd?dkrdSt|jd?d@�S)z�Return the IPv4 6to4 embedded address.

        Returns:
            The IPv4 6to4-embedded address if present or None if the
            address doesn't appear to contain a 6to4 embedded address.

        �pi N�Pr'r(r[r
r
r�	sixtofour�s	zIPv6Address.sixtofourN)rrrr	r}r�r~r�r�r�r�r&r�r�r�r�r�r�r)r,r/r
r
r
rrs8$





	










rc@s�eZdZdd�Zejdd��Zdd�Zdd�Zd	d
�Z	dd�Z
ejZe
d
d��Ze
dd��Ze
dd��Ze
dd��Ze
dd��Ze
dd��ZdS)rcCsD|�|�\}}t�||�t||fdd�|_|jj|_|jj|_dSr�)ryrr�rr�r�rMr�r
r
rr��s

zIPv6Interface.__init__cCs|jjSrzr�r[r
r
rr��szIPv6Interface.hostmaskcCsd|�|j�|jfSr�rr[r
r
rr��s�zIPv6Interface.__str__cCsFt�||�}|r|tkr|Sz|j|jkWStk
r@YdSXdSr�)rr�rVr�rNrr
r
rr��szIPv6Interface.__eq__cCsRt�||�}|tkrtSz|j|jkp4|j|jko4|WStk
rLYdSXdSr�)rr�rVr�rNrr
r
rr��s�zIPv6Interface.__lt__cCst|j|jt|jj�f�Srzrr[r
r
rr��szIPv6Interface.__hash__cCs
t|j�Srz)rr,r[r
r
rr1�szIPv6Interface.ipcCsd|�|j�|jfSr�rr[r
r
rr��s�zIPv6Interface.with_prefixlencCsd|�|j�|jfSr�rr[r
r
rr��s�zIPv6Interface.with_netmaskcCsd|�|j�|jfSr�rr[r
r
rr��s�zIPv6Interface.with_hostmaskcCs|jdko|jjS)Nr)r,r�r�r[r
r
rr�szIPv6Interface.is_unspecifiedcCs|jdko|jjSr�)r,r�r�r[r
r
rr�szIPv6Interface.is_loopbackN)rrrr�r�r�r�r�r�r�r�rYr|r~r1r�r�r�r�r�r
r
r
rr�s(





rc@s2eZdZdZeZd
dd�Zdd�Zedd��Z	d	S)ravThis class represents and manipulates 128-bit IPv6 networks.

    Attributes: [examples for IPv6('2001:db8::1000/124')]
        .network_address: IPv6Address('2001:db8::1000')
        .hostmask: IPv6Address('::f')
        .broadcast_address: IPv6Address('2001:db8::100f')
        .netmask: IPv6Address('ffff:ffff:ffff:ffff:ffff:ffff:ffff:fff0')
        .prefixlen: 124

    Tcs�|�|�\�}t��|_|�|�\|_|_t|j�}|t|j�@|krl|rXtd|��nt|t|j�@�|_|j|jdkr�|j	|_
n|j|jkr��fdd�|_
dS)a�Instantiate a new IPv6 Network object.

        Args:
            address: A string or integer representing the IPv6 network or the
              IP and prefix/netmask.
              '2001:db8::/128'
              '2001:db8:0000:0000:0000:0000:0000:0000/128'
              '2001:db8::'
              are all functionally the same in IPv6.  That is to say,
              failing to provide a subnetmask will create an object with
              a mask of /128.

              Additionally, an integer can be passed, so
              IPv6Network('2001:db8::') ==
                IPv6Network(42540766411282592856903984951653826560)
              or, more generally
              IPv6Network(int(IPv6Network('2001:db8::'))) ==
                IPv6Network('2001:db8::')

            strict: A boolean. If true, ensure that we have been passed
              A true network address, eg, 2001:db8::1000/124 and not an
              IP address on a network, eg, 2001:db8::1/124.

        Raises:
            AddressValueError: If address isn't a valid IPv6 address.
            NetmaskValueError: If the netmask isn't valid for
              an IPv6 address.
            ValueError: If strict was True and a network address was not
              supplied.
        rr)cs
t��gSrz)rr
rr
rrIr	z&IPv6Network.__init__.<locals>.<lambda>N)ryrrOr�r�rMrrrr=r�r�r
r
rrr�s

�
zIPv6Network.__init__ccs<t|j�}t|j�}t|d|d�D]}|�|�Vq&dS)z�Generate Iterator over usable hosts in a network.

          This is like __iter__ except it doesn't return the
          Subnet-Router anycast address.

        r)Nr�r�r
r
rr�Ks

zIPv6Network.hostscCs|jjo|jjSr$)rOr&rHr[r
r
rr&Ws�zIPv6Network.is_site_localN)T)
rrrr	rr�r�r�r~r&r
r
r
rrs
0rc@s�eZdZed�Zed�Zed�ed�ed�ed�ed�ed�ed	�ed
�ed�ed�g
Zed�ed
�ed�ed�ed�ed�ed�ed�ed�ed�ed�ed�ed�ed�ed�gZed�ZdS)�_IPv6Constantsz	fe80::/10zff00::/8z::1/128z::/128z
::ffff:0:0/96z100::/64z	2001::/23z2001:2::/48z
2001:db8::/32z2001:10::/28zfc00::/7z::/8z100::/8z200::/7z400::/6z800::/5z1000::/4z4000::/3z6000::/3z8000::/3zA000::/3zC000::/3zE000::/4zF000::/5zF800::/6zFE00::/9z	fec0::/10N)	rrrrr�r�r�r#r%r
r
r
rr0gs<��r0)T)#r	�__version__r�r�r!rrrrrrrr!r(r2r6r@rJrRrXrY�total_orderingr:rSr�r
rrrr�r
rrrr0r
r
r
r�<module>sV
#7163:IuCR 5K\!__pycache__/cgitb.cpython-38.opt-1.pyc000064400000023650151153537600013447 0ustar00U

e5d@/�@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
dd�ZgZdd�Z
dd�Zd	d
�Zdd�Zd
d�Zddd�Zddd�ZGdd�d�Ze�jZddd�ZdS)a�More comprehensive traceback formatting for Python scripts.

To enable this module, do:

    import cgitb; cgitb.enable()

at the top of your script.  The optional arguments to enable() are:

    display     - if true, tracebacks are displayed in the web browser
    logdir      - if set, tracebacks are written to files in this directory
    context     - number of lines of source code to show for each stack frame
    format      - 'text' or 'html' controls the output format

By default, tracebacks are displayed but not saved, the context is 5 lines
and the output format is 'html' (for backwards compatibility with the
original use of this module)

Alternatively, if you have caught an exception and want cgitb to display it
for you, call cgitb.handler().  The optional argument to handler() is a
3-item tuple (etype, evalue, etb) just like the value of sys.exc_info().
The default handler displays output as HTML.

�NcCsdS)zAReturn a string that resets the CGI and browser to a known state.a'<!--: spam
Content-Type: text/html

<body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> -->
<body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> --> -->
</font> </font> </font> </script> </object> </blockquote> </pre>
</table> </table> </table> </table> </table> </font> </font> </font>�rrr�/usr/lib64/python3.8/cgitb.py�reset#srcCs|rd|dSdSdS)Nz<small>z</small>�r��textrrr�small.srcCs|rd|dSdSdS)Nz<strong>z	</strong>rrrrrr�strong4sr	cCs|rd|dSdSdS)Nz<font color="#909090">z</font>rrrrrr�grey:sr
cCs�||krd||fS||jkr,d|j|fSd|jkr~|jd}t|�ti�krf||kr~d||fSnt||�r~dt||�fSdtfS)z9Find the value for a given name in the given environment.�local�global�__builtins__�builtinN)�	f_globals�type�hasattr�getattr�	__UNDEF__)�name�frame�locals�builtinsrrr�lookup@s



rcCs�gdddtf\}}}}}t�|�D]�\}}	}
}}|tjkr>q�|tjkr�|	tjkr�|dkr�|tk	r�t||	t�}|�||	||f�q�t	|	||�\}
}|�|	|
|f�n"|	dkr�||d7}|}nd\}}|	}q"|S)zEScan one logical line of Python and look up values of variables used.Nr�.)Nr)
r�tokenize�generate_tokens�NEWLINE�NAME�keyword�kwlistr�appendr)�readerrr�varsZ	lasttoken�parent�prefix�valueZttype�token�start�end�line�whererrr�scanvarsPs"
r+�c"s�|\}}}t|t�r|j}dtj��ddtj}t�t���}dt	j
�dtt	j
�
t|���dd|d|�d	}d
td�d}g}	t�||�}
|
D�]F\}�}}
}}�r�tj����d
�t	j
�
��f}nd�}t�|�\}}}}d}|
dk�r8dtt	j
�
|
��}|
dk�r8|tj||||dd�d�7}i�|gf��fdd�	}t|||�}dd||fg}|dk	�r
||}|D]�}tddtt|��t|��d}|�k�r�d|t	j
�|�f}|�d|�n&d|t	j
�|�f}|�dt|��|d 7}�q�ig}}|D]�\}}} ||k�r0�qd ||<| tk	�r�|d!k�r^d"|t|�}n*|d#k�rrt|�}n|t|�d$�d%�}|�d&|t	j
�| �f�n|�|d'��q|�dttd(�|����|	�d)d*�|��q�d+tt	j
�
t|���t	j
�
t|��fg}!t|�D]B}|dd �d,k�r4�qt	j
�t ||��} |!�d-||| f��q|d�|	�d�|!�d.t	j
�
d�t!�"|||���S)/z9Return a nice HTML document describing a given traceback.�Python r�: z<body bgcolor="#f0f0f8">z<big><big>%s</big></big>z#ffffffz#6622aaz<br>z�
<p>A problem occurred in a Python script.  Here is the sequence of
function calls leading up to the error, in the order they occurred.</p>z<tt>z&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;z&nbsp;</tt>z<a href="file://%s">%s</a>�?r�in �<module>cSsdtj�|�S�N�=)�pydoc�html�repr�r%rrr�<lambda>��zhtml.<locals>.<lambda>�Zformatvaluec
s8d�|d<zt��|d�W�S|dd7<XdS�N�r��	linecache�getline��lnum��fileZ	highlightrrr!�szhtml.<locals>.readerz+<tr><td bgcolor="#d8bbff">%s%s %s</td></tr>z<big>&nbsp;</big>Nz&nbsp;r,z<tt>=&gt;%s%s</tt>z&<tr><td bgcolor="#ffccee">%s</td></tr>z<tt>&nbsp;&nbsp;%s%s</tt>z<tr><td>%s</td></tr>r<)rrz<em>%s</em> rr���z%s&nbsp;= %sz <em>undefined</em>z, zF
<table width="100%%" cellspacing=0 cellpadding=0 border=0>
%s</table>�
z	<p>%s: %s�_z
<br>%s%s&nbsp;=
%sz�


<!-- The above is a description of an error in a Python program, formatted
     for a Web browser because the 'cgitb' module was enabled.  In case you
     are not reading this in a Web browser, here is the original traceback:

%s
-->
)#�
isinstancer�__name__�sys�version�split�
executable�time�ctimer4r5Zheadingr	�escape�strr�inspect�getinnerframes�os�path�abspath�getargvalues�formatargvaluesr+�lenZ	preformatr r
rr6�join�dirr�	traceback�format_exception)"�einfo�context�etype�evalue�etb�pyver�date�head�indent�frames�recordsrrA�func�lines�index�link�args�varargs�varkwr�callr!r"�rows�ir)�num�done�dumprr*r%�	exceptionrrBrr5es�

�
��

��
$






��	��r5c 	s�|\}}}t|t�r|j}dtj��ddtj}t�t���}dt	|�||fd}g}t
�||�}	|	D�]�\}
�}}}
}�r�tj
���p�d�t
�|
�\}}}}d}|dkr�d|}|d	kr�|t
j||||d
d�d�7}i�|gf��fd
d�	}t||
|�}d�|fg}|dk	�rP||}|
D](}d|}|�||���|d7}�q&ig}}|D]�\}}}||k�rv�q^d||<|tk	�r�|dk�r�d|}n|dk�r�||�d�d}|�d|tj�|�f�n|�|d��q^|�d�|��|�dd�|��qndt	|�t	|�fg}t|�D],}tj�t||��}|�dd||f��q*|d�|�d�|�dd�t�|||��S) z:Return a plain text document describing a given traceback.r-rr.z	%s
%s
%s
z�
A problem occurred in a Python script.  Here is the sequence of
function calls leading up to the error, in the order they occurred.
r/rr0r1cSsdtj�|�Sr2)r4rr6r7rrrr8�r9ztext.<locals>.<lambda>r:c
s8d�|d<zt��|d�W�S|dd7<XdSr;r=r@rBrrr!�sztext.<locals>.readerz %s %sNz%5d r<rzglobal rrrDz%s = %sz
 undefinedrEz
%s
z%s: %sz

%s%s = %sz    zc

The above is a description of an error in a Python program.  Here is
the original traceback:

%s
)rGrrHrIrJrKrLrMrNrPrQrRrSrTrUrVrWr+r �rstriprr4rr6rYrZrr[r\) r]r^r_r`rarbrcrdrfrgrrArhrirjrlrmrnrror!r"rprqr)rrrsrtrr*r%rurrBrr�sb

�






�rc@s,eZdZdZddd�Zdd	�Zd
d
d�ZdS)�Hookz?A hook to replace sys.excepthook that shows tracebacks in HTML.r<Nr,r5cCs(||_||_||_|ptj|_||_dS�N)�display�logdirr^rI�stdoutrC�format)�selfryrzr^rCr|rrr�__init__s
z
Hook.__init__cCs|�|||f�dSrx)�handle)r}r_r`rarrr�__call__
sz
Hook.__call__c
	Csz|p
t��}|jdkr$|j�t��|jdkr2tp4t}d}z|||j�}Wn d�	t
j|��}d}YnX|jr�|r�t
j�|�}|j�d|d�q�|j�|d�n|j�d�|jdk	�rZd	d
g|jdk}tj||jd�\}}z.t�|d��}|�|�W5QRXd
|}	Wnd|}	YnX|jdk�rJ|j�d|	�n|j�|	d�z|j��WnYnXdS)Nr5FrTz<pre>z</pre>
rEz*<p>A problem occurred in a Python script.
z.txtz.html)�suffixrZ�wz*%s contains the description of this error.z*Tried to save traceback to %s, but failed.z
<p>%s</p>
)rI�exc_infor|rC�writerr5rr^rYr[r\ryr4rOrz�tempfileZmkstemprS�fdopen�flush)
r}�infoZ	formatterZplain�docr��fdrTrC�msgrrrrs@

zHook.handle)r<Nr,Nr5)N)rH�
__module__�__qualname__�__doc__r~r�rrrrrrws�
rwr<cCst||||d�t_dS)aInstall an exception handler that formats tracebacks as HTML.

    The optional argument 'display' can be set to 0 to suppress sending the
    traceback to the browser, and 'logdir' can be set to a directory to cause
    tracebacks to be written to files there.�ryrzr^r|N)rwrI�
excepthookr�rrr�enable:s�r�)r,)r,)r<Nr,r5)r�rQrr>rSr4rIr�rMrr[rrrr	r
rr+r5rrwrZhandlerr�rrrr�<module>s,

[
B7__pycache__/wave.cpython-38.opt-2.pyc000064400000027515151153537600013326 0ustar00U

e5d6G�@s�ddlZdddddgZGdd�de�ZdZd	ZddlZddlZddlZdd
l	m
Z
ddlmZddl
Z
edd
�ZGdd�d�ZGdd�d�Zddd�Zddd�ZdS)�N�open�openfp�Error�	Wave_read�
Wave_writec@seZdZdS)rN)�__name__�
__module__�__qualname__�r
r
�/usr/lib64/python3.8/wave.pyrNs�)N�b�hN�i)�Chunk)�
namedtuple�_wave_paramsz7nchannels sampwidth framerate nframes comptype compnamec@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+S),rcCs�d|_d|_t|dd�|_|j��dkr0td��|j�d�dkrHtd��d|_d|_d|_	zt|jdd�}Wnt
k
r�Yq�YnX|��}|d	kr�|�|�d|_n2|d
kr�|js�td��||_|j|j
|_d|_	q�|��qT|jr�|js�td��dS)
Nr)Z	bigendian�RIFFz file does not start with RIFF id��WAVEznot a WAVE filer�fmt �datazdata chunk before fmt chunkz#fmt chunk and/or data chunk missing)�_convert�	_soundposr�_fileZgetnamer�readZ_fmt_chunk_read�_data_chunk�_data_seek_needed�EOFError�_read_fmt_chunkZ	chunksize�
_framesize�_nframes�skip)�self�file�chunkZ	chunknamer
r
r�initfp~s8


zWave_read.initfpcCsRd|_t|t�r"t�|d�}||_z|�|�Wn|jrF|���YnXdS)N�rb��_i_opened_the_file�
isinstance�str�builtinsrr&�close�r#�fr
r
r�__init__�s
zWave_read.__init__cCs|��dS�N�r-�r#r
r
r�__del__�szWave_read.__del__cCs|Sr1r
r3r
r
r�	__enter__�szWave_read.__enter__cGs|��dSr1r2�r#�argsr
r
r�__exit__�szWave_read.__exit__cCs|jSr1)rr3r
r
r�getfp�szWave_read.getfpcCsd|_d|_dS)Nrr)rrr3r
r
r�rewind�szWave_read.rewindcCs"d|_|j}|rd|_|��dSr1)rr)r-�r#r$r
r
rr-�s
zWave_read.closecCs|jSr1)rr3r
r
r�tell�szWave_read.tellcCs|jSr1)�
_nchannelsr3r
r
r�getnchannels�szWave_read.getnchannelscCs|jSr1)r!r3r
r
r�
getnframes�szWave_read.getnframescCs|jSr1)�
_sampwidthr3r
r
r�getsampwidth�szWave_read.getsampwidthcCs|jSr1)�
_framerater3r
r
r�getframerate�szWave_read.getframeratecCs|jSr1��	_comptyper3r
r
r�getcomptype�szWave_read.getcomptypecCs|jSr1��	_compnamer3r
r
r�getcompname�szWave_read.getcompnamecCs*t|��|��|��|��|��|���Sr1)rr>rArCr?rFrIr3r
r
r�	getparams�s�zWave_read.getparamscCsdSr1r
r3r
r
r�
getmarkers�szWave_read.getmarkerscCstd��dS�Nzno marks�r�r#�idr
r
r�getmark�szWave_read.getmarkcCs*|dks||jkrtd��||_d|_dS)Nrzposition not in ranger)r!rrr)r#�posr
r
r�setpos�szWave_read.setposcCs�|jr8|j�dd�|j|j}|r2|j�|d�d|_|dkrDdS|j�||j�}|jdkrxtjdkrxt	�
||j�}|jr�|r�|�|�}|jt|�|j
|j|_|S)Nr�r�big)rr�seekrr rr@�sys�	byteorder�audioop�byteswapr�lenr=)r#�nframesrQ�datar
r
r�
readframes�s

zWave_read.readframescCs�z$t�d|�d��\}|_|_}}Wntjk
r@td�YnX|tkr�zt�d|�d��d}Wntjk
r�td�YnX|dd|_|js�t	d��nt	d	|f��|js�t	d
��|j|j|_
d|_d|_dS)
Nz<HHLLH�z<H�r���bad sample widthzunknown format: %r�bad # of channels�NONEznot compressed)
�structZunpack_fromrr=rB�errorr�WAVE_FORMAT_PCMr@rr rErH)r#r%Z
wFormatTagZdwAvgBytesPerSecZwBlockAlign�	sampwidthr
r
rr�s$$
zWave_read._read_fmt_chunkN)rrr	r&r0r4r5r8r9r:r-r<r>r?rArCrFrIrJrKrPrRr]rr
r
r
rr_s*
c@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9S):rcCsRd|_t|t�r"t�|d�}||_z|�|�Wn|jrF|���YnXdS)N�wbr(r.r
r
rr0.s
zWave_write.__init__cCs@||_d|_d|_d|_d|_d|_d|_d|_d|_d|_	dS)NrF)
rrr=r@rBr!�_nframeswritten�_datawritten�_datalength�_headerwrittenr;r
r
rr&:szWave_write.initfpcCs|��dSr1r2r3r
r
rr4FszWave_write.__del__cCs|Sr1r
r3r
r
rr5IszWave_write.__enter__cGs|��dSr1r2r6r
r
rr8LszWave_write.__exit__cCs(|jrtd��|dkrtd��||_dS)N�0cannot change parameters after starting to writerrc)rkrr=)r#�	nchannelsr
r
r�setnchannelsRs
zWave_write.setnchannelscCs|jstd��|jS)Nznumber of channels not set)r=rr3r
r
rr>YszWave_write.getnchannelscCs0|jrtd��|dks|dkr&td��||_dS)Nrnrrrb)rkrr@)r#rhr
r
r�setsampwidth^s
zWave_write.setsampwidthcCs|jstd��|jS)Nzsample width not set)r@rr3r
r
rrAeszWave_write.getsampwidthcCs0|jrtd��|dkrtd��tt|��|_dS)Nrnrzbad frame rate)rkr�int�roundrB)r#�	framerater
r
r�setframeratejs
zWave_write.setframeratecCs|jstd��|jS)Nzframe rate not set)rBrr3r
r
rrCqszWave_write.getframeratecCs|jrtd��||_dS�Nrn)rkrr!)r#r[r
r
r�
setnframesvszWave_write.setnframescCs|jSr1�rjr3r
r
rr?{szWave_write.getnframescCs.|jrtd��|dkrtd��||_||_dS)Nrn)rdzunsupported compression type)rkrrErH)r#�comptype�compnamer
r
r�setcomptype~szWave_write.setcomptypecCs|jSr1rDr3r
r
rrF�szWave_write.getcomptypecCs|jSr1rGr3r
r
rrI�szWave_write.getcompnamecCsV|\}}}}}}|jrtd��|�|�|�|�|�|�|�|�|�||�dSrv)rkrrprqrurwr{)r#Zparamsrorhrtr[ryrzr
r
r�	setparams�s



zWave_write.setparamscCs8|jr|jr|jstd��t|j|j|j|j|j|j�S)Nznot all parameters set)r=r@rBrrr!rErHr3r
r
rrJ�s�zWave_write.getparamscCstd��dS)Nzsetmark() not supportedrM)r#rOrQ�namer
r
r�setmark�szWave_write.setmarkcCstd��dSrLrMrNr
r
rrP�szWave_write.getmarkcCsdSr1r
r3r
r
rrK�szWave_write.getmarkerscCs|jSr1rxr3r
r
rr<�szWave_write.tellcCs�t|ttf�st|��d�}|�t|��t|�|j|j}|j	rN|�	|�}|jdkrpt
jdkrpt�
||j�}|j�|�|jt|�7_|j||_dS)N�BrrT)r*�bytes�	bytearray�
memoryview�cast�_ensure_header_writtenrZr@r=rrVrWrXrYr�writerkrj)r#r\r[r
r
r�writeframesraw�s
zWave_write.writeframesrawcCs"|�|�|j|jkr|��dSr1)r�rlrk�_patchheader)r#r\r
r
r�writeframes�s
zWave_write.writeframescCsXz2|jr0|�d�|j|jkr&|��|j��W5d|_|j}|rRd|_|��XdS)Nr)rr)r-r�rlrkr��flushr;r
r
rr-�s
zWave_write.closecCs>|js:|jstd��|js"td��|js0td��|�|�dS)Nz# channels not specifiedzsample width not specifiedzsampling rate not specified)rmr=rr@rB�
_write_header)r#Zdatasizer
r
rr��sz!Wave_write._ensure_header_writtencCs�|j�d�|js$||j|j|_|j|j|j|_z|j��|_Wntt	fk
rfd|_YnX|j�t
�dd|jdddt|j|j
|j|j
|j|j|j|jdd��|jdk	r�|j��|_|j�t
�d	|j��d
|_dS)Nrz<L4s4sLHHLLHH4s�$rr�rar�<LT)rr�r!r=r@rlr<�_form_length_pos�AttributeError�OSErrorre�packrgrB�_data_length_posrm)r#Z
initlengthr
r
rr��s2
�
zWave_write._write_headercCs�|j|jkrdS|j��}|j�|jd�|j�t�dd|j��|j�|j	d�|j�t�d|j��|j�|d�|j|_dS)Nrr�r�)
rkrlrr<rUr�r�rer�r�)r#Zcurposr
r
rr��s
zWave_write._patchheaderN)rrr	r0r&r4r5r8rpr>rqrArurCrwr?r{rFrIr|rJr~rPrKr<r�r�r-r�r�r�r
r
r
rrs8


cCsJ|dkrt|d�r|j}nd}|dkr.t|�S|dkr>t|�Std��dS)N�moder')�rr')�wriz$mode must be 'r', 'rb', 'w', or 'wb')�hasattrr�rrr�r/r�r
r
rr�s
cCstjdtdd�t||d�S)NzBwave.openfp is deprecated since Python 3.7. Use wave.open instead.r_)�
stacklevel)r�)�warnings�warn�DeprecationWarningrr�r
r
rrs
�)N)N)r,�__all__�	ExceptionrrgZ_array_fmtsrXrerVr%r�collectionsrr�rrrrrr
r
r
r�<module>Js&�6d

__pycache__/abc.cpython-38.opt-2.pyc000064400000006216151153537600013104 0ustar00U

e5d��@s�dd�ZGdd�de�ZGdd�de�ZGdd�de�Zz,dd	lmZm	Z	m
Z
mZmZm
Z
mZmZWn*ek
r�dd
lmZmZde_YnXGdd
�d
e�ZGdd�ded�ZdS)cCs
d|_|S�NT)�__isabstractmethod__)�funcobj�r�/usr/lib64/python3.8/abc.py�abstractmethodsrcs eZdZdZ�fdd�Z�ZS)�abstractclassmethodTcsd|_t��|�dSr�r�super�__init__��self�callable��	__class__rrr
$szabstractclassmethod.__init__��__name__�
__module__�__qualname__rr
�
__classcell__rrrrrsrcs eZdZdZ�fdd�Z�ZS)�abstractstaticmethodTcsd|_t��|�dSrrrrrrr
1szabstractstaticmethod.__init__rrrrrr)src@seZdZdZdS)�abstractpropertyTN)rrrrrrrrr6sr�)�get_cache_token�	_abc_init�
_abc_register�_abc_instancecheck�_abc_subclasscheck�	_get_dump�_reset_registry�
_reset_caches)�ABCMetar�abccsNeZdZ�fdd�Zdd�Zdd�Zdd�Zdd
d�Zdd
�Zdd�Z	�Z
S)r cs"t�j||||f|�}t|�|S�N)r	�__new__r)�mcls�name�bases�	namespace�kwargs�clsrrrr#TszABCMeta.__new__cCs
t||�Sr")r�r)�subclassrrr�registerYszABCMeta.registercCs
t||�Sr")r)r)�instancerrr�__instancecheck__`szABCMeta.__instancecheck__cCs
t||�Sr")rr*rrr�__subclasscheck__dszABCMeta.__subclasscheck__NcCs�td|j�d|j��|d�tdt���|d�t|�\}}}}td|��|d�td|��|d�td|��|d�td|��|d�dS)	NzClass: �.)�filezInv. counter: z_abc_registry: z_abc_cache: z_abc_negative_cache: z_abc_negative_cache_version: )�printrrrr)r)r1�
_abc_registry�
_abc_cache�_abc_negative_cache�_abc_negative_cache_versionrrr�_dump_registryhs�
�zABCMeta._dump_registrycCst|�dSr")r�r)rrr�_abc_registry_cleartszABCMeta._abc_registry_clearcCst|�dSr")rr8rrr�_abc_caches_clearxszABCMeta._abc_caches_clear)N)rrrr#r,r.r/r7r9r:rrrrrr Gs

r c@seZdZdZdS)�ABCrN)rrr�	__slots__rrrrr;}sr;)�	metaclassN)r�classmethodr�staticmethodr�propertyr�_abcrrrrrrrr�ImportErrorZ_py_abcr r�typer;rrrr�<module>s

	,6__pycache__/profile.cpython-38.opt-2.pyc000064400000026506151153537600014023 0ustar00U

e5d�[�@stddlZddlZddlZddlZdddgZGdd�d�Zddd�Zdd	d�ZGd
d�d�Zdd�Z	e
d
krpe	�dS)�N�run�runctx�Profilec@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�_UtilscCs
||_dS�N)�profiler)�selfr�r	�/usr/lib64/python3.8/profile.py�__init__0sz_Utils.__init__cCsF|��}z(z|�|�Wntk
r,YnXW5|�|||�XdSr)r�_showr�
SystemExit)r�	statement�filename�sort�profr	r	r
r3s
z
_Utils.runcCsJ|��}z,z|�|||�Wntk
r0YnXW5|�|||�XdSr)rrrr
)rr�globals�localsrrrr	r	r
r<s
z
_Utils.runctxcCs"|dk	r|�|�n
|�|�dSr)�
dump_stats�print_stats)rrrrr	r	r
rEsz_Utils._showN)�__name__�
__module__�__qualname__rrrrr	r	r	r
r*s		r���cCstt��|||�Sr)rrr)rrrr	r	r
rQscCstt��|||||�Sr)rrr)rrrrrr	r	r
r^sc@s�eZdZdZd4dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Ze
e	eeeed�Z
dd�ZGdd�d�ZGdd�d�Zdd�Zdd�Zd5d!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/e_d6d0d1�Zd2d3�ZdS)7rrNcCs�i|_d|_d|_d|_|dkr&|j}||_|sHtj|_|_|j	|_
nl||_|��}zt|�}Wn"tk
r�||_|j	|_
Yn0X|dkr�|j
|_
n|j|_
|tfdd�}||_|��|_|�d�dS)N��cSs
||��Srr	)�timer�sumr	r	r
�get_time_timer�sz(Profile.__init__.<locals>.get_time_timerr)�timings�cur�cmd�c_func_name�bias�time�process_timer�get_time�trace_dispatch_i�
dispatcher�len�	TypeError�trace_dispatch�trace_dispatch_lr�t�
simulate_call)rrr#r-Zlengthrr	r	r
r�s0


zProfile.__init__cCs�|j}|�}|d|d|j|j}|dkr8|j|_|j||||�rd|�}|d|d|_n|�}|d|d||_dS)Nr��c_call�rr-r#rr"�dispatch)r�frame�event�argrr-�rr	r	r
r+�szProfile.trace_dispatchcCsT|j}|�|j|j}|dkr(|j|_|j||||�rD|�|_n|�||_dS�Nr0r1�rr3r4r5rr-r	r	r
r'�s
zProfile.trace_dispatch_icCs`|j}|�d|j|j}|dkr,|j|_|j||||�rL|�d|_n|�d||_dS)NgN@r0r1r8r	r	r
�trace_dispatch_mac�szProfile.trace_dispatch_maccCsT|j}|�|j|j}|dkr(|j|_|j||||�rD|�|_n|�||_dSr7)r&r-r#rr"r2)rr3r4r5r&r-r	r	r
r,�s
zProfile.trace_dispatch_lc	CsD|j\}}}}}}||k	r*|r*|�||�S|||||||f|_dS�Nr/)r �trace_dispatch_return)	rr3r-�rpt�rit�ret�rfn�rframe�rcurr	r	r
�trace_dispatch_exception�s
z Profile.trace_dispatch_exceptioncCs�|jr@|j|jdk	r@|j\}}}}}}t|tj�s@|�|d�|j}	|	j|	j|	j	f}
|dd|
||jf|_|j
}|
|kr�||
\}}
}}}||
d|||f||
<nddddif||
<dS�N���rr/)r �f_back�
isinstancer�
fake_framer;�f_code�co_filename�co_firstlineno�co_namer)rr3r-r<r=r>r?r@rAZfcode�fnr�cc�ns�tt�ct�callersr	r	r
�trace_dispatch_callszProfile.trace_dispatch_callc
Csndd|jf}|dd|||jf|_|j}||krX||\}}}}}	||d|||	f||<nddddif||<dS)Nrrr/)r"r r)
rr3r-rLrrMrNrOrPrQr	r	r
�trace_dispatch_c_callszProfile.trace_dispatch_c_callcCs�||jdk	r |�|jdd�|j\}}}}}}||}||}|\}	}
}}}
}|	|
|||||
|f|_|j}||\}}}}}|s�||}|d}||kr�||d||<nd||<||d||||f||<dSrC)r r;r)rr3r-r<r=r>r?rAZframe_totalZpptZpitZpetZpfn�pframeZpcurrrMrNrOrPrQr	r	r
r;"s"zProfile.trace_dispatch_return)�callZ	exception�returnr0Zc_exceptionZc_returncCs"|jdrdS||_|�|�dS)Nr)r r!r.)rr!r	r	r
�set_cmdXs
zProfile.set_cmdc@seZdZdd�Zdd�ZdS)zProfile.fake_codecCs||_||_||_d|_dS�Nr)rI�co_linerKrJ)rr�line�namer	r	r
r^szProfile.fake_code.__init__cCst|j|j|jf�Sr)�reprrIrYrK�rr	r	r
�__repr__dszProfile.fake_code.__repr__N)rrrrr^r	r	r	r
�	fake_code]sr_c@seZdZdd�ZdS)zProfile.fake_framecCs||_||_dSr)rHrE)r�codeZpriorr	r	r
rhszProfile.fake_frame.__init__N)rrrrr	r	r	r
rGgsrGcCsF|�dd|�}|jr |jd}nd}|�||�}|jd||d�dS)NZprofilerrDrU)r_r rGr2)rr[r`rTr3r	r	r
r.lszProfile.simulate_callcCsJ|j}|�|j}|jdr:|jd||jd|�d}q|�||_dS)NrrVrDr)r&r-r r2)rr&r-r	r	r
�simulate_cmd_completexs
zProfile.simulate_cmd_completercCs$ddl}|�|����|���dSrX)�pstatsZStatsZ
strip_dirsZ
sort_statsr)rrrbr	r	r
r�szProfile.print_statsc	Cs0t|d��}|��t�|j|�W5QRXdS)N�wb)�open�create_stats�marshal�dump�stats)r�file�fr	r	r
r�szProfile.dump_statscCs|��|��dSr)ra�snapshot_statsr]r	r	r
re�szProfile.create_statsc	Cs^i|_|j��D]H\}\}}}}}|��}d}|��D]}||7}q6|||||f|j|<qdSrX)rhr�items�copy�values)	r�funcrMrNrOrPrQZncZcallcntr	r	r
rk�s
zProfile.snapshot_statscCsddl}|j}|�|||�SrX)�__main__�__dict__r)rr!rp�dictr	r	r
r�szProfile.runc	Cs8|�|�t�|j�zt|||�W5t�d�X|Sr)rW�sys�
setprofiler(�exec)rr!rrr	r	r
r�s
zProfile.runctxc	Os�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��|�t|��t�	|j
�z|||�W�St�	d�XdS)	Nrz:descriptor 'runcall' of 'Profile' object needs an argumentrorz0Passing 'func' as keyword argument is deprecated)�
stacklevelz7runcall expected at least 1 positional argument, got %dr/)r)r*�pop�warnings�warn�DeprecationWarningrWr\rsrtr()�args�kwrrorxr	r	r
�runcall�s(

�
�zProfile.runcallz($self, func, /, *args, **kw)cCs<|jtk	rtd��|j}d|_z|�||�W�S||_XdS)Nz&Subclasses must override .calibrate().r)�	__class__rr*r#�_calibrate_inner)r�m�verboseZ
saved_biasr	r	r
�	calibrate�s
zProfile.calibratecCs|j}dd�}|fdd�}||�|�}||�|�}||}|rLtd|�t�}	|�}|	�dt�t��|�}||}
|r�td|
�d}d}|	j��D]0\\}
}}\}}}}}|d	kr�||7}||7}q�|r�td
|�td|�||dkr�td
|��||d|}|�rtd|�|S)NcSst|�D]}d}qdSr:��range)�n�i�xr	r	r
�f1sz$Profile._calibrate_inner.<locals>.f1cSst|�D]}|d�qdS)N�dr�)r�r�r�r	r	r
rjsz#Profile._calibrate_inner.<locals>.fz elapsed time without profiling =zf(m)zelapsed time with profiling =g)rjr�z!'CPU seconds' profiler reported =ztotal # calls =r/z internal error: total calls = %dg@z+mean stopwatch overhead per profile event =)	r&�printrrrrrrl�
ValueError)rr�r�r&r�rjZt0�t1Zelapsed_noprofile�pZelapsed_profileZtotal_callsZ
reported_timerrZ�funcnamerMrNrOrPrQZmeanr	r	r
r�sB

�



zProfile._calibrate_inner)NN)r)r)rrrr#rr+r'r9r,rBrRrSr;r2rWr_rGr.rarrrerkrrr}�__text_signature__r�rr	r	r	r
rgs@'
''�



+
c
Cs�ddl}ddlm}d}||d�}d|_|jdddd	dd
�|jddd
ddd�|jdddddd
�tjdd�s�|��t�d�|�	�\}}|tjdd�<|j
dk	r�|j�|j
�|_
t
|�dk�r�|jr�ddl}d}|j|dd�}nR|d}	tj�d|j�|	��t�|	��}
t|
��|	d�}W5QRX|	dddd�}zt||d|j
|j�Wn6tk
�r�}zdt_t�|j�W5d}~XYnXn|��|S)Nr)�OptionParserzMprofile.py [-o output_file_path] [-s sort] [-m module | scriptfile] [arg] ...)�usageFz-oz	--outfile�outfilezSave stats to <outfile>)�dest�help�defaultz-m�module�
store_truezProfile a library module.)r��actionr�r�z-sz--sortrz?Sort order when printing to stdout, based on pstats.Stats classrr/rz(run_module(modname, run_name='__main__'))�
run_module�modnamerurp)�__file__r�__package__�
__cached__)�osZoptparser�Zallow_interspersed_argsZ
add_optionrs�argvZprint_usage�exit�
parse_argsr��path�abspathr)r��runpyr��insert�dirname�io�	open_code�compile�readrr�BrokenPipeError�stdout�errno)r�r�r��parserZoptionsr{r�r`ZglobsZprogname�fp�excr	r	r
�main9s^

�
�
�

�� r�rp)Nr)Nr)r�rsr$rf�__all__rrrrr�rr	r	r	r
�<module>s

'

	U9__pycache__/runpy.cpython-38.opt-2.pyc000064400000014731151153537600013535 0ustar00U

e5d/�@sddlZddlZddlZddlZddlZddlZddlmZm	Z	ddgZ
Gdd�de�ZGdd�de�Z
dd	d
�Zd dd�Zefd
d�ZGdd�de�Zd!dd�Zd"dd�Zefdd�Zdd�Zd#dd�Zedk�r
eej�dk�r�edejd�nejd=eejd�dS)$�N)�	read_code�get_importer�
run_module�run_pathc@s$eZdZdd�Zdd�Zdd�ZdS)�_TempModulecCs||_t�|�|_g|_dS�N)�mod_name�types�
ModuleType�module�
_saved_module��selfr�r�/usr/lib64/python3.8/runpy.py�__init__sz_TempModule.__init__cCsB|j}z|j�tj|�Wntk
r0YnX|jtj|<|Sr)rr�append�sys�modules�KeyErrorrr
rrr�	__enter__ sz_TempModule.__enter__cGs.|jr|jdtj|j<n
tj|j=g|_dS�Nr)rrrr�r�argsrrr�__exit__)s
z_TempModule.__exit__N��__name__�
__module__�__qualname__rrrrrrrrs	rc@s$eZdZdd�Zdd�Zdd�ZdS)�_ModifiedArgv0cCs||_t�|_|_dSr)�value�object�_saved_value�	_sentinel)rr rrrr1sz_ModifiedArgv0.__init__cCs0|j|jk	rtd��tjd|_|jtjd<dS)NzAlready preserving saved valuer)r"r#�RuntimeErrorr�argvr )rrrrr5sz_ModifiedArgv0.__enter__cGs|j|_|jtjd<dSr)r#r r"rr%rrrrr;sz_ModifiedArgv0.__exit__Nrrrrrr0src
	Csn|dk	r|�|�|dkr(d}|}d}	n |j}|j}|j}	|dkrH|j}|j|||	d|||d�t||�|S)N)r�__file__�
__cached__�__doc__�
__loader__�__package__�__spec__)�update�loader�origin�cached�parent�exec)
�codeZrun_globals�init_globalsr�mod_spec�pkg_name�script_namer-�fnamer/rrr�	_run_code@s*
�
r8c	
Cs^|dkr|n|j}t|��6}t|��"|jj}t|||||||�W5QRXW5QRX|��Sr)r.rrr�__dict__r8�copy)	r2r3rr4r5r6r7�temp_module�mod_globalsrrr�_run_module_codeZs�r=c
Cs2|�d�r|d��|�d�\}}}|r�zt|�WnHtk
rz}z*|jdksh|j|krj|�|jd�sj�W5d}~XYnXtj�|�}|dk	r�t|d�s�ddl	m
}dj||d�}|t|��zt
j�|�}WnJttttfk
�r}	z"d}||�|t|	�j|	��|	�W5d}	~	XYnX|dk�r2|d	|��|jdk	�r�|d
k�sT|�d��r\|d��z|d}
t|
|�WS|k
�r�}z"|tjk�r��|d
||f��W5d}~XYnX|j}|dk�r�|d|��z|�|�}Wn2tk
�r}z|t|��|�W5d}~XYnX|dk�r(|d|��|||fS)N�.z#Relative module names not supported�__path__r)�warnz�{mod_name!r} found in sys.modules after import of package {pkg_name!r}, but prior to execution of {mod_name!r}; this may result in unpredictable behaviour)rr5z:Error while finding module specification for {!r} ({}: {})zNo module named %s�__main__z	.__main__z%Cannot use package as __main__ modulez3%s; %r is a package and cannot be directly executedz0%r is a namespace package and cannot be executedzNo code object available for %s)�
startswith�
rpartition�
__import__�ImportError�namerr�get�hasattr�warningsr@�format�RuntimeWarning�	importlib�util�	find_spec�AttributeError�	TypeError�
ValueError�typer�submodule_search_locations�endswith�_get_module_detailsr-�get_code)
r�errorr5�_�eZexistingr@�msg�specZexZ
pkg_main_namer-r2rrrrUhsd
��,
�
� 
rUc@seZdZdS)�_ErrorN)rrrrrrrr\�sr\Tc
Cs�z0|s|dkr t|t�\}}}ntt�\}}}Wn:tk
rj}zdtj|f}t�|�W5d}~XYnXtjdj}|r�|jtj	d<t
||dd|�S)NrAz%s: %sr)rUr\�_get_main_module_detailsr�
executable�exitrr9r.r%r8)rZ
alter_argvr4r2�excrZZmain_globalsrrr�_run_module_as_main�s�raFcCs@t|�\}}}|dkr|}|r,t||||�St|i|||�SdSr)rUr=r8)rr3�run_nameZ	alter_sysr4r2rrrr�sc
Cs�d}tj|}tj|=z\zt|�WW�NStk
rn}z*|t|�kr\|d|tjdf�|��W5d}~XYnXW5|tj|<XdS)NrAzcan't find %r module in %rr)rrrUrE�str�path)rWZ	main_nameZ
saved_mainr`rrrr]�s
��r]c	Csftj�t�|��}t�|��}t|�}W5QRX|dkr^t�|��}t|��|d�}W5QRX||fS)Nr1)	�osrd�abspath�fsdecode�io�	open_coder�compile�read)rbr7Zdecoded_path�fr2rrr�_get_code_from_file�srmcCs$|dkrd}|�d�d}t|�}d}t|�jdkrFt|�jdkrFd}t|td��sX|rxt||�\}}t|||||d�Stj	�
d|�znt
�\}}	}t|��P}
t|��<|
jj}t|||||	|���W5QR�W5QR�W�SQRXW5QRXW5ztj	�|�Wntk
�rYnXXdS)	Nz
<run_path>r>rFZimpZNullImporterT)r5r6)rCrrRrr�
isinstancermr=rrd�insert�removerQr]rrrr9r8r:)Z	path_namer3rbr5ZimporterZis_NullImporterr2r7rr4r;r<rrrr�s<
�
��8rA�z!No module specified for execution)�file)NNNNN)NNNNN)T)NNF)NN)r�importlib.machineryrL�importlib.utilrhr	reZpkgutilrr�__all__r!rrr8r=rErU�	Exceptionr\rarr]rmrr�lenr%�print�stderrrrrr�<module>
sL��
�
:
�

1
__pycache__/binhex.cpython-38.opt-2.pyc000064400000026523151153537600013637 0ustar00U

e5d�6�@s�ddlZddlZddlZddlZdddgZGdd�de�ZdZdZdZ	dZ
d	ZGd
d�d�Zdd
�Z
Gdd�d�ZGdd�d�ZGdd�d�ZGdd�d�Zdd�ZGdd�d�ZGdd�d�ZGdd�d�Zdd�ZdS)�N�binhex�hexbin�Errorc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/binhex.pyrs�i��@��c@seZdZdd�ZdS)�FInfocCsd|_d|_d|_dS)Nz????r)�Type�Creator�Flags��selfrrr	�__init__0szFInfo.__init__N)rrrrrrrr	r
/sr
c	Cstt�}t�|d��2}|�d�}d|kr,d|_|�dd�|��}W5QRXtj�	|�\}}|�
ddd�}|||dfS)	N�rbirZTEXT��:�-r
)r
�io�open�readr�seek�tell�os�path�split�replace)�name�finfo�fp�dataZdsize�dir�filerrr	�getfileinfo5s
r'c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�openrsrccGsdS�Nr�r�argsrrr	rCszopenrsrc.__init__cGsdS�N�rr*rrr	rFsz
openrsrc.readcGsdSr)rr*rrr	�writeIszopenrsrc.writecCsdSr)rrrrr	�closeLszopenrsrc.closeN)rrrrrr.r/rrrr	r(Bsr(c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�_HqxcoderenginecCs ||_d|_d|_td|_dS)Nr-r
)�ofpr$�hqxdata�LINELEN�linelen�rr1rrr	rRsz_Hqxcoderengine.__init__cCsh|j||_t|j�}|dd}|jd|�}|j|d�|_|sHdS|jt�|�|_|�d�dS)N�r)r$�lenr2�binascii�b2a_hqx�_flush)rr$ZdatalenZtodorrr	r.Xs
z_Hqxcoderengine.writecCsrd}|t|j�|jkrH||j}|j�|j||�d�t|_|}q|j|d�|_|rn|j�|jd�dS)Nr�
s:
)r7r2r4r1r.r3)rZforce�firstZlastrrr	r:cs
z_Hqxcoderengine._flushcCs6|jr|jt�|j�|_|�d�|j��|`dS)Nr
)r$r2r8r9r:r1r/rrrr	r/ns


z_Hqxcoderengine.closeN)rrrrr.r:r/rrrr	r0Osr0c@s$eZdZdd�Zdd�Zdd�ZdS)�_RlecoderenginecCs||_d|_dSr,)r1r$r5rrr	rxsz_Rlecoderengine.__init__cCs@|j||_t|j�tkrdSt�|j�}|j�|�d|_dSr,)r$r7�REASONABLY_LARGEr8�rlecode_hqxr1r.)rr$�rledatarrr	r.|sz_Rlecoderengine.writecCs0|jrt�|j�}|j�|�|j��|`dSr))r$r8r?r1r.r/)rr@rrr	r/�s

z_Rlecoderengine.closeN)rrrrr.r/rrrr	r=usr=c@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�BinHexc
Cs�|\}}}}d}t|t�r.|}t�|d�}d}zR|�d�t|�}	t|	�|_d|_|dkr`t	�}||_
||_|�||�t
|_Wn|r�|���YnXdS)NF�wbTs0(This file must be converted with BinHex 4.0)

:r)�
isinstance�strrrr.r0r=r1�crcr
�dlen�rlen�
_writeinfo�_DID_HEADER�stater/)
rZname_finfo_dlen_rlenr1r!r"rFrGZclose_on_errorZofnameZhqxerrrr	r�s*



zBinHex.__init__cCs�t|�}|dkrtd��t|g�|�d�d}|j|j}}t|t�rR|�d�}t|t�rf|�d�}||}t�	d|j
�}t�	d|j|j�}	||||	}
|�
|
�|��dS)N�?zFilename too longzlatin-1��>hz>ii)r7r�bytes�encoderrrCrD�struct�packrrFrG�_write�	_writecrc)rr!r"�nl�d�tpZcrZd2Zd3Zd4�inforrr	rH�s




zBinHex._writeinfocCs t�||j�|_|j�|�dSr))r8�crc_hqxrEr1r.�rr$rrr	rR�sz
BinHex._writecCs4|jdkrd}nd}|j�t�||j��d|_dS)NrrMz>H)rEr1r.rPrQ)rZfmtrrr	rS�s

zBinHex._writecrccCs0|jtkrtd��|jt|�|_|�|�dS)NzWriting data at the wrong time)rJrIrrFr7rRrYrrr	r.�s
zBinHex.writecCs,|jdkrtd|jf��|��t|_dS)NrzIncorrect data size, diff=%r)rFrrGrS�	_DID_DATArJrrrr	�
close_data�s
zBinHex.close_datacCsB|jtkr|��|jtkr$td��|jt|�|_|�|�dS)Nz'Writing resource data at the wrong time)rJrZr[rrGr7rRrYrrr	�
write_rsrc�s

zBinHex.write_rsrccCsx|jdkrdSzJ|jtkr"|��|jtkr4td��|jdkrNtd|jf��|��W5d|_|j}|`|��XdS)NzClose at the wrong timerz$Incorrect resource-datasize, diff=%r)rJr1r/rZr[rrGrSr5rrr	r/�s



zBinHex.closeN)rrrrrHrRrSr.r[r\r/rrrr	rA�s
rAc	Cs�t|�}t||�}t�|d��*}|�d�}|s0q<|�|�q |��W5QRXt|d�}|�d�}|shqt|�|�qX|�	�|�	�dS)Nr��)
r'rArrrr.r[r(r\r/)�inp�outr"r1�ifprUrrr	r�s



c@s$eZdZdd�Zdd�Zdd�ZdS)�_HqxdecoderenginecCs||_d|_dS)Nr)r`�eof�rr`rrr	rsz_Hqxdecoderengine.__init__cCs�d}|}|dkr�|jr|S|ddd}|j�|�}zt�|�\}|_Wq�Wntjk
rdYnX|j�d�}|s~td��||}q6||}|t|�}|s|jstd��q|S)Nr-rrr6�r
zPremature EOF on binhex file)rbr`rr8Za2b_hqxZ
Incompleterr7)rZtotalwtdZdecdata�wtdr$Z
decdatacur�newdatarrr	rs*


z_Hqxdecoderengine.readcCs|j��dSr)�r`r/rrrr	r/%sz_Hqxdecoderengine.closeN)rrrrrr/rrrr	ra�s rac@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�_RledecoderenginecCs||_d|_d|_d|_dS)Nr-r)r`�
pre_buffer�post_bufferrbrcrrr	r+sz_Rledecoderengine.__init__cCsD|t|j�kr"|�|t|j��|jd|�}|j|d�|_|Sr))r7rj�_fill)rre�rvrrr	r1s
z_Rledecoderengine.readcCs�|j|j�|d�|_|jjr>|jt�|j�|_d|_dSt|j�}|jdd�tdtkrl|d}nX|jdd�tkr�|d}n<|jdd�tdkr�|d}n|jdd�tkr�n|d	}|jt�|jd|��|_|j|d�|_dS)
Nrdr-���rLr6���r���r
)	rir`rrbrjr8Z
rledecode_hqxr7�RUNCHAR)rreZmarkrrr	rk8s*
�



�z_Rledecoderengine._fillcCs|j��dSr)rgrrrr	r/[sz_Rledecoderengine.closeN)rrrrrrkr/rrrr	rh(s#rhc@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�HexBincCsft|t�rt�|d�}|�d�}|s,td��|dkr6q|dkrqBqt|�}t|�|_d|_	|�
�dS)Nrr
zNo binhex data foundr;�:r)rCrDrrrrrarhr`rE�_readheader)rr`ZchZhqxifprrr	r_s


zHexBin.__init__cCs |j�|�}t�||j�|_|Sr))r`rr8rXrE)rr7r$rrr	�_readuszHexBin._readcCsNt�d|j�d��dd@}|jd@|_||jkrDtd|j|f��d|_dS)NrMrri��zCRC error, computed %x, read %x)rP�unpackr`rrEr)rZfilecrcrrr	�	_checkcrczs
�zHexBin._checkcrccCs�|�d�}|�t|��}|�d�}|��|dd�}|dd�}t�d|dd��d}t�d|dd	��d|_t�d|d	d��d|_||_t�|_||j_	||j_
||j_t|_
dS)
Nr
���	rM�rz>l�)rt�ordrvrPrurFrG�FNamer
rrrrIrJ)rr7Zfname�rest�typeZcreator�flagsrrr	rs�s

zHexBin._readheadercGsj|jtkrtd��|r,|d}t||j�}n|j}d}t|�|krZ||�|t|��}q6|j||_|S)NzRead data at wrong timerr-)rJrIr�minrFr7rt)r�nrlrrr	r�s
zHexBin.readcCs6|jtkrtd��|jr$|�|j�}|��t|_dS)Nzclose_data at wrong time)rJrIrrFrtrvrZ�rZdummyrrr	r[�s
zHexBin.close_datacGsZ|jtkr|��|jtkr$td��|r>|d}t||j�}n|j}|j||_|�|�S)Nz Read resource data at wrong timer)rJrIr[rZrr�rGrt)rr�rrr	�	read_rsrc�s

zHexBin.read_rsrccCsD|jdkrdSz|jr"|�|j�}|��W5d|_|j��XdSr))rJr`r/rGr�rvr�rrr	r/�s
zHexBin.closeN)rrrrrtrvrsrr[r�r/rrrr	rq^s

rqc	Cs�t|�}|j}|s|j}t�|d��"}|�d�}|s6qB|�|�q&W5QRX|��|�d�}|r�t	|d�}|�|�|�d�}|s�q�|�|�qv|�
�|�
�dS)NrBr])rqr
r}rrrr.r[r�r(r/)r^r_r`r"r1rUrrr	r�s(




)rrrPr8�__all__�	ExceptionrrIrZr>r3rpr
r'r(r0r=rArrarhrqrrrrr	�<module>s*


&^*6h__pycache__/mimetypes.cpython-38.opt-1.pyc000064400000037241151153537600014374 0ustar00U

e5d�T�
@s�dZddlZddlZddlZddlZzddlZWnek
rHdZYnXddddddd	d
ddd
ddg
Z	dddddddddg	Z
dadaGdd�d�Z
d&dd�Zd'dd�Zd(dd�Zd)dd	�Zd*dd
�Zd d�Zd!d"�Ze�d#d$�Zed%kr�e�dS)+a�Guess the MIME type of a file.

This module defines two useful functions:

guess_type(url, strict=True) -- guess the MIME type and encoding of a URL.

guess_extension(type, strict=True) -- guess the extension for a given MIME type.

It also contains the following, for tuning the behavior:

Data:

knownfiles -- list of files to parse
inited -- flag set when init() has been called
suffix_map -- dictionary mapping suffixes to suffixes
encodings_map -- dictionary mapping suffixes to encodings
types_map -- dictionary mapping suffixes to types

Functions:

init([files]) -- parse a list of files, default knownfiles (on Windows, the
  default values are taken from the registry)
read_mime_types(file) -- parse one file, return a dictionary or None
�N�
knownfiles�inited�	MimeTypes�
guess_type�guess_all_extensions�guess_extension�add_type�init�read_mime_types�
suffix_map�
encodings_map�	types_map�common_typesz/etc/mime.typesz/etc/httpd/mime.typesz/etc/httpd/conf/mime.typesz/etc/apache/mime.typesz/etc/apache2/mime.typesz$/usr/local/etc/httpd/conf/mime.typesz"/usr/local/lib/netscape/mime.typesz/usr/local/etc/mime.typesFc@s`eZdZdZddd�Zddd�Zddd	�Zdd
d�Zddd
�Zddd�Z	ddd�Z
ddd�ZdS)rz�MIME-types datastore.

    This datastore can handle information from mime.types-style files
    and supports basic determination of MIME type from a filename or
    URL, and can guess a reasonable extension given a MIME type.
    �TcCs�ts
t�t��|_t��|_iif|_iif|_t	�
�D]\}}|�||d�q:t�
�D]\}}|�||d�qZ|D]}|�
||�qvdS�NTF)rr	�_encodings_map_default�copyr�_suffix_map_defaultrr
�
types_map_inv�_types_map_default�itemsr�_common_types_default�read)�self�	filenames�strict�ext�type�namerr�!/usr/lib64/python3.8/mimetypes.py�__init__Bs



zMimeTypes.__init__cCs6||j||<|j|�|g�}||kr2|�|�dS)a�Add a mapping between a type and an extension.

        When the extension is already known, the new
        type will replace the old one. When the type
        is already known the extension will be added
        to the list of known extensions.

        If strict is true, information will be added to
        list of standard types, else to the list of non-standard
        types.
        N)r
r�
setdefault�append)rrrrZextsrrrrPszMimeTypes.add_typecCsrt�|�}tj�|�\}}|dkr�|�d�}|dkr8dS|�dd|�}|dkr\|d|�}n|d|�}d|ksxd|kr|d	}|dfSt�|�\}}||jkr�t�||j|�\}}q�||j	kr�|j	|}	t�|�\}}nd}	|j
d
}
||
kr�|
||	fS|��|
k�r|
|��|	fS|�r(d|	fS|j
d}
||
k�rH|
||	fS|��|
k�rf|
|��|	fSd|	fSdS)aUGuess the type of a file which is either a URL or a path-like object.

        Return value is a tuple (type, encoding) where type is None if
        the type can't be guessed (no or unknown suffix) or a string
        of the form type/subtype, usable for a MIME Content-type
        header; and encoding is None for no encoding or the name of
        the program used to encode (e.g. compress or gzip).  The
        mappings are table driven.  Encoding suffixes are case
        sensitive; type suffixes are first tried case sensitive, then
        case insensitive.

        The suffixes .tgz, .taz and .tz (case sensitive!) are all
        mapped to '.tar.gz'.  (This is table-driven too, using the
        dictionary suffix_map.)

        Optional `strict' argument when False adds a bunch of commonly found,
        but non-standard types.
        �data�,r)NN�;N�=�/�
text/plainTF)�os�fspath�urllib�parseZ
_splittype�find�	posixpath�splitextrrr
�lower)r�urlrZschemeZcommaZsemir�baser�encodingr
rrrrasB







zMimeTypes.guess_typecCsL|��}|jd�|g�}|sH|jd�|g�D]}||kr0|�|�q0|S)a�Guess the extensions for a file based on its MIME type.

        Return value is a list of strings giving the possible filename
        extensions, including the leading dot ('.').  The extension is not
        guaranteed to have been associated with any particular data stream,
        but would be mapped to the MIME type `type' by guess_type().

        Optional `strict' argument when false adds a bunch of commonly found,
        but non-standard types.
        TF)r0r�getr")rrr�
extensionsrrrrr�szMimeTypes.guess_all_extensionscCs|�||�}|sdS|dS)aGuess the extension for a file based on its MIME type.

        Return value is a string giving a filename extension,
        including the leading dot ('.').  The extension is not
        guaranteed to have been associated with any particular data
        stream, but would be mapped to the MIME type `type' by
        guess_type().  If no extension can be guessed for `type', None
        is returned.

        Optional `strict' argument when false adds a bunch of commonly found,
        but non-standard types.
        Nr)r)rrrr5rrrr�s
zMimeTypes.guess_extensionc	Cs(t|dd��}|�||�W5QRXdS)z�
        Read a single mime.types-format file, specified by pathname.

        If strict is true, information will be added to
        list of standard types, else to the list of non-standard
        types.
        �utf-8�r3N)�open�readfp)r�filenamer�fprrrr�szMimeTypes.readc	Cs�|��}|sq�|��}tt|��D]"}||ddkr"||d�=qFq"|sLq|d|dd�}}|D]}|�|d||�qfqdS)z�
        Read a single mime.types-format file.

        If strict is true, information will be added to
        list of standard types, else to the list of non-standard
        types.
        r�#N��.)�readline�split�range�lenr)	rr;r�lineZwords�ir�suffixesZsuffrrrr9�s	
zMimeTypes.readfpcCs�tsdSdd�}t�tjd���}||�D]�}zjt�||��T}|�d�sTW5QR�Wq(t�|d�\}}|tjkr|W5QR�Wq(|�|||�W5QRXWq(tk
r�Yq(Yq(Xq(W5QRXdS)z�
        Load the MIME types database from Windows registry.

        If strict is true, information will be added to
        list of standard types, else to the list of non-standard
        types.
        NcssJd}zt�||�}Wntk
r,YqFYnXd|kr<|V|d7}qdS)Nr�r=)�_winregZEnumKey�OSError)ZmimedbrDZctyperrr�
enum_types�s
z3MimeTypes.read_windows_registry.<locals>.enum_types�r>zContent Type)rG�OpenKeyZHKEY_CLASSES_ROOT�
startswithZQueryValueExZREG_SZrrH)rrrIZhkcrZ
subkeynameZsubkeyZmimetypeZdatatyperrr�read_windows_registry�s$

�
zMimeTypes.read_windows_registryN)rT)T)T)T)T)T)T)T)�__name__�
__module__�__qualname__�__doc__r rrrrrr9rMrrrrr:s


?



TcCstdkrt�t�||�S)a�Guess the type of a file based on its URL.

    Return value is a tuple (type, encoding) where type is None if the
    type can't be guessed (no or unknown suffix) or a string of the
    form type/subtype, usable for a MIME Content-type header; and
    encoding is None for no encoding or the name of the program used
    to encode (e.g. compress or gzip).  The mappings are table
    driven.  Encoding suffixes are case sensitive; type suffixes are
    first tried case sensitive, then case insensitive.

    The suffixes .tgz, .taz and .tz (case sensitive!) are all mapped
    to ".tar.gz".  (This is table-driven too, using the dictionary
    suffix_map).

    Optional `strict' argument when false adds a bunch of commonly found, but
    non-standard types.
    N)�_dbr	r)r1rrrrrscCstdkrt�t�||�S)a�Guess the extensions for a file based on its MIME type.

    Return value is a list of strings giving the possible filename
    extensions, including the leading dot ('.').  The extension is not
    guaranteed to have been associated with any particular data
    stream, but would be mapped to the MIME type `type' by
    guess_type().  If no extension can be guessed for `type', None
    is returned.

    Optional `strict' argument when false adds a bunch of commonly found,
    but non-standard types.
    N)rRr	r�rrrrrr's
cCstdkrt�t�||�S)a�Guess the extension for a file based on its MIME type.

    Return value is a string giving a filename extension, including the
    leading dot ('.').  The extension is not guaranteed to have been
    associated with any particular data stream, but would be mapped to the
    MIME type `type' by guess_type().  If no extension can be guessed for
    `type', None is returned.

    Optional `strict' argument when false adds a bunch of commonly found,
    but non-standard types.
    N)rRr	rrSrrrr8scCstdkrt�t�|||�S)aiAdd a mapping between a type and an extension.

    When the extension is already known, the new
    type will replace the old one. When the type
    is already known the extension will be added
    to the list of known extensions.

    If strict is true, information will be added to
    list of standard types, else to the list of non-standard
    types.
    N)rRr	r)rrrrrrrHscCs�da|dkstdkrBt�}tr&|��|dkr4t}qFtt|�}nt}|D]}tj�	|�rJ|�
|�qJ|ja|ja|j
da
|j
da|adSr)rrRrrGrMr�listr)�path�isfilerrrr
r)�files�db�filerrrr	Ys"

c
Cs`zt|dd�}Wntk
r&YdSX|�*t�}|�|d�|jdW5QR�SQRXdS)Nr6r7T)r8rHrr9r
)rY�frXrrrr
usc�CsXddddddd�aadddd	d
�aadddd
ddddddddddddddddddddddddddddddddddd d!d!d"d"d#d$d$d%d&d'd(d)d*d+d,d-d-d.d.d.d/d0d1d2d3d4d4d4d4d5d6d6d7d7d8d8d8d9d:d;d<d=d>d>d>d?d@dAdAdBdCdDdEdFdGdHdIdJdKdLdMdMdMdMdNdOdPdPdQdQdQdQdQdQdRdSdTdUdVdVdWdXdYdZdZdZdZdZd[d[d\d]d^d_��aad`dadadbdcdcdcddde�aadS)fNz.svg.gzz.tar.gzz.tar.bz2z.tar.xz)z.svgzz.tgzz.tazz.tzz.tbz2z.txzZgzip�compressZbzip2Zxz)z.gzz.Zz.bz2z.xzzapplication/javascriptzapplication/jsonzapplication/manifest+jsonzapplication/mswordzapplication/octet-streamzapplication/odazapplication/pdfzapplication/pkcs7-mimezapplication/postscriptzapplication/vnd.apple.mpegurlzapplication/vnd.ms-excelzapplication/vnd.ms-powerpointzapplication/wasmzapplication/x-bcpiozapplication/x-cpiozapplication/x-cshzapplication/x-dvizapplication/x-gtarzapplication/x-hdfzapplication/x-hdf5zapplication/x-latexzapplication/x-mifzapplication/x-netcdfzapplication/x-pkcs12zapplication/x-pn-realaudiozapplication/x-python-codezapplication/x-shzapplication/x-sharzapplication/x-shockwave-flashzapplication/x-sv4cpiozapplication/x-sv4crczapplication/x-tarzapplication/x-tclzapplication/x-texzapplication/x-texinfozapplication/x-troffzapplication/x-troff-manzapplication/x-troff-mezapplication/x-troff-mszapplication/x-ustarzapplication/x-wais-sourcezapplication/xmlzapplication/zipzaudio/basicz
audio/mpegzaudio/x-aiffzaudio/x-pn-realaudiozaudio/x-wavz	image/bmpz	image/gifz	image/iefz
image/jpegz	image/pngz
image/svg+xmlz
image/tiffzimage/vnd.microsoft.iconzimage/x-cmu-rasterzimage/x-ms-bmpzimage/x-portable-anymapzimage/x-portable-bitmapzimage/x-portable-graymapzimage/x-portable-pixmapzimage/x-rgbzimage/x-xbitmapzimage/x-xpixmapzimage/x-xwindowdumpzmessage/rfc822ztext/cssztext/csvz	text/htmlr(z
text/richtextztext/tab-separated-valuesz
text/x-pythonz
text/x-setextztext/x-sgmlztext/x-vcardztext/xmlz	video/mp4z
video/mpegzvideo/quicktimez
video/webmzvideo/x-msvideozvideo/x-sgi-movie)�z.jsz.mjsz.jsonz.webmanifestz.docz.dotz.wizz.binz.az.dllz.exez.oz.objz.soz.odaz.pdfz.p7cz.psz.aiz.epsz.m3uz.m3u8z.xlsz.xlbz.pptz.potz.ppaz.ppsz.pwzz.wasmz.bcpioz.cpioz.cshz.dviz.gtarz.hdfz.h5z.latexz.mifz.cdfz.ncz.p12z.pfxz.ramz.pycz.pyoz.shz.sharz.swfz.sv4cpioz.sv4crcz.tarz.tclz.texz.texiz.texinfoz.roffz.tz.trz.manz.mez.msz.ustarz.srcz.xslz.rdfz.wsdlz.xpdlz.zipz.auz.sndz.mp3z.mp2z.aifz.aifcz.aiffz.raz.wav�.bmpz.gifz.ief�.jpgz.jpez.jpegz.pngz.svgz.tiffz.tifz.icoz.rasr\z.pnmz.pbmz.pgmz.ppmz.rgbz.xbmz.xpmz.xwdz.emlz.mhtz.mhtmlz.nwsz.cssz.csvz.htmlz.htmz.txtz.batz.cz.hz.kshz.plz.rtxz.tsvz.pyz.etxz.sgmz.sgmlz.vcfz.xmlz.mp4z.mpegz.m1vz.mpaz.mpez.mpgz.movz.qtz.webmz.aviz.moviezapplication/rtfz
audio/midiz	image/jpgz
image/pictztext/xul)z.rtfz.midiz.midr]z.pictz.pctz.picz.xul)rrrrr
rrrrrrr�_default_mime_types�s8�

�
��

�r^c
sddl}d�d�fdd�	}z&|�tjdd�ddd	d
g�\}}Wn.|jk
rn}z|d|�W5d}~XYnXd}d}|D]4\}}|dkr�|d�q||dkr�d}q||d
kr|d}q||D]Z}	|r�t|	|�}
|
s�td|	�nt|
�q�t|	|�\}
}|
�std|	�q�td|
d|�q�dS)Nra4Usage: mimetypes.py [options] type

Options:
    --help / -h       -- print this message and exit
    --lenient / -l    -- additionally search of some common, but non-standard
                         types.
    --extension / -e  -- guess extension instead of type

More than one type argument may be given.
rJcs"t��|rt|�t�|�dS)N)�print�sys�exit)�code�msg�ZUSAGErr�usageFsz_main.<locals>.usager=Zhle�helpZlenient�	extension)z-hz--help)z-lz	--lenient)z-ez--extensionz I don't know anything about typeztype:z	encoding:)rJ)�getoptr`�argv�errorrr_r)rhreZopts�argsrcrrg�opt�argZgtypeZguessr3rrdr�_main7s8�


rn�__main__)T)T)T)T)N)rQr)r`r.Zurllib.parser+�winregrG�ImportError�__all__rrrRrrrrrr	r
r^rnrNrrrr�<module>s`
��W




5.__pycache__/calendar.cpython-38.pyc000064400000064672151153537600013202 0ustar00U

e5da�@s4dZddlZddlZddlZddlmZdddddd	d
ddd
ddddddddddddddgZeZ	Gdd�de�Z
Gdd�de�ZdZdZ
dd d!d d"d d"d d d"d d"d g
ZGd#d$�d$�ZGd%d&�d&�Zed'�Zed(�Zed)�Zed*�Zed+�\ZZZZZZZd,d�Zd-d	�Zd.d
�Zd/d�Z d0d1�Z!d2d3�Z"d4d5�Z#Gd6d�de$�Z%Gd7d�de%�Z&Gd8d�de%�Z'Gd9d:�d:�Z(Gd;d�de&�Z)Gd<d�de'�Z*e&�Z+e+j,Z-d=d�Z.e+j/Z0e+j1Z1e+j2Z3e+j4Z5e+j6Z6e+j7Z8e+j9Z:e+j;Z<d>Z=d?Z>e=e>fd@dA�Z?e=e>fdBdC�Z@dDZAe�BeAdd��C�ZDdEd�ZEdFdG�ZFeGdHk�r0eFejH�dS)Ia$Calendar printing functions

Note when comparing these calendars to the ones printed by cal(1): By
default, these calendars have Monday as the first day of the week, and
Sunday as the last (the European convention). Use setfirstweekday() to
set the first day of the week (0=Monday, 6=Sunday).�N)�repeat�IllegalMonthError�IllegalWeekdayError�setfirstweekday�firstweekday�isleap�leapdays�weekday�
monthrange�
monthcalendar�prmonth�month�prcal�calendar�timegm�
month_name�
month_abbr�day_name�day_abbr�Calendar�TextCalendar�HTMLCalendar�LocaleTextCalendar�LocaleHTMLCalendar�
weekheaderc@seZdZdd�Zdd�ZdS)rcCs
||_dS�N�r
)�selfr
�r� /usr/lib64/python3.8/calendar.py�__init__szIllegalMonthError.__init__cCs
d|jS)Nz!bad month number %r; must be 1-12r�rrrr�__str__szIllegalMonthError.__str__N��__name__�
__module__�__qualname__r r"rrrrrsc@seZdZdd�Zdd�ZdS)rcCs
||_dSr�r	)rr	rrrr  szIllegalWeekdayError.__init__cCs
d|jS)Nz7bad weekday number %r; must be 0 (Monday) to 6 (Sunday)r'r!rrrr""szIllegalWeekdayError.__str__Nr#rrrrrs�����c@sFeZdZdd�ed�D�Ze�ddd��dd�Zd	d
�Zdd�Zd
S)�_localized_monthcCs g|]}t�d|dd�j�qS�i�r(��datetime�date�strftime��.0�irrr�
<listcomp>4sz_localized_month.<listcomp>�rcCsdS)N�r)�xrrr�<lambda>5�z_localized_month.<lambda>cCs
||_dSr��format�rr=rrrr 7sz_localized_month.__init__cs4�j|}t|t�r&�fdd�|D�S|�j�SdS)Ncsg|]}|�j��qSrr<�r4�fr!rrr6=sz0_localized_month.__getitem__.<locals>.<listcomp>)�_months�
isinstance�slicer=�rr5Zfuncsrr!r�__getitem__:s

z_localized_month.__getitem__cCsdS)N�
rr!rrr�__len__Asz_localized_month.__len__N)	r$r%r&�rangerA�insertr rErGrrrrr-2s
r-c@s6eZdZdd�ed�D�Zdd�Zdd�Zdd	�Zd
S)�_localized_daycCs g|]}t�dd|d�j�qSr.r/r3rrrr6Hsz_localized_day.<listcomp>�cCs
||_dSrr<r>rrrr Jsz_localized_day.__init__cs4�j|}t|t�r&�fdd�|D�S|�j�SdS)Ncsg|]}|�j��qSrr<r?r!rrr6Psz._localized_day.__getitem__.<locals>.<listcomp>)�_daysrBrCr=rDrr!rrEMs

z_localized_day.__getitem__cCsdS�NrKrr!rrrrGTsz_localized_day.__len__N)r$r%r&rHrLr rErGrrrrrJEsrJz%Az%az%Bz%brKcCs$|ddko"|ddkp"|ddkS)z5Return True for leap years, False for non-leap years.�r�d�r)�yearrrrrdscCs@|d8}|d8}|d|d|d|d|d|dS)zFReturn number of leap years in range [y1, y2).
       Assume y1 <= y2.r(rNrOrPr)Zy1Zy2rrrriscCs8tj|krtjks&nd|d}t�|||���S)zBReturn weekday (0-6 ~ Mon-Sun) for year, month (1-12), day (1-31).i�rP)r0ZMINYEARZMAXYEARr1r	)rQr
�dayrrrr	qscCsJd|krdksnt|��t||d�}t||tko>t|�}||fS)zQReturn weekday (0-6 ~ Mon-Sun) and number of days (28-31) for
       year, month.r(r7)rr	�mdays�Februaryr)rQr
�day1�ndaysrrrr
xs
cCst||tkot|�Sr)rSrTr�rQr
rrr�	_monthlen�srXcCs$|dkr|ddfS||dfSdS)Nr(r7rrWrrr�
_prevmonth�srYcCs$|dkr|ddfS||dfSdS)Nr7r(rrWrrr�
_nextmonth�srZc@s�eZdZdZd#dd�Zdd�Zdd�Zeee�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd$dd�Zd%dd�Zd&d d!�Zd"S)'rzo
    Base calendar class. This class doesn't do any formatting. It simply
    provides data to subclasses.
    rcCs
||_dSr�r�rrrrrr �szCalendar.__init__cCs
|jdSrM�Z
_firstweekdayr!rrr�getfirstweekday�szCalendar.getfirstweekdaycCs
||_dSrr]r\rrrr�szCalendar.setfirstweekdayccs&t|j|jd�D]}|dVqdS)zt
        Return an iterator for one week of weekday numbers starting with the
        configured first one.
        rKN)rHr)rr5rrr�iterweekdays�szCalendar.iterweekdaysccs,|�||�D]\}}}t�|||�VqdS)z�
        Return an iterator for one month. The iterator will yield datetime.date
        values and will always iterate through complete weeks, so it will yield
        dates outside the specified month.
        N)�itermonthdays3r0r1)rrQr
�y�m�drrr�itermonthdates�szCalendar.itermonthdatesccsft||�\}}||jd}td|�EdHtd|d�EdH|j||d}td|�EdHdS)z�
        Like itermonthdates(), but will yield day numbers. For days outside
        the specified month the day number is 0.
        rKrNr()r
rrrH)rrQr
rUrV�days_before�
days_afterrrr�
itermonthdays�szCalendar.itermonthdaysccs0t|�||�|j�D]\}}||dfVqdS)z�
        Like itermonthdates(), but will yield (day number, weekday number)
        tuples. For days outside the specified month the day number is 0.
        rKN)�	enumeratergr)rrQr
r5rcrrr�itermonthdays2�szCalendar.itermonthdays2ccs�t||�\}}||jd}|j||d}t||�\}}t||�d}	t|	||	�D]}
|||
fVqXtd|d�D]}
|||
fVqxt||�\}}td|d�D]}
|||
fVq�dS)z�
        Like itermonthdates(), but will yield (year, month, day) tuples.  Can be
        used for dates outside of datetime.date range.
        rKr(N)r
rrYrXrHrZ)rrQr
rUrVrerfrarb�endrcrrrr`�szCalendar.itermonthdays3ccs<t|�||��D]&\}\}}}||||j|dfVqdS)z�
        Like itermonthdates(), but will yield (year, month, day, day_of_week) tuples.
        Can be used for dates outside of datetime.date range.
        rKN)rhr`r)rrQr
r5rarbrcrrr�itermonthdays4�szCalendar.itermonthdays4cs.t|�||����fdd�tdt��d�D�S)z�
        Return a matrix (list of lists) representing a month's calendar.
        Each row represents a week; week entries are datetime.date values.
        csg|]}�||d��qS�rKrr3�Zdatesrrr6�sz/Calendar.monthdatescalendar.<locals>.<listcomp>rrK)�listrdrH�len�rrQr
rrmr�monthdatescalendar�szCalendar.monthdatescalendarcs.t|�||����fdd�tdt��d�D�S)z�
        Return a matrix representing a month's calendar.
        Each row represents a week; week entries are
        (day number, weekday number) tuples. Day numbers outside this month
        are zero.
        csg|]}�||d��qSrlrr3��daysrrr6�sz/Calendar.monthdays2calendar.<locals>.<listcomp>rrK)rnrirHrorprrrr�monthdays2calendar�szCalendar.monthdays2calendarcs.t|�||����fdd�tdt��d�D�S)z�
        Return a matrix representing a month's calendar.
        Each row represents a week; days outside this month are zero.
        csg|]}�||d��qSrlrr3rrrrr6�sz.Calendar.monthdayscalendar.<locals>.<listcomp>rrK)rnrgrHrorprrrr�monthdayscalendar�szCalendar.monthdayscalendar�cs>��fdd�tttd�D����fdd�tdt����D�S)a'
        Return the data for the specified year ready for formatting. The return
        value is a list of month rows. Each month row contains up to width months.
        Each month contains between 4 and 6 weeks and each week contains 1-7
        days. Days are datetime.date objects.
        csg|]}���|��qSr)rqr3�rrQrrr6s�z.Calendar.yeardatescalendar.<locals>.<listcomp>r7csg|]}�||���qSrrr3��months�widthrrr6	sr�rH�Januaryro�rrQrzr�ryrrzrQr�yeardatescalendar�s�zCalendar.yeardatescalendarcs>��fdd�tttd�D����fdd�tdt����D�S)z�
        Return the data for the specified year ready for formatting (similar to
        yeardatescalendar()). Entries in the week lists are
        (day number, weekday number) tuples. Day numbers outside this month are
        zero.
        csg|]}���|��qSr)rtr3rwrrr6s�z.Calendar.yeardays2calendar.<locals>.<listcomp>r7csg|]}�||���qSrrr3rxrrr6srr{r}rr~r�yeardays2calendars�zCalendar.yeardays2calendarcs>��fdd�tttd�D����fdd�tdt����D�S)z�
        Return the data for the specified year ready for formatting (similar to
        yeardatescalendar()). Entries in the week lists are day numbers.
        Day numbers outside this month are zero.
        csg|]}���|��qSr)rur3rwrrr6s�z-Calendar.yeardayscalendar.<locals>.<listcomp>r7csg|]}�||���qSrrr3rxrrr6"srr{r}rr~r�yeardayscalendars�zCalendar.yeardayscalendarN)r)rv)rv)rv)r$r%r&�__doc__r r^r�propertyrr_rdrgrir`rkrqrtrurr�r�rrrrr�s"

	



c@sjeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
d�Z	ddd�Z
ddd�Zd dd�Zd!dd�Z
dS)"rzr
    Subclass of Calendar that outputs a calendar as a simple plain text
    similar to the UNIX program cal.
    cCst|�||�dd�dS)z3
        Print a single week (no newline).
        r8�rjN)�print�
formatweek�r�theweekrzrrr�prweek+szTextCalendar.prweekcCs |dkrd}nd|}|�|�S)z*
        Returns a formatted day.
        rr8z%2i��center)rrRr	rz�srrr�	formatday1szTextCalendar.formatdaycsd���fdd�|D��S)zA
        Returns a single week in a string (no newline).
        � c3s |]\}}��||��VqdSr�r��r4rcZwd�rrzrr�	<genexpr>?sz*TextCalendar.formatweek.<locals>.<genexpr>��joinr�rr�rr�;szTextCalendar.formatweekcCs(|dkrt}nt}||d|��|�S)z4
        Returns a formatted week day name.
        �	N)rrr�)rrRrz�namesrrr�
formatweekdayAszTextCalendar.formatweekdaycsd���fdd����D��S)z-
        Return a header for a week.
        r�c3s|]}��|��VqdSr�r�r3r�rrr�Osz0TextCalendar.formatweekheader.<locals>.<genexpr>�r�r_r�rr�r�formatweekheaderKszTextCalendar.formatweekheaderTcCs"t|}|rd||f}|�|�S)z0
        Return a formatted month name.
        �%s %r)rr��r�theyear�themonthrz�withyearr�rrr�formatmonthnameQszTextCalendar.formatmonthnamercCst|�||||�dd�dS)z+
        Print a month's calendar.
        r8r�N)r��formatmonth)rr�r��w�lrrrrZszTextCalendar.prmonthcCs�td|�}td|�}|�||d|dd�}|��}|d|7}||�|���7}|d|7}|�||�D]$}||�||���7}|d|7}ql|S)z@
        Return a month's calendar string (multi-line).
        r)r(rK�
)�maxr��rstripr�rtr�)rr�r�r�r�r��weekrrrr�`s

zTextCalendar.formatmonthr)r(�rvc	s�td|�}td|�}td|�}|ddd�g}|j}|t����|||d����|d|���|��t���|��D�]"\}}	t||dt	||ddd��}
|d|����fdd�|
D�}|t
|�|����|d|��fdd�|
D�}|t
|�|����|d|�td	d�|	D��}
t|
�D]f}g}|	D]6}|t|�k�rj|�d
�n|���|||���qL|t
|�|����|d|��q@q�d
�
|�S)zC
        Returns a year's calendar as a multi-line string.
        r)r(rKr�rFc3s|]}���|�d�VqdS)FN)r��r4�k)�colwidthrr�rrr��s�z*TextCalendar.formatyear.<locals>.<genexpr>c3s|]
}�VqdSrrr�)�headerrrr��scss|]}t|�VqdSr)ro)r4�calrrrr��sr8)r��append�reprr�r�r�rhr�rH�min�formatstringror�r�)rr�r�r��crb�v�ar5�rowryr�ZheadersZheight�jZweeksr�r)r�r�rr�r�
formatyearps<


&
$�zTextCalendar.formatyearcCst|�|||||�dd�dS)zPrint a year's calendar.r8r�N)r�r�)rr�r�r�r�rbrrr�pryear�szTextCalendar.pryearN)T)rr)rr)r)r(r�rv)rrr�rv)r$r%r&r�r�r�r�r�r�r�rr�r�r�rrrrr%s


	


%c@s�eZdZdZdddddddgZeZd	Zd
Zd
ZdZ	dZ
dd
�Zdd�Zdd�Z
dd�Zd dd�Zd!dd�Zd"dd�Zd#dd�ZdS)$rz4
    This calendar returns complete HTML pages.
    ZmonZtueZwedZthuZfriZsatZsunZnodayr
rQcCs(|dkrd|jSd|j||fSdS)z/
        Return a day as a table cell.
        rz<td class="%s">&nbsp;</td>z<td class="%s">%d</td>N)�cssclass_noday�
cssclasses)rrRr	rrrr��s
zHTMLCalendar.formatdaycs d��fdd�|D��}d|S)z8
        Return a complete week as a table row.
        r8c3s|]\}}��||�VqdSrr�r�r!rrr��sz*HTMLCalendar.formatweek.<locals>.<genexpr>�<tr>%s</tr>r�)rr�r�rr!rr��szHTMLCalendar.formatweekcCsd|j|t|fS)z:
        Return a weekday name as a table header.
        �<th class="%s">%s</th>)�cssclasses_weekday_headr)rrRrrrr��s�zHTMLCalendar.formatweekdaycs$d��fdd����D��}d|S)z<
        Return a header for a week as a table row.
        r8c3s|]}��|�VqdSrr�r3r!rrr��sz0HTMLCalendar.formatweekheader.<locals>.<genexpr>r�r�)rr�rr!rr��szHTMLCalendar.formatweekheaderTcCs0|rdt||f}ndt|}d|j|fS)z5
        Return a month name as a table row.
        �%s %sz%sz+<tr><th colspan="7" class="%s">%s</th></tr>)r�cssclass_month_head�rr�r�r�r�rrrr��s�zHTMLCalendar.formatmonthnamecCs�g}|j}|d|j�|d�||j|||d��|d�||���|d�|�||�D]}||�|��|d�q\|d�|d�d�|�S)z6
        Return a formatted month as a table.
        �=<table border="0" cellpadding="0" cellspacing="0" class="%s">r��r��</table>r8)r��cssclass_monthr�r�rtr�r�)rr�r�r�r�r�r�rrrr��s �
zHTMLCalendar.formatmonthrvcCs�g}|j}t|d�}|d|j�|d�|d||j|f�tttd|�D]V}t|t||d��}|d�|D](}|d�||j||d	d
��|d�qr|d�qN|d
�d�|�S)z?
        Return a formatted year as a table of tables.
        r(r�r�z,<tr><th colspan="%d" class="%s">%s</th></tr>r7rFz<tr>z<td>Fr�z</td>z</tr>r�r8)	r�r��
cssclass_year�cssclass_year_headrHr|r�r�r�)rr�rzr�r�r5ryrbrrrr��s,
��

zHTMLCalendar.formatyear�calendar.cssNcCs�|dkrt��}g}|j}|d|�|d�|d�|d�|d|�|dk	r^|d|�|d|�|d	�|d
�||�||��|d�|d�d
�|��|d�S)zB
        Return a formatted year as a complete HTML page.
        Nz$<?xml version="1.0" encoding="%s"?>
zn<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
z<html>
z<head>
zC<meta http-equiv="Content-Type" content="text/html; charset=%s" />
z4<link rel="stylesheet" type="text/css" href="%s" />
z<title>Calendar for %d</title>
z</head>
z<body>
z</body>
z</html>
r8�xmlcharrefreplace)�sys�getdefaultencodingr�r�r��encode)rr�rz�css�encodingr�r�rrr�formatyearpage
s$zHTMLCalendar.formatyearpage)T)T)rv)rvr�N)r$r%r&r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr�s 



c@s$eZdZdd�Zdd�Zdd�ZdS)�different_localecCs
||_dSr��locale)rr�rrrr #szdifferent_locale.__init__cCs"t�tj�|_t�tj|j�dSr)�_localeZ	getlocale�LC_TIME�	oldlocale�	setlocaler�r!rrr�	__enter__&szdifferent_locale.__enter__cGst�tj|j�dSr)r�r�r�r�)r�argsrrr�__exit__*szdifferent_locale.__exit__N)r$r%r&r r�r�rrrrr�"sr�c@s,eZdZdZddd�Zdd�Zdd	d
�ZdS)
r�
    This class can be passed a locale name in the constructor and will return
    month and weekday names in the specified locale. If this locale includes
    an encoding all strings containing month and weekday names will be returned
    as unicode.
    rNcCs&t�||�|dkrt��}||_dSr)rr r��getdefaultlocaler��rrr�rrrr 6szLocaleTextCalendar.__init__c
CsNt|j��:|dkrt}nt}||}|d|��|�W5QR�SQRXdS)Nr�)r�r�rrr�)rrRrzr��namerrrr�<sz LocaleTextCalendar.formatweekdayTc
CsDt|j��0t|}|r$d||f}|�|�W5QR�SQRXdS)Nr�)r�r�rr�r�rrrr�Es
z"LocaleTextCalendar.formatmonthname)rN)T�r$r%r&r�r r�r�rrrrr.s
	c@s,eZdZdZddd�Zdd�Zdd	d
�ZdS)
rr�rNcCs&t�||�|dkrt��}||_dSr)rr r�r�r�r�rrrr TszLocaleHTMLCalendar.__init__c
Cs<t|j��(t|}d|j||fW5QR�SQRXdS)Nr�)r�r�rr�)rrRr�rrrr�Zsz LocaleHTMLCalendar.formatweekdayTc
CsBt|j��.t|}|r$d||f}d|W5QR�SQRXdS)Nr�z.<tr><th colspan="7" class="month">%s</th></tr>)r�r�rr�rrrr�_s
z"LocaleHTMLCalendar.formatmonthname)rN)Tr�rrrrrMs
cCs(t|krtksnt|��|t_dSr)�MONDAY�SUNDAYrr�rr[rrrrls�r�cCstt|||��dS)z1Prints multi-column formatting for year calendarsN)r�r��Zcolsr��spacingrrrr=�sr=cs |d9}|��fdd�|D��S)zEReturns a string formatted from n strings, centered within n columns.r�c3s|]}|���VqdSrr�)r4r��r�rrr��szformatstring.<locals>.<genexpr>r�r�rr�rr��sr�i�cCs^|dd�\}}}}}}t�||d���t|d}|d|}|d|}	|	d|}
|
S)zBUnrelated but handy function to calculate Unix timestamp from GMT.Nr�r(��<)r0r1�	toordinal�
_EPOCH_ORD)�tuplerQr
rRZhourZminute�secondrsZhoursZminutesZsecondsrrrr�scCs�ddl}|��}|�d�}|�d�}|jddtddd�|jd	d
tddd�|jd
dtddd�|jddtddd�|jddddd�|jddddd�|jddddd�|jd d!d"d#d$d%�|jd&d'td(d)�|jd*d'td+d)�|�|dd��}|j�r|j�s|�d,�t	�
d�|j|jf}|jd-k�r�|j�rDt|d.�}nt
�}|j}|dk�rbt	��}t||jd/�}	t	jjj}
|jdk�r�|
|jtj��jf|	��n6|jdk�r�|
|j|jf|	��n|�d0�t	�
d�n�|j�r�t|d.�}nt�}t|j|jd1�}	|jdk�r$|j|	d2<|j|	d3<|jdk�rH|j tj��jf|	�}n2|jdk�rf|j |jf|	�}n|j!|j|jf|	�}t	jj}
|j�r�|�"|j�}t	jjj}
|
|�dS)4Nrztext only argumentszhtml only argumentsz-wz--widthr)z width of date column (default 2))�type�default�helpz-lz--linesr(z)number of lines for each week (default 1)z-sz	--spacingr�z"spacing between months (default 6)z-mz--monthsrvzmonths per row (default 3)z-cz--cssr�zCSS to use for page)r�r�z-Lz--localez.locale to be used from month and weekday namesz-ez
--encodingzencoding to use for outputz-tz--type�text)r��htmlzoutput type (text or html))r��choicesr�rQ�?zyear number (1-9999))�nargsr�r�r
zmonth number (1-12, text only)z/if --locale is specified --encoding is requiredr�r�)r�r�zincorrect number of arguments)r�r�r�rb)#�argparse�ArgumentParserZadd_argument_group�add_argument�int�
parse_argsr�r��errorr��exitr�rrr��dictr��stdout�buffer�writerQr�r0r1Ztodayr
rrrz�linesr�ryr�r�r�)r�r��parserZ	textgroupZ	htmlgroupZoptionsr�r�r�Zoptdictr��resultrrr�main�s�

����������







r�__main__)Ir�r�r0r�r��	itertoolsr�__all__�
ValueErrorr�rrr|rTrSr-rJrrrrrHr�ZTUESDAYZ	WEDNESDAYZTHURSDAYZFRIDAYZSATURDAYr�rrr	r
rXrYrZ�objectrrrr�rrr�r^rrrurr�r�r�r�rrr�r
r�rr�rZ	_colwidthZ_spacingr=r�ZEPOCHr1r�r�rrr$�argvrrrr�<module>s��
u	
h
__pycache__/ftplib.cpython-38.pyc000064400000066551151153537600012707 0ustar00U

e5d9��@sVdZddlZddlZddlmZdddddd	gZd
ZdZdZGd
d�de�Z	Gdd�de	�Z
Gdd�de	�ZGdd�de	�ZGdd�de	�Z
e	eefZdZdZGdd�d�ZzddlZWnek
r�dZYn0XejZGdd�de�Ze�d�e	eeejfZdadd�Zdadd�Zdd�Zdd�Z d d!�Z!d)d$d%�Z"d&d'�Z#e$d(k�rRe#�dS)*aSAn FTP client class and some helper functions.

Based on RFC 959: File Transfer Protocol (FTP), by J. Postel and J. Reynolds

Example:

>>> from ftplib import FTP
>>> ftp = FTP('ftp.python.org') # connect to host, default port
>>> ftp.login() # default, i.e.: user anonymous, passwd anonymous@
'230 Guest login ok, access restrictions apply.'
>>> ftp.retrlines('LIST') # list directory contents
total 9
drwxr-xr-x   8 root     wheel        1024 Jan  3  1994 .
drwxr-xr-x   8 root     wheel        1024 Jan  3  1994 ..
drwxr-xr-x   2 root     wheel        1024 Jan  3  1994 bin
drwxr-xr-x   2 root     wheel        1024 Jan  3  1994 etc
d-wxrwxr-x   2 ftp      wheel        1024 Sep  5 13:43 incoming
drwxr-xr-x   2 root     wheel        1024 Nov 17  1993 lib
drwxr-xr-x   6 1094     wheel        1024 Sep 13 19:07 pub
drwxr-xr-x   3 root     wheel        1024 Jan  3  1994 usr
-rw-r--r--   1 root     root          312 Aug  1  1994 welcome.msg
'226 Transfer complete.'
>>> ftp.quit()
'221 Goodbye.'
>>>

A nice test that reveals some of the network dialogue would be:
python ftplib.py -d localhost -l -p -l
�N)�_GLOBAL_DEFAULT_TIMEOUT�FTP�error_reply�
error_temp�
error_perm�error_proto�
all_errors��� c@seZdZdS)�ErrorN��__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/ftplib.pyr9src@seZdZdS)rNr
rrrrr:sc@seZdZdS)rNr
rrrrr;sc@seZdZdS)rNr
rrrrr<sc@seZdZdS)rNr
rrrrr=s�
s
c@s�eZdZdZdZdZeZeZ	dZ
dZdZdZ
dZdZddddedfdd	�Zd
d�Zdd
�Zd\dd�Zdd�Zdd�ZeZdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Z d'd(�Z!d)d*�Z"d+d,�Z#d-d.�Z$d/d0�Z%d1d2�Z&d]d3d4�Z'd^d5d6�Z(d_d7d8�Z)d`d:d;�Z*dad<d=�Z+dbd>d?�Z,dcd@dA�Z-dBdC�Z.dDdE�Z/dFdG�Z0dgfdHdI�Z1dJdK�Z2dLdM�Z3dNdO�Z4dPdQ�Z5dRdS�Z6dTdU�Z7dVdW�Z8dXdY�Z9dZd[�Z:dS)drayAn FTP client class.

    To create a connection, call the class using these arguments:
            host, user, passwd, acct, timeout

    The first four arguments are all strings, and have default value ''.
    timeout must be numeric and defaults to None if not passed,
    meaning that no timeout will be set on any ftp socket(s)
    If a timeout is passed, then this is now the default timeout for all ftp
    socket operations for this instance.

    Then use self.connect() with optional host and port argument.

    To download a file, use ftp.retrlines('RETR ' + filename),
    or ftp.retrbinary() with slightly different arguments.
    To upload a file, use ftp.storlines() or ftp.storbinary(),
    which have an open file as argument (see their definitions
    below for details).
    The download/upload functions first issue appropriate TYPE
    and PORT or PASV commands.
    r�Nr	zlatin-1FcCs0||_||_|r,|�|�|r,|�|||�dS�N)�source_address�timeout�connect�login)�self�host�user�passwd�acctrrrrr�__init__rs
zFTP.__init__cCs|Srr�rrrr�	__enter__{sz
FTP.__enter__c	GsN|jdk	rJz*z|��Wnttfk
r0YnXW5|jdk	rH|��XdSr)�sock�close�quit�OSError�EOFError)r�argsrrr�__exit__s


zFTP.__exit__����cCs�|dkr||_|dkr||_|dkr*||_|dk	r8||_t�d||j|j�tj|j|jf|j|jd�|_|jj	|_
|jjd|jd�|_
|��|_|jS)	awConnect to host.  Arguments are:
         - host: hostname to connect to (string, default previous host)
         - port: port to connect to (integer, default previous port)
         - timeout: the timeout to set against the ftp socket(s)
         - source_address: a 2-tuple (host, port) for the socket to bind
           to as its source address before connecting.
        rrr)Nzftplib.connect�r�r��encoding)r�portrr�sys�audit�socket�create_connectionr"�family�af�makefiler-�file�getresp�welcome)rrr.rrrrrr�s �

zFTP.connectcCs|jrtd|�|j��|jS)z`Get the welcome message from the server.
        (this is read and squirreled away by connect())z	*welcome*)�	debugging�print�sanitizer8r rrr�
getwelcome�szFTP.getwelcomecCs
||_dS)z�Set the debugging level.
        The required argument level means:
        0: no debugging output (default)
        1: print commands and responses but not body text etc.
        2: also print raw lines read and sent before stripping CR/LFN)r9)r�levelrrr�set_debuglevel�szFTP.set_debuglevelcCs
||_dS)z�Use passive or active mode for data transfers.
        With a false argument, use the normal PORT mode,
        With a true argument, use the PASV command.N)�
passiveserver)r�valrrr�set_pasv�szFTP.set_pasvcCsJ|dd�dkrBt|�d��}|dd�d|d||d�}t|�S)N�>�PASS �pass r�*)�len�rstrip�repr)r�s�irrrr;�s$zFTP.sanitizecCs`d|ksd|krtd��t�d||�|t}|jdkrHtd|�|��|j�|�	|j
��dS)N�
�
z4an illegal newline character should not be containedzftplib.sendcmdr	z*put*)�
ValueErrorr/r0�CRLFr9r:r;r"�sendall�encoder-�r�linerrr�putline�s
zFTP.putlinecCs$|jrtd|�|��|�|�dS)Nz*cmd*)r9r:r;rSrQrrr�putcmd�sz
FTP.putcmdcCs�|j�|jd�}t|�|jkr.td|j��|jdkrHtd|�|��|sPt�|dd�t	krn|dd�}n|dd�t	kr�|dd�}|S)Nr	�got more than %d bytesz*get*������)
r6�readline�maxlinerFrr9r:r;r&rNrQrrr�getline�s
zFTP.getlinecCs`|��}|dd�dkr\|dd�}|��}|d|}|dd�|kr$|dd�dkr$q\q$|S)N���-rL)rZ)rrR�codeZnextlinerrr�getmultiline�s�zFTP.getmultilinecCsp|��}|jrtd|�|��|dd�|_|dd�}|dkrD|S|dkrTt|��|dkrdt|��t|��dS)Nz*resp*r[r	>�1�3�2�4�5)r_r9r:r;Zlastresprrr)r�resp�crrrr7�szFTP.getrespcCs$|��}|dd�dkr t|��|S)z%Expect a response beginning with '2'.Nr	rb)r7r�rrerrr�voidresp�szFTP.voidrespcCsTdt}|jdkr"td|�|��|j�|t�|��}|dd�dkrPt|��|S)z�Abort a file transfer.  Uses out-of-band data.
        This does not follow the procedure from the RFC to send Telnet
        IP and Synch; that doesn't seem to work with the servers I've
        tried.  Instead, just send the ABOR command as OOB data.�ABORr	z*put urgent*Nr[��225�426�226)	�B_CRLFr9r:r;r"rO�MSG_OOBr_r�rrRrerrr�aborts
z	FTP.abortcCs|�|�|��S)z'Send a command and return the response.)rTr7�r�cmdrrr�sendcmds
zFTP.sendcmdcCs|�|�|��S)z8Send a command and expect a response beginning with '2'.)rTrhrrrrr�voidcmds
zFTP.voidcmdcCsB|�d�}t|d�t|d�g}||}dd�|�}|�|�S)zUSend a PORT command with the current host and the given
        port number.
        �.�zPORT �,)�splitrH�joinru)rrr.ZhbytesZpbytes�bytesrsrrr�sendports

zFTP.sendportcCsbd}|jtjkrd}|jtjkr$d}|dkr4td��dt|�|t|�dg}dd�|�}|�|�S)zESend an EPRT command with the current host and the given port number.rr	�zunsupported address familyrzEPRT �|)r4r1�AF_INETZAF_INET6rrHrzru)rrr.r4Zfieldsrsrrr�sendeprt&szFTP.sendeprtcCsltjd|jdd�}|��d}|j��d}|jtjkrF|�||�}n|�||�}|jt	k	rh|�
|j�|S)z3Create a new socket and send a PORT command for it.)rrr	)r3Zbacklogr)r1Z
create_serverr4Zgetsocknamer"rr|r�rr�
settimeout)rr"r.rrerrr�makeport3s
zFTP.makeportcCs\|jtjkr:t|�d��\}}|jr*|}qT|j��d}nt|�d�|j���\}}||fS)z<Internal: Does the PASV or EPSV handshake -> (address, port)�PASVrZEPSV)	r4r1r�parse227rt�trust_server_pasv_ipv4_addressr"Zgetpeername�parse229)rZuntrusted_hostr.rrrr�makepasv@szFTP.makepasvc
	Cs6d}|jr�|��\}}tj||f|j|jd�}zL|dk	rF|�d|�|�|�}|ddkrd|��}|ddkrxt|��Wn|�	��YnXn�|�
��r}|dk	r�|�d|�|�|�}|ddkr�|��}|ddkr�t|��|��\}}	|jtk	�r
|�
|j�W5QRX|dd�dk�r.t|�}||fS)	a�Initiate a transfer over the data connection.

        If the transfer is active, send a port command and the
        transfer command, and accept the connection.  If the server is
        passive, send a pasv command, connect to it, and start the
        transfer command.  Either way, return the socket for the
        connection and the expected size of the transfer.  The
        expected size may be None if it could not be determined.

        Optional `rest' argument can be a string that is sent as the
        argument to a REST command.  This is essentially a server
        marker used to tell the server to skip over any data up to the
        given marker.
        Nr*zREST %srrbr`r[�150)r?r�r1r2rrrtr7rr#r�Zacceptrr��parse150)
rrs�rest�sizerr.�connrer"Zsockaddrrrr�ntransfercmdLs>�



zFTP.ntransfercmdcCs|�||�dS)z0Like ntransfercmd() but returns only the socket.r)r�)rrsr�rrr�transfercmd�szFTP.transfercmdcCs�|sd}|sd}|sd}|dkr0|dkr0|d}|�d|�}|ddkrX|�d|�}|ddkrr|�d	|�}|dd
kr�t|��|S)zLogin, default anonymous.Z	anonymousr>rr]z
anonymous@zUSER rrarC�ACCT rb�rtr)rrrrrerrrr�s z	FTP.loginrc	Cs^|�d�|�||��:}|�|�}|s(q2||�qtdk	rLt|t�rL|��W5QRX|��S)a�Retrieve data in binary mode.  A new port is created for you.

        Args:
          cmd: A RETR command.
          callback: A single parameter callable to be called on each
                    block of data read.
          blocksize: The maximum number of bytes to read from the
                     socket at one time.  [default: 8192]
          rest: Passed to transfercmd().  [default: None]

        Returns:
          The response code.
        �TYPE IN)rur�Zrecv�
_SSLSocket�
isinstance�unwraprh)rrs�callback�	blocksizer�r��datarrr�
retrbinary�s


zFTP.retrbinaryc
Cs�|dkrt}|�d�}|�|���}|jd|jd���}|�|jd�}t|�|jkr`td|j��|j	dkrxt
dt|��|s~q�|d	d�tkr�|dd	�}n|d
d�dkr�|dd
�}||�q4t
dk	r�t|t
�r�|��W5QRXW5QRX|��S)ahRetrieve data in line mode.  A new port is created for you.

        Args:
          cmd: A RETR, LIST, or NLST command.
          callback: An optional single parameter callable that is called
                    for each line with the trailing CRLF stripped.
                    [default: print_line()]

        Returns:
          The response code.
        N�TYPE Ar+r,r	rUr}z*retr*rVrWrL)�
print_linertr�r5r-rXrYrFrr9r:rHrNr�r�r�rh)rrsr�rer��fprRrrr�	retrlines�s,
�

z
FTP.retrlinesc	Csl|�d�|�||��H}|�|�}|s(q@|�|�|r||�qtdk	rZt|t�rZ|��W5QRX|��S)a9Store a file in binary mode.  A new port is created for you.

        Args:
          cmd: A STOR command.
          fp: A file-like object with a read(num_bytes) method.
          blocksize: The maximum data size to read from fp and send over
                     the connection at once.  [default: 8192]
          callback: An optional single parameter callable that is called on
                    each block of data after it is sent.  [default: None]
          rest: Passed to transfercmd().  [default: None]

        Returns:
          The response code.
        r�N)rur��readrOr�r�r�rh)rrsr�r�r�r�r��bufrrr�
storbinary�s



zFTP.storbinaryc	Cs�|�d�|�|���}|�|jd�}t|�|jkrBtd|j��|sHq�|dd�tkrx|dtkrp|dd�}|t}|�|�|r||�qtdk	r�t	|t�r�|�
�W5QRX|��S)ahStore a file in line mode.  A new port is created for you.

        Args:
          cmd: A STOR command.
          fp: A file-like object with a readline() method.
          callback: An optional single parameter callable that is called on
                    each line after it is sent.  [default: None]

        Returns:
          The response code.
        r�r	rUrVNrW)rur�rXrYrFrrnrOr�r�r�rh)rrsr�r�r�r�rrr�	storlines�s"


z
FTP.storlinescCsd|}|�|�S)zSend new account name.r��ru)rZpasswordrsrrrrszFTP.acctcGs0d}|D]}|d|}qg}|�||j�|S)zBReturn a list of files in a given directory (default the current).ZNLST� )r��append)rr'rs�arg�filesrrr�nlstszFTP.nlstcGshd}d}|dd�r>t|d�td�kr>|dd�|d}}|D]}|rB|d|}qB|�||�dS)aList a directory in long form.
        By default list current directory to stdout.
        Optional last argument is callback function; all
        non-empty arguments before it are concatenated to the
        LIST command.  (This *should* only be used for a pathname.)ZLISTNrWrr�)�typer�)rr'rs�funcr�rrr�dir(s zFTP.dirc
cs�|r|�dd�|�d�|r*d|}nd}g}|�||j�|D]\}|�t��d�\}}}i}	|dd��d�D] }
|
�d�\}}}||	|��<qt||	fVqDdS)	a<List a directory in a standardized format by using MLSD
        command (RFC-3659). If path is omitted the current directory
        is assumed. "facts" is a list of strings representing the type
        of information desired (e.g. ["type", "size", "perm"]).

        Return a generator object yielding a tuple of two elements
        for every file found in path.
        First element is the file name, the second one is a dictionary
        including a variable number of "facts" depending on the server
        and whether "facts" argument has been provided.
        z
OPTS MLST �;zMLSD %sZMLSDr�NrW�=)	rtrzr�r�rGrN�	partitionry�lower)
r�pathZfactsrs�linesrRZfacts_found�_�name�entryZfact�key�valuerrr�mlsd7s
zFTP.mlsdcCs0|�d|�}|ddkr"t|��|�d|�S)zRename a file.zRNFR rrazRNTO )rtrru)rZfromnameZtonamererrr�renameSsz
FTP.renamecCs.|�d|�}|dd�dkr"|St|��dS)zDelete a file.zDELE Nr[>�250�200r�)r�filenamererrr�deleteZsz
FTP.deletec
Csp|dkrRz|�d�WStk
rN}z|jddd�dkr>�W5d}~XYq^Xn|dkr^d}d	|}|�|�S)
zChange to a directory.z..ZCDUPrNr[�500rrvzCWD )rurr')r�dirname�msgrsrrr�cwdbszFTP.cwdcCs:|�d|�}|dd�dkr6|dd���}t|�SdS)zRetrieve the size of a file.zSIZE Nr[Z213)rt�strip�int)rr�rerIrrrr�oszFTP.sizecCs$|�d|�}|�d�sdSt|�S)z+Make a directory, return its full pathname.zMKD �257r�ru�
startswith�parse257)rr�rerrr�mkdws
zFTP.mkdcCs|�d|�S)zRemove a directory.zRMD r�)rr�rrr�rmd�szFTP.rmdcCs |�d�}|�d�sdSt|�S)z!Return current working directory.ZPWDr�rr�rgrrr�pwd�s

zFTP.pwdcCs|�d�}|��|S)zQuit, and close the connection.ZQUIT)rur#rgrrrr$�s
zFTP.quitcCsDz |j}d|_|dk	r|��W5|j}d|_|dk	r>|��XdS)z8Close the connection without assuming anything about it.N)r"r#r6)rr"r6rrrr#�sz	FTP.close)rrr)N)N)N)rrr)rN)N)rNN)N);rrr�__doc__r9r�FTP_PORTr.�MAXLINErYr"r6r8r?r-r�rrr!r(rr<r>�debugrAr;rSrTrZr_r7rhrqrtrur|r�r�r�r�r�rr�r�r�r�rr�r�r�r�r�r�r�r�r�r�r$r#rrrrrJsp�
	






7



#

	
		c	@sneZdZdZejZdddddddedf	dd�Zddd�Z	d	d
�Z
dd�Zd
d�Zdd�Z
ddd�Zdd�ZdS)�FTP_TLSa�A FTP subclass which adds TLS support to FTP as described
        in RFC-4217.

        Connect as usual to port 21 implicitly securing the FTP control
        connection before authenticating.

        Securing the data connection requires user to explicitly ask
        for it by calling prot_p() method.

        Usage example:
        >>> from ftplib import FTP_TLS
        >>> ftps = FTP_TLS('ftp.python.org')
        >>> ftps.login()  # login anonymously previously securing control channel
        '230 Guest login ok, access restrictions apply.'
        >>> ftps.prot_p()  # switch to secure data connection
        '200 Protection level set to P'
        >>> ftps.retrlines('LIST')  # list directory content securely
        total 9
        drwxr-xr-x   8 root     wheel        1024 Jan  3  1994 .
        drwxr-xr-x   8 root     wheel        1024 Jan  3  1994 ..
        drwxr-xr-x   2 root     wheel        1024 Jan  3  1994 bin
        drwxr-xr-x   2 root     wheel        1024 Jan  3  1994 etc
        d-wxrwxr-x   2 ftp      wheel        1024 Sep  5 13:43 incoming
        drwxr-xr-x   2 root     wheel        1024 Nov 17  1993 lib
        drwxr-xr-x   6 1094     wheel        1024 Sep 13 19:07 pub
        drwxr-xr-x   3 root     wheel        1024 Jan  3  1994 usr
        -rw-r--r--   1 root     root          312 Aug  1  1994 welcome.msg
        '226 Transfer complete.'
        >>> ftps.quit()
        '221 Goodbye.'
        >>>
        rNc
	Cs�|dk	r|dk	rtd��|dk	r0|dk	r0td��|dk	s@|dk	rVddl}
|
�dtd�||_||_|dkr|tj|j||d�}||_	d|_
t�|||||||	�dS)Nz4context and keyfile arguments are mutually exclusivez5context and certfile arguments are mutually exclusiverzAkeyfile and certfile are deprecated, use a custom context insteadr})�certfile�keyfileF)
rM�warnings�warn�DeprecationWarningr�r��sslZ_create_stdlib_context�ssl_version�context�_prot_prr)rrrrrr�r�r�rrr�rrrr�s(��zFTP_TLS.__init__TcCs*|rt|jtj�s|��t�||||�Sr)r�r"r��	SSLSocket�authrr)rrrrZsecurerrrr�sz
FTP_TLS.logincCsft|jtj�rtd��|jtjkr.|�d�}n
|�d�}|jj	|j|j
d�|_|jjd|jd�|_
|S)z2Set up secure control connection by using TLS/SSL.zAlready using TLSzAUTH TLSzAUTH SSL�Zserver_hostnamer+)�moder-)r�r"r�r�rMr�ZPROTOCOL_TLSrur��wrap_socketrr5r-r6rgrrrr��s

�zFTP_TLS.authcCs0t|jtj�std��|�d�}|j��|_|S)z/Switch back to a clear-text control connection.z
not using TLSZCCC)r�r"r�r�rMrur�rgrrr�ccc�s

zFTP_TLS.ccccCs|�d�|�d�}d|_|S)zSet up secure data connection.zPBSZ 0zPROT PT�rur�rgrrr�prot_p�s

zFTP_TLS.prot_pcCs|�d�}d|_|S)z"Set up clear text data connection.zPROT CFr�rgrrr�prot_cs
zFTP_TLS.prot_ccCs2t�|||�\}}|jr*|jj||jd�}||fS)Nr�)rr�r�r�r�r)rrsr�r�r�rrrr�s�zFTP_TLS.ntransfercmdcCs8dt}|j�|�|��}|dd�dkr4t|��|S)Nrir[rj)rnr"rOr_rrprrrrqsz
FTP_TLS.abort)rrrT)N)rrrr�r�ZPROTOCOL_TLS_CLIENTr�rrrr�r�r�r�r�rqrrrrr��s 
�



r�cCs\|dd�dkrt|��tdkr<ddl}|�d|j|jB�at�|�}|sNdSt|�d��S)z�Parse the '150' response for a RETR request.
    Returns the expected transfer size or None; size is not guaranteed to
    be present in the 150 message.
    Nr[r�rz150 .* \((\d+) bytes\)r	)	r�_150_re�re�compile�
IGNORECASE�ASCII�matchr��group)rer��mrrrr�)s
�
r�cCs�|dd�dkrt|��tdkr6ddl}|�d|j�at�|�}|sLt|��|��}d�|dd��}t	|d�d>t	|d	�}||fS)
z�Parse the '227' response for a PASV request.
    Raises error_proto if it does not contain '(h1,h2,h3,h4,p1,p2)'
    Return ('host.addr.as.numbers', port#) tuple.Nr[Z227rz#(\d+),(\d+),(\d+),(\d+),(\d+),(\d+)rvr\�rB)
r�_227_rer�r�r��searchr�groupsrzr�)rer�r�Znumbersrr.rrrr�=s
r�cCs�|dd�dkrt|��|�d�}|dkr2t|��|�d|d�}|dkrRt|��||d||dkrrt|��||d|��||d�}t|�dkr�t|��|d}t|d�}||fS)	z�Parse the '229' response for an EPSV request.
    Raises error_proto if it does not contain '(|||port|)'
    Return ('host.addr.as.numbers', port#) tuple.Nr[Z229�(r�)r	rB)r�findrryrFr�)reZpeer�left�right�partsrr.rrrr�Qs 
r�cCs�|dd�dkrt|��|dd�dkr,dSd}d}t|�}||kr�||}|d}|dkrz||ks�||dkrrq�|d}||}q<|S)	z�Parse the '257' response for a MKD or PWD request.
    This is a response to a MKD or PWD request: a directory name.
    Returns the directoryname in the 257 reply.Nr[r�rBz "rr	�")rrF)rer�rJ�nrfrrrr�gs 
r�cCst|�dS)z+Default retrlines callback to print a line.N)r:)rRrrrr�~sr�r�Ic	Cs�|s|}d|}|�|�|�|�t|�d��\}}|�||�|�d|�}|dd�dkrdt�|�d|�}|dd�dkr�t�|��|��dS)z+Copy file from one FTP-instance to another.zTYPE r�zSTOR Nr[>�125r��RETR )rur�rtr|rrh)	�sourceZ
sourcename�targetZ
targetnamer�Z
sourcehostZ
sourceportZtreplyZsreplyrrr�ftpcp�s

r�cCs�ttj�dkr"ttj�t�d�ddl}d}d}tjddkrR|d}tjd=q2tjddd�dkr�tjddd�}tjd=tjd}t|�}|�	|�d}}}z|�|�}Wn(t
k
r�|dk	r�tj�d�Yn:Xz|�
|�\}}}Wn"tk
�rtj�d	�YnX|�|||�tjdd�D]�}	|	dd�d
k�r`|�|	dd��nt|	dd�dk�r�d}
|	dd��r�|
d|	dd�}
|�|
�}n0|	d
k�r�|�|j�n|�d|	tjjd��q6|��dS)z�Test program.
    Usage: ftp [-d] [-r[file]] host [-l[dir]] [-d[dir]] [-p] [file] ...

    -d dir
    -l list
    -p password
    r}rNr	z-dz-rrz5Could not open account file -- using anonymous login.z$No account -- using anonymous login.z-lZCWDr�z-pr�i)rFr/�argvr:�testr��exit�netrcrr>r%�stderr�writeZauthenticators�KeyErrorrr�rtrAr?r��stdoutr$)r�r9ZrcfilerZftpZuseridrrZnetrcobjr6rsrerrrr��sV	




�


�r��__main__)rr�)%r�r/r1r�__all__ror�r��	Exceptionrrrrrr%r&rrNrnrr��ImportErrorr�r�r�r�ZSSLErrorr�r�r�r�r�r�r�r�r�rrrrr�<module>sR&
�
Z
|

9
__pycache__/imghdr.cpython-38.pyc000064400000010030151153537600012656 0ustar00U

e5d��@s2dZddlmZdgZd%dd�ZgZdd�Ze�e�dd	�Ze�e�d
d�Z	e�e	�dd
�Z
e�e
�dd�Ze�e�dd�Ze�e�dd�Z
e�e
�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�d d!�Zd"d#�Zed$k�r.e�dS)&z<Recognize image file formats based on their first few bytes.�)�PathLike�whatNcCs�d}zp|dkrNt|ttf�r2t|d�}|�d�}n|��}|�d�}|�|�tD]}|||�}|rR|W�SqRW5|r�|��XdS)N�rb� )	�close�
isinstance�strr�open�read�tell�seek�tests)�file�h�f�locationZtf�res�r�/usr/lib64/python3.8/imghdr.pyrs 




cCs|dd�dkrdSdS)z JPEG data in JFIF or Exif format��
)sJFIFsExifZjpegNr�rrrrr�	test_jpeg%srcCs|�d�rdSdS)Ns�PNG

Zpng��
startswithrrrr�test_png,s
rcCs|dd�dkrdSdS)zGIF ('87 and '89 variants)Nr)sGIF87asGIF89aZgifrrrrr�test_gif2srcCs|dd�dkrdSdS)z-TIFF (can be in Motorola or Intel byte order)N�)sMMsIIZtiffrrrrr�	test_tiff9srcCs|�d�rdSdS)zSGI image librarys�ZrgbNrrrrr�test_rgb@s
rcCs<t|�dkr8|dtd�kr8|ddkr8|ddkr8dSd	S)
zPBM (portable bitmap)�r�P�s14r� 	

ZpbmN��len�ordrrrr�test_pbmGs�
�
�r'cCs<t|�dkr8|dtd�kr8|ddkr8|ddkr8dSd	S)
zPGM (portable graymap)r rr!r"s25rr#ZpgmNr$rrrr�test_pgmOs�
�
�r(cCs<t|�dkr8|dtd�kr8|ddkr8|ddkr8dSd	S)
zPPM (portable pixmap)r rr!r"s36rr#ZppmNr$rrrr�test_ppmWs�
�
�r)cCs|�d�rdSdS)zSun raster filesY�j�ZrastNrrrrr�	test_rast_s
r*cCs|�d�rdSdS)zX bitmap (X10 or X11)s#define ZxbmNrrrrr�test_xbmfs
r+cCs|�d�rdSdS)NsBMZbmprrrrr�test_bmpms
r,cCs"|�d�r|dd�dkrdSdS)NsRIFF��sWEBPZwebprrrrr�	test_webpssr/cCs|�d�rdSdS)Nsv/1Zexrrrrrr�test_exrys
r0cCs�ddl}d}|jdd�r8|jddkr8|jdd�=d}z8|jdd�r`t|jdd�|d�ntdg|d�Wn*tk
r�|j�d�|�d�YnXdS)Nrr"z-rr�.z
[Interrupted]
)�sys�argv�testall�KeyboardInterrupt�stderr�write�exit)r2�	recursiverrr�test�sr:c	Cs�ddl}ddl}|D]�}|j�|�r~t|ddd�|s<|rttd�ddl}|�|j�|�|�d��}t||d�q�td�qt|ddd�|j	�
�ztt|��Wqtk
r�td	�YqXqdS)
Nrz/:� )�endzrecursing down:�*z*** directory (use -r) ***�:z*** not found ***)
r2�os�path�isdir�print�glob�join�escaper4�stdout�flushr�OSError)�listr9Ztoplevelr2r?�filenamerC�namesrrrr4�s"

r4�__main__)N)�__doc__r?r�__all__rr
r�appendrrrrr'r(r)r*r+r,r/r0r:r4�__name__rrrr�<module>sD














__pycache__/dummy_threading.cpython-38.opt-2.pyc000064400000001343151153537600015533 0ustar00U

e5d�
�	@s�ddlmZddlZdZdZdZz�dekr6edZ	dZeded<dekr\edZdZed=dekrvedZdZed=ddl
Z
eded	<ed=eded
<ed=ddlTddlmZW5er�eed<[[er�eed<[[er�e	ed<[	ned=[[[XdS)
�)�modulesNF�	threadingZ_threading_local�_threadT�
_dummy_thread�_dummy_threadingZ_dummy__threading_local)�*)�__all__)
�sysrZsys_modulesrZholding_threadZholding_threadingZholding__threading_localZheld_threadingZheld__threading_localZheld_threadrrr�r
r
�'/usr/lib64/python3.8/dummy_threading.py�<module>	sN__pycache__/enum.cpython-38.opt-1.pyc000064400000062554151153537600013331 0ustar00U

e5d���@s�ddlZddlmZmZddddddd	gZd
d�Zdd
�Zdd�Zdd�Ze	�Z
Gdd�d�ZGdd�de�Z
dZGdd�de�ZGdd�ded�ZGdd�dee�Zdd�ZGdd�de�ZGdd�dee�Zdd�Zdd	�Zd d!�Zd"d#�ZdS)$�N)�MappingProxyType�DynamicClassAttribute�EnumMeta�Enum�IntEnum�Flag�IntFlag�auto�uniquecCst|d�pt|d�pt|d�S)z?
    Returns True if obj is a descriptor, False otherwise.
    �__get__�__set__�
__delete__)�hasattr)�obj�r�/usr/lib64/python3.8/enum.py�_is_descriptors

��rcCsLt|�dkoJ|dd�|dd�ko.dknoJ|ddkoJ|ddkS)z=
    Returns True if a __dunder__ name, False otherwise.
    �N�����__�_�����len��namerrr�
_is_dunders&�
�
�rcCsLt|�dkoJ|d|dko&dknoJ|dd�dkoJ|dd�dkS)z;
    Returns True if a _sunder_ name, False otherwise.
    rr���r�rrrrrr�
_is_sunder!s���r cCsdd�}||_d|_dS)z,
    Make the given class un-picklable.
    cSstd|��dS)Nz%r cannot be pickled)�	TypeError��self�protorrr�_break_on_call_reduce0sz6_make_class_unpicklable.<locals>._break_on_call_reducez	<unknown>N)�
__reduce_ex__�
__module__)�clsr%rrr�_make_class_unpicklable,sr)c@seZdZdZeZdS)r	zP
    Instances are replaced with an appropriate value in Enum class suites.
    N)�__name__r'�__qualname__�__doc__�
_auto_null�valuerrrrr	6scs,eZdZdZ�fdd�Z�fdd�Z�ZS)�	_EnumDictz�
    Track enum member order and ensure member names are not reused.

    EnumMeta will use the names found in self._member_names as the
    enumeration member names.
    cs&t���g|_g|_g|_d|_dS)NF)�super�__init__�
_member_names�_last_values�_ignore�_auto_called�r#��	__class__rrr1Ds

z_EnumDict.__init__csdt|�r�|dkrtd��|dkr<|jr.td��t|d|�nV|dkr�t|t�r`|�dd���}nt	|�}||_
t|�t|j�@}|r�td	|f��n�t
|�r�|d
kr�d}n�||jkr�td|��n�||j
kr�n�t|��sR||kr�td
|||f��t|t��r:|jtk�r4|�|dt|j�|jdd��|_d|_|j}|j�|�|j�|�t��||�dS)z�
        Changes anything not dundered or not a descriptor.

        If an enum member name is used twice, an error is raised; duplicate
        values are not checked for.

        Single underscore (sunder) names are reserved.
        )�_order_�_create_pseudo_member_�_generate_next_value_�	_missing_�_ignore_z(_names_ are reserved for future Enum user;z4_generate_next_value_ must be defined before members�_generate_next_valuer=�,� z-_ignore_ cannot specify already set names: %r�	__order__r9zAttempted to reuse key: %rz%r already defined as: %rrNT)r �
ValueErrorr5r!�setattr�
isinstance�str�replace�split�listr4�setr2rrr	r.r-r>rr3�appendr0�__setitem__)r#�keyr.�alreadyr7rrrKKsT	
��


�z_EnumDict.__setitem__)r*r'r+r,r1rK�
__classcell__rrr7rr/=sr/cs�eZdZdZedd��Z�fdd�Zdd�Zd/dddd	d
�dd�Zd
d�Z	�fdd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zedd��Zdd�Zdd �Z�fd!d"�Zdddd	d
�d#d$�Zd0d%d&�Zd'd(�Zed)d*��Zed+d,��Zed-d.��Z�ZS)1rz
    Metaclass for Enum
    cCs>|�||�t�}|�||�\}}|dk	r:t|dd�|d<|S)Nr;)�_check_for_existing_membersr/�_get_mixins_�getattr)�metaclsr(�bases�	enum_dict�member_type�
first_enumrrr�__prepare__�s�zEnumMeta.__prepare__c	s��dg��d��d}|D]}��|d�q|�||�\�}|���|�\}}}	�fdd��jD�}
�jD]
}�|=qn��dd�}t|
�ddh@}
|
r�td�d�	|
����d	�kr�d
�d	<t
��|||��}g|_i|_
�|_dd�|��D�}i|_d
�k�r2�tk	�r2d}t�fdd�|D���s2t|��jD�]*}|
|}t|t��sZ|f}n|}�tk�rn|f}|	�s�||�}t|d��s�||_n6||f|��}t|d��sƈtk�r�||_n
�|�|_|j}||_||_|j|�|j
��D]"\}}|j|jk�r�|}�q�q�|j�|�||k�r2t|||�||j
|<z||j|<Wntk
�r`YnX�q8dD]V}|�k�r|�qjt||�}t�|d�}t||d�}|dk	�rj||k�rjt|||��qjtdk	�r�|�r�||_ tj|_|dk	�rt|t!��r|�"dd��#�}||jk�rtd��|S)Nr=csi|]}|�|�qSrr)�.0�k)�	classdictrr�
<dictcomp>�sz$EnumMeta.__new__.<locals>.<dictcomp>r9�mro�zInvalid enum member name: {0}r?r,zAn enumeration.cSs.h|]&}|j��D]\}}t|t�r|�qqSr)�__dict__�itemsrDr)rX�crY�vrrr�	<setcomp>�s

�z#EnumMeta.__new__.<locals>.<setcomp>r&)�__getnewargs_ex__�__getnewargs__r&�
__reduce__c3s|]}|�jkVqdS�N)r^�rX�m)rUrr�	<genexpr>�sz#EnumMeta.__new__.<locals>.<genexpr>�_value_)�__repr__�__str__�
__format__r&r@z#member order does not match _order_)$�
setdefaultrJ�poprP�
_find_new_r2rIrB�format�joinr0�__new__�_member_names_�_member_map_�
_member_type_r\�_value2member_map_�object�anyr)rD�tuplerrj�_name_�__objclass__r1r_rCr!rQr�__new_member__rErFrG)rRr(rSrZ�ignorerLrVrs�save_new�use_args�enum_membersrr9�
invalid_names�
enum_class�dynamic_attributes�methods�member_namer.�args�enum_member�canonical_member�class_method�
obj_method�enum_methodr7)rZrUrrs�s��

��













zEnumMeta.__new__cCsdS)z6
        classes/types should always be True.
        Trr6rrr�__bool__3szEnumMeta.__bool__Nr��module�qualname�type�startcCs*|dkr|�||�S|j||||||d�S)a!
        Either returns an existing member, or creates a new enum class.

        This method is used both when an enum class is given a value to match
        to an enumeration member (i.e. Color(3)) and for the functional API
        (i.e. Color = Enum('Color', names='RED GREEN BLUE')).

        When used for the functional API:

        `value` will be the name of the new class.

        `names` should be either a string of white-space/comma delimited names
        (values will start at `start`), or an iterator/mapping of name, value pairs.

        `module` should be set to the module this class is being created in;
        if it is not set, an attempt to find that module will be made, but if
        it fails the class will not be picklable.

        `qualname` should be set to the actual location this class can be found
        at in its module; by default it is set to the global scope.  If this is
        not correct, unpickling will fail in some circumstances.

        `type`, if set, will be mixed in as the first base class.
        Nr�)rs�_create_)r(r.�namesr�r�r�r�rrr�__call__9s�zEnumMeta.__call__cCs:t|t�s$tdt|�j|jjf��t||�o8|j|jkS)N�3unsupported operand type(s) for 'in': '%s' and '%s')rDrr!r�r+r8r{ru)r(�memberrrr�__contains__^s
��zEnumMeta.__contains__cs(||jkrtd|j��t��|�dS)Nz%s: cannot delete Enum member.)ru�AttributeErrorr*r0�__delattr__)r(�attrr7rrr�es
zEnumMeta.__delattr__cCsddddg|jS)Nr8r,�__members__r'�rtr6rrr�__dir__ls
��zEnumMeta.__dir__cCs@t|�rt|��z|j|WStk
r:t|�d�YnXdS)a=
        Return the enum member matching `name`

        We use __getattr__ instead of descriptors or inserting into the enum
        class' __dict__ in order to support `name` and `value` being both
        properties for enum members (which live in the class' __dict__) and
        enum members themselves.
        N)rr�ru�KeyError�r(rrrr�__getattr__rs	zEnumMeta.__getattr__cCs
|j|Srf�rur�rrr�__getitem__�szEnumMeta.__getitem__cs�fdd��jD�S)z6
        Returns members in definition order.
        c3s|]}�j|VqdSrfr��rXr�r(rrri�sz$EnumMeta.__iter__.<locals>.<genexpr>r�r�rr�r�__iter__�szEnumMeta.__iter__cCs
t|j�Srf)rrtr�rrr�__len__�szEnumMeta.__len__cCs
t|j�S)z�
        Returns a mapping of member name->value.

        This mapping lists all enum members, including aliases. Note that this
        is a read-only view of the internal mapping.
        )rrur�rrrr��szEnumMeta.__members__cCs
d|jS)Nz	<enum %r>)r*r�rrrrk�szEnumMeta.__repr__cs�fdd�t�j�D�S)z>
        Returns members in reverse definition order.
        c3s|]}�j|VqdSrfr�r�r�rrri�sz(EnumMeta.__reversed__.<locals>.<genexpr>)�reversedrtr�rr�r�__reversed__�szEnumMeta.__reversed__cs0|j�di�}||krtd��t��||�dS)a
        Block attempts to reassign Enum members.

        A simple assignment to the class namespace only changes one of the
        several possible ways to get an Enum member from the Enum class,
        resulting in an inconsistent Enumeration.
        ruzCannot reassign members.N)r^�getr�r0�__setattr__)r(rr.�
member_mapr7rrr��szEnumMeta.__setattr__c
Cs~|j}|dkr|fn||f}|�||�\}	}
|�||�}t|t�rR|�dd���}t|ttf�r�|r�t|dt�r�|g}}g}
t	|�D]8\}}|
�
||||
dd��}|
�|�|�||f�q�|D].}t|t�r�|||}}n|\}}|||<q�|�||||�}|dk�rPzt
�d�jd}Wn*tttfk
�rN}zW5d}~XYnX|dk�rdt|�n||_|dk	�rz||_|S)a�
        Convenience method to create a new Enum class.

        `names` can be:

        * A string containing member names, separated either with spaces or
          commas.  Values are incremented by 1 from `start`.
        * An iterable of member names.  Values are incremented by 1 from `start`.
        * An iterable of (member name, value) pairs.
        * A mapping of member name -> value pairs.
        Nr?r@rrr*)r8rPrWrDrErFrGrzrH�	enumerater;rJrs�sys�	_getframe�	f_globalsr�rBr�r)r'r+)r(�
class_namer�r�r�r�r�rRrSrrVrZ�original_names�last_values�countrr.�itemr��member_valuer��excrrrr��s<
 







zEnumMeta._create_cs�ttj|�}|rt|�}n|}�fdd�|��D�}z|jdd�d�Wn$tk
rn|jdd�d�YnX||||d�}t|_|�|j	�|||<|S)z[
        Create a new Enum subclass that replaces a collection of global constants
        cs g|]\}}�|�r||f�qSrr)rXrr.��filterrr�
<listcomp>�s�z&EnumMeta._convert_.<locals>.<listcomp>cSs|d|dfS)Nrrr��trrr�<lambda>��z$EnumMeta._convert_.<locals>.<lambda>)rLcSs|dS�Nrrr�rrrr��r�)r�)
�varsr��modulesr_�sortr!�_reduce_ex_by_namer&�updater�)r(rr�r��source�module_globals�membersrr�r�	_convert_�s 	

�zEnumMeta._convert_cOs$ddl}|jdtdd�|j||�S)NrzI_convert is deprecated and will be removed in 3.9, use _convert_ instead.r)�
stacklevel)�warnings�warn�DeprecationWarningr�)r(r��kwargsr�rrr�_converts�zEnumMeta._convertcCs<|D]2}|jD]&}t|t�r|jrtd||jf��qqdS)Nz %s: cannot extend enumeration %r)�__mro__�
issubclassrrtr!r*)r�rS�chain�baserrrrO
s
��z$EnumMeta._check_for_existing_memberscsT|sttfS�fdd�}|d}t|t�s2td��||�p<t}|jrLtd��||fS)z�
        Returns the type for creating enum members, and the first inherited
        enum class.

        bases: the tuple of bases that was given to __new__
        cs�g}|D]t}d}|jD]d}|tkr&qqt|t�rL|jtk	rz|�|j�qqd|jkrvt|t�rbq|�|pl|�qq|}qqt|�dkr�td�|f��n|r�|dSdSdS)Nrsrz%r: too many data types: %rr)	r�rxr�rrvrJr^rr!)rS�
data_typesr��	candidater��r�rr�_find_data_types*




z.EnumMeta._get_mixins_.<locals>._find_data_typerzZnew enumerations should be created as `EnumName([mixin_type, ...] [data_type,] enum_type)`zCannot extend enumerations)rxrr�r!rt)r�rSr�rVrUrr�rrPs
zEnumMeta._get_mixins_c	Cs�|�dd�}|dk	}|dkrpdD]H}||fD].}t||d�}|ddjtjtjhkr,|}q\q,|dk	r qpq tj}|tjkr�d}nd}|||fS)a
        Returns the __new__ to be used for creating the enum members.

        classdict: the class dictionary given to __new__
        member_type: the data type whose __new__ will be used by default
        first_enum: enumeration to check for an overriding __new__
        rsN)r}rsFT)r�rQrsrxr)	rZrUrVrsr�method�possible�targetr�rrrrpCs*�
zEnumMeta._find_new_)N)N)r*r'r+r,�classmethodrWrsr�r�r�r�r�r�r�r�r��propertyr�rkr�r�r�r�r��staticmethodrOrPrprNrrr7rr�s8

%
	
5
!
	
.c@steZdZdZdd�Zdd�Zedd��Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
edd��Zedd��ZdS)rzV
    Generic enumeration.

    Derive from this class to define new enumerations.
    c
Cst|�|kr|Sz|j|WStk
r0Yn:tk
rh|j��D]}|j|krH|YSqHYnXzd}|�|�}Wn*tk
r�}z|}d}W5d}~XYnXzdt	||�r�|W�TSt
d||jf�}|dkr�|dkr�|�n|dk�rtd|j|f�}||_|�W5d}d}XdS)N�%r is not a valid %szDerror in %s._missing_: returned %r instead of None or a valid member)
r�rwr�r!ru�valuesrjr<�	ExceptionrDrBr*�__context__)r(r.r�r��result�e�ve_excrrrrsws@


��zEnum.__new__c	Cs6t|�D](}z|dWStk
r.YqXq|S)��
        Generate the next value when not given.

        name: the name of the member
        start: the initial start value or None
        count: the number of existing members
        last_value: the last value assigned or None
        rN)r�r!)rr�r�r��
last_valuerrrr;�s	zEnum._generate_next_value_cCsdSrfr)r(r.rrrr<�szEnum._missing_cCsd|jj|j|jfS)N�<%s.%s: %r>)r8r*r{rjr6rrrrk�s
�z
Enum.__repr__cCsd|jj|jfS)N�%s.%s)r8r*r{r6rrrrl�szEnum.__str__cs6�fdd��j��D�dd��jD�}dddg|S)z<
        Returns all members and all public methods
        cs2g|]*}|jD]}|ddkr|�jkr|�qqS�rr)r^ru)rXr(rhr6rrr��s
�z Enum.__dir__.<locals>.<listcomp>cSsg|]}|ddkr|�qSr�rrgrrrr��sr8r,r')r8r\r^)r#�added_behaviorrr6rr��s
��zEnum.__dir__cCsJt|�jtjtjfk}|jtks$|r2t}t|�}n|j}|j}|�||�S)z\
        Returns format using actual value type unless __str__ has been overridden.
        )	r�rlrrrvrxrErjrm)r#�format_spec�str_overriddenr(�valrrrrm�s	
zEnum.__format__cCs
t|j�Srf)�hashr{r6rrr�__hash__�sz
Enum.__hash__cCs|j|jffSrf�r8rjr"rrrr&�szEnum.__reduce_ex__cCs|jS)zThe name of the Enum member.)r{r6rrrr�sz	Enum.namecCs|jS)zThe value of the Enum member.�rjr6rrrr.�sz
Enum.valueN)r*r'r+r,rsr;r�r<rkrlr�rmr�r&rrr.rrrrrqs-


)�	metaclassc@seZdZdZdS)rz.Enum where members are also (and must be) intsN)r*r'r+r,rrrrr�scCs|jSrfrr"rrrr��sr�c@speZdZdZdd�Zedd��Zedd��Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)rz
    Support for flags
    c	Csd|s|dk	r|SdSt|�D]:}zt|�}WqXWqtk
rTtd|�d�YqXqd|dS)r�NrzInvalid Flag value: %rr)r��	_high_bitr�r!)rr�r�r�r��high_bitrrrr;s	
zFlag._generate_next_value_cCs.|}|dkr|}|�|�}|dkr*|}|S)�V
        Returns member (possibly creating it) if one can be found for value.
        r)r:)r(r.�original_value�possible_memberrrrr<s
zFlag._missing_cCsb|j�|d�}|dkr^t||�\}}|r:td||jf��t�|�}d|_||_|j�	||�}|S)�L
        Create a composite member iff value contains only members.
        Nr�)
rwr��
_decomposerBr*rxrsr{rjrn)r(r.�
pseudo_memberr�extra_flagsrrrr:#s
zFlag._create_pseudo_member_cCs8t||j�s&tdt|�j|jjf��|j|j@|jkS)zP
        Returns True if self has at least the same flags set as other.
        r�)rDr8r!r�r+rj�r#�otherrrrr�7s��zFlag.__contains__cCsV|j}|jdk	r$d|j|j|jfSt||j�\}}d|jd�dd�|D��|jfS)Nr��|cSsg|]}t|jp|j��qSr�rEr{rjrgrrrr�Hsz!Flag.__repr__.<locals>.<listcomp>)r8r{r*rjr�rr�r#r(r��	uncoveredrrrrkAs
�z
Flag.__repr__cCs�|j}|jdk	r d|j|jfSt||j�\}}t|�dkr^|djdkr^d|j|djfSd|jd�dd�|D��fSdS)Nr�rrz%s.%rr�cSsg|]}t|jp|j��qSrr�rgrrrr�Vsz Flag.__str__.<locals>.<listcomp>)r8r{r*r�rjrrrr�rrrrlLs
�zFlag.__str__cCs
t|j�Srf)�boolrjr6rrrr�Ysz
Flag.__bool__cCs"t||j�stS|�|j|jB�Srf�rDr8�NotImplementedrjr�rrr�__or__\szFlag.__or__cCs"t||j�stS|�|j|j@�Srfrr�rrr�__and__aszFlag.__and__cCs"t||j�stS|�|j|jA�Srfrr�rrr�__xor__fszFlag.__xor__cCsNt|j|j�\}}|�d�}|jD] }||kr"|j|j@s"||B}q"|�|�Sr�)r�r8rj)r#r�r�invertedrhrrr�
__invert__ks


zFlag.__invert__N)r*r'r+r,r;r�r<r:r�rkrlr�rrrrrrrrr�s



c@sTeZdZdZedd��Zedd��Zdd�Zdd	�Zd
d�Z	eZ
eZe	Zdd
�Z
dS)rz)
    Support for integer-based Flags
    cCs*t|t�std||jf��|�|�}|S)r�r�)rD�intrBr*r:)r(r.�
new_memberrrrr<ys

zIntFlag._missing_cCs�|j�|d�}|dkr�|g}t||�\}}|rtt|�}d|}||jkrZ||krZ|�|�||krjd}q*||N}q*t|�D]*}t�||�}d|_||_	|j�
||�}q||S)r�Nrr)rwr�r�r�rJr�r	rsr{rjrn)r(r.r��need_to_createrr��bit�
flag_valuerrrr:�s(
�


zIntFlag._create_pseudo_member_cCs0t||jtf�stS|�|j|�|�jB�}|Srf�rDr8r	rrj)r#r�r�rrrr�szIntFlag.__or__cCs,t||jtf�stS|�|j|�|�j@�Srfrr�rrrr�szIntFlag.__and__cCs,t||jtf�stS|�|j|�|�jA�Srfrr�rrrr�szIntFlag.__xor__cCs|�|j�}|Srfr�)r#r�rrrr�szIntFlag.__invert__N)r*r'r+r,r�r<r:rrr�__ror__�__rand__�__rxor__rrrrrrts
	
 cCs|��dS)zJ
    returns index of highest bit, or -1 if value is zero or negative
    r)�
bit_length�r.rrrr��sr�cCs^g}|j��D]"\}}||jkr|�||jf�q|rZd�dd�|D��}td||f��|S)zI
    Class decorator for enumerations ensuring unique member values.
    z, cSsg|]\}}d||f�qS)z%s -> %sr)rX�aliasrrrrr��szunique.<locals>.<listcomp>z duplicate values found in %r: %s)r�r_rrJrrrB)�enumeration�
duplicatesrr��
alias_detailsrrrr
�s
��cCs�|}|dk}|r*dd�t|j���D�}ndd�t|j���D�}g}|D],\}}|rJ||@|krJ|�|�||M}qJ|s�||jkr�|�|j|�|jdd�dd�t|�d	kr�|dj|kr�|�d�||fS)
z-
    Extract all members from the value.
    rcSs"g|]\}}|jdk	r||f�qSrfr�rXrarhrrrr��s
�z_decompose.<locals>.<listcomp>cSs*g|]"\}}|jdk	st|�r||f�qSrf)r�
_power_of_tworrrrr��s
�cSs|jSrfr�)rhrrrr��r�z_decompose.<locals>.<lambda>T)rL�reverser)rHrwr_rJr�rr.ro)�flagr.�not_covered�negative�flags_to_checkr�r�r�rrrr��s(��

r�cCs|dkrdS|dt|�kS)NrFr)r�rrrrr�sr)r��typesrr�__all__rrr r)rxr-r	�dictr/rr�rr	rr�rrr�r
r�rrrrr�<module>s>�
	LivI%__pycache__/_collections_abc.cpython-38.opt-2.pyc000064400000056204151153537600015643 0ustar00U

e5d�e�@spddlmZmZddlZddddddd	d
ddd
ddddddddddddddgZdZeed��Zeee	���Z
eei����Zeei�
���Zeei����Zeeg��Zeeeg���Zeeed���Zeeedd>���Zeee���Zeed ��Zeed!��Zeee���Zei���Zei�
��Zei���Zeej �Z!ed"d#���Z"d$d%�Z#e#�Z#ee#�Z$e#�%�[#d&d'�Z&e&�Z&ee&�Z'[&d(d)�Z(Gd*d�ded+�Z)Gd,d�ded+�Z*Gd-d�de*�Z+e+�,e$�Gd.d�ded+�Z-Gd/d�de-�Z.Gd0d�de.�Z/e/�,e'�Gd1d	�d	ed+�Z0Gd2d
�d
e0�Z1e1�,e�e1�,e
�e1�,e�e1�,e�e1�,e�e1�,e�e1�,e�e1�,e�e1�,e�e1�,e�e1�,e�e1�,e�e1�,e�Gd3d�de0�Z2Gd4d�de1�Z3e3�,e"�Gd5d
�d
ed+�Z4Gd6d�ded+�Z5Gd7d�de4e0e5�Z6Gd8d�ded+�Z7Gd9d�de6�Z8e8�,e9�Gd:d�de8�Z:e:�,e�Gd;d�de6�Z;e;�,e!�Gd<d�de4�Z<Gd=d�de<e8�Z=e=�,e�Gd>d�de<e8�Z>e>�,e�Gd?d�de<e6�Z?e?�,e�Gd@d�de;�Z@e@�,eA�GdAd�de2e6�ZBeB�,eC�eB�,eD�eB�,e�eB�,eE�GdBd�deB�ZFeF�,eG�eF�,e	�GdCd�deB�ZHeH�,eI�eH�,e	�dS)D�)�ABCMeta�abstractmethodN�	Awaitable�	Coroutine�
AsyncIterable�
AsyncIterator�AsyncGenerator�Hashable�Iterable�Iterator�	Generator�
Reversible�Sized�	Container�Callable�
Collection�Set�
MutableSet�Mapping�MutableMapping�MappingView�KeysView�	ItemsView�
ValuesView�Sequence�MutableSequence�
ByteStringzcollections.abc��i���ccsdVS�Nr r r r �(/usr/lib64/python3.8/_collections_abc.py�<lambda>8rr#c�sdSr!r r r r r"�_coro:rr$cCs
dVdSr!r r r r r"�_ag@rr%cGsN|j}|D]>}|D],}||jkr|j|dkr:tSq
qtSq
dS)NT)�__mro__�__dict__�NotImplemented)�C�methods�mro�method�Br r r"�_check_methodsHs

r.c@s(eZdZdZedd��Zedd��ZdS)r	r cCsdS�Nrr ��selfr r r"�__hash__XszHashable.__hash__cCs|tkrt|d�StS)Nr2)r	r.r(��clsr)r r r"�__subclasshook__\s
zHashable.__subclasshook__N)�__name__�
__module__�__qualname__�	__slots__rr2�classmethodr5r r r r"r	Ts

)�	metaclassc@s(eZdZdZedd��Zedd��ZdS)rr ccs
dVdSr!r r0r r r"�	__await__gszAwaitable.__await__cCs|tkrt|d�StS)Nr<)rr.r(r3r r r"r5ks
zAwaitable.__subclasshook__N)r6r7r8r9rr<r:r5r r r r"rcs

c@s>eZdZdZedd��Zeddd��Zdd�Zed	d
��Z	dS)rr cCst�dSr!��
StopIteration�r1�valuer r r"�sendvszCoroutine.sendNcCs4|dkr|dkr|�|�}|dk	r,|�|�}|�dSr!��with_traceback�r1�typ�val�tbr r r"�throw}s
zCoroutine.throwc	Cs4z|�t�Wnttfk
r&Yn
Xtd��dS)Nzcoroutine ignored GeneratorExit�rH�
GeneratorExitr>�RuntimeErrorr0r r r"�close�s
zCoroutine.closecCs|tkrt|dddd�StS)Nr<rArHrL)rr.r(r3r r r"r5�szCoroutine.__subclasshook__)NN)
r6r7r8r9rrArHrLr:r5r r r r"rrs

c@s(eZdZdZedd��Zedd��ZdS)rr cCst�Sr!)rr0r r r"�	__aiter__�szAsyncIterable.__aiter__cCs|tkrt|d�StS)NrM)rr.r(r3r r r"r5�s
zAsyncIterable.__subclasshook__N)r6r7r8r9rrMr:r5r r r r"r�s

c@s0eZdZdZedd��Zdd�Zedd��ZdS)	rr c�st�dSr!��StopAsyncIterationr0r r r"�	__anext__�szAsyncIterator.__anext__cCs|Sr!r r0r r r"rM�szAsyncIterator.__aiter__cCs|tkrt|dd�StS)NrPrM)rr.r(r3r r r"r5�szAsyncIterator.__subclasshook__N)	r6r7r8r9rrPrMr:r5r r r r"r�s
c@sFeZdZdZdd�Zedd��Zed
dd��Zd	d
�Ze	dd��Z
dS)rr c�s|�d�IdHSr!)�asendr0r r r"rP�szAsyncGenerator.__anext__c�st�dSr!rNr?r r r"rQ�szAsyncGenerator.asendNc�s4|dkr|dkr|�|�}|dk	r,|�|�}|�dSr!rBrDr r r"�athrow�s
zAsyncGenerator.athrowc	�s:z|�t�IdHWnttfk
r,Yn
Xtd��dS)Nz,asynchronous generator ignored GeneratorExit)rRrJrOrKr0r r r"�aclose�s
zAsyncGenerator.aclosecCs|tkrt|ddddd�StS)NrMrPrQrRrS)rr.r(r3r r r"r5�s�zAsyncGenerator.__subclasshook__)NN)r6r7r8r9rPrrQrRrSr:r5r r r r"r�s

c@s(eZdZdZedd��Zedd��ZdS)r
r ccsdSr!r r0r r r"�__iter__�szIterable.__iter__cCs|tkrt|d�StS)NrT)r
r.r(r3r r r"r5�s
zIterable.__subclasshook__N)r6r7r8r9rrTr:r5r r r r"r
�s

c@s0eZdZdZedd��Zdd�Zedd��ZdS)	rr cCst�dSr!r=r0r r r"�__next__szIterator.__next__cCs|Sr!r r0r r r"rTszIterator.__iter__cCs|tkrt|dd�StS)NrTrU)rr.r(r3r r r"r5szIterator.__subclasshook__N)	r6r7r8r9rrUrTr:r5r r r r"rs
c@s(eZdZdZedd��Zedd��ZdS)r
r ccsdSr!r r0r r r"�__reversed__)szReversible.__reversed__cCs|tkrt|dd�StS)NrVrT)r
r.r(r3r r r"r5.szReversible.__subclasshook__N)r6r7r8r9rrVr:r5r r r r"r
%s

c@sFeZdZdZdd�Zedd��Zed
dd��Zd	d
�Ze	dd��Z
dS)rr cCs
|�d�Sr!)rAr0r r r"rU9szGenerator.__next__cCst�dSr!r=r?r r r"rA?szGenerator.sendNcCs4|dkr|dkr|�|�}|dk	r,|�|�}|�dSr!rBrDr r r"rHFs
zGenerator.throwc	Cs4z|�t�Wnttfk
r&Yn
Xtd��dS)Nzgenerator ignored GeneratorExitrIr0r r r"rLSs
zGenerator.closecCs|tkrt|ddddd�StS)NrTrUrArHrL)rr.r(r3r r r"r5]s�zGenerator.__subclasshook__)NN)r6r7r8r9rUrrArHrLr:r5r r r r"r5s

c@s(eZdZdZedd��Zedd��ZdS)rr cCsdSr/r r0r r r"�__len__ksz
Sized.__len__cCs|tkrt|d�StS)NrW)rr.r(r3r r r"r5os
zSized.__subclasshook__N)r6r7r8r9rrWr:r5r r r r"rgs

c@s(eZdZdZedd��Zedd��ZdS)rr cCsdS�NFr )r1�xr r r"�__contains__zszContainer.__contains__cCs|tkrt|d�StS)NrZ)rr.r(r3r r r"r5~s
zContainer.__subclasshook__N)r6r7r8r9rrZr:r5r r r r"rvs

c@seZdZdZedd��ZdS)rr cCs|tkrt|ddd�StS)NrWrTrZ)rr.r(r3r r r"r5�szCollection.__subclasshook__N)r6r7r8r9r:r5r r r r"r�sc@s(eZdZdZedd��Zedd��ZdS)rr cOsdSrXr )r1�args�kwdsr r r"�__call__�szCallable.__call__cCs|tkrt|d�StS)Nr])rr.r(r3r r r"r5�s
zCallable.__subclasshook__N)r6r7r8r9rr]r:r5r r r r"r�s

c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Ze	dd
��Z
dd�ZeZdd�Z
dd�ZeZdd�Zdd�Zdd�ZeZdd�ZdS)rr cCs>t|t�stSt|�t|�kr"dS|D]}||kr&dSq&dS�NFT��
isinstancerr(�len�r1�other�elemr r r"�__le__�s
z
Set.__le__cCs(t|t�stSt|�t|�ko&|�|�Sr!�r`rr(rare�r1rcr r r"�__lt__�s
z
Set.__lt__cCs(t|t�stSt|�t|�ko&|�|�Sr!)r`rr(ra�__ge__rgr r r"�__gt__�s
z
Set.__gt__cCs>t|t�stSt|�t|�kr"dS|D]}||kr&dSq&dSr^r_rbr r r"ri�s
z
Set.__ge__cCs(t|t�stSt|�t|�ko&|�|�Sr!rfrgr r r"�__eq__�s
z
Set.__eq__cCs||�Sr!r )r4�itr r r"�_from_iterable�szSet._from_iterablecs&t|t�stS���fdd�|D��S)Nc3s|]}|�kr|VqdSr!r ��.0r@r0r r"�	<genexpr>�szSet.__and__.<locals>.<genexpr>�r`r
r(rmrgr r0r"�__and__�s
zSet.__and__cCs|D]}||krdSqdSr^r )r1rcr@r r r"�
isdisjoint�szSet.isdisjointcCs*t|t�stSdd�||fD�}|�|�S)Ncss|]}|D]
}|Vq
qdSr!r )ro�s�er r r"rp�szSet.__or__.<locals>.<genexpr>rq)r1rc�chainr r r"�__or__�s
z
Set.__or__cs:t�t�s"t�t�stS|����|��fdd�|D��S)Nc3s|]}|�kr|VqdSr!r rn�rcr r"rp�s�zSet.__sub__.<locals>.<genexpr>�r`rr
r(rmrgr rxr"�__sub__�s



zSet.__sub__cs:t|t�s"t|t�stS��|�}���fdd�|D��S)Nc3s|]}|�kr|VqdSr!r rnr0r r"rp�s�zSet.__rsub__.<locals>.<genexpr>ryrgr r0r"�__rsub__�s



zSet.__rsub__cCs2t|t�s"t|t�stS|�|�}||||BSr!ryrgr r r"�__xor__s



zSet.__xor__cCs�tj}d|d}t|�}d|d}||M}|D],}t|�}|||d>AdAdN}||M}q2|dd}||M}||kr�||d8}|d	kr�d
}|S)N�riM��r�i�M[l�4~2i�
i��6���i��8#)�sys�maxsizera�hash)r1�MAX�MASK�n�hrY�hxr r r"�_hash	s 
z	Set._hashN)r6r7r8r9rerhrjrirkr:rmrr�__rand__rsrw�__ror__rzr{r|�__rxor__r�r r r r"r�s$


c@s`eZdZdZedd��Zedd��Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dS)rr cCst�dSr!��NotImplementedErrorr?r r r"�add:szMutableSet.addcCst�dSr!r�r?r r r"�discard?szMutableSet.discardcCs||krt|��|�|�dSr!)�KeyErrorr�r?r r r"�removeDszMutableSet.removecCs>t|�}zt|�}Wntk
r.td�YnX|�|�|Sr!)�iter�nextr>r�r��r1rlr@r r r"�popJs
zMutableSet.popcCs(z|��qWntk
r"YnXdSr!)r�r�r0r r r"�clearTszMutableSet.clearcCs|D]}|�|�q|Sr!)r�r�r r r"�__ior__\szMutableSet.__ior__cCs||D]}|�|�q|Sr!)r�r�r r r"�__iand__aszMutableSet.__iand__cCsR||kr|��n<t|t�s&|�|�}|D]"}||krB|�|�q*|�|�q*|Sr!)r�r`rrmr�r�r�r r r"�__ixor__fs


zMutableSet.__ixor__cCs*||kr|��n|D]}|�|�q|Sr!)r�r�r�r r r"�__isub__ss

zMutableSet.__isub__N)r6r7r8r9rr�r�r�r�r�r�r�r�r�r r r r"r,s



c@sReZdZdZedd��Zddd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�ZdZdS)rr cCst�dSr!�r��r1�keyr r r"�__getitem__�szMapping.__getitem__NcCs(z
||WStk
r"|YSXdSr!r��r1r��defaultr r r"�get�s
zMapping.getcCs,z||Wntk
r"YdSXdSdSr^r�r�r r r"rZ�s
zMapping.__contains__cCst|�Sr!)rr0r r r"�keys�szMapping.keyscCst|�Sr!)rr0r r r"�items�sz
Mapping.itemscCst|�Sr!)rr0r r r"�values�szMapping.valuescCs&t|t�stSt|���t|���kSr!)r`rr(�dictr�rgr r r"rk�s
zMapping.__eq__)N)
r6r7r8r9rr�r�rZr�r�r�rkrVr r r r"r�s


c@s(eZdZdZdd�Zdd�Zdd�ZdS)	r��_mappingcCs
||_dSr!r�)r1�mappingr r r"�__init__�szMappingView.__init__cCs
t|j�Sr!)rar�r0r r r"rW�szMappingView.__len__cCs
d�|�S)Nz&{0.__class__.__name__}({0._mapping!r}))�formatr0r r r"�__repr__�szMappingView.__repr__N)r6r7r8r9r�rWr�r r r r"r�sc@s,eZdZdZedd��Zdd�Zdd�ZdS)	rr cCst|�Sr!��set�r1rlr r r"rm�szKeysView._from_iterablecCs
||jkSr!r�r�r r r"rZ�szKeysView.__contains__ccs|jEdHdSr!r�r0r r r"rT�szKeysView.__iter__N�r6r7r8r9r:rmrZrTr r r r"r�s

c@s,eZdZdZedd��Zdd�Zdd�ZdS)	rr cCst|�Sr!r�r�r r r"rm�szItemsView._from_iterablecCsB|\}}z|j|}Wntk
r,YdSX||kp<||kSdSrX)r�r�)r1�itemr�r@�vr r r"rZ�szItemsView.__contains__ccs |jD]}||j|fVqdSr!r�r�r r r"rT�s
zItemsView.__iter__Nr�r r r r"r�s

	c@s eZdZdZdd�Zdd�ZdS)rr cCs0|jD]$}|j|}||ks$||krdSqdS�NTFr�)r1r@r�r�r r r"rZ�s


zValuesView.__contains__ccs|jD]}|j|VqdSr!r�r�r r r"rT�s
zValuesView.__iter__N)r6r7r8r9rZrTr r r r"r�sc@s^eZdZdZedd��Zedd��Ze�Zefdd�Z	dd	�Z
d
d�Zddd
�Zddd�Z
dS)rr cCst�dSr!r��r1r�r@r r r"�__setitem__szMutableMapping.__setitem__cCst�dSr!r�r�r r r"�__delitem__szMutableMapping.__delitem__cCs@z||}Wn$tk
r0||jkr(�|YSX||=|SdSr!)r��_MutableMapping__marker)r1r�r�r@r r r"r�s

zMutableMapping.popcCsBztt|��}Wntk
r*td�YnX||}||=||fSr!)r�r�r>r�r�r r r"�popitem$szMutableMapping.popitemcCs(z|��qWntk
r"YnXdSr!)r�r�r0r r r"r�0szMutableMapping.clearcKs|t|t�r"|D]}||||<qn<t|d�rH|��D]}||||<q4n|D]\}}|||<qL|��D]\}}|||<qfdS)Nr�)r`r�hasattrr�r�)r1rcr\r�r@r r r"�update8s


zMutableMapping.updateNcCs,z
||WStk
r&|||<YnX|Sr!r�r�r r r"�
setdefaultJs

zMutableMapping.setdefault)r )N)r6r7r8r9rr�r��objectr�r�r�r�r�r�r r r r"r�s


c@sFeZdZdZedd��Zdd�Zdd�Zdd	�Zddd
�Z	dd�Z
dS)rr cCst�dSr!��
IndexError�r1�indexr r r"r�bszSequence.__getitem__ccs<d}z||}|V|d7}qWntk
r6YdSXdS�Nrrr�)r1�ir�r r r"rTfszSequence.__iter__cCs$|D]}||ks||krdSqdSr�r )r1r@r�r r r"rZpszSequence.__contains__ccs$ttt|���D]}||VqdSr!)�reversed�rangera)r1r�r r r"rVvszSequence.__reversed__rNcCs�|dk	r"|dkr"tt|�|d�}|dk	r>|dkr>|t|�7}|}|dksR||kr�z"||}||ksl||krr|WSWntk
r�Yq�YnX|d7}qBt�dSr�)�maxrar��
ValueError)r1r@�start�stopr�r�r r r"r�zs


zSequence.indexcst�fdd�|D��S)Nc3s"|]}|�ks|�krdVqdS)rNr )ror��r@r r"rp�sz!Sequence.count.<locals>.<genexpr>)�sumr?r r�r"�count�szSequence.count)rN)r6r7r8r9rr�rTrZrVr�r�r r r r"rXs


c@seZdZdZdS)rr N)r6r7r8r9r r r r"r�sc@sneZdZdZedd��Zedd��Zedd��Zdd	�Zd
d�Z	dd
�Z
dd�Zddd�Zdd�Z
dd�ZdS)rr cCst�dSr!r��r1r�r@r r r"r��szMutableSequence.__setitem__cCst�dSr!r�r�r r r"r��szMutableSequence.__delitem__cCst�dSr!r�r�r r r"�insert�szMutableSequence.insertcCs|�t|�|�dSr!)r�rar?r r r"�append�szMutableSequence.appendcCs(z|��qWntk
r"YnXdSr!)r�r�r0r r r"r��szMutableSequence.clearcCsHt|�}t|d�D].}|||d||||<|||d<qdS)Nr}r)rar�)r1r�r�r r r"�reverse�szMutableSequence.reversecCs(||krt|�}|D]}|�|�qdSr!)�listr�)r1r�r�r r r"�extend�szMutableSequence.extendrcCs||}||=|Sr!r )r1r�r�r r r"r��szMutableSequence.popcCs||�|�=dSr!)r�r?r r r"r��szMutableSequence.removecCs|�|�|Sr!)r�)r1r�r r r"�__iadd__�s
zMutableSequence.__iadd__N)r)r6r7r8r9rr�r�r�r�r�r�r�r�r�r�r r r r"r�s	



)J�abcrrr��__all__r6�typer��bytes_iterator�	bytearray�bytearray_iteratorr��dict_keyiteratorr��dict_valueiteratorr��dict_itemiterator�
list_iteratorr��list_reverseiteratorr��range_iterator�longrange_iteratorr��set_iterator�str_iterator�tuple_iterator�zip�zip_iterator�	dict_keys�dict_values�
dict_itemsr'�mappingproxy�	generatorr$�	coroutinerLr%�async_generatorr.r	rr�registerrrrr
rr
rrrrrr�	frozensetrrrrrrrr�r�tuple�str�
memoryviewr�bytesrr�r r r r"�<module>	s��	
)
0













/



O
2



S
=



	

C
__pycache__/runpy.cpython-38.opt-1.pyc000064400000017767151153537600013550 0ustar00U

e5d/�@sdZddlZddlZddlZddlZddlZddlZddlm	Z	m
Z
ddgZGdd�de�Z
Gdd	�d	e�Zd d
d�Zd!dd
�Zefdd�ZGdd�de�Zd"dd�Zd#dd�Zefdd�Zdd�Zd$dd�Zedk�reej�dk�r�edejd�nejd=eejd�dS)%aZrunpy.py - locating and running Python code using the module namespace

Provides support for locating and running Python scripts using the Python
module namespace instead of the native filesystem.

This allows Python code to play nicely with non-filesystem based PEP 302
importers when locating support scripts as well as when importing modules.
�N)�	read_code�get_importer�
run_module�run_pathc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_TempModulezCTemporarily replace a module in sys.modules with an empty namespacecCs||_t�|�|_g|_dS�N)�mod_name�types�
ModuleType�module�
_saved_module��selfr�r�/usr/lib64/python3.8/runpy.py�__init__sz_TempModule.__init__cCsB|j}z|j�tj|�Wntk
r0YnX|jtj|<|Sr)rr�append�sys�modules�KeyErrorrr
rrr�	__enter__ sz_TempModule.__enter__cGs.|jr|jdtj|j<n
tj|j=g|_dS�Nr)rrrr�r�argsrrr�__exit__)s
z_TempModule.__exit__N)�__name__�
__module__�__qualname__�__doc__rrrrrrrrs	rc@s$eZdZdd�Zdd�Zdd�ZdS)�_ModifiedArgv0cCs||_t�|_|_dSr)�value�object�_saved_value�	_sentinel)rr rrrr1sz_ModifiedArgv0.__init__cCs0|j|jk	rtd��tjd|_|jtjd<dS)NzAlready preserving saved valuer)r"r#�RuntimeErrorr�argvr )rrrrr5sz_ModifiedArgv0.__enter__cGs|j|_|jtjd<dSr)r#r r"rr%rrrrr;sz_ModifiedArgv0.__exit__N)rrrrrrrrrrr0src
	Csn|dk	r|�|�|dkr(d}|}d}	n |j}|j}|j}	|dkrH|j}|j|||	d|||d�t||�|S)z)Helper to run code in nominated namespaceN)r�__file__�
__cached__r�
__loader__�__package__�__spec__)�update�loader�origin�cached�parent�exec)
�codeZrun_globals�init_globalsr�mod_spec�pkg_name�script_namer,�fnamer.rrr�	_run_code@s*
�
r7c	
Cs^|dkr|n|j}t|��6}t|��"|jj}t|||||||�W5QRXW5QRX|��S)z5Helper to run code in new namespace with sys modifiedN)r-rrr�__dict__r7�copy)	r1r2rr3r4r5r6�temp_module�mod_globalsrrr�_run_module_codeZs�r<c
Cs2|�d�r|d��|�d�\}}}|r�zt|�WnHtk
rz}z*|jdksh|j|krj|�|jd�sj�W5d}~XYnXtj�|�}|dk	r�t|d�s�ddl	m
}dj||d�}|t|��zt
j�|�}WnJttttfk
�r}	z"d}||�|t|	�j|	��|	�W5d}	~	XYnX|dk�r2|d	|��|jdk	�r�|d
k�sT|�d��r\|d��z|d}
t|
|�WS|k
�r�}z"|tjk�r��|d
||f��W5d}~XYnX|j}|dk�r�|d|��z|�|�}Wn2tk
�r}z|t|��|�W5d}~XYnX|dk�r(|d|��|||fS)N�.z#Relative module names not supported�__path__r)�warnz�{mod_name!r} found in sys.modules after import of package {pkg_name!r}, but prior to execution of {mod_name!r}; this may result in unpredictable behaviour)rr4z:Error while finding module specification for {!r} ({}: {})zNo module named %s�__main__z	.__main__z%Cannot use package as __main__ modulez3%s; %r is a package and cannot be directly executedz0%r is a namespace package and cannot be executedzNo code object available for %s)�
startswith�
rpartition�
__import__�ImportError�namerr�get�hasattr�warningsr?�format�RuntimeWarning�	importlib�util�	find_spec�AttributeError�	TypeError�
ValueError�typer�submodule_search_locations�endswith�_get_module_detailsr,�get_code)
r�errorr4�_�eZexistingr?�msg�specZexZ
pkg_main_namer,r1rrrrThsd
��,
�
� 
rTc@seZdZdZdS)�_ErrorzBError that _run_module_as_main() should report without a tracebackN)rrrrrrrrr[�sr[Tc
Cs�z0|s|dkr t|t�\}}}ntt�\}}}Wn:tk
rj}zdtj|f}t�|�W5d}~XYnXtjdj}|r�|jtj	d<t
||dd|�S)a�Runs the designated module in the __main__ namespace

       Note that the executed module will have full access to the
       __main__ namespace. If this is not desirable, the run_module()
       function should be used to run the module code in a fresh namespace.

       At the very least, these variables in __main__ will be overwritten:
           __name__
           __file__
           __cached__
           __loader__
           __package__
    r@z%s: %sNr)rTr[�_get_main_module_detailsr�
executable�exitrr8r-r%r7)rZ
alter_argvr3r1�excrYZmain_globalsrrr�_run_module_as_main�s�r`FcCs@t|�\}}}|dkr|}|r,t||||�St|i|||�SdS)znExecute a module's code without importing it

       Returns the resulting top level namespace dictionary
    N)rTr<r7)rr2�run_nameZ	alter_sysr3r1rrrr�sc
Cs�d}tj|}tj|=z\zt|�WW�NStk
rn}z*|t|�kr\|d|tjdf�|��W5d}~XYnXW5|tj|<XdS)Nr@zcan't find %r module in %rr)rrrTrD�str�path)rVZ	main_nameZ
saved_mainr_rrrr\�s
��r\c	Csftj�t�|��}t�|��}t|�}W5QRX|dkr^t�|��}t|��|d�}W5QRX||fS)Nr0)	�osrc�abspath�fsdecode�io�	open_coder�compile�read)rar6Zdecoded_path�fr1rrr�_get_code_from_file�srlcCs$|dkrd}|�d�d}t|�}d}t|�jdkrFt|�jdkrFd}t|td��sX|rxt||�\}}t|||||d	�Stj	�
d|�znt
�\}}	}t|��P}
t|��<|
jj}t|||||	|���W5QR�W5QR�W�SQRXW5QRXW5ztj	�|�Wntk
�rYnXXdS)
a_Execute code located at the specified filesystem location

       Returns the resulting top level namespace dictionary

       The file path may refer directly to a Python script (i.e.
       one that could be directly executed with execfile) or else
       it may refer to a zipfile or directory containing a top
       level __main__.py script.
    Nz
<run_path>r=rFZimpZNullImporterT)r4r5)rBrrQrr�
isinstancerlr<rrc�insert�removerPr\rrrr8r7r9)Z	path_namer2rar4ZimporterZis_NullImporterr1r6rr3r:r;rrrr�s<
�
��8r@�z!No module specified for execution)�file)NNNNN)NNNNN)T)NNF)NN)rr�importlib.machineryrK�importlib.utilrgr	rdZpkgutilrr�__all__r!rrr7r<rDrT�	Exceptionr[r`rr\rlrr�lenr%�print�stderrrrrr�<module>sN��
�
:
�

1
__pycache__/posixpath.cpython-38.opt-2.pyc000064400000021013151153537600014366 0ustar00U

e5d=�&@sZdZdZdZdZdZdZdZdZddlZddl	Z	ddl
Z
ddlZddlTd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.g&Zd/d0�Z
d1d	�Zd2d
�Zd3d�Zd4d
�Zd5d�Zejje_d6d�Zd7d�Zd8d�Zd9d�Zd:d�Zd;d�Zd<d�Zdadad=d�Zd>d�Zd?d�Z d@d+�Z!dAdB�Z"e	j#dCkZ$dFdDd-�Z%dEd.�Z&dS)G�.�..�/�:z
/bin:/usr/binNz	/dev/null�)�*�normcase�isabs�join�
splitdrive�split�splitext�basename�dirname�commonprefix�getsize�getmtime�getatime�getctime�islink�exists�lexists�isdir�isfile�ismount�
expanduser�
expandvars�normpath�abspath�samefile�sameopenfile�samestat�curdir�pardir�sep�pathsep�defpath�altsep�extsep�devnull�realpath�supports_unicode_filenames�relpath�
commonpathcCst|t�rdSdSdS)N�/r)�
isinstance�bytes��path�r2�!/usr/lib64/python3.8/posixpath.py�_get_sep)s
r4cCs
t�|�S�N��os�fspath)�sr2r2r3r4scCst�|�}t|�}|�|�Sr5)r7r8r4�
startswith)r9r#r2r2r3r<s
c
Gs�t�|�}t|�}|}z^|s,|dd�|ttj|�D]8}|�|�rL|}q8|rZ|�|�rd||7}q8|||7}q8Wn.tttfk
r�t	j
d|f|���YnX|S)Nrr	)r7r8r4�mapr:�endswith�	TypeError�AttributeError�BytesWarning�genericpath�_check_arg_types)�a�pr#r1�br2r2r3r	Gs 


cCs`t�|�}t|�}|�|�d}|d|�||d�}}|rX||t|�krX|�|�}||fS�N��r7r8r4�rfind�len�rstrip)rCr#�i�head�tailr2r2r3rds

cCs6t�|�}t|t�rd}d}nd}d}t�||d|�S)Nr-�.rr)r7r8r.r/r@�	_splitext)rCr#r'r2r2r3rus

cCst�|�}|dd�|fS�Nrr6)rCr2r2r3r
�s
cCs,t�|�}t|�}|�|�d}||d�SrE)r7r8r4rH)rCr#rKr2r2r3r
�s
cCsNt�|�}t|�}|�|�d}|d|�}|rJ||t|�krJ|�|�}|SrErG)rCr#rKrLr2r2r3r�s

c
Cs8zt�|�}Wntttfk
r*YdSXt�|j�S)NF)r7�lstat�OSError�
ValueErrorr>�stat�S_ISLNK�st_mode)r1�str2r2r3r�s
c	Cs.zt�|�Wnttfk
r(YdSXdS)NFT)r7rQrRrSr0r2r2r3r�s
c	Cs�zt�|�}Wnttfk
r(YdSXt�|j�r:dSt|t�rPt	|d�}n
t	|d�}t
|�}zt�|�}Wnttfk
r�YdSX|j}|j}||kr�dS|j}|j}||kr�dSdS)NF�..rT)
r7rQrRrSrTrUrVr.r/r	r)�st_dev�st_ino)r1�s1�parent�s2�dev1�dev2�ino1�ino2r2r2r3r�s.

c	Cs<t�|�}t|t�rd}nd}|�|�s,|St|�}|�|d�}|dkrPt|�}|dkr�dtjkr�ddl	}z|�
t���j}Wq�t
k
r�|YSXn
tjd}nVddl	}|d|�}t|t�r�t|d�}z|�|�}Wnt
k
r�|YSX|j}t|t��rt�|�}d}nd}|�|�}|||d��p:|S)	N�~�~rFr�HOME�ASCIIr-r)r7r8r.r/r:r4�findrI�environ�pwd�getpwuid�getuid�pw_dir�KeyError�str�getpwnam�fsencoderJ)	r1�tilder#rKrh�userhome�name�pwent�rootr2r2r3r�sB








cCsZt�|�}t|t�rVd|kr |Sts:ddl}|�d|j�atj}d}d}t	tdd�}n:d|krb|St
s|ddl}|�d|j�a
t
j}d	}d
}tj}d}|||�}|s��qV|�d�\}}|�
d�}	|	�|�r�|	�|�r�|	dd�}	z.|dk�rt�tjt�|	��}
n||	}
Wntk
�r&|}Yq�X||d�}|d|�|
}t|�}||7}q�|S)
N�$rs\$(\w+|\{[^}]*\})�{�}�environb�$z\$(\w+|\{[^}]*\})�{�}rF���)r7r8r.r/�	_varprogb�re�compilere�search�getattr�_varprogrg�span�groupr:r<ro�fsdecoderlrI)r1r~r��start�endrgrK�m�jrr�valuerMr2r2r3rsN






c	Cs�t�|�}t|t�r&d}d}d}d}nd}d}d}d}||krB|S|�|�}|rp|�|d	�rp|�|d
�spd	}|�|�}g}|D]J}|||fkr�q�||ks�|s�|r�|r�|d|kr�|�|�q�|r�|��q�|}|�|�}|r�|||}|p�|S)Nr-�rNrXr�rr��r|)	r7r8r.r/r:r�append�popr	)	r1r#�empty�dot�dotdot�initial_slashes�comps�	new_comps�compr2r2r3rNsJ


��
�
�

cCs@t�|�}t|�s8t|t�r&t��}nt��}t||�}t|�Sr5)	r7r8rr.r/�getcwdb�getcwdr	r)r1�cwdr2r2r3rts



cCs*t�|�}t|dd�|i�\}}t|�SrP)r7r8�
_joinrealpathr)�filenamer1�okr2r2r3r)�s
c
Cst|t�rd}d}d}nd}d}d}t|�r<|dd�}|}|�r|�|�\}}}|r<||kr`q<||kr�|r�t|�\}}||kr�t|||�}q<|}q<t||�}t|�s�|}q<||kr�||}|dk	r�q<t||�dfSd||<t|t�	|�|�\}}	|	�st||�dfS|||<q<|d	fS)
Nr-rNrXrrrrFFT)
r.r/r�	partitionrr	rr�r7�readlink)
r1�rest�seenr#r!r"rr�_�newpathr�r2r2r3r��sH


r��darwinc	Cs�|std��t�|�}t|t�r.d}d}d}nd}d}d}|dkrH|}n
t�|�}zrdd	�t|��|�D�}d
d	�t|��|�D�}tt||g��}|gt|�|||d�}|s�|WSt	|�WSt
ttt
fk
r�t�d||��YnXdS)Nzno path specifiedrNr-rXrrrcSsg|]}|r|�qSr2r2��.0�xr2r2r3�
<listcomp>�szrelpath.<locals>.<listcomp>cSsg|]}|r|�qSr2r2r�r2r2r3r��sr+)rSr7r8r.r/rrrIrr	r=r>r?�DeprecationWarningr@rA)	r1r�r!r#r"�
start_list�	path_listrK�rel_listr2r2r3r+�s0



c		s2|std��tttj|��}t|dt�r4d�d�nd�d�zƇfdd�|D�}zt�fd	d
�|D��\}Wntk
r�td�d�YnX�fdd�|D�}t|�}t	|�}|}t
|�D]$\}}|||kr�|d|�}q�q�|r�n
�dd�}|��|�WStt
fk
�r,tjd|���YnXdS)Nz%commonpath() arg is an empty sequencerr-rNrrcsg|]}|����qSr2)r)r�r1�r#r2r3r��szcommonpath.<locals>.<listcomp>c3s|]}|dd��kVqdSrEr2)r�rCr�r2r3�	<genexpr>�szcommonpath.<locals>.<genexpr>z%Can't mix absolute and relative pathscsg|]}�fdd�|D��qS)csg|]}|r|�kr|�qSr2r2)r��c�r!r2r3r�sz)commonpath.<locals>.<listcomp>.<listcomp>r2)r�r9r�r2r3r�sr,)r,)rS�tupler;r7r8r.r/�set�min�max�	enumerater	r=r>r@rA)	�paths�split_pathsrr[r]�commonrKr��prefixr2)r!r#r3r,�s6)N)'r!r"r'r#r$r%r&r(r7�sysrTr@�__all__r4rrr	rrrO�__doc__r
r
rrrrrr�r}rrrr)r��platformr*r+r,r2r2r2r3�<module>s��
	
	

*25&	3

)__pycache__/contextvars.cpython-38.opt-1.pyc000064400000000365151153537600014735 0ustar00U

e5d��@s ddlmZmZmZmZdZdS)�)�Context�
ContextVar�Token�copy_contextN)Z_contextvarsrrrr�__all__�rr�#/usr/lib64/python3.8/contextvars.py�<module>s__pycache__/string.cpython-38.opt-2.pyc000064400000014064151153537600013665 0ustar00U

e5d')�@s�dddddddddd	d
dgZdd
lZdZdZdZeeZdZeddZdZdZ	eee	eZ
ddd�Zdd
lZ
ddlmZiZGdd�de�ZGdd�ded�ZGdd
�d
�Zd
S)�
ascii_letters�ascii_lowercase�ascii_uppercase�capwords�digits�	hexdigits�	octdigits�	printable�punctuation�
whitespace�	Formatter�Template�Nz 	

ZabcdefghijklmnopqrstuvwxyzZABCDEFGHIJKLMNOPQRSTUVWXYZ�
0123456789ZabcdefZABCDEFZ01234567z !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~cCs|pd�dd�|�|�D��S)N� css|]}|��VqdS�N)�
capitalize)�.0�x�r�/usr/lib64/python3.8/string.py�	<genexpr>0szcapwords.<locals>.<genexpr>)�join�split)�s�seprrrr%s)�ChainMapcs eZdZdZ�fdd�Z�ZS)�_TemplateMetaclassa/
    %(delim)s(?:
      (?P<escaped>%(delim)s) |   # Escape sequence of two delimiters
      (?P<named>%(id)s)      |   # delimiter and a Python identifier
      {(?P<braced>%(bid)s)}  |   # delimiter and a braced identifier
      (?P<invalid>)              # Other ill-formed delimiter exprs
    )
    csbtt|��|||�d|kr$|j}n$tjt�|j�|j|jp@|jd�}t�	||j
tjB�|_dS)N�pattern)Zdelim�idZbid)�superr�__init__r�_re�escape�	delimiter�	idpattern�braceidpattern�compile�flags�VERBOSE)�cls�name�basesZdctr��	__class__rrr Cs

�z_TemplateMetaclass.__init__)�__name__�
__module__�__qualname__rr �
__classcell__rrr,rr9s	rc@sFeZdZdZdZdZejZdd�Z	dd�Z
efdd	�Zefd
d�Z
dS)r�$z(?a:[_a-z][_a-z0-9]*)NcCs
||_dSr)�template)�selfr3rrrr \szTemplate.__init__cCsd|�d�}|jd|�jdd�}|s.d}d}n"|td�|dd���}t|�}td||f��dS)N�invalidT)�keepends�����z.Invalid placeholder in string: line %d, col %d)�startr3�
splitlines�lenr�
ValueError)r4�mo�i�lines�colno�linenorrr�_invalidas
�zTemplate._invalidcs:�tkr|�n|rt|�����fdd�}�j�|�j�S)Ncsd|�d�p|�d�}|dk	r(t�|�S|�d�dk	r<�jS|�d�dk	rT��|�td�j��dS�N�namedZbracedZescapedr5z#Unrecognized named group in pattern)�group�strr#rCr=r�r>rE��mappingr4rr�convertss
�z$Template.substitute.<locals>.convert��_sentinel_dict�	_ChainMapr�subr3�r4rJZkwsrKrrIr�
substitutems
zTemplate.substitutecs:�tkr|�n|rt|�����fdd�}�j�|�j�S)Ncs�|�d�p|�d�}|dk	rHzt�|�WStk
rF|��YSX|�d�dk	r\�jS|�d�dk	rr|��Std�j��dSrD)rFrG�KeyErrorr#r=rrHrIrrrK�s�z)Template.safe_substitute.<locals>.convertrLrPrrIr�safe_substitute�s

zTemplate.safe_substitute)r.r/r0r#r$r%r!�
IGNORECASEr'r rCrMrQrSrrrrrPs)�	metaclassc@sVeZdZdd�Zdd�Zddd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�ZdS)rcOs|�|||�Sr)�vformat)r4�
format_string�args�kwargsrrr�format�szFormatter.formatcCs.t�}|�||||d�\}}|�|||�|S)N�)�set�_vformat�check_unused_args)r4rWrXrY�	used_args�result�_rrrrV�szFormatter.vformatr
c	Cs�|dkrtd��g}|�|�D]�\}}	}
}|r8|�|�|	dk	r|	dkrj|dkrXtd��t|�}	|d7}n|	��r�|r~td��d}|�|	||�\}}
|�|
�|�||�}|j|
||||d|d�\}
}|�|�	||
��qd�
|�|fS)Nr
zMax string recursion exceededr8FzJcannot switch from manual field specification to automatic field numberingr7)�auto_arg_index)r=�parse�appendrG�isdigit�	get_field�add�
convert_fieldr]�format_fieldr)r4rWrXrYr_Zrecursion_depthrbr`Zliteral_text�
field_name�format_spec�
conversion�objZarg_usedrrrr]�s<�


�
zFormatter._vformatcCst|t�r||S||SdSr)�
isinstance�int)r4�keyrXrYrrr�	get_value�s
zFormatter.get_valuecCsdSrr)r4r_rXrYrrrr^�szFormatter.check_unused_argscCs
t||�Sr)rZ)r4�valuerkrrrri�szFormatter.format_fieldcCsN|dkr|S|dkrt|�S|dkr,t|�S|dkr<t|�Std�|���dS)Nr�r�az"Unknown conversion specifier {0!s})rG�repr�asciir=rZ)r4rrrlrrrrh�szFormatter.convert_fieldcCs
t�|�Sr)�_stringZformatter_parser)r4rWrrrrcszFormatter.parsec	CsJt�|�\}}|�|||�}|D] \}}|r8t||�}q ||}q ||fSr)rwZformatter_field_name_splitrq�getattr)	r4rjrXrY�first�restrmZis_attrr?rrrrf
s
zFormatter.get_fieldN)r
)r.r/r0rZrVr]rqr^rirhrcrfrrrrr�s�
6	)N)�__all__rwr
rrrrrrr	rr�rer!�collectionsrrNrM�typerrrrrrr�<module>s4�
Q__pycache__/plistlib.cpython-38.opt-1.pyc000064400000064734151153537600014211 0ustar00U

e5d�}�
@s>dZddddddddd	d
ddd
g
ZddlZddlZddlZddlZddlZddlmZddl	Z	ddl
Z
ddlZddlZddl
mZddlmZejdded�Ze��ej�ejdd��Zdd�Zdd�Zdd�Zdd�ZGdd�d�ZGdd
�d
�ZdZe� d�Z!dLd!d"�Z"d#d$�Z#e� d%ej$�Z%d&d'�Z&d(d)�Z'd*d+�Z(Gd,d-�d-�Z)Gd.d/�d/�Z*Gd0d1�d1e*�Z+d2d3�Z,Gd4d�de-�Z.d5d6d7d8d9�Z/e0�Z1Gd:d;�d;�Z2d<d=�Z3e4e5e6eje7fZ8Gd>d?�d?e0�Z9d@dA�Z:e;e<e,e)e+dB�e=e<e:e2e9dB�iZ>ddCe<dD�dEd	�Z?ddCe<dD�dFd�Z@e;dCdGdH�dId
�ZAe;dGdCdJ�dKd�ZBdS)Ma�plistlib.py -- a tool to generate and parse MacOSX .plist files.

The property list (.plist) file format is a simple XML pickle supporting
basic object types, like dictionaries, lists, numbers and strings.
Usually the top level object is a dictionary.

To write out a plist file, use the dump(value, file)
function. 'value' is the top level object, 'file' is
a (writable) file object.

To parse a plist from a file, use the load(file) function,
with a (readable) file object as the only argument. It
returns the top level object (again, usually a dictionary).

To work with plist data in bytes objects, you can use loads()
and dumps().

Values can be strings, integers, floats, booleans, tuples, lists,
dictionaries (but only with string keys), Data, bytes, bytearray, or
datetime.datetime objects.

Generate Plist example:

    pl = dict(
        aString = "Doodah",
        aList = ["A", "B", 12, 32.1, [1, 2, 3]],
        aFloat = 0.1,
        anInt = 728,
        aDict = dict(
            anotherString = "<hello & hi there!>",
            aUnicodeValue = "M\xe4ssig, Ma\xdf",
            aTrueValue = True,
            aFalseValue = False,
        ),
        someData = b"<binary gunk>",
        someMoreData = b"<lots of binary gunk>" * 10,
        aDate = datetime.datetime.fromtimestamp(time.mktime(time.gmtime())),
    )
    with open(fileName, 'wb') as fp:
        dump(pl, fp)

Parse Plist example:

    with open(fileName, 'rb') as fp:
        pl = load(fp)
    print(pl["aKey"])
�	readPlist�
writePlist�readPlistFromBytes�writePlistToBytes�Data�InvalidFileException�FMT_XML�
FMT_BINARY�load�dump�loads�dumps�UID�N)�BytesIO)�warn)�ParserCreate�PlistFormatzFMT_XML FMT_BINARY)�modulec	cs2t|t�r(t||��}|VW5QRXn|VdS�N)�
isinstance�str�open)�
pathOrFile�mode�fp�r� /usr/lib64/python3.8/plistlib.py�_maybe_openOs
rc
Cs<tdtd�t|d��}t|ddd�W5QR�SQRXdS)z�
    Read a .plist from a path or file. pathOrFile should either
    be a file name, or a readable binary file object.

    This function is deprecated, use load instead.
    z8The readPlist function is deprecated, use load() instead��rbNF��fmt�use_builtin_types)r�DeprecationWarningrr	)rrrrrrYs�c	Cs8tdtd�t|d��}t||tddd�W5QRXdS)z�
    Write 'value' to a .plist file. 'pathOrFile' may either be a
    file name or a (writable) file object.

    This function is deprecated, use dump instead.
    z9The writePlist function is deprecated, use dump() insteadr�wbTF�r!�	sort_keys�skipkeysN)rr#rr
r)�valuerrrrrrfs�cCstdtd�tt|�ddd�S)z}
    Read a plist data from a bytes object. Return the root object.

    This function is deprecated, use loads instead.
    zBThe readPlistFromBytes function is deprecated, use loads() insteadrNFr )rr#r	r��datarrrrss
�cCs,tdtd�t�}t||tddd�|��S)zp
    Return 'value' as a plist-formatted bytes object.

    This function is deprecated, use dumps instead.
    zAThe writePlistToBytes function is deprecated, use dumps() insteadrTFr%)rr#rr
r�getvalue)r(�frrrr~s�c@s>eZdZdZdd�Zedd��Zddd�Zd	d
�Zdd�Z	d
S)rz]
    Wrapper for binary data.

    This class is deprecated, use a bytes object instead.
    cCst|t�std��||_dS)Nzdata must be as bytes)r�bytes�	TypeErrorr*��selfr*rrr�__init__�s
z
Data.__init__cCs|t|��Sr)�_decode_base64)�clsr*rrr�
fromBase64�szData.fromBase64�LcCst|j|�Sr)�_encode_base64r*)r0�
maxlinelengthrrr�asBase64�sz
Data.asBase64cCs4t||j�r|j|jkSt|t�r,|j|kStSdSr)r�	__class__r*r-�NotImplemented�r0�otherrrr�__eq__�s


zData.__eq__cCsd|jjt|j�fS�Nz%s(%s)�r9�__name__�reprr*�r0rrr�__repr__�sz
Data.__repr__N)r5)
r@�
__module__�__qualname__�__doc__r1�classmethodr4r8r=rCrrrrr�s

c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)r
cCs<t|t�std��|dkr"td��|dkr2td��||_dS)Nzdata must be an int�zUIDs cannot be >= 2**64r�UIDs must be positive)r�intr.�
ValueErrorr*r/rrrr1�s
zUID.__init__cCs|jSrr)rBrrr�	__index__�sz
UID.__index__cCsd|jjt|j�fSr>r?rBrrrrC�szUID.__repr__cCs|j|jffSr)r9r*rBrrr�
__reduce__�szUID.__reduce__cCst|t�stS|j|jkSr)rr
r:r*r;rrrr=�s
z
UID.__eq__cCs
t|j�Sr)�hashr*rBrrr�__hash__�szUID.__hash__N)	r@rDrEr1rLrCrMr=rOrrrrr
�s	s�<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
zv[\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0c\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f]r5cCsP|dd}g}tdt|�|�D]$}||||�}|�t�|��q d�|�S)N��r�)�range�len�append�binasciiZ
b2a_base64�join)�sr7Z
maxbinsize�pieces�i�chunkrrrr6�sr6cCs(t|t�rt�|�d��St�|�SdS)N�utf-8)rrrVZ
a2b_base64�encode)rXrrrr2�s
r2z{(?P<year>\d\d\d\d)(?:-(?P<month>\d\d)(?:-(?P<day>\d\d)(?:T(?P<hour>\d\d)(?::(?P<minute>\d\d)(?::(?P<second>\d\d))?)?)?)?)?ZcCsLd}t�|���}g}|D]&}||}|dkr2qB|�t|��qtj|�S)N�ZyearZmonthZdayZhourZminute�second)�_dateParser�match�	groupdictrUrJ�datetime)rX�orderZgdZlst�key�valrrr�_date_from_string�srgcCs d|j|j|j|j|j|jfS)Nz%04d-%02d-%02dT%02d:%02d:%02dZr^)�drrr�_date_to_strings�ricCsZt�|�}|dk	rtd��|�dd�}|�dd�}|�dd�}|�dd�}|�d	d
�}|S)Nz<strings can't contains control characters; use bytes insteadz
�
�
�&z&amp;�<z&lt;�>z&gt;)�_controlCharPat�searchrK�replace)�text�mrrr�_escapes
rtc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)S)*�_PlistParsercCs"g|_d|_d|_||_||_dSr)�stack�current_key�root�_use_builtin_types�
_dict_type�r0r"�	dict_typerrrr1s
z_PlistParser.__init__cCsBt�|_|j|j_|j|j_|j|j_|j|j_	|j�
|�|jSr)r�parser�handle_begin_elementZStartElementHandler�handle_end_elementZEndElementHandler�handle_dataZCharacterDataHandler�handle_entity_declZEntityDeclHandlerZ	ParseFilerx)r0Zfileobjrrr�parses



z_PlistParser.parsecCstd��dS)Nz8XML entity declarations are not supported in plist files)r)r0Zentity_nameZis_parameter_entityr(�baseZ	system_idZ	public_idZ
notation_namerrrr�$sz_PlistParser.handle_entity_declcCs*g|_t|d|d�}|dk	r&||�dS)NZbegin_)r*�getattr)r0�element�attrs�handlerrrrr~*sz!_PlistParser.handle_begin_elementcCs"t|d|d�}|dk	r|�dS)NZend_)r�)r0r�r�rrrr0sz_PlistParser.handle_end_elementcCs|j�|�dSr)r*rUr/rrrr�5sz_PlistParser.handle_datacCs�|jdk	rFt|jdti��s.td|jj��||jd|j<d|_nB|jsT||_n4t|jdtg��sxtd|jj��|jd�|�dS)N���zunexpected element at line %d)	rwrrv�typerKr}�CurrentLineNumberrxrU�r0r(rrr�
add_object8s
��z_PlistParser.add_objectcCsd�|j�}g|_|S)N�)rWr*r/rrr�get_dataHsz_PlistParser.get_datacCs"|��}|�|�|j�|�dSr)rzr�rvrU)r0r�rhrrr�
begin_dictOs
z_PlistParser.begin_dictcCs*|jrtd|j|jjf��|j��dS)Nz%missing value for key '%s' at line %d)rwrKr}r�rv�poprBrrr�end_dictTs
�z_PlistParser.end_dictcCs8|jst|jdti��s*td|jj��|��|_dS)Nr�zunexpected key at line %d)rwrrvr�rKr}r�r�rBrrr�end_keyZs
�z_PlistParser.end_keycCsg}|�|�|j�|�dSr)r�rvrU)r0r��arrr�begin_array`s
z_PlistParser.begin_arraycCs|j��dSr)rvr�rBrrr�	end_arrayesz_PlistParser.end_arraycCs|�d�dS)NT�r�rBrrr�end_truehsz_PlistParser.end_truecCs|�d�dS)NFr�rBrrr�	end_falseksz_PlistParser.end_falsecCs@|��}|�d�s|�d�r.|�t|d��n|�t|��dS)NZ0xZ0X�)r��
startswithr�rJ)r0�rawrrr�end_integernsz_PlistParser.end_integercCs|�t|����dSr)r��floatr�rBrrr�end_realusz_PlistParser.end_realcCs|�|���dSr)r�r�rBrrr�
end_stringxsz_PlistParser.end_stringcCs2|jr|�t|����n|�t�|����dSr)ryr�r2r�rr4rBrrr�end_data{sz_PlistParser.end_datacCs|�t|����dSr)r�rgr�rBrrr�end_date�sz_PlistParser.end_dateN)r@rDrEr1r�r�r~rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrus(	ruc@s8eZdZddd�Zdd�Zdd�Zdd
d�Zdd
�Zd	S)�_DumbXMLWriterr�	cCs||_g|_||_||_dSr)�filerv�
_indent_level�indent)r0r��indent_levelr�rrrr1�sz_DumbXMLWriter.__init__cCs,|j�|�|�d|�|jd7_dS)Nz<%s>�)rvrU�writelnr��r0r�rrr�
begin_element�sz_DumbXMLWriter.begin_elementcCs |jd8_|�d|�dS)Nr�z</%s>)r�r�r�rrr�end_element�sz_DumbXMLWriter.end_elementNcCs8|dk	r&t|�}|�d|||f�n|�d|�dS)Nz<%s>%s</%s>z<%s/>)rtr�)r0r�r(rrr�simple_element�sz_DumbXMLWriter.simple_elementcCsH|r8t|t�r|�d�}|j�|j|j�|j�|�|j�d�dS)Nr\�
)rrr]r��writer�r�)r0�linerrrr��s

z_DumbXMLWriter.writeln)rr�)N)r@rDrEr1r�r�r�r�rrrrr��s


r�c@sFeZdZddd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Zdd�Z	dS)�_PlistWriterr�	r�TFcCs.|r|�t�t�||||�||_||_dSr)r��PLISTHEADERr�r1�
_sort_keys�	_skipkeys)r0r�r�r�ZwriteHeaderr&r'rrrr1�s

z_PlistWriter.__init__cCs"|�d�|�|�|�d�dS)Nz<plist version="1.0">z</plist>)r��write_valuer�rrrr��s

z_PlistWriter.writecCs4t|t�r|�d|��n|dkr0|�d��n|dkrD|�d�n�t|t�r�d|krbdkrxnn|�dd	|�nt|��n�t|t�r�|�d
t|��n�t|t�r�|�|�n|t|t	�r�|�
|�nft|ttf�r�|�
|�nLt|tj��r|�dt|��n,t|ttf��r |�|�ntdt|���dS)
N�stringT�trueFZfalsel����rHZintegerz%d�real�datezunsupported type: %s)rrr�rJ�
OverflowErrorr�rA�dict�
write_dictr�
write_datar-�	bytearray�write_bytesrcri�tuple�list�write_arrayr.r�r�rrrr��s.





z_PlistWriter.write_valuecCs|�|j�dSr)r�r*r/rrrr��sz_PlistWriter.write_datacCsz|�d�|jd8_tddt|j�dd�|j��}t||��d�D]}|rJ|�|�qJ|jd7_|�	d�dS)Nr*r�r�r5r�s        r�)
r�r��maxrTr�rqr6�splitr�r�)r0r*r7r�rrrr��s
�z_PlistWriter.write_bytescCs�|rt|�d�|jr"t|���}n|��}|D]8\}}t|t�sP|jrHq.td��|�d|�|�	|�q.|�
d�n
|�d�dS)Nr��keys must be stringsre)r�r��sorted�itemsrrr�r.r�r�r�)r0rhr�rer(rrrr��s

z_PlistWriter.write_dictcCs<|r.|�d�|D]}|�|�q|�d�n
|�d�dS)N�array)r�r�r�r�)r0r�r(rrrr�s
z_PlistWriter.write_arrayN)rr�r�TF)
r@rDrEr1r�r�r�r�r�r�rrrrr��s�

%
r�cCs�d}|D]}|�|�rdSqtjdftjdftjdffD]N\}}|�|�sNq:|D]4}||�d��|�}|dt|��|krRdSqRq:dS)N)s<?xmls<plistTr\z	utf-16-bez	utf-16-le�asciiF)r��codecs�BOM_UTF8�BOM_UTF16_BE�BOM_UTF16_LE�decoder]rT)�header�prefixesZpfxZbom�encoding�start�prefixrrr�_is_fmt_xmls
�
r�c@seZdZddd�ZdS)r�Invalid filecCst�||�dSr)rKr1)r0�messagerrrr12szInvalidFileException.__init__N)r�)r@rDrEr1rrrrr1s�B�H�L�Q)r�rrP�c@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�_BinaryPlistParsera
    Read or write a binary plist file, following the description of the binary
    format.  Raise InvalidFileException in case of error, otherwise return the
    root object.

    see also: http://opensource.apple.com/source/CF/CF-744.18/CFBinaryPList.c
    cCs||_||_dSr)ryrzr{rrrr1Asz_BinaryPlistParser.__init__cCs�z~||_|j�dtj�|j�d�}t|�dkr6t��t�d|�\}|_	}}}|j�|�|�
||�|_tg||_
|�|�WStttjttfk
r�t��YnXdS)Ni��� z>6xBBQQQ)�_fp�seek�os�SEEK_END�readrTr�struct�unpack�	_ref_size�
_read_ints�_object_offsets�
_undefined�_objects�_read_object�OSError�
IndexError�errorr�rK)r0r�trailer�offset_size�num_objects�
top_object�offset_table_offsetrrrr�Es*
��z_BinaryPlistParser.parsecCsL|dkrH|j�d�dd@}d|>}dt|}t�||j�|��dS|S)z$ return the size of the next object.�r�rrQrn)r�r��_BINARY_FORMATr�r�)r0�tokenLrsrXr,rrr�	_get_size^sz_BinaryPlistParser._get_sizecst|j��|���tkr2t�d|�t�����S�rFt���|krLt��t��fdd�td�|��D��SdS)Nrnc3s&|]}t��||��d�VqdS)�bigN)rJ�
from_bytes)�.0rZ�r*�sizerr�	<genexpr>os�z0_BinaryPlistParser._read_ints.<locals>.<genexpr>r)	r�r�r�r�r�rTrr�rS)r0�nr�rr�rr�hs�z_BinaryPlistParser._read_intscCs|�||j�Sr)r�r�)r0r�rrr�
_read_refsrsz_BinaryPlistParser._read_refscs�j|}|tk	r|S�j|}�j�|��j�d�d}|d@|d@}}|dkr^d}�n�|dkrnd}�n�|dkr~d	}�n�|dkr�d
}�n�|dkr�tj�j�d|>�d|d
kd�}�nT|dkr�t�	d�j�d��d}�n0|dk�rt�	d�j�d��d}�n
|dk�rDt�	d�j�d��d}t
�
ddd�t
j|d�}�n�|dk�r���|�}�j�|�}t
|�|k�rxt���j�st|�}�n�|dk�rΈ�|�}�j�|�}	t
|	�|k�r�t��|	�d�}�n@|dk�r��|�d}�j�|�}	t
|	�|k�rt��|	�d�}n�|dk�r:tt��j�d|�d��}n�|dk�r���|�}��|�}
g}|�j|<|��fdd �|
D��n�|d!k�r��|�}��|�}��|�}
���}|�j|<z.t||
�D]\}}
��|
�|��|�<�q�Wntk
�rt��YnXnt��|�j|<|S)"zx
        read the object by reference.

        May recursively read sub-objects (content of an array/dict/set)
        r�r��r�Nr�F�	TrRr�r�rQ�Zsigned�"z>frP�#z>d�3��)Zseconds�@�Pr��`r�utf-16be��c3s|]}��|�VqdSr)r�)r��xrBrrr��sz2_BinaryPlistParser._read_object.<locals>.<genexpr>��)r�r�r�r�r�r�rJr�r�r�rcZ	timedeltar�rTrryrr�r
r��extendrz�zipr�r.)r0�ref�result�offset�tokenZtokenHr�r,rXr*Zobj_refsZkey_refs�k�orrBrr�us�

�



�















z_BinaryPlistParser._read_objectN)
r@rDrErFr1r�r�r�r�r�rrrrr�9s

r�cCs,|dkrdS|dkrdS|dkr$dSdSdS)N�r��r�rPr�r)�countrrr�_count_to_size�src@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�_BinaryPlistWritercCs||_||_||_dSr)r�r�r�)r0rr&r'rrrr1�sz_BinaryPlistWriter.__init__c
Cs�g|_i|_i|_|�|�t|j�}dg||_t|�|_t|j|_	|j
�d�|jD]}|�|�qZ|�
|�}|j
��}t|�}dt||}|j
�tj|f|j���d}|||j|||f}	|j
�tjd|	���dS)Nr�bplist00rn�	>5xBBBQQQ)r)�_objlist�	_objtable�_objidtable�_flattenrTr�rr�r��_ref_formatr�r��
_write_object�
_getrefnum�tellr��pack)
r0r(r��objr�r�r�Z
offset_formatZsort_versionr�rrrr��s2





�z_BinaryPlistWriter.writec	Csrt|t�r"t|�|f|jkrZdSn8t|t�rHt|j�|jf|jkrZdSnt|�|jkrZdSt|j	�}|j	�
|�t|t�r�||jt|�|f<n0t|t�r�||jt|j�|jf<n||jt|�<t|t��rHg}g}|��}|j
r�t|�}|D]:\}}t|t��s|j�r
q�td��|�
|�|�
|�q�t�||�D]}|�|��q4n&t|ttf��rn|D]}|�|��q\dS)Nr�)r�_scalarsr�r rr*�idr!rTrrUr�r�r�r�rr�r.�	itertools�chainr"r�r�)	r0r(Zrefnum�keys�valuesr�r�vrrrrr"sB





z_BinaryPlistWriter._flattencCsNt|t�r|jt|�|fSt|t�r<|jt|j�|jfS|jt|�SdSr)rr)r r�rr*r!r*r�rrrr%Ns


z_BinaryPlistWriter._getrefnumcCs�|dkr"|j�t�d||B��n�|dkrH|j�t�d|dBd|��nh|dkrn|j�t�d|dBd|��nB|d	kr�|j�t�d
|dBd|��n|j�t�d|dBd
|��dS)Nr�z>Brz>BBBr�rz>BBH�rz>BBL�z>BBQ�)r�r�r�r')r0rr�rrr�_write_sizeVsz_BinaryPlistWriter._write_sizecs���|�}�j���j|<|dkr2�j�d��nl|dkrJ�j�d��nT|dkrb�j�d��n<t|t��rl|dkr�z�j�t�dd|��Wn tj	k
r�t
|�d�YnXn�|d	krԈj�t�d
d|��n�|dkr�j�t�d
d|��nt|dk�r�j�t�dd|��nR|dk�r8�j�t�dd|��n0|dk�r`�j�d|jdddd��nt
|���n2t|t��r��j�t�dd|���nt|t
j
��r�|t
�
ddd���}�j�t�dd|���n�t|t��r��dt|j���j�|j��n�t|ttf��r0��dt|���j�|��nnt|t��r�z|�d�}��dt|��Wn4tk
�r�|�d �}��d!t|�d"�YnX�j�|��n�t|t��r^|jdk�r�td#��n�|jd	k�r�j�t�d
d$|��nt|jdk�r
�j�t�d
d%|��nP|jdk�r.�j�t�dd&|��n,|jdk�rR�j�t�dd'|��nt
|���n@t|ttf��r��fd(d)�|D�}t|�}��d*|��j�tjd+�j|f|���n�t|t��r�gg}}�j�r�t|� ��}	n|� �}	|	D]J\}
}t|
t��s�j!�r�q�t"d,��|�#��|
��|�#��|���q�t|�}��d-|��j�tjd+�j|f|����j�tjd+�j|f|���nt"|��dS).N�F�Tr�rz>Bqr2rz>BBr�rz>BHr0rz>BLr1lz>BQrH�r�rz>Bdrrr�rrr�rr
r	rrIr���csg|]}��|��qSr)r%)r�rrBrr�
<listcomp>�sz4_BinaryPlistWriter._write_object.<locals>.<listcomp>rrnr�r)$r%r�r&r�r�rrJr�r'r�r��to_bytesr�rcZ
total_secondsrr3rTr*r-r�rr]�UnicodeEncodeErrorr
rKr�r�r#r�r�r�r�r�r.rU)r0r(rr,�tZrefsrXZkeyRefsZvalRefsZ	rootItemsrr/rrBrr$fs�






$
"$z _BinaryPlistWriter._write_objectN)	r@rDrEr1r�r"r%r3r$rrrrr�s-0rcCs|dd�dkS)Nr�rr)r�rrr�_is_fmt_binary�sr>)�detectr}�writerT�r!r"r|cCsl|dkrJ|�d�}|�d�t��D]}|d|�r$|d}qVq$t��nt|d}|||d�}|�|�S)z�Read a .plist file. 'fp' should be a readable and binary file object.
    Return the unpacked root object (which usually is a dictionary).
    Nr�rr?r})r"r|)r�r��_FORMATSr.rr�)rr!r"r|r��info�P�prrrr	�s

cCst|�}t||||d�S)zqRead a .plist file from a bytes object.
    Return the unpacked root object (which usually is a dictionary).
    rA)rr	)r(r!r"r|rrrrr�s�Fr%cCs:|tkrtd|f��t|d|||d�}|�|�dS)zWWrite 'value' to a .plist file. 'fp' should be a writable,
    binary file object.
    zUnsupported format: %rr@)r&r'N)rBrKr�)r(rr!r&r'r@rrrr
s�r!r'r&cCs t�}t|||||d�|��S)z?Return a bytes object with the contents for a .plist file.
    rF)rr
r+)r(r!r'r&rrrrrs)r5)CrF�__all__rVr��
contextlibrc�enum�iorr+r��rer��warningsrZxml.parsers.expatr�Enumr@r�globals�update�__members__�contextmanagerrrrrrrr
r��compileror6r2�ASCIIr`rgrirtrur�r�r�rKrr��objectr�r�rrrJr�r-r)rr>rr�rrBr	rr
rrrrr�<module>s�0�

	


'"�
	
s&d!$
a	���	__pycache__/optparse.cpython-38.pyc000064400000135673151153537600013266 0ustar00U

e5d���@s�dZdZdddddddd	d
ddd
dddddgZdZddlZddlZddlZdd�ZzddlmZm	Z	Wn$e
k
r�dd�Zdd�Z	YnXeZGdd
�d
e�Z
Gdd�de
�ZGdd�de�ZGd d�de
�ZGd!d�de
�ZGd"d#�d#e�ZGd$d
�d
�ZGd%d�de�ZGd&d�de�Zd'd(�Zd)d*�Zeed+�feed+�feed,�feed-�fd.�Zd/d0�Zd1d�Zd2ZGd3d�d�Zd4Zd5Z Gd6d�d�Z!Gd7d�d�Z"Gd8d�de"�Z#Gd9d	�d	e"�Z$d:d;�Z%eZ&dS)<a�A powerful, extensible, and easy-to-use option parser.

By Greg Ward <gward@python.net>

Originally distributed as Optik.

For support, use the optik-users@lists.sourceforge.net mailing list
(http://lists.sourceforge.net/lists/listinfo/optik-users).

Simple usage example:

   from optparse import OptionParser

   parser = OptionParser()
   parser.add_option("-f", "--file", dest="filename",
                     help="write report to FILE", metavar="FILE")
   parser.add_option("-q", "--quiet",
                     action="store_false", dest="verbose", default=True,
                     help="don't print status messages to stdout")

   (options, args) = parser.parse_args()
z1.5.3�Option�make_option�
SUPPRESS_HELP�SUPPRESS_USAGE�Values�OptionContainer�OptionGroup�OptionParser�
HelpFormatter�IndentedHelpFormatter�TitledHelpFormatter�
OptParseError�OptionError�OptionConflictError�OptionValueError�BadOptionError�check_choicea"
Copyright (c) 2001-2006 Gregory P. Ward.  All rights reserved.
Copyright (c) 2002-2006 Python Software Foundation.  All rights reserved.

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

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

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

  * Neither the name of the author nor the names of its
    contributors may be used to endorse or promote products derived from
    this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
�NcCsd|jjt|�|fS)Nz<%s at 0x%x: %s>)�	__class__�__name__�id��self�r� /usr/lib64/python3.8/optparse.py�_reprOsr)�gettext�ngettextcCs|S�Nr)�messagerrrr\srcCs|dkr|S|S�N�r)ZsingularZplural�nrrrr_src@seZdZdd�Zdd�ZdS)rcCs
||_dSr��msg�rr#rrr�__init__hszOptParseError.__init__cCs|jSrr"rrrr�__str__kszOptParseError.__str__N)r�
__module__�__qualname__r%r&rrrrrgsc@s eZdZdZdd�Zdd�ZdS)r
z]
    Raised if an Option instance is created with invalid or
    inconsistent arguments.
    cCs||_t|�|_dSr)r#�str�	option_id)rr#�optionrrrr%uszOptionError.__init__cCs |jrd|j|jfS|jSdS)Nz
option %s: %s)r*r#rrrrr&yszOptionError.__str__N�rr'r(�__doc__r%r&rrrrr
osc@seZdZdZdS)rzE
    Raised if conflicting options are added to an OptionParser.
    N�rr'r(r-rrrrrsc@seZdZdZdS)rzS
    Raised if an invalid option value is encountered on the command
    line.
    Nr.rrrrr�sc@s eZdZdZdd�Zdd�ZdS)rzB
    Raised if an invalid option is seen on the command line.
    cCs
||_dSr)�opt_str�rr/rrrr%�szBadOptionError.__init__cCstd�|jS)Nzno such option: %s)�_r/rrrrr&�szBadOptionError.__str__Nr,rrrrr�sc@s eZdZdZdd�Zdd�ZdS)�AmbiguousOptionErrorzD
    Raised if an ambiguous option is seen on the command line.
    cCst�||�||_dSr)rr%�
possibilities)rr/r3rrrr%�szAmbiguousOptionError.__init__cCstd�|jd�|j�fS)Nzambiguous option: %s (%s?)�, )r1r/�joinr3rrrrr&�s�zAmbiguousOptionError.__str__Nr,rrrrr2�sr2c@s�eZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!S)"r	a�
    Abstract base class for formatting option help.  OptionParser
    instances should use one of the HelpFormatter subclasses for
    formatting help; by default IndentedHelpFormatter is used.

    Instance attributes:
      parser : OptionParser
        the controlling OptionParser instance
      indent_increment : int
        the number of columns to indent per nesting level
      max_help_position : int
        the maximum starting column for option help text
      help_position : int
        the calculated starting column for option help text;
        initially the same as the maximum
      width : int
        total number of columns for output (pass None to constructor for
        this value to be taken from the $COLUMNS environment variable)
      level : int
        current indentation level
      current_indent : int
        current indentation level (in columns)
      help_width : int
        number of columns available for option help text (calculated)
      default_tag : str
        text to replace with each option's default value, "%default"
        by default.  Set to false value to disable default value expansion.
      option_strings : { Option : str }
        maps Option instances to the snippet of help text explaining
        the syntax of that option, e.g. "-h, --help" or
        "-fFILE, --file=FILE"
      _short_opt_fmt : str
        format string controlling how short options with values are
        printed in help text.  Must be either "%s%s" ("-fFILE") or
        "%s %s" ("-f FILE"), because those are the two syntaxes that
        Optik supports.
      _long_opt_fmt : str
        similar but for long options; must be either "%s %s" ("--file FILE")
        or "%s=%s" ("--file=FILE").
    Znonec	Cs�d|_||_|dkrLzttjd�}Wnttfk
rBd}YnX|d8}||_t|t	|d|d��|_
|_d|_d|_
d|_||_d|_i|_d|_d|_dS)	NZCOLUMNS�P��rz%defaultz%s %sz%s=%s)�parser�indent_increment�int�os�environ�KeyError�
ValueError�width�min�max�
help_position�max_help_position�current_indent�level�
help_width�short_first�default_tag�option_strings�_short_opt_fmt�
_long_opt_fmt�rr:rDr@rHrrrr%�s&
�
zHelpFormatter.__init__cCs
||_dSr)r9�rr9rrr�
set_parser�szHelpFormatter.set_parsercCs&|dkrtd|��d|d|_dS)N)�� z/invalid metavar delimiter for short options: %r�%s)r?rK�rZdelimrrr�set_short_opt_delimiter�s
�z%HelpFormatter.set_short_opt_delimitercCs&|dkrtd|��d|d|_dS)N)�=rQz.invalid metavar delimiter for long options: %rrR)r?rLrSrrr�set_long_opt_delimiter�s
�z$HelpFormatter.set_long_opt_delimitercCs"|j|j7_|jd7_dSr)rEr:rFrrrr�indent�szHelpFormatter.indentcCs4|j|j8_|jdks"td��|jd8_dS)NrzIndent decreased below 0.r )rEr:�AssertionErrorrFrrrr�dedent�szHelpFormatter.dedentcCstd��dS�Nzsubclasses must implement��NotImplementedError�r�usagerrr�format_usage�szHelpFormatter.format_usagecCstd��dSrZr[�rZheadingrrr�format_headingszHelpFormatter.format_headingcCs.t|j|jd�}d|j}tj||||d�S)z�
        Format a paragraph of free-form text for inclusion in the
        help output at the current indentation level.
        �rQ)Zinitial_indentZsubsequent_indent)rBr@rE�textwrapZfill)r�textZ
text_widthrWrrr�_format_texts
�zHelpFormatter._format_textcCs|r|�|�dSdSdS�N�
rP�re�r�descriptionrrr�format_descriptionsz HelpFormatter.format_descriptioncCs|rd|�|�dSdSdSrfrh)r�epilogrrr�
format_epilogszHelpFormatter.format_epilogcCsP|jdks|js|jS|jj�|j�}|tks6|dkr<|j}|j�|jt	|��Sr)
r9rI�help�defaults�get�dest�
NO_DEFAULT�NO_DEFAULT_VALUE�replacer))rr+Z
default_valuerrr�expand_defaultszHelpFormatter.expand_defaultcs�g}�j|}�j�jd}t|�|krBd�jd|f}�j}nd�jd||f}d}|�|�|jr���|�}t�|�j	�}|�d|d|df�|�
�fdd�|dd�D��n|d	d
kr�|�d
�d�|�S)Nr7�%*s%s
rPz	%*s%-*s  rcsg|]}d�jd|f�qS)rvrP)rC)�.0�linerrr�
<listcomp>Es�z/HelpFormatter.format_option.<locals>.<listcomp>r ���rg)rJrCrE�len�appendrnrurcZwraprG�extendr5)rr+�result�optsZ	opt_widthZindent_firstZ	help_textZ
help_linesrrr�
format_option(s&



�

zHelpFormatter.format_optioncCs�|��d}|jD],}|�|�}||j|<t|t|�|j�}q|��|jD]8}|jD],}|�|�}||j|<t|t|�|j�}qXqN|��|��t	|d|j
�|_t|j|jd�|_
dS)Nrr7rb)rW�option_list�format_option_stringsrJrBr{rE�
option_groupsrYrArDrCr@rG)rr9Zmax_len�optZstrings�grouprrr�store_option_stringsKs 






z"HelpFormatter.store_option_stringscst|��rF|jp|j�����fdd�|jD�}��fdd�|jD�}n|j}|j}�jrb||}n||}d�|�S)z@Return a comma-separated list of option strings & metavariables.csg|]}�j|�f�qSr)rK)rwZsopt��metavarrrrryas�z7HelpFormatter.format_option_strings.<locals>.<listcomp>csg|]}�j|�f�qSr)rL)rwZloptr�rrrycs�r4)�takes_valuer�rq�upper�_short_opts�
_long_optsrHr5)rr+Z
short_optsZ	long_optsrrr�rr�]s��
z#HelpFormatter.format_option_stringsN)rr'r(r-rsr%rOrTrVrWrYr_rarerkrmrur�r�r�rrrrr	�s")
#c@s*eZdZdZddd�Zdd	�Zd
d�ZdS)
r
z.Format help with indented section bodies.
    r7�Nr cCst�|||||�dSr�r	r%rMrrrr%ts�zIndentedHelpFormatter.__init__cCstd�|S)Nz
Usage: %s
)r1r]rrrr_|sz"IndentedHelpFormatter.format_usagecCsd|jd|fS)Nz%*s%s:
rP)rEr`rrrrasz$IndentedHelpFormatter.format_heading)r7r�Nr �rr'r(r-r%r_rarrrrr
ps�
c@s*eZdZdZddd�Zdd�Zd	d
�ZdS)rz1Format help with underlined section headers.
    rr�NcCst�|||||�dSrr�rMrrrr%�s�zTitledHelpFormatter.__init__cCsd|�td��|fS)Nz%s  %s
ZUsage)rar1r]rrrr_�sz TitledHelpFormatter.format_usagecCsd|d|jt|�fS)Nz%s
%s
z=-)rFr{r`rrrra�sz"TitledHelpFormatter.format_heading)rr�Nrr�rrrrr�s�
cCsh|dd���dkrd}nD|dd���dkrDd}|dd�p@d}n|dd�dkrZd}nd}|||�S)	Nr7Z0x�Z0b�0r ��
)�lower)�val�type�radixrrr�
_parse_num�sr�cCs
t|t�Sr)r�r;)r�rrr�
_parse_int�sr�Zintegerzfloating-point�complex)r;�long�floatr�cCsHt|j\}}z
||�WStk
rBttd�|||f��YnXdS)Nzoption %s: invalid %s value: %r)�_builtin_cvtr�r?rr1)r+r��valueZcvtZwhatrrr�
check_builtin�s
�r�cCs:||jkr|Sd�tt|j��}ttd�|||f��dS)Nr4z.option %s: invalid choice: %r (choose from %s))�choicesr5�map�reprrr1)r+r�r�r�rrrr�s
��)ZNOZDEFAULTc@s�eZdZdZdddddddd	d
ddd
gZdZdZdZdZdZ	dZ
eeeeed�Z
dZdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�ZeeeeeeegZd,d-�ZeZd.d/�Zd0d1�Zd2d3�Zd4d5�Z d6d7�Z!d8d9�Z"dS):rar
    Instance attributes:
      _short_opts : [string]
      _long_opts : [string]

      action : string
      type : string
      dest : string
      default : any
      nargs : int
      const : any
      choices : [string]
      callback : function
      callback_args : (any*)
      callback_kwargs : { string : any }
      help : string
      metavar : string
    �actionr�rq�default�nargs�constr��callback�
callback_args�callback_kwargsrnr�)
�store�store_const�
store_true�store_falser|�append_const�countr�rn�version)r�r�r�r�r|r�r�)r�r|r�)r�r|)r�r�)�stringr;r�r�r��choice)r;r�r�r�r�NcOsBg|_g|_|�|�}|�|�|�|�|jD]}||�q0dSr)r�r��_check_opt_strings�_set_opt_strings�
_set_attrs�
CHECK_METHODS)rr�attrs�checkerrrrr%4s



zOption.__init__cCsdd�|D�}|std��|S)NcSsg|]}|r|�qSrr)rwr�rrrryKsz-Option._check_opt_strings.<locals>.<listcomp>z+at least one option string must be supplied)�	TypeError)rrrrrr�GszOption._check_opt_stringscCs�|D]�}t|�dkr$td||��qt|�dkrd|ddkrH|ddksVtd||��|j�|�q|dd�dkr�|ddks�td||��|j�|�qdS)	Nr7z>invalid option string %r: must be at least two characters longr�-r zMinvalid short option string %r: must be of the form -x, (x any non-dash char)�--zGinvalid long option string %r: must start with --, followed by non-dash)r{r
r�r|r�)rrr�rrrr�Ps2������zOption._set_opt_stringscCsv|jD]F}||kr*t||||�||=q|dkr@t||t�qt||d�q|rrt|���}tdd�|�|��dS)Nr�zinvalid keyword arguments: %sr4)�ATTRS�setattrrr�sorted�keysr
r5)rr��attrrrrr�es
�zOption._set_attrscCs2|jdkrd|_n|j|jkr.td|j|��dS)Nr�zinvalid action: %r)r��ACTIONSr
rrrr�
_check_actionxs
zOption._check_actioncCs�|jdkr0|j|jkr�|jdk	r(d|_q�d|_n^t|jt�rF|jj|_|jdkrVd|_|j|jkrrtd|j|��|j|jkr�td|j|��dS)Nr�r�r)zinvalid option type: %rz$must not supply a type for action %r)	r�r��ALWAYS_TYPED_ACTIONSr��
isinstancer�TYPESr
�
TYPED_ACTIONSrrrr�_check_type~s 



�zOption._check_typecCsr|jdkrT|jdkr td|��qnt|jttf�sntdtt|j���d�d|��n|jdk	rntd|j|��dS)Nr�z/must supply a list of choices for type 'choice'z1choices must be a list of strings ('%s' supplied)�'r z#must not supply choices for type %r)r�r�r
r��tuple�listr)�splitrrrr�
_check_choice�s$

���
�zOption._check_choicecCs\|j|jkp|jdk	}|jdkrX|rX|jrH|jddd��dd�|_n|jdd|_dS)Nrr7r�r1r )r��
STORE_ACTIONSr�rqr�rtr�)rr�rrr�_check_dest�s�zOption._check_destcCs*|j|jkr&|jdk	r&td|j|��dS)Nz*'const' must not be supplied for action %r)r��
CONST_ACTIONSr�r
rrrr�_check_const�s
�zOption._check_constcCs<|j|jkr|jdkr8d|_n|jdk	r8td|j|��dS)Nr z*'nargs' must not be supplied for action %r)r�r�r�r
rrrr�_check_nargs�s

�zOption._check_nargscCs�|jdkrrt|j�s$td|j|��|jdk	rJt|jt�sJtd|j|��|jdk	r�t|jt�s�td|j|��nB|jdk	r�td|j|��|jdk	r�td|��|jdk	r�td|��dS)Nr�zcallback not callable: %rz3callback_args, if supplied, must be a tuple: not %rz4callback_kwargs, if supplied, must be a dict: not %rz.callback supplied (%r) for non-callback optionz.callback_args supplied for non-callback optionz0callback_kwargs supplied for non-callback option)	r��callabler�r
r�r�r�r��dictrrrr�_check_callback�sR

�

���

���
��
�
�zOption._check_callbackcCsd�|j|j�S)N�/)r5r�r�rrrrr&�szOption.__str__cCs
|jdk	Sr)r�rrrrr��szOption.takes_valuecCs|jr|jdS|jdSdS�Nr)r�r�rrrr�get_opt_string�s
zOption.get_opt_stringcCs*|j�|j�}|dkr|S||||�SdSr)�TYPE_CHECKERrpr�)rr�r�r�rrr�check_value�szOption.check_valuecs:|dk	r6�jdkr���|�St��fdd�|D��SdS)Nr csg|]}���|��qSr)r�)rw�v�r�rrrrysz(Option.convert_value.<locals>.<listcomp>)r�r�r�)rr�r�rr�r�
convert_values
zOption.convert_valuecCs$|�||�}|�|j|j||||�Sr)r��take_actionr�rq)rr�r��valuesr9rrr�processs�zOption.processc	Cs:|dkrt|||��n|dkr2t|||j��n|dkrHt||d�n�|dkr^t||d�n�|dkrz|�|g��|�n�|dkr�|�|g��|j�n�|d	kr�t|||�|d
�d�n||dkr�|jp�d
}|jp�i}|j||||f|�|�nF|dk�r|��|��n*|dk�r(|�	�|��nt
d|j��dS)Nr�r�r�Tr�Fr|r�r�rr r�rrnr�zunknown action %r)r�r��ensure_valuer|r�r�r��
print_help�exit�
print_versionr?r�)	rr�rqr�r�r�r9�args�kwargsrrrr�s4





zOption.take_action)#rr'r(r-r�r�r�r�r�r�r�r�rr�r�r%r�r�r�r�r�r�r�r�r�r�r&r�__repr__r�r�r�r�r�r�rrrrr�sl�
�	
	�	ZSUPPRESSHELPZ
SUPPRESSUSAGEc@s^eZdZddd�Zdd�ZeZdd�Zdd	�Zd
d�Z	dd
�Z
ddd�Zddd�Zdd�Z
dS)rNcCs&|r"|��D]\}}t|||�qdSr)�itemsr�)rror�r�rrrr%9szValues.__init__cCs
t|j�Sr)r)�__dict__rrrrr&>szValues.__str__cCs2t|t�r|j|jkSt|t�r*|j|kStSdSr)r�rr�r��NotImplemented)r�otherrrr�__eq__Cs



z
Values.__eq__cCs6t|�D](}||kr||}|dk	rt|||�qdS)z�
        Update the option values from an arbitrary dictionary, but only
        use keys from dict that already have a corresponding attribute
        in self.  Any keys in dict without a corresponding attribute
        are silently ignored.
        N)�dirr�)rr�r�Zdvalrrr�_update_carefulKs
zValues._update_carefulcCs|j�|�dS)z�
        Update the option values from an arbitrary dictionary,
        using all keys from the dictionary regardless of whether
        they have a corresponding attribute in self or not.
        N)r��update)rr�rrr�
_update_looseXszValues._update_loosecCs8|dkr|�|�n |dkr(|�|�ntd|��dS)N�carefulZloosezinvalid update mode: %r)r�r�r?)rr��moderrr�_update`s
zValues._updater�cCs&t|�tj|}|�t|�|�dSr)�
__import__�sys�modulesr��vars)r�modnamer��modrrr�read_modulehs
zValues.read_modulecCs&i}tt|���|�|�||�dSr)�exec�open�readr�)r�filenamer�r�rrr�	read_filemszValues.read_filecCs.t||�rt||�dkr$t|||�t||�Sr)�hasattr�getattrr�)rr�r�rrrr�rszValues.ensure_value)N)r�)r�)rr'r(r%r&rr�r�r�r�r�r�r�r�rrrrr7s



c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"S)#ra�
    Abstract base class.

    Class attributes:
      standard_option_list : [Option]
        list of standard options that will be accepted by all instances
        of this parser class (intended to be overridden by subclasses).

    Instance attributes:
      option_list : [Option]
        the list of Option objects contained by this OptionContainer
      _short_opt : { string : Option }
        dictionary mapping short option strings, eg. "-f" or "-X",
        to the Option instances that implement them.  If an Option
        has multiple short option strings, it will appear in this
        dictionary multiple times. [1]
      _long_opt : { string : Option }
        dictionary mapping long option strings, eg. "--file" or
        "--exclude", to the Option instances that implement them.
        Again, a given Option can occur multiple times in this
        dictionary. [1]
      defaults : { string : any }
        dictionary mapping option destination names to default
        values for each destination [1]

    [1] These mappings are common to (shared by) all components of the
        controlling OptionParser, where they are initially created.

    cCs&|��||_|�|�|�|�dSr)�_create_option_list�option_class�set_conflict_handler�set_description)rr�conflict_handlerrjrrrr%�s
zOptionContainer.__init__cCsi|_i|_i|_dSr��
_short_opt�	_long_optrorrrr�_create_option_mappings�sz'OptionContainer._create_option_mappingscCs|j|_|j|_|j|_dSrrrNrrr�_share_option_mappings�sz&OptionContainer._share_option_mappingscCs|dkrtd|��||_dS)N)�error�resolvez$invalid conflict_resolution value %r)r?r)r�handlerrrrr�sz$OptionContainer.set_conflict_handlercCs
||_dSr�rjrirrrr�szOptionContainer.set_descriptioncCs|jSrrrrrr�get_description�szOptionContainer.get_descriptioncCs|`|`|`dS�zsee OptionParser.destroy().Nrrrrr�destroy�szOptionContainer.destroycCs�g}|jD]"}||jkr
|�||j|f�q
|jD]"}||jkr4|�||j|f�q4|r�|j}|dkr�tdd�dd�|D��|��nd|dkr�|D]V\}}|�d�r�|j�	|�|j|=n|j�	|�|j|=|js�|js�|j
j�	|�q�dS)Nrz conflicting option string(s): %sr4cSsg|]}|d�qS)rr)rw�corrrry�sz3OptionContainer._check_conflict.<locals>.<listcomp>rr�)r�rr|r�rrrr5�
startswith�remove�	containerr�)rr+Z
conflict_optsr�r
Zc_optionrrr�_check_conflict�s2



��

zOptionContainer._check_conflictcOs�t|dt�r|j||�}n8t|�dkrL|sL|d}t|t�sTtd|��ntd��|�|�|j�|�||_	|j
D]}||j|<qv|jD]}||j
|<q�|jdk	r�|jtk	r�|j|j|j<n|j|jkr�d|j|j<|S)zOadd_option(Option)
           add_option(opt_str, ..., kwarg=val, ...)
        rr znot an Option instance: %r�invalid argumentsN)r�r)rr{rr�rr�r|rr�rr�rrqr�rrro)rr�r�r+r�rrr�
add_option�s(





zOptionContainer.add_optioncCs|D]}|�|�qdSr)r)rr�r+rrr�add_optionsszOptionContainer.add_optionscCs|j�|�p|j�|�Sr)rrprr0rrr�
get_options
�zOptionContainer.get_optioncCs||jkp||jkSr)rrr0rrr�
has_options
�zOptionContainer.has_optioncCsn|j�|�}|dkr |j�|�}|dkr4td|��|jD]}|j|=q:|jD]}|j|=qN|jj�|�dS)Nzno such option %r)	rrprr?r�r�rr�r)rr/r+r�rrr�
remove_options



zOptionContainer.remove_optioncCs>|js
dSg}|jD]}|jtk	r|�|�|��qd�|�S�NrP)r�rnrr|r�r5)r�	formatterr~r+rrr�format_option_helps

z"OptionContainer.format_option_helpcCs|�|���Sr)rkr�rrrrrrk(sz"OptionContainer.format_descriptioncCs:g}|jr|�|�|��|jr0|�|�|��d�|�S)Nrg)rjr|rkr�rr5�rrr~rrr�format_help+szOptionContainer.format_helpN)rr'r(r-r%r	r
rrrrrrrrrrrrkr"rrrrrxs"			c@s6eZdZddd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
rNcCs$||_t�||j|j|�||_dSr)r9rr%rr�title)rr9r#rjrrrr%6s�zOptionGroup.__init__cCsg|_|�|j�dSr)r�r
r9rrrrr<szOptionGroup._create_option_listcCs
||_dSr)r#)rr#rrr�	set_title@szOptionGroup.set_titlecCst�|�|`dSr)rrr�rrrrrCs
zOptionGroup.destroycCs0|�|j�}|��|t�||�7}|��|Sr)rar#rWrr"rYr!rrrr"Js
zOptionGroup.format_help)N)rr'r(r%rr$rr"rrrrr4s

c
@sbeZdZdZgZddedddddddf
dd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dPdd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�ZdQd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Z dRd<d=�Z!d>d?�Z"d@dA�Z#dSdBdC�Z$dDdE�Z%dTdFdG�Z&dUdHdI�Z'dJdK�Z(dVdLdM�Z)dWdNdO�Z*dS)Xra$
    Class attributes:
      standard_option_list : [Option]
        list of standard options that will be accepted by all instances
        of this parser class (intended to be overridden by subclasses).

    Instance attributes:
      usage : string
        a usage string for your program.  Before it is displayed
        to the user, "%prog" will be expanded to the name of
        your program (self.prog or os.path.basename(sys.argv[0])).
      prog : string
        the name of the current program (to override
        os.path.basename(sys.argv[0])).
      description : string
        A paragraph of text giving a brief overview of your program.
        optparse reformats this paragraph to fit the current terminal
        width and prints it when the user requests help (after usage,
        but before the list of options).
      epilog : string
        paragraph of help text to print after option help

      option_groups : [OptionGroup]
        list of option groups in this parser (option groups are
        irrelevant for parsing the command-line, but very useful
        for generating help)

      allow_interspersed_args : bool = true
        if true, positional arguments may be interspersed with options.
        Assuming -a and -b each take a single argument, the command-line
          -ablah foo bar -bboo baz
        will be interpreted the same as
          -ablah -bboo -- foo bar baz
        If this flag were false, that command line would be interpreted as
          -ablah -- foo bar -bboo baz
        -- ie. we stop processing options as soon as we see the first
        non-option argument.  (This is the tradition followed by
        Python's getopt module, Perl's Getopt::Std, and other argument-
        parsing libraries, but it is generally annoying to users.)

      process_default_values : bool = true
        if true, option default values are processed similarly to option
        values from the command line: that is, they are passed to the
        type-checking function for the option's type (as long as the
        default value is a string).  (This really only matters if you
        have defined custom types; see SF bug #955889.)  Set it to false
        to restore the behaviour of Optik 1.4.1 and earlier.

      rargs : [string]
        the argument list currently being parsed.  Only set when
        parse_args() is active, and continually trimmed down as
        we consume arguments.  Mainly there for the benefit of
        callback options.
      largs : [string]
        the list of leftover arguments that we have skipped while
        parsing options.  If allow_interspersed_args is false, this
        list is always empty.
      values : Values
        the set of option values currently being accumulated.  Only
        set when parse_args() is active.  Also mainly for callbacks.

    Because of the 'rargs', 'largs', and 'values' attributes,
    OptionParser is not thread-safe.  If, for some perverse reason, you
    need to parse command-line arguments simultaneously in different
    threads, use different OptionParser instances.

    NrTcCsrt�||||�|�|�|	|_||_d|_d|_|dkr@t�}||_|j�	|�|
|_
|j||d�|��dS)NT)�add_help)
rr%�	set_usage�progr��allow_interspersed_args�process_default_valuesr
rrOrl�_populate_option_list�_init_parsing_state)rr^r�rr�rrjrZadd_help_optionr'rlrrrr%�s(�
�zOptionParser.__init__cCs.t�|�|jD]}|��q|`|`|`dS)a
        Declare that you are done with this OptionParser.  This cleans up
        reference cycles so the OptionParser (and all objects referenced by
        it) can be garbage-collected promptly.  After calling destroy(), the
        OptionParser is unusable.
        N)rrr�r�r)rr�rrrr�s


zOptionParser.destroycCsg|_g|_|��dSr)r�r�r	rrrrr�sz OptionParser._create_option_listcCs|jdddtd�d�dS)Nz-hz--helprnzshow this help message and exit�r�rn�rr1rrrr�_add_help_option�s�zOptionParser._add_help_optioncCs|jddtd�d�dS)Nz	--versionr�z&show program's version number and exitr,r-rrrr�_add_version_option�s�z OptionParser._add_version_optioncCs>|jr|�|j�|r |�|�|jr.|��|r:|��dSr)�standard_option_listrr�r/r.)rr�r%rrrr*�s
z"OptionParser._populate_option_listcCsd|_d|_d|_dSr)�rargs�largsr�rrrrr+�sz OptionParser._init_parsing_statecCsL|dkrtd�|_n4|tkr$d|_n$|���d�rB|dd�|_n||_dS)Nz%prog [options]zusage: �)r1r^rr�rr]rrrr&�szOptionParser.set_usagecCs
d|_dS)aSet parsing to not stop on the first non-option, allowing
        interspersing switches with command arguments. This is the
        default behavior. See also disable_interspersed_args() and the
        class documentation description of the attribute
        allow_interspersed_args.TN�r(rrrr�enable_interspersed_args�sz%OptionParser.enable_interspersed_argscCs
d|_dS)z�Set parsing to stop on the first non-option. Use this if
        you have a command processor which runs another command that
        has options of its own and you want to make sure these options
        don't get confused.
        FNr4rrrr�disable_interspersed_argssz&OptionParser.disable_interspersed_argscCs
||_dSr)r))rr�rrr�set_process_default_valuessz'OptionParser.set_process_default_valuescCs||j|<dSr)ro)rrqr�rrr�set_defaultszOptionParser.set_defaultcKs|j�|�dSr)ror�)rr�rrr�set_defaultsszOptionParser.set_defaultscCs*|jdd�}|jD]}|�|j�q|Sr)r�r�r})rZoptionsr�rrr�_get_all_optionss
zOptionParser._get_all_optionscCs`|jst|j�S|j��}|��D]4}|�|j�}t|t�r"|�	�}|�
||�||j<q"t|�Sr)r)rro�copyr:rprqr�r)r�r�)rror+r�r/rrr�get_default_valuess


zOptionParser.get_default_valuescOszt|dt�r t|f|�|�}nJt|�dkrb|sb|d}t|t�sNtd|��|j|k	rjtd��ntd��|j�|�|S)Nrr znot an OptionGroup instance: %rz"invalid OptionGroup (wrong parser)r)	r�r)rr{r�r9r?r�r|)rr�r�r�rrr�add_option_group+s


zOptionParser.add_option_groupcCs0|j�|�p|j�|�}|r,|j|k	r,|jSdSr)rrprr)rr/r+rrr�get_option_group;s
�zOptionParser.get_option_groupcCs&|dkrtjdd�S|dd�SdSr)r��argv)rr�rrr�	_get_argsEszOptionParser._get_argsc
Cs�|�|�}|dkr|��}||_g|_}||_z|�|||�}Wn4ttfk
rv}z|�t	|��W5d}~XYnX||}|�
||�S)aR
        parse_args(args : [string] = sys.argv[1:],
                   values : Values = None)
        -> (values : Values, args : [string])

        Parse the command-line options found in 'args' (default:
        sys.argv[1:]).  Any errors result in a call to 'error()', which
        by default prints the usage message to stderr and calls
        sys.exit() with an error message.  On success returns a pair
        (values, args) where 'values' is a Values instance (with all
        your option values) and 'args' is the list of arguments left
        over after parsing options.
        N)r@r<r1r2r��
_process_argsrrrr)�check_values)rr�r�r1r2�stop�errrrr�
parse_argsKs

 zOptionParser.parse_argscCs||fS)a�
        check_values(values : Values, args : [string])
        -> (values : Values, args : [string])

        Check that the supplied option values and leftover arguments are
        valid.  Returns the option values and leftover arguments
        (possibly adjusted, possibly completely new -- whatever you
        like).  Default implementation just returns the passed-in
        values; subclasses may override as desired.
        r)rr�r�rrrrBrszOptionParser.check_valuescCs�|r�|d}|dkr|d=dS|dd�dkr<|�||�q|dd�dkrft|�dkrf|�||�q|jr~|�|�|d=qdSqdS)a�_process_args(largs : [string],
                         rargs : [string],
                         values : Values)

        Process command-line arguments and populate 'values', consuming
        options and arguments from 'rargs'.  If 'allow_interspersed_args' is
        false, stop at the first non-option argument.  If true, accumulate any
        interspersed non-option arguments in 'largs'.
        rr�Nr7r r�)�_process_long_optr{�_process_short_optsr(r|)rr2r1r��argrrrrAs

zOptionParser._process_argscCst||j�S)a_match_long_opt(opt : string) -> string

        Determine which long option string 'opt' matches, ie. which one
        it is an unambiguous abbreviation for.  Raises BadOptionError if
        'opt' doesn't unambiguously match any long option string.
        )�
_match_abbrevr)rr�rrr�_match_long_opt�szOptionParser._match_long_optc
Cs�|�d�}d|kr4|�dd�\}}|�d|�d}n|}d}|�|�}|j|}|��r�|j}t|�|kr�|�t	dd|�||d��q�|dkr�|�d�}	q�t
|d|��}	|d|�=n|r�|�td	�|�nd}	|�||	||�dS)
NrrUr TF�.%(option)s option requires %(number)d argument�/%(option)s option requires %(number)d arguments�r+Znumberz%s option does not take a value)
�popr��insertrJrr�r�r{rrr�r1r�)
rr1r�rHr�Znext_argZhad_explicit_valuer+r�r�rrrrF�s6


��zOptionParser._process_long_optcCs�|�d�}d}d}|dd�D]�}d|}|j�|�}|d7}|sJt|��|��r�|t|�krv|�d||d��d}|j}	t|�|	kr�|�t	dd|	�||	d��q�|	dkr�|�d�}
q�t
|d|	��}
|d|	�=nd}
|�||
||�|rq�qdS)	NrFr r�TrKrLrM)rNrrprr�r{rOr�rrr�r�)rr1r�rHrC�iZchr�r+r�r�rrrrG�s<
��z OptionParser._process_short_optscCs&|jdkrtj�tjd�S|jSdSr�)r'r<�path�basenamer�r?rrrr�
get_prog_names
zOptionParser.get_prog_namecCs|�d|���S)Nz%prog)rtrS)r�srrr�expand_prog_nameszOptionParser.expand_prog_namecCs|�|j�Sr)rUrjrrrrrszOptionParser.get_descriptionrcCs|rtj�|�t�|�dSr)r��stderr�writer�)rZstatusr#rrrr�szOptionParser.exitcCs(|�tj�|�dd|��|f�dS)z�error(msg : string)

        Print a usage message incorporating 'msg' to stderr and exit.
        If you override this in a subclass, it should not return -- it
        should either exit or raise an exception.
        r7z%s: error: %s
N)�print_usager�rVr�rSr$rrrrszOptionParser.errorcCs"|jr|j�|�|j��SdSdSr)r^rr_rUrrrr�	get_usage#s

�zOptionParser.get_usagecCs|jrt|��|d�dS)aaprint_usage(file : file = stdout)

        Print the usage message for the current program (self.usage) to
        'file' (default stdout).  Any occurrence of the string "%prog" in
        self.usage is replaced with the name of the current program
        (basename of sys.argv[0]).  Does nothing if self.usage is empty
        or not defined.
        ��fileN)r^�printrY�rr[rrrrX*s	zOptionParser.print_usagecCs|jr|�|j�SdSdSr)r�rUrrrr�get_version6szOptionParser.get_versioncCs|jrt|��|d�dS)aEprint_version(file : file = stdout)

        Print the version message for this program (self.version) to
        'file' (default stdout).  As with print_usage(), any occurrence
        of "%prog" in self.version is replaced by the current program's
        name.  Does nothing if self.version is empty or undefined.
        rZN)r�r\r^r]rrrr�<szOptionParser.print_versioncCs�|dkr|j}|�|�g}|�|�td���|��|jrZ|�t�||��|�d�|j	D]}|�|�
|��|�d�q`|��d�|dd��S)NZOptionsrgrPrz)
rr�r|rar1rWr�rrr�r"rYr5)rrr~r�rrrrGs


zOptionParser.format_option_helpcCs|�|j�Sr)rmrlr rrrrmXszOptionParser.format_epilogcCsn|dkr|j}g}|jr*|�|��d�|jrD|�|�|�d�|�|�|��|�|�|��d�|�Srf)	rr^r|rYrjrkrrmr5r!rrrr"[szOptionParser.format_helpcCs |dkrtj}|�|���dS)z�print_help(file : file = stdout)

        Print an extended help message, listing all options and any
        help text provided with them, to 'file' (default stdout).
        N)r��stdoutrWr"r]rrrr�gszOptionParser.print_help)T)NN)rN)N)N)N)N)N)+rr'r(r-r0rr%rrr.r/r*r+r&r5r6r7r8r9r:r<r=r>r@rErBrArJrFrGrSrUrr�rrYrXr^r�rrmr"r�rrrrrRsbD�
"

	

'
3	$)





csZ�|kr�S�fdd�|��D�}t|�dkr6|dS|sDt���n|��t�|��dS)z�_match_abbrev(s : string, wordmap : {string : Option}) -> string

    Return the string key in 'wordmap' for which 's' is an unambiguous
    abbreviation.  If 's' is found to be ambiguous or doesn't match any of
    'words', raise BadOptionError.
    csg|]}|���r|�qSr)r)rwZword�rTrrry�s
�z!_match_abbrev.<locals>.<listcomp>r rN)r�r{r�sortr2)rTZwordmapr3rr`rrIts
rI)'r-�__version__�__all__Z
__copyright__r�r<rcrrr�ImportErrorr1�	Exceptionrr
rrrr2r	r
rr�r�r�r�r�r�rrrrrrrrrrrIrrrrr�<module>s�� 


P




�uA=&__pycache__/_dummy_thread.cpython-38.pyc000064400000013627151153537600014244 0ustar00U

e5d��@s�dZddddddddgZd	ZeZifd
d�Zdd�Zdd�Zd
d�Zddd�Z	dd�Z
Gdd�de�ZGdd�de�Z
dadadd�ZdS)a/Drop-in replacement for the thread module.

Meant to be used as a brain-dead substitute so that threaded code does
not need to be rewritten for when the thread module is not present.

Suggested usage is::

    try:
        import _thread
    except ImportError:
        import _dummy_thread as _thread

�error�start_new_thread�exit�	get_ident�
allocate_lock�interrupt_main�LockType�RLocklcCs�t|�tt��krtd��t|�tt��kr4td��daz|||�Wn.tk
rZYnddl}|��YnXdatr�dat	�dS)a�Dummy implementation of _thread.start_new_thread().

    Compatibility is maintained by making sure that ``args`` is a
    tuple and ``kwargs`` is a dictionary.  If an exception is raised
    and it is SystemExit (which can be done by _thread.exit()) it is
    caught and nothing is done; all other exceptions are printed out
    by using traceback.print_exc().

    If the executed function calls interrupt_main the KeyboardInterrupt will be
    raised when the function returns.

    z2nd arg must be a tuplez3rd arg must be a dictF�NT)
�type�tuple�	TypeError�dict�_main�
SystemExit�	traceback�	print_exc�
_interrupt�KeyboardInterrupt)Zfunction�args�kwargsr�r�%/usr/lib64/python3.8/_dummy_thread.pyrs 
cCst�dS)z'Dummy implementation of _thread.exit().N)rrrrrr=scCsdS)z�Dummy implementation of _thread.get_ident().

    Since this module should only be used when _threadmodule is not
    available, it is safe to assume that the current process is the
    only thread.  Thus a constant can be safely returned.
    �rrrrrrAscCst�S)z0Dummy implementation of _thread.allocate_lock().�rrrrrrJsNcCs|dk	rtd��dS)z-Dummy implementation of _thread.stack_size().Nz'setting thread stack size not supportedr	)r)�sizerrr�
stack_sizeNsrcCst�S)z0Dummy implementation of _thread._set_sentinel().rrrrr�
_set_sentinelTsrc@sFeZdZdZdd�Zddd�ZeZdd	�Zd
d�Zdd
�Z	dd�Z
dS)ra�Class implementing dummy implementation of _thread.LockType.

    Compatibility is maintained by maintaining self.locked_status
    which is a boolean that stores the state of the lock.  Pickling of
    the lock, though, should not be done since if the _thread module is
    then used with an unpickled ``lock()`` from here problems could
    occur from this class not having atomic methods.

    cCs
d|_dS)NF��
locked_status��selfrrr�__init__cszLockType.__init__N���cCsH|dks|rd|_dS|js&d|_dS|dkr@ddl}|�|�dSdS)a�Dummy implementation of acquire().

        For blocking calls, self.locked_status is automatically set to
        True and returned appropriately based on value of
        ``waitflag``.  If it is non-blocking, then the value is
        actually checked and not set if it is already acquired.  This
        is all done so that threading.Condition's assert statements
        aren't triggered and throw a little fit.

        NTr	F)r�time�sleep)r �waitflag�timeoutr#rrr�acquirefs
zLockType.acquirecCs|��dS�N)�release)r �typ�val�tbrrr�__exit__�szLockType.__exit__cCs|js
t�d|_dS)zRelease the dummy lock.FT)rrrrrrr)�szLockType.releasecCs|jSr(rrrrr�locked�szLockType.lockedcCs*d|jrdnd|jj|jjtt|��fS)Nz<%s %s.%s object at %s>r.Zunlocked)r�	__class__�
__module__�__qualname__�hex�idrrrr�__repr__�s
�zLockType.__repr__)Nr")�__name__r0r1�__doc__r!r'�	__enter__r-r)r.r4rrrrrXs

	cs:eZdZdZ�fdd�Zd
�fdd�	Z�fdd	�Z�ZS)raDummy implementation of threading._RLock.

    Re-entrant lock can be aquired multiple times and needs to be released
    just as many times. This dummy implemention does not check wheter the
    current thread actually owns the lock, but does accounting on the call
    counts.
    cst���d|_dS)Nr	)�superr!�_levelsr�r/rrr!�s
zRLock.__init__Nr"cs$t��||�}|r |jd7_|S)zEAquire the lock, can be called multiple times in succession.
        r)r8r'r9)r r%r&r.r:rrr'�sz
RLock.acquirecs4|jdkrt�|jdkr"t���|jd8_dS)zERelease needs to be called once for every call to acquire().
        r	rN)r9rr8r)rr:rrr)�s



z
RLock.release)Nr")r5r0r1r6r!r'r)�
__classcell__rrr:rr�sFTcCstr
t�ndadS)z^Set _interrupt flag to True to have start_new_thread raise
    KeyboardInterrupt upon exiting.TN)rrrrrrrr�s)N)r6�__all__�TIMEOUT_MAX�RuntimeErrorrrrrrrr�objectrrrrrrrrr�<module>s$
� 	
@__pycache__/fnmatch.cpython-38.pyc000064400000006435151153537600013042 0ustar00U

e5d��@sjdZddlZddlZddlZddlZddddgZdd�Zejdd	d
�dd��Zd
d�Z	dd�Z
dd�ZdS)a�Filename matching with shell patterns.

fnmatch(FILENAME, PATTERN) matches according to the local convention.
fnmatchcase(FILENAME, PATTERN) always takes case in account.

The functions operate by translating the pattern into a regular
expression.  They cache the compiled regular expressions for speed.

The function translate(PATTERN) returns a regular expression
corresponding to PATTERN.  (It does not compile it.)
�N�filter�fnmatch�fnmatchcase�	translatecCs"tj�|�}tj�|�}t||�S)a�Test whether FILENAME matches PATTERN.

    Patterns are Unix shell style:

    *       matches everything
    ?       matches any single character
    [seq]   matches any character in seq
    [!seq]  matches any char not in seq

    An initial period in FILENAME is not special.
    Both FILENAME and PATTERN are first case-normalized
    if the operating system requires it.
    If you don't want this, use fnmatchcase(FILENAME, PATTERN).
    )�os�path�normcaser)�name�pat�r�/usr/lib64/python3.8/fnmatch.pyrs�T)�maxsize�typedcCs<t|t�r(t|d�}t|�}t|d�}nt|�}t�|�jS)Nz
ISO-8859-1)�
isinstance�bytes�strr�re�compile�match)r
Zpat_strZres_str�resrrr�_compile_pattern&s

rcCshg}tj�|�}t|�}tjtkr@|D]}||�r&|�|�q&n$|D]}|tj�|��rD|�|�qD|S)zJConstruct a list from those elements of the iterable NAMES that match PAT.)rrrr�	posixpath�append)�namesr
�resultrr	rrrr0s
cCst|�}||�dk	S)z�Test whether FILENAME matches PATTERN, including case.

    This is a version of fnmatch() which doesn't case-normalize
    its arguments.
    N)r)r	r
rrrrr@sc	Cs�dt|�}}d}||k�r�||}|d}|dkr>|d}q|dkrP|d}q|dk�r�|}||krz||d	krz|d}||kr�||d
kr�|d}||kr�||d
kr�|d}q�||kr�|d}�q�|||�}d|kr�|�d
d�}n�g}||d	k�r|dn|d}|�d||�}|dk�r(�qN|�|||��|d}|d}�q|�|||��d�dd�|D��}t�dd|�}|d}|dd	k�r�d|dd�}n|ddk�r�d
|}d||f}q|t�|�}qd|S)zfTranslate a shell PATTERN to a regular expression.

    There is no way to quote meta-characters.
    r���*z.*�?�.�[�!�]z\[z--�\�\\��-�css"|]}|�dd��dd�VqdS)r$r%r'z\-N)�replace)�.0�srrr�	<genexpr>ts�ztranslate.<locals>.<genexpr>z([&~|])z\\\1�^N)r-r!z%s[%s]z	(?s:%s)\Z)�lenr)�findr�joinr�sub�escape)	r
�i�nr�c�jZstuffZchunks�krrrrJsV






�)�__doc__rrr�	functools�__all__r�	lru_cacherrrrrrrr�<module>s
	
__pycache__/site.cpython-38.opt-2.pyc000064400000026047151153537600013327 0ustar00U

&�.eNU�@s"ddlZddlZddlZddlZddlZejejgadada	da
dd�Zdd�Zdd�Z
dd	�Zd
d�Zd1dd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd2dd�Zd3dd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Z ej!j"�se �d.d/�Z#e$d0k�re#�dS)4�NcGsBtjj|�}ztj�|�}Wntk
r0YnX|tj�|�fS�N)�os�path�join�abspath�OSError�normcase)�paths�dir�r�/usr/lib64/python3.8/site.py�makepath[sr
cCs�ttj���D]~}tt|dd�dd�dkr,qztj�|j�|_Wnt	t
tfk
rZYnXztj�|j�|_Wqt	t
tfk
r�YqXqdS)N�
__loader__�
__module__)�_frozen_importlib�_frozen_importlib_external)
�set�sys�modules�values�getattrrrr�__file__�AttributeErrorr�	TypeError�
__cached__)�mrrr�	abs_pathsds�rcCsPg}t�}tjD],}t|�\}}||kr|�|�|�|�q|tjdd�<|Sr)rrrr
�append�add)�L�known_pathsr
�dircaserrr�removeduppathsts

r"c	CsVt�}tjD]D}z&tj�|�r4t|�\}}|�|�Wqtk
rNYqYqXq|Sr)rrrr�existsr
rr)�d�item�_�itemcaserrr�_init_pathinfo�s
r(cCsr|dkrt�}d}nd}tj�||�}zt�t�|��}Wntk
rPYdSX|��t|�D]�\}}|�	d�rvqbzZ|�	d�r�t
|�Wqb|��}t||�\}}	|	|kr�tj�
|�r�tj�|�|�|	�Wqbtk
�rVtd�|d|�tjd�ddl}
|
jt���D](}|��D]}td	|tjd��q�qtd
tjd�Y�qZYqbXqbW5QRX|�rnd}|S)NTF�#)zimport zimport	z"Error processing line {:d} of {}:
�)�filerz  z
Remainder of file ignored)r(rrr�io�
TextIOWrapper�	open_coder�	enumerate�
startswith�exec�rstripr
r#rrr�	Exception�print�format�stderr�	traceback�format_exception�exc_info�
splitlines)�sitedir�namer �reset�fullname�f�n�liner
r!r7�recordrrr�
addpackage�sF

�rCcCs�|dkrt�}d}nd}t|�\}}||krBtj�|�|�|�zt�|�}Wntk
rfYdSXdd�|D�}t	|�D]}t
|||�q~|r�d}|S)NTFcSsg|]}|�d�r|�qS)z.pth)�endswith)�.0r<rrr�
<listcomp>�s
zaddsitedir.<locals>.<listcomp>)r(r
rrrrr�listdirr�sortedrC)r;r r=�sitedircase�namesr<rrr�
addsitedir�s$
rKcCs`tjjrdSttd�r4ttd�r4t��t��kr4dSttd�r\ttd�r\t��t��kr\dSdS)NF�getuid�geteuid�getgid�getegidT)	r�flags�no_user_site�hasattrrrMrLrOrNrrrr�check_enableusersite�s
rScCsztj�dd�}|r|Sdd�}tjdkrBtj�d�p6d}||d�Stjdkrptjrp|dd	tjd
tjdd��S|dd�S)
N�PYTHONUSERBASEcWstj�tjj|��Sr)rr�
expanduserr)�argsrrr�joinuser�sz_getuserbase.<locals>.joinuser�nt�APPDATA�~�Python�darwin�Libraryz%d.%d�z.local)r�environ�getr<r�platform�
_framework�version_info)�env_baserW�baserrr�_getuserbase�s


�rfcCsdtj}tjdkr,|�d|d�|d�d�StjdkrFtjrF|�d�S|�d|d�d	|d�d
�S)NrXz\Pythonrr*z\site-packagesr\z/lib/python/site-packagesz/lib/python�.z/site-packages)rrcrr<rarb)�userbase�versionrrr�	_get_path
s

rjcCstdkrt�atSr)�	USER_BASErfrrrr�getuserbasesrlcCst�}tdkrt|�atSr)rl�	USER_SITErj)rhrrr�getusersitepackages#srncCs$t�}tr tj�|�r t||�|Sr)rn�ENABLE_USER_SITErr�isdirrK)r �	user_siterrr�addusersitepackages1s
rrcCs�g}t�}|dkrt}|D]�}|r||kr,q|�|�tjdkr�|�tj�|ddtj	dd�d��|�tj�|ddtj
dd�d��q|�|�|�tj�|dd��|�tj�|dd��q|S)	N�/�lib64�python�z
site-packages�libzpython%d.%dr^)r�PREFIXESrr�seprrrrrirc)�prefixes�sitepackages�seen�prefixrrr�getsitepackages?s*

��
r~cCsBtrdtjkrt�dd�t|�D]}tj�|�r"t||�q"|S)N�RPM_BUILD_ROOTrz
/usr/local)	rorr_rx�insertr~rrprK)r rzr;rrr�addsitepackages^sr�cCs4tjdkrd}nd}t�d|�t_t�d|�t_dS)N�\zCtrl-Z plus ReturnzCtrl-D (i.e. EOF)�quit�exit)rry�
_sitebuiltins�Quitter�builtinsr�r�)�eofrrr�setquitms

r�cCs�t�dtj�t_tjdd�dkr2t�dd�t_nt�dd�t_gg}}ttd�r�tj	�
tj�}|�dd	g�|�tj	�
|tj�|tjg�t�d
d||�t_dS)N�	copyright��java�creditsz?Jython is maintained by the Jython developers (www.jython.org).z�    Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
    for supporting Python development.  See www.python.org for more information.rzLICENSE.txt�LICENSE�licensez'See https://www.python.org/psf/license/)r��_Printerrr�r�rar�rRrr�dirnamer�extendr�pardir�curdirr�)�files�dirs�hererrr�setcopyright}s$�

�r�cCst��t_dSr)r��_Helperr��helprrrr�	sethelper�sr�cCsdd�}|t_dS)Ncs�ddl}zddl�ddl}Wntk
r2YdSXt�dd�}|dk	r\d|kr\��d�n
��d�z���Wntk
r�YnX���dkr�t	j
�t	j
�d�d��z��
��Wntk
r�YnX��fd	d
�}|�|�dS)Nr�__doc__��libeditzbind ^I rl_completez
tab: completerZz.python_historycs(z����Wntk
r"YnXdSr)�write_history_filerr��history�readlinerr�
write_history�szCenablerlcompleter.<locals>.register_readline.<locals>.write_history)�atexitr��rlcompleter�ImportErrorr�parse_and_bind�read_init_filer�get_current_history_lengthrrrrU�read_history_file�register)r�r��readline_docr�rr�r�register_readline�s0
�z,enablerlcompleter.<locals>.register_readline)r�__interactivehook__)r�rrr�enablerlcompleter�s	0r�c	CsHtj}tjdkr*d|kr*tjd}t_ntj}tj�tj�|��\}}tj�	|�}dt_
d}dd�tj�||�tj�||�fD�}|�rD|d}d}	t|dd	��\}
|
D]P}d
|kr�|�
d
�\}}}
|����}|
��}
|dkr�|
��}	q�|dkr�|
t_
q�W5QRX|t_t_t|tjg�|	dk�r8t�dtj�ntjgad
a|S)Nr\�__PYVENV_LAUNCHER__z
pyvenv.cfgcSsg|]}tj�|�r|�qSr)rr�isfile)rE�conffilerrrrF�s�zvenv.<locals>.<listcomp>r�truezutf-8)�encoding�=zinclude-system-site-packages�homeF)rr_rra�_base_executable�
executabler�splitrr��_homer�open�	partition�strip�lowerr}�exec_prefixr�rxr�ro)r �envr��exe_dirr&�site_prefix�
conf_basename�candidate_confs�virtual_conf�system_siter?rA�key�valuerrr�venv�sB��

r�c
Cs�zBzddl}Wn0tk
r>}z|jdkr,n�W5d}~XYnXWnRtk
r�}z4tjjrltjt���ntj	�
d|jj|f�W5d}~XYnXdS)Nr�
sitecustomizez@Error in sitecustomize; set PYTHONVERBOSE for traceback:
%s: %s
)
r�r�r<r3rrP�verbose�
excepthookr9r6�write�	__class__�__name__)r��exc�errrrr�execsitecustomizes

��r�c
Cs�zBzddl}Wn0tk
r>}z|jdkr,n�W5d}~XYnXWnRtk
r�}z4tjjrltjt���ntj	�
d|jj|f�W5d}~XYnXdS)Nr�
usercustomizez@Error in usercustomize; set PYTHONVERBOSE for traceback:
%s: %s
)
r�r�r<r3rrPr�r�r9r6r�r�r�)r�r�r�rrr�execusercustomizes

��r�cCs~tjdd�}t�}|tjkr$t�t|�}tdkr:t�at|�}t|�}t	�t
�t�tjj
sjt�t�trzt�dSr)rrr"rr�rorSrrr�r�r�r�rP�isolatedr�r�r�)�	orig_pathr rrr�main/s"
r�cCs\d}tjdd�}|s�t�}t�}td�tjD]}td|f�q0td�td|tj�|�rbdndf�td	|tj�|�r�dndf�td
t�t�	d�g}d|kr�|�
t�d
|kr�|�
t�|�r(ttj
�|��tr�t�	d�n6tdk�rt�	d�n tdk�rt�	d�n
t�	d�n0ddl}t|�|tjdtj
f��t�	d�dS)Na�    %s [--user-base] [--user-site]

    Without arguments print some useful information
    With arguments print the value of USER_BASE and/or USER_SITE separated
    by '%s'.

    Exit codes with --user-base or --user-site:
      0 - user site directory is enabled
      1 - user site directory is disabled by user
      2 - uses site directory is disabled by super user
          or for security reasons
     >2 - unknown error
    r*zsys.path = [z    %r,�]zUSER_BASE: %r (%s)r#z
doesn't existzUSER_SITE: %r (%s)zENABLE_USER_SITE: %rrz--user-basez--user-siteFr^rv�
)r�argvrlrnr4rrrpror�rrkrm�pathsepr�textwrap�dedent)r�rV�	user_baserqr
�bufferr�rrr�_scriptQsD
��




r��__main__)N)N)N)%rrr�r�r,r}r�rxrormrkr
rr"r(rCrKrSrfrjrlrnrrr~r�r�r�r�r�r�r�r�r�rP�no_siter�r�rrrr�<module>HsF	
*
 


;4
3
__pycache__/hashlib.cpython-38.pyc000064400000012457151153537600013035 0ustar00U

&�.e� �	@svdZdZee�Zee�ZedZddddddd	d
hZzddlmZ	Wne
k
r`d
d�Z	YnXe	�stiZdd�Zdd�Z
e	�s�ddd�Zddd�Zz ddlZeZe
Ze�ej�ZWn$e
k
r�e	�r΂eZeZYnXddlmZzddlmZWne
k
�rYnXeD]DZzee�e�e<Wn*ek
�rTddlZe�de�YnX�q[[[[[
e���sp[[	dS)a3hashlib module - A common interface to many hash functions.

new(name, data=b'', **kwargs) - returns a new hash object implementing the
                                given hash function; initializing the hash
                                using the given binary data.

Named constructor functions are also available, these are faster
than using new(name):

md5(), sha1(), sha224(), sha256(), sha384(), sha512(), blake2b(), blake2s(),
sha3_224, sha3_256, sha3_384, sha3_512, shake_128, and shake_256.

More algorithms may be available on your platform but the above are guaranteed
to exist.  See the algorithms_guaranteed and algorithms_available attributes
to find out what algorithm names can be passed to new().

NOTE: If you want the adler32 or crc32 hash functions they are available in
the zlib module.

Choose your hash function wisely.  Some have known collision weaknesses.
sha384 and sha512 will be slow on 32 bit platforms.

Hash objects have these methods:
 - update(data): Update the hash object with the bytes in data. Repeated calls
                 are equivalent to a single call with the concatenation of all
                 the arguments.
 - digest():     Return the digest of the bytes passed to the update() method
                 so far as a bytes object.
 - hexdigest():  Like digest() except the digest is returned as a string
                 of double length, containing only hexadecimal digits.
 - copy():       Return a copy (clone) of the hash object. This can be used to
                 efficiently compute the digests of datas that share a common
                 initial substring.

For example, to obtain the digest of the byte string 'Nobody inspects the
spammish repetition':

    >>> import hashlib
    >>> m = hashlib.md5()
    >>> m.update(b"Nobody inspects")
    >>> m.update(b" the spammish repetition")
    >>> m.digest()
    b'\xbbd\x9c\x83\xdd\x1e\xa5\xc9\xd9\xde\xc9\xa1\x8d\xf0\xff\xe9'

More condensed:

    >>> hashlib.sha224(b"Nobody inspects the spammish repetition").hexdigest()
    'a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2'

)�md5�sha1�sha224�sha256�sha384�sha512�blake2b�blake2s�sha3_224�sha3_256�sha3_384�sha3_512�	shake_128�	shake_256)�new�algorithms_guaranteed�algorithms_available�pbkdf2_hmacr	r
rrr
rrr�)�
get_fips_modecCsdS)Nr�rrr�/usr/lib64/python3.8/hashlib.py�_hashlib_get_fips_modeQsrc	Cs�t}|�|�}|dk	r|S�zB|dkrDddl}|j|d<|d<�n|dkrhddl}|j|d<|d<n�|dkr�ddl}|j|d	<|d
<|j|d<|d<n�|d
kr�ddl	}|j
|d<|d<|j|d<|d<n�|dkr�ddl}|j
|d<|j|d<nb|dk�r6ddl}|j|d<|j|d<|j|d<|j|d<n&|dk�r\ddl}|j|d<|j|d<Wntk
�rtYnX|�|�}|dk	�r�|Std|��dS)N>r�SHA1rrr>�MD5rrr>r�SHA224r�SHA256rrrr>r�SHA512�SHA384rrrrr>rrrr>rr	rr
r	r
rr>r
rr
rzunsupported hash type )�__builtin_constructor_cache�get�_sha1r�_md5r�_sha256rr�_sha512rr�_blake2rr�_sha3r	r
rrr
r�ImportError�
ValueError)	�name�cache�constructorr r!r"r#r$r%rrr�__get_builtin_constructorWsN









r+c	Cs^t�s|tkrt|�Sz"ttd|�}t��s4|�|WSttfk
rXt|�YSXdS)NZopenssl_)r�__block_openssl_constructorr+�getattr�_hashlibr�AttributeErrorr')r(�frrr�__get_openssl_constructor�sr1�cKst|�|f|�S)z�new(name, data=b'', **kwargs) - Return a new hashing object using the
        named algorithm; optionally initialized with data (which must be
        a bytes-like object).
        )r+�r(�data�kwargsrrr�__py_new�sr6cKsft��s |tkr t|�|f|�Sztj||f|�WStk
r`t��rL�t|�|f|�YSXdS)z�new(name, data=b'') - Return a new hashing object using the named algorithm;
    optionally initialized with data (which must be a bytes-like object).
    N)r.rr,r+rr'r3rrr�
__hash_new�sr7N)r)�scryptzcode for hash %s was not found.)r2)r2)�__doc__Z__always_supported�setrr�__all__r,r.rrr&rr+r1r6r7rZ
__get_hash�unionZopenssl_md_meth_namesrr8Z__func_name�globalsr'ZloggingZ	exceptionrrrr�<module>sh5�,

�

__pycache__/runpy.cpython-38.pyc000064400000017767151153537600012611 0ustar00U

e5d/�@sdZddlZddlZddlZddlZddlZddlZddlm	Z	m
Z
ddgZGdd�de�Z
Gdd	�d	e�Zd d
d�Zd!dd
�Zefdd�ZGdd�de�Zd"dd�Zd#dd�Zefdd�Zdd�Zd$dd�Zedk�reej�dk�r�edejd�nejd=eejd�dS)%aZrunpy.py - locating and running Python code using the module namespace

Provides support for locating and running Python scripts using the Python
module namespace instead of the native filesystem.

This allows Python code to play nicely with non-filesystem based PEP 302
importers when locating support scripts as well as when importing modules.
�N)�	read_code�get_importer�
run_module�run_pathc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_TempModulezCTemporarily replace a module in sys.modules with an empty namespacecCs||_t�|�|_g|_dS�N)�mod_name�types�
ModuleType�module�
_saved_module��selfr�r�/usr/lib64/python3.8/runpy.py�__init__sz_TempModule.__init__cCsB|j}z|j�tj|�Wntk
r0YnX|jtj|<|Sr)rr�append�sys�modules�KeyErrorrr
rrr�	__enter__ sz_TempModule.__enter__cGs.|jr|jdtj|j<n
tj|j=g|_dS�Nr)rrrr�r�argsrrr�__exit__)s
z_TempModule.__exit__N)�__name__�
__module__�__qualname__�__doc__rrrrrrrrs	rc@s$eZdZdd�Zdd�Zdd�ZdS)�_ModifiedArgv0cCs||_t�|_|_dSr)�value�object�_saved_value�	_sentinel)rr rrrr1sz_ModifiedArgv0.__init__cCs0|j|jk	rtd��tjd|_|jtjd<dS)NzAlready preserving saved valuer)r"r#�RuntimeErrorr�argvr )rrrrr5sz_ModifiedArgv0.__enter__cGs|j|_|jtjd<dSr)r#r r"rr%rrrrr;sz_ModifiedArgv0.__exit__N)rrrrrrrrrrr0src
	Csn|dk	r|�|�|dkr(d}|}d}	n |j}|j}|j}	|dkrH|j}|j|||	d|||d�t||�|S)z)Helper to run code in nominated namespaceN)r�__file__�
__cached__r�
__loader__�__package__�__spec__)�update�loader�origin�cached�parent�exec)
�codeZrun_globals�init_globalsr�mod_spec�pkg_name�script_namer,�fnamer.rrr�	_run_code@s*
�
r7c	
Cs^|dkr|n|j}t|��6}t|��"|jj}t|||||||�W5QRXW5QRX|��S)z5Helper to run code in new namespace with sys modifiedN)r-rrr�__dict__r7�copy)	r1r2rr3r4r5r6�temp_module�mod_globalsrrr�_run_module_codeZs�r<c
Cs2|�d�r|d��|�d�\}}}|r�zt|�WnHtk
rz}z*|jdksh|j|krj|�|jd�sj�W5d}~XYnXtj�|�}|dk	r�t|d�s�ddl	m
}dj||d�}|t|��zt
j�|�}WnJttttfk
�r}	z"d}||�|t|	�j|	��|	�W5d}	~	XYnX|dk�r2|d	|��|jdk	�r�|d
k�sT|�d��r\|d��z|d}
t|
|�WS|k
�r�}z"|tjk�r��|d
||f��W5d}~XYnX|j}|dk�r�|d|��z|�|�}Wn2tk
�r}z|t|��|�W5d}~XYnX|dk�r(|d|��|||fS)N�.z#Relative module names not supported�__path__r)�warnz�{mod_name!r} found in sys.modules after import of package {pkg_name!r}, but prior to execution of {mod_name!r}; this may result in unpredictable behaviour)rr4z:Error while finding module specification for {!r} ({}: {})zNo module named %s�__main__z	.__main__z%Cannot use package as __main__ modulez3%s; %r is a package and cannot be directly executedz0%r is a namespace package and cannot be executedzNo code object available for %s)�
startswith�
rpartition�
__import__�ImportError�namerr�get�hasattr�warningsr?�format�RuntimeWarning�	importlib�util�	find_spec�AttributeError�	TypeError�
ValueError�typer�submodule_search_locations�endswith�_get_module_detailsr,�get_code)
r�errorr4�_�eZexistingr?�msg�specZexZ
pkg_main_namer,r1rrrrThsd
��,
�
� 
rTc@seZdZdZdS)�_ErrorzBError that _run_module_as_main() should report without a tracebackN)rrrrrrrrr[�sr[Tc
Cs�z0|s|dkr t|t�\}}}ntt�\}}}Wn:tk
rj}zdtj|f}t�|�W5d}~XYnXtjdj}|r�|jtj	d<t
||dd|�S)a�Runs the designated module in the __main__ namespace

       Note that the executed module will have full access to the
       __main__ namespace. If this is not desirable, the run_module()
       function should be used to run the module code in a fresh namespace.

       At the very least, these variables in __main__ will be overwritten:
           __name__
           __file__
           __cached__
           __loader__
           __package__
    r@z%s: %sNr)rTr[�_get_main_module_detailsr�
executable�exitrr8r-r%r7)rZ
alter_argvr3r1�excrYZmain_globalsrrr�_run_module_as_main�s�r`FcCs@t|�\}}}|dkr|}|r,t||||�St|i|||�SdS)znExecute a module's code without importing it

       Returns the resulting top level namespace dictionary
    N)rTr<r7)rr2�run_nameZ	alter_sysr3r1rrrr�sc
Cs�d}tj|}tj|=z\zt|�WW�NStk
rn}z*|t|�kr\|d|tjdf�|��W5d}~XYnXW5|tj|<XdS)Nr@zcan't find %r module in %rr)rrrTrD�str�path)rVZ	main_nameZ
saved_mainr_rrrr\�s
��r\c	Csftj�t�|��}t�|��}t|�}W5QRX|dkr^t�|��}t|��|d�}W5QRX||fS)Nr0)	�osrc�abspath�fsdecode�io�	open_coder�compile�read)rar6Zdecoded_path�fr1rrr�_get_code_from_file�srlcCs$|dkrd}|�d�d}t|�}d}t|�jdkrFt|�jdkrFd}t|td��sX|rxt||�\}}t|||||d	�Stj	�
d|�znt
�\}}	}t|��P}
t|��<|
jj}t|||||	|���W5QR�W5QR�W�SQRXW5QRXW5ztj	�|�Wntk
�rYnXXdS)
a_Execute code located at the specified filesystem location

       Returns the resulting top level namespace dictionary

       The file path may refer directly to a Python script (i.e.
       one that could be directly executed with execfile) or else
       it may refer to a zipfile or directory containing a top
       level __main__.py script.
    Nz
<run_path>r=rFZimpZNullImporterT)r4r5)rBrrQrr�
isinstancerlr<rrc�insert�removerPr\rrrr8r7r9)Z	path_namer2rar4ZimporterZis_NullImporterr1r6rr3r:r;rrrr�s<
�
��8r@�z!No module specified for execution)�file)NNNNN)NNNNN)T)NNF)NN)rr�importlib.machineryrK�importlib.utilrgr	rdZpkgutilrr�__all__r!rrr7r<rDrT�	Exceptionr[r`rr\rlrr�lenr%�print�stderrrrrr�<module>sN��
�
:
�

1
__pycache__/tempfile.cpython-38.opt-1.pyc000064400000055547151153537600014176 0ustar00U

e5d�k�
@s�dZddddddddd	d
ddd
g
ZddlZddlZddlZddlZ	ddl
ZddlZ
ddlmZddlZddlZddlZejZe	je	jBe	jBZee	d�r�ee	jOZeZee	d�r�ee	jOZee	d�r�e	j Z ndZ dZ!e�Z"dd�Z#dd�Z$dd�Z%Gdd�d�Z&dd�Z'dd �Z(da)d!d"�Z*d#d$�Z+d%d	�Z,d&d�Z-da.d'd�Z/d(d
�Z0d=d*d�Z1d>d+d�Z2d,e!dfd-d�Z3Gd.d/�d/�Z4Gd0d1�d1�Z5d?dd5�d6d�Z6e	j7d7k�s�ej8d8k�r�e6Z9nee	d9�a:d@dd5�d:d�Z9Gd;d�d�Z;Gd<d�de<�Z=dS)Aa�Temporary files.

This module provides generic, low- and high-level interfaces for
creating temporary files and directories.  All of the interfaces
provided by this module can be used without fear of race conditions
except for 'mktemp'.  'mktemp' is subject to race conditions and
should not be used; it is provided for backward compatibility only.

The default path names are returned as str.  If you supply bytes as
input, all return values will be in bytes.  Ex:

    >>> tempfile.mkstemp()
    (4, '/tmp/tmptpu9nin8')
    >>> tempfile.mkdtemp(suffix=b'')
    b'/tmp/tmppbi8f0hy'

This module also provides some data items to the user:

  TMP_MAX  - maximum number of names that will be tried before
             giving up.
  tempdir  - If this is set to a string before the first use of
             any routine from this module, it will be considered as
             another candidate location to store temporary files.
�NamedTemporaryFile�
TemporaryFile�SpooledTemporaryFile�TemporaryDirectory�mkstemp�mkdtemp�mktemp�TMP_MAX�
gettempprefix�tempdir�
gettempdir�gettempprefixb�gettempdirb�N)�Random�
O_NOFOLLOW�O_BINARYi'ZtmpcCs.zt�|�Wntk
r$YdSXdSdS)NFT)�_os�lstat�OSError)�fn�r� /usr/lib64/python3.8/tempfile.py�_existsKs
rcGs\d}|D]B}|dkrqt|t�r6|tkr0td��t}q|tkrFtd��t}q|dkrXtS|S)zBLook at the type of all args and divine their implied return type.Nz1Can't mix bytes and non-bytes in path components.)�
isinstance�bytes�str�	TypeError)�argsZreturn_type�argrrr�_infer_return_typeTs
rcCsdt|||�}|dkr|�}|dkr:|tkr0t}n
t�t�}|dkrX|tkrRt�}nt�}||||fS)z9Common parameter processing for most APIs in this module.N)rr�templater�fsencoderr
)�prefix�suffix�dir�output_typerrr�_sanitize_paramsis
r&c@s0eZdZdZdZedd��Zdd�Zdd�Zd	S)
�_RandomNameSequencea,An instance of _RandomNameSequence generates an endless
    sequence of unpredictable strings which can safely be incorporated
    into file names.  Each string is eight characters long.  Multiple
    threads can safely use the same instance at the same time.

    _RandomNameSequence is an iterator.Z%abcdefghijklmnopqrstuvwxyz0123456789_cCs,t��}|t|dd�kr&t�|_||_|jS)N�_rng_pid)r�getpid�getattr�_RandomZ_rngr()�selfZcur_pidrrr�rng�s
z_RandomNameSequence.rngcCs|S�Nr�r,rrr�__iter__�sz_RandomNameSequence.__iter__cs0|j�|jj���fdd�td�D�}d�|�S)Ncsg|]}����qSrr)�.0Zdummy��cZchooserr�
<listcomp>�sz0_RandomNameSequence.__next__.<locals>.<listcomp>��)�
charactersr-Zchoice�range�join)r,Zlettersrr2r�__next__�sz_RandomNameSequence.__next__N)	�__name__�
__module__�__qualname__�__doc__r7�propertyr-r0r:rrrrr'{s
r'c	Cs�g}dD]}t�|�}|r|�|�qtjdkrX|�tj�d�tj�d�ddddg�n|�d	d
dg�z|�t���Wn$t	t
fk
r�|�tj�YnX|S)z[Generate a list of candidate temporary directories which
    _get_default_tempdir will try.)ZTMPDIRZTEMPZTMP�ntz~\AppData\Local\Tempz%SYSTEMROOT%\Tempzc:\tempzc:\tmpz\tempz\tmpz/tmpz/var/tmpz/usr/tmp)r�getenv�append�name�extend�path�
expanduser�
expandvars�getcwd�AttributeErrorr�curdir)�dirlistZenvname�dirnamerrr�_candidate_tempdir_list�s&


�rMcCsFt�}t�}|D�]}|tjkr,tj�|�}td�D�]�}t|�}tj�||�}zft�	|t
d�}z<z*t
j	|ddd��}|�d�W5QRXW5t�|�XW5t�|�X|WStk
r�Yq4tk
�rtjdk�rtj�|��rt�|tj��rYq4YqYq4tk
�r,YqYq4Xq4qttjd|��d	S)
aqCalculate the default directory to use for temporary files.
    This routine should be called exactly once.

    We determine whether or not a candidate temp dir is usable by
    trying to create and write to a file in that directory.  If this
    is successful, the test file is deleted.  To prevent denial of
    service, the name of the test file must be randomized.�d��wbF)�closefdsblatr@z)No usable temporary directory found in %sN)r'rMrrJrE�abspathr8�nextr9�open�_bin_openflags�unlink�close�_io�write�FileExistsError�PermissionErrorrC�isdir�access�W_OKr�FileNotFoundError�_errnoZENOENT)ZnamerrKr$�seqrC�filename�fd�fprrr�_get_default_tempdir�s@	

�
��recCs2tdkr.t��ztdkr t�aW5t��XtS)z7Common setup sequence for all user-callable interfaces.N)�_name_sequence�
_once_lock�acquire�releaser'rrrr�_get_candidate_names�s

rjc
	Cs�t�}|tkrttj|�}tt�D]�}t|�}tj�	||||�}t
�d|�zt�||d�}	WnVt
k
rzYq"Yn@tk
r�tjdkr�tj�|�r�t�|tj�r�Yq"n�YnX|	tj�|�fSt
tjd��dS)z>Code common to mkstemp, TemporaryFile, and NamedTemporaryFile.ztempfile.mkstemprOr@z#No usable temporary file name foundN)rjr�maprr!r8rrSrEr9�_sys�auditrTrZr[rCr\r]r^rRr`�EEXIST)
r$ZpreZsuf�flagsr%�namesrarC�filercrrr�_mkstemp_inner�s*��rrcCstS)z-The default prefix for temporary directories.)r rrrrr	
scCst�t��S)z6The default prefix for temporary directories as bytes.)rr!r	rrrrrscCs2tdkr.t��ztdkr t�aW5t��XtS)zAccessor for tempfile.tempdir.N)r
rgrhrirerrrrrs

cCst�t��S)z)A bytes version of tempfile.gettempdir().)rr!rrrrrr
#sFcCs2t|||�\}}}}|rt}nt}t|||||�S)a�User-callable function to create and return a unique temporary
    file.  The return value is a pair (fd, name) where fd is the
    file descriptor returned by os.open, and name is the filename.

    If 'suffix' is not None, the file name will end with that suffix,
    otherwise there will be no suffix.

    If 'prefix' is not None, the file name will begin with that prefix,
    otherwise a default prefix is used.

    If 'dir' is not None, the file will be created in that directory,
    otherwise a default directory is used.

    If 'text' is specified and true, the file is opened in text
    mode.  Else (the default) the file is opened in binary mode.

    If any of 'suffix', 'prefix' and 'dir' are not None, they must be the
    same type.  If they are bytes, the returned name will be bytes; str
    otherwise.

    The file is readable and writable only by the creating user ID.
    If the operating system uses permission bits to indicate whether a
    file is executable, the file is executable by no one. The file
    descriptor is not inherited by children of this process.

    Caller is responsible for deleting the file when done with it.
    )r&�_text_openflagsrUrr)r#r"r$�textr%rorrrr's
c	Cs�t|||�\}}}}t�}|tkr.ttj|�}tt�D]�}t|�}tj	�
||||�}t�d|�zt�
|d�WnVtk
r�Yq6Yn@tk
r�tjdkr�tj	�|�r�t�|tj�r�Yq6n�YnX|Sttjd��dS)aUser-callable function to create and return a unique temporary
    directory.  The return value is the pathname of the directory.

    Arguments are as for mkstemp, except that the 'text' argument is
    not accepted.

    The directory is readable, writable, and searchable only by the
    creating user.

    Caller is responsible for deleting the directory when done with it.
    ztempfile.mkdtemp�r@z(No usable temporary directory name foundN)r&rjrrkrr!r8rrSrEr9rlrm�mkdirrZr[rCr\r]r^r`rn)r#r"r$r%rprarCrqrrrrNs,
��r6cCs`|dkrt�}t�}tt�D]2}t|�}tj�||||�}t|�s|Sqt	t
jd��dS)a�User-callable function to return a unique temporary file name.  The
    file is not created.

    Arguments are similar to mkstemp, except that the 'text' argument is
    not accepted, and suffix=None, prefix=None and bytes file names are not
    supported.

    THIS FUNCTION IS UNSAFE AND SHOULD NOT BE USED.  The file name may
    refer to a file that did not exist at some point, but by the time
    you get around to creating it, someone else may have beaten you to
    the punch.
    Nz"No usable temporary filename found)rrjr8rrSrrEr9rrZr`rn)r#r"r$rprarCrqrrrrvs
�c@sLeZdZdZdZdZd
dd�Zejdkr@ej	fdd	�Z
d
d�Zndd	�Z
dS)�_TemporaryFileCloserz�A separate object allowing proper closing of a temporary file's
    underlying file object, without adding a __del__ method to the
    temporary file.NFTcCs||_||_||_dSr.)rqrC�delete�r,rqrCrxrrr�__init__�sz_TemporaryFileCloser.__init__r@cCs<|js8|jdk	r8d|_z|j��W5|jr6||j�XdS�NT)�close_calledrqrxrCrW)r,rVrrrrW�sz_TemporaryFileCloser.closecCs|��dSr.)rWr/rrr�__del__�sz_TemporaryFileCloser.__del__cCs|jsd|_|j��dSr{)r|rqrWr/rrrrW�s)T)r;r<r=r>rqr|rzrrCrVrWr}rrrrrw�s



rwc@sBeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�_TemporaryFileWrapperz�Temporary file wrapper

    This class provides a wrapper around files opened for
    temporary use.  In particular, it seeks to automatically
    remove the file when it is no longer needed.
    TcCs$||_||_||_t|||�|_dSr.)rqrCrxrw�_closerryrrrrz�sz_TemporaryFileWrapper.__init__cs^|jd}t||�}t|d�rD|�t����fdd��}|j|_|}t|t�sZt|||�|S)Nrq�__call__cs
�||�Sr.r)r�kwargs��funcrr�func_wrapper�sz7_TemporaryFileWrapper.__getattr__.<locals>.func_wrapper)	�__dict__r*�hasattr�
_functools�wrapsrr�int�setattr)r,rCrq�ar�rr�r�__getattr__�s



z!_TemporaryFileWrapper.__getattr__cCs|j��|Sr.)rq�	__enter__r/rrrr��s
z_TemporaryFileWrapper.__enter__cCs|j�|||�}|��|Sr.)rq�__exit__rW)r,�exc�value�tb�resultrrrr��sz_TemporaryFileWrapper.__exit__cCs|j��dS)zA
        Close the temporary file, possibly deleting it.
        N)rrWr/rrrrW�sz_TemporaryFileWrapper.closeccs|jD]
}|VqdSr.)rq)r,�linerrrr0�s
z_TemporaryFileWrapper.__iter__N)T)
r;r<r=r>rzr�r�r�rWr0rrrrr~�s
r~�w+b���T��errorscCs�t|||�\}}}}	t}
tjdkr0|r0|
tjO}
t||||
|	�\}}z$tj||||||d�}
t|
||�WSt	k
r�t�
|�t�|��YnXdS)a�Create and return a temporary file.
    Arguments:
    'prefix', 'suffix', 'dir' -- as for mkstemp.
    'mode' -- the mode argument to io.open (default "w+b").
    'buffering' -- the buffer size argument to io.open (default -1).
    'encoding' -- the encoding argument to io.open (default None)
    'newline' -- the newline argument to io.open (default None)
    'delete' -- whether the file is deleted on close (default True).
    'errors' -- the errors argument to io.open (default None)
    The file is created as mkstemp() would do it.

    Returns an object with a file-like interface; the name of the file
    is accessible as its 'name' attribute.  The file will be automatically
    deleted when it is closed unless the 'delete' argument is set to False.
    r@��	buffering�newline�encodingr�N)r&rUrrCZO_TEMPORARYrrrXrTr~�
BaseExceptionrVrW)�moder�r�r�r#r"r$rxr�r%rorcrCrqrrrrs 

�

�posix�cygwin�	O_TMPFILEc
Cs�t|||�\}}}}t}	tr�z$|	tjBtj@}
t�||
d�}Wn*tk
rXdaYnFtk
rjYn4Xzt	j||||||d�WSt�
|��YnXt||||	|�\}}z"t�|�t	j||||||d�WSt�
|��YnXdS)a�Create and return a temporary file.
        Arguments:
        'prefix', 'suffix', 'dir' -- as for mkstemp.
        'mode' -- the mode argument to io.open (default "w+b").
        'buffering' -- the buffer size argument to io.open (default -1).
        'encoding' -- the encoding argument to io.open (default None)
        'newline' -- the newline argument to io.open (default None)
        'errors' -- the errors argument to io.open (default None)
        The file is created as mkstemp() would do it.

        Returns an object with a file-like interface.  The file has no
        name, and will cease to exist when it is closed.
        rOFr�N)
r&rU�_O_TMPFILE_WORKSrr��O_CREATrT�IsADirectoryErrorrrXrWrrrV)
r�r�r�r�r#r"r$r�r%roZflags2rcrCrrrr2s<
�


�
c@seZdZdZdZd:dd�dd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�Zedd��Z
edd��Zedd��Zdd�Zdd�Zd d!�Zed"d#��Zed$d%��Zed&d'��Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zed0d1��Zd2d3�Zd;d4d5�Zd6d7�Zd8d9�ZdS)<rz�Temporary file wrapper, specialized to switch from BytesIO
    or StringIO to a real file when it exceeds a certain size or
    when a fileno is needed.
    Frr�r�Nr�c	
	CsTd|krt��|_ntjt��||	|d�|_||_d|_||||||||	d�|_dS)N�b)r�r�r�F)r�r�r#r"r�r�r$r�)rX�BytesIO�_file�
TextIOWrapper�	_max_size�_rolled�_TemporaryFileArgs)
r,�max_sizer�r�r�r�r#r"r$r�rrrrzus"
��zSpooledTemporaryFile.__init__cCs,|jr
dS|j}|r(|��|kr(|��dSr.)r�r��tell�rollover)r,rqr�rrr�_check�s
zSpooledTemporaryFile._checkcCsr|jr
dS|j}tf|j�}|_|`|��}t|d�rN|j�|���	��n|�|�	��|�
|d�d|_dS)N�bufferrT)r�r�rr�r�r�r�rY�detach�getvalue�seek)r,rqZnewfile�posrrrr��s
zSpooledTemporaryFile.rollovercCs|jjrtd��|S)Nz%Cannot enter context with closed file)r��closed�
ValueErrorr/rrrr��szSpooledTemporaryFile.__enter__cCs|j��dSr.�r�rW�r,r�r�r�rrrr��szSpooledTemporaryFile.__exit__cCs
|j��Sr.)r�r0r/rrrr0�szSpooledTemporaryFile.__iter__cCs|j��dSr.r�r/rrrrW�szSpooledTemporaryFile.closecCs|jjSr.)r�r�r/rrrr��szSpooledTemporaryFile.closedcCs|jjSr.)r�r�r/rrrr��szSpooledTemporaryFile.encodingcCs|jjSr.)r�r�r/rrrr��szSpooledTemporaryFile.errorscCs|��|j��Sr.)r�r��filenor/rrrr��szSpooledTemporaryFile.filenocCs|j��dSr.)r��flushr/rrrr��szSpooledTemporaryFile.flushcCs
|j��Sr.)r��isattyr/rrrr��szSpooledTemporaryFile.isattycCs.z
|jjWStk
r(|jdYSXdS)Nr�)r�r�rIr�r/rrrr��s
zSpooledTemporaryFile.modecCs&z
|jjWStk
r YdSXdSr.)r�rCrIr/rrrrC�s
zSpooledTemporaryFile.namecCs|jjSr.)r��newlinesr/rrrr��szSpooledTemporaryFile.newlinescGs|jj|�Sr.)r��read�r,rrrrr��szSpooledTemporaryFile.readcGs|jj|�Sr.)r��readliner�rrrr��szSpooledTemporaryFile.readlinecGs|jj|�Sr.)r��	readlinesr�rrrr��szSpooledTemporaryFile.readlinescGs|jj|�Sr.)r�r�r�rrrr��szSpooledTemporaryFile.seekcCs|jjSr.)r��	softspacer/rrrr��szSpooledTemporaryFile.softspacecCs
|j��Sr.)r�r�r/rrrr��szSpooledTemporaryFile.tellcCs6|dkr|j��n||jkr&|��|j�|�dSr.)r��truncater�r�)r,�sizerrrr��s

zSpooledTemporaryFile.truncatecCs|j}|�|�}|�|�|Sr.)r�rYr�)r,�srq�rvrrrrY�s

zSpooledTemporaryFile.writecCs|j}|�|�}|�|�|Sr.)r��
writelinesr�)r,�iterablerqr�rrrr��s

zSpooledTemporaryFile.writelines)rr�r�NNNNN)N)r;r<r=r>r�rzr�r�r�r�r0rWr?r�r�r�r�r�r�r�rCr�r�r�r�r�r�r�r�rYr�rrrrrnsT��







c@sReZdZdZddd�Zedd��Zedd��Zd	d
�Zdd�Z	d
d�Z
dd�ZdS)ra+Create and return a temporary directory.  This has the same
    behavior as mkdtemp but can be used as a context manager.  For
    example:

        with TemporaryDirectory() as tmpdir:
            ...

    Upon exiting the context, the directory and everything contained
    in it are removed.
    NcCs0t|||�|_tj||j|jd�|�d�|_dS)NzImplicitly cleaning up {!r})�warn_message)rrC�_weakrefZfinalize�_cleanup�format�
_finalizer)r,r#r"r$rrrrzs�zTemporaryDirectory.__init__cs ��fdd�}tj�|d�dS)Nc	s�t|dt�r�dd�}zV|�kr0|tj�|��||�zt�|�Wn"ttfk
rh��|�YnXWq�tk
r�Yq�Xnt|dt�r�n�dS)NrcSs6zt�|d�Wntk
r$YnXt�|d�dS)Nrru)rZchflagsrI�chmod)rErrr�
resetpermss
z?TemporaryDirectory._rmtree.<locals>.onerror.<locals>.resetperms)	�
issubclassr[rrErLrVr��_rmtreer_)r�rE�exc_infor���clsrCrr�onerrorsz+TemporaryDirectory._rmtree.<locals>.onerror)r�)�_shutilZrmtree)r�rCr�rr�rr�szTemporaryDirectory._rmtreecCs|�|�t�|t�dSr.)r��	_warnings�warn�ResourceWarning)r�rCr�rrrr�/s
zTemporaryDirectory._cleanupcCsd�|jj|j�S)Nz	<{} {!r}>)r��	__class__r;rCr/rrr�__repr__4szTemporaryDirectory.__repr__cCs|jSr.)rCr/rrrr�7szTemporaryDirectory.__enter__cCs|��dSr.)�cleanupr�rrrr�:szTemporaryDirectory.__exit__cCs|j��r|�|j�dSr.)r�r�r�rCr/rrrr�=s
zTemporaryDirectory.cleanup)NNN)r;r<r=r>rz�classmethodr�r�r�r�r�r�rrrrr�s


)NNNF)NNN)r�r�NNNNNT)r�r�NNNNN)>r>�__all__�	functoolsr��warningsr��iorX�osrZshutilr��errnor`Zrandomrr+�sysrl�weakrefr��_thread�
allocate_lockZ_allocate_lock�O_RDWRr��O_EXCLrsr�rrUrrr rgrrr&r'rMrerfrjrrr	rr
rr
rrrrwr~rrC�platformrr�r�objectrrrrr�<module>s��





	-
'
( +?��'
��<__pycache__/calendar.cpython-38.opt-1.pyc000064400000064672151153537600014141 0ustar00U

e5da�@s4dZddlZddlZddlZddlmZdddddd	d
ddd
ddddddddddddddgZeZ	Gdd�de�Z
Gdd�de�ZdZdZ
dd d!d d"d d"d d d"d d"d g
ZGd#d$�d$�ZGd%d&�d&�Zed'�Zed(�Zed)�Zed*�Zed+�\ZZZZZZZd,d�Zd-d	�Zd.d
�Zd/d�Z d0d1�Z!d2d3�Z"d4d5�Z#Gd6d�de$�Z%Gd7d�de%�Z&Gd8d�de%�Z'Gd9d:�d:�Z(Gd;d�de&�Z)Gd<d�de'�Z*e&�Z+e+j,Z-d=d�Z.e+j/Z0e+j1Z1e+j2Z3e+j4Z5e+j6Z6e+j7Z8e+j9Z:e+j;Z<d>Z=d?Z>e=e>fd@dA�Z?e=e>fdBdC�Z@dDZAe�BeAdd��C�ZDdEd�ZEdFdG�ZFeGdHk�r0eFejH�dS)Ia$Calendar printing functions

Note when comparing these calendars to the ones printed by cal(1): By
default, these calendars have Monday as the first day of the week, and
Sunday as the last (the European convention). Use setfirstweekday() to
set the first day of the week (0=Monday, 6=Sunday).�N)�repeat�IllegalMonthError�IllegalWeekdayError�setfirstweekday�firstweekday�isleap�leapdays�weekday�
monthrange�
monthcalendar�prmonth�month�prcal�calendar�timegm�
month_name�
month_abbr�day_name�day_abbr�Calendar�TextCalendar�HTMLCalendar�LocaleTextCalendar�LocaleHTMLCalendar�
weekheaderc@seZdZdd�Zdd�ZdS)rcCs
||_dS�N�r
)�selfr
�r� /usr/lib64/python3.8/calendar.py�__init__szIllegalMonthError.__init__cCs
d|jS)Nz!bad month number %r; must be 1-12r�rrrr�__str__szIllegalMonthError.__str__N��__name__�
__module__�__qualname__r r"rrrrrsc@seZdZdd�Zdd�ZdS)rcCs
||_dSr�r	)rr	rrrr  szIllegalWeekdayError.__init__cCs
d|jS)Nz7bad weekday number %r; must be 0 (Monday) to 6 (Sunday)r'r!rrrr""szIllegalWeekdayError.__str__Nr#rrrrrs�����c@sFeZdZdd�ed�D�Ze�ddd��dd�Zd	d
�Zdd�Zd
S)�_localized_monthcCs g|]}t�d|dd�j�qS�i�r(��datetime�date�strftime��.0�irrr�
<listcomp>4sz_localized_month.<listcomp>�rcCsdS)N�r)�xrrr�<lambda>5�z_localized_month.<lambda>cCs
||_dSr��format�rr=rrrr 7sz_localized_month.__init__cs4�j|}t|t�r&�fdd�|D�S|�j�SdS)Ncsg|]}|�j��qSrr<�r4�fr!rrr6=sz0_localized_month.__getitem__.<locals>.<listcomp>)�_months�
isinstance�slicer=�rr5Zfuncsrr!r�__getitem__:s

z_localized_month.__getitem__cCsdS)N�
rr!rrr�__len__Asz_localized_month.__len__N)	r$r%r&�rangerA�insertr rErGrrrrr-2s
r-c@s6eZdZdd�ed�D�Zdd�Zdd�Zdd	�Zd
S)�_localized_daycCs g|]}t�dd|d�j�qSr.r/r3rrrr6Hsz_localized_day.<listcomp>�cCs
||_dSrr<r>rrrr Jsz_localized_day.__init__cs4�j|}t|t�r&�fdd�|D�S|�j�SdS)Ncsg|]}|�j��qSrr<r?r!rrr6Psz._localized_day.__getitem__.<locals>.<listcomp>)�_daysrBrCr=rDrr!rrEMs

z_localized_day.__getitem__cCsdS�NrKrr!rrrrGTsz_localized_day.__len__N)r$r%r&rHrLr rErGrrrrrJEsrJz%Az%az%Bz%brKcCs$|ddko"|ddkp"|ddkS)z5Return True for leap years, False for non-leap years.�r�d�r)�yearrrrrdscCs@|d8}|d8}|d|d|d|d|d|dS)zFReturn number of leap years in range [y1, y2).
       Assume y1 <= y2.r(rNrOrPr)Zy1Zy2rrrriscCs8tj|krtjks&nd|d}t�|||���S)zBReturn weekday (0-6 ~ Mon-Sun) for year, month (1-12), day (1-31).i�rP)r0ZMINYEARZMAXYEARr1r	)rQr
�dayrrrr	qscCsJd|krdksnt|��t||d�}t||tko>t|�}||fS)zQReturn weekday (0-6 ~ Mon-Sun) and number of days (28-31) for
       year, month.r(r7)rr	�mdays�Februaryr)rQr
�day1�ndaysrrrr
xs
cCst||tkot|�Sr)rSrTr�rQr
rrr�	_monthlen�srXcCs$|dkr|ddfS||dfSdS)Nr(r7rrWrrr�
_prevmonth�srYcCs$|dkr|ddfS||dfSdS)Nr7r(rrWrrr�
_nextmonth�srZc@s�eZdZdZd#dd�Zdd�Zdd�Zeee�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd$dd�Zd%dd�Zd&d d!�Zd"S)'rzo
    Base calendar class. This class doesn't do any formatting. It simply
    provides data to subclasses.
    rcCs
||_dSr�r�rrrrrr �szCalendar.__init__cCs
|jdSrM�Z
_firstweekdayr!rrr�getfirstweekday�szCalendar.getfirstweekdaycCs
||_dSrr]r\rrrr�szCalendar.setfirstweekdayccs&t|j|jd�D]}|dVqdS)zt
        Return an iterator for one week of weekday numbers starting with the
        configured first one.
        rKN)rHr)rr5rrr�iterweekdays�szCalendar.iterweekdaysccs,|�||�D]\}}}t�|||�VqdS)z�
        Return an iterator for one month. The iterator will yield datetime.date
        values and will always iterate through complete weeks, so it will yield
        dates outside the specified month.
        N)�itermonthdays3r0r1)rrQr
�y�m�drrr�itermonthdates�szCalendar.itermonthdatesccsft||�\}}||jd}td|�EdHtd|d�EdH|j||d}td|�EdHdS)z�
        Like itermonthdates(), but will yield day numbers. For days outside
        the specified month the day number is 0.
        rKrNr()r
rrrH)rrQr
rUrV�days_before�
days_afterrrr�
itermonthdays�szCalendar.itermonthdaysccs0t|�||�|j�D]\}}||dfVqdS)z�
        Like itermonthdates(), but will yield (day number, weekday number)
        tuples. For days outside the specified month the day number is 0.
        rKN)�	enumeratergr)rrQr
r5rcrrr�itermonthdays2�szCalendar.itermonthdays2ccs�t||�\}}||jd}|j||d}t||�\}}t||�d}	t|	||	�D]}
|||
fVqXtd|d�D]}
|||
fVqxt||�\}}td|d�D]}
|||
fVq�dS)z�
        Like itermonthdates(), but will yield (year, month, day) tuples.  Can be
        used for dates outside of datetime.date range.
        rKr(N)r
rrYrXrHrZ)rrQr
rUrVrerfrarb�endrcrrrr`�szCalendar.itermonthdays3ccs<t|�||��D]&\}\}}}||||j|dfVqdS)z�
        Like itermonthdates(), but will yield (year, month, day, day_of_week) tuples.
        Can be used for dates outside of datetime.date range.
        rKN)rhr`r)rrQr
r5rarbrcrrr�itermonthdays4�szCalendar.itermonthdays4cs.t|�||����fdd�tdt��d�D�S)z�
        Return a matrix (list of lists) representing a month's calendar.
        Each row represents a week; week entries are datetime.date values.
        csg|]}�||d��qS�rKrr3�Zdatesrrr6�sz/Calendar.monthdatescalendar.<locals>.<listcomp>rrK)�listrdrH�len�rrQr
rrmr�monthdatescalendar�szCalendar.monthdatescalendarcs.t|�||����fdd�tdt��d�D�S)z�
        Return a matrix representing a month's calendar.
        Each row represents a week; week entries are
        (day number, weekday number) tuples. Day numbers outside this month
        are zero.
        csg|]}�||d��qSrlrr3��daysrrr6�sz/Calendar.monthdays2calendar.<locals>.<listcomp>rrK)rnrirHrorprrrr�monthdays2calendar�szCalendar.monthdays2calendarcs.t|�||����fdd�tdt��d�D�S)z�
        Return a matrix representing a month's calendar.
        Each row represents a week; days outside this month are zero.
        csg|]}�||d��qSrlrr3rrrrr6�sz.Calendar.monthdayscalendar.<locals>.<listcomp>rrK)rnrgrHrorprrrr�monthdayscalendar�szCalendar.monthdayscalendar�cs>��fdd�tttd�D����fdd�tdt����D�S)a'
        Return the data for the specified year ready for formatting. The return
        value is a list of month rows. Each month row contains up to width months.
        Each month contains between 4 and 6 weeks and each week contains 1-7
        days. Days are datetime.date objects.
        csg|]}���|��qSr)rqr3�rrQrrr6s�z.Calendar.yeardatescalendar.<locals>.<listcomp>r7csg|]}�||���qSrrr3��months�widthrrr6	sr�rH�Januaryro�rrQrzr�ryrrzrQr�yeardatescalendar�s�zCalendar.yeardatescalendarcs>��fdd�tttd�D����fdd�tdt����D�S)z�
        Return the data for the specified year ready for formatting (similar to
        yeardatescalendar()). Entries in the week lists are
        (day number, weekday number) tuples. Day numbers outside this month are
        zero.
        csg|]}���|��qSr)rtr3rwrrr6s�z.Calendar.yeardays2calendar.<locals>.<listcomp>r7csg|]}�||���qSrrr3rxrrr6srr{r}rr~r�yeardays2calendars�zCalendar.yeardays2calendarcs>��fdd�tttd�D����fdd�tdt����D�S)z�
        Return the data for the specified year ready for formatting (similar to
        yeardatescalendar()). Entries in the week lists are day numbers.
        Day numbers outside this month are zero.
        csg|]}���|��qSr)rur3rwrrr6s�z-Calendar.yeardayscalendar.<locals>.<listcomp>r7csg|]}�||���qSrrr3rxrrr6"srr{r}rr~r�yeardayscalendars�zCalendar.yeardayscalendarN)r)rv)rv)rv)r$r%r&�__doc__r r^r�propertyrr_rdrgrir`rkrqrtrurr�r�rrrrr�s"

	



c@sjeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
d�Z	ddd�Z
ddd�Zd dd�Zd!dd�Z
dS)"rzr
    Subclass of Calendar that outputs a calendar as a simple plain text
    similar to the UNIX program cal.
    cCst|�||�dd�dS)z3
        Print a single week (no newline).
        r8�rjN)�print�
formatweek�r�theweekrzrrr�prweek+szTextCalendar.prweekcCs |dkrd}nd|}|�|�S)z*
        Returns a formatted day.
        rr8z%2i��center)rrRr	rz�srrr�	formatday1szTextCalendar.formatdaycsd���fdd�|D��S)zA
        Returns a single week in a string (no newline).
        � c3s |]\}}��||��VqdSr�r��r4rcZwd�rrzrr�	<genexpr>?sz*TextCalendar.formatweek.<locals>.<genexpr>��joinr�rr�rr�;szTextCalendar.formatweekcCs(|dkrt}nt}||d|��|�S)z4
        Returns a formatted week day name.
        �	N)rrr�)rrRrz�namesrrr�
formatweekdayAszTextCalendar.formatweekdaycsd���fdd����D��S)z-
        Return a header for a week.
        r�c3s|]}��|��VqdSr�r�r3r�rrr�Osz0TextCalendar.formatweekheader.<locals>.<genexpr>�r�r_r�rr�r�formatweekheaderKszTextCalendar.formatweekheaderTcCs"t|}|rd||f}|�|�S)z0
        Return a formatted month name.
        �%s %r)rr��r�theyear�themonthrz�withyearr�rrr�formatmonthnameQszTextCalendar.formatmonthnamercCst|�||||�dd�dS)z+
        Print a month's calendar.
        r8r�N)r��formatmonth)rr�r��w�lrrrrZszTextCalendar.prmonthcCs�td|�}td|�}|�||d|dd�}|��}|d|7}||�|���7}|d|7}|�||�D]$}||�||���7}|d|7}ql|S)z@
        Return a month's calendar string (multi-line).
        r)r(rK�
)�maxr��rstripr�rtr�)rr�r�r�r�r��weekrrrr�`s

zTextCalendar.formatmonthr)r(�rvc	s�td|�}td|�}td|�}|ddd�g}|j}|t����|||d����|d|���|��t���|��D�]"\}}	t||dt	||ddd��}
|d|����fdd�|
D�}|t
|�|����|d|��fdd�|
D�}|t
|�|����|d|�td	d�|	D��}
t|
�D]f}g}|	D]6}|t|�k�rj|�d
�n|���|||���qL|t
|�|����|d|��q@q�d
�
|�S)zC
        Returns a year's calendar as a multi-line string.
        r)r(rKr�rFc3s|]}���|�d�VqdS)FN)r��r4�k)�colwidthrr�rrr��s�z*TextCalendar.formatyear.<locals>.<genexpr>c3s|]
}�VqdSrrr�)�headerrrr��scss|]}t|�VqdSr)ro)r4�calrrrr��sr8)r��append�reprr�r�r�rhr�rH�min�formatstringror�r�)rr�r�r��crb�v�ar5�rowryr�ZheadersZheight�jZweeksr�r)r�r�rr�r�
formatyearps<


&
$�zTextCalendar.formatyearcCst|�|||||�dd�dS)zPrint a year's calendar.r8r�N)r�r�)rr�r�r�r�rbrrr�pryear�szTextCalendar.pryearN)T)rr)rr)r)r(r�rv)rrr�rv)r$r%r&r�r�r�r�r�r�r�rr�r�r�rrrrr%s


	


%c@s�eZdZdZdddddddgZeZd	Zd
Zd
ZdZ	dZ
dd
�Zdd�Zdd�Z
dd�Zd dd�Zd!dd�Zd"dd�Zd#dd�ZdS)$rz4
    This calendar returns complete HTML pages.
    ZmonZtueZwedZthuZfriZsatZsunZnodayr
rQcCs(|dkrd|jSd|j||fSdS)z/
        Return a day as a table cell.
        rz<td class="%s">&nbsp;</td>z<td class="%s">%d</td>N)�cssclass_noday�
cssclasses)rrRr	rrrr��s
zHTMLCalendar.formatdaycs d��fdd�|D��}d|S)z8
        Return a complete week as a table row.
        r8c3s|]\}}��||�VqdSrr�r�r!rrr��sz*HTMLCalendar.formatweek.<locals>.<genexpr>�<tr>%s</tr>r�)rr�r�rr!rr��szHTMLCalendar.formatweekcCsd|j|t|fS)z:
        Return a weekday name as a table header.
        �<th class="%s">%s</th>)�cssclasses_weekday_headr)rrRrrrr��s�zHTMLCalendar.formatweekdaycs$d��fdd����D��}d|S)z<
        Return a header for a week as a table row.
        r8c3s|]}��|�VqdSrr�r3r!rrr��sz0HTMLCalendar.formatweekheader.<locals>.<genexpr>r�r�)rr�rr!rr��szHTMLCalendar.formatweekheaderTcCs0|rdt||f}ndt|}d|j|fS)z5
        Return a month name as a table row.
        �%s %sz%sz+<tr><th colspan="7" class="%s">%s</th></tr>)r�cssclass_month_head�rr�r�r�r�rrrr��s�zHTMLCalendar.formatmonthnamecCs�g}|j}|d|j�|d�||j|||d��|d�||���|d�|�||�D]}||�|��|d�q\|d�|d�d�|�S)z6
        Return a formatted month as a table.
        �=<table border="0" cellpadding="0" cellspacing="0" class="%s">r��r��</table>r8)r��cssclass_monthr�r�rtr�r�)rr�r�r�r�r�r�rrrr��s �
zHTMLCalendar.formatmonthrvcCs�g}|j}t|d�}|d|j�|d�|d||j|f�tttd|�D]V}t|t||d��}|d�|D](}|d�||j||d	d
��|d�qr|d�qN|d
�d�|�S)z?
        Return a formatted year as a table of tables.
        r(r�r�z,<tr><th colspan="%d" class="%s">%s</th></tr>r7rFz<tr>z<td>Fr�z</td>z</tr>r�r8)	r�r��
cssclass_year�cssclass_year_headrHr|r�r�r�)rr�rzr�r�r5ryrbrrrr��s,
��

zHTMLCalendar.formatyear�calendar.cssNcCs�|dkrt��}g}|j}|d|�|d�|d�|d�|d|�|dk	r^|d|�|d|�|d	�|d
�||�||��|d�|d�d
�|��|d�S)zB
        Return a formatted year as a complete HTML page.
        Nz$<?xml version="1.0" encoding="%s"?>
zn<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
z<html>
z<head>
zC<meta http-equiv="Content-Type" content="text/html; charset=%s" />
z4<link rel="stylesheet" type="text/css" href="%s" />
z<title>Calendar for %d</title>
z</head>
z<body>
z</body>
z</html>
r8�xmlcharrefreplace)�sys�getdefaultencodingr�r�r��encode)rr�rz�css�encodingr�r�rrr�formatyearpage
s$zHTMLCalendar.formatyearpage)T)T)rv)rvr�N)r$r%r&r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr�s 



c@s$eZdZdd�Zdd�Zdd�ZdS)�different_localecCs
||_dSr��locale)rr�rrrr #szdifferent_locale.__init__cCs"t�tj�|_t�tj|j�dSr)�_localeZ	getlocale�LC_TIME�	oldlocale�	setlocaler�r!rrr�	__enter__&szdifferent_locale.__enter__cGst�tj|j�dSr)r�r�r�r�)r�argsrrr�__exit__*szdifferent_locale.__exit__N)r$r%r&r r�r�rrrrr�"sr�c@s,eZdZdZddd�Zdd�Zdd	d
�ZdS)
r�
    This class can be passed a locale name in the constructor and will return
    month and weekday names in the specified locale. If this locale includes
    an encoding all strings containing month and weekday names will be returned
    as unicode.
    rNcCs&t�||�|dkrt��}||_dSr)rr r��getdefaultlocaler��rrr�rrrr 6szLocaleTextCalendar.__init__c
CsNt|j��:|dkrt}nt}||}|d|��|�W5QR�SQRXdS)Nr�)r�r�rrr�)rrRrzr��namerrrr�<sz LocaleTextCalendar.formatweekdayTc
CsDt|j��0t|}|r$d||f}|�|�W5QR�SQRXdS)Nr�)r�r�rr�r�rrrr�Es
z"LocaleTextCalendar.formatmonthname)rN)T�r$r%r&r�r r�r�rrrrr.s
	c@s,eZdZdZddd�Zdd�Zdd	d
�ZdS)
rr�rNcCs&t�||�|dkrt��}||_dSr)rr r�r�r�r�rrrr TszLocaleHTMLCalendar.__init__c
Cs<t|j��(t|}d|j||fW5QR�SQRXdS)Nr�)r�r�rr�)rrRr�rrrr�Zsz LocaleHTMLCalendar.formatweekdayTc
CsBt|j��.t|}|r$d||f}d|W5QR�SQRXdS)Nr�z.<tr><th colspan="7" class="month">%s</th></tr>)r�r�rr�rrrr�_s
z"LocaleHTMLCalendar.formatmonthname)rN)Tr�rrrrrMs
cCs(t|krtksnt|��|t_dSr)�MONDAY�SUNDAYrr�rr[rrrrls�r�cCstt|||��dS)z1Prints multi-column formatting for year calendarsN)r�r��Zcolsr��spacingrrrr=�sr=cs |d9}|��fdd�|D��S)zEReturns a string formatted from n strings, centered within n columns.r�c3s|]}|���VqdSrr�)r4r��r�rrr��szformatstring.<locals>.<genexpr>r�r�rr�rr��sr�i�cCs^|dd�\}}}}}}t�||d���t|d}|d|}|d|}	|	d|}
|
S)zBUnrelated but handy function to calculate Unix timestamp from GMT.Nr�r(��<)r0r1�	toordinal�
_EPOCH_ORD)�tuplerQr
rRZhourZminute�secondrsZhoursZminutesZsecondsrrrr�scCs�ddl}|��}|�d�}|�d�}|jddtddd�|jd	d
tddd�|jd
dtddd�|jddtddd�|jddddd�|jddddd�|jddddd�|jd d!d"d#d$d%�|jd&d'td(d)�|jd*d'td+d)�|�|dd��}|j�r|j�s|�d,�t	�
d�|j|jf}|jd-k�r�|j�rDt|d.�}nt
�}|j}|dk�rbt	��}t||jd/�}	t	jjj}
|jdk�r�|
|jtj��jf|	��n6|jdk�r�|
|j|jf|	��n|�d0�t	�
d�n�|j�r�t|d.�}nt�}t|j|jd1�}	|jdk�r$|j|	d2<|j|	d3<|jdk�rH|j tj��jf|	�}n2|jdk�rf|j |jf|	�}n|j!|j|jf|	�}t	jj}
|j�r�|�"|j�}t	jjj}
|
|�dS)4Nrztext only argumentszhtml only argumentsz-wz--widthr)z width of date column (default 2))�type�default�helpz-lz--linesr(z)number of lines for each week (default 1)z-sz	--spacingr�z"spacing between months (default 6)z-mz--monthsrvzmonths per row (default 3)z-cz--cssr�zCSS to use for page)r�r�z-Lz--localez.locale to be used from month and weekday namesz-ez
--encodingzencoding to use for outputz-tz--type�text)r��htmlzoutput type (text or html))r��choicesr�rQ�?zyear number (1-9999))�nargsr�r�r
zmonth number (1-12, text only)z/if --locale is specified --encoding is requiredr�r�)r�r�zincorrect number of arguments)r�r�r�rb)#�argparse�ArgumentParserZadd_argument_group�add_argument�int�
parse_argsr�r��errorr��exitr�rrr��dictr��stdout�buffer�writerQr�r0r1Ztodayr
rrrz�linesr�ryr�r�r�)r�r��parserZ	textgroupZ	htmlgroupZoptionsr�r�r�Zoptdictr��resultrrr�main�s�

����������







r�__main__)Ir�r�r0r�r��	itertoolsr�__all__�
ValueErrorr�rrr|rTrSr-rJrrrrrHr�ZTUESDAYZ	WEDNESDAYZTHURSDAYZFRIDAYZSATURDAYr�rrr	r
rXrYrZ�objectrrrr�rrr�r^rrrurr�r�r�r�rrr�r
r�rr�rZ	_colwidthZ_spacingr=r�ZEPOCHr1r�r�rrr$�argvrrrr�<module>s��
u	
h
__pycache__/reprlib.cpython-38.opt-1.pyc000064400000012271151153537600014013 0ustar00U

e5d��@s^dZdddgZddlZddlmZddlmZd
d	d�ZGd
d�d�Zdd�Z	e�Z
e
jZdS)zGRedo the builtin repr() (representation) but with limits on most sizes.�Repr�repr�recursive_repr�N)�islice)�	get_ident�...cs�fdd�}|S)zGDecorator to make a repr function return fillvalue for a recursive callcsXt�����fdd�}t�d�|_t�d�|_t�d�|_t�d�|_t�di�|_|S)Nc	sBt|�t�f}|�kr�S��|�z�|�}W5��|�X|S�N)�idr�add�discard)�self�key�result)�	fillvalue�repr_running�
user_function��/usr/lib64/python3.8/reprlib.py�wrappers
z<recursive_repr.<locals>.decorating_function.<locals>.wrapper�
__module__�__doc__�__name__�__qualname__�__annotations__)�set�getattrrrrrr)rr�r)rrr�decorating_functionsz+recursive_repr.<locals>.decorating_functionr)rrrrrr	sc@s~eZdZdd�Zdd�Zdd�Zddd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS) rcCsFd|_d|_d|_d|_d|_d|_d|_d|_d|_d|_	d|_
dS)N�����()�maxlevel�maxtuple�maxlist�maxarray�maxdict�maxset�maxfrozenset�maxdeque�	maxstring�maxlong�maxother)rrrr�__init__&sz
Repr.__init__cCs|�||j�Sr)�repr1r#)r�xrrrr3sz	Repr.reprcCsVt|�j}d|kr$|��}d�|�}t|d|�rFt|d|�||�S|�||�SdS)N� �_�repr_)�typer�split�join�hasattrr�
repr_instance)rr0�level�typename�partsrrrr/6s

z
Repr.repr1�c
s�t|�}|dkr|rd}nX|d�|j���fdd�t||�D�}	||krT|	�d�d�|	�}|dkrr|rr||}d|||fS)Nrr�csg|]}�|���qSrr)�.0�elem��newlevelr/rr�
<listcomp>Gsz'Repr._repr_iterable.<locals>.<listcomp>�, z%s%s%s)�lenr/r�appendr6)
rr0r9�left�right�maxiter�trail�n�s�piecesrr@r�_repr_iterable@s

zRepr._repr_iterablecCs|�||dd|jd�S)N�(�)�,)rMr$�rr0r9rrr�
repr_tupleMszRepr.repr_tuplecCs|�||dd|j�S)N�[�])rMr%rQrrr�	repr_listPszRepr.repr_listcCs,|sd|jSd|j}|�|||d|j�S)Nzarray('%s')z
array('%s', [�]))�typecoderMr&)rr0r9�headerrrr�
repr_arraySs

zRepr.repr_arraycCs$|sdSt|�}|�||dd|j�S)Nzset()�{�})�_possibly_sortedrMr(rQrrr�repr_setYsz
Repr.repr_setcCs$|sdSt|�}|�||dd|j�S)Nzfrozenset()zfrozenset({z}))r\rMr)rQrrr�repr_frozenset_s�zRepr.repr_frozensetcCs|�||dd|j�S)Nzdeque([rV)rMr*rQrrr�
repr_dequefszRepr.repr_dequecCs�t|�}|dkrdS|dkr dS|d}|j}g}tt|�|j�D].}|||�}||||�}	|�d||	f�qB||jkr�|�d�d�|�}
d|
fS)	Nrz{}z{...}r=z%s: %srrCz{%s})rDr/rr\r'rEr6)rr0r9rJrAr/rLr
�keyrepr�valreprrKrrr�	repr_dictis 



zRepr.repr_dictcCs�t�|d|j��}t|�|jkr�td|jdd�}td|jd|�}t�|d|�|t|�|d��}|d|�d|t|�|d�}|S�Nr��r)�builtinsrr+rD�max�rr0r9rK�i�jrrr�repr_strxs&$z
Repr.repr_strcCsht�|�}t|�|jkrdtd|jdd�}td|jd|�}|d|�d|t|�|d�}|Src)rfrrDr,rgrhrrr�repr_int�s
$z
Repr.repr_intcCs�zt�|�}Wn(tk
r6d|jjt|�fYSXt|�|jkr�td|jdd�}td|jd|�}|d|�d|t|�|d�}|S)Nz<%s instance at %#x>rrdrer)	rfr�	Exception�	__class__rr	rDr-rgrhrrrr8�s$zRepr.repr_instanceN)r<)rrrr.rr/rMrRrUrYr]r^r_rbrkrlr8rrrrr$s



	cCs,z
t|�WStk
r&t|�YSXdSr)�sortedrm�list)r0rrrr\�s
r\)r)r�__all__rf�	itertoolsr�_threadrrrr\�aReprrrrrr�<module>s

s	__pycache__/re.cpython-38.opt-2.pyc000064400000013706151153537600012767 0ustar00U

e5d�=�@s�ddlZddlZddlZddlZzddlZWnek
rDdZYnXdddddddd	d
ddd
dddddddddddddddddgZdZGd d!�d!ej�Z	e
��e	j�ej
Z
d?d"d�Zd@d#d�ZdAd$d�ZdBd%d�ZdCd&d�ZdDd'd�ZdEd(d�ZdFd)d	�ZdGd*d
�Zd+d�ZdHd,d�Zd-d.�d/D�Zd0d
�Zee�d1d��Zee�d1d��d1��ZiZd2Zd3d4�Z e�!e�d5d6��Z"d7d8�Z#d9d:�Z$ddl%Z%d;d<�Z&e%�'ee&e �Gd=d>�d>�Z(dS)I�N�match�	fullmatch�search�sub�subn�split�findall�finditer�compile�purge�template�escape�error�Pattern�Match�A�I�L�M�S�X�U�ASCII�
IGNORECASE�LOCALE�	MULTILINE�DOTALL�VERBOSE�UNICODEz2.2.1c@speZdZejZZejZZ	ej
ZZej
ZZejZZejZZejZZejZZejZdd�Zej Z dS)�	RegexFlagcCs�|jdk	rd|j��S|j}g}|dk}|r2|}|jD],}||j@r8||jM}|�d|j���q8|rx|�t|��d�|�}|r�t|�dkr�d|�d�}n
d|��}|S)Nzre.r�|�z~(�)�~)�_name_�_value_�	__class__�append�hex�join�len)�self�value�members�negative�m�res�r1�/usr/lib64/python3.8/re.py�__repr__�s&




zRegexFlag.__repr__N)!�__name__�
__module__�__qualname__�sre_compile�SRE_FLAG_ASCIIrr�SRE_FLAG_IGNORECASErr�SRE_FLAG_LOCALErr�SRE_FLAG_UNICODErr�SRE_FLAG_MULTILINErr�SRE_FLAG_DOTALLrr�SRE_FLAG_VERBOSErr�SRE_FLAG_TEMPLATE�TEMPLATE�T�SRE_FLAG_DEBUG�DEBUGr3�object�__str__r1r1r1r2r�s







rcCst||��|�S�N)�_compiler��pattern�string�flagsr1r1r2r�scCst||��|�SrF)rGrrHr1r1r2r�scCst||��|�SrF)rGrrHr1r1r2r�scCst||��|||�SrF)rGr�rI�replrJ�countrKr1r1r2r�scCst||��|||�SrF)rGrrLr1r1r2r�s	cCst||��||�SrF)rGr)rIrJ�maxsplitrKr1r1r2r�scCst||��|�SrF)rGrrHr1r1r2r�scCst||��|�SrF)rGr	rHr1r1r2r	�scCs
t||�SrF)rG�rIrKr1r1r2r
�scCst��t��dSrF)�_cache�clear�
_compile_repl�cache_clearr1r1r1r2r�scCst||tB�SrF)rGrArPr1r1r2rscCsi|]}|dt|��qS)�\)�chr)�.0�ir1r1r2�
<dictcomp>srYs()[]{}?*+-|^$\.&~# 	

cCs2t|t�r|�t�St|d�}|�t��d�SdS)N�latin1)�
isinstance�str�	translate�_special_chars_map�encode)rIr1r1r2r
s


�ic
Cs�t|t�r|j}ztt|�||fWStk
r8YnXt|t�rT|rPtd��|St�	|�sft
d��t�||�}|t@s�t
t�tkr�ztttt��=Wntttfk
r�YnX|tt|�||f<|S)Nz5cannot process flags argument with a compiled patternz1first argument must be string or compiled pattern)r[rr,rQ�type�KeyErrorr�
ValueErrorr7�isstring�	TypeErrorr
rCr*�	_MAXCACHE�next�iter�
StopIteration�RuntimeError)rIrK�pr1r1r2rG!s.

�
rGcCst�||�SrF)�	sre_parse�parse_template)rMrIr1r1r2rS;srScCst�||�}t�||�SrF)rlrm�expand_template)rIrrr1r1r2�_expand@srocCs>t||�}|ds.t|d�dkr.|ddS|fdd�}|S)Nrr!cSst�||�SrF)rlrn)rrr1r1r2�filterKsz_subx.<locals>.filter)rSr*)rIrrpr1r1r2�_subxEs

rqcCst|j|jffSrF)rGrIrK)rkr1r1r2�_pickleSsrrc@seZdZddd�Zdd�ZdS)�Scannerrc
Cs�ddlm}m}t|t�r |j}||_g}t��}||_	|D]H\}}|�
�}	|�t�|||	ddt�
||�ffg��|�|	|d�q<t�||d|ffg�}t�|�|_dS)Nr)�BRANCH�
SUBPATTERN���)�
sre_constantsrtrur[rr,�lexiconrl�StaterK�	opengroupr'�
SubPattern�parse�
closegroupr7r
�scanner)
r+rxrKrtrurk�s�phrase�action�gidr1r1r2�__init__\s

�zScanner.__init__c	Cs�g}|j}|j�|�j}d}|�}|s(q�|��}||kr:q�|j|jdd}t|�rj||_|||���}|dk	rz||�|}q|||d�fS)Nrr!)r'r~r�endrx�	lastindex�callable�group)	r+rJ�resultr'rrXr/�jr�r1r1r2�scanms$zScanner.scanN)r)r4r5r6r�r�r1r1r1r2rs[s
rs)r)r)r)rr)rr)rr)r)r)r)r))�enumr7rl�	functools�_locale�ImportError�__all__�__version__�IntFlagr�globals�update�__members__rrrrrrrrr	r
rrr^r
rarrrQrfrG�	lru_cacherSrorq�copyregrr�picklersr1r1r1r2�<module>|s�
�#



	







	

__pycache__/codeop.cpython-38.opt-2.pyc000064400000004467151153537600013636 0ustar00U

e5d��@shddlZddlZdd�ejD�ZdddgZdZdd	�Zd
d�Zddd�ZGdd�d�Z	Gdd�d�Z
dS)�NcCsg|]}tt|��qS�)�getattr�
__future__)�.0Zfnamerr�/usr/lib64/python3.8/codeop.py�
<listcomp>>s�r�compile_command�Compile�CommandCompilericCsZ|�d�D] }|��}|r
|ddkr
q8q
|dkr8d}d}}}d}}	}
z||||�}Wn"tk
r�}zW5d}~XYnXt����t�d�z||d||�}	Wn&tk
r�}z|}W5d}~XYnXz||d||�}
Wn(tk
�r}z|}W5d}~XYnXW5QRXz.|�r,|W�"S|	�sHt|�t|�k�rH|�W5d}}XdS)N�
r�#�eval�pass�errorz

)�split�strip�SyntaxError�warnings�catch_warnings�simplefilter�repr)�compiler�source�filename�symbol�line�errZerr1Zerr2�code�code1�code2�errr�_maybe_compileEs8

 r!cCst|||t�S�N)�compile�PyCF_DONT_IMPLY_DEDENT�rrrrrr�_compilensr&�<input>�singlecCstt|||�Sr")r!r&r%rrrrqsc@seZdZdd�Zdd�ZdS)r	cCs
t|_dSr")r$�flags��selfrrr�__init__�szCompile.__init__cCs<t||||jd�}tD] }|j|j@r|j|jO_q|S)N�)r#r)�	_features�co_flagsZ
compiler_flag)r+rrrZcodeobZfeaturerrr�__call__�s
zCompile.__call__N��__name__�
__module__�__qualname__r,r0rrrrr	�sc@seZdZdd�Zddd�ZdS)	r
cCst�|_dSr")r	rr*rrrr,�szCommandCompiler.__init__r'r(cCst|j|||�Sr")r!r)r+rrrrrrr0�szCommandCompiler.__call__N)r'r(r1rrrrr
�s)r'r()rrZall_feature_namesr.�__all__r$r!r&rr	r
rrrr�<module>;s�
)
__pycache__/chunk.cpython-38.opt-2.pyc000064400000005211151153537600013461 0ustar00U

e5d;�@sGdd�d�ZdS)c@sZeZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zddd�Zdd�Z	ddd�Z
dd�ZdS)�ChunkTFc	Cs�ddl}d|_||_|rd}nd}||_|�d�|_t|j�dkrFt�z |�|d|�d��d|_	Wn|j
k
r�td�YnX|r�|j	d|_	d|_z|j��|_
Wnttfk
r�d|_YnXd|_dS)	N�F�>�<��L�T)�struct�closed�align�file�read�	chunkname�len�EOFErrorZunpack_from�	chunksize�error�	size_read�tell�offset�AttributeError�OSError�seekable)�selfrr
Z	bigendianZ
inclheaderrZstrflag�r�/usr/lib64/python3.8/chunk.py�__init__4s, zChunk.__init__cCs|jS�N)r
�rrrr�getnameNsz
Chunk.getnamecCs|jSr)rrrrr�getsizeRsz
Chunk.getsizecCs |jsz|��W5d|_XdS)NT)r	�skiprrrr�closeVszChunk.closecCs|jrtd��dS)N�I/O operation on closed fileF)r	�
ValueErrorrrrr�isatty]szChunk.isattyrcCsv|jrtd��|jstd��|dkr0||j}n|dkrB||j}|dksT||jkrXt�|j�|j	|d�||_dS)Nr"zcannot seek��r)
r	r#rrrr�RuntimeErrorr�seekr)r�pos�whencerrrr(bs
z
Chunk.seekcCs|jrtd��|jS)Nr")r	r#rrrrrrusz
Chunk.tell���cCs�|jrtd��|j|jkrdS|dkr2|j|j}||j|jkrN|j|j}|j�|�}|jt|�|_|j|jkr�|jr�|jd@r�|j�d�}|jt|�|_|S)Nr"�rr%)r	r#rrrrrr
)r�size�data�dummyrrrrzs$��z
Chunk.readcCs�|jrtd��|jrnzD|j|j}|jr:|jd@r:|d}|j�|d�|j||_WdStk
rlYnX|j|jkr�t	d|j|j�}|�
|�}|snt�qndS)Nr"r%i )r	r#rrrr
rr(r�minrr)r�nr/rrrr �s"
z
Chunk.skipN)TTF)r)r+)�__name__�
__module__�__qualname__rrrr!r$r(rrr rrrrr3s


rN)rrrrr�<module>3r,__pycache__/_weakrefset.cpython-38.opt-2.pyc000064400000016662151153537600014664 0ustar00U

e5dg�@s2ddlmZdgZGdd�d�ZGdd�d�ZdS)���ref�WeakSetc@s$eZdZdd�Zdd�Zdd�ZdS)�_IterationGuardcCst|�|_dS�N)r�
weakcontainer)�selfr�r	�#/usr/lib64/python3.8/_weakrefset.py�__init__sz_IterationGuard.__init__cCs |��}|dk	r|j�|�|Sr)r�
_iterating�add)r�wr	r	r
�	__enter__sz_IterationGuard.__enter__cCs0|��}|dk	r,|j}|�|�|s,|��dSr)rr�remove�_commit_removals)r�e�t�br�sr	r	r
�__exit__s
z_IterationGuard.__exit__N)�__name__�
__module__�__qualname__rrrr	r	r	r
r
src@seZdZd@dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZeZd d!�Zd"d#�Zd$d%�ZeZd&d'�Zd(d)�Zd*d+�ZeZd,d-�Zd.d/�ZeZd0d1�Zd2d3�Zd4d5�Z e Z!d6d7�Z"d8d9�Z#d:d;�Z$e$Z%d<d=�Z&d>d?�Z'dS)ArNcCsBt�|_t|�fdd�}||_g|_t�|_|dk	r>|�|�dS)NcSs2|�}|dk	r.|jr"|j�|�n|j�|�dSr)r�_pending_removals�append�data�discard)�itemZselfrefrr	r	r
�_remove&s
z!WeakSet.__init__.<locals>._remove)�setrrrrr�update)rrrr	r	r
r$szWeakSet.__init__cCs$|j}|jj}|r ||���qdSr)rrr�pop)r�lrr	r	r
r4szWeakSet._commit_removalsc	cs8t|��&|jD]}|�}|dk	r|VqW5QRXdSr)rr�rZitemrefrr	r	r
�__iter__:s


zWeakSet.__iter__cCst|j�t|j�Sr)�lenrr�rr	r	r
�__len__CszWeakSet.__len__cCs.zt|�}Wntk
r"YdSX||jkS)NF)r�	TypeErrorr)rrZwrr	r	r
�__contains__Fs
zWeakSet.__contains__cCs|jt|�ft|dd�fS)N�__dict__)�	__class__�list�getattrr'r	r	r
�
__reduce__Ms
�zWeakSet.__reduce__cCs&|jr|��|j�t||j��dSr)rrrr
rr�rrr	r	r
r
QszWeakSet.addcCs|jr|��|j��dSr)rrr�clearr'r	r	r
r1Vsz
WeakSet.clearcCs
|�|�Sr�r,r'r	r	r
�copy[szWeakSet.copycCsT|jr|��z|j��}Wntk
r:td�d�YnX|�}|dk	r|SqdS)Nzpop from empty WeakSet)rrrr"�KeyErrorr$r	r	r
r"^szWeakSet.popcCs"|jr|��|j�t|��dSr)rrrrrr0r	r	r
rjszWeakSet.removecCs"|jr|��|j�t|��dSr)rrrrrr0r	r	r
roszWeakSet.discardcCs&|jr|��|D]}|�|�qdSr)rrr
)r�otherZelementr	r	r
r!tszWeakSet.updatecCs|�|�|Sr)r!�rr5r	r	r
�__ior__zs
zWeakSet.__ior__cCs|��}|�|�|Sr)r3�difference_update�rr5Znewsetr	r	r
�
difference~s
zWeakSet.differencecCs|�|�dSr)�__isub__r6r	r	r
r8�szWeakSet.difference_updatecCs<|jr|��||kr"|j��n|j�dd�|D��|S)Ncss|]}t|�VqdSrr��.0rr	r	r
�	<genexpr>�sz#WeakSet.__isub__.<locals>.<genexpr>)rrrr1r8r6r	r	r
r;�szWeakSet.__isub__cs���fdd�|D��S)Nc3s|]}|�kr|VqdSrr	r<r'r	r
r>�sz'WeakSet.intersection.<locals>.<genexpr>r2r6r	r'r
�intersection�szWeakSet.intersectioncCs|�|�dSr)�__iand__r6r	r	r
�intersection_update�szWeakSet.intersection_updatecCs(|jr|��|j�dd�|D��|S)Ncss|]}t|�VqdSrrr<r	r	r
r>�sz#WeakSet.__iand__.<locals>.<genexpr>)rrrrAr6r	r	r
r@�szWeakSet.__iand__cCs|j�dd�|D��S)Ncss|]}t|�VqdSrrr<r	r	r
r>�sz#WeakSet.issubset.<locals>.<genexpr>)r�issubsetr6r	r	r
rB�szWeakSet.issubsetcCs|jttt|��kSr�rr �maprr6r	r	r
�__lt__�szWeakSet.__lt__cCs|j�dd�|D��S)Ncss|]}t|�VqdSrrr<r	r	r
r>�sz%WeakSet.issuperset.<locals>.<genexpr>)r�
issupersetr6r	r	r
rF�szWeakSet.issupersetcCs|jttt|��kSrrCr6r	r	r
�__gt__�szWeakSet.__gt__cCs$t||j�stS|jttt|��kSr)�
isinstancer,�NotImplementedrr rDrr6r	r	r
�__eq__�szWeakSet.__eq__cCs|��}|�|�|Sr)r3�symmetric_difference_updater9r	r	r
�symmetric_difference�s
zWeakSet.symmetric_differencecCs|�|�dSr)�__ixor__r6r	r	r
rK�sz#WeakSet.symmetric_difference_updatecs@�jr����|kr"�j��n�j��fdd�|D���S)Nc3s|]}t|�j�VqdSr)rrr<r'r	r
r>�sz#WeakSet.__ixor__.<locals>.<genexpr>)rrrr1rKr6r	r'r
rM�szWeakSet.__ixor__cCs|�dd�||fD��S)Ncss|]}|D]
}|Vq
qdSrr	)r=rrr	r	r
r>�sz WeakSet.union.<locals>.<genexpr>r2r6r	r	r
�union�sz
WeakSet.unioncCst|�|��dkS)Nr)r&r?r6r	r	r
�
isdisjoint�szWeakSet.isdisjointcCs
t|j�Sr)�reprrr'r	r	r
�__repr__�szWeakSet.__repr__)N)(rrrrrr%r(r*r/r
r1r3r"rrr!r7r:�__sub__r8r;r?�__and__rAr@rB�__le__rErF�__ge__rGrJrL�__xor__rKrMrN�__or__rOrQr	r	r	r
r#sJ
			N)�_weakrefr�__all__rrr	r	r	r
�<module>s__pycache__/getpass.cpython-38.opt-2.pyc000064400000005663151153537600014032 0ustar00U

e5dj�@s�ddlZddlZddlZddlZddlZdddgZGdd�de�Zddd�Zdd	d
�Z	ddd�Z
ddd�Zdd�Zzddl
Z
e
je
jfWnBeefk
r�zddlZWnek
r�e
ZYnXe	ZYnXeZdS)�N�getpass�getuser�GetPassWarningc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/getpass.pyrs�
Password: c
Cs�d}t�����}zJt�dtjtjB�}t�|d�}|�|�t�	|�}|�|�|sX|}Wnpt
k
r�}zR|��ztj
��}Wn&ttfk
r�d}t||�}YnXtj
}|s�tj}W5d}~XYnX|dk	�r�z�t�|�}|dd�}	|	dtjM<tj}
ttd��r|
tjO}
z t�||
|	�t|||d�}W5t�||
|�|��XWn@tjk
�r�|dk	�rz�||k	�r�|��t||�}YnX|�d�|W5QR�SQRXdS)Nz/dev/ttyzw+��TCSASOFT)�input�
)�
contextlib�	ExitStack�os�open�O_RDWR�O_NOCTTY�io�FileIO�
enter_context�
TextIOWrapper�OSError�close�sys�stdin�fileno�AttributeError�
ValueError�fallback_getpass�stderr�termios�	tcgetattrZECHOZ	TCSAFLUSH�hasattrr�	tcsetattr�flush�
_raw_input�error�write)�prompt�streamZpasswd�stack�fdZttyr
�e�old�newZtcsetattr_flagsrrr	�unix_getpasssR








r1cCs�tjtjk	rt||�S|D]}t�|�qd}t��}|dkst|dkrHqt|dkrTt�|dkrj|dd�}q.||}q.t�d�t�d�|S)N��
r�����)rr�	__stdin__r �msvcrtZputwchZgetwch�KeyboardInterrupt)r*r+�cZpwrrr	�win_getpassas 



r;cCs0tjdtdd�|stj}td|d�t||�S)Nz%Can not control echo on the terminal.�)�
stacklevelz&Warning: Password input may be echoed.)�file)�warnings�warnrrr!�printr')r*r+rrr	r xs�r r2cCs�|s
tj}|stj}t|�}|rpz|�|�Wn8tk
rf|�|jd�}|�|j�}|�|�YnX|�	�|�
�}|s�t�|ddkr�|dd�}|S)N�replacer6r)rr!r�strr)�UnicodeEncodeError�encode�encoding�decoder&�readline�EOFError)r*r+r
�linerrr	r'�s&r'cCs<dD]}tj�|�}|r|Sqddl}|�t���dS)N)ZLOGNAMEZUSERZLNAMEZUSERNAMEr)r�environ�get�pwd�getpwuid�getuid)�name�userrMrrr	r�s
)r
N)r
N)r
N)r2NN)rrrrr?�__all__�UserWarningrr1r;r r'rr"r#r%�ImportErrorrr8rrrrr	�<module>s*

D

	


__pycache__/configparser.cpython-38.opt-1.pyc000064400000131230151153537600015033 0ustar00U

e5df��@s�dZddlmZddlmZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddddd	d
ddd
ddddddddddddgZ
eZdZdZGdd�de�ZGdd�de�ZGdd�de�ZGd d�de�ZGd!d�de�ZGd"d	�d	e�ZGd#d�de�ZGd$d�de�ZGd%d
�d
e�ZGd&d
�d
e�ZGd'd�de�Ze�ZGd(d�d�Z Gd)d�de �Z!Gd*d�de �Z"Gd+d�de �Z#Gd,d�de�Z$Gd-d�de$�Z%Gd.d�de%�Z&Gd/d�de�Z'Gd0d�de�Z(dS)1a�Configuration file parser.

A configuration file consists of sections, lead by a "[section]" header,
and followed by "name: value" entries, with continuations and such in
the style of RFC 822.

Intrinsic defaults can be specified by passing them into the
ConfigParser constructor as a dictionary.

class:

ConfigParser -- responsible for parsing a list of
                    configuration files, and managing the parsed database.

    methods:

    __init__(defaults=None, dict_type=_default_dict, allow_no_value=False,
             delimiters=('=', ':'), comment_prefixes=('#', ';'),
             inline_comment_prefixes=None, strict=True,
             empty_lines_in_values=True, default_section='DEFAULT',
             interpolation=<unset>, converters=<unset>):
        Create the parser. When `defaults' is given, it is initialized into the
        dictionary or intrinsic defaults. The keys must be strings, the values
        must be appropriate for %()s string interpolation.

        When `dict_type' is given, it will be used to create the dictionary
        objects for the list of sections, for the options within a section, and
        for the default values.

        When `delimiters' is given, it will be used as the set of substrings
        that divide keys from values.

        When `comment_prefixes' is given, it will be used as the set of
        substrings that prefix comments in empty lines. Comments can be
        indented.

        When `inline_comment_prefixes' is given, it will be used as the set of
        substrings that prefix comments in non-empty lines.

        When `strict` is True, the parser won't allow for any section or option
        duplicates while reading from a single source (file, string or
        dictionary). Default is True.

        When `empty_lines_in_values' is False (default: True), each empty line
        marks the end of an option. Otherwise, internal empty lines of
        a multiline option are kept as part of the value.

        When `allow_no_value' is True (default: False), options without
        values are accepted; the value presented for these is None.

        When `default_section' is given, the name of the special section is
        named accordingly. By default it is called ``"DEFAULT"`` but this can
        be customized to point to any other valid section name. Its current
        value can be retrieved using the ``parser_instance.default_section``
        attribute and may be modified at runtime.

        When `interpolation` is given, it should be an Interpolation subclass
        instance. It will be used as the handler for option value
        pre-processing when using getters. RawConfigParser objects don't do
        any sort of interpolation, whereas ConfigParser uses an instance of
        BasicInterpolation. The library also provides a ``zc.buildbot``
        inspired ExtendedInterpolation implementation.

        When `converters` is given, it should be a dictionary where each key
        represents the name of a type converter and each value is a callable
        implementing the conversion from string to the desired datatype. Every
        converter gets its corresponding get*() method on the parser object and
        section proxies.

    sections()
        Return all the configuration section names, sans DEFAULT.

    has_section(section)
        Return whether the given section exists.

    has_option(section, option)
        Return whether the given option exists in the given section.

    options(section)
        Return list of configuration options for the named section.

    read(filenames, encoding=None)
        Read and parse the iterable of named configuration files, given by
        name.  A single filename is also allowed.  Non-existing files
        are ignored.  Return list of successfully read files.

    read_file(f, filename=None)
        Read and parse one configuration file, given as a file object.
        The filename defaults to f.name; it is only used in error
        messages (if f has no `name' attribute, the string `<???>' is used).

    read_string(string)
        Read configuration from a given string.

    read_dict(dictionary)
        Read configuration from a dictionary. Keys are section names,
        values are dictionaries with keys and values that should be present
        in the section. If the used dictionary type preserves order, sections
        and their keys will be added in order. Values are automatically
        converted to strings.

    get(section, option, raw=False, vars=None, fallback=_UNSET)
        Return a string value for the named option.  All % interpolations are
        expanded in the return values, based on the defaults passed into the
        constructor and the DEFAULT section.  Additional substitutions may be
        provided using the `vars' argument, which must be a dictionary whose
        contents override any pre-existing defaults. If `option' is a key in
        `vars', the value from `vars' is used.

    getint(section, options, raw=False, vars=None, fallback=_UNSET)
        Like get(), but convert value to an integer.

    getfloat(section, options, raw=False, vars=None, fallback=_UNSET)
        Like get(), but convert value to a float.

    getboolean(section, options, raw=False, vars=None, fallback=_UNSET)
        Like get(), but convert value to a boolean (currently case
        insensitively defined as 0, false, no, off for False, and 1, true,
        yes, on for True).  Returns False or True.

    items(section=_UNSET, raw=False, vars=None)
        If section is given, return a list of tuples with (name, value) for
        each option in the section. Otherwise, return a list of tuples with
        (section_name, section_proxy) for each section, including DEFAULTSECT.

    remove_section(section)
        Remove the given file section and all its options.

    remove_option(section, option)
        Remove the given option from the given section.

    set(section, option, value)
        Set the given option.

    write(fp, space_around_delimiters=True)
        Write the configuration state in .ini format. If
        `space_around_delimiters' is True (the default), delimiters
        between keys and values are surrounded by spaces.
�)�MutableMapping)�ChainMapN�NoSectionError�DuplicateOptionError�DuplicateSectionError�
NoOptionError�InterpolationError�InterpolationDepthError�InterpolationMissingOptionError�InterpolationSyntaxError�ParsingError�MissingSectionHeaderError�ConfigParser�SafeConfigParser�RawConfigParser�
Interpolation�BasicInterpolation�ExtendedInterpolation�LegacyInterpolation�SectionProxy�ConverterMapping�DEFAULTSECT�MAX_INTERPOLATION_DEPTHZDEFAULT�
c@s&eZdZdZddd�Zdd�ZeZdS)	�Errorz'Base class for ConfigParser exceptions.�cCs||_t�||�dS�N)�message�	Exception�__init__)�self�msg�r"�$/usr/lib64/python3.8/configparser.pyr�szError.__init__cCs|jSr)r�r r"r"r#�__repr__�szError.__repr__N)r)�__name__�
__module__�__qualname__�__doc__rr%�__str__r"r"r"r#r�s
rc@seZdZdZdd�ZdS)rz2Raised when no section matches a requested option.cCs$t�|d|f�||_|f|_dS)NzNo section: %r)rr�section�args�r r+r"r"r#r�szNoSectionError.__init__N�r&r'r(r)rr"r"r"r#r�sc@seZdZdZddd�ZdS)raRaised when a section is repeated in an input source.

    Possible repetitions that raise this exception are: multiple creation
    using the API or in strict parsers when a section is found more than once
    in a single input file, string or dictionary.
    NcCs�t|�dg}|dk	rRdt|�g}|dk	r8|�d�|��|�d�|�|�|}n|�dd�t�|d�|��||_||_	||_
|||f|_dS)N� already exists�While reading from � [line {0:2d}]z
: section rzSection r)�repr�append�format�extend�insertrr�joinr+�source�linenor,)r r+r8r9r!rr"r"r#r�s

zDuplicateSectionError.__init__)NNr.r"r"r"r#r�sc@seZdZdZddd�ZdS)rz�Raised by strict parsers when an option is repeated in an input source.

    Current implementation raises this exception only when an option is found
    more than once in a single file, string or dictionary.
    NcCs�t|�dt|�dg}|dk	rZdt|�g}|dk	r@|�d�|��|�d�|�|�|}n|�dd�t�|d�|��||_||_	||_
||_||||f|_dS)	Nz in section r/r0r1z	: option rzOption r)
r2r3r4r5r6rrr7r+�optionr8r9r,)r r+r:r8r9r!rr"r"r#r�s"�

zDuplicateOptionError.__init__)NNr.r"r"r"r#r�sc@seZdZdZdd�ZdS)rz!A requested option was not found.cCs.t�|d||f�||_||_||f|_dS)NzNo option %r in section: %r�rrr:r+r,)r r:r+r"r"r#r�s�zNoOptionError.__init__Nr.r"r"r"r#r�sc@seZdZdZdd�ZdS)rz0Base class for interpolation-related exceptions.cCs(t�||�||_||_|||f|_dSrr;)r r:r+r!r"r"r#rszInterpolationError.__init__Nr.r"r"r"r#r�sc@seZdZdZdd�ZdS)r
zAA string substitution required a setting which was not available.cCs8d�||||�}t�||||�||_||||f|_dS)Nz�Bad value substitution: option {!r} in section {!r} contains an interpolation key {!r} which is not a valid option name. Raw value: {!r})r4rr�	referencer,)r r:r+�rawvalr<r!r"r"r#rs�z(InterpolationMissingOptionError.__init__Nr.r"r"r"r#r
sc@seZdZdZdS)rz�Raised when the source text contains invalid syntax.

    Current implementation raises this exception when the source text into
    which substitutions are made does not conform to the required syntax.
    N)r&r'r(r)r"r"r"r#rsc@seZdZdZdd�ZdS)r	z0Raised when substitutions are nested too deeply.cCs0d�||t|�}t�||||�|||f|_dS)Nz�Recursion limit exceeded in value substitution: option {!r} in section {!r} contains an interpolation key which cannot be substituted in {} steps. Raw value: {!r})r4rrrr,)r r:r+r=r!r"r"r#rs�z InterpolationDepthError.__init__Nr.r"r"r"r#r	sc@s<eZdZdZd
dd�Zedd��Zejdd��Zdd	�ZdS)rz>Raised when a configuration file does not follow legal syntax.NcCsT|r|rtd��n|s$|s$td��n|r,|}t�|d|�||_g|_|f|_dS)Nz:Cannot specify both `filename' and `source'. Use `source'.z%Required argument `source' not given.z"Source contains parsing errors: %r)�
ValueErrorrrr8�errorsr,)r r8�filenamer"r"r#r,s

zParsingError.__init__cCstjdtdd�|jS)zDeprecated, use `source'.�SThe 'filename' attribute will be removed in future versions.  Use 'source' instead.���
stacklevel��warnings�warn�DeprecationWarningr8r$r"r"r#r@;s�zParsingError.filenamecCstjdtdd�||_dS)zDeprecated, user `source'.rArBrCNrE�r �valuer"r"r#r@Es�cCs*|j�||f�|jd||f7_dS)Nz
	[line %2d]: %s)r?r3r)r r9�liner"r"r#r3OszParsingError.append)NN)	r&r'r(r)r�propertyr@�setterr3r"r"r"r#r)s

	
	c@seZdZdZdd�ZdS)r
z@Raised when a key-value pair is found before any section header.cCs8t�|d|||f�||_||_||_|||f|_dS)Nz7File contains no section headers.
file: %r, line: %d
%r)rrr8r9rKr,)r r@r9rKr"r"r#rWs��z"MissingSectionHeaderError.__init__Nr.r"r"r"r#r
Tsc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)rzBDummy interpolation that passes the value through with no changes.cCs|Srr")r �parserr+r:rJ�defaultsr"r"r#�
before_getkszInterpolation.before_getcCs|Srr"�r rNr+r:rJr"r"r#�
before_setnszInterpolation.before_setcCs|Srr"rQr"r"r#�before_readqszInterpolation.before_readcCs|Srr"rQr"r"r#�before_writetszInterpolation.before_writeN)r&r'r(r)rPrRrSrTr"r"r"r#rhs
c@s2eZdZdZe�d�Zdd�Zdd�Zdd�Z	d	S)
ra!Interpolation as implemented in the classic ConfigParser.

    The option values can contain format strings which refer to other values in
    the same section, or values in the special default section.

    For example:

        something: %(dir)s/whatever

    would resolve the "%(dir)s" to the value of dir.  All reference
    expansions are done late, on demand. If a user needs to use a bare % in
    a configuration file, she can escape it by writing %%. Other % usage
    is considered a user error and raises `InterpolationSyntaxError'.z
%\(([^)]+)\)sc	Cs$g}|�||||||d�d�|�S�N�r��_interpolate_somer7�r rNr+r:rJrO�Lr"r"r#rP�szBasicInterpolation.before_getcCs<|�dd�}|j�d|�}d|kr8td||�d�f��|S)Nz%%r�%�1invalid interpolation syntax in %r at position %d��replace�_KEYCRE�subr>�find�r rNr+r:rJZ	tmp_valuer"r"r#rR�s�zBasicInterpolation.before_setc
Csj|j||d|d�}|tkr&t|||��|�rf|�d�}	|	dkrL|�|�dS|	dkrr|�|d|	��||	d�}|dd�}
|
dkr�|�d�|dd�}q&|
dk�rR|j�|�}|dkr�t||d|��|�|�	d��}||�
�d�}z||}
Wn&tk
�rt||||�d�YnXd|
k�rF|�
||||
|||d�n
|�|
�q&t||d	|f��q&dS)
NT��raw�fallbackr[rrVrB�(�'bad interpolation variable reference %rz/'%%' must be followed by '%%' or '(', found: %r)�getrr	rar3r_�matchr�optionxform�group�end�KeyErrorr
rX)r rNr:�accum�restr+�map�depthr=�p�c�m�var�vr"r"r#rX�s`



���
���z$BasicInterpolation._interpolate_someN�
r&r'r(r)�re�compiler_rPrRrXr"r"r"r#rxs

c@s2eZdZdZe�d�Zdd�Zdd�Zdd�Z	d	S)
rzyAdvanced variant of interpolation, supports the syntax used by
    `zc.buildout'. Enables interpolation between sections.z
\$\{([^}]+)\}c	Cs$g}|�||||||d�d�|�SrUrWrYr"r"r#rP�sz ExtendedInterpolation.before_getcCs<|�dd�}|j�d|�}d|kr8td||�d�f��|S)Nz$$r�$r\r]rbr"r"r#rR�s�z ExtendedInterpolation.before_setcCs�|j||d|d�}|tkr&t|||��|�r�|�d�}	|	dkrL|�|�dS|	dkrr|�|d|	��||	d�}|dd�}
|
dkr�|�d�|dd�}q&|
dk�r�|j�|�}|dkr�t||d|��|�d��	d	�}||�
�d�}|}
|}zrt|�dk�r|�|d�}||}nHt|�dk�rR|d}
|�|d�}|j|
|dd
�}nt||d|f��Wn2t
ttfk
�r�t|||d	�|��d�YnXd|k�r�|�|||||
t|j|
dd
��|d�n
|�|�q&t||d|f��q&dS)
NTrcrzrrVrB�{rg�:)rdzMore than one ':' found: %rz-'$' must be followed by '$' or '{', found: %r)rhrr	rar3r_rirrk�splitrl�lenrjrmrrr
r7rX�dict�items)r rNr:rnror+rprqr=rrrsrt�pathZsect�optrvr"r"r#rX�sx



�
���
���z'ExtendedInterpolation._interpolate_someNrwr"r"r"r#r�s

c@s6eZdZdZe�d�Zdd�Zdd�Ze	dd��Z
d	S)
rz{Deprecated interpolation used in old versions of ConfigParser.
    Use BasicInterpolation or ExtendedInterpolation instead.z%\(([^)]*)\)s|.c

Cs�|}t}|r�|d8}|r�d|kr�tj|j|d�}|j�||�}z||}Wq�tk
r�}	zt||||	jd�d�W5d}	~	XYq�Xqq�q|r�d|kr�t	|||��|S)NrVz%()rNr)
r�	functools�partial�_interpolation_replacer_r`rmr
r,r	)
r rNr+r:rJ�varsr=rqr^�er"r"r#rPs0���zLegacyInterpolation.before_getcCs|Srr"rQr"r"r#rR$szLegacyInterpolation.before_setcCs,|�d�}|dkr|��Sd|�|�SdS)NrVz%%(%s)s)rkrj)rirN�sr"r"r#r�'s
z*LegacyInterpolation._interpolation_replaceN)r&r'r(r)rxryr_rPrR�staticmethodr�r"r"r"r#r
s
c
s6eZdZdZdZdZdZe�Ze	�
ee	j�Ze	�
ej
dd�e	j�Ze	�
ej
dd�e	j�Ze	�
d�Zddddd	d	d	d	d
�Zded	fdd
dddeeed�dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdddd�Zdedd�Zdfd d!�Zdgd#d$�Zdhd%d&�Zd	ded'�d(d)�Z d*d+�Z!d	ded'�d,d-�Z"d	ded'�d.d/�Z#d	ded'�d0d1�Z$d	ded'�d2d3�Z%ed	df�fd4d5�	Z&d6d7�Z'd8d9�Z(d:d;�Z)did<d=�Z*djd>d?�Z+d@dA�Z,dBdC�Z-dDdE�Z.dFdG�Z/dHdI�Z0dJdK�Z1dLdM�Z2dNdO�Z3dPdQ�Z4dRdS�Z5dTdU�Z6dVdW�Z7dXdY�Z8dZd[�Z9d\d]�Z:d^d^d^d_�d`da�Z;e<dbdc��Z=�Z>S)krz,ConfigParser that does not do interpolation.z�
        \[                                 # [
        (?P<header>[^]]+)                  # very permissive!
        \]                                 # ]
        a�
        (?P<option>.*?)                    # very permissive!
        \s*(?P<vi>{delim})\s*              # any number of space/tab,
                                           # followed by any of the
                                           # allowed delimiters,
                                           # followed by any space/tab
        (?P<value>.*)$                     # everything up to eol
        a�
        (?P<option>.*?)                    # very permissive!
        \s*(?:                             # any number of space/tab,
        (?P<vi>{delim})\s*                 # optionally followed by
                                           # any of the allowed
                                           # delimiters, followed by any
                                           # space/tab
        (?P<value>.*))?$                   # everything up to eol
        z=|:�Zdelimz\STF)�1Zyes�trueZon�0ZnoZfalseZoffN��=r|)�#�;)�
delimiters�comment_prefixes�inline_comment_prefixes�strict�empty_lines_in_values�default_section�
interpolation�
convertersc
Cs<||_|��|_|��|_t|�|_|��|_t||	�|j|	<t|�|_|dkrd|rZ|j	n|j
|_nNd�dd�|D��}|r�t
�|jj|d�t
j�|_nt
�|jj|d�t
j�|_t|p�d�|_t|p�d�|_||_||_||_|	|_|
|_|jtkr�|j|_|jdk�rt�|_|tk	�r(|j�|�|�r8|�|�dS)Nr��|css|]}t�|�VqdSr)rx�escape)�.0�dr"r"r#�	<genexpr>jsz+RawConfigParser.__init__.<locals>.<genexpr>r�r")�_dict�	_sections�	_defaultsr�_converters�_proxiesr�tuple�_delimiters�	OPTCRE_NV�OPTCRE�_optcrer7rxry�_OPT_NV_TMPLr4�VERBOSE�	_OPT_TMPL�_comment_prefixes�_inline_comment_prefixes�_strict�_allow_no_value�_empty_lines_in_valuesr��_interpolation�_UNSET�_DEFAULT_INTERPOLATIONr�update�_read_defaults)
r rOZ	dict_typeZallow_no_valuer�r�r�r�r�r�r�r�r�r"r"r#rYs@




��

zRawConfigParser.__init__cCs|jSr)r�r$r"r"r#rO�szRawConfigParser.defaultscCst|j���S)z3Return a list of section names, excluding [DEFAULT])�listr��keysr$r"r"r#�sections�szRawConfigParser.sectionscCsJ||jkrtd|��||jkr(t|��|��|j|<t||�|j|<dS)z�Create a new section in the configuration.

        Raise DuplicateSectionError if a section by the specified name
        already exists. Raise ValueError if name is DEFAULT.
        zInvalid section name: %rN)r�r>r�rr�rr�r-r"r"r#�add_section�s

zRawConfigParser.add_sectioncCs
||jkS)z~Indicate whether the named section is present in the configuration.

        The DEFAULT section is not acknowledged.
        )r�r-r"r"r#�has_section�szRawConfigParser.has_sectioncCsJz|j|��}Wntk
r0t|�d�YnX|�|j�t|���S)z9Return a list of option names for the given section name.N)r��copyrmrr�r�r�r�)r r+Zoptsr"r"r#�options�szRawConfigParser.optionsc
Cs�t|tttjf�r|g}g}|D]f}z(t||d��}|�||�W5QRXWntk
rdYq YnXt|tj�r|t�|�}|�	|�q |S)a�Read and parse a filename or an iterable of filenames.

        Files that cannot be opened are silently ignored; this is
        designed so that you can specify an iterable of potential
        configuration file locations (e.g. current directory, user's
        home directory, systemwide directory), and all existing
        configuration files in the iterable will be read.  A single
        filename may also be given.

        Return list of successfully read files.
        )�encoding)
�
isinstance�str�bytes�os�PathLike�open�_read�OSError�fspathr3)r �	filenamesr�Zread_okr@�fpr"r"r#�read�s

zRawConfigParser.readcCs<|dkr,z
|j}Wntk
r*d}YnX|�||�dS)aPLike read() but the argument must be a file-like object.

        The `f' argument must be iterable, returning one line at a time.
        Optional second argument is the `source' specifying the name of the
        file being read. If not given, it is taken from f.name. If `f' has no
        `name' attribute, `<???>' is used.
        Nz<???>)�name�AttributeErrorr�)r �fr8r"r"r#�	read_file�s

zRawConfigParser.read_file�<string>cCst�|�}|�||�dS)z'Read configuration from a given string.N)�io�StringIOr�)r �stringr8Zsfiler"r"r#�read_string�s
zRawConfigParser.read_string�<dict>c
Cs�t�}|��D]�\}}t|�}z|�|�Wn(ttfk
rT|jrP||krP�YnX|�|�|��D]`\}}|�t|��}|dk	r�t|�}|jr�||f|kr�t	|||��|�||f�|�|||�qhqdS)aRead configuration from a dictionary.

        Keys are section names, values are dictionaries with keys and values
        that should be present in the section. If the used dictionary type
        preserves order, sections and their keys will be added in order.

        All types held in the dictionary are converted to strings during
        reading, including section names, option names and keys.

        Optional second argument is the `source' specifying the name of the
        dictionary being read.
        N)
�setr�r�r�rr>r��addrjr)r Z
dictionaryr8�elements_addedr+r��keyrJr"r"r#�	read_dict�s"

zRawConfigParser.read_dictcCs"tjdtdd�|j||d�dS)z"Deprecated, use read_file instead.zRThis method will be removed in future versions.  Use 'parser.read_file()' instead.rBrC)r8N)rFrGrHr�)r r�r@r"r"r#�readfp�s�zRawConfigParser.readfp�rdr�recCs�z|�||�}Wn(tk
r8|tkr,�n|YSYnX|�|�}z||}Wn0tk
r�|tkrtt||��n|YSYnX|s�|dkr�|S|j�|||||�SdS)a]Get an option value for a given section.

        If `vars' is provided, it must be a dictionary. The option is looked up
        in `vars' (if provided), `section', and in `DEFAULTSECT' in that order.
        If the key is not found and `fallback' is provided, it is used as
        a fallback value. `None' can be provided as a `fallback' value.

        If interpolation is enabled and the optional argument `raw' is False,
        all interpolations are expanded in the return values.

        Arguments `raw', `vars', and `fallback' are keyword only.

        The section DEFAULT is special.
        N)�
_unify_valuesrr�rjrmrr�rP)r r+r:rdr�rer�rJr"r"r#rh�s$
�zRawConfigParser.getcKs||j||f|��Sr)rh)r r+�convr:�kwargsr"r"r#�_get"szRawConfigParser._getc	KsJz|j|||f||d�|��WSttfk
rD|tkr<�|YSXdS)N)rdr�)r�rrr�)r r+r:r�rdr�rer�r"r"r#�	_get_conv%s�zRawConfigParser._get_convcKs|j||tf|||d�|��S�Nr�)r��int�r r+r:rdr�rer�r"r"r#�getint0s
��zRawConfigParser.getintcKs|j||tf|||d�|��Sr�)r��floatr�r"r"r#�getfloat5s
��zRawConfigParser.getfloatcKs |j|||jf|||d�|��Sr�)r��_convert_to_booleanr�r"r"r#�
getboolean:s��zRawConfigParser.getbooleancs��tkrt���S�j���z���j��Wn&tk
rV��jkrRt	���YnXt
����}|r�|��D]\}}|���|�<qp���fdd��|r��fdd���fdd�|D�S)a�Return a list of (name, value) tuples for each option in a section.

        All % interpolations are expanded in the return values, based on the
        defaults passed into the constructor, unless the optional argument
        `raw' is true.  Additional substitutions may be provided using the
        `vars' argument, which must be a dictionary whose contents overrides
        any pre-existing defaults.

        The section DEFAULT is special.
        cs�j���|�|��Sr)r�rP�r:)r�r+r r"r#�<lambda>Ws
�z'RawConfigParser.items.<locals>.<lambda>cs�|Srr"r�)r�r"r#r�Z�csg|]}|�|�f�qSr"r")r�r:)�value_getterr"r#�
<listcomp>[sz)RawConfigParser.items.<locals>.<listcomp>)
r��superr�r�r�r�r�rmr�rr�r�rj)r r+rdr�Z	orig_keysr�rJ��	__class__)r�r+r r�r#r�?s 


zRawConfigParser.itemscCs.|��D]}||}||=||fSt�dS)z�Remove a section from the parser and return it as
        a (section_name, section_proxy) tuple. If no section is present, raise
        KeyError.

        The section DEFAULT is never returned because it cannot be removed.
        N)r�rm�r r�rJr"r"r#�popitem]s
zRawConfigParser.popitemcCs|��Sr)�lower)r Z	optionstrr"r"r#rjjszRawConfigParser.optionxformcCsV|r||jkr"|�|�}||jkS||jkr0dS|�|�}||j|kpP||jkSdS)z�Check for the existence of a given option in a given section.
        If the specified `section' is None or an empty string, DEFAULT is
        assumed. If the specified `section' does not exist, returns False.FN)r�rjr�r�)r r+r:r"r"r#�
has_optionms



�zRawConfigParser.has_optioncCsl|r|j�||||�}|r$||jkr,|j}n.z|j|}Wntk
rXt|�d�YnX|||�|�<dS)zSet an option.N)r�rRr�r�r�rmrrj)r r+r:rJ�sectdictr"r"r#r�{s�zRawConfigParser.setcCsh|rd�|jd�}n
|jd}|jr>|�||j|j��|�|jD]}|�|||j|��|�qDdS)z�Write an .ini-format representation of the configuration state.

        If `space_around_delimiters' is True (the default), delimiters
        between keys and values are surrounded by spaces.
        z {} rN)r4r�r��_write_sectionr�r�r�)r r�Zspace_around_delimitersr�r+r"r"r#�write�s

�
�zRawConfigParser.writecCsx|�d�|��|D]T\}}|j�||||�}|dk	s<|jsR|t|��dd�}nd}|�d�||��q|�d�dS)z-Write a single section to the specified `fp'.z[{}]
N�
z
	rz{}{}
)r�r4r�rTr�r�r^)r r�Zsection_nameZ
section_itemsZ	delimiterr�rJr"r"r#r��s�zRawConfigParser._write_sectioncCsd|r||jkr|j}n.z|j|}Wntk
rBt|�d�YnX|�|�}||k}|r`||=|S)zRemove an option.N)r�r�r�rmrrj)r r+r:r��existedr"r"r#�
remove_option�s
zRawConfigParser.remove_optioncCs"||jk}|r|j|=|j|=|S)zRemove a file section.)r�r�)r r+r�r"r"r#�remove_section�s

zRawConfigParser.remove_sectioncCs&||jkr|�|�st|��|j|Sr)r�r�rmr��r r�r"r"r#�__getitem__�szRawConfigParser.__getitem__cCsX||kr|||krdS||jkr.|j��n||jkrF|j|��|�||i�dSr)r�r��clearr�r�r�r"r"r#�__setitem__�s

zRawConfigParser.__setitem__cCs2||jkrtd��|�|�s$t|��|�|�dS)Nz"Cannot remove the default section.)r�r>r�rmr�r�r"r"r#�__delitem__�s


zRawConfigParser.__delitem__cCs||jkp|�|�Sr)r�r�r�r"r"r#�__contains__�szRawConfigParser.__contains__cCst|j�dS)NrV)r~r�r$r"r"r#�__len__�szRawConfigParser.__len__cCst�|jf|j���Sr)�	itertools�chainr�r�r�r$r"r"r#�__iter__�szRawConfigParser.__iter__cCs t�}d}d}d}d}d}d}	t|dd�D�]�\}}
tj}dd�|jD�}|tjkr�|r�i}
|��D]T\}}|
�||d�}|dkr�qd||
|<|dks�|dkrd|
|d��rdt||�}qd|
}qJ|j	D]}|
�
��|�r�d}q�q�|tjkr�d}|
d|��
�}|�sN|j�rF|dk�rL|dk	�rL|�rL||dk	�rL||�
d�q*tj}q*|j�|
�}|�rh|��nd}|dk	�r�|�r�||k�r�||�
|�q*|}|j�|�}|�r<|�d	�}||jk�r�|j�r�||k�r�t|||��|j|}|�|�n@||jk�r
|j}n,|��}||j|<t||�|j|<|�|�d}q*|dk�rTt|||
��q*|j�|�}|�r�|�d
dd�\}}}|�s�|�|	|||
�}	|� |�!��}|j�r�||f|k�r�t"||||��|�||f�|dk	�r�|�
�}|g||<nd||<q*|�|	|||
�}	q*|�#�|	�r|	�dS)
aParse a sectioned configuration file.

        Each section in a configuration file contains a header, indicated by
        a name in square brackets (`[]'), plus key/value options, indicated by
        `name' and `value' delimited with a specific substring (`=' or `:' by
        default).

        Values can span multiple lines, as long as they are indented deeper
        than the first line of the value. Depending on the parser's mode, blank
        lines may be treated as parts of multiline values or ignored.

        Configuration files may include comments, prefixed by specific
        characters (`#' and `;' by default). Comments may appear on their own
        in an otherwise empty line or may be entered in lines holding values or
        section names.
        NrrV)�startcSsi|]
}|d�qS)���r")r�rrr"r"r#�
<dictcomp>�sz)RawConfigParser._read.<locals>.<dictcomp>rr�headerr:�virJ)$r��	enumerate�sys�maxsizer�r�ra�isspace�minr��strip�
startswithr�r3�NONSPACECRE�searchr�SECTCRErirkr�r�rr�r�r�r�rr�r
r��
_handle_errorrj�rstripr�_join_multiline_values)r r��fpnamer�ZcursectZsectnameZoptnamer9Zindent_levelr�rKZ
comment_startZinline_prefixesZ
next_prefixes�prefix�indexrJZfirst_nonspaceZcur_indent_levelZmor	Zoptvalr"r"r#r��s� 


��
��
�




��

zRawConfigParser._readcCsr|j|jf}t�|f|j���}|D]H\}}|��D]6\}}t|t�rTd�|��	�}|j
�||||�||<q4q$dS)Nr�)r�r�rrr�r�r�r�r7rr�rS)r rOZall_sectionsr+r�r��valr"r"r#r[s�
�z&RawConfigParser._join_multiline_valuescCs&|��D]\}}||j|�|�<qdS)zTRead the defaults passed in the initializer.
        Note: values can be non-string.N)r�r�rj)r rOr�rJr"r"r#r�gszRawConfigParser._read_defaultscCs |st|�}|�|t|��|Sr)rr3r2)r �excrr9rKr"r"r#rmszRawConfigParser._handle_errorcCs�i}z|j|}Wn(tk
r:||jkr6t|�d�YnXi}|rt|��D]&\}}|dk	rdt|�}|||�|�<qLt|||j�S)z�Create a sequence of lookups with 'vars' taking priority over
        the 'section' which takes priority over the DEFAULTSECT.

        N)	r�rmr�rr�r�rj�	_ChainMapr�)r r+r�ZsectiondictZvardictr�rJr"r"r#r�ss
zRawConfigParser._unify_valuescCs(|��|jkrtd|��|j|��S)zJReturn a boolean value translating from other types if necessary.
        zNot a boolean: %s)r��BOOLEAN_STATESr>rIr"r"r#r��sz#RawConfigParser._convert_to_booleanr)r+r:rJcCsDt|t�std��t|t�s$td��|jr.|r@t|t�s@td��dS)a�Raises a TypeError for non-string values.

        The only legal non-string value if we allow valueless
        options is None, so we need to check if the value is a
        string if:
        - we do not allow valueless options, or
        - we allow valueless options but the value is not None

        For compatibility reasons this method is not used in classic set()
        for RawConfigParsers. It is invoked in every case for mapping protocol
        access and in ConfigParser.set().
        zsection names must be stringszoption keys must be stringszoption values must be stringsN)r�r��	TypeErrorr��r r+r:rJr"r"r#�_validate_value_types�s



z%RawConfigParser._validate_value_typescCs|jSr)r�r$r"r"r#r��szRawConfigParser.converters)N)N)r�)r�)N)N)T)?r&r'r(r)Z
_SECT_TMPLr�r�rr�rxryr�rr4r�r�rr�
_default_dictrr�rrOr�r�r�r�r�r�r�r�r�rhr�r�r�r�r�r�r�rjr�r�r�r�r�r�r�r�r�rrrr�rr�rr�r�r rLr��
__classcell__r"r"r�r#r0s�

���(	




	%����




zcs<eZdZdZe�Zd	�fdd�	Z�fdd�Zdd�Z�Z	S)
rz(ConfigParser implementing interpolation.Ncs"|j||d�t��|||�dS)zmSet an option.  Extends RawConfigParser.set by validating type and
        interpolation syntax on the value.�r:rJN)r r�r�rr�r"r#r��szConfigParser.setcs|j|d�t��|�dS)z�Create a new section in the configuration.  Extends
        RawConfigParser.add_section by validating if the section name is
        a string.)r+N)r r�r�r-r�r"r#r��szConfigParser.add_sectioncCs0z"|j}t�|_|�|j|i�W5||_XdS)z�Reads the defaults passed in the initializer, implicitly converting
        values to strings like the rest of the API.

        Does not perform interpolation for backwards compatibility.
        N)r�rr�r�)r rOZhold_interpolationr"r"r#r��s
zConfigParser._read_defaults)N)
r&r'r(r)rr�r�r�r�r"r"r"r�r#r�s
cs eZdZdZ�fdd�Z�ZS)rz8ConfigParser alias for backwards compatibility purposes.cs"t�j||�tjdtdd�dS)Nz�The SafeConfigParser class has been renamed to ConfigParser in Python 3.2. This alias will be removed in future versions. Use ConfigParser directly instead.rBrC)r�rrFrGrH)r r,r�r�r"r#r�s�zSafeConfigParser.__init__)r&r'r(r)rr"r"r"r�r#r�sc@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Ze
dd��Ze
dd��Zddddd�dd�ZdS)rz+A proxy for a single section from a parser.cCsF||_||_|jD].}d|}tj|jt||�d�}t|||�qdS)z@Creates a view on a section of the specified `name` in `parser`.rh��_implN)�_parser�_namer�r�r�rh�getattr�setattr)r rNr�r�r��getterr"r"r#r�s
zSectionProxy.__init__cCsd�|j�S)Nz
<Section: {}>)r4r'r$r"r"r#r%�szSectionProxy.__repr__cCs(|j�|j|�st|��|j�|j|�Sr)r&r�r'rmrhr�r"r"r#r��szSectionProxy.__getitem__cCs"|jj||d�|j�|j||�S)Nr#)r&r r�r'r�r"r"r#r��szSectionProxy.__setitem__cCs,|j�|j|�r |j�|j|�s(t|��dSr)r&r�r'r�rmr�r"r"r#r��s�zSectionProxy.__delitem__cCs|j�|j|�Sr)r&r�r'r�r"r"r#r�szSectionProxy.__contains__cCst|���Sr)r~�_optionsr$r"r"r#r�szSectionProxy.__len__cCs|����Sr)r+rr$r"r"r#r�szSectionProxy.__iter__cCs*|j|jjkr|j�|j�S|j��SdSr)r'r&r�r�rOr$r"r"r#r+�szSectionProxy._optionscCs|jSr)r&r$r"r"r#rNszSectionProxy.parsercCs|jSr)r'r$r"r"r#r�szSectionProxy.nameNF)rdr�r%cKs(|s|jj}||j|f|||d�|��S)z�Get an option value.

        Unless `fallback` is provided, `None` will be returned if the option
        is not found.

        r�)r&rhr')r r:rerdr�r%r�r"r"r#rhs
��zSectionProxy.get)N)r&r'r(r)rr%r�r�r�rrrr+rLrNr�rhr"r"r"r#r�s"	

�c@sJeZdZdZe�d�Zdd�Zdd�Zdd�Z	d	d
�Z
dd�Zd
d�ZdS)ra/Enables reuse of get*() methods between the parser and section proxies.

    If a parser class implements a getter directly, the value for the given
    key will be ``None``. The presence of the converter name here enables
    section proxies to find and use the implementation on the parser class.
    z^get(?P<name>.+)$cCsR||_i|_t|j�D]6}|j�|�}|rtt|j|��s<qd|j|�d�<qdS)Nr�)r&�_data�dir�	GETTERCREri�callabler(rk)r rNr*rtr"r"r#r%szConverterMapping.__init__cCs
|j|Sr)r,r�r"r"r#r�.szConverterMapping.__getitem__c	Cs�zd|}Wn(tk
r4td�|t|����YnX|dkrFtd��||j|<tj|jj|d�}||_	t
|j||�|j��D] }tj|j|d�}t
|||�q�dS)NrhzIncompatible key: {} (type: {})z)Incompatible key: cannot use "" as a name)r�r$)
rr>r4�typer,r�r�r&r�Z	converterr)�valuesrh)r r�rJ�k�func�proxyr*r"r"r#r�1s �
zConverterMapping.__setitem__c	Cs~zd|p
d}Wntk
r,t|��YnX|j|=t�|jf|j���D],}zt||�WqLtk
rvYqLYqLXqLdS)Nrh)	rrmr,rrr&r1�delattrr�)r r�r2�instr"r"r#r�AszConverterMapping.__delitem__cCs
t|j�Sr)�iterr,r$r"r"r#rOszConverterMapping.__iter__cCs
t|j�Sr)r~r,r$r"r"r#rRszConverterMapping.__len__N)
r&r'r(r)rxryr.rr�r�r�rrr"r"r"r#rs
	))r)Zcollections.abcr�collectionsrrr�r�rr�rxrrF�__all__rr!rrrrrrrrrr
rr	rr
�objectr�rrrrrrrrrr"r"r"r#�<module>st
�	
	

+HJ&| 
F__pycache__/configparser.cpython-38.opt-2.pyc000064400000074112151153537600015041 0ustar00U

e5df��@s�ddlmZddlmZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZdddddd	d
ddd
dddddddddddgZe
ZdZdZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGd d�de�ZGd!d�de�ZGd"d
�d
e�ZGd#d�de�ZGd$d	�d	e�ZGd%d�de�ZGd&d
�d
e�Ze�ZGd'd�d�ZGd(d�de�Z Gd)d�de�Z!Gd*d�de�Z"Gd+d�de�Z#Gd,d�de#�Z$Gd-d�de$�Z%Gd.d�de�Z&Gd/d�de�Z'dS)0�)�MutableMapping)�ChainMapN�NoSectionError�DuplicateOptionError�DuplicateSectionError�
NoOptionError�InterpolationError�InterpolationDepthError�InterpolationMissingOptionError�InterpolationSyntaxError�ParsingError�MissingSectionHeaderError�ConfigParser�SafeConfigParser�RawConfigParser�
Interpolation�BasicInterpolation�ExtendedInterpolation�LegacyInterpolation�SectionProxy�ConverterMapping�DEFAULTSECT�MAX_INTERPOLATION_DEPTHZDEFAULT�
c@s"eZdZddd�Zdd�ZeZdS)�Error�cCs||_t�||�dS�N)�message�	Exception�__init__)�self�msg�r"�$/usr/lib64/python3.8/configparser.pyr�szError.__init__cCs|jSr)r�r r"r"r#�__repr__�szError.__repr__N)r)�__name__�
__module__�__qualname__rr%�__str__r"r"r"r#r�s
rc@seZdZdd�ZdS)rcCs$t�|d|f�||_|f|_dS)NzNo section: %r)rr�section�args�r r*r"r"r#r�szNoSectionError.__init__N�r&r'r(rr"r"r"r#r�sc@seZdZddd�ZdS)rNcCs�t|�dg}|dk	rRdt|�g}|dk	r8|�d�|��|�d�|�|�|}n|�dd�t�|d�|��||_||_	||_
|||f|_dS)N� already exists�While reading from � [line {0:2d}]z
: section rzSection r)�repr�append�format�extend�insertrr�joinr*�source�linenor+)r r*r7r8r!rr"r"r#r�s

zDuplicateSectionError.__init__)NNr-r"r"r"r#r�sc@seZdZddd�ZdS)rNcCs�t|�dt|�dg}|dk	rZdt|�g}|dk	r@|�d�|��|�d�|�|�|}n|�dd�t�|d�|��||_||_	||_
||_||||f|_dS)	Nz in section r.r/r0z	: option rzOption r)
r1r2r3r4r5rrr6r*�optionr7r8r+)r r*r9r7r8r!rr"r"r#r�s"�

zDuplicateOptionError.__init__)NNr-r"r"r"r#r�sc@seZdZdd�ZdS)rcCs.t�|d||f�||_||_||f|_dS)NzNo option %r in section: %r�rrr9r*r+)r r9r*r"r"r#r�s�zNoOptionError.__init__Nr-r"r"r"r#r�sc@seZdZdd�ZdS)rcCs(t�||�||_||_|||f|_dSrr:)r r9r*r!r"r"r#rszInterpolationError.__init__Nr-r"r"r"r#r�sc@seZdZdd�ZdS)r
cCs8d�||||�}t�||||�||_||||f|_dS)Nz�Bad value substitution: option {!r} in section {!r} contains an interpolation key {!r} which is not a valid option name. Raw value: {!r})r3rr�	referencer+)r r9r*�rawvalr;r!r"r"r#rs�z(InterpolationMissingOptionError.__init__Nr-r"r"r"r#r
sc@seZdZdS)rN)r&r'r(r"r"r"r#rsc@seZdZdd�ZdS)r	cCs0d�||t|�}t�||||�|||f|_dS)Nz�Recursion limit exceeded in value substitution: option {!r} in section {!r} contains an interpolation key which cannot be substituted in {} steps. Raw value: {!r})r3rrrr+)r r9r*r<r!r"r"r#rs�z InterpolationDepthError.__init__Nr-r"r"r"r#r	sc@s8eZdZd	dd�Zedd��Zejdd��Zdd�ZdS)
rNcCsT|r|rtd��n|s$|s$td��n|r,|}t�|d|�||_g|_|f|_dS)Nz:Cannot specify both `filename' and `source'. Use `source'.z%Required argument `source' not given.z"Source contains parsing errors: %r)�
ValueErrorrrr7�errorsr+)r r7�filenamer"r"r#r,s

zParsingError.__init__cCstjdtdd�|jS�NzSThe 'filename' attribute will be removed in future versions.  Use 'source' instead.���
stacklevel��warnings�warn�DeprecationWarningr7r$r"r"r#r?;s�zParsingError.filenamecCstjdtdd�||_dSr@rD�r �valuer"r"r#r?Es�cCs*|j�||f�|jd||f7_dS)Nz
	[line %2d]: %s)r>r2r)r r8�liner"r"r#r2OszParsingError.append)NN)r&r'r(r�propertyr?�setterr2r"r"r"r#r)s

	
	c@seZdZdd�ZdS)r
cCs8t�|d|||f�||_||_||_|||f|_dS)Nz7File contains no section headers.
file: %r, line: %d
%r)rrr7r8rJr+)r r?r8rJr"r"r#rWs��z"MissingSectionHeaderError.__init__Nr-r"r"r"r#r
Tsc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
rcCs|Srr")r �parserr*r9rI�defaultsr"r"r#�
before_getkszInterpolation.before_getcCs|Srr"�r rMr*r9rIr"r"r#�
before_setnszInterpolation.before_setcCs|Srr"rPr"r"r#�before_readqszInterpolation.before_readcCs|Srr"rPr"r"r#�before_writetszInterpolation.before_writeN)r&r'r(rOrQrRrSr"r"r"r#rhsc@s.eZdZe�d�Zdd�Zdd�Zdd�ZdS)	rz
%\(([^)]+)\)sc	Cs$g}|�||||||d�d�|�S�N�r��_interpolate_somer6�r rMr*r9rIrN�Lr"r"r#rO�szBasicInterpolation.before_getcCs<|�dd�}|j�d|�}d|kr8td||�d�f��|S)Nz%%r�%�1invalid interpolation syntax in %r at position %d��replace�_KEYCRE�subr=�find�r rMr*r9rIZ	tmp_valuer"r"r#rQ�s�zBasicInterpolation.before_setc
Csj|j||d|d�}|tkr&t|||��|�rf|�d�}	|	dkrL|�|�dS|	dkrr|�|d|	��||	d�}|dd�}
|
dkr�|�d�|dd�}q&|
dk�rR|j�|�}|dkr�t||d|��|�|�	d��}||�
�d�}z||}
Wn&tk
�rt||||�d�YnXd|
k�rF|�
||||
|||d�n
|�|
�q&t||d	|f��q&dS)
NT��raw�fallbackrZrrUrA�(�'bad interpolation variable reference %rz/'%%' must be followed by '%%' or '(', found: %r)�getrr	r`r2r^�matchr�optionxform�group�end�KeyErrorr
rW)r rMr9�accum�restr*�map�depthr<�p�c�m�var�vr"r"r#rW�s`



���
���z$BasicInterpolation._interpolate_someN�	r&r'r(�re�compiler^rOrQrWr"r"r"r#rxs
c@s.eZdZe�d�Zdd�Zdd�Zdd�ZdS)	rz
\$\{([^}]+)\}c	Cs$g}|�||||||d�d�|�SrTrVrXr"r"r#rO�sz ExtendedInterpolation.before_getcCs<|�dd�}|j�d|�}d|kr8td||�d�f��|S)Nz$$r�$r[r\rar"r"r#rQ�s�z ExtendedInterpolation.before_setcCs�|j||d|d�}|tkr&t|||��|�r�|�d�}	|	dkrL|�|�dS|	dkrr|�|d|	��||	d�}|dd�}
|
dkr�|�d�|dd�}q&|
dk�r�|j�|�}|dkr�t||d|��|�d��	d	�}||�
�d�}|}
|}zrt|�dk�r|�|d�}||}nHt|�dk�rR|d}
|�|d�}|j|
|dd
�}nt||d|f��Wn2t
ttfk
�r�t|||d	�|��d�YnXd|k�r�|�|||||
t|j|
dd
��|d�n
|�|�q&t||d|f��q&dS)
NTrbryrrUrA�{rf�:)rczMore than one ':' found: %rz-'$' must be followed by '$' or '{', found: %r)rgrr	r`r2r^rhrrj�splitrk�lenrirlrrr
r6rW�dict�items)r rMr9rmrnr*rorpr<rqrrrs�pathZsect�optrur"r"r#rW�sx



�
���
���z'ExtendedInterpolation._interpolate_someNrvr"r"r"r#r�s
c@s2eZdZe�d�Zdd�Zdd�Zedd��Z	dS)	rz%\(([^)]*)\)s|.c

Cs�|}t}|r�|d8}|r�d|kr�tj|j|d�}|j�||�}z||}Wq�tk
r�}	zt||||	jd�d�W5d}	~	XYq�Xqq�q|r�d|kr�t	|||��|S)NrUz%()rMr)
r�	functools�partial�_interpolation_replacer^r_rlr
r+r	)
r rMr*r9rI�varsr<rpr]�er"r"r#rOs0���zLegacyInterpolation.before_getcCs|Srr"rPr"r"r#rQ$szLegacyInterpolation.before_setcCs,|�d�}|dkr|��Sd|�|�SdS)NrUz%%(%s)s)rjri)rhrM�sr"r"r#r�'s
z*LegacyInterpolation._interpolation_replaceN)
r&r'r(rwrxr^rOrQ�staticmethodr�r"r"r"r#r
s

c
s2eZdZdZdZdZe�Ze�	eej
�Ze�	ejdd�ej
�Z
e�	ejdd�ej
�Ze�	d�Zddddddddd	�Zd
edfddd
ddeeed
�dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdcdd�Zdddd�Zdedd �Zdfd"d#�Zdgd$d%�Zdd
ed&�d'd(�Zd)d*�Z dd
ed&�d+d,�Z!dd
ed&�d-d.�Z"dd
ed&�d/d0�Z#dd
ed&�d1d2�Z$edd
f�fd3d4�	Z%d5d6�Z&d7d8�Z'd9d:�Z(dhd;d<�Z)did=d>�Z*d?d@�Z+dAdB�Z,dCdD�Z-dEdF�Z.dGdH�Z/dIdJ�Z0dKdL�Z1dMdN�Z2dOdP�Z3dQdR�Z4dSdT�Z5dUdV�Z6dWdX�Z7dYdZ�Z8d[d\�Z9d]d]d]d^�d_d`�Z:e;dadb��Z<�Z=S)jrz�
        \[                                 # [
        (?P<header>[^]]+)                  # very permissive!
        \]                                 # ]
        a�
        (?P<option>.*?)                    # very permissive!
        \s*(?P<vi>{delim})\s*              # any number of space/tab,
                                           # followed by any of the
                                           # allowed delimiters,
                                           # followed by any space/tab
        (?P<value>.*)$                     # everything up to eol
        a�
        (?P<option>.*?)                    # very permissive!
        \s*(?:                             # any number of space/tab,
        (?P<vi>{delim})\s*                 # optionally followed by
                                           # any of the allowed
                                           # delimiters, followed by any
                                           # space/tab
        (?P<value>.*))?$                   # everything up to eol
        z=|:�Zdelimz\STF)�1Zyes�trueZon�0ZnoZfalseZoffN��=r{)�#�;)�
delimiters�comment_prefixes�inline_comment_prefixes�strict�empty_lines_in_values�default_section�
interpolation�
convertersc
Cs<||_|��|_|��|_t|�|_|��|_t||	�|j|	<t|�|_|dkrd|rZ|j	n|j
|_nNd�dd�|D��}|r�t
�|jj|d�t
j�|_nt
�|jj|d�t
j�|_t|p�d�|_t|p�d�|_||_||_||_|	|_|
|_|jtkr�|j|_|jdk�rt�|_|tk	�r(|j�|�|�r8|�|�dS)Nr��|css|]}t�|�VqdSr)rw�escape)�.0�dr"r"r#�	<genexpr>jsz+RawConfigParser.__init__.<locals>.<genexpr>r�r")�_dict�	_sections�	_defaultsr�_converters�_proxiesr�tuple�_delimiters�	OPTCRE_NV�OPTCRE�_optcrer6rwrx�_OPT_NV_TMPLr3�VERBOSE�	_OPT_TMPL�_comment_prefixes�_inline_comment_prefixes�_strict�_allow_no_value�_empty_lines_in_valuesr��_interpolation�_UNSET�_DEFAULT_INTERPOLATIONr�update�_read_defaults)
r rNZ	dict_typeZallow_no_valuer�r�r�r�r�r�r�r�r�r"r"r#rYs@




��

zRawConfigParser.__init__cCs|jSr)r�r$r"r"r#rN�szRawConfigParser.defaultscCst|j���Sr)�listr��keysr$r"r"r#�sections�szRawConfigParser.sectionscCsJ||jkrtd|��||jkr(t|��|��|j|<t||�|j|<dS)NzInvalid section name: %r)r�r=r�rr�rr�r,r"r"r#�add_section�s

zRawConfigParser.add_sectioncCs
||jkSr)r�r,r"r"r#�has_section�szRawConfigParser.has_sectioncCsJz|j|��}Wntk
r0t|�d�YnX|�|j�t|���Sr)r��copyrlrr�r�r�r�)r r*Zoptsr"r"r#�options�szRawConfigParser.optionsc
Cs�t|tttjf�r|g}g}|D]f}z(t||d��}|�||�W5QRXWntk
rdYq YnXt|tj�r|t�|�}|�	|�q |S)N)�encoding)
�
isinstance�str�bytes�os�PathLike�open�_read�OSError�fspathr2)r �	filenamesr�Zread_okr?�fpr"r"r#�read�s

zRawConfigParser.readcCs<|dkr,z
|j}Wntk
r*d}YnX|�||�dS)Nz<???>)�name�AttributeErrorr�)r �fr7r"r"r#�	read_file�s

zRawConfigParser.read_file�<string>cCst�|�}|�||�dSr)�io�StringIOr�)r �stringr7Zsfiler"r"r#�read_string�s
zRawConfigParser.read_string�<dict>c
Cs�t�}|��D]�\}}t|�}z|�|�Wn(ttfk
rT|jrP||krP�YnX|�|�|��D]`\}}|�t|��}|dk	r�t|�}|jr�||f|kr�t	|||��|�||f�|�|||�qhqdSr)
�setrr�r�rr=r��addrir)r Z
dictionaryr7�elements_addedr*r��keyrIr"r"r#�	read_dict�s"

zRawConfigParser.read_dictcCs"tjdtdd�|j||d�dS)NzRThis method will be removed in future versions.  Use 'parser.read_file()' instead.rArB)r7)rErFrGr�)r r�r?r"r"r#�readfp�s�zRawConfigParser.readfp�rcr�rdcCs�z|�||�}Wn(tk
r8|tkr,�n|YSYnX|�|�}z||}Wn0tk
r�|tkrtt||��n|YSYnX|s�|dkr�|S|j�|||||�SdSr)�
_unify_valuesrr�rirlrr�rO)r r*r9rcr�rdr�rIr"r"r#rg�s$
�zRawConfigParser.getcKs||j||f|��Sr)rg)r r*�convr9�kwargsr"r"r#�_get"szRawConfigParser._getc	KsJz|j|||f||d�|��WSttfk
rD|tkr<�|YSXdS)N)rcr�)r�rrr�)r r*r9r�rcr�rdr�r"r"r#�	_get_conv%s�zRawConfigParser._get_convcKs|j||tf|||d�|��S�Nr�)r��int�r r*r9rcr�rdr�r"r"r#�getint0s
��zRawConfigParser.getintcKs|j||tf|||d�|��Sr�)r��floatr�r"r"r#�getfloat5s
��zRawConfigParser.getfloatcKs |j|||jf|||d�|��Sr�)r��_convert_to_booleanr�r"r"r#�
getboolean:s��zRawConfigParser.getbooleancs��tkrt���S�j���z���j��Wn&tk
rV��jkrRt	���YnXt
����}|r�|��D]\}}|���|�<qp���fdd��|r��fdd���fdd�|D�S)Ncs�j���|�|��Sr)r�rO�r9)r�r*r r"r#�<lambda>Ws
�z'RawConfigParser.items.<locals>.<lambda>cs�|Srr"r�)r�r"r#r�Z�csg|]}|�|�f�qSr"r")r�r9)�value_getterr"r#�
<listcomp>[sz)RawConfigParser.items.<locals>.<listcomp>)
r��superrr�r�r�r�rlr�rr�r�ri)r r*rcr�Z	orig_keysr�rI��	__class__)r�r*r r�r#r?s 


zRawConfigParser.itemscCs.|��D]}||}||=||fSt�dSr)r�rl�r r�rIr"r"r#�popitem]s
zRawConfigParser.popitemcCs|��Sr)�lower)r Z	optionstrr"r"r#rijszRawConfigParser.optionxformcCsV|r||jkr"|�|�}||jkS||jkr0dS|�|�}||j|kpP||jkSdS)NF)r�rir�r�)r r*r9r"r"r#�
has_optionms



�zRawConfigParser.has_optioncCsl|r|j�||||�}|r$||jkr,|j}n.z|j|}Wntk
rXt|�d�YnX|||�|�<dSr)r�rQr�r�r�rlrri)r r*r9rI�sectdictr"r"r#r�{s�zRawConfigParser.setcCsh|rd�|jd�}n
|jd}|jr>|�||j|j��|�|jD]}|�|||j|��|�qDdS)Nz {} r)r3r�r��_write_sectionr�rr�)r r�Zspace_around_delimitersr�r*r"r"r#�write�s

�
�zRawConfigParser.writecCsx|�d�|��|D]T\}}|j�||||�}|dk	s<|jsR|t|��dd�}nd}|�d�||��q|�d�dS)Nz[{}]
�
z
	rz{}{}
)r�r3r�rSr�r�r])r r�Zsection_nameZ
section_itemsZ	delimiterr�rIr"r"r#r��s�zRawConfigParser._write_sectioncCsd|r||jkr|j}n.z|j|}Wntk
rBt|�d�YnX|�|�}||k}|r`||=|Sr)r�r�r�rlrri)r r*r9r��existedr"r"r#�
remove_option�s
zRawConfigParser.remove_optioncCs"||jk}|r|j|=|j|=|Sr)r�r�)r r*r�r"r"r#�remove_section�s

zRawConfigParser.remove_sectioncCs&||jkr|�|�st|��|j|Sr)r�r�rlr��r r�r"r"r#�__getitem__�szRawConfigParser.__getitem__cCsX||kr|||krdS||jkr.|j��n||jkrF|j|��|�||i�dSr)r�r��clearr�r�r�r"r"r#�__setitem__�s

zRawConfigParser.__setitem__cCs2||jkrtd��|�|�s$t|��|�|�dS)Nz"Cannot remove the default section.)r�r=r�rlr�r�r"r"r#�__delitem__�s


zRawConfigParser.__delitem__cCs||jkp|�|�Sr)r�r�r�r"r"r#�__contains__�szRawConfigParser.__contains__cCst|j�dS)NrU)r}r�r$r"r"r#�__len__�szRawConfigParser.__len__cCst�|jf|j���Sr)�	itertools�chainr�r�r�r$r"r"r#�__iter__�szRawConfigParser.__iter__cCs t�}d}d}d}d}d}d}	t|dd�D�]�\}}
tj}dd�|jD�}|tjkr�|r�i}
|��D]T\}}|
�||d�}|dkr�qd||
|<|dks�|dkrd|
|d��rdt||�}qd|
}qJ|j	D]}|
�
��|�r�d}q�q�|tjkr�d}|
d|��
�}|�sN|j�rF|dk�rL|dk	�rL|�rL||dk	�rL||�
d�q*tj}q*|j�|
�}|�rh|��nd}|dk	�r�|�r�||k�r�||�
|�q*|}|j�|�}|�r<|�d�}||jk�r�|j�r�||k�r�t|||��|j|}|�|�n@||jk�r
|j}n,|��}||j|<t||�|j|<|�|�d}q*|dk�rTt|||
��q*|j�|�}|�r�|�d	d
d�\}}}|�s�|�|	|||
�}	|� |�!��}|j�r�||f|k�r�t"||||��|�||f�|dk	�r�|�
�}|g||<nd||<q*|�|	|||
�}	q*|�#�|	�r|	�dS)NrrU)�startcSsi|]
}|d�qS)���r")r�rqr"r"r#�
<dictcomp>�sz)RawConfigParser._read.<locals>.<dictcomp>rr�headerr9�virI)$r��	enumerate�sys�maxsizer�rr`�isspace�minr��strip�
startswithr�r2�NONSPACECRE�searchr�SECTCRErhrjr�r�rr�r�r�r�rr�r
r��
_handle_errorri�rstripr�_join_multiline_values)r r��fpnamer�ZcursectZsectnameZoptnamer8Zindent_levelr�rJZ
comment_startZinline_prefixesZ
next_prefixes�prefix�indexrIZfirst_nonspaceZcur_indent_levelZmorZoptvalr"r"r#r��s� 


��
��
�




��

zRawConfigParser._readcCsr|j|jf}t�|f|j���}|D]H\}}|��D]6\}}t|t�rTd�|��	�}|j
�||||�||<q4q$dS)Nr�)r�r�rrr�rr�r�r6rr�rR)r rNZall_sectionsr*r�r��valr"r"r#r[s�
�z&RawConfigParser._join_multiline_valuescCs&|��D]\}}||j|�|�<qdSr)rr�ri)r rNr�rIr"r"r#r�gszRawConfigParser._read_defaultscCs |st|�}|�|t|��|Sr)rr2r1)r �excrr8rJr"r"r#rmszRawConfigParser._handle_errorcCs�i}z|j|}Wn(tk
r:||jkr6t|�d�YnXi}|rt|��D]&\}}|dk	rdt|�}|||�|�<qLt|||j�Sr)	r�rlr�rrr�ri�	_ChainMapr�)r r*r�ZsectiondictZvardictr�rIr"r"r#r�ss
zRawConfigParser._unify_valuescCs(|��|jkrtd|��|j|��S)NzNot a boolean: %s)r��BOOLEAN_STATESr=rHr"r"r#r��sz#RawConfigParser._convert_to_booleanr)r*r9rIcCsDt|t�std��t|t�s$td��|jr.|r@t|t�s@td��dS)Nzsection names must be stringszoption keys must be stringszoption values must be strings)r�r��	TypeErrorr��r r*r9rIr"r"r#�_validate_value_types�s



z%RawConfigParser._validate_value_typescCs|jSr)r�r$r"r"r#r��szRawConfigParser.converters)N)N)r�)r�)N)N)T)>r&r'r(Z
_SECT_TMPLr�r�rr�rwrxr�rr3r�r�rr�
_default_dictrr�rrNr�r�r�r�r�r�r�r�r�rgr�r�r�r�r�rr�rir�r�r�r�r�r�r�r�r�r�rrr�rr�rr�r�rrKr��
__classcell__r"r"r�r#r0s�

���(	




	%����




zcs8eZdZe�Zd�fdd�	Z�fdd�Zdd�Z�ZS)	rNcs"|j||d�t��|||�dS�N)r9rI)rr�r�rr�r"r#r��szConfigParser.setcs|j|d�t��|�dS)N)r*)rr�r�r,r�r"r#r��szConfigParser.add_sectioncCs0z"|j}t�|_|�|j|i�W5||_XdSr)r�rr�r�)r rNZhold_interpolationr"r"r#r��s
zConfigParser._read_defaults)N)	r&r'r(rr�r�r�r�r!r"r"r�r#r�scseZdZ�fdd�Z�ZS)rcs"t�j||�tjdtdd�dS)Nz�The SafeConfigParser class has been renamed to ConfigParser in Python 3.2. This alias will be removed in future versions. Use ConfigParser directly instead.rArB)r�rrErFrG)r r+r�r�r"r#r�s�zSafeConfigParser.__init__)r&r'r(rr!r"r"r�r#r�sc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zedd��Z
edd��Zddddd�dd�ZdS)rcCsF||_||_|jD].}d|}tj|jt||�d�}t|||�qdS)Nrg��_impl)�_parser�_namer�r�r�rg�getattr�setattr)r rMr�r�r��getterr"r"r#r�s
zSectionProxy.__init__cCsd�|j�S)Nz
<Section: {}>)r3r&r$r"r"r#r%�szSectionProxy.__repr__cCs(|j�|j|�st|��|j�|j|�Sr)r%r�r&rlrgr�r"r"r#r��szSectionProxy.__getitem__cCs"|jj||d�|j�|j||�Sr")r%rr�r&r�r"r"r#r��szSectionProxy.__setitem__cCs,|j�|j|�r |j�|j|�s(t|��dSr)r%r�r&r�rlr�r"r"r#r��s�zSectionProxy.__delitem__cCs|j�|j|�Sr)r%r�r&r�r"r"r#r��szSectionProxy.__contains__cCst|���Sr)r}�_optionsr$r"r"r#r�szSectionProxy.__len__cCs|����Sr)r*rr$r"r"r#r�szSectionProxy.__iter__cCs*|j|jjkr|j�|j�S|j��SdSr)r&r%r�r�rNr$r"r"r#r*�szSectionProxy._optionscCs|jSr)r%r$r"r"r#rMszSectionProxy.parsercCs|jSr)r&r$r"r"r#r�szSectionProxy.nameNF)rcr�r$cKs(|s|jj}||j|f|||d�|��Sr�)r%rgr&)r r9rdrcr�r$r�r"r"r#rgs
��zSectionProxy.get)N)r&r'r(rr%r�r�r�r�rrr*rKrMr�rgr"r"r"r#r�s 	

�c@sFeZdZe�d�Zdd�Zdd�Zdd�Zdd	�Z	d
d�Z
dd
�ZdS)rz^get(?P<name>.+)$cCsR||_i|_t|j�D]6}|j�|�}|rtt|j|��s<qd|j|�d�<qdS)Nr�)r%�_data�dir�	GETTERCRErh�callabler'rj)r rMr)rsr"r"r#r%szConverterMapping.__init__cCs
|j|Sr)r+r�r"r"r#r�.szConverterMapping.__getitem__c	Cs�zd|}Wn(tk
r4td�|t|����YnX|dkrFtd��||j|<tj|jj|d�}||_	t
|j||�|j��D] }tj|j|d�}t
|||�q�dS)NrgzIncompatible key: {} (type: {})z)Incompatible key: cannot use "" as a name)r�r#)
rr=r3�typer+r�r�r%r�Z	converterr(�valuesrg)r r�rI�k�func�proxyr)r"r"r#r�1s �
zConverterMapping.__setitem__c	Cs~zd|p
d}Wntk
r,t|��YnX|j|=t�|jf|j���D],}zt||�WqLtk
rvYqLYqLXqLdS)Nrg)	rrlr+rrr%r0�delattrr�)r r�r1�instr"r"r#r�AszConverterMapping.__delitem__cCs
t|j�Sr)�iterr+r$r"r"r#rOszConverterMapping.__iter__cCs
t|j�Sr)r}r+r$r"r"r#rRszConverterMapping.__len__N)r&r'r(rwrxr-rr�r�r�rrr"r"r"r#rs
	)(Zcollections.abcr�collectionsrrr�r�rr�rwr
rE�__all__r~r rrrrrrrrrr
rr	rr
�objectr�rrrrrrrrrr"r"r"r#�<module>�sp�	
	

+HJ&| 
F__pycache__/modulefinder.cpython-38.opt-2.pyc000064400000035452151153537600015040 0ustar00U

e5dn_�@sddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ej
dZej
dZej
dZ
ej
dZe
efZejZdZdZdZdZd	Zd
ZdZiZdd
�ZiZdd�Zddd�ZGdd�d�ZGdd�d�Zdd�Ze dk�rz
e�Z!Wne"k
�re#d�YnXdS)�N�
LOAD_CONST�IMPORT_NAME�
STORE_NAME�STORE_GLOBAL������cCst�|g��|�dS�N)�packagePathMap�
setdefault�append)Zpackagename�path�r�$/usr/lib64/python3.8/modulefinder.py�AddPackagePath(srcCs|t|<dSr)�replacePackageMap)Zoldname�newnamerrr�ReplacePackage3srcCstjj��tjj�||�}|dkr8tdj|d�|d��|jtjjkrVddddt	ffS|jtjj
krtddddtffS|j}|j�
|�r�dtj�|�ddtffSt|jtjj�r�t}n<t|jtjj�r�t}n&t|jtjj�r�t}nddddtffSt�|�}tj�|�d}|||d|ffS)NzNo module named {name!r})�name�����rb)�	importlib�	machinery�
PathFinder�invalidate_caches�	find_spec�ImportError�format�loader�BuiltinImporter�
_C_BUILTIN�FrozenImporter�
_PY_FROZEN�origin�
is_package�osr�dirname�_PKG_DIRECTORY�
isinstance�SourceFileLoader�
_PY_SOURCE�ExtensionFileLoader�_C_EXTENSION�SourcelessFileLoader�_PY_COMPILED�
_SEARCH_ERROR�io�	open_code�splitext)rr�specZ	file_pathZkind�file�suffixrrr�_find_module7s*
r:c@seZdZddd�Zdd�ZdS)�ModuleNcCs(||_||_||_d|_i|_i|_dSr)�__name__�__file__�__path__�__code__�globalnames�starimports)�selfrr8rrrr�__init__fszModule.__init__cCsLd|jf}|jdk	r&|d|jf}|jdk	r@|d|jf}|d}|S)Nz	Module(%rz, %r�))r<r=r>)rB�srrr�__repr__ss

zModule.__repr__)NN)r<�
__module__�__qualname__rCrFrrrrr;ds

r;c@s�eZdZd6dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zd7dd�Z	d8dd�Z
dd�Zdd�Zd9dd�Z
dd�Zdd�Zdd�Zd d!�Zd:d"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd;d,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�ZdS)<�ModuleFinderNrcCsZ|dkrtj}||_i|_i|_||_d|_|dk	r8|ng|_|dk	rJ|ng|_g|_dS)Nr)	�sysr�modules�
badmodules�debug�indent�excludes�
replace_paths�processed_paths)rBrrMrOrPrrrrC~szModuleFinder.__init__cGsV||jkrRt|j�D]}tddd�qt|dd�|D]}tt|�dd�q6t�dS)N�   � ��end)rM�rangerN�print�repr)rB�level�str�args�i�argrrr�msg�s
zModuleFinder.msgcGs,|d}||jkr(|jd|_|j|�dS�Nrr�rMrNr^�rBr[rYrrr�msgin�s
zModuleFinder.msgincGs,|d}||jkr(|jd|_|j|�dSr_r`rarrr�msgout�s
zModuleFinder.msgoutc	CsB|�dd|�t�|�� }ddtf}|�d|||�W5QRXdS)Nr�
run_scriptrr�__main__)r^r4r5r.�load_module)rB�pathname�fp�stuffrrrrd�s
zModuleFinder.run_scriptc	CsTtj�|�\}}tj�|�\}}t�|�� }|dtf}|�||||�W5QRXdS)Nr)r)r�splitr6r4r5r.rf)rBrg�dirrZextrhrirrr�	load_file�s

zModuleFinder.load_filerc	Cs\|�dd||||�|j||d�}|�||�\}}|�||�}|sF|S|jrX|�||�dS)Nr�import_hook�rY)r^�determine_parent�find_head_package�	load_tailr>�ensure_fromlist)	rBr�caller�fromlistrY�parent�q�tail�mrrrrm�szModuleFinder.import_hookcCs&|�dd||�|r|dkr,|�dd�dS|j}|dkr�|jrH|d8}|dkrl|j|}|�dd|�|S|�d�|kr�td��d�|�d�d|��}|j|}|�dd|�|S|jr�|j|}|�dd|�|Sd|k�r|�	d�}|d|�}|j|}|�dd|�|S|�dd�dS)	N�rorzdetermine_parent -> Nonerzdetermine_parent ->�.zrelative importpath too deep)
rbrcr<r>rK�countr �joinrj�rfind)rBrsrYZpnamerur\rrrro�s<





zModuleFinder.determine_parentcCs�|�dd||�d|kr@|�d�}|d|�}||dd�}n|}d}|r\d|j|f}n|}|�|||�}|r�|�dd||f�||fS|r�|}d}|�|||�}|r�|�dd||f�||fS|�dd|�td	|��dS)
Nryrprzrr�%s.%szfind_head_package ->�"raise ImportError: No module named�No module named )rb�findr<�
import_modulercr )rBrurr\�headrwZqnamervrrrrp�s.
zModuleFinder.find_head_packagecCs�|�dd||�|}|r�|�d�}|dkr2t|�}|d|�||dd�}}d|j|f}|�|||�}|s|�dd|�td|��q|�dd	|�|S)
Nryrqrzrrr~rr�zload_tail ->)rbr��lenr<r�rcr )rBrvrwrxr\r�Zmnamerrrrq�s
zModuleFinder.load_tailcCs�|�dd|||�|D]d}|dkrD|sz|�|�}|rz|�||d�qt||�sd|j|f}|�|||�}|std|��qdS)Nryrr�*rr~r�)r^�find_all_submodulesrr�hasattrr<r�r )rBrxrt�	recursive�sub�all�subnameZsubmodrrrrrs

zModuleFinder.ensure_fromlistc
	Cs�|js
dSi}g}|tjjdd�7}|tjjdd�7}|tjjdd�7}|jD]�}zt�|�}Wn&tk
r�|�	dd|�YqTYnX|D]R}d}|D]0}t
|�}	||	d�|kr�|d|	�}q�q�|r�|dkr�|||<q�qT|��S)Nrzcan't list directoryrC)r>rr�EXTENSION_SUFFIXES�SOURCE_SUFFIXES�BYTECODE_SUFFIXESr)�listdir�OSErrorr^r��keys)
rBrxrK�suffixesrk�namesr�modZsuff�nrrrr�s.

z ModuleFinder.find_all_submodulescCs
|�dd|||�z|j|}Wntk
r4YnX|�dd|�|S||jkrb|�dd�dS|r�|jdkr�|�dd�dSz|�||o�|j|�\}}}Wn$tk
r�|�ddd�YdSXz|�	||||�}W5|r�|��X|r�t
|||�|�dd|�|S)Nrr�zimport_module ->zimport_module -> None)rbrK�KeyErrorrcrLr>�find_moduler �closerf�setattr)rBZpartname�fqnamerurxrhrgrirrrr�.s:
�
zModuleFinder.import_modulec
Cs(|\}}}|�dd||od|�|tkrF|�||�}|�dd|�|S|tkr`t|��|d�}	n||tkr�z|��}
tj	�
|
|i�Wn:tk
r�}z|�ddt|�|��W5d}~XYnXt
�t|
�dd��}	nd}	|�|�}||_|	�r|j�r|�|	�}	|	|_|�|	|�|�dd|�|S)Nrrfrhzload_module ->�execzraise ImportError: �)rbr+�load_packagercr.�compile�readr2r�_bootstrap_external�
_classify_pycr rZ�marshal�loads�
memoryview�
add_moduler=rP�replace_paths_in_coder?�	scan_code)rBr�rhrg�	file_infor9�mode�typerx�co�data�excrrrrfNs4


zModuleFinder.load_modulecCs<||jkri|j|<|r*d|j||j<nd|j|d<dS)Nr�-)rLr<)rBrrsrrr�_add_badmoduleks


zModuleFinder._add_badmodulecCsB||jkr|�||�dSz|j|||d�Wn~tk
rn}z"|�ddt|��|�||�W5d}~XYn�tk
r�}z"|�ddt|��|�||�W5d}~XYn�X|�r>|D]�}|d|}||jkr�|�||�q�z|j|||g|d�Wq�tk
�r:}z"|�ddt|��|�||�W5d}~XYq�Xq�dS)NrnrzImportError:zSyntaxError:rz)rLr�rmr r^rZ�SyntaxError)rBrrsrtrYr^r��fullnamerrr�_safe_import_hookss,

zModuleFinder._safe_import_hookccs�|j}|j}|j}dd�t�|�D�}t|�D]�\}\}}|tkrTd||ffVq.|tkr.|dkr.||dd||ddkr�tkr.nq.|||dd}	|||dd}
|	dkr�d|
||ffVq.d|	|
||ffVq.q.dS)	NcSs"g|]\}}}|tkr||f�qSr)�EXTENDED_ARG)�.0�_�opr]rrr�
<listcomp>�s�z-ModuleFinder.scan_opcodes.<locals>.<listcomp>�storerrr�absolute_import�relative_import)	�co_code�co_names�	co_consts�disZ_unpack_opargs�	enumerate�	STORE_OPSrr)rBr��coder��constsZopargsr\r�ZopargrYrtrrr�scan_opcodes�s(��
zModuleFinder.scan_opcodescCs�|j}|j}||�D�]F\}}|dkr8|\}d|j|<q|dk�r|\}}d}	|dk	rpd|krbd}	dd�|D�}|j|||dd�|	�r\d}
|jr�|j�|jd	|�}
|
dkr�|j�|�}
|
dk	r�|j�|
j�|j	�|
j	�|
j
dkr�d|j	|<n
d|j	|<q|d
k�rT|\}}}|�r0|j||||d�n"|j||d�}|j|jd|dd�qt|��q|j
D]"}
t|
t|���rd|�|
|��qddS)Nr�rr�rr�cSsg|]}|dkr|�qS)r�r)r��frrrr��sz*ModuleFinder.scan_code.<locals>.<listcomp>rnrzr�)r�r�r@r�r>rK�getr<�updaterAr?ro�RuntimeErrorr�r,r�r�)rBr�rxr��scannerZwhatr[rrtZ	have_starZmmrYru�crrrr��sH





zModuleFinder.scan_codecCs�|�dd||�t�|�}|r"|}|�|�}||_|g|_|jt�|g�|_|�d|j�\}}}z&|�	||||�|�
dd|�|W�S|r�|��XdS)Nrr�rCzload_package ->)rbrr�r�r=r>r
r�r�rfrc)rBr�rgrrxrhZbufrirrrr��s

zModuleFinder.load_packagecCs*||jkr|j|St|�|j|<}|Sr)rKr;)rBr�rxrrrr��s

zModuleFinder.add_modulecCsn|dk	r|jd|}n|}||jkr<|�dd|�t|��|dkrd|tjkr^ddddtffS|j}t||�S)Nrzrzfind_module -> Excludedr)	r<rOrcr rJ�builtin_module_namesr$rr:)rBrrrur�rrrr��s

zModuleFinder.find_modulecCst�tdd�tdd�t|j���}|D]B}|j|}|jrRtddd�ntddd�td||jpnd	�q0|��\}}|r�t�td
�|D]*}t|j|���}td|dd
�|��q�|�rt�tddd�td�|D]*}t|j|���}td|dd
�|��q�dS)Nz
  %-25s %s)�NameZFile)�----r��PrSrTrxz%-25srzMissing modules:�?z
imported fromz, z7Submodules that appear to be missing, but could also bez#global names in the parent package:)	rW�sortedrKr�r>r=�any_missing_mayberLr|)rBr��keyrx�missing�mayberZmodsrrr�reports0
zModuleFinder.reportcCs|��\}}||Sr)r�)rBr�r�rrr�any_missing"szModuleFinder.any_missingcCs�g}g}|jD]�}||jkrq|�d�}|dkr<|�|�q||dd�}|d|�}|j�|�}|dk	r�||j|kr�|�|�q�||jkr�q�|jr�|�|�q�|�|�q|�|�q|��|��||fS)Nrzrr)	rLrOr}rrKr�r@rA�sort)rBr�r�rr\r�ZpkgnameZpkgrrrr�*s0	




zModuleFinder.any_missing_maybecCs�tj�|j�}}|jD]*\}}|�|�r||t|�d�}qDq|jr�||jkr�||krr|�	dd||f�n|�	dd|f�|j�
|�t|j�}t
t|��D](}t||t|��r�|�||�||<q�|jt|�|d�S)Nrzco_filename %r changed to %rz co_filename %r remains unchanged)r��co_filename)r)r�normpathr�rP�
startswithr�rMrQrcr�listr�rVr,r�r��replace�tuple)rBr�Znew_filenameZoriginal_filenamer��rr�r\rrrr�Xs&
��
z"ModuleFinder.replace_paths_in_code)NrNN)NNr)r)r)r)N)r<rGrHrCr^rbrcrdrlrmrorprqrrr�r�rfr�r�r�r�r�r�r�r�r�r�r�rrrrrI|s2
	

#
 
1
".rIc
Cs�ddl}z|�tjdd�d�\}}Wn2|jk
rX}zt|�WY�dSd}~XYnXd}d}g}g}|D]Z\}}	|dkr�|d}|dkr�d}|dkr�||	�tj�}|dkr�d}|dkrn|�|	�qn|s�d	}
n|d}
tj	dd�}tj	�
|
�|d<||}|dk�r.td
�|D]}tdt|���qt|||�}
|dd�D]`}|dk�r\d}�qF|�r�|dd�d
k�r�|
�
|dd�ddg�n
|
�
|�n
|
�|��qF|
�|
�|
��|
S)Nrrzdmp:qx:z-dz-mz-pz-qz-xzhello.pyzpath:rR���z.*r�)�getoptrJ�argv�errorrWrjr)�pathseprrr*rXrIrmrlrdr�)r�Zoptsr[r^rMZdomodsZaddpathZexclude�o�aZscriptr�item�mfr]rrr�testpsX


r�rez
[interrupted])N)$r�Zimportlib._bootstrap_externalr�importlib.machineryr�r)r4rJ�types�warningsZopmaprrrrr�r�r3r.r2r0r+r$r&r
rrrr:r;rIr�r<r��KeyboardInterruptrWrrrr�<module>sJ




-w;

__pycache__/token.cpython-38.opt-2.pyc000064400000004626151153537600013502 0ustar00U

e5d@	�0@s�ddddgZdZdZdZdZdZd	Zd
ZdZdZ	d
Z
dZdZdZ
dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZd Zd!Zd"Zd#Z d$Z!d%Z"d&Z#d'Z$d(Z%d)Z&d*Z'd+Z(d,Z)d-Z*d.Z+d/Z,d0Z-d1Z.d2Z/d3Z0d4Z1d5Z2d6Z3d7Z4d8Z5d9Z6d:Z7d;Z8d<Z9d=Z:d>Z;d?Z<d@Z=dAZ>dBZ?dCZ@dDZAdEdF�eB��C�D�ZDe�EeD�F��eee)ee*ee	ee$e/e'ee%e
ee&e4ee5ee0e1e(ee6eee"e-eeeeee#e.e2e3e
ee!e,eee+ee dG�/ZGdHd�ZHdId�ZIdJd�ZJdKS)L�tok_name�
ISTERMINAL�
ISNONTERMINAL�ISEOF����������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�cCs*i|]"\}}t|t�r|�d�s||�qS)�_)�
isinstance�int�
startswith)�.0�name�value�rM�/usr/lib64/python3.8/token.py�
<dictcomp>Js


�rO)/z!=�%z%=�&z&=�(�)�*z**z**=z*=�+z+=�,�-z-=z->�.z...�/z//z//=z/=�:z:=�;�<z<<z<<=z<=�=z==�>z>=z>>z>>=�@z@=�[�]�^z^=�{�|z|=�}�~cCs|tkS�N��	NT_OFFSET��xrMrMrNr�scCs|tkSrgrhrjrMrMrNr�scCs|tkSrg)�	ENDMARKERrjrMrMrNr�sN)K�__all__rl�NAME�NUMBER�STRING�NEWLINE�INDENT�DEDENT�LPAR�RPAR�LSQB�RSQB�COLON�COMMA�SEMI�PLUS�MINUS�STAR�SLASH�VBAR�AMPER�LESS�GREATER�EQUAL�DOT�PERCENT�LBRACE�RBRACE�EQEQUAL�NOTEQUAL�	LESSEQUAL�GREATEREQUAL�TILDE�
CIRCUMFLEX�	LEFTSHIFT�
RIGHTSHIFT�
DOUBLESTAR�	PLUSEQUAL�MINEQUAL�	STAREQUAL�
SLASHEQUAL�PERCENTEQUAL�
AMPEREQUAL�	VBAREQUAL�CIRCUMFLEXEQUAL�LEFTSHIFTEQUAL�RIGHTSHIFTEQUAL�DOUBLESTAREQUAL�DOUBLESLASH�DOUBLESLASHEQUAL�AT�ATEQUAL�RARROW�ELLIPSIS�
COLONEQUAL�OP�AWAIT�ASYNC�TYPE_IGNORE�TYPE_COMMENT�
ERRORTOKEN�COMMENT�NL�ENCODING�N_TOKENSri�globals�itemsr�extend�values�EXACT_TOKEN_TYPESrrrrMrMrMrN�<module>s���2__pycache__/queue.cpython-38.opt-2.pyc000064400000014223151153537600013500 0ustar00U

e5d\,�@s�ddlZddlmZddlmZmZddlmZzddlm	Z	Wne
k
rXdZ	YnXdddd	d
dgZzddlmZWn$e
k
r�Gd
d�de
�ZYnXGdd�de
�ZGdd�d�ZGdd	�d	e�ZGdd
�d
e�ZGdd�d�Ze	dkr�eZ	dS)�N)�deque)�heappush�heappop)�	monotonic)�SimpleQueue�Empty�Full�Queue�
PriorityQueue�	LifoQueuer)rc@seZdZdS)rN��__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/queue.pyrsc@seZdZdS)rNrrrrrrsc@s�eZdZd dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zd!dd�Z	d"dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)#r	rcCsN||_|�|�t��|_t�|j�|_t�|j�|_t�|j�|_d|_	dS�Nr)
�maxsize�_init�	threadingZLock�mutexZ	Condition�	not_empty�not_full�all_tasks_done�unfinished_tasks��selfrrrr�__init__!s

zQueue.__init__c	CsH|j�8|jd}|dkr4|dkr*td��|j��||_W5QRXdS)N�rz!task_done() called too many times)rr�
ValueErrorZ
notify_all)rZ
unfinishedrrr�	task_done8s

zQueue.task_donec	Cs(|j�|jr|j��qW5QRXdS�N)rr�wait�rrrr�joinNs	z
Queue.joinc
Cs&|j�|��W5QR�SQRXdSr!�r�_qsizer#rrr�qsize[szQueue.qsizec
Cs(|j�|��W5QR�SQRXdSr!r%r#rrr�empty`szQueue.emptyc
Cs<|j�,d|jko |��knW5QR�SQRXdSr)rrr&r#rrr�fullnsz
Queue.fullTNc	Cs�|j��|jdkr�|s*|��|jkr�t�nr|dkrN|��|jkr�|j��q2nN|dkr`td��n<t�|}|��|jkr�|t�}|dkr�t�|j�|�qj|�|�|jd7_|j	�
�W5QRXdS)Nr�''timeout' must be a non-negative number�r)rrr&rr"r�time�_putrr�notify)r�item�block�timeout�endtime�	remainingrrr�putys&




z	Queue.putc
Cs�|j��|s|��s�t�nf|dkr8|��s�|j��q"nH|dkrJtd��n6t�|}|��s�|t�}|dkrrt�|j�|�qT|��}|j��|W5QR�SQRXdS)Nrr*r+)	rr&rr"rr,�_getrr.)rr0r1r2r3r/rrr�get�s$



z	Queue.getcCs|j|dd�S�NF)r0�r4�rr/rrr�
put_nowait�szQueue.put_nowaitcCs|jdd�Sr7�r6r#rrr�
get_nowait�szQueue.get_nowaitcCst�|_dSr!)r�queuerrrrr�szQueue._initcCs
t|j�Sr!��lenr=r#rrrr&�szQueue._qsizecCs|j�|�dSr!�r=�appendr9rrrr-�sz
Queue._putcCs
|j��Sr!)r=�popleftr#rrrr5�sz
Queue._get)r)TN)TN)r
rrrr r$r'r(r)r4r6r:r<rr&r-r5rrrrr	s


 

c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
r
cCs
g|_dSr!�r=rrrrr�szPriorityQueue._initcCs
t|j�Sr!r>r#rrrr&�szPriorityQueue._qsizecCst|j|�dSr!)rr=r9rrrr-�szPriorityQueue._putcCs
t|j�Sr!)rr=r#rrrr5�szPriorityQueue._getN�r
rrrr&r-r5rrrrr
�sc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
rcCs
g|_dSr!rCrrrrr�szLifoQueue._initcCs
t|j�Sr!r>r#rrrr&�szLifoQueue._qsizecCs|j�|�dSr!r@r9rrrr-�szLifoQueue._putcCs
|j��Sr!)r=�popr#rrrr5�szLifoQueue._getNrDrrrrr�sc@sHeZdZdd�Zddd�Zddd�Zd	d
�Zdd�Zd
d�Zdd�Z	dS)�_PySimpleQueuecCst�|_t�d�|_dSr)r�_queuerZ	Semaphore�_countr#rrrr	sz_PySimpleQueue.__init__TNcCs|j�|�|j��dSr!)rGrArH�release)rr/r0r1rrrr4
sz_PySimpleQueue.putcCs4|dk	r|dkrtd��|j�||�s*t�|j��S)Nrr*)rrH�acquirerrGrB)rr0r1rrrr6s
z_PySimpleQueue.getcCs|j|dd�Sr7r8r9rrrr:'sz_PySimpleQueue.put_nowaitcCs|jdd�Sr7r;r#rrrr</sz_PySimpleQueue.get_nowaitcCst|j�dkSr�r?rGr#rrrr(7sz_PySimpleQueue.emptycCs
t|j�Sr!rKr#rrrr';sz_PySimpleQueue.qsize)TN)TN)
r
rrrr4r6r:r<r(r'rrrrrF�s

	
rF)r�collectionsr�heapqrrr,rrGr�ImportError�__all__r�	Exceptionrr	r
rrFrrrr�<module>s(
BA__pycache__/struct.cpython-38.opt-1.pyc000064400000000514151153537600013675 0ustar00U

e5d�@s8ddddddddgZdd	lTdd
lmZddlmZdS)
ZcalcsizeZpackZ	pack_intoZunpackZunpack_fromZiter_unpackZStruct�error�)�*)�_clearcache)�__doc__N)�__all__Z_structrr�rr�/usr/lib64/python3.8/struct.py�<module>s�__pycache__/contextlib.cpython-38.opt-1.pyc000064400000047322151153537600014534 0ustar00U

e5d�a�@sjdZddlZddlZddlZddlmZddlmZddlm	Z	dddd	d
ddd
ddddgZ
Gdd
�d
ej�ZGdd�dej�Z
Gdd
�d
e�ZGdd�d�ZGdd�deee�ZGdd�dee
�Zdd�Zdd�ZGdd�de�ZGdd�de�ZGd d�de�ZGd!d�de�ZGd"d�de�ZGd#d$�d$�ZGd%d�dee�ZGd&d�dee
�ZGd'd	�d	e�ZdS)(z4Utilities for with-statement contexts.  See PEP 343.�N)�deque��wraps��
MethodType�asynccontextmanager�contextmanager�closing�nullcontext�AbstractContextManager�AbstractAsyncContextManager�AsyncExitStack�ContextDecorator�	ExitStack�redirect_stdout�redirect_stderr�suppressc@s2eZdZdZdd�Zejdd��Zedd��Z	dS)	rz,An abstract base class for context managers.cCs|S�z0Return `self` upon entering the runtime context.���selfrr�"/usr/lib64/python3.8/contextlib.py�	__enter__sz AbstractContextManager.__enter__cCsdS�z9Raise any exception triggered within the runtime context.Nr�r�exc_type�	exc_value�	tracebackrrr�__exit__szAbstractContextManager.__exit__cCs|tkrt�|dd�StS)Nrr)r�_collections_abc�_check_methods�NotImplemented��cls�Crrr�__subclasshook__sz'AbstractContextManager.__subclasshook__N)
�__name__�
__module__�__qualname__�__doc__r�abc�abstractmethodr�classmethodr%rrrrrs
c@s2eZdZdZdd�Zejdd��Zedd��Z	dS)	rz9An abstract base class for asynchronous context managers.c�s|Srrrrrr�
__aenter__'sz&AbstractAsyncContextManager.__aenter__c�sdSrrrrrr�	__aexit__+sz%AbstractAsyncContextManager.__aexit__cCs|tkrt�|dd�StS)Nr-r.)rrr r!r"rrrr%0s
�z,AbstractAsyncContextManager.__subclasshook__N)
r&r'r(r)r-r*r+r.r,r%rrrrr#s
c@s eZdZdZdd�Zdd�ZdS)rzJA base class or mixin that enables context managers to work as decorators.cCs|S)a6Return a recreated instance of self.

        Allows an otherwise one-shot context manager like
        _GeneratorContextManager to support use as
        a decorator via implicit recreation.

        This is a private interface just for _GeneratorContextManager.
        See issue #11647 for details.
        rrrrr�_recreate_cm;s
zContextDecorator._recreate_cmcst����fdd��}|S)Nc
s*�����||�W5QR�SQRXdS�N)r/��args�kwds��funcrrr�innerHs
z(ContextDecorator.__call__.<locals>.innerr)rr5r6rr4r�__call__GszContextDecorator.__call__N)r&r'r(r)r/r7rrrrr8sc@seZdZdZdd�ZdS)�_GeneratorContextManagerBasezBShared functionality for @contextmanager and @asynccontextmanager.cCsJ|||�|_||||_|_|_t|dd�}|dkr@t|�j}||_dS)Nr))�genr5r2r3�getattr�typer))rr5r2r3�docrrr�__init__Rs
z%_GeneratorContextManagerBase.__init__N)r&r'r(r)r=rrrrr8Osr8c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_GeneratorContextManagerz%Helper for @contextmanager decorator.cCs|�|j|j|j�Sr0)�	__class__r5r2r3rrrrr/fsz%_GeneratorContextManager._recreate_cmcCs<|`|`|`zt|j�WStk
r6td�d�YnXdS�Nzgenerator didn't yield)r2r3r5�nextr9�
StopIteration�RuntimeErrorrrrrrls
z"_GeneratorContextManager.__enter__c
Cs|dkr8zt|j�Wntk
r,YdSXtd��n�|dkrF|�}z|j�|||�Wn�tk
r�}z||k	WY�Sd}~XYnttk
r�}z4||kr�WY�&dS|tkr�|j|kr�WY�
dS�W5d}~XYn$t��d|kr�YdS�YnXtd��dS)NF�generator didn't stop�z#generator didn't stop after throw())rAr9rBrC�throw�	__cause__�sys�exc_info)rr;�valuer�excrrrrus.


z!_GeneratorContextManager.__exit__N)r&r'r(r)r/rrrrrrr>as	r>c@s eZdZdZdd�Zdd�ZdS)�_AsyncGeneratorContextManagerz Helper for @asynccontextmanager.c�s6z|j��IdHWStk
r0td�d�YnXdSr@)r9�	__anext__�StopAsyncIterationrCrrrrr-�sz(_AsyncGeneratorContextManager.__aenter__c
�s&|dkr>z|j��IdHWntk
r2YdSXtd��n�|dkrL|�}z"|j�|||�IdHtd��Wn�tk
r�}z||k	WY�Sd}~XYn�tk
r�}z:||kr�WY�,dSt|ttf�r�|j|kr�WY�
dS�W5d}~XYn0tk
�r }z||k	�r�W5d}~XYnXdS)NrDz$generator didn't stop after athrow()F)	r9rMrNrC�athrow�
isinstancerBrG�
BaseException)r�typrJrrKrrrr.�s.




z'_AsyncGeneratorContextManager.__aexit__N)r&r'r(r)r-r.rrrrrL�srLcst���fdd��}|S)a�@contextmanager decorator.

    Typical usage:

        @contextmanager
        def some_generator(<arguments>):
            <setup>
            try:
                yield <value>
            finally:
                <cleanup>

    This makes this:

        with some_generator(<arguments>) as <variable>:
            <body>

    equivalent to this:

        <setup>
        try:
            <variable> = <value>
            <body>
        finally:
            <cleanup>
    cst�||�Sr0)r>r1�r5rr�helper�szcontextmanager.<locals>.helperr�r5rTrrSrr�scst���fdd��}|S)a�@asynccontextmanager decorator.

    Typical usage:

        @asynccontextmanager
        async def some_async_generator(<arguments>):
            <setup>
            try:
                yield <value>
            finally:
                <cleanup>

    This makes this:

        async with some_async_generator(<arguments>) as <variable>:
            <body>

    equivalent to this:

        <setup>
        try:
            <variable> = <value>
            <body>
        finally:
            <cleanup>
    cst�||�Sr0)rLr1rSrrrTsz#asynccontextmanager.<locals>.helperrrUrrSrr�sc@s(eZdZdZdd�Zdd�Zdd�ZdS)	r	a2Context to automatically close something at the end of a block.

    Code like this:

        with closing(<module>.open(<arguments>)) as f:
            <block>

    is equivalent to this:

        f = <module>.open(<arguments>)
        try:
            <block>
        finally:
            f.close()

    cCs
||_dSr0��thing)rrWrrrr=&szclosing.__init__cCs|jSr0rVrrrrr(szclosing.__enter__cGs|j��dSr0)rW�close)rrIrrrr*szclosing.__exit__N�r&r'r(r)r=rrrrrrr	sc@s(eZdZdZdd�Zdd�Zdd�ZdS)�_RedirectStreamNcCs||_g|_dSr0)�_new_target�_old_targets)r�
new_targetrrrr=2sz_RedirectStream.__init__cCs*|j�tt|j��tt|j|j�|jSr0)r\�appendr:rH�_stream�setattrr[rrrrr7sz_RedirectStream.__enter__cCstt|j|j���dSr0)r`rHr_r\�pop�r�exctype�excinst�exctbrrrr<sz_RedirectStream.__exit__)r&r'r(r_r=rrrrrrrZ.srZc@seZdZdZdZdS)raAContext manager for temporarily redirecting stdout to another file.

        # How to send help() to stderr
        with redirect_stdout(sys.stderr):
            help(dir)

        # How to write help() to a file
        with open('help.txt', 'w') as f:
            with redirect_stdout(f):
                help(pow)
    �stdoutN�r&r'r(r)r_rrrrr@sc@seZdZdZdZdS)rzCContext manager for temporarily redirecting stderr to another file.�stderrNrgrrrrrPsc@s(eZdZdZdd�Zdd�Zdd�ZdS)	ra?Context manager to suppress specified exceptions

    After the exception is suppressed, execution proceeds with the next
    statement following the with statement.

         with suppress(FileNotFoundError):
             os.remove(somefile)
         # Execution still resumes here if the file was already removed
    cGs
||_dSr0)�_exceptions)r�
exceptionsrrrr=aszsuppress.__init__cCsdSr0rrrrrrdszsuppress.__enter__cCs|dk	ot||j�Sr0)�
issubclassrirbrrrrgs
zsuppress.__exit__NrYrrrrrVs
c@sheZdZdZedd��Zedd��Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zde_dd�Z
ddd�ZdS)�_BaseExitStackz.A base class for ExitStack and AsyncExitStack.cCs
t||�Sr0r��cm�cm_exitrrr�_create_exit_wrapperwsz#_BaseExitStack._create_exit_wrappercs���fdd�}|S)Ncs����dSr0r�rrK�tb�r2�callbackr3rr�
_exit_wrapper}sz8_BaseExitStack._create_cb_wrapper.<locals>._exit_wrapperr�rtr2r3rurrsr�_create_cb_wrapper{sz!_BaseExitStack._create_cb_wrappercCst�|_dSr0)r�_exit_callbacksrrrrr=�sz_BaseExitStack.__init__cCst|��}|j|_t�|_|S)z@Preserve the context stack by transferring it to a new instance.)r;rxr)r�	new_stackrrr�pop_all�s
z_BaseExitStack.pop_allcCsBt|�}z
|j}Wntk
r0|�|�YnX|�||�|S)aRegisters a callback with the standard __exit__ method signature.

        Can suppress exceptions the same way __exit__ method can.
        Also accepts any object with an __exit__ method (registering a call
        to the method instead of the object itself).
        )r;r�AttributeError�_push_exit_callback�
_push_cm_exit�r�exit�_cb_type�exit_methodrrr�push�s	
z_BaseExitStack.pushcCs(t|�}|j}|�|�}|�||�|S)z�Enters the supplied context manager.

        If successful, also pushes its __exit__ method as a callback and
        returns the result of the __enter__ method.
        )r;rrr}�rrn�_cm_type�_exit�resultrrr�
enter_context�s

z_BaseExitStack.enter_contextcOs�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d	��|j|f|�|�}||_|�|�|S)
z\Registers an arbitrary callback and arguments.

        Cannot suppress exceptions.
        �zBdescriptor 'callback' of '_BaseExitStack' object needs an argumentrtrN�4Passing 'callback' as keyword argument is deprecated��
stacklevelz8callback expected at least 1 positional argument, got %drE)	�len�	TypeErrorra�warnings�warn�DeprecationWarningrw�__wrapped__r|�r2r3rrtr�rurrrrt�s&

�
�
z_BaseExitStack.callback�#($self, callback, /, *args, **kwds)cCs|�||�}|�|d�dS)z;Helper to correctly register callbacks to __exit__ methods.TN)rpr|�rrnrorurrrr}�sz_BaseExitStack._push_cm_exitTcCs|j�||f�dSr0)rxr^)rrt�is_syncrrrr|�sz"_BaseExitStack._push_exit_callbackN)T)r&r'r(r)�staticmethodrprwr=rzr�r�rt�__text_signature__r}r|rrrrrlts

rlc@s(eZdZdZdd�Zdd�Zdd�ZdS)	ra�Context manager for dynamic management of a stack of exit callbacks.

    For example:
        with ExitStack() as stack:
            files = [stack.enter_context(open(fname)) for fname in filenames]
            # All opened files will automatically be closed at the end of
            # the with statement, even if attempts to open files later
            # in the list raise an exception.
    cCs|Sr0rrrrrr�szExitStack.__enter__c
s�|ddk	}t��d��fdd�}d}d}|jr�|j��\}}z||�rVd}d}d}Wq,t��}||d|d�d}|}Yq,Xq,|r�z|dj}	|d�Wn tk
r�|	|d_�YnX|o�|S)NrrEcs4|j}||krdS|dks*|�kr$q*|}q||_dSr0��__context__��new_exc�old_exc�exc_context��	frame_excrr�_fix_exception_context�sz2ExitStack.__exit__.<locals>._fix_exception_contextFT�NNN�rHrIrxrar�rQ)
r�exc_details�received_excr��suppressed_exc�
pending_raiser��cb�new_exc_details�	fixed_ctxrr�rr�s2

zExitStack.__exit__cCs|�ddd�dS�z%Immediately unwind the context stack.N)rrrrrrXszExitStack.closeN)r&r'r(r)rrrXrrrrr�s
1c@sfeZdZdZedd��Zedd��Zdd�Zdd	�Zd
d�Z	de	_
d
d�Zdd�Zdd�Z
dd�ZdS)r
a�Async context manager for dynamic management of a stack of exit
    callbacks.

    For example:
        async with AsyncExitStack() as stack:
            connections = [await stack.enter_async_context(get_connection())
                for i in range(5)]
            # All opened connections will automatically be released at the
            # end of the async with statement, even if attempts to open a
            # connection later in the list raise an exception.
    cCs
t||�Sr0rrmrrr�_create_async_exit_wrapper&sz)AsyncExitStack._create_async_exit_wrappercs���fdd�}|S)Nc�s����IdHdSr0rrqrsrrru,sz>AsyncExitStack._create_async_cb_wrapper.<locals>._exit_wrapperrrvrrsr�_create_async_cb_wrapper*sz'AsyncExitStack._create_async_cb_wrapperc�s.t|�}|j}|�|�IdH}|�||�|S)z�Enters the supplied async context manager.

        If successful, also pushes its __aexit__ method as a callback and
        returns the result of the __aenter__ method.
        N)r;r.r-�_push_async_cm_exitr�rrr�enter_async_context0s
z"AsyncExitStack.enter_async_contextcCsDt|�}z
|j}Wn tk
r2|�|d�YnX|�||�|S)a#Registers a coroutine function with the standard __aexit__ method
        signature.

        Can suppress exceptions the same way __aexit__ method can.
        Also accepts any object with an __aexit__ method (registering a call
        to the method instead of the object itself).
        F)r;r.r{r|r�r~rrr�push_async_exit<s
zAsyncExitStack.push_async_exitcOs�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d	��|j|f|�|�}||_|�|d
�|S)zfRegisters an arbitrary coroutine function and arguments.

        Cannot suppress exceptions.
        r�zMdescriptor 'push_async_callback' of 'AsyncExitStack' object needs an argumentrtrNr�r�zCpush_async_callback expected at least 1 positional argument, got %drEF)	r�r�rar�r�r�r�r�r|r�rrr�push_async_callbackNs&

�
�z"AsyncExitStack.push_async_callbackr�c�s|�ddd�IdHdSr�)r.rrrr�aclosekszAsyncExitStack.aclosecCs|�||�}|�|d�dS)zLHelper to correctly register coroutine function to __aexit__
        method.FN)r�r|r�rrrr�osz"AsyncExitStack._push_async_cm_exitc�s|Sr0rrrrrr-uszAsyncExitStack.__aenter__c�s�|ddk	}t��d��fdd�}d}d}|jr�|j��\}}z0|rP||�}n||�IdH}|rnd}d}d}Wq,t��}	||	d|d�d}|	}Yq,Xq,|r�z|dj}
|d�Wn tk
r�|
|d_�YnX|o�|S)NrrEcs4|j}||krdS|dks*|�kr$q*|}q||_dSr0r�r�r�rrr�~sz8AsyncExitStack.__aexit__.<locals>._fix_exception_contextFTr�r�)rr�r�r�r�r�r�r��cb_suppressr�r�rr�rr.xs8


zAsyncExitStack.__aexit__N)r&r'r(r)r�r�r�r�r�r�r�r�r�r-r.rrrrr
s

c@s*eZdZdZd	dd�Zdd�Zdd�ZdS)
r
aOContext manager that does no additional processing.

    Used as a stand-in for a normal context manager, when a particular
    block of code is only sometimes used with a normal context manager:

    cm = optional_cm if condition else nullcontext()
    with cm:
        # Perform operation, using optional_cm if condition is True
    NcCs
||_dSr0��enter_result)rr�rrrr=�sznullcontext.__init__cCs|jSr0r�rrrrr�sznullcontext.__enter__cGsdSr0r)r�excinforrrr�sznullcontext.__exit__)NrYrrrrr
�s

)r)r*rHr�collectionsr�	functoolsr�typesr�__all__�ABCrr�objectrr8r>rLrrr	rZrrrrlrr
r
rrrr�<module>sN��D�.!!`E__pycache__/compileall.cpython-38.pyc000064400000022304151153537600013534 0ustar00U

e5dn5�	@s�dZddlZddlZddlZddlZddlZddlmZdddgZ	ddd	�Z
dd
d�Zdd�Zddd�Z
ddd�Zdd�Zedkr�ee��Ze�e�dS)a�Module/script to byte-compile all .py files to .pyc files.

When called as a script with arguments, this compiles the directories
given as arguments recursively; the -l option prevents it from
recursing into directories.

Without arguments, if compiles all modules on sys.path, without
recursing into subdirectories.  (Even though it should do so for
packages -- for now, you'll have to deal with packages separately.)

See module py_compile for details of the actual byte-compilation.
�N)�partial�compile_dir�compile_file�compile_path�
ccs|dkrt|tj�rt�|�}|s0td�|��zt�|�}Wn.tk
rl|dkrdtd�|��g}YnX|��|D]�}|dkr�qztj	�
||�}|dk	r�tj	�
||�}nd}tj	�|�s�||fVqz|dkrz|tjkrz|tj
krztj	�|�rztj	�|�szt|||d|d�EdHqzdS)N�zListing {!r}...zCan't list {!r}�__pycache__r�)�ddir�	maxlevels�quiet)�
isinstance�os�PathLike�fspath�print�format�listdir�OSError�sort�path�join�isdir�curdir�pardir�islink�	_walk_dir)�dirr
rr�names�name�fullname�dfile�r"�"/usr/lib64/python3.8/compileall.pyrs:


�
��rF���r	c
Cs�d}
|dkrtd��|dkrFzddlm}
Wntk
rDd}YnXt||||d�}d}|dkr�|
dk	r�|ppd}|
|d��0}
|
�tt||||||	d	�|�}t|dd
�}W5QRXn(|D]"\}}t	||||||||	�s�d}q�|S)aByte-compile all modules in the given directory tree.

    Arguments (only dir is required):

    dir:       the directory to byte-compile
    maxlevels: maximum recursion level (default 10)
    ddir:      the directory that will be prepended to the path to the
               file as it is compiled into each byte-code file.
    force:     if True, force compilation, even if timestamps are up-to-date
    quiet:     full output with False or 0, errors only with 1,
               no output with 2
    legacy:    if True, produce legacy pyc paths instead of PEP 3147 paths
    optimize:  optimization level or -1 for level of the interpreter
    workers:   maximum number of parallel workers
    invalidation_mode: how the up-to-dateness of the pyc will be checked
    Nrz%workers must be greater or equal to 0r	)�ProcessPoolExecutor)rrr
T)Zmax_workers)�force�rxr�legacy�optimize�invalidation_mode)�defaultF)
�
ValueErrorZconcurrent.futuresr%�ImportErrorr�mapr�_compile_file_tuple�minr)rrr
r&r'rr(r)�workersr*r%Zfiles_and_ddirs�successZexecutorZresults�filer!r"r"r#r2sF
����cKs|\}}t||f|�S)z-Needs to be toplevel for ProcessPoolExecutor.)r)Zfile_and_dfile�kwargsr3r!r"r"r#r/esr/c
Cs�d}|dkr"t|tj�r"t�|�}tj�|�}	|dk	rFtj�||	�}
nd}
|dk	rd|�|�}|rd|Stj�|��r�|r�|d}nB|dkr�|dkr�|nd}
t	j
j||
d�}nt	j
�|�}tj�|�}|	dd	�|	d	d�}}|d
k�r�|�s\zXt
t�|�j�}t�dt	j
jd|�}t|d��}|�d
�}W5QRX||k�rB|WSWntk
�rZYnX|�sptd�|��ztj|||
d||d�}W�ntjk
�r}zjd}|dk�r�|WY�RS|�r�td�|��ntddd�|jjtjjdd�}|� tjj�}t|�W5d}~XYn�t!t"tfk
�r�}zRd}|dk�rJ|WY�:S|�r`td�|��ntddd�t|j#j$d|�W5d}~XYnX|dk�r�d}|S)aTByte-compile one file.

    Arguments (only fullname is required):

    fullname:  the file to byte-compile
    ddir:      if given, the directory name compiled in to the
               byte-code file.
    force:     if True, force compilation, even if timestamps are up-to-date
    quiet:     full output with False or 0, errors only with 1,
               no output with 2
    legacy:    if True, produce legacy pyc paths instead of PEP 3147 paths
    optimize:  optimization level or -1 for level of the interpreter
    invalidation_mode: how the up-to-dateness of the pyc will be checked
    TrN�crr	�)�optimization���z.pyz<4sll�rb�zCompiling {!r}...)r)r*Fz*** Error compiling {!r}...z*** )�end�backslashreplace)�errors�:)%r
rrrr�basenamer�search�isfile�	importlib�util�cache_from_source�dirname�int�stat�st_mtime�structZpack�MAGIC_NUMBER�open�readrrr�
py_compile�compile�PyCompileError�msg�encode�sys�stdout�encoding�decode�SyntaxError�UnicodeError�	__class__�__name__)r r
r&r'rr(r)r*r2rr!Zmo�cfile�optZ	cache_dir�head�tail�mtimeZexpectZchandleZactual�ok�errrP�er"r"r#rjs�


�
�

�
�
$
c	CsTd}tjD]D}|r|tjkr2|r2|dkrNtd�q
|oLt||d|||||d�}q
|S)a�Byte-compile all module on sys.path.

    Arguments (all optional):

    skip_curdir: if true, skip current directory (default True)
    maxlevels:   max recursion level (default 0)
    force: as for compile_dir() (default False)
    quiet: as for compile_dir() (default 0)
    legacy: as for compile_dir() (default False)
    optimize: as for compile_dir() (default -1)
    invalidation_mode: as for compiler_dir()
    TrzSkipping current directoryN)rr(r)r*)rRrrrrr)	Zskip_curdirrr&rr(r)r*r2rr"r"r#r�s 

�
c
Cs�ddl}|jdd�}|jdddddd	d
�|jdtdd
d�|jddddd�|jdddddd�|jddddd�|jdddddd �|jd!d"d#dd$d �|jd%d&d'd(d)�|jd*d+d,d-d.�|jd/d0d1td2d3�d4d5�tjD�}|jd6t|�d7d8�|��}|j}|j	�r$ddl
}|�|j	�|_	|jdk	�r8|j}n|j
}|j�r�zF|jd9k�rZtjnt|j�� }|D]}|�|����qjW5QRXWn4tk
�r�|jd:k�r�td;�|j��Yd<SX|j�r�|j�d9d=���}	tj|	}
nd}
d>}z�|�rl|D]h}tj�|��r6t||j|j |j	|j|j!|
d?��sbd<}n,t"|||j|j |j	|j|j!|j#|
d@�	�s�d<}�q�|WSt$|j!|j |j|
dA�WSWn,t%k
�r�|jd:k�r�tdB�Yd<SXd>S)CzScript main program.rNz1Utilities to support installing Python libraries.)Zdescriptionz-lZstore_constrrz!don't recurse into subdirectories)�actionZconstr+�dest�helpz-r�	recursionzhcontrol the maximum recursion level. if `-l` and `-r` options are specified, then `-r` takes precedence.)�typercrdz-f�
store_truer&z/force rebuild even if timestamps are up to date)rbrcrdz-q�countrzIoutput only error messages; -qq will suppress the error messages as well.)rbrcr+rdz-br(z0use legacy (pre-PEP3147) compiled file locationsz-dZDESTDIRr
z�directory to prepend to file paths for use in compile-time tracebacks and in runtime tracebacks in cases where the source file is unavailable)�metavarrcr+rdz-xZREGEXPr'zskip files matching the regular expression; the regexp is searched for in the full path of each file considered for compilationz-iZFILE�flistzzadd all the files and directories listed in FILE to the list considered for compilation; if "-", names are read from stdin)rircrd�compile_destzFILE|DIR�*zrzero or more file and directory names to compile; if no arguments given, defaults to the equivalent of -l sys.path)ri�nargsrdz-jz	--workersr	zRun compileall concurrently)r+rfrdcSsg|]}|j���dd��qS)�_�-)r�lower�replace)�.0�moder"r"r#�
<listcomp>	s�zmain.<locals>.<listcomp>z--invalidation-modez�set .pyc invalidation mode; defaults to "checked-hash" if the SOURCE_DATE_EPOCH environment variable is set, and "timestamp" otherwise.)�choicesrdrorzError reading file list {}FrnT)r*)r1r*)r(r&rr*z
[interrupted])&�argparse�ArgumentParser�add_argumentrFrM�PycInvalidationMode�sorted�
parse_argsrkr'�rerNrerrjrR�stdinrK�append�striprrrrr*rq�upperrrrArr
r&r(rr1r�KeyboardInterrupt)
rv�parserZinvalidation_modes�argsZ
compile_destsr|r�f�lineZivl_moder*r2rcr"r"r#�main�s��
�
�
��
���
�
�
��� �
�
�r��__main__)Nrr)	rNFNrFr$r	N)NFNrFr$N)r	rFrFr$N)�__doc__rrR�importlib.utilrBrMrI�	functoolsr�__all__rrr/rrr�rYrFZexit_status�exitr"r"r"r#�<module>s<

�
3�
V�
"i__pycache__/this.cpython-38.opt-2.pyc000064400000002357151153537600013330 0ustar00U

e5d��@s\dZiZdD]2Zed�D]$Zeedde�eeee�<qqed�dd�eD���dS)aXGur Mra bs Clguba, ol Gvz Crgref

Ornhgvshy vf orggre guna htyl.
Rkcyvpvg vf orggre guna vzcyvpvg.
Fvzcyr vf orggre guna pbzcyrk.
Pbzcyrk vf orggre guna pbzcyvpngrq.
Syng vf orggre guna arfgrq.
Fcnefr vf orggre guna qrafr.
Ernqnovyvgl pbhagf.
Fcrpvny pnfrf nera'g fcrpvny rabhtu gb oernx gur ehyrf.
Nygubhtu cenpgvpnyvgl orngf chevgl.
Reebef fubhyq arire cnff fvyragyl.
Hayrff rkcyvpvgyl fvyraprq.
Va gur snpr bs nzovthvgl, ershfr gur grzcgngvba gb thrff.
Gurer fubhyq or bar-- naq cersrenoyl bayl bar --boivbhf jnl gb qb vg.
Nygubhtu gung jnl znl abg or boivbhf ng svefg hayrff lbh'er Qhgpu.
Abj vf orggre guna arire.
Nygubhtu arire vf bsgra orggre guna *evtug* abj.
Vs gur vzcyrzragngvba vf uneq gb rkcynva, vg'f n onq vqrn.
Vs gur vzcyrzragngvba vf rnfl gb rkcynva, vg znl or n tbbq vqrn.
Anzrfcnprf ner bar ubaxvat terng vqrn -- yrg'f qb zber bs gubfr!)�A�a��
�cCsg|]}t�||��qS�)�d�get)�.0�crr�/usr/lib64/python3.8/this.py�
<listcomp>srN)�srr
�range�i�chr�print�joinrrrr�<module>s
$__pycache__/dis.cpython-38.pyc000064400000036702151153537600012201 0ustar00U

e5dZP�@sdZddlZddlZddlZddlZddlTddlmZddddd	d
ddd
ddgeZ[ejej	ej
eee
fZedZdedfedfedffZedZdZdd�ZdVddd�dd�ZdWdd�dd�Zdddd d!d"d#d$d%d&d'�
Zd(d)�Zd*d+�Zd,d�Zd-d.�Zdd�d/d�Ze� d0d1�Z!d2e!j"_d3e!j_d4e!j#_d5e!j$_d6e!j%_d7e!j&_d8e!j'_d9e!j(_d:Z)d;Z*Gd<d�de!�Z+dd=�d>d
�Z,d?d@�Z-dAdB�Z.dXdCdD�Z/dYdd�dFd�Z0ddd�dGdH�Z1dZdddI�dJdK�Z2dLdM�Z3e0Z4dNdO�Z5dPd�Z6dQd
�Z7GdRd�d�Z8dSdT�Z9e:dUk�re9�dS)[z0Disassembler of Python byte code into mnemonics.�N)�*)�__all__�	code_info�dis�disassemble�distb�disco�findlinestarts�
findlabels�	show_code�get_instructions�Instruction�Bytecode�FORMAT_VALUE)N��str�repr�ascii�
MAKE_FUNCTION)�defaultsZ
kwdefaultsZannotationsZclosurecCs6zt||d�}Wn tk
r0t||d�}YnX|S)z�Attempts to compile the given source, first as an expression and
       then as a statement if the first approach fails.

       Utility function to accept strings in functions that otherwise
       expect code objects
    �eval�exec)�compile�SyntaxError)�source�name�c�r�/usr/lib64/python3.8/dis.py�_try_compiles
r��file�depthcCsh|dkrt|d�dSt|d�r&|j}t|d�r8|j}n4t|d�rJ|j}n"t|d�r\|j}nt|d�rl|j}t|d�r�t|j�	��}|D]p\}}t
|t�r�td	||d�zt
|||d
�Wn0tk
r�}ztd||d�W5d}~XYnXt|d�q�nht|d��rt|||d
�nLt
|ttf��r6t||d�n.t
|t��rRt|||d
�ntd
t|�j��dS)a0Disassemble classes, methods, functions, and other compiled objects.

    With no argument, disassemble the last traceback.

    Compiled objects currently include generator objects, async generator
    objects, and coroutine objects, all of which store their code object
    in a special attribute.
    N�r!�__func__�__code__�gi_code�ag_code�cr_code�__dict__zDisassembly of %s:r zSorry:�co_code�(don't know how to disassemble %s objects)r�hasattrr$r%r&r'r(�sortedr)�items�
isinstance�
_have_code�printr�	TypeError�_disassemble_recursive�bytes�	bytearray�_disassemble_bytesr�_disassemble_str�type�__name__)�xr!r"r.rZx1�msgrrrr+s@	







 �r#cCsX|dkr@z
tj}Wntk
r0td�d�YnX|jr@|j}q2t|jj|j|d�dS)z2Disassemble a traceback (default: last traceback).Nz no last traceback to disassembler#)	�sys�last_traceback�AttributeError�RuntimeError�tb_nextr�tb_frame�f_code�tb_lasti)�tbr!rrrrXs
Z	OPTIMIZEDZ	NEWLOCALSZVARARGSZVARKEYWORDSZNESTEDZ	GENERATORZNOFREEZ	COROUTINEZITERABLE_COROUTINEZASYNC_GENERATOR)
������ �@��icCs`g}td�D]:}d|>}||@r|�t�|t|���||N}|sqVq|�t|��d�|�S)z+Return pretty representation of code flags.rJrE�, )�range�append�COMPILER_FLAG_NAMES�get�hex�join)�flags�names�i�flagrrr�pretty_flagsrsrYcCs�t|d�r|j}t|d�r"|j}n4t|d�r4|j}n"t|d�rF|j}nt|d�rV|j}t|t�rjt|d�}t|d�rx|St	dt
|�j��d	S)
zDHelper to handle methods, compiled or raw code objects, and strings.r$r%r&r'r(z
<disassembly>r*r+N)r,r$r%r&r'r(r/rrr2r8r9�r:rrr�_get_code_object�s"







�r[cCstt|��S)z1Formatted details of methods, functions, or code.)�_format_code_infor[rZrrrr�scCs�g}|�d|j�|�d|j�|�d|j�|�d|j�|�d|j�|�d|j�|�d|j�|�dt|j	��|j
r�|�d	�t|j
�D]}|�d
|�q�|jr�|�d�t|j�D]}|�d|�q�|j
�r|�d
�t|j
�D]}|�d|��q|j�rH|�d�t|j�D]}|�d|��q2|j�rz|�d�t|j�D]}|�d|��qdd�|�S)NzName:              %szFilename:          %szArgument count:    %szPositional-only arguments: %szKw-only arguments: %szNumber of locals:  %szStack size:        %szFlags:             %sz
Constants:z%4d: %rzNames:z%4d: %szVariable names:zFree variables:zCell variables:�
)rP�co_name�co_filename�co_argcount�co_posonlyargcount�co_kwonlyargcount�
co_nlocals�co_stacksizerY�co_flags�	co_consts�	enumerate�co_names�co_varnames�co_freevars�co_cellvarsrT)�co�linesZi_cZi_nrrrr\�s<




r\cCstt|�|d�dS)z}Print details of methods, functions, or code to *file*.

    If *file* is not provided, the output is printed on stdout.
    r#N)r1r)rlr!rrrr�s�_InstructionzBopname opcode arg argval argrepr offset starts_line is_jump_targetz!Human readable name for operationzNumeric code for operationz6Numeric argument to operation (if any), otherwise Nonez4Resolved arg value (if known), otherwise same as argz0Human readable description of operation argumentz1Start index of operation within bytecode sequencez4Line started by this opcode (if any), otherwise Nonez1True if other code jumps to here, otherwise False��c@seZdZdZddd�ZdS)	r
aKDetails for a bytecode operation

       Defined fields:
         opname - human readable name for operation
         opcode - numeric code for operation
         arg - numeric argument to operation (if any), otherwise None
         argval - resolved arg value (if known), otherwise same as arg
         argrepr - human readable description of operation argument
         offset - start index of operation within bytecode sequence
         starts_line - line started by this opcode (if any), otherwise None
         is_jump_target - True if other code jumps to here, otherwise False
    �FrGcCs�g}|r:|jdk	r,d|}|�||j�n|�d|�|rJ|�d�n
|�d�|jrf|�d�n
|�d�|�t|j��|��|�|j�t��|j	dk	r�|�t|j	��t
��|jr�|�d|jd	�d�|��
�S)
a%Format instruction details for inclusion in disassembly output

        *lineno_width* sets the width of the line number field (0 omits it)
        *mark_as_current* inserts a '-->' marker arrow as part of the line
        *offset_width* sets the width of the instruction offset field
        Nz%%%dd� z-->z   z>>z  �(�))�starts_linerP�is_jump_targetr�offset�rjust�opname�ljust�
_OPNAME_WIDTH�arg�_OPARG_WIDTH�argreprrT�rstrip)�self�lineno_widthZmark_as_current�offset_widthZfieldsZ
lineno_fmtrrr�_disassemble�s&



zInstruction._disassembleN)rqFrG)r9�
__module__�__qualname__�__doc__r�rrrrr
�s
)�
first_linecCsTt|�}|j|j}tt|��}|dk	r4||j}nd}t|j|j|j	|j
|||�S)a�Iterator for the opcodes in methods, functions or code

    Generates a series of Instruction named tuples giving the details of
    each operations in the supplied code.

    If *first_line* is not None, it indicates the line number that should
    be reported for the first source line in the disassembled code.
    Otherwise, the source line information (if any) is taken directly from
    the disassembled code object.
    Nr)r[rkrj�dictr	�co_firstlineno�_get_instructions_bytesr*rirhrf)r:r�rl�
cell_names�
linestarts�line_offsetrrrrs�cCs |}|dk	r||}|t|�fS)z�Helper to get optional details about const references

       Returns the dereferenced constant and its repr if the constant
       list is defined.
       Otherwise returns the constant index and its repr().
    N�r)Zconst_indexZ
const_list�argvalrrr�_get_const_infosr�cCs*|}|dk	r||}|}nt|�}||fS)z�Helper to get optional details about named references

       Returns the dereferenced name as both value and repr if the name
       list is defined.
       Otherwise returns the name index and its repr().
    Nr�)Z
name_indexZ	name_listr�r~rrr�_get_name_info'sr�c
#s�t|�}d}t|�D�]r\}	}
�|dk	rD|�|	d�}|dk	rD||7}|	|k}d}d}
�dk	�rl�}|
tkrzt�|�\}}
n�|
tkr�t�|�\}}
n�|
tkr�|	d�}dt|�}
n�|
t	kr�t�|�\}}
n�|
t
kr�t�}|}
n�|
tkr�t�|�\}}
nr|
t
k�rFt�d@\}}
|t�d@�f}|d�rl|
�r<|
d7}
|
d	7}
n&|
tk�rld��fd
d�tt�D��}
tt|
|
�||
|	||�VqdS)a&Iterate over the instructions in a bytecode string.

    Generates a sequence of Instruction namedtuples giving the details of each
    opcode.  Additional information about the code's runtime environment
    (e.g. variable names, constants) can be specified using optional
    arguments.

    NrrFzto rqrGrErNzwith formatc3s"|]\}}�d|>@r|VqdS)rENr)�.0rW�s�r|rr�	<genexpr>gs�z*_get_instructions_bytes.<locals>.<genexpr>)r
�_unpack_opargsrRZhasconstr�Zhasnamer��hasjrelrZhaslocalZ
hascompareZcmp_opZhasfreer�FORMAT_VALUE_CONVERTERS�boolrrTrg�MAKE_FUNCTION_FLAGSr
ry)�code�varnamesrV�	constants�cellsr�r��labelsrurw�oprvr�r~rr�rr�7sV






�r����c
Cs<|j|j}tt|��}t|j||j|j|j|||d�dS)zDisassemble a code object.r#N)	rkrjr�r	r6r*rirhrf)rl�lastir!r�r�rrrrms�cCspt||d�|dks|dkrl|dk	r,|d}|jD]8}t|d�r2t|d�td|f|d�t|||d�q2dS)Nr#rrEr*zDisassembly of %r:r )rrfr,r1r3)rlr!r"r:rrrr3ts


r3)r!r�c	Cs�|dk	}	|	r8t|���|}
|
dkr2tt|
��}q<d}nd}t|�d}|dkr^tt|��}
nd}
t|||||||d�D]J}|	o�|jdk	o�|jdk}|r�t|d�|j|k}t|�|||
�|d�qxdS)	Ni�rqrrFi'rG�r�r#)	�max�values�lenrr�rurwr1r�)r�r�r�rVr�r�r�r!r�Zshow_linenoZ	maxlinenor�Z	maxoffsetr�ZinstrZnew_source_lineZis_current_instrrrrr6s8�
��

�r6cKstt|d�f|�dS)z<Compile the source string, then disassemble the code object.z<dis>N)r3r)r�kwargsrrrr7�sr7ccsdd}tdt|�d�D]J}||}|tkrN||d|B}|tkrH|d>nd}nd}|||fVqdS)NrrFrErH)rOr�Z
HAVE_ARGUMENTZEXTENDED_ARG)r�Zextended_argrWr�r|rrrr��sr�cCs\g}t|�D]J\}}}|dk	r|tkr4|d|}n|tkr|}nq||kr|�|�q|S)z`Detect all offsets in a byte code which are jump targets.

    Return the list of offsets.

    NrF)r�r�ZhasjabsrP)r�r�rwr�r|Zlabelrrrr
�sc	cs�|jddd�}|jddd�}t|j�}d}|j}d}t||�D]P\}}|rz||krd||fV|}||7}||krzdS|dkr�|d8}||7}qB||kr�||fVdS)z�Find the offsets in a byte code which are start of lines in the source.

    Generate pairs (offset, lineno) as described in Python/compile.c.

    rNrFrErLrM)�	co_lnotabr�r*r��zip)	r�Zbyte_incrementsZline_incrementsZbytecode_lenZ
lastlineno�linenoZaddrZ	byte_incrZ	line_incrrrrr	�s&


c@sLeZdZdZddd�dd�Zdd�Zdd	�Zed
d��Zdd
�Z	dd�Z
dS)raThe bytecode operations of a piece of code

    Instantiate this with a function, method, other compiled object, string of
    code, or a code object (as returned by compile()).

    Iterating over this yields the bytecode operations as Instruction instances.
    N)r��current_offsetcCsdt|�|_}|dkr&|j|_d|_n||_||j|_|j|j|_tt	|��|_
||_||_dS)Nr)
r[�codeobjr�r��_line_offsetrkrj�_cell_namesr�r	�_linestarts�_original_objectr�)r�r:r�r�rlrrr�__init__�szBytecode.__init__c	Cs*|j}t|j|j|j|j|j|j|jd�S)Nr�)	r�r�r*rirhrfr�r�r�)r�rlrrr�__iter__�s�zBytecode.__iter__cCsd�|jj|j�S)Nz{}({!r}))�format�	__class__r9r��r�rrr�__repr__�s
�zBytecode.__repr__cCs |jr|j}q||jj|jd�S)z/ Construct a Bytecode from the given traceback )r�)r@rArBrC)�clsrDrrr�from_traceback�szBytecode.from_tracebackcCs
t|j�S)z3Return formatted information about the code object.)r\r�r�rrr�infosz
Bytecode.infocCsl|j}|jdk	r|j}nd}t���>}t|j|j|j|j|j	|j
|j||d�	|��W5QR�SQRXdS)z3Return a formatted view of the bytecode operations.Nr�)r�rVr�r�r�r�r!r�)
r�r��io�StringIOr6r*rirhrfr�r�r��getvalue)r�rlrw�outputrrrr
s


�zBytecode.dis)r9r�r�r�r�r�r��classmethodr�r�rrrrrr�s

c	Csfddl}|��}|jd|�d�ddd�|��}|j�}|��}W5QRXt||jjd�}t	|�dS)	z*Simple test program to disassemble a file.rN�infile�rb�?�-)r8�nargs�defaultr)
�argparse�ArgumentParser�add_argumentZFileType�
parse_argsr��readrrr)r��parser�argsr�rr�rrr�_testsr��__main__)N)N)NNNNNr)r�)r�NNNNN);r�r<�types�collectionsr�ZopcoderZ_opcodes_all�
MethodType�FunctionType�CodeTyper��staticmethodr8r0Zopmaprrrrr�rr�rrrrQrYr[rr\r�
namedtuplernryr|r�r~rwrurvr{r}r
rr�r�r�rr3r6r7rr�r
r	rr�r9rrrr�<module>s�
����
-�
 �4�
6��=
__pycache__/dataclasses.cpython-38.pyc000064400000056147151153537600013716 0ustar00U

e5d5��@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZdddddddd	d
ddd
gZ	Gdd�de
�ZGdd�d�Ze�Z
Gdd�d�Ze�Ze�i�ZGdd�d�Zed�Zed�Zed�ZdZdZdZe�d�ZGdd�de�ZGdd�ded�ZGd d�d�ZGd!d"�d"�Zeed#d#dd#dd$�d%d�Z d&d'�Z!d(d)�Z"dded*�d+d,�Z#d-d.�Z$d/d0�Z%d1d2�Z&d3d4�Z'd5d6�Z(d7d8�Z)d9d:�Z*d;d<�Z+d=d>�Z,d?d@�Z-dAdB�Z.dCdD�Z/dEdF�Z0dGdH�Z1dIdJ�Z2dKdL�Z3dddde1de2de2e3e2e3e2e3e2e3dM�Z4dNdO�Z5ddd#d#d#dPdPdPdQ�dRd�Z6dSd�Z7dTdU�Z8dVd
�Z9e:dW�dXd	�Z;dYdZ�Z<e=d[�d\d
�Z>d]d^�Z?d_dd#d#d#dPdPdPd`�dad�Z@dbd�ZAdceA_BdS)e�N�	dataclass�field�Field�FrozenInstanceError�InitVar�MISSING�fields�asdict�astuple�make_dataclass�replace�is_dataclassc@seZdZdS)rN��__name__�
__module__�__qualname__�rr�#/usr/lib64/python3.8/dataclasses.pyr�sc@seZdZdd�ZdS)�_HAS_DEFAULT_FACTORY_CLASScCsdS)Nz	<factory>r��selfrrr�__repr__�sz#_HAS_DEFAULT_FACTORY_CLASS.__repr__N)rrrrrrrrr�src@seZdZdS)�
_MISSING_TYPENrrrrrr�src@seZdZdd�Zdd�ZdS)�_FIELD_BASEcCs
||_dS�N��name�rrrrr�__init__�sz_FIELD_BASE.__init__cCs|jSrrrrrrr�sz_FIELD_BASE.__repr__N)rrrrrrrrrr�sr�_FIELD�_FIELD_CLASSVAR�_FIELD_INITVARZ__dataclass_fields__Z__dataclass_params__Z
__post_init__z^(?:\s*(\w+)\s*\.)?\s*(\w+)c@seZdZdd�ZdS)�_InitVarMetacCst|�Sr)r)rZparamsrrr�__getitem__�sz_InitVarMeta.__getitem__N)rrrr#rrrrr"�sr"c@s eZdZdZdd�Zdd�ZdS)r��typecCs
||_dSrr$)rr%rrrr�szInitVar.__init__cCs,t|jt�r|jj}n
t|j�}d|�d�S)Nzdataclasses.InitVar[�])�
isinstancer%r�repr)rZ	type_namerrrr�s

zInitVar.__repr__N�rrr�	__slots__rrrrrrr�s)�	metaclassc@s(eZdZdZdd�Zdd�Zdd�ZdS)	r)
rr%�default�default_factoryr(�hash�init�compare�metadata�_field_typecCsRd|_d|_||_||_||_||_||_||_|dkr<tnt	�
|�|_d|_dSr)
rr%r,r-r/r(r.r0�_EMPTY_METADATA�types�MappingProxyTyper1r2)rr,r-r/r(r.r0r1rrrr�s��zField.__init__cCsVd|j�d|j�d|j�d|j�d|j�d|j�d|j�d|j�d	|j�d
|j	�d�S)NzField(name=z,type=z	,default=z,default_factory=z,init=�,repr=z,hash=z	,compare=z
,metadata=z
,_field_type=�))
rr%r,r-r/r(r.r0r1r2rrrrrszField.__repr__cCs(tt|j�dd�}|r$||j||�dS)N�__set_name__)�getattrr%r,)r�ownerr�funcrrrr8szField.__set_name__N)rrrr*rrr8rrrrr�sc@s eZdZdZdd�Zdd�ZdS)�_DataclassParams�r/r(�eq�order�unsafe_hash�frozencCs(||_||_||_||_||_||_dSrr=)rr/r(r>r?r@rArrrr*sz_DataclassParams.__init__c
Cs6d|j�d|j�d|j�d|j�d|j�d|j�d�
S)Nz_DataclassParams(init=r6z,eq=z,order=z
,unsafe_hash=z,frozen=r7r=rrrrr2sz_DataclassParams.__repr__Nr)rrrrr<!sr<T�r,r-r/r(r.r0r1cCs,|tk	r|tk	rtd��t|||||||�S)a�Return an object to identify dataclass fields.

    default is the default value of the field.  default_factory is a
    0-argument function called to initialize a field's value.  If init
    is True, the field will be a parameter to the class's __init__()
    function.  If repr is True, the field will be included in the
    object's repr().  If hash is True, the field will be included in
    the object's hash().  If compare is True, the field will be used
    in comparison functions.  metadata, if specified, must be a
    mapping which is stored but not otherwise examined by dataclass.

    It is an error to specify both default and default_factory.
    z/cannot specify both default and default_factory)r�
ValueErrorrrBrrrr@s
�cs(|sdSdd��fdd�|D���d�S)N�()�(�,csg|]}��d|j���qS)�.r��.0�f��obj_namerr�
<listcomp>_sz_tuple_str.<locals>.<listcomp>�,))�join)rLrrrKr�
_tuple_strVsrPcs"t��t�����fdd��}|S)Nc	sDt|�t��f}|�krdS��|�z�|�}W5��|�X|S)Nz...)�id�_thread�	get_ident�add�discard)r�key�result��repr_running�
user_functionrr�wrapperis
z _recursive_repr.<locals>.wrapper)�set�	functools�wraps)rZr[rrXr�_recursive_reprds
r_)�globals�locals�return_typec
Cs�|dkri}d|krt|d<d}|tk	r4||d<d}d�|�}d�dd�|D��}d	|�d
|�d|�d|��}d
�|���}d|�d|�d|��}i}	t|||	�|	df|�S)NZBUILTINS�Z_return_typez->_return_typerF�
css|]}d|��VqdS)z  Nr)rI�brrr�	<genexpr>�sz_create_fn.<locals>.<genexpr>z def rEr7z:
�, zdef __create_fn__(z):
z	
 return Z
__create_fn__)�builtinsrrO�keys�exec)
r�argsZbodyr`rarbZreturn_annotationZtxtZ
local_vars�nsrrr�
_create_fnws 
rmcCs0|rd|�d|�d|�d�S|�d|�d|��S)NzBUILTINS.object.__setattr__(rFr7rG�=r)rAr�value�	self_namerrr�
_field_assign�srqcCs�d|j��}|jtk	rV|jr@|j||<|�d|j�d|j��}q�|j||<|�d�}n8|jr�|jtkrn|j}q�|jtk	r�|j||<|j}ndS|jtkr�dSt||j||�S)NZ_dflt_z() if z is _HAS_DEFAULT_FACTORY else rD)rr-rr/r,r2r!rq)rJrAr`rpZdefault_namerorrr�_field_init�s"






rrcCsV|jtkr|jtkrd}n&|jtk	r2d|j��}n|jtk	r@d}|j�d|j�|��S)Nrcz=_dflt_z=_HAS_DEFAULT_FACTORYz:_type_)r,rr-r)rJr,rrr�_init_param�s

rscCs�d}|D]:}|jr|jtkr&|jtks,d}q|rtd|j�d���qdd�|D�}|�ttd��g}|D] }t||||�}	|	rj|�	|	�qj|r�d�
d	d
�|D��}
|�	|�dt�d|
�d
��|s�dg}td|gdd�|D�|||dd�S)NFTznon-default argument z follows default argumentcSsi|]}d|j��|j�qS)Z_type_)rr%rHrrr�
<dictcomp>�s
z_init_fn.<locals>.<dictcomp>)r�_HAS_DEFAULT_FACTORYrFcss|]}|jtkr|jVqdSr)r2r!rrHrrrrf	s
�z_init_fn.<locals>.<genexpr>rGrEr7�passrcSsg|]}|jrt|��qSr)r/rsrHrrrrMsz_init_fn.<locals>.<listcomp>)rar`rb)
r/r,rr-�	TypeErrorr�updaterurr�appendrO�_POST_INIT_NAMErm)rrA�
has_post_initrpr`Zseen_defaultrJraZ
body_lines�lineZ
params_strrrr�_init_fn�s:��r}cCs2tdddd�dd�|D��dg|d�}t|�S)	Nrrz(return self.__class__.__qualname__ + f"(rgcSs g|]}|j�d|j�d��qS)z={self.z!r}rrHrrrrMs�z_repr_fn.<locals>.<listcomp>z)"�r`)rmrOr_)rr`�fnrrr�_repr_fns
����r�cCsp|td�}|r,dd�dd�|D��d}nd}tdd	d
|�d�dd
f||d�tddd
|�d�ddf||d�fS)N)�clsrrErFcss|]}t|j�VqdSr)r(rrHrrrrf(sz'_frozen_get_del_attr.<locals>.<genexpr>rNrD�__setattr__)rrroz if type(self) is cls or name in �:z> raise FrozenInstanceError(f"cannot assign to field {name!r}")z)super(cls, self).__setattr__(name, value))rar`�__delattr__rz; raise FrozenInstanceError(f"cannot delete field {name!r}")z"super(cls, self).__delattr__(name))rrOrm)r�rr`raZ
fields_strrrr�_frozen_get_del_attr$s2�
��
���r�cCs$t|ddd|�|�|��dg|d�S)N)r�otherz%if other.__class__ is self.__class__:z return zreturn NotImplementedr~)rm)r�op�
self_tuple�other_tupler`rrr�_cmp_fn=s��r�cCs$td|�}tddd|�d�g|d�S)Nr�__hash__rzreturn hash(r7r~)rPrm)rr`r�rrr�_hash_fnKs
�r�cCs$||jkp"t|�|jko"|j|jkSr)�ClassVarr%Z
_GenericAliasZ
__origin__)�a_type�typingrrr�_is_classvarSs

�r�cCs||jkpt|�|jkSr)rr%)r��dataclassesrrr�_is_initvar[s
�r�c	Cs�t�|�}|r�d}|�d�}|s2tj�|j�j}n2tj�|j�}|rd|j�|�|krdtj�|j�j}|r�||�|�d��|�r�dSdS)N��TF)�_MODULE_IDENTIFIER_RE�match�group�sys�modules�getr�__dict__)	Z
annotationr�Za_moduler�Zis_type_predicater�rlZmodule_name�modulerrr�_is_typebs)

r�cCs8t||t�}t|t�r|}nt|tj�r,t}t|d�}||_||_t	|_
tj�
d�}|r�t||�s�t|jt�r�t|j|||jt�r�t|_
|j
t	kr�tjt}t||�s�t|jt�r�t|j|||jt�r�t|_
|j
ttfkr�|jtk	r�td|j�d���|j
t	k�r4t|jtttf��r4tdt|j��d|j�d���|S)N)r,r��field z cannot have a default factoryzmutable default z for field z$ is not allowed: use default_factory)r9rr'rr4�MemberDescriptorTyperrr%rr2r�r�r�r��strr�r�r rr�rr!r-rwr,�list�dictr\rC)r�Za_namer�r,rJr�r�rrr�
_get_field�sF



���



���
	 r�cCs||jkrdSt|||�dS)NTF)r��setattr)r�rrorrr�_set_new_attribute�s
r�cCsdSrr�r�rr`rrr�_hash_set_none�sr�cCsdd�|D�}t||�S)NcSs(g|] }|jdkr|jrn|jr|�qSr)r.r0rHrrrrMs

z_hash_add.<locals>.<listcomp>)r�)r�rr`�fldsrrr�	_hash_addsr�cCstd|j����dS)Nz-Cannot overwrite attribute __hash__ in class )rwrr�rrr�_hash_exceptionsr�))FFFF)FFFT)FFTF)FFTT)FTFF)FTFT)FTTF)FTTT)TFFF)TFFT)TFTF)TFTT)TTFF)TTFT)TTTF)TTTTcs�i}�jtjkr tj�jj}ni}t�tt||||||��d}	d}
�jddd�D]D}t|t	d�}|dk	rVd}
|�
�D]}
|
||
j<qzt|t�jrVd}	qV�j�
di�}�fdd�|��D�}|D]L}
|
||
j<tt�|
jd�t�r�|
jtk�rt�|
j�q�t�|
j|
j�qĈj��D].\}}t|t��r||k�rt|�d����q|
�rz|	�rf|�sftd	��|	�sz|�rztd
��t�t	|��j�
dt�}|tk�p�|dk�o�d�jk}|�r�|�s�td
��|�rt�t�}dd�|�
�D�}t�dt|||d|k�rdnd|��dd�|�
�D�}|�rHdd�|D�}t�dt||��|�r�dd�|D�}td|�}td|�}t�dtdd|||d��|�r�dd�|D�}td|�}td|�}dD]>\}}t�|t|||||d���r�td|�d�j�d����q�|�r8t�||�D].}t�|j|��rtd|j�d�j�����qtt |�t |�t |�|f}|�rh|�||��_!t�d��s��jt"t#�$����%dd ��_&�S)!NF���rT�__annotations__csg|]\}}t�||��qSr)r�)rIrr%�r�rrrM]s�z"_process_class.<locals>.<listcomp>z& is a field but has no type annotationz5cannot inherit non-frozen dataclass from a frozen onez5cannot inherit frozen dataclass from a non-frozen oner��__eq__z eq must be true if order is truecSsg|]}|jttfkr|�qSr)r2rr!rHrrrrM�s�rrZ__dataclass_self__cSsg|]}|jtkr|�qSr�r2rrHrrrrM�s
cSsg|]}|jr|�qSr)r(rHrrrrM�srcSsg|]}|jr|�qSr�r0rHrrrrM�sr�z==r~cSsg|]}|jr|�qSrr�rHrrrrM�s))�__lt__�<)�__le__z<=)�__gt__�>)�__ge__z>=zCannot overwrite attribute z
 in class z). Consider using functools.total_ordering�__doc__z -> Nonerc)'rr�r�r�r��_PARAMSr<�__mro__r9�_FIELDS�valuesrrAr��itemsr'rr,r�delattrrwrC�hasattrrzr�r}r�rPr�rr��_hash_action�boolr�r��inspectZ	signaturerr�)r�r/r(r>r?r@rArr`Zany_frozen_baseZhas_dataclass_basesreZbase_fieldsrJZcls_annotationsZ
cls_fieldsrroZ
class_hashZhas_explicit_hashr{r�Z
field_listr�r�r�rZhash_actionrr�r�_process_class's��
�

�
��

��


����r�Fr=cs*������fdd�}|dkr"|S||�S)a�Returns the same class as was passed in, with dunder methods
    added based on the fields defined in the class.

    Examines PEP 526 __annotations__ to determine fields.

    If init is true, an __init__() method is added to the class. If
    repr is true, a __repr__() method is added. If order is true, rich
    comparison dunder methods are added. If unsafe_hash is true, a
    __hash__() method function is added. If frozen is true, fields may
    not be assigned to after instance creation.
    cst|�������Sr)r�r��r>rAr/r?r(r@rr�wrap�szdataclass.<locals>.wrapNr)r�r/r(r>r?r@rAr�rr�rr�scCsBzt|t�}Wntk
r*td��YnXtdd�|��D��S)z�Return a tuple describing the fields of this dataclass.

    Accepts a dataclass or an instance of one. Tuple elements are of
    type Field.
    z0must be called with a dataclass type or instancecss|]}|jtkr|VqdSrr�rHrrrrf
s
zfields.<locals>.<genexpr>)r9r��AttributeErrorrw�tupler�)Zclass_or_instancerrrrr�s
cCstt|�t�S)z2Returns True if obj is an instance of a dataclass.)r�r%r�)�objrrr�_is_dataclass_instancesr�cCs t|t�r|nt|�}t|t�S)zEReturns True if obj is a dataclass or an instance of a
    dataclass.)r'r%r�r�)r�r�rrrr
s��dict_factorycCst|�std��t||�S)a�Return the fields of a dataclass instance as a new dictionary mapping
    field names to field values.

    Example usage:

      @dataclass
      class C:
          x: int
          y: int

      c = C(1, 2)
      assert asdict(c) == {'x': 1, 'y': 2}

    If given, 'dict_factory' will be used instead of built-in dict.
    The function applies recursively to field values that are
    dataclass instances. This will also look into built-in containers:
    tuples, lists, and dicts.
    z0asdict() should be called on dataclass instances)r�rw�
_asdict_inner)r�r�rrrr	scs�t|�rDg}t|�D]&}tt||j���}|�|j|f�q�|�St|t�rrt|d�rrt	|��fdd�|D��St|t
tf�r�t	|��fdd�|D��St|t�r�t	|��fdd�|��D��St
�|�SdS)N�_fieldscsg|]}t|���qSr�r��rI�vr�rrrMOsz!_asdict_inner.<locals>.<listcomp>c3s|]}t|��VqdSrr�r�r�rrrfTsz _asdict_inner.<locals>.<genexpr>c3s&|]\}}t|��t|��fVqdSrr��rI�kr�r�rrrfVs��)r�rr�r9rryr'r�r�r%r�r�r��copy�deepcopy)r�r�rWrJrorr�rr�4s
�r���
tuple_factorycCst|�std��t||�S)a�Return the fields of a dataclass instance as a new tuple of field values.

    Example usage::

      @dataclass
      class C:
          x: int
          y: int

    c = C(1, 2)
    assert astuple(c) == (1, 2)

    If given, 'tuple_factory' will be used instead of built-in tuple.
    The function applies recursively to field values that are
    dataclass instances. This will also look into built-in containers:
    tuples, lists, and dicts.
    z1astuple() should be called on dataclass instances)r�rw�_astuple_inner)r�r�rrrr
]scs�t|�r>g}t|�D] }tt||j���}|�|�q�|�St|t�rlt|d�rlt	|��fdd�|D��St|t
tf�r�t	|��fdd�|D��St|t�r�t	|��fdd�|��D��St
�|�SdS)Nr�csg|]}t|���qSr�r�r�r�rrrM�sz"_astuple_inner.<locals>.<listcomp>c3s|]}t|��VqdSrr�r�r�rrrf�sz!_astuple_inner.<locals>.<genexpr>c3s&|]\}}t|��t|��fVqdSrr�r�r�rrrf�s�)r�rr�r9rryr'r�r�r%r�r�r�r�r�)r�r�rWrJrorr�rr�us
�r�r)�bases�	namespacer/r(r>r?r@rAc	s�dkri�n����t�}
i}|D]�}t|t�r<|}
d}nDt|�dkrR|\}
}n.t|�dkrr|\}
}}|�|
<ntd|����t|
t�r�|
��s�td|
����t�|
�r�td|
����|
|
kr�td|
����|
�	|
�|||
<q$|�d	<t
�||i�fd
d��}t|||||||	d�S)
a�Return a new dynamically created dataclass.

    The dataclass name will be 'cls_name'.  'fields' is an iterable
    of either (name), (name, type) or (name, type, Field) objects. If type is
    omitted, use the string 'typing.Any'.  Field objects are created by
    the equivalent of calling 'field(name, type [, Field-info])'.

      C = make_dataclass('C', ['x', ('y', int), ('z', int, field(init=False))], bases=(Base,))

    is equivalent to:

      @dataclass
      class C(Base):
          x: 'typing.Any'
          y: int
          z: int = field(init=False)

    For the bases and namespace parameters, see the builtin type() function.

    The parameters init, repr, eq, order, unsafe_hash, and frozen are passed to
    dataclass().
    Nz
typing.Anyr��zInvalid field: z'Field names must be valid identifiers: z"Field names must not be keywords: zField name duplicated: r�cs
|���Sr)rx)rl�r�rr�<lambda>��z make_dataclass.<locals>.<lambda>r=)
r�r\r'r��lenrw�isidentifier�keyword�	iskeywordrTr4�	new_classr)Zcls_namerr�r�r/r(r>r?r@rA�seenZanns�itemr�tp�specr�rr�rr�s:






�cOst|�dkr tdt|��d���|r,|\}n4d|krX|�d�}ddl}|jdtdd	�ntd
��t|�sptd��t|t��	�D]v}|j
tkr�q~|js�|j
|kr~td|j
�d
���q~|j
|kr~|j
tkr�|jtkr�td|j
�d���t||j
�||j
<q~|jf|�S)a,Return a new object replacing specified fields with new values.

    This is especially useful for frozen classes.  Example usage:

      @dataclass(frozen=True)
      class C:
          x: int
          y: int

      c = C(1, 2)
      c1 = replace(c, x=3)
      assert c1.x == 3 and c1.y == 2
      r�z*replace() takes 1 positional argument but z were givenr�rNz/Passing 'obj' as keyword argument is deprecatedr�)�
stacklevelz7replace() missing 1 required positional argument: 'obj'z1replace() should be called on dataclass instancesr�zC is declared with init=False, it cannot be specified with replace()zInitVar z! must be specified with replace())r�rw�pop�warnings�warn�DeprecationWarningr�r9r�r�r2r r/rrCr!r,r�	__class__)rkZchangesr�r�rJrrrr�s4
�


z(obj, /, **kwargs))N)C�rer�r�r4r�r�rhr]rR�__all__r�rrrurrr5r3rrr r!r�r�rz�compiler�r%r"rrr<rrPr_rmrqrrrsr}r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr�r
r�r	r�r�r
r�rr�__text_signature__rrrr�<module>s��

:��62;R�>
�)�B<__pycache__/cmd.cpython-38.opt-2.pyc000064400000016043151153537600013121 0ustar00U

e5d:�@s<ddlZddlZdgZdZejejdZGdd�d�ZdS)�N�Cmdz(Cmd) �_c@s�eZdZeZeZdZdZdZ	dZ
dZdZdZ
dZdZd/d
d�Zd0dd
�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Z d1d-d.�Z!dS)2r�=�Nz(Documented commands (type help <topic>):zMiscellaneous help topics:zUndocumented commands:z*** No help on %s��tabcCs@|dk	r||_ntj|_|dk	r(||_ntj|_g|_||_dS�N)�stdin�sys�stdout�cmdqueue�completekey)�selfr
r	r�r�/usr/lib64/python3.8/cmd.py�__init__LszCmd.__init__cCs�|��|jr\|jr\z2ddl}|��|_|�|j�|�|jd�Wnt	k
rZYnXz�|dk	rl||_
|j
r�|j�t
|j
�d�d}|�s4|jr�|j�d�}nl|jr�zt|j�}Wntk
r�d}YnXn<|j�|j�|j��|j��}t|��sd}n
|�d�}|�|�}|�|�}|�||�}q�|��W5|j�r�|j�r�zddl}|�|j�Wnt	k
�r~YnXXdS)Nrz
: complete�
�EOFz
)�preloop�use_rawinputr
�readlineZ
get_completerZ
old_completerZ
set_completer�complete�parse_and_bind�ImportError�intror�write�strr�pop�input�prompt�EOFError�flushr	�len�rstrip�precmd�onecmd�postcmd�postloop)rrr�stop�linerrr�cmdloopbsN






zCmd.cmdloopcCs|Srr�rr)rrrr$�sz
Cmd.precmdcCs|Srr)rr(r)rrrr&�szCmd.postcmdcCsdSrr�rrrrr�szCmd.preloopcCsdSrrr,rrrr'�szCmd.postloopcCs�|��}|sdd|fS|ddkr4d|dd�}n2|ddkrft|d�r\d|dd�}n
dd|fSdt|�}}||kr�|||jkr�|d}qt|d|�||d���}}|||fS)Nr�?zhelp r�!Zdo_shellzshell )�strip�hasattrr"�
identchars)rr)�i�n�cmd�argrrr�	parseline�s



z
Cmd.parselinecCs�|�|�\}}}|s|��S|dkr.|�|�S||_|dkrBd|_|dkrT|�|�Szt|d|�}Wntk
r�|�|�YSX||�SdS)Nrr�do_)r6�	emptyline�default�lastcmd�getattr�AttributeError)rr)r4r5�funcrrrr%�s


z
Cmd.onecmdcCs|jr|�|j�SdSr)r:r%r,rrrr8�sz
Cmd.emptylinecCs|j�d|�dS)Nz*** Unknown syntax: %s
)rrr+rrrr9�szCmd.defaultcGsgSrr)r�ignoredrrr�completedefault�szCmd.completedefaultcsd|��fdd�|��D�S)Nr7cs"g|]}|���r|dd��qS)�N��
startswith��.0�a�Zdotextrr�
<listcomp>�s
z%Cmd.completenames.<locals>.<listcomp>)�	get_names)r�textr>rrFr�
completenames�szCmd.completenamesc
Cs�|dkr�ddl}|��}|��}t|�t|�}|��|}|��|}|dkr�|�|�\}	}
}|	dkrp|j}q�zt|d|	�}Wq�t	k
r�|j}Yq�Xn|j
}|||||�|_z|j|WStk
r�YdSXdS)NrrZ	complete_)
rZget_line_buffer�lstripr"Z
get_begidxZ
get_endidxr6r?r;r<rJZcompletion_matches�
IndexError)
rrI�staterZorigliner)�strippedZbegidxZendidxr4�argsZfooZcompfuncrrrr�s*zCmd.completecCs
t|j�Sr)�dir�	__class__r,rrrrHsz
Cmd.get_namescs4t|j���}t�fdd�|��D��}t||B�S)Nc3s,|]$}|�d�d�r|dd�VqdS)�help_r�NrArC�rOrr�	<genexpr> s�z$Cmd.complete_help.<locals>.<genexpr>)�setrJrH�list)rrOZcommandsZtopicsrrTr�
complete_helpszCmd.complete_helpcCs�|r�zt|d|�}Wn|tk
r�z4t|d|�j}|rX|j�dt|��WYdSWntk
rnYnX|j�dt|j|f��YdSX|��n|��}g}g}i}|D]$}|dd�dkr�d||dd�<q�|��d}	|D]p}|dd�dkr�||	k�rq�|}	|dd�}
|
|k�r8|�	|
�||
=q�t||�j�rR|�	|
�q�|�	|
�q�|j�dt|j
��|�|j|dd	�|�|j
t|���dd	�|�|j|dd	�dS)
NrRr7�%s
rSrrr@��P)r;r<�__doc__rrr�nohelprH�sort�append�
doc_leader�print_topics�
doc_header�misc_headerrW�keys�undoc_header)rr5r=�doc�namesZcmds_docZ
cmds_undoc�help�nameZprevnamer4rrr�do_help$sN



zCmd.do_helpcCs\|rX|j�dt|��|jr<|j�dt|jt|���|�||d�|j�d�dS)NrYrr)rrr�rulerr"�	columnize)r�headerZcmdsZcmdlenZmaxcolrrrraRszCmd.print_topicsr[cs��s|j�d�dS�fdd�tt���D�}|rJtdd�tt|����t��}|dkrv|j�dt�d��dStdt���D]�}||d|}g}d	}t|�D]h}	d}
t|�D]2}|||	}||kr�q�|}
t|
t|
��}
q�|�	|
�||
d
7}||kr��qq�||kr��q4q�t��}d}dg}t|�D]�}g}t|�D]4}	|||	}||k�rld}
n�|}
|�	|
��qL|�r�|d�s�|d=�q�tt|��D]}	||	�
||	�||	<�q�|j�dtd
�|����q<dS)Nz<empty>
csg|]}t�|t�s|�qSr)�
isinstancer)rDr2�rWrrrGds�z!Cmd.columnize.<locals>.<listcomp>z list[i] not a string for i in %sz, rrYr����r���z  )rr�ranger"�	TypeError�join�mapr�maxr_�ljust)rrWZdisplaywidthZ
nonstrings�sizeZnrowsZncolsZ	colwidthsZtotwidth�colZcolwidth�rowr2�xZtextsrrorrlZs\�


z
Cmd.columnize)rNN)N)r[)"�__name__�
__module__�__qualname__�PROMPTr�
IDENTCHARSr1rkr:rr`rbrcrer]rrr*r$r&rr'r6r%r8r9r?rJrrHrXrjrarlrrrrr4s:

4
		.)�stringr
�__all__r�Z
ascii_lettersZdigitsr�rrrrr�<module>-s__pycache__/profile.cpython-38.opt-1.pyc000064400000034350151153537600014016 0ustar00U

e5d�[�@sxdZddlZddlZddlZddlZdddgZGdd�d�Zdd	d�Zdd
d�ZGdd�d�Z	dd
�Z
edkrte
�dS)z Class for profiling Python code.�N�run�runctx�Profilec@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�_Utilsz�Support class for utility functions which are shared by
    profile.py and cProfile.py modules.
    Not supposed to be used directly.
    cCs
||_dS�N)�profiler)�selfr�r	�/usr/lib64/python3.8/profile.py�__init__0sz_Utils.__init__cCsF|��}z(z|�|�Wntk
r,YnXW5|�|||�XdSr)r�_showr�
SystemExit)r�	statement�filename�sort�profr	r	r
r3s
z
_Utils.runcCsJ|��}z,z|�|||�Wntk
r0YnXW5|�|||�XdSr)rrrr
)rr�globals�localsrrrr	r	r
r<s
z
_Utils.runctxcCs"|dk	r|�|�n
|�|�dSr)�
dump_stats�print_stats)rrrrr	r	r
rEsz_Utils._showN)�__name__�
__module__�__qualname__�__doc__rrrrr	r	r	r
r*s
		r���cCstt��|||�S)aRun statement under profiler optionally saving results in filename

    This function takes a single argument that can be passed to the
    "exec" statement, and an optional file name.  In all cases this
    routine attempts to "exec" its first argument and gather profiling
    statistics from the execution. If no file name is present, then this
    function automatically prints a simple profiling report, sorted by the
    standard name string (file/line/function-name) that is presented in
    each line.
    )rrr)rrrr	r	r
rQscCstt��|||||�S)z�Run statement under profiler, supplying your own globals and locals,
    optionally saving results in filename.

    statement and filename have the same semantics as profile.run
    )rrr)rrrrrr	r	r
r^sc@s�eZdZdZdZd5dd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
ee
e
ee
e
d�Zdd�ZGdd�d�ZGdd�d�Zdd�Zdd �Zd6d"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0e_d7d1d2�Zd3d4�ZdS)8raProfiler class.

    self.cur is always a tuple.  Each such tuple corresponds to a stack
    frame that is currently active (self.cur[-2]).  The following are the
    definitions of its members.  We use this external "parallel stack" to
    avoid contaminating the program that we are profiling. (old profiler
    used to write into the frames local dictionary!!) Derived classes
    can change the definition of some entries, as long as they leave
    [-2:] intact (frame and previous tuple).  In case an internal error is
    detected, the -3 element is used as the function name.

    [ 0] = Time that needs to be charged to the parent frame's function.
           It is used so that a function call will not have to access the
           timing data for the parent frame.
    [ 1] = Total time spent in this frame's function, excluding time in
           subfunctions (this latter is tallied in cur[2]).
    [ 2] = Total time spent in subfunctions, excluding time executing the
           frame's function (this latter is tallied in cur[1]).
    [-3] = Name of the function that corresponds to this frame.
    [-2] = Actual frame that we correspond to (used to sync exception handling).
    [-1] = Our parent 6-tuple (corresponds to frame.f_back).

    Timing data for each function is stored as a 5-tuple in the dictionary
    self.timings[].  The index is always the name stored in self.cur[-3].
    The following are the definitions of the members:

    [0] = The number of times this function was called, not counting direct
          or indirect recursion,
    [1] = Number of times this function appears on the stack, minus one
    [2] = Total time spent internal to this function
    [3] = Cumulative time that this function was present on the stack.  In
          non-recursive functions, this is the total execution time from start
          to finish of each invocation of a function, including time spent in
          all subfunctions.
    [4] = A dictionary indicating for each function name, the number of times
          it was called by us.
    rNcCs�i|_d|_d|_d|_|dkr&|j}||_|sHtj|_|_|j	|_
nl||_|��}zt|�}Wn"tk
r�||_|j	|_
Yn0X|dkr�|j
|_
n|j|_
|tfdd�}||_|��|_|�d�dS)N��cSs
||��Srr	)�timer�sumr	r	r
�get_time_timer�sz(Profile.__init__.<locals>.get_time_timerr)�timings�cur�cmd�c_func_name�bias�time�process_timer�get_time�trace_dispatch_i�
dispatcher�len�	TypeError�trace_dispatch�trace_dispatch_lr�t�
simulate_call)rrr$r.Zlengthrr	r	r
r�s0


zProfile.__init__cCs�|j}|�}|d|d|j|j}|dkr8|j|_|j||||�rd|�}|d|d|_n|�}|d|d||_dS)Nr��c_call�rr.r$rr#�dispatch)r�frame�event�argrr.�rr	r	r
r,�szProfile.trace_dispatchcCsT|j}|�|j|j}|dkr(|j|_|j||||�rD|�|_n|�||_dS�Nr1r2�rr4r5r6rr.r	r	r
r(�s
zProfile.trace_dispatch_icCs`|j}|�d|j|j}|dkr,|j|_|j||||�rL|�d|_n|�d||_dS)NgN@r1r2r9r	r	r
�trace_dispatch_mac�szProfile.trace_dispatch_maccCsT|j}|�|j|j}|dkr(|j|_|j||||�rD|�|_n|�||_dSr8)r'r.r$rr#r3)rr4r5r6r'r.r	r	r
r-�s
zProfile.trace_dispatch_lc	CsD|j\}}}}}}||k	r*|r*|�||�S|||||||f|_dS�Nr0)r!�trace_dispatch_return)	rr4r.�rpt�rit�ret�rfn�rframe�rcurr	r	r
�trace_dispatch_exception�s
z Profile.trace_dispatch_exceptioncCs�|jr@|j|jdk	r@|j\}}}}}}t|tj�s@|�|d�|j}	|	j|	j|	j	f}
|dd|
||jf|_|j
}|
|kr�||
\}}
}}}||
d|||f||
<nddddif||
<dS�N���rr0)r!�f_back�
isinstancer�
fake_framer<�f_code�co_filename�co_firstlineno�co_namer )rr4r.r=r>r?r@rArBZfcode�fnr �cc�ns�tt�ct�callersr	r	r
�trace_dispatch_callszProfile.trace_dispatch_callc
Csndd|jf}|dd|||jf|_|j}||krX||\}}}}}	||d|||	f||<nddddif||<dS)Nrrr0)r#r!r )
rr4r.rMr rNrOrPrQrRr	r	r
�trace_dispatch_c_callszProfile.trace_dispatch_c_callcCs�||jdk	r |�|jdd�|j\}}}}}}||}||}|\}	}
}}}
}|	|
|||||
|f|_|j}||\}}}}}|s�||}|d}||kr�||d||<nd||<||d||||f||<dSrD)r!r<r )rr4r.r=r>r?r@rBZframe_totalZpptZpitZpetZpfn�pframeZpcurr rNrOrPrQrRr	r	r
r<"s"zProfile.trace_dispatch_return)�callZ	exception�returnr1Zc_exceptionZc_returncCs"|jdrdS||_|�|�dS)Nr)r!r"r/)rr"r	r	r
�set_cmdXs
zProfile.set_cmdc@seZdZdd�Zdd�ZdS)zProfile.fake_codecCs||_||_||_d|_dS�Nr)rJ�co_linerLrK)rr�line�namer	r	r
r^szProfile.fake_code.__init__cCst|j|j|jf�Sr)�reprrJrZrL�rr	r	r
�__repr__dszProfile.fake_code.__repr__N)rrrrr_r	r	r	r
�	fake_code]sr`c@seZdZdd�ZdS)zProfile.fake_framecCs||_||_dSr)rIrF)r�codeZpriorr	r	r
rhszProfile.fake_frame.__init__N)rrrrr	r	r	r
rHgsrHcCsF|�dd|�}|jr |jd}nd}|�||�}|jd||d�dS)NZprofilerrErV)r`r!rHr3)rr\rarUr4r	r	r
r/lszProfile.simulate_callcCsJ|j}|�|j}|jdr:|jd||jd|�d}q|�||_dS)NrrWrEr)r'r.r!r3)rr'r.r	r	r
�simulate_cmd_completexs
zProfile.simulate_cmd_completercCs$ddl}|�|����|���dSrY)�pstatsZStatsZ
strip_dirsZ
sort_statsr)rrrcr	r	r
r�szProfile.print_statsc	Cs0t|d��}|��t�|j|�W5QRXdS)N�wb)�open�create_stats�marshal�dump�stats)r�file�fr	r	r
r�szProfile.dump_statscCs|��|��dSr)rb�snapshot_statsr^r	r	r
rf�szProfile.create_statsc	Cs^i|_|j��D]H\}\}}}}}|��}d}|��D]}||7}q6|||||f|j|<qdSrY)rir �items�copy�values)	r�funcrNrOrPrQrRZncZcallcntr	r	r
rl�s
zProfile.snapshot_statscCsddl}|j}|�|||�SrY)�__main__�__dict__r)rr"rq�dictr	r	r
r�szProfile.runc	Cs8|�|�t�|j�zt|||�W5t�d�X|Sr)rX�sys�
setprofiler)�exec)rr"rrr	r	r
r�s
zProfile.runctxc	Os�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��|�t|��t�	|j
�z|||�W�St�	d�XdS)	Nrz:descriptor 'runcall' of 'Profile' object needs an argumentrprz0Passing 'func' as keyword argument is deprecated)�
stacklevelz7runcall expected at least 1 positional argument, got %dr0)r*r+�pop�warnings�warn�DeprecationWarningrXr]rtrur))�args�kwrrpryr	r	r
�runcall�s(

�
�zProfile.runcallz($self, func, /, *args, **kw)cCs<|jtk	rtd��|j}d|_z|�||�W�S||_XdS)Nz&Subclasses must override .calibrate().r)�	__class__rr+r$�_calibrate_inner)r�m�verboseZ
saved_biasr	r	r
�	calibrate�s
zProfile.calibratecCs|j}dd�}|fdd�}||�|�}||�|�}||}|rLtd|�t�}	|�}|	�dt�t��|�}||}
|r�td|
�d}d}|	j��D]0\\}
}}\}}}}}|d	kr�||7}||7}q�|r�td
|�td|�||dkr�td
|��||d|}|�rtd|�|S)NcSst|�D]}d}qdSr;��range)�n�i�xr	r	r
�f1sz$Profile._calibrate_inner.<locals>.f1cSst|�D]}|d�qdS)N�dr�)r�r�r�r	r	r
rksz#Profile._calibrate_inner.<locals>.fz elapsed time without profiling =zf(m)zelapsed time with profiling =g)rkr�z!'CPU seconds' profiler reported =ztotal # calls =r0z internal error: total calls = %dg@z+mean stopwatch overhead per profile event =)	r'�printrrrrr rm�
ValueError)rr�r�r'r�rkZt0�t1Zelapsed_noprofile�pZelapsed_profileZtotal_callsZ
reported_timerr[�funcnamerNrOrPrQrRZmeanr	r	r
r��sB

�



zProfile._calibrate_inner)NN)r)r)rrrrr$rr,r(r:r-rCrSrTr<r3rXr`rHr/rbrrrfrlrrr~�__text_signature__r�r�r	r	r	r
rgsB&
''�



+
c
Cs�ddl}ddlm}d}||d�}d|_|jdddd	dd
�|jddd
ddd�|jdddddd
�tjdd�s�|��t�d�|�	�\}}|tjdd�<|j
dk	r�|j�|j
�|_
t
|�dk�r�|jr�ddl}d}|j|dd�}nR|d}	tj�d|j�|	��t�|	��}
t|
��|	d�}W5QRX|	dddd�}zt||d|j
|j�Wn6tk
�r�}zdt_t�|j�W5d}~XYnXn|��|S)Nr)�OptionParserzMprofile.py [-o output_file_path] [-s sort] [-m module | scriptfile] [arg] ...)�usageFz-oz	--outfile�outfilezSave stats to <outfile>)�dest�help�defaultz-m�module�
store_truezProfile a library module.)r��actionr�r�z-sz--sortrz?Sort order when printing to stdout, based on pstats.Stats classrr0rz(run_module(modname, run_name='__main__'))�
run_module�modnamervrq)�__file__r�__package__�
__cached__)�osZoptparser�Zallow_interspersed_argsZ
add_optionrt�argvZprint_usage�exit�
parse_argsr��path�abspathr*r��runpyr��insert�dirname�io�	open_code�compile�readrr�BrokenPipeError�stdout�errno)r�r�r��parserZoptionsr|r�raZglobsZprogname�fp�excr	r	r
�main9s^

�
�
�

�� r�rq)Nr)Nr)rr�rtr%rg�__all__rrrrr�rr	r	r	r
�<module>	s

'

	U9__pycache__/nntplib.cpython-38.opt-2.pyc000064400000051732151153537600014030 0ustar00U

e5d���@s�ddlZddlZddlZddlZddlZddlZzddlZWnek
rTdZYnXdZddl	m
ZddlmZdddd	d
ddd
gZ
dZGdd�de�ZGdd�de�ZGdd	�d	e�ZGdd
�d
e�ZGdd�de�ZGdd�de�ZdZdZdddddddddd d!d"hZd#d$d%d&d'd(d)gZd(d)d*�Zd+Ze�d,d-d.d/d0g�Ze�d1d2d3d4g�Zd5d
�Z
d6d7�Zdld8d9�Z dmd:d;�Z!dnd<d=�Z"e�r�d>d?�Z#Gd@dA�dA�Z$GdBd�de$�Z%e�r�GdCdD�dDe$�Z&e
�'dD�e(dEk�r�ddl)Z)e)j*dFdG�Z+e+j,dHdIdJdKdL�e+j,dMdNdOdPdL�e+j,dQdRdSe-dTeefdU�e+j,dVdWdXe-dYdU�e+j,dZd[d\dd]d^�e+�.�Z/e/j0Z0e/j�s�e0dSk�rxeZ0e%e/j1e0d_�Z2ne0dSk�r�eZ0e&e/j1e0d_�Z2e2�3�Z4d`e4k�r�e2�5�e2�6e/j6�\Z7Z8Z9Z:Z;e<dae;dbe8dce9dde:�dedf�Z=e>e-e:�e/j?dg�Z9e2�@e9e:�\Z7ZAeAD]Z\ZBZCe
eCd$��Ddhdg�dZEe
eCd#�ZFe-eCd)�ZGe<di�HeBe=eEdj�e=eFdk�eG���qe2�I�dS)o�NFT)�
decode_header)�_GLOBAL_DEFAULT_TIMEOUT�NNTP�	NNTPError�NNTPReplyError�NNTPTemporaryError�NNTPPermanentError�NNTPProtocolError�
NNTPDataErrorric@seZdZdd�ZdS)rcGs>tj|f|��z|d|_Wntk
r8d|_YnXdS)NrzNo response given)�	Exception�__init__�response�
IndexError)�self�args�r�/usr/lib64/python3.8/nntplib.pyrcs
zNNTPError.__init__N)�__name__�
__module__�__qualname__rrrrrrasc@seZdZdS)rN�rrrrrrrrjsc@seZdZdS)rNrrrrrrnsc@seZdZdS)rNrrrrrrrsc@seZdZdS)r	Nrrrrrr	vsc@seZdZdS)r
Nrrrrrr
zs�wi3Z100Z101�211�215Z220Z221Z222Z224Z225Z230Z231Z282�subject�from�datez
message-idZ
referencesz:bytesz:lines)�bytes�lines�
�	GroupInfo�group�last�first�flag�ArticleInfoZnumber�
message_idrcCsJg}t|�D]2\}}t|t�r4|�|�|p,d��q|�|�qd�|�S)N�ascii�)�_email_decode_header�
isinstancer�append�decode�join)Z
header_str�parts�v�encrrrr�s
cCs�g}|D]`}|ddkr:|dd��d�\}}}d|}n|�d�\}}}|��}t�||�}|�|�qt}t|�t|�kr�td��|dt|��|kr�td��|S)Nr�:�z$LIST OVERVIEW.FMT response too shortz*LIST OVERVIEW.FMT redefines default fields)�	partition�lower�_OVERVIEW_FMT_ALTERNATIVES�getr+�_DEFAULT_OVERVIEW_FMT�lenr
)r�fmt�line�name�_�suffix�defaultsrrr�_parse_overview_fmt�s
r?cCs�tt�}g}|D]�}i}|�d�^}}t|�}t|�D]�\}	}
|	t|�krLq6||	}|�d�}|	|kr�|s�|d}
|
r�|
dt|
����|
kr�td��|
r�|
t|
�d�nd}
|
|||	<q6|�||f�q|S)N�	r1z: z?OVER/XOVER response doesn't include names of additional headers)	r8r7�split�int�	enumerate�
startswithr4r
r+)rr9Zdata_process_funcZ
n_defaultsZoverviewr:ZfieldsZarticle_number�tokens�i�tokenZ
field_nameZis_metadata�hrrr�_parse_overview�s&
rIcCs�|dkr |dd�}|dd�}t|dd��}t|dd��}t|dd��}t|dd��}t|dd��}t|dd��}|dkr�|d7}n|dkr�|d	7}t�||||||�S)
Ni�������������Fi��dil)rB�datetime)�date_str�time_strZhoursZminutesZseconds�yearZmonthZdayrrr�_parse_datetime�s
rTcCsPt|tj�sd}n
d�|�}|j}|r<|d}d�||�}nd�||�}||fS)NZ000000z({0.hour:02d}{0.minute:02d}{0.second:02d}rOz{0:02d}{1.month:02d}{1.day:02d}z{0:04d}{1.month:02d}{1.day:02d})r*rP�formatrS)ZdtZlegacyrR�yrQrrr�_unparse_datetime�s

rWcCs|dkrt��}|j||d�S)N)Zserver_hostname)�sslZ_create_stdlib_contextZwrap_socket)�sock�contextZhostnamerrr�_encrypt_onsr[c@seZdZdZdZdefdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�ZeZdd�Z
dd�Zdhdd�Zdd�Zdidd�Zdd�Zdjdd�Zdkdd �Zd!d"�Zd#d$�Zd%d&�Zdd'�d(d)�Zdd'�d*d+�Zdldd'�d,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zdd'�d6d7�Zd8d9�Z d:d;�Z!dmd<d=�Z"d>d?�Z#d@dA�Z$dndBdC�Z%dodd'�dDdE�Z&dpdd'�dFdG�Z'dqdd'�dHdI�Z(dJdK�Z)dd'�dLdM�Z*dd'�dNdO�Z+dd'�dPdQ�Z,dd'�dRdS�Z-dTdU�Z.dVdW�Z/dXdY�Z0dZd[�Z1d\d]�Z2d^d_�Z3d`da�Z4drdbdc�Z5ddde�Z6e7�rdsdfdg�Z8dS)t�	_NNTPBasezutf-8�surrogateescapeNcCsj||_||_d|_|��|_d|_|��d|_|rZd|jkrZ|��|jsZd|_|��d|_	d|_
dS)NrF�READER)�host�file�	debugging�_getresp�welcome�_caps�getcapabilities�readermode_afterauth�_setreadermode�tls_on�
authenticated)rr`r_�
readermode�timeoutrrrr9s
	z_NNTPBase.__init__cCs|S�Nr�rrrr�	__enter__hsz_NNTPBase.__enter__c	sR�fdd�}|�rNz*z���Wnttfk
r8YnXW5|�rL���XdS)Ncs
t�d�S)Nr`)�hasattrrrmrr�<lambda>l�z$_NNTPBase.__exit__.<locals>.<lambda>)�_close�quit�OSError�EOFError)rrZis_connectedrrmr�__exit__ks
z_NNTPBase.__exit__cCs|jrtdt|j��|jS)Nz	*welcome*)ra�print�reprrcrmrrr�
getwelcomevsz_NNTPBase.getwelcomec	Cs�|jdkr�d|_d|_z|��\}}Wnttfk
rDi|_Yn<X||_d|krhttt|d��|_d|kr�d�	|d�|_|jS)Nr2ZVERSIONZIMPLEMENTATION� )
rd�nntp_versionZnntp_implementation�capabilitiesrr�max�maprBr-)r�resp�capsrrrres
z_NNTPBase.getcapabilitiescCs
||_dSrl)ra)r�levelrrr�set_debuglevel�sz_NNTPBase.set_debuglevelcCsHt�d||�|t}|jdkr.tdt|��|j�|�|j��dS)Nznntplib.putliner2z*put*)	�sys�audit�_CRLFrarwrxr`�write�flush�rr:rrr�_putline�s
z_NNTPBase._putlinecCs2|jrtdt|��|�|j|j�}|�|�dS)Nz*cmd*)rarwrx�encode�encoding�errorsr�r�rrr�_putcmd�sz_NNTPBase._putcmdTcCs�|j�td�}t|�tkr$td��|jdkr<tdt|��|sDt�|r�|dd�t	krf|dd�}n|dd�t	kr�|dd�}|S)Nr2z
line too longz*get*rM���)
r`�readline�_MAXLINEr8r
rarwrxrur�)rZ
strip_crlfr:rrr�_getline�s
z_NNTPBase._getlinecCsl|��}|jrtdt|��|�|j|j�}|dd�}|dkrHt|��|dkrXt|��|dkrht	|��|S)Nz*resp*r2�4�5Z123)
r�rarwrxr,r�r�rrr	)rr�crrrrb�sz_NNTPBase._getrespcCs�d}z�t|ttf�r"t|d�}}|��}|dd�tkrBt|��g}|dk	r�dtdf}|�	d�}||krnq�|�
d�r�|dd�}|�|�qZn8d}|�	�}||kr�q�|�
d�r�|dd�}|�|�q�W5|r�|��X||fS)N�wb��.s.
Fs..r2)
�closer*�strr�openrb�	_LONGRESPrr�r�rDr�r+)rr`Z
openedFilerrZterminatorsr:�
terminatorrrr�_getlongresp�s4	



z_NNTPBase._getlongrespcCs|�|�|��Srl)r�rbr�rrr�	_shortcmd�s
z_NNTPBase._shortcmdcCs|�|�|�|�Srl�r�r�)rr:r`rrr�_longcmds
z_NNTPBase._longcmdcs.��|���|�\}}|�fdd�|D�fS)Ncsg|]}|��j�j��qSr)r,r�r���.0r:rmrr�
<listcomp>s�z,_NNTPBase._longcmdstring.<locals>.<listcomp>r�)rr:r`r�listrrmr�_longcmdstring	s

�z_NNTPBase._longcmdstringcCsdz|jWStk
rYnXz|�d�\}}Wn tk
rPtdd�}Yn
Xt|�}||_|S)NzLIST OVERVIEW.FMT)Z_cachedoverviewfmt�AttributeErrorr�rr7r?)rrrr9rrr�_getoverviewfmtsz_NNTPBase._getoverviewfmtcCsdd�|D�S)NcSsg|]}t|����qSr)r rAr�rrrr�&sz(_NNTPBase._grouplist.<locals>.<listcomp>r)rrrrr�
_grouplist$sz_NNTPBase._grouplistcCs8i}|�d�\}}|D]}|��^}}|||<q||fS)NZCAPABILITIES)r�rA)rr�rrr:r;rErrrr|(s
z_NNTPBase.capabilities)r`cCsbt|tjtjf�s$td�|jj���t||jdk�\}}d�||�}|�	||�\}}||�
|�fS)N�Athe date parameter must be a date or datetime object, not '{:40}'rJzNEWGROUPS {0} {1})r*rPr�	TypeErrorrU�	__class__rrWr{r�r�)rrr`rQrR�cmdrrrrr�	newgroups6s��z_NNTPBase.newgroupscCsRt|tjtjf�s$td�|jj���t||jdk�\}}d�|||�}|�	||�S)Nr�rJzNEWNEWS {0} {1} {2})
r*rPrr�rUr�rrWr{r�)rr!rr`rQrRr�rrr�newnewsFs��z_NNTPBase.newnewscCs4|dk	rd|}nd}|�||�\}}||�|�fS)NzLIST ACTIVE ZLIST)r�r�)r�
group_patternr`�commandrrrrrr�Vs

z_NNTPBase.listcCs�t�d�}|�d|�\}}|�d�s8|�d|�\}}i}|D]:}|�|���}|r@|�dd�\}	}
|sr|
S|
||	<q@|r�||fSdSdS)Nz^(?P<group>[^ 	]+)[ 	]+(.*)$zLIST NEWSGROUPS r�XGTITLE r2rJr()�re�compiler�rD�search�stripr!)rr�Z
return_all�line_patrr�groups�raw_line�matchr;Zdescrrr�_getdescriptionses


z_NNTPBase._getdescriptionscCs|�|d�S)NF�r�)rr!rrr�description|sz_NNTPBase.descriptioncCs|�|d�S)NTr�)rr�rrr�descriptions�sz_NNTPBase.descriptionscCs�|�d|�}|�d�s t|��|��}d}}}t|�}|dkr�|d}|dkr�|d}|dkr�|d}|dkr�|d��}|t|�t|�t|�|fS)NzGROUP rrr2rJr�rK)r�rDrrAr8r4rB)rr;r�words�countr#r"�nrrrr!�s

z_NNTPBase.groupcCs|�d|�S)NZHELP)r�)rr`rrr�help�sz_NNTPBase.helpcCs8|�d�st|��|��}t|d�}|d}|||fS)NZ22r2rJ)rDrrArB)rrr��art_numr&rrr�
_statparse�s
z_NNTPBase._statparsecCs|�|�}|�|�Srl)r�r�)rr:rrrr�_statcmd�s
z_NNTPBase._statcmdcCs"|r|�d�|��S|�d�SdS)NzSTAT {0}ZSTAT)r�rU)r�message_specrrr�stat�s	z_NNTPBase.statcCs
|�d�S)NZNEXT�r�rmrrr�next�sz_NNTPBase.nextcCs
|�d�S)NZLASTr�rmrrrr"�sz_NNTPBase.lastcCs0|�||�\}}|�|�\}}}|t|||�fSrl)r�r�r%)rr:r`rrr�r&rrr�_artcmd�sz_NNTPBase._artcmdcCs$|dk	rd�|�}nd}|�||�S)NzHEAD {0}ZHEAD�rUr��rr�r`r�rrr�head�sz_NNTPBase.headcCs$|dk	rd�|�}nd}|�||�S)NzBODY {0}ZBODYr�r�rrr�body�sz_NNTPBase.bodycCs$|dk	rd�|�}nd}|�||�S)NzARTICLE {0}ZARTICLEr�r�rrr�article�sz_NNTPBase.articlecCs
|�d�S)NZSLAVE)r�rmrrr�slavesz_NNTPBase.slavecsDt�d��|�d�||�|�\}}�fdd��|�fdd�|D�fS)Nz^([0-9]+) ?(.*)
?zXHDR {0} {1}cs��|�}|r|�dd�S|S)Nr2rJ)r�r!)r:�m)�patrr�
remove_numbers
z%_NNTPBase.xhdr.<locals>.remove_numbercsg|]}�|��qSrrr�)r�rrr�sz"_NNTPBase.xhdr.<locals>.<listcomp>)r�r�r�rU)rZhdrr�r`rrr)r�r�r�xhdrs	
z_NNTPBase.xhdrcCs.|�d�||�|�\}}|��}|t||�fS)Nz
XOVER {0}-{1})r�rUr�rI)r�start�endr`rrr9rrr�xovers
	�z_NNTPBase.xoverc	Csxd|jkrdnd}t|ttf�r>|\}}|d�||p6d�7}n|dk	rR|d|}|�||�\}}|��}|t||�fS)NZOVERZXOVERz {0}-{1}r(rz)rdr*�tupler�rUr�r�rI)	rr�r`r�r�r�rrr9rrr�over*sz_NNTPBase.overc	Csft�dtd�t�d�}|�d||�\}}g}|D](}|�|���}|r4|�|�	dd��q4||fS)NzFThe XGTITLE extension is not actively used, use descriptions() insteadrJz^([^ 	]+)[ 	]+(.*)$r�r2)
�warnings�warn�DeprecationWarningr�r�r�r�r�r+r!)	rr!r`r�rZ	raw_linesrr�r�rrr�xgtitleEs�
z_NNTPBase.xgtitlecCslt�dtd�|�d�|��}|�d�s0t|��z|��\}}Wntk
r^t|�d�Yn
X||fSdS)Nz(The XPATH extension is not actively usedrJz	XPATH {0}Z223)	r�r�r�r�rUrDrrA�
ValueError)r�idrZresp_num�pathrrr�xpathWs�
z_NNTPBase.xpathcCsb|�d�}|�d�st|��|��}t|�dkr8t|��|d}t|�dkrTt|��|t|d�fS)NZDATEZ111rJr2�)r�rDrrAr8r
rT)rr�elemrrrrrks

z_NNTPBase.datecCs�|�|�}|�d�st|��t|ttf�r2|��}|D]:}|�t�sR|�	d�t}|�d�rdd|}|j
�|�q6|j
�d�|j
��|�
�S)N�3rr�s.
)r�rDrr*r�	bytearray�
splitlines�endswithr��rstripr`r�r�rb)rr��frr:rrr�_post|s




z_NNTPBase._postcCs|�d|�S)NZPOST)r�)r�datarrr�post�sz_NNTPBase.postcCs|�d�|�|�S)Nz	IHAVE {0})r�rU)rr&r�rrr�ihave�sz_NNTPBase.ihavecCs|j��|`dSrl)r`r�rmrrrrr�s
z_NNTPBase._closecCsz|�d�}W5|��X|S)NZQUIT)rrr�)rrrrrrs�s
z_NNTPBase.quitcCs�|jrtd��|s|std��z<|rX|sXddl}|��}|�|j�}|rX|d}|d}Wntk
rnYnX|sxdS|�d|�}|�d�r�|s�t|��n |�d|�}|�d�s�t	|��d|_
|��|jr�d	|j
kr�|�
�d|_
|��dS)
NzAlready logged in.z7At least one of `user` and `usenetrc` must be specifiedrrJzauthinfo user Z381zauthinfo pass Z281r^)rir��netrcZauthenticatorsr_rtr�rDrrrdrerfrg)r�user�password�usenetrcr�ZcredentialsZauthrrrr�login�s>�


z_NNTPBase.loginc
Cs`z|�d�|_WnJtk
r$Yn8tk
rZ}z|j�d�rHd|_n�W5d}~XYnXdS)Nzmode readerZ480T)r�rcrrr
rDrf)r�errrrg�sz_NNTPBase._setreadermodecCs||jrtd��|jrtd��|�d�}|�d�rp|j��t|j||j	�|_|j�
d�|_d|_d|_|��nt
d��dS)NzTLS is already enabled.z+TLS cannot be started after authentication.�STARTTLSZ382�rwbTzTLS failed to start.)rhr�rir�rDr`r�r[rYr_�makefilerdrer)rrZrrrr�starttls�s



z_NNTPBase.starttls)T)N)N)N)N)N)N)N)N)N)NNT)N)9rrrr�r�rrrnrvryrer��debugr�r�r�rbr�r�r�r�r�r�r|r�r�r�r�r�r�r!r�r�r�r�r�r"r�r�r�r�r�r�r�r�r�r�rr�r�r�rrrsr�rg�	_have_sslr�rrrrr\)sn
�
/		

.







		
)
r\c@s*eZdZeddddefdd�Zdd�ZdS)rNFc	Cs�||_||_t�d|||�t�||f|�|_d}z8|j�d�}t�	|||||�|sZ|rh|�
|||�Wn$|r~|��|j���YnXdS)N�nntplib.connectr�)r_�portr�r��socket�create_connectionrYr�r\rr�r�)	rr_r�r�r�rjr�rkr`rrrr�s$
�
z
NNTP.__init__cCs zt�|�W5|j��XdSrl�rYr�r\rrrmrrrrr$szNNTP._close)rrr�	NNTP_PORTrrrrrrrrr�s�
%c@s,eZdZedddddefdd�Zdd�ZdS)�NNTP_SSLNFc	
Cs�t�d|||�t�||f|�|_d}	zJt|j||�|_|j�d�}	tj||	|||d�|s`|rn|�	|||�Wn$|	r�|	�
�|j�
��YnXdS)Nr�r�)rjrk)r�r�r�r�rYr[r�r\rr�r�)
rr_r�r�r�Zssl_contextrjr�rkr`rrrr.s"
�
zNNTP_SSL.__init__cCs zt�|�W5|j��XdSrlr�rmrrrrrEszNNTP_SSL._close)rrr�
NNTP_SSL_PORTrrrrrrrrr�,s�
r��__main__zJ        nntplib built-in demo - display the latest articles in a newsgroup)r�z-gz--groupzgmane.comp.python.generalz3group to fetch messages from (default: %(default)s))�defaultr�z-sz--serverz
news.gmane.ioz+NNTP server hostname (default: %(default)s)z-pz--portr�z#NNTP port number (default: %s / %s))r�typer�z-nz
--nb-articles�
z2number of articles to fetch (default: %(default)s)z-Sz--ssl�
store_truezuse NNTP over SSL)�actionrr�)r_r�r�ZGroupZhaszarticles, range�tocCs$t|�|kr |d|d�d}|S)NrKz...)r8)�sZlimrrr�cutpsr	r2�<z{:7} {:20} {:42} ({})��*)N)N)F)Jr�r��collectionsrPr�r�rX�ImportErrorr�Zemail.headerrr)r�__all__r�rrrrrr	r
r�rr�r7r5r��
namedtupler r%r?rIrTrWr[r\rr�r+r�argparse�ArgumentParser�parser�add_argumentrB�
parse_argsrr�Zserverrrer�r�r!rr�r#r"r;rwr	r�Znb_articlesr�Z	overviewsZartnumr�rAZauthorrrrUrsrrrr�<module>Bs�
�
	���
��


Y.


�
�
���


�
__pycache__/tokenize.cpython-38.opt-1.pyc000064400000041336151153537600014210 0ustar00U

e5d�d�@sHdZdZdZddlmZddlmZmZddl	Z	ddl
mZddlZ
ddlZddlZddlTdd	lmZe�d
ej�Ze�dej�ZddlZejdd
dddgZ[Gdd�de	�dd��Zdd�Zdd�Zdd�ZdZdZeede�ee�ZdZdZ dZ!dZ"d Z#ee e!e"e#�Z$d!Z%ed"d#�ee%�Z&d$e%Z'ee&e'�Z(ed%e(d&�Z)ee)e(e$�Z*d'd(�Z+d)d*�Z,ee+��Z-d+Z.d,Z/d-Z0d.Z1ee-d/e-d0�Z2ee-d1e-d2�Z3ee4ej5e6ed3d4���Z7ed5e7�Z8ee*e8e3e�Z9ee9Z:ee-d6ed7d�e-d8ed9d��Z;ed:ee2�Z<eee<e*e8e;e�Z=iZ>e+�D]6Z?e.e>e?d7<e/e>e?d9<e0e>e?d/<e1e>e?d0<�q,e@�ZAe@�ZBe+�D]JZCeCd9eCd7fD]ZDeA�EeD��q�eCd0eCd/fD]ZDeB�EeD��q��qvd;ZFGd<d=�d=eG�ZHGd>d?�d?eG�ZIGd@dA�dA�ZJdBd�ZKdCdD�ZLdEd�ZMdFdG�ZdHd�ZNdIdJ�ZOdKd
�ZPdLdM�ZQeRdNk�rDeQ�dS)OaoTokenization help for Python programs.

tokenize(readline) is a generator that breaks a stream of bytes into
Python tokens.  It decodes the bytes according to PEP-0263 for
determining source file encoding.

It accepts a readline-like method which is called repeatedly to get the
next line of input (or b"" for EOF).  It generates 5-tuples with these
members:

    the token type (see token.py)
    the token (a string)
    the starting (row, column) indices of the token (a 2-tuple of ints)
    the ending (row, column) indices of the token (a 2-tuple of ints)
    the original line (string)

It is designed to match the working of the Python tokenizer exactly, except
that it produces COMMENT tokens for comments and gives type OP for all
operators.  Additionally, all token lists start with an ENCODING token
which tells you which encoding was used to decode the bytes stream.
zKa-Ping Yee <ping@lfw.org>zpGvR, ESR, Tim Peters, Thomas Wouters, Fred Drake, Skip Montanaro, Raymond Hettinger, Trent Nelson, Michael Foord�)�open)�lookup�BOM_UTF8N)�
TextIOWrapper)�*)�EXACT_TOKEN_TYPESz&^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)s^[ \t\f]*(?:[#\r\n]|$)�tokenize�generate_tokens�detect_encoding�
untokenize�	TokenInfoc@s eZdZdd�Zedd��ZdS)rcCs$d|jt|jf}d|j|d�S)Nz%d (%s)z8TokenInfo(type=%s, string=%r, start=%r, end=%r, line=%r))�type)r
�tok_name�_replace)�self�annotated_type�r� /usr/lib64/python3.8/tokenize.py�__repr__.s
�zTokenInfo.__repr__cCs(|jtkr|jtkrt|jS|jSdS�N)r
�OP�stringr�rrrr�
exact_type3s
zTokenInfo.exact_typeN)�__name__�
__module__�__qualname__r�propertyrrrrrr-sztype string start end linecGsdd�|�dS)N�(�|�))�join��choicesrrr�group:�r$cGst|�dS)Nr�r$r"rrr�any;r%r'cGst|�dS)N�?r&r"rrr�maybe<r%r)z[ \f\t]*z	#[^\r\n]*z\\\r?\nz\w+z0[xX](?:_?[0-9a-fA-F])+z0[bB](?:_?[01])+z0[oO](?:_?[0-7])+z(?:0(?:_?0)*|[1-9](?:_?[0-9])*)z[eE][-+]?[0-9](?:_?[0-9])*z)[0-9](?:_?[0-9])*\.(?:[0-9](?:_?[0-9])*)?z\.[0-9](?:_?[0-9])*z[0-9](?:_?[0-9])*z[0-9](?:_?[0-9])*[jJ]z[jJ]cCs^ddddddg}dh}|D]>}t�|�D].}tjdd	�|D��D]}|�d�|��q@q(q|S)
N�b�r�u�f�br�fr�cSsg|]}||��f�qSr)�upper)�.0�crrr�
<listcomp>^sz(_all_string_prefixes.<locals>.<listcomp>)�
_itertools�permutations�product�addr!)�_valid_string_prefixes�result�prefix�tr,rrr�_all_string_prefixesSsr=cCst�|tj�Sr)�re�compile�UNICODE)�exprrrr�_compilebsrBz[^'\\]*(?:\\.[^'\\]*)*'z[^"\\]*(?:\\.[^"\\]*)*"z%[^'\\]*(?:(?:\\.|'(?!''))[^'\\]*)*'''z%[^"\\]*(?:(?:\\.|"(?!""))[^"\\]*)*"""z'''z"""z'[^\n'\\]*(?:\\.[^\n'\\]*)*'z"[^\n"\\]*(?:\\.[^\n"\\]*)*"T)�reversez\r?\nz'[^\n'\\]*(?:\\.[^\n'\\]*)*�'z"[^\n"\\]*(?:\\.[^\n"\\]*)*�"z
\\\r?\n|\Z�c@seZdZdS)�
TokenErrorN�rrrrrrrrG�srGc@seZdZdS)�StopTokenizingNrHrrrrrI�srIc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�UntokenizercCsg|_d|_d|_d|_dS)N�r)�tokens�prev_row�prev_col�encodingrrrr�__init__�szUntokenizer.__init__cCs�|\}}||jks&||jkr>||jkr>td�|||j|j���||j}|rb|j�d|�d|_||j}|r�|j�d|�dS)Nz+start ({},{}) precedes previous end ({},{})�\
r� )rMrN�
ValueError�formatrL�append)r�start�row�col�
row_offset�
col_offsetrrr�add_whitespace�s�

zUntokenizer.add_whitespacecCs6t|�}g}d}|D�]}t|�dkr8|�||��q*|\}}}}	}
|tkrV||_q|tkrd�q*|tkrz|�|�qnl|tkr�|�	�|	\|_
|_qnL|tt
fkr�d}n:|r�|r�|d}|dt|�kr�|j�|�t|�|_d}|�|�|j�|�|	\|_
|_|tt
fkr|j
d7_
d|_qd�|j�S)NF�T���rKrr0)�iter�len�compat�ENCODINGrO�	ENDMARKER�INDENTrU�DEDENT�poprMrN�NEWLINE�NLrLr[r!)r�iterable�it�indents�	startliner<�tok_type�tokenrV�end�line�indentrrrr�sF



zUntokenizer.untokenizec
Cs�g}|jj}|dttfk}d}t�|g|�D]�}|dd�\}}	|tkrR|	|_q.|tt	fkrf|	d7}	|t
kr�|rzd|	}	d}nd}|tkr�|�|	�q.n>|tkr�|�
�q.n*|ttfkr�d}n|r�|r�||d�d}||	�q.dS)NrFr\rRTr])rLrUrfrgr5�chainrarO�NAME�NUMBER�STRINGrcrdre)
rrmrhrj�toks_appendrk�
prevstring�tok�toknum�tokvalrrrr`�s8
zUntokenizer.compatN)rrrrPr[rr`rrrrrJ�s
%rJcCs*t�}|�|�}|jdk	r&|�|j�}|S)aTransform tokens back into Python source code.
    It returns a bytes object, encoded using the ENCODING
    token, which is the first token sequence output by tokenize.

    Each element returned by the iterable must be a token sequence
    with at least two elements, a token number and token value.  If
    only two tokens are passed, the resulting output is poor.

    Round-trip invariant for full input:
        Untokenized source will match input source exactly

    Round-trip invariant for limited input:
        # Output bytes will tokenize back to the input
        t1 = [tok[:2] for tok in tokenize(f.readline)]
        newcode = untokenize(t1)
        readline = BytesIO(newcode).readline
        t2 = [tok[:2] for tok in tokenize(readline)]
        assert t1 == t2
    N)rJrrO�encode)rh�ut�outrrrrs


cCsH|dd����dd�}|dks*|�d�r.dS|dks@|�d�rDd	S|S)
z(Imitates get_normal_name in tokenizer.c.N��_�-�utf-8zutf-8-)zlatin-1�
iso-8859-1ziso-latin-1)zlatin-1-ziso-8859-1-ziso-latin-1-r�)�lower�replace�
startswith)�orig_enc�encrrr�_get_normal_names�r�cs�z�jj�Wntk
r$d�YnXd�d}d}�fdd�}��fdd�}|�}|�t�rpd�|d	d�}d
}|s||gfS||�}|r�||gfSt�|�s�||gfS|�}|s�||gfS||�}|r�|||gfS|||gfS)a
    The detect_encoding() function is used to detect the encoding that should
    be used to decode a Python source file.  It requires one argument, readline,
    in the same way as the tokenize() generator.

    It will call readline a maximum of twice, and return the encoding used
    (as a string) and a list of any lines (left as bytes) it has read in.

    It detects the encoding from the presence of a utf-8 bom or an encoding
    cookie as specified in pep-0263.  If both a bom and a cookie are present,
    but disagree, a SyntaxError will be raised.  If the encoding cookie is an
    invalid charset, raise a SyntaxError.  Note that if a utf-8 bom is found,
    'utf-8-sig' is returned.

    If no encoding is specified, then the default of 'utf-8' will be returned.
    NFr�cs$z��WStk
rYdSXdS)Nr%)�
StopIterationr��readlinerr�read_or_stop?sz%detect_encoding.<locals>.read_or_stopcs�z|�d�}Wn4tk
rBd}�dk	r6d�|��}t|��YnXt�|�}|sVdSt|�d��}zt|�}Wn:t	k
r��dkr�d|}nd��|�}t|��YnX�r�|dkr؈dkr�d}n
d���}t|��|d	7}|S)
Nr�z'invalid or missing encoding declarationz{} for {!r}rKzunknown encoding: zunknown encoding for {!r}: {}zencoding problem: utf-8z encoding problem for {!r}: utf-8z-sig)
�decode�UnicodeDecodeErrorrT�SyntaxError�	cookie_re�matchr�r$r�LookupError)ro�line_string�msgr�rO�codec)�	bom_found�filenamerr�find_cookieEs8

�
z$detect_encoding.<locals>.find_cookieT��	utf-8-sig)�__self__�name�AttributeErrorr�r�blank_rer�)r�rO�defaultr�r��first�secondr)r�r�r�rr
's8
&




cCsXt|d�}z2t|j�\}}|�d�t||dd�}d|_|WS|���YnXdS)zXOpen a file in read only mode using the encoding detected by
    detect_encoding().
    �rbrT)�line_bufferingr+N)�
_builtin_openr
r��seekr�mode�close)r��bufferrO�lines�textrrrr�s

rcCs6t|�\}}t�d�}t�|t|d�|�}t|j|�S)a�
    The tokenize() generator requires one argument, readline, which
    must be a callable object which provides the same interface as the
    readline() method of built-in file objects.  Each call to the function
    should return one line of input as bytes.  Alternatively, readline
    can be a callable function terminating with StopIteration:
        readline = open(myfile, 'rb').__next__  # Example of alternate readline

    The generator produces 5-tuples with these members: the token type; the
    token string; a 2-tuple (srow, scol) of ints specifying the row and
    column where the token begins in the source; a 2-tuple (erow, ecol) of
    ints specifying the row and column where the token ends in the source;
    and the line on which the token was found.  The line passed is the
    physical line.

    The first token sequence will always be an ENCODING token
    which tells you which encoding was used to decode the bytes stream.
    r%)r
r5�repeatrqr^�	_tokenize�__next__)r�rO�consumed�empty�rl_genrrrr�s
ccsld}}}d}d\}}d}dg}	|dk	rH|dkr6d}tt|ddd�Vd}
d}z|}
|�}Wntk
rvd}YnX|dk	r�|�|�}|d	7}dt|�}}
|�rp|s�td
|��|�|�}|�r|�d�}}tt||d|�|||f||�Vd\}}d}nf|�rZ|dd�dk�rZ|d
d�dk�rZtt	||||t|�f|�Vd}d}qPn||}||}qP�n�|dk�r|�s|�s��q�d}||
k�r�||dk�r�|d	7}n8||dk�r�|t
d	t
}n||dk�r�d}n�q�|d	7}�q�||
k�r�q�||dk�r�||dk�r^||d��d�}tt|||f||t|�f|�V|t|�7}tt
||d�||f|t|�f|�VqP||	dk�r�|	�|�tt|d|�|df||f|�V||	dk�r.||	k�r�tdd|||f��|	dd�}	ttd||f||f|�V�q�n|�s*td|df��d}||
krPtt��||�}|�r�|�d	�\}}||f||f|}}}||k�r��q.|||�||}}||k�s�|dk�r�|dk�r�|dk�r�tt||||�V�q�|dk�r|dk�r�tt
||||�Vntt||||�V�q�|dk�r2tt||||�V�q�|tk�r�tt|�}|�||�}|�r�|�d�}|||�}tt||||f|�Vn||f}||d�}|}qP�q�|tk�s�|dd�tk�s�|dd�tk�rF|ddk�r2||f}tt�|��pt�|d	��pt�|d��}||d�d	}}|}qPntt||||�Vnf|���rdtt||||�VnH|dk�rtd	}n8|dk�r�|d	7}n|d k�r�|d	8}tt||||�Vn*tt	||||f||d	f|�V|d	7}�q.qP|
�r |
ddk�r ttd|d	t|
�f|d	t|
�d	fd�V|	d	d�D] }ttd|df|dfd�V�q,ttd|df|dfd�VdS)!Nr�
0123456789)r0rr�r�)rrr0r%rKzEOF in multi-line string���rQ���z\
rR�	�z#
�#z
r]z3unindent does not match any outer indentation levelz
<tokenize>zEOF in multi-line statement�.z...r\r��
�\z([{z)]})rrar�r�r_rGr�rnrt�
ERRORTOKEN�tabsize�rstrip�COMMENTrgrUrc�IndentationErrorrdrB�PseudoToken�spanrsrf�
triple_quoted�endpats�
single_quoted�get�isidentifierrrrrb)r�rO�lnum�parenlev�	continued�numchars�contstr�needcont�contlinerj�	last_linero�pos�max�strstart�endprog�endmatchrn�column�
comment_token�pseudomatchrV�spos�eposrm�initialrprrrr��s<




�*

�


�
�
"

� 

���





����






�.r�cCs
t|d�S)z�Tokenize a source reading Python code as unicode strings.

    This has the same API as tokenize(), except that it expects the *readline*
    callable to return str objects instead of bytes.
    N)r�r�rrrr	dsc

s$ddl}dd��d�fdd�	}|jdd�}|jdd	d
dd�|jd
ddddd�|��}z�|jr�|j}t|d��}tt|j��}W5QRXnd}t	t
jjd�}|D]>}|j}|j
r�|j}d|j|j}	td|	t||jf�q�W�n8tk
�r6}
z0|
jddd�\}}||
jd|||f�W5d}
~
XYn�tk
�r|}
z(|
jd\}}||
jd|||f�W5d}
~
XYn�tk
�r�}
z||
|�W5d}
~
XYnxtk
�r�}
z||
�W5d}
~
XYnNtk
�r�td�Yn2tk
�r}
z�d|
��W5d}
~
XYnXdS)NrcSstj�|�tj�d�dS)Nr�)�sys�stderr�write)�messagerrr�perrorpszmain.<locals>.perrorcsR|r"|f||f}�d|�n"|r8�d||f�n�d|�t�d�dS)Nz%s:%d:%d: error: %sz
%s: error: %sz	error: %srK)r��exit)r�r��location�args�r�rr�errortszmain.<locals>.errorzpython -m tokenize)�progr�r(zfilename.pyz'the file to tokenize; defaults to stdin)�dest�nargs�metavar�helpz-ez--exact�exact�
store_truez(display token names using the exact type)r��actionr�r�z<stdin>z%d,%d-%d,%d:z%-20s%-15s%-15rrKr�zinterrupted
zunexpected error: %s)NN)�argparse�ArgumentParser�add_argument�
parse_argsr�r��listrr�r�r��stdinr
r�rrVrn�printrrr�r�rGr��OSError�KeyboardInterrupt�	Exception)
r�r��parserr�r�r-rLrm�
token_type�token_range�errror�rr�r�mainlsT���&&r��__main__)S�__doc__�
__author__�__credits__�builtinsrr��codecsrr�collections�ior�	itertoolsr5r>r�rmrr?�ASCIIr�r��__all__�
namedtuplerr$r'r)�
Whitespace�Comment�Ignore�Name�	Hexnumber�	Binnumber�	Octnumber�	Decnumber�	Intnumber�Exponent�
Pointfloat�Expfloat�Floatnumber�
Imagnumber�Numberr=rB�StringPrefix�Single�Double�Single3�Double3�Triple�String�map�escape�sorted�Special�Funny�
PlainToken�Token�ContStr�PseudoExtrasr�r��_prefix�setr�r�r<r,r8r�r�rGrIrJrr�r
rr�r	r�rrrrr�<module>s�
�
��

�
���

_]8=
__pycache__/tarfile.cpython-38.opt-1.pyc000064400000211624151153537600014005 0ustar00U

&�.e��@sdZdZdZdZddlmZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZzddlZWnek
r�dZYnXzddlZWnek
r�dZYnXeefZzeef7ZWnek
r�YnXddd	d
ddd
ddddddddgZdZdZdZdZedZdZdZ dZ!dZ"dZ#dZ$dZ%d Z&d!Z'd"Z(d#Z)d$Z*d%Z+d&Z,d'Z-d(Z.d)Z/d*Z0d+Z1d,Z2dZ3d-Z4d.Z5e5Z6e$e%e&e'e*e+e,e(e)e-e.e/fZ7e$e%e,e/fZ8e-e.e/fZ9d/Z:d0d1d2d3hZ;e<e<e<e=e=e=d4�Z>ej?d5k�r�d6Z@ne�A�Z@d7d8�ZBd9d:�ZCd;d<�ZDd=e6fd>d?�ZEd@dA�ZFdedfdBdC�ZGdDdE�ZHGdFd
�d
eI�ZJGdGd�deJ�ZKGdHd�deJ�ZLGdId�deJ�ZMGdJd
�d
eJ�ZNGdKd�deJ�ZOGdLdM�dMeO�ZPGdNdO�dOeO�ZQGdPdQ�dQeO�ZRGdRdS�dSeO�ZSGdTdU�dUeO�ZTGdVdW�dW�ZUGdXdY�dY�ZVGdZd[�d[eW�ZXGd\d]�d]eW�ZYGd^d_�d_e	jZ�Z[Gd`da�daeJ�Z\Gdbdc�dce\�Z]Gddde�dee\�Z^Gdfdg�dge\�Z_Gdhdi�die\�Z`Gdjdk�dke\�Zad{dldm�Zbdndo�Zcdpdq�Zddrds�Zeecedeedt�ZfeW�ZgGdud�deW�ZhGdvd�deW�Zidwd	�ZjeijZdxdy�Zkeldzk�r
ek�dS)|z,Read from and write to tar format archives.
z0.9.0u"Lars Gustäbel (lars@gustaebel.de)u4Gustavo Niemeyer, Niels Gustäbel, Richard Townsend.�)�openN�TarFile�TarInfo�
is_tarfile�TarError�	ReadError�CompressionError�StreamError�ExtractError�HeaderError�ENCODING�USTAR_FORMAT�
GNU_FORMAT�
PAX_FORMAT�DEFAULT_FORMATrTz/etc/python/tarfile.cfg�i�sustar  sustar00�d��0�1�2�3�4�5�6�7�L�K�S�x�g�X��)�path�linkpath�size�mtime�uid�gid�uname�gnamer%r&r+r,)Zatime�ctimer(r)r*r'�nt�utf-8cCs8|dkrtd��|�||�}|d|�|t|�tS)z8Convert a string to a null-terminated bytes object.
    Nzmetadata cannot contain None)�
ValueError�encode�len�NUL)�s�length�encoding�errors�r8�/usr/lib64/python3.8/tarfile.py�stn�sr:cCs*|�d�}|dkr|d|�}|�||�S)z8Convert a null-terminated bytes object to a string.
    r���N)�find�decode)r4r6r7�pr8r8r9�nts�s
r?cCs�|ddkrbd}tt|�d�D]}|dK}|||d7}q |ddkr�dt|�d|}n@z"t|dd�}t|��p|d	d�}Wntk
r�td
��YnX|S)z/Convert a number field to a python number.
    r)��r#�rA��ascii�strict�0�invalid header)�ranger2r?�int�stripr0�InvalidHeaderError)r4�n�ir8r8r9�nti�srNrBcCs�t|�}d|kr$d|dkrDnntd|d|fd�t}n�|tkr�d|d|krrd|dkr�nnV|dkr�tdg�}ntdg�}d||}t|d�D]}|�d|d@�|dL}q�ntd	��|S)
z/Convert a python number to a number field.
    rrBr#z%0*orDrCr@rAzoverflow in number field)rI�bytesr3r�	bytearrayrH�insertr0)rL�digits�formatr4rMr8r8r9�itn�s 2
rTcCs0dtt�d|��}dtt�d|��}||fS)a�Calculate the checksum for a member's header by summing up all
       characters except for the chksum field which is treated as if
       it was filled with spaces. According to the GNU tar sources,
       some tars (Sun and NeXT) calculate chksum with signed char,
       which will be different if there are chars in the buffer with
       the high bit set. So we calculate two checksums, unsigned and
       signed.
    rCZ
148B8x356BZ
148b8x356b)�sum�structZunpack_from)�bufZunsigned_chksumZ
signed_chksumr8r8r9�calc_chksums�s	rXc	Cs�|pd}|dkrdS|dkr.t�|||�dSt||�\}}t|�D],}|�|�}t|�|krf|d��|�|�qD|dkr�|�|�}t|�|kr�|d��|�|�dS)zjCopy length bytes from fileobj src to fileobj dst.
       If length is None, copy the entire content.
    i@rN�unexpected end of data)�shutil�copyfileobj�divmodrH�readr2�write)	�srcZdstr5�	exception�bufsize�blocks�	remainder�brWr8r8r9r[�s$


r[cCs8ttjdd�}|dk	r(|�|d��|�}t|dd�dS)Nr6�backslashreplace� )�end)�getattr�sys�stdoutr1r=�print)r4r6r8r8r9�_safe_printsrlc@seZdZdZdS)rzBase exception.N��__name__�
__module__�__qualname__�__doc__r8r8r8r9rsc@seZdZdZdS)r
z%General exception for extract errors.Nrmr8r8r8r9r
sc@seZdZdZdS)rz&Exception for unreadable tar archives.Nrmr8r8r8r9rsc@seZdZdZdS)rz.Exception for unavailable compression methods.Nrmr8r8r8r9rsc@seZdZdZdS)r	z=Exception for unsupported operations on stream-like TarFiles.Nrmr8r8r8r9r	!sc@seZdZdZdS)rz!Base exception for header errors.Nrmr8r8r8r9r$sc@seZdZdZdS)�EmptyHeaderErrorzException for empty headers.Nrmr8r8r8r9rr'srrc@seZdZdZdS)�TruncatedHeaderErrorz Exception for truncated headers.Nrmr8r8r8r9rs*srsc@seZdZdZdS)�EOFHeaderErrorz"Exception for end of file headers.Nrmr8r8r8r9rt-srtc@seZdZdZdS)rKzException for invalid headers.Nrmr8r8r8r9rK0srKc@seZdZdZdS)�SubsequentHeaderErrorz3Exception for missing and invalid extended headers.Nrmr8r8r8r9ru3sruc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�
_LowLevelFilez�Low-level file object. Supports reading and writing.
       It is used instead of a regular file object for streaming
       access.
    cCsFtjtjtjBtjBd�|}ttd�r2|tjO}t�||d�|_dS)N��r�w�O_BINARYi�)	�os�O_RDONLY�O_WRONLY�O_CREAT�O_TRUNC�hasattrrzr�fd)�self�name�moder8r8r9�__init__@s��

z_LowLevelFile.__init__cCst�|j�dS�N)r{�closer��r�r8r8r9r�Isz_LowLevelFile.closecCst�|j|�Sr�)r{r]r��r�r'r8r8r9r]Lsz_LowLevelFile.readcCst�|j|�dSr�)r{r^r��r�r4r8r8r9r^Osz_LowLevelFile.writeN)rnrorprqr�r�r]r^r8r8r8r9rv:s
	rvc@sreZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zddd�Zdd�Z
dd�Zdd�ZdS)�_Streama�Class that serves as an adapter between TarFile and
       a stream-like object.  The stream-like object only
       needs to have a read() or write() method and is accessed
       blockwise.  Use of gzip or bzip2 compression is possible.
       A stream-like object could be for example: sys.stdin,
       sys.stdout, a socket, a tape device etc.

       _Stream is intended to be used only internally.
    c	Cs�d|_|dkrt||�}d|_|dkr6t|�}|��}|p<d|_||_||_||_||_d|_	d|_
d|_�zL|dkr�zddl}Wnt
k
r�td	��YnX||_|�d�|_|d
kr�|��|j|_n|��n�|dk�r:zddl}Wnt
k
�r
td��YnX|d
k�r.d|_|��|_t|_n
|��|_n||d
k�r�zddl}Wnt
k
�rntd��YnX|d
k�r�d|_|��|_|j|_n
|��|_n|dk�r�td|��Wn&|j�s�|j��d|_�YnXdS)z$Construct a _Stream object.
        TNF�*��r�gzzzlib module is not availablerx�bz2�bz2 module is not available�xz�lzma module is not available�tar�unknown compression type %r) �_extfileobjrv�_StreamProxy�getcomptyper�r��comptype�fileobjrarW�pos�closed�zlib�ImportErrorr�crc32�crc�
_init_read_gz�errorr`�_init_write_gzr��dbufZBZ2Decompressor�cmp�OSErrorZ
BZ2Compressor�lzmaZLZMADecompressor�	LZMAErrorZLZMACompressorr�)	r�r�r�r�r�rar�r�r�r8r8r9r�]sl












z_Stream.__init__cCst|d�r|js|��dS)Nr�)r�r�r�r�r8r8r9�__del__�sz_Stream.__del__cCs�|j�d|jj|jj|jjd�|_t�dtt	�	���}|�
d|d�|j�d�rf|jdd�|_t
j�|j�|_|�
|j�d	d
�t�dS)z6Initialize for writing with gzip compression.
        �	r�<Ls�s��.gzN���z
iso-8859-1�replace)r�ZcompressobjZDEFLATED�	MAX_WBITSZ
DEF_MEM_LEVELr�rV�packrI�time�_Stream__writer��endswithr{r%�basenamer1r3)r�Z	timestampr8r8r9r��s�z_Stream._init_write_gzcCsR|jdkr|j�||j�|_|jt|�7_|jdkrD|j�|�}|�|�dS)z&Write string s to the stream.
        r�r�N)	r�r�r�r�r�r2r��compressr�r�r8r8r9r^�s

z
_Stream.writecCsN|j|7_t|j�|jkrJ|j�|jd|j��|j|jd�|_qdS)z]Write string s to the stream if a whole new block
           is ready to be written.
        N)rWr2rar�r^r�r8r8r9Z__write�sz_Stream.__writecCs�|jr
dSd|_z�|jdkr:|jdkr:|j|j��7_|jdkr�|jr�|j�	|j�d|_|jdkr�|j�	t
�d|j��|j�	t
�d|j
d@��W5|js�|j��XdS)	z[Close the _Stream object. No operation should be
           done on it afterwards.
        NTryr�r�r�r�l��)r�r�r�r�r�r�rWr��flushr^rVr�r�r�r�r8r8r9r��s
z
_Stream.closecCs�|j�|jj�|_d|_|�d�dkr0td��|�d�dkrFtd��t|�d��}|�d�|d	@r�t|�d��d
t|�d��}|�	|�|d@r�|�d�}|r�|t
kr�q�q�|d@r�|�d�}|r�|t
kr�q�q�|d@r�|�d�d
S)z:Initialize for reading a gzip compressed fileobj.
        r�r$s��not a gzip filer#�zunsupported compression method��rCrB�N)r�Z
decompressobjr�r�r��
_Stream__readrr�ordr]r3)r��flagZxlenr4r8r8r9r��s*
 


z_Stream._init_read_gzcCs|jS)z3Return the stream's file pointer position.
        )r�r�r8r8r9�tell�sz_Stream.tellrcCsX||jdkrJt||j|j�\}}t|�D]}|�|j�q,|�|�ntd��|jS)zXSet the stream's file pointer to pos. Negative seeking
           is forbidden.
        rz seeking backwards is not allowed)r�r\rarHr]r	)r�r�rbrcrMr8r8r9�seeksz_Stream.seekcCs |�|�}|jt|�7_|S)z5Return the next size number of bytes from the stream.)�_readr�r2)r�r'rWr8r8r9r]s
z_Stream.readcCs�|jdkr|�|�St|j�}|jg}||kr�|jrB|j}d|_n|j�|j�}|sVq�z|j�	|�}Wn|j
k
r�td��YnX|�|�|t|�7}q&d�
|�}||d�|_|d|�S)z+Return size bytes from the stream.
        r�r�zinvalid compressed dataN)r�r�r2r�rWr�r]rar��
decompressr`r�append�join�r�r'�c�trWr8r8r9r�s(




z
_Stream._readcCsjt|j�}|jg}||krF|j�|j�}|s.qF|�|�|t|�7}qd�|�}||d�|_|d|�S)zsReturn size bytes from stream. If internal buffer is empty,
           read another block from the stream.
        r�N)r2rWr�r]rar�r�r�r8r8r9Z__read3s


z_Stream.__readN)r)rnrorprqr�r�r�r^r�r�r�r�r�r]r�r�r8r8r8r9r�Rs
F
	

r�c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r�zsSmall proxy class that enables transparent compression
       detection for the Stream interface (mode 'r|*').
    cCs||_|j�t�|_dSr�)r�r]�	BLOCKSIZErW)r�r�r8r8r9r�Isz_StreamProxy.__init__cCs|jj|_|jSr�)r�r]rWr�r8r8r9r]Ms
z_StreamProxy.readcCsP|j�d�rdS|jdd�dkr8|jdd�dkr8d	S|j�d
�rHdSdSdS)
Ns�r�r�sBZhr��
s1AY&SYr�)s]�s�7zXZr�r�)rW�
startswithr�r8r8r9r�Qs$z_StreamProxy.getcomptypecCs|j��dSr�)r�r�r�r8r8r9r�[sz_StreamProxy.closeN)rnrorprqr�r]r�r�r8r8r8r9r�Ds

r�c@sjeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	e
jfdd�Zddd�Z
dd�Zdd�ZdS)�_FileInFilezA thin wrapper around an existing file object that
       provides a part of its data as an individual file
       object.
    NcCs�||_||_||_d|_t|dd�|_d|_|dkr>d|fg}d|_g|_d}|j}|D]L\}}||kr||j�	d||df�|j�	d||||f�||7}||}qX||jkr�|j�	d||jdf�dS)Nrr�FT)
r��offsetr'�positionrhr�r��	map_index�mapr�)r�r�r�r'Z	blockinfoZlastposZrealposr8r8r9r�hs(


z_FileInFile.__init__cCsdSr�r8r�r8r8r9r��sz_FileInFile.flushcCsdS�NTr8r�r8r8r9�readable�sz_FileInFile.readablecCsdS)NFr8r�r8r8r9�writable�sz_FileInFile.writablecCs
|j��Sr�)r��seekabler�r8r8r9r��sz_FileInFile.seekablecCs|jS)z*Return the current file position.
        )r�r�r8r8r9r��sz_FileInFile.tellcCs�|tjkr tt|d�|j�|_nj|tjkr\|dkrFt|j|d�|_q�t|j||j�|_n.|tjkr�tt|j||j�d�|_ntd��|jS)z(Seek to a position in the file.
        rzInvalid argument)	�io�SEEK_SET�min�maxr'r��SEEK_CUR�SEEK_ENDr0)r�r��whencer8r8r9r��s


z_FileInFile.seekc	Cs
|dkr|j|j}nt||j|j�}d}|dk�r|j|j\}}}}||jkr`|krhq�nq�q6|jd7_|jt|j�kr6d|_q6t|||j�}|r�|j�||j|�|j�|�}t|�|kr�t	d��||7}n|t
|7}||8}|j|7_q,|S)z!Read data from the file.
        Nr�rr#rY)r'r�r�r�r�r2r�r�r]rr3)	r�r'rW�data�start�stopr�r5rdr8r8r9r]�s,

z_FileInFile.readcCs&|�t|��}||dt|��<t|�Sr�)r]r2)r�rdrWr8r8r9�readinto�sz_FileInFile.readintocCs
d|_dSr�)r�r�r8r8r9r��sz_FileInFile.close)N)N)rnrorprqr�r�r�r�r�r�r�r�r�r]r�r�r8r8r8r9r�bs

r�cseZdZ�fdd�Z�ZS)�ExFileObjectcs&t|j|j|j|j�}t��|�dSr�)r�r��offset_datar'�sparse�superr�)r��tarfile�tarinfor���	__class__r8r9r��s

�zExFileObject.__init__�rnrorpr��
__classcell__r8r8r�r9r��sr�c@seZdZdS)�FilterErrorN)rnrorpr8r8r8r9r��sr�cseZdZ�fdd�Z�ZS)�AbsolutePathErrorcs ||_t��d|j�d��dS)Nzmember z has an absolute path�r�r�r�r��r�r�r�r8r9r��szAbsolutePathError.__init__r�r8r8r�r9r��sr�cseZdZ�fdd�Z�ZS)�OutsideDestinationErrorcs.||_||_t��|j�d|�d�d�dS)Nz would be extracted to �, � which is outside the destination�r��_pathr�r�r��r�r�r%r�r8r9r��s
�z OutsideDestinationError.__init__r�r8r8r�r9r��sr�cseZdZ�fdd�Z�ZS)�SpecialFileErrorcs||_t��|j�d��dS)Nz is a special filer�r�r�r8r9r��szSpecialFileError.__init__r�r8r8r�r9r��sr�cseZdZ�fdd�Z�ZS)�AbsoluteLinkErrorcs||_t��|j�d��dS)Nz! is a symlink to an absolute pathr�r�r�r8r9r��szAbsoluteLinkError.__init__r�r8r8r�r9r��sr�cseZdZ�fdd�Z�ZS)�LinkOutsideDestinationErrorcs.||_||_t��|j�d|�d�d�dS)Nz would link to r�r�r�r�r�r8r9r��s
�z$LinkOutsideDestinationError.__init__r�r8r8r�r9r��sr�cCs�i}|j}tj�|�}|�dtjf�r@|j�dtj�}|d<tj�|�rTt|��tj�tj�	||��}tj�
||g�|kr�t||��|j}|dk	r�|d@}|r�|�
�s�|��r�|d@s�|dM}|dO}n|��s�|��r�d}nt|��||jkr�||d<|�r�|jdk	�rd|d<|jdk	�r*d|d	<|jdk	�r>d|d
<|jdk	�rRd|d<|���sf|���r�tj�|j��r~t|��|���r�tj�	|tj�|�|j�}ntj�	||j�}tj�|�}tj�
||g�|k�r�t||��|S)N�/r�i��@i�����r�r)r*r+r,)r�r{r%�realpathr��sep�lstrip�isabsr�r��
commonpathr�r��isreg�islnk�isdir�issymr�r)r*r+r,�linknamer��dirnamer�)�member�	dest_pathZfor_data�	new_attrsr�Ztarget_pathr�r8r8r9�_get_filtered_attrs�s^




��
rcCs|Sr�r8)rrr8r8r9�fully_trusted_filter6sr	cCs(t||d�}|r$|jf|ddi��S|S)NF�deep�rr��rrrr8r8r9�
tar_filter9sr
cCs(t||d�}|r$|jf|ddi��S|S)NTr
Frrr8r8r9�data_filter?sr)Z
fully_trustedr�r�c@s�eZdZdZedddddddd	d
ddd
ddddddddd�Zdidd�Zedd��Zej	dd��Zedd��Z
e
j	dd��Z
dd�Zeeeeeeeed ed!�
d"d#�Z
d$d%�Zeed&fd'd(�Zd)d*�Zd+d,�Zd-d.�Zed/d0��Zd1d2�Zed3d4��Zed5d6��Zed7d8��Zed9d:��Zed;d<��Zed=d>��Zd?d@�ZdAdB�Z dCdD�Z!dEdF�Z"dGdH�Z#dIdJ�Z$dKdL�Z%dMdN�Z&dOdP�Z'dQdR�Z(dSdT�Z)dUdV�Z*dWdX�Z+dYdZ�Z,d[d\�Z-d]d^�Z.d_d`�Z/dadb�Z0dcdd�Z1dedf�Z2dgdh�Z3dS)jraInformational class which holds the details about an
       archive member given by a tar header block.
       TarInfo objects are returned by TarFile.getmember(),
       TarFile.getmembers() and TarFile.gettarinfo() and are
       usually created internally.
    zName of the archive member.zPermission bits.z6User ID of the user who originally stored this member.z7Group ID of the user who originally stored this member.zSize in bytes.zTime of last modification.zHeader checksum.z�File type. type is usually one of these constants: REGTYPE, AREGTYPE, LNKTYPE, SYMTYPE, DIRTYPE, FIFOTYPE, CONTTYPE, CHRTYPE, BLKTYPE, GNUTYPE_SPARSE.zcName of the target file name, which is only present in TarInfo objects of type LNKTYPE and SYMTYPE.z
User name.zGroup name.zDevice major number.zDevice minor number.zThe tar header starts here.zThe file's data starts here.zMA dictionary containing key-value pairs of an associated pax extended header.zSparse member information.N)r�r�r)r*r'r(�chksum�typerr+r,�devmajor�devminorr�r��pax_headersr�r��_sparse_structs�_link_targetr�cCsj||_d|_d|_d|_d|_d|_d|_t|_d|_	d|_
d|_d|_d|_
d|_d|_d|_i|_dS)zXConstruct a TarInfo object. name is the optional name
           of the member.
        i�rr�N)r�r�r)r*r'r(r�REGTYPErrr+r,rrr�r�r�r�r�r�r8r8r9r�us"zTarInfo.__init__cCs|jS)z(In pax headers, "name" is called "path".�r�r�r8r8r9r%�szTarInfo.pathcCs
||_dSr�rrr8r8r9r%�scCs|jS)z0In pax headers, "linkname" is called "linkpath".�rr�r8r8r9r&�szTarInfo.linkpathcCs
||_dSr�r)r�rr8r8r9r&�scCsd|jj|jt|�fS)Nz<%s %r at %#x>)r�rnr��idr�r8r8r9�__repr__�szTarInfo.__repr__T)
r�r(r�rr)r*r+r,r
�_KEEPc
Cs�|	rt�|�}n
t�|�}||
k	r(||_||
k	r6||_||
k	rD||_||
k	rR||_||
k	r`||_||
k	rn||_||
k	r|||_||
k	r�||_	|S)zGReturn a deep copy of self with the given attributes replaced.
        )
�copyZdeepcopyr�r(r�rr)r*r+r,)r�r�r(r�rr)r*r+r,r
r�resultr8r8r9r��s(
zTarInfo.replacecCs�|jdkrd}n
|jd@}|j||j|j|j|j|j|j|j|j	|j
|j|jd�
}|dt
kr||d�d�s||dd7<|S)z9Return the TarInfo's attributes as a dictionary.
        N�)
r�r�r)r*r'r(rrrr+r,rrrr�r�)r�r�r)r*r'r(rrrr+r,rr�DIRTYPEr�)r�r��infor8r8r9�get_info�s(

�zTarInfo.get_info�surrogateescapecCsz|��}|��D]\}}|dkrtd|��q|tkrD|�|||�S|tkrZ|�|||�S|tkrn|�||�Std��dS)z<Return a tar header as a string of 512 byte blocks.
        Nz%s may not be Nonezinvalid format)	r"�itemsr0r
�create_ustar_headerr�create_gnu_headerr�create_pax_header)r�rSr6r7r!r��valuer8r8r9�tobuf�sz
TarInfo.tobufcCsnt|d<t|d�||��tkr(td��t|d�||��tkr^|�|d||�\|d<|d<|�|t||�S)z3Return the object as a ustar header block.
        �magicrzlinkname is too longr��prefix)	�POSIX_MAGICr2r1�LENGTH_LINKr0�LENGTH_NAME�_posix_split_name�_create_headerr
)r�r!r6r7r8r8r9r%�szTarInfo.create_ustar_headercCs�t|d<d}t|d�||��tkr<||�|dt||�7}t|d�||��tkrl||�|dt||�7}||�|t	||�S)z:Return the object as a GNU header block sequence.
        r*r�rr�)
�	GNU_MAGICr2r1r-�_create_gnu_long_header�GNUTYPE_LONGLINKr.�GNUTYPE_LONGNAMEr0r)r�r!r6r7rWr8r8r9r&�szTarInfo.create_gnu_headerc
	Cs*t|d<|j��}ddtfddtfddfD]j\}}}||kr>q*z||�dd	�Wn$tk
rv||||<Yq*YnXt||�|kr*||||<q*d
D]`\}}||kr�d||<q�||}d|kr�d|d
kr�nn
t|t	�r�t
|�||<d||<q�|�r|�|t|�}	nd}	|	|�
|tdd�S)z�Return the object as a ustar header block. If it cannot be
           represented this way, prepend a pax extended header sequence
           with supplement information.
        r*r�r%rr&)r+r+� )r,r,r5rDrE))r)rB)r*rB)r'�)r(r6rrBr#r�r�)r,rrr.r-r1�UnicodeEncodeErrorr2�
isinstance�float�str�_create_pax_generic_header�XHDTYPEr0r
)
r�r!r6rr�Zhnamer5rR�valrWr8r8r9r's8
�
*
zTarInfo.create_pax_headercCs|�|td�S)zAReturn the object as a pax global header block sequence.
        r/)r;�XGLTYPE)�clsrr8r8r9�create_pax_global_header7sz TarInfo.create_pax_global_headercCs~|�d�}tdt|��D]T}d�|d|��}d�||d��}t|�||��tkrt|�||��tkrqvqtd��||fS)zUSplit a name longer than 100 chars into a prefix
           and a name part.
        r�r#Nzname is too long)�splitrHr2r�r1�
LENGTH_PREFIXr.r0)r�r�r6r7Z
componentsrMr+r8r8r9r/=s
�zTarInfo._posix_split_namecCs�|�d�ttfk}|r@t|�dd�d|�}t|�dd�d|�}ntdd||�}tdd||�}|�dt�}|dkrxtd��t|�d	d�d
||�t|�dd�d@d|�t|�d
d�d|�t|�dd�d|�t|�dd�d|�t|�dd�d|�d|t|�dd�d
||�|�dt�t|�dd�d||�t|�dd�d||�t|�dd�d|�t|�dd�d|�t|�dd�d||�g}t�	dt
d�|��}	t|	t
d��d}
|	dd�t
d|
d�|	dd�}	|	S) z�Return a header block. info is a dictionary with file
           information, format must be one of the *_FORMAT constants.
        rrrrBrr�NzTarInfo.type must not be Noner�rr�rr)r*r'r6r(s        rr*r+r5r,r+rz%dsr�i����z%06orDi����)�get�CHRTYPE�BLKTYPErTr:rr0r,rVr�r�r�rXrO)r!rSr6r7Zhas_device_fieldsrrZfiletype�partsrWrr8r8r9r0Ms:
�&zTarInfo._create_headercCs.tt|�t�\}}|dkr*|t|t7}|S)zdReturn the string payload filled with zero bytes
           up to the next 512 byte border.
        r)r\r2r�r3)Zpayloadrbrcr8r8r9�_create_payloadwszTarInfo._create_payloadcCsR|�||�t}i}d|d<||d<t|�|d<t|d<|�|t||�|�|�S)zTReturn a GNUTYPE_LONGNAME or GNUTYPE_LONGLINK sequence
           for name.
        z
././@LongLinkr�rr'r*)r1r3r2r1r0r
rG)r?r�rr6r7r!r8r8r9r2�s�zTarInfo._create_gnu_long_headerc	Cs2d}|��D]8\}}z|�dd�Wqtk
rBd}YqFYqXqd}|rV|d7}|��D]�\}}|�d�}|r�|�|d�}n
|�d�}t|�t|�d}d	}	}
|tt|
��}	|	|
kr�q�|	}
q�|tt|
�d
�d|d|d
7}q^i}d|d<||d<t|�|d<t|d<|�|td
d�|�	|�S)z�Return a POSIX.1-2008 extended or global header sequence
           that contains a list of keyword, value pairs. The values
           must be strings.
        Fr/rETr�s21 hdrcharset=BINARY
r#r�rrD� �=�
z././@PaxHeaderr�rr'r*r�)
r$r1r7r2r:rOr,r0r
rG)r?rrr6Zbinary�keywordr(Zrecords�lrLr>r!r8r8r9r;�s<

(�z"TarInfo._create_pax_generic_headerc	Csvt|�dkrtd��t|�tkr(td��|�t�tkr>td��t|dd��}|t|�krbt	d��|�}t
|dd�||�|_t|dd	��|_t|d	d
��|_
t|d
d��|_t|dd��|_t|dd��|_||_|dd
�|_t
|d
d�||�|_t
|dd�||�|_t
|dd�||�|_t|dd��|_t|dd��|_t
|dd�||�}|jtk�r�|j�d��r�t|_|jtk�r8d}g}td�D]l}	z0t|||d��}
t||d|d��}Wntk
�r�Y�qYnX|�|
|f�|d7}�q�t|d�}t|dd��}
|||
f|_ |�!��rP|j�"d�|_|�rr|jt#k�rr|d|j|_|S)zAConstruct a TarInfo object from a 512 byte bytes object.
        rzempty headerztruncated headerzend of file header��zbad checksumr�l�t�|��ii	i)iIiQiYi�r�i�r�r6�i�i�i�)$r2rrr�rs�countr3rtrNrXrKr?r�r�r)r*r'r(rrrr+r,rr�AREGTYPEr�r �GNUTYPE_SPARSErHr0r��boolrr�rstrip�	GNU_TYPES)r?rWr6r7r�objr+r��structsrMr��numbytes�
isextended�origsizer8r8r9�frombuf�sZ
zTarInfo.frombufcCs8|j�t�}|�||j|j�}|j��t|_|�|�S)zOReturn the next TarInfo object from TarFile object
           tarfile.
        )	r�r]r�r`r6r7r�r��_proc_member)r?r�rWr[r8r8r9�fromtarfileszTarInfo.fromtarfilecCsT|jttfkr|�|�S|jtkr,|�|�S|jtttfkrF|�	|�S|�
|�SdS)zYChoose the right processing method depending on
           the type and call it.
        N)rr4r3�
_proc_gnulongrW�_proc_sparser<r>�SOLARIS_XHDTYPE�	_proc_pax�
_proc_builtin)r�r�r8r8r9ras



zTarInfo._proc_membercCsR|j��|_|j}|��s$|jtkr4||�|j�7}||_|�	|j
|j|j�|S)zfProcess a builtin type or an unknown type which
           will be treated as a regular file.
        )
r�r�r�r�r�SUPPORTED_TYPES�_blockr'r��_apply_pax_inforr6r7)r�r�r�r8r8r9rg&szTarInfo._proc_builtincCs�|j�|�|j��}z|�|�}Wntk
r>td��YnX|j|_|jt	krft
||j|j�|_
n|jtkr�t
||j|j�|_|S)zSProcess the blocks that hold a GNU longname
           or longlink member.
        � missing or bad subsequent header)r�r]rir'rbrrur�rr4r?r6r7r�r3r)r�r�rW�nextr8r8r9rc7s

zTarInfo._proc_gnulongc
	Cs�|j\}}}|`|r�|j�t�}d}td�D]n}z0t|||d��}t||d|d��}	Wntk
rzYq�YnX|r�|	r�|�||	f�|d7}q,t|d�}q||_	|j�
�|_|j|�|j
�|_||_
|S)z8Process a GNU sparse header plus extra headers.
        r�r6rTi�)rr�r]r�rHrNr0r�rXr�r�r�rir'r�)
r�r�r\r^r_rWr�rMr�r]r8r8r9rdMs(
zTarInfo._proc_sparsecCs.|j�|�|j��}|jtkr&|j}n
|j��}t�	d|�}|dk	rX|�
d��d�|d<|�d�}|dkrr|j
}nd}t�d�}d}|�||�}|s��q6|��\}	}
t|	�}	|	dkr�td	��||�d
�d|�d�|	d�}|�|
dd|j�}
|
tk�r|�|||j
|j�}n|�|dd|j�}|||
<||	7}q�z|�|�}Wntk
�rbtd��YnXd|k�r||�||�nHd
|k�r�|�|||�n.|�d�dk�r�|�d�dk�r�|�|||�|jttfk�r*|� ||j
|j�|j!|_!d|k�r*|j"}
|�#��s|jt$k�r$|
|�|j�7}
|
|_!|S)zVProcess an extended or global header as described in
           POSIX.1-2008.
        s\d+ hdrcharset=([^\n]+)\nNr#r/�
hdrcharsetZBINARYs(\d+) ([^=]+)=rrGr$rk�GNU.sparse.map�GNU.sparse.sizezGNU.sparse.major�1zGNU.sparse.minorrFr')%r�r]rir'rr>rr�re�search�groupr=rCr6�compile�match�groupsrIrKrgr��_decode_pax_fieldr7�PAX_NAME_FIELDSrbrru�_proc_gnusparse_01�_proc_gnusparse_00�_proc_gnusparse_10r<rerjr�r�r�rh)r�r�rWrrvrnr6Zregexr�r5rKr(rlr�r8r8r9rfish



$	
�
�
�


 
zTarInfo._proc_paxcCshg}t�d|�D]}|�t|�d���qg}t�d|�D]}|�t|�d���q:tt||��|_dS)z?Process a GNU tar extended sparse header, version 0.0.
        s\d+ GNU.sparse.offset=(\d+)\nr#s\d+ GNU.sparse.numbytes=(\d+)\nN)rr�finditerr�rIrt�list�zipr�)r�rlrrWZoffsetsrvr]r8r8r9r{�szTarInfo._proc_gnusparse_00cCs@dd�|d�d�D�}tt|ddd�|ddd���|_dS)z?Process a GNU tar extended sparse header, version 0.1.
        cSsg|]}t|��qSr8)rI)�.0�xr8r8r9�
<listcomp>�sz.TarInfo._proc_gnusparse_01.<locals>.<listcomp>ro�,Nr$r#)rAr~rr�)r�rlrr�r8r8r9rz�szTarInfo._proc_gnusparse_01cCs�d}g}|j�t�}|�dd�\}}t|�}t|�|dkrtd|krT||j�t�7}|�dd�\}}|�t|��q,|j��|_t	t
|ddd�|ddd���|_dS)z?Process a GNU tar extended sparse header, version 1.0.
        NrJr#r$)r�r]r�rArIr2r�r�r�r~rr�)r�rlrr�Zfieldsr�rWZnumberr8r8r9r|�szTarInfo._proc_gnusparse_10c	Cs�|��D]�\}}|dkr&t|d|�q|dkr@t|dt|��q|dkrZt|dt|��q|tkr|tkr�zt||�}Wntk
r�d}YnX|dkr�|�d�}t|||�q|��|_dS)	zoReplace fields with supplemental information from a previous
           pax extended or global header.
        zGNU.sparse.namer%rpr'zGNU.sparse.realsizerr�N)	r$�setattrrI�
PAX_FIELDS�PAX_NUMBER_FIELDSr0rYrr)r�rr6r7rKr(r8r8r9rj�s"

zTarInfo._apply_pax_infocCs4z|�|d�WStk
r.|�||�YSXdS)z1Decode a single field from a pax record.
        rEN)r=�UnicodeDecodeError)r�r(r6Zfallback_encodingZfallback_errorsr8r8r9rx	szTarInfo._decode_pax_fieldcCs"t|t�\}}|r|d7}|tS)z_Round up a byte count by BLOCKSIZE and return it,
           e.g. _block(834) => 1024.
        r#)r\r�)r�rUrbrcr8r8r9riszTarInfo._blockcCs
|jtkS�z4Return True if the Tarinfo object is a regular file.)r�
REGULAR_TYPESr�r8r8r9r�sz
TarInfo.isregcCs|��Sr�)r�r�r8r8r9�isfileszTarInfo.isfilecCs
|jtkS)z!Return True if it is a directory.)rr r�r8r8r9r"sz
TarInfo.isdircCs
|jtkS)z%Return True if it is a symbolic link.)r�SYMTYPEr�r8r8r9r&sz
TarInfo.issymcCs
|jtkS)z!Return True if it is a hard link.)r�LNKTYPEr�r8r8r9r*sz
TarInfo.islnkcCs
|jtkS)z(Return True if it is a character device.)rrDr�r8r8r9�ischr.sz
TarInfo.ischrcCs
|jtkS)z$Return True if it is a block device.)rrEr�r8r8r9�isblk2sz
TarInfo.isblkcCs
|jtkS)zReturn True if it is a FIFO.)r�FIFOTYPEr�r8r8r9�isfifo6szTarInfo.isfifocCs
|jdk	Sr�)r�r�r8r8r9�issparse:szTarInfo.issparsecCs|jtttfkS)zCReturn True if it is one of character device, block device or FIFO.)rrDrEr�r�r8r8r9�isdev=sz
TarInfo.isdev)r�)4rnrorprq�dict�	__slots__r��propertyr%�setterr&rrr�r"rrr)r%r&r'�classmethodr@r/�staticmethodr0rGr2r;r`rbrargrcrdrfr{rzr|rjrxrir�r�rrrr�r�r�r�r�r8r8r8r9rRs��




�
1

)
	

2
>

h	c
@s�eZdZdZdZdZdZdZeZ	e
ZdZe
ZeZdZdfdd	�Zedddefd
d��Zedgdd
��Zedhdd��Zedidd��Zedjdd��Zddddd�Zdd�Zdd�Zdd�Zd d!�Zdkd"d#�Zdldd%�d&d'�Z dmdd(�d)d*�Z!dnd+d,�Z"d-d.�Z#doddd0�d1d2�Z$dpddd0�d4d5�Z%d6d7�Z&d8d9�Z'd:d;�Z(d<d=�Z)d>d?�Z*dqd@dA�Z+dBdC�Z,dDdE�Z-dFdG�Z.dHdI�Z/dJdK�Z0dLdM�Z1dNdO�Z2dPdQ�Z3dRdS�Z4dTdU�Z5drdVdW�Z6dXdY�Z7dsdZd[�Z8d\d]�Z9d^d_�Z:d`da�Z;dbdc�Z<ddde�Z=dS)trz=The TarFile Class provides an interface to tar archives.
    rFr#Nrxr#c
Cs�ddddd�}||krtd��||_|||_|sh|jdkrTtj�|�sTd|_d|_t||j�}d	|_n@|d
kr�t|d�r�t	|j
ttf�r�|j
}t|d�r�|j|_d
|_|r�tj�
|�nd
|_
||_|d
k	r�||_|d
k	r�||_|d
k	r�||_|d
k	r�||_|d
k	�r||_|	|_|
d
k	�r0|jtk�r0|
|_ni|_|d
k	�rF||_|d
k	�rV||_|
|_d	|_g|_d	|_|j��|_i|_z�|jdk�r�d
|_ |�!�|_ |jdk�r2|j�"|j�z|j�#|�}|j�$|�WnXt%k
�r�|j�"|j�Y�q2Yn0t&k
�r,}zt't|���W5d
}~XYnX�q�|jdk�r|d
|_|j�r||j�(|j�)��}|j�*|�|jt+|�7_Wn&|j�s�|j�,�d
|_�YnXd
S)a�Open an (uncompressed) tar archive `name'. `mode' is either 'r' to
           read from an existing archive, 'a' to append data to an existing
           file or 'w' to create a new file overwriting an existing one. `mode'
           defaults to 'r'.
           If `fileobj' is given, it is used for reading or writing data. If it
           can be determined, `mode' is overridden by `fileobj's mode.
           `fileobj' is not closed, when TarFile is closed.
        �rbzr+b�wbZxb�rx�aryr��!mode must be 'r', 'a', 'w' or 'x'r�ryFNr�r�Trx�r�ryr�)-r0r��_moder{r%�exists�	bltn_openr�r�r8r�r:rO�abspathr�rSr��dereference�ignore_zerosr6r7rr�debug�
errorlevel�copybufsizer��members�_loadedr�r��inodes�firstmemberrlr�rbr�rtrrr@rr^r2r�)r�r�r�r�rSr�r�r�r6r7rr�r�r�Zmodes�erWr8r8r9r�^s�
�





"
zTarFile.__init__c

s�|s|std��|dkr��fdd�}t�j|d�D]j}t��j|�}|dk	rV|��}	z||d|f|�WSttfk
r�|dk	r�|�|	�Yq2Yq2Xq2td���nd	|k�r|�d	d
�\}
}|
p�d}
|p�d}|�jkr�t��j|�}ntd|��|||
|f|�Sd
|k�r�|�d
d
�\}
}|
�p.d}
|�p8d}|
dk�rLtd��t	||
|||�}z�||
|f|�}Wn|�
��YnXd|_|S|dk�r��j|||f|�Std��dS)a�Open a tar archive for reading, writing or appending. Return
           an appropriate TarFile class.

           mode:
           'r' or 'r:*' open for reading with transparent compression
           'r:'         open for reading exclusively uncompressed
           'r:gz'       open for reading with gzip compression
           'r:bz2'      open for reading with bzip2 compression
           'r:xz'       open for reading with lzma compression
           'a' or 'a:'  open for appending, creating the file if necessary
           'w' or 'w:'  open for writing without compression
           'w:gz'       open for writing with gzip compression
           'w:bz2'      open for writing with bzip2 compression
           'w:xz'       open for writing with lzma compression

           'x' or 'x:'  create a tarfile exclusively without compression, raise
                        an exception if the file is already created
           'x:gz'       create a gzip compressed tarfile, raise an exception
                        if the file is already created
           'x:bz2'      create a bzip2 compressed tarfile, raise an exception
                        if the file is already created
           'x:xz'       create an lzma compressed tarfile, raise an exception
                        if the file is already created

           'r|*'        open a stream of tar blocks with transparent compression
           'r|'         open an uncompressed stream of tar blocks for reading
           'r|gz'       open a gzip compressed stream of tar blocks
           'r|bz2'      open a bzip2 compressed stream of tar blocks
           'r|xz'       open an lzma compressed stream of tar blocks
           'w|'         open an uncompressed stream for writing
           'w|gz'       open a gzip compressed stream for writing
           'w|bz2'      open a bzip2 compressed stream for writing
           'w|xz'       open an lzma compressed stream for writing
        znothing to open)rx�r:*cs�j|dkS)N�taropen)�	OPEN_METH)r��r?r8r9�not_compressed�sz$TarFile.open.<locals>.not_compressed)�keyNrxz%file could not be opened successfully�:r#r�r��|rwzmode must be 'r' or 'w'Fr�zundiscernible mode)
r0�sortedr�rhr�rrr�rAr�r�r�r�)
r?r�r�r�ra�kwargsr�r��funcZ	saved_pos�filemode�streamr�r8r�r9r�sP%







zTarFile.opencKs |dkrtd��||||f|�S)zCOpen uncompressed tar archive name for reading or writing.
        r�r�)r0)r?r�r�r�r�r8r8r9r�(szTarFile.taropenr�cKs�|dkrtd��zddlm}Wntk
r<td��YnXz|||d||�}Wn.tk
r�|dk	r||dkr|td	���YnXz|j|||f|�}WnBtk
r�|��|dkr�td	���Yn|���YnXd
|_	|S)zkOpen gzip compressed tar archive name for reading or writing.
           Appending is not allowed.
        �rxryr��mode must be 'r', 'w' or 'x'r)�GzipFilezgzip module is not availablerdNrxr�F)
r0Zgzipr�r�rr�rr�r�r�)r?r�r�r��
compresslevelr�r�r�r8r8r9�gzopen0s0zTarFile.gzopenc	Ks�|dkrtd��zddlm}Wntk
r<td��YnX||pF|||d�}z|j|||f|�}WnFttfk
r�|��|dkr�t	d���Yn|���YnXd	|_
|S)
zlOpen bzip2 compressed tar archive name for reading or writing.
           Appending is not allowed.
        r�r�r)�BZ2Filer�)r�rxznot a bzip2 fileF)r0r�r�r�rr�r��EOFErrorr�rr�)r?r�r�r�r�r�r�r�r8r8r9�bz2openQs&zTarFile.bz2openc		Ks�|dkrtd��zddlm}m}Wntk
r@td��YnX||pJ|||d�}z|j|||f|�}WnF|tfk
r�|��|dkr�t	d���Yn|���YnXd	|_
|S)
zkOpen lzma compressed tar archive name for reading or writing.
           Appending is not allowed.
        r�r�r)�LZMAFiler�r�)�presetrxznot an lzma fileF)r0r�r�r�r�rr�r�r�rr�)	r?r�r�r�r�r�r�r�r�r8r8r9�xzopenms&zTarFile.xzopenr�r�r�r�)r�r�r�r�cCs�|jr
dSd|_z`|jdkrn|j�ttd�|jtd7_t	|jt
�\}}|dkrn|j�tt
|�W5|js�|j��XdS)zlClose the TarFile. In write-mode, two finishing zero blocks are
           appended to the archive.
        NTr�r$r)r�r�r�r�r�r^r3r�r�r\�
RECORDSIZE)r�rbrcr8r8r9r��s
z
TarFile.closecCs"|�|�}|dkrtd|��|S)aReturn a TarInfo object for member `name'. If `name' can not be
           found in the archive, KeyError is raised. If a member occurs more
           than once in the archive, its last occurrence is assumed to be the
           most up-to-date version.
        Nzfilename %r not found)�
_getmember�KeyError)r�r�r�r8r8r9�	getmember�s
zTarFile.getmembercCs|��|js|��|jS)z�Return the members of the archive as a list of TarInfo objects. The
           list has the same order as the members in the archive.
        )�_checkr��_loadr�r�r8r8r9�
getmembers�szTarFile.getmemberscCsdd�|��D�S)z�Return the members of the archive as a list of their names. It has
           the same order as the list returned by getmembers().
        cSsg|]
}|j�qSr8r)r�r�r8r8r9r��sz$TarFile.getnames.<locals>.<listcomp>)r�r�r8r8r9�getnames�szTarFile.getnamescCs^|�d�|dk	r|j}|dkr$|}tj�|�\}}|�tjd�}|�d�}|��}||_	|dkr�|j
stt�|�}q�t�|�}nt�
|���}d}|j}t�|�r�|j|jf}	|j
s�|jdkr�|	|jkr�||j|	kr�t}
|j|	}nt}
|	dr�||j|	<nht�|��rt}
nVt�|��r"t}
nDt�|��r>t}
t�|�}n(t�|��rPt}
nt� |��rbt!}
ndS||_||_"|j#|_$|j%|_&|
tk�r�|j'|_(nd|_(|j)|_*|
|_+||_,t-�r�zt-�.|j$�d|_/Wnt0k
�r�YnXt1�rzt1�2|j&�d|_3Wnt0k
�rYnX|
tt!fk�rZt4td��rZt4td��rZt�5|j6�|_7t�8|j6�|_9|S)	a�Create a TarInfo object from the result of os.stat or equivalent
           on an existing file. The file is either named by `name', or
           specified as a file object `fileobj' with a file descriptor. If
           given, `arcname' specifies an alternative name for the file in the
           archive, otherwise, the name is taken from the 'name' attribute of
           'fileobj', or the 'name' argument. The name should be a text
           string.
        �awxNr�r�r#r�major�minor):r�r�r{r%�
splitdriver�r�r�r�r�r��lstat�stat�fstat�fileno�st_mode�S_ISREG�st_ino�st_dev�st_nlinkr�r�r�S_ISDIRr �S_ISFIFOr��S_ISLNKr��readlink�S_ISCHRrD�S_ISBLKrEr��st_uidr)�st_gidr*�st_sizer'�st_mtimer(rr�pwd�getpwuidr+r��grpZgetgrgidr,r�r��st_rdevrr�r)r�r��arcnamer�Zdrvr�ZstatresrZstmd�inoderr8r8r9�
gettarinfo�s�	


��

zTarFile.gettarinfoT)r�cCs*|��|dkr|}|D�]
}|r�|jdkr6td�ntt�|j��td|jpT|j|jp^|jf�|�	�sv|�
�r�tdd|j|jf�ntd|j
�|jdkr�td�ntdt�|j�dd	��t|j|��r�d
nd�|�r|���rtd|j�|���rtd
|j�t�qdS)aPrint a table of contents to sys.stdout. If `verbose' is False, only
           the names of the members are printed. If it is True, an `ls -l'-like
           output is produced. `members' is optional and must be a subset of the
           list returned by getmembers().
        Nz
??????????z%s/%sz%10sz%d,%dz%10dz????-??-?? ??:??:??z%d-%02d-%02d %02d:%02d:%02dr�r�r�z-> zlink to )r�r�rlr�r�r+r)r,r*r�r�rrr'r(r��	localtimer�rrrrrk)r��verboser�r�r8r8r9r~'s8



��

�

zTarFile.list��filterc	Cs6|�d�|dkr|}|jdk	rFtj�|�|jkrF|�dd|�dS|�d|�|�||�}|dkrz|�dd|�dS|dk	r�||�}|dkr�|�dd|�dS|��r�t|d��}|�	||�W5QRXn`|�
��r(|�	|�|�r2tt�|��D]*}|j
tj�||�tj�||�||d	�q�n
|�	|�dS)
a!Add the file `name' to the archive. `name' may be any type of file
           (directory, fifo, symbolic link, etc.). If given, `arcname'
           specifies an alternative name for the file in the archive.
           Directories are added recursively by default. This can be avoided by
           setting `recursive' to False. `filter' is a function
           that expects a TarInfo object argument and returns the changed
           TarInfo object, if it returns None the TarInfo object will be
           excluded from the archive.
        r�Nr$ztarfile: Skipped %rr#ztarfile: Unsupported type %r�tarfile: Excluded %rr�r�)r�r�r{r%r��_dbgr�r�r��addfilerr��listdir�addr�)r�r�r��	recursiver�r��fr8r8r9r�Ms8



�
zTarFile.addcCs�|�d�t�|�}|�|j|j|j�}|j�|�|jt	|�7_|j
}|dk	r�t||j|j|d�t
|jt�\}}|dkr�|j�tt|�|d7}|j|t7_|j�|�dS)aAdd the TarInfo object `tarinfo' to the archive. If `fileobj' is
           given, it should be a binary file, and tarinfo.size bytes are read
           from it and added to the archive. You can create TarInfo objects
           directly, or by using gettarinfo().
        r�N)rarr#)r�rr)rSr6r7r�r^r�r2r�r[r'r\r�r3r�r�)r�r�r�rWrarbrcr8r8r9r��s

zTarFile.addfilec	CsB|dkr�|j}|dkr�tj�d�}|dkr�ztt�}Wntk
rJYnBXddl}|jddd�}|�|�	|�W5QRX|jdddd�}|r�zt
|}Wn&tk
r�td|�d	��d�YnX||_|St
r�t�d
t�tStSt|t�r�td��|St|��r
|Sz
t
|WStk
�r<td|�d	��d�YnXdS)NZ PYTHON_TARFILE_EXTRACTION_FILTERr)�#)Z
interpolationZcomment_prefixesr�r�)Zfallbackzfilter z
 not foundaThe default behavior of tarfile extraction has been changed to disallow common exploits (including CVE-2007-4559). By default, absolute/parent paths are disallowed and some mode bits are cleared. See https://access.redhat.com/articles/7004769 for more details.zrString names are not supported for TarFile.extraction_filter. Use a function such as tarfile.data_filter directly.)�extraction_filterr{�environrCr��_CONFIG_FILENAME�FileNotFoundError�configparserZConfigParserZ	read_file�_NAMED_FILTERSr�r0�_RH_SAFER_DEFAULT�warnings�warn�RuntimeWarningr
r	r8r:�	TypeError�callable)r�r�r��filer�Zconfr8r8r9�_get_filter_function�sZ���	
�

zTarFile._get_filter_function�.)�
numeric_ownerr�cCs�g}|�|�}|dkr|}|D]F}|�|||�}|dkr:q|��rL|�|�|j|||��|d�q|jdd�dd�|D]n}tj�||j	�}	z,|j
||	|d�|�||	�|�||	�Wq|t
k
r�}
z|�|
�W5d}
~
XYq|Xq|dS)a�Extract all members from the archive to the current working
           directory and set owner, modification time and permissions on
           directories afterwards. `path' specifies a different directory
           to extract to. `members' is optional and must be a subset of the
           list returned by getmembers(). If `numeric_owner` is True, only
           the numbers for user/group names are used and not the names.

           The `filter` function will be called on each member just
           before extraction.
           It can return a changed TarInfo or None to skip the member.
           String names of common filters are accepted.
        N��	set_attrsrcSs|jSr�r)r�r8r8r9�<lambda>�r�z$TarFile.extractall.<locals>.<lambda>T)r��reverse)r)r�_get_extract_tarinforr��_extract_one�sortr{r%r�r��chown�utime�chmodr
�_handle_nonfatal_error)r�r%r�rr�Zdirectories�filter_functionrr��dirpathr�r8r8r9�
extractall�s,

�zTarFile.extractallr�cCs4|�|�}|�|||�}|dk	r0|�||||�dS)a�Extract a member from the archive to the current working directory,
           using its full name. Its file information is extracted as accurately
           as possible. `member' may be a filename or a TarInfo object. You can
           specify a different directory using `path'. File attributes (owner,
           mtime, mode) are set unless `set_attrs' is False. If `numeric_owner`
           is True, only the numbers for user/group names are used and not
           the names.

           The `filter` function will be called before extraction.
           It can return a changed TarInfo or None to skip the member.
           String names of common filters are accepted.
        N)rrr)r�rr%rrr�rr�r8r8r9�extract�s
zTarFile.extractc
Cs�t|t�r|�|�}n|}|}z|||�}WnZttfk
r\}z|�|�W5d}~XYn,tk
r�}z|�|�W5d}~XYnX|dkr�|�dd|j	�dS|�
�r�t�|�}tj
�||j�|_|S)z@Get filtered TarInfo (or None) from member, which might be a strNr$r�)r8r:r�r�r��_handle_fatal_errorr
rr�r�rrr{r%r�rr)r�rrr%r�Z
unfilteredr�r8r8r9r	s"

zTarFile._get_extract_tarinfoc
Cs�|�d�z"|j|tj�||j�||d�WnVtk
rX}z|�|�W5d}~XYn,tk
r�}z|�	|�W5d}~XYnXdS)z%Extract from filtered tarinfo to diskrxrN)
r��_extract_memberr{r%r�r�r�rr
r)r�r�r%rrr�r8r8r9r%	s
�
zTarFile._extract_onecCs"|jdkr�n|�dd|�dS)z=Handle non-fatal error (ExtractError) according to errorlevelr#�tarfile: %sN)r�r��r�r�r8r8r9r2	s
zTarFile._handle_nonfatal_errorcCsn|jdkr�n\t|t�rP|jdkr6|�dd|j�qj|�dd|j|jf�n|�ddt|�j|f�dS)z1Handle "fatal" error according to self.errorlevelrNr#rztarfile: %s %rztarfile: %s %s)r�r8r��filenamer��strerrorrrnrr8r8r9r9	s


zTarFile._handle_fatal_errorcCs�|�d�t|t�r |�|�}n|}|��s6|jtkrB|�||�S|��sR|�	�rzt|j
t�rhtd��q~|�
|�|��SndSdS)z�Extract a member from the archive as a file object. `member' may be
           a filename or a TarInfo object. If `member' is a regular file or a
           link, an io.BufferedReader object is returned. Otherwise, None is
           returned.
        rxz'cannot extract (sym)link as file objectN)r�r8r:r�r�rrh�
fileobjectrrr�r�r	�extractfile�_find_link_target)r�rr�r8r8r9rE	s


zTarFile.extractfilecCsT|�d�}|�dtj�}tj�|�}|r>tj�|�s>t�|�|��sN|�	�rh|�
dd|j|jf�n|�
d|j�|�
�r�|�||�n�|��r�|�||�nx|��r�|�||�nb|��s�|��r�|�||�nD|��s�|�	�r�|�||�n&|jtk�r|�||�n|�||�|�rP|�|||�|�	��sP|�||�|�||�dS)z\Extract the TarInfo object tarinfo to a physical
           file called targetpath.
        r�r#z%s -> %sN)rYr�r{r�r%rr��makedirsrrr�r�rr��makefiler�makedirr��makefifor�r��makedev�makelinkrrh�makeunknownrrr)r�r��
targetpathrrZ	upperdirsr8r8r9rd	s4


zTarFile._extract_membercCs@z&|jdkrt�|�nt�|d�Wntk
r:YnXdS)z,Make a directory called targetpath.
        Ni�)r�r{�mkdir�FileExistsError�r�r�r&r8r8r9r!�	s
zTarFile.makedirc	Cs�|j}|�|j�|j}t|d��b}|jdk	rn|jD]"\}}|�|�t|||t|�q4|�|j�|�	�nt|||jt|�W5QRXdS)z'Make a file called targetpath.
        r�N)
r�r�r�r�r�r�r[rr'�truncate)r�r�r&�sourcera�targetr�r'r8r8r9r �	s


zTarFile.makefilecCs"|�||�|�dd|j�dS)zYMake a file from a TarInfo object with an unknown type
           at targetpath.
        r#z9tarfile: Unknown file type %r, extracted as regular file.N)r r�rr)r8r8r9r%�	s�zTarFile.makeunknowncCs"ttd�rt�|�ntd��dS)z'Make a fifo called targetpath.
        �mkfifozfifo not supported by systemN)r�r{r-r
r)r8r8r9r"�	s
zTarFile.makefifocCsjttd�rttd�std��|j}|dkr.d}|��rB|tjO}n
|tjO}t�||t�	|j
|j��dS)z<Make a character or block device called targetpath.
        �mknodr#z'special devices not supported by systemNr�)r�r{r
r�r�r��S_IFBLK�S_IFCHRr.r#rr)r�r�r&r�r8r8r9r#�	s
�zTarFile.makedevcCs�zb|��r0tj�|�r t�|�t�|j|�n0tj�|j�rNt�	|j|�n|�
|�|�|�WnHtk
r�z|�
|�|�|�Wnt
k
r�td��YnXYnXdS)z�Make a (symbolic) link called targetpath. If it cannot be created
          (platform limitation), we try to make a copy of the referenced file
          instead of a link.
        z%unable to resolve link inside archiveN)rr{r%�lexists�unlink�symlinkrr�r�linkrr�symlink_exceptionr�r
r)r8r8r9r$�	s"
��zTarFile.makelinkcCs�ttd�r�t��dkr�|j}|j}|s�ztrB|jrBt�|j�d}Wntk
rXYnXzt	rv|j
rvt	�|j
�d}Wntk
r�YnX|dkr�d}|dkr�d}z4|��r�ttd�r�t�
|||�nt�|||�Wntk
r�td��YnXdS)z�Set owner of targetpath according to tarinfo. If numeric_owner
           is True, use .gid/.uid instead of .gname/.uname. If numeric_owner
           is False, fall back to .gid/.uid when the search based on name
           fails.
        �geteuidrr$Nr;�lchownzcould not change owner)r�r{r6r*r)r�r,Zgetgrnamr�r�r+�getpwnamrr7rr�r
)r�r�r&r�g�ur8r8r9r�	s0

z
TarFile.chowncCsB|jdkrdSzt�||j�Wntk
r<td��YnXdS)zASet file permissions of targetpath according to tarinfo.
        Nzcould not change mode)r�r{rr�r
r)r8r8r9r
s
z
TarFile.chmodcCsV|j}|dkrdSttd�s dSzt�|||f�Wntk
rPtd��YnXdS)zBSet modification time of targetpath according to tarinfo.
        Nrz"could not change modification time)r(r�r{rr�r
)r�r�r&r(r8r8r9r
s
z
TarFile.utimec
Cs�|�d�|jdk	r$|j}d|_|S|j|j��krZ|j�|jd�|j�d�sZtd��d}z|j�	|�}W�q�t
k
r�}z6|jr�|�dd|j|f�|jt
7_WY�q^W5d}~XY�q�tk
�r6}zR|j�r|�dd|j|f�|jt
7_WY� q^n|jdk�r&tt|���W5d}~XYn�tk
�r^|jdk�rZtd��Ynjtk
�r�}z|jdk�r�tt|���W5d}~XYn0tk
�r�}ztt|���W5d}~XYnX�q�q^|dk	�r�|j�|�nd	|_|S)
z�Return the next member of the archive as a TarInfo object, when
           TarFile is opened for reading. Return None if there is no more
           available.
        ZraNr#rYr$z0x%X: %srz
empty fileT)r�r�r�r�r�r�r]rr�rbrtr�r�r�rKr:rrrsrur�r�r�)r��mr�r�r8r8r9rl'
sJ



zTarFile.nextc	Cs�|��}d}|dk	rHz|�|�}Wntk
r:d}YnX|d|�}|rXtj�|�}t|�D]D}|rz|j|jkr`d}q`|r�tj�|j�}n|j}||kr`|Sq`|r�t|��dS)z}Find an archive member by name from bottom to top.
           If tarinfo is given, it is used as the starting point.
        FNT)	r��indexr0r{r%�normpath�reversedr�r�)	r�r�r��	normalizer�Zskippingr<r�member_namer8r8r9r�]
s,

zTarFile._getmembercCs|��}|dkrqqd|_dS)zWRead through the entire archive file and look for readable
           members.
        NT)rlr�r�r8r8r9r��
sz
TarFile._loadcCs:|jrtd|jj��|dk	r6|j|kr6td|j��dS)znCheck if TarFile is still open, and if the operation's mode
           corresponds to TarFile's mode.
        z%s is closedNzbad operation for mode %r)r�r�r�rnr�)r�r�r8r8r9r��
szTarFile._checkcCs`|��r.d�tdtj�|j�|jf��}d}n
|j}|}|j||dd�}|dkr\t	d|��|S)zZFind the target member of a symlink or hardlink member in the
           archive.
        r�NT)r�r?zlinkname %r not found)
rr�r�r{r%rr�rr�r�)r�r�r�limitrr8r8r9r�
s zTarFile._find_link_targetccs�|jr|jEdHdSd}|jdk	r:|��}|d7}|V|t|j�krT|j|}n"|jsr|��}|svd|_dSndS|d7}|Vq:dS)z$Provide an iterator object.
        Nrr#T)r�r�r�rlr2)r�r<r�r8r8r9�__iter__�
s$
zTarFile.__iter__cCs||jkrt|tjd�dS)z.Write debugging output to sys.stderr.
        �rN)r�rkri�stderr)r��level�msgr8r8r9r��
s
zTarFile._dbgcCs|��|Sr�)r�r�r8r8r9�	__enter__�
szTarFile.__enter__cCs,|dkr|��n|js"|j��d|_dSr�)r�r�r�r�)r�rr(�	tracebackr8r8r9�__exit__�
s


zTarFile.__exit__)
NrxNNNNNNr#NNNN)rxN)rxNr�)rxNr�)rxNN)NNN)T)NT)N)rN)r�T)TF)NF)N)>rnrorprqr�r�r�r�rrSrr6r7rr�r�rr�r�r�r�rr�r�r�r�r�r�r�r�r�r�r~r�r�rrrrrrrrrr!r r%r"r#r$rrrrlr�r�r�rrBr�rGrIr8r8r8r9rBs��
oZ �


c&3
5�-�
�
1!
6
(

	cCs2zt|�}|��WdStk
r,YdSXdS)zfReturn True if name points to a tar archive that we
       are able to handle, else return False.
    TFN)rr�r)r�r�r8r8r9r�
sc	Csddl}d}|j|d�}|jdddddd	�|jd
dtdd
�|jdd�}|jddddd�|jdddddd�|jdddddd�|jdd dd!d�|��}|jr�|jdkr�|�d"d#�|j	dk	�r4|j	}t
|��rt|d$�� }|��t
|��tjd%�W5QRX|j�r0t
d&�|��n|�d"d'�|���n�|jdk	�r�|j}t
|��rxt�|d(��}|j|jd)�W5QRXn|�d"d'�|���nv|jdk	�rbt|j�d"k�r�|jd}tj}n,t|j�d*k�r�|j\}}n|�d"|���t
|��rNt�|d(��}|j||jd+�W5QRX|j�r`|d,k�r8d-�|�}	nd.�||�}	t
|	�n|�d"d'�|��n�|jdk	�r|j�d�}
tj�|
�\}}d/d/d0d0d1d1d1d1d2�}
||
k�r�d3|
|nd4}|j}t�|
|��}|D]}|�|��q�W5QRX|j�rt
d5�|
��dS)6Nrz3A simple command-line interface for tarfile module.)�descriptionz-vz	--verbose�
store_trueFzVerbose output)�action�default�helpz--filterz<filtername>zFilter for extraction)�metavar�choicesrNT)Zrequiredz-lz--list�	<tarfile>zShow listing of a tarfile)rOrNz-ez	--extract�+)rQz<output_dir>zExtract tarfile into target dir)�nargsrOrNz-cz--create)z<name>z<file>zCreate tarfile from sourcesz-tz--testzTest if a tarfile is validr#z&--filter is only valid for extraction
rxrCz{!r} is a tar archive.z{!r} is not a tar archive.
r�)r�r$)r%r�rz{!r} file is extracted.z+{!r} file is extracted into {!r} directory.r�r�r�)r�z.tgzz.xzz.txzz.bz2z.tbzz.tbz2z.tb2zw:ryz{!r} file created.)�argparse�ArgumentParser�add_argumentr�Zadd_mutually_exclusive_group�
parse_argsr�r�exitZtestrrr�rkrirDr�rSr~rr2r{�curdirZformat_helprZcreate�popr%�splitextr�)rTrJ�parserrt�argsr_r�ZtfrYrFZtar_name�_ZextZcompressionsZtar_modeZ	tar_files�	file_namer8r8r9�main�
s���
�
�
�
�




�
�
r`�__main__)T)mrq�version�
__author__�__credits__�builtinsrr�rir{r�rZr�r�rVrrrr�r�r�r��AttributeError�NotImplementedErrorr5r��	NameError�__all__r�r�r3r�r�r1r,r.r-rBrrVr�r�rDrEr r�ZCONTTYPEr4r3rWr<r>rer
rrrrhr�rZr�ryr9rIr�r�r�getfilesystemencodingr:r?rNrTrXr[rl�	Exceptionrr
rrr	rrrrsrtrKrurvr��objectr�r��BufferedReaderr�r�r�r�r�r�r�rr	r
rr�rrrrr`rnr8r8r8r9�<module>s<


�����
sh

?�u)_
__pycache__/fractions.cpython-38.pyc000064400000044465151153537600013417 0ustar00U

e5d	_�@s�dZddlmZddlZddlZddlZddlZddlZddgZdd�Z	dd�Z
ejjZ
ejjZe�d	ejejB�ZGd
d�dej�ZdS)z+Fraction, infinite-precision, real numbers.���DecimalN�Fraction�gcdcCsfddl}|�dtd�t|�tkr2t|�kr\nn&|p<|dkrPt�||�St�||�St||�S)z�Calculate the Greatest Common Divisor of a and b.

    Unless b==0, the result will have the same sign as b (so that when
    b is divided by it, the result comes out positive).
    rNz6fractions.gcd() is deprecated. Use math.gcd() instead.�)�warnings�warn�DeprecationWarning�type�int�mathr�_gcd)�a�br�r�!/usr/lib64/python3.8/fractions.pyrs� cCs|r|||}}q|S�Nr�rrrrrr
 sr
aC
    \A\s*                      # optional whitespace at the start, then
    (?P<sign>[-+]?)            # an optional sign, then
    (?=\d|\.\d)                # lookahead for digit or .digit
    (?P<num>\d*)               # numerator (possibly empty)
    (?:                        # followed by
       (?:/(?P<denom>\d+))?    # an optional denominator
    |                          # or
       (?:\.(?P<decimal>\d*))? # an optional fractional part
       (?:E(?P<exp>[-+]?\d+))? # and optional exponent
    )
    \s*\Z                      # and optional whitespace to finish
cs�eZdZdZdZdRdd��fdd�Zed	d
��Zedd��Zd
d�Z	dSdd�Z
edd��Zedd��Z
dd�Zdd�Zdd�Zdd�Zeeej�\ZZdd�Zeeej�\ZZd d!�Zeeej�\ZZd"d#�Zeeej�\Z Z!d$d%�Z"ee"ej#�\Z$Z%d&d'�Z&ee&e'�\Z(Z)d(d)�Z*ee*ej+�\Z,Z-d*d+�Z.d,d-�Z/d.d/�Z0d0d1�Z1d2d3�Z2d4d5�Z3d6d7�Z4d8d9�Z5dTd:d;�Z6d<d=�Z7d>d?�Z8d@dA�Z9dBdC�Z:dDdE�Z;dFdG�Z<dHdI�Z=dJdK�Z>dLdM�Z?dNdO�Z@dPdQ�ZA�ZBS)Ura]This class implements rational numbers.

    In the two-argument form of the constructor, Fraction(8, 6) will
    produce a rational number equivalent to 4/3. Both arguments must
    be Rational. The numerator defaults to 0 and the denominator
    defaults to 1 so that Fraction(3) == 3 and Fraction() == 0.

    Fractions can also be constructed from:

      - numeric strings similar to those accepted by the
        float constructor (for example, '-2.3' or '1e10')

      - strings of the form '123/456'

      - float and Decimal instances

      - other Rational instances (including integers)

    ��
_numerator�_denominatorrNT��
_normalizecsRtt|��|�}|dk�rdt|�tkr6||_d|_|St|tj	�rV|j
|_|j|_|St|tt
f�rx|��\|_|_|St|t��rZt�|�}|dkr�td|��t|�d�p�d�}|�d�}|r�t|�}nvd}|�d�}|�rdt|�}||t|�}||9}|�d	�}	|	�rBt|	�}	|	d
k�r4|d|	9}n|d|	9}|�d�dk�rb|}ntd
��nft|�tk�r�t|�k�r�nnn@t|tj	��r�t|tj	��r�|j
|j|j
|j}}ntd��|d
k�r�td|��|�rBt|�tk�rt|�k�r(nnt�||�}
|d
k�r2|
}
n
t||�}
||
}||
}||_||_|S)a�Constructs a Rational.

        Takes a string like '3/2' or '1.5', another Rational instance, a
        numerator/denominator pair, or a float.

        Examples
        --------

        >>> Fraction(10, -8)
        Fraction(-5, 4)
        >>> Fraction(Fraction(1, 7), 5)
        Fraction(1, 35)
        >>> Fraction(Fraction(1, 7), Fraction(2, 3))
        Fraction(3, 14)
        >>> Fraction('314')
        Fraction(314, 1)
        >>> Fraction('-35/4')
        Fraction(-35, 4)
        >>> Fraction('3.1415') # conversion from numeric string
        Fraction(6283, 2000)
        >>> Fraction('-47e-2') # string may include a decimal exponent
        Fraction(-47, 100)
        >>> Fraction(1.47)  # direct construction from float (exact conversion)
        Fraction(6620291452234629, 4503599627370496)
        >>> Fraction(2.25)
        Fraction(9, 4)
        >>> Fraction(Decimal('1.47'))
        Fraction(147, 100)

        N�z Invalid literal for Fraction: %rZnum�0�denom�decimal�
�exprZsign�-z2argument should be a string or a Rational instancez+both arguments should be Rational instanceszFraction(%s, 0))�superr�__new__r
rrr�
isinstance�numbers�Rational�	numerator�denominator�floatr�as_integer_ratio�str�_RATIONAL_FORMAT�match�
ValueError�group�len�	TypeError�ZeroDivisionErrorrrr
)�clsr%r&r�self�mrrZscaler�g��	__class__rrr!Tsx

�





$
�

�
$

zFraction.__new__cCsDt|tj�r||�St|t�s8td|j|t|�jf��||���S)z�Converts a finite float to a rational number, exactly.

        Beware that Fraction.from_float(0.3) != Fraction(3, 10).

        z.%s.from_float() only takes floats, not %r (%s))r"r#�Integralr'r/�__name__r
r()r1�frrr�
from_float�s
�zFraction.from_floatcCsVddlm}t|tj�r&|t|��}n$t||�sJtd|j|t|�jf��||�	��S)zAConverts a finite Decimal instance to a rational number, exactly.rrz2%s.from_decimal() only takes Decimals, not %r (%s))
rrr"r#r7rr/r8r
r()r1Zdecrrrr�from_decimal�s
��zFraction.from_decimalcCs|j|jfS)z�Return the integer ratio as a tuple.

        Return a tuple of two integers, whose ratio is equal to the
        Fraction and with a positive denominator.
        r�r2rrrr(�szFraction.as_integer_ratio�@Bc
Cs�|dkrtd��|j|kr"t|�Sd\}}}}|j|j}}||}|||}	|	|krZq�||||||	f\}}}}||||}}q<|||}
t||
|||
|�}t||�}t||�t||�kr�|S|SdS)aWClosest Fraction to self with denominator at most max_denominator.

        >>> Fraction('3.141592653589793').limit_denominator(10)
        Fraction(22, 7)
        >>> Fraction('3.141592653589793').limit_denominator(100)
        Fraction(311, 99)
        >>> Fraction(4321, 8765).limit_denominator(10000)
        Fraction(4321, 8765)

        rz$max_denominator should be at least 1)rrrrN)r,rrr�abs)
r2Zmax_denominatorZp0Zq0Zp1Zq1�n�drZq2�kZbound1Zbound2rrr�limit_denominator�s$ 

zFraction.limit_denominatorcCs|jSr)r�rrrrr%szFraction.numeratorcCs|jSr)rrCrrrr&szFraction.denominatorcCsd|jj|j|jfS)z
repr(self)z
%s(%s, %s))r6r8rrr<rrr�__repr__"s�zFraction.__repr__cCs(|jdkrt|j�Sd|j|jfSdS)z	str(self)rz%s/%sN)rr)rr<rrr�__str__'s

zFraction.__str__csT��fdd�}d�jd|_�j|_��fdd�}d�jd|_�j|_||fS)a�Generates forward and reverse operators given a purely-rational
        operator and a function from the operator module.

        Use this like:
        __op__, __rop__ = _operator_fallbacks(just_rational_op, operator.op)

        In general, we want to implement the arithmetic operations so
        that mixed-mode operations either call an implementation whose
        author knew about the types of both arguments, or convert both
        to the nearest built in type and do the operation there. In
        Fraction, that means that we define __add__ and __radd__ as:

            def __add__(self, other):
                # Both types have numerators/denominator attributes,
                # so do the operation directly
                if isinstance(other, (int, Fraction)):
                    return Fraction(self.numerator * other.denominator +
                                    other.numerator * self.denominator,
                                    self.denominator * other.denominator)
                # float and complex don't have those operations, but we
                # know about those types, so special case them.
                elif isinstance(other, float):
                    return float(self) + other
                elif isinstance(other, complex):
                    return complex(self) + other
                # Let the other type take over.
                return NotImplemented

            def __radd__(self, other):
                # radd handles more types than add because there's
                # nothing left to fall back to.
                if isinstance(other, numbers.Rational):
                    return Fraction(self.numerator * other.denominator +
                                    other.numerator * self.denominator,
                                    self.denominator * other.denominator)
                elif isinstance(other, Real):
                    return float(other) + float(self)
                elif isinstance(other, Complex):
                    return complex(other) + complex(self)
                return NotImplemented


        There are 5 different cases for a mixed-type addition on
        Fraction. I'll refer to all of the above code that doesn't
        refer to Fraction, float, or complex as "boilerplate". 'r'
        will be an instance of Fraction, which is a subtype of
        Rational (r : Fraction <: Rational), and b : B <:
        Complex. The first three involve 'r + b':

            1. If B <: Fraction, int, float, or complex, we handle
               that specially, and all is well.
            2. If Fraction falls back to the boilerplate code, and it
               were to return a value from __add__, we'd miss the
               possibility that B defines a more intelligent __radd__,
               so the boilerplate should return NotImplemented from
               __add__. In particular, we don't handle Rational
               here, even though we could get an exact answer, in case
               the other type wants to do something special.
            3. If B <: Fraction, Python tries B.__radd__ before
               Fraction.__add__. This is ok, because it was
               implemented with knowledge of Fraction, so it can
               handle those instances before delegating to Real or
               Complex.

        The next two situations describe 'b + r'. We assume that b
        didn't know about Fraction in its implementation, and that it
        uses similar boilerplate code:

            4. If B <: Rational, then __radd_ converts both to the
               builtin rational type (hey look, that's us) and
               proceeds.
            5. Otherwise, __radd__ tries to find the nearest common
               base ABC, and fall back to its builtin type. Since this
               class doesn't subclass a concrete type, there's no
               implementation to fall back to, so we need to try as
               hard as possible to return an actual value, or the user
               will get a TypeError.

        csPt|ttf�r�||�St|t�r0�t|�|�St|t�rH�t|�|�StSdSr)r"rrr'�complex�NotImplementedr��fallback_operator�monomorphic_operatorrr�forward~s


z-Fraction._operator_fallbacks.<locals>.forward�__csZt|tj�r�||�St|tj�r4�t|�t|��St|tj�rR�t|�t|��StSdSr)r"r#r$ZRealr'�ComplexrFrG�rrrHrr�reverse�s
z-Fraction._operator_fallbacks.<locals>.reverseZ__r)r8�__doc__)rJrIrKrOrrHr�_operator_fallbacks.sP	
zFraction._operator_fallbackscCs,|j|j}}t|j||j|||�S)za + b�r&rr%�rr�da�dbrrr�_add�s�z
Fraction._addcCs,|j|j}}t|j||j|||�S)za - brRrSrrr�_sub�s�z
Fraction._subcCst|j|j|j|j�S)za * b�rr%r&rrrr�_mul�sz
Fraction._mulcCst|j|j|j|j�S)za / brXrrrr�_div�s
�z
Fraction._divcCs|j|j|j|jS)za // b�r%r&rrrr�	_floordiv�szFraction._floordivcCs:|j|j}}t|j|||j�\}}|t|||�fS)z(a // b, a % b))r&�divmodr%r)rrrTrUZdivZn_modrrr�_divmod�szFraction._divmodcCs,|j|j}}t|j||j|||�S)za % brRrSrrr�_mod�sz
Fraction._modcCs�t|tj�r�|jdkr�|j}|dkr>t|j||j|dd�S|jdkrft|j||j|dd�St|j||j|dd�Sq�t|�t|�Snt|�|SdS)z�a ** b

        If b is not an integer, the result will be a float or complex
        since roots are generally irrational. If b is an integer, the
        result will be rational.

        rrFrN)	r"r#r$r&r%rrrr')rrZpowerrrr�__pow__�s&

�

��zFraction.__pow__cCs\|jdkr|jdkr||jSt|tj�r<t|j|j�|S|jdkrP||jS|t|�S)za ** brr)	rrr"r#r$rr%r&r'rNrrr�__rpow__�s


zFraction.__rpow__cCst|j|jdd�S)z++a: Coerces a subclass instance to FractionFr�rrrrCrrr�__pos__�szFraction.__pos__cCst|j|jdd�S)z-aFrrbrCrrr�__neg__�szFraction.__neg__cCstt|j�|jdd�S)zabs(a)Fr)rr>rrrCrrr�__abs__�szFraction.__abs__cCs*|jdkr|j|jS|j|jSdS)ztrunc(a)rNrrCrrr�	__trunc__s
zFraction.__trunc__cCs|j|jS)z
math.floor(a)r[rCrrr�	__floor__
szFraction.__floor__cCs|j|jS)zmath.ceil(a)r[rCrrr�__ceil__szFraction.__ceil__cCs�|dkrZt|j|j�\}}|d|jkr,|S|d|jkrB|dS|ddkrR|S|dSdt|�}|dkr�tt||�|�Stt||�|�SdS)z?round(self, ndigits)

        Rounds half toward even.
        Nrrrr)r]r%r&r>r�round)r2ZndigitsZfloorZ	remainder�shiftrrr�	__round__szFraction.__round__cCsPt|jtdt�}|st}nt|j�|t}|dkr:|n|}|dkrLdS|S)z
hash(self)rr������)�powr�_PyHASH_MODULUS�_PyHASH_INFr>r)r2ZdinvZhash_�resultrrr�__hash__,szFraction.__hash__cCs�t|�tkr |j|ko|jdkSt|tj�rD|j|jkoB|j|jkSt|tj	�r`|j
dkr`|j}t|t�r�t
�|�s~t
�|�r�d|kS||�|�kSntSdS)za == brr�N)r
rrrr"r#r$r%r&rM�imag�realr'r�isnan�isinfr:rGrrrr�__eq__Bs
�
zFraction.__eq__cCsht|tj�r&||j|j|j|j�St|t�r`t�	|�sDt�
|�rN|d|�S|||�|��SntSdS)acHelper for comparison operators, for internal use only.

        Implement comparison between a Rational instance `self`, and
        either another Rational instance or a float `other`.  If
        `other` is not a Rational instance or a float, return
        NotImplemented. `op` should be one of the six standard
        comparison operators.

        rsN)
r"r#r$rr&rr%r'rrvrwr:rG)r2�other�oprrr�_richcmpWs
�

zFraction._richcmpcCs|�|tj�S)za < b)r{�operator�ltrrrr�__lt__mszFraction.__lt__cCs|�|tj�S)za > b)r{r|�gtrrrr�__gt__qszFraction.__gt__cCs|�|tj�S)za <= b)r{r|�lerrrr�__le__uszFraction.__le__cCs|�|tj�S)za >= b)r{r|�gerrrr�__ge__yszFraction.__ge__cCs
t|j�S)za != 0)�boolrrCrrr�__bool__}szFraction.__bool__cCs|jt|�ffSr)r6r)r<rrr�
__reduce__�szFraction.__reduce__cCs t|�tkr|S|�|j|j�Sr�r
rr6rrr<rrr�__copy__�szFraction.__copy__cCs t|�tkr|S|�|j|j�Srr�)r2Zmemorrr�__deepcopy__�szFraction.__deepcopy__)rN)r=)N)Cr8�
__module__�__qualname__rP�	__slots__r!�classmethodr:r;r(rB�propertyr%r&rDrErQrVr|�add�__add__�__radd__rW�sub�__sub__�__rsub__rY�mul�__mul__�__rmul__rZ�truediv�__truediv__�__rtruediv__r\�floordiv�__floordiv__�
__rfloordiv__r^r]�
__divmod__�__rdivmod__r_�mod�__mod__�__rmod__r`rarcrdrerfrgrhrkrrrxr{r~r�r�r�r�r�r�r��
__classcell__rrr5rr<sdm



7

k
)rPrrrr#r|�re�sys�__all__rr
�	hash_info�modulusro�infrp�compile�VERBOSE�
IGNORECASEr*r$rrrrr�<module>s
�__pycache__/shutil.cpython-38.pyc000064400000111044151153537600012723 0ustar00U

e5d1��@s�dZddlZddlZddlZddlZddlZddlZzddlZ[dZWne	k
r^dZYnXzddl
Z
[
dZWne	k
r�dZYnXzddlZ[dZ
Wne	k
r�dZ
YnXzddlmZWne	k
r�dZYnXzddlmZWne	k
�rdZYnXejdkZdZZejdk�r6ddlZne�rDddlZe�rNd	nd
Zeed��ohej�d�ae�oxeed
�ZdZdddddddddddddddddd d!d"d#d$d%d&d'gZGd(d�de�ZGd)d'�d'e�Z Gd*d�de�Z!Gd+d�de�Z"Gd,d-�d-e�Z#Gd.d/�d/e$�Z%Gd0d1�d1e$�Z&d2d3�Z'd4d5�Z(efd6d7�Z)d�d8d�Z*d9d:�Z+d;d<�Z,d=d>�Z-dd?�d@d�Z.dd?�dAd�Z/eedB��r�dd?�dCdD�Z0ndEdD�Z0dd?�dFd�Z1dd?�dGd�Z2dd?�dHd�Z3dId#�Z4d�dJdK�Z5dde3ddfdLd�Z6eej7dM��rdNdO�Z8dPdQ�Z9ndRdO�Z8dSdQ�Z9dTdU�Z:dVdW�Z;ej<ejej=ej>hej?k�ofej@ejAk�ofejejBkZCd�dXd�ZDeCeD_EdYdZ�ZFe3fd[d�ZGd\d]�ZHd^d_�ZId`da�ZJdbdc�ZKd�dedf�ZLd�dgdh�ZMdieLdjgdkfiZNe�r�eLdlgdmfeNdn<eMgdofeNdp<e�r
eLdqgdrfeNds<e
�r eLdtgdufeNdv<dwd�ZOd�dyd�ZPdzd�ZQd�d{d�ZRd|d�ZSd}d~�ZTd�dd �ZUd�d!�ZVd�d��ZWd�d��ZXdd��d�d��ZYd�geYgdkfd�geXgdofd��ZZe�r�d�d�geYgdmfeZdn<e�r�d�d�geYgdrfeZds<e
�r�d�d�geYgdufeZdv<d�d��Z[d�dd��d�d"�Z\eed���rLe�]d��e�^d�d��Z_d�e_j`_d�e_ja_d�e_jb_d�d��Zcn$e�rpe�]d��e�^d�d��Z_d�d��Zcd�d�d$�Zdd�d�d&�Zed�d��ZfejgejhBdfd�d%�ZidS)�z�Utility functions for copying and archiving files and directory trees.

XXX The functions here don't copy the resource fork or other metadata on Mac.

�NTF)�getpwnam)�getgrnam�nt�posixii�sendfileZlinux�
_fcopyfilez%.COM;.EXE;.BAT;.CMD;.VBS;.JS;.WS;.MSC�copyfileobj�copyfile�copymode�copystat�copy�copy2�copytree�move�rmtree�Error�SpecialFileError�	ExecError�make_archive�get_archive_formats�register_archive_format�unregister_archive_format�get_unpack_formats�register_unpack_format�unregister_unpack_format�unpack_archive�ignore_patterns�chown�which�get_terminal_size�
SameFileErrorc@seZdZdS)rN)�__name__�
__module__�__qualname__�r$r$�/usr/lib64/python3.8/shutil.pyrEsc@seZdZdZdS)r z5Raised when source and destination are the same file.N�r!r"r#�__doc__r$r$r$r%r Hsc@seZdZdZdS)rz|Raised when trying to do a kind of operation (e.g. copying) which is
    not supported on a special file (e.g. a named pipe)Nr&r$r$r$r%rKsc@seZdZdZdS)rz+Raised when a command could not be executedNr&r$r$r$r%rOsc@seZdZdZdS)�	ReadErrorz%Raised when an archive cannot be readNr&r$r$r$r%r(Rsr(c@seZdZdZdS)�
RegistryErrorzVRaised when a registry operation with the archiving
    and unpacking registries failsNr&r$r$r$r%r)Usr)c@seZdZdZdS)�_GiveupOnFastCopyzuRaised as a signal to fallback on using raw read()/write()
    file copy when fast-copy functions fail to do so.
    Nr&r$r$r$r%r*Ysr*c
Cs�z|��}|��}Wn*tk
r>}zt|��W5d}~XYnXzt�|||�WnTtk
r�}z6|j|_|j|_|j	t	j
t	jhkr�t|��n|d�W5d}~XYnXdS)zhCopy a regular file content or metadata by using high-performance
    fcopyfile(3) syscall (macOS).
    N)�fileno�	Exceptionr*rr�OSError�name�filename�	filename2�errno�EINVAL�ENOTSUP)�fsrc�fdst�flags�infd�outfd�errr$r$r%�_fastcopy_fcopyfile^s
r:c
CsDz|��}|��}Wn*tk
r>}zt|��W5d}~XYnXztt�|�jd�}Wntk
rnd}YnXtj	dkr�t
|d�}d}zt�||||�}Wn�tk
�r&}zj|j|_
|j|_|jtjkr�dat|��|jtjkr�|d�|dk�rt�|dtj�dk�rt|��|�W5d}~XYq�X|dk�r6�q@||7}q�dS)z�Copy data from one regular mmap-like fd to another by using
    high-performance sendfile(2) syscall.
    This should work on Linux >= 2.6.33 only.
    Ni�ili@rF)r+r,r*�max�os�fstat�st_sizer-�sys�maxsize�minrr.r/r0r1ZENOTSOCK�_USE_CP_SENDFILEZENOSPC�lseek�SEEK_CUR)r4r5r7r8r9Z	blocksize�offsetZsentr$r$r%�_fastcopy_sendfilers8


 
rFc
Csn|j}|j}tt|���L}||�}|s*q`q||krV|d|��}|�|�W5QRXq||�qW5QRXdS)z�readinto()/memoryview() based variant of copyfileobj().
    *fsrc* must support readinto() method and both files must be
    open in binary mode.
    N)�readinto�write�
memoryview�	bytearray)r4r5�lengthZ
fsrc_readinto�
fdst_writeZmv�nZsmvr$r$r%�_copyfileobj_readinto�srNcCs0|st}|j}|j}||�}|s"q,||�qdS)z=copy data from file-like object fsrc to file-like object fdstN)�COPY_BUFSIZE�readrH)r4r5rKZ	fsrc_readrLZbufr$r$r%r�scCs�t|tj�rJttjd�rJztj�|��t�|��WStk
rHYdSXttjd�r~ztj�||�WStk
r|YdSXtj�	tj�
|��tj�	tj�
|��kS)N�samestatF�samefile)�
isinstancer<�DirEntry�hasattr�pathrQ�statr-rR�normcase�abspath��src�dstr$r$r%�	_samefile�s�r]cCst|tj�r|��St�|�S�N)rSr<rTrW��fnr$r$r%�_stat�sracCs t|tj�r|��Stj�|�Sr^)rSr<rT�
is_symlinkrV�islinkr_r$r$r%�_islink�srd��follow_symlinksc	Cs�t�d||�t||�r(td�||���d}t||g�D]j\}}zt|�}Wntk
r`Yq8Xt�	|j
�r�t|tj
�r�|jn|}td|��tr8|dkr8|j}q8|s�t|�r�t�t�|�|��n
t|d����}t|d���}t�r,z,t||tj�|WW5QR�W5QR�Stk
�r(YnXn�t�rtz(t||�|WW5QR�W5QR�Stk
�rpYnXn>t�r�|dk�r�t||t|t��|W5QR�W5QR�St ||�W5QRXW5QRX|S)z�Copy data from src to dst in the most efficient way possible.

    If follow_symlinks is not set and src is a symbolic link, a new
    symlink will be created instead of copying the file it points to.

    zshutil.copyfilez{!r} and {!r} are the same filerz`%s` is a named pipe�rb�wb)!r?�auditr]r �format�	enumeraterar-rW�S_ISFIFO�st_moderSr<rTrVr�_WINDOWSr>rd�symlink�readlink�open�_HAS_FCOPYFILEr:rZ_COPYFILE_DATAr*rBrFrNrArOr)	r[r\rf�	file_size�ir`�str4r5r$r$r%r	�sD

cCspt�d||�|sFt|�rFtj�|�rFttd�r@tjtj}}qRdSnt	tj
}}||�}||t�|j
��dS)z�Copy mode bits from src to dst.

    If follow_symlinks is not set, symlinks aren't followed if and only
    if both `src` and `dst` are symlinks.  If `lchmod` isn't available
    (e.g. Linux) this method does nothing.

    zshutil.copymode�lchmodN)r?rirdr<rVrcrU�lstatrvra�chmodrW�S_IMODErm)r[r\rfZ	stat_funcZ
chmod_funcrur$r$r%r
!s
�	listxattrcCs�ztj||d�}Wn@tk
rR}z"|jtjtjtjfkr<�WY�dSd}~XYnX|D]j}z&tj|||d�}tj||||d�WqXtk
r�}z |jtj	tjtjtjfkr��W5d}~XYqXXqXdS)z�Copy extended filesystem attributes from `src` to `dst`.

        Overwrite existing attributes.

        If `follow_symlinks` is false, symlinks won't be followed.

        reN)
r<rzr-r1r3ZENODATAr2�getxattr�setxattrZEPERM)r[r\rf�names�er.�valuer$r$r%�
_copyxattr7s	�r�cOsdSr^r$)�args�kwargsr$r$r%r�Osc	
s`t�d||�ddd�dd��|p6t|�o4tj�|�}|rJ�fdd�}n�fdd�}t|tj�rp|j|d	�}n|d
�||d	�}t�	|j
�}|d�||j|jf|d�t
|||d	�z|d�|||d	�Wntk
r�YnXt|d
��r\z|d�||j|d	�WnVtk
�rZ}z6dD]*}tt|��r|jtt|�k�r�qJ�q�W5d}~XYnXdS)a�Copy file metadata

    Copy the permission bits, last access time, last modification time, and
    flags from `src` to `dst`. On Linux, copystat() also copies the "extended
    attributes" where possible. The file contents, owner, and group are
    unaffected. `src` and `dst` are path-like objects or path names given as
    strings.

    If the optional flag `follow_symlinks` is not set, symlinks aren't
    followed if and only if both `src` and `dst` are symlinks.
    zshutil.copystatN)�nsrfcWsdSr^r$)r�rfr�r$r$r%�_nop`szcopystat.<locals>._nopcstt|��Sr^)�getattrr<�r.�r�r$r%�lookupgszcopystat.<locals>.lookupcstt|��}|tjkr|S�Sr^)r�r<�supports_follow_symlinks)r.r`r�r$r%r�ls
rerW�utimerx�st_flagsZchflags)Z
EOPNOTSUPPr3)r?rirdr<rVrcrSrTrWryrm�st_atime_ns�st_mtime_nsr��NotImplementedErrorrUr�r-r1r�)	r[r\rfZfollowr�ru�mode�whyr9r$r�r%rRs4�
cCsBtj�|�r"tj�|tj�|��}t|||d�t|||d�|S)a3Copy data and mode bits ("cp src dst"). Return the file's destination.

    The destination may be a directory.

    If follow_symlinks is false, symlinks won't be followed. This
    resembles GNU's "cp -P src dst".

    If source and destination are the same file, a SameFileError will be
    raised.

    re)r<rV�isdir�join�basenamer	r
�r[r\rfr$r$r%r�s
cCsBtj�|�r"tj�|tj�|��}t|||d�t|||d�|S)a0Copy data and metadata. Return the file's destination.

    Metadata is copied with copystat(). Please see the copystat function
    for more information.

    The destination may be a directory.

    If follow_symlinks is false, symlinks won't be followed. This
    resembles GNU's "cp -P src dst".
    re)r<rVr�r�r�r	rr�r$r$r%r
�s
cs�fdd�}|S)z�Function that can be used as copytree() ignore parameter.

    Patterns is a sequence of glob-style patterns
    that are used to exclude filescs(g}�D]}|�t�||��qt|�Sr^)�extend�fnmatch�filter�set)rVr}�
ignored_names�pattern��patternsr$r%�_ignore_patterns�sz)ignore_patterns.<locals>._ignore_patternsr$)r�r�r$r�r%r�scCs>|dk	r$|t�|�dd�|D��}nt�}tj||d�g}	|tkpJ|tk}
|D�]~}|j|krbqPtj�||j�}tj�||j�}
|
r�|n|}z�|�	�}|r�tjdkr�|j
dd�}|jt
jkr�d}|�r8t�
|�}|r�t�||
�t||
|d�nBtj�|��s|�rWqP|���r,t||
||||d�n
|||
�n*|���rXt||
||||d�n
|||
�WqPtk
�r�}z|	�|jd�W5d}~XYqPtk
�r�}z|	�||
t|�f�W5d}~XYqPXqPzt||�WnJtk
�r*}z*t|d	d�dk�r|	�||t|�f�W5d}~XYnX|	�r:t|	��|S)
NcSsg|]
}|j�qSr$r�)�.0�xr$r$r%�
<listcomp>�sz_copytree.<locals>.<listcomp>)�exist_okrFre)�
dirs_exist_okrZwinerror)r<�fspathr��makedirsr
rr.rVr�rbrW�st_reparse_tag�IO_REPARSE_TAG_MOUNT_POINTrpror�exists�is_dirrrr�r�r-�append�strr�)�entriesr[r\�symlinks�ignore�
copy_function�ignore_dangling_symlinksr�r��errorsZuse_srcentryZsrcentryZsrcnameZdstnameZsrcobjrbrw�linktor9r�r$r$r%�	_copytree�s`




�
� (&r�c	
CsDt�d||�t�|��}t|�}W5QRXt||||||||d�S)aeRecursively copy a directory tree and return the destination directory.

    dirs_exist_ok dictates whether to raise an exception in case dst or any
    missing parent directory already exists.

    If exception(s) occur, an Error is raised with a list of reasons.

    If the optional symlinks flag is true, symbolic links in the
    source tree result in symbolic links in the destination tree; if
    it is false, the contents of the files pointed to by symbolic
    links are copied. If the file pointed by the symlink doesn't
    exist, an exception will be added in the list of errors raised in
    an Error exception at the end of the copy process.

    You can set the optional ignore_dangling_symlinks flag to true if you
    want to silence this exception. Notice that this has no effect on
    platforms that don't support os.symlink.

    The optional ignore argument is a callable. If given, it
    is called with the `src` parameter, which is the directory
    being visited by copytree(), and `names` which is the list of
    `src` contents, as returned by os.listdir():

        callable(src, names) -> ignored_names

    Since copytree() is called recursively, the callable will be
    called once for each directory that is copied. It returns a
    list of names relative to the `src` directory that should
    not be copied.

    The optional copy_function argument is a callable that will be used
    to copy each file. It will be called with the source path and the
    destination path as arguments. By default, copy2() is used, but any
    function that supports the same signature (like copy()) can be used.

    zshutil.copytree)r�r[r\r�r�r�r�r�)r?rir<�scandir�listr�)	r[r\r�r�r�r�r�Zitrr�r$r$r%rs&
��st_file_attributescCsPz4|jdd�}t�|j�o2|jtj@o0|jtjkWStk
rJYdSXdS�NFre)rW�S_ISDIRrmr��FILE_ATTRIBUTE_REPARSE_POINTr�r�r-)�entryrur$r$r%�
_rmtree_isdir6s
�r�cCsLz0t�|�}t�|j�p.|jtj@o.|jtjkWSt	k
rFYdSXdS)NF)
r<rwrW�S_ISLNKrmr�r�r�r�r-)rVrur$r$r%�_rmtree_islink?s

�r�cCs*z|jdd�WStk
r$YdSXdSr�)r�r-)r�r$r$r%r�HscCstj�|�Sr^)r<rVrc)rVr$r$r%r�Nsc	Cs&z"t�|��}t|�}W5QRXWn*tk
rL|tj|t���g}YnX|D]�}|j}t|�r�z|��rvtd��Wn,tk
r�|tjj	|t���YqRYnXt
||�qRzt�|�WqRtk
r�|tj|t���YqRXqRzt�|�Wn(tk
�r |tj|t���YnXdS)N�%Cannot call rmtree on a symbolic link)
r<r�r�r-r?�exc_inforVr�rbrc�_rmtree_unsafe�unlink�rmdir)rV�onerror�
scandir_itr�r��fullnamer$r$r%r�Rs0

r�c
Cs.z"t�|��}t|�}W5QRXWn@tk
rb}z"||_|tj|t���WY�dSd}~XYnX|D�]�}tj�||j	�}z|j
dd�}Wntk
r�d}YnNX|r�z|jdd�}	t�|	j
�}Wn*tk
r�|tj|t���YqhYnX|�r�ztj|j	tj|d�}
Wn(tk
�r:|tj|t���Yn�Xz�tj�|	t�|
���r�t|
||�ztj|j	|d�Wn(tk
�r�|tj|t���YnXn8ztd��Wn*tk
�r�|tjj|t���YnXW5t�|
�Xqhztj|j	|d�Wqhtk
�r&|tj|t���YqhXqhdS)NFre)�dir_fdr�)r<r�r�r-r/r?r�rVr�r.r�rWr�rmrwrq�O_RDONLY�closerQr=�_rmtree_safe_fdr�rcr�)�topfdrVr�r�r�r9r�r�r��orig_st�dirfdr$r$r%r�qsR


r�c	Cs�t�d|�|rdd�}n|dkr*dd�}t�r`t|t�rDt�|�}zt�|�}Wn(tk
rz|tj|t�	��YdSXzt�
|tj�}Wn(tk
r�|tj
|t�	��YdSXz�tj
�|t�|���rt|||�zt�|�Wn(tk
�r|tj|t�	��YnXn8ztd��Wn*tk
�rL|tj
j|t�	��YnXW5t�|�XnNzt|��rttd��Wn,tk
�r�|tj
j|t�	��YdSXt||�SdS)a�Recursively delete a directory tree.

    If ignore_errors is set, errors are ignored; otherwise, if onerror
    is set, it is called to handle the error with arguments (func,
    path, exc_info) where func is platform and implementation dependent;
    path is the argument to that function that caused it to fail; and
    exc_info is a tuple returned by sys.exc_info().  If ignore_errors
    is false and onerror is None, an exception is raised.

    z
shutil.rmtreecWsdSr^r$�r�r$r$r%r��szrmtree.<locals>.onerrorNcWs�dSr^r$r�r$r$r%r��sr�)r?ri�_use_fd_functionsrS�bytesr<�fsdecoderwr,r�rqr�r�rVrQr=r�r�r-rcr�r�)rV�
ignore_errorsr�r��fdr$r$r%r�sJ



cCs&tjjtjjpd}tj�|�|��S)N�)r<rV�sep�altsepr��rstrip)rVr�r$r$r%�	_basename�sr�c	CsTt�d||�|}tj�|�rbt||�r8t�||�dStj�|t|��}tj�	|�rbt
d|��zt�||�Wn�tk
�rNtj�|�r�t�
|�}t�||�t�|�n�tj�|��r6t||�r�t
d||f��t|��st�|tj��st�|��rtjdk�rtd||f��t|||dd�t|�n|||�t�|�YnX|S)	a+Recursively move a file or directory to another location. This is
    similar to the Unix "mv" command. Return the file or directory's
    destination.

    If the destination is a directory or a symlink to a directory, the source
    is moved inside the directory. The destination path must not already
    exist.

    If the destination already exists but is not a directory, it may be
    overwritten depending on os.rename() semantics.

    If the destination is on our current filesystem, then rename() is used.
    Otherwise, src is copied to the destination and then removed. Symlinks are
    recreated under the new name if os.rename() fails because of cross
    filesystem renames.

    The optional `copy_function` argument is a callable that will be used
    to copy the source or it will be delegated to `copytree`.
    By default, copy2() is used, but any function that supports the same
    signature (like copy()) can be used.

    A lot more could be done here...  A look at a mv.c shows a lot of
    the issues this implementation glosses over.

    zshutil.moveNz$Destination path '%s' already existsz.Cannot move a directory '%s' into itself '%s'.�darwinzKCannot move the non-empty directory '%s': Lacking write permission to '%s'.T)r�r�)r?rir<rVr�r]�renamer�r�r�rr-rcrpror��
_destinsrc�
_is_immutable�access�W_OK�listdir�platform�PermissionErrorrr)r[r\r�Zreal_dstr�r$r$r%r�sL


�
�����

cCsVtj�|�}tj�|�}|�tjj�s2|tjj7}|�tjj�sL|tjj7}|�|�Sr^)r<rVrY�endswithr��
startswithrZr$r$r%r�/sr�cCs(t|�}tjtjg}t|d�o&|j|kS)Nr�)rarW�UF_IMMUTABLE�SF_IMMUTABLErUr�)r[ruZimmutable_statesr$r$r%r�8sr�cCsNtdks|dkrdSzt|�}Wntk
r8d}YnX|dk	rJ|dSdS)z"Returns a gid, given a group name.N�)r�KeyError�r.�resultr$r$r%�_get_gid=s
r�cCsNtdks|dkrdSzt|�}Wntk
r8d}YnX|dk	rJ|dSdS)z"Returns an uid, given a user name.Nr�)rr�r�r$r$r%�_get_uidIs
r��gzipcs |dkrd}nDtr |dkr d}n2tr2|dkr2d}n trD|dkrDd}ntd�|���d	dl}	|rfd
|nd}
|d|
}tj�|�}|r�tj�	|�s�|dk	r�|�
d|�|s�t�|�|dk	r�|�
d
�t���t
�������fdd�}
|�s|	�|d|�}z|j||
d�W5|��X|S)a�Create a (possibly compressed) tar file from all the files under
    'base_dir'.

    'compress' must be "gzip" (the default), "bzip2", "xz", or None.

    'owner' and 'group' can be used to define an owner and a group for the
    archive that is being built. If not provided, the current owner and group
    will be used.

    The output tar file will be named 'base_name' +  ".tar", possibly plus
    the appropriate compression extension (".gz", ".bz2", or ".xz").

    Returns the output filename.
    Nr�r�Zgz�bzip2�bz2�xzzCbad value for 'compress', or compression format not supported : {0}r�.�.tar�creating %szCreating tar archivecs,�dk	r�|_�|_�dk	r(�|_�|_|Sr^)�gidZgname�uid�uname)Ztarinfo�r��group�ownerr�r$r%�_set_uid_gid�sz#_make_tarball.<locals>._set_uid_gidzw|%s�r�)�_ZLIB_SUPPORTED�_BZ2_SUPPORTED�_LZMA_SUPPORTED�
ValueErrorrj�tarfiler<rV�dirnamer��infor�r�r�rqr��add)�	base_name�base_dir�compress�verbose�dry_runr�r��loggerZtar_compressionr�Zcompress_extZarchive_name�archive_dirr��tarr$r�r%�
_make_tarballUs>�

	
r	c	Csnddl}|d}tj�|�}|rNtj�|�sN|dk	r@|�d|�|sNt�|�|dk	rd|�d||�|�sj|j|d|jd���}tj�	|�}	|	tj
kr�|�|	|	�|dk	r�|�d|	�t�|�D]�\}
}}t
|�D]:}
tj�	tj�|
|
��}	|�|	|	�|dk	r�|�d|	�q�|D]L}
tj�	tj�|
|
��}	tj�|	��r|�|	|	�|dk	�r|�d|	��qq�W5QRX|S)	z�Create a zip file from all the files under 'base_dir'.

    The output zip file will be named 'base_name' + ".zip".  Returns the
    name of the output zip file.
    rN�.zipr�z#creating '%s' and adding '%s' to it�w)Zcompressionzadding '%s')�zipfiler<rVr�r�r�r��ZipFileZZIP_DEFLATED�normpath�curdirrH�walk�sortedr��isfile)rrrrrrZzip_filenamerZzfrV�dirpathZdirnames�	filenamesr.r$r$r%�
_make_zipfile�sH
��

rr)rNzuncompressed tar file)rr�zgzip'ed tar-fileZgztarzZIP file�zip)rr�zbzip2'ed tar-fileZbztar)rr�zxz'ed tar-fileZxztarcCsdd�t��D�}|��|S)z�Returns a list of supported formats for archiving and unarchiving.

    Each element of the returned sequence is a tuple (name, description)
    cSsg|]\}}||df�qS)r�r$)r�r.�registryr$r$r%r��sz'get_archive_formats.<locals>.<listcomp>)�_ARCHIVE_FORMATS�items�sort�Zformatsr$r$r%r�s
�r�cCst|dkrg}t|�s td|��t|ttf�s6td��|D]&}t|ttf�rXt|�dkr:td��q:|||ft|<dS)auRegisters an archive format.

    name is the name of the format. function is the callable that will be
    used to create archives. If provided, extra_args is a sequence of
    (name, value) tuples that will be passed as arguments to the callable.
    description can be provided to describe the format, and will be returned
    by the get_archive_formats() function.
    NzThe %s object is not callablez!extra_args needs to be a sequencer�z+extra_args elements are : (arg_name, value))�callable�	TypeErrorrS�tupler��lenr)r.�function�
extra_args�descriptionZelementr$r$r%r�s	
cCs
t|=dSr^)rr�r$r$r%r�sc	
Cst�d||||�t��}	|dk	rP|dk	r6|�d|�tj�|�}|sPt�|�|dkr^tj}||d�}
zt	|}Wn"t
k
r�td|�d�YnX|d}|dD]\}
}||
|
<q�|dkr�||
d	<||
d
<z|||f|
�}W5|dk	�r|dk	�r|�d|	�t�|	�X|S)aCreate an archive file (eg. zip or tar).

    'base_name' is the name of the file to create, minus any format-specific
    extension; 'format' is the archive format: one of "zip", "tar", "gztar",
    "bztar", or "xztar".  Or any other registered format.

    'root_dir' is a directory that will be the root directory of the
    archive; ie. we typically chdir into 'root_dir' before creating the
    archive.  'base_dir' is the directory where we start archiving from;
    ie. 'base_dir' will be the common prefix of all files and
    directories in the archive.  'root_dir' and 'base_dir' both default
    to the current directory.  Returns the name of the archive file.

    'owner' and 'group' are used when creating a tar archive. By default,
    uses the current owner and group.
    zshutil.make_archiveNzchanging into '%s')rrzunknown archive format '%s'r�rr�r�zchanging back to '%s')r?rir<�getcwd�debugrVrY�chdirrrr�r�)rrjZroot_dirrrrr�r�rZsave_cwdr��format_info�func�arg�valr/r$r$r%r�s8




cCsdd�t��D�}|��|S)z�Returns a list of supported formats for unpacking.

    Each element of the returned sequence is a tuple
    (name, extensions, description)
    cSs"g|]\}}||d|df�qS)r�r$)r�r.r�r$r$r%r�3sz&get_unpack_formats.<locals>.<listcomp>)�_UNPACK_FORMATSrrrr$r$r%r-s
�c	Csji}t��D]\}}|dD]}|||<qq|D]$}||kr0d}t||||f��q0t|�sftd��dS)z+Checks what gets registered as an unpacker.rz!%s is already registered for "%s"z*The registered function must be a callableN)r,rr)rr)	�
extensionsr r!Zexisting_extensionsr.r��ext�	extension�msgr$r$r%�_check_unpack_options8s�
r1cCs,|dkrg}t|||�||||ft|<dS)aMRegisters an unpack format.

    `name` is the name of the format. `extensions` is a list of extensions
    corresponding to the format.

    `function` is the callable that will be
    used to unpack archives. The callable will receive archives to unpack.
    If it's unable to handle an archive, it needs to raise a ReadError
    exception.

    If provided, `extra_args` is a sequence of
    (name, value) tuples that will be passed as arguments to the callable.
    description can be provided to describe the format, and will be returned
    by the get_unpack_formats() function.
    N)r1r,)r.r-r r!r"r$r$r%rJscCs
t|=dS)z*Removes the pack format from the registry.N)r,r�r$r$r%r`scCs&tj�|�}tj�|�s"t�|�dS)z1Ensure that the parent directory of `path` existsN)r<rVr�r�r�)rVr�r$r$r%�_ensure_directorydsr2c		Cs�ddl}|�|�std|��|�|�}z�|��D]�}|j}|�d�s2d|krPq2tj	j
|f|�d���}|snq2t|�|�
d�s2|�|j�}t|d�}z|�|�W5|��~Xq2W5|��XdS)z+Unpack zip `filename` to `extract_dir`
    rNz%s is not a zip file�/z..rh)rZ
is_zipfiler(r
r�Zinfolistr/r�r<rVr��splitr2r�rPrqrH)	r/�extract_dirrrr�r.�target�data�fr$r$r%�_unpack_zipfilejs*




r9r�cCs\ddl}z|�|�}Wn"|jk
r8td|��YnXz|j||d�W5|��XdS)zAUnpack tar/tar.gz/tar.bz2/tar.xz `filename` to `extract_dir`
    rNz/%s is not a compressed or uncompressed tar filer�)r�rqZTarErrorr(r�Z
extractall)r/r5r�r�Ztarobjr$r$r%�_unpack_tarfile�s�
r:r�r
)rrz.tar.gzz.tgzz.tar.bz2z.tbz2z.tar.xzz.txzcCs:t��D],\}}|dD]}|�|�r|SqqdS)Nr)r,rr�)r/r.r�r/r$r$r%�_find_unpack_format�s

r;cCs�t�d|||�|dkr t��}t�|�}t�|�}|dkrBi}nd|i}|dk	r�zt|}Wn$tk
r�td�|��d�YnX|d}|||ft	|d�|��nRt
|�}|dkr�td�|���t|d}t	t|d�}|�|�|||f|�dS)a]Unpack an archive.

    `filename` is the name of the archive.

    `extract_dir` is the name of the target directory, where the archive
    is unpacked. If not provided, the current working directory is used.

    `format` is the archive format: one of "zip", "tar", "gztar", "bztar",
    or "xztar".  Or any other registered format.  If not provided,
    unpack_archive will use the filename extension and see if an unpacker
    was registered for that extension.

    In case none is found, a ValueError is raised.

    If `filter` is given, it is passed to the underlying
    extraction function.
    zshutil.unpack_archiveNr�zUnknown unpack format '{0}'r#r�zUnknown archive format '{0}')
r?rir<r$r�r,r�r�rj�dictr;r(�update)r/r5rjr�Z
filter_kwargsr'r(r�r$r$r%r�s,


�statvfs�
disk_usageZusageztotal used freezTotal space in byteszUsed space in byteszFree space in bytescCs@t�|�}|j|j}|j|j}|j|j|j}t|||�S)z�Return disk usage statistics about the given path.

        Returned value is a named tuple with attributes 'total', 'used' and
        'free', which are the amount of total, used and free space, in bytes.
        )r<r>�f_bavail�f_frsize�f_blocks�f_bfree�_ntuple_diskusage)rVru�free�total�usedr$r$r%r?�s

cCs"t�|�\}}||}t|||�S)z�Return disk usage statistics about the given path.

        Returned values is a named tuple with attributes 'total', 'used' and
        'free', which are the amount of total, used and free space, in bytes.
        )rZ
_getdiskusagerD)rVrFrErGr$r$r%r?�scCs�t�d|||�|dkr(|dkr(td��|}|}|dkr>d}n(t|t�rft|�}|dkrftd�|���|dkrtd}n(t|t�s�t	|�}|dkr�td�|���t
�|||�dS)z�Change owner user and group of the given path.

    user and group can be the uid/gid or the user/group names, and in that case,
    they are converted to their respective uid/gid.
    zshutil.chownNzuser and/or group must be set���zno such user: {!r}zno such group: {!r})r?rir�rSr�r��LookupErrorrj�intr�r<r)rV�userr�Z_userZ_groupr$r$r%rs$

��P�c
Cs�zttjd�}Wnttfk
r.d}YnXzttjd�}Wnttfk
r^d}YnX|dksp|dkr�zt�tj���}Wn$t	tt
fk
r�t�|�}YnX|dkr�|j}|dkr�|j
}t�||f�S)aGet the size of the terminal window.

    For each of the two dimensions, the environment variable, COLUMNS
    and LINES respectively, is checked. If the variable is defined and
    the value is a positive integer, it is used.

    When COLUMNS or LINES is not defined, which is the common case,
    the terminal connected to sys.__stdout__ is queried
    by invoking os.get_terminal_size.

    If the terminal size cannot be successfully queried, either because
    the system doesn't support querying, or because we are not
    connected to a terminal, the value given in fallback parameter
    is used. Fallback defaults to (80, 24) which is the default
    size used by many terminal emulators.

    The value returned is a named tuple of type os.terminal_size.
    ZCOLUMNSrZLINES)rJr<�environr�r�rr?�
__stdout__r+�AttributeErrorr-�
terminal_size�columns�lines)ZfallbackrSrT�sizer$r$r%r(s$

cCs&tj�|�o$t�||�o$tj�|�Sr^)r<rVr�r�r�)r`r�r$r$r%�
_access_checkYs�rVc
	s�tj���rt�|�r�SdSt�t�}|dkrttj�dd�}|dkrtzt�d�}Wnt	t
fk
rrtj}YnX|s|dS|r�t�|�}|�
t�tj��}nt�|�}|�
tj�}tjdk�rTtj}|r�t�|�}||kr�|�d|�t�d�p�t}dd�|�
tj�D�}|�r d	d�|D�}t�fd
d�|D���r@�g}n�fdd�|D�}n�g}t�}|D]X}	tj�|	�}
|
|k�rd|�|
�|D],}tj�|	|�}t||��r�|S�q��qddS)
a3Given a command, mode, and a PATH string, return the path which
    conforms to the given mode on the PATH, or None if there is no such
    file.

    `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result
    of os.environ.get("PATH"), or can be overridden with a custom search
    path.

    N�PATH�CS_PATHZwin32rZPATHEXTcSsg|]}|r|�qSr$r$�r�r.r$r$r%r��szwhich.<locals>.<listcomp>cSsg|]}t�|��qSr$)r<�fsencoderYr$r$r%r��sc3s |]}����|���VqdSr^)�lowerr�rY��cmdr$r%�	<genexpr>�szwhich.<locals>.<genexpr>csg|]}�|�qSr$r$rYr\r$r%r��s)r<rVr�rVrSr�rO�get�confstrrQr��defpathrZr4�pathsepr�r?r�r�insert�getenv�_WIN_DEFAULT_PATHEXT�anyr�rXrr�)
r]r�rVZ	use_bytesrZpathext_sourceZpathext�files�seen�dirZnormdirZthefiler.r$r\r%r^sV







)r)F)FN)r�rrNNN)rrN)Nr�)NNrrNNN)Nr�)NN)NN)rL)jr'r<r?rWr��collectionsr1�zlibr��ImportErrorr�r�Zlzmar��pwdrZgrprr.rnrrrOrUr�r�rBrrre�__all__r-rr rrr(r,r)r*r:rFrNrr]rardr	r
r�rrr
rr�r�stat_resultr�r�r�r�rqr�r��supports_dir_fdr��supports_fdr�r�rZavoids_symlink_attacksr�rr�r�r�r�r	rrrrrrrr1rrr2r9r:r,r;rr��
namedtuplerDrFrGrEr?rrrV�F_OK�X_OKrr$r$r$r%�<module>st






�
@

7B
�
A�
.	
	4�
�
�
>?	�
A
-
����

�
8�
"�
�
�
�2



 
1__pycache__/operator.cpython-38.opt-2.pyc000064400000026074151153537600014216 0ustar00U

e5d�)�6@s$dddddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5g6Zd6d7lmZd8d%�Zd9d"�Zd:d�Zd;d*�Zd<d
�Zd=d�Z	d>d,�Z
d?d4�Zd@d�ZdAd�Z
dBd�ZdCd�ZdDd�ZdEd	�ZdFd�ZdGd�ZeZdHd$�ZdId(�ZdJd)�ZdKd&�ZdLd+�ZdMd-�ZdNd.�ZdOd/�ZdPd0�ZdQd2�ZdRd3�ZdSd5�ZdTd�Z dUd�Z!dVd�Z"dWd�Z#dXd�Z$dYd�Z%dZd1�Z&dpd[d#�Z'Gd\d�d�Z(Gd]d�d�Z)Gd^d'�d'�Z*d_d
�Z+d`d�Z,dad�Z-dbd�Z.dcd�Z/ddd�Z0ded�Z1dfd�Z2dgd�Z3dhd�Z4did�Z5djd�Z6dkd �Z7dld!�Z8zd6dml9TWne:k
�r^YnXd6dnl9m;Z;eZ<eZ=eZ>eZ?eZ@e	ZAe
ZBeZCeZDeZEeZFeZGeZHeZIeZJeZKeZLeZMeZNeZOeZPeZQeZReZSeZTeZUe ZVe!ZWe#ZXe$ZYe&ZZe+Z[e,Z\e-Z]e.Z^e/Z_e0Z`e1Zae2Zbe3Zce4Zde5Zee6Zfe7Zge8ZhdoS)q�abs�add�and_�
attrgetter�concat�contains�countOf�delitem�eq�floordiv�ge�getitem�gt�iadd�iand�iconcat�	ifloordiv�ilshift�imatmul�imod�imul�index�indexOf�inv�invert�ior�ipow�irshift�is_�is_not�isub�
itemgetter�itruediv�ixor�le�length_hint�lshift�lt�matmul�methodcaller�mod�mul�ne�neg�not_�or_�pos�pow�rshift�setitem�sub�truediv�truth�xor�)rcCs||kS�N���a�br9r9� /usr/lib64/python3.8/operator.pyr&scCs||kSr8r9r:r9r9r=r#scCs||kSr8r9r:r9r9r=r	#scCs||kSr8r9r:r9r9r=r+'scCs||kSr8r9r:r9r9r=r+scCs||kSr8r9r:r9r9r=r
/scCs|Sr8r9�r;r9r9r=r-5scCs|rdSdS)NTFr9r>r9r9r=r59scCs||kSr8r9r:r9r9r=r=scCs||k	Sr8r9r:r9r9r=rAscCst|�Sr8)�_absr>r9r9r=rGscCs||Sr8r9r:r9r9r=rKscCs||@Sr8r9r:r9r9r=rOscCs||Sr8r9r:r9r9r=r
SscCs|��Sr8)�	__index__r>r9r9r=rWscCs|Sr8r9r>r9r9r=r[scCs||>Sr8r9r:r9r9r=r%`scCs||Sr8r9r:r9r9r=r)dscCs||Sr8r9r:r9r9r=r*hscCs||Sr8r9r:r9r9r=r'lscCs|Sr8r9r>r9r9r=r,pscCs||BSr8r9r:r9r9r=r.tscCs|
Sr8r9r>r9r9r=r/xscCs||Sr8r9r:r9r9r=r0|scCs||?Sr8r9r:r9r9r=r1�scCs||Sr8r9r:r9r9r=r3�scCs||Sr8r9r:r9r9r=r4�scCs||ASr8r9r:r9r9r=r6�scCs(t|d�s dt|�j}t|��||S�N�__getitem__z!'%s' object can't be concatenated��hasattr�type�__name__�	TypeError�r;r<�msgr9r9r=r�s
cCs||kSr8r9r:r9r9r=r�scCs"d}|D]}||kr|d7}q|S)Nr7�r9)r;r<�count�ir9r9r=r�s

cCs
||=dSr8r9r:r9r9r=r�scCs||Sr8r9r:r9r9r=r�scCs.t|�D]\}}||kr|Sqtd��dS)Nz$sequence.index(x): x not in sequence)�	enumerate�
ValueError)r;r<rL�jr9r9r=r�s
cCs|||<dSr8r9)r;r<�cr9r9r=r2�scCs�t|t�s dt|�j}t|��z
t|�WStk
r>YnXzt|�j}Wntk
rf|YSXz||�}Wntk
r�|YSX|tkr�|St|t�s�dt|�j}t|��|dkr�d}t	|��|S)Nz/'%s' object cannot be interpreted as an integerz'__length_hint__ must be integer, not %sr7z$__length_hint__() should return >= 0)
�
isinstance�intrErFrG�len�__length_hint__�AttributeError�NotImplementedrN)�obj�defaultrIZhint�valr9r9r=r$�s8	
�



�c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r)�_attrs�_callcsn|s<t|t�std��|f|_|�d���fdd�}||_n.|f||_ttt|j����fdd�}||_dS)Nzattribute name must be a string�.cs�D]}t||�}q|Sr8)�getattr)rW�name)�namesr9r=�func�sz!attrgetter.__init__.<locals>.funccst�fdd��D��S)Nc3s|]}|��VqdSr8r9)�.0�getter�rWr9r=�	<genexpr>�sz4attrgetter.__init__.<locals>.func.<locals>.<genexpr>��tuplerc)�gettersrcr=r`�s)	rQ�strrGrZ�splitr[rf�mapr)�self�attr�attrsr`r9)rgr_r=�__init__�s

zattrgetter.__init__cCs
|�|�Sr8�r[�rkrWr9r9r=�__call__�szattrgetter.__call__cCs$d|jj|jjd�tt|j��fS�N�	%s.%s(%s)�, )�	__class__�
__module__�__qualname__�joinrj�reprrZ�rkr9r9r=�__repr__s�zattrgetter.__repr__cCs|j|jfSr8)rurZrzr9r9r=�
__reduce__szattrgetter.__reduce__N�rFrvrw�	__slots__rnrqr{r|r9r9r9r=r�s
c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r ��_itemsr[csF�s �f|_�fdd�}||_n"�f�|_��fdd�}||_dS)Ncs|�Sr8r9rc)�itemr9r=r`sz!itemgetter.__init__.<locals>.funccst�fdd��D��S)Nc3s|]}�|VqdSr8r9)rarLrcr9r=rdsz4itemgetter.__init__.<locals>.func.<locals>.<genexpr>rerc)�itemsrcr=r`sr)rkr�r�r`r9)r�r�r=rnszitemgetter.__init__cCs
|�|�Sr8rorpr9r9r=rqszitemgetter.__call__cCs$d|jj|jjd�tt|j��fSrr)rurvrFrxrjryr�rzr9r9r=r{ s�zitemgetter.__repr__cCs|j|jfSr8)rur�rzr9r9r=r|%szitemgetter.__reduce__Nr}r9r9r9r=r 	s
c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r()�_name�_args�_kwargscOs*||_t|jt�std��||_||_dS)Nzmethod name must be a string)r�rQrhrGr�r�)rkr^�args�kwargsr9r9r=rn1s
zmethodcaller.__init__cCst||j�|j|j�Sr8)r]r�r�r�rpr9r9r=rq8szmethodcaller.__call__cCsTt|j�g}|�tt|j��|�dd�|j��D��d|jj|jj	d�
|�fS)Ncss|]\}}d||fVqdS)z%s=%rNr9)ra�k�vr9r9r=rd>sz(methodcaller.__repr__.<locals>.<genexpr>rsrt)ryr��extendrjr�r�r�rurvrFrx)rkr�r9r9r=r{;s�zmethodcaller.__repr__cCsD|js|j|jf|jfSddlm}||j|jf|j�|jfSdS)Nr7)�partial)r�rur�r��	functoolsr�)rkr�r9r9r=r|Cszmethodcaller.__reduce__Nr}r9r9r9r=r((s
cCs||7}|Sr8r9r:r9r9r=rMscCs||M}|Sr8r9r:r9r9r=rRscCs,t|d�s dt|�j}t|��||7}|SrArCrHr9r9r=rWs

cCs||}|Sr8r9r:r9r9r=r_scCs||K}|Sr8r9r:r9r9r=rdscCs||;}|Sr8r9r:r9r9r=riscCs||9}|Sr8r9r:r9r9r=rnscCs||}|Sr8r9r:r9r9r=rsscCs||O}|Sr8r9r:r9r9r=rxscCs||C}|Sr8r9r:r9r9r=r}scCs||L}|Sr8r9r:r9r9r=r�scCs||8}|Sr8r9r:r9r9r=r�scCs||}|Sr8r9r:r9r9r=r!�scCs||N}|Sr8r9r:r9r9r=r"�s)�*)�__doc__N)r7)i�__all__�builtinsrr?r&r#r	r+rr
r-r5rrrrr
rrrr%r)r*r'r,r.r/r0r1r3r4r6rrrrrrr2r$rr r(rrrrrrrrrrrrr!r"�	_operator�ImportErrorr��__lt__�__le__�__eq__�__ne__�__ge__�__gt__�__not__�__abs__�__add__�__and__�__floordiv__r@�__inv__�
__invert__�
__lshift__�__mod__�__mul__�
__matmul__�__neg__�__or__�__pos__�__pow__�
__rshift__�__sub__�__truediv__�__xor__�
__concat__�__contains__�__delitem__rB�__setitem__�__iadd__�__iand__�__iconcat__�
__ifloordiv__�__ilshift__�__imod__�__imul__�__imatmul__�__ior__�__ipow__�__irshift__�__isub__�__itruediv__�__ixor__r9r9r9r=�<module>
s2�	
)'%__pycache__/inspect.cpython-38.opt-1.pyc000064400000234666151153537600014037 0ustar00U

e5d��@s�dZdZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlmZddlmZmZe�Zej��D]\ZZeede<q�dZdd	�Zd
d�Z dd
�Z!dd�Z"dd�Z#e$ed��rdd�Z%ndd�Z%e$ed��r*dd�Z&ndd�Z&dd�Z'dd�Z(dd�Z)d d!�Z*d"d#�Z+d$d%�Z,d&d'�Z-d(d)�Z.d*d+�Z/d,d-�Z0d.d/�Z1d0d1�Z2d2d3�Z3d4d5�Z4d6d7�Z5d�d8d9�Z6ed:d;�Z7d<d=�Z8d>d?�Z9dd@�dAdB�Z:dCdD�Z;dEdF�Z<dGdH�Z=dIdJ�Z>dKdL�Z?dMdN�Z@dOdP�ZAdQdR�ZBd�dSdT�ZCiZDiZEd�dUdV�ZFdWdX�ZGdYdZ�ZHGd[d\�d\eI�ZJGd]d^�d^�ZKd_d`�ZLdadb�ZMdcdd�ZNdedf�ZOd�dhdi�ZPedjdk�ZQdldm�ZRedndo�ZSdpdq�ZTedrds�ZUdtdu�ZVedvdw�ZWdxdy�ZXd�dzd{�ZYd|d}�ZZdddd~iie[dd��d�d��d�d��d�d��eYfd�d��Z\e[d�d��d�d��d�d��fd�d��Z]d�d��Z^d�d��Z_d�d��Z`ed�d��Zad�d��Zbed�d��Zcd�d�d��Zdd�d��Zeed�d�ecjf�Zgd�d�d��Zhd�d�d��Zid�d��Zjd�d�d��Zkd�d�d��Zlem�Znd�d��Zod�d��Zpd�d��Zqd�d��Zrd�d��Zsenfd�d��Ztd�Zud�Zvd�Zwd�Zxd�d��Zyd�d��Zzd�Z{d�Z|d�Z}d�Z~d�d��Zd�dÄZ�e�e�j��Z�e�e�j��Z�e�e�j�d��Z�e�e�e�ej�fZ�d�dƄZ�d�d�dȄZ�d�dʄZ�d�d̄Z�d�d΄Z�d�dЄZ�d�d҄Z�d�d�dՄZ��dd�dׄZ��dd�dلZ�d�d�dڜd�d܄Z�Gd�dބdރZ�Gd�d�d�Z�Gd�d�d�ej��Z�e�j�Z�e�j�Z�e�j�Z�e�j�Z�e�j�Z�e�d�e�d�e�d�e�d�e�d�iZ�Gd�d�d�Z�Gd�d�d�Z�Gd�d�d�Z�d�d�d�d�Z�d�d�Z�e�d�k�r�e��dS(aGet useful information from live Python objects.

This module encapsulates the interface provided by the internal special
attributes (co_*, im_*, tb_*, etc.) in a friendlier fashion.
It also provides some help for examining source code and class layout.

Here are some of the useful functions provided by this module:

    ismodule(), isclass(), ismethod(), isfunction(), isgeneratorfunction(),
        isgenerator(), istraceback(), isframe(), iscode(), isbuiltin(),
        isroutine() - check object types
    getmembers() - get members of an object that satisfy a given condition

    getfile(), getsourcefile(), getsource() - find an object's source code
    getdoc(), getcomments() - get documentation on an object
    getmodule() - determine the module that an object came from
    getclasstree() - arrange classes so as to represent their hierarchy

    getargvalues(), getcallargs() - get info about function arguments
    getfullargspec() - same, with support for Python 3 features
    formatargvalues() - format an argument spec
    getouterframes(), getinnerframes() - get info about frames
    currentframe() - get the current stack frame
    stack(), trace() - get info about frames on the stack or in a traceback

    signature() - get a Signature object for the callable
)zKa-Ping Yee <ping@lfw.org>z'Yury Selivanov <yselivanov@sprymix.com>�N)�
attrgetter)�
namedtuple�OrderedDictZCO_icCst|tj�S)z�Return true if the object is a module.

    Module objects provide these attributes:
        __cached__      pathname to byte compiled file
        __doc__         documentation string
        __file__        filename (missing for built-in modules))�
isinstance�types�
ModuleType��object�r
�/usr/lib64/python3.8/inspect.py�ismodule?srcCs
t|t�S)z�Return true if the object is a class.

    Class objects provide these attributes:
        __doc__         documentation string
        __module__      name of module in which this class was defined)r�typerr
r
r�isclassHsrcCst|tj�S)a_Return true if the object is an instance method.

    Instance method objects provide these attributes:
        __doc__         documentation string
        __name__        name with which this method was defined
        __func__        function object containing implementation of method
        __self__        instance to which this method is bound)rr�
MethodTyperr
r
r�ismethodPsrcCs:t|�st|�st|�rdSt|�}t|d�o8t|d�S)a�Return true if the object is a method descriptor.

    But not if ismethod() or isclass() or isfunction() are true.

    This is new in Python 2.2, and, for example, is true of int.__add__.
    An object passing this test has a __get__ attribute but not a __set__
    attribute, but beyond that the set of attributes varies.  __name__ is
    usually sensible, and __doc__ often is.

    Methods implemented via descriptors that also pass one of the other
    tests return false from the ismethoddescriptor() test, simply because
    the other tests promise more -- you can, e.g., count on having the
    __func__ attribute (etc) when an object passes ismethod().F�__get__�__set__�rr�
isfunctionr
�hasattr�r	�tpr
r
r�ismethoddescriptorZsrcCs8t|�st|�st|�rdSt|�}t|d�p6t|d�S)a}Return true if the object is a data descriptor.

    Data descriptors have a __set__ or a __delete__ attribute.  Examples are
    properties (defined in Python) and getsets and members (defined in C).
    Typically, data descriptors will also have __name__ and __doc__ attributes
    (properties, getsets, and members have both of these attributes), but this
    is not guaranteed.Fr�
__delete__rrr
r
r�isdatadescriptornsr�MemberDescriptorTypecCst|tj�S)��Return true if the object is a member descriptor.

        Member descriptors are specialized descriptors defined in extension
        modules.)rrrrr
r
r�ismemberdescriptor~srcCsdS)rFr
rr
r
rr�s�GetSetDescriptorTypecCst|tj�S)��Return true if the object is a getset descriptor.

        getset descriptors are specialized descriptors defined in extension
        modules.)rrrrr
r
r�isgetsetdescriptor�sr cCsdS)rFr
rr
r
rr �scCst|tj�S)a(Return true if the object is a user-defined function.

    Function objects provide these attributes:
        __doc__         documentation string
        __name__        name with which this function was defined
        __code__        code object containing compiled function bytecode
        __defaults__    tuple of any default values for arguments
        __globals__     global namespace in which this function was defined
        __annotations__ dict of parameter annotations
        __kwdefaults__  dict of keyword only parameters with defaults)rr�FunctionTyperr
r
rr�srcCs6t|�r|j}qt�|�}t|�s&dSt|jj|@�S)z�Return true if ``f`` is a function (or a method or functools.partial
    wrapper wrapping a function) whose code object has the given ``flag``
    set in its flags.F)r�__func__�	functools�_unwrap_partialr�bool�__code__�co_flags)�f�flagr
r
r�_has_code_flag�s
r*cCs
t|t�S)z�Return true if the object is a user-defined generator function.

    Generator function objects provide the same attributes as functions.
    See help(isfunction) for a list of attributes.)r*ZCO_GENERATOR��objr
r
r�isgeneratorfunction�sr-cCs
t|t�S)zuReturn true if the object is a coroutine function.

    Coroutine functions are defined with "async def" syntax.
    )r*ZCO_COROUTINEr+r
r
r�iscoroutinefunction�sr.cCs
t|t�S)z�Return true if the object is an asynchronous generator function.

    Asynchronous generator functions are defined with "async def"
    syntax and have "yield" expressions in their body.
    )r*ZCO_ASYNC_GENERATORr+r
r
r�isasyncgenfunction�sr/cCst|tj�S)z7Return true if the object is an asynchronous generator.)rr�AsyncGeneratorTyperr
r
r�
isasyncgen�sr1cCst|tj�S)aReturn true if the object is a generator.

    Generator objects provide these attributes:
        __iter__        defined to support iteration over container
        close           raises a new GeneratorExit exception inside the
                        generator to terminate the iteration
        gi_code         code object
        gi_frame        frame object or possibly None once the generator has
                        been exhausted
        gi_running      set to 1 when generator is executing, 0 otherwise
        next            return the next item from the container
        send            resumes the generator and "sends" a value that becomes
                        the result of the current yield-expression
        throw           used to raise an exception inside the generator)rr�
GeneratorTyperr
r
r�isgenerator�sr3cCst|tj�S)z)Return true if the object is a coroutine.)rr�
CoroutineTyperr
r
r�iscoroutine�sr5cCs6t|tj�p4t|tj�r(t|jjt@�p4t|tj	j
�S)z?Return true if object can be passed to an ``await`` expression.)rrr4r2r%�gi_coder'ZCO_ITERABLE_COROUTINE�collections�abc�	Awaitablerr
r
r�isawaitable�s��r:cCst|tj�S)abReturn true if the object is a traceback.

    Traceback objects provide these attributes:
        tb_frame        frame object at this level
        tb_lasti        index of last attempted instruction in bytecode
        tb_lineno       current line number in Python source code
        tb_next         next inner traceback object (called by this level))rr�
TracebackTyperr
r
r�istraceback�sr<cCst|tj�S)a`Return true if the object is a frame object.

    Frame objects provide these attributes:
        f_back          next outer frame object (this frame's caller)
        f_builtins      built-in namespace seen by this frame
        f_code          code object being executed in this frame
        f_globals       global namespace seen by this frame
        f_lasti         index of last attempted instruction in bytecode
        f_lineno        current line number in Python source code
        f_locals        local namespace seen by this frame
        f_trace         tracing function for this frame, or None)rr�	FrameTyperr
r
r�isframe�sr>cCst|tj�S)a�Return true if the object is a code object.

    Code objects provide these attributes:
        co_argcount         number of arguments (not including *, ** args
                            or keyword only arguments)
        co_code             string of raw compiled bytecode
        co_cellvars         tuple of names of cell variables
        co_consts           tuple of constants used in the bytecode
        co_filename         name of file in which this code object was created
        co_firstlineno      number of first line in Python source code
        co_flags            bitmap: 1=optimized | 2=newlocals | 4=*arg | 8=**arg
                            | 16=nested | 32=generator | 64=nofree | 128=coroutine
                            | 256=iterable_coroutine | 512=async_generator
        co_freevars         tuple of names of free variables
        co_posonlyargcount  number of positional only arguments
        co_kwonlyargcount   number of keyword only arguments (not including ** arg)
        co_lnotab           encoded mapping of line numbers to bytecode indices
        co_name             name with which this code object was defined
        co_names            tuple of names of local variables
        co_nlocals          number of local variables
        co_stacksize        virtual machine stack space required
        co_varnames         tuple of names of arguments and local variables)rr�CodeTyperr
r
r�iscodesr@cCst|tj�S)a,Return true if the object is a built-in function or method.

    Built-in functions and methods provide these attributes:
        __doc__         documentation string
        __name__        original name of this function or method
        __self__        instance to which a method is bound, or None)rr�BuiltinFunctionTyperr
r
r�	isbuiltinsrBcCs t|�pt|�pt|�pt|�S)z<Return true if the object is any kind of function or method.)rBrrrrr
r
r�	isroutine&s���rCcCs�t|t�sdS|jt@rdStt|�tj�s0dSt|d�r>dS|j�	�D]\}}t
|dd�rHdSqH|jD]6}t
|dd�D]$}t
||d�}t
|dd�rzdSqzqjdS)z:Return true if the object is an abstract base class (ABC).FT�__abstractmethods__�__isabstractmethod__r
N)rr
�	__flags__�TPFLAGS_IS_ABSTRACT�
issubclassr8�ABCMetar�__dict__�items�getattr�	__bases__)r	�name�value�baser
r
r�
isabstract-s"



rQc	Cst|�r|ft|�}nd}g}t�}t|�}z:|jD].}|j��D]\}}t|tj	�rD|�
|�qDq6Wntk
r|YnX|D]~}	zt||	�}
|	|kr�t�Wn:tk
r�|D]}|	|jkr�|j|	}
q�q�Yq�YnX|r�||
�r�|�
|	|
f�|�
|	�q�|jdd�d�|S)z�Return all members of an object as (name, value) pairs sorted by name.
    Optionally, only return members that satisfy a given predicate.r
cSs|dS)Nrr
)Zpairr
r
r�<lambda>n�zgetmembers.<locals>.<lambda>��key)r�getmro�set�dirrMrJrKrr�DynamicClassAttribute�append�AttributeErrorrL�add�sort)r	Z	predicate�mro�results�	processed�namesrP�k�vrUrOr
r
r�
getmembersEs:




rd�	Attributezname kind defining_class objectcCsTt|�}tt|��}tdd�|D��}|f|}||}t|�}|D].}|j��D]\}}t|tj�rR|�	|�qRqDg}	t
�}
|D�]�}d}d}
d}||
k�rzz|dkr�td��t||�}
Wn"tk
r�}zW5d}~XYn�Xt|
d|�}||k�rzd}d}|D] }t||d�}||
k�r|}�q|D]B}z|�
||�}Wntk
�rXY�q(YnX||
k�r(|}�q(|dk	�rz|}|D]0}||jk�r~|j|}||k�r�|}�q��q~|dk�r�q�|
dk	�r�|
n|}t|ttjf��r�d}|}nFt|ttjf��rd}|}n*t|t��rd	}|}nt|��r,d
}nd}|	�	t||||��|
�|�q�|	S)aNReturn list of attribute-descriptor tuples.

    For each name in dir(cls), the return list contains a 4-tuple
    with these elements:

        0. The name (a string).

        1. The kind of attribute this is, one of these strings:
               'class method'    created via classmethod()
               'static method'   created via staticmethod()
               'property'        created via property()
               'method'          any other flavor of method or descriptor
               'data'            not a method

        2. The class which defined this attribute (a class).

        3. The object as obtained by calling getattr; if this fails, or if the
           resulting object does not live anywhere in the class' mro (including
           metaclasses) then the object is looked up in the defining class's
           dict (found by walking the mro).

    If one of the items in dir(cls) is stored in the metaclass it will now
    be discovered and not have None be listed as the class in which it was
    defined.  Any items whose home class cannot be discovered are skipped.
    css|]}|ttfkr|VqdS�N)r
r	)�.0�clsr
r
r�	<genexpr>�sz'classify_class_attrs.<locals>.<genexpr>NrJz)__dict__ is special, don't want the proxy�__objclass__z
static methodzclass method�property�method�data)rVr
�tuplerXrJrKrrrYrZrW�	ExceptionrL�__getattr__r[�staticmethod�BuiltinMethodType�classmethod�ClassMethodDescriptorTyperkrCrer\)rhr^ZmetamroZclass_basesZ	all_basesrarPrbrc�resultr`rNZhomeclsZget_objZdict_obj�excZlast_clsZsrch_clsZsrch_objr,�kindr
r
r�classify_class_attrsss�












rxcCs|jS)zHReturn tuple of base classes (including cls) in method resolution order.)�__mro__)rhr
r
rrV�srV��stopcs|�dkrdd�}n�fdd�}|}t|�|i}t��}||�rx|j}t|�}||ks`t|�|krntd�|���|||<q6|S)anGet the object wrapped by *func*.

   Follows the chain of :attr:`__wrapped__` attributes returning the last
   object in the chain.

   *stop* is an optional callback accepting an object in the wrapper chain
   as its sole argument that allows the unwrapping to be terminated early if
   the callback returns a true value. If the callback never returns a true
   value, the last object in the chain is returned as usual. For example,
   :func:`signature` uses this to stop unwrapping if any object in the
   chain has a ``__signature__`` attribute defined.

   :exc:`ValueError` is raised if a cycle is encountered.

    NcSs
t|d�S�N�__wrapped__�r�r(r
r
r�_is_wrapper�szunwrap.<locals>._is_wrappercst|d�o�|�Sr|r~rrzr
rr�sz!wrapper loop when unwrapping {!r})�id�sys�getrecursionlimitr}�len�
ValueError�format)�funcr{r�r(ZmemoZrecursion_limitZid_funcr
rzr�unwrap�s

r�cCs|��}t|�t|���S)zBReturn the indent size, in spaces, at the start of a line of text.)�
expandtabsr��lstrip)�lineZexpliner
r
r�
indentsizesr�cCsNtj�|j�}|dkrdS|j�d�dd�D]}t||�}q.t|�sJdS|S)N�.���)r��modules�get�
__module__�__qualname__�splitrLr)r�rhrNr
r
r�
_findclasssr�c	Cst|�rT|jD]@}|tk	rz
|j}Wntk
r<YqYnX|dk	r|SqdSt|�r�|jj}|j}t|�r�t	t	||d�d�|jkr�|}n|j
}�n$t|�r�|j}t|�}|dks�t	||�|k	r�dSn�t
|��r|j}|j}t|��r|jd||jk�r|}n|j
}n�t|t��rP|j}|j}t|�}|dk�sJt	||�|k	�r�dSnnt|��sdt|��r�|j}|j}t	||�|k	�r�dSt|��r�t	|dd�}t|t��r�||k�r�||SndS|jD]F}zt	||�j}Wntk
�r�Y�q�YnX|dk	�r�|S�q�dS)Nr"r��	__slots__)rryr	�__doc__r[rr"�__name__�__self__rL�	__class__rr�rBr�rrk�fgetrrrjr�dict)r,rP�docrN�selfrhr��slotsr
r
r�_finddoc sn



�


�



r�c	Cshz
|j}Wntk
r YdSX|dkrRzt|�}Wnttfk
rPYdSXt|t�s`dSt|�S)z�Get the documentation string for an object.

    All tabs are expanded to spaces.  To clean up docstrings that are
    indented to line up with blocks of code, any whitespace than can be
    uniformly removed from the second line onwards is removed.N)r�r[r��	TypeErrorr�str�cleandoc)r	r�r
r
r�getdoc^s

r�cCs�z|���d�}Wntk
r(YdSXtj}|dd�D]*}t|���}|r<t|�|}t||�}q<|r||d��|d<|tjkr�tdt|��D]}|||d�||<q�|r�|ds�|�	�q�|r�|ds�|�	d�q�d�
|�SdS)z�Clean up indentation from docstrings.

    Any whitespace that can be uniformly removed from the second line
    onwards is removed.�
N�rr�)r�r��UnicodeErrorr��maxsizer�r��min�range�pop�join)r��linesZmarginr�Zcontent�indent�ir
r
rr�qs(

r�cCs�t|�r(t|dd�r|jStd�|���t|�rht|d�rZtj�	|j
�}t|dd�rZ|jStd�|���t|�rv|j}t
|�r�|j}t|�r�|j}t|�r�|j}t|�r�|jStd�t|�j���dS)z@Work out which source or compiled file an object was defined in.�__file__Nz{!r} is a built-in moduler�z{!r} is a built-in classzVmodule, class, method, function, traceback, frame, or code object was expected, got {})rrLr�r�r�rrr�r�r�r�rr"rr&r<�tb_framer>�f_coder@�co_filenamer
r�)r	�moduler
r
r�getfile�s.
�r�cCsTtj�|�}dd�tj��D�}|��|D]"\}}|�|�r,|d|�Sq,dS)z1Return the module name for a given file, or None.cSsg|]}t|�|f�qSr
)r�)rg�suffixr
r
r�
<listcomp>�s�z!getmodulename.<locals>.<listcomp>N)�os�path�basename�	importlib�	machinery�all_suffixesr]�endswith)r�Zfname�suffixesZneglenr�r
r
r�
getmodulename�s�
r�cs�t|��tjjdd�}|tjjdd�7}t�fdd�|D��r`tj���dtjj	d�nt�fdd�tjj
D��r~dStj���r��Stt
|��dd�dk	r��S�tjkr��SdS)z�Return the filename that can be used to locate an object's source.
    Return None if no way can be identified to get the source.
    Nc3s|]}��|�VqdSrf�r��rg�s��filenamer
rri�sz getsourcefile.<locals>.<genexpr>rc3s|]}��|�VqdSrfr�r�r�r
rri�s�
__loader__)r�r�r��DEBUG_BYTECODE_SUFFIXES�OPTIMIZED_BYTECODE_SUFFIXES�anyr�r��splitext�SOURCE_SUFFIXES�EXTENSION_SUFFIXES�existsrL�	getmodule�	linecache�cache)r	Zall_bytecode_suffixesr
r�r�
getsourcefile�s"
��
r�cCs,|dkrt|�pt|�}tj�tj�|��S)z�Return an absolute path to the source or compiled file for an object.

    The idea is for each object to have a unique origin, so this routine
    normalizes the result as much as possible.N)r�r�r�r��normcase�abspath)r	�	_filenamer
r
r�
getabsfile�sr�c
Cs�t|�r|St|d�r$tj�|j�S|dk	rD|tkrDtj�t|�Szt||�}Wntk
rhYdSX|tkr�tj�t|�Stj�	��
�D]\\}}t|�r�t|d�r�|j}|t�|d�kr�q�|t|<t|�}|j
t|<ttj�|�<q�|tk�rtj�t|�Stjd}t|d��s"dSt||j
��rJt||j
�}||k�rJ|Stjd}t||j
��r|t||j
�}	|	|k�r||SdS)zAReturn the module an object was defined in, or None if not found.r�Nr��__main__r��builtins)rrr�r�r�r��
modulesbyfiler�r��copyrKr��_filesbymodnamer�r�r��realpathrL)
r	r��file�modnamer�r(�mainZ
mainobjectZbuiltinZ
builtinobjectr
r
rr��sJ
�

�




r�cCs�t|�}|rt�|�n$t|�}|�d�r4|�d�s<td��t||�}|rZt�||j	�}n
t�|�}|sptd��t
|�r�|dfSt|��r |j}t
�d|d�}g}tt|��D]F}|�||�}|r�||ddkr�||fS|�|�d	�|f�q�|�r|��||dd	fStd
��t|��r0|j}t|��r@|j}t|��rP|j}t|��r`|j}t|��r�t|d��s~td��|jd	}	t
�d
�}|	dk�r�z||	}
Wnt k
�r�td��YnX|�|
��rؐq�|	d	}	�q�||	fStd��dS)abReturn the entire source file and starting line number for an object.

    The argument may be a module, class, method, function, traceback, frame,
    or code object.  The source code is returned as a list of all the lines
    in the file and the line number indexes a line in that list.  An OSError
    is raised if the source code cannot be retrieved.�<�>zsource code not availablezcould not get source coderz^(\s*)class\s*z\b�cr�zcould not find class definition�co_firstlinenoz"could not find function definitionz>^(\s*def\s)|(\s*async\s+def\s)|(.*(?<!\w)lambda(:|\s))|^(\s*@)zlineno is out of boundszcould not find code objectN)!r�r��
checkcacher��
startswithr��OSErrorr��getlinesrJrrr��re�compiler�r��matchrZ�groupr]rr"rr&r<r�r>r�r@rr��
IndexError)r	r�r�r�rNZpatZ
candidatesr�r��lnumr�r
r
r�
findsourcesf










r�c	Cs.zt|�\}}Wnttfk
r*YdSXt|�r�d}|rT|ddd�dkrTd}|t|�krz||��dkrz|d}qT|t|�kr�||dd�dkr�g}|}|t|�kr�||dd�dkr�|�||���|d}q�d�|�S�n>|dk�r*t	||�}|d}|dk�r*||�
�dd�dk�r*t	||�|k�r*||���
�g}|dk�r�|d}||���
�}|dd�dk�r�t	||�|k�r�|g|dd�<|d}|dk�r��q�||���
�}�qt|�r�|d��dk�r�g|dd�<�q�|�r |d	��dk�r g|d	d�<�q�d�|�SdS)
zwGet lines of comments immediately preceding an object's source code.

    Returns None when source can't be found.
    Nr�z#!r�)��#r�r�r�)r�r�r�rr��striprZr�r�r�r�)r	r�r��startZcomments�endr�Zcommentr
r
r�getcommentsRsL
  

$�
$
r�c@seZdZdS)�
EndOfBlockN)r�r�r�r
r
r
rr�sr�c@s eZdZdZdd�Zdd�ZdS)�BlockFinderz@Provide a tokeneater() method to detect the end of a code block.cCs4d|_d|_d|_d|_d|_d|_d|_d|_dS)NrFr�)r��islambda�started�passline�indecorator�decoratorhasargs�last�	body_col0�r�r
r
r�__init__�szBlockFinder.__init__cCsr|jsB|jsB|dkrd|_n|dkr8|dkr2d|_d|_d|_�n,|dkrZ|jrVd|_�n|dkrv|jrtd|_d|_n�|tjkr�d|_|d|_|jr�t�|jr�|js�d|_n�|jr�n�|tj	kr�|j
dkr�|jr�|d	|_
|jd	|_d|_n�|tjk�r|jd	|_|jdk�rnt�nV|tj
k�rL|j
dk	�rn|d	|j
k�rn|d|_n"|jdk�rn|tj
tjfk�rnt�dS)
N�@T)�def�class�lambdar�(�)Frr�)r�r�r�r�r��tokenize�NEWLINEr�r��INDENTr�r��DEDENT�COMMENT�NL)r�r
�tokenZsrowcolZerowcolr�r
r
r�
tokeneater�sL





zBlockFinder.tokeneaterN)r�r�r�r�r�rr
r
r
rr��s
r�c	CsVt�}z(t�t|�j�}|D]}|j|�qWnttfk
rFYnX|d|j�S)z@Extract the block of code at the top of the given list of lines.N)	r�r�generate_tokens�iter�__next__rr��IndentationErrorr�)r�Zblockfinder�tokensZ_tokenr
r
r�getblock�srcCsbt|�}t|�\}}t|�r"|j}t|�s>t|�rF|jjdkrF|dfSt||d��|dfSdS)a�Return a list of source lines and starting line number for an object.

    The argument may be a module, class, method, function, traceback, frame,
    or code object.  The source code is returned as a list of the lines
    corresponding to the object and the line number indicates where in the
    original source file the first line of code was found.  An OSError is
    raised if the source code cannot be retrieved.z<module>rNr�)	r�r�r<r�rr>r��co_namer�r	r�r�r
r
r�getsourcelines�s�
�rcCst|�\}}d�|�S)aReturn the text of the source code for an object.

    The argument may be a module, class, method, function, traceback, frame,
    or code object.  The source code is returned as a single string.  An
    OSError is raised if the source code cannot be retrieved.r�)rr�rr
r
r�	getsource�srcCsRg}|jtdd�d�|D]2}|�||jf�||kr|�t||||��q|S)z-Recursive helper function for getclasstree().r�r�rT)r]rrZrM�walktree)�classes�children�parentr_r�r
r
rr�srFcCs�i}g}|D]d}|jr^|jD]>}||kr0g||<|||krJ||�|�|r||krqpqq||kr|�|�q|D]}||krv|�|�qvt||d�S)a�Arrange the given list of classes into a hierarchy of nested lists.

    Where a nested list appears, it contains classes derived from the class
    whose entry immediately precedes the list.  Each entry is a 2-tuple
    containing a class and a tuple of its base classes.  If the 'unique'
    argument is true, exactly one entry appears in the returned structure
    for each class in the given list.  Otherwise, classes using multiple
    inheritance and their descendants will appear multiple times.N)rMrZr)r�uniquer�rootsr�rr
r
r�getclasstree�s"	
r�	Argumentszargs, varargs, varkwc	Cs�t|�std�|���|j}|j}|j}t|d|��}t||||��}d}||7}d}|jt@rx|j|}|d}d}|jt	@r�|j|}t
||||�S)aGet information about the arguments accepted by a code object.

    Three things are returned: (args, varargs, varkw), where
    'args' is the list of argument names. Keyword-only arguments are
    appended. 'varargs' and 'varkw' are the names of the * and **
    arguments or None.z{!r} is not a code objectNrr�)r@r�r��co_varnames�co_argcount�co_kwonlyargcount�listr'�
CO_VARARGS�CO_VARKEYWORDSr)	�cora�nargsZnkwargs�args�
kwonlyargs�step�varargs�varkwr
r
r�getargss"



r,�ArgSpeczargs varargs keywords defaultscCsDtjdtdd�t|�\}}}}}}}|s.|r6td��t||||�S)aeGet the names and default values of a function's parameters.

    A tuple of four things is returned: (args, varargs, keywords, defaults).
    'args' is a list of the argument names, including keyword-only argument names.
    'varargs' and 'keywords' are the names of the * and ** parameters or None.
    'defaults' is an n-tuple of the default values of the last n parameters.

    This function is deprecated, as it does not support annotations or
    keyword-only parameters and will raise ValueError if either is present
    on the supplied callable.

    For a more structured introspection API, use inspect.signature() instead.

    Alternatively, use getfullargspec() for an API with a similar namedtuple
    based interface, but full support for annotations and keyword-only
    parameters.

    Deprecated since Python 3.5, use `inspect.getfullargspec()`.
    zhinspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()r���
stacklevelzgFunction has keyword-only parameters or annotations, use inspect.signature() API which can support them)�warnings�warn�DeprecationWarning�getfullargspecr�r-)r�r'r*r+�defaultsr(�kwonlydefaults�annr
r
r�
getargspec-s��r7�FullArgSpeczGargs, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotationsc
Cs|zt|ddtd�}Wn,tk
r@}ztd�|�W5d}~XYnXg}d}d}g}g}d}i}	d}i}
|j|jk	r||j|	d<|j��D]�}|j}|j	}
|t
kr�|�|
�|j|jk	r�||jf7}nv|t
kr�|�|
�|j|jk	r�||jf7}nJ|tkr�|
}n<|tk�r*|�|
�|j|jk	�r8|j|
|
<n|tk�r8|
}|j|jk	r�|j|	|
<q�|
�sZd}
|�sdd}t|||||||
|	�S)a$Get the names and default values of a callable object's parameters.

    A tuple of seven things is returned:
    (args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations).
    'args' is a list of the parameter names.
    'varargs' and 'varkw' are the names of the * and ** parameters or None.
    'defaults' is an n-tuple of the default values of the last n parameters.
    'kwonlyargs' is a list of keyword-only parameter names.
    'kwonlydefaults' is a dictionary mapping names from kwonlyargs to defaults.
    'annotations' is a dictionary mapping parameter names to annotations.

    Notable differences from inspect.signature():
      - the "self" parameter is always reported, even for bound methods
      - wrapper chains defined by __wrapped__ *not* unwrapped automatically
    F��follow_wrapper_chains�skip_bound_arg�sigclszunsupported callableNr
�return)�_signature_from_callable�	Signatureror��return_annotation�empty�
parameters�valuesrwrN�_POSITIONAL_ONLYrZ�default�_POSITIONAL_OR_KEYWORD�_VAR_POSITIONAL�
_KEYWORD_ONLY�_VAR_KEYWORD�
annotationr8)r��sig�exr'r*r+Zposonlyargsr(r4�annotations�
kwdefaults�paramrwrNr
r
rr3Nsb�






�r3�ArgInfozargs varargs keywords localscCs t|j�\}}}t||||j�S)a9Get information about arguments passed into a particular frame.

    A tuple of four things is returned: (args, varargs, varkw, locals).
    'args' is a list of the argument names.
    'varargs' and 'varkw' are the names of the * and ** arguments or None.
    'locals' is the locals dictionary of the given frame.)r,r�rP�f_locals)�framer'r*r+r
r
r�getargvalues�srScCsVt|dd�dkr t|��dd�St|t�rN|jd|fkr>|jS|jd|jSt|�S)Nr��typingztyping.r�r�r�)rL�repr�replacerr
r�r�)rJZbase_moduler
r
r�formatannotation�s
rWcst|dd���fdd�}|S)Nr�cs
t|��Srf)rW)rJ�r�r
r�_formatannotation�sz5formatannotationrelativeto.<locals>._formatannotation)rL)r	rYr
rXr�formatannotationrelativeto�srZr
cCsd|S�N�*r
�rNr
r
rrR�rSrRcCsd|S�N�**r
r]r
r
rrR�rScCsdt|�S�N�=�rU�rOr
r
rrR�rScCsd|S)Nz -> r
)�textr
r
rrR�rSc
s<ddlm}
|
dtdd����fdd�}g}|rBt|�t|�}t|�D]:\}}||�}|rz||krz||
|||�}|�|�qJ|dk	r�|�|||���n|r�|�d	�|r�|D]2}||�}|r�||kr�||
||�7}|�|�q�|dk	�r|�|	||���d
d�|�d}d
�k�r8||��d
��7}|S)a�Format an argument spec from the values returned by getfullargspec.

    The first seven arguments are (args, varargs, varkw, defaults,
    kwonlyargs, kwonlydefaults, annotations).  The other five arguments
    are the corresponding optional formatting functions that are called to
    turn names and values into strings.  The last argument is an optional
    function to format the sequence of arguments.

    Deprecated since Python 3.5: use the `signature` function and `Signature`
    objects.
    r)r1zc`formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directlyr�r.cs(�|�}|�kr$|d��|�7}|S)Nz: r
)�argru�rMrW�	formatargr
r�formatargandannotation�sz-formatargspec.<locals>.formatargandannotationNr\r�, rr=)r0r1r2r��	enumeraterZr�)r'r*r+r4r(r5rMrg�
formatvarargs�formatvarkw�formatvalueZ
formatreturnsrWr1rh�specsZfirstdefaultr�re�specZ	kwonlyargrur
rfr�
formatargspec�s<�


rpcCsd|Sr[r
r]r
r
rrRrScCsd|Sr^r
r]r
r
rrRrScCsdt|�Sr`rbrcr
r
rrRrScCs�|||fdd�}g}	tt|��D]}
|	�|||
��q |rV|	�||�|||��|rt|	�||�|||��dd�|	�dS)afFormat an argument spec from the 4 values returned by getargvalues.

    The first four arguments are (args, varargs, varkw, locals).  The
    next four arguments are the corresponding optional formatting functions
    that are called to turn names and values into strings.  The ninth
    argument is an optional function to format the sequence of arguments.cSs||�|||�Srfr
)rN�localsrgrmr
r
r�convertsz formatargvalues.<locals>.convertrrir)r�r�rZr�)r'r*r+rqrgrkrlrmrrrnr�r
r
r�formatargvaluess�
rscs��fdd�|D�}t|�}|dkr,|d}n>|dkr@dj|�}n*dj|dd��}|dd�=d	�|�|}td
|||rzdnd|dkr�d
nd|f��dS)Ncsg|]}|�krt|��qSr
rb)rgrN�rCr
rr�sz&_missing_arguments.<locals>.<listcomp>r�rr�z	{} and {}z, {} and {}���riz*%s() missing %i required %s argument%s: %s�
positional�keyword-onlyr�r�)r�r�r�r�)�f_nameZargnames�posrCra�missingr��tailr
rtr�_missing_argumentss 


��r|c
	s�t|�|}t�fdd�|D��}|r:|dk}	d|f}
n2|rTd}	d|t|�f}
nt|�dk}	tt|��}
d}|r�d}||dkr�d	nd||dkr�d	ndf}td
||
|	r�d	nd|||dkr�|s�dndf��dS)
Ncsg|]}|�kr|�qSr
r
)rgrertr
rr�)sz_too_many.<locals>.<listcomp>r�zat least %dTz
from %d to %dr�z7 positional argument%s (and %d keyword-only argument%s)r�z5%s() takes %s positional argument%s but %d%s %s givenZwasZwere)r�r�r�)
rxr'Zkwonlyr*ZdefcountZgivenrCZatleastZkwonly_givenZpluralrKZ
kwonly_sig�msgr
rtr�	_too_many's*���r~cOst|�}|\}}}}}}	}
|j}i}t|�rB|jdk	rB|jf|}t|�}
t|�}|r^t|�nd}t|
|�}t|�D]}|||||<qt|r�t||d��||<t||�}|r�i||<|�	�D]T\}}||kr�|s�t
d||f��||||<q�||k�rt
d||f��|||<q�|
|k�r<|�s<t||||||
|�|
|k�r�|d||�}|D]}||k�rZt||d|��qZt
|||d��D] \}}||k�r�||||<�q�d}|D]6}||k�r�|	�r�||	k�r�|	|||<n|d7}�q�|�rt||d|�|S)z�Get the mapping of arguments to values.

    A dict is returned, with keys the function argument names (including the
    names of the * and ** arguments, if any), and values the respective bound
    values from 'positional' and 'named'.Nrz*%s() got an unexpected keyword argument %rz(%s() got multiple values for argument %rTr�F)r3r�rr�r�r�r�rnrWrKr�r~r|rj)r�rvZnamedror'r*r+r4r(r5r6rxZ	arg2valueZnum_posZnum_argsZnum_defaults�nr�Zpossible_kwargs�kwrOZreqrerz�kwargr
r
r�getcallargs<sh
�
�
�



r��ClosureVarsz"nonlocals globals builtins unboundc	Cs�t|�r|j}t|�s$td�|���|j}|jdkr:i}ndd�t|j|j�D�}|j	}|�
dtj�}t
|�rt|j}i}i}t�}|jD]d}|dkr�q�z||||<Wq�tk
r�z||||<Wntk
r�|�|�YnXYq�Xq�t||||�S)a
    Get the mapping of free variables to their current values.

    Returns a named tuple of dicts mapping the current nonlocal, global
    and builtin references as seen by the body of the function. A final
    set of unbound names that could not be resolved is also provided.
    �{!r} is not a Python functionNcSsi|]\}}||j�qSr
)�
cell_contents)rg�varZcellr
r
r�
<dictcomp>�s�z"getclosurevars.<locals>.<dictcomp>�__builtins__)�None�True�False)rr"rr�r�r&�__closure__�zip�co_freevars�__globals__r�r�rJrrW�co_names�KeyErrorr\r�)	r��codeZ
nonlocal_varsZ	global_nsZ
builtin_nsZglobal_varsZbuiltin_varsZ
unbound_namesrNr
r
r�getclosurevarszs>	
�
�r��	Tracebackz+filename lineno function code_context indexr�cCs�t|�r|j}|j}n|j}t|�s2td�|���t|�p@t|�}|dkr�|d|d}zt	|�\}}Wnt
k
r�d}}Yq�Xtdt|t
|�|��}||||�}|d|}nd}}t|||jj||�S)a�Get information about a frame or traceback object.

    A tuple of five things is returned: the filename, the line number of
    the current line, the function name, a list of lines of context from
    the source code, and the index of the current line within that list.
    The optional second argument specifies the number of lines of context
    to return, which are centered around the current line.z'{!r} is not a frame or traceback objectrr�r�N)r<�	tb_linenor��f_linenor>r�r�r�r�r�r��maxr�r�r�r�r)rR�context�linenor�r�r�r��indexr
r
r�getframeinfo�s$r�cCs|jS)zCGet the line number from a frame object, allowing for optimization.)r��rRr
r
r�	getlineno�sr��	FrameInfor�cCs2g}|r.|ft||�}|�t|��|j}q|S)z�Get a list of records for a frame and all higher (calling) frames.

    Each record contains a frame object, filename, line number, function
    name, a list of lines of context, and index within the context.)r�rZr��f_back)rRr��	framelist�	frameinfor
r
r�getouterframes�sr�cCs4g}|r0|jft||�}|�t|��|j}q|S)z�Get a list of records for a traceback's frame and all lower frames.

    Each record contains a frame object, filename, line number, function
    name, a list of lines of context, and index within the context.)r�r�rZr��tb_next)�tbr�r�r�r
r
r�getinnerframes�sr�cCsttd�rt�d�SdS)z?Return the frame of the caller or None if this is not possible.�	_getframer�N)rr�r�r
r
r
r�currentframe�sr�cCstt�d�|�S)z@Return a list of records for the stack above the caller's frame.r�)r�r�r��r�r
r
r�stack�sr�cCstt��d|�S)zCReturn a list of records for the stack below the current exception.r�)r�r��exc_infor�r
r
r�trace�sr�cCstjd�|�S)Nry)r
rJr)�klassr
r
r�_static_getmrosr�cCs8i}zt�|d�}Wntk
r(YnXt�||t�S�NrJ)r	�__getattribute__r[r�r��	_sentinel)r,�attrZ
instance_dictr
r
r�_check_instancesr�c	CsHt|�D]:}tt|��tkrz|j|WStk
r@YqXqtSrf)r��_shadowed_dictr
r�rJr�)r�r��entryr
r
r�_check_class
sr�cCs(zt|�Wntk
r"YdSXdS�NFT)r�r�r+r
r
r�_is_types
r�c	Csntjd}t|�D]V}z|�|�d}Wntk
r<YqXt|�tjkr`|jdkr`|j|ks|Sqt	Sr�)
r
rJr�rr�rrr�rjr�)r��	dict_attrr�Z
class_dictr
r
rr�s
��
r�c	Cst}t|�s>t|�}t|�}|tks2t|�tjkrBt||�}n|}t||�}|tk	r�|tk	r�tt|�d�tk	r�tt|�d�tk	r�|S|tk	r�|S|tk	r�|S||kr�tt|��D]:}tt|��tkr�z|j	|WSt
k
r�Yq�Xq�|tk	r�|St|��dS)a�Retrieve attributes without triggering dynamic lookup via the
       descriptor protocol,  __getattr__ or __getattribute__.

       Note: this function may not be able to retrieve all attributes
       that getattr can fetch (like dynamically created attributes)
       and may find attributes that getattr can't (like descriptors
       that raise AttributeError). It can also return descriptor objects
       instead of instance members in some cases. See the
       documentation for details.
    rrN)r�r�r
r�rrr�r�r�rJr�r[)r,r�rEZinstance_resultr�r�Zklass_resultr�r
r
r�getattr_static+s:�
�r��GEN_CREATED�GEN_RUNNING�
GEN_SUSPENDED�
GEN_CLOSEDcCs,|jr
tS|jdkrtS|jjdkr(tStS)a#Get current state of a generator-iterator.

    Possible states are:
      GEN_CREATED: Waiting to start execution.
      GEN_RUNNING: Currently being executed by the interpreter.
      GEN_SUSPENDED: Currently suspended at a yield expression.
      GEN_CLOSED: Execution has completed.
    Nr�)�
gi_runningr��gi_framer��f_lastir�r�)�	generatorr
r
r�getgeneratorstate`s	
r�cCs:t|�std�|���t|dd�}|dk	r2|jjSiSdS)z�
    Get the mapping of generator local variables to their current values.

    A dict is returned, with the keys the local variable names and values the
    bound values.z{!r} is not a Python generatorr�N)r3r�r�rLr�rQ)r�rRr
r
r�getgeneratorlocalsrsr��CORO_CREATED�CORO_RUNNING�CORO_SUSPENDED�CORO_CLOSEDcCs,|jr
tS|jdkrtS|jjdkr(tStS)a&Get current state of a coroutine object.

    Possible states are:
      CORO_CREATED: Waiting to start execution.
      CORO_RUNNING: Currently being executed by the interpreter.
      CORO_SUSPENDED: Currently suspended at an await expression.
      CORO_CLOSED: Execution has completed.
    Nr�)�
cr_runningr��cr_framer�r�r�r�)�	coroutiner
r
r�getcoroutinestate�s	
r�cCs"t|dd�}|dk	r|jSiSdS)z�
    Get the mapping of coroutine local variables to their current values.

    A dict is returned, with the keys the local variable names and values the
    bound values.r�N)rLrQ)r�rRr
r
r�getcoroutinelocals�sr��
from_bytescCs8zt||�}Wntk
r$YdSXt|t�s4|SdS)z�Private helper. Checks if ``cls`` has an attribute
    named ``method_name`` and returns it only if it is a
    pure python function.
    N)rLr[r�_NonUserDefinedCallables)rhZmethod_nameZmethr
r
r�"_signature_get_user_defined_method�s
r�c
Cs�|j}t|���}|jpd}|jp$i}|r2||}z|j||�}Wn6tk
rx}zd�|�}	t|	�|�W5d}~XYnXd}
|��D]�\}}z|j	|}
Wnt
k
r�YnjX|jtkr�|�
|�q�|jtkr�||kr�d}
|j|
d�||<n|�
|j�q�|jtk�r|j|
d�||<|
r�|jtk�rN||jtd�}|||<|�|�q�|jttfk�rj|�|�q�|jtkr�|�
|j�q�|j|��d�S)	z�Private helper to calculate how 'wrapped_sig' signature will
    look like after applying a 'functools.partial' object (or alike)
    on it.
    r
z+partial object {!r} has incorrect argumentsNFT)rE�rw�rB)rBrrKr'�keywords�bind_partialr�r�r��	argumentsr�rwrDr�rFrVrNrH�move_to_endrIrGrC)�wrapped_sig�partialZ
extra_argsZ
old_params�
new_paramsZpartial_argsZpartial_keywordsZbarLr}Ztransform_to_kwonly�
param_namerOZ	arg_valueZ	new_paramr
r
r�_signature_get_partial�sL







r�cCslt|j���}|r$|djttfkr,td��|dj}|ttfkrP|dd�}n|t	k	r`td��|j
|d�S)zWPrivate helper to transform signatures for unbound
    functions to bound methods.
    rzinvalid method signaturer�Nzinvalid argument typer�)rnrBrCrwrIrHr�rFrDrGrV)rK�paramsrwr
r
r�_signature_bound_methods
r�cCs&t|�p$t|�p$t|t�p$|ttfkS)zxPrivate helper to test if `obj` is a callable that might
    support Argument Clinic's __text_signature__ protocol.
    )rBrrr�r
r	r+r
r
r�_signature_is_builtin.s��
�r�cCs�t|�rt|�rdSt|dd�}t|dd�}t|dt�}t|dt�}t|dd�}t|tj�o�t|t�o�|dksxt|t�o�|dks�t|t	�o�t|t	�S)z�Private helper to test if `obj` is a duck type of FunctionType.
    A good example of such objects are functions compiled with
    Cython, which have all attributes that a pure Python function
    would have, but have their code statically compiled.
    Fr�Nr&�__defaults__�__kwdefaults__�__annotations__)
�callablerrL�_voidrrr?r�rnr�)r,rNr�r4rNrMr
r
r�_signature_is_functionlike:s ����r�cCs<|�d�}|dkr|�d�}|�d�}|�d�}|d|�S)z� Private helper to get first parameter name from a
    __text_signature__ of a builtin method, which should
    be in the following format: '($param1, ...)'.
    Assumptions are that the first argument won't have
    a default value or an annotation.
    �,r�r�:rar�)�find)roryZcposr
r
r�_signature_get_bound_paramSs




r�cCs |s|ddfSd}d}dd�|�d�D�}t|�j}t�|�}d}d}g}|j}	d}
tj}tj}t|�}
|D]�}
|
j	|
j
}}||kr�|dkr�|r�d}qld}|
d	7}
ql|d
kr�d}|
d	}ql||kr�|dkr�|
}ql|r�d}||kr�|dks�|	d
�|	|�|dkrl|	d�qld�|�}|||fS)a�
    Private helper function. Takes a signature in Argument Clinic's
    extended signature format.

    Returns a tuple of three things:
      * that signature re-rendered in standard Python syntax,
      * the index of the "self" parameter (generally 0), or None if
        the function does not have a "self" parameter, and
      * the index of the last "positional only" parameter,
        or None if the signature has no positional-only parameters.
    NcSsg|]}|�d��qS)�ascii)�encode)rg�lr
r
rr�}sz6_signature_strip_non_python_syntax.<locals>.<listcomp>r�Frr�Tr��/�$rri� r�)r�rrrrZr�OP�
ERRORTOKEN�nextr
�stringr�)�	signature�self_parameter�last_positional_onlyr�r�Ztoken_streamZ
delayed_commaZskip_next_commardr\Zcurrent_parameterr�r��tr
r��clean_signaturer
r
r�"_signature_strip_non_python_syntaxjsP





r�Tc	s`ddl�|j�t|�\}}}d|d}z��|�}Wntk
rNd}YnXt|�j�sjtd�|���|j	d}	g��j
�t��d}i�t|dd�}
|
r�t
j�|
d�}|r�|j�t
j���	�fdd�����	fd	d
��
G��
fdd�d�j���f��������fd
d�	}t|	jj�}t|	jj�}
tj||
dd�}|dk	�rJ�j�n�j�ttt|���D](\}\}}|||�||k�r`�j��q`|	jj�r��j�||	jj���j�t|	jj |	jj!�D]\}}|||��q�|	jj"�r�j#�||	jj"��|dk	�rRt|dd�}|dk	}t$|�}|�r8|�s,|�r8��%d�n�dj&�jd�}|�d<|�|j
d�S)zdPrivate helper to parse content of '__text_signature__'
    and return a Signature based on it.
    rNzdef fooz: passz"{!r} builtin has invalid signaturer�cs|jdk	rtd��|jS)Nz'Annotations are not currently supported)rJr�re)�node)�astr
r�
parse_name�s
z&_signature_fromstr.<locals>.parse_namecs|zt|��}Wn>tk
rLzt|��}Wntk
rFt��YnXYnXt|tttttt	d�f�rr��
|�St��dSrf)�eval�	NameError�RuntimeErrorrr��int�float�bytesr%r
ZConstant)r�rO)r��module_dict�sys_module_dictr
r�
wrap_value�s
z&_signature_fromstr.<locals>.wrap_valuecs(eZdZ��fdd�Z��fdd�ZdS)z,_signature_fromstr.<locals>.RewriteSymbolicscs\g}|}t|�j�r(|�|j�|j}qt|�j�s:t��|�|j�d�t	|��}�|�S)Nr�)
rrerZr�rO�Namer�r�r��reversed)r�r��arrO�r�rr
r�visit_Attribute�sz<_signature_fromstr.<locals>.RewriteSymbolics.visit_Attributecst|j�j�st���|j�Srf)rZctxZLoadr�r�)r�r�rr
r�
visit_Name�sz7_signature_fromstr.<locals>.RewriteSymbolics.visit_NameN)r�r�r�rr	r
rr
r�RewriteSymbolics�sr
cs��|�}|�krdS|rp|tk	rpz���|�}��|�}Wntk
rR�}YnX|�kr`dS|�k	rl|n|}���|�|�d��dS)N�rErJ)�_emptyZvisitZliteral_evalr�rZ)Z	name_nodeZdefault_noderErN�o)�	Parameterr
r�rA�invalidrwrBr�r
r�p�s
z_signature_fromstr.<locals>.p)�	fillvaluer�r��r@)'r��_parameter_clsr��parse�SyntaxErrorrZModuler�r�ZbodyrAr	rLr�r�r�rJr�ZNodeTransformerrr'r4�	itertools�zip_longest�POSITIONAL_ONLY�POSITIONAL_OR_KEYWORDrjr"Zvararg�VAR_POSITIONAL�KEYWORD_ONLYr�r(Zkw_defaultsr��VAR_KEYWORDrr�rV)rhr,r�r;r�r�r�Zprogramr�r(Zmodule_namerr'r4rr�rNrEZ_selfZself_isboundZ
self_ismoduler
)rr
r�rArrwrrBr�rrr�_signature_fromstr�sn�










rcCsBt|�std�|���t|dd�}|s4td�|���t||||�S)zHPrivate helper function to get signature for
    builtin callables.
    z%{!r} is not a Python builtin function�__text_signature__Nz#no signature found for builtin {!r})r�r�r�rLr�r)rhr�r;r�r
r
r�_signature_from_builtin<s�rc	CsHd}t|�s(t|�rd}ntd�|���t|dd�}|rFt||||�S|j}|j}|j}|j	}|j
}	|d|�}
|j}||||�}|j}
|j
}|j}|r�t|�}nd}g}||}|	}|
d|�D]<}|r�tnt}|
�|t�}|�||||d��|r�|d8}q�t|
|d��D]L\}}|�r&tnt}|
�|t�}|�||||||d	��|�r|d8}�q|jt@�r�|||}|
�|t�}|�|||td��|D]B}t}|dk	�r�|�|t�}|
�|t�}|�|||t|d	���q�|jt@�r2||}|jt@�r
|d7}||}|
�|t�}|�|||td��|||
�d
t�|d�S)zCPrivate helper: constructs Signature for the given python function.FTr�rNr)rJrwr�)rJrwrEr=�r@�__validate_parameters__)rr�r�r�rLrrr&r r�co_posonlyargcountr!r�r�r�r�rDrFr�rrZrjr'r#rGrHr$rI)rhr�r;Zis_duck_functionr�rZ	func_codeZ	pos_countZ	arg_namesZ
posonly_countrvZkeyword_only_countZkeyword_onlyrMr4rNZpos_default_countrBZnon_default_countZposonly_leftrNrwrJ�offsetrEr�r
r
r�_signature_from_functionLs�

�

�
�

�
�
�r$)r:r;c
Cs�t|�std�|���t|tj�rDt|j|||d�}|r@t|�S|S|rtt	|dd�d�}t|tj�rtt||||d�Sz
|j
}Wntk
r�Yn&X|dk	r�t|t�s�td�|���|Sz
|j
}Wntk
r�YnvXt|tj��rLt|j|||d�}t||d�}t|j���d	}|jtjk�r(|St|j���}|f|}	|j|	d
�St|��s`t|��rnt|||d�St|��r�t|||d�St|tj��r�t|j|||d�}t||�Sd}t|t��r�t t|�d�}
|
dk	�r�t|
|||d�}nJt |d
�}|dk	�rt||||d�}n$t |d�}|dk	�r4t||||d�}|dk�r@|j!dd�D]>}
z
|
j"}Wntk
�rpYnX|�rLt#|||�S�qLt|j!k�r@|j$t%j$k�r�|j&t%j&k�r�|�'t%�St(d�|���nrt|t)��s@t t|�d�}
|
dk	�r@zt|
|||d�}Wn8t(k
�r>}zd�|�}t(|�|�W5d}~XYnX|dk	�r\|�rXt|�S|St|tj*��r|d�|�}t(|��t(d�|���dS)zQPrivate helper function to get signature for arbitrary
    callable objects.
    z{!r} is not a callable objectr9cSs
t|d�S)N�
__signature__r~rr
r
rrR�rSz*_signature_from_callable.<locals>.<lambda>rzNz1unexpected object {!r} in __signature__ attributerfrr�)r;�__call__�__new__r�r�z(no signature found for builtin type {!r}zno signature found for {!r}z,no signature found for builtin function {!r}z+callable {!r} is not supported by signature)+r�r�r�rrrr>r"r�r�r%r[r?�_partialmethodr#�
partialmethodr�r�rnrBrCrwrrrVrr�r$r�rr�r
r�ryrrr�r	r'�
from_callabler�r�rA)r,r:r;r<rKr)r�Zfirst_wrapped_paramZ
sig_paramsr�Zcall�newZinitrPZtext_sigrLr}r
r
rr>�s	��

��
�
�
��

�

�

�


�
�
�



r>c@seZdZdZdS)r�z1A private marker - used in Parameter & Signature.N�r�r�r�r�r
r
r
rr�t	sr�c@seZdZdZdS)rz6Marker object for Signature.empty and Parameter.empty.Nr,r
r
r
rrx	src@s4eZdZdZdZdZdZdZdd�Ze	dd	��Z
d
S)�_ParameterKindrr�r���cCs|jSrf)�_name_r�r
r
r�__str__�	sz_ParameterKind.__str__cCst|Srf)�_PARAM_NAME_MAPPINGr�r
r
r�description�	sz_ParameterKind.descriptionN)r�r�r�rrrrrr1rkr3r
r
r
rr-|	sr-zpositional-onlyzpositional or keywordzvariadic positionalrwzvariadic keywordc@s�eZdZdZdZeZeZe	Z
eZe
ZeZeed�dd�Zdd�Zdd	�Zed
d��Zedd
��Zedd��Zedd��Zeeeed�dd�Zdd�Zdd�Zdd�Zdd�ZdS)raRepresents a parameter in a function signature.

    Has the following public attributes:

    * name : str
        The name of the parameter as a string.
    * default : object
        The default value for the parameter if specified.  If the
        parameter has no default value, this attribute is set to
        `Parameter.empty`.
    * annotation
        The annotation for the parameter if specified.  If the
        parameter has no annotation, this attribute is set to
        `Parameter.empty`.
    * kind : str
        Describes how argument values are bound to the parameter.
        Possible values: `Parameter.POSITIONAL_ONLY`,
        `Parameter.POSITIONAL_OR_KEYWORD`, `Parameter.VAR_POSITIONAL`,
        `Parameter.KEYWORD_ONLY`, `Parameter.VAR_KEYWORD`.
    )�_name�_kind�_default�_annotationrcCszt|�|_Wn$tk
r2td|�d���YnX|tk	rd|jttfkrdd}|�|jj�}t|��||_||_	|tkr�td��t
|t�s�d�t|�j
�}t|��|ddkr�|dd���r�|jtkr�d	}|�|jj�}t|��t|_d
�|dd��}|���std�|���||_dS)Nzvalue z is not a valid Parameter.kindz({} parameters cannot have default valuesz*name is a required attribute for Parameterzname must be a str, not a {}rr�r�zLimplicit arguments must be passed as positional or keyword arguments, not {}z
implicit{}z"{!r} is not a valid parameter name)r-r5r�rrGrIr�r3r6r7rr�r
r�r��isdigitrFrD�isidentifierr4)r�rNrwrErJr}r
r
rr��	s6

�
zParameter.__init__cCs t|�|j|jf|j|jd�fS)N�r6r7)r
r4r5r6r7r�r
r
r�
__reduce__�	s
��zParameter.__reduce__cCs|d|_|d|_dS)Nr6r7r:�r��stater
r
r�__setstate__�	s
zParameter.__setstate__cCs|jSrf)r4r�r
r
rrN�	szParameter.namecCs|jSrf)r6r�r
r
rrE�	szParameter.defaultcCs|jSrf)r7r�r
r
rrJ�	szParameter.annotationcCs|jSrf)r5r�r
r
rrw�	szParameter.kind)rNrwrJrEcCsL|tkr|j}|tkr|j}|tkr*|j}|tkr8|j}t|�||||d�S)z+Creates a customized copy of the Parameter.r)r�r4r5r7r6r
)r�rNrwrJrEr
r
rrV�	szParameter.replacecCs�|j}|j}|jtk	r(d�|t|j��}|jtk	rb|jtk	rPd�|t|j��}nd�|t|j��}|tkrtd|}n|t	kr�d|}|S)Nz{}: {}z{} = {}z{}={}r\r_)
rwr4r7rr�rWr6rUrGrI)r�rw�	formattedr
r
rr1
s
�


zParameter.__str__cCsd�|jj|�S)Nz	<{} "{}">�r�r�r�r�r
r
r�__repr__#
szParameter.__repr__cCst|j|j|j|jf�Srf)�hashrNrwrJrEr�r
r
r�__hash__&
szParameter.__hash__cCsJ||krdSt|t�stS|j|jkoH|j|jkoH|j|jkoH|j|jkS�NT)rr�NotImplementedr4r5r6r7�r��otherr
r
r�__eq__)
s

�
�
�zParameter.__eq__N)r�r�r�r�r�rDrrFrrGrrHrrIrrrAr�r;r>rkrNrErJrwr�rVr1rArCrHr
r
r
rr�	s6(



�rc@sheZdZdZdZdd�Zedd��Zedd��Zed	d
��Z	dd�Z
d
d�Zdd�Zdd�Z
dd�ZdS)�BoundArgumentsaResult of `Signature.bind` call.  Holds the mapping of arguments
    to the function's parameters.

    Has the following public attributes:

    * arguments : OrderedDict
        An ordered mutable mapping of parameters' names to arguments' values.
        Does not contain arguments' default values.
    * signature : Signature
        The Signature object that created this instance.
    * args : tuple
        Tuple of positional arguments values.
    * kwargs : dict
        Dict of keyword arguments values.
    )r��
_signature�__weakref__cCs||_||_dSrf)r�rJ)r�r�r�r
r
rr�G
szBoundArguments.__init__cCs|jSrf)rJr�r
r
rr�K
szBoundArguments.signaturec	Cs~g}|jj��D]d\}}|jttfkr*qvz|j|}Wntk
rRYqvYqX|jtkrj|�	|�q|�
|�qt|�Srf)rJrBrKrwrIrHr�r�rG�extendrZrn)r�r'r�rOrer
r
rr'O
s
zBoundArguments.argsc	Cs�i}d}|jj��D]x\}}|sD|jttfkr4d}n||jkrDd}q|sJqz|j|}Wntk
rlYqX|jtkr�|�|�q|||<q|Sr�)	rJrBrKrwrIrHr�r��update)r��kwargsZkwargs_startedr�rOrer
r
rrNf
s&


zBoundArguments.kwargsc	Cs�|j}g}|jj��D]x\}}z|�|||f�Wqtk
r�|jtk	rV|j}n$|jt	krfd}n|jt
krvi}nYq|�||f�YqXqt|�|_dS)z�Set default values for missing arguments.

        For variable-positional arguments (*args) the default is an
        empty tuple.

        For variable-keyword arguments (**kwargs) the default is an
        empty dict.
        r
N)r�rJrBrKrZr�rErrwrGrIr)r�r�Z
new_argumentsrNrO�valr
r
r�apply_defaults�
s	


zBoundArguments.apply_defaultscCs2||krdSt|t�stS|j|jko0|j|jkSrD)rrIrEr�r�rFr
r
rrH�
s

�zBoundArguments.__eq__cCs|d|_|d|_dS)NrJr��rJr�r<r
r
rr>�
s
zBoundArguments.__setstate__cCs|j|jd�S)NrQrQr�r
r
r�__getstate__�
szBoundArguments.__getstate__cCs@g}|j��D]\}}|�d�||��qd�|jjd�|��S)Nz{}={!r}z	<{} ({})>ri)r�rKrZr�r�r�r�)r�r'rerOr
r
rrA�
szBoundArguments.__repr__N)r�r�r�r�r�r�rkr�r'rNrPrHr>rRrAr
r
r
rrI4
s


rIc@s�eZdZdZdZeZeZe	Z
d,e	dd�dd�Zedd	��Z
ed
d��Zedd�d
d��Zedd��Zedd��Zeed�dd�Zdd�Zdd�Zdd�Zdd�dd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�ZdS)-r?aA Signature object represents the overall signature of a function.
    It stores a Parameter object for each parameter accepted by the
    function, as well as information specific to the function itself.

    A Signature object has the following public attributes and methods:

    * parameters : OrderedDict
        An ordered mapping of parameters' names to the corresponding
        Parameter objects (keyword-only arguments are in the same order
        as listed in `code.co_varnames`).
    * return_annotation : object
        The annotation for the return type of the function if specified.
        If the function has no annotation for its return type, this
        attribute is set to `Signature.empty`.
    * bind(*args, **kwargs) -> BoundArguments
        Creates a mapping from positional and keyword arguments to
        parameters.
    * bind_partial(*args, **kwargs) -> BoundArguments
        Creates a partial mapping from positional and keyword arguments
        to parameters (simulating 'functools.partial' behavior.)
    )�_return_annotation�_parametersNTr cCs�|dkrt�}n�|r�t�}t}d}t|�D]�\}}|j}	|j}
|	|krdd}|�|j|	j�}t|��n|	|krtd}|	}|	ttfkr�|j	t
kr�|r�d}t|��nd}|
|kr�d�|
�}t|��|||
<q*ntdd�|D��}t�|�|_
||_dS)	z�Constructs Signature from the given list of Parameter
        objects and 'return_annotation'.  All arguments are optional.
        NFz7wrong parameter order: {} parameter before {} parameterz-non-default argument follows default argumentTzduplicate parameter name: {!r}css|]}|j|fVqdSrfr]�rgrOr
r
rris�z%Signature.__init__.<locals>.<genexpr>)rrDrjrwrNr�r3r�rFrErr�MappingProxyTyperTrS)r�rBr@r!r�Ztop_kindZ
kind_defaults�idxrOrwrNr}r
r
rr��
sD��



�zSignature.__init__cCstjdtdd�t||�S)z�Constructs Signature for the given python function.

        Deprecated since Python 3.5, use `Signature.from_callable()`.
        z_inspect.Signature.from_function() is deprecated since Python 3.5, use Signature.from_callable()r�r.)r0r1r2r$�rhr�r
r
r�
from_functions
�zSignature.from_functioncCstjdtdd�t||�S)z�Constructs Signature for the given builtin function.

        Deprecated since Python 3.5, use `Signature.from_callable()`.
        z^inspect.Signature.from_builtin() is deprecated since Python 3.5, use Signature.from_callable()r�r.)r0r1r2rrXr
r
r�from_builtins
�zSignature.from_builtin��follow_wrappedcCst|||d�S)z3Constructs Signature for the given callable object.)r<r:)r>)rhr,r\r
r
rr*#s�zSignature.from_callablecCs|jSrf)rTr�r
r
rrB)szSignature.parameterscCs|jSrf�rSr�r
r
rr@-szSignature.return_annotation)rBr@cCs0|tkr|j��}|tkr |j}t|�||d�S)z�Creates a customized copy of the Signature.
        Pass 'parameters' and/or 'return_annotation' arguments
        to override them in the new copy.
        r)r�rBrCrSr
)r�rBr@r
r
rrV1s
�zSignature.replacecCs8tdd�|j��D��}dd�|j��D�}|||jfS)Ncss|]}|jtkr|VqdSrf)rwrHrUr
r
rriAs
�z(Signature._hash_basis.<locals>.<genexpr>cSsi|]}|jtkr|j|�qSr
)rwrHrNrUr
r
rr�Ds
�z)Signature._hash_basis.<locals>.<dictcomp>)rnrBrCr@)r�r��
kwo_paramsr
r
r�_hash_basis@szSignature._hash_basiscCs(|��\}}}t|���}t|||f�Srf)r_�	frozensetrCrB)r�r�r^r@r
r
rrCIszSignature.__hash__cCs*||krdSt|t�stS|��|��kSrD)rr?rEr_rFr
r
rrHNs

zSignature.__eq__F�r�cCs�t�}t|j���}d}t|�}zt|�}Wn�tk
�rzt|�}	Wntk
rfYY�q�Yn�X|	jtkrzY�q�n�|	j|kr�|	jt	kr�d}
|
j
|	jd�}
t|
�d�|	f}Y�q�nP|	jtks�|	j
tk	r�|	f}Y�q�n.|r�|	f}Y�q�nd}
|
j
|	jd�}
t|
�d�Yq Xzt|�}	Wn tk
�r:td�d�Yq X|	jttfk�rVtd�d�|	jtk�r�|g}|�|�t|�||	j<�q�|	j|k�r�|	jt	k�r�tdj
|	jd��d�|||	j<q d}t�||�D]�}	|	jtk�r�|	}�q�|	jtk�r�q�|	j}
z|�|
�}WnFtk
�rN|�sJ|	jtk�rJ|	j
tk�rJtdj
|
d��d�Yn(X|	jt	k�rntdj
|	jd���|||
<�q�|�r�|dk	�r�|||j<ntdj
tt|��d���|�||�S)	z#Private method. Don't use directly.r
zA{arg!r} parameter is positional only, but was passed as a keyword)reNz$missing a required argument: {arg!r}ztoo many positional argumentsz$multiple values for argument {arg!r}z*got an unexpected keyword argument {arg!r})rrrBrCr��
StopIterationrwrGrNrDr�r�rIrErrHrLrnr�chainr�r��_bound_arguments_cls)r�r'rNr�r�rBZ
parameters_exZarg_valsZarg_valrOr}rCZkwargs_paramr�r
r
r�_bindUs�




���
�������

��zSignature._bindcOs|�||�S)z�Get a BoundArguments object, that maps the passed `args`
        and `kwargs` to the function's signature.  Raises `TypeError`
        if the passed arguments can not be bound.
        �re�r�r'rNr
r
r�bind�szSignature.bindcOs|j||dd�S)z�Get a BoundArguments object, that partially maps the
        passed `args` and `kwargs` to the function's signature.
        Raises `TypeError` if the passed arguments can not be bound.
        Trarfrgr
r
rr��szSignature.bind_partialcCs t|�t|j���fd|jifS�NrS)r
rnrTrCrSr�r
r
rr;�s�zSignature.__reduce__cCs|d|_dSrir]r<r
r
rr>�szSignature.__setstate__cCsd�|jj|�S)Nz<{} {}>r@r�r
r
rrA�szSignature.__repr__c	Cs�g}d}d}|j��D]d}t|�}|j}|tkr6d}n|rH|�d�d}|tkrVd}n|tkrp|rp|�d�d}|�|�q|r�|�d�d�d�	|��}|j
tk	r�t|j
�}|d�|�7}|S)NFTr�r\z({})riz -> {})
rBrCr�rwrDrZrGrHr�r�r@rrW)	r�ruZrender_pos_only_separatorZrender_kw_only_separatorrOr?rwZrenderedZannor
r
rr1�s0




zSignature.__str__)N)r�r�r�r�r�rrrIrdrrAr�rsrYrZr*rkrBr@r�rVr_rCrHrerhr�r;r>rAr1r
r
r
rr?�
s<�7



	r?r[cCstj||d�S)z/Get a signature object for the passed callable.r[)r?r*)r,r\r
r
rr�sr�c
Cs�ddl}ddl}|��}|jddd�|jdddd	d
�|��}|j}|�d�\}}}z|�|�}}	WnNtk
r�}
z0d�	|t
|
�j|
�}t|t
jd
�t
�d�W5d}
~
XYnX|r�|�d�}|	}|D]}
t||
�}q�|	jt
jk�rtdt
jd
�t
�d�|j�r�td�	|��td�	t|	���td�	|	j��||	k�rxtd�	t|	j���t|	d��r�td�	|	j��n6zt|�\}}Wntk
�r�YnXtd�	|��td�ntt|��dS)z6 Logic for inspecting an object given at command line rNr	zCThe object to be analysed. It supports the 'module:qualname' syntax)�helpz-dz	--details�
store_truez9Display info about the module rather than its source code)�actionrjr�zFailed to import {} ({}: {}))r�r�r�z#Can't get info for builtin modules.r�z
Target: {}z
Origin: {}z
Cached: {}z
Loader: {}�__path__zSubmodule search path: {}zLine: {}r�)�argparser��ArgumentParser�add_argument�
parse_argsr	�	partition�
import_moduleror�r
r��printr��stderr�exitr�rL�builtin_module_namesZdetailsr��
__cached__rUr�rrmr�r)rnr��parserr'�targetZmod_nameZ	has_attrs�attrsr,r�rvr}�parts�part�__r�r
r
r�_main$s`���



rr�)N)N)N)F)N)r�)r�)r�)r�)r�)r
)T)T)T)�r��
__author__r8�disZcollections.abcr7�enum�importlib.machineryr�rr�r�r�r�rrrr0r#r��operatorrrr�globalsZmod_dictZCOMPILER_FLAG_NAMESrKrbrcrGrrrrrrrr rr*r-r.r/r1r3r5r:r<r>r@rBrCrQrdrerxrVr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�ror�r�rrrrrrr,r-r7r8r3rPrSrWrZr�rprsr|r~r�r�r�r�r�r��_fieldsr�r�r�r�r�r�r	r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r
r&Z_WrapperDescriptor�allZ_MethodWrapperr�rJZ_ClassMethodWrapperrAr�r�r�r�r�r�r�r�rrr$r>r�r�IntEnumr-rrDrrFrrGrrHrrIr2rrIr?r�rr�r
r
r
r�<module>sz	




	
,
t$
>
	
.N->




�]


	�
;�
<
5

 



		0

�
LH
_�K�	k:
__pycache__/os.cpython-38.opt-2.pyc000064400000045350151153537600013002 0ustar00U

e5dS��@s�ddlZddlZddlZddlmZejZddddddd	d
ddd
ddddddddgZdd�Z	dd�Z
dekr�dZdZddl
Tzddl
mZe�d�Wnek
r�YnXddlZzddl
mZWnek
r�YnXddl
Z
e�e
e
��[
n�d ek�r�d Zd!ZddlTzddlmZe�d�Wnek
�r>YnXddlZddlZe�e
e��[zddlmZWnek
�r�YnXned"��eejd#<dd$lmZmZmZmZmZmZmZm Z [e	d%��r�e!�Z"d&d'�Z#e$�Z%e#d(d)�e#d*d+�e#d,d-�e#d.d/�e#d0d1�e#d2d3�e#d4d5�e#d6d7�e#d8d9�e#d:d;�e#d<d=�e#d>d?�e#d@dA�e#dBdC�e#dBdD�e#dEd1�e%Z&e$�Z%e#d(d)�e%Z'e$�Z%e#dFdG�e#dHd+�e#dId-�e#dJdK�e#dJdL�e#dMdN�e%�(e�e#dOdP�e#dQd1�e#dRd1�e#dSdT�e	dU��r.e	dV��r.e#dWdU�e%Z)e$�Z%e#d(d)�e#d,d-�e#d.d/�e#dXdY�e#dZd+�e	d[��r~e#d\d-�e#d2d3�e#d]d1�e#d^d/�e#d.d/�e#dEd1�e#d_d/�e%Z*[%[["[#dZ+d`Z,daZ-d�ddde�Z.dfdg�Z/dhdi�Z0e�dedgdig�d�dkdl�Z1e�dl�e2ehe&k�rPe3ehe)k�rPd�dcddn�dodp�Z4dqdr�Z5e�dp�dsdt�Z6dudv�Z7dwdx�Z8dydz�Z9d{d|�Z:d}d~�Z;e�dtdvdxdzd|d~g�d�dd��Z<d�d�d�Z=dd�lm>Z>Gd�d��d�e>�Z?ze@ZAWneBk
�r�d�d��ZAYnXd�ek�re�d��zeCZDWneBk
�r(d�d��ZDYnXd�ek�r>e�d��d�d��ZEeE�ZF[Ed�d�d��ZGed kZHe�d��eH�r�d�d��ZIe?eFjJeIeKeIeKeAeD�ZL[Id�d�d��ZMe�d��d�d��ZNeN�\ZOZP[Ne	d���r,e	d���s,e	d���r,dZQd`ZRZSe�d�d�d�g�d�d��ZTd�d��ZUd�d��ZVd�d��ZWd�d��ZXe�d�d�d�d�g�e	d���rTd�d��ZYd�d��ZZe�d�d�g�e	d���r|d�d��Z[d�d��Z\e�d�d�g�d�d�d�Z]Gd�d��d��Z^d�d�Z_d�d��Z`e	d���s�e`Zad�ea_bGd�d��d�ejc�Zded k�r�Gd�d��d��Zed�d��ZfdS)��N)�_check_methods�altsep�curdir�pardir�sep�pathsep�linesep�defpath�name�path�devnull�SEEK_SET�SEEK_CUR�SEEK_END�fsencode�fsdecode�
get_exec_path�fdopen�popen�extsepcCs
|t�kS�N)�globals)r
�r�/usr/lib64/python3.8/os.py�_exists'srcCs8zt|j�WStk
r2dd�t|�D�YSXdS)NcSsg|]}|ddkr|�qS)r�_r)�.0�nrrr�
<listcomp>.sz%_get_exports_list.<locals>.<listcomp>)�list�__all__�AttributeError�dir)�modulerrr�_get_exports_list*sr$�posix�
)�*)�_exitr()�_have_functions�ntz
zno os specific module foundzos.path)rrrrr	rrrr)cCs"|tkr|tkrt�t|�dSr)�_globalsr)�_set�add)�str�fnrrr�_addfsr0ZHAVE_FACCESSAT�accessZ
HAVE_FCHMODAT�chmodZ
HAVE_FCHOWNAT�chownZHAVE_FSTATAT�statZHAVE_FUTIMESAT�utimeZHAVE_LINKAT�linkZHAVE_MKDIRAT�mkdirZ
HAVE_MKFIFOAT�mkfifoZHAVE_MKNODAT�mknodZHAVE_OPENAT�openZHAVE_READLINKAT�readlinkZ
HAVE_RENAMEAT�renameZHAVE_SYMLINKAT�symlinkZ
HAVE_UNLINKAT�unlink�rmdirZHAVE_UTIMENSATZHAVE_FCHDIR�chdirZHAVE_FCHMODZHAVE_FCHOWNZHAVE_FDOPENDIR�listdir�scandirZHAVE_FEXECVE�execveZHAVE_FTRUNCATE�truncateZ
HAVE_FUTIMENSZHAVE_FUTIMESZHAVE_FPATHCONF�pathconf�statvfs�fstatvfsZ
HAVE_FSTATVFSZ
HAVE_LCHFLAGSZchflagsZHAVE_LCHMOD�lchownZHAVE_LCHOWNZHAVE_LUTIMESZ
HAVE_LSTATZ
MS_WINDOWS���FcCs�t�|�\}}|s t�|�\}}|r||r|t�|�s|zt||d�Wntk
rVYnXt}t|t�rpttd�}||kr|dSzt||�Wn$t	k
r�|r�t�
|�s��YnXdS)N)�exist_ok�ASCII)r�split�exists�makedirs�FileExistsErrorr�
isinstance�bytesr7�OSError�isdir)r
�moderL�head�tail�cdirrrrrP�s$


rPcCsjt|�t�|�\}}|s(t�|�\}}|rf|rfzt|�Wntk
rTYqfYnXt�|�\}}q(dSr)r?rrNrT)r
rWrXrrr�
removedirs�s
rZcCsnt�|�\}}|r(|r(t�|�s(t|�t||�t�|�\}}|rj|rjzt|�Wntk
rhYnXdSr)rrNrOrPr<rZrT)�old�newrWrXrrr�renames�s
r]Tccst|�}g}g}g}zt|�}Wn8tk
rX}z|dk	rB||�WY�dSd}~XYnX|��z.zt|�}	Wntk
r�YW�qpYnXWnBtk
r�}z$|dk	r�||�WY�W5QR�dSd}~XYnXz|	��}
Wntk
�r�d}
YnX|
�r|�|	j�n|�|	j�|sb|
rb|�r0d}n.z|	��}Wntk
�rVd}YnX|}|rb|�|	j	�qbW5QRX|�r�|||fVt	j
t	j}
}|D]4}|||�}|�s�|
|��s�t||||�EdH�q�n,|D]}t||||�EdH�q�|||fVdS)NFT)
�fspathrBrT�next�
StopIteration�is_dir�appendr
�
is_symlinkr�islink�join�walk)�top�topdown�onerror�followlinks�dirs�nondirs�	walk_dirs�
scandir_it�error�entryra�	walk_intorcrdre�dirname�new_pathrrrrfs^;"


rf�.��follow_symlinks�dir_fdccs�t|t�rt|d�st|�}|s.t|d|d�}t|t|d�}zB|s^t�	|j
�r|t�|t|��r|t
||t|t�|||�EdHW5t|�XdS)N�	__index__Fru�rw)rR�int�hasattrr^r4r:�O_RDONLY�close�st�S_ISDIR�st_moder�samestat�_fwalkrS)rgrhrirvrw�orig_st�topfdrrr�fwalk�s!��r�ccs�t|�}g}g}|s|rdng}	|D]�}
|
j}|r:t|�}z4|
��rb|�|�|	dk	rl|	�|
�n
|�|�Wq$tk
r�z|
��r�|�|�Wntk
r�YnXYq$Xq$|r�||||fV|	dkr�|nt||	�D]�}z@|�s|r�t||dd�}n|\}}
|
jdd�}t	|t
|d�}
Wn>tk
�r\}z|dk	�rD||�WY�q�W5d}~XYnXz@|�sxt�
|t|
���r�t�||�}t|
|||||�EdHW5t|
�Xq�|�s�||||fVdS)NF)rwrv)rvry)rBr
rrarbrTrc�zipr4r:r|r}rr�rer�)r��toppath�isbytesrhrirvrnrkrl�entriesrpr
r��dirfd�err�dirpathrrrr��sZ

�r�cGst||�dSr)�execv��file�argsrrr�execlsr�cGs |d}t||dd�|�dS�N���)rC�r�r��envrrr�execlesr�cGst||�dSr)�execvpr�rrr�execlp"sr�cGs |d}t||dd�|�dSr�)�execvper�rrr�execlpe)sr�cCst||�dSr��_execvper�rrrr�2sr�cCst|||�dSrr�r�rrrr�:sr�cCs�|dk	rt}||f}nt}|f}t}t�|�r@||f|��dSd}t|�}tdkrft|�}tt|�}|D]~}t�	||�}z||f|��Wqjt
tfk
r�}	z|	}
W5d}	~	XYqjtk
r�}	z|	}
|dkr�|	}W5d}	~	XYqjXqj|dk	r�|�|
�dS)Nr*)
rCr��environrrrrr
r�mapre�FileNotFoundError�NotADirectoryErrorrT)r�r�r��	exec_func�argrest�	saved_exc�	path_listr"�fullname�e�last_excrrrr�Es6


r�c
Cs�ddl}|dkrt}|����|�dt�z|�d�}Wntk
rPd}YnXtr�z|d}Wnttfk
rzYnX|dk	r�t	d��|}|dk	r�t
|t�r�t|�}W5QRX|dkr�t
}|�t�S)Nr�ignore�PATHsPATHz*env cannot contain 'PATH' and b'PATH' keys)�warningsr��catch_warnings�simplefilter�BytesWarning�get�	TypeError�supports_bytes_environ�KeyError�
ValueErrorrRrSrr	rNr)r�r�r��
path_listbrrrres0


�)�MutableMappingc@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�_EnvironcCs.||_||_||_||_||_||_||_dSr)�	encodekey�	decodekey�encodevalue�decodevalue�putenv�unsetenv�_data)�self�datar�r�r�r�r�r�rrr�__init__�sz_Environ.__init__cCs>z|j|�|�}Wntk
r2t|�d�YnX|�|�Sr)r�r�r�r��r��key�valuerrr�__getitem__�s
z_Environ.__getitem__cCs.|�|�}|�|�}|�||�||j|<dSr)r�r�r�r�r�rrr�__setitem__�s

z_Environ.__setitem__cCsD|�|�}|�|�z|j|=Wntk
r>t|�d�YnXdSr)r�r�r�r�)r�r��
encodedkeyrrr�__delitem__�s

z_Environ.__delitem__ccs$t|j�}|D]}|�|�VqdSr)rr�r�)r��keysr�rrr�__iter__�s
z_Environ.__iter__cCs
t|j�Sr)�lenr��r�rrr�__len__�sz_Environ.__len__cs$d�d��fdd��j��D���S)Nzenviron({{{}}})z, c3s*|]"\}}d���|���|��VqdS)z
{!r}: {!r}N)�formatr�r�)rr�r�r�rr�	<genexpr>�s�z$_Environ.__repr__.<locals>.<genexpr>)r�rer��itemsr�rr�r�__repr__�s

��z_Environ.__repr__cCst|�Sr)�dictr�rrr�copy�sz
_Environ.copycCs||kr|||<||Srrr�rrr�
setdefault�sz_Environ.setdefaultN)�__name__�
__module__�__qualname__r�r�r�r�r�r�r�r�r�rrrrr��s		r�cCsdSrr)r�r�rrr�<lambda>��r�r�cCs
t|d�S)N�)�_putenv�r�rrrr��r�r�cs�tdkrHdd�}|�t}�fdd�}i}t��D]\}}||||�<q0n(t����fdd���fdd	�}�}t}t|||�|tt�S)
Nr*cSs t|t�stdt|�j��|S)N�str expected, not %s)rRr.r��typer��r�rrr�	check_str�s
z!_createenviron.<locals>.check_strcs�|���Sr)�upperr�)�encoderrr��sz!_createenviron.<locals>.encodekeycs(t|t�stdt|�j��|��d�S)Nr��surrogateescape)rRr.r�r�r�r�r���encodingrrr��s
z_createenviron.<locals>.encodecs|��d�S)Nr�)�decoder�r�rrr��sz_createenviron.<locals>.decode)	r
r.r�r��sys�getfilesystemencodingr�r��	_unsetenv)r�r�r�r�r�r�r)r�r�r�_createenviron�s*�r�cCst�||�Sr)r�r��r��defaultrrr�getenv�sr�)r�r�cCs t|t�stdt|�j��|S)Nzbytes expected, not %s)rRrSr�r�r�r�rrr�_check_bytess
r�cCst�||�Sr)�environbr�r�rrr�getenvbsr�)r�r�cs4t���t�����fdd�}��fdd�}||fS)Ncs&t|�}t|t�r|����S|SdSr)r^rRr.r���filename�r��errorsrrr s
z_fscodec.<locals>.fsencodecs&t|�}t|t�r|����S|SdSr)r^rRrSr�r�r�rrr,s
z_fscodec.<locals>.fsdecode)r�r��getfilesystemencodeerrors)rrrr�r�_fscodecs
r��fork�spawnvr��P_WAIT�P_NOWAIT�	P_NOWAITOcCs�t|ttf�std��|r"|ds*td��t�}|spz$|dkrJ|||�n||||�Wq�td�Yq�XnR|tkr||St|d�\}}t	|�r�q|q|t
|�r�t|�St|�r�t
|�Std��q|dS)Nzargv must be a tuple or a listrz"argv first element cannot be empty�z"Not stopped, signaled or exited???)rR�tuplerr�r�r�r(r��waitpid�
WIFSTOPPED�WIFSIGNALED�WTERMSIG�	WIFEXITED�WEXITSTATUSrT)rVr�r�r��func�pid�wpid�stsrrr�	_spawnvefIs,
rcCst|||dt�Sr)rr��rVr�r�rrrr�hscCst||||t�Sr)rrC�rVr�r�r�rrr�spawnveqsr	cCst|||dt�Sr)rr�rrrr�spawnvp}sr
cCst||||t�Sr)rr�rrrr�spawnvpe�srcGst|||�Sr)r�rrrr�spawnl�srcGs|d}t|||dd�|�Sr�)r	rrrr�spawnle�sr
cGst|||�Sr)r
rrrr�spawnlp�srcGs|d}t|||dd�|�Sr�)rrrrr�spawnlpe�sr�rr�cCs�t|t�stdt|���|dkr.td|��|dks>|dkrFtd��ddl}ddl}|dkr�|j|d|j|d�}t	|�
|j�|�S|j|d|j|d	�}t	|�
|j�|�SdS)
Nz&invalid cmd type (%s, expected string))r�wzinvalid mode %rrz+popen() does not support unbuffered streamsrT)�shell�stdout�bufsize)r�stdinr)
rRr.r�r�r��
subprocess�io�Popen�PIPE�_wrap_close�
TextIOWrapperrr)�cmdrV�	bufferingrr�procrrrr�s(
��c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)rcCs||_||_dSr)�_stream�_proc)r��streamrrrrr��sz_wrap_close.__init__cCs8|j��|j��}|dkr dStdkr,|S|d>SdS)Nrr*�)rr}r �waitr
)r��
returncoderrrr}�s

z_wrap_close.closecCs|Srrr�rrr�	__enter__�sz_wrap_close.__enter__cGs|��dSr�r}�r�r�rrr�__exit__�sz_wrap_close.__exit__cCst|j|�Sr)�getattrr)r�r
rrr�__getattr__�sz_wrap_close.__getattr__cCs
t|j�Sr)�iterrr�rrrr��sz_wrap_close.__iter__N)	r�r�r�r�r}r%r(r*r�rrrrr�s	rcOs4t|t�stdt|���ddl}|j|f|�|�S)Nz&invalid fd type (%s, expected integer)r)rRrzr�r�rr:)�fdr��kwargsrrrrr�s
cCs�t|ttf�r|St|�}z|�|�}Wn0tk
rXt|d�rF�ntd|j��YnXt|ttf�rl|Std�	|jt|�j���dS)N�
__fspath__z/expected str, bytes or os.PathLike object, not z7expected {}.__fspath__() to return str or bytes, not {})
rRr.rSr�r.r!r{r�r�r�)r�	path_type�	path_reprrrr�_fspaths"
��r1r^c@s&eZdZejdd��Zedd��ZdS)�PathLikecCst�dSr)�NotImplementedErrorr�rrrr.,szPathLike.__fspath__cCs|tkrt|d�StS)Nr.)r2r�NotImplemented)�cls�subclassrrr�__subclasshook__1s
zPathLike.__subclasshook__N)r�r�r��abc�abstractmethodr.�classmethodr7rrrrr2(s
r2c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�_AddedDllDirectorycCs||_||_||_dSr)r�_cookie�_remove_dll_directory)r�r�cookieZremove_dll_directoryrrrr�:sz_AddedDllDirectory.__init__cCs|�|j�d|_dSr)r=r<rr�rrrr}>sz_AddedDllDirectory.closecCs|Srrr�rrrr%Asz_AddedDllDirectory.__enter__cGs|��dSrr&r'rrrr(Csz_AddedDllDirectory.__exit__cCs|jrd�|j�SdS)Nz<AddedDllDirectory({!r})>z<AddedDllDirectory()>)rr�r�rrrr�Esz_AddedDllDirectory.__repr__N)r�r�r�r�r}r%r(r�rrrrr;9s
r;cCs ddl}|�|�}t|||j�S)Nr)r*Z_add_dll_directoryr;r=)rr*r>rrr�add_dll_directoryJs

�r?)rKF)TNF)rtTN)N)N)N)N)rr�)gr8r�r4r~�_collections_abcr�builtin_module_namesZ_namesr rr$r
rr%r(rb�ImportError�	posixpathrr)�extendr*Zntpath�modulesZos.pathrrrrr	rrrrr+r0�setr,�supports_dir_fd�supports_effective_idsr-�supports_fd�supports_follow_symlinksr
rrrPrZr]rfr:rBr�r�r�r�r�r�r�r�r�rr�r�r�r��	NameErrorr�r�r�r�r�r�r�r�rSr�r�r�rrr�r�r�rr�r	r
rrr
rrrrrr1r^r��ABCr2r;r?rrrr�<module>s��

(











































 

08
		
 
-7





�


	

	


	

__pycache__/bz2.cpython-38.pyc000064400000026267151153537600012124 0ustar00U

e5d1�@s�dZddddddgZdZdd	lmZdd
lZdd
lZdd
lZdd
l	Z	ddl
mZddlm
Z
mZdZd
ZdZe�ZGdd�de	j�Zddd�Zddd�Zdd�Zd
S)z�Interface to the libbzip2 compression library.

This module provides a file interface, classes for incremental
(de)compression, and functions for one-shot (de)compression.
�BZ2File�
BZ2Compressor�BZ2Decompressor�open�compress�
decompressz%Nadeem Vawda <nadeem.vawda@gmail.com>�)rN)�RLock)rr��c@s�eZdZdZdedfdd�Zdd�Zedd	��Zd
d�Z	dd
�Z
dd�Zdd�Zd)dd�Z
d*dd�Zd+dd�Zdd�Zd,dd�Zd-dd�Zd d!�Zd"d#�Zejfd$d%�Zd&d'�Zd(S).ra@A file object providing transparent bzip2 (de)compression.

    A BZ2File can act as a wrapper for an existing file object, or refer
    directly to a named file on disk.

    Note that BZ2File provides a *binary* file interface - data read is
    returned as bytes, and data to be written should be given as bytes.
    �r�	cCsTt�|_d|_d|_t|_|tk	r2tjdt	dd�d|krFdksPnt
d��|d	krbd
}t}nb|dkr~d}t}t
|�|_nF|d
kr�d}t}t
|�|_n*|dkr�d}t}t
|�|_nt
d|f��t|tttjf�r�t||�|_d|_||_n.t|d��st|d��r||_||_ntd��|jtk�rJtj|jttd�}t�|�|_nd|_dS)aOOpen a bzip2-compressed file.

        If filename is a str, bytes, or PathLike object, it gives the
        name of the file to be opened. Otherwise, it should be a file
        object, which will be used to read or write the compressed data.

        mode can be 'r' for reading (default), 'w' for (over)writing,
        'x' for creating exclusively, or 'a' for appending. These can
        equivalently be given as 'rb', 'wb', 'xb', and 'ab'.

        buffering is ignored since Python 3.0. Its use is deprecated.

        If mode is 'w', 'x' or 'a', compresslevel can be a number between 1
        and 9 specifying the level of compression: 1 produces the least
        compression, and 9 (default) produces the most compression.

        If mode is 'r', the input file may be the concatenation of
        multiple compressed streams.
        NFzGUse of 'buffering' argument is deprecated and ignored since Python 3.0.�)�
stacklevelr	rz%compresslevel must be between 1 and 9)�r�rbr)�w�wbr)�x�xbr)�a�abr�Invalid mode: %rT�read�writez6filename must be a str, bytes, file or PathLike object)Ztrailing_errorr)r�_lock�_fp�_closefp�_MODE_CLOSED�_mode�	_sentinel�warnings�warn�DeprecationWarning�
ValueError�
_MODE_READ�_MODE_WRITEr�_compressor�
isinstance�str�bytes�os�PathLike�
_builtin_open�hasattr�	TypeError�_compressionZDecompressReaderr�OSError�io�BufferedReader�_buffer�_pos)�self�filename�mode�	buffering�
compresslevelZ	mode_code�raw�r;�/usr/lib64/python3.8/bz2.py�__init__)sT��zBZ2File.__init__cCs�|j��|jtkr W5QR�dSz<|jtkr8|j��n"|jtkrZ|j�	|j
���d|_
W5z|jrp|j��W5d|_d|_t|_d|_XXW5QRXdS)z�Flush and close the file.

        May be called more than once without error. Once the file is
        closed, any other operation on it will raise a ValueError.
        NF)rrrrrr3�closer$r%rr&�flush�r5r;r;r<r>ps 



z
BZ2File.closecCs
|jtkS)zTrue if this file is closed.)rrr@r;r;r<�closed�szBZ2File.closedcCs|��|j��S)z3Return the file descriptor for the underlying file.)�_check_not_closedr�filenor@r;r;r<rC�szBZ2File.filenocCs|��o|j��S)z)Return whether the file supports seeking.)�readabler3�seekabler@r;r;r<rE�szBZ2File.seekablecCs|��|jtkS)z/Return whether the file was opened for reading.)rBrr$r@r;r;r<rD�szBZ2File.readablecCs|��|jtkS)z/Return whether the file was opened for writing.)rBrr%r@r;r;r<�writable�szBZ2File.writablerc
Cs2|j�"|��|j�|�W5QR�SQRXdS)z�Return buffered data without advancing the file position.

        Always returns at least one byte of data, unless at EOF.
        The exact number of bytes returned is unspecified.
        N)r�_check_can_readr3�peek)r5�nr;r;r<rH�szBZ2File.peek���c
Cs2|j�"|��|j�|�W5QR�SQRXdS)z�Read up to size uncompressed bytes from the file.

        If size is negative or omitted, read until EOF is reached.
        Returns b'' if the file is already at EOF.
        N)rrGr3r�r5�sizer;r;r<r�szBZ2File.readc
Cs@|j�0|��|dkrtj}|j�|�W5QR�SQRXdS)z�Read up to size uncompressed bytes, while trying to avoid
        making multiple reads from the underlying stream. Reads up to a
        buffer's worth of data if size is negative.

        Returns b'' if the file is at EOF.
        rN)rrGr1�DEFAULT_BUFFER_SIZEr3�read1rKr;r;r<rN�s
z
BZ2File.read1c
Cs2|j�"|��|j�|�W5QR�SQRXdS)zRRead bytes into b.

        Returns the number of bytes read (0 for EOF).
        N)rrGr3�readinto)r5�br;r;r<rO�szBZ2File.readintoc
CsVt|t�s$t|d�std��|��}|j�"|��|j�|�W5QR�SQRXdS)a
Read a line of uncompressed bytes from the file.

        The terminating newline (if present) is retained. If size is
        non-negative, no more than size bytes will be read (in which
        case the line may be incomplete). Returns b'' if already at EOF.
        �	__index__�Integer argument expectedN)	r'�intr-r.rQrrGr3�readlinerKr;r;r<rT�s

zBZ2File.readlinec
CsVt|t�s$t|d�std��|��}|j�"|��|j�|�W5QR�SQRXdS)z�Read a list of lines of uncompressed bytes from the file.

        size can be specified to control the number of lines read: no
        further lines will be read once the total size of the lines read
        so far equals or exceeds size.
        rQrRN)	r'rSr-r.rQrrGr3�	readlinesrKr;r;r<rU�s

zBZ2File.readlinesc
CsX|j�H|��|j�|�}|j�|�|jt|�7_t|�W5QR�SQRXdS)z�Write a byte string to the file.

        Returns the number of uncompressed bytes written, which is
        always len(data). Note that due to buffering, the file on disk
        may not reflect the data written until close() is called.
        N)rZ_check_can_writer&rrrr4�len)r5�dataZ
compressedr;r;r<r�sz
BZ2File.writec
Cs,|j�tj�||�W5QR�SQRXdS)z�Write a sequence of byte strings to the file.

        Returns the number of uncompressed bytes written.
        seq can be any iterable yielding byte strings.

        Line separators are not added between the written byte strings.
        N)rr/�
BaseStream�
writelines)r5�seqr;r;r<rY�szBZ2File.writelinesc
Cs4|j�$|��|j�||�W5QR�SQRXdS)a�Change the file position.

        The new position is specified by offset, relative to the
        position indicated by whence. Values for whence are:

            0: start of stream (default); offset must not be negative
            1: current stream position
            2: end of stream; offset must not be positive

        Returns the new file position.

        Note that seeking is emulated, so depending on the parameters,
        this operation may be extremely slow.
        N)rZ_check_can_seekr3�seek)r5�offset�whencer;r;r<r[szBZ2File.seekc
CsL|j�<|��|jtkr0|j��W5QR�S|jW5QR�SQRXdS)z!Return the current file position.N)rrBrr$r3�tellr4r@r;r;r<r^s

zBZ2File.tellN)r)rJ)rJ)rJ)rJ)�__name__�
__module__�__qualname__�__doc__rr=r>�propertyrArCrErDrFrHrrNrOrTrUrrYr1�SEEK_SETr[r^r;r;r;r<rs&	G





	

rrcCs�d|kr d|krPtd|f��n0|dk	r0td��|dk	r@td��|dk	rPtd��|�dd�}t|||d	�}d|kr�t�||||�S|SdS)
aOpen a bzip2-compressed file in binary or text mode.

    The filename argument can be an actual filename (a str, bytes, or
    PathLike object), or an existing file object to read from or write
    to.

    The mode argument can be "r", "rb", "w", "wb", "x", "xb", "a" or
    "ab" for binary mode, or "rt", "wt", "xt" or "at" for text mode.
    The default mode is "rb", and the default compresslevel is 9.

    For binary mode, this function is equivalent to the BZ2File
    constructor: BZ2File(filename, mode, compresslevel). In this case,
    the encoding, errors and newline arguments must not be provided.

    For text mode, a BZ2File object is created, and wrapped in an
    io.TextIOWrapper instance with the specified encoding, error
    handling behavior, and line ending(s).

    �trPrNz0Argument 'encoding' not supported in binary modez.Argument 'errors' not supported in binary modez/Argument 'newline' not supported in binary moder)r9)r#�replacerr1�
TextIOWrapper)r6r7r9�encoding�errors�newlineZbz_modeZbinary_filer;r;r<r!scCst|�}|�|�|��S)z�Compress a block of data.

    compresslevel, if given, must be a number between 1 and 9.

    For incremental compression, use a BZ2Compressor object instead.
    )rrr?)rWr9�compr;r;r<rJscCshg}|r^t�}z|�|�}Wn tk
r<|r6Yq^n�YnX|�|�|jsVtd��|j}qd�|�S)zjDecompress a block of data.

    For incremental decompression, use a BZ2Decompressor object instead.
    zACompressed data ended before the end-of-stream marker was reached�)rrr0�append�eofr#Zunused_data�join)rWZresultsZdecomp�resr;r;r<rUs
)rrNNN)r)rb�__all__�
__author__�builtinsrr,r1r*r r/Z	threadingrZ_bz2rrrr$r%�objectrrXrrrr;r;r;r<�<module>s6��
)
__pycache__/gettext.cpython-38.opt-2.pyc000064400000041452151153537600014044 0ustar00U

e5dj�@s�ddlZddlZddlZddlZdddddddd	d
ddd
dddddddddgZej�ejdd�Ze�	dej
ejB�Zdd�Z
dd�ZdZdd �eed!�D�Zd"d#d$d%�ZdFd'd(�Zd)d*�Zd+d,�Zd-d.�ZGd/d�d�ZGd0d�de�ZdGd2d�ZiZd3gZdddd1efd4d�Zdedfd5d�Ziaiad6adHd7d�Z dId8d	�Z!dJd9d
�Z"d:d�Z#d;d�Z$d<d�Z%d=d�Z&d>d�Z'd?d�Z(d@d
�Z)dAd�Z*dBd�Z+dCd�Z,dDd�Z-dEd�Z.eZ/dS)K�N�NullTranslations�GNUTranslations�Catalog�find�translation�install�
textdomain�bindtextdomain�bind_textdomain_codeset�dgettext�	dngettext�gettext�lgettext�	ldgettext�
ldngettext�	lngettext�ngettext�pgettext�	dpgettext�	npgettext�
dnpgettextZshare�localea�
        (?P<WHITESPACES>[ \t]+)                    | # spaces and horizontal tabs
        (?P<NUMBER>[0-9]+\b)                       | # decimal integer
        (?P<NAME>n\b)                              | # only n is allowed
        (?P<PARENTHESIS>[()])                      |
        (?P<OPERATOR>[-*/%+?:]|[><!]=?|==|&&|\|\|) | # !, *, /, %, +, -, <, >,
                                                     # <=, >=, ==, !=, &&, ||,
                                                     # ? :
                                                     # unary and bitwise ops
                                                     # not allowed
        (?P<INVALID>\w+|.)                           # invalid token
    ccsPt�t|�D]8}|j}|dkr q|�|�}|dkr>td|��|VqdVdS)NZWHITESPACESZINVALIDz invalid token in plural form: %s�)�re�finditer�_token_pattern�	lastgroup�group�
ValueError)�pluralZmoZkind�value�r!�/usr/lib64/python3.8/gettext.py�	_tokenizeWs
r#cCs|rtd|�Std�SdS)Nz#unexpected token in plural form: %szunexpected end of plural form)r)r r!r!r"�_errorbsr$))�||)�&&)z==z!=)�<�>z<=z>=)�+�-)�*�/�%cCs i|]\}}|D]
}||�qqSr!r!)�.0�iZops�opr!r!r"�
<dictcomp>ps
r1��or�andz//)r%r&r,���cCs�d}t|�}|dkr&|d7}t|�}q|dkrXt|�\}}d||f}|dkr�td��nP|dkrnd	||f}n:zt|d
�}Wntk
r�t|�d�YnXd||f}t|�}d}|tk�rt|}||krҐq|d
kr�|d
kr�d|}t�||�}t||d�\}	}d|||	f}|}q�||k�r4dk�r@nnd|}|dk�r�|dk�r�t|d�\}
}|dk�rtt|��t|�\}}d|
||f}|dk�r�d|}||fS)Nr�!znot �(z%s(%s)�)z%unbalanced parenthesis in plural form�nz%s%s�
z%s%d�d)��z(%s)r2z%s %s %sr=�?r�:z%s if %s else %s)�next�_parser�intr$�_binary_ops�	_c2py_ops�get)�tokensZpriority�result�nexttok�subr �jr/r0�rightZif_trueZif_falser!r!r"rAssP




rAcCsZzt|�}Wn(tk
r4td|jjf�d�YnXddl}|�d|jjftd�|S)Nz'Plural value must be an integer, got %srr=)�round�	TypeError�	__class__�__name__�warnings�warn�DeprecationWarning)r9r/rPr!r!r"�_as_int�s ����rScCs�t|�dkrtd��z|tt|��\}}|r2t|��d}|D]6}|dkr`|d7}|dkrptd��q:|dkr:|d8}q:d	ti}td
||�|dWStk
r�td��YnXdS)Ni�z"plural form expression is too longrr7r2�z%plural form expression is too complexr8rSz�if True:
            def func(n):
                if not isinstance(n, int):
                    n = _as_int(n)
                return int(%s)
            �func)�lenrrAr#r$rS�exec�RecursionError)rrGrHZdepth�c�nsr!r!r"�c2py�s.

��
r[c
Cs4t�|�}d}d}d}d}|�d�}|dkrN||d�}|d|�}||O}nd}|�d�}|dkr�||d�}|d|�}||O}nd}|�d�}|dkr�||d�}|d|�}||O}nd}|}	g}
t|d�D]P}||@s�|	}||@r�||7}||@�r
||7}||@�r||7}|
�|�q�|
��|
S)	Nr2�r=r�@r�.�_)rZ	normalizer�range�append�reverse)
ZlocZCOMPONENT_CODESETZCOMPONENT_TERRITORYZCOMPONENT_MODIFIER�mask�posZmodifier�codesetZ	territoryZlanguageZretr/�valr!r!r"�_expand_lang�sJ









rgc@s�eZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zddd�ZdS) rNcCs.i|_d|_d|_d|_|dk	r*|�|�dS�N)�_info�_charset�_output_charset�	_fallbackrA��self�fpr!r!r"�__init__�szNullTranslations.__init__cCsdSrhr!rmr!r!r"rAszNullTranslations._parsecCs|jr|j�|�n||_dSrh)rl�add_fallback)rn�fallbackr!r!r"rq
szNullTranslations.add_fallbackcCs|jr|j�|�S|Srh)rlr
)rn�messager!r!r"r
szNullTranslations.gettextc
Csrddl}|�dtd�|jrR|���(|�ddt�|j�|�W5QR�SQRX|jrd|�|j�S|�t	�
��S)Nr�/lgettext() is deprecated, use gettext() insteadr\�ignore�.*\blgettext\b.*)rPrQrRrl�catch_warnings�filterwarningsrrk�encoder�getpreferredencoding)rnrsrPr!r!r"rs�
�zNullTranslations.lgettextcCs*|jr|j�|||�S|dkr"|S|SdS�Nr2)rlr)rn�msgid1�msgid2r9r!r!r"r"s
zNullTranslations.ngettextc
Cs�ddl}|�dtd�|jrV|���,|�ddt�|j�|||�W5QR�SQRX|dkrd|}n|}|jrz|�|j�S|�t	�
��S)Nr�1lngettext() is deprecated, use ngettext() insteadr\ru�.*\blngettext\b.*r2)rPrQrRrlrwrxrrkryrrz�rnr|r}r9rP�tmsgr!r!r"r*s"�
�"zNullTranslations.lngettextcCs|jr|j�||�S|Srh)rlr)rn�contextrsr!r!r"r;szNullTranslations.pgettextcCs,|jr|j�||||�S|dkr$|S|SdSr{)rlr)rnr�r|r}r9r!r!r"r@s
zNullTranslations.npgettextcCs|jSrh)ri�rnr!r!r"�infoHszNullTranslations.infocCs|jSrh)rjr�r!r!r"�charsetKszNullTranslations.charsetcCsddl}|�dtd�|jS)Nrzoutput_charset() is deprecatedr\�rPrQrRrk)rnrPr!r!r"�output_charsetNs�zNullTranslations.output_charsetcCs ddl}|�dtd�||_dS)Nrz"set_output_charset() is deprecatedr\r�)rnr�rPr!r!r"�set_output_charsetTs�z#NullTranslations.set_output_charsetcCsRddl}|j|jd<|dk	rNddddddh}|t|�@D]}t||�|j|<q8dS)	Nrr_r
rrrrr)�builtinsr
�__dict__�set�getattr)rn�namesr�Zallowed�namer!r!r"rZs�zNullTranslations.install)N)N)rO�
__module__�__qualname__rprArqr
rrrrrr�r�r�r�rr!r!r!r"r�s

c@s\eZdZdZdZdZdZdd�Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�ZdS)rl�*l�$<z%s%s)rr2cCs|d?|d@fS)N�i��r!)rn�versionr!r!r"�
_get_versionspszGNUTranslations._get_versionsc"Cs�ddlm}t|dd�}i|_}dd�|_|��}t|�}|d|dd��d}||jkr||d	|dd
��\}}	}
}d}n6||jkr�|d|dd
��\}}	}
}d
}nt	dd|��|�
|�\}
}|
|jkr�t	ddt|
�|��t
d|	�D�]}||||
|
d��\}}||}|||||d��\}}||}||k�r`||k�r`|||�}|||�}nt	dd|��|dk�rld}|�d�D]�}|����}|�s��q�|�d��r�|�d��r��q�d}}d|k�r|�dd�\}}|����}|��}||j|<|}n|�r|j|d|7<|dk�r8|�d�d|_n0|dk�r�|�d�}|d�d�d}t|�|_�q�|j�pvd}d|k�r�|�d�\}} |�d�}t||�}t|�D]\}}!t|!|�|||f<�q�nt||�|t||�<|
d7}
|d7}q�dS)Nr)�unpackr�rcSst|dk�Sr{)rB)r9r!r!r"�<lambda>}�z(GNUTranslations._parse.<locals>.<lambda>z<Ir=z<4IrTz<IIz>4Iz>IIzBad magic numberzBad version number �zFile is corrupt�
z	#-#-#-#-#r?r2�
zcontent-typezcharset=zplural-forms�;zplural=�ascii�)Zstructr�r��_catalogr�readrV�LE_MAGIC�BE_MAGIC�OSErrorr��VERSIONS�strr`�split�decode�strip�
startswith�endswith�lowerrirjr[�	enumerate)"rnror��filenameZcatalogZbufZbuflen�magicr�ZmsgcountZ	masteridxZtransidxZiiZ
major_versionZ
minor_versionr/ZmlenZmoffZmendZtlenZtoffZtend�msgr�ZlastkZb_item�item�k�vrr�r|r}�xr!r!r"rAtsv














zGNUTranslations._parsecCshddl}|�dtd�t�}|j�||�}||krH|jrD|j�|�S|}|jrZ|�	|j�S|�	t
���S)Nrrtr\)rPrQrR�objectr�rErlrrkryrrz)rnrsrP�missingr�r!r!r"r�s�zGNUTranslations.lgettextcCs�ddl}|�dtd�z|j||�|�f}Wn@tk
rn|jrX|j�|||�YS|dkrf|}n|}YnX|jr�|�	|j�S|�	t
���S)Nrr~r\r2)rPrQrRr�r�KeyErrorrlrrkryrrzr�r!r!r"r�s �
zGNUTranslations.lngettextcCs6t�}|j�||�}||kr2|jr.|j�|�S|S|Srh)r�r�rErlr
)rnrsr�r�r!r!r"r
�szGNUTranslations.gettextcCs^z|j||�|�f}Wn@tk
rX|jrB|j�|||�YS|dkrP|}n|}YnX|Sr{)r�rr�rlr)rnr|r}r9r�r!r!r"r�s
zGNUTranslations.ngettextcCsF|j||f}t�}|j�||�}||krB|jr>|j�||�S|S|Srh)�CONTEXTr�r�rErlr)rnr�rs�ctxt_msg_idr�r�r!r!r"rszGNUTranslations.pgettextc	Csn|j||f}z|j||�|�f}WnBtk
rh|jrR|j�||||�YS|dkr`|}n|}YnX|Sr{)r�r�rr�rlr)rnr�r|r}r9r�r�r!r!r"rs
zGNUTranslations.npgettextN)rOr�r�r�r�r�r�r�rArrr
rrrr!r!r!r"rdsY	
FcCs�|dkrt}|dkrRg}dD]"}tj�|�}|r|�d�}q@qd|krR|�d�g}|D]$}t|�D]}||krf|�|�qfqZ|r�g}	nd}	|D]J}|dkr�q�tj�||dd|�}
tj�	|
�r�|r�|	�|
�q�|
Sq�|	S)N)ZLANGUAGE�LC_ALL�LC_MESSAGESZLANGr?�Cr�z%s.mo)
�_default_localedir�os�environrEr�rarg�path�join�exists)�domain�	localedir�	languages�allZenvarrfZnelangsZlangZnelangrG�mofiler!r!r"rs8


Zunspecifiedc
Cs|dkrt}t|||dd�}|sB|r*t�Sddlm}t|d|��d}|D]�}	|tj�|	�f}
t	�
|
�}|dkr�t|	d��}t	�|
||��}W5QRXddl
}
|
�
|�}|tk	r�ddl}|�dtd�|r�|���|�d	d
t�|�|�W5QRX|dk�r|}qJ|�|�qJ|S)NT)r�r)�ENOENTz$No translation file found for domain�rbzparameter codeset is deprecatedr\ruz.*\bset_output_charset\b.*)rrr�errnor��FileNotFoundErrorr�r��abspath�
_translationsrE�open�
setdefault�copy�_unspecifiedrPrQrRrwrxr�rq)r�r�r�Zclass_rrreZmofilesr�rGr��key�tror�rPr!r!r"rCsH�

�
�
cCst||d|d�}|�|�dS)NT)rrre)rr)r�r�rer�r�r!r!r"rnsZmessagescCs|dk	r|atSrh)�_current_domain)r�r!r!r"r|scCs|dk	r|t|<t�|t�Srh)�_localedirsrEr�)r�r�r!r!r"r	�scCs0ddl}|�dtd�|dk	r&|t|<t�|�S)Nrz'bind_textdomain_codeset() is deprecatedr\)rPrQrR�_localecodesetsrE)r�rerPr!r!r"r
�s�cCs:zt|t�|d��}Wntk
r.|YSX|�|�Srh)rr�rEr�r
)r�rsr�r!r!r"r�s

c
Cs�ddl}|�dtd�t�|�}z<|���*|�ddt�t|t�|d�|d�}W5QRXWn&t	k
r�|�
|pzt���YSX|���&|�ddt�|�
|�W5QR�SQRXdS)Nrz1ldgettext() is deprecated, use dgettext() insteadr\ru�.*\bparameter codeset\b.*�rerv)rPrQrRr�rErwrxrr�r�ryrrzr)r�rsrPrer�r!r!r"r�s&�

�$
�cCsRzt|t�|d��}Wn,tk
rB|dkr6|YS|YSYnX|�|||�Sr{)rr�rEr�r)r�r|r}r9r�r!r!r"r�sc
Cs�ddl}|�dtd�t�|�}z<|���*|�ddt�t|t�|d�|d�}W5QRXWn8t	k
r�|dkrz|}n|}|�
|p�t���YSX|���*|�ddt�|�
|||�W5QR�SQRXdS)	Nrz3ldngettext() is deprecated, use dngettext() insteadr\rur�r�r2r)rPrQrRr�rErwrxrr�r�ryrrzr)r�r|r}r9rPrer�r�r!r!r"r�s,�

�$
�cCs<zt|t�|d��}Wntk
r.|YSX|�||�Srh)rr�rEr�r)r�r�rsr�r!r!r"r�s

cCsTzt|t�|d��}Wn,tk
rB|dkr6|YS|YSYnX|�||||�Sr{)rr�rEr�r)r�r�r|r}r9r�r!r!r"r�scCs
tt|�Srh)rr�)rsr!r!r"r
�sc
CsNddl}|�dtd�|���&|�ddt�tt|�W5QR�SQRXdS)Nrrtr\ruz.*\bldgettext\b.*)rPrQrRrwrxrr�)rsrPr!r!r"r�s�
�cCstt|||�Srh)rr�)r|r}r9r!r!r"r�sc
CsRddl}|�dtd�|���*|�ddt�tt|||�W5QR�SQRXdS)Nrr~r\ruz.*\bldngettext\b.*)rPrQrRrwrxrr�)r|r}r9rPr!r!r"r�s�
�cCstt||�Srh)rr�)r�rsr!r!r"r�scCstt||||�Srh)rr�)r�r|r}r9r!r!r"r�s)r5)NNF)N)N)N)0rr�r�sys�__all__r�r��base_prefixr��compile�VERBOSE�DOTALLrr#r$rCr�rDrArSr[rgrrrr�r�rrr�r�r�rr	r
rrrrrrr
rrrrrrr!r!r!r"�<module>1s��
�

1$*f7
&�
+




	
__pycache__/pty.cpython-38.pyc000064400000007565151153537600012243 0ustar00U

e5d��@s�dZddlmZddlZddlZddlZdddgZdZdZdZdZ	d	d�Z
d
d�Zdd
�Zdd�Z
dd�Zdd�Zdd�Zeefdd�Zeefdd�ZdS)zPseudo terminal utilities.�)�selectN�openpty�fork�spawn��c	Cs>z
t��WSttfk
r"YnXt�\}}t|�}||fS)zdopenpty() -> (master_fd, slave_fd)
    Open a pty master/slave pair, using os.openpty() if possible.)�osr�AttributeError�OSError�_open_terminal�
slave_open)�	master_fd�
slave_name�slave_fd�r�/usr/lib64/python3.8/pty.pyrs

c	CsLzt��\}}Wnttfk
r(YnXt�|�}t�|�||fSt�S)z�master_open() -> (master_fd, slave_name)
    Open a pty master and return the fd, and the filename of the slave end.
    Deprecated, use openpty() instead.)rrr	r
�ttyname�closer)r
rrrrr�master_open"s

rc
CsndD]\}dD]R}d||}zt�|tj�}Wntk
rFYqYnX|d||fSqtd��dS)z1Open pty master and return (master_fd, tty_name).ZpqrstuvwxyzPQRSTZ0123456789abcdefz/dev/ptyz/dev/ttyzout of pty devicesN)r�open�O_RDWRr
)�x�yZpty_name�fdrrrr2s
rcCsrt�|tj�}zddlm}m}Wntk
r:|YSXz|||d�|||d�Wntk
rlYnX|S)z�slave_open(tty_name) -> slave_fd
    Open the pty slave and acquire the controlling terminal, returning
    opened filedescriptor.
    Deprecated, use openpty() instead.r)�ioctl�I_PUSHZptemZldterm)rrrZfcntlrr�ImportErrorr
)Ztty_name�resultrrrrrr>s
rc	Cs�zt��\}}Wnttfk
r(Yn4X|tkrTzt��Wntk
rRYnX||fSt�\}}t��}|tkr�t��t�|�t�	|t
�t�	|t�t�	|t�|tkr�t�|�t�
t�t�tj�}t�|�n
t�|�||fS)zdfork() -> (pid, master_fd)
    Fork and make the child a session leader with a controlling terminal.)r�forkptyr	r
�CHILD�setsidrrr�dup2�STDIN_FILENO�
STDOUT_FILENO�
STDERR_FILENOrrr)�pidrr
rZtmp_fdrrrrPs0



cCs"|rt�||�}||d�}qdS)z#Write all the data to a descriptor.N)r�write)r�data�nrrr�_writenxsr)cCst�|d�S)zDefault read function.i)r�read)rrrr�_read~sr+cCsv|tg}t|gg�\}}}||krF||�}|s:|�|�nt�t|�t|kr|t�}|sf|�t�qt||�qdS)z�Parent copy loop.
    Copies
            pty master -> standard output   (master_read)
            standard input -> pty master    (stdin_read)N)r"r�removerr&r#r))r
�master_read�
stdin_readZfdsZrfdsZwfdsZxfdsr'rrr�_copy�sr/cCs�t|�td�kr|f}t�d|�t�\}}|tkrHtj|df|��zt�t	�}t�
t	�d}Wntjk
r~d}YnXzt|||�Wn(t
k
r�|r�t�t	tj|�YnXt�|�t�|d�dS)zCreate a spawned process.�z	pty.spawnrr)�type�sys�auditrrr�execlp�ttyZ	tcgetattrr"Zsetraw�errorr/r
Z	tcsetattrZ	TCSAFLUSHr�waitpid)�argvr-r.r%r
�modeZrestorerrrr�s&




)�__doc__rrr2r5�__all__r"r#r$rrrrrrr)r+r/rrrrr�<module>s$
(__pycache__/site.cpython-38.opt-1.pyc000064400000041121151153537600013314 0ustar00U

&�.eNU�@s&dZddlZddlZddlZddlZddlZejejgada	da
dadd�Zdd�Z
dd�Zd	d
�Zdd�Zd2d
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd3dd�Zd4dd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Z d-d.�Z!ej"j#�s
e!�d/d0�Z$e%d1k�r"e$�dS)5a�Append module search paths for third-party packages to sys.path.

****************************************************************
* This module is automatically imported during initialization. *
****************************************************************

This will append site-specific paths to the module search path.  On
Unix (including Mac OSX), it starts with sys.prefix and
sys.exec_prefix (if different) and appends
lib/python<version>/site-packages.
On other platforms (such as Windows), it tries each of the
prefixes directly, as well as with lib/site-packages appended.  The
resulting directories, if they exist, are appended to sys.path, and
also inspected for path configuration files.

If a file named "pyvenv.cfg" exists one directory above sys.executable,
sys.prefix and sys.exec_prefix are set to that directory and
it is also checked for site-packages (sys.base_prefix and
sys.base_exec_prefix will always be the "real" prefixes of the Python
installation). If "pyvenv.cfg" (a bootstrap configuration file) contains
the key "include-system-site-packages" set to anything other than "false"
(case-insensitive), the system-level prefixes will still also be
searched for site-packages; otherwise they won't.

All of the resulting site-specific directories, if they exist, are
appended to sys.path, and also inspected for path configuration
files.

A path configuration file is a file whose name has the form
<package>.pth; its contents are additional directories (one per line)
to be added to sys.path.  Non-existing directories (or
non-directories) are never added to sys.path; no directory is added to
sys.path more than once.  Blank lines and lines beginning with
'#' are skipped. Lines starting with 'import' are executed.

For example, suppose sys.prefix and sys.exec_prefix are set to
/usr/local and there is a directory /usr/local/lib/python2.5/site-packages
with three subdirectories, foo, bar and spam, and two path
configuration files, foo.pth and bar.pth.  Assume foo.pth contains the
following:

  # foo package configuration
  foo
  bar
  bletch

and bar.pth contains:

  # bar package configuration
  bar

Then the following directories are added to sys.path, in this order:

  /usr/local/lib/python2.5/site-packages/bar
  /usr/local/lib/python2.5/site-packages/foo

Note that bletch is omitted because it doesn't exist; bar precedes foo
because bar.pth comes alphabetically before foo.pth; and spam is
omitted because it is not mentioned in either path configuration file.

The readline module is also automatically configured to enable
completion for systems that support it.  This can be overridden in
sitecustomize, usercustomize or PYTHONSTARTUP.  Starting Python in
isolated mode (-I) disables automatic readline configuration.

After these operations, an attempt is made to import a module
named sitecustomize, which can perform arbitrary additional
site-specific customizations.  If this import fails with an
ImportError exception, it is silently ignored.
�NcGsBtjj|�}ztj�|�}Wntk
r0YnX|tj�|�fS�N)�os�path�join�abspath�OSError�normcase)�paths�dir�r�/usr/lib64/python3.8/site.py�makepath[sr
cCs�ttj���D]~}tt|dd�dd�dkr,qztj�|j�|_Wnt	t
tfk
rZYnXztj�|j�|_Wqt	t
tfk
r�YqXqdS)zESet all module __file__ and __cached__ attributes to an absolute path�
__loader__N�
__module__)�_frozen_importlib�_frozen_importlib_external)
�set�sys�modules�values�getattrrrr�__file__�AttributeErrorr�	TypeError�
__cached__)�mrrr�	abs_pathsds�rcCsPg}t�}tjD],}t|�\}}||kr|�|�|�|�q|tjdd�<|S)zK Remove duplicate entries from sys.path along with making them
    absoluteN)rrrr
�append�add)�L�known_pathsr
�dircaserrr�removeduppathsts

r"c	CsVt�}tjD]D}z&tj�|�r4t|�\}}|�|�Wqtk
rNYqYqXq|S)zEReturn a set containing all existing file system items from sys.path.)rrrr�existsr
rr)�d�item�_�itemcaserrr�_init_pathinfo�s
r(cCsr|dkrt�}d}nd}tj�||�}zt�t�|��}Wntk
rPYdSX|��t|�D]�\}}|�	d�rvqbzZ|�	d�r�t
|�Wqb|��}t||�\}}	|	|kr�tj�
|�r�tj�|�|�|	�Wqbtk
�rVtd�|d|�tjd�d	dl}
|
jt���D](}|��D]}td
|tjd��q�qtdtjd�Y�qZYqbXqbW5QRX|�rnd}|S)z�Process a .pth file within the site-packages directory:
       For each line in the file, either combine it with sitedir to a path
       and add that to known_paths, or execute it if it starts with 'import '.
    NTF�#)zimport zimport	z"Error processing line {:d} of {}:
�)�filerz  z
Remainder of file ignored)r(rrr�io�
TextIOWrapper�	open_coder�	enumerate�
startswith�exec�rstripr
r#rrr�	Exception�print�format�stderr�	traceback�format_exception�exc_info�
splitlines)�sitedir�namer �reset�fullname�f�n�liner
r!r7�recordrrr�
addpackage�sF

�rCcCs�|dkrt�}d}nd}t|�\}}||krBtj�|�|�|�zt�|�}Wntk
rfYdSXdd�|D�}t	|�D]}t
|||�q~|r�d}|S)zTAdd 'sitedir' argument to sys.path if missing and handle .pth files in
    'sitedir'NTFcSsg|]}|�d�r|�qS)z.pth)�endswith)�.0r<rrr�
<listcomp>�s
zaddsitedir.<locals>.<listcomp>)r(r
rrrrr�listdirr�sortedrC)r;r r=�sitedircase�namesr<rrr�
addsitedir�s$
rKcCs`tjjrdSttd�r4ttd�r4t��t��kr4dSttd�r\ttd�r\t��t��kr\dSdS)a,Check if user site directory is safe for inclusion

    The function tests for the command line flag (including environment var),
    process uid/gid equal to effective uid/gid.

    None: Disabled for security reasons
    False: Disabled by user (command line option)
    True: Safe and enabled
    F�getuid�geteuidN�getgid�getegidT)	r�flags�no_user_site�hasattrrrMrLrOrNrrrr�check_enableusersite�s
rScCsztj�dd�}|r|Sdd�}tjdkrBtj�d�p6d}||d�Stjdkrptjrp|dd	tjd
tjdd��S|dd�S)
N�PYTHONUSERBASEcWstj�tjj|��Sr)rr�
expanduserr)�argsrrr�joinuser�sz_getuserbase.<locals>.joinuser�nt�APPDATA�~�Python�darwin�Libraryz%d.%d�z.local)r�environ�getr<r�platform�
_framework�version_info)�env_baserW�baserrr�_getuserbase�s


�rfcCsdtj}tjdkr,|�d|d�|d�d�StjdkrFtjrF|�d�S|�d|d�d	|d�d
�S)NrXz\Pythonrr*z\site-packagesr\z/lib/python/site-packagesz/lib/python�.z/site-packages)rrcrr<rarb)�userbase�versionrrr�	_get_path
s

rjcCstdkrt�atS)z�Returns the `user base` directory path.

    The `user base` directory can be used to store data. If the global
    variable ``USER_BASE`` is not initialized yet, this function will also set
    it.
    N)�	USER_BASErfrrrr�getuserbasesrlcCst�}tdkrt|�atS)z�Returns the user-specific site-packages directory path.

    If the global variable ``USER_SITE`` is not initialized yet, this
    function will also set it.
    N)rl�	USER_SITErj)rhrrr�getusersitepackages#srncCs$t�}tr tj�|�r t||�|S)z�Add a per user site-package to sys.path

    Each user has its own python directory with site-packages in the
    home directory.
    )rn�ENABLE_USER_SITErr�isdirrK)r �	user_siterrr�addusersitepackages1s
rrcCs�g}t�}|dkrt}|D]�}|r||kr,q|�|�tjdkr�|�tj�|ddtj	dd�d��|�tj�|ddtj
dd	�d��q|�|�|�tj�|dd��|�tj�|dd��q|S)
aReturns a list containing all global site-packages directories.

    For each directory present in ``prefixes`` (or the global ``PREFIXES``),
    this function will find its `site-packages` subdirectory depending on the
    system environment, and will return a list of full paths.
    N�/�lib64�python�z
site-packages�libzpython%d.%dr^)r�PREFIXESrr�seprrrrrirc)�prefixes�sitepackages�seen�prefixrrr�getsitepackages?s*

��
r~cCsBtrdtjkrt�dd�t|�D]}tj�|�r"t||�q"|S)z�Add site-packages to sys.path

    '/usr/local' is included in PREFIXES if RPM build is not detected
    to make packages installed into this location visible.

    �RPM_BUILD_ROOTrz
/usr/local)	rorr_rx�insertr~rrprK)r rzr;rrr�addsitepackages^sr�cCs4tjdkrd}nd}t�d|�t_t�d|�t_dS)z�Define new builtins 'quit' and 'exit'.

    These are objects which make the interpreter exit when called.
    The repr of each object contains a hint at how it works.

    �\zCtrl-Z plus ReturnzCtrl-D (i.e. EOF)�quit�exitN)rry�
_sitebuiltins�Quitter�builtinsr�r�)�eofrrr�setquitms

r�cCs�t�dtj�t_tjdd�dkr2t�dd�t_nt�dd�t_gg}}ttd�r�tj	�
tj�}|�d	d
g�|�tj	�
|tj�|tjg�t�dd||�t_dS)
z)Set 'copyright' and 'credits' in builtins�	copyrightN��java�creditsz?Jython is maintained by the Jython developers (www.jython.org).z�    Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands
    for supporting Python development.  See www.python.org for more information.rzLICENSE.txt�LICENSE�licensez'See https://www.python.org/psf/license/)r��_Printerrr�r�rar�rRrr�dirnamer�extendr�pardir�curdirr�)�files�dirs�hererrr�setcopyright}s$�

�r�cCst��t_dSr)r��_Helperr��helprrrr�	sethelper�sr�cCsdd�}|t_dS)ajEnable default readline configuration on interactive prompts, by
    registering a sys.__interactivehook__.

    If the readline module can be imported, the hook will set the Tab key
    as completion key and register ~/.python_history as history file.
    This can be overridden in the sitecustomize or usercustomize module,
    or in a PYTHONSTARTUP file.
    cs�ddl}zddl�ddl}Wntk
r2YdSXt�dd�}|dk	r\d|kr\��d�n
��d�z���Wntk
r�YnX���dkr�t	j
�t	j
�d�d��z��
��Wntk
r�YnX��fd	d
�}|�|�dS)Nr�__doc__��libeditzbind ^I rl_completez
tab: completerZz.python_historycs(z����Wntk
r"YnXdSr)�write_history_filerr��history�readlinerr�
write_history�szCenablerlcompleter.<locals>.register_readline.<locals>.write_history)�atexitr��rlcompleter�ImportErrorr�parse_and_bind�read_init_filer�get_current_history_lengthrrrrU�read_history_file�register)r�r��readline_docr�rr�r�register_readline�s0
�z,enablerlcompleter.<locals>.register_readlineN)r�__interactivehook__)r�rrr�enablerlcompleter�s	0r�c	CsHtj}tjdkr*d|kr*tjd}t_ntj}tj�tj�|��\}}tj�	|�}dt_
d}dd�tj�||�tj�||�fD�}|�rD|d}d}	t|dd	��\}
|
D]P}d
|kr�|�
d
�\}}}
|����}|
��}
|dkr�|
��}	q�|dkr�|
t_
q�W5QRX|t_t_t|tjg�|	dk�r8t�dtj�ntjgad
a|S)Nr\�__PYVENV_LAUNCHER__z
pyvenv.cfgcSsg|]}tj�|�r|�qSr)rr�isfile)rE�conffilerrrrF�s�zvenv.<locals>.<listcomp>r�truezutf-8)�encoding�=zinclude-system-site-packages�homeF)rr_rra�_base_executable�
executabler�splitrr��_homer�open�	partition�strip�lowerr}�exec_prefixr�rxr�ro)r �envr��exe_dirr&�site_prefix�
conf_basename�candidate_confs�virtual_conf�system_siter?rA�key�valuerrr�venv�sB��

r�c
Cs�zBzddl}Wn0tk
r>}z|jdkr,n�W5d}~XYnXWnRtk
r�}z4tjjrltjt���ntj	�
d|jj|f�W5d}~XYnXdS)z,Run custom site specific code, if available.rN�
sitecustomizez@Error in sitecustomize; set PYTHONVERBOSE for traceback:
%s: %s
)
r�r�r<r3rrP�verbose�
excepthookr9r6�write�	__class__�__name__)r��exc�errrrr�execsitecustomizes

��r�c
Cs�zBzddl}Wn0tk
r>}z|jdkr,n�W5d}~XYnXWnRtk
r�}z4tjjrltjt���ntj	�
d|jj|f�W5d}~XYnXdS)z,Run custom user specific code, if available.rN�
usercustomizez@Error in usercustomize; set PYTHONVERBOSE for traceback:
%s: %s
)
r�r�r<r3rrPr�r�r9r6r�r�r�)r�r�r�rrr�execusercustomizes

��r�cCs~tjdd�}t�}|tjkr$t�t|�}tdkr:t�at|�}t|�}t	�t
�t�tjj
sjt�t�trzt�dS)z�Add standard site-specific directories to the module search path.

    This function is called automatically when this module is imported,
    unless the python interpreter was started with the -S flag.
    N)rrr"rr�rorSrrr�r�r�r�rP�isolatedr�r�r�)�	orig_pathr rrr�main/s"
r�cCs\d}tjdd�}|s�t�}t�}td�tjD]}td|f�q0td�td|tj�|�rbdndf�td	|tj�|�r�dndf�td
t�t�	d�g}d|kr�|�
t�d
|kr�|�
t�|�r(ttj
�|��tr�t�	d�n6tdk�rt�	d�n tdk�rt�	d�n
t�	d�n0ddl}t|�|tjdtj
f��t�	d�dS)Na�    %s [--user-base] [--user-site]

    Without arguments print some useful information
    With arguments print the value of USER_BASE and/or USER_SITE separated
    by '%s'.

    Exit codes with --user-base or --user-site:
      0 - user site directory is enabled
      1 - user site directory is disabled by user
      2 - uses site directory is disabled by super user
          or for security reasons
     >2 - unknown error
    r*zsys.path = [z    %r,�]zUSER_BASE: %r (%s)r#z
doesn't existzUSER_SITE: %r (%s)zENABLE_USER_SITE: %rrz--user-basez--user-siteFr^rv�
)r�argvrlrnr4rrrpror�rrkrm�pathsepr�textwrap�dedent)r�rV�	user_baserqr
�bufferr�rrr�_scriptQsD
��




r��__main__)N)N)N)&r�rrr�r�r,r}r�rxrormrkr
rr"r(rCrKrSrfrjrlrnrrr~r�r�r�r�r�r�r�r�r�rP�no_siter�r�rrrr�<module>sHG	
*
 


;4
3
__pycache__/zipapp.cpython-38.opt-2.pyc000064400000011110151153537600013647 0ustar00U

e5do�@s�ddlZddlZddlZddlZddlZddlZddlZdddgZdZej	�
d�rXdZne��ZGdd�de
�Zejd	d
��Zdd�Zdd
d�Zddd�Zdd�Zddd�Zedkr�e�dS)�N�ZipAppError�create_archive�get_interpreterz8# -*- coding: utf-8 -*-
import {module}
{module}.{fn}()
�win�utf-8c@seZdZdS)rN)�__name__�
__module__�__qualname__�r
r
�/usr/lib64/python3.8/zipapp.pyr!sc	cs8t|ttjf�r.t||��}|VW5QRXn|VdS�N)�
isinstance�str�os�PathLike�open)�archive�mode�fr
r
r�_maybe_open%srcCs$|r d|�t�d}|�|�dS)N�#!�
)�encode�shebang_encoding�write)r�interpreterZshebangr
r
r�_write_file_prefix.src
Cs�t|d��Z}|�d�}|dkr*d}|��t|d��&}t||�|�|�t�||�W5QRXW5QRX|r�t|t�r�t	�
|t	�|�jtj
B�dS)N�rb�r��wb)r�read�readlinerr�shutilZcopyfileobjr
rr�chmod�stat�st_mode�S_IEXEC)rZnew_archiver�srcZfirst_2Zdstr
r
r�
_copy_archive5s


 r)Fc
Cs�d}t|d�rt|d�rd}nt�|�}|��r4d}|rHt|||�dS|��sXtd��|d��}|rt|rttd��|s�|s�td��d}|r�|�d	�\}	}
}td
d�|	�	d�D��}td
d�|�	d�D��}
|
d	kr�|r�|
s�td|��t
j|	|d�}|dk�r|�d�}nt|d��s"t�|�}t
|d���}t||�|�rDtjntj}tj|d|d��^}|�d�D]4}|�|�}|dk�s�||��rf|�||����qf|�r�|�d|�d��W5QRXW5QRX|�r�t|d��s�|�|��jtjB�dS)NFr!r"TzSource does not existz__main__.pyz8Cannot specify entry point if the source has __main__.pyzArchive has no entry point�:css|]}|��VqdSr��isidentifier��.0�partr
r
r�	<genexpr>{sz!create_archive.<locals>.<genexpr>�.css|]}|��VqdSrr+r-r
r
rr0|szInvalid entry point: )�module�fnz.pyzrr �w)�compression�*r)�hasattr�pathlib�Path�is_filer)�existsr�	partition�all�split�
MAIN_TEMPLATE�formatZwith_suffixrr�zipfileZZIP_DEFLATEDZ
ZIP_STOREDZZipFileZrglob�relative_torZas_posixZwritestrrr$r%r&r')�source�targetr�main�filter�
compressedZsource_is_fileZhas_mainZmain_py�mod�sepr3Zmod_okZfn_ok�fdr5�zZchildZarcnamer
r
rrLsX
�


�
&c
CsFt|d��2}|�d�dkr8|�����t�W5QR�SW5QRXdS)Nrrr)rr!r"�strip�decoder)rrr
r
rr�scCs<ddl}|��}|jddddd�|jddddd�|jd	d
ddd�|jdd
ddd�|jddddd�|jddd�|�|�}|jr�tj�|j�s�t	d��t
|j�}td�|p�d��t
�d�tj�|j��r|jdk�stj�|j��rtj�|j|j��rt	d��|j�rt	d��t|j|j|j|j|jd�dS)Nrz--outputz-ozAThe name of the output archive. Required if SOURCE is an archive.)�default�helpz--pythonz-pzEThe name of the Python interpreter to use (default: no shebang line).z--mainz-mzLThe main function of the application (default: use an existing __main__.py).z
--compressz-c�
store_truezQCompress files with the deflate method. Files are stored uncompressed by default.)�actionrOz--infoFz)Display the interpreter from the archive.)rNrQrOrCz'Source directory (or existing archive).)rOz%Can only get info for an archive filezInterpreter: {}z<none>z-In-place editing of archives is not supportedz,Cannot change the main function when copying)rrErG)�argparse�ArgumentParser�add_argument�
parse_args�infor�path�isfilerC�
SystemExitr�printr@�sys�exit�outputr;�samefilerEr�python�compress)�argsrR�parserrr
r
rrE�sN
�
�
�
�
��


�
�rE�__main__)N)NNNNF)N)�
contextlibrr8r#r%r[rA�__all__r?�platform�
startswithr�getfilesystemencoding�
ValueErrorr�contextmanagerrrr)rrrErr
r
r
r�<module>s0



�
J
1__pycache__/_compression.cpython-38.opt-1.pyc000064400000010064151153537600015052 0ustar00U

e5d��@s:dZddlZejZGdd�dej�ZGdd�dej�ZdS)z7Internal classes used by the gzip, lzma and bz2 modules�Nc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�
BaseStreamzMode-checking helper functions.cCs|jrtd��dS)NzI/O operation on closed file)�closed�
ValueError��self�r�$/usr/lib64/python3.8/_compression.py�_check_not_closedszBaseStream._check_not_closedcCs|��st�d��dS)NzFile not open for reading)�readable�io�UnsupportedOperationrrrr�_check_can_readszBaseStream._check_can_readcCs|��st�d��dS)NzFile not open for writing)�writablerrrrrr�_check_can_writeszBaseStream._check_can_writecCs(|��st�d��|��s$t�d��dS)Nz3Seeking is only supported on files open for readingz3The underlying file object does not support seeking)r
rr�seekablerrrr�_check_can_seeks
zBaseStream._check_can_seekN)�__name__�
__module__�__qualname__�__doc__r	r
rrrrrrr	s
rcsjeZdZdZdd�Zddd�Z�fdd�Zd	d
�Zdd�Zddd�Z	dd�Z
ejfdd�Z
dd�Z�ZS)�DecompressReaderz5Adapts the decompressor API to a RawIOBase reader APIcCsdS)NTrrrrrr
$szDecompressReader.readablercKs>||_d|_d|_d|_||_||_|jf|j�|_||_dS)NFr���)�_fp�_eof�_pos�_size�_decomp_factory�_decomp_args�
_decompressor�_trailing_error)r�fpZdecomp_factoryZtrailing_errorZdecomp_argsrrr�__init__'szDecompressReader.__init__csd|_t���S�N)r�super�closer��	__class__rrr$;szDecompressReader.closecCs
|j��Sr")rrrrrrr?szDecompressReader.seekablec
CsPt|��:}|�d��$}|�t|��}||dt|��<W5QRXW5QRXt|�S)N�B)�
memoryview�cast�read�len)r�bZviewZ	byte_view�datarrr�readintoBs$zDecompressReader.readintorcCs�|dkr|��S|r|jrdSd}|jjr�|jjp<|j�t�}|sDq�|jf|j	�|_z|j�
||�}Wq�|jk
r�Yq�Yq�Xn4|jjr�|j�t�}|s�t
d��nd}|j�
||�}|r"q�q"|s�d|_|j|_dS|jt|�7_|S)Nr�zACompressed file ended before the end-of-stream marker was reachedT)�readallrr�eofZunused_datarr*�BUFFER_SIZErr�
decompressrZneeds_input�EOFErrorrrr+)r�sizer-Zrawblockrrrr*Hs@

��
zDecompressReader.readcCs,|j�d�d|_d|_|jf|j�|_dS)NrF)r�seekrrrrrrrrr�_rewindrszDecompressReader._rewindcCs�|tjkrnR|tjkr"|j|}n<|tjkrP|jdkrD|�tj�rDq6|j|}ntd�	|���||jkrr|�
�n
||j8}|dkr�|�ttj|��}|s�q�|t|�8}q||jS)NrzInvalid value for whence: {})
r�SEEK_SET�SEEK_CURr�SEEK_ENDrr*�DEFAULT_BUFFER_SIZEr�formatr7�minr+)r�offset�whencer-rrrr6xs&






zDecompressReader.seekcCs|jS)z!Return the current file position.)rrrrr�tell�szDecompressReader.tell)r)r)rrrrr
r!r$rr.r*r7rr8r6r@�
__classcell__rrr%rr!s

*r)rrr;r2�BufferedIOBaser�	RawIOBaserrrrr�<module>s__pycache__/getopt.cpython-38.opt-2.pyc000064400000007145151153537600013663 0ustar00U

e5dA�@s�ddddgZddlZzddlmZWnek
r@dd�ZYnXGd	d�de�ZeZgfd
d�Zgfdd�Z	dd
�Z
dd�Zdd�Zdd�Z
edkr�ddlZeeejdd�dddg��dS)�GetoptError�error�getopt�
gnu_getopt�N)�gettextcCs|S�N�)�srr�/usr/lib64/python3.8/getopt.py�_)�rc@s&eZdZdZdZddd�Zdd�ZdS)r�cCs||_||_t�|||�dSr)�msg�opt�	Exception�__init__)�selfrrrrr
r.szGetoptError.__init__cCs|jSr)r)rrrr
�__str__3szGetoptError.__str__N)r
)�__name__�
__module__�__qualname__rrrrrrrr
r+s
cCs�g}t|�td�kr|g}nt|�}|r�|d�d�r�|ddkr�|ddkr\|dd�}q�|d�d�r�t||ddd�||dd��\}}q$t||ddd�||dd��\}}q$||fS)Nr
r�-�--��)�type�list�
startswith�do_longs�	do_shorts)�args�	shortopts�longopts�optsrrr
r8s((cCs6g}g}t|t�r|g}nt|�}|�d�r>|dd�}d}ntj�d�rPd}nd}|�r.|ddkrz||dd�7}�q.|ddd�dkr�t||ddd�||dd��\}}qT|ddd�d	kr�|dd	kr�t||ddd�||dd��\}}qT|�r||7}�q.qT|�	|d�|dd�}qT||fS)
N�+rTZPOSIXLY_CORRECTFrrrr)
�
isinstance�strrr�os�environ�getrr�append)r r!r"r#Z	prog_argsZall_options_firstrrr
rcs2

( (cCs�z|�d�}Wntk
r&d}Yn X|d|�||dd�}}t||�\}}|r�|dkr�|svttd�||��|d|dd�}}n|dk	r�ttd�||��|�d||p�df�||fS)N�=rzoption --%s requires argumentrz%option --%s must not have an argumentrr
)�index�
ValueError�
long_has_argsrrr*)r#rr"r �i�optarg�has_argrrr
r�s
rcs��fdd�|D�}|s(ttd������|kr8d�fS�d|krLd�fSt|�dkrjttd�����|d	}|�d�}|r�|dd
�}||fS)Ncsg|]}|���r|�qSr)r)�.0�o�rrr
�
<listcomp>�s
z!long_has_args.<locals>.<listcomp>zoption --%s not recognizedFr+Trzoption --%s not a unique prefixr���)rr�len�endswith)rr"Z
possibilitiesZunique_matchr1rr4r
r.�s
r.cCs�|dkr�|d|dd�}}t||�rh|dkr\|sFttd�||��|d|dd�}}|d}}nd}|�d||f�q||fS)Nr
rrzoption -%s requires argumentr)�
short_has_argrrr*)r#Z	optstringr!r rr0rrr
r�s
�rcCsXtt|��D]4}|||kr(dkrnq|�d|d�Sqttd�||��dS)N�:rzoption -%s not recognized)�ranger7rrr)rr!r/rrr
r9�sr9�__main__rza:bzalpha=Zbeta)�__all__r'rr�ImportErrorrrrrrrr.rr9r�sys�print�argvrrrr
�<module>"s +2__pycache__/telnetlib.cpython-38.opt-1.pyc000064400000043477151153537600014352 0ustar00U

e5d�Z�@sJdZddlZddlZddlZddlmZdgZdZdZ	e
dg�Ze
dg�Ze
dg�Z
e
d	g�Ze
d
g�Ze
dg�Ze
dg�Ze
dg�Ze
d
g�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Z e
dg�Z!e
dg�Z"e
dg�Z#e
dg�Z$e
dg�Z%e
dg�Z&e
d g�Z'e
d!g�Z(e
d"g�Z)e
d#g�Z*e
d$g�Z+e
d%g�Z,e
d&g�Z-e
d'g�Z.e
d(g�Z/e
d)g�Z0e
d*g�Z1e
d+g�Z2e
dg�Z3e
d,g�Z4e
d-g�Z5e
d.g�Z6e
d/g�Z7e
d0g�Z8e
d1g�Z9e
d2g�Z:e
d3g�Z;e
d4g�Z<e
d5g�Z=e
d6g�Z>e
d7g�Z?e
d8g�Z@e
d9g�ZAe
d:g�ZBe
d;g�ZCe
d<g�ZDe
d=g�ZEe
d>g�ZFe
d?g�ZGe
d@g�ZHe
dAg�ZIe
dBg�ZJe
dCg�ZKe
dDg�ZLe
dEg�ZMe
dFg�ZNe
dGg�ZOe
dHg�ZPe
dg�ZQe
dg�ZReSedI��rejTZUnejVZUGdJd�d�ZWdKdL�ZXeYdMk�rFeX�dS)NaQTELNET client class.

Based on RFC 854: TELNET Protocol Specification, by J. Postel and
J. Reynolds

Example:

>>> from telnetlib import Telnet
>>> tn = Telnet('www.python.org', 79)   # connect to finger port
>>> tn.write(b'guido\r\n')
>>> print(tn.read_all())
Login       Name               TTY         Idle    When    Where
guido    Guido van Rossum      pts/2        <Dec  2 11:10> snag.cnri.reston..

>>>

Note that read_all() won't read until eof -- it just reads some data
-- but it guarantees to read at least one byte unless EOF is hit.

It is possible to pass a Telnet object to a selector in order to wait until
more data is available.  Note that in this case, read_eager() may return b''
even if there was data on the socket, because the protocol negotiation may have
eaten the data.  This is why EOFError is needed in some cases to distinguish
between "no data" and "connection closed" (since the socket also appears ready
for reading when it is closed).

To do:
- option negotiation
- timeout should be intrinsic to the connection object instead of an
  option on one of the read calls only

�N)�	monotonic�Telnet�������������������������������	�
���
������������������ �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1����PollSelectorc@seZdZdZddejfdd�Zdejfdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zd<dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd=d6d7�Zd8d9�Z d:d;�Z!dS)>ra�Telnet interface class.

    An instance of this class represents a connection to a telnet
    server.  The instance is initially not connected; the open()
    method must be used to establish a connection.  Alternatively, the
    host name and optional port number can be passed to the
    constructor, too.

    Don't try to reopen an already connected instance.

    This class has many read_*() methods.  Note that some of them
    raise EOFError when the end of the connection is read, because
    they can return an empty string for other reasons.  See the
    individual doc strings.

    read_until(expected, [timeout])
        Read until the expected string has been seen, or a timeout is
        hit (default is no timeout); may block.

    read_all()
        Read all data until EOF; may block.

    read_some()
        Read at least one byte or EOF; may block.

    read_very_eager()
        Read all data available already queued or on the socket,
        without blocking.

    read_eager()
        Read either data already queued or some data available on the
        socket, without blocking.

    read_lazy()
        Read all data in the raw queue (processing it first), without
        doing any socket I/O.

    read_very_lazy()
        Reads all data in the cooked queue, without doing any socket
        I/O.

    read_sb_data()
        Reads available data between SB ... SE sequence. Don't block.

    set_option_negotiation_callback(callback)
        Each time a telnet option is read on the input flow, this callback
        (if set) is called with the following parameters :
        callback(telnet socket, command, option)
            option will be chr(0) when there is no option.
        No other action is done afterwards by telnetlib.

    NrcCsht|_||_||_||_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
|dk	rd|�|||�dS)z�Constructor.

        When called without arguments, create an unconnected instance.
        With a hostname argument, it connects the instance; port number
        and timeout are optional.
        N�r)�
DEBUGLEVEL�
debuglevel�host�port�timeout�sock�rawq�irawq�cookedq�eof�iacseq�sb�sbdataq�option_callback�open��selfrLrMrN�r[�!/usr/lib64/python3.8/telnetlib.py�__init__�szTelnet.__init__cCsFd|_|st}||_||_||_t�d|||�t�||f|�|_	dS)z�Connect to a host.

        The optional second argument is the port number, which
        defaults to the standard telnet port (23).

        Don't try to reopen an already connected instance.
        rztelnetlib.Telnet.openN)
rS�TELNET_PORTrLrMrN�sys�audit�socketZcreate_connectionrOrYr[r[r\rX�szTelnet.opencCs|��dS)z#Destructor -- close the connection.N��close�rZr[r[r\�__del__�szTelnet.__del__cGs@|jdkr<td|j|jfdd�|r4t||�nt|�dS)z�Print a debug message, when the debug level is > 0.

        If extra arguments are present, they are substituted in the
        message using the standard string formatting operator.

        rzTelnet(%s,%s):� )�endN)rK�printrLrM)rZ�msg�argsr[r[r\ri�s

z
Telnet.msgcCs
||_dS)zhSet the debug level.

        The higher it is, the more debug output you get (on sys.stdout).

        N)rK)rZrKr[r[r\�set_debuglevel�szTelnet.set_debuglevelcCs.|j}d|_d|_d|_d|_|r*|��dS)zClose the connection.NTrIr)rOrSrTrUrc)rZrOr[r[r\rcszTelnet.closecCs|jS)z)Return the socket object used internally.)rOrdr[r[r\�
get_socketszTelnet.get_socketcCs
|j��S)z9Return the fileno() of the socket object used internally.)rO�filenordr[r[r\rmsz
Telnet.filenocCsBt|kr|�ttt�}t�d||�|�d|�|j�|�dS)z�Write a string to the socket, doubling any IAC characters.

        Can block if the connection is blocked.  May raise
        OSError if the connection is closed.

        ztelnetlib.Telnet.writezsend %rN)�IAC�replacer_r`rirO�sendall)rZ�bufferr[r[r\�writes
zTelnet.writec
Cs*t|�}|��|j�|�}|dkrN||}|jd|�}|j|d�|_|S|dk	r`t�|}t���}|�|tj�|j	�s|�
|�r�tdt|j�|�}|��|��|j�||�}|dkr�||}|jd|�}|j|d�|_|W5QR�S|dk	rv|t�}|dkrv�qqvW5QRX|�
�S)aRead until a given string is encountered or until timeout.

        When no match is found, return whatever is available instead,
        possibly the empty string.  Raise EOFError if the connection
        is closed and no cooked data is available.

        rN)�len�process_rawqrR�find�_time�_TelnetSelector�register�	selectors�
EVENT_READrS�select�max�	fill_rawq�read_very_lazy)rZ�matchrN�n�i�buf�deadline�selectorr[r[r\�
read_until&s8


zTelnet.read_untilcCs0|��|js |��|��q|j}d|_|S)z7Read all data until EOF; block until connection closed.rI)rtrSr}rR�rZr�r[r[r\�read_allKs
zTelnet.read_allcCs6|��|js&|js&|��|��q|j}d|_|S)z�Read at least one byte of cooked data unless EOF is hit.

        Return b'' if EOF is hit.  Block if no data is immediately
        available.

        rI)rtrRrSr}r�r[r[r\�	read_someUs
zTelnet.read_somecCs0|��|js(|��r(|��|��q|��S)aRead everything that's possible without blocking in I/O (eager).

        Raise EOFError if connection closed and no cooked data
        available.  Return b'' if no cooked data available otherwise.
        Don't block unless in the midst of an IAC sequence.

        )rtrS�
sock_availr}r~rdr[r[r\�read_very_eagerds

zTelnet.read_very_eagercCs6|��|js.|js.|��r.|��|��q|��S)z�Read readily available data.

        Raise EOFError if connection closed and no cooked data
        available.  Return b'' if no cooked data available otherwise.
        Don't block unless in the midst of an IAC sequence.

        )rtrRrSr�r}r~rdr[r[r\�
read_eagerrs

zTelnet.read_eagercCs|��|��S)aProcess and return data that's already in the queues (lazy).

        Raise EOFError if connection closed and no data available.
        Return b'' if no cooked data available otherwise.  Don't block
        unless in the midst of an IAC sequence.

        )rtr~rdr[r[r\�	read_lazy�szTelnet.read_lazycCs(|j}d|_|s$|jr$|js$td��|S)z�Return any data available in the cooked queue (very lazy).

        Raise EOFError if connection closed and no data available.
        Return b'' if no cooked data available otherwise.  Don't block.

        rIztelnet connection closed)rRrSrP�EOFErrorr�r[r[r\r~�s
zTelnet.read_very_lazycCs|j}d|_|S)aReturn any data available in the SB ... SE queue.

        Return b'' if no SB ... SE available. Should only be called
        after seeing a SB or SE command. When a new SB command is
        found, old unread SB data will be discarded. Don't block.

        rI)rVr�r[r[r\�read_sb_data�szTelnet.read_sb_datacCs
||_dS)zIProvide a callback function called after each receipt of a telnet option.N)rW)rZ�callbackr[r[r\�set_option_negotiation_callback�sz&Telnet.set_option_negotiation_callbackcCsRddg}�z|j�r|��}|jsf|tkr,q|dkr6q|tkrV||j|||j<qn|j|7_qt|j�dk�r$|ttt	t
fkr�|j|7_qd|_|tkr�||j|||j<nh|tkr�d|_d|_n&|t
kr�d|_|j|d|_d|d<|j�r|�|j|t�n|�dt|��qt|j�dkr|jdd�}d|_|}|ttfk�r�|�d|tk�rnd�ppd	t|��|j�r�|�|j||�n|j�tt
|�q|t	t
fkr|�d|t	k�r�d
�p�dt|��|j�r�|�|j||�q|j�tt|�qWn"tk
�r,d|_d|_YnX|j|d|_|j|d|_dS)
z�Transfer from raw queue to cooked queue.

        Set self.eof when connection is closed.  Don't block unless in
        the midst of an IAC sequence.

        rI�rrzIAC %d not recognizedrz	IAC %s %d�DO�DONT�WILL�WONTN)rP�rawq_getcharrT�theNULLrnrUrsr�r�r�r��SBrV�SErWrO�NOOPTri�ordrpr�rR)rZr��c�cmd�optr[r[r\rt�sp��zTelnet.process_rawqcCsZ|js|��|jrt�|j|j|jd�}|jd|_|jt|j�krVd|_d|_|S)z�Get next char from raw queue.

        Block if no data is immediately available.  Raise EOFError
        when connection is closed.

        rrIr)rPr}rSr�rQrs)rZr�r[r[r\r��szTelnet.rawq_getcharcCsL|jt|j�krd|_d|_|j�d�}|�d|�||_|j||_dS)z�Fill raw queue from exactly one recv() system call.

        Block if no data is immediately available.  Set self.eof when
        connection is closed.

        rIr�2zrecv %rN)rQrsrPrOZrecvrirSr�r[r[r\r}szTelnet.fill_rawqc
Cs:t��*}|�|tj�t|�d��W5QR�SQRXdS)z-Test whether data is available on the socket.rN)rwrxryrz�boolr{)rZr�r[r[r\r�szTelnet.sock_availc
Cs�tjdkr|��dSt���}|�|tj�|�tjtj�|��D]�\}}|j	|kr�z|�
�}Wn*tk
r�td�YW5QR�dSX|r�tj
�|�d��tj
��qD|j	tjkrDtj���d�}|s�W5QR�dS|�|�qDq<W5QRXdS)z9Interaction function, emulates a very dumb telnet client.Zwin32N�(*** Connection closed by remote host ***�ascii)r_�platform�mt_interactrwrxryrz�stdinr{Zfileobjr�r�rh�stdoutrr�decode�flush�readline�encode)rZr��keyZevents�text�liner[r[r\�interacts*

zTelnet.interactcCs<ddl}|�|jd�tj��}|s&q8|�|�d��qdS)z$Multithreaded version of interact().rNr[r�)�_thread�start_new_thread�listenerr_r�r�rrr�)rZr�r�r[r[r\r�3s
zTelnet.mt_interactcCsTz|��}Wntk
r*td�YdSX|rDtj�|�d��qtj��qdS)z>Helper for mt_interact() -- this executes in the other thread.r�Nr�)r�r�rhr_r�rrr�r�)rZ�datar[r[r\r�=szTelnet.listenerc
CsTd}|dd�}tt|��}|D]0}t||d�s |s>ddl}|�||�||<q |dk	rdt�|}t���}|�|tj	�|j
�s&|��|D]X}||�|j
�}|r�|��}	|j
d|	�}
|j
|	d�|_
|||
fW5QR�Sq�|dk	�r|�|�}|t�}|�s|dkrz�q&nqz|��qzW5QRX|��}
|
�sJ|j
�rJt�dd|
fS)a�Read until one from a list of a regular expressions matches.

        The first argument is a list of regular expressions, either
        compiled (re.Pattern instances) or uncompiled (strings).
        The optional second argument is a timeout, in seconds; default
        is no timeout.

        Return a tuple of three items: the index in the list of the
        first regular expression that matches; the re.Match object
        returned; and the text read up till and including the match.

        If EOF is read and no text was read, raise EOFError.
        Otherwise, when nothing matches, return (-1, None, text) where
        text is the text received so far (may be the empty string if a
        timeout happened).

        If a regular expression ends with a greedy match (e.g. '.*')
        or if more than one expression can match the same input, the
        results are undeterministic, and may depend on the I/O timing.

        N�searchr���)�rangers�hasattr�re�compilervrwrxryrzrSrtr�rRrgr{r}r~r�)rZ�listrNr��indicesr�r�r��m�er�Zreadyr[r[r\�expectJsB



z
Telnet.expectcCs|S�Nr[rdr[r[r\�	__enter__�szTelnet.__enter__cCs|��dSr�rb)rZ�type�value�	tracebackr[r[r\�__exit__�szTelnet.__exit__)N)N)"�__name__�
__module__�__qualname__�__doc__raZ_GLOBAL_DEFAULT_TIMEOUTr]rXrerirkrcrlrmrrr�r�r�r�r�r�r~r�r�rtr�r}r�r�r�r�r�r�r�r[r[r[r\r�s>5�


%

H

8c	Cs�d}tjdd�r2tjddkr2|d}tjd=qd}tjdd�rNtjd}d}tjdd�r�tjd}zt|�}Wn tk
r�t�|d�}YnXt��(}|�|�|j||dd	�|�	�W5QRXdS)
z�Test program for telnetlib.

    Usage: python telnetlib.py [-d] ... [host [port]]

    Default host is localhost; default port is 23.

    rrNz-dZ	localhostrZtcpg�?)rN)
r_�argv�int�
ValueErrorraZ
getservbynamerrkrXr�)rKrLrMZportstrZtnr[r[r\�test�s$



r��__main__)Zr�r_rary�timerrv�__all__rJr^�bytesrnr�r�r�r�r�r�ZNOPZDMZBRKZIPZAOZAYTZECZELZGAr�ZBINARYZECHOZRCPZSGAZNAMSZSTATUSZTMZRCTEZNAOLZNAOPZNAOCRDZNAOHTSZNAOHTDZNAOFFDZNAOVTSZNAOVTDZNAOLFDZXASCIIZLOGOUTZBMZDETZSUPDUPZSUPDUPOUTPUTZSNDLOCZTTYPEZEORZTUIDZOUTMRKZTTYLOCZVT3270REGIMEZX3PADZNAWSZTSPEEDZLFLOWZLINEMODEZXDISPLOCZOLD_ENVIRONZAUTHENTICATIONZENCRYPTZNEW_ENVIRONZTN3270EZXAUTH�CHARSETZRSPZCOM_PORT_OPTIONZSUPPRESS_LOCAL_ECHOZTLSZKERMITZSEND_URLZ	FORWARD_XZPRAGMA_LOGONZ
SSPI_LOGONZPRAGMA_HEARTBEATZEXOPLr�r�rHrwZSelectSelectorrr�r�r[r[r[r\�<module>s�#








































































__pycache__/_sysconfigdata_d_linux_x86_64-linux-gnu.cpython-38.pyc000064400000070505151153537600021102 0ustar00U

��.e]���@s`dddddddddddd	d
dddd
ddddddddddddddddddddddd	dd dd!d"d#d$d%dddd&d'dd(d)d*d&d+dd!dd,d-dddddddd.d&d&d&d&dd&dd&d&d&d&d&dddddddddd&dd&d&d&d&d&d&d&d&dd&d&d&d&d&dd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&dd&d&d&dd&dd&dd&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&d&d&dd&d&d&d&d&d&dd&d&d&d&dd&d&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&d&d&dd&ddd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&dd&d&d&d&dd&d&d&d&d&ddd&d&dd&dddd&d&d&ddd&d&dddd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&d&d&dd&d&dd&d&dd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&dd&d&d&d&d&d&dd&d&d&d&d&d&d&d&ddd&d&d&dd&d&ddd&d&d&d&d&d&d&dddddd&dd&d&dddddd&ddd&d&d&d&d&d&d&d&d&d&d&ddd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&ddd&d&d&d&ddd&d&d&ddd&dd&d&d&d&d&d&d&d&d&d&d&d&d&d&dd
d/ddd0d1d0d0d2d3d4dd5d6d7ddd8dd	d9dd:d;dd<d=dd>ddd?d@dAdBddd+ddCdDddEdd	dddd&dFdGdHdIdddJddKdLd&dMddddNdOdddddddddPdQdRdddSd&d&dddddTddddUdVdddWddXd&dYdZdd[d6d\d]dd^d&d&ddd_d`dadbdcd9dddded?dfd&dddgdhdidhdgdidgdgdhdhdgd]dgdgdgdgdhd&djdkdld&dmdnddod:d&dddddpddqdrdd&ddddsd&dtdud&d&d&d&dddd&d&ddvdwdudxdydydudz���Zd{S)|�d�z"cpython-38-x86_64-linux-gnu"ZarZrcsz!-Wno-unused-result -Wsign-comparez-IObjects -IInclude -IPython�z/usr/binz/usr/lib64/python3.8z-L. -lpython3.8dzOgcc -pthread -shared -Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -g�pythonzx86_64-redhat-linux-gnu�\zgcc -pthreadz-fPICa{-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -Ogz?configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.ina-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapvaK-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declarationz-Wl,-z,relro  -Wl,-z,now  -gz�-Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -ga�'--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--enable-ipv6' '--enable-shared' '--with-computed-gotos=yes' '--with-dbmliborder=gdbm:ndbm:bdb' '--with-system-expat' '--with-system-ffi' '--enable-loadable-sqlite-extensions' '--with-dtrace' '--with-lto' '--with-ssl-default-suites=openssl' '--with-valgrind' '--without-ensurepip' '--with-pydebug' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'CFLAGS= -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv ' 'LDFLAGS= -Wl,-z,relro  -Wl,-z,now  -g ' 'CPPFLAGS=' 'PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'z/usr/includez/usr/include/python3.8dz=/builddir/build/BUILD/Python-3.8.17/build/debug/coverage.infoz;/builddir/build/BUILD/Python-3.8.17/build/debug/lcov-reportz2--no-branch-coverage --title "CPython lcov report"zN-IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Includezg++ -pthreadzE/usr /usr/lib64 /usr/lib64/python3.8 /usr/lib64/python3.8/lib-dynloadz /usr/lib64/python3.8/lib-dynloadi�zoREADME.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in Include Lib Misc Ext-dummyzInclude Lib Misc Ext-dummyzTREADME.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in�.�z/usr/bin/dtracezInclude/pydtrace_probes.hzPython/pydtrace.ozdynload_shlib.oZnoz .cpython-38d-x86_64-linux-gnu.soi�ZyeszI/usr/include /usr/include /usr/include/python3.8d /usr/include/python3.8dz/usr/bin/install -cz/usr/bin/install -c -m 644z/usr/bin/install -c -m 755zlibpython3.8d.so.1.0zModules/_io/_iomodule.hzg++ -pthread -sharedz:-Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -gzlibpython3.8d.soz3.8dz
/usr/lib64z-lmzPython/z/usr/lib64/pkgconfigz1/usr/lib64/python3.8/config-3.8d-x86_64-linux-gnuzlibpython3.8d.az"-lcrypt -lpthread -ldl  -lutil -lmz0tkinter tkinter/test tkinter/test/test_tkinter \Zgccz-Xlinker -export-dynamic�trueZlnZlinuxz5/builddir/build/BUILD/Python-3.8.17/Modules/makesetupz/usr/share/manz/usr/bin/mkdir -pz�posix  errno  pwd  _sre  _codecs  _weakref  _functools  _operator  _collections  _abc  itertools  atexit  _signal  _stat  time  _thread  _locale  _io  faulthandler  _tracemalloc  _symtable  xxsubtypeavModules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  Modules/_sre.o  Modules/_codecsmodule.o  Modules/_weakref.o  Modules/_functoolsmodule.o  Modules/_operator.o  Modules/_collectionsmodule.o  Modules/_abc.o  Modules/itertoolsmodule.o  Modules/atexitmodule.o  Modules/signalmodule.o  Modules/_stat.o  Modules/timemodule.o  Modules/_threadmodule.o  Modules/_localemodule.o  Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o  Modules/faulthandler.o  Modules/_tracemalloc.o Modules/hashtable.o  Modules/symtablemodule.o  Modules/xxsubtype.ozx86_64-linux-gnuz -DMULTIARCH=\"x86_64-linux-gnu\"z-Wl,--no-as-neededz-lssl -lcryptoa1-DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapvz:\ Parser/myreadline.o Parser/parsetok.o Parser/tokenizer.oz-fprofile-generatez"-fprofile-use -fprofile-correctionz
-m test --pgozno-frameworkz./python -Ez	python3.8a�-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -Og -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -Og -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPIC -DPy_BUILD_CORE_BUILTINa-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -Og -I/builddir/build/BUILD/Python-3.8.17/Include/internala�-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -Og -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -Og -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPIC -DPy_BUILD_COREaT-Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g -lcryptoz"z"a-Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g�a�-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -Og -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -Og -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPICz)-x test_subprocess test_io test_lib2to3 \ZreadelfzMac/Resources/frameworkZvoidz?LD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/debugz	@SGI_ABI@z/bin/shz.so���zcpython-38d-x86_64-linux-gnuz2Parser Objects Python Modules Modules/_io Programsz:/builddir/build/BUILD/Python-3.8.17/Tools/gdb/libpython.pyz"/* Don't use ncurses extensions */z-szInclude Lib MisczHLD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/debug ./pythonz�LD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/debug ./python /builddir/build/BUILD/Python-3.8.17/Tools/scripts/run_tests.pyi�zJpython3.8 /builddir/build/BUILD/Python-3.8.17/Tools/scripts/update_file.pyz3.8z#/builddir/build/BUILD/Python-3.8.17z)xml xml/dom xml/etree xml/parsers xml/saxz//builddir/build/BUILD/Python-3.8.17/build/debugz
/usr/sharez/usr(�ZABIFLAGSZAC_APPLE_UNIVERSAL_BUILDZAIX_GENUINE_CPLUSPLUSZ	ALT_SOABIZANDROID_API_LEVELZARZARFLAGSZ
BASECFLAGSZBASECPPFLAGSZBASEMODLIBSZBINDIRZ
BINLIBDESTZ
BLDLIBRARYZ	BLDSHAREDZBUILDEXEZBUILDPYTHONZBUILD_GNU_TYPEZBYTESTR_DEPSZCCZCCSHAREDZCFLAGSZCFLAGSFORSHAREDZCFLAGS_ALIASINGZCONFIGFILESZCONFIGURE_CFLAGSZCONFIGURE_CFLAGS_NODISTZCONFIGURE_CPPFLAGSZCONFIGURE_LDFLAGSZCONFIGURE_LDFLAGS_NODISTZCONFIG_ARGSZCONFINCLUDEDIRZ
CONFINCLUDEPYZCOREPYTHONPATHZ
COVERAGE_INFOZCOVERAGE_REPORTZCOVERAGE_REPORT_OPTIONSZCPPFLAGSZCXXZDESTDIRSZDESTLIBZDESTPATHZ
DESTSHAREDZDFLAGSZDIRMODEZDISTZDISTDIRSZ	DISTFILESZ	DLINCLDIRZ
DLLLIBRARYZ"DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754ZDOUBLE_IS_BIG_ENDIAN_IEEE754ZDOUBLE_IS_LITTLE_ENDIAN_IEEE754ZDTRACEZDTRACE_DEPSZDTRACE_HEADERSZDTRACE_OBJSZDYNLOADFILEZENABLE_IPV6Z	ENSUREPIPZEXEZEXEMODEZ
EXTRATESTOPTSZ
EXT_SUFFIXZFILEMODEZFLOAT_WORDS_BIGENDIANZFLOCK_NEEDS_LIBBSDZGETPGRP_HAVE_ARGZGETTIMEOFDAY_NO_TZZ	GITBRANCHZGITTAGZ
GITVERSIONZGNULDZHAVE_ACCEPT4Z
HAVE_ACOSHZ
HAVE_ADDRINFOZ
HAVE_ALARMZHAVE_ALIGNED_REQUIREDZ
HAVE_ALLOCA_HZHAVE_ALTZONEZ
HAVE_ASINHZHAVE_ASM_TYPES_HZ
HAVE_ATANHZHAVE_BIND_TEXTDOMAIN_CODESETZHAVE_BLUETOOTH_BLUETOOTH_HZHAVE_BLUETOOTH_HZHAVE_BROKEN_MBSTOWCSZHAVE_BROKEN_NICEZHAVE_BROKEN_PIPE_BUFZHAVE_BROKEN_POLLZHAVE_BROKEN_POSIX_SEMAPHORESZHAVE_BROKEN_PTHREAD_SIGMASKZHAVE_BROKEN_SEM_GETVALUEZHAVE_BROKEN_UNSETENVZHAVE_BUILTIN_ATOMICZHAVE_CHFLAGSZ
HAVE_CHOWNZHAVE_CHROOTZ
HAVE_CLOCKZHAVE_CLOCK_GETRESZHAVE_CLOCK_GETTIMEZHAVE_CLOCK_SETTIMEZHAVE_COMPUTED_GOTOSZHAVE_CONFSTRZHAVE_CONIO_HZ
HAVE_COPYSIGNZHAVE_COPY_FILE_RANGEZHAVE_CRYPT_HZHAVE_CRYPT_RZHAVE_CTERMIDZHAVE_CTERMID_RZHAVE_CURSES_FILTERZ
HAVE_CURSES_HZHAVE_CURSES_HAS_KEYZHAVE_CURSES_IMMEDOKZHAVE_CURSES_IS_PADZHAVE_CURSES_IS_TERM_RESIZEDZHAVE_CURSES_RESIZETERMZHAVE_CURSES_RESIZE_TERMZHAVE_CURSES_SYNCOKZHAVE_CURSES_TYPEAHEADZHAVE_CURSES_USE_ENVZHAVE_CURSES_WCHGATZHAVE_DECL_ISFINITEZHAVE_DECL_ISINFZHAVE_DECL_ISNANZHAVE_DECL_RTLD_DEEPBINDZHAVE_DECL_RTLD_GLOBALZHAVE_DECL_RTLD_LAZYZHAVE_DECL_RTLD_LOCALZHAVE_DECL_RTLD_MEMBERZHAVE_DECL_RTLD_NODELETEZHAVE_DECL_RTLD_NOLOADZHAVE_DECL_RTLD_NOWZHAVE_DECL_TZNAMEZHAVE_DEVICE_MACROSZHAVE_DEV_PTCZ
HAVE_DEV_PTMXZ
HAVE_DIRECT_HZHAVE_DIRENT_D_TYPEZ
HAVE_DIRENT_HZ
HAVE_DIRFDZHAVE_DLFCN_HZHAVE_DLOPENZ	HAVE_DUP2Z	HAVE_DUP3Z$HAVE_DYLD_SHARED_CACHE_CONTAINS_PATHZHAVE_DYNAMIC_LOADINGZ
HAVE_ENDIAN_HZ
HAVE_EPOLLZHAVE_EPOLL_CREATE1ZHAVE_ERFZ	HAVE_ERFCZHAVE_ERRNO_HZ
HAVE_EXECVZHAVE_EXPLICIT_BZEROZHAVE_EXPLICIT_MEMSETZ
HAVE_EXPM1ZHAVE_FACCESSATZHAVE_FCHDIRZHAVE_FCHMODZ
HAVE_FCHMODATZHAVE_FCHOWNZ
HAVE_FCHOWNATZHAVE_FCNTL_HZHAVE_FDATASYNCZHAVE_FDOPENDIRZHAVE_FDWALKZHAVE_FEXECVEZHAVE_FINITEZ
HAVE_FLOCKZ	HAVE_FORKZHAVE_FORKPTYZHAVE_FPATHCONFZHAVE_FSEEK64ZHAVE_FSEEKOZHAVE_FSTATATZ
HAVE_FSTATVFSZ
HAVE_FSYNCZHAVE_FTELL64ZHAVE_FTELLOZ
HAVE_FTIMEZHAVE_FTRUNCATEZ
HAVE_FUTIMENSZHAVE_FUTIMESZHAVE_FUTIMESATZHAVE_GAI_STRERRORZ
HAVE_GAMMAZHAVE_GCC_ASM_FOR_MC68881ZHAVE_GCC_ASM_FOR_X64ZHAVE_GCC_ASM_FOR_X87ZHAVE_GCC_UINT128_TZHAVE_GETADDRINFOZHAVE_GETC_UNLOCKEDZHAVE_GETENTROPYZHAVE_GETGRGID_RZHAVE_GETGRNAM_RZHAVE_GETGROUPLISTZHAVE_GETGROUPSZHAVE_GETHOSTBYNAMEZHAVE_GETHOSTBYNAME_RZHAVE_GETHOSTBYNAME_R_3_ARGZHAVE_GETHOSTBYNAME_R_5_ARGZHAVE_GETHOSTBYNAME_R_6_ARGZHAVE_GETITIMERZHAVE_GETLOADAVGZ
HAVE_GETLOGINZHAVE_GETNAMEINFOZHAVE_GETPAGESIZEZHAVE_GETPEERNAMEZHAVE_GETPGIDZHAVE_GETPGRPZHAVE_GETPIDZHAVE_GETPRIORITYZ
HAVE_GETPWENTZHAVE_GETPWNAM_RZHAVE_GETPWUID_RZHAVE_GETRANDOMZHAVE_GETRANDOM_SYSCALLZHAVE_GETRESGIDZHAVE_GETRESUIDZHAVE_GETSIDZ
HAVE_GETSPENTZ
HAVE_GETSPNAMZHAVE_GETTIMEOFDAYZ
HAVE_GETWDZHAVE_GLIBC_MEMMOVE_BUGZ
HAVE_GRP_HZHAVE_HSTRERRORZHAVE_HTOLE64Z
HAVE_HYPOTZ
HAVE_IEEEFP_HZHAVE_IF_NAMEINDEXZHAVE_INET_ATONZHAVE_INET_PTONZHAVE_INITGROUPSZHAVE_INTTYPES_HZ	HAVE_IO_HZHAVE_IPA_PURE_CONST_BUGZ	HAVE_KILLZHAVE_KILLPGZHAVE_KQUEUEZHAVE_LANGINFO_HZHAVE_LARGEFILE_SUPPORTZ
HAVE_LCHFLAGSZHAVE_LCHMODZHAVE_LCHOWNZHAVE_LGAMMAZ
HAVE_LIBDLZHAVE_LIBDLDZHAVE_LIBIEEEZHAVE_LIBINTL_HZHAVE_LIBREADLINEZHAVE_LIBRESOLVZHAVE_LIBSENDFILEZHAVE_LIBUTIL_HZ	HAVE_LINKZHAVE_LINKATZHAVE_LINUX_CAN_BCM_HZHAVE_LINUX_CAN_HZHAVE_LINUX_CAN_RAW_FD_FRAMESZHAVE_LINUX_CAN_RAW_HZHAVE_LINUX_MEMFD_HZHAVE_LINUX_NETLINK_HZHAVE_LINUX_QRTR_HZHAVE_LINUX_RANDOM_HZHAVE_LINUX_TIPC_HZHAVE_LINUX_VM_SOCKETS_HZ
HAVE_LOCKFZ
HAVE_LOG1PZ	HAVE_LOG2ZHAVE_LONG_DOUBLEZ
HAVE_LSTATZHAVE_LUTIMESZHAVE_MADVISEZHAVE_MAKEDEVZHAVE_MBRTOWCZHAVE_MEMFD_CREATEZ
HAVE_MEMORY_HZHAVE_MEMRCHRZHAVE_MKDIRATZHAVE_MKFIFOZ
HAVE_MKFIFOATZ
HAVE_MKNODZHAVE_MKNODATZHAVE_MKTIMEZ	HAVE_MMAPZHAVE_MREMAPZHAVE_NCURSES_HZHAVE_NDIR_HZHAVE_NETPACKET_PACKET_HZ
HAVE_NET_IF_HZ	HAVE_NICEZHAVE_OPENATZHAVE_OPENPTYZ
HAVE_PATHCONFZ
HAVE_PAUSEZ
HAVE_PIPE2Z
HAVE_PLOCKZ	HAVE_POLLZHAVE_POLL_HZHAVE_POSIX_FADVISEZHAVE_POSIX_FALLOCATEZHAVE_POSIX_SPAWNZHAVE_POSIX_SPAWNPZ
HAVE_PREADZHAVE_PREADVZHAVE_PREADV2ZHAVE_PRLIMITZHAVE_PROCESS_HZHAVE_PROTOTYPESZHAVE_PTHREAD_CONDATTR_SETCLOCKZHAVE_PTHREAD_DESTRUCTORZHAVE_PTHREAD_GETCPUCLOCKIDZHAVE_PTHREAD_HZHAVE_PTHREAD_INITZHAVE_PTHREAD_KILLZHAVE_PTHREAD_SIGMASKZ
HAVE_PTY_HZHAVE_PUTENVZHAVE_PWRITEZHAVE_PWRITEVZ
HAVE_PWRITEV2Z
HAVE_READLINKZHAVE_READLINKATZ
HAVE_READVZ
HAVE_REALPATHZ
HAVE_RENAMEATZHAVE_RL_APPEND_HISTORYZHAVE_RL_CATCH_SIGNALZ#HAVE_RL_COMPLETION_APPEND_CHARACTERZ'HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOKZHAVE_RL_COMPLETION_MATCHESZ"HAVE_RL_COMPLETION_SUPPRESS_APPENDZHAVE_RL_PRE_INPUT_HOOKZHAVE_RL_RESIZE_TERMINALZ
HAVE_ROUNDZ
HAVE_RTPSPAWNZHAVE_SCHED_GET_PRIORITY_MAXZHAVE_SCHED_HZHAVE_SCHED_RR_GET_INTERVALZHAVE_SCHED_SETAFFINITYZHAVE_SCHED_SETPARAMZHAVE_SCHED_SETSCHEDULERZHAVE_SEM_GETVALUEZ
HAVE_SEM_OPENZHAVE_SEM_TIMEDWAITZHAVE_SEM_UNLINKZ
HAVE_SENDFILEZHAVE_SETEGIDZHAVE_SETEUIDZHAVE_SETGIDZHAVE_SETGROUPSZHAVE_SETHOSTNAMEZHAVE_SETITIMERZHAVE_SETLOCALEZHAVE_SETPGIDZHAVE_SETPGRPZHAVE_SETPRIORITYZ
HAVE_SETREGIDZHAVE_SETRESGIDZHAVE_SETRESUIDZ
HAVE_SETREUIDZHAVE_SETSIDZHAVE_SETUIDZHAVE_SETVBUFZ
HAVE_SHADOW_HZ
HAVE_SHM_OPENZHAVE_SHM_UNLINKZHAVE_SIGACTIONZHAVE_SIGALTSTACKZHAVE_SIGFILLSETZHAVE_SIGINFO_T_SI_BANDZHAVE_SIGINTERRUPTZ
HAVE_SIGNAL_HZHAVE_SIGPENDINGZ
HAVE_SIGRELSEZHAVE_SIGTIMEDWAITZHAVE_SIGWAITZHAVE_SIGWAITINFOZ
HAVE_SNPRINTFZHAVE_SOCKADDR_ALGZHAVE_SOCKADDR_SA_LENZHAVE_SOCKADDR_STORAGEZHAVE_SOCKETPAIRZHAVE_SPAWN_HZHAVE_SSIZE_TZHAVE_STATVFSZHAVE_STAT_TV_NSECZHAVE_STAT_TV_NSEC2ZHAVE_STDARG_PROTOTYPESZ
HAVE_STDINT_HZ
HAVE_STDLIB_HZHAVE_STD_ATOMICZHAVE_STRDUPZ
HAVE_STRFTIMEZHAVE_STRINGS_HZ
HAVE_STRING_HZHAVE_STRLCPYZHAVE_STROPTS_HZHAVE_STRSIGNALZHAVE_STRUCT_PASSWD_PW_GECOSZHAVE_STRUCT_PASSWD_PW_PASSWDZHAVE_STRUCT_STAT_ST_BIRTHTIMEZHAVE_STRUCT_STAT_ST_BLKSIZEZHAVE_STRUCT_STAT_ST_BLOCKSZHAVE_STRUCT_STAT_ST_FLAGSZHAVE_STRUCT_STAT_ST_GENZHAVE_STRUCT_STAT_ST_RDEVZHAVE_STRUCT_TM_TM_ZONEZHAVE_SYMLINKZHAVE_SYMLINKATZ	HAVE_SYNCZHAVE_SYSCONFZHAVE_SYSEXITS_HZHAVE_SYS_AUDIOIO_HZHAVE_SYS_BSDTTY_HZHAVE_SYS_DEVPOLL_HZHAVE_SYS_DIR_HZHAVE_SYS_ENDIAN_HZHAVE_SYS_EPOLL_HZHAVE_SYS_EVENT_HZHAVE_SYS_FILE_HZHAVE_SYS_IOCTL_HZHAVE_SYS_KERN_CONTROL_HZHAVE_SYS_LOADAVG_HZHAVE_SYS_LOCK_HZHAVE_SYS_MEMFD_HZHAVE_SYS_MKDEV_HZHAVE_SYS_MMAN_HZHAVE_SYS_MODEM_HZHAVE_SYS_NDIR_HZHAVE_SYS_PARAM_HZHAVE_SYS_POLL_HZHAVE_SYS_RANDOM_HZHAVE_SYS_RESOURCE_HZHAVE_SYS_SELECT_HZHAVE_SYS_SENDFILE_HZHAVE_SYS_SOCKET_HZHAVE_SYS_STATVFS_HZHAVE_SYS_STAT_HZHAVE_SYS_SYSCALL_HZHAVE_SYS_SYSMACROS_HZHAVE_SYS_SYS_DOMAIN_HZHAVE_SYS_TERMIO_HZHAVE_SYS_TIMES_HZHAVE_SYS_TIME_HZHAVE_SYS_TYPES_HZHAVE_SYS_UIO_HZ
HAVE_SYS_UN_HZHAVE_SYS_UTSNAME_HZHAVE_SYS_WAIT_HZHAVE_SYS_XATTR_HZHAVE_TCGETPGRPZHAVE_TCSETPGRPZHAVE_TEMPNAMZHAVE_TERMIOS_HZHAVE_TERM_HZHAVE_TGAMMAZHAVE_TIMEGMZ
HAVE_TIMESZHAVE_TMPFILEZHAVE_TMPNAMZ
HAVE_TMPNAM_RZHAVE_TM_ZONEZ
HAVE_TRUNCATEZHAVE_TZNAMEZ
HAVE_UCS4_TCLZ
HAVE_UNAMEZ
HAVE_UNISTD_HZ
HAVE_UNLINKATZ
HAVE_UNSETENVZHAVE_USABLE_WCHAR_TZHAVE_UTIL_HZHAVE_UTIMENSATZHAVE_UTIMESZHAVE_UTIME_HZHAVE_UUID_CREATEZHAVE_UUID_ENC_BEZHAVE_UUID_GENERATE_TIME_SAFEZHAVE_UUID_HZHAVE_UUID_UUID_HZ
HAVE_WAIT3Z
HAVE_WAIT4ZHAVE_WAITIDZHAVE_WAITPIDZHAVE_WCHAR_HZHAVE_WCSCOLLZ
HAVE_WCSFTIMEZHAVE_WCSXFRMZHAVE_WMEMCMPZHAVE_WORKING_TZSETZHAVE_WRITEVZ HAVE_X509_VERIFY_PARAM_SET1_HOSTZHAVE_ZLIB_COPYZHAVE__GETPTYZ
HOST_GNU_TYPEZINCLDIRSTOMAKEZ
INCLUDEDIRZ	INCLUDEPYZINSTALLZINSTALL_DATAZINSTALL_PROGRAMZINSTALL_SCRIPTZINSTALL_SHAREDZ
INSTSONAMEZIO_HZIO_OBJSZLDCXXSHAREDZLDFLAGSZ	LDLIBRARYZLDLIBRARYDIRZLDSHAREDZ	LDVERSIONZLIBCZLIBDESTZLIBDIRZLIBFFI_INCLUDEDIRZLIBMZ	LIBOBJDIRZLIBOBJSZLIBPCZLIBPLZ	LIBPYTHONZLIBRARYZLIBRARY_OBJSZLIBRARY_OBJS_OMIT_FROZENZLIBSZ
LIBSUBDIRSZLINKCCZ
LINKFORSHAREDZLIPO_32BIT_FLAGSZLIPO_INTEL64_FLAGSZ
LLVM_PROF_ERRZLLVM_PROF_FILEZLLVM_PROF_MERGERZLNZLOCALMODLIBSZMACHDEPZMACHDEP_OBJSZMACHDESTLIBZMACOSX_DEPLOYMENT_TARGETZMAINCCZMAJOR_IN_MKDEVZMAJOR_IN_SYSMACROSZ	MAKESETUPZMANDIRZMKDIR_PZMODBUILT_NAMESZMODDISABLED_NAMESZMODLIBSZMODOBJSZMODULE_OBJSZ	MULTIARCHZMULTIARCH_CPPFLAGSZMVWDELCH_IS_EXPRESSIONZNO_AS_NEEDEDZOBJECT_OBJSZOPENSSL_INCLUDESZOPENSSL_LDFLAGSZOPENSSL_LIBSZOPTZOTHER_LIBTOOL_OPTZPACKAGE_BUGREPORTZPACKAGE_NAMEZPACKAGE_STRINGZPACKAGE_TARNAMEZPACKAGE_URLZPACKAGE_VERSIONZPARSER_HEADERSZPARSER_OBJSZPGO_PROF_GEN_FLAGZPGO_PROF_USE_FLAGZPOBJSZPOSIX_SEMAPHORES_NOT_ENABLEDZPROFILE_TASKZ$PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INTZPTHREAD_SYSTEM_SCHED_SUPPORTEDZ
PY3LIBRARYZPYLONG_BITS_IN_DIGITZPYTHONZPYTHONFRAMEWORKZPYTHONFRAMEWORKDIRZPYTHONFRAMEWORKINSTALLDIRZPYTHONFRAMEWORKPREFIXZ
PYTHONPATHZPYTHON_FOR_BUILDZPYTHON_FOR_REGENZPYTHON_HEADERSZPYTHON_OBJSZPY_BUILTIN_MODULE_CFLAGSZ	PY_CFLAGSZPY_CFLAGS_NODISTZPY_COERCE_C_LOCALEZPY_CORE_CFLAGSZPY_CORE_LDFLAGSZPY_CPPFLAGSZPY_FORMAT_SIZE_TZ
PY_LDFLAGSZPY_LDFLAGS_NODISTZPY_SSL_DEFAULT_CIPHERSZPY_SSL_DEFAULT_CIPHER_STRINGZPY_STDMODULE_CFLAGSZPy_DEBUGZPy_ENABLE_SHAREDZPy_HASH_ALGORITHMZ
Py_TRACE_REFSZ
QUICKTESTOPTSZREADELFZ	RESSRCDIRZ
RETSIGTYPEZ	RUNSHAREDZ	SCRIPTDIRZSETPGRP_HAVE_ARGZSGI_ABIZSHELLZSHLIBSZSHLIB_SUFFIXZSHM_NEEDS_LIBRTZSIGNED_RIGHT_SHIFT_ZERO_FILLSZSITEPATHZ
SIZEOF_DOUBLEZSIZEOF_FLOATZ
SIZEOF_FPOS_TZ
SIZEOF_INTZSIZEOF_LONGZSIZEOF_LONG_DOUBLEZSIZEOF_LONG_LONGZSIZEOF_OFF_TZSIZEOF_PID_TZSIZEOF_PTHREAD_KEY_TZSIZEOF_PTHREAD_TZSIZEOF_SHORTZ
SIZEOF_SIZE_TZ
SIZEOF_TIME_TZSIZEOF_UINTPTR_TZ
SIZEOF_VOID_PZSIZEOF_WCHAR_TZSIZEOF__BOOLZSOABIZSRCDIRSZ
SRC_GDB_HOOKSZSTDC_HEADERSZSTRICT_SYSV_CURSESZ	STRIPFLAGZSUBDIRSZ
SUBDIRSTOOZSYSLIBSZSYS_SELECT_WITH_SYS_TIMEZTCLTK_INCLUDESZ
TCLTK_LIBSZTESTOPTSZTESTPATHZ
TESTPYTHONZTESTPYTHONOPTSZ
TESTRUNNERZTESTTIMEOUTZTIMEMODULE_LIBZTIME_WITH_SYS_TIMEZTM_IN_SYS_TIMEZUNICODE_DEPSZUNIVERSALSDKZUPDATE_FILEZUSE_COMPUTED_GOTOSZVERSIONZVPATHZWINDOW_HAS_FLAGSZWITH_DECIMAL_CONTEXTVARZWITH_DOC_STRINGSZWITH_DTRACEZ	WITH_DYLDZWITH_LIBINTLZWITH_NEXT_FRAMEWORKZ
WITH_PYMALLOCZ
WITH_VALGRINDZX87_DOUBLE_ROUNDINGZ
XMLLIBSUBDIRSZabs_builddirZ
abs_srcdirZdatarootdir�exec_prefix�prefixZsrcdirN)Zbuild_time_vars�rr�?/usr/lib64/python3.8/_sysconfigdata_d_linux_x86_64-linux-gnu.py�<module>sb2+-��������__pycache__/sysconfig.cpython-38.pyc000064400000036751151153537600013432 0ustar00U

��.e@a�
@sdZddlZddlZddlmZmZdddddd	d
ddd
dgZdhZddddddddd�ddddddddd�ddddddd dd�d!d!d"d"d#d$d%d&�d'd'd(d)d*d+d%d&�d,d,d-d-d.d+d%d&�d/�Zd&Z	ej
��dZd0ej
dd1�Zd2ej
dd1�Zej�ej�Zej�ej�Zej�ej�Zej�ej�ZdadZd3d4�Zej�rVej�eej��Znee� ��Zej!d5k�r�e�"��#d6��r�eej�$eee��Zd7ej%k�r�eej%d7�Zd8d9�Z&e'ed:d�Z(ej!d5k�r�d;d<�Z)e)e�Ze)e(�Z(djd>d?�Z*e*d@�Z+e+�r dAD]Z,dBee,dC<dDee,dE<�qdFdG�Z-dHdI�Z.dJdK�Z/dLdM�Z0dNdO�Z1dkdPdQ�Z2dRd�Z3dSdT�Z4dUdV�Z5dWdX�Z6dYdZ�Z7dld[d�Z8d\d�Z9d]d
�Z:d^d	�Z;e0�dd@fd_d
�Z<e0�dd@fd`d�Z=dad�Z>dbd�Z?dcd�Z@ddd�ZAdedf�ZBdgdh�ZCeDdik�reC�dS)mz-Access to Python's configuration information.�N)�pardir�realpath�get_config_h_filename�get_config_var�get_config_vars�get_makefile_filename�get_path�get_path_names�	get_paths�get_platform�get_python_version�get_scheme_names�parse_config_hZMACOSX_DEPLOYMENT_TARGETz/{installed_base}/lib64/python{py_version_short}z){platbase}/lib64/python{py_version_short}z1{base}/lib/python{py_version_short}/site-packagesz7{platbase}/lib64/python{py_version_short}/site-packagesz;{installed_base}/include/python{py_version_short}{abiflags}z?{installed_platbase}/include/python{py_version_short}{abiflags}z
{base}/binz{base})�stdlib�
platstdlib�purelib�platlib�include�platinclude�scripts�dataz{installed_base}/lib/pythonz{base}/lib/pythonz{installed_base}/include/pythonz{installed_base}/Libz
{base}/Libz{base}/Lib/site-packagesz{installed_base}/Includez{base}/Scriptsz#{userbase}/Python{py_version_nodot}z1{userbase}/Python{py_version_nodot}/site-packagesz+{userbase}/Python{py_version_nodot}/Includez+{userbase}/Python{py_version_nodot}/Scriptsz
{userbase})rrrrrrrz){userbase}/lib64/python{py_version_short}z5{userbase}/lib/python{py_version_short}/site-packagesz7{userbase}/lib64/python{py_version_short}/site-packagesz+{userbase}/include/python{py_version_short}z{userbase}/binz{userbase}/lib/pythonz#{userbase}/lib/python/site-packagesz{userbase}/include)�posix_prefix�
posix_home�ntZnt_userZ
posix_userZosx_framework_user�%d.%d�z%d%dcCs(z
t|�WStk
r"|YSXdS�N)r�OSError)�path�r�!/usr/lib64/python3.8/sysconfig.py�_safe_realpathis
r!r)z\pcbuild\win32z\pcbuild\amd64Z_PYTHON_PROJECT_BASEcCs,dD]"}tj�tj�|d|��rdSqdS)N)ZSetupzSetup.localZModulesTF)�osr�isfile�join)�d�fnrrr �_is_python_source_dir~sr'�_homecCs0|r,tj�|��tj�tj�td���r,tS|S)NZPCbuild)r"r�normcase�
startswithr$�_PREFIX)r%rrr �_fix_pcbuild�s
�r,FcCs|rtrtt�Stt�Sr)�	_sys_homer'�
_PROJECT_BASE)Z
check_homerrr �is_python_build�sr/T)rrz{srcdir}/Includerz{projectbase}/.rc
Csnz|jf|�WStk
rhz|jftj�WYStk
rb}ztd|�d�W5d}~XYnXYnXdS)Nz{%s})�format�KeyErrorr"�environ�AttributeError)�sZ
local_vars�varrrr �_subst_vars�sr6cCs0|��}|��D]\}}||kr"q|||<qdSr)�keys�items)Ztarget_dictZ
other_dictZtarget_keys�key�valuerrr �_extend_dict�s
r;cCsbi}|dkri}t|t��t|��D]4\}}tjdkrFtj�|�}tj�t	||��||<q(|S)N)�posixr)
r;r�_INSTALL_SCHEMESr8r"�namer�
expanduser�normpathr6)�scheme�vars�resr9r:rrr �_expand_vars�s
rDcCstjdkrdStjS)Nr<r)r"r>rrrr �_get_default_scheme�s
rEcCsztj�dd�}|r|Sdd�}tjdkrBtj�d�p6d}||d�Stjdkrptjrp|dd	tjd
tjdd��S|dd�S)
N�PYTHONUSERBASEcWstj�tjj|��Sr)r"rr?r$)�argsrrr �joinuser�sz_getuserbase.<locals>.joinuserr�APPDATA�~�Python�darwin�Libraryrrz.local)r"r2�getr>�sys�platform�
_framework�version_info)�env_baserH�baserrr �_getuserbase�s


�rUc	Cs`ddl}|�d�}|�d�}|�d�}|dkr2i}i}i}t|dd��}|��}	W5QRX|	D]�}
|
�d�s^|
��d	krzq^|�|
�}|r^|�d
d�\}}
|
��}
|
�dd	�}d
|kr�|
||<q^z|t	kr�t
�t|
�}
Wn$t
k
r�|
�dd
�||<Yq^X|
||<q^t|�
��}d}t|�dk�r&t|�D�]�}||}|�|�}|�|�}|�rv|�rv|��|��k�rp|n|}n|�r�|n|}|dk	�r|�d
�}d}||k�r�t||�}n�||k�r�d}nx|tjk�r�tj|}n`||k�r0|�d��r
|dd�|k�r
d	}n$d||k�rd}nt|d|�}nd	||<}|�r||��d�}|d|���||}d
|k�r~|||<n�z|t	k�r�t
�t|�}Wn"t
k
�r�|��||<Yn
X|||<|�|�|�d��r|dd�|k�r|dd�}||k�r|||<n|||<|�|��q,�q|��D]"\}}
t|
t��r.|
��||<�q.|�|�|S)z�Parse a Makefile-style file.

    A dictionary containing name/value pairs is returned.  If an
    optional dictionary is passed in as the second argument, it is
    used instead of a new dictionary.
    rNz"([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)z\$\(([A-Za-z][A-Za-z0-9_]*)\)z\${([A-Za-z][A-Za-z0-9_]*)}�surrogateescape)�errors�#��rz$$�$)ZCFLAGSZLDFLAGSZCPPFLAGSTFZPY_�)�re�compile�open�	readlinesr*�strip�match�group�replace�_ALWAYS_STR�
ValueError�int�listr7�len�tuple�search�start�strr"r2�end�remover8�
isinstance�update)�filenamerBr]Z_variable_rxZ_findvar1_rxZ_findvar2_rxZdoneZnotdone�f�lines�line�m�n�vZtmpvZ	variablesZrenamed_variablesr>r:Zm1Zm2�found�itemZafter�krrr �_parse_makefile�s�	












�



�


r|cCsdtrtj�tptd�Sttd�r0dttj	f}nd}ttj
d�rP|dtj
j7}tj�td�|d�S)z Return the path of the Makefile.ZMakefile�abiflagszconfig-%s%sZconfig�
_multiarchz-%sr)
�
_PYTHON_BUILDr"rr$r-r.�hasattrrO�_PY_VERSION_SHORTr}�implementationr~r)Zconfig_dir_namerrr rWs
c
Cs(tj�ddjtjtjttjdd�d��S)NZ_PYTHON_SYSCONFIGDATA_NAMEz+_sysconfigdata_{abi}_{platform}_{multiarch}r~rY)ZabirPZ	multiarch)	r"r2rNr0rOr}rP�getattrr�rrrr �_get_sysconfigdata_nameds��r�c
Cs�ddl}i}t�}zt||�WnJtk
rj}z,d|}t|d�rR|d|j}t|��W5d}~XYnXt�}z"t|��}t||�W5QRXWnJtk
r�}z,d|}t|d�r�|d|j}t|��W5d}~XYnXt	r�|d|d<t
�}dtjk�r$ddl
}|�|�}	||	_|	tj|<d	t�tf}
ttd
��rF|
d7}
tj|
dd
�tj�|
|d�}t|ddd��(}|�d�|�d�|j||d�W5QRXtdddd��}|�|
�W5QRXdS)z;Generate the Python module containing build-time variables.rNz.invalid Python installation: unable to open %s�strerrorz (%s)ZLDSHAREDZ	BLDSHAREDrLzbuild/lib.%s-%sZgettotalrefcountz-pydebugT)�exist_okz.py�w�utf8)�encodingzB# system configuration generated and used by the sysconfig module
zbuild_time_vars = )�streamzpybuilddir.txt)�pprintrr|rr�r�rr_rrr�rOrP�types�
ModuleType�build_time_vars�modulesrr�r"�makedirsrr$�write)r�rBZmakefile�e�msgZconfig_hrsr>r��moduleZ
pybuilddirZdestfilerrr �_generate_posix_varsmsL







r�cCs0t�}t|t�t�dgd�}|j}|�|�dS)z7Initialize the module as appropriate for POSIX systems.r�rN)r��
__import__�globals�localsr�rq)rBr>Z_tempr�rrr �_init_posix�sr�cCsfddl}td�|d<td�|d<td�|d<|��d|d	<d
|d<t|d<tj�ttj	��|d
<dS)z+Initialize the module as appropriate for NTrNrZLIBDESTrZ
BINLIBDESTrZ	INCLUDEPY�
EXT_SUFFIXz.exeZEXEZVERSIONZBINDIR)
�_impr�extension_suffixes�_PY_VERSION_SHORT_NO_DOTr"r�dirnamer!rO�
executable)rBr�rrr �_init_non_posix�sr�c	Cs�|dkri}ddl}|�d�}|�d�}|��}|s6q�|�|�}|r�|�dd�\}}z|tkrbt�t|�}Wntk
r�YnX|||<q(|�|�}|r(d||�d�<q(|S)z�Parse a config.h-style file.

    A dictionary containing name/value pairs is returned.  If an
    optional dictionary is passed in as the second argument, it is
    used instead of a new dictionary.
    Nrz"#define ([A-Z][A-Za-z0-9_]+) (.*)
z&/[*] #undef ([A-Z][A-Za-z0-9_]+) [*]/
rZr)r]r^�readlinerbrcrerfrg)	�fprBr]Z	define_rxZundef_rxrurvrwrxrrr r�s,




cCsBtr,tjdkr"tj�tptd�}q4tp(t}ntd�}tj�|d�S)zReturn the path of pyconfig.h.rZPCrz
pyconfig-64.h)rr"r>rr$r-r.r)Zinc_dirrrr r�s

cCsttt��S)z,Return a tuple containing the schemes names.)rj�sortedr=rrrr r
�scCstS)z*Return a tuple containing the paths names.)�_SCHEME_KEYSrrrr r	�scCs|rt||�St|SdS)z�Return a mapping containing an install scheme.

    ``scheme`` is the install scheme name. If not provided, it will
    return the default scheme for the current platform.
    N)rDr=)rArB�expandrrr r
�s
cCst|||�|S)z[Return a path corresponding to the scheme.

    ``scheme`` is the install scheme name.
    )r
)r>rArBr�rrr r	scGsxtdk�rFiattd<ttd<ttd<ttd<ttd<ttd<ttd<ttd	<ttd
<ttd<zt	j
td<Wntk
r�d
td<YnXtj
dkr�tt�tj
dkr�tt�t�d�}|dk	r�|td<t�td<t�dt�}tj
dk�rt�rtj�t��}tj�||�}ntj�t��}t|�td<t	jdk�rFddl}|�t�|�rpg}|D]}|�t�|���qT|StSdS)anWith no arguments, return a dictionary of all configuration
    variables relevant for the current platform.

    On Unix, this means every variable defined in Python's installed Makefile;
    On Windows it's a much smaller set.

    With arguments, return a list of values that result from looking up
    each argument in the configuration variable dictionary.
    N�prefix�exec_prefixZ
py_versionZpy_version_shortZpy_version_nodotZinstalled_baserTZinstalled_platbaseZplatbaseZprojectbaser}rYrr<r��SO�userbase�srcdirrLr)�_CONFIG_VARSr+�_EXEC_PREFIX�_PY_VERSIONr�r��_BASE_PREFIX�_BASE_EXEC_PREFIXr.rOr}r3r"r>r�r�rNrUrrr�rr$r!rP�_osx_supportZcustomize_config_vars�append)rGr�r�rTr�Zvalsr>rrr rsP





cCs*|dkrddl}|�dtd�t��|�S)z�Return the value of a single variable using the dictionary returned by
    'get_config_vars()'.

    Equivalent to get_config_vars().get(name)
    r�rNz SO is deprecated, use EXT_SUFFIXr)�warnings�warn�DeprecationWarningrrN)r>r�rrr r^sc
Cs�tjdkrFdtj��krdSdtj��kr.dSdtj��kr@dStjStjdksZttd	�s`tjSd
tjkrttjd
St��\}}}}}|���	dd�}|�	d
d�}|�	dd�}|dd�dkr�d||fS|dd�dk�r,|ddk�r�d}dt
|d�d|dd�f}ddd�}|d|tj7}n�|dd�dk�rLd |||fS|dd!�d"k�r�d"}ddl}|�
d#�}|�|�}|�r�|��}n2|dd!�d$k�r�ddl}	|	�t�|||�\}}}d%|||fS)&a�Return a string that identifies the current platform.

    This is used mainly to distinguish platform-specific build directories and
    platform-specific built distributions.  Typically includes the OS name and
    version and the architecture (as supplied by 'os.uname()'), although the
    exact information included depends on the OS; on Linux, the kernel version
    isn't particularly important.

    Examples of returned values:
       linux-i586
       linux-alpha (?)
       solaris-2.6-sun4u

    Windows will return one of:
       win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc)
       win32 (all others - specifically, sys.platform is returned)

    For other non-POSIX platforms, currently just returns 'sys.platform'.

    rZamd64z	win-amd64z(arm)z	win-arm32z(arm64)z	win-arm64r<�unameZ_PYTHON_HOST_PLATFORM�/rY� �_�-N�Zlinuxz%s-%sZsunosr�5Zsolarisz%d.%sr\rZ32bitZ64bit)i���l����z.%sZaixz%s-%s.%s��cygwinz[\d.]+rLz%s-%s-%s)r"r>rO�version�lowerrPr�r2r�rdrg�maxsizer]r^rbrcr�Zget_platform_osxr)
ZosnameZhost�releaser��machineZbitnessr]Zrel_rervr�rrr rjsT


 



�
cCstSr)r�rrrr r�scCsFtt|����D]0\}\}}|dkr0td|�td||f�qdS)Nrz%s: z
	%s = "%s")�	enumerater�r8�print)�titler�indexr9r:rrr �_print_dict�sr�cCsfdtjkrt�dStdt��tdt��tdt��t�tdt��t�tdt	��dS)z*Display all information sysconfig detains.z--generate-posix-varsNzPlatform: "%s"zPython version: "%s"z!Current installation scheme: "%s"ZPathsZ	Variables)
rO�argvr�r�rrrEr�r
rrrrr �_main�s
r��__main__)F)N)N)E�__doc__r"rOZos.pathrr�__all__rer=r�r��splitr�rRr�r�rr@r�r+�base_prefixr�r�r��base_exec_prefixr�r�Z
_USER_BASEr!r�r�r.�getcwdr>r��endswithr$r2r'r�r-r,r/rrAr6r;rDrErUr|rr�r�r�r�rrr
r	r
rrrrrr�r��__name__rrrr �<module>s����
���
�
��?�
	
	

	?
"MP
__pycache__/tabnanny.cpython-38.opt-1.pyc000064400000015570151153537600014173 0ustar00U

e5d�,�@s�dZdZddlZddlZddlZeed�s2ed��dddgZdada	d	d
�Z
dd�ZGd
d�de�Z
dd�ZGdd�d�Zdd�Zdd�Zedkr�e�dS)a�The Tab Nanny despises ambiguous indentation.  She knows no mercy.

tabnanny -- Detection of ambiguous indentation

For the time being this module is intended to be called as a script.
However it is possible to import it into an IDE and use the function
check() described below.

Warning: The API provided by this module is likely to change in future
releases; such changes may not be backward compatible.
�6�N�NLz4tokenize.NL doesn't exist -- tokenize module too old�check�NannyNag�process_tokenscGs6d}|D]}tj�|t|��d}qtj�d�dS)N�� �
)�sys�stderr�write�str)�args�sep�arg�r� /usr/lib64/python3.8/tabnanny.py�errprint"s
rc
Cs�ddl}z|�tjdd�d�\}}Wn2|jk
rX}zt|�WY�dSd}~XYnX|D](\}}|dkrvtda|dkr^tdaq^|s�tdtjdd�dS|D]}t|�q�dS)Nr�Zqvz-qz-vzUsage:z[-v] file_or_directory ...)�getoptr
�argv�errorr�
filename_only�verboser)rZoptsr�msg�o�arrrr�main)s 
rc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)rzk
    Raised by process_tokens() if detecting an ambiguous indent.
    Captured and handled in check().
    cCs||||_|_|_dS�N)�linenor�line)�selfrrr rrr�__init__BszNannyNag.__init__cCs|jSr)r�r!rrr�
get_linenoDszNannyNag.get_linenocCs|jSr)rr#rrr�get_msgFszNannyNag.get_msgcCs|jSr)r r#rrr�get_lineHszNannyNag.get_lineN)�__name__�
__module__�__qualname__�__doc__r"r$r%r&rrrrr=s
c	
CsHtj�|�r�tj�|�s�tr*td|f�t�|�}|D]J}tj�||�}tj�|�rbtj�|�rztj�|dd��dkr8t	|�q8dSzt
�|�}Wn8tk
r�}zt
d||f�WY�dSd}~XYnXtdkr�td|��z>ztt
�|j��W�n"t
jk
�r@}z t
d||f�WY�
W���dSd}~XYn�tk
�r|}zt
d	||f�WY�W��dSd}~XYn�tk
�r }z�|��}|��}t�r�td
||f�td|f�t|���n6d|k�r�d
|d
}t�r�t|�nt||t|��WY�W�dSd}~XYnXW5|��Xt�rDtd|f�dS)a~check(file_or_dir)

    If file_or_dir is a directory and not a symbolic link, then recursively
    descend the directory tree named by file_or_dir, checking all .py files
    along the way. If file_or_dir is an ordinary Python source file, it is
    checked for whitespace related problems. The diagnostic messages are
    written to standard output using the print statement.
    z%r: listing directory���Nz.pyz%r: I/O Error: %srzchecking %r ...z%r: Token Error: %sz%r: Indentation Error: %sz)%r: *** Line %d: trouble in tab city! ***zoffending line: %rr�"z%r: Clean bill of health.)�os�path�isdir�islinkr�print�listdir�join�normcaser�tokenize�open�OSErrorr�closer�generate_tokens�readline�
TokenError�IndentationErrorrr$r&r%r�repr)	�file�names�name�fullname�frZnag�badliner rrrrKsX


��


 
c@sLeZdZd\ZZdd�Zdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�ZdS)�
Whitespacez 	c	Cs�||_tjtj}}g}d}}}|jD]v}||krH|d}|d}q*||kr�|d}|d}|t|�kr�|dg|t|�d}||d||<d}q*q�q*||_||_t|�|f|_t|�dk|_	dS)Nrr)
�rawrD�S�T�len�n�nt�tuple�norm�	is_simple)	r!ZwsrFrG�count�brIrJZchrrrr"�s(

zWhitespace.__init__cCs|j\}}tt|�d|�S�Nr)rL�maxrH)r!rN�trailingrrr�longest_run_of_spaces�s
z Whitespace.longest_run_of_spacescCsH|j\}}d}t|t|��D]}|||||}q||||jS)Nr)rL�rangerHrJ)r!�tabsizerNrRZil�irrr�indent_level�s

zWhitespace.indent_levelcCs|j|jkSr)rL)r!�otherrrr�equal�szWhitespace.equalcCsbt|��|���d}g}td|d�D]4}|�|�|�|�kr(|�||�|�|�|�f�q(|SrP�rQrSrTrW�append�r!rXrIr�tsrrr�not_equal_witness�s���zWhitespace.not_equal_witnesscCsp|j|jkrdS|jr(|jr(|j|jkSt|��|���d}td|d�D]}|�|�|�|�krLdSqLdS)NFr�T)rIrMrJrQrSrTrW)r!rXrIr]rrr�less�s��zWhitespace.lesscCsbt|��|���d}g}td|d�D]4}|�|�|�|�kr(|�||�|�|�|�f�q(|SrPrZr\rrr�not_less_witnesss���zWhitespace.not_less_witnessN)r'r(r)rFrGr"rSrWrYr^r`rarrrrrD�srDcCs8dd�|D�}d}t|�dkr&|d}|dd�|�S)Ncss|]}t|d�VqdS)rN)r
)�.0�tuprrr�	<genexpr>sz#format_witnesses.<locals>.<genexpr>zat tab sizer�srz, )rHr3)�wZfirsts�prefixrrr�format_witnessess
rhcCstj}tj}tj}tjtjf}td�g}d}|D]�\}}}	}
}||krLd}q0||kr�d}t|�}|d�|�s�|d�|�}
dt	|
�}t
|	d||��|�|�q0||kr�d}|d=q0|r0||kr0d}t|�}|d�|�s0|d�
|�}
dt	|
�}t
|	d||��q0dS)Nrrr���zindent not greater e.g. zindent not equal e.g. )r5�INDENT�DEDENT�NEWLINE�COMMENTrrDr`rarhrr[rYr^)�tokensrjrkrlZJUNK�indentsZcheck_equal�type�token�start�endr ZthisguyZwitnessrrrrrs6

�__main__)r*�__version__r-r
r5�hasattr�
ValueError�__all__rrrr�	ExceptionrrrDrhrr'rrrr�<module>s&

=7__pycache__/telnetlib.cpython-38.pyc000064400000043477151153537600013413 0ustar00U

e5d�Z�@sJdZddlZddlZddlZddlmZdgZdZdZ	e
dg�Ze
dg�Ze
dg�Z
e
d	g�Ze
d
g�Ze
dg�Ze
dg�Ze
dg�Ze
d
g�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Ze
dg�Z e
dg�Z!e
dg�Z"e
dg�Z#e
dg�Z$e
dg�Z%e
dg�Z&e
d g�Z'e
d!g�Z(e
d"g�Z)e
d#g�Z*e
d$g�Z+e
d%g�Z,e
d&g�Z-e
d'g�Z.e
d(g�Z/e
d)g�Z0e
d*g�Z1e
d+g�Z2e
dg�Z3e
d,g�Z4e
d-g�Z5e
d.g�Z6e
d/g�Z7e
d0g�Z8e
d1g�Z9e
d2g�Z:e
d3g�Z;e
d4g�Z<e
d5g�Z=e
d6g�Z>e
d7g�Z?e
d8g�Z@e
d9g�ZAe
d:g�ZBe
d;g�ZCe
d<g�ZDe
d=g�ZEe
d>g�ZFe
d?g�ZGe
d@g�ZHe
dAg�ZIe
dBg�ZJe
dCg�ZKe
dDg�ZLe
dEg�ZMe
dFg�ZNe
dGg�ZOe
dHg�ZPe
dg�ZQe
dg�ZReSedI��rejTZUnejVZUGdJd�d�ZWdKdL�ZXeYdMk�rFeX�dS)NaQTELNET client class.

Based on RFC 854: TELNET Protocol Specification, by J. Postel and
J. Reynolds

Example:

>>> from telnetlib import Telnet
>>> tn = Telnet('www.python.org', 79)   # connect to finger port
>>> tn.write(b'guido\r\n')
>>> print(tn.read_all())
Login       Name               TTY         Idle    When    Where
guido    Guido van Rossum      pts/2        <Dec  2 11:10> snag.cnri.reston..

>>>

Note that read_all() won't read until eof -- it just reads some data
-- but it guarantees to read at least one byte unless EOF is hit.

It is possible to pass a Telnet object to a selector in order to wait until
more data is available.  Note that in this case, read_eager() may return b''
even if there was data on the socket, because the protocol negotiation may have
eaten the data.  This is why EOFError is needed in some cases to distinguish
between "no data" and "connection closed" (since the socket also appears ready
for reading when it is closed).

To do:
- option negotiation
- timeout should be intrinsic to the connection object instead of an
  option on one of the read calls only

�N)�	monotonic�Telnet�������������������������������	�
���
������������������ �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1����PollSelectorc@seZdZdZddejfdd�Zdejfdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zd<dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd=d6d7�Zd8d9�Z d:d;�Z!dS)>ra�Telnet interface class.

    An instance of this class represents a connection to a telnet
    server.  The instance is initially not connected; the open()
    method must be used to establish a connection.  Alternatively, the
    host name and optional port number can be passed to the
    constructor, too.

    Don't try to reopen an already connected instance.

    This class has many read_*() methods.  Note that some of them
    raise EOFError when the end of the connection is read, because
    they can return an empty string for other reasons.  See the
    individual doc strings.

    read_until(expected, [timeout])
        Read until the expected string has been seen, or a timeout is
        hit (default is no timeout); may block.

    read_all()
        Read all data until EOF; may block.

    read_some()
        Read at least one byte or EOF; may block.

    read_very_eager()
        Read all data available already queued or on the socket,
        without blocking.

    read_eager()
        Read either data already queued or some data available on the
        socket, without blocking.

    read_lazy()
        Read all data in the raw queue (processing it first), without
        doing any socket I/O.

    read_very_lazy()
        Reads all data in the cooked queue, without doing any socket
        I/O.

    read_sb_data()
        Reads available data between SB ... SE sequence. Don't block.

    set_option_negotiation_callback(callback)
        Each time a telnet option is read on the input flow, this callback
        (if set) is called with the following parameters :
        callback(telnet socket, command, option)
            option will be chr(0) when there is no option.
        No other action is done afterwards by telnetlib.

    NrcCsht|_||_||_||_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
|dk	rd|�|||�dS)z�Constructor.

        When called without arguments, create an unconnected instance.
        With a hostname argument, it connects the instance; port number
        and timeout are optional.
        N�r)�
DEBUGLEVEL�
debuglevel�host�port�timeout�sock�rawq�irawq�cookedq�eof�iacseq�sb�sbdataq�option_callback�open��selfrLrMrN�r[�!/usr/lib64/python3.8/telnetlib.py�__init__�szTelnet.__init__cCsFd|_|st}||_||_||_t�d|||�t�||f|�|_	dS)z�Connect to a host.

        The optional second argument is the port number, which
        defaults to the standard telnet port (23).

        Don't try to reopen an already connected instance.
        rztelnetlib.Telnet.openN)
rS�TELNET_PORTrLrMrN�sys�audit�socketZcreate_connectionrOrYr[r[r\rX�szTelnet.opencCs|��dS)z#Destructor -- close the connection.N��close�rZr[r[r\�__del__�szTelnet.__del__cGs@|jdkr<td|j|jfdd�|r4t||�nt|�dS)z�Print a debug message, when the debug level is > 0.

        If extra arguments are present, they are substituted in the
        message using the standard string formatting operator.

        rzTelnet(%s,%s):� )�endN)rK�printrLrM)rZ�msg�argsr[r[r\ri�s

z
Telnet.msgcCs
||_dS)zhSet the debug level.

        The higher it is, the more debug output you get (on sys.stdout).

        N)rK)rZrKr[r[r\�set_debuglevel�szTelnet.set_debuglevelcCs.|j}d|_d|_d|_d|_|r*|��dS)zClose the connection.NTrIr)rOrSrTrUrc)rZrOr[r[r\rcszTelnet.closecCs|jS)z)Return the socket object used internally.)rOrdr[r[r\�
get_socketszTelnet.get_socketcCs
|j��S)z9Return the fileno() of the socket object used internally.)rO�filenordr[r[r\rmsz
Telnet.filenocCsBt|kr|�ttt�}t�d||�|�d|�|j�|�dS)z�Write a string to the socket, doubling any IAC characters.

        Can block if the connection is blocked.  May raise
        OSError if the connection is closed.

        ztelnetlib.Telnet.writezsend %rN)�IAC�replacer_r`rirO�sendall)rZ�bufferr[r[r\�writes
zTelnet.writec
Cs*t|�}|��|j�|�}|dkrN||}|jd|�}|j|d�|_|S|dk	r`t�|}t���}|�|tj�|j	�s|�
|�r�tdt|j�|�}|��|��|j�||�}|dkr�||}|jd|�}|j|d�|_|W5QR�S|dk	rv|t�}|dkrv�qqvW5QRX|�
�S)aRead until a given string is encountered or until timeout.

        When no match is found, return whatever is available instead,
        possibly the empty string.  Raise EOFError if the connection
        is closed and no cooked data is available.

        rN)�len�process_rawqrR�find�_time�_TelnetSelector�register�	selectors�
EVENT_READrS�select�max�	fill_rawq�read_very_lazy)rZ�matchrN�n�i�buf�deadline�selectorr[r[r\�
read_until&s8


zTelnet.read_untilcCs0|��|js |��|��q|j}d|_|S)z7Read all data until EOF; block until connection closed.rI)rtrSr}rR�rZr�r[r[r\�read_allKs
zTelnet.read_allcCs6|��|js&|js&|��|��q|j}d|_|S)z�Read at least one byte of cooked data unless EOF is hit.

        Return b'' if EOF is hit.  Block if no data is immediately
        available.

        rI)rtrRrSr}r�r[r[r\�	read_someUs
zTelnet.read_somecCs0|��|js(|��r(|��|��q|��S)aRead everything that's possible without blocking in I/O (eager).

        Raise EOFError if connection closed and no cooked data
        available.  Return b'' if no cooked data available otherwise.
        Don't block unless in the midst of an IAC sequence.

        )rtrS�
sock_availr}r~rdr[r[r\�read_very_eagerds

zTelnet.read_very_eagercCs6|��|js.|js.|��r.|��|��q|��S)z�Read readily available data.

        Raise EOFError if connection closed and no cooked data
        available.  Return b'' if no cooked data available otherwise.
        Don't block unless in the midst of an IAC sequence.

        )rtrRrSr�r}r~rdr[r[r\�
read_eagerrs

zTelnet.read_eagercCs|��|��S)aProcess and return data that's already in the queues (lazy).

        Raise EOFError if connection closed and no data available.
        Return b'' if no cooked data available otherwise.  Don't block
        unless in the midst of an IAC sequence.

        )rtr~rdr[r[r\�	read_lazy�szTelnet.read_lazycCs(|j}d|_|s$|jr$|js$td��|S)z�Return any data available in the cooked queue (very lazy).

        Raise EOFError if connection closed and no data available.
        Return b'' if no cooked data available otherwise.  Don't block.

        rIztelnet connection closed)rRrSrP�EOFErrorr�r[r[r\r~�s
zTelnet.read_very_lazycCs|j}d|_|S)aReturn any data available in the SB ... SE queue.

        Return b'' if no SB ... SE available. Should only be called
        after seeing a SB or SE command. When a new SB command is
        found, old unread SB data will be discarded. Don't block.

        rI)rVr�r[r[r\�read_sb_data�szTelnet.read_sb_datacCs
||_dS)zIProvide a callback function called after each receipt of a telnet option.N)rW)rZ�callbackr[r[r\�set_option_negotiation_callback�sz&Telnet.set_option_negotiation_callbackcCsRddg}�z|j�r|��}|jsf|tkr,q|dkr6q|tkrV||j|||j<qn|j|7_qt|j�dk�r$|ttt	t
fkr�|j|7_qd|_|tkr�||j|||j<nh|tkr�d|_d|_n&|t
kr�d|_|j|d|_d|d<|j�r|�|j|t�n|�dt|��qt|j�dkr|jdd�}d|_|}|ttfk�r�|�d|tk�rnd�ppd	t|��|j�r�|�|j||�n|j�tt
|�q|t	t
fkr|�d|t	k�r�d
�p�dt|��|j�r�|�|j||�q|j�tt|�qWn"tk
�r,d|_d|_YnX|j|d|_|j|d|_dS)
z�Transfer from raw queue to cooked queue.

        Set self.eof when connection is closed.  Don't block unless in
        the midst of an IAC sequence.

        rI�rrzIAC %d not recognizedrz	IAC %s %d�DO�DONT�WILL�WONTN)rP�rawq_getcharrT�theNULLrnrUrsr�r�r�r��SBrV�SErWrO�NOOPTri�ordrpr�rR)rZr��c�cmd�optr[r[r\rt�sp��zTelnet.process_rawqcCsZ|js|��|jrt�|j|j|jd�}|jd|_|jt|j�krVd|_d|_|S)z�Get next char from raw queue.

        Block if no data is immediately available.  Raise EOFError
        when connection is closed.

        rrIr)rPr}rSr�rQrs)rZr�r[r[r\r��szTelnet.rawq_getcharcCsL|jt|j�krd|_d|_|j�d�}|�d|�||_|j||_dS)z�Fill raw queue from exactly one recv() system call.

        Block if no data is immediately available.  Set self.eof when
        connection is closed.

        rIr�2zrecv %rN)rQrsrPrOZrecvrirSr�r[r[r\r}szTelnet.fill_rawqc
Cs:t��*}|�|tj�t|�d��W5QR�SQRXdS)z-Test whether data is available on the socket.rN)rwrxryrz�boolr{)rZr�r[r[r\r�szTelnet.sock_availc
Cs�tjdkr|��dSt���}|�|tj�|�tjtj�|��D]�\}}|j	|kr�z|�
�}Wn*tk
r�td�YW5QR�dSX|r�tj
�|�d��tj
��qD|j	tjkrDtj���d�}|s�W5QR�dS|�|�qDq<W5QRXdS)z9Interaction function, emulates a very dumb telnet client.Zwin32N�(*** Connection closed by remote host ***�ascii)r_�platform�mt_interactrwrxryrz�stdinr{Zfileobjr�r�rh�stdoutrr�decode�flush�readline�encode)rZr��keyZevents�text�liner[r[r\�interacts*

zTelnet.interactcCs<ddl}|�|jd�tj��}|s&q8|�|�d��qdS)z$Multithreaded version of interact().rNr[r�)�_thread�start_new_thread�listenerr_r�r�rrr�)rZr�r�r[r[r\r�3s
zTelnet.mt_interactcCsTz|��}Wntk
r*td�YdSX|rDtj�|�d��qtj��qdS)z>Helper for mt_interact() -- this executes in the other thread.r�Nr�)r�r�rhr_r�rrr�r�)rZ�datar[r[r\r�=szTelnet.listenerc
CsTd}|dd�}tt|��}|D]0}t||d�s |s>ddl}|�||�||<q |dk	rdt�|}t���}|�|tj	�|j
�s&|��|D]X}||�|j
�}|r�|��}	|j
d|	�}
|j
|	d�|_
|||
fW5QR�Sq�|dk	�r|�|�}|t�}|�s|dkrz�q&nqz|��qzW5QRX|��}
|
�sJ|j
�rJt�dd|
fS)a�Read until one from a list of a regular expressions matches.

        The first argument is a list of regular expressions, either
        compiled (re.Pattern instances) or uncompiled (strings).
        The optional second argument is a timeout, in seconds; default
        is no timeout.

        Return a tuple of three items: the index in the list of the
        first regular expression that matches; the re.Match object
        returned; and the text read up till and including the match.

        If EOF is read and no text was read, raise EOFError.
        Otherwise, when nothing matches, return (-1, None, text) where
        text is the text received so far (may be the empty string if a
        timeout happened).

        If a regular expression ends with a greedy match (e.g. '.*')
        or if more than one expression can match the same input, the
        results are undeterministic, and may depend on the I/O timing.

        N�searchr���)�rangers�hasattr�re�compilervrwrxryrzrSrtr�rRrgr{r}r~r�)rZ�listrNr��indicesr�r�r��m�er�Zreadyr[r[r\�expectJsB



z
Telnet.expectcCs|S�Nr[rdr[r[r\�	__enter__�szTelnet.__enter__cCs|��dSr�rb)rZ�type�value�	tracebackr[r[r\�__exit__�szTelnet.__exit__)N)N)"�__name__�
__module__�__qualname__�__doc__raZ_GLOBAL_DEFAULT_TIMEOUTr]rXrerirkrcrlrmrrr�r�r�r�r�r�r~r�r�rtr�r}r�r�r�r�r�r�r�r[r[r[r\r�s>5�


%

H

8c	Cs�d}tjdd�r2tjddkr2|d}tjd=qd}tjdd�rNtjd}d}tjdd�r�tjd}zt|�}Wn tk
r�t�|d�}YnXt��(}|�|�|j||dd	�|�	�W5QRXdS)
z�Test program for telnetlib.

    Usage: python telnetlib.py [-d] ... [host [port]]

    Default host is localhost; default port is 23.

    rrNz-dZ	localhostrZtcpg�?)rN)
r_�argv�int�
ValueErrorraZ
getservbynamerrkrXr�)rKrLrMZportstrZtnr[r[r\�test�s$



r��__main__)Zr�r_rary�timerrv�__all__rJr^�bytesrnr�r�r�r�r�r�ZNOPZDMZBRKZIPZAOZAYTZECZELZGAr�ZBINARYZECHOZRCPZSGAZNAMSZSTATUSZTMZRCTEZNAOLZNAOPZNAOCRDZNAOHTSZNAOHTDZNAOFFDZNAOVTSZNAOVTDZNAOLFDZXASCIIZLOGOUTZBMZDETZSUPDUPZSUPDUPOUTPUTZSNDLOCZTTYPEZEORZTUIDZOUTMRKZTTYLOCZVT3270REGIMEZX3PADZNAWSZTSPEEDZLFLOWZLINEMODEZXDISPLOCZOLD_ENVIRONZAUTHENTICATIONZENCRYPTZNEW_ENVIRONZTN3270EZXAUTH�CHARSETZRSPZCOM_PORT_OPTIONZSUPPRESS_LOCAL_ECHOZTLSZKERMITZSEND_URLZ	FORWARD_XZPRAGMA_LOGONZ
SSPI_LOGONZPRAGMA_HEARTBEATZEXOPLr�r�rHrwZSelectSelectorrr�r�r[r[r[r\�<module>s�#








































































__pycache__/codecs.cpython-38.pyc000064400000102246151153537600012657 0ustar00U

e5d;��,@s�dZddlZddlZzddlTWn.ek
rNZzede��W5dZ[XYnXddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0g,Zd1Zd2Z	Z
d3ZZd4Z
d5Zejd6kr�e
ZZe
ZneZZeZe
ZeZe
ZeZGd7d�de�ZGd8d�d�ZGd9d�de�ZGd:d;�d;e�ZGd<d�de�ZGd=d>�d>e�ZGd?d�de�ZGd@d�de�Z GdAd�d�Z!GdBd�d�Z"d\dFd�Z#d]dGd�Z$dHd�Z%dId �Z&dJd!�Z'dKd"�Z(dLd#�Z)dMd$�Z*d^dNd'�Z+d_dOd(�Z,dPdQ�Z-dRdS�Z.z4e/dD�Z0e/dT�Z1e/dU�Z2e/dV�Z3e/dW�Z4e/dX�Z5Wn.e6k
�r`dZ0dZ1dZ2dZ3dZ4dZ5YnXdZ7e7�rtddl8Z8e9dYk�r�e$ej:dZd[�e_:e$ej;d[dZ�e_;dS)`z� codecs -- Python Codec Registry, API and helpers.


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

�N)�*z%Failed to load the builtin codecs: %s�register�lookup�open�EncodedFile�BOM�BOM_BE�BOM_LE�BOM32_BE�BOM32_LE�BOM64_BE�BOM64_LE�BOM_UTF8�	BOM_UTF16�BOM_UTF16_LE�BOM_UTF16_BE�	BOM_UTF32�BOM_UTF32_LE�BOM_UTF32_BE�	CodecInfo�Codec�IncrementalEncoder�IncrementalDecoder�StreamReader�StreamWriter�StreamReaderWriter�
StreamRecoder�
getencoder�
getdecoder�getincrementalencoder�getincrementaldecoder�	getreader�	getwriter�encode�decode�
iterencode�
iterdecode�
strict_errors�
ignore_errors�replace_errors�xmlcharrefreplace_errors�backslashreplace_errors�namereplace_errors�register_error�lookup_errorss��s��s��s���littlec@s,eZdZdZdZd	dd�dd�Zdd�ZdS)
rz0Codec details when looking up the codec registryTN)�_is_text_encodingc
CsPt�|||||f�}	||	_||	_||	_||	_||	_||	_||	_|dk	rL||	_	|	S�N)
�tuple�__new__�namer#r$�incrementalencoder�incrementaldecoder�streamwriter�streamreaderr0)
�clsr#r$r8r7r5r6r4r0�self�r;�/usr/lib64/python3.8/codecs.pyr3^szCodecInfo.__new__cCsd|jj|jj|jt|�fS)Nz%<%s.%s object for encoding %s at %#x>)�	__class__�
__module__�__qualname__r4�id�r:r;r;r<�__repr__ms��zCodecInfo.__repr__)NNNNN)�__name__r>r?�__doc__r0r3rBr;r;r;r<rSs��c@s$eZdZdZddd�Zd	dd�ZdS)
ra9 Defines the interface for stateless encoders/decoders.

        The .encode()/.decode() methods may use different error
        handling schemes by providing the errors argument. These
        string values are predefined:

         'strict' - raise a ValueError error (or a subclass)
         'ignore' - ignore the character and continue with the next
         'replace' - replace with a suitable replacement character;
                    Python will use the official U+FFFD REPLACEMENT
                    CHARACTER for the builtin Unicode codecs on
                    decoding and '?' on encoding.
         'surrogateescape' - replace with private code points U+DCnn.
         'xmlcharrefreplace' - Replace with the appropriate XML
                               character reference (only for encoding).
         'backslashreplace'  - Replace with backslashed escape sequences.
         'namereplace'       - Replace with \N{...} escape sequences
                               (only for encoding).

        The set of allowed values can be extended via register_error.

    �strictcCst�dS)a# Encodes the object input and returns a tuple (output
            object, length consumed).

            errors defines the error handling to apply. It defaults to
            'strict' handling.

            The method may not store state in the Codec instance. Use
            StreamWriter for codecs which have to keep state in order to
            make encoding efficient.

            The encoder must be able to handle zero length input and
            return an empty object of the output object type in this
            situation.

        N��NotImplementedError�r:�input�errorsr;r;r<r#�szCodec.encodecCst�dS)a� Decodes the object input and returns a tuple (output
            object, length consumed).

            input must be an object which provides the bf_getreadbuf
            buffer slot. Python strings, buffer objects and memory
            mapped files are examples of objects providing this slot.

            errors defines the error handling to apply. It defaults to
            'strict' handling.

            The method may not store state in the Codec instance. Use
            StreamReader for codecs which have to keep state in order to
            make decoding efficient.

            The decoder must be able to handle zero length input and
            return an empty object of the output object type in this
            situation.

        NrFrHr;r;r<r$�szCodec.decodeN)rE)rE)rCr>r?rDr#r$r;r;r;r<rrs
c@s<eZdZdZddd�Zddd�Zdd	�Zd
d�Zdd
�ZdS)rz�
    An IncrementalEncoder encodes an input in multiple steps. The input can
    be passed piece by piece to the encode() method. The IncrementalEncoder
    remembers the state of the encoding process between calls to encode().
    rEcCs||_d|_dS)z�
        Creates an IncrementalEncoder instance.

        The IncrementalEncoder may use different error handling schemes by
        providing the errors keyword argument. See the module docstring
        for a list of possible values.
        �N)rJ�buffer�r:rJr;r;r<�__init__�szIncrementalEncoder.__init__FcCst�dS)zA
        Encodes input and returns the resulting object.
        NrF�r:rI�finalr;r;r<r#�szIncrementalEncoder.encodecCsdS)z:
        Resets the encoder to the initial state.
        Nr;rAr;r;r<�reset�szIncrementalEncoder.resetcCsdS)z:
        Return the current state of the encoder.
        rr;rAr;r;r<�getstate�szIncrementalEncoder.getstatecCsdS)zl
        Set the current state of the encoder. state must have been
        returned by getstate().
        Nr;�r:�stater;r;r<�setstate�szIncrementalEncoder.setstateN)rE)F)	rCr>r?rDrNr#rQrRrUr;r;r;r<r�s

c@sDeZdZdZddd�Zdd�Zddd	�Zd
d�Zdd
�Zdd�Z	dS)�BufferedIncrementalEncoderz�
    This subclass of IncrementalEncoder can be used as the baseclass for an
    incremental encoder if the encoder must keep some of the output in a
    buffer between calls to encode().
    rEcCst�||�d|_dS�NrK)rrNrLrMr;r;r<rN�sz#BufferedIncrementalEncoder.__init__cCst�dSr1rF�r:rIrJrPr;r;r<�_buffer_encode�sz)BufferedIncrementalEncoder._buffer_encodeFcCs0|j|}|�||j|�\}}||d�|_|Sr1)rLrYrJ�r:rIrP�data�result�consumedr;r;r<r#�s
z!BufferedIncrementalEncoder.encodecCst�|�d|_dSrW)rrQrLrAr;r;r<rQ�s
z BufferedIncrementalEncoder.resetcCs
|jpdS�Nr�rLrAr;r;r<rR�sz#BufferedIncrementalEncoder.getstatecCs|pd|_dSrWr_rSr;r;r<rU�sz#BufferedIncrementalEncoder.setstateN)rE)F)
rCr>r?rDrNrYr#rQrRrUr;r;r;r<rV�s

rVc@s<eZdZdZddd�Zddd�Zdd	�Zd
d�Zdd
�ZdS)rz�
    An IncrementalDecoder decodes an input in multiple steps. The input can
    be passed piece by piece to the decode() method. The IncrementalDecoder
    remembers the state of the decoding process between calls to decode().
    rEcCs
||_dS)z�
        Create an IncrementalDecoder instance.

        The IncrementalDecoder may use different error handling schemes by
        providing the errors keyword argument. See the module docstring
        for a list of possible values.
        N)rJrMr;r;r<rNszIncrementalDecoder.__init__FcCst�dS)z@
        Decode input and returns the resulting object.
        NrFrOr;r;r<r$szIncrementalDecoder.decodecCsdS)z9
        Reset the decoder to the initial state.
        Nr;rAr;r;r<rQszIncrementalDecoder.resetcCsdS)a	
        Return the current state of the decoder.

        This must be a (buffered_input, additional_state_info) tuple.
        buffered_input must be a bytes object containing bytes that
        were passed to decode() that have not yet been converted.
        additional_state_info must be a non-negative integer
        representing the state of the decoder WITHOUT yet having
        processed the contents of buffered_input.  In the initial state
        and after reset(), getstate() must return (b"", 0).
        )�rr;rAr;r;r<rRszIncrementalDecoder.getstatecCsdS)z�
        Set the current state of the decoder.

        state must have been returned by getstate().  The effect of
        setstate((b"", 0)) must be equivalent to reset().
        Nr;rSr;r;r<rU'szIncrementalDecoder.setstateN)rE)F)	rCr>r?rDrNr$rQrRrUr;r;r;r<r�s


c@sDeZdZdZddd�Zdd�Zddd	�Zd
d�Zdd
�Zdd�Z	dS)�BufferedIncrementalDecoderz�
    This subclass of IncrementalDecoder can be used as the baseclass for an
    incremental decoder if the decoder must be able to handle incomplete
    byte sequences.
    rEcCst�||�d|_dS�Nr`)rrNrLrMr;r;r<rN5sz#BufferedIncrementalDecoder.__init__cCst�dSr1rFrXr;r;r<�_buffer_decode:sz)BufferedIncrementalDecoder._buffer_decodeFcCs0|j|}|�||j|�\}}||d�|_|Sr1)rLrcrJrZr;r;r<r$?s
z!BufferedIncrementalDecoder.decodecCst�|�d|_dSrb)rrQrLrAr;r;r<rQGs
z BufferedIncrementalDecoder.resetcCs
|jdfSr^r_rAr;r;r<rRKsz#BufferedIncrementalDecoder.getstatecCs|d|_dSr^r_rSr;r;r<rUOsz#BufferedIncrementalDecoder.setstateN)rE)F)
rCr>r?rDrNrcr$rQrRrUr;r;r;r<ra/s

rac@sTeZdZddd�Zdd�Zdd�Zdd	�Zddd�Zefd
d�Z	dd�Z
dd�ZdS)rrEcCs||_||_dS)aw Creates a StreamWriter instance.

            stream must be a file-like object open for writing.

            The StreamWriter may use different error handling
            schemes by providing the errors keyword argument. These
            parameters are predefined:

             'strict' - raise a ValueError (or a subclass)
             'ignore' - ignore the character and continue with the next
             'replace'- replace with a suitable replacement character
             'xmlcharrefreplace' - Replace with the appropriate XML
                                   character reference.
             'backslashreplace'  - Replace with backslashed escape
                                   sequences.
             'namereplace'       - Replace with \N{...} escape sequences.

            The set of allowed parameter values can be extended via
            register_error.
        N)�streamrJ�r:rdrJr;r;r<rN\szStreamWriter.__init__cCs"|�||j�\}}|j�|�dS)z> Writes the object's contents encoded to self.stream.
        N)r#rJrd�write)r:�objectr[r]r;r;r<rfuszStreamWriter.writecCs|�d�|��dS)z[ Writes the concatenated list of strings to the stream
            using .write().
        rKN)rf�join�r:�listr;r;r<�
writelines|szStreamWriter.writelinescCsdS)a5 Flushes and resets the codec buffers used for keeping state.

            Calling this method should ensure that the data on the
            output is put into a clean state, that allows appending
            of new fresh data without having to rescan the whole
            stream to recover state.

        Nr;rAr;r;r<rQ�s
zStreamWriter.resetrcCs*|j�||�|dkr&|dkr&|��dSr^�rd�seekrQ�r:�offset�whencer;r;r<rm�szStreamWriter.seekcCs||j|�S�z? Inherit all other methods from the underlying stream.
        �rd�r:r4�getattrr;r;r<�__getattr__�szStreamWriter.__getattr__cCs|Sr1r;rAr;r;r<�	__enter__�szStreamWriter.__enter__cCs|j��dSr1�rd�close�r:�type�value�tbr;r;r<�__exit__�szStreamWriter.__exit__N)rE)r)rCr>r?rNrfrkrQrmrtrurvr}r;r;r;r<rZs

�
c@s�eZdZeZddd�Zd dd�Zd!dd	�Zd"dd
�Zd#dd�Z	dd�Z
d$dd�Zdd�Zdd�Z
efdd�Zdd�Zdd�Zd
S)%rrEcCs.||_||_d|_|��|_|j|_d|_dS)a� Creates a StreamReader instance.

            stream must be a file-like object open for reading.

            The StreamReader may use different error handling
            schemes by providing the errors keyword argument. These
            parameters are predefined:

             'strict' - raise a ValueError (or a subclass)
             'ignore' - ignore the character and continue with the next
             'replace'- replace with a suitable replacement character
             'backslashreplace' - Replace with backslashed escape sequences;

            The set of allowed parameter values can be extended via
            register_error.
        r`N)rdrJ�
bytebuffer�charbuffertype�_empty_charbuffer�
charbuffer�
linebufferrer;r;r<rN�s
zStreamReader.__init__cCst�dSr1rFrHr;r;r<r$�szStreamReader.decode���Fc
CsN|jr|j�|j�|_d|_|dkr(|}|dkrBt|j�|krB�q|dkrV|j��}n|j�|�}|j|}|st�qz|�||j	�\}}Wn`t
k
r�}zB|r�|�|d|j�|j	�\}}|jdd�}	t|	�dkrڂn�W5d}~XYnX||d�|_|j|7_|s(�qq(|dk�r,|j}
|j|_n|jd|�}
|j|d�|_|
S)a� Decodes data from the stream self.stream and returns the
            resulting object.

            chars indicates the number of decoded code points or bytes to
            return. read() will never return more data than requested,
            but it might return less, if there is not enough available.

            size indicates the approximate maximum number of decoded
            bytes or code points to read for decoding. The decoder
            can modify this setting as appropriate. The default value
            -1 indicates to read and decode as much as possible.  size
            is intended to prevent having to decode huge files in one
            step.

            If firstline is true, and a UnicodeDecodeError happens
            after the first line terminator in the input only the first line
            will be returned, the rest of the input will be kept until the
            next call to read().

            The method should use a greedy read strategy, meaning that
            it should read as much data as is allowed within the
            definition of the encoding and the given size, e.g.  if
            optional encoding endings or state markers are available
            on the stream, these should be read too.
        NrT��keepends�)
r�r�rhr��lenrd�readr~r$rJ�UnicodeDecodeError�start�
splitlines)r:�size�chars�	firstline�newdatar[�newchars�decodedbytes�exc�linesr\r;r;r<r��sD
�

zStreamReader.readNTc	Cs�|jrP|jd}|jd=t|j�dkr8|jd|_d|_|sL|jdd�d}|S|pVd}|j}|j|dd�}|r�t|t�r�|�d	�s�t|t	�r�|�d
�r�||jddd�7}||7}|jdd�}|�r�t|�dk�r8|d}|d=t|�dk�r|d|j7<||_d|_n|d|j|_|�s�|jdd�d}�q�|d}|djdd�d}||k�r�|j�
|dd��|j|_|�r�|}n|}�q�|�r�|dk	�r�|�r�|�s�|jdd�d}�q�|d
kr^|d9}q^|S)z� Read one line from the input stream and return the
            decoded data.

            size, if given, is passed as size argument to the
            read() method.

        rr�NFr��HT)r��
�
)r�r�r�i@�)r�r�r�r�r�r��
isinstance�str�endswith�bytesrh)	r:r�r��line�readsizer[r��line0withend�line0withoutendr;r;r<�readlinesd
��
�
zStreamReader.readlinecCs|��}|�|�S)aS Read all lines available on the input stream
            and return them as a list.

            Line breaks are implemented using the codec's decoder
            method and are included in the list entries.

            sizehint, if given, is ignored since there is no efficient
            way to finding the true end-of-line.

        )r�r�)r:�sizehintr�r[r;r;r<�	readlines^szStreamReader.readlinescCsd|_|j|_d|_dS)z� Resets the codec buffers used for keeping state.

            Note that no stream repositioning should take place.
            This method is primarily intended to be able to recover
            from decoding errors.

        r`N)r~r�r�r�rAr;r;r<rQms	zStreamReader.resetrcCs|j�||�|��dS)zp Set the input stream's current position.

            Resets the codec buffers used for keeping state.
        Nrlrnr;r;r<rmzszStreamReader.seekcCs|��}|r|St�dS)�4 Return the next decoded line from the input stream.N)r��
StopIteration)r:r�r;r;r<�__next__�szStreamReader.__next__cCs|Sr1r;rAr;r;r<�__iter__�szStreamReader.__iter__cCs||j|�Srqrrrsr;r;r<ru�szStreamReader.__getattr__cCs|Sr1r;rAr;r;r<rv�szStreamReader.__enter__cCs|j��dSr1rwryr;r;r<r}�szStreamReader.__exit__)rE)rE)r�r�F)NT)NT)r)rCr>r?r�rrNr$r�r�r�rQrmr�r�rtrurvr}r;r;r;r<r�s


P
K

�
c@s�eZdZdZdZd!dd�Zd"dd�Zd#d
d�Zd$dd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
d%dd�Zefdd�Zdd�Zdd �Zd	S)&ra StreamReaderWriter instances allow wrapping streams which
        work in both read and write modes.

        The design is such that one can use the factory functions
        returned by the codec.lookup() function to construct the
        instance.

    �unknownrEcCs(||_|||�|_|||�|_||_dS)aR Creates a StreamReaderWriter instance.

            stream must be a Stream-like object.

            Reader, Writer must be factory functions or classes
            providing the StreamReader, StreamWriter interface resp.

            Error handling is done in the same way as defined for the
            StreamWriter/Readers.

        N)rd�reader�writerrJ)r:rd�Reader�WriterrJr;r;r<rN�s
zStreamReaderWriter.__init__r�cCs|j�|�Sr1)r�r��r:r�r;r;r<r��szStreamReaderWriter.readNcCs|j�|�Sr1)r�r�r�r;r;r<r��szStreamReaderWriter.readlinecCs|j�|�Sr1)r�r�)r:r�r;r;r<r��szStreamReaderWriter.readlinescCs
t|j�S�r�)�nextr�rAr;r;r<r��szStreamReaderWriter.__next__cCs|Sr1r;rAr;r;r<r��szStreamReaderWriter.__iter__cCs|j�|�Sr1)r�rf)r:r[r;r;r<rf�szStreamReaderWriter.writecCs|j�|�Sr1)r�rkrir;r;r<rk�szStreamReaderWriter.writelinescCs|j��|j��dSr1�r�rQr�rAr;r;r<rQ�s
zStreamReaderWriter.resetrcCs6|j�||�|j��|dkr2|dkr2|j��dSr^)rdrmr�rQr�rnr;r;r<rm�s
zStreamReaderWriter.seekcCs||j|�Srqrrrsr;r;r<ru�szStreamReaderWriter.__getattr__cCs|Sr1r;rAr;r;r<rv�szStreamReaderWriter.__enter__cCs|j��dSr1rwryr;r;r<r}�szStreamReaderWriter.__exit__)rE)r�)N)N)r)rCr>r?rD�encodingrNr�r�r�r�r�rfrkrQrmrtrurvr}r;r;r;r<r�s 	




�
	c@s�eZdZdZdZdZd!dd�Zd"dd�Zd#d
d�Zd$dd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zd%dd�Zefdd�Zdd�Zdd �Zd	S)&raB StreamRecoder instances translate data from one encoding to another.

        They use the complete set of APIs returned by the
        codecs.lookup() function to implement their task.

        Data written to the StreamRecoder is first decoded into an
        intermediate format (depending on the "decode" codec) and then
        written to the underlying stream using an instance of the provided
        Writer class.

        In the other direction, data is read from the underlying stream using
        a Reader instance and then encoded and returned to the caller.

    r�rEcCs4||_||_||_|||�|_|||�|_||_dS)a� Creates a StreamRecoder instance which implements a two-way
            conversion: encode and decode work on the frontend (the
            data visible to .read() and .write()) while Reader and Writer
            work on the backend (the data in stream).

            You can use these objects to do transparent
            transcodings from e.g. latin-1 to utf-8 and back.

            stream must be a file-like object.

            encode and decode must adhere to the Codec interface; Reader and
            Writer must be factory functions or classes providing the
            StreamReader and StreamWriter interfaces resp.

            Error handling is done in the same way as defined for the
            StreamWriter/Readers.

        N)rdr#r$r�r�rJ)r:rdr#r$r�r�rJr;r;r<rNszStreamRecoder.__init__r�cCs"|j�|�}|�||j�\}}|Sr1)r�r�r#rJ�r:r�r[�bytesencodedr;r;r<r�#szStreamRecoder.readNcCs6|dkr|j��}n|j�|�}|�||j�\}}|Sr1)r�r�r#rJr�r;r;r<r�)s
zStreamRecoder.readlinecCs(|j��}|�||j�\}}|jdd�S)NTr�)r�r�r#rJr�)r:r�r[r�r;r;r<r�2s
zStreamRecoder.readlinescCs t|j�}|�||j�\}}|Sr�)r�r�r#rJ)r:r[r�r;r;r<r�8s
zStreamRecoder.__next__cCs|Sr1r;rAr;r;r<r�?szStreamRecoder.__iter__cCs|�||j�\}}|j�|�Sr1)r$rJr�rf)r:r[�bytesdecodedr;r;r<rfBszStreamRecoder.writecCs(d�|�}|�||j�\}}|j�|�Srb)rhr$rJr�rf)r:rjr[r�r;r;r<rkGs
zStreamRecoder.writelinescCs|j��|j��dSr1r�rAr;r;r<rQMs
zStreamRecoder.resetrcCs |j�||�|j�||�dSr1)r�rmr�rnr;r;r<rmRszStreamRecoder.seekcCs||j|�Srqrrrsr;r;r<ruXszStreamRecoder.__getattr__cCs|Sr1r;rAr;r;r<rv_szStreamRecoder.__enter__cCs|j��dSr1rwryr;r;r<r}bszStreamRecoder.__exit__)rE)r�)N)N)r)rCr>r?rD�
data_encoding�
file_encodingrNr�r�r�r�r�rfrkrQrmrtrurvr}r;r;r;r<r�s$�


	

�
�rrEr�cCst|dk	rd|kr|d}t�|||�}|dkr2|Sz&t|�}t||j|j|�}||_|WS|���YnXdS)aq Open an encoded file using the given mode and return
        a wrapped version providing transparent encoding/decoding.

        Note: The wrapped version will only accept the object format
        defined by the codecs, i.e. Unicode objects for most builtin
        codecs. Output is also codec dependent and will usually be
        Unicode as well.

        Underlying encoded files are always opened in binary mode.
        The default file mode is 'r', meaning to open the file in read mode.

        encoding specifies the encoding which is to be used for the
        file.

        errors may be given to define the error handling. It defaults
        to 'strict' which causes ValueErrors to be raised in case an
        encoding error occurs.

        buffering has the same meaning as for the builtin open() API.
        It defaults to -1 which means that the default buffer size will
        be used.

        The returned wrapped file object provides an extra attribute
        .encoding which allows querying the used encoding. This
        attribute is only available if an encoding was specified as
        parameter.

    N�b)�builtinsrrrr8r7r�rx)�filename�moder�rJ�	buffering�file�info�srwr;r;r<rgs�cCsF|dkr|}t|�}t|�}t||j|j|j|j|�}||_||_|S)a� Return a wrapped version of file which provides transparent
        encoding translation.

        Data written to the wrapped file is decoded according
        to the given data_encoding and then encoded to the underlying
        file using file_encoding. The intermediate data type
        will usually be Unicode but depends on the specified codecs.

        Bytes read from the file are decoded using file_encoding and then
        passed back to the caller encoded using data_encoding.

        If file_encoding is not given, it defaults to data_encoding.

        errors may be given to define the error handling. It defaults
        to 'strict' which causes ValueErrors to be raised in case an
        encoding error occurs.

        The returned wrapped file object provides two extra attributes
        .data_encoding and .file_encoding which reflect the given
        parameters of the same name. The attributes can be used for
        introspection by Python programs.

    N)rrr#r$r8r7r�r�)r�r�r�rJ�	data_info�	file_info�srr;r;r<r�s�cCs
t|�jS)z� Lookup up the codec for the given encoding and return
        its encoder function.

        Raises a LookupError in case the encoding cannot be found.

    )rr#�r�r;r;r<r�scCs
t|�jS)z� Lookup up the codec for the given encoding and return
        its decoder function.

        Raises a LookupError in case the encoding cannot be found.

    )rr$r�r;r;r<r�scCst|�j}|dkrt|��|S)z� Lookup up the codec for the given encoding and return
        its IncrementalEncoder class or factory function.

        Raises a LookupError in case the encoding cannot be found
        or the codecs doesn't provide an incremental encoder.

    N)rr5�LookupError)r��encoderr;r;r<r�s	
cCst|�j}|dkrt|��|S)z� Lookup up the codec for the given encoding and return
        its IncrementalDecoder class or factory function.

        Raises a LookupError in case the encoding cannot be found
        or the codecs doesn't provide an incremental decoder.

    N)rr6r�)r��decoderr;r;r<r �s	
cCs
t|�jS)z� Lookup up the codec for the given encoding and return
        its StreamReader class or factory function.

        Raises a LookupError in case the encoding cannot be found.

    )rr8r�r;r;r<r!�scCs
t|�jS)z� Lookup up the codec for the given encoding and return
        its StreamWriter class or factory function.

        Raises a LookupError in case the encoding cannot be found.

    )rr7r�r;r;r<r"�scksHt|�|f|�}|D]}|�|�}|r|Vq|�dd�}|rD|VdS)z�
    Encoding iterator.

    Encodes the input strings from the iterator using an IncrementalEncoder.

    errors and kwargs are passed through to the IncrementalEncoder
    constructor.
    rKTN)rr#)�iteratorr�rJ�kwargsr�rI�outputr;r;r<r%s	
cksHt|�|f|�}|D]}|�|�}|r|Vq|�dd�}|rD|VdS)z�
    Decoding iterator.

    Decodes the input strings from the iterator using an IncrementalDecoder.

    errors and kwargs are passed through to the IncrementalDecoder
    constructor.
    r`TN)r r$)r�r�rJr�r�rIr�r;r;r<r&s	
cCsdd�|D�S)z� make_identity_dict(rng) -> dict

        Return a dictionary where elements of the rng sequence are
        mapped to themselves.

    cSsi|]
}||�qSr;r;)�.0�ir;r;r<�
<dictcomp>/sz&make_identity_dict.<locals>.<dictcomp>r;)�rngr;r;r<�make_identity_dict'sr�cCs4i}|��D]"\}}||kr&|||<qd||<q|S)a� Creates an encoding map from a decoding map.

        If a target mapping in the decoding map occurs multiple
        times, then that target is mapped to None (undefined mapping),
        causing an exception when encountered by the charmap codec
        during translation.

        One example where this happens is cp875.py which decodes
        multiple character to \u001a.

    N)�items)�decoding_map�m�k�vr;r;r<�make_encoding_map1s


r��ignore�replace�xmlcharrefreplace�backslashreplace�namereplace�__main__zlatin-1zutf-8)r�NrEr�)NrE)rE)rE)<rDr��sys�_codecs�ImportErrorZwhy�SystemError�__all__rr	rrrrr�	byteorderrrrrr
r
rr2rrrgrrVrrarrrrrrrrrr r!r"r%r&r�r�r.r'r(r)r*r+r,r��_falseZ	encodingsrC�stdout�stdinr;r;r;r<�<module>s�	�
B("1+IzWt
0
&








__pycache__/gettext.cpython-38.pyc000064400000042735151153537600013111 0ustar00U

e5dj�@s�dZddlZddlZddlZddlZddddddd	d
ddd
ddddddddddgZej�ejdd�Z	e�
dejejB�Z
dd�Zdd�ZdZd d!�eed"�D�Zd#d$d%d&�ZdGd(d)�Zd*d+�Zd,d-�Zd.d/�ZGd0d�d�ZGd1d�de�ZdHd3d�ZiZd4gZdddd2efd5d�Zdedfd6d�Ziaiad7a dId8d	�Z!dJd9d
�Z"dKd:d�Z#d;d�Z$d<d�Z%d=d
�Z&d>d�Z'd?d�Z(d@d�Z)dAd�Z*dBd�Z+dCd�Z,dDd�Z-dEd�Z.dFd�Z/eZ0dS)La�Internationalization and localization support.

This module provides internationalization (I18N) and localization (L10N)
support for your Python programs by providing an interface to the GNU gettext
message catalog library.

I18N refers to the operation by which a program is made aware of multiple
languages.  L10N refers to the adaptation of your program, once
internationalized, to the local language and cultural habits.

�N�NullTranslations�GNUTranslations�Catalog�find�translation�install�
textdomain�bindtextdomain�bind_textdomain_codeset�dgettext�	dngettext�gettext�lgettext�	ldgettext�
ldngettext�	lngettext�ngettext�pgettext�	dpgettext�	npgettext�
dnpgettextZshare�localea�
        (?P<WHITESPACES>[ \t]+)                    | # spaces and horizontal tabs
        (?P<NUMBER>[0-9]+\b)                       | # decimal integer
        (?P<NAME>n\b)                              | # only n is allowed
        (?P<PARENTHESIS>[()])                      |
        (?P<OPERATOR>[-*/%+?:]|[><!]=?|==|&&|\|\|) | # !, *, /, %, +, -, <, >,
                                                     # <=, >=, ==, !=, &&, ||,
                                                     # ? :
                                                     # unary and bitwise ops
                                                     # not allowed
        (?P<INVALID>\w+|.)                           # invalid token
    ccsPt�t|�D]8}|j}|dkr q|�|�}|dkr>td|��|VqdVdS)NZWHITESPACESZINVALIDz invalid token in plural form: %s�)�re�finditer�_token_pattern�	lastgroup�group�
ValueError)�pluralZmoZkind�value�r!�/usr/lib64/python3.8/gettext.py�	_tokenizeWs
r#cCs|rtd|�Std�SdS)Nz#unexpected token in plural form: %szunexpected end of plural form)r)r r!r!r"�_errorbsr$))�||)�&&)z==z!=)�<�>z<=z>=)�+�-)�*�/�%cCs i|]\}}|D]
}||�qqSr!r!)�.0�iZops�opr!r!r"�
<dictcomp>ps
r1��or�andz//)r%r&r,���cCs�d}t|�}|dkr&|d7}t|�}q|dkrXt|�\}}d||f}|dkr�td��nP|dkrnd	||f}n:zt|d
�}Wntk
r�t|�d�YnXd||f}t|�}d}|tk�rt|}||krҐq|d
kr�|d
kr�d|}t�||�}t||d�\}	}d|||	f}|}q�||k�r4dk�r@nnd|}|dk�r�|dk�r�t|d�\}
}|dk�rtt|��t|�\}}d|
||f}|dk�r�d|}||fS)Nr�!znot �(z%s(%s)�)z%unbalanced parenthesis in plural form�nz%s%s�
z%s%d�d)��z(%s)r2z%s %s %sr=�?r�:z%s if %s else %s)�next�_parser�intr$�_binary_ops�	_c2py_ops�get)�tokensZpriority�result�nexttok�subr �jr/r0�rightZif_trueZif_falser!r!r"rAssP




rAcCsZzt|�}Wn(tk
r4td|jjf�d�YnXddl}|�d|jjftd�|S)Nz'Plural value must be an integer, got %srr=)�round�	TypeError�	__class__�__name__�warnings�warn�DeprecationWarning)r9r/rPr!r!r"�_as_int�s ����rScCs�t|�dkrtd��z|tt|��\}}|r2t|��d}|D]6}|dkr`|d7}|dkrptd��q:|dkr:|d8}q:d	ti}td
||�|dWStk
r�td��YnXdS)
z�Gets a C expression as used in PO files for plural forms and returns a
    Python function that implements an equivalent expression.
    i�z"plural form expression is too longrr7r2�z%plural form expression is too complexr8rSz�if True:
            def func(n):
                if not isinstance(n, int):
                    n = _as_int(n)
                return int(%s)
            �funcN)�lenrrAr#r$rS�exec�RecursionError)rrGrHZdepth�c�nsr!r!r"�c2py�s.

��
r[c
Cs4t�|�}d}d}d}d}|�d�}|dkrN||d�}|d|�}||O}nd}|�d�}|dkr�||d�}|d|�}||O}nd}|�d�}|dkr�||d�}|d|�}||O}nd}|}	g}
t|d�D]P}||@s�|	}||@r�||7}||@�r
||7}||@�r||7}|
�|�q�|
��|
S)	Nr2�r=r�@r�.�_)rZ	normalizer�range�append�reverse)
ZlocZCOMPONENT_CODESETZCOMPONENT_TERRITORYZCOMPONENT_MODIFIER�mask�posZmodifier�codesetZ	territoryZlanguageZretr/�valr!r!r"�_expand_lang�sJ









rgc@s�eZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zddd�ZdS) rNcCs.i|_d|_d|_d|_|dk	r*|�|�dS�N)�_info�_charset�_output_charset�	_fallbackrA��self�fpr!r!r"�__init__�szNullTranslations.__init__cCsdSrhr!rmr!r!r"rAszNullTranslations._parsecCs|jr|j�|�n||_dSrh)rl�add_fallback)rn�fallbackr!r!r"rq
szNullTranslations.add_fallbackcCs|jr|j�|�S|Srh)rlr
)rn�messager!r!r"r
szNullTranslations.gettextc
Csrddl}|�dtd�|jrR|���(|�ddt�|j�|�W5QR�SQRX|jrd|�|j�S|�t	�
��S)Nr�/lgettext() is deprecated, use gettext() insteadr\�ignore�.*\blgettext\b.*)rPrQrRrl�catch_warnings�filterwarningsrrk�encoder�getpreferredencoding)rnrsrPr!r!r"rs�
�zNullTranslations.lgettextcCs*|jr|j�|||�S|dkr"|S|SdS�Nr2)rlr)rn�msgid1�msgid2r9r!r!r"r"s
zNullTranslations.ngettextc
Cs�ddl}|�dtd�|jrV|���,|�ddt�|j�|||�W5QR�SQRX|dkrd|}n|}|jrz|�|j�S|�t	�
��S)Nr�1lngettext() is deprecated, use ngettext() insteadr\ru�.*\blngettext\b.*r2)rPrQrRrlrwrxrrkryrrz�rnr|r}r9rP�tmsgr!r!r"r*s"�
�"zNullTranslations.lngettextcCs|jr|j�||�S|Srh)rlr)rn�contextrsr!r!r"r;szNullTranslations.pgettextcCs,|jr|j�||||�S|dkr$|S|SdSr{)rlr)rnr�r|r}r9r!r!r"r@s
zNullTranslations.npgettextcCs|jSrh)ri�rnr!r!r"�infoHszNullTranslations.infocCs|jSrh)rjr�r!r!r"�charsetKszNullTranslations.charsetcCsddl}|�dtd�|jS)Nrzoutput_charset() is deprecatedr\�rPrQrRrk)rnrPr!r!r"�output_charsetNs�zNullTranslations.output_charsetcCs ddl}|�dtd�||_dS)Nrz"set_output_charset() is deprecatedr\r�)rnr�rPr!r!r"�set_output_charsetTs�z#NullTranslations.set_output_charsetcCsRddl}|j|jd<|dk	rNddddddh}|t|�@D]}t||�|j|<q8dS)	Nrr_r
rrrrr)�builtinsr
�__dict__�set�getattr)rn�namesr�Zallowed�namer!r!r"rZs�zNullTranslations.install)N)N)rO�
__module__�__qualname__rprArqr
rrrrrr�r�r�r�rr!r!r!r"r�s

c@s\eZdZdZdZdZdZdd�Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�ZdS)rl�*l�$<z%s%s)rr2cCs|d?|d@fS)z/Returns a tuple of major version, minor version�i��r!)rn�versionr!r!r"�
_get_versionspszGNUTranslations._get_versionsc"Cs�ddlm}t|dd�}i|_}dd�|_|��}t|�}|d|dd	��d}||jkr||d
|d	d��\}}	}
}d}n6||jkr�|d
|d	d��\}}	}
}d}nt	dd|��|�
|�\}
}|
|jkr�t	ddt|
�|��t
d|	�D�]}||||
|
d��\}}||}|||||d��\}}||}||k�r`||k�r`|||�}|||�}nt	dd|��|dk�rld}|�d�D]�}|����}|�s��q�|�d��r�|�d��r��q�d}}d|k�r|�dd�\}}|����}|��}||j|<|}n|�r|j|d|7<|dk�r8|�d�d|_n0|dk�r�|�d�}|d�d�d}t|�|_�q�|j�pvd}d|k�r�|�d�\}} |�d�}t||�}t|�D]\}}!t|!|�|||f<�q�nt||�|t||�<|
d7}
|d7}q�dS)z8Override this method to support alternative .mo formats.r)�unpackr�rcSst|dk�Sr{)rB)r9r!r!r"�<lambda>}�z(GNUTranslations._parse.<locals>.<lambda>z<INr=z<4IrTz<IIz>4Iz>IIzBad magic numberzBad version number �zFile is corrupt�
z	#-#-#-#-#r?r2�
zcontent-typezcharset=zplural-forms�;zplural=�ascii�)Zstructr�r��_catalogr�readrV�LE_MAGIC�BE_MAGIC�OSErrorr��VERSIONS�strr`�split�decode�strip�
startswith�endswith�lowerrirjr[�	enumerate)"rnror��filenameZcatalogZbufZbuflen�magicr�ZmsgcountZ	masteridxZtransidxZiiZ
major_versionZ
minor_versionr/ZmlenZmoffZmendZtlenZtoffZtend�msgr�ZlastkZb_item�item�k�vrr�r|r}�xr!r!r"rAtsv














zGNUTranslations._parsecCshddl}|�dtd�t�}|j�||�}||krH|jrD|j�|�S|}|jrZ|�	|j�S|�	t
���S)Nrrtr\)rPrQrR�objectr�rErlrrkryrrz)rnrsrP�missingr�r!r!r"r�s�zGNUTranslations.lgettextcCs�ddl}|�dtd�z|j||�|�f}Wn@tk
rn|jrX|j�|||�YS|dkrf|}n|}YnX|jr�|�	|j�S|�	t
���S)Nrr~r\r2)rPrQrRr�r�KeyErrorrlrrkryrrzr�r!r!r"r�s �
zGNUTranslations.lngettextcCs6t�}|j�||�}||kr2|jr.|j�|�S|S|Srh)r�r�rErlr
)rnrsr�r�r!r!r"r
�szGNUTranslations.gettextcCs^z|j||�|�f}Wn@tk
rX|jrB|j�|||�YS|dkrP|}n|}YnX|Sr{)r�rr�rlr)rnr|r}r9r�r!r!r"r�s
zGNUTranslations.ngettextcCsF|j||f}t�}|j�||�}||krB|jr>|j�||�S|S|Srh)�CONTEXTr�r�rErlr)rnr�rs�ctxt_msg_idr�r�r!r!r"rszGNUTranslations.pgettextc	Csn|j||f}z|j||�|�f}WnBtk
rh|jrR|j�||||�YS|dkr`|}n|}YnX|Sr{)r�r�rr�rlr)rnr�r|r}r9r�r�r!r!r"rs
zGNUTranslations.npgettextN)rOr�r�r�r�r�r�r�rArrr
rrrr!r!r!r"rdsY	
FcCs�|dkrt}|dkrRg}dD]"}tj�|�}|r|�d�}q@qd|krR|�d�g}|D]$}t|�D]}||krf|�|�qfqZ|r�g}	nd}	|D]J}|dkr�q�tj�||dd|�}
tj�	|
�r�|r�|	�|
�q�|
Sq�|	S)N)ZLANGUAGE�LC_ALL�LC_MESSAGESZLANGr?�Cr�z%s.mo)
�_default_localedir�os�environrEr�rarg�path�join�exists)�domain�	localedir�	languages�allZenvarrfZnelangsZlangZnelangrG�mofiler!r!r"rs8


Zunspecifiedc
Cs|dkrt}t|||dd�}|sB|r*t�Sddlm}t|d|��d}|D]�}	|tj�|	�f}
t	�
|
�}|dkr�t|	d��}t	�|
||��}W5QRXddl
}
|
�
|�}|tk	r�ddl}|�dtd�|r�|���|�d	d
t�|�|�W5QRX|dk�r|}qJ|�|�qJ|S)NT)r�r)�ENOENTz$No translation file found for domain�rbzparameter codeset is deprecatedr\ruz.*\bset_output_charset\b.*)rrr�errnor��FileNotFoundErrorr�r��abspath�
_translationsrE�open�
setdefault�copy�_unspecifiedrPrQrRrwrxr�rq)r�r�r�Zclass_rrreZmofilesr�rGr��key�tror�rPr!r!r"rCsH�

�
�
cCst||d|d�}|�|�dS)NT)rrre)rr)r�r�rer�r�r!r!r"rnsZmessagescCs|dk	r|atSrh)�_current_domain)r�r!r!r"r|scCs|dk	r|t|<t�|t�Srh)�_localedirsrEr�)r�r�r!r!r"r	�scCs0ddl}|�dtd�|dk	r&|t|<t�|�S)Nrz'bind_textdomain_codeset() is deprecatedr\)rPrQrR�_localecodesetsrE)r�rerPr!r!r"r
�s�cCs:zt|t�|d��}Wntk
r.|YSX|�|�Srh)rr�rEr�r
)r�rsr�r!r!r"r�s

c
Cs�ddl}|�dtd�t�|�}z<|���*|�ddt�t|t�|d�|d�}W5QRXWn&t	k
r�|�
|pzt���YSX|���&|�ddt�|�
|�W5QR�SQRXdS)Nrz1ldgettext() is deprecated, use dgettext() insteadr\ru�.*\bparameter codeset\b.*�rerv)rPrQrRr�rErwrxrr�r�ryrrzr)r�rsrPrer�r!r!r"r�s&�

�$
�cCsRzt|t�|d��}Wn,tk
rB|dkr6|YS|YSYnX|�|||�Sr{)rr�rEr�r)r�r|r}r9r�r!r!r"r�sc
Cs�ddl}|�dtd�t�|�}z<|���*|�ddt�t|t�|d�|d�}W5QRXWn8t	k
r�|dkrz|}n|}|�
|p�t���YSX|���*|�ddt�|�
|||�W5QR�SQRXdS)	Nrz3ldngettext() is deprecated, use dngettext() insteadr\rur�r�r2r)rPrQrRr�rErwrxrr�r�ryrrzr)r�r|r}r9rPrer�r�r!r!r"r�s,�

�$
�cCs<zt|t�|d��}Wntk
r.|YSX|�||�Srh)rr�rEr�r)r�r�rsr�r!r!r"r�s

cCsTzt|t�|d��}Wn,tk
rB|dkr6|YS|YSYnX|�||||�Sr{)rr�rEr�r)r�r�r|r}r9r�r!r!r"r�scCs
tt|�Srh)rr�)rsr!r!r"r
�sc
CsNddl}|�dtd�|���&|�ddt�tt|�W5QR�SQRXdS)Nrrtr\ruz.*\bldgettext\b.*)rPrQrRrwrxrr�)rsrPr!r!r"r�s�
�cCstt|||�Srh)rr�)r|r}r9r!r!r"r�sc
CsRddl}|�dtd�|���*|�ddt�tt|||�W5QR�SQRXdS)Nrr~r\ruz.*\bldngettext\b.*)rPrQrRrwrxrr�)r|r}r9rPr!r!r"r�s�
�cCstt||�Srh)rr�)r�rsr!r!r"r�scCstt||||�Srh)rr�)r�r|r}r9r!r!r"r�s)r5)NNF)N)N)N)1�__doc__rr�r�sys�__all__r�r��base_prefixr��compile�VERBOSE�DOTALLrr#r$rCr�rDrArSr[rgrrrr�r�rrr�r�r�rr	r
rrrrrrr
rrrrrrr!r!r!r"�<module>s�0�
�

1$*f7
&�
+




	
__pycache__/mimetypes.cpython-38.pyc000064400000037241151153537600013435 0ustar00U

e5d�T�
@s�dZddlZddlZddlZddlZzddlZWnek
rHdZYnXddddddd	d
ddd
ddg
Z	dddddddddg	Z
dadaGdd�d�Z
d&dd�Zd'dd�Zd(dd�Zd)dd	�Zd*dd
�Zd d�Zd!d"�Ze�d#d$�Zed%kr�e�dS)+a�Guess the MIME type of a file.

This module defines two useful functions:

guess_type(url, strict=True) -- guess the MIME type and encoding of a URL.

guess_extension(type, strict=True) -- guess the extension for a given MIME type.

It also contains the following, for tuning the behavior:

Data:

knownfiles -- list of files to parse
inited -- flag set when init() has been called
suffix_map -- dictionary mapping suffixes to suffixes
encodings_map -- dictionary mapping suffixes to encodings
types_map -- dictionary mapping suffixes to types

Functions:

init([files]) -- parse a list of files, default knownfiles (on Windows, the
  default values are taken from the registry)
read_mime_types(file) -- parse one file, return a dictionary or None
�N�
knownfiles�inited�	MimeTypes�
guess_type�guess_all_extensions�guess_extension�add_type�init�read_mime_types�
suffix_map�
encodings_map�	types_map�common_typesz/etc/mime.typesz/etc/httpd/mime.typesz/etc/httpd/conf/mime.typesz/etc/apache/mime.typesz/etc/apache2/mime.typesz$/usr/local/etc/httpd/conf/mime.typesz"/usr/local/lib/netscape/mime.typesz/usr/local/etc/mime.typesFc@s`eZdZdZddd�Zddd�Zddd	�Zdd
d�Zddd
�Zddd�Z	ddd�Z
ddd�ZdS)rz�MIME-types datastore.

    This datastore can handle information from mime.types-style files
    and supports basic determination of MIME type from a filename or
    URL, and can guess a reasonable extension given a MIME type.
    �TcCs�ts
t�t��|_t��|_iif|_iif|_t	�
�D]\}}|�||d�q:t�
�D]\}}|�||d�qZ|D]}|�
||�qvdS�NTF)rr	�_encodings_map_default�copyr�_suffix_map_defaultrr
�
types_map_inv�_types_map_default�itemsr�_common_types_default�read)�self�	filenames�strict�ext�type�namerr�!/usr/lib64/python3.8/mimetypes.py�__init__Bs



zMimeTypes.__init__cCs6||j||<|j|�|g�}||kr2|�|�dS)a�Add a mapping between a type and an extension.

        When the extension is already known, the new
        type will replace the old one. When the type
        is already known the extension will be added
        to the list of known extensions.

        If strict is true, information will be added to
        list of standard types, else to the list of non-standard
        types.
        N)r
r�
setdefault�append)rrrrZextsrrrrPszMimeTypes.add_typecCsrt�|�}tj�|�\}}|dkr�|�d�}|dkr8dS|�dd|�}|dkr\|d|�}n|d|�}d|ksxd|kr|d	}|dfSt�|�\}}||jkr�t�||j|�\}}q�||j	kr�|j	|}	t�|�\}}nd}	|j
d
}
||
kr�|
||	fS|��|
k�r|
|��|	fS|�r(d|	fS|j
d}
||
k�rH|
||	fS|��|
k�rf|
|��|	fSd|	fSdS)aUGuess the type of a file which is either a URL or a path-like object.

        Return value is a tuple (type, encoding) where type is None if
        the type can't be guessed (no or unknown suffix) or a string
        of the form type/subtype, usable for a MIME Content-type
        header; and encoding is None for no encoding or the name of
        the program used to encode (e.g. compress or gzip).  The
        mappings are table driven.  Encoding suffixes are case
        sensitive; type suffixes are first tried case sensitive, then
        case insensitive.

        The suffixes .tgz, .taz and .tz (case sensitive!) are all
        mapped to '.tar.gz'.  (This is table-driven too, using the
        dictionary suffix_map.)

        Optional `strict' argument when False adds a bunch of commonly found,
        but non-standard types.
        �data�,r)NN�;N�=�/�
text/plainTF)�os�fspath�urllib�parseZ
_splittype�find�	posixpath�splitextrrr
�lower)r�urlrZschemeZcommaZsemir�baser�encodingr
rrrrasB







zMimeTypes.guess_typecCsL|��}|jd�|g�}|sH|jd�|g�D]}||kr0|�|�q0|S)a�Guess the extensions for a file based on its MIME type.

        Return value is a list of strings giving the possible filename
        extensions, including the leading dot ('.').  The extension is not
        guaranteed to have been associated with any particular data stream,
        but would be mapped to the MIME type `type' by guess_type().

        Optional `strict' argument when false adds a bunch of commonly found,
        but non-standard types.
        TF)r0r�getr")rrr�
extensionsrrrrr�szMimeTypes.guess_all_extensionscCs|�||�}|sdS|dS)aGuess the extension for a file based on its MIME type.

        Return value is a string giving a filename extension,
        including the leading dot ('.').  The extension is not
        guaranteed to have been associated with any particular data
        stream, but would be mapped to the MIME type `type' by
        guess_type().  If no extension can be guessed for `type', None
        is returned.

        Optional `strict' argument when false adds a bunch of commonly found,
        but non-standard types.
        Nr)r)rrrr5rrrr�s
zMimeTypes.guess_extensionc	Cs(t|dd��}|�||�W5QRXdS)z�
        Read a single mime.types-format file, specified by pathname.

        If strict is true, information will be added to
        list of standard types, else to the list of non-standard
        types.
        �utf-8�r3N)�open�readfp)r�filenamer�fprrrr�szMimeTypes.readc	Cs�|��}|sq�|��}tt|��D]"}||ddkr"||d�=qFq"|sLq|d|dd�}}|D]}|�|d||�qfqdS)z�
        Read a single mime.types-format file.

        If strict is true, information will be added to
        list of standard types, else to the list of non-standard
        types.
        r�#N��.)�readline�split�range�lenr)	rr;r�lineZwords�ir�suffixesZsuffrrrr9�s	
zMimeTypes.readfpcCs�tsdSdd�}t�tjd���}||�D]�}zjt�||��T}|�d�sTW5QR�Wq(t�|d�\}}|tjkr|W5QR�Wq(|�|||�W5QRXWq(tk
r�Yq(Yq(Xq(W5QRXdS)z�
        Load the MIME types database from Windows registry.

        If strict is true, information will be added to
        list of standard types, else to the list of non-standard
        types.
        NcssJd}zt�||�}Wntk
r,YqFYnXd|kr<|V|d7}qdS)Nr�r=)�_winregZEnumKey�OSError)ZmimedbrDZctyperrr�
enum_types�s
z3MimeTypes.read_windows_registry.<locals>.enum_types�r>zContent Type)rG�OpenKeyZHKEY_CLASSES_ROOT�
startswithZQueryValueExZREG_SZrrH)rrrIZhkcrZ
subkeynameZsubkeyZmimetypeZdatatyperrr�read_windows_registry�s$

�
zMimeTypes.read_windows_registryN)rT)T)T)T)T)T)T)T)�__name__�
__module__�__qualname__�__doc__r rrrrrr9rMrrrrr:s


?



TcCstdkrt�t�||�S)a�Guess the type of a file based on its URL.

    Return value is a tuple (type, encoding) where type is None if the
    type can't be guessed (no or unknown suffix) or a string of the
    form type/subtype, usable for a MIME Content-type header; and
    encoding is None for no encoding or the name of the program used
    to encode (e.g. compress or gzip).  The mappings are table
    driven.  Encoding suffixes are case sensitive; type suffixes are
    first tried case sensitive, then case insensitive.

    The suffixes .tgz, .taz and .tz (case sensitive!) are all mapped
    to ".tar.gz".  (This is table-driven too, using the dictionary
    suffix_map).

    Optional `strict' argument when false adds a bunch of commonly found, but
    non-standard types.
    N)�_dbr	r)r1rrrrrscCstdkrt�t�||�S)a�Guess the extensions for a file based on its MIME type.

    Return value is a list of strings giving the possible filename
    extensions, including the leading dot ('.').  The extension is not
    guaranteed to have been associated with any particular data
    stream, but would be mapped to the MIME type `type' by
    guess_type().  If no extension can be guessed for `type', None
    is returned.

    Optional `strict' argument when false adds a bunch of commonly found,
    but non-standard types.
    N)rRr	r�rrrrrr's
cCstdkrt�t�||�S)a�Guess the extension for a file based on its MIME type.

    Return value is a string giving a filename extension, including the
    leading dot ('.').  The extension is not guaranteed to have been
    associated with any particular data stream, but would be mapped to the
    MIME type `type' by guess_type().  If no extension can be guessed for
    `type', None is returned.

    Optional `strict' argument when false adds a bunch of commonly found,
    but non-standard types.
    N)rRr	rrSrrrr8scCstdkrt�t�|||�S)aiAdd a mapping between a type and an extension.

    When the extension is already known, the new
    type will replace the old one. When the type
    is already known the extension will be added
    to the list of known extensions.

    If strict is true, information will be added to
    list of standard types, else to the list of non-standard
    types.
    N)rRr	r)rrrrrrrHscCs�da|dkstdkrBt�}tr&|��|dkr4t}qFtt|�}nt}|D]}tj�	|�rJ|�
|�qJ|ja|ja|j
da
|j
da|adSr)rrRrrGrMr�listr)�path�isfilerrrr
r)�files�db�filerrrr	Ys"

c
Cs`zt|dd�}Wntk
r&YdSX|�*t�}|�|d�|jdW5QR�SQRXdS)Nr6r7T)r8rHrr9r
)rY�frXrrrr
usc�CsXddddddd�aadddd	d
�aadddd
ddddddddddddddddddddddddddddddddddd d!d!d"d"d#d$d$d%d&d'd(d)d*d+d,d-d-d.d.d.d/d0d1d2d3d4d4d4d4d5d6d6d7d7d8d8d8d9d:d;d<d=d>d>d>d?d@dAdAdBdCdDdEdFdGdHdIdJdKdLdMdMdMdMdNdOdPdPdQdQdQdQdQdQdRdSdTdUdVdVdWdXdYdZdZdZdZdZd[d[d\d]d^d_��aad`dadadbdcdcdcddde�aadS)fNz.svg.gzz.tar.gzz.tar.bz2z.tar.xz)z.svgzz.tgzz.tazz.tzz.tbz2z.txzZgzip�compressZbzip2Zxz)z.gzz.Zz.bz2z.xzzapplication/javascriptzapplication/jsonzapplication/manifest+jsonzapplication/mswordzapplication/octet-streamzapplication/odazapplication/pdfzapplication/pkcs7-mimezapplication/postscriptzapplication/vnd.apple.mpegurlzapplication/vnd.ms-excelzapplication/vnd.ms-powerpointzapplication/wasmzapplication/x-bcpiozapplication/x-cpiozapplication/x-cshzapplication/x-dvizapplication/x-gtarzapplication/x-hdfzapplication/x-hdf5zapplication/x-latexzapplication/x-mifzapplication/x-netcdfzapplication/x-pkcs12zapplication/x-pn-realaudiozapplication/x-python-codezapplication/x-shzapplication/x-sharzapplication/x-shockwave-flashzapplication/x-sv4cpiozapplication/x-sv4crczapplication/x-tarzapplication/x-tclzapplication/x-texzapplication/x-texinfozapplication/x-troffzapplication/x-troff-manzapplication/x-troff-mezapplication/x-troff-mszapplication/x-ustarzapplication/x-wais-sourcezapplication/xmlzapplication/zipzaudio/basicz
audio/mpegzaudio/x-aiffzaudio/x-pn-realaudiozaudio/x-wavz	image/bmpz	image/gifz	image/iefz
image/jpegz	image/pngz
image/svg+xmlz
image/tiffzimage/vnd.microsoft.iconzimage/x-cmu-rasterzimage/x-ms-bmpzimage/x-portable-anymapzimage/x-portable-bitmapzimage/x-portable-graymapzimage/x-portable-pixmapzimage/x-rgbzimage/x-xbitmapzimage/x-xpixmapzimage/x-xwindowdumpzmessage/rfc822ztext/cssztext/csvz	text/htmlr(z
text/richtextztext/tab-separated-valuesz
text/x-pythonz
text/x-setextztext/x-sgmlztext/x-vcardztext/xmlz	video/mp4z
video/mpegzvideo/quicktimez
video/webmzvideo/x-msvideozvideo/x-sgi-movie)�z.jsz.mjsz.jsonz.webmanifestz.docz.dotz.wizz.binz.az.dllz.exez.oz.objz.soz.odaz.pdfz.p7cz.psz.aiz.epsz.m3uz.m3u8z.xlsz.xlbz.pptz.potz.ppaz.ppsz.pwzz.wasmz.bcpioz.cpioz.cshz.dviz.gtarz.hdfz.h5z.latexz.mifz.cdfz.ncz.p12z.pfxz.ramz.pycz.pyoz.shz.sharz.swfz.sv4cpioz.sv4crcz.tarz.tclz.texz.texiz.texinfoz.roffz.tz.trz.manz.mez.msz.ustarz.srcz.xslz.rdfz.wsdlz.xpdlz.zipz.auz.sndz.mp3z.mp2z.aifz.aifcz.aiffz.raz.wav�.bmpz.gifz.ief�.jpgz.jpez.jpegz.pngz.svgz.tiffz.tifz.icoz.rasr\z.pnmz.pbmz.pgmz.ppmz.rgbz.xbmz.xpmz.xwdz.emlz.mhtz.mhtmlz.nwsz.cssz.csvz.htmlz.htmz.txtz.batz.cz.hz.kshz.plz.rtxz.tsvz.pyz.etxz.sgmz.sgmlz.vcfz.xmlz.mp4z.mpegz.m1vz.mpaz.mpez.mpgz.movz.qtz.webmz.aviz.moviezapplication/rtfz
audio/midiz	image/jpgz
image/pictztext/xul)z.rtfz.midiz.midr]z.pictz.pctz.picz.xul)rrrrr
rrrrrrr�_default_mime_types�s8�

�
��

�r^c
sddl}d�d�fdd�	}z&|�tjdd�ddd	d
g�\}}Wn.|jk
rn}z|d|�W5d}~XYnXd}d}|D]4\}}|dkr�|d�q||dkr�d}q||d
kr|d}q||D]Z}	|r�t|	|�}
|
s�td|	�nt|
�q�t|	|�\}
}|
�std|	�q�td|
d|�q�dS)Nra4Usage: mimetypes.py [options] type

Options:
    --help / -h       -- print this message and exit
    --lenient / -l    -- additionally search of some common, but non-standard
                         types.
    --extension / -e  -- guess extension instead of type

More than one type argument may be given.
rJcs"t��|rt|�t�|�dS)N)�print�sys�exit)�code�msg�ZUSAGErr�usageFsz_main.<locals>.usager=Zhle�helpZlenient�	extension)z-hz--help)z-lz	--lenient)z-ez--extensionz I don't know anything about typeztype:z	encoding:)rJ)�getoptr`�argv�errorrr_r)rhreZopts�argsrcrrg�opt�argZgtypeZguessr3rrdr�_main7s8�


rn�__main__)T)T)T)T)N)rQr)r`r.Zurllib.parser+�winregrG�ImportError�__all__rrrRrrrrrr	r
r^rnrNrrrr�<module>s`
��W




5.__pycache__/antigravity.cpython-38.opt-1.pyc000064400000001437151153537600014717 0ustar00U

e5d��@s&ddlZddlZe�d�dd�ZdS)�Nzhttps://xkcd.com/353/cCs\t�|���}dd�|dd�|dd�fD�\}}td||dd�||dd�f�dS)z�Compute geohash() using the Munroe algorithm.

    >>> geohash(37.421542, -122.085589, b'2005-05-26-10458.68')
    37.857713 -122.544543

    cSsg|]}dt�d|��qS)z%fz0.)�float�fromhex)�.0�x�r�#/usr/lib64/python3.8/antigravity.py�
<listcomp>szgeohash.<locals>.<listcomp>N�� z	%d%s %d%s�)�hashlibZmd5Z	hexdigest�print)ZlatitudeZ	longitudeZdatedow�h�p�qrrr�geohashs&r)Z
webbrowserr�openrrrrr�<module>s
__pycache__/shlex.cpython-38.opt-2.pyc000064400000015505151153537600013503 0ustar00U

e5d
4�	@s�ddlZddlZddlZddlmZddlmZddddgZGdd�d�Zddd�Z	dd�Z
e�d
ej�j
Zdd�Zdd�Zedkr�eej�dkr�ee��n,ejdZee��Zeeee��W5QRXdS)�N)�deque)�StringIO�shlex�split�quote�joinc@sneZdZddd�Zedd��Zdd�Zdd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zddd�Zdd�Z
dd�ZdS)rNFcCst|t�rt|�}|dk	r(||_||_ntj|_d|_||_|rHd|_nd|_d|_	d|_
|jrn|j
d7_
d|_d|_d|_
d|_d	|_d
|_t�|_d|_d|_d|_t�|_d|_|s�d}n|d
kr�d}||_|�rt�|_|j
d7_
|j
�t�|��}|j
�|�|_
dS)N��#Z?abcdfeghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_u|ßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞz 	
Fz'"�\�"� �rTz();<>|&z~-./*?=)�
isinstance�strr�instream�infile�sys�stdin�posix�eof�
commenters�	wordchars�
whitespace�whitespace_split�quotes�escape�
escapedquotes�stater�pushback�lineno�debug�token�	filestack�source�_punctuation_chars�_pushback_chars�	maketrans�dict�fromkeys�	translate)�selfrrr�punctuation_chars�t�r-�/usr/lib64/python3.8/shlex.py�__init__sJ
zshlex.__init__cCs|jS�N)r$�r*r-r-r.r+Dszshlex.punctuation_charscCs*|jdkrtdt|��|j�|�dS)Nr
zshlex: pushing token )r �print�reprr�
appendleft)r*�tokr-r-r.�
push_tokenHs
zshlex.push_tokencCspt|t�rt|�}|j�|j|j|jf�||_||_d|_|jrl|dk	r\t	d|jf�nt	d|jf�dS)Nr
zshlex: pushing to file %szshlex: pushing to stream %s)
rrrr"r4rrrr r2)r*�	newstream�newfiler-r-r.�push_sourceNs
zshlex.push_sourcecCsD|j��|j��\|_|_|_|jr:td|j|jf�d|_dS)Nzshlex: popping to %s, line %dr)	r�closer"�popleftrrr r2rr1r-r-r.�
pop_source\s

�zshlex.pop_sourcecCs�|jr.|j��}|jdkr*tdt|��|S|��}|jdk	rz||jkrz|�|���}|rp|\}}|�||�|�	�}q@||j
kr�|js�|j
S|��|�	�}qz|jdkr�||j
kr�tdt|��ntd�|S)Nr
zshlex: popping token z
shlex: token=zshlex: token=EOF)
rr;r r2r3�
read_tokenr#�
sourcehookr9�	get_tokenrr"r<)r*r5�raw�specr8r7r-r-r.r?es.








zshlex.get_tokencCs�d}d}|jr |jr |j��}n|j�d�}|dkrB|jd7_|jdkr^td|j|f�|jdkrtd|_	�q�q|jdk�r�|s�d|_�q��q�||j
kr�|jdkr�td	�|j	s�|jr|r�q�nqn�||jkr�|j�
�|jd7_n�|j�r||jk�rd
}||_n�||jk�r&||_	d
|_nr||jk�r@||_	d|_nX||jk�rb|j�sZ||_	||_n6|j�rx||_	d
|_n ||_	|j	�s�|jr|r�q�nqq|j|jk�rDd}|�s�|jdk�r�td
�td��||jk�r|j�s�|j	|7_	d|_�q�nd
|_n>|j�r4||jk�r4|j|jk�r4|j}||_n|j	|7_	q|j|jk�r�|�st|jdk�rltd�td��||jk�r�||jk�r�||k�r�|j	|j7_	|j	|7_	||_q|jdkr|�s�d|_�q�q||j
k�r|jdk�r�td�d|_|j	�s�|jr|r�q�nqq||jk�rh|j�
�|jd7_|j�r�d|_|j	�s�|jr|r�q�nqq|jdk�r�||jk�r�|j	|7_	n"||j
k�r�|j�|�d|_�q�q|j�r�||jk�r�||_q|j�r�||jk�r�d
}||_q||jk�s||jk�s|j�r,||jk�r,|j	|7_	q|j�rB|j�|�n|j�|�|jdk�rbtd�d|_|j	�s�|jr|r�q�qqq|j	}d|_	|j�r�|�s�|dk�r�d}|jdk�r�|�r�tdt|��ntd�|S)NFrr
�
�z&shlex: in state %r I see character: %rr�z+shlex: I see whitespace in whitespace state�a�cTz shlex: I see EOF in quotes statezNo closing quotationz shlex: I see EOF in escape statezNo escaped character)rErFz%shlex: I see whitespace in word statez&shlex: I see punctuation in word statezshlex: raw token=zshlex: raw token=EOF)r+r%�popr�readrr r2rr!rrr�readlinerrrr�
ValueErrorr�appendrr4r3)r*ZquotedZescapedstateZnextchar�resultr-r-r.r=�s

�




���

��zshlex.read_tokencCsV|ddkr|dd�}t|jt�rHtj�|�sHtj�tj�|j�|�}|t|d�fS)Nrrr
����r)	rrr�os�path�isabsr�dirname�open)r*r8r-r-r.r>s
zshlex.sourcehookcCs(|dkr|j}|dkr|j}d||fS)Nz"%s", line %d: )rr)r*rrr-r-r.�error_leader s
zshlex.error_leadercCs|Sr0r-r1r-r-r.�__iter__(szshlex.__iter__cCs|��}||jkrt�|Sr0)r?r�
StopIteration)r*r!r-r-r.�__next__+s
zshlex.__next__)NNFF)N)NN)�__name__�
__module__�__qualname__r/�propertyr+r6r9r<r?r=r>rTrUrWr-r-r-r.rs�
/

	 	
FTcCs$t||d�}d|_|sd|_t|�S)N)rTr)rrr�list)�sZcommentsrZlexr-r-r.r1s
cCsd�dd�|D��S)Nrcss|]}t|�VqdSr0)r)�.0�argr-r-r.�	<genexpr><szjoin.<locals>.<genexpr>)r)Z
split_commandr-r-r.r:sz[^\w@%+=:,./-]cCs,|sdSt|�dkr|Sd|�dd�dS)Nz''�'z'"'"')�_find_unsafe�replace)r]r-r-r.rAs
cCs$|��}|sq tdt|��qdS)NzToken: )r?r2r3)ZlexerZttr-r-r.�
_print_tokensMsrd�__main__r
)FT)rO�rer�collectionsr�ior�__all__rrr�compile�ASCII�searchrbrrdrX�len�argv�fnrS�fr-r-r-r.�<module>
s& 
	

__pycache__/sched.cpython-38.pyc000064400000014606151153537600012507 0ustar00U

e5d*�@s�dZddlZddlZddlmZddlZddlmZdgZGdd�dedd��Z	d	e	j_d
e	j
_de	j_de	j_d
e	j
_e�ZGdd�d�ZdS)a�A generally useful event scheduler class.

Each instance of this class manages its own queue.
No multi-threading is implied; you are supposed to hack that
yourself, or use a single instance per application.

Each instance is parametrized with two functions, one that is
supposed to return the current time, one that is supposed to
implement a delay.  You can implement real-time scheduling by
substituting time and sleep from built-in module time, or you can
implement simulated time by writing your own functions.  This can
also be used to integrate scheduling with STDWIN events; the delay
function is allowed to modify the queue.  Time can be expressed as
integers or floating point numbers, as long as it is consistent.

Events are specified by tuples (time, priority, action, argument, kwargs).
As in UNIX, lower priority numbers mean higher priority; in this
way the queue can be maintained as a priority queue.  Execution of the
event means calling the action function, passing it the argument
sequence in "argument" (remember that in Python, multiple function
arguments are be packed in a sequence) and keyword parameters in "kwargs".
The action function may be an instance method so it
has another way to reference private data (besides global variables).
�N)�
namedtuple)�	monotonic�	schedulerc@s8eZdZgZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�EventcCs|j|jf|j|jfkS�N��time�priority��s�o�r
�/usr/lib64/python3.8/sched.py�__eq__$�zEvent.__eq__cCs|j|jf|j|jfkSrrr
r
r
r�__lt__%rzEvent.__lt__cCs|j|jf|j|jfkSrrr
r
r
r�__le__&rzEvent.__le__cCs|j|jf|j|jfkSrrr
r
r
r�__gt__'rzEvent.__gt__cCs|j|jf|j|jfkSrrr
r
r
r�__ge__(rzEvent.__ge__N)	�__name__�
__module__�__qualname__�	__slots__rrrrrr
r
r
rr"srz(time, priority, action, argument, kwargszaNumeric type compatible with the return value of the
timefunc function passed to the constructor.zSEvents scheduled for the same time will be executed
in the order of their priority.z?Executing the event means executing
action(*argument, **kwargs)zGargument is a sequence holding the positional
arguments for the action.zDkwargs is a dictionary holding the keyword
arguments for the action.c@s^eZdZeejfdd�Zdefdd�Zdefdd�Z	dd	�Z
d
d�Zdd
d�Ze
dd��ZdS)rcCs g|_t��|_||_||_dS)zGInitialize a new instance, passing the time and delay
        functionsN)�_queue�	threading�RLock�_lock�timefunc�	delayfunc)�selfrrr
r
r�__init__9s
zscheduler.__init__r
c	Cs@|tkri}t|||||�}|j�t�|j|�W5QRX|S)z�Enter a new event in the queue at an absolute time.

        Returns an ID for the event which can be used to remove it,
        if necessary.

        )�	_sentinelrr�heapq�heappushr)rrr	�action�argument�kwargs�eventr
r
r�enterabsAszscheduler.enterabscCs|��|}|�|||||�S)z{A variant that specifies the time as a relative time.

        This is actually the more commonly used interface.

        )rr()r�delayr	r$r%r&rr
r
r�enterOszscheduler.enterc	Cs.|j�|j�|�t�|j�W5QRXdS)z�Remove an event from the queue.

        This must be presented the ID as returned by enter().
        If the event is not in the queue, this raises ValueError.

        N)rr�remover"�heapify)rr'r
r
r�cancelXszscheduler.cancelc
Cs&|j�|jW5QR�SQRXdS)z!Check whether the queue is empty.N)rr)rr
r
r�emptycszscheduler.emptyTc	Cs�|j}|j}|j}|j}tj}|�H|s4W5QR�q�|d\}}}	}
}|�}||krZd}
nd}
||�W5QRX|
r�|s�||S|||�q|	|
|�|d�qdS)aExecute events until the queue is empty.
        If blocking is False executes the scheduled events due to
        expire soonest (if any) and then return the deadline of the
        next scheduled call in the scheduler.

        When there is a positive delay until the first event, the
        delay function is called and the event is left in the queue;
        otherwise, the event is removed from the queue and executed
        (its action function is called, passing it the argument).  If
        the delay function returns prematurely, it is simply
        restarted.

        It is legal for both the delay function and the action
        function to modify the queue or to raise an exception;
        exceptions are not caught but the scheduler's state remains
        well-defined so run() may be called again.

        A questionable hack is added to allow other threads to run:
        just after an event is executed, a delay of 0 is executed, to
        avoid monopolizing the CPU when other threads are also
        runnable.

        rTFN)rrrrr"�heappop)rZblocking�lock�qrr�poprr	r$r%r&Znowr)r
r
r�runhs(
z
scheduler.runc	Cs:|j�|jdd�}W5QRXtttj|gt|���S)z�An ordered list of upcoming events.

        Events are named tuples with fields for:
            time, priority, action, arguments, kwargs

        N)rr�list�mapr"r/�len)rZeventsr
r
r�queue�szscheduler.queueN)T)rrr�_timer�sleepr r!r(r*r-r.r3�propertyr7r
r
r
rr7s	
2)�__doc__rr"�collectionsrrrr8�__all__rr	r$r%r&�objectr!rr
r
r
r�<module>s__pycache__/nturl2path.cpython-38.opt-1.pyc000064400000003322151153537600014454 0ustar00U

e5dG�@sdZdd�Zdd�ZdS)z�Convert a NT pathname to a file URL and vice versa.

This module only exists to provide OS-specific code
for urllib.requests, thus do not use directly.
cCs�ddl}ddl}|�dd�}d|kr\|dd�dkr@|dd�}|�d�}|j�d	�|��S|�d�}t|�dks�|dd
|jkr�d|}t	|��|dd
�
�}|d�d�}|d}|D]}|r�|d	|j�|�}q�|�d�r�|�d�r�|d	7}|S)
z{OS-specific conversion from a relative URL of the 'file' scheme
    to a file system path; not recommended for general use.�N�:�|�z////��/�\���z	Bad URL: �)�string�urllib.parse�replace�split�parseZunquote�join�lenZ
ascii_letters�OSError�upper�endswith)Zurlr
�urllib�
components�comp�error�drive�path�r�"/usr/lib64/python3.8/nturl2path.py�url2pathnames(	

rcCs4ddl}|dd�dkrf|dd�}|dd���dkrJd|dd�}n|dd�d	krftd
|��d	|kr�|dd�dkr�d|}|�d�}|j�d�|��S|jd	dd
�}t|�dks�t|d�dkr�d
|}t|��|j�|d���}|d�d�}d|d	}|D] }|�r|d|j�|�}�q|S)z{OS-specific conversion from a file system path to a relative URL
    of the 'file' scheme; not recommended for general use.rNrz\\?\zUNC\rr	rrz
Bad path: z\\r)�maxsplitz///)rrrr
rZquoterr)�prrrrrrrrr�pathname2url-s.
rN)�__doc__rrrrrr�<module>s%__pycache__/_pyio.cpython-38.pyc000064400000220541151153537600012535 0ustar00U

e5d�k�@s|dZddlZddlZddlZddlZddlZddlZddlmZ	ej
dkrXddlmZ
ndZ
ddlZddlmZmZmZmZdddhZeed	�r�e�ej�e�ej�d
ZeZeed�p�ejjZd7dd�Zdd�Zz
ejZWne k
�r�eZYnXGdd�d�Z!Gdd�d�Z"z
ej#Z#Wn(e k
�rHGdd�de$e%�Z#YnXGdd�dej&d�Z'ej'�(e'�Gdd�de'�Z)ej)�(e)�ddl*m+Z+e)�(e+�Gdd �d e'�Z,ej,�(e,�Gd!d"�d"e,�Z-Gd#d$�d$e,�Z.Gd%d&�d&e-�Z/Gd'd(�d(e-�Z0Gd)d*�d*e,�Z1Gd+d,�d,e0e/�Z2Gd-d.�d.e)�Z+Gd/d0�d0e'�Z3ej3�(e3�Gd1d2�d2ej4�Z5Gd3d4�d4e3�Z6Gd5d6�d6e6�Z7dS)8z)
Python implementation of the io module.
�N)�
allocate_lock>�win32�cygwin)�setmode)�__all__�SEEK_SET�SEEK_CUR�SEEK_END���	SEEK_HOLEi Zgettotalrefcount�r���Tc	Cs�t|t�st�|�}t|tttf�s0td|��t|t�sFtd|��t|t�s\td|��|dk	rzt|t�sztd|��|dk	r�t|t�s�td|��t|�}|td�s�t|�t|�kr�t	d|��d|k}	d	|k}
d
|k}d|k}d|k}
d
|k}d|k}d|k�rD|	�s"|�s"|�s"|
�r*t	d��ddl
}|�dtd�d}
|�rX|�rXt	d��|	|
||dk�rvt	d��|	�s�|
�s�|�s�|�s�t	d��|�r�|dk	�r�t	d��|�r�|dk	�r�t	d��|�r�|dk	�r�t	d��|�r|dk�rddl
}|�dt
d�t||	�rd�pd|
�r"d	�p$d|�r2d
�p4d|�rBd�pDd|
�rRd�pTd||d�}|}�z$d}|dk�s�|dk�r�|���r�d }d}|dk�r�t}zt�|���j}Wnttfk
�r�YnX|dk�r�|}|dk�r�t	d!��|dk�r|�r|WSt	d"��|
�r t||�}n<|	�s2|�s2|�r>t||�}n|
�rPt||�}nt	d#|��|}|�rl|WSt|||||�}|}||_|WS|���YnXdS)$a�Open file and return a stream.  Raise OSError upon failure.

    file is either a text or byte string giving the name (and the path
    if the file isn't in the current working directory) of the file to
    be opened or an integer file descriptor of the file to be
    wrapped. (If a file descriptor is given, it is closed when the
    returned I/O object is closed, unless closefd is set to False.)

    mode is an optional string that specifies the mode in which the file is
    opened. It defaults to 'r' which means open for reading in text mode. Other
    common values are 'w' for writing (truncating the file if it already
    exists), 'x' for exclusive creation of a new file, and 'a' for appending
    (which on some Unix systems, means that all writes append to the end of the
    file regardless of the current seek position). In text mode, if encoding is
    not specified the encoding used is platform dependent. (For reading and
    writing raw bytes use binary mode and leave encoding unspecified.) The
    available modes are:

    ========= ===============================================================
    Character Meaning
    --------- ---------------------------------------------------------------
    'r'       open for reading (default)
    'w'       open for writing, truncating the file first
    'x'       create a new file and open it for writing
    'a'       open for writing, appending to the end of the file if it exists
    'b'       binary mode
    't'       text mode (default)
    '+'       open a disk file for updating (reading and writing)
    'U'       universal newline mode (deprecated)
    ========= ===============================================================

    The default mode is 'rt' (open for reading text). For binary random
    access, the mode 'w+b' opens and truncates the file to 0 bytes, while
    'r+b' opens the file without truncation. The 'x' mode implies 'w' and
    raises an `FileExistsError` if the file already exists.

    Python distinguishes between files opened in binary and text modes,
    even when the underlying operating system doesn't. Files opened in
    binary mode (appending 'b' to the mode argument) return contents as
    bytes objects without any decoding. In text mode (the default, or when
    't' is appended to the mode argument), the contents of the file are
    returned as strings, the bytes having been first decoded using a
    platform-dependent encoding or using the specified encoding if given.

    'U' mode is deprecated and will raise an exception in future versions
    of Python.  It has no effect in Python 3.  Use newline to control
    universal newlines mode.

    buffering is an optional integer used to set the buffering policy.
    Pass 0 to switch buffering off (only allowed in binary mode), 1 to select
    line buffering (only usable in text mode), and an integer > 1 to indicate
    the size of a fixed-size chunk buffer.  When no buffering argument is
    given, the default buffering policy works as follows:

    * Binary files are buffered in fixed-size chunks; the size of the buffer
      is chosen using a heuristic trying to determine the underlying device's
      "block size" and falling back on `io.DEFAULT_BUFFER_SIZE`.
      On many systems, the buffer will typically be 4096 or 8192 bytes long.

    * "Interactive" text files (files for which isatty() returns True)
      use line buffering.  Other text files use the policy described above
      for binary files.

    encoding is the str name of the encoding used to decode or encode the
    file. This should only be used in text mode. The default encoding is
    platform dependent, but any encoding supported by Python can be
    passed.  See the codecs module for the list of supported encodings.

    errors is an optional string that specifies how encoding errors are to
    be handled---this argument should not be used in binary mode. Pass
    'strict' to raise a ValueError exception if there is an encoding error
    (the default of None has the same effect), or pass 'ignore' to ignore
    errors. (Note that ignoring encoding errors can lead to data loss.)
    See the documentation for codecs.register for a list of the permitted
    encoding error strings.

    newline is a string controlling how universal newlines works (it only
    applies to text mode). It can be None, '', '\n', '\r', and '\r\n'.  It works
    as follows:

    * On input, if newline is None, universal newlines mode is
      enabled. Lines in the input can end in '\n', '\r', or '\r\n', and
      these are translated into '\n' before being returned to the
      caller. If it is '', universal newline mode is enabled, but line
      endings are returned to the caller untranslated. If it has any of
      the other legal values, input lines are only terminated by the given
      string, and the line ending is returned to the caller untranslated.

    * On output, if newline is None, any '\n' characters written are
      translated to the system default line separator, os.linesep. If
      newline is '', no translation takes place. If newline is any of the
      other legal values, any '\n' characters written are translated to
      the given string.

    closedfd is a bool. If closefd is False, the underlying file descriptor will
    be kept open when the file is closed. This does not work when a file name is
    given and must be True in that case.

    The newly created file is non-inheritable.

    A custom opener can be used by passing a callable as *opener*. The
    underlying file descriptor for the file object is then obtained by calling
    *opener* with (*file*, *flags*). *opener* must return an open file
    descriptor (passing os.open as *opener* results in functionality similar to
    passing None).

    open() returns a file object whose type depends on the mode, and
    through which the standard file operations such as reading and writing
    are performed. When open() is used to open a file in a text mode ('w',
    'r', 'wt', 'rt', etc.), it returns a TextIOWrapper. When used to open
    a file in a binary mode, the returned class varies: in read binary
    mode, it returns a BufferedReader; in write binary and append binary
    modes, it returns a BufferedWriter, and in read/write mode, it returns
    a BufferedRandom.

    It is also possible to use a string or bytearray as a file for both
    reading and writing. For strings StringIO can be used like a file
    opened in a text mode, and for bytes a BytesIO can be used like a file
    opened in a binary mode.
    zinvalid file: %rzinvalid mode: %rzinvalid buffering: %rN�invalid encoding: %r�invalid errors: %rzaxrwb+tU�xr
�w�a�+�t�b�Uz4mode U cannot be combined with 'x', 'w', 'a', or '+'rz'U' mode is deprecatedrTz'can't have text and binary mode at oncer
z)can't have read/write/append mode at oncez/must have exactly one of read/write/append modez-binary mode doesn't take an encoding argumentz+binary mode doesn't take an errors argumentz+binary mode doesn't take a newline argumentzaline buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used�)�openerFrzinvalid buffering sizezcan't have unbuffered text I/Ozunknown mode: %r)�
isinstance�int�os�fspath�str�bytes�	TypeError�set�len�
ValueError�warnings�warn�DeprecationWarning�RuntimeWarning�FileIO�isatty�DEFAULT_BUFFER_SIZE�fstat�fileno�
st_blksize�OSError�AttributeError�BufferedRandom�BufferedWriter�BufferedReader�
TextIOWrapper�mode�close)�filer4�	buffering�encoding�errors�newline�closefdrZmodesZcreatingZreadingZwritingZ	appendingZupdating�textZbinaryr$�raw�result�line_bufferingZbs�buffer�rA�/usr/lib64/python3.8/_pyio.py�open)s�{




�������



rCcCs ddl}|�dtd�t|d�S)azOpens the provided file with mode ``'rb'``. This function
    should be used when the intent is to treat the contents as
    executable code.

    ``path`` should be an absolute path.

    When supported by the runtime, this function can be hooked
    in order to allow embedders more control over code files.
    This functionality is not supported on the current runtime.
    rNz(_pyio.open_code() may not be using hooksr�rb)r$r%r'rC)�pathr$rArArB�_open_code_with_warnings�rFc@seZdZdZddd�ZdS)�
DocDescriptorz%Helper for builtins.open.__doc__
    NcCs
dtjS)Nz\open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True)

)rC�__doc__)�self�obj�typrArArB�__get__s��zDocDescriptor.__get__)N)�__name__�
__module__�__qualname__rHrLrArArArBrGsrGc@seZdZdZe�Zdd�ZdS)�OpenWrapperz�Wrapper for builtins.open

    Trick so that open won't become a bound method when stored
    as a class variable (as dbm.dumb does).

    See initstdio() in Python/pylifecycle.c.
    cOs
t||�S�N)rC)�cls�args�kwargsrArArB�__new__,szOpenWrapper.__new__N)rMrNrOrHrGrUrArArArBrP"srPc@seZdZdS)�UnsupportedOperationN)rMrNrOrArArArBrV5srVc@s�eZdZdZdd�Zd6dd�Zdd�Zd7d
d�Zdd
�ZdZ	dd�Z
dd�Zdd�Zd8dd�Z
dd�Zd9dd�Zdd�Zd:dd�Zedd ��Zd;d!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd<d,d-�Zd.d/�Zd0d1�Zd=d2d3�Zd4d5�Zd	S)>�IOBaseaThe abstract base class for all I/O classes, acting on streams of
    bytes. There is no public constructor.

    This class provides dummy implementations for many methods that
    derived classes can override selectively; the default implementations
    represent a file that cannot be read, written or seeked.

    Even though IOBase does not declare read or write because
    their signatures will vary, implementations and clients should
    consider those methods part of the interface. Also, implementations
    may raise UnsupportedOperation when operations they do not support are
    called.

    The basic type used for binary data read from or written to a file is
    bytes. Other bytes-like objects are accepted as method arguments too.
    Text I/O classes work with str data.

    Note that calling any method (even inquiries) on a closed stream is
    undefined. Implementations may raise OSError in this case.

    IOBase (and its subclasses) support the iterator protocol, meaning
    that an IOBase object can be iterated over yielding the lines in a
    stream.

    IOBase also supports the :keyword:`with` statement. In this example,
    fp is closed after the suite of the with statement is complete:

    with open('spam.txt', 'r') as fp:
        fp.write('Spam and eggs!')
    cCstd|jj|f��dS)z@Internal: raise an OSError exception for unsupported operations.z%s.%s() not supportedN)rV�	__class__rM)rI�namerArArB�_unsupported\s
�zIOBase._unsupportedrcCs|�d�dS)a$Change stream position.

        Change the stream position to byte offset pos. Argument pos is
        interpreted relative to the position indicated by whence.  Values
        for whence are ints:

        * 0 -- start of stream (the default); offset should be zero or positive
        * 1 -- current stream position; offset may be negative
        * 2 -- end of stream; offset is usually negative
        Some operating systems / file systems could provide additional values.

        Return an int indicating the new absolute position.
        �seekN�rZ�rI�pos�whencerArArBr[cszIOBase.seekcCs|�dd�S)z5Return an int indicating the current stream position.rr
)r[�rIrArArB�tellsszIOBase.tellNcCs|�d�dS)z�Truncate file to size bytes.

        Size defaults to the current IO position as reported by tell().  Return
        the new size.
        �truncateNr\�rIr^rArArBrbwszIOBase.truncatecCs|��dS)zuFlush write buffers, if applicable.

        This is not implemented for read-only and non-blocking streams.
        N��_checkClosedr`rArArB�flush�szIOBase.flushFcCs |jsz|��W5d|_XdS)ziFlush and close the IO object.

        This method has no effect if the file is already closed.
        TN)�_IOBase__closedrfr`rArArBr5�szIOBase.closecCsVz
|j}Wntk
r YdSX|r*dStr8|��nz|��WnYnXdS)zDestructor.  Calls close().N)�closedr/�_IOBASE_EMITS_UNRAISABLEr5)rIrhrArArB�__del__�s

zIOBase.__del__cCsdS)z�Return a bool indicating whether object supports random access.

        If False, seek(), tell() and truncate() will raise OSError.
        This method may need to do a test seek().
        FrAr`rArArB�seekable�szIOBase.seekablecCs |��st|dkrdn|��dS)zEInternal: raise UnsupportedOperation if file is not seekable
        NzFile or stream is not seekable.)rkrV�rI�msgrArArB�_checkSeekable�s��zIOBase._checkSeekablecCsdS)zvReturn a bool indicating whether object was opened for reading.

        If False, read() will raise OSError.
        FrAr`rArArB�readable�szIOBase.readablecCs |��st|dkrdn|��dS)zEInternal: raise UnsupportedOperation if file is not readable
        NzFile or stream is not readable.)rorVrlrArArB�_checkReadable�s��zIOBase._checkReadablecCsdS)z�Return a bool indicating whether object was opened for writing.

        If False, write() and truncate() will raise OSError.
        FrAr`rArArB�writable�szIOBase.writablecCs |��st|dkrdn|��dS)zEInternal: raise UnsupportedOperation if file is not writable
        NzFile or stream is not writable.)rqrVrlrArArB�_checkWritable�s��zIOBase._checkWritablecCs|jS)z�closed: bool.  True iff the file has been closed.

        For backwards compatibility, this is a property, not a predicate.
        )rgr`rArArBrh�sz
IOBase.closedcCs|jrt|dkrdn|��dS)z7Internal: raise a ValueError if file is closed
        N�I/O operation on closed file.�rhr#rlrArArBre�s��zIOBase._checkClosedcCs|��|S)zCContext management protocol.  Returns self (an instance of IOBase).rdr`rArArB�	__enter__�szIOBase.__enter__cGs|��dS)z+Context management protocol.  Calls close()N)r5)rIrSrArArB�__exit__�szIOBase.__exit__cCs|�d�dS)z�Returns underlying file descriptor (an int) if one exists.

        An OSError is raised if the IO object does not use a file descriptor.
        r,Nr\r`rArArBr,�sz
IOBase.filenocCs|��dS)z{Return a bool indicating whether this is an 'interactive' stream.

        Return False if it can't be determined.
        Frdr`rArArBr)sz
IOBase.isattyrcs�t�d�r��fdd�}ndd�}�dkr0d�n4z
�j}Wn"tk
r\t��d���YnX|��t�}�dks~t|��kr���|��}|s�q�||7}|�d	�rjq�qjt|�S)
aNRead and return a line of bytes from the stream.

        If size is specified, at most size bytes will be read.
        Size should be an int.

        The line terminator is always b'\n' for binary files; for text
        files, the newlines argument to open can be used to select the line
        terminator(s) recognized.
        �peekcs>��d�}|sdS|�d�dp&t|�}�dkr:t|��}|S)Nr
�
r)rw�findr"�min)Z	readahead�n�rI�sizerArB�
nreadaheads

z#IOBase.readline.<locals>.nreadaheadcSsdS�Nr
rArArArArBr~ sNr� is not an integerrrx)	�hasattr�	__index__r/r �	bytearrayr"�read�endswithr)rIr}r~�
size_index�resrrAr|rB�readlines&
	

zIOBase.readlinecCs|��|SrQrdr`rArArB�__iter__5szIOBase.__iter__cCs|��}|st�|SrQ)r��
StopIteration�rI�linerArArB�__next__9szIOBase.__next__cCsP|dks|dkrt|�Sd}g}|D]&}|�|�|t|�7}||kr$qLq$|S)z�Return a list of lines from the stream.

        hint can be specified to control the number of lines read: no more
        lines will be read if the total size (in bytes/characters) of all
        lines so far exceeds hint.
        Nr)�list�appendr")rIZhintr{�linesr�rArArB�	readlines?s
zIOBase.readlinescCs |��|D]}|�|�qdS)z�Write a list of lines to the stream.

        Line separators are not added, so it is usual for each of the lines
        provided to have a line separator at the end.
        N)re�write)rIr�r�rArArB�
writelinesQszIOBase.writelines)r)N)N)N)N)N)r)N)rMrNrOrHrZr[rarbrfrgr5rjrkrnrorprqrr�propertyrhrerurvr,r)r�r�r�r�r�rArArArBrW9s6!







	

*
rW)�	metaclassc@s2eZdZdZddd�Zdd�Zdd�Zd	d
�ZdS)
�	RawIOBasezBase class for raw binary I/O.rcCsP|dkrd}|dkr|��St|���}|�|�}|dkr>dS||d�=t|�S)z�Read and return up to size bytes, where size is an int.

        Returns an empty bytes object on EOF, or None if the object is
        set not to block and has no data to read.
        Nrr)�readallr�r��readintor)rIr}rr{rArArBr�ls

zRawIOBase.readcCs4t�}|�t�}|sq ||7}q|r,t|�S|SdS)z+Read until EOF, using multiple read() call.N)r�r�r*r)rIr��datarArArBr�}s

zRawIOBase.readallcCs|�d�dS)z�Read bytes into a pre-allocated bytes-like object b.

        Returns an int representing the number of bytes read (0 for EOF), or
        None if the object is set not to block and has no data to read.
        r�Nr\�rIrrArArBr��szRawIOBase.readintocCs|�d�dS)z�Write the given buffer to the IO stream.

        Returns the number of bytes written, which may be less than the
        length of b in bytes.
        r�Nr\r�rArArBr��szRawIOBase.writeN)r)rMrNrOrHr�r�r�r�rArArArBr�^s

r�)r(c@sLeZdZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�BufferedIOBaseaBase class for buffered IO objects.

    The main difference with RawIOBase is that the read() method
    supports omitting the size argument, and does not have a default
    implementation that defers to readinto().

    In addition, read(), readinto() and write() may raise
    BlockingIOError if the underlying raw stream is in non-blocking
    mode and not ready; unlike their raw counterparts, they will never
    return None.

    A typical implementation should not inherit from a RawIOBase
    implementation, but wrap one.
    rcCs|�d�dS)a�Read and return up to size bytes, where size is an int.

        If the argument is omitted, None, or negative, reads and
        returns all data until EOF.

        If the argument is positive, and the underlying raw stream is
        not 'interactive', multiple raw reads may be issued to satisfy
        the byte count (unless EOF is reached first).  But for
        interactive raw streams (XXX and for pipes?), at most one raw
        read will be issued, and a short result does not imply that
        EOF is imminent.

        Returns an empty bytes array on EOF.

        Raises BlockingIOError if the underlying raw stream has no
        data at the moment.
        r�Nr\r|rArArBr��szBufferedIOBase.readcCs|�d�dS)zaRead up to size bytes with at most one read() system call,
        where size is an int.
        �read1Nr\r|rArArBr��szBufferedIOBase.read1cCs|j|dd�S)afRead bytes into a pre-allocated bytes-like object b.

        Like read(), this may issue multiple reads to the underlying raw
        stream, unless the latter is 'interactive'.

        Returns an int representing the number of bytes read (0 for EOF).

        Raises BlockingIOError if the underlying raw stream has no
        data at the moment.
        F�r���	_readintor�rArArBr��szBufferedIOBase.readintocCs|j|dd�S)z�Read bytes into buffer *b*, using at most one system call

        Returns an int representing the number of bytes read (0 for EOF).

        Raises BlockingIOError if the underlying raw stream has no
        data at the moment.
        Tr�r�r�rArArB�	readinto1�s	zBufferedIOBase.readinto1cCsVt|t�st|�}|�d�}|r0|�t|��}n|�t|��}t|�}||d|�<|S)N�B)r�
memoryview�castr�r"r�)rIrr�r�r{rArArBr��s

zBufferedIOBase._readintocCs|�d�dS)aWrite the given bytes buffer to the IO stream.

        Return the number of bytes written, which is always the length of b
        in bytes.

        Raises BlockingIOError if the buffer is full and the
        underlying raw stream cannot accept more data at the moment.
        r�Nr\r�rArArBr��s	zBufferedIOBase.writecCs|�d�dS)z�
        Separate the underlying raw stream from the buffer and return it.

        After the raw stream has been detached, the buffer is in an unusable
        state.
        �detachNr\r`rArArBr��szBufferedIOBase.detachN)r)r)rMrNrOrHr�r�r�r�r�r�r�rArArArBr��s

r�c@s�eZdZdZdd�Zd$dd�Zdd�Zd%d
d�Zdd
�Zdd�Z	dd�Z
dd�Zedd��Z
edd��Zedd��Zedd��Zdd�Zdd�Zd d!�Zd"d#�Zd	S)&�_BufferedIOMixinz�A mixin implementation of BufferedIOBase with an underlying raw stream.

    This passes most requests on to the underlying raw stream.  It
    does *not* provide implementations of read(), readinto() or
    write().
    cCs
||_dSrQ��_raw�rIr=rArArB�__init__sz_BufferedIOMixin.__init__rcCs"|j�||�}|dkrtd��|S)Nrz#seek() returned an invalid position)r=r[r.)rIr^r_Znew_positionrArArBr[sz_BufferedIOMixin.seekcCs|j��}|dkrtd��|S)Nrz#tell() returned an invalid position)r=rar.rcrArArBras
z_BufferedIOMixin.tellNcCs$|��|dkr|��}|j�|�SrQ)rfrar=rbrcrArArBrb$sz_BufferedIOMixin.truncatecCs|jrtd��|j��dS)N�flush on closed file)rhr#r=rfr`rArArBrf2sz_BufferedIOMixin.flushcCs.|jdk	r*|js*z|��W5|j��XdSrQ)r=rhr5rfr`rArArBr57sz_BufferedIOMixin.closecCs*|jdkrtd��|��|j}d|_|S)Nzraw stream already detached)r=r#rfr�r�rArArBr�?s
z_BufferedIOMixin.detachcCs
|j��SrQ)r=rkr`rArArBrkIsz_BufferedIOMixin.seekablecCs|jSrQr�r`rArArBr=Lsz_BufferedIOMixin.rawcCs|jjSrQ)r=rhr`rArArBrhPsz_BufferedIOMixin.closedcCs|jjSrQ)r=rYr`rArArBrYTsz_BufferedIOMixin.namecCs|jjSrQ)r=r4r`rArArBr4Xsz_BufferedIOMixin.modecCstd|jj�d���dS�Nzcannot pickle z object�r rXrMr`rArArB�__getstate__\sz_BufferedIOMixin.__getstate__cCsN|jj}|jj}z
|j}Wn tk
r:d�||�YSXd�|||�SdS)Nz<{}.{}>z<{}.{} name={!r}>)rXrNrOrYr/�format)rI�modnameZclsnamerYrArArB�__repr___s
z_BufferedIOMixin.__repr__cCs
|j��SrQ)r=r,r`rArArBr,ksz_BufferedIOMixin.filenocCs
|j��SrQ)r=r)r`rArArBr)nsz_BufferedIOMixin.isatty)r)N)rMrNrOrHr�r[rarbrfr5r�rkr�r=rhrYr4r�r�r,r)rArArArBr�
s*






r�cs�eZdZdZdZd!dd�Zdd�Zdd�Zd	d
�Z�fdd�Z	d"dd�Z
d#dd�Zdd�Zd$dd�Z
dd�Zd%dd�Zdd�Zdd�Zdd �Z�ZS)&�BytesIOz<Buffered I/O implementation using an in-memory bytes buffer.NcCs&t�}|dk	r||7}||_d|_dS�Nr)r��_buffer�_pos)rIZ
initial_bytes�bufrArArBr�zs
zBytesIO.__init__cCs|jrtd��|j��S)Nz__getstate__ on closed file)rhr#�__dict__�copyr`rArArBr��szBytesIO.__getstate__cCs|jrtd��t|j�S)z8Return the bytes value (contents) of the buffer
        zgetvalue on closed file)rhr#rr�r`rArArB�getvalue�szBytesIO.getvaluecCs|jrtd��t|j�S)z;Return a readable and writable view of the buffer.
        zgetbuffer on closed file)rhr#r�r�r`rArArB�	getbuffer�szBytesIO.getbuffercs"|jdk	r|j��t���dSrQ)r��clear�superr5r`�rXrArBr5�s

z
BytesIO.closercCs�|jrtd��|dkrd}n4z
|j}Wn"tk
rHt|�d���YnX|�}|dkrbt|j�}t|j�|jkrvdStt|j�|j|�}|j|j|�}||_t	|�S)N�read from closed filerr�r�)
rhr#r�r/r r"r�r�rzr)rIr}r�ZnewposrrArArBr��s"

zBytesIO.readcCs
|�|�S)z"This is the same as read.
        )r�r|rArArBr��sz
BytesIO.read1c	Cs�|jrtd��t|t�r td��t|��}|j}W5QRX|dkrFdS|j}|t|j	�krzd|t|j	�}|j	|7_	||j	|||�<|j|7_|S)N�write to closed file� can't write str to binary streamr�)
rhr#rrr r��nbytesr�r"r�)rIrZviewr{r^ZpaddingrArArBr��s

z
BytesIO.writercCs�|jrtd��z
|j}Wn"tk
r:t|�d���YnX|�}|dkrh|dkr`td|f��||_nD|dkr�td|j|�|_n(|dkr�tdt|j�|�|_ntd��|jS)Nzseek on closed filer�r�negative seek position %rr
rzunsupported whence value)	rhr#r�r/r r��maxr"r�)rIr^r_�	pos_indexrArArBr[�s"
zBytesIO.seekcCs|jrtd��|jS)N�tell on closed file)rhr#r�r`rArArBra�szBytesIO.tellcCsx|jrtd��|dkr|j}nJz
|j}Wn"tk
rJt|�d���YnX|�}|dkrhtd|f��|j|d�=|S)Nztruncate on closed filer�rznegative truncate position %r)rhr#r�r�r/r r�)rIr^r�rArArBrb�s
zBytesIO.truncatecCs|jrtd��dS�NrsTrtr`rArArBro�szBytesIO.readablecCs|jrtd��dSr�rtr`rArArBrq�szBytesIO.writablecCs|jrtd��dSr�rtr`rArArBrk�szBytesIO.seekable)N)r)r)r)N)rMrNrOrHr�r�r�r�r�r5r�r�r�r[rarbrorqrk�
__classcell__rArAr�rBr�rs 




r�c@sxeZdZdZefdd�Zdd�Zdd�Zdd	d
�Zddd�Z	ddd�Z
ddd�Zddd�Zdd�Z
dd�Zd dd�ZdS)!r2aBufferedReader(raw[, buffer_size])

    A buffer for a readable, sequential BaseRawIO object.

    The constructor creates a BufferedReader for the given readable raw
    stream and buffer_size. If buffer_size is omitted, DEFAULT_BUFFER_SIZE
    is used.
    cCsF|��std��t�||�|dkr,td��||_|��t�|_dS)zMCreate a new buffered reader using the given readable raw IO object.
        z "raw" argument must be readable.r�invalid buffer sizeN)	ror.r�r�r#�buffer_size�_reset_read_buf�Lock�
_read_lock�rIr=r�rArArBr�szBufferedReader.__init__cCs
|j��SrQ)r=ror`rArArBroszBufferedReader.readablecCsd|_d|_dS)Nr�r)�	_read_buf�	_read_posr`rArArBr�szBufferedReader._reset_read_bufNc
Cs@|dk	r|dkrtd��|j�|�|�W5QR�SQRXdS)z�Read size bytes.

        Returns exactly size bytes of data unless the underlying raw IO
        stream reaches EOF or if the call would block in non-blocking
        mode. If size is negative, read until EOF or until read() would
        block.
        Nrzinvalid number of bytes to read)r#r��_read_unlockedr|rArArBr� szBufferedReader.readcCs�d}d}|j}|j}|dks$|dkr�|��t|jd�rj|j��}|dkrZ||d�pXdS||d�|S||d�g}d}|j��}||kr�|}q�|t|�7}|�|�q|d�	|�p�|St|�|}	||	kr�|j|7_||||�S||d�g}t
|j|�}
|	|k�rH|j�|
�}||k�r.|}�qH|	t|�7}	|�|��qt||	�}d�	|�}||d�|_d|_|�r�|d|�S|S)Nr�)r�Nrr�r)
r�r�r�r�r=r�r�r"r��joinr�r�rz)rIr{Z
nodata_valZempty_valuesr�r^�chunkZchunksZcurrent_size�availZwanted�outrArArBr�-sL





zBufferedReader._read_unlockedrc
Cs(|j�|�|�W5QR�SQRXdS)z�Returns buffered bytes without advancing the position.

        The argument indicates a desired minimal number of bytes; we
        do at most one raw read to satisfy it.  We never return more
        than self.buffer_size.
        N)r��_peek_unlockedr|rArArBrwaszBufferedReader.peekcCsrt||j�}t|j�|j}||ks,|dkrb|j|}|j�|�}|rb|j|jd�||_d|_|j|jd�Sr�)rzr�r"r�r�r=r�)rIr{ZwantZhaveZto_readZcurrentrArArBr�ks
zBufferedReader._peek_unlockedrc
Cs^|dkr|j}|dkrdS|j�4|�d�|�t|t|j�|j��W5QR�SQRXdS)z<Reads up to size bytes, with at most one read() system call.rr�r
N)r�r�r�r�rzr"r�r�r|rArArBr�vs
�zBufferedReader.read1c	Cs
t|t�st|�}|jdkr dS|�d�}d}|j��|t|�kr�tt|j�|jt|��}|r�|j|j|j|�||||�<|j|7_||7}|t|�kr�q�t|�||j	kr�|j
�||d��}|s�q�||7}n|r�|s�|�d�s�q�|r6|r6q�q6W5QRX|S)z2Read data into *buf* with at most one system call.rr�Nr
)
rr�r�r�r�r"rzr�r�r�r=r�r�)rIr�r��writtenr�r{rArArBr��s6


�

zBufferedReader._readintocCst�|�t|j�|jSrQ)r�rar"r�r�r`rArArBra�szBufferedReader.tellc
Csd|tkrtd��|j�D|dkr4|t|j�|j8}t�|||�}|��|W5QR�SQRXdS)N�invalid whence valuer
)	�valid_seek_flagsr#r�r"r�r�r�r[r�r]rArArBr[�szBufferedReader.seek)N)N)r)r)r)r)rMrNrOrHr*r�ror�r�r�rwr�r�r�rar[rArArArBr2s	


4



.r2c@s`eZdZdZefdd�Zdd�Zdd�Zdd	d
�Zdd�Z	d
d�Z
dd�Zddd�Zdd�Z
dS)r1z�A buffer for a writeable sequential RawIO object.

    The constructor creates a BufferedWriter for the given writeable raw
    stream. If the buffer_size is not given, it defaults to
    DEFAULT_BUFFER_SIZE.
    cCsF|��std��t�||�|dkr,td��||_t�|_t�|_	dS)Nz "raw" argument must be writable.rr�)
rqr.r�r�r#r�r��
_write_bufr��_write_lockr�rArArBr��szBufferedWriter.__init__cCs
|j��SrQ)r=rqr`rArArBrq�szBufferedWriter.writablecCst|t�rtd��|j��|jr(td��t|j�|jkr@|�	�t|j�}|j�
|�t|j�|}t|j�|jkr�z|�	�Wnltk
r�}zNt|j�|jkr�t|j�|j}||8}|jd|j�|_t|j|j
|��W5d}~XYnX|W5QR�SQRXdS)Nr�r�)rrr r�rhr#r"r�r��_flush_unlocked�extend�BlockingIOError�errno�strerror)rIrZbeforer��eZoveragerArArBr��s(

"zBufferedWriter.writeNc
CsD|j�4|��|dkr"|j��}|j�|�W5QR�SQRXdSrQ)r�r�r=rarbrcrArArBrb�s

zBufferedWriter.truncatec	Cs|j�|��W5QRXdSrQ)r�r�r`rArArBrf�szBufferedWriter.flushcCs�|jrtd��|jr�z|j�|j�}Wntk
rBtd��YnX|dkrZttjdd��|t	|j�ksp|dkrxt
d��|jd|�=qdS)Nr�zHself.raw should implement RawIOBase: it should not raise BlockingIOErrorz)write could not complete without blockingrz*write() returned incorrect number of bytes)rhr#r�r=r�r��RuntimeErrorr�ZEAGAINr"r.�rIr{rArArBr�s �zBufferedWriter._flush_unlockedcCst�|�t|j�SrQ)r�rar"r�r`rArArBraszBufferedWriter.tellrc
CsD|tkrtd��|j�$|��t�|||�W5QR�SQRXdS)Nr�)r�r#r�r�r�r[r]rArArBr[s
zBufferedWriter.seekcCs`|j�$|jdks|jr&W5QR�dSW5QRXz|��W5|j�|j��W5QRXXdSrQ)r�r=rhr5rfr`rArArBr5szBufferedWriter.close)N)r)rMrNrOrHr*r�rqr�rbrfr�rar[r5rArArArBr1�s

r1c@s�eZdZdZefdd�Zddd�Zdd�Zd	d
�Zd dd
�Z	d!dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zedd��ZdS)"�BufferedRWPaira�A buffered reader and writer object together.

    A buffered reader object and buffered writer object put together to
    form a sequential IO object that can read and write. This is typically
    used with a socket or two-way pipe.

    reader and writer are RawIOBase objects that are readable and
    writeable respectively. If the buffer_size is omitted it defaults to
    DEFAULT_BUFFER_SIZE.
    cCs<|��std��|��s td��t||�|_t||�|_dS)zEConstructor.

        The arguments are two RawIO instances.
        z#"reader" argument must be readable.z#"writer" argument must be writable.N)ror.rqr2�readerr1�writer)rIr�r�r�rArArBr�<szBufferedRWPair.__init__rcCs|dkrd}|j�|�S�Nr)r�r�r|rArArBr�JszBufferedRWPair.readcCs|j�|�SrQ)r�r�r�rArArBr�OszBufferedRWPair.readintocCs|j�|�SrQ)r�r�r�rArArBr�RszBufferedRWPair.writercCs|j�|�SrQ)r�rwr|rArArBrwUszBufferedRWPair.peekcCs|j�|�SrQ)r�r�r|rArArBr�XszBufferedRWPair.read1cCs|j�|�SrQ)r�r�r�rArArBr�[szBufferedRWPair.readinto1cCs
|j��SrQ)r�ror`rArArBro^szBufferedRWPair.readablecCs
|j��SrQ)r�rqr`rArArBrqaszBufferedRWPair.writablecCs
|j��SrQ)r�rfr`rArArBrfdszBufferedRWPair.flushcCs z|j��W5|j��XdSrQ)r�r5r�r`rArArBr5gszBufferedRWPair.closecCs|j��p|j��SrQ)r�r)r�r`rArArBr)mszBufferedRWPair.isattycCs|jjSrQ)r�rhr`rArArBrhpszBufferedRWPair.closedN)r)r)r)rMrNrOrHr*r�r�r�r�rwr�r�rorqrfr5r)r�rhrArArArBr�,s


r�c@sneZdZdZefdd�Zddd�Zdd�Zdd
d�Zddd
�Z	dd�Z
ddd�Zddd�Zdd�Z
dd�Zd	S)r0z�A buffered interface to random access streams.

    The constructor creates a reader and writer for a seekable stream,
    raw, given in the first argument. If the buffer_size is omitted it
    defaults to DEFAULT_BUFFER_SIZE.
    cCs(|��t�|||�t�|||�dSrQ)rnr2r�r1r�rArArBr�~szBufferedRandom.__init__rc	Cs�|tkrtd��|��|jrJ|j� |j�|jt|j�d�W5QRX|j�||�}|j�|�	�W5QRX|dkr�t
d��|S)Nr�r
rz seek() returned invalid position)r�r#rfr�r�r=r[r�r"r�r.r]rArArBr[�s$zBufferedRandom.seekcCs|jrt�|�St�|�SdSrQ)r�r1rar2r`rArArBra�s
zBufferedRandom.tellNcCs|dkr|��}t�||�SrQ)rar1rbrcrArArBrb�szBufferedRandom.truncatecCs |dkrd}|��t�||�Sr�)rfr2r�r|rArArBr��szBufferedRandom.readcCs|��t�||�SrQ)rfr2r�r�rArArBr��szBufferedRandom.readintocCs|��t�||�SrQ)rfr2rwr|rArArBrw�szBufferedRandom.peekrcCs|��t�||�SrQ)rfr2r�r|rArArBr��szBufferedRandom.read1cCs|��t�||�SrQ)rfr2r�r�rArArBr��szBufferedRandom.readinto1c	CsF|jr:|j�(|j�|jt|j�d�|��W5QRXt�||�Sr)	r�r�r=r[r�r"r�r1r�r�rArArBr��s
zBufferedRandom.write)r)N)N)r)r)rMrNrOrHr*r�r[rarbr�r�rwr�r�r�rArArArBr0us




r0cs�eZdZdZdZdZdZdZdZdZ	d0dd�Z
dd	�Zd
d�Zdd
�Z
dd�Zd1dd�Zd2dd�Zdd�Zdd�Zdd�Zefdd�Zdd�Zd3dd�Z�fd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zed,d-��Zed.d/��Z �Z!S)4r(rFNTr
c
CsB|jdkr*z|jrt�|j�W5d|_Xt|t�r<td��t|t�r\|}|dkr`td��nd}t|t	�sxtd|f��t
|�t
d�ks�td|f��tdd�|D��d	ks�|�d
�d	kr�td��d|kr�d
|_
d
|_tjtjB}nTd|kr�d
|_d}n@d|k�rd
|_tjtjB}n"d|k�r8d
|_d
|_tjtjB}d
|k�rNd
|_d
|_|j�rj|j�rj|tjO}n|j�r~|tjO}n
|tjO}|ttdd�O}ttdd��p�ttdd�}||O}d}�zT|dk�r:|�s�td��|dk�r�t�||d�}n0|||�}t|t��std��|dk�r$td��|}|�s:t�|d�||_t�|�}	z(t�|	j��rpt t!j"t�#t!j"�|��Wnt$k
�r�YnXt|	dd�|_%|j%d	k�r�t&|_%t'�r�t'|tj(�||_)|j�rzt�*|dt+�Wn4tk
�r}
z|
j!t!j,k�r�W5d}
~
XYnXWn"|dk	�r0t�|��YnX||_dS)adOpen a file.  The mode can be 'r' (default), 'w', 'x' or 'a' for reading,
        writing, exclusive creation or appending.  The file will be created if it
        doesn't exist when opened for writing or appending; it will be truncated
        when opened for writing.  A FileExistsError will be raised if it already
        exists when opened for creating. Opening a file for creating implies
        writing so this mode behaves in a similar way to 'w'. Add a '+' to the mode
        to allow simultaneous reading and writing. A custom opener can be used by
        passing a callable as *opener*. The underlying file descriptor for the file
        object is then obtained by calling opener with (*name*, *flags*).
        *opener* must return an open file descriptor (passing os.open as *opener*
        results in functionality similar to passing None).
        rrz$integer argument expected, got floatznegative file descriptorzinvalid mode: %szxrwab+css|]}|dkVqdS)ZrwaxNrA)�.0�crArArB�	<genexpr>�sz"FileIO.__init__.<locals>.<genexpr>r
rzKMust have exactly one of create/read/write/append mode and at most one plusrTr
rr�O_BINARYZO_NOINHERIT�	O_CLOEXECNz'Cannot use closefd=False with file namei�zexpected integer from openerzNegative file descriptorFr-)-�_fd�_closefdrr5r�floatr rr#rr!�sum�count�_created�	_writable�O_EXCL�O_CREAT�	_readable�O_TRUNC�
_appending�O_APPEND�O_RDWR�O_RDONLY�O_WRONLY�getattrrCr.�set_inheritabler+�stat�S_ISDIR�st_mode�IsADirectoryErrorr�ZEISDIRr�r/�_blksizer*�_setmoder�rY�lseekr	ZESPIPE)rIr6r4r;r�fd�flagsZnoinherit_flagZowned_fdZfdfstatr�rArArBr��s�




$




�





�

zFileIO.__init__cCsB|jdkr>|jr>|js>ddl}|jd|ftd|d�|��dS)Nrzunclosed file %rr)�
stacklevel�source)r�r�rhr$r%�ResourceWarningr5)rIr$rArArBrjAs�zFileIO.__del__cCstd|jj�d���dSr�r�r`rArArBr�HszFileIO.__getstate__cCspd|jj|jjf}|jr"d|Sz
|j}Wn*tk
rVd||j|j|jfYSXd|||j|jfSdS)Nz%s.%sz
<%s [closed]>z<%s fd=%d mode=%r closefd=%r>z<%s name=%r mode=%r closefd=%r>)	rXrNrOrhrYr/r�r4r�)rI�
class_namerYrArArBr�Ks�
�
�zFileIO.__repr__cCs|jstd��dS)NzFile not open for reading)r�rVr`rArArBrpYszFileIO._checkReadablecCs|jstd��dS)NzFile not open for writing)r�rVrlrArArBrr]szFileIO._checkWritablecCsT|��|��|dks |dkr(|��Szt�|j|�WStk
rNYdSXdS)z�Read at most size bytes, returned as bytes.

        Only makes one system call, so less data may be returned than requested
        In non-blocking mode, returns None if no data is available.
        Return an empty bytes object at EOF.
        Nr)rerpr�rr�r�r�r|rArArBr�aszFileIO.readcCs�|��|��t}z6t�|jdt�}t�|j�j}||krH||d}Wnt	k
r^YnXt
�}t|�|kr�t|�}|t|t�7}|t|�}zt�
|j|�}Wntk
r�|r�Yq�YdSX|s�q�||7}qft|�S)z�Read all data from the file, returned as bytes.

        In non-blocking mode, returns as much as is immediately available,
        or None if no data is available.  Return an empty bytes object at EOF.
        rr
N)rerpr*rrr�rr+�st_sizer.r�r"r�r�r�r)rI�bufsizer^�endr>r{r�rArArBr�qs2
zFileIO.readallcCs4t|��d�}|�t|��}t|�}||d|�<|S)zSame as RawIOBase.readinto().r�N)r�r�r�r")rIr�mr�r{rArArBr��s
zFileIO.readintocCs<|��|��zt�|j|�WStk
r6YdSXdS)aWrite bytes b to file, return number written.

        Only makes one system call, so not all of the data may be written.
        The number of bytes actually written is returned.  In non-blocking mode,
        returns None if the write would block.
        N)rerrrr�r�r�r�rArArBr��szFileIO.writecCs*t|t�rtd��|��t�|j||�S)a�Move to new file position.

        Argument offset is a byte count.  Optional argument whence defaults to
        SEEK_SET or 0 (offset from start of file, offset should be >= 0); other values
        are SEEK_CUR or 1 (move relative to current position, positive or negative),
        and SEEK_END or 2 (move relative to end of file, usually negative, although
        many platforms allow seeking beyond the end of a file).

        Note that not all file objects are seekable.
        zan integer is required)rr�r rerrr�r]rArArBr[�s
zFileIO.seekcCs|��t�|jdt�S)zYtell() -> int.  Current file position.

        Can raise OSError for non seekable files.r)rerrr�rr`rArArBra�szFileIO.tellcCs2|��|��|dkr |��}t�|j|�|S)z�Truncate the file to at most size bytes.

        Size defaults to the current file position, as returned by tell().
        The current file position is changed to the value of size.
        N)rerrrar�	ftruncater�r|rArArBrb�szFileIO.truncatecs.|js*z|jrt�|j�W5t���XdS)z�Close the file.

        A closed file cannot be used for further I/O operations.  close() may be
        called more than once without error.
        N)rhr�r5r�rr�r`r�rArBr5�s
zFileIO.closecCsF|��|jdkr@z|��Wntk
r8d|_YnXd|_|jS)z$True if file supports random-access.NFT)re�	_seekablerar.r`rArArBrk�s
zFileIO.seekablecCs|��|jS)z'True if file was opened in a read mode.)rer�r`rArArBro�szFileIO.readablecCs|��|jS)z(True if file was opened in a write mode.)rer�r`rArArBrq�szFileIO.writablecCs|��|jS)z3Return the underlying file descriptor (an integer).)rer�r`rArArBr,�sz
FileIO.filenocCs|��t�|j�S)z.True if the file is connected to a TTY device.)rerr)r�r`rArArBr)�sz
FileIO.isattycCs|jS)z6True if the file descriptor will be closed by close().)r�r`rArArBr;�szFileIO.closefdcCsJ|jr|jrdSdSn0|jr,|jr&dSdSn|jrB|jr<dSdSndSdS)	zString giving the file modezxb+Zxbzab+Zabzrb+rD�wbN)r�r�r�r�r`rArArBr4szFileIO.mode)r
TN)N)N)N)"rMrNrOr�r�r�r�r�rr�r�rjr�r�rprrr�r�r�r�rr[rarbr5rkrorqr,r)r�r;r4r�rArAr�rBr(�s<
y

#



r(c@s`eZdZdZddd�Zdd�Zddd	�Zd
d�Zdd
�Ze	dd��Z
e	dd��Ze	dd��ZdS)�
TextIOBasez�Base class for text I/O.

    This class provides a character and line based interface to stream
    I/O. There is no public constructor.
    rcCs|�d�dS)z�Read at most size characters from stream, where size is an int.

        Read from underlying buffer until we have size characters or we hit EOF.
        If size is negative or omitted, read until EOF.

        Returns a string.
        r�Nr\r|rArArBr�szTextIOBase.readcCs|�d�dS)z.Write string s to stream and returning an int.r�Nr\)rI�srArArBr�(szTextIOBase.writeNcCs|�d�dS)z*Truncate size to pos, where pos is an int.rbNr\rcrArArBrb,szTextIOBase.truncatecCs|�d�dS)z_Read until newline or EOF.

        Returns an empty string if EOF is hit immediately.
        r�Nr\r`rArArBr�0szTextIOBase.readlinecCs|�d�dS)z�
        Separate the underlying buffer from the TextIOBase and return it.

        After the underlying buffer has been detached, the TextIO is in an
        unusable state.
        r�Nr\r`rArArBr�7szTextIOBase.detachcCsdS)zSubclasses should override.NrAr`rArArBr8@szTextIOBase.encodingcCsdS)z�Line endings translated so far.

        Only line endings translated during reading are considered.

        Subclasses should override.
        NrAr`rArArB�newlinesEszTextIOBase.newlinescCsdS)zMError setting of the decoder or encoder.

        Subclasses should override.NrAr`rArArBr9OszTextIOBase.errors)r)N)
rMrNrOrHr�r�rbr�r�r�r8rr9rArArArBrs


	

	rc@sTeZdZdZddd�Zddd�Zdd	�Zd
d�Zdd
�ZdZ	dZ
dZedd��Z
dS)�IncrementalNewlineDecodera+Codec used when reading a file in universal newlines mode.  It wraps
    another incremental decoder, translating \r\n and \r into \n.  It also
    records the types of newlines encountered.  When used with
    translate=False, it ensures that the newline sequence is returned in
    one piece.
    �strictcCs,tjj||d�||_||_d|_d|_dS)N)r9rF)�codecs�IncrementalDecoderr��	translate�decoder�seennl�	pendingcr)rIrrr9rArArBr�`s
z"IncrementalNewlineDecoder.__init__FcCs�|jdkr|}n|jj||d�}|jr<|s.|r<d|}d|_|�d�r\|s\|dd�}d|_|�d�}|�d�|}|�d�|}|j|o�|j|o�|jB|o�|jBO_|j	r�|r�|�
dd�}|r�|�
dd�}|S)N��final�
FrT�
�
)r�decoderr�r�r�_LF�_CR�_CRLFr�replace)rI�inputr�outputZcrlfZcrZlfrArArBr#gs*

�z IncrementalNewlineDecoder.decodecCs@|jdkrd}d}n|j��\}}|dK}|jr8|dO}||fS)Nr�rr
)r�getstater)rIr��flagrArArBr*�s
z"IncrementalNewlineDecoder.getstatecCs8|\}}t|d@�|_|jdk	r4|j�||d?f�dSr)�boolrr�setstate)rI�stater�r+rArArBr-�s
z"IncrementalNewlineDecoder.setstatecCs$d|_d|_|jdk	r |j��dS)NrF)rrr�resetr`rArArBr/�s
zIncrementalNewlineDecoder.resetr
r�cCs
d|jS)N)Nr"r )r r"r!)r"r!)r r!)r r"r!)rr`rArArBr�s�z"IncrementalNewlineDecoder.newlinesN)r)F)rMrNrOrHr�r#r*r-r/r$r%r&r�rrArArArBrYs

rc@sveZdZdZdZdZdOdd�Zdd�ZdPd	d
�Zdd�Z	e
d
d��Ze
dd��Ze
dd��Z
e
dd��Ze
dd��Zddeddd�dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Ze
d$d%��Ze
d&d'��Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�ZdQd4d5�Zd6d7�Z d8d9�Z!dRd;d<�Z"d=d>�Z#d?d@�Z$dSdAdB�Z%dCdD�Z&dTdEdF�Z'dUdGdH�Z(dIdJ�Z)dVdKdL�Z*e
dMdN��Z+dS)Wr3aCharacter and line based layer over a BufferedIOBase object, buffer.

    encoding gives the name of the encoding that the stream will be
    decoded or encoded with. It defaults to locale.getpreferredencoding(False).

    errors determines the strictness of encoding and decoding (see the
    codecs.register) and defaults to "strict".

    newline can be None, '', '\n', '\r', or '\r\n'.  It controls the
    handling of line endings. If it is None, universal newlines is
    enabled.  With this enabled, on input, the lines endings '\n', '\r',
    or '\r\n' are translated to '\n' before being returned to the
    caller. Conversely, on output, '\n' is translated to the system
    default line separator, os.linesep. If newline is any other of its
    legal values, that newline becomes the newline when the file is read
    and it is returned untranslated. On output, '\n' is converted to the
    newline.

    If line_buffering is True, a call to flush is implied when a call to
    write contains a newline character.
    iNFc		Cs|�|�|dkrvzt�|���}Wnttfk
r<YnX|dkrvzddl}Wntk
rjd}YnX|�d�}t	|t
�s�td|��t�
|�js�d}t||��|dkr�d}nt	|t
�s�td|��||_d|_d|_d|_|j��|_|_t|jd	�|_|�|||||�dS)
Nr�asciiFrzG%r is not a text encoding; use codecs.open() to handle arbitrary codecsrrrr�)�_check_newliner�device_encodingr,r/rV�locale�ImportErrorZgetpreferredencodingrrr#r�lookup�_is_text_encoding�LookupErrorr��_decoded_chars�_decoded_chars_used�	_snapshotr@rkr�_tellingr��
_has_read1�
_configure)	rIr@r8r9r:r?�
write_throughr4rmrArArBr��s>





�zTextIOWrapper.__init__cCs>|dk	r$t|t�s$tdt|�f��|dkr:td|f��dS)Nzillegal newline type: %r)Nrr"r r!zillegal newline value: %r)rrr �typer#)rIr:rArArBr2�szTextIOWrapper._check_newlinecCs�||_||_d|_d|_d|_||_|dk|_||_|dk|_|pHt	j
|_||_||_
|jr�|��r�|j��}|dkr�z|���d�Wntk
r�YnXdS)N�rr)�	_encoding�_errors�_encoder�_decoder�	_b2cratio�_readuniversal�_readtranslate�_readnl�_writetranslater�linesep�_writenl�_line_buffering�_write_throughrrqr@ra�_get_encoderr-r8)rIr8r9r:r?r?�positionrArArBr>�s&


zTextIOWrapper._configurecCs�d�|jj|jj�}z
|j}Wntk
r2YnX|d�|�7}z
|j}Wntk
r`YnX|d�|�7}|d�|j�S)Nz<{}.{}z name={0!r}z mode={0!r}z encoding={0!r}>)r�rXrNrOrYr/r4r8)rIr>rYr4rArArBr�!s
�

zTextIOWrapper.__repr__cCs|jSrQ)rBr`rArArBr82szTextIOWrapper.encodingcCs|jSrQ)rCr`rArArBr96szTextIOWrapper.errorscCs|jSrQ)rMr`rArArBr?:szTextIOWrapper.line_bufferingcCs|jSrQ)rNr`rArArBr?>szTextIOWrapper.write_throughcCs|jSrQ)r�r`rArArBr@BszTextIOWrapper.buffer)r8r9r:r?r?cCs�|jdk	r*|dk	s"|dk	s"|tk	r*td��|dkrH|dkrB|j}q^d}nt|t�s^td|��|dkrn|j}nt|t�s�td|��|tkr�|j}|�	|�|dkr�|j
}|dkr�|j}|��|�
|||||�dS)z`Reconfigure the text stream with new parameters.

        This also flushes the stream.
        NzPIt is not possible to set the encoding or newline of stream after the first readrrr)rE�EllipsisrVrCrrr rBrIr2r?r?rfr>)rIr8r9r:r?r?rArArB�reconfigureFs@
����



�zTextIOWrapper.reconfigurecCs|jrtd��|jS)Nrs)rhr#rr`rArArBrkoszTextIOWrapper.seekablecCs
|j��SrQ)r@ror`rArArBrotszTextIOWrapper.readablecCs
|j��SrQ)r@rqr`rArArBrqwszTextIOWrapper.writablecCs|j��|j|_dSrQ)r@rfrr<r`rArArBrfzs
zTextIOWrapper.flushcCs.|jdk	r*|js*z|��W5|j��XdSrQ)r@rhr5rfr`rArArBr5~szTextIOWrapper.closecCs|jjSrQ)r@rhr`rArArBrh�szTextIOWrapper.closedcCs|jjSrQ)r@rYr`rArArBrY�szTextIOWrapper.namecCs
|j��SrQ)r@r,r`rArArBr,�szTextIOWrapper.filenocCs
|j��SrQ)r@r)r`rArArBr)�szTextIOWrapper.isattycCs�|jrtd��t|t�s(td|jj��t|�}|js<|j	oBd|k}|rf|jrf|j
dkrf|�d|j
�}|jpr|�
�}|�|�}|j�|�|j	r�|s�d|kr�|��|�d�d|_|jr�|j��|S)zWrite data, where s is a strr�zcan't write %s to text streamr"r rN)rhr#rrr rXrMr"rJrMrLr'rDrO�encoder@r�rf�_set_decoded_charsr;rEr/)rIrZlengthZhaslf�encoderrrArArBr��s(
�


zTextIOWrapper.writecCst�|j�}||j�|_|jSrQ)r�getincrementalencoderrBrCrD)rIZmake_encoderrArArBrO�szTextIOWrapper._get_encodercCs2t�|j�}||j�}|jr(t||j�}||_|SrQ)r�getincrementaldecoderrBrCrGrrHrE)rIZmake_decoderrrArArB�_get_decoder�s
zTextIOWrapper._get_decodercCs||_d|_dS)zSet the _decoded_chars buffer.rN)r9r:)rI�charsrArArBrT�sz TextIOWrapper._set_decoded_charscCsF|j}|dkr|j|d�}n|j|||�}|jt|�7_|S)z'Advance into the _decoded_chars buffer.N)r:r9r")rIr{�offsetrYrArArB�_get_decoded_chars�sz TextIOWrapper._get_decoded_charscCs$|j|krtd��|j|8_dS)z!Rewind the _decoded_chars buffer.z"rewind decoded_chars out of boundsN)r:�AssertionErrorr�rArArB�_rewind_decoded_chars�s
z#TextIOWrapper._rewind_decoded_charscCs�|jdkrtd��|jr&|j��\}}|jr<|j�|j�}n|j�|j�}|}|j�	||�}|�
|�|r�t|�t|j�|_
nd|_
|jr�|||f|_|S)zQ
        Read and decode the next chunk of data from the BufferedReader.
        Nz
no decoderrA)rEr#r<r*r=r@r��_CHUNK_SIZEr�r#rTr"r9rFr;)rI�
dec_buffer�	dec_flags�input_chunk�eofZ
decoded_charsrArArB�_read_chunk�s 

zTextIOWrapper._read_chunkrcCs(||d>B|d>B|d>Bt|�d>BS)N�@���)r,)rIrPr`�
bytes_to_feed�need_eof�
chars_to_skiprArArB�_pack_cookie�s
�
�zTextIOWrapper._pack_cookiecCsFt|d�\}}t|d�\}}t|d�\}}t|d�\}}|||||fS)Nl)�divmod)rIZbigint�restrPr`rhrirjrArArB�_unpack_cookie	s
zTextIOWrapper._unpack_cookiec	CsR|jstd��|jstd��|��|j��}|j}|dksF|jdkrX|j	rTt
d��|S|j\}}|t|�8}|j}|dkr�|�
||�S|��}�z�t|j|�}d}|t|�ks�t
�|dk�r4|�d|f�t|�|d|���}	|	|k�r"|��\}
}|
�s|}||	8}�qF|t|
�8}d}q�||8}|d}q�d}|�d|f�||}|}
|dk�rl|�
||
�W��Sd}d}d}t|t|��D]x}|d7}|t|�|||d���7}|��\}}|�s�||k�r�||7}||8}|dd}
}}||k�r��q,�q�|t|jddd	��7}d}||k�r,td
��|�
||
|||�W�S|�|�XdS)N�!underlying stream is not seekablez(telling position disabled by next() callzpending decoded textrr
r�rTrz'can't reconstruct logical file position)rrVr<r.rfr@rarEr;r9r\r"r:rkr*r-rrFr#�range)rIrPrr`Z
next_inputrjZsaved_stateZ
skip_bytesZ	skip_backr{r�d�	start_posZstart_flagsZ	bytes_fedriZ
chars_decoded�ir_rArArBra
	s�








�zTextIOWrapper.tellcCs$|��|dkr|��}|j�|�SrQ)rfrar@rbrcrArArBrbm	szTextIOWrapper.truncatecCs*|jdkrtd��|��|j}d|_|S)Nzbuffer is already detached)r@r#rfr�)rIr@rArArBr�s	s
zTextIOWrapper.detachcs��fdd�}�jrtd���js(td��|tkrN|dkr@td��d}���}nZ|tkr�|dkrftd������j�	d|�}��
d�d�_�jr��j�
�||�|S|dkr�td	|f��|dkr�td
|f�������|�\}}}}}	�j�	|���
d�d�_|dk�r*�j�r*�j�
�n@�j�s>|�s>|	�rj�j�pL����_�j�d|f�|df�_|	�r��j�|�}
��
�j�|
|��||
f�_t�j�|	k�r�td��|	�_||�|S)
NcsHz�jp���}Wntk
r&YnX|dkr<|�d�n|��dS)z9Reset the encoder (merely useful for proper BOM handling)rN)rDrOr8r-r/)rPrUr`rArB�_reset_encoder|	sz*TextIOWrapper.seek.<locals>._reset_encoderr�rorz#can't do nonzero cur-relative seeksz#can't do nonzero end-relative seeksrzunsupported whence (%r)r�r�z#can't restore logical file position)rhr#rrVrrar	rfr@r[rTr;rEr/rnrXr-r�r#r"r9r.r:)rIZcookier_rtrPrrr`rhrirjrarAr`rBr[{	s`



�

�
zTextIOWrapper.seekcCs�|��|dkrd}n4z
|j}Wn"tk
rBt|�d���YnX|�}|jpV|��}|dkr�|��|j|j�	�dd�}|�
d�d|_|Sd}|�|�}t|�|kr�|s�|�
�}||�|t|��7}q�|SdS)Nrr�rTrrF)rpr�r/r rErXr[r#r@r�rTr;r"rc)rIr}r�rr>rbrArArBr��	s,
�


zTextIOWrapper.readcCs(d|_|��}|s$d|_|j|_t�|S)NF)r<r�r;rr�r�rArArBr��	szTextIOWrapper.__next__c	Cs
|jrtd��|dkrd}n4z
|j}Wn"tk
rHt|�d���YnX|�}|��}d}|jsj|��d}}|jr�|�	d|�}|dkr�|d}�q�nt
|�}n�|j�rF|�	d|�}|�	d|�}|dkr�|dkr�t
|�}n|d}�q�nX|dk�r|d}�q�n@||k�r|d}�q�n(||dk�r8|d}�q�n|d}�q�n(|�	|j�}|dk�rn|t
|j�}�q�|dk�r�t
|�|k�r�|}�q�|�
��r�|j�r��q��q�|j�r�||��7}qr|�d	�d|_|Sqr|dk�r�||k�r�|}|�t
|�|�|d|�S)
Nr�rr�rr"r
r rr)rhr#r�r/r r[rErXrHryr"rGrIrcr9rTr;r])	rIr}r�r��startr^�endposZnlposZcrposrArArBr��	st







zTextIOWrapper.readlinecCs|jr|jjSdSrQ)rErr`rArArBrH
szTextIOWrapper.newlines)NNNFF)NNNFF)N)rrrr)N)r)N)N),rMrNrOrHr^r�r�r2r>r�r�r8r9r?r?r@rQrRrkrorqrfr5rhrYr,r)r�rOrXrTr[r]rcrkrnrarbr�r[r�r�r�rrArArArBr3�s|�
(�
$




�)



*�

c

K
	
]r3csReZdZdZd�fdd�	Zdd�Zdd	�Zed
d��Zedd
��Z	dd�Z
�ZS)�StringIOz�Text I/O implementation using an in-memory buffer.

    The initial_value argument sets the value of object.  The newline
    argument is like the one of TextIOWrapper's constructor.
    rr"csftt|�jt�dd|d�|dkr(d|_|dk	rbt|t�sNtd�t	|�j
���|�|�|�d�dS)Nzutf-8�
surrogatepass)r8r9r:Fz*initial_value must be str or None, not {0}r)
r�rwr�r�rJrrr r�r@rMr�r[)rIZ
initial_valuer:r�rArBr�T
s�
�
zStringIO.__init__c	CsP|��|jp|��}|��}|��z|j|j��dd�W�S|�|�XdS)NTr)	rfrErXr*r/r-r#r@r�)rIrZ	old_staterArArBr�d
szStringIO.getvaluecCs
t�|�SrQ)�objectr�r`rArArBr�n
szStringIO.__repr__cCsdSrQrAr`rArArBr9s
szStringIO.errorscCsdSrQrAr`rArArBr8w
szStringIO.encodingcCs|�d�dS)Nr�r\r`rArArBr�{
szStringIO.detach)rr")rMrNrOrHr�r�r�r�r9r8r�r�rArAr�rBrwM
s


rw)r
rNNNTN)8rHr�abcrr�r��sys�_threadrr��platformZmsvcrtrr�iorrrr	r�r��addr�	SEEK_DATAr*r�r�dev_moderirCrF�	open_coder/rGrPrVr.r#�ABCMetarW�registerr��_ior(r�r�r�r2r1r�r0rrrr3rwrArArArB�<module>s�


�
[

	
$=
ghCiIJY@U$__pycache__/cgitb.cpython-38.opt-2.pyc000064400000020551151153537600013445 0ustar00U

e5d@/�@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	dd�Z
gZdd�Zdd�Z
dd	�Zd
d�Zdd
�Zddd�Zddd�ZGdd�d�Ze�jZddd�ZdS)�NcCsdS)Na'<!--: spam
Content-Type: text/html

<body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> -->
<body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> --> -->
</font> </font> </font> </script> </object> </blockquote> </pre>
</table> </table> </table> </table> </table> </font> </font> </font>�rrr�/usr/lib64/python3.8/cgitb.py�reset#srcCs|rd|dSdSdS)Nz<small>z</small>�r��textrrr�small.srcCs|rd|dSdSdS)Nz<strong>z	</strong>rrrrrr�strong4sr	cCs|rd|dSdSdS)Nz<font color="#909090">z</font>rrrrrr�grey:sr
cCs�||krd||fS||jkr,d|j|fSd|jkr~|jd}t|�ti�krf||kr~d||fSnt||�r~dt||�fSdtfS)N�local�global�__builtins__�builtin)�	f_globals�type�hasattr�getattr�	__UNDEF__)�name�frame�locals�builtinsrrr�lookup@s



rcCs�gdddtf\}}}}}t�|�D]�\}}	}
}}|tjkr>q�|tjkr�|	tjkr�|dkr�|tk	r�t||	t�}|�||	||f�q�t	|	||�\}
}|�|	|
|f�n"|	dkr�||d7}|}nd\}}|	}q"|S)Nr�.)Nr)
r�tokenize�generate_tokens�NEWLINE�NAME�keyword�kwlistr�appendr)�readerrr�varsZ	lasttoken�parent�prefix�valueZttype�token�start�end�line�whererrr�scanvarsPs"
r+�c"s�|\}}}t|t�r|j}dtj��ddtj}t�t���}dt	j
�dtt	j
�
t|���dd|d|�d	}d
td�d}g}	t�||�}
|
D�]F\}�}}
}}�r�tj����d
�t	j
�
��f}nd�}t�|�\}}}}d}|
dk�r8dtt	j
�
|
��}|
dk�r8|tj||||dd�d�7}i�|gf��fdd�	}t|||�}dd||fg}|dk	�r
||}|D]�}tddtt|��t|��d}|�k�r�d|t	j
�|�f}|�d|�n&d|t	j
�|�f}|�dt|��|d7}�q�ig}}|D]�\}}} ||k�r0�qd||<| tk	�r�|d k�r^d!|t|�}n*|d"k�rrt|�}n|t|�d#�d$�}|�d%|t	j
�| �f�n|�|d&��q|�dttd'�|����|	�d(d)�|��q�d*tt	j
�
t|���t	j
�
t|��fg}!t|�D]B}|dd�d+k�r4�qt	j
�t ||��} |!�d,||| f��q|d�|	�d�|!�d-t	j
�
d�t!�"|||���S).N�Python r�: z<body bgcolor="#f0f0f8">z<big><big>%s</big></big>z#ffffffz#6622aaz<br>z�
<p>A problem occurred in a Python script.  Here is the sequence of
function calls leading up to the error, in the order they occurred.</p>z<tt>z&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;z&nbsp;</tt>z<a href="file://%s">%s</a>�?r�in �<module>cSsdtj�|�S�N�=)�pydoc�html�repr�r%rrr�<lambda>��zhtml.<locals>.<lambda>�Zformatvaluec
s8d�|d<zt��|d�W�S|dd7<XdS�N�r��	linecache�getline��lnum��fileZ	highlightrrr!�szhtml.<locals>.readerz+<tr><td bgcolor="#d8bbff">%s%s %s</td></tr>z<big>&nbsp;</big>z&nbsp;r,z<tt>=&gt;%s%s</tt>z&<tr><td bgcolor="#ffccee">%s</td></tr>z<tt>&nbsp;&nbsp;%s%s</tt>z<tr><td>%s</td></tr>r<)rrz<em>%s</em> rr���z%s&nbsp;= %sz <em>undefined</em>z, zF
<table width="100%%" cellspacing=0 cellpadding=0 border=0>
%s</table>�
z	<p>%s: %s�_z
<br>%s%s&nbsp;=
%sz�


<!-- The above is a description of an error in a Python program, formatted
     for a Web browser because the 'cgitb' module was enabled.  In case you
     are not reading this in a Web browser, here is the original traceback:

%s
-->
)#�
isinstancer�__name__�sys�version�split�
executable�time�ctimer4r5Zheadingr	�escape�strr�inspect�getinnerframes�os�path�abspath�getargvalues�formatargvaluesr+�lenZ	preformatr r
rr6�join�dirr�	traceback�format_exception)"�einfo�context�etype�evalue�etb�pyver�date�head�indent�frames�recordsrrA�func�lines�index�link�args�varargs�varkwr�callr!r"�rows�ir)�num�done�dumprr*r%�	exceptionrrBrr5es�

�
��

��
$






��	��r5c 	s�|\}}}t|t�r|j}dtj��ddtj}t�t���}dt	|�||fd}g}t
�||�}	|	D�]�\}
�}}}
}�r�tj
���p�d�t
�|
�\}}}}d}|dkr�d|}|d	kr�|t
j||||d
d�d�7}i�|gf��fd
d�	}t||
|�}d�|fg}|dk	�rP||}|
D](}d|}|�||���|d7}�q&ig}}|D]�\}}}||k�rv�q^d||<|tk	�r�|dk�r�d|}n|dk�r�||�d�d}|�d|tj�|�f�n|�|d��q^|�d�|��|�dd�|��qndt	|�t	|�fg}t|�D],}tj�t||��}|�dd||f��q*|d�|�d�|�dd�t�|||��S)Nr-rr.z	%s
%s
%s
z�
A problem occurred in a Python script.  Here is the sequence of
function calls leading up to the error, in the order they occurred.
r/rr0r1cSsdtj�|�Sr2)r4rr6r7rrrr8�r9ztext.<locals>.<lambda>r:c
s8d�|d<zt��|d�W�S|dd7<XdSr;r=r@rBrrr!�sztext.<locals>.readerz %s %sz%5d r<rzglobal rrrDz%s = %sz
 undefinedrEz
%s
z%s: %sz

%s%s = %sz    zc

The above is a description of an error in a Python program.  Here is
the original traceback:

%s
)rGrrHrIrJrKrLrMrNrPrQrRrSrTrUrVrWr+r �rstriprr4rr6rYrZrr[r\) r]r^r_r`rarbrcrdrfrgrrArhrirjrlrmrnrror!r"rprqr)rrrsrtrr*r%rurrBrr�sb

�






�rc@s(eZdZddd�Zdd�Zdd	d
�ZdS)
�Hookr<Nr,r5cCs(||_||_||_|ptj|_||_dS�N)�display�logdirr^rI�stdoutrC�format)�selfryrzr^rCr|rrr�__init__s
z
Hook.__init__cCs|�|||f�dSrx)�handle)r}r_r`rarrr�__call__
sz
Hook.__call__c
	Csz|p
t��}|jdkr$|j�t��|jdkr2tp4t}d}z|||j�}Wn d�	t
j|��}d}YnX|jr�|r�t
j�|�}|j�d|d�q�|j�|d�n|j�d�|jdk	�rZd	d
g|jdk}tj||jd�\}}z.t�|d��}|�|�W5QRXd
|}	Wnd|}	YnX|jdk�rJ|j�d|	�n|j�|	d�z|j��WnYnXdS)Nr5FrTz<pre>z</pre>
rEz*<p>A problem occurred in a Python script.
z.txtz.html)�suffixrZ�wz*%s contains the description of this error.z*Tried to save traceback to %s, but failed.z
<p>%s</p>
)rI�exc_infor|rC�writerr5rr^rYr[r\ryr4rOrz�tempfileZmkstemprS�fdopen�flush)
r}�infoZ	formatterZplain�docr��fdrTrC�msgrrrrs@

zHook.handle)r<Nr,Nr5)N)rH�
__module__�__qualname__r~r�rrrrrrws
�
rwr<cCst||||d�t_dS)N�ryrzr^r|)rwrI�
excepthookr�rrr�enable:s�r�)r,)r,)r<Nr,r5)rQrr>rSr4rIr�rMrr[rrrr	r
rr+r5rrwrZhandlerr�rrrr�<module>s*

[
B7__pycache__/secrets.cpython-38.pyc000064400000004220151153537600013060 0ustar00U

e5d��@s�dZddddddddgZd	d
lZd	d
lZd	d
lZd	dlmZd	dlmZe�Z	e	j
Ze	jZd
d�Z
dZddd�Zddd�Zddd�Zd
S)z�Generate cryptographically strong pseudo-random numbers suitable for
managing secrets such as account authentication, tokens, and similar.

See PEP 506 for more information.
https://www.python.org/dev/peps/pep-0506/

�choice�	randbelow�randbits�SystemRandom�token_bytes�	token_hex�
token_urlsafe�compare_digest�N)r)rcCs|dkrtd��t�|�S)z(Return a random int in the range [0, n).r	zUpper bound must be positive.)�
ValueError�_sysrandZ
_randbelow)Zexclusive_upper_bound�r�/usr/lib64/python3.8/secrets.pyrs� cCs|dkrt}t�|�S)z�Return a random byte string containing *nbytes* bytes.

    If *nbytes* is ``None`` or not supplied, a reasonable
    default is used.

    >>> token_bytes(16)  #doctest:+SKIP
    b'\xebr\x17D*t\xae\xd4\xe3S\xb6\xe2\xebP1\x8b'

    N)�DEFAULT_ENTROPY�os�urandom��nbytesrrr
r#s
cCst�t|���d�S)a"Return a random text string, in hexadecimal.

    The string has *nbytes* random bytes, each byte converted to two
    hex digits.  If *nbytes* is ``None`` or not supplied, a reasonable
    default is used.

    >>> token_hex(16)  #doctest:+SKIP
    'f9bf78b9a18ce6d46a0cd2b0b86df9da'

    �ascii)�binasciiZhexlifyr�decoderrrr
r1scCst|�}t�|��d��d�S)z�Return a random URL-safe text string, in Base64 encoding.

    The string has *nbytes* random bytes.  If *nbytes* is ``None``
    or not supplied, a reasonable default is used.

    >>> token_urlsafe(16)  #doctest:+SKIP
    'Drmhze6EPcv0fN_81Bj-nA'

    �=r)r�base64Zurlsafe_b64encode�rstripr)r�tokrrr
r>s
)N)N)N)�__doc__�__all__rrrZhmacrZrandomrrZgetrandbitsrrrrrrrrrrr
�<module>s&�


__pycache__/gzip.cpython-38.opt-2.pyc000064400000033756151153537600013341 0ustar00U

e5d�S�@sddlZddlZddlZddlZddlZddlZddlZddlZdddddgZd\Z	Z
ZZZ
d\ZZd	Zd
ZdZdedddfd
d�Zdd�ZGdd�d�ZGdd�de�ZGdd�dej�ZGdd�dej�Zefdd�dd�Zdd�Zdd�Zedkr�e�dS)�N�BadGzipFile�GzipFile�open�compress�
decompress)�����)rrr��	�rbcCs�d|kr d|krPtd|f��n0|dk	r0td��|dk	r@td��|dk	rPtd��|�dd�}t|tttjf�r|t|||�}n,t|d�s�t|d	�r�td|||�}nt	d
��d|kr�t
�||||�S|SdS)N�t�bzInvalid mode: %rz0Argument 'encoding' not supported in binary modez.Argument 'errors' not supported in binary modez/Argument 'newline' not supported in binary mode��read�writez1filename must be a str or bytes object, or a file)�
ValueError�replace�
isinstance�str�bytes�os�PathLiker�hasattr�	TypeError�io�
TextIOWrapper)�filename�mode�
compresslevel�encoding�errors�newlineZgz_modeZbinary_file�r%�/usr/lib64/python3.8/gzip.pyrs$cCs|�t�d|��dS)Nz<L)r�structZpack)�output�valuer%r%r&�write32uEsr*c@s8eZdZd
dd�Zdd�Zddd�Zdd	�Zd
d�ZdS)�_PaddedFile�cCs ||_t|�|_||_d|_dS�Nr)�_buffer�len�_length�file�_read)�self�f�prependr%r%r&�__init__Os
z_PaddedFile.__init__cCs~|jdkr|j�|�S|j||jkrJ|j}|j|7_|j||j�S|j}d|_|j|d�|j�||j|�SdS�N)r2r1rr0r.)r3�sizerr%r%r&rUs
�z_PaddedFile.readcCs>|jdkr||_n|jt|�8_dSt|j�|_d|_dSr-)r2r.r/r0)r3r5r%r%r&r5bs
z_PaddedFile.prependcCsd|_d|_|j�|�Sr7)r2r.r1�seek)r3Zoffr%r%r&r9ksz_PaddedFile.seekcCsdS�NTr%�r3r%r%r&�seekablepsz_PaddedFile.seekableN)r,)r,)�__name__�
__module__�__qualname__r6rr5r9r<r%r%r%r&r+Js


	r+c@seZdZdS)rN)r=r>r?r%r%r%r&rtsc@s�eZdZdZddeddfdd�Zedd��Zedd��Zdd	�Z	d
d�Z
dd
�Zdd�Zd+dd�Z
d,dd�Zdd�Zedd��Zdd�Zejfdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zejfd'd(�Zd-d)d*�ZdS).rNcCs4|r"d|ksd|kr"td�|���|r6d|kr6|d7}|dkrTt�||pJd�}|_|dkr|t|dd�}t|ttf�s�d}n
t	�
|�}|dkr�t|dd�}|�d	�r�t|_
t|�}t�|�|_||_nN|�d
��rt|_
|�|�t�|tjtjtjd�|_||_ntd�|���||_|j
tk�r0|�|�dS)Nr�UzInvalid mode: {!r}rr�namerr �r)�w�a�xr)r�format�builtinsr�	myfileobj�getattrrrrr�fspath�
startswith�READr �_GzipReaderr�BufferedReaderr.rA�WRITE�_init_write�zlibZcompressobjZDEFLATED�	MAX_WBITSZ
DEF_MEM_LEVELr�_write_mtime�fileobj�_write_gzip_header)r3rr r!rT�mtime�rawr%r%r&r6�s@#


�zGzipFile.__init__cCsBddl}|�dtd�|jtkr<|jdd�dkr<|jdS|jS)Nrzuse the name attributer����.gz)�warnings�warn�DeprecationWarningr rOrA)r3rZr%r%r&r�s

zGzipFile.filenamecCs
|jjjSr7)r.rW�_last_mtimer;r%r%r&rV�szGzipFile.mtimecCs.t|j�}d|dd�dtt|��dS)Nz<gzip r���� �>)�reprrT�hex�id)r3�sr%r%r&�__repr__�s
zGzipFile.__repr__cCs.||_t�d�|_d|_g|_d|_d|_dS�Nr,r)rArQ�crc32�crcr8Zwritebuf�bufsize�offset)r3rr%r%r&rP�szGzipFile._init_writecCs|j�d�|j�d�z<tj�|j�}t|t�s<|�d�}|�	d�rR|dd�}Wnt
k
rld}YnXd}|rzt}|j�t|��d��|j
}|dkr�t��}t|jt|��|tkr�d}n|tkr�d	}nd
}|j�|�|j�d�|�r|j�|d
�dS)N���zlatin-1s.gzrXr,r�����)rTrr�path�basenamerArr�encode�endswith�UnicodeEncodeError�FNAME�chrrS�timer*�int�_COMPRESS_LEVEL_BEST�_COMPRESS_LEVEL_FAST)r3r!Zfname�flagsrVZxflr%r%r&rU�s6



zGzipFile._write_gzip_headercCs�|��|jtkr&ddl}t|jd��|jdkr8td��t|t	�rLt
|�}nt|�}|j}|dkr�|j�
|j�|��|j|7_t�||j�|_|j|7_|S)Nrz$write() on read-only GzipFile objectz!write() on closed GzipFile object)�_check_not_closedr rO�errno�OSError�EBADFrTrrrr/�
memoryview�nbytesrrr8rQrgrhrj)r3�datar~Zlengthr%r%r&rs 



zGzipFile.writer^cCs2|��|jtkr&ddl}t|jd��|j�|�S)Nrz$read() on write-only GzipFile object)r}r rLr~rr�r.r�r3r8r~r%r%r&rs

z
GzipFile.readcCs@|��|jtkr&ddl}t|jd��|dkr4tj}|j�	|�S)Nrz%read1() on write-only GzipFile object)
r}r rLr~rr�r�DEFAULT_BUFFER_SIZEr.�read1r�r%r%r&r�&s
zGzipFile.read1cCs2|��|jtkr&ddl}t|jd��|j�|�S)Nrz$peek() on write-only GzipFile object)r}r rLr~rr�r.�peek)r3�nr~r%r%r&r�3s

z
GzipFile.peekcCs
|jdkSr7�rTr;r%r%r&�closed:szGzipFile.closedcCs�|j}|dkrdSd|_zP|jtkrR|�|j���t||j	�t||j
d@�n|jtkrf|j��W5|j}|r�d|_|��XdS)N���)
rTrH�closer rOrr�flushr*rhr8rLr.)r3rTrHr%r%r&r�>s

zGzipFile.closecCs4|��|jtkr0|j�|j�|��|j��dSr7)r}r rOrTrrr�)r3Z	zlib_moder%r%r&r�Qs
zGzipFile.flushcCs
|j��Sr7)rT�filenor;r%r%r&r�XszGzipFile.filenocCs"|jtkrtd��|j�d�dS)NzCan't rewind in write moder)r rLrr.r9r;r%r%r&�rewind`s
zGzipFile.rewindcCs
|jtkSr7)r rLr;r%r%r&�readablegszGzipFile.readablecCs
|jtkSr7)r rOr;r%r%r&�writablejszGzipFile.writablecCsdSr:r%r;r%r%r&r<mszGzipFile.seekablecCs�|jtkr�|tjkr2|tjkr*|j|}ntd��||jkrDtd��||j}d}t|d�D]}|�	|�q^|�	d|d�n |jt
kr�|��|j�
||�S|jS)NzSeek from end not supportedzNegative seek in write modes�ro)r rOr�SEEK_SET�SEEK_CURrjrr�rangerrLr}r.r9)r3rj�whence�count�chunk�ir%r%r&r9ps 





z
GzipFile.seekcCs|��|j�|�Sr7)r}r.�readline)r3r8r%r%r&r��szGzipFile.readline)r^)r^)r^)r=r>r?rHrzr6�propertyrrVrerPrUrrr�r�r�r�rQZZ_SYNC_FLUSHr�r�r�r�r�r<rr�r9r�r%r%r%r&rxs8�
I

 



csZeZdZ�fdd�Zdd�Zdd�Zdd�Zdd
d�Zdd
�Zdd�Z	�fdd�Z
�ZS)rMcs,t�jt|�tjtjd�d|_d|_dS)N)ZwbitsT)�superr6r+rQZ
decompressobjrR�_new_memberr])r3�fp��	__class__r%r&r6�s
�z_GzipReader.__init__cCst�d�|_d|_dSrf)rQrg�_crc�_stream_sizer;r%r%r&�
_init_read�sz_GzipReader._init_readcCsF|j�|�}t|�|krB|j�|t|��}|s8td��||7}q|S)N�ACompressed file ended before the end-of-stream marker was reached)�_fprr/�EOFError)r3r�r�rr%r%r&�_read_exact�s
z_GzipReader._read_exactcCs�|j�d�}|dkrdS|dkr,td|��t�d|�d��\}}|_|dkrVtd��|t@r|t�d	|�d��\}|�|�|t@r�|j�d
�}|r�|dkr�q�q�|t	@r�|j�d
�}|r�|dkr�q�q�|t
@r�|�d�dS)
Nrr,FrkzNot a gzipped file (%r)z<BBIxxr
zUnknown compression methodz<HrroT)r�rrr'�unpackr�r]�FEXTRArv�FCOMMENT�FHCRC)r3�magic�method�flagZ	extra_lenrdr%r%r&�_read_gzip_header�s0�

z_GzipReader._read_gzip_headerr^cCs�|dkr|��S|sdS|jjr>|��d|_|jf|j�|_|jrf|��|��s`|j	|_
dSd|_|j�t
j�}|j�||�}|jjdkr�|j�|jj�n|jjdkr�|j�|jj�|dkr�q�|dkrtd��q|�|�|j	t|�7_	|S)Nrr,TFr�)�readallZ
_decompressor�eof�	_read_eofr�Z_decomp_factoryZ_decomp_argsr�r�Z_posZ_sizer�rrr�rZunconsumed_tailr5Zunused_datar��_add_read_datar/)r3r8�bufZ
uncompressr%r%r&r�s:�

z_GzipReader.readcCs$t�||j�|_|jt|�|_dSr7)rQrgr�r�r/)r3r�r%r%r&r��sz_GzipReader._add_read_datacCs�t�d|�d��\}}||jkr<tdt|�t|j�f��n||jd@krRtd��d}|dkrl|j�d�}qV|r||j�	|�dS)Nz<IIr
zCRC check failed %s != %sr�z!Incorrect length of data producedror)
r'r�r�r�rrbr�r�rr5)r3rgZisize�cr%r%r&r��s

�
z_GzipReader._read_eofcst���d|_dSr:)r��_rewindr�r;r�r%r&r�s
z_GzipReader._rewind)r^)r=r>r?r6r�r�r�rr�r�r��
__classcell__r%r%r�r&rM�s!
3rM)rVc	Cs6t��}t|d||d��}|�|�W5QRX|��S)N�wb)rTr r!rV)r�BytesIOrr�getvalue)r�r!rVr�r4r%r%r&rsc
Cs0tt�|�d��}|��W5QR�SQRXdS)Nr�)rrr�r)r�r4r%r%r&rsc	Cs�ddlm}|dd�}|��}|jdddd�|jd	dd
d�|jdddd
d�|jdddgdd�|��}t}|jr|t}n
|jr�t	}|j
D]�}|jr�|dkr�tddt
jjd�}t
jj}n>|dd�dkr�t
�d|���t|d�}t�|dd�d�}nB|dk�r"t
jj}tddt
jj|d�}nt�|d�}t|dd�}|�d�}|�sP�q^|�|��q<|t
jjk	�rt|��|t
jjk	r�|��q�dS)Nr)�ArgumentParserzeA simple command line interface for the gzip module: act like gzip, but do not delete the input file.)Zdescriptionz--fast�
store_truezcompress faster)�action�helpz--bestzcompress betterz-dz--decompresszact like gunzip instead of gzip�args�*�-r1)�nargs�default�metavarrr)rr rTrXrYzfilename doesn't end in .gz: r�)rr rTr!r�)�argparser�Zadd_mutually_exclusive_group�add_argument�
parse_args�_COMPRESS_LEVEL_TRADEOFFZfastr{Zbestrzr�rr�sys�stdin�buffer�stdout�exitrrGrrr�)	r��parser�groupr�r!�argr4�gr�r%r%r&�main'sR�
�



�
r��__main__) r'r�rxrrQrGrZ_compression�__all__ZFTEXTr�r�rvr�rLrOr{r�rzrr*r+rrZ
BaseStreamrZDecompressReaderrMrrr�r=r%r%r%r&�<module>s8 �
,*	0__pycache__/statistics.cpython-38.opt-1.pyc000064400000100751151153537600014547 0ustar00U

e5d
��@sndZddddddddd	d
ddd
ddddgZddlZddlZddlZddlmZddlmZddl	m
Z
ddlmZm
Z
ddlmZmZmZmZmZmZmZmZddlmZddlmZGdd�de�Zdddd�Zdd�Zd d!�Zd"d#�Zd$d%�Z d&d'�Z!d(d)�Z"ded+d,�Z#d-d�Z$d.d�Z%d/d�Z&d0d�Z'd1d�Z(d2d
�Z)d3d	�Z*dfd5d�Z+d6d�Z,d7d�Z-d8d9d:�d;d�Z.dgd<d=�Z/dhd>d�Z0did?d�Z1djd@d�Z2dkdAd
�Z3dBdC�Z4GdDd�d�Z5zddEl6m4Z4Wne7k
�r�YnXe8dFk�rjddGlm9Z9ddHlm:Z:m;Z;m<Z<m=Z=ddIl	m>Z>ddl?Z?e5dJdK�Z@e5dLdM�ZAdNZBe@�CeB�ZDeA�CeB�ZEe:e;fD]<ZFeGdOeFj8�dP��eGeFe@eA��eGe5�HeIeFeDeE����qRdQZJe:e;e<e=fD]@ZFeGdOeFj8�dR��eGeFe@eJ��eGe5�HeIeFeDe>eJ�����q�dSZJe:e;e<fD]@ZFeGdTeFj8�dU��eGeFeJe@��eGe5�HeIeFe>eJ�eD����q�dVdW�ZKe5dXdY�ZLe5dZd[�ZMd\ZNdNZBe5�Hd]d^�eL�CeB�D��ZOeKeLeNeO�e5�Hd_d^�eL�CeB�D��ZOeKeLeNeO�e5�Hd`d^�eL�CeB�D��ZOeKeLeNeO�e5�Hdad^�eL�CeB�D��ZOeKeLeNeO�e5�Hdbd^�ePeL�CeB�eM�CeB��D��ZOeKeLeMeO�e5�Hdcd^�ePeL�CeB�eM�CeB��D��ZOeKeLeMeO�eGe?�Q��dS)lam

Basic statistics module.

This module provides functions for calculating statistics of data, including
averages, variance, and standard deviation.

Calculating averages
--------------------

==================  ==================================================
Function            Description
==================  ==================================================
mean                Arithmetic mean (average) of data.
fmean               Fast, floating point arithmetic mean.
geometric_mean      Geometric mean of data.
harmonic_mean       Harmonic mean of data.
median              Median (middle value) of data.
median_low          Low median of data.
median_high         High median of data.
median_grouped      Median, or 50th percentile, of grouped data.
mode                Mode (most common value) of data.
multimode           List of modes (most common values of data).
quantiles           Divide data into intervals with equal probability.
==================  ==================================================

Calculate the arithmetic mean ("the average") of data:

>>> mean([-1.0, 2.5, 3.25, 5.75])
2.625


Calculate the standard median of discrete data:

>>> median([2, 3, 4, 5])
3.5


Calculate the median, or 50th percentile, of data grouped into class intervals
centred on the data values provided. E.g. if your data points are rounded to
the nearest whole number:

>>> median_grouped([2, 2, 3, 3, 3, 4])  #doctest: +ELLIPSIS
2.8333333333...

This should be interpreted in this way: you have two data points in the class
interval 1.5-2.5, three data points in the class interval 2.5-3.5, and one in
the class interval 3.5-4.5. The median of these data points is 2.8333...


Calculating variability or spread
---------------------------------

==================  =============================================
Function            Description
==================  =============================================
pvariance           Population variance of data.
variance            Sample variance of data.
pstdev              Population standard deviation of data.
stdev               Sample standard deviation of data.
==================  =============================================

Calculate the standard deviation of sample data:

>>> stdev([2.5, 3.25, 5.5, 11.25, 11.75])  #doctest: +ELLIPSIS
4.38961843444...

If you have previously calculated the mean, you can pass it as the optional
second argument to the four "spread" functions to avoid recalculating it:

>>> data = [1, 2, 2, 4, 4, 4, 5, 6]
>>> mu = mean(data)
>>> pvariance(data, mu)
2.5


Exceptions
----------

A single exception is defined: StatisticsError is a subclass of ValueError.

�
NormalDist�StatisticsError�fmean�geometric_mean�
harmonic_mean�mean�median�median_grouped�median_high�
median_low�mode�	multimode�pstdev�	pvariance�	quantiles�stdev�variance�N��Fraction)�Decimal)�groupby)�bisect_left�bisect_right)�hypot�sqrt�fabs�exp�erf�tau�log�fsum)�
itemgetter)�Counterc@seZdZdS)rN)�__name__�
__module__�__qualname__�r&r&�"/usr/lib64/python3.8/statistics.pyruscCs�d}t|�\}}||i}|j}ttt|��}t|t�D]@\}}	t||�}tt|	�D]"\}}|d7}||d�|||<qRq6d|kr�|d}
ntdd�t|�	��D��}
||
|fS)aC_sum(data [, start]) -> (type, sum, count)

    Return a high-precision sum of the given numeric data as a fraction,
    together with the type to be converted to and the count of items.

    If optional argument ``start`` is given, it is added to the total.
    If ``data`` is empty, ``start`` (defaulting to 0) is returned.


    Examples
    --------

    >>> _sum([3, 2.25, 4.5, -0.5, 1.0], 0.75)
    (<class 'float'>, Fraction(11, 1), 5)

    Some sources of round-off error will be avoided:

    # Built-in sum returns zero.
    >>> _sum([1e50, 1, -1e50] * 1000)
    (<class 'float'>, Fraction(1000, 1), 3000)

    Fractions and Decimals are also supported:

    >>> from fractions import Fraction as F
    >>> _sum([F(2, 3), F(7, 5), F(1, 4), F(5, 6)])
    (<class 'fractions.Fraction'>, Fraction(63, 20), 4)

    >>> from decimal import Decimal as D
    >>> data = [D("0.1375"), D("0.2108"), D("0.3061"), D("0.0419")]
    >>> _sum(data)
    (<class 'decimal.Decimal'>, Fraction(6963, 10000), 4)

    Mixed types are currently treated as an error, except that int is
    allowed.
    r�Ncss|]\}}t||�VqdS�Nr)�.0�d�nr&r&r'�	<genexpr>�sz_sum.<locals>.<genexpr>)
�_exact_ratio�get�_coerce�int�typer�map�sum�sorted�items)�data�start�countr,r+ZpartialsZpartials_get�T�typ�values�totalr&r&r'�_sum{s$
r>cCs.z
|��WStk
r(t�|�YSXdSr))Z	is_finite�AttributeError�mathZisfinite)�xr&r&r'�	_isfinite�s
rBcCs�||kr|S|tks|tkr |S|tkr,|St||�r:|St||�rH|St|t�rV|St|t�rd|St|t�r|t|t�r||St|t�r�t|t�r�|Sd}t||j|jf��dS)z�Coerce types T and S to a common type, or raise TypeError.

    Coercion rules are currently an implementation detail. See the CoerceTest
    test class in test_statistics for details.
    z"don't know how to coerce %s and %sN)r1�bool�
issubclassr�float�	TypeErrorr#)r:�S�msgr&r&r'r0�s(



r0cCs�zrt|�tkst|�tkr$|��WSz|j|jfWWStk
rnz|��WYWStk
rhYnXYnXWn ttfk
r�|dfYSXd}t	|�
t|�j���dS)z�Return Real number x to exact (numerator, denominator) pair.

    >>> _exact_ratio(0.25)
    (1, 4)

    x is expected to be an int, Fraction, Decimal or float.
    Nz0can't convert type '{}' to numerator/denominator)r2rEr�as_integer_ratio�	numerator�denominatorr?�
OverflowError�
ValueErrorrF�formatr#)rArHr&r&r'r.�s
r.cCspt|�|kr|St|t�r(|jdkr(t}z
||�WStk
rjt|t�rd||j�||j�YS�YnXdS)z&Convert value to given numeric type T.r(N)r2rDr1rKrErFrrJ)�valuer:r&r&r'�_convert�s

rPcCs.t||�}|t|�kr&|||kr&|St�dS)z,Locate the leftmost value exactly equal to xN)r�lenrM)�arA�ir&r&r'�
_find_lteq
s
rTcCs>t|||d�}|t|�dkr6||d|kr6|dSt�dS)z-Locate the rightmost value exactly equal to x)�lor(N)rrQrM)rR�lrArSr&r&r'�
_find_rteqs rW�negative valueccs$|D]}|dkrt|��|VqdS)z7Iterate over values, failing if any are less than zero.rN)r)r<�errmsgrAr&r&r'�	_fail_negsrZcCsHt|�|krt|�}t|�}|dkr,td��t|�\}}}t|||�S)a�Return the sample arithmetic mean of data.

    >>> mean([1, 2, 3, 4, 4])
    2.8

    >>> from fractions import Fraction as F
    >>> mean([F(3, 7), F(1, 21), F(5, 3), F(1, 3)])
    Fraction(13, 21)

    >>> from decimal import Decimal as D
    >>> mean([D("0.5"), D("0.75"), D("0.625"), D("0.375")])
    Decimal('0.5625')

    If ``data`` is empty, StatisticsError will be raised.
    r(z%mean requires at least one data point)�iter�listrQrr>rP)r7r,r:r=r9r&r&r'r'scstzt|��Wn0tk
r<d��fdd�}t||��}Yn
Xt|�}z
|�WStk
rntd�d�YnXdS)z�Convert data to floats and compute the arithmetic mean.

    This runs faster than the mean() function and it always returns a float.
    If the input dataset is empty, it raises a StatisticsError.

    >>> fmean([3.5, 4.0, 5.25])
    4.25
    rc3s t|dd�D]\�}|VqdS)Nr()r8)�	enumerate)�iterablerA�r,r&r'r9Oszfmean.<locals>.countz&fmean requires at least one data pointN)rQrFr �ZeroDivisionErrorr)r7r9r=r&r_r'rAs	
cCs8ztttt|���WStk
r2td�d�YnXdS)aYConvert data to floats and compute the geometric mean.

    Raises a StatisticsError if the input dataset is empty,
    if it contains a zero, or if it contains a negative value.

    No special efforts are made to achieve exact results.
    (However, this may change in the future.)

    >>> round(geometric_mean([54, 24, 36]), 9)
    36.0
    zHgeometric mean requires a non-empty dataset  containing positive numbersN)rrr3rrMr)r7r&r&r'r\s�cCs�t|�|krt|�}d}t|�}|dkr2td��n<|dkrn|d}t|tjtf�rf|dkrbt|��|Std��z"t	dd�t
||�D��\}}}Wntk
r�YdSXt|||�S)aReturn the harmonic mean of data.

    The harmonic mean, sometimes called the subcontrary mean, is the
    reciprocal of the arithmetic mean of the reciprocals of the data,
    and is often appropriate when averaging quantities which are rates
    or ratios, for example speeds. Example:

    Suppose an investor purchases an equal value of shares in each of
    three companies, with P/E (price/earning) ratios of 2.5, 3 and 10.
    What is the average P/E ratio for the investor's portfolio?

    >>> harmonic_mean([2.5, 3, 10])  # For an equal investment portfolio.
    3.6

    Using the arithmetic mean would give an average of about 5.167, which
    is too high.

    If ``data`` is empty, or any element is less than zero,
    ``harmonic_mean`` will raise ``StatisticsError``.
    z.harmonic mean does not support negative valuesr(z.harmonic_mean requires at least one data pointrzunsupported typecss|]}d|VqdS)r(Nr&�r*rAr&r&r'r-�sz harmonic_mean.<locals>.<genexpr>)
r[r\rQr�
isinstance�numbersZRealrrFr>rZr`rP)r7rYr,rAr:r=r9r&r&r'ros$
"cCs\t|�}t|�}|dkr td��|ddkr8||dS|d}||d||dSdS)aBReturn the median (middle value) of numeric data.

    When the number of data points is odd, return the middle data point.
    When the number of data points is even, the median is interpolated by
    taking the average of the two middle values:

    >>> median([1, 3, 5])
    3
    >>> median([1, 3, 5, 7])
    4.0

    r�no median for empty data�r(N�r5rQr)r7r,rSr&r&r'r�s
cCsLt|�}t|�}|dkr td��|ddkr8||dS||ddSdS)a	Return the low median of numeric data.

    When the number of data points is odd, the middle value is returned.
    When it is even, the smaller of the two middle values is returned.

    >>> median_low([1, 3, 5])
    3
    >>> median_low([1, 3, 5, 7])
    3

    rrdrer(Nrf�r7r,r&r&r'r
�scCs,t|�}t|�}|dkr td��||dS)aReturn the high median of data.

    When the number of data points is odd, the middle value is returned.
    When it is even, the larger of the two middle values is returned.

    >>> median_high([1, 3, 5])
    3
    >>> median_high([1, 3, 5, 7])
    5

    rrdrerfrgr&r&r'r	�s
r(c
Cs�t|�}t|�}|dkr"td��n|dkr2|dS||d}||fD]}t|ttf�rFtd|��qFz||d}Wn(tk
r�t|�t|�d}YnXt||�}t	|||�}|}||d}	|||d||	S)a�Return the 50th percentile (median) of grouped continuous data.

    >>> median_grouped([1, 2, 2, 3, 4, 4, 4, 4, 4, 5])
    3.7
    >>> median_grouped([52, 52, 53, 54])
    52.5

    This calculates the median as the 50th percentile, and should be
    used when your data is continuous and grouped. In the above example,
    the values 1, 2, 3, etc. actually represent the midpoint of classes
    0.5-1.5, 1.5-2.5, 2.5-3.5, etc. The middle value falls somewhere in
    class 3.5-4.5, and interpolation is used to estimate it.

    Optional argument ``interval`` represents the class interval, and
    defaults to 1. Changing the class interval naturally will change the
    interpolated 50th percentile value:

    >>> median_grouped([1, 3, 3, 5, 7], interval=1)
    3.25
    >>> median_grouped([1, 3, 3, 5, 7], interval=2)
    3.5

    This function does not check whether the data points are at least
    ``interval`` apart.
    rrdr(rezexpected number but got %r)
r5rQrrb�str�bytesrFrErTrW)
r7Zintervalr,rA�obj�L�l1�l2Zcf�fr&r&r'r�s&

cCsHt|�}t|��d�}z|ddWStk
rBtd�d�YnXdS)axReturn the most common data point from discrete or nominal data.

    ``mode`` assumes discrete data, and returns a single value. This is the
    standard treatment of the mode as commonly taught in schools:

        >>> mode([1, 1, 2, 3, 3, 3, 3, 4])
        3

    This also works with nominal (non-numeric) data:

        >>> mode(["red", "blue", "blue", "red", "green", "red", "red"])
        'red'

    If there are multiple modes with same frequency, return the first one
    encountered:

        >>> mode(['red', 'red', 'green', 'blue', 'blue'])
        'red'

    If *data* is empty, ``mode``, raises StatisticsError.

    r(rzno mode for empty dataN)r[r"�most_common�
IndexErrorr)r7Zpairsr&r&r'rscCs@tt|����}tt|td�d�dgf�\}}tttd�|��S)a.Return a list of the most frequently occurring values.

    Will return more than one result if there are multiple modes
    or an empty list if *data* is empty.

    >>> multimode('aabbbbbbbbcc')
    ['b']
    >>> multimode('aabbbbccddddeeffffgg')
    ['b', 'd', 'f']
    >>> multimode('')
    []
    r()�keyr)r"r[ro�nextrr!r\r3)r7ZcountsZmaxcountZ
mode_itemsr&r&r'r5s
��	exclusive)r,�methodc
CsL|dkrtd��t|�}t|�}|dkr0td��|dkr�|d}g}td|�D]N}|||}||||}||||||d||}	|�|	�qN|S|dk�r:|d}g}td|�D]r}|||}|dkr�dn||dkr�|dn|}||||}||d||||||}	|�|	�q�|Std|����dS)	a�Divide *data* into *n* continuous intervals with equal probability.

    Returns a list of (n - 1) cut points separating the intervals.

    Set *n* to 4 for quartiles (the default).  Set *n* to 10 for deciles.
    Set *n* to 100 for percentiles which gives the 99 cuts points that
    separate *data* in to 100 equal sized groups.

    The *data* can be any iterable containing sample.
    The cut points are linearly interpolated between data points.

    If *method* is set to *inclusive*, *data* is treated as population
    data.  The minimum value is treated as the 0th percentile and the
    maximum value is treated as the 100th percentile.
    r(zn must be at least 1rez"must have at least two data pointsZ	inclusivertzUnknown method: N)rr5rQ�range�appendrM)
r7r,ruZld�m�resultrS�jZdeltaZinterpolatedr&r&r'rls4$
$$cs��dk	r,t�fdd�|D��\}}}||fSt|��t�fdd�|D��\}}}t�fdd�|D��\}}}||dt|�8}||fS)a;Return sum of square deviations of sequence data.

    If ``c`` is None, the mean is calculated in one pass, and the deviations
    from the mean are calculated in a second pass. Otherwise, deviations are
    calculated from ``c`` as given. Use the second case with care, as it can
    lead to garbage results.
    Nc3s|]}|�dVqdS�reNr&ra��cr&r'r-�sz_ss.<locals>.<genexpr>c3s|]}|�dVqdSr{r&rar|r&r'r-�sc3s|]}|�VqdSr)r&rar|r&r'r-�sre)r>rrQ)r7r}r:r=r9�UZtotal2Zcount2r&r|r'�_ss�srcCsLt|�|krt|�}t|�}|dkr,td��t||�\}}t||d|�S)a�Return the sample variance of data.

    data should be an iterable of Real-valued numbers, with at least two
    values. The optional argument xbar, if given, should be the mean of
    the data. If it is missing or None, the mean is automatically calculated.

    Use this function when your data is a sample from a population. To
    calculate the variance from the entire population, see ``pvariance``.

    Examples:

    >>> data = [2.75, 1.75, 1.25, 0.25, 0.5, 1.25, 3.5]
    >>> variance(data)
    1.3720238095238095

    If you have already calculated the mean of your data, you can pass it as
    the optional second argument ``xbar`` to avoid recalculating it:

    >>> m = mean(data)
    >>> variance(data, m)
    1.3720238095238095

    This function does not check that ``xbar`` is actually the mean of
    ``data``. Giving arbitrary values for ``xbar`` may lead to invalid or
    impossible results.

    Decimals and Fractions are supported:

    >>> from decimal import Decimal as D
    >>> variance([D("27.5"), D("30.25"), D("30.25"), D("34.5"), D("41.75")])
    Decimal('31.01875')

    >>> from fractions import Fraction as F
    >>> variance([F(1, 6), F(1, 2), F(5, 3)])
    Fraction(67, 108)

    rez*variance requires at least two data pointsr(�r[r\rQrrrP)r7�xbarr,r:�ssr&r&r'r�s&cCsHt|�|krt|�}t|�}|dkr,td��t||�\}}t|||�S)a,Return the population variance of ``data``.

    data should be a sequence or iterable of Real-valued numbers, with at least one
    value. The optional argument mu, if given, should be the mean of
    the data. If it is missing or None, the mean is automatically calculated.

    Use this function to calculate the variance from the entire population.
    To estimate the variance from a sample, the ``variance`` function is
    usually a better choice.

    Examples:

    >>> data = [0.0, 0.25, 0.25, 1.25, 1.5, 1.75, 2.75, 3.25]
    >>> pvariance(data)
    1.25

    If you have already calculated the mean of the data, you can pass it as
    the optional second argument to avoid recalculating it:

    >>> mu = mean(data)
    >>> pvariance(data, mu)
    1.25

    Decimals and Fractions are supported:

    >>> from decimal import Decimal as D
    >>> pvariance([D("27.5"), D("30.25"), D("30.25"), D("34.5"), D("41.75")])
    Decimal('24.815')

    >>> from fractions import Fraction as F
    >>> pvariance([F(1, 4), F(5, 4), F(1, 2)])
    Fraction(13, 72)

    r(z*pvariance requires at least one data pointr�)r7�mur,r:r�r&r&r'r�s#cCs8t||�}z
|��WStk
r2t�|�YSXdS)z�Return the square root of the sample variance.

    See ``variance`` for arguments and other details.

    >>> stdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75])
    1.0810874155219827

    N)rrr?r@)r7r��varr&r&r'rs
	

cCs8t||�}z
|��WStk
r2t�|�YSXdS)z�Return the square root of the population variance.

    See ``pvariance`` for arguments and other details.

    >>> pstdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75])
    0.986893273527251

    N)rrr?r@)r7r�r�r&r&r'r
&s
	

cCs|d}t|�dkr�d||}d|d|d|d|d|d	|d
|d|}d|d
|d|d|d|d|d|d}||}|||S|dkr�|nd|}tt|��}|dk�r^|d}d|d|d|d|d|d|d|d}d|d |d!|d"|d#|d$|d%|d}n�|d}d&|d'|d(|d)|d*|d+|d,|d-}d.|d/|d0|d1|d2|d3|d4|d}||}|dk�r�|}|||S)5N��?g333333�?g��Q��?g^�}o)��@g�E.k�R�@g ��Ul�@g*u��>l�@g�N����@g�"]Ξ@gnC���`@gu��@giK��~j�@gv��|E�@g��d�|1�@gfR��r��@g��u.2�@g���~y�@g�n8(E@��?�g@g�������?g鬷�ZaI?gg�El�D�?g7\�����?g�uS�S�?g�=�.
@gj%b�@g���Hw�@gjR�e�?g�9dh?
>g('߿��A?g��~z �?g@�3��?gɅ3��?g3fR�x�?gI�F��l@g����t��>g*�Y��n�>gESB\T?g�N;A+�?g�UR1��?gE�F���?gP�n��@g&�>���@g����i�<g�@�F�>g�tcI,\�>g�ŝ���I?g*F2�v�?g�C4�?g��O�1�?)rrr)�pr��sigma�q�rZnumZdenrAr&r&r'�_normal_dist_inv_cdf9sd���������������������������
��������������������������	��������������������������
r�c@s�eZdZdZddd�Zd8dd�Zed	d
��Zdd�d
d�Zdd�Z	dd�Z
dd�Zd9dd�Zdd�Z
edd��Zedd��Zedd��Zed d!��Zed"d#��Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�ZeZd0d1�ZeZd2d3�Zd4d5�Zd6d7�ZdS):rz(Normal distribution of a random variablez(Arithmetic mean of a normal distributionz+Standard deviation of a normal distribution)�_mu�_sigmar�r�cCs(|dkrtd��t|�|_t|�|_dS)zDNormalDist where mu is the mean and sigma is the standard deviation.r�zsigma must be non-negativeN)rrEr�r�)�selfr�r�r&r&r'�__init__�s
zNormalDist.__init__cCs.t|ttf�st|�}t|�}||t||��S)z5Make a normal distribution instance from sample data.)rbr\�tuplerr)�clsr7r�r&r&r'�from_samples�szNormalDist.from_samplesN)�seedcsB|dkrtjn
t�|�j�|j|j�����fdd�t|�D�S)z=Generate *n* samples for a given mean and standard deviation.Ncsg|]}�����qSr&r&�r*rS��gaussr�r�r&r'�
<listcomp>�sz&NormalDist.samples.<locals>.<listcomp>)�randomr�ZRandomr�r�rv)r�r,r�r&r�r'�samples�szNormalDist.samplescCs<|jd}|std��t||jdd|�tt|�S)z4Probability density function.  P(x <= X < x+dx) / dx�@z$pdf() not defined when sigma is zerog�)r�rrr�rr)r�rArr&r&r'�pdf�s
zNormalDist.pdfcCs2|jstd��ddt||j|jtd��S)z,Cumulative distribution function.  P(X <= x)z$cdf() not defined when sigma is zeror�r�r�)r�rrr�r)r�rAr&r&r'�cdf�szNormalDist.cdfcCs:|dks|dkrtd��|jdkr*td��t||j|j�S)aSInverse cumulative distribution function.  x : P(X <= x) = p

        Finds the value of the random variable such that the probability of
        the variable being less than or equal to that value equals the given
        probability.

        This function is also called the percent point function or quantile
        function.
        r�r�z$p must be in the range 0.0 < p < 1.0z-cdf() not defined when sigma at or below zero)rr�r�r�)r�r�r&r&r'�inv_cdf�s


zNormalDist.inv_cdfrscs��fdd�td��D�S)anDivide into *n* continuous intervals with equal probability.

        Returns a list of (n - 1) cut points separating the intervals.

        Set *n* to 4 for quartiles (the default).  Set *n* to 10 for deciles.
        Set *n* to 100 for percentiles which gives the 99 cuts points that
        separate the normal distribution in to 100 equal sized groups.
        csg|]}��|���qSr&)r�r��r,r�r&r'r��sz(NormalDist.quantiles.<locals>.<listcomp>r()rv)r�r,r&r�r'r�s	zNormalDist.quantilescCst|t�std��||}}|j|jf|j|jfkr>||}}|j|j}}|rT|s\td��||}t|j|j�}|s�dt|d|jt	d��S|j||j|}|j|jt	|d|t
||��}	||	|}
||	|}dt|�|
�|�|
��t|�|�|�|��S)a�Compute the overlapping coefficient (OVL) between two normal distributions.

        Measures the agreement between two normal probability distributions.
        Returns a value between 0.0 and 1.0 giving the overlapping area in
        the two underlying probability density functions.

            >>> N1 = NormalDist(2.4, 1.6)
            >>> N2 = NormalDist(3.2, 2.0)
            >>> N1.overlap(N2)
            0.8035050657330205
        z$Expected another NormalDist instancez(overlap() not defined when sigma is zeror�r�)rbrrFr�r�rrrrrrr�)r��other�X�YZX_varZY_varZdvZdmrR�b�x1�x2r&r&r'�overlap�s"


(zNormalDist.overlapcCs|jS)z+Arithmetic mean of the normal distribution.�r��r�r&r&r'r�szNormalDist.meancCs|jS)z,Return the median of the normal distributionr�r�r&r&r'r�szNormalDist.mediancCs|jS)z�Return the mode of the normal distribution

        The mode is the value x where which the probability density
        function (pdf) takes its maximum value.
        r�r�r&r&r'r�szNormalDist.modecCs|jS)z.Standard deviation of the normal distribution.�r�r�r&r&r'r�szNormalDist.stdevcCs
|jdS)z!Square of the standard deviation.r�r�r�r&r&r'rszNormalDist.variancecCs8t|t�r&t|j|jt|j|j��St|j||j�S)ajAdd a constant or another NormalDist instance.

        If *other* is a constant, translate mu by the constant,
        leaving sigma unchanged.

        If *other* is a NormalDist, add both the means and the variances.
        Mathematically, this works only if the two distributions are
        independent or if they are jointly normally distributed.
        �rbrr�rr��r�r�r&r&r'�__add__	s

zNormalDist.__add__cCs8t|t�r&t|j|jt|j|j��St|j||j�S)asSubtract a constant or another NormalDist instance.

        If *other* is a constant, translate by the constant mu,
        leaving sigma unchanged.

        If *other* is a NormalDist, subtract the means and add the variances.
        Mathematically, this works only if the two distributions are
        independent or if they are jointly normally distributed.
        r�r�r&r&r'�__sub__s

zNormalDist.__sub__cCst|j||jt|��S)z�Multiply both mu and sigma by a constant.

        Used for rescaling, perhaps to change measurement units.
        Sigma is scaled with the absolute value of the constant.
        �rr�r�rr�r&r&r'�__mul__%szNormalDist.__mul__cCst|j||jt|��S)z�Divide both mu and sigma by a constant.

        Used for rescaling, perhaps to change measurement units.
        Sigma is scaled with the absolute value of the constant.
        r�r�r&r&r'�__truediv__-szNormalDist.__truediv__cCst|j|j�S)zReturn a copy of the instance.�rr�r��r�r&r&r'�__pos__5szNormalDist.__pos__cCst|j|j�S)z(Negates mu while keeping sigma the same.r�r�r&r&r'�__neg__9szNormalDist.__neg__cCs
||S)z<Subtract a NormalDist from a constant or another NormalDist.r&r�r&r&r'�__rsub__?szNormalDist.__rsub__cCs&t|t�stS|j|jko$|j|jkS)zFTwo NormalDist objects are equal if their mu and sigma are both equal.)rbr�NotImplementedr�r�r�r&r&r'�__eq__Es
zNormalDist.__eq__cCst|j|jf�S)zCNormalDist objects hash equal if their mu and sigma are both equal.)�hashr�r�r�r&r&r'�__hash__KszNormalDist.__hash__cCs t|�j�d|j�d|j�d�S)Nz(mu=z, sigma=�))r2r#r�r�r�r&r&r'�__repr__OszNormalDist.__repr__)r�r�)rs) r#r$r%�__doc__�	__slots__r��classmethodr�r�r�r�r�rr��propertyrrrrrr�r�r�r�r�r��__radd__r��__rmul__r�r�r�r&r&r&r'r�sF�


"




)r��__main__)�isclose)�add�sub�mul�truediv)�repeat�
�����i��z
Test z with another NormalDist:�z with a constant:�z
Test constant with �:cCsdSr)r&)�G1�G2r&r&r'�assert_closesr�i�����I��/g`@@cCsg|]}|t�qSr&��srar&r&r'r��sr�cCsg|]}|t�qSr&r�rar&r&r'r��scCsg|]}|t�qSr&r�rar&r&r'r��scCsg|]}|t�qSr&r�rar&r&r'r��scCsg|]\}}||�qSr&r&�r*rA�yr&r&r'r��scCsg|]\}}||�qSr&r&r�r&r&r'r��s)r)rX)r()N)N)N)N)N)Rr��__all__r@rcr�Z	fractionsrZdecimalr�	itertoolsrZbisectrrrrrrrrrr �operatorr!�collectionsr"rMrr>rBr0r.rPrTrWrZrrrrrr
r	rrrrrrrrr
r�rZ_statistics�ImportErrorr#r�r�r�r�r�r�ZdoctestZg1Zg2r,r�r�r��func�printr�r3Zconstr�r�r�r�rG�zipZtestmodr&r&r&r'�<module>s�S�(
: 

/
779

/
,

JQ






�
�
__pycache__/symbol.cpython-38.pyc000064400000004546151153537600012730 0ustar00U

��.e=�@s�dZdZdZdZdZdZdZdZdZd	Z	d
Z
dZdZd
Z
dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZd Z d!Z!d"Z"d#Z#d$Z$d%Z%d&Z&d'Z'd(Z(d)Z)d*Z*d+Z+d,Z,d-Z-d.Z.d/Z/d0Z0d1Z1d2Z2d3Z3d4Z4d5Z5d6Z6d7Z7d8Z8d9Z9d:Z:d;Z;d<Z<d=Z=d>Z>d?Z?d@Z@dAZAdBZBdCZCdDZDdEZEdFZFdGZGdHZHdIZIdJZJdKZKdLZLdMZMdNZNdOZOdPZPdQZQdRZRdSZSdTZTdUZUdVZVdWZWdXZXdYZYdZZZd[Z[d\Z\iZ]e^e_��`��D]$\ZaZbeceb�ecd]�k�r�eae]eb<�q�[a[bd^S)_z;Non-terminal symbols of Python grammar (from "graminit.h").�iiiiiiiii	i
iii
iiiiiiiiiiiiiiiiiii i!i"i#i$i%i&i'i(i)i*i+i,i-i.i/i0i1i2i3i4i5i6i7i8i9i:i;i<i=i>i?i@iAiBiCiDiEiFiGiHiIiJiKiLiMiNiOiPiQiRiSiTiUiViWiXiYiZi[�N)d�__doc__Zsingle_inputZ
file_inputZ
eval_inputZ	decoratorZ
decoratorsZ	decoratedZ
async_funcdefZfuncdefZ
parametersZ
typedargslistZtfpdefZvarargslistZvfpdefZstmtZsimple_stmtZ
small_stmtZ	expr_stmtZ	annassignZtestlist_star_exprZ	augassignZdel_stmtZ	pass_stmtZ	flow_stmtZ
break_stmtZ
continue_stmtZreturn_stmtZ
yield_stmtZ
raise_stmtZimport_stmtZimport_nameZimport_fromZimport_as_nameZdotted_as_nameZimport_as_namesZdotted_as_namesZdotted_nameZglobal_stmtZ
nonlocal_stmtZassert_stmtZ
compound_stmtZ
async_stmtZif_stmtZ
while_stmtZfor_stmtZtry_stmtZ	with_stmtZ	with_itemZ
except_clauseZsuiteZnamedexpr_testZtestZtest_nocondZlambdefZlambdef_nocondZor_testZand_testZnot_testZ
comparisonZcomp_opZ	star_expr�exprZxor_exprZand_exprZ
shift_exprZ
arith_exprZtermZfactorZpowerZ	atom_exprZatomZ
testlist_compZtrailerZ
subscriptlistZ	subscriptZsliceopZexprlistZtestlistZdictorsetmakerZclassdefZarglistZargumentZ	comp_iterZ
sync_comp_forZcomp_forZcomp_ifZ
encoding_declZ
yield_exprZ	yield_argZfunc_body_suiteZfunc_type_inputZ	func_typeZtypelistZsym_name�list�globals�items�_nameZ_value�type�r
r
�/usr/lib64/python3.8/symbol.py�<module>s�__pycache__/crypt.cpython-38.opt-1.pyc000064400000006475151153537600013526 0ustar00U

e5d�@s0dZddlZzddlZWn0ek
rHejdkr<ed��ned��YnXddlZddl	m
Zddlm
ZejejdZe�ZGd	d
�d
ed
d��Zd&dd�d
d�Zd'dd�ZgZdd�dd�Zedddd�edddd�dD](Zeddeddee�dd�r��qq�edd d!d"�ed#dd$d%�[[dS)(zEWrapper to the POSIX crypt library call and associated functionality.�NZwin32z,The crypt module is not supported on Windowsz;The required _crypt module was not built as part of CPython)�SystemRandom)�
namedtuplez./c@seZdZdZdd�ZdS)�_MethodziClass representing a salt method per the Modular Crypt Format or the
    legacy 2-character crypt method.cCsd�|j�S)Nz<crypt.METHOD_{}>)�format�name)�self�r�/usr/lib64/python3.8/crypt.py�__repr__sz_Method.__repr__N)�__name__�
__module__�__qualname__�__doc__r
rrrr	rsrz name ident salt_chars total_size��roundscCsB|dkrtd}|dk	r4t|t�s4t|jj�d���|js@d}nd|j�d�}|jr�|jddkr�|dkrpd}n@t�|d�}|d|>kr�td	��d
|kr�dks�ntd��||d
�d�7}n^|jdk�r|dk	�r d|kr�dks�ntd��|d|�d�7}n|dk	�r t|�d���|d�	dd�t
|j�D��7}|S)zsGenerate a salt for the specified method.

    If not specified, the strongest available method will be used.

    Nrz+ object cannot be interpreted as an integer��$�2��zrounds must be a power of 2��z%rounds out of the range 2**4 to 2**31Z02d)�5�6i�i�ɚ;z+rounds out of the range 1000 to 999_999_999zrounds=z$ doesn't support the rounds argumentcss|]}t�t�VqdS)N)�_srZchoice�
_saltchars)�.0�charrrr	�	<genexpr>Aszmksalt.<locals>.<genexpr>)�methods�
isinstance�int�	TypeError�	__class__rZident�
bit_length�
ValueError�join�rangeZ
salt_chars)�methodr�sZ
log_roundsrrr	�mksalts2

r*cCs&|dkst|t�rt|�}t�||�S)aRReturn a string representing the one-way hash of a password, with a salt
    prepended.

    If ``salt`` is not specified or is ``None``, the strongest
    available method will be selected and a salt generated.  Otherwise,
    ``salt`` may be one of the ``crypt.METHOD_*`` values, or a string as
    returned by ``crypt.mksalt()``.

    N)r rr*�_crypt�crypt)Zword�saltrrr	r,Es
r,cGsVt|f|��}|t�d|<t||d�}td|�}|rRt|�|jkrRt�|�dSdS)NZMETHOD_rrTF)r�globalsr*r,�lenZ
total_sizer�append)rr�argsr(r-�resultrrr	�_add_methodWs

r3ZSHA512r��jZSHA256r�?)�b�y�arZBLOWFISHr��;ZMD5�1��"ZCRYPT��
)N)N)r�sys�_sysr+�ModuleNotFoundError�platform�ImportError�stringZ_stringZrandomrZ
_SystemRandom�collectionsrZ_namedtupleZ
ascii_lettersZdigitsrrrr*r,rr3Z_vr/rrrr	�<module>s2

	&

__pycache__/colorsys.cpython-38.pyc000064400000006252151153537600013274 0ustar00U

e5d��@s\dZddddddgZdZdZd	Zd
d�Zdd�Zdd�Zd
d�Zdd�Z	dd�Z
dd�ZdS)aJConversion functions between RGB and other color systems.

This modules provides two functions for each color system ABC:

  rgb_to_abc(r, g, b) --> a, b, c
  abc_to_rgb(a, b, c) --> r, g, b

All inputs and outputs are triples of floats in the range [0.0...1.0]
(with the exception of I and Q, which covers a slightly larger range).
Inputs outside the valid range may cause exceptions or invalid outputs.

Supported color systems:
RGB: Red, Green, Blue components
YIQ: Luminance, Chrominance (used by composite video signals)
HLS: Hue, Luminance, Saturation
HSV: Hue, Saturation, Value
�
rgb_to_yiq�
yiq_to_rgb�
rgb_to_hls�
hls_to_rgb�
rgb_to_hsv�
hsv_to_rgbgUUUUUU�?gUUUUUU�?gUUUUUU�?cCsRd|d|d|}d||d||}d||d||}|||fS)Ng333333�?g�z�G��?g)\��(�?g�G�z��?gH�z�G�?g���Q��?g=
ףp=�?�)�r�g�b�y�i�qrr� /usr/lib64/python3.8/colorsys.pyr(scCs�|d|d|}|d|d|}|d|d|}|dkrHd}|dkrTd}|dkr`d}|dkrld}|dkrxd}|dkr�d}|||fS)	Ng2r��L�?g����,��?g:�����?g�nєW�?g6�޷���?gJ"�X�?���?r)rrr
rr	r
rrrr.s cCs�t|||�}t|||�}||d}||kr6d|dfS|dkrP||||}n||d||}||||}||||}||||}	||kr�|	|}
n"||kr�d||	}
nd||}
|
dd}
|
||fS)N�@r��?�@�@r��max�min)rr	r
�maxc�minc�l�s�rc�gc�bc�hrrrrKs$

cCsn|dkr|||fS|dkr(|d|}n||||}d||}t|||t�t|||�t|||t�fS)Nrrrr)�_v�	ONE_THIRD)rrr�m2�m1rrrrbs
cCsT|d}|tkr$||||dS|dkr0|S|tkrP|||t|dS|S)Nrrr)�	ONE_SIXTH�	TWO_THIRD)r#r"Zhuerrrr lsr cCs�t|||�}t|||�}|}||kr.dd|fS|||}||||}||||}||||}	||kr||	|}
n"||kr�d||	}
nd||}
|
dd}
|
||fS)Nrrrrrr)rr	r
rr�vrrrrrrrrr|s 

cCs�|dkr|||fSt|d�}|d|}|d|}|d||}|d|d|}|d}|dkrt|||fS|dkr�|||fS|dkr�|||fS|dkr�|||fS|d	kr�|||fS|d
kr�|||fSdS)Nrrr�������)�int)rrr&r�f�pr
�trrrr�s(





N)�__doc__�__all__r!r$r%rrrrr rrrrrr�<module>s�	
__pycache__/imaplib.cpython-38.opt-2.pyc000064400000065060151153537600013776 0ustar00U

e5df��*@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
m
Z
mZmZddl
mZzddlZdZWnek
r�dZYnXddd	d
ddgZd
ZdZdZdZdZdZdddddddddddddddddddddddddddddddddddddddddd�)Ze�d�Ze�d�Ze�d�Ze�dej�Ze�d�Z e�d�Z!e�d�Z"e�dej�Z#dZ$dZ%Gd d�d�Z&e�r�Gd!d"�d"e&�Z'e�(d"�Gd#d�de&�Z)Gd$d%�d%�Z*d&�+d'�Z,d(d)�e-e,d*d��D�Z.d+d	�Z/d,d
�Z0d-d�Z1d.d�Z2e3d/k�r�ddl4Z4ddl5Z5ze4�4ej6d*d�d0�\Z7Z8Wn.e4j9k
�rlZ:zd1\Z7Z8W5dZ:[:XYnXdZ;e7D]8\Z<Z:e<d2k�r�e=e:�Zne<d3k�rve:Z;e8�sve;fZ8�qve8�s�d4Z8e8dZ>e5�?�Z@e5�5d5e@e>�p�d6f�ZAd7e@d8d9�ZBd:e@eAffd;d<d=d>d?ddeBffd@dAdBdCdDdEdFdGdHfZCdIdJdKdLd>dddeBffdGdMfZDdNdO�ZE�ze;�r^e)e;�ZFne&e>�ZFeFjGdPk�r~eCd*d�ZCeF�HdQeFjI�eF�HdReFjJf�eCD]\ZKZ8eEeKe8��q�eEdSdT�D]<ZLe�MdUeL�ZNeN�r�eN�Od*�ZPneL�+�dVZPeEdWePf��q�eDD]T\ZKZ8eEeKe8�ZQeKe8fdKk�r*�qeQdV�+�ZReR�s@�qeEdXdYdZeRdVd[f��qeSd\�Wn.eSd]�e�s�eSd^ej6d��YnXdS)_z2.58�N)�datetime�timezone�	timedelta)�DEFAULT_BUFFER_SIZETF�IMAP4�IMAP4_stream�Internaldate2tuple�Int2AP�
ParseFlags�Time2Internaldate�
�i�)Z	IMAP4REV1ri@B)�AUTH�SELECTED)�NONAUTH)rrr�LOGOUT)r)r))�APPEND�AUTHENTICATE�
CAPABILITY�CHECK�CLOSE�COPY�CREATE�DELETE�	DELETEACL�ENABLE�EXAMINE�EXPUNGE�FETCH�GETACL�
GETANNOTATION�GETQUOTA�GETQUOTAROOT�MYRIGHTS�LIST�LOGINr�LSUBZMOVE�	NAMESPACE�NOOP�PARTIAL�	PROXYAUTH�RENAME�SEARCH�SELECT�SETACL�
SETANNOTATION�SETQUOTA�SORT�STARTTLS�STATUS�STORE�	SUBSCRIBE�THREAD�UID�UNSUBSCRIBEs\+( (?P<data>.*))?s.*FLAGS \((?P<flags>[^\)]*)\)s�.*INTERNALDATE "(?P<day>[ 0123][0-9])-(?P<mon>[A-Z][a-z][a-z])-(?P<year>[0-9][0-9][0-9][0-9]) (?P<hour>[0-9][0-9]):(?P<min>[0-9][0-9]):(?P<sec>[0-9][0-9]) (?P<zonen>[-+])(?P<zoneh>[0-9][0-9])(?P<zonem>[0-9][0-9])"s.*{(?P<size>\d+)}$s
\r\n|\r|\ns%\[(?P<type>[A-Z-]+)( (?P<data>.*))?\]s$\* (?P<type>[A-Z-]+)( (?P<data>.*))?s3\* (?P<data>\d+) (?P<type>[A-Z-]+)( (?P<data2>.*))?c@s�eZdZGdd�de�ZGdd�de�ZGdd�de�Zdefdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdefdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Z d:d;�Z!d<d=�Z"d>d?�Z#d@dA�Z$dBdC�Z%dDdE�Z&dFdG�Z'd�dJdK�Z(dLdM�Z)dNdO�Z*dPdQ�Z+dRdS�Z,d�dTdU�Z-dVdW�Z.dXdY�Z/dZd[�Z0d\d]�Z1d^d_�Z2d`da�Z3dbdc�Z4d�dfdg�Z5dhdi�Z6djdk�Z7dldm�Z8dndo�Z9d�dqdr�Z:dsdt�Z;dudv�Z<dwdx�Z=dydz�Z>d{d|�Z?d}d~�Z@dd��ZAd�d��ZBd�d��ZCd�d��ZDd�d��ZEd�d��ZFd�d��ZGd�d�d��ZHd�d��ZId�d��ZJd�d��ZKd�d��ZLd�d��ZMd�d��ZNdpS)�rc@seZdZdS)zIMAP4.errorN��__name__�
__module__�__qualname__�r=r=�/usr/lib64/python3.8/imaplib.py�error�sr?c@seZdZdS)zIMAP4.abortNr9r=r=r=r>�abort�sr@c@seZdZdS)zIMAP4.readonlyNr9r=r=r=r>�readonly�srA�cCs�t|_d|_d|_i|_i|_d|_d|_d|_d|_	|�
�|�||�z|��Wn8t
k
r�z|��Wntk
r�YnX�YnXdS)NrrBFr)�Debug�debug�state�literal�tagged_commands�untagged_responses�continuation_response�is_readonly�tagnum�_tls_established�_mode_ascii�open�_connect�	Exception�shutdown�OSError��self�host�portr=r=r>�__init__�s&zIMAP4.__init__cCs0d|_d|_t�ttj�|_t�ttj�|_dS)NF�ascii)	�utf8_enabled�	_encoding�re�compile�_Literal�ASCII�Literal�_Untagged_status�Untagged_status�rTr=r=r>rM�szIMAP4._mode_asciicCs(d|_d|_t�t�|_t�t�|_dS)NT�utf-8)rYrZr[r\r]r_r`rarbr=r=r>�
_mode_utf8�szIMAP4._mode_utf8cCs�tt�dd��|_t�d|jdtj�|_|�	�|_
d|jkrHd|_nd|jkrZd|_n|�
|j
��|��tD]}||jkr�qr||_dS|�
d	��dS)
Nii��s(?P<tag>s"\d+) (?P<type>[A-Z]+) (?P<data>.*)ZPREAUTHr�OKrzserver not IMAP4 compliant)r	�randomZrandint�tagprer[r\r^�tagre�__version__�
_get_responseZwelcomerHrEr?�_get_capabilities�AllowedVersions�capabilities�PROTOCOL_VERSION)rT�versionr=r=r>rO�s*���



zIMAP4._connectcCs&|tkrt||���Std|��dS)NzUnknown IMAP4 command: '%s')�Commands�getattr�lower�AttributeError)rT�attrr=r=r>�__getattr__	szIMAP4.__getattr__cCs|S�Nr=rbr=r=r>�	__enter__szIMAP4.__enter__cGs4|jdkrdSz|��Wntk
r.YnXdS�Nr)rE�logoutrR)rT�argsr=r=r>�__exit__s
zIMAP4.__exit__cCs4|js
dn|j}t�d||j|j�t�||jf�S)Nzimaplib.open)rU�sys�auditrV�socketZcreate_connection)rTrUr=r=r>�_create_socketszIMAP4._create_socketcCs(||_||_|��|_|j�d�|_dS)N�rb)rUrVr�sock�makefile�filerSr=r=r>rN's
z
IMAP4.opencCs|j�|�Srv)r��read�rT�sizer=r=r>r�3sz
IMAP4.readcCs.|j�td�}t|�tkr*|�dt��|S)N�zgot more than %d bytes)r��readline�_MAXLINE�lenr?�rT�liner=r=r>r�8szIMAP4.readlinecCst�d||�|j�|�dS)Nzimaplib.send)r|r}r�Zsendall�rT�datar=r=r>�send@sz
IMAP4.sendc
Cst|j��zXz|j�tj�Wn@tk
r^}z"|jtjkrNt	|dd�dkrN�W5d}~XYnXW5|j��XdS)NZwinerrorri&')
r��closer�rQr~Z	SHUT_RDWRrR�errnoZENOTCONNrq)rT�excr=r=r>rQFs
�zIMAP4.shutdowncCs|jSrv)r�rbr=r=r>r~VszIMAP4.socketcCsBd}|�ddg|�\}}|dr(||fS|��\}}|�|||�S)NZRECENTre���)�_untagged_response�noop�rT�name�typ�datr=r=r>�recentbs	zIMAP4.recentcCs|�|dg|���Srv)r��upper)rT�coder=r=r>�responsesszIMAP4.responsecCsxd}|sd}|r.|d|dfdkr2d|}nd}|r@t|�}nd}t�t|�}|jrbd|d}||_|�||||�S)	Nr�INBOXrr���(�)�(%s)sUTF8 (�))r�MapCRLF�sub�CRLFrYrF�_simple_command)rT�mailbox�flags�	date_time�messager�rFr=r=r>�append�s

zIMAP4.appendcCsP|��}t|�j|_|�d|�\}}|dkrB|�|d�dd���d|_||fS)Nrrer�rc�replacer)r��_Authenticator�processrFr�r?�decoderE)rTZ	mechanismZ
authobject�mechr�r�r=r=r>�authenticate�szIMAP4.authenticatecCs d}|�|�\}}|�|||�S)Nr�r�r�r�r=r=r>�
capability�szIMAP4.capabilitycCs
|�d�S)Nr�r�rbr=r=r>�check�szIMAP4.checkcCs$z|�d�\}}W5d|_X||fS)Nrr)rEr��rTr�r�r=r=r>r��szIMAP4.closecCs|�d||�S)Nrr�)rT�message_setZnew_mailboxr=r=r>�copy�sz
IMAP4.copycCs|�d|�S)Nrr��rTr�r=r=r>�create�szIMAP4.createcCs|�d|�S)Nrr�r�r=r=r>�delete�szIMAP4.deletecCs|�d||�S)Nrr�)rTr��whor=r=r>�	deleteacl�szIMAP4.deleteaclcCsHd|jkrt�d��|�d|�\}}|dkr@d|��kr@|��||fS)NrzServer does not support ENABLErezUTF8=ACCEPT)rmrr?r�r�rd)rTr�r�r�r=r=r>�enable�s

zIMAP4.enablecCs d}|�|�\}}|�|||�S)Nrr�r�r=r=r>�expunges	z
IMAP4.expungecCs$d}|�|||�\}}|�|||�S)Nrr�)rTr�Z
message_partsr�r�r�r=r=r>�fetchs
zIMAP4.fetchcCs|�d|�\}}|�||d�S)NrZACLr��rTr�r�r�r=r=r>�getaclszIMAP4.getaclcCs"|�d|||�\}}|�||d�S)Nr �
ANNOTATIONr�)rTr��entryZ	attributer�r�r=r=r>�
getannotation(szIMAP4.getannotationcCs|�d|�\}}|�||d�S)Nr!�QUOTAr�)rT�rootr�r�r=r=r>�getquota0szIMAP4.getquotacCs@|�d|�\}}|�||d�\}}|�||d�\}}|||gfS)Nr"r�Z	QUOTAROOTr�)rTr�r�r�ZquotaZ	quotarootr=r=r>�getquotaroot;szIMAP4.getquotaroot�""�*cCs$d}|�|||�\}}|�|||�S)Nr$r��rTZ	directory�patternr�r�r�r=r=r>�listFsz
IMAP4.listcCs<|�d||�|��\}}|dkr.|�|d��d|_||fS)Nr%rer�r)r��_quoter?rE)rT�user�passwordr�r�r=r=r>�loginRs
zIMAP4.logincCs|||_|_|�d|j�S)NzCRAM-MD5)r�r�r��_CRAM_MD5_AUTH)rTr�r�r=r=r>�login_cram_md5`szIMAP4.login_cram_md5cCsBddl}t|jt�r |j�d�n|j}|jd|�||d���S)Nrrc� Zmd5)�hmac�
isinstancer��str�encoder�ZHMACZ	hexdigest)rTZ	challenger��pwdr=r=r>r�is
�zIMAP4._CRAM_MD5_AUTHcCs$d|_|�d�\}}|��||fSrx)rEr�rQr�r=r=r>ryqszIMAP4.logoutcCs$d}|�|||�\}}|�|||�S)Nr&r�r�r=r=r>�lsub~sz
IMAP4.lsubcCs|�d|�\}}|�||d�S)Nr#r�r�r=r=r>�myrights�szIMAP4.myrightscCs d}|�|�\}}|�|||�S)Nr'r�r�r=r=r>�	namespace�szIMAP4.namespacecCs
|�d�S)Nr(r�rbr=r=r>r��sz
IMAP4.noopcCs(d}|�|||||�\}}|�||d�S)Nr)rr�)rTZmessage_numZmessage_part�startZlengthr�r�r�r=r=r>�partial�sz
IMAP4.partialcCsd}|�d|�S)Nr*r�)rTr�r�r=r=r>�	proxyauth�s	zIMAP4.proxyauthcCs|�d||�S)Nr+r�)rTZ
oldmailboxZ
newmailboxr=r=r>�rename�szIMAP4.renamecGsTd}|r2|jrt�d��|j|d|f|��\}}n|j|f|��\}}|�|||�S)Nr,z'Non-None charset not valid in UTF8 mode�CHARSET)rYrr?r�r�)rT�charsetZcriteriar�r�r�r=r=r>�search�s
zIMAP4.searchr�FcCsvi|_||_|rd}nd}|�||�\}}|dkr@d|_||fSd|_d|jkrb|sb|�d|��||j�ddg�fS)	Nrr-rerr�	READ-ONLYz%s is not writable�EXISTS)rHrJr�rErA�get)rTr�rAr�r�r�r=r=r>�select�s
�zIMAP4.selectcCs|�d|||�S)Nr.r�)rTr�r�Zwhatr=r=r>�setacl�szIMAP4.setaclcGs |jd|��\}}|�||d�S)Nr/r�)r/r�)rTrzr�r�r=r=r>�
setannotationszIMAP4.setannotationcCs |�d||�\}}|�||d�S)Nr0r�r�)rTr�Zlimitsr�r�r=r=r>�setquota	szIMAP4.setquotacGsFd}|d|dfdkr d|}|j|||f|��\}}|�|||�S)Nr1rr�r�r�r�)rTZ
sort_criteriar��search_criteriar�r�r�r=r=r>�sorts
z
IMAP4.sortNcCs�d}ts|�d��|jr"|�d��||jkr6|�d��|dkrFt��}|�|�\}}|dkr�|j|j	|j
d�|_	|j	�d�|_d|_|�
�n
|�d	��|�|||�S)
Nr2zSSL support missingzTLS session already establishedzTLS not supported by serverre�Zserver_hostnamer�TzCouldn't establish TLS session)�HAVE_SSLr?rLr@rm�ssl�_create_stdlib_contextr��wrap_socketr�rUr�r�rkr�)rT�ssl_contextr�r�r�r=r=r>�starttls s&



�

zIMAP4.starttlscCs$d}|�|||�\}}|�|||�S)Nr3r�)rTr��namesr�r�r�r=r=r>�status7szIMAP4.statuscCs>|d|dfdkrd|}|�d|||�\}}|�||d�S)Nrr�r�r�r4rr�)rTr��commandr�r�r�r=r=r>�storeCszIMAP4.storecCs|�d|�S)Nr5r�r�r=r=r>�	subscribeNszIMAP4.subscribecGs*d}|j|||f|��\}}|�|||�S)Nr6r�)rTZthreading_algorithmr�r�r�r�r�r=r=r>�threadVszIMAP4.threadc	Gs�|��}|tkr|�d|��|jt|krL|�d||jd�t|�f��d}|j||f|��\}}|dkrt|}nd}|�|||�S)NzUnknown IMAP4 UID command: %s�9command %s illegal in state %s, only allowed in states %s�, r7)r,r1r6r)r�rpr?rE�joinr�r�)rTr�rzr�r�r�r=r=r>�uid`s��z	IMAP4.uidcCs|�d|�S)Nr8r�r�r=r=r>�unsubscribeyszIMAP4.unsubscribecGs,|��}|tkr|jft|<|j|f|��Srv)r�rprEr��rTr�rzr=r=r>�xatom�s
zIMAP4.xatomcCs8|dkrd}|j}||kr*||�|�n
|g||<dS�N�)rHr�r�)rTr�r�Zurr=r=r>�_append_untagged�szIMAP4._append_untaggedcCs,|j�d�}|r(|�|d�|jd���dS)N�BYEr�r�)rHr�r@r�rZ)rT�byer=r=r>�
_check_bye�szIMAP4._check_byec

Gs�|jt|kr4d|_|�d||jd�t|�f��dD]}||jkr8|j|=q8d|jkrj|jsj|�d��|��}t	||j
�}|d|}|D]0}|dkr�q�t|t�r�t	||j
�}|d|}q�|j}|dk	�r
d|_t
|�t
|j�kr�|}nd}|t	dt|�|j
�}z|�|t�Wn2tk
�rN}	z|�d|	��W5d}	~	XYnX|dk�r^|S|���r||j|�r^|S�q^|�r�||j�}z|�|�|�t�Wn2tk
�r�}	z|�d|	��W5d}	~	XYnX|�s^�q�q^|S)	Nr�r��re�NO�BADr�z#mailbox status changed to READ-ONLY� z {%s}zsocket error: %s)rErprFr?r�rHrJrA�_new_tag�bytesrZr�r��type�_commandr�r�r�rRr@rjrGrI)
rTr�rzr��tagr��argrFZ	literator�valr=r=r>r�sb��


�


 



 zIMAP4._commandc
Cs�|dk}|s|��z|j||d�\}}Wnj|jk
r`}z|�d||f��W5d}~XYn6|jk
r�}z|�d||f��W5d}~XYnX|s�|��|dkr�|�d|||f��||fS)Nr)�
expect_byezcommand: %s => %srz%s command error: %s %s)r�_get_tagged_responser@r?)rTr�rryr�r�rr=r=r>�_command_complete�s"$zIMAP4._command_completecCsJ|��\}}|dgkr |�d��t|d|j�}|��}t|���|_dS)Nz"no CAPABILITY response from serverr�)r�r?r�rZr��tuple�splitrmr�r=r=r>rk
s

zIMAP4._get_capabilitiescCs�|��}|�|j|�rp|j�d�}||jkr:|�d|��|j�d�}t||j�}|j�d�}||gf|j|<n�d}|�t	|�s�|�|j
|�r�|j�d�}|jdkr�|�t|�r�|j�d�|_dS|�d|��|j�d�}t||j�}|j�d�}|dk�rd}|�r|d|}|�|j
|��rZt|j�d	��}|�|�}|�|||f�|��}�q|�||�|d
k�r�|�t|��r�|j�d�}t||j�}|�||j�d��|S)Nrzunexpected tagged response: %rrr�Zdata2zunexpected response: %rrrr�r	)�	_get_line�_matchrh�mo�grouprGr@r�rZ�Untagged_responsera�ContinuationrIr_�intr�r�
Response_code)rT�resprr�r�Zdat2r�r�r=r=r>rjsH



zIMAP4._get_responsec
Cs�|j|}|dk	r|j|=|S|rDd}|j�|d�}|dk	rD||fS|��z|��Wq|jk
r~}z�W5d}~XYqXqdS)Nr)rGrH�poprrjr@)rTrr�resultr�rrr=r=r>rcs
zIMAP4._get_tagged_responsecCs>|��}|s|�d��|�d�s.|�d|��|dd�}|S)Nzsocket error: EOFrz#socket error: unterminated line: %r���)r�r@�endswithr�r=r=r>r�s

zIMAP4._get_linecCs|�|�|_|jdk	Srv)�matchr)rTZcre�sr=r=r>r�szIMAP4._matchcCs2|jtt|j�|j�}|jd|_d|j|<|S)Nr�)rgrr�rKrZrG)rTrr=r=r>r
�s
zIMAP4._new_tagcCs$|�dd�}|�dd�}d|dS)N�\z\\�"z\")r�)rTrr=r=r>r��szIMAP4._quotecGs|�||j|f|���Srv)rrrr=r=r>r��szIMAP4._simple_commandcCs8|dkr||fS||jkr$|dgfS|j�|�}||fS)Nr
)rHr")rTr�r�r�r�r=r=r>r��s

zIMAP4._untagged_response)r�r�)r�r�)r�F)N)F)Sr:r;r<rPr?r@rA�
IMAP4_PORTrWrMrdrOrurwr{rrNr�r�r�rQr~r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�ryr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrkrjrrrr
r�r�r��_mesgZ_dump_urZ_logZ	print_logr=r=r=r>r�s�.*
		
	



 	

M	P
!$c@s6eZdZdedddfdd�Zdd�Zdefdd�ZdS)	�	IMAP4_SSLrBNcCs�|dk	r|dk	rtd��|dk	r0|dk	r0td��|dk	s@|dk	rVddl}|�dtd�||_||_|dkrxtj||d�}||_t	�
|||�dS)Nz8ssl_context and keyfile arguments are mutually exclusivez9ssl_context and certfile arguments are mutually exclusiverzEkeyfile and certfile are deprecated, use a custom ssl_context instead�)�certfile�keyfile)�
ValueError�warnings�warn�DeprecationWarningr/r.r�r�r�rrW)rTrUrVr/r.r�r1r=r=r>rW�s$��zIMAP4_SSL.__init__cCst�|�}|jj||jd�S)Nr�)rrr�r�rU)rTr�r=r=r>rs
�zIMAP4_SSL._create_socketcCst�|||�dSrv)rrNrSr=r=r>rNszIMAP4_SSL.open)r:r;r<�IMAP4_SSL_PORTrWrrNr=r=r=r>r,�s�
r,c@s>eZdZdd�Zddd�Zdd�Zdd	�Zd
d�Zdd
�ZdS)rcCs||_t�|�dSrv)r�rrW)rTr�r=r=r>rW/szIMAP4_stream.__init__NcCsNd|_d|_d|_d|_tj|jttjtjddd�|_	|j	j
|_|j	j|_
dS)NT)�bufsize�stdin�stdout�shellZ	close_fds)rUrVr�r��
subprocess�Popenr�r�PIPEr�r6�	writefiler7�readfilerSr=r=r>rN4s�
zIMAP4_stream.opencCs|j�|�Srv)r=r�r�r=r=r>r�DszIMAP4_stream.readcCs
|j��Srv)r=r�rbr=r=r>r�IszIMAP4_stream.readlinecCs|j�|�|j��dSrv)r<�write�flushr�r=r=r>r�NszIMAP4_stream.sendcCs"|j��|j��|j��dSrv)r=r�r<r��waitrbr=r=r>rQTs

zIMAP4_stream.shutdown)NN)	r:r;r<rWrNr�r�r�rQr=r=r=r>r#s
c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
r�cCs
||_dSrv)r�)rTZmechinstr=r=r>rWbsz_Authenticator.__init__cCs&|�|�|��}|dkrdS|�|�S)N�*)r�r�r�)rTr�Zretr=r=r>r�esz_Authenticator.processcCsnd}t|t�r|�d�}|rjt|�dkrB|dd�}|dd�}n|}d}t�|�}|r||dd�}q|S)Nrrc�0r�)r�r�r�r��binasciiZ
b2a_base64)rT�inpZoup�t�er=r=r>r�ks	


z_Authenticator.encodecCs|sdSt�|�Sr)rCZ
a2b_base64)rTrDr=r=r>r��sz_Authenticator.decodeN)r:r;r<rWr�r�r�r=r=r=r>r�\sr�z0 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Decr�cCsi|]\}}|��|d�qS)r�)r�)�.0�nr'r=r=r>�
<dictcomp>�srIr�c	Cs�t�|�}|sdSt|�d�}|�d�}t|�d��}t|�d��}t|�d��}t|�d��}t|�d��}t|�d��}	t|�d	��}
|	d
|
d
}|dkr�|}||||||dddf	}t�|�|}
t�|
�S)
N�mon�zonen�day�year�hour�min�sec�zoneh�zonem�<�-r�)	�InternalDater&�Mon2numrr�calendarZtimegm�time�	localtime)r!rrJrKrLrMrNrOrPrQrRZzoneZtt�utcr=r=r>r�s$

cCs@d}d}tt|��}|r<t|d�\}}|||d�|}q|S)NrsABCDEFGHIJKLMNOP�r�)r�abs�divmod)ZnumrZAP�modr=r=r>r	�scCs$t�|�}|sdSt|�d����S)Nr=r�)�Flagsr&rrr)r!rr=r=r>r
�s
cCst|ttf�r"t�|tj���}n�t|t�r�z
|j	}WnZt
k
r�tjr�|d}|dkrpt�
t�|��d}tjtjf|}ntj}YnXt|d�}t|dd�dt|�i�}nLt|t�r�|jdkr�td��|}n*t|t�r�|d|dfdkr�|Std	��d
�t|j�}|�|�S)N�r�)Zseconds��tzinfozdate_time must be awarer)r)r)zdate_time not of a known typez"%d-{}-%Y %H:%M:%S %z")r�r�floatrZ
fromtimestamprrZZ
astimezoner�	tm_gmtoffrsrX�daylightrY�mktime�altzonerrbr0r��format�MonthsZmonth�strftime)r�ZdtZgmtoffZdstZdeltaZfmtr=r=r>r�s2�





�__main__zd:s:)r=r=z-dz-s)rBzIMAP password for %s on %s: Z	localhostzJFrom: %(user)s@localhost%(lf)sSubject: IMAP4 test%(lf)s%(lf)sdata...%(lf)s�
)r�Zlfr�)r�)�
/tmp/xxx 1)r�)rmz/tmp/yyy)r��
/tmp/yyz 2r�ro)r�)z/tmpzyy*)r�rn)r�)NZSUBJECTZtest)r�)�1z(FLAGS INTERNALDATE RFC822))r�)rp�FLAGSz
(\Deleted))r�r=)r�r=)r�r=)r�r=)r�r=)r�)ZUIDVALIDITY)r�)r,ZALL)r�)r�)ryr=cCsLt�d||f�tt|�|�\}}t�d|||f�|dkrH|d�|S)Nz%s %sz%s => %s %sr
r)�Mr+rq)�cmdrzr�r�r=r=r>�run'srtrzPROTOCOL_VERSION = %szCAPABILITIES = %rr�)z/tmp/zyy%z.*"([^"]+)"$r�r�r�rz%sz:(FLAGS INTERNALDATE RFC822.SIZE RFC822.HEADER RFC822.TEXT)z
All tests OK.z
Tests failed.z8
If you would like to see debugging output,
try: %s -d5
)TrirCr�rfr[r~r9r|rXrWrrr�iorr�r��ImportError�__all__r�rCr*r4rlr�rpr\rr_rUr^r_r�r rrar]r`rr,r�rr�rri�	enumeraterVrr	r
rr:ZgetoptZgetpass�argvZoptlistrzr?rZstream_command�optrrUZgetuserZUSERZPASSWDZ	test_mesgZ	test_seq1Z	test_seq2rtrrrEr+rnrmrsZmlr&rr�pathr�r��printr=r=r=r>�<module>sXH
�	�/



	

�l4
9,
#
)





��


�
�__pycache__/functools.cpython-38.opt-2.pyc000064400000051402151153537600014370 0ustar00U

e5d��
@s�dddddddddd	d
ddg
Zd
dlmZd
dlmZd
dlmZd
dlmZdZ	dZ
e	e
fdd�Ze	e
fdd�Ze
fdd�Ze
fdd�Ze
fdd�Ze
fdd�Ze
fdd�Ze
fd d!�Ze
fd"d#�Ze
fd$d%�Ze
fd&d'�Ze
fd(d)�Ze
fd*d+�Ze
fd,d-�Zd.efd/efd0efgd0efd1efd.efgd1efd0efd/efgd/efd.efd1efgd2�Zd3d�Zd4d�Zzd
d5lmZWnek
�r�YnXe�Z e fd6d�Z!zd
d7lm!Z!Wnek
�r�YnXGd8d�d�Z"zd
d9lm"Z"Wnek
�r�YnXGd:d	�d	e�Z#d;d<�Z$ed=d>d?d@dAg�Z%GdBdC�dCe&�Z'e�fe(e)he*e+e,fdDdE�Z-dXdHd�Z.dIdJ�Z/zd
dKlm/Z/Wnek
�r�YnXdLdM�Z0dYdOdP�Z1dQdR�Z2dSdT�Z3dUd
�Z4GdVd�d�Z5e�Z6GdWd�d�Z7dNS)Z�update_wrapper�wraps�WRAPPER_ASSIGNMENTS�WRAPPER_UPDATES�total_ordering�
cmp_to_key�	lru_cache�reduce�partial�
partialmethod�singledispatch�singledispatchmethod�cached_property�)�get_cache_token)�
namedtuple)�recursive_repr)�RLock)�
__module__�__name__�__qualname__�__doc__�__annotations__)�__dict__c	Csf|D]4}zt||�}Wntk
r*YqXt|||�q|D]}t||��t||i��q>||_|S�N)�getattr�AttributeError�setattr�update�__wrapped__)�wrapper�wrapped�assigned�updated�attr�value�r%�!/usr/lib64/python3.8/functools.pyr"scCstt|||d�S)N�r r!r")r	rr'r%r%r&r@s�cCs$|�|�}||kr|S|o"||kSr��__lt__��self�other�NotImplemented�	op_resultr%r%r&�_gt_from_ltXs
r/cCs|�|�}|p||kSrr(r*r%r%r&�_le_from_lt_s
r0cCs|�|�}||kr|S|Srr(r*r%r%r&�_ge_from_ltds
r1cCs$|�|�}||kr|S|p"||kSr��__le__r*r%r%r&�_ge_from_leks
r4cCs"|�|�}||kr|S|o ||kSrr2r*r%r%r&�_lt_from_lers
r5cCs|�|�}||kr|S|Srr2r*r%r%r&�_gt_from_leys
r6cCs$|�|�}||kr|S|o"||kSr��__gt__r*r%r%r&�_lt_from_gt�s
r9cCs|�|�}|p||kSrr7r*r%r%r&�_ge_from_gt�s
r:cCs|�|�}||kr|S|Srr7r*r%r%r&�_le_from_gt�s
r;cCs$|�|�}||kr|S|p"||kSr��__ge__r*r%r%r&�_le_from_ge�s
r>cCs"|�|�}||kr|S|o ||kSrr<r*r%r%r&�_gt_from_ge�s
r?cCs|�|�}||kr|S|Srr<r*r%r%r&�_lt_from_ge�s
r@r8r3r=r))r)r3r8r=csV�fdd�tD�}|std��t|�}t|D]"\}}||kr.||_t�||�q.�S)Ncs(h|] }t�|d�tt|d�k	r|�qSr)r�object)�.0�op��clsr%r&�	<setcomp>�sz!total_ordering.<locals>.<setcomp>z6must define at least one ordering operation: < > <= >=)�_convert�
ValueError�maxrr)rE�roots�root�opname�opfuncr%rDr&r�scsG�fdd�dt�}|S)NcsZeZdZdgZdd�Z�fdd�Z�fdd�Z�fdd	�Z�fd
d�Z�fdd
�Z	dZ
dS)zcmp_to_key.<locals>.K�objcSs
||_dSr�rN)r+rNr%r%r&�__init__�szcmp_to_key.<locals>.K.__init__cs�|j|j�dkS�NrrO�r+r,��mycmpr%r&r)�szcmp_to_key.<locals>.K.__lt__cs�|j|j�dkSrQrOrRrSr%r&r8�szcmp_to_key.<locals>.K.__gt__cs�|j|j�dkSrQrOrRrSr%r&�__eq__�szcmp_to_key.<locals>.K.__eq__cs�|j|j�dkSrQrOrRrSr%r&r3�szcmp_to_key.<locals>.K.__le__cs�|j|j�dkSrQrOrRrSr%r&r=�szcmp_to_key.<locals>.K.__ge__N)rrr�	__slots__rPr)r8rUr3r=�__hash__r%rSr%r&�K�srX)rA)rTrXr%rSr&r�s)rcCsZt|�}|tkr>zt|�}WqBtk
r:td�d�YqBXn|}|D]}|||�}qF|S)Nz0reduce() of empty sequence with no initial value)�iter�_initial_missing�next�
StopIteration�	TypeError)ZfunctionZsequence�initial�itr$Zelementr%r%r&r�s)rcsFeZdZdZ�fdd�Zdd�Ze�dd��Zdd	�Zd
d�Z	�Z
S)r	)�func�args�keywordsr�__weakref__csZt|�std��t|d�r4|j|}|j|�}|j}tt|��|�}||_||_||_|S)Nz#the first argument must be callabler`)	�callabler]�hasattrrarbr`�superr	�__new__)rEr`rarbr+��	__class__r%r&rgs


zpartial.__new__cOs|j|�}|j|j|�|�Sr�rbr`ra)r+rarbr%r%r&�__call__%s
zpartial.__call__cCs�t|�j}t|j�g}|�dd�|jD��|�dd�|j��D��t|�jdkrld|�dd�	|��d�S|�dd�	|��d�S)	Ncss|]}t|�VqdSr)�repr)rB�xr%r%r&�	<genexpr>-sz#partial.__repr__.<locals>.<genexpr>css |]\}}|�d|��VqdS)�=Nr%�rB�k�vr%r%r&rn.s�	functoolsz
functools.�(�, �))
�typerrlr`�extendrarb�itemsr�join)r+�qualnamerar%r%r&�__repr__)s
zpartial.__repr__cCs*t|�|jf|j|j|jpd|jp$dffSr)rwr`rarbr�r+r%r%r&�
__reduce__3s�zpartial.__reduce__cCs�t|t�std��t|�dkr0tdt|�����|\}}}}t|�rrt|t�rr|dk	r`t|t�rr|dk	rzt|t�sztd��t|�}|dkr�i}nt|�tk	r�t|�}|dkr�i}||_||_||_	||_
dS)Nz(argument to __setstate__ must be a tuple�zexpected 4 items in state, got zinvalid partial state)�
isinstance�tupler]�lenrd�dictrwrr`rarb)r+�stater`ra�kwds�	namespacer%r%r&�__setstate__7s4
����zpartial.__setstate__)rrrrVrgrkrr|r~r��
__classcell__r%r%rhr&r	s
	)r	c@s@eZdZdd�Zde_dd�Zdd�Zd
d	d
�Zedd��Z	dS)r
cOs�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��t|�}t|�s�t|d	�s�td
�	|���t
|t�r�|j|_|j
||_
|j|�|_n||_||_
||_dS)N�z8descriptor '__init__' of partialmethod needs an argumentr`rz0Passing 'func' as keyword argument is deprecated)�
stacklevelz8type 'partialmethod' takes at least one argument, got %d��__get__z${!r} is not callable or a descriptor)r�r]�pop�warnings�warn�DeprecationWarningr�rdre�formatr�r
r`rarb)rarbr+r`r�r%r%r&rP]s6

�
��
zpartialmethod.__init__z#($self, func, /, *args, **keywords)cCsNd�tt|j��}d�dd�|j��D��}d}|j|jj|jj	|j
||d�S)Nrucss|]\}}d�||�VqdS)z{}={!r}N)r�rpr%r%r&rn�s�z)partialmethod.__repr__.<locals>.<genexpr>z*{module}.{cls}({func}, {args}, {keywords}))�modulerEr`rarb)rz�maprlrarbryr�rirrr`)r+rarb�
format_stringr%r%r&r|�s
�
�zpartialmethod.__repr__cs�fdd�}�j|_�|_|S)Ncs �j|�}�j|f�j|�|�Srrj)�cls_or_selfrarbr}r%r&�_method�s
z3partialmethod._make_unbound_method.<locals>._method)�__isabstractmethod__�_partialmethod)r+r�r%r}r&�_make_unbound_method�sz"partialmethod._make_unbound_methodNcCs�t|jdd�}d}|dk	rd|||�}||jk	rdt|f|j�|j�}z|j|_Wntk
rbYnX|dkr||���||�}|S)Nr�)	rr`r	rarb�__self__rr�r�)r+rNrE�get�result�new_funcr%r%r&r��s

zpartialmethod.__get__cCst|jdd�S�Nr�F�rr`r}r%r%r&r��sz"partialmethod.__isabstractmethod__)N)
rrrrP�__text_signature__r|r�r��propertyr�r%r%r%r&r
Us"
cCst|t�r|j}q|Sr)r�r	r`�r`r%r%r&�_unwrap_partial�s
r��	CacheInfo�hits�misses�maxsize�currsizec@s$eZdZdZefdd�Zdd�ZdS)�
_HashedSeq�	hashvaluecCs||dd�<||�|_dSr�r�)r+�tup�hashr%r%r&rP�sz_HashedSeq.__init__cCs|jSrr�r}r%r%r&rW�sz_HashedSeq.__hash__N)rrrrVr�rPrWr%r%r%r&r��sr�c
s�|}|r&||7}|��D]}	||	7}q|rh||�fdd�|D��7}|r�||�fdd�|��D��7}n$||�dkr��|d�|kr�|dSt|�S)Nc3s|]}�|�VqdSrr%�rBrr�rwr%r&rn�sz_make_key.<locals>.<genexpr>c3s|]}�|�VqdSrr%r�r�r%r&rn�sr�r)ry�valuesr�)
rar��typed�kwd_mark�	fasttypesr�rwr��key�itemr%r�r&�	_make_key�s
 r��Fcsnt�t�r�dkr\d�nDt��rLt�t�rL�d}�t|��t�}t||�S�dk	r\td����fdd�}|S)Nrr�z=Expected first argument to be an integer, a callable, or Nonecst|��t�}t||�Sr)�_lru_cache_wrapper�
_CacheInfor)�
user_functionr�r�r�r%r&�decorating_function
sz&lru_cache.<locals>.decorating_function)r��intrd�boolr�r�rr])r�r�r�rr�r%r�r&r�s


�cs�t��t�d\����i�d�	�
d��j��j�t��
g���ddg�dd�<�dkrh�
�fdd�}nN�dkr����	��
���fdd�}n*���������	�
���
���fdd�}���	�
��
fdd	�}���	�
�
�fd
d�}||_||_|S)N)rr�r��rFcs�d7��||�}|S�Nr�r%)rar�r�)r�r�r%r&r$s
z#_lru_cache_wrapper.<locals>.wrappercsH�||��}�|��}|�k	r*�d7�|S�d7��||�}|�|<|Sr�r%)rar�r�r�)�cache�	cache_getr��make_keyr��sentinelr�r�r%r&r-s

c
s>�
||��}�	�z�|�}|dk	r~|\}}}}||�<||�<�
�}||�<�
�<||�<�
|�<�d7�|W5QR�S�d7�W5QRX�||�}�	��|�kr�n��r��
}	||	�<||	�<|	��
�
�}
�
�}d�
�<�
�<�|
=|	�|<n6�
�}|�
||g}||�<�
�<�|<���k�W5QRX|Sr�r%)rar�r��linkZ	link_prevZ	link_nextZ_keyr�ZlastZoldrootZoldkeyZ	oldresult)�KEY�NEXT�PREV�RESULTr�r��	cache_len�fullr��lockr�r�r�rKr�r�r%r&r<sB

c
s,���������W5QR�SQRXdSrr%r%)r�r�r�r�r�r�r%r&�
cache_infousz&_lru_cache_wrapper.<locals>.cache_infoc	s<��.�����ddg�dd�<d��d�W5QRXdS)NrF)�clearr%)r�r�r�r�r�rKr%r&�cache_clearzs
z'_lru_cache_wrapper.<locals>.cache_clear)rAr�r��__len__rr�r�)r�r�r�r�rr�r�r%)r�r�r�r�r�r�r�r�r�r�r�r�r�r�rKr�r�r�r&r�s**9	r�)r�cCs�g}dd�|D�}|s|S|D]2}|d}|D]}||dd�kr.d}qq.qRq|dkrbtd��|�|�|D]}|d|krp|d=qpqdS)NcSsg|]}|r|�qSr%r%�rB�sr%r%r&�
<listcomp>�sz_c3_merge.<locals>.<listcomp>rr�zInconsistent hierarchy)�RuntimeError�append)�	sequencesr��s1�	candidate�s2�seqr%r%r&�	_c3_merge�s"
r�Nc
stt|j��D]$\}�t�d�rt|j�|}q8qd}�rDt��ng�t|jd|��}g}t|j|d��}�D]0�t|��rtt�fdd�|jD��st|���qt|D]���	��q��fdd�|D�}�fdd�|D�}�fdd�|D�}	t
|gg|||	|g|g|g�S)	N�__abstractmethods__rc3s|]}t|��VqdSr)�
issubclass)rB�b)�baser%r&rn�sz_c3_mro.<locals>.<genexpr>csg|]}t|�d��qS���abcs��_c3_mro�rBr�r�r%r&r��sz_c3_mro.<locals>.<listcomp>csg|]}t|�d��qSr�r�r�r�r%r&r��scsg|]}t|�d��qSr�r�r�r�r%r&r��s)�	enumerate�reversed�	__bases__rer��listr��anyr��remover�)
rEr��i�boundary�explicit_bases�abstract_bases�other_bases�explicit_c3_mros�abstract_c3_mros�
other_c3_mrosr%)r�r�r&r��sD
��������r�cs�t�j����fdd���fdd��D���fdd���fdd��D��t���g}�D]�}g}|��D]0}|�krht�|�rh|��fdd�|jD��qh|s�|�|�qX|jtd	d
�|D] }|D]}||kr�|�|�q�q�qXt�|d�S)Ncs|�kot|d�ot�|�S)N�__mro__)rer�)�typ)�basesrEr%r&�
is_related�s�z _compose_mro.<locals>.is_relatedcsg|]}�|�r|�qSr%r%�rB�n)r�r%r&r��sz _compose_mro.<locals>.<listcomp>cs&�D]}||kr||jkrdSqdS)NTF)r�)r�r,)�typesr%r&�is_strict_base�sz$_compose_mro.<locals>.is_strict_basecsg|]}�|�s|�qSr%r%r�)r�r%r&r��scsg|]}|�kr|�qSr%r%r�)�type_setr%r&r��sT)r��reverser�)�setr��__subclasses__r�r��sortr�r�)rEr��mror��found�sub�subclsr%)r�rEr�r�r�r�r&�_compose_mro�s*

rcCstt||���}d}|D]R}|dk	r\||krX||jkrX||jkrXt||�sXtd�||���qj||kr|}q|�|�S)NzAmbiguous dispatch: {} or {})r�keysr�r�r�r�r�)rE�registryr�match�tr%r%r&�
_find_impls"
���r
cs�ddl}ddl}i�|���d����fdd��d
����fdd�	���fdd�}t|dd	��|�t<�|_�|_|���|_�j	|_
t||�|S)Nrcs|�dk	r"t�}�|kr"���|�z�|}WnHtk
rvz�|}Wntk
rht|��}YnX|�|<YnX|Sr)rr��KeyErrorr
)rE�
current_token�impl)�cache_token�dispatch_cacherr%r&�dispatch.sz singledispatch.<locals>.dispatchcs�|dkr�t�t�r ��fdd�St�di�}|s@td��d����}ddlm}tt||�����\}�t�t�s�td|�d	��d
���|��<�dkr�t	�d�r�t
�����|S)Ncs
��|�Srr%)�f)rE�registerr%r&�<lambda>N�z2singledispatch.<locals>.register.<locals>.<lambda>rz(Invalid first argument to `register()`: zS. Use either `@register(some_class)` or plain `@register` on an annotated function.r)�get_type_hintszInvalid annotation for z. z is not a class.r�)r�rwrr]�typingrr[rYryrerr�)rEr`�annr�argname)rrrrrDr&rEs(

�
�z singledispatch.<locals>.registercs&|st��d����|dj�||�S)Nz( requires at least 1 positional argumentr)r]ri)ra�kw)r�funcnamer%r&rfszsingledispatch.<locals>.wrapperrzsingledispatch function)N)r��weakref�WeakKeyDictionaryrrArr�MappingProxyTyperr��_clear_cacher)r`r�rrr%)rrrrrrr&rs!
c@s4eZdZdd�Zd
dd�Zddd�Zedd	��ZdS)rcCs4t|�s t|d�s t|�d���t|�|_||_dS)Nr�z  is not callable or a descriptor)rdrer]r�
dispatcherr`�r+r`r%r%r&rPs
zsingledispatchmethod.__init__NcCs|jj||d�S)Nr�)rr)r+rE�methodr%r%r&r�szsingledispatchmethod.registercs0���fdd�}�j|_�j|_t|�j�|S)Ncs$�j�|dj�}|����||�SrQ)rrrir�)ra�kwargsr!�rErNr+r%r&r��sz-singledispatchmethod.__get__.<locals>._method)r�rrr`)r+rNrEr�r%r#r&r��s
zsingledispatchmethod.__get__cCst|jdd�Sr�r�r}r%r%r&r��sz)singledispatchmethod.__isabstractmethod__)N)N)rrrrPrr�r�r�r%r%r%r&rxs



c@s&eZdZdd�Zdd�Zddd�ZdS)	r
cCs ||_d|_|j|_t�|_dSr)r`�attrnamerrr�r r%r%r&rP�szcached_property.__init__cCs8|jdkr||_n"||jkr4td|j�d|�d���dS)Nz?Cannot assign the same cached_property to two different names (z and z).)r$r])r+�owner�namer%r%r&�__set_name__�s

�zcached_property.__set_name__Nc	Cs�|dkr|S|jdkrtd��z
|j}Wn8tk
r`dt|�j�d|j�d�}t|�d�YnX|�|jt�}|tkr�|j�n|�|jt�}|tkr�|�	|�}z|||j<Wn8tk
r�dt|�j�d|j�d�}t|�d�YnXW5QRX|S)NzGCannot use cached_property instance without calling __set_name__ on it.zNo '__dict__' attribute on z instance to cache z
 property.zThe '__dict__' attribute on z7 instance does not support item assignment for caching )
r$r]rrrwrr��
_NOT_FOUNDr�r`)r+�instancer%r��msg�valr%r%r&r��s2
�
�
�zcached_property.__get__)N)rrrrPr'r�r%r%r%r&r
�s	)r�F)N)8�__all__�abcr�collectionsr�reprlibr�_threadrrrrrr-r/r0r1r4r5r6r9r:r;r>r?r@rGrr�
_functools�ImportErrorrArZrr	r
r�r�r�r�r��strr�rwr�r�rr�r�r�rr
rrr(r
r%r%r%r&�<module>s��
�
�
�����AX	�

,t
-)\(__pycache__/_sysconfigdata_d_linux_x86_64-linux-gnu.cpython-38.opt-1.pyc000064400000070505151153537600022041 0ustar00U

��.e]���@s`dddddddddddd	d
dddd
ddddddddddddddddddddddd	dd dd!d"d#d$d%dddd&d'dd(d)d*d&d+dd!dd,d-dddddddd.d&d&d&d&dd&dd&d&d&d&d&dddddddddd&dd&d&d&d&d&d&d&d&dd&d&d&d&d&dd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&dd&d&d&dd&dd&dd&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&d&d&dd&d&d&d&d&d&dd&d&d&d&dd&d&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&d&d&dd&ddd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&dd&d&d&d&dd&d&d&d&d&ddd&d&dd&dddd&d&d&ddd&d&dddd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&d&d&dd&d&dd&d&dd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&dd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&dd&d&d&d&d&d&dd&d&d&d&d&d&d&d&ddd&d&d&dd&d&ddd&d&d&d&d&d&d&dddddd&dd&d&dddddd&ddd&d&d&d&d&d&d&d&d&d&d&ddd&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&d&ddd&d&d&d&ddd&d&d&ddd&dd&d&d&d&d&d&d&d&d&d&d&d&d&d&dd
d/ddd0d1d0d0d2d3d4dd5d6d7ddd8dd	d9dd:d;dd<d=dd>ddd?d@dAdBddd+ddCdDddEdd	dddd&dFdGdHdIdddJddKdLd&dMddddNdOdddddddddPdQdRdddSd&d&dddddTddddUdVdddWddXd&dYdZdd[d6d\d]dd^d&d&ddd_d`dadbdcd9dddded?dfd&dddgdhdidhdgdidgdgdhdhdgd]dgdgdgdgdhd&djdkdld&dmdnddod:d&dddddpddqdrdd&ddddsd&dtdud&d&d&d&dddd&d&ddvdwdudxdydydudz���Zd{S)|�d�z"cpython-38-x86_64-linux-gnu"ZarZrcsz!-Wno-unused-result -Wsign-comparez-IObjects -IInclude -IPython�z/usr/binz/usr/lib64/python3.8z-L. -lpython3.8dzOgcc -pthread -shared -Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -g�pythonzx86_64-redhat-linux-gnu�\zgcc -pthreadz-fPICa{-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -Ogz?configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.ina-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapvaK-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declarationz-Wl,-z,relro  -Wl,-z,now  -gz�-Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -ga�'--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--program-prefix=' '--disable-dependency-tracking' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--enable-ipv6' '--enable-shared' '--with-computed-gotos=yes' '--with-dbmliborder=gdbm:ndbm:bdb' '--with-system-expat' '--with-system-ffi' '--enable-loadable-sqlite-extensions' '--with-dtrace' '--with-lto' '--with-ssl-default-suites=openssl' '--with-valgrind' '--without-ensurepip' '--with-pydebug' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'CFLAGS= -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv ' 'LDFLAGS= -Wl,-z,relro  -Wl,-z,now  -g ' 'CPPFLAGS=' 'PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'z/usr/includez/usr/include/python3.8dz=/builddir/build/BUILD/Python-3.8.17/build/debug/coverage.infoz;/builddir/build/BUILD/Python-3.8.17/build/debug/lcov-reportz2--no-branch-coverage --title "CPython lcov report"zN-IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Includezg++ -pthreadzE/usr /usr/lib64 /usr/lib64/python3.8 /usr/lib64/python3.8/lib-dynloadz /usr/lib64/python3.8/lib-dynloadi�zoREADME.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in Include Lib Misc Ext-dummyzInclude Lib Misc Ext-dummyzTREADME.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in�.�z/usr/bin/dtracezInclude/pydtrace_probes.hzPython/pydtrace.ozdynload_shlib.oZnoz .cpython-38d-x86_64-linux-gnu.soi�ZyeszI/usr/include /usr/include /usr/include/python3.8d /usr/include/python3.8dz/usr/bin/install -cz/usr/bin/install -c -m 644z/usr/bin/install -c -m 755zlibpython3.8d.so.1.0zModules/_io/_iomodule.hzg++ -pthread -sharedz:-Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -gzlibpython3.8d.soz3.8dz
/usr/lib64z-lmzPython/z/usr/lib64/pkgconfigz1/usr/lib64/python3.8/config-3.8d-x86_64-linux-gnuzlibpython3.8d.az"-lcrypt -lpthread -ldl  -lutil -lmz0tkinter tkinter/test tkinter/test/test_tkinter \Zgccz-Xlinker -export-dynamic�trueZlnZlinuxz5/builddir/build/BUILD/Python-3.8.17/Modules/makesetupz/usr/share/manz/usr/bin/mkdir -pz�posix  errno  pwd  _sre  _codecs  _weakref  _functools  _operator  _collections  _abc  itertools  atexit  _signal  _stat  time  _thread  _locale  _io  faulthandler  _tracemalloc  _symtable  xxsubtypeavModules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  Modules/_sre.o  Modules/_codecsmodule.o  Modules/_weakref.o  Modules/_functoolsmodule.o  Modules/_operator.o  Modules/_collectionsmodule.o  Modules/_abc.o  Modules/itertoolsmodule.o  Modules/atexitmodule.o  Modules/signalmodule.o  Modules/_stat.o  Modules/timemodule.o  Modules/_threadmodule.o  Modules/_localemodule.o  Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o  Modules/faulthandler.o  Modules/_tracemalloc.o Modules/hashtable.o  Modules/symtablemodule.o  Modules/xxsubtype.ozx86_64-linux-gnuz -DMULTIARCH=\"x86_64-linux-gnu\"z-Wl,--no-as-neededz-lssl -lcryptoa1-DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapvz:\ Parser/myreadline.o Parser/parsetok.o Parser/tokenizer.oz-fprofile-generatez"-fprofile-use -fprofile-correctionz
-m test --pgozno-frameworkz./python -Ez	python3.8a�-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -Og -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -Og -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPIC -DPy_BUILD_CORE_BUILTINa-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -Og -I/builddir/build/BUILD/Python-3.8.17/Include/internala�-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -Og -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -Og -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPIC -DPy_BUILD_COREaT-Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g -lcryptoz"z"a-Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -Wl,-z,relro  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fno-semantic-interposition -g�a�-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches   -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -Og -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -fno-semantic-interposition -Og -I/builddir/build/BUILD/Python-3.8.17/Include/internal -IObjects -IInclude -IPython -I. -I/builddir/build/BUILD/Python-3.8.17/Include -fPICz)-x test_subprocess test_io test_lib2to3 \ZreadelfzMac/Resources/frameworkZvoidz?LD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/debugz	@SGI_ABI@z/bin/shz.so���zcpython-38d-x86_64-linux-gnuz2Parser Objects Python Modules Modules/_io Programsz:/builddir/build/BUILD/Python-3.8.17/Tools/gdb/libpython.pyz"/* Don't use ncurses extensions */z-szInclude Lib MisczHLD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/debug ./pythonz�LD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/debug ./python /builddir/build/BUILD/Python-3.8.17/Tools/scripts/run_tests.pyi�zJpython3.8 /builddir/build/BUILD/Python-3.8.17/Tools/scripts/update_file.pyz3.8z#/builddir/build/BUILD/Python-3.8.17z)xml xml/dom xml/etree xml/parsers xml/saxz//builddir/build/BUILD/Python-3.8.17/build/debugz
/usr/sharez/usr(�ZABIFLAGSZAC_APPLE_UNIVERSAL_BUILDZAIX_GENUINE_CPLUSPLUSZ	ALT_SOABIZANDROID_API_LEVELZARZARFLAGSZ
BASECFLAGSZBASECPPFLAGSZBASEMODLIBSZBINDIRZ
BINLIBDESTZ
BLDLIBRARYZ	BLDSHAREDZBUILDEXEZBUILDPYTHONZBUILD_GNU_TYPEZBYTESTR_DEPSZCCZCCSHAREDZCFLAGSZCFLAGSFORSHAREDZCFLAGS_ALIASINGZCONFIGFILESZCONFIGURE_CFLAGSZCONFIGURE_CFLAGS_NODISTZCONFIGURE_CPPFLAGSZCONFIGURE_LDFLAGSZCONFIGURE_LDFLAGS_NODISTZCONFIG_ARGSZCONFINCLUDEDIRZ
CONFINCLUDEPYZCOREPYTHONPATHZ
COVERAGE_INFOZCOVERAGE_REPORTZCOVERAGE_REPORT_OPTIONSZCPPFLAGSZCXXZDESTDIRSZDESTLIBZDESTPATHZ
DESTSHAREDZDFLAGSZDIRMODEZDISTZDISTDIRSZ	DISTFILESZ	DLINCLDIRZ
DLLLIBRARYZ"DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754ZDOUBLE_IS_BIG_ENDIAN_IEEE754ZDOUBLE_IS_LITTLE_ENDIAN_IEEE754ZDTRACEZDTRACE_DEPSZDTRACE_HEADERSZDTRACE_OBJSZDYNLOADFILEZENABLE_IPV6Z	ENSUREPIPZEXEZEXEMODEZ
EXTRATESTOPTSZ
EXT_SUFFIXZFILEMODEZFLOAT_WORDS_BIGENDIANZFLOCK_NEEDS_LIBBSDZGETPGRP_HAVE_ARGZGETTIMEOFDAY_NO_TZZ	GITBRANCHZGITTAGZ
GITVERSIONZGNULDZHAVE_ACCEPT4Z
HAVE_ACOSHZ
HAVE_ADDRINFOZ
HAVE_ALARMZHAVE_ALIGNED_REQUIREDZ
HAVE_ALLOCA_HZHAVE_ALTZONEZ
HAVE_ASINHZHAVE_ASM_TYPES_HZ
HAVE_ATANHZHAVE_BIND_TEXTDOMAIN_CODESETZHAVE_BLUETOOTH_BLUETOOTH_HZHAVE_BLUETOOTH_HZHAVE_BROKEN_MBSTOWCSZHAVE_BROKEN_NICEZHAVE_BROKEN_PIPE_BUFZHAVE_BROKEN_POLLZHAVE_BROKEN_POSIX_SEMAPHORESZHAVE_BROKEN_PTHREAD_SIGMASKZHAVE_BROKEN_SEM_GETVALUEZHAVE_BROKEN_UNSETENVZHAVE_BUILTIN_ATOMICZHAVE_CHFLAGSZ
HAVE_CHOWNZHAVE_CHROOTZ
HAVE_CLOCKZHAVE_CLOCK_GETRESZHAVE_CLOCK_GETTIMEZHAVE_CLOCK_SETTIMEZHAVE_COMPUTED_GOTOSZHAVE_CONFSTRZHAVE_CONIO_HZ
HAVE_COPYSIGNZHAVE_COPY_FILE_RANGEZHAVE_CRYPT_HZHAVE_CRYPT_RZHAVE_CTERMIDZHAVE_CTERMID_RZHAVE_CURSES_FILTERZ
HAVE_CURSES_HZHAVE_CURSES_HAS_KEYZHAVE_CURSES_IMMEDOKZHAVE_CURSES_IS_PADZHAVE_CURSES_IS_TERM_RESIZEDZHAVE_CURSES_RESIZETERMZHAVE_CURSES_RESIZE_TERMZHAVE_CURSES_SYNCOKZHAVE_CURSES_TYPEAHEADZHAVE_CURSES_USE_ENVZHAVE_CURSES_WCHGATZHAVE_DECL_ISFINITEZHAVE_DECL_ISINFZHAVE_DECL_ISNANZHAVE_DECL_RTLD_DEEPBINDZHAVE_DECL_RTLD_GLOBALZHAVE_DECL_RTLD_LAZYZHAVE_DECL_RTLD_LOCALZHAVE_DECL_RTLD_MEMBERZHAVE_DECL_RTLD_NODELETEZHAVE_DECL_RTLD_NOLOADZHAVE_DECL_RTLD_NOWZHAVE_DECL_TZNAMEZHAVE_DEVICE_MACROSZHAVE_DEV_PTCZ
HAVE_DEV_PTMXZ
HAVE_DIRECT_HZHAVE_DIRENT_D_TYPEZ
HAVE_DIRENT_HZ
HAVE_DIRFDZHAVE_DLFCN_HZHAVE_DLOPENZ	HAVE_DUP2Z	HAVE_DUP3Z$HAVE_DYLD_SHARED_CACHE_CONTAINS_PATHZHAVE_DYNAMIC_LOADINGZ
HAVE_ENDIAN_HZ
HAVE_EPOLLZHAVE_EPOLL_CREATE1ZHAVE_ERFZ	HAVE_ERFCZHAVE_ERRNO_HZ
HAVE_EXECVZHAVE_EXPLICIT_BZEROZHAVE_EXPLICIT_MEMSETZ
HAVE_EXPM1ZHAVE_FACCESSATZHAVE_FCHDIRZHAVE_FCHMODZ
HAVE_FCHMODATZHAVE_FCHOWNZ
HAVE_FCHOWNATZHAVE_FCNTL_HZHAVE_FDATASYNCZHAVE_FDOPENDIRZHAVE_FDWALKZHAVE_FEXECVEZHAVE_FINITEZ
HAVE_FLOCKZ	HAVE_FORKZHAVE_FORKPTYZHAVE_FPATHCONFZHAVE_FSEEK64ZHAVE_FSEEKOZHAVE_FSTATATZ
HAVE_FSTATVFSZ
HAVE_FSYNCZHAVE_FTELL64ZHAVE_FTELLOZ
HAVE_FTIMEZHAVE_FTRUNCATEZ
HAVE_FUTIMENSZHAVE_FUTIMESZHAVE_FUTIMESATZHAVE_GAI_STRERRORZ
HAVE_GAMMAZHAVE_GCC_ASM_FOR_MC68881ZHAVE_GCC_ASM_FOR_X64ZHAVE_GCC_ASM_FOR_X87ZHAVE_GCC_UINT128_TZHAVE_GETADDRINFOZHAVE_GETC_UNLOCKEDZHAVE_GETENTROPYZHAVE_GETGRGID_RZHAVE_GETGRNAM_RZHAVE_GETGROUPLISTZHAVE_GETGROUPSZHAVE_GETHOSTBYNAMEZHAVE_GETHOSTBYNAME_RZHAVE_GETHOSTBYNAME_R_3_ARGZHAVE_GETHOSTBYNAME_R_5_ARGZHAVE_GETHOSTBYNAME_R_6_ARGZHAVE_GETITIMERZHAVE_GETLOADAVGZ
HAVE_GETLOGINZHAVE_GETNAMEINFOZHAVE_GETPAGESIZEZHAVE_GETPEERNAMEZHAVE_GETPGIDZHAVE_GETPGRPZHAVE_GETPIDZHAVE_GETPRIORITYZ
HAVE_GETPWENTZHAVE_GETPWNAM_RZHAVE_GETPWUID_RZHAVE_GETRANDOMZHAVE_GETRANDOM_SYSCALLZHAVE_GETRESGIDZHAVE_GETRESUIDZHAVE_GETSIDZ
HAVE_GETSPENTZ
HAVE_GETSPNAMZHAVE_GETTIMEOFDAYZ
HAVE_GETWDZHAVE_GLIBC_MEMMOVE_BUGZ
HAVE_GRP_HZHAVE_HSTRERRORZHAVE_HTOLE64Z
HAVE_HYPOTZ
HAVE_IEEEFP_HZHAVE_IF_NAMEINDEXZHAVE_INET_ATONZHAVE_INET_PTONZHAVE_INITGROUPSZHAVE_INTTYPES_HZ	HAVE_IO_HZHAVE_IPA_PURE_CONST_BUGZ	HAVE_KILLZHAVE_KILLPGZHAVE_KQUEUEZHAVE_LANGINFO_HZHAVE_LARGEFILE_SUPPORTZ
HAVE_LCHFLAGSZHAVE_LCHMODZHAVE_LCHOWNZHAVE_LGAMMAZ
HAVE_LIBDLZHAVE_LIBDLDZHAVE_LIBIEEEZHAVE_LIBINTL_HZHAVE_LIBREADLINEZHAVE_LIBRESOLVZHAVE_LIBSENDFILEZHAVE_LIBUTIL_HZ	HAVE_LINKZHAVE_LINKATZHAVE_LINUX_CAN_BCM_HZHAVE_LINUX_CAN_HZHAVE_LINUX_CAN_RAW_FD_FRAMESZHAVE_LINUX_CAN_RAW_HZHAVE_LINUX_MEMFD_HZHAVE_LINUX_NETLINK_HZHAVE_LINUX_QRTR_HZHAVE_LINUX_RANDOM_HZHAVE_LINUX_TIPC_HZHAVE_LINUX_VM_SOCKETS_HZ
HAVE_LOCKFZ
HAVE_LOG1PZ	HAVE_LOG2ZHAVE_LONG_DOUBLEZ
HAVE_LSTATZHAVE_LUTIMESZHAVE_MADVISEZHAVE_MAKEDEVZHAVE_MBRTOWCZHAVE_MEMFD_CREATEZ
HAVE_MEMORY_HZHAVE_MEMRCHRZHAVE_MKDIRATZHAVE_MKFIFOZ
HAVE_MKFIFOATZ
HAVE_MKNODZHAVE_MKNODATZHAVE_MKTIMEZ	HAVE_MMAPZHAVE_MREMAPZHAVE_NCURSES_HZHAVE_NDIR_HZHAVE_NETPACKET_PACKET_HZ
HAVE_NET_IF_HZ	HAVE_NICEZHAVE_OPENATZHAVE_OPENPTYZ
HAVE_PATHCONFZ
HAVE_PAUSEZ
HAVE_PIPE2Z
HAVE_PLOCKZ	HAVE_POLLZHAVE_POLL_HZHAVE_POSIX_FADVISEZHAVE_POSIX_FALLOCATEZHAVE_POSIX_SPAWNZHAVE_POSIX_SPAWNPZ
HAVE_PREADZHAVE_PREADVZHAVE_PREADV2ZHAVE_PRLIMITZHAVE_PROCESS_HZHAVE_PROTOTYPESZHAVE_PTHREAD_CONDATTR_SETCLOCKZHAVE_PTHREAD_DESTRUCTORZHAVE_PTHREAD_GETCPUCLOCKIDZHAVE_PTHREAD_HZHAVE_PTHREAD_INITZHAVE_PTHREAD_KILLZHAVE_PTHREAD_SIGMASKZ
HAVE_PTY_HZHAVE_PUTENVZHAVE_PWRITEZHAVE_PWRITEVZ
HAVE_PWRITEV2Z
HAVE_READLINKZHAVE_READLINKATZ
HAVE_READVZ
HAVE_REALPATHZ
HAVE_RENAMEATZHAVE_RL_APPEND_HISTORYZHAVE_RL_CATCH_SIGNALZ#HAVE_RL_COMPLETION_APPEND_CHARACTERZ'HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOKZHAVE_RL_COMPLETION_MATCHESZ"HAVE_RL_COMPLETION_SUPPRESS_APPENDZHAVE_RL_PRE_INPUT_HOOKZHAVE_RL_RESIZE_TERMINALZ
HAVE_ROUNDZ
HAVE_RTPSPAWNZHAVE_SCHED_GET_PRIORITY_MAXZHAVE_SCHED_HZHAVE_SCHED_RR_GET_INTERVALZHAVE_SCHED_SETAFFINITYZHAVE_SCHED_SETPARAMZHAVE_SCHED_SETSCHEDULERZHAVE_SEM_GETVALUEZ
HAVE_SEM_OPENZHAVE_SEM_TIMEDWAITZHAVE_SEM_UNLINKZ
HAVE_SENDFILEZHAVE_SETEGIDZHAVE_SETEUIDZHAVE_SETGIDZHAVE_SETGROUPSZHAVE_SETHOSTNAMEZHAVE_SETITIMERZHAVE_SETLOCALEZHAVE_SETPGIDZHAVE_SETPGRPZHAVE_SETPRIORITYZ
HAVE_SETREGIDZHAVE_SETRESGIDZHAVE_SETRESUIDZ
HAVE_SETREUIDZHAVE_SETSIDZHAVE_SETUIDZHAVE_SETVBUFZ
HAVE_SHADOW_HZ
HAVE_SHM_OPENZHAVE_SHM_UNLINKZHAVE_SIGACTIONZHAVE_SIGALTSTACKZHAVE_SIGFILLSETZHAVE_SIGINFO_T_SI_BANDZHAVE_SIGINTERRUPTZ
HAVE_SIGNAL_HZHAVE_SIGPENDINGZ
HAVE_SIGRELSEZHAVE_SIGTIMEDWAITZHAVE_SIGWAITZHAVE_SIGWAITINFOZ
HAVE_SNPRINTFZHAVE_SOCKADDR_ALGZHAVE_SOCKADDR_SA_LENZHAVE_SOCKADDR_STORAGEZHAVE_SOCKETPAIRZHAVE_SPAWN_HZHAVE_SSIZE_TZHAVE_STATVFSZHAVE_STAT_TV_NSECZHAVE_STAT_TV_NSEC2ZHAVE_STDARG_PROTOTYPESZ
HAVE_STDINT_HZ
HAVE_STDLIB_HZHAVE_STD_ATOMICZHAVE_STRDUPZ
HAVE_STRFTIMEZHAVE_STRINGS_HZ
HAVE_STRING_HZHAVE_STRLCPYZHAVE_STROPTS_HZHAVE_STRSIGNALZHAVE_STRUCT_PASSWD_PW_GECOSZHAVE_STRUCT_PASSWD_PW_PASSWDZHAVE_STRUCT_STAT_ST_BIRTHTIMEZHAVE_STRUCT_STAT_ST_BLKSIZEZHAVE_STRUCT_STAT_ST_BLOCKSZHAVE_STRUCT_STAT_ST_FLAGSZHAVE_STRUCT_STAT_ST_GENZHAVE_STRUCT_STAT_ST_RDEVZHAVE_STRUCT_TM_TM_ZONEZHAVE_SYMLINKZHAVE_SYMLINKATZ	HAVE_SYNCZHAVE_SYSCONFZHAVE_SYSEXITS_HZHAVE_SYS_AUDIOIO_HZHAVE_SYS_BSDTTY_HZHAVE_SYS_DEVPOLL_HZHAVE_SYS_DIR_HZHAVE_SYS_ENDIAN_HZHAVE_SYS_EPOLL_HZHAVE_SYS_EVENT_HZHAVE_SYS_FILE_HZHAVE_SYS_IOCTL_HZHAVE_SYS_KERN_CONTROL_HZHAVE_SYS_LOADAVG_HZHAVE_SYS_LOCK_HZHAVE_SYS_MEMFD_HZHAVE_SYS_MKDEV_HZHAVE_SYS_MMAN_HZHAVE_SYS_MODEM_HZHAVE_SYS_NDIR_HZHAVE_SYS_PARAM_HZHAVE_SYS_POLL_HZHAVE_SYS_RANDOM_HZHAVE_SYS_RESOURCE_HZHAVE_SYS_SELECT_HZHAVE_SYS_SENDFILE_HZHAVE_SYS_SOCKET_HZHAVE_SYS_STATVFS_HZHAVE_SYS_STAT_HZHAVE_SYS_SYSCALL_HZHAVE_SYS_SYSMACROS_HZHAVE_SYS_SYS_DOMAIN_HZHAVE_SYS_TERMIO_HZHAVE_SYS_TIMES_HZHAVE_SYS_TIME_HZHAVE_SYS_TYPES_HZHAVE_SYS_UIO_HZ
HAVE_SYS_UN_HZHAVE_SYS_UTSNAME_HZHAVE_SYS_WAIT_HZHAVE_SYS_XATTR_HZHAVE_TCGETPGRPZHAVE_TCSETPGRPZHAVE_TEMPNAMZHAVE_TERMIOS_HZHAVE_TERM_HZHAVE_TGAMMAZHAVE_TIMEGMZ
HAVE_TIMESZHAVE_TMPFILEZHAVE_TMPNAMZ
HAVE_TMPNAM_RZHAVE_TM_ZONEZ
HAVE_TRUNCATEZHAVE_TZNAMEZ
HAVE_UCS4_TCLZ
HAVE_UNAMEZ
HAVE_UNISTD_HZ
HAVE_UNLINKATZ
HAVE_UNSETENVZHAVE_USABLE_WCHAR_TZHAVE_UTIL_HZHAVE_UTIMENSATZHAVE_UTIMESZHAVE_UTIME_HZHAVE_UUID_CREATEZHAVE_UUID_ENC_BEZHAVE_UUID_GENERATE_TIME_SAFEZHAVE_UUID_HZHAVE_UUID_UUID_HZ
HAVE_WAIT3Z
HAVE_WAIT4ZHAVE_WAITIDZHAVE_WAITPIDZHAVE_WCHAR_HZHAVE_WCSCOLLZ
HAVE_WCSFTIMEZHAVE_WCSXFRMZHAVE_WMEMCMPZHAVE_WORKING_TZSETZHAVE_WRITEVZ HAVE_X509_VERIFY_PARAM_SET1_HOSTZHAVE_ZLIB_COPYZHAVE__GETPTYZ
HOST_GNU_TYPEZINCLDIRSTOMAKEZ
INCLUDEDIRZ	INCLUDEPYZINSTALLZINSTALL_DATAZINSTALL_PROGRAMZINSTALL_SCRIPTZINSTALL_SHAREDZ
INSTSONAMEZIO_HZIO_OBJSZLDCXXSHAREDZLDFLAGSZ	LDLIBRARYZLDLIBRARYDIRZLDSHAREDZ	LDVERSIONZLIBCZLIBDESTZLIBDIRZLIBFFI_INCLUDEDIRZLIBMZ	LIBOBJDIRZLIBOBJSZLIBPCZLIBPLZ	LIBPYTHONZLIBRARYZLIBRARY_OBJSZLIBRARY_OBJS_OMIT_FROZENZLIBSZ
LIBSUBDIRSZLINKCCZ
LINKFORSHAREDZLIPO_32BIT_FLAGSZLIPO_INTEL64_FLAGSZ
LLVM_PROF_ERRZLLVM_PROF_FILEZLLVM_PROF_MERGERZLNZLOCALMODLIBSZMACHDEPZMACHDEP_OBJSZMACHDESTLIBZMACOSX_DEPLOYMENT_TARGETZMAINCCZMAJOR_IN_MKDEVZMAJOR_IN_SYSMACROSZ	MAKESETUPZMANDIRZMKDIR_PZMODBUILT_NAMESZMODDISABLED_NAMESZMODLIBSZMODOBJSZMODULE_OBJSZ	MULTIARCHZMULTIARCH_CPPFLAGSZMVWDELCH_IS_EXPRESSIONZNO_AS_NEEDEDZOBJECT_OBJSZOPENSSL_INCLUDESZOPENSSL_LDFLAGSZOPENSSL_LIBSZOPTZOTHER_LIBTOOL_OPTZPACKAGE_BUGREPORTZPACKAGE_NAMEZPACKAGE_STRINGZPACKAGE_TARNAMEZPACKAGE_URLZPACKAGE_VERSIONZPARSER_HEADERSZPARSER_OBJSZPGO_PROF_GEN_FLAGZPGO_PROF_USE_FLAGZPOBJSZPOSIX_SEMAPHORES_NOT_ENABLEDZPROFILE_TASKZ$PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INTZPTHREAD_SYSTEM_SCHED_SUPPORTEDZ
PY3LIBRARYZPYLONG_BITS_IN_DIGITZPYTHONZPYTHONFRAMEWORKZPYTHONFRAMEWORKDIRZPYTHONFRAMEWORKINSTALLDIRZPYTHONFRAMEWORKPREFIXZ
PYTHONPATHZPYTHON_FOR_BUILDZPYTHON_FOR_REGENZPYTHON_HEADERSZPYTHON_OBJSZPY_BUILTIN_MODULE_CFLAGSZ	PY_CFLAGSZPY_CFLAGS_NODISTZPY_COERCE_C_LOCALEZPY_CORE_CFLAGSZPY_CORE_LDFLAGSZPY_CPPFLAGSZPY_FORMAT_SIZE_TZ
PY_LDFLAGSZPY_LDFLAGS_NODISTZPY_SSL_DEFAULT_CIPHERSZPY_SSL_DEFAULT_CIPHER_STRINGZPY_STDMODULE_CFLAGSZPy_DEBUGZPy_ENABLE_SHAREDZPy_HASH_ALGORITHMZ
Py_TRACE_REFSZ
QUICKTESTOPTSZREADELFZ	RESSRCDIRZ
RETSIGTYPEZ	RUNSHAREDZ	SCRIPTDIRZSETPGRP_HAVE_ARGZSGI_ABIZSHELLZSHLIBSZSHLIB_SUFFIXZSHM_NEEDS_LIBRTZSIGNED_RIGHT_SHIFT_ZERO_FILLSZSITEPATHZ
SIZEOF_DOUBLEZSIZEOF_FLOATZ
SIZEOF_FPOS_TZ
SIZEOF_INTZSIZEOF_LONGZSIZEOF_LONG_DOUBLEZSIZEOF_LONG_LONGZSIZEOF_OFF_TZSIZEOF_PID_TZSIZEOF_PTHREAD_KEY_TZSIZEOF_PTHREAD_TZSIZEOF_SHORTZ
SIZEOF_SIZE_TZ
SIZEOF_TIME_TZSIZEOF_UINTPTR_TZ
SIZEOF_VOID_PZSIZEOF_WCHAR_TZSIZEOF__BOOLZSOABIZSRCDIRSZ
SRC_GDB_HOOKSZSTDC_HEADERSZSTRICT_SYSV_CURSESZ	STRIPFLAGZSUBDIRSZ
SUBDIRSTOOZSYSLIBSZSYS_SELECT_WITH_SYS_TIMEZTCLTK_INCLUDESZ
TCLTK_LIBSZTESTOPTSZTESTPATHZ
TESTPYTHONZTESTPYTHONOPTSZ
TESTRUNNERZTESTTIMEOUTZTIMEMODULE_LIBZTIME_WITH_SYS_TIMEZTM_IN_SYS_TIMEZUNICODE_DEPSZUNIVERSALSDKZUPDATE_FILEZUSE_COMPUTED_GOTOSZVERSIONZVPATHZWINDOW_HAS_FLAGSZWITH_DECIMAL_CONTEXTVARZWITH_DOC_STRINGSZWITH_DTRACEZ	WITH_DYLDZWITH_LIBINTLZWITH_NEXT_FRAMEWORKZ
WITH_PYMALLOCZ
WITH_VALGRINDZX87_DOUBLE_ROUNDINGZ
XMLLIBSUBDIRSZabs_builddirZ
abs_srcdirZdatarootdir�exec_prefix�prefixZsrcdirN)Zbuild_time_vars�rr�?/usr/lib64/python3.8/_sysconfigdata_d_linux_x86_64-linux-gnu.py�<module>sb2+-��������__pycache__/symtable.cpython-38.pyc000064400000026074151153537600013243 0ustar00U

e5dU�	@sJdZddlZddlmZmZmZmZmZmZmZm	Z	m
Z
mZmZm
Z
mZmZmZddlZdddddgZd	d�ZGd
d�d�Ze�ZGdd�d�ZGd
d�de�ZGdd�de�ZGdd�d�Zedk�rFddlZddlZeejd��Ze� �Z!W5QRXee!ej"�#ejd�dd�Z$e$�%�D]$Z&e$�'e&�Z(e)e(e(�*�e(�+���q dS)z2Interface to the compiler's internal symbol tables�N)�USE�
DEF_GLOBAL�DEF_NONLOCAL�	DEF_LOCAL�	DEF_PARAM�
DEF_IMPORT�	DEF_BOUND�	DEF_ANNOT�	SCOPE_OFF�
SCOPE_MASK�FREE�LOCAL�GLOBAL_IMPLICIT�GLOBAL_EXPLICIT�CELL�symtable�SymbolTable�Class�Function�SymbolcCst�|||�}t||�S�N)�	_symtabler�_newSymbolTable)�code�filenameZcompile_type�top�r� /usr/lib64/python3.8/symtable.pyrsc@s$eZdZdd�Zdd�Zdd�ZdS)�SymbolTableFactorycCst��|_dSr)�weakrefZWeakValueDictionary�_SymbolTableFactory__memo��selfrrr�__init__szSymbolTableFactory.__init__cCs6|jtjkrt||�S|jtjkr,t||�St||�Sr)�typer�
TYPE_FUNCTIONr�
TYPE_CLASSrr)r"�tablerrrr�news


zSymbolTableFactory.newcCs8||f}|j�|d�}|dkr4|�||�}|j|<|Sr)r �getr()r"r'r�key�objrrr�__call__s
zSymbolTableFactory.__call__N)�__name__�
__module__�__qualname__r#r(r,rrrrrsrc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZdS) rcCs||_||_i|_dSr)�_table�	_filename�_symbols)r"Z	raw_tablerrrrr#'szSymbolTable.__init__cCsN|jtkrd}nd|jj}|jjdkr6d�||j�Sd�||jj|j�SdS)N�z%s rz<{0}SymbolTable for module {1}>z<{0}SymbolTable for {1} in {2}>)�	__class__rr-r0�name�formatr1)r"Zkindrrr�__repr__,s
�zSymbolTable.__repr__cCsX|jjtjkrdS|jjtjkr$dS|jjtjkr6dS|jjdksTtd�|jj���dS)N�moduleZfunction�class)���zunexpected type: {0})r0r$rZTYPE_MODULEr%r&�AssertionErrorr6r!rrr�get_type9s�zSymbolTable.get_typecCs|jjSr)r0�idr!rrr�get_idCszSymbolTable.get_idcCs|jjSr)r0r5r!rrr�get_nameFszSymbolTable.get_namecCs|jjSr)r0�linenor!rrr�
get_linenoIszSymbolTable.get_linenocCst|jjtjk�Sr)�boolr0r$rr%r!rrr�is_optimizedLszSymbolTable.is_optimizedcCst|jj�Sr)rDr0�nestedr!rrr�	is_nestedOszSymbolTable.is_nestedcCst|jj�Sr)rDr0�childrenr!rrr�has_childrenRszSymbolTable.has_childrencCsdS)z7Return true if the scope uses exec.  Deprecated method.Frr!rrr�has_execUszSymbolTable.has_execcCs|jj��Sr)r0�symbols�keysr!rrr�get_identifiersYszSymbolTable.get_identifierscCsT|j�|�}|dkrP|jj|}|�|�}|jjdk}t||||d�}|j|<|S)Nr��module_scope)r2r)r0rK�_SymbolTable__check_childrenr5r)r"r5Zsym�flags�
namespacesrOrrr�lookup\s
�zSymbolTable.lookupcs�fdd����D�S)Ncsg|]}��|��qSr)rS��.0�identr!rr�
<listcomp>gsz+SymbolTable.get_symbols.<locals>.<listcomp>)rMr!rr!r�get_symbolsfszSymbolTable.get_symbolscs��fdd��jjD�S)Ncs"g|]}|j�krt|�j��qSr)r5rr1�rU�st�r5r"rrrWjs
�z0SymbolTable.__check_children.<locals>.<listcomp>�r0rH)r"r5rr[rZ__check_childrenis�zSymbolTable.__check_childrencs�fdd��jjD�S)Ncsg|]}t|�j��qSr)rr1rYr!rrrWos�z,SymbolTable.get_children.<locals>.<listcomp>r\r!rr!r�get_childrenns
�zSymbolTable.get_childrenN)r-r.r/r#r7r>r@rArCrErGrIrJrMrSrXrPr]rrrrr%s


c@sPeZdZdZdZdZdZdZdd�Zdd�Z	dd�Z
dd	�Zd
d�Zdd
�Z
dS)rNcst��fdd����D��S)Nc3s"|]}��jj|�r|VqdSr)r0rKrT�r"Z	test_funcrr�	<genexpr>}s�z-Function.__idents_matching.<locals>.<genexpr>)�tuplerMr^rr^rZ__idents_matching|szFunction.__idents_matchingcCs |jdkr|�dd��|_|jS)NcSs|t@Sr)r��xrrr�<lambda>��z)Function.get_parameters.<locals>.<lambda>)�_Function__params�_Function__idents_matchingr!rrr�get_parameters�s
zFunction.get_parameterscs0|jdkr*ttf��fdd�}|�|�|_|jS)Ncs|t?t@�kSr�r
rra�Zlocsrrrc�rdz%Function.get_locals.<locals>.<lambda>)�_Function__localsr
rrf�r"Ztestrrir�
get_locals�s

zFunction.get_localscs0|jdkr*ttf��fdd�}|�|�|_|jS)Ncs|t?t@�kSrrhra�Zglobrrrc�rdz&Function.get_globals.<locals>.<lambda>)�_Function__globalsrrrfrkrrmr�get_globals�s

zFunction.get_globalscCs |jdkr|�dd��|_|jS)NcSs|t@Sr)rrarrrrc�rdz(Function.get_nonlocals.<locals>.<lambda>)�_Function__nonlocalsrfr!rrr�
get_nonlocals�s
zFunction.get_nonlocalscCs$|jdkrdd�}|�|�|_|jS)NcSs|t?t@tkSr)r
rrrarrrrc�rdz$Function.get_frees.<locals>.<lambda>)�_Function__freesrf)r"�is_freerrr�	get_frees�s
zFunction.get_frees)r-r.r/rerjrrrnrprfrgrlrorqrtrrrrrssc@seZdZdZdd�ZdS)rNcCs6|jdkr0i}|jjD]}d||j<qt|�|_|jS)Nr:)�_Class__methodsr0rHr5r`)r"�drZrrr�get_methods�s

zClass.get_methods)r-r.r/rurwrrrrr�sc@s�eZdZd$dd�dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd d!�Zd"d#�ZdS)%rNFrNcCs.||_||_|t?t@|_|p d|_||_dS)Nr)�
_Symbol__name�_Symbol__flagsr
r�_Symbol__scope�_Symbol__namespaces�_Symbol__module_scope)r"r5rQrRrOrrrr#�s

zSymbol.__init__cCsd�|j�S)Nz<symbol {0!r}>)r6rxr!rrrr7�szSymbol.__repr__cCs|jSr)rxr!rrrrA�szSymbol.get_namecCst|jtj@�Sr)rDryrrr!rrr�
is_referenced�szSymbol.is_referencedcCst|jt@�Sr)rDryrr!rrr�is_parameter�szSymbol.is_parametercCs"t|jttfkp|jo|jt@�S)z0Return *True* if the sysmbol is global.
        )rDrzrrr|ryrr!rrr�	is_global�s�zSymbol.is_globalcCst|jt@�Sr)rDryrr!rrr�is_nonlocal�szSymbol.is_nonlocalcCst|jtk�Sr)rDrzrr!rrr�is_declared_global�szSymbol.is_declared_globalcCs"t|jttfkp|jo|jt@�S)z.Return *True* if the symbol is local.
        )rDrzr
rr|ryrr!rrr�is_local�s�zSymbol.is_localcCst|jt@�Sr)rDryr	r!rrr�is_annotated�szSymbol.is_annotatedcCst|jtk�Sr)rDrzrr!rrrrs�szSymbol.is_freecCst|jt@�Sr)rDryrr!rrr�is_imported�szSymbol.is_importedcCst|jt@�Sr)rDryrr!rrr�is_assigned�szSymbol.is_assignedcCs
t|j�S)a�Returns true if name binding introduces new namespace.

        If the name is used as the target of a function or class
        statement, this will be true.

        Note that a single name can be bound to multiple objects.  If
        is_namespace() is true, the name may also be bound to other
        objects, like an int or list, that does not introduce a new
        namespace.
        )rDr{r!rrr�is_namespace�szSymbol.is_namespacecCs|jS)z.Return a list of namespaces bound to this name)r{r!rrr�get_namespaces�szSymbol.get_namespacescCs t|j�dkrtd��|jdS)z�Returns the single namespace bound to this name.

        Raises ValueError if the name is bound to multiple namespaces.
        r:z$name is bound to multiple namespacesr)�lenr{�
ValueErrorr!rrr�
get_namespace�szSymbol.get_namespace)N)r-r.r/r#r7rAr}r~rr�r�r�r�rsr�r�r�r�r�rrrrr�s 
�__main__r:�exec),�__doc__rrrrrrrrr	r
rrr
rrrr�__all__rrrrrrrr-�os�sys�open�argv�f�read�src�path�split�modrMrVrS�info�printr�r�rrrr�<module>s&DN,
M

__pycache__/trace.cpython-38.opt-2.pyc000064400000041212151153537600013450 0ustar00U

e5d�t�@s�ddgZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlm
ZddlZdZGdd�d�Zdd	�Zd
d�ZGdd�d�Zd
d�Zdd�Zddd�Zdd�ZGdd�d�Zdd�Zedkr�e�dS)�Trace�CoverageResults�N)�	monotonicz#pragma NO COVERc@seZdZddd�Zdd�ZdS)�_IgnoreNcCs:|s
t�nt|�|_|sgndd�|D�|_ddi|_dS)NcSsg|]}tj�|��qS�)�os�path�normpath��.0�drr�/usr/lib64/python3.8/trace.py�
<listcomp>Hs�z$_Ignore.__init__.<locals>.<listcomp>z<string>�)�set�_mods�_dirs�_ignore)�self�modules�dirsrrr
�__init__Fs
�z_Ignore.__init__cCs�||jkr|j|S||jkr,d|j|<dS|jD]"}|�|d�r2d|j|<dSq2|dkrld|j|<dS|jD]$}|�|tj�rrd|j|<dSqrd|j|<dS)Nr�.r)rr�
startswithrr�sep)r�filename�
modulename�modrrrr
�namesLs$









z
_Ignore.names)NN)�__name__�
__module__�__qualname__rrrrrr
rEs
rcCs tj�|�}tj�|�\}}|S�N)rr�basename�splitext)r�baser�extrrr
�_modnamewsr'cCs�tj�|�}d}tjD]@}tj�|�}|�|�r|t|�tjkrt|�t|�kr|}q|rr|t|�dd�}n|}tj�|�\}}|�tjd�}tj	r�|�tj	d�}tj�
|�\}}|�d�S)N�rr)rr�normcase�sysr�lenr�
splitdrive�replace�altsepr$�lstrip)rZcomparepathZlongest�dirr%Zdriverr&rrr
�_fullmodname~s 
r1c@s:eZdZddd�Zdd�Zdd�Zdd
d�Zddd
�ZdS)rNc
Cs�||_|jdkri|_|j��|_||_|jdkr8i|_|j��|_||_|jdkrZi|_|j��|_||_||_|jr�z@t|jd��}t�	|�\}}}W5QRX|�
|�|||��Wn@tt
tfk
r�}ztd|j|ftjd�W5d}~XYnXdS)N�rbzSkipping counts file %r: %s��file)�counts�copyZcounter�calledfuncs�callers�infile�outfile�open�pickle�load�update�	__class__�OSError�EOFError�
ValueError�printr*�stderr)rr5r7r9r8r:�f�errrrr
r�s2


��zCoverageResults.__init__cCs|�d�o|�d�S)N�<�>)r�endswith)rrrrr
�is_ignored_filename�sz#CoverageResults.is_ignored_filenamec	Csn|j}|j}|j}|j}|j}|j}|D]}|�|d�||||<q(|D]}d||<qJ|D]}d||<q\dS�Nrr)r5r7r8�get)	r�otherr5r7r8Zother_countsZother_calledfuncsZ
other_callers�keyrrr
r>�s
zCoverageResults.updateTFc"
Cs�|jr@t�td�|j}t|�D]\}}}td|||f�q"|jr�t�td�d}}	t|j�D]h\\}
}}\}
}}|
|kr�t�td|
d�|
}d}	|
|
kr�|	|
kr�td|
�|
}	td||||f�qfi}|jD].\}}|�|i�}||<|j||f||<q�i}|��D�]\}}|�|��r0�q|�d��rH|dd	�}|dk�rpt	j
�t	j
�|��}t
|�}n$|}t	j
�|��s�t	�|�t|�}|�r�t|�}ni}t�|�}t	j
�||d
�}t|d��}t�|j�\}}W5QRX|�|||||�\}}|�r|�rtd||�}||||f||<�q|�rt|�rttd
�t|�D]&}||\}}}}td||��qL|j�r�z6t|jd�� } t�|j|j|jf| d�W5QRXWn6tk
�r�}!ztd|!tj d�W5d}!~!XYnXdS)Nzfunctions called:z*filename: %s, modulename: %s, funcname: %szcalling relationships:r(z***z  -->z    %s.%s -> %s.%sz.pyc���z.coverr2�dzlines   cov%   module   (path)z%5d   %3d%%   %s   (%s)�wbrz"Can't save counts files because %sr3)!r7rC�sortedr8r5rL�itemsrJrIrr�dirname�abspathr'�exists�makedirsr1�_find_executable_linenos�	linecache�getlines�joinr;�tokenize�detect_encoding�readline�write_results_file�intr:r<�dumpr@r*rD)"rZshow_missing�summary�coverdirZcallsrr�funcnameZlastfileZ	lastcfileZpfileZpmodZpfunc�cfileZcmodZcfuncZper_file�lineno�	lines_hitZsums�countr0�lnotab�sourceZ	coverpath�fp�encoding�_�n_hits�n_linesZpercent�mrErFrrr
�
write_results�s�
��





��zCoverageResults.write_resultsc
Cs�zt|d|d�}Wn>tk
rP}z td||ftjd�WY�dSd}~XYnXd}d}	|��t|d�D]r\}
}|
|kr�|�d||
�|	d7}	|d7}n.|
|kr�t|kr�|�d	�|d7}n
|�d
�|�|�d��qjW5QRX|	|fS)N�w�rlz3trace: Could not open %r for writing: %s - skippingr3)rrrrz%5d: z>>>>>> z       �)	r;r@rCr*rD�	enumerate�write�PRAGMA_NOCOVER�
expandtabs)rr�linesrirgrlr:rFrornrf�linerrr
r_)s.��



z"CoverageResults.write_results_file)NNNNN)TFN)N)rr r!rrJr>rqr_rrrr
r�s�

\cCs,i}t�|�D]\}}||krd||<q|S)Nr)�disZfindlinestarts)�code�strs�linenosrmrfrrr
�_find_lines_from_codeIs

rcCs4t||�}|jD]}t�|�r|�t||��q|Sr")r�	co_consts�inspectZiscoder>�_find_lines)r|r}r~�crrr
r�Ss



r�c	Cs�i}tj}t||d��j}t�|j�}|D]R\}}}}	}
|tjkrv|tjkrv|\}}|	\}
}t||
d�D]}d||<qh|}q(W5QRX|S)Nrsr)�token�INDENTr;r\�generate_tokensr^�STRING�range)rrlrZ
prev_ttyperE�tokZttypeZtstr�start�endrzZslineZscolZelineZecol�irrr
�
_find_strings_s


r�c
Cs�z(t�|��}|��}|j}W5QRXWn@tk
rh}z"td||ftjd�iWY�Sd}~XYnXt||d�}t	||�}t
||�S)Nz%Not printing coverage data for %r: %sr3�exec)r\r;�readrlr@rCr*rD�compiler�r�)rrE�progrlrFr|r}rrr
rXvs��
rXc	@sveZdZddd�Zdd	�Zd d
d�Zdd
�Zde_dd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)!rrrrNFc

Cs�||_||_t||�|_i|_i|_d|_||_i|_i|_	i|_
d|_|	rTt�|_|rb|j
|_nZ|rp|j|_nL|r�|r�|j|_|j|_n2|r�|j|_|j|_n|r�|j|_|j|_nd|_dSrK)r9r:r�ignorer5Zpathtobasename�	donothing�trace�_calledfuncs�_callers�
_caller_cache�
start_time�_time�globaltrace_trackcallers�globaltrace�globaltrace_countfuncs�globaltrace_lt�localtrace_trace_and_count�
localtrace�localtrace_trace�localtrace_count)
rrhr��
countfuncs�countcallers�
ignoremods�
ignoredirsr9r:�timingrrr
r�s6




zTrace.__init__cCs ddl}|j}|�|||�dS)Nr)�__main__�__dict__�runctx)r�cmdr��dictrrr
�run�sz	Trace.runc	Csh|dkri}|dkri}|js6t�|j�t�|j�zt|||�W5|jsbt�d�t�d�XdSr")r��	threading�settracer�r*r�)rr��globals�localsrrr
r��s
zTrace.runctxc	Os�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��d}|js�t�|j	�z|||�}W5|js�t�d�X|S)	N�z8descriptor 'runfunc' of 'Trace' object needs an argument�funcrz0Passing 'func' as keyword argument is deprecated)�
stacklevelz7runfunc expected at least 1 positional argument, got %dr)
r+�	TypeError�pop�warnings�warn�DeprecationWarningr�r*r�r�)�args�kwrr�r��resultrrr
�runfunc�s.

�
�z
Trace.runfuncz($self, func, /, *args, **kw)c
Cs�|j}|j}|rt|�}nd}|j}d}||jkrL|j|dk	r�|j|}n�d|j|<dd�t�|�D�}t|�dkr�dd�t�|d�D�}t|�dkr�dd�t�|d�D�}	t|	�dkr�|	dj}||j|<|dk	r�d||f}|||fS)NcSsg|]}t�|�r|�qSr)r�Z
isfunction)rrErrr
r�s
�z1Trace.file_module_function_of.<locals>.<listcomp>rcSsg|]}t|t�r|�qSr)�
isinstancer�r
rrr
r�s
�rcSsg|]}t|d�r|�qS)�	__bases__)�hasattr)rr�rrr
r�s
�z%s.%s)	�f_code�co_filenamer'�co_namer��gcZ
get_referrersr+r)
r�framer|rrrdZclsnameZfuncsZdicts�classesrrr
�file_module_function_of�s,




zTrace.file_module_function_ofcCs0|dkr,|�|�}|�|j�}d|j||f<dS�N�callr)r��f_backr�)rr��why�arg�	this_funcZparent_funcrrr
r�
s
zTrace.globaltrace_trackcallerscCs |dkr|�|�}d|j|<dSr�)r�r�)rr�r�r�r�rrr
r�s
zTrace.globaltrace_countfuncscCsj|dkrf|j}|j�dd�}|rbt|�}|dk	rf|j�||�}|sf|jrZtd||jf�|j	SndSdS)Nr��__file__z! --- modulename: %s, funcname: %s)
r��	f_globalsrLr'r�rr�rCr�r�)rr�r�r�r|rrZ	ignore_itrrr
r�!s�zTrace.globaltrace_ltcCs�|dkr~|jj}|j}||f}|j�|d�d|j|<|jrTtdt�|jdd�tj	�
|�}td||t�||�fdd�|j
S)	Nrzrr�%.2f� �r��
%s(%d): %sr()r�r��f_linenor5rLr�rCr�rrr#rY�getliner�)rr�r�r�rrfrN�bnamerrr
r�8s
��z Trace.localtrace_trace_and_countcCsd|dkr^|jj}|j}|jr4tdt�|jdd�tj�|�}td||t	�
||�fdd�|jS)Nrzr�r�r�r�r()r�r�r�r�rCr�rrr#rYr�r�)rr�r�r�rrfr�rrr
r�Gs
��zTrace.localtrace_tracecCs<|dkr6|jj}|j}||f}|j�|d�d|j|<|jS)Nrzrr)r�r�r�r5rLr�)rr�r�r�rrfrNrrr
r�TszTrace.localtrace_countcCst|j|j|j|j|jd�S)N)r9r:r7r8)rr5r9r:r�r�)rrrr
�results\s

�z
Trace.results)	rrrrrrNNF)NN)rr r!rr�r�r��__text_signature__r�r�r�r�r�r�r�r�rrrr
r�s&�
2

)	
cs�ddl}|��}|jdddd�|�dd�}|jdd	d
dd�|jd
dd
dd�|jddd
dd�|jddd
dd�|�d�}|��}|jddd
dd�|jddd
dd�|jdddd �|jd!d"d#d �|jd$d%d
d&d�|jd'd(d
d)d�|jd*d+d
d,d�|�d-d.�}|jd/d0gd1d2�|jd3d0gd4d2�|jd5d
d6d7d2�|jd8d9d:d;�|jd<|jd=d;�|��}|j�r�t�	d>��t�	d?����fd@dA��dBdC�|j
D�|_
�fdDdC�|jD�|_|j�r�|j�s�|�
dE�t|j|jdF�}|�|j|j|j�St|j|j|j|jg��s |�
dG�|j�rB|j�s8|j�rB|�
dH�|j�r\|j�s\|�
dI�|jdk�rr|�
dJ�t|j|j|j|j|j
|j|j|j|jdK�	}z�|j�r�ddl}|j}|�|�\}	}
}|jf|j�t _!dL|j|
j"|
j#|
ddM�}n^|jf|j�t _!t$j%�&|j�t j%d<t'�(|j��}
t)|
�*�|jdN�}W5QRX|jdLdddO�}|�+|||�WnPt,k
�r�}zt �-dPt j!d|f�W5d}~XYnt.k
�r�YnX|�/�}|j0�s�|�|j|j|j�dS)QNrz	--version�versionz	trace 2.0)�actionr�zMain optionsz(One of these (or --report) must be givenz-cz--count�
store_truez�Count the number of times each line is executed and write the counts to <module>.cover for each module executed, in the module's directory. See also --coverdir, --file, --no-report below.)r��helpz-tz--tracez3Print each line to sys.stdout before it is executedz-lz--listfuncsz�Keep track of which functions are executed at least once and write the results to sys.stdout after the program exits. Cannot be specified alongside --trace or --count.z-Tz--trackcallsz^Keep track of caller/called pairs and write the results to sys.stdout after the program exits.Z	Modifiersz-rz--reportz�Generate a report from a counts file; does not execute any code. --file must specify the results file to read, which must have been created in a previous run with --count --file=FILEz-Rz--no-reportz^Do not generate the coverage report files. Useful if you want to accumulate over several runs.z-fz--filez+File to accumulate counts over several runs)r�z-Cz
--coverdirz�Directory where the report files go. The coverage report for <package>.<module> will be written to file <dir>/<package>/<module>.coverz-mz	--missingz?Annotate executable lines that were not executed with ">>>>>> "z-sz	--summaryz\Write a brief summary for each file to sys.stdout. Can only be used with --count or --reportz-gz--timingzQPrefix each line with the time since the program started. Only used while tracingZFilterszCan be specified multiple timesz--ignore-module�appendzqIgnore the given module(s) and its submodules (if it is a package). Accepts comma separated list of module names.)r��defaultr�z--ignore-dirzWIgnore files in the given directory (multiple directories can be joined by os.pathsep).z--moduleFzTrace a module. �progname�?zfile to run as main program)�nargsr��	argumentszarguments to the programZstdlibZ
platstdlibcs4tj�tj�|��}|�d���d��}tj�|�S)Nz$prefixz$exec_prefix)rr�
expanduser�
expandvarsr-r	)�s)�_exec_prefix�_prefixrr
�parse_ignore_dir�szmain.<locals>.parse_ignore_dircSs$g|]}|�d�D]}|���qqS)�,)�split�strip)rr�rrrr
r�s�zmain.<locals>.<listcomp>cs&g|]}|�tj�D]}�|��qqSr)r�r�pathsep)rr�r�)r�rr
r�s�z-r/--report requires -f/--file)r9r:zLmust specify one of --trace, --count, --report, --listfuncs, or --trackcallsz8cannot specify both --listfuncs and (--trace or --count)z3--summary can only be used with --count or --reportz3progname is missing: required with the main options)r�r�r�r�r9r:r�r�)rr��__package__�
__loader__�__spec__�
__cached__r�)r�rr�r�zCannot run file %r because: %s)1�argparse�ArgumentParser�add_argumentZadd_argument_groupZadd_mutually_exclusive_groupZ	REMAINDER�
parse_argsZ
ignore_dir�	sysconfigZget_pathZ
ignore_moduleZreportr4�errorrrqZmissingrbrc�anyr�rhZ	listfuncsZ
trackcallsr�rr��module�runpyZ_get_module_detailsr�r�r*�argv�parent�loaderrrrT�io�	open_coder�r�r�r@�exit�
SystemExitr�Z	no_report)r��parserZgrpZ_grpZoptsr��tr�Zmodule_nameZmod_nameZmod_specr|ZglobsrkrFr)r�r�r�r
�mainbs��
�
�
�
�

�
���
�
�
��
�
�
��
�

�
�




��	�(rr�)N)�__all__r�rYrr*r�r�r\r�r�r{r<�timerr�r�rwrr'r1rrr�r�rXrrrrrrr
�<module>2s:20

___pycache__/pipes.cpython-38.opt-1.pyc000064400000017165151153537600013503 0ustar00U

e5d�"�@spdZddlZddlZddlZddlmZdgZdZdZdZ	dZ
d	Zd
Zeee	e
eegZ
Gdd�d�Zdd
�ZdS)a�Conversion pipeline templates.

The problem:
------------

Suppose you have some data that you want to convert to another format,
such as from GIF image format to PPM image format.  Maybe the
conversion involves several steps (e.g. piping it through compress or
uuencode).  Some of the conversion steps may require that their input
is a disk file, others may be able to read standard input; similar for
their output.  The input to the entire conversion may also be read
from a disk file or from an open file, and similar for its output.

The module lets you construct a pipeline template by sticking one or
more conversion steps together.  It will take care of creating and
removing temporary files if they are necessary to hold intermediate
data.  You can then use the template to do conversions from many
different sources to many different destinations.  The temporary
file names used are different each time the template is used.

The templates are objects so you can create templates for many
different conversion steps and store them in a dictionary, for
instance.


Directions:
-----------

To create a template:
    t = Template()

To add a conversion step to a template:
   t.append(command, kind)
where kind is a string of two characters: the first is '-' if the
command reads its standard input or 'f' if it requires a file; the
second likewise for the output. The command must be valid /bin/sh
syntax.  If input or output files are required, they are passed as
$IN and $OUT; otherwise, it must be  possible to use the command in
a pipeline.

To add a conversion step at the beginning:
   t.prepend(command, kind)

To convert a file to another file using a template:
  sts = t.copy(infile, outfile)
If infile or outfile are the empty string, standard input is read or
standard output is written, respectively.  The return value is the
exit status of the conversion pipeline.

To open a file for reading or writing through a conversion pipeline:
   fp = t.open(file, mode)
where mode is 'r' to read the file, or 'w' to write it -- just like
for the built-in function open() or for os.popen().

To create a new template object initialized to a given one:
   t2 = t.clone()
�N)�quote�TemplateZffz-fzf-�--z.-z-.c@speZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)rz'Class representing a pipeline template.cCsd|_|��dS)z-Template() returns a fresh pipeline template.rN)�	debugging�reset��self�r	�/usr/lib64/python3.8/pipes.py�__init__UszTemplate.__init__cCsd|jfS)z t.__repr__() implements repr(t).z<Template instance, steps=%r>��stepsrr	r	r
�__repr__ZszTemplate.__repr__cCs
g|_dS)z<t.reset() restores a pipeline template to its initial state.Nrrr	r	r
r^szTemplate.resetcCs"t�}|jdd�|_|j|_|S)zbt.clone() returns a new pipeline template with identical
        initial state as the current one.N)rr
r)r�tr	r	r
�clonebszTemplate.clonecCs
||_dS)z(t.debug(flag) turns debugging on or off.N)r)r�flagr	r	r
�debugjszTemplate.debugcCs�t|�td�k	rtd��|tkr.td|f��|tkr>td��|jr^|jddtkr^td��|dd	kr~t�d
|�s~td��|dd	kr�t�d|�s�td
��|j�	||f�dS)z/t.append(cmd, kind) adds a new step at the end.�z%Template.append: cmd must be a stringzTemplate.append: bad kind %rz-Template.append: SOURCE can only be prepended����z'Template.append: already ends with SINKr�f�\$IN\bz#Template.append: missing $IN in cmd�\$OUT\bz$Template.append: missing $OUT in cmdN)
�type�	TypeError�	stepkinds�
ValueError�SOURCEr
�SINK�re�search�append�r�cmd�kindr	r	r
r!nszTemplate.appendcCs�t|�td�k	rtd��|tkr.td|f��|tkr>td��|jr^|jddtkr^td��|ddkr~t�d	|�s~td
��|ddkr�t�d|�s�td��|j�	d||f�d
S)z2t.prepend(cmd, kind) adds a new step at the front.rz&Template.prepend: cmd must be a stringzTemplate.prepend: bad kind %rz+Template.prepend: SINK can only be appendedrrz,Template.prepend: already begins with SOURCErrz$Template.prepend: missing $IN in cmdrz%Template.prepend: missing $OUT in cmdN)
rrrrrr
rrr �insertr"r	r	r
�prepend~szTemplate.prependcCs6|dkr|�|�S|dkr$|�|�Std|f��dS)z~t.open(file, rw) returns a pipe or file object open for
        reading or writing; the file is the other end of the pipeline.�r�wz,Template.open: rw must be 'r' or 'w', not %rN)�open_r�open_wr)r�fileZrwr	r	r
�open�s

�z
Template.opencCsB|jst|d�S|jddtkr*td��|�|d�}t�|d�S)zit.open_r(file) and t.open_w(file) implement
        t.open(file, 'r') and t.open(file, 'w') respectively.r'rrz)Template.open_r: pipeline ends width SINKr)r
r,rr�makepipeline�os�popen�rr+r#r	r	r
r)�s
zTemplate.open_rcCsB|jst|d�S|jddtkr*td��|�d|�}t�|d�S)Nr(rrz,Template.open_w: pipeline begins with SOURCEr)r
r,rrr-r.r/r0r	r	r
r*�s
zTemplate.open_wcCst�|�||��S)N)r.�systemr-)r�infile�outfiler	r	r
�copy�sz
Template.copycCs(t||j|�}|jr$t|�d|}|S)Nzset -x; )r-r
r�print)rr2r3r#r	r	r
r-�s
zTemplate.makepipelineN)�__name__�
__module__�__qualname__�__doc__rrrrrr!r&r,r)r*r4r-r	r	r	r
rRs

cCs�g}|D]\}}|�d||dg�q|s:|�ddddg�|ddd�\}}|ddkrr|sr|�dddddg�||dd<|ddd�\}}|ddkr�|s�|�ddddg�||dd<g}tdt|��D]v}||dd	}||d	}	|ddk�s|	ddkr�t��\}
}t�|
�|�|�|||dd<||d<q�|D]�}|\}
}}}|ddk�r�d
t|�d|}|ddk�r�dt|
�d|}|dd
k�r�|
�r�|dt|
�}|dd
k�r�|�r�|dt|�}||d<�qN|dd}|dd�D]T}|dd�\}}|ddk�rTd|k�rFd|d}|d|}n|d|}�q|�r�d}|D]}|dt|�}�qrdt|d�d}|d|d|}|S)Nr�catrrr�rr�zOUT=z; zIN=�-z <z >z{ z; }z |
�
zrm -f� ztrap z; exitz 1 2 3 13 14 15)	r!r%�range�len�tempfileZmkstempr.�closer)r2r
r3�listr#r$Zgarbage�iZlkindZrkind�fdZtemp�item�infZoutfZcmdlistZrmcmdr+Ztrapcmdr	r	r
r-�s`


r-)r9rr.rBZshlexr�__all__ZFILEIN_FILEOUTZ
STDIN_FILEOUTZ
FILEIN_STDOUTZSTDIN_STDOUTrrrrr-r	r	r	r
�<module>s";�c__pycache__/ipaddress.cpython-38.pyc000064400000165113151153537600013377 0ustar00U

e5d��@s�dZdZddlZdZdZGdd�de�ZGdd	�d	e�Zd
d�Zd=d
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�ZGd#d$�d$�ZejGd%d&�d&e��ZejGd'd(�d(e��ZGd)d*�d*�ZGd+d,�d,ee�ZGd-d.�d.e�ZGd/d0�d0ee�ZGd1d2�d2�Zee_Gd3d4�d4�ZGd5d6�d6ee�ZGd7d8�d8e�Z Gd9d:�d:ee�Z!Gd;d<�d<�Z"e"e_dS)>z�A fast, lightweight IPv4/IPv6 manipulation library in Python.

This library is used to create/poke/manipulate IPv4 and IPv6 addresses
and networks.

z1.0�N� �c@seZdZdZdS)�AddressValueErrorz%A Value Error related to the address.N��__name__�
__module__�__qualname__�__doc__�r
r
�!/usr/lib64/python3.8/ipaddress.pyrsrc@seZdZdZdS)�NetmaskValueErrorz%A Value Error related to the netmask.Nrr
r
r
rrsrc	CsXz
t|�WSttfk
r"YnXz
t|�WSttfk
rFYnXtd|��dS)a�Take an IP string/int and return an object of the correct type.

    Args:
        address: A string or integer, the IP address.  Either IPv4 or
          IPv6 addresses may be supplied; integers less than 2**32 will
          be considered to be IPv4 by default.

    Returns:
        An IPv4Address or IPv6Address object.

    Raises:
        ValueError: if the *address* passed isn't either a v4 or a v6
          address

    z0%r does not appear to be an IPv4 or IPv6 addressN)�IPv4Addressrr�IPv6Address�
ValueError��addressr
r
r�
ip_addresss

�rTc	Cs\zt||�WSttfk
r$YnXzt||�WSttfk
rJYnXtd|��dS)a�Take an IP string/int and return an object of the correct type.

    Args:
        address: A string or integer, the IP network.  Either IPv4 or
          IPv6 networks may be supplied; integers less than 2**32 will
          be considered to be IPv4 by default.

    Returns:
        An IPv4Network or IPv6Network object.

    Raises:
        ValueError: if the string passed isn't either a v4 or a v6
          address. Or if the network has host bits set.

    z0%r does not appear to be an IPv4 or IPv6 networkN)�IPv4Networkrr�IPv6Networkr)r�strictr
r
r�
ip_network9s�rc	CsXz
t|�WSttfk
r"YnXz
t|�WSttfk
rFYnXtd|��dS)agTake an IP string/int and return an object of the correct type.

    Args:
        address: A string or integer, the IP address.  Either IPv4 or
          IPv6 addresses may be supplied; integers less than 2**32 will
          be considered to be IPv4 by default.

    Returns:
        An IPv4Interface or IPv6Interface object.

    Raises:
        ValueError: if the string passed isn't either a v4 or a v6
          address.

    Notes:
        The IPv?Interface classes describe an Address on a particular
        Network, so they're basically a combination of both the Address
        and Network classes.

    z2%r does not appear to be an IPv4 or IPv6 interfaceN)�
IPv4Interfacerr�
IPv6Interfacerrr
r
r�ip_interfaceWs

�rcCs0z|�dd�WStk
r*td��YnXdS)a`Represent an address as 4 packed bytes in network (big-endian) order.

    Args:
        address: An integer representation of an IPv4 IP address.

    Returns:
        The integer address packed as 4 bytes in network (big-endian) order.

    Raises:
        ValueError: If the integer is negative or too large to be an
          IPv4 IP address.

    ��bigz&Address negative or too large for IPv4N��to_bytes�
OverflowErrorrrr
r
r�v4_int_to_packedzsrcCs0z|�dd�WStk
r*td��YnXdS)z�Represent an address as 16 packed bytes in network (big-endian) order.

    Args:
        address: An integer representation of an IPv6 IP address.

    Returns:
        The integer address packed as 16 bytes in network (big-endian) order.

    �rz&Address negative or too large for IPv6Nrrr
r
r�v6_int_to_packed�s
r!cCs*t|��d�}t|�dkr&td|��|S)zAHelper to split the netmask and raise AddressValueError if needed�/�zOnly one '/' permitted in %r)�str�split�lenr)r�addrr
r
r�_split_optional_netmask�sr(ccsNt|�}t|�}}|D]&}|j|jdkr:||fV|}|}q||fVdS)z�Find a sequence of sorted deduplicated IPv#Address.

    Args:
        addresses: a list of IPv#Address objects.

    Yields:
        A tuple containing the first and last IP addresses in the sequence.

    �N)�iter�next�_ip)�	addresses�it�first�last�ipr
r
r�_find_address_range�s

r2cCs$|dkr|St|||d@���S)z�Count the number of zero bits on the right hand side.

    Args:
        number: an integer.
        bits: maximum number of bits to count.

    Returns:
        The number of zero bits on the right hand side of the number.

    rr))�min�
bit_length)Znumber�bitsr
r
r�_count_righthand_zero_bits�sr6ccs�t|t�rt|t�std��|j|jkr8td||f��||krHtd��|jdkrXt}n|jdkrht}ntd��|j}|j}|j}||kr�t	t
||�||d��d�}||||f�}|V|d|>7}|d|jkr�q�q�dS)	a�Summarize a network range given the first and last IP addresses.

    Example:
        >>> list(summarize_address_range(IPv4Address('192.0.2.0'),
        ...                              IPv4Address('192.0.2.130')))
        ...                                #doctest: +NORMALIZE_WHITESPACE
        [IPv4Network('192.0.2.0/25'), IPv4Network('192.0.2.128/31'),
         IPv4Network('192.0.2.130/32')]

    Args:
        first: the first IPv4Address or IPv6Address in the range.
        last: the last IPv4Address or IPv6Address in the range.

    Returns:
        An iterator of the summarized IPv(4|6) network objects.

    Raise:
        TypeError:
            If the first and last objects are not IP addresses.
            If the first and last objects are not the same version.
        ValueError:
            If the last object is not greater than the first.
            If the version of the first address is not 4 or 6.

    z1first and last must be IP addresses, not networks�%%s and %s are not of the same versionz*last IP address must be greater than firstr�zunknown IP versionr)N)
�
isinstance�_BaseAddress�	TypeError�versionrrr�_max_prefixlenr,r3r6r4�	_ALL_ONES)r/r0r1Zip_bitsZ	first_intZlast_intZnbits�netr
r
r�summarize_address_range�s8
��


�r@ccs�t|�}i}|rV|��}|��}|�|�}|dkr<|||<q||kr||=|�|�qd}t|���D]$}|dk	r�|j|jkr�qf|V|}qfdS)auLoops through the addresses, collapsing concurrent netblocks.

    Example:

        ip1 = IPv4Network('192.0.2.0/26')
        ip2 = IPv4Network('192.0.2.64/26')
        ip3 = IPv4Network('192.0.2.128/26')
        ip4 = IPv4Network('192.0.2.192/26')

        _collapse_addresses_internal([ip1, ip2, ip3, ip4]) ->
          [IPv4Network('192.0.2.0/24')]

        This shouldn't be called directly; it is called via
          collapse_addresses([]).

    Args:
        addresses: A list of IPv4Network's or IPv6Network's

    Returns:
        A list of IPv4Network's or IPv6Network's depending on what we were
        passed.

    N)�list�pop�supernet�get�append�sorted�values�broadcast_address)r-Zto_merge�subnetsr?rCZexistingr0r
r
r�_collapse_addresses_internals$

rJc	Cs0g}g}g}|D]�}t|t�rR|rF|dj|jkrFtd||df��|�|�q|j|jkr�|r�|dj|jkr�td||df��z|�|j�Wq�tk
r�|�|j	�Yq�Xq|r�|dj|jkr�td||df��|�|�qt
t|��}|�r$t|�D]\}}|�
t||���qt||�S)a�Collapse a list of IP objects.

    Example:
        collapse_addresses([IPv4Network('192.0.2.0/25'),
                            IPv4Network('192.0.2.128/25')]) ->
                           [IPv4Network('192.0.2.0/24')]

    Args:
        addresses: An iterator of IPv4Network or IPv6Network objects.

    Returns:
        An iterator of the collapsed IPv(4|6)Network objects.

    Raises:
        TypeError: If passed a list of mixed version objects.

    ���r7)r9r:�_versionr;rE�
_prefixlenr=r1�AttributeError�network_addressrF�setr2�extendr@rJ)r-ZaddrsZipsZnetsr1r/r0r
r
r�collapse_addresses2s@
���rRcCs(t|t�r|��St|t�r$|��StS)a2Return a key suitable for sorting between networks and addresses.

    Address and Network objects are not sortable by default; they're
    fundamentally different so the expression

        IPv4Address('192.0.2.0') <= IPv4Network('192.0.2.0/24')

    doesn't make any sense.  There are some times however, where you may wish
    to have ipaddress sort these for you anyway. If you need to do this, you
    can use this function as the key= argument to sorted().

    Args:
      obj: either a Network or Address object.
    Returns:
      appropriate key.

    )r9�_BaseNetwork�_get_networks_keyr:�_get_address_key�NotImplemented)�objr
r
r�get_mixed_type_keyhs


rXc@s�eZdZdZdZedd��Zedd��Zedd��Zed	d
��Z	dd�Z
d
d�Zedd��Z
edd��Zedd��Zedd��Zedd��Zedd��Zdd�ZdS)�_IPAddressBasezThe mother class.r
cCs|��S)z:Return the longhand version of the IP address as a string.)�_explode_shorthand_ip_string��selfr
r
r�exploded�sz_IPAddressBase.explodedcCst|�S)z;Return the shorthand version of the IP address as a string.�r$r[r
r
r�
compressed�sz_IPAddressBase.compressedcCs|��S)aIThe name of the reverse DNS pointer for the IP address, e.g.:
            >>> ipaddress.ip_address("127.0.0.1").reverse_pointer
            '1.0.0.127.in-addr.arpa'
            >>> ipaddress.ip_address("2001:db8::1").reverse_pointer
            '1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa'

        )�_reverse_pointerr[r
r
r�reverse_pointer�s	z_IPAddressBase.reverse_pointercCsdt|�f}t|��dS)Nz%200s has no version specified��type�NotImplementedError�r\�msgr
r
rr<�sz_IPAddressBase.versioncCsF|dkrd}t|||jf��||jkrBd}t|||j|jf��dS)Nrz-%d (< 0) is not permitted as an IPv%d addressz2%d (>= 2**%d) is not permitted as an IPv%d address)rrLr>r=)r\rrfr
r
r�_check_int_address�s

�z!_IPAddressBase._check_int_addresscCs.t|�}||kr*d}t|||||jf��dS)Nz6%r (len %d != %d) is not permitted as an IPv%d address)r&rrL)r\rZexpected_lenZaddress_lenrfr
r
r�_check_packed_address�s�z$_IPAddressBase._check_packed_addresscCs|j|j|?AS)z�Turn the prefix length into a bitwise netmask

        Args:
            prefixlen: An integer, the prefix length.

        Returns:
            An integer.

        )r>)�cls�	prefixlenr
r
r�_ip_int_from_prefix�sz"_IPAddressBase._ip_int_from_prefixc	Cs\t||j�}|j|}||?}d|>d}||krX|jd}|�|d�}d}t||��|S)aReturn prefix length from the bitwise netmask.

        Args:
            ip_int: An integer, the netmask in expanded bitwise format

        Returns:
            An integer, the prefix length.

        Raises:
            ValueError: If the input intermingles zeroes & ones
        r)�rz&Netmask pattern %r mixes zeroes & ones)r6r=rr)	ri�ip_intZtrailing_zeroesrjZleading_onesZall_onesZbyteslenZdetailsrfr
r
r�_prefix_from_ip_int�s
�

z"_IPAddressBase._prefix_from_ip_intcCsd|}t|�d�dS)Nz%r is not a valid netmask)r)riZnetmask_strrfr
r
r�_report_invalid_netmask�sz&_IPAddressBase._report_invalid_netmaskcCsl|��r|��s|�|�zt|�}Wntk
rD|�|�YnXd|kr\|jkshn|�|�|S)a	Return prefix length from a numeric string

        Args:
            prefixlen_str: The string to be converted

        Returns:
            An integer, the prefix length.

        Raises:
            NetmaskValueError: If the input is not a valid netmask
        r)�isascii�isdigitro�intrr=)riZ
prefixlen_strrjr
r
r�_prefix_from_prefix_string�s

z)_IPAddressBase._prefix_from_prefix_stringcCs�z|�|�}Wntk
r,|�|�YnXz|�|�WStk
rNYnX||jN}z|�|�WStk
r�|�|�YnXdS)aTurn a netmask/hostmask string into a prefix length

        Args:
            ip_str: The netmask/hostmask to be converted

        Returns:
            An integer, the prefix length.

        Raises:
            NetmaskValueError: If the input is not a valid netmask/hostmask
        N)�_ip_int_from_stringrrornrr>)ri�ip_strrmr
r
r�_prefix_from_ip_string�s
z%_IPAddressBase._prefix_from_ip_stringcCsHt|ttf�r||jfSt|t�s*t|�}t|�dkr:|S|d|jfS)z�Helper function to parse address of Network/Interface.

        Arg:
            address: Argument of Network/Interface.

        Returns:
            (addr, prefix) tuple.
        r)r)r9�bytesrrr=�tupler(r&)rirr
r
r�_split_addr_prefixs

z!_IPAddressBase._split_addr_prefixcCs|jt|�ffS�N)�	__class__r$r[r
r
r�
__reduce__/sz_IPAddressBase.__reduce__N)rrrr	�	__slots__�propertyr]r_rar<rgrh�classmethodrkrnrorsrvryr|r
r
r
rrY�s2




	




!
rYc@sdeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�ZdS)r:z�A generic IP object.

    This IP class contains the version independent methods which are
    used by single IP addresses.
    r
cCs|jSrz�r,r[r
r
r�__int__>sz_BaseAddress.__int__cCs8z|j|jko|j|jkWStk
r2tYSXdSrz)r,rLrNrV�r\�otherr
r
r�__eq__As
�z_BaseAddress.__eq__cCsFt|t�stS|j|jkr*td||f��|j|jkrB|j|jkSdS�Nr7F)r9r:rVrLr;r,r�r
r
r�__lt__Hs
�z_BaseAddress.__lt__cCs t|t�stS|�t|�|�Srz�r9rrrVr{r�r
r
r�__add__Ts
z_BaseAddress.__add__cCs t|t�stS|�t|�|�Srzr�r�r
r
r�__sub__Ys
z_BaseAddress.__sub__cCsd|jjt|�fS�Nz%s(%r)�r{rr$r[r
r
r�__repr__^sz_BaseAddress.__repr__cCst|�|j��Srz)r$�_string_from_ip_intr,r[r
r
r�__str__asz_BaseAddress.__str__cCsttt|j���Srz)�hash�hexrrr,r[r
r
r�__hash__dsz_BaseAddress.__hash__cCs
|j|fSrz�rLr[r
r
rrUgsz_BaseAddress._get_address_keycCs|j|jffSrz)r{r,r[r
r
rr|jsz_BaseAddress.__reduce__N)rrrr	r}r�r�r�r�r�r�r�r�rUr|r
r
r
rr:3sr:c@s`eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
ejdd��Zejdd��Zedd��Zedd��Zedd��Zed d!��Zed"d#��Zed$d%��Zd&d'�Zd(d)�Zd*d+�ZdFd.d/�ZdGd0d1�Zed2d3��Zed4d5��Z d6d7�Z!d8d9�Z"ed:d;��Z#ed<d=��Z$ed>d?��Z%ed@dA��Z&edBdC��Z'edDdE��Z(d-S)HrSz}A generic IP network object.

    This IP class contains the version independent methods which are
    used by networks.
    cCsd|jjt|�fSr�r�r[r
r
rr�vsz_BaseNetwork.__repr__cCsd|j|jfS�N�%s/%d)rOrjr[r
r
rr�ysz_BaseNetwork.__str__ccs8t|j�}t|j�}t|d|�D]}|�|�Vq"dS)z�Generate Iterator over usable hosts in a network.

        This is like __iter__ except it doesn't return the network
        or broadcast addresses.

        r)N�rrrOrH�range�_address_class�r\�network�	broadcast�xr
r
r�hosts|s

z_BaseNetwork.hostsccs8t|j�}t|j�}t||d�D]}|�|�Vq"dS�Nr)r�r�r
r
r�__iter__�s

z_BaseNetwork.__iter__cCslt|j�}t|j�}|dkr>|||kr0td��|�||�S|d7}|||krZtd��|�||�SdS)Nrzaddress out of ranger))rrrOrH�
IndexErrorr�)r\�nr�r�r
r
r�__getitem__�s

z_BaseNetwork.__getitem__cCs^t|t�stS|j|jkr*td||f��|j|jkrB|j|jkS|j|jkrZ|j|jkSdSr�)r9rSrVrLr;rO�netmaskr�r
r
rr��s
�z_BaseNetwork.__lt__cCsLz.|j|jko,|j|jko,t|j�t|j�kWStk
rFtYSXdSrz)rLrOrrr�rNrVr�r
r
rr��s
��z_BaseNetwork.__eq__cCstt|j�t|j�A�Srz)r�rrrOr�r[r
r
rr��sz_BaseNetwork.__hash__cCs8|j|jkrdSt|t�rdS|j|jj@|jjkSdS�NF)rLr9rSr,r�rOr�r
r
r�__contains__�s

z_BaseNetwork.__contains__cCs(|j|kp&|j|kp&|j|kp&|j|kS)z*Tell if self is partly contained in other.)rOrHr�r
r
r�overlaps�s



�z_BaseNetwork.overlapscCs|�t|j�t|j�B�Srz)r�rrrO�hostmaskr[r
r
rrH�s�z_BaseNetwork.broadcast_addresscCs|�t|j�|jA�Srz)r�rrr�r>r[r
r
rr��sz_BaseNetwork.hostmaskcCsd|j|jfSr�)rOrMr[r
r
r�with_prefixlen�sz_BaseNetwork.with_prefixlencCsd|j|jfS�N�%s/%s)rOr�r[r
r
r�with_netmask�sz_BaseNetwork.with_netmaskcCsd|j|jfSr�)rOr�r[r
r
r�
with_hostmask�sz_BaseNetwork.with_hostmaskcCst|j�t|j�dS)z&Number of hosts in the current subnet.r))rrrHrOr[r
r
r�
num_addresses�sz_BaseNetwork.num_addressescCsdt|�f}t|��dS)Nz%%200s has no associated address classrbrer
r
rr��sz_BaseNetwork._address_classcCs|jSrz)rMr[r
r
rrj�sz_BaseNetwork.prefixlenccs|j|jkstd||f��t|t�s2td|��|�|�sLtd||f��||krXdS|�d|j|jf�}|�	�\}}||kr�||kr�|�|�r�|V|�	�\}}qz|�|�r�|V|�	�\}}qzt
d|||f��qz||kr�|Vn"||kr�|Vnt
d|||f��dS)a�Remove an address from a larger block.

        For example:

            addr1 = ip_network('192.0.2.0/28')
            addr2 = ip_network('192.0.2.1/32')
            list(addr1.address_exclude(addr2)) =
                [IPv4Network('192.0.2.0/32'), IPv4Network('192.0.2.2/31'),
                 IPv4Network('192.0.2.4/30'), IPv4Network('192.0.2.8/29')]

        or IPv6:

            addr1 = ip_network('2001:db8::1/32')
            addr2 = ip_network('2001:db8::1/128')
            list(addr1.address_exclude(addr2)) =
                [ip_network('2001:db8::1/128'),
                 ip_network('2001:db8::2/127'),
                 ip_network('2001:db8::4/126'),
                 ip_network('2001:db8::8/125'),
                 ...
                 ip_network('2001:db8:8000::/33')]

        Args:
            other: An IPv4Network or IPv6Network object of the same type.

        Returns:
            An iterator of the IPv(4|6)Network objects which is self
            minus other.

        Raises:
            TypeError: If self and other are of differing address
              versions, or if other is not a network object.
            ValueError: If other is not completely contained by self.

        r7z%s is not a network objectz%s not contained in %sNr�z3Error performing exclusion: s1: %s s2: %s other: %s)rLr;r9rS�	subnet_ofrr{rOrjrI�AssertionError)r\r��s1�s2r
r
r�address_exclude�s@$�


�

��z_BaseNetwork.address_excludecCs`|j|jkrtd||f��|j|jkr,dS|j|jkr<dS|j|jkrLdS|j|jkr\dSdS)a�Compare two IP objects.

        This is only concerned about the comparison of the integer
        representation of the network addresses.  This means that the
        host bits aren't considered at all in this method.  If you want
        to compare host bits, you can easily enough do a
        'HostA._ip < HostB._ip'

        Args:
            other: An IP object.

        Returns:
            If the IP versions of self and other are the same, returns:

            -1 if self < other:
              eg: IPv4Network('192.0.2.0/25') < IPv4Network('192.0.2.128/25')
              IPv6Network('2001:db8::1000/124') <
                  IPv6Network('2001:db8::2000/124')
            0 if self == other
              eg: IPv4Network('192.0.2.0/24') == IPv4Network('192.0.2.0/24')
              IPv6Network('2001:db8::1000/124') ==
                  IPv6Network('2001:db8::1000/124')
            1 if self > other
              eg: IPv4Network('192.0.2.128/25') > IPv4Network('192.0.2.0/25')
                  IPv6Network('2001:db8::2000/124') >
                      IPv6Network('2001:db8::1000/124')

          Raises:
              TypeError if the IP versions are different.

        z"%s and %s are not of the same typerKr)r)rLr;rOr�r�r
r
r�compare_networks6s!�z_BaseNetwork.compare_networkscCs|j|j|jfS)z�Network-only key function.

        Returns an object that identifies this address' network and
        netmask. This function is a suitable "key" argument for sorted()
        and list.sort().

        )rLrOr�r[r
r
rrTfsz_BaseNetwork._get_networks_keyr)Nc	cs�|j|jkr|VdS|dk	rJ||jkr0td��|dkr@td��||j}|dkrZtd��|j|}||jkr~td||f��t|j�}t|j�d}t|j�d|?}t|||�D]}|�||f�}|Vq�dS)a�The subnets which join to make the current subnet.

        In the case that self contains only one IP
        (self._prefixlen == 32 for IPv4 or self._prefixlen == 128
        for IPv6), yield an iterator with just ourself.

        Args:
            prefixlen_diff: An integer, the amount the prefix length
              should be increased by. This should not be set if
              new_prefix is also set.
            new_prefix: The desired new prefix length. This must be a
              larger number (smaller prefix) than the existing prefix.
              This should not be set if prefixlen_diff is also set.

        Returns:
            An iterator of IPv(4|6) objects.

        Raises:
            ValueError: The prefixlen_diff is too small or too large.
                OR
            prefixlen_diff and new_prefix are both set or new_prefix
              is a smaller number than the current prefix (smaller
              number means a larger network)

        Nznew prefix must be longerr)�(cannot set prefixlen_diff and new_prefixrzprefix length diff must be > 0z0prefix length diff %d is invalid for netblock %s)	rMr=rrrrOrHr�r�r{)	r\�prefixlen_diff�
new_prefix�
new_prefixlen�start�end�stepZnew_addrZcurrentr
r
rrIps2



��
z_BaseNetwork.subnetscCs�|jdkr|S|dk	rB||jkr(td��|dkr8td��|j|}|j|}|dkrftd|j|f��|�t|j�t|j�|>@|f�S)a�The supernet containing the current network.

        Args:
            prefixlen_diff: An integer, the amount the prefix length of
              the network should be decreased by.  For example, given a
              /24 network and a prefixlen_diff of 3, a supernet with a
              /21 netmask is returned.

        Returns:
            An IPv4 network object.

        Raises:
            ValueError: If self.prefixlen - prefixlen_diff < 0. I.e., you have
              a negative prefix length.
                OR
            If prefixlen_diff and new_prefix are both set or new_prefix is a
              larger number than the current prefix (larger number means a
              smaller network)

        rNznew prefix must be shorterr)r�z;current prefixlen is %d, cannot have a prefixlen_diff of %d)rMrrjr{rrrOr�)r\r�r�r�r
r
rrC�s&



���z_BaseNetwork.supernetcCs|jjo|jjS�z�Test if the address is reserved for multicast use.

        Returns:
            A boolean, True if the address is a multicast address.
            See RFC 2373 2.7 for details.

        )rO�is_multicastrHr[r
r
rr��s	�z_BaseNetwork.is_multicastcCshz:|j|jkr"t|�d|�d���|j|jko8|j|jkWStk
rbtd|�d|����YnXdS)Nz and z are not of the same versionz*Unable to test subnet containment between )rLr;rOrHrN)�a�br
r
r�
_is_subnet_of�s
�z_BaseNetwork._is_subnet_ofcCs|�||�S)z1Return True if this network is a subnet of other.�r�r�r
r
rr��sz_BaseNetwork.subnet_ofcCs|�||�S)z3Return True if this network is a supernet of other.r�r�r
r
r�supernet_of�sz_BaseNetwork.supernet_ofcCs|jjo|jjS)��Test if the address is otherwise IETF reserved.

        Returns:
            A boolean, True if the address is within one of the
            reserved IPv6 Network ranges.

        )rO�is_reservedrHr[r
r
rr��s	�z_BaseNetwork.is_reservedcCs|jjo|jjS�z�Test if the address is reserved for link-local.

        Returns:
            A boolean, True if the address is reserved per RFC 4291.

        )rO�
is_link_localrHr[r
r
rr��s�z_BaseNetwork.is_link_localcCs|jjo|jjS)z�Test if this address is allocated for private networks.

        Returns:
            A boolean, True if the address is reserved per
            iana-ipv4-special-registry or iana-ipv6-special-registry.

        )rO�
is_privaterHr[r
r
rr�s	�z_BaseNetwork.is_privatecCs|jS)z�Test if this address is allocated for public networks.

        Returns:
            A boolean, True if the address is not reserved per
            iana-ipv4-special-registry or iana-ipv6-special-registry.

        �r�r[r
r
r�	is_globals	z_BaseNetwork.is_globalcCs|jjo|jjS)��Test if the address is unspecified.

        Returns:
            A boolean, True if this is the unspecified address as defined in
            RFC 2373 2.5.2.

        )rO�is_unspecifiedrHr[r
r
rr�s	�z_BaseNetwork.is_unspecifiedcCs|jjo|jjS)��Test if the address is a loopback address.

        Returns:
            A boolean, True if the address is a loopback address as defined in
            RFC 2373 2.5.3.

        )rO�is_loopbackrHr[r
r
rr�(s	�z_BaseNetwork.is_loopback)r)N)r)N))rrrr	r�r�r�r�r�r�r�r�r�r��	functools�cached_propertyrHr�r~r�r�r�r�r�rjr�r�rTrIrCr��staticmethodr�r�r�r�r�r�r�r�r�r
r
r
rrSnsd








K0

5
)








rSc@s�eZdZdZdZdZdedZeZiZ	dd�Z
edd	��Zed
d��Z
edd
��Zedd��Zdd�Zedd��Zedd��ZdS)�_BaseV4zyBase IPv4 object.

    The following methods are used by IPv4 objects in both single IP
    addresses and networks.

    r
rr#r)cCst|�Srzr^r[r
r
rrZHsz$_BaseV4._explode_shorthand_ip_stringcCs�||jkr�t|t�r<|}d|kr.|jksjn|�|�n.z|�|�}Wntk
rh|�|�}YnXt|�	|��}||f|j|<|j|S�aMake a (netmask, prefix_len) tuple from the given argument.

        Argument can be:
        - an integer (the prefix length)
        - a string representing the prefix length (e.g. "24")
        - a string representing the prefix netmask (e.g. "255.255.255.0")
        r)
�_netmask_cacher9rrr=rorsrrvr
rk�ri�argrjr�r
r
r�
_make_netmaskKs	

z_BaseV4._make_netmaskc
Cs~|std��|�d�}t|�dkr.td|��zt�t|j|�d�WStk
rx}ztd||f�d�W5d}~XYnXdS)aTurn the given IP string into an integer for comparison.

        Args:
            ip_str: A string, the IP ip_str.

        Returns:
            The IP ip_str as an integer.

        Raises:
            AddressValueError: if ip_str isn't a valid IPv4 Address.

        �Address cannot be empty�.rzExpected 4 octets in %rr�%s in %rN)rr%r&rr�
from_bytes�map�_parse_octetr)riruZoctets�excr
r
rrtes
z_BaseV4._ip_int_from_stringcCs�|std��|��r|��s,d}t||��t|�dkrHd}t||��|dkrl|ddkrld}t||��t|d�}|d	kr�td
|��|S)aConvert a decimal octet into an integer.

        Args:
            octet_str: A string, the number to parse.

        Returns:
            The octet as an integer.

        Raises:
            ValueError: if the octet isn't strictly a decimal from [0..255].

        zEmpty octet not permittedz#Only decimal digits permitted in %r�z$At most 3 characters permitted in %r�0rz%Leading zeros are not permitted in %r�
�zOctet %d (> 255) not permitted)rrprqr&rr)riZ	octet_strrfZ	octet_intr
r
rr�s
z_BaseV4._parse_octetcCsd�tt|�dd���S)z�Turns a 32-bit integer into dotted decimal notation.

        Args:
            ip_int: An integer, the IP address.

        Returns:
            The IP address as a string in dotted decimal notation.

        r�rr)�joinr�r$r)rirmr
r
rr��sz_BaseV4._string_from_ip_intcCs&t|��d�ddd�}d�|�dS)z�Return the reverse DNS pointer name for the IPv4 address.

        This implements the method described in RFC1035 3.5.

        r�NrKz
.in-addr.arpa)r$r%r�)r\Zreverse_octetsr
r
rr`�sz_BaseV4._reverse_pointercCs|jSrz�r=r[r
r
r�
max_prefixlen�sz_BaseV4.max_prefixlencCs|jSrzr�r[r
r
rr<�sz_BaseV4.versionN)rrrr	r}rL�
IPV4LENGTHr>r=r�rZrr�rtr�r�r`r~r�r<r
r
r
rr�5s(


#
	
r�c@s�eZdZdZdZdd�Zedd��Zedd��Zee	�
�d	d
���Zee	�
�dd���Zed
d��Z
edd��Zedd��Zedd��ZdS)r
z/Represent and manipulate single IPv4 Addresses.�r,�__weakref__cCsrt|t�r|�|�||_dSt|t�rF|�|d�t�|d�|_dSt|�}d|krbtd|��|�	|�|_dS)a�
        Args:
            address: A string or integer representing the IP

              Additionally, an integer can be passed, so
              IPv4Address('192.0.2.1') == IPv4Address(3221225985).
              or, more generally
              IPv4Address(int(IPv4Address('192.0.2.1'))) ==
                IPv4Address('192.0.2.1')

        Raises:
            AddressValueError: If ipaddress isn't a valid IPv4 address.

        Nrrr"�Unexpected '/' in %r�
r9rrrgr,rwrhr�r$rrt�r\rZaddr_strr
r
r�__init__�s


zIPv4Address.__init__cCs
t|j�S�z*The binary representation of this address.)rr,r[r
r
r�packed�szIPv4Address.packedcCs||jjkS)z�Test if the address is otherwise IETF reserved.

         Returns:
             A boolean, True if the address is within the
             reserved IPv4 Network range.

        )�
_constants�_reserved_networkr[r
r
rr��s	zIPv4Address.is_reservedcst�fdd��jjD��S)z�Test if this address is allocated for private networks.

        Returns:
            A boolean, True if the address is reserved per
            iana-ipv4-special-registry.

        c3s|]}�|kVqdSrzr
��.0r?r[r
r�	<genexpr>sz)IPv4Address.is_private.<locals>.<genexpr>��anyr��_private_networksr[r
r[rr��s
zIPv4Address.is_privatecCs||jjko|jSrz)r��_public_networkr�r[r
r
rr�szIPv4Address.is_globalcCs||jjkS)z�Test if the address is reserved for multicast use.

        Returns:
            A boolean, True if the address is multicast.
            See RFC 3171 for details.

        �r��_multicast_networkr[r
r
rr�s	zIPv4Address.is_multicastcCs||jjkS)z�Test if the address is unspecified.

        Returns:
            A boolean, True if this is the unspecified address as defined in
            RFC 5735 3.

        )r��_unspecified_addressr[r
r
rr�s	zIPv4Address.is_unspecifiedcCs||jjkS)z�Test if the address is a loopback address.

        Returns:
            A boolean, True if the address is a loopback per RFC 3330.

        )r��_loopback_networkr[r
r
rr�"szIPv4Address.is_loopbackcCs||jjkS)z�Test if the address is reserved for link-local.

        Returns:
            A boolean, True if the address is link-local per RFC 3927.

        �r��_linklocal_networkr[r
r
rr�,szIPv4Address.is_link_localN)rrrr	r}r�r~r�r�r��	lru_cacher�r�r�r�r�r�r
r
r
rr
�s*#








	r
c@sxeZdZdd�Zejdd��Zdd�Zdd�Zd	d
�Z	dd�Z
ejZe
d
d��Ze
dd��Ze
dd��Ze
dd��ZdS)rcCsD|�|�\}}t�||�t||fdd�|_|jj|_|jj|_dS�NF)r)ryr
r�rr�r�rM�r\rr'�maskr
r
rr�9s

zIPv4Interface.__init__cCs|jjSrz�r�r�r[r
r
rr�AszIPv4Interface.hostmaskcCsd|�|j�|jfSr��r�r,rMr[r
r
rr�Es�zIPv4Interface.__str__cCsFt�||�}|r|tkr|Sz|j|jkWStk
r@YdSXdSr�)r
r�rVr�rN�r\r�Z
address_equalr
r
rr�IszIPv4Interface.__eq__cCsRt�||�}|tkrtSz|j|jkp4|j|jko4|WStk
rLYdSXdSr�)r
r�rVr�rN�r\r�Zaddress_lessr
r
rr�Us�zIPv4Interface.__lt__cCst|j|jt|jj�f�Srz�r�r,rMrrr�rOr[r
r
rr�aszIPv4Interface.__hash__cCs
t|j�Srz)r
r,r[r
r
rr1fszIPv4Interface.ipcCsd|�|j�|jfSr�rr[r
r
rr�js�zIPv4Interface.with_prefixlencCsd|�|j�|jfSr��r�r,r�r[r
r
rr�os�zIPv4Interface.with_netmaskcCsd|�|j�|jfSr��r�r,r�r[r
r
rr�ts�zIPv4Interface.with_hostmaskN)rrrr�r�r�r�r�r�r�r�rYr|r~r1r�r�r�r
r
r
rr7s 



rc@s2eZdZdZeZddd�Zee�	�dd���Z
dS)	raeThis class represents and manipulates 32-bit IPv4 network + addresses..

    Attributes: [examples for IPv4Network('192.0.2.0/27')]
        .network_address: IPv4Address('192.0.2.0')
        .hostmask: IPv4Address('0.0.0.31')
        .broadcast_address: IPv4Address('192.0.2.32')
        .netmask: IPv4Address('255.255.255.224')
        .prefixlen: 27

    Tcs�|�|�\�}t��|_|�|�\|_|_t|j�}|t|j�@|krl|rXtd|��nt|t|j�@�|_|j|jdkr�|j	|_
n|j|jkr��fdd�|_
dS)aInstantiate a new IPv4 network object.

        Args:
            address: A string or integer representing the IP [& network].
              '192.0.2.0/24'
              '192.0.2.0/255.255.255.0'
              '192.0.2.0/0.0.0.255'
              are all functionally the same in IPv4. Similarly,
              '192.0.2.1'
              '192.0.2.1/255.255.255.255'
              '192.0.2.1/32'
              are also functionally equivalent. That is to say, failing to
              provide a subnetmask will create an object with a mask of /32.

              If the mask (portion after the / in the argument) is given in
              dotted quad form, it is treated as a netmask if it starts with a
              non-zero field (e.g. /255.0.0.0 == /8) and as a hostmask if it
              starts with a zero field (e.g. 0.255.255.255 == /8), with the
              single exception of an all-zero mask which is treated as a
              netmask == /0. If no mask is given, a default of /32 is used.

              Additionally, an integer can be passed, so
              IPv4Network('192.0.2.1') == IPv4Network(3221225985)
              or, more generally
              IPv4Interface(int(IPv4Interface('192.0.2.1'))) ==
                IPv4Interface('192.0.2.1')

        Raises:
            AddressValueError: If ipaddress isn't a valid IPv4 address.
            NetmaskValueError: If the netmask isn't valid for
              an IPv4 address.
            ValueError: If strict is True and a network address is not
              supplied.
        �%s has host bits setr)cs
t��gSrz)r
r
�r'r
r�<lambda>��z&IPv4Network.__init__.<locals>.<lambda>N)ryr
rOr�r�rMrrrr=r�r��r\rrr�r�r
rrr��s#

�
zIPv4Network.__init__cCs&|jtd�ko|jtd�ko$|jS)z�Test if this address is allocated for public networks.

        Returns:
            A boolean, True if the address is not reserved per
            iana-ipv4-special-registry.

        �
100.64.0.0/10)rOrrHr�r[r
r
rr��s

��zIPv4Network.is_globalN)T)rrrr	r
r�r�r~r�r�r�r
r
r
rrzs
4rc@s�eZdZed�Zed�Zed�Zed�Zed�ed�ed�ed�ed�ed�ed	�ed
�ed�ed�ed
�ed�ed�ed�gZed�Z	e
d�ZdS)�_IPv4Constantsz169.254.0.0/16z127.0.0.0/8z224.0.0.0/4rz	0.0.0.0/8z
10.0.0.0/8z
172.16.0.0/12z192.0.0.0/29z192.0.0.170/31z192.0.2.0/24z192.168.0.0/16z
198.18.0.0/15z198.51.100.0/24z203.0.113.0/24z240.0.0.0/4z255.255.255.255/32z0.0.0.0N)rrrrr�r�r�r�r�r�r
r�r
r
r
rr�s*�rc@s�eZdZdZdZdZdedZdZe	d�Z
eZiZe
dd	��Ze
d
d��Ze
dd
��Ze
dd��Ze
ddd��Zdd�Zdd�Zedd��Zedd��ZdS)�_BaseV6zyBase IPv6 object.

    The following methods are used by IPv6 objects in both single IP
    addresses and networks.

    r
r8r#r)rlZ0123456789ABCDEFabcdefcCsl||jkrbt|t�r<|}d|kr.|jksFn|�|�n
|�|�}t|�|��}||f|j|<|j|Sr�)r�r9rrr=rorsrrkr�r
r
rr�s	


z_BaseV6._make_netmaskc
Cs�|std��|�d�}d}t|�|kr:d||f}t|��d|dkr�zt|���j}Wn4tk
r�}ztd||f�d�W5d}~XYnX|�d	|d
?d@�|�d	|d@�|jd}t|�|kr�d
|d|f}t|��d}tdt|�d�D]*}	||	s�|dk	�r d|}t|��|	}q�|dk	�r�|}
t|�|d}|d�sl|
d8}
|
�rld}t||��|d�s�|d8}|�r�d}t||��|j|
|}|dk�r2d}t||jd|f��njt|�|jk�r�d}t||j|f��|d�sd}t||��|d�s"d}t||��t|�}
d}d}znd}
t|
�D] }	|
d
K}
|
|�	||	�O}
�q@|
d
|K}
t|d�D] }	|
d
K}
|
|�	||	�O}
�qz|
WSt
k
�r�}ztd||f�d�W5d}~XYnXdS)z�Turn an IPv6 ip_str into an integer.

        Args:
            ip_str: A string, the IPv6 ip_str.

        Returns:
            An int, the IPv6 address

        Raises:
            AddressValueError: if ip_str isn't a valid IPv6 Address.

        r��:r�z At least %d parts expected in %rr�rKr�N�%xr �r)z!At most %d colons permitted in %rz At most one '::' permitted in %rrz0Leading ':' only permitted as part of '::' in %rz1Trailing ':' only permitted as part of '::' in %rz/Expected at most %d other parts with '::' in %rz,Exactly %d parts expected without '::' in %r)rr%r&r
rBr,rE�
_HEXTET_COUNTr��
_parse_hextetr)riru�partsZ
_min_partsrfZipv4_intr�Z
_max_partsZ
skip_index�iZparts_hiZparts_loZ
parts_skippedrmr
r
rrts�
$







z_BaseV6._ip_int_from_stringcCs>|j�|�std|��t|�dkr4d}t||��t|d�S)a&Convert an IPv6 hextet string into an integer.

        Args:
            hextet_str: A string, the number to parse.

        Returns:
            The hextet as an integer.

        Raises:
            ValueError: if the input isn't strictly a hex number from
              [0..FFFF].

        zOnly hex digits permitted in %rrz$At most 4 characters permitted in %rr )�_HEX_DIGITS�
issupersetrr&rr)riZ
hextet_strrfr
r
rr~sz_BaseV6._parse_hextetc	Cs�d}d}d}d}t|�D]>\}}|dkrN|d7}|dkr<|}||krV|}|}qd}d}q|dkr�||}|t|�kr~|dg7}dg|||�<|dkr�dg|}|S)a�Compresses a list of hextets.

        Compresses a list of strings, replacing the longest continuous
        sequence of "0" in the list with "" and adding empty strings at
        the beginning or at the end of the string such that subsequently
        calling ":".join(hextets) will produce the compressed version of
        the IPv6 address.

        Args:
            hextets: A list of strings, the hextets to compress.

        Returns:
            A list of strings.

        rKrr�r)�)�	enumerater&)	ri�hextetsZbest_doublecolon_startZbest_doublecolon_lenZdoublecolon_startZdoublecolon_len�indexZhextetZbest_doublecolon_endr
r
r�_compress_hextets�s0�

z_BaseV6._compress_hextetsNcsZ|dkrt|j�}||jkr$td��d|��fdd�tddd�D�}|�|�}d	�|�S)
a,Turns a 128-bit integer into hexadecimal notation.

        Args:
            ip_int: An integer, the IP address.

        Returns:
            A string, the hexadecimal representation of the address.

        Raises:
            ValueError: The address is bigger than 128 bits of all ones.

        NzIPv6 address is too large�%032xcs&g|]}dt�||d�d��qS)rrr )rr�r�r��Zhex_strr
r�
<listcomp>�sz/_BaseV6._string_from_ip_int.<locals>.<listcomp>rrrr)rrr,r>rr�rr�)rirmrr
rrr��s


z_BaseV6._string_from_ip_intcs�t|t�rt|j�}nt|t�r,t|j�}nt|�}|�|�}d|��fdd�tddd�D�}t|ttf�r�dd�	|�|j
fSd�	|�S)	z�Expand a shortened IPv6 address.

        Args:
            ip_str: A string, the IPv6 address.

        Returns:
            A string, the expanded IPv6 address.

        rcsg|]}�||d��qS)rr
rrr
rr�sz8_BaseV6._explode_shorthand_ip_string.<locals>.<listcomp>rrrr�r)r9rr$rOrr1rtr�rSr�rM)r\rurmrr
rrrZ�s



z$_BaseV6._explode_shorthand_ip_stringcCs&|jddd��dd�}d�|�dS)z�Return the reverse DNS pointer name for the IPv6 address.

        This implements the method described in RFC3596 2.5.

        NrKrrr�z	.ip6.arpa)r]�replacer�)r\Z
reverse_charsr
r
rr`�sz_BaseV6._reverse_pointercCs|jSrzr�r[r
r
rr�sz_BaseV6.max_prefixlencCs|jSrzr�r[r
r
rr<sz_BaseV6.version)N)rrrr	r}rL�
IPV6LENGTHr>r�	frozensetrr=r�rr�rtrrr�rZr`r~r�r<r
r
r
rr
�s0

g

/	
r
c@s�eZdZdZdZdd�Zedd��Zedd��Zed	d
��Z	edd��Z
ed
d��Zee�
�dd���Zedd��Zedd��Zedd��Zedd��Zedd��Zedd��ZdS)rz/Represent and manipulate single IPv6 Addresses.r�cCsrt|t�r|�|�||_dSt|t�rF|�|d�t�|d�|_dSt|�}d|krbtd|��|�	|�|_dS)aInstantiate a new IPv6 address object.

        Args:
            address: A string or integer representing the IP

              Additionally, an integer can be passed, so
              IPv6Address('2001:db8::') ==
                IPv6Address(42540766411282592856903984951653826560)
              or, more generally
              IPv6Address(int(IPv6Address('2001:db8::'))) ==
                IPv6Address('2001:db8::')

        Raises:
            AddressValueError: If address isn't a valid IPv6 address.

        Nr rr"r�r�r�r
r
rr�s


zIPv6Address.__init__cCs
t|j�Sr�)r!r,r[r
r
rr�6szIPv6Address.packedcCs||jjkSr�r�r[r
r
rr�;s	zIPv6Address.is_multicastcst�fdd��jjD��S)r�c3s|]}�|kVqdSrzr
rr[r
rr�Osz*IPv6Address.is_reserved.<locals>.<genexpr>)r�r��_reserved_networksr[r
r[rr�Fs	zIPv6Address.is_reservedcCs||jjkSr�r�r[r
r
rr�QszIPv6Address.is_link_localcCs||jjkS�a`Test if the address is reserved for site-local.

        Note that the site-local address space has been deprecated by RFC 3879.
        Use is_private to test if this address is in the space of unique local
        addresses as defined by RFC 4193.

        Returns:
            A boolean, True if the address is reserved per RFC 3513 2.5.6.

        )r��_sitelocal_networkr[r
r
r�
is_site_local[szIPv6Address.is_site_localcst�fdd��jjD��S)z�Test if this address is allocated for private networks.

        Returns:
            A boolean, True if the address is reserved per
            iana-ipv6-special-registry.

        c3s|]}�|kVqdSrzr
r�r[r
rr�ssz)IPv6Address.is_private.<locals>.<genexpr>r�r[r
r[rr�is
zIPv6Address.is_privatecCs|jS)z�Test if this address is allocated for public networks.

        Returns:
            A boolean, true if the address is not reserved per
            iana-ipv6-special-registry.

        r�r[r
r
rr�us	zIPv6Address.is_globalcCs
|jdkS)r�rr�r[r
r
rr��s	zIPv6Address.is_unspecifiedcCs
|jdkS)r�r)r�r[r
r
rr��s	zIPv6Address.is_loopbackcCs |jd?dkrdSt|jd@�S)z�Return the IPv4 mapped address.

        Returns:
            If the IPv6 address is a v4 mapped address, return the
            IPv4 mapped address. Return None otherwise.

        rrN����r,r
r[r
r
r�ipv4_mapped�s	zIPv6Address.ipv4_mappedcCs4|jd?dkrdSt|jd?d@�t|jd@�fS)z�Tuple of embedded teredo IPs.

        Returns:
            Tuple of the (server, client) IPs or None if the address
            doesn't appear to be a teredo address (doesn't start with
            2001::/32)

        �`i N�@r'r(r[r
r
r�teredo�s

�zIPv6Address.teredocCs$|jd?dkrdSt|jd?d@�S)z�Return the IPv4 6to4 embedded address.

        Returns:
            The IPv4 6to4-embedded address if present or None if the
            address doesn't appear to contain a 6to4 embedded address.

        �pi N�Pr'r(r[r
r
r�	sixtofour�s	zIPv6Address.sixtofourN)rrrr	r}r�r~r�r�r�r�r&r�r�r�r�r�r�r)r,r/r
r
r
rrs8$





	










rc@s�eZdZdd�Zejdd��Zdd�Zdd�Zd	d
�Z	dd�Z
ejZe
d
d��Ze
dd��Ze
dd��Ze
dd��Ze
dd��Ze
dd��ZdS)rcCsD|�|�\}}t�||�t||fdd�|_|jj|_|jj|_dSr�)ryrr�rr�r�rMr�r
r
rr��s

zIPv6Interface.__init__cCs|jjSrzr�r[r
r
rr��szIPv6Interface.hostmaskcCsd|�|j�|jfSr�rr[r
r
rr��s�zIPv6Interface.__str__cCsFt�||�}|r|tkr|Sz|j|jkWStk
r@YdSXdSr�)rr�rVr�rNrr
r
rr��szIPv6Interface.__eq__cCsRt�||�}|tkrtSz|j|jkp4|j|jko4|WStk
rLYdSXdSr�)rr�rVr�rNrr
r
rr��s�zIPv6Interface.__lt__cCst|j|jt|jj�f�Srzrr[r
r
rr��szIPv6Interface.__hash__cCs
t|j�Srz)rr,r[r
r
rr1�szIPv6Interface.ipcCsd|�|j�|jfSr�rr[r
r
rr��s�zIPv6Interface.with_prefixlencCsd|�|j�|jfSr�rr[r
r
rr��s�zIPv6Interface.with_netmaskcCsd|�|j�|jfSr�rr[r
r
rr��s�zIPv6Interface.with_hostmaskcCs|jdko|jjS)Nr)r,r�r�r[r
r
rr�szIPv6Interface.is_unspecifiedcCs|jdko|jjSr�)r,r�r�r[r
r
rr�szIPv6Interface.is_loopbackN)rrrr�r�r�r�r�r�r�r�rYr|r~r1r�r�r�r�r�r
r
r
rr�s(





rc@s2eZdZdZeZd
dd�Zdd�Zedd��Z	d	S)ravThis class represents and manipulates 128-bit IPv6 networks.

    Attributes: [examples for IPv6('2001:db8::1000/124')]
        .network_address: IPv6Address('2001:db8::1000')
        .hostmask: IPv6Address('::f')
        .broadcast_address: IPv6Address('2001:db8::100f')
        .netmask: IPv6Address('ffff:ffff:ffff:ffff:ffff:ffff:ffff:fff0')
        .prefixlen: 124

    Tcs�|�|�\�}t��|_|�|�\|_|_t|j�}|t|j�@|krl|rXtd|��nt|t|j�@�|_|j|jdkr�|j	|_
n|j|jkr��fdd�|_
dS)a�Instantiate a new IPv6 Network object.

        Args:
            address: A string or integer representing the IPv6 network or the
              IP and prefix/netmask.
              '2001:db8::/128'
              '2001:db8:0000:0000:0000:0000:0000:0000/128'
              '2001:db8::'
              are all functionally the same in IPv6.  That is to say,
              failing to provide a subnetmask will create an object with
              a mask of /128.

              Additionally, an integer can be passed, so
              IPv6Network('2001:db8::') ==
                IPv6Network(42540766411282592856903984951653826560)
              or, more generally
              IPv6Network(int(IPv6Network('2001:db8::'))) ==
                IPv6Network('2001:db8::')

            strict: A boolean. If true, ensure that we have been passed
              A true network address, eg, 2001:db8::1000/124 and not an
              IP address on a network, eg, 2001:db8::1/124.

        Raises:
            AddressValueError: If address isn't a valid IPv6 address.
            NetmaskValueError: If the netmask isn't valid for
              an IPv6 address.
            ValueError: If strict was True and a network address was not
              supplied.
        rr)cs
t��gSrz)rr
rr
rrIr	z&IPv6Network.__init__.<locals>.<lambda>N)ryrrOr�r�rMrrrr=r�r�r
r
rrr�s

�
zIPv6Network.__init__ccs<t|j�}t|j�}t|d|d�D]}|�|�Vq&dS)z�Generate Iterator over usable hosts in a network.

          This is like __iter__ except it doesn't return the
          Subnet-Router anycast address.

        r)Nr�r�r
r
rr�Ks

zIPv6Network.hostscCs|jjo|jjSr$)rOr&rHr[r
r
rr&Ws�zIPv6Network.is_site_localN)T)
rrrr	rr�r�r�r~r&r
r
r
rrs
0rc@s�eZdZed�Zed�Zed�ed�ed�ed�ed�ed�ed	�ed
�ed�ed�g
Zed�ed
�ed�ed�ed�ed�ed�ed�ed�ed�ed�ed�ed�ed�ed�gZed�ZdS)�_IPv6Constantsz	fe80::/10zff00::/8z::1/128z::/128z
::ffff:0:0/96z100::/64z	2001::/23z2001:2::/48z
2001:db8::/32z2001:10::/28zfc00::/7z::/8z100::/8z200::/7z400::/6z800::/5z1000::/4z4000::/3z6000::/3z8000::/3zA000::/3zC000::/3zE000::/4zF000::/5zF800::/6zFE00::/9z	fec0::/10N)	rrrrr�r�r�r#r%r
r
r
rr0gs<��r0)T)#r	�__version__r�r�r!rrrrrrrr!r(r2r6r@rJrRrXrY�total_orderingr:rSr�r
rrrr�r
rrrr0r
r
r
r�<module>sV
#7163:IuCR 5K\!__pycache__/pathlib.cpython-38.pyc000064400000126263151153537600013047 0ustar00U

e5d���@sjddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZmZm
Z
mZmZddlmZddlmZmZmZmZmZmZmZddlmZdZejdkr�ddlZe� �dd	�d
kr�ddlm!Z!q�dZdZ!ndZd
dddddgZ"ee
eefZ#dZ$dd�Z%dd�Z&Gdd�de'�Z(Gdd�de(�Z)Gdd�de(�Z*e)�Z+e*�Z,Gdd�d�Z-Gd d!�d!e-�Z.e.�Z/d"d#�Z0e1ed$��r�e�2�e0�Z0Gd%d&�d&�Z3Gd'd(�d(�Z4Gd)d*�d*e3�Z5Gd+d,�d,e3�Z6Gd-d.�d.e3�Z7Gd/d0�d0e	�Z8Gd1d
�d
e'�Z9ej:�;e9�Gd2d�de9�Z<Gd3d�de9�Z=Gd4d�de9�Z>Gd5d�de>e<�Z?Gd6d�de>e=�Z@dS)7�N)�Sequence)�EINVAL�ENOENT�ENOTDIR�EBADF�ELOOP)�
attrgetter)�S_ISDIR�S_ISLNK�S_ISREG�S_ISSOCK�S_ISBLK�S_ISCHR�S_ISFIFO)�quote_from_bytesT�nt�)�r)�_getfinalpathnameF�PurePath�
PurePosixPath�PureWindowsPath�Path�	PosixPath�WindowsPath)��{i�cCs t|dd�tkpt|dd�tkS)N�errnoZwinerror)�getattr�_IGNORED_ERROS�_IGNORED_WINERRORS)Z	exception�r!�/usr/lib64/python3.8/pathlib.py�
_ignore_error.s�r#cCsd|kpd|kpd|kS)N�*�?�[r!)�patr!r!r"�_is_wildcard_pattern3sr(c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_FlavourzPA flavour implements a particular (platform-specific) set of path
    semantics.cCs|jj|_dS�N)�sep�join��selfr!r!r"�__init__=sz_Flavour.__init__cCsg}|j}|j}d}}t|�}|D]�}|s.q$|r>|�||�}|�|�\}}}	||	kr�t|	�|��D] }
|
rd|
dkrd|�t�|
��qdn|	r�|	dkr�|�t�|	��|s�|r$|s�|D]0}|s�q�|r�|�||�}|�|�d}|r�q�q�q�q$|s�|�r|�||�|�	�|||fS)N��.r)
r+�altsep�reversed�replace�	splitroot�split�append�sys�intern�reverse)r.�partsZparsedr+r2�drv�root�it�partZrel�xr!r!r"�parse_parts@s@
z_Flavour.parse_partscCsz|r*|sp|rp||||g|dd�fSnF|rb||ksJ|�|�|�|�krp||||dd�fSn||||fS|||fS)z�
        Join the two paths represented by the respective
        (drive, root, parts) tuples.  Return a new (drive, root, parts) tuple.
        �N)�casefold)r.r<r=r;Zdrv2Zroot2Zparts2r!r!r"�join_parsed_partsfsz_Flavour.join_parsed_partsN)�__name__�
__module__�__qualname__�__doc__r/rArDr!r!r!r"r)9s&r)c@s�eZdZdZdZdZeZej	dkZ
ed�ZdZ
ddd	d
hdd�ed
d�D�Bdd�ed
d�D�BZefdd�Zdd�Zdd�Zdd�Zd&dd�Ze
fdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%S)'�_WindowsFlavour�\�/TrZ4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZz\\?\ZCONZPRNZAUXZNULcCsh|]}d|�qS)zCOM%dr!��.0�ir!r!r"�	<setcomp>�sz_WindowsFlavour.<setcomp>rB�
cCsh|]}d|�qS)zLPT%dr!rLr!r!r"rO�scCs\|dd�}|dd�}||krP||krP|�|�\}}|dd�}|dd�}nd}|dd�}||kr�||kr�||kr�|�|d�}|dkr�|�||d�}||dkr�|dkr�t|�}|r�||d|�|||dd�fS|d|�|||dd�fSd}	}
|dk�r6||jk�r6|dd�}	|dd�}|}||k�rN|}
|�|�}||	|
|fS)NrrBrr0�����:)�_split_extended_path�find�len�
drive_letters�lstrip)r.r?r+�first�second�prefixZthird�indexZindex2r<r=r!r!r"r5�s6"

z_WindowsFlavour.splitrootcCs|��Sr*��lower�r.�sr!r!r"rC�sz_WindowsFlavour.casefoldcCsdd�|D�S)NcSsg|]}|���qSr!r])rM�pr!r!r"�
<listcomp>�sz2_WindowsFlavour.casefold_parts.<locals>.<listcomp>r!�r.r;r!r!r"�casefold_parts�sz_WindowsFlavour.casefold_partscCst�t�|�tj�jSr*)�re�compile�fnmatch�	translate�
IGNORECASE�	fullmatch�r.�patternr!r!r"�compile_pattern�sz_WindowsFlavour.compile_patternFcCs�t|�}|st��Sd}tdk	r�|r2|�t|��Sg}z|�t|��}WnBtk
r�|}tj�|�\}}|�|�||kr�|YSYq6Xtjj	|ft
|���Sq6dSr*)�str�os�getcwdr�_ext_to_normal�FileNotFoundError�pathr6r7r,r3)r.rs�strictr`Z
previous_sZ
tail_parts�tailr!r!r"�resolve�s$
z_WindowsFlavour.resolvecCsXd}|�|�rP|dd�}|dd�}|�d�rP||dd�7}d|dd�}||fS)Nr0�zUNC\rQrJ)�
startswith)r.r`Z
ext_prefixr[r!r!r"rT�s

z$_WindowsFlavour._split_extended_pathcCs|�|�dS�NrB)rTr_r!r!r"rq�sz_WindowsFlavour._ext_to_normalcCs6|sdS|d�d�rdS|d�d�d��|jkS)NFrz\\rRr1)rx�	partition�upper�reserved_namesrcr!r!r"�is_reserved�s
z_WindowsFlavour.is_reservedcCsd|j}t|�dkrJ|ddkrJ|��dd��d�}d|t|�d��fSdt|���d��SdS)NrrBrSrKz
file:///%s/%szutf-8zfile:)�driverV�as_posixrX�urlquote_from_bytes�encode)r.rsr~�restr!r!r"�make_uri�s�z_WindowsFlavour.make_uricCs�dtjkrtjd}nJdtjkrXztjd}Wntk
rFd}YnX|tjd}ntd��|r�tjd|kr�|�|f�\}}}|dtjdkr�td|��||d<|s�|r�|||�|d	d��}n
|�|�}|S)
NZUSERPROFILEZHOMEPATHZ	HOMEDRIVEr0zCan't determine home directoryZUSERNAMErR�%Can't determine home directory for %rrB)ro�environ�KeyError�RuntimeErrorrAr,)r.�username�userhomer<r=r;r!r!r"�
gethomedirs*


�
z_WindowsFlavour.gethomedirN)F)rErFrGr+r2�has_drv�ntpath�pathmodro�name�is_supported�setrWZext_namespace_prefix�ranger|r5rCrdrmrvrTrqr}r�r�r!r!r!r"rIxs.

���'

rIc@sleZdZdZdZdZeZej	dkZ
efdd�Zdd�Zd	d
�Z
dd�Zdd
d�Zdd�Zdd�Zdd�ZdS)�
_PosixFlavourrKr0FrcCsV|rH|d|krH|�|�}t|�t|�dkr<d|d|fSd||fSn
dd|fSdS)Nrrr0)rXrV)r.r?r+Z
stripped_partr!r!r"r5%s
z_PosixFlavour.splitrootcCs|Sr*r!r_r!r!r"rC4sz_PosixFlavour.casefoldcCs|Sr*r!rcr!r!r"rd7sz_PosixFlavour.casefold_partscCst�t�|��jSr*)rerfrgrhrjrkr!r!r"rm:sz_PosixFlavour.compile_patterncsJ|j�|j�i������fdd��|��r0dnt��}�|t|��pH�S)Ncs�|���rd}|���D]�}|r|dkr*q|dkrD|���\}}}q|���rX||}n|�|}|�kr��|}|dk	r~qtd|��z��|�}Wn6tk
r�}z|jtkr��r��|}W5d}~XYqXd�|<�||�}|�|<q|S)Nr0r1�..zSymlink loop from %r)	rxr6�
rpartition�endswithr��readlink�OSErrorrr)rsr�r��_�newpath�target�e��_resolveZaccessor�seenr+rtr!r"r�As4




z'_PosixFlavour.resolve.<locals>._resolver0)r+�	_accessor�is_absoluterorprn)r.rsrt�baser!r�r"rv=s)z_PosixFlavour.resolvecCsdS�NFr!rcr!r!r"r}msz_PosixFlavour.is_reservedcCst|�}dt|�S)Nzfile://)�bytesr�)r.rsZbpathr!r!r"r�psz_PosixFlavour.make_uricCs||s@ztjdWStk
r<ddl}|�t���jYSXn8ddl}z|�|�jWStk
rvtd|��YnXdS)N�HOMErr�)	ror�r��pwd�getpwuid�getuid�pw_dir�getpwnamr�)r.r�r�r!r!r"r�vs�z_PosixFlavour.gethomedirN)F)rErFrGr+r2r��	posixpathr�ror�r�r5rCrdrmrvr}r�r�r!r!r!r"r�s

0r�c@seZdZdZdS)�	_AccessorzjAn accessor implements a particular (system-specific or not) way of
    accessing paths on the filesystem.N)rErFrGrHr!r!r!r"r��sr�c@s�eZdZejZejZejZejZejZej	Z	e
ed�r>ejZndd�ZejZej
Z
e
ed�rdejZnedd��ZejZejZejZer�er�ejZq�dd�Zned	d��ZejZd
d�ZdS)
�_NormalAccessor�lchmodcCstd��dS)Nz%lchmod() not available on this system��NotImplementedError)r.Zpathobj�moder!r!r"r��sz_NormalAccessor.lchmod�linkcCstd��dS)Nz&os.link() not available on this systemr��r.r�r!r!r"�link_to�sz_NormalAccessor.link_tocCstd��dS)Nz&symlink() not available on this systemr���a�b�target_is_directoryr!r!r"�symlink�sz_NormalAccessor.symlinkcCst�||�Sr*)ror�r�r!r!r"r��scCs
t�|�Sr*)ror��r.rsr!r!r"r��sz_NormalAccessor.readlinkN)rErFrGro�stat�lstat�open�listdir�scandir�chmod�hasattrr��mkdir�unlinkr�r��staticmethod�rmdir�renamer4r�supports_symlinksr��utimer�r!r!r!r"r��s4




r�cCsR|d}|dd�}|dkr"t}n$d|kr4td��nt|�rBt}nt}||||�S)NrrB�**z:Invalid pattern: '**' can only be an entire path component)�_RecursiveWildcardSelector�
ValueErrorr(�_WildcardSelector�_PreciseSelector)�
pattern_parts�flavourr'�child_parts�clsr!r!r"�_make_selector�s
r��	lru_cachec@s eZdZdZdd�Zdd�ZdS)�	_SelectorzYA selector matches a specific glob pattern part against the children
    of a given path.cCs0||_|rt||�|_d|_nt�|_d|_dS)NTF)r�r��	successor�dironly�_TerminatingSelector)r.r�r�r!r!r"r/�sz_Selector.__init__cCs<t|�}|j}|j}|jj}||�s,tg�S|�||||�S)zuIterate over all child paths of `parent_path` matched by this
        selector.  This can contain parent_path itself.)�type�is_dir�existsr�r��iter�_select_from)r.�parent_pathZpath_clsr�r�r�r!r!r"�select_from�sz_Selector.select_fromN)rErFrGrHr/r�r!r!r!r"r��s	r�c@seZdZdd�ZdS)r�ccs
|VdSr*r!)r.r�r�r�r�r!r!r"r��sz!_TerminatingSelector._select_fromN)rErFrGr�r!r!r!r"r��sr�c@seZdZdd�Zdd�ZdS)r�cCs||_t�|||�dSr*)r�r�r/)r.r�r�r�r!r!r"r/sz_PreciseSelector.__init__ccs\z@|�|j�}|jr|n||�r>|j�||||�D]
}|Vq2Wntk
rVYdSXdSr*)�_make_child_relpathr�r�r�r��PermissionError)r.r�r�r�r�rsrar!r!r"r�sz_PreciseSelector._select_fromN�rErFrGr/r�r!r!r!r"r��sr�c@seZdZdd�Zdd�ZdS)r�cCs|�|�|_t�|||�dSr*)rm�matchr�r/�r.r'r�r�r!r!r"r/sz_WildcardSelector.__init__ccs�z�||��}t|�}W5QRX|D]�}|jrrz|��s:Wq"Wn4tk
rp}zt|�sX�WY�q"W5d}~XYnX|j}	|�|	�r"|�|	�}
|j�	|
|||�D]
}|Vq�q"Wnt
k
r�YdSXdSr*)�listr�r�r�r#r�r�r�r�r�r�)r.r�r�r�r��
scandir_it�entries�entryr�r�rsrar!r!r"r�s&


z_WildcardSelector._select_fromNr�r!r!r!r"r�sr�c@s$eZdZdd�Zdd�Zdd�ZdS)r�cCst�|||�dSr*)r�r/r�r!r!r"r//sz#_RecursiveWildcardSelector.__init__ccs�|Vz�||��}t|�}W5QRX|D]t}d}z|��}Wn,tk
rh}zt|�sX�W5d}~XYnX|r(|��s(|�|j�}	|�|	||�D]
}
|
Vq�q(Wntk
r�YdSXdSr�)	r�r�r�r#�
is_symlinkr�r��_iterate_directoriesr�)r.r�r�r�r�r�r�Zentry_is_dirr�rsrar!r!r"r�2s"
z/_RecursiveWildcardSelector._iterate_directoriesc	cs~zbt�}zL|jj}|�|||�D]0}|||||�D]}||kr2|V|�|�q2q W5|��XWntk
rxYdSXdSr*)r��clearr�r�r��addr�)	r.r�r�r�r�ZyieldedZsuccessor_selectZstarting_pointrar!r!r"r�Esz'_RecursiveWildcardSelector._select_fromN)rErFrGr/r�r�r!r!r!r"r�-sr�c@s4eZdZdZdZdd�Zdd�Zdd�Zd	d
�ZdS)�_PathParentszvThis object provides sequence-like access to the logical ancestors
    of a path.  Don't try to construct it yourself.)�_pathcls�_drv�_root�_partscCs&t|�|_|j|_|j|_|j|_dSr*)r�r�r�r�r�r�r!r!r"r/^s
z_PathParents.__init__cCs(|js|jrt|j�dSt|j�SdSry)r�r�rVr�r-r!r!r"�__len__esz_PathParents.__len__cCs@|dks|t|�krt|��|j�|j|j|jd|d��S)NrrB)rV�
IndexErrorr��_from_parsed_partsr�r�r�)r.�idxr!r!r"�__getitem__ks
�z_PathParents.__getitem__cCsd�|jj�S)Nz<{}.parents>)�formatr�rEr-r!r!r"�__repr__qsz_PathParents.__repr__N)	rErFrGrH�	__slots__r/r�r�r�r!r!r!r"r�Ysr�c@s�eZdZdZdZdd�Zdd�Zedd��ZedVd
d��Z	edWdd
��Z
edd��Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zed d!��Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zeed.�d/d0�Zeed1�d2d0�Zed3d4��Zed5d6��Z ed7d8��Z!ed9d:��Z"ed;d<��Z#d=d>�Z$d?d@�Z%dAdB�Z&edCdD��Z'dEdF�Z(dGdH�Z)dIdJ�Z*edKdL��Z+edMdN��Z,dOdP�Z-dQdR�Z.dSdT�Z/dUS)Xra|Base class for manipulating paths without I/O.

    PurePath represents a filesystem path and offers operations which
    don't imply any actual filesystem I/O.  Depending on your system,
    instantiating a PurePath will return either a PurePosixPath or a
    PureWindowsPath object.  You can also instantiate either of these classes
    directly, regardless of your system.
    )r�r�r��_str�_hash�_pparts�_cached_cpartscGs$|tkrtjdkrtnt}|�|�S)z�Construct a PurePath from one or several strings and or existing
        PurePath objects.  The strings and path objects are combined so as
        to yield a canonicalized path, which is incorporated into the
        new PurePath object.
        r)rror�rr�_from_parts)r��argsr!r!r"�__new__�szPurePath.__new__cCs|jt|j�fSr*)�	__class__�tupler�r-r!r!r"�
__reduce__�szPurePath.__reduce__cCsdg}|D]N}t|t�r"||j7}qt�|�}t|t�rF|�t|��qtdt|���q|j	�
|�S)NzNargument should be a str object or an os.PathLike object returning str, not %r)�
isinstancerr�ro�fspathrnr7�	TypeErrorr��_flavourrA)r�r�r;r�r!r!r"�_parse_args�s


��zPurePath._parse_argsTcCs<t�|�}|�|�\}}}||_||_||_|r8|��|Sr*)�objectr�rr�r�r��_init)r�r��initr.r<r=r;r!r!r"r��s
zPurePath._from_partscCs,t�|�}||_||_||_|r(|��|Sr*)rr�r�r�r�r)r�r<r=r;r	r.r!r!r"r��s
zPurePath._from_parsed_partscCs4|s|r$|||j�|dd��S|j�|�SdSry)rr,)r�r<r=r;r!r!r"�_format_parsed_parts�szPurePath._format_parsed_partscCsdSr*r!r-r!r!r"r�szPurePath._initcCs@|�|�\}}}|j�|j|j|j|||�\}}}|�|||�Sr*)rrrDr�r�r�r�)r.r�r<r=r;r!r!r"�_make_child�s�
zPurePath._make_childcCsBz|jWStk
r<|�|j|j|j�p.d|_|jYSXdS)z[Return the string representation of the path, suitable for
        passing to system calls.r1N)r��AttributeErrorr
r�r�r�r-r!r!r"�__str__�s��zPurePath.__str__cCst|�Sr*)rnr-r!r!r"�
__fspath__�szPurePath.__fspath__cCs|j}t|��|jd�S)zNReturn the string representation of the path with forward (/)
        slashes.rK)rrnr4r+�r.�fr!r!r"r�szPurePath.as_posixcCs
t�|�S)zaReturn the bytes representation of the path.  This is only
        recommended to use under Unix.)ro�fsencoder-r!r!r"�	__bytes__�szPurePath.__bytes__cCsd�|jj|���S)Nz{}({!r}))r�r�rErr-r!r!r"r��szPurePath.__repr__cCs|��std��|j�|�S)z Return the path as a 'file' URI.z.relative path can't be expressed as a file URI)r�r�rr�r-r!r!r"�as_uri�szPurePath.as_uricCs8z|jWStk
r2|j�|j�|_|jYSXdSr*)r�rrrdr�r-r!r!r"�_cparts�s
zPurePath._cpartscCs&t|t�stS|j|jko$|j|jkSr*)rr�NotImplementedrr�r.�otherr!r!r"�__eq__�s
zPurePath.__eq__cCs8z|jWStk
r2tt|j��|_|jYSXdSr*)r�r�hashrrr-r!r!r"�__hash__�s
zPurePath.__hash__cCs&t|t�r|j|jk	rtS|j|jkSr*�rrrrrrr!r!r"�__lt__szPurePath.__lt__cCs&t|t�r|j|jk	rtS|j|jkSr*rrr!r!r"�__le__	szPurePath.__le__cCs&t|t�r|j|jk	rtS|j|jkSr*rrr!r!r"�__gt__szPurePath.__gt__cCs&t|t�r|j|jk	rtS|j|jkSr*rrr!r!r"�__ge__szPurePath.__ge__r�z.The drive prefix (letter or UNC path), if any.)�docr�zThe root of the path, if any.cCs|j|j}|S)z/The concatenation of the drive and root, or ''.)r�r�)r.�anchorr!r!r"r!szPurePath.anchorcCs.|j}t|�|js|jrdndkr&dS|dS)z!The final path component, if any.rBrr0rR)r�rVr�r�rcr!r!r"r�$sz
PurePath.namecCsD|j}|�d�}d|kr,t|�dkr<nn||d�SdSdS)z{
        The final component's last suffix, if any.

        This includes the leading period. For example: '.txt'
        r1rrBNr0�r��rfindrV�r.r�rNr!r!r"�suffix,s

 zPurePath.suffixcCs:|j}|�d�rgS|�d�}dd�|�d�dd�D�S)z�
        A list of the final component's suffixes, if any.

        These include the leading periods. For example: ['.tar', '.gz']
        r1cSsg|]}d|�qS)r1r!)rMr%r!r!r"rbEsz%PurePath.suffixes.<locals>.<listcomp>rBN)r�r�rXr6�r.r�r!r!r"�suffixes:s


zPurePath.suffixescCsD|j}|�d�}d|kr,t|�dkr<nn|d|�S|SdS)z0The final path component, minus its last suffix.r1rrBNr"r$r!r!r"�stemGs

 z
PurePath.stemcCs�|jstd|f��|j�|f�\}}}|rX|d|jj|jjfksX|sX|sXt|�dkrdtd|��|�|j|j	|j
dd�|g�S)z-Return a new path with the file name changed.�%r has an empty namerRrBzInvalid name %rN)r�r�rrAr+r2rVr�r�r�r�)r.r�r<r=r;r!r!r"�	with_nameQs��
��zPurePath.with_namecCs�|j}|j|ks |jr.|j|kr.td|f��|r<|�d�rD|dkrPtd|��|j}|shtd|f��|j}|s|||}n|dt|��|}|�|j	|j
|jdd�|g�S)z�Return a new path with the file suffix changed.  If the path
        has no suffix, add given suffix.  If the given suffix is an empty
        string, remove the suffix from the path.
        zInvalid suffix %rr1r)NrR)rr+r2r�rxr�r%rVr�r�r�r�)r.r%rr�Z
old_suffixr!r!r"�with_suffix\s
�zPurePath.with_suffixc
Gs�|std��|j}|j}|j}|r8||g|dd�}n|}|�|�\}}}|rf||g|dd�}	n|}	t|	�}
|jj}|
dkr�|s�|r�n||d|
��||	�kr�|�|||�}t	d�
t|�t|����|�d|
dkr�|nd||
d��S)z�Return the relative path to another path identified by the passed
        arguments.  If the operation is not possible (because this is not
        a subpath of the other path), raise ValueError.
        zneed at least one argumentrBNrz{!r} does not start with {!r}r0)
rr�r�r�rrVrrdr
r�r�rnr�)
r.rr;r<r=Z	abs_partsZto_drvZto_rootZto_partsZto_abs_parts�n�cfZ	formattedr!r!r"�relative_toqs.	*�
�zPurePath.relative_tocCs4z|jWStk
r.t|j�|_|jYSXdS)zZAn object providing sequence-like access to the
        components in the filesystem path.N)r�rrr�r-r!r!r"r;�s
zPurePath.partscGs
|�|�S)z�Combine this path with one or several arguments, and return a
        new path representing either a subpath (if all arguments are relative
        paths) or a totally different path (if one of the arguments is
        anchored).
        )r)r.r�r!r!r"�joinpath�szPurePath.joinpathcCs,z|�|f�WStk
r&tYSXdSr*)rrr�r.�keyr!r!r"�__truediv__�szPurePath.__truediv__cCs2z|�|g|j�WStk
r,tYSXdSr*)r�r�rrr0r!r!r"�__rtruediv__�szPurePath.__rtruediv__cCs@|j}|j}|j}t|�dkr*|s&|r*|S|�|||dd��S)zThe logical parent of the path.rBNrR)r�r�r�rVr�)r.r<r=r;r!r!r"�parent�szPurePath.parentcCst|�S)z*A sequence of this path's logical parents.)r�r-r!r!r"�parents�szPurePath.parentscCs|js
dS|jjpt|j�S)zSTrue if the path is absolute (has both a root and, if applicable,
        a drive).F)r�rr��boolr�r-r!r!r"r��szPurePath.is_absolutecCs|j�|j�S)zaReturn True if the path contains one of the special names reserved
        by the system, if any.)rr}r�r-r!r!r"r}�szPurePath.is_reservedc	Cs�|jj}||�}|j�|f�\}}}|s0td��|rF|||j�krFdS|r\|||j�kr\dS|j}|sj|r�t|�t|�kr~dS|dd�}nt|�t|�kr�dStt	|�t	|��D]\}}t
�||�s�dSq�dS)zE
        Return True if this path matches the given pattern.
        z
empty patternFrBNT)rrCrAr�r�r�rrV�zipr3rgZfnmatchcase)	r.Zpath_patternr-r<r=Z	pat_partsr;r?r'r!r!r"r��s(zPurePath.matchN)T)T)0rErFrGrHr�r�r�classmethodrr�r�r
rrr
rrrr�r�propertyrrrrrrrrr~r=r!r�r%r'r(r*r+r.r;r/r2r3r4r5r�r}r�r!r!r!r"rusv

	


��





	 

	
c@seZdZdZeZdZdS)rz�PurePath subclass for non-Windows systems.

    On a POSIX system, instantiating a PurePath should return this object.
    However, you can also instantiate it directly on any system.
    r!N)rErFrGrH�_posix_flavourrr�r!r!r!r"r�sc@seZdZdZeZdZdS)rz�PurePath subclass for Windows systems.

    On a Windows system, instantiating a PurePath should return this object.
    However, you can also instantiate it directly on any system.
    r!N)rErFrGrH�_windows_flavourrr�r!r!r!r"r�sc@s�eZdZdZdZdd�Zdddd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dedd�Zdfdd�Ze
dd��Ze
dd��Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zdgd%d&�Zd'd(�Zd)d*�Zd+d,�Zdhd/d0�Zd1d2�Zdid3d4�Zd5d6�Zdjd7d8�Zdkd:d;�Zdld<d=�Zd>d?�Z d@dA�Z!dmdBdC�Z"dDdE�Z#dFdG�Z$dHdI�Z%dJdK�Z&dndLdM�Z'dNdO�Z(dPdQ�Z)dRdS�Z*dTdU�Z+dVdW�Z,dXdY�Z-dZd[�Z.d\d]�Z/d^d_�Z0d`da�Z1dbdc�Z2dS)ora�PurePath subclass that can make system calls.

    Path represents a filesystem path but unlike PurePath, also offers
    methods to do system calls on path objects. Depending on your system,
    instantiating a Path will return either a PosixPath or a WindowsPath
    object. You can also instantiate a PosixPath or WindowsPath directly,
    but cannot instantiate a WindowsPath on a POSIX system or vice versa.
    )r��_closedcOsL|tkrtjdkrtnt}|j|dd�}|jjs@td|j	f��|�
�|S)NrF�r	z$cannot instantiate %r on your system)rror�rrr�rr�r�rEr)r�r��kwargsr.r!r!r"r�s�zPath.__new__NcCs"d|_|dk	r|j|_nt|_dSr�)r<r��_normal_accessor)r.�templater!r!r"rs
z
Path._initcCs|j|g}|�|j|j|�Sr*)r�r�r�r�)r.r?r;r!r!r"r�#szPath._make_child_relpathcCs|jr|��|Sr*)r<�
_raise_closedr-r!r!r"�	__enter__)szPath.__enter__cCs
d|_dS)NT)r<)r.�t�v�tbr!r!r"�__exit__.sz
Path.__exit__cCstd��dS)NzI/O operation on closed path)r�r-r!r!r"rA1szPath._raise_closed�cCs|j�|||�Sr*)r�r�)r.r��flagsr�r!r!r"�_opener4szPath._opener�cCs|jr|��|j�|||�S)zm
        Open the file pointed by this path and return a file descriptor,
        as os.open() does.
        )r<rAr�r�)r.rHr�r!r!r"�	_raw_open8szPath._raw_opencCs|t���S)zjReturn a new path pointing to the current working directory
        (as returned by os.getcwd()).
        )rorp�r�r!r!r"�cwdCszPath.cwdcCs||�j�d��S)zrReturn a new path pointing to the user's home directory (as
        returned by os.path.expanduser('~')).
        N)rr�rLr!r!r"�homeJsz	Path.homecCsB|��}z|��}Wntk
r2t�|�}YnXtj�||�S)zoReturn whether other_path is the same or not as this file
        (as returned by os.path.samefile()).
        )r�rrors�samestat)r.Z
other_path�stZother_str!r!r"�samefileQsz
Path.samefileccsH|jr|��|j�|�D](}|dkr(q|�|�V|jr|��qdS)zyIterate over the files in this directory.  Does not yield any
        result for the special paths '.' and '..'.
        >r1r�N)r<rAr�r�r�r&r!r!r"�iterdir\szPath.iterdirccs`|std�|���|j�|f�\}}}|s.|r6td��tt|�|j�}|�|�D]
}|VqPdS)z�Iterate over this subtree and yield all existing files (of any
        kind, including directories) matching the given relative pattern.
        zUnacceptable pattern: {!r}�%Non-relative patterns are unsupportedN)r�r�rrAr�r�rr��r.rlr<r=r�Zselectorrar!r!r"�globjsz	Path.globccsR|j�|f�\}}}|s|r$td��tdt|�|j�}|�|�D]
}|VqBdS)z�Recursively yield all existing files (of any kind, including
        directories) matching the given relative pattern, anywhere in
        this subtree.
        rS)r�N)rrAr�r�rr�rTr!r!r"�rglobwsz
Path.rglobcCsD|jr|��|��r|S|jt��g|jdd�}|j|d�|S)aReturn an absolute version of this path.  This function works
        even if the path doesn't point to anything.

        No normalization is done, i.e. all '.' and '..' will be kept along.
        Use resolve() to get the canonical path to a file.
        Fr=�r@)r<rAr�r�rorpr�r)r.�objr!r!r"�absolute�sz
Path.absoluteFcCsh|jr|��|jj||d�}|dkr:|��t|���}|jj�|�}|j	|fdd�}|j
|d�|S)z�
        Make the path absolute, resolving all symlinks on the way and also
        normalizing it (for example turning slashes into backslashes under
        Windows).
        )rtNFr=rW)r<rArrvr�rnrYr��normpathr�r)r.rtr`ZnormedrXr!r!r"rv�szPath.resolvecCs|j�|�S)zh
        Return the result of the stat() system call on this path, like
        os.stat() does.
        )r�r�r-r!r!r"r��sz	Path.statcCsddl}|�|��j�jS)z:
        Return the login name of the file owner.
        rN)r�r�r��st_uidZpw_name)r.r�r!r!r"�owner�sz
Path.ownercCsddl}|�|��j�jS)z8
        Return the group name of the file gid.
        rN)�grpZgetgrgidr��st_gidZgr_name)r.r]r!r!r"�group�sz
Path.group�rrRc	Cs(|jr|��tj|||||||jd�S)z|
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        )Zopener)r<rA�ior�rI)r.r��	buffering�encoding�errors�newliner!r!r"r��s
�z	Path.openc
Cs,|jdd��}|��W5QR�SQRXdS)zK
        Open the file in bytes mode, read it, and close the file.
        �rb�r�N�r��readrr!r!r"�
read_bytes�szPath.read_bytesc
Cs0|jd||d��}|��W5QR�SQRXdS)zJ
        Open the file in text mode, read it, and close the file.
        r`�r�rcrdNrh)r.rcrdrr!r!r"�	read_text�szPath.read_textc
Cs6t|�}|jdd��}|�|�W5QR�SQRXdS)zO
        Open the file in bytes mode, write to it, and close the file.
        �wbrgN)�
memoryviewr��write)r.�dataZviewrr!r!r"�write_bytes�szPath.write_bytesc
CsLt|t�std|jj��|jd||d��}|�|�W5QR�SQRXdS)zN
        Open the file in text mode, write to it, and close the file.
        zdata must be str, not %s�wrkN)rrnrr�rEr�ro)r.rprcrdrr!r!r"�
write_text�s
�zPath.write_textTcCsr|jr|��|r>z|j�|d�Wntk
r8YnXdStjtjB}|sX|tjO}|�	||�}t�
|�dS)zS
        Create this file with the given access mode, if it doesn't exist.
        N)r<rAr�r�r�ro�O_CREAT�O_WRONLY�O_EXCLrK�close)r.r��exist_okrH�fdr!r!r"�touch�s
z
Path.touchcCs�|jr|��z|j�||�Wndtk
rd|r>|j|kr@�|jjddd�|j|d|d�Yn"tk
r�|r~|��s��YnXdS)z<
        Create a new directory at this given path.
        T)r5rxFN)r<rAr�r�rrr4r�r�)r.r�r5rxr!r!r"r�sz
Path.mkdircCs |jr|��|j�||�dS)zF
        Change the permissions of the path, like os.chmod().
        N)r<rAr�r��r.r�r!r!r"r�sz
Path.chmodcCs |jr|��|j�||�dS)z�
        Like chmod(), except if the path points to a symlink, the symlink's
        permissions are changed, rather than its target's.
        N)r<rAr�r�r{r!r!r"r�szPath.lchmodcCs>|jr|��z|j�|�Wntk
r8|s4�YnXdS)zd
        Remove this file or link.
        If the path is a directory, use rmdir() instead.
        N)r<rAr�r�rr)r.Z
missing_okr!r!r"r�%szPath.unlinkcCs|jr|��|j�|�dS)zF
        Remove this directory.  The directory must be empty.
        N)r<rAr�r�r-r!r!r"r�2sz
Path.rmdircCs|jr|��|j�|�S)z�
        Like stat(), except if the path points to a symlink, the symlink's
        status information is returned, rather than its target's.
        )r<rAr�r�r-r!r!r"r�:sz
Path.lstatcCs&|jr|��|j�||�|�|�S)a2
        Rename this path to the target path.

        The target path may be absolute or relative. Relative paths are
        interpreted relative to the current working directory, *not* the
        directory of the Path object.

        Returns the new Path instance pointing to the target path.
        )r<rAr�r�r�r�r!r!r"r�Cs
zPath.renamecCs&|jr|��|j�||�|�|�S)aS
        Rename this path to the target path, overwriting if that path exists.

        The target path may be absolute or relative. Relative paths are
        interpreted relative to the current working directory, *not* the
        directory of the Path object.

        Returns the new Path instance pointing to the target path.
        )r<rAr�r4r�r�r!r!r"r4Rs
zPath.replacecCs"|jr|��|j�|||�dS)z�
        Make this path a symlink pointing to the target path.
        Note the order of arguments (link, target) is the reverse of os.symlink.
        N)r<rAr�r�)r.r�r�r!r!r"�
symlink_toaszPath.symlink_tocCs |jr|��|j�||�dS)aQ
        Make the target path a hard link pointing to this path.

        Note this function does not make this path a hard link to *target*,
        despite the implication of the function and argument names. The order
        of arguments (target, link) is the reverse of Path.symlink_to, but
        matches that of os.link.

        N)r<rAr�r�r�r!r!r"r�js
zPath.link_toc
CsXz|��WnFtk
r>}zt|�s(�WY�dSd}~XYntk
rRYdSXdS)z+
        Whether this path exists.
        FNT)r�r�r#r��r.r�r!r!r"r�zszPath.existsc
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdS)z3
        Whether this path is a directory.
        FN)r	r��st_moder�r#r�r}r!r!r"r��szPath.is_dirc
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdS)zq
        Whether this path is a regular file (also True for symlinks pointing
        to regular files).
        FN)rr�r~r�r#r�r}r!r!r"�is_file�szPath.is_filecCsv|��r|��sdSt|j�}z|��j}Wntk
rBYdSX|��j}||krZdS|��j}|��j}||kS)z;
        Check if this path is a POSIX mount point
        FT)r�r�rr4r��st_devr��st_ino)r.r4Z
parent_devZdevZinoZ
parent_inor!r!r"�is_mount�s



z
Path.is_mountc
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdS)z7
        Whether this path is a symbolic link.
        FN)r
r�r~r�r#r�r}r!r!r"r��szPath.is_symlinkc
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdS)z6
        Whether this path is a block device.
        FN)r
r�r~r�r#r�r}r!r!r"�is_block_device�szPath.is_block_devicec
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdS)z:
        Whether this path is a character device.
        FN)rr�r~r�r#r�r}r!r!r"�is_char_device�szPath.is_char_devicec
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdS)z.
        Whether this path is a FIFO.
        FN)rr�r~r�r#r�r}r!r!r"�is_fifo�szPath.is_fifoc
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdS)z0
        Whether this path is a socket.
        FN)rr�r~r�r#r�r}r!r!r"�	is_socket�szPath.is_socketcCs`|js\|js\|jr\|jddd�dkr\|j�|jddd��}|�|g|jdd��S|S)zl Return a new path with expanded ~ and ~user constructs
        (as returned by os.path.expanduser)
        rNrB�~)r�r�r�rr�r�)r.Zhomedirr!r!r"�
expandusers��zPath.expanduser)N)rG)rJ)F)r`rRNNN)NN)NN)rGT)rJFF)F)F)3rErFrGrHr�r�rr�rBrFrArIrKr8rMrNrQrRrUrVrYrvr�r\r_r�rjrlrqrsrzr�r�r�r�r�r�r�r4r|r�r�r�rr�r�r�r�r�r�r�r!r!r!r"rsj�







�

	



	

	
	c@seZdZdZdZdS)rzsPath subclass for non-Windows systems.

    On a POSIX system, instantiating a Path should return this object.
    r!N)rErFrGrHr�r!r!r!r"rsc@s,eZdZdZdZdd�Zdd�Zdd�Zd	S)
rzqPath subclass for Windows systems.

    On a Windows system, instantiating a Path should return this object.
    r!cCstd��dS)Nz*Path.owner() is unsupported on this systemr�r-r!r!r"r\(szWindowsPath.ownercCstd��dS)Nz*Path.group() is unsupported on this systemr�r-r!r!r"r_+szWindowsPath.groupcCstd��dS)Nz-Path.is_mount() is unsupported on this systemr�r-r!r!r"r�.szWindowsPath.is_mountN)rErFrGrHr�r\r_r�r!r!r!r"r!s
)Arg�	functoolsrar�ror�rer8�_collections_abcrrrrrrr�operatorrr�r	r
rrr
rrZurllib.parserr�r�r�rZgetwindowsversionr�__all__rr r#r(rr)rIr�r;r:r�r�r?r�r�r�r�r�r�r�r�r�r�PathLike�registerrrrrrr!r!r!r"�<module>s|$
�
?&i8
,t

__pycache__/statistics.cpython-38.pyc000064400000101567151153537600013616 0ustar00U

e5d
��@s�dZddddddddd	d
ddd
ddddgZddlZddlZddlZddlmZddlmZddl	m
Z
ddlmZm
Z
ddlmZmZmZmZmZmZmZmZddlmZddlmZGdd�de�Zdedd�Zdd�Zd d!�Zd"d#�Zd$d%�Z d&d'�Z!d(d)�Z"dfd+d,�Z#d-d�Z$d.d�Z%d/d�Z&d0d�Z'd1d�Z(d2d
�Z)d3d	�Z*dgd5d�Z+d6d�Z,d7d�Z-d8d9d:�d;d�Z.dhd<d=�Z/did>d�Z0djd?d�Z1dkd@d�Z2dldAd
�Z3dBdC�Z4GdDd�d�Z5zddEl6m4Z4Wne7k
�r�YnXe8dFk�r�ddGlm9Z9ddHlm:Z:m;Z;m<Z<m=Z=ddIl	m>Z>ddl?Z?e5dJdK�Z@e5dLdM�ZAe@dNdNj$e@j$k�sLtB�e@dNdNj2e@j2k�sftB�dOZCe@�DeC�ZEeA�DeC�ZFe:e;fD]<ZGeHdPeGj8�dQ��eHeGe@eA��eHe5�IeJeGeEeF����q�dRZKe:e;e<e=fD]@ZGeHdPeGj8�dS��eHeGe@eK��eHe5�IeJeGeEe>eK�����q�dTZKe:e;e<fD]@ZGeHdUeGj8�dV��eHeGeKe@��eHe5�IeJeGe>eK�eE����q$dWdX�ZLe5dYdZ�ZMe5d[d\�ZNd]ZOdOZCe5�Id^d_�eM�DeC�D��ZPeLeMeOeP�e5�Id`d_�eM�DeC�D��ZPeLeMeOeP�e5�Idad_�eM�DeC�D��ZPeLeMeOeP�e5�Idbd_�eM�DeC�D��ZPeLeMeOeP�e5�Idcd_�eQeM�DeC�eN�DeC��D��ZPeLeMeNeP�e5�Iddd_�eQeM�DeC�eN�DeC��D��ZPeLeMeNeP�eHe?�R��dS)mam

Basic statistics module.

This module provides functions for calculating statistics of data, including
averages, variance, and standard deviation.

Calculating averages
--------------------

==================  ==================================================
Function            Description
==================  ==================================================
mean                Arithmetic mean (average) of data.
fmean               Fast, floating point arithmetic mean.
geometric_mean      Geometric mean of data.
harmonic_mean       Harmonic mean of data.
median              Median (middle value) of data.
median_low          Low median of data.
median_high         High median of data.
median_grouped      Median, or 50th percentile, of grouped data.
mode                Mode (most common value) of data.
multimode           List of modes (most common values of data).
quantiles           Divide data into intervals with equal probability.
==================  ==================================================

Calculate the arithmetic mean ("the average") of data:

>>> mean([-1.0, 2.5, 3.25, 5.75])
2.625


Calculate the standard median of discrete data:

>>> median([2, 3, 4, 5])
3.5


Calculate the median, or 50th percentile, of data grouped into class intervals
centred on the data values provided. E.g. if your data points are rounded to
the nearest whole number:

>>> median_grouped([2, 2, 3, 3, 3, 4])  #doctest: +ELLIPSIS
2.8333333333...

This should be interpreted in this way: you have two data points in the class
interval 1.5-2.5, three data points in the class interval 2.5-3.5, and one in
the class interval 3.5-4.5. The median of these data points is 2.8333...


Calculating variability or spread
---------------------------------

==================  =============================================
Function            Description
==================  =============================================
pvariance           Population variance of data.
variance            Sample variance of data.
pstdev              Population standard deviation of data.
stdev               Sample standard deviation of data.
==================  =============================================

Calculate the standard deviation of sample data:

>>> stdev([2.5, 3.25, 5.5, 11.25, 11.75])  #doctest: +ELLIPSIS
4.38961843444...

If you have previously calculated the mean, you can pass it as the optional
second argument to the four "spread" functions to avoid recalculating it:

>>> data = [1, 2, 2, 4, 4, 4, 5, 6]
>>> mu = mean(data)
>>> pvariance(data, mu)
2.5


Exceptions
----------

A single exception is defined: StatisticsError is a subclass of ValueError.

�
NormalDist�StatisticsError�fmean�geometric_mean�
harmonic_mean�mean�median�median_grouped�median_high�
median_low�mode�	multimode�pstdev�	pvariance�	quantiles�stdev�variance�N��Fraction)�Decimal)�groupby)�bisect_left�bisect_right)�hypot�sqrt�fabs�exp�erf�tau�log�fsum)�
itemgetter)�Counterc@seZdZdS)rN)�__name__�
__module__�__qualname__�r&r&�"/usr/lib64/python3.8/statistics.pyruscCs�d}t|�\}}||i}|j}ttt|��}t|t�D]@\}}	t||�}tt|	�D]"\}}|d7}||d�|||<qRq6d|kr�|d}
t|
�r�t�nt	dd�t
|���D��}
||
|fS)aC_sum(data [, start]) -> (type, sum, count)

    Return a high-precision sum of the given numeric data as a fraction,
    together with the type to be converted to and the count of items.

    If optional argument ``start`` is given, it is added to the total.
    If ``data`` is empty, ``start`` (defaulting to 0) is returned.


    Examples
    --------

    >>> _sum([3, 2.25, 4.5, -0.5, 1.0], 0.75)
    (<class 'float'>, Fraction(11, 1), 5)

    Some sources of round-off error will be avoided:

    # Built-in sum returns zero.
    >>> _sum([1e50, 1, -1e50] * 1000)
    (<class 'float'>, Fraction(1000, 1), 3000)

    Fractions and Decimals are also supported:

    >>> from fractions import Fraction as F
    >>> _sum([F(2, 3), F(7, 5), F(1, 4), F(5, 6)])
    (<class 'fractions.Fraction'>, Fraction(63, 20), 4)

    >>> from decimal import Decimal as D
    >>> data = [D("0.1375"), D("0.2108"), D("0.3061"), D("0.0419")]
    >>> _sum(data)
    (<class 'decimal.Decimal'>, Fraction(6963, 10000), 4)

    Mixed types are currently treated as an error, except that int is
    allowed.
    r�Ncss|]\}}t||�VqdS�Nr)�.0�d�nr&r&r'�	<genexpr>�sz_sum.<locals>.<genexpr>)�_exact_ratio�get�_coerce�int�typer�map�	_isfinite�AssertionError�sum�sorted�items)�data�start�countr,r+ZpartialsZpartials_get�T�typ�values�totalr&r&r'�_sum{s$
r@cCs.z
|��WStk
r(t�|�YSXdSr))Z	is_finite�AttributeError�mathZisfinite)�xr&r&r'r4�s
r4cCs�|tk	std��||kr|S|tks,|tkr0|S|tkr<|St||�rJ|St||�rX|St|t�rf|St|t�rt|St|t�r�t|t�r�|St|t�r�t|t�r�|Sd}t||j|jf��dS)z�Coerce types T and S to a common type, or raise TypeError.

    Coercion rules are currently an implementation detail. See the CoerceTest
    test class in test_statistics for details.
    zinitial type T is boolz"don't know how to coerce %s and %sN)�boolr5r1�
issubclassr�float�	TypeErrorr#)r<�S�msgr&r&r'r0�s*



r0cCs�zrt|�tkst|�tkr$|��WSz|j|jfWWStk
rnz|��WYWStk
rhYnXYnXWn,ttfk
r�t	|�r�t
�|dfYSXd}t|�t|�j
���dS)z�Return Real number x to exact (numerator, denominator) pair.

    >>> _exact_ratio(0.25)
    (1, 4)

    x is expected to be an int, Fraction, Decimal or float.
    Nz0can't convert type '{}' to numerator/denominator)r2rFr�as_integer_ratio�	numerator�denominatorrA�
OverflowError�
ValueErrorr4r5rG�formatr#)rCrIr&r&r'r.�s
r.cCspt|�|kr|St|t�r(|jdkr(t}z
||�WStk
rjt|t�rd||j�||j�YS�YnXdS)z&Convert value to given numeric type T.r(N)r2rEr1rLrFrGrrK)�valuer<r&r&r'�_convert�s

rQcCs.t||�}|t|�kr&|||kr&|St�dS)z,Locate the leftmost value exactly equal to xN)r�lenrN)�arC�ir&r&r'�
_find_lteq
s
rUcCs>t|||d�}|t|�dkr6||d|kr6|dSt�dS)z-Locate the rightmost value exactly equal to x)�lor(N)rrRrN)rS�lrCrTr&r&r'�
_find_rteqs rX�negative valueccs$|D]}|dkrt|��|VqdS)z7Iterate over values, failing if any are less than zero.rN)r)r>�errmsgrCr&r&r'�	_fail_negsr[cCsTt|�|krt|�}t|�}|dkr,td��t|�\}}}||ksFt�t|||�S)a�Return the sample arithmetic mean of data.

    >>> mean([1, 2, 3, 4, 4])
    2.8

    >>> from fractions import Fraction as F
    >>> mean([F(3, 7), F(1, 21), F(5, 3), F(1, 3)])
    Fraction(13, 21)

    >>> from decimal import Decimal as D
    >>> mean([D("0.5"), D("0.75"), D("0.625"), D("0.375")])
    Decimal('0.5625')

    If ``data`` is empty, StatisticsError will be raised.
    r(z%mean requires at least one data point)�iter�listrRrr@r5rQ)r9r,r<r?r;r&r&r'r'scstzt|��Wn0tk
r<d��fdd�}t||��}Yn
Xt|�}z
|�WStk
rntd�d�YnXdS)z�Convert data to floats and compute the arithmetic mean.

    This runs faster than the mean() function and it always returns a float.
    If the input dataset is empty, it raises a StatisticsError.

    >>> fmean([3.5, 4.0, 5.25])
    4.25
    rc3s t|dd�D]\�}|VqdS)Nr()r:)�	enumerate)�iterablerC�r,r&r'r;Oszfmean.<locals>.countz&fmean requires at least one data pointN)rRrGr �ZeroDivisionErrorr)r9r;r?r&r`r'rAs	
cCs8ztttt|���WStk
r2td�d�YnXdS)aYConvert data to floats and compute the geometric mean.

    Raises a StatisticsError if the input dataset is empty,
    if it contains a zero, or if it contains a negative value.

    No special efforts are made to achieve exact results.
    (However, this may change in the future.)

    >>> round(geometric_mean([54, 24, 36]), 9)
    36.0
    zHgeometric mean requires a non-empty dataset  containing positive numbersN)rrr3rrNr)r9r&r&r'r\s�cCs�t|�|krt|�}d}t|�}|dkr2td��n<|dkrn|d}t|tjtf�rf|dkrbt|��|Std��z"t	dd�t
||�D��\}}}Wntk
r�YdSX||ks�t�t
|||�S)aReturn the harmonic mean of data.

    The harmonic mean, sometimes called the subcontrary mean, is the
    reciprocal of the arithmetic mean of the reciprocals of the data,
    and is often appropriate when averaging quantities which are rates
    or ratios, for example speeds. Example:

    Suppose an investor purchases an equal value of shares in each of
    three companies, with P/E (price/earning) ratios of 2.5, 3 and 10.
    What is the average P/E ratio for the investor's portfolio?

    >>> harmonic_mean([2.5, 3, 10])  # For an equal investment portfolio.
    3.6

    Using the arithmetic mean would give an average of about 5.167, which
    is too high.

    If ``data`` is empty, or any element is less than zero,
    ``harmonic_mean`` will raise ``StatisticsError``.
    z.harmonic mean does not support negative valuesr(z.harmonic_mean requires at least one data pointrzunsupported typecss|]}d|VqdS)r(Nr&�r*rCr&r&r'r-�sz harmonic_mean.<locals>.<genexpr>)r\r]rRr�
isinstance�numbersZRealrrGr@r[rar5rQ)r9rZr,rCr<r?r;r&r&r'ros&
"cCs\t|�}t|�}|dkr td��|ddkr8||dS|d}||d||dSdS)aBReturn the median (middle value) of numeric data.

    When the number of data points is odd, return the middle data point.
    When the number of data points is even, the median is interpolated by
    taking the average of the two middle values:

    >>> median([1, 3, 5])
    3
    >>> median([1, 3, 5, 7])
    4.0

    r�no median for empty data�r(N�r7rRr)r9r,rTr&r&r'r�s
cCsLt|�}t|�}|dkr td��|ddkr8||dS||ddSdS)a	Return the low median of numeric data.

    When the number of data points is odd, the middle value is returned.
    When it is even, the smaller of the two middle values is returned.

    >>> median_low([1, 3, 5])
    3
    >>> median_low([1, 3, 5, 7])
    3

    rrerfr(Nrg�r9r,r&r&r'r
�scCs,t|�}t|�}|dkr td��||dS)aReturn the high median of data.

    When the number of data points is odd, the middle value is returned.
    When it is even, the larger of the two middle values is returned.

    >>> median_high([1, 3, 5])
    3
    >>> median_high([1, 3, 5, 7])
    5

    rrerfrgrhr&r&r'r	�s
r(c
Cs�t|�}t|�}|dkr"td��n|dkr2|dS||d}||fD]}t|ttf�rFtd|��qFz||d}Wn(tk
r�t|�t|�d}YnXt||�}t	|||�}|}||d}	|||d||	S)a�Return the 50th percentile (median) of grouped continuous data.

    >>> median_grouped([1, 2, 2, 3, 4, 4, 4, 4, 4, 5])
    3.7
    >>> median_grouped([52, 52, 53, 54])
    52.5

    This calculates the median as the 50th percentile, and should be
    used when your data is continuous and grouped. In the above example,
    the values 1, 2, 3, etc. actually represent the midpoint of classes
    0.5-1.5, 1.5-2.5, 2.5-3.5, etc. The middle value falls somewhere in
    class 3.5-4.5, and interpolation is used to estimate it.

    Optional argument ``interval`` represents the class interval, and
    defaults to 1. Changing the class interval naturally will change the
    interpolated 50th percentile value:

    >>> median_grouped([1, 3, 3, 5, 7], interval=1)
    3.25
    >>> median_grouped([1, 3, 3, 5, 7], interval=2)
    3.5

    This function does not check whether the data points are at least
    ``interval`` apart.
    rrer(rfzexpected number but got %r)
r7rRrrc�str�bytesrGrFrUrX)
r9Zintervalr,rC�obj�L�l1�l2Zcf�fr&r&r'r�s&

cCsHt|�}t|��d�}z|ddWStk
rBtd�d�YnXdS)axReturn the most common data point from discrete or nominal data.

    ``mode`` assumes discrete data, and returns a single value. This is the
    standard treatment of the mode as commonly taught in schools:

        >>> mode([1, 1, 2, 3, 3, 3, 3, 4])
        3

    This also works with nominal (non-numeric) data:

        >>> mode(["red", "blue", "blue", "red", "green", "red", "red"])
        'red'

    If there are multiple modes with same frequency, return the first one
    encountered:

        >>> mode(['red', 'red', 'green', 'blue', 'blue'])
        'red'

    If *data* is empty, ``mode``, raises StatisticsError.

    r(rzno mode for empty dataN)r\r"�most_common�
IndexErrorr)r9Zpairsr&r&r'rscCs@tt|����}tt|td�d�dgf�\}}tttd�|��S)a.Return a list of the most frequently occurring values.

    Will return more than one result if there are multiple modes
    or an empty list if *data* is empty.

    >>> multimode('aabbbbbbbbcc')
    ['b']
    >>> multimode('aabbbbccddddeeffffgg')
    ['b', 'd', 'f']
    >>> multimode('')
    []
    r()�keyr)r"r\rp�nextrr!r]r3)r9ZcountsZmaxcountZ
mode_itemsr&r&r'r5s
��	exclusive)r,�methodc
CsL|dkrtd��t|�}t|�}|dkr0td��|dkr�|d}g}td|�D]N}|||}||||}||||||d||}	|�|	�qN|S|dk�r:|d}g}td|�D]r}|||}|dkr�dn||dkr�|dn|}||||}||d||||||}	|�|	�q�|Std|����dS)	a�Divide *data* into *n* continuous intervals with equal probability.

    Returns a list of (n - 1) cut points separating the intervals.

    Set *n* to 4 for quartiles (the default).  Set *n* to 10 for deciles.
    Set *n* to 100 for percentiles which gives the 99 cuts points that
    separate *data* in to 100 equal sized groups.

    The *data* can be any iterable containing sample.
    The cut points are linearly interpolated between data points.

    If *method* is set to *inclusive*, *data* is treated as population
    data.  The minimum value is treated as the 0th percentile and the
    maximum value is treated as the 100th percentile.
    r(zn must be at least 1rfz"must have at least two data pointsZ	inclusiveruzUnknown method: N)rr7rR�range�appendrN)
r9r,rvZld�m�resultrT�jZdeltaZinterpolatedr&r&r'rls4$
$$cs��dk	r,t�fdd�|D��\}}}||fSt|��t�fdd�|D��\}}}t�fdd�|D��\}}}||kr|||ks�t�||dt|�8}|dkr�td|��||fS)	a;Return sum of square deviations of sequence data.

    If ``c`` is None, the mean is calculated in one pass, and the deviations
    from the mean are calculated in a second pass. Otherwise, deviations are
    calculated from ``c`` as given. Use the second case with care, as it can
    lead to garbage results.
    Nc3s|]}|�dVqdS�rfNr&rb��cr&r'r-�sz_ss.<locals>.<genexpr>c3s|]}|�dVqdSr|r&rbr}r&r'r-�sc3s|]}|�VqdSr)r&rbr}r&r'r-�srfrz%negative sum of square deviations: %f)r@rr5rR)r9r~r<r?r;�UZtotal2Zcount2r&r}r'�_ss�sr�cCsLt|�|krt|�}t|�}|dkr,td��t||�\}}t||d|�S)a�Return the sample variance of data.

    data should be an iterable of Real-valued numbers, with at least two
    values. The optional argument xbar, if given, should be the mean of
    the data. If it is missing or None, the mean is automatically calculated.

    Use this function when your data is a sample from a population. To
    calculate the variance from the entire population, see ``pvariance``.

    Examples:

    >>> data = [2.75, 1.75, 1.25, 0.25, 0.5, 1.25, 3.5]
    >>> variance(data)
    1.3720238095238095

    If you have already calculated the mean of your data, you can pass it as
    the optional second argument ``xbar`` to avoid recalculating it:

    >>> m = mean(data)
    >>> variance(data, m)
    1.3720238095238095

    This function does not check that ``xbar`` is actually the mean of
    ``data``. Giving arbitrary values for ``xbar`` may lead to invalid or
    impossible results.

    Decimals and Fractions are supported:

    >>> from decimal import Decimal as D
    >>> variance([D("27.5"), D("30.25"), D("30.25"), D("34.5"), D("41.75")])
    Decimal('31.01875')

    >>> from fractions import Fraction as F
    >>> variance([F(1, 6), F(1, 2), F(5, 3)])
    Fraction(67, 108)

    rfz*variance requires at least two data pointsr(�r\r]rRrr�rQ)r9�xbarr,r<�ssr&r&r'r�s&cCsHt|�|krt|�}t|�}|dkr,td��t||�\}}t|||�S)a,Return the population variance of ``data``.

    data should be a sequence or iterable of Real-valued numbers, with at least one
    value. The optional argument mu, if given, should be the mean of
    the data. If it is missing or None, the mean is automatically calculated.

    Use this function to calculate the variance from the entire population.
    To estimate the variance from a sample, the ``variance`` function is
    usually a better choice.

    Examples:

    >>> data = [0.0, 0.25, 0.25, 1.25, 1.5, 1.75, 2.75, 3.25]
    >>> pvariance(data)
    1.25

    If you have already calculated the mean of the data, you can pass it as
    the optional second argument to avoid recalculating it:

    >>> mu = mean(data)
    >>> pvariance(data, mu)
    1.25

    Decimals and Fractions are supported:

    >>> from decimal import Decimal as D
    >>> pvariance([D("27.5"), D("30.25"), D("30.25"), D("34.5"), D("41.75")])
    Decimal('24.815')

    >>> from fractions import Fraction as F
    >>> pvariance([F(1, 4), F(5, 4), F(1, 2)])
    Fraction(13, 72)

    r(z*pvariance requires at least one data pointr�)r9�mur,r<r�r&r&r'r�s#cCs8t||�}z
|��WStk
r2t�|�YSXdS)z�Return the square root of the sample variance.

    See ``variance`` for arguments and other details.

    >>> stdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75])
    1.0810874155219827

    N)rrrArB)r9r��varr&r&r'rs
	

cCs8t||�}z
|��WStk
r2t�|�YSXdS)z�Return the square root of the population variance.

    See ``pvariance`` for arguments and other details.

    >>> pstdev([1.5, 2.5, 2.5, 2.75, 3.25, 4.75])
    0.986893273527251

    N)rrrArB)r9r�r�r&r&r'r
&s
	

cCs|d}t|�dkr�d||}d|d|d|d|d|d	|d
|d|}d|d
|d|d|d|d|d|d}||}|||S|dkr�|nd|}tt|��}|dk�r^|d}d|d|d|d|d|d|d|d}d|d |d!|d"|d#|d$|d%|d}n�|d}d&|d'|d(|d)|d*|d+|d,|d-}d.|d/|d0|d1|d2|d3|d4|d}||}|dk�r�|}|||S)5N��?g333333�?g��Q��?g^�}o)��@g�E.k�R�@g ��Ul�@g*u��>l�@g�N����@g�"]Ξ@gnC���`@gu��@giK��~j�@gv��|E�@g��d�|1�@gfR��r��@g��u.2�@g���~y�@g�n8(E@��?�g@g�������?g鬷�ZaI?gg�El�D�?g7\�����?g�uS�S�?g�=�.
@gj%b�@g���Hw�@gjR�e�?g�9dh?
>g('߿��A?g��~z �?g@�3��?gɅ3��?g3fR�x�?gI�F��l@g����t��>g*�Y��n�>gESB\T?g�N;A+�?g�UR1��?gE�F���?gP�n��@g&�>���@g����i�<g�@�F�>g�tcI,\�>g�ŝ���I?g*F2�v�?g�C4�?g��O�1�?)rrr)�pr��sigma�q�rZnumZdenrCr&r&r'�_normal_dist_inv_cdf9sd���������������������������
��������������������������	��������������������������
r�c@s�eZdZdZddd�Zd8dd�Zed	d
��Zdd�d
d�Zdd�Z	dd�Z
dd�Zd9dd�Zdd�Z
edd��Zedd��Zedd��Zed d!��Zed"d#��Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�ZeZd0d1�ZeZd2d3�Zd4d5�Zd6d7�ZdS):rz(Normal distribution of a random variablez(Arithmetic mean of a normal distributionz+Standard deviation of a normal distribution)�_mu�_sigmar�r�cCs(|dkrtd��t|�|_t|�|_dS)zDNormalDist where mu is the mean and sigma is the standard deviation.r�zsigma must be non-negativeN)rrFr�r�)�selfr�r�r&r&r'�__init__�s
zNormalDist.__init__cCs.t|ttf�st|�}t|�}||t||��S)z5Make a normal distribution instance from sample data.)rcr]�tuplerr)�clsr9r�r&r&r'�from_samples�szNormalDist.from_samplesN)�seedcsB|dkrtjn
t�|�j�|j|j�����fdd�t|�D�S)z=Generate *n* samples for a given mean and standard deviation.Ncsg|]}�����qSr&r&�r*rT��gaussr�r�r&r'�
<listcomp>�sz&NormalDist.samples.<locals>.<listcomp>)�randomr�ZRandomr�r�rw)r�r,r�r&r�r'�samples�szNormalDist.samplescCs<|jd}|std��t||jdd|�tt|�S)z4Probability density function.  P(x <= X < x+dx) / dx�@z$pdf() not defined when sigma is zerog�)r�rrr�rr)r�rCrr&r&r'�pdf�s
zNormalDist.pdfcCs2|jstd��ddt||j|jtd��S)z,Cumulative distribution function.  P(X <= x)z$cdf() not defined when sigma is zeror�r�r�)r�rrr�r)r�rCr&r&r'�cdf�szNormalDist.cdfcCs:|dks|dkrtd��|jdkr*td��t||j|j�S)aSInverse cumulative distribution function.  x : P(X <= x) = p

        Finds the value of the random variable such that the probability of
        the variable being less than or equal to that value equals the given
        probability.

        This function is also called the percent point function or quantile
        function.
        r�r�z$p must be in the range 0.0 < p < 1.0z-cdf() not defined when sigma at or below zero)rr�r�r�)r�r�r&r&r'�inv_cdf�s


zNormalDist.inv_cdfrtcs��fdd�td��D�S)anDivide into *n* continuous intervals with equal probability.

        Returns a list of (n - 1) cut points separating the intervals.

        Set *n* to 4 for quartiles (the default).  Set *n* to 10 for deciles.
        Set *n* to 100 for percentiles which gives the 99 cuts points that
        separate the normal distribution in to 100 equal sized groups.
        csg|]}��|���qSr&)r�r��r,r�r&r'r��sz(NormalDist.quantiles.<locals>.<listcomp>r()rw)r�r,r&r�r'r�s	zNormalDist.quantilescCst|t�std��||}}|j|jf|j|jfkr>||}}|j|j}}|rT|s\td��||}t|j|j�}|s�dt|d|jt	d��S|j||j|}|j|jt	|d|t
||��}	||	|}
||	|}dt|�|
�|�|
��t|�|�|�|��S)a�Compute the overlapping coefficient (OVL) between two normal distributions.

        Measures the agreement between two normal probability distributions.
        Returns a value between 0.0 and 1.0 giving the overlapping area in
        the two underlying probability density functions.

            >>> N1 = NormalDist(2.4, 1.6)
            >>> N2 = NormalDist(3.2, 2.0)
            >>> N1.overlap(N2)
            0.8035050657330205
        z$Expected another NormalDist instancez(overlap() not defined when sigma is zeror�r�)rcrrGr�r�rrrrrrr�)r��other�X�YZX_varZY_varZdvZdmrS�b�x1�x2r&r&r'�overlap�s"


(zNormalDist.overlapcCs|jS)z+Arithmetic mean of the normal distribution.�r��r�r&r&r'r�szNormalDist.meancCs|jS)z,Return the median of the normal distributionr�r�r&r&r'r�szNormalDist.mediancCs|jS)z�Return the mode of the normal distribution

        The mode is the value x where which the probability density
        function (pdf) takes its maximum value.
        r�r�r&r&r'r�szNormalDist.modecCs|jS)z.Standard deviation of the normal distribution.�r�r�r&r&r'r�szNormalDist.stdevcCs
|jdS)z!Square of the standard deviation.r�r�r�r&r&r'rszNormalDist.variancecCs8t|t�r&t|j|jt|j|j��St|j||j�S)ajAdd a constant or another NormalDist instance.

        If *other* is a constant, translate mu by the constant,
        leaving sigma unchanged.

        If *other* is a NormalDist, add both the means and the variances.
        Mathematically, this works only if the two distributions are
        independent or if they are jointly normally distributed.
        �rcrr�rr��r�r�r&r&r'�__add__	s

zNormalDist.__add__cCs8t|t�r&t|j|jt|j|j��St|j||j�S)asSubtract a constant or another NormalDist instance.

        If *other* is a constant, translate by the constant mu,
        leaving sigma unchanged.

        If *other* is a NormalDist, subtract the means and add the variances.
        Mathematically, this works only if the two distributions are
        independent or if they are jointly normally distributed.
        r�r�r&r&r'�__sub__s

zNormalDist.__sub__cCst|j||jt|��S)z�Multiply both mu and sigma by a constant.

        Used for rescaling, perhaps to change measurement units.
        Sigma is scaled with the absolute value of the constant.
        �rr�r�rr�r&r&r'�__mul__%szNormalDist.__mul__cCst|j||jt|��S)z�Divide both mu and sigma by a constant.

        Used for rescaling, perhaps to change measurement units.
        Sigma is scaled with the absolute value of the constant.
        r�r�r&r&r'�__truediv__-szNormalDist.__truediv__cCst|j|j�S)zReturn a copy of the instance.�rr�r��r�r&r&r'�__pos__5szNormalDist.__pos__cCst|j|j�S)z(Negates mu while keeping sigma the same.r�r�r&r&r'�__neg__9szNormalDist.__neg__cCs
||S)z<Subtract a NormalDist from a constant or another NormalDist.r&r�r&r&r'�__rsub__?szNormalDist.__rsub__cCs&t|t�stS|j|jko$|j|jkS)zFTwo NormalDist objects are equal if their mu and sigma are both equal.)rcr�NotImplementedr�r�r�r&r&r'�__eq__Es
zNormalDist.__eq__cCst|j|jf�S)zCNormalDist objects hash equal if their mu and sigma are both equal.)�hashr�r�r�r&r&r'�__hash__KszNormalDist.__hash__cCs t|�j�d|j�d|j�d�S)Nz(mu=z, sigma=�))r2r#r�r�r�r&r&r'�__repr__OszNormalDist.__repr__)r�r�)rt) r#r$r%�__doc__�	__slots__r��classmethodr�r�r�r�r�rr��propertyrrrrrr�r�r�r�r�r��__radd__r��__rmul__r�r�r�r&r&r&r'r�sF�


"




)r��__main__)�isclose)�add�sub�mul�truediv)�repeat�
������i��z
Test z with another NormalDist:�z with a constant:�z
Test constant with �:cCs@t|j|jdd�st||f��t|j|jdd�s<t||f��dS)Ng{�G�z�?)Zrel_tol)r�rr5r)�G1�G2r&r&r'�assert_closesr�i�����I��/g`@@cCsg|]}|t�qSr&��srbr&r&r'r��sr�cCsg|]}|t�qSr&r�rbr&r&r'r��scCsg|]}|t�qSr&r�rbr&r&r'r��scCsg|]}|t�qSr&r�rbr&r&r'r��scCsg|]\}}||�qSr&r&�r*rC�yr&r&r'r��scCsg|]\}}||�qSr&r&r�r&r&r'r��s)r)rY)r()N)N)N)N)N)Sr��__all__rBrdr�Z	fractionsrZdecimalr�	itertoolsrZbisectrrrrrrrrrr �operatorr!�collectionsr"rNrr@r4r0r.rQrUrXr[rrrrrr
r	rrrrr�rrrr
r�rZ_statistics�ImportErrorr#r�r�r�r�r�r�ZdoctestZg1Zg2r5r,r�r�r��func�printr�r3Zconstr�r�r�r�rH�zipZtestmodr&r&r&r'�<module>s�S�(
: 

/
779

/
,

JQ






�
�
__pycache__/string.cpython-38.pyc000064400000016206151153537600012725 0ustar00U

e5d')�@s�dZddddddddd	d
ddgZd
dlZdZdZdZeeZdZeddZdZ	dZ
eee
eZddd�Zd
dl
Zd
dlmZiZGdd�de�ZGdd�ded�ZGdd�d�ZdS)anA collection of string constants.

Public module variables:

whitespace -- a string containing all ASCII whitespace
ascii_lowercase -- a string containing all ASCII lowercase letters
ascii_uppercase -- a string containing all ASCII uppercase letters
ascii_letters -- a string containing all ASCII letters
digits -- a string containing all ASCII decimal digits
hexdigits -- a string containing all ASCII hexadecimal digits
octdigits -- a string containing all ASCII octal digits
punctuation -- a string containing all ASCII punctuation characters
printable -- a string containing all ASCII characters considered printable

�
ascii_letters�ascii_lowercase�ascii_uppercase�capwords�digits�	hexdigits�	octdigits�	printable�punctuation�
whitespace�	Formatter�Template�Nz 	

ZabcdefghijklmnopqrstuvwxyzZABCDEFGHIJKLMNOPQRSTUVWXYZ�
0123456789ZabcdefZABCDEFZ01234567z !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~cCs|pd�dd�|�|�D��S)a�capwords(s [,sep]) -> string

    Split the argument into words using split, capitalize each
    word using capitalize, and join the capitalized words using
    join.  If the optional second argument sep is absent or None,
    runs of whitespace characters are replaced by a single space
    and leading and trailing whitespace are removed, otherwise
    sep is used to split and join the words.

    � css|]}|��VqdS�N)�
capitalize)�.0�x�r�/usr/lib64/python3.8/string.py�	<genexpr>0szcapwords.<locals>.<genexpr>)�join�split)�s�seprrrr%s)�ChainMapcs eZdZdZ�fdd�Z�ZS)�_TemplateMetaclassa/
    %(delim)s(?:
      (?P<escaped>%(delim)s) |   # Escape sequence of two delimiters
      (?P<named>%(id)s)      |   # delimiter and a Python identifier
      {(?P<braced>%(bid)s)}  |   # delimiter and a braced identifier
      (?P<invalid>)              # Other ill-formed delimiter exprs
    )
    csbtt|��|||�d|kr$|j}n$tjt�|j�|j|jp@|jd�}t�	||j
tjB�|_dS)N�pattern)Zdelim�idZbid)�superr�__init__r�_re�escape�	delimiter�	idpattern�braceidpattern�compile�flags�VERBOSE)�cls�name�basesZdctr��	__class__rrr Cs

�z_TemplateMetaclass.__init__)�__name__�
__module__�__qualname__rr �
__classcell__rrr,rr9s	rc@sJeZdZdZdZdZdZejZ	dd�Z
dd�Zefd	d
�Z
efdd�ZdS)
rz.A string class for supporting $-substitutions.�$z(?a:[_a-z][_a-z0-9]*)NcCs
||_dSr)�template)�selfr3rrrr \szTemplate.__init__cCsd|�d�}|jd|�jdd�}|s.d}d}n"|td�|dd���}t|�}td||f��dS)N�invalidT)�keepends�����z.Invalid placeholder in string: line %d, col %d)�startr3�
splitlines�lenr�
ValueError)r4�mo�i�lines�colno�linenorrr�_invalidas
�zTemplate._invalidcs:�tkr|�n|rt|�����fdd�}�j�|�j�S)Ncsd|�d�p|�d�}|dk	r(t�|�S|�d�dk	r<�jS|�d�dk	rT��|�td�j��dS�N�namedZbracedZescapedr5z#Unrecognized named group in pattern)�group�strr#rCr=r�r>rE��mappingr4rr�convertss
�z$Template.substitute.<locals>.convert��_sentinel_dict�	_ChainMapr�subr3�r4rJZkwsrKrrIr�
substitutems
zTemplate.substitutecs:�tkr|�n|rt|�����fdd�}�j�|�j�S)Ncs�|�d�p|�d�}|dk	rHzt�|�WStk
rF|��YSX|�d�dk	r\�jS|�d�dk	rr|��Std�j��dSrD)rFrG�KeyErrorr#r=rrHrIrrrK�s�z)Template.safe_substitute.<locals>.convertrLrPrrIr�safe_substitute�s

zTemplate.safe_substitute)r.r/r0�__doc__r#r$r%r!�
IGNORECASEr'r rCrMrQrSrrrrrPs)�	metaclassc@sVeZdZdd�Zdd�Zddd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�ZdS)rcOs|�|||�Sr)�vformat)r4�
format_string�args�kwargsrrr�format�szFormatter.formatcCs.t�}|�||||d�\}}|�|||�|S)N�)�set�_vformat�check_unused_args)r4rXrYrZ�	used_args�result�_rrrrW�szFormatter.vformatr
c	Cs�|dkrtd��g}|�|�D]�\}}	}
}|r8|�|�|	dk	r|	dkrj|dkrXtd��t|�}	|d7}n|	��r�|r~td��d}|�|	||�\}}
|�|
�|�||�}|j|
||||d|d�\}
}|�|�	||
��qd�
|�|fS)Nr
zMax string recursion exceededr8FzJcannot switch from manual field specification to automatic field numberingr7)�auto_arg_index)r=�parse�appendrG�isdigit�	get_field�add�
convert_fieldr^�format_fieldr)r4rXrYrZr`Zrecursion_depthrcraZliteral_text�
field_name�format_spec�
conversion�objZarg_usedrrrr^�s<�


�
zFormatter._vformatcCst|t�r||S||SdSr)�
isinstance�int)r4�keyrYrZrrr�	get_value�s
zFormatter.get_valuecCsdSrr)r4r`rYrZrrrr_�szFormatter.check_unused_argscCs
t||�Sr)r[)r4�valuerlrrrrj�szFormatter.format_fieldcCsN|dkr|S|dkrt|�S|dkr,t|�S|dkr<t|�Std�|���dS)Nr�r�az"Unknown conversion specifier {0!s})rG�repr�asciir=r[)r4rsrmrrrri�szFormatter.convert_fieldcCs
t�|�Sr)�_stringZformatter_parser)r4rXrrrrdszFormatter.parsec	CsJt�|�\}}|�|||�}|D] \}}|r8t||�}q ||}q ||fSr)rxZformatter_field_name_splitrr�getattr)	r4rkrYrZ�first�restrnZis_attrr?rrrrg
s
zFormatter.get_fieldN)r
)r.r/r0r[rWr^rrr_rjrirdrgrrrrr�s�
6	)N)rT�__all__rxr
rrrrrrr	rr�rer!�collectionsrrNrM�typerrrrrrr�<module>s6�
Q__pycache__/decimal.cpython-38.opt-2.pyc000064400000000551151153537600013751 0ustar00U

e5d@�@svz0ddlTddlmZddlmZddlmZWn@ek
rpddlTddlmZddlmZddlmZYnXdS)�)�*)�__doc__)�__version__)�__libmpdec_version__N)Z_decimalrrr�ImportErrorZ
_pydecimal�rr�/usr/lib64/python3.8/decimal.py�<module>s__pycache__/pickle.cpython-38.opt-1.pyc000064400000133311151153537600013622 0ustar00U

e5d��	@shdZddlmZddlmZddlmZmZmZddlm	Z	ddl
mZddlZddlm
Z
dd	lmZmZddlZddlZddlZddlZd
ddd
dddddg	ZzddlmZe�d�dZWnek
r�dZYnXeefZdZddddddddgZdZ d Z!Gd!d
�d
e"�Z#Gd"d�de#�Z$Gd#d�de#�Z%Gd$d%�d%e"�Z&zdd&l'm(Z(Wnek
�rldZ(YnXd'Z)d(Z*d)Z+d*Z,d+Z-d,Z.d-Z/d.Z0d/Z1d0Z2d1Z3d2Z4d3Z5d4Z6d5Z7d6Z8d7Z9d8Z:d9Z;d:Z<d;Z=d<Z>d=Z?d>Z@d?ZAd@ZBdAZCdBZDdCZEdDZFdEZGdFZHdGZIdHZJdIZKdJZLdKZMdLZNdMZOdNZPdOZQdPZRdQZSdRZTdSZUdTZVdUZWdVZXdWZYdXZZdYZ[dZZ\d[Z]d\Z^d]Z_eOeYeZe[gZ`d^Zad_Zbd`ZcdaZddbZedcZfddZgdeZhdfZidgZjdhZkdiZldjZmdkZndlZoe�pdmdn�eq�D��Gdodp�dp�ZrGdqdr�dr�Zsdsdt�Ztdudv�Zudwdx�Zvdydz�ZwGd{d|�d|�ZxGd}d~�d~�Zyd�ddd�d�d��Zzd�ddd�d�d��Z{dd�d�dd��d�d��Z|dd�d�dd��d�d��Z}z0dd�lm#Z#m$Z$m%Z%m~Z~mZm�Z�m�Z�m�Z�m�Z�Wn4ek
�r�exeyZ~Zeze{e|e}f\Z�Z�Z�Z�YnXd�d��Z�e�d�k�rdddl�Z�e�j�d�d��Z�e�j�d�e���d��d�d�d��e�j�d�d�d�d�d��e�j�d�d�d�d��e����Z�e�j��r*e��n:e�j��s<e����n(ddl�Z�e�j�D]Z�e�e��Z�e���e���qJdS)�a�Create portable serialized representations of Python objects.

See module copyreg for a mechanism for registering custom picklers.
See module pickletools source for extensive comments.

Classes:

    Pickler
    Unpickler

Functions:

    dump(object, file)
    dumps(object) -> string
    load(file) -> object
    loads(string) -> object

Misc variables:

    __version__
    format_version
    compatible_formats

�)�FunctionType)�dispatch_table)�_extension_registry�_inverted_registry�_extension_cache)�islice)�partialN)�maxsize)�pack�unpack�PickleError�
PicklingError�UnpicklingError�Pickler�	Unpickler�dump�dumps�load�loads)�PickleBufferrTFz4.0z1.0z1.1z1.2z1.3z2.0z3.0z5.0��c@seZdZdZdS)rz6A common base class for the other pickling exceptions.N��__name__�
__module__�__qualname__�__doc__�rr�/usr/lib64/python3.8/pickle.pyrIsc@seZdZdZdS)r
z]This exception is raised when an unpicklable object is passed to the
    dump() method.

    Nrrrrrr
Msc@seZdZdZdS)raThis exception is raised when there is a problem unpickling an object,
    such as a security violation.

    Note that other exceptions may also be raised during unpickling, including
    (but not necessarily limited to) AttributeError, EOFError, ImportError,
    and IndexError.

    NrrrrrrTsc@seZdZdd�ZdS)�_StopcCs
||_dS�N)�value��selfr!rrr�__init__bsz_Stop.__init__N)rrrr$rrrrrasr)�PyStringMap�(�.�0�1�2�F�I�J�K�L�M�N�P�Q�R�S�T�U�V�X�a�b�c�d�}�e�g�h�i�j�l�]�o�p�q�r�s�t�)�u�GsI01
sI00
�������������������������B�C��������������������������cCsg|]}t�d|�r|�qS)z[A-Z][A-Z0-9_]+$)�re�match)�.0�xrrr�
<listcomp>�srnc@sFeZdZdZdZdd�Zdd�Zdd�Zdd
d�Zdd
�Z	dd�Z
dS)�_FramerricCs||_d|_dSr )�
file_write�
current_frame)r#rprrrr$�sz_Framer.__init__cCst��|_dSr )�io�BytesIOrq�r#rrr�
start_framing�sz_Framer.start_framingcCs*|jr&|j��dkr&|jdd�d|_dS)NrT��force)rq�tell�commit_framertrrr�end_framing�sz_Framer.end_framingFcCsf|jrb|j}|��|jks|rb|��}|j}t|�|jkrP|ttdt|���||�t	�
�|_dS)N�<Q)rqrx�_FRAME_SIZE_TARGET�	getbufferrp�len�_FRAME_SIZE_MIN�FRAMEr
rrrs)r#rw�f�data�writerrrry�sz_Framer.commit_framecCs |jr|j�|�S|�|�SdSr )rqr�rp�r#r�rrrr��sz
_Framer.writecCs,|j}|jr|jdd�||�||�dS)NTrv)rprqry)r#�headerZpayloadr�rrr�write_large_bytes�s
z_Framer.write_large_bytesN)F)rrrrr|r$rurzryr�r�rrrrro�s
roc@s6eZdZddd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�	_UnframerNcCs||_||_d|_dSr )�	file_read�
file_readlinerq)r#r�r�Z	file_tellrrrr$	sz_Unframer.__init__cCs�|jrb|j�|�}|dkrJt|�dkrJd|_t|�}|�|�|dd�<|S|t|�kr^td��|St|�}|�|�|dd�<|SdS�Nr�$pickle exhausted before end of frame)rq�readintor~r�r)r#�buf�nrrrr�s�z_Unframer.readintocCsT|jrF|j�|�}|s.|dkr.d|_|�|�St|�|krBtd��|S|�|�SdSr�)rq�readr�r~r�r#r�r�rrrr�s
�z_Unframer.readcCsF|jr:|j��}|s"d|_|��S|ddkr6td��|S|��SdS)N����
r�)rq�readliner�rr�rrrr�,s
�z_Unframer.readlinecCs2|jr|j��dkrtd��t�|�|��|_dS)N�z4beginning of a new frame before end of current frame)rqr�rrrrsr��r#Z
frame_sizerrr�
load_frame9s
�z_Unframer.load_frame)N)rrrr$r�r�r�r�rrrrr�s



r�c	Csj|�d�D]V}|dkr&td�||���z|}t||�}Wq
tk
r^td�||��d�Yq
Xq
||fS)N�.z<locals>z&Can't get local attribute {!r} on {!r}z Can't get attribute {!r} on {!r})�split�AttributeError�format�getattr)�obj�nameZsubpath�parentrrr�
_getattributeBs"���
r�c	Cs�t|dd�}|dk	r|Stj����D]X\}}|dks&|dks&|dkrHq&z t||�d|krf|WSWq&tk
r|Yq&Xq&dS)z$Find the module an object belong to.rN�__main__Z__mp_main__r)r��sys�modules�copy�itemsr�r�)r�r��module_name�modulerrr�whichmoduleOs ��r�cCsh|dkrdS|��d?d}|j|ddd�}|dkrd|dkrd|dd	krd|d
d@dkrd|dd�}|S)
a�Encode a long to a two's complement little-endian binary string.
    Note that 0 is a special case, returning an empty string, to save a
    byte in the LONG1 pickling context.

    >>> encode_long(0)
    b''
    >>> encode_long(255)
    b'\xff\x00'
    >>> encode_long(32767)
    b'\xff\x7f'
    >>> encode_long(-256)
    b'\x00\xff'
    >>> encode_long(-32768)
    b'\x00\x80'
    >>> encode_long(-128)
    b'\x80'
    >>> encode_long(127)
    b'\x7f'
    >>>
    rr����littleT��	byteorderZsignedr������N)�
bit_length�to_bytes)rm�nbytes�resultrrr�encode_longbsr�cCstj|ddd�S)a\Decode a long from a two's complement little-endian binary string.

    >>> decode_long(b'')
    0
    >>> decode_long(b"\xff\x00")
    255
    >>> decode_long(b"\xff\x7f")
    32767
    >>> decode_long(b"\x00\xff")
    -256
    >>> decode_long(b"\x00\x80")
    -32768
    >>> decode_long(b"\x80")
    -128
    >>> decode_long(b"\x7f")
    127
    r�Tr�)�int�
from_bytes)r�rrr�decode_long�sr�c@s�eZdZd;ddd�dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zd<dd�Z	dd�Z
dd�Zd=dd�ZiZ
dd�Zee
ed�<dd�Zee
e<dd�Zee
e<dd�Zee
e<d d!�Zee
e<d"d#�Zee
e<er�d$d%�Zee
e<d&d'�Zee
e<d(d)�Zee
e <d*d+�Z!e!e
e"<d,Z#d-d.�Z$d/d0�Z%e%e
e&<e'dk	�r@e%e
e'<d1d2�Z(d3d4�Z)e)e
e*<d5d6�Z+e+e
e,<d>d7d8�Z-d9d:�Z.e-e
e/<e.e
e<dS)?�_PicklerNT��fix_imports�buffer_callbackcCs�|dkrt}|dkrt}n"d|kr.tks<ntdt��|dk	rT|dkrTtd��||_z|j|_Wntk
r�td��YnXt|j�|_	|j	j|_|j	j
|_i|_t
|�|_|dk|_d|_|o�|dk|_dS)	a!This takes a binary file for writing a pickle data stream.

        The optional *protocol* argument tells the pickler to use the
        given protocol; supported protocols are 0, 1, 2, 3, 4 and 5.
        The default protocol is 4. It was introduced in Python 3.4, and
        is incompatible with previous versions.

        Specifying a negative protocol version selects the highest
        protocol version supported.  The higher the protocol used, the
        more recent the version of Python needed to read the pickle
        produced.

        The *file* argument must have a write() method that accepts a
        single bytes argument. It can thus be a file object opened for
        binary writing, an io.BytesIO instance, or any other custom
        object that meets this interface.

        If *fix_imports* is True and *protocol* is less than 3, pickle
        will try to map the new Python 3 names to the old module names
        used in Python 2, so that the pickle data stream is readable
        with Python 2.

        If *buffer_callback* is None (the default), buffer views are
        serialized into *file* as part of the pickle stream.

        If *buffer_callback* is not None, then it can be called any number
        of times with a buffer view.  If the callback returns a false value
        (such as None), the given buffer is out-of-band; otherwise the
        buffer is serialized in-band, i.e. inside the pickle stream.

        It is an error if *buffer_callback* is not None and *protocol*
        is None or smaller than 5.
        Nrzpickle protocol must be <= %drz#buffer_callback needs protocol >= 5z"file must have a 'write' attributer�r�)�DEFAULT_PROTOCOL�HIGHEST_PROTOCOL�
ValueError�_buffer_callbackr��_file_writer��	TypeErrorro�framerr��_write_large_bytes�memor��proto�bin�fastr�)r#�file�protocolr�r�rrrr$�s*#



z_Pickler.__init__cCs|j��dS)aClears the pickler's "memo".

        The memo is the data structure that remembers which objects the
        pickler has already seen, so that shared or recursive objects
        are pickled by reference and not by value.  This method is
        useful when re-using picklers.
        N)r��clearrtrrr�
clear_memo�sz_Pickler.clear_memocCsrt|d�std|jjf��|jdkr<|�ttd|j��|jdkrP|j�	�|�
|�|�t�|j��dS)z7Write a pickled representation of obj to the open file.r�z2Pickler.__init__() was not called by %s.__init__()��<BrN)
�hasattrr
�	__class__rr�r��PROTOr
r�ru�save�STOPrz�r#r�rrrr�s
�




z
_Pickler.dumpcCs:|jr
dSt|j�}|�|�|��||f|jt|�<dS)zStore an object in the memo.N)r�r~r�r��put�id)r#r��idxrrr�memoize�s

z_Pickler.memoizecCsT|jdkrtS|jr:|dkr*ttd|�Sttd|�Sntt|��d�dSdS)Nr�r��<I�ascii�
)	r��MEMOIZEr��BINPUTr
�LONG_BINPUT�PUT�repr�encode)r#r�rrrr�s
z_Pickler.putcCs@|jr*|dkrttd|�Sttd|�Stt|��d�dS)Nr�r�r�r�r�)r��BINGETr
�LONG_BINGET�GETr�r��r#�irrr�gets
z_Pickler.getc
Cs�|j��|�|�}|dk	r.|r.|�|�dS|j�t|��}|dk	r^|�|�|d��dSt}t	|dd�}|dk	r~||�}|tk�r@t
|�}|j�|�}|dk	r�|||�dSt	|dt��|�}|dk	r�||�}njt
|t
�r�|�|�dSt	|dd�}|dk	�r||j�}n0t	|dd�}|dk	�r.|�}ntd|j|f��t|t��r\|�||�dSt|t��sttd|��t|�}	d|	k�r�d	k�s�ntd
|��|j|d|i�dS)NrZreducer_overrider�
__reduce_ex__�
__reduce__zCan't pickle %r object: %rz%s must return string or tupler��z2Tuple returned by %s must have two to six elementsr�)r�ry�
persistent_id�	save_persr�r�r�r��NotImplementedr��type�dispatchr�
issubclass�save_globalr�r
r�
isinstance�str�tupler~�save_reduce)
r#r��save_persistent_id�pidrm�rv�reduce�tr��lrrrr�sZ









��z
_Pickler.savecCsdSr rr�rrrr�]sz_Pickler.persistent_idcCsb|jr |j|dd�|�t�n>z |�tt|��d�d�Wntk
r\td��YnXdS)NF)r�r�r��2persistent IDs in protocol 0 must be ASCII strings)	r�r�r��	BINPERSID�PERSIDr�r��UnicodeEncodeErrorr
�r#r�rrrr�as �z_Pickler.save_persc
Cs>t|t�std��t|�s"td��|j}|j}	t|dd�}
|jdkr�|
dkr�|\}}}t|d�sntd�	|
���|dk	r�||j
k	r�td	�	|
���|jd
kr�||�||�||�|	t�n,t|j
|f|�|�}||�|d�|	t�n�|jdk�r^|
dk�r^|d
}t|d��std��|dk	�r8||j
k	�r8td��|dd�}||�||�|	t�n||�||�|	t�|dk	�r�t|�|jk�r�|	t|�|jt|�d
��n
|�|�|dk	�r�|�|�|dk	�r�|�|�|dk	�r:|dk�r
||�|	t�n0||�||�||�|	t�|	t�|	t�dS)Nz'args from save_reduce() must be a tuplez(func from save_reduce() must be callabler�r��
__newobj_ex__�__new__z#args[0] from {} args has no __new__z(args[0] from {} args has the wrong classrr�
__newobj__rz+args[0] from __newobj__ args has no __new__z0args[0] from __newobj__ args has the wrong classr�)r�r�r
�callabler�r�r�r�r�r�r��	NEWOBJ_EXrr�REDUCE�NEWOBJr�r��POPr�r��_batch_appends�_batch_setitems�BUILD�TUPLE2)
r#�func�args�stateZ	listitemsZ	dictitemsZstate_setterr�r�r�Z	func_name�cls�kwargsrrrr�msz


��


��

"







z_Pickler.save_reducecCs|�t�dSr )r��NONEr�rrr�	save_none�sz_Pickler.save_nonecCs4|jdkr|�|rtnt�n|�|r*tnt�dS)Nr�)r�r��NEWTRUE�NEWFALSE�TRUE�FALSEr�rrr�	save_bool�s
z_Pickler.save_boolcCs.|jr~|dkrN|dkr.|�ttd|��dS|dkrN|�ttd|��dSd|krbdkr~nn|�ttd|��dS|jd	kr�t|�}t|�}|d
kr�|�t	td|�|�n|�t
td|�|�dSd|kr�dk�rnn|�tt|��
d�d�n|�tt|��
d�d
�dS)Nrr�r���<Hi�i����<ir�r�r�r�sL
)r�r��BININT1r
�BININT2�BININTr�r�r~�LONG1�LONG4�INTr�r��LONG�r#r�Zencodedr�rrr�	save_long�s*
z_Pickler.save_longcCs<|jr|�ttd|��n|�tt|��d�d�dS)N�>dr�r�)r�r��BINFLOATr
�FLOATr�r�r�rrr�
save_floatsz_Pickler.save_floatcCs�|jdkr@|s |jtd|d�n|jtjt|d�df|d�dSt|�}|dkrj|�tt	d|�|�nf|dkr�|jdkr�|�
tt	d	|�|�n<||jj
kr�|�
tt	d
|�|�n|�tt	d
|�|�|�|�dS)Nr�r�r��latin1r�r����rr{r�)r�r��bytes�codecsr�r�r~r��SHORT_BINBYTESr
r��	BINBYTES8r�r|�BINBYTESr��r#r�r�rrr�
save_bytess"
�z_Pickler.save_bytescCs�|jdkr:|s |jtd|d�n|jtt|�f|d�dSt|�}||jjkrf|�tt	d|�|�n|�
tt	d|�|�dS)Nrrr*r{)r�r��	bytearrayr-r~r�r|r��
BYTEARRAY8r
r�r2rrr�save_bytearray)s
z_Pickler.save_bytearrayc	Cs�|jdkrtd��|���t}|js*td��d}|jdk	rFt|�|��}|rp|jr`|�|���q�|�	|���n|�
t�|jr�|�
t�W5QRXdS)Nrz0PickleBuffer can only pickled with protocol >= 5zHPickleBuffer can not be pickled when pointing to a non-contiguous bufferT)
r�r
�raw�
contiguousr��bool�readonlyr3�tobytesr6r��NEXT_BUFFER�READONLY_BUFFER)r#r��mZin_bandrrr�save_picklebuffer8s



z_Pickler.save_picklebuffercCs|jr�|�dd�}t|�}|dkrF|jdkrF|�ttd|�|�nf|dkrp|jdkrp|�ttd|�|�n<||j	j
kr�|�ttd|�|�n|�ttd|�|�nT|�d	d
�}|�dd�}|�d
d�}|�dd�}|�dd�}|�t
|�d�d�|�|�dS)N�utf-8�
surrogatepassr�rr�r,r{r��\z\u005c�z\u0000�
z\u000a�
z\u000d�z\u001a�raw-unicode-escaper�)r�r�r~r�r��SHORT_BINUNICODEr
r��BINUNICODE8r�r|�
BINUNICODE�replace�UNICODEr�r$rrr�save_strRs&�z_Pickler.save_strcCs:|s(|jr|�t�n|�tt�dSt|�}|j}|j}|dkr�|jdkr�|D]}||�qRt	|�|kr�|�
|t	|�d�}|�t||�n|�t|�|�
|�dS|j}|t�|D]}||�q�t	|�|k�r$|�
|t	|�d�}|j�r|t|�n|t|d|�dS|t�|�
|�dS)Nr�r�rr�)r�r��EMPTY_TUPLE�MARK�TUPLEr~r�r�r�r�r�r	�_tuplesize2coder��POP_MARK)r#r�r�r�r�Zelementr�r�rrr�
save_tupleis:


z_Pickler.save_tuplecCs8|jr|�t�n|�tt�|�|�|�|�dSr )r�r��
EMPTY_LISTrO�LISTr�r
r�rrr�	save_list�s

z_Pickler.save_listi�cCs�|j}|j}|js0|D]}||�|t�qdSt|�}tt||j��}t|�}|dkr||t	�|D]}||�qd|t
�n|r�||d�|t�||jkr8dSq8dS�Nr�r)r�r�r��APPEND�iter�listr�
_BATCHSIZEr~rO�APPENDS)r#r�r�r�rm�it�tmpr�rrrr
�s(



z_Pickler._batch_appendscCs<|jr|�t�n|�tt�|�|�|�|���dSr )r�r��
EMPTY_DICTrO�DICTr�rr�r�rrr�	save_dict�s

z_Pickler.save_dictc	Cs�|j}|j}|js<|D] \}}||�||�|t�qdSt|�}tt||j��}t|�}|dkr�|t	�|D]\}}||�||�qp|t
�n(|r�|d\}}||�||�|t�||jkrDdSqDdSrW)r�r�r��SETITEMrYrZrr[r~rO�SETITEMS)	r#r�r�r��k�vr]r^r�rrrr�s0



z_Pickler._batch_setitemscCs�|j}|j}|jdkr0|jtt|�f|d�dS|t�|�|�t|�}tt	||j
��}t|�}|dkr�|t�|D]}||�qv|t
�||j
krJdSqJdS�Nrr*r)r�r�r�r��setrZ�	EMPTY_SETr�rYrr[r~rO�ADDITEMS)r#r�r�r�r]Zbatchr��itemrrr�save_set�s"



z_Pickler.save_setcCs�|j}|j}|jdkr0|jtt|�f|d�dS|t�|D]}||�q<t|�|jkr||t	|�
|jt|�d��dS|t�|�|�dSrf)
r�r�r�r��	frozensetrZrOr�r�rRr��	FROZENSETr�)r#r�r�r�rjrrr�save_frozensets

 z_Pickler.save_frozensetc

CsX|j}|j}|dkr t|dd�}|dkr.|j}t||�}z(t|dd�tj|}t||�\}}Wn.t	t
tfk
r�td|||f�d�YnX||k	r�td|||f��|j
dk�rt�||f�}	|	�r|	dkr�|ttd|	��n0|	d	k�r|ttd
|	��n|ttd|	��dS|�d�d}
||k�r6|
}|j
d
k�r`|�|�|�|�|t�n�||k	�r||�t||
f�n�|j
dk�r�|tt|d�dt|d�d�n�|j�r�tj}tj}||f|k�r�|||f\}}n||k�r�||}z(|tt|d�dt|d�d�Wn,tk
�rHtd|||j
f�d�YnX|�|�dS)Nrr��levelz(Can't pickle %r: it's not found as %s.%sz2Can't pickle %r: it's not the same object as %s.%sr�r�r�rrrr�rr�r@r�r�z?can't pickle global identifier '%s.%s' using pickle protocol %i) r�r�r�rr��
__import__r�r�r��ImportError�KeyErrorr�r
r�rr��EXT1r
�EXT2�EXT4�
rpartitionr��STACK_GLOBALr��GLOBALr-r��_compat_pickleZREVERSE_NAME_MAPPINGZREVERSE_IMPORT_MAPPINGr�r�)
r#r�r�r�r�r�r�Zobj2r��codeZlastnameZr_name_mappingZr_import_mappingrrrr�s�

�����





��
��

���z_Pickler.save_globalcCs`|td�kr|jtd|d�S|tt�kr:|jttf|d�S|td�krV|jtd|d�S|�|�S)Nr r*.).)r�r�r�r�r�rrr�	save_typeasz_Pickler.save_type)N)T)NNNNN)N)0rrrr$r�rr�r�r�r�r�r�r�r�rr�rr9r%r�r)�floatr3r-r6r4�_HAVE_PICKLE_BUFFERr?rrMr�rSr�rVrZr[r
ra�dictr%rrkrgrnrlr�r|rrrrrr��sj�9
	
F�
u1		

B	r�c@s�eZdZddddd�dd�Zdd	�Zd
d�Zdd
�ZiZdd�Zeee	d<dd�Z
e
eed<dd�Zeee
d<dd�Zeeed<dd�Zeeed<dd�Zeeed<dd�Zeeed<dd�Zeeed<dd �Zeeed<d!d"�Zeeed<d#d$�Zeeed<d%d&�Zeeed<d'd(�Z e ee!d<d)d*�Z"e"ee#d<d+d,�Z$e$ee%d<d-d.�Z&e&ee'd<d/d0�Z(d1d2�Z)e)ee*d<d3d4�Z+e+ee,d<d5d6�Z-e-ee.d<d7d8�Z/e/ee0d<d9d:�Z1e1ee2d<d;d<�Z3e3ee4d<d=d>�Z5e5ee6d<d?d@�Z7e7ee8d<dAdB�Z9e9ee:d<dCdD�Z;e;ee<d<dEdF�Z=e=ee>d<dGdH�Z?e?ee@d<dIdJ�ZAeAeeBd<dKdL�ZCeCeeDd<dMdN�ZEeEeeFd<dOdP�ZGeGeeHd<dQdR�ZIeIeeJd<dSdT�ZKeKeeLd<dUdV�ZMeMeeNd<dWdX�ZOeOeePd<dYdZ�ZQeQeeRd<d[d\�ZSeSeeTd<d]d^�ZUeUeeVd<d_d`�ZWeWeeXd<dadb�ZYdcdd�ZZeZee[d<dedf�Z\e\ee]d<dgdh�Z^e^ee_d<didj�Z`e`eead<dkdl�Zbebeecd<dmdn�Zdedeeed<dodp�Zfefeegd<dqdr�Zheheeid<dsdt�Zjejeekd<dudv�Zldwdx�Zmdydz�Zneneeod<d{d|�Zpepeeqd<d}d~�Zrereesd<dd��Zteteeud<d�d��Zveveewd<d�d��Zxexeeyd<d�d��Zzezee{d<d�d��Z|e|ee}d<d�d��Z~e~eed<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<dS)��
_UnpicklerT�ASCII�strictN�r��encoding�errors�bufferscCsH|dk	rt|�nd|_|j|_|j|_i|_||_||_d|_	||_
dS)a�This takes a binary file for reading a pickle data stream.

        The protocol version of the pickle is detected automatically, so
        no proto argument is needed.

        The argument *file* must have two methods, a read() method that
        takes an integer argument, and a readline() method that requires
        no arguments.  Both methods should return bytes.  Thus *file*
        can be a binary file object opened for reading, an io.BytesIO
        object, or any other custom object that meets this interface.

        The file-like object must have two methods, a read() method
        that takes an integer argument, and a readline() method that
        requires no arguments.  Both methods should return bytes.
        Thus file-like object can be a binary file object opened for
        reading, a BytesIO object, or any other custom object that
        meets this interface.

        If *buffers* is not None, it should be an iterable of buffer-enabled
        objects that is consumed each time the pickle stream references
        an out-of-band buffer view.  Such buffers have been given in order
        to the *buffer_callback* of a Pickler object.

        If *buffers* is None (the default), then the buffers are taken
        from the pickle stream, assuming they are serialized there.
        It is an error for *buffers* to be None if the pickle stream
        was produced with a non-None *buffer_callback*.

        Other optional arguments are *fix_imports*, *encoding* and
        *errors*, which are used to control compatibility support for
        pickle stream generated by Python 2.  If *fix_imports* is True,
        pickle will try to map the old Python 2 names to the new names
        used in Python 3.  The *encoding* and *errors* tell pickle how
        to decode 8-bit string instances pickled by Python 2; these
        default to 'ASCII' and 'strict', respectively. *encoding* can be
        'bytes' to read theses 8-bit string instances as bytes objects.
        Nr)rY�_buffersr��_file_readliner��
_file_readr�r�r�r�r�)r#r�r�r�r�r�rrrr$rs'z_Unpickler.__init__c
Cs�t|d�std|jjf��t|j|j�|_|jj|_|jj	|_	|jj
|_
g|_g|_|jj
|_
d|_|j}|j}z&|d�}|s�t�||d|�qtWn,tk
r�}z|jWY�Sd}~XYnXdS)z�Read a pickled object representation from the open file.

        Return the reconstituted object hierarchy specified in the file.
        r�z4Unpickler.__init__() was not called by %s.__init__()rr�N)r�rr�rr�r�r��	_unframerr�r�r��	metastack�stack�appendr�r��EOFErrorrr!)r#r�r��keyZstopinstrrrr�s*
�



z_Unpickler.loadcCs |j}|j��|_|jj|_|Sr )r�r��popr��r#r�rrr�pop_mark�s
z_Unpickler.pop_markcCstd��dS)Nz%unsupported persistent id encountered)rrrrr�persistent_load�sz_Unpickler.persistent_loadcCs:|�d�d}d|kr"tks0ntd|��||_dS)Nr�rzunsupported pickle protocol: %d)r�r�r�r�)r#r�rrr�
load_proto�sz_Unpickler.load_protorcCs8td|�d��\}|tjkr(td|��|j�|�dS)Nr{�zframe size > sys.maxsize: %d)rr�r�r	r�r�r�r�rrrr��s
z_Unpickler.load_framecCsLz|��dd��d�}Wntk
r6td��YnX|�|�|��dS)Nr�r�r�)r��decode�UnicodeDecodeErrorrr�r�rrrr�load_persid�s�
z_Unpickler.load_persidcCs|j��}|�|�|��dSr )r�r�r�r�rrrr�load_binpersid�s
z_Unpickler.load_binpersidcCs|�d�dSr �r�rtrrr�	load_none�sz_Unpickler.load_nonecCs|�d�dS)NFr�rtrrr�
load_false�sz_Unpickler.load_falsecCs|�d�dS)NTr�rtrrr�	load_true�sz_Unpickler.load_truecCsL|��}|tdd�krd}n |tdd�kr4d}n
t|d�}|�|�dS)Nr�FTr)r�rrr�r�)r#r��valrrr�load_int�s
z_Unpickler.load_intcCs|�td|�d��d�dS)Nrrr�r�rr�rtrrr�load_binint�sz_Unpickler.load_binintcCs|�|�d�d�dSrW)r�r�rtrrr�load_binint1sz_Unpickler.load_binint1cCs|�td|�d��d�dS)Nrr�rr�rtrrr�load_binint2sz_Unpickler.load_binint2cCs@|��dd�}|r,|ddkr,|dd�}|�t|d��dS)Nr��Lr)r�r�r�)r#r�rrr�	load_longsz_Unpickler.load_longcCs*|�d�d}|�|�}|�t|��dSrW)r�r�r�r�rrr�
load_long1s
z_Unpickler.load_long1cCs>td|�d��\}|dkr"td��|�|�}|�t|��dS)Nrrrz#LONG pickle has negative byte count)rr�rr�r�r�rrr�
load_long4s

z_Unpickler.load_long4cCs|�t|��dd���dS�Nr�)r�r}r�rtrrr�
load_float!sz_Unpickler.load_floatcCs|�td|�d��d�dS)Nr&r�rr�rtrrr�
load_binfloat%sz_Unpickler.load_binfloatcCs"|jdkr|S|�|j|j�SdS)Nr-)r�r�r�r"rrr�_decode_string)s
z_Unpickler._decode_stringcCsl|��dd�}t|�dkrF|d|dkrF|ddkrF|dd�}ntd��|�|�t�|�d��dS)Nr�r�rs"'r�z)the STRING opcode argument must be quoted)r�r~rr�r�r.�
escape_decoder�rrr�load_string2s
(z_Unpickler.load_stringcCs@td|�d��\}|dkr"td��|�|�}|�|�|��dS)Nrrrz(BINSTRING pickle has negative byte count)rr�rr�r��r#r~r�rrr�load_binstring<s

z_Unpickler.load_binstringcCs:td|�d��\}|tkr&tdt��|�|�|��dS)Nr�rz2BINBYTES exceeds system's maximum size of %d bytes�rr�r	rr��r#r~rrr�
load_binbytesEs�z_Unpickler.load_binbytescCs |�t|��dd�d��dS)Nr�rG)r�r�r�rtrrr�load_unicodeMsz_Unpickler.load_unicodecCsBtd|�d��\}|tkr&tdt��|�t|�|�dd��dS)Nr�rz4BINUNICODE exceeds system's maximum size of %d bytesr@rA�rr�r	rr�r�r�rrr�load_binunicodeQs�z_Unpickler.load_binunicodecCsBtd|�d��\}|tkr&tdt��|�t|�|�dd��dS)Nr{r�z5BINUNICODE8 exceeds system's maximum size of %d bytesr@rAr�r�rrr�load_binunicode8Ys�z_Unpickler.load_binunicode8cCs:td|�d��\}|tkr&tdt��|�|�|��dS)Nr{r�z3BINBYTES8 exceeds system's maximum size of %d bytesr�r�rrr�load_binbytes8as�z_Unpickler.load_binbytes8cCsFtd|�d��\}|tkr&tdt��t|�}|�|�|�|�dS)Nr{r�z4BYTEARRAY8 exceeds system's maximum size of %d bytes)rr�r	rr4r�r�)r#r~�brrr�load_bytearray8is�
z_Unpickler.load_bytearray8cCsL|jdkrtd��zt|j�}Wntk
r<td��YnX|�|�dS)NzLpickle stream refers to out-of-band data but no *buffers* argument was givenznot enough out-of-band buffers)r�r�next�
StopIterationr�)r#r�rrr�load_next_bufferss
z_Unpickler.load_next_bufferc	Cs6|jd}t|��}|js(|��|jd<W5QRXdSr�)r��
memoryviewr:�
toreadonly)r#r�r>rrr�load_readonly_buffer~s

z_Unpickler.load_readonly_buffercCs,|�d�d}|�|�}|�|�|��dSrW)r�r�r�r�rrr�load_short_binstring�s
z_Unpickler.load_short_binstringcCs"|�d�d}|�|�|��dSrW)r�r�r�rrr�load_short_binbytes�sz_Unpickler.load_short_binbytescCs*|�d�d}|�t|�|�dd��dS)Nr�rr@rA)r�r�r�r�rrr�load_short_binunicode�sz _Unpickler.load_short_binunicodecCs|��}|�t|��dSr )r�r�r�r�rrr�
load_tuple�sz_Unpickler.load_tuplecCs|�d�dS)Nrr�rtrrr�load_empty_tuple�sz_Unpickler.load_empty_tuplecCs|jdf|jd<dSr��r�rtrrr�load_tuple1�sz_Unpickler.load_tuple1cCs$|jd|jdfg|jdd�<dS)Nr�r�r�rtrrr�load_tuple2�sz_Unpickler.load_tuple2cCs,|jd|jd|jdfg|jdd�<dS)N���r�r�r�rtrrr�load_tuple3�sz_Unpickler.load_tuple3cCs|�g�dSr r�rtrrr�load_empty_list�sz_Unpickler.load_empty_listcCs|�i�dSr r�rtrrr�load_empty_dictionary�sz _Unpickler.load_empty_dictionarycCs|�t��dSr )r�rgrtrrr�load_empty_set�sz_Unpickler.load_empty_setcCs|��}|�t|��dSr )r�r�rlr�rrr�load_frozenset�sz_Unpickler.load_frozensetcCs|��}|�|�dSr )r�r�r�rrr�	load_list�sz_Unpickler.load_listcs4|����fdd�tdt��d�D�}|�|�dS)Ncsi|]}�|�|d�qS)r�r)rlr��r�rr�
<dictcomp>�s�z(_Unpickler.load_dict.<locals>.<dictcomp>rr�)r��ranger~r�)r#�drr�r�	load_dict�s

�z_Unpickler.load_dictc
Cs�|st|t�rt|d�rjz||�}Wqttk
rf}z$td|jt|�ft��d��W5d}~XYqtXn
|�|�}|�	|�dS)NZ__getinitargs__zin constructor for %s: %sr�)
r�r�r�r�rr�r��exc_inforr�)r#�klassrr!�errrrr�_instantiate�s��
�
z_Unpickler._instantiatecCsL|��dd��d�}|��dd��d�}|�||�}|�||���dS)Nr�r�)r�r��
find_classr�r��r#r�r�r�rrr�	load_inst�sz_Unpickler.load_instcCs"|��}|�d�}|�||�dS�Nr)r�r�r�)r#rrrrr�load_obj�s
z_Unpickler.load_objcCs2|j��}|j��}|j|f|��}|�|�dSr �r�r�rr�)r#rrr�rrr�load_newobj�s

z_Unpickler.load_newobjcCs>|j��}|j��}|j��}|j|f|�|�}|�|�dSr r�)r#rrrr�rrr�load_newobj_ex�s



z_Unpickler.load_newobj_excCsF|��dd��d�}|��dd��d�}|�||�}|�|�dS)Nr�r@)r�r�r�r�r�rrr�load_global�sz_Unpickler.load_globalcCsJ|j��}|j��}t|�tk	s,t|�tk	r4td��|�|�||��dS)NzSTACK_GLOBAL requires str)r�r�r�r�rr�r�)r#r�r�rrr�load_stack_global�s


z_Unpickler.load_stack_globalcCs|�d�d}|�|�dSrW)r��
get_extension�r#r{rrr�	load_ext1sz_Unpickler.load_ext1cCs td|�d��\}|�|�dS)Nrr��rr�r�r�rrr�	load_ext2	sz_Unpickler.load_ext2cCs td|�d��\}|�|�dS)Nrrr�r�rrr�	load_ext4sz_Unpickler.load_ext4cCspg}t�||�}||k	r&|�|�dSt�|�}|sP|dkrDtd��td|��|j|�}|t|<|�|�dS)NrzEXT specifies code <= 0zunregistered extension code %d)rr�r�rrr�r�)r#r{Znilr�r�rrrr�s


z_Unpickler.get_extensioncCs�t�d||�|jdkrT|jrT||ftjkr@tj||f\}}n|tjkrTtj|}t|dd�|jdkr~ttj	||�dSt
tj	||�SdS)Nzpickle.find_classr�rror)r��auditr�r�rzZNAME_MAPPINGZIMPORT_MAPPINGrqr�r�r�)r#r�r�rrrr�#s


z_Unpickler.find_classcCs&|j}|��}|d}||�|d<dSr��r�r�)r#r�rrrrr�load_reduce1sz_Unpickler.load_reducecCs|jr|jd=n|��dSr�)r�r�rtrrr�load_pop8s
z_Unpickler.load_popcCs|��dSr )r�rtrrr�
load_pop_mark?sz_Unpickler.load_pop_markcCs|�|jd�dSr�)r�r�rtrrr�load_dupCsz_Unpickler.load_dupcCs(t|��dd��}|�|j|�dSr�)r�r�r�r�r�rrr�load_getGsz_Unpickler.load_getcCs"|�d�d}|�|j|�dSrW)r�r�r�r�rrr�load_bingetLsz_Unpickler.load_bingetcCs&td|�d��\}|�|j|�dS)Nr�r)rr�r�r�r�rrr�load_long_bingetQsz_Unpickler.load_long_bingetcCs8t|��dd��}|dkr$td��|jd|j|<dS)Nr�rznegative PUT argument)r�r�r�r�r�r�rrr�load_putVsz_Unpickler.load_putcCs2|�d�d}|dkrtd��|jd|j|<dS)Nr�rznegative BINPUT argumentr�)r�r�r�r�r�rrr�load_binput]sz_Unpickler.load_binputcCs6td|�d��\}|tkr"td��|jd|j|<dS)Nr�rznegative LONG_BINPUT argumentr�)rr�r	r�r�r�r�rrr�load_long_binputdsz_Unpickler.load_long_binputcCs|j}|jd|t|�<dSr�)r�r�r~)r#r�rrr�load_memoizeksz_Unpickler.load_memoizecCs$|j}|��}|d}|�|�dSr�)r�r�r�)r#r�r!rZrrr�load_appendpsz_Unpickler.load_appendcCsZ|��}|jd}z
|j}Wntk
r0YnX||�dS|j}|D]}||�qHdSr�)r�r��extendr�r�)r#r�Zlist_objr�r�rjrrr�load_appendsws

z_Unpickler.load_appendscCs*|j}|��}|��}|d}|||<dSr�r�)r#r�r!r�rrrr�load_setitem�s
z_Unpickler.load_setitemcCs@|��}|jd}tdt|�d�D]}||d|||<q"dS)Nr�rr�r�)r�r�r�r~)r#r�rr�rrr�
load_setitems�s
z_Unpickler.load_setitemscCsD|��}|jd}t|t�r(|�|�n|j}|D]}||�q2dSr�)r�r�r�rg�update�add)r#r�Zset_objr�rjrrr�
load_additems�s

z_Unpickler.load_additemsc
Cs�|j}|��}|d}t|dd�}|dk	r6||�dSd}t|t�rXt|�dkrX|\}}|r�|j}tj}|�	�D]*\}}	t
|�tkr�|	|||�<qp|	||<qp|r�|�	�D]\}}	t|||	�q�dS)Nr��__setstate__r�)
r�r�r�r�r�r~�__dict__r��internr�r�r��setattr)
r#r�r�inst�setstateZ	slotstateZ	inst_dictr�rdrerrr�
load_build�s(
z_Unpickler.load_buildcCs"|j�|j�g|_|jj|_dSr )r�r�r�rtrrr�	load_mark�sz_Unpickler.load_markcCs|j��}t|��dSr )r�r�rr"rrr�	load_stop�s
z_Unpickler.load_stop)�rrrr$rr�r�r�r�r�r�r�r�r�r�r�r�rr�rr�rr�r"r�rr�rr�rr�r#r�r r�r!r�r(r�r'r�r��STRINGr��	BINSTRINGr�r1r�rLr�rJr�rIr�r0r�r5r�r<r�r=r��SHORT_BINSTRINGr�r/r�rHr�rPr�rNr��TUPLE1r�r
r��TUPLE3r�rTr�r_r�rhr�rmr�rUr�r`r�r��INSTr��OBJr�rr�rr�ryr�rxr�rtr�rur�rvr�r�r�rr�r	r�rRr��DUPr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rXr�r\r�rbr�rcr�rirrrrOrr�rrrrr�ps*�0				r�r�cCst||||d��|�dS�Nr�)r�r)r�r�r�r�r�rrr�_dump�s
��rcCs*t��}t||||d��|�|��}|Sr)rrrsr�r�getvalue)r�r�r�r�r��resrrr�_dumps�s��rr�r�r�cCst|||||d���S)N�r�r�r�r�)r�r)r�r�r�r�r�rrr�_load�s�rcCs2t|t�rtd��t�|�}t|||||d���S)Nz%Can't load pickle from unicode stringr)r�r�r�rrrsr�r)�sr�r�r�r�r�rrr�_loads�s

�r)	rr
rrrrrrrcCsddl}|��Sr�)�doctestZtestmod)rrrr�_test�srr�z$display contents of the pickle files)Zdescription�pickle_file�br�*zthe pickle file)r��nargs�helpz-tz--test�
store_truezrun self-test suite)�actionrz-vz)run verbosely; only affects self-test run)N)N)�r�typesr�copyregrrrr�	itertoolsr�	functoolsrr�r	Zstructr
rrjrrr.rz�__all__�_picklerr�r~rrr-r4Zbytes_typesZformat_versionZcompatible_formatsr�r��	Exceptionrr
rrZorg.python.corer%rOr�r	rRr
r(r"rrr#rrr�r�rrrrrLrJrXrryr`r_r\r�r�rr�rUrTrr�r�r�rbrPrNrcr'rrr�rrtrurvr	r
r
rrr r!rQr1r/rHrIr0rhrirmrrxr�r�r5r<r=r��dirror�r�r�r�r�r�r�rrrrrrrrrrrr�argparse�ArgumentParser�parser�add_argumentZFileType�
parse_argsrZtestrZ
print_helpZpprintr�r�rrrr�<module>sh�

�

?;
^]��	0

����

__pycache__/ssl.cpython-38.opt-1.pyc000064400000127066151153537600013166 0ustar00U

e5dH��
@s�dZddlZddlZddlmZddlmZmZ	m
ZddlZddlm
Z
mZmZddlmZmZmZddlmZmZmZmZmZmZmZddlmZmZdd	lmZmZm Z m!Z!zdd
lm"Z"Wne#k
r�YnXddlm$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-ddlm.Z.m/Z/e	j0d
e1dd�ed�ej0de1dd�ed�e	j0de1dd�ed�e	j0de1dd�ed�ej0de1dd�ed�e	j0de1dd�ed�e2j3Z4e2_4dd�e2j5�6�D�Z7e8e2dd�Z9Gdd�de	�Z:Gd d!�d!e	�Z;Gd"d#�d#e	�Z<Gd$d%�d%e	�Z=ej>d&k�r"dd'lm?Z?m@Z@dd(lAmAZAmBZBmCZCmDZDdd)lAmEZEmFZFddlAZGddlHZHddlIZIddlJZJeKZLd*gZMeNed+�ZOe.ZPeZQd,d-�ZRd.d/�ZSd0d1�ZTd2d3�ZUed4d5�ZVd6d7�ZWGd8d9�d9ed9d:��ZXGd;d<�d<eXe�ZYGd=d>�d>e�ZZeYj[fdddd?�d@dA�Z\e3fe]dBeYj[ddddddC�dDdE�Z^e\Z_e^Z`GdFdG�dG�ZadHdI�ZbGdJdK�dKeA�ZceceZ_deaeZ_edddBe]e3ddLdLdf	dMdN�ZfdOdP�ZgdQZhdRZidSdT�ZjdUdV�Zke3dfdWdX�ZldYdZ�ZmdS)[a�
This module provides some more Pythonic support for SSL.

Object types:

  SSLSocket -- subtype of socket.socket which does SSL over the socket

Exceptions:

  SSLError -- exception raised for I/O errors

Functions:

  cert_time_to_seconds -- convert time string used for certificate
                          notBefore and notAfter functions to integer
                          seconds past the Epoch (the time values
                          returned from time.time())

  fetch_server_certificate (HOST, PORT) -- fetch the certificate provided
                          by the server running on HOST at port PORT.  No
                          validation of the certificate is performed.

Integer constants:

SSL_ERROR_ZERO_RETURN
SSL_ERROR_WANT_READ
SSL_ERROR_WANT_WRITE
SSL_ERROR_WANT_X509_LOOKUP
SSL_ERROR_SYSCALL
SSL_ERROR_SSL
SSL_ERROR_WANT_CONNECT

SSL_ERROR_EOF
SSL_ERROR_INVALID_ERROR_CODE

The following group define certificate requirements that one side is
allowing/requiring from the other side:

CERT_NONE - no certificates from the other side are required (or will
            be looked at if provided)
CERT_OPTIONAL - certificates are not required, but if provided will be
                validated, and if validation fails, the connection will
                also fail
CERT_REQUIRED - certificates are required, and will be validated, and
                if validation fails, the connection will also fail

The following constants identify various SSL protocol variants:

PROTOCOL_SSLv2
PROTOCOL_SSLv3
PROTOCOL_SSLv23
PROTOCOL_TLS
PROTOCOL_TLS_CLIENT
PROTOCOL_TLS_SERVER
PROTOCOL_TLSv1
PROTOCOL_TLSv1_1
PROTOCOL_TLSv1_2

The following constants identify various SSL alert message descriptions as per
http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-6

ALERT_DESCRIPTION_CLOSE_NOTIFY
ALERT_DESCRIPTION_UNEXPECTED_MESSAGE
ALERT_DESCRIPTION_BAD_RECORD_MAC
ALERT_DESCRIPTION_RECORD_OVERFLOW
ALERT_DESCRIPTION_DECOMPRESSION_FAILURE
ALERT_DESCRIPTION_HANDSHAKE_FAILURE
ALERT_DESCRIPTION_BAD_CERTIFICATE
ALERT_DESCRIPTION_UNSUPPORTED_CERTIFICATE
ALERT_DESCRIPTION_CERTIFICATE_REVOKED
ALERT_DESCRIPTION_CERTIFICATE_EXPIRED
ALERT_DESCRIPTION_CERTIFICATE_UNKNOWN
ALERT_DESCRIPTION_ILLEGAL_PARAMETER
ALERT_DESCRIPTION_UNKNOWN_CA
ALERT_DESCRIPTION_ACCESS_DENIED
ALERT_DESCRIPTION_DECODE_ERROR
ALERT_DESCRIPTION_DECRYPT_ERROR
ALERT_DESCRIPTION_PROTOCOL_VERSION
ALERT_DESCRIPTION_INSUFFICIENT_SECURITY
ALERT_DESCRIPTION_INTERNAL_ERROR
ALERT_DESCRIPTION_USER_CANCELLED
ALERT_DESCRIPTION_NO_RENEGOTIATION
ALERT_DESCRIPTION_UNSUPPORTED_EXTENSION
ALERT_DESCRIPTION_CERTIFICATE_UNOBTAINABLE
ALERT_DESCRIPTION_UNRECOGNIZED_NAME
ALERT_DESCRIPTION_BAD_CERTIFICATE_STATUS_RESPONSE
ALERT_DESCRIPTION_BAD_CERTIFICATE_HASH_VALUE
ALERT_DESCRIPTION_UNKNOWN_PSK_IDENTITY
�N)�
namedtuple)�Enum�IntEnum�IntFlag)�OPENSSL_VERSION_NUMBER�OPENSSL_VERSION_INFO�OPENSSL_VERSION)�_SSLContext�	MemoryBIO�
SSLSession)�SSLError�SSLZeroReturnError�SSLWantReadError�SSLWantWriteError�SSLSyscallError�SSLEOFError�SSLCertVerificationError)�txt2obj�nid2obj)�RAND_status�RAND_add�
RAND_bytes�RAND_pseudo_bytes)�RAND_egd)
�HAS_SNI�HAS_ECDH�HAS_NPN�HAS_ALPN�	HAS_SSLv2�	HAS_SSLv3�	HAS_TLSv1�HAS_TLSv1_1�HAS_TLSv1_2�HAS_TLSv1_3)�_DEFAULT_CIPHERS�_OPENSSL_API_VERSION�
_SSLMethodcCs|�d�o|dkS)NZ	PROTOCOL_�PROTOCOL_SSLv23��
startswith��name�r,�/usr/lib64/python3.8/ssl.py�<lambda>|�r.)�source�OptionscCs
|�d�S)NZOP_r(r*r,r,r-r.�r/ZAlertDescriptioncCs
|�d�S)NZALERT_DESCRIPTION_r(r*r,r,r-r.�r/ZSSLErrorNumbercCs
|�d�S)NZ
SSL_ERROR_r(r*r,r,r-r.�r/�VerifyFlagscCs
|�d�S)NZVERIFY_r(r*r,r,r-r.�r/�
VerifyModecCs
|�d�S)NZCERT_r(r*r,r,r-r.�r/cCsi|]\}}||�qSr,r,)�.0r+�valuer,r,r-�
<dictcomp>�sr6ZPROTOCOL_SSLv2c@s6eZdZejZejZejZ	ej
ZejZ
ejZejZdS)�
TLSVersionN)�__name__�
__module__�__qualname__�_sslZPROTO_MINIMUM_SUPPORTEDZMINIMUM_SUPPORTEDZPROTO_SSLv3�SSLv3ZPROTO_TLSv1ZTLSv1Z
PROTO_TLSv1_1ZTLSv1_1Z
PROTO_TLSv1_2ZTLSv1_2Z
PROTO_TLSv1_3ZTLSv1_3ZPROTO_MAXIMUM_SUPPORTEDZMAXIMUM_SUPPORTEDr,r,r,r-r7�sr7c@s(eZdZdZdZdZdZdZdZdZ	dS)	�_TLSContentTypez@Content types (record layer)

    See RFC 8446, section B.1
    ������N)
r8r9r:�__doc__�CHANGE_CIPHER_SPEC�ALERTZ	HANDSHAKEZAPPLICATION_DATA�HEADERZINNER_CONTENT_TYPEr,r,r,r-r=�sr=c@s�eZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#d"Z$d#Z%d$S)%�
_TLSAlertTypezQAlert types for TLSContentType.ALERT messages

    See RFC 8466, section B.2
    r�
r>r?r@��(�)�*�+�,�-�.�/�0�1�2�3�<�F�G�P�V�Z�d�m�n�o�p�q�r�s�t�xN)&r8r9r:rDZCLOSE_NOTIFYZUNEXPECTED_MESSAGEZBAD_RECORD_MACZDECRYPTION_FAILEDZRECORD_OVERFLOWZDECOMPRESSION_FAILUREZHANDSHAKE_FAILUREZNO_CERTIFICATEZBAD_CERTIFICATEZUNSUPPORTED_CERTIFICATEZCERTIFICATE_REVOKEDZCERTIFICATE_EXPIREDZCERTIFICATE_UNKNOWNZILLEGAL_PARAMETERZ
UNKNOWN_CAZ
ACCESS_DENIEDZDECODE_ERRORZ
DECRYPT_ERRORZEXPORT_RESTRICTIONZPROTOCOL_VERSIONZINSUFFICIENT_SECURITYZINTERNAL_ERRORZINAPPROPRIATE_FALLBACKZ
USER_CANCELEDZNO_RENEGOTIATIONZMISSING_EXTENSIONZUNSUPPORTED_EXTENSIONZCERTIFICATE_UNOBTAINABLEZUNRECOGNIZED_NAMEZBAD_CERTIFICATE_STATUS_RESPONSEZBAD_CERTIFICATE_HASH_VALUEZUNKNOWN_PSK_IDENTITYZCERTIFICATE_REQUIREDZNO_APPLICATION_PROTOCOLr,r,r,r-rH�sFrHc@sheZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZdZdZdZdS)�_TLSMessageTypezFMessage types (handshake protocol)

    See RFC 8446, section B.3
    r����������
���r>r?r@rA��C�rCN)r8r9r:rDZ
HELLO_REQUESTZCLIENT_HELLOZSERVER_HELLOZHELLO_VERIFY_REQUESTZNEWSESSION_TICKETZEND_OF_EARLY_DATAZHELLO_RETRY_REQUESTZENCRYPTED_EXTENSIONSZCERTIFICATEZSERVER_KEY_EXCHANGEZCERTIFICATE_REQUESTZSERVER_DONEZCERTIFICATE_VERIFYZCLIENT_KEY_EXCHANGEZFINISHEDZCERTIFICATE_URLZCERTIFICATE_STATUSZSUPPLEMENTAL_DATAZ
KEY_UPDATEZ
NEXT_PROTOZMESSAGE_HASHrEr,r,r,r-rg�s.rg�win32)�enum_certificates�	enum_crls)�socket�AF_INET�SOCK_STREAM�create_connection)�
SOL_SOCKET�SO_TYPE�
tls-unique�HOSTFLAG_NEVER_CHECK_SUBJECTcCs�|sdS|�d�}|s&|��|��kS|dkr<td�|���|�d�\}}}d|krbtd�|���|sttd�|���|dkr�td�|���|�d�\}}}|r�|s�dS|��|��kS)	a�Matching according to RFC 6125, section 6.4.3

    - Hostnames are compared lower case.
    - For IDNA, both dn and hostname must be encoded as IDN A-label (ACE).
    - Partial wildcards like 'www*.example.org', multiple wildcards, sole
      wildcard or wildcards in labels other then the left-most label are not
      supported and a CertificateError is raised.
    - A wildcard must match at least one character.
    F�*rhz1too many wildcards in certificate DNS name: {!r}.�.z9wildcard can only be present in the leftmost label: {!r}.z>sole wildcard without additional labels are not support: {!r}.z<partial wildcards in leftmost label are not supported: {!r}.)�count�lower�CertificateError�format�	partition)Zdn�hostnameZ	wildcardsZdn_leftmost�sepZdn_remainderZhostname_leftmostZhostname_remainderr,r,r-�_dnsname_matchs@

�������r�cCs�zt�|�}Wntk
r"Yn"Xt�|�|kr6|Std�|���zt�tj|�WStk
rvtd�|���Yntk
r�YnXtd�|���dS)z�Try to convert an IP address to packed binary form

    Supports IPv4 addresses on all platforms and IPv6 on platforms with IPv6
    support.
    z'{!r} is not a quad-dotted IPv4 address.z+{!r} is neither an IPv4 nor an IP6 address.z{!r} is not an IPv4 address.N)	�_socketZ	inet_aton�OSErrorZ	inet_ntoa�
ValueErrorr�Z	inet_ptonZAF_INET6�AttributeError)Zipname�addrr,r,r-�_inet_patonDs$��
r�cCst|���}||kS)z�Exact matching of IP addresses.

    RFC 6125 explicitly doesn't define an algorithm for this
    (section 1.7.2 - "Out of Scope").
    )r��rstrip)Zcert_ipaddress�host_ipZipr,r,r-�_ipaddress_matchgsr�cCsJ|std��zt|�}Wntk
r0d}YnXg}|�dd�}|D]^\}}|dkrz|dkrnt||�rndS|�|�qF|dkrF|dk	r�t||�r�dS|�|�qF|s�|�dd�D]6}|D],\}}|dkr�t||�r�dS|�|�q�q�t|�d	k�rtd
|d�t	t
|��f��n,t|�d	k�r>td||d
f��ntd��dS)a�Verify that *cert* (in decoded format as returned by
    SSLSocket.getpeercert()) matches the *hostname*.  RFC 2818 and RFC 6125
    rules are followed.

    The function matches IP addresses rather than dNSNames if hostname is a
    valid ipaddress string. IPv4 addresses are supported on all platforms.
    IPv6 addresses are supported on platforms with IPv6 support (AF_INET6
    and inet_pton).

    CertificateError is raised on failure. On success, the function
    returns nothing.
    ztempty or no certificate, match_hostname needs a SSL socket or SSL context with either CERT_OPTIONAL or CERT_REQUIREDNZsubjectAltNamer,ZDNSz
IP AddressZsubjectZ
commonNamerhz&hostname %r doesn't match either of %sz, zhostname %r doesn't match %rrz=no appropriate commonName or subjectAltName fields were found)r�r��getr��appendr��lenr��join�map�repr)�certr�r�ZdnsnamesZsan�keyr5�subr,r,r-�match_hostnamessB


�
�r��DefaultVerifyPathszQcafile capath openssl_cafile_env openssl_cafile openssl_capath_env openssl_capathcCsdt��}tj�|d|d�}tj�|d|d�}ttj�|�rF|ndtj�|�rX|ndf|��S)z/Return paths to default cafile and capath.
    rrhrirjN)	r;�get_default_verify_paths�os�environr�r��path�isfile�isdir)�parts�cafile�capathr,r,r-r��s��r�csDeZdZdZdZ�fdd�Ze�fdd��Ze�fdd��Z�Z	S)	�_ASN1Objectz#ASN.1 object identifier lookup
    r,cst�j|ft|dd���S)NFr*��super�__new__�_txt2obj)�cls�oid��	__class__r,r-r��sz_ASN1Object.__new__cst�j|ft|���S)z3Create _ASN1Object from OpenSSL numeric ID
        )r�r��_nid2obj)r�Znidr�r,r-�fromnid�sz_ASN1Object.fromnidcst�j|ft|dd���S)z=Create _ASN1Object from short name, long name or OID
        Tr*r�)r�r+r�r,r-�fromname�sz_ASN1Object.fromname)
r8r9r:rD�	__slots__r��classmethodr�r��
__classcell__r,r,r�r-r��sr�znid shortname longname oidc@seZdZdZdZdZdS)�PurposezDSSLContext purpose flags with X509v3 Extended Key Usage objects
    z1.3.6.1.5.5.7.3.1z1.3.6.1.5.5.7.3.2N)r8r9r:rD�SERVER_AUTHZCLIENT_AUTHr,r,r,r-r��sr�cs�eZdZdZdZdZdZefdd�Zdd�Z	d2d
d�Z
d3dd
�Zdd�Zdd�Z
dd�Zdd�Zejfdd�Zeed�r�e�fdd��Zej�fdd��Ze�fdd��Zej�fdd��Ze�fdd ��Zej�fd!d ��Zeed"��red#d$��Zejd%d$��Zned&d$��Ze�fd'd(��Zej�fd)d(��Ze�fd*d+��Ze�fd,d-��Zej�fd.d-��Ze�fd/d0��Zej�fd1d0��Z�Z S)4�
SSLContextz|An SSLContext holds various SSL-related configuration options and
    data, such as certificates and possibly a private key.)ZCAZROOTNcOst�||�}|S�N)r	r�)r��protocol�args�kwargs�selfr,r,r-r��szSSLContext.__new__cCs4|dkrdSt|t�r&|�d��d�S|�d�SdS)NZidna�ascii)�
isinstance�str�encode�decode)r�r�r,r,r-�_encode_hostname�s

zSSLContext._encode_hostnameFTc	Cs|jj|||||||d�S)N)�sock�server_side�do_handshake_on_connect�suppress_ragged_eofs�server_hostname�context�session)�sslsocket_class�_create)r�r�r�r�r�r�r�r,r,r-�wrap_socket�s�zSSLContext.wrap_socketcCs|jj||||�|�||d�S)N)r�r�r�r�)�sslobject_classr�r�)r��incoming�outgoingr�r�r�r,r,r-�wrap_bio�s�zSSLContext.wrap_biocCs`t�}|D]F}t|d�}t|�dks0t|�dkr8td��|�t|��|�|�q
|�|�dS)Nr�r�z(NPN protocols must be 1 to 255 in length)�	bytearray�bytesr�rr��extendZ_set_npn_protocols)r�Z
npn_protocols�protosr��br,r,r-�set_npn_protocolss
zSSLContext.set_npn_protocolscs8�dkrd�_n$t��s td����fdd�}|�_dS)Nznot a callable objectcs��|�}�|||�Sr�)r�)�sslobjZ
servernameZsslctx�r��server_name_callbackr,r-�shim_cbs
z3SSLContext.set_servername_callback.<locals>.shim_cb)Zsni_callback�callable�	TypeError)r�r�r�r,r�r-�set_servername_callbacksz"SSLContext.set_servername_callbackcCs`t�}|D]F}t|d�}t|�dks0t|�dkr8td��|�t|��|�|�q
|�|�dS)Nr�rr�z)ALPN protocols must be 1 to 255 in length)r�r�r�rr�r�Z_set_alpn_protocols)r�Zalpn_protocolsr�r�r�r,r,r-�set_alpn_protocols s
zSSLContext.set_alpn_protocolscCsvt�}z<t|�D].\}}}|dkr|dks4|j|kr|�|�qWntk
r`t�d�YnX|rr|j|d�|S)NZx509_asnTz-unable to enumerate Windows certificate store)�cadata)r�ryr�r��PermissionError�warnings�warn�load_verify_locations)r��	storename�purposeZcertsr��encodingZtrustr,r,r-�_load_windows_store_certs+sz$SSLContext._load_windows_store_certscCs@t|t�st|��tjdkr4|jD]}|�||�q"|��dS)Nrx)r�r�r��sys�platform�_windows_cert_storesr�Zset_default_verify_paths)r�r�r�r,r,r-�load_default_certs9s


zSSLContext.load_default_certs�minimum_versioncstt�j�Sr�)r7r�r��r�r�r,r-r�BszSSLContext.minimum_versioncs4|tjkr|jtjM_ttt�j�||�dSr�)	r7r<�optionsr1ZOP_NO_SSLv3r�r�r��__set__�r�r5r�r,r-r�Fs
cstt�j�Sr�)r7r��maximum_versionr�r�r,r-r�LszSSLContext.maximum_versioncsttt�j�||�dSr�)r�r�r�r�r�r�r,r-r�Pscstt�j�Sr�)r1r�r�r�r�r,r-r�TszSSLContext.optionscsttt�j�||�dSr�)r�r�r�r�r�r�r,r-r�Xsr�cCs|jtj@}|tjkSr��Z_host_flagsr;r�)r�Zncsr,r,r-�hostname_checks_common_name]sz&SSLContext.hostname_checks_common_namecCs,|r|jtjM_n|jtjO_dSr�r�r�r,r,r-r�bscCsdS)NTr,r�r,r,r-r�iscst�j}|dk	r|jSdSdS)a9TLS message callback

        The message callback provides a debugging hook to analyze TLS
        connections. The callback is called for any TLS protocol message
        (header, handshake, alert, and more), but not for application data.
        Due to technical  limitations, the callback can't be used to filter
        traffic or to abort a connection. Any exception raised in the
        callback is delayed until the handshake, read, or write operation
        has been performed.

        def msg_cb(conn, direction, version, content_type, msg_type, data):
            pass

        conn
            :class:`SSLSocket` or :class:`SSLObject` instance
        direction
            ``read`` or ``write``
        version
            :class:`TLSVersion` enum member or int for unknown version. For a
            frame header, it's the header version.
        content_type
            :class:`_TLSContentType` enum member or int for unsupported
            content type.
        msg_type
            Either a :class:`_TLSContentType` enum number for a header
            message, a :class:`_TLSAlertType` enum member for an alert
            message, a :class:`_TLSMessageType` enum member for other
            messages, or int for unsupported message types.
        data
            Raw, decrypted message content as bytes
        N)r��
_msg_callback�
user_function)r��innerr�r,r-r�ms!zSSLContext._msg_callbackcsb�dkr ttt�j�|d�dSt�d�s8t��d����fdd�}�|_ttt�j�||�dS)N�__call__z is not callable.cs�zt|�}Wntk
r YnXzt|�}Wntk
rBYnX|tjkrTt}n|tjkrdt}nt}z||�}Wntk
r�YnX�||||||�Sr�)r7r�r=rGrFrHrg)Zconn�	direction�versionZcontent_typeZmsg_type�dataZmsg_enum��callbackr,r-r��s,

�z'SSLContext._msg_callback.<locals>.inner)r�r�r�r��hasattrr�r�)r�rr�r�rr-r��s
cstt�j�Sr�)r&r�r�r�r�r,r-r��szSSLContext.protocolcstt�j�Sr�)r2r��verify_flagsr�r�r,r-r�szSSLContext.verify_flagscsttt�j�||�dSr�)r�r�rr�r�r�r,r-r�scs0t�j}z
t|�WStk
r*|YSXdSr�)r��verify_moder3r�r�r�r,r-r�s

zSSLContext.verify_modecsttt�j�||�dSr�)r�r�rr�r�r�r,r-r�s)FTTNN)FNN)!r8r9r:rDr�r�r��PROTOCOL_TLSr�r�r�r�r�r�r�r�r�r�r�rr	�propertyr��setterr�r�r;r�r�r�rrr�r,r,r�r-r��sn�
�





&%r�)r�r�r�cCs�t|t�st|��tt�}|tjkr0t|_d|_	|s<|s<|rL|�
|||�n|jtkr`|�|�t
|d�r�tj�d�}|r�tjjs�||_|S)z�Create a SSLContext object with default settings.

    NOTE: The protocol and settings may change anytime without prior
          deprecation. The values represent a fair balance between maximum
          compatibility and security.
    T�keylog_filename�
SSLKEYLOGFILE)r�r�r�r�rr�r��
CERT_REQUIREDr�check_hostnamer��	CERT_NONEr�rr�r�r�r��flags�ignore_environmentr)r�r�r�r�r��
keylogfiler,r,r-�create_default_context�s




rF)�	cert_reqsrr��certfile�keyfiler�r�r�cCs�t|t�st|��t|�}	|s$d|	_|dk	r2||	_|r<d|	_|rL|sLtd��|sT|r`|	�||�|sl|sl|r||	�|||�n|	jt	kr�|	�
|�t|	d�r�tj
�d�}
|
r�tjjs�|
|	_|	S)a/Create a SSLContext object for Python stdlib modules

    All Python stdlib modules shall use this function to create SSLContext
    objects in order to keep common settings in one place. The configuration
    is less restrict than create_default_context()'s to increase backward
    compatibility.
    FNT�certfile must be specifiedrr	)r�r�r�r�rrr��load_cert_chainr�rr�rr�r�r�r�r
rr)r�rrr�rrr�r�r�r�rr,r,r-�_create_unverified_context�s,



rc@s�eZdZdZdd�Zed2dd��Zedd	��Zej	d
d	��Zedd��Z
e
j	d
d��Z
edd��Zedd��Zedd��Z
d3dd�Zdd�Zd4dd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd5d,d-�Zd.d/�Zd0d1�ZdS)6�	SSLObjectaThis class implements an interface on top of a low-level SSL object as
    implemented by OpenSSL. This object captures the state of an SSL connection
    but does not provide any network IO itself. IO needs to be performed
    through separate "BIO" objects which are OpenSSL's IO abstraction layer.

    This class does not have a public constructor. Instances are returned by
    ``SSLContext.wrap_bio``. This class is typically used by framework authors
    that want to implement asynchronous IO for SSL through memory buffers.

    When compared to ``SSLSocket``, this object lacks the following features:

     * Any form of network IO, including methods such as ``recv`` and ``send``.
     * The ``do_handshake_on_connect`` and ``suppress_ragged_eofs`` machinery.
    cOst|jj�d���dS)NzU does not have a public constructor. Instances are returned by SSLContext.wrap_bio().�r�r�r8�r�r�r�r,r,r-�__init__;s�zSSLObject.__init__FNc	Cs*|�|�}|j||||||d�}||_|S)N)r�r��ownerr�)r�Z	_wrap_bio�_sslobj)	r�r�r�r�r�r�r�r�r�r,r,r-r�As
�zSSLObject._createcCs|jjS)z(The SSLContext that is currently in use.�rr�r�r,r,r-r�MszSSLObject.contextcCs||j_dSr�r�r�Zctxr,r,r-r�RscCs|jjS)z!The SSLSession for client socket.�rr�r�r,r,r-r�VszSSLObject.sessioncCs||j_dSr�r�r�r�r,r,r-r�[scCs|jjS)z.Was the client session reused during handshake�r�session_reusedr�r,r,r-r"_szSSLObject.session_reusedcCs|jjS)z%Whether this is a server-side socket.)rr�r�r,r,r-r�dszSSLObject.server_sidecCs|jjS)z^The currently set server hostname (for SNI), or ``None`` if no
        server hostname is set.)rr�r�r,r,r-r�iszSSLObject.server_hostname�cCs(|dk	r|j�||�}n|j�|�}|S)z�Read up to 'len' bytes from the SSL object and return them.

        If 'buffer' is provided, read into this buffer and return the number of
        bytes read.
        N)r�read)r�r��buffer�vr,r,r-r$oszSSLObject.readcCs|j�|�S)z�Write 'data' to the SSL object and return the number of bytes
        written.

        The 'data' argument must support the buffer interface.
        )r�write�r�r�r,r,r-r'{szSSLObject.writecCs|j�|�S)z�Returns a formatted version of the data in the certificate provided
        by the other end of the SSL channel.

        Return None if no certificate was provided, {} if a certificate was
        provided, but not validated.
        )r�getpeercert�r�Zbinary_formr,r,r-r)�szSSLObject.getpeercertcCstjr|j��SdS)z�Return the currently selected NPN protocol as a string, or ``None``
        if a next protocol was not negotiated or if NPN is not supported by one
        of the peers.N)r;rr�selected_npn_protocolr�r,r,r-r+�szSSLObject.selected_npn_protocolcCstjr|j��SdS)z�Return the currently selected ALPN protocol as a string, or ``None``
        if a next protocol was not negotiated or if ALPN is not supported by one
        of the peers.N)r;rr�selected_alpn_protocolr�r,r,r-r,�sz SSLObject.selected_alpn_protocolcCs
|j��S)z_Return the currently selected cipher as a 3-tuple ``(name,
        ssl_version, secret_bits)``.)r�cipherr�r,r,r-r-�szSSLObject.ciphercCs
|j��S)z�Return a list of ciphers shared by the client during the handshake or
        None if this is not a valid server connection.
        )r�shared_ciphersr�r,r,r-r.�szSSLObject.shared_cipherscCs
|j��S)z�Return the current compression algorithm in use, or ``None`` if
        compression was not negotiated or not supported by one of the peers.)r�compressionr�r,r,r-r/�szSSLObject.compressioncCs
|j��S)z8Return the number of bytes that can be read immediately.)r�pendingr�r,r,r-r0�szSSLObject.pendingcCs|j��dS)zStart the SSL/TLS handshake.N)r�do_handshaker�r,r,r-r1�szSSLObject.do_handshakecCs
|j��S)z!Start the SSL shutdown handshake.)r�shutdownr�r,r,r-�unwrap�szSSLObject.unwrapr�cCs|j�|�S)z�Get channel binding data for current connection.  Raise ValueError
        if the requested `cb_type` is not supported.  Return bytes of the data
        or None if the data is not available (e.g. before the handshake).)r�get_channel_binding�r�Zcb_typer,r,r-r4�szSSLObject.get_channel_bindingcCs
|j��S)zZReturn a string identifying the protocol version used by the
        current SSL channel. �rr�r�r,r,r-r��szSSLObject.versioncCs
|j��Sr�)r�verify_client_post_handshaker�r,r,r-r7�sz&SSLObject.verify_client_post_handshake)FNNN)r#N)F)r�)r8r9r:rDrr�r�rr�rr�r"r�r�r$r'r)r+r,r-r.r/r0r1r3r4r�r7r,r,r,r-r,sH�








	
rcCstt|j�j|_|S)z*Copy docstring from SSLObject to SSLSocket)�getattrrr8rD)�funcr,r,r-�_sslcopydoc�sr:cseZdZdZdd�ZedX�fdd�	�Zeed	d
���Z	e	j
dd
��Z	eedd
���Zej
dd
��Zeedd���Zdd�Z
dYdd�Zdd�ZdZdd�Zdd�Zed[dd��Zedd��Zed d!��Zed"d#��Zed$d%��Zed&d'��Zd\�fd)d*�	Zd]�fd+d,�	Zd-d.�Zd^�fd/d0�	Zd_�fd1d2�	Zd`�fd3d4�	Zda�fd5d6�	Zdb�fd7d8�	Zdc�fd9d:�	Z d;d<�Z!d=d>�Z"ed?d@��Z#�fdAdB�Z$edCdD��Z%edEdF��Z&�fdGdH�Z'edddIdJ��Z(�fdKdL�Z)dMdN�Z*dOdP�Z+�fdQdR�Z,ededTdU��Z-edVdW��Z.�Z/S)f�	SSLSocketz�This class implements a subtype of socket.socket that wraps
    the underlying OS socket in an SSL context when necessary, and
    provides read and write methods over that channel. cOst|jj�d���dS)NzX does not have a public constructor. Instances are returned by SSLContext.wrap_socket().rrr,r,r-r�s�zSSLSocket.__init__FTNc

s�|�tt�tkrtd��|r8|r(td��|dk	r8td��|jrJ|sJtd��t|j|j	|j
|��d�}|j|f|�}	t
t|	�jf|�|	�|���|��||	_||	_d|	_d|	_||	_|�|�|	_||	_||	_z|	��Wn6tk
�r}
z|
jtjkr��d}W5d}
~
XYnXd}||	_ |�r�zH|	jj!|	||	j|	|	jd�|	_|�rj|	��}|d	k�rbtd
��|	�"�Wn$ttfk
�r�|	�#��YnX|	S)Nz!only stream sockets are supportedz4server_hostname can only be specified in client modez,session can only be specified in client modez'check_hostname requires server_hostname)�family�type�proto�filenoFT�rr��zHdo_handshake_on_connect should not be specified for non-blocking sockets)$Z
getsockoptrr�r}�NotImplementedErrorr�r�dictr<r=r>r?r�r�r;r�
settimeout�
gettimeout�detach�_context�_sessionZ_closedrr�r�r�r�r��getpeernamer��errnoZENOTCONN�
_connected�_wrap_socketr1�close)
r�r�r�r�r�r�r�r�r�r��eZ	connected�timeoutr�r,r-r��sj
��
zSSLSocket._createcCs|jSr�)rGr�r,r,r-r�szSSLSocket.contextcCs||_||j_dSr�)rGrr�rr,r,r-r�scCs|jdk	r|jjSdSr�rr�r,r,r-r� s
zSSLSocket.sessioncCs||_|jdk	r||j_dSr�)rHrr�r r,r,r-r�&s
cCs|jdk	r|jjSdSr�r!r�r,r,r-r",s
zSSLSocket.session_reusedcCstd|jj��dS)NzCan't dup() %s instances)rBr�r8r�r,r,r-�dup2s�z
SSLSocket.dupcCsdSr�r,)r��msgr,r,r-�_checkClosed6szSSLSocket._checkClosedcCs|js|��dSr�)rKrIr�r,r,r-�_check_connected:szSSLSocket._check_connectedr#c
Cs�|��|jdkrtd��z*|dk	r4|j�||�WS|j�|�WSWnVtk
r�}z8|jdtkr�|jr�|dk	r|WY�dSWY�dSn�W5d}~XYnXdS)zORead up to LEN bytes and return them.
        Return zero-length string on EOF.Nz'Read on closed or unwrapped SSL socket.rr/)rRrr�r$rr�Z
SSL_ERROR_EOFr�)r�r�r%�xr,r,r-r$Bs

zSSLSocket.readcCs&|��|jdkrtd��|j�|�S)zhWrite DATA to the underlying SSL channel.  Returns
        number of bytes of DATA actually transmitted.Nz(Write on closed or unwrapped SSL socket.)rRrr�r'r(r,r,r-r'Ws
zSSLSocket.writecCs|��|��|j�|�Sr�)rRrSrr)r*r,r,r-r)`szSSLSocket.getpeercertcCs*|��|jdkstjsdS|j��SdSr�)rRrr;rr+r�r,r,r-r+fszSSLSocket.selected_npn_protocolcCs*|��|jdkstjsdS|j��SdSr�)rRrr;rr,r�r,r,r-r,nsz SSLSocket.selected_alpn_protocolcCs$|��|jdkrdS|j��SdSr�)rRrr-r�r,r,r-r-vs
zSSLSocket.ciphercCs$|��|jdkrdS|j��SdSr�)rRrr.r�r,r,r-r.~s
zSSLSocket.shared_cipherscCs$|��|jdkrdS|j��SdSr�)rRrr/r�r,r,r-r/�s
zSSLSocket.compressionrcsF|��|jdk	r4|dkr(td|j��|j�|�St��||�SdS)Nrz3non-zero flags not allowed in calls to send() on %s)rRrr�r�r'r��send)r�r�r
r�r,r-rU�s
��zSSLSocket.sendcsL|��|jdk	r"td|j��n&|dkr8t��||�St��|||�SdS)Nz%sendto not allowed on instances of %s)rRrr�r�r��sendto)r�r�Z
flags_or_addrr�r�r,r-rV�s
�zSSLSocket.sendtocOstd|j��dS)Nz&sendmsg not allowed on instances of %s�rBr�rr,r,r-�sendmsg�s�zSSLSocket.sendmsgc
s�|��|jdk	r�|dkr(td|j��d}t|��H}|�d��2}t|�}||krn|�||d��}||7}qJW5QRXW5QRXnt��	||�SdS)Nrz6non-zero flags not allowed in calls to sendall() on %s�B)
rRrr�r��
memoryview�castr�rUr��sendall)r�r�r
r�ZviewZ	byte_viewZamountr&r�r,r-r\�s
�� zSSLSocket.sendallcs,|jdk	r|�|||�St��|||�SdS)z�Send a file, possibly by using os.sendfile() if this is a
        clear-text socket.  Return the total number of bytes sent.
        N)rZ_sendfile_use_sendr��sendfile)r��file�offsetr�r�r,r-r]�s
zSSLSocket.sendfilecsD|��|jdk	r2|dkr(td|j��|�|�St��||�SdS)Nrz3non-zero flags not allowed in calls to recv() on %s)rRrr�r�r$r��recv�r�Zbuflenr
r�r,r-r`�s
��
zSSLSocket.recvcsj|��|r|dkrt|�}n|dkr*d}|jdk	rV|dkrJtd|j��|�||�St��|||�SdS)Nr#rz8non-zero flags not allowed in calls to recv_into() on %s)rRr�rr�r�r$r��	recv_into�r�r%�nbytesr
r�r,r-rb�s

��zSSLSocket.recv_intocs4|��|jdk	r"td|j��nt��||�SdS)Nz'recvfrom not allowed on instances of %s)rRrr�r�r��recvfromrar�r,r-re�s
�zSSLSocket.recvfromcs6|��|jdk	r"td|j��nt��|||�SdS)Nz,recvfrom_into not allowed on instances of %s)rRrr�r�r��
recvfrom_intorcr�r,r-rf�s
�zSSLSocket.recvfrom_intocOstd|j��dS)Nz&recvmsg not allowed on instances of %srWrr,r,r-�recvmsg�s�zSSLSocket.recvmsgcOstd|j��dS)Nz+recvmsg_into not allowed on instances of %srWrr,r,r-�recvmsg_into�s�zSSLSocket.recvmsg_intocCs$|��|jdk	r|j��SdSdS)Nr)rRrr0r�r,r,r-r0�s

zSSLSocket.pendingcs|��d|_t��|�dSr�)rRrr�r2)r�Zhowr�r,r-r2�szSSLSocket.shutdowncCs.|jr|j��}d|_|Stdt|���dS�NzNo SSL wrapper around )rr2r�r�)r��sr,r,r-r3s

zSSLSocket.unwrapcCs$|jr|j��Stdt|���dSri)rr7r�r�r�r,r,r-r7s
z&SSLSocket.verify_client_post_handshakecsd|_t���dSr�)rr��_real_closer�r�r,r-rkszSSLSocket._real_closec	CsF|��|��}z$|dkr(|r(|�d�|j��W5|�|�XdS)NrA)rSrErDrr1)r��blockrOr,r,r-r1s
zSSLSocket.do_handshakec	s�|jrtd��|js|jdk	r&td��|jj|d|j||jd�|_z@|rVt��	|�}nd}t��
|�|s~d|_|jr~|��|WSt
tfk
r�d|_�YnXdS)Nz!can't connect in server-side modez/attempt to connect already-connected SSLSocket!Fr@T)r�r�rKrr�rLr�rHr��
connect_ex�connectr�r1r�)r�r�rmZrcr�r,r-�
_real_connect!s0�zSSLSocket._real_connectcCs|�|d�dS)�QConnects to remote ADDR, and then wraps the connection in
        an SSL channel.FN�ro�r�r�r,r,r-rn;szSSLSocket.connectcCs|�|d�S)rpTrqrrr,r,r-rm@szSSLSocket.connect_excs.t���\}}|jj||j|jdd�}||fS)z�Accepts a new connection from a remote client, and returns
        a tuple containing that new connection wrapped with a server-side
        SSL channel, and the address of the remote client.T)r�r�r�)r��acceptr�r�r�r�)r�Znewsockr�r�r,r-rsEs�zSSLSocket.acceptr�cCs4|jdk	r|j�|�S|tkr,td�|���dSdS)Nz({0} channel binding type not implemented)rr4�CHANNEL_BINDING_TYPESr�r�r5r,r,r-r4Qs
�zSSLSocket.get_channel_bindingcCs|jdk	r|j��SdSdSr�r6r�r,r,r-r�\s

zSSLSocket.version)FTTNNN)N)r#N)F)r)N)r)rN)r#r)Nr)r#r)Nr)F)r�)0r8r9r:rDrr�r�rr:r�rr�r"rPrRrSr$r'r)r+r,r-r.r/rUrVrXr\r]r`rbrerfrgrhr0r2r3r7rkr1rornrmrsr4r�r�r,r,r�r-r;�s��>



	











r;Tc
Csl|r|std��|r |s td��t|�}
||
_|r<|
�|�|rL|
�||�|	rZ|
�|	�|
j||||d�S)Nz5certfile must be specified for server-side operationsr)r�r�r�r�)r�r�rr�rZset_ciphersr�)r�rrr�r�ssl_version�ca_certsr�r�Zciphersr�r,r,r-r�is$

�r�cCs�ddlm}ddlm}d}d}z|�|dd����d}Wn$tk
rbtd	||f��Yn0X||dd�|�}||d|f|d
d��SdS)a�Return the time in seconds since the Epoch, given the timestring
    representing the "notBefore" or "notAfter" date from a certificate
    in ``"%b %d %H:%M:%S %Y %Z"`` strptime format (C locale).

    "notBefore" or "notAfter" dates must use UTC (RFC 5280).

    Month is one of: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
    UTC should be specified as GMT (see ASN1_TIME_print())
    r)�strptime)�timegm)ZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDecz %d %H:%M:%S %Y GMTNrjrhz*time data %r does not match format "%%b%s"rirm)�timerwZcalendarrx�index�titler�)Z	cert_timerwrxZmonthsZtime_formatZmonth_numberZttr,r,r-�cert_time_to_seconds�s
�r|z-----BEGIN CERTIFICATE-----z-----END CERTIFICATE-----csRtt�|�dd��tg}|�fdd�tdt��d�D�7}|�td�d�|�S)z[Takes a certificate in binary DER format and returns the
    PEM version of it as a string.�ASCII�strictcsg|]}�||d��qS)�@r,)r4�i��fr,r-�
<listcomp>�sz(DER_cert_to_PEM_cert.<locals>.<listcomp>rr�
)	r��base64Zstandard_b64encode�
PEM_HEADER�ranger�r��
PEM_FOOTERr�)Zder_cert_bytesZssr,r�r-�DER_cert_to_PEM_cert�s
"r�cCs\|�t�stdt��|���t�s0tdt��|��tt�tt��}t�|�	dd��S)zhTakes a certificate in ASCII PEM format and returns the
    DER-encoded version of it as a byte sequencez(Invalid PEM encoding; must start with %sz&Invalid PEM encoding; must end with %sr}r~)
r)r�r��strip�endswithr�r�r�Zdecodebytesr�)Zpem_cert_string�dr,r,r-�PEM_cert_to_DER_cert�s
��r�c

Csd|\}}|dk	rt}nt}t|||d�}t|��&}|�|��}|�d�}	W5QRXW5QRXt|	�S)z�Retrieve the certificate from the server at the specified address,
    and return it as a PEM-encoded string.
    If 'ca_certs' is specified, validate the server cert against it.
    If 'ssl_version' is specified, use it in the connection attempt.N)rr�T)r
r�_create_stdlib_contextr~r�r)r�)
r�rurvZhostZportrr�r�ZsslsockZdercertr,r,r-�get_server_certificate�s�
r�cCst�|d�S)Nz	<unknown>)�_PROTOCOL_NAMESr�)Z
protocol_coder,r,r-�get_protocol_name�sr�)nrDr�r��collectionsr�enumrZ_EnumrZ_IntEnumrZ_IntFlagr;rrrr	r
rrr
rrrrrrr�rr�rrrrr�ImportErrorrrrrrrr r!r"r#r$r%�	_convert_r8r&rr'�__members__�itemsr�r8Z_SSLv2_IF_EXISTSr7r=rHrgr�ryrzr{r|r}r~rr�r�r�rJr�r�Zsocket_errorrtrZHAS_NEVER_CHECK_COMMON_NAMEZ_RESTRICTED_SERVER_CIPHERSr�r�r�r�r�r�r�r�r�r�r�rrrZ_create_default_https_contextr�rr:r;r�r�r�r|r�r�r�r�r�r�r,r,r,r-�<module>s�Y$0������
)
1#9�z�#�/�


__pycache__/compileall.cpython-38.opt-1.pyc000064400000022304151153537600014473 0ustar00U

e5dn5�	@s�dZddlZddlZddlZddlZddlZddlmZdddgZ	ddd	�Z
dd
d�Zdd�Zddd�Z
ddd�Zdd�Zedkr�ee��Ze�e�dS)a�Module/script to byte-compile all .py files to .pyc files.

When called as a script with arguments, this compiles the directories
given as arguments recursively; the -l option prevents it from
recursing into directories.

Without arguments, if compiles all modules on sys.path, without
recursing into subdirectories.  (Even though it should do so for
packages -- for now, you'll have to deal with packages separately.)

See module py_compile for details of the actual byte-compilation.
�N)�partial�compile_dir�compile_file�compile_path�
ccs|dkrt|tj�rt�|�}|s0td�|��zt�|�}Wn.tk
rl|dkrdtd�|��g}YnX|��|D]�}|dkr�qztj	�
||�}|dk	r�tj	�
||�}nd}tj	�|�s�||fVqz|dkrz|tjkrz|tj
krztj	�|�rztj	�|�szt|||d|d�EdHqzdS)N�zListing {!r}...zCan't list {!r}�__pycache__r�)�ddir�	maxlevels�quiet)�
isinstance�os�PathLike�fspath�print�format�listdir�OSError�sort�path�join�isdir�curdir�pardir�islink�	_walk_dir)�dirr
rr�names�name�fullname�dfile�r"�"/usr/lib64/python3.8/compileall.pyrs:


�
��rF���r	c
Cs�d}
|dkrtd��|dkrFzddlm}
Wntk
rDd}YnXt||||d�}d}|dkr�|
dk	r�|ppd}|
|d��0}
|
�tt||||||	d	�|�}t|dd
�}W5QRXn(|D]"\}}t	||||||||	�s�d}q�|S)aByte-compile all modules in the given directory tree.

    Arguments (only dir is required):

    dir:       the directory to byte-compile
    maxlevels: maximum recursion level (default 10)
    ddir:      the directory that will be prepended to the path to the
               file as it is compiled into each byte-code file.
    force:     if True, force compilation, even if timestamps are up-to-date
    quiet:     full output with False or 0, errors only with 1,
               no output with 2
    legacy:    if True, produce legacy pyc paths instead of PEP 3147 paths
    optimize:  optimization level or -1 for level of the interpreter
    workers:   maximum number of parallel workers
    invalidation_mode: how the up-to-dateness of the pyc will be checked
    Nrz%workers must be greater or equal to 0r	)�ProcessPoolExecutor)rrr
T)Zmax_workers)�force�rxr�legacy�optimize�invalidation_mode)�defaultF)
�
ValueErrorZconcurrent.futuresr%�ImportErrorr�mapr�_compile_file_tuple�minr)rrr
r&r'rr(r)�workersr*r%Zfiles_and_ddirs�successZexecutorZresults�filer!r"r"r#r2sF
����cKs|\}}t||f|�S)z-Needs to be toplevel for ProcessPoolExecutor.)r)Zfile_and_dfile�kwargsr3r!r"r"r#r/esr/c
Cs�d}|dkr"t|tj�r"t�|�}tj�|�}	|dk	rFtj�||	�}
nd}
|dk	rd|�|�}|rd|Stj�|��r�|r�|d}nB|dkr�|dkr�|nd}
t	j
j||
d�}nt	j
�|�}tj�|�}|	dd	�|	d	d�}}|d
k�r�|�s\zXt
t�|�j�}t�dt	j
jd|�}t|d��}|�d
�}W5QRX||k�rB|WSWntk
�rZYnX|�sptd�|��ztj|||
d||d�}W�ntjk
�r}zjd}|dk�r�|WY�RS|�r�td�|��ntddd�|jjtjjdd�}|� tjj�}t|�W5d}~XYn�t!t"tfk
�r�}zRd}|dk�rJ|WY�:S|�r`td�|��ntddd�t|j#j$d|�W5d}~XYnX|dk�r�d}|S)aTByte-compile one file.

    Arguments (only fullname is required):

    fullname:  the file to byte-compile
    ddir:      if given, the directory name compiled in to the
               byte-code file.
    force:     if True, force compilation, even if timestamps are up-to-date
    quiet:     full output with False or 0, errors only with 1,
               no output with 2
    legacy:    if True, produce legacy pyc paths instead of PEP 3147 paths
    optimize:  optimization level or -1 for level of the interpreter
    invalidation_mode: how the up-to-dateness of the pyc will be checked
    TrN�crr	�)�optimization���z.pyz<4sll�rb�zCompiling {!r}...)r)r*Fz*** Error compiling {!r}...z*** )�end�backslashreplace)�errors�:)%r
rrrr�basenamer�search�isfile�	importlib�util�cache_from_source�dirname�int�stat�st_mtime�structZpack�MAGIC_NUMBER�open�readrrr�
py_compile�compile�PyCompileError�msg�encode�sys�stdout�encoding�decode�SyntaxError�UnicodeError�	__class__�__name__)r r
r&r'rr(r)r*r2rr!Zmo�cfile�optZ	cache_dir�head�tail�mtimeZexpectZchandleZactual�ok�errrP�er"r"r#rjs�


�
�

�
�
$
c	CsTd}tjD]D}|r|tjkr2|r2|dkrNtd�q
|oLt||d|||||d�}q
|S)a�Byte-compile all module on sys.path.

    Arguments (all optional):

    skip_curdir: if true, skip current directory (default True)
    maxlevels:   max recursion level (default 0)
    force: as for compile_dir() (default False)
    quiet: as for compile_dir() (default 0)
    legacy: as for compile_dir() (default False)
    optimize: as for compile_dir() (default -1)
    invalidation_mode: as for compiler_dir()
    TrzSkipping current directoryN)rr(r)r*)rRrrrrr)	Zskip_curdirrr&rr(r)r*r2rr"r"r#r�s 

�
c
Cs�ddl}|jdd�}|jdddddd	d
�|jdtdd
d�|jddddd�|jdddddd�|jddddd�|jdddddd �|jd!d"d#dd$d �|jd%d&d'd(d)�|jd*d+d,d-d.�|jd/d0d1td2d3�d4d5�tjD�}|jd6t|�d7d8�|��}|j}|j	�r$ddl
}|�|j	�|_	|jdk	�r8|j}n|j
}|j�r�zF|jd9k�rZtjnt|j�� }|D]}|�|����qjW5QRXWn4tk
�r�|jd:k�r�td;�|j��Yd<SX|j�r�|j�d9d=���}	tj|	}
nd}
d>}z�|�rl|D]h}tj�|��r6t||j|j |j	|j|j!|
d?��sbd<}n,t"|||j|j |j	|j|j!|j#|
d@�	�s�d<}�q�|WSt$|j!|j |j|
dA�WSWn,t%k
�r�|jd:k�r�tdB�Yd<SXd>S)CzScript main program.rNz1Utilities to support installing Python libraries.)Zdescriptionz-lZstore_constrrz!don't recurse into subdirectories)�actionZconstr+�dest�helpz-r�	recursionzhcontrol the maximum recursion level. if `-l` and `-r` options are specified, then `-r` takes precedence.)�typercrdz-f�
store_truer&z/force rebuild even if timestamps are up to date)rbrcrdz-q�countrzIoutput only error messages; -qq will suppress the error messages as well.)rbrcr+rdz-br(z0use legacy (pre-PEP3147) compiled file locationsz-dZDESTDIRr
z�directory to prepend to file paths for use in compile-time tracebacks and in runtime tracebacks in cases where the source file is unavailable)�metavarrcr+rdz-xZREGEXPr'zskip files matching the regular expression; the regexp is searched for in the full path of each file considered for compilationz-iZFILE�flistzzadd all the files and directories listed in FILE to the list considered for compilation; if "-", names are read from stdin)rircrd�compile_destzFILE|DIR�*zrzero or more file and directory names to compile; if no arguments given, defaults to the equivalent of -l sys.path)ri�nargsrdz-jz	--workersr	zRun compileall concurrently)r+rfrdcSsg|]}|j���dd��qS)�_�-)r�lower�replace)�.0�moder"r"r#�
<listcomp>	s�zmain.<locals>.<listcomp>z--invalidation-modez�set .pyc invalidation mode; defaults to "checked-hash" if the SOURCE_DATE_EPOCH environment variable is set, and "timestamp" otherwise.)�choicesrdrorzError reading file list {}FrnT)r*)r1r*)r(r&rr*z
[interrupted])&�argparse�ArgumentParser�add_argumentrFrM�PycInvalidationMode�sorted�
parse_argsrkr'�rerNrerrjrR�stdinrK�append�striprrrrr*rq�upperrrrArr
r&r(rr1r�KeyboardInterrupt)
rv�parserZinvalidation_modes�argsZ
compile_destsr|r�f�lineZivl_moder*r2rcr"r"r#�main�s��
�
�
��
���
�
�
��� �
�
�r��__main__)Nrr)	rNFNrFr$r	N)NFNrFr$N)r	rFrFr$N)�__doc__rrR�importlib.utilrBrMrI�	functoolsr�__all__rrr/rrr�rYrFZexit_status�exitr"r"r"r#�<module>s<

�
3�
V�
"i__pycache__/__future__.cpython-38.opt-2.pyc000064400000004214151153537600014461 0ustar00U

e5d�
@s�dddddddddd	g
Zd
geZdZdZd
ZdZdZdZdZdZ	dZ
dZGdd�d�Zedde�Z
edde�Zedde�Zedde�Zedde�Zedde�Zedde�Zed d!e	�Zed"d#e
�Zed$d%e�Zd&S)'�
nested_scopes�
generators�division�absolute_import�with_statement�print_function�unicode_literals�barry_as_FLUFL�generator_stop�annotations�all_feature_names��iiiii i@i�ic@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�_FeaturecCs||_||_||_dS�N)�optional�	mandatory�
compiler_flag)�selfZoptionalReleaseZmandatoryReleaser�r�"/usr/lib64/python3.8/__future__.py�__init__Ssz_Feature.__init__cCs|jSr)r�rrrr�getOptionalReleaseXsz_Feature.getOptionalReleasecCs|jSr)rrrrr�getMandatoryRelease_sz_Feature.getMandatoryReleasecCsdt|j|j|jf�S)Nr)�reprrrrrrrr�__repr__gs�z_Feature.__repr__N)�__name__�
__module__�__qualname__rrrrrrrrrQsr)��r
�betar )rrr
�alphar
)rrr
r"r )r�r
�finalr
)rrr
r"r)r#r
r
r"r
)r�r
r"r )r�r
r"r
)rr&r
r"r)r#r r
r"r)�r
r
r"r
)r#r%r
r!r )r#�r
r"r
)r#r(r
r!r )r#�
r
r"r
N)r�__all__Z	CO_NESTEDZCO_GENERATOR_ALLOWEDZCO_FUTURE_DIVISIONZCO_FUTURE_ABSOLUTE_IMPORTZCO_FUTURE_WITH_STATEMENTZCO_FUTURE_PRINT_FUNCTIONZCO_FUTURE_UNICODE_LITERALSZCO_FUTURE_BARRY_AS_BDFLZCO_FUTURE_GENERATOR_STOPZCO_FUTURE_ANNOTATIONSrrrrrrrrrr	r
rrrr�<module>3s|�
����������__pycache__/compileall.cpython-38.opt-2.pyc000064400000015575151153537600014510 0ustar00U

e5dn5�	@s�ddlZddlZddlZddlZddlZddlmZdddgZddd�Z	ddd�Z
d
d�Zddd�Zddd�Z
dd�Zedkr�ee��Ze�e�dS)�N)�partial�compile_dir�compile_file�compile_path�
ccs|dkrt|tj�rt�|�}|s0td�|��zt�|�}Wn.tk
rl|dkrdtd�|��g}YnX|��|D]�}|dkr�qztj	�
||�}|dk	r�tj	�
||�}nd}tj	�|�s�||fVqz|dkrz|tjkrz|tj
krztj	�|�rztj	�|�szt|||d|d�EdHqzdS)N�zListing {!r}...zCan't list {!r}�__pycache__r�)�ddir�	maxlevels�quiet)�
isinstance�os�PathLike�fspath�print�format�listdir�OSError�sort�path�join�isdir�curdir�pardir�islink�	_walk_dir)�dirr
rr�names�name�fullname�dfile�r"�"/usr/lib64/python3.8/compileall.pyrs:


�
��rF���r	c
Cs�d}
|dkrtd��|dkrFzddlm}
Wntk
rDd}YnXt||||d�}d}|dkr�|
dk	r�|ppd}|
|d��0}
|
�tt||||||	d�|�}t|dd	�}W5QRXn(|D]"\}}t	||||||||	�s�d
}q�|S)Nrz%workers must be greater or equal to 0r	)�ProcessPoolExecutor)rrr
T)Zmax_workers)�force�rxr�legacy�optimize�invalidation_mode)�defaultF)
�
ValueErrorZconcurrent.futuresr%�ImportErrorr�mapr�_compile_file_tuple�minr)rrr
r&r'rr(r)�workersr*r%Zfiles_and_ddirs�successZexecutorZresults�filer!r"r"r#r2sF
����cKs|\}}t||f|�S)N)r)Zfile_and_dfile�kwargsr3r!r"r"r#r/esr/c
Cs�d}|dkr"t|tj�r"t�|�}tj�|�}	|dk	rFtj�||	�}
nd}
|dk	rd|�|�}|rd|Stj�|��r�|r�|d}nB|dkr�|dkr�|nd}
t	j
j||
d�}nt	j
�|�}tj�|�}|	dd�|	dd�}}|d	k�r�|�s\zXt
t�|�j�}t�d
t	j
jd|�}t|d��}|�d�}W5QRX||k�rB|WSWntk
�rZYnX|�sptd
�|��ztj|||
d||d�}W�ntjk
�r}zjd}|dk�r�|WY�RS|�r�td�|��ntddd�|jjtjjdd�}|� tjj�}t|�W5d}~XYn�t!t"tfk
�r�}zRd}|dk�rJ|WY�:S|�r`td�|��ntddd�t|j#j$d|�W5d}~XYnX|dk�r�d}|S)NTr�crr	�)�optimization���z.pyz<4sll�rb�zCompiling {!r}...)r)r*Fz*** Error compiling {!r}...z*** )�end�backslashreplace)�errors�:)%r
rrrr�basenamer�search�isfile�	importlib�util�cache_from_source�dirname�int�stat�st_mtime�structZpack�MAGIC_NUMBER�open�readrrr�
py_compile�compile�PyCompileError�msg�encode�sys�stdout�encoding�decode�SyntaxError�UnicodeError�	__class__�__name__)r r
r&r'rr(r)r*r2rr!Zmo�cfile�optZ	cache_dir�head�tail�mtimeZexpectZchandleZactual�ok�errrP�er"r"r#rjs�


�
�

�
�
$
c	CsTd}tjD]D}|r|tjkr2|r2|dkrNtd�q
|oLt||d|||||d�}q
|S)NTrzSkipping current directory)rr(r)r*)rRrrrrr)	Zskip_curdirrr&rr(r)r*r2rr"r"r#r�s 

�
c
Cs�ddl}|jdd�}|jddddddd	�|jd
tddd
�|jddddd�|jdddddd�|jddddd�|jdddddd�|jd d!d"dd#d�|jd$d%d&d'd(�|jd)d*d+d,d-�|jd.d/d0td1d2�d3d4�tjD�}|jd5t|�d6d7�|��}|j}|j	�r$ddl
}|�|j	�|_	|jdk	�r8|j}n|j
}|j�r�zF|jd8k�rZtjnt|j�� }|D]}|�|����qjW5QRXWn4tk
�r�|jd9k�r�td:�|j��Yd;SX|j�r�|j�d8d<���}	tj|	}
nd}
d=}z�|�rl|D]h}tj�|��r6t||j|j |j	|j|j!|
d>��sbd;}n,t"|||j|j |j	|j|j!|j#|
d?�	�s�d;}�q�|WSt$|j!|j |j|
d@�WSWn,t%k
�r�|jd9k�r�tdA�Yd;SXd=S)BNrz1Utilities to support installing Python libraries.)Zdescriptionz-lZstore_constrrz!don't recurse into subdirectories)�actionZconstr+�dest�helpz-r�	recursionzhcontrol the maximum recursion level. if `-l` and `-r` options are specified, then `-r` takes precedence.)�typercrdz-f�
store_truer&z/force rebuild even if timestamps are up to date)rbrcrdz-q�countrzIoutput only error messages; -qq will suppress the error messages as well.)rbrcr+rdz-br(z0use legacy (pre-PEP3147) compiled file locationsz-dZDESTDIRr
z�directory to prepend to file paths for use in compile-time tracebacks and in runtime tracebacks in cases where the source file is unavailable)�metavarrcr+rdz-xZREGEXPr'zskip files matching the regular expression; the regexp is searched for in the full path of each file considered for compilationz-iZFILE�flistzzadd all the files and directories listed in FILE to the list considered for compilation; if "-", names are read from stdin)rircrd�compile_destzFILE|DIR�*zrzero or more file and directory names to compile; if no arguments given, defaults to the equivalent of -l sys.path)ri�nargsrdz-jz	--workersr	zRun compileall concurrently)r+rfrdcSsg|]}|j���dd��qS)�_�-)r�lower�replace)�.0�moder"r"r#�
<listcomp>	s�zmain.<locals>.<listcomp>z--invalidation-modez�set .pyc invalidation mode; defaults to "checked-hash" if the SOURCE_DATE_EPOCH environment variable is set, and "timestamp" otherwise.)�choicesrdrorzError reading file list {}FrnT)r*)r1r*)r(r&rr*z
[interrupted])&�argparse�ArgumentParser�add_argumentrFrM�PycInvalidationMode�sorted�
parse_argsrkr'�rerNrerrjrR�stdinrK�append�striprrrrr*rq�upperrrrArr
r&r(rr1r�KeyboardInterrupt)
rv�parserZinvalidation_modes�argsZ
compile_destsr|r�f�lineZivl_moder*r2rcr"r"r#�main�s��
�
�
��
���
�
�
��� �
�
�r��__main__)Nrr)	rNFNrFr$r	N)NFNrFr$N)r	rFrFr$N)rrR�importlib.utilrBrMrI�	functoolsr�__all__rrr/rrr�rYrFZexit_status�exitr"r"r"r#�<module>
s:

�
3�
V�
"i__pycache__/types.cpython-38.opt-1.pyc000064400000021733151153537600013523 0ustar00U

e5d�%�@s�dZddlZdd�Zee�Zedd��Zeej�Zeej�Z	eej
�Zdd�Zee��Z
d	d
�Zee��Zdd�Ze�Zee�Ze��d
d�Ze�Zee�ZGdd�d�Zee�j�Zee�Zegj�Zeej�Zee�j�Z ee!j"�Z#ee$jd�Z%ee�Z&ze'�Wn:e'k
�rBe�(�dZ)ee)�Z*ee)j+�Z,dZ)[)YnXeej�Z-eej.�Z/[[[[[[d$dd�Z0dd�Z1d%dd�Z2dd�Z3Gdd�d�Z4Gdd�d�Z5d d!�Z6d"d#�e7�D�Z8dS)&zO
Define names for built-in types that aren't directly accessible as a builtin.
�NcCsdS�N�rrr�/usr/lib64/python3.8/types.py�_f�rcCsdSrrrrrr�<lambda>
rrcsd��fdd�}|jdS)N�csdSrrr��arr�fsz_cell_factory.<locals>.fr)�__closure__)rrr	r�
_cell_factorysr
ccs
dVdS)Nrrrrrr�_gsrc�sdSrrrrrr�_crrcCs
dVdSrrrrrr�_ag"src@seZdZdd�ZdS)�_CcCsdSrr��selfrrr�_m(rz_C._mN)�__name__�
__module__�__qualname__rrrrrr'sr�fromkeys�rcCsJt|�}t|||�\}}}|dk	r*||�||k	r:||d<||||f|�S)zBCreate a class object dynamically using the appropriate metaclass.N�__orig_bases__)�
resolve_bases�
prepare_class)�name�bases�kwds�	exec_body�resolved_bases�meta�nsrrr�	new_classEsr$cCs�t|�}d}d}t|�D]j\}}t|t�r,qt|d�s8q|�|�}d}t|t�sZtd��q||||||d�<|t|�d7}q|s�|St|�S)z8Resolve MRO entries dynamically as specified by PEP 560.Fr�__mro_entries__Tz#__mro_entries__ must return a tupler)	�list�	enumerate�
isinstance�type�hasattrr%�tuple�	TypeError�len)r�	new_bases�updated�shift�i�base�new_baserrrrOs"




rcCs~|dkri}nt|�}d|kr*|�d�}n|r<t|d�}nt}t|t�rTt||�}t|d�rp|j||f|�}ni}|||fS)azCall the __prepare__ method of the appropriate metaclass.

    Returns (metaclass, namespace, kwds) as a 3-tuple

    *metaclass* is the appropriate metaclass
    *namespace* is the prepared class namespace
    *kwds* is an updated copy of the passed in kwds argument with any
    'metaclass' entry removed. If no kwds argument is passed in, this will
    be an empty dict.
    N�	metaclassr�__prepare__)�dict�popr)r(�_calculate_metar*r5)rrrr"r#rrrrds


rcCs>|}|D]0}t|�}t||�r qt||�r0|}qtd��q|S)z%Calculate the most derived metaclass.zxmetaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases)r)�
issubclassr,)r"r�winnerr2�	base_metarrrr8�s


r8c@sLeZdZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�DynamicClassAttributeaRoute attribute access on a class to __getattr__.

    This is a descriptor, used to define attributes that act differently when
    accessed through an instance and through a class.  Instance access remains
    normal, but access to an attribute through a class will be routed to the
    class's __getattr__ method; this is done by raising AttributeError.

    This allows one to have properties active on an instance, and have virtual
    attributes on the class with the same name (see Enum for an example).

    NcCs>||_||_||_|p|j|_|dk|_tt|dd��|_dS)N�__isabstractmethod__F)�fget�fset�fdel�__doc__�
overwrite_doc�bool�getattrr=)rr>r?r@�docrrr�__init__�s
zDynamicClassAttribute.__init__cCs6|dkr|jr|St��n|jdkr,td��|�|�S)Nzunreadable attribute)r=�AttributeErrorr>)r�instance�
ownerclassrrr�__get__�s
zDynamicClassAttribute.__get__cCs"|jdkrtd��|�||�dS)Nzcan't set attribute)r?rG)rrH�valuerrr�__set__�s
zDynamicClassAttribute.__set__cCs |jdkrtd��|�|�dS)Nzcan't delete attribute)r@rG)rrHrrr�
__delete__�s
z DynamicClassAttribute.__delete__cCs8|jr|jnd}t|�||j|j|p(|j�}|j|_|Sr)rBrAr)r?r@)rr>�fdoc�resultrrr�getter�szDynamicClassAttribute.gettercCs$t|�|j||j|j�}|j|_|Sr)r)r>r@rArB)rr?rOrrr�setter�szDynamicClassAttribute.settercCs$t|�|j|j||j�}|j|_|Sr)r)r>r?rArB)rr@rOrrr�deleter�szDynamicClassAttribute.deleter)NNNN)N)rrrrArFrJrLrMrPrQrRrrrrr<�s


	r<c@s�eZdZdd�Zdd�Zdd�Zdd�Zed	d
��Zedd��Z	ed
d��Z
edd��ZeZe	Z
e
ZeZdd�Zdd�ZeZdS)�_GeneratorWrappercCs2||_|jtk|_t|dd�|_t|dd�|_dS)Nrr)�_GeneratorWrapper__wrapped�	__class__�
GeneratorType�_GeneratorWrapper__isgenrDrr)r�genrrrrF�sz_GeneratorWrapper.__init__cCs|j�|�Sr)rT�send)r�valrrrrY�sz_GeneratorWrapper.sendcGs|jj|f|��Sr)rT�throw)r�tp�restrrrr[�sz_GeneratorWrapper.throwcCs
|j��Sr)rT�closerrrrr^�sz_GeneratorWrapper.closecCs|jjSr)rT�gi_coderrrrr_�sz_GeneratorWrapper.gi_codecCs|jjSr)rT�gi_framerrrrr`�sz_GeneratorWrapper.gi_framecCs|jjSr)rT�
gi_runningrrrrra�sz_GeneratorWrapper.gi_runningcCs|jjSr)rT�gi_yieldfromrrrrrb�sz_GeneratorWrapper.gi_yieldfromcCs
t|j�Sr)�nextrTrrrr�__next__�sz_GeneratorWrapper.__next__cCs|jr|jS|Sr)rWrTrrrr�__iter__�sz_GeneratorWrapper.__iter__N)rrrrFrYr[r^�propertyr_r`rarb�cr_code�cr_frame�
cr_running�cr_awaitrdre�	__await__rrrrrS�s&



rScs�t��std���jtkrft�dd�jtkrf�jj}|d@r@�S|d@rf�j}|j|jdBd��_�Sddl	}ddl
�|�����fd	d
��}|S)z2Convert regular generator function to a coroutine.z$types.coroutine() expects a callable�__code__Ni�� �)�co_flagsrcsR�||�}|jtks*|jtkr.|jjd@r.|St|�j�rNt|�j�sNt|�S|S)Nrn)	rU�
CoroutineTyperVr_ror(�	Generator�	CoroutinerS)�args�kwargs�coro��_collections_abc�funcrr�wrappeds

�
�
�zcoroutine.<locals>.wrapped)�callabler,rU�FunctionTyperD�CodeTyperlro�replace�	functoolsrw�wraps)rxro�cor~ryrrvr�	coroutine�s"
�r�cCs g|]}|dd�dkr|�qS)Nr�_r)�.0�nrrr�
<listcomp>(sr�)rNN)rN)9rA�sysrr)r{�
LambdaTyperlr|�__dict__�MappingProxyType�implementation�SimpleNamespacer
�CellTyperrVrrpr^r�AsyncGeneratorTyperr�
MethodTyper-�BuiltinFunctionType�append�BuiltinMethodType�objectrF�WrapperDescriptorType�__str__�MethodWrapperType�str�join�MethodDescriptorTyper6�ClassMethodDescriptorType�
ModuleTyper,�exc_info�tb�
TracebackType�tb_frame�	FrameType�GetSetDescriptorType�__globals__�MemberDescriptorTyper$rrr8r<rSr��globals�__all__rrrr�<module>s\













 :%4__pycache__/lzma.cpython-38.opt-1.pyc000064400000027364151153537600013330 0ustar00U

e5d�2�$@s�dZddddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$g$Zd%d&lZd%d&lZd%d&lZd%d'lTd%d(lmZmZd%d&lZd%Z	d)Z
d*ZGd+d�dej�Z
d2d&d-d&d&d&d&d&d.�d/d!�Zed-d&d&fd0d"�Zed&d&fd1d#�Zd&S)3aSInterface to the liblzma compression library.

This module provides a class for reading and writing compressed files,
classes for incremental (de)compression, and convenience functions for
one-shot (de)compression.

These classes and functions support both the XZ and legacy LZMA
container formats, as well as raw compressed data streams.
Z
CHECK_NONEZCHECK_CRC32ZCHECK_CRC64ZCHECK_SHA256ZCHECK_ID_MAXZ
CHECK_UNKNOWNZFILTER_LZMA1ZFILTER_LZMA2ZFILTER_DELTAZ
FILTER_X86ZFILTER_IA64Z
FILTER_ARMZFILTER_ARMTHUMBZFILTER_POWERPCZFILTER_SPARC�FORMAT_AUTO�	FORMAT_XZZFORMAT_ALONEZ
FORMAT_RAWZMF_HC3ZMF_HC4ZMF_BT2ZMF_BT3ZMF_BT4Z	MODE_FASTZMODE_NORMALZPRESET_DEFAULTZPRESET_EXTREME�LZMACompressor�LZMADecompressor�LZMAFile�	LZMAError�open�compress�
decompressZis_check_supported�N)�*)�_encode_filter_properties�_decode_filter_properties��c@s�eZdZdZd"ddddd�dd�Zdd	�Zed
d��Zdd
�Zdd�Z	dd�Z
dd�Zd#dd�Zd$dd�Z
d%dd�Zd&dd�Zdd�Zejfdd�Zd d!�ZdS)'ra@A file object providing transparent LZMA (de)compression.

    An LZMAFile can act as a wrapper for an existing file object, or
    refer directly to a named file on disk.

    Note that LZMAFile provides a *binary* file interface - data read
    is returned as bytes, and data to be written must be given as bytes.
    N�r�����format�check�preset�filtersc	Cs&d|_d|_t|_|dkrL|dkr*td��|dk	r:td��|dkrFt}t}n@|dkr~|dkr`t}t}t	||||d�|_
d	|_ntd
�|���t
|tttjf�r�d|kr�|d7}t�||�|_d|_||_n*t|d
�s�t|d�r�||_||_ntd��|jtk�r"tj|jtt||d�}t�|�|_dS)a�Open an LZMA-compressed file in binary mode.

        filename can be either an actual file name (given as a str,
        bytes, or PathLike object), in which case the named file is
        opened, or it can be an existing file object to read from or
        write to.

        mode can be "r" for reading (default), "w" for (over)writing,
        "x" for creating exclusively, or "a" for appending. These can
        equivalently be given as "rb", "wb", "xb" and "ab" respectively.

        format specifies the container format to use for the file.
        If mode is "r", this defaults to FORMAT_AUTO. Otherwise, the
        default is FORMAT_XZ.

        check specifies the integrity check to use. This argument can
        only be used when opening a file for writing. For FORMAT_XZ,
        the default is CHECK_CRC64. FORMAT_ALONE and FORMAT_RAW do not
        support integrity checks - for these formats, check must be
        omitted, or be CHECK_NONE.

        When opening a file for reading, the *preset* argument is not
        meaningful, and should be omitted. The *filters* argument should
        also be omitted, except when format is FORMAT_RAW (in which case
        it is required).

        When opening a file for writing, the settings used by the
        compressor can be specified either as a preset compression
        level (with the *preset* argument), or in detail as a custom
        filter chain (with the *filters* argument). For FORMAT_XZ and
        FORMAT_ALONE, the default is to use the PRESET_DEFAULT preset
        level. For FORMAT_RAW, the caller must always specify a filter
        chain; the raw compressor does not support preset compression
        levels.

        preset (if provided) should be an integer in the range 0-9,
        optionally OR-ed with the constant PRESET_EXTREME.

        filters (if provided) should be a sequence of dicts. Each dict
        should have an entry for "id" indicating ID of the filter, plus
        additional entries for options to the filter.
        NF)r�rbrzACannot specify an integrity check when opening a file for readingzICannot specify a preset compression level when opening a file for reading)�w�wb�aZab�xZxbrr
zInvalid mode: {!r}�bT�read�writez6filename must be a str, bytes, file or PathLike object)Ztrailing_errorrr)�_fp�_closefp�_MODE_CLOSED�_mode�
ValueErrorr�
_MODE_READr�_MODE_WRITEr�_compressor�_posr�
isinstance�str�bytes�os�PathLike�builtinsr�hasattr�	TypeError�_compressionZDecompressReaderrr�io�BufferedReader�_buffer)	�self�filename�moderrrrZ	mode_code�raw�r8�/usr/lib64/python3.8/lzma.py�__init__1sL,�
�zLZMAFile.__init__cCs�|jtkrdSzB|jtkr,|j��d|_n"|jtkrN|j�|j	�
��d|_	W5z|jrd|j��W5d|_d|_t|_XXdS)z�Flush and close the file.

        May be called more than once without error. Once the file is
        closed, any other operation on it will raise a ValueError.
        NF)r"r!rr �closer$r3r%rr&�flush�r4r8r8r9r;�s




zLZMAFile.closecCs
|jtkS)zTrue if this file is closed.)r"r!r=r8r8r9�closed�szLZMAFile.closedcCs|��|j��S)z3Return the file descriptor for the underlying file.)�_check_not_closedr�filenor=r8r8r9r@�szLZMAFile.filenocCs|��o|j��S)z)Return whether the file supports seeking.)�readabler3�seekabler=r8r8r9rB�szLZMAFile.seekablecCs|��|jtkS)z/Return whether the file was opened for reading.)r?r"r$r=r8r8r9rA�szLZMAFile.readablecCs|��|jtkS)z/Return whether the file was opened for writing.)r?r"r%r=r8r8r9�writable�szLZMAFile.writablecCs|��|j�|�S)z�Return buffered data without advancing the file position.

        Always returns at least one byte of data, unless at EOF.
        The exact number of bytes returned is unspecified.
        )�_check_can_readr3�peek�r4�sizer8r8r9rE�sz
LZMAFile.peekcCs|��|j�|�S)z�Read up to size uncompressed bytes from the file.

        If size is negative or omitted, read until EOF is reached.
        Returns b"" if the file is already at EOF.
        )rDr3rrFr8r8r9r�sz
LZMAFile.readcCs"|��|dkrtj}|j�|�S)z�Read up to size uncompressed bytes, while trying to avoid
        making multiple reads from the underlying stream. Reads up to a
        buffer's worth of data if size is negative.

        Returns b"" if the file is at EOF.
        r
)rDr1�DEFAULT_BUFFER_SIZEr3�read1rFr8r8r9rI�szLZMAFile.read1cCs|��|j�|�S)a
Read a line of uncompressed bytes from the file.

        The terminating newline (if present) is retained. If size is
        non-negative, no more than size bytes will be read (in which
        case the line may be incomplete). Returns b'' if already at EOF.
        )rDr3�readlinerFr8r8r9rJ�szLZMAFile.readlinecCs:|��|j�|�}|j�|�|jt|�7_t|�S)z�Write a bytes object to the file.

        Returns the number of uncompressed bytes written, which is
        always len(data). Note that due to buffering, the file on disk
        may not reflect the data written until close() is called.
        )Z_check_can_writer&rrrr'�len)r4�dataZ
compressedr8r8r9r�s
zLZMAFile.writecCs|��|j�||�S)a�Change the file position.

        The new position is specified by offset, relative to the
        position indicated by whence. Possible values for whence are:

            0: start of stream (default): offset must not be negative
            1: current stream position
            2: end of stream; offset must not be positive

        Returns the new file position.

        Note that seeking is emulated, so depending on the parameters,
        this operation may be extremely slow.
        )Z_check_can_seekr3�seek)r4�offset�whencer8r8r9rM�sz
LZMAFile.seekcCs"|��|jtkr|j��S|jS)z!Return the current file position.)r?r"r$r3�tellr'r=r8r8r9rP�s

z
LZMAFile.tell)Nr)r)r)r)r)�__name__�
__module__�__qualname__�__doc__r:r;�propertyr>r@rBrArCrErrIrJrr1�SEEK_SETrMrPr8r8r8r9r&s*	�U


	



rr)rrrr�encoding�errors�newlinecCs�d|kr d|krPtd|f��n0|dk	r0td��|dk	r@td��|dk	rPtd��|�dd�}	t||	||||d	�}
d|kr�t�|
|||�S|
SdS)
a�Open an LZMA-compressed file in binary or text mode.

    filename can be either an actual file name (given as a str, bytes,
    or PathLike object), in which case the named file is opened, or it
    can be an existing file object to read from or write to.

    The mode argument can be "r", "rb" (default), "w", "wb", "x", "xb",
    "a", or "ab" for binary mode, or "rt", "wt", "xt", or "at" for text
    mode.

    The format, check, preset and filters arguments specify the
    compression settings, as for LZMACompressor, LZMADecompressor and
    LZMAFile.

    For binary mode, this function is equivalent to the LZMAFile
    constructor: LZMAFile(filename, mode, ...). In this case, the
    encoding, errors and newline arguments must not be provided.

    For text mode, an LZMAFile object is created, and wrapped in an
    io.TextIOWrapper instance with the specified encoding, error
    handling behavior, and line ending(s).

    �trzInvalid mode: %rNz0Argument 'encoding' not supported in binary modez.Argument 'errors' not supported in binary modez/Argument 'newline' not supported in binary mode�r)r#�replacerr1�
TextIOWrapper)r5r6rrrrrWrXrYZlz_modeZbinary_filer8r8r9rs"
�cCs t||||�}|�|�|��S)z�Compress a block of data.

    Refer to LZMACompressor's docstring for a description of the
    optional arguments *format*, *check*, *preset* and *filters*.

    For incremental compression, use an LZMACompressor instead.
    )rrr<)rLrrrr�compr8r8r9r6scCspg}t|||�}z|�|�}Wn tk
r>|r8Yqfn�YnX|�|�|jsXtd��|j}|sqfqd�|�S)z�Decompress a block of data.

    Refer to LZMADecompressor's docstring for a description of the
    optional arguments *format*, *check* and *filters*.

    For incremental decompression, use an LZMADecompressor instead.
    zACompressed data ended before the end-of-stream marker was reached�)rr	r�append�eofZunused_data�join)rLrZmemlimitrZresultsZdecomp�resr8r8r9r	Bs
)r)rT�__all__r-r1r+Z_lzmarr
r0r!r$r%Z
BaseStreamrrrrrr	r8r8r8r9�<module>sv�
b�/__pycache__/_osx_support.cpython-38.pyc000064400000026513151153537600014165 0ustar00U

e5dU�@s�dZddlZddlZddlZddddgZdZdZd	Zd-d
d�Zd.d
d�Z	dd�Z
dadd�Zda
dd�Zdd�Zdd�Zdadd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d�Zd*d�Zd+d�Zd,d�ZdS)/zShared OS X support functions.�N�compiler_fixup�customize_config_vars�customize_compiler�get_platform_osx)
�CFLAGSZLDFLAGSZCPPFLAGSZ
BASECFLAGS�	BLDSHARED�LDSHARED�CC�CXXZ	PY_CFLAGSZ
PY_LDFLAGSZPY_CPPFLAGSZPY_CORE_CFLAGSZPY_CORE_LDFLAGS)rrr	r
Z_OSX_SUPPORT_INITIAL_cCs�|dkrtjd}|�tj�}tj�|�\}}tjdkrH|dkrH|d}tj�|�s�|D]&}tj�	||�}tj�|�rX|SqXdS|SdS)z�Tries to find 'executable' in the directories listed in 'path'.

    A string listing directories separated by 'os.pathsep'; defaults to
    os.environ['PATH'].  Returns the complete filename or None if not found.
    N�PATHZwin32z.exe)
�os�environ�split�pathsep�path�splitext�sys�platform�isfile�join)�
executabler�paths�baseZext�p�f�r�$/usr/lib64/python3.8/_osx_support.py�_find_executables

rFc
Cs�ddl}zddl}|��}Wn(tk
rDtdt��fd�}YnX|�|��P}|rfd||jf}nd||jf}t�	|�s�|�
��d���ndW5QR�SQRXdS)z0Output from successful command execution or NonerNz/tmp/_osx_support.%szw+bz
%s >'%s' 2>&1z%s 2>/dev/null >'%s'zutf-8)
�
contextlib�tempfileZNamedTemporaryFile�ImportError�openr�getpid�closing�name�system�read�decode�strip)Z
commandstringZcapture_stderrrr�fp�cmdrrr�_read_output7s��
r+cCst|�ptd|f�pdS)z0Find a build tool on current path or using xcrunz/usr/bin/xcrun -find %s�)rr+)Ztoolnamerrr�_find_build_toolMs
��r-cCsxtdkrtdaztd�}Wntk
r,YnHXzt�d|���}W5|��X|dk	rtd�|�d��	d�dd��atS)z*Return the OS X system version as a stringNr,z0/System/Library/CoreServices/SystemVersion.plistz=<key>ProductUserVisibleVersion</key>\s*<string>(.*?)</string>�.��)
�_SYSTEM_VERSIONr!�OSError�close�re�searchr&r�groupr)r�mrrr�_get_system_versionVs
�
r8cCsLtdkrHt�}|rHztdd�|�d�D��aWntk
rFdaYnXtS)z}
    Return the macOS system version as a tuple

    The return value is safe to use to compare
    two version numbers.
    Ncss|]}t|�VqdS�N��int��.0�irrr�	<genexpr>�sz,_get_system_version_tuple.<locals>.<genexpr>r.r)�_SYSTEM_VERSION_TUPLEr8�tupler�
ValueError�Zosx_versionrrr�_get_system_version_tupleus
rDcCs"t|�D]}|�t�r||=qdS)z-Remove original unmodified values for testingN)�list�
startswith�_INITPRE)�_config_vars�krrr�_remove_original_values�s
rJcCs8|�|d�}||kr,t||kr,||t|<|||<dS)z@Save modified and original unmodified value of configuration varr,N)�getrG)rH�cvZnewvalueZoldvaluerrr�_save_modified_value�srMcCs�tdk	rtStd|fd�}d}|��D]T}|�d�r<d}q(|�d�rLd}q(|r(|��}|dkrfdaq(|�d	�r(|dd
�aq(tdkr�datS)z= Returns the root of the default SDK for this system, or '/' Nz%s -c -E -v - </dev/nullTFz#include <...>zEnd of search listz/usr/include�/z.sdk/usr/includei�)�_cache_default_sysrootr+�
splitlinesrFr(�endswith)�cc�contentsZ
in_incdirs�linerrr�_default_sysroot�s$


rUcCst�}|rt|dk�SdS)z=Returns True if universal builds are supported on this system��
�F)rD�boolrCrrr�_supports_universal_builds�srZcCst�}|r|dkSdS)z9Returns True if arm64 builds are supported on this system)�rF)rDrCrrr�_supports_arm64_builds�sr\cCs�dtjkr|S|d��d}}t|�s4td�}n<tj�|��d�rptd|�	dd�f�}|rpd|krptd�}|s|t
d	��||kr�tD]L}||kr�|tjkr�||��}|d
kr�|n|d|d<t||d�
|��q�|S)
z7Find appropriate C compiler for extension module buildsr	rZclangZgccz'%s' --version�'�'"'"'zllvm-gcczCannot locate working compilerr
z++� )rr
rrr-r�basenamerFr+�replace�SystemError�_COMPILER_CONFIG_VARSrMr)rHrRZoldcc�datarLZcv_splitrrr�_find_appropriate_compiler�s,

��recCsVtD]L}||kr|tjkr||}tjdd|tjd�}t�dd|�}t|||�q|S)z5Remove all universal build arguments from config vars�
-arch\s+\w+\sr_)�flagsz-isysroot\s*\S+)�_UNIVERSAL_CONFIG_VARSrr
r4�sub�ASCIIrM)rHrLrgrrr�_remove_universal_flagssrkcCs�dtjkr|St�d|d�dk	r�t�d|d�dd�f�}|r�tD]8}||krF|tjkrF||}t�dd	|�}t|||�qF|S)
z-Remove any unsupported archs from config varsr	z-arch\s+ppcrNzNecho 'int main{};' | '%s' -c -arch ppc -x c -o /dev/null /dev/null 2>/dev/nullr]r^z-arch\s+ppc\w*\sr_)	rr
r4r5r%rarhrirM)rHZstatusrLrgrrr�_remove_unsupported_archss
��	rlcCsddtjkr`tjd}tD]F}||krd||kr||}t�dd|�}|d|}t|||�q|S)z2Allow override of all archs with ARCHFLAGS env var�	ARCHFLAGS�-archrfr_)rr
rhr4rirM)rHZarchrLrgrrr�_override_all_archs:s

rocCsx|�dd�}t�d|�}|dk	rt|�d�}tj�|�sttD]8}||kr:|tjkr:||}t�	dd|�}t
|||�q:|S)z+Remove references to any SDKs not availablerr,z-isysroot\s*(\S+)Nr/z-isysroot\s*\S+(?:\s|$)r_)rKr4r5r6rr�existsrhr
rirM)rH�cflagsr7ZsdkrLrgrrr�_check_for_unavailable_sdkKs
rrc
Cs�d}}t|�}t�s d}}nd|k}tdd�|D��}|sHdtjkr�z|�d�}|||d�=WqHtk
r|Yq�YqHXqHnFt�s�tt	t
|���D].}||dkr�||dd	kr�|||d�=q�dtjkr�|s�|tjd��}|�r@d
d�t|�D�}|�s
�q@|d}||d
k�r0|||d�=q�|||d�=q�d}|}dd�t|�D�}|�sv|}dd�t|�D�}|D]B}||d
k�r�||d}�q�n||t
d
�d�}�q��qz|�r�tj
�|��s�ddlm}	|	�d|�|	�d�|S)ae
    This function will strip '-isysroot PATH' and '-arch ARCH' from the
    compile flags if the user has specified one them in extra_compile_flags.

    This is needed because '-arch ARCH' adds another architecture to the
    build, without a way to remove an architecture. Furthermore GCC will
    barf if multiple '-isysroot' arguments are present.
    FTrncss|]}|�d�r|VqdS)�	-isysrootN�rF)r=�argrrrr?ys
z!compiler_fixup.<locals>.<genexpr>rmr0r/�arm64cSsg|]\}}|�d�r|�qS�rsrt�r=r>�xrrr�
<listcomp>�s
z"compiler_fixup.<locals>.<listcomp>rrsNcSsg|]\}}|�d�r|�qSrwrtrxrrrrz�s
cSsg|]\}}|�d�r|�qSrwrtrxrrrrz�s
)�logz4Compiling with an SDK that doesn't seem to exist: %sz$Please check your Xcode installation)rErZ�anyrr
�indexrBr\�reversed�range�lenr�	enumerater�isdirZ	distutilsr{�warn)
Zcompiler_soZcc_argsZ	stripArchZstripSysrootr}�idx�indicesZsysrootZargvarr{rrrrfsZ	


�
cCs"t�st|�t|�t|�|S)a�Customize Python build configuration variables.

    Called internally from sysconfig with a mutable mapping
    containing name/value pairs parsed from the configured
    makefile used to build this interpreter.  Returns
    the mapping updated as needed to reflect the environment
    in which the interpreter is running; in the case of
    a Python from a binary installer, the installed
    environment may be very different from the build
    environment, i.e. different OS levels, different
    built tools, different available CPU architectures.

    This customization is performed whenever
    distutils.sysconfig.get_config_vars() is first
    called.  It may be used in environments where no
    compilers are present, i.e. when installing pure
    Python dists.  Customization of compiler paths
    and detection of unavailable archs is deferred
    until the first extension module build is
    requested (in distutils.sysconfig.customize_compiler).

    Currently called from distutils.sysconfig
    )rZrkrorr�rHrrrr�s
cCst|�t|�t|�|S)z�Customize compiler path and configuration variables.

    This customization is performed when the first
    extension module build is requested
    in distutils.sysconfig.customize_compiler).
    )rerlror�rrrr�s	cCs�|�dd�}t�p|}|p|}|�r�|}d}|�td|�dd��}|r�z$tdd�|�d�dd	�D��}Wq�tk
r�d
}Yq�Xnd
}|dk�rFd|��k�rFd
}t�d|�}tt	t
|���}t|�dkr�|d}nj|dkr�d}n\|dkr�d
}nN|dk�rd}n>|dk�rd}n.|dk�r&d}n|dk�r6d}ntd|f��n<|dk�rbtj
dk�r�d}n |dk�r�tj
dk�r~d }nd!}|||fS)"z Filter values for get_platform()ZMACOSX_DEPLOYMENT_TARGETr,Zmacosxrcss|]}t|�VqdSr9r:r<rrrr?sz#get_platform_osx.<locals>.<genexpr>r.rr0)rWrrVrnZfatz
-arch\s+(\S+)r/)rv�x86_64Z
universal2)�i386�ppc)r�r�Zintel)r�r�r�Zfat3)�ppc64r�Zfat64)r�r�r�r�Z	universalz%Don't know machine value for archs=%rr�lr�)ZPowerPCZPower_Macintoshr�r�)rKr8rGrArrBr(r4�findall�sorted�setr�r�maxsize)rHZosname�release�machineZmacverZ
macreleaserqZarchsrrrr�sX



�$




�

)N)F)�__doc__rr4r�__all__rhrcrGrr+r-r1r8r@rDrJrMrOrUrZr\rerkrlrorrrrrrrrrr�<module>sB�


	

>(Q)__pycache__/imp.cpython-38.pyc000064400000023123151153537600012200 0ustar00U

e5d()�@s�dZddlmZmZmZmZmZmZmZm	Z	m
Z
zddlmZWnek
rXdZYnXddl
mZmZmZmZddlmZddlmZddlmZddlZddlZddlZddlZddlZddlZejd	ed
d�dZdZd
Z d
Z!dZ"dZ#dZ$dZ%dZ&dZ'dd�Z(dd�Z)dd�Z*d8dd�Z+dd�Z,dd�Z-Gd d!�d!�Z.Gd"d#�d#�Z/Gd$d%�d%e/ej0�Z1d9d&d'�Z2Gd(d)�d)e/e�Z3d:d*d+�Z4d,d-�Z5d.d/�Z6d;d0d1�Z7d2d3�Z8d4d5�Z9e�r�d<d6d7�Z:ndZ:dS)=z�This module provides the components needed to build your own __import__
function.  Undocumented functions are obsolete.

In most cases it is preferred you consider using the importlib module's
functionality over this module.

�)	�	lock_held�acquire_lock�release_lock�get_frozen_object�is_frozen_package�init_frozen�
is_builtin�	is_frozen�_fix_co_filename)�create_dynamicN)�_ERR_MSG�_exec�_load�_builtin_from_name)�SourcelessFileLoader)�	machinery)�utilzhthe imp module is deprecated in favour of importlib; see the module's documentation for alternative uses�)�
stacklevel��������	cCs
t�|�S)z_**DEPRECATED**

    Create a new module.

    The module is not entered into sys.modules.

    )�types�
ModuleType��name�r!�/usr/lib64/python3.8/imp.py�
new_module0sr#cCstjS)z@**DEPRECATED**

    Return the magic number for .pyc files.
    )r�MAGIC_NUMBERr!r!r!r"�	get_magic;sr%cCstjjS)z$Return the magic tag for .pyc files.)�sys�implementation�	cache_tagr!r!r!r"�get_tagCsr)c
Cs6t���$t�d�t�||�W5QR�SQRXdS)a�**DEPRECATED**

    Given the path to a .py file, return the path to its .pyc file.

    The .py file does not need to exist; this simply returns the path to the
    .pyc file calculated as if the .py file were imported.

    If debug_override is not None, then it must be a boolean and is used in
    place of sys.flags.optimize.

    If sys.implementation.cache_tag is None then NotImplementedError is raised.

    �ignoreN)�warnings�catch_warnings�simplefilterr�cache_from_source)�path�debug_overrider!r!r"r.Hs

r.cCs
t�|�S)a~**DEPRECATED**

    Given the path to a .pyc. file, return the path to its .py file.

    The .pyc file does not need to exist; this simply returns the path to
    the .py file calculated to correspond to the .pyc file.  If path does
    not conform to PEP 3147 format, ValueError will be raised. If
    sys.implementation.cache_tag is None then NotImplementedError is raised.

    )r�source_from_cache�r/r!r!r"r1[sr1cCs<dd�tjD�}dd�tjD�}dd�tjD�}|||S)�**DEPRECATED**cSsg|]}|dtf�qS��rb)�C_EXTENSION��.0�sr!r!r"�
<listcomp>ksz get_suffixes.<locals>.<listcomp>cSsg|]}|dtf�qS)�r)�	PY_SOURCEr7r!r!r"r:lscSsg|]}|dtf�qSr4)�PY_COMPILEDr7r!r!r"r:ms)r�EXTENSION_SUFFIXES�SOURCE_SUFFIXES�BYTECODE_SUFFIXES)�
extensions�source�bytecoder!r!r"�get_suffixesisrDc@s eZdZdZdd�Zdd�ZdS)�NullImporterz-**DEPRECATED**

    Null import object.

    cCs2|dkrtddd��ntj�|�r.td|d��dS)N�zempty pathnamer2zexisting directory)�ImportError�osr/�isdir)�selfr/r!r!r"�__init__zszNullImporter.__init__cCsdS)zAlways returns None.Nr!)rJ�fullnamer!r!r"�find_module�szNullImporter.find_moduleN)�__name__�
__module__�__qualname__�__doc__rKrMr!r!r!r"rErsrEcs.eZdZdZd�fdd�	Z�fdd�Z�ZS)�_HackedGetDatazMCompatibility support for 'file' arguments of various load_*()
    functions.Ncst��||�||_dS)N)�superrK�file)rJrLr/rT��	__class__r!r"rK�sz_HackedGetData.__init__c
s||jrl||jkrl|jjs0|j}d|jkr0|��|jjrJt|jd�|_}|�|��W5QR�SQRXnt��|�SdS)z;Gross hack to contort loader to deal w/ load_*()'s bad API.�br5N)	rTr/�closed�mode�close�open�readrS�get_data)rJr/rTrUr!r"r]�s
z_HackedGetData.get_data)N)rNrOrPrQrKr]�
__classcell__r!r!rUr"rR�srRc@seZdZdZdS)�_LoadSourceCompatibilityz5Compatibility support for implementing load_source().N�rNrOrPrQr!r!r!r"r_�sr_cCs\t|||�}tj|||d�}|tjkr8t|tj|�}nt|�}t�||�|_	|j	|j
_|S)N��loader)r_r�spec_from_file_locationr&�modulesr
rr�SourceFileLoader�
__loader__�__spec__rb�r �pathnamerTrb�spec�moduler!r!r"�load_source�s

rlc@seZdZdZdS)�_LoadCompiledCompatibilityz7Compatibility support for implementing load_compiled().Nr`r!r!r!r"rm�srmcCsZt|||�}tj|||d�}|tjkr8t|tj|�}nt|�}t||�|_|j|j	_
|S)r3ra)rmrrcr&rdr
rrrfrgrbrhr!r!r"�
load_compiled�s

rncCs�tj�|�rftjdd�tjdd�}|D]*}tj�|d|�}tj�|�r,|}qfq,td�	|���t
j||gd�}|tj
kr�t|tj
|�St|�SdS)r3NrKz{!r} is not a package)�submodule_search_locations)rHr/rIrr?r@�join�exists�
ValueError�formatrrcr&rdr
r)r r/rA�	extensionZ	init_pathrjr!r!r"�load_package�s ��
ruc	
Cs$|\}}}|r0|�d�r d|kr0td�|���n�|dkrX|tthkrXd�|�}t|��n�|tkrlt|||�S|tkr�t|||�S|tkr�tdk	r�|dkr�t	|d��}t|||�W5QR�SQRXnt|||�SnN|t
kr�t||�S|tk�r�t
|�S|tk�rt|�Sd�||�}t||d��dS)	z�**DEPRECATED**

    Load a module, given information returned by find_module().

    The module name must include the full package name, if any.

    )r;�U�+zinvalid file open mode {!r}Nz.file object required for import (type code {})r5z*Don't know how to import {} (type code {})r)�
startswithrrrsr<r=rlrnr6�load_dynamicr[�
PKG_DIRECTORYru�	C_BUILTIN�init_builtin�	PY_FROZENrrG)	r rT�filenameZdetails�suffixrY�type_�msgZopened_filer!r!r"�load_module�s.


 


r�c	Cs�t|t�std�t|����n$t|td�tf�sBtd�t|����|dkr�t|�rbddddtffSt	|�rzddddt
ffStj}|D]�}t
j�||�}dtjdfD]>}d|}t
j�||�}t
j�|�r�d|ddtffSq�t�D]2\}}}||}	t
j�||	�}t
j�|�r��q q�q��q:q�tt�|�|d��d}
d	|k�rnt|d
��}t�|j�d}
W5QRXt|||
d�}|||||ffS)a,**DEPRECATED**

    Search for a module.

    If path is omitted or None, search for a built-in, frozen or special
    module and continue search in sys.path. The module name cannot
    contain '.'; to search for a submodule of a package, pass the
    submodule name and the package's __path__.

    z'name' must be a str, not {}Nz%'path' must be None or a list, not {}rFz.pyrrKrrWr5)�encoding)�
isinstance�str�	TypeErrorrs�type�list�RuntimeErrorrr{r	r}r&r/rHrprr@�isfilerzrDrGrr[�tokenize�detect_encoding�readline)r r/�entryZpackage_directoryrZpackage_file_nameZ	file_pathrYr��	file_namer�rTr!r!r"rM�sB
�
rMcCs
t�|�S)zw**DEPRECATED**

    Reload the module and return it.

    The module must have been successfully imported before.

    )�	importlib�reload)rkr!r!r"r�2sr�cCs&z
t|�WStk
r YdSXdS)zl**DEPRECATED**

    Load and return a built-in module by name, or None is such module doesn't
    exist
    N)rrGrr!r!r"r|=s
r|cCs0ddl}|j�||�}|jj|||d�}t|�S)z:**DEPRECATED**

        Load an extension module.
        rN)r rb�origin)�importlib.machineryr�ExtensionFileLoader�
ModuleSpecr)r r/rTr�rbrjr!r!r"ryJs�ry)N)N)N)N)N);rQ�_imprrrrrrrr	r
rrGZimportlib._bootstraprr
rrZimportlib._bootstrap_externalrr�rrrHr&r�rr+�warn�DeprecationWarningZSEARCH_ERRORr<r=r6ZPY_RESOURCErzr{r}ZPY_CODERESOURCEZIMP_HOOKr#r%r)r.r1rDrErRrer_rlrmrnrur�rMr�r|ryr!r!r!r"�<module>sb,
�
	

#
4__pycache__/numbers.cpython-38.pyc000064400000027654151153537600013103 0ustar00U

e5d(�@s�dZddlmZmZdddddgZGdd�ded	�ZGd
d�de�Ze�e�Gdd�de�Z	e	�e
�Gdd�de	�ZGd
d�de�Ze�e
�dS)z~Abstract Base Classes (ABCs) for numbers, according to PEP 3141.

TODO: Fill out more detailed documentation on the operators.�)�ABCMeta�abstractmethod�Number�Complex�Real�Rational�Integralc@seZdZdZdZdZdS)rz�All numbers inherit from this class.

    If you just want to check if an argument x is a number, without
    caring what kind, use isinstance(x, Number).
    �N)�__name__�
__module__�__qualname__�__doc__�	__slots__�__hash__r	r	r	�/usr/lib64/python3.8/numbers.pyrs)�	metaclassc@s�eZdZdZdZedd��Zdd�Zeedd���Z	eed	d
���Z
edd��Zed
d��Zedd��Z
edd��Zdd�Zdd�Zedd��Zedd��Zedd��Zedd��Zedd ��Zed!d"��Zed#d$��Zed%d&��Zed'd(��Zd)S)*rabComplex defines the operations that work on the builtin complex type.

    In short, those are: a conversion to complex, .real, .imag, +, -,
    *, /, abs(), .conjugate, ==, and !=.

    If it is given heterogeneous arguments, and doesn't have special
    knowledge about them, it should fall back to the builtin complex
    type as described below.
    r	cCsdS)z<Return a builtin complex instance. Called for complex(self).Nr	��selfr	r	r�__complex__-szComplex.__complex__cCs|dkS)z)True if self != 0. Called for bool(self).rr	rr	r	r�__bool__1szComplex.__bool__cCst�dS)zXRetrieve the real component of this number.

        This should subclass Real.
        N��NotImplementedErrorrr	r	r�real5szComplex.realcCst�dS)z]Retrieve the imaginary component of this number.

        This should subclass Real.
        Nrrr	r	r�imag>szComplex.imagcCst�dS)zself + otherNr�r�otherr	r	r�__add__GszComplex.__add__cCst�dS)zother + selfNrrr	r	r�__radd__LszComplex.__radd__cCst�dS)z-selfNrrr	r	r�__neg__QszComplex.__neg__cCst�dS)z+selfNrrr	r	r�__pos__VszComplex.__pos__cCs
||S)zself - otherr	rr	r	r�__sub__[szComplex.__sub__cCs
||S)zother - selfr	rr	r	r�__rsub___szComplex.__rsub__cCst�dS)zself * otherNrrr	r	r�__mul__cszComplex.__mul__cCst�dS)zother * selfNrrr	r	r�__rmul__hszComplex.__rmul__cCst�dS)z5self / other: Should promote to float when necessary.Nrrr	r	r�__truediv__mszComplex.__truediv__cCst�dS)zother / selfNrrr	r	r�__rtruediv__rszComplex.__rtruediv__cCst�dS)zBself**exponent; should promote to float or complex when necessary.Nr)r�exponentr	r	r�__pow__wszComplex.__pow__cCst�dS)zbase ** selfNr)r�baser	r	r�__rpow__|szComplex.__rpow__cCst�dS)z7Returns the Real distance from 0. Called for abs(self).Nrrr	r	r�__abs__�szComplex.__abs__cCst�dS)z$(x+y*i).conjugate() returns (x-y*i).Nrrr	r	r�	conjugate�szComplex.conjugatecCst�dS)z
self == otherNrrr	r	r�__eq__�szComplex.__eq__N)r
rrr
rrrr�propertyrrrrrrr r!r"r#r$r%r'r)r*r+r,r	r	r	rr sN













c@s�eZdZdZdZedd��Zedd��Zedd��Zed	d
��Z	ed&dd
��Z
dd�Zdd�Zedd��Z
edd��Zedd��Zedd��Zedd��Zedd��Zdd�Zed d!��Zed"d#��Zd$d%�ZdS)'rz�To Complex, Real adds the operations that work on real numbers.

    In short, those are: a conversion to float, trunc(), divmod,
    %, <, <=, >, and >=.

    Real also provides defaults for the derived operations.
    r	cCst�dS)zTAny Real can be converted to a native float object.

        Called for float(self).Nrrr	r	r�	__float__�szReal.__float__cCst�dS)aGtrunc(self): Truncates self to an Integral.

        Returns an Integral i such that:
          * i>0 iff self>0;
          * abs(i) <= abs(self);
          * for any Integral j satisfying the first two conditions,
            abs(i) >= abs(j) [i.e. i has "maximal" abs among those].
        i.e. "truncate towards 0".
        Nrrr	r	r�	__trunc__�szReal.__trunc__cCst�dS)z$Finds the greatest Integral <= self.Nrrr	r	r�	__floor__�szReal.__floor__cCst�dS)z!Finds the least Integral >= self.Nrrr	r	r�__ceil__�sz
Real.__ceil__NcCst�dS)z�Rounds self to ndigits decimal places, defaulting to 0.

        If ndigits is omitted or None, returns an Integral, otherwise
        returns a Real. Rounds half toward even.
        Nr)rZndigitsr	r	r�	__round__�szReal.__round__cCs||||fS)z�divmod(self, other): The pair (self // other, self % other).

        Sometimes this can be computed faster than the pair of
        operations.
        r	rr	r	r�
__divmod__�szReal.__divmod__cCs||||fS)z�divmod(other, self): The pair (self // other, self % other).

        Sometimes this can be computed faster than the pair of
        operations.
        r	rr	r	r�__rdivmod__�szReal.__rdivmod__cCst�dS)z)self // other: The floor() of self/other.Nrrr	r	r�__floordiv__�szReal.__floordiv__cCst�dS)z)other // self: The floor() of other/self.Nrrr	r	r�
__rfloordiv__�szReal.__rfloordiv__cCst�dS)zself % otherNrrr	r	r�__mod__�szReal.__mod__cCst�dS)zother % selfNrrr	r	r�__rmod__�sz
Real.__rmod__cCst�dS)zRself < other

        < on Reals defines a total ordering, except perhaps for NaN.Nrrr	r	r�__lt__�szReal.__lt__cCst�dS)z
self <= otherNrrr	r	r�__le__�szReal.__le__cCstt|��S)z(complex(self) == complex(float(self), 0))�complex�floatrr	r	rr�szReal.__complex__cCs|
S)z&Real numbers are their real component.r	rr	r	rr�sz	Real.realcCsdS)z)Real numbers have no imaginary component.rr	rr	r	rr�sz	Real.imagcCs|
S)zConjugate is a no-op for Reals.r	rr	r	rr+szReal.conjugate)N)r
rrr
rrr.r/r0r1r2r3r4r5r6r7r8r9r:rr-rrr+r	r	r	rr�s@











c@s<eZdZdZdZeedd���Zeedd���Zdd�Z	d	S)
rz6.numerator and .denominator should be in lowest terms.r	cCst�dS�Nrrr	r	r�	numeratorszRational.numeratorcCst�dSr=rrr	r	r�denominatorszRational.denominatorcCs|j|jS)afloat(self) = self.numerator / self.denominator

        It's important that this conversion use the integer's "true"
        division rather than casting one side to float before dividing
        so that ratios of huge integers convert without overflowing.

        )r>r?rr	r	rr.szRational.__float__N)
r
rrr
rr-rr>r?r.r	r	r	rrsc@s�eZdZdZdZedd��Zdd�Zed&dd	��Zed
d��Z	edd
��Z
edd��Zedd��Zedd��Z
edd��Zedd��Zedd��Zedd��Zedd��Zedd��Zd d!�Zed"d#��Zed$d%��ZdS)'rz@Integral adds a conversion to int and the bit-string operations.r	cCst�dS)z	int(self)Nrrr	r	r�__int__+szIntegral.__int__cCst|�S)z6Called whenever an index is needed, such as in slicing)�intrr	r	r�	__index__0szIntegral.__index__NcCst�dS)a4self ** exponent % modulus, but maybe faster.

        Accept the modulus argument if you want to support the
        3-argument version of pow(). Raise a TypeError if exponent < 0
        or any argument isn't Integral. Otherwise, just implement the
        2-argument version described in Complex.
        Nr)rr&�modulusr	r	rr'4s	zIntegral.__pow__cCst�dS)z
self << otherNrrr	r	r�
__lshift__?szIntegral.__lshift__cCst�dS)z
other << selfNrrr	r	r�__rlshift__DszIntegral.__rlshift__cCst�dS)z
self >> otherNrrr	r	r�
__rshift__IszIntegral.__rshift__cCst�dS)z
other >> selfNrrr	r	r�__rrshift__NszIntegral.__rrshift__cCst�dS)zself & otherNrrr	r	r�__and__SszIntegral.__and__cCst�dS)zother & selfNrrr	r	r�__rand__XszIntegral.__rand__cCst�dS)zself ^ otherNrrr	r	r�__xor__]szIntegral.__xor__cCst�dS)zother ^ selfNrrr	r	r�__rxor__bszIntegral.__rxor__cCst�dS)zself | otherNrrr	r	r�__or__gszIntegral.__or__cCst�dS)zother | selfNrrr	r	r�__ror__lszIntegral.__ror__cCst�dS)z~selfNrrr	r	r�
__invert__qszIntegral.__invert__cCstt|��S)zfloat(self) == float(int(self)))r<rArr	r	rr.wszIntegral.__float__cCs|
S)z"Integers are their own numerators.r	rr	r	rr>{szIntegral.numeratorcCsdS)z!Integers have a denominator of 1.�r	rr	r	rr?�szIntegral.denominator)N)r
rrr
rrr@rBr'rDrErFrGrHrIrJrKrLrMrNr.r-r>r?r	r	r	rr&sD













N)r
�abcrr�__all__rr�registerr;rr<rrrAr	r	r	r�<module>sp
u
___pycache__/py_compile.cpython-38.opt-2.pyc000064400000007100151153537600014510 0ustar00U

&�.e �@s�ddlZddlZddlZddlZddlZddlZddlZddlZddddgZ	Gdd�de
�ZGdd�dej�Z
dd	�Zddd�Zdd
d�Zedkr�e�e��dS)�N�compile�main�PyCompileError�PycInvalidationModec@seZdZddd�Zdd�ZdS)r�cCst|j}|tkr2d�t�||��}|�dd|�}nd||f}t�||pJ||||�||_||_	||_
|pl||_dS)NrzFile "<string>"z	File "%s"z
Sorry: %s: %s)�__name__�SyntaxError�join�	traceback�format_exception_only�replace�	Exception�__init__�
exc_type_name�	exc_value�file�msg)�self�exc_typerrrr�tbtext�errmsg�r�"/usr/lib64/python3.8/py_compile.pyr.s�zPyCompileError.__init__cCs|jS)N)r)rrrr�__str__>szPyCompileError.__str__N)r)r�
__module__�__qualname__rrrrrrrs
c@seZdZdZdZdZdS)r���N)rrr�	TIMESTAMP�CHECKED_HASH�UNCHECKED_HASHrrrrrBscCs(tj�d�rtj�d�stjStjSdS)N�SOURCE_DATE_EPOCH�RPM_BUILD_ROOT)�os�environ�getrr rrrrr�_get_default_invalidation_modeHs

�r'F���c
Cs�|dkrt�}|dkrL|dkr@|dkr*|nd}tjj||d�}ntj�|�}tj�|�rld}t|�|���n*tj�	|�r�tj�
|�s�d}t|�|���tj�d|�}	|	�
|�}
z|	j|
|p�||d�}Wndtk
�r*}zDt|j||p�|�}
|d	k�r|�r|
�ntj�|
jd
�WY�dSd}~XYnXz tj�|�}|�rJt�|�Wntk
�rbYnX|tjk�r�|	�|�}tj�||d|d�}n"tj�|
�}tj�|||tjk�}tj� |�}tj�!|||�|S)
Nrrr)�optimizationzc{} is a symlink and will be changed into a regular file if import writes a byte-compiled file to itzk{} is a non-regular file and will be changed into a regular one if import writes a byte-compiled file to itz<py_compile>)�	_optimizer�
�mtime�size)"r'�	importlib�util�cache_from_sourcer$�path�islink�FileExistsError�format�exists�isfile�	machinery�SourceFileLoader�get_data�source_to_coder
r�	__class__�sys�stderr�writer�dirname�makedirsrr�
path_stats�_bootstrap_external�_code_to_timestamp_pyc�source_hash�_code_to_hash_pycr �
_calc_mode�
_write_atomic)r�cfile�dfile�doraise�optimize�invalidation_mode�quietr)r�loader�source_bytes�code�err�py_excr?�source_stats�bytecoderD�moderrrrPsd-�
�


��cCs|dkrtjdd�}d}|dgkr�tj��}|s4q�|�d�}zt|dd�Wq$tk
r�}zd}tj�d|j	�W5d}~XYq$t
k
r�}zd}tj�d|�W5d}~XYq$Xq$nV|D]P}zt|dd�Wq�tk
�r}zd}tj�d|j	�W5d}~XYq�Xq�|S)Nrr�-r+T)rJz%s
)r<�argv�stdin�readline�rstriprrr=r>r�OSError)�args�rv�filename�errorrrrr�s.


"&&�__main__)NNFr(Nr)N)�enumZimportlib._bootstrap_externalr.�importlib.machinery�importlib.utilr$Zos.pathr<r
�__all__r
r�Enumrr'rrr�exitrrrr�<module>s$0�
a
&__pycache__/sre_parse.cpython-38.pyc000064400000052221151153537600013377 0ustar00U

e5d&��@s�dZddlTdZdZed�Zed�Zed�Zed�Zed	�Z	ee
eh�Zee
eeeeeh�Zeed
�feed�feed�feed
�feed�feed�feed�feed�fd�Zeefeefeefeeefgfeeefgfeeefgfeeefgfeeefgfeeefgfee fd�
Z!e"e#e$e%e&e'e(e)d�Z*e'e#Be)BZ+e,e(BZ-Gdd�de.�Z/Gdd�d�Z0Gdd�d�Z1Gdd�d�Z2dd�Z3dd �Z4d!d"�Z5d#d$�Z6d3d&d'�Z7d(d)�Z8d*d+�Z9d4d-d.�Z:d/d0�Z;d1d2�Z<d,S)5zInternal support module for sre�)�*z.\[{()*+?^$|z*+?{�
0123456789Z01234567Z0123456789abcdefABCDEFZ4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZz 	

����
�
�	��\)z\a�\bz\fz\nz\rz\tz\vz\\)
z\Arz\Bz\dz\Dz\sz\Sz\wz\Wz\Z)�i�L�m�s�x�a�t�uc@seZdZdS)�VerboseN)�__name__�
__module__�__qualname__�rr�!/usr/lib64/python3.8/sre_parse.pyrGsrc@sBeZdZdd�Zedd��Zddd�Zdd	�Zd
d�Zdd
�Z	dS)�StatecCsd|_i|_dg|_d|_dS)Nr)�flags�	groupdict�groupwidths�lookbehindgroups��selfrrr�__init__LszState.__init__cCs
t|j�S�N)�lenrr rrr�groupsQszState.groupsNcCsb|j}|j�d�|jtkr$td��|dk	r^|j�|d�}|dk	rTtd|||f��||j|<|S)Nztoo many groupsz7redefinition of group name %r as group %d; was group %d)r%r�append�	MAXGROUPS�errorr�get)r!�name�gid�ogidrrr�	opengroupTs
�
zState.opengroupcCs|��|j|<dSr#)�getwidthr)r!r+�prrr�
closegroup`szState.closegroupcCs||jko|j|dk	Sr#)r%r)r!r+rrr�
checkgroupbszState.checkgroupcCs6|jdk	r2|�|�s|�d��||jkr2|�d��dS)N�cannot refer to an open groupz?cannot refer to group defined in the same lookbehind subpattern)rr1r()r!r+�sourcerrr�checklookbehindgroupes




zState.checklookbehindgroup)N)
rrrr"�propertyr%r-r0r1r4rrrrrJs

rc@s`eZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�ZdS)�
SubPatternNcCs"||_|dkrg}||_d|_dSr#)�state�data�width)r!r7r8rrrr"os
zSubPattern.__init__rcCs�d}ttf}|jD�]t\}}t|dt|�dd�|tkrlt�|D]"\}}t|ddt|�|�qFq|tkr�t�t|d�D]*\}}|r�t|dd�|�|d�q�q|t	k�r|\}}	}
td|�|	�|d�|
�r�t|dd�|
�|d�qt
||��r~d}|D]T}t
|t��rJ|�s6t�|�|d�d}n"|�s\td	dd�t|dd�d}�q|�s�t�qtd|�qdS)
NTz  �)�end��OR�ELSEF� )�tuple�listr8�print�str�IN�BRANCH�	enumerate�dump�GROUPREF_EXISTS�
isinstancer6)r!�level�nl�seqtypes�op�avrr
�	condgroup�item_yes�item_norrrrGvsH


zSubPattern.dumpcCs
t|j�Sr#)�reprr8r rrr�__repr__�szSubPattern.__repr__cCs
t|j�Sr#)r$r8r rrr�__len__�szSubPattern.__len__cCs|j|=dSr#�r8�r!�indexrrr�__delitem__�szSubPattern.__delitem__cCs&t|t�rt|j|j|�S|j|Sr#)rI�slicer6r7r8rVrrr�__getitem__�s
zSubPattern.__getitem__cCs||j|<dSr#rU�r!rW�coderrr�__setitem__�szSubPattern.__setitem__cCs|j�||�dSr#)r8�insertr[rrrr^�szSubPattern.insertcCs|j�|�dSr#)r8r&)r!r\rrrr&�szSubPattern.appendc	Cs�|jdk	r|jSd}}|jD�]�\}}|tkr|td}d}|dD]$}|��\}}t||�}t||�}qD||}||}q|tkr�|��\}}||}||}q|tkr�|d��\}}||}||}q|t	k�r|d��\}}|||d}|||d}q|t
k�r$|d}|d}q|tk�rP|jj
|\}}||}||}q|tk�r�|d��\}}|ddk	�r�|d��\}}t||�}t||�}nd}||}||}q|tkr�q�qt|td�t|t�f|_|jS)Nrr<����)r9r8rE�	MAXREPEATr.�min�max�CALL�
SUBPATTERN�_REPEATCODES�
_UNITCODES�GROUPREFr7rrH�SUCCESS)	r!�lo�hirMrNr
�j�l�hrrrr.�sZ












zSubPattern.getwidth)N)r)
rrrr"rGrSrTrXrZr]r^r&r.rrrrr6ms

(r6c@sbeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Ze	d
d��Z
dd�Zdd�Zddd�Z
dS)�	TokenizercCs@t|t�|_||_|js"t|d�}||_d|_d|_|��dS)N�latin1r)rIrC�istext�string�decoded_stringrW�next�_Tokenizer__next)r!rrrrrr"�s
zTokenizer.__init__cCs�|j}z|j|}Wntk
r0d|_YdSX|dkr�|d7}z||j|7}Wn.tk
r�td|jt|j�d�d�YnX|d|_||_dS)Nrr<zbad escape (end of pattern))rWrs�
IndexErrorrtr(rrr$)r!rW�charrrr�__next�s&��
zTokenizer.__nextcCs||jkr|��dSdS)NTF�rtru)r!rwrrr�match�s
zTokenizer.matchcCs|j}|��|Sr#ry)r!�thisrrrr)�sz
Tokenizer.getcCs8d}t|�D]&}|j}||kr"q4||7}|��q|S�Nr:)�rangertru)r!�n�charset�result�_�crrr�getwhiles
zTokenizer.getwhilecCsld}|j}|��|dkr@|s,|�d|��|�d|t|���||kr^|sh|�d|d��qh||7}q|S)Nr:zmissing zmissing %s, unterminated namer<)rtrur(r$)r!�
terminatorr*r�r�rrr�getuntils
�
zTokenizer.getuntilcCs|jt|jpd�Sr|�rWr$rtr rrr�possz
Tokenizer.poscCs|jt|jpd�Sr|r�r rrr�tellszTokenizer.tellcCs||_|��dSr#)rWrurVrrr�seek szTokenizer.seekrcCst||j|��|�Sr#)r(rrr�)r!�msg�offsetrrrr($szTokenizer.errorN)r)rrrr"rurzr)r�r�r5r�r�r�r(rrrrro�s		
roc	Cs�t�|�}|r|St�|�}|r0|dtkr0|S�zJ|dd�}|dkr�||�dt�7}t|�dkrx|�d|t|���tt	|dd�d�fWS|dkr�|j
r�||�dt�7}t|�d	kr�|�d|t|���tt	|dd�d�fWS|d
k�rN|j
�rN||�dt�7}t|�dk�r*|�d|t|���t	|dd�d�}t|�t|fWS|d
k�r�|j
�r�ddl}|�
d��s~|�d��|�dd�}zt|�|��}Wn2tk
�r�|�d|t|�td���YnXt|fWS|tk�r.||�dt�7}t	|dd�d�}|dk�r$|�d|t|���t|fWS|tk�r<t�t|�dk�rz|tk�rh|�d|t|���tt|d�fWSWntk
�r�YnX|�d|t|���dS)Nrr<r`r��incomplete escape %s�r��U��
�N�{�	missing {�}�character name�undefined character name %r�\N{}��.octal escape value %s outside of range 0-0o377�
bad escape %s)�ESCAPESr)�
CATEGORIESrDr��	HEXDIGITSr$r(�LITERAL�intrq�chr�unicodedatarzr��ord�lookup�KeyError�	OCTDIGITS�DIGITS�
ValueError�ASCIILETTERS)r3�escaper\r�r��charnamerrr�
_class_escape'sp




�



��


r�c	Csft�|�}|r|St�|�}|r$|S�z|dd�}|dkr�||�dt�7}t|�dkrl|�d|t|���tt|dd�d�fWS|dkr�|j	r�||�dt�7}t|�dkr�|�d|t|���tt|dd�d�fWS|d	k�rB|j	�rB||�d
t�7}t|�dk�r|�d|t|���t|dd�d�}t
|�t|fWS|dk�r�|j	�r�d
dl}|�d��sr|�d��|�
dd�}zt|�|��}Wn2tk
�r�|�d|t|�td���YnXt|fWS|dk�r||�dt�7}tt|dd�d
�fWS|tk�r�|jtk�r�||��7}|dtk�r�|dtk�r�|jtk�r�||��7}t|dd�d
�}|dk�r�|�d|t|���t|fWSt|dd��}||jk�r�|�|��s�|�dt|���|�||�t|fWS|�d|t|�d��t|�dk�r4|tk�r"|�d|t|���tt|d�fWSWntk
�rLYnX|�d|t|���dS)Nr<r`rr�r�r�rr�r�r�r�r�rr�r�r�r�r�r��0r�r�r2�invalid group reference %dr�)r�r)r�r�r�r$r(r�r�rqr�r�rzr�r�r�r�r�r�rtr%r1r4rhr�r�)r3r�r7r\r�r�r��grouprrr�_escapecs�




�



�
��
�

r�cCstt�|��Sr#)rA�dict�fromkeys)�itemsrrr�_uniq�sr�cCsVg}|j}|j}|��}|t||||d|o2|��|d�sqDqt|�dkrX|dSt|�}d}	|D].}
|
stq�|	dkr�|
d}	qh|
d|	krhq�qh|D]
}
|
d=q�|�|	�q`q�q`g}|D]h}
t|
�dkr��q@|
d\}}
|tkr�|�||
f�q�|tk�r"|
ddtk	�r"|�	|
�q��q@q�|�tt
|�f�|S|�td|ff�|S)Nr<�|r)r&rzr��_parser$r6r�rD�NEGATE�extendr�rE)r3r7�verbose�nestedr��itemsappend�sourcematch�start�
subpattern�prefix�item�setrMrNrrr�
_parse_sub�sN
�

r�Fc/
Cs�t|�}|j}|j}|j}t}	t}
|j}|dkr4�q*|dkr@�q*|�|rx|tkrTq"|dkrx|�}|dksv|dkr\q"q\q"|ddkr�t|||�}||�q"|t	kr�|t
|
|�f�q"|dk�r�|��d}
g}|j}|jdk�rddl}|j
d|��t|d	d
�|d�}|�}|dk�r0|�d|��|
��|d
k�rF|�rF�qbn�|ddk�r`t||�}n~|�r�|dk�r�|j|k�r�ddl}|j
d|dk�r�dn|dk�r�dn|dk�r�dnd|��dft|d	d
�t
|
|�f}|d��r<|�}|dk�r|�d|��|
��|d
k�rL|dtk�r0|dd}||�|t
|
d�f��qb|ddk�rft||�}n>|dk�r�ddl}|j
d|��dt|d	d
�t
|
|�f}|dt
k�s�|dt
k�r�d||f}|�|t|�dt|���|d}|d}||k�r*d||f}|�|t|�dt|���|t||ff�n"|dtk�rV|dd}||��qt|�}|	|�dk�r�|ddt
k�r�|�r�|t|ddf�n||d�n"|�r�|�dtdf�|t|f�q"|tk�r.|��}
|dk�rd\}}�nB|dk�rdt}}�n*|dk�r0dt}}�n|dk�r4|jdk�rX|t
|
|�f�q"dt}}d }}|jtk�r�||�7}�qj|d!��r�|jtk�r�||�7}�q�n|}|d��s�|t
|
|�f�|�|
�q"|�r�t|�}|tk�r�td"��|�rBt|�}|tk�rtd"��||k�rB|�d#|��|
��ntd$|f��|�rV|d%d�}nd}|�rr|ddtk�r�|�d&|��|
t|���|ddtk�r�|�d'|��|
t|���|ddt k�r�|dd\}}}}|dk�r�|�s�|�s�|}|d��rt!|||ff|d%<nt"|||ff|d%<q"|d(k�rF|t#df�q"|d)k�r�|��d} d*}d}!d}d}|d��r|�}|dk�r�|�d+��|d,k�r�|d-��r�|�$d.d/�}!|!�%��s�d0|!}|�|t|!�d��n�|d1��r�|�$d2d/�}!|!�%��sd0|!}|�|t|!�d��|j&�|!�}"|"dk�rFd3|!}|�|t|!�d��|�'|"��sf|�d4t|!�d��|�(|"|�|t)|"f�q"n2|�}|dk�r�|�d+��|�d5|t|�d���nd|d6k�r�d}�nR|dk�r|jdk�r�|�d7|��| ��|�d2k�r�q"�q�q"�n|d8k�r�d}#|d-k�r||�}|dk�r>|�d+��|d9k�r`|�d:|t|�d��d%}#|j*}$|$dk�r||j+|_*t,||||d�}|#dk�r�|$dk�r�d|_*|d2��s�|�d;|��| ��|d1k�r�|t-|#|ff�q"|t.|#|ff�q"�n$|d)k�
rj|�$d2d/�}%|%�%��	rL|j&�|%�}&|&dk�	r�d3|%}|�|t|%�d��n�zt|%�}&|&dk�	rdt/�Wn4t/k
�	r�d0|%}|�|t|%�d�d�YnX|&�	s�|�d<t|%�d��|&t0k�	r�d=|&}|�|t|%�d��|�(|&|�t1||||d�}'|�d>��
r0t1||||d�}(|jd>k�
r4|�d?��nd}(|�d2��
sT|�d;|��| ��|t2|&|'|(ff�q"n�|t3k�
s~|dk�rt4|||�})|)dk�
r�|�
r�|�
r�ddl}|j
d@|j5ddA�t|j5�dAk�
r�dBnd ft6|d	d
�|j7t8@r"|s"t9�q"|)\}}d}n|�dC|t|�d��|dk	�rrz|�:|!�}Wn<tk
�rp}*z|�|*j;t|!�d�d�W5d}*~*XYnX|�s�|t8@�o�|t8@}+t,|||+|d�}|�d2��s�|�d;|��| ��|dk	�r�|�<||�|t ||||ff�q"|dk�r|tt=f�q"|dDk�r|tt>f�q"tdE|f��q"t?t|��ddd%�D]N},||,\}-}.|-t k�r@|.\}}}}|dk�r@|�s@|�s@|||,|,d�<�q@|S)FNz|)�#rrr�[r<z"Possible nested set at position %dr�)�
stacklevel�^zunterminated character set�]z-&~|zPossible set %s at position %d�-�
difference�&�intersection�~zsymmetric difference�unionz&Possible set difference at position %dr`zbad character range %s-%s�?)rr<r�+r�r�r:�,z"the repetition number is too largez"min repeat greater than max repeatzunsupported quantifier %rr_znothing to repeatzmultiple repeat�.�(Tzunexpected end of pattern�P�<�>�
group name�bad character in group name %r�=�)�unknown group name %rr2zunknown extension ?P�:zmissing ), unterminated commentz=!<z=!zunknown extension ?<z"missing ), unterminated subpatternzbad group numberr�r�z/conditional backref with more than two branchesz-Flags not at the start of the expression %r%s�z (truncated)zunknown extension ?�$z unsupported special character %r)@r6r&r)rzr$r�rt�
WHITESPACEr��
SPECIAL_CHARSr�r��warnings�warn�
FutureWarningr(r�rD�RANGEr��NOT_LITERALr^r��REPEAT_CHARSrar�r�r��
OverflowError�AssertionError�ATrfre�
MIN_REPEAT�
MAX_REPEAT�ANYr��isidentifierrr1r4rhrr%r��ASSERT�
ASSERT_NOTr�r'r�rH�FLAGS�_parse_flagsrr�DeprecationWarningr�SRE_FLAG_VERBOSErr-r�r0�AT_BEGINNING�AT_ENDr})/r3r7r�r��firstr��subpatternappend�	sourcegetr��_len�_ordr{r\�herer��	setappendr��negate�code1�that�code2r�rjrkrbrcrwr�r��	add_flags�	del_flagsr/r�r*r+�dirr�condnamerOrPrQr�err�sub_verboser
rMrNrrrr��s|


�

�
��	


�


��
 












���












�



�


�






�




�





�

�
��

�
*�
�



r�cCs|j}d}d}|dkr�t|}|jr<|dkrRd}|�|��n|dkrRd}|�|��||O}|t@r||t@|kr|d}|�|��|�}|dkr�|�d��|d	kr�q�|tkr|��r�d
nd}|�|t|���q|dkr�|j|O_dS|t@r�|�dd
��|dk�r�|�}|dk�r|�d��|tk�rF|���r2d
nd}|�|t|���t|}|t@�rfd}|�|��||O}|�}|dk�r�|�d��|dk�r��q�|tk�rF|���r�d
nd}|�|t|����qF|dk�s�t	�|t@�r�|�dd
��||@�r|�dd
��||fS)Nrr�rz8bad inline flags: cannot use 'L' flag with a str patternrz:bad inline flags: cannot use 'u' flag with a bytes patternz9bad inline flags: flags 'a', 'u' and 'L' are incompatiblezmissing -, : or )z)-:zunknown flagr�z,bad inline flags: cannot turn on global flagr<zmissing flagz8bad inline flags: cannot turn off flags 'a', 'u' and 'L'z	missing :r�z-bad inline flags: cannot turn off global flagz(bad inline flags: flag turned on and off)
r)r�rqr(�
TYPE_FLAGS�isalphar$r�GLOBAL_FLAGSr�)r3r7rwr�rr�flagr�rrrr�]sn














r�cCsjt|t�r>|t@rtd��|t@s,|tO}qf|t@rftd��n(|t@rNtd��|t@rf|t@rftd��|S)Nz)cannot use LOCALE flag with a str patternz(ASCII and UNICODE flags are incompatiblez,cannot use UNICODE flag with a bytes patternz'ASCII and LOCALE flags are incompatible)rIrC�SRE_FLAG_LOCALEr��SRE_FLAG_ASCII�SRE_FLAG_UNICODE)�srcrrrr�	fix_flags�s


rNcCs�t|�}|dkrt�}||_||_zt|||t@d�}WnBtk
rzt�}|tB|_||_|�d�t||dd�}YnXt||j	j�|j	_|j
dk	r�|j
dks�t�|�d��|t
@r�|��|S)NrTr�zunbalanced parenthesis)rorrrCr�r�rr�rr7rtr�r(�SRE_FLAG_DEBUGrG)rCrr7r3r/rrr�parse�s(



rcs�t|���j}g�g�g��j}�����fdd�}�j}|�}|dkrL�q�|ddk�r�|d}|dk�rJd}��d�s���d	����d
d�}|��r�z||}	Wn tk
r�t	d|��YnXnlzt
|�}	|	dkr�t�Wn0tk
�r��d
|t|�d�d�YnX|	t
k�r4��d|	t|�d��||	t|�d��q�|dk�r��jtk�r�||�7}�jtk�r�||�7}|tt
|dd�d�d@���q�|tk�rZd}
�jtk�r4||�7}|tk�r4|dtk�r4�jtk�r4||�7}d}
t
|dd�d�}|dk�r(��d|t|���|t|��|
�s�|t
|dd��t|�d�nRztt|d�}Wn4tk
�r�|tk�r���d|t|���YnX||�q:||�q:��rΈ�d����t|t��s�dd��D����fS)NcsX|�jkr��d||���r8��d�����dd�=��t��|f���d�dS)Nr�r:)r%r(r&�joinr$)rWr��r%�literal�literalsrr7rr�addgroup�s

z parse_template.<locals>.addgrouprrr<�gr:r�z	missing <r�r�r�r�r�r�r�r�Fr`Tr�r�cSs"g|]}|dkrdn|�d��qS)Nzlatin-1)�encode)�.0rrrr�
<listcomp>sz"parse_template.<locals>.<listcomp>)ror)r&�
groupindexrzr(r�r�r�rvr�r�r$r'rtr�r�r�r�r�rrIrC)r3r7�sget�lappendrrr{r�r*rW�isoctalrrr�parse_template�s�




��


�


"

�

�� 


rcCsv|j}|jdd�}|\}}|dd�}z"|D]\}}||�p@|||<q.Wn tk
rjtd|��YnX|�|�S)Nrr�)r�rrrvr(r)�templaterzr�emptyr%rrWr�rrr�expand_templatesr")F)rN)=�__doc__�
sre_constantsr�r��	frozensetr�r�r�r�r�r�r�rfr�r�rDr�r��CATEGORYrgr�r�r�ZAT_BEGINNING_STRINGZAT_BOUNDARYZAT_NON_BOUNDARYZCATEGORY_DIGITZCATEGORY_NOT_DIGITZCATEGORY_SPACEZCATEGORY_NOT_SPACEZ
CATEGORY_WORDZCATEGORY_NOT_WORDZ
AT_END_STRINGr��SRE_FLAG_IGNORECASEr�SRE_FLAG_MULTILINE�SRE_FLAG_DOTALLr�r�SRE_FLAG_TEMPLATEr
r�rrr	�	Exceptionrrr6ror�r�r�r�r�r�rrrr"rrrr�<module>sr







���
#rH<M:
r<
 U__pycache__/crypt.cpython-38.opt-2.pyc000064400000005247151153537600013523 0ustar00U

e5d�@s,ddlZzddlZWn0ek
rDejdkr8ed��ned��YnXddlZddlm	Z
ddlmZ
ejejdZe
�ZGdd	�d	e
d	d
��Zd%dd�dd
�Zd&dd�ZgZdd�dd�Zedddd�edddd�dD](Zeddeddee�dd�r��qq�eddd d!�ed"dd#d$�[[dS)'�NZwin32z,The crypt module is not supported on Windowsz;The required _crypt module was not built as part of CPython)�SystemRandom)�
namedtuplez./c@seZdZdd�ZdS)�_MethodcCsd�|j�S)Nz<crypt.METHOD_{}>)�format�name)�self�r�/usr/lib64/python3.8/crypt.py�__repr__sz_Method.__repr__N)�__name__�
__module__�__qualname__r
rrrr	rsrz name ident salt_chars total_size��roundscCsB|dkrtd}|dk	r4t|t�s4t|jj�d���|js@d}nd|j�d�}|jr�|jddkr�|dkrpd}n@t�|d�}|d|>kr�td��d	|kr�d
ks�ntd��||d�d�7}n^|jd
k�r|dk	�r d|kr�dks�ntd��|d|�d�7}n|dk	�r t|�d���|d�	dd�t
|j�D��7}|S)Nrz+ object cannot be interpreted as an integer��$�2��zrounds must be a power of 2��z%rounds out of the range 2**4 to 2**31Z02d)�5�6i�i�ɚ;z+rounds out of the range 1000 to 999_999_999zrounds=z$ doesn't support the rounds argumentcss|]}t�t�VqdS�N)�_srZchoice�
_saltchars)�.0�charrrr	�	<genexpr>Aszmksalt.<locals>.<genexpr>)�methods�
isinstance�int�	TypeError�	__class__rZident�
bit_length�
ValueError�join�rangeZ
salt_chars)�methodr�sZ
log_roundsrrr	�mksalts2

r*cCs&|dkst|t�rt|�}t�||�Sr)r rr*�_crypt�crypt)Zword�saltrrr	r,Es
r,cGsVt|f|��}|t�d|<t||d�}td|�}|rRt|�|jkrRt�|�dSdS)NZMETHOD_rrTF)r�globalsr*r,�lenZ
total_sizer�append)rr�argsr(r-�resultrrr	�_add_methodWs

r3ZSHA512r��jZSHA256r�?)�b�y�arZBLOWFISHr��;ZMD5�1��"ZCRYPT��
)N)N)�sys�_sysr+�ModuleNotFoundError�platform�ImportError�stringZ_stringZrandomrZ
_SystemRandom�collectionsrZ_namedtupleZ
ascii_lettersZdigitsrrrr*r,rr3Z_vr/rrrr	�<module>s0

	&

__pycache__/asyncore.cpython-38.opt-1.pyc000064400000037236151153537600014207 0ustar00U

e5d~N�@shdZddlZddlZddlZddlZddlZddlZddlmZm	Z	m
Z
mZmZm
Z
mZmZmZmZmZmZmZeee
eeeeh�ZzeWnek
r�iZYnXdd�ZGdd�de�ZeeefZdd	�Zd
d�Z dd
�Z!dd�Z"d&dd�Z#d'dd�Z$e$Z%d(dd�Z&Gdd�d�Z'Gdd�de'�Z(dd�Z)d)dd �Z*ej+d!k�rdGd"d#�d#�Z,Gd$d%�d%e'�Z-dS)*a�Basic infrastructure for asynchronous socket service clients and servers.

There are only two ways to have a program on a single processor do "more
than one thing at a time".  Multi-threaded programming is the simplest and
most popular way to do it, but there is another very different technique,
that lets you have nearly all the advantages of multi-threading, without
actually using multiple threads. it's really only practical if your program
is largely I/O bound. If your program is CPU bound, then pre-emptive
scheduled threads are probably what you really need. Network servers are
rarely CPU-bound, however.

If your operating system supports the select() system call in its I/O
library (and nearly all do), then you can use it to juggle multiple
communication channels at once; doing other work while your I/O is taking
place in the "background."  Although this strategy can seem strange and
complex, especially at first, it is in many ways easier to understand and
control than multi-threaded programming. The module documented here solves
many of the difficult problems for you, making the task of building
sophisticated high-performance network servers and clients a snap.
�N)
�EALREADY�EINPROGRESS�EWOULDBLOCK�
ECONNRESET�EINVAL�ENOTCONN�	ESHUTDOWN�EISCONN�EBADF�ECONNABORTED�EPIPE�EAGAIN�	errorcodec
CsHzt�|�WStttfk
rB|tkr6t|YSd|YSXdS)NzUnknown error %s)�os�strerror�
ValueError�
OverflowError�	NameErrorr)�err�r� /usr/lib64/python3.8/asyncore.py�	_strerrorDsrc@seZdZdS)�ExitNowN)�__name__�
__module__�__qualname__rrrrrLsrcCs:z|��Wn(tk
r"�Yn|��YnXdS�N)�handle_read_event�_reraised_exceptions�handle_error��objrrr�readQsr"cCs:z|��Wn(tk
r"�Yn|��YnXdSr)�handle_write_eventrrr rrr�writeYsr$cCs:z|��Wn(tk
r"�Yn|��YnXdSr)�handle_expt_eventrrr rrr�
_exceptionasr&c
Cs�zX|tj@r|��|tj@r&|��|tj@r8|��|tjtjBtj	B@rV|�
�Wnhtk
r�}z$|jdt
kr�|��n|�
�W5d}~XYn(tk
r��Yn|��YnXdS�Nr)�select�POLLINr�POLLOUTr#�POLLPRIr%ZPOLLHUPZPOLLERRZPOLLNVAL�handle_close�OSError�args�
_DISCONNECTEDrr)r!�flags�errr�	readwriteis"



r2�c	Cs<|dkrt}|�r8g}g}g}t|���D]L\}}|��}|��}|rP|�|�|rd|jsd|�|�|sl|r*|�|�q*g|kr�|kr�|kr�nnt�|�dSt	�	||||�\}}}|D] }|�
|�}|dkr�q�t|�q�|D]"}|�
|�}|dk�rq�t|�q�|D]&}|�
|�}|dk�r,�qt
|��qdSr)�
socket_map�list�items�readable�writable�append�	accepting�time�sleepr(�getr"r$r&)	�timeout�map�r�wr1�fdr!Zis_rZis_wrrr�poll}sD


"







rCcCs�|dkrt}|dk	r t|d�}t��}|r�t|���D]L\}}d}|��r\|tjtjBO}|�	�rt|j
st|tjO}|r8|�||�q8|�|�}|D]&\}}|�
|�}|dkr�q�t||�q�dS)Ni�r)r4�intr(rCr5r6r7r)r+r8r:r*�registerr=r2)r>r?ZpollsterrBr!r0r@rrr�poll2�s(


rF�>@FcCsb|dkrt}|r ttd�r t}nt}|dkr>|r^|||�q,n |r^|dkr^|||�|d}q>dS)NrCr�)r4�hasattrr(rFrC)r>Zuse_pollr?�countZpoll_funrrr�loop�s
rKc@s2eZdZdZdZdZdZdZdZe	dh�Z
dAdd�Zdd�ZdBdd	�Z
dCd
d�Zejejfdd
�ZdDdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�ZdEd'd(�Zd)d*�Z d+d,�Z!d-d.�Z"d/d0�Z#d1d2�Z$d3d4�Z%d5d6�Z&d7d8�Z'd9d:�Z(d;d<�Z)d=d>�Z*d?d@�Z+dS)F�
dispatcherFN�warningc
Cs�|dkrt|_n||_d|_|r�|�d�|�||�d|_z|��|_Wq�tk
r�}z*|j	dt
tfkrvd|_n|�|��W5d}~XYq�Xnd|_
dS�NrTF)r4�_map�_fileno�setblocking�
set_socket�	connectedZgetpeername�addrr-r.rr�del_channel�socket)�self�sockr?rrrr�__init__�s 

zdispatcher.__init__cCs�|jjd|jjg}|jr.|jr.|�d�n|jr>|�d�|jdk	r�z|�d|j�Wn$tk
r�|�t|j��YnXdd�	|�t
|�fS)N�.Z	listeningrSz%s:%dz<%s at %#x>� )�	__class__rrr:rTr9rS�	TypeError�repr�join�id)rWZstatusrrr�__repr__�s

zdispatcher.__repr__cCs|dkr|j}|||j<dSr)rOrP)rWr?rrr�add_channel	szdispatcher.add_channelcCs,|j}|dkr|j}||kr"||=d|_dSr)rPrO)rWr?rBrrrrUszdispatcher.del_channelcCs.||f|_t�||�}|�d�|�|�dSr')Zfamily_and_typerVrQrR)rWZfamily�typerXrrr�
create_sockets

zdispatcher.create_socketcCs||_|��|_|�|�dSr)rV�filenorPrb�rWrXr?rrrrRs
zdispatcher.set_socketcCsDz*|j�tjtj|j�tjtj�dB�Wntk
r>YnXdS)NrH)rVZ
setsockopt�
SOL_SOCKETZSO_REUSEADDR�
getsockoptr-�rWrrr�set_reuse_addr#s
���zdispatcher.set_reuse_addrcCsdS�NTrrirrrr74szdispatcher.readablecCsdSrkrrirrrr87szdispatcher.writablecCs(d|_tjdkr|dkrd}|j�|�S)NT�nt�)r:r�namerV�listen)rWZnumrrrro>szdispatcher.listencCs||_|j�|�Sr)rTrV�bind)rWrTrrrrpDszdispatcher.bindcCspd|_d|_|j�|�}|tttfks8|tkrBtj	dkrB||_
dS|dtfkr^||_
|��nt
|t|��dS)NFTrlr)rS�
connectingrVZ
connect_exrrrrrrnrTr	�handle_connect_eventr-r)rWZaddressrrrr�connectHs��
zdispatcher.connectc
Csvz|j��\}}WnVtk
r(YdStk
rh}z$|jdtttfkrVWY�
dS�W5d}~XYn
X||fSdSr')rV�acceptr]r-r.rrr
)rWZconnrT�whyrrrrtVs
zdispatcher.acceptc
Cstz|j�|�}|WStk
rn}z>|jdtkr<WY�*dS|jdtkr\|��WY�
dS�W5d}~XYnXdSr')rV�sendr-r.rr/r,)rW�data�resultrurrrrvds

zdispatcher.sendc
Csrz(|j�|�}|s |��WdS|WSWnDtk
rl}z&|jdtkrZ|��WY�
dS�W5d}~XYnXdS)N�r)rV�recvr,r-r.r/)rWZbuffer_sizerwrurrrrzqs

zdispatcher.recvc
Csnd|_d|_d|_|��|jdk	rjz|j��Wn6tk
rh}z|jdtt	fkrX�W5d}~XYnXdS)NFr)
rSr:rqrUrV�closer-r.rr
)rWrurrrr{�s
zdispatcher.closecCstj�dt|��dS)Nzlog: %s
)�sys�stderrr$�str)rW�messagerrr�log�szdispatcher.log�infocCs||jkrtd||f�dS)Nz%s: %s)�ignore_log_types�print)rWrrcrrr�log_info�s
zdispatcher.log_infocCs:|jr|��n&|js.|jr$|��|��n|��dSr)r:�
handle_acceptrSrqrr�handle_readrirrrr�s

zdispatcher.handle_read_eventcCs@|j�tjtj�}|dkr(t|t|���|��d|_d|_dSrN)	rVrhrg�SO_ERRORr-r�handle_connectrSrq�rWrrrrrr�szdispatcher.handle_connect_eventcCs*|jr
dS|js|jr|��|��dSr)r:rSrqrr�handle_writerirrrr#�szdispatcher.handle_write_eventcCs0|j�tjtj�}|dkr$|��n|��dSr')rVrhrgr�r,�handle_exptr�rrrr%�s
zdispatcher.handle_expt_eventcCsXt�\}}}}zt|�}Wndt|�}YnX|�d||||fd�|��dS)Nz)<__repr__(self) failed for object at %0x>z:uncaptured python exception, closing channel %s (%s:%s %s)�error)�compact_tracebackr^r`r�r,)rWZnil�t�v�tbinfoZ	self_reprrrrr�s��	zdispatcher.handle_errorcCs|�dd�dS)Nz!unhandled incoming priority eventrM�r�rirrrr��szdispatcher.handle_exptcCs|�dd�dS)Nzunhandled read eventrMr�rirrrr��szdispatcher.handle_readcCs|�dd�dS)Nzunhandled write eventrMr�rirrrr��szdispatcher.handle_writecCs|�dd�dS)Nzunhandled connect eventrMr�rirrrr��szdispatcher.handle_connectcCs|��}|dk	r|j|�dSr)rt�handle_accepted)rWZpairrrrr��szdispatcher.handle_acceptcCs|��|�dd�dS)Nzunhandled accepted eventrM)r{r�)rWrXrTrrrr��szdispatcher.handle_acceptedcCs|�dd�|��dS)Nzunhandled close eventrM)r�r{rirrrr,�szdispatcher.handle_close)NN)N)N)N)r�),rrr�debugrSr:rq�closingrT�	frozensetr�rYrarbrUrVZAF_INETZSOCK_STREAMrdrRrjr7r8rorprsrtrvrzr{r�r�rrrr#r%rr�r�r�r�r�r�r,rrrrrL�sJ

 

	


rLc@s6eZdZddd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�dispatcher_with_sendNcCst�|||�d|_dS)Nry)rLrY�
out_bufferrfrrrrY�szdispatcher_with_send.__init__cCs.d}t�||jdd��}|j|d�|_dS)Nri)rLrvr�)rWZnum_sentrrr�
initiate_sendsz"dispatcher_with_send.initiate_sendcCs|��dSr)r�rirrrr�sz!dispatcher_with_send.handle_writecCs|jpt|j�Sr)rS�lenr�rirrrr8szdispatcher_with_send.writablecCs0|jr|�dt|��|j||_|��dS)Nz
sending %s)r�r�r^r�r�)rWrwrrrrvszdispatcher_with_send.send)NN)rrrrYr�r�r8rvrrrrr��s

r�cCs�t��\}}}g}|std��|rL|�|jjj|jjjt|j	�f�|j
}q~|d\}}}d�dd�|D��}|||f|||fS)Nztraceback does not exist���r[cSsg|]}d|�qS)z
[%s|%s|%s]r)�.0�xrrr�
<listcomp>&sz%compact_traceback.<locals>.<listcomp>)r|�exc_info�AssertionErrorr9�tb_frame�f_code�co_filename�co_namer~�	tb_lineno�tb_nextr_)r�r��tbr��fileZfunction�liner�rrrr�s�r�cCs�|dkrt}t|���D]n}z|��Wqtk
r`}z|jdtkrJn|sP�W5d}~XYqtk
rt�Yq|s��YqXq|��dSr')	r4r5�valuesr{r-r.r
r�clear)r?Z
ignore_allr�rrr�	close_all)s 
r��posixc@sNeZdZdd�Zdd�Zdd�Zdd�Zdd
d�ZeZeZ	dd
�Z
dd�Zd	S)�file_wrappercCst�|�|_dSr)r�duprB�rWrBrrrrYNszfile_wrapper.__init__cCs*|jdkrtjd|t|d�|��dS)Nrzunclosed file %r)�source)rB�warnings�warn�ResourceWarningr{rirrr�__del__Qs

�zfile_wrapper.__del__cGstj|jf|��Sr)rr"rB�rWr.rrrrzWszfile_wrapper.recvcGstj|jf|��Sr)rr$rBr�rrrrvZszfile_wrapper.sendNcCs(|tjkr|tjkr|sdStd��dS)Nrz-Only asyncore specific behaviour implemented.)rVrgr��NotImplementedError)rW�levelZoptnameZbuflenrrrrh]s
��zfile_wrapper.getsockoptcCs(|jdkrdS|j}d|_t�|�dS)Nrr�)rBrr{r�rrrr{hs

zfile_wrapper.closecCs|jSr)rBrirrrreoszfile_wrapper.fileno)N)rrrrYr�rzrvrhr"r$r{rerrrrr�Is
r�c@seZdZddd�Zdd�ZdS)�file_dispatcherNcCsPt�|d|�d|_z|��}Wntk
r4YnX|�|�t�|d�dS)NTF)rLrYrSre�AttributeError�set_filer�set_blocking)rWrBr?rrrrYts
zfile_dispatcher.__init__cCs"t|�|_|j��|_|��dSr)r�rVrerPrbr�rrrr�s
zfile_dispatcher.set_file)N)rrrrYr�rrrrr�rs
r�)r3N)r3N)rGFNN)NF).�__doc__r(rVr|r;r�r�errnorrrrrrrr	r
rrr
rr�r/r4rr�	Exceptionr�KeyboardInterrupt�
SystemExitrr"r$r&r2rCrFZpoll3rKrLr�r�r�rnr�r�rrrr�<module>sD<�


'

*
)__pycache__/sre_compile.cpython-38.opt-2.pyc000064400000034250151153537600014657 0ustar00U

e5dGh�@sddlZddlZddlTeehZeeehZ	e
ehZe
ehZeeehBZdZdd�eD�Zejfdd�Zdd	�Zd
d�Zd+dd
�ZejdZde>dZdZeefdd�Zdd�Z dd�Z!dd�Z"dd�Z#dd�Z$dd�Z%dd �Z&d!d"�Z'd#d$�Z(d%d&�Z)d'd(�Z*d,d)d*�Z+dS)-�N)�*))�ii1)�si)�i�)iEi�i�)i�i�)i�i�)i�i�)i�i�)i�i�)i�i�)i�i�)i�i�)i�i�)i�i�)iai�)i�i�cs.i|]&}|D]��t�fdd�|D���qqS)c3s|]}�|kr|VqdS�N�)�.0�j��ir�#/usr/lib64/python3.8/sre_compile.py�	<genexpr>>sz<dictcomp>.<genexpr>)�tuple)r�trr
r�
<dictcomp>>s
�rcCs ||@r||M}||B|@Srr)�flags�	add_flags�	del_flags�
TYPE_FLAGSrrr�_combine_flagsAs
rcCs�|j}t}t}t}t}t}d}	d}
d}|t@r\|t@s\|t@rPt	j
}	t	j}
t}nt	j
}	t	j}
|D�]|\}}
||k�rr|t@s�||�||
�n�|t@r�|t|�||
�n�|	|
�s�||�||
�n�|
|
�}|s�|t|�||�n�||k�r|t|�||�nh|t�||�}|d�|tk�r2|t�|f||D]}|t�||��q@|t�||�|||<q`|tk�rt|
|	|
|�\}}|t@�r�|t@�r�|t�n(|�s�|t�n|�s�|t�n|t�||�}|d�t|||�||�|||<q`|tk�r*|t@�r |t�n|t�q`||k�r6|t@�rLt d|f��t!|
d��r�|t"k�rn|t#�n|t$�||�}|d�||
d�||
d�t%||
d|�|t&�||�|||<nl|t'�||�}|d�||
d�||
d�t%||
d|�||�|||<|t"k�r,|t(�n|t)�q`|t*k�r�|
\}}}}|�rj|t+�||dd�t%||t,|||��|�r�|t+�||ddd�q`||k�r�||�q`||k�rD||�||�}|d�|
ddk�r�|d�n*|
d�-�\}}||k�rt d��||�t%||
d|�|t&�||�|||<q`|t.k�r�||�||�}|d�t%||
|�|t&�||�|||<q`|t/k�r�||�|t0@�r�t1�2|
|
�}
|t@�r�t3�2|
|
�}
n|t@�r�t4�2|
|
�}
||
�q`|t5k�r�||�g}|j}|
dD]N}
||�}|d�t%||
|�|t6�|||��|d�||�|||<�q|t�|D]}||�|||<�qlq`|t7k�r�||�|t@�r�t8|
}
n|t@�r�t9|
}
||
�q`|t:k�r |t@�s�||�n,|t@�r�|t;�n|�s
|t<�n|t=�||
d�q`|t>k�r�||�||
dd�||�}|d�t%||
d|�|
d�r�|t6�||�}|d�||�|d||<t%||
d|�||�|||<n||�|d||<q`t d|f��q`dS)Nrz*internal: unsupported template operator %r��z(look-behind requires fixed-width patternz%internal: unsupported operand type %r)?�append�len�_LITERAL_CODES�_REPEATING_CODES�_SUCCESS_CODES�
_ASSERT_CODES�SRE_FLAG_IGNORECASE�SRE_FLAG_LOCALE�SRE_FLAG_UNICODE�_sre�unicode_iscased�unicode_tolower�_ignorecase_fixes�
ascii_iscased�
ascii_tolower�OP_LOCALE_IGNORE�	OP_IGNORE�OP_UNICODE_IGNORE�
IN_UNI_IGNORE�NOT_LITERAL�NEGATE�LITERAL�FAILURE�IN�_optimize_charset�
IN_LOC_IGNORE�	IN_IGNORE�_compile_charset�ANY�SRE_FLAG_DOTALL�ANY_ALL�SRE_FLAG_TEMPLATE�error�_simple�
MAX_REPEAT�
REPEAT_ONE�MIN_REPEAT_ONE�_compile�SUCCESS�REPEAT�	MAX_UNTIL�	MIN_UNTIL�
SUBPATTERN�MARKr�getwidth�CALL�AT�SRE_FLAG_MULTILINE�AT_MULTILINE�get�	AT_LOCALE�
AT_UNICODE�BRANCH�JUMP�CATEGORY�	CH_LOCALE�
CH_UNICODE�GROUPREF�GROUPREF_LOC_IGNORE�GROUPREF_IGNORE�GROUPREF_UNI_IGNORE�GROUPREF_EXISTS)�code�patternr�emit�_len�
LITERAL_CODES�REPEATING_CODES�
SUCCESS_CODES�ASSERT_CODES�iscased�tolower�fixes�op�av�lo�skip�k�charset�hascased�grouprr�p�hi�tail�
tailappend�skipyes�skipnorrrr=GsV
















































r=cCs�|j}|D]�\}}||�|tkr$q
|tkr6||�q
|tksF|tkr`||d�||d�q
|tkrt|�|�q
|tkr�|�|�q
|tkr�|t	@r�|t
|�q�|t@r�|t|�q�||�q
t
d|f��q
|t�dS)Nrrz%internal: unsupported set operator %r)rr,r-�RANGE�RANGE_UNI_IGNORE�CHARSET�extend�
BIGCHARSETrNrrOr rPr8r.)rfrrVrXrarbrrrr3�s,

r3c	Cs�g}g}td�}d}|D�]�\}}	�z,|tkr�|rv||	�}
d||
<|rd|
|krd||
D]}d||<qV|s~||	�r~d}nd||	<n�|tk�r&t|	d|	dd�}|�r|r�t||�D]*}
d||
<|
|kr�||
D]}d||<q�q�nt||�D]}
d||
<q�|�s$tt||��}n|D]}
d||
<�qn(|tk�r@|�||	f�n|�||	f�WnZtk
�r�t	|�dk�r�|dd7}Yq"|�r�d}|tk�r�t
}|�||	f�YnXqq"qg}d}|�d|�}|dk�rԐq(t	|�dk�r�d}�q(|�d|�}|dk�r|�|t	|�f��q(|�||f��q�|dk	�r�|D]>\}}||dk�r\|�t|f�n|�t||dff��q6||7}|�s�t	|�t	|�k�r�||fS||fSt	|�dk�r�t|�}|�t
|f�||7}||fSt|�}i}td�}d}t�}tdd	d�D]V}
||
|
d�}||k�r4||||
d<n$|||
d<||<|d7}||7}�qt|�}|gt|�|dd�<|�t|f�||7}||fS)
N�FrTr�i�ri)�	bytearrayr-ro�range�map�anyr,r�
IndexErrorrrp�find�
_mk_bitmaprq�bytes�_bytes_to_codesrs)rfr^�fixupr`�outrk�charmaprgrarbrcre�rr�runs�qri�data�comps�mapping�block�chunkrrrr0s�









r0�rs0111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111cs8|�t�ddd�����fdd�tt��d��D�S)N���cs"g|]}��|�|�d��qS)rr)rr��	_CODEBITS�_int�srr�
<listcomp>�s�z_mk_bitmap.<locals>.<listcomp>r)�	translate�_BITS_TRANSrwr)�bitsr�r�rr�rr|�s�r|cCst|��d�}|��S)N�I)�
memoryview�cast�tolist)�b�arrrr~�sr~cCsDt|�dkrdS|d\}}|tkr<|ddko:t|d�S|tkS)NrFrr�)rrBr9�_UNIT_CODES)rirarbrrrr9�sr9cCsndgt|�}tdt|��D]L}||d}||||kr\|dkrNd||<q||d}q,|d||<q|S)Nrr)rrw)�prefix�tabler�idxrrr�_generate_overlap_table�s	r�cCs$|t@sdS|t@rtjStjSdSr)rr r!r"r%)rrrr�_get_iscased�s
r�cCs�g}|j}d}t|�}|jD]�\}}|tkrF|r<||�r<q�||�q|tkr�|\}}	}
}t||	|
�}|t@rz|t@rzq�t||�\}
}}|dkr�|dk	r�t	|�}n|dk	r�t	|�|}|�
|
�|s�q�qq�q||dfS||dfS)NTF)rr�r�r-rBrrr�_get_literal_prefixrrr)rWrr��prefixappend�prefix_skipr^rarbrhrrri�flags1�prefix1�prefix_skip1�got_allrrrr��s4



r�cCsd|js
dS|jd\}}|tk	r"qP|\}}}}t|||�}|t@r|t@rdSqt|�}|tkrz|rp||�rpdS||fgS|tkr�g}|j}	|dD]B}
|
s�dS|
d\}}|tkr�|r�||�s�|	||f�q�dSq�|S|t	k�r`|}|�r\|D]f\}}|tk�r||��rZdSq�|t
kr�|ddk�r4dStt|t
|d|dd���r�dSq�|SdS)Nrri��)r�rBrrrr�r-rLrr/roryrxrw)rWrrarbrhrrr^rf�
charsetappendrirrr�_get_charset_prefix�sN



 r�c
Csr|��\}}|tkrt}|dkr8|�tdd||g�dSg}d}g}|t@rT|t@srt||�\}}}|srt||�}|j}	|	t�t	|�}
|	d�d}|r�t
}|dkr�|r�|tB}n|r�|tB}|	|�|tkr�|	|�n|	t�|dt�}|	t
|t��|�r@|	t	|��|dk�rt	|�}|	|�|�|�|�t|��n|�r^t|�\}}t|||�t	|�|
||
<dS)Nr�)rD�MAXCODErr�INFOrrr�r�rr�SRE_INFO_PREFIX�SRE_INFO_LITERAL�SRE_INFO_CHARSET�minr�r0r3)
rVrWrrcrjr�r�rfr�rXrd�maskrgrrr�
_compile_infosR




r�cCst|ttf�Sr)�
isinstance�strr})�objrrr�isstringSsr�cCs8|jj|B}g}t|||�t||j|�|�t�|Sr)�staterr�r=r�rr>)rirrVrrr�_codeVs
r�cCsdd�dd�|D��S)N�[%s]�, css$|]}dtjdd|fVqdS)z%#0*xrN)r!�CODESIZE�r�xrrrr
fsz_hex_code.<locals>.<genexpr>)�join�rVrrr�	_hex_codeesr�csNddl�t��d�ttt��d���������fdd���dt���dS)Nrrc	s�dd�����fdd�
}��fdd�}�d7��}||k�r�|��|}|d7}t|}|tttttttfkrx||�q2|tt	t
ttt
ttfkr��|}|d7}||d|t|�f�q2|tkr�|}|d7}tt|�}|||dd��q2|tk�r*�|}|d7}tt|�}|||d	d��q2|ttttfk�rr�|}|||||d��|d||�||7}q2|ttfk�r��||d
�\}}	|d
7}||d||	t|�t|	�f�q2|tk�r�||t�||dt���|dt7}q2|tk�r��|}|d7}t d
�!�fdd��||dt"j#�D���}
||||
�|dt"j#7}�d7�t$|�D].}|t�||dt���|dt7}�qd�d8�q2|t%t&t't(t)fk�rΈ|}|d7}|||�q2|t*k�r��|}|||||d�|d7}q2|t+k�r|�|}|||||d�|�rr�|d||�||7}|��|}|�rf|d|||d�n|t��q |d7}q2|t,t-t.fk�r�||d�\}}}
|
t/k�r�d}
|||||
||d��|d||�||7}q2|t0k�r�||d
�\}}||||||d�|d
7}q2|t1t2fk�rp�||d
�\}}||||||d��|d
||�||7}q2|t3k�r��||d�\}}}}
|
t/k�r�d}
|||t4|�||
||d�|d�|t5@�r^�|d|d�\}}|d|�|d����|�}|ddd�!dd�|D��dd�!t6t|����|7�|d���|���|7�|t7@�r��d7�|d���||��d8�||7}q2t8|��q2�d8�dS)N)�tocsX|dk	r"��|�|d|ff7}td����kr6dndfd�dd�t|�dS)Nz(to %d)z%*d%s �:�.z  r��end)�add�print)r��args)�labels�level�offset_width�startrr�print_ps

�z!dis.<locals>.dis_.<locals>.print_cs"td�d�d�t|�dS)N� rr�)r�)r�)r�r�rr�print_2xsz"dis.<locals>.dis_.<locals>.print_2rz
%#02x (%r)��	rz%#02x %#02x (%r-%r)rt�c3s|]}|�tj�j�VqdSr)�to_bytesr!r��	byteorderr�)�sysrrr
�s�z$dis.<locals>.dis_.<locals>.<genexpr>�branch�	MAXREPEATr��z
  prefix_skipz  prefixr�r�css|]}d|VqdS)z%#02xNrr�rrrr
�sz(%r)�z	  overlap�in)9�OPCODESr>r.r4r6r@rAr,r-r+�LITERAL_IGNORE�NOT_LITERAL_IGNORE�LITERAL_UNI_IGNORE�NOT_LITERAL_UNI_IGNORE�LITERAL_LOC_IGNORE�NOT_LITERAL_LOC_IGNORE�chrrFr��ATCODESrN�CHCODESr/r2r*r1rorprqr�r�rs�listr�r!r�rwrCrQrSrTrRrMrLr?r;r<r�rU�ASSERT�
ASSERT_NOTr��binr�rxr��
ValueError)r�r�r�r�rra�argrdrcrjr�r	r��maxr�
prefix_lenr�r��rV�dis_r�r�r�r�)r�rr�os�

�
�

 

�


�












�


zdis.<locals>.dis_)r��setrr�r�rr�r�dishsr�c	Cs�t|�r|}t�||�}nd}t||�}|t@r>t�t|�|jj}dg|jj	}|�
�D]\}}|||<q\t�|||jj
B||jj	d|t|��S)Nr)r��	sre_parse�parser��SRE_FLAG_DEBUGr�r�r��	groupdict�groups�itemsr!�compilerr)rirrWrV�
groupindex�
indexgrouprerrrrr��s(



�r�)NNN)r),r!r��
sre_constantsr-r+rr?�
MIN_REPEATr:rr>r.rr�r�rr4r/r��
_equivalencesr$rrr=r3r0r�r�r�r��intr|r~r9r�r�r�r�r�r�r�r�r�r�rrrr�<module>
sF
$��
3

	,;__pycache__/tarfile.cpython-38.opt-2.pyc000064400000155175151153537600014016 0ustar00U

&�.e��@s
dZdZdZddlmZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZzddlZWnek
r�dZYnXzddlZWnek
r�dZYnXeefZzeef7ZWnek
r�YnXdddd	d
ddd
dddddddgZdZdZdZdZedZdZdZdZ dZ!dZ"dZ#dZ$dZ%d Z&d!Z'd"Z(d#Z)d$Z*d%Z+d&Z,d'Z-d(Z.d)Z/d*Z0d+Z1dZ2d,Z3d-Z4e4Z5e#e$e%e&e)e*e+e'e(e,e-e.fZ6e#e$e+e.fZ7e,e-e.fZ8d.Z9d/d0d1d2hZ:e;e;e;e<e<e<d3�Z=ej>d4k�r�d5Z?ne�@�Z?d6d7�ZAd8d9�ZBd:d;�ZCd<e5fd=d>�ZDd?d@�ZEdedfdAdB�ZFdCdD�ZGGdEd	�d	eH�ZIGdFd
�d
eI�ZJGdGd
�d
eI�ZKGdHd�deI�ZLGdId�deI�ZMGdJd�deI�ZNGdKdL�dLeN�ZOGdMdN�dNeN�ZPGdOdP�dPeN�ZQGdQdR�dReN�ZRGdSdT�dTeN�ZSGdUdV�dV�ZTGdWdX�dX�ZUGdYdZ�dZeV�ZWGd[d\�d\eV�ZXGd]d^�d^ejY�ZZGd_d`�d`eI�Z[Gdadb�dbe[�Z\Gdcdd�dde[�Z]Gdedf�dfe[�Z^Gdgdh�dhe[�Z_Gdidj�dje[�Z`dzdkdl�Zadmdn�Zbdodp�Zcdqdr�Zdebecedds�ZeeV�ZfGdtd�deV�ZgGdud�deV�Zhdvd�ZiehjZdwdx�Zjekdyk�rej�dS){z0.9.0u"Lars Gustäbel (lars@gustaebel.de)u4Gustavo Niemeyer, Niels Gustäbel, Richard Townsend.�)�openN�TarFile�TarInfo�
is_tarfile�TarError�	ReadError�CompressionError�StreamError�ExtractError�HeaderError�ENCODING�USTAR_FORMAT�
GNU_FORMAT�
PAX_FORMAT�DEFAULT_FORMATrTz/etc/python/tarfile.cfg�i�sustar  sustar00�d��0�1�2�3�4�5�6�7�L�K�S�x�g�X��)�path�linkpath�size�mtime�uid�gid�uname�gnamer%r&r+r,)Zatime�ctimer(r)r*r'�nt�utf-8cCs8|dkrtd��|�||�}|d|�|t|�tS)Nzmetadata cannot contain None)�
ValueError�encode�len�NUL)�s�length�encoding�errors�r8�/usr/lib64/python3.8/tarfile.py�stn�sr:cCs*|�d�}|dkr|d|�}|�||�S)Nr���)�find�decode)r4r6r7�pr8r8r9�nts�s
r?cCs�|ddkrbd}tt|�d�D]}|dK}|||d7}q |ddkr�dt|�d|}n@z"t|dd�}t|��p|d	d�}Wntk
r�td
��YnX|S)Nr)��r#�rA��ascii�strict�0�invalid header)�ranger2r?�int�stripr0�InvalidHeaderError)r4�n�ir8r8r9�nti�srNrBcCs�t|�}d|kr$d|dkrDnntd|d|fd�t}n�|tkr�d|d|krrd|dkr�nnV|dkr�tdg�}ntdg�}d||}t|d�D]}|�d|d@�|dL}q�ntd	��|S)
NrrBr#z%0*orDrCr@rAzoverflow in number field)rI�bytesr3r�	bytearrayrH�insertr0)rL�digits�formatr4rMr8r8r9�itn�s 2
rTcCs0dtt�d|��}dtt�d|��}||fS)NrCZ
148B8x356BZ
148b8x356b)�sum�structZunpack_from)�bufZunsigned_chksumZ
signed_chksumr8r8r9�calc_chksums�s	rXc	Cs�|pd}|dkrdS|dkr.t�|||�dSt||�\}}t|�D],}|�|�}t|�|krf|d��|�|�qD|dkr�|�|�}t|�|kr�|d��|�|�dS)Ni@r�unexpected end of data)�shutil�copyfileobj�divmodrH�readr2�write)	�srcZdstr5�	exception�bufsize�blocks�	remainder�brWr8r8r9r[�s$


r[cCs8ttjdd�}|dk	r(|�|d��|�}t|dd�dS)Nr6�backslashreplace� )�end)�getattr�sys�stdoutr1r=�print)r4r6r8r8r9�_safe_printsrlc@seZdZdS)rN��__name__�
__module__�__qualname__r8r8r8r9rsc@seZdZdS)r
Nrmr8r8r8r9r
sc@seZdZdS)rNrmr8r8r8r9rsc@seZdZdS)rNrmr8r8r8r9rsc@seZdZdS)r	Nrmr8r8r8r9r	!sc@seZdZdS)rNrmr8r8r8r9r$sc@seZdZdS)�EmptyHeaderErrorNrmr8r8r8r9rq'srqc@seZdZdS)�TruncatedHeaderErrorNrmr8r8r8r9rr*srrc@seZdZdS)�EOFHeaderErrorNrmr8r8r8r9rs-srsc@seZdZdS)rKNrmr8r8r8r9rK0srKc@seZdZdS)�SubsequentHeaderErrorNrmr8r8r8r9rt3srtc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�
_LowLevelFilecCsFtjtjtjBtjBd�|}ttd�r2|tjO}t�||d�|_dS)N��r�w�O_BINARYi�)	�os�O_RDONLY�O_WRONLY�O_CREAT�O_TRUNC�hasattrryr�fd)�self�name�moder8r8r9�__init__@s��

z_LowLevelFile.__init__cCst�|j�dS�N)rz�closer��r�r8r8r9r�Isz_LowLevelFile.closecCst�|j|�Sr�)rzr]r��r�r'r8r8r9r]Lsz_LowLevelFile.readcCst�|j|�dSr�)rzr^r��r�r4r8r8r9r^Osz_LowLevelFile.writeN)rnrorpr�r�r]r^r8r8r8r9ru:s	ruc@sneZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
ddd�Zdd�Zdd�Z
dd�ZdS)�_Streamc	Cs�d|_|dkrt||�}d|_|dkr6t|�}|��}|p<d|_||_||_||_||_d|_	d|_
d|_�zL|dkr�zddl}Wnt
k
r�td��YnX||_|�d�|_|d	kr�|��|j|_n|��n�|d
k�r:zddl}Wnt
k
�r
td��YnX|d	k�r.d|_|��|_t|_n
|��|_n||dk�r�zddl}Wnt
k
�rntd
��YnX|d	k�r�d|_|��|_|j|_n
|��|_n|dk�r�td|��Wn&|j�s�|j��d|_�YnXdS)NTF�*��r�gzzzlib module is not availablerw�bz2�bz2 module is not available�xz�lzma module is not available�tar�unknown compression type %r) �_extfileobjru�_StreamProxy�getcomptyper�r��comptype�fileobjrarW�pos�closed�zlib�ImportErrorr�crc32�crc�
_init_read_gz�errorr`�_init_write_gzr��dbufZBZ2Decompressor�cmp�OSErrorZ
BZ2Compressor�lzmaZLZMADecompressor�	LZMAErrorZLZMACompressorr�)	r�r�r�r�r�rar�r�r�r8r8r9r�]sl












z_Stream.__init__cCst|d�r|js|��dS)Nr�)rr�r�r�r8r8r9�__del__�sz_Stream.__del__cCs�|j�d|jj|jj|jjd�|_t�dtt	�	���}|�
d|d�|j�d�rf|jdd�|_t
j�|j�|_|�
|j�dd	�t�dS)
N�	r�<Ls�s��.gz���z
iso-8859-1�replace)r�ZcompressobjZDEFLATED�	MAX_WBITSZ
DEF_MEM_LEVELr�rV�packrI�time�_Stream__writer��endswithrzr%�basenamer1r3)r�Z	timestampr8r8r9r��s�z_Stream._init_write_gzcCsR|jdkr|j�||j�|_|jt|�7_|jdkrD|j�|�}|�|�dS)Nr�r�)	r�r�r�r�r�r2r��compressr�r�r8r8r9r^�s

z
_Stream.writecCsN|j|7_t|j�|jkrJ|j�|jd|j��|j|jd�|_qdSr�)rWr2rar�r^r�r8r8r9Z__write�sz_Stream.__writecCs�|jr
dSd|_z�|jdkr:|jdkr:|j|j��7_|jdkr�|jr�|j�	|j�d|_|jdkr�|j�	t
�d|j��|j�	t
�d|j
d@��W5|js�|j��XdS)NTrxr�r�r�r�l��)r�r�r�r�r�r�rWr��flushr^rVr�r�r�r�r8r8r9r��s
z
_Stream.closecCs�|j�|jj�|_d|_|�d�dkr0td��|�d�dkrFtd��t|�d��}|�d�|d	@r�t|�d��d
t|�d��}|�	|�|d@r�|�d�}|r�|t
kr�q�q�|d@r�|�d�}|r�|t
kr�q�q�|d@r�|�d�dS)
Nr�r$s��not a gzip filer#�zunsupported compression method��rCrB�)r�Z
decompressobjr�r�r��
_Stream__readrr�ordr]r3)r��flagZxlenr4r8r8r9r��s*
 


z_Stream._init_read_gzcCs|jSr�)r�r�r8r8r9�tell�sz_Stream.tellrcCsX||jdkrJt||j|j�\}}t|�D]}|�|j�q,|�|�ntd��|jS)Nrz seeking backwards is not allowed)r�r\rarHr]r	)r�r�rbrcrMr8r8r9�seeksz_Stream.seekcCs |�|�}|jt|�7_|Sr�)�_readr�r2)r�r'rWr8r8r9r]s
z_Stream.readcCs�|jdkr|�|�St|j�}|jg}||kr�|jrB|j}d|_n|j�|j�}|sVq�z|j�	|�}Wn|j
k
r�td��YnX|�|�|t|�7}q&d�
|�}||d�|_|d|�S)Nr�r�zinvalid compressed data)r�r�r2r�rWr�r]rar��
decompressr`r�append�join�r�r'�c�trWr8r8r9r�s(




z
_Stream._readcCsjt|j�}|jg}||krF|j�|j�}|s.qF|�|�|t|�7}qd�|�}||d�|_|d|�S)Nr�)r2rWr�r]rar�r�r�r8r8r9Z__read3s


z_Stream.__readN)r)rnrorpr�r�r�r^r�r�r�r�r�r]r�r�r8r8r8r9r�RsF
	

r�c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
r�cCs||_|j�t�|_dSr�)r�r]�	BLOCKSIZErW)r�r�r8r8r9r�Isz_StreamProxy.__init__cCs|jj|_|jSr�)r�r]rWr�r8r8r9r]Ms
z_StreamProxy.readcCsP|j�d�rdS|jdd�dkr8|jdd�dkr8d	S|j�d
�rHdSdSdS)
Ns�r�r�sBZhr��
s1AY&SYr�)s]�s�7zXZr�r�)rW�
startswithr�r8r8r9r�Qs$z_StreamProxy.getcomptypecCs|j��dSr�)r�r�r�r8r8r9r�[sz_StreamProxy.closeN)rnrorpr�r]r�r�r8r8r8r9r�Ds
r�c@sfeZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Ze	j
fdd�Zddd�Zdd�Z
dd�ZdS)�_FileInFileNcCs�||_||_||_d|_t|dd�|_d|_|dkr>d|fg}d|_g|_d}|j}|D]L\}}||kr||j�	d||df�|j�	d||||f�||7}||}qX||jkr�|j�	d||jdf�dS)Nrr�FT)
r��offsetr'�positionrhr�r��	map_index�mapr�)r�r�r�r'Z	blockinfoZlastposZrealposr8r8r9r�hs(


z_FileInFile.__init__cCsdSr�r8r�r8r8r9r��sz_FileInFile.flushcCsdS�NTr8r�r8r8r9�readable�sz_FileInFile.readablecCsdS)NFr8r�r8r8r9�writable�sz_FileInFile.writablecCs
|j��Sr�)r��seekabler�r8r8r9r��sz_FileInFile.seekablecCs|jSr�)r�r�r8r8r9r��sz_FileInFile.tellcCs�|tjkr tt|d�|j�|_nj|tjkr\|dkrFt|j|d�|_q�t|j||j�|_n.|tjkr�tt|j||j�d�|_ntd��|jS)NrzInvalid argument)	�io�SEEK_SET�min�maxr'r��SEEK_CUR�SEEK_ENDr0)r�r��whencer8r8r9r��s


z_FileInFile.seekc	Cs
|dkr|j|j}nt||j|j�}d}|dk�r|j|j\}}}}||jkr`|krhq�nq�q6|jd7_|jt|j�kr6d|_q6t|||j�}|r�|j�||j|�|j�|�}t|�|kr�t	d��||7}n|t
|7}||8}|j|7_q,|S)Nr�rr#rY)r'r�r�r�r�r2r�r�r]rr3)	r�r'rW�data�start�stopr�r5rdr8r8r9r]�s,

z_FileInFile.readcCs&|�t|��}||dt|��<t|�Sr�)r]r2)r�rdrWr8r8r9�readinto�sz_FileInFile.readintocCs
d|_dSr�)r�r�r8r8r9r��sz_FileInFile.close)N)N)rnrorpr�r�r�r�r�r�r�r�r�r]r�r�r8r8r8r9r�bs

r�cseZdZ�fdd�Z�ZS)�ExFileObjectcs&t|j|j|j|j�}t��|�dSr�)r�r��offset_datar'�sparse�superr�)r��tarfile�tarinfor���	__class__r8r9r��s

�zExFileObject.__init__�rnrorpr��
__classcell__r8r8r�r9r��sr�c@seZdZdS)�FilterErrorNrmr8r8r8r9r��sr�cseZdZ�fdd�Z�ZS)�AbsolutePathErrorcs ||_t��d|j�d��dS)Nzmember z has an absolute path�r�r�r�r��r�r�r�r8r9r��szAbsolutePathError.__init__r�r8r8r�r9r��sr�cseZdZ�fdd�Z�ZS)�OutsideDestinationErrorcs.||_||_t��|j�d|�d�d�dS)Nz would be extracted to �, � which is outside the destination�r��_pathr�r�r��r�r�r%r�r8r9r��s
�z OutsideDestinationError.__init__r�r8r8r�r9r��sr�cseZdZ�fdd�Z�ZS)�SpecialFileErrorcs||_t��|j�d��dS)Nz is a special filer�r�r�r8r9r��szSpecialFileError.__init__r�r8r8r�r9r��sr�cseZdZ�fdd�Z�ZS)�AbsoluteLinkErrorcs||_t��|j�d��dS)Nz! is a symlink to an absolute pathr�r�r�r8r9r��szAbsoluteLinkError.__init__r�r8r8r�r9r��sr�cseZdZ�fdd�Z�ZS)�LinkOutsideDestinationErrorcs.||_||_t��|j�d|�d�d�dS)Nz would link to r�r�r�r�r�r8r9r��s
�z$LinkOutsideDestinationError.__init__r�r8r8r�r9r��sr�cCs�i}|j}tj�|�}|�dtjf�r@|j�dtj�}|d<tj�|�rTt|��tj�tj�	||��}tj�
||g�|kr�t||��|j}|dk	r�|d@}|r�|�
�s�|��r�|d@s�|dM}|dO}n|��s�|��r�d}nt|��||jkr�||d<|�r�|jdk	�rd|d<|jdk	�r*d|d	<|jdk	�r>d|d
<|jdk	�rRd|d<|���sf|���r�tj�|j��r~t|��|���r�tj�	|tj�|�|j�}ntj�	||j�}tj�|�}tj�
||g�|k�r�t||��|S)N�/r�i��@i�����r�r)r*r+r,)r�rzr%�realpathr��sep�lstrip�isabsr�r��
commonpathr�r��isreg�islnk�isdir�issymr�r)r*r+r,�linknamer��dirnamer�)�member�	dest_pathZfor_data�	new_attrsr�Ztarget_pathr�r8r8r9�_get_filtered_attrs�s^




��
rcCs|Sr�r8)rrr8r8r9�fully_trusted_filter6srcCs(t||d�}|r$|jf|ddi��S|S)NF�deep�rr��rrrr8r8r9�
tar_filter9srcCs(t||d�}|r$|jf|ddi��S|S)NTr	Fr
rr8r8r9�data_filter?sr
)Z
fully_trustedr�r�c@s�eZdZeddddddddd	d
ddd
dddddddd�Zdhdd�Zedd��Zejdd��Zedd��Z	e	jdd��Z	dd�Z
eeeeeeeeded �
d!d"�Zd#d$�Z
eed%fd&d'�Zd(d)�Zd*d+�Zd,d-�Zed.d/��Zd0d1�Zed2d3��Zed4d5��Zed6d7��Zed8d9��Zed:d;��Zed<d=��Zd>d?�Zd@dA�ZdBdC�Z dDdE�Z!dFdG�Z"dHdI�Z#dJdK�Z$dLdM�Z%dNdO�Z&dPdQ�Z'dRdS�Z(dTdU�Z)dVdW�Z*dXdY�Z+dZd[�Z,d\d]�Z-d^d_�Z.d`da�Z/dbdc�Z0ddde�Z1dfdg�Z2dS)irzName of the archive member.zPermission bits.z6User ID of the user who originally stored this member.z7Group ID of the user who originally stored this member.zSize in bytes.zTime of last modification.zHeader checksum.z�File type. type is usually one of these constants: REGTYPE, AREGTYPE, LNKTYPE, SYMTYPE, DIRTYPE, FIFOTYPE, CONTTYPE, CHRTYPE, BLKTYPE, GNUTYPE_SPARSE.zcName of the target file name, which is only present in TarInfo objects of type LNKTYPE and SYMTYPE.z
User name.zGroup name.zDevice major number.zDevice minor number.zThe tar header starts here.zThe file's data starts here.zMA dictionary containing key-value pairs of an associated pax extended header.zSparse member information.N)r�r�r)r*r'r(�chksum�typerr+r,�devmajor�devminorr�r��pax_headersr�r��_sparse_structs�_link_targetr�cCsj||_d|_d|_d|_d|_d|_d|_t|_d|_	d|_
d|_d|_d|_
d|_d|_d|_i|_dS)Ni�rr�)r�r�r)r*r'r(r�REGTYPErrr+r,rrr�r�r�r�r�r�r8r8r9r�us"zTarInfo.__init__cCs|jSr��r�r�r8r8r9r%�szTarInfo.pathcCs
||_dSr�rrr8r8r9r%�scCs|jSr��rr�r8r8r9r&�szTarInfo.linkpathcCs
||_dSr�r)r�rr8r8r9r&�scCsd|jj|jt|�fS)Nz<%s %r at %#x>)r�rnr��idr�r8r8r9�__repr__�szTarInfo.__repr__T)
r�r(r�rr)r*r+r,r	�_KEEPc
Cs�|	rt�|�}n
t�|�}||
k	r(||_||
k	r6||_||
k	rD||_||
k	rR||_||
k	r`||_||
k	rn||_||
k	r|||_||
k	r�||_	|Sr�)
�copyZdeepcopyr�r(r�rr)r*r+r,)r�r�r(r�rr)r*r+r,r	r�resultr8r8r9r��s(
zTarInfo.replacecCs�|jdkrd}n
|jd@}|j||j|j|j|j|j|j|j|j	|j
|j|jd�
}|dt
kr||d�d�s||dd7<|S)N�)
r�r�r)r*r'r(rrrr+r,rrrr�r�)r�r�r)r*r'r(rrrr+r,rr�DIRTYPEr�)r�r��infor8r8r9�get_info�s(

�zTarInfo.get_info�surrogateescapecCsz|��}|��D]\}}|dkrtd|��q|tkrD|�|||�S|tkrZ|�|||�S|tkrn|�||�Std��dS)Nz%s may not be Nonezinvalid format)	r!�itemsr0r
�create_ustar_headerr�create_gnu_headerr�create_pax_header)r�rSr6r7r r��valuer8r8r9�tobuf�sz
TarInfo.tobufcCsnt|d<t|d�||��tkr(td��t|d�||��tkr^|�|d||�\|d<|d<|�|t||�S)N�magicrzlinkname is too longr��prefix)	�POSIX_MAGICr2r1�LENGTH_LINKr0�LENGTH_NAME�_posix_split_name�_create_headerr
)r�r r6r7r8r8r9r$�szTarInfo.create_ustar_headercCs�t|d<d}t|d�||��tkr<||�|dt||�7}t|d�||��tkrl||�|dt||�7}||�|t	||�S)Nr)r�rr�)
�	GNU_MAGICr2r1r,�_create_gnu_long_header�GNUTYPE_LONGLINKr-�GNUTYPE_LONGNAMEr/r)r�r r6r7rWr8r8r9r%�szTarInfo.create_gnu_headerc
	Cs*t|d<|j��}ddtfddtfddfD]j\}}}||kr>q*z||�dd	�Wn$tk
rv||||<Yq*YnXt||�|kr*||||<q*d
D]`\}}||kr�d||<q�||}d|kr�d|d
kr�nn
t|t	�r�t
|�||<d||<q�|�r|�|t|�}	nd}	|	|�
|tdd�S)Nr)r�r%rr&)r+r+� )r,r,r4rDrE))r)rB)r*rB)r'�)r(r5rrBr#r�r�)r+rrr-r,r1�UnicodeEncodeErrorr2�
isinstance�float�str�_create_pax_generic_header�XHDTYPEr/r
)
r�r r6rr�Zhnamer5rR�valrWr8r8r9r&s8
�
*
zTarInfo.create_pax_headercCs|�|td�S)Nr/)r:�XGLTYPE)�clsrr8r8r9�create_pax_global_header7sz TarInfo.create_pax_global_headercCs~|�d�}tdt|��D]T}d�|d|��}d�||d��}t|�||��tkrt|�||��tkrqvqtd��||fS)Nr�r#zname is too long)�splitrHr2r�r1�
LENGTH_PREFIXr-r0)r�r�r6r7Z
componentsrMr*r8r8r9r.=s
�zTarInfo._posix_split_namecCs�|�d�ttfk}|r@t|�dd�d|�}t|�dd�d|�}ntdd||�}tdd||�}|�dt�}|dkrxtd��t|�dd�d	||�t|�d
d�d@d|�t|�dd�d|�t|�d
d�d|�t|�dd�d|�t|�dd�d|�d|t|�dd�d	||�|�dt�t|�dd�d||�t|�dd�d||�t|�dd�d|�t|�dd�d|�t|�dd�d||�g}t�	dt
d�|��}	t|	t
d��d}
|	dd�t
d|
d�|	dd�}	|	S)NrrrrBrr�zTarInfo.type must not be Noner�rr�rr)r*r'r5r(s        rr)r+r4r,r*rz%dsr�i����z%06orDi����)�get�CHRTYPE�BLKTYPErTr:rr0r+rVr�r�r�rXrO)r rSr6r7Zhas_device_fieldsrrZfiletype�partsrWrr8r8r9r/Ms:
�&zTarInfo._create_headercCs.tt|�t�\}}|dkr*|t|t7}|S)Nr)r\r2r�r3)Zpayloadrbrcr8r8r9�_create_payloadwszTarInfo._create_payloadcCsR|�||�t}i}d|d<||d<t|�|d<t|d<|�|t||�|�|�S)Nz
././@LongLinkr�rr'r))r1r3r2r0r/r
rF)r>r�rr6r7r r8r8r9r1�s�zTarInfo._create_gnu_long_headerc	Cs2d}|��D]8\}}z|�dd�Wqtk
rBd}YqFYqXqd}|rV|d7}|��D]�\}}|�d�}|r�|�|d�}n
|�d�}t|�t|�d}d	}	}
|tt|
��}	|	|
kr�q�|	}
q�|tt|
�d
�d|d|d
7}q^i}d|d<||d<t|�|d<t|d<|�|td
d�|�	|�S)NFr/rETr�s21 hdrcharset=BINARY
r"r�rrD� �=�
z././@PaxHeaderr�rr'r)r�)
r#r1r6r2r9rOr+r/r
rF)r>rrr6Zbinary�keywordr'Zrecords�lrLr>r r8r8r9r:�s<

(�z"TarInfo._create_pax_generic_headerc	Csvt|�dkrtd��t|�tkr(td��|�t�tkr>td��t|dd��}|t|�krbt	d��|�}t
|dd�||�|_t|dd	��|_t|d	d
��|_
t|d
d��|_t|dd��|_t|dd��|_||_|dd
�|_t
|d
d�||�|_t
|dd�||�|_t
|dd�||�|_t|dd��|_t|dd��|_t
|dd�||�}|jtk�r�|j�d��r�t|_|jtk�r8d}g}td�D]l}	z0t|||d��}
t||d|d��}Wntk
�r�Y�qYnX|�|
|f�|d7}�q�t|d�}t|dd��}
|||
f|_ |�!��rP|j�"d�|_|�rr|jt#k�rr|d|j|_|S)Nrzempty headerztruncated headerzend of file header��zbad checksumr�l�t�|��ii	i)iIiQiYi�r�i�r�r5�i�i�i�)$r2rqr�rr�countr3rsrNrXrKr?r�r�r)r*r'r(rrrr+r,rr�AREGTYPEr�r�GNUTYPE_SPARSErHr0r��boolrr�rstrip�	GNU_TYPES)r>rWr6r7r�objr*r��structsrMr��numbytes�
isextended�origsizer8r8r9�frombuf�sZ
zTarInfo.frombufcCs8|j�t�}|�||j|j�}|j��t|_|�|�Sr�)	r�r]r�r_r6r7r�r��_proc_member)r>r�rWrZr8r8r9�fromtarfileszTarInfo.fromtarfilecCsT|jttfkr|�|�S|jtkr,|�|�S|jtttfkrF|�	|�S|�
|�SdSr�)rr3r2�
_proc_gnulongrV�_proc_sparser;r=�SOLARIS_XHDTYPE�	_proc_pax�
_proc_builtin)r�r�r8r8r9r`s



zTarInfo._proc_membercCsR|j��|_|j}|��s$|jtkr4||�|j�7}||_|�	|j
|j|j�|Sr�)
r�r�r�r�r�SUPPORTED_TYPES�_blockr'r��_apply_pax_inforr6r7)r�r�r�r8r8r9rf&szTarInfo._proc_builtincCs�|j�|�|j��}z|�|�}Wntk
r>td��YnX|j|_|jt	krft
||j|j�|_
n|jtkr�t
||j|j�|_|S)N� missing or bad subsequent header)r�r]rhr'rarrtr�rr3r?r6r7r�r2r)r�r�rW�nextr8r8r9rb7s

zTarInfo._proc_gnulongc
	Cs�|j\}}}|`|r�|j�t�}d}td�D]n}z0t|||d��}t||d|d��}	Wntk
rzYq�YnX|r�|	r�|�||	f�|d7}q,t|d�}q||_	|j�
�|_|j|�|j
�|_||_
|S)Nr�r5rSi�)rr�r]r�rHrNr0r�rWr�r�r�rhr'r�)
r�r�r[r]r^rWr�rMr�r\r8r8r9rcMs(
zTarInfo._proc_sparsecCs.|j�|�|j��}|jtkr&|j}n
|j��}t�	d|�}|dk	rX|�
d��d�|d<|�d�}|dkrr|j
}nd}t�d�}d}|�||�}|s��q6|��\}	}
t|	�}	|	dkr�td��||�d	�d|�d�|	d�}|�|
dd|j�}
|
tk�r|�|||j
|j�}n|�|dd|j�}|||
<||	7}q�z|�|�}Wntk
�rbtd
��YnXd|k�r||�||�nHd|k�r�|�|||�n.|�d
�dk�r�|�d�dk�r�|�|||�|jttfk�r*|� ||j
|j�|j!|_!d|k�r*|j"}
|�#��s|jt$k�r$|
|�|j�7}
|
|_!|S)Ns\d+ hdrcharset=([^\n]+)\nr#r/�
hdrcharsetZBINARYs(\d+) ([^=]+)=rrGr$rj�GNU.sparse.map�GNU.sparse.sizezGNU.sparse.major�1zGNU.sparse.minorrFr')%r�r]rhr'rr=rr�re�search�groupr=rBr6�compile�match�groupsrIrKrgr��_decode_pax_fieldr7�PAX_NAME_FIELDSrarrt�_proc_gnusparse_01�_proc_gnusparse_00�_proc_gnusparse_10r;rdrir�r�r�rg)r�r�rWrrurmr6Zregexr�r5rJr'rkr�r8r8r9reish



$	
�
�
�


 
zTarInfo._proc_paxcCshg}t�d|�D]}|�t|�d���qg}t�d|�D]}|�t|�d���q:tt||��|_dS)Ns\d+ GNU.sparse.offset=(\d+)\nr#s\d+ GNU.sparse.numbytes=(\d+)\n)rq�finditerr�rIrs�list�zipr�)r�rkrrWZoffsetsrur\r8r8r9rz�szTarInfo._proc_gnusparse_00cCs@dd�|d�d�D�}tt|ddd�|ddd���|_dS)NcSsg|]}t|��qSr8)rI)�.0�xr8r8r9�
<listcomp>�sz.TarInfo._proc_gnusparse_01.<locals>.<listcomp>rn�,r$r#)r@r}r~r�)r�rkrr�r8r8r9ry�szTarInfo._proc_gnusparse_01cCs�d}g}|j�t�}|�dd�\}}t|�}t|�|dkrtd|krT||j�t�7}|�dd�\}}|�t|��q,|j��|_t	t
|ddd�|ddd���|_dS)NrIr#r$)r�r]r�r@rIr2r�r�r�r}r~r�)r�rkrr�Zfieldsr�rWZnumberr8r8r9r{�szTarInfo._proc_gnusparse_10c	Cs�|��D]�\}}|dkr&t|d|�q|dkr@t|dt|��q|dkrZt|dt|��q|tkr|tkr�zt||�}Wntk
r�d}YnX|dkr�|�d�}t|||�q|��|_dS)NzGNU.sparse.namer%ror'zGNU.sparse.realsizerr�)	r#�setattrrI�
PAX_FIELDS�PAX_NUMBER_FIELDSr0rXrr)r�rr6r7rJr'r8r8r9ri�s"

zTarInfo._apply_pax_infocCs4z|�|d�WStk
r.|�||�YSXdS)NrE)r=�UnicodeDecodeError)r�r'r6Zfallback_encodingZfallback_errorsr8r8r9rw	szTarInfo._decode_pax_fieldcCs"t|t�\}}|r|d7}|tS)Nr#)r\r�)r�rTrbrcr8r8r9rhszTarInfo._blockcCs
|jtkSr�)r�
REGULAR_TYPESr�r8r8r9r�sz
TarInfo.isregcCs|��Sr�)r�r�r8r8r9�isfileszTarInfo.isfilecCs
|jtkSr�)rrr�r8r8r9r"sz
TarInfo.isdircCs
|jtkSr�)r�SYMTYPEr�r8r8r9r&sz
TarInfo.issymcCs
|jtkSr�)r�LNKTYPEr�r8r8r9r�*sz
TarInfo.islnkcCs
|jtkSr�)rrCr�r8r8r9�ischr.sz
TarInfo.ischrcCs
|jtkSr�)rrDr�r8r8r9�isblk2sz
TarInfo.isblkcCs
|jtkSr�)r�FIFOTYPEr�r8r8r9�isfifo6szTarInfo.isfifocCs
|jdk	Sr�)r�r�r8r8r9�issparse:szTarInfo.issparsecCs|jtttfkSr�)rrCrDr�r�r8r8r9�isdev=sz
TarInfo.isdev)r�)3rnrorp�dict�	__slots__r��propertyr%�setterr&rrr�r!rrr(r$r%r&�classmethodr?r.�staticmethodr/rFr1r:r_rar`rfrbrcrerzryr{rirwrhr�r�rrr�r�r�r�r�r�r8r8r8r9rRs��




�
1

)
	

2
>

h	c
@s�eZdZdZdZdZdZeZe	Z
dZeZ
eZdZdedd�Zedddefd	d
��Zedfdd��Zedgdd��Zedhdd��Zedidd��Zddddd�Zdd�Zdd�Zdd�Zdd �Zdjd!d"�Zdkdd$�d%d&�Zdldd'�d(d)�Z dmd*d+�Z!d,d-�Z"dnddd/�d0d1�Z#doddd/�d3d4�Z$d5d6�Z%d7d8�Z&d9d:�Z'd;d<�Z(d=d>�Z)dpd?d@�Z*dAdB�Z+dCdD�Z,dEdF�Z-dGdH�Z.dIdJ�Z/dKdL�Z0dMdN�Z1dOdP�Z2dQdR�Z3dSdT�Z4dqdUdV�Z5dWdX�Z6drdYdZ�Z7d[d\�Z8d]d^�Z9d_d`�Z:dadb�Z;dcdd�Z<dS)srrFr#Nrwr"c
Cs�ddddd�}||krtd��||_|||_|sh|jdkrTtj�|�sTd|_d|_t||j�}d	|_n@|dkr�t|d
�r�t	|j
ttf�r�|j
}t|d�r�|j|_d|_|r�tj�
|�nd|_
||_|dk	r�||_|dk	r�||_|dk	r�||_|dk	r�||_|dk	�r||_|	|_|
dk	�r0|jtk�r0|
|_ni|_|dk	�rF||_|dk	�rV||_|
|_d	|_g|_d	|_|j��|_i|_z�|jd
k�r�d|_ |�!�|_ |jdk�r2|j�"|j�z|j�#|�}|j�$|�WnXt%k
�r�|j�"|j�Y�q2Yn0t&k
�r,}zt't|���W5d}~XYnX�q�|jdk�r|d|_|j�r||j�(|j�)��}|j�*|�|jt+|�7_Wn&|j�s�|j�,�d|_�YnXdS)N�rbzr+b�wbZxb�rw�arxr��!mode must be 'r', 'a', 'w' or 'x'r�rxFr�r�Trw�r�rxr�)-r0r��_moderzr%�exists�	bltn_openr�rr7r�r9rO�abspathr�rSr��dereference�ignore_zerosr6r7rr�debug�
errorlevel�copybufsizer��members�_loadedr�r��inodes�firstmemberrkr�rar�rsrrr?rr^r2r�)r�r�r�r�rSr�r�r�r6r7rr�r�r�Zmodes�erWr8r8r9r�^s�
�





"
zTarFile.__init__c

s�|s|std��|dkr��fdd�}t�j|d�D]j}t��j|�}|dk	rV|��}	z||d|f|�WSttfk
r�|dk	r�|�|	�Yq2Yq2Xq2td���nd|k�r|�dd	�\}
}|
p�d}
|p�d
}|�jkr�t��j|�}ntd|��|||
|f|�Sd|k�r�|�dd	�\}
}|
�p.d}
|�p8d
}|
d
k�rLtd��t	||
|||�}z�||
|f|�}Wn|�
��YnXd|_|S|dk�r��j|||f|�Std��dS)Nznothing to open)rw�r:*cs�j|dkS)N�taropen)�	OPEN_METH)r��r>r8r9�not_compressed�sz$TarFile.open.<locals>.not_compressed)�keyrwz%file could not be opened successfully�:r#r�r��|rvzmode must be 'r' or 'w'Fr�zundiscernible mode)
r0�sortedr�rhr�rrr�r@r�r�r�r�)
r>r�r�r�ra�kwargsr�r��funcZ	saved_pos�filemode�streamr�r8r�r9r�sP%







zTarFile.opencKs |dkrtd��||||f|�S)Nr�r�)r0)r>r�r�r�r�r8r8r9r�(szTarFile.taropenr�cKs�|dkrtd��zddlm}Wntk
r<td��YnXz|||d||�}Wn.tk
r�|dk	r||dkr|td���YnXz|j|||f|�}WnBtk
r�|��|dkr�td���Yn|���YnXd	|_	|S)
N�rwrxr��mode must be 'r', 'w' or 'x'r)�GzipFilezgzip module is not availablerdrwr�F)
r0Zgzipr�r�rr�rr�r�r�)r>r�r�r��
compresslevelr�r�r�r8r8r9�gzopen0s0zTarFile.gzopenc	Ks�|dkrtd��zddlm}Wntk
r<td��YnX||pF|||d�}z|j|||f|�}WnFttfk
r�|��|dkr�t	d���Yn|���YnXd	|_
|S)
Nr�r�r)�BZ2Filer�)r�rwznot a bzip2 fileF)r0r�r�r�rr�r��EOFErrorr�rr�)r>r�r�r�r�r�r�r�r8r8r9�bz2openQs&zTarFile.bz2openc		Ks�|dkrtd��zddlm}m}Wntk
r@td��YnX||pJ|||d�}z|j|||f|�}WnF|tfk
r�|��|dkr�t	d���Yn|���YnXd	|_
|S)
Nr�r�r)�LZMAFiler�r�)�presetrwznot an lzma fileF)r0r�r�r�r�rr�r�r�rr�)	r>r�r�r�r�r�r�r�r�r8r8r9�xzopenms&zTarFile.xzopenr�r�r�r�)r�r�r�r�cCs�|jr
dSd|_z`|jdkrn|j�ttd�|jtd7_t	|jt
�\}}|dkrn|j�tt
|�W5|js�|j��XdS)NTr�r$r)r�r�r�r�r�r^r3r�r�r\�
RECORDSIZE)r�rbrcr8r8r9r��s
z
TarFile.closecCs"|�|�}|dkrtd|��|S)Nzfilename %r not found)�
_getmember�KeyError)r�r�r�r8r8r9�	getmember�s
zTarFile.getmembercCs|��|js|��|jSr�)�_checkr��_loadr�r�r8r8r9�
getmembers�szTarFile.getmemberscCsdd�|��D�S)NcSsg|]
}|j�qSr8r)rr�r8r8r9r��sz$TarFile.getnames.<locals>.<listcomp>)r�r�r8r8r9�getnames�szTarFile.getnamescCs^|�d�|dk	r|j}|dkr$|}tj�|�\}}|�tjd�}|�d�}|��}||_	|dkr�|j
stt�|�}q�t�|�}nt�
|���}d}|j}t�|�r�|j|jf}	|j
s�|jdkr�|	|jkr�||j|	kr�t}
|j|	}nt}
|	dr�||j|	<nht�|��rt}
nVt�|��r"t}
nDt�|��r>t}
t�|�}n(t�|��rPt}
nt� |��rbt!}
ndS||_||_"|j#|_$|j%|_&|
tk�r�|j'|_(nd|_(|j)|_*|
|_+||_,t-�r�zt-�.|j$�d|_/Wnt0k
�r�YnXt1�rzt1�2|j&�d|_3Wnt0k
�rYnX|
tt!fk�rZt4td��rZt4td��rZt�5|j6�|_7t�8|j6�|_9|S)N�awxr�r�r#r�major�minor):r�r�rzr%�
splitdriver�r�r�r�r�r��lstat�stat�fstat�fileno�st_mode�S_ISREG�st_ino�st_dev�st_nlinkr�r�r�S_ISDIRr�S_ISFIFOr��S_ISLNKr��readlink�S_ISCHRrC�S_ISBLKrDr��st_uidr)�st_gidr*�st_sizer'�st_mtimer(rr�pwd�getpwuidr+r��grpZgetgrgidr,rr��st_rdevrr�r)r�r��arcnamer�Zdrvr�ZstatresrZstmd�inoderr8r8r9�
gettarinfo�s�	


��

zTarFile.gettarinfoT)r�cCs*|��|dkr|}|D�]
}|r�|jdkr6td�ntt�|j��td|jpT|j|jp^|jf�|�	�sv|�
�r�tdd|j|jf�ntd|j
�|jdkr�td�ntdt�|j�dd��t|j|��r�d	nd
�|�r|���rtd|j�|���rtd|j�t�qdS)
Nz
??????????z%s/%sz%10sz%d,%dz%10dz????-??-?? ??:??:??z%d-%02d-%02d %02d:%02d:%02dr�r�r�z-> zlink to )r�r�rlr�r�r+r)r,r*r�r�rrr'r(r��	localtimer�rrrr�rk)r��verboser�r�r8r8r9r}'s8



��

�

zTarFile.list��filterc	Cs6|�d�|dkr|}|jdk	rFtj�|�|jkrF|�dd|�dS|�d|�|�||�}|dkrz|�dd|�dS|dk	r�||�}|dkr�|�dd|�dS|��r�t|d��}|�	||�W5QRXn`|�
��r(|�	|�|�r2tt�|��D]*}|j
tj�||�tj�||�||d�q�n
|�	|�dS)	Nr�r$ztarfile: Skipped %rr#ztarfile: Unsupported type %r�tarfile: Excluded %rr�r�)r�r�rzr%r��_dbgr�r�r��addfilerr��listdir�addr�)r�r�r��	recursiver�r��fr8r8r9r�Ms8



�
zTarFile.addcCs�|�d�t�|�}|�|j|j|j�}|j�|�|jt	|�7_|j
}|dk	r�t||j|j|d�t
|jt�\}}|dkr�|j�tt|�|d7}|j|t7_|j�|�dS)Nr�)rarr#)r�rr(rSr6r7r�r^r�r2r�r[r'r\r�r3r�r�)r�r�r�rWrarbrcr8r8r9r��s

zTarFile.addfilec	CsB|dkr�|j}|dkr�tj�d�}|dkr�ztt�}Wntk
rJYnBXddl}|jddd�}|�|�	|�W5QRX|jdddd�}|r�zt
|}Wn&tk
r�td|�d	��d�YnX||_|St
r�t�d
t�tStSt|t�r�td��|St|��r
|Sz
t
|WStk
�r<td|�d	��d�YnXdS)NZ PYTHON_TARFILE_EXTRACTION_FILTERr)�#)Z
interpolationZcomment_prefixesr�r�)Zfallbackzfilter z
 not foundaThe default behavior of tarfile extraction has been changed to disallow common exploits (including CVE-2007-4559). By default, absolute/parent paths are disallowed and some mode bits are cleared. See https://access.redhat.com/articles/7004769 for more details.zrString names are not supported for TarFile.extraction_filter. Use a function such as tarfile.data_filter directly.)�extraction_filterrz�environrBr��_CONFIG_FILENAME�FileNotFoundError�configparserZConfigParserZ	read_file�_NAMED_FILTERSr�r0�_RH_SAFER_DEFAULT�warnings�warn�RuntimeWarningrrr7r9�	TypeError�callable)r�r�r��filer�Zconfr8r8r9�_get_filter_function�sZ���	
�

zTarFile._get_filter_function�.)�
numeric_ownerr�cCs�g}|�|�}|dkr|}|D]F}|�|||�}|dkr:q|��rL|�|�|j|||��|d�q|jdd�dd�|D]n}tj�||j	�}	z,|j
||	|d�|�||	�|�||	�Wq|t
k
r�}
z|�|
�W5d}
~
XYq|Xq|dS)N��	set_attrsrcSs|jSr�r)r�r8r8r9�<lambda>�r�z$TarFile.extractall.<locals>.<lambda>T)r��reverse)r)r�_get_extract_tarinforr��_extract_one�sortrzr%r�r��chown�utime�chmodr
�_handle_nonfatal_error)r�r%r�rr�Zdirectories�filter_functionrr��dirpathr�r8r8r9�
extractall�s,

�zTarFile.extractallr�cCs4|�|�}|�|||�}|dk	r0|�||||�dSr�)rr	r
)r�rr%rrr�rr�r8r8r9�extract�s
zTarFile.extractc
Cs�t|t�r|�|�}n|}|}z|||�}WnZttfk
r\}z|�|�W5d}~XYn,tk
r�}z|�|�W5d}~XYnX|dkr�|�dd|j	�dS|�
�r�t�|�}tj
�||j�|_|S)Nr$r�)r7r9r�r�r��_handle_fatal_errorr
rr�r�r�rrzr%r�rr)r�rrr%r�Z
unfilteredr�r8r8r9r		s"

zTarFile._get_extract_tarinfoc
Cs�|�d�z"|j|tj�||j�||d�WnVtk
rX}z|�|�W5d}~XYn,tk
r�}z|�	|�W5d}~XYnXdS)Nrwr)
r��_extract_memberrzr%r�r�r�rr
r)r�r�r%rrr�r8r8r9r
%	s
�
zTarFile._extract_onecCs"|jdkr�n|�dd|�dS)Nr#�tarfile: %s)r�r��r�r�r8r8r9r2	s
zTarFile._handle_nonfatal_errorcCsn|jdkr�n\t|t�rP|jdkr6|�dd|j�qj|�dd|j|jf�n|�ddt|�j|f�dS)Nrr#rztarfile: %s %rztarfile: %s %s)r�r7r��filenamer��strerrorrrnrr8r8r9r9	s


zTarFile._handle_fatal_errorcCs�|�d�t|t�r |�|�}n|}|��s6|jtkrB|�||�S|��sR|�	�rzt|j
t�rhtd��q~|�
|�|��SndSdS)Nrwz'cannot extract (sym)link as file object)r�r7r9r�r�rrg�
fileobjectr�rr�r�r	�extractfile�_find_link_target)r�rr�r8r8r9rE	s


zTarFile.extractfilecCsT|�d�}|�dtj�}tj�|�}|r>tj�|�s>t�|�|��sN|�	�rh|�
dd|j|jf�n|�
d|j�|�
�r�|�||�n�|��r�|�||�nx|��r�|�||�nb|��s�|��r�|�||�nD|��s�|�	�r�|�||�n&|jtk�r|�||�n|�||�|�rP|�|||�|�	��sP|�||�|�||�dS)Nr�r#z%s -> %s)rXr�rzr�r%rr��makedirsr�rr�r�rr��makefiler�makedirr��makefifor�r��makedev�makelinkrrg�makeunknownrrr
)r�r��
targetpathrrZ	upperdirsr8r8r9rd	s4


zTarFile._extract_membercCs@z&|jdkrt�|�nt�|d�Wntk
r:YnXdS)Ni�)r�rz�mkdir�FileExistsError�r�r�r$r8r8r9r�	s
zTarFile.makedirc	Cs�|j}|�|j�|j}t|d��b}|jdk	rn|jD]"\}}|�|�t|||t|�q4|�|j�|�	�nt|||jt|�W5QRXdS)Nr�)
r�r�r�r�r�r�r[rr'�truncate)r�r�r$�sourcera�targetr�r'r8r8r9r�	s


zTarFile.makefilecCs"|�||�|�dd|j�dS)Nr#z9tarfile: Unknown file type %r, extracted as regular file.)rr�rr'r8r8r9r#�	s�zTarFile.makeunknowncCs"ttd�rt�|�ntd��dS)N�mkfifozfifo not supported by system)rrzr+r
r'r8r8r9r �	s
zTarFile.makefifocCsjttd�rttd�std��|j}|dkr.d}|��rB|tjO}n
|tjO}t�||t�	|j
|j��dS)N�mknodr!z'special devices not supported by systemr�)rrzr
r�r�r��S_IFBLK�S_IFCHRr,r!rr)r�r�r$r�r8r8r9r!�	s
�zTarFile.makedevcCs�zb|��r0tj�|�r t�|�t�|j|�n0tj�|j�rNt�	|j|�n|�
|�|�|�WnHtk
r�z|�
|�|�|�Wnt
k
r�td��YnXYnXdS)Nz%unable to resolve link inside archive)rrzr%�lexists�unlink�symlinkrr�r�linkrr�symlink_exceptionr�r
r'r8r8r9r"�	s"
��zTarFile.makelinkcCs�ttd�r�t��dkr�|j}|j}|s�ztrB|jrBt�|j�d}Wntk
rXYnXzt	rv|j
rvt	�|j
�d}Wntk
r�YnX|dkr�d}|dkr�d}z4|��r�ttd�r�t�
|||�nt�|||�Wntk
r�td��YnXdS)N�geteuidrr$r;�lchownzcould not change owner)rrzr4r*r)r�r,Zgetgrnamr�r�r+�getpwnamrr5rr�r
)r�r�r$r�g�ur8r8r9r�	s0

z
TarFile.chowncCsB|jdkrdSzt�||j�Wntk
r<td��YnXdS)Nzcould not change mode)r�rzrr�r
r'r8r8r9r
s
z
TarFile.chmodcCsV|j}|dkrdSttd�s dSzt�|||f�Wntk
rPtd��YnXdS)Nr
z"could not change modification time)r(rrzr
r�r
)r�r�r$r(r8r8r9r

s
z
TarFile.utimec
Cs�|�d�|jdk	r$|j}d|_|S|j|j��krZ|j�|jd�|j�d�sZtd��d}z|j�	|�}W�q�t
k
r�}z6|jr�|�dd|j|f�|jt
7_WY�q^W5d}~XY�q�tk
�r6}zR|j�r|�dd|j|f�|jt
7_WY� q^n|jdk�r&tt|���W5d}~XYn�tk
�r^|jdk�rZtd��Ynjtk
�r�}z|jdk�r�tt|���W5d}~XYn0tk
�r�}ztt|���W5d}~XYnX�q�q^|dk	�r�|j�|�nd|_|S)	NZrar#rYr$z0x%X: %srz
empty fileT)r�r�r�r�r�r�r]rr�rarsr�r�r�rKr9rqrrrtr�r�r�)r��mr�r�r8r8r9rk'
sJ



zTarFile.nextc	Cs�|��}d}|dk	rHz|�|�}Wntk
r:d}YnX|d|�}|rXtj�|�}t|�D]D}|rz|j|jkr`d}q`|r�tj�|j�}n|j}||kr`|Sq`|r�t|��dS)NFT)	r��indexr0rzr%�normpath�reversedr�r�)	r�r�r��	normalizer�Zskippingr:r�member_namer8r8r9r�]
s,

zTarFile._getmembercCs|��}|dkrqqd|_dSr�)rkr�r�r8r8r9r��
sz
TarFile._loadcCs:|jrtd|jj��|dk	r6|j|kr6td|j��dS)Nz%s is closedzbad operation for mode %r)r�r�r�rnr�)r�r�r8r8r9r��
szTarFile._checkcCs`|��r.d�tdtj�|j�|jf��}d}n
|j}|}|j||dd�}|dkr\t	d|��|S)Nr�T)r�r=zlinkname %r not found)
rr�r�rzr%rr�rr�r�)r�r�r�limitrr8r8r9r�
s zTarFile._find_link_targetccs�|jr|jEdHdSd}|jdk	r:|��}|d7}|V|t|j�krT|j|}n"|jsr|��}|svd|_dSndS|d7}|Vq:dS)Nrr#T)r�r�r�rkr2)r�r:r�r8r8r9�__iter__�
s$
zTarFile.__iter__cCs||jkrt|tjd�dS)N�r)r�rkri�stderr)r��level�msgr8r8r9r��
s
zTarFile._dbgcCs|��|Sr�)r�r�r8r8r9�	__enter__�
szTarFile.__enter__cCs,|dkr|��n|js"|j��d|_dSr�)r�r�r�r�)r�rr'�	tracebackr8r8r9�__exit__�
s


zTarFile.__exit__)
NrwNNNNNNr"NNNN)rwN)rwNr�)rwNr�)rwNN)NNN)T)NT)N)rN)r�T)TF)NF)N)=rnrorpr�r�r�r�rrSrr6r7rr�r�rr�r�r�r�rr�r�r�r�r�r�r�r�r�r�r}r�r�rrrr	r
rrrrrrr#r r!r"rrr
rkr�r�r�rr@r�rErGr8r8r8r9rBs��
oZ �


c&3
5�-�
�
1!
6
(

	cCs2zt|�}|��WdStk
r,YdSXdS)NTF)rr�r)r�r�r8r8r9r�
sc	Csddl}d}|j|d�}|jdddddd	�|jd
dtdd
�|jdd�}|jddddd�|jdddddd�|jdddddd�|jdd dd!d�|��}|jr�|jdkr�|�d"d#�|j	dk	�r4|j	}t
|��rt|d$�� }|��t
|��tjd%�W5QRX|j�r0t
d&�|��n|�d"d'�|���n�|jdk	�r�|j}t
|��rxt�|d(��}|j|jd)�W5QRXn|�d"d'�|���nv|jdk	�rbt|j�d"k�r�|jd}tj}n,t|j�d*k�r�|j\}}n|�d"|���t
|��rNt�|d(��}|j||jd+�W5QRX|j�r`|d,k�r8d-�|�}	nd.�||�}	t
|	�n|�d"d'�|��n�|jdk	�r|j�d�}
tj�|
�\}}d/d/d0d0d1d1d1d1d2�}
||
k�r�d3|
|nd4}|j}t�|
|��}|D]}|�|��q�W5QRX|j�rt
d5�|
��dS)6Nrz3A simple command-line interface for tarfile module.)�descriptionz-vz	--verbose�
store_trueFzVerbose output)�action�default�helpz--filterz<filtername>zFilter for extraction)�metavar�choicesrLT)Zrequiredz-lz--list�	<tarfile>zShow listing of a tarfile)rMrLz-ez	--extract�+)rOz<output_dir>zExtract tarfile into target dir)�nargsrMrLz-cz--create)z<name>z<file>zCreate tarfile from sourcesz-tz--testzTest if a tarfile is validr#z&--filter is only valid for extraction
rwrAz{!r} is a tar archive.z{!r} is not a tar archive.
r�)r�r$)r%r�rz{!r} file is extracted.z+{!r} file is extracted into {!r} directory.r�r�r�)r�z.tgzz.xzz.txzz.bz2z.tbzz.tbz2z.tb2zw:rxz{!r} file created.)�argparse�ArgumentParser�add_argumentr�Zadd_mutually_exclusive_group�
parse_argsr�r�exitZtestrrr�rkrirBr�rSr}rr2rz�curdirZformat_helprZcreate�popr%�splitextr�)rRrH�parserrs�argsr_r�ZtfrWrDZtar_name�_ZextZcompressionsZtar_modeZ	tar_files�	file_namer8r8r9�main�
s���
�
�
�
�




�
�
r^�__main__)T)l�version�
__author__�__credits__�builtinsrr�rirzr�rZr�r�rVrrqr�r�r�r��AttributeError�NotImplementedErrorr3r��	NameError�__all__r�r�r3r�r�r0r+r-r,rArrUr�r�rCrDrr�ZCONTTYPEr3r2rVr;r=rdr
rrrrgr�rYr�rxr8rIr�r�r�getfilesystemencodingr:r?rNrTrXr[rl�	Exceptionrr
rrr	rrqrrrsrKrtrur��objectr�r��BufferedReaderr�r�r�r�r�r�r�rrrr
r�rrrrr^rnr8r8r8r9�<module> s:


�����
sh

?�u)_
__pycache__/pkgutil.cpython-38.opt-1.pyc000064400000037722151153537600014043 0ustar00U

e5d�S�@sxdZddlmZddlmZddlZddlZddlZddl	Z	ddl
Z	ddlZddlm
Z
ddlZdddd	d
ddd
ddddgZedd�Zde_dd�Zdd�Zd+dd
�Zd,dd�Zed-dd��Zd.dd�Ze�ejje�dd�ZGd d
�d
�ZGd!d�d�Zz.ddlZdd"lmZd/d#d$�Ze�ee�Wne k
�r@YnXd%d�Z!d0d&d�Z"d'd�Z#d(d	�Z$d)d�Z%d*d�Z&dS)1zUtilities to support packages.�)�
namedtuple)�singledispatchN)�
ModuleType�get_importer�iter_importers�
get_loader�find_loader�
walk_packages�iter_modules�get_data�ImpImporter�	ImpLoader�	read_code�extend_path�
ModuleInfozmodule_finder name ispkgz.A namedtuple with minimal info about a module.cCsRz
|j}Wn:tk
rD|�|�}|dkr2YdStj�||�YSX||�SdS)z'Return the finder-specific module spec.N)�	find_spec�AttributeError�find_module�	importlib�util�spec_from_loader)�finder�namer�loader�r�/usr/lib64/python3.8/pkgutil.py�	_get_specs

rcCs6ddl}|�d�}|tjjkr"dS|�d�|�|�S)Nr��)�marshal�readrr�MAGIC_NUMBER�load)�streamr�magicrrrr(s

�c	#s�ifdd��t||�D]�}|V|jrzt|j�WnNtk
rZ|dk	rV||j�Yqtk
r�|dk	r|||j�n�YqXttj|jdd�p�g}�fdd�|D�}t	||jd|�EdHqdS)a�Yields ModuleInfo for all modules recursively
    on path, or, if path is None, all accessible modules.

    'path' should be either None or a list of paths to look for
    modules in.

    'prefix' is a string to output on the front of every module name
    on output.

    Note that this function must import all *packages* (NOT all
    modules!) on the given path, in order to access the __path__
    attribute to find submodules.

    'onerror' is a function which gets called with one argument (the
    name of the package which was being imported) if any exception
    occurs while trying to import a package.  If no onerror function is
    supplied, ImportErrors are caught and ignored, while all other
    exceptions are propagated, terminating the search.

    Examples:

    # list all modules python can access
    walk_packages()

    # list all submodules of ctypes
    walk_packages(ctypes.__path__, ctypes.__name__+'.')
    cSs||krdSd||<dS)NTr)�p�mrrr�seenRszwalk_packages.<locals>.seenN�__path__csg|]}�|�s|�qSrr)�.0r&�r(rr�
<listcomp>isz!walk_packages.<locals>.<listcomp>�.)
r
�ispkg�
__import__r�ImportError�	Exception�getattr�sys�modulesr	)�path�prefix�onerror�inforr+rr	5s ccsr|dkrt�}nt|t�r$td��n
tt|�}i}|D]6}t||�D]&\}}||krDd||<t|||�VqDq6dS)aYields ModuleInfo for all submodules on path,
    or, if path is None, all top-level modules on sys.path.

    'path' should be either None or a list of paths to look for
    modules in.

    'prefix' is a string to output on the front of every module name
    on output.
    Nz9path must be None or list of paths to look for modules in�)r�
isinstance�str�
ValueError�mapr�iter_importer_modulesr)r5r6Z	importers�yielded�irr.rrrr
ns



cCst|d�sgS|�|�S)Nr
)�hasattrr
)�importerr6rrrr>�s
r>c	cs$|jdkstj�|j�sdSi}ddl}zt�|j�}Wntk
rPg}YnX|��|D]�}|�|�}|dks^||kr~q^tj�|j|�}d}|s�tj�|�r�d|kr�|}zt�|�}	Wntk
r�g}	YnX|	D]}|�|�}
|
dkr�d}q�q�q^|r^d|kr^d||<|||fVq^dS�Nr�__init__Fr-Tr9�	r5�os�isdir�inspect�listdir�OSError�sort�
getmodulename�join)rBr6r?rH�	filenames�fn�modnamer5r.�dircontents�subnamerrr�_iter_file_finder_modules�s<



rSc	Cs.t���t�dt�t�d�aW5QRXdS)N�ignore�imp)�warnings�catch_warnings�simplefilter�DeprecationWarningr�
import_modulerUrrrr�_import_imp�s
r[c@s.eZdZdZd
dd�Zddd�Zddd	�ZdS)
raPEP 302 Finder that wraps Python's "classic" import algorithm

    ImpImporter(dirname) produces a PEP 302 finder that searches that
    directory.  ImpImporter(None) produces a PEP 302 finder that searches
    the current sys.path, plus any modules that are frozen or built-in.

    Note that ImpImporter does not currently support being used by placement
    on sys.meta_path.
    NcCst�dt�t�||_dS�Nz5This emulation is deprecated, use 'importlib' instead)rV�warnrYr[r5)�selfr5rrrrD�s
�zImpImporter.__init__cCs�|�d�d}||kr$|jdkr$dS|jdkr4d}ntj�|j�g}zt�||�\}}}Wntk
rpYdSXt||||�S)Nr-���)�splitr5rF�realpathrUrr0r
)r^�fullnamer5rR�file�filename�etcrrrr�s
zImpImporter.find_moduler%c	cs$|jdkstj�|j�sdSi}ddl}zt�|j�}Wntk
rPg}YnX|��|D]�}|�|�}|dks^||kr~q^tj�|j|�}d}|s�tj�|�r�d|kr�|}zt�|�}	Wntk
r�g}	YnX|	D]}|�|�}
|
dkr�d}q�q�q^|r^d|kr^d||<|||fVq^dSrCrE)r^r6r?rHrNrOrPr5r.rQrRrrrr
�s<



zImpImporter.iter_modules)N)N)r%)�__name__�
__module__�__qualname__�__doc__rDrr
rrrrr�s


c@sneZdZdZdZZdd�Zdd�Zdd�Zd	d
�Z	dd�Z
d
d�Zddd�Zddd�Z
dd�Zddd�ZdS)r
zBPEP 302 Loader that wraps Python's "classic" import algorithm
    NcCs.t�dt�t�||_||_||_||_dSr\)rVr]rYr[rcrdrbre)r^rbrcrdrerrrrDs�zImpLoader.__init__cCs:|��zt�||j|j|j�}W5|jr4|j��X|S)N)�_reopenrc�closerU�load_modulerdre)r^rb�modrrrrlszImpLoader.load_modulec
Cs*t|d��}|��W5QR�SQRXdS)N�rb)�openr )r^�pathnamercrrrr%szImpLoader.get_datacCsT|jrP|jjrP|jd}|tjkr2t|jd�|_n|tjtjfkrPt|jd�|_dS)N��rrn)	rc�closedrerU�	PY_SOURCErord�PY_COMPILED�C_EXTENSION)r^�mod_typerrrrj)s

zImpLoader._reopencCs0|dkr|j}n||jkr,td|j|f��|S)Nz,Loader for module %s cannot handle module %s)rbr0�r^rbrrr�	_fix_name1s
�zImpLoader._fix_namecCs|�|�}|jdtjkS�Nrq)ryrerU�
PKG_DIRECTORYrxrrr�
is_package9s
zImpLoader.is_packagecCs�|�|�}|jdkr�|jd}|tjkrD|�|�}t||jd�|_nJ|tjkrv|�	�zt|j
�|_W5|j
��Xn|tj
kr�|����|_|jS)Nrq�exec)ry�codererUrt�
get_source�compilerdrurjrcrkrr{�
_get_delegate�get_code)r^rbrw�sourcerrrr�=s






zImpLoader.get_codec	Cs�|�|�}|jdkr�|jd}|tjkrP|��z|j��|_W5|j��Xnd|tj	kr�t
j�|j
dd��r�t|j
dd�d��}|��|_W5QRXn|tjkr�|����|_|jS)Nrqr_rr)ryr�rerUrtrjrcrkr rurFr5�existsrdror{r�r)r^rbrw�frrrrNs





zImpLoader.get_sourcecCst|j�}t|d�}|jS)NrD)rrdrr)r^r�specrrrr�`s

zImpLoader._get_delegatecCsH|�|�}|jd}|tjkr*|����S|tjtjtjfkrD|j	SdSrz)
ryrerUr{r��get_filenamertrurvrd)r^rbrwrrrr�es


zImpLoader.get_filename)N)N)N)rfrgrhrir~r�rDrlrrjryr|r�rr�r�rrrrr
s	

)�zipimporterc	cs�ttj|j�}|j}t|�}i}ddl}|D]�}|�|�s>q.||d��t	j
�}t|�dkr�|d�d�r�|d|kr�d||d<||ddfVt|�dkr�q.|�|d�}|dkr�q.|r.d|kr.||kr.d||<||dfVq.dS)	Nrrqr9z__init__.pyTrDr-F)�sorted�	zipimport�_zip_directory_cache�archiver6�lenrH�
startswithr`rF�seprL)	rBr6Zdirlist�_prefixZplenr?rHrOrPrrr�iter_zipimport_modulesss*
r�cCsxt�|�}ztj|}WnZtk
rrtjD]:}z ||�}tj�||�WqnWq.tk
rfYq.Xq.d}YnX|S)z�Retrieve a finder for the given path item

    The returned finder is cached in sys.path_importer_cache
    if it was newly created by a path hook.

    The cache (or part of it) can be cleared manually if a
    rescan of sys.path_hooks is necessary.
    N)rF�fsdecoder3�path_importer_cache�KeyError�
path_hooks�
setdefaultr0)Z	path_itemrB�	path_hookrrrr�s	



ccs�|�d�rd�|�}t|��d|krV|�d�d}t�|�}t|dd�}|dkrhdSntjEdHtj	}|D]}t
|�VqldS)a�Yield finders for the given module name

    If fullname contains a '.', the finders will be for the package
    containing fullname, otherwise they will be all registered top level
    finders (i.e. those on both sys.meta_path and sys.path_hooks).

    If the named module is in a package, that package is imported as a side
    effect of invoking this function.

    If no module name is specified, all top level finders are produced.
    r-�'Relative module name {!r} not supportedrr)N)r��formatr0�
rpartitionrrZr2r3�	meta_pathr5r)rb�msgZpkg_nameZpkgr5�itemrrrr�s


cCsn|tjkr tj|}|dkr dSt|t�rb|}t|dd�}|dk	rF|St|dd�dkrZdS|j}n|}t|�S)z�Get a "loader" object for module_or_name

    Returns None if the module cannot be found or imported.
    If the named module is not already imported, its containing package
    (if any) is imported, in order to establish the package __path__.
    N�
__loader__�__spec__)r3r4r:rr2rfr)Zmodule_or_name�modulerrbrrrr�s


cCs�|�d�rd�|�}t|��ztj�|�}WnFttttfk
rr}z d}t|�|t	|�|��|�W5d}~XYnX|dk	r�|j
SdS)z�Find a "loader" object for fullname

    This is a backwards compatibility wrapper around
    importlib.util.find_spec that converts most failures to ImportError
    and only returns the loader rather than the full spec
    r-r�z,Error while finding loader for {!r} ({}: {})N)r�r�r0rrrr�	TypeErrorr<�typer)rbr�r�Zexrrrr�s

*cCs�t|t�s|S|d}|dd�}|�d�\}}}|rfztj|j}Wqlttfk
rb|YSXntj}|D�]&}t|t	�s�qpt
|�}|dk	r�g}	t|d�r�|�|�}
|
dk	r�|
j
p�g}	nt|d�r�|�|�\}}	|	D]}||kr�|�|�q�tj�||�}tj�|�rpzt|�}
Wn8tk
�rP}ztj�d||f�W5d}~XYqpX|
�<|
D]0}|�d�}|�r\|�d��r��q\|�|��q\W5QRXqp|S)	a�Extend a package's path.

    Intended use is to place the following code in a package's __init__.py:

        from pkgutil import extend_path
        __path__ = extend_path(__path__, __name__)

    This will add to the package's __path__ all subdirectories of
    directories on sys.path named after the package.  This is useful
    if one wants to distribute different parts of a single logical
    package as multiple directories.

    It also looks for *.pkg files beginning where * matches the name
    argument.  This feature is similar to *.pth files (see site.py),
    except that it doesn't special-case lines starting with 'import'.
    A *.pkg file is trusted at face value: apart from checking for
    duplicates, all entries found in a *.pkg file are added to the
    path, regardless of whether they are exist the filesystem.  (This
    is a feature.)

    If the input path is not a list (as is the case for frozen
    packages) it is returned unchanged.  The input path is not
    modified; an extended copy is returned.  Items are only appended
    to the copy at the end.

    It is assumed that sys.path is a sequence.  Items of sys.path that
    are not (unicode or 8-bit) strings referring to existing
    directories are ignored.  Unicode items of sys.path that cause
    errors when used as filenames may cause this function to raise an
    exception (in line with os.path.isdir() behavior).
    z.pkgNr-rrzCan't open %s: %s
�
�#)r:�listr�r3r4r)r�rr5r;rrAr�submodule_search_locationsr�appendrFrM�isfilerorJ�stderr�write�rstripr�)r5rZ	sname_pkgZparent_package�_Z
final_nameZsearch_path�dirr�portionsr�ZportionZpkgfiler�r��linerrrr�sR!





�
cCs�tj�|�}|dkrdS|j}|dks0t|d�s4dStj�|�pJtj�	|�}|dks^t|d�sbdS|�
d�}|�dtj
�|j��tj
j|�}|�|�S)afGet a resource from a package.

    This is a wrapper round the PEP 302 loader get_data API. The package
    argument should be the name of a package, in standard module format
    (foo.bar). The resource argument should be in the form of a relative
    filename, using '/' as the path separator. The parent directory name '..'
    is not allowed, and nor is a rooted name (starting with a '/').

    The function returns a binary string, which is the contents of the
    specified resource.

    For packages located in the filesystem, which have already been imported,
    this is the rough equivalent of

        d = os.path.dirname(sys.modules[package].__file__)
        data = open(os.path.join(d, resource), 'rb').read()

    If the package cannot be located or loaded, or it uses a PEP 302 loader
    which does not support get_data(), then None is returned.
    Nr�__file__�/r)rrrrrAr3r4�get�
_bootstrap�_loadr`�insertrFr5�dirnamer�rMr)�package�resourcer�rrm�partsZ
resource_namerrrrVs
�
)Nr%N)Nr%)r%)r%)r%)r%)'ri�collectionsr�	functoolsrZ
simplegenericr�importlib.util�importlib.machineryrFZos.pathr3�typesrrV�__all__rrrr	r
r>rS�register�	machinery�
FileFinderr[rr
r�r�r�r0rrrrrrrrrr�<module>sh�

9

(�Jc

^__pycache__/enum.cpython-38.pyc000064400000062554151153537600012372 0ustar00U

e5d���@s�ddlZddlmZmZddddddd	gZd
d�Zdd
�Zdd�Zdd�Ze	�Z
Gdd�d�ZGdd�de�Z
dZGdd�de�ZGdd�ded�ZGdd�dee�Zdd�ZGdd�de�ZGdd�dee�Zdd�Zdd	�Zd d!�Zd"d#�ZdS)$�N)�MappingProxyType�DynamicClassAttribute�EnumMeta�Enum�IntEnum�Flag�IntFlag�auto�uniquecCst|d�pt|d�pt|d�S)z?
    Returns True if obj is a descriptor, False otherwise.
    �__get__�__set__�
__delete__)�hasattr)�obj�r�/usr/lib64/python3.8/enum.py�_is_descriptors

��rcCsLt|�dkoJ|dd�|dd�ko.dknoJ|ddkoJ|ddkS)z=
    Returns True if a __dunder__ name, False otherwise.
    �N�����__�_�����len��namerrr�
_is_dunders&�
�
�rcCsLt|�dkoJ|d|dko&dknoJ|dd�dkoJ|dd�dkS)z;
    Returns True if a _sunder_ name, False otherwise.
    rr���r�rrrrrr�
_is_sunder!s���r cCsdd�}||_d|_dS)z,
    Make the given class un-picklable.
    cSstd|��dS)Nz%r cannot be pickled)�	TypeError��self�protorrr�_break_on_call_reduce0sz6_make_class_unpicklable.<locals>._break_on_call_reducez	<unknown>N)�
__reduce_ex__�
__module__)�clsr%rrr�_make_class_unpicklable,sr)c@seZdZdZeZdS)r	zP
    Instances are replaced with an appropriate value in Enum class suites.
    N)�__name__r'�__qualname__�__doc__�
_auto_null�valuerrrrr	6scs,eZdZdZ�fdd�Z�fdd�Z�ZS)�	_EnumDictz�
    Track enum member order and ensure member names are not reused.

    EnumMeta will use the names found in self._member_names as the
    enumeration member names.
    cs&t���g|_g|_g|_d|_dS)NF)�super�__init__�
_member_names�_last_values�_ignore�_auto_called�r#��	__class__rrr1Ds

z_EnumDict.__init__csdt|�r�|dkrtd��|dkr<|jr.td��t|d|�nV|dkr�t|t�r`|�dd���}nt	|�}||_
t|�t|j�@}|r�td	|f��n�t
|�r�|d
kr�d}n�||jkr�td|��n�||j
kr�n�t|��sR||kr�td
|||f��t|t��r:|jtk�r4|�|dt|j�|jdd��|_d|_|j}|j�|�|j�|�t��||�dS)z�
        Changes anything not dundered or not a descriptor.

        If an enum member name is used twice, an error is raised; duplicate
        values are not checked for.

        Single underscore (sunder) names are reserved.
        )�_order_�_create_pseudo_member_�_generate_next_value_�	_missing_�_ignore_z(_names_ are reserved for future Enum user;z4_generate_next_value_ must be defined before members�_generate_next_valuer=�,� z-_ignore_ cannot specify already set names: %r�	__order__r9zAttempted to reuse key: %rz%r already defined as: %rrNT)r �
ValueErrorr5r!�setattr�
isinstance�str�replace�split�listr4�setr2rrr	r.r-r>rr3�appendr0�__setitem__)r#�keyr.�alreadyr7rrrKKsT	
��


�z_EnumDict.__setitem__)r*r'r+r,r1rK�
__classcell__rrr7rr/=sr/cs�eZdZdZedd��Z�fdd�Zdd�Zd/dddd	d
�dd�Zd
d�Z	�fdd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zedd��Zdd�Zdd �Z�fd!d"�Zdddd	d
�d#d$�Zd0d%d&�Zd'd(�Zed)d*��Zed+d,��Zed-d.��Z�ZS)1rz
    Metaclass for Enum
    cCs>|�||�t�}|�||�\}}|dk	r:t|dd�|d<|S)Nr;)�_check_for_existing_membersr/�_get_mixins_�getattr)�metaclsr(�bases�	enum_dict�member_type�
first_enumrrr�__prepare__�s�zEnumMeta.__prepare__c	s��dg��d��d}|D]}��|d�q|�||�\�}|���|�\}}}	�fdd��jD�}
�jD]
}�|=qn��dd�}t|
�ddh@}
|
r�td�d�	|
����d	�kr�d
�d	<t
��|||��}g|_i|_
�|_dd�|��D�}i|_d
�k�r2�tk	�r2d}t�fdd�|D���s2t|��jD�]*}|
|}t|t��sZ|f}n|}�tk�rn|f}|	�s�||�}t|d��s�||_n6||f|��}t|d��sƈtk�r�||_n
�|�|_|j}||_||_|j|�|j
��D]"\}}|j|jk�r�|}�q�q�|j�|�||k�r2t|||�||j
|<z||j|<Wntk
�r`YnX�q8dD]V}|�k�r|�qjt||�}t�|d�}t||d�}|dk	�rj||k�rjt|||��qjtdk	�r�|�r�||_ tj|_|dk	�rt|t!��r|�"dd��#�}||jk�rtd��|S)Nr=csi|]}|�|�qSrr)�.0�k)�	classdictrr�
<dictcomp>�sz$EnumMeta.__new__.<locals>.<dictcomp>r9�mro�zInvalid enum member name: {0}r?r,zAn enumeration.cSs.h|]&}|j��D]\}}t|t�r|�qqSr)�__dict__�itemsrDr)rX�crY�vrrr�	<setcomp>�s

�z#EnumMeta.__new__.<locals>.<setcomp>r&)�__getnewargs_ex__�__getnewargs__r&�
__reduce__c3s|]}|�jkVqdS�N)r^�rX�m)rUrr�	<genexpr>�sz#EnumMeta.__new__.<locals>.<genexpr>�_value_)�__repr__�__str__�
__format__r&r@z#member order does not match _order_)$�
setdefaultrJ�poprP�
_find_new_r2rIrB�format�joinr0�__new__�_member_names_�_member_map_�
_member_type_r\�_value2member_map_�object�anyr)rD�tuplerrj�_name_�__objclass__r1r_rCr!rQr�__new_member__rErFrG)rRr(rSrZ�ignorerLrVrs�save_new�use_args�enum_membersrr9�
invalid_names�
enum_class�dynamic_attributes�methods�member_namer.�args�enum_member�canonical_member�class_method�
obj_method�enum_methodr7)rZrUrrs�s��

��













zEnumMeta.__new__cCsdS)z6
        classes/types should always be True.
        Trr6rrr�__bool__3szEnumMeta.__bool__Nr��module�qualname�type�startcCs*|dkr|�||�S|j||||||d�S)a!
        Either returns an existing member, or creates a new enum class.

        This method is used both when an enum class is given a value to match
        to an enumeration member (i.e. Color(3)) and for the functional API
        (i.e. Color = Enum('Color', names='RED GREEN BLUE')).

        When used for the functional API:

        `value` will be the name of the new class.

        `names` should be either a string of white-space/comma delimited names
        (values will start at `start`), or an iterator/mapping of name, value pairs.

        `module` should be set to the module this class is being created in;
        if it is not set, an attempt to find that module will be made, but if
        it fails the class will not be picklable.

        `qualname` should be set to the actual location this class can be found
        at in its module; by default it is set to the global scope.  If this is
        not correct, unpickling will fail in some circumstances.

        `type`, if set, will be mixed in as the first base class.
        Nr�)rs�_create_)r(r.�namesr�r�r�r�rrr�__call__9s�zEnumMeta.__call__cCs:t|t�s$tdt|�j|jjf��t||�o8|j|jkS)N�3unsupported operand type(s) for 'in': '%s' and '%s')rDrr!r�r+r8r{ru)r(�memberrrr�__contains__^s
��zEnumMeta.__contains__cs(||jkrtd|j��t��|�dS)Nz%s: cannot delete Enum member.)ru�AttributeErrorr*r0�__delattr__)r(�attrr7rrr�es
zEnumMeta.__delattr__cCsddddg|jS)Nr8r,�__members__r'�rtr6rrr�__dir__ls
��zEnumMeta.__dir__cCs@t|�rt|��z|j|WStk
r:t|�d�YnXdS)a=
        Return the enum member matching `name`

        We use __getattr__ instead of descriptors or inserting into the enum
        class' __dict__ in order to support `name` and `value` being both
        properties for enum members (which live in the class' __dict__) and
        enum members themselves.
        N)rr�ru�KeyError�r(rrrr�__getattr__rs	zEnumMeta.__getattr__cCs
|j|Srf�rur�rrr�__getitem__�szEnumMeta.__getitem__cs�fdd��jD�S)z6
        Returns members in definition order.
        c3s|]}�j|VqdSrfr��rXr�r(rrri�sz$EnumMeta.__iter__.<locals>.<genexpr>r�r�rr�r�__iter__�szEnumMeta.__iter__cCs
t|j�Srf)rrtr�rrr�__len__�szEnumMeta.__len__cCs
t|j�S)z�
        Returns a mapping of member name->value.

        This mapping lists all enum members, including aliases. Note that this
        is a read-only view of the internal mapping.
        )rrur�rrrr��szEnumMeta.__members__cCs
d|jS)Nz	<enum %r>)r*r�rrrrk�szEnumMeta.__repr__cs�fdd�t�j�D�S)z>
        Returns members in reverse definition order.
        c3s|]}�j|VqdSrfr�r�r�rrri�sz(EnumMeta.__reversed__.<locals>.<genexpr>)�reversedrtr�rr�r�__reversed__�szEnumMeta.__reversed__cs0|j�di�}||krtd��t��||�dS)a
        Block attempts to reassign Enum members.

        A simple assignment to the class namespace only changes one of the
        several possible ways to get an Enum member from the Enum class,
        resulting in an inconsistent Enumeration.
        ruzCannot reassign members.N)r^�getr�r0�__setattr__)r(rr.�
member_mapr7rrr��szEnumMeta.__setattr__c
Cs~|j}|dkr|fn||f}|�||�\}	}
|�||�}t|t�rR|�dd���}t|ttf�r�|r�t|dt�r�|g}}g}
t	|�D]8\}}|
�
||||
dd��}|
�|�|�||f�q�|D].}t|t�r�|||}}n|\}}|||<q�|�||||�}|dk�rPzt
�d�jd}Wn*tttfk
�rN}zW5d}~XYnX|dk�rdt|�n||_|dk	�rz||_|S)a�
        Convenience method to create a new Enum class.

        `names` can be:

        * A string containing member names, separated either with spaces or
          commas.  Values are incremented by 1 from `start`.
        * An iterable of member names.  Values are incremented by 1 from `start`.
        * An iterable of (member name, value) pairs.
        * A mapping of member name -> value pairs.
        Nr?r@rrr*)r8rPrWrDrErFrGrzrH�	enumerater;rJrs�sys�	_getframe�	f_globalsr�rBr�r)r'r+)r(�
class_namer�r�r�r�r�rRrSrrVrZ�original_names�last_values�countrr.�itemr��member_valuer��excrrrr��s<
 







zEnumMeta._create_cs�ttj|�}|rt|�}n|}�fdd�|��D�}z|jdd�d�Wn$tk
rn|jdd�d�YnX||||d�}t|_|�|j	�|||<|S)z[
        Create a new Enum subclass that replaces a collection of global constants
        cs g|]\}}�|�r||f�qSrr)rXrr.��filterrr�
<listcomp>�s�z&EnumMeta._convert_.<locals>.<listcomp>cSs|d|dfS)Nrrr��trrr�<lambda>��z$EnumMeta._convert_.<locals>.<lambda>)rLcSs|dS�Nrrr�rrrr��r�)r�)
�varsr��modulesr_�sortr!�_reduce_ex_by_namer&�updater�)r(rr�r��source�module_globals�membersrr�r�	_convert_�s 	

�zEnumMeta._convert_cOs$ddl}|jdtdd�|j||�S)NrzI_convert is deprecated and will be removed in 3.9, use _convert_ instead.r)�
stacklevel)�warnings�warn�DeprecationWarningr�)r(r��kwargsr�rrr�_converts�zEnumMeta._convertcCs<|D]2}|jD]&}t|t�r|jrtd||jf��qqdS)Nz %s: cannot extend enumeration %r)�__mro__�
issubclassrrtr!r*)r�rS�chain�baserrrrO
s
��z$EnumMeta._check_for_existing_memberscsT|sttfS�fdd�}|d}t|t�s2td��||�p<t}|jrLtd��||fS)z�
        Returns the type for creating enum members, and the first inherited
        enum class.

        bases: the tuple of bases that was given to __new__
        cs�g}|D]t}d}|jD]d}|tkr&qqt|t�rL|jtk	rz|�|j�qqd|jkrvt|t�rbq|�|pl|�qq|}qqt|�dkr�td�|f��n|r�|dSdSdS)Nrsrz%r: too many data types: %rr)	r�rxr�rrvrJr^rr!)rS�
data_typesr��	candidater��r�rr�_find_data_types*




z.EnumMeta._get_mixins_.<locals>._find_data_typerzZnew enumerations should be created as `EnumName([mixin_type, ...] [data_type,] enum_type)`zCannot extend enumerations)rxrr�r!rt)r�rSr�rVrUrr�rrPs
zEnumMeta._get_mixins_c	Cs�|�dd�}|dk	}|dkrpdD]H}||fD].}t||d�}|ddjtjtjhkr,|}q\q,|dk	r qpq tj}|tjkr�d}nd}|||fS)a
        Returns the __new__ to be used for creating the enum members.

        classdict: the class dictionary given to __new__
        member_type: the data type whose __new__ will be used by default
        first_enum: enumeration to check for an overriding __new__
        rsN)r}rsFT)r�rQrsrxr)	rZrUrVrsr�method�possible�targetr�rrrrpCs*�
zEnumMeta._find_new_)N)N)r*r'r+r,�classmethodrWrsr�r�r�r�r�r�r�r�r��propertyr�rkr�r�r�r�r��staticmethodrOrPrprNrrr7rr�s8

%
	
5
!
	
.c@steZdZdZdd�Zdd�Zedd��Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
edd��Zedd��ZdS)rzV
    Generic enumeration.

    Derive from this class to define new enumerations.
    c
Cst|�|kr|Sz|j|WStk
r0Yn:tk
rh|j��D]}|j|krH|YSqHYnXzd}|�|�}Wn*tk
r�}z|}d}W5d}~XYnXzdt	||�r�|W�TSt
d||jf�}|dkr�|dkr�|�n|dk�rtd|j|f�}||_|�W5d}d}XdS)N�%r is not a valid %szDerror in %s._missing_: returned %r instead of None or a valid member)
r�rwr�r!ru�valuesrjr<�	ExceptionrDrBr*�__context__)r(r.r�r��result�e�ve_excrrrrsws@


��zEnum.__new__c	Cs6t|�D](}z|dWStk
r.YqXq|S)��
        Generate the next value when not given.

        name: the name of the member
        start: the initial start value or None
        count: the number of existing members
        last_value: the last value assigned or None
        rN)r�r!)rr�r�r��
last_valuerrrr;�s	zEnum._generate_next_value_cCsdSrfr)r(r.rrrr<�szEnum._missing_cCsd|jj|j|jfS)N�<%s.%s: %r>)r8r*r{rjr6rrrrk�s
�z
Enum.__repr__cCsd|jj|jfS)N�%s.%s)r8r*r{r6rrrrl�szEnum.__str__cs6�fdd��j��D�dd��jD�}dddg|S)z<
        Returns all members and all public methods
        cs2g|]*}|jD]}|ddkr|�jkr|�qqS�rr)r^ru)rXr(rhr6rrr��s
�z Enum.__dir__.<locals>.<listcomp>cSsg|]}|ddkr|�qSr�rrgrrrr��sr8r,r')r8r\r^)r#�added_behaviorrr6rr��s
��zEnum.__dir__cCsJt|�jtjtjfk}|jtks$|r2t}t|�}n|j}|j}|�||�S)z\
        Returns format using actual value type unless __str__ has been overridden.
        )	r�rlrrrvrxrErjrm)r#�format_spec�str_overriddenr(�valrrrrm�s	
zEnum.__format__cCs
t|j�Srf)�hashr{r6rrr�__hash__�sz
Enum.__hash__cCs|j|jffSrf�r8rjr"rrrr&�szEnum.__reduce_ex__cCs|jS)zThe name of the Enum member.)r{r6rrrr�sz	Enum.namecCs|jS)zThe value of the Enum member.�rjr6rrrr.�sz
Enum.valueN)r*r'r+r,rsr;r�r<rkrlr�rmr�r&rrr.rrrrrqs-


)�	metaclassc@seZdZdZdS)rz.Enum where members are also (and must be) intsN)r*r'r+r,rrrrr�scCs|jSrfrr"rrrr��sr�c@speZdZdZdd�Zedd��Zedd��Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)rz
    Support for flags
    c	Csd|s|dk	r|SdSt|�D]:}zt|�}WqXWqtk
rTtd|�d�YqXqd|dS)r�NrzInvalid Flag value: %rr)r��	_high_bitr�r!)rr�r�r�r��high_bitrrrr;s	
zFlag._generate_next_value_cCs.|}|dkr|}|�|�}|dkr*|}|S)�V
        Returns member (possibly creating it) if one can be found for value.
        r)r:)r(r.�original_value�possible_memberrrrr<s
zFlag._missing_cCsb|j�|d�}|dkr^t||�\}}|r:td||jf��t�|�}d|_||_|j�	||�}|S)�L
        Create a composite member iff value contains only members.
        Nr�)
rwr��
_decomposerBr*rxrsr{rjrn)r(r.�
pseudo_memberr�extra_flagsrrrr:#s
zFlag._create_pseudo_member_cCs8t||j�s&tdt|�j|jjf��|j|j@|jkS)zP
        Returns True if self has at least the same flags set as other.
        r�)rDr8r!r�r+rj�r#�otherrrrr�7s��zFlag.__contains__cCsV|j}|jdk	r$d|j|j|jfSt||j�\}}d|jd�dd�|D��|jfS)Nr��|cSsg|]}t|jp|j��qSr�rEr{rjrgrrrr�Hsz!Flag.__repr__.<locals>.<listcomp>)r8r{r*rjr�rr�r#r(r��	uncoveredrrrrkAs
�z
Flag.__repr__cCs�|j}|jdk	r d|j|jfSt||j�\}}t|�dkr^|djdkr^d|j|djfSd|jd�dd�|D��fSdS)Nr�rrz%s.%rr�cSsg|]}t|jp|j��qSrr�rgrrrr�Vsz Flag.__str__.<locals>.<listcomp>)r8r{r*r�rjrrrr�rrrrlLs
�zFlag.__str__cCs
t|j�Srf)�boolrjr6rrrr�Ysz
Flag.__bool__cCs"t||j�stS|�|j|jB�Srf�rDr8�NotImplementedrjr�rrr�__or__\szFlag.__or__cCs"t||j�stS|�|j|j@�Srfrr�rrr�__and__aszFlag.__and__cCs"t||j�stS|�|j|jA�Srfrr�rrr�__xor__fszFlag.__xor__cCsNt|j|j�\}}|�d�}|jD] }||kr"|j|j@s"||B}q"|�|�Sr�)r�r8rj)r#r�r�invertedrhrrr�
__invert__ks


zFlag.__invert__N)r*r'r+r,r;r�r<r:r�rkrlr�rrrrrrrrr�s



c@sTeZdZdZedd��Zedd��Zdd�Zdd	�Zd
d�Z	eZ
eZe	Zdd
�Z
dS)rz)
    Support for integer-based Flags
    cCs*t|t�std||jf��|�|�}|S)r�r�)rD�intrBr*r:)r(r.�
new_memberrrrr<ys

zIntFlag._missing_cCs�|j�|d�}|dkr�|g}t||�\}}|rtt|�}d|}||jkrZ||krZ|�|�||krjd}q*||N}q*t|�D]*}t�||�}d|_||_	|j�
||�}q||S)r�Nrr)rwr�r�r�rJr�r	rsr{rjrn)r(r.r��need_to_createrr��bit�
flag_valuerrrr:�s(
�


zIntFlag._create_pseudo_member_cCs0t||jtf�stS|�|j|�|�jB�}|Srf�rDr8r	rrj)r#r�r�rrrr�szIntFlag.__or__cCs,t||jtf�stS|�|j|�|�j@�Srfrr�rrrr�szIntFlag.__and__cCs,t||jtf�stS|�|j|�|�jA�Srfrr�rrrr�szIntFlag.__xor__cCs|�|j�}|Srfr�)r#r�rrrr�szIntFlag.__invert__N)r*r'r+r,r�r<r:rrr�__ror__�__rand__�__rxor__rrrrrrts
	
 cCs|��dS)zJ
    returns index of highest bit, or -1 if value is zero or negative
    r)�
bit_length�r.rrrr��sr�cCs^g}|j��D]"\}}||jkr|�||jf�q|rZd�dd�|D��}td||f��|S)zI
    Class decorator for enumerations ensuring unique member values.
    z, cSsg|]\}}d||f�qS)z%s -> %sr)rX�aliasrrrrr��szunique.<locals>.<listcomp>z duplicate values found in %r: %s)r�r_rrJrrrB)�enumeration�
duplicatesrr��
alias_detailsrrrr
�s
��cCs�|}|dk}|r*dd�t|j���D�}ndd�t|j���D�}g}|D],\}}|rJ||@|krJ|�|�||M}qJ|s�||jkr�|�|j|�|jdd�dd�t|�d	kr�|dj|kr�|�d�||fS)
z-
    Extract all members from the value.
    rcSs"g|]\}}|jdk	r||f�qSrfr�rXrarhrrrr��s
�z_decompose.<locals>.<listcomp>cSs*g|]"\}}|jdk	st|�r||f�qSrf)r�
_power_of_tworrrrr��s
�cSs|jSrfr�)rhrrrr��r�z_decompose.<locals>.<lambda>T)rL�reverser)rHrwr_rJr�rr.ro)�flagr.�not_covered�negative�flags_to_checkr�r�r�rrrr��s(��

r�cCs|dkrdS|dt|�kS)NrFr)r�rrrrr�sr)r��typesrr�__all__rrr r)rxr-r	�dictr/rr�rr	rr�rrr�r
r�rrrrr�<module>s>�
	LivI%__pycache__/sched.cpython-38.opt-1.pyc000064400000014606151153537600013446 0ustar00U

e5d*�@s�dZddlZddlZddlmZddlZddlmZdgZGdd�dedd��Z	d	e	j_d
e	j
_de	j_de	j_d
e	j
_e�ZGdd�d�ZdS)a�A generally useful event scheduler class.

Each instance of this class manages its own queue.
No multi-threading is implied; you are supposed to hack that
yourself, or use a single instance per application.

Each instance is parametrized with two functions, one that is
supposed to return the current time, one that is supposed to
implement a delay.  You can implement real-time scheduling by
substituting time and sleep from built-in module time, or you can
implement simulated time by writing your own functions.  This can
also be used to integrate scheduling with STDWIN events; the delay
function is allowed to modify the queue.  Time can be expressed as
integers or floating point numbers, as long as it is consistent.

Events are specified by tuples (time, priority, action, argument, kwargs).
As in UNIX, lower priority numbers mean higher priority; in this
way the queue can be maintained as a priority queue.  Execution of the
event means calling the action function, passing it the argument
sequence in "argument" (remember that in Python, multiple function
arguments are be packed in a sequence) and keyword parameters in "kwargs".
The action function may be an instance method so it
has another way to reference private data (besides global variables).
�N)�
namedtuple)�	monotonic�	schedulerc@s8eZdZgZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�EventcCs|j|jf|j|jfkS�N��time�priority��s�o�r
�/usr/lib64/python3.8/sched.py�__eq__$�zEvent.__eq__cCs|j|jf|j|jfkSrrr
r
r
r�__lt__%rzEvent.__lt__cCs|j|jf|j|jfkSrrr
r
r
r�__le__&rzEvent.__le__cCs|j|jf|j|jfkSrrr
r
r
r�__gt__'rzEvent.__gt__cCs|j|jf|j|jfkSrrr
r
r
r�__ge__(rzEvent.__ge__N)	�__name__�
__module__�__qualname__�	__slots__rrrrrr
r
r
rr"srz(time, priority, action, argument, kwargszaNumeric type compatible with the return value of the
timefunc function passed to the constructor.zSEvents scheduled for the same time will be executed
in the order of their priority.z?Executing the event means executing
action(*argument, **kwargs)zGargument is a sequence holding the positional
arguments for the action.zDkwargs is a dictionary holding the keyword
arguments for the action.c@s^eZdZeejfdd�Zdefdd�Zdefdd�Z	dd	�Z
d
d�Zdd
d�Ze
dd��ZdS)rcCs g|_t��|_||_||_dS)zGInitialize a new instance, passing the time and delay
        functionsN)�_queue�	threading�RLock�_lock�timefunc�	delayfunc)�selfrrr
r
r�__init__9s
zscheduler.__init__r
c	Cs@|tkri}t|||||�}|j�t�|j|�W5QRX|S)z�Enter a new event in the queue at an absolute time.

        Returns an ID for the event which can be used to remove it,
        if necessary.

        )�	_sentinelrr�heapq�heappushr)rrr	�action�argument�kwargs�eventr
r
r�enterabsAszscheduler.enterabscCs|��|}|�|||||�S)z{A variant that specifies the time as a relative time.

        This is actually the more commonly used interface.

        )rr()r�delayr	r$r%r&rr
r
r�enterOszscheduler.enterc	Cs.|j�|j�|�t�|j�W5QRXdS)z�Remove an event from the queue.

        This must be presented the ID as returned by enter().
        If the event is not in the queue, this raises ValueError.

        N)rr�remover"�heapify)rr'r
r
r�cancelXszscheduler.cancelc
Cs&|j�|jW5QR�SQRXdS)z!Check whether the queue is empty.N)rr)rr
r
r�emptycszscheduler.emptyTc	Cs�|j}|j}|j}|j}tj}|�H|s4W5QR�q�|d\}}}	}
}|�}||krZd}
nd}
||�W5QRX|
r�|s�||S|||�q|	|
|�|d�qdS)aExecute events until the queue is empty.
        If blocking is False executes the scheduled events due to
        expire soonest (if any) and then return the deadline of the
        next scheduled call in the scheduler.

        When there is a positive delay until the first event, the
        delay function is called and the event is left in the queue;
        otherwise, the event is removed from the queue and executed
        (its action function is called, passing it the argument).  If
        the delay function returns prematurely, it is simply
        restarted.

        It is legal for both the delay function and the action
        function to modify the queue or to raise an exception;
        exceptions are not caught but the scheduler's state remains
        well-defined so run() may be called again.

        A questionable hack is added to allow other threads to run:
        just after an event is executed, a delay of 0 is executed, to
        avoid monopolizing the CPU when other threads are also
        runnable.

        rTFN)rrrrr"�heappop)rZblocking�lock�qrr�poprr	r$r%r&Znowr)r
r
r�runhs(
z
scheduler.runc	Cs:|j�|jdd�}W5QRXtttj|gt|���S)z�An ordered list of upcoming events.

        Events are named tuples with fields for:
            time, priority, action, arguments, kwargs

        N)rr�list�mapr"r/�len)rZeventsr
r
r�queue�szscheduler.queueN)T)rrr�_timer�sleepr r!r(r*r-r.r3�propertyr7r
r
r
rr7s	
2)�__doc__rr"�collectionsrrrr8�__all__rr	r$r%r&�objectr!rr
r
r
r�<module>s__pycache__/fractions.cpython-38.opt-2.pyc000064400000026135151153537600014351 0ustar00U

e5d	_�@s�ddlmZddlZddlZddlZddlZddlZddgZdd�Zdd�Z	ej
jZej
j
Ze�dejejB�ZGd	d�dej�ZdS)
���DecimalN�Fraction�gcdcCsfddl}|�dtd�t|�tkr2t|�kr\nn&|p<|dkrPt�||�St�||�St||�S)Nrz6fractions.gcd() is deprecated. Use math.gcd() instead.�)�warnings�warn�DeprecationWarning�type�int�mathr�_gcd)�a�br�r�!/usr/lib64/python3.8/fractions.pyrs� cCs|r|||}}q|S�Nr�rrrrrr
 sr
aC
    \A\s*                      # optional whitespace at the start, then
    (?P<sign>[-+]?)            # an optional sign, then
    (?=\d|\.\d)                # lookahead for digit or .digit
    (?P<num>\d*)               # numerator (possibly empty)
    (?:                        # followed by
       (?:/(?P<denom>\d+))?    # an optional denominator
    |                          # or
       (?:\.(?P<decimal>\d*))? # an optional fractional part
       (?:E(?P<exp>[-+]?\d+))? # and optional exponent
    )
    \s*\Z                      # and optional whitespace to finish
cs�eZdZdZdQdd��fdd�Zedd	��Zed
d��Zdd
�ZdRdd�Z	e
dd��Ze
dd��Zdd�Z
dd�Zdd�Zdd�Zeeej�\ZZdd�Zeeej�\ZZdd �Zeeej�\ZZd!d"�Zeeej�\ZZ d#d$�Z!ee!ej"�\Z#Z$d%d&�Z%ee%e&�\Z'Z(d'd(�Z)ee)ej*�\Z+Z,d)d*�Z-d+d,�Z.d-d.�Z/d/d0�Z0d1d2�Z1d3d4�Z2d5d6�Z3d7d8�Z4dSd9d:�Z5d;d<�Z6d=d>�Z7d?d@�Z8dAdB�Z9dCdD�Z:dEdF�Z;dGdH�Z<dIdJ�Z=dKdL�Z>dMdN�Z?dOdP�Z@�ZAS)Tr��
_numerator�_denominatorrNT��
_normalizecsRtt|��|�}|dk�rdt|�tkr6||_d|_|St|tj	�rV|j
|_|j|_|St|tt
f�rx|��\|_|_|St|t��rZt�|�}|dkr�td|��t|�d�p�d�}|�d�}|r�t|�}nvd}|�d�}|�rdt|�}||t|�}||9}|�d�}	|	�rBt|	�}	|	d	k�r4|d|	9}n|d|	9}|�d
�dk�rb|}ntd��nft|�tk�r�t|�k�r�nnn@t|tj	��r�t|tj	��r�|j
|j|j
|j}}ntd
��|d	k�r�td|��|�rBt|�tk�rt|�k�r(nnt�||�}
|d	k�r2|
}
n
t||�}
||
}||
}||_||_|S)N�z Invalid literal for Fraction: %rZnum�0�denom�decimal�
�exprZsign�-z2argument should be a string or a Rational instancez+both arguments should be Rational instanceszFraction(%s, 0))�superr�__new__r
rrr�
isinstance�numbers�Rational�	numerator�denominator�floatr�as_integer_ratio�str�_RATIONAL_FORMAT�match�
ValueError�group�len�	TypeError�ZeroDivisionErrorrrr
)�clsr%r&r�self�mrrZscaler�g��	__class__rrr!Tsx

�





$
�

�
$

zFraction.__new__cCsDt|tj�r||�St|t�s8td|j|t|�jf��||���S)Nz.%s.from_float() only takes floats, not %r (%s))r"r#�Integralr'r/�__name__r
r()r1�frrr�
from_float�s
�zFraction.from_floatcCsVddlm}t|tj�r&|t|��}n$t||�sJtd|j|t|�jf��||�	��S)Nrrz2%s.from_decimal() only takes Decimals, not %r (%s))
rrr"r#r7rr/r8r
r()r1Zdecrrrr�from_decimal�s
��zFraction.from_decimalcCs|j|jfSrr�r2rrrr(�szFraction.as_integer_ratio�@Bc
Cs�|dkrtd��|j|kr"t|�Sd\}}}}|j|j}}||}|||}	|	|krZq�||||||	f\}}}}||||}}q<|||}
t||
|||
|�}t||�}t||�t||�kr�|S|SdS)Nrz$max_denominator should be at least 1)rrrr)r,rrr�abs)
r2Zmax_denominatorZp0Zq0Zp1Zq1�n�drZq2�kZbound1Zbound2rrr�limit_denominator�s$ 

zFraction.limit_denominatorcCs|jSr)r�rrrrr%szFraction.numeratorcCs|jSr)rrCrrrr&szFraction.denominatorcCsd|jj|j|jfS)Nz
%s(%s, %s))r6r8rrr<rrr�__repr__"s�zFraction.__repr__cCs(|jdkrt|j�Sd|j|jfSdS)Nrz%s/%s)rr)rr<rrr�__str__'s

zFraction.__str__csT��fdd�}d�jd|_�j|_��fdd�}d�jd|_�j|_||fS)NcsPt|ttf�r�||�St|t�r0�t|�|�St|t�rH�t|�|�StSdSr)r"rrr'�complex�NotImplementedr��fallback_operator�monomorphic_operatorrr�forward~s


z-Fraction._operator_fallbacks.<locals>.forward�__csZt|tj�r�||�St|tj�r4�t|�t|��St|tj�rR�t|�t|��StSdSr)r"r#r$ZRealr'�ComplexrFrG�rrrHrr�reverse�s
z-Fraction._operator_fallbacks.<locals>.reverseZ__r)r8�__doc__)rJrIrKrOrrHr�_operator_fallbacks.sP	
zFraction._operator_fallbackscCs,|j|j}}t|j||j|||�Sr�r&rr%�rr�da�dbrrr�_add�s�z
Fraction._addcCs,|j|j}}t|j||j|||�SrrRrSrrr�_sub�s�z
Fraction._subcCst|j|j|j|j�Sr�rr%r&rrrr�_mul�sz
Fraction._mulcCst|j|j|j|j�SrrXrrrr�_div�s
�z
Fraction._divcCs|j|j|j|jSr�r%r&rrrr�	_floordiv�szFraction._floordivcCs:|j|j}}t|j|||j�\}}|t|||�fSr)r&�divmodr%r)rrrTrUZdivZn_modrrr�_divmod�szFraction._divmodcCs,|j|j}}t|j||j|||�SrrRrSrrr�_mod�sz
Fraction._modcCs�t|tj�r�|jdkr�|j}|dkr>t|j||j|dd�S|jdkrft|j||j|dd�St|j||j|dd�Sq�t|�t|�Snt|�|SdS)NrrFr)	r"r#r$r&r%rrrr')rrZpowerrrr�__pow__�s&

�

��zFraction.__pow__cCs\|jdkr|jdkr||jSt|tj�r<t|j|j�|S|jdkrP||jS|t|�S)Nrr)	rrr"r#r$rr%r&r'rNrrr�__rpow__�s


zFraction.__rpow__cCst|j|jdd�S�NFr�rrrrCrrr�__pos__�szFraction.__pos__cCst|j|jdd�SrbrcrCrrr�__neg__�szFraction.__neg__cCstt|j�|jdd�Srb)rr>rrrCrrr�__abs__�szFraction.__abs__cCs*|jdkr|j|jS|j|jSdS)NrrrCrrr�	__trunc__s
zFraction.__trunc__cCs|j|jSrr[rCrrr�	__floor__
szFraction.__floor__cCs|j|jSrr[rCrrr�__ceil__szFraction.__ceil__cCs�|dkrZt|j|j�\}}|d|jkr,|S|d|jkrB|dS|ddkrR|S|dSdt|�}|dkr�tt||�|�Stt||�|�SdS)Nrrrr)r]r%r&r>r�round)r2ZndigitsZfloorZ	remainder�shiftrrr�	__round__szFraction.__round__cCsPt|jtdt�}|st}nt|j�|t}|dkr:|n|}|dkrLdS|S)Nrr������)�powr�_PyHASH_MODULUS�_PyHASH_INFr>r)r2ZdinvZhash_�resultrrr�__hash__,szFraction.__hash__cCs�t|�tkr |j|ko|jdkSt|tj�rD|j|jkoB|j|jkSt|tj	�r`|j
dkr`|j}t|t�r�t
�|�s~t
�|�r�d|kS||�|�kSntSdS)Nrr�)r
rrrr"r#r$r%r&rM�imag�realr'r�isnan�isinfr:rGrrrr�__eq__Bs
�
zFraction.__eq__cCsht|tj�r&||j|j|j|j�St|t�r`t�	|�sDt�
|�rN|d|�S|||�|��SntSdS)Nrt)
r"r#r$rr&rr%r'rrwrxr:rG)r2�other�oprrr�_richcmpWs
�

zFraction._richcmpcCs|�|tj�Sr)r|�operator�ltrrrr�__lt__mszFraction.__lt__cCs|�|tj�Sr)r|r}�gtrrrr�__gt__qszFraction.__gt__cCs|�|tj�Sr)r|r}�lerrrr�__le__uszFraction.__le__cCs|�|tj�Sr)r|r}�gerrrr�__ge__yszFraction.__ge__cCs
t|j�Sr)�boolrrCrrr�__bool__}szFraction.__bool__cCs|jt|�ffSr)r6r)r<rrr�
__reduce__�szFraction.__reduce__cCs t|�tkr|S|�|j|j�Sr�r
rr6rrr<rrr�__copy__�szFraction.__copy__cCs t|�tkr|S|�|j|j�Srr�)r2Zmemorrr�__deepcopy__�szFraction.__deepcopy__)rN)r=)N)Br8�
__module__�__qualname__�	__slots__r!�classmethodr:r;r(rB�propertyr%r&rDrErQrVr}�add�__add__�__radd__rW�sub�__sub__�__rsub__rY�mul�__mul__�__rmul__rZ�truediv�__truediv__�__rtruediv__r\�floordiv�__floordiv__�
__rfloordiv__r^r]�
__divmod__�__rdivmod__r_�mod�__mod__�__rmod__r`rardrerfrgrhrirlrsryr|rr�r�r�r�r�r�r��
__classcell__rrr5rr<sbm



7

k
)rrrr#r}�re�sys�__all__rr
�	hash_info�modulusrp�infrq�compile�VERBOSE�
IGNORECASEr*r$rrrrr�<module>s
�__pycache__/linecache.cpython-38.opt-2.pyc000064400000005314151153537600014270 0ustar00U

e5d��@sjddlZddlZddlZddlZdddgZddd�Ziadd�Zddd�Zdd	d�Z	dd
d�Z
dd
�ZdS)�N�getline�
clearcache�
checkcachecCs:t||�}d|kr"t|�kr2nn||dSdSdS)N��)�getlines�len)�filename�lineno�module_globals�lines�r
�!/usr/lib64/python3.8/linecache.pyrs
cCsiadS)N)�cacher
r
r
rrscCsX|tkr(t|}t|�dkr(t|dSzt||�WStk
rRt�gYSXdS)Nr�)rr�updatecache�MemoryErrorr)r	r�entryr
r
rr%src	Cs�|dkrtt���}n|tkr&|g}ndS|D]�}t|}t|�dkrHq.|\}}}}|dkr^q.zt�|�}Wn$tk
r�t�|d�Yq.YnX||jks�||j	kr.t�|d�q.dS)Nr)
�listr�keysr�os�stat�OSError�pop�st_size�st_mtime)r	�	filenamesr�size�mtimer�fullnamerr
r
rr5s&
c
Cs�|tkr$tt|�dkr$t�|d�|r<|�d�r@|�d�r@gS|}zt�|�}W�ntk
�rn|}t||�r�zt|d�}Wnt	tfk
r�YnDX|dkr�gYSt|�ddd�|�
�D�|ft|<t|dYStj�|�r�gYSt
jD]d}ztj�||�}Wnttfk
�r0Yq�YnXzt�|�}W�qjWq�tk
�r^Yq�Xq�gYSYnXz"t�|��}|��}W5QRXWntk
�r�gYSX|�r�|d�d	��s�|dd	7<|j|j}	}
|	|
||ft|<|S)
Nr�<�>rcSsg|]}|d�qS)�
r
)�.0�liner
r
r�
<listcomp>qszupdatecache.<locals>.<listcomp>r���r")rrr�
startswith�endswithrrr�	lazycache�ImportError�
splitlines�path�isabs�sys�join�	TypeError�AttributeError�tokenize�open�	readlinesrr)r	rrr�basename�data�dirname�fprrrr
r
rrRs\
�



rcCs�|tkr tt|�dkrdSdS|r8|�d�r<|�d�r<dS|r�d|kr�|�d�}|d}t|dd�}|r�|r�t�||�}|ft|<dSdS)	NrTFr r!�
__loader__�__name__�
get_source)rrr'r(�get�getattr�	functools�partial)r	r�name�loaderr;�	get_linesr
r
rr)�s


r))N)N)N)N)r>r.rr2�__all__rrrrrrr)r
r
r
r�<module>s




A__pycache__/zipapp.cpython-38.opt-1.pyc000064400000013340151153537600013655 0ustar00U

e5do�@s�ddlZddlZddlZddlZddlZddlZddlZdddgZdZej	�
d�rXdZne��ZGdd�de
�Zejd	d
��Zdd�Zdd
d�Zddd�Zdd�Zddd�Zedkr�e�dS)�N�ZipAppError�create_archive�get_interpreterz8# -*- coding: utf-8 -*-
import {module}
{module}.{fn}()
�win�utf-8c@seZdZdS)rN)�__name__�
__module__�__qualname__�r
r
�/usr/lib64/python3.8/zipapp.pyr!sc	cs8t|ttjf�r.t||��}|VW5QRXn|VdS�N)�
isinstance�str�os�PathLike�open)�archive�mode�fr
r
r�_maybe_open%srcCs$|r d|�t�d}|�|�dS)zWrite a shebang line.�#!�
N)�encode�shebang_encoding�write)r�interpreterZshebangr
r
r�_write_file_prefix.src
Cs�t|d��Z}|�d�}|dkr*d}|��t|d��&}t||�|�|�t�||�W5QRXW5QRX|r�t|t�r�t	�
|t	�|�jtj
B�dS)z8Copy an application archive, modifying the shebang line.�rb�r��wbN)r�read�readlinerr�shutilZcopyfileobjr
rr�chmod�stat�st_mode�S_IEXEC)rZnew_archiver�srcZfirst_2Zdstr
r
r�
_copy_archive5s


 r)Fc
Cs�d}t|d�rt|d�rd}nt�|�}|��r4d}|rHt|||�dS|��sXtd��|d��}|rt|rttd��|s�|s�td	��d}|r�|�d
�\}	}
}tdd�|	�	d
�D��}tdd�|�	d
�D��}
|
d
kr�|r�|
s�td|��t
j|	|d�}|dk�r|�d�}nt|d��s"t�|�}t
|d���}t||�|�rDtjntj}tj|d|d��^}|�d�D]4}|�|�}|dk�s�||��rf|�||����qf|�r�|�d|�d��W5QRXW5QRX|�r�t|d��s�|�|��jtjB�dS)abCreate an application archive from SOURCE.

    The SOURCE can be the name of a directory, or a filename or a file-like
    object referring to an existing archive.

    The content of SOURCE is packed into an application archive in TARGET,
    which can be a filename or a file-like object.  If SOURCE is a directory,
    TARGET can be omitted and will default to the name of SOURCE with .pyz
    appended.

    The created application archive will have a shebang line specifying
    that it should run with INTERPRETER (there will be no shebang line if
    INTERPRETER is None), and a __main__.py which runs MAIN (if MAIN is
    not specified, an existing __main__.py will be used).  It is an error
    to specify MAIN for anything other than a directory source with no
    __main__.py, and it is an error to omit MAIN if the directory has no
    __main__.py.
    Fr!r"TNzSource does not existz__main__.pyz8Cannot specify entry point if the source has __main__.pyzArchive has no entry point�:css|]}|��VqdSr��isidentifier��.0�partr
r
r�	<genexpr>{sz!create_archive.<locals>.<genexpr>�.css|]}|��VqdSrr+r-r
r
rr0|szInvalid entry point: )�module�fnz.pyzrr �w)�compression�*r)�hasattr�pathlib�Path�is_filer)�existsr�	partition�all�split�
MAIN_TEMPLATE�formatZwith_suffixrr�zipfileZZIP_DEFLATEDZ
ZIP_STOREDZZipFileZrglob�relative_torZas_posixZwritestrrr$r%r&r')�source�targetr�main�filter�
compressedZsource_is_fileZhas_mainZmain_py�mod�sepr3Zmod_okZfn_ok�fdr5�zZchildZarcnamer
r
rrLsX
�


�
&c
CsFt|d��2}|�d�dkr8|�����t�W5QR�SW5QRXdS)Nrrr)rr!r"�strip�decoder)rrr
r
rr�scCs<ddl}|��}|jddddd�|jdddd	d�|jd
dddd�|jd
dddd�|jddddd�|jddd�|�|�}|jr�tj�|j�s�t	d��t
|j�}td�|p�d��t
�d�tj�|j��r|jdk�stj�|j��rtj�|j|j��rt	d��|j�rt	d��t|j|j|j|j|jd�dS)z�Run the zipapp command line interface.

    The ARGS parameter lets you specify the argument list directly.
    Omitting ARGS (or setting it to None) works as for argparse, using
    sys.argv[1:] as the argument list.
    rNz--outputz-ozAThe name of the output archive. Required if SOURCE is an archive.)�default�helpz--pythonz-pzEThe name of the Python interpreter to use (default: no shebang line).z--mainz-mzLThe main function of the application (default: use an existing __main__.py).z
--compressz-c�
store_truezQCompress files with the deflate method. Files are stored uncompressed by default.)�actionrOz--infoFz)Display the interpreter from the archive.)rNrQrOrCz'Source directory (or existing archive).)rOz%Can only get info for an archive filezInterpreter: {}z<none>z-In-place editing of archives is not supportedz,Cannot change the main function when copying)rrErG)�argparse�ArgumentParser�add_argument�
parse_args�infor�path�isfilerC�
SystemExitr�printr@�sys�exit�outputr;�samefilerEr�python�compress)�argsrR�parserrr
r
rrE�sN
�
�
�
�
��


�
�rE�__main__)N)NNNNF)N)�
contextlibrr8r#r%r[rA�__all__r?�platform�
startswithr�getfilesystemencoding�
ValueErrorr�contextmanagerrrr)rrrErr
r
r
r�<module>s0



�
J
1__pycache__/_markupbase.cpython-38.opt-2.pyc000064400000016112151153537600014644 0ustar00U

e5d9�@sRddlZe�d�jZe�d�jZe�d�Ze�d�Ze�d�Z[Gdd�d�ZdS)	�Nz[a-zA-Z][-_.a-zA-Z0-9]*\s*z(\'[^\']*\'|"[^"]*")\s*z--\s*>z	]\s*]\s*>z]\s*>c@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdZdd
�Z	d"dd�Z
d#dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!S)$�
ParserBasecCs|jtkrtd��dS)Nz)_markupbase.ParserBase must be subclassed)�	__class__r�RuntimeError��self�r�#/usr/lib64/python3.8/_markupbase.py�__init__s
�zParserBase.__init__cCstd��dS)Nz.subclasses of ParserBase must override error())�NotImplementedError)r�messagerrr�error s�zParserBase.errorcCsd|_d|_dS)N�r��lineno�offsetrrrr�reset$szParserBase.resetcCs|j|jfS�Nrrrrr�getpos(szParserBase.getposcCsb||kr|S|j}|�d||�}|rN|j||_|�d||�}||d|_n|j|||_|S)N�
r
)�rawdata�countr�rindexr)r�i�jrZnlines�posrrr�	updatepos0szParserBase.updatepos�c
Cs�|j}|d}|||d�dkr*|dS|||d�dkrBdSt|�}|||d�dkrh|�|�S||dkr~|�|�S|�||�\}}|dkr�|S|d	kr�d
|_||k�r�||}|dkr�||d|�}|d	kr�|�|�n
|�|�|dS|dk�r t||�}|�sdS|�	�}n�|dk�r<|�||�\}	}nt||jk�rR|d}n^|dk�r�|d	k�rx|�
|d|�}n$|d
k�r�|�d|�n
|�d�n|�d||�|dkr�|Sq�dS)N�r
�>)�-r���z--�[rZdoctyperz"'Z4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ>�linktype�attlist�element�linkz&unsupported '[' char in %s declarationz"unexpected '[' char in declarationz!unexpected %r char in declaration)r�len�
parse_comment�parse_marked_section�
_scan_name�_decl_othercharsZhandle_decl�unknown_decl�_declstringlit_match�end�_parse_doctype_subsetr)
rrrr�nZdecltype�c�data�m�namerrr�parse_declaration@sZ












�zParserBase.parse_declarationr
cCs�|j}|�|d|�\}}|dkr&|S|dkr@t�||d�}n4|dkrZt�||d�}n|�d||d|��|s|dS|r�|�d�}|�||d|��|�d�S)N�r>�rcdata�temp�ignore�cdata�include>�endif�else�ifz+unknown status keyword %r in marked sectionr )	rr)�_markedsectionclose�search�_msmarkedsectioncloser�startr+r-)rr�reportrZsectNamer�matchrrrr(�s
zParserBase.parse_marked_sectioncCsj|j}|||d�dkr$|�d�t�||d�}|s<dS|r`|�d�}|�||d|��|�d�S)N��<!--z"unexpected call to parse_comment()r r)rr�
_commentcloser?rAZhandle_commentr-)rrrBrrCrrrrr'�s

zParserBase.parse_commentc
Cs*|j}t|�}|}||k�r&||}|dk�r0|||d�}|dkrJdS|dkrp|�||d�|�d|�|d|kr�dS|d|kr�dS|||d�dkr�|j|d	d
�}|d	kr|Sq|�|d|�\}}|dkr�dS|dk�r|�||d�|�d|�t|d
|�}	|	||�}|d	k�r$|Sq|dk�r�|d|k�rLdS|�|d|�\}}|d	k�rn|S||dk�r$|d}q|dk�r�|d}||k�r�||���r�|d}�q�||k�r�||dk�r�|S|�||�|�d�ndSq|���r
|d}q|�||�|�d|�qdS)N�<rr z<!r
z*unexpected char in internal subset (in %r)rDrEr)rB>r$r#�notation�entityz)unknown declaration %r in internal subsetZ_parse_doctype_�%�;�]rz%unexpected char after internal subsetz%unexpected char %r in internal subset)rr&rrr'r)�getattr�isspace)
rr�declstartposrr/rr0�sr3Zmethrrrr.�sp


�








z ParserBase._parse_doctype_subsetcCsF|�||�\}}|dkrdS|j}d||d�krB|�d|�dSdS)Nr rr
)r)r�find)rrrOr3rrrrr�_parse_doctype_element�sz!ParserBase._parse_doctype_elementcCs�|j}|�||�\}}|||d�}|dkr2dS|dkrB|dS|�||�\}}|dkr^|S|||d�}|dkrzdS|dkr�d||d�kr�|�d|�d}ndS|||d���r�|d}q�||d�s�dSn|�||�\}}|||d�}|�sdS|dk�rDt||�}|�r&|��}ndS|||d�}|�sDdS|d	k�r�||d�d	k�rddS|�|d|�\}}|dk�r�|S|||d�}|�s�dS|dkrB|dSqBdS)
Nr
rr rr�(�)�'"�#)rr)rQrNr,r-)rrrOrr3rr0r2rrr�_parse_doctype_attlistsX





z!ParserBase._parse_doctype_attlistcCs�|�||�\}}|dkr|S|j}|||d�}|s:dS|dkrJ|dS|dkrnt||�}|sddS|��}q"|�||�\}}|dkr"|Sq"dS)Nrr
r rrU)r)rr,r-)rrrOr3rrr0r2rrr�_parse_doctype_notation=s"

z"ParserBase._parse_doctype_notationcCs�|j}|||d�dkrR|d}|||d�}|s:dS|��rP|d}q"qVq"n|}|�||�\}}|dkrr|S|j||d�}|s�dS|dkr�t||�}|r�|��}q�dSqr|dkr�|dS|�||�\}}|dkrr|SqrdS)Nr
rJr rrUr)rrNr)r,r-)rrrOrrr0r3r2rrr�_parse_doctype_entityTs4


z ParserBase._parse_doctype_entitycCs�|j}t|�}||krdSt||�}|r\|��}|��}|t|�|krLdS|��|��fS|�||�|�d|||d��dS)N)Nr zexpected name token at %r�)	rr&�_declname_match�group�strip�lowerr-rr)rrrOrr/r2rPr3rrrr)xs
�zParserBase._scan_namecCsdSrr)rr1rrrr+�szParserBase.unknown_declN)r
)r
)�__name__�
__module__�__qualname__r	rrrrr*r4r(r'r.rRrWrXrYr)r+rrrrrs 
R

C9$r)	�re�compilerCr[r,rFr>r@rrrrr�<module>s


__pycache__/sre_constants.cpython-38.opt-1.pyc000064400000014331151153537600015240 0ustar00U

e5d��@sDdZdZddlmZmZGdd�de�ZGdd�de�Zeed�Zd	d
�Z	e	d�Z
e
dd
�=e	d�Ze	d�Ze
eeeiZe
eeeiZe
eeeiZeeeeiZeeee iZ!ee"ee#iZ$e%e%e&e&e'e'e(e(e)e*e+e,e-e-e.e.iZ/e%e0e&e1e'e2e(e3e)e4e+e5e-e6e.e7iZ8dZ9dZ:dZ;dZ<dZ=dZ>dZ?dZ@dZAdZBdZCdZDeEdk�r@dd�ZFeGdd���ZHeH�Id�eH�Ide�eFeHe
d �eFeHed!�eFeHed!�eH�Id"e9�eH�Id#e:�eH�Id$e;�eH�Id%e<�eH�Id&e=�eH�Id'e>�eH�Id(e?�eH�Id)e@�eH�Id*eA�eH�Id+eB�eH�Id,eC�eH�Id-eD�W5QRXeJd.�d
S)/zInternal support module for srei��3�)�	MAXREPEAT�	MAXGROUPScs&eZdZdZdZd�fdd�	Z�ZS)�erroraiException raised for invalid regular expressions.

    Attributes:

        msg: The unformatted error message
        pattern: The regular expression pattern
        pos: The index in the pattern where compilation failed (may be None)
        lineno: The line corresponding to pos (may be None)
        colno: The column corresponding to pos (may be None)
    �reNcs�||_||_||_|dk	r�|dk	r�d||f}t|t�r>d}nd}|�|d|�d|_||�|d|�|_||kr�d||j|jf}nd|_|_t	��
|�dS)Nz%s at position %d�
�
r�z%s (line %d, column %d))�msg�pattern�pos�
isinstance�str�count�lineno�rfind�colno�super�__init__)�selfr	r
r�newline��	__class__��%/usr/lib64/python3.8/sre_constants.pyr%s
zerror.__init__)NN)�__name__�
__module__�__qualname__�__doc__r�
__classcell__rrrrrsrcs$eZdZ�fdd�Zdd�Z�ZS)�_NamedIntConstantcstt|��||�}||_|S�N)rr�__new__�name)�cls�valuer"rrrrr!9sz_NamedIntConstant.__new__cCs|jSr �r")rrrr�__repr__>sz_NamedIntConstant.__repr__)rrrr!r&rrrrrr8srrcCs8|����}dd�t|�D�}t��dd�|D��|S)NcSsg|]\}}t||��qSr)r)�.0�ir"rrr�
<listcomp>Esz_makecodes.<locals>.<listcomp>cSsi|]}|j|�qSrr%)r'�itemrrr�
<dictcomp>Fsz_makecodes.<locals>.<dictcomp>)�strip�split�	enumerate�globals�update)�names�itemsrrr�
_makecodesCsr3az
    FAILURE SUCCESS

    ANY ANY_ALL
    ASSERT ASSERT_NOT
    AT
    BRANCH
    CALL
    CATEGORY
    CHARSET BIGCHARSET
    GROUPREF GROUPREF_EXISTS
    IN
    INFO
    JUMP
    LITERAL
    MARK
    MAX_UNTIL
    MIN_UNTIL
    NOT_LITERAL
    NEGATE
    RANGE
    REPEAT
    REPEAT_ONE
    SUBPATTERN
    MIN_REPEAT_ONE

    GROUPREF_IGNORE
    IN_IGNORE
    LITERAL_IGNORE
    NOT_LITERAL_IGNORE

    GROUPREF_LOC_IGNORE
    IN_LOC_IGNORE
    LITERAL_LOC_IGNORE
    NOT_LITERAL_LOC_IGNORE

    GROUPREF_UNI_IGNORE
    IN_UNI_IGNORE
    LITERAL_UNI_IGNORE
    NOT_LITERAL_UNI_IGNORE
    RANGE_UNI_IGNORE

    MIN_REPEAT MAX_REPEAT
���Nz�
    AT_BEGINNING AT_BEGINNING_LINE AT_BEGINNING_STRING
    AT_BOUNDARY AT_NON_BOUNDARY
    AT_END AT_END_LINE AT_END_STRING

    AT_LOC_BOUNDARY AT_LOC_NON_BOUNDARY

    AT_UNI_BOUNDARY AT_UNI_NON_BOUNDARY
a�
    CATEGORY_DIGIT CATEGORY_NOT_DIGIT
    CATEGORY_SPACE CATEGORY_NOT_SPACE
    CATEGORY_WORD CATEGORY_NOT_WORD
    CATEGORY_LINEBREAK CATEGORY_NOT_LINEBREAK

    CATEGORY_LOC_WORD CATEGORY_LOC_NOT_WORD

    CATEGORY_UNI_DIGIT CATEGORY_UNI_NOT_DIGIT
    CATEGORY_UNI_SPACE CATEGORY_UNI_NOT_SPACE
    CATEGORY_UNI_WORD CATEGORY_UNI_NOT_WORD
    CATEGORY_UNI_LINEBREAK CATEGORY_UNI_NOT_LINEBREAK
r����� �@���__main__cCs*t|�}|D]}|�d|||f�qdS)Nz#define %s_%s %d
)�sorted�write)�f�d�prefixr2r*rrr�dump�srCzsre_constants.h�wao/*
 * Secret Labs' Regular Expression Engine
 *
 * regular expression matching engine
 *
 * NOTE: This file is generated by sre_constants.py.  If you need
 * to change anything in here, edit sre_constants.py and run it.
 *
 * Copyright (c) 1997-2001 by Secret Labs AB.  All rights reserved.
 *
 * See the _sre.c file for information on usage and redistribution.
 */

z#define SRE_MAGIC %d
ZSRE_OPZSREz#define SRE_FLAG_TEMPLATE %d
z#define SRE_FLAG_IGNORECASE %d
z#define SRE_FLAG_LOCALE %d
z#define SRE_FLAG_MULTILINE %d
z#define SRE_FLAG_DOTALL %d
z#define SRE_FLAG_UNICODE %d
z#define SRE_FLAG_VERBOSE %d
z#define SRE_FLAG_DEBUG %d
z#define SRE_FLAG_ASCII %d
z#define SRE_INFO_PREFIX %d
z#define SRE_INFO_LITERAL %d
z#define SRE_INFO_CHARSET %d
Zdone)Kr�MAGIC�_srerr�	Exceptionr�intrr3�OPCODES�ATCODES�CHCODES�LITERAL�LITERAL_IGNORE�NOT_LITERAL�NOT_LITERAL_IGNORE�	OP_IGNORE�LITERAL_LOC_IGNORE�NOT_LITERAL_LOC_IGNORE�OP_LOCALE_IGNORE�LITERAL_UNI_IGNORE�NOT_LITERAL_UNI_IGNORE�OP_UNICODE_IGNORE�AT_BEGINNINGZAT_BEGINNING_LINE�AT_ENDZAT_END_LINE�AT_MULTILINEZAT_BOUNDARYZAT_LOC_BOUNDARYZAT_NON_BOUNDARYZAT_LOC_NON_BOUNDARY�	AT_LOCALEZAT_UNI_BOUNDARYZAT_UNI_NON_BOUNDARY�
AT_UNICODEZCATEGORY_DIGITZCATEGORY_NOT_DIGITZCATEGORY_SPACEZCATEGORY_NOT_SPACEZ
CATEGORY_WORDZCATEGORY_LOC_WORDZCATEGORY_NOT_WORDZCATEGORY_LOC_NOT_WORDZCATEGORY_LINEBREAKZCATEGORY_NOT_LINEBREAK�	CH_LOCALEZCATEGORY_UNI_DIGITZCATEGORY_UNI_NOT_DIGITZCATEGORY_UNI_SPACEZCATEGORY_UNI_NOT_SPACEZCATEGORY_UNI_WORDZCATEGORY_UNI_NOT_WORDZCATEGORY_UNI_LINEBREAKZCATEGORY_UNI_NOT_LINEBREAK�
CH_UNICODE�SRE_FLAG_TEMPLATE�SRE_FLAG_IGNORECASE�SRE_FLAG_LOCALE�SRE_FLAG_MULTILINE�SRE_FLAG_DOTALL�SRE_FLAG_UNICODE�SRE_FLAG_VERBOSE�SRE_FLAG_DEBUG�SRE_FLAG_ASCII�SRE_INFO_PREFIX�SRE_INFO_LITERAL�SRE_INFO_CHARSETrrC�openr@r?�printrrrr�<module>s�!	
,
��������

__pycache__/os.cpython-38.pyc000064400000075247151153537600012052 0ustar00U

e5dS��@s�dZddlZddlZddlZddlmZejZdddddd	d
ddd
dddddddddgZ	dd�Z
dd�Zdekr�dZdZ
ddlTzddlmZe	�d�Wnek
r�YnXddlZzdd lmZWnek
r�YnXddlZe	�ee��[n�d!ek�r�d!Zd"Z
ddlTzddlmZe	�d�Wnek
�rBYnXddlZddlZe	�ee��[zdd lmZWnek
�r�YnXned#��eejd$<dd%lmZmZmZmZmZmZm Z m!Z![e
d&��r�e"�Z#d'd(�Z$e%�Z&e$d)d*�e$d+d,�e$d-d.�e$d/d0�e$d1d2�e$d3d4�e$d5d6�e$d7d8�e$d9d:�e$d;d<�e$d=d>�e$d?d@�e$dAdB�e$dCdD�e$dCdE�e$dFd2�e&Z'e%�Z&e$d)d*�e&Z(e%�Z&e$dGdH�e$dId,�e$dJd.�e$dKdL�e$dKdM�e$dNdO�e&�)e�e$dPdQ�e$dRd2�e$dSd2�e$dTdU�e
dV��r2e
dW��r2e$dXdV�e&Z*e%�Z&e$d)d*�e$d-d.�e$d/d0�e$dYdZ�e$d[d,�e
d\��r�e$d]d.�e$d3d4�e$d^d2�e$d_d0�e$d/d0�e$dFd2�e$d`d0�e&Z+[&[[#[$dZ,daZ-dbZ.d�dedf�Z/dgdh�Z0didj�Z1e	�dfdhdjg�d�dldm�Z2e	�dm�e3ehe'k�rTe4ehe*k�rTd�ddddo�dpdq�Z5drds�Z6e	�dq�dtdu�Z7dvdw�Z8dxdy�Z9dzd{�Z:d|d}�Z;d~d�Z<e	�dudwdyd{d}dg�d�d�d��Z=d�d�d�Z>dd�lm?Z?Gd�d��d�e?�Z@zeAZBWneCk
�r�d�d��ZBYnXd�e	k�re	�d��zeDZEWneCk
�r,d�d��ZEYnXd�e	k�rBe	�d��d�d��ZFeF�ZG[Fd�d�d��ZHed!kZIe	�d��eI�r�d�d��ZJe@eGjKeJeLeJeLeBeE�ZM[Jd�d�d��ZNe	�d��d�d��ZOeO�\ZPZQ[Oe
d���r0e
d���s0e
d���r0dZRdaZSZTe	�d�d�d�g�d�d��ZUd�d��ZVd�d��ZWd�d��ZXd�d��ZYe	�d�d�d�d�g�e
d���rXd�d��ZZd�d��Z[e	�d�d�g�e
d���r�d�d��Z\d�d��Z]e	�d�d�g�d�d�d�Z^Gd�d��d��Z_d�d�Z`d�d��Zae
d���s�eaZbd�eb_cGd�d��d�ejd�Zeed!k�r�Gd�d��d��Zfd�d��ZgdS)�aNOS routines for NT or Posix depending on what system we're on.

This exports:
  - all functions from posix or nt, e.g. unlink, stat, etc.
  - os.path is either posixpath or ntpath
  - os.name is either 'posix' or 'nt'
  - os.curdir is a string representing the current directory (always '.')
  - os.pardir is a string representing the parent directory (always '..')
  - os.sep is the (or a most common) pathname separator ('/' or '\\')
  - os.extsep is the extension separator (always '.')
  - os.altsep is the alternate pathname separator (None or '/')
  - os.pathsep is the component separator used in $PATH etc
  - os.linesep is the line separator in text files ('\r' or '\n' or '\r\n')
  - os.defpath is the default search path for executables
  - os.devnull is the file path of the null device ('/dev/null', etc.)

Programs that import and use 'os' stand a better chance of being
portable between different platforms.  Of course, they must then
only use functions that are defined by all platforms (e.g., unlink
and opendir), and leave all pathname manipulation to os.path
(e.g., split and join).
�N)�_check_methods�altsep�curdir�pardir�sep�pathsep�linesep�defpath�name�path�devnull�SEEK_SET�SEEK_CUR�SEEK_END�fsencode�fsdecode�
get_exec_path�fdopen�popen�extsepcCs
|t�kS�N)�globals)r
�r�/usr/lib64/python3.8/os.py�_exists'srcCs8zt|j�WStk
r2dd�t|�D�YSXdS)NcSsg|]}|ddkr|�qS)r�_r)�.0�nrrr�
<listcomp>.sz%_get_exports_list.<locals>.<listcomp>)�list�__all__�AttributeError�dir)�modulerrr�_get_exports_list*sr$�posix�
)�*)�_exitr()�_have_functions�ntz
zno os specific module foundzos.path)rrrrr	rrrr)cCs"|tkr|tkrt�t|�dSr)�_globalsr)�_set�add)�str�fnrrr�_addfsr0ZHAVE_FACCESSAT�accessZ
HAVE_FCHMODAT�chmodZ
HAVE_FCHOWNAT�chownZHAVE_FSTATAT�statZHAVE_FUTIMESAT�utimeZHAVE_LINKAT�linkZHAVE_MKDIRAT�mkdirZ
HAVE_MKFIFOAT�mkfifoZHAVE_MKNODAT�mknodZHAVE_OPENAT�openZHAVE_READLINKAT�readlinkZ
HAVE_RENAMEAT�renameZHAVE_SYMLINKAT�symlinkZ
HAVE_UNLINKAT�unlink�rmdirZHAVE_UTIMENSATZHAVE_FCHDIR�chdirZHAVE_FCHMODZHAVE_FCHOWNZHAVE_FDOPENDIR�listdir�scandirZHAVE_FEXECVE�execveZHAVE_FTRUNCATE�truncateZ
HAVE_FUTIMENSZHAVE_FUTIMESZHAVE_FPATHCONF�pathconf�statvfs�fstatvfsZ
HAVE_FSTATVFSZ
HAVE_LCHFLAGSZchflagsZHAVE_LCHMOD�lchownZHAVE_LCHOWNZHAVE_LUTIMESZ
HAVE_LSTATZ
MS_WINDOWS���FcCs�t�|�\}}|s t�|�\}}|r||r|t�|�s|zt||d�Wntk
rVYnXt}t|t�rpttd�}||kr|dSzt||�Wn$t	k
r�|r�t�
|�s��YnXdS)a�makedirs(name [, mode=0o777][, exist_ok=False])

    Super-mkdir; create a leaf directory and all intermediate ones.  Works like
    mkdir, except that any intermediate path segment (not just the rightmost)
    will be created if it does not exist. If the target directory already
    exists, raise an OSError if exist_ok is False. Otherwise no exception is
    raised.  This is recursive.

    )�exist_ok�ASCIIN)r�split�exists�makedirs�FileExistsErrorr�
isinstance�bytesr7�OSError�isdir)r
�moderL�head�tail�cdirrrrrP�s$


rPcCsjt|�t�|�\}}|s(t�|�\}}|rf|rfzt|�Wntk
rTYqfYnXt�|�\}}q(dS)a�removedirs(name)

    Super-rmdir; remove a leaf directory and all empty intermediate
    ones.  Works like rmdir except that, if the leaf directory is
    successfully removed, directories corresponding to rightmost path
    segments will be pruned away until either the whole path is
    consumed or an error occurs.  Errors during this latter phase are
    ignored -- they generally mean that a directory was not empty.

    N)r?rrNrT)r
rWrXrrr�
removedirs�s
rZcCsnt�|�\}}|r(|r(t�|�s(t|�t||�t�|�\}}|rj|rjzt|�Wntk
rhYnXdS)a<renames(old, new)

    Super-rename; create directories as necessary and delete any left
    empty.  Works like rename, except creation of any intermediate
    directories needed to make the new pathname good is attempted
    first.  After the rename, directories corresponding to rightmost
    path segments of the old name will be pruned until either the
    whole path is consumed or a nonempty directory is found.

    Note: this function can fail with the new directory structure made
    if you lack permissions needed to unlink the leaf directory or
    file.

    N)rrNrOrPr<rZrT)�old�newrWrXrrr�renames�s
r]Tccst|�}g}g}g}zt|�}Wn8tk
rX}z|dk	rB||�WY�dSd}~XYnX|��z.zt|�}	Wntk
r�YW�qpYnXWnBtk
r�}z$|dk	r�||�WY�W5QR�dSd}~XYnXz|	��}
Wntk
�r�d}
YnX|
�r|�|	j�n|�|	j�|sb|
rb|�r0d}n.z|	��}Wntk
�rVd}YnX|}|rb|�|	j	�qbW5QRX|�r�|||fVt	j
t	j}
}|D]4}|||�}|�s�|
|��s�t||||�EdH�q�n,|D]}t||||�EdH�q�|||fVdS)aDirectory tree generator.

    For each directory in the directory tree rooted at top (including top
    itself, but excluding '.' and '..'), yields a 3-tuple

        dirpath, dirnames, filenames

    dirpath is a string, the path to the directory.  dirnames is a list of
    the names of the subdirectories in dirpath (excluding '.' and '..').
    filenames is a list of the names of the non-directory files in dirpath.
    Note that the names in the lists are just names, with no path components.
    To get a full path (which begins with top) to a file or directory in
    dirpath, do os.path.join(dirpath, name).

    If optional arg 'topdown' is true or not specified, the triple for a
    directory is generated before the triples for any of its subdirectories
    (directories are generated top down).  If topdown is false, the triple
    for a directory is generated after the triples for all of its
    subdirectories (directories are generated bottom up).

    When topdown is true, the caller can modify the dirnames list in-place
    (e.g., via del or slice assignment), and walk will only recurse into the
    subdirectories whose names remain in dirnames; this can be used to prune the
    search, or to impose a specific order of visiting.  Modifying dirnames when
    topdown is false has no effect on the behavior of os.walk(), since the
    directories in dirnames have already been generated by the time dirnames
    itself is generated. No matter the value of topdown, the list of
    subdirectories is retrieved before the tuples for the directory and its
    subdirectories are generated.

    By default errors from the os.scandir() call are ignored.  If
    optional arg 'onerror' is specified, it should be a function; it
    will be called with one argument, an OSError instance.  It can
    report the error to continue with the walk, or raise the exception
    to abort the walk.  Note that the filename is available as the
    filename attribute of the exception object.

    By default, os.walk does not follow symbolic links to subdirectories on
    systems that support them.  In order to get this functionality, set the
    optional argument 'followlinks' to true.

    Caution:  if you pass a relative pathname for top, don't change the
    current working directory between resumptions of walk.  walk never
    changes the current directory, and assumes that the client doesn't
    either.

    Example:

    import os
    from os.path import join, getsize
    for root, dirs, files in os.walk('python/Lib/email'):
        print(root, "consumes", end="")
        print(sum(getsize(join(root, name)) for name in files), end="")
        print("bytes in", len(files), "non-directory files")
        if 'CVS' in dirs:
            dirs.remove('CVS')  # don't visit CVS directories

    NFT)
�fspathrBrT�next�
StopIteration�is_dir�appendr
�
is_symlinkr�islink�join�walk)�top�topdown�onerror�followlinks�dirs�nondirs�	walk_dirs�
scandir_it�error�entryra�	walk_intorcrdre�dirname�new_pathrrrrfs^;"


rf�.��follow_symlinks�dir_fdccs�t|t�rt|d�st|�}|s.t|d|d�}t|t|d�}zB|s^t�	|j
�r|t�|t|��r|t
||t|t�|||�EdHW5t|�XdS)aDirectory tree generator.

        This behaves exactly like walk(), except that it yields a 4-tuple

            dirpath, dirnames, filenames, dirfd

        `dirpath`, `dirnames` and `filenames` are identical to walk() output,
        and `dirfd` is a file descriptor referring to the directory `dirpath`.

        The advantage of fwalk() over walk() is that it's safe against symlink
        races (when follow_symlinks is False).

        If dir_fd is not None, it should be a file descriptor open to a directory,
          and top should be relative; top will then be relative to that directory.
          (dir_fd is always supported for fwalk.)

        Caution:
        Since fwalk() yields file descriptors, those are only valid until the
        next iteration step, so you should dup() them if you want to keep them
        for a longer period.

        Example:

        import os
        for root, dirs, files, rootfd in os.fwalk('python/Lib/email'):
            print(root, "consumes", end="")
            print(sum(os.stat(name, dir_fd=rootfd).st_size for name in files),
                  end="")
            print("bytes in", len(files), "non-directory files")
            if 'CVS' in dirs:
                dirs.remove('CVS')  # don't visit CVS directories
        �	__index__Fru�rwN)rR�int�hasattrr^r4r:�O_RDONLY�close�st�S_ISDIR�st_moder�samestat�_fwalkrS)rgrhrirvrw�orig_st�topfdrrr�fwalk�s!��r�ccs�t|�}g}g}|s|rdng}	|D]�}
|
j}|r:t|�}z4|
��rb|�|�|	dk	rl|	�|
�n
|�|�Wq$tk
r�z|
��r�|�|�Wntk
r�YnXYq$Xq$|r�||||fV|	dkr�|nt||	�D]�}zN|�s|r�t||dd�}n"|	dk	�st	�|\}}
|
jdd�}t
|t|d�}
Wn>tk
�rj}z|dk	�rR||�WY�q�W5d}~XYnXz@|�s�t
�|t|
���r�t
�||�}t|
|||||�EdHW5t|
�Xq�|�s�||||fVdS)NF)rwrv)rvry)rBr
rrarbrTrc�zipr4�AssertionErrorr:r|r}rr�rer�)r��toppath�isbytesrhrirvrnrkrl�entriesrpr
r��dirfd�err�dirpathrrrr��s\

�r�cGst||�dS)zpexecl(file, *args)

    Execute the executable file with argument list args, replacing the
    current process. N)�execv��file�argsrrr�execlsr�cGs |d}t||dd�|�dS)z�execle(file, *args, env)

    Execute the executable file with argument list args and
    environment env, replacing the current process. ���N)rC�r�r��envrrr�execlesr�cGst||�dS)z�execlp(file, *args)

    Execute the executable file (which is searched for along $PATH)
    with argument list args, replacing the current process. N)�execvpr�rrr�execlp"sr�cGs |d}t||dd�|�dS)z�execlpe(file, *args, env)

    Execute the executable file (which is searched for along $PATH)
    with argument list args and environment env, replacing the current
    process. r�N)�execvper�rrr�execlpe)sr�cCst||�dS)z�execvp(file, args)

    Execute the executable file (which is searched for along $PATH)
    with argument list args, replacing the current process.
    args may be a list or tuple of strings. N��_execvper�rrrr�2sr�cCst|||�dS)z�execvpe(file, args, env)

    Execute the executable file (which is searched for along $PATH)
    with argument list args and environment env, replacing the
    current process.
    args may be a list or tuple of strings. Nr�r�rrrr�:sr�cCs�|dk	rt}||f}nt}|f}t}t�|�r@||f|��dSd}t|�}tdkrft|�}tt|�}|D]~}t�	||�}z||f|��Wqjt
tfk
r�}	z|	}
W5d}	~	XYqjtk
r�}	z|	}
|dkr�|	}W5d}	~	XYqjXqj|dk	r�|�|
�dS)Nr*)
rCr��environrrrrr
r�mapre�FileNotFoundError�NotADirectoryErrorrT)r�r�r��	exec_func�argrest�	saved_exc�	path_listr"�fullname�e�last_excrrrr�Es6


r�c
Cs�ddl}|dkrt}|����|�dt�z|�d�}Wntk
rPd}YnXtr�z|d}Wnttfk
rzYnX|dk	r�t	d��|}|dk	r�t
|t�r�t|�}W5QRX|dkr�t
}|�t�S)z�Returns the sequence of directories that will be searched for the
    named executable (similar to a shell) when launching a process.

    *env* must be an environment variable dict or None.  If *env* is None,
    os.environ will be used.
    rN�ignore�PATHsPATHz*env cannot contain 'PATH' and b'PATH' keys)�warningsr��catch_warnings�simplefilter�BytesWarning�get�	TypeError�supports_bytes_environ�KeyError�
ValueErrorrRrSrr	rNr)r�r�r��
path_listbrrrres0


�)�MutableMappingc@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�_EnvironcCs.||_||_||_||_||_||_||_dSr)�	encodekey�	decodekey�encodevalue�decodevalue�putenv�unsetenv�_data)�self�datar�r�r�r�r�r�rrr�__init__�sz_Environ.__init__cCs>z|j|�|�}Wntk
r2t|�d�YnX|�|�Sr)r�r�r�r��r��key�valuerrr�__getitem__�s
z_Environ.__getitem__cCs.|�|�}|�|�}|�||�||j|<dSr)r�r�r�r�r�rrr�__setitem__�s

z_Environ.__setitem__cCsD|�|�}|�|�z|j|=Wntk
r>t|�d�YnXdSr)r�r�r�r�)r�r��
encodedkeyrrr�__delitem__�s

z_Environ.__delitem__ccs$t|j�}|D]}|�|�VqdSr)rr�r�)r��keysr�rrr�__iter__�s
z_Environ.__iter__cCs
t|j�Sr)�lenr��r�rrr�__len__�sz_Environ.__len__cs$d�d��fdd��j��D���S)Nzenviron({{{}}})z, c3s*|]"\}}d���|���|��VqdS)z
{!r}: {!r}N)�formatr�r�)rr�r�r�rr�	<genexpr>�s�z$_Environ.__repr__.<locals>.<genexpr>)r�rer��itemsr�rr�r�__repr__�s

��z_Environ.__repr__cCst|�Sr)�dictr�rrr�copy�sz
_Environ.copycCs||kr|||<||Srrr�rrr�
setdefault�sz_Environ.setdefaultN)�__name__�
__module__�__qualname__r�r�r�r�r�r�r�r�r�rrrrr��s		r�cCsdSrr)r�r�rrr�<lambda>��r�r�cCs
t|d�S)N�)�_putenv�r�rrrr��r�r�cs�tdkrHdd�}|�t}�fdd�}i}t��D]\}}||||�<q0n(t����fdd���fdd	�}�}t}t|||�|tt�S)
Nr*cSs t|t�stdt|�j��|S)N�str expected, not %s)rRr.r��typer��r�rrr�	check_str�s
z!_createenviron.<locals>.check_strcs�|���Sr)�upperr�)�encoderrr��sz!_createenviron.<locals>.encodekeycs(t|t�stdt|�j��|��d�S)Nr��surrogateescape)rRr.r�r�r�r�r���encodingrrr��s
z_createenviron.<locals>.encodecs|��d�S)Nr�)�decoder�r�rrr��sz_createenviron.<locals>.decode)	r
r.r�r��sys�getfilesystemencodingr�r��	_unsetenv)r�r�r�r�r�r�r)r�r�r�_createenviron�s*�r�cCst�||�S)z�Get an environment variable, return None if it doesn't exist.
    The optional second argument can specify an alternate default.
    key, default and the result are str.)r�r��r��defaultrrr�getenv�sr�)r�r�cCs t|t�stdt|�j��|S)Nzbytes expected, not %s)rRrSr�r�r�r�rrr�_check_bytess
r�cCst�||�S)z�Get an environment variable, return None if it doesn't exist.
        The optional second argument can specify an alternate default.
        key, default and the result are bytes.)�environbr�r�rrr�getenvbsr�)r�r�cs4t���t�����fdd�}��fdd�}||fS)Ncs&t|�}t|t�r|����S|SdS)aEncode filename (an os.PathLike, bytes, or str) to the filesystem
        encoding with 'surrogateescape' error handler, return bytes unchanged.
        On Windows, use 'strict' error handler if the file system encoding is
        'mbcs' (which is the default encoding).
        N)r^rRr.r���filename�r��errorsrrr s
z_fscodec.<locals>.fsencodecs&t|�}t|t�r|����S|SdS)aDecode filename (an os.PathLike, bytes, or str) from the filesystem
        encoding with 'surrogateescape' error handler, return str unchanged. On
        Windows, use 'strict' error handler if the file system encoding is
        'mbcs' (which is the default encoding).
        N)r^rRrSr�r�r�rrr,s
z_fscodec.<locals>.fsdecode)r�r��getfilesystemencodeerrors)rrrr�r�_fscodecs
r��fork�spawnvr��P_WAIT�P_NOWAIT�	P_NOWAITOcCs�t|ttf�std��|r"|ds*td��t�}|spz$|dkrJ|||�n||||�Wq�td�Yq�XnR|tkr||St|d�\}}t	|�r�q|q|t
|�r�t|�St|�r�t
|�Std��q|dS)Nzargv must be a tuple or a listrz"argv first element cannot be empty�z"Not stopped, signaled or exited???)rR�tuplerr�r�r�r(r��waitpid�
WIFSTOPPED�WIFSIGNALED�WTERMSIG�	WIFEXITED�WEXITSTATUSrT)rVr�r�r��func�pid�wpid�stsrrr�	_spawnvefIs,
rcCst|||dt�S)aspawnv(mode, file, args) -> integer

Execute file with arguments from args in a subprocess.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. N)rr��rVr�r�rrrr�hscCst||||t�S)a:spawnve(mode, file, args, env) -> integer

Execute file with arguments from args in a subprocess with the
specified environment.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. )rrC�rVr�r�r�rrr�spawnveqsr	cCst|||dt�S)a8spawnvp(mode, file, args) -> integer

Execute file (which is looked for along $PATH) with arguments from
args in a subprocess.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. N)rr�rrrr�spawnvp}sr
cCst||||t�S)a\spawnvpe(mode, file, args, env) -> integer

Execute file (which is looked for along $PATH) with arguments from
args in a subprocess with the supplied environment.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. )rr�rrrr�spawnvpe�srcGst|||�S)aspawnl(mode, file, *args) -> integer

Execute file with arguments from args in a subprocess.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. )r�rrrr�spawnl�srcGs|d}t|||dd�|�S)a:spawnle(mode, file, *args, env) -> integer

Execute file with arguments from args in a subprocess with the
supplied environment.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. r�N)r	rrrr�spawnle�sr
cGst|||�S)aWspawnlp(mode, file, *args) -> integer

Execute file (which is looked for along $PATH) with arguments from
args in a subprocess with the supplied environment.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. )r
rrrr�spawnlp�srcGs|d}t|||dd�|�S)a]spawnlpe(mode, file, *args, env) -> integer

Execute file (which is looked for along $PATH) with arguments from
args in a subprocess with the supplied environment.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. r�N)rrrrr�spawnlpe�sr�rr�cCs�t|t�stdt|���|dkr.td|��|dks>|dkrFtd��ddl}ddl}|dkr�|j|d|j|d�}t	|�
|j�|�S|j|d|j|d	�}t	|�
|j�|�SdS)
Nz&invalid cmd type (%s, expected string))r�wzinvalid mode %rrz+popen() does not support unbuffered streamsrT)�shell�stdout�bufsize)r�stdinr)
rRr.r�r�r��
subprocess�io�Popen�PIPE�_wrap_close�
TextIOWrapperrr)�cmdrV�	bufferingrr�procrrrr�s(
��c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)rcCs||_||_dSr)�_stream�_proc)r��streamrrrrr��sz_wrap_close.__init__cCs8|j��|j��}|dkr dStdkr,|S|d>SdS)Nrr*�)rr}r �waitr
)r��
returncoderrrr}�s

z_wrap_close.closecCs|Srrr�rrr�	__enter__�sz_wrap_close.__enter__cGs|��dSr�r}�r�r�rrr�__exit__�sz_wrap_close.__exit__cCst|j|�Sr)�getattrr)r�r
rrr�__getattr__�sz_wrap_close.__getattr__cCs
t|j�Sr)�iterrr�rrrr��sz_wrap_close.__iter__N)	r�r�r�r�r}r%r(r*r�rrrrr�s	rcOs4t|t�stdt|���ddl}|j|f|�|�S)Nz&invalid fd type (%s, expected integer)r)rRrzr�r�rr:)�fdr��kwargsrrrrr�s
cCs�t|ttf�r|St|�}z|�|�}Wn0tk
rXt|d�rF�ntd|j��YnXt|ttf�rl|Std�	|jt|�j���dS)aaReturn the path representation of a path-like object.

    If str or bytes is passed in, it is returned unchanged. Otherwise the
    os.PathLike interface is used to get the path representation. If the
    path representation is not str or bytes, TypeError is raised. If the
    provided path is not str, bytes, or os.PathLike, TypeError is raised.
    �
__fspath__z/expected str, bytes or os.PathLike object, not z7expected {}.__fspath__() to return str or bytes, not {}N)
rRr.rSr�r.r!r{r�r�r�)r�	path_type�	path_reprrrr�_fspaths"
��r1r^c@s*eZdZdZejdd��Zedd��ZdS)�PathLikezCAbstract base class for implementing the file system path protocol.cCst�dS)z9Return the file system path representation of the object.N)�NotImplementedErrorr�rrrr.,szPathLike.__fspath__cCs|tkrt|d�StS)Nr.)r2r�NotImplemented)�cls�subclassrrr�__subclasshook__1s
zPathLike.__subclasshook__N)	r�r�r��__doc__�abc�abstractmethodr.�classmethodr7rrrrr2(s

r2c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�_AddedDllDirectorycCs||_||_||_dSr)r�_cookie�_remove_dll_directory)r�r�cookieZremove_dll_directoryrrrr�:sz_AddedDllDirectory.__init__cCs|�|j�d|_dSr)r>r=rr�rrrr}>sz_AddedDllDirectory.closecCs|Srrr�rrrr%Asz_AddedDllDirectory.__enter__cGs|��dSrr&r'rrrr(Csz_AddedDllDirectory.__exit__cCs|jrd�|j�SdS)Nz<AddedDllDirectory({!r})>z<AddedDllDirectory()>)rr�r�rrrr�Esz_AddedDllDirectory.__repr__N)r�r�r�r�r}r%r(r�rrrrr<9s
r<cCs ddl}|�|�}t|||j�S)aOAdd a path to the DLL search path.

        This search path is used when resolving dependencies for imported
        extension modules (the module itself is resolved through sys.path),
        and also by ctypes.

        Remove the directory by calling close() on the returned object or
        using it in a with statement.
        rN)r*Z_add_dll_directoryr<r>)rr*r?rrr�add_dll_directoryJs

�r@)rKF)TNF)rtTN)N)N)N)N)rr�)hr8r9r�r4r~�_collections_abcr�builtin_module_namesZ_namesr rr$r
rr%r(rb�ImportError�	posixpathrr)�extendr*Zntpath�modulesZos.pathrrrrr	rrrrr+r0�setr,�supports_dir_fd�supports_effective_idsr-�supports_fd�supports_follow_symlinksr
rrrPrZr]rfr:rBr�r�r�r�r�r�r�r�r�rr�r�r�r��	NameErrorr�r�r�r�r�r�r�r�rSr�r�r�rrr�r�r�rr�r	r
rrr
rrrrrr1r^r��ABCr2r<r@rrrr�<module>s��

(











































 

08
		
 
-7





�


	

	


	

__pycache__/ntpath.cpython-38.opt-2.pyc000064400000030500151153537600013646 0ustar00U

e5dVl�&@s$dZdZdZdZdZdZdZdZddlZddl	Z	ddl
Z
ddlZdd	lTd
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/g&Zd0d1�Z
d2d
�Zd3d�Zd4d�Zd5d
�Zd6d�Zd7d�Zejje_d8d�Zd9d�Zd:d�Zd;d�Zzdd<lmZWnek
�r$dZYnXd=d�Zd>d�Zd?d�Zd@d�Z dAdB�Z!zddClm"Z"Wnek
�rxe!Z#Yn
XdDd �Z#zddElm$Z$m%Z&Wnek
�r�e#Z'YnXdFdG�Z(dHdI�Z)dJd)�Z'e*e	dK��o�e	�+�dLdMkZ,dQdNd+�Z-dOd/�Z.zddPlm/Z0Wnek
�rYnXdS)R�.�..�\�;�/z.;C:\binZnul�N)�*�normcase�isabs�join�
splitdrive�split�splitext�basename�dirname�commonprefix�getsize�getmtime�getatime�getctime�islink�exists�lexists�isdir�isfile�ismount�
expanduser�
expandvars�normpath�abspath�curdir�pardir�sep�pathsep�defpath�altsep�extsep�devnull�realpath�supports_unicode_filenames�relpath�samefile�sameopenfile�samestat�
commonpathcCst|t�rdSdSdS)N�\/�\/)�
isinstance�bytes��path�r4�/usr/lib64/python3.8/ntpath.py�
_get_bothseps"s
r6cCs8t�|�}t|t�r$|�dd���S|�dd���SdS)N�/�\rr)�os�fspathr0r1�replace�lower��sr4r4r5r,s

cCsjt�|�}t|t�r,|�dd��d�rBdSn|�dd��d�rBdSt|�d}t|�d	koh|d	t|�kS)
Nr7r8�\\?\Trr�\\?\�r)	r9r:r0r1r;�
startswithr�lenr6r=r4r4r5r	=s

c

GsTt�|�}t|t�r"d}d}d}nd}d}d}z�|sD|dd�|t|�\}}ttj|�D]~}t|�\}}	|	r�|	d|kr�|s�|s�|}|	}q\n*|r�||kr�|��|��kr�|}|	}q\|}|r�|d|kr�||}||	}q\|�r|d|k�r|�r|dd�|k�r|||WS||WSttt	fk
�rNt
jd	|f|���YnXdS)
Nr8r.�:rr/�:r���r
)r9r:r0r1r�mapr<�	TypeError�AttributeError�BytesWarning�genericpath�_check_arg_types)
r3�pathsr!�seps�colonZresult_driveZresult_path�pZp_driveZp_pathr4r4r5r
MsL


��
cCst�|�}t|�dk�rt|t�r0d}d}d}nd}d}d}|�||�}|dd�|dkr�|dd	�|kr�|�|d�}|d
kr�|dd�|fS|�||d�}||dkr�|dd�|fS|d
kr�t|�}|d|�||d�fS|dd�|k�r|dd�|dd�fS|dd�|fS)N�r8r7rDrrrEr�rFrA)r9r:rCr0r1r;�find)rPr!r$rOZnormp�indexZindex2r4r4r5r|s.

$cCsxt�|�}t|�}t|�\}}t|�}|rD||d|krD|d8}q&|d|�||d�}}|�|�pj|}|||fS�NrA)r9r:r6rrC�rstrip)rPrN�d�i�head�tailr4r4r5r�s

cCs8t�|�}t|t�r$t�|ddd�St�|ddd�SdS)Nr8r7�.rrr)r9r:r0r1rK�	_splitext�rPr4r4r5r
�s

cCst|�dSrU�rr]r4r4r5r�scCst|�dS)Nrr^r]r4r4r5r�sc
Cs8zt�|�}Wntttfk
r*YdSXt�|j�S)NF)r9�lstat�OSError�
ValueErrorrI�stat�S_ISLNK�st_mode�r3�str4r4r5r�s
c	Cs.zt�|�}Wnttfk
r(YdSXdS)NFT)r9r_r`rarer4r4r5r�s
)�_getvolumepathnamecCstt�|�}t|�}t|�}t|�\}}|rD|d|krD|pB||kS||krPdStrl|�|�t|��|�kSdSdS)NrTF)r9r:r6rrrgrV)r3rN�root�restr4r4r5rs
cCs�t�|�}t|t�rd}nd}|�|�s,|Sdt|�}}||kr\||t|�kr\|d7}q:dtjkrrtjd}nFdtjkr�|Sztjd}Wntk
r�d}YnXt	|tjd�}t|t�r�t�
|�}|dkr�t	t|�|d|��}|||d�S)N�~�~rAZUSERPROFILEZHOMEPATHZ	HOMEDRIVE�)r9r:r0r1rBrCr6�environ�KeyErrorr
�fsencoder)r3�tilderX�n�userhome�driver4r4r5r!s.








cCs2t�|�}t|t�rhd|kr(d|kr(|Sddl}t|j|jdd�}d}d}d}d}d}ttd	d�}nFd
|kr|d|kr||Sddl}|j|jd}d}d}d
}d}d
}tj}|dd�}	d}
t	|�}|
|k�r.||
|
d�}||k�rX||
dd�}t	|�}z&|�
|�}
|	||d|
d�7}	Wn*tk
�rR|	||7}	|d}
YnX�n�||k�rJ||
d|
d�|k�r�|	|7}	|
d7}
n�||
dd�}t	|�}z|�
|�}
Wn*tk
�r�|	||7}	|d}
YnhX|d|
�}
z.|dk�rt�tjt�
|
��}n||
}Wn"tk
�r<||
|}YnX|	|7}	�n�||k�r||
d|
d�|k�r�|	|7}	|
d7}
�q$||
d|
d�|k�r^||
dd�}t	|�}z|�
|�}
Wn.tk
�r�|	|||7}	|d}
YnlX|d|
�}
z.|dk�r"t�tjt�
|
��}n||
}Wn&tk
�rR|||
|}YnX|	|7}	n�|dd�}
|
d7}
||
|
d�}|�r�||k�r�|
|7}
|
d7}
||
|
d�}�q�z.|dk�r�t�tjt�
|
��}n||
}Wntk
�r||
}YnX|	|7}	|�r$|
d8}
n|	|7}	|
d7}
q�|	S)N�$�%rz_-�ascii�'�{�}�environb�$�%�'�{�}rArQ)r9r:r0r1�stringZ
ascii_lettersZdigits�getattrrmrCrTraro�fsdecodern)r3r�ZvarcharsZquoteZpercentZbraceZrbraceZdollarrm�resrTZpathlen�c�var�valuer4r4r5rQs�













c	CsPt�|�}t|t�r*d}d}d}d}d}nd}d}d}d	}d
}|�|�rL|S|�||�}t|�\}}|�|�r�||7}|�|�}|�|�}d}|t	|�k�r,||r�|||kr�||=q�|||k�r"|dkr�||d|kr�||d|d�=|d8}n&|dk�r|�
|��r||=n|d7}q�|d7}q�|�sB|�sB|�|�||�|�S)
Nr8r7r[�..)s\\.\r?rrrr)z\\.\r@rrA)
r9r:r0r1rBr;r�lstriprrC�endswith�appendr
)	r3r!r$rr Zspecial_prefixes�prefix�compsrXr4r4r5r�sF









cCs@t�|�}t|�s8t|t�r&t��}nt��}t||�}t|�S�N)	r9r:r	r0r1�getcwdb�getcwdr
r)r3�cwdr4r4r5�_abspath_fallback�s



r�)�_getfullpathnamec	Cs4ztt|��WSttfk
r.t|�YSXdSr�)rr�r`rar�r2r4r4r5rs)�_getfinalpathname�readlinkc
Cs�d}t�}t|�|kr�|�t|��z:|}t|�}t|�s\t|�sJ|}Wq�ttt|�|��}Wq
t	k
r�}z|j
|kr�WY�q��W5d}~XYq
tk
r�Yq�Yq
Xq
|S)N)rArQrR��� �2�C�Wi&i(i))�setr�add�_nt_readlinkr	rrr
rr`�winerrorra)r3�allowed_winerror�seenZold_path�exr4r4r5�_readlink_deeps&
r�cCs�d}d}|r�zt|�}|r$t||�n|WStk
r�}z�|j|krF�z0t|�}||krt|rft||�n|WWY�TSWntk
r�YnXt|�\}}|r�|s�||WY�S|r�t||�n|}W5d}~XYqXq|S)N)rArQrRr�r�r�r�r�r��{i�i�rl)r�r
r`r�r�r)r3r�rZr��new_path�namer4r4r5�_getfinalpathname_nonstrictCs(
 &r�c	
Cs^t|�}t|t�rBd}d}d}t��}t|�tt�t��krjdSn(d}d}d}t��}t|�tt�krjdS|�	|�}|s�t
|�s�t||�}zt|�}d	}Wn0t
k
r�}z|j}t|�}W5d}~XYnX|�sZ|�	|��rZ|�	|�r�||t|�d�}n|t|�d�}zt|�|k�r"|}Wn4t
k
�rX}z|j|k�rH|}W5d}~XYnX|S)
Nr?s\\?\UNC\s\\s\\.\NULr@z\\?\UNC\z\\z\\.\NULr)rr0r1r9r�rror&r�rBr	r
r�r`r�r�rC)	r3r�Z
unc_prefixZnew_unc_prefixr�Z
had_prefixZinitial_winerrorr�Zspathr4r4r5r'qsD



�getwindowsversionrRrQcCsft�|�}t|t�r"d}d}d}nd}d}d}|dkr:|}|sFtd��t�|�}z�tt|��}tt|��}t|�\}}t|�\}	}
t|�t|	�kr�td|	|f��d	d
�|�	|�D�}dd
�|
�	|�D�}d}
t
||�D]$\}}t|�t|�kr�q�|
d
7}
q�|gt|�|
||
d�}|�s(|WSt|�WSt
ttttfk
�r`t�d||��YnXdS)Nr8r[r�rrrzno path specifiedz&path is on mount %r, start on mount %rcSsg|]}|r|�qSr4r4��.0�xr4r4r5�
<listcomp>�szrelpath.<locals>.<listcomp>cSsg|]}|r|�qSr4r4r�r4r4r5r��srrAr))r9r:r0r1rarrrrr�ziprCr
rHrIrJ�DeprecationWarningrKrL)r3�startr!rr Z	start_absZpath_absZstart_driveZ
start_restZ
path_driveZ	path_rest�
start_list�	path_listrXZe1Ze2�rel_listr4r4r5r)�sJ


�

c	s�|std��tttj|��}t|dt�r8d�d�d�nd�d�d��z@��fd	d
�|D�}�fdd
�|D�}zt�fdd
�|D��\}Wntk
r�td�d�YnXttdd
�|D���dkr�td��t	|d�
����\}}|���}�fdd
�|D�}�fdd
�|D�}t|�}t
|�}t|�D]*\}	}
|
||	k�r*|d|	�}�qf�q*|dt|��}|�rt|�n|}|��|�WSttfk
�r�tjd|���YnXdS)Nz%commonpath() arg is an empty sequencerr8r7r[rrrcs g|]}t|��������qSr4)rr;r<)r�rP)r$r!r4r5r��szcommonpath.<locals>.<listcomp>csg|]\}}|����qSr4r^�r�rWrP�r!r4r5r��sc3s"|]\}}|dd��kVqdSrUr4r�r�r4r5�	<genexpr>�szcommonpath.<locals>.<genexpr>z%Can't mix absolute and relative pathscss|]\}}|VqdSr�r4r�r4r4r5r��srAzPaths don't have the same drivecsg|]}|r|�kr|�qSr4r4�r�r��rr4r5r��scsg|]}�fdd�|D��qS)csg|]}|r|�kr|�qSr4r4r�r�r4r5r�sz)commonpath.<locals>.<listcomp>.<listcomp>r4)r�r>r�r4r5r�sr-)r-)ra�tuplerGr9r:r0r1r�rCrr;r�min�max�	enumerater
rHrIrKrL)rMZdrivesplits�split_pathsr	rsr3�common�s1�s2rXr�r�r4)r$rr!r5r-�sF

)�_isdir)N)1rr r%r!r"r$r#r&r9�sysrbrK�__all__r6rr	r
rrr
r\�__doc__rrrr�ntrg�ImportErrorrrrrr�r�rr�r�r�r'r�r��hasattrr�r(r)r-r�rr4r4r4r5�<module>s��
/8

0q2

*.2�
84__pycache__/tabnanny.cpython-38.opt-2.pyc000064400000013723151153537600014172 0ustar00U

e5d�,�@s�dZddlZddlZddlZeed�s.ed��dddgZdadadd	�Z	d
d�Z
Gdd�de�Zd
d�Z
Gdd�d�Zdd�Zdd�Zedkr�e
�dS)�6�N�NLz4tokenize.NL doesn't exist -- tokenize module too old�check�NannyNag�process_tokenscGs6d}|D]}tj�|t|��d}qtj�d�dS)N�� �
)�sys�stderr�write�str)�args�sep�arg�r� /usr/lib64/python3.8/tabnanny.py�errprint"s
rc
Cs�ddl}z|�tjdd�d�\}}Wn2|jk
rX}zt|�WY�dSd}~XYnX|D](\}}|dkrvtda|dkr^tdaq^|s�tdtjdd�dS|D]}t|�q�dS)Nr�Zqvz-qz-vzUsage:z[-v] file_or_directory ...)�getoptr
�argv�errorr�
filename_only�verboser)rZoptsr�msg�o�arrrr�main)s 
rc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
rcCs||||_|_|_dS�N)�linenor�line)�selfrrr rrr�__init__BszNannyNag.__init__cCs|jSr)r�r!rrr�
get_linenoDszNannyNag.get_linenocCs|jSr)rr#rrr�get_msgFszNannyNag.get_msgcCs|jSr)r r#rrr�get_lineHszNannyNag.get_lineN)�__name__�
__module__�__qualname__r"r$r%r&rrrrr=sc	
CsHtj�|�r�tj�|�s�tr*td|f�t�|�}|D]J}tj�||�}tj�|�rbtj�|�rztj�|dd��dkr8t	|�q8dSzt
�|�}Wn8tk
r�}zt
d||f�WY�dSd}~XYnXtdkr�td|��z>ztt
�|j��W�n"t
jk
�r@}z t
d||f�WY�
W���dSd}~XYn�tk
�r|}zt
d||f�WY�W��dSd}~XYn�tk
�r }z�|��}|��}t�r�td	||f�td
|f�t|���n6d|k�r�d|d}t�r�t|�nt||t|��WY�W�dSd}~XYnXW5|��Xt�rDtd
|f�dS)Nz%r: listing directory���z.pyz%r: I/O Error: %srzchecking %r ...z%r: Token Error: %sz%r: Indentation Error: %sz)%r: *** Line %d: trouble in tab city! ***zoffending line: %rr�"z%r: Clean bill of health.)�os�path�isdir�islinkr�print�listdir�join�normcaser�tokenize�open�OSErrorr�closer�generate_tokens�readline�
TokenError�IndentationErrorrr$r&r%r�repr)	�file�names�name�fullname�frZnag�badliner rrrrKsX


��


 
c@sLeZdZd\ZZdd�Zdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�ZdS)�
Whitespacez 	c	Cs�||_tjtj}}g}d}}}|jD]v}||krH|d}|d}q*||kr�|d}|d}|t|�kr�|dg|t|�d}||d||<d}q*q�q*||_||_t|�|f|_t|�dk|_	dS)Nrr)
�rawrC�S�T�len�n�nt�tuple�norm�	is_simple)	r!ZwsrErF�count�brHrIZchrrrr"�s(

zWhitespace.__init__cCs|j\}}tt|�d|�S�Nr)rK�maxrG)r!rM�trailingrrr�longest_run_of_spaces�s
z Whitespace.longest_run_of_spacescCsH|j\}}d}t|t|��D]}|||||}q||||jS)Nr)rK�rangerGrI)r!�tabsizerMrQZil�irrr�indent_level�s

zWhitespace.indent_levelcCs|j|jkSr)rK)r!�otherrrr�equal�szWhitespace.equalcCsbt|��|���d}g}td|d�D]4}|�|�|�|�kr(|�||�|�|�|�f�q(|SrO�rPrRrSrV�append�r!rWrHr�tsrrr�not_equal_witness�s���zWhitespace.not_equal_witnesscCsp|j|jkrdS|jr(|jr(|j|jkSt|��|���d}td|d�D]}|�|�|�|�krLdSqLdS)NFr�T)rHrLrIrPrRrSrV)r!rWrHr\rrr�less�s��zWhitespace.lesscCsbt|��|���d}g}td|d�D]4}|�|�|�|�kr(|�||�|�|�|�f�q(|SrOrYr[rrr�not_less_witnesss���zWhitespace.not_less_witnessN)r'r(r)rErFr"rRrVrXr]r_r`rrrrrC�srCcCs8dd�|D�}d}t|�dkr&|d}|dd�|�S)Ncss|]}t|d�VqdS)rN)r
)�.0�tuprrr�	<genexpr>sz#format_witnesses.<locals>.<genexpr>zat tab sizer�srz, )rGr2)�wZfirsts�prefixrrr�format_witnessess
rgcCstj}tj}tj}tjtjf}td�g}d}|D]�\}}}	}
}||krLd}q0||kr�d}t|�}|d�|�s�|d�|�}
dt	|
�}t
|	d||��|�|�q0||kr�d}|d=q0|r0||kr0d}t|�}|d�|�s0|d�
|�}
dt	|
�}t
|	d||��q0dS)Nrrr���zindent not greater e.g. zindent not equal e.g. )r4�INDENT�DEDENT�NEWLINE�COMMENTrrCr_r`rgrrZrXr])�tokensrirjrkZJUNK�indentsZcheck_equal�type�token�start�endr ZthisguyZwitnessrrrrrs6

�__main__)�__version__r,r
r4�hasattr�
ValueError�__all__rrrr�	ExceptionrrrCrgrr'rrrr�<module>s$

=7__pycache__/linecache.cpython-38.pyc000064400000007435151153537600013336 0ustar00U

e5d��@sndZddlZddlZddlZddlZdddgZddd�Ziadd�Zddd	�Z	dd
d�Z
ddd�Zd
d�ZdS)z�Cache lines from Python source files.

This is intended to read lines from modules imported -- hence if a filename
is not found, it will look down the module search path for a file by
that name.
�N�getline�
clearcache�
checkcachecCs:t||�}d|kr"t|�kr2nn||dSdSdS)N��)�getlines�len)�filename�lineno�module_globals�lines�r
�!/usr/lib64/python3.8/linecache.pyrs
cCsiadS)zClear the cache entirely.N)�cacher
r
r
rrscCsX|tkr(t|}t|�dkr(t|dSzt||�WStk
rRt�gYSXdS)z�Get the lines for a Python source file from the cache.
    Update the cache if it doesn't contain an entry for this file already.r�N)rr�updatecache�MemoryErrorr)r	r�entryr
r
rr%src	Cs�|dkrtt���}n|tkr&|g}ndS|D]�}t|}t|�dkrHq.|\}}}}|dkr^q.zt�|�}Wn$tk
r�t�|d�Yq.YnX||jks�||j	kr.t�|d�q.dS)zUDiscard cache entries that are out of date.
    (This is not checked upon each call!)Nr)
�listr�keysr�os�stat�OSError�pop�st_size�st_mtime)r	�	filenamesr�size�mtimer�fullnamerr
r
rr5s&
c
Cs�|tkr$tt|�dkr$t�|d�|r<|�d�r@|�d�r@gS|}zt�|�}W�ntk
�rn|}t||�r�zt|d�}Wnt	tfk
r�YnDX|dkr�gYSt|�ddd�|�
�D�|ft|<t|dYStj�|�r�gYSt
jD]d}ztj�||�}Wnttfk
�r0Yq�YnXzt�|�}W�qjWq�tk
�r^Yq�Xq�gYSYnXz"t�|��}|��}W5QRXWntk
�r�gYSX|�r�|d	�d
��s�|d	d
7<|j|j}	}
|	|
||ft|<|S)z�Update a cache entry and return its list of lines.
    If something's wrong, print a message, discard the cache entry,
    and return an empty list.rN�<�>rcSsg|]}|d�qS)�
r
)�.0�liner
r
r�
<listcomp>qszupdatecache.<locals>.<listcomp>r���r")rrr�
startswith�endswithrrr�	lazycache�ImportError�
splitlines�path�isabs�sys�join�	TypeError�AttributeError�tokenize�open�	readlinesrr)r	rrr�basename�data�dirname�fprrrr
r
rrRs\
�



rcCs�|tkr tt|�dkrdSdS|r8|�d�r<|�d�r<dS|r�d|kr�|�d�}|d}t|dd	�}|r�|r�t�||�}|ft|<dSdS)
a�Seed the cache for filename with module_globals.

    The module loader will be asked for the source only when getlines is
    called, not immediately.

    If there is an entry in the cache already, it is not altered.

    :return: True if a lazy load is registered in the cache,
        otherwise False. To register such a load a module loader with a
        get_source method must be found, the filename must be a cachable
        filename, and the filename must not be already cached.
    rTFr r!�
__loader__�__name__�
get_sourceN)rrr'r(�get�getattr�	functools�partial)r	r�name�loaderr;�	get_linesr
r
rr)�s


r))N)N)N)N)
�__doc__r>r.rr2�__all__rrrrrrr)r
r
r
r�<module>s




A__pycache__/imaplib.cpython-38.pyc000064400000120600151153537600013026 0ustar00U

e5df��*@s�dZdZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZmZm
Z
ddlmZzddlZdZWnek
r�dZYnXdd	d
ddd
gZdZdZdZdZdZdZdddddddddddddddddddddddddddddddddddddddddd�)Ze�d�Ze�d�Ze�d�Ze�dej�Z e�d�Z!e�d�Z"e�d�Z#e�d ej�Z$dZ%d Z&Gd!d�d�Z'e�r�Gd"d#�d#e'�Z(e�)d#�Gd$d	�d	e'�Z*Gd%d&�d&�Z+d'�,d(�Z-d)d*�e.e-d+d��D�Z/d,d
�Z0d-d�Z1d.d�Z2d/d
�Z3e4d0k�r�ddl5Z5ddl6Z6ze5�5ej7d+d�d1�\Z8Z9Wn.e5j:k
�rpZ;zd2\Z8Z9W5dZ;[;XYnXdZ<e8D]8\Z=Z;e=d3k�r�e>e;�Zne=d4k�rze;Z<e9�sze<fZ9�qze9�s�d5Z9e9dZ?e6�@�ZAe6�6d6eAe?�p�d7f�ZBd8eAd9d:�ZCd;eAeBffd<d=d>d?d@ddeCffdAdBdCdDdEdFdGdHdIfZDdJdKdLdMd?dddeCffdHdNfZEdOdP�ZF�ze<�rbe*e<�ZGne'e?�ZGeGjHdQk�r�eDd+d�ZDeG�IdReGjJ�eG�IdSeGjKf�eDD]\ZLZ9eFeLe9��q�eFdTdU�D]<ZMe�NdVeM�ZOeO�r�eO�Pd+�ZQneM�,�dWZQeFdXeQf��q�eED]T\ZLZ9eFeLe9�ZReLe9fdLk�r.�q
eRdW�,�ZSeS�sD�q
eFdYdZd[eSdWd\f��q
eTd]�Wn.eTd^�e�s�eTd_ej7d��YnXdS)`z�IMAP4 client.

Based on RFC 2060.

Public class:           IMAP4
Public variable:        Debug
Public functions:       Internaldate2tuple
                        Int2AP
                        ParseFlags
                        Time2Internaldate
z2.58�N)�datetime�timezone�	timedelta)�DEFAULT_BUFFER_SIZETF�IMAP4�IMAP4_stream�Internaldate2tuple�Int2AP�
ParseFlags�Time2Internaldate�
�i�)Z	IMAP4REV1ri@B)�AUTH�SELECTED)�NONAUTH)rrr�LOGOUT)r)r))�APPEND�AUTHENTICATE�
CAPABILITY�CHECK�CLOSE�COPY�CREATE�DELETE�	DELETEACL�ENABLE�EXAMINE�EXPUNGE�FETCH�GETACL�
GETANNOTATION�GETQUOTA�GETQUOTAROOT�MYRIGHTS�LIST�LOGINr�LSUBZMOVE�	NAMESPACE�NOOP�PARTIAL�	PROXYAUTH�RENAME�SEARCH�SELECT�SETACL�
SETANNOTATION�SETQUOTA�SORT�STARTTLS�STATUS�STORE�	SUBSCRIBE�THREAD�UID�UNSUBSCRIBEs\+( (?P<data>.*))?s.*FLAGS \((?P<flags>[^\)]*)\)s�.*INTERNALDATE "(?P<day>[ 0123][0-9])-(?P<mon>[A-Z][a-z][a-z])-(?P<year>[0-9][0-9][0-9][0-9]) (?P<hour>[0-9][0-9]):(?P<min>[0-9][0-9]):(?P<sec>[0-9][0-9]) (?P<zonen>[-+])(?P<zoneh>[0-9][0-9])(?P<zonem>[0-9][0-9])"s.*{(?P<size>\d+)}$s
\r\n|\r|\ns%\[(?P<type>[A-Z-]+)( (?P<data>.*))?\]s$\* (?P<type>[A-Z-]+)( (?P<data>.*))?s3\* (?P<data>\d+) (?P<type>[A-Z-]+)( (?P<data2>.*))?c@s�eZdZdZGdd�de�ZGdd�de�ZGdd�de�Zdefd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdefdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Z d9d:�Z!d;d<�Z"d=d>�Z#d?d@�Z$dAdB�Z%dCdD�Z&dEdF�Z'dGdH�Z(d�dKdL�Z)dMdN�Z*dOdP�Z+dQdR�Z,dSdT�Z-d�dUdV�Z.dWdX�Z/dYdZ�Z0d[d\�Z1d]d^�Z2d_d`�Z3dadb�Z4dcdd�Z5d�dgdh�Z6didj�Z7dkdl�Z8dmdn�Z9dodp�Z:d�drds�Z;dtdu�Z<dvdw�Z=dxdy�Z>dzd{�Z?d|d}�Z@d~d�ZAd�d��ZBd�d��ZCd�d��ZDd�d��ZEd�d��ZFd�d��ZGd�d��ZHd�d�d��ZId�d��ZJd�d��ZKd�d��ZLd�d��ZMd�d��ZNd�d��ZOd�d�d��ZPd�d��ZQd�d��ZRd�d��ZSdqS)�ra�IMAP4 client class.

    Instantiate with: IMAP4([host[, port]])

            host - host's name (default: localhost);
            port - port number (default: standard IMAP4 port).

    All IMAP4rev1 commands are supported by methods of the same
    name (in lower-case).

    All arguments to commands are converted to strings, except for
    AUTHENTICATE, and the last argument to APPEND which is passed as
    an IMAP4 literal.  If necessary (the string contains any
    non-printing characters or white-space and isn't enclosed with
    either parentheses or double quotes) each string is quoted.
    However, the 'password' argument to the LOGIN command is always
    quoted.  If you want to avoid having an argument string quoted
    (eg: the 'flags' argument to STORE) then enclose the string in
    parentheses (eg: "(\Deleted)").

    Each command returns a tuple: (type, [data, ...]) where 'type'
    is usually 'OK' or 'NO', and 'data' is either the text from the
    tagged response, or untagged results from command. Each 'data'
    is either a string, or a tuple. If a tuple, then the first part
    is the header of the response, and the second part contains
    the data (ie: 'literal' value).

    Errors raise the exception class <instance>.error("<reason>").
    IMAP4 server errors raise <instance>.abort("<reason>"),
    which is a sub-class of 'error'. Mailbox status changes
    from READ-WRITE to READ-ONLY raise the exception class
    <instance>.readonly("<reason>"), which is a sub-class of 'abort'.

    "error" exceptions imply a program error.
    "abort" exceptions imply the connection should be reset, and
            the command re-tried.
    "readonly" exceptions imply the command should be re-tried.

    Note: to use this module, you must read the RFCs pertaining to the
    IMAP4 protocol, as the semantics of the arguments to each IMAP4
    command are left to the invoker, not to mention the results. Also,
    most IMAP servers implement a sub-set of the commands available here.
    c@seZdZdS)zIMAP4.errorN��__name__�
__module__�__qualname__�r=r=�/usr/lib64/python3.8/imaplib.py�error�sr?c@seZdZdS)zIMAP4.abortNr9r=r=r=r>�abort�sr@c@seZdZdS)zIMAP4.readonlyNr9r=r=r=r>�readonly�srA�cCs�t|_d|_d|_i|_i|_d|_d|_d|_d|_	|�
�|�||�z|��Wn8t
k
r�z|��Wntk
r�YnX�YnXdS)NrrBFr)�Debug�debug�state�literal�tagged_commands�untagged_responses�continuation_response�is_readonly�tagnum�_tls_established�_mode_ascii�open�_connect�	Exception�shutdown�OSError��self�host�portr=r=r>�__init__�s&zIMAP4.__init__cCs0d|_d|_t�ttj�|_t�ttj�|_dS)NF�ascii)	�utf8_enabled�	_encoding�re�compile�_Literal�ASCII�Literal�_Untagged_status�Untagged_status�rTr=r=r>rM�szIMAP4._mode_asciicCs(d|_d|_t�t�|_t�t�|_dS)NT�utf-8)rYrZr[r\r]r_r`rarbr=r=r>�
_mode_utf8�szIMAP4._mode_utf8cCs�tt�dd��|_t�d|jdtj�|_d|_d|_	i|_
|jdkrf|�dt
�|�d	|j�|��|_d
|jkr�d|_nd|jkr�d
|_n|�|j��|��|jdkr�|�d|jf�tD]}||jkr�q�||_dS|�d��dS)Nii��s(?P<tag>s"\d+) (?P<type>[A-Z]+) (?P<data>.*)�
r�zimaplib version %sznew IMAP4 connection, tag=%sZPREAUTHr�OKr�zCAPABILITIES: %rzserver not IMAP4 compliant)r	�randomZrandint�tagprer[r\r^�tagre�_cmd_log_len�_cmd_log_idx�_cmd_logrD�_mesg�__version__�
_get_responseZwelcomerHrEr?�_get_capabilities�capabilities�AllowedVersions�PROTOCOL_VERSION)rT�versionr=r=r>rO�s:���





zIMAP4._connectcCs&|tkrt||���Std|��dS)NzUnknown IMAP4 command: '%s')�Commands�getattr�lower�AttributeError)rT�attrr=r=r>�__getattr__	szIMAP4.__getattr__cCs|S�Nr=rbr=r=r>�	__enter__szIMAP4.__enter__cGs4|jdkrdSz|��Wntk
r.YnXdS)Nr)rE�logoutrR)rT�argsr=r=r>�__exit__s
zIMAP4.__exit__cCs4|js
dn|j}t�d||j|j�t�||jf�S)Nzimaplib.open)rU�sys�auditrV�socketZcreate_connection)rTrUr=r=r>�_create_socketszIMAP4._create_socketcCs(||_||_|��|_|j�d�|_dS)z�Setup connection to remote server on "host:port"
            (default: localhost:standard IMAP4 port).
        This connection will be used by the routines:
            read, readline, send, shutdown.
        �rbN)rUrVr��sock�makefile�filerSr=r=r>rN's
z
IMAP4.opencCs|j�|�S�zRead 'size' bytes from remote.)r��read�rT�sizer=r=r>r�3sz
IMAP4.readcCs.|j�td�}t|�tkr*|�dt��|S)�Read line from remote.rfzgot more than %d bytes)r��readline�_MAXLINE�lenr?�rT�liner=r=r>r�8szIMAP4.readlinecCst�d||�|j�|�dS)�Send data to remote.zimaplib.sendN)r�r�r�Zsendall�rT�datar=r=r>�send@sz
IMAP4.sendc
Cst|j��zXz|j�tj�Wn@tk
r^}z"|jtjkrNt	|dd�dkrN�W5d}~XYnXW5|j��XdS)� Close I/O established in "open".Zwinerrorri&'N)
r��closer�rQr�Z	SHUT_RDWRrR�errnoZENOTCONNrx)rT�excr=r=r>rQFs
�zIMAP4.shutdowncCs|jS)zfReturn socket instance used to connect to IMAP4 server.

        socket = <instance>.socket()
        )r�rbr=r=r>r�VszIMAP4.socketcCsBd}|�ddg|�\}}|dr(||fS|��\}}|�|||�S)aReturn most recent 'RECENT' responses if any exist,
        else prompt server for an update using the 'NOOP' command.

        (typ, [data]) = <instance>.recent()

        'data' is None if no new messages,
        else list of RECENT responses, most recent last.
        ZRECENTrgN���)�_untagged_response�noop�rT�name�typ�datr=r=r>�recentbs	zIMAP4.recentcCs|�|dg|���S)z�Return data for response 'code' if received, or None.

        Old value for response 'code' is cleared.

        (code, [data]) = <instance>.response(code)
        N)r��upper)rT�coder=r=r>�responsesszIMAP4.responsecCsxd}|sd}|r.|d|dfdkr2d|}nd}|r@t|�}nd}t�t|�}|jrbd|d	}||_|�||||�S)
z�Append message to named mailbox.

        (typ, [data]) = <instance>.append(mailbox, flags, date_time, message)

                All args except `message' can be None.
        r�INBOXrr���(�)�(%s)NsUTF8 (�))r�MapCRLF�sub�CRLFrYrF�_simple_command)rT�mailbox�flags�	date_time�messager�rFr=r=r>�append�s

zIMAP4.appendcCsP|��}t|�j|_|�d|�\}}|dkrB|�|d�dd���d|_||fS)asAuthenticate command - requires response processing.

        'mechanism' specifies which authentication mechanism is to
        be used - it must appear in <instance>.capabilities in the
        form AUTH=<mechanism>.

        'authobject' must be a callable object:

                data = authobject(response)

        It will be called to process server continuation responses; the
        response argument it is passed will be a bytes.  It should return bytes
        data that will be base64 encoded and sent to the server.  It should
        return None if the client abort response '*' should be sent instead.
        rrgr�rc�replacer)r��_Authenticator�processrFr�r?�decoderE)rTZ	mechanismZ
authobject�mechr�r�r=r=r>�authenticate�szIMAP4.authenticatecCs d}|�|�\}}|�|||�S)zT(typ, [data]) = <instance>.capability()
        Fetch capabilities list from server.r�r�r�r�r=r=r>�
capability�szIMAP4.capabilitycCs
|�d�S)zRCheckpoint mailbox on server.

        (typ, [data]) = <instance>.check()
        r�r�rbr=r=r>�check�szIMAP4.checkcCs$z|�d�\}}W5d|_X||fS)z�Close currently selected mailbox.

        Deleted messages are removed from writable mailbox.
        This is the recommended command before 'LOGOUT'.

        (typ, [data]) = <instance>.close()
        rr)rEr��rTr�r�r=r=r>r��szIMAP4.closecCs|�d||�S)z�Copy 'message_set' messages onto end of 'new_mailbox'.

        (typ, [data]) = <instance>.copy(message_set, new_mailbox)
        rr�)rT�message_setZnew_mailboxr=r=r>�copy�sz
IMAP4.copycCs|�d|�S)zPCreate new mailbox.

        (typ, [data]) = <instance>.create(mailbox)
        rr��rTr�r=r=r>�create�szIMAP4.createcCs|�d|�S)zPDelete old mailbox.

        (typ, [data]) = <instance>.delete(mailbox)
        rr�r�r=r=r>�delete�szIMAP4.deletecCs|�d||�S)z�Delete the ACLs (remove any rights) set for who on mailbox.

        (typ, [data]) = <instance>.deleteacl(mailbox, who)
        rr�)rTr��whor=r=r>�	deleteacl�szIMAP4.deleteaclcCsHd|jkrt�d��|�d|�\}}|dkr@d|��kr@|��||fS)zkSend an RFC5161 enable string to the server.

        (typ, [data]) = <intance>.enable(capability)
        rzServer does not support ENABLErgzUTF8=ACCEPT)rsrr?r�r�rd)rTr�r�r�r=r=r>�enable�s

zIMAP4.enablecCs d}|�|�\}}|�|||�S)z�Permanently remove deleted items from selected mailbox.

        Generates 'EXPUNGE' response for each deleted message.

        (typ, [data]) = <instance>.expunge()

        'data' is list of 'EXPUNGE'd message numbers in order received.
        rr�r�r=r=r>�expunges	z
IMAP4.expungecCs$d}|�|||�\}}|�|||�S)a#Fetch (parts of) messages.

        (typ, [data, ...]) = <instance>.fetch(message_set, message_parts)

        'message_parts' should be a string of selected parts
        enclosed in parentheses, eg: "(UID BODY[TEXT])".

        'data' are tuples of message part envelope and data.
        rr�)rTr�Z
message_partsr�r�r�r=r=r>�fetchs
zIMAP4.fetchcCs|�d|�\}}|�||d�S)zXGet the ACLs for a mailbox.

        (typ, [data]) = <instance>.getacl(mailbox)
        rZACLr��rTr�r�r�r=r=r>�getaclszIMAP4.getaclcCs"|�d|||�\}}|�||d�S)za(typ, [data]) = <instance>.getannotation(mailbox, entry, attribute)
        Retrieve ANNOTATIONs.r �
ANNOTATIONr�)rTr��entryZ	attributer�r�r=r=r>�
getannotation(szIMAP4.getannotationcCs|�d|�\}}|�||d�S)z�Get the quota root's resource usage and limits.

        Part of the IMAP4 QUOTA extension defined in rfc2087.

        (typ, [data]) = <instance>.getquota(root)
        r!�QUOTAr�)rT�rootr�r�r=r=r>�getquota0szIMAP4.getquotacCs@|�d|�\}}|�||d�\}}|�||d�\}}|||gfS)z�Get the list of quota roots for the named mailbox.

        (typ, [[QUOTAROOT responses...], [QUOTA responses]]) = <instance>.getquotaroot(mailbox)
        r"r�Z	QUOTAROOTr�)rTr�r�r�ZquotaZ	quotarootr=r=r>�getquotaroot;szIMAP4.getquotaroot�""�*cCs$d}|�|||�\}}|�|||�S)z�List mailbox names in directory matching pattern.

        (typ, [data]) = <instance>.list(directory='""', pattern='*')

        'data' is list of LIST responses.
        r$r��rTZ	directory�patternr�r�r�r=r=r>�listFsz
IMAP4.listcCs<|�d||�|��\}}|dkr.|�|d��d|_||fS)z�Identify client using plaintext password.

        (typ, [data]) = <instance>.login(user, password)

        NB: 'password' will be quoted.
        r%rgr�r)r��_quoter?rE)rT�user�passwordr�r�r=r=r>�loginRs
zIMAP4.logincCs|||_|_|�d|j�S)zr Force use of CRAM-MD5 authentication.

        (typ, [data]) = <instance>.login_cram_md5(user, password)
        zCRAM-MD5)r�r�r��_CRAM_MD5_AUTH)rTr�r�r=r=r>�login_cram_md5`szIMAP4.login_cram_md5cCsBddl}t|jt�r |j�d�n|j}|jd|�||d���S)z1 Authobject to use with CRAM-MD5 authentication. rNrc� Zmd5)�hmac�
isinstancer��str�encoder�ZHMACZ	hexdigest)rTZ	challenger��pwdr=r=r>r�is
�zIMAP4._CRAM_MD5_AUTHcCs$d|_|�d�\}}|��||fS)z|Shutdown connection to server.

        (typ, [data]) = <instance>.logout()

        Returns server 'BYE' response.
        r)rEr�rQr�r=r=r>rqszIMAP4.logoutcCs$d}|�|||�\}}|�|||�S)z�List 'subscribed' mailbox names in directory matching pattern.

        (typ, [data, ...]) = <instance>.lsub(directory='""', pattern='*')

        'data' are tuples of message part envelope and data.
        r&r�r�r=r=r>�lsub~sz
IMAP4.lsubcCs|�d|�\}}|�||d�S)z�Show my ACLs for a mailbox (i.e. the rights that I have on mailbox).

        (typ, [data]) = <instance>.myrights(mailbox)
        r#r�r�r=r=r>�myrights�szIMAP4.myrightscCs d}|�|�\}}|�|||�S)zb Returns IMAP namespaces ala rfc2342

        (typ, [data, ...]) = <instance>.namespace()
        r'r�r�r=r=r>�	namespace�szIMAP4.namespacecCs |jdkr|�|j�|�d�S)zFSend NOOP command.

        (typ, [data]) = <instance>.noop()
        rhr()rD�_dump_urrHr�rbr=r=r>r��s
z
IMAP4.noopcCs(d}|�|||||�\}}|�||d�S)z�Fetch truncated part of a message.

        (typ, [data, ...]) = <instance>.partial(message_num, message_part, start, length)

        'data' is tuple of message part envelope and data.
        r)rr�)rTZmessage_numZmessage_part�startZlengthr�r�r�r=r=r>�partial�sz
IMAP4.partialcCsd}|�d|�S)z�Assume authentication as "user".

        Allows an authorised administrator to proxy into any user's
        mailbox.

        (typ, [data]) = <instance>.proxyauth(user)
        r*r�)rTr�r�r=r=r>�	proxyauth�s	zIMAP4.proxyauthcCs|�d||�S)zkRename old mailbox name to new.

        (typ, [data]) = <instance>.rename(oldmailbox, newmailbox)
        r+r�)rTZ
oldmailboxZ
newmailboxr=r=r>�rename�szIMAP4.renamecGsTd}|r2|jrt�d��|j|d|f|��\}}n|j|f|��\}}|�|||�S)z�Search mailbox for matching messages.

        (typ, [data]) = <instance>.search(charset, criterion, ...)

        'data' is space separated list of matching message numbers.
        If UTF8 is enabled, charset MUST be None.
        r,z'Non-None charset not valid in UTF8 mode�CHARSET)rYrr?r�r�)rT�charsetZcriteriar�r�r�r=r=r>�search�s
zIMAP4.searchr�FcCs�i|_||_|rd}nd}|�||�\}}|dkr@d|_||fSd|_d|jkrx|sx|jdkrj|�|j�|�d|��||j�d	d
g�fS)atSelect a mailbox.

        Flush all untagged responses.

        (typ, [data]) = <instance>.select(mailbox='INBOX', readonly=False)

        'data' is count of messages in mailbox ('EXISTS' response).

        Mandated responses are ('FLAGS', 'EXISTS', 'RECENT', 'UIDVALIDITY'), so
        other responses should be obtained via <instance>.response('FLAGS') etc.
        rr-rgrr�	READ-ONLYrfz%s is not writable�EXISTSN)rHrJr�rErDr�rA�get)rTr�rAr�r�r�r=r=r>�select�s"
�
zIMAP4.selectcCs|�d|||�S)zZSet a mailbox acl.

        (typ, [data]) = <instance>.setacl(mailbox, who, what)
        r.r�)rTr�r�Zwhatr=r=r>�setacl�szIMAP4.setaclcGs |jd|��\}}|�||d�S)z_(typ, [data]) = <instance>.setannotation(mailbox[, entry, attribute]+)
        Set ANNOTATIONs.r/r�)r/r�)rTr�r�r�r=r=r>�
setannotationszIMAP4.setannotationcCs |�d||�\}}|�||d�S)ziSet the quota root's resource limits.

        (typ, [data]) = <instance>.setquota(root, limits)
        r0r�r�)rTr�Zlimitsr�r�r=r=r>�setquota	szIMAP4.setquotacGsFd}|d|dfdkr d|}|j|||f|��\}}|�|||�S)z�IMAP4rev1 extension SORT command.

        (typ, [data]) = <instance>.sort(sort_criteria, charset, search_criteria, ...)
        r1rr�r�r�r�)rTZ
sort_criteriar��search_criteriar�r�r�r=r=r>�sorts
z
IMAP4.sortNcCs�d}ts|�d��|jr"|�d��||jkr6|�d��|dkrFt��}|�|�\}}|dkr�|j|j	|j
d�|_	|j	�d�|_d|_|�
�n
|�d	��|�|||�S)
Nr2zSSL support missingzTLS session already establishedzTLS not supported by serverrg�Zserver_hostnamer�TzCouldn't establish TLS session)�HAVE_SSLr?rLr@rs�ssl�_create_stdlib_contextr��wrap_socketr�rUr�r�rrr�)rT�ssl_contextr�r�r�r=r=r>�starttls s&



�

zIMAP4.starttlscCs$d}|�|||�\}}|�|||�S)zpRequest named status conditions for mailbox.

        (typ, [data]) = <instance>.status(mailbox, names)
        r3r�)rTr��namesr�r�r�r=r=r>�status7szIMAP4.statuscCs>|d|dfdkrd|}|�d|||�\}}|�||d�S)z�Alters flag dispositions for messages in mailbox.

        (typ, [data]) = <instance>.store(message_set, command, flags)
        rr�r�r�r4rr�)rTr��commandr�r�r�r=r=r>�storeCszIMAP4.storecCs|�d|�S)zYSubscribe to new mailbox.

        (typ, [data]) = <instance>.subscribe(mailbox)
        r5r�r�r=r=r>�	subscribeNszIMAP4.subscribecGs*d}|j|||f|��\}}|�|||�S)z�IMAPrev1 extension THREAD command.

        (type, [data]) = <instance>.thread(threading_algorithm, charset, search_criteria, ...)
        r6r�)rTZthreading_algorithmr�r�r�r�r�r=r=r>�threadVszIMAP4.threadc	Gs�|��}|tkr|�d|��|jt|krL|�d||jd�t|�f��d}|j||f|��\}}|dkrt|}nd}|�|||�S)z�Execute "command arg ..." with messages identified by UID,
                rather than message number.

        (typ, [data]) = <instance>.uid(command, arg1, arg2, ...)

        Returns response appropriate to 'command'.
        zUnknown IMAP4 UID command: %s�9command %s illegal in state %s, only allowed in states %s�, r7)r,r1r6r)r�rwr?rE�joinr�r�)rTrr�r�r�r�r=r=r>�uid`s��z	IMAP4.uidcCs|�d|�S)z_Unsubscribe from old mailbox.

        (typ, [data]) = <instance>.unsubscribe(mailbox)
        r8r�r�r=r=r>�unsubscribeyszIMAP4.unsubscribecGs,|��}|tkr|jft|<|j|f|��S)aAllow simple extension commands
                notified by server in CAPABILITY response.

        Assumes command is legal in current state.

        (typ, [data]) = <instance>.xatom(name, arg, ...)

        Returns response appropriate to extension command `name'.
        )r�rwrEr��rTr�r�r=r=r>�xatom�s
zIMAP4.xatomc	Csb|dkrd}|j}|jdkr<|�d|t|�|d��|f�||krT||�|�n
|g||<dS)N��z#untagged_responses[%s] %s += ["%r"]rB)rHrDror�r�r�)rTr�r�Zurr=r=r>�_append_untagged�s
�zIMAP4._append_untaggedcCs,|j�d�}|r(|�|d�|jd���dS)N�BYEr�r�)rHr�r@r�rZ)rT�byer=r=r>�
_check_bye�szIMAP4._check_byec

Gs2|jt|kr4d|_|�d||jd�t|�f��dD]}||jkr8|j|=q8d|jkrj|jsj|�d��|��}t	||j
�}|d|}|D]0}|dkr�q�t|t�r�t	||j
�}|d|}q�|j}|dk	�r
d|_t
|�t
|j�kr�|}nd}|t	dt|�|j
�}|jdk�r&|�d	|�n|�d	|�z|�|t�Wn2tk
�rx}	z|�d
|	��W5d}	~	XYnX|dk�r�|S|���r�|j|�r�|S�q�|�r�||j�}|jdk�r�|�dt|��z|�|�|�t�Wn2tk
�r}	z|�d
|	��W5d}	~	XYnX|�s��q.�q�|S)Nrr�rg�NO�BADr�z#mailbox status changed to READ-ONLY� z {%s}�z> %rzsocket error: %szwrite literal size %s)rErwrFr?rrHrJrA�_new_tag�bytesrZr�r��type�_commandr�rDro�_logr�r�rRr@rqrGrI)
rTr�r�r��tagr��argrFZ	literator�valr=r=r>r�sl��


�


 



 zIMAP4._commandc
Cs�|dk}|s|��z|j||d�\}}Wnj|jk
r`}z|�d||f��W5d}~XYn6|jk
r�}z|�d||f��W5d}~XYnX|s�|��|dkr�|�d|||f��||fS)Nr)�
expect_byezcommand: %s => %srz%s command error: %s %s)r�_get_tagged_responser@r?)rTr�rrr�r�rr=r=r>�_command_complete�s"$zIMAP4._command_completecCsJ|��\}}|dgkr |�d��t|d|j�}|��}t|���|_dS)Nz"no CAPABILITY response from serverr�)r�r?r�rZr��tuple�splitrsr�r=r=r>rr
s

zIMAP4._get_capabilitiescCs�|��}|�|j|�rr|j�d�}||jkr:|�d|��|j�d�}t||j�}|j�d�}||gf|j|<�nd}|�t	|�s�|�|j
|�r�|j�d�}|jdkr�|�t|�r�|j�d�|_dS|�d|��|j�d�}t||j�}|j�d�}|dk�rd}|�r|d|}|�|j
|��rvt|j�d	��}|jd
k�rP|�d|�|�|�}|�|||f�|��}�q|�||�|dk�r�|�t|��r�|j�d�}t||j�}|�||j�d��|jd
k�r�|dk�r�|�d||f�|S)Nrzunexpected tagged response: %rrr�Zdata2zunexpected response: %rr
rr�rzread literal size %srrf)rrrz%s response: %r)�	_get_line�_matchrk�mo�grouprGr@r�rZ�Untagged_responsera�ContinuationrIr_�intrDror�r�
Response_code)rT�resprr�r�Zdat2r�r�r=r=r>rqsP



zIMAP4._get_responsec
Cs�|j|}|dk	r|j|=|S|rDd}|j�|d�}|dk	rD||fS|��z|��Wq|jk
r�}z|jdkr~|���W5d}~XYqXqdS)Nrrf)rGrH�poprrqr@rD�	print_log)rTrr �resultr�rrr=r=r>r!cs 

zIMAP4._get_tagged_responsecCsf|��}|s|�d��|�d�s.|�d|��|dd�}|jdkrT|�d|�n|�d|�|S)Nzsocket error: EOFrz#socket error: unterminated line: %r���rz< %r)r�r@�endswithrDrorr�r=r=r>r%�s


zIMAP4._get_linecCsD|�|�|_|jdk	r:|jdkr:|�d|j|j��f�|jdk	S)Nrz	matched %r => %r)�matchr'rDror��groups)rTZcre�sr=r=r>r&�szIMAP4._matchcCs2|jtt|j�|j�}|jd|_d|j|<|S)Nrf)rjrr�rKrZrG)rTrr=r=r>r�s
zIMAP4._new_tagcCs$|�dd�}|�dd�}d|dS)N�\z\\�"z\")r�)rTrr=r=r>r��szIMAP4._quotecGs|�||j|f|���Sr})r"rrr=r=r>r��szIMAP4._simple_commandcCsT|dkr||fS||jkr$|dgfS|j�|�}|jdkrL|�d||f�||fS)Nrrzuntagged_responses[%s] => %s)rHr.rDro)rTr�r�r�r�r=r=r>r��s


zIMAP4._untagged_responsecCsN|dkrt��}t�dt�|��}tj�d||dd|f�tj��dS)Nz%M:%Sz
  %s.%02d %s
�d)�time�strftime�	localtimer��stderr�write�flush)rTr5ZsecsZtmr=r=r>ro�s
zIMAP4._mesgcCs>|��}|sdSd}tdd�|�}|�d||�|�f�dS)Nz
		cSs*d|d|ddr"d�|d�p$dfS)Nz%s: "%s"rrfz" "rB)r)�xr=r=r>�<lambda>�r
z IMAP4._dump_ur.<locals>.<lambda>zuntagged responses dump:%s%s)�items�mapror)rT�dict�l�tr=r=r>r��szIMAP4._dump_urcCs8|t��f|j|j<|jd7_|j|jkr4d|_dS)Nrfr)r9rnrmrlr�r=r=r>r�sz
IMAP4._logcCsl|�dt|j��|j|j}}|rhz|j|j|�WnYnX|d7}||jkr^d}|d8}q"dS)Nzlast %d IMAP4 interactions:rfr)ror�rnrmrl)rT�i�nr=r=r>r/�s
zIMAP4.print_log)r�r�)r�r�)r�F)N)F)N)Tr:r;r<�__doc__rPr?r@rA�
IMAP4_PORTrWrMrdrOr|r~r�r�rNr�r�r�rQr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr	r
rrrrr"rrrqr!r%r&rr�r�r�ror�rr/r=r=r=r>r�s�,*
		
	



 	

M	P
!
c@s:eZdZdZdedddfdd�Zdd�Zdefdd	�ZdS)
�	IMAP4_SSLa3IMAP4 client class over SSL connection

        Instantiate with: IMAP4_SSL([host[, port[, keyfile[, certfile[, ssl_context]]]]])

                host - host's name (default: localhost);
                port - port number (default: standard IMAP4 SSL port);
                keyfile - PEM formatted file that contains your private key (default: None);
                certfile - PEM formatted certificate chain file (default: None);
                ssl_context - a SSLContext object that contains your certificate chain
                              and private key (default: None)
                Note: if ssl_context is provided, then parameters keyfile or
                certfile should not be set otherwise ValueError is raised.

        for more documentation see the docstring of the parent class IMAP4.
        rBNcCs�|dk	r|dk	rtd��|dk	r0|dk	r0td��|dk	s@|dk	rVddl}|�dtd�||_||_|dkrxtj||d�}||_t	�
|||�dS)Nz8ssl_context and keyfile arguments are mutually exclusivez9ssl_context and certfile arguments are mutually exclusiverzEkeyfile and certfile are deprecated, use a custom ssl_context instead�)�certfile�keyfile)�
ValueError�warnings�warn�DeprecationWarningrMrLr�r�r�rrW)rTrUrVrMrLr�rOr=r=r>rW�s$��zIMAP4_SSL.__init__cCst�|�}|jj||jd�S)Nr�)rr�r�r�rU)rTr�r=r=r>r�s
�zIMAP4_SSL._create_socketcCst�|||�dS)z�Setup connection to remote server on "host:port".
                (default: localhost:standard IMAP4 SSL port).
            This connection will be used by the routines:
                read, readline, send, shutdown.
            N)rrNrSr=r=r>rNszIMAP4_SSL.open)r:r;r<rH�IMAP4_SSL_PORTrWr�rNr=r=r=r>rJ�s�
rJc@sBeZdZdZdd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)rz�IMAP4 client class over a stream

    Instantiate with: IMAP4_stream(command)

            "command" - a string that can be passed to subprocess.Popen()

    for more documentation see the docstring of the parent class IMAP4.
    cCs||_t�|�dSr})rrrW)rTrr=r=r>rW/szIMAP4_stream.__init__NcCsNd|_d|_d|_d|_tj|jttjtjddd�|_	|j	j
|_|j	j|_
dS)z�Setup a stream connection.
        This connection will be used by the routines:
            read, readline, send, shutdown.
        NT)�bufsize�stdin�stdout�shellZ	close_fds)rUrVr�r��
subprocess�Popenrr�PIPEr�rT�	writefilerU�readfilerSr=r=r>rN4s�
zIMAP4_stream.opencCs|j�|�Sr�)r[r�r�r=r=r>r�DszIMAP4_stream.readcCs
|j��S)r�)r[r�rbr=r=r>r�IszIMAP4_stream.readlinecCs|j�|�|j��dS)r�N)rZr=r>r�r=r=r>r�NszIMAP4_stream.sendcCs"|j��|j��|j��dS)r�N)r[r�rZr��waitrbr=r=r>rQTs

zIMAP4_stream.shutdown)NN)
r:r;r<rHrWrNr�r�r�rQr=r=r=r>r#s

c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r�zcPrivate class to provide en/decoding
            for base64-based authentication conversation.
    cCs
||_dSr})r�)rTZmechinstr=r=r>rWbsz_Authenticator.__init__cCs&|�|�|��}|dkrdS|�|�S)N�*)r�r�r�)rTr�Zretr=r=r>r�esz_Authenticator.processcCsnd}t|t�r|�d�}|rjt|�dkrB|dd�}|dd�}n|}d}t�|�}|r||dd�}q|S)Nr
rc�0r�)r�r�r�r��binasciiZ
b2a_base64)rT�inpZouprE�er=r=r>r�ks	


z_Authenticator.encodecCs|sdSt�|�S)Nr
)r_Z
a2b_base64)rTr`r=r=r>r��sz_Authenticator.decodeN)r:r;r<rHrWr�r�r�r=r=r=r>r�\s
r�z0 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Decr�cCsi|]\}}|��|d�qS)rf)r�)�.0rGr5r=r=r>�
<dictcomp>�srcrfc	Cs�t�|�}|sdSt|�d�}|�d�}t|�d��}t|�d��}t|�d��}t|�d��}t|�d��}t|�d	��}	t|�d
��}
|	d|
d}|dkr�|}||||||d
d
d
f	}t�|�|}
t�|
�S)z�Parse an IMAP4 INTERNALDATE string.

    Return corresponding local time.  The return value is a
    time.struct_time tuple or None if the string has wrong format.
    N�mon�zonen�day�year�hour�min�sec�zoneh�zonem�<�-r�)	�InternalDater3�Mon2numr(r+�calendarZtimegmr9r;)r-r'rdrerfrgrhrirjrkrlZzoneZtt�utcr=r=r>r�s$

cCs@d}d}tt|��}|r<t|d�\}}|||d�|}q|S)z-Convert integer to A-P string representation.r
sABCDEFGHIJKLMNOP�rf)r+�abs�divmod)ZnumrZAP�modr=r=r>r	�scCs$t�|�}|sdSt|�d����S)z-Convert IMAP4 flags response to python tuple.r=r�)�Flagsr3r#r(r$)r-r'r=r=r>r
�s
cCst|ttf�r"t�|tj���}n�t|t�r�z
|j	}WnZt
k
r�tjr�|d}|dkrpt�
t�|��d}tjtjf|}ntj}YnXt|d�}t|dd�dt|�i�}nLt|t�r�|jdkr�td��|}n*t|t�r�|d|dfd	kr�|Std
��d�t|j�}|�|�S)a�Convert date_time to IMAP4 INTERNALDATE representation.

    Return string in form: '"DD-Mmm-YYYY HH:MM:SS +HHMM"'.  The
    date_time argument can be a number (int or float) representing
    seconds since epoch (as returned by time.time()), a 9-tuple
    representing local time, an instance of time.struct_time (as
    returned by time.localtime()), an aware datetime instance or a
    double-quoted string.  In the last case, it is assumed to already
    be in the correct format.
    �r�)ZsecondsN��tzinfozdate_time must be awarer)r7r7zdate_time not of a known typez"%d-{}-%Y %H:%M:%S %z")r�r+�floatrZ
fromtimestamprrrZ
astimezoner#�	tm_gmtoffrzr9�daylightr;�mktime�altzonerrzrNr��format�MonthsZmonthr:)r�ZdtZgmtoffZdstZdeltaZfmtr=r=r>r�s2�





�__main__zd:s:)r=r=z-dz-s)rBzIMAP password for %s on %s: Z	localhostzJFrom: %(user)s@localhost%(lf)sSubject: IMAP4 test%(lf)s%(lf)sdata...%(lf)s�
)r�Zlfr�)r�)�
/tmp/xxx 1)r�)r�z/tmp/yyy)r��
/tmp/yyz 2r�r�)r�)z/tmpzyy*)r�r�)r�)NZSUBJECTZtest)r�)�1z(FLAGS INTERNALDATE RFC822))r)r��FLAGSz
(\Deleted))r�r=)r�r=)r�r=)r�r=)r�r=)r�)ZUIDVALIDITY)r	)r,ZALL)r�)r�)rr=cCsLt�d||f�tt|�|�\}}t�d|||f�|dkrH|d�|S)Nz%s %sz%s => %s %srr)�Mrorx)�cmdr�r�r�r=r=r>�run'sr�rzPROTOCOL_VERSION = %szCAPABILITIES = %rr�)z/tmp/zyy%z.*"([^"]+)"$r�r�r	rz%sz:(FLAGS INTERNALDATE RFC822.SIZE RFC822.HEADER RFC822.TEXT)z
All tests OK.z
Tests failed.z8
If you would like to see debugging output,
try: %s -d5
)UrHrpr_r�rir[r�rWr�r9rqrrr�iorr�r��ImportError�__all__r�rCrIrRrtr�rwr\r*rwror^r_r�r,r)rar]r`rrJr�rr�r$r��	enumeraterprr	r
rr:ZgetoptZgetpass�argvZoptlistr�r?rZstream_command�optr+rUZgetuserZUSERZPASSWDZ	test_mesgZ	test_seq1Z	test_seq2r�r�rErorursr�Zmlr3r'r(�pathr�r	�printr=r=r=r>�<module>sZH
�	�/



	

�l4
9,
#
)





��


�
�__pycache__/pathlib.cpython-38.opt-1.pyc000064400000126263151153537600014006 0ustar00U

e5d���@sjddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZmZm
Z
mZmZddlmZddlmZmZmZmZmZmZmZddlmZdZejdkr�ddlZe� �dd	�d
kr�ddlm!Z!q�dZdZ!ndZd
dddddgZ"ee
eefZ#dZ$dd�Z%dd�Z&Gdd�de'�Z(Gdd�de(�Z)Gdd�de(�Z*e)�Z+e*�Z,Gdd�d�Z-Gd d!�d!e-�Z.e.�Z/d"d#�Z0e1ed$��r�e�2�e0�Z0Gd%d&�d&�Z3Gd'd(�d(�Z4Gd)d*�d*e3�Z5Gd+d,�d,e3�Z6Gd-d.�d.e3�Z7Gd/d0�d0e	�Z8Gd1d
�d
e'�Z9ej:�;e9�Gd2d�de9�Z<Gd3d�de9�Z=Gd4d�de9�Z>Gd5d�de>e<�Z?Gd6d�de>e=�Z@dS)7�N)�Sequence)�EINVAL�ENOENT�ENOTDIR�EBADF�ELOOP)�
attrgetter)�S_ISDIR�S_ISLNK�S_ISREG�S_ISSOCK�S_ISBLK�S_ISCHR�S_ISFIFO)�quote_from_bytesT�nt�)�r)�_getfinalpathnameF�PurePath�
PurePosixPath�PureWindowsPath�Path�	PosixPath�WindowsPath)��{i�cCs t|dd�tkpt|dd�tkS)N�errnoZwinerror)�getattr�_IGNORED_ERROS�_IGNORED_WINERRORS)Z	exception�r!�/usr/lib64/python3.8/pathlib.py�
_ignore_error.s�r#cCsd|kpd|kpd|kS)N�*�?�[r!)�patr!r!r"�_is_wildcard_pattern3sr(c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_FlavourzPA flavour implements a particular (platform-specific) set of path
    semantics.cCs|jj|_dS�N)�sep�join��selfr!r!r"�__init__=sz_Flavour.__init__cCsg}|j}|j}d}}t|�}|D]�}|s.q$|r>|�||�}|�|�\}}}	||	kr�t|	�|��D] }
|
rd|
dkrd|�t�|
��qdn|	r�|	dkr�|�t�|	��|s�|r$|s�|D]0}|s�q�|r�|�||�}|�|�d}|r�q�q�q�q$|s�|�r|�||�|�	�|||fS)N��.r)
r+�altsep�reversed�replace�	splitroot�split�append�sys�intern�reverse)r.�partsZparsedr+r2�drv�root�it�partZrel�xr!r!r"�parse_parts@s@
z_Flavour.parse_partscCsz|r*|sp|rp||||g|dd�fSnF|rb||ksJ|�|�|�|�krp||||dd�fSn||||fS|||fS)z�
        Join the two paths represented by the respective
        (drive, root, parts) tuples.  Return a new (drive, root, parts) tuple.
        �N)�casefold)r.r<r=r;Zdrv2Zroot2Zparts2r!r!r"�join_parsed_partsfsz_Flavour.join_parsed_partsN)�__name__�
__module__�__qualname__�__doc__r/rArDr!r!r!r"r)9s&r)c@s�eZdZdZdZdZeZej	dkZ
ed�ZdZ
ddd	d
hdd�ed
d�D�Bdd�ed
d�D�BZefdd�Zdd�Zdd�Zdd�Zd&dd�Ze
fdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%S)'�_WindowsFlavour�\�/TrZ4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZz\\?\ZCONZPRNZAUXZNULcCsh|]}d|�qS)zCOM%dr!��.0�ir!r!r"�	<setcomp>�sz_WindowsFlavour.<setcomp>rB�
cCsh|]}d|�qS)zLPT%dr!rLr!r!r"rO�scCs\|dd�}|dd�}||krP||krP|�|�\}}|dd�}|dd�}nd}|dd�}||kr�||kr�||kr�|�|d�}|dkr�|�||d�}||dkr�|dkr�t|�}|r�||d|�|||dd�fS|d|�|||dd�fSd}	}
|dk�r6||jk�r6|dd�}	|dd�}|}||k�rN|}
|�|�}||	|
|fS)NrrBrr0�����:)�_split_extended_path�find�len�
drive_letters�lstrip)r.r?r+�first�second�prefixZthird�indexZindex2r<r=r!r!r"r5�s6"

z_WindowsFlavour.splitrootcCs|��Sr*��lower�r.�sr!r!r"rC�sz_WindowsFlavour.casefoldcCsdd�|D�S)NcSsg|]}|���qSr!r])rM�pr!r!r"�
<listcomp>�sz2_WindowsFlavour.casefold_parts.<locals>.<listcomp>r!�r.r;r!r!r"�casefold_parts�sz_WindowsFlavour.casefold_partscCst�t�|�tj�jSr*)�re�compile�fnmatch�	translate�
IGNORECASE�	fullmatch�r.�patternr!r!r"�compile_pattern�sz_WindowsFlavour.compile_patternFcCs�t|�}|st��Sd}tdk	r�|r2|�t|��Sg}z|�t|��}WnBtk
r�|}tj�|�\}}|�|�||kr�|YSYq6Xtjj	|ft
|���Sq6dSr*)�str�os�getcwdr�_ext_to_normal�FileNotFoundError�pathr6r7r,r3)r.rs�strictr`Z
previous_sZ
tail_parts�tailr!r!r"�resolve�s$
z_WindowsFlavour.resolvecCsXd}|�|�rP|dd�}|dd�}|�d�rP||dd�7}d|dd�}||fS)Nr0�zUNC\rQrJ)�
startswith)r.r`Z
ext_prefixr[r!r!r"rT�s

z$_WindowsFlavour._split_extended_pathcCs|�|�dS�NrB)rTr_r!r!r"rq�sz_WindowsFlavour._ext_to_normalcCs6|sdS|d�d�rdS|d�d�d��|jkS)NFrz\\rRr1)rx�	partition�upper�reserved_namesrcr!r!r"�is_reserved�s
z_WindowsFlavour.is_reservedcCsd|j}t|�dkrJ|ddkrJ|��dd��d�}d|t|�d��fSdt|���d��SdS)NrrBrSrKz
file:///%s/%szutf-8zfile:)�driverV�as_posixrX�urlquote_from_bytes�encode)r.rsr~�restr!r!r"�make_uri�s�z_WindowsFlavour.make_uricCs�dtjkrtjd}nJdtjkrXztjd}Wntk
rFd}YnX|tjd}ntd��|r�tjd|kr�|�|f�\}}}|dtjdkr�td|��||d<|s�|r�|||�|d	d��}n
|�|�}|S)
NZUSERPROFILEZHOMEPATHZ	HOMEDRIVEr0zCan't determine home directoryZUSERNAMErR�%Can't determine home directory for %rrB)ro�environ�KeyError�RuntimeErrorrAr,)r.�username�userhomer<r=r;r!r!r"�
gethomedirs*


�
z_WindowsFlavour.gethomedirN)F)rErFrGr+r2�has_drv�ntpath�pathmodro�name�is_supported�setrWZext_namespace_prefix�ranger|r5rCrdrmrvrTrqr}r�r�r!r!r!r"rIxs.

���'

rIc@sleZdZdZdZdZeZej	dkZ
efdd�Zdd�Zd	d
�Z
dd�Zdd
d�Zdd�Zdd�Zdd�ZdS)�
_PosixFlavourrKr0FrcCsV|rH|d|krH|�|�}t|�t|�dkr<d|d|fSd||fSn
dd|fSdS)Nrrr0)rXrV)r.r?r+Z
stripped_partr!r!r"r5%s
z_PosixFlavour.splitrootcCs|Sr*r!r_r!r!r"rC4sz_PosixFlavour.casefoldcCs|Sr*r!rcr!r!r"rd7sz_PosixFlavour.casefold_partscCst�t�|��jSr*)rerfrgrhrjrkr!r!r"rm:sz_PosixFlavour.compile_patterncsJ|j�|j�i������fdd��|��r0dnt��}�|t|��pH�S)Ncs�|���rd}|���D]�}|r|dkr*q|dkrD|���\}}}q|���rX||}n|�|}|�kr��|}|dk	r~qtd|��z��|�}Wn6tk
r�}z|jtkr��r��|}W5d}~XYqXd�|<�||�}|�|<q|S)Nr0r1�..zSymlink loop from %r)	rxr6�
rpartition�endswithr��readlink�OSErrorrr)rsr�r��_�newpath�target�e��_resolveZaccessor�seenr+rtr!r"r�As4




z'_PosixFlavour.resolve.<locals>._resolver0)r+�	_accessor�is_absoluterorprn)r.rsrt�baser!r�r"rv=s)z_PosixFlavour.resolvecCsdS�NFr!rcr!r!r"r}msz_PosixFlavour.is_reservedcCst|�}dt|�S)Nzfile://)�bytesr�)r.rsZbpathr!r!r"r�psz_PosixFlavour.make_uricCs||s@ztjdWStk
r<ddl}|�t���jYSXn8ddl}z|�|�jWStk
rvtd|��YnXdS)N�HOMErr�)	ror�r��pwd�getpwuid�getuid�pw_dir�getpwnamr�)r.r�r�r!r!r"r�vs�z_PosixFlavour.gethomedirN)F)rErFrGr+r2r��	posixpathr�ror�r�r5rCrdrmrvr}r�r�r!r!r!r"r�s

0r�c@seZdZdZdS)�	_AccessorzjAn accessor implements a particular (system-specific or not) way of
    accessing paths on the filesystem.N)rErFrGrHr!r!r!r"r��sr�c@s�eZdZejZejZejZejZejZej	Z	e
ed�r>ejZndd�ZejZej
Z
e
ed�rdejZnedd��ZejZejZejZer�er�ejZq�dd�Zned	d��ZejZd
d�ZdS)
�_NormalAccessor�lchmodcCstd��dS)Nz%lchmod() not available on this system��NotImplementedError)r.Zpathobj�moder!r!r"r��sz_NormalAccessor.lchmod�linkcCstd��dS)Nz&os.link() not available on this systemr��r.r�r!r!r"�link_to�sz_NormalAccessor.link_tocCstd��dS)Nz&symlink() not available on this systemr���a�b�target_is_directoryr!r!r"�symlink�sz_NormalAccessor.symlinkcCst�||�Sr*)ror�r�r!r!r"r��scCs
t�|�Sr*)ror��r.rsr!r!r"r��sz_NormalAccessor.readlinkN)rErFrGro�stat�lstat�open�listdir�scandir�chmod�hasattrr��mkdir�unlinkr�r��staticmethod�rmdir�renamer4r�supports_symlinksr��utimer�r!r!r!r"r��s4




r�cCsR|d}|dd�}|dkr"t}n$d|kr4td��nt|�rBt}nt}||||�S)NrrB�**z:Invalid pattern: '**' can only be an entire path component)�_RecursiveWildcardSelector�
ValueErrorr(�_WildcardSelector�_PreciseSelector)�
pattern_parts�flavourr'�child_parts�clsr!r!r"�_make_selector�s
r��	lru_cachec@s eZdZdZdd�Zdd�ZdS)�	_SelectorzYA selector matches a specific glob pattern part against the children
    of a given path.cCs0||_|rt||�|_d|_nt�|_d|_dS)NTF)r�r��	successor�dironly�_TerminatingSelector)r.r�r�r!r!r"r/�sz_Selector.__init__cCs<t|�}|j}|j}|jj}||�s,tg�S|�||||�S)zuIterate over all child paths of `parent_path` matched by this
        selector.  This can contain parent_path itself.)�type�is_dir�existsr�r��iter�_select_from)r.�parent_pathZpath_clsr�r�r�r!r!r"�select_from�sz_Selector.select_fromN)rErFrGrHr/r�r!r!r!r"r��s	r�c@seZdZdd�ZdS)r�ccs
|VdSr*r!)r.r�r�r�r�r!r!r"r��sz!_TerminatingSelector._select_fromN)rErFrGr�r!r!r!r"r��sr�c@seZdZdd�Zdd�ZdS)r�cCs||_t�|||�dSr*)r�r�r/)r.r�r�r�r!r!r"r/sz_PreciseSelector.__init__ccs\z@|�|j�}|jr|n||�r>|j�||||�D]
}|Vq2Wntk
rVYdSXdSr*)�_make_child_relpathr�r�r�r��PermissionError)r.r�r�r�r�rsrar!r!r"r�sz_PreciseSelector._select_fromN�rErFrGr/r�r!r!r!r"r��sr�c@seZdZdd�Zdd�ZdS)r�cCs|�|�|_t�|||�dSr*)rm�matchr�r/�r.r'r�r�r!r!r"r/sz_WildcardSelector.__init__ccs�z�||��}t|�}W5QRX|D]�}|jrrz|��s:Wq"Wn4tk
rp}zt|�sX�WY�q"W5d}~XYnX|j}	|�|	�r"|�|	�}
|j�	|
|||�D]
}|Vq�q"Wnt
k
r�YdSXdSr*)�listr�r�r�r#r�r�r�r�r�r�)r.r�r�r�r��
scandir_it�entries�entryr�r�rsrar!r!r"r�s&


z_WildcardSelector._select_fromNr�r!r!r!r"r�sr�c@s$eZdZdd�Zdd�Zdd�ZdS)r�cCst�|||�dSr*)r�r/r�r!r!r"r//sz#_RecursiveWildcardSelector.__init__ccs�|Vz�||��}t|�}W5QRX|D]t}d}z|��}Wn,tk
rh}zt|�sX�W5d}~XYnX|r(|��s(|�|j�}	|�|	||�D]
}
|
Vq�q(Wntk
r�YdSXdSr�)	r�r�r�r#�
is_symlinkr�r��_iterate_directoriesr�)r.r�r�r�r�r�r�Zentry_is_dirr�rsrar!r!r"r�2s"
z/_RecursiveWildcardSelector._iterate_directoriesc	cs~zbt�}zL|jj}|�|||�D]0}|||||�D]}||kr2|V|�|�q2q W5|��XWntk
rxYdSXdSr*)r��clearr�r�r��addr�)	r.r�r�r�r�ZyieldedZsuccessor_selectZstarting_pointrar!r!r"r�Esz'_RecursiveWildcardSelector._select_fromN)rErFrGr/r�r�r!r!r!r"r�-sr�c@s4eZdZdZdZdd�Zdd�Zdd�Zd	d
�ZdS)�_PathParentszvThis object provides sequence-like access to the logical ancestors
    of a path.  Don't try to construct it yourself.)�_pathcls�_drv�_root�_partscCs&t|�|_|j|_|j|_|j|_dSr*)r�r�r�r�r�r�r!r!r"r/^s
z_PathParents.__init__cCs(|js|jrt|j�dSt|j�SdSry)r�r�rVr�r-r!r!r"�__len__esz_PathParents.__len__cCs@|dks|t|�krt|��|j�|j|j|jd|d��S)NrrB)rV�
IndexErrorr��_from_parsed_partsr�r�r�)r.�idxr!r!r"�__getitem__ks
�z_PathParents.__getitem__cCsd�|jj�S)Nz<{}.parents>)�formatr�rEr-r!r!r"�__repr__qsz_PathParents.__repr__N)	rErFrGrH�	__slots__r/r�r�r�r!r!r!r"r�Ysr�c@s�eZdZdZdZdd�Zdd�Zedd��ZedVd
d��Z	edWdd
��Z
edd��Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zed d!��Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zeed.�d/d0�Zeed1�d2d0�Zed3d4��Zed5d6��Z ed7d8��Z!ed9d:��Z"ed;d<��Z#d=d>�Z$d?d@�Z%dAdB�Z&edCdD��Z'dEdF�Z(dGdH�Z)dIdJ�Z*edKdL��Z+edMdN��Z,dOdP�Z-dQdR�Z.dSdT�Z/dUS)Xra|Base class for manipulating paths without I/O.

    PurePath represents a filesystem path and offers operations which
    don't imply any actual filesystem I/O.  Depending on your system,
    instantiating a PurePath will return either a PurePosixPath or a
    PureWindowsPath object.  You can also instantiate either of these classes
    directly, regardless of your system.
    )r�r�r��_str�_hash�_pparts�_cached_cpartscGs$|tkrtjdkrtnt}|�|�S)z�Construct a PurePath from one or several strings and or existing
        PurePath objects.  The strings and path objects are combined so as
        to yield a canonicalized path, which is incorporated into the
        new PurePath object.
        r)rror�rr�_from_parts)r��argsr!r!r"�__new__�szPurePath.__new__cCs|jt|j�fSr*)�	__class__�tupler�r-r!r!r"�
__reduce__�szPurePath.__reduce__cCsdg}|D]N}t|t�r"||j7}qt�|�}t|t�rF|�t|��qtdt|���q|j	�
|�S)NzNargument should be a str object or an os.PathLike object returning str, not %r)�
isinstancerr�ro�fspathrnr7�	TypeErrorr��_flavourrA)r�r�r;r�r!r!r"�_parse_args�s


��zPurePath._parse_argsTcCs<t�|�}|�|�\}}}||_||_||_|r8|��|Sr*)�objectr�rr�r�r��_init)r�r��initr.r<r=r;r!r!r"r��s
zPurePath._from_partscCs,t�|�}||_||_||_|r(|��|Sr*)rr�r�r�r�r)r�r<r=r;r	r.r!r!r"r��s
zPurePath._from_parsed_partscCs4|s|r$|||j�|dd��S|j�|�SdSry)rr,)r�r<r=r;r!r!r"�_format_parsed_parts�szPurePath._format_parsed_partscCsdSr*r!r-r!r!r"r�szPurePath._initcCs@|�|�\}}}|j�|j|j|j|||�\}}}|�|||�Sr*)rrrDr�r�r�r�)r.r�r<r=r;r!r!r"�_make_child�s�
zPurePath._make_childcCsBz|jWStk
r<|�|j|j|j�p.d|_|jYSXdS)z[Return the string representation of the path, suitable for
        passing to system calls.r1N)r��AttributeErrorr
r�r�r�r-r!r!r"�__str__�s��zPurePath.__str__cCst|�Sr*)rnr-r!r!r"�
__fspath__�szPurePath.__fspath__cCs|j}t|��|jd�S)zNReturn the string representation of the path with forward (/)
        slashes.rK)rrnr4r+�r.�fr!r!r"r�szPurePath.as_posixcCs
t�|�S)zaReturn the bytes representation of the path.  This is only
        recommended to use under Unix.)ro�fsencoder-r!r!r"�	__bytes__�szPurePath.__bytes__cCsd�|jj|���S)Nz{}({!r}))r�r�rErr-r!r!r"r��szPurePath.__repr__cCs|��std��|j�|�S)z Return the path as a 'file' URI.z.relative path can't be expressed as a file URI)r�r�rr�r-r!r!r"�as_uri�szPurePath.as_uricCs8z|jWStk
r2|j�|j�|_|jYSXdSr*)r�rrrdr�r-r!r!r"�_cparts�s
zPurePath._cpartscCs&t|t�stS|j|jko$|j|jkSr*)rr�NotImplementedrr�r.�otherr!r!r"�__eq__�s
zPurePath.__eq__cCs8z|jWStk
r2tt|j��|_|jYSXdSr*)r�r�hashrrr-r!r!r"�__hash__�s
zPurePath.__hash__cCs&t|t�r|j|jk	rtS|j|jkSr*�rrrrrrr!r!r"�__lt__szPurePath.__lt__cCs&t|t�r|j|jk	rtS|j|jkSr*rrr!r!r"�__le__	szPurePath.__le__cCs&t|t�r|j|jk	rtS|j|jkSr*rrr!r!r"�__gt__szPurePath.__gt__cCs&t|t�r|j|jk	rtS|j|jkSr*rrr!r!r"�__ge__szPurePath.__ge__r�z.The drive prefix (letter or UNC path), if any.)�docr�zThe root of the path, if any.cCs|j|j}|S)z/The concatenation of the drive and root, or ''.)r�r�)r.�anchorr!r!r"r!szPurePath.anchorcCs.|j}t|�|js|jrdndkr&dS|dS)z!The final path component, if any.rBrr0rR)r�rVr�r�rcr!r!r"r�$sz
PurePath.namecCsD|j}|�d�}d|kr,t|�dkr<nn||d�SdSdS)z{
        The final component's last suffix, if any.

        This includes the leading period. For example: '.txt'
        r1rrBNr0�r��rfindrV�r.r�rNr!r!r"�suffix,s

 zPurePath.suffixcCs:|j}|�d�rgS|�d�}dd�|�d�dd�D�S)z�
        A list of the final component's suffixes, if any.

        These include the leading periods. For example: ['.tar', '.gz']
        r1cSsg|]}d|�qS)r1r!)rMr%r!r!r"rbEsz%PurePath.suffixes.<locals>.<listcomp>rBN)r�r�rXr6�r.r�r!r!r"�suffixes:s


zPurePath.suffixescCsD|j}|�d�}d|kr,t|�dkr<nn|d|�S|SdS)z0The final path component, minus its last suffix.r1rrBNr"r$r!r!r"�stemGs

 z
PurePath.stemcCs�|jstd|f��|j�|f�\}}}|rX|d|jj|jjfksX|sX|sXt|�dkrdtd|��|�|j|j	|j
dd�|g�S)z-Return a new path with the file name changed.�%r has an empty namerRrBzInvalid name %rN)r�r�rrAr+r2rVr�r�r�r�)r.r�r<r=r;r!r!r"�	with_nameQs��
��zPurePath.with_namecCs�|j}|j|ks |jr.|j|kr.td|f��|r<|�d�rD|dkrPtd|��|j}|shtd|f��|j}|s|||}n|dt|��|}|�|j	|j
|jdd�|g�S)z�Return a new path with the file suffix changed.  If the path
        has no suffix, add given suffix.  If the given suffix is an empty
        string, remove the suffix from the path.
        zInvalid suffix %rr1r)NrR)rr+r2r�rxr�r%rVr�r�r�r�)r.r%rr�Z
old_suffixr!r!r"�with_suffix\s
�zPurePath.with_suffixc
Gs�|std��|j}|j}|j}|r8||g|dd�}n|}|�|�\}}}|rf||g|dd�}	n|}	t|	�}
|jj}|
dkr�|s�|r�n||d|
��||	�kr�|�|||�}t	d�
t|�t|����|�d|
dkr�|nd||
d��S)z�Return the relative path to another path identified by the passed
        arguments.  If the operation is not possible (because this is not
        a subpath of the other path), raise ValueError.
        zneed at least one argumentrBNrz{!r} does not start with {!r}r0)
rr�r�r�rrVrrdr
r�r�rnr�)
r.rr;r<r=Z	abs_partsZto_drvZto_rootZto_partsZto_abs_parts�n�cfZ	formattedr!r!r"�relative_toqs.	*�
�zPurePath.relative_tocCs4z|jWStk
r.t|j�|_|jYSXdS)zZAn object providing sequence-like access to the
        components in the filesystem path.N)r�rrr�r-r!r!r"r;�s
zPurePath.partscGs
|�|�S)z�Combine this path with one or several arguments, and return a
        new path representing either a subpath (if all arguments are relative
        paths) or a totally different path (if one of the arguments is
        anchored).
        )r)r.r�r!r!r"�joinpath�szPurePath.joinpathcCs,z|�|f�WStk
r&tYSXdSr*)rrr�r.�keyr!r!r"�__truediv__�szPurePath.__truediv__cCs2z|�|g|j�WStk
r,tYSXdSr*)r�r�rrr0r!r!r"�__rtruediv__�szPurePath.__rtruediv__cCs@|j}|j}|j}t|�dkr*|s&|r*|S|�|||dd��S)zThe logical parent of the path.rBNrR)r�r�r�rVr�)r.r<r=r;r!r!r"�parent�szPurePath.parentcCst|�S)z*A sequence of this path's logical parents.)r�r-r!r!r"�parents�szPurePath.parentscCs|js
dS|jjpt|j�S)zSTrue if the path is absolute (has both a root and, if applicable,
        a drive).F)r�rr��boolr�r-r!r!r"r��szPurePath.is_absolutecCs|j�|j�S)zaReturn True if the path contains one of the special names reserved
        by the system, if any.)rr}r�r-r!r!r"r}�szPurePath.is_reservedc	Cs�|jj}||�}|j�|f�\}}}|s0td��|rF|||j�krFdS|r\|||j�kr\dS|j}|sj|r�t|�t|�kr~dS|dd�}nt|�t|�kr�dStt	|�t	|��D]\}}t
�||�s�dSq�dS)zE
        Return True if this path matches the given pattern.
        z
empty patternFrBNT)rrCrAr�r�r�rrV�zipr3rgZfnmatchcase)	r.Zpath_patternr-r<r=Z	pat_partsr;r?r'r!r!r"r��s(zPurePath.matchN)T)T)0rErFrGrHr�r�r�classmethodrr�r�r
rrr
rrrr�r�propertyrrrrrrrrr~r=r!r�r%r'r(r*r+r.r;r/r2r3r4r5r�r}r�r!r!r!r"rusv

	


��





	 

	
c@seZdZdZeZdZdS)rz�PurePath subclass for non-Windows systems.

    On a POSIX system, instantiating a PurePath should return this object.
    However, you can also instantiate it directly on any system.
    r!N)rErFrGrH�_posix_flavourrr�r!r!r!r"r�sc@seZdZdZeZdZdS)rz�PurePath subclass for Windows systems.

    On a Windows system, instantiating a PurePath should return this object.
    However, you can also instantiate it directly on any system.
    r!N)rErFrGrH�_windows_flavourrr�r!r!r!r"r�sc@s�eZdZdZdZdd�Zdddd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dedd�Zdfdd�Ze
dd��Ze
dd��Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zdgd%d&�Zd'd(�Zd)d*�Zd+d,�Zdhd/d0�Zd1d2�Zdid3d4�Zd5d6�Zdjd7d8�Zdkd:d;�Zdld<d=�Zd>d?�Z d@dA�Z!dmdBdC�Z"dDdE�Z#dFdG�Z$dHdI�Z%dJdK�Z&dndLdM�Z'dNdO�Z(dPdQ�Z)dRdS�Z*dTdU�Z+dVdW�Z,dXdY�Z-dZd[�Z.d\d]�Z/d^d_�Z0d`da�Z1dbdc�Z2dS)ora�PurePath subclass that can make system calls.

    Path represents a filesystem path but unlike PurePath, also offers
    methods to do system calls on path objects. Depending on your system,
    instantiating a Path will return either a PosixPath or a WindowsPath
    object. You can also instantiate a PosixPath or WindowsPath directly,
    but cannot instantiate a WindowsPath on a POSIX system or vice versa.
    )r��_closedcOsL|tkrtjdkrtnt}|j|dd�}|jjs@td|j	f��|�
�|S)NrF�r	z$cannot instantiate %r on your system)rror�rrr�rr�r�rEr)r�r��kwargsr.r!r!r"r�s�zPath.__new__NcCs"d|_|dk	r|j|_nt|_dSr�)r<r��_normal_accessor)r.�templater!r!r"rs
z
Path._initcCs|j|g}|�|j|j|�Sr*)r�r�r�r�)r.r?r;r!r!r"r�#szPath._make_child_relpathcCs|jr|��|Sr*)r<�
_raise_closedr-r!r!r"�	__enter__)szPath.__enter__cCs
d|_dS)NT)r<)r.�t�v�tbr!r!r"�__exit__.sz
Path.__exit__cCstd��dS)NzI/O operation on closed path)r�r-r!r!r"rA1szPath._raise_closed�cCs|j�|||�Sr*)r�r�)r.r��flagsr�r!r!r"�_opener4szPath._opener�cCs|jr|��|j�|||�S)zm
        Open the file pointed by this path and return a file descriptor,
        as os.open() does.
        )r<rAr�r�)r.rHr�r!r!r"�	_raw_open8szPath._raw_opencCs|t���S)zjReturn a new path pointing to the current working directory
        (as returned by os.getcwd()).
        )rorp�r�r!r!r"�cwdCszPath.cwdcCs||�j�d��S)zrReturn a new path pointing to the user's home directory (as
        returned by os.path.expanduser('~')).
        N)rr�rLr!r!r"�homeJsz	Path.homecCsB|��}z|��}Wntk
r2t�|�}YnXtj�||�S)zoReturn whether other_path is the same or not as this file
        (as returned by os.path.samefile()).
        )r�rrors�samestat)r.Z
other_path�stZother_str!r!r"�samefileQsz
Path.samefileccsH|jr|��|j�|�D](}|dkr(q|�|�V|jr|��qdS)zyIterate over the files in this directory.  Does not yield any
        result for the special paths '.' and '..'.
        >r1r�N)r<rAr�r�r�r&r!r!r"�iterdir\szPath.iterdirccs`|std�|���|j�|f�\}}}|s.|r6td��tt|�|j�}|�|�D]
}|VqPdS)z�Iterate over this subtree and yield all existing files (of any
        kind, including directories) matching the given relative pattern.
        zUnacceptable pattern: {!r}�%Non-relative patterns are unsupportedN)r�r�rrAr�r�rr��r.rlr<r=r�Zselectorrar!r!r"�globjsz	Path.globccsR|j�|f�\}}}|s|r$td��tdt|�|j�}|�|�D]
}|VqBdS)z�Recursively yield all existing files (of any kind, including
        directories) matching the given relative pattern, anywhere in
        this subtree.
        rS)r�N)rrAr�r�rr�rTr!r!r"�rglobwsz
Path.rglobcCsD|jr|��|��r|S|jt��g|jdd�}|j|d�|S)aReturn an absolute version of this path.  This function works
        even if the path doesn't point to anything.

        No normalization is done, i.e. all '.' and '..' will be kept along.
        Use resolve() to get the canonical path to a file.
        Fr=�r@)r<rAr�r�rorpr�r)r.�objr!r!r"�absolute�sz
Path.absoluteFcCsh|jr|��|jj||d�}|dkr:|��t|���}|jj�|�}|j	|fdd�}|j
|d�|S)z�
        Make the path absolute, resolving all symlinks on the way and also
        normalizing it (for example turning slashes into backslashes under
        Windows).
        )rtNFr=rW)r<rArrvr�rnrYr��normpathr�r)r.rtr`ZnormedrXr!r!r"rv�szPath.resolvecCs|j�|�S)zh
        Return the result of the stat() system call on this path, like
        os.stat() does.
        )r�r�r-r!r!r"r��sz	Path.statcCsddl}|�|��j�jS)z:
        Return the login name of the file owner.
        rN)r�r�r��st_uidZpw_name)r.r�r!r!r"�owner�sz
Path.ownercCsddl}|�|��j�jS)z8
        Return the group name of the file gid.
        rN)�grpZgetgrgidr��st_gidZgr_name)r.r]r!r!r"�group�sz
Path.group�rrRc	Cs(|jr|��tj|||||||jd�S)z|
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        )Zopener)r<rA�ior�rI)r.r��	buffering�encoding�errors�newliner!r!r"r��s
�z	Path.openc
Cs,|jdd��}|��W5QR�SQRXdS)zK
        Open the file in bytes mode, read it, and close the file.
        �rb�r�N�r��readrr!r!r"�
read_bytes�szPath.read_bytesc
Cs0|jd||d��}|��W5QR�SQRXdS)zJ
        Open the file in text mode, read it, and close the file.
        r`�r�rcrdNrh)r.rcrdrr!r!r"�	read_text�szPath.read_textc
Cs6t|�}|jdd��}|�|�W5QR�SQRXdS)zO
        Open the file in bytes mode, write to it, and close the file.
        �wbrgN)�
memoryviewr��write)r.�dataZviewrr!r!r"�write_bytes�szPath.write_bytesc
CsLt|t�std|jj��|jd||d��}|�|�W5QR�SQRXdS)zN
        Open the file in text mode, write to it, and close the file.
        zdata must be str, not %s�wrkN)rrnrr�rEr�ro)r.rprcrdrr!r!r"�
write_text�s
�zPath.write_textTcCsr|jr|��|r>z|j�|d�Wntk
r8YnXdStjtjB}|sX|tjO}|�	||�}t�
|�dS)zS
        Create this file with the given access mode, if it doesn't exist.
        N)r<rAr�r�r�ro�O_CREAT�O_WRONLY�O_EXCLrK�close)r.r��exist_okrH�fdr!r!r"�touch�s
z
Path.touchcCs�|jr|��z|j�||�Wndtk
rd|r>|j|kr@�|jjddd�|j|d|d�Yn"tk
r�|r~|��s��YnXdS)z<
        Create a new directory at this given path.
        T)r5rxFN)r<rAr�r�rrr4r�r�)r.r�r5rxr!r!r"r�sz
Path.mkdircCs |jr|��|j�||�dS)zF
        Change the permissions of the path, like os.chmod().
        N)r<rAr�r��r.r�r!r!r"r�sz
Path.chmodcCs |jr|��|j�||�dS)z�
        Like chmod(), except if the path points to a symlink, the symlink's
        permissions are changed, rather than its target's.
        N)r<rAr�r�r{r!r!r"r�szPath.lchmodcCs>|jr|��z|j�|�Wntk
r8|s4�YnXdS)zd
        Remove this file or link.
        If the path is a directory, use rmdir() instead.
        N)r<rAr�r�rr)r.Z
missing_okr!r!r"r�%szPath.unlinkcCs|jr|��|j�|�dS)zF
        Remove this directory.  The directory must be empty.
        N)r<rAr�r�r-r!r!r"r�2sz
Path.rmdircCs|jr|��|j�|�S)z�
        Like stat(), except if the path points to a symlink, the symlink's
        status information is returned, rather than its target's.
        )r<rAr�r�r-r!r!r"r�:sz
Path.lstatcCs&|jr|��|j�||�|�|�S)a2
        Rename this path to the target path.

        The target path may be absolute or relative. Relative paths are
        interpreted relative to the current working directory, *not* the
        directory of the Path object.

        Returns the new Path instance pointing to the target path.
        )r<rAr�r�r�r�r!r!r"r�Cs
zPath.renamecCs&|jr|��|j�||�|�|�S)aS
        Rename this path to the target path, overwriting if that path exists.

        The target path may be absolute or relative. Relative paths are
        interpreted relative to the current working directory, *not* the
        directory of the Path object.

        Returns the new Path instance pointing to the target path.
        )r<rAr�r4r�r�r!r!r"r4Rs
zPath.replacecCs"|jr|��|j�|||�dS)z�
        Make this path a symlink pointing to the target path.
        Note the order of arguments (link, target) is the reverse of os.symlink.
        N)r<rAr�r�)r.r�r�r!r!r"�
symlink_toaszPath.symlink_tocCs |jr|��|j�||�dS)aQ
        Make the target path a hard link pointing to this path.

        Note this function does not make this path a hard link to *target*,
        despite the implication of the function and argument names. The order
        of arguments (target, link) is the reverse of Path.symlink_to, but
        matches that of os.link.

        N)r<rAr�r�r�r!r!r"r�js
zPath.link_toc
CsXz|��WnFtk
r>}zt|�s(�WY�dSd}~XYntk
rRYdSXdS)z+
        Whether this path exists.
        FNT)r�r�r#r��r.r�r!r!r"r�zszPath.existsc
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdS)z3
        Whether this path is a directory.
        FN)r	r��st_moder�r#r�r}r!r!r"r��szPath.is_dirc
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdS)zq
        Whether this path is a regular file (also True for symlinks pointing
        to regular files).
        FN)rr�r~r�r#r�r}r!r!r"�is_file�szPath.is_filecCsv|��r|��sdSt|j�}z|��j}Wntk
rBYdSX|��j}||krZdS|��j}|��j}||kS)z;
        Check if this path is a POSIX mount point
        FT)r�r�rr4r��st_devr��st_ino)r.r4Z
parent_devZdevZinoZ
parent_inor!r!r"�is_mount�s



z
Path.is_mountc
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdS)z7
        Whether this path is a symbolic link.
        FN)r
r�r~r�r#r�r}r!r!r"r��szPath.is_symlinkc
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdS)z6
        Whether this path is a block device.
        FN)r
r�r~r�r#r�r}r!r!r"�is_block_device�szPath.is_block_devicec
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdS)z:
        Whether this path is a character device.
        FN)rr�r~r�r#r�r}r!r!r"�is_char_device�szPath.is_char_devicec
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdS)z.
        Whether this path is a FIFO.
        FN)rr�r~r�r#r�r}r!r!r"�is_fifo�szPath.is_fifoc
Cs\zt|��j�WStk
rB}zt|�s,�WY�dSd}~XYntk
rVYdSXdS)z0
        Whether this path is a socket.
        FN)rr�r~r�r#r�r}r!r!r"�	is_socket�szPath.is_socketcCs`|js\|js\|jr\|jddd�dkr\|j�|jddd��}|�|g|jdd��S|S)zl Return a new path with expanded ~ and ~user constructs
        (as returned by os.path.expanduser)
        rNrB�~)r�r�r�rr�r�)r.Zhomedirr!r!r"�
expandusers��zPath.expanduser)N)rG)rJ)F)r`rRNNN)NN)NN)rGT)rJFF)F)F)3rErFrGrHr�r�rr�rBrFrArIrKr8rMrNrQrRrUrVrYrvr�r\r_r�rjrlrqrsrzr�r�r�r�r�r�r�r4r|r�r�r�rr�r�r�r�r�r�r�r!r!r!r"rsj�







�

	



	

	
	c@seZdZdZdZdS)rzsPath subclass for non-Windows systems.

    On a POSIX system, instantiating a Path should return this object.
    r!N)rErFrGrHr�r!r!r!r"rsc@s,eZdZdZdZdd�Zdd�Zdd�Zd	S)
rzqPath subclass for Windows systems.

    On a Windows system, instantiating a Path should return this object.
    r!cCstd��dS)Nz*Path.owner() is unsupported on this systemr�r-r!r!r"r\(szWindowsPath.ownercCstd��dS)Nz*Path.group() is unsupported on this systemr�r-r!r!r"r_+szWindowsPath.groupcCstd��dS)Nz-Path.is_mount() is unsupported on this systemr�r-r!r!r"r�.szWindowsPath.is_mountN)rErFrGrHr�r\r_r�r!r!r!r"r!s
)Arg�	functoolsrar�ror�rer8�_collections_abcrrrrrrr�operatorrr�r	r
rrr
rrZurllib.parserr�r�r�rZgetwindowsversionr�__all__rr r#r(rr)rIr�r;r:r�r�r?r�r�r�r�r�r�r�r�r�r�PathLike�registerrrrrrr!r!r!r"�<module>s|$
�
?&i8
,t

__pycache__/posixpath.cpython-38.pyc000064400000024276151153537600013444 0ustar00U

e5d=�&@s^dZdZdZdZdZdZdZdZdZddl	Z	ddl
Z
ddlZddlZdd	lTd
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/g&Z
d0d1�Zd2d
�Zd3d�Zd4d�Zd5d�Zd6d�Zejje_d7d
�Zd8d�Zd9d�Zd:d�Zd;d�Zd<d�Zd=d�Zdadad>d�Zd?d�Zd@d �Z dAd,�Z!dBdC�Z"e
j#dDkZ$dGdEd.�Z%dFd/�Z&dS)Ha�Common operations on Posix pathnames.

Instead of importing this module directly, import os and refer to
this module as os.path.  The "os.path" name is an alias for this
module on Posix systems; on other systems (e.g. Windows),
os.path provides the same operations in a manner specific to that
platform, and is an alias to another module (e.g. ntpath).

Some of this can actually be useful on non-Posix systems too, e.g.
for manipulation of the pathname component of URLs.
�.�..�/�:z
/bin:/usr/binNz	/dev/null�)�*�normcase�isabs�join�
splitdrive�split�splitext�basename�dirname�commonprefix�getsize�getmtime�getatime�getctime�islink�exists�lexists�isdir�isfile�ismount�
expanduser�
expandvars�normpath�abspath�samefile�sameopenfile�samestat�curdir�pardir�sep�pathsep�defpath�altsep�extsep�devnull�realpath�supports_unicode_filenames�relpath�
commonpathcCst|t�rdSdSdS)N�/r)�
isinstance�bytes��path�r2�!/usr/lib64/python3.8/posixpath.py�_get_sep)s
r4cCs
t�|�S)z6Normalize case of pathname.  Has no effect under Posix��os�fspath)�sr2r2r3r4scCst�|�}t|�}|�|�S)zTest whether a path is absolute)r6r7r4�
startswith)r8r#r2r2r3r<s
c
Gs�t�|�}t|�}|}z^|s,|dd�|ttj|�D]8}|�|�rL|}q8|rZ|�|�rd||7}q8|||7}q8Wn.tttfk
r�t	j
d|f|���YnX|S)z�Join two or more pathname components, inserting '/' as needed.
    If any component is an absolute path, all previous path components
    will be discarded.  An empty last part will result in a path that
    ends with a separator.Nrr	)r6r7r4�mapr9�endswith�	TypeError�AttributeError�BytesWarning�genericpath�_check_arg_types)�a�pr#r1�br2r2r3r	Gs 


cCs`t�|�}t|�}|�|�d}|d|�||d�}}|rX||t|�krX|�|�}||fS)z�Split a pathname.  Returns tuple "(head, tail)" where "tail" is
    everything after the final slash.  Either part may be empty.�N�r6r7r4�rfind�len�rstrip)rBr#�i�head�tailr2r2r3rds

cCs6t�|�}t|t�rd}d}nd}d}t�||d|�S)Nr-�.rr)r6r7r.r/r?�	_splitext)rBr#r'r2r2r3rus

cCst�|�}|dd�|fS)zJSplit a pathname into drive and path. On Posix, drive is always
    empty.Nrr5)rBr2r2r3r
�s
cCs,t�|�}t|�}|�|�d}||d�S)z)Returns the final component of a pathnamerDN)r6r7r4rF)rBr#rIr2r2r3r
�s
cCsNt�|�}t|�}|�|�d}|d|�}|rJ||t|�krJ|�|�}|S)z-Returns the directory component of a pathnamerDNrE)rBr#rIrJr2r2r3r�s

c
Cs8zt�|�}Wntttfk
r*YdSXt�|j�S)z&Test whether a path is a symbolic linkF)r6�lstat�OSError�
ValueErrorr=�stat�S_ISLNK�st_mode)r1�str2r2r3r�s
c	Cs.zt�|�Wnttfk
r(YdSXdS)zCTest whether a path exists.  Returns True for broken symbolic linksFT)r6rNrOrPr0r2r2r3r�s
c	Cs�zt�|�}Wnttfk
r(YdSXt�|j�r:dSt|t�rPt	|d�}n
t	|d�}t
|�}zt�|�}Wnttfk
r�YdSX|j}|j}||kr�dS|j}|j}||kr�dSdS)z$Test whether a path is a mount pointF�..rT)
r6rNrOrPrQrRrSr.r/r	r)�st_dev�st_ino)r1�s1�parent�s2�dev1�dev2�ino1�ino2r2r2r3r�s.

c	Cs<t�|�}t|t�rd}nd}|�|�s,|St|�}|�|d�}|dkrPt|�}|dkr�dtjkr�ddl	}z|�
t���j}Wq�t
k
r�|YSXn
tjd}nVddl	}|d|�}t|t�r�t|d�}z|�|�}Wnt
k
r�|YSX|j}t|t��rt�|�}d}nd	}|�|�}|||d��p:|S)
zOExpand ~ and ~user constructions.  If user or $HOME is unknown,
    do nothing.�~�~rDr�HOMEN�ASCIIr-r)r6r7r.r/r9r4�findrG�environ�pwd�getpwuid�getuid�pw_dir�KeyError�str�getpwnam�fsencoderH)	r1�tilder#rIre�userhome�name�pwent�rootr2r2r3r�sB








cCsZt�|�}t|t�rVd|kr |Sts:ddl}|�d|j�atj}d}d}t	tdd�}n:d|krb|St
s|ddl}|�d	|j�a
t
j}d
}d}tj}d}|||�}|s��qV|�d�\}}|�
d�}	|	�|�r�|	�|�r�|	dd
�}	z.|dk�rt�tjt�|	��}
n||	}
Wntk
�r&|}Yq�X||d�}|d|�|
}t|�}||7}q�|S)zZExpand shell variables of form $var and ${var}.  Unknown variables
    are left unchanged.�$rNs\$(\w+|\{[^}]*\})�{�}�environb�$z\$(\w+|\{[^}]*\})�{�}rD���)r6r7r.r/�	_varprogb�re�compilerb�search�getattr�_varprogrd�span�groupr9r;rl�fsdecoderirG)r1r{r}�start�endrdrI�m�jro�valuerKr2r2r3rsN






c	Cs�t�|�}t|t�r&d}d}d}d}nd}d}d}d}||krB|S|�|�}|rp|�|d	�rp|�|d
�spd	}|�|�}g}|D]J}|||fkr�q�||ks�|s�|r�|r�|d|kr�|�|�q�|r�|��q�|}|�|�}|r�|||}|p�|S)z0Normalize path, eliminating double slashes, etc.r-�rLrUr�rr��ry)	r6r7r.r/r9r�append�popr	)	r1r#�empty�dot�dotdot�initial_slashes�comps�	new_comps�compr2r2r3rNsJ


��
�
�

cCs@t�|�}t|�s8t|t�r&t��}nt��}t||�}t|�S)zReturn an absolute path.)	r6r7rr.r/�getcwdb�getcwdr	r)r1�cwdr2r2r3rts



cCs*t�|�}t|dd�|i�\}}t|�S)zlReturn the canonical path of the specified filename, eliminating any
symbolic links encountered in the path.Nr)r6r7�
_joinrealpathr)�filenamer1�okr2r2r3r)�s
c
Cst|t�rd}d}d}nd}d}d}t|�r<|dd�}|}|�r|�|�\}}}|r<||kr`q<||kr�|r�t|�\}}||kr�t|||�}q<|}q<t||�}t|�s�|}q<||kr�||}|dk	r�q<t||�dfSd||<t|t�	|�|�\}}	|	�st||�dfS|||<q<|d	fS)
Nr-rLrUrrrrDFT)
r.r/r�	partitionrr	rr�r6�readlink)
r1�rest�seenr#r!r"ro�_�newpathr�r2r2r3r��sH


r��darwinc	Cs�|std��t�|�}t|t�r.d}d}d}nd}d}d}|dkrH|}n
t�|�}zrd	d
�t|��|�D�}dd
�t|��|�D�}tt||g��}|gt|�|||d�}|s�|WSt	|�WSt
ttt
fk
r�t�d||��YnXdS)
z#Return a relative version of a pathzno path specifiedrLr-rUrrrNcSsg|]}|r|�qSr2r2��.0�xr2r2r3�
<listcomp>�szrelpath.<locals>.<listcomp>cSsg|]}|r|�qSr2r2r�r2r2r3r��sr+)rPr6r7r.r/rrrGrr	r<r=r>�DeprecationWarningr?r@)	r1r�r!r#r"�
start_list�	path_listrI�rel_listr2r2r3r+�s0



c		s2|std��tttj|��}t|dt�r4d�d�nd�d�zƇfdd�|D�}zt�fd	d
�|D��\}Wntk
r�td�d�YnX�fd
d�|D�}t|�}t	|�}|}t
|�D]$\}}|||kr�|d|�}q�q�|r�n
�dd�}|��|�WStt
fk
�r,tjd|���YnXdS)zDGiven a sequence of path names, returns the longest common sub-path.z%commonpath() arg is an empty sequencerr-rLrrcsg|]}|����qSr2)r)r�r1�r#r2r3r��szcommonpath.<locals>.<listcomp>c3s|]}|dd��kVqdS)NrDr2)r�rBr�r2r3�	<genexpr>�szcommonpath.<locals>.<genexpr>z%Can't mix absolute and relative pathsNcsg|]}�fdd�|D��qS)csg|]}|r|�kr|�qSr2r2)r��c�r!r2r3r�sz)commonpath.<locals>.<listcomp>.<listcomp>r2)r�r8r�r2r3r�sr,)r,)rP�tupler:r6r7r.r/�set�min�max�	enumerater	r<r=r?r@)	�paths�split_pathsrrXrZ�commonrIr��prefixr2)r!r#r3r,�s6)N)'�__doc__r!r"r'r#r$r%r&r(r6�sysrQr?�__all__r4rrr	rrrMr
r
rrrrrrrzrrrr)r��platformr*r+r,r2r2r2r3�<module>s��
	
	

*25&	3

)__pycache__/poplib.cpython-38.opt-1.pyc000064400000032225151153537600013642 0ustar00U

e5d�:�@sldZddlZddlZddlZddlZzddlZdZWnek
rLdZYnXddgZGdd�de	�Z
dZd	Zd
Z
dZe
eZdZGd
d�d�Zer�Gdd�de�Ze�d�edk�rhddlZeejd�Zee���e�ejd�e�ejd�e��e��\ZZeded�D]BZ e�!e �\Z"Z#Z$ede �e#D]Z%ede%��q@ed��qe�&�dS)z@A POP3 client class.

Based on the J. Myers POP3 draft, Jan. 96
�NTF�POP3�error_protoc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/poplib.pyrs�ni��
�
ic@seZdZdZdZeejfdd�Zdd�Z	dd�Z
d	d
�Zdd�Zd
d�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd=d d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Ze�d0�Z d1d2�Z!d3d4�Z"d>d5d6�Z#d7d8�Z$d9d:�Z%d?d;d<�Z&dS)@raPThis class supports both the minimal and optional command sets.
    Arguments can be strings or integers (where appropriate)
    (e.g.: retr(1) and retr('1') both work equally well.

    Minimal Command Set:
            USER name               user(name)
            PASS string             pass_(string)
            STAT                    stat()
            LIST [msg]              list(msg = None)
            RETR msg                retr(msg)
            DELE msg                dele(msg)
            NOOP                    noop()
            RSET                    rset()
            QUIT                    quit()

    Optional Commands (some servers support these):
            RPOP name               rpop(name)
            APOP name digest        apop(name, digest)
            TOP msg n               top(msg, n)
            UIDL [msg]              uidl(msg = None)
            CAPA                    capa()
            STLS                    stls()
            UTF8                    utf8()

    Raises one exception: 'error_proto'.

    Instantiate with:
            POP3(hostname, port=110)

    NB:     the POP protocol locks the mailbox from user
            authorization until QUIT, so be sure to get in, suck
            the messages, and quit, each time you access the
            mailbox.

            POP is a line-based protocol, which means large mail
            messages consume lots of python cycles reading them
            line-by-line.

            If it's available on your mail server, use IMAP4
            instead, it doesn't suffer from the two problems
            above.
    zUTF-8cCsP||_||_d|_t�d|||�|�|�|_|j�d�|_d|_	|�
�|_dS)NFzpoplib.connect�rbr)�host�port�_tls_established�sys�audit�_create_socket�sock�makefile�file�
_debugging�_getresp�welcome)�selfr
r�timeoutrrr�__init__bsz
POP3.__init__cCst�|j|jf|�S�N)�socketZcreate_connectionr
r)rrrrrrmszPOP3._create_socketcCs:|jdkrtdt|��t�d||�|j�|t�dS)N�z*put*zpoplib.putline)r�print�reprrrrZsendall�CRLF�r�linerrr�_putlineps
z
POP3._putlinecCs.|jrtdt|��t||j�}|�|�dS)Nz*cmd*)rrr �bytes�encodingr$r"rrr�_putcmdxszPOP3._putcmdcCs�|j�td�}t|�tkr$td��|jdkr<tdt|��|sHtd��t|�}|dd�tkrp|dd�|fS|dd�t	kr�|dd�|fS|dd�|fS)Nrz
line too longz*get*z-ERR EOF������)
r�readline�_MAXLINE�lenrrrr r!�CR)rr#�octetsrrr�_getline�s
z
POP3._getlinecCs:|��\}}|jdkr$tdt|��|�d�s6t|��|S)Nrz*resp*�+)r/rrr �
startswithr)r�resp�orrrr�s

z
POP3._getrespcCsl|��}g}d}|��\}}|dkrb|�d�rB|d}|dd�}||}|�|�|��\}}q|||fS)Nr�.s..r)rr/r1�append)rr2�listr.r#r3rrr�_getlongresp�s

zPOP3._getlongrespcCs|�|�|��Sr)r'rr"rrr�	_shortcmd�s
zPOP3._shortcmdcCs|�|�|��Sr)r'r7r"rrr�_longcmd�s
z
POP3._longcmdcCs|jSr)r�rrrr�
getwelcome�szPOP3.getwelcomecCs
||_dSr)r)r�levelrrr�set_debuglevel�szPOP3.set_debuglevelcCs|�d|�S)zVSend user name, return response

        (should indicate password required).
        zUSER %s�r8�r�userrrrr@�sz	POP3.usercCs|�d|�S)z�Send password, return response

        (response includes message count, mailbox size).

        NB: mailbox is locked by server from here to 'quit()'
        zPASS %sr>)rZpswdrrr�pass_�sz
POP3.pass_cCsF|�d�}|��}|jr&tdt|��t|d�}t|d�}||fS)z]Get mailbox status.

        Result is tuple of 2 ints (message count, mailbox size)
        ZSTATz*stat*r�)r8�splitrrr �int)rZretvalZretsZnumMessagesZsizeMessagesrrr�stat�s
z	POP3.statNcCs |dk	r|�d|�S|�d�S)aRequest listing, return result.

        Result without a message number argument is in form
        ['response', ['mesg_num octets', ...], octets].

        Result when a message number argument is given is a
        single response: the "scan listing" for that message.
        NzLIST %sZLIST�r8r9�r�whichrrrr6�s	z	POP3.listcCs|�d|�S)zoRetrieve whole message number 'which'.

        Result is in form ['response', ['line', ...], octets].
        zRETR %s�r9rGrrr�retr�sz	POP3.retrcCs|�d|�S)zFDelete message number 'which'.

        Result is 'response'.
        zDELE %sr>rGrrr�dele�sz	POP3.delecCs
|�d�S)zXDoes nothing.

        One supposes the response indicates the server is alive.
        ZNOOPr>r:rrr�noopsz	POP3.noopcCs
|�d�S)z(Unmark all messages marked for deletion.ZRSETr>r:rrr�rsetsz	POP3.rsetcCs|�d�}|��|S)zDSignoff: commit changes on server, unlock mailbox, close connection.ZQUIT)r8�close)rr2rrr�quits
z	POP3.quitcCs�z |j	}d|_	|dk	r|��W5|j}d|_|dk	r�zVz|�tj�Wn@tk
r�}z"|jtjkrxt|dd�dkrx�W5d}~XYnXW5|��XXdS)z8Close the connection without assuming anything about it.NZwinerrorri&')
rrNZshutdownrZ	SHUT_RDWR�OSError�errnoZENOTCONN�getattrr)rr�excrrrrrNs �z
POP3.closecCs|�d|�S)zNot sure what this does.zRPOP %sr>r?rrr�rpop5sz	POP3.rpops\+OK.[^<]*(<.*>)cCs\t||j�}|j�|j�}|s&td��ddl}|�d�|}|�|��	�}|�
d||f�S)aAuthorisation

        - only possible if server has supplied a timestamp in initial greeting.

        Args:
                user     - mailbox user;
                password - mailbox password.

        NB: mailbox is locked by server from here to 'quit()'
        z!-ERR APOP not supported by serverrNrz
APOP %s %s)r%r&�	timestamp�matchrr�hashlib�groupZmd5Z	hexdigestr8)rr@ZpasswordZsecret�mrWZdigestrrr�apop<sz	POP3.apopcCs|�d||f�S)z�Retrieve message header of message number 'which'
        and first 'howmuch' lines of message body.

        Result is in form ['response', ['line', ...], octets].
        z	TOP %s %srI)rrHZhowmuchrrr�topQszPOP3.topcCs |dk	r|�d|�S|�d�S)z�Return message digest (unique id) list.

        If 'which', result contains unique id for that message
        in the form 'response mesgnum uid', otherwise result is
        the list ['response', ['mesgnum uid', ...], octets]
        NzUIDL %sZUIDLrFrGrrr�uidlZsz	POP3.uidlcCs
|�d�S)zITry to enter UTF-8 mode (see RFC 6856). Returns server response.
        ZUTF8r>r:rrr�utf8fsz	POP3.utf8c	
Cspdd�}i}z4|�d�}|d}|D]}||�\}}|||<q$Wn*tk
rj}ztd��W5d}~XYnX|S)aReturn server capabilities (RFC 2449) as a dictionary
        >>> c=poplib.POP3('localhost')
        >>> c.capa()
        {'IMPLEMENTATION': ['Cyrus', 'POP3', 'server', 'v2.2.12'],
         'TOP': [], 'LOGIN-DELAY': ['0'], 'AUTH-RESP-CODE': [],
         'EXPIRE': ['NEVER'], 'USER': [], 'STLS': [], 'PIPELINING': [],
         'UIDL': [], 'RESP-CODES': []}
        >>>

        Really, according to RFC 2449, the cyrus folks should avoid
        having the implementation split into multiple arguments...
        cSs"|�d���}|d|dd�fS)N�asciirr)�decoderC)r#Zlstrrr�	_parsecapyszPOP3.capa.<locals>._parsecapZCAPArz!-ERR CAPA not supported by serverN)r9r)	rr`�capsr2ZrawcapsZcaplineZcapnmZcapargsZ_errrrr�capals

z	POP3.capacCsxtstd��|jrtd��|��}d|kr2td��|dkrBt��}|�d�}|j|j|j	d�|_|j�
d�|_d|_|S)	z{Start a TLS session on the active connection as specified in RFC 2595.

                context - a ssl.SSLContext
        z-ERR TLS support missing�$-ERR TLS session already establishedZSTLSz!-ERR STLS not supported by serverN�Zserver_hostnamerT)�HAVE_SSLrrrb�ssl�_create_stdlib_contextr8�wrap_socketrr
rr)r�contextrar2rrr�stls�s 
�z	POP3.stls)N)N)N)'rrr�__doc__r&�	POP3_PORTr�_GLOBAL_DEFAULT_TIMEOUTrrr$r'r/rr7r8r9r;r=r@rArEr6rJrKrLrMrOrNrT�re�compilerUrZr[r\r]rbrjrrrrr3sB+�





	
c@s8eZdZdZeddejdfdd�Zdd�Zd	dd�Z	dS)
�POP3_SSLaPOP3 client class over SSL connection

        Instantiate with: POP3_SSL(hostname, port=995, keyfile=None, certfile=None,
                                   context=None)

               hostname - the hostname of the pop3 over ssl server
               port - port number
               keyfile - PEM formatted file that contains your private key
               certfile - PEM formatted certificate chain file
               context - a ssl.SSLContext

        See the methods of the parent class POP3 for more documentation.
        NcCs�|dk	r|dk	rtd��|dk	r0|dk	r0td��|dk	s@|dk	rVddl}|�dtd�||_||_|dkrxtj||d�}||_t	�
||||�dS)Nz4context and keyfile arguments are mutually exclusivez5context and certfile arguments are mutually exclusiverzAkeyfile and certfile are deprecated, use a custom context insteadrB)�certfile�keyfile)�
ValueError�warnings�warn�DeprecationWarningrrrqrfrgrirr)rr
rrrrqrrirtrrrr�s$��zPOP3_SSL.__init__cCs"t�||�}|jj||jd�}|S)Nrd)rrrirhr
)rrrrrrr�s
�zPOP3_SSL._create_socketcCstd��dS)z�The method unconditionally raises an exception since the
            STLS command doesn't make any sense on an already established
            SSL/TLS session.
            rcN)r)rrrrqrirrrrj�sz
POP3_SSL.stls)NNN)
rrrrk�
POP3_SSL_PORTrrmrrrjrrrrrp�s�
rp�__main__rrB�zMessage %d:z   z-----------------------)'rkrQrnrrrfre�ImportError�__all__�	Exceptionrrlrwr-ZLFr!r+rrpr5r�argv�arr;r@rAr6rEZnumMsgsZ	totalSize�range�irJ�header�msgr.r#rOrrrr�<module>sL
n0

__pycache__/ast.cpython-38.opt-1.pyc000064400000040532151153537600013144 0ustar00U

e5d"K�@s�dZddlTd=ddd�dd	�Zd
d�Zd>d
d�Zdd�Zdd�Zd?dd�Zdd�Zdd�Z	d@dd�Z
dd�Zdd�Zdd �d!d"�Z
d#d$�ZGd%d&�d&e�ZGd'd(�d(e�Zd)d*�Zd+d,�Zeee�e_eee�e_Gd-d.�d.e�Zd/d0�ZGd1d2�d2eed3�ZGd4d5�d5eed3�ZGd6d7�d7eed3�ZGd8d9�d9eed3�ZGd:d;�d;eed3�Zee e!e"fee#fee$feed�e%feed<�fiZ&ee%fiZ'e%d9ed�d9e d2e!d2e"d2e#d5e$d7ed<�d;iZ(dS)AaH
    ast
    ~~~

    The `ast` module helps Python applications to process trees of the Python
    abstract syntax grammar.  The abstract syntax itself might change with
    each Python release; this module helps to find out programmatically what
    the current grammar looks like and allows modifications of it.

    An abstract syntax tree can be generated by passing `ast.PyCF_ONLY_AST` as
    a flag to the `compile()` builtin function or by using the `parse()`
    function from this module.  The result will be a tree of objects whose
    classes all inherit from `ast.AST`.

    A modified abstract syntax tree can be compiled into a Python code object
    using the built-in `compile()` function.

    Additionally various helper functions are provided that make working with
    the trees simpler.  The main intention of the helper functions and this
    module in general is to provide an easy to use interface for libraries
    that work tightly with the python syntax (template engines for example).


    :copyright: Copyright 2008 by Armin Ronacher.
    :license: Python License.
�)�*�	<unknown>�execFN)�
type_comments�feature_versioncCsFt}|r|tO}t|t�r(|\}}|}n|dkr4d}t|||||d�S)z�
    Parse the source into an AST node.
    Equivalent to compile(source, filename, mode, PyCF_ONLY_AST).
    Pass type_comments=True to get back type comments where the syntax allows.
    N���)�_feature_version)Z
PyCF_ONLY_ASTZPyCF_TYPE_COMMENTS�
isinstance�tuple�compile)�source�filename�moderr�flags�major�minor�r�/usr/lib64/python3.8/ast.py�parses

�rcs`t|t�rt|dd�}t|t�r&|j}dd���fdd���fdd������fd	d
���|�S)a
    Safely evaluate an expression node or a string containing a Python
    expression.  The string or node provided may only consist of the following
    Python literal structures: strings, bytes, numbers, tuples, lists, dicts,
    sets, booleans, and None.
    �eval)rcSstd|����dS)Nzmalformed node or string: )�
ValueError��noderrr�_raise_malformed_node>sz+literal_eval.<locals>._raise_malformed_nodecs,t|t�rt|j�tttfkr&�|�|jS�N)r	�Constant�type�value�int�float�complexr)rrr�_convert_num@sz"literal_eval.<locals>._convert_numcsDt|t�r<t|jttf�r<�|j�}t|jt�r6|
S|S�|�Sr)r	ZUnaryOp�opZUAddZUSub�operand)rr#)r!rr�_convert_signed_numDs
z)literal_eval.<locals>._convert_signed_numcst|t�r|jSt|t�r*tt�|j��St|t�rDtt�|j��St|t	�r^t
t�|j��St|t�r�t|j
�t|j�kr��|�ttt�|j
�t�|j���St|t��rt|jttf��r�|j�}�|j�}t|ttf��rt|t��rt|jt��r||S||S�|�Sr)r	rrZTupler
�mapZeltsZList�list�Set�setZDict�len�keys�values�dict�zipZBinOpr"ZAddZSub�left�rightrrr )rr.r/��_convertr!r$rrrr1Ls,





�

zliteral_eval.<locals>._convert)r	�strrZ
Expression�body)Znode_or_stringrr0r�literal_eval3s

r4Tcs2���fdd��t|t�s*td|jj���|�S)a�
    Return a formatted dump of the tree in node.  This is mainly useful for
    debugging purposes.  If annotate_fields is true (by default),
    the returned string will show the names and the values for fields.
    If annotate_fields is false, the result string will be more compact by
    omitting unambiguous field names.  Attributes such as line
    numbers and column offsets are not dumped by default.  If this is wanted,
    include_attributes can be set to true.
    c	st|t�r�g}�}|jD]V}zt||�}Wntk
rBd}YqX|r`|�d|�|�f�q|��|��q�r�|jr�|jD]:}z |�d|�t||��f�Wq�tk
r�Yq�Xq�d|jjd�	|�fSt|t
�r�dd�	�fdd�|D��St|�S)NTz%s=%sz%s(%s)z, z[%s]c3s|]}�|�VqdSrr)�.0�x)�_formatrr�	<genexpr>�sz(dump.<locals>._format.<locals>.<genexpr>)r	�AST�_fields�getattr�AttributeError�append�_attributes�	__class__�__name__�joinr&�repr)r�args�keywords�fieldr�a�r7�annotate_fields�include_attributesrrr7ps*




 
zdump.<locals>._formatzexpected AST, got %r)r	r9�	TypeErrorr?r@)rrHrIrrGr�dumpfs

rKcCsVdD]L}||jkr||jkrt||d�}|dk	sDt||�r|�d�rt|||�q|S)z�
    Copy source location (`lineno`, `col_offset`, `end_lineno`, and `end_col_offset`
    attributes) from *old_node* to *new_node* if possible, and return *new_node*.
    )�lineno�
col_offset�
end_lineno�end_col_offsetNZend_)r>r;�hasattr�
startswith�setattr)�new_nodeZold_node�attrrrrr�
copy_location�s��rUcs �fdd���|dddd�|S)a{
    When you compile a node tree with compile(), the compiler expects lineno and
    col_offset attributes for every node that supports them.  This is rather
    tedious to fill in for generated nodes, so this helper adds these attributes
    recursively where not already set, by setting them to the values of the
    parent node.  It works recursively starting at *node*.
    cs�d|jkr"t|d�s||_n|j}d|jkrDt|d�s>||_n|j}d|jkrft|d�s`||_n|j}d|jkr�t|d�s�||_n|j}t|�D]}�|||||�q�dS)NrLrNrMrO)r>rPrLrNrMrO�iter_child_nodes)rrLrMrNrO�child��_fixrrrY�s$







z#fix_missing_locations.<locals>._fix�rrrrrXr�fix_missing_locations�sr[rZcCsVt|�D]H}d|jkr(t|dd�||_d|jkrt|dd�}dk	r|||_q|S)z�
    Increment the line number and end line number of each node in the tree
    starting at *node* by *n*. This is useful to "move code" to a different
    location in a file.
    rLrrNN)�walkr>r;rLrN)r�nrWrNrrr�increment_lineno�s
��r^c	cs:|jD].}z|t||�fVWqtk
r2YqXqdS)zs
    Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields``
    that is present on *node*.
    N)r:r;r<)rrErrr�iter_fields�s

r_ccsLt|�D]>\}}t|t�r"|Vqt|t�r|D]}t|t�r0|Vq0qdS)z�
    Yield all direct child nodes of *node*, that is, all fields that are nodes
    and all items of fields that are lists of nodes.
    N)r_r	r9r&)r�namerE�itemrrrrV�s


rVcCs�t|ttttf�s"td|jj��|jr8t|jdt	�s<dS|jdj
}t|t�rZ|j}n"t|t
�rxt|j
t�rx|j
}ndS|r�ddl}|�|�}|S)aC
    Return the docstring for the given node or None if no docstring can
    be found.  If the node provided does not have docstrings a TypeError
    will be raised.

    If *clean* is `True`, all tabs are expanded to spaces and any whitespace
    that can be uniformly removed from the second line onwards is removed.
    z%r can't have docstringsrN)r	ZAsyncFunctionDefZFunctionDefZClassDefZModulerJr?r@r3ZExprr�Str�srr2�inspectZcleandoc)rZclean�textrdrrr�
get_docstring�s	

rfcCs�d}g}d}|t|�krx||}||7}|d7}|dkr`|t|�kr`||dkr`|d7}|d7}|dkr|�|�d}q|r�|�|�|S)z}Split a string into lines ignoring form feed and other chars.

    This mimics how the Python parser splits source code.
    r�rZ�
�
z
)r)r=)r�idx�linesZ	next_line�crrr�_splitlines_no_ffs  

rmcCs,d}|D]}|dkr||7}q|d7}q|S)z6Replace all chars except '\f\t' in a line with spaces.rgz	� r)r�resultrlrrr�_pad_whitespaces

rp)�paddedcCs�z$|jd}|jd}|j}|j}Wntk
r:YdSXt|�}||krd||��||���S|r�t||��d|����}nd}|||��|d���}	||��d|���}
||d|�}|�	d|	�|�
|
�d�|�S)aBGet source code segment of the *source* that generated *node*.

    If some location information (`lineno`, `end_lineno`, `col_offset`,
    or `end_col_offset`) is missing, return None.

    If *padded* is `True`, the first line of a multi-line statement will
    be padded with spaces to match its original position.
    rZNrgr)rLrNrMrOr<rm�encode�decoderp�insertr=rA)rrrqrLrNrMrOrkZpadding�firstZlastrrr�get_source_segment*s&	



rvccs<ddlm}||g�}|r8|��}|�t|��|VqdS)z�
    Recursively yield all descendant nodes in the tree starting at *node*
    (including *node* itself), in no specified order.  This is useful if you
    only want to modify nodes in place and don't care about the context.
    r)�dequeN)�collectionsrw�popleft�extendrV)rrwZtodorrrr\Ms
r\c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�NodeVisitora<
    A node visitor base class that walks the abstract syntax tree and calls a
    visitor function for every node found.  This function may return a value
    which is forwarded by the `visit` method.

    This class is meant to be subclassed, with the subclass adding visitor
    methods.

    Per default the visitor functions for the nodes are ``'visit_'`` +
    class name of the node.  So a `TryFinally` node visit function would
    be `visit_TryFinally`.  This behavior can be changed by overriding
    the `visit` method.  If no visitor function exists for a node
    (return value `None`) the `generic_visit` visitor is used instead.

    Don't use the `NodeVisitor` if you want to apply changes to nodes during
    traversing.  For this a special visitor exists (`NodeTransformer`) that
    allows modifications.
    cCs"d|jj}t|||j�}||�S)z
Visit a node.�visit_)r?r@r;�
generic_visit)�selfr�method�visitorrrr�visitoszNodeVisitor.visitcCsTt|�D]F\}}t|t�r:|D]}t|t�r|�|�qqt|t�r|�|�qdS)z9Called if no explicit visitor function exists for a node.N)r_r	r&r9r�)r~rrErrarrrr}us


zNodeVisitor.generic_visitc	Cs�|j}t�t|��}|dkr@t��D]\}}t||�r$|}q@q$|dk	r�d|}zt||�}Wntk
rrYn&Xddl}|�	|�d�t
d�||�S|�|�S)Nr|rz" is deprecated; add visit_Constant�)r�_const_node_type_names�getr�itemsr	r;r<�warnings�warn�PendingDeprecationWarningr})	r~rrZ	type_name�clsr`rr�r�rrr�visit_Constants(
�zNodeVisitor.visit_ConstantN)r@�
__module__�__qualname__�__doc__r�r}r�rrrrr{[s
r{c@seZdZdZdd�ZdS)�NodeTransformeraG
    A :class:`NodeVisitor` subclass that walks the abstract syntax tree and
    allows modification of nodes.

    The `NodeTransformer` will walk the AST and use the return value of the
    visitor methods to replace or remove the old node.  If the return value of
    the visitor method is ``None``, the node will be removed from its location,
    otherwise it is replaced with the return value.  The return value may be the
    original node in which case no replacement takes place.

    Here is an example transformer that rewrites all occurrences of name lookups
    (``foo``) to ``data['foo']``::

       class RewriteName(NodeTransformer):

           def visit_Name(self, node):
               return Subscript(
                   value=Name(id='data', ctx=Load()),
                   slice=Index(value=Str(s=node.id)),
                   ctx=node.ctx
               )

    Keep in mind that if the node you're operating on has child nodes you must
    either transform the child nodes yourself or call the :meth:`generic_visit`
    method for the node first.

    For nodes that were part of a collection of statements (that applies to all
    statement nodes), the visitor may also return a list of nodes rather than
    just a single node.

    Usually you use the transformer like this::

       node = YourTransformer().visit(node)
    cCs�t|�D]�\}}t|t�rvg}|D]D}t|t�r\|�|�}|dkrFq"nt|t�s\|�|�q"|�|�q"||dd�<qt|t�r|�|�}|dkr�t||�qt|||�q|Sr)	r_r	r&r9r�rzr=�delattrrR)r~rrE�	old_valueZ
new_valuesrrSrrrr}�s&






zNodeTransformer.generic_visitN)r@r�r�r�r}rrrrr��s#r�cCs|jSr�r)r~rrr�_getter�sr�cCs
||_dSrr�)r~rrrr�_setter�sr�c@seZdZdd�ZdS)�_ABCcCsft|t�sdS|tkrZz
|j}Wntk
r6YdSXt|t|�oXt|t�|d��St�||�S)NFr)	r	r�_const_typesrr<�_const_types_notr�r�__instancecheck__)r��instrrrrr��s

�z_ABC.__instancecheck__N)r@r�r�r�rrrrr��sr�cOsf|D]<}||jkrq|j�|�}|t|�krt|j�d|����q|tkrTt||�Stj|f|�|�S)Nz" got multiple values for argument )r:�indexr)rJr@r�r�__new__)r�rC�kwargs�key�posrrr�_new�s

r�c@seZdZdZeZdS)�Num)r]N�r@r�r�r:r�r�rrrrr��sr�)�	metaclassc@seZdZdZeZdS)rb�rcNr�rrrrrb�srbc@seZdZdZeZdS)�Bytesr�Nr�rrrrr�sr�c@seZdZeZdS)�NameConstantN)r@r�r�r�r�rrrrr�sr�c@seZdZdZdd�ZdS)�EllipsisrcOs(|tkrtd|�|�Stj|f|�|�S)N.).)r�rr�)r�rCr�rrrr�szEllipsis.__new__N)r@r�r�r:r�rrrrr�sr�.)rr)TF)rZ)T))r��_astrr4rKrUr[r^r_rVrfrmrprvr\�objectr{r�r�r��propertyrr]rcrr�r�r�rbr�r�r�rrr r2�bytes�boolr�r�r�rrrr�<module>sz�3
'#

#:>	
���__pycache__/doctest.cpython-38.opt-2.pyc000064400000116753151153537600014034 0ustar00U

e5d_��!@spdZddddddddd	d
ddd
ddddddddddddddddddd d!g!Zd"d#lZd"d#lZd"d#lZd"d#lZd"d#lZd"d#lZd"d#lZd"d#l	Z	d"d#l
Z
d"d#lZd"d$lm
Z
d"d%lmZed&d'�ZiZd(d�Zed�Zed�Zed�Zed�Zed�Zed�ZeeBeBeBeBeBZed	�Zed
�Zed�Zed�Zed�ZeeBeBeBeBZd)Z d*Z!d+d,�Z"drd.d/�Z#d0d1�Z$d2d3�Z%dsd5d6�Z&d7d8�Z'Gd9d:�d:e
�Z(d;d<�Z)d=d>�Z*d?d@�Z+GdAdB�dBej,�Z-dCdD�Z.GdEd�d�Z/GdFd�d�Z0GdGd�d�Z1GdHd�d�Z2GdId�d�Z3GdJd�d�Z4GdKd�de5�Z6GdLd�de5�Z7GdMd�de3�Z8d#a9dtdPd�Z:dNd#d#d#d#dNd"d#dOe1�d#fdQd�Z;dudSd�Z<d"a=dTd�Z>GdUdV�dVej?�Z@GdWdX�dXe@�ZAGdYdZ�dZejB�ZCdvd[d�ZDGd\d]�d]e@�ZEdNd#d#e1�d#fd^d_�ZFd`d�ZGdad�ZHdbd�ZIdwdcd �ZJdxddde�ZKdydfd!�ZLGdgdh�dh�ZMeMdidjdkdldmdn�ZNdodp�ZOePdqk�rle	�QeO��d#S)zzreStructuredText en�register_optionflag�DONT_ACCEPT_TRUE_FOR_1�DONT_ACCEPT_BLANKLINE�NORMALIZE_WHITESPACE�ELLIPSIS�SKIP�IGNORE_EXCEPTION_DETAIL�COMPARISON_FLAGS�REPORT_UDIFF�REPORT_CDIFF�REPORT_NDIFF�REPORT_ONLY_FIRST_FAILURE�REPORTING_FLAGS�	FAIL_FAST�Example�DocTest�
DocTestParser�
DocTestFinder�
DocTestRunner�
OutputChecker�DocTestFailure�UnexpectedException�DebugRunner�testmod�testfile�run_docstring_examples�DocTestSuite�DocFileSuite�set_unittest_reportflags�script_from_examples�
testsource�	debug_src�debug�N)�StringIO)�
namedtuple�TestResultszfailed attemptedcCst�|dtt�>�S)N�)�OPTIONFLAGS_BY_NAME�
setdefault�len��name�r,�/usr/lib64/python3.8/doctest.pyr�sz<BLANKLINE>z...cCs8d}tjD](}|�|d�}|tt|�kr
||jO}q
|S)Nr")�
__future__Zall_feature_names�get�getattrZ
compiler_flag)�globs�flagsZfnameZfeaturer,r,r-�_extract_future_flags�s
r3�cCsVt�|�r|St|t�r,t|t�t�dg�S|dkrJtjt�	|�j
dStd��dS)N�*�__name__z"Expected a module, string, or None)�inspect�ismodule�
isinstance�str�
__import__�globals�locals�sys�modules�	_getframe�	f_globals�	TypeError)�moduleZdepthr,r,r-�_normalize_module�s


rDcCsdD]}|�|d�}q|S)N)z
�
�
)�replace)�data�newliner,r,r-�_newline_convert�srJc
Cs�|rVt|d�}t||�}t|dd�dk	rVt|jd�rV|j�|�}|�|�}t|�|fSt||d��}|�	�|fW5QR�SQRXdS)N��
__loader__�get_data)�encoding)
rD�_module_relative_pathr0�hasattrrLrM�decoderJ�open�read)�filename�package�module_relativerNZ
file_contents�fr,r,r-�_load_testfile�s


rX�cCst�d|d|�S)Nz
(?m)^(?!$)� )�re�sub)�s�indentr,r,r-�_indent�sr_cCs*t�}|\}}}tj||||d�|��S)N)�file)r#�	traceback�print_exception�getvalue)�exc_infoZexcout�exc_typeZexc_valZexc_tbr,r,r-�_exception_traceback�s
rfc@seZdZdd�Zddd�ZdS)�	_SpoofOutcCs$t�|�}|r |�d�s |d7}|S�NrF)r#rc�endswith)�self�resultr,r,r-rcs
z_SpoofOut.getvalueNcCs|�|�t�|�dS�N)�seekr#�truncate)rj�sizer,r,r-rn	s
z_SpoofOut.truncate)N)r6�
__module__�__qualname__rcrnr,r,r,r-rg�s	rgcCs�t|kr||kS|�t�}dt|�}}|d}|rR|�|�rNt|�}|d=ndS|d}|r�|�|�r||t|�8}|d=ndS||kr�dS|D],}|�|||�}|dkr�dS|t|�7}q�dS)Nr"F���T)�ELLIPSIS_MARKER�splitr)�
startswithri�find)�want�gotZws�startpos�endpos�wr,r,r-�_ellipsis_matchs0


r|cCs|��}|rd|SdSdS)Nz# �#)�rstrip)�liner,r,r-�
_comment_line?sr�cCshdt|�}}|�d�}|dkr$|}|�dd|�}|dkr>|}|�dd|�}|dkr\|d}|||�S)Nr"rF�:�.r&)r)rv�rfind)�msg�start�end�ir,r,r-�_strip_exception_detailsGs
r�c@s.eZdZdd�Zd
dd�Zdd�Zdd	�ZdS)�_OutputRedirectingPdbcCs(||_d|_tjj||dd�d|_dS)NFT)�stdout�nosigintr&)�_OutputRedirectingPdb__out�$_OutputRedirectingPdb__debugger_used�pdb�Pdb�__init__Zuse_rawinput)rj�outr,r,r-r�gsz_OutputRedirectingPdb.__init__NcCs*d|_|dkrt��j}tj�||�dS)NT)r�r>r@�f_backr�r��	set_trace)rj�framer,r,r-r�os
z_OutputRedirectingPdb.set_tracecCs|jrtj�|�dSrl)r�r�r��set_continue�rjr,r,r-r�usz"_OutputRedirectingPdb.set_continuecGs2tj}|jt_ztjj|f|��W�S|t_XdSrl)r>r�r�r�r��trace_dispatch)rj�args�save_stdoutr,r,r-r�{s
z$_OutputRedirectingPdb.trace_dispatch)N)r6rprqr�r�r�r�r,r,r,r-r�as
r�cCs�t�|�std|��|�d�r(td��tjj|�d��}t	|d�rXtj�|j
�d}n�|jdkr�tt
j�dkr�t
jddkr�tj�t
jd�d}q�tj}nFt	|d�r�|jD]&}tj�||�}tj�|�r�|Sq�td	|j��tj�||�S)
NzExpected a module: %r�/z1Module-relative files may not have absolute paths�__file__r"�__main__��__path__zBCan't resolve paths relative to the module %r (it has no __file__))r7r8rBru�
ValueError�os�path�joinrtrPr�r6r)r>�argv�curdirr��exists)rCZ	test_pathZbasedirZ	directory�fullpathr,r,r-rO�s(






�rOc@s&eZdZd	dd�Zdd�Zdd�ZdS)
rNr"cCsv|�d�s|d7}|r(|�d�s(|d7}|dk	rB|�d�sB|d7}||_||_||_||_|dkrfi}||_||_dSrh)ri�sourcerw�linenor^�options�exc_msg)rjr�rwr�r�r^r�r,r,r-r��s
zExample.__init__cCs\t|�t|�k	rtS|j|jkoZ|j|jkoZ|j|jkoZ|j|jkoZ|j|jkoZ|j|jkSrl)�type�NotImplementedr�rwr�r^r�r��rj�otherr,r,r-�__eq__�s
�
�
�
�
�zExample.__eq__cCst|j|j|j|j|jf�Srl)�hashr�rwr�r^r�r�r,r,r-�__hash__�s�zExample.__hash__)Nr"r"N)r6rprqr�r�r�r,r,r,r-r�s
#�
c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)rcCs,||_||_|��|_||_||_||_dSrl)�examples�	docstring�copyr1r+rTr�)rjr�r1r+rTr�r�r,r,r-r�s
zDocTest.__init__cCsRt|j�dkrd}n"t|j�dkr(d}ndt|j�}d|jj|j|j|j|fS)Nr"zno examplesr&z	1 examplez%d examplesz<%s %s from %s:%s (%s)>)r)r��	__class__r6r+rTr�)rjr�r,r,r-�__repr__s��zDocTest.__repr__cCs\t|�t|�k	rtS|j|jkoZ|j|jkoZ|j|jkoZ|j|jkoZ|j|jkoZ|j|jkSrl)r�r�r�r�r1r+rTr�r�r,r,r-r�)s
�
�
�
�
�zDocTest.__eq__cCst|j|j|j|jf�Srl)r�r�r+rTr�r�r,r,r-r�4szDocTest.__hash__cCs:t|t�stS|j|j|jt|�f|j|j|jt|�fkSrl)r9rr�r+rTr��idr�r,r,r-�__lt__8s

�zDocTest.__lt__N)r6rprqr�r�r�r�r�r,r,r,r-r�s
c@s�eZdZe�dejejB�Ze�dejejBejB�Z	e�d�j
Zddd�Zdd�Z
dd	d
�Zdd�Ze�d
ej�Zdd�Ze�dej�Zdd�Zdd�Zdd�ZdS)ra�
        # Source consists of a PS1 line followed by zero or more PS2 lines.
        (?P<source>
            (?:^(?P<indent> [ ]*) >>>    .*)    # PS1 line
            (?:\n           [ ]*  \.\.\. .*)*)  # PS2 lines
        \n?
        # Want consists of any non-blank lines that do not start with PS1.
        (?P<want> (?:(?![ ]*$)    # Not a blank line
                     (?![ ]*>>>)  # Not a line starting with PS1
                     .+$\n?       # But any other line
                  )*)
        a�
        # Grab the traceback header.  Different versions of Python have
        # said different things on the first traceback line.
        ^(?P<hdr> Traceback\ \(
            (?: most\ recent\ call\ last
            |   innermost\ last
            ) \) :
        )
        \s* $                # toss trailing whitespace on the header.
        (?P<stack> .*?)      # don't blink: absorb stuff until...
        ^ (?P<msg> \w+ .*)   #     a line *starts* with alphanum.
        z^[ ]*(#.*)?$�<string>c
s|��}|�|���dkr8d��fdd�|�d�D��}g}d\}}|j�|�D]�}|�|||����||�d||���7}|�	|||�\}}}	}
|�
|�s�|�t||	|
|�t|�
d��|d��||�d|��|���7}|��}qP|�||d��|S)Nr"rFcsg|]}|�d��qSrlr,��.0�l�Z
min_indentr,r-�
<listcomp>sz'DocTestParser.parse.<locals>.<listcomp>�r"r"r^)r�r^r�)�
expandtabs�_min_indentr�rt�_EXAMPLE_RE�finditer�appendr��count�_parse_example�_IS_BLANK_OR_COMMENTrr)�groupr�)rj�stringr+�outputZcharnor��mr�r�rwr�r,r�r-�parsess*
�

�
zDocTestParser.parsecCst|�||�|||||�Srl)r�get_examples)rjr�r1r+rTr�r,r,r-�get_doctest�s	�zDocTestParser.get_doctestcCsdd�|�||�D�S)NcSsg|]}t|t�r|�qSr,)r9r)r��xr,r,r-r��s
�z.DocTestParser.get_examples.<locals>.<listcomp>)r�)rjr�r+r,r,r-r��szDocTestParser.get_examplesc
s
t|�d���|�d��d�}|�|�||�|�|dd�d�d||�d��fdd�|D��}|�d	�}|�d�}t|�dkr�t�d
|d�r�|d=|�|d�||t|��d��fdd�|D��}|j�|�}|r�|�d
�}nd}|�	|||�}	||	||fS)Nr^r�rFr&rZr�csg|]}|�dd��qS)rYNr,)r�Zsl�r^r,r-r��sz0DocTestParser._parse_example.<locals>.<listcomp>rwz *$rrcsg|]}|�d��qSrlr,)r�Zwlr�r,r-r��sr�)
r)r�rt�_check_prompt_blank�
_check_prefixr�r[�match�
_EXCEPTION_RE�
_find_options)
rjr�r+r��source_linesr�rw�
want_linesr�r�r,r�r-r��s& 


�zDocTestParser._parse_examplez#\s*doctest:\s*([^\n\'"]*)$c	Cs�i}|j�|�D]v}|�d��dd���}|D]V}|ddksN|dd�tkrdtd|d||f��t|dd�}|ddk||<q.q|r�|�|�r�td|||f��|S)	Nr&�,rZr"z+-z7line %r of the doctest for %s has an invalid option: %r�+zSline %r of the doctest for %s has an option directive on a line with no example: %r)�_OPTION_DIRECTIVE_REr�r�rGrtr'r�r�)	rjr�r+r�r�r�Zoption_strings�option�flagr,r,r-r��s"���zDocTestParser._find_optionsz
^([ ]*)(?=\S)cCs2dd�|j�|�D�}t|�dkr*t|�SdSdS)NcSsg|]}t|��qSr,)r))r�r^r,r,r-r�
sz-DocTestParser._min_indent.<locals>.<listcomp>r")�
_INDENT_RE�findallr)�min)rjr]�indentsr,r,r-r�szDocTestParser._min_indentc	Cs^t|�D]P\}}t|�|dkr||ddkrtd||d||||d�|f��qdS)NrYrKrZz8line %r of the docstring for %s lacks blank after %s: %rr&)�	enumerater)r�)rj�linesr^r+r�r�rr,r,r-r�s ��z!DocTestParser._check_prompt_blankcCs>t|�D]0\}}|r|�|�std||d||f��qdS)NzGline %r of the docstring for %s has inconsistent leading whitespace: %rr&)r�rur�)rjr��prefixr+r�r�rr,r,r-r�s
�zDocTestParser._check_prefixN)r�)r�)r6rprqr[�compile�	MULTILINE�VERBOSEr��DOTALLr�r�r�r�r�r�r�r�r�r�r�r�r�r,r,r,r-rCs&	
��
'
3�c@sJeZdZde�ddfdd�Zddd�Zdd	�Zd
d�Zdd
�Zdd�Z	dS)rFTcCs||_||_||_||_dSrl)�_parser�_verbose�_recurse�_exclude_empty)rj�verbose�parser�recurse�
exclude_emptyr,r,r-r�7szDocTestFinder.__init__Nc		CsN|dkr.t|dd�}|dkr.tdt|�f��|dkr<d}n|dkrNt�|�}zt�|�}Wntk
rtd}YndX|s�t�|�}|d|dd�dks�d}|dkr�d}n*|dk	r�t�	||j
�}n
t�	|�}|s�d}|dkr�|dkr�i}n
|j
��}n|��}|dk	�r|�|�d|k�r(d|d<g}|�
||||||i�|��|S)Nr6zJDocTestFinder.find: name must be given when obj.__name__ doesn't exist: %rFr"���z<]>r�)r0r�r�r7�	getmoduleZ
getsourcefilerBZgetfile�	linecache�getlines�__dict__r��update�_find�sort)	rj�objr+rCr1�
extraglobsr`r��testsr,r,r-rvMsL$�






zDocTestFinder.findcCs�|dkrdSt�|�dk	r(|t�|�kSt�|�r>|j|jkSt�|�r|t|d�r\|jj}nt|d�rn|j}ndS|j	|kSt�
|�r�|j	|jkSt|d�r�|j	|jkSt|t�r�dSt
d��dS)NT�__objclass__rpz"object must be a class or function)r7r��
isfunctionr��__globals__ZismethoddescriptorrPr�rpr6�isclassr9�propertyr�)rjrC�objectZobj_modr,r,r-�_from_module�s(








zDocTestFinder._from_modulec
Cs|jrtd|�t|�|kr"dSd|t|�<|�|||||�}|dk	rR|�|�t�|�r�|jr�|j�	�D]P\}	}
d||	f}	t�
t�|
��s�t�|
�rl|�
||
�rl|�||
|	||||�qlt�|��rn|j�rnt|di��	�D]�\}	}
t|	t��stdt|	�f��t�
|
��sJt�|
��sJt�|
��sJt|
t��sJtdt|
�f��d||	f}	|�||
|	||||�q�t�|��r|j�r|j�	�D]�\}	}
t|
t��r�t||	�}
t|
t��r�t||	�j}
t�
|
��s�t�|
��s�t|
t��r�|�
||
��r�d||	f}	|�||
|	||||��q�dS)NzFinding tests in %sr&z%s.%s�__test__z5DocTestFinder.find: __test__ keys must be strings: %rz`DocTestFinder.find: __test__ values must be strings, functions, methods, classes, or modules: %rz%s.__test__.%s)r��printr��	_get_testr�r7r8r�r��itemsZ	isroutineZunwrapr�rr�r0r9r:r�r��staticmethod�classmethod�__func__r�)rjr�r�r+rCr�r1�seen�testZvalname�valr,r,r-r��sn
�
�������
�
��zDocTestFinder._findc		Cs�t|t�r|}nJz,|jdkr"d}n|j}t|t�s:t|�}Wnttfk
rXd}YnX|�||�}|jrt|stdS|dkr�d}n.t|dd�p�|j}|dd�dkr�|dd�}|j	�
|||||�S)Nr�r�����.pycrr)r9r:�__doc__rB�AttributeError�_find_linenor�r0r6r�r�)	rjr�r+rCr1r�r�r�rTr,r,r-rs,




�zDocTestFinder._get_testcCsd}t�|�rd}t�|�rb|dkr(dSt�dt|dd��}t|�D]\}}|�|�rF|}qbqFt�|�rr|j	}t�
|�r�|j}t�|�r�|j
}t�|�r�|j}t�|�r�t|dd�d}|dk	�r
|dkr�|dSt�d�}t|t|��D]}|�||�r�|Sq�dS)Nr"z^\s*class\s*%s\br6�-�co_firstlinenor&z(^|.*:)\s*\w*("|\'))r7r8r�r[r�r0r�r�Zismethodrr��__code__Zistraceback�tb_frameZisframe�f_codeZiscode�ranger))rjr�r�r�Zpatr�rr,r,r-r4s>


�








zDocTestFinder._find_lineno)NNNN)
r6rprqrr�rvrr�rrr,r,r,r-r.s	�

f?&c@s�eZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Ze�
d�Zddd�Zd dd�Zd!dd�Zdd�ZdS)"rzF**********************************************************************Nr"cCsN|pt�|_|dkrdtjk}||_||_||_d|_d|_i|_	t
�|_dS)N�-vr")r�_checkerr>r�r��optionflags�original_optionflags�tries�failures�_name2ftrg�_fakeout)rj�checkerr�rr,r,r-r��s
zDocTestRunner.__init__cCsH|jrD|jr.|dt|j�dt|j��n|dt|j�d�dS)NzTrying:
zExpecting:
zExpecting nothing
)r�rwr_r�)rjr�r
�exampler,r,r-�report_start�s���zDocTestRunner.report_startcCs|jr|d�dS)Nzok
)r��rjr�r
r rxr,r,r-�report_success�szDocTestRunner.report_successcCs&||�||�|j�|||j��dSrl)�_failure_headerr�output_differencerr"r,r,r-�report_failure�s�zDocTestRunner.report_failurecCs$||�||�dtt|���dS)NzException raised:
)r$r_rf�rjr�r
r rdr,r,r-�report_unexpected_exception�s
�
�z)DocTestRunner.report_unexpected_exceptioncCs�|jg}|jrR|jdk	r4|jdk	r4|j|jd}nd}|�d|j||jf�n|�d|jd|jf�|�d�|j}|�t|��d�|�S)Nr&�?zFile "%s", line %s, in %szLine %s, in %szFailed example:rF)�DIVIDERrTr�r�r+r�r_r�)rjr
r r�r�r�r,r,r-r$�s�
zDocTestRunner._failure_headerc	Cs�d}}|j}td�\}}}	|jj}
t|j�D�]6\}}|jt@oH|dk}
||_|jr�|j��D],\}}|r||j|O_q`|j|M_q`|jt	@r�q.|d7}|
s�|�
|||�d|j|f}z,tt
|j|d|d�|j�|j��d}Wn4tk
�r�Ynt��}|j��YnX|j��}|j�d�|}|dk�r`|
|j||j��r�|}n|tj|dd��d}|
�s�|t|�7}|jdk�r�|	}nB|
|j||j��r�|}n*|jt@�r�|
t|j�t|�|j��r�|}||k�r�|
�sR|�||||�nT||k�r(|
�s|� ||||�|d7}n*||	k�rR|
�sH|�!||||�|d7}n|r.|jt"@r.�qhq.||_|�#|||�t$||�S)Nr"rKr&z<doctest %s[%d]>Zsingler4rr)%rrr�check_outputr�r�rr�rrr!r+�execr�r�r1�debuggerr��KeyboardInterruptr>rdrrcrnrwra�format_exception_onlyrfr�rr�r#r&r(r�_DocTestRunner__record_outcomer%)rjr
�compileflagsr�rrr�SUCCESS�FAILUREZBOOMZcheck�
examplenumr �quietZ
optionflagrrTZ	exceptionrxZoutcomer�r,r,r-Z__run�s�
�
��



�




�
zDocTestRunner.__runcCsL|j�|jd�\}}||||f|j|j<|j|7_|j|7_dS)Nr�)rr/r+rr)rjr
rW�t�f2�t2r,r,r-Z__record_outcome|szDocTestRunner.__record_outcomez.<doctest (?P<name>.+)\[(?P<examplenum>\d+)\]>$cCsV|j�|�}|rF|�d�|jjkrF|jjt|�d��}|jjdd�S|�	||�SdS)Nr+r4T��keepends)
�%_DocTestRunner__LINECACHE_FILENAME_REr�r�r
r+r��intr��
splitlines�save_linecache_getlines)rjrT�module_globalsr�r r,r,r-Z__patched_linecache_getlines�s
z*DocTestRunner.__patched_linecache_getlinesTc		s||_|dkrt|j�}tj�|dkrV�j��dks@���dkrH�j}n��fdd�}|jt_t�	�}t
j}t��|_
|j
��|j
jt
_tj|_|jt_tj}tjt_z|�|||�W�S�t_|t
_t�|�|jt_|t_|�r�|j��ddl}d|_XdS)N�utf-8cs t|��d���}��|�dS)N�backslashreplace)r:�encode�write)r]�rNr�r,r-r��szDocTestRunner.run.<locals>.outr")r
r3r1r>r�rN�lowerrCr�gettracer�r�r�r-�resetr�r�r>�*_DocTestRunner__patched_linecache_getlines�displayhook�__displayhook__�settrace�clear�builtins�_�_DocTestRunner__run)	rjr
r1r��clear_globsZ
save_traceZsave_set_traceZsave_displayhookrMr,rDr-�run�s<





zDocTestRunner.runc
Cs�|dkr|j}g}g}g}d}}|j��D]V}|\}\}	}
||
7}||	7}|
dkr`|�|�q,|	dkrx|�||
f�q,|�|�q,|r�|r�tt|�d�|��|D]}td|�q�|r�tt|�d�|��|D]\}}td||f�q�|�r:t|j�tt|�d�|��|D] \}\}	}
td|	|
|f��q|�rft|dt|j�d	�t||d
|d�|�rztd|d
�n|�r�td�t||�S)Nr"zitems had no tests:z   zitems passed all tests:z %3d tests in %szitems had failures:z %3d of %3d in %sztests inzitems.z
passed andzfailed.z***Test Failed***z	failures.zTest passed.)	r�rrr�rr)r�r*r%)
rjr�ZnotestsZpassedZfailedZtotaltZtotalfr�r+rWr6�thingr�r,r,r-�	summarize�sP
zDocTestRunner.summarizecCsR|j}|j��D]<\}\}}||kr@||\}}||}||}||f||<qdSrl)rr)rjr��dr+rWr6r7r8r,r,r-�mergeszDocTestRunner.merge)NNr")N)NNT)N)r6rprqr*r�r!r#r&r(r$rOr0r[r�r;rHrQrSrUr,r,r,r-rhs:
$
}



I
9c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
rcCst|�dd�d�S)N�ASCIIrA)r:rB)rjr]r,r,r-�_toAscii(szOutputChecker._toAsciicCs�|�|�}|�|�}||kr dS|t@sH||fdkr8dS||fdkrHdS|t@s�t�dt�t�d|�}t�dd|�}||kr�dS|t@r�d�|�	��}d�|�	��}||kr�dS|t
@r�t||�r�dSdS)	NT)zTrue
z1
)zFalse
z0
z(?m)^%s\s*?$r�z(?m)^[^\S\n]+$rZF)rWrrr[r\�escape�BLANKLINE_MARKERrr�rtrr|�rjrwrxrr,r,r-r+.s4

�
zOutputChecker.check_outputcCs<|ttBtB@sdS|t@r dS|�d�dko:|�d�dkS)NFTrFr4)r	r
rr�rZr,r,r-�_do_a_fancy_diffms��zOutputChecker._do_a_fancy_diffc
Cs(|j}|t@st�dt|�}|�|||�r�|jdd�}|jdd�}|t@rptj	||dd�}t
|�dd�}d}nZ|t@r�tj||dd�}t
|�dd�}d}n,|t
@r�tjtjd�}	t
|	�||��}d	}nd
|td�|��S|r�|r�dt|�t|�fS|�rd
t|�S|�r dt|�SdSdS)Nz(?m)^[ ]*(?=
)Tr9r4)�nz#unified diff with -expected +actualz-context diff with expected followed by actual)Zcharjunkzndiff with -expected +actualzDifferences (%s):
r�zExpected:
%sGot:
%szExpected:
%sGot nothing
zExpected nothing
Got:
%szExpected nothing
Got nothing
)rwrr[r\rYr[r=r	�difflibZunified_diff�listr
Zcontext_diffrZDifferZIS_CHARACTER_JUNKZcomparer_r�)
rjr rxrrwr�Z	got_linesZdiffZkindZenginer,r,r-r%�s4zOutputChecker.output_differenceN)r6rprqrWr+r[r%r,r,r,r-r s?c@seZdZdd�Zdd�ZdS)rcCs||_||_||_dSrl)r
r rx)rjr
r rxr,r,r-r��szDocTestFailure.__init__cCs
t|j�Srl�r:r
r�r,r,r-�__str__�szDocTestFailure.__str__N�r6rprqr�r`r,r,r,r-r�sc@seZdZdd�Zdd�ZdS)rcCs||_||_||_dSrl)r
r rd)rjr
r rdr,r,r-r��szUnexpectedException.__init__cCs
t|j�Srlr_r�r,r,r-r`�szUnexpectedException.__str__Nrar,r,r,r-r�sc@s&eZdZd	dd�Zdd�Zdd�ZdS)
rNTcCs$t�||||d�}|r |j��|S)NF)rrQr1rL)rjr
r1r�rP�rr,r,r-rQ3s
zDebugRunner.runcCst|||��dSrl)rr'r,r,r-r(9sz'DebugRunner.report_unexpected_exceptioncCst|||��dSrl)rr"r,r,r-r&<szDebugRunner.report_failure)NNT)r6rprqrQr(r&r,r,r,r-r�s[
TFc	Cs�|dkrtj�d�}t�|�s,td|f��|dkr:|j}t|d�}	|rVt||d�}
nt	||d�}
|	j
||||d�D]}|
�|�qt|r�|
��t
dkr�|
a
n
t
�|
�t|
j|
j�S)Nr�ztestmod: module required; %r)r��r�r�r1r�)r>r?r/r7r8rBr6rrrrvrQrS�masterrUr%rr)r�r+r1r��reportrr��raise_on_errorr��finder�runnerr
r,r,r-rHs$E


cCs�|r|std��t||||pd�\}}|dkr:tj�|�}|dkrHi}n|��}|dk	rb|�|�d|krrd|d<|	r�t||d�}
nt||d�}
|
�	||||d�}|
�
|�|r�|
��tdkr�|
an
t�
|
�t|
j|
j�S)N�8Package may only be specified for module-relative paths.r@r6r�rcr")r�rXr�r��basenamer�r�rrr�rQrSrerUr%rr)rTrVr+rUr1r�rfrr�rgr�rN�textrir
r,r,r-r�s2R�


�NoNamec	Cs@t|dd�}t||d�}|j|||d�D]}|j||d�q(dS)NF)r�r�rc)r1)r1)rrrvrQ)	rWr1r�r+r1rrhrir
r,r,r-r+scCs"|t@|krtd|��t}|a|S)NzOnly reporting flags allowed)r
r��_unittest_reportflags)r2�oldr,r,r-rHs

c@sleZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Ze
jZdd�ZdS)�DocTestCaser"NcCs.tj�|�||_||_||_||_||_dSrl)�unittest�TestCaser��_dt_optionflags�_dt_checker�_dt_test�	_dt_setUp�_dt_tearDown)rjr
r�setUp�tearDownrr,r,r-r�nszDocTestCase.__init__cCs|j}|jdk	r|�|�dSrl)rurv�rjr
r,r,r-rxxs
zDocTestCase.setUpcCs(|j}|jdk	r|�|�|j��dSrl)rurwr1rLrzr,r,r-ry~s

zDocTestCase.tearDowncCs~|j}tj}t�}|j}|t@s(|tO}t||jdd�}z d|_	|j
||jdd�\}}W5|t_X|rz|�|�
|�����dS)NF�rrr�zF----------------------------------------------------------------------)r�rP)rur>r�r#rsr
rnrrtr*rQrCZfailureException�format_failurerc)rjr
ro�newrrirrr,r,r-�runTest�s(��zDocTestCase.runTestcCsP|j}|jdkrd}n
d|j}d�|j�d�dd��}d|j|j|||fS)Nzunknown line numberz%sr�rrz:Failed doctest test for %s
  File "%s", line %s, in %s

%s)rur�r�r+rtrT)rj�errr
r�Zlnamer,r,r-r|�s

�zDocTestCase.format_failurecCs6|��t|j|jdd�}|j|jdd�|��dS)NFr{)rP)rxrrsrtrQrury)rjrir,r,r-r!�sB�zDocTestCase.debugcCs|jjSrl�rur+r�r,r,r-r��szDocTestCase.idcCsPt|�t|�k	rtS|j|jkoN|j|jkoN|j|jkoN|j|jkoN|j|jkSrl)r�r�rursrvrwrtr�r,r,r-r��s
�
�
�
�zDocTestCase.__eq__cCst|j|j|j|jf�Srl)r�rsrvrwrtr�r,r,r-r��s�zDocTestCase.__hash__cCs,|jj�d�}d|dd�|dd��fS)Nr�z%s (%s)rr)rur+rtr�)rjr+r,r,r-r�	szDocTestCase.__repr__cCsd|jjS)Nz	Doctest: r�r�r,r,r-�shortDescription		szDocTestCase.shortDescription)r"NNN)r6rprqr�rxryr~r|r!r�r�r�r�rr`r�r,r,r,r-rpls�

H
rpc@s0eZdZdd�Zdd�Zdd�Zdd�ZeZd	S)
�SkipDocTestCasecCs||_t�|d�dSrl)rCrpr�)rjrCr,r,r-r�
	szSkipDocTestCase.__init__cCs|�d�dS)Nz-DocTestSuite will not work with -O2 and above)ZskipTestr�r,r,r-rx	szSkipDocTestCase.setUpcCsdSrlr,r�r,r,r-�	test_skip	szSkipDocTestCase.test_skipcCsd|jjS)NzSkipping tests from %s)rCr6r�r,r,r-r�	sz SkipDocTestCase.shortDescriptionN)r6rprqr�rxr�r�r`r,r,r,r-r�	s
r�c@seZdZdd�ZdS)�
_DocTestSuitecCsdSrlr,)rj�indexr,r,r-�_removeTestAtIndex	sz _DocTestSuite._removeTestAtIndexN)r6rprqr�r,r,r,r-r�	sr�c	Ks�|dkrt�}t|�}|j|||d�}|sNtjjdkrNt�}|�t|��|S|�	�t�}|D]T}t
|j�dkrtq`|js�|j
}|dd�dkr�|dd�}||_|�t|f|��q`|S)Nrdr4r"rr
rr)rrDrvr>r2�optimizer��addTestr�r�r)r�rTr�rp)	rCr1r�Ztest_finderr�r��suiter
rTr,r,r-r#	s(%c@s$eZdZdd�Zdd�Zdd�ZdS)�DocFileCasecCsd�|jj�d��S)NrNr�)r�rur+rtr�r,r,r-r�e	szDocFileCase.idcCs|jjSrl)rurTr�r,r,r-r�h	szDocFileCase.__repr__cCsd|jj|jj|fS)Nz2Failed doctest test for %s
  File "%s", line 0

%s)rur+rT)rjrr,r,r-r|k	s�zDocFileCase.format_failureN)r6rprqr�r�r|r,r,r,r-r�c	sr�c
Ksv|dkri}n|��}|r&|s&td��t||||p4d�\}}d|krL||d<tj�|�}|�||||d�}	t|	f|�S)Nrjr@r�r")r�r�rXr�r�rkr�r�)
r�rVrUr1r�rNr��docr+r
r,r,r-�DocFileTestp	s�r�cOsDt�}|�dd�r$t|�d��|d<|D]}|�t|f|��q(|S)NrVTrU)r�r/rDr�r�)�paths�kwr�r�r,r,r-r�	s8cCs�g}t��|�D]x}t|t�rh|�|jdd��|j}|r�|�d�|dd�|�d�dd�D�7}q|dd�|�d�dd�D�7}q|r�|ddkr�|��q�|r�|ddkr�|�d�q�d�	|�dS)	Nrrz# Expected:cSsg|]}d|�qS)z## r,r�r,r,r-r�
sz(script_from_examples.<locals>.<listcomp>rFcSsg|]}t|��qSr,)r�r�r,r,r-r�
s�r}r")
rr�r9rr�r�rwrt�popr�)r]r�Zpiecerwr,r,r-r�	s :

"�

csJt|�}t��|�}�fdd�|D�}|s4t�d��|d}t|j�}|S)Ncsg|]}|j�kr|�qSr,r*)r�r6r*r,r-r�.
s
ztestsource.<locals>.<listcomp>znot found in testsr")rDrrvr�rr�)rCr+r�r
�testsrcr,r*r-r%
s

cCst|�}t|||�dSrl)r�debug_script)�src�pmr1r�r,r,r-r 5
scCs�ddl}|r|��}ni}|rvzt|||�Wq�tt��d�|jdd�}|��|�dt��d�Yq�Xn|jdd��	d|||�dS)Nr"r&T)r�r4zexec(%r))
r�r�r,rr>rdr�rGZinteractionrQ)r�r�r1r��pr,r,r-r�:
s
r�cCs$t|�}t||�}t|||j�dSrl)rDrr�r�)rCr+r�r�r,r,r-r!N
s
c@s$eZdZdd�Zdd�Zdd�ZdS)�
_TestClasscCs
||_dSrl�r)rjrr,r,r-r�j
sz_TestClass.__init__cCs|jd|_|S)Nr4r�r�r,r,r-�squaret
sz_TestClass.squarecCs|jSrlr�r�r,r,r-r/~
sz_TestClass.getN)r6rprqr�r�r/r,r,r,r-r�\
s

r�z�
                      Example of a string object, searched as-is.
                      >>> x = 1; y = 2
                      >>> x + y, x * y
                      (3, 2)
                      a�
                                    In 2.2, boolean expressions displayed
                                    0 or 1.  By default, we still accept
                                    them.  This can be disabled by passing
                                    DONT_ACCEPT_TRUE_FOR_1 to the new
                                    optionflags argument.
                                    >>> 4 == 4
                                    1
                                    >>> 4 == 4
                                    True
                                    >>> 4 > 4
                                    0
                                    >>> 4 > 4
                                    False
                                    z�
                Blank lines can be marked with <BLANKLINE>:
                    >>> print('foo\n\nbar\n')
                    foo
                    <BLANKLINE>
                    bar
                    <BLANKLINE>
            z�
                If the ellipsis flag is used, then '...' can be used to
                elide substrings in the desired output:
                    >>> print(list(range(1000))) #doctest: +ELLIPSIS
                    [0, 1, 2, ..., 999]
            a�
                If the whitespace normalization flag is used, then
                differences in whitespace are ignored.
                    >>> print(list(range(30))) #doctest: +NORMALIZE_WHITESPACE
                    [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
                     15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
                     27, 28, 29]
            )r�r�zbool-int equivalencezblank linesZellipsiszwhitespace normalizationcCs"ddl}|jdd�}|jdddddd	�|jd
ddt��gd
d�|jddddd�|jdddd�|��}|j}|j}d}|jD]}|t|O}q�|j	r�|t
O}|D]v}|�d�r�tj
�|�\}}tj
�d|�t|dd��}	tj
d=t|	||d�\}
}nt|d||d�\}
}|
r�dSq�dS)Nr"zdoctest runner)Zdescriptionrz	--verbose�
store_trueFz'print very verbose output for all tests)�action�default�helpz-oz--optionr�zqspecify a doctest option flag to apply to the test run; may be specified more than once to apply multiple options)r��choicesr�r�z-fz--fail-fastzystop running tests after first failure (this is a shorthand for -o FAIL_FAST, and is in addition to any other -o options))r�r�r`r�z file containing the tests to run)�nargsr�z.py���rc)rVr�rr&)�argparse�ArgumentParser�add_argumentr'�keys�
parse_argsr`r�r�Z	fail_fastrrir�r�rtr>�insertr;rr)r�r�r�Z	testfilesr�r�r�rT�dirnamer�rrNr,r,r-�_test�
sL�
�
��

�
r�r�)r4)rY)	NNNNTr"NFF)FrmNr")NNNN)FN)FN)F)RZ
__docformat__�__all__r.r]r7r�r�r�r[r>rarq�ior#�collectionsr$r%r'rrrrrrrrr	r
rrrr
rYrsr3rDrJrXr_rfrgr|r�r�r�r�rOrrrrrr�	Exceptionrrrrerrrrnrrrrpr�Z	TestSuiter�rr�r�rrrr r�r!r�rr�r6�exitr,r,r,r-�<module>0sD�-
���������

1%.DKl<;n�
h�
{�
$!
@
�
IR


,	�3-
__pycache__/tracemalloc.cpython-38.opt-1.pyc000064400000041725151153537600014650 0ustar00U

e5d�B�@sddlmZmZddlmZddlZddlZddlZddl	Z	ddl
Tddl
mZmZdd�Z
Gdd	�d	�ZGd
d�d�Zdd
�ZeGdd�d��ZeGdd�de��Zdd�ZGdd�d�ZGdd�de�Zdd�ZGdd�d�ZGdd�de�ZGdd�de�ZGd d!�d!�Zd"d#�ZdS)$�)�Sequence�Iterable)�total_orderingN)�*)�_get_object_traceback�_get_tracescCs�dD]|}t|�dkr@|dkr@|r0d||fSd||fSt|�dksT|dkrx|rhd||fSd	||fS|d
}qdS)N)�BZKiBZMiBZGiB�TiB�drz%+.1f %sz%.1f %si(r	z%+.0f %sz%.0f %si)�abs)�sizeZsignZunit�r
�#/usr/lib64/python3.8/tracemalloc.py�_format_size
src@sDeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dS)�	StatisticzS
    Statistic difference on memory allocations between two Snapshot instance.
    ��	tracebackr�countcCs||_||_||_dS�Nr)�selfrrrr
r
r�__init__%szStatistic.__init__cCst|j|j|jf�Sr)�hashrrr�rr
r
r�__hash__*szStatistic.__hash__cCs$|j|jko"|j|jko"|j|jkSrr�r�otherr
r
r�__eq__-s

�
�zStatistic.__eq__cCsBd|jt|jd�|jf}|jr>|j|j}|dt|d�7}|S)Nz%s: size=%s, count=%iF�, average=%s)rrrr�r�textZaverager
r
r�__str__2s
��zStatistic.__str__cCsd|j|j|jfS)Nz)<Statistic traceback=%r size=%i count=%i>rrr
r
r�__repr__<s�zStatistic.__repr__cCs|j|j|jfSr)rrrrr
r
r�	_sort_key@szStatistic._sort_keyN��__name__�
__module__�__qualname__�__doc__�	__slots__rrrr r!r"r
r
r
rrs
rc@sDeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dS)�
StatisticDiffzd
    Statistic difference on memory allocations between an old and a new
    Snapshot instance.
    �rr�	size_diffr�
count_diffcCs"||_||_||_||_||_dSrr*)rrrr+rr,r
r
rrKs
zStatisticDiff.__init__cCst|j|j|j|j|jf�Sr)rrrr+rr,rr
r
rrRs�zStatisticDiff.__hash__cCs<|j|jko:|j|jko:|j|jko:|j|jko:|j|jkSrr*rr
r
rrVs
�
�
�
�zStatisticDiff.__eq__cCsPd|jt|jd�t|jd�|j|jf}|jrL|j|j}|dt|d�7}|S)Nz %s: size=%s (%s), count=%i (%+i)FTr)rrrr+rr,rr
r
rr ]s

��zStatisticDiff.__str__cCsd|j|j|j|j|jfS)Nz9<StatisticDiff traceback=%r size=%i (%+i) count=%i (%+i)>r*rr
r
rr!is��zStatisticDiff.__repr__cCs t|j�|jt|j�|j|jfSr)rr+rr,rrrr
r
rr"ns
�zStatisticDiff._sort_keyNr#r
r
r
rr)Dsr)cCs�g}|��D]d\}}|�|d�}|dk	rNt||j|j|j|j|j|j�}nt||j|j|j|j�}|�|�q|��D]*\}}t|d|jd|j�}|�|�qz|S�Nr)�items�popr)rr�append)�	old_group�	new_group�
statisticsr�statZpreviousr
r
r�_compare_grouped_statsts*

��r5c@s\eZdZdZdZdd�Zedd��Zedd��Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dS)�Framez
    Frame of a traceback.
    ��_framecCs
||_dSrr7�r�framer
r
rr�szFrame.__init__cCs
|jdSr-r7rr
r
r�filename�szFrame.filenamecCs
|jdS�N�r7rr
r
r�lineno�szFrame.linenocCs|j|jkSrr7rr
r
rr�szFrame.__eq__cCs|j|jkSrr7rr
r
r�__lt__�szFrame.__lt__cCs
t|j�Sr)rr8rr
r
rr�szFrame.__hash__cCsd|j|jfS)Nz%s:%s�r;r>rr
r
rr �sz
Frame.__str__cCsd|j|jfS)Nz<Frame filename=%r lineno=%r>r@rr
r
rr!�szFrame.__repr__N)r$r%r&r'r(r�propertyr;r>rr?rr r!r
r
r
rr6�s

r6c@sfeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
ddd�ZdS)�	Tracebackz`
    Sequence of Frame instances sorted from the oldest frame
    to the most recent frame.
    ��_framescCst�|�tt|��|_dSr)rr�tuple�reversedrD)r�framesr
r
rr�s
zTraceback.__init__cCs
t|j�Sr)�lenrDrr
r
r�__len__�szTraceback.__len__cCs4t|t�r"tdd�|j|D��St|j|�SdS)Ncss|]}t|�VqdSr)r6��.0�tracer
r
r�	<genexpr>�sz(Traceback.__getitem__.<locals>.<genexpr>)�
isinstance�slicerErDr6�r�indexr
r
r�__getitem__�s
zTraceback.__getitem__cCs|j|jkSr)r8rDr9r
r
r�__contains__�szTraceback.__contains__cCs
t|j�Sr)rrDrr
r
rr�szTraceback.__hash__cCs|j|jkSrrCrr
r
rr�szTraceback.__eq__cCs|j|jkSrrCrr
r
rr?�szTraceback.__lt__cCst|d�Sr-)�strrr
r
rr �szTraceback.__str__cCsdt|�fS)Nz<Traceback %r>)rErr
r
rr!�szTraceback.__repr__NFcCs�g}|dk	r2|dkr$||d�}q6|d|�}n|}|rBt|�}|D]@}|�d|j|jf�t�|j|j���}|rF|�d|�qF|S)Nrz  File "%s", line %sz    %s)rFr0r;r>�	linecache�getline�strip)r�limitZmost_recent_first�linesZframe_slicer:�liner
r
r�format�s 
�zTraceback.format)NF)r$r%r&r'r(rrIrRrSrrr?r r!r[r
r
r
rrB�srBcCs t|�}|dk	rt|�SdSdS)z�
    Get the traceback where the Python object *obj* was allocated.
    Return a Traceback instance.

    Return None if the tracemalloc module is not tracing memory allocations or
    did not trace the allocation of the object.
    N)rrB)�objrGr
r
r�get_object_traceback�sr]c@s`eZdZdZdZdd�Zedd��Zedd��Zed	d
��Z	dd�Z
d
d�Zdd�Zdd�Z
dS)�Tracez"
    Trace of a memory block.
    ��_tracecCs
||_dSrr_�rrLr
r
rrszTrace.__init__cCs
|jdSr-r_rr
r
r�domainszTrace.domaincCs
|jdSr<r_rr
r
rr	sz
Trace.sizecCst|jd�S)N�)rBr`rr
r
rr
szTrace.tracebackcCs|j|jkSrr_rr
r
rrszTrace.__eq__cCs
t|j�Sr)rr`rr
r
rrszTrace.__hash__cCsd|jt|jd�fS)Nz%s: %sF)rrrrr
r
rr sz
Trace.__str__cCsd|jt|jd�|jfS)Nz'<Trace domain=%s size=%s, traceback=%r>F)rbrrrrr
r
rr!s�zTrace.__repr__N)r$r%r&r'r(rrArbrrrrr r!r
r
r
rr^�s


r^c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�_TracescCst�|�||_dSr)rr�_traces)r�tracesr
r
rr s
z_Traces.__init__cCs
t|j�Sr)rHrerr
r
rrI%sz_Traces.__len__cCs4t|t�r"tdd�|j|D��St|j|�SdS)Ncss|]}t|�VqdSr)r^rJr
r
rrM*sz&_Traces.__getitem__.<locals>.<genexpr>)rNrOrErer^rPr
r
rrR(s
z_Traces.__getitem__cCs|j|jkSr)r`rerar
r
rrS.sz_Traces.__contains__cCs|j|jkSr)rerr
r
rr1sz_Traces.__eq__cCsdt|�S)Nz<Traces len=%s>)rHrr
r
rr!4sz_Traces.__repr__N)	r$r%r&rrIrRrSrr!r
r
r
rrdsrdcCs&tj�|�}|�d�r"|dd�}|S)Nz.pyc���)�os�path�normcase�endswith)r;r
r
r�_normalize_filename8s
rlc@seZdZdd�Zdd�ZdS)�
BaseFiltercCs
||_dSr)�	inclusive)rrnr
r
rr@szBaseFilter.__init__cCst�dSr)�NotImplementedErrorrar
r
r�_matchCszBaseFilter._matchN)r$r%r&rrpr
r
r
rrm?srmcsJeZdZd�fdd�	Zedd��Zdd�Zd	d
�Zdd�Zd
d�Z	�Z
S)�FilterNFcs2t��|�||_t|�|_||_||_||_dSr)�superrrnrl�_filename_patternr>�
all_framesrb)rrn�filename_patternr>rtrb��	__class__r
rrHs
zFilter.__init__cCs|jSr)rsrr
r
rruQszFilter.filename_patterncCs6t|�}t�||j�sdS|jdkr(dS||jkSdS)NFT)rl�fnmatchrsr>�rr;r>r
r
r�_match_frame_implUs
zFilter._match_frame_implcCs|�||�|jASr)rzrnryr
r
r�_match_frame^szFilter._match_framecsH�jr,t�fdd�|D��r"�jS�jSn|d\}}��||�SdS)Nc3s|]\}}��||�VqdSr)rz)rKr;r>rr
rrMcs�z*Filter._match_traceback.<locals>.<genexpr>r)rt�anyrnr{)rrr;r>r
rr�_match_tracebackas�
zFilter._match_tracebackcCsD|\}}}|�|�}|jdk	r@|jr2|o0||jkS|p>||jkS|Sr)r}rbrn)rrLrbrr�resr
r
rrpls


z
Filter._match)NFN)r$r%r&rrArurzr{r}rp�
__classcell__r
r
rvrrqGs�	
	rqcs0eZdZ�fdd�Zedd��Zdd�Z�ZS)�DomainFiltercst��|�||_dSr)rrr�_domain)rrnrbrvr
rrxszDomainFilter.__init__cCs|jSr)r�rr
r
rrb|szDomainFilter.domaincCs|\}}}||jk|jASr)rbrn)rrLrbrrr
r
rrp�s
zDomainFilter._match)r$r%r&rrArbrprr
r
rvrr�ws
r�c@sXeZdZdZdd�Zdd�Zedd��Zdd	�Zd
d�Z	dd
�Z
ddd�Zddd�ZdS)�SnapshotzB
    Snapshot of traces of memory blocks allocated by Python.
    cCst|�|_||_dSr)rdrf�traceback_limit)rrfr�r
r
rr�s
zSnapshot.__init__c	Cs*t|d��}t�||tj�W5QRXdS)z1
        Write the snapshot into a file.
        �wbN)�open�pickle�dumpZHIGHEST_PROTOCOL)rr;�fpr
r
rr��sz
Snapshot.dumpc
Cs,t|d��}t�|�W5QR�SQRXdS)z.
        Load a snapshot from a file.
        �rbN)r�r��load)r;r�r
r
rr��sz
Snapshot.loadcs@|rt�fdd�|D��sdS|r<t�fdd�|D��r<dSdS)Nc3s|]}|���VqdSr�rp�rK�trace_filter�rLr
rrM�s�z)Snapshot._filter_trace.<locals>.<genexpr>Fc3s|]}|���VqdSrr�r�r�r
rrM�s�T)r|)r�include_filters�exclude_filtersrLr
r�r�
_filter_trace�s��zSnapshot._filter_tracecs�t|t�stdt|�j��|rjg�g�|D] }|jrB��|�q,��|�q,���fdd��jjD�}n�jj�	�}t
|�j�S)z�
        Create a new Snapshot instance with a filtered traces sequence, filters
        is a list of Filter or DomainFilter instances.  If filters is an empty
        list, return a new Snapshot instance with a copy of the traces.
        z)filters must be a list of filters, not %scsg|]}����|�r|�qSr
)r�rJ�r�r�rr
r�
<listcomp>�s��z*Snapshot.filter_traces.<locals>.<listcomp>)rNr�	TypeError�typer$rnr0rfre�copyr�r�)r�filtersr�Z
new_tracesr
r�r�
filter_traces�s
�zSnapshot.filter_tracesc

Cs�|dkrtd|f��|r.|dkr.td|��i}i}|�s|jjD]�}|\}}}z||}	WnZtk
r�|dkr||}
n(|dkr�|dd�}
n|dddff}
t|
�}	|	||<YnXz(||	}|j|7_|jd7_WqDtk
�rt|	|d�||	<YqDXqDn�|jjD]�}|\}}}|D]�}z||}	WnFtk
�r~|dk�r\|f}
n|ddff}
t|
�}	|	||<YnXz(||	}|j|7_|jd7_Wn&tk
�r�t|	|d�||	<YnX�q(�q|S)	N)rr;r>zunknown key_type: %r)r>r;z/cumulative mode cannot by used with key type %rrr>r=r)�
ValueErrorrfre�KeyErrorrBrrr)
r�key_type�
cumulativeZstatsZ
tracebacksrLrbrZtrace_tracebackrrGr4r:r
r
r�	_group_by�sZ�


zSnapshot._group_byFcCs,|�||�}t|���}|jdtjd�|S)zd
        Group statistics by key_type. Return a sorted list of Statistic
        instances.
        T��reverse�key)r��list�values�sortrr")rr�r�Zgroupedr3r
r
rr3�szSnapshot.statisticscCs6|�||�}|�||�}t||�}|jdtjd�|S)z�
        Compute the differences with an old snapshot old_snapshot. Get
        statistics as a sorted list of StatisticDiff instances, grouped by
        group_by.
        Tr�)r�r5r�r)r")rZold_snapshotr�r�r2r1r3r
r
r�
compare_tos

zSnapshot.compare_toN)F)F)
r$r%r&r'rr��staticmethodr�r�r�r�r3r�r
r
r
rr��s
3

r�cCs$t�std��t�}t�}t||�S)zI
    Take a snapshot of traces of memory blocks allocated by Python.
    zLthe tracemalloc module must be tracing memory allocations to take a snapshot)�
is_tracing�RuntimeErrorrZget_traceback_limitr�)rfr�r
r
r�
take_snapshot
s
r�)Zcollections.abcrr�	functoolsrrxrUZos.pathrhr�Z_tracemallocrrrrr)r5r6rBr]r^rdrlrmrqr�r�r�r
r
r
r�<module>s2&0"?%0	__pycache__/fnmatch.cpython-38.opt-2.pyc000064400000004145151153537600013776 0ustar00U

e5d��@sfddlZddlZddlZddlZddddgZdd�Zejddd	�d
d��Zdd�Zd
d�Z	dd�Z
dS)�N�filter�fnmatch�fnmatchcase�	translatecCs"tj�|�}tj�|�}t||�S�N)�os�path�normcaser)�name�pat�r�/usr/lib64/python3.8/fnmatch.pyrs�T)�maxsize�typedcCs<t|t�r(t|d�}t|�}t|d�}nt|�}t�|�jS)Nz
ISO-8859-1)�
isinstance�bytes�strr�re�compile�match)rZpat_strZres_str�resrrr
�_compile_pattern&s

rcCshg}tj�|�}t|�}tjtkr@|D]}||�r&|�|�q&n$|D]}|tj�|��rD|�|�qD|Sr)rrr	r�	posixpath�append)�namesr�resultrr
rrr
r0s
cCst|�}||�dk	Sr)r)r
rrrrr
r@sc	Cs�dt|�}}d}||k�r�||}|d}|dkr>|d}q|dkrP|d}q|dk�r�|}||krz||d	krz|d}||kr�||d
kr�|d}||kr�||d
kr�|d}q�||kr�|d}�q�|||�}d|kr�|�d
d�}n�g}||d	k�r|dn|d}|�d||�}|dk�r(�qN|�|||��|d}|d}�q|�|||��d�dd�|D��}t�dd|�}|d}|dd	k�r�d|dd�}n|ddk�r�d
|}d||f}q|t�|�}qd|S)Nr���*z.*�?�.�[�!�]z\[z--�\�\\��-�css"|]}|�dd��dd�VqdS)r%r&r(z\-N)�replace)�.0�srrr
�	<genexpr>ts�ztranslate.<locals>.<genexpr>z([&~|])z\\\1�^)r.r"z%s[%s]z	(?s:%s)\Z)�lenr*�findr�joinr�sub�escape)	r�i�nr�c�jZstuffZchunks�krrr
rJsV






�)rrr�	functools�__all__r�	lru_cacherrrrrrrr
�<module>s
	
__pycache__/hmac.cpython-38.opt-1.pyc000064400000016352151153537600013270 0ustar00U

&�.e��@s�dZddlZddlmZzddlZWnek
r@dZdZ	YnXe
ej�Z	ddlZddlZ
ddlZedd�ed�D��Zedd�ed�D��ZdZGdd	�d	�Zd
d�ZGdd
�d
ej�Ze
��r�eZddd�Zdd�ZdS)zqHMAC (Keyed-Hashing for Message Authentication) module.

Implements the HMAC algorithm as described by RFC 2104.
�N)�_compare_digestccs|]}|dAVqdS)�\N���.0�xrr�/usr/lib64/python3.8/hmac.py�	<genexpr>sr	�ccs|]}|dAVqdS)�6Nrrrrrr	sc@sReZdZdZdZddd�Zedd��Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�ZdS)�HMACz~RFC 2104 HMAC class.  Also complies with RFC 4231.

    This supports the API for Cryptographic Hash Functions (PEP 247).
    �@N�csVt��rtd��t|ttf�s0tdt|�j���s<td��t	��rL�|_
n,t�t�rhd�fdd�	|_
nd�fdd�	|_
|�
�|_|�
�|_
|j
j|_t|j
d�r�|j
j}|d	kr�t�d
||jftd�|j}nt�d|jtd�|j}||_t|�|k�r|�
|���}|�|d
�}|j�|�t��|j
�|�t��|dk	�rR|�|�dS)a?Create a new HMAC object.

        key: bytes or buffer, key for the keyed hash object.
        msg: bytes or buffer, Initial input for the hash or None.
        digestmod: A hash name suitable for hashlib.new(). *OR*
                   A hashlib constructor returning a new hash object. *OR*
                   A module supporting PEP 247.

                   Required as of 3.8, despite its position after the optional
                   msg argument.  Passing it as a keyword argument is
                   recommended, though not required for legacy API reasons.
        z9This class is not available in FIPS mode. Use hmac.new().�,key: expected bytes or bytearray, but got %rz'Missing required parameter 'digestmod'.�cst��|�S�N��_hashlib�new��d��	digestmodrr�<lambda>?rzHMAC.__init__.<locals>.<lambda>cs
��|�Sr�rrrrrrAr�
block_size�z:block_size of %d seems too small; using our default of %d.�z<No block_size attribute on given digest object; Assuming %d.�N)r)r)�_hashlibopenssl�
get_fips_mode�
ValueError�
isinstance�bytes�	bytearray�	TypeError�type�__name__�callable�digest_cons�str�outer�inner�digest_size�hasattrr�	_warnings�warn�	blocksize�RuntimeWarning�len�digest�ljust�update�	translate�trans_5C�trans_36)�self�key�msgrr1rrr�__init__#sR
�



����
z
HMAC.__init__cCsd|jjS)Nzhmac-)r,�name)r:rrrr>asz	HMAC.namecCs t��rtd��|j�|�dS)z,Feed data from msg into this hashing object.z'hmac.HMAC is not available in FIPS modeN)rr r!r,r6)r:r<rrrr6eszHMAC.updatecCs:|j�|j�}|j|_|j|_|j��|_|j��|_|S)zyReturn a separate copy of this hashing object.

        An update to this copy won't affect the original object.
        )�	__class__�__new__r)r-r,�copyr+)r:�otherrrrrAksz	HMAC.copycCs|j��}|�|j���|S)zwReturn a hash object for the current state.

        To be used only internally with digest() and hexdigest().
        )r+rAr6r,r4�r:�hrrr�_currentxs
z
HMAC._currentcCs|��}|��S)z�Return the hash value of this hashing object.

        This returns the hmac value as bytes.  The object is
        not altered in any way by this function; you can continue
        updating the object after calling this function.
        )rEr4rCrrrr4�szHMAC.digestcCs|��}|��S)zKLike digest(), but returns a string of hexadecimal digits instead.
        )rE�	hexdigestrCrrrrF�szHMAC.hexdigest)Nr)
r'�
__module__�__qualname__�__doc__r1r=�propertyr>r6rArEr4rFrrrrrs
>

	
rcCsHt|t�r|��St|�r"|d�}t|tj�s6td��|j���dd�S)Nrz6Only OpenSSL hashlib hashes are accepted in FIPS mode.�_�-)	r"r*�lowerr(rZHASHr%r>�replacerrrr�_get_openssl_name�s
�rOc@seZdZddd�ZdS)�HMAC_opensslNcCsLt|ttf�s tdt|�j��t|�}tjj	|||d�}|rH|�
|�|S)Nrr)r"r#r$r%r&r'rO�_hmacopensslrr@r6)�clsr;r<rr>�resultrrrr@�s
zHMAC_openssl.__new__)NN)r'rGrHr@rrrrrP�srPrcCst|||�S)a�Create a new hashing object and return it.

    key: bytes or buffer, The starting key for the hash.
    msg: bytes or buffer, Initial input for the hash, or None.
    digestmod: A hash name suitable for hashlib.new(). *OR*
               A hashlib constructor returning a new hash object. *OR*
               A module supporting PEP 247.

               Required as of 3.8, despite its position after the optional
               msg argument.  Passing it as a keyword argument is
               recommended, though not required for legacy API reasons.

    You can now feed arbitrary bytes into the object using its update()
    method, and can ask for the hash value at any time by calling its digest()
    or hexdigest() methods.
    )r)r;r<rrrrr�srcs�tdk	r(t�t�r(�tkr(t�||��St��r6�}n(t�t�rPd	�fdd�	}nd
�fdd�	}|�}|�}t|dd�}t|�|kr�||���}|d|t|�}|�	|�
t��|�	|�
t��|�	|�|�	|���|��S)aJFast inline implementation of HMAC.

    key: bytes or buffer, The key for the keyed hash object.
    msg: bytes or buffer, Input message.
    digest: A hash name suitable for hashlib.new() for best performance. *OR*
            A hashlib constructor returning a new hash object. *OR*
            A module supporting PEP 247.
    Nrcst��|�Srrr�r4rrr�rzdigest.<locals>.<lambda>cs
��|�SrrrrTrrr�rrr
r)r)r)
�_hashopensslr"r*�_openssl_md_methsZhmac_digestr(�getattrr3r4r6r7r9r8)r;r<r4r)r,r+r1rrTrr4�s,	��

r4)Nr)rI�warningsr/�	_operatorrZcompare_digestrrU�ImportErrorrV�	frozensetZopenssl_md_meth_namesZhashlibrrQr#�ranger8r9r-rrOrPr rr4rrrr�<module>s*

u
__pycache__/platform.cpython-38.opt-2.pyc000064400000040104151153537600014175 0ustar00U

e5d��@shdZdZddlZddlZddlZddlZddddddddd	d	d
�
Ze�d�Zdd
�Z	e�dej
�Zdvdd�Zdwdd�Z
e�d�Zdxdd�Zdddddddd d!d"d#d$�Zdd%d&d'd(d)d*�Zd+d,�Zd-d.�Zdyd/d0�Zd1d2�Zdzd4d5�Zd6d7�Zd{d8d9�Zd:d;�Zd<d=�Zd|d>d?�Zd@dA�Zd}dBdC�Zd~dDdE�ZdFdGdHd�Zej ddfdIdJ�Z!e�"dKdL�Z#da$dMdN�Z%dOdP�Z&dQdR�Z'dSdT�Z(dUdV�Z)dWdX�Z*dYdZ�Z+e�d[ej
�Z,e�d\ej
�Z-e�d]�Z.e�d^�Z/iZ0dd_d`�Z1dadb�Z2dcdd�Z3dedf�Z4dgdh�Z5didj�Z6dkdl�Z7dmdn�Z8iZ9d�dodp�Z:e;dqk�rddrej<k�p4dsej<kZ=dtej<k�oJduej<kZ>e?e:e>e=��e�@d�dS)�a
    Copyright (c) 1999-2000, Marc-Andre Lemburg; mailto:mal@lemburg.com
    Copyright (c) 2000-2010, eGenix.com Software GmbH; mailto:info@egenix.com

    Permission to use, copy, modify, and distribute this software and its
    documentation for any purpose and without fee or royalty is hereby granted,
    provided that the above copyright notice appear in all copies and that
    both that copyright notice and this permission notice appear in
    supporting documentation or portions thereof, including modifications,
    that you make.

    EGENIX.COM SOFTWARE GMBH DISCLAIMS ALL WARRANTIES WITH REGARD TO
    THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
    FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL,
    INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
    FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
    NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
    WITH THE USE OR PERFORMANCE OF THIS SOFTWARE !

z1.0.8�N�
���(�2��)
ZdevZalpha�aZbeta�b�cZRCZrc�pl�pz([0-9]+|[._+-])c	Csbg}t�|�D]N}|dkrzt|d�}d}Wn tk
rLt�|d�}YnX|�||f�q|S)Nz._+-r�dr)�
_component_re�split�int�
ValueError�_ver_stages�get�extend)�version�result�v�t�r� /usr/lib64/python3.8/platform.py�_comparable_version�s
rsC(__libc_init)|(GLIBC_([0-9.]+))|(libc(_\w+)?\.so(?:\.(\d[0-9.]*))?)��@c
Cs�|dkrZz0t�d�}|jdd�}t|�dkr6t|�WSWntttfk
rRYnXtj	}t
}ttjd�rvtj�
|�}t|d���`}|�|�}d}	|	t|�k�r�d|ks�d	|kr�t�||	�}
nd}
|
r�|
��t|�k�r|�|�}|�r|t|	t|�d
�d�|}d}	q�|
�s�q�dd�|
��D�\}}
}}}}|�rF|�sFd
}n�|
�rx|dk�r`d}|}n||�||�k�r�|}n\|�r�|dk�r�d
}|�r�|�r�||�||�k�r�|}|�r�|t|�d�|k�r�||}|
��}	q�W5QRX||fS)N�CS_GNU_LIBC_VERSION�)�maxsplit��realpath�rbrslibcsGLIBCi�cSs"g|]}|dk	r|�d�n|�qS)N�latin1)�decode)�.0�srrr�
<listcomp>�s�zlibc_ver.<locals>.<listcomp>Zlibc�glibc)�os�confstrr�len�tuple�AttributeErrorr�OSError�sys�
executabler�hasattr�pathr"�open�read�_libc_search�search�end�max�groups)r1�librZ	chunksize�ver�parts�V�fZbinary�pos�m�chunkZlibcinitr)ZglibcversionZsoZthreadsZ	soversionrrr�libc_ver�s^


�

rCcCs`|�d�}|r|�|�zttttt|���}Wntk
rH|}YnXd�|dd��}|S)N�.�)r�append�list�map�strrr�join)r�build�lZstringsrrr�
_norm_version�s


rMz'(?:([\w ]+) ([\w.]+) .*\[.* ([\d.]+)\])��win32�win16�dosc	Cs�tj|kr|||fSddl}dD]R}z|j||jddd�}Wn0t|jfk
rl}zWY�q W5d}~XYq Xq~q |||fS|��}t�	|�}|dk	r�|�
�\}}}|ddkr�|dd�}|ddkr�|dd�}t|�}|||fS)Nr)r<zcommand /c verz
cmd /c verT)�stderr�text�shell���rD)r0�platform�
subprocess�check_output�DEVNULLr/�CalledProcessError�strip�_ver_output�matchr:rM)	�system�releaserZsupported_platformsrW�cmd�infoZwhyrArrr�_syscmd_vers0

�


rbZ2000ZXPZ
2003ServerZpost2003�Vista�7�8z8.1zpost8.1Z10Zpost10))�r)rfr�rfr!)rfN��r�rir�rir!�rirE�riN)rr)rNZ
2008ServerZ2008ServerR2Z
2012ServerZ2012ServerR2Zpost2012ServerR2)rgrhrjrkrlrmcCs
t�dkS)N)ZIoTUAPZ
NanoServerZWindowsCoreHeadlessZ	IoTEdgeOS)�
win32_editionrrrr�win32_is_iotOsroc
Cs�z.zddl}Wntk
r*ddl}YnXWntk
rBYnTXz<d}|�|j|�� }|�|d�dW5QR�WSQRXWntk
r�YnXdS)Nr�,SOFTWARE\Microsoft\Windows NT\CurrentVersionZ	EditionId)�winreg�ImportError�_winreg�	OpenKeyEx�HKEY_LOCAL_MACHINE�QueryValueExr/)rq�cvkey�keyrrrrnRs(rnc	Cs�zddlm}Wn tk
r0||||fYSX|�}z ttt�d�d��\}}}Wn,tk
r�|jpx|dd�\}}}YnXd�	|||�}t
�||f�p�t
�|df�p�|}|dd�||fk�rzd�	|j�}Wn8t
k
�r|dd�d	k�rd
|dd�}YnXt|dd�dk�rJt�||f��pHt�|df��pH|}z0zddl}	Wntk
�rvddl}	YnXWntk
�r�YnLXz2d}
|	�|	j|
��}|	�|d
�d}W5QRXWntk
�r�YnX||||fS)Nr)�getwindowsversionr!rDrEz{0}.{1}.{2}zSP{}�
z
Service Pack ZSPZproduct_typerpZCurrentType)r0ryrrrHrrbrrZplatform_version�format�_WIN32_CLIENT_RELEASESrZservice_pack_majorr.�getattr�_WIN32_SERVER_RELEASESrqrsrtrurvr/)r_r�csd�ptyperyZwinver�major�minorrKrqrwrxrrr�	win32_verdsR ����r�c	Cs�d}tj�|�sdSzddl}Wntk
r6YdSXt|d��}|�|�}W5QRX|d}d}t��j}|dkrzd}|||fS)Nz0/System/Library/CoreServices/SystemVersion.plistrr#ZProductVersion�rrr)ZppczPower MacintoshZPowerPC)	r*r3�exists�plistlibrrr4�load�uname�machine)�fnr�r?rr_�versioninfor�rrr�_mac_ver_xml�s
r�r�cCst�}|dk	r|S|||fS�N)r�)r_r�r�rarrr�mac_ver�sr�cCsHddlm}z|�|�}|dkr&|WS|WStk
rB|YSXdS)Nr)�System)�	java.langr�ZgetPropertyr.)�name�defaultr��valuerrr�
_java_getprop�s
r�cCs�zddl}Wn tk
r,||||fYSXtd|�}td|�}|\}}}td|�}td|�}td|�}|||f}|\}}	}
td|
�}
td|�}td	|	�}	||	|
f}||||fS)
Nrzjava.vendorzjava.versionzjava.vm.namezjava.vm.vendorzjava.vm.versionzjava.os.archzjava.os.namezjava.os.version)r�rrr�)r_�vendor�vminfo�osinfo�javaZvm_nameZ
vm_releaseZ	vm_vendor�os_name�
os_version�os_archrrr�java_ver�s"












r�cCs�|dkr�|dkr|||fS|�d�}|rlzt|d�}Wntk
rLYn X|d}t|�|d<d�|�}|dkrzd}q�d}n,|dkr�d	}|r�|d
}q�d}n|dkr�d
}|||fS)NZSunOS�5rDrrE�6ZSolarisZIRIX64ZIRIXz (64bit)�64bit�rOrP�Windows)rrrrIrJ)r^r_rrLr�rrr�system_alias�s.	



r�cGs�d�dd�tt|�D��}|�dd�}|�dd�}|�dd�}|�dd�}|�d	d�}|�d
d�}|�dd�}|�dd�}|�d
d�}|�dd�}||kr�q�|}q�|ddkr�|dd�}q�|S)N�-css|]}|��VqdSr�)r[)r&�xrrr�	<genexpr>(sz_platform.<locals>.<genexpr>� �_�/�\�:�;�"�(�)�unknownrz--rU)rJ�filterr,�replace)�argsrVZcleanedrrr�	_platform"s"r�cCsNzddl}Wntk
r$|YSXz
|��WStk
rH|YSXdS�Nr)�socketrrZgethostnamer/)r�r�rrr�_nodeBs

r�cCsBtj�|�}tj�|�r>tj�tj�tj�|�t�|���}q|Sr�)r*r3�abspath�islink�normpathrJ�dirname�readlink)�filepathrrr�_follow_symlinksQs�r�c	Cs\tjdkr|Sddl}z|jd|f|jdd�}Wnt|jfk
rN|YSX|��pZ|S)N�rQrOrPrr�T)rRrS)r0rVrWrXrYr/rZr[)Zoptionr�rW�outputrrr�
_syscmd_uname\s

�

r�c	Csztjdkr|Sddl}t|�}ttjdd�}z|jdd|g|j|d�}Wnt	|j
fk
rf|YSX|sp|S|�d�S)	Nr�r�C)�LC_ALL�filez-b)rR�envzlatin-1)r0rVrWr��dictr*�environrXrYr/rZr%)�targetr�rWr�r�rrr�_syscmd_filems	
�

r�)r�	WindowsPE)rr�)r�MSDOScCs|s&ddl}|�d�}t|d�d}|r6t|d�}nd}|sx|tjkrxtjtkrpttj\}}|rh|}|rp|}||fSd|kr�d|kr�||fSd|kr�d	}nd
|kr�d}nd|kr�d
}d|kr�d}n8d|kr�d|kr�d}q�d}nd|kr�d}nd|kr�d}n||fS)Nr�P��bitrr1z
shared objectz32-bit�32bitZN32Zn32bitz64-bitr�ZELFZPEr�r�ZCOFFzMS-DOSr�)�structZcalcsizerIr�r0r1rV�_default_architecture)r1�bits�linkager��sizeZfileoutr	rLrrr�architecture�sH
�
r��uname_resultz-system node release version machine processorcCs�d}tdk	rtSd}zt��\}}}}}Wntk
rBd}YnX|sbttd|||||f���s�|r~tj}d}d}t�}d}d}|dkr�t	�\}}}}	|r�|r�d}|s�dtj
kr�tj
�dd�}ntj
�dd�}|s�tj
�d|�}|�r:t|�\}}}|dk�rd	}n4|d
k�r:|d	k�r:d	}d|dd�k�r6d
}nd}|dk�rd|�s^|dk�rZd}nd}d	}n8|dd�dk�r�t
�\}}
}}d}d�|�}|�s�|
}|dk�r|�r�|dk�r�|}d}zddl}
Wntk
�r�Yn&X|
�dd�\}}|dk�rd}nd}|�stdd�}|dk�r$d}|dk�r2d}|dk�r@d}|dk�rNd}|dk�r\d}|dk�rjd}|d
k�r�|d	k�r�d	}d
}t||||||�atS)NrrrrOZPROCESSOR_ARCHITEW6432ZPROCESSOR_ARCHITECTUREZPROCESSOR_IDENTIFIERzMicrosoft Windowsr�Z	Microsoftz6.0rErcr�r�Z16bit�r��Javaz, ZOpenVMS�0zSYI$_CPU�ZAlphaZVAXz-pr�)�_uname_cacher*r�r.rGr�r0rVr�r�r�rrbr�rJ�vms_librrZgetsyir�r�)Zno_os_uname�	processorr^�noder_rr�Zuse_syscmd_verrr�r�r�r�r�ZcsidZ
cpu_numberrrrr��s�
















�r�cCst�jSr�)r�r^rrrrr^usr^cCst�jSr�)r�r�rrrrr�~sr�cCst�jSr�)r�r_rrrrr_�sr_cCst�jSr�)r�rrrrrr�srcCst�jSr�)r�r�rrrrr��sr�cCst�jSr�)r�r�rrrrr��s
r�zL([\w.+]+)\s*\(#?([^,]+)(?:,\s*([\w ]*)(?:,\s*([\w :]*))?)?\)\s*\[([^\]]+)\]?z;IronPython\s*([\d\.]+)(?: \(([\d\.]+)\))? on (.NET [\d\.]+)zU([\d.]+)\s*\(IronPython\s*[\d.]+\s*\(([\d.]+)\) on ([\w.]+ [\d.]+(?: \(\d+-bit\))?)\)zE([\w.+]+)\s*\(#?([^,]+),\s*([\w ]+),\s*([\w :]+)\)\s*\[PyPy [^\]]+\]?cCs|dkrtj}t�|d�}|dk	r&|Sd|kr�d}|�d�rHt�|�}n
t�|�}|dkrjtdt	|���|�
�\}}}d}d}n�tj�d�r�d}t�|�}|dkr�tdt	|���|�
�\}}}}	}
|dkr�d}tj}n�d|k�r"d}t
�|�}|dk�rtdt	|���|�
�\}}}}	d}n\t�|�}|dk�rFtd	t	|���|�
�\}}}}	}d
}|dk�rld}n|	�r~|d|	}ttd��r�tj\}
}}n"ttd
��r�tj\}
}}nd}d}|�d�}
t|
�dk�r�|
�d�d�|
�}|||||||f}|t|<|S)NZ
IronPythonz*failed to parse IronPython sys.version: %srr�ZJythonz&failed to parse Jython sys.version: %sZPyPyz$failed to parse PyPy sys.version: %sz'failed to parse CPython sys.version: %sZCPythonr��_git�
_mercurialrDr!r�)r0r�_sys_version_cacher�
startswith�_ironpython_sys_version_parserr]� _ironpython26_sys_version_parserr�reprr:rV�_sys_version_parser�_pypy_sys_version_parserr2r�r�rr,rFrJ)�sys_versionrr�r]rZalt_versionZcompilerZbuildnoZ	builddateZ	buildtimer��branchZrevisionrLrrr�_sys_version�s�

��
��


�

���



r�cCs
t�dSr��r�rrrr�python_implementation5sr�cCs
t�dS)Nrr�rrrr�python_versionBsr�cCstt�d�d��S)NrrD)r-r�rrrrr�python_version_tupleLs	r�cCs
t�dS)Nr!r�rrrr�
python_branchWsr�cCs
t�dS)NrEr�rrrr�python_revisionesr�cCst�dd�S)Nr�rir�rrrr�python_buildrsr�cCs
t�dS)Nrir�rrrr�python_compilerzsr�cCsbt�||fd�}|dk	r|St�\}}}}}}||kr:d}|rPt|||�\}}}|dkrnt�d}	|	rnd}|	}|dkr�t|�\}
}}}
|r�t||�}nt||||�}n�|dkr�ttj	�\}}t||||d||�}n~|dk�r t
�\}}}\}}}|s�|�s
t|||�}nt|||d	|||�}n2|�r2t||�}n ttj	�\}}t||||||�}|t||f<|S)
NrZDarwinrZmacOSr�)ZLinux�withr�Zon)�_platform_cacherr�r�r�r�r�rCr0r1r�r�)�aliased�terserr^r�r_rr�r�Z
macos_releaseZrelZversrr�rVZlibcnameZlibcversion�rrr�r�r�r�r�r�rrrrV�sX

�

��rV�__main__r�z--terseZ
nonaliasedz--nonaliased)Nrrr)r)rrrrN)rrrr)rr�r)rrr�r�)r)r)r)N)rr)AZ
__copyright__�__version__�collectionsr*�rer0r�compilerr�ASCIIr6rCrMr\rbr|r~rornr�r�r�r�r�r�r�r�r�r�r�r�r1r��
namedtupler�r�r�r^r�r_rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rV�__name__�argvr�r��print�exitrrrr�<module>\s�
�
�
G


�
1��

3

#4 


$�P�	
			����
h




L
__pycache__/_compat_pickle.cpython-38.opt-1.pyc000064400000012505151153537600015325 0ustar00U

e5d-"�+@s�dddddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*�*Zd+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdL�!ZdMZzeWnek
r�Yn
XedN7ZeD]ZdefedOef<q�dPZeD]ZdQefedRef<q�edSdT�e��D��Z	edUdT�e��D��Z
e�dVdWdddd"d"dXdXdXd(dYdYdZ�
�e	�d[d(d\d]dVd^��e�d/d_d6d`da��e
�dbdcdddedfdgdhdidjdkdldmdndo�
�dpZeD]Zdqe
def<�q�drZ
e
D]Zdse
def<�q�dtS)u�builtins�copyregZqueueZsocketserverZconfigparser�reprlib�tkinter.filedialog�tkinter.simpledialogztkinter.colorchooserztkinter.commondialogztkinter.dialogztkinter.dndztkinter.fontztkinter.messageboxztkinter.scrolledtextztkinter.constantsztkinter.tixztkinter.ttkZtkinterZ_markupbase�winreg�_threadZ
_dummy_threadzdbm.bsdzdbm.dumbzdbm.ndbmzdbm.gnuz
xmlrpc.client�
xmlrpc.serverzhttp.clientz
html.entitieszhtml.parserzhttp.cookieszhttp.cookiejar�http.serverztest.support�
subprocess�urllib.parsezurllib.robotparser�urllib.request�dbmzcollections.abc)*�__builtin__Zcopy_regZQueueZSocketServerZConfigParser�reprZtkFileDialogZtkSimpleDialogZtkColorChooserZtkCommonDialogZDialogZTkdndZtkFontZtkMessageBoxZScrolledTextZTkconstantsZTixZttkZTkinterZ
markupbase�_winreg�threadZdummy_threadZdbhashZdumbdbmr
�gdbmZ	xmlrpclibZSimpleXMLRPCServerZhttplibZhtmlentitydefsZ
HTMLParserZCookieZ	cookielibZBaseHTTPServerztest.test_supportZcommandsZurlparseZrobotparser�urllib2ZanydbmZ_abcoll)r�range)�	functools�reduce)�sys�intern)r�chr)r�str)r�int)r�zip)r�map)r�filter)�	itertools�filterfalse)r�zip_longest)�collections�UserDict)r"�UserList)r"�
UserString)r
�whichdb)�socket�fromfd)zmultiprocessing.connection�
Connection)�multiprocessing.context�Process)zmultiprocessing.popen_fork�Popen)�urllib.error�ContentTooShortError)r�
getproxies)r�pathname2url)r�
quote_plus)r�quote)r�unquote_plus)r�unquote)r�url2pathname)r�
urlcleanup)r�	urlencode)r�urlopen)r�urlretrieve)r-�	HTTPError)r-�URLError)!)rZxrange�rr)rr)rZunichr)rZunicode)rZlong)rZizip)rZimap)rZifilter)rZifilterfalse)rZizip_longest)r#ZIterableUserDict)r$r$)r%r%)r&r&)�_socketr()Z_multiprocessingr))zmultiprocessing.processr+)zmultiprocessing.forkingr,)�urllibr.)r>r/)r>r0)r>r1)r>r2)r>r3)r>r4)r>r5)r>r6)r>r7)r>r8)r>r9)rr:)rr;)/�ArithmeticError�AssertionError�AttributeError�
BaseException�BufferError�BytesWarning�DeprecationWarning�EOFError�EnvironmentError�	Exception�FloatingPointError�
FutureWarning�
GeneratorExit�IOError�ImportError�
ImportWarning�IndentationError�
IndexError�KeyError�KeyboardInterrupt�LookupError�MemoryError�	NameError�NotImplementedError�OSError�
OverflowError�PendingDeprecationWarning�ReferenceError�RuntimeError�RuntimeWarning�
StopIteration�SyntaxError�
SyntaxWarning�SystemError�
SystemExit�TabError�	TypeError�UnboundLocalError�UnicodeDecodeError�UnicodeEncodeError�UnicodeError�UnicodeTranslateError�UnicodeWarning�UserWarning�
ValueError�Warning�ZeroDivisionError)�WindowsError�
exceptions)ZAuthenticationErrorZBufferTooShortZProcessError�TimeoutErrorr*Zmultiprocessingccs|]\}}||fVqdS�N���.0�k�vrrrr�&/usr/lib64/python3.8/_compat_pickle.py�	<genexpr>�srxccs|]\}}||fVqdSrqrrrsrrrrrwrx�s�picklezxml.etree.ElementTreer"�io)
ZcPickleZ_elementtree�
FileDialog�SimpleDialog�DocXMLRPCServer�SimpleHTTPServer�
CGIHTTPServerr#r$r%r&�StringIOZ	cStringIO�bz2rr)Z_bz2Z_dbm�
_functoolsZ_gdbm�_pickle)rrH)r'Z
SocketType))rZ
basestring)roZ
StandardError)r#r#�r'Z
_socketobjectr<)r{r{)r{�LoadFileDialog)r{�SaveFileDialog)r|r|)r}�
ServerHTMLDoc)r}�XMLRPCDocGenerator)r}�DocXMLRPCRequestHandler)r}r})r}�DocCGIXMLRPCRequestHandler)r~�SimpleHTTPRequestHandler)r�CGIHTTPRequestHandlerr�)
)r�r)rr{)rr�)rr�)rr|)rr�)rr�)rr�)rr})rr�)r	r�)r	r�)r=r')�BrokenPipeError�ChildProcessError�ConnectionAbortedError�ConnectionError�ConnectionRefusedError�ConnectionResetError�FileExistsError�FileNotFoundError�InterruptedError�IsADirectoryError�NotADirectoryError�PermissionError�ProcessLookupErrorrp)rorW)�ModuleNotFoundError)rorMN)ZIMPORT_MAPPINGZNAME_MAPPINGZPYTHON2_EXCEPTIONSrnrUZexcnameZMULTIPROCESSING_EXCEPTIONS�dict�itemsZREVERSE_IMPORT_MAPPINGZREVERSE_NAME_MAPPING�updateZPYTHON3_OSERROR_EXCEPTIONSZPYTHON3_IMPORTERROR_EXCEPTIONSrrrrrrrw�<module>	s�2�$3����__pycache__/bz2.cpython-38.opt-2.pyc000064400000014365151153537600013060 0ustar00U

e5d1�@s�ddddddgZdZddlmZdd	lZdd	lZdd	lZdd	lZdd
l	m
Z
ddlmZm
Z
dZdZd
Ze�ZGdd�dej�Zddd�Zddd�Zdd�Zd	S)�BZ2File�
BZ2Compressor�BZ2Decompressor�open�compress�
decompressz%Nadeem Vawda <nadeem.vawda@gmail.com>�)rN)�RLock)rr��c@s�eZdZdedfdd�Zdd�Zedd��Zd	d
�Zdd�Z	d
d�Z
dd�Zd(dd�Zd)dd�Z
d*dd�Zdd�Zd+dd�Zd,dd�Zdd �Zd!d"�Zejfd#d$�Zd%d&�Zd'S)-r�r�	cCsTt�|_d|_d|_t|_|tk	r2tjdt	dd�d|krFdksPnt
d��|dkrbd	}t}nb|d
kr~d}t}t
|�|_nF|dkr�d
}t}t
|�|_n*|dkr�d}t}t
|�|_nt
d|f��t|tttjf�r�t||�|_d|_||_n.t|d��st|d��r||_||_ntd��|jtk�rJtj|jttd�}t�|�|_nd|_dS)NFzGUse of 'buffering' argument is deprecated and ignored since Python 3.0.�)�
stacklevelr	rz%compresslevel must be between 1 and 9)�r�rbr)�w�wbr)�x�xbr)�a�abr�Invalid mode: %rT�read�writez6filename must be a str, bytes, file or PathLike object)Ztrailing_errorr)r�_lock�_fp�_closefp�_MODE_CLOSED�_mode�	_sentinel�warnings�warn�DeprecationWarning�
ValueError�
_MODE_READ�_MODE_WRITEr�_compressor�
isinstance�str�bytes�os�PathLike�
_builtin_open�hasattr�	TypeError�_compressionZDecompressReaderr�OSError�io�BufferedReader�_buffer�_pos)�self�filename�mode�	buffering�
compresslevelZ	mode_code�raw�r;�/usr/lib64/python3.8/bz2.py�__init__)sT��zBZ2File.__init__cCs�|j��|jtkr W5QR�dSz<|jtkr8|j��n"|jtkrZ|j�	|j
���d|_
W5z|jrp|j��W5d|_d|_t|_d|_XXW5QRXdS)NF)rrrrrr3�closer$r%rr&�flush�r5r;r;r<r>ps 



z
BZ2File.closecCs
|jtkS�N)rrr@r;r;r<�closed�szBZ2File.closedcCs|��|j��SrA)�_check_not_closedr�filenor@r;r;r<rD�szBZ2File.filenocCs|��o|j��SrA)�readabler3�seekabler@r;r;r<rF�szBZ2File.seekablecCs|��|jtkSrA)rCrr$r@r;r;r<rE�szBZ2File.readablecCs|��|jtkSrA)rCrr%r@r;r;r<�writable�szBZ2File.writablerc
Cs2|j�"|��|j�|�W5QR�SQRXdSrA)r�_check_can_readr3�peek)r5�nr;r;r<rI�szBZ2File.peek���c
Cs2|j�"|��|j�|�W5QR�SQRXdSrA)rrHr3r�r5�sizer;r;r<r�szBZ2File.readc
Cs@|j�0|��|dkrtj}|j�|�W5QR�SQRXdS)Nr)rrHr1�DEFAULT_BUFFER_SIZEr3�read1rLr;r;r<rO�s
z
BZ2File.read1c
Cs2|j�"|��|j�|�W5QR�SQRXdSrA)rrHr3�readinto)r5�br;r;r<rP�szBZ2File.readintoc
CsVt|t�s$t|d�std��|��}|j�"|��|j�|�W5QR�SQRXdS�N�	__index__zInteger argument expected)	r'�intr-r.rSrrHr3�readlinerLr;r;r<rU�s

zBZ2File.readlinec
CsVt|t�s$t|d�std��|��}|j�"|��|j�|�W5QR�SQRXdSrR)	r'rTr-r.rSrrHr3�	readlinesrLr;r;r<rV�s

zBZ2File.readlinesc
CsX|j�H|��|j�|�}|j�|�|jt|�7_t|�W5QR�SQRXdSrA)rZ_check_can_writer&rrrr4�len)r5�dataZ
compressedr;r;r<r�sz
BZ2File.writec
Cs,|j�tj�||�W5QR�SQRXdSrA)rr/�
BaseStream�
writelines)r5�seqr;r;r<rZ�szBZ2File.writelinesc
Cs4|j�$|��|j�||�W5QR�SQRXdSrA)rZ_check_can_seekr3�seek)r5�offset�whencer;r;r<r\szBZ2File.seekc
CsL|j�<|��|jtkr0|j��W5QR�S|jW5QR�SQRXdSrA)rrCrr$r3�tellr4r@r;r;r<r_s

zBZ2File.tellN)r)rK)rK)rK)rK)�__name__�
__module__�__qualname__rr=r>�propertyrBrDrFrErGrIrrOrPrUrVrrZr1�SEEK_SETr\r_r;r;r;r<rs$G





	

rrcCs�d|kr d|krPtd|f��n0|dk	r0td��|dk	r@td��|dk	rPtd��|�dd�}t|||d�}d|kr�t�||||�S|SdS)	N�trQrz0Argument 'encoding' not supported in binary modez.Argument 'errors' not supported in binary modez/Argument 'newline' not supported in binary moder)r9)r#�replacerr1�
TextIOWrapper)r6r7r9�encoding�errors�newlineZbz_modeZbinary_filer;r;r<r!scCst|�}|�|�|��SrA)rrr?)rXr9�compr;r;r<rJscCshg}|r^t�}z|�|�}Wn tk
r<|r6Yq^n�YnX|�|�|jsVtd��|j}qd�|�S)NzACompressed data ended before the end-of-stream marker was reached�)rrr0�append�eofr#Zunused_data�join)rXZresultsZdecomp�resr;r;r<rUs
)rrNNN)r)�__all__�
__author__�builtinsrr,r1r*r r/Z	threadingrZ_bz2rrrr$r%�objectrrYrrrr;r;r;r<�<module>s4��
)
__pycache__/glob.cpython-38.opt-1.pyc000064400000010270151153537600013274 0ustar00U

e5dA�@s�dZddlZddlZddlZddlZdddgZdd�dd�Zdd�d	d�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Ze�d�Ze�d�Zdd�Zdd�Zd d!�Zd"d�ZdS)#zFilename globbing utility.�N�glob�iglob�escapeF��	recursivecCstt||d��S)ayReturn a list of paths matching a pathname pattern.

    The pattern may contain simple shell-style wildcards a la
    fnmatch. However, unlike fnmatch, filenames starting with a
    dot are special cases that are not matched by '*' and '?'
    patterns.

    If recursive is true, the pattern '**' will match any files and
    zero or more directories and subdirectories.
    r)�listr)�pathnamer�r	�/usr/lib64/python3.8/glob.pyr
scCs2t�d||�t||d�}|r.t|�r.t|�}|S)a�Return an iterator which yields the paths matching a pathname pattern.

    The pattern may contain simple shell-style wildcards a la
    fnmatch. However, unlike fnmatch, filenames starting with a
    dot are special cases that are not matched by '*' and '?'
    patterns.

    If recursive is true, the pattern '**' will match any files and
    zero or more directories and subdirectories.
    z	glob.globF)�sys�audit�_iglob�_isrecursive�next)rr�it�sr	r	r
rs
ccs�tj�|�\}}t|�sF|r0tj�|�rB|Vntj�|�rB|VdS|s�|rjt|�rjt|||�EdHnt|||�EdHdS||kr�t|�r�t	||d�}n|g}t|�r�|r�t|�r�t}q�t}nt
}|D]&}||||�D]}tj�||�Vq�q�dS)NT)�os�path�split�	has_magic�lexists�isdirr�_glob2�_glob1r
�_glob0�join)rr�dironly�dirname�basename�dirsZglob_in_dir�namer	r	r
r
)s0r
cCs0tt||��}t|�s$dd�|D�}t�||�S)Ncss|]}t|�s|VqdS�N)�	_ishidden)�.0�xr	r	r
�	<genexpr>Tsz_glob1.<locals>.<genexpr>)r�_iterdirr"�fnmatch�filter)r�patternr�namesr	r	r
rQsrcCs8|stj�|�r4|gSntj�tj�||��r4|gSgSr!)rrrrr)rrrr	r	r
rWsrcCst||d�S�NF)r�rr)r	r	r
�glob0dsr-cCst||d�Sr+)rr,r	r	r
�glob1gsr.ccs"|dd�Vt||�EdHdS)Nr)�	_rlistdir)rr)rr	r	r
rmsrc
cs�|s"t|t�rttjd�}ntj}zRt�|��>}|D]2}z|rF|��rN|jVWq4tk
rdYq4Xq4W5QRXWntk
r�YdSXdS)N�ASCII)�
isinstance�bytesr�curdir�scandir�is_dirr �OSError)rrr�entryr	r	r
r&ts
r&ccs`tt||��}|D]H}t|�s|V|r6tj�||�n|}t||�D]}tj�||�VqDqdSr!)rr&r"rrrr/)rrr*r$r�yr	r	r
r/�sr/z([*?[])s([*?[])cCs(t|t�rt�|�}n
t�|�}|dk	Sr!)r1r2�magic_check_bytes�search�magic_check)r�matchr	r	r
r�s

rcCs|ddkS)Nr)�.�.r	)rr	r	r
r"�sr"cCst|t�r|dkS|dkSdS)Ns**z**)r1r2)r)r	r	r
r�s
rcCs<tj�|�\}}t|t�r(t�d|�}nt�d|�}||S)z#Escape all special characters.
    s[\1]z[\1])rr�
splitdriver1r2r9�subr;)rZdriver	r	r
r�s

)�__doc__r�rer'r�__all__rrr
rrr-r.rr&r/�compiler;r9rr"rrr	r	r	r
�<module>s*

(



__pycache__/difflib.cpython-38.pyc000064400000164060151153537600013020 0ustar00U

e5dZH�@s8dZddddddddd	d
ddgZd
dlmZd
dlmZedd�Zdd�Z	Gdd�d�Z
d8dd�Zdd�ZGdd�d�Z
d
dlZe�d�jfdd�Zd9dd�Zdd �Zd:d#d	�Zd$d%�Zd;d&d�Zd'd(�Zd<d+d
�Zdefd,d�Zddefd-d.�Zd/Zd0Zd1Zd2ZGd3d�de�Z [d4d�Z!d5d6�Z"e#d7k�r4e"�dS)=ae
Module difflib -- helpers for computing deltas between objects.

Function get_close_matches(word, possibilities, n=3, cutoff=0.6):
    Use SequenceMatcher to return list of the best "good enough" matches.

Function context_diff(a, b):
    For two lists of strings, return a delta in context diff format.

Function ndiff(a, b):
    Return a delta: the difference between `a` and `b` (lists of strings).

Function restore(delta, which):
    Return one of the two sequences that generated an ndiff delta.

Function unified_diff(a, b):
    For two lists of strings, return a delta in unified diff format.

Class SequenceMatcher:
    A flexible class for comparing pairs of sequences of any type.

Class Differ:
    For producing human-readable deltas from sequences of lines of text.

Class HtmlDiff:
    For producing HTML side by side comparison with change highlights.
�get_close_matches�ndiff�restore�SequenceMatcher�Differ�IS_CHARACTER_JUNK�IS_LINE_JUNK�context_diff�unified_diff�
diff_bytes�HtmlDiff�Match�)�nlargest)�
namedtupleza b sizecCs|rd||SdS)Ng@��?�)�matches�lengthrr�/usr/lib64/python3.8/difflib.py�_calculate_ratio&src@steZdZdZddd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zddd�Zdd�Z
dd�Zdd�ZdS) ra�
    SequenceMatcher is a flexible class for comparing pairs of sequences of
    any type, so long as the sequence elements are hashable.  The basic
    algorithm predates, and is a little fancier than, an algorithm
    published in the late 1980's by Ratcliff and Obershelp under the
    hyperbolic name "gestalt pattern matching".  The basic idea is to find
    the longest contiguous matching subsequence that contains no "junk"
    elements (R-O doesn't address junk).  The same idea is then applied
    recursively to the pieces of the sequences to the left and to the right
    of the matching subsequence.  This does not yield minimal edit
    sequences, but does tend to yield matches that "look right" to people.

    SequenceMatcher tries to compute a "human-friendly diff" between two
    sequences.  Unlike e.g. UNIX(tm) diff, the fundamental notion is the
    longest *contiguous* & junk-free matching subsequence.  That's what
    catches peoples' eyes.  The Windows(tm) windiff has another interesting
    notion, pairing up elements that appear uniquely in each sequence.
    That, and the method here, appear to yield more intuitive difference
    reports than does diff.  This method appears to be the least vulnerable
    to synching up on blocks of "junk lines", though (like blank lines in
    ordinary text files, or maybe "<P>" lines in HTML files).  That may be
    because this is the only method of the 3 that has a *concept* of
    "junk" <wink>.

    Example, comparing two strings, and considering blanks to be "junk":

    >>> s = SequenceMatcher(lambda x: x == " ",
    ...                     "private Thread currentThread;",
    ...                     "private volatile Thread currentThread;")
    >>>

    .ratio() returns a float in [0, 1], measuring the "similarity" of the
    sequences.  As a rule of thumb, a .ratio() value over 0.6 means the
    sequences are close matches:

    >>> print(round(s.ratio(), 3))
    0.866
    >>>

    If you're only interested in where the sequences match,
    .get_matching_blocks() is handy:

    >>> for block in s.get_matching_blocks():
    ...     print("a[%d] and b[%d] match for %d elements" % block)
    a[0] and b[0] match for 8 elements
    a[8] and b[17] match for 21 elements
    a[29] and b[38] match for 0 elements

    Note that the last tuple returned by .get_matching_blocks() is always a
    dummy, (len(a), len(b), 0), and this is the only case in which the last
    tuple element (number of elements matched) is 0.

    If you want to know how to change the first sequence into the second,
    use .get_opcodes():

    >>> for opcode in s.get_opcodes():
    ...     print("%6s a[%d:%d] b[%d:%d]" % opcode)
     equal a[0:8] b[0:8]
    insert a[8:8] b[8:17]
     equal a[8:29] b[17:38]

    See the Differ class for a fancy human-friendly file differencer, which
    uses SequenceMatcher both to compare sequences of lines, and to compare
    sequences of characters within similar (near-matching) lines.

    See also function get_close_matches() in this module, which shows how
    simple code building on SequenceMatcher can be used to do useful work.

    Timing:  Basic R-O is cubic time worst case and quadratic time expected
    case.  SequenceMatcher is quadratic time for the worst case and has
    expected-case behavior dependent in a complicated way on how many
    elements the sequences have in common; best case time is linear.

    Methods:

    __init__(isjunk=None, a='', b='')
        Construct a SequenceMatcher.

    set_seqs(a, b)
        Set the two sequences to be compared.

    set_seq1(a)
        Set the first sequence to be compared.

    set_seq2(b)
        Set the second sequence to be compared.

    find_longest_match(alo, ahi, blo, bhi)
        Find longest matching block in a[alo:ahi] and b[blo:bhi].

    get_matching_blocks()
        Return list of triples describing matching subsequences.

    get_opcodes()
        Return list of 5-tuples describing how to turn a into b.

    ratio()
        Return a measure of the sequences' similarity (float in [0,1]).

    quick_ratio()
        Return an upper bound on .ratio() relatively quickly.

    real_quick_ratio()
        Return an upper bound on ratio() very quickly.
    N�TcCs(||_d|_|_||_|�||�dS)a!Construct a SequenceMatcher.

        Optional arg isjunk is None (the default), or a one-argument
        function that takes a sequence element and returns true iff the
        element is junk.  None is equivalent to passing "lambda x: 0", i.e.
        no elements are considered to be junk.  For example, pass
            lambda x: x in " \t"
        if you're comparing lines as sequences of characters, and don't
        want to synch up on blanks or hard tabs.

        Optional arg a is the first of two sequences to be compared.  By
        default, an empty string.  The elements of a must be hashable.  See
        also .set_seqs() and .set_seq1().

        Optional arg b is the second of two sequences to be compared.  By
        default, an empty string.  The elements of b must be hashable. See
        also .set_seqs() and .set_seq2().

        Optional arg autojunk should be set to False to disable the
        "automatic junk heuristic" that treats popular elements as junk
        (see module documentation for more information).
        N)�isjunk�a�b�autojunk�set_seqs)�selfrrrrrrr�__init__�s;zSequenceMatcher.__init__cCs|�|�|�|�dS)z�Set the two sequences to be compared.

        >>> s = SequenceMatcher()
        >>> s.set_seqs("abcd", "bcde")
        >>> s.ratio()
        0.75
        N)�set_seq1�set_seq2)rrrrrrr�s	
zSequenceMatcher.set_seqscCs$||jkrdS||_d|_|_dS)aMSet the first sequence to be compared.

        The second sequence to be compared is not changed.

        >>> s = SequenceMatcher(None, "abcd", "bcde")
        >>> s.ratio()
        0.75
        >>> s.set_seq1("bcde")
        >>> s.ratio()
        1.0
        >>>

        SequenceMatcher computes and caches detailed information about the
        second sequence, so if you want to compare one sequence S against
        many sequences, use .set_seq2(S) once and call .set_seq1(x)
        repeatedly for each of the other sequences.

        See also set_seqs() and set_seq2().
        N)r�matching_blocks�opcodes)rrrrrr�s
zSequenceMatcher.set_seq1cCs2||jkrdS||_d|_|_d|_|��dS)aMSet the second sequence to be compared.

        The first sequence to be compared is not changed.

        >>> s = SequenceMatcher(None, "abcd", "bcde")
        >>> s.ratio()
        0.75
        >>> s.set_seq2("abcd")
        >>> s.ratio()
        1.0
        >>>

        SequenceMatcher computes and caches detailed information about the
        second sequence, so if you want to compare one sequence S against
        many sequences, use .set_seq2(S) once and call .set_seq1(x)
        repeatedly for each of the other sequences.

        See also set_seqs() and set_seq1().
        N)rr r!�
fullbcount�_SequenceMatcher__chain_b)rrrrrr�s
zSequenceMatcher.set_seq2cCs�|j}i|_}t|�D]\}}|�|g�}|�|�qt�|_}|j}|r~|��D]}||�rV|�	|�qV|D]
}||=qrt�|_
}t|�}	|jr�|	dkr�|	dd}
|�
�D]\}}t|�|
kr�|�	|�q�|D]
}||=q�dS)N���d�)r�b2j�	enumerate�
setdefault�append�set�bjunkr�keys�addZbpopular�lenr�items)rrr'�i�elt�indicesZjunkrZpopular�nZntestZidxsrrrZ	__chain_b)s,
zSequenceMatcher.__chain_bcCs4|j|j|j|jjf\}}}}||d}	}
}i}g}
t||�D]�}|j}i}|�|||
�D]\}||krlq^||krxq�||dd�d}||<||kr^||d||d|}	}
}q^|}q@|	|k�r |
|k�r |||
d��s ||	d||
dk�r |	d|
d|d}	}
}q�|	||k�rt|
||k�rt|||
|��st||	|||
|k�rt|d7}�q |	|k�r�|
|k�r�|||
d��r�||	d||
dk�r�|	d|
d|d}	}
}�qt|	||k�r(|
||k�r(|||
|��r(||	|||
|k�r(|d}�q�t|	|
|�S)a�Find longest matching block in a[alo:ahi] and b[blo:bhi].

        If isjunk is not defined:

        Return (i,j,k) such that a[i:i+k] is equal to b[j:j+k], where
            alo <= i <= i+k <= ahi
            blo <= j <= j+k <= bhi
        and for all (i',j',k') meeting those conditions,
            k >= k'
            i <= i'
            and if i == i', j <= j'

        In other words, of all maximal matching blocks, return one that
        starts earliest in a, and of all those maximal matching blocks that
        start earliest in a, return the one that starts earliest in b.

        >>> s = SequenceMatcher(None, " abcd", "abcd abcd")
        >>> s.find_longest_match(0, 5, 0, 9)
        Match(a=0, b=4, size=5)

        If isjunk is defined, first the longest matching block is
        determined as above, but with the additional restriction that no
        junk element appears in the block.  Then that block is extended as
        far as possible by matching (only) junk elements on both sides.  So
        the resulting block never matches on junk except as identical junk
        happens to be adjacent to an "interesting" match.

        Here's the same example as before, but considering blanks to be
        junk.  That prevents " abcd" from matching the " abcd" at the tail
        end of the second sequence directly.  Instead only the "abcd" can
        match, and matches the leftmost "abcd" in the second sequence:

        >>> s = SequenceMatcher(lambda x: x==" ", " abcd", "abcd abcd")
        >>> s.find_longest_match(0, 5, 0, 9)
        Match(a=1, b=0, size=4)

        If no blocks match, return (alo, blo, 0).

        >>> s = SequenceMatcher(None, "ab", "c")
        >>> s.find_longest_match(0, 2, 0, 1)
        Match(a=0, b=0, size=0)
        r
r&)rrr'r,�__contains__�range�getr)r�alo�ahi�blo�bhirrr'ZisbjunkZbestiZbestjZbestsizeZj2lenZnothingr1Zj2lengetZnewj2len�j�krrr�find_longest_matchPsR8"����	�� ��z"SequenceMatcher.find_longest_matchcCs||jdk	r|jSt|j�t|j�}}d|d|fg}g}|r�|��\}}}}|�||||�\}	}
}}|r8|�|�||	kr�||
kr�|�||	||
f�|	||kr8|
||kr8|�|	|||
||f�q8|��d}
}}g}|D]V\}}}|
||k�r|||k�r||7}q�|�r,|�|
||f�|||}
}}q�|�rT|�|
||f�|�||df�tt	t
j|��|_|jS)aReturn list of triples describing matching subsequences.

        Each triple is of the form (i, j, n), and means that
        a[i:i+n] == b[j:j+n].  The triples are monotonically increasing in
        i and in j.  New in Python 2.5, it's also guaranteed that if
        (i, j, n) and (i', j', n') are adjacent triples in the list, and
        the second is not the last triple in the list, then i+n != i' or
        j+n != j'.  IOW, adjacent triples never describe adjacent equal
        blocks.

        The last triple is a dummy, (len(a), len(b), 0), and is the only
        triple with n==0.

        >>> s = SequenceMatcher(None, "abxcd", "abcd")
        >>> list(s.get_matching_blocks())
        [Match(a=0, b=0, size=2), Match(a=3, b=2, size=2), Match(a=5, b=4, size=0)]
        Nr
)r r/rr�popr>r*�sort�list�mapr�_make)r�la�lbZqueuer r8r9r:r;r1r<r=�x�i1�j1Zk1Znon_adjacent�i2�j2Zk2rrr�get_matching_blocks�s8


z#SequenceMatcher.get_matching_blockscCs�|jdk	r|jSd}}g|_}|��D]�\}}}d}||krN||krNd}n||kr\d}n||krhd}|r�|�|||||f�||||}}|r*|�d||||f�q*|S)a[Return list of 5-tuples describing how to turn a into b.

        Each tuple is of the form (tag, i1, i2, j1, j2).  The first tuple
        has i1 == j1 == 0, and remaining tuples have i1 == the i2 from the
        tuple preceding it, and likewise for j1 == the previous j2.

        The tags are strings, with these meanings:

        'replace':  a[i1:i2] should be replaced by b[j1:j2]
        'delete':   a[i1:i2] should be deleted.
                    Note that j1==j2 in this case.
        'insert':   b[j1:j2] should be inserted at a[i1:i1].
                    Note that i1==i2 in this case.
        'equal':    a[i1:i2] == b[j1:j2]

        >>> a = "qabxcd"
        >>> b = "abycdf"
        >>> s = SequenceMatcher(None, a, b)
        >>> for tag, i1, i2, j1, j2 in s.get_opcodes():
        ...    print(("%7s a[%d:%d] (%s) b[%d:%d] (%s)" %
        ...           (tag, i1, i2, a[i1:i2], j1, j2, b[j1:j2])))
         delete a[0:1] (q) b[0:0] ()
          equal a[1:3] (ab) b[0:2] (ab)
        replace a[3:4] (x) b[2:3] (y)
          equal a[4:6] (cd) b[3:5] (cd)
         insert a[6:6] () b[5:6] (f)
        Nr
r�replace�delete�insert�equal)r!rKr*)rr1r<Zanswer�ai�bj�size�tagrrr�get_opcodess$

zSequenceMatcher.get_opcodes�c
csn|��}|sdg}|dddkrZ|d\}}}}}|t|||�|t|||�|f|d<|dddkr�|d\}}}}}||t|||�|t|||�f|d<||}g}	|D]�\}}}}}|dk�r(|||k�r(|	�||t|||�|t|||�f�|	Vg}	t|||�t|||�}}|	�|||||f�q�|	�rjt|	�dk�rd|	dddk�sj|	VdS)a� Isolate change clusters by eliminating ranges with no changes.

        Return a generator of groups with up to n lines of context.
        Each group is in the same format as returned by get_opcodes().

        >>> from pprint import pprint
        >>> a = list(map(str, range(1,40)))
        >>> b = a[:]
        >>> b[8:8] = ['i']     # Make an insertion
        >>> b[20] += 'x'       # Make a replacement
        >>> b[23:28] = []      # Make a deletion
        >>> b[30] += 'y'       # Make another replacement
        >>> pprint(list(SequenceMatcher(None,a,b).get_grouped_opcodes()))
        [[('equal', 5, 8, 5, 8), ('insert', 8, 8, 8, 9), ('equal', 8, 11, 9, 12)],
         [('equal', 16, 19, 17, 20),
          ('replace', 19, 20, 20, 21),
          ('equal', 20, 22, 21, 23),
          ('delete', 22, 27, 23, 23),
          ('equal', 27, 30, 23, 26)],
         [('equal', 31, 34, 27, 30),
          ('replace', 34, 35, 30, 31),
          ('equal', 35, 38, 31, 34)]]
        )rOr
r&r
r&r
rO���r&N)rT�max�minr*r/)
rr4ZcodesrSrGrIrHrJZnn�grouprrr�get_grouped_opcodes<s(&&(&z#SequenceMatcher.get_grouped_opcodescCs0tdd�|��D��}t|t|j�t|j��S)a�Return a measure of the sequences' similarity (float in [0,1]).

        Where T is the total number of elements in both sequences, and
        M is the number of matches, this is 2.0*M / T.
        Note that this is 1 if the sequences are identical, and 0 if
        they have nothing in common.

        .ratio() is expensive to compute if you haven't already computed
        .get_matching_blocks() or .get_opcodes(), in which case you may
        want to try .quick_ratio() or .real_quick_ratio() first to get an
        upper bound.

        >>> s = SequenceMatcher(None, "abcd", "bcde")
        >>> s.ratio()
        0.75
        >>> s.quick_ratio()
        0.75
        >>> s.real_quick_ratio()
        1.0
        css|]}|dVqdS)rVNr)�.0Ztriplerrr�	<genexpr>�sz(SequenceMatcher.ratio.<locals>.<genexpr>)�sumrKrr/rr)rrrrr�rationszSequenceMatcher.ratiocCs�|jdkr4i|_}|jD]}|�|d�d||<q|j}i}|jd}}|jD]>}||�rf||}n|�|d�}|d||<|dkrP|d}qPt|t|j�t|j��S)z�Return an upper bound on ratio() relatively quickly.

        This isn't defined beyond that it is an upper bound on .ratio(), and
        is faster to compute.
        Nr
r&)r"rr7r5rrr/)rr"r2ZavailZavailhasrZnumbrrr�quick_ratio�s






zSequenceMatcher.quick_ratiocCs*t|j�t|j�}}tt||�||�S)z�Return an upper bound on ratio() very quickly.

        This isn't defined beyond that it is an upper bound on .ratio(), and
        is faster to compute than either .ratio() or .quick_ratio().
        )r/rrrrX)rrDrErrr�real_quick_ratio�sz SequenceMatcher.real_quick_ratio)NrrT)rU)�__name__�
__module__�__qualname__�__doc__rrrrr#r>rKrTrZr^r_r`rrrrr+sj
@,'nG7
2rU�333333�?cCs�|dkstd|f��d|kr*dks:ntd|f��g}t�}|�|�|D]D}|�|�|��|krR|��|krR|��|krR|�|��|f�qRt||�}dd�|D�S)a�Use SequenceMatcher to return list of the best "good enough" matches.

    word is a sequence for which close matches are desired (typically a
    string).

    possibilities is a list of sequences against which to match word
    (typically a list of strings).

    Optional arg n (default 3) is the maximum number of close matches to
    return.  n must be > 0.

    Optional arg cutoff (default 0.6) is a float in [0, 1].  Possibilities
    that don't score at least that similar to word are ignored.

    The best (no more than n) matches among the possibilities are returned
    in a list, sorted by similarity score, most similar first.

    >>> get_close_matches("appel", ["ape", "apple", "peach", "puppy"])
    ['apple', 'ape']
    >>> import keyword as _keyword
    >>> get_close_matches("wheel", _keyword.kwlist)
    ['while']
    >>> get_close_matches("Apple", _keyword.kwlist)
    []
    >>> get_close_matches("accept", _keyword.kwlist)
    ['except']
    r
zn must be > 0: %rgrz cutoff must be in [0.0, 1.0]: %rcSsg|]\}}|�qSrr)r[ZscorerFrrr�
<listcomp>�sz%get_close_matches.<locals>.<listcomp>)	�
ValueErrorrrrr`r_r^r*�	_nlargest)ZwordZ
possibilitiesr4�cutoff�result�srFrrrr�s"


�
�
cCsd�dd�t||�D��S)zAReplace whitespace with the original whitespace characters in `s`rcss*|]"\}}|dkr|��r|n|VqdS)� N)�isspace)r[�cZtag_crrrr\�s�z$_keep_original_ws.<locals>.<genexpr>)�join�zip)rkZtag_srrr�_keep_original_ws�s
�rqc@sJeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)ra�

    Differ is a class for comparing sequences of lines of text, and
    producing human-readable differences or deltas.  Differ uses
    SequenceMatcher both to compare sequences of lines, and to compare
    sequences of characters within similar (near-matching) lines.

    Each line of a Differ delta begins with a two-letter code:

        '- '    line unique to sequence 1
        '+ '    line unique to sequence 2
        '  '    line common to both sequences
        '? '    line not present in either input sequence

    Lines beginning with '? ' attempt to guide the eye to intraline
    differences, and were not present in either input sequence.  These lines
    can be confusing if the sequences contain tab characters.

    Note that Differ makes no claim to produce a *minimal* diff.  To the
    contrary, minimal diffs are often counter-intuitive, because they synch
    up anywhere possible, sometimes accidental matches 100 pages apart.
    Restricting synch points to contiguous matches preserves some notion of
    locality, at the occasional cost of producing a longer diff.

    Example: Comparing two texts.

    First we set up the texts, sequences of individual single-line strings
    ending with newlines (such sequences can also be obtained from the
    `readlines()` method of file-like objects):

    >>> text1 = '''  1. Beautiful is better than ugly.
    ...   2. Explicit is better than implicit.
    ...   3. Simple is better than complex.
    ...   4. Complex is better than complicated.
    ... '''.splitlines(keepends=True)
    >>> len(text1)
    4
    >>> text1[0][-1]
    '\n'
    >>> text2 = '''  1. Beautiful is better than ugly.
    ...   3.   Simple is better than complex.
    ...   4. Complicated is better than complex.
    ...   5. Flat is better than nested.
    ... '''.splitlines(keepends=True)

    Next we instantiate a Differ object:

    >>> d = Differ()

    Note that when instantiating a Differ object we may pass functions to
    filter out line and character 'junk'.  See Differ.__init__ for details.

    Finally, we compare the two:

    >>> result = list(d.compare(text1, text2))

    'result' is a list of strings, so let's pretty-print it:

    >>> from pprint import pprint as _pprint
    >>> _pprint(result)
    ['    1. Beautiful is better than ugly.\n',
     '-   2. Explicit is better than implicit.\n',
     '-   3. Simple is better than complex.\n',
     '+   3.   Simple is better than complex.\n',
     '?     ++\n',
     '-   4. Complex is better than complicated.\n',
     '?            ^                     ---- ^\n',
     '+   4. Complicated is better than complex.\n',
     '?           ++++ ^                      ^\n',
     '+   5. Flat is better than nested.\n']

    As a single multi-line string it looks like this:

    >>> print(''.join(result), end="")
        1. Beautiful is better than ugly.
    -   2. Explicit is better than implicit.
    -   3. Simple is better than complex.
    +   3.   Simple is better than complex.
    ?     ++
    -   4. Complex is better than complicated.
    ?            ^                     ---- ^
    +   4. Complicated is better than complex.
    ?           ++++ ^                      ^
    +   5. Flat is better than nested.

    Methods:

    __init__(linejunk=None, charjunk=None)
        Construct a text differencer, with optional filters.

    compare(a, b)
        Compare two sequences of lines; generate the resulting delta.
    NcCs||_||_dS)a�
        Construct a text differencer, with optional filters.

        The two optional keyword parameters are for filter functions:

        - `linejunk`: A function that should accept a single string argument,
          and return true iff the string is junk. The module-level function
          `IS_LINE_JUNK` may be used to filter out lines without visible
          characters, except for at most one splat ('#').  It is recommended
          to leave linejunk None; the underlying SequenceMatcher class has
          an adaptive notion of "noise" lines that's better than any static
          definition the author has ever been able to craft.

        - `charjunk`: A function that should accept a string of length 1. The
          module-level function `IS_CHARACTER_JUNK` may be used to filter out
          whitespace characters (a blank or tab; **note**: bad idea to include
          newline in this!).  Use of IS_CHARACTER_JUNK is recommended.
        N��linejunk�charjunk)rrsrtrrrrHszDiffer.__init__c
	cs�t|j||�}|��D]�\}}}}}|dkrB|�||||||�}	n\|dkr\|�d|||�}	nB|dkrv|�d|||�}	n(|dkr�|�d|||�}	ntd|f��|	Ed	Hqd	S)
a�
        Compare two sequences of lines; generate the resulting delta.

        Each sequence must contain individual single-line strings ending with
        newlines. Such sequences can be obtained from the `readlines()` method
        of file-like objects.  The delta generated also consists of newline-
        terminated strings, ready to be printed as-is via the writeline()
        method of a file-like object.

        Example:

        >>> print(''.join(Differ().compare('one\ntwo\nthree\n'.splitlines(True),
        ...                                'ore\ntree\nemu\n'.splitlines(True))),
        ...       end="")
        - one
        ?  ^
        + ore
        ?  ^
        - two
        - three
        ?  -
        + tree
        + emu
        rLrM�-rN�+rOrl�unknown tag %rN)rrsrT�_fancy_replace�_dumprg)
rrr�cruncherrSr8r9r:r;�grrr�compare_szDiffer.compareccs&t||�D]}d|||fVq
dS)z4Generate comparison results for a same-tagged range.z%s %sN)r6)rrSrF�lo�hir1rrrry�szDiffer._dumpc
cs�||kr||kst�||||krF|�d|||�}|�d|||�}n |�d|||�}|�d|||�}||fD]}	|	EdHqndS)Nrvru)�AssertionErrorry)
rrr8r9rr:r;�first�secondr{rrr�_plain_replace�szDiffer._plain_replaceccs:d\}}t|j�}	d\}
}t||�D]�}||}
|	�|
�t||�D]j}||}||
krl|
dkrD||}
}qD|	�|�|	��|krD|	��|krD|	��|krD|	��||}}}qDq$||kr�|
dkr�|�||||||�EdHdS|
|d}}}nd}
|�	||||||�EdH||||}}|
dk�r
d}}|	�
||�|	��D]�\}}}}}||||}}|dk�r�|d|7}|d|7}nb|dk�r�|d	|7}nJ|d
k�r�|d|7}n2|dk�r�|d
|7}|d
|7}ntd|f���qH|�
||||�EdHn
d|V|�	||d|||d|�EdHdS)aL
        When replacing one block of lines with another, search the blocks
        for *similar* lines; the best-matching pair (if any) is used as a
        synch point, and intraline difference marking is done on the
        similar pair. Lots of work, but often worth it.

        Example:

        >>> d = Differ()
        >>> results = d._fancy_replace(['abcDefghiJkl\n'], 0, 1,
        ...                            ['abcdefGhijkl\n'], 0, 1)
        >>> print(''.join(results), end="")
        - abcDefghiJkl
        ?    ^  ^  ^
        + abcdefGhijkl
        ?    ^  ^  ^
        )g�G�z��?g�?)NNNrrrL�^rMrurNrvrOrlrw�  r&)rrtr6rrr`r_r^r��
_fancy_helperrrTrg�_qformat)rrr8r9rr:r;Z
best_ratiorirzZeqiZeqjr<rQr1rPZbest_iZbest_jZaeltZbelt�atags�btagsrSZai1Zai2Zbj1Zbj2rDrErrrrx�s\




�
�





zDiffer._fancy_replaceccsbg}||kr<||kr*|�||||||�}qT|�d|||�}n||krT|�d|||�}|EdHdS)Nrurv)rxry)rrr8r9rr:r;r{rrrr��szDiffer._fancy_helperccsXt||���}t||���}d|V|r8d|�d�Vd|V|rTd|�d�VdS)a�
        Format "?" output and deal with tabs.

        Example:

        >>> d = Differ()
        >>> results = d._qformat('\tabcDefghiJkl\n', '\tabcdefGhijkl\n',
        ...                      '  ^ ^  ^      ', '  ^ ^  ^      ')
        >>> for line in results: print(repr(line))
        ...
        '- \tabcDefghiJkl\n'
        '? \t ^ ^  ^\n'
        '+ \tabcdefGhijkl\n'
        '? \t ^ ^  ^\n'
        �- z? �
�+ N)rq�rstrip)rZalineZbliner�r�rrrr�s

zDiffer._qformat)NN)rarbrcrdrr|ryr�rxr�r�rrrrr�s]
)^Nz
\s*(?:#\s*)?$cCs||�dk	S)z�
    Return True for ignorable line: iff `line` is blank or contains a single '#'.

    Examples:

    >>> IS_LINE_JUNK('\n')
    True
    >>> IS_LINE_JUNK('  #   \n')
    True
    >>> IS_LINE_JUNK('hello\n')
    False
    Nr)�lineZpatrrrr3s� 	cCs||kS)z�
    Return True for ignorable character: iff `ch` is a space or tab.

    Examples:

    >>> IS_CHARACTER_JUNK(' ')
    True
    >>> IS_CHARACTER_JUNK('\t')
    True
    >>> IS_CHARACTER_JUNK('\n')
    False
    >>> IS_CHARACTER_JUNK('x')
    False
    r)ZchZwsrrrrCscCs:|d}||}|dkr"d�|�S|s.|d8}d�||�S�z Convert range to the "ed" formatr&z{}z{},{}��format��start�stopZ	beginningrrrr�_format_range_unifiedZs
r�rr�ccsPt|||||||�d}td||��|�D�]}	|s|d}|rFd�|�nd}
|rXd�|�nd}d�||
|�Vd�|||�V|	d|	d	}}
t|d
|
d�}t|d|
d
�}d�|||�V|	D]�\}}}}}|dkr�|||�D]}d|Vq�q�|dk�r"|||�D]}d|V�q|dkr�|||�D]}d|V�q6q�q*dS)a�
    Compare two sequences of lines; generate the delta as a unified diff.

    Unified diffs are a compact way of showing line changes and a few
    lines of context.  The number of context lines is set by 'n' which
    defaults to three.

    By default, the diff control lines (those with ---, +++, or @@) are
    created with a trailing newline.  This is helpful so that inputs
    created from file.readlines() result in diffs that are suitable for
    file.writelines() since both the inputs and outputs have trailing
    newlines.

    For inputs that do not have trailing newlines, set the lineterm
    argument to "" so that the output will be uniformly newline free.

    The unidiff format normally has a header for filenames and modification
    times.  Any or all of these may be specified using strings for
    'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'.
    The modification times are normally expressed in the ISO 8601 format.

    Example:

    >>> for line in unified_diff('one two three four'.split(),
    ...             'zero one tree four'.split(), 'Original', 'Current',
    ...             '2005-01-26 23:30:50', '2010-04-02 10:20:52',
    ...             lineterm=''):
    ...     print(line)                 # doctest: +NORMALIZE_WHITESPACE
    --- Original        2005-01-26 23:30:50
    +++ Current         2010-04-02 10:20:52
    @@ -1,4 +1,4 @@
    +zero
     one
    -two
    -three
    +tree
     four
    FNT�	{}r�
--- {}{}{}z
+++ {}{}{}r
rVr&�rU�z@@ -{} +{} @@{}rOrl>rMrLru>rLrNrv)�_check_typesrrZr�r�)rr�fromfile�tofile�fromfiledate�
tofiledater4�lineterm�startedrY�fromdate�todater��last�file1_range�file2_rangerSrGrIrHrJr�rrrr	es0)
cCsB|d}||}|s|d8}|dkr.d�|�Sd�|||d�Sr�r�r�rrr�_format_range_context�s
r�ccs�t|||||||�tddddd�}d}	td||��|�D�]R}
|	s�d}	|rVd	�|�nd
}|rhd	�|�nd
}d�|||�Vd�|||�V|
d
|
d}
}d|Vt|
d|d�}d�||�Vtdd�|
D���r|
D]8\}}}}}|dkr�|||�D]}|||V�qq�t|
d|d�}d�||�Vtdd�|
D��r:|
D]<\}}}}}|dk�rP|||�D]}|||V�qt�qPq:dS)ah
    Compare two sequences of lines; generate the delta as a context diff.

    Context diffs are a compact way of showing line changes and a few
    lines of context.  The number of context lines is set by 'n' which
    defaults to three.

    By default, the diff control lines (those with *** or ---) are
    created with a trailing newline.  This is helpful so that inputs
    created from file.readlines() result in diffs that are suitable for
    file.writelines() since both the inputs and outputs have trailing
    newlines.

    For inputs that do not have trailing newlines, set the lineterm
    argument to "" so that the output will be uniformly newline free.

    The context diff format normally has a header for filenames and
    modification times.  Any or all of these may be specified using
    strings for 'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'.
    The modification times are normally expressed in the ISO 8601 format.
    If not specified, the strings default to blanks.

    Example:

    >>> print(''.join(context_diff('one\ntwo\nthree\nfour\n'.splitlines(True),
    ...       'zero\none\ntree\nfour\n'.splitlines(True), 'Original', 'Current')),
    ...       end="")
    *** Original
    --- Current
    ***************
    *** 1,4 ****
      one
    ! two
    ! three
      four
    --- 1,4 ----
    + zero
      one
    ! tree
      four
    r�r�z! r�)rNrMrLrOFNTr�rz
*** {}{}{}r�r
rVz***************r&r�z
*** {} ****{}css |]\}}}}}|dkVqdS)>rMrLNr�r[rS�_rrrr\�szcontext_diff.<locals>.<genexpr>rNrUr�z
--- {} ----{}css |]\}}}}}|dkVqdS)>rLrNNrr�rrrr\srM)r��dictrrZr�r��any)rrr�r�r�r�r4r��prefixr�rYr�r�r�r�r�rSrGrIr�r�r�rHrJrrrr�s4,

cGs�|r0t|dt�s0tdt|d�j|df��|r`t|dt�s`tdt|d�j|df��|D]}t|t�sdtd|f��qddS)Nr
z)lines to compare must be str, not %s (%r)z"all arguments must be str, not: %r)�
isinstance�str�	TypeError�typera)rr�args�argrrrr�s��
r���
c		cs~dd�}	tt|	|��}tt|	|��}|	|�}|	|�}|	|�}|	|�}|	|�}|||||||||�}
|
D]}|�dd�VqfdS)a�
    Compare `a` and `b`, two sequences of lines represented as bytes rather
    than str. This is a wrapper for `dfunc`, which is typically either
    unified_diff() or context_diff(). Inputs are losslessly converted to
    strings so that `dfunc` only has to worry about strings, and encoded
    back to bytes on return. This is necessary to compare files with
    unknown or inconsistent encoding. All other inputs (except `n`) must be
    bytes rather than str.
    c
SsRz|�dd�WStk
rL}z dt|�j|f}t|�|�W5d}~XYnXdS)N�ascii�surrogateescapez(all arguments must be bytes, not %s (%r))�decode�AttributeErrorr�rar�)rk�err�msgrrrr�"s�zdiff_bytes.<locals>.decoder�r�N)rArB�encode)Zdfuncrrr�r�r�r�r4r�r��linesr�rrrr
scCst||��||�S)aJ
    Compare `a` and `b` (lists of strings); return a `Differ`-style delta.

    Optional keyword parameters `linejunk` and `charjunk` are for filter
    functions, or can be None:

    - linejunk: A function that should accept a single string argument and
      return true iff the string is junk.  The default is None, and is
      recommended; the underlying SequenceMatcher class has an adaptive
      notion of "noise" lines.

    - charjunk: A function that accepts a character (string of length
      1), and returns true iff the character is junk. The default is
      the module-level function IS_CHARACTER_JUNK, which filters out
      whitespace characters (a blank or tab; note: it's a bad idea to
      include newline in this!).

    Tools/scripts/ndiff.py is a command-line front-end to this function.

    Example:

    >>> diff = ndiff('one\ntwo\nthree\n'.splitlines(keepends=True),
    ...              'ore\ntree\nemu\n'.splitlines(keepends=True))
    >>> print(''.join(diff), end="")
    - one
    ?  ^
    + ore
    ?  ^
    - two
    - three
    ?  -
    + tree
    + emu
    )rr|)rrrsrtrrrr5s#c#s�ddl}|�d��t||||��ddgf�fdd�	���fdd���fdd	�}|�}|dkrj|EdH�n|d
7}d}ddg|}	}
d}|dkr�zt|�\}}
}Wntk
r�YdSX|	|}||
|f|
|<|	d
7}	q�|	|kr�dV|}n|	}d}	|�r"|	|}|	d
7}	|
|V|d
8}q�|d
}z@|�rht|�\}}
}|�rP|d
}n|d
8}||
|fV�q,Wqvtk
�r�YdSXqvdS)
a�Returns generator yielding marked up from/to side by side differences.

    Arguments:
    fromlines -- list of text lines to compared to tolines
    tolines -- list of text lines to be compared to fromlines
    context -- number of context lines to display on each side of difference,
               if None, all from/to text lines will be generated.
    linejunk -- passed on to ndiff (see ndiff documentation)
    charjunk -- passed on to ndiff (see ndiff documentation)

    This function returns an iterator which returns a tuple:
    (from line tuple, to line tuple, boolean flag)

    from/to line tuple -- (line num, line text)
        line num -- integer or None (to indicate a context separation)
        line text -- original line text with following markers inserted:
            '\0+' -- marks start of added text
            '\0-' -- marks start of deleted text
            '\0^' -- marks start of changed text
            '\1' -- marks end of added/deleted/changed text

    boolean flag -- None indicates context separation, True indicates
        either "from" or "to" line contains a change, otherwise False.

    This function/iterator was originally developed to generate side by side
    file difference for making HTML pages (see HtmlDiff class for example
    usage).

    Note, this function utilizes the ndiff function to generate the side by
    side difference markup.  Optional ndiff arguments may be passed to this
    function and they in turn will be passed to ndiff.
    r
Nz
(\++|\-+|\^+)cs�||d7<|dkr2|||�d�dd�fS|dkr�|�d�|�d�}}g}|fdd�}��||�t|�D]<\}\}	}
|d|	�d|||	|
�d	||
d�}qt|dd�}n*|�d�dd�}|s�d
}d||d	}|||fS)aReturns line of text with user's change markup and line formatting.

        lines -- list of lines from the ndiff generator to produce a line of
                 text from.  When producing the line of text to return, the
                 lines used are removed from this list.
        format_key -- '+' return first line in list with "add" markup around
                          the entire line.
                      '-' return first line in list with "delete" markup around
                          the entire line.
                      '?' return first line in list with add/delete/change
                          intraline markup (indices obtained from second line)
                      None return first line in list with no markup
        side -- indice into the num_lines list (0=from,1=to)
        num_lines -- from/to current line number.  This is NOT intended to be a
                     passed parameter.  It is present as a keyword argument to
                     maintain memory of the current line numbers between calls
                     of this function.

        Note, this function is purposefully not defined at the module scope so
        that data it needs from its parent function (within whose context it
        is defined) does not need to be of module scope.
        r&Nr
r��?cSs&|�|�d�d|��g�|�d�S)Nr&r
)r*rY�span)Zmatch_object�sub_inforrr�record_sub_info�sz3_mdiff.<locals>._make_line.<locals>.record_sub_info��rl)r?�sub�reversed)r�Z
format_key�sideZ	num_lines�textZmarkersr�r��keyZbegin�end)�	change_rerr�
_make_line�s 2z_mdiff.<locals>._make_linec3sng}d\}}t|�dkr*|�t�d��qd�dd�|D��}|�d�rP|}�n�|�d�r|�|dd	��|dd
�dfVq�n�|�d�r�|d
8}�|d
d	�ddfVq�nl|�d�rֈ|d
d	�d}}|d
d	}}�n>|�d��r�|dd	��|dd
�dfVq�n|�d��r0�|dd	��|dd
�dfVqn�|�d
��r\|d
8}�|d
d	�ddfVqn�|�d��r�|d
7}d�|dd
�dfVqn�|�d��r�d�|dd
�}}|d
d	}}n^|�d��r�|d
7}d�|dd
�dfVqn2|�d��r�|dd�dd	��|dd
�dfVq|d	k�r0|d
7}dV�q|d	k�rL|d
8}dV�q0|�d��r\dS||dfVqdS)a�Yields from/to lines of text with a change indication.

        This function is an iterator.  It itself pulls lines from a
        differencing iterator, processes them and yields them.  When it can
        it yields both a "from" and a "to" line, otherwise it will yield one
        or the other.  In addition to yielding the lines of from/to text, a
        boolean flag is yielded to indicate if the text line(s) have
        differences in them.

        Note, this function is purposefully not defined at the module scope so
        that data it needs from its parent function (within whose context it
        is defined) does not need to be of module scope.
        )r
r
r��XrcSsg|]}|d�qS)r
r�r[r�rrrrf�sz2_mdiff.<locals>._line_iterator.<locals>.<listcomp>z-?+?r�r
r&Tz--++ruN)z--?+z--+r�z-+?z-?+z+--rv)r�z+-rlF)N�rr�T)r�NT)r/r*�nextro�
startswith)r�Znum_blanks_pendingZnum_blanks_to_yieldrk�	from_line�to_line)r��diff_lines_iteratorrr�_line_iterator�sd



$



z_mdiff.<locals>._line_iteratorc3s���}gg}}t|�dks(t|�dkr�zt|�\}}}Wntk
rPYdSX|dk	rh|�||f�|dk	r|�||f�q|�d�\}}|�d�\}}|||p�|fVqdS)atYields from/to lines of text with a change indication.

        This function is an iterator.  It itself pulls lines from the line
        iterator.  Its difference from that iterator is that this function
        always yields a pair of from/to text lines (with the change
        indication).  If necessary it will collect single from/to lines
        until it has a matching pair from/to pair to yield.

        Note, this function is purposefully not defined at the module scope so
        that data it needs from its parent function (within whose context it
        is defined) does not need to be of module scope.
        r
N)r/r��
StopIterationr*r?)Z
line_iterator�	fromlines�tolinesr�r��
found_diffZfromDiffZto_diff)r�rr�_line_pair_iterators

z#_mdiff.<locals>._line_pair_iteratorr&F)NNN)�re�compilerr�r�)r�r��contextrsrtr�r�Zline_pair_iteratorZlines_to_write�indexZcontextLinesr�r�r�r1r)r�r�r�r�r�_mdiffZsR"
8X!



r�an
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>

<head>
    <meta http-equiv="Content-Type"
          content="text/html; charset=%(charset)s" />
    <title></title>
    <style type="text/css">%(styles)s
    </style>
</head>

<body>
    %(table)s%(legend)s
</body>

</html>aH
        table.diff {font-family:Courier; border:medium;}
        .diff_header {background-color:#e0e0e0}
        td.diff_header {text-align:right}
        .diff_next {background-color:#c0c0c0}
        .diff_add {background-color:#aaffaa}
        .diff_chg {background-color:#ffff77}
        .diff_sub {background-color:#ffaaaa}aZ
    <table class="diff" id="difflib_chg_%(prefix)s_top"
           cellspacing="0" cellpadding="0" rules="groups" >
        <colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
        <colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
        %(header_row)s
        <tbody>
%(data_rows)s        </tbody>
    </table>a�
    <table class="diff" summary="Legends">
        <tr> <th colspan="2"> Legends </th> </tr>
        <tr> <td> <table border="" summary="Colors">
                      <tr><th> Colors </th> </tr>
                      <tr><td class="diff_add">&nbsp;Added&nbsp;</td></tr>
                      <tr><td class="diff_chg">Changed</td> </tr>
                      <tr><td class="diff_sub">Deleted</td> </tr>
                  </table></td>
             <td> <table border="" summary="Links">
                      <tr><th colspan="2"> Links </th> </tr>
                      <tr><td>(f)irst change</td> </tr>
                      <tr><td>(n)ext change</td> </tr>
                      <tr><td>(t)op</td> </tr>
                  </table></td> </tr>
    </table>c@s�eZdZdZeZeZeZeZdZddde	fdd�Z
dd
d�dd
�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zddd�ZdS) ra{For producing HTML side by side comparison with change highlights.

    This class can be used to create an HTML table (or a complete HTML file
    containing the table) showing a side by side, line by line comparison
    of text with inter-line and intra-line change highlights.  The table can
    be generated in either full or contextual difference mode.

    The following methods are provided for HTML generation:

    make_table -- generates HTML for a single side by side table
    make_file -- generates complete HTML file with a single side by side table

    See tools/scripts/diff.py for an example usage of this class.
    r
�NcCs||_||_||_||_dS)a�HtmlDiff instance initializer

        Arguments:
        tabsize -- tab stop spacing, defaults to 8.
        wrapcolumn -- column number where lines are broken and wrapped,
            defaults to None where lines are not wrapped.
        linejunk,charjunk -- keyword arguments passed into ndiff() (used by
            HtmlDiff() to generate the side by side HTML differences).  See
            ndiff() documentation for argument default values and descriptions.
        N)�_tabsize�_wrapcolumn�	_linejunk�	_charjunk)r�tabsizeZ
wrapcolumnrsrtrrrr�szHtmlDiff.__init__rF�zutf-8)�charsetcCs:|jt|j|j|j||||||d�|d��|d��|�S)aReturns HTML file of side by side comparison with change highlights

        Arguments:
        fromlines -- list of "from" lines
        tolines -- list of "to" lines
        fromdesc -- "from" file column header string
        todesc -- "to" file column header string
        context -- set to True for contextual differences (defaults to False
            which shows full differences).
        numlines -- number of context lines.  When context is set True,
            controls number of lines displayed before and after the change.
            When context is False, controls the number of lines to place
            the "next" link anchors before the next change (so click of
            "next" link jumps to just before the change).
        charset -- charset of the HTML document
        )r��numlines)ZstylesZlegend�tabler��xmlcharrefreplace)�_file_templater��_styles�_legend�
make_tabler�r�)rr�r��fromdesc�todescr�r�r�rrr�	make_file�s����zHtmlDiff.make_filecs8�fdd���fdd�|D�}�fdd�|D�}||fS)aReturns from/to line lists with tabs expanded and newlines removed.

        Instead of tab characters being replaced by the number of spaces
        needed to fill in to the next tab stop, this function will fill
        the space with tab characters.  This is done so that the difference
        algorithms can identify changes in a file when tabs are replaced by
        spaces and vice versa.  At the end of the HTML generation, the tab
        characters will be replaced with a nonbreakable space.
        cs6|�dd�}|��j�}|�dd�}|�dd��d�S)Nrlr��	r�)rL�
expandtabsr�r�)r�)rrr�expand_tabs�sz2HtmlDiff._tab_newline_replace.<locals>.expand_tabscsg|]}�|��qSrrr��r�rrrf�sz1HtmlDiff._tab_newline_replace.<locals>.<listcomp>csg|]}�|��qSrrr�r�rrrf�sr)rr�r�r)r�rr�_tab_newline_replace�s
	zHtmlDiff._tab_newline_replacecCs|s|�||f�dSt|�}|j}||ksB||�d�d|krT|�||f�dSd}d}d}||kr�||kr�||dkr�|d7}||}|d7}q`||dkr�|d7}d}q`|d7}|d7}q`|d|�}	||d�}
|r�|	d}	d||
}
|�||	f�|�|d|
�dS)	a�Builds list of text lines by splitting text lines at wrap point

        This function will determine if the input text line needs to be
        wrapped (split) into separate lines.  If so, the first wrap point
        will be determined and the first line appended to the output
        text line list.  This function is used recursively to handle
        the second part of the split line to further split it.
        Nr�rUr
rr&r��>)r*r/r��count�_split_line)rZ	data_listZline_numr�rRrWr1r4ZmarkZline1Zline2rrrr��s8


zHtmlDiff._split_lineccs�|D]�\}}}|dkr$|||fVq||\}}\}}gg}	}
|�|	||�|�|
||�|	sd|
r|	rt|	�d�}nd}|
r�|
�d�}nd}|||fVq\qdS)z5Returns iterator that splits (wraps) mdiff text linesNr
)rrl)r�r?)r�diffs�fromdata�todata�flagZfromlineZfromtextZtolineZtotext�fromlist�tolistrrr�
_line_wrapper0s 
zHtmlDiff._line_wrapperc	Cs�ggg}}}|D]r\}}}z4|�|jd|f|���|�|jd|f|���Wn(tk
rz|�d�|�d�YnX|�|�q|||fS)z�Collects mdiff output into separate lists

        Before storing the mdiff from/to data into a list, it is converted
        into a single line of text with HTML markup.
        r
r&N)r*�_format_liner�)rr�r�r��flaglistr�r�r�rrr�_collect_linesLs
zHtmlDiff._collect_linescCsrzd|}d|j||f}Wntk
r6d}YnX|�dd��dd��dd	�}|�d
d���}d|||fS)
aReturns HTML markup of "from" / "to" text lines

        side -- 0 or 1 indicating "from" or "to" text
        flag -- indicates if difference on line
        linenum -- line number (used for line number column)
        text -- line text to be marked up
        z%dz
 id="%s%s"r�&z&amp;r�z&gt;�<z&lt;rl�&nbsp;z<<td class="diff_header"%s>%s</td><td nowrap="nowrap">%s</td>)�_prefixr�rLr�)rr�r�Zlinenumr��idrrrr�as
�zHtmlDiff._format_linecCs0dtj}dtj}tjd7_||g|_dS)zCreate unique anchor prefixeszfrom%d_zto%d_r&N)r�_default_prefixr)rZ
fromprefix�toprefixrrr�_make_prefixxs

zHtmlDiff._make_prefixcCs�|jd}dgt|�}dgt|�}d\}	}
d}t|�D]V\}}
|
r�|
s�d}
|}td||g�}d||	f||<|	d7}	d||	f||<q:d}
q:|s�dg}dg}dg}d}|r�d	g}|}n
d
g}}|ds�d||d<d|||<|||||fS)
zMakes list of "next" linksr&r)r
Fr
Tz id="difflib_chg_%s_%d"z"<a href="#difflib_chg_%s_%d">n</a>Fz2<td></td><td>&nbsp;No Differences Found&nbsp;</td>z(<td></td><td>&nbsp;Empty File&nbsp;</td>z!<a href="#difflib_chg_%s_0">f</a>z#<a href="#difflib_chg_%s_top">t</a>)rr/r(rW)rr�r�r�r�r�r�next_id�	next_hrefZnum_chgZ	in_changer�r1r�rrr�_convert_flags�s>
�
zHtmlDiff._convert_flagsc
CsR|��|�||�\}}|r"|}nd}t||||j|jd�}|jrL|�|�}|�|�\}	}
}|�|	|
|||�\}	}
}}}
g}d}t	t
|��D]P}||dkr�|dkr�|�d�q�|�||
||||	||||
|f�q�|s�|�rddd|dd|f}nd	}|jt
d	�|�||jd
d�}|�dd
��dd��dd��dd��dd�S)a�Returns HTML table of side by side comparison with change highlights

        Arguments:
        fromlines -- list of "from" lines
        tolines -- list of "to" lines
        fromdesc -- "from" file column header string
        todesc -- "to" file column header string
        context -- set to True for contextual differences (defaults to False
            which shows full differences).
        numlines -- number of context lines.  When context is set True,
            controls number of lines displayed before and after the change.
            When context is False, controls the number of lines to place
            the "next" link anchors before the next change (so click of
            "next" link jumps to just before the change).
        NrrzV            <tr><td class="diff_next"%s>%s</td>%s<td class="diff_next">%s</td>%s</tr>
r
z)        </tbody>        
        <tbody>
z <thead><tr>%s%s%s%s</tr></thead>z!<th class="diff_next"><br /></th>z+<th colspan="2" class="diff_header">%s</th>rr&)Z	data_rows�
header_rowr�z+z<span class="diff_add">z-z<span class="diff_sub">z^z<span class="diff_chg">r�z</span>r�r)rr�r�r�r�r�r�rrr6r/r*�_table_templater�rorrL)rr�r�r�r�r�r�Z
context_linesr�r�r�r�r
r	rkZfmtr1rr�rrrr��sl�
��

������zHtmlDiff.make_table)rrFr�)rrFr�)rarbrcrdr�r�r
r�rrrr�r�r�r�rr�rrr�rrrrr�s2�
��7/�ccsnzddd�t|�}Wn"tk
r8td|�d�YnXd|f}|D]"}|dd�|krF|dd�VqFdS)a0
    Generate one of the two sequences that generated a delta.

    Given a `delta` produced by `Differ.compare()` or `ndiff()`, extract
    lines originating from file 1 or 2 (parameter `which`), stripping off line
    prefixes.

    Examples:

    >>> diff = ndiff('one\ntwo\nthree\n'.splitlines(keepends=True),
    ...              'ore\ntree\nemu\n'.splitlines(keepends=True))
    >>> diff = list(diff)
    >>> print(''.join(restore(diff, 1)), end="")
    one
    two
    three
    >>> print(''.join(restore(diff, 2)), end="")
    ore
    tree
    emu
    r�r�)r&r�z)unknown delta choice (must be 1 or 2): %rNr�r�)�int�KeyErrorrg)ZdeltaZwhichrS�prefixesr�rrrrs��cCsddl}ddl}|�|�S)Nr
)�doctest�difflibZtestmod)rrrrr�_test!sr�__main__)rUre)r�)rrrrrUr�)rrrrrUr�)r�r�r�r�rUr�)$rd�__all__�heapqrrh�collectionsrZ_namedtuplerrrrrqrr�r��matchrrr�r	r�rr�r
rr�r�r�r
r��objectrrrrarrrr�<module>s��


1	I
�
I�
L�
%�
	
a 
__pycache__/pyclbr.cpython-38.pyc000064400000024325151153537600012713 0ustar00U

e5d�;�@s�dZddlZddlZddlZddlZddlmZmZm	Z	ddddgZ
iZGdd	�d	�ZGd
d�de�Z
Gdd�de�Zdd
�Zddd�Zddd�Zddd�Zd dd�Zdd�Zdd�Zdd�Zdd�Zedkr�e�dS)!aParse a Python module and describe its classes and functions.

Parse enough of a Python file to recognize imports and class and
function definitions, and to find out the superclasses of a class.

The interface consists of a single function:
    readmodule_ex(module, path=None)
where module is the name of a Python module, and path is an optional
list of directories where the module is to be searched.  If present,
path is prepended to the system search path sys.path.  The return value
is a dictionary.  The keys of the dictionary are the names of the
classes and functions defined in the module (including classes that are
defined via the from XXX import YYY construct).  The values are
instances of classes Class and Function.  One special key/value pair is
present for packages: the key '__path__' has a list as its value which
contains the package search path.

Classes and Functions have a common superclass: _Object.  Every instance
has the following attributes:
    module  -- name of the module;
    name    -- name of the object;
    file    -- file in which the object is defined;
    lineno  -- line in the file where the object's definition starts;
    parent  -- parent of this object, if any;
    children -- nested objects contained in this object.
The 'children' attribute is a dictionary mapping names to objects.

Instances of Function describe functions with the attributes from _Object.

Instances of Class describe classes with the attributes from _Object,
plus the following:
    super   -- list of super classes (Class instances if possible);
    methods -- mapping of method names to beginning line numbers.
If the name of a super class is not recognized, the corresponding
entry in the list of super classes is not a class instance but a
string giving the name of the super class.  Since import statements
are recognized and imported modules are scanned as well, this
shouldn't happen often.
�N)�NAME�DEDENT�OP�
readmodule�
readmodule_ex�Class�Functionc@s eZdZdZdd�Zdd�ZdS)�_Objectz+Information about Python class or function.cCs(||_||_||_||_||_i|_dS�N)�module�name�file�lineno�parent�children��selfrrr
rr�r�/usr/lib64/python3.8/pyclbr.py�__init__6sz_Object.__init__cCs||j|<dSr
)r)rr�objrrr�	_addchild>sz_Object._addchildN)�__name__�
__module__�__qualname__�__doc__rrrrrrr	4sr	c@seZdZdZddd�ZdS)rz7Information about a Python function, including methods.NcCst�||||||�dSr
)r	rrrrrrDszFunction.__init__)N)rrrrrrrrrrBscs*eZdZdZd�fdd�	Zdd�Z�ZS)rz!Information about a Python class.Ncs0t�||||||�|dkr gn||_i|_dSr
)r	r�super�methods)rrrrr
rr��	__class__rrrJszClass.__init__cCs||j|<dSr
)r)rrrrrr�
_addmethodOszClass._addmethod)N)rrrrrr �
__classcell__rrrrrHscCs:t|j||j||�}|�||�t|t�r6|�||�|S)z*Return a Function after nesting within ob.)rrr
r�
isinstancerr )�ob�	func_namerZnewfuncrrr�_nest_functionSs

r%cCs&t|j|||j||�}|�||�|S)z'Return a Class after nesting within ob.)rrr
r)r#�
class_namerrZnewclassrrr�_nest_class[sr'cCs6i}t||pg���D]\}}t|t�r|||<q|S)z�Return Class objects for the top-level classes in module.

    This is the original interface, before Functions were added.
    )�_readmodule�itemsr"r)r�path�res�key�valuerrrras


cCst||p
g�S)z�Return a dictionary with all functions and classes in module.

    Search for module in PATH + sys.path.
    If possible, include imported superclasses.
    Do this by reading source, without importing (and executing) it.
    )r()rr*rrrrmsc	Cs�|dk	rd||f}n|}|tkr*t|Si}|tjkrL|dkrL|t|<|S|�d�}|dkr�|d|�}||dd�}t|||�}|dk	r�d||f}d|kr�td�|���t||d|�Sd}	|dk	r�|}
n
|tj}
tj	�
||
�}|dk�rtd|��|d	��|t|<|jdk	�r$|j|d<z|j
�|�}Wnttfk
�rR|YSX|dk�rb|S|j
�|�}
t|||
|||�S)
a.Do the hard work for readmodule[_ex].

    If inpackage is given, it must be the dotted name of the package in
    which we are searching for a submodule, and then PATH must be the
    package search path; otherwise, we are searching for a top-level
    module, and path is combined with sys.path.
    Nz%s.%s�.r��__path__zNo package named {}zno module named )r)�_modules�sys�builtin_module_names�rfindr(�ImportError�formatr*�	importlib�util�_find_spec_from_path�ModuleNotFoundError�submodule_search_locations�loader�
get_source�AttributeError�get_filename�_create_tree)rr*�	inpackage�
fullmodule�tree�i�packageZ	submoduler�fZsearch_path�spec�source�fnamerrrr(vsJ	





r(c!
CsHt�|�}g}t�|j�}�z|D�]�\}	}
}}}
|	tkr`|\}}|r^|dd|kr^|d=qBq"|
dkr�|\}}|r�|dd|kr�|d=qpt|�dd�\}	}}|	tkr�q"d}|r�|dd}t|||�}nt	||||�}|||<|�
||f�q"|
dk�r�|\}}|�r(|dd|k�r(|d=�qt|�dd�\}	}}|	tk�rJq"t|�dd�\}	}
}d}|
dk�r�g}d}g}t|�dd�\}	}
}|
d	k�r|dk�rd
�|�}||k�r�||}nL|�d�}t
|�dk�r|d}|d}|tk�rt|}||k�r||}|�
|�g}|
dk�r0|d7}nZ|
d
k�rR|d8}|dk�r��q�n8|
dk�rh|dk�rhn"|	ttfk�rz|dk�rz|�
|
��qz|}|�r�|dd}t||||�}nt|||||�}|||<|�
||f�q"|
dk�rh|ddk�rht|�}|D]d\}}zL|dk�r t||�n2zt|||�Wn tk
�rPt|g�YnXWnYnX�qq"|
dkr"|ddkr"t|�\}}
|r"|
dk�r�q"t|�}zt|||�}WnYq"YnX|D]X\}} ||k�r�|||| �p�|<n0|dk�r�|D] }|ddk�r�||||<�q��q�q"Wntk
�r:YnX|��|S)a�Return the tree for a particular module.

    fullmodule (full module name), inpackage+module, becomes o.module.
    path is passed to recursive calls of _readmodule.
    fname becomes o.file.
    source is tokenized.  Imports cause recursive calls to _readmodule.
    tree is {} or {'__path__': <submodule search locations>}.
    inpackage, None or string, is passed to recursive calls of _readmodule.

    The effect of recursive calls is mutation of global _modules.
    ���r/�defr�N�class�()�)�,�r.���rOrP�import�from�*�_)�io�StringIO�tokenize�generate_tokens�readliner�nextrr%r�append�join�split�lenr1rr'r�_getnamelistr(r5�_getname�
StopIteration�close)!rBr*rIrHrCrArF�stack�g�	tokentype�token�startZ_end�_linerZ
thisindentr$Zcur_funcZcur_objr&Zinherit�names�levelr�n�c�m�dZ	cur_class�modules�modZ_mod2Zn2rrrr@�s�
















��



r@cCslg}t|�\}}|sqh|dkr,t|�\}}nd}|�||f�|dkr\d|kr\t|�d}q>|dkrqhq|S)z�Return list of (dotted-name, as-name or None) tuples for token source g.

    An as-name is the name that follows 'as' in an as clause.
    �asNrP�
r/)rbr]r\)rfrkrrhZname2rrrraEsracCs�g}t|�dd�\}}|tkr0|dkr0d|fS|�|�t|�dd�\}}|dkrXq�t|�dd�\}}|tkrvq�|�|�q:d�|�|fS)zBReturn (dotted-name or None, next-token) tuple for token source g.r�rUNr.)r\rr]r^)rf�partsrgrhrrrrb[s
rbc
CsXddl}ztjd}Wnt}YnX|j�|�rj|j�|�g}|j�|�}|���	d�rn|dd�}ng}t
||�}dd�}t|��|dd	�}d
}|�rT|�
�}t|t�r�q�t|d�s�d|_t|t�r�t|j��|dd	�}|D]}	|j||	_q�|�|�t|t��r,td�d
|j|j|j|j��q�t|t�r�td�d
|j|j|j��q�dS)z?Print module output (default this file) for quick visual check.rNr/z.py���cSst|dd�S)Nrr)�getattr)�arrr�<lambda>|�z_main.<locals>.<lambda>T)r,�reverseru�indentz{}class {} {} {}� z{}def {} {})�osr2�argv�__file__r*�exists�dirname�basename�lower�endswithr�sorted�values�popr"�list�hasattrr}r	r�extendr�printr6rrrr)
rrrr*rCZ
lineno_keyZobjsZindent_levelrZnew_objsr#rrr�_mainmsL





�
�
r��__main__)N)N)N)N)rrWr2�importlib.utilr7rYrhrrr�__all__r1r	rrr%r'rrr(r@rarbr�rrrrr�<module>s,(


	
@&__pycache__/pickletools.cpython-38.opt-1.pyc000064400000201414151153537600014703 0ustar00U

e5d.m�L@s�
dZddlZddlZddlZddlZddlZdddgZejZdZdZ	dZ
d	Zd
ZGdd�de
�Zdd
lmZdd�Zeddedd�Zdd�Zeddedd�Zdd�Zeddedd�Zdd�Zed ded!d�Zd"d#�Zed$d%ed&d�Z�d�d(d)�Zed*eed+d�Zd,d-�Zed.eed/d�Zd0d1�Z ed2ee d3d�Z!d4d5�Z"ed6e	e"d7d�Z#d8d9�Z$ed:e
e$d;d�Z%d<d=�Z&ed>e	e&d?d�Z'd@dA�Z(edBee(dCd�Z)dDdE�Z*edFee*dGd�Z+dHdI�Z,edJee,dKd�Z-dLdM�Z.edNee.dOd�Z/dPdQ�Z0edRe	e0dSd�Z1dTdU�Z2edVee2dWd�Z3dXdY�Z4edZee4d[d�Z5d\d]�Z6d^d_�Z7ed`ee6dad�Z8edbee7dcd�Z9ddde�Z:edfee:dgd�Z;dhdi�Z<edjd%e<dkd�Z=ddllm>Z>dmdn�Z?edoe	e?dpd�Z@dqdr�ZAedse
eAdtd�ZBGdudv�dve
�ZCeCdweDdxdy�ZEZFeCdzeDeGfd{dy�ZHeCd|eGd}dy�ZIeCd~eJddy�ZKeCd�eLeMfd�dy�ZNZOeCd�eLd�dy�ZPeCd�eQd�dy�ZReCd�eMd�dy�ZSeCd�eTd�d�dy�ZUeCd�eVd�dy�ZWeCd�eXd�dy�ZYeCd�eZd�dy�Z[eCd�e\d�dy�Z]eCd�e\d�dy�Z^eCd�e
d�dy�Z_eCd�e
d�dy�Z`eCd�eCd�dy�ZaeCd�eCd�dy�ZbGd�d��d�e
�ZcecZdedd�d�e8geHgdd�d��edd�d�egeEgdd�d��edd�d�egeEgdd�d��edd�d�egeEgdd�d��edd�d�e9geEgdd�d��edd�d�e@geEgdd�d��edd�d�eBgeEgdd�d��edd�d�egeNgdd�d��edd�d�e%geNgdd�d��edd�d�e#geNgdd�d��edd�d�e)gePgd�d�d��edd�d�e'gePgd�d�d��edd�d�e+gePgdd�d��edd�d�e-geRgd�d�d��edd�d�dge_gd�d�d��edd�d�de_ge_gd�d�d��edd�d�dgeUgdd�d��edd�d�dgeIgdd�d��edd�d�dgeIgdd�d��edd�d�e/geSgdd�d��edd�d�e1geSgdd�d��edd�d�e3geSgdd�d��edd�d�e5geSgdd�d��edd�d�e;geKgdd�d��edd�d�e=geKgdd�d��edd�d�dgeYgdd�d��edd�d�deYe`geYgdd�d��edd�d�deYeaebgeYgdd�d��edd�d�deaebgeYgdd�d��edd�d�dgeWgdd�d��edd�d�deaebgeWgdd�d��edd�d�de`geWgd�dd��ed�d�dde`e`geWgd�dd��ed�d�dde`e`e`geWgd�dd��ed�d�ddge[gd�d	d��ed�d
�ddeaebge[gd�dd��ed�d
�dde[e`e`ge[gd�dd��ed�d�dde[eaebge[gd�dd��ed�d�ddge]gd�dd��ed�d�dde]eaebge]gd�dd��ed�d�ddeaebge^gd�dd��ed�d�dde`ggd�dd��ed�d�d de`ge`e`gd�d!d��ed�d"�d#dgeagd�d$d��ed�d%�d&deaebggd�d'd��ed�d(�d)e8ge`gd�d*d��ed�d+�d,ege`gd�d-d��ed�d.�d/ege`gd�d0d��ed�d1�d2e8ggd�d3d��ed�d4�d5eggd�d6d��ed�d7�d8eggd�d9d��ed�d:�d;de`ge`gd�d<d��ed�d=�d>ege`gd�d?d��ed�d@�dAege`gd�dBd��ed�dC�dDege`gd�dEd��ed�dF�dGe!ge`gd�dHd��ed�dI�dJdeSeSge`gd�dKd��ed�dL�dMde`e`ge`gd�dNd��ed�dO�dPde`e`ge`gd�dQd��ed�dR�dSe!eaebge`gd�dTd��ed�dU�dVdeae`ebge`gd�dWd��ed�dX�dYde`e`ge`gd�dZd��ed�d[�d\de`e`e`ge`gd�d]d��ed�d^�d_eggd�d`d��ed�da�dbde`ggd�dcd��ed�dd�deeggd�dfd��ed�dg�dhege`gd�did��ed�dj�dkde`ge`gd�dld��gDZe[diZfiZgehee�D]n\ZiZjejjkefk�rBel�dmejjkefejjkeif��ejjmegk�rjel�dnejjmegejjmeif��eiefejjk<eiegejjm<�q[f[g[i[jiZneeD]Zjejenejjm<�q�[j�d��dp�dq�Zoeo�[o�d��dr�ds�Zp�dtd�Zq�dud�Zr�d��dvd�ZsG�dw�dx��dx�Zt�dyZu�dzZveuev�d{�Zw�d|�d}�Zxey�d~k�
r�ddlzZzezj{�d�d��Z|e|j}�d�ez�~�d���d��d��d��e|j}�d��d�ejez�~�d���d��d��e|j}�d��d��d��d��d��e|j}�d��d�deD�d��d��e|j}�d��d��d��d��d��e|j}�d��d��d��d��d��e|j}�d��d��d��d��d��e|j}�d��d��d��d��e|���Z�e�j��
rPex�n�e�j��
r^�d�ndZ�e�j��
ste|���n�e�e�j��dk�
r�ese�j�de�j�de�j�e��nVe�j��
r�indZ�e�j�D]>Z�e�j�j�e�jk�d��Z�e�j���e��d��ese�e�j�e�e�j�e���
q�dS(�ar"Executable documentation" for the pickle module.

Extensive comments about the pickle protocols and pickle-machine opcodes
can be found here.  Some functions meant for external use:

genops(pickle)
   Generate all the opcodes in a pickle, as (opcode, arg, position) triples.

dis(pickle, out=None, memo=None, indentlevel=4)
   Print a symbolic disassembly of a pickle.
�N�dis�genops�optimize���������������c@seZdZdZdd�ZdS)�ArgumentDescriptor��name�n�reader�doccCs||_||_||_||_dS�Nr)�selfrr
rr�r�#/usr/lib64/python3.8/pickletools.py�__init__�szArgumentDescriptor.__init__N��__name__�
__module__�__qualname__�	__slots__rrrrrr
�sr
)�unpackcCs"|�d�}|r|dStd��dS)zG
    >>> import io
    >>> read_uint1(io.BytesIO(b'\xff'))
    255
    �rz'not enough data in stream to read uint1N)�read�
ValueError��f�datarrr�
read_uint1�s
r!�uint1rzOne-byte unsigned integer.rcCs0|�d�}t|�dkr$td|�dStd��dS)z�
    >>> import io
    >>> read_uint2(io.BytesIO(b'\xff\x00'))
    255
    >>> read_uint2(io.BytesIO(b'\xff\xff'))
    65535
    �z<Hrz'not enough data in stream to read uint2N�r�len�_unpackrrrrr�
read_uint2�s	
r'�uint2r#z)Two-byte unsigned integer, little-endian.cCs0|�d�}t|�dkr$td|�dStd��dS)z�
    >>> import io
    >>> read_int4(io.BytesIO(b'\xff\x00\x00\x00'))
    255
    >>> read_int4(io.BytesIO(b'\x00\x00\x00\x80')) == -(2**31)
    True
    �z<irz&not enough data in stream to read int4Nr$rrrr�	read_int4�s	
r*�int4r)z8Four-byte signed integer, little-endian, 2's complement.cCs0|�d�}t|�dkr$td|�dStd��dS)z�
    >>> import io
    >>> read_uint4(io.BytesIO(b'\xff\x00\x00\x00'))
    255
    >>> read_uint4(io.BytesIO(b'\x00\x00\x00\x80')) == 2**31
    True
    r)z<Irz'not enough data in stream to read uint4Nr$rrrr�
read_uint4s	
r,�uint4z*Four-byte unsigned integer, little-endian.cCs0|�d�}t|�dkr$td|�dStd��dS)z�
    >>> import io
    >>> read_uint8(io.BytesIO(b'\xff\x00\x00\x00\x00\x00\x00\x00'))
    255
    >>> read_uint8(io.BytesIO(b'\xff' * 8)) == 2**64-1
    True
    �z<Qrz'not enough data in stream to read uint8Nr$rrrr�
read_uint8&s	
r/�uint8r.z+Eight-byte unsigned integer, little-endian.TcCs�|��}|�d�std��|dd�}|rtdD]8}|�|�r.|�|�sVtd||f��|dd�}qtq.td|��|r�t�|�d	�d
�}|S)au
    >>> import io
    >>> read_stringnl(io.BytesIO(b"'abcd'\nefg\n"))
    'abcd'

    >>> read_stringnl(io.BytesIO(b"\n"))
    Traceback (most recent call last):
    ...
    ValueError: no string quotes around b''

    >>> read_stringnl(io.BytesIO(b"\n"), stripquotes=False)
    ''

    >>> read_stringnl(io.BytesIO(b"''\n"))
    ''

    >>> read_stringnl(io.BytesIO(b'"abcd"'))
    Traceback (most recent call last):
    ...
    ValueError: no newline found when trying to read stringnl

    Embedded escapes are undone in the result.
    >>> read_stringnl(io.BytesIO(br"'a\n\\b\x00c\td'" + b"\n'e'"))
    'a\n\\b\x00c\td'
    �
z-no newline found when trying to read stringnlNr)�"�'z,strinq quote %r not found at both ends of %rrzno string quotes around %rr�ascii)�readline�endswithr�
startswith�codecs�
escape_decode�decode)rr:�stripquotesr �qrrr�
read_stringnl;s"


�r=�stringnlz�A newline-terminated string.

                   This is a repr-style string, with embedded escapes, and
                   bracketing quotes.
                   cCst|dd�S)NF)r;)r=�rrrr�read_stringnl_noescapetsr@�stringnl_noescapeaA newline-terminated string.

                        This is a str-style string, without embedded escapes,
                        or bracketing quotes.  It should consist solely of
                        printable ASCII characters.
                        cCsdt|�t|�fS)zp
    >>> import io
    >>> read_stringnl_noescape_pair(io.BytesIO(b"Queue\nEmpty\njunk"))
    'Queue Empty'
    z%s %s)r@r?rrr�read_stringnl_noescape_pair�srB�stringnl_noescape_paira�A pair of newline-terminated strings.

                             These are str-style strings, without embedded
                             escapes, or bracketing quotes.  They should
                             consist solely of printable ASCII characters.
                             The pair is returned as a single string, with
                             a single blank separating the two strings.
                             cCs@t|�}|�|�}t|�|kr(|�d�Std|t|�f��dS)z�
    >>> import io
    >>> read_string1(io.BytesIO(b"\x00"))
    ''
    >>> read_string1(io.BytesIO(b"\x03abcdef"))
    'abc'
    �latin-1z2expected %d bytes in a string1, but only %d remainN)r!rr%r:r�rr
r rrr�read_string1�s	


�rF�string1z�A counted string.

              The first argument is a 1-byte unsigned int giving the number
              of bytes in the string, and the second argument is that many
              bytes.
              cCsTt|�}|dkrtd|��|�|�}t|�|kr<|�d�Std|t|�f��dS)aP
    >>> import io
    >>> read_string4(io.BytesIO(b"\x00\x00\x00\x00abc"))
    ''
    >>> read_string4(io.BytesIO(b"\x03\x00\x00\x00abcdef"))
    'abc'
    >>> read_string4(io.BytesIO(b"\x00\x00\x00\x03abcdef"))
    Traceback (most recent call last):
    ...
    ValueError: expected 50331648 bytes in a string4, but only 6 remain
    rzstring4 byte count < 0: %drDz2expected %d bytes in a string4, but only %d remainN)r*rrr%r:rErrr�read_string4�s



�rH�string4z�A counted string.

              The first argument is a 4-byte little-endian signed int giving
              the number of bytes in the string, and the second argument is
              that many bytes.
              cCs:t|�}|�|�}t|�|kr"|Std|t|�f��dS)z�
    >>> import io
    >>> read_bytes1(io.BytesIO(b"\x00"))
    b''
    >>> read_bytes1(io.BytesIO(b"\x03abcdef"))
    b'abc'
    z1expected %d bytes in a bytes1, but only %d remainN)r!rr%rrErrr�read_bytes1�s	

�rJ�bytes1z�A counted bytes string.

              The first argument is a 1-byte unsigned int giving the number
              of bytes, and the second argument is that many bytes.
              cCsPt|�}|tjkrtd|��|�|�}t|�|kr8|Std|t|�f��dS)aN
    >>> import io
    >>> read_bytes4(io.BytesIO(b"\x00\x00\x00\x00abc"))
    b''
    >>> read_bytes4(io.BytesIO(b"\x03\x00\x00\x00abcdef"))
    b'abc'
    >>> read_bytes4(io.BytesIO(b"\x00\x00\x00\x03abcdef"))
    Traceback (most recent call last):
    ...
    ValueError: expected 50331648 bytes in a bytes4, but only 6 remain
    z#bytes4 byte count > sys.maxsize: %dz1expected %d bytes in a bytes4, but only %d remainN)r,�sys�maxsizerrr%rErrr�read_bytes4�s



�rN�bytes4z�A counted bytes string.

              The first argument is a 4-byte little-endian unsigned int giving
              the number of bytes, and the second argument is that many bytes.
              cCsPt|�}|tjkrtd|��|�|�}t|�|kr8|Std|t|�f��dS)a�
    >>> import io, struct, sys
    >>> read_bytes8(io.BytesIO(b"\x00\x00\x00\x00\x00\x00\x00\x00abc"))
    b''
    >>> read_bytes8(io.BytesIO(b"\x03\x00\x00\x00\x00\x00\x00\x00abcdef"))
    b'abc'
    >>> bigsize8 = struct.pack("<Q", sys.maxsize//3)
    >>> read_bytes8(io.BytesIO(bigsize8 + b"abcdef"))  #doctest: +ELLIPSIS
    Traceback (most recent call last):
    ...
    ValueError: expected ... bytes in a bytes8, but only 6 remain
    z#bytes8 byte count > sys.maxsize: %dz1expected %d bytes in a bytes8, but only %d remainN)r/rLrMrrr%rErrr�read_bytes8s


�rP�bytes8z�A counted bytes string.

              The first argument is an 8-byte little-endian unsigned int giving
              the number of bytes, and the second argument is that many bytes.
              cCsTt|�}|tjkrtd|��|�|�}t|�|kr<t|�Std|t|�f��dS)a�
    >>> import io, struct, sys
    >>> read_bytearray8(io.BytesIO(b"\x00\x00\x00\x00\x00\x00\x00\x00abc"))
    bytearray(b'')
    >>> read_bytearray8(io.BytesIO(b"\x03\x00\x00\x00\x00\x00\x00\x00abcdef"))
    bytearray(b'abc')
    >>> bigsize8 = struct.pack("<Q", sys.maxsize//3)
    >>> read_bytearray8(io.BytesIO(bigsize8 + b"abcdef"))  #doctest: +ELLIPSIS
    Traceback (most recent call last):
    ...
    ValueError: expected ... bytes in a bytearray8, but only 6 remain
    z'bytearray8 byte count > sys.maxsize: %dz5expected %d bytes in a bytearray8, but only %d remainN)r/rLrMrrr%�	bytearrayrErrr�read_bytearray89s


�rS�
bytearray8z�A counted bytearray.

              The first argument is an 8-byte little-endian unsigned int giving
              the number of bytes, and the second argument is that many bytes.
              cCs0|��}|�d�std��|dd�}t|d�S)zm
    >>> import io
    >>> read_unicodestringnl(io.BytesIO(b"abc\\uabcd\njunk")) == 'abc\uabcd'
    True
    r1z4no newline found when trying to read unicodestringnlNrzraw-unicode-escape)r5r6r�strrrrr�read_unicodestringnl[s

rV�unicodestringnlz�A newline-terminated Unicode string.

                      This is raw-unicode-escape encoded, so consists of
                      printable ASCII characters, and may contain embedded
                      escape sequences.
                      cCsBt|�}|�|�}t|�|kr*t|dd�Std|t|�f��dS)a�
    >>> import io
    >>> s = 'abcd\uabcd'
    >>> enc = s.encode('utf-8')
    >>> enc
    b'abcd\xea\xaf\x8d'
    >>> n = bytes([len(enc)])  # little-endian 1-byte length
    >>> t = read_unicodestring1(io.BytesIO(n + enc + b'junk'))
    >>> s == t
    True

    >>> read_unicodestring1(io.BytesIO(n + enc[:-1]))
    Traceback (most recent call last):
    ...
    ValueError: expected 7 bytes in a unicodestring1, but only 6 remain
    �utf-8�
surrogatepassz9expected %d bytes in a unicodestring1, but only %d remainN)r!rr%rUrrErrr�read_unicodestring1us

�rZ�unicodestring1aAA counted Unicode string.

                    The first argument is a 1-byte little-endian signed int
                    giving the number of bytes in the string, and the second
                    argument-- the UTF-8 encoding of the Unicode string --
                    contains that many bytes.
                    cCsXt|�}|tjkrtd|��|�|�}t|�|kr@t|dd�Std|t|�f��dS)a�
    >>> import io
    >>> s = 'abcd\uabcd'
    >>> enc = s.encode('utf-8')
    >>> enc
    b'abcd\xea\xaf\x8d'
    >>> n = bytes([len(enc), 0, 0, 0])  # little-endian 4-byte length
    >>> t = read_unicodestring4(io.BytesIO(n + enc + b'junk'))
    >>> s == t
    True

    >>> read_unicodestring4(io.BytesIO(n + enc[:-1]))
    Traceback (most recent call last):
    ...
    ValueError: expected 7 bytes in a unicodestring4, but only 6 remain
    z+unicodestring4 byte count > sys.maxsize: %drXrYz9expected %d bytes in a unicodestring4, but only %d remainN)r,rLrMrrr%rUrErrr�read_unicodestring4�s


�r\�unicodestring4aAA counted Unicode string.

                    The first argument is a 4-byte little-endian signed int
                    giving the number of bytes in the string, and the second
                    argument-- the UTF-8 encoding of the Unicode string --
                    contains that many bytes.
                    cCsXt|�}|tjkrtd|��|�|�}t|�|kr@t|dd�Std|t|�f��dS)a�
    >>> import io
    >>> s = 'abcd\uabcd'
    >>> enc = s.encode('utf-8')
    >>> enc
    b'abcd\xea\xaf\x8d'
    >>> n = bytes([len(enc)]) + b'\0' * 7  # little-endian 8-byte length
    >>> t = read_unicodestring8(io.BytesIO(n + enc + b'junk'))
    >>> s == t
    True

    >>> read_unicodestring8(io.BytesIO(n + enc[:-1]))
    Traceback (most recent call last):
    ...
    ValueError: expected 7 bytes in a unicodestring8, but only 6 remain
    z+unicodestring8 byte count > sys.maxsize: %drXrYz9expected %d bytes in a unicodestring8, but only %d remainN)r/rLrMrrr%rUrErrr�read_unicodestring8�s


�r^�unicodestring8aBA counted Unicode string.

                    The first argument is an 8-byte little-endian signed int
                    giving the number of bytes in the string, and the second
                    argument-- the UTF-8 encoding of the Unicode string --
                    contains that many bytes.
                    cCs.t|ddd�}|dkrdS|dkr&dSt|�S)z�
    >>> import io
    >>> read_decimalnl_short(io.BytesIO(b"1234\n56"))
    1234

    >>> read_decimalnl_short(io.BytesIO(b"1234L\n56"))
    Traceback (most recent call last):
    ...
    ValueError: invalid literal for int() with base 10: b'1234L'
    F�r:r;s00s01T�r=�int�r�srrr�read_decimalnl_short�srecCs2t|ddd�}|dd�dkr*|dd�}t|�S)z�
    >>> import io

    >>> read_decimalnl_long(io.BytesIO(b"1234L\n56"))
    1234

    >>> read_decimalnl_long(io.BytesIO(b"123456789012345678901234L\n6"))
    123456789012345678901234
    Fr`rN�Lrarcrrr�read_decimalnl_longsrg�decimalnl_shorta�A newline-terminated decimal integer literal.

                          This never has a trailing 'L', and the integer fit
                          in a short Python int on the box where the pickle
                          was written -- but there's no guarantee it will fit
                          in a short Python int on the box where the pickle
                          is read.
                          �decimalnl_longz�A newline-terminated decimal integer literal.

                         This has a trailing 'L', and can represent integers
                         of any size.
                         cCst|ddd�}t|�S)zO
    >>> import io
    >>> read_floatnl(io.BytesIO(b"-1.25\n6"))
    -1.25
    Fr`)r=�floatrcrrr�read_floatnl-srk�floatnla�A newline-terminated decimal floating literal.

              In general this requires 17 significant digits for roundtrip
              identity, and pickling then unpickling infinities, NaNs, and
              minus zero doesn't work across boxes, or on some boxes even
              on itself (e.g., Windows can't read the strings it produces
              for infinities or NaNs).
              cCs0|�d�}t|�dkr$td|�dStd��dS)z�
    >>> import io, struct
    >>> raw = struct.pack(">d", -1.25)
    >>> raw
    b'\xbf\xf4\x00\x00\x00\x00\x00\x00'
    >>> read_float8(io.BytesIO(raw + b"\n"))
    -1.25
    r.z>drz(not enough data in stream to read float8Nr$rrrr�read_float8Cs

rm�float8aAn 8-byte binary representation of a float, big-endian.

             The format is unique to Python, and shared with the struct
             module (format string '>d') "in theory" (the struct and pickle
             implementations don't share the code -- they should).  It's
             strongly related to the IEEE-754 double format, and, in normal
             cases, is in fact identical to the big-endian 754 double format.
             On other boxes the dynamic range is limited to that of a 754
             double, and "add a half and chop" rounding is used to reduce
             the precision to 53 bits.  However, even on a 754 box,
             infinities, NaNs, and minus zero may not be handled correctly
             (may not survive roundtrip pickling intact).
             )�decode_longcCs.t|�}|�|�}t|�|kr&td��t|�S)a+
    >>> import io
    >>> read_long1(io.BytesIO(b"\x00"))
    0
    >>> read_long1(io.BytesIO(b"\x02\xff\x00"))
    255
    >>> read_long1(io.BytesIO(b"\x02\xff\x7f"))
    32767
    >>> read_long1(io.BytesIO(b"\x02\x00\xff"))
    -256
    >>> read_long1(io.BytesIO(b"\x02\x00\x80"))
    -32768
    z'not enough data in stream to read long1)r!rr%rrorErrr�
read_long1is

rp�long1aA binary long, little-endian, using 1-byte size.

    This first reads one byte as an unsigned size, then reads that
    many bytes and interprets them as a little-endian 2's-complement long.
    If the size is 0, that's taken as a shortcut for the long 0L.
    cCsBt|�}|dkrtd|��|�|�}t|�|kr:td��t|�S)ag
    >>> import io
    >>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\xff\x00"))
    255
    >>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\xff\x7f"))
    32767
    >>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\x00\xff"))
    -256
    >>> read_long4(io.BytesIO(b"\x02\x00\x00\x00\x00\x80"))
    -32768
    >>> read_long1(io.BytesIO(b"\x00\x00\x00\x00"))
    0
    rzlong4 byte count < 0: %dz'not enough data in stream to read long4)r*rrr%rorErrr�
read_long4�s
rr�long4a�A binary representation of a long, little-endian.

    This first reads four bytes as a signed size (but requires the
    size to be >= 0), then reads that many bytes and interprets them
    as a little-endian 2's-complement long.  If the size is 0, that's taken
    as a shortcut for the int 0, although LONG1 should really be used
    then instead (and in any case where # of bytes < 256).
    c@s eZdZdZdd�Zdd�ZdS)�StackObject�r�obtypercCs*||_t|t�r|D]}q||_||_dSr)r�
isinstance�tuplervr)rrrvrZ	containedrrrr�s
zStackObject.__init__cCs|jSr�r)rrrr�__repr__�szStackObject.__repr__N)rrrrrrzrrrrrt�s
rtrbzA Python integer object.ruZint_or_boolz#A Python integer or boolean object.�boolzA Python boolean object.rjzA Python float object.Zbytes_or_strz*A Python bytes or (Unicode) string object.�byteszA Python bytes object.rRzA Python bytearray object.rUz!A Python (Unicode) string object.�NonezThe Python None object.rxzA Python tuple object.�listzA Python list object.�dictzA Python dict object.�setzA Python set object.�	frozensetzA Python frozenset object.�bufferzA Python buffer-like object.�anyzAny kind of object whatsoever.Zmarkaz'The mark' is a unique object.

Opcodes that operate on a variable number of objects
generally don't embed the count of objects in the opcode,
or pull it off the stack.  Instead the MARK opcode is used
to push a special marker object on the stack, and then
some other opcodes grab all the objects from the top of
the stack down to (but not including) the topmost marker
object.
�
stackslicea�An object representing a contiguous slice of the stack.

This is used in conjunction with markobject, to represent all
of the stack following the topmost markobject.  For example,
the POP_MARK opcode changes the stack from

    [..., markobject, stackslice]
to
    [...]

No matter how many object are on the stack after the topmost
markobject, POP_MARK gets rid of all of them (including the
topmost markobject too).
c@seZdZdZdd�ZdS)�
OpcodeInfo�r�code�arg�stack_before�stack_after�protorc	CsB||_||_||_|D]}q||_|D]}q&||_||_||_dSrr�)	rrr�r�r�r�r�r�xrrrrdszOpcodeInfo.__init__Nrrrrrr�Esr�ZINT�Ia�Push an integer or bool.

      The argument is a newline-terminated decimal literal string.

      The intent may have been that this always fit in a short Python int,
      but INT can be generated in pickles written on a 64-bit box that
      require a Python long on a 32-bit box.  The difference between this
      and LONG then is that INT skips a trailing 'L', and produces a short
      int whenever possible.

      Another difference is due to that, when bool was introduced as a
      distinct type in 2.3, builtin names True and False were also added to
      2.2.2, mapping to ints 1 and 0.  For compatibility in both directions,
      True gets pickled as INT + "I01\n", and False as INT + "I00\n".
      Leading zeroes are never produced for a genuine integer.  The 2.3
      (and later) unpicklers special-case these and return bool instead;
      earlier unpicklers ignore the leading "0" and return the int.
      r�ZBININT�Ja1Push a four-byte signed integer.

      This handles the full range of Python (short) integers on a 32-bit
      box, directly as binary bytes (1 for the opcode and 4 for the integer).
      If the integer is non-negative and fits in 1 or 2 bytes, pickling via
      BININT1 or BININT2 saves space.
      ZBININT1�Kz�Push a one-byte unsigned integer.

      This is a space optimization for pickling very small non-negative ints,
      in range(256).
      ZBININT2�Mz�Push a two-byte unsigned integer.

      This is a space optimization for pickling small positive ints, in
      range(256, 2**16).  Integers in range(256) can also be pickled via
      BININT2, but BININT1 instead saves a byte.
      ZLONG�La�Push a long integer.

      The same as INT, except that the literal ends with 'L', and always
      unpickles to a Python long.  There doesn't seem a real purpose to the
      trailing 'L'.

      Note that LONG takes time quadratic in the number of digits when
      unpickling (this is simply due to the nature of decimal->binary
      conversion).  Proto 2 added linear-time (in C; still quadratic-time
      in Python) LONG1 and LONG4 opcodes.
      ZLONG1�Šz|Long integer using one-byte length.

      A more efficient encoding of a Python long; the long1 encoding
      says it all.ZLONG4�‹z~Long integer using found-byte length.

      A more efficient encoding of a Python long; the long4 encoding
      says it all.�STRING�Sa�Push a Python string object.

      The argument is a repr-style string, with bracketing quote characters,
      and perhaps embedded escapes.  The argument extends until the next
      newline character.  These are usually decoded into a str instance
      using the encoding given to the Unpickler constructor. or the default,
      'ASCII'.  If the encoding given was 'bytes' however, they will be
      decoded as bytes object instead.
      Z	BINSTRING�Ta�Push a Python string object.

      There are two arguments: the first is a 4-byte little-endian
      signed int giving the number of bytes in the string, and the
      second is that many bytes, which are taken literally as the string
      content.  These are usually decoded into a str instance using the
      encoding given to the Unpickler constructor. or the default,
      'ASCII'.  If the encoding given was 'bytes' however, they will be
      decoded as bytes object instead.
      ZSHORT_BINSTRING�Ua�Push a Python string object.

      There are two arguments: the first is a 1-byte unsigned int giving
      the number of bytes in the string, and the second is that many
      bytes, which are taken literally as the string content.  These are
      usually decoded into a str instance using the encoding given to
      the Unpickler constructor. or the default, 'ASCII'.  If the
      encoding given was 'bytes' however, they will be decoded as bytes
      object instead.
      ZBINBYTES�B�z�Push a Python bytes object.

      There are two arguments:  the first is a 4-byte little-endian unsigned int
      giving the number of bytes, and the second is that many bytes, which are
      taken literally as the bytes content.
      ZSHORT_BINBYTES�Cz�Push a Python bytes object.

      There are two arguments:  the first is a 1-byte unsigned int giving
      the number of bytes, and the second is that many bytes, which are taken
      literally as the string content.
      Z	BINBYTES8�Žz�Push a Python bytes object.

      There are two arguments:  the first is an 8-byte unsigned int giving
      the number of bytes in the string, and the second is that many bytes,
      which are taken literally as the string content.
      Z
BYTEARRAY8�–�z�Push a Python bytearray object.

      There are two arguments:  the first is an 8-byte unsigned int giving
      the number of bytes in the bytearray, and the second is that many bytes,
      which are taken literally as the bytearray content.
      ZNEXT_BUFFER�—z"Push an out-of-band buffer object.ZREADONLY_BUFFER�˜z,Make an out-of-band buffer object read-only.ZNONE�NzPush None on the stack.ZNEWTRUE�ˆzPush True onto the stack.ZNEWFALSE�‰zPush False onto the stack.�UNICODE�Vz�Push a Python Unicode string object.

      The argument is a raw-unicode-escape encoding of a Unicode string,
      and so may contain embedded escape sequences.  The argument extends
      until the next newline character.
      ZSHORT_BINUNICODE�ŒaPush a Python Unicode string object.

      There are two arguments:  the first is a 1-byte little-endian signed int
      giving the number of bytes in the string.  The second is that many
      bytes, and is the UTF-8 encoding of the Unicode string.
      Z
BINUNICODE�XaPush a Python Unicode string object.

      There are two arguments:  the first is a 4-byte little-endian unsigned int
      giving the number of bytes in the string.  The second is that many
      bytes, and is the UTF-8 encoding of the Unicode string.
      ZBINUNICODE8�aPush a Python Unicode string object.

      There are two arguments:  the first is an 8-byte little-endian signed int
      giving the number of bytes in the string.  The second is that many
      bytes, and is the UTF-8 encoding of the Unicode string.
      ZFLOAT�Fa�Newline-terminated decimal float literal.

      The argument is repr(a_float), and in general requires 17 significant
      digits for roundtrip conversion to be an identity (this is so for
      IEEE-754 double precision values, which is what Python float maps to
      on most boxes).

      In general, FLOAT cannot be used to transport infinities, NaNs, or
      minus zero across boxes (or even on a single box, if the platform C
      library can't read the strings it produces for such things -- Windows
      is like that), but may do less damage than BINFLOAT on boxes with
      greater precision or dynamic range than IEEE-754 double.
      ZBINFLOAT�Ga�Float stored in binary form, with 8 bytes of data.

      This generally requires less than half the space of FLOAT encoding.
      In general, BINFLOAT cannot be used to transport infinities, NaNs, or
      minus zero, raises an exception if the exponent exceeds the range of
      an IEEE-754 double, and retains no more than 53 bits of precision (if
      there are more than that, "add a half and chop" rounding is used to
      cut it back to 53 significant bits).
      Z
EMPTY_LIST�]zPush an empty list.ZAPPEND�az�Append an object to a list.

      Stack before:  ... pylist anyobject
      Stack after:   ... pylist+[anyobject]

      although pylist is really extended in-place.
      ZAPPENDS�ez�Extend a list by a slice of stack objects.

      Stack before:  ... pylist markobject stackslice
      Stack after:   ... pylist+stackslice

      although pylist is really extended in-place.
      ZLIST�lasBuild a list out of the topmost stack slice, after markobject.

      All the stack entries following the topmost markobject are placed into
      a single Python list, which single list object replaces all of the
      stack from the topmost markobject onward.  For example,

      Stack before: ... markobject 1 2 3 'abc'
      Stack after:  ... [1, 2, 3, 'abc']
      ZEMPTY_TUPLE�)zPush an empty tuple.ZTUPLE�tavBuild a tuple out of the topmost stack slice, after markobject.

      All the stack entries following the topmost markobject are placed into
      a single Python tuple, which single tuple object replaces all of the
      stack from the topmost markobject onward.  For example,

      Stack before: ... markobject 1 2 3 'abc'
      Stack after:  ... (1, 2, 3, 'abc')
      ZTUPLE1�…z�Build a one-tuple out of the topmost item on the stack.

      This code pops one value off the stack and pushes a tuple of
      length 1 whose one item is that value back onto it.  In other
      words:

          stack[-1] = tuple(stack[-1:])
      ZTUPLE2�†aBuild a two-tuple out of the top two items on the stack.

      This code pops two values off the stack and pushes a tuple of
      length 2 whose items are those values back onto it.  In other
      words:

          stack[-2:] = [tuple(stack[-2:])]
      ZTUPLE3�‡aBuild a three-tuple out of the top three items on the stack.

      This code pops three values off the stack and pushes a tuple of
      length 3 whose items are those values back onto it.  In other
      words:

          stack[-3:] = [tuple(stack[-3:])]
      Z
EMPTY_DICT�}zPush an empty dict.ZDICT�da�Build a dict out of the topmost stack slice, after markobject.

      All the stack entries following the topmost markobject are placed into
      a single Python dict, which single dict object replaces all of the
      stack from the topmost markobject onward.  The stack slice alternates
      key, value, key, value, ....  For example,

      Stack before: ... markobject 1 2 3 'abc'
      Stack after:  ... {1: 2, 3: 'abc'}
      ZSETITEMrdz�Add a key+value pair to an existing dict.

      Stack before:  ... pydict key value
      Stack after:   ... pydict

      where pydict has been modified via pydict[key] = value.
      ZSETITEMS�ua\Add an arbitrary number of key+value pairs to an existing dict.

      The slice of the stack following the topmost markobject is taken as
      an alternating sequence of keys and values, added to the dict
      immediately under the topmost markobject.  Everything at and after the
      topmost markobject is popped, leaving the mutated dict at the top
      of the stack.

      Stack before:  ... pydict markobject key_1 value_1 ... key_n value_n
      Stack after:   ... pydict

      where pydict has been modified via pydict[key_i] = value_i for i in
      1, 2, ..., n, and in that order.
      Z	EMPTY_SET�zPush an empty set.ZADDITEMS�a$Add an arbitrary number of items to an existing set.

      The slice of the stack following the topmost markobject is taken as
      a sequence of items, added to the set immediately under the topmost
      markobject.  Everything at and after the topmost markobject is popped,
      leaving the mutated set at the top of the stack.

      Stack before:  ... pyset markobject item_1 ... item_n
      Stack after:   ... pyset

      where pyset has been modified via pyset.add(item_i) = item_i for i in
      1, 2, ..., n, and in that order.
      Z	FROZENSET�‘azBuild a frozenset out of the topmost slice, after markobject.

      All the stack entries following the topmost markobject are placed into
      a single Python frozenset, which single frozenset object replaces all
      of the stack from the topmost markobject onward.  For example,

      Stack before: ... markobject 1 2 3
      Stack after:  ... frozenset({1, 2, 3})
      �POP�0z<Discard the top stack item, shrinking the stack by one item.ZDUP�2z=Push the top stack item onto the stack again, duplicating it.�MARK�(z�Push markobject onto the stack.

      markobject is a unique object, used by other opcodes to identify a
      region of the stack containing a variable number of objects for them
      to work on.  See markobject.doc for more detail.
      ZPOP_MARK�1aPop all the stack objects at and above the topmost markobject.

      When an opcode using a variable number of stack objects is done,
      POP_MARK is used to remove those objects, and to remove the markobject
      that delimited their starting position on the stack.
      �GET�gz�Read an object from the memo and push it on the stack.

      The index of the memo object to push is given by the newline-terminated
      decimal string following.  BINGET and LONG_BINGET are space-optimized
      versions.
      �BINGET�hz�Read an object from the memo and push it on the stack.

      The index of the memo object to push is given by the 1-byte unsigned
      integer following.
      �LONG_BINGET�jz�Read an object from the memo and push it on the stack.

      The index of the memo object to push is given by the 4-byte unsigned
      little-endian integer following.
      �PUT�pz�Store the stack top into the memo.  The stack is not popped.

      The index of the memo location to write into is given by the newline-
      terminated decimal string following.  BINPUT and LONG_BINPUT are
      space-optimized versions.
      �BINPUTr<z�Store the stack top into the memo.  The stack is not popped.

      The index of the memo location to write into is given by the 1-byte
      unsigned integer following.
      �LONG_BINPUT�rz�Store the stack top into the memo.  The stack is not popped.

      The index of the memo location to write into is given by the 4-byte
      unsigned little-endian integer following.
      �MEMOIZE�”z�Store the stack top into the memo.  The stack is not popped.

      The index of the memo location to write is the number of
      elements currently present in the memo.
      ZEXT1�‚a�Extension code.

      This code and the similar EXT2 and EXT4 allow using a registry
      of popular objects that are pickled by name, typically classes.
      It is envisioned that through a global negotiation and
      registration process, third parties can set up a mapping between
      ints and object names.

      In order to guarantee pickle interchangeability, the extension
      code registry ought to be global, although a range of codes may
      be reserved for private use.

      EXT1 has a 1-byte integer argument.  This is used to index into the
      extension registry, and the object at that index is pushed on the stack.
      ZEXT2�ƒzNExtension code.

      See EXT1.  EXT2 has a two-byte integer argument.
      ZEXT4�„zOExtension code.

      See EXT1.  EXT4 has a four-byte integer argument.
      ZGLOBAL�ca�Push a global object (module.attr) on the stack.

      Two newline-terminated strings follow the GLOBAL opcode.  The first is
      taken as a module name, and the second as a class name.  The class
      object module.class is pushed on the stack.  More accurately, the
      object returned by self.find_class(module, class) is pushed on the
      stack, so unpickling subclasses can override this form of lookup.
      ZSTACK_GLOBAL�“z7Push a global object (module.attr) on the stack.
      ZREDUCE�RaLPush an object built from a callable and an argument tuple.

      The opcode is named to remind of the __reduce__() method.

      Stack before: ... callable pytuple
      Stack after:  ... callable(*pytuple)

      The callable and the argument tuple are the first two items returned
      by a __reduce__ method.  Applying the callable to the argtuple is
      supposed to reproduce the original object, or at least get it started.
      If the __reduce__ method returns a 3-tuple, the last component is an
      argument to be passed to the object's __setstate__, and then the REDUCE
      opcode is followed by code to create setstate's argument, and then a
      BUILD opcode to apply  __setstate__ to that argument.

      If not isinstance(callable, type), REDUCE complains unless the
      callable has been registered with the copyreg module's
      safe_constructors dict, or the callable has a magic
      '__safe_for_unpickling__' attribute with a true value.  I'm not sure
      why it does this, but I've sure seen this complaint often enough when
      I didn't want to <wink>.
      ZBUILD�ba�Finish building an object, via __setstate__ or dict update.

      Stack before: ... anyobject argument
      Stack after:  ... anyobject

      where anyobject may have been mutated, as follows:

      If the object has a __setstate__ method,

          anyobject.__setstate__(argument)

      is called.

      Else the argument must be a dict, the object must have a __dict__, and
      the object is updated via

          anyobject.__dict__.update(argument)
      ZINST�iaqBuild a class instance.

      This is the protocol 0 version of protocol 1's OBJ opcode.
      INST is followed by two newline-terminated strings, giving a
      module and class name, just as for the GLOBAL opcode (and see
      GLOBAL for more details about that).  self.find_class(module, name)
      is used to get a class object.

      In addition, all the objects on the stack following the topmost
      markobject are gathered into a tuple and popped (along with the
      topmost markobject), just as for the TUPLE opcode.

      Now it gets complicated.  If all of these are true:

        + The argtuple is empty (markobject was at the top of the stack
          at the start).

        + The class object does not have a __getinitargs__ attribute.

      then we want to create an old-style class instance without invoking
      its __init__() method (pickle has waffled on this over the years; not
      calling __init__() is current wisdom).  In this case, an instance of
      an old-style dummy class is created, and then we try to rebind its
      __class__ attribute to the desired class object.  If this succeeds,
      the new instance object is pushed on the stack, and we're done.

      Else (the argtuple is not empty, it's not an old-style class object,
      or the class object does have a __getinitargs__ attribute), the code
      first insists that the class object have a __safe_for_unpickling__
      attribute.  Unlike as for the __safe_for_unpickling__ check in REDUCE,
      it doesn't matter whether this attribute has a true or false value, it
      only matters whether it exists (XXX this is a bug).  If
      __safe_for_unpickling__ doesn't exist, UnpicklingError is raised.

      Else (the class object does have a __safe_for_unpickling__ attr),
      the class object obtained from INST's arguments is applied to the
      argtuple obtained from the stack, and the resulting instance object
      is pushed on the stack.

      NOTE:  checks for __safe_for_unpickling__ went away in Python 2.3.
      NOTE:  the distinction between old-style and new-style classes does
             not make sense in Python 3.
      ZOBJ�oa�Build a class instance.

      This is the protocol 1 version of protocol 0's INST opcode, and is
      very much like it.  The major difference is that the class object
      is taken off the stack, allowing it to be retrieved from the memo
      repeatedly if several instances of the same class are created.  This
      can be much more efficient (in both time and space) than repeatedly
      embedding the module and class names in INST opcodes.

      Unlike INST, OBJ takes no arguments from the opcode stream.  Instead
      the class object is taken off the stack, immediately above the
      topmost markobject:

      Stack before: ... markobject classobject stackslice
      Stack after:  ... new_instance_object

      As for INST, the remainder of the stack above the markobject is
      gathered into an argument tuple, and then the logic seems identical,
      except that no __safe_for_unpickling__ check is done (XXX this is
      a bug).  See INST for the gory details.

      NOTE:  In Python 2.3, INST and OBJ are identical except for how they
      get the class object.  That was always the intent; the implementations
      had diverged for accidental reasons.
      ZNEWOBJ�aLBuild an object instance.

      The stack before should be thought of as containing a class
      object followed by an argument tuple (the tuple being the stack
      top).  Call these cls and args.  They are popped off the stack,
      and the value returned by cls.__new__(cls, *args) is pushed back
      onto the stack.
      Z	NEWOBJ_EX�’auBuild an object instance.

      The stack before should be thought of as containing a class
      object followed by an argument tuple and by a keyword argument dict
      (the dict being the stack top).  Call these cls and args.  They are
      popped off the stack, and the value returned by
      cls.__new__(cls, *args, *kwargs) is  pushed back  onto the stack.
      �PROTO�€z�Protocol version indicator.

      For protocol 2 and above, a pickle must start with this opcode.
      The argument is the protocol version, an int in range(2, 256).
      ZSTOP�.z�Stop the unpickling machine.

      Every pickle ends with this opcode.  The object at the top of the stack
      is popped, and that's the result of unpickling.  The stack should be
      empty then.
      �FRAME�•z�Indicate the beginning of a new frame.

      The unpickler may use this opcode to safely prefetch data from its
      underlying stream.
      ZPERSID�PaPush an object identified by a persistent ID.

      The pickle module doesn't define what a persistent ID means.  PERSID's
      argument is a newline-terminated str-style (no embedded escapes, no
      bracketing quote characters) string, which *is* "the persistent ID".
      The unpickler passes this string to self.persistent_load().  Whatever
      object that returns is pushed on the stack.  There is no implementation
      of persistent_load() in Python's unpickler:  it must be supplied by an
      unpickler subclass.
      Z	BINPERSID�QaXPush an object identified by a persistent ID.

      Like PERSID, except the persistent ID is popped off the stack (instead
      of being a string embedded in the opcode bytestream).  The persistent
      ID is passed to self.persistent_load(), and whatever object that
      returns is pushed on the stack.  See PERSID for more detail.
      z%repeated name %r at indices %d and %dz%repeated code %r at indices %d and %dFcCst��}tjD]�}t�d|�s0|rtd|�qtt|�}t|t	�rPt
|�dkrf|rtd||f�q|�d�}||kr�|r�td||f�||}|j|kr�t
d|||jf��||=qt
d||f��q|�rd	g}|��D]\}}|�d
|j|f�q�t
d�|���dS)Nz[A-Z][A-Z0-9_]+$z0skipping %r: it doesn't look like an opcode namerz5skipping %r: value %r doesn't look like a pickle coderDz+checking name %r w/ code %r for consistencyzBfor pickle code %r, pickle.py uses name %r but we're using name %rzPpickle.py appears to have a pickle opcode with name %r and code %r, but we don'tz=we appear to have pickle opcodes that pickle.py doesn't have:z    name %r with code %r�
)�code2op�copy�pickle�__all__�re�match�print�getattrrwr|r%r:rr�items�append�join)�verboser�rZ
picklecoder��msgr�rrr�assure_pickle_consistency�sJ

�
�
���r�ccs�t|t�rt�|�}t|d�r&|j}ndd�}|�}|�d�}t�|�	d��}|dkr�|dkrht
d��nt
d|dkrxd	n||f��|jdkr�d}n|j�|�}|r�||||�fVn|||fV|d
kr.q�q.dS)N�tellcSsdSrrrrrr�<lambda>��z_genops.<locals>.<lambda>rrDr�z#pickle exhausted before seeing STOPz!at position %s, opcode %r unknownz	<unknown>�.)
rw�bytes_types�io�BytesIO�hasattrr�rr��getr:rr�r)r �
yield_end_posZgetpos�posr��opcoder�rrr�_genops�s.




�
r�cCst|�S)axGenerate all the opcodes in a pickle.

    'pickle' is a file-like object, or string, containing the pickle.

    Each opcode in the pickle is generated, from the current pickle position,
    stopping after a STOP opcode is delivered.  A triple is generated for
    each opcode:

        opcode, arg, pos

    opcode is an OpcodeInfo record, describing the current opcode.

    If the opcode has an argument embedded in the pickle, arg is its decoded
    value, as a Python object.  If the opcode doesn't have an argument, arg
    is None.

    If the pickle has a tell() method, pos was the value of pickle.tell()
    before reading the current opcode.  If the pickle is a bytes object,
    it's wrapped in a BytesIO object, and the latter's tell() result is
    used.  Else (the pickle doesn't have a tell(), and it's not obvious how
    to query its current position) pos is None.
    )r�)r�rrrr�scCsd}d}t�}i}g}d}d}t|dd�D]�\}}	}
}d|jkrZ|�|	�|�||	f�q*|jdkr�t|�}|�|�|�||f�q*d|jkr�q*d|jkr�|j|kr�|j}d	||	<|�||	f�q*|jd
k�r|	|kr�|	}|
dkr�||
|�}n|�|
|f�q*|�|
|f�q*~t��}
|
�	|�t
�|
|�}|dk�rF|j�
�d}|D]�\}}	d}||k�r�|	|k�rr�qN|�|�}|||	<|d
7}n6||k�r�|�||	�}n|||	�}t|�|jjk}|jj|d�|�r�|j�|�n
|�	|��qN|j��|
��S)z7Optimize a pickle string by removing unused PUT opcodesr�r�rr�T)r�r�r�Nr�r)Fr)Zforce)r�r�r�addr�r%r�r�r��writer�Z_PicklerZframerZ
start_framing�putr�Z_FRAME_SIZE_TARGETZcommit_frameZ
file_writeZend_framing�getvalue)r�r�r�ZoldidsZnewids�opcodesr�Zprotoheaderr�r�r�Zend_pos�idx�outZpickler�opZ	framelessr rrrr	sl















c	Csg}|dkri}d}g}d|}d}	|}
t|�D�]�\}}}
|
dk	rVtd|
d|d�dt|j�dd�|t|�|jf}t||j�}|j}|j	}t|�}d}t
|ks�|jdk�r@|�r@|dt
k�r@|�r8|��}|dkr�d	}nd
|}|dt
k	�r|��q�|��z|�t
�}Wnt
k
�r4d}YnXnd}	}|jd
k�r�|jdk�rjt|�}d|}n|}||k�r�d|}	n,|�s�d}	n |dt
k�r�d}	n|d||<n*|jdk�r�||k�r�||g}nd|}	|dk	�s�|�r,|ddt|j�7}|dk	�r|dt|�7}|�r,|d|7}|�rv|d|
t|�7}t|�}
|
dk�r\|}
|d|j�dd�d7}t||d�|	�r�t
|	��t|�|k�r�t
d|t|�f��|�r�||d�=t
|k�r�|�|
�|�|�q0td||d�|�rt
d|��dS)aKProduce a symbolic disassembly of a pickle.

    'pickle' is a file-like object, or string, containing a (at least one)
    pickle.  The pickle is disassembled from the current position, through
    the first STOP opcode encountered.

    Optional arg 'out' is a file-like object to which the disassembly is
    printed.  It defaults to sys.stdout.

    Optional arg 'memo' is a Python dict, used as the pickle's memo.  It
    may be mutated by dis(), if the pickle contains PUT or BINPUT opcodes.
    Passing the same memo object to another dis() call then allows disassembly
    to proceed across multiple pickles that were all created by the same
    pickler with the same memo.  Ordinarily you don't need to worry about this.

    Optional arg 'indentlevel' is the number of blanks by which to indent
    a new MARK level.  It defaults to 4.

    Optional arg 'annotate' if nonzero instructs dis() to add short
    description of the opcode on each line of disassembled output.
    The value given to 'annotate' must be an integer and is used as a
    hint for the column where annotation should start.  The default
    value is 0, meaning no annotations.

    In addition to printing the disassembly, some sanity checks are made:

    + All embedded opcode arguments "make sense".

    + Explicit and implicit pop operations have enough items on the stack.

    + When an opcode implicitly refers to a markobject, a markobject is
      actually on the stack.

    + A memo entry isn't referenced before it's defined.

    + The markobject isn't stored in the memo.

    + A memo entry isn't redefined.
    Nr� z%5d:)�end�filez	%-4s %s%srr�z(MARK at unknown opcode offset)z(MARK at %d)rzno MARK exists on stack)r�r�r�r�r�z(as %d)zmemo key %r already definedz'stack is empty -- can't store into memoz"can't store markobject in the memo)r�r�r�z&memo key %r has never been stored into�
�2r�)rz3tries to pop %d items from stack with only %d itemsz highest protocol among opcodes =zstack not empty after STOP: %r)rr��reprr�r%r�maxr�r�r��
markobject�pop�indexrr�splitr��extend)r�r�memo�indentlevel�annotate�stackZmaxprotoZ	markstackZindentchunkZerrormsgZannocolr�r�r��lineZbeforeZafterZnumtopopZmarkmsgZmarkposZmemo_idxrrrr[	s�-
��
�







�

c@seZdZdd�ZdS)�_ExamplecCs
||_dSr)�value)rrrrrr�	sz_Example.__init__N)rrrrrrrrr�	sra�
>>> import pickle
>>> x = [1, 2, (3, 4), {b'abc': "def"}]
>>> pkl0 = pickle.dumps(x, 0)
>>> dis(pkl0)
    0: (    MARK
    1: l        LIST       (MARK at 0)
    2: p    PUT        0
    5: I    INT        1
    8: a    APPEND
    9: I    INT        2
   12: a    APPEND
   13: (    MARK
   14: I        INT        3
   17: I        INT        4
   20: t        TUPLE      (MARK at 13)
   21: p    PUT        1
   24: a    APPEND
   25: (    MARK
   26: d        DICT       (MARK at 25)
   27: p    PUT        2
   30: c    GLOBAL     '_codecs encode'
   46: p    PUT        3
   49: (    MARK
   50: V        UNICODE    'abc'
   55: p        PUT        4
   58: V        UNICODE    'latin1'
   66: p        PUT        5
   69: t        TUPLE      (MARK at 49)
   70: p    PUT        6
   73: R    REDUCE
   74: p    PUT        7
   77: V    UNICODE    'def'
   82: p    PUT        8
   85: s    SETITEM
   86: a    APPEND
   87: .    STOP
highest protocol among opcodes = 0

Try again with a "binary" pickle.

>>> pkl1 = pickle.dumps(x, 1)
>>> dis(pkl1)
    0: ]    EMPTY_LIST
    1: q    BINPUT     0
    3: (    MARK
    4: K        BININT1    1
    6: K        BININT1    2
    8: (        MARK
    9: K            BININT1    3
   11: K            BININT1    4
   13: t            TUPLE      (MARK at 8)
   14: q        BINPUT     1
   16: }        EMPTY_DICT
   17: q        BINPUT     2
   19: c        GLOBAL     '_codecs encode'
   35: q        BINPUT     3
   37: (        MARK
   38: X            BINUNICODE 'abc'
   46: q            BINPUT     4
   48: X            BINUNICODE 'latin1'
   59: q            BINPUT     5
   61: t            TUPLE      (MARK at 37)
   62: q        BINPUT     6
   64: R        REDUCE
   65: q        BINPUT     7
   67: X        BINUNICODE 'def'
   75: q        BINPUT     8
   77: s        SETITEM
   78: e        APPENDS    (MARK at 3)
   79: .    STOP
highest protocol among opcodes = 1

Exercise the INST/OBJ/BUILD family.

>>> import pickletools
>>> dis(pickle.dumps(pickletools.dis, 0))
    0: c    GLOBAL     'pickletools dis'
   17: p    PUT        0
   20: .    STOP
highest protocol among opcodes = 0

>>> from pickletools import _Example
>>> x = [_Example(42)] * 2
>>> dis(pickle.dumps(x, 0))
    0: (    MARK
    1: l        LIST       (MARK at 0)
    2: p    PUT        0
    5: c    GLOBAL     'copy_reg _reconstructor'
   30: p    PUT        1
   33: (    MARK
   34: c        GLOBAL     'pickletools _Example'
   56: p        PUT        2
   59: c        GLOBAL     '__builtin__ object'
   79: p        PUT        3
   82: N        NONE
   83: t        TUPLE      (MARK at 33)
   84: p    PUT        4
   87: R    REDUCE
   88: p    PUT        5
   91: (    MARK
   92: d        DICT       (MARK at 91)
   93: p    PUT        6
   96: V    UNICODE    'value'
  103: p    PUT        7
  106: I    INT        42
  110: s    SETITEM
  111: b    BUILD
  112: a    APPEND
  113: g    GET        5
  116: a    APPEND
  117: .    STOP
highest protocol among opcodes = 0

>>> dis(pickle.dumps(x, 1))
    0: ]    EMPTY_LIST
    1: q    BINPUT     0
    3: (    MARK
    4: c        GLOBAL     'copy_reg _reconstructor'
   29: q        BINPUT     1
   31: (        MARK
   32: c            GLOBAL     'pickletools _Example'
   54: q            BINPUT     2
   56: c            GLOBAL     '__builtin__ object'
   76: q            BINPUT     3
   78: N            NONE
   79: t            TUPLE      (MARK at 31)
   80: q        BINPUT     4
   82: R        REDUCE
   83: q        BINPUT     5
   85: }        EMPTY_DICT
   86: q        BINPUT     6
   88: X        BINUNICODE 'value'
   98: q        BINPUT     7
  100: K        BININT1    42
  102: s        SETITEM
  103: b        BUILD
  104: h        BINGET     5
  106: e        APPENDS    (MARK at 3)
  107: .    STOP
highest protocol among opcodes = 1

Try "the canonical" recursive-object test.

>>> L = []
>>> T = L,
>>> L.append(T)
>>> L[0] is T
True
>>> T[0] is L
True
>>> L[0][0] is L
True
>>> T[0][0] is T
True
>>> dis(pickle.dumps(L, 0))
    0: (    MARK
    1: l        LIST       (MARK at 0)
    2: p    PUT        0
    5: (    MARK
    6: g        GET        0
    9: t        TUPLE      (MARK at 5)
   10: p    PUT        1
   13: a    APPEND
   14: .    STOP
highest protocol among opcodes = 0

>>> dis(pickle.dumps(L, 1))
    0: ]    EMPTY_LIST
    1: q    BINPUT     0
    3: (    MARK
    4: h        BINGET     0
    6: t        TUPLE      (MARK at 3)
    7: q    BINPUT     1
    9: a    APPEND
   10: .    STOP
highest protocol among opcodes = 1

Note that, in the protocol 0 pickle of the recursive tuple, the disassembler
has to emulate the stack in order to realize that the POP opcode at 16 gets
rid of the MARK at 0.

>>> dis(pickle.dumps(T, 0))
    0: (    MARK
    1: (        MARK
    2: l            LIST       (MARK at 1)
    3: p        PUT        0
    6: (        MARK
    7: g            GET        0
   10: t            TUPLE      (MARK at 6)
   11: p        PUT        1
   14: a        APPEND
   15: 0        POP
   16: 0        POP        (MARK at 0)
   17: g    GET        1
   20: .    STOP
highest protocol among opcodes = 0

>>> dis(pickle.dumps(T, 1))
    0: (    MARK
    1: ]        EMPTY_LIST
    2: q        BINPUT     0
    4: (        MARK
    5: h            BINGET     0
    7: t            TUPLE      (MARK at 4)
    8: q        BINPUT     1
   10: a        APPEND
   11: 1        POP_MARK   (MARK at 0)
   12: h    BINGET     1
   14: .    STOP
highest protocol among opcodes = 1

Try protocol 2.

>>> dis(pickle.dumps(L, 2))
    0: \x80 PROTO      2
    2: ]    EMPTY_LIST
    3: q    BINPUT     0
    5: h    BINGET     0
    7: \x85 TUPLE1
    8: q    BINPUT     1
   10: a    APPEND
   11: .    STOP
highest protocol among opcodes = 2

>>> dis(pickle.dumps(T, 2))
    0: \x80 PROTO      2
    2: ]    EMPTY_LIST
    3: q    BINPUT     0
    5: h    BINGET     0
    7: \x85 TUPLE1
    8: q    BINPUT     1
   10: a    APPEND
   11: 0    POP
   12: h    BINGET     1
   14: .    STOP
highest protocol among opcodes = 2

Try protocol 3 with annotations:

>>> dis(pickle.dumps(T, 3), annotate=1)
    0: \x80 PROTO      3 Protocol version indicator.
    2: ]    EMPTY_LIST   Push an empty list.
    3: q    BINPUT     0 Store the stack top into the memo.  The stack is not popped.
    5: h    BINGET     0 Read an object from the memo and push it on the stack.
    7: \x85 TUPLE1       Build a one-tuple out of the topmost item on the stack.
    8: q    BINPUT     1 Store the stack top into the memo.  The stack is not popped.
   10: a    APPEND       Append an object to a list.
   11: 0    POP          Discard the top stack item, shrinking the stack by one item.
   12: h    BINGET     1 Read an object from the memo and push it on the stack.
   14: .    STOP         Stop the unpickling machine.
highest protocol among opcodes = 2

a=
>>> import pickle
>>> import io
>>> f = io.BytesIO()
>>> p = pickle.Pickler(f, 2)
>>> x = [1, 2, 3]
>>> p.dump(x)
>>> p.dump(x)
>>> f.seek(0)
0
>>> memo = {}
>>> dis(f, memo=memo)
    0: \x80 PROTO      2
    2: ]    EMPTY_LIST
    3: q    BINPUT     0
    5: (    MARK
    6: K        BININT1    1
    8: K        BININT1    2
   10: K        BININT1    3
   12: e        APPENDS    (MARK at 5)
   13: .    STOP
highest protocol among opcodes = 2
>>> dis(f, memo=memo)
   14: \x80 PROTO      2
   16: h    BINGET     0
   18: .    STOP
highest protocol among opcodes = 2
)Zdisassembler_testZdisassembler_memo_testcCsddl}|��S)Nr)�doctestZtestmod)rrrr�_testsr�__main__z$disassemble one or more pickle files)Zdescription�pickle_file�br�*zthe pickle file)�type�nargs�helpz-oz--output�wz+the file where the output should be written)�defaultrrz-mz--memo�
store_truez#preserve memo between disassemblies)�actionrz-lz
--indentlevelz8the number of blanks by which to indent a new MARK levelz-az
--annotatez2annotate each line with a short opcode descriptionz-pz
--preamblez==> {name} <==zMif more than one pickle file is specified, print this before each disassembly)rrz-tz--testzrun self-test suitez-vz)run verbosely; only affects self-test run�ryr�)TT)F)F)NNr)r)��__doc__r8r�r�r�rLr�r�Z
UP_TO_NEWLINEZTAKEN_FROM_ARGUMENT1ZTAKEN_FROM_ARGUMENT4ZTAKEN_FROM_ARGUMENT4UZTAKEN_FROM_ARGUMENT8U�objectr
Zstructrr&r!r"r'r(r*r+r,r-r/r0r=r>r@rArBrCrFrGrHrIrJrKrNrOrPrQrSrTrVrWrZr[r\r]r^r_rergrhrirkrlrmrnrorprqrrrsrtrbZpyintZpylongr{Zpyinteger_or_boolZpyboolrjZpyfloatr|rUZpybytes_or_strZpystringZpybytesrRZpybytearrayZ	pyunicoderZpynonerxZpytupler~ZpylistrZpydictr�ZpysetZpyfrozensetZpybufferZ	anyobjectr	r�r�r�r�Zname2iZcode2i�	enumerater�r�rrr�r�r�r�rrrrZ	_dis_testZ
_memo_testZ__test__rr�argparse�ArgumentParser�parser�add_argumentZFileType�stdout�
parse_args�argsZtestrrZ
print_helpr%�outputrrrZpreamble�formatr�rrrr�<module>s`
$�����/�
�	�������
��
�
�
�
�	�
����
����
�������������;����
���
����
�
����
���
�
�
�
����������������������
��
���
�����������2� ������������������
& 

C��
�
�������
�
__pycache__/keyword.cpython-38.opt-1.pyc000064400000001750151153537600014040 0ustar00U

e5d��#@sddZddgZddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%g#Zee�jZd&S)'a�Keywords (from "Grammar/Grammar")

This file is automatically generated; please don't muck it up!

To update the symbols in this file, 'cd' to the top directory of
the python source tree and run:

    python3 -m Parser.pgen.keywordgen Grammar/Grammar                                       Grammar/Tokens                                       Lib/keyword.py

Alternatively, you can run 'make regen-keyword'.
�	iskeyword�kwlist�False�None�True�and�as�assert�async�await�break�class�continue�def�del�elif�else�except�finally�for�from�global�if�import�in�is�lambda�nonlocal�not�or�pass�raise�return�try�while�with�yieldN)�__doc__�__all__r�	frozenset�__contains__r�r*r*�/usr/lib64/python3.8/keyword.py�<module>sL�&__pycache__/contextvars.cpython-38.pyc000064400000000365151153537600013776 0ustar00U

e5d��@s ddlmZmZmZmZdZdS)�)�Context�
ContextVar�Token�copy_contextN)Z_contextvarsrrrr�__all__�rr�#/usr/lib64/python3.8/contextvars.py�<module>s__pycache__/linecache.cpython-38.opt-1.pyc000064400000007435151153537600014275 0ustar00U

e5d��@sndZddlZddlZddlZddlZdddgZddd�Ziadd�Zddd	�Z	dd
d�Z
ddd�Zd
d�ZdS)z�Cache lines from Python source files.

This is intended to read lines from modules imported -- hence if a filename
is not found, it will look down the module search path for a file by
that name.
�N�getline�
clearcache�
checkcachecCs:t||�}d|kr"t|�kr2nn||dSdSdS)N��)�getlines�len)�filename�lineno�module_globals�lines�r
�!/usr/lib64/python3.8/linecache.pyrs
cCsiadS)zClear the cache entirely.N)�cacher
r
r
rrscCsX|tkr(t|}t|�dkr(t|dSzt||�WStk
rRt�gYSXdS)z�Get the lines for a Python source file from the cache.
    Update the cache if it doesn't contain an entry for this file already.r�N)rr�updatecache�MemoryErrorr)r	r�entryr
r
rr%src	Cs�|dkrtt���}n|tkr&|g}ndS|D]�}t|}t|�dkrHq.|\}}}}|dkr^q.zt�|�}Wn$tk
r�t�|d�Yq.YnX||jks�||j	kr.t�|d�q.dS)zUDiscard cache entries that are out of date.
    (This is not checked upon each call!)Nr)
�listr�keysr�os�stat�OSError�pop�st_size�st_mtime)r	�	filenamesr�size�mtimer�fullnamerr
r
rr5s&
c
Cs�|tkr$tt|�dkr$t�|d�|r<|�d�r@|�d�r@gS|}zt�|�}W�ntk
�rn|}t||�r�zt|d�}Wnt	tfk
r�YnDX|dkr�gYSt|�ddd�|�
�D�|ft|<t|dYStj�|�r�gYSt
jD]d}ztj�||�}Wnttfk
�r0Yq�YnXzt�|�}W�qjWq�tk
�r^Yq�Xq�gYSYnXz"t�|��}|��}W5QRXWntk
�r�gYSX|�r�|d	�d
��s�|d	d
7<|j|j}	}
|	|
||ft|<|S)z�Update a cache entry and return its list of lines.
    If something's wrong, print a message, discard the cache entry,
    and return an empty list.rN�<�>rcSsg|]}|d�qS)�
r
)�.0�liner
r
r�
<listcomp>qszupdatecache.<locals>.<listcomp>r���r")rrr�
startswith�endswithrrr�	lazycache�ImportError�
splitlines�path�isabs�sys�join�	TypeError�AttributeError�tokenize�open�	readlinesrr)r	rrr�basename�data�dirname�fprrrr
r
rrRs\
�



rcCs�|tkr tt|�dkrdSdS|r8|�d�r<|�d�r<dS|r�d|kr�|�d�}|d}t|dd	�}|r�|r�t�||�}|ft|<dSdS)
a�Seed the cache for filename with module_globals.

    The module loader will be asked for the source only when getlines is
    called, not immediately.

    If there is an entry in the cache already, it is not altered.

    :return: True if a lazy load is registered in the cache,
        otherwise False. To register such a load a module loader with a
        get_source method must be found, the filename must be a cachable
        filename, and the filename must not be already cached.
    rTFr r!�
__loader__�__name__�
get_sourceN)rrr'r(�get�getattr�	functools�partial)r	r�name�loaderr;�	get_linesr
r
rr)�s


r))N)N)N)N)
�__doc__r>r.rr2�__all__rrrrrrr)r
r
r
r�<module>s




A__pycache__/glob.cpython-38.opt-2.pyc000064400000006534151153537600013305 0ustar00U

e5dA�@s�ddlZddlZddlZddlZdddgZdd�dd�Zdd�dd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Ze�d�Ze�d�Zdd�Zdd�Zdd �Zd!d�ZdS)"�N�glob�iglob�escapeF��	recursivecCstt||d��S)Nr)�listr)�pathnamer�r	�/usr/lib64/python3.8/glob.pyr
scCs2t�d||�t||d�}|r.t|�r.t|�}|S)Nz	glob.globF)�sys�audit�_iglob�_isrecursive�next)rr�it�sr	r	r
rs
ccs�tj�|�\}}t|�sF|r0tj�|�rB|Vntj�|�rB|VdS|s�|rjt|�rjt|||�EdHnt|||�EdHdS||kr�t|�r�t	||d�}n|g}t|�r�|r�t|�r�t}q�t}nt
}|D]&}||||�D]}tj�||�Vq�q�dS)NT)�os�path�split�	has_magic�lexists�isdirr�_glob2�_glob1r
�_glob0�join)rr�dironly�dirname�basename�dirsZglob_in_dir�namer	r	r
r
)s0r
cCs0tt||��}t|�s$dd�|D�}t�||�S)Ncss|]}t|�s|VqdS�N)�	_ishidden)�.0�xr	r	r
�	<genexpr>Tsz_glob1.<locals>.<genexpr>)r�_iterdirr"�fnmatch�filter)r�patternr�namesr	r	r
rQsrcCs8|stj�|�r4|gSntj�tj�||��r4|gSgSr!)rrrrr)rrrr	r	r
rWsrcCst||d�S�NF)r�rr)r	r	r
�glob0dsr-cCst||d�Sr+)rr,r	r	r
�glob1gsr.ccs"|dd�Vt||�EdHdS)Nr)�	_rlistdir)rr)rr	r	r
rmsrc
cs�|s"t|t�rttjd�}ntj}zRt�|��>}|D]2}z|rF|��rN|jVWq4tk
rdYq4Xq4W5QRXWntk
r�YdSXdS)N�ASCII)�
isinstance�bytesr�curdir�scandir�is_dirr �OSError)rrr�entryr	r	r
r&ts
r&ccs`tt||��}|D]H}t|�s|V|r6tj�||�n|}t||�D]}tj�||�VqDqdSr!)rr&r"rrrr/)rrr*r$r�yr	r	r
r/�sr/z([*?[])s([*?[])cCs(t|t�rt�|�}n
t�|�}|dk	Sr!)r1r2�magic_check_bytes�search�magic_check)r�matchr	r	r
r�s

rcCs|ddkS)Nr)�.�.r	)rr	r	r
r"�sr"cCst|t�r|dkS|dkSdS)Ns**z**)r1r2)r)r	r	r
r�s
rcCs<tj�|�\}}t|t�r(t�d|�}nt�d|�}||S)Ns[\1]z[\1])rr�
splitdriver1r2r9�subr;)rZdriver	r	r
r�s

)r�rer'r�__all__rrr
rrr-r.rr&r/�compiler;r9rr"rrr	r	r	r
�<module>s(

(



__pycache__/dummy_threading.cpython-38.opt-1.pyc000064400000002130151153537600015525 0ustar00U

e5d�
�	@sdZddlmZddlZdZdZdZz�dekr:edZ
dZed	ed<dekr`edZdZed=dekrzedZ	dZed=ddlZeded
<ed=eded<ed=ddlTdd
lm
Z
W5er�eed<[[er�e	ed<[	[er�e
ed<[
ned=[[[XdS)aaFaux ``threading`` version using ``dummy_thread`` instead of ``thread``.

The module ``_dummy_threading`` is added to ``sys.modules`` in order
to not have ``threading`` considered imported.  Had ``threading`` been
directly imported it would have made all subsequent imports succeed
regardless of whether ``_thread`` was available which is not desired.

�)�modulesNF�	threadingZ_threading_local�_threadT�
_dummy_thread�_dummy_threadingZ_dummy__threading_local)�*)�__all__)�__doc__�sysrZsys_modulesrZholding_threadZholding_threadingZholding__threading_localZheld_threadingZheld__threading_localZheld_threadrrr�rr�'/usr/lib64/python3.8/dummy_threading.py�<module>sP__pycache__/enum.cpython-38.opt-2.pyc000064400000051062151153537600013322 0ustar00U

e5d���@s�ddlZddlmZmZddddddd	gZd
d�Zdd
�Zdd�Zdd�Ze	�Z
Gdd�d�ZGdd�de�Z
dZGdd�de�ZGdd�ded�ZGdd�dee�Zdd�ZGdd�de�ZGdd�dee�Zdd�Zdd	�Zd d!�Zd"d#�ZdS)$�N)�MappingProxyType�DynamicClassAttribute�EnumMeta�Enum�IntEnum�Flag�IntFlag�auto�uniquecCst|d�pt|d�pt|d�S)N�__get__�__set__�
__delete__)�hasattr)�obj�r�/usr/lib64/python3.8/enum.py�_is_descriptors

��rcCsLt|�dkoJ|dd�|dd�ko.dknoJ|ddkoJ|ddkS)N������__�_�����len��namerrr�
_is_dunders&�
�
�rcCsLt|�dkoJ|d|dko&dknoJ|dd�dkoJ|dd�dkS)Nrr���r�rrrrrr�
_is_sunder!s���r cCsdd�}||_d|_dS)NcSstd|��dS)Nz%r cannot be pickled)�	TypeError��self�protorrr�_break_on_call_reduce0sz6_make_class_unpicklable.<locals>._break_on_call_reducez	<unknown>)�
__reduce_ex__�
__module__)�clsr%rrr�_make_class_unpicklable,sr)c@seZdZeZdS)r	N)�__name__r'�__qualname__�
_auto_null�valuerrrrr	6scs(eZdZ�fdd�Z�fdd�Z�ZS)�	_EnumDictcs&t���g|_g|_g|_d|_dS)NF)�super�__init__�
_member_names�_last_values�_ignore�_auto_called�r#��	__class__rrr0Ds

z_EnumDict.__init__csdt|�r�|dkrtd��|dkr<|jr.td��t|d|�nV|dkr�t|t�r`|�dd���}nt	|�}||_
t|�t|j�@}|r�td	|f��n�t
|�r�|d
kr�d}n�||jkr�td|��n�||j
kr�n�t|��sR||kr�td
|||f��t|t��r:|jtk�r4|�|dt|j�|jdd��|_d|_|j}|j�|�|j�|�t��||�dS)N)�_order_�_create_pseudo_member_�_generate_next_value_�	_missing_�_ignore_z(_names_ are reserved for future Enum user:z4_generate_next_value_ must be defined before members�_generate_next_valuer<�,� z-_ignore_ cannot specify already set names: %r�	__order__r8zAttempted to reuse key: %rz%r already defined as: %rrT)r �
ValueErrorr4r!�setattr�
isinstance�str�replace�split�listr3�setr1rrr	r-r,r=rr2�appendr/�__setitem__)r#�keyr-�alreadyr6rrrJKsT	
��


�z_EnumDict.__setitem__)r*r'r+r0rJ�
__classcell__rrr6rr.=sr.cs�eZdZedd��Z�fdd�Zdd�Zd.ddddd	�d
d�Zdd
�Z�fdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zedd��Zdd�Zdd�Z�fd d!�Zddddd	�d"d#�Zd/d$d%�Zd&d'�Zed(d)��Zed*d+��Zed,d-��Z�ZS)0rcCs>|�||�t�}|�||�\}}|dk	r:t|dd�|d<|S)Nr:)�_check_for_existing_membersr.�_get_mixins_�getattr)�metaclsr(�bases�	enum_dict�member_type�
first_enumrrr�__prepare__�s�zEnumMeta.__prepare__c	s��dg��d��d}|D]}��|d�q|�||�\�}|���|�\}}}	�fdd��jD�}
�jD]
}�|=qn��dd�}t|
�ddh@}
|
r�td�d�	|
����d	�kr�d
�d	<t
��|||��}g|_i|_
�|_dd�|��D�}i|_d
�k�r2�tk	�r2d}t�fdd�|D���s2t|��jD�]*}|
|}t|t��sZ|f}n|}�tk�rn|f}|	�s�||�}t|d��s�||_n6||f|��}t|d��sƈtk�r�||_n
�|�|_|j}||_||_|j|�|j
��D]"\}}|j|jk�r�|}�q�q�|j�|�||k�r2t|||�||j
|<z||j|<Wntk
�r`YnX�q8dD]V}|�k�r|�qjt||�}t�|d�}t||d�}|dk	�rj||k�rjt|||��qjtdk	�r�|�r�||_ tj|_|dk	�rt|t!��r|�"dd��#�}||jk�rtd��|S)Nr<csi|]}|�|�qSrr)�.0�k)�	classdictrr�
<dictcomp>�sz$EnumMeta.__new__.<locals>.<dictcomp>r8�mro�zInvalid enum member name: {0}r>�__doc__zAn enumeration.cSs.h|]&}|j��D]\}}t|t�r|�qqSr)�__dict__�itemsrCr)rW�crX�vrrr�	<setcomp>�s

�z#EnumMeta.__new__.<locals>.<setcomp>r&)�__getnewargs_ex__�__getnewargs__r&�
__reduce__c3s|]}|�jkVqdS�N)r^�rW�m)rTrr�	<genexpr>�sz#EnumMeta.__new__.<locals>.<genexpr>�_value_)�__repr__�__str__�
__format__r&r?z#member order does not match _order_)$�
setdefaultrI�poprO�
_find_new_r1rHrA�format�joinr/�__new__�_member_names_�_member_map_�
_member_type_r[�_value2member_map_�object�anyr)rC�tuplerrj�_name_�__objclass__r0r_rBr!rPr�__new_member__rDrErF)rQr(rRrY�ignorerKrUrs�save_new�use_args�enum_membersrr8�
invalid_names�
enum_class�dynamic_attributes�methods�member_namer-�args�enum_member�canonical_member�class_method�
obj_method�enum_methodr6)rYrTrrs�s��

��













zEnumMeta.__new__cCsdS)NTrr5rrr�__bool__3szEnumMeta.__bool__Nr��module�qualname�type�startcCs*|dkr|�||�S|j||||||d�S)Nr�)rs�_create_)r(r-�namesr�r�r�r�rrr�__call__9s�zEnumMeta.__call__cCs:t|t�s$tdt|�j|jjf��t||�o8|j|jkS�Nz3unsupported operand type(s) for 'in': '%s' and '%s')rCrr!r�r+r7r{ru)r(�memberrrr�__contains__^s
��zEnumMeta.__contains__cs(||jkrtd|j��t��|�dS)Nz%s: cannot delete Enum member.)ru�AttributeErrorr*r/�__delattr__)r(�attrr6rrr�es
zEnumMeta.__delattr__cCsddddg|jS)Nr7r]�__members__r'�rtr5rrr�__dir__ls
��zEnumMeta.__dir__cCs@t|�rt|��z|j|WStk
r:t|�d�YnXdSrf)rr�ru�KeyError�r(rrrr�__getattr__rs	zEnumMeta.__getattr__cCs
|j|Srf�rur�rrr�__getitem__�szEnumMeta.__getitem__cs�fdd��jD�S)Nc3s|]}�j|VqdSrfr��rWr�r(rrri�sz$EnumMeta.__iter__.<locals>.<genexpr>r�r�rr�r�__iter__�szEnumMeta.__iter__cCs
t|j�Srf)rrtr�rrr�__len__�szEnumMeta.__len__cCs
t|j�Srf)rrur�rrrr��szEnumMeta.__members__cCs
d|jS)Nz	<enum %r>)r*r�rrrrk�szEnumMeta.__repr__cs�fdd�t�j�D�S)Nc3s|]}�j|VqdSrfr�r�r�rrri�sz(EnumMeta.__reversed__.<locals>.<genexpr>)�reversedrtr�rr�r�__reversed__�szEnumMeta.__reversed__cs0|j�di�}||krtd��t��||�dS)NruzCannot reassign members.)r^�getr�r/�__setattr__)r(rr-�
member_mapr6rrr��szEnumMeta.__setattr__c
Cs~|j}|dkr|fn||f}|�||�\}	}
|�||�}t|t�rR|�dd���}t|ttf�r�|r�t|dt�r�|g}}g}
t	|�D]8\}}|
�
||||
dd��}|
�|�|�||f�q�|D].}t|t�r�|||}}n|\}}|||<q�|�||||�}|dk�rPzt
�d�jd}Wn*tttfk
�rN}zW5d}~XYnX|dk�rdt|�n||_|dk	�rz||_|S)Nr>r?rrr*)r7rOrVrCrDrErFrzrG�	enumerater:rIrs�sys�	_getframe�	f_globalsr�rAr�r)r'r+)r(�
class_namer�r�r�r�r�rQrRrrUrY�original_names�last_values�countrr-�itemr��member_valuer��excrrrr��s<
 







zEnumMeta._create_cs�ttj|�}|rt|�}n|}�fdd�|��D�}z|jdd�d�Wn$tk
rn|jdd�d�YnX||||d�}t|_|�|j	�|||<|S)Ncs g|]\}}�|�r||f�qSrr)rWrr-��filterrr�
<listcomp>�s�z&EnumMeta._convert_.<locals>.<listcomp>cSs|d|dfS)Nrrr��trrr�<lambda>��z$EnumMeta._convert_.<locals>.<lambda>)rKcSs|dS�Nrrr�rrrr��r�)r�)
�varsr��modulesr_�sortr!�_reduce_ex_by_namer&�updater�)r(rr�r��source�module_globals�membersrr�r�	_convert_�s 	

�zEnumMeta._convert_cOs$ddl}|jdtdd�|j||�S)NrzI_convert is deprecated and will be removed in 3.9, use _convert_ instead.r)�
stacklevel)�warnings�warn�DeprecationWarningr�)r(r��kwargsr�rrr�_converts�zEnumMeta._convertcCs<|D]2}|jD]&}t|t�r|jrtd||jf��qqdS)Nz %s: cannot extend enumeration %r)�__mro__�
issubclassrrtr!r*)r�rR�chain�baserrrrN
s
��z$EnumMeta._check_for_existing_memberscsT|sttfS�fdd�}|d}t|t�s2td��||�p<t}|jrLtd��||fS)Ncs�g}|D]t}d}|jD]d}|tkr&qqt|t�rL|jtk	rz|�|j�qqd|jkrvt|t�rbq|�|pl|�qq|}qqt|�dkr�td�|f��n|r�|dSdSdS)Nrsrz%r: too many data types: %rr)	r�rxr�rrvrIr^rr!)rR�
data_typesr��	candidater��r�rr�_find_data_types*




z.EnumMeta._get_mixins_.<locals>._find_data_typerzZnew enumerations should be created as `EnumName([mixin_type, ...] [data_type,] enum_type)`zCannot extend enumerations)rxrr�r!rt)r�rRr�rUrTrr�rrOs
zEnumMeta._get_mixins_c	Cs�|�dd�}|dk	}|dkrpdD]H}||fD].}t||d�}|ddjtjtjhkr,|}q\q,|dk	r qpq tj}|tjkr�d}nd}|||fS)Nrs)r}rsFT)r�rPrsrxr)	rYrTrUrsr�method�possible�targetr�rrrrpCs*�
zEnumMeta._find_new_)N)N)r*r'r+�classmethodrVrsr�r�r�r�r�r�r�r�r��propertyr�rkr�r�r�r�r��staticmethodrNrOrprMrrr6rr�s6

%
	
5
!
	
.c@speZdZdd�Zdd�Zedd��Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Ze
dd��Ze
dd��ZdS)rc
Cst|�|kr|Sz|j|WStk
r0Yn:tk
rh|j��D]}|j|krH|YSqHYnXzd}|�|�}Wn*tk
r�}z|}d}W5d}~XYnXzdt	||�r�|W�TSt
d||jf�}|dkr�|dkr�|�n|dk�rtd|j|f�}||_|�W5d}d}XdS)N�%r is not a valid %szDerror in %s._missing_: returned %r instead of None or a valid member)
r�rwr�r!ru�valuesrjr;�	ExceptionrCrAr*�__context__)r(r-r�r��result�e�ve_excrrrrsws@


��zEnum.__new__c	Cs6t|�D](}z|dWStk
r.YqXq|S�Nr)r�r!)rr�r�r��
last_valuerrrr:�s	zEnum._generate_next_value_cCsdSrfr)r(r-rrrr;�szEnum._missing_cCsd|jj|j|jfS)N�<%s.%s: %r>)r7r*r{rjr5rrrrk�s
�z
Enum.__repr__cCsd|jj|jfS)N�%s.%s)r7r*r{r5rrrrl�szEnum.__str__cs6�fdd��j��D�dd��jD�}dddg|S)Ncs2g|]*}|jD]}|ddkr|�jkr|�qqS�rr)r^ru)rWr(rhr5rrr��s
�z Enum.__dir__.<locals>.<listcomp>cSsg|]}|ddkr|�qSr�rrgrrrr��sr7r]r')r7r[r^)r#�added_behaviorrr5rr��s
��zEnum.__dir__cCsJt|�jtjtjfk}|jtks$|r2t}t|�}n|j}|j}|�||�Srf)	r�rlrrrvrxrDrjrm)r#�format_spec�str_overriddenr(�valrrrrm�s	
zEnum.__format__cCs
t|j�Srf)�hashr{r5rrr�__hash__�sz
Enum.__hash__cCs|j|jffSrf�r7rjr"rrrr&�szEnum.__reduce_ex__cCs|jSrf)r{r5rrrr�sz	Enum.namecCs|jSrf�rjr5rrrr-�sz
Enum.valueN)r*r'r+rsr:r�r;rkrlr�rmr�r&rrr-rrrrrqs-


)�	metaclassc@seZdZdS)rN)r*r'r+rrrrr�scCs|jSrfrr"rrrr��sr�c@sleZdZdd�Zedd��Zedd��Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�Zdd�Z
dd�ZdS)rc	Csd|s|dk	r|SdSt|�D]:}zt|�}WqXWqtk
rTtd|�d�YqXqd|dS)NrzInvalid Flag value: %rr)r��	_high_bitr�r!)rr�r�r�r��high_bitrrrr:s	
zFlag._generate_next_value_cCs.|}|dkr|}|�|�}|dkr*|}|Sr�)r9)r(r-�original_value�possible_memberrrrr;s
zFlag._missing_cCsb|j�|d�}|dkr^t||�\}}|r:td||jf��t�|�}d|_||_|j�	||�}|S�Nr�)
rwr��
_decomposerAr*rxrsr{rjrn)r(r-�
pseudo_memberr�extra_flagsrrrr9#s
zFlag._create_pseudo_member_cCs8t||j�s&tdt|�j|jjf��|j|j@|jkSr�)rCr7r!r�r+rj�r#�otherrrrr�7s��zFlag.__contains__cCsV|j}|jdk	r$d|j|j|jfSt||j�\}}d|jd�dd�|D��|jfS)Nr��|cSsg|]}t|jp|j��qSr�rDr{rjrgrrrr�Hsz!Flag.__repr__.<locals>.<listcomp>)r7r{r*rjr�rr�r#r(r��	uncoveredrrrrkAs
�z
Flag.__repr__cCs�|j}|jdk	r d|j|jfSt||j�\}}t|�dkr^|djdkr^d|j|djfSd|jd�dd�|D��fSdS)Nr�rrz%s.%rr�cSsg|]}t|jp|j��qSrr�rgrrrr�Vsz Flag.__str__.<locals>.<listcomp>)r7r{r*r�rjrrrr�rrrrlLs
�zFlag.__str__cCs
t|j�Srf)�boolrjr5rrrr�Ysz
Flag.__bool__cCs"t||j�stS|�|j|jB�Srf�rCr7�NotImplementedrjr�rrr�__or__\szFlag.__or__cCs"t||j�stS|�|j|j@�Srfrr�rrr�__and__aszFlag.__and__cCs"t||j�stS|�|j|jA�Srfrr�rrr�__xor__fszFlag.__xor__cCsNt|j|j�\}}|�d�}|jD] }||kr"|j|j@s"||B}q"|�|�Sr�)r�r7rj)r#r�r��invertedrhrrr�
__invert__ks


zFlag.__invert__N)r*r'r+r:r�r;r9r�rkrlr�rrrrrrrrr�s



c@sPeZdZedd��Zedd��Zdd�Zdd�Zd	d
�ZeZ	eZ
eZdd�Zd
S)rcCs*t|t�std||jf��|�|�}|Sr�)rC�intrAr*r9)r(r-�
new_memberrrrr;ys

zIntFlag._missing_cCs�|j�|d�}|dkr�|g}t||�\}}|rtt|�}d|}||jkrZ||krZ|�|�||krjd}q*||N}q*t|�D]*}t�||�}d|_||_	|j�
||�}q||S)Nrr)rwr�r�r�rIr�rrsr{rjrn)r(r-r��need_to_createrr��bit�
flag_valuerrrr9�s(
�


zIntFlag._create_pseudo_member_cCs0t||jtf�stS|�|j|�|�jB�}|Srf�rCr7rrrj)r#r�r�rrrr�szIntFlag.__or__cCs,t||jtf�stS|�|j|�|�j@�Srfr
r�rrrr�szIntFlag.__and__cCs,t||jtf�stS|�|j|�|�jA�Srfr
r�rrrr�szIntFlag.__xor__cCs|�|j�}|Srfr�)r#r�rrrr�szIntFlag.__invert__N)
r*r'r+r�r;r9rrr�__ror__�__rand__�__rxor__rrrrrrts
	
 cCs|��dSr�)�
bit_length�r-rrrr��sr�cCs^g}|j��D]"\}}||jkr|�||jf�q|rZd�dd�|D��}td||f��|S)Nz, cSsg|]\}}d||f�qS)z%s -> %sr)rW�aliasrrrrr��szunique.<locals>.<listcomp>z duplicate values found in %r: %s)r�r_rrIrrrA)�enumeration�
duplicatesrr��
alias_detailsrrrr
�s
��cCs�|}|dk}|r*dd�t|j���D�}ndd�t|j���D�}g}|D],\}}|rJ||@|krJ|�|�||M}qJ|s�||jkr�|�|j|�|jdd�dd�t|�d	kr�|dj|kr�|�d�||fS)
NrcSs"g|]\}}|jdk	r||f�qSrfr�rWrarhrrrr��s
�z_decompose.<locals>.<listcomp>cSs*g|]"\}}|jdk	st|�r||f�qSrf)r�
_power_of_tworrrrr��s
�cSs|jSrfr�)rhrrrr��r�z_decompose.<locals>.<lambda>T)rK�reverser)rGrwr_rIr�rr-ro)�flagr-�not_covered�negative�flags_to_checkr�r�r�rrrr��s(��

r�cCs|dkrdS|dt|�kS)NrFr)r�rrrrr�sr)r��typesrr�__all__rrr r)rxr,r	�dictr.rr�rrrr�rrr�r
r�rrrrr�<module>s>�
	LivI%__pycache__/timeit.cpython-38.opt-1.pyc000064400000027003151153537600013646 0ustar00U

e5d�4�@s�dZddlZddlZddlZddlZddddgZdZdZd	Zej	Z
eZd
Z
dd�ZGd
d�d�Zdde
edfdd�Zdde
eedfdd�Zddd�dd�Zedkr�e�e��dS)a9Tool for measuring execution time of small code snippets.

This module avoids a number of common traps for measuring execution
times.  See also Tim Peters' introduction to the Algorithms chapter in
the Python Cookbook, published by O'Reilly.

Library usage: see the Timer class.

Command line usage:
    python timeit.py [-n N] [-r N] [-s S] [-p] [-h] [--] [statement]

Options:
  -n/--number N: how many times to execute 'statement' (default: see below)
  -r/--repeat N: how many times to repeat the timer (default 5)
  -s/--setup S: statement to be executed once initially (default 'pass').
                Execution time of this setup statement is NOT timed.
  -p/--process: use time.process_time() (default is time.perf_counter())
  -v/--verbose: print raw timing results; repeat for more digits precision
  -u/--unit: set the output time unit (nsec, usec, msec, or sec)
  -h/--help: print this usage message and exit
  --: separate options from statement, use when statement starts with -
  statement: statement to be timed (default 'pass')

A multi-line statement may be given by specifying each line as a
separate argument; indented lines are possible by enclosing an
argument in quotes and using leading spaces.  Multiple -s options are
treated similarly.

If -n is not given, a suitable number of loops is calculated by trying
increasing numbers from the sequence 1, 2, 5, 10, 20, 50, ... until the
total time is at least 0.2 seconds.

Note: there is a certain baseline overhead associated with executing a
pass statement.  It differs between versions.  The code here doesn't try
to hide it, but you should be aware of it.  The baseline overhead can be
measured by invoking the program without arguments.

Classes:

    Timer

Functions:

    timeit(string, string) -> float
    repeat(string, string) -> list
    default_timer() -> float

�N�Timer�timeit�repeat�
default_timerz<timeit-src>i@B�z�
def inner(_it, _timer{init}):
    {setup}
    _t0 = _timer()
    for _i in _it:
        {stmt}
    _t1 = _timer()
    return _t1 - _t0
cCs|�ddd|�S)z*Helper to reindent a multi-line statement.�
� )�replace)�src�indent�r�/usr/lib64/python3.8/timeit.py�reindentOsrc@sPeZdZdZddedfdd�Zddd�Zefdd	�Ze	efd
d�Z
ddd
�ZdS)ra�Class for timing execution speed of small code snippets.

    The constructor takes a statement to be timed, an additional
    statement used for setup, and a timer function.  Both statements
    default to 'pass'; the timer function is platform-dependent (see
    module doc string).  If 'globals' is specified, the code will be
    executed within that namespace (as opposed to inside timeit's
    namespace).

    To measure the execution time of the first statement, use the
    timeit() method.  The repeat() method is a convenience to call
    timeit() multiple times and return a list of results.

    The statements may contain newlines, as long as they don't contain
    multi-line string literals.
    �passNcCs�||_i}|dkrt�n|}d}t|t�rJt|td�|d}t|d�}n*t|�rl||d<|d7}d}d}ntd	��t|t�r�t||td�t|d
�}n&t|�r�||d<|d7}d
}ntd��t	j
|||d�}	|	|_t|	td�}
t|
||�|d|_
dS)z#Constructor.  See class doc string.N��execr��_setupz, _setup=_setupz_setup()z&setup is neither a string nor callable�Z_stmtz
, _stmt=_stmtz_stmt()z%stmt is neither a string nor callable)�stmt�setup�init�inner)�timer�_globals�
isinstance�str�compile�dummy_src_namer�callable�
ValueError�template�formatr
rr)�selfrrr�globalsZlocal_nsZ	global_nsrZ
stmtprefixr
�coderrr
�__init__es6

zTimer.__init__cCsJddl}ddl}|jdk	r:t|j�d|j�d�tf|jt<|j|d�dS)a�Helper to print a traceback from the timed code.

        Typical use:

            t = Timer(...)       # outside the try/except
            try:
                t.timeit(...)    # or t.repeat(...)
            except:
                t.print_exc()

        The advantage over the standard traceback is that source lines
        in the compiled template will be displayed.

        The optional file argument directs where the traceback is
        sent; it defaults to sys.stderr.
        rNr��file)�	linecache�	tracebackr
�len�splitr�cache�	print_exc)r#r(r)r*rrr
r.�s

�
zTimer.print_exccCsBt�d|�}t��}t��z|�||j�}W5|r<t��X|S)a�Time 'number' executions of the main statement.

        To be precise, this executes the setup statement once, and
        then returns the time it takes to execute the main statement
        a number of times, as a float measured in seconds.  The
        argument is the number of times through the loop, defaulting
        to one million.  The main statement, the setup statement and
        the timer function to be used are passed to the constructor.
        N)�	itertoolsr�gcZ	isenabledZdisableZenablerr)r#�number�itZgcoldZtimingrrr
r�s

zTimer.timeitcCs*g}t|�D]}|�|�}|�|�q|S)a�Call timeit() a few times.

        This is a convenience function that calls the timeit()
        repeatedly, returning a list of results.  The first argument
        specifies how many times to call timeit(), defaulting to 5;
        the second argument specifies the timer argument, defaulting
        to one million.

        Note: it's tempting to calculate mean and standard deviation
        from the result vector and report these.  However, this is not
        very useful.  In a typical case, the lowest value gives a
        lower bound for how fast your machine can run the given code
        snippet; higher values in the result vector are typically not
        caused by variability in Python's speed, but by other
        processes interfering with your timing accuracy.  So the min()
        of the result is probably the only number you should be
        interested in.  After that, you should look at the entire
        vector and apply common sense rather than statistics.
        )�ranger�append)r#rr1�r�i�trrr
r�s

zTimer.repeatcCsPd}dD]8}||}|�|�}|r,|||�|dkr||fSq|d9}qdS)a�Return the number of loops and time taken so that total time >= 0.2.

        Calls the timeit method with increasing numbers from the sequence
        1, 2, 5, 10, 20, 50, ... until the time taken is at least 0.2
        second.  Returns (number, time_taken).

        If *callback* is given and is not None, it will be called after
        each trial with two arguments: ``callback(number, time_taken)``.
        �)r8�rg�������?�
N)r)r#�callbackr6�jr1�
time_takenrrr
�	autorange�s


zTimer.autorange)N)N)�__name__�
__module__�__qualname__�__doc__rr&r.�default_numberr�default_repeatrr>rrrr
rSs�
#
rcCst||||��|�S)zCConvenience function to create Timer object and call timeit method.)rr)rrrr1r$rrr
r�scCst||||��||�S)zCConvenience function to create Timer object and call repeat method.)rr)rrrrr1r$rrr
r�s)�_wrap_timerc
s|dkrtjdd�}ddl}z(|�|dddddd	d
ddd
g	�\}}Wn:|jk
r�}zt|�td�WY�dSd}~XYnXt}d�|�p�d}d�g}t}d}	d�ddddd��d�|D]�\}
}|
dkr�t|��|
dkr�|�	|�|
dk�r|�k�r|�ntdtj
d�dS|
dk�r6t|�}|dk�r6d}|
dk�rFtj}|
dk�rf|	�r^�d7�|	d7}	|
d kr�tt
d!d"�dSq�d�|��p�d}ddl}tj�d|j�|dk	�r�||�}t|||�}
�dk�rd}|	�r�fd#d$�}z|
�|�\�}Wn|
��YdSX|	�rt�z|
�|��}Wn|
��YdSX���fd%d&�}|	�rztd'd(�t||���t��fd)d*�|D�}t|�}td+��dk�r�d,nd-|||�f�t|�}t|�}||d.k�rddl}|�d/||�||�ftd-d�dS)0a�Main program, used when run as a script.

    The optional 'args' argument specifies the command line to be parsed,
    defaulting to sys.argv[1:].

    The return value is an exit code to be passed to sys.exit(); it
    may be None to indicate success.

    When an exception happens during timing, a traceback is printed to
    stderr and the return value is 1.  Exceptions at other times
    (including the template compilation) are not caught.

    '_wrap_timer' is an internal interface used for unit testing.  If it
    is not None, it must be a callable that accepts a timer function
    and returns another timer function (used for unit testing).
    Nr8rz
n:u:s:r:tcpvhznumber=zsetup=zrepeat=�timeZclockZprocess�verbosezunit=�helpz#use -h/--help for command line helpr9rrg��&�.>g���ư>g����MbP?g�?)ZnsecZusecZmsecZsec�)z-nz--number)z-sz--setup)z-uz--unitz:Unrecognized unit. Please select nsec, usec, msec, or sec.r')z-rz--repeat)z-pz	--process)z-vz	--verbose)z-hz--helpr)�endcs.d}|dk}t|j||rdnd|�d��dS)Nz%{num} loop{s} -> {secs:.{prec}g} secsr8�sr)ZnumrKZsecsZprec)�printr")r1r=�msgZplural)�	precisionrr
r;?s�zmain.<locals>.callbackcs`�}|dk	r�|}n8dd����D�}|jdd�|D]\}}||kr8qNq8d�|||fS)NcSsg|]\}}||f�qSrr)�.0�unit�scalerrr
�
<listcomp>Ysz-main.<locals>.format_time.<locals>.<listcomp>T)�reversez%.*g %s)�items�sort)�dtrPrQZscales)rN�	time_unit�unitsrr
�format_timeSs
zmain.<locals>.format_timez
raw times: %sz, csg|]}|��qSrr)rOrV)r1rr
rRdszmain.<locals>.<listcomp>z"%d loop%s, best of %d: %s per looprKrrztThe test results are likely unreliable. The worst time (%s) was more than four times slower than the best time (%s).)�sys�argv�getopt�errorrLr�joinrD�intr4�stderrrF�process_timerB�os�path�insert�curdirrr>r.r�map�min�max�warnings�
warn_explicit�UserWarning)�argsrEr\Zopts�errrrrrrG�o�arbr7r;�_Zraw_timingsrYZtimingsZbestZworstrir)r1rNrWrXr
�main�s���


�





����rq�__main__)N)rBr0rZrFr/�__all__rrCrD�perf_counterrr$rr!rrrrrqr?�exitrrrr
�<module>s61
�
�
__pycache__/ntpath.cpython-38.pyc000064400000034503151153537600012715 0ustar00U

e5dVl�&@s(dZdZdZdZdZdZdZdZdZdd	l	Z	dd	l
Z
dd	lZdd	lZdd
lTddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0g&Z
d1d2�Zd3d�Zd4d�Zd5d
�Zd6d�Zd7d�Zd8d�Zejje_d9d�Zd:d�Zd;d�Zd<d�Zzdd=lmZWnek
�r(d	ZYnXd>d�Zd?d�Zd@d�ZdAd �Z dBdC�Z!zddDlm"Z"Wnek
�r|e!Z#Yn
XdEd!�Z#zddFlm$Z$m%Z&Wnek
�r�e#Z'YnXdGdH�Z(dIdJ�Z)dKd*�Z'e*e
dL��o�e
�+�dMdNkZ,dRdOd,�Z-dPd0�Z.zddQlm/Z0Wnek
�r"YnXd	S)Sz�Common pathname manipulations, WindowsNT/95 version.

Instead of importing this module directly, import os and refer to this
module as os.path.
�.�..�\�;�/z.;C:\binZnul�N)�*�normcase�isabs�join�
splitdrive�split�splitext�basename�dirname�commonprefix�getsize�getmtime�getatime�getctime�islink�exists�lexists�isdir�isfile�ismount�
expanduser�
expandvars�normpath�abspath�curdir�pardir�sep�pathsep�defpath�altsep�extsep�devnull�realpath�supports_unicode_filenames�relpath�samefile�sameopenfile�samestat�
commonpathcCst|t�rdSdSdS)N�\/�\/)�
isinstance�bytes��path�r4�/usr/lib64/python3.8/ntpath.py�
_get_bothseps"s
r6cCs8t�|�}t|t�r$|�dd���S|�dd���SdS)zaNormalize case of pathname.

    Makes all characters lowercase and all slashes into backslashes.�/�\rrN)�os�fspathr0r1�replace�lower��sr4r4r5r,s

cCsjt�|�}t|t�r,|�dd��d�rBdSn|�dd��d�rBdSt|�d}t|�d	koh|d	t|�kS)
zTest whether a path is absoluter7r8�\\?\Trr�\\?\�r)	r9r:r0r1r;�
startswithr�lenr6r=r4r4r5r	=s

c

GsTt�|�}t|t�r"d}d}d}nd}d}d}z�|sD|dd�|t|�\}}ttj|�D]~}t|�\}}	|	r�|	d|kr�|s�|s�|}|	}q\n*|r�||kr�|��|��kr�|}|	}q\|}|r�|d|kr�||}||	}q\|�r|d|k�r|�r|dd�|k�r|||WS||WSttt	fk
�rNt
jd	|f|���YnXdS)
Nr8r.�:rr/�:r���r
)r9r:r0r1r�mapr<�	TypeError�AttributeError�BytesWarning�genericpath�_check_arg_types)
r3�pathsr!�seps�colonZresult_driveZresult_path�pZp_driveZp_pathr4r4r5r
MsL


��
cCst�|�}t|�dk�rt|t�r0d}d}d}nd}d}d}|�||�}|dd�|dkr�|dd	�|kr�|�|d�}|d
kr�|dd�|fS|�||d�}||dkr�|dd�|fS|d
kr�t|�}|d|�||d�fS|dd�|k�r|dd�|dd�fS|dd�|fS)
a�Split a pathname into drive/UNC sharepoint and relative path specifiers.
    Returns a 2-tuple (drive_or_unc, path); either part may be empty.

    If you assign
        result = splitdrive(p)
    It is always true that:
        result[0] + result[1] == p

    If the path contained a drive letter, drive_or_unc will contain everything
    up to and including the colon.  e.g. splitdrive("c:/dir") returns ("c:", "/dir")

    If the path contained a UNC path, the drive_or_unc will contain the host name
    and share up to but not including the fourth directory separator character.
    e.g. splitdrive("//host/computer/dir") returns ("//host/computer", "/dir")

    Paths cannot contain both a drive letter and a UNC path.

    �r8r7rDrrrEr�rFNrA)r9r:rCr0r1r;�find)rPr!r$rOZnormp�indexZindex2r4r4r5r|s.

$cCsxt�|�}t|�}t|�\}}t|�}|rD||d|krD|d8}q&|d|�||d�}}|�|�pj|}|||fS)z~Split a pathname.

    Return tuple (head, tail) where tail is everything after the final slash.
    Either part may be empty.rAN)r9r:r6rrC�rstrip)rPrN�d�i�head�tailr4r4r5r�s

cCs8t�|�}t|t�r$t�|ddd�St�|ddd�SdS)Nr8r7�.rrr)r9r:r0r1rK�	_splitext�rPr4r4r5r
�s

cCst|�dS)z)Returns the final component of a pathnamerA�rr\r4r4r5r�scCst|�dS)z-Returns the directory component of a pathnamerr]r\r4r4r5r�sc
Cs8zt�|�}Wntttfk
r*YdSXt�|j�S)zhTest whether a path is a symbolic link.
    This will always return false for Windows prior to 6.0.
    F)r9�lstat�OSError�
ValueErrorrI�stat�S_ISLNK�st_mode�r3�str4r4r5r�s
c	Cs.zt�|�}Wnttfk
r(YdSXdS)zCTest whether a path exists.  Returns True for broken symbolic linksFT)r9r^r_r`rdr4r4r5r�s
)�_getvolumepathnamecCstt�|�}t|�}t|�}t|�\}}|rD|d|krD|pB||kS||krPdStrl|�|�t|��|�kSdSdS)zaTest whether a path is a mount point (a drive root, the root of a
    share, or a mounted volume)rTFN)r9r:r6rrrfrU)r3rN�root�restr4r4r5rs
cCs�t�|�}t|t�rd}nd}|�|�s,|Sdt|�}}||kr\||t|�kr\|d7}q:dtjkrrtjd}nFdtjkr�|Sztjd}Wntk
r�d}YnXt	|tjd�}t|t�r�t�
|�}|dkr�t	t|�|d|��}|||d�S)	zLExpand ~ and ~user constructs.

    If user or $HOME is unknown, do nothing.�~�~rAZUSERPROFILEZHOMEPATHZ	HOMEDRIVE�N)r9r:r0r1rBrCr6�environ�KeyErrorr
�fsencoder)r3�tilderW�n�userhome�driver4r4r5r!s.








cCs2t�|�}t|t�rhd|kr(d|kr(|Sddl}t|j|jdd�}d}d}d}d	}d}ttd
d�}nFd|kr|d|kr||Sddl}|j|jd}d
}d}d}d}d}tj}|dd�}	d}
t	|�}|
|k�r.||
|
d�}||k�rX||
dd�}t	|�}z&|�
|�}
|	||d|
d�7}	Wn*tk
�rR|	||7}	|d}
YnX�n�||k�rJ||
d|
d�|k�r�|	|7}	|
d7}
n�||
dd�}t	|�}z|�
|�}
Wn*tk
�r�|	||7}	|d}
YnhX|d|
�}
z.|dk�rt�tjt�
|
��}n||
}Wn"tk
�r<||
|}YnX|	|7}	�n�||k�r||
d|
d�|k�r�|	|7}	|
d7}
�q$||
d|
d�|k�r^||
dd�}t	|�}z|�
|�}
Wn.tk
�r�|	|||7}	|d}
YnlX|d|
�}
z.|dk�r"t�tjt�
|
��}n||
}Wn&tk
�rR|||
|}YnX|	|7}	n�|dd�}
|
d7}
||
|
d�}|�r�||k�r�|
|7}
|
d7}
||
|
d�}�q�z.|dk�r�t�tjt�
|
��}n||
}Wntk
�r||
}YnX|	|7}	|�r$|
d8}
n|	|7}	|
d7}
q�|	S)zfExpand shell variables of the forms $var, ${var} and %var%.

    Unknown variables are left unchanged.�$�%rNz_-�ascii�'�{�}�environb�$�%�'�{�}rArQ)r9r:r0r1�stringZ
ascii_lettersZdigits�getattrrlrCrTr`rn�fsdecoderm)r3rZvarcharsZquoteZpercentZbraceZrbraceZdollarrl�resrTZpathlen�c�var�valuer4r4r5rQs�













c	CsPt�|�}t|t�r*d}d}d}d}d}nd}d}d}d	}d
}|�|�rL|S|�||�}t|�\}}|�|�r�||7}|�|�}|�|�}d}|t	|�k�r,||r�|||kr�||=q�|||k�r"|dkr�||d|kr�||d|d�=|d8}n&|dk�r|�
|��r||=n|d7}q�|d7}q�|�sB|�sB|�|�||�|�S)
z0Normalize path, eliminating double slashes, etc.r8r7rZ�..)s\\.\r?rrrr)z\\.\r@rrA)
r9r:r0r1rBr;r�lstriprrC�endswith�appendr
)	r3r!r$rr Zspecial_prefixes�prefix�compsrWr4r4r5r�sF









cCs@t�|�}t|�s8t|t�r&t��}nt��}t||�}t|�S)z�Return the absolute version of a path as a fallback function in case
    `nt._getfullpathname` is not available or raises OSError. See bpo-31047 for
    more.

    )	r9r:r	r0r1�getcwdb�getcwdr
r)r3�cwdr4r4r5�_abspath_fallback�s



r�)�_getfullpathnamec	Cs4ztt|��WSttfk
r.t|�YSXdS)z&Return the absolute version of a path.N)rr�r_r`r�r2r4r4r5rs)�_getfinalpathname�readlinkc
Cs�d}t�}t|�|kr�|�t|��z:|}t|�}t|�s\t|�sJ|}Wq�ttt|�|��}Wq
t	k
r�}z|j
|kr�WY�q��W5d}~XYq
tk
r�Yq�Yq
Xq
|S)N)rArQrR��� �2�C�Wi&i(i))�setr�add�_nt_readlinkr	rrr
rr_�winerrorr`)r3�allowed_winerror�seenZold_path�exr4r4r5�_readlink_deeps&
r�cCs�d}d}|r�zt|�}|r$t||�n|WStk
r�}z�|j|krF�z0t|�}||krt|rft||�n|WWY�TSWntk
r�YnXt|�\}}|r�|s�||WY�S|r�t||�n|}W5d}~XYqXq|S)N)rArQrRr�r�r�r�r�r��{i�i�rk)r�r
r_r�r�r)r3r�rYr��new_path�namer4r4r5�_getfinalpathname_nonstrictCs(
 &r�c	
Cs^t|�}t|t�rBd}d}d}t��}t|�tt�t��krjdSn(d}d}d}t��}t|�tt�krjdS|�	|�}|s�t
|�s�t||�}zt|�}d	}Wn0t
k
r�}z|j}t|�}W5d}~XYnX|�sZ|�	|��rZ|�	|�r�||t|�d�}n|t|�d�}zt|�|k�r"|}Wn4t
k
�rX}z|j|k�rH|}W5d}~XYnX|S)
Nr?s\\?\UNC\s\\s\\.\NULr@z\\?\UNC\z\\z\\.\NULr)rr0r1r9r�rrnr&r�rBr	r
r�r_r�r�rC)	r3r�Z
unc_prefixZnew_unc_prefixr�Z
had_prefixZinitial_winerrorr�Zspathr4r4r5r'qsD



�getwindowsversionrRrQcCsft�|�}t|t�r"d}d}d}nd}d}d}|dkr:|}|sFtd��t�|�}z�tt|��}tt|��}t|�\}}t|�\}	}
t|�t|	�kr�td	|	|f��d
d�|�	|�D�}dd�|
�	|�D�}d
}
t
||�D]$\}}t|�t|�kr�q�|
d7}
q�|gt|�|
||
d�}|�s(|WSt|�WSt
ttttfk
�r`t�d||��YnXdS)z#Return a relative version of a pathr8rZr�rrrNzno path specifiedz&path is on mount %r, start on mount %rcSsg|]}|r|�qSr4r4��.0�xr4r4r5�
<listcomp>�szrelpath.<locals>.<listcomp>cSsg|]}|r|�qSr4r4r�r4r4r5r��srrAr))r9r:r0r1r`rrrrr�ziprCr
rHrIrJ�DeprecationWarningrKrL)r3�startr!rr Z	start_absZpath_absZstart_driveZ
start_restZ
path_driveZ	path_rest�
start_list�	path_listrWZe1Ze2�rel_listr4r4r5r)�sJ


�

c	s�|std��tttj|��}t|dt�r8d�d�d�nd�d�d��z@��fd	d
�|D�}�fdd
�|D�}zt�fdd
�|D��\}Wntk
r�td�d�YnXttdd
�|D���dkr�td��t	|d�
����\}}|���}�fdd
�|D�}�fdd
�|D�}t|�}t
|�}t|�D]*\}	}
|
||	k�r*|d|	�}�qf�q*|dt|��}|�rt|�n|}|��|�WSttfk
�r�tjd|���YnXdS)zDGiven a sequence of path names, returns the longest common sub-path.z%commonpath() arg is an empty sequencerr8r7rZrrrcs g|]}t|��������qSr4)rr;r<)r�rP)r$r!r4r5r��szcommonpath.<locals>.<listcomp>csg|]\}}|����qSr4r]�r�rVrP�r!r4r5r��sc3s"|]\}}|dd��kVqdS)NrAr4r�r�r4r5�	<genexpr>�szcommonpath.<locals>.<genexpr>z%Can't mix absolute and relative pathsNcss|]\}}|VqdS)Nr4r�r4r4r5r��srAzPaths don't have the same drivecsg|]}|r|�kr|�qSr4r4�r�r��rr4r5r��scsg|]}�fdd�|D��qS)csg|]}|r|�kr|�qSr4r4r�r�r4r5r�sz)commonpath.<locals>.<listcomp>.<listcomp>r4)r�r>r�r4r5r�sr-)r-)r`�tuplerGr9r:r0r1r�rCrr;r�min�max�	enumerater
rHrIrKrL)rMZdrivesplits�split_pathsr	rrr3�common�s1�s2rWr�r�r4)r$rr!r5r-�sF

)�_isdir)N)1�__doc__rr r%r!r"r$r#r&r9�sysrarK�__all__r6rr	r
rrr
r[rrrr�ntrf�ImportErrorrrrrr�r�rr�r�r�r'r�r��hasattrr�r(r)r-r�rr4r4r4r5�<module>s�	�
/8

0q2

*.2�
84__pycache__/filecmp.cpython-38.opt-2.pyc000064400000013600151153537600013771 0ustar00U

e5df&�@s�ddlZddlZddlmZdddddgZiZdZd	d
ddd
dddgZdd�Zd!dd�Z	dd�Z
dd�ZGdd�d�Zd"dd�Z
ee	fdd�Zdd�Zdd�Zed kr�e�dS)#�N)�filterfalse�clear_cache�cmp�dircmp�cmpfiles�DEFAULT_IGNORESi ZRCSZCVSZtagsz.gitz.hgz.bzrZ_darcs�__pycache__cCst��dS�N)�_cache�clear�rr�/usr/lib64/python3.8/filecmp.pyrsTcCs�tt�|��}tt�|��}|dtjks8|dtjkr<dS|rL||krLdS|d|dkr`dSt�||||f�}|dkr�t||�}tt�dkr�t�|t||||f<|S)NrFT��d)	�_sig�os�stat�S_IFREGr
�get�_do_cmp�lenr)�f1�f2�shallow�s1�s2Zoutcomerrr
rs
cCst�|j�|j|jfSr	)r�S_IFMT�st_mode�st_size�st_mtime)�strrr
rDs
�rc
Cs�t}t|d��n}t|d��X}|�|�}|�|�}||krPW5QR�W5QR�dS|sW5QR�W5QR�dSqW5QRXW5QRXdS)N�rbFT)�BUFSIZE�open�read)rr�bufsize�fp1�fp2Zb1Zb2rrr
rIs

rc@s�eZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Ze
eeeeeeeeeeeed�Zdd�ZdS)rNcCsD||_||_|dkr$tjtjg|_n||_|dkr:t|_n||_dSr	)�left�rightr�curdir�pardir�hider�ignore)�self�a�br-r,rrr
�__init__xszdircmp.__init__cCsPtt�|j�|j|j�|_tt�|j�|j|j�|_|j�	�|j�	�dSr	)
�_filterr�listdirr(r,r-�	left_listr)�
right_list�sort�r.rrr
�phase0�s
�
�
z
dircmp.phase0cCs�ttttjj|j�|j��}ttttjj|j�|j��}tt|j	t
|j|���|_tt|j	t
|j|���|_tt|j	t
|j|���|_dSr	)�dict�zip�mapr�path�normcaser4r5�list�__getitem__�filter�__contains__�commonr�	left_only�
right_only)r.r/r0rrr
�phase1�s
z
dircmp.phase1c
Cs4g|_g|_g|_|jD�]}tj�|j|�}tj�|j|�}d}zt�	|�}Wn&t
k
rv}zd}W5d}~XYnXzt�	|�}Wn&t
k
r�}zd}W5d}~XYnX|�r"t	�|j�}t	�|j�}	||	kr�|j�
|�n>t	�|�r�|j�
|�n&t	�|��r|j�
|�n|j�
|�q|j�
|�qdS)Nrr)�common_dirs�common_files�common_funnyrBrr<�joinr(r)r�OSErrorrr�append�S_ISDIR�S_ISREG)
r.�xZa_pathZb_path�okZa_statZwhyZb_statZa_typeZb_typerrr
�phase2�s4
z
dircmp.phase2cCs&t|j|j|j�}|\|_|_|_dSr	)rr(r)rG�
same_files�
diff_files�funny_files)r.Zxxrrr
�phase3�sz
dircmp.phase3cCsNi|_|jD]<}tj�|j|�}tj�|j|�}t|||j|j	�|j|<qdSr	)
�subdirsrFrr<rIr(r)rr-r,)r.rNZa_xZb_xrrr
�phase4�s

z
dircmp.phase4cCs$|��|j��D]}|��qdSr	)rVrU�values�phase4_closure�r.Zsdrrr
rX�szdircmp.phase4_closurecCs�td|j|j�|jr2|j��td|jd|j�|jrT|j��td|jd|j�|jrp|j��td|j�|jr�|j��td|j�|jr�|j��td|j�|j	r�|j	��td|j	�|j
r�|j
��td|j
�dS)	NZdiffzOnly in�:zIdentical files :zDiffering files :zTrouble with common files :zCommon subdirectories :zCommon funny cases :)�printr(r)rCr6rDrQrRrSrFrHr7rrr
�report�s,






z
dircmp.reportcCs*|��|j��D]}t�|��qdSr	)r\rUrWr[rYrrr
�report_partial_closure�szdircmp.report_partial_closurecCs*|��|j��D]}t�|��qdSr	)r\rUrWr[�report_full_closurerYrrr
r^�szdircmp.report_full_closure)rUrQrRrSrFrGrHrBrCrDr4r5cCs*||jkrt|��|j||�t||�Sr	)�	methodmap�AttributeError�getattr)r.�attrrrr
�__getattr__�s
zdircmp.__getattr__)NN)�__name__�
__module__�__qualname__r1r8rErPrTrVrXr\r]r^r9r_rcrrrr
rVs0"
#
�cCsJgggf}|D]6}tj�||�}tj�||�}|t|||��|�q|Sr	)rr<rI�_cmprK)r/r0rBr�resrNZaxZbxrrr
r�s
cCs0z|||||��WStk
r*YdSXdS)N�)rJ)r/r0Zsh�absrrrr
rgsrgcCstt|j|��Sr	)r>rrA)Zflist�skiprrr
r2sr2cCsrddl}ddl}|�|jdd�d�\}}t|�dkrB|�dd��t|d|d�}d|krf|��n|��dS)Nrr�rrizneed exactly two args)z-r�)�sys�getopt�argvrZGetoptErrorrr^r\)rnroZoptions�argsZddrrr
�demo$s
rr�__main__)T)T)rr�	itertoolsr�__all__r
r"rrrrrrrrjrgr2rrrdrrrr
�<module>
s4�
'
%
	__pycache__/aifc.cpython-38.opt-1.pyc000064400000061604151153537600013262 0ustar00U

e5d.��
@sBdZddlZddlZddlZdddgZGdd�de�ZdZdd	�Zd
d�Z	dd
�Z
dd�Zdd�ZdZ
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zdd!lmZdd"lmZed#d$�Zd%ej_d&ej_d'ej_d(ej_d)ej_d*ej_Gd+d,�d,�Z Gd-d.�d.�Z!dAd/d�Z"dBd0d�Z#e$d1k�r>ddl%Z%e%j&d2d��sNe%j&�'d3�e%j&d2Z(e"e(d4���Z)e*d5e(�e*d6e)�+��e*d7e)�,��e*d8e)�-��e*d9e)�.��e*d:e)�/��e*d;e)�0��e%j&d<d��r4e%j&d<Z1e*d=e1�e"e1d>��6Z2e2�3e)�4��e)�5d?�Z6e6�s�q"e2�7e6��qW5QRXe*d@�W5QRXdS)CaJStuff to parse AIFF-C and AIFF files.

Unless explicitly stated otherwise, the description below is true
both for AIFF-C files and AIFF files.

An AIFF-C file has the following structure.

  +-----------------+
  | FORM            |
  +-----------------+
  | <size>          |
  +----+------------+
  |    | AIFC       |
  |    +------------+
  |    | <chunks>   |
  |    |    .       |
  |    |    .       |
  |    |    .       |
  +----+------------+

An AIFF file has the string "AIFF" instead of "AIFC".

A chunk consists of an identifier (4 bytes) followed by a size (4 bytes,
big endian order), followed by the data.  The size field does not include
the size of the 8 byte header.

The following chunk types are recognized.

  FVER
      <version number of AIFF-C defining document> (AIFF-C only).
  MARK
      <# of markers> (2 bytes)
      list of markers:
          <marker ID> (2 bytes, must be > 0)
          <position> (4 bytes)
          <marker name> ("pstring")
  COMM
      <# of channels> (2 bytes)
      <# of sound frames> (4 bytes)
      <size of the samples> (2 bytes)
      <sampling frequency> (10 bytes, IEEE 80-bit extended
          floating point)
      in AIFF-C files only:
      <compression type> (4 bytes)
      <human-readable version of compression type> ("pstring")
  SSND
      <offset> (4 bytes, not used by this program)
      <blocksize> (4 bytes, not used by this program)
      <sound data>

A pstring consists of 1 byte length, a string of characters, and 0 or 1
byte pad to make the total length even.

Usage.

Reading AIFF files:
  f = aifc.open(file, 'r')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods read(), seek(), and close().
In some types of audio files, if the setpos() method is not used,
the seek() method is not necessary.

This returns an instance of a class with the following public methods:
  getnchannels()  -- returns number of audio channels (1 for
             mono, 2 for stereo)
  getsampwidth()  -- returns sample width in bytes
  getframerate()  -- returns sampling frequency
  getnframes()    -- returns number of audio frames
  getcomptype()   -- returns compression type ('NONE' for AIFF files)
  getcompname()   -- returns human-readable version of
             compression type ('not compressed' for AIFF files)
  getparams() -- returns a namedtuple consisting of all of the
             above in the above order
  getmarkers()    -- get the list of marks in the audio file or None
             if there are no marks
  getmark(id) -- get mark with the specified id (raises an error
             if the mark does not exist)
  readframes(n)   -- returns at most n frames of audio
  rewind()    -- rewind to the beginning of the audio stream
  setpos(pos) -- seek to the specified position
  tell()      -- return the current position
  close()     -- close the instance (make it unusable)
The position returned by tell(), the position given to setpos() and
the position of marks are all compatible and have nothing to do with
the actual position in the file.
The close() method is called automatically when the class instance
is destroyed.

Writing AIFF files:
  f = aifc.open(file, 'w')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods write(), tell(), seek(), and
close().

This returns an instance of a class with the following public methods:
  aiff()      -- create an AIFF file (AIFF-C default)
  aifc()      -- create an AIFF-C file
  setnchannels(n) -- set the number of channels
  setsampwidth(n) -- set the sample width
  setframerate(n) -- set the frame rate
  setnframes(n)   -- set the number of frames
  setcomptype(type, name)
          -- set the compression type and the
             human-readable compression type
  setparams(tuple)
          -- set all parameters at once
  setmark(id, pos, name)
          -- add specified mark to the list of marks
  tell()      -- return current position in output file (useful
             in combination with setmark())
  writeframesraw(data)
          -- write audio frames without pathing up the
             file header
  writeframes(data)
          -- write audio frames and patch up the file header
  close()     -- patch up the file header and close the
             output file
You should set the parameters before the first writeframesraw or
writeframes.  The total number of frames does not need to be set,
but when it is set to the correct value, the header does not have to
be patched up.
It is best to first set all parameters, perhaps possibly the
compression type, and then write audio frames using writeframesraw.
When all frames have been written, either call writeframes(b'') or
close() to patch up the sizes in the header.
Marks can be added anytime.  If there are any marks, you must call
close() after all frames have been written.
The close() method is called automatically when the class instance
is destroyed.

When a file is opened with the extension '.aiff', an AIFF file is
written, otherwise an AIFF-C file is written.  This default can be
changed by calling aiff() or aifc() before the first writeframes or
writeframesraw.
�N�Error�open�openfpc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/aifc.pyr�sl@QEcCs:zt�d|�d��dWStjk
r4td�YnXdS)N�>l�r��structZunpack�read�error�EOFError��filerrr	�
_read_long�srcCs:zt�d|�d��dWStjk
r4td�YnXdS)N�>Lrrrrrrr	�_read_ulong�srcCs:zt�d|�d��dWStjk
r4td�YnXdS)N�>h�rrrrrr	�_read_short�srcCs:zt�d|�d��dWStjk
r4td�YnXdS)N�>Hrrrrrrr	�_read_ushort�srcCs@t|�d��}|dkrd}n
|�|�}|d@dkr<|�d�}|S)N�r�)�ordr)r�length�data�dummyrrr	�_read_string�s

r!g�����cCs�t|�}d}|dkr d}|d}t|�}t|�}||krN|krNdkrXnnd}n0|dkrft}n"|d}|d|td	|d
�}||S)Nrr�����g�i�?lg@�?)rr�	_HUGE_VAL�pow)�f�expon�sign�himant�lomantrrr	�_read_float�s"r-cCs|�t�d|��dS)Nr��writer
�pack�r(�xrrr	�_write_short�sr3cCs|�t�d|��dS)Nrr.r1rrr	�
_write_ushort�sr4cCs|�t�d|��dS)Nr
r.r1rrr	�_write_long�sr5cCs|�t�d|��dS)Nrr.r1rrr	�_write_ulong�sr6cCsRt|�dkrtd��|�t�dt|���|�|�t|�d@dkrN|�d�dS)N�z%string exceeds maximum pstring length�Brr�)�len�
ValueErrorr/r
r0)r(�srrr	�
_write_string�s
r=c	Cs�ddl}|dkrd}|d}nd}|dkr8d}d}d}n�|�|�\}}|dks^|dks^||krp|dB}d}d}nh|d}|dkr�|�||�}d}||B}|�|d�}|�|�}t|�}|�||d�}|�|�}t|�}t||�t||�t||�dS)	Nrr#r"i@rr$i�?� )�mathZfrexpZldexpZfloor�intr4r6)	r(r2r?r*r)r+r,ZfmantZfsmantrrr	�_write_float�s8




rA)�Chunk)�
namedtuple�_aifc_paramsz7nchannels sampwidth framerate nframes comptype compnamez3Number of audio channels (1 for mono, 2 for stereo)zSample width in byteszSampling frequencyzNumber of audio framesz(Compression type ("NONE" for AIFF files)zRA human-readable version of the compression type
('not compressed' for AIFF files)c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�ZdS)2�	Aifc_readNcCs8d|_d|_g|_d|_||_t|�}|��dkr:td��|�d�}|dkrTd|_	n|dkrdd|_	ntd��d|_
d|_d|_zt|j�}Wnt
k
r�Y�qYnX|��}|d	kr�|�|�d|_
nH|d
kr�||_|�d�}d|_n(|dkr�t|�|_n|d
k�r|�|�|��qx|j
�r,|j�s4td��dS)Nr�FORMz file does not start with FORM idr�AIFF�AIFCrznot an AIFF or AIFF-C file�COMM�SSND��FVER�MARKz$COMM chunk and/or SSND chunk missing)�_version�_convert�_markers�	_soundpos�_filerBZgetnamerr�_aifcZ_comm_chunk_read�_ssnd_chunk�_ssnd_seek_neededr�_read_comm_chunkr�	_readmark�skip)�selfr�chunkZformdataZ	chunknamer rrr	�initfp4sH





zAifc_read.initfpcCsLt|t�r>t�|d�}z|�|�WqH|���YqHXn
|�|�dS)N�rb)�
isinstance�str�builtinsrr[�close�rYr(Zfile_objectrrr	�__init__\s

zAifc_read.__init__cCs|S�Nr�rYrrr	�	__enter__hszAifc_read.__enter__cGs|��dSrc�r`�rY�argsrrr	�__exit__kszAifc_read.__exit__cCs|jSrc)rRrdrrr	�getfpqszAifc_read.getfpcCsd|_d|_dS)Nrr)rUrQrdrrr	�rewindtszAifc_read.rewindcCs |j}|dk	rd|_|��dSrc)rRr`�rYrrrr	r`xszAifc_read.closecCs|jSrc)rQrdrrr	�tell~szAifc_read.tellcCs|jSrc)�
_nchannelsrdrrr	�getnchannels�szAifc_read.getnchannelscCs|jSrc)�_nframesrdrrr	�
getnframes�szAifc_read.getnframescCs|jSrc)�
_sampwidthrdrrr	�getsampwidth�szAifc_read.getsampwidthcCs|jSrc)�
_frameraterdrrr	�getframerate�szAifc_read.getframeratecCs|jSrc��	_comptyperdrrr	�getcomptype�szAifc_read.getcomptypecCs|jSrc��	_compnamerdrrr	�getcompname�szAifc_read.getcompnamecCs*t|��|��|��|��|��|���Src)rDrorsrurqrxr{rdrrr	�	getparams�s�zAifc_read.getparamscCst|j�dkrdS|jS�Nr�r:rPrdrrr	�
getmarkers�szAifc_read.getmarkerscCs2|jD]}||dkr|Sqtd�|���dS�Nrzmarker {0!r} does not exist�rPr�format�rY�id�markerrrr	�getmark�s

zAifc_read.getmarkcCs*|dks||jkrtd��||_d|_dS)Nrzposition not in ranger)rprrQrU)rY�posrrr	�setpos�szAifc_read.setposcCs�|jrD|j�d�|j�d�}|j|j}|r>|j�|d�d|_|dkrPdS|j�||j�}|jrv|rv|�|�}|jt|�|j|j	|_|S)NrrKr)
rUrT�seekrrQ�
_framesizerOr:rnrr)rY�nframesr r�rrrr	�
readframes�s 

�
zAifc_read.readframescCsddl}|�|d�S�Nrr)�audioopZalaw2lin�rYrr�rrr	�	_alaw2lin�szAifc_read._alaw2lincCsddl}|�|d�Sr�)r�Zulaw2linr�rrr	�	_ulaw2lin�szAifc_read._ulaw2lincCs2ddl}t|d�sd|_|�|d|j�\}|_|S�Nr�_adpcmstater)r��hasattrr�Z	adpcm2linr�rrr	�
_adpcm2lin�s

zAifc_read._adpcm2lincCsVt|�|_t|�|_t|�dd|_tt|��|_|jdkrFtd��|jdkrXtd��|j|j|_	|j
�rFd}|jdkr�d}t�
d�d	|_|�d
�|_|r�t|j�d��}|d@dkr�|d}|j||_|j�dd�t|�|_|jdk�rR|jd
k�r
|j|_n4|jdk�r |j|_n|jdk�r6|j|_ntd��d|_nd|_d|_dS)N�rKr�bad sample width�bad # of channels�rzWarning: bad COMM chunk size�rr"�NONE�G722��ulaw�ULAW��alaw�ALAW�unsupported compression typer�not compressed)rrnrrprrr@r-rtrr�rSZ	chunksize�warnings�warnrrwrrr�r!rzr�rOr�r�)rYrZZkludgerrrr	rV�sD









zAifc_read._read_comm_chunkcCs�t|�}zDt|�D]6}t|�}t|�}t|�}|s6|r|j�|||f�qWnDtk
r�dt|j�t|j�dkrxdnd|f}t�	|�YnXdS)Nz;Warning: MARK chunk contains only %s marker%s instead of %sr�r<)
r�rangerr!rP�appendrr:r�r�)rYrZZnmarkers�ir�r��name�wrrr	rW�s��zAifc_read._readmark)rrrrRr[rbrerirjrkr`rmrorqrsrurxr{r|rr�r�r�r�r�r�rVrWrrrr	rEs2$(*rEc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Z d<d=�Z!d>d?�Z"d@dA�Z#dBdC�Z$dDdE�Z%dFdG�Z&dHdI�Z'dS)J�
Aifc_writeNcCs\t|t�rNt�|d�}z|�|�Wn|���YnX|�d�rXd|_n
|�|�dS)N�wbz.aiffr)r]r^r_rr[r`�endswithrSrarrr	rb/s

zAifc_write.__init__cCs^||_t|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_g|_
d|_d|_dS)Nr�r�rr)rR�
_AIFC_versionrNrwrzrOrnrrrtrp�_nframeswritten�_datawritten�_datalengthrP�_marklengthrSrlrrr	r[?szAifc_write.initfpcCs|��dSrcrfrdrrr	�__del__PszAifc_write.__del__cCs|Srcrrdrrr	reSszAifc_write.__enter__cGs|��dSrcrfrgrrr	riVszAifc_write.__exit__cCs|jrtd��d|_dS)N�0cannot change parameters after starting to writer�r�rrSrdrrr	�aiff\szAifc_write.aiffcCs|jrtd��d|_dS)Nr�rr�rdrrr	�aifcaszAifc_write.aifccCs(|jrtd��|dkrtd��||_dS)Nr�rr�)r�rrn)rY�	nchannelsrrr	�setnchannelsfs
zAifc_write.setnchannelscCs|jstd��|jS)Nznumber of channels not set)rnrrdrrr	romszAifc_write.getnchannelscCs0|jrtd��|dks|dkr&td��||_dS)Nr�rrr�)r�rrr)rY�	sampwidthrrr	�setsampwidthrs
zAifc_write.setsampwidthcCs|jstd��|jS)Nzsample width not set)rrrrdrrr	rsyszAifc_write.getsampwidthcCs(|jrtd��|dkrtd��||_dS)Nr�rzbad frame rate)r�rrt)rY�	frameraterrr	�setframerate~s
zAifc_write.setframeratecCs|jstd��|jS)Nzframe rate not set)rtrrdrrr	ru�szAifc_write.getframeratecCs|jrtd��||_dS)Nr�)r�rrp)rYr�rrr	�
setnframes�szAifc_write.setnframescCs|jSrc�r�rdrrr	rq�szAifc_write.getnframescCs.|jrtd��|dkrtd��||_||_dS�Nr�)r�r�r�r�r�r�r�)r�rrwrz)rY�comptype�compnamerrr	�setcomptype�szAifc_write.setcomptypecCs|jSrcrvrdrrr	rx�szAifc_write.getcomptypecCs|jSrcryrdrrr	r{�szAifc_write.getcompnamecCsf|\}}}}}}|jrtd��|dkr.td��|�|�|�|�|�|�|�|�|�||�dSr�)r�rr�r�r�r�r�)rYZparamsr�r�r�r�r�r�rrr	�	setparams�s



zAifc_write.setparamscCs8|jr|jr|jstd��t|j|j|j|j|j|j�S)Nznot all parameters set)rnrrrtrrDrprwrzrdrrr	r|�s�zAifc_write.getparamscCs�|dkrtd��|dkr td��t|t�s2td��tt|j��D],}||j|dkr@|||f|j|<dSq@|j�|||f�dS)Nrzmarker ID must be > 0zmarker position must be >= 0zmarker name must be bytes)rr]�bytesr�r:rPr�)rYr�r�r�r�rrr	�setmark�s
zAifc_write.setmarkcCs2|jD]}||dkr|Sqtd�|���dSr�r�r�rrr	r��s

zAifc_write.getmarkcCst|j�dkrdS|jSr}r~rdrrr	r�szAifc_write.getmarkerscCs|jSrcr�rdrrr	rm�szAifc_write.tellcCszt|ttf�st|��d�}|�t|��t|�|j|j}|j	rN|�	|�}|j
�|�|j||_|j
t|�|_
dS)Nr8)r]r��	bytearray�
memoryview�cast�_ensure_header_writtenr:rrrnrOrRr/r�r�)rYrr�rrr	�writeframesraw�s
zAifc_write.writeframesrawcCs.|�|�|j|jks"|j|jkr*|��dSrc)r�r�rpr�r��_patchheader)rYrrrr	�writeframes�s


�zAifc_write.writeframescCs�|jdkrdSz^|�d�|jd@r<|j�d�|jd|_|��|j|jksb|j	|jksb|j
rj|��W5d|_|j}d|_|��XdS)Nrrr9)rRrOr`r�r�r/�
_writemarkersr�rpr�r�r�)rYr(rrr	r`�s$



��zAifc_write.closecCsddl}|�|d�Sr�)r�Zlin2alawr�rrr	�	_lin2alaw�szAifc_write._lin2alawcCsddl}|�|d�Sr�)r�Zlin2ulawr�rrr	�	_lin2ulawszAifc_write._lin2ulawcCs2ddl}t|d�sd|_|�|d|j�\}|_|Sr�)r�r�r�Z	lin2adpcmr�rrr	�
_lin2adpcms

zAifc_write._lin2adpcmcCsf|jsb|jdkr.|jsd|_|jdkr.td��|js<td��|jsJtd��|jsXtd��|�|�dS)N�r�r�r�r�r�rzRsample width must be 2 when compressing with ulaw/ULAW, alaw/ALAW or G7.22 (ADPCM)z# channels not specifiedzsample width not specifiedzsampling rate not specified)r�rwrrrrnrt�
_write_header)rYZdatasizerrr	r�
s

z!Aifc_write._ensure_header_writtencCs>|jdkr|j|_n&|jdkr(|j|_n|jdkr:|j|_dS)Nr�r�r�)rwr�rOr�r�rdrrr	�_init_compressions




zAifc_write._init_compressionc	CsJ|jr|jdkr|��|j�d�|js<||j|j|_|j|j|j|_|jd@rf|jd|_|jr�|jdkr�|jd|_|jd@r�|jd|_n0|jdkr�|jdd|_|jd@r�|jd|_z|j�	�|_
Wnttfk
r�d|_
YnX|�
|j�}|j�rB|j�d	�|j�d
�t|jd�t|j|j�n|j�d�|j�d�t|j|�t|j|j�|j
dk	�r�|j�	�|_t|j|j�|jd
k�r�t|jd�nt|j|jd�t|j|j�|j�r�|j�|j�t|j|j�|j�d�|j
dk	�r|j�	�|_t|j|jd�t|jd�t|jd�dS)Nr�rFr)r�r�r�r�rr��rrHrLrGrIr�rKrJr)rSrwr�rRr/rprnrrr�rm�_form_length_pos�AttributeError�OSError�_write_form_lengthr6rNr3�_nframes_posrArtr=rz�_ssnd_length_pos)rYZ
initlength�
commlengthrrr	r�%s^




zAifc_write._write_headercCs\|jr*dt|j�}|d@r$|d}d}nd}d}t|jd||jd|d|�|S)	Nr�r�r�rrrK�)rSr:rzr6rRr�)rY�
datalengthr�Z
verslengthrrr	r�Xs"����zAifc_write._write_form_lengthcCs�|j��}|jd@r,|jd}|j�d�n|j}||jkrd|j|jkrd|jdkrd|j�|d�dS|j�|j	d�|�
|�}|j�|jd�t|j|j�|j�|j
d�t|j|d�|j�|d�|j|_||_dS)Nrr9rrK)rRrmr�r/r�rpr�r�r�r�r�r�r6r�)rYZcurposr�r rrr	r�es*




��
zAifc_write._patchheadercCs�t|j�dkrdS|j�d�d}|jD]:}|\}}}|t|�dd}t|�d@dkr(|d}q(t|j|�|d|_t|jt|j��|jD]2}|\}}}t|j|�t|j|�t|j|�q�dS)NrrMrr�rK)r:rPrRr/r6r�r3r=)rYrr�r�r�r�rrr	r�{s"





zAifc_write._writemarkers)(rrrrRrbr[r�rerir�r�r�ror�rsr�rur�rqr�rxr{r�r|r�r�rrmr�r�r`r�r�r�r�r�r�r�r�r�rrrr	r�sJ	

3
r�cCsJ|dkrt|d�r|j}nd}|dkr.t|�S|dkr>t|�Std��dS)N�moder\)�rr\)r�r�z$mode must be 'r', 'rb', 'w', or 'wb')r�r�rEr�r�r(r�rrr	r�s
cCstjdtdd�t||d�S)NzBaifc.openfp is deprecated since Python 3.7. Use aifc.open instead.r)�
stacklevel)r�)r�r��DeprecationWarningrr�rrr	r�s
��__main__rz/usr/demos/data/audio/bach.aiffr�ZReadingznchannels =znframes   =zsampwidth =zframerate =zcomptype  =zcompname  =rZWritingr�izDone.)N)N)8�__doc__r
r_r��__all__�	Exceptionrr�rrrrr!r&r-r3r4r5r6r=rArZrB�collectionsrCrDr�r�r�r�r�r�rEr�rrr�sys�argvr��fnr(�printrorqrsrurxr{Zgn�gr�r|r�rr�rrrr	�<module>s~	

!�







__pycache__/wave.cpython-38.opt-1.pyc000064400000043265151153537610013326 0ustar00U

e5d6G�@s�dZddlZdddddgZGdd�de�Zd	Zd
ZddlZddlZddl	Z	ddl
mZddlm
Z
ddlZe
d
d�ZGdd�d�ZGdd�d�Zddd�Zddd�ZdS)a%
Stuff to parse WAVE files.

Usage.

Reading WAVE files:
      f = wave.open(file, 'r')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods read(), seek(), and close().
When the setpos() and rewind() methods are not used, the seek()
method is not  necessary.

This returns an instance of a class with the following public methods:
      getnchannels()  -- returns number of audio channels (1 for
                         mono, 2 for stereo)
      getsampwidth()  -- returns sample width in bytes
      getframerate()  -- returns sampling frequency
      getnframes()    -- returns number of audio frames
      getcomptype()   -- returns compression type ('NONE' for linear samples)
      getcompname()   -- returns human-readable version of
                         compression type ('not compressed' linear samples)
      getparams()     -- returns a namedtuple consisting of all of the
                         above in the above order
      getmarkers()    -- returns None (for compatibility with the
                         aifc module)
      getmark(id)     -- raises an error since the mark does not
                         exist (for compatibility with the aifc module)
      readframes(n)   -- returns at most n frames of audio
      rewind()        -- rewind to the beginning of the audio stream
      setpos(pos)     -- seek to the specified position
      tell()          -- return the current position
      close()         -- close the instance (make it unusable)
The position returned by tell() and the position given to setpos()
are compatible and have nothing to do with the actual position in the
file.
The close() method is called automatically when the class instance
is destroyed.

Writing WAVE files:
      f = wave.open(file, 'w')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods write(), tell(), seek(), and
close().

This returns an instance of a class with the following public methods:
      setnchannels(n) -- set the number of channels
      setsampwidth(n) -- set the sample width
      setframerate(n) -- set the frame rate
      setnframes(n)   -- set the number of frames
      setcomptype(type, name)
                      -- set the compression type and the
                         human-readable compression type
      setparams(tuple)
                      -- set all parameters at once
      tell()          -- return current position in output file
      writeframesraw(data)
                      -- write audio frames without patching up the
                         file header
      writeframes(data)
                      -- write audio frames and patch up the file header
      close()         -- patch up the file header and close the
                         output file
You should set the parameters before the first writeframesraw or
writeframes.  The total number of frames does not need to be set,
but when it is set to the correct value, the header does not have to
be patched up.
It is best to first set all parameters, perhaps possibly the
compression type, and then write audio frames using writeframesraw.
When all frames have been written, either call writeframes(b'') or
close() to patch up the sizes in the header.
The close() method is called automatically when the class instance
is destroyed.
�N�open�openfp�Error�	Wave_read�
Wave_writec@seZdZdS)rN)�__name__�
__module__�__qualname__�r
r
�/usr/lib64/python3.8/wave.pyrNs�)N�b�hN�i)�Chunk)�
namedtuple�_wave_paramsz7nchannels sampwidth framerate nframes comptype compnamec@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,S)-raPVariables used in this class:

    These variables are available to the user though appropriate
    methods of this class:
    _file -- the open file with methods read(), close(), and seek()
              set through the __init__() method
    _nchannels -- the number of audio channels
              available through the getnchannels() method
    _nframes -- the number of audio frames
              available through the getnframes() method
    _sampwidth -- the number of bytes per audio sample
              available through the getsampwidth() method
    _framerate -- the sampling frequency
              available through the getframerate() method
    _comptype -- the AIFF-C compression type ('NONE' if AIFF)
              available through the getcomptype() method
    _compname -- the human-readable AIFF-C compression type
              available through the getcomptype() method
    _soundpos -- the position in the audio stream
              available through the tell() method, set through the
              setpos() method

    These variables are used internally only:
    _fmt_chunk_read -- 1 iff the FMT chunk has been read
    _data_seek_needed -- 1 iff positioned correctly in audio
              file for readframes()
    _data_chunk -- instantiation of a chunk class for the DATA chunk
    _framesize -- size of one frame in the file
    cCs�d|_d|_t|dd�|_|j��dkr0td��|j�d�dkrHtd��d|_d|_d|_	zt|jdd�}Wnt
k
r�Yq�YnX|��}|d	kr�|�|�d|_n2|d
kr�|js�td��||_|j|j
|_d|_	q�|��qT|jr�|js�td��dS)
Nr)Z	bigendian�RIFFz file does not start with RIFF id��WAVEznot a WAVE filer�fmt �datazdata chunk before fmt chunkz#fmt chunk and/or data chunk missing)�_convert�	_soundposr�_fileZgetnamer�readZ_fmt_chunk_read�_data_chunk�_data_seek_needed�EOFError�_read_fmt_chunkZ	chunksize�
_framesize�_nframes�skip)�self�file�chunkZ	chunknamer
r
r�initfp~s8


zWave_read.initfpcCsRd|_t|t�r"t�|d�}||_z|�|�Wn|jrF|���YnXdS)N�rb��_i_opened_the_file�
isinstance�str�builtinsrr&�close�r#�fr
r
r�__init__�s
zWave_read.__init__cCs|��dS�N�r-�r#r
r
r�__del__�szWave_read.__del__cCs|Sr1r
r3r
r
r�	__enter__�szWave_read.__enter__cGs|��dSr1r2�r#�argsr
r
r�__exit__�szWave_read.__exit__cCs|jSr1)rr3r
r
r�getfp�szWave_read.getfpcCsd|_d|_dS)Nrr)rrr3r
r
r�rewind�szWave_read.rewindcCs"d|_|j}|rd|_|��dSr1)rr)r-�r#r$r
r
rr-�s
zWave_read.closecCs|jSr1)rr3r
r
r�tell�szWave_read.tellcCs|jSr1)�
_nchannelsr3r
r
r�getnchannels�szWave_read.getnchannelscCs|jSr1)r!r3r
r
r�
getnframes�szWave_read.getnframescCs|jSr1)�
_sampwidthr3r
r
r�getsampwidth�szWave_read.getsampwidthcCs|jSr1)�
_framerater3r
r
r�getframerate�szWave_read.getframeratecCs|jSr1��	_comptyper3r
r
r�getcomptype�szWave_read.getcomptypecCs|jSr1��	_compnamer3r
r
r�getcompname�szWave_read.getcompnamecCs*t|��|��|��|��|��|���Sr1)rr>rArCr?rFrIr3r
r
r�	getparams�s�zWave_read.getparamscCsdSr1r
r3r
r
r�
getmarkers�szWave_read.getmarkerscCstd��dS�Nzno marks�r�r#�idr
r
r�getmark�szWave_read.getmarkcCs*|dks||jkrtd��||_d|_dS)Nrzposition not in ranger)r!rrr)r#�posr
r
r�setpos�szWave_read.setposcCs�|jr8|j�dd�|j|j}|r2|j�|d�d|_|dkrDdS|j�||j�}|jdkrxtjdkrxt	�
||j�}|jr�|r�|�|�}|jt|�|j
|j|_|S)Nr�r�big)rr�seekrr rr@�sys�	byteorder�audioop�byteswapr�lenr=)r#�nframesrQ�datar
r
r�
readframes�s

zWave_read.readframescCs�z$t�d|�d��\}|_|_}}Wntjk
r@td�YnX|tkr�zt�d|�d��d}Wntjk
r�td�YnX|dd|_|js�t	d��nt	d	|f��|js�t	d
��|j|j|_
d|_d|_dS)
Nz<HHLLH�z<H�r���bad sample widthzunknown format: %r�bad # of channels�NONEznot compressed)
�structZunpack_fromrr=rB�errorr�WAVE_FORMAT_PCMr@rr rErH)r#r%Z
wFormatTagZdwAvgBytesPerSecZwBlockAlign�	sampwidthr
r
rr�s$$
zWave_read._read_fmt_chunkN)rrr	�__doc__r&r0r4r5r8r9r:r-r<r>r?rArCrFrIrJrKrPrRr]rr
r
r
rr_s,
c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:S);ra�Variables used in this class:

    These variables are user settable through appropriate methods
    of this class:
    _file -- the open file with methods write(), close(), tell(), seek()
              set through the __init__() method
    _comptype -- the AIFF-C compression type ('NONE' in AIFF)
              set through the setcomptype() or setparams() method
    _compname -- the human-readable AIFF-C compression type
              set through the setcomptype() or setparams() method
    _nchannels -- the number of audio channels
              set through the setnchannels() or setparams() method
    _sampwidth -- the number of bytes per audio sample
              set through the setsampwidth() or setparams() method
    _framerate -- the sampling frequency
              set through the setframerate() or setparams() method
    _nframes -- the number of audio frames written to the header
              set through the setnframes() or setparams() method

    These variables are used internally only:
    _datalength -- the size of the audio samples written to the header
    _nframeswritten -- the number of frames actually written
    _datawritten -- the size of the audio samples actually written
    cCsRd|_t|t�r"t�|d�}||_z|�|�Wn|jrF|���YnXdS)N�wbr(r.r
r
rr0.s
zWave_write.__init__cCs@||_d|_d|_d|_d|_d|_d|_d|_d|_d|_	dS)NrF)
rrr=r@rBr!�_nframeswritten�_datawritten�_datalength�_headerwrittenr;r
r
rr&:szWave_write.initfpcCs|��dSr1r2r3r
r
rr4FszWave_write.__del__cCs|Sr1r
r3r
r
rr5IszWave_write.__enter__cGs|��dSr1r2r6r
r
rr8LszWave_write.__exit__cCs(|jrtd��|dkrtd��||_dS)N�0cannot change parameters after starting to writerrc)rlrr=)r#�	nchannelsr
r
r�setnchannelsRs
zWave_write.setnchannelscCs|jstd��|jS)Nznumber of channels not set)r=rr3r
r
rr>YszWave_write.getnchannelscCs0|jrtd��|dks|dkr&td��||_dS)Nrorrrb)rlrr@)r#rhr
r
r�setsampwidth^s
zWave_write.setsampwidthcCs|jstd��|jS)Nzsample width not set)r@rr3r
r
rrAeszWave_write.getsampwidthcCs0|jrtd��|dkrtd��tt|��|_dS)Nrorzbad frame rate)rlr�int�roundrB)r#�	framerater
r
r�setframeratejs
zWave_write.setframeratecCs|jstd��|jS)Nzframe rate not set)rBrr3r
r
rrCqszWave_write.getframeratecCs|jrtd��||_dS�Nro)rlrr!)r#r[r
r
r�
setnframesvszWave_write.setnframescCs|jSr1�rkr3r
r
rr?{szWave_write.getnframescCs.|jrtd��|dkrtd��||_||_dS)Nro)rdzunsupported compression type)rlrrErH)r#�comptype�compnamer
r
r�setcomptype~szWave_write.setcomptypecCs|jSr1rDr3r
r
rrF�szWave_write.getcomptypecCs|jSr1rGr3r
r
rrI�szWave_write.getcompnamecCsV|\}}}}}}|jrtd��|�|�|�|�|�|�|�|�|�||�dSrw)rlrrqrrrvrxr|)r#Zparamsrprhrur[rzr{r
r
r�	setparams�s



zWave_write.setparamscCs8|jr|jr|jstd��t|j|j|j|j|j|j�S)Nznot all parameters set)r=r@rBrrr!rErHr3r
r
rrJ�s�zWave_write.getparamscCstd��dS)Nzsetmark() not supportedrM)r#rOrQ�namer
r
r�setmark�szWave_write.setmarkcCstd��dSrLrMrNr
r
rrP�szWave_write.getmarkcCsdSr1r
r3r
r
rrK�szWave_write.getmarkerscCs|jSr1ryr3r
r
rr<�szWave_write.tellcCs�t|ttf�st|��d�}|�t|��t|�|j|j}|j	rN|�	|�}|jdkrpt
jdkrpt�
||j�}|j�|�|jt|�7_|j||_dS)N�BrrT)r*�bytes�	bytearray�
memoryview�cast�_ensure_header_writtenrZr@r=rrVrWrXrYr�writerlrk)r#r\r[r
r
r�writeframesraw�s
zWave_write.writeframesrawcCs"|�|�|j|jkr|��dSr1)r�rmrl�_patchheader)r#r\r
r
r�writeframes�s
zWave_write.writeframescCsXz2|jr0|�d�|j|jkr&|��|j��W5d|_|j}|rRd|_|��XdS)Nr)rr)r-r�rmrlr��flushr;r
r
rr-�s
zWave_write.closecCs>|js:|jstd��|js"td��|js0td��|�|�dS)Nz# channels not specifiedzsample width not specifiedzsampling rate not specified)rnr=rr@rB�
_write_header)r#Zdatasizer
r
rr��sz!Wave_write._ensure_header_writtencCs�|j�d�|js$||j|j|_|j|j|j|_z|j��|_Wntt	fk
rfd|_YnX|j�t
�dd|jdddt|j|j
|j|j
|j|j|j|jdd��|jdk	r�|j��|_|j�t
�d	|j��d
|_dS)Nrz<L4s4sLHHLLHH4s�$rr�rar�<LT)rr�r!r=r@rmr<�_form_length_pos�AttributeError�OSErrorre�packrgrB�_data_length_posrn)r#Z
initlengthr
r
rr��s2
�
zWave_write._write_headercCs�|j|jkrdS|j��}|j�|jd�|j�t�dd|j��|j�|j	d�|j�t�d|j��|j�|d�|j|_dS)Nrr�r�)
rlrmrr<rUr�r�rer�r�)r#Zcurposr
r
rr��s
zWave_write._patchheaderN) rrr	rir0r&r4r5r8rqr>rrrArvrCrxr?r|rFrIr}rJrrPrKr<r�r�r-r�r�r�r
r
r
rrs:


cCsJ|dkrt|d�r|j}nd}|dkr.t|�S|dkr>t|�Std��dS)N�moder')�rr')�wrjz$mode must be 'r', 'rb', 'w', or 'wb')�hasattrr�rrr�r/r�r
r
rr�s
cCstjdtdd�t||d�S)NzBwave.openfp is deprecated since Python 3.7. Use wave.open instead.r_)�
stacklevel)r�)�warnings�warn�DeprecationWarningrr�r
r
rrs
�)N)N)rir,�__all__�	ExceptionrrgZ_array_fmtsrXrerVr%r�collectionsrr�rrrrrr
r
r
r�<module>s(I�6d

__pycache__/dataclasses.cpython-38.opt-1.pyc000064400000056147151153537610014656 0ustar00U

e5d5��@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZdddddddd	d
ddd
gZ	Gdd�de
�ZGdd�d�Ze�Z
Gdd�d�Ze�Ze�i�ZGdd�d�Zed�Zed�Zed�ZdZdZdZe�d�ZGdd�de�ZGdd�ded�ZGd d�d�ZGd!d"�d"�Zeed#d#dd#dd$�d%d�Z d&d'�Z!d(d)�Z"dded*�d+d,�Z#d-d.�Z$d/d0�Z%d1d2�Z&d3d4�Z'd5d6�Z(d7d8�Z)d9d:�Z*d;d<�Z+d=d>�Z,d?d@�Z-dAdB�Z.dCdD�Z/dEdF�Z0dGdH�Z1dIdJ�Z2dKdL�Z3dddde1de2de2e3e2e3e2e3e2e3dM�Z4dNdO�Z5ddd#d#d#dPdPdPdQ�dRd�Z6dSd�Z7dTdU�Z8dVd
�Z9e:dW�dXd	�Z;dYdZ�Z<e=d[�d\d
�Z>d]d^�Z?d_dd#d#d#dPdPdPd`�dad�Z@dbd�ZAdceA_BdS)e�N�	dataclass�field�Field�FrozenInstanceError�InitVar�MISSING�fields�asdict�astuple�make_dataclass�replace�is_dataclassc@seZdZdS)rN��__name__�
__module__�__qualname__�rr�#/usr/lib64/python3.8/dataclasses.pyr�sc@seZdZdd�ZdS)�_HAS_DEFAULT_FACTORY_CLASScCsdS)Nz	<factory>r��selfrrr�__repr__�sz#_HAS_DEFAULT_FACTORY_CLASS.__repr__N)rrrrrrrrr�src@seZdZdS)�
_MISSING_TYPENrrrrrr�src@seZdZdd�Zdd�ZdS)�_FIELD_BASEcCs
||_dS�N��name�rrrrr�__init__�sz_FIELD_BASE.__init__cCs|jSrrrrrrr�sz_FIELD_BASE.__repr__N)rrrrrrrrrr�sr�_FIELD�_FIELD_CLASSVAR�_FIELD_INITVARZ__dataclass_fields__Z__dataclass_params__Z
__post_init__z^(?:\s*(\w+)\s*\.)?\s*(\w+)c@seZdZdd�ZdS)�_InitVarMetacCst|�Sr)r)rZparamsrrr�__getitem__�sz_InitVarMeta.__getitem__N)rrrr#rrrrr"�sr"c@s eZdZdZdd�Zdd�ZdS)r��typecCs
||_dSrr$)rr%rrrr�szInitVar.__init__cCs,t|jt�r|jj}n
t|j�}d|�d�S)Nzdataclasses.InitVar[�])�
isinstancer%r�repr)rZ	type_namerrrr�s

zInitVar.__repr__N�rrr�	__slots__rrrrrrr�s)�	metaclassc@s(eZdZdZdd�Zdd�Zdd�ZdS)	r)
rr%�default�default_factoryr(�hash�init�compare�metadata�_field_typecCsRd|_d|_||_||_||_||_||_||_|dkr<tnt	�
|�|_d|_dSr)
rr%r,r-r/r(r.r0�_EMPTY_METADATA�types�MappingProxyTyper1r2)rr,r-r/r(r.r0r1rrrr�s��zField.__init__cCsVd|j�d|j�d|j�d|j�d|j�d|j�d|j�d|j�d	|j�d
|j	�d�S)NzField(name=z,type=z	,default=z,default_factory=z,init=�,repr=z,hash=z	,compare=z
,metadata=z
,_field_type=�))
rr%r,r-r/r(r.r0r1r2rrrrrszField.__repr__cCs(tt|j�dd�}|r$||j||�dS)N�__set_name__)�getattrr%r,)r�ownerr�funcrrrr8szField.__set_name__N)rrrr*rrr8rrrrr�sc@s eZdZdZdd�Zdd�ZdS)�_DataclassParams�r/r(�eq�order�unsafe_hash�frozencCs(||_||_||_||_||_||_dSrr=)rr/r(r>r?r@rArrrr*sz_DataclassParams.__init__c
Cs6d|j�d|j�d|j�d|j�d|j�d|j�d�
S)Nz_DataclassParams(init=r6z,eq=z,order=z
,unsafe_hash=z,frozen=r7r=rrrrr2sz_DataclassParams.__repr__Nr)rrrrr<!sr<T�r,r-r/r(r.r0r1cCs,|tk	r|tk	rtd��t|||||||�S)a�Return an object to identify dataclass fields.

    default is the default value of the field.  default_factory is a
    0-argument function called to initialize a field's value.  If init
    is True, the field will be a parameter to the class's __init__()
    function.  If repr is True, the field will be included in the
    object's repr().  If hash is True, the field will be included in
    the object's hash().  If compare is True, the field will be used
    in comparison functions.  metadata, if specified, must be a
    mapping which is stored but not otherwise examined by dataclass.

    It is an error to specify both default and default_factory.
    z/cannot specify both default and default_factory)r�
ValueErrorrrBrrrr@s
�cs(|sdSdd��fdd�|D���d�S)N�()�(�,csg|]}��d|j���qS)�.r��.0�f��obj_namerr�
<listcomp>_sz_tuple_str.<locals>.<listcomp>�,))�join)rLrrrKr�
_tuple_strVsrPcs"t��t�����fdd��}|S)Nc	sDt|�t��f}|�krdS��|�z�|�}W5��|�X|S)Nz...)�id�_thread�	get_ident�add�discard)r�key�result��repr_running�
user_functionrr�wrapperis
z _recursive_repr.<locals>.wrapper)�set�	functools�wraps)rZr[rrXr�_recursive_reprds
r_)�globals�locals�return_typec
Cs�|dkri}d|krt|d<d}|tk	r4||d<d}d�|�}d�dd�|D��}d	|�d
|�d|�d|��}d
�|���}d|�d|�d|��}i}	t|||	�|	df|�S)NZBUILTINS�Z_return_typez->_return_typerF�
css|]}d|��VqdS)z  Nr)rI�brrr�	<genexpr>�sz_create_fn.<locals>.<genexpr>z def rEr7z:
�, zdef __create_fn__(z):
z	
 return Z
__create_fn__)�builtinsrrO�keys�exec)
r�argsZbodyr`rarbZreturn_annotationZtxtZ
local_vars�nsrrr�
_create_fnws 
rmcCs0|rd|�d|�d|�d�S|�d|�d|��S)NzBUILTINS.object.__setattr__(rFr7rG�=r)rAr�value�	self_namerrr�
_field_assign�srqcCs�d|j��}|jtk	rV|jr@|j||<|�d|j�d|j��}q�|j||<|�d�}n8|jr�|jtkrn|j}q�|jtk	r�|j||<|j}ndS|jtkr�dSt||j||�S)NZ_dflt_z() if z is _HAS_DEFAULT_FACTORY else rD)rr-rr/r,r2r!rq)rJrAr`rpZdefault_namerorrr�_field_init�s"






rrcCsV|jtkr|jtkrd}n&|jtk	r2d|j��}n|jtk	r@d}|j�d|j�|��S)Nrcz=_dflt_z=_HAS_DEFAULT_FACTORYz:_type_)r,rr-r)rJr,rrr�_init_param�s

rscCs�d}|D]:}|jr|jtkr&|jtks,d}q|rtd|j�d���qdd�|D�}|�ttd��g}|D] }t||||�}	|	rj|�	|	�qj|r�d�
d	d
�|D��}
|�	|�dt�d|
�d
��|s�dg}td|gdd�|D�|||dd�S)NFTznon-default argument z follows default argumentcSsi|]}d|j��|j�qS)Z_type_)rr%rHrrr�
<dictcomp>�s
z_init_fn.<locals>.<dictcomp>)r�_HAS_DEFAULT_FACTORYrFcss|]}|jtkr|jVqdSr)r2r!rrHrrrrf	s
�z_init_fn.<locals>.<genexpr>rGrEr7�passrcSsg|]}|jrt|��qSr)r/rsrHrrrrMsz_init_fn.<locals>.<listcomp>)rar`rb)
r/r,rr-�	TypeErrorr�updaterurr�appendrO�_POST_INIT_NAMErm)rrA�
has_post_initrpr`Zseen_defaultrJraZ
body_lines�lineZ
params_strrrr�_init_fn�s:��r}cCs2tdddd�dd�|D��dg|d�}t|�S)	Nrrz(return self.__class__.__qualname__ + f"(rgcSs g|]}|j�d|j�d��qS)z={self.z!r}rrHrrrrMs�z_repr_fn.<locals>.<listcomp>z)"�r`)rmrOr_)rr`�fnrrr�_repr_fns
����r�cCsp|td�}|r,dd�dd�|D��d}nd}tdd	d
|�d�dd
f||d�tddd
|�d�ddf||d�fS)N)�clsrrErFcss|]}t|j�VqdSr)r(rrHrrrrf(sz'_frozen_get_del_attr.<locals>.<genexpr>rNrD�__setattr__)rrroz if type(self) is cls or name in �:z> raise FrozenInstanceError(f"cannot assign to field {name!r}")z)super(cls, self).__setattr__(name, value))rar`�__delattr__rz; raise FrozenInstanceError(f"cannot delete field {name!r}")z"super(cls, self).__delattr__(name))rrOrm)r�rr`raZ
fields_strrrr�_frozen_get_del_attr$s2�
��
���r�cCs$t|ddd|�|�|��dg|d�S)N)r�otherz%if other.__class__ is self.__class__:z return zreturn NotImplementedr~)rm)r�op�
self_tuple�other_tupler`rrr�_cmp_fn=s��r�cCs$td|�}tddd|�d�g|d�S)Nr�__hash__rzreturn hash(r7r~)rPrm)rr`r�rrr�_hash_fnKs
�r�cCs$||jkp"t|�|jko"|j|jkSr)�ClassVarr%Z
_GenericAliasZ
__origin__)�a_type�typingrrr�_is_classvarSs

�r�cCs||jkpt|�|jkSr)rr%)r��dataclassesrrr�_is_initvar[s
�r�c	Cs�t�|�}|r�d}|�d�}|s2tj�|j�j}n2tj�|j�}|rd|j�|�|krdtj�|j�j}|r�||�|�d��|�r�dSdS)N��TF)�_MODULE_IDENTIFIER_RE�match�group�sys�modules�getr�__dict__)	Z
annotationr�Za_moduler�Zis_type_predicater�rlZmodule_name�modulerrr�_is_typebs)

r�cCs8t||t�}t|t�r|}nt|tj�r,t}t|d�}||_||_t	|_
tj�
d�}|r�t||�s�t|jt�r�t|j|||jt�r�t|_
|j
t	kr�tjt}t||�s�t|jt�r�t|j|||jt�r�t|_
|j
ttfkr�|jtk	r�td|j�d���|j
t	k�r4t|jtttf��r4tdt|j��d|j�d���|S)N)r,r��field z cannot have a default factoryzmutable default z for field z$ is not allowed: use default_factory)r9rr'rr4�MemberDescriptorTyperrr%rr2r�r�r�r��strr�r�r rr�rr!r-rwr,�list�dictr\rC)r�Za_namer�r,rJr�r�rrr�
_get_field�sF



���



���
	 r�cCs||jkrdSt|||�dS)NTF)r��setattr)r�rrorrr�_set_new_attribute�s
r�cCsdSrr�r�rr`rrr�_hash_set_none�sr�cCsdd�|D�}t||�S)NcSs(g|] }|jdkr|jrn|jr|�qSr)r.r0rHrrrrMs

z_hash_add.<locals>.<listcomp>)r�)r�rr`�fldsrrr�	_hash_addsr�cCstd|j����dS)Nz-Cannot overwrite attribute __hash__ in class )rwrr�rrr�_hash_exceptionsr�))FFFF)FFFT)FFTF)FFTT)FTFF)FTFT)FTTF)FTTT)TFFF)TFFT)TFTF)TFTT)TTFF)TTFT)TTTF)TTTTcs�i}�jtjkr tj�jj}ni}t�tt||||||��d}	d}
�jddd�D]D}t|t	d�}|dk	rVd}
|�
�D]}
|
||
j<qzt|t�jrVd}	qV�j�
di�}�fdd�|��D�}|D]L}
|
||
j<tt�|
jd�t�r�|
jtk�rt�|
j�q�t�|
j|
j�qĈj��D].\}}t|t��r||k�rt|�d����q|
�rz|	�rf|�sftd	��|	�sz|�rztd
��t�t	|��j�
dt�}|tk�p�|dk�o�d�jk}|�r�|�s�td
��|�rt�t�}dd�|�
�D�}t�dt|||d|k�rdnd|��dd�|�
�D�}|�rHdd�|D�}t�dt||��|�r�dd�|D�}td|�}td|�}t�dtdd|||d��|�r�dd�|D�}td|�}td|�}dD]>\}}t�|t|||||d���r�td|�d�j�d����q�|�r8t�||�D].}t�|j|��rtd|j�d�j�����qtt |�t |�t |�|f}|�rh|�||��_!t�d��s��jt"t#�$����%dd ��_&�S)!NF���rT�__annotations__csg|]\}}t�||��qSr)r�)rIrr%�r�rrrM]s�z"_process_class.<locals>.<listcomp>z& is a field but has no type annotationz5cannot inherit non-frozen dataclass from a frozen onez5cannot inherit frozen dataclass from a non-frozen oner��__eq__z eq must be true if order is truecSsg|]}|jttfkr|�qSr)r2rr!rHrrrrM�s�rrZ__dataclass_self__cSsg|]}|jtkr|�qSr�r2rrHrrrrM�s
cSsg|]}|jr|�qSr)r(rHrrrrM�srcSsg|]}|jr|�qSr�r0rHrrrrM�sr�z==r~cSsg|]}|jr|�qSrr�rHrrrrM�s))�__lt__�<)�__le__z<=)�__gt__�>)�__ge__z>=zCannot overwrite attribute z
 in class z). Consider using functools.total_ordering�__doc__z -> Nonerc)'rr�r�r�r��_PARAMSr<�__mro__r9�_FIELDS�valuesrrAr��itemsr'rr,r�delattrrwrC�hasattrrzr�r}r�rPr�rr��_hash_action�boolr�r��inspectZ	signaturerr�)r�r/r(r>r?r@rArr`Zany_frozen_baseZhas_dataclass_basesreZbase_fieldsrJZcls_annotationsZ
cls_fieldsrroZ
class_hashZhas_explicit_hashr{r�Z
field_listr�r�r�rZhash_actionrr�r�_process_class's��
�

�
��

��


����r�Fr=cs*������fdd�}|dkr"|S||�S)a�Returns the same class as was passed in, with dunder methods
    added based on the fields defined in the class.

    Examines PEP 526 __annotations__ to determine fields.

    If init is true, an __init__() method is added to the class. If
    repr is true, a __repr__() method is added. If order is true, rich
    comparison dunder methods are added. If unsafe_hash is true, a
    __hash__() method function is added. If frozen is true, fields may
    not be assigned to after instance creation.
    cst|�������Sr)r�r��r>rAr/r?r(r@rr�wrap�szdataclass.<locals>.wrapNr)r�r/r(r>r?r@rAr�rr�rr�scCsBzt|t�}Wntk
r*td��YnXtdd�|��D��S)z�Return a tuple describing the fields of this dataclass.

    Accepts a dataclass or an instance of one. Tuple elements are of
    type Field.
    z0must be called with a dataclass type or instancecss|]}|jtkr|VqdSrr�rHrrrrf
s
zfields.<locals>.<genexpr>)r9r��AttributeErrorrw�tupler�)Zclass_or_instancerrrrr�s
cCstt|�t�S)z2Returns True if obj is an instance of a dataclass.)r�r%r�)�objrrr�_is_dataclass_instancesr�cCs t|t�r|nt|�}t|t�S)zEReturns True if obj is a dataclass or an instance of a
    dataclass.)r'r%r�r�)r�r�rrrr
s��dict_factorycCst|�std��t||�S)a�Return the fields of a dataclass instance as a new dictionary mapping
    field names to field values.

    Example usage:

      @dataclass
      class C:
          x: int
          y: int

      c = C(1, 2)
      assert asdict(c) == {'x': 1, 'y': 2}

    If given, 'dict_factory' will be used instead of built-in dict.
    The function applies recursively to field values that are
    dataclass instances. This will also look into built-in containers:
    tuples, lists, and dicts.
    z0asdict() should be called on dataclass instances)r�rw�
_asdict_inner)r�r�rrrr	scs�t|�rDg}t|�D]&}tt||j���}|�|j|f�q�|�St|t�rrt|d�rrt	|��fdd�|D��St|t
tf�r�t	|��fdd�|D��St|t�r�t	|��fdd�|��D��St
�|�SdS)N�_fieldscsg|]}t|���qSr�r��rI�vr�rrrMOsz!_asdict_inner.<locals>.<listcomp>c3s|]}t|��VqdSrr�r�r�rrrfTsz _asdict_inner.<locals>.<genexpr>c3s&|]\}}t|��t|��fVqdSrr��rI�kr�r�rrrfVs��)r�rr�r9rryr'r�r�r%r�r�r��copy�deepcopy)r�r�rWrJrorr�rr�4s
�r���
tuple_factorycCst|�std��t||�S)a�Return the fields of a dataclass instance as a new tuple of field values.

    Example usage::

      @dataclass
      class C:
          x: int
          y: int

    c = C(1, 2)
    assert astuple(c) == (1, 2)

    If given, 'tuple_factory' will be used instead of built-in tuple.
    The function applies recursively to field values that are
    dataclass instances. This will also look into built-in containers:
    tuples, lists, and dicts.
    z1astuple() should be called on dataclass instances)r�rw�_astuple_inner)r�r�rrrr
]scs�t|�r>g}t|�D] }tt||j���}|�|�q�|�St|t�rlt|d�rlt	|��fdd�|D��St|t
tf�r�t	|��fdd�|D��St|t�r�t	|��fdd�|��D��St
�|�SdS)Nr�csg|]}t|���qSr�r�r�r�rrrM�sz"_astuple_inner.<locals>.<listcomp>c3s|]}t|��VqdSrr�r�r�rrrf�sz!_astuple_inner.<locals>.<genexpr>c3s&|]\}}t|��t|��fVqdSrr�r�r�rrrf�s�)r�rr�r9rryr'r�r�r%r�r�r�r�r�)r�r�rWrJrorr�rr�us
�r�r)�bases�	namespacer/r(r>r?r@rAc	s�dkri�n����t�}
i}|D]�}t|t�r<|}
d}nDt|�dkrR|\}
}n.t|�dkrr|\}
}}|�|
<ntd|����t|
t�r�|
��s�td|
����t�|
�r�td|
����|
|
kr�td|
����|
�	|
�|||
<q$|�d	<t
�||i�fd
d��}t|||||||	d�S)
a�Return a new dynamically created dataclass.

    The dataclass name will be 'cls_name'.  'fields' is an iterable
    of either (name), (name, type) or (name, type, Field) objects. If type is
    omitted, use the string 'typing.Any'.  Field objects are created by
    the equivalent of calling 'field(name, type [, Field-info])'.

      C = make_dataclass('C', ['x', ('y', int), ('z', int, field(init=False))], bases=(Base,))

    is equivalent to:

      @dataclass
      class C(Base):
          x: 'typing.Any'
          y: int
          z: int = field(init=False)

    For the bases and namespace parameters, see the builtin type() function.

    The parameters init, repr, eq, order, unsafe_hash, and frozen are passed to
    dataclass().
    Nz
typing.Anyr��zInvalid field: z'Field names must be valid identifiers: z"Field names must not be keywords: zField name duplicated: r�cs
|���Sr)rx)rl�r�rr�<lambda>��z make_dataclass.<locals>.<lambda>r=)
r�r\r'r��lenrw�isidentifier�keyword�	iskeywordrTr4�	new_classr)Zcls_namerr�r�r/r(r>r?r@rA�seenZanns�itemr�tp�specr�rr�rr�s:






�cOst|�dkr tdt|��d���|r,|\}n4d|krX|�d�}ddl}|jdtdd	�ntd
��t|�sptd��t|t��	�D]v}|j
tkr�q~|js�|j
|kr~td|j
�d
���q~|j
|kr~|j
tkr�|jtkr�td|j
�d���t||j
�||j
<q~|jf|�S)a,Return a new object replacing specified fields with new values.

    This is especially useful for frozen classes.  Example usage:

      @dataclass(frozen=True)
      class C:
          x: int
          y: int

      c = C(1, 2)
      c1 = replace(c, x=3)
      assert c1.x == 3 and c1.y == 2
      r�z*replace() takes 1 positional argument but z were givenr�rNz/Passing 'obj' as keyword argument is deprecatedr�)�
stacklevelz7replace() missing 1 required positional argument: 'obj'z1replace() should be called on dataclass instancesr�zC is declared with init=False, it cannot be specified with replace()zInitVar z! must be specified with replace())r�rw�pop�warnings�warn�DeprecationWarningr�r9r�r�r2r r/rrCr!r,r�	__class__)rkZchangesr�r�rJrrrr�s4
�


z(obj, /, **kwargs))N)C�rer�r�r4r�r�rhr]rR�__all__r�rrrurrr5r3rrr r!r�r�rz�compiler�r%r"rrr<rrPr_rmrqrrrsr}r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr�r
r�r	r�r�r
r�rr�__text_signature__rrrr�<module>s��

:��62;R�>
�)�B<__pycache__/_compat_pickle.cpython-38.pyc000064400000012577151153537610014400 0ustar00U

e5d-"�+@sdddddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*�*Zd+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdL�!ZdMZzeWnek
r�Yn
XedN7ZeD]ZdefedOef<q�dPZeD]ZdQefedRef<q�edSdT�e��D��Z	e
e	�e
e�k�s0t�edUdT�e��D��Ze
e�e
e�k�s\t�e�
dVdWdddd"d"dXdXdXd(dYdYdZ�
�e	�
d[d(d\d]dVd^��e�
d/d_d6d`da��e�
dbdcdddedfdgdhdidjdkdldmdndo�
�dpZeD]Zdqedef<�q�drZeD]Zdsedef<�q�dtS)u�builtins�copyregZqueueZsocketserverZconfigparser�reprlib�tkinter.filedialog�tkinter.simpledialogztkinter.colorchooserztkinter.commondialogztkinter.dialogztkinter.dndztkinter.fontztkinter.messageboxztkinter.scrolledtextztkinter.constantsztkinter.tixztkinter.ttkZtkinterZ_markupbase�winreg�_threadZ
_dummy_threadzdbm.bsdzdbm.dumbzdbm.ndbmzdbm.gnuz
xmlrpc.client�
xmlrpc.serverzhttp.clientz
html.entitieszhtml.parserzhttp.cookieszhttp.cookiejar�http.serverztest.support�
subprocess�urllib.parsezurllib.robotparser�urllib.request�dbmzcollections.abc)*�__builtin__Zcopy_regZQueueZSocketServerZConfigParser�reprZtkFileDialogZtkSimpleDialogZtkColorChooserZtkCommonDialogZDialogZTkdndZtkFontZtkMessageBoxZScrolledTextZTkconstantsZTixZttkZTkinterZ
markupbase�_winreg�threadZdummy_threadZdbhashZdumbdbmr
�gdbmZ	xmlrpclibZSimpleXMLRPCServerZhttplibZhtmlentitydefsZ
HTMLParserZCookieZ	cookielibZBaseHTTPServerztest.test_supportZcommandsZurlparseZrobotparser�urllib2ZanydbmZ_abcoll)r�range)�	functools�reduce)�sys�intern)r�chr)r�str)r�int)r�zip)r�map)r�filter)�	itertools�filterfalse)r�zip_longest)�collections�UserDict)r"�UserList)r"�
UserString)r
�whichdb)�socket�fromfd)zmultiprocessing.connection�
Connection)�multiprocessing.context�Process)zmultiprocessing.popen_fork�Popen)�urllib.error�ContentTooShortError)r�
getproxies)r�pathname2url)r�
quote_plus)r�quote)r�unquote_plus)r�unquote)r�url2pathname)r�
urlcleanup)r�	urlencode)r�urlopen)r�urlretrieve)r-�	HTTPError)r-�URLError)!)rZxrange�rr)rr)rZunichr)rZunicode)rZlong)rZizip)rZimap)rZifilter)rZifilterfalse)rZizip_longest)r#ZIterableUserDict)r$r$)r%r%)r&r&)�_socketr()Z_multiprocessingr))zmultiprocessing.processr+)zmultiprocessing.forkingr,)�urllibr.)r>r/)r>r0)r>r1)r>r2)r>r3)r>r4)r>r5)r>r6)r>r7)r>r8)r>r9)rr:)rr;)/�ArithmeticError�AssertionError�AttributeError�
BaseException�BufferError�BytesWarning�DeprecationWarning�EOFError�EnvironmentError�	Exception�FloatingPointError�
FutureWarning�
GeneratorExit�IOError�ImportError�
ImportWarning�IndentationError�
IndexError�KeyError�KeyboardInterrupt�LookupError�MemoryError�	NameError�NotImplementedError�OSError�
OverflowError�PendingDeprecationWarning�ReferenceError�RuntimeError�RuntimeWarning�
StopIteration�SyntaxError�
SyntaxWarning�SystemError�
SystemExit�TabError�	TypeError�UnboundLocalError�UnicodeDecodeError�UnicodeEncodeError�UnicodeError�UnicodeTranslateError�UnicodeWarning�UserWarning�
ValueError�Warning�ZeroDivisionError)�WindowsError�
exceptions)ZAuthenticationErrorZBufferTooShortZProcessError�TimeoutErrorr*Zmultiprocessingccs|]\}}||fVqdS�N���.0�k�vrrrr�&/usr/lib64/python3.8/_compat_pickle.py�	<genexpr>�srxccs|]\}}||fVqdSrqrrrsrrrrrwrx�s�picklezxml.etree.ElementTreer"�io)
ZcPickleZ_elementtree�
FileDialog�SimpleDialog�DocXMLRPCServer�SimpleHTTPServer�
CGIHTTPServerr#r$r%r&�StringIOZ	cStringIO�bz2rr)Z_bz2Z_dbm�
_functoolsZ_gdbm�_pickle)rrH)r'Z
SocketType))rZ
basestring)roZ
StandardError)r#r#�r'Z
_socketobjectr<)r{r{)r{�LoadFileDialog)r{�SaveFileDialog)r|r|)r}�
ServerHTMLDoc)r}�XMLRPCDocGenerator)r}�DocXMLRPCRequestHandler)r}r})r}�DocCGIXMLRPCRequestHandler)r~�SimpleHTTPRequestHandler)r�CGIHTTPRequestHandlerr�)
)r�r)rr{)rr�)rr�)rr|)rr�)rr�)rr�)rr})rr�)r	r�)r	r�)r=r')�BrokenPipeError�ChildProcessError�ConnectionAbortedError�ConnectionError�ConnectionRefusedError�ConnectionResetError�FileExistsError�FileNotFoundError�InterruptedError�IsADirectoryError�NotADirectoryError�PermissionError�ProcessLookupErrorrp)rorW)�ModuleNotFoundError)rorMN)ZIMPORT_MAPPINGZNAME_MAPPINGZPYTHON2_EXCEPTIONSrnrUZexcnameZMULTIPROCESSING_EXCEPTIONS�dict�itemsZREVERSE_IMPORT_MAPPING�lenr@ZREVERSE_NAME_MAPPING�updateZPYTHON3_OSERROR_EXCEPTIONSZPYTHON3_IMPORTERROR_EXCEPTIONSrrrrrrrw�<module>	s�2�$3����__pycache__/sre_constants.cpython-38.opt-2.pyc000064400000013460151153537610015244 0ustar00U

e5d��@s@dZddlmZmZGdd�de�ZGdd�de�Zeed�Zdd	�Zed
�Z	e	dd�=ed
�Z
ed�Zee
eeiZeeeeiZeeeeiZeeeeiZeeeeiZ ee!ee"iZ#e$e$e%e%e&e&e'e'e(e)e*e+e,e,e-e-iZ.e$e/e%e0e&e1e'e2e(e3e*e4e,e5e-e6iZ7dZ8dZ9dZ:dZ;dZ<dZ=dZ>dZ?dZ@dZAdZBdZCeDdk�r<dd�ZEeFdd���ZGeG�Hd�eG�Hde�eEeGe	d�eEeGe
d �eEeGed �eG�Hd!e8�eG�Hd"e9�eG�Hd#e:�eG�Hd$e;�eG�Hd%e<�eG�Hd&e=�eG�Hd'e>�eG�Hd(e?�eG�Hd)e@�eG�Hd*eA�eG�Hd+eB�eG�Hd,eC�W5QRXeId-�dS).i��3�)�	MAXREPEAT�	MAXGROUPScs"eZdZdZd�fdd�	Z�ZS)�error�reNcs�||_||_||_|dk	r�|dk	r�d||f}t|t�r>d}nd}|�|d|�d|_||�|d|�|_||kr�d||j|jf}nd|_|_t	��
|�dS)Nz%s at position %d�
�
r�z%s (line %d, column %d))�msg�pattern�pos�
isinstance�str�count�lineno�rfind�colno�super�__init__)�selfr	r
r�newline��	__class__��%/usr/lib64/python3.8/sre_constants.pyr%s
zerror.__init__)NN)�__name__�
__module__�__qualname__r�
__classcell__rrrrrsrcs$eZdZ�fdd�Zdd�Z�ZS)�_NamedIntConstantcstt|��||�}||_|S�N)rr�__new__�name)�cls�valuer!rrrrr 9sz_NamedIntConstant.__new__cCs|jSr�r!)rrrr�__repr__>sz_NamedIntConstant.__repr__)rrrr r%rrrrrr8srrcCs8|����}dd�t|�D�}t��dd�|D��|S)NcSsg|]\}}t||��qSr)r)�.0�ir!rrr�
<listcomp>Esz_makecodes.<locals>.<listcomp>cSsi|]}|j|�qSrr$)r&�itemrrr�
<dictcomp>Fsz_makecodes.<locals>.<dictcomp>)�strip�split�	enumerate�globals�update)�names�itemsrrr�
_makecodesCsr2az
    FAILURE SUCCESS

    ANY ANY_ALL
    ASSERT ASSERT_NOT
    AT
    BRANCH
    CALL
    CATEGORY
    CHARSET BIGCHARSET
    GROUPREF GROUPREF_EXISTS
    IN
    INFO
    JUMP
    LITERAL
    MARK
    MAX_UNTIL
    MIN_UNTIL
    NOT_LITERAL
    NEGATE
    RANGE
    REPEAT
    REPEAT_ONE
    SUBPATTERN
    MIN_REPEAT_ONE

    GROUPREF_IGNORE
    IN_IGNORE
    LITERAL_IGNORE
    NOT_LITERAL_IGNORE

    GROUPREF_LOC_IGNORE
    IN_LOC_IGNORE
    LITERAL_LOC_IGNORE
    NOT_LITERAL_LOC_IGNORE

    GROUPREF_UNI_IGNORE
    IN_UNI_IGNORE
    LITERAL_UNI_IGNORE
    NOT_LITERAL_UNI_IGNORE
    RANGE_UNI_IGNORE

    MIN_REPEAT MAX_REPEAT
���Nz�
    AT_BEGINNING AT_BEGINNING_LINE AT_BEGINNING_STRING
    AT_BOUNDARY AT_NON_BOUNDARY
    AT_END AT_END_LINE AT_END_STRING

    AT_LOC_BOUNDARY AT_LOC_NON_BOUNDARY

    AT_UNI_BOUNDARY AT_UNI_NON_BOUNDARY
a�
    CATEGORY_DIGIT CATEGORY_NOT_DIGIT
    CATEGORY_SPACE CATEGORY_NOT_SPACE
    CATEGORY_WORD CATEGORY_NOT_WORD
    CATEGORY_LINEBREAK CATEGORY_NOT_LINEBREAK

    CATEGORY_LOC_WORD CATEGORY_LOC_NOT_WORD

    CATEGORY_UNI_DIGIT CATEGORY_UNI_NOT_DIGIT
    CATEGORY_UNI_SPACE CATEGORY_UNI_NOT_SPACE
    CATEGORY_UNI_WORD CATEGORY_UNI_NOT_WORD
    CATEGORY_UNI_LINEBREAK CATEGORY_UNI_NOT_LINEBREAK
r����� �@���__main__cCs*t|�}|D]}|�d|||f�qdS)Nz#define %s_%s %d
)�sorted�write)�f�d�prefixr1r)rrr�dump�srBzsre_constants.h�wao/*
 * Secret Labs' Regular Expression Engine
 *
 * regular expression matching engine
 *
 * NOTE: This file is generated by sre_constants.py.  If you need
 * to change anything in here, edit sre_constants.py and run it.
 *
 * Copyright (c) 1997-2001 by Secret Labs AB.  All rights reserved.
 *
 * See the _sre.c file for information on usage and redistribution.
 */

z#define SRE_MAGIC %d
ZSRE_OPZSREz#define SRE_FLAG_TEMPLATE %d
z#define SRE_FLAG_IGNORECASE %d
z#define SRE_FLAG_LOCALE %d
z#define SRE_FLAG_MULTILINE %d
z#define SRE_FLAG_DOTALL %d
z#define SRE_FLAG_UNICODE %d
z#define SRE_FLAG_VERBOSE %d
z#define SRE_FLAG_DEBUG %d
z#define SRE_FLAG_ASCII %d
z#define SRE_INFO_PREFIX %d
z#define SRE_INFO_LITERAL %d
z#define SRE_INFO_CHARSET %d
Zdone)J�MAGIC�_srerr�	Exceptionr�intrr2�OPCODES�ATCODES�CHCODES�LITERAL�LITERAL_IGNORE�NOT_LITERAL�NOT_LITERAL_IGNORE�	OP_IGNORE�LITERAL_LOC_IGNORE�NOT_LITERAL_LOC_IGNORE�OP_LOCALE_IGNORE�LITERAL_UNI_IGNORE�NOT_LITERAL_UNI_IGNORE�OP_UNICODE_IGNORE�AT_BEGINNINGZAT_BEGINNING_LINE�AT_ENDZAT_END_LINE�AT_MULTILINEZAT_BOUNDARYZAT_LOC_BOUNDARYZAT_NON_BOUNDARYZAT_LOC_NON_BOUNDARY�	AT_LOCALEZAT_UNI_BOUNDARYZAT_UNI_NON_BOUNDARY�
AT_UNICODEZCATEGORY_DIGITZCATEGORY_NOT_DIGITZCATEGORY_SPACEZCATEGORY_NOT_SPACEZ
CATEGORY_WORDZCATEGORY_LOC_WORDZCATEGORY_NOT_WORDZCATEGORY_LOC_NOT_WORDZCATEGORY_LINEBREAKZCATEGORY_NOT_LINEBREAK�	CH_LOCALEZCATEGORY_UNI_DIGITZCATEGORY_UNI_NOT_DIGITZCATEGORY_UNI_SPACEZCATEGORY_UNI_NOT_SPACEZCATEGORY_UNI_WORDZCATEGORY_UNI_NOT_WORDZCATEGORY_UNI_LINEBREAKZCATEGORY_UNI_NOT_LINEBREAK�
CH_UNICODE�SRE_FLAG_TEMPLATE�SRE_FLAG_IGNORECASE�SRE_FLAG_LOCALE�SRE_FLAG_MULTILINE�SRE_FLAG_DOTALL�SRE_FLAG_UNICODE�SRE_FLAG_VERBOSE�SRE_FLAG_DEBUG�SRE_FLAG_ASCII�SRE_INFO_PREFIX�SRE_INFO_LITERAL�SRE_INFO_CHARSETrrB�openr?r>�printrrrr�<module>s�!	
,
��������

__pycache__/sre_parse.cpython-38.opt-2.pyc000064400000052062151153537610014343 0ustar00U

e5d&��@s�ddlTdZdZed�Zed�Zed�Zed�Zed�Zee	e
h�Zeee
eeeeh�Zeed	�feed
�feed�feed�feed
�feed�feed�feed�fd�Zeefeefeefeeefgfeeefgfeeefgfeeefgfeeefgfeeefgfeefd�
Z e!e"e#e$e%e&e'e(d�Z)e&e"Be(BZ*e+e'BZ,Gdd�de-�Z.Gdd�d�Z/Gdd�d�Z0Gdd�d�Z1dd�Z2dd�Z3d d!�Z4d"d#�Z5d2d%d&�Z6d'd(�Z7d)d*�Z8d3d,d-�Z9d.d/�Z:d0d1�Z;d+S)4�)�*z.\[{()*+?^$|z*+?{�
0123456789Z01234567Z0123456789abcdefABCDEFZ4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZz 	

����
�
�	��\)z\a�\bz\fz\nz\rz\tz\vz\\)
z\Arz\Bz\dz\Dz\sz\Sz\wz\Wz\Z)�i�L�m�s�x�a�t�uc@seZdZdS)�VerboseN)�__name__�
__module__�__qualname__�rr�!/usr/lib64/python3.8/sre_parse.pyrGsrc@sBeZdZdd�Zedd��Zddd�Zdd	�Zd
d�Zdd
�Z	dS)�StatecCsd|_i|_dg|_d|_dS)Nr)�flags�	groupdict�groupwidths�lookbehindgroups��selfrrr�__init__LszState.__init__cCs
t|j�S�N)�lenrr rrr�groupsQszState.groupsNcCsb|j}|j�d�|jtkr$td��|dk	r^|j�|d�}|dk	rTtd|||f��||j|<|S)Nztoo many groupsz7redefinition of group name %r as group %d; was group %d)r%r�append�	MAXGROUPS�errorr�get)r!�name�gid�ogidrrr�	opengroupTs
�
zState.opengroupcCs|��|j|<dSr#)�getwidthr)r!r+�prrr�
closegroup`szState.closegroupcCs||jko|j|dk	Sr#)r%r)r!r+rrr�
checkgroupbszState.checkgroupcCs6|jdk	r2|�|�s|�d��||jkr2|�d��dS)N�cannot refer to an open groupz?cannot refer to group defined in the same lookbehind subpattern)rr1r()r!r+�sourcerrr�checklookbehindgroupes




zState.checklookbehindgroup)N)
rrrr"�propertyr%r-r0r1r4rrrrrJs

rc@s`eZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�ZdS)�
SubPatternNcCs"||_|dkrg}||_d|_dSr#)�state�data�width)r!r7r8rrrr"os
zSubPattern.__init__rcCs�d}ttf}|jD�]t\}}t|dt|�dd�|tkrlt�|D]"\}}t|ddt|�|�qFq|tkr�t�t|d�D]*\}}|r�t|dd�|�|d�q�q|t	k�r|\}}	}
td|�|	�|d�|
�r�t|dd�|
�|d�qt
||��r~d}|D]T}t
|t��rJ|�s6t�|�|d�d}n"|�s\td	dd�t|dd�d}�q|�s�t�qtd|�qdS)
NTz  �)�end��OR�ELSEF� )�tuple�listr8�print�str�IN�BRANCH�	enumerate�dump�GROUPREF_EXISTS�
isinstancer6)r!�level�nl�seqtypes�op�avrr
�	condgroup�item_yes�item_norrrrGvsH


zSubPattern.dumpcCs
t|j�Sr#)�reprr8r rrr�__repr__�szSubPattern.__repr__cCs
t|j�Sr#)r$r8r rrr�__len__�szSubPattern.__len__cCs|j|=dSr#�r8�r!�indexrrr�__delitem__�szSubPattern.__delitem__cCs&t|t�rt|j|j|�S|j|Sr#)rI�slicer6r7r8rVrrr�__getitem__�s
zSubPattern.__getitem__cCs||j|<dSr#rU�r!rW�coderrr�__setitem__�szSubPattern.__setitem__cCs|j�||�dSr#)r8�insertr[rrrr^�szSubPattern.insertcCs|j�|�dSr#)r8r&)r!r\rrrr&�szSubPattern.appendc	Cs�|jdk	r|jSd}}|jD�]�\}}|tkr|td}d}|dD]$}|��\}}t||�}t||�}qD||}||}q|tkr�|��\}}||}||}q|tkr�|d��\}}||}||}q|t	k�r|d��\}}|||d}|||d}q|t
k�r$|d}|d}q|tk�rP|jj
|\}}||}||}q|tk�r�|d��\}}|ddk	�r�|d��\}}t||�}t||�}nd}||}||}q|tkr�q�qt|td�t|t�f|_|jS)Nrr<����)r9r8rE�	MAXREPEATr.�min�max�CALL�
SUBPATTERN�_REPEATCODES�
_UNITCODES�GROUPREFr7rrH�SUCCESS)	r!�lo�hirMrNr
�j�l�hrrrr.�sZ












zSubPattern.getwidth)N)r)
rrrr"rGrSrTrXrZr]r^r&r.rrrrr6ms

(r6c@sbeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Ze	d
d��Z
dd�Zdd�Zddd�Z
dS)�	TokenizercCs@t|t�|_||_|js"t|d�}||_d|_d|_|��dS)N�latin1r)rIrC�istext�string�decoded_stringrW�next�_Tokenizer__next)r!rrrrrr"�s
zTokenizer.__init__cCs�|j}z|j|}Wntk
r0d|_YdSX|dkr�|d7}z||j|7}Wn.tk
r�td|jt|j�d�d�YnX|d|_||_dS)Nrr<zbad escape (end of pattern))rWrs�
IndexErrorrtr(rrr$)r!rW�charrrr�__next�s&��
zTokenizer.__nextcCs||jkr|��dSdS)NTF�rtru)r!rwrrr�match�s
zTokenizer.matchcCs|j}|��|Sr#ry)r!�thisrrrr)�sz
Tokenizer.getcCs8d}t|�D]&}|j}||kr"q4||7}|��q|S�Nr:)�rangertru)r!�n�charset�result�_�crrr�getwhiles
zTokenizer.getwhilecCsld}|j}|��|dkr@|s,|�d|��|�d|t|���||kr^|sh|�d|d��qh||7}q|S)Nr:zmissing zmissing %s, unterminated namer<)rtrur(r$)r!�
terminatorr*r�r�rrr�getuntils
�
zTokenizer.getuntilcCs|jt|jpd�Sr|�rWr$rtr rrr�possz
Tokenizer.poscCs|jt|jpd�Sr|r�r rrr�tellszTokenizer.tellcCs||_|��dSr#)rWrurVrrr�seek szTokenizer.seekrcCst||j|��|�Sr#)r(rrr�)r!�msg�offsetrrrr($szTokenizer.errorN)r)rrrr"rurzr)r�r�r5r�r�r�r(rrrrro�s		
roc	Cs�t�|�}|r|St�|�}|r0|dtkr0|S�zJ|dd�}|dkr�||�dt�7}t|�dkrx|�d|t|���tt	|dd�d�fWS|dkr�|j
r�||�dt�7}t|�d	kr�|�d|t|���tt	|dd�d�fWS|d
k�rN|j
�rN||�dt�7}t|�dk�r*|�d|t|���t	|dd�d�}t|�t|fWS|d
k�r�|j
�r�ddl}|�
d��s~|�d��|�dd�}zt|�|��}Wn2tk
�r�|�d|t|�td���YnXt|fWS|tk�r.||�dt�7}t	|dd�d�}|dk�r$|�d|t|���t|fWS|tk�r<t�t|�dk�rz|tk�rh|�d|t|���tt|d�fWSWntk
�r�YnX|�d|t|���dS)Nrr<r`r��incomplete escape %s�r��U��
�N�{�	missing {�}�character name�undefined character name %r�\N{}��.octal escape value %s outside of range 0-0o377�
bad escape %s)�ESCAPESr)�
CATEGORIESrDr��	HEXDIGITSr$r(�LITERAL�intrq�chr�unicodedatarzr��ord�lookup�KeyError�	OCTDIGITS�DIGITS�
ValueError�ASCIILETTERS)r3�escaper\r�r��charnamerrr�
_class_escape'sp




�



��


r�c	Csft�|�}|r|St�|�}|r$|S�z|dd�}|dkr�||�dt�7}t|�dkrl|�d|t|���tt|dd�d�fWS|dkr�|j	r�||�dt�7}t|�dkr�|�d|t|���tt|dd�d�fWS|d	k�rB|j	�rB||�d
t�7}t|�dk�r|�d|t|���t|dd�d�}t
|�t|fWS|dk�r�|j	�r�d
dl}|�d��sr|�d��|�
dd�}zt|�|��}Wn2tk
�r�|�d|t|�td���YnXt|fWS|dk�r||�dt�7}tt|dd�d
�fWS|tk�r�|jtk�r�||��7}|dtk�r�|dtk�r�|jtk�r�||��7}t|dd�d
�}|dk�r�|�d|t|���t|fWSt|dd��}||jk�r�|�|��s�|�dt|���|�||�t|fWS|�d|t|�d��t|�dk�r4|tk�r"|�d|t|���tt|d�fWSWntk
�rLYnX|�d|t|���dS)Nr<r`rr�r�r�rr�r�r�r�r�rr�r�r�r�r�r��0r�r�r2�invalid group reference %dr�)r�r)r�r�r�r$r(r�r�rqr�r�rzr�r�r�r�r�r�rtr%r1r4rhr�r�)r3r�r7r\r�r�r��grouprrr�_escapecs�




�



�
��
�

r�cCstt�|��Sr#)rA�dict�fromkeys)�itemsrrr�_uniq�sr�cCsVg}|j}|j}|��}|t||||d|o2|��|d�sqDqt|�dkrX|dSt|�}d}	|D].}
|
stq�|	dkr�|
d}	qh|
d|	krhq�qh|D]
}
|
d=q�|�|	�q`q�q`g}|D]h}
t|
�dkr��q@|
d\}}
|tkr�|�||
f�q�|tk�r"|
ddtk	�r"|�	|
�q��q@q�|�tt
|�f�|S|�td|ff�|S)Nr<�|r)r&rzr��_parser$r6r�rD�NEGATE�extendr�rE)r3r7�verbose�nestedr��itemsappend�sourcematch�start�
subpattern�prefix�item�setrMrNrrr�
_parse_sub�sN
�

r�Fc/
Cs�t|�}|j}|j}|j}t}	t}
|j}|dkr4�q*|dkr@�q*|�|rx|tkrTq"|dkrx|�}|dksv|dkr\q"q\q"|ddkr�t|||�}||�q"|t	kr�|t
|
|�f�q"|dk�r�|��d}
g}|j}|jdk�rddl}|j
d|��t|d	d
�|d�}|�}|dk�r0|�d|��|
��|d
k�rF|�rF�qbn�|ddk�r`t||�}n~|�r�|dk�r�|j|k�r�ddl}|j
d|dk�r�dn|dk�r�dn|dk�r�dnd|��dft|d	d
�t
|
|�f}|d��r<|�}|dk�r|�d|��|
��|d
k�rL|dtk�r0|dd}||�|t
|
d�f��qb|ddk�rft||�}n>|dk�r�ddl}|j
d|��dt|d	d
�t
|
|�f}|dt
k�s�|dt
k�r�d||f}|�|t|�dt|���|d}|d}||k�r*d||f}|�|t|�dt|���|t||ff�n"|dtk�rV|dd}||��qt|�}|	|�dk�r�|ddt
k�r�|�r�|t|ddf�n||d�n"|�r�|�dtdf�|t|f�q"|tk�r.|��}
|dk�rd\}}�nB|dk�rdt}}�n*|dk�r0dt}}�n|dk�r4|jdk�rX|t
|
|�f�q"dt}}d }}|jtk�r�||�7}�qj|d!��r�|jtk�r�||�7}�q�n|}|d��s�|t
|
|�f�|�|
�q"|�r�t|�}|tk�r�td"��|�rBt|�}|tk�rtd"��||k�rB|�d#|��|
��ntd$|f��|�rV|d%d�}nd}|�rr|ddtk�r�|�d&|��|
t|���|ddtk�r�|�d'|��|
t|���|ddt k�r�|dd\}}}}|dk�r�|�s�|�s�|}|d��rt!|||ff|d%<nt"|||ff|d%<q"|d(k�rF|t#df�q"|d)k�r�|��d} d*}d}!d}d}|d��r|�}|dk�r�|�d+��|d,k�r�|d-��r�|�$d.d/�}!|!�%��s�d0|!}|�|t|!�d��n�|d1��r�|�$d2d/�}!|!�%��sd0|!}|�|t|!�d��|j&�|!�}"|"dk�rFd3|!}|�|t|!�d��|�'|"��sf|�d4t|!�d��|�(|"|�|t)|"f�q"n2|�}|dk�r�|�d+��|�d5|t|�d���nd|d6k�r�d}�nR|dk�r|jdk�r�|�d7|��| ��|�d2k�r�q"�q�q"�n|d8k�r�d}#|d-k�r||�}|dk�r>|�d+��|d9k�r`|�d:|t|�d��d%}#|j*}$|$dk�r||j+|_*t,||||d�}|#dk�r�|$dk�r�d|_*|d2��s�|�d;|��| ��|d1k�r�|t-|#|ff�q"|t.|#|ff�q"�n$|d)k�
rj|�$d2d/�}%|%�%��	rL|j&�|%�}&|&dk�	r�d3|%}|�|t|%�d��n�zt|%�}&|&dk�	rdt/�Wn4t/k
�	r�d0|%}|�|t|%�d�d�YnX|&�	s�|�d<t|%�d��|&t0k�	r�d=|&}|�|t|%�d��|�(|&|�t1||||d�}'|�d>��
r0t1||||d�}(|jd>k�
r4|�d?��nd}(|�d2��
sT|�d;|��| ��|t2|&|'|(ff�q"n�|t3k�
s~|dk�rt4|||�})|)dk�
r�|�
r�|�
r�ddl}|j
d@|j5ddA�t|j5�dAk�
r�dBnd ft6|d	d
�|j7t8@r"|s"t9�q"|)\}}d}n|�dC|t|�d��|dk	�rrz|�:|!�}Wn<tk
�rp}*z|�|*j;t|!�d�d�W5d}*~*XYnX|�s�|t8@�o�|t8@}+t,|||+|d�}|�d2��s�|�d;|��| ��|dk	�r�|�<||�|t ||||ff�q"|dk�r|tt=f�q"|dDk�r|tt>f�q"tdE|f��q"t?t|��ddd%�D]N},||,\}-}.|-t k�r@|.\}}}}|dk�r@|�s@|�s@|||,|,d�<�q@|S)FNz|)�#rrr�[r<z"Possible nested set at position %dr�)�
stacklevel�^zunterminated character set�]z-&~|zPossible set %s at position %d�-�
difference�&�intersection�~zsymmetric difference�unionz&Possible set difference at position %dr`zbad character range %s-%s�?)rr<r�+r�r�r:�,z"the repetition number is too largez"min repeat greater than max repeatzunsupported quantifier %rr_znothing to repeatzmultiple repeat�.�(Tzunexpected end of pattern�P�<�>�
group name�bad character in group name %r�=�)�unknown group name %rr2zunknown extension ?P�:zmissing ), unterminated commentz=!<z=!zunknown extension ?<z"missing ), unterminated subpatternzbad group numberr�r�z/conditional backref with more than two branchesz-Flags not at the start of the expression %r%s�z (truncated)zunknown extension ?�$z unsupported special character %r)@r6r&r)rzr$r�rt�
WHITESPACEr��
SPECIAL_CHARSr�r��warnings�warn�
FutureWarningr(r�rD�RANGEr��NOT_LITERALr^r��REPEAT_CHARSrar�r�r��
OverflowError�AssertionError�ATrfre�
MIN_REPEAT�
MAX_REPEAT�ANYr��isidentifierrr1r4rhrr%r��ASSERT�
ASSERT_NOTr�r'r�rH�FLAGS�_parse_flagsrr�DeprecationWarningr�SRE_FLAG_VERBOSErr-r�r0�AT_BEGINNING�AT_ENDr})/r3r7r�r��firstr��subpatternappend�	sourcegetr��_len�_ordr{r\�herer��	setappendr��negate�code1�that�code2r�rjrkrbrcrwr�r��	add_flags�	del_flagsr/r�r*r+�dirr�condnamerOrPrQr�err�sub_verboser
rMrNrrrr��s|


�

�
��	


�


��
 












���












�



�


�






�




�





�

�
��

�
*�
�



r�cCs�|j}d}d}|dkr�t|}|jr<|dkrRd}|�|��n|dkrRd}|�|��||O}|t@r||t@|kr|d}|�|��|�}|dkr�|�d��|d	kr�q�|tkr|��r�d
nd}|�|t|���q|dkr�|j|O_dS|t@r�|�dd
��|dk�r�|�}|dk�r|�d��|tk�rF|���r2d
nd}|�|t|���t|}|t@�rfd}|�|��||O}|�}|dk�r�|�d��|dk�r��q�|tk�rF|���r�d
nd}|�|t|����qF|t@�r�|�dd
��||@�r�|�dd
��||fS)Nrr�rz8bad inline flags: cannot use 'L' flag with a str patternrz:bad inline flags: cannot use 'u' flag with a bytes patternz9bad inline flags: flags 'a', 'u' and 'L' are incompatiblezmissing -, : or )z)-:zunknown flagr�z,bad inline flags: cannot turn on global flagr<zmissing flagz8bad inline flags: cannot turn off flags 'a', 'u' and 'L'z	missing :r�z-bad inline flags: cannot turn off global flagz(bad inline flags: flag turned on and off)	r)r�rqr(�
TYPE_FLAGS�isalphar$r�GLOBAL_FLAGS)r3r7rwr�rr�flagr�rrrr�]sl














r�cCsjt|t�r>|t@rtd��|t@s,|tO}qf|t@rftd��n(|t@rNtd��|t@rf|t@rftd��|S)Nz)cannot use LOCALE flag with a str patternz(ASCII and UNICODE flags are incompatiblez,cannot use UNICODE flag with a bytes patternz'ASCII and LOCALE flags are incompatible)rIrC�SRE_FLAG_LOCALEr��SRE_FLAG_ASCII�SRE_FLAG_UNICODE)�srcrrrr�	fix_flags�s


rNcCs�t|�}|dkrt�}||_||_zt|||t@d�}WnBtk
rzt�}|tB|_||_|�d�t||dd�}YnXt||j	j�|j	_|j
dk	r�|�d��|t@r�|�
�|S)NrTzunbalanced parenthesis)rorrrCr�r�rr�rr7rtr(�SRE_FLAG_DEBUGrG)rCrr7r3r/rrr�parse�s&



rcs�t|���j}g�g�g��j}�����fdd�}�j}|�}|dkrL�q�|ddk�r�|d}|dk�rJd}��d�s���d	����d
d�}|��r�z||}	Wn tk
r�t	d|��YnXnlzt
|�}	|	dkr�t�Wn0tk
�r��d
|t|�d�d�YnX|	t
k�r4��d|	t|�d��||	t|�d��q�|dk�r��jtk�r�||�7}�jtk�r�||�7}|tt
|dd�d�d@���q�|tk�rZd}
�jtk�r4||�7}|tk�r4|dtk�r4�jtk�r4||�7}d}
t
|dd�d�}|dk�r(��d|t|���|t|��|
�s�|t
|dd��t|�d�nRztt|d�}Wn4tk
�r�|tk�r���d|t|���YnX||�q:||�q:��rΈ�d����t|t��s�dd��D����fS)NcsX|�jkr��d||���r8��d�����dd�=��t��|f���d�dS)Nr�r:)r%r(r&�joinr$)rWr��r%�literal�literalsrr7rr�addgroup�s

z parse_template.<locals>.addgrouprrr<�gr:r�z	missing <r�r�r�r�r�r�r�r�Fr`Tr�r�cSs"g|]}|dkrdn|�d��qS)Nzlatin-1)�encode)�.0rrrr�
<listcomp>sz"parse_template.<locals>.<listcomp>)ror)r&�
groupindexrzr(r�r�r�rvr�r�r$r'rtr�r�r�r�r�rrIrC)r3r7�sget�lappendrrr{r�r*rW�isoctalrrr�parse_template�s�




��


�


"

�

�� 


rcCsv|j}|jdd�}|\}}|dd�}z"|D]\}}||�p@|||<q.Wn tk
rjtd|��YnX|�|�S)Nrr�)r�rrrvr(r)�templaterzr�emptyr%rrWr�rrr�expand_templatesr")F)rN)<�
sre_constantsr�r��	frozensetr�r�r�r�r�r�r�rfr�r�rDr�r��CATEGORYrgr�r�r�ZAT_BEGINNING_STRINGZAT_BOUNDARYZAT_NON_BOUNDARYZCATEGORY_DIGITZCATEGORY_NOT_DIGITZCATEGORY_SPACEZCATEGORY_NOT_SPACEZ
CATEGORY_WORDZCATEGORY_NOT_WORDZ
AT_END_STRINGr��SRE_FLAG_IGNORECASEr�SRE_FLAG_MULTILINE�SRE_FLAG_DOTALLr�r�SRE_FLAG_TEMPLATEr
r�rrr	�	Exceptionrrr6ror�r�r�r�r�r�rrrr"rrrr�<module>sp







���
#rH<M:
r<
 U__pycache__/uuid.cpython-38.pyc000064400000056243151153537610012373 0ustar00U

&�.e3w�@s dZddlZddlZddlmZdZejdkr8dZZn ddlZe�	�Z
e
dkZe
dkZd	d
ddg\ZZZ
ZeZeZGd
d�de�ZGdd�d�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zdaa da!zddl"Z"Wne#k
�rdZ"YnXd%d&�Z$d'd(�Z%d)d*�Z&d+d,�Z'e�rFeegZ(nJejd-k�r^eeegZ(n2ejd.k�rteegZ(ne�r�egZ(neeeeegZ(ej)d/k�r�e%ge(Z*nej)d0k�r�e&ge(Z*ne(Z*da+dd1�d2d3�Z,da-d@d4d5�Z.d6d7�Z/d8d9�Z0d:d;�Z1ed<�Z2ed=�Z3ed>�Z4ed?�Z5dS)AaQUUID objects (universally unique identifiers) according to RFC 4122.

This module provides immutable UUID objects (class UUID) and the functions
uuid1(), uuid3(), uuid4(), uuid5() for generating version 1, 3, 4, and 5
UUIDs as specified in RFC 4122.

If all you want is a unique ID, you should probably call uuid1() or uuid4().
Note that uuid1() may compromise privacy since it creates a UUID containing
the computer's network address.  uuid4() creates a random UUID.

Typical usage:

    >>> import uuid

    # make a UUID based on the host ID and current time
    >>> uuid.uuid1()    # doctest: +SKIP
    UUID('a8098c1a-f86e-11da-bd1a-00112444be1e')

    # make a UUID using an MD5 hash of a namespace UUID and a name
    >>> uuid.uuid3(uuid.NAMESPACE_DNS, 'python.org')
    UUID('6fa459ea-ee8a-3ca4-894e-db77e160355e')

    # make a random UUID
    >>> uuid.uuid4()    # doctest: +SKIP
    UUID('16fd2706-8baf-433b-82eb-8c7fada847da')

    # make a UUID using a SHA-1 hash of a namespace UUID and a name
    >>> uuid.uuid5(uuid.NAMESPACE_DNS, 'python.org')
    UUID('886313e1-3b8a-5372-9b90-0c9aee199e5d')

    # make a UUID from a string of hex digits (braces and hyphens ignored)
    >>> x = uuid.UUID('{00010203-0405-0607-0809-0a0b0c0d0e0f}')

    # convert a UUID to a string of hex digits in standard form
    >>> str(x)
    '00010203-0405-0607-0809-0a0b0c0d0e0f'

    # get the raw 16 bytes of the UUID
    >>> x.bytes
    b'\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f'

    # make a UUID from a 16-byte string
    >>> uuid.UUID(bytes=x.bytes)
    UUID('00010203-0405-0607-0809-0a0b0c0d0e0f')
�N)�EnumzKa-Ping Yee <ping@zesty.ca>)�win32�darwinFZAIXZLinuxzreserved for NCS compatibilityzspecified in RFC 4122z$reserved for Microsoft compatibilityzreserved for future definitionc@seZdZdZdZdZdS)�SafeUUIDr���N)�__name__�
__module__�__qualname__ZsafeZunsafe�unknown�rr�/usr/lib64/python3.8/uuid.pyrHsrc@s:eZdZdZdZd=ejd�dd�Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zedd ��Zed!d"��Zed#d$��Zed%d&��Zed'd(��Zed)d*��Zed+d,��Zed-d.��Zed/d0��Zed1d2��Zed3d4��Zed5d6��Z ed7d8��Z!ed9d:��Z"ed;d<��Z#dS)>�UUIDa�	Instances of the UUID class represent UUIDs as specified in RFC 4122.
    UUID objects are immutable, hashable, and usable as dictionary keys.
    Converting a UUID to a string with str() yields something in the form
    '12345678-1234-1234-1234-123456789abc'.  The UUID constructor accepts
    five possible forms: a similar string of hexadecimal digits, or a tuple
    of six integer fields (with 32-bit, 16-bit, 16-bit, 8-bit, 8-bit, and
    48-bit values respectively) as an argument named 'fields', or a string
    of 16 bytes (with all the integer fields in big-endian order) as an
    argument named 'bytes', or a string of 16 bytes (with the first three
    fields in little-endian order) as an argument named 'bytes_le', or a
    single 128-bit integer as an argument named 'int'.

    UUIDs have these read-only attributes:

        bytes       the UUID as a 16-byte string (containing the six
                    integer fields in big-endian byte order)

        bytes_le    the UUID as a 16-byte string (with time_low, time_mid,
                    and time_hi_version in little-endian byte order)

        fields      a tuple of the six integer fields of the UUID,
                    which are also available as six individual attributes
                    and two derived attributes:

            time_low                the first 32 bits of the UUID
            time_mid                the next 16 bits of the UUID
            time_hi_version         the next 16 bits of the UUID
            clock_seq_hi_variant    the next 8 bits of the UUID
            clock_seq_low           the next 8 bits of the UUID
            node                    the last 48 bits of the UUID

            time                    the 60-bit timestamp
            clock_seq               the 14-bit sequence number

        hex         the UUID as a 32-character hexadecimal string

        int         the UUID as a 128-bit integer

        urn         the UUID as a URN as specified in RFC 4122

        variant     the UUID variant (one of the constants RESERVED_NCS,
                    RFC_4122, RESERVED_MICROSOFT, or RESERVED_FUTURE)

        version     the UUID version number (1 through 5, meaningful only
                    when the variant is RFC_4122)

        is_safe     An enum indicating whether the UUID has been generated in
                    a way that is safe for multiprocessing applications, via
                    uuid_generate_time_safe(3).
    )�int�is_safe�__weakref__N)rcCs�|||||g�d�dkr td��|dk	rl|�dd��dd�}|�d��dd�}t|�d	krbtd
��t|d�}|dk	r�t|�dkr�td��|d
dd�|dd
d�|ddd�|dd�}|dk	r�t|�dkr�td��t|t�s�t	t
|���tj|dd�}|dk	�r*t|�dk�rtd��|\}}	}
}}}
d|k�rFdk�sPntd��d|	k�rhdk�srntd��d|
k�r�dk�s�ntd��d|k�r�dk�s�ntd��d|k�r�dk�s�ntd��d|
k�r�d k�s�ntd!��|d>|B}|d">|	d#>B|
d$>B|d%>B|
B}|dk	�rZd|k�rPd&d'>k�sZntd(��|dk	�r�d&|k�r|dk�s�ntd)��|d*M}|d+O}|d,M}||d->O}t�
|d.|�t�
|d/|�dS)0aLCreate a UUID from either a string of 32 hexadecimal digits,
        a string of 16 bytes as the 'bytes' argument, a string of 16 bytes
        in little-endian order as the 'bytes_le' argument, a tuple of six
        integers (32-bit time_low, 16-bit time_mid, 16-bit time_hi_version,
        8-bit clock_seq_hi_variant, 8-bit clock_seq_low, 48-bit node) as
        the 'fields' argument, or a single 128-bit integer as the 'int'
        argument.  When a string of hex digits is given, curly braces,
        hyphens, and a URN prefix are all optional.  For example, these
        expressions all yield the same UUID:

        UUID('{12345678-1234-5678-1234-567812345678}')
        UUID('12345678123456781234567812345678')
        UUID('urn:uuid:12345678-1234-5678-1234-567812345678')
        UUID(bytes='\x12\x34\x56\x78'*4)
        UUID(bytes_le='\x78\x56\x34\x12\x34\x12\x78\x56' +
                      '\x12\x34\x56\x78\x12\x34\x56\x78')
        UUID(fields=(0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x567812345678))
        UUID(int=0x12345678123456781234567812345678)

        Exactly one of 'hex', 'bytes', 'bytes_le', 'fields', or 'int' must
        be given.  The 'version' argument is optional; if given, the resulting
        UUID will have its variant and version set according to RFC 4122,
        overriding the given 'hex', 'bytes', 'bytes_le', 'fields', or 'int'.

        is_safe is an enum exposed as an attribute on the instance.  It
        indicates whether the UUID has been generated in a way that is safe
        for multiprocessing applications, via uuid_generate_time_safe(3).
        N�zGone of the hex, bytes, bytes_le, fields, or int arguments must be givenzurn:�zuuid:z{}�-� z$badly formed hexadecimal UUID string�z bytes_le is not a 16-char string�r���zbytes is not a 16-char string�big)�	byteorder�zfields is not a 6-tuplerlz*field 1 out of range (need a 32-bit value)iz*field 2 out of range (need a 16-bit value)z*field 3 out of range (need a 16-bit value)�z*field 4 out of range (need an 8-bit value)z*field 5 out of range (need an 8-bit value)�z*field 6 out of range (need a 48-bit value)�`�P�@�0��z*int is out of range (need a 128-bit value)zillegal version numberl�����l�����Lrr)�count�	TypeError�replace�strip�len�
ValueError�int_�
isinstance�bytes_�AssertionError�repr�
from_bytes�object�__setattr__)�self�hex�bytes�bytes_le�fieldsr�versionr�time_low�time_mid�time_hi_version�clock_seq_hi_variant�
clock_seq_low�node�	clock_seqrrr�__init__�sz 
�
�
����

z
UUID.__init__cCs&d|ji}|jtjkr"|jj|d<|S�Nrr)rrrr
�value)r5�drrr�__getstate__�s
zUUID.__getstate__cCs:t�|d|d�t�|dd|kr.t|d�ntj�dSrC)r3r4rr
)r5�staterrr�__setstate__�s��zUUID.__setstate__cCst|t�r|j|jkStS�N�r.r
r�NotImplemented�r5�otherrrr�__eq__�s
zUUID.__eq__cCst|t�r|j|jkStSrIrJrLrrr�__lt__�s
zUUID.__lt__cCst|t�r|j|jkStSrIrJrLrrr�__gt__�s
zUUID.__gt__cCst|t�r|j|jkStSrIrJrLrrr�__le__�s
zUUID.__le__cCst|t�r|j|jkStSrIrJrLrrr�__ge__s
zUUID.__ge__cCs
t|j�SrI)�hashr�r5rrr�__hash__sz
UUID.__hash__cCs|jSrI�rrTrrr�__int__szUUID.__int__cCsd|jjt|�fS)Nz%s(%r))�	__class__r�strrTrrr�__repr__sz
UUID.__repr__cCstd��dS)NzUUID objects are immutable)r()r5�namerDrrrr4szUUID.__setattr__cCsDd|j}d|dd�|dd�|dd�|dd�|dd�fS)N�%032xz%s-%s-%s-%s-%sr�r�rV)r5r6rrr�__str__s





�zUUID.__str__cCs|j�dd�S)Nrr)r�to_bytesrTrrrr7sz
UUID.bytescCs<|j}|ddd�|ddd�|ddd�|dd�S)Nrrrrr�r7)r5r7rrrr8s(
�z
UUID.bytes_lecCs|j|j|j|j|j|jfSrI)r;r<r=r>r?r@rTrrrr9 s
�zUUID.fieldscCs
|jd?S)NrrVrTrrrr;%sz
UUID.time_lowcCs|jd?d@S)Nr �rVrTrrrr<)sz
UUID.time_midcCs|jd?d@S)Nr!rbrVrTrrrr=-szUUID.time_hi_versioncCs|jd?d@S)N�8�rVrTrrrr>1szUUID.clock_seq_hi_variantcCs|jd?d@S)Nr"rdrVrTrrrr?5szUUID.clock_seq_lowcCs|jd@d>|jd>B|jBS)N�r"r)r=r<r;rTrrr�time9s
��z	UUID.timecCs|jd@d>|jBS)N�?r)r>r?rTrrrrA>s�zUUID.clock_seqcCs
|jd@S)Nl���rVrTrrrr@Csz	UUID.nodecCs
d|jS)Nr\rVrTrrrr6GszUUID.hexcCsdt|�S)Nz	urn:uuid:)rYrTrrr�urnKszUUID.urncCs2|jd@stS|jd@stS|jd@s*tStSdS)Nr%ll)r�RESERVED_NCS�RFC_4122�RESERVED_MICROSOFT�RESERVED_FUTURErTrrr�variantOs


zUUID.variantcCs |jtkrt|jd?d@�SdS)Nr&�)rmrjrrTrrrr:Zs
zUUID.version)NNNNNN)$rrr	�__doc__�	__slots__rr
rBrFrHrNrOrPrQrRrUrWrZr4r_�propertyr7r8r9r;r<r=r>r?rfrAr@r6rhrmr:rrrrr
Nsd3��V














r
c	Gs�ddl}ddl}ddl}|�|�}|dkrP|j�d�}|j||d�}|dkrPdSt|j�}d|d<|j|f||j	|j
|d�}|S)Nr)z/sbinz	/usr/sbin)�path�C�LC_ALL)�stdout�stderr�env)�os�shutil�
subprocessZwhich�pathsep�join�dict�environ�Popen�PIPEZDEVNULL)	�command�argsrxryrz�
executablerrrw�procrrr�_popen`s

�r�cCs
|d@S)Nlr��macrrr�
_is_universal�sr�cCs�d}z�t|f|����}|s"WdS|��|jD]�}|������}tt|��D]x}|||krNzN|||�}	t|	�dd�d�}
t	|
�r�|
WW5QR�WS|p�|
}WqNt
tfk
r�YqNXqNq.W5QRXWntk
r�YnX|p�dS)N�:�r)
r��splitru�lower�rstrip�ranger+rr)r�r,�
IndexError�OSError)r�r�Zhw_identifiersZ	get_index�first_local_macr��line�words�i�wordr�rrr�	_find_mac�s*
r�cCs4d}dD]&}td||dd��}|r*|SdSdS)z5Get the hardware address on Unix by running ifconfig.)shwaddrsethersaddress:slladdr)rz-az-avZifconfigcSs|dS�Nr#r�r�rrr�<lambda>�r�z#_ifconfig_getnode.<locals>.<lambda>N�r�)�keywordsr�r�rrr�_ifconfig_getnode�sr�cCs tdddgdd��}|r|SdS)z/Get the hardware address on Unix by running ip.Zip�links
link/ethercSs|dSr�rr�rrrr��r�z_ip_getnode.<locals>.<lambda>Nr�r�rrr�_ip_getnode�sr�cCs�ddl}ddl}z|�|���}Wntk
r8YdSXtdd|�|�gdd��}|r\|Stdd|�|�gdd��}|r~|Stdd|�d|�gd	d��}|r�|SdS)
z0Get the hardware address on Unix by running arp.rNZarpz-ancSsdS)Nrrr�rrrr��r�z_arp_getnode.<locals>.<lambda>cSs|dSr�rr�rrrr��r�z(%s)cSs|dS)N�rr�rrrr��r�)rx�socketZ
gethostbynameZgethostnamer�r��fsencode)rxr�Zip_addrr�rrr�_arp_getnode�s"�r�cCstdddgdd��S)z4Get the hardware address on Unix by running lanscan.Zlanscanz-aislan0cSsdS)Nrrr�rrrr��r�z"_lanscan_getnode.<locals>.<lambda>r�rrrr�_lanscan_getnode�sr�cCs&d}�z�tdd�}|sWdS|��|j������}z|�d�}Wn"tk
rdYW5QR�WdSX|jD]�}zl|����}||}t|�dkr�|�d�dkr�t	|�
dd�d	�}t|�r�|WW5QR�WS|p�|}Wqlttfk
r�YqlXqlW5QRXWnt
k
�rYnX|�p$dS)
z4Get the hardware address on Unix by running netstat.NZnetstatz-iasAddress�r�rr�r)r�ru�readliner�r��indexr,r+r'rr)r�r�r�)r�r�r�r�r�r�r�rrr�_netstat_getnode�s2

r�cCs<ddl}ddl}ddl}d}dddg}z:ddl}|�d�}|jj�|d�|�d|j	�
d��WnYnX|D]�}z$|j|j�
|d�d	g|jd
d�}Wntk
r�YqrYnX|�r|jD]d}	|	�d�d
����}
|�d|
�r�t|
�dd�d�}t|��r|W5QR�S|�p"|}q�W5QRXqr|�p:dS)z<Get the hardware address on Windows by running ipconfig.exe.rNrzc:\windows\system32zc:\winnt\system32i,�mbcsZipconfigz/allZoem)ru�encoding�:rz((?:[0-9a-f][0-9a-f]-){5}[0-9a-f][0-9a-f]rr)rx�rerz�ctypes�create_string_buffer�windllZkernel32ZGetSystemDirectoryA�insertrD�decoderrrr|r�r�rur�r*r��	fullmatchrr)r�)rxr�rzr��dirsr��buffer�dirr�r�rDr�rrr�_ipconfig_getnode�s6

�



r�c	Cs6ddl}ddl}d}|��}|j|_|��|_}|��|�|�dkrLdS|�	�t
|j�D]�}|��|j
|_t|j|�|_|�|�dkr�q^|��|j|_t|j|�|_d�d�|_|��|_}|�|�dkr�q^|�	�|jdd�}t|�dk�rq^t�|d�}t|��r |S|�p(|}q^|�p4dS)ztGet the hardware address on Windows using NetBIOS calls.
    See http://support.microsoft.com/kb/118623 for details.rN�*rrr)�	win32wnet�netbiosZNCBZNCBENUMZCommandZ	LANA_ENUMZBufferZ_packZNetbiosZ_unpackr�ZlengthZResetZNCBRESET�ordZlanaZLana_numZNCBASTAT�ljustZCallnameZADAPTER_STATUSZadapter_addressr+rr2r�)	r�r�r�ZncbZadaptersr�Zstatusr7r�rrr�_netbios_getnodes>
r�c
s�tdk	rdSdatjdkr8tt��j�d�d�dkr8ntdk	rPtj	a
tjadSz�ddl�ddl
�dg}tj�d�s~|�d	�|D]�}z���j�|��}Wntk
r�Yq�YnXt|d
�r�|j���fdd�a
d
a�qq�t|d�r�|j�d�_��fdd�a
�qq�z�jj}Wnd}YnXt|dt|dd��aWn>tk
�r~}zddl}|�d|��t�W5d}~XYnXdS)zG
    Try to load platform-specific functions for generating uuids.
    NFr�.r�	Zuuid�win�c�uuid_generate_time_safecs ��d�}�|�}t|j�|fS�Nr�r�r7�raw)�_buffer�res)�_uuid_generate_time_safer�rr�_generate_time_safehs
r�T�uuid_generate_timecs ��d�}�|�t|j�dfSr�r�)r�)�_uuid_generate_timer�rrr�ss
ZUuidCreateSequentialZ
UuidCreatez/Could not find fallback ctypes uuid functions: )�_has_uuid_generate_time_safe�sys�platformrrx�uname�releaser��_uuidZgenerate_time_safer�Zhas_uuid_generate_time_safer�Zctypes.util�
startswith�appendZCDLL�utilZfind_library�	Exception�hasattrr�r�Zrestyper�Zrpcrt4�getattr�_UuidCreate�warnings�warn�
ImportWarning)Z	_libnamesZlibname�lib�excr�r)r�r�r�r�_load_system_functions:sT&






��r�cCst�t�\}}t|d�jS)zPGet the hardware address on Unix using the _uuid extension module
    or ctypes.ra)r�r�r
r@)�	uuid_time�_rrr�
_unix_getnode�s
r�cCs:ddl}t�|�d�}t|�dkr6tt|j�d�jSdS)z1Get the hardware address on Windows using ctypes.rNrra)r�r�r�r�r
r/r�r@)r�r�rrr�_windll_getnode�s

r�cCsddl}|�d�dBS)zGet a random node ID.rNr"l)�random�getrandbits)r�rrr�_random_getnode�sr�rr�posix�nt)�getterscCsvtdk	rtSttgD]H}z
|�aWnYqYnXtdk	rdtkrRdkrnqtSqdsrtd�t���dS)a3Get the hardware address as a 48-bit positive integer.

    The first time this runs, it may launch a separate program, which could
    be quite slow.  If all attempts to obtain the hardware address fail, we
    choose a random 48-bit number with its eighth bit set to 1 as recommended
    in RFC 4122.
    NrrFz,_random_getnode() returned invalid value: {})�_node�_GETTERSr�r0�format)r��getterrrr�getnode�s	

 
r�cCst�tdk	rd||kr"dkrdnn>t�\}}zt|�}Wntk
rVtj}YnXt||d�Sddl}|��}|dd}tdk	r�|tkr�td}|a|dkr�ddl	}|�
d�}|d@}	|d	?d
@}
|d?d@}|d
@}|d?d@}
|dkr�t�}t|	|
||
||fdd�S)aGenerate a UUID from a host ID, sequence number, and the current time.
    If 'node' is not given, getnode() is used to obtain the hardware
    address.  If 'clock_seq' is given, it is used as the sequence number;
    otherwise a random 14-bit sequence number is chosen.N)r7rr�dl@'Hw�
r#�l��rrbr"rerdrrg)r9r:)r�r�rr,r
r
rf�time_ns�_last_timestampr�r�r�)r@rAr�Zsafely_generatedrrfZnanosecondsZ	timestampr�r;r<r=r?r>rrr�uuid1�s> 

��r�cCs<ddlm}||jt|d�dd���}t|dd�dd	�S)
zAGenerate a UUID from the MD5 hash of a namespace UUID and a name.r)�md5�utf-8F)ZusedforsecurityNrr�r7r:)�hashlibr�r7�digestr
)�	namespacer[r�r�rrr�uuid3s�
r�cCstt�d�dd�S)zGenerate a random UUID.rrr�)r
rx�urandomrrrr�uuid4sr�cCs8ddlm}||jt|d����}t|dd�dd�S)zCGenerate a UUID from the SHA-1 hash of a namespace UUID and a name.r)�sha1r�Nrrr�)r�r�r7r�r
)r�r[r�rSrrr�uuid5sr�z$6ba7b810-9dad-11d1-80b4-00c04fd430c8z$6ba7b811-9dad-11d1-80b4-00c04fd430c8z$6ba7b812-9dad-11d1-80b4-00c04fd430c8z$6ba7b814-9dad-11d1-80b4-00c04fd430c8)NN)6rorxr��enumr�
__author__r�Z_AIXZ_LINUX�systemZ_platform_systemrirjrkrlrr-r7r/rr
r�r�r�r�r�r�r�r�r�r�r�r�r�r��ImportErrorr�r�r�r�Z_OS_GETTERSr[r�r�r�r�r�r�r�r�Z
NAMESPACE_DNSZ
NAMESPACE_URLZ
NAMESPACE_OIDZNAMESPACE_X500rrrr�<module>s�.

�"
$
T

�
'	__pycache__/genericpath.cpython-38.opt-2.pyc000064400000005463151153537610014654 0ustar00U

e5do�@s�ddlZddlZdddddddd	d
ddgZd
d�Zdd	�Zdd�Zdd�Zdd�Zdd�Zdd�Z	dd�Z
dd�Zdd
�Zdd�Z
dd�Zdd�ZdS)�N�commonprefix�exists�getatime�getctime�getmtime�getsize�isdir�isfile�samefile�sameopenfile�samestatc	Cs.zt�|�Wnttfk
r(YdSXdS)NFT)�os�stat�OSError�
ValueError)�path�r�#/usr/lib64/python3.8/genericpath.pyrs
c	Cs6zt�|�}Wnttfk
r(YdSXt�|j�S�NF)r
rrr�S_ISREG�st_mode)r�strrrr	s
c	Cs6zt�|�}Wnttfk
r(YdSXt�|j�Sr)r
rrr�S_ISDIRr)�srrrrr's
cCst�|�jS�N)r
r�st_size��filenamerrrr0scCst�|�jSr)r
r�st_mtimerrrrr5scCst�|�jSr)r
r�st_atimerrrrr:scCst�|�jSr)r
r�st_ctimerrrrr?scCsl|sdSt|dttf�s*tttj|��}t|�}t|�}t|�D]$\}}|||krB|d|�SqB|S)N�r)	�
isinstance�list�tuple�mapr
�fspath�min�max�	enumerate)�m�s1�s2�i�crrrrEscCs|j|jko|j|jkSr)�st_ino�st_dev)r+r,rrrrWs
�cCst�|�}t�|�}t||�Sr)r
rr)�f1�f2r+r,rrrr
^s

cCst�|�}t�|�}t||�Sr)r
�fstatr)�fp1�fp2r+r,rrrrks

cCs�|�|�}|r"|�|�}t||�}|�|�}||krz|d}||krz|||d�|krp|d|�||d�fS|d7}q<||dd�fS)N�r)�rfindr()�p�sep�altsep�extsep�sepIndex�altsepIndex�dotIndex�
filenameIndexrrr�	_splitextys




r@cGs`d}}|D]<}t|t�r d}qt|t�r0d}qt|�d|jj���d�q|r\|r\td�d�dS)NFTz;() argument must be str, bytes, or os.PathLike object, not z.Can't mix strings and bytes in path components)r"�str�bytes�	TypeError�	__class__�__name__)�funcname�args�hasstr�hasbytesrrrr�_check_arg_types�s

�rJ)r
r�__all__rr	rrrrrrrr
rr@rJrrrr�<module>s,
�	
__pycache__/zipfile.cpython-38.pyc000064400000162224151153537610013064 0ustar00U

e5d�V�@sdZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZzddlZejZWnek
r�dZejZYnXzddlZWnek
r�dZYnXzddlZWnek
r�dZYnXddddddd	d
ddd
ddg
ZGdd�de�ZGdd�de�ZeZZdZdZdZdZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'dZ(e�)e'�Z*dZ+dZ,dZ-dZ.d Z/d!Z0d"Z1d#Z2dZ3d$Z4d%Z5d&Z6e�)e5�Z7dZ8dZ9dZ:dZ;d Z<d!Z=d"Z>d#Z?dZ@d$ZAd'ZBd(ZCdZDd)ZEdZFd*ZGd+ZHd,ZId-ZJd.ZKd/ZLe�)eK�ZMdZNdZOdZPdZQd ZRd!ZSd"ZTd#ZUdZVd$ZWd'ZXd(ZYd0ZZd1Z[e�)eZ�Z\d2Z]d3Z^e�)e]�Z_dZ`dZadZbdZcd Zdd!Zed"Zfd#ZgdZhd$Zid4Zje�kd5�Zld6d7�Zmd8d9�Znd:d
�Zod;d<�Zpd=d>�ZqGd?d�der�Zsdatd@dA�ZudBdC�ZvGdDdE�dE�ZwGdFdG�dG�ZxdHdIdJdJdJdJdKdLdMdNdKdOdPdQdRdSdTdU�ZydVdW�ZzdtdXdY�Z{dZd[�Z|Gd\d]�d]�Z}Gd^d_�d_�Z~Gd`da�daej�Z�Gdbdc�dcej�Z�Gddd�d�Z�Gded
�d
e��Z�dfdg�Z�dhdi�Z�e�j�Z�djdk�Z�Gdldm�dme��Z�Gdndo�doe��Z�Gdpd�d�Z�dudqdr�Z�e�dsk�r
e��dS)vzP
Read and write ZIP files.

XXX references to utf-8 need further investigation.
�N�
BadZipFile�
BadZipfile�error�
ZIP_STORED�ZIP_DEFLATED�	ZIP_BZIP2�ZIP_LZMA�
is_zipfile�ZipInfo�ZipFile�	PyZipFile�LargeZipFile�Pathc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/zipfile.pyr+sc@seZdZdZdS)r
zu
    Raised when writing a zipfile, the zipfile requires ZIP64 extensions
    and those extensions are disabled.
    N)rrr�__doc__rrrrr
/si���������-�.�?s<4s4H2LHsPK��������	z<4s4B4HL2L5H2LsPK�
��
����z<4s2B4HL2L2HsPKz<4sLQLsPKz
<4sQ2H2L4QsPKiPK�<HHc
Cs�tj}d}g}d}}|dt|�krz||||d��\}}|d|}	||krt||krl|�|||��|	}d}|	}q|s�|Sd�|�S)NFrr T�)�_EXTRA_FIELD_STRUCT�unpack�len�append�join)
�extraZxidsr/Zmodified�buffer�start�iZxidZxlen�jrrr�_strip_extra�s r8cCs,zt|�rWdSWntk
r&YnXdS)NTF)�_EndRecData�OSError��fprrr�_check_zipfile�s
r=c	CsVd}z8t|d�rt|d�}nt|d��}t|�}W5QRXWntk
rPYnX|S)z�Quickly see if a file is a ZIP file by checking the magic number.

    The filename argument may be a file or file-like object too.
    F�readr;�rb)�hasattrr=�openr:)�filename�resultr<rrrr	�s
c
Csz|�|td�Wntk
r,|YSX|�t�}t|�tkrH|St�t|�\}}}}|tkrh|S|dksx|dkr�t	d��|�|tt
d�|�t
�}t|�t
kr�|St�t|�\
}}}	}
}}}
}}}|tkr�|S||t
<||t<||t<|
|t<||t<||t<||t<|S)zM
    Read the ZIP64 end-of-archive records and use that to update endrec
    rrrz3zipfiles that span multiple disks are not supported)�seek�sizeEndCentDir64Locatorr:r>r0�structr/�structEndArchive64Locator�stringEndArchive64Locatorr�sizeEndCentDir64�structEndArchive64�stringEndArchive64�_ECD_SIGNATURE�_ECD_DISK_NUMBER�_ECD_DISK_START�_ECD_ENTRIES_THIS_DISK�_ECD_ENTRIES_TOTAL�	_ECD_SIZE�_ECD_OFFSET)�fpin�offset�endrec�dataZsigZdisknoZreloffZdisksZsz�create_versionZread_versionZdisk_numZdisk_dirZdircountZ	dircount2ZdirsizeZ	diroffsetrrr�
_EndRecData64�s@



�rXc	Csh|�dd�|��}z|�td�Wntk
r<YdSX|��}t|�tkr�|dd�tkr�|dd�dkr�t�t	|�}t
|�}|�d�|�|t�t|t|�St
|dtd�}|�|d�|��}|�t�}|dk�rd|||t�}t|�tk�rdSt
t�t	|��}|t}||t|t|�}|�|�|�||�t|||||�SdS)	z�Return data from the "End of Central Directory" record, or None.

    The data is a list of the nine items in the ZIP "End of central dir"
    record followed by a tenth item, the file seek offset of this record.rrNr ���sr-i)rD�tell�sizeEndCentDirr:r>r0�stringEndArchiverFr/�structEndArchive�listr1rX�max�rfind�_ECD_COMMENT_SIZE)	rSZfilesizerVrUZmaxCommentStartr5ZrecDataZcommentSize�commentrrrr9sD��



�r9c@s\eZdZdZdZddd�Zdd�Zdd
d�Zdd
�Zdd�Z	e
ddd�dd��Zdd�Zd	S)r
z>Class with attributes describing each file in the ZIP archive.)�
orig_filenamerB�	date_time�
compress_type�_compresslevelrbr3�
create_systemrW�extract_version�reserved�	flag_bits�volume�
internal_attr�
external_attr�
header_offset�CRC�
compress_size�	file_size�	_raw_time�NoName��rrrrrcCs�||_|�td��}|dkr(|d|�}tjdkrJtj|krJ|�tjd�}||_||_|ddkrjtd��t	|_
d|_d|_d|_
tjdkr�d|_nd|_t|_t|_d|_d|_d|_d|_d|_dS)Nr�/ruz+ZIP does not support timestamps before 1980r-Zwin32r)rc�find�chr�os�sep�replacerBrd�
ValueErrorrrerfrbr3�sys�platformrg�DEFAULT_VERSIONrWrhrirjrkrlrm)�selfrBrdZ	null_byterrr�__init__Xs0
zZipInfo.__init__cCs�d|jj|jfg}|jtkr8|�dt�|j|j��|jd?}|jd@}|rd|�dt	�
|��|rv|�d|�|��}|r�|jr�|�d|j�|r�|j
r�|jtks�|j|j
kr�|�d|j
�|�d	�d
�|�S)Nz<%s filename=%r� compress_type=%sr)rz filemode=%rz external_attr=%#xz
 file_size=%rz compress_size=%r�>�)�	__class__rrBrerr1�compressor_names�getrm�stat�filemode�is_dirrqrpr2)r�rC�hi�lo�isdirrrr�__repr__�s0
��



�
�
zZipInfo.__repr__NcCs||j}|ddd>|dd>B|dB}|dd>|d	d>B|ddB}|jd
@rfd}}}n|j}|j}|j}|j}d}	|dkr�|tkp�|tk}|r�d}
|t�|
dt�	|
�d	||�}|tks�|tkr�|s�t
d
��d}d}t}	|jt
k�rtt|	�}	n|jtk�rtt|	�}	t|	|j�|_t|	|j�|_|��\}}t�tt|j|j||j|||||t|�t|��
}
|
||S)z-Return the per-file header as a bytes object.rrur$rr!rrr&r rNz<HHQQz'Filesize would require ZIP64 extensions���)rdrjrorprqr3�ZIP64_LIMITrF�pack�calcsizer
�
ZIP64_VERSIONrerr_�
BZIP2_VERSIONr�LZMA_VERSIONrhrW�_encodeFilenameFlags�structFileHeader�stringFileHeaderrir0)r��zip64�dt�dosdate�dostimerorprqr3�min_version�fmtrBrj�headerrrr�
FileHeader�s^$$
�
�zZipInfo.FileHeadercCsDz|j�d�|jfWStk
r>|j�d�|jdBfYSXdS)N�ascii�utf-8�)rB�encoderj�UnicodeEncodeError�r�rrrr��szZipInfo._encodeFilenameFlagscCs�|j}tj}t|�dk�r�|d|dd��\}}|dt|�krPtd||f��|dk�rp|dkrv|d|dd��}nV|dkr�|d	|dd
��}n:|dkr�|d|dd
��}n|dkr�d}ntd||f��d}|jdk�rt|�|kr�td��|||_|d7}|jdk�r6t|�|k�r$td��|||_|d7}|jdk�rpt|�|k�rXtd��|j}|||_|d7}||dd�}qdS)Nr r,z"Corrupt extra field %04x (size=%d)r�z<QQQ�r)z<QQrrz<Qrrr)l����r�z/Corrupt zip64 extra field. File size not found.r�z3Corrupt zip64 extra field. Compress size not found.z3Corrupt zip64 extra field. Header offset not found.)r3rFr/r0rrqrprn)r�r3r/�tpZlnZcounts�idx�oldrrr�_decodeExtra�sP
�
�
�
zZipInfo._decodeExtraT��strict_timestampsc	Cst|tj�rt�|�}t�|�}t�|j�}t�|j	�}|dd�}|sZ|ddkrZd}n|sn|ddkrnd}|dkrz|}tj
�tj
�|�d�}|dtj
tjfkr�|dd�}q�|r�|d	7}|||�}|jd
@d>|_|r�d|_|jdO_n|j|_|S)a_Construct an appropriate ZipInfo for a file on the filesystem.

        filename should be the path to a file or directory on the filesystem.

        arcname is the name which it will have within the archive (by default,
        this will be the same as filename, but without a drive letter and with
        leading path separators removed).
        rr"rurt�;)r�r���;r�Nrrvrr))�
isinstancery�PathLike�fspathr��S_ISDIR�st_mode�time�	localtime�st_mtime�path�normpath�
splitdriverz�altseprmrq�st_size)	�clsrB�arcnamer��str��mtimerd�zinforrr�	from_file�s0



zZipInfo.from_filecCs|jddkS)z2Return True if this archive member is a directory.���rv�rBr�rrrr�%szZipInfo.is_dir)rsrt)N)N)
rrrr�	__slots__r�r�r�r�r��classmethodr�r�rrrrr
>s
+
.2%cCs0td�D]"}|d@r"|d?dA}q|dL}q|S)Nrrl q[)�range)�crcr7rrr�_gen_crc/s

r�csld�d�d�tdkr&ttttd���at��fdd������fdd��|D]}�|�qL��fd	d
�}|S)NixV4i�gE#i�xV4�cs|d?�||Ad@AS)z(Compute the CRC32 primitive on one byte.r�r)Zchr�)�crctablerr�crc32Isz_ZipDecrypter.<locals>.crc32cs<�|�����d@d@��ddd@���d?���dS)Nr�r�i�rr�r)�c)r��key0�key1�key2rr�update_keysMs
z"_ZipDecrypter.<locals>.update_keyscsNt�}|j}|D]4}�dB}|||dAd?d@N}�|�||�qt|�S)zDecrypt a bytes object.rrrr�)�	bytearrayr1�bytes)rVrCr1r��k)r�r�rr�	decrypterWs
z _ZipDecrypter.<locals>.decrypter)�	_crctabler^�mapr�r�)�pwd�pr�r)r�r�r�r�r�r�r�
_ZipDecrypter?s
r�c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�LZMACompressorcCs
d|_dS�N)�_compr�rrrr�gszLZMACompressor.__init__cCsFt�dtji�}tjtjt�tj|�gd�|_t�dddt	|��|S)N�id��filtersz<BBHr$r )
�lzmaZ_encode_filter_properties�FILTER_LZMA1r��
FORMAT_RAW�_decode_filter_propertiesr�rFr�r0)r�Zpropsrrr�_initjs
�
zLZMACompressor._initcCs*|jdkr|��|j�|�S|j�|�Sr�)r�r��compress)r�rVrrrr�qs
zLZMACompressor.compresscCs&|jdkr|��|j��S|j��Sr�)r�r��flushr�rrrr�vs
zLZMACompressor.flushN)rrrr�r�r�r�rrrrr�esr�c@seZdZdd�Zdd�ZdS)�LZMADecompressorcCsd|_d|_d|_dS)Nr-F)�_decomp�_unconsumed�eofr�rrrr�~szLZMADecompressor.__init__c	Cs�|jdkr�|j|7_t|j�dkr*dSt�d|jdd��\}t|j�d|krXdStjtjt�tj	|jdd|��gd�|_|jd|d�}|`|j�
|�}|jj|_|S)Nr r-z<Hrr�)r�r�r0rFr/r�r�r�r�r��
decompressr�)r�rVZpsizerCrrrr��s"
��

zLZMADecompressor.decompressN)rrrr�r�rrrrr�|sr�ZstoreZshrink�reduceZimplode�tokenizeZdeflateZ	deflate64Zbzip2r�ZterseZlz77ZwavpackZppmd)rrrrr r!r"r#rr$r%rrr+��a�bcCsX|tkr
nJ|tkr tsTtd��n4|tkr6tsTtd��n|tkrLtsTtd��ntd��dS)Nz.Compression requires the (missing) zlib modulez-Compression requires the (missing) bz2 modulez.Compression requires the (missing) lzma modulez(That compression method is not supported)	rr�zlib�RuntimeErrorr�bz2rr��NotImplementedError)�compressionrrr�_check_compression�s$���r�cCsj|tkr2|dk	r t�|tjd�St�tjtjd�S|tkrT|dk	rLt�|�St��S|tkrbt	�SdSdS)N��)
rr�ZcompressobjZDEFLATEDZZ_DEFAULT_COMPRESSIONrr�Z
BZ2Compressorrr�)re�
compresslevelrrr�_get_compressor�s
r�cCsvt|�|tkrdS|tkr&t�d�S|tkr6t��S|tkrDt	�St
�|�}|rdtd||f��ntd|f��dS)Nr�zcompression type %d (%s)zcompression type %d)
r�rrr�Z
decompressobjrr�ZBZ2Decompressorrr�r�r�r�)reZdescrrrr�_get_decompressor�s

r�c@s0eZdZdd�Zddd�Zd
dd�Zd	d
�ZdS)�_SharedFilecCs2||_||_||_||_||_|j|_|j|_dSr�)�_file�_pos�_close�_lock�_writing�seekablerZ)r��file�pos�close�lockZwritingrrrr��sz_SharedFile.__init__rc
CsN|j�>|��rtd��|j�||�|j��|_|jW5QR�SQRXdS)Nz}Can't reposition in the ZIP file while there is an open writing handle on it. Close the writing handle before trying to read.)rrr|rrDrZr)r�rT�whencerrrrD�sz_SharedFile.seekr�c
CsX|j�H|��rtd��|j�|j�|j�|�}|j��|_|W5QR�SQRXdS)N�yCan't read from the ZIP file while there is an open writing handle on it. Close the writing handle before trying to read.)rrr|rrDrr>rZ�r��nrVrrrr>�sz_SharedFile.readcCs$|jdk	r |j}d|_|�|�dSr�)rr)r��fileobjrrrr	s
z_SharedFile.closeN)r)r�)rrrr�rDr>r	rrrrr�s	


rc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�	_TellablecCs||_d|_dS�Nr)r<rT�r�r<rrrr�sz_Tellable.__init__cCs|j�|�}|j|7_|Sr�)r<�writerT)r�rVrrrrrsz_Tellable.writecCs|jSr�)rTr�rrrrZsz_Tellable.tellcCs|j��dSr�)r<r�r�rrrr�sz_Tellable.flushcCs|j��dSr�)r<r	r�rrrr	sz_Tellable.closeN)rrrr�rrZr�r	rrrrrs
rcs�eZdZdZdZdZdZd(dd�Zd	d
�Zdd�Z	d)dd�Z
d*dd�Zdd�Zd+dd�Z
dd�Zdd�Zdd�Zdd�Z�fdd �Zd!d"�Zd,d$d%�Zd&d'�Z�ZS)-�
ZipExtFilezZFile-like object for reading an archive member.
       Is returned by ZipFile.open().
    i@iiNFcCs(||_||_||_|j|_|j|_|j|_t	|j�|_
d|_d|_d|_
d|_||_|j|_t|d�rz|j|_td�|_nd|_d|_z4|��r�|��|_|j|_|j|_|j|_d|_Wntk
r�YnXd|_|�r$|j d@r�|j!d?d@}n|jd?d@}|�"�}||k�r$t#d	|j$��dS)
NFr-rroTrr�r�zBad password for file %r)%�_fileobj�_pwd�_close_fileobjre�_compress_typerp�_compress_leftrq�_leftr��
_decompressor�_eof�_readbuffer�_offset�newlines�moderB�namer@ro�
_expected_crcr��_running_crc�	_seekablerrZ�_orig_compress_start�_orig_compress_size�_orig_file_size�_orig_start_crc�AttributeError�
_decrypterrjrr�_init_decrypterr�rc)r�rr �zipinfor�Z
close_fileobjZ
check_byte�hrrrr�)sF




zZipExtFile.__init__cCs4t|j�|_|j�d�}|jd8_|�|�dS)Nrr&)r�rr*rr>r)r�r�rrrr+\szZipExtFile._init_decryptercCsvd|jj|jjfg}|jsX|�d|j|jf�|jtkrb|�dt	�
|j|j��n
|�d�|�d�d�|�S)N�<%s.%sz name=%r mode=%rr��	 [closed]r�r�)r�rr�closedr1r!r rrr�r�r2�r�rCrrrr�gs�
��

zZipExtFile.__repr__r�cCsL|dkr>|j�d|j�d}|dkr>|j|j|�}||_|Stj�||�S)zrRead and return a line from the stream.

        If limit is specified, at most limit bytes will be read.
        r�
r)rrwr�io�BufferedIOBase�readline)r��limitr6�linerrrr5uszZipExtFile.readlinercCsr|t|j�|jkr\|�|�}t|�|jkrJ||j|jd�|_d|_n|jt|�8_|j|j|jd�S)z6Returns buffered bytes without advancing the position.Nri)r0rrr>)r�r�chunkrrr�peek�s
zZipExtFile.peekcCsdS�NTrr�rrr�readable�szZipExtFile.readablecCs|dks|dkrH|j|jd�}d|_d|_|jsD||�|j�7}q,|S||j}|t|j�krz|j|j|�}||_|S|t|j�}|j|jd�}d|_d|_|dkr�|js�|�|�}|t|�kr�||_||_||d|�7}q�||7}|t|�8}q�|S)z�Read and return up to n bytes.
        If the argument is omitted, None, or negative, data is read and returned until EOF is reached.
        Nrr-�rrr�_read1�MAX_Nr0)r�r�buf�endrVrrrr>�s4

zZipExtFile.readcCs@|jdkrdSt||j�|_|jr<|j|jkr<td|j��dS)NzBad CRC-32 for file %r)r"r�r#rrr!)r��newdatarrr�_update_crc�s

zZipExtFile._update_crccCs|dks|dkrR|j|jd�}d|_d|_|jsN|�|j�}|r,||7}qNq,|S||j}|t|j�kr�|j|j|�}||_|S|t|j�}|j|jd�}d|_d|_|dk�r|j�s|�|�}|t|�kr�||_||_||d|�7}�q|r�||7}�qq�|S)z7Read up to n bytes with at most one read() system call.Nrr-r<)r�rr?rVr@rrr�read1�s>


zZipExtFile.read1cCs"|js|dkrdS|jtkrH|jj}|t|�krR||�|t|��7}n
|�|�}|jtkrj|jdk|_nx|jtkr�t	||j
�}|j�||�}|jjp�|jdko�|jj|_|jr�||j�
�7}n |j�|�}|jjp�|jdk|_|d|j�}|jt|�8_|jdk�rd|_|�|�|S)Nrr-T)rrrrZunconsumed_tailr0�_read2rrr_�
MIN_READ_SIZEr�r�r�rrBr
rrrr=�s4




�
zZipExtFile._read1cCsd|jdkrdSt||j�}t||j�}|j�|�}|jt|�8_|sLt�|jdk	r`|�|�}|S)Nrr-)	rr_rE�minrr>r0�EOFErrorr*r
rrrrD	s


zZipExtFile._read2cs&z|jr|j��W5t���XdSr�)�superr	rrr��r�rrr	szZipExtFile.closecCs|jSr�)r$r�rrrr szZipExtFile.seekablercCs>|jst�d��|��}|dkr&|}n.|dkr8||}n|dkrL|j|}ntd��||jkrd|j}|dkrpd}||}||j}|dkr�|t|j�kr�||_d}nf|dk�r
|j	�
|j�|j|_
|j|_|j|_d|_d|_t|j�|_d|_|}|jdk	�r
|��|dk�r6t|j|�}|�|�||8}�q
|��S)N�!underlying stream is not seekablerrrzCwhence must be os.SEEK_SET (0), os.SEEK_CUR (1), or os.SEEK_END (2)r-F)r$r3�UnsupportedOperationrZr'r|rr0rrrDr%r(r#r&rrr�rrrr*r+rF�
MAX_SEEK_READr>)r�rTrZcurr_posZnew_posZread_offsetZbuff_offsetZread_lenrrrrD#sH






zZipExtFile.seekcCs0|jst�d��|j|jt|j�|j}|S)NrJ)r$r3rKr'rr0rr)r�ZfileposrrrrZSs
zZipExtFile.tell)NF)r�)r)r�)r)rrrrr>rErLr�r+r�r5r9r;r>rBrCr=rDr	rrDrZ�
__classcell__rrrIrrs*�
3



!
%$
0rcs@eZdZdd�Zedd��Zdd�Zdd�Z�fd	d
�Z�Z	S)�
_ZipWriteFilecCs8||_||_||_t|j|j�|_d|_d|_d|_	dSr)
�_zinfo�_zip64�_zipfiler�rerf�_compressor�
_file_size�_compress_size�_crc)r��zfr�r�rrrr�[s�z_ZipWriteFile.__init__cCs|jjSr�)rQr<r�rrrresz_ZipWriteFile._fileobjcCsdSr:rr�rrr�writableisz_ZipWriteFile.writablecCsf|jrtd��t|�}|j|7_t||j�|_|jrV|j�|�}|jt|�7_|j	�
|�|S)NzI/O operation on closed file.)r0r|r0rSr�rUrRr�rTrr)r�rV�nbytesrrrrlsz_ZipWriteFile.writec	sb|jr
dS�zFt���|jrR|j��}|jt|�7_|j	�
|�|j|j_n
|j
|j_|j|j_|j
|j_|jjd@r�|jr�dnd}|j	�
t�|t|jj|jj|jj��|j	��|j_nn|js�|j
tkr�td��|jtkr�td��|j	��|j_|j	�|jj�|j	�
|j�|j��|j	�|jj�|jj�|j�|j|jj|jj <W5d|j_XdS)NFrz<LLQQz<LLLLz+File size unexpectedly exceeded ZIP64 limitz1Compressed size unexpectedly exceeded ZIP64 limit)!r0rQrrHr	rRr�rTr0rrrOrprSrUrorqrjrPrFr��
_DD_SIGNATURErZ�	start_dirr�r�rDrnr��filelistr1�
NameToInforB)r�r?r�rIrrr	xsF




�
�
�z_ZipWriteFile.close)
rrrr��propertyrrWrr	rMrrrIrrNZs

rNc@s$eZdZdZdZdZdeddfdd�dd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
d=dd�Zdd�Zdd�Zdd�Zedd��Zejdd��Zd>dd �Zd?d!d"�d#d$�Zd@d%d&�ZdAd'd(�ZdBd)d*�Zed+d,��Zd-d.�Zd/d0�ZdCd1d2�ZdDd3d4�Zd5d6�Z d7d8�Z!d9d:�Z"d;d<�Z#dS)Erai Class with methods to open, read, write, close, list zip files.

    z = ZipFile(file, mode="r", compression=ZIP_STORED, allowZip64=True,
                compresslevel=None)

    file: Either the path to the file, or a file-like object.
          If it is a path, the file will be opened and closed by ZipFile.
    mode: The mode can be either read 'r', write 'w', exclusive create 'x',
          or append 'a'.
    compression: ZIP_STORED (no compression), ZIP_DEFLATED (requires zlib),
                 ZIP_BZIP2 (requires bz2) or ZIP_LZMA (requires lzma).
    allowZip64: if True ZipFile will create files with ZIP64 extensions when
                needed, otherwise it will raise an exception when this would
                be necessary.
    compresslevel: None (default for the given compression type) or an integer
                   specifying the level to pass to the compressor.
                   When using ZIP_STORED or ZIP_LZMA this keyword has no effect.
                   When using ZIP_DEFLATED integers 0 through 9 are accepted.
                   When using ZIP_BZIP2 integers 1 through 9 are accepted.

    N�rTr�c
	CsP|dkrtd��t|�||_d|_d|_i|_g|_||_||_||_	d|_
d|_||_t
|tj�rpt�|�}t
|t�r�d|_||_ddd	d
dddd
�}||}zt�||�|_Wq�tk
r�||kr�||}Yq��Yq�Xq�q�nd|_||_t|dd�|_d|_t��|_d|_d|_�z|dk�r4|��n�|dk�r�d|_z|j� �|_!Wn2t"tfk
�r�t#|j�|_d|_!d|_Yn6Xz|j�$|j!�Wn t"tfk
�r�d|_YnXnf|dk�rz|��|j�$|j!�Wn6t%k
�r|j�$dd�d|_|j� �|_!YnXntd��Wn$|j}	d|_|�&|	��YnXdS)z]Open the ZIP file with mode read 'r', write 'w', exclusive create 'x',
        or append 'a'.)r^�w�x�az+ZipFile requires mode 'r', 'w', 'x', or 'a'FrNr-r?�w+b�x+b�r+b�wbZxb)r^r_r`rardrbrcrr!Tr^)r_r`rarz"Mode must be 'r', 'w', 'x', or 'a')'r|r��_allowZip64�
_didModify�debugr\r[r�r�r r��_comment�_strict_timestampsr�ryr�r��str�_filePassedrBr3rAr<r:�getattr�_fileRefCnt�	threading�RLockrr$r�_RealGetContentsrZrZr)rrDr�_fpclose)
r�rr r��
allowZip64r�r�ZmodeDictr�r<rrrr��s�

�





zZipFile.__init__cCs|Sr�rr�rrr�	__enter__szZipFile.__enter__cCs|��dSr��r	)r��type�value�	tracebackrrr�__exit__szZipFile.__exit__cCs�d|jj|jjfg}|jdk	rd|jr8|�d|j�n|jdk	rR|�d|j�|�d|j�n
|�d�|�d�d�|�S)Nr.z file=%rz filename=%rz mode=%rr/r�r�)	r�rrr<rlr1rBr r2r1rrrr�"s�



zZipFile.__repr__cCs�|j}zt|�}Wntk
r.td��YnX|s<td��|jdkrNt|�|t}|t}|t|_	|t
||}|ttkr�|t
t8}|jdkr�||}td|||�|||_|�|jd�|�|�}t�|�}d}||k�r�|�t�}	t|	�tk�r
td��t�t|	�}	|	ttk�r,td��|jdk�r@t|	�|�|	t�}
|	d}|d	@�rl|
�d
�}
n
|
�d�}
t|
�}|�|	t�|_|�|	t �|_!|	t"|_#|	dd�\|_$|_%|_&|_'|_(|_)}
}|_*|_+|_,|j&t-k�r�t.d
|j&d��|	dd�\|_/|_0|_1|
|_2|d?d|d?d@|d@|
d?|
d?d@|
d@df|_3|�4�|j#||_#|j5�6|�||j7|j8<|t|	t|	t|	t }|jdkr�td|�q�dS)z/Read in the table of contents for the ZIP file.zFile is not a zip filerrzgiven, inferred, offsetrzTruncated central directoryz&Bad magic number for central directoryr!r�r��cp437rzzip file version %.1fr%r(r+r$rur�r&r�totalN)9r<r9r:rrh�printrQrR�_ECD_COMMENTri�
_ECD_LOCATIONrLrKrIrErZrDr>r3�BytesIO�sizeCentralDirr0rFr/�structCentralDir�
_CD_SIGNATURE�stringCentralDir�_CD_FILENAME_LENGTH�decoder
�_CD_EXTRA_FIELD_LENGTHr3�_CD_COMMENT_LENGTHrb�_CD_LOCAL_HEADER_OFFSETrnrWrgrhrirjrerorprq�MAX_EXTRACT_VERSIONr�rkrlrmrrrdr�r[r1r\rB)r�r<rUZsize_cdZ	offset_cd�concatZinferredrVr{�centdirrB�flagsr`�t�drrrrq0s�











��

���
zZipFile._RealGetContentscCsdd�|jD�S)z+Return a list of file names in the archive.cSsg|]
}|j�qSrr�)�.0rVrrr�
<listcomp>�sz$ZipFile.namelist.<locals>.<listcomp>�r[r�rrr�namelist~szZipFile.namelistcCs|jS)zJReturn a list of class ZipInfo instances for files in the
        archive.r�r�rrr�infolist�szZipFile.infolistcCsLtdd|d�|jD]0}d|jdd�}td|j||jf|d�qdS)z+Print a table of contents for the zip file.z%-46s %19s %12s)z	File NamezModified    ZSize�rz%d-%02d-%02d %02d:%02d:%02dNr"z
%-46s %s %12d)r|r[rdrBrq)r�rr��daterrr�printdir�s�
�zZipFile.printdirc
Cs^d}|jD]N}z*|�|jd��}|�|�r,q W5QRXWq
tk
rV|jYSXq
dS)z%Read all the files and check the CRC.ir^N)r[rArBr>r)r�Z
chunk_sizer��frrr�testzip�s

zZipFile.testzipcCs$|j�|�}|dkr td|��|S)z,Return the instance of ZipInfo given 'name'.Nz(There is no item named %r in the archive)r\r��KeyError)r�r!�inforrr�getinfo�s�zZipFile.getinfocCs6|r t|t�s tdt|�j��|r,||_nd|_dS)z)Set default password for encrypted files.�pwd: expected bytes, got %sN)r�r��	TypeErrorrvrr�)r�r�rrr�setpassword�s
zZipFile.setpasswordcCs|jS)z.The comment text associated with the ZIP file.)rir�rrrrb�szZipFile.commentcCs^t|t�stdt|�j��t|�tkrNddl}|jdtdd�|dt�}||_	d|_
dS)Nzcomment: expected bytes, got %srz3Archive comment is too long; truncating to %d bytesr��
stacklevelT)r�r�r�rvrr0�ZIP_MAX_COMMENT�warnings�warnrirg)r�rbr�rrrrb�s
��c
Cs.|�|d|��}|��W5QR�SQRXdS)zReturn file bytes for name.r^N�rAr>)r�r!r�r<rrrr>�szZipFile.readF��force_zip64cs|dkrtd��|r0t|t�s0tdt|�j��|rD|dkrDtd���jsRtd��t|t�rb|}n,|dkr�t|�}�j|_	�j
|_n
��|�}|dkr��j
||d�S�jr�td���jd	7_t�j|j�j�j�fd
d��}�z|�t�}t|�tk�rtd��t�t|�}|ttk�r&td
��|�|t�}|t�rL|�|t�|jd@�r`t d��|jd@�rtt d��|t!d@�r�|�"d�}	n
|�"d�}	|	|j#k�r�td|j#|f��|jd	@}
|
�r�|�s҈j$}|�s�t%d|��nd}t&||||d�WS|�'��YnXdS)auReturn file-like object for 'name'.

        name is a string for the file name within the ZIP file, or a ZipInfo
        object.

        mode should be 'r' to read a file already in the ZIP file, or 'w' to
        write to a file newly added to the archive.

        pwd is the password to decrypt files (only used for reading).

        When writing, if the file size is not known in advance but may exceed
        2 GiB, pass force_zip64 to use the ZIP64 format, which can handle large
        files.  If the size is known in advance, it is best to pass a ZipInfo
        instance for name, with zinfo.file_size set.
        >r_r^zopen() requires mode "r" or "w"r�r_z'pwd is only supported for reading filesz2Attempt to use ZIP archive that was already closedr�rrcs�jSr�)rrr�rr�<lambda>�r-zZipFile.open.<locals>.<lambda>zTruncated file headerz Bad magic number for file header� z$compressed patched data (flag bit 5)�@zstrong encryption (flag bit 6)r�r�rzz/File name in directory %r and header %r differ.z6File %r is encrypted, password required for extractionNT)(r|r�r�r�rvrr<r
r�rer�rfr��_open_to_writerrnrrnrrrr>�sizeFileHeaderr0rrFr/r��
_FH_SIGNATUREr��_FH_FILENAME_LENGTH�_FH_EXTRA_FIELD_LENGTHrjr��_FH_GENERAL_PURPOSE_FLAG_BITSr�rcr�r�rr	)r�r!r r�r�r�Zzef_fileZfheader�fnameZ	fname_strZis_encryptedrr�rrA�s~�




�


��
�zZipFile.opencCs�|r|jstd��|jr td��t|d�s0d|_d|_d|_d|_|jt	krZ|jdO_|j
sn|jdO_|jszd|_|jo�|p�|jdtk}|j
r�|j
�|j�|j
��|_|�|�d	|_|j
�|�|��d	|_t|||�S)
NzHforce_zip64 is True, but allowZip64 was False when opening the ZIP file.zzCan't write to the ZIP file while there is another write handle open on it. Close the first handle before opening another.rqrrr��g�������?T)rfr|rr@rqrprorjrerr$rmr�r<rDrZrZrn�_writecheckrgrr�rN)r�r�r�r�rrrr�(s8
�

�
zZipFile._open_to_writecCs*|dkrt��}n
t�|�}|�|||�S)a#Extract a member from the archive to the current working directory,
           using its full name. Its file information is extracted as accurately
           as possible. `member' may be a filename or a ZipInfo object. You can
           specify a different directory using `path'.
        N)ry�getcwdr��_extract_member)r��memberr�r�rrr�extractSs

zZipFile.extractcCsH|dkr|��}|dkr"t��}n
t�|�}|D]}|�|||�q0dS)z�Extract all members from the archive to the current working
           directory. `path' specifies a different directory to extract to.
           `members' is optional and must be a subset of the list returned
           by namelist().
        N)r�ryr�r�r�)r�r��membersr�r,rrr�
extractall`s

zZipFile.extractallcCs^|j}|s(d}t�|dt|��}||_|�|�}dd�|�|�D�}|�dd�|D��}|S)z;Replace bad characters and remove trailing dots from parts.z:<>|"?*�_css|]}|�d�VqdS)�.N)�rstrip�r�r`rrr�	<genexpr>{sz1ZipFile._sanitize_windows_name.<locals>.<genexpr>css|]}|r|VqdSr�rr�rrrr�}s)�!_windows_illegal_name_trans_tablerk�	maketransr0�	translate�splitr2)r�r��pathsep�tableZillegalrrr�_sanitize_windows_nameqs
zZipFile._sanitize_windows_namec
sLt|t�s|�|�}|j�dtjj�}tjjrB|�tjjtjj�}tj�	|�d}dtjj
tjjf�tjj��fdd�|�
tjj�D��}tjjdkr�|�|tjj�}tj�||�}tj�|�}tj�|�}|r�tj�|�s�t�|�|���rtj�|��st�|�|S|j||d��(}t|d��}t�||�W5QRXW5QRX|S)	zbExtract the ZipInfo object 'member' to a physical
           file on the path targetpath.
        rvrr�c3s|]}|�kr|VqdSr�rr��Zinvalid_path_partsrrr��s�z*ZipFile._extract_member.<locals>.<genexpr>�\)r�re)r�r
r�rBr{ryr�rzr�r��curdir�pardirr2r�r�r��dirname�exists�makedirsr�r��mkdirrA�shutil�copyfileobj)r�r�Z
targetpathr�r�Z	upperdirs�source�targetrr�rr��s2

&


� zZipFile._extract_membercCs�|j|jkr(ddl}|jd|jdd�|jdkr:td��|jsHtd��t|j�|j	s�d}t
|j�tkrpd	}n|j
tkr�d
}n|jtkr�d}|r�t|d��dS)
z6Check for errors before writing a file to the archive.rNzDuplicate name: %rrr��r_r`raz&write() requires mode 'w', 'x', or 'a'z4Attempt to write ZIP archive that was already closed�Files countZFilesizezZipfile size� would require ZIP64 extensions)rBr\r�r�r r|r<r�rerfr0r[�ZIP_FILECOUNT_LIMITrqr�rnr
)r�r�r��requires_zip64rrrr��s,
�


�zZipFile._writecheckc
CsP|jstd��|jrtd��tj|||jd�}|��rDd|_d|_n0|dk	rT||_	n|j
|_	|dk	rl||_n|j|_|���r|j
��|jr�|j�|j�|j��|_|j	tkr�|jdO_|�|�d|_|j�|�||j|j<|j�|�d��|j��|_W5QRXn<t|d	��,}|�|d
��}t�||d�W5QRXW5QRXdS)zLPut the bytes from filename into the archive under the name
        arcname.�7Attempt to write to ZIP archive that was already closedz>Can't write to ZIP archive while an open writing handle existsr�rNrTFr?r_i ) r<r|rr
r�rjr�rprorer�rfr�rr$rDrZrZrnrrjr�rgr[r1r\rBrr�rAr�r�)r�rBr�rer�r��src�destrrrr�sF���


z
ZipFile.writec
Cs�t|t�r|�d�}t|t�sxt|t�t���dd�d�}|j|_|j|_	|j
ddkrpd|_|jdO_q|d	|_n|}|js�t
d
��|jr�t
d��|dk	r�||_|dk	r�||_	t|�|_|j�*|j|dd
��}|�|�W5QRXW5QRXdS)aWrite a file into the archive.  The contents is 'data', which
        may be either a 'str' or a 'bytes' instance; if it is a 'str',
        it is encoded as UTF-8 first.
        'zinfo_or_arcname' is either a ZipInfo instance or
        the name of the file in the archive.r�Nr")rBrdr�rvi�Ar)r�r�z?Can't write to ZIP archive while an open writing handle exists.r_)r )r�rkr�r
r�r�r�rer�rfrBrmr<r|rr0rqrrAr)r�Zzinfo_or_arcnamerVrer�r�r�rrr�writestr�s:


���
zZipFile.writestrcCs|��dS)z2Call the "close()" method in case the user forgot.Nrur�rrr�__del__szZipFile.__del__c	Cs||jdkrdS|jrtd��zB|jdkr\|jr\|j�"|jrJ|j�|j	�|�
�W5QRXW5|j}d|_|�|�XdS)zOClose the file, and for mode 'w', 'x' and 'a' write the ending
        records.NzvCan't close the ZIP file while there is an open writing handle on it. Close the writing handle before closing the zip.r�)r<rr|rrr rgrr$rDrZ�_write_end_recordrrrrr	s
z
ZipFile.closecCs�|jD�]D}|j}|ddd>|dd>B|dB}|dd>|d	d>B|ddB}g}|jtksr|jtkr�|�|j�|�|j�d
}d
}n|j}|j}|jtkr�|�|j�d
}n|j}|j}	d}
|�rt|	d�}	t	j
dd
t|�ddt|�f|��|	}	t}
|j
tk�r$tt|
�}
n|j
tk�r:tt|
�}
t|
|j�}t|
|j�}zZ|��\}
}t	�
tt||j||j||j
|||j||t|
�t|	�t|j�d|j|j|�}Wnltk
�rttt||j||j|j |j
|||j||t|j!�t|	�t|j�d|j|j|ft"j#d��YnX|j$�%|�|j$�%|
�|j$�%|	�|j$�%|j�q|j$�&�}t|j�}||j'}|j'}d}|t(k�r�d}n|tk�r�d}n|tk�r�d}|�r$|j)�s�t*|d��t	�
t+t,ddddd||||�}|j$�%|�t	�
t-t.d|d�}|j$�%|�t/|d�}t/|d
�}t/|d
�}t	�
t0t1dd||||t|j2��	}|j$�%|�|j$�%|j2�|j3dk�rt|j$�4�|j$�5�dS)Nrrur$rr!rrr&r r�)rr,�Qrr�r�zCentral directory offsetzCentral directory sizer��,rrra)6r[rdrqr�rpr1rnr3r8rFr�r0r�rerr_r�rr�rhrWr�r�r�rgrirorbrlrm�DeprecationWarningr|rjrBr}�stderrr<rrZrZr�rfr
rJrKrGrHrFr]r\rir �truncater�)r�r�r�r�r�r3rqrprnZ
extra_datar�rhrWrBrjr�Zpos2ZcentDirCountZcentDirSizeZ
centDirOffsetr�Zzip64endrecZzip64locrecrUrrrr�5s$$
�


���
���





���


�
zZipFile._write_end_recordcCs4|jdkst�|jd8_|js0|js0|��dS)Nrr)rn�AssertionErrorrlr	rrrrrr�szZipFile._fpclose)N)N)r^N)F)NN)NNN)NNN)NN)$rrrrr<r�rr�rtryr�rqr�r�r�r�r�r�r]rb�setterr>rAr�r�r�r�r�r�r�rr�r�r	r�rrrrrrr�sT��ZN
	
		


b
+


*�
2�
)hc@s4eZdZdZdeddfdd�Zd
d	d
�Zdd�ZdS)rzDClass to create ZIP archives with Python library files and packages.r^Tr�cCstj|||||d�||_dS)N)r r�rs)rr��	_optimize)r�rr r�rs�optimizerrrr��s�zPyZipFile.__init__r�NcCs�t�|�}|rD||�sD|jr@tj�|�r,dnd}td||f�dStj�|�\}}tj�|��rhtj�|d�}tj�|��r�|r�d||f}n|}|jr�td|d|�|�	|d	d
�|�\}}	|jr�td|	�|�
||	�tt�|��}
|
�
d�|
D]�}tj�||�}tj�|�\}
}tj�|��rRtj�tj�|d���r�|j|||d�q�|d
kr�|�r~||��s~|jr�td|�q�|�	|d	d
�|�\}}	|j�r�td|	�|�
||	�q�n�|j�r�td|�tt�|��D]�}tj�||�}tj�|�\}
}|d
k�r�|�r,||��s,|j�r�td|��q�|�	|d	d
�|�\}}	|j�rVtd|	�|�
||	��q�nP|d
d�d
k�r�td��|�	|d	d
�|�\}}	|j�r�td|	�|�
||	�dS)a�Add all files from "pathname" to the ZIP archive.

        If pathname is a package directory, search the directory and
        all package subdirectories recursively for all *.py and enter
        the modules into the archive.  If pathname is a plain
        directory, listdir *.py and enter all modules.  Else, pathname
        must be a Python *.py file and the module will be put into the
        archive.  Added modules are always module.pyc.
        This method will compile the module.py into module.pyc if
        necessary.
        If filterfunc(pathname) is given, it is called with every argument.
        When it is False, the file or directory is skipped.
        r�rz%s %r skipped by filterfuncNz__init__.py�%s/%szAdding package in�asr���ZAdding)�
filterfunc�.pyzfile %r skipped by filterfunczAdding files from directoryz.Files added with writepy() must end with ".py"zAdding file)ryr�rhr�r�r|r�r2�isfile�
_get_codenamer�sorted�listdir�remove�splitext�writepyr�)r��pathname�basenamer�Zlabel�dirr!Zinitnamer�r�ZdirlistrBr��rootZextrrrr��s�


��


�
�
zPyZipFile.writepyc
sd�fdd�	}|d}|d}tjj|dd�}tjj|dd�}tjj|d	d�}�jdk�r\tj�|�r�t�|�jt�|�jkr�|}	}
n�tj�|�r�t�|�jt�|�jkr�|}
|}	n�tj�|�r�t�|�jt�|�jkr�|}
|}	nvtj�|��rt�|�jt�|�jk�r|}
|}	nD||��rRt	j
jd
k�r4|}
nt	j
jdk�rH|}
n|}
|}	n|}
}	n��jd
k�rr|}
|}	n<|}	�jdk�r�|}
n&�jd	k�r�|}
nd��j�}t
|��tj�|
��r�t�|
�jt�|�jk�s�||�jd��s�|}
}	tj�|	�d}|�rd
||f}|
|fS)aReturn (filename, archivename) for the path.

        Given a module name path, return the correct file path and
        archive name, compiling if necessary.  For example, given
        /python/lib/string, return (/python/lib/string.pyc, string).
        r�c
sfddl}�jrtd|�z|j|d|d�Wn4|jk
r`}zt|j�WY�dSd}~XYnXdS)NrZ	CompilingT)�doraiser�F)�
py_compilerhr|�compile�PyCompileError�msg)rr�r��errr�rr�_compiles

z)PyZipFile._get_codename.<locals>._compiler�z.pycr�)�optimizationrrrz"invalid value for 'optimize': {!r})r�r�)r�)�	importlib�util�cache_from_sourcer�ryr�r�r�r�r}r�r��formatr|r�)
r�r�r�r�Zfile_pyZfile_pycZpycache_opt0Zpycache_opt1Zpycache_opt2r�r�r�Zarchivenamerr�rr��sj�
���

�zPyZipFile._get_codename)r�N)rrrrrr�r�r�rrrrr�s�

RcCst�t|�dd�S)a2
    Given a path with elements separated by
    posixpath.sep, generate all parents of that path.

    >>> list(_parents('b/d'))
    ['b']
    >>> list(_parents('/b/d/'))
    ['/b']
    >>> list(_parents('b/d/f/'))
    ['b/d', 'b']
    >>> list(_parents('b'))
    []
    >>> list(_parents(''))
    []
    rN)�	itertools�islice�	_ancestry)r�rrr�_parentsRsrccs4|�tj�}|r0|tjkr0|Vt�|�\}}qdS)aR
    Given a path with elements separated by
    posixpath.sep, generate all elements of that path

    >>> list(_ancestry('b/d'))
    ['b/d', 'b']
    >>> list(_ancestry('/b/d/'))
    ['/b/d', '/b']
    >>> list(_ancestry('b/d/f/'))
    ['b/d/f', 'b/d', 'b']
    >>> list(_ancestry('b'))
    ['b']
    >>> list(_ancestry(''))
    []
    N)r��	posixpathrzr�)r��tailrrrresrcCst�t|�j|�S)zZ
    Return items in minuend not in subtrahend, retaining order
    with O(1) lookup.
    )r�filterfalse�set�__contains__)ZminuendZ
subtrahendrrr�_differencesr
csHeZdZdZedd��Z�fdd�Zdd�Zdd	�Ze	d
d��Z
�ZS)�CompleteDirszk
    A ZipFile subclass that ensures that implied directories
    are always included in the namelist.
    cCs.tj�tt|��}dd�|D�}tt||��S)Ncss|]}|tjVqdSr�)rrz)r�r�rrrr��sz-CompleteDirs._implied_dirs.<locals>.<genexpr>)r�chain�
from_iterabler�r�_deduper
)�names�parentsZas_dirsrrr�
_implied_dirs�szCompleteDirs._implied_dirscs tt|���}|t|�|��Sr�)rHrr�r^r)r�rrIrrr��szCompleteDirs.namelistcCst|���Sr�)rr�r�rrr�	_name_set�szCompleteDirs._name_setcCs,|��}|d}||ko||k}|r(|S|S)zx
        If the name represents a directory, return that name
        as a directory (with the trailing slash).
        rv)r)r�r!rr�Z	dir_matchrrr�resolve_dir�szCompleteDirs.resolve_dircCsNt|t�r|St|t�s ||�Sd|jkr.t}|�|�}t|��t|��|S)zl
        Given a source (filename or zipfile), return an
        appropriate CompleteDirs subclass.
        r^)r�rrr �__new__�vars�update)r�r��resrrr�make�s



zCompleteDirs.make)rrrr�staticmethodrr�rrr�rrMrrrIrr�s

rcs,eZdZdZ�fdd�Z�fdd�Z�ZS)�
FastLookupzV
    ZipFile subclass to ensure implicit
    dirs exist and are resolved rapidly.
    c
s:t�t��|jW5QR�SQRXtt|���|_|jSr�)�
contextlib�suppressr)Z_FastLookup__namesrHrr�r�rIrrr��szFastLookup.namelistc
s:t�t��|jW5QR�SQRXtt|���|_|jSr�)rrr)Z_FastLookup__lookuprHrrr�rIrrr�szFastLookup._name_set)rrrrr�rrMrrrIrr�src@s�eZdZdZdZd#dd�Zedd��Zedd	��Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�ZeZed d!��Zd"S)$ru�
    A pathlib-compatible interface for zip files.

    Consider a zip file with this structure::

        .
        ├── a.txt
        └── b
            ├── c.txt
            └── d
                └── e.txt

    >>> data = io.BytesIO()
    >>> zf = ZipFile(data, 'w')
    >>> zf.writestr('a.txt', 'content of a')
    >>> zf.writestr('b/c.txt', 'content of c')
    >>> zf.writestr('b/d/e.txt', 'content of e')
    >>> zf.filename = 'abcde.zip'

    Path accepts the zipfile object itself or a filename

    >>> root = Path(zf)

    From there, several path operations are available.

    Directory iteration (including the zip file itself):

    >>> a, b = root.iterdir()
    >>> a
    Path('abcde.zip', 'a.txt')
    >>> b
    Path('abcde.zip', 'b/')

    name property:

    >>> b.name
    'b'

    join with divide operator:

    >>> c = b / 'c.txt'
    >>> c
    Path('abcde.zip', 'b/c.txt')
    >>> c.name
    'c.txt'

    Read text:

    >>> c.read_text()
    'content of c'

    existence:

    >>> c.exists()
    True
    >>> (b / 'missing.txt').exists()
    False

    Coercion to string:

    >>> str(c)
    'abcde.zip/b/c.txt'
    z>{self.__class__.__name__}({self.root.filename!r}, {self.at!r})r�cCst�|�|_||_dSr�)rrr��at)r�r�rrrrr�	sz
Path.__init__cCst�|jj|j�Sr�)�	functools�partialr�rArr�rrrrA	sz	Path.opencCst�|j�d��S�Nrv)rr�rr�r�rrrr!	sz	Path.namec
Os6|���$}tj|f|�|���W5QR�SQRXdSr�)rAr3�
TextIOWrapperr>)r��args�kwargs�strmrrr�	read_text	s
zPath.read_textc
Cs(|���}|��W5QR�SQRXdSr�r�)r�r$rrr�
read_bytes	s
zPath.read_bytescCst�|j�d��|j�d�kSr )rr�rr�)r�r�rrr�	_is_child"	szPath._is_childcCst|j|�Sr�)rr�)r�rrrr�_next%	sz
Path._nextcCs|jp|j�d�Sr )r�endswithr�rrrr�(	szPath.is_dircCs
|��Sr�)r�r�rrr�is_file+	szPath.is_filecCs|j|j��kSr�)rr�rr�rrrr�.	szPath.existscCs.|��std��t|j|j���}t|j|�S)NzCan't listdir a file)r�r|r�r(r�r��filterr')r�Zsubsrrr�iterdir1	szPath.iterdircCst�|jj|j�Sr�)rr2r�rBrr�rrr�__str__7	szPath.__str__cCs|jj|d�S)Nr�)�_Path__reprrr�rrrr�:	sz
Path.__repr__cCs t�|j|�}|�|j�|��Sr�)rr2rr(r�r)r��add�nextrrr�joinpath=	sz
Path.joinpathcCs(t�|j�d��}|r|d7}|�|�Sr )rr�rr�r()r�Z	parent_atrrr�parentC	szPath.parentN)r�)rrrrr.r�r]rAr!r%r&r'r(r�r*r�r,r-r�r1�__truediv__r2rrrrr�s*@


c
	s�ddl}d}|j|d�}|jdd�}|jdddd	d
�|jddd
ddd�|jdddddd�|jddddd
�|�|�}|jdk	r�|j}t|d��}|��}W5QRX|r�td�	|��td�n�|j
dk	r�|j
}t|d��}|��W5QRXn�|jdk	�r,|j\}}t|d��}|�
|�W5QRXn�|jdk	�r�|j�d�}	|j}
�fdd��t|	d��\}|
D]P}tj�|�}|�s�tj�tj�|��}|dtjtjfk�r�d}�|||��qfW5QRXdS) Nrz3A simple command-line interface for zipfile module.)�descriptionT)Zrequiredz-lz--list�	<zipfile>zShow listing of a zipfile)�metavar�helpz-ez	--extractr)r5z<output_dir>zExtract zipfile into target dir)�nargsr6r7z-cz--create�+)z<name>z<file>zCreate zipfile from sourcesz-tz--testzTest if a zipfile is validr^z.The following enclosed file is corrupted: {!r}zDone testingcsptj�|�r|�||t�nPtj�|�rl|r8|�||�tt�|��D]$}�|tj�||�tj�||��qFdSr�)	ryr�r�rrr�r�r�r2)rVr��zippathZnm��addToZiprrr<s	s�zmain.<locals>.addToZipr_r�)�argparse�ArgumentParserZadd_mutually_exclusive_group�add_argument�
parse_argsZtestrr�r|rr^r�r�r�Zcreate�popryr�r�r�r�r�)
r"r=r4�parser�groupr�rVZbadfiler�Zzip_name�filesr�r:rr;r�mainK	s\
�
�
�
�




rE�__main__)N)N)�rZbinasciir�importlib.utilr�r3rryrr�r�rFr}ror�rr�r��ImportErrorr�r��__all__�	Exceptionrr
rrr�r�r�rrrrrr�r�r�r�r]r\r�r[rLrMrNrOrPrQrRrar}r~r�r�r�r�Z_CD_CREATE_VERSIONZ_CD_CREATE_SYSTEMZ_CD_EXTRACT_VERSIONZ_CD_EXTRACT_SYSTEMZ
_CD_FLAG_BITSZ_CD_COMPRESS_TYPEZ_CD_TIMEZ_CD_DATEZ_CD_CRCZ_CD_COMPRESSED_SIZEZ_CD_UNCOMPRESSED_SIZEr�r�r�Z_CD_DISK_NUMBER_STARTZ_CD_INTERNAL_FILE_ATTRIBUTESZ_CD_EXTERNAL_FILE_ATTRIBUTESr�r�r�r�r�Z_FH_EXTRACT_VERSIONZ_FH_EXTRACT_SYSTEMr�Z_FH_COMPRESSION_METHODZ_FH_LAST_MOD_TIMEZ_FH_LAST_MOD_DATEZ_FH_CRCZ_FH_COMPRESSED_SIZEZ_FH_UNCOMPRESSED_SIZEr�r�rGrHrErJrKrIZ_CD64_SIGNATUREZ_CD64_DIRECTORY_RECSIZEZ_CD64_CREATE_VERSIONZ_CD64_EXTRACT_VERSIONZ_CD64_DISK_NUMBERZ_CD64_DISK_NUMBER_STARTZ_CD64_NUMBER_ENTRIES_THIS_DISKZ_CD64_NUMBER_ENTRIES_TOTALZ_CD64_DIRECTORY_SIZEZ_CD64_OFFSET_START_CENTDIRrYZStructr.r8r=r	rXr9�objectr
r�r�r�r�r�r�r�r�r�rrr4rrNrrrr�dict�fromkeysrr
rrrrErrrrr�<module>sl


�






+=q&�
&AN/2
=
__pycache__/aifc.cpython-38.pyc000064400000061604151153537610012324 0ustar00U

e5d.��
@sBdZddlZddlZddlZdddgZGdd�de�ZdZdd	�Zd
d�Z	dd
�Z
dd�Zdd�ZdZ
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zdd!lmZdd"lmZed#d$�Zd%ej_d&ej_d'ej_d(ej_d)ej_d*ej_Gd+d,�d,�Z Gd-d.�d.�Z!dAd/d�Z"dBd0d�Z#e$d1k�r>ddl%Z%e%j&d2d��sNe%j&�'d3�e%j&d2Z(e"e(d4���Z)e*d5e(�e*d6e)�+��e*d7e)�,��e*d8e)�-��e*d9e)�.��e*d:e)�/��e*d;e)�0��e%j&d<d��r4e%j&d<Z1e*d=e1�e"e1d>��6Z2e2�3e)�4��e)�5d?�Z6e6�s�q"e2�7e6��qW5QRXe*d@�W5QRXdS)CaJStuff to parse AIFF-C and AIFF files.

Unless explicitly stated otherwise, the description below is true
both for AIFF-C files and AIFF files.

An AIFF-C file has the following structure.

  +-----------------+
  | FORM            |
  +-----------------+
  | <size>          |
  +----+------------+
  |    | AIFC       |
  |    +------------+
  |    | <chunks>   |
  |    |    .       |
  |    |    .       |
  |    |    .       |
  +----+------------+

An AIFF file has the string "AIFF" instead of "AIFC".

A chunk consists of an identifier (4 bytes) followed by a size (4 bytes,
big endian order), followed by the data.  The size field does not include
the size of the 8 byte header.

The following chunk types are recognized.

  FVER
      <version number of AIFF-C defining document> (AIFF-C only).
  MARK
      <# of markers> (2 bytes)
      list of markers:
          <marker ID> (2 bytes, must be > 0)
          <position> (4 bytes)
          <marker name> ("pstring")
  COMM
      <# of channels> (2 bytes)
      <# of sound frames> (4 bytes)
      <size of the samples> (2 bytes)
      <sampling frequency> (10 bytes, IEEE 80-bit extended
          floating point)
      in AIFF-C files only:
      <compression type> (4 bytes)
      <human-readable version of compression type> ("pstring")
  SSND
      <offset> (4 bytes, not used by this program)
      <blocksize> (4 bytes, not used by this program)
      <sound data>

A pstring consists of 1 byte length, a string of characters, and 0 or 1
byte pad to make the total length even.

Usage.

Reading AIFF files:
  f = aifc.open(file, 'r')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods read(), seek(), and close().
In some types of audio files, if the setpos() method is not used,
the seek() method is not necessary.

This returns an instance of a class with the following public methods:
  getnchannels()  -- returns number of audio channels (1 for
             mono, 2 for stereo)
  getsampwidth()  -- returns sample width in bytes
  getframerate()  -- returns sampling frequency
  getnframes()    -- returns number of audio frames
  getcomptype()   -- returns compression type ('NONE' for AIFF files)
  getcompname()   -- returns human-readable version of
             compression type ('not compressed' for AIFF files)
  getparams() -- returns a namedtuple consisting of all of the
             above in the above order
  getmarkers()    -- get the list of marks in the audio file or None
             if there are no marks
  getmark(id) -- get mark with the specified id (raises an error
             if the mark does not exist)
  readframes(n)   -- returns at most n frames of audio
  rewind()    -- rewind to the beginning of the audio stream
  setpos(pos) -- seek to the specified position
  tell()      -- return the current position
  close()     -- close the instance (make it unusable)
The position returned by tell(), the position given to setpos() and
the position of marks are all compatible and have nothing to do with
the actual position in the file.
The close() method is called automatically when the class instance
is destroyed.

Writing AIFF files:
  f = aifc.open(file, 'w')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods write(), tell(), seek(), and
close().

This returns an instance of a class with the following public methods:
  aiff()      -- create an AIFF file (AIFF-C default)
  aifc()      -- create an AIFF-C file
  setnchannels(n) -- set the number of channels
  setsampwidth(n) -- set the sample width
  setframerate(n) -- set the frame rate
  setnframes(n)   -- set the number of frames
  setcomptype(type, name)
          -- set the compression type and the
             human-readable compression type
  setparams(tuple)
          -- set all parameters at once
  setmark(id, pos, name)
          -- add specified mark to the list of marks
  tell()      -- return current position in output file (useful
             in combination with setmark())
  writeframesraw(data)
          -- write audio frames without pathing up the
             file header
  writeframes(data)
          -- write audio frames and patch up the file header
  close()     -- patch up the file header and close the
             output file
You should set the parameters before the first writeframesraw or
writeframes.  The total number of frames does not need to be set,
but when it is set to the correct value, the header does not have to
be patched up.
It is best to first set all parameters, perhaps possibly the
compression type, and then write audio frames using writeframesraw.
When all frames have been written, either call writeframes(b'') or
close() to patch up the sizes in the header.
Marks can be added anytime.  If there are any marks, you must call
close() after all frames have been written.
The close() method is called automatically when the class instance
is destroyed.

When a file is opened with the extension '.aiff', an AIFF file is
written, otherwise an AIFF-C file is written.  This default can be
changed by calling aiff() or aifc() before the first writeframes or
writeframesraw.
�N�Error�open�openfpc@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/aifc.pyr�sl@QEcCs:zt�d|�d��dWStjk
r4td�YnXdS)N�>l�r��structZunpack�read�error�EOFError��filerrr	�
_read_long�srcCs:zt�d|�d��dWStjk
r4td�YnXdS)N�>Lrrrrrrr	�_read_ulong�srcCs:zt�d|�d��dWStjk
r4td�YnXdS)N�>h�rrrrrr	�_read_short�srcCs:zt�d|�d��dWStjk
r4td�YnXdS)N�>Hrrrrrrr	�_read_ushort�srcCs@t|�d��}|dkrd}n
|�|�}|d@dkr<|�d�}|S)N�r�)�ordr)r�length�data�dummyrrr	�_read_string�s

r!g�����cCs�t|�}d}|dkr d}|d}t|�}t|�}||krN|krNdkrXnnd}n0|dkrft}n"|d}|d|td	|d
�}||S)Nrr�����g�i�?lg@�?)rr�	_HUGE_VAL�pow)�f�expon�sign�himant�lomantrrr	�_read_float�s"r-cCs|�t�d|��dS)Nr��writer
�pack�r(�xrrr	�_write_short�sr3cCs|�t�d|��dS)Nrr.r1rrr	�
_write_ushort�sr4cCs|�t�d|��dS)Nr
r.r1rrr	�_write_long�sr5cCs|�t�d|��dS)Nrr.r1rrr	�_write_ulong�sr6cCsRt|�dkrtd��|�t�dt|���|�|�t|�d@dkrN|�d�dS)N�z%string exceeds maximum pstring length�Brr�)�len�
ValueErrorr/r
r0)r(�srrr	�
_write_string�s
r=c	Cs�ddl}|dkrd}|d}nd}|dkr8d}d}d}n�|�|�\}}|dks^|dks^||krp|dB}d}d}nh|d}|dkr�|�||�}d}||B}|�|d�}|�|�}t|�}|�||d�}|�|�}t|�}t||�t||�t||�dS)	Nrr#r"i@rr$i�?� )�mathZfrexpZldexpZfloor�intr4r6)	r(r2r?r*r)r+r,ZfmantZfsmantrrr	�_write_float�s8




rA)�Chunk)�
namedtuple�_aifc_paramsz7nchannels sampwidth framerate nframes comptype compnamez3Number of audio channels (1 for mono, 2 for stereo)zSample width in byteszSampling frequencyzNumber of audio framesz(Compression type ("NONE" for AIFF files)zRA human-readable version of the compression type
('not compressed' for AIFF files)c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�ZdS)2�	Aifc_readNcCs8d|_d|_g|_d|_||_t|�}|��dkr:td��|�d�}|dkrTd|_	n|dkrdd|_	ntd��d|_
d|_d|_zt|j�}Wnt
k
r�Y�qYnX|��}|d	kr�|�|�d|_
nH|d
kr�||_|�d�}d|_n(|dkr�t|�|_n|d
k�r|�|�|��qx|j
�r,|j�s4td��dS)Nr�FORMz file does not start with FORM idr�AIFF�AIFCrznot an AIFF or AIFF-C file�COMM�SSND��FVER�MARKz$COMM chunk and/or SSND chunk missing)�_version�_convert�_markers�	_soundpos�_filerBZgetnamerr�_aifcZ_comm_chunk_read�_ssnd_chunk�_ssnd_seek_neededr�_read_comm_chunkr�	_readmark�skip)�selfr�chunkZformdataZ	chunknamer rrr	�initfp4sH





zAifc_read.initfpcCsLt|t�r>t�|d�}z|�|�WqH|���YqHXn
|�|�dS)N�rb)�
isinstance�str�builtinsrr[�close�rYr(Zfile_objectrrr	�__init__\s

zAifc_read.__init__cCs|S�Nr�rYrrr	�	__enter__hszAifc_read.__enter__cGs|��dSrc�r`�rY�argsrrr	�__exit__kszAifc_read.__exit__cCs|jSrc)rRrdrrr	�getfpqszAifc_read.getfpcCsd|_d|_dS)Nrr)rUrQrdrrr	�rewindtszAifc_read.rewindcCs |j}|dk	rd|_|��dSrc)rRr`�rYrrrr	r`xszAifc_read.closecCs|jSrc)rQrdrrr	�tell~szAifc_read.tellcCs|jSrc)�
_nchannelsrdrrr	�getnchannels�szAifc_read.getnchannelscCs|jSrc)�_nframesrdrrr	�
getnframes�szAifc_read.getnframescCs|jSrc)�
_sampwidthrdrrr	�getsampwidth�szAifc_read.getsampwidthcCs|jSrc)�
_frameraterdrrr	�getframerate�szAifc_read.getframeratecCs|jSrc��	_comptyperdrrr	�getcomptype�szAifc_read.getcomptypecCs|jSrc��	_compnamerdrrr	�getcompname�szAifc_read.getcompnamecCs*t|��|��|��|��|��|���Src)rDrorsrurqrxr{rdrrr	�	getparams�s�zAifc_read.getparamscCst|j�dkrdS|jS�Nr�r:rPrdrrr	�
getmarkers�szAifc_read.getmarkerscCs2|jD]}||dkr|Sqtd�|���dS�Nrzmarker {0!r} does not exist�rPr�format�rY�id�markerrrr	�getmark�s

zAifc_read.getmarkcCs*|dks||jkrtd��||_d|_dS)Nrzposition not in ranger)rprrQrU)rY�posrrr	�setpos�szAifc_read.setposcCs�|jrD|j�d�|j�d�}|j|j}|r>|j�|d�d|_|dkrPdS|j�||j�}|jrv|rv|�|�}|jt|�|j|j	|_|S)NrrKr)
rUrT�seekrrQ�
_framesizerOr:rnrr)rY�nframesr r�rrrr	�
readframes�s 

�
zAifc_read.readframescCsddl}|�|d�S�Nrr)�audioopZalaw2lin�rYrr�rrr	�	_alaw2lin�szAifc_read._alaw2lincCsddl}|�|d�Sr�)r�Zulaw2linr�rrr	�	_ulaw2lin�szAifc_read._ulaw2lincCs2ddl}t|d�sd|_|�|d|j�\}|_|S�Nr�_adpcmstater)r��hasattrr�Z	adpcm2linr�rrr	�
_adpcm2lin�s

zAifc_read._adpcm2lincCsVt|�|_t|�|_t|�dd|_tt|��|_|jdkrFtd��|jdkrXtd��|j|j|_	|j
�rFd}|jdkr�d}t�
d�d	|_|�d
�|_|r�t|j�d��}|d@dkr�|d}|j||_|j�dd�t|�|_|jdk�rR|jd
k�r
|j|_n4|jdk�r |j|_n|jdk�r6|j|_ntd��d|_nd|_d|_dS)N�rKr�bad sample width�bad # of channels�rzWarning: bad COMM chunk size�rr"�NONE�G722��ulaw�ULAW��alaw�ALAW�unsupported compression typer�not compressed)rrnrrprrr@r-rtrr�rSZ	chunksize�warnings�warnrrwrrr�r!rzr�rOr�r�)rYrZZkludgerrrr	rV�sD









zAifc_read._read_comm_chunkcCs�t|�}zDt|�D]6}t|�}t|�}t|�}|s6|r|j�|||f�qWnDtk
r�dt|j�t|j�dkrxdnd|f}t�	|�YnXdS)Nz;Warning: MARK chunk contains only %s marker%s instead of %sr�r<)
r�rangerr!rP�appendrr:r�r�)rYrZZnmarkers�ir�r��name�wrrr	rW�s��zAifc_read._readmark)rrrrRr[rbrerirjrkr`rmrorqrsrurxr{r|rr�r�r�r�r�r�rVrWrrrr	rEs2$(*rEc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Z d<d=�Z!d>d?�Z"d@dA�Z#dBdC�Z$dDdE�Z%dFdG�Z&dHdI�Z'dS)J�
Aifc_writeNcCs\t|t�rNt�|d�}z|�|�Wn|���YnX|�d�rXd|_n
|�|�dS)N�wbz.aiffr)r]r^r_rr[r`�endswithrSrarrr	rb/s

zAifc_write.__init__cCs^||_t|_d|_d|_d|_d|_d|_d|_d|_	d|_
d|_d|_g|_
d|_d|_dS)Nr�r�rr)rR�
_AIFC_versionrNrwrzrOrnrrrtrp�_nframeswritten�_datawritten�_datalengthrP�_marklengthrSrlrrr	r[?szAifc_write.initfpcCs|��dSrcrfrdrrr	�__del__PszAifc_write.__del__cCs|Srcrrdrrr	reSszAifc_write.__enter__cGs|��dSrcrfrgrrr	riVszAifc_write.__exit__cCs|jrtd��d|_dS)N�0cannot change parameters after starting to writer�r�rrSrdrrr	�aiff\szAifc_write.aiffcCs|jrtd��d|_dS)Nr�rr�rdrrr	�aifcaszAifc_write.aifccCs(|jrtd��|dkrtd��||_dS)Nr�rr�)r�rrn)rY�	nchannelsrrr	�setnchannelsfs
zAifc_write.setnchannelscCs|jstd��|jS)Nznumber of channels not set)rnrrdrrr	romszAifc_write.getnchannelscCs0|jrtd��|dks|dkr&td��||_dS)Nr�rrr�)r�rrr)rY�	sampwidthrrr	�setsampwidthrs
zAifc_write.setsampwidthcCs|jstd��|jS)Nzsample width not set)rrrrdrrr	rsyszAifc_write.getsampwidthcCs(|jrtd��|dkrtd��||_dS)Nr�rzbad frame rate)r�rrt)rY�	frameraterrr	�setframerate~s
zAifc_write.setframeratecCs|jstd��|jS)Nzframe rate not set)rtrrdrrr	ru�szAifc_write.getframeratecCs|jrtd��||_dS)Nr�)r�rrp)rYr�rrr	�
setnframes�szAifc_write.setnframescCs|jSrc�r�rdrrr	rq�szAifc_write.getnframescCs.|jrtd��|dkrtd��||_||_dS�Nr�)r�r�r�r�r�r�r�)r�rrwrz)rY�comptype�compnamerrr	�setcomptype�szAifc_write.setcomptypecCs|jSrcrvrdrrr	rx�szAifc_write.getcomptypecCs|jSrcryrdrrr	r{�szAifc_write.getcompnamecCsf|\}}}}}}|jrtd��|dkr.td��|�|�|�|�|�|�|�|�|�||�dSr�)r�rr�r�r�r�r�)rYZparamsr�r�r�r�r�r�rrr	�	setparams�s



zAifc_write.setparamscCs8|jr|jr|jstd��t|j|j|j|j|j|j�S)Nznot all parameters set)rnrrrtrrDrprwrzrdrrr	r|�s�zAifc_write.getparamscCs�|dkrtd��|dkr td��t|t�s2td��tt|j��D],}||j|dkr@|||f|j|<dSq@|j�|||f�dS)Nrzmarker ID must be > 0zmarker position must be >= 0zmarker name must be bytes)rr]�bytesr�r:rPr�)rYr�r�r�r�rrr	�setmark�s
zAifc_write.setmarkcCs2|jD]}||dkr|Sqtd�|���dSr�r�r�rrr	r��s

zAifc_write.getmarkcCst|j�dkrdS|jSr}r~rdrrr	r�szAifc_write.getmarkerscCs|jSrcr�rdrrr	rm�szAifc_write.tellcCszt|ttf�st|��d�}|�t|��t|�|j|j}|j	rN|�	|�}|j
�|�|j||_|j
t|�|_
dS)Nr8)r]r��	bytearray�
memoryview�cast�_ensure_header_writtenr:rrrnrOrRr/r�r�)rYrr�rrr	�writeframesraw�s
zAifc_write.writeframesrawcCs.|�|�|j|jks"|j|jkr*|��dSrc)r�r�rpr�r��_patchheader)rYrrrr	�writeframes�s


�zAifc_write.writeframescCs�|jdkrdSz^|�d�|jd@r<|j�d�|jd|_|��|j|jksb|j	|jksb|j
rj|��W5d|_|j}d|_|��XdS)Nrrr9)rRrOr`r�r�r/�
_writemarkersr�rpr�r�r�)rYr(rrr	r`�s$



��zAifc_write.closecCsddl}|�|d�Sr�)r�Zlin2alawr�rrr	�	_lin2alaw�szAifc_write._lin2alawcCsddl}|�|d�Sr�)r�Zlin2ulawr�rrr	�	_lin2ulawszAifc_write._lin2ulawcCs2ddl}t|d�sd|_|�|d|j�\}|_|Sr�)r�r�r�Z	lin2adpcmr�rrr	�
_lin2adpcms

zAifc_write._lin2adpcmcCsf|jsb|jdkr.|jsd|_|jdkr.td��|js<td��|jsJtd��|jsXtd��|�|�dS)N�r�r�r�r�r�rzRsample width must be 2 when compressing with ulaw/ULAW, alaw/ALAW or G7.22 (ADPCM)z# channels not specifiedzsample width not specifiedzsampling rate not specified)r�rwrrrrnrt�
_write_header)rYZdatasizerrr	r�
s

z!Aifc_write._ensure_header_writtencCs>|jdkr|j|_n&|jdkr(|j|_n|jdkr:|j|_dS)Nr�r�r�)rwr�rOr�r�rdrrr	�_init_compressions




zAifc_write._init_compressionc	CsJ|jr|jdkr|��|j�d�|js<||j|j|_|j|j|j|_|jd@rf|jd|_|jr�|jdkr�|jd|_|jd@r�|jd|_n0|jdkr�|jdd|_|jd@r�|jd|_z|j�	�|_
Wnttfk
r�d|_
YnX|�
|j�}|j�rB|j�d	�|j�d
�t|jd�t|j|j�n|j�d�|j�d�t|j|�t|j|j�|j
dk	�r�|j�	�|_t|j|j�|jd
k�r�t|jd�nt|j|jd�t|j|j�|j�r�|j�|j�t|j|j�|j�d�|j
dk	�r|j�	�|_t|j|jd�t|jd�t|jd�dS)Nr�rFr)r�r�r�r�rr��rrHrLrGrIr�rKrJr)rSrwr�rRr/rprnrrr�rm�_form_length_pos�AttributeError�OSError�_write_form_lengthr6rNr3�_nframes_posrArtr=rz�_ssnd_length_pos)rYZ
initlength�
commlengthrrr	r�%s^




zAifc_write._write_headercCs\|jr*dt|j�}|d@r$|d}d}nd}d}t|jd||jd|d|�|S)	Nr�r�r�rrrK�)rSr:rzr6rRr�)rY�
datalengthr�Z
verslengthrrr	r�Xs"����zAifc_write._write_form_lengthcCs�|j��}|jd@r,|jd}|j�d�n|j}||jkrd|j|jkrd|jdkrd|j�|d�dS|j�|j	d�|�
|�}|j�|jd�t|j|j�|j�|j
d�t|j|d�|j�|d�|j|_||_dS)Nrr9rrK)rRrmr�r/r�rpr�r�r�r�r�r�r6r�)rYZcurposr�r rrr	r�es*




��
zAifc_write._patchheadercCs�t|j�dkrdS|j�d�d}|jD]:}|\}}}|t|�dd}t|�d@dkr(|d}q(t|j|�|d|_t|jt|j��|jD]2}|\}}}t|j|�t|j|�t|j|�q�dS)NrrMrr�rK)r:rPrRr/r6r�r3r=)rYrr�r�r�r�rrr	r�{s"





zAifc_write._writemarkers)(rrrrRrbr[r�rerir�r�r�ror�rsr�rur�rqr�rxr{r�r|r�r�rrmr�r�r`r�r�r�r�r�r�r�r�r�rrrr	r�sJ	

3
r�cCsJ|dkrt|d�r|j}nd}|dkr.t|�S|dkr>t|�Std��dS)N�moder\)�rr\)r�r�z$mode must be 'r', 'rb', 'w', or 'wb')r�r�rEr�r�r(r�rrr	r�s
cCstjdtdd�t||d�S)NzBaifc.openfp is deprecated since Python 3.7. Use aifc.open instead.r)�
stacklevel)r�)r�r��DeprecationWarningrr�rrr	r�s
��__main__rz/usr/demos/data/audio/bach.aiffr�ZReadingznchannels =znframes   =zsampwidth =zframerate =zcomptype  =zcompname  =rZWritingr�izDone.)N)N)8�__doc__r
r_r��__all__�	Exceptionrr�rrrrr!r&r-r3r4r5r6r=rArZrB�collectionsrCrDr�r�r�r�r�r�rEr�rrr�sys�argvr��fnr(�printrorqrsrurxr{Zgn�gr�r|r�rr�rrrr	�<module>s~	

!�







__pycache__/_markupbase.cpython-38.opt-1.pyc000064400000016704151153537610014653 0ustar00U

e5d9�@sVdZddlZe�d�jZe�d�jZe�d�Ze�d�Ze�d�Z[Gdd	�d	�Z	dS)
z�Shared support for scanning document type declarations in HTML and XHTML.

This module is used as a foundation for the html.parser module.  It has no
documented public API and should not be used directly.

�Nz[a-zA-Z][-_.a-zA-Z0-9]*\s*z(\'[^\']*\'|"[^"]*")\s*z--\s*>z	]\s*]\s*>z]\s*>c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdZ	d
d�Z
d#dd�Zd$dd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"S)%�
ParserBaseziParser base class which provides some common support methods used
    by the SGML/HTML and XHTML parsers.cCs|jtkrtd��dS)Nz)_markupbase.ParserBase must be subclassed)�	__class__r�RuntimeError��self�r�#/usr/lib64/python3.8/_markupbase.py�__init__s
�zParserBase.__init__cCstd��dS)Nz.subclasses of ParserBase must override error())�NotImplementedError)r�messagerrr�error s�zParserBase.errorcCsd|_d|_dS)N�r��lineno�offsetrrrr�reset$szParserBase.resetcCs|j|jfS)z&Return current line number and offset.rrrrr�getpos(szParserBase.getposcCsb||kr|S|j}|�d||�}|rN|j||_|�d||�}||d|_n|j|||_|S)N�
r
)�rawdata�countr�rindexr)r�i�jrZnlines�posrrr�	updatepos0szParserBase.updatepos�c
Cs�|j}|d}|||d�dkr*|dS|||d�dkrBdSt|�}|||d�dkrh|�|�S||dkr~|�|�S|�||�\}}|dkr�|S|d	kr�d
|_||k�r�||}|dkr�||d|�}|d	kr�|�|�n
|�|�|dS|dk�r t||�}|�sdS|�	�}n�|dk�r<|�||�\}	}nt||jk�rR|d}n^|dk�r�|d	k�rx|�
|d|�}n$|d
k�r�|�d|�n
|�d�n|�d||�|dkr�|Sq�dS)N�r
�>)�-r���z--�[rZdoctyperz"'Z4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ>�linktype�attlist�element�linkz&unsupported '[' char in %s declarationz"unexpected '[' char in declarationz!unexpected %r char in declaration)r�len�
parse_comment�parse_marked_section�
_scan_name�_decl_othercharsZhandle_decl�unknown_decl�_declstringlit_match�end�_parse_doctype_subsetr)
rrrr�nZdecltype�c�data�m�namerrr�parse_declaration@sZ












�zParserBase.parse_declarationr
cCs�|j}|�|d|�\}}|dkr&|S|dkr@t�||d�}n4|dkrZt�||d�}n|�d||d|��|s|dS|r�|�d�}|�||d|��|�d�S)N�r>�rcdata�temp�ignore�cdata�include>�endif�else�ifz+unknown status keyword %r in marked sectionr)	rr(�_markedsectionclose�search�_msmarkedsectioncloser�startr*r,)rr�reportrZsectNamer�matchrrrr'�s
zParserBase.parse_marked_sectioncCsj|j}|||d�dkr$|�d�t�||d�}|s<dS|r`|�d�}|�||d|��|�d�S)N��<!--z"unexpected call to parse_comment()rr)rr�
_commentcloser>r@Zhandle_commentr,)rrrArrBrrrrr&�s

zParserBase.parse_commentc
Cs*|j}t|�}|}||k�r&||}|dk�r0|||d�}|dkrJdS|dkrp|�||d�|�d|�|d|kr�dS|d|kr�dS|||d�dkr�|j|d	d
�}|d	kr|Sq|�|d|�\}}|dkr�dS|dk�r|�||d�|�d|�t|d
|�}	|	||�}|d	k�r$|Sq|dk�r�|d|k�rLdS|�|d|�\}}|d	k�rn|S||dk�r$|d}q|dk�r�|d}||k�r�||���r�|d}�q�||k�r�||dk�r�|S|�||�|�d�ndSq|���r
|d}q|�||�|�d|�qdS)N�<rrz<!r
z*unexpected char in internal subset (in %r)rCrDr)rA>r#r"�notation�entityz)unknown declaration %r in internal subsetZ_parse_doctype_�%�;�]rz%unexpected char after internal subsetz%unexpected char %r in internal subset)rr%rrr&r(�getattr�isspace)
rr�declstartposrr.rr/�sr2Zmethrrrr-�sp


�








z ParserBase._parse_doctype_subsetcCsF|�||�\}}|dkrdS|j}d||d�krB|�d|�dSdS)Nrrr
)r(r�find)rrrNr2rrrrr�_parse_doctype_element�sz!ParserBase._parse_doctype_elementcCs�|j}|�||�\}}|||d�}|dkr2dS|dkrB|dS|�||�\}}|dkr^|S|||d�}|dkrzdS|dkr�d||d�kr�|�d|�d}ndS|||d���r�|d}q�||d�s�dSn|�||�\}}|||d�}|�sdS|dk�rDt||�}|�r&|��}ndS|||d�}|�sDdS|d	k�r�||d�d	k�rddS|�|d|�\}}|dk�r�|S|||d�}|�s�dS|dkrB|dSqBdS)
Nr
rrrr�(�)�'"�#)rr(rPrMr+r,)rrrNrr2rr/r1rrr�_parse_doctype_attlistsX





z!ParserBase._parse_doctype_attlistcCs�|�||�\}}|dkr|S|j}|||d�}|s:dS|dkrJ|dS|dkrnt||�}|sddS|��}q"|�||�\}}|dkr"|Sq"dS)Nrr
rrrT)r(rr+r,)rrrNr2rrr/r1rrr�_parse_doctype_notation=s"

z"ParserBase._parse_doctype_notationcCs�|j}|||d�dkrR|d}|||d�}|s:dS|��rP|d}q"qVq"n|}|�||�\}}|dkrr|S|j||d�}|s�dS|dkr�t||�}|r�|��}q�dSqr|dkr�|dS|�||�\}}|dkrr|SqrdS)Nr
rIrrrTr)rrMr(r+r,)rrrNrrr/r2r1rrr�_parse_doctype_entityTs4


z ParserBase._parse_doctype_entitycCs�|j}t|�}||krdSt||�}|r\|��}|��}|t|�|krLdS|��|��fS|�||�|�d|||d��dS)N)Nrzexpected name token at %r�)	rr%�_declname_match�group�strip�lowerr,rr)rrrNrr.r1rOr2rrrr(xs
�zParserBase._scan_namecCsdS)Nr)rr0rrrr*�szParserBase.unknown_declN)r
)r
)�__name__�
__module__�__qualname__�__doc__r	rrrrr)r3r'r&r-rQrVrWrXr(r*rrrrrs"
R

C9$r)
ra�re�compilerBrZr+rEr=r?rrrrr�<module>s


__pycache__/rlcompleter.cpython-38.opt-2.pyc000064400000006026151153537610014707 0ustar00U

e5d��@s~ddlZddlZddlZdgZGdd�d�Zdd�ZzddlZWnek
rXdZYn"Xe�	e�j
�e�dd��d	ZdS)
�N�	Completerc@s6eZdZddd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
rNcCs6|rt|t�std��|dkr&d|_nd|_||_dS)Nznamespace must be a dictionary�r)�
isinstance�dict�	TypeError�use_main_ns�	namespace)�selfr�r
�#/usr/lib64/python3.8/rlcompleter.py�__init__'szCompleter.__init__cCs�|jrtj|_|��sB|dkr>tr8t�d�t��dSdSndS|dkrld|kr`|�	|�|_
n|�|�|_
z|j
|WStk
r�YdSXdS)Nr�	��.)
r�__main__�__dict__r�strip�_readline_available�readlineZinsert_textZ	redisplay�attr_matches�matches�global_matches�
IndexError)r	�text�stater
r
r�completeBs$
zCompleter.completecCst|�r|d}|S)N�()�callable)r	�val�wordr
r
r�_callable_postfixaszCompleter._callable_postfixc	Cs�ddl}g}dh}t|�}|jD]J}|d|�|kr |�|�|dkrP|d}n|dkr`|d}|�|�q |jtjfD]J}|��D]<\}}|d|�|kr�||kr�|�|�|�|�	||��q�qx|S)Nr�__builtins__>�try�finally�:>�break�None�pass�continue�False�True�else� )
�keyword�len�kwlist�add�appendr�builtinsr�itemsr )	r	rr-r�seen�nrZnspacerr
r
rrfs$



zCompleter.global_matchesc	Cshddl}|�d|�}|sgS|�dd�\}}zt||j�}Wntk
rTgYSXtt|��}|�d�t	|d�r�|�
d�|�t|j
��g}t|�}	|dkr�d}
n|dkr�d	}
nd}
|D]t}|d|	�|kr�|
r�|d|	d�|
ks�d
||f}zt||�}
Wntk
�rYnX|�|
|�}|�|�q�|�s\|
�sF�q\|
dk�rVd	}
q�d}
q�|��|S)Nrz(\w+(\.\w+)*)\.(\w*)r�r!�	__class__r�_�__z%s.%s)�re�match�group�evalr�	Exception�set�dir�discard�hasattrr0�update�get_class_membersr7r.�getattrr r1�sort)r	rr:�m�expr�attrZ
thisobjectZwordsrr5Znoprefixrr;rr
r
rr�sR



��
zCompleter.attr_matches)N)�__name__�
__module__�__qualname__rrr rrr
r
r
rr&s

cCs.t|�}t|d�r*|jD]}|t|�}q|S)N�	__bases__)r@rBrMrD)�klassZret�baser
r
rrD�s


rDFcCs
t�d�S)N)r�
set_completerr
r
r
r�<lambda>��rQT)�atexitr2r�__all__rrDr�ImportErrorrrPr�registerr
r
r
r�<module> s
__pycache__/functools.cpython-38.pyc000064400000066377151153537610013452 0ustar00U

e5d��
@s�dZddddddddd	d
ddd
g
ZddlmZddlmZddlmZddlm	Z	dZ
dZe
efdd�Ze
efdd�Z
efdd�Zefdd�Zefdd�Zefdd�Zefdd �Zefd!d"�Zefd#d$�Zefd%d&�Zefd'd(�Zefd)d*�Zefd+d,�Zefd-d.�Zd/efd0efd1efgd1efd2efd/efgd2efd1efd0efgd0efd/efd2efgd3�Zd4d�Zd5d�Zzdd6lmZWnek
�r�YnXe �Z!e!fd7d�Z"zdd8lm"Z"Wnek
�r�YnXGd9d	�d	�Z#zdd:lm#Z#Wnek
�rYnXGd;d
�d
e �Z$d<d=�Z%ed>d?d@dAdBg�Z&GdCdD�dDe'�Z(e �fe)e*he+e,e-fdEdF�Z.dYdId�Z/dJdK�Z0zddLlm0Z0Wnek
�r�YnXdMdN�Z1dZdPdQ�Z2dRdS�Z3dTdU�Z4dVd�Z5GdWd�d�Z6e �Z7GdXd
�d
�Z8dOS)[zEfunctools.py - Tools for working with functions and callable objects
�update_wrapper�wraps�WRAPPER_ASSIGNMENTS�WRAPPER_UPDATES�total_ordering�
cmp_to_key�	lru_cache�reduce�partial�
partialmethod�singledispatch�singledispatchmethod�cached_property�)�get_cache_token)�
namedtuple)�recursive_repr)�RLock)�
__module__�__name__�__qualname__�__doc__�__annotations__)�__dict__c	Csf|D]4}zt||�}Wntk
r*YqXt|||�q|D]}t||��t||i��q>||_|S)aUpdate a wrapper function to look like the wrapped function

       wrapper is the function to be updated
       wrapped is the original function
       assigned is a tuple naming the attributes assigned directly
       from the wrapped function to the wrapper function (defaults to
       functools.WRAPPER_ASSIGNMENTS)
       updated is a tuple naming the attributes of the wrapper that
       are updated with the corresponding attribute from the wrapped
       function (defaults to functools.WRAPPER_UPDATES)
    )�getattr�AttributeError�setattr�update�__wrapped__)�wrapper�wrapped�assigned�updated�attr�value�r$�!/usr/lib64/python3.8/functools.pyr"scCstt|||d�S)a�Decorator factory to apply update_wrapper() to a wrapper function

       Returns a decorator that invokes update_wrapper() with the decorated
       function as the wrapper argument and the arguments to wraps() as the
       remaining arguments. Default arguments are as for update_wrapper().
       This is a convenience function to simplify applying partial() to
       update_wrapper().
    �rr r!)r	rr&r$r$r%r@s�cCs$|�|�}||kr|S|o"||kS)zIReturn a > b.  Computed by @total_ordering from (not a < b) and (a != b).��__lt__��self�other�NotImplemented�	op_resultr$r$r%�_gt_from_ltXs
r.cCs|�|�}|p||kS)zEReturn a <= b.  Computed by @total_ordering from (a < b) or (a == b).r'r)r$r$r%�_le_from_lt_s
r/cCs|�|�}||kr|S|S)z=Return a >= b.  Computed by @total_ordering from (not a < b).r'r)r$r$r%�_ge_from_ltds
r0cCs$|�|�}||kr|S|p"||kS)zJReturn a >= b.  Computed by @total_ordering from (not a <= b) or (a == b).��__le__r)r$r$r%�_ge_from_leks
r3cCs"|�|�}||kr|S|o ||kS)zFReturn a < b.  Computed by @total_ordering from (a <= b) and (a != b).r1r)r$r$r%�_lt_from_lers
r4cCs|�|�}||kr|S|S)z=Return a > b.  Computed by @total_ordering from (not a <= b).r1r)r$r$r%�_gt_from_leys
r5cCs$|�|�}||kr|S|o"||kS)zIReturn a < b.  Computed by @total_ordering from (not a > b) and (a != b).��__gt__r)r$r$r%�_lt_from_gt�s
r8cCs|�|�}|p||kS)zEReturn a >= b.  Computed by @total_ordering from (a > b) or (a == b).r6r)r$r$r%�_ge_from_gt�s
r9cCs|�|�}||kr|S|S)z=Return a <= b.  Computed by @total_ordering from (not a > b).r6r)r$r$r%�_le_from_gt�s
r:cCs$|�|�}||kr|S|p"||kS)zJReturn a <= b.  Computed by @total_ordering from (not a >= b) or (a == b).��__ge__r)r$r$r%�_le_from_ge�s
r=cCs"|�|�}||kr|S|o ||kS)zFReturn a > b.  Computed by @total_ordering from (a >= b) and (a != b).r;r)r$r$r%�_gt_from_ge�s
r>cCs|�|�}||kr|S|S)z=Return a < b.  Computed by @total_ordering from (not a >= b).r;r)r$r$r%�_lt_from_ge�s
r?r7r2r<r()r(r2r7r<csV�fdd�tD�}|std��t|�}t|D]"\}}||kr.||_t�||�q.�S)z6Class decorator that fills in missing ordering methodscs(h|] }t�|d�tt|d�k	r|�qS�N)r�object)�.0�op��clsr$r%�	<setcomp>�sz!total_ordering.<locals>.<setcomp>z6must define at least one ordering operation: < > <= >=)�_convert�
ValueError�maxrr)rE�roots�root�opname�opfuncr$rDr%r�scsG�fdd�dt�}|S)z,Convert a cmp= function into a key= functioncsZeZdZdgZdd�Z�fdd�Z�fdd�Z�fdd	�Z�fd
d�Z�fdd
�Z	dZ
dS)zcmp_to_key.<locals>.K�objcSs
||_dSr@�rN)r*rNr$r$r%�__init__�szcmp_to_key.<locals>.K.__init__cs�|j|j�dkS�NrrO�r*r+��mycmpr$r%r(�szcmp_to_key.<locals>.K.__lt__cs�|j|j�dkSrQrOrRrSr$r%r7�szcmp_to_key.<locals>.K.__gt__cs�|j|j�dkSrQrOrRrSr$r%�__eq__�szcmp_to_key.<locals>.K.__eq__cs�|j|j�dkSrQrOrRrSr$r%r2�szcmp_to_key.<locals>.K.__le__cs�|j|j�dkSrQrOrRrSr$r%r<�szcmp_to_key.<locals>.K.__ge__N)rrr�	__slots__rPr(r7rUr2r<�__hash__r$rSr$r%�K�srX)rA)rTrXr$rSr%r�s)rcCsZt|�}|tkr>zt|�}WqBtk
r:td�d�YqBXn|}|D]}|||�}qF|S)a�
    reduce(function, sequence[, initial]) -> value

    Apply a function of two arguments cumulatively to the items of a sequence,
    from left to right, so as to reduce the sequence to a single value.
    For example, reduce(lambda x, y: x+y, [1, 2, 3, 4, 5]) calculates
    ((((1+2)+3)+4)+5).  If initial is present, it is placed before the items
    of the sequence in the calculation, and serves as a default when the
    sequence is empty.
    z0reduce() of empty sequence with no initial valueN)�iter�_initial_missing�next�
StopIteration�	TypeError)ZfunctionZsequence�initial�itr#Zelementr$r$r%r�s)rcsJeZdZdZdZ�fdd�Zdd�Ze�dd��Zd	d
�Z	dd�Z
�ZS)
r	zSNew function with partial application of the given arguments
    and keywords.
    )�func�args�keywordsr�__weakref__csZt|�std��t|d�r4|j|}|j|�}|j}tt|��|�}||_||_||_|S)Nz#the first argument must be callabler`)	�callabler]�hasattrrarbr`�superr	�__new__)rEr`rarbr*��	__class__r$r%rgs


zpartial.__new__cOs|j|�}|j|j|�|�Sr@�rbr`ra)r*rarbr$r$r%�__call__%s
zpartial.__call__cCs�t|�j}t|j�g}|�dd�|jD��|�dd�|j��D��t|�jdkrld|�dd�	|��d�S|�dd�	|��d�S)	Ncss|]}t|�VqdSr@)�repr)rB�xr$r$r%�	<genexpr>-sz#partial.__repr__.<locals>.<genexpr>css |]\}}|�d|��VqdS)�=Nr$�rB�k�vr$r$r%rn.s�	functoolsz
functools.�(�, �))
�typerrlr`�extendrarb�itemsr�join)r*�qualnamerar$r$r%�__repr__)s
zpartial.__repr__cCs*t|�|jf|j|j|jpd|jp$dffSr@)rwr`rarbr�r*r$r$r%�
__reduce__3s�zpartial.__reduce__cCs�t|t�std��t|�dkr0tdt|�����|\}}}}t|�rrt|t�rr|dk	r`t|t�rr|dk	rzt|t�sztd��t|�}|dkr�i}nt|�tk	r�t|�}|dkr�i}||_||_||_	||_
dS)Nz(argument to __setstate__ must be a tuple�zexpected 4 items in state, got zinvalid partial state)�
isinstance�tupler]�lenrd�dictrwrr`rarb)r*�stater`ra�kwds�	namespacer$r$r%�__setstate__7s4
����zpartial.__setstate__)rrrrrVrgrkrr|r~r��
__classcell__r$r$rhr%r	s
	)r	c@sDeZdZdZdd�Zde_dd�Zdd�Zdd
d�Ze	dd
��Z
d	S)r
z�Method descriptor with partial application of the given arguments
    and keywords.

    Supports wrapping existing descriptors and handles non-descriptor
    callables as instance methods.
    cOs�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��t|�}t|�s�t|d	�s�td
�	|���t
|t�r�|j|_|j
||_
|j|�|_n||_||_
||_dS)N�z8descriptor '__init__' of partialmethod needs an argumentr`rz0Passing 'func' as keyword argument is deprecated)�
stacklevelz8type 'partialmethod' takes at least one argument, got %d��__get__z${!r} is not callable or a descriptor)r�r]�pop�warnings�warn�DeprecationWarningr�rdre�formatr�r
r`rarb)rarbr*r`r�r$r$r%rP]s6

�
��
zpartialmethod.__init__z#($self, func, /, *args, **keywords)cCsNd�tt|j��}d�dd�|j��D��}d}|j|jj|jj	|j
||d�S)Nrucss|]\}}d�||�VqdS)z{}={!r}N)r�rpr$r$r%rn�s�z)partialmethod.__repr__.<locals>.<genexpr>z*{module}.{cls}({func}, {args}, {keywords}))�modulerEr`rarb)rz�maprlrarbryr�rirrr`)r*rarb�
format_stringr$r$r%r|�s
�
�zpartialmethod.__repr__cs�fdd�}�j|_�|_|S)Ncs �j|�}�j|f�j|�|�Sr@rj)�cls_or_selfrarbr}r$r%�_method�s
z3partialmethod._make_unbound_method.<locals>._method)�__isabstractmethod__�_partialmethod)r*r�r$r}r%�_make_unbound_method�sz"partialmethod._make_unbound_methodNcCs�t|jdd�}d}|dk	rd|||�}||jk	rdt|f|j�|j�}z|j|_Wntk
rbYnX|dkr||���||�}|S)Nr�)	rr`r	rarb�__self__rr�r�)r*rNrE�get�result�new_funcr$r$r%r��s

zpartialmethod.__get__cCst|jdd�S�Nr�F�rr`r}r$r$r%r��sz"partialmethod.__isabstractmethod__)N)rrrrrP�__text_signature__r|r�r��propertyr�r$r$r$r%r
Us"
cCst|t�r|j}q|Sr@)r�r	r`�r`r$r$r%�_unwrap_partial�s
r��	CacheInfo�hits�misses�maxsize�currsizec@s(eZdZdZdZefdd�Zdd�ZdS)�
_HashedSeqz� This class guarantees that hash() will be called no more than once
        per element.  This is important because the lru_cache() will hash
        the key multiple times on a cache miss.

    �	hashvaluecCs||dd�<||�|_dSr@�r�)r*�tup�hashr$r$r%rP�sz_HashedSeq.__init__cCs|jSr@r�r}r$r$r%rW�sz_HashedSeq.__hash__N)rrrrrVr�rPrWr$r$r$r%r��sr�c
s�|}|r&||7}|��D]}	||	7}q|rh||�fdd�|D��7}|r�||�fdd�|��D��7}n$||�dkr��|d�|kr�|dSt|�S)a�Make a cache key from optionally typed positional and keyword arguments

    The key is constructed in a way that is flat as possible rather than
    as a nested structure that would take more memory.

    If there is only a single argument and its data type is known to cache
    its hash value, then that argument is returned without a wrapper.  This
    saves space and improves lookup speed.

    c3s|]}�|�VqdSr@r$�rBrr�rwr$r%rn�sz_make_key.<locals>.<genexpr>c3s|]}�|�VqdSr@r$r�r�r$r%rn�sr�r)ry�valuesr�)
rar��typed�kwd_mark�	fasttypesr�rwr��key�itemr$r�r%�	_make_key�s
 r��Fcsnt�t�r�dkr\d�nDt��rLt�t�rL�d}�t|��t�}t||�S�dk	r\td����fdd�}|S)a�Least-recently-used cache decorator.

    If *maxsize* is set to None, the LRU features are disabled and the cache
    can grow without bound.

    If *typed* is True, arguments of different types will be cached separately.
    For example, f(3.0) and f(3) will be treated as distinct calls with
    distinct results.

    Arguments to the cached function must be hashable.

    View the cache statistics named tuple (hits, misses, maxsize, currsize)
    with f.cache_info().  Clear the cache and statistics with f.cache_clear().
    Access the underlying function with f.__wrapped__.

    See:  http://en.wikipedia.org/wiki/Cache_replacement_policies#Least_recently_used_(LRU)

    rr�Nz=Expected first argument to be an integer, a callable, or Nonecst|��t�}t||�Sr@)�_lru_cache_wrapper�
_CacheInfor)�
user_functionr�r�r�r$r%�decorating_function
sz&lru_cache.<locals>.decorating_function)r��intrd�boolr�r�rr])r�r�r�rr�r$r�r%r�s


�cs�t��t�d\����i�d�	�
d��j��j�t��
g���ddg�dd�<�dkrh�
�fdd�}nN�dkr����	��
���fdd�}n*���������	�
���
���fdd�}���	�
��
fdd	�}���	�
�
�fd
d�}||_||_|S)N)rr�r��rFcs�d7��||�}|S�Nr�r$)rar�r�)r�r�r$r%r$s
z#_lru_cache_wrapper.<locals>.wrappercsH�||��}�|��}|�k	r*�d7�|S�d7��||�}|�|<|Sr�r$)rar�r�r�)�cache�	cache_getr��make_keyr��sentinelr�r�r$r%r-s

c
s>�
||��}�	�z�|�}|dk	r~|\}}}}||�<||�<�
�}||�<�
�<||�<�
|�<�d7�|W5QR�S�d7�W5QRX�||�}�	��|�kr�n��r��
}	||	�<||	�<|	��
�
�}
�
�}d�
�<�
�<�|
=|	�|<n6�
�}|�
||g}||�<�
�<�|<���k�W5QRX|Sr�r$)rar�r��linkZ	link_prevZ	link_nextZ_keyr�ZlastZoldrootZoldkeyZ	oldresult)�KEY�NEXT�PREV�RESULTr�r��	cache_len�fullr��lockr�r�r�rKr�r�r$r%r<sB

c
s,���������W5QR�SQRXdS)zReport cache statisticsNr$r$)r�r�r�r�r�r�r$r%�
cache_infousz&_lru_cache_wrapper.<locals>.cache_infoc	s<��.�����ddg�dd�<d��d�W5QRXdS)z$Clear the cache and cache statisticsNrF)�clearr$)r�r�r�r�r�rKr$r%�cache_clearzs
z'_lru_cache_wrapper.<locals>.cache_clear)rAr�r��__len__rr�r�)r�r�r�r�rr�r�r$)r�r�r�r�r�r�r�r�r�r�r�r�r�r�rKr�r�r�r%r�s**9	r�)r�cCs�g}dd�|D�}|s|S|D]2}|d}|D]}||dd�kr.d}qq.qRq|dkrbtd��|�|�|D]}|d|krp|d=qpqdS)z�Merges MROs in *sequences* to a single MRO using the C3 algorithm.

    Adapted from http://www.python.org/download/releases/2.3/mro/.

    cSsg|]}|r|�qSr$r$�rB�sr$r$r%�
<listcomp>�sz_c3_merge.<locals>.<listcomp>rr�NzInconsistent hierarchy)�RuntimeError�append)�	sequencesr��s1�	candidate�s2�seqr$r$r%�	_c3_merge�s"
r�Nc
stt|j��D]$\}�t�d�rt|j�|}q8qd}�rDt��ng�t|jd|��}g}t|j|d��}�D]0�t|��rtt�fdd�|jD��st|���qt|D]���	��q��fdd�|D�}�fdd�|D�}�fd	d�|D�}	t
|gg|||	|g|g|g�S)
a�Computes the method resolution order using extended C3 linearization.

    If no *abcs* are given, the algorithm works exactly like the built-in C3
    linearization used for method resolution.

    If given, *abcs* is a list of abstract base classes that should be inserted
    into the resulting MRO. Unrelated ABCs are ignored and don't end up in the
    result. The algorithm inserts ABCs where their functionality is introduced,
    i.e. issubclass(cls, abc) returns True for the class itself but returns
    False for all its direct base classes. Implicit ABCs for a given class
    (either registered or inferred from the presence of a special method like
    __len__) are inserted directly after the last ABC explicitly listed in the
    MRO of said class. If two implicit ABCs end up next to each other in the
    resulting MRO, their ordering depends on the order of types in *abcs*.

    �__abstractmethods__rNc3s|]}t|��VqdSr@)�
issubclass)rB�b)�baser$r%rn�sz_c3_mro.<locals>.<genexpr>csg|]}t|�d��qS���abcs��_c3_mro�rBr�r�r$r%r��sz_c3_mro.<locals>.<listcomp>csg|]}t|�d��qSr�r�r�r�r$r%r��scsg|]}t|�d��qSr�r�r�r�r$r%r��s)�	enumerate�reversed�	__bases__rer��listr��anyr��remover�)
rEr��i�boundary�explicit_bases�abstract_bases�other_bases�explicit_c3_mros�abstract_c3_mros�
other_c3_mrosr$)r�r�r%r��sD
��������r�cs�t�j����fdd���fdd��D���fdd���fdd��D��t���g}�D]�}g}|��D]0}|�krht�|�rh|��fdd�|jD��qh|s�|�|�qX|jtd	d
�|D] }|D]}||kr�|�|�q�q�qXt�|d�S)z�Calculates the method resolution order for a given class *cls*.

    Includes relevant abstract base classes (with their respective bases) from
    the *types* iterable. Uses a modified C3 linearization algorithm.

    cs|�kot|d�ot�|�S)N�__mro__)rer�)�typ)�basesrEr$r%�
is_related�s�z _compose_mro.<locals>.is_relatedcsg|]}�|�r|�qSr$r$�rB�n)r�r$r%r��sz _compose_mro.<locals>.<listcomp>cs&�D]}||kr||jkrdSqdS)NTF)r�)r�r+)�typesr$r%�is_strict_base�sz$_compose_mro.<locals>.is_strict_basecsg|]}�|�s|�qSr$r$r�)r�r$r%r��scsg|]}|�kr|�qSr$r$r�)�type_setr$r%r��sT)r��reverser�)�setr��__subclasses__r�r��sortr�r�)rEr��mror��found�sub�subclsr$)r�rEr�r�r�r�r%�_compose_mro�s*

rcCstt||���}d}|D]R}|dk	r\||krX||jkrX||jkrXt||�sXtd�||���qj||kr|}q|�|�S)a^Returns the best matching implementation from *registry* for type *cls*.

    Where there is no registered implementation for a specific type, its method
    resolution order is used to find a more generic implementation.

    Note: if *registry* does not contain an implementation for the base
    *object* type, this function may return None.

    NzAmbiguous dispatch: {} or {})r�keysr�r�r�r�r�)rE�registryr�match�tr$r$r%�
_find_impls"
���r
cs�ddl}ddl}i�|���d����fdd��d����fdd�	���fdd�}t|d	d
��|�t<�|_�|_|���|_�j	|_
t||�|S)akSingle-dispatch generic function decorator.

    Transforms a function into a generic function, which can have different
    behaviours depending upon the type of its first argument. The decorated
    function acts as the default implementation, and additional
    implementations can be registered using the register() attribute of the
    generic function.
    rNcs|�dk	r"t�}�|kr"���|�z�|}WnHtk
rvz�|}Wntk
rht|��}YnX|�|<YnX|S)z�generic_func.dispatch(cls) -> <function implementation>

        Runs the dispatch algorithm to return the best available implementation
        for the given *cls* registered on *generic_func*.

        N)rr��KeyErrorr
)rE�
current_token�impl)�cache_token�dispatch_cacherr$r%�dispatch.sz singledispatch.<locals>.dispatchcs�|dkr�t�t�r ��fdd�St�di�}|s@td��d����}ddlm}tt||�����\}�t�t�s�td	|�d
��d���|��<�dkr�t	�d�r�t
�����|S)
z�generic_func.register(cls, func) -> func

        Registers a new implementation for the given *cls* on a *generic_func*.

        Ncs
��|�Sr@r$)�f)rE�registerr$r%�<lambda>N�z2singledispatch.<locals>.register.<locals>.<lambda>rz(Invalid first argument to `register()`: zS. Use either `@register(some_class)` or plain `@register` on an annotated function.r)�get_type_hintszInvalid annotation for z. z is not a class.r�)r�rwrr]�typingrr[rYryrerr�)rEr`�annr�argname)rrrrrDr%rEs(

�
�z singledispatch.<locals>.registercs&|st��d����|dj�||�S)Nz( requires at least 1 positional argumentr)r]ri)ra�kw)r�funcnamer$r%rfszsingledispatch.<locals>.wrapperrzsingledispatch function)N)r��weakref�WeakKeyDictionaryrrArr�MappingProxyTyperr��_clear_cacher)r`r�rrr$)rrrrrrr%rs!
c@s8eZdZdZdd�Zddd�Zddd�Zed	d
��ZdS)
rz�Single-dispatch generic method descriptor.

    Supports wrapping existing descriptors and handles non-descriptor
    callables as instance methods.
    cCs4t|�s t|d�s t|�d���t|�|_||_dS)Nr�z  is not callable or a descriptor)rdrer]r�
dispatcherr`�r*r`r$r$r%rPs
zsingledispatchmethod.__init__NcCs|jj||d�S)z�generic_method.register(cls, func) -> func

        Registers a new implementation for the given *cls* on a *generic_method*.
        r�)rr)r*rE�methodr$r$r%r�szsingledispatchmethod.registercs0���fdd�}�j|_�j|_t|�j�|S)Ncs$�j�|dj�}|����||�SrQ)rrrir�)ra�kwargsr!�rErNr*r$r%r��sz-singledispatchmethod.__get__.<locals>._method)r�rrr`)r*rNrEr�r$r#r%r��s
zsingledispatchmethod.__get__cCst|jdd�Sr�r�r}r$r$r%r��sz)singledispatchmethod.__isabstractmethod__)N)N)	rrrrrPrr�r�r�r$r$r$r%rxs


c@s&eZdZdd�Zdd�Zddd�ZdS)	r
cCs ||_d|_|j|_t�|_dSr@)r`�attrnamerrr�r r$r$r%rP�szcached_property.__init__cCs8|jdkr||_n"||jkr4td|j�d|�d���dS)Nz?Cannot assign the same cached_property to two different names (z and z).)r$r])r*�owner�namer$r$r%�__set_name__�s

�zcached_property.__set_name__Nc	Cs�|dkr|S|jdkrtd��z
|j}Wn8tk
r`dt|�j�d|j�d�}t|�d�YnX|�|jt�}|tkr�|j�n|�|jt�}|tkr�|�	|�}z|||j<Wn8tk
r�dt|�j�d|j�d�}t|�d�YnXW5QRX|S)NzGCannot use cached_property instance without calling __set_name__ on it.zNo '__dict__' attribute on z instance to cache z
 property.zThe '__dict__' attribute on z7 instance does not support item assignment for caching )
r$r]rrrwrr��
_NOT_FOUNDr�r`)r*�instancer%r��msg�valr$r$r%r��s2
�
�
�zcached_property.__get__)N)rrrrPr'r�r$r$r$r%r
�s	)r�F)N)9r�__all__�abcr�collectionsr�reprlibr�_threadrrrrrr,r.r/r0r3r4r5r8r9r:r=r>r?rGrr�
_functools�ImportErrorrArZrr	r
r�r�r�r�r��strr�rwr�r�rr�r�r�rr
rrr(r
r$r$r$r%�<module>s��
�
�
�����AX	�

,t
-)\(__pycache__/pickle.cpython-38.opt-2.pyc000064400000117731151153537610013634 0ustar00U

e5d��	@sdddlmZddlmZddlmZmZmZddlmZddl	m
Z
ddlZddlmZddl
mZmZddlZddlZddlZddlZd	d
ddd
ddddg	ZzddlmZe�d�dZWnek
r�dZYnXeefZdZddddddddgZdZdZ Gd d	�d	e!�Z"Gd!d
�d
e"�Z#Gd"d�de"�Z$Gd#d$�d$e!�Z%zdd%l&m'Z'Wnek
�rhdZ'YnXd&Z(d'Z)d(Z*d)Z+d*Z,d+Z-d,Z.d-Z/d.Z0d/Z1d0Z2d1Z3d2Z4d3Z5d4Z6d5Z7d6Z8d7Z9d8Z:d9Z;d:Z<d;Z=d<Z>d=Z?d>Z@d?ZAd@ZBdAZCdBZDdCZEdDZFdEZGdFZHdGZIdHZJdIZKdJZLdKZMdLZNdMZOdNZPdOZQdPZRdQZSdRZTdSZUdTZVdUZWdVZXdWZYdXZZdYZ[dZZ\d[Z]d\Z^eNeXeYeZgZ_d]Z`d^Zad_Zbd`ZcdaZddbZedcZfddZgdeZhdfZidgZjdhZkdiZldjZmdkZne�odldm�ep�D��Gdndo�do�ZqGdpdq�dq�Zrdrds�Zsdtdu�Ztdvdw�Zudxdy�ZvGdzd{�d{�ZwGd|d}�d}�Zxd�ddd~�dd��Zyd�ddd~�d�d��Zzdd�d�dd��d�d��Z{dd�d�dd��d�d��Z|z0dd�lm"Z"m#Z#m$Z$m}Z}m~Z~mZm�Z�m�Z�m�Z�Wn4ek
�r�ewexZ}Z~eyeze{e|f\ZZ�Z�Z�YnXd�d��Z�e�d�k�r`ddl�Z�e�j�d�d��Z�e�j�d�e���d��d�d�d��e�j�d�d�d�d�d��e�j�d�d�d�d��e����Z�e�j��r&e��n:e�j��s8e����n(ddl�Z�e�j�D]Z�e�e��Z�e���e���qFdS)��)�FunctionType)�dispatch_table)�_extension_registry�_inverted_registry�_extension_cache)�islice)�partialN)�maxsize)�pack�unpack�PickleError�
PicklingError�UnpicklingError�Pickler�	Unpickler�dump�dumps�load�loads)�PickleBufferrTFz4.0z1.0z1.1z1.2z1.3z2.0z3.0z5.0��c@seZdZdS)rN��__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/pickle.pyrIsc@seZdZdS)r
Nrrrrrr
Msc@seZdZdS)rNrrrrrrTs	c@seZdZdd�ZdS)�_StopcCs
||_dS�N)�value��selfr rrr�__init__bsz_Stop.__init__N)rrrr#rrrrrasr)�PyStringMap�(�.�0�1�2�F�I�J�K�L�M�N�P�Q�R�S�T�U�V�X�a�b�c�d�}�e�g�h�i�j�l�]�o�p�q�r�s�t�)�u�GsI01
sI00
�������������������������B�C��������������������������cCsg|]}t�d|�r|�qS)z[A-Z][A-Z0-9_]+$)�re�match)�.0�xrrr�
<listcomp>�srmc@sFeZdZdZdZdd�Zdd�Zdd�Zdd
d�Zdd
�Z	dd�Z
dS)�_FramerricCs||_d|_dSr)�
file_write�
current_frame)r"rorrrr#�sz_Framer.__init__cCst��|_dSr)�io�BytesIOrp�r"rrr�
start_framing�sz_Framer.start_framingcCs*|jr&|j��dkr&|jdd�d|_dS)NrT��force)rp�tell�commit_framersrrr�end_framing�sz_Framer.end_framingFcCsf|jrb|j}|��|jks|rb|��}|j}t|�|jkrP|ttdt|���||�t	�
�|_dS)N�<Q)rprw�_FRAME_SIZE_TARGET�	getbufferro�len�_FRAME_SIZE_MIN�FRAMEr
rqrr)r"rv�f�data�writerrrrx�sz_Framer.commit_framecCs |jr|j�|�S|�|�SdSr)rpr�ro�r"r�rrrr��sz
_Framer.writecCs,|j}|jr|jdd�||�||�dS)NTru)rorprx)r"�headerZpayloadr�rrr�write_large_bytes�s
z_Framer.write_large_bytesN)F)rrrr~r{r#rtryrxr�r�rrrrrn�s
rnc@s6eZdZddd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�	_UnframerNcCs||_||_d|_dSr)�	file_read�
file_readlinerp)r"r�r�Z	file_tellrrrr#	sz_Unframer.__init__cCs�|jrb|j�|�}|dkrJt|�dkrJd|_t|�}|�|�|dd�<|S|t|�kr^td��|St|�}|�|�|dd�<|SdS�Nr�$pickle exhausted before end of frame)rp�readintor}r�r)r"�buf�nrrrr�s�z_Unframer.readintocCsT|jrF|j�|�}|s.|dkr.d|_|�|�St|�|krBtd��|S|�|�SdSr�)rp�readr�r}r�r"r�r�rrrr�s
�z_Unframer.readcCsF|jr:|j��}|s"d|_|��S|ddkr6td��|S|��SdS)N����
r�)rp�readliner�rr�rrrr�,s
�z_Unframer.readlinecCs2|jr|j��dkrtd��t�|�|��|_dS)N�z4beginning of a new frame before end of current frame)rpr�rrqrrr��r"Z
frame_sizerrr�
load_frame9s
�z_Unframer.load_frame)N)rrrr#r�r�r�r�rrrrr�s



r�c	Csj|�d�D]V}|dkr&td�||���z|}t||�}Wq
tk
r^td�||��d�Yq
Xq
||fS)N�.z<locals>z&Can't get local attribute {!r} on {!r}z Can't get attribute {!r} on {!r})�split�AttributeError�format�getattr)�obj�nameZsubpath�parentrrr�
_getattributeBs"���
r�c	Cs�t|dd�}|dk	r|Stj����D]X\}}|dks&|dks&|dkrHq&z t||�d|krf|WSWq&tk
r|Yq&Xq&dS)Nr�__main__Z__mp_main__r)r��sys�modules�copy�itemsr�r�)r�r��module_name�modulerrr�whichmoduleOs ��r�cCsh|dkrdS|��d?d}|j|ddd�}|dkrd|dkrd|dd	krd|d
d@dkrd|dd�}|S)Nrr����littleT��	byteorderZsignedr������)�
bit_length�to_bytes)rl�nbytes�resultrrr�encode_longbsr�cCstj|ddd�S)Nr�Tr�)�int�
from_bytes)r�rrr�decode_long�sr�c@s�eZdZd;ddd�dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zd<dd�Z	dd�Z
dd�Zd=dd�ZiZ
dd�Zee
ed�<dd�Zee
e<dd�Zee
e<dd�Zee
e<d d!�Zee
e<d"d#�Zee
e<er�d$d%�Zee
e<d&d'�Zee
e<d(d)�Zee
e <d*d+�Z!e!e
e"<d,Z#d-d.�Z$d/d0�Z%e%e
e&<e'dk	�r@e%e
e'<d1d2�Z(d3d4�Z)e)e
e*<d5d6�Z+e+e
e,<d>d7d8�Z-d9d:�Z.e-e
e/<e.e
e<dS)?�_PicklerNT��fix_imports�buffer_callbackcCs�|dkrt}|dkrt}n"d|kr.tks<ntdt��|dk	rT|dkrTtd��||_z|j|_Wntk
r�td��YnXt|j�|_	|j	j|_|j	j
|_i|_t
|�|_|dk|_d|_|o�|dk|_dS)Nrzpickle protocol must be <= %drz#buffer_callback needs protocol >= 5z"file must have a 'write' attributer�r�)�DEFAULT_PROTOCOL�HIGHEST_PROTOCOL�
ValueError�_buffer_callbackr��_file_writer��	TypeErrorrn�framerr��_write_large_bytes�memor��proto�bin�fastr�)r"�file�protocolr�r�rrrr#�s*#



z_Pickler.__init__cCs|j��dSr)r��clearrsrrr�
clear_memo�sz_Pickler.clear_memocCsrt|d�std|jjf��|jdkr<|�ttd|j��|jdkrP|j�	�|�
|�|�t�|j��dS)Nr�z2Pickler.__init__() was not called by %s.__init__()��<Br)
�hasattrr
�	__class__rr�r��PROTOr
r�rt�save�STOPry�r"r�rrrr�s
�




z
_Pickler.dumpcCs:|jr
dSt|j�}|�|�|��||f|jt|�<dSr)r�r}r�r��put�id)r"r��idxrrr�memoize�s

z_Pickler.memoizecCsT|jdkrtS|jr:|dkr*ttd|�Sttd|�Sntt|��d�dSdS)Nr�r��<I�ascii�
)	r��MEMOIZEr��BINPUTr
�LONG_BINPUT�PUT�repr�encode)r"r�rrrr�s
z_Pickler.putcCs@|jr*|dkrttd|�Sttd|�Stt|��d�dS)Nr�r�r�r�r�)r��BINGETr
�LONG_BINGET�GETr�r��r"�irrr�gets
z_Pickler.getc
Cs�|j��|�|�}|dk	r.|r.|�|�dS|j�t|��}|dk	r^|�|�|d��dSt}t	|dd�}|dk	r~||�}|tk�r@t
|�}|j�|�}|dk	r�|||�dSt	|dt��|�}|dk	r�||�}njt
|t
�r�|�|�dSt	|dd�}|dk	�r||j�}n0t	|dd�}|dk	�r.|�}ntd|j|f��t|t��r\|�||�dSt|t��sttd|��t|�}	d|	k�r�d	k�s�ntd
|��|j|d|i�dS)NrZreducer_overrider�
__reduce_ex__�
__reduce__zCan't pickle %r object: %rz%s must return string or tupler��z2Tuple returned by %s must have two to six elementsr�)r�rx�
persistent_id�	save_persr�r�r�r��NotImplementedr��type�dispatchr�
issubclass�save_globalr�r
r�
isinstance�str�tupler}�save_reduce)
r"r��save_persistent_id�pidrl�rv�reduce�tr��lrrrr�sZ









��z
_Pickler.savecCsdSrrr�rrrr�]sz_Pickler.persistent_idcCsb|jr |j|dd�|�t�n>z |�tt|��d�d�Wntk
r\td��YnXdS)NF)r�r�r��2persistent IDs in protocol 0 must be ASCII strings)	r�r�r��	BINPERSID�PERSIDr�r��UnicodeEncodeErrorr
�r"r�rrrr�as �z_Pickler.save_persc
Cs>t|t�std��t|�s"td��|j}|j}	t|dd�}
|jdkr�|
dkr�|\}}}t|d�sntd�	|
���|dk	r�||j
k	r�td	�	|
���|jd
kr�||�||�||�|	t�n,t|j
|f|�|�}||�|d�|	t�n�|jdk�r^|
dk�r^|d
}t|d��std��|dk	�r8||j
k	�r8td��|dd�}||�||�|	t�n||�||�|	t�|dk	�r�t|�|jk�r�|	t|�|jt|�d
��n
|�|�|dk	�r�|�|�|dk	�r�|�|�|dk	�r:|dk�r
||�|	t�n0||�||�||�|	t�|	t�|	t�dS)Nz'args from save_reduce() must be a tuplez(func from save_reduce() must be callabler�r��
__newobj_ex__�__new__z#args[0] from {} args has no __new__z(args[0] from {} args has the wrong classrr�
__newobj__rz+args[0] from __newobj__ args has no __new__z0args[0] from __newobj__ args has the wrong classr�)r�r�r
�callabler�r�r�r�r�r�r��	NEWOBJ_EXrr�REDUCE�NEWOBJr�r��POPr�r��_batch_appends�_batch_setitems�BUILD�TUPLE2)
r"�func�args�stateZ	listitemsZ	dictitemsZstate_setterr�r�r�Z	func_name�cls�kwargsrrrr�msz


��


��

"







z_Pickler.save_reducecCs|�t�dSr)r��NONEr�rrr�	save_none�sz_Pickler.save_nonecCs4|jdkr|�|rtnt�n|�|r*tnt�dS)Nr�)r�r��NEWTRUE�NEWFALSE�TRUE�FALSEr�rrr�	save_bool�s
z_Pickler.save_boolcCs.|jr~|dkrN|dkr.|�ttd|��dS|dkrN|�ttd|��dSd|krbdkr~nn|�ttd|��dS|jd	kr�t|�}t|�}|d
kr�|�t	td|�|�n|�t
td|�|�dSd|kr�dk�rnn|�tt|��
d�d�n|�tt|��
d�d
�dS)Nrr�r���<Hi�i����<ir�r�r�r�sL
)r�r��BININT1r
�BININT2�BININTr�r�r}�LONG1�LONG4�INTr�r��LONG�r"r�Zencodedr�rrr�	save_long�s*
z_Pickler.save_longcCs<|jr|�ttd|��n|�tt|��d�d�dS)N�>dr�r�)r�r��BINFLOATr
�FLOATr�r�r�rrr�
save_floatsz_Pickler.save_floatcCs�|jdkr@|s |jtd|d�n|jtjt|d�df|d�dSt|�}|dkrj|�tt	d|�|�nf|dkr�|jdkr�|�
tt	d	|�|�n<||jj
kr�|�
tt	d
|�|�n|�tt	d
|�|�|�|�dS)Nr�r�r��latin1r�r����rrzr�)r�r��bytes�codecsr�r�r}r��SHORT_BINBYTESr
r��	BINBYTES8r�r{�BINBYTESr��r"r�r�rrr�
save_bytess"
�z_Pickler.save_bytescCs�|jdkr:|s |jtd|d�n|jtt|�f|d�dSt|�}||jjkrf|�tt	d|�|�n|�
tt	d|�|�dS)Nrrr)rz)r�r��	bytearrayr,r}r�r{r��
BYTEARRAY8r
r�r1rrr�save_bytearray)s
z_Pickler.save_bytearrayc	Cs�|jdkrtd��|���t}|js*td��d}|jdk	rFt|�|��}|rp|jr`|�|���q�|�	|���n|�
t�|jr�|�
t�W5QRXdS)Nrz0PickleBuffer can only pickled with protocol >= 5zHPickleBuffer can not be pickled when pointing to a non-contiguous bufferT)
r�r
�raw�
contiguousr��bool�readonlyr2�tobytesr5r��NEXT_BUFFER�READONLY_BUFFER)r"r��mZin_bandrrr�save_picklebuffer8s



z_Pickler.save_picklebuffercCs|jr�|�dd�}t|�}|dkrF|jdkrF|�ttd|�|�nf|dkrp|jdkrp|�ttd|�|�n<||j	j
kr�|�ttd|�|�n|�ttd|�|�nT|�d	d
�}|�dd�}|�d
d�}|�dd�}|�dd�}|�t
|�d�d�|�|�dS)N�utf-8�
surrogatepassr�rr�r+rzr��\z\u005c�z\u0000�
z\u000a�
z\u000d�z\u001a�raw-unicode-escaper�)r�r�r}r�r��SHORT_BINUNICODEr
r��BINUNICODE8r�r{�
BINUNICODE�replace�UNICODEr�r#rrr�save_strRs&�z_Pickler.save_strcCs:|s(|jr|�t�n|�tt�dSt|�}|j}|j}|dkr�|jdkr�|D]}||�qRt	|�|kr�|�
|t	|�d�}|�t||�n|�t|�|�
|�dS|j}|t�|D]}||�q�t	|�|k�r$|�
|t	|�d�}|j�r|t|�n|t|d|�dS|t�|�
|�dS)Nr�r�rr�)r�r��EMPTY_TUPLE�MARK�TUPLEr}r�r�r�r�r�r�_tuplesize2coder��POP_MARK)r"r�r�r�r�Zelementr�r�rrr�
save_tupleis:


z_Pickler.save_tuplecCs8|jr|�t�n|�tt�|�|�|�|�dSr)r�r��
EMPTY_LISTrN�LISTr�r	r�rrr�	save_list�s

z_Pickler.save_listi�cCs�|j}|j}|js0|D]}||�|t�qdSt|�}tt||j��}t|�}|dkr||t	�|D]}||�qd|t
�n|r�||d�|t�||jkr8dSq8dS�Nr�r)r�r�r��APPEND�iter�listr�
_BATCHSIZEr}rN�APPENDS)r"r�r�r�rl�it�tmpr�rrrr	�s(



z_Pickler._batch_appendscCs<|jr|�t�n|�tt�|�|�|�|���dSr)r�r��
EMPTY_DICTrN�DICTr�r
r�r�rrr�	save_dict�s

z_Pickler.save_dictc	Cs�|j}|j}|js<|D] \}}||�||�|t�qdSt|�}tt||j��}t|�}|dkr�|t	�|D]\}}||�||�qp|t
�n(|r�|d\}}||�||�|t�||jkrDdSqDdSrV)r�r�r��SETITEMrXrYrrZr}rN�SETITEMS)	r"r�r�r��k�vr\r]r�rrrr
�s0



z_Pickler._batch_setitemscCs�|j}|j}|jdkr0|jtt|�f|d�dS|t�|�|�t|�}tt	||j
��}t|�}|dkr�|t�|D]}||�qv|t
�||j
krJdSqJdS�Nrr)r)r�r�r�r��setrY�	EMPTY_SETr�rXrrZr}rN�ADDITEMS)r"r�r�r�r\Zbatchr��itemrrr�save_set�s"



z_Pickler.save_setcCs�|j}|j}|jdkr0|jtt|�f|d�dS|t�|D]}||�q<t|�|jkr||t	|�
|jt|�d��dS|t�|�|�dSre)
r�r�r�r��	frozensetrYrNr�r�rQr��	FROZENSETr�)r"r�r�r�rirrr�save_frozensets

 z_Pickler.save_frozensetc

CsX|j}|j}|dkr t|dd�}|dkr.|j}t||�}z(t|dd�tj|}t||�\}}Wn.t	t
tfk
r�td|||f�d�YnX||k	r�td|||f��|j
dk�rt�||f�}	|	�r|	dkr�|ttd|	��n0|	d	k�r|ttd
|	��n|ttd|	��dS|�d�d}
||k�r6|
}|j
d
k�r`|�|�|�|�|t�n�||k	�r||�t||
f�n�|j
dk�r�|tt|d�dt|d�d�n�|j�r�tj}tj}||f|k�r�|||f\}}n||k�r�||}z(|tt|d�dt|d�d�Wn,tk
�rHtd|||j
f�d�YnX|�|�dS)Nrr��levelz(Can't pickle %r: it's not found as %s.%sz2Can't pickle %r: it's not the same object as %s.%sr�r�r�rrrr�rr�r?r�r�z?can't pickle global identifier '%s.%s' using pickle protocol %i) r�r�r�rr��
__import__r�r�r��ImportError�KeyErrorr�r
r�rr��EXT1r
�EXT2�EXT4�
rpartitionr��STACK_GLOBALr��GLOBALr,r��_compat_pickleZREVERSE_NAME_MAPPINGZREVERSE_IMPORT_MAPPINGr�r�)
r"r�r�r�r�r�r�Zobj2r��codeZlastnameZr_name_mappingZr_import_mappingrrrr�s�

�����





��
��

���z_Pickler.save_globalcCs`|td�kr|jtd|d�S|tt�kr:|jttf|d�S|td�krV|jtd|d�S|�|�S)Nrr).).)r�r�r�r�r�rrr�	save_typeasz_Pickler.save_type)N)T)NNNNN)N)0rrrr#r�rr�r�r�r�r�r�r�r�rr�rr8r$r�r(�floatr2r,r5r3�_HAVE_PICKLE_BUFFERr>rrLr�rRr�rUrYrZr	r`�dictr$r
rjrfrmrkr�r{rrrrrr��sj�9
	
F�
u1		

B	r�c@s�eZdZddddd�dd�Zdd	�Zd
d�Zdd
�ZiZdd�Zeee	d<dd�Z
e
eed<dd�Zeee
d<dd�Zeeed<dd�Zeeed<dd�Zeeed<dd�Zeeed<dd�Zeeed<dd �Zeeed<d!d"�Zeeed<d#d$�Zeeed<d%d&�Zeeed<d'd(�Z e ee!d<d)d*�Z"e"ee#d<d+d,�Z$e$ee%d<d-d.�Z&e&ee'd<d/d0�Z(d1d2�Z)e)ee*d<d3d4�Z+e+ee,d<d5d6�Z-e-ee.d<d7d8�Z/e/ee0d<d9d:�Z1e1ee2d<d;d<�Z3e3ee4d<d=d>�Z5e5ee6d<d?d@�Z7e7ee8d<dAdB�Z9e9ee:d<dCdD�Z;e;ee<d<dEdF�Z=e=ee>d<dGdH�Z?e?ee@d<dIdJ�ZAeAeeBd<dKdL�ZCeCeeDd<dMdN�ZEeEeeFd<dOdP�ZGeGeeHd<dQdR�ZIeIeeJd<dSdT�ZKeKeeLd<dUdV�ZMeMeeNd<dWdX�ZOeOeePd<dYdZ�ZQeQeeRd<d[d\�ZSeSeeTd<d]d^�ZUeUeeVd<d_d`�ZWeWeeXd<dadb�ZYdcdd�ZZeZee[d<dedf�Z\e\ee]d<dgdh�Z^e^ee_d<didj�Z`e`eead<dkdl�Zbebeecd<dmdn�Zdedeeed<dodp�Zfefeegd<dqdr�Zheheeid<dsdt�Zjejeekd<dudv�Zldwdx�Zmdydz�Zneneeod<d{d|�Zpepeeqd<d}d~�Zrereesd<dd��Zteteeud<d�d��Zveveewd<d�d��Zxexeeyd<d�d��Zzezee{d<d�d��Z|e|ee}d<d�d��Z~e~eed<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<dS)��
_UnpicklerT�ASCII�strictN�r��encoding�errors�bufferscCsH|dk	rt|�nd|_|j|_|j|_i|_||_||_d|_	||_
dS�Nr)rX�_buffersr��_file_readliner��
_file_readr�r�r�r�r�)r"r�r�r�r�r�rrrr#rs'z_Unpickler.__init__c
Cs�t|d�std|jjf��t|j|j�|_|jj|_|jj	|_	|jj
|_
g|_g|_|jj
|_
d|_|j}|j}z&|d�}|s�t�||d|�qtWn,tk
r�}z|jWY�Sd}~XYnXdS)Nr�z4Unpickler.__init__() was not called by %s.__init__()rr�)r�rr�rr�r�r��	_unframerr�r�r��	metastack�stack�appendr�r��EOFErrorrr )r"r�r��keyZstopinstrrrr�s*
�



z_Unpickler.loadcCs |j}|j��|_|jj|_|Sr)r�r��popr��r"r�rrr�pop_mark�s
z_Unpickler.pop_markcCstd��dS)Nz%unsupported persistent id encountered)rr�rrr�persistent_load�sz_Unpickler.persistent_loadcCs:|�d�d}d|kr"tks0ntd|��||_dS)Nr�rzunsupported pickle protocol: %d)r�r�r�r�)r"r�rrr�
load_proto�sz_Unpickler.load_protorcCs8td|�d��\}|tjkr(td|��|j�|�dS)Nrz�zframe size > sys.maxsize: %d)rr�r�r	r�r�r�r�rrrr��s
z_Unpickler.load_framecCsLz|��dd��d�}Wntk
r6td��YnX|�|�|��dS)Nr�r�r�)r��decode�UnicodeDecodeErrorrr�r�r�rrr�load_persid�s�
z_Unpickler.load_persidcCs|j��}|�|�|��dSr)r�r�r�r�r�rrr�load_binpersid�s
z_Unpickler.load_binpersidcCs|�d�dSr�r�rsrrr�	load_none�sz_Unpickler.load_nonecCs|�d�dS)NFr�rsrrr�
load_false�sz_Unpickler.load_falsecCs|�d�dS)NTr�rsrrr�	load_true�sz_Unpickler.load_truecCsL|��}|tdd�krd}n |tdd�kr4d}n
t|d�}|�|�dS)Nr�FTr)r�rrr�r�)r"r��valrrr�load_int�s
z_Unpickler.load_intcCs|�td|�d��d�dS)Nrrr�r�rr�rsrrr�load_binint�sz_Unpickler.load_binintcCs|�|�d�d�dSrV)r�r�rsrrr�load_binint1sz_Unpickler.load_binint1cCs|�td|�d��d�dS)Nrr�rr�rsrrr�load_binint2sz_Unpickler.load_binint2cCs@|��dd�}|r,|ddkr,|dd�}|�t|d��dS)Nr��Lr)r�r�r�)r"r�rrr�	load_longsz_Unpickler.load_longcCs*|�d�d}|�|�}|�t|��dSrV)r�r�r�r�rrr�
load_long1s
z_Unpickler.load_long1cCs>td|�d��\}|dkr"td��|�|�}|�t|��dS)Nrrrz#LONG pickle has negative byte count)rr�rr�r�r�rrr�
load_long4s

z_Unpickler.load_long4cCs|�t|��dd���dS�Nr�)r�r|r�rsrrr�
load_float!sz_Unpickler.load_floatcCs|�td|�d��d�dS)Nr%r�rr�rsrrr�
load_binfloat%sz_Unpickler.load_binfloatcCs"|jdkr|S|�|j|j�SdS)Nr,)r�r�r�r!rrr�_decode_string)s
z_Unpickler._decode_stringcCsl|��dd�}t|�dkrF|d|dkrF|ddkrF|dd�}ntd��|�|�t�|�d��dS)Nr�r�rs"'r�z)the STRING opcode argument must be quoted)r�r}rr�r�r-�
escape_decoder�rrr�load_string2s
(z_Unpickler.load_stringcCs@td|�d��\}|dkr"td��|�|�}|�|�|��dS)Nrrrz(BINSTRING pickle has negative byte count)rr�rr�r��r"r}r�rrr�load_binstring<s

z_Unpickler.load_binstringcCs:td|�d��\}|tkr&tdt��|�|�|��dS)Nr�rz2BINBYTES exceeds system's maximum size of %d bytes�rr�r	rr��r"r}rrr�
load_binbytesEs�z_Unpickler.load_binbytescCs |�t|��dd�d��dS)Nr�rF)r�r�r�rsrrr�load_unicodeMsz_Unpickler.load_unicodecCsBtd|�d��\}|tkr&tdt��|�t|�|�dd��dS)Nr�rz4BINUNICODE exceeds system's maximum size of %d bytesr?r@�rr�r	rr�r�r�rrr�load_binunicodeQs�z_Unpickler.load_binunicodecCsBtd|�d��\}|tkr&tdt��|�t|�|�dd��dS)Nrzr�z5BINUNICODE8 exceeds system's maximum size of %d bytesr?r@r�r�rrr�load_binunicode8Ys�z_Unpickler.load_binunicode8cCs:td|�d��\}|tkr&tdt��|�|�|��dS)Nrzr�z3BINBYTES8 exceeds system's maximum size of %d bytesr�r�rrr�load_binbytes8as�z_Unpickler.load_binbytes8cCsFtd|�d��\}|tkr&tdt��t|�}|�|�|�|�dS)Nrzr�z4BYTEARRAY8 exceeds system's maximum size of %d bytes)rr�r	rr3r�r�)r"r}�brrr�load_bytearray8is�
z_Unpickler.load_bytearray8cCsL|jdkrtd��zt|j�}Wntk
r<td��YnX|�|�dS)NzLpickle stream refers to out-of-band data but no *buffers* argument was givenznot enough out-of-band buffers)r�r�next�
StopIterationr�)r"r�rrr�load_next_bufferss
z_Unpickler.load_next_bufferc	Cs6|jd}t|��}|js(|��|jd<W5QRXdSr�)r��
memoryviewr9�
toreadonly)r"r�r=rrr�load_readonly_buffer~s

z_Unpickler.load_readonly_buffercCs,|�d�d}|�|�}|�|�|��dSrV)r�r�r�r�rrr�load_short_binstring�s
z_Unpickler.load_short_binstringcCs"|�d�d}|�|�|��dSrV)r�r�r�rrr�load_short_binbytes�sz_Unpickler.load_short_binbytescCs*|�d�d}|�t|�|�dd��dS)Nr�rr?r@)r�r�r�r�rrr�load_short_binunicode�sz _Unpickler.load_short_binunicodecCs|��}|�t|��dSr)r�r�r�r�rrr�
load_tuple�sz_Unpickler.load_tuplecCs|�d�dS)Nrr�rsrrr�load_empty_tuple�sz_Unpickler.load_empty_tuplecCs|jdf|jd<dSr��r�rsrrr�load_tuple1�sz_Unpickler.load_tuple1cCs$|jd|jdfg|jdd�<dS)Nr�r�r�rsrrr�load_tuple2�sz_Unpickler.load_tuple2cCs,|jd|jd|jdfg|jdd�<dS)N���r�r�r�rsrrr�load_tuple3�sz_Unpickler.load_tuple3cCs|�g�dSrr�rsrrr�load_empty_list�sz_Unpickler.load_empty_listcCs|�i�dSrr�rsrrr�load_empty_dictionary�sz _Unpickler.load_empty_dictionarycCs|�t��dSr)r�rfrsrrr�load_empty_set�sz_Unpickler.load_empty_setcCs|��}|�t|��dSr)r�r�rkr�rrr�load_frozenset�sz_Unpickler.load_frozensetcCs|��}|�|�dSr)r�r�r�rrr�	load_list�sz_Unpickler.load_listcs4|����fdd�tdt��d�D�}|�|�dS)Ncsi|]}�|�|d�qS)r�r)rkr��r�rr�
<dictcomp>�s�z(_Unpickler.load_dict.<locals>.<dictcomp>rr�)r��ranger}r�)r"�drr�r�	load_dict�s

�z_Unpickler.load_dictc
Cs�|st|t�rt|d�rjz||�}Wqttk
rf}z$td|jt|�ft��d��W5d}~XYqtXn
|�|�}|�	|�dS)NZ__getinitargs__zin constructor for %s: %sr�)
r�r�r�r�rr�r��exc_inforr�)r"�klassrr �errrrr�_instantiate�s��
�
z_Unpickler._instantiatecCsL|��dd��d�}|��dd��d�}|�||�}|�||���dS)Nr�r�)r�r��
find_classr�r��r"r�r�r�rrr�	load_inst�sz_Unpickler.load_instcCs"|��}|�d�}|�||�dSr�)r�r�r�)r"rrrrr�load_obj�s
z_Unpickler.load_objcCs2|j��}|j��}|j|f|��}|�|�dSr�r�r�rr�)r"rrr�rrr�load_newobj�s

z_Unpickler.load_newobjcCs>|j��}|j��}|j��}|j|f|�|�}|�|�dSrr�)r"rrrr�rrr�load_newobj_ex�s



z_Unpickler.load_newobj_excCsF|��dd��d�}|��dd��d�}|�||�}|�|�dS)Nr�r?)r�r�r�r�r�rrr�load_global�sz_Unpickler.load_globalcCsJ|j��}|j��}t|�tk	s,t|�tk	r4td��|�|�||��dS)NzSTACK_GLOBAL requires str)r�r�r�r�rr�r�)r"r�r�rrr�load_stack_global�s


z_Unpickler.load_stack_globalcCs|�d�d}|�|�dSrV)r��
get_extension�r"rzrrr�	load_ext1sz_Unpickler.load_ext1cCs td|�d��\}|�|�dS)Nrr��rr�r�r�rrr�	load_ext2	sz_Unpickler.load_ext2cCs td|�d��\}|�|�dS)Nrrr�r�rrr�	load_ext4sz_Unpickler.load_ext4cCspg}t�||�}||k	r&|�|�dSt�|�}|sP|dkrDtd��td|��|j|�}|t|<|�|�dS)NrzEXT specifies code <= 0zunregistered extension code %d)rr�r�rrr�r�)r"rzZnilr�r�rrrr�s


z_Unpickler.get_extensioncCs�t�d||�|jdkrT|jrT||ftjkr@tj||f\}}n|tjkrTtj|}t|dd�|jdkr~ttj	||�dSt
tj	||�SdS)Nzpickle.find_classr�rrnr)r��auditr�r�ryZNAME_MAPPINGZIMPORT_MAPPINGrpr�r�r�)r"r�r�rrrr�#s


z_Unpickler.find_classcCs&|j}|��}|d}||�|d<dSr��r�r�)r"r�rr
rrr�load_reduce1sz_Unpickler.load_reducecCs|jr|jd=n|��dSr�)r�r�rsrrr�load_pop8s
z_Unpickler.load_popcCs|��dSr)r�rsrrr�
load_pop_mark?sz_Unpickler.load_pop_markcCs|�|jd�dSr�)r�r�rsrrr�load_dupCsz_Unpickler.load_dupcCs(t|��dd��}|�|j|�dSr�)r�r�r�r�r�rrr�load_getGsz_Unpickler.load_getcCs"|�d�d}|�|j|�dSrV)r�r�r�r�rrr�load_bingetLsz_Unpickler.load_bingetcCs&td|�d��\}|�|j|�dS)Nr�r)rr�r�r�r�rrr�load_long_bingetQsz_Unpickler.load_long_bingetcCs8t|��dd��}|dkr$td��|jd|j|<dS)Nr�rznegative PUT argument)r�r�r�r�r�r�rrr�load_putVsz_Unpickler.load_putcCs2|�d�d}|dkrtd��|jd|j|<dS)Nr�rznegative BINPUT argumentr�)r�r�r�r�r�rrr�load_binput]sz_Unpickler.load_binputcCs6td|�d��\}|tkr"td��|jd|j|<dS)Nr�rznegative LONG_BINPUT argumentr�)rr�r	r�r�r�r�rrr�load_long_binputdsz_Unpickler.load_long_binputcCs|j}|jd|t|�<dSr�)r�r�r})r"r�rrr�load_memoizeksz_Unpickler.load_memoizecCs$|j}|��}|d}|�|�dSr�)r�r�r�)r"r�r rYrrr�load_appendpsz_Unpickler.load_appendcCsZ|��}|jd}z
|j}Wntk
r0YnX||�dS|j}|D]}||�qHdSr�)r�r��extendr�r�)r"r�Zlist_objr�r�rirrr�load_appendsws

z_Unpickler.load_appendscCs*|j}|��}|��}|d}|||<dSr�r�)r"r�r r�r~rrr�load_setitem�s
z_Unpickler.load_setitemcCs@|��}|jd}tdt|�d�D]}||d|||<q"dS)Nr�rr�r�)r�r�r�r})r"r�r~r�rrr�
load_setitems�s
z_Unpickler.load_setitemscCsD|��}|jd}t|t�r(|�|�n|j}|D]}||�q2dSr�)r�r�r�rf�update�add)r"r�Zset_objr�rirrr�
load_additems�s

z_Unpickler.load_additemsc
Cs�|j}|��}|d}t|dd�}|dk	r6||�dSd}t|t�rXt|�dkrX|\}}|r�|j}tj}|�	�D]*\}}	t
|�tkr�|	|||�<qp|	||<qp|r�|�	�D]\}}	t|||	�q�dS)Nr��__setstate__r�)
r�r�r�r�r�r}�__dict__r��internr�r�r��setattr)
r"r�r�inst�setstateZ	slotstateZ	inst_dictr�rcrdrrr�
load_build�s(
z_Unpickler.load_buildcCs"|j�|j�g|_|jj|_dSr)r�r�r�rsrrr�	load_mark�sz_Unpickler.load_markcCs|j��}t|��dSr)r�r�rr!rrr�	load_stop�s
z_Unpickler.load_stop)�rrrr#rr�r�r�r�r�r�rr�r�r�r�r�rr�rr�rr�r!r�rr�rr�rr�r"r�rr�r r�r'r�r&r�r��STRINGr��	BINSTRINGr�r0r�rKr�rIr�rHr�r/r�r4r�r;r�r<r��SHORT_BINSTRINGr�r.r�rGr�rOr�rMr��TUPLE1r�rr��TUPLE3r�rSr�r^r�rgr�rlr�rTr�r_r�r��INSTr��OBJr�rr�rr�rxr�rwr�rsr�rtr�rur�r�r�rr�rr�rQr��DUPr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rWr�r[r�rar�rbr�rhrrrrNrr�rrrrrps*�0				rr�cCst||||d��|�dS�Nr�)r�r)r�r�r�r�r�rrr�_dump�s
��rcCs*t��}t||||d��|�|��}|Sr
)rqrrr�r�getvalue)r�r�r�r�r��resrrr�_dumps�s��rr�r�r�cCst|||||d���S)N�r�r�r�r�)rr)r�r�r�r�r�rrr�_load�s�rcCs2t|t�rtd��t�|�}t|||||d���S)Nz%Can't load pickle from unicode stringr)r�r�r�rqrrrr)�sr�r�r�r�r�rrr�_loads�s

�r)	rr
rrrrrrrcCsddl}|��Sr�)�doctestZtestmod)rrrr�_test�srr�z$display contents of the pickle files)Zdescription�pickle_file�br�*zthe pickle file)r��nargs�helpz-tz--test�
store_truezrun self-test suite)�actionrz-vz)run verbosely; only affects self-test run)N)N)��typesr�copyregrrrr�	itertoolsr�	functoolsrr�r	Zstructr
rrirqr-ry�__all__�_picklerr�r}rqr,r3Zbytes_typesZformat_versionZcompatible_formatsr�r��	Exceptionrr
rrZorg.python.corer$rNr�rrQrr'r!rrr"rrr�r�rrrrrKrIrWrrxr_r^r[r�r�r
r�rTrSrr�r�r�rarOrMrbr&rrr�rrsrtrurrr	rrrr rPr0r.rGrHr/rgrhrlrrwr�rr4r;r<r��dirrnr�r�r�r�r�r�rrrrrrrrrrrrr�argparse�ArgumentParser�parser�add_argumentZFileType�
parse_argsrZtestrZ
print_helpZpprintr�r�rrrr�<module>sf�

�

?;
^]��	0

����

__pycache__/ssl.cpython-38.pyc000064400000127066151153537610012230 0ustar00U

e5dH��
@s�dZddlZddlZddlmZddlmZmZ	m
ZddlZddlm
Z
mZmZddlmZmZmZddlmZmZmZmZmZmZmZddlmZmZdd	lmZmZm Z m!Z!zdd
lm"Z"Wne#k
r�YnXddlm$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-ddlm.Z.m/Z/e	j0d
e1dd�ed�ej0de1dd�ed�e	j0de1dd�ed�e	j0de1dd�ed�ej0de1dd�ed�e	j0de1dd�ed�e2j3Z4e2_4dd�e2j5�6�D�Z7e8e2dd�Z9Gdd�de	�Z:Gd d!�d!e	�Z;Gd"d#�d#e	�Z<Gd$d%�d%e	�Z=ej>d&k�r"dd'lm?Z?m@Z@dd(lAmAZAmBZBmCZCmDZDdd)lAmEZEmFZFddlAZGddlHZHddlIZIddlJZJeKZLd*gZMeNed+�ZOe.ZPeZQd,d-�ZRd.d/�ZSd0d1�ZTd2d3�ZUed4d5�ZVd6d7�ZWGd8d9�d9ed9d:��ZXGd;d<�d<eXe�ZYGd=d>�d>e�ZZeYj[fdddd?�d@dA�Z\e3fe]dBeYj[ddddddC�dDdE�Z^e\Z_e^Z`GdFdG�dG�ZadHdI�ZbGdJdK�dKeA�ZceceZ_deaeZ_edddBe]e3ddLdLdf	dMdN�ZfdOdP�ZgdQZhdRZidSdT�ZjdUdV�Zke3dfdWdX�ZldYdZ�ZmdS)[a�
This module provides some more Pythonic support for SSL.

Object types:

  SSLSocket -- subtype of socket.socket which does SSL over the socket

Exceptions:

  SSLError -- exception raised for I/O errors

Functions:

  cert_time_to_seconds -- convert time string used for certificate
                          notBefore and notAfter functions to integer
                          seconds past the Epoch (the time values
                          returned from time.time())

  fetch_server_certificate (HOST, PORT) -- fetch the certificate provided
                          by the server running on HOST at port PORT.  No
                          validation of the certificate is performed.

Integer constants:

SSL_ERROR_ZERO_RETURN
SSL_ERROR_WANT_READ
SSL_ERROR_WANT_WRITE
SSL_ERROR_WANT_X509_LOOKUP
SSL_ERROR_SYSCALL
SSL_ERROR_SSL
SSL_ERROR_WANT_CONNECT

SSL_ERROR_EOF
SSL_ERROR_INVALID_ERROR_CODE

The following group define certificate requirements that one side is
allowing/requiring from the other side:

CERT_NONE - no certificates from the other side are required (or will
            be looked at if provided)
CERT_OPTIONAL - certificates are not required, but if provided will be
                validated, and if validation fails, the connection will
                also fail
CERT_REQUIRED - certificates are required, and will be validated, and
                if validation fails, the connection will also fail

The following constants identify various SSL protocol variants:

PROTOCOL_SSLv2
PROTOCOL_SSLv3
PROTOCOL_SSLv23
PROTOCOL_TLS
PROTOCOL_TLS_CLIENT
PROTOCOL_TLS_SERVER
PROTOCOL_TLSv1
PROTOCOL_TLSv1_1
PROTOCOL_TLSv1_2

The following constants identify various SSL alert message descriptions as per
http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-6

ALERT_DESCRIPTION_CLOSE_NOTIFY
ALERT_DESCRIPTION_UNEXPECTED_MESSAGE
ALERT_DESCRIPTION_BAD_RECORD_MAC
ALERT_DESCRIPTION_RECORD_OVERFLOW
ALERT_DESCRIPTION_DECOMPRESSION_FAILURE
ALERT_DESCRIPTION_HANDSHAKE_FAILURE
ALERT_DESCRIPTION_BAD_CERTIFICATE
ALERT_DESCRIPTION_UNSUPPORTED_CERTIFICATE
ALERT_DESCRIPTION_CERTIFICATE_REVOKED
ALERT_DESCRIPTION_CERTIFICATE_EXPIRED
ALERT_DESCRIPTION_CERTIFICATE_UNKNOWN
ALERT_DESCRIPTION_ILLEGAL_PARAMETER
ALERT_DESCRIPTION_UNKNOWN_CA
ALERT_DESCRIPTION_ACCESS_DENIED
ALERT_DESCRIPTION_DECODE_ERROR
ALERT_DESCRIPTION_DECRYPT_ERROR
ALERT_DESCRIPTION_PROTOCOL_VERSION
ALERT_DESCRIPTION_INSUFFICIENT_SECURITY
ALERT_DESCRIPTION_INTERNAL_ERROR
ALERT_DESCRIPTION_USER_CANCELLED
ALERT_DESCRIPTION_NO_RENEGOTIATION
ALERT_DESCRIPTION_UNSUPPORTED_EXTENSION
ALERT_DESCRIPTION_CERTIFICATE_UNOBTAINABLE
ALERT_DESCRIPTION_UNRECOGNIZED_NAME
ALERT_DESCRIPTION_BAD_CERTIFICATE_STATUS_RESPONSE
ALERT_DESCRIPTION_BAD_CERTIFICATE_HASH_VALUE
ALERT_DESCRIPTION_UNKNOWN_PSK_IDENTITY
�N)�
namedtuple)�Enum�IntEnum�IntFlag)�OPENSSL_VERSION_NUMBER�OPENSSL_VERSION_INFO�OPENSSL_VERSION)�_SSLContext�	MemoryBIO�
SSLSession)�SSLError�SSLZeroReturnError�SSLWantReadError�SSLWantWriteError�SSLSyscallError�SSLEOFError�SSLCertVerificationError)�txt2obj�nid2obj)�RAND_status�RAND_add�
RAND_bytes�RAND_pseudo_bytes)�RAND_egd)
�HAS_SNI�HAS_ECDH�HAS_NPN�HAS_ALPN�	HAS_SSLv2�	HAS_SSLv3�	HAS_TLSv1�HAS_TLSv1_1�HAS_TLSv1_2�HAS_TLSv1_3)�_DEFAULT_CIPHERS�_OPENSSL_API_VERSION�
_SSLMethodcCs|�d�o|dkS)NZ	PROTOCOL_�PROTOCOL_SSLv23��
startswith��name�r,�/usr/lib64/python3.8/ssl.py�<lambda>|�r.)�source�OptionscCs
|�d�S)NZOP_r(r*r,r,r-r.�r/ZAlertDescriptioncCs
|�d�S)NZALERT_DESCRIPTION_r(r*r,r,r-r.�r/ZSSLErrorNumbercCs
|�d�S)NZ
SSL_ERROR_r(r*r,r,r-r.�r/�VerifyFlagscCs
|�d�S)NZVERIFY_r(r*r,r,r-r.�r/�
VerifyModecCs
|�d�S)NZCERT_r(r*r,r,r-r.�r/cCsi|]\}}||�qSr,r,)�.0r+�valuer,r,r-�
<dictcomp>�sr6ZPROTOCOL_SSLv2c@s6eZdZejZejZejZ	ej
ZejZ
ejZejZdS)�
TLSVersionN)�__name__�
__module__�__qualname__�_sslZPROTO_MINIMUM_SUPPORTEDZMINIMUM_SUPPORTEDZPROTO_SSLv3�SSLv3ZPROTO_TLSv1ZTLSv1Z
PROTO_TLSv1_1ZTLSv1_1Z
PROTO_TLSv1_2ZTLSv1_2Z
PROTO_TLSv1_3ZTLSv1_3ZPROTO_MAXIMUM_SUPPORTEDZMAXIMUM_SUPPORTEDr,r,r,r-r7�sr7c@s(eZdZdZdZdZdZdZdZdZ	dS)	�_TLSContentTypez@Content types (record layer)

    See RFC 8446, section B.1
    ������N)
r8r9r:�__doc__�CHANGE_CIPHER_SPEC�ALERTZ	HANDSHAKEZAPPLICATION_DATA�HEADERZINNER_CONTENT_TYPEr,r,r,r-r=�sr=c@s�eZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"d!Z#d"Z$d#Z%d$S)%�
_TLSAlertTypezQAlert types for TLSContentType.ALERT messages

    See RFC 8466, section B.2
    r�
r>r?r@��(�)�*�+�,�-�.�/�0�1�2�3�<�F�G�P�V�Z�d�m�n�o�p�q�r�s�t�xN)&r8r9r:rDZCLOSE_NOTIFYZUNEXPECTED_MESSAGEZBAD_RECORD_MACZDECRYPTION_FAILEDZRECORD_OVERFLOWZDECOMPRESSION_FAILUREZHANDSHAKE_FAILUREZNO_CERTIFICATEZBAD_CERTIFICATEZUNSUPPORTED_CERTIFICATEZCERTIFICATE_REVOKEDZCERTIFICATE_EXPIREDZCERTIFICATE_UNKNOWNZILLEGAL_PARAMETERZ
UNKNOWN_CAZ
ACCESS_DENIEDZDECODE_ERRORZ
DECRYPT_ERRORZEXPORT_RESTRICTIONZPROTOCOL_VERSIONZINSUFFICIENT_SECURITYZINTERNAL_ERRORZINAPPROPRIATE_FALLBACKZ
USER_CANCELEDZNO_RENEGOTIATIONZMISSING_EXTENSIONZUNSUPPORTED_EXTENSIONZCERTIFICATE_UNOBTAINABLEZUNRECOGNIZED_NAMEZBAD_CERTIFICATE_STATUS_RESPONSEZBAD_CERTIFICATE_HASH_VALUEZUNKNOWN_PSK_IDENTITYZCERTIFICATE_REQUIREDZNO_APPLICATION_PROTOCOLr,r,r,r-rH�sFrHc@sheZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZdZdZdZdS)�_TLSMessageTypezFMessage types (handshake protocol)

    See RFC 8446, section B.3
    r����������
���r>r?r@rA��C�rCN)r8r9r:rDZ
HELLO_REQUESTZCLIENT_HELLOZSERVER_HELLOZHELLO_VERIFY_REQUESTZNEWSESSION_TICKETZEND_OF_EARLY_DATAZHELLO_RETRY_REQUESTZENCRYPTED_EXTENSIONSZCERTIFICATEZSERVER_KEY_EXCHANGEZCERTIFICATE_REQUESTZSERVER_DONEZCERTIFICATE_VERIFYZCLIENT_KEY_EXCHANGEZFINISHEDZCERTIFICATE_URLZCERTIFICATE_STATUSZSUPPLEMENTAL_DATAZ
KEY_UPDATEZ
NEXT_PROTOZMESSAGE_HASHrEr,r,r,r-rg�s.rg�win32)�enum_certificates�	enum_crls)�socket�AF_INET�SOCK_STREAM�create_connection)�
SOL_SOCKET�SO_TYPE�
tls-unique�HOSTFLAG_NEVER_CHECK_SUBJECTcCs�|sdS|�d�}|s&|��|��kS|dkr<td�|���|�d�\}}}d|krbtd�|���|sttd�|���|dkr�td�|���|�d�\}}}|r�|s�dS|��|��kS)	a�Matching according to RFC 6125, section 6.4.3

    - Hostnames are compared lower case.
    - For IDNA, both dn and hostname must be encoded as IDN A-label (ACE).
    - Partial wildcards like 'www*.example.org', multiple wildcards, sole
      wildcard or wildcards in labels other then the left-most label are not
      supported and a CertificateError is raised.
    - A wildcard must match at least one character.
    F�*rhz1too many wildcards in certificate DNS name: {!r}.�.z9wildcard can only be present in the leftmost label: {!r}.z>sole wildcard without additional labels are not support: {!r}.z<partial wildcards in leftmost label are not supported: {!r}.)�count�lower�CertificateError�format�	partition)Zdn�hostnameZ	wildcardsZdn_leftmost�sepZdn_remainderZhostname_leftmostZhostname_remainderr,r,r-�_dnsname_matchs@

�������r�cCs�zt�|�}Wntk
r"Yn"Xt�|�|kr6|Std�|���zt�tj|�WStk
rvtd�|���Yntk
r�YnXtd�|���dS)z�Try to convert an IP address to packed binary form

    Supports IPv4 addresses on all platforms and IPv6 on platforms with IPv6
    support.
    z'{!r} is not a quad-dotted IPv4 address.z+{!r} is neither an IPv4 nor an IP6 address.z{!r} is not an IPv4 address.N)	�_socketZ	inet_aton�OSErrorZ	inet_ntoa�
ValueErrorr�Z	inet_ptonZAF_INET6�AttributeError)Zipname�addrr,r,r-�_inet_patonDs$��
r�cCst|���}||kS)z�Exact matching of IP addresses.

    RFC 6125 explicitly doesn't define an algorithm for this
    (section 1.7.2 - "Out of Scope").
    )r��rstrip)Zcert_ipaddress�host_ipZipr,r,r-�_ipaddress_matchgsr�cCsJ|std��zt|�}Wntk
r0d}YnXg}|�dd�}|D]^\}}|dkrz|dkrnt||�rndS|�|�qF|dkrF|dk	r�t||�r�dS|�|�qF|s�|�dd�D]6}|D],\}}|dkr�t||�r�dS|�|�q�q�t|�d	k�rtd
|d�t	t
|��f��n,t|�d	k�r>td||d
f��ntd��dS)a�Verify that *cert* (in decoded format as returned by
    SSLSocket.getpeercert()) matches the *hostname*.  RFC 2818 and RFC 6125
    rules are followed.

    The function matches IP addresses rather than dNSNames if hostname is a
    valid ipaddress string. IPv4 addresses are supported on all platforms.
    IPv6 addresses are supported on platforms with IPv6 support (AF_INET6
    and inet_pton).

    CertificateError is raised on failure. On success, the function
    returns nothing.
    ztempty or no certificate, match_hostname needs a SSL socket or SSL context with either CERT_OPTIONAL or CERT_REQUIREDNZsubjectAltNamer,ZDNSz
IP AddressZsubjectZ
commonNamerhz&hostname %r doesn't match either of %sz, zhostname %r doesn't match %rrz=no appropriate commonName or subjectAltName fields were found)r�r��getr��appendr��lenr��join�map�repr)�certr�r�ZdnsnamesZsan�keyr5�subr,r,r-�match_hostnamessB


�
�r��DefaultVerifyPathszQcafile capath openssl_cafile_env openssl_cafile openssl_capath_env openssl_capathcCsdt��}tj�|d|d�}tj�|d|d�}ttj�|�rF|ndtj�|�rX|ndf|��S)z/Return paths to default cafile and capath.
    rrhrirjN)	r;�get_default_verify_paths�os�environr�r��path�isfile�isdir)�parts�cafile�capathr,r,r-r��s��r�csDeZdZdZdZ�fdd�Ze�fdd��Ze�fdd��Z�Z	S)	�_ASN1Objectz#ASN.1 object identifier lookup
    r,cst�j|ft|dd���S)NFr*��super�__new__�_txt2obj)�cls�oid��	__class__r,r-r��sz_ASN1Object.__new__cst�j|ft|���S)z3Create _ASN1Object from OpenSSL numeric ID
        )r�r��_nid2obj)r�Znidr�r,r-�fromnid�sz_ASN1Object.fromnidcst�j|ft|dd���S)z=Create _ASN1Object from short name, long name or OID
        Tr*r�)r�r+r�r,r-�fromname�sz_ASN1Object.fromname)
r8r9r:rD�	__slots__r��classmethodr�r��
__classcell__r,r,r�r-r��sr�znid shortname longname oidc@seZdZdZdZdZdS)�PurposezDSSLContext purpose flags with X509v3 Extended Key Usage objects
    z1.3.6.1.5.5.7.3.1z1.3.6.1.5.5.7.3.2N)r8r9r:rD�SERVER_AUTHZCLIENT_AUTHr,r,r,r-r��sr�cs�eZdZdZdZdZdZefdd�Zdd�Z	d2d
d�Z
d3dd
�Zdd�Zdd�Z
dd�Zdd�Zejfdd�Zeed�r�e�fdd��Zej�fdd��Ze�fdd��Zej�fdd��Ze�fdd ��Zej�fd!d ��Zeed"��red#d$��Zejd%d$��Zned&d$��Ze�fd'd(��Zej�fd)d(��Ze�fd*d+��Ze�fd,d-��Zej�fd.d-��Ze�fd/d0��Zej�fd1d0��Z�Z S)4�
SSLContextz|An SSLContext holds various SSL-related configuration options and
    data, such as certificates and possibly a private key.)ZCAZROOTNcOst�||�}|S�N)r	r�)r��protocol�args�kwargs�selfr,r,r-r��szSSLContext.__new__cCs4|dkrdSt|t�r&|�d��d�S|�d�SdS)NZidna�ascii)�
isinstance�str�encode�decode)r�r�r,r,r-�_encode_hostname�s

zSSLContext._encode_hostnameFTc	Cs|jj|||||||d�S)N)�sock�server_side�do_handshake_on_connect�suppress_ragged_eofs�server_hostname�context�session)�sslsocket_class�_create)r�r�r�r�r�r�r�r,r,r-�wrap_socket�s�zSSLContext.wrap_socketcCs|jj||||�|�||d�S)N)r�r�r�r�)�sslobject_classr�r�)r��incoming�outgoingr�r�r�r,r,r-�wrap_bio�s�zSSLContext.wrap_biocCs`t�}|D]F}t|d�}t|�dks0t|�dkr8td��|�t|��|�|�q
|�|�dS)Nr�r�z(NPN protocols must be 1 to 255 in length)�	bytearray�bytesr�rr��extendZ_set_npn_protocols)r�Z
npn_protocols�protosr��br,r,r-�set_npn_protocolss
zSSLContext.set_npn_protocolscs8�dkrd�_n$t��s td����fdd�}|�_dS)Nznot a callable objectcs��|�}�|||�Sr�)r�)�sslobjZ
servernameZsslctx�r��server_name_callbackr,r-�shim_cbs
z3SSLContext.set_servername_callback.<locals>.shim_cb)Zsni_callback�callable�	TypeError)r�r�r�r,r�r-�set_servername_callbacksz"SSLContext.set_servername_callbackcCs`t�}|D]F}t|d�}t|�dks0t|�dkr8td��|�t|��|�|�q
|�|�dS)Nr�rr�z)ALPN protocols must be 1 to 255 in length)r�r�r�rr�r�Z_set_alpn_protocols)r�Zalpn_protocolsr�r�r�r,r,r-�set_alpn_protocols s
zSSLContext.set_alpn_protocolscCsvt�}z<t|�D].\}}}|dkr|dks4|j|kr|�|�qWntk
r`t�d�YnX|rr|j|d�|S)NZx509_asnTz-unable to enumerate Windows certificate store)�cadata)r�ryr�r��PermissionError�warnings�warn�load_verify_locations)r��	storename�purposeZcertsr��encodingZtrustr,r,r-�_load_windows_store_certs+sz$SSLContext._load_windows_store_certscCs@t|t�st|��tjdkr4|jD]}|�||�q"|��dS)Nrx)r�r�r��sys�platform�_windows_cert_storesr�Zset_default_verify_paths)r�r�r�r,r,r-�load_default_certs9s


zSSLContext.load_default_certs�minimum_versioncstt�j�Sr�)r7r�r��r�r�r,r-r�BszSSLContext.minimum_versioncs4|tjkr|jtjM_ttt�j�||�dSr�)	r7r<�optionsr1ZOP_NO_SSLv3r�r�r��__set__�r�r5r�r,r-r�Fs
cstt�j�Sr�)r7r��maximum_versionr�r�r,r-r�LszSSLContext.maximum_versioncsttt�j�||�dSr�)r�r�r�r�r�r�r,r-r�Pscstt�j�Sr�)r1r�r�r�r�r,r-r�TszSSLContext.optionscsttt�j�||�dSr�)r�r�r�r�r�r�r,r-r�Xsr�cCs|jtj@}|tjkSr��Z_host_flagsr;r�)r�Zncsr,r,r-�hostname_checks_common_name]sz&SSLContext.hostname_checks_common_namecCs,|r|jtjM_n|jtjO_dSr�r�r�r,r,r-r�bscCsdS)NTr,r�r,r,r-r�iscst�j}|dk	r|jSdSdS)a9TLS message callback

        The message callback provides a debugging hook to analyze TLS
        connections. The callback is called for any TLS protocol message
        (header, handshake, alert, and more), but not for application data.
        Due to technical  limitations, the callback can't be used to filter
        traffic or to abort a connection. Any exception raised in the
        callback is delayed until the handshake, read, or write operation
        has been performed.

        def msg_cb(conn, direction, version, content_type, msg_type, data):
            pass

        conn
            :class:`SSLSocket` or :class:`SSLObject` instance
        direction
            ``read`` or ``write``
        version
            :class:`TLSVersion` enum member or int for unknown version. For a
            frame header, it's the header version.
        content_type
            :class:`_TLSContentType` enum member or int for unsupported
            content type.
        msg_type
            Either a :class:`_TLSContentType` enum number for a header
            message, a :class:`_TLSAlertType` enum member for an alert
            message, a :class:`_TLSMessageType` enum member for other
            messages, or int for unsupported message types.
        data
            Raw, decrypted message content as bytes
        N)r��
_msg_callback�
user_function)r��innerr�r,r-r�ms!zSSLContext._msg_callbackcsb�dkr ttt�j�|d�dSt�d�s8t��d����fdd�}�|_ttt�j�||�dS)N�__call__z is not callable.cs�zt|�}Wntk
r YnXzt|�}Wntk
rBYnX|tjkrTt}n|tjkrdt}nt}z||�}Wntk
r�YnX�||||||�Sr�)r7r�r=rGrFrHrg)Zconn�	direction�versionZcontent_typeZmsg_type�dataZmsg_enum��callbackr,r-r��s,

�z'SSLContext._msg_callback.<locals>.inner)r�r�r�r��hasattrr�r�)r�rr�r�rr-r��s
cstt�j�Sr�)r&r�r�r�r�r,r-r��szSSLContext.protocolcstt�j�Sr�)r2r��verify_flagsr�r�r,r-r�szSSLContext.verify_flagscsttt�j�||�dSr�)r�r�rr�r�r�r,r-r�scs0t�j}z
t|�WStk
r*|YSXdSr�)r��verify_moder3r�r�r�r,r-r�s

zSSLContext.verify_modecsttt�j�||�dSr�)r�r�rr�r�r�r,r-r�s)FTTNN)FNN)!r8r9r:rDr�r�r��PROTOCOL_TLSr�r�r�r�r�r�r�r�r�r�r�rr	�propertyr��setterr�r�r;r�r�r�rrr�r,r,r�r-r��sn�
�





&%r�)r�r�r�cCs�t|t�st|��tt�}|tjkr0t|_d|_	|s<|s<|rL|�
|||�n|jtkr`|�|�t
|d�r�tj�d�}|r�tjjs�||_|S)z�Create a SSLContext object with default settings.

    NOTE: The protocol and settings may change anytime without prior
          deprecation. The values represent a fair balance between maximum
          compatibility and security.
    T�keylog_filename�
SSLKEYLOGFILE)r�r�r�r�rr�r��
CERT_REQUIREDr�check_hostnamer��	CERT_NONEr�rr�r�r�r��flags�ignore_environmentr)r�r�r�r�r��
keylogfiler,r,r-�create_default_context�s




rF)�	cert_reqsrr��certfile�keyfiler�r�r�cCs�t|t�st|��t|�}	|s$d|	_|dk	r2||	_|r<d|	_|rL|sLtd��|sT|r`|	�||�|sl|sl|r||	�|||�n|	jt	kr�|	�
|�t|	d�r�tj
�d�}
|
r�tjjs�|
|	_|	S)a/Create a SSLContext object for Python stdlib modules

    All Python stdlib modules shall use this function to create SSLContext
    objects in order to keep common settings in one place. The configuration
    is less restrict than create_default_context()'s to increase backward
    compatibility.
    FNT�certfile must be specifiedrr	)r�r�r�r�rrr��load_cert_chainr�rr�rr�r�r�r�r
rr)r�rrr�rrr�r�r�r�rr,r,r-�_create_unverified_context�s,



rc@s�eZdZdZdd�Zed2dd��Zedd	��Zej	d
d	��Zedd��Z
e
j	d
d��Z
edd��Zedd��Zedd��Z
d3dd�Zdd�Zd4dd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd5d,d-�Zd.d/�Zd0d1�ZdS)6�	SSLObjectaThis class implements an interface on top of a low-level SSL object as
    implemented by OpenSSL. This object captures the state of an SSL connection
    but does not provide any network IO itself. IO needs to be performed
    through separate "BIO" objects which are OpenSSL's IO abstraction layer.

    This class does not have a public constructor. Instances are returned by
    ``SSLContext.wrap_bio``. This class is typically used by framework authors
    that want to implement asynchronous IO for SSL through memory buffers.

    When compared to ``SSLSocket``, this object lacks the following features:

     * Any form of network IO, including methods such as ``recv`` and ``send``.
     * The ``do_handshake_on_connect`` and ``suppress_ragged_eofs`` machinery.
    cOst|jj�d���dS)NzU does not have a public constructor. Instances are returned by SSLContext.wrap_bio().�r�r�r8�r�r�r�r,r,r-�__init__;s�zSSLObject.__init__FNc	Cs*|�|�}|j||||||d�}||_|S)N)r�r��ownerr�)r�Z	_wrap_bio�_sslobj)	r�r�r�r�r�r�r�r�r�r,r,r-r�As
�zSSLObject._createcCs|jjS)z(The SSLContext that is currently in use.�rr�r�r,r,r-r�MszSSLObject.contextcCs||j_dSr�r�r�Zctxr,r,r-r�RscCs|jjS)z!The SSLSession for client socket.�rr�r�r,r,r-r�VszSSLObject.sessioncCs||j_dSr�r�r�r�r,r,r-r�[scCs|jjS)z.Was the client session reused during handshake�r�session_reusedr�r,r,r-r"_szSSLObject.session_reusedcCs|jjS)z%Whether this is a server-side socket.)rr�r�r,r,r-r�dszSSLObject.server_sidecCs|jjS)z^The currently set server hostname (for SNI), or ``None`` if no
        server hostname is set.)rr�r�r,r,r-r�iszSSLObject.server_hostname�cCs(|dk	r|j�||�}n|j�|�}|S)z�Read up to 'len' bytes from the SSL object and return them.

        If 'buffer' is provided, read into this buffer and return the number of
        bytes read.
        N)r�read)r�r��buffer�vr,r,r-r$oszSSLObject.readcCs|j�|�S)z�Write 'data' to the SSL object and return the number of bytes
        written.

        The 'data' argument must support the buffer interface.
        )r�write�r�r�r,r,r-r'{szSSLObject.writecCs|j�|�S)z�Returns a formatted version of the data in the certificate provided
        by the other end of the SSL channel.

        Return None if no certificate was provided, {} if a certificate was
        provided, but not validated.
        )r�getpeercert�r�Zbinary_formr,r,r-r)�szSSLObject.getpeercertcCstjr|j��SdS)z�Return the currently selected NPN protocol as a string, or ``None``
        if a next protocol was not negotiated or if NPN is not supported by one
        of the peers.N)r;rr�selected_npn_protocolr�r,r,r-r+�szSSLObject.selected_npn_protocolcCstjr|j��SdS)z�Return the currently selected ALPN protocol as a string, or ``None``
        if a next protocol was not negotiated or if ALPN is not supported by one
        of the peers.N)r;rr�selected_alpn_protocolr�r,r,r-r,�sz SSLObject.selected_alpn_protocolcCs
|j��S)z_Return the currently selected cipher as a 3-tuple ``(name,
        ssl_version, secret_bits)``.)r�cipherr�r,r,r-r-�szSSLObject.ciphercCs
|j��S)z�Return a list of ciphers shared by the client during the handshake or
        None if this is not a valid server connection.
        )r�shared_ciphersr�r,r,r-r.�szSSLObject.shared_cipherscCs
|j��S)z�Return the current compression algorithm in use, or ``None`` if
        compression was not negotiated or not supported by one of the peers.)r�compressionr�r,r,r-r/�szSSLObject.compressioncCs
|j��S)z8Return the number of bytes that can be read immediately.)r�pendingr�r,r,r-r0�szSSLObject.pendingcCs|j��dS)zStart the SSL/TLS handshake.N)r�do_handshaker�r,r,r-r1�szSSLObject.do_handshakecCs
|j��S)z!Start the SSL shutdown handshake.)r�shutdownr�r,r,r-�unwrap�szSSLObject.unwrapr�cCs|j�|�S)z�Get channel binding data for current connection.  Raise ValueError
        if the requested `cb_type` is not supported.  Return bytes of the data
        or None if the data is not available (e.g. before the handshake).)r�get_channel_binding�r�Zcb_typer,r,r-r4�szSSLObject.get_channel_bindingcCs
|j��S)zZReturn a string identifying the protocol version used by the
        current SSL channel. �rr�r�r,r,r-r��szSSLObject.versioncCs
|j��Sr�)r�verify_client_post_handshaker�r,r,r-r7�sz&SSLObject.verify_client_post_handshake)FNNN)r#N)F)r�)r8r9r:rDrr�r�rr�rr�r"r�r�r$r'r)r+r,r-r.r/r0r1r3r4r�r7r,r,r,r-r,sH�








	
rcCstt|j�j|_|S)z*Copy docstring from SSLObject to SSLSocket)�getattrrr8rD)�funcr,r,r-�_sslcopydoc�sr:cseZdZdZdd�ZedX�fdd�	�Zeed	d
���Z	e	j
dd
��Z	eedd
���Zej
dd
��Zeedd���Zdd�Z
dYdd�Zdd�ZdZdd�Zdd�Zed[dd��Zedd��Zed d!��Zed"d#��Zed$d%��Zed&d'��Zd\�fd)d*�	Zd]�fd+d,�	Zd-d.�Zd^�fd/d0�	Zd_�fd1d2�	Zd`�fd3d4�	Zda�fd5d6�	Zdb�fd7d8�	Zdc�fd9d:�	Z d;d<�Z!d=d>�Z"ed?d@��Z#�fdAdB�Z$edCdD��Z%edEdF��Z&�fdGdH�Z'edddIdJ��Z(�fdKdL�Z)dMdN�Z*dOdP�Z+�fdQdR�Z,ededTdU��Z-edVdW��Z.�Z/S)f�	SSLSocketz�This class implements a subtype of socket.socket that wraps
    the underlying OS socket in an SSL context when necessary, and
    provides read and write methods over that channel. cOst|jj�d���dS)NzX does not have a public constructor. Instances are returned by SSLContext.wrap_socket().rrr,r,r-r�s�zSSLSocket.__init__FTNc

s�|�tt�tkrtd��|r8|r(td��|dk	r8td��|jrJ|sJtd��t|j|j	|j
|��d�}|j|f|�}	t
t|	�jf|�|	�|���|��||	_||	_d|	_d|	_||	_|�|�|	_||	_||	_z|	��Wn6tk
�r}
z|
jtjkr��d}W5d}
~
XYnXd}||	_ |�r�zH|	jj!|	||	j|	|	jd�|	_|�rj|	��}|d	k�rbtd
��|	�"�Wn$ttfk
�r�|	�#��YnX|	S)Nz!only stream sockets are supportedz4server_hostname can only be specified in client modez,session can only be specified in client modez'check_hostname requires server_hostname)�family�type�proto�filenoFT�rr��zHdo_handshake_on_connect should not be specified for non-blocking sockets)$Z
getsockoptrr�r}�NotImplementedErrorr�r�dictr<r=r>r?r�r�r;r�
settimeout�
gettimeout�detach�_context�_sessionZ_closedrr�r�r�r�r��getpeernamer��errnoZENOTCONN�
_connected�_wrap_socketr1�close)
r�r�r�r�r�r�r�r�r�r��eZ	connected�timeoutr�r,r-r��sj
��
zSSLSocket._createcCs|jSr�)rGr�r,r,r-r�szSSLSocket.contextcCs||_||j_dSr�)rGrr�rr,r,r-r�scCs|jdk	r|jjSdSr�rr�r,r,r-r� s
zSSLSocket.sessioncCs||_|jdk	r||j_dSr�)rHrr�r r,r,r-r�&s
cCs|jdk	r|jjSdSr�r!r�r,r,r-r",s
zSSLSocket.session_reusedcCstd|jj��dS)NzCan't dup() %s instances)rBr�r8r�r,r,r-�dup2s�z
SSLSocket.dupcCsdSr�r,)r��msgr,r,r-�_checkClosed6szSSLSocket._checkClosedcCs|js|��dSr�)rKrIr�r,r,r-�_check_connected:szSSLSocket._check_connectedr#c
Cs�|��|jdkrtd��z*|dk	r4|j�||�WS|j�|�WSWnVtk
r�}z8|jdtkr�|jr�|dk	r|WY�dSWY�dSn�W5d}~XYnXdS)zORead up to LEN bytes and return them.
        Return zero-length string on EOF.Nz'Read on closed or unwrapped SSL socket.rr/)rRrr�r$rr�Z
SSL_ERROR_EOFr�)r�r�r%�xr,r,r-r$Bs

zSSLSocket.readcCs&|��|jdkrtd��|j�|�S)zhWrite DATA to the underlying SSL channel.  Returns
        number of bytes of DATA actually transmitted.Nz(Write on closed or unwrapped SSL socket.)rRrr�r'r(r,r,r-r'Ws
zSSLSocket.writecCs|��|��|j�|�Sr�)rRrSrr)r*r,r,r-r)`szSSLSocket.getpeercertcCs*|��|jdkstjsdS|j��SdSr�)rRrr;rr+r�r,r,r-r+fszSSLSocket.selected_npn_protocolcCs*|��|jdkstjsdS|j��SdSr�)rRrr;rr,r�r,r,r-r,nsz SSLSocket.selected_alpn_protocolcCs$|��|jdkrdS|j��SdSr�)rRrr-r�r,r,r-r-vs
zSSLSocket.ciphercCs$|��|jdkrdS|j��SdSr�)rRrr.r�r,r,r-r.~s
zSSLSocket.shared_cipherscCs$|��|jdkrdS|j��SdSr�)rRrr/r�r,r,r-r/�s
zSSLSocket.compressionrcsF|��|jdk	r4|dkr(td|j��|j�|�St��||�SdS)Nrz3non-zero flags not allowed in calls to send() on %s)rRrr�r�r'r��send)r�r�r
r�r,r-rU�s
��zSSLSocket.sendcsL|��|jdk	r"td|j��n&|dkr8t��||�St��|||�SdS)Nz%sendto not allowed on instances of %s)rRrr�r�r��sendto)r�r�Z
flags_or_addrr�r�r,r-rV�s
�zSSLSocket.sendtocOstd|j��dS)Nz&sendmsg not allowed on instances of %s�rBr�rr,r,r-�sendmsg�s�zSSLSocket.sendmsgc
s�|��|jdk	r�|dkr(td|j��d}t|��H}|�d��2}t|�}||krn|�||d��}||7}qJW5QRXW5QRXnt��	||�SdS)Nrz6non-zero flags not allowed in calls to sendall() on %s�B)
rRrr�r��
memoryview�castr�rUr��sendall)r�r�r
r�ZviewZ	byte_viewZamountr&r�r,r-r\�s
�� zSSLSocket.sendallcs,|jdk	r|�|||�St��|||�SdS)z�Send a file, possibly by using os.sendfile() if this is a
        clear-text socket.  Return the total number of bytes sent.
        N)rZ_sendfile_use_sendr��sendfile)r��file�offsetr�r�r,r-r]�s
zSSLSocket.sendfilecsD|��|jdk	r2|dkr(td|j��|�|�St��||�SdS)Nrz3non-zero flags not allowed in calls to recv() on %s)rRrr�r�r$r��recv�r�Zbuflenr
r�r,r-r`�s
��
zSSLSocket.recvcsj|��|r|dkrt|�}n|dkr*d}|jdk	rV|dkrJtd|j��|�||�St��|||�SdS)Nr#rz8non-zero flags not allowed in calls to recv_into() on %s)rRr�rr�r�r$r��	recv_into�r�r%�nbytesr
r�r,r-rb�s

��zSSLSocket.recv_intocs4|��|jdk	r"td|j��nt��||�SdS)Nz'recvfrom not allowed on instances of %s)rRrr�r�r��recvfromrar�r,r-re�s
�zSSLSocket.recvfromcs6|��|jdk	r"td|j��nt��|||�SdS)Nz,recvfrom_into not allowed on instances of %s)rRrr�r�r��
recvfrom_intorcr�r,r-rf�s
�zSSLSocket.recvfrom_intocOstd|j��dS)Nz&recvmsg not allowed on instances of %srWrr,r,r-�recvmsg�s�zSSLSocket.recvmsgcOstd|j��dS)Nz+recvmsg_into not allowed on instances of %srWrr,r,r-�recvmsg_into�s�zSSLSocket.recvmsg_intocCs$|��|jdk	r|j��SdSdS)Nr)rRrr0r�r,r,r-r0�s

zSSLSocket.pendingcs|��d|_t��|�dSr�)rRrr�r2)r�Zhowr�r,r-r2�szSSLSocket.shutdowncCs.|jr|j��}d|_|Stdt|���dS�NzNo SSL wrapper around )rr2r�r�)r��sr,r,r-r3s

zSSLSocket.unwrapcCs$|jr|j��Stdt|���dSri)rr7r�r�r�r,r,r-r7s
z&SSLSocket.verify_client_post_handshakecsd|_t���dSr�)rr��_real_closer�r�r,r-rkszSSLSocket._real_closec	CsF|��|��}z$|dkr(|r(|�d�|j��W5|�|�XdS)NrA)rSrErDrr1)r��blockrOr,r,r-r1s
zSSLSocket.do_handshakec	s�|jrtd��|js|jdk	r&td��|jj|d|j||jd�|_z@|rVt��	|�}nd}t��
|�|s~d|_|jr~|��|WSt
tfk
r�d|_�YnXdS)Nz!can't connect in server-side modez/attempt to connect already-connected SSLSocket!Fr@T)r�r�rKrr�rLr�rHr��
connect_ex�connectr�r1r�)r�r�rmZrcr�r,r-�
_real_connect!s0�zSSLSocket._real_connectcCs|�|d�dS)�QConnects to remote ADDR, and then wraps the connection in
        an SSL channel.FN�ro�r�r�r,r,r-rn;szSSLSocket.connectcCs|�|d�S)rpTrqrrr,r,r-rm@szSSLSocket.connect_excs.t���\}}|jj||j|jdd�}||fS)z�Accepts a new connection from a remote client, and returns
        a tuple containing that new connection wrapped with a server-side
        SSL channel, and the address of the remote client.T)r�r�r�)r��acceptr�r�r�r�)r�Znewsockr�r�r,r-rsEs�zSSLSocket.acceptr�cCs4|jdk	r|j�|�S|tkr,td�|���dSdS)Nz({0} channel binding type not implemented)rr4�CHANNEL_BINDING_TYPESr�r�r5r,r,r-r4Qs
�zSSLSocket.get_channel_bindingcCs|jdk	r|j��SdSdSr�r6r�r,r,r-r�\s

zSSLSocket.version)FTTNNN)N)r#N)F)r)N)r)rN)r#r)Nr)r#r)Nr)F)r�)0r8r9r:rDrr�r�rr:r�rr�r"rPrRrSr$r'r)r+r,r-r.r/rUrVrXr\r]r`rbrerfrgrhr0r2r3r7rkr1rornrmrsr4r�r�r,r,r�r-r;�s��>



	











r;Tc
Csl|r|std��|r |s td��t|�}
||
_|r<|
�|�|rL|
�||�|	rZ|
�|	�|
j||||d�S)Nz5certfile must be specified for server-side operationsr)r�r�r�r�)r�r�rr�rZset_ciphersr�)r�rrr�r�ssl_version�ca_certsr�r�Zciphersr�r,r,r-r�is$

�r�cCs�ddlm}ddlm}d}d}z|�|dd����d}Wn$tk
rbtd	||f��Yn0X||dd�|�}||d|f|d
d��SdS)a�Return the time in seconds since the Epoch, given the timestring
    representing the "notBefore" or "notAfter" date from a certificate
    in ``"%b %d %H:%M:%S %Y %Z"`` strptime format (C locale).

    "notBefore" or "notAfter" dates must use UTC (RFC 5280).

    Month is one of: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
    UTC should be specified as GMT (see ASN1_TIME_print())
    r)�strptime)�timegm)ZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDecz %d %H:%M:%S %Y GMTNrjrhz*time data %r does not match format "%%b%s"rirm)�timerwZcalendarrx�index�titler�)Z	cert_timerwrxZmonthsZtime_formatZmonth_numberZttr,r,r-�cert_time_to_seconds�s
�r|z-----BEGIN CERTIFICATE-----z-----END CERTIFICATE-----csRtt�|�dd��tg}|�fdd�tdt��d�D�7}|�td�d�|�S)z[Takes a certificate in binary DER format and returns the
    PEM version of it as a string.�ASCII�strictcsg|]}�||d��qS)�@r,)r4�i��fr,r-�
<listcomp>�sz(DER_cert_to_PEM_cert.<locals>.<listcomp>rr�
)	r��base64Zstandard_b64encode�
PEM_HEADER�ranger�r��
PEM_FOOTERr�)Zder_cert_bytesZssr,r�r-�DER_cert_to_PEM_cert�s
"r�cCs\|�t�stdt��|���t�s0tdt��|��tt�tt��}t�|�	dd��S)zhTakes a certificate in ASCII PEM format and returns the
    DER-encoded version of it as a byte sequencez(Invalid PEM encoding; must start with %sz&Invalid PEM encoding; must end with %sr}r~)
r)r�r��strip�endswithr�r�r�Zdecodebytesr�)Zpem_cert_string�dr,r,r-�PEM_cert_to_DER_cert�s
��r�c

Csd|\}}|dk	rt}nt}t|||d�}t|��&}|�|��}|�d�}	W5QRXW5QRXt|	�S)z�Retrieve the certificate from the server at the specified address,
    and return it as a PEM-encoded string.
    If 'ca_certs' is specified, validate the server cert against it.
    If 'ssl_version' is specified, use it in the connection attempt.N)rr�T)r
r�_create_stdlib_contextr~r�r)r�)
r�rurvZhostZportrr�r�ZsslsockZdercertr,r,r-�get_server_certificate�s�
r�cCst�|d�S)Nz	<unknown>)�_PROTOCOL_NAMESr�)Z
protocol_coder,r,r-�get_protocol_name�sr�)nrDr�r��collectionsr�enumrZ_EnumrZ_IntEnumrZ_IntFlagr;rrrr	r
rrr
rrrrrrr�rr�rrrrr�ImportErrorrrrrrrr r!r"r#r$r%�	_convert_r8r&rr'�__members__�itemsr�r8Z_SSLv2_IF_EXISTSr7r=rHrgr�ryrzr{r|r}r~rr�r�r�rJr�r�Zsocket_errorrtrZHAS_NEVER_CHECK_COMMON_NAMEZ_RESTRICTED_SERVER_CIPHERSr�r�r�r�r�r�r�r�r�r�r�rrrZ_create_default_https_contextr�rr:r;r�r�r�r|r�r�r�r�r�r�r,r,r,r-�<module>s�Y$0������
)
1#9�z�#�/�


__pycache__/mimetypes.cpython-38.opt-2.pyc000064400000023442151153537610014374 0ustar00U

e5d�T�
@s�ddlZddlZddlZddlZzddlZWnek
rDdZYnXdddddddd	d
ddd
dg
Zdddddddddg	Z	da
daGdd�d�Zd%dd�Z
d&dd�Zd'dd�Zd(dd�Zd)dd	�Zdd
�Zd d!�Ze�d"d#�Zed$kr�e�dS)*�N�
knownfiles�inited�	MimeTypes�
guess_type�guess_all_extensions�guess_extension�add_type�init�read_mime_types�
suffix_map�
encodings_map�	types_map�common_typesz/etc/mime.typesz/etc/httpd/mime.typesz/etc/httpd/conf/mime.typesz/etc/apache/mime.typesz/etc/apache2/mime.typesz$/usr/local/etc/httpd/conf/mime.typesz"/usr/local/lib/netscape/mime.typesz/usr/local/etc/mime.typesFc@s\eZdZddd�Zddd�Zddd�Zdd	d
�Zddd�Zdd
d�Zddd�Z	ddd�Z
dS)r�TcCs�ts
t�t��|_t��|_iif|_iif|_t	�
�D]\}}|�||d�q:t�
�D]\}}|�||d�qZ|D]}|�
||�qvdS�NTF)rr	�_encodings_map_default�copyr�_suffix_map_defaultrr
�
types_map_inv�_types_map_default�itemsr�_common_types_default�read)�self�	filenames�strict�ext�type�namerr�!/usr/lib64/python3.8/mimetypes.py�__init__Bs



zMimeTypes.__init__cCs6||j||<|j|�|g�}||kr2|�|�dS�N)r
r�
setdefault�append)rrrrZextsrrrrPszMimeTypes.add_typecCsrt�|�}tj�|�\}}|dkr�|�d�}|dkr8dS|�dd|�}|dkr\|d|�}n|d|�}d|ksxd|kr|d}|dfSt�|�\}}||jkr�t�||j|�\}}q�||j	kr�|j	|}	t�|�\}}nd}	|j
d	}
||
kr�|
||	fS|��|
k�r|
|��|	fS|�r(d|	fS|j
d
}
||
k�rH|
||	fS|��|
k�rf|
|��|	fSd|	fSdS)N�data�,r)NN�;�=�/�
text/plainTF)�os�fspath�urllib�parseZ
_splittype�find�	posixpath�splitextrrr
�lower)r�urlrZschemeZcommaZsemir�baser�encodingr
rrrrasB







zMimeTypes.guess_typecCsL|��}|jd�|g�}|sH|jd�|g�D]}||kr0|�|�q0|Sr)r1r�getr#)rrr�
extensionsrrrrr�szMimeTypes.guess_all_extensionscCs|�||�}|sdS|dS)Nr)r)rrrr6rrrr�s
zMimeTypes.guess_extensionc	Cs(t|dd��}|�||�W5QRXdS)N�utf-8�r4)�open�readfp)r�filenamer�fprrrr�szMimeTypes.readc	Cs�|��}|sq�|��}tt|��D]"}||ddkr"||d�=qFq"|sLq|d|dd�}}|D]}|�|d||�qfqdS)Nr�#��.)�readline�split�range�lenr)	rr<r�lineZwords�ir�suffixesZsuffrrrr:�s	
zMimeTypes.readfpcCs�tsdSdd�}t�tjd���}||�D]�}zjt�||��T}|�d�sTW5QR�Wq(t�|d�\}}|tjkr|W5QR�Wq(|�|||�W5QRXWq(tk
r�Yq(Yq(Xq(W5QRXdS)NcssJd}zt�||�}Wntk
r,YqFYnXd|kr<|V|d7}qdS)Nr�r>)�_winregZEnumKey�OSError)ZmimedbrEZctyperrr�
enum_types�s
z3MimeTypes.read_windows_registry.<locals>.enum_types�r?zContent Type)rH�OpenKeyZHKEY_CLASSES_ROOT�
startswithZQueryValueExZREG_SZrrI)rrrJZhkcrZ
subkeynameZsubkeyZmimetypeZdatatyperrr�read_windows_registry�s$

�
zMimeTypes.read_windows_registryN)rT)T)T)T)T)T)T)T)�__name__�
__module__�__qualname__r rrrrrr:rNrrrrr:s


?



TcCstdkrt�t�||�Sr!)�_dbr	r)r2rrrrrscCstdkrt�t�||�Sr!)rRr	r�rrrrrr's
cCstdkrt�t�||�Sr!)rRr	rrSrrrr8scCstdkrt�t�|||�Sr!)rRr	r)rrrrrrrHscCs�da|dkstdkrBt�}tr&|��|dkr4t}qFtt|�}nt}|D]}tj�	|�rJ|�
|�qJ|ja|ja|j
da
|j
da|adSr)rrRrrHrNr�listr*�path�isfilerrrr
r)�files�db�filerrrr	Ys"

c
Cs`zt|dd�}Wntk
r&YdSX|�*t�}|�|d�|jdW5QR�SQRXdS)Nr7r8T)r9rIrr:r
)rY�frXrrrr
usc�CsXddddddd�aadddd	d
�aadddd
ddddddddddddddddddddddddddddddddddd d!d!d"d"d#d$d$d%d&d'd(d)d*d+d,d-d-d.d.d.d/d0d1d2d3d4d4d4d4d5d6d6d7d7d8d8d8d9d:d;d<d=d>d>d>d?d@dAdAdBdCdDdEdFdGdHdIdJdKdLdMdMdMdMdNdOdPdPdQdQdQdQdQdQdRdSdTdUdVdVdWdXdYdZdZdZdZdZd[d[d\d]d^d_��aad`dadadbdcdcdcddde�aadS)fNz.svg.gzz.tar.gzz.tar.bz2z.tar.xz)z.svgzz.tgzz.tazz.tzz.tbz2z.txzZgzip�compressZbzip2Zxz)z.gzz.Zz.bz2z.xzzapplication/javascriptzapplication/jsonzapplication/manifest+jsonzapplication/mswordzapplication/octet-streamzapplication/odazapplication/pdfzapplication/pkcs7-mimezapplication/postscriptzapplication/vnd.apple.mpegurlzapplication/vnd.ms-excelzapplication/vnd.ms-powerpointzapplication/wasmzapplication/x-bcpiozapplication/x-cpiozapplication/x-cshzapplication/x-dvizapplication/x-gtarzapplication/x-hdfzapplication/x-hdf5zapplication/x-latexzapplication/x-mifzapplication/x-netcdfzapplication/x-pkcs12zapplication/x-pn-realaudiozapplication/x-python-codezapplication/x-shzapplication/x-sharzapplication/x-shockwave-flashzapplication/x-sv4cpiozapplication/x-sv4crczapplication/x-tarzapplication/x-tclzapplication/x-texzapplication/x-texinfozapplication/x-troffzapplication/x-troff-manzapplication/x-troff-mezapplication/x-troff-mszapplication/x-ustarzapplication/x-wais-sourcezapplication/xmlzapplication/zipzaudio/basicz
audio/mpegzaudio/x-aiffzaudio/x-pn-realaudiozaudio/x-wavz	image/bmpz	image/gifz	image/iefz
image/jpegz	image/pngz
image/svg+xmlz
image/tiffzimage/vnd.microsoft.iconzimage/x-cmu-rasterzimage/x-ms-bmpzimage/x-portable-anymapzimage/x-portable-bitmapzimage/x-portable-graymapzimage/x-portable-pixmapzimage/x-rgbzimage/x-xbitmapzimage/x-xpixmapzimage/x-xwindowdumpzmessage/rfc822ztext/cssztext/csvz	text/htmlr)z
text/richtextztext/tab-separated-valuesz
text/x-pythonz
text/x-setextztext/x-sgmlztext/x-vcardztext/xmlz	video/mp4z
video/mpegzvideo/quicktimez
video/webmzvideo/x-msvideozvideo/x-sgi-movie)�z.jsz.mjsz.jsonz.webmanifestz.docz.dotz.wizz.binz.az.dllz.exez.oz.objz.soz.odaz.pdfz.p7cz.psz.aiz.epsz.m3uz.m3u8z.xlsz.xlbz.pptz.potz.ppaz.ppsz.pwzz.wasmz.bcpioz.cpioz.cshz.dviz.gtarz.hdfz.h5z.latexz.mifz.cdfz.ncz.p12z.pfxz.ramz.pycz.pyoz.shz.sharz.swfz.sv4cpioz.sv4crcz.tarz.tclz.texz.texiz.texinfoz.roffz.tz.trz.manz.mez.msz.ustarz.srcz.xslz.rdfz.wsdlz.xpdlz.zipz.auz.sndz.mp3z.mp2z.aifz.aifcz.aiffz.raz.wav�.bmpz.gifz.ief�.jpgz.jpez.jpegz.pngz.svgz.tiffz.tifz.icoz.rasr\z.pnmz.pbmz.pgmz.ppmz.rgbz.xbmz.xpmz.xwdz.emlz.mhtz.mhtmlz.nwsz.cssz.csvz.htmlz.htmz.txtz.batz.cz.hz.kshz.plz.rtxz.tsvz.pyz.etxz.sgmz.sgmlz.vcfz.xmlz.mp4z.mpegz.m1vz.mpaz.mpez.mpgz.movz.qtz.webmz.aviz.moviezapplication/rtfz
audio/midiz	image/jpgz
image/pictztext/xul)z.rtfz.midiz.midr]z.pictz.pctz.picz.xul)rrrrr
rrrrrrr�_default_mime_types�s8�

�
��

�r^c
sddl}d�d�fdd�	}z&|�tjdd�ddd	d
g�\}}Wn.|jk
rn}z|d|�W5d}~XYnXd}d}|D]4\}}|dkr�|d�q||dkr�d}q||d
kr|d}q||D]Z}	|r�t|	|�}
|
s�td|	�nt|
�q�t|	|�\}
}|
�std|	�q�td|
d|�q�dS)Nra4Usage: mimetypes.py [options] type

Options:
    --help / -h       -- print this message and exit
    --lenient / -l    -- additionally search of some common, but non-standard
                         types.
    --extension / -e  -- guess extension instead of type

More than one type argument may be given.
rKcs"t��|rt|�t�|�dSr!)�print�sys�exit)�code�msg�ZUSAGErr�usageFsz_main.<locals>.usager>Zhle�helpZlenient�	extension)z-hz--help)z-lz	--lenient)z-ez--extensionz I don't know anything about typeztype:z	encoding:)rK)�getoptr`�argv�errorrr_r)rhreZopts�argsrcrrg�opt�argZgtypeZguessr4rrdr�_main7s8�


rn�__main__)T)T)T)T)N)r*r`r/Zurllib.parser,�winregrH�ImportError�__all__rrrRrrrrrr	r
r^rnrOrrrr�<module>s^
��W




5.__pycache__/imghdr.cpython-38.opt-2.pyc000064400000007335151153537610013635 0ustar00U

e5d��@s.ddlmZdgZd$dd�ZgZdd�Ze�e�dd�Ze�e�d	d
�Ze�e�dd�Z	e�e	�d
d�Z
e�e
�dd�Ze�e�dd�Ze�e�dd�Z
e�e
�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd�Ze�e�dd �Zd!d"�Zed#k�r*e�dS)%�)�PathLike�whatNcCs�d}zp|dkrNt|ttf�r2t|d�}|�d�}n|��}|�d�}|�|�tD]}|||�}|rR|W�SqRW5|r�|��XdS)N�rb� )	�close�
isinstance�strr�open�read�tell�seek�tests)�file�h�f�locationZtf�res�r�/usr/lib64/python3.8/imghdr.pyrs 




cCs|dd�dkrdSdS)N��
)sJFIFsExifZjpegr�rrrrr�	test_jpeg%srcCs|�d�rdSdS)Ns�PNG

Zpng��
startswithrrrr�test_png,s
rcCs|dd�dkrdSdS)Nr)sGIF87asGIF89aZgifrrrrr�test_gif2srcCs|dd�dkrdSdS)N�)sMMsIIZtiffrrrrr�	test_tiff9srcCs|�d�rdSdS)Ns�Zrgbrrrrr�test_rgb@s
rcCs<t|�dkr8|dtd�kr8|ddkr8|ddkr8dSdS)	N�r�P�s14r� 	

Zpbm��len�ordrrrr�test_pbmGs�
�
�r'cCs<t|�dkr8|dtd�kr8|ddkr8|ddkr8dSdS)	Nr rr!r"s25rr#Zpgmr$rrrr�test_pgmOs�
�
�r(cCs<t|�dkr8|dtd�kr8|ddkr8|ddkr8dSdS)	Nr rr!r"s36rr#Zppmr$rrrr�test_ppmWs�
�
�r)cCs|�d�rdSdS)NsY�j�Zrastrrrrr�	test_rast_s
r*cCs|�d�rdSdS)Ns#define Zxbmrrrrr�test_xbmfs
r+cCs|�d�rdSdS)NsBMZbmprrrrr�test_bmpms
r,cCs"|�d�r|dd�dkrdSdS)NsRIFF��sWEBPZwebprrrrr�	test_webpssr/cCs|�d�rdSdS)Nsv/1Zexrrrrrr�test_exrys
r0cCs�ddl}d}|jdd�r8|jddkr8|jdd�=d}z8|jdd�r`t|jdd�|d�ntdg|d�Wn*tk
r�|j�d�|�d�YnXdS)Nrr"z-rr�.z
[Interrupted]
)�sys�argv�testall�KeyboardInterrupt�stderr�write�exit)r2�	recursiverrr�test�sr:c	Cs�ddl}ddl}|D]�}|j�|�r~t|ddd�|s<|rttd�ddl}|�|j�|�|�d��}t||d�q�td�qt|ddd�|j	�
�ztt|��Wqtk
r�td	�YqXqdS)
Nrz/:� )�endzrecursing down:�*z*** directory (use -r) ***�:z*** not found ***)
r2�os�path�isdir�print�glob�join�escaper4�stdout�flushr�OSError)�listr9Ztoplevelr2r?�filenamerC�namesrrrr4�s"

r4�__main__)N)r?r�__all__rr
r�appendrrrrr'r(r)r*r+r,r/r0r:r4�__name__rrrr�<module>sB














__pycache__/tty.cpython-38.opt-2.pyc000064400000001711151153537610013173 0ustar00U

e5do�@sHddlTddgZdZdZdZdZdZdZd	Ze	fd
d�Z
e	fdd�ZdS)
�)�*�setraw�	setcbreak������cCs�t|�}|tttBtBtBtB@|t<|tt@|t<|t	t
tB@|t	<|t	tB|t	<|t
ttBtBtB@|t
<d|tt<d|tt<t|||�dS�Nrr)�	tcgetattr�IFLAGZBRKINTZICRNLZINPCKZISTRIPZIXON�OFLAGZOPOST�CFLAGZCSIZEZPARENBZCS8�LFLAG�ECHO�ICANONZIEXTENZISIG�CC�VMIN�VTIME�	tcsetattr��fdZwhen�mode�r�/usr/lib64/python3.8/tty.pyrs"cCsFt|�}|tttB@|t<d|tt<d|tt<t|||�dSr)rrrrrrrrrrrrrs
N)Ztermios�__all__r
rrrZISPEEDZOSPEEDrZ	TCSAFLUSHrrrrrr�<module>s__pycache__/dis.cpython-38.opt-2.pyc000064400000027343151153537610013143 0ustar00U

e5dZP�@sddlZddlZddlZddlZddlTddlmZdddddd	d
ddd
dgeZ[ejejej	e
eefZ
edZdedfedfedffZedZdZdd�ZdUddd�dd�ZdVdd�dd�Zddddd d!d"d#d$d%d&�
Zd'd(�Zd)d*�Zd+d�Zd,d-�Zdd�d.d�Ze�d/d0�Z d1e j!_"d2e j_"d3e j#_"d4e j$_"d5e j%_"d6e j&_"d7e j'_"d8e j(_"d9Z)d:Z*Gd;d
�d
e �Z+dd<�d=d�Z,d>d?�Z-d@dA�Z.dWdBdC�Z/dXdd�dEd�Z0ddd�dFdG�Z1dYdddH�dIdJ�Z2dKdL�Z3e0Z4dMdN�Z5dOd
�Z6dPd	�Z7GdQd�d�Z8dRdS�Z9e:dTk�re9�dS)Z�N)�*)�__all__�	code_info�dis�disassemble�distb�disco�findlinestarts�
findlabels�	show_code�get_instructions�Instruction�Bytecode�FORMAT_VALUE)N��str�repr�ascii�
MAKE_FUNCTION)�defaultsZ
kwdefaultsZannotationsZclosurecCs6zt||d�}Wn tk
r0t||d�}YnX|S)N�eval�exec)�compile�SyntaxError)�source�name�c�r�/usr/lib64/python3.8/dis.py�_try_compiles
r��file�depthcCsh|dkrt|d�dSt|d�r&|j}t|d�r8|j}n4t|d�rJ|j}n"t|d�r\|j}nt|d�rl|j}t|d�r�t|j�	��}|D]p\}}t
|t�r�td||d�zt
|||d	�Wn0tk
r�}ztd
||d�W5d}~XYnXt|d�q�nht|d��rt|||d	�nLt
|ttf��r6t||d�n.t
|t��rRt|||d	�ntdt|�j��dS)
N�r!�__func__�__code__�gi_code�ag_code�cr_code�__dict__zDisassembly of %s:r zSorry:�co_code�(don't know how to disassemble %s objects)r�hasattrr$r%r&r'r(�sortedr)�items�
isinstance�
_have_code�printr�	TypeError�_disassemble_recursive�bytes�	bytearray�_disassemble_bytesr�_disassemble_str�type�__name__)�xr!r"r.rZx1�msgrrrr+s@	







 �r#cCsX|dkr@z
tj}Wntk
r0td�d�YnX|jr@|j}q2t|jj|j|d�dS)Nz no last traceback to disassembler#)	�sys�last_traceback�AttributeError�RuntimeError�tb_nextr�tb_frame�f_code�tb_lasti)�tbr!rrrrXs
Z	OPTIMIZEDZ	NEWLOCALSZVARARGSZVARKEYWORDSZNESTEDZ	GENERATORZNOFREEZ	COROUTINEZITERABLE_COROUTINEZASYNC_GENERATOR)
������ �@��icCs`g}td�D]:}d|>}||@r|�t�|t|���||N}|sqVq|�t|��d�|�S)NrJrE�, )�range�append�COMPILER_FLAG_NAMES�get�hex�join)�flags�names�i�flagrrr�pretty_flagsrsrYcCs�t|d�r|j}t|d�r"|j}n4t|d�r4|j}n"t|d�rF|j}nt|d�rV|j}t|t�rjt|d�}t|d�rx|St	dt
|�j��dS)	Nr$r%r&r'r(z
<disassembly>r*r+)r,r$r%r&r'r(r/rrr2r8r9�r:rrr�_get_code_object�s"







�r[cCstt|��S�N)�_format_code_infor[rZrrrr�scCs�g}|�d|j�|�d|j�|�d|j�|�d|j�|�d|j�|�d|j�|�d|j�|�dt|j	��|j
r�|�d	�t|j
�D]}|�d
|�q�|jr�|�d�t|j�D]}|�d|�q�|j
�r|�d
�t|j
�D]}|�d|��q|j�rH|�d�t|j�D]}|�d|��q2|j�rz|�d�t|j�D]}|�d|��qdd�|�S)NzName:              %szFilename:          %szArgument count:    %szPositional-only arguments: %szKw-only arguments: %szNumber of locals:  %szStack size:        %szFlags:             %sz
Constants:z%4d: %rzNames:z%4d: %szVariable names:zFree variables:zCell variables:�
)rP�co_name�co_filename�co_argcount�co_posonlyargcount�co_kwonlyargcount�
co_nlocals�co_stacksizerY�co_flags�	co_consts�	enumerate�co_names�co_varnames�co_freevars�co_cellvarsrT)�co�linesZi_cZi_nrrrr]�s<




r]cCstt|�|d�dS�Nr#)r1r)rmr!rrrr�s�_InstructionzBopname opcode arg argval argrepr offset starts_line is_jump_targetz!Human readable name for operationzNumeric code for operationz6Numeric argument to operation (if any), otherwise Nonez4Resolved arg value (if known), otherwise same as argz0Human readable description of operation argumentz1Start index of operation within bytecode sequencez4Line started by this opcode (if any), otherwise Nonez1True if other code jumps to here, otherwise False��c@seZdZddd�ZdS)r
�FrGcCs�g}|r:|jdk	r,d|}|�||j�n|�d|�|rJ|�d�n
|�d�|jrf|�d�n
|�d�|�t|j��|��|�|j�t��|j	dk	r�|�t|j	��t
��|jr�|�d|jd�d�|��
�S)	Nz%%%dd� z-->z   z>>z  �(�))�starts_linerP�is_jump_targetr�offset�rjust�opname�ljust�
_OPNAME_WIDTH�arg�_OPARG_WIDTH�argreprrT�rstrip)�self�lineno_widthZmark_as_current�offset_widthZfieldsZ
lineno_fmtrrr�_disassemble�s&



zInstruction._disassembleN)rsFrG)r9�
__module__�__qualname__r�rrrrr
�s)�
first_linecCsTt|�}|j|j}tt|��}|dk	r4||j}nd}t|j|j|j	|j
|||�S�Nr)r[rlrk�dictr	�co_firstlineno�_get_instructions_bytesr*rjrirg)r:r�rm�
cell_names�
linestarts�line_offsetrrrrs�cCs |}|dk	r||}|t|�fSr\�r)Zconst_indexZ
const_list�argvalrrr�_get_const_infosr�cCs*|}|dk	r||}|}nt|�}||fSr\r�)Z
name_indexZ	name_listr�r�rrr�_get_name_info'sr�c
#s�t|�}d}t|�D�]r\}	}
�|dk	rD|�|	d�}|dk	rD||7}|	|k}d}d}
�dk	�rl�}|
tkrzt�|�\}}
n�|
tkr�t�|�\}}
n�|
tkr�|	d�}dt|�}
n�|
t	kr�t�|�\}}
n�|
t
kr�t�}|}
n�|
tkr�t�|�\}}
nr|
t
k�rFt�d@\}}
|t�d@�f}|d�rl|
�r<|
d7}
|
d7}
n&|
tk�rld��fd	d
�tt�D��}
tt|
|
�||
|	||�VqdS)NrrFzto rsrGrErNzwith formatc3s"|]\}}�d|>@r|VqdS)rENr)�.0rW�s�r~rr�	<genexpr>gs�z*_get_instructions_bytes.<locals>.<genexpr>)r
�_unpack_opargsrRZhasconstr�Zhasnamer��hasjrelrZhaslocalZ
hascompareZcmp_opZhasfreer�FORMAT_VALUE_CONVERTERS�boolrrTrh�MAKE_FUNCTION_FLAGSr
r{)�code�varnamesrV�	constants�cellsr�r��labelsrwry�oprxr�r�rr�rr�7sV






�r����c
Cs<|j|j}tt|��}t|j||j|j|j|||d�dSro)	rlrkr�r	r6r*rjrirg)rm�lastir!r�r�rrrrms�cCspt||d�|dks|dkrl|dk	r,|d}|jD]8}t|d�r2t|d�td|f|d�t|||d�q2dS)Nr#rrEr*zDisassembly of %r:r )rrgr,r1r3)rmr!r"r:rrrr3ts


r3)r!r�c	Cs�|dk	}	|	r8t|���|}
|
dkr2tt|
��}q<d}nd}t|�d}|dkr^tt|��}
nd}
t|||||||d�D]J}|	o�|jdk	o�|jdk}|r�t|d�|j|k}t|�|||
�|d�qxdS)	Ni�rsrrFi'rG�r�r#)	�max�values�lenrr�rwryr1r�)r�r�r�rVr�r�r�r!r�Zshow_linenoZ	maxlinenor�Z	maxoffsetr�ZinstrZnew_source_lineZis_current_instrrrrr6s8�
��

�r6cKstt|d�f|�dS)Nz<dis>)r3r)r�kwargsrrrr7�sr7ccsdd}tdt|�d�D]J}||}|tkrN||d|B}|tkrH|d>nd}nd}|||fVqdS)NrrFrErH)rOr�Z
HAVE_ARGUMENTZEXTENDED_ARG)r�Zextended_argrWr�r~rrrr��sr�cCs\g}t|�D]J\}}}|dk	r|tkr4|d|}n|tkr|}nq||kr|�|�q|S)NrF)r�r�ZhasjabsrP)r�r�ryr�r~Zlabelrrrr
�sc	cs�|jddd�}|jddd�}t|j�}d}|j}d}t||�D]P\}}|rz||krd||fV|}||7}||krzdS|dkr�|d8}||7}qB||kr�||fVdS)NrrFrErLrM)�	co_lnotabr�r*r��zip)	r�Zbyte_incrementsZline_incrementsZbytecode_lenZ
lastlineno�linenoZaddrZ	byte_incrZ	line_incrrrrr	�s&


c@sHeZdZddd�dd�Zdd�Zdd�Zed	d
��Zdd�Zd
d�Z	dS)rN)r��current_offsetcCsdt|�|_}|dkr&|j|_d|_n||_||j|_|j|j|_tt	|��|_
||_||_dSr�)
r[�codeobjr�r��_line_offsetrlrk�_cell_namesr�r	�_linestarts�_original_objectr�)r�r:r�r�rmrrr�__init__�szBytecode.__init__c	Cs*|j}t|j|j|j|j|j|j|jd�S)Nr�)	r�r�r*rjrirgr�r�r�)r�rmrrr�__iter__�s�zBytecode.__iter__cCsd�|jj|j�S)Nz{}({!r}))�format�	__class__r9r��r�rrr�__repr__�s
�zBytecode.__repr__cCs |jr|j}q||jj|jd�S)N)r�)r@rArBrC)�clsrDrrr�from_traceback�szBytecode.from_tracebackcCs
t|j�Sr\)r]r�r�rrr�infosz
Bytecode.infocCsl|j}|jdk	r|j}nd}t���>}t|j|j|j|j|j	|j
|j||d�	|��W5QR�SQRXdS)Nr�)r�rVr�r�r�r�r!r�)
r�r��io�StringIOr6r*rjrirgr�r�r��getvalue)r�rmry�outputrrrr
s


�zBytecode.dis)
r9r�r�r�r�r��classmethodr�r�rrrrrr�s

c	Csfddl}|��}|jd|�d�ddd�|��}|j�}|��}W5QRXt||jjd�}t	|�dS)Nr�infile�rb�?�-)r8�nargs�defaultr)
�argparse�ArgumentParser�add_argumentZFileType�
parse_argsr��readrrr)r��parser�argsr�rr�rrr�_testsr��__main__)N)N)NNNNNr)r�)r�NNNNN);r<�types�collectionsr�ZopcoderZ_opcodes_all�
MethodType�FunctionType�CodeTyper��staticmethodr8r0Zopmaprrrrr�rr�rrrrQrYr[rr]r�
namedtuplerpr{�__doc__r~r�r�ryrwrxr}rr
rr�r�r�rr3r6r7rr�r
r	rr�r9rrrr�<module>s�
����
-�
 �4�
6��=
__pycache__/xdrlib.cpython-38.pyc000064400000020037151153537610012701 0ustar00U

e5d�@sxdZddlZddlmZddlmZddddgZGd	d�de�ZGd
d�de�Z	dd�Z
Gd
d�d�ZGdd�d�ZdS)zRImplements (a subset of) Sun XDR -- eXternal Data Representation.

See: RFC 1014

�N)�BytesIO��wraps�Error�Packer�Unpacker�ConversionErrorc@s(eZdZdZdd�Zdd�Zdd�ZdS)	rz�Exception class for this module. Use:

    except xdrlib.Error as var:
        # var has the Error instance for the exception

    Public ivars:
        msg -- contains the message

    cCs
||_dS�N)�msg)�selfr
�r�/usr/lib64/python3.8/xdrlib.py�__init__szError.__init__cCs
t|j�Sr	)�reprr
�rrrr
�__repr__szError.__repr__cCs
t|j�Sr	)�strr
rrrr
�__str__sz
Error.__str__N)�__name__�
__module__�__qualname__�__doc__rrrrrrr
rs	c@seZdZdS)rN)rrrrrrr
r scst���fdd��}|S)z5 Wrap any raised struct.errors in a ConversionError. c
sFz�||�WStjk
r@}zt|jd�d�W5d}~XYnXdS�Nr)�struct�errorr�args)r�value�e��functionrr
�result&sz&raise_conversion_error.<locals>.resultr)rr rrr
�raise_conversion_error#sr!c@s�eZdZdZdd�Zdd�Zdd�ZeZedd	��Z	ed
d��Z
e
Zdd
�Zdd�Z
e
Zedd��Zedd��Zdd�ZeZdd�ZeZeZdd�Zdd�Zdd�ZdS)rz0Pack various data representations into a buffer.cCs|��dSr	��resetrrrr
r2szPacker.__init__cCst�|_dSr	)r�_Packer__bufrrrr
r#5szPacker.resetcCs
|j��Sr	)r$�getvaluerrrr
�
get_buffer8szPacker.get_buffercCs|j�t�d|��dS)N�>L�r$�writerZpack�r�xrrr
�	pack_uint=szPacker.pack_uintcCs|j�t�d|��dS)N�>lr(r*rrr
�pack_intAszPacker.pack_intcCs"|r|j�d�n|j�d�dS)Nss)r$r)r*rrr
�	pack_boolGszPacker.pack_boolc
Cs�z|�|d?d@�Wn8ttjfk
rN}zt|jd�d�W5d}~XYnXz|�|d@�Wn8ttjfk
r�}zt|jd�d�W5d}~XYnXdS)N� l��r)r,�	TypeErrorrrrr)rr+rrrr
�pack_uhyperKs"zPacker.pack_uhypercCs|j�t�d|��dS)N�>fr(r*rrr
�
pack_floatWszPacker.pack_floatcCs|j�t�d|��dS)N�>dr(r*rrr
�pack_double[szPacker.pack_doublecCsP|dkrtd��|d|�}|ddd}||t|�d}|j�|�dS)Nr� fstring size must be nonnegative���)�
ValueError�lenr$r))r�n�s�datarrr
�pack_fstring_szPacker.pack_fstringcCs"t|�}|�|�|�||�dSr	)r<r,r@)rr>r=rrr
�pack_stringis
zPacker.pack_stringcCs*|D]}|�d�||�q|�d�dS)N�r)r,)r�list�	pack_item�itemrrr
�	pack_listqs

zPacker.pack_listcCs*t|�|krtd��|D]}||�qdS)Nzwrong array size)r<r;)rr=rCrDrErrr
�pack_farraywszPacker.pack_farraycCs$t|�}|�|�|�|||�dSr	)r<r,rG)rrCrDr=rrr
�
pack_array}s
zPacker.pack_arrayN)rrrrrr#r&Zget_bufr!r,r.Z	pack_enumr/r2Z
pack_hyperr4r6r@Zpack_fopaquerAZpack_opaqueZ
pack_bytesrFrGrHrrrr
r/s2




c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�ZeZdd�Z
dd�Zdd�Zdd�Zdd�Zdd�ZeZdd�ZeZeZd d!�Zd"d#�Zd$d%�Zd&S)'rz;Unpacks various data representations from the given buffer.cCs|�|�dSr	r"�rr?rrr
r�szUnpacker.__init__cCs||_d|_dSr)�_Unpacker__buf�_Unpacker__posrIrrr
r#�szUnpacker.resetcCs|jSr	�rKrrrr
�get_position�szUnpacker.get_positioncCs
||_dSr	rL)rZpositionrrr
�set_position�szUnpacker.set_positioncCs|jSr	)rJrrrr
r&�szUnpacker.get_buffercCs|jt|j�krtd��dS)Nzunextracted data remains)rKr<rJrrrrr
�done�sz
Unpacker.donecCsB|j}|d|_}|j||�}t|�dkr2t�t�d|�dS)Nr9r'r�rKrJr<�EOFErrorrZunpack�r�i�jr?rrr
�unpack_uint�szUnpacker.unpack_uintcCsB|j}|d|_}|j||�}t|�dkr2t�t�d|�dS)Nr9r-rrPrRrrr
�
unpack_int�szUnpacker.unpack_intcCst|���Sr	)�boolrVrrrr
�unpack_bool�szUnpacker.unpack_boolcCs |��}|��}t|�d>|BS)Nr0)rU�int)r�hi�lorrr
�
unpack_uhyper�szUnpacker.unpack_uhypercCs|��}|dkr|d}|S)Nll)r\r*rrr
�unpack_hyper�szUnpacker.unpack_hypercCsB|j}|d|_}|j||�}t|�dkr2t�t�d|�dS)Nr9r3rrPrRrrr
�unpack_float�szUnpacker.unpack_floatcCsB|j}|d|_}|j||�}t|�dkr2t�t�d|�dS)N�r5rrPrRrrr
�
unpack_double�szUnpacker.unpack_doublecCsT|dkrtd��|j}||ddd}|t|j�kr<t�||_|j|||�S)Nrr7r8r9)r;rKr<rJrQ)rr=rSrTrrr
�unpack_fstring�szUnpacker.unpack_fstringcCs|��}|�|�Sr	)rUra)rr=rrr
�
unpack_string�szUnpacker.unpack_stringcCsBg}|��}|dkrq>|dkr,td|f��|�}|�|�q|S)NrrBz0 or 1 expected, got %r)rUr�append)r�unpack_itemrCr+rErrr
�unpack_list�szUnpacker.unpack_listcCs"g}t|�D]}|�|��q|Sr	)�rangerc)rr=rdrCrSrrr
�
unpack_farray�szUnpacker.unpack_farraycCs|��}|�||�Sr	)rUrg)rrdr=rrr
�unpack_array�szUnpacker.unpack_arrayN)rrrrrr#rMrNr&rOrUrVZunpack_enumrXr\r]r^r`raZunpack_fopaquerbZ
unpack_opaqueZunpack_bytesrergrhrrrr
r�s.
)
rr�ior�	functoolsr�__all__�	Exceptionrrr!rrrrrr
�<module>sU__pycache__/plistlib.cpython-38.pyc000064400000065037151153537610013250 0ustar00U

e5d�}�
@s>dZddddddddd	d
ddd
g
ZddlZddlZddlZddlZddlZddlmZddl	Z	ddl
Z
ddlZddlZddl
mZddlmZejdded�Ze��ej�ejdd��Zdd�Zdd�Zdd�Zdd�ZGdd�d�ZGdd
�d
�ZdZe� d�Z!dLd!d"�Z"d#d$�Z#e� d%ej$�Z%d&d'�Z&d(d)�Z'd*d+�Z(Gd,d-�d-�Z)Gd.d/�d/�Z*Gd0d1�d1e*�Z+d2d3�Z,Gd4d�de-�Z.d5d6d7d8d9�Z/e0�Z1Gd:d;�d;�Z2d<d=�Z3e4e5e6eje7fZ8Gd>d?�d?e0�Z9d@dA�Z:e;e<e,e)e+dB�e=e<e:e2e9dB�iZ>ddCe<dD�dEd	�Z?ddCe<dD�dFd�Z@e;dCdGdH�dId
�ZAe;dGdCdJ�dKd�ZBdS)Ma�plistlib.py -- a tool to generate and parse MacOSX .plist files.

The property list (.plist) file format is a simple XML pickle supporting
basic object types, like dictionaries, lists, numbers and strings.
Usually the top level object is a dictionary.

To write out a plist file, use the dump(value, file)
function. 'value' is the top level object, 'file' is
a (writable) file object.

To parse a plist from a file, use the load(file) function,
with a (readable) file object as the only argument. It
returns the top level object (again, usually a dictionary).

To work with plist data in bytes objects, you can use loads()
and dumps().

Values can be strings, integers, floats, booleans, tuples, lists,
dictionaries (but only with string keys), Data, bytes, bytearray, or
datetime.datetime objects.

Generate Plist example:

    pl = dict(
        aString = "Doodah",
        aList = ["A", "B", 12, 32.1, [1, 2, 3]],
        aFloat = 0.1,
        anInt = 728,
        aDict = dict(
            anotherString = "<hello & hi there!>",
            aUnicodeValue = "M\xe4ssig, Ma\xdf",
            aTrueValue = True,
            aFalseValue = False,
        ),
        someData = b"<binary gunk>",
        someMoreData = b"<lots of binary gunk>" * 10,
        aDate = datetime.datetime.fromtimestamp(time.mktime(time.gmtime())),
    )
    with open(fileName, 'wb') as fp:
        dump(pl, fp)

Parse Plist example:

    with open(fileName, 'rb') as fp:
        pl = load(fp)
    print(pl["aKey"])
�	readPlist�
writePlist�readPlistFromBytes�writePlistToBytes�Data�InvalidFileException�FMT_XML�
FMT_BINARY�load�dump�loads�dumps�UID�N)�BytesIO)�warn)�ParserCreate�PlistFormatzFMT_XML FMT_BINARY)�modulec	cs2t|t�r(t||��}|VW5QRXn|VdS�N)�
isinstance�str�open)�
pathOrFile�mode�fp�r� /usr/lib64/python3.8/plistlib.py�_maybe_openOs
rc
Cs<tdtd�t|d��}t|ddd�W5QR�SQRXdS)z�
    Read a .plist from a path or file. pathOrFile should either
    be a file name, or a readable binary file object.

    This function is deprecated, use load instead.
    z8The readPlist function is deprecated, use load() instead��rbNF��fmt�use_builtin_types)r�DeprecationWarningrr	)rrrrrrYs�c	Cs8tdtd�t|d��}t||tddd�W5QRXdS)z�
    Write 'value' to a .plist file. 'pathOrFile' may either be a
    file name or a (writable) file object.

    This function is deprecated, use dump instead.
    z9The writePlist function is deprecated, use dump() insteadr�wbTF�r!�	sort_keys�skipkeysN)rr#rr
r)�valuerrrrrrfs�cCstdtd�tt|�ddd�S)z}
    Read a plist data from a bytes object. Return the root object.

    This function is deprecated, use loads instead.
    zBThe readPlistFromBytes function is deprecated, use loads() insteadrNFr )rr#r	r��datarrrrss
�cCs,tdtd�t�}t||tddd�|��S)zp
    Return 'value' as a plist-formatted bytes object.

    This function is deprecated, use dumps instead.
    zAThe writePlistToBytes function is deprecated, use dumps() insteadrTFr%)rr#rr
r�getvalue)r(�frrrr~s�c@s>eZdZdZdd�Zedd��Zddd�Zd	d
�Zdd�Z	d
S)rz]
    Wrapper for binary data.

    This class is deprecated, use a bytes object instead.
    cCst|t�std��||_dS)Nzdata must be as bytes)r�bytes�	TypeErrorr*��selfr*rrr�__init__�s
z
Data.__init__cCs|t|��Sr)�_decode_base64)�clsr*rrr�
fromBase64�szData.fromBase64�LcCst|j|�Sr)�_encode_base64r*)r0�
maxlinelengthrrr�asBase64�sz
Data.asBase64cCs4t||j�r|j|jkSt|t�r,|j|kStSdSr)r�	__class__r*r-�NotImplemented�r0�otherrrr�__eq__�s


zData.__eq__cCsd|jjt|j�fS�Nz%s(%s)�r9�__name__�reprr*�r0rrr�__repr__�sz
Data.__repr__N)r5)
r@�
__module__�__qualname__�__doc__r1�classmethodr4r8r=rCrrrrr�s

c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)r
cCs<t|t�std��|dkr"td��|dkr2td��||_dS)Nzdata must be an int�zUIDs cannot be >= 2**64r�UIDs must be positive)r�intr.�
ValueErrorr*r/rrrr1�s
zUID.__init__cCs|jSrr)rBrrr�	__index__�sz
UID.__index__cCsd|jjt|j�fSr>r?rBrrrrC�szUID.__repr__cCs|j|jffSr)r9r*rBrrr�
__reduce__�szUID.__reduce__cCst|t�stS|j|jkSr)rr
r:r*r;rrrr=�s
z
UID.__eq__cCs
t|j�Sr)�hashr*rBrrr�__hash__�szUID.__hash__N)	r@rDrEr1rLrCrMr=rOrrrrr
�s	s�<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
zv[\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0c\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f]r5cCsP|dd}g}tdt|�|�D]$}||||�}|�t�|��q d�|�S)N��r�)�range�len�append�binasciiZ
b2a_base64�join)�sr7Z
maxbinsize�pieces�i�chunkrrrr6�sr6cCs(t|t�rt�|�d��St�|�SdS)N�utf-8)rrrVZ
a2b_base64�encode)rXrrrr2�s
r2z{(?P<year>\d\d\d\d)(?:-(?P<month>\d\d)(?:-(?P<day>\d\d)(?:T(?P<hour>\d\d)(?::(?P<minute>\d\d)(?::(?P<second>\d\d))?)?)?)?)?ZcCsLd}t�|���}g}|D]&}||}|dkr2qB|�t|��qtj|�S)N�ZyearZmonthZdayZhourZminute�second)�_dateParser�match�	groupdictrUrJ�datetime)rX�orderZgdZlst�key�valrrr�_date_from_string�srgcCs d|j|j|j|j|j|jfS)Nz%04d-%02d-%02dT%02d:%02d:%02dZr^)�drrr�_date_to_strings�ricCsZt�|�}|dk	rtd��|�dd�}|�dd�}|�dd�}|�dd�}|�d	d
�}|S)Nz<strings can't contains control characters; use bytes insteadz
�
�
�&z&amp;�<z&lt;�>z&gt;)�_controlCharPat�searchrK�replace)�text�mrrr�_escapes
rtc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)S)*�_PlistParsercCs"g|_d|_d|_||_||_dSr)�stack�current_key�root�_use_builtin_types�
_dict_type�r0r"�	dict_typerrrr1s
z_PlistParser.__init__cCsBt�|_|j|j_|j|j_|j|j_|j|j_	|j�
|�|jSr)r�parser�handle_begin_elementZStartElementHandler�handle_end_elementZEndElementHandler�handle_dataZCharacterDataHandler�handle_entity_declZEntityDeclHandlerZ	ParseFilerx)r0Zfileobjrrr�parses



z_PlistParser.parsecCstd��dS)Nz8XML entity declarations are not supported in plist files)r)r0Zentity_nameZis_parameter_entityr(�baseZ	system_idZ	public_idZ
notation_namerrrr�$sz_PlistParser.handle_entity_declcCs*g|_t|d|d�}|dk	r&||�dS)NZbegin_)r*�getattr)r0�element�attrs�handlerrrrr~*sz!_PlistParser.handle_begin_elementcCs"t|d|d�}|dk	r|�dS)NZend_)r�)r0r�r�rrrr0sz_PlistParser.handle_end_elementcCs|j�|�dSr)r*rUr/rrrr�5sz_PlistParser.handle_datacCs�|jdk	rFt|jdti��s.td|jj��||jd|j<d|_nB|jsT||_n4t|jdtg��sxtd|jj��|jd�|�dS)N���zunexpected element at line %d)	rwrrv�typerKr}�CurrentLineNumberrxrU�r0r(rrr�
add_object8s
��z_PlistParser.add_objectcCsd�|j�}g|_|S)N�)rWr*r/rrr�get_dataHsz_PlistParser.get_datacCs"|��}|�|�|j�|�dSr)rzr�rvrU)r0r�rhrrr�
begin_dictOs
z_PlistParser.begin_dictcCs*|jrtd|j|jjf��|j��dS)Nz%missing value for key '%s' at line %d)rwrKr}r�rv�poprBrrr�end_dictTs
�z_PlistParser.end_dictcCs8|jst|jdti��s*td|jj��|��|_dS)Nr�zunexpected key at line %d)rwrrvr�rKr}r�r�rBrrr�end_keyZs
�z_PlistParser.end_keycCsg}|�|�|j�|�dSr)r�rvrU)r0r��arrr�begin_array`s
z_PlistParser.begin_arraycCs|j��dSr)rvr�rBrrr�	end_arrayesz_PlistParser.end_arraycCs|�d�dS)NT�r�rBrrr�end_truehsz_PlistParser.end_truecCs|�d�dS)NFr�rBrrr�	end_falseksz_PlistParser.end_falsecCs@|��}|�d�s|�d�r.|�t|d��n|�t|��dS)NZ0xZ0X�)r��
startswithr�rJ)r0�rawrrr�end_integernsz_PlistParser.end_integercCs|�t|����dSr)r��floatr�rBrrr�end_realusz_PlistParser.end_realcCs|�|���dSr)r�r�rBrrr�
end_stringxsz_PlistParser.end_stringcCs2|jr|�t|����n|�t�|����dSr)ryr�r2r�rr4rBrrr�end_data{sz_PlistParser.end_datacCs|�t|����dSr)r�rgr�rBrrr�end_date�sz_PlistParser.end_dateN)r@rDrEr1r�r�r~rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrus(	ruc@s8eZdZddd�Zdd�Zdd�Zdd
d�Zdd
�Zd	S)�_DumbXMLWriterr�	cCs||_g|_||_||_dSr)�filerv�
_indent_level�indent)r0r��indent_levelr�rrrr1�sz_DumbXMLWriter.__init__cCs,|j�|�|�d|�|jd7_dS)Nz<%s>�)rvrU�writelnr��r0r�rrr�
begin_element�sz_DumbXMLWriter.begin_elementcCs@|jdkst�|j��|ks t�|jd8_|�d|�dS)Nrr�z</%s>)r��AssertionErrorrvr�r�r�rrr�end_element�sz_DumbXMLWriter.end_elementNcCs8|dk	r&t|�}|�d|||f�n|�d|�dS)Nz<%s>%s</%s>z<%s/>)rtr�)r0r�r(rrr�simple_element�sz_DumbXMLWriter.simple_elementcCsH|r8t|t�r|�d�}|j�|j|j�|j�|�|j�d�dS)Nr\�
)rrr]r��writer�r�)r0�linerrrr��s

z_DumbXMLWriter.writeln)rr�)N)r@rDrEr1r�r�r�r�rrrrr��s


r�c@sFeZdZddd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Zdd�Z	dS)�_PlistWriterr�	r�TFcCs.|r|�t�t�||||�||_||_dSr)r��PLISTHEADERr�r1�
_sort_keys�	_skipkeys)r0r�r�r�ZwriteHeaderr&r'rrrr1�s

z_PlistWriter.__init__cCs"|�d�|�|�|�d�dS)Nz<plist version="1.0">z</plist>)r��write_valuer�rrrr��s

z_PlistWriter.writecCs4t|t�r|�d|��n|dkr0|�d��n|dkrD|�d�n�t|t�r�d|krbdkrxnn|�dd	|�nt|��n�t|t�r�|�d
t|��n�t|t�r�|�|�n|t|t	�r�|�
|�nft|ttf�r�|�
|�nLt|tj��r|�dt|��n,t|ttf��r |�|�ntdt|���dS)
N�stringT�trueFZfalsel����rHZintegerz%d�real�datezunsupported type: %s)rrr�rJ�
OverflowErrorr�rA�dict�
write_dictr�
write_datar-�	bytearray�write_bytesrcri�tuple�list�write_arrayr.r�r�rrrr��s.





z_PlistWriter.write_valuecCs|�|j�dSr)r�r*r/rrrr��sz_PlistWriter.write_datacCsz|�d�|jd8_tddt|j�dd�|j��}t||��d�D]}|rJ|�|�qJ|jd7_|�	d�dS)Nr*r�r�r5r�s        r�)
r�r��maxrTr�rqr6�splitr�r�)r0r*r7r�rrrr��s
�z_PlistWriter.write_bytescCs�|rt|�d�|jr"t|���}n|��}|D]8\}}t|t�sP|jrHq.td��|�d|�|�	|�q.|�
d�n
|�d�dS)Nr��keys must be stringsre)r�r��sorted�itemsrrr�r.r�r�r�)r0rhr�rer(rrrr��s

z_PlistWriter.write_dictcCs<|r.|�d�|D]}|�|�q|�d�n
|�d�dS)N�array)r�r�r�r�)r0r�r(rrrr�s
z_PlistWriter.write_arrayN)rr�r�TF)
r@rDrEr1r�r�r�r�r�r�rrrrr��s�

%
r�cCs�d}|D]}|�|�rdSqtjdftjdftjdffD]N\}}|�|�sNq:|D]4}||�d��|�}|dt|��|krRdSqRq:dS)N)s<?xmls<plistTr\z	utf-16-bez	utf-16-le�asciiF)r��codecs�BOM_UTF8�BOM_UTF16_BE�BOM_UTF16_LE�decoder]rT)�header�prefixesZpfxZbom�encoding�start�prefixrrr�_is_fmt_xmls
�
r�c@seZdZddd�ZdS)r�Invalid filecCst�||�dSr)rKr1)r0�messagerrrr12szInvalidFileException.__init__N)r�)r@rDrEr1rrrrr1s�B�H�L�Q)r�rrP�c@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�_BinaryPlistParsera
    Read or write a binary plist file, following the description of the binary
    format.  Raise InvalidFileException in case of error, otherwise return the
    root object.

    see also: http://opensource.apple.com/source/CF/CF-744.18/CFBinaryPList.c
    cCs||_||_dSr)ryrzr{rrrr1Asz_BinaryPlistParser.__init__cCs�z~||_|j�dtj�|j�d�}t|�dkr6t��t�d|�\}|_	}}}|j�|�|�
||�|_tg||_
|�|�WStttjttfk
r�t��YnXdS)Ni��� z>6xBBQQQ)�_fp�seek�os�SEEK_END�readrTr�struct�unpack�	_ref_size�
_read_ints�_object_offsets�
_undefined�_objects�_read_object�OSError�
IndexError�errorr�rK)r0r�trailer�offset_size�num_objects�
top_object�offset_table_offsetrrrr�Es*
��z_BinaryPlistParser.parsecCsL|dkrH|j�d�dd@}d|>}dt|}t�||j�|��dS|S)z$ return the size of the next object.�r�rrQrn)r�r��_BINARY_FORMATr�r�)r0�tokenLrsrXr,rrr�	_get_size^sz_BinaryPlistParser._get_sizecst|j��|���tkr2t�d|�t�����S�rFt���|krLt��t��fdd�td�|��D��SdS)Nrnc3s&|]}t��||��d�VqdS)�bigN)rJ�
from_bytes)�.0rZ�r*�sizerr�	<genexpr>os�z0_BinaryPlistParser._read_ints.<locals>.<genexpr>r)	r�r�r�r�r�rTrr�rS)r0�nr�rr�rr�hs�z_BinaryPlistParser._read_intscCs|�||j�Sr)r�r�)r0r�rrr�
_read_refsrsz_BinaryPlistParser._read_refscs�j|}|tk	r|S�j|}�j�|��j�d�d}|d@|d@}}|dkr^d}�n�|dkrnd}�n�|dkr~d	}�n�|dkr�d
}�n�|dkr�tj�j�d|>�d|d
kd�}�nT|dkr�t�	d�j�d��d}�n0|dk�rt�	d�j�d��d}�n
|dk�rDt�	d�j�d��d}t
�
ddd�t
j|d�}�n�|dk�r���|�}�j�|�}t
|�|k�rxt���j�st|�}�n�|dk�rΈ�|�}�j�|�}	t
|	�|k�r�t��|	�d�}�n@|dk�r��|�d}�j�|�}	t
|	�|k�rt��|	�d�}n�|dk�r:tt��j�d|�d��}n�|dk�r���|�}��|�}
g}|�j|<|��fdd �|
D��n�|d!k�r��|�}��|�}��|�}
���}|�j|<z.t||
�D]\}}
��|
�|��|�<�q�Wntk
�rt��YnXnt��|�j|<|S)"zx
        read the object by reference.

        May recursively read sub-objects (content of an array/dict/set)
        r�r��r�Nr�F�	TrRr�r�rQ�Zsigned�"z>frP�#z>d�3��)Zseconds�@�Pr��`r�utf-16be��c3s|]}��|�VqdSr)r�)r��xrBrrr��sz2_BinaryPlistParser._read_object.<locals>.<genexpr>��)r�r�r�r�r�r�rJr�r�r�rcZ	timedeltar�rTrryrr�r
r�extendrz�zipr�r.)r0�ref�result�offset�tokenZtokenHr�r,rXr*Zobj_refsZkey_refs�k�orrBrr�us�

�



�















z_BinaryPlistParser._read_objectN)
r@rDrErFr1r�r�r�rr�rrrrr�9s

r�cCs,|dkrdS|dkrdS|dkr$dSdSdS)N�r��r�rPr�r)�countrrr�_count_to_size�src@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�_BinaryPlistWritercCs||_||_||_dSr)r�r�r�)r0rr&r'rrrr1�sz_BinaryPlistWriter.__init__c
Cs�g|_i|_i|_|�|�t|j�}dg||_t|�|_t|j|_	|j
�d�|jD]}|�|�qZ|�
|�}|j
��}t|�}dt||}|j
�tj|f|j���d}|||j|||f}	|j
�tjd|	���dS)Nr�bplist00rn�	>5xBBBQQQ)r)�_objlist�	_objtable�_objidtable�_flattenrTr�rr�r��_ref_formatr�r��
_write_object�
_getrefnum�tellr��pack)
r0r(r��objr�r�r�Z
offset_formatZsort_versionr�rrrr��s2





�z_BinaryPlistWriter.writec	Csrt|t�r"t|�|f|jkrZdSn8t|t�rHt|j�|jf|jkrZdSnt|�|jkrZdSt|j	�}|j	�
|�t|t�r�||jt|�|f<n0t|t�r�||jt|j�|jf<n||jt|�<t|t��rHg}g}|��}|j
r�t|�}|D]:\}}t|t��s|j�r
q�td��|�
|�|�
|�q�t�||�D]}|�|��q4n&t|ttf��rn|D]}|�|��q\dS)Nr�)r�_scalarsr�r!rr*�idr"rTr rUr�r�r�r�rr�r.�	itertools�chainr#r�r�)	r0r(Zrefnum�keys�valuesr�r�vrrrrr#sB





z_BinaryPlistWriter._flattencCsNt|t�r|jt|�|fSt|t�r<|jt|j�|jfS|jt|�SdSr)rr*r!r�rr*r"r+r�rrrr&Ns


z_BinaryPlistWriter._getrefnumcCs�|dkr"|j�t�d||B��n�|dkrH|j�t�d|dBd|��nh|dkrn|j�t�d|dBd|��nB|d	kr�|j�t�d
|dBd|��n|j�t�d|dBd
|��dS)Nr�z>Brz>BBBr�rz>BBH�rz>BBL�z>BBQ�)r�r�r�r()r0rr�rrr�_write_sizeVsz_BinaryPlistWriter._write_sizecs���|�}�j���j|<|dkr2�j�d��nl|dkrJ�j�d��nT|dkrb�j�d��n<t|t��rl|dkr�z�j�t�dd|��Wn tj	k
r�t
|�d�YnXn�|d	krԈj�t�d
d|��n�|dkr�j�t�d
d|��nt|dk�r�j�t�dd|��nR|dk�r8�j�t�dd|��n0|dk�r`�j�d|jdddd��nt
|���n2t|t��r��j�t�dd|���nt|t
j
��r�|t
�
ddd���}�j�t�dd|���n�t|t��r��dt|j���j�|j��n�t|ttf��r0��dt|���j�|��nnt|t��r�z|�d�}��dt|��Wn4tk
�r�|�d �}��d!t|�d"�YnX�j�|��n�t|t��r^|jdk�r�td#��n�|jd	k�r�j�t�d
d$|��nt|jdk�r
�j�t�d
d%|��nP|jdk�r.�j�t�dd&|��n,|jdk�rR�j�t�dd'|��nt
|���n@t|ttf��r��fd(d)�|D�}t|�}��d*|��j�tjd+�j|f|���n�t|t��r�gg}}�j�r�t|� ��}	n|� �}	|	D]J\}
}t|
t��s�j!�r�q�t"d,��|�#��|
��|�#��|���q�t|�}��d-|��j�tjd+�j|f|����j�tjd+�j|f|���nt"|��dS).N�F�Tr�rz>Bqr3rz>BBr�rz>BHr1rz>BLr2lz>BQrH�r�rz>Bdrrr�rrr�r	rr
rrIr���csg|]}��|��qSr)r&)r�rrBrr�
<listcomp>�sz4_BinaryPlistWriter._write_object.<locals>.<listcomp>r
rnr�r)$r&r�r'r�r�rrJr�r(r�r��to_bytesr�rcZ
total_secondsrr4rTr*r-r�rr]�UnicodeEncodeErrorr
rKr�r�r$r�r�r�r�r�r.rU)r0r(rr,�tZrefsrXZkeyRefsZvalRefsZ	rootItemsrr0rrBrr%fs�






$
"$z _BinaryPlistWriter._write_objectN)	r@rDrEr1r�r#r&r4r%rrrrr�s-0rcCs|dd�dkS)Nr�rr)r�rrr�_is_fmt_binary�sr?)�detectr}�writerT�r!r"r|cCsl|dkrJ|�d�}|�d�t��D]}|d|�r$|d}qVq$t��nt|d}|||d�}|�|�S)z�Read a .plist file. 'fp' should be a readable and binary file object.
    Return the unpacked root object (which usually is a dictionary).
    Nr�rr@r})r"r|)r�r��_FORMATSr/rr�)rr!r"r|r��info�P�prrrr	�s

cCst|�}t||||d�S)zqRead a .plist file from a bytes object.
    Return the unpacked root object (which usually is a dictionary).
    rB)rr	)r(r!r"r|rrrrr�s�Fr%cCs:|tkrtd|f��t|d|||d�}|�|�dS)zWWrite 'value' to a .plist file. 'fp' should be a writable,
    binary file object.
    zUnsupported format: %rrA)r&r'N)rCrKr�)r(rr!r&r'rArrrr
s�r!r'r&cCs t�}t|||||d�|��S)z?Return a bytes object with the contents for a .plist file.
    rG)rr
r+)r(r!r'r&rrrrrs)r5)CrF�__all__rVr��
contextlibrc�enum�iorr,r��rer��warningsrZxml.parsers.expatr�Enumr@r�globals�update�__members__�contextmanagerrrrrrrr
r��compileror6r2�ASCIIr`rgrirtrur�r�r�rKrr��objectr�r�rrrJr�r-r*rr?rr�rrCr	rr
rrrrr�<module>s�0�

	


'"�
	
s&d!$
a	���	__pycache__/py_compile.cpython-38.opt-1.pyc000064400000016332151153537610014517 0ustar00U

&�.e �@s�dZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddddgZ
Gdd�de�ZGdd�dej
�Zd	d
�Zdd
d�Zddd�Zedkr�e�e��dS)zqRoutine to "compile" a .py file to a .pyc file.

This module has intimate knowledge of the format of .pyc files.
�N�compile�main�PyCompileError�PycInvalidationModec@s"eZdZdZddd�Zdd�ZdS)	ra�Exception raised when an error occurs while attempting to
    compile the file.

    To raise this exception, use

        raise PyCompileError(exc_type,exc_value,file[,msg])

    where

        exc_type:   exception type to be used in error message
                    type name can be accesses as class variable
                    'exc_type_name'

        exc_value:  exception value to be used in error message
                    can be accesses as class variable 'exc_value'

        file:       name of file being compiled to be used in error message
                    can be accesses as class variable 'file'

        msg:        string message to be written as error message
                    If no value is given, a default exception message will be
                    given, consistent with 'standard' py_compile output.
                    message (or default) can be accesses as class variable
                    'msg'

    �cCst|j}|tkr2d�t�||��}|�dd|�}nd||f}t�||pJ||||�||_||_	||_
|pl||_dS)NrzFile "<string>"z	File "%s"z
Sorry: %s: %s)�__name__�SyntaxError�join�	traceback�format_exception_only�replace�	Exception�__init__�
exc_type_name�	exc_value�file�msg)�self�exc_typerrrr�tbtext�errmsg�r�"/usr/lib64/python3.8/py_compile.pyr.s�zPyCompileError.__init__cCs|jS)N)r)rrrr�__str__>szPyCompileError.__str__N)r)r�
__module__�__qualname__�__doc__rrrrrrrs
c@seZdZdZdZdZdS)r���N)rrr�	TIMESTAMP�CHECKED_HASH�UNCHECKED_HASHrrrrrBscCs(tj�d�rtj�d�stjStjSdS)N�SOURCE_DATE_EPOCH�RPM_BUILD_ROOT)�os�environ�getrr!r rrrr�_get_default_invalidation_modeHs

�r(F���c
Cs�|dkrt�}|dkrL|dkr@|dkr*|nd}tjj||d�}ntj�|�}tj�|�rld}t|�|���n*tj�	|�r�tj�
|�s�d}t|�|���tj�d|�}	|	�
|�}
z|	j|
|p�||d	�}Wndtk
�r*}zDt|j||p�|�}
|d
k�r|�r|
�ntj�|
jd�WY�dSd}~XYnXz tj�|�}|�rJt�|�Wntk
�rbYnX|tjk�r�|	�|�}tj�||d|d
�}n"tj�|
�}tj�|||tjk�}tj� |�}tj�!|||�|S)a�Byte-compile one Python source file to Python bytecode.

    :param file: The source file name.
    :param cfile: The target byte compiled file name.  When not given, this
        defaults to the PEP 3147/PEP 488 location.
    :param dfile: Purported file name, i.e. the file name that shows up in
        error messages.  Defaults to the source file name.
    :param doraise: Flag indicating whether or not an exception should be
        raised when a compile error is found.  If an exception occurs and this
        flag is set to False, a string indicating the nature of the exception
        will be printed, and the function will return to the caller. If an
        exception occurs and this flag is set to True, a PyCompileError
        exception will be raised.
    :param optimize: The optimization level for the compiler.  Valid values
        are -1, 0, 1 and 2.  A value of -1 means to use the optimization
        level of the current interpreter, as given by -O command line options.
    :param invalidation_mode:
    :param quiet: Return full output with False or 0, errors only with 1,
        and no output with 2.

    :return: Path to the resulting byte compiled file.

    Note that it isn't necessary to byte-compile Python modules for
    execution efficiency -- Python itself byte-compiles a module when
    it is loaded, and if it can, writes out the bytecode to the
    corresponding .pyc file.

    However, if a Python installation is shared between users, it is a
    good idea to byte-compile all modules upon installation, since
    other users may not be able to write in the source directories,
    and thus they won't be able to write the .pyc file, and then
    they would be byte-compiling every module each time it is loaded.
    This can slow down program start-up considerably.

    See compileall.py for a script/module that uses this module to
    byte-compile all installed files (or all files in selected
    directories).

    Do note that FileExistsError is raised if cfile ends up pointing at a
    non-regular file or symlink. Because the compilation uses a file renaming,
    the resulting file would be regular and thus not the same type of file as
    it was previously.
    Nrrr)�optimizationzc{} is a symlink and will be changed into a regular file if import writes a byte-compiled file to itzk{} is a non-regular file and will be changed into a regular one if import writes a byte-compiled file to itz<py_compile>)�	_optimizer�
�mtime�size)"r(�	importlib�util�cache_from_sourcer%�path�islink�FileExistsError�format�exists�isfile�	machinery�SourceFileLoader�get_data�source_to_coder
r�	__class__�sys�stderr�writer�dirname�makedirsrr �
path_stats�_bootstrap_external�_code_to_timestamp_pyc�source_hash�_code_to_hash_pycr!�
_calc_mode�
_write_atomic)r�cfile�dfile�doraise�optimize�invalidation_mode�quietr*r�loader�source_bytes�code�err�py_excr@�source_stats�bytecoderE�moderrrrPsd-�
�


��cCs|dkrtjdd�}d}|dgkr�tj��}|s4q�|�d�}zt|dd�Wq$tk
r�}zd}tj�d|j	�W5d}~XYq$t
k
r�}zd}tj�d|�W5d}~XYq$Xq$nV|D]P}zt|dd�Wq�tk
�r}zd}tj�d|j	�W5d}~XYq�Xq�|S)	a�Compile several source files.

    The files named in 'args' (or on the command line, if 'args' is
    not specified) are compiled and the resulting bytecode is cached
    in the normal manner.  This function does not search a directory
    structure to locate source files; it only compiles files named
    explicitly.  If '-' is the only parameter in args, the list of
    files is taken from standard input.

    Nrr�-r,T)rKz%s
)r=�argv�stdin�readline�rstriprrr>r?r�OSError)�args�rv�filename�errorrrrr�s.


"&&�__main__)NNFr)Nr)N)r�enumZimportlib._bootstrap_externalr/�importlib.machinery�importlib.utilr%Zos.pathr=r
�__all__r
r�Enumrr(rrr�exitrrrr�<module>s&0�
a
&__pycache__/dataclasses.cpython-38.opt-2.pyc000064400000047367151153537610014663 0ustar00U

e5d5��@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZdddddddd	d
ddd
gZ	Gdd�de
�ZGdd�d�Ze�Z
Gdd�d�Ze�Ze�i�ZGdd�d�Zed�Zed�Zed�ZdZdZdZe�d�ZGdd�de�ZGdd�ded�ZGd d�d�ZGd!d"�d"�Zeed#d#dd#dd$�d%d�Z d&d'�Z!d(d)�Z"dded*�d+d,�Z#d-d.�Z$d/d0�Z%d1d2�Z&d3d4�Z'd5d6�Z(d7d8�Z)d9d:�Z*d;d<�Z+d=d>�Z,d?d@�Z-dAdB�Z.dCdD�Z/dEdF�Z0dGdH�Z1dIdJ�Z2dKdL�Z3dddde1de2de2e3e2e3e2e3e2e3dM�Z4dNdO�Z5ddd#d#d#dPdPdPdQ�dRd�Z6dSd�Z7dTdU�Z8dVd
�Z9e:dW�dXd	�Z;dYdZ�Z<e=d[�d\d
�Z>d]d^�Z?d_dd#d#d#dPdPdPd`�dad�Z@dbd�ZAdceA_BdS)e�N�	dataclass�field�Field�FrozenInstanceError�InitVar�MISSING�fields�asdict�astuple�make_dataclass�replace�is_dataclassc@seZdZdS)rN��__name__�
__module__�__qualname__�rr�#/usr/lib64/python3.8/dataclasses.pyr�sc@seZdZdd�ZdS)�_HAS_DEFAULT_FACTORY_CLASScCsdS)Nz	<factory>r��selfrrr�__repr__�sz#_HAS_DEFAULT_FACTORY_CLASS.__repr__N)rrrrrrrrr�src@seZdZdS)�
_MISSING_TYPENrrrrrr�src@seZdZdd�Zdd�ZdS)�_FIELD_BASEcCs
||_dS�N��name�rrrrr�__init__�sz_FIELD_BASE.__init__cCs|jSrrrrrrr�sz_FIELD_BASE.__repr__N)rrrrrrrrrr�sr�_FIELD�_FIELD_CLASSVAR�_FIELD_INITVARZ__dataclass_fields__Z__dataclass_params__Z
__post_init__z^(?:\s*(\w+)\s*\.)?\s*(\w+)c@seZdZdd�ZdS)�_InitVarMetacCst|�Sr)r)rZparamsrrr�__getitem__�sz_InitVarMeta.__getitem__N)rrrr#rrrrr"�sr"c@s eZdZdZdd�Zdd�ZdS)r��typecCs
||_dSrr$)rr%rrrr�szInitVar.__init__cCs,t|jt�r|jj}n
t|j�}d|�d�S)Nzdataclasses.InitVar[�])�
isinstancer%r�repr)rZ	type_namerrrr�s

zInitVar.__repr__N�rrr�	__slots__rrrrrrr�s)�	metaclassc@s(eZdZdZdd�Zdd�Zdd�ZdS)	r)
rr%�default�default_factoryr(�hash�init�compare�metadata�_field_typecCsRd|_d|_||_||_||_||_||_||_|dkr<tnt	�
|�|_d|_dSr)
rr%r,r-r/r(r.r0�_EMPTY_METADATA�types�MappingProxyTyper1r2)rr,r-r/r(r.r0r1rrrr�s��zField.__init__cCsVd|j�d|j�d|j�d|j�d|j�d|j�d|j�d|j�d	|j�d
|j	�d�S)NzField(name=z,type=z	,default=z,default_factory=z,init=�,repr=z,hash=z	,compare=z
,metadata=z
,_field_type=�))
rr%r,r-r/r(r.r0r1r2rrrrrszField.__repr__cCs(tt|j�dd�}|r$||j||�dS)N�__set_name__)�getattrr%r,)r�ownerr�funcrrrr8szField.__set_name__N)rrrr*rrr8rrrrr�sc@s eZdZdZdd�Zdd�ZdS)�_DataclassParams�r/r(�eq�order�unsafe_hash�frozencCs(||_||_||_||_||_||_dSrr=)rr/r(r>r?r@rArrrr*sz_DataclassParams.__init__c
Cs6d|j�d|j�d|j�d|j�d|j�d|j�d�
S)Nz_DataclassParams(init=r6z,eq=z,order=z
,unsafe_hash=z,frozen=r7r=rrrrr2sz_DataclassParams.__repr__Nr)rrrrr<!sr<T�r,r-r/r(r.r0r1cCs,|tk	r|tk	rtd��t|||||||�S)Nz/cannot specify both default and default_factory)r�
ValueErrorrrBrrrr@s
�cs(|sdSdd��fdd�|D���d�S)N�()�(�,csg|]}��d|j���qS)�.r��.0�f��obj_namerr�
<listcomp>_sz_tuple_str.<locals>.<listcomp>�,))�join)rLrrrKr�
_tuple_strVsrPcs"t��t�����fdd��}|S)Nc	sDt|�t��f}|�krdS��|�z�|�}W5��|�X|S)Nz...)�id�_thread�	get_ident�add�discard)r�key�result��repr_running�
user_functionrr�wrapperis
z _recursive_repr.<locals>.wrapper)�set�	functools�wraps)rZr[rrXr�_recursive_reprds
r_)�globals�locals�return_typec
Cs�|dkri}d|krt|d<d}|tk	r4||d<d}d�|�}d�dd�|D��}d	|�d
|�d|�d|��}d
�|���}d|�d|�d|��}i}	t|||	�|	df|�S)NZBUILTINS�Z_return_typez->_return_typerF�
css|]}d|��VqdS)z  Nr)rI�brrr�	<genexpr>�sz_create_fn.<locals>.<genexpr>z def rEr7z:
�, zdef __create_fn__(z):
z	
 return Z
__create_fn__)�builtinsrrO�keys�exec)
r�argsZbodyr`rarbZreturn_annotationZtxtZ
local_vars�nsrrr�
_create_fnws 
rmcCs0|rd|�d|�d|�d�S|�d|�d|��S)NzBUILTINS.object.__setattr__(rFr7rG�=r)rAr�value�	self_namerrr�
_field_assign�srqcCs�d|j��}|jtk	rV|jr@|j||<|�d|j�d|j��}q�|j||<|�d�}n8|jr�|jtkrn|j}q�|jtk	r�|j||<|j}ndS|jtkr�dSt||j||�S)NZ_dflt_z() if z is _HAS_DEFAULT_FACTORY else rD)rr-rr/r,r2r!rq)rJrAr`rpZdefault_namerorrr�_field_init�s"






rrcCsV|jtkr|jtkrd}n&|jtk	r2d|j��}n|jtk	r@d}|j�d|j�|��S)Nrcz=_dflt_z=_HAS_DEFAULT_FACTORYz:_type_)r,rr-r)rJr,rrr�_init_param�s

rscCs�d}|D]:}|jr|jtkr&|jtks,d}q|rtd|j�d���qdd�|D�}|�ttd��g}|D] }t||||�}	|	rj|�	|	�qj|r�d�
d	d
�|D��}
|�	|�dt�d|
�d
��|s�dg}td|gdd�|D�|||dd�S)NFTznon-default argument z follows default argumentcSsi|]}d|j��|j�qS)Z_type_)rr%rHrrr�
<dictcomp>�s
z_init_fn.<locals>.<dictcomp>)r�_HAS_DEFAULT_FACTORYrFcss|]}|jtkr|jVqdSr)r2r!rrHrrrrf	s
�z_init_fn.<locals>.<genexpr>rGrEr7�passrcSsg|]}|jrt|��qSr)r/rsrHrrrrMsz_init_fn.<locals>.<listcomp>)rar`rb)
r/r,rr-�	TypeErrorr�updaterurr�appendrO�_POST_INIT_NAMErm)rrA�
has_post_initrpr`Zseen_defaultrJraZ
body_lines�lineZ
params_strrrr�_init_fn�s:��r}cCs2tdddd�dd�|D��dg|d�}t|�S)	Nrrz(return self.__class__.__qualname__ + f"(rgcSs g|]}|j�d|j�d��qS)z={self.z!r}rrHrrrrMs�z_repr_fn.<locals>.<listcomp>z)"�r`)rmrOr_)rr`�fnrrr�_repr_fns
����r�cCsp|td�}|r,dd�dd�|D��d}nd}tdd	d
|�d�dd
f||d�tddd
|�d�ddf||d�fS)N)�clsrrErFcss|]}t|j�VqdSr)r(rrHrrrrf(sz'_frozen_get_del_attr.<locals>.<genexpr>rNrD�__setattr__)rrroz if type(self) is cls or name in �:z> raise FrozenInstanceError(f"cannot assign to field {name!r}")z)super(cls, self).__setattr__(name, value))rar`�__delattr__rz; raise FrozenInstanceError(f"cannot delete field {name!r}")z"super(cls, self).__delattr__(name))rrOrm)r�rr`raZ
fields_strrrr�_frozen_get_del_attr$s2�
��
���r�cCs$t|ddd|�|�|��dg|d�S)N)r�otherz%if other.__class__ is self.__class__:z return zreturn NotImplementedr~)rm)r�op�
self_tuple�other_tupler`rrr�_cmp_fn=s��r�cCs$td|�}tddd|�d�g|d�S)Nr�__hash__rzreturn hash(r7r~)rPrm)rr`r�rrr�_hash_fnKs
�r�cCs$||jkp"t|�|jko"|j|jkSr)�ClassVarr%Z
_GenericAliasZ
__origin__)�a_type�typingrrr�_is_classvarSs

�r�cCs||jkpt|�|jkSr)rr%)r��dataclassesrrr�_is_initvar[s
�r�c	Cs�t�|�}|r�d}|�d�}|s2tj�|j�j}n2tj�|j�}|rd|j�|�|krdtj�|j�j}|r�||�|�d��|�r�dSdS)N��TF)�_MODULE_IDENTIFIER_RE�match�group�sys�modules�getr�__dict__)	Z
annotationr�Za_moduler�Zis_type_predicater�rlZmodule_name�modulerrr�_is_typebs)

r�cCs8t||t�}t|t�r|}nt|tj�r,t}t|d�}||_||_t	|_
tj�
d�}|r�t||�s�t|jt�r�t|j|||jt�r�t|_
|j
t	kr�tjt}t||�s�t|jt�r�t|j|||jt�r�t|_
|j
ttfkr�|jtk	r�td|j�d���|j
t	k�r4t|jtttf��r4tdt|j��d|j�d���|S)N)r,r��field z cannot have a default factoryzmutable default z for field z$ is not allowed: use default_factory)r9rr'rr4�MemberDescriptorTyperrr%rr2r�r�r�r��strr�r�r rr�rr!r-rwr,�list�dictr\rC)r�Za_namer�r,rJr�r�rrr�
_get_field�sF



���



���
	 r�cCs||jkrdSt|||�dS)NTF)r��setattr)r�rrorrr�_set_new_attribute�s
r�cCsdSrr�r�rr`rrr�_hash_set_none�sr�cCsdd�|D�}t||�S)NcSs(g|] }|jdkr|jrn|jr|�qSr)r.r0rHrrrrMs

z_hash_add.<locals>.<listcomp>)r�)r�rr`�fldsrrr�	_hash_addsr�cCstd|j����dS)Nz-Cannot overwrite attribute __hash__ in class )rwrr�rrr�_hash_exceptionsr�))FFFF)FFFT)FFTF)FFTT)FTFF)FTFT)FTTF)FTTT)TFFF)TFFT)TFTF)TFTT)TTFF)TTFT)TTTF)TTTTcs�i}�jtjkr tj�jj}ni}t�tt||||||��d}	d}
�jddd�D]D}t|t	d�}|dk	rVd}
|�
�D]}
|
||
j<qzt|t�jrVd}	qV�j�
di�}�fdd�|��D�}|D]L}
|
||
j<tt�|
jd�t�r�|
jtk�rt�|
j�q�t�|
j|
j�qĈj��D].\}}t|t��r||k�rt|�d����q|
�rz|	�rf|�sftd	��|	�sz|�rztd
��t�t	|��j�
dt�}|tk�p�|dk�o�d�jk}|�r�|�s�td
��|�rt�t�}dd�|�
�D�}t�dt|||d|k�rdnd|��dd�|�
�D�}|�rHdd�|D�}t�dt||��|�r�dd�|D�}td|�}td|�}t�dtdd|||d��|�r�dd�|D�}td|�}td|�}dD]>\}}t�|t|||||d���r�td|�d�j�d����q�|�r8t�||�D].}t�|j|��rtd|j�d�j�����qtt |�t |�t |�|f}|�rh|�||��_!t�d��s��jt"t#�$����%dd ��_&�S)!NF���rT�__annotations__csg|]\}}t�||��qSr)r�)rIrr%�r�rrrM]s�z"_process_class.<locals>.<listcomp>z& is a field but has no type annotationz5cannot inherit non-frozen dataclass from a frozen onez5cannot inherit frozen dataclass from a non-frozen oner��__eq__z eq must be true if order is truecSsg|]}|jttfkr|�qSr)r2rr!rHrrrrM�s�rrZ__dataclass_self__cSsg|]}|jtkr|�qSr�r2rrHrrrrM�s
cSsg|]}|jr|�qSr)r(rHrrrrM�srcSsg|]}|jr|�qSr�r0rHrrrrM�sr�z==r~cSsg|]}|jr|�qSrr�rHrrrrM�s))�__lt__�<)�__le__z<=)�__gt__�>)�__ge__z>=zCannot overwrite attribute z
 in class z). Consider using functools.total_ordering�__doc__z -> Nonerc)'rr�r�r�r��_PARAMSr<�__mro__r9�_FIELDS�valuesrrAr��itemsr'rr,r�delattrrwrC�hasattrrzr�r}r�rPr�rr��_hash_action�boolr�r��inspectZ	signaturerr�)r�r/r(r>r?r@rArr`Zany_frozen_baseZhas_dataclass_basesreZbase_fieldsrJZcls_annotationsZ
cls_fieldsrroZ
class_hashZhas_explicit_hashr{r�Z
field_listr�r�r�rZhash_actionrr�r�_process_class's��
�

�
��

��


����r�Fr=cs*������fdd�}|dkr"|S||�S)Ncst|�������Sr)r�r��r>rAr/r?r(r@rr�wrap�szdataclass.<locals>.wrapr)r�r/r(r>r?r@rAr�rr�rr�scCsBzt|t�}Wntk
r*td��YnXtdd�|��D��S)Nz0must be called with a dataclass type or instancecss|]}|jtkr|VqdSrr�rHrrrrf
s
zfields.<locals>.<genexpr>)r9r��AttributeErrorrw�tupler�)Zclass_or_instancerrrrr�s
cCstt|�t�Sr)r�r%r�)�objrrr�_is_dataclass_instancesr�cCs t|t�r|nt|�}t|t�Sr)r'r%r�r�)r�r�rrrr
s��dict_factorycCst|�std��t||�S)Nz0asdict() should be called on dataclass instances)r�rw�
_asdict_inner)r�r�rrrr	scs�t|�rDg}t|�D]&}tt||j���}|�|j|f�q�|�St|t�rrt|d�rrt	|��fdd�|D��St|t
tf�r�t	|��fdd�|D��St|t�r�t	|��fdd�|��D��St
�|�SdS)N�_fieldscsg|]}t|���qSr�r��rI�vr�rrrMOsz!_asdict_inner.<locals>.<listcomp>c3s|]}t|��VqdSrr�r�r�rrrfTsz _asdict_inner.<locals>.<genexpr>c3s&|]\}}t|��t|��fVqdSrr��rI�kr�r�rrrfVs��)r�rr�r9rryr'r�r�r%r�r�r��copy�deepcopy)r�r�rWrJrorr�rr�4s
�r���
tuple_factorycCst|�std��t||�S)Nz1astuple() should be called on dataclass instances)r�rw�_astuple_inner)r�r�rrrr
]scs�t|�r>g}t|�D] }tt||j���}|�|�q�|�St|t�rlt|d�rlt	|��fdd�|D��St|t
tf�r�t	|��fdd�|D��St|t�r�t	|��fdd�|��D��St
�|�SdS)Nr�csg|]}t|���qSr�r�r�r�rrrM�sz"_astuple_inner.<locals>.<listcomp>c3s|]}t|��VqdSrr�r�r�rrrf�sz!_astuple_inner.<locals>.<genexpr>c3s&|]\}}t|��t|��fVqdSrr�r�r�rrrf�s�)r�rr�r9rryr'r�r�r%r�r�r�r�r�)r�r�rWrJrorr�rr�us
�r�r)�bases�	namespacer/r(r>r?r@rAc	s�dkri�n����t�}
i}|D]�}t|t�r<|}
d}nDt|�dkrR|\}
}n.t|�dkrr|\}
}}|�|
<ntd|����t|
t�r�|
��s�td|
����t�|
�r�td|
����|
|
kr�td|
����|
�	|
�|||
<q$|�d<t
�||i�fd	d
��}t|||||||	d�S)Nz
typing.Anyr��zInvalid field: z'Field names must be valid identifiers: z"Field names must not be keywords: zField name duplicated: r�cs
|���Sr)rx)rl�r�rr�<lambda>��z make_dataclass.<locals>.<lambda>r=)
r�r\r'r��lenrw�isidentifier�keyword�	iskeywordrTr4�	new_classr)Zcls_namerr�r�r/r(r>r?r@rA�seenZanns�itemr�tp�specr�rr�rr�s:






�cOst|�dkr tdt|��d���|r,|\}n4d|krX|�d�}ddl}|jdtdd�ntd	��t|�sptd
��t|t��	�D]v}|j
tkr�q~|js�|j
|kr~td|j
�d���q~|j
|kr~|j
tkr�|jtkr�td
|j
�d���t||j
�||j
<q~|jf|�S)Nr�z*replace() takes 1 positional argument but z were givenr�rz/Passing 'obj' as keyword argument is deprecatedr�)�
stacklevelz7replace() missing 1 required positional argument: 'obj'z1replace() should be called on dataclass instancesr�zC is declared with init=False, it cannot be specified with replace()zInitVar z! must be specified with replace())r�rw�pop�warnings�warn�DeprecationWarningr�r9r�r�r2r r/rrCr!r,r�	__class__)rkZchangesr�r�rJrrrr�s4
�


z(obj, /, **kwargs))N)C�rer�r�r4r�r�rhr]rR�__all__r�rrrurrr5r3rrr r!r�r�rz�compiler�r%r"rrr<rrPr_rmrqrrrsr}r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr�r
r�r	r�r�r
r�rr�__text_signature__rrrr�<module>s��

:��62;R�>
�)�B<__pycache__/string.cpython-38.opt-1.pyc000064400000016206151153537610013665 0ustar00U

e5d')�@s�dZddddddddd	d
ddgZd
dlZdZdZdZeeZdZeddZdZ	dZ
eee
eZddd�Zd
dl
Zd
dlmZiZGdd�de�ZGdd�ded�ZGdd�d�ZdS)anA collection of string constants.

Public module variables:

whitespace -- a string containing all ASCII whitespace
ascii_lowercase -- a string containing all ASCII lowercase letters
ascii_uppercase -- a string containing all ASCII uppercase letters
ascii_letters -- a string containing all ASCII letters
digits -- a string containing all ASCII decimal digits
hexdigits -- a string containing all ASCII hexadecimal digits
octdigits -- a string containing all ASCII octal digits
punctuation -- a string containing all ASCII punctuation characters
printable -- a string containing all ASCII characters considered printable

�
ascii_letters�ascii_lowercase�ascii_uppercase�capwords�digits�	hexdigits�	octdigits�	printable�punctuation�
whitespace�	Formatter�Template�Nz 	

ZabcdefghijklmnopqrstuvwxyzZABCDEFGHIJKLMNOPQRSTUVWXYZ�
0123456789ZabcdefZABCDEFZ01234567z !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~cCs|pd�dd�|�|�D��S)a�capwords(s [,sep]) -> string

    Split the argument into words using split, capitalize each
    word using capitalize, and join the capitalized words using
    join.  If the optional second argument sep is absent or None,
    runs of whitespace characters are replaced by a single space
    and leading and trailing whitespace are removed, otherwise
    sep is used to split and join the words.

    � css|]}|��VqdS�N)�
capitalize)�.0�x�r�/usr/lib64/python3.8/string.py�	<genexpr>0szcapwords.<locals>.<genexpr>)�join�split)�s�seprrrr%s)�ChainMapcs eZdZdZ�fdd�Z�ZS)�_TemplateMetaclassa/
    %(delim)s(?:
      (?P<escaped>%(delim)s) |   # Escape sequence of two delimiters
      (?P<named>%(id)s)      |   # delimiter and a Python identifier
      {(?P<braced>%(bid)s)}  |   # delimiter and a braced identifier
      (?P<invalid>)              # Other ill-formed delimiter exprs
    )
    csbtt|��|||�d|kr$|j}n$tjt�|j�|j|jp@|jd�}t�	||j
tjB�|_dS)N�pattern)Zdelim�idZbid)�superr�__init__r�_re�escape�	delimiter�	idpattern�braceidpattern�compile�flags�VERBOSE)�cls�name�basesZdctr��	__class__rrr Cs

�z_TemplateMetaclass.__init__)�__name__�
__module__�__qualname__rr �
__classcell__rrr,rr9s	rc@sJeZdZdZdZdZdZejZ	dd�Z
dd�Zefd	d
�Z
efdd�ZdS)
rz.A string class for supporting $-substitutions.�$z(?a:[_a-z][_a-z0-9]*)NcCs
||_dSr)�template)�selfr3rrrr \szTemplate.__init__cCsd|�d�}|jd|�jdd�}|s.d}d}n"|td�|dd���}t|�}td||f��dS)N�invalidT)�keepends�����z.Invalid placeholder in string: line %d, col %d)�startr3�
splitlines�lenr�
ValueError)r4�mo�i�lines�colno�linenorrr�_invalidas
�zTemplate._invalidcs:�tkr|�n|rt|�����fdd�}�j�|�j�S)Ncsd|�d�p|�d�}|dk	r(t�|�S|�d�dk	r<�jS|�d�dk	rT��|�td�j��dS�N�namedZbracedZescapedr5z#Unrecognized named group in pattern)�group�strr#rCr=r�r>rE��mappingr4rr�convertss
�z$Template.substitute.<locals>.convert��_sentinel_dict�	_ChainMapr�subr3�r4rJZkwsrKrrIr�
substitutems
zTemplate.substitutecs:�tkr|�n|rt|�����fdd�}�j�|�j�S)Ncs�|�d�p|�d�}|dk	rHzt�|�WStk
rF|��YSX|�d�dk	r\�jS|�d�dk	rr|��Std�j��dSrD)rFrG�KeyErrorr#r=rrHrIrrrK�s�z)Template.safe_substitute.<locals>.convertrLrPrrIr�safe_substitute�s

zTemplate.safe_substitute)r.r/r0�__doc__r#r$r%r!�
IGNORECASEr'r rCrMrQrSrrrrrPs)�	metaclassc@sVeZdZdd�Zdd�Zddd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�ZdS)rcOs|�|||�Sr)�vformat)r4�
format_string�args�kwargsrrr�format�szFormatter.formatcCs.t�}|�||||d�\}}|�|||�|S)N�)�set�_vformat�check_unused_args)r4rXrYrZ�	used_args�result�_rrrrW�szFormatter.vformatr
c	Cs�|dkrtd��g}|�|�D]�\}}	}
}|r8|�|�|	dk	r|	dkrj|dkrXtd��t|�}	|d7}n|	��r�|r~td��d}|�|	||�\}}
|�|
�|�||�}|j|
||||d|d�\}
}|�|�	||
��qd�
|�|fS)Nr
zMax string recursion exceededr8FzJcannot switch from manual field specification to automatic field numberingr7)�auto_arg_index)r=�parse�appendrG�isdigit�	get_field�add�
convert_fieldr^�format_fieldr)r4rXrYrZr`Zrecursion_depthrcraZliteral_text�
field_name�format_spec�
conversion�objZarg_usedrrrr^�s<�


�
zFormatter._vformatcCst|t�r||S||SdSr)�
isinstance�int)r4�keyrYrZrrr�	get_value�s
zFormatter.get_valuecCsdSrr)r4r`rYrZrrrr_�szFormatter.check_unused_argscCs
t||�Sr)r[)r4�valuerlrrrrj�szFormatter.format_fieldcCsN|dkr|S|dkrt|�S|dkr,t|�S|dkr<t|�Std�|���dS)Nr�r�az"Unknown conversion specifier {0!s})rG�repr�asciir=r[)r4rsrmrrrri�szFormatter.convert_fieldcCs
t�|�Sr)�_stringZformatter_parser)r4rXrrrrdszFormatter.parsec	CsJt�|�\}}|�|||�}|D] \}}|r8t||�}q ||}q ||fSr)rxZformatter_field_name_splitrr�getattr)	r4rkrYrZ�first�restrnZis_attrr?rrrrg
s
zFormatter.get_fieldN)r
)r.r/r0r[rWr^rrr_rjrirdrgrrrrr�s�
6	)N)rT�__all__rxr
rrrrrrr	rr�rer!�collectionsrrNrM�typerrrrrrr�<module>s6�
Q__pycache__/symbol.cpython-38.opt-2.pyc000064400000004432151153537610013663 0ustar00U

��.e=�@s�dZdZdZdZdZdZdZdZdZd	Z	d
Z
dZdZd
Z
dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZd Z d!Z!d"Z"d#Z#d$Z$d%Z%d&Z&d'Z'd(Z(d)Z)d*Z*d+Z+d,Z,d-Z-d.Z.d/Z/d0Z0d1Z1d2Z2d3Z3d4Z4d5Z5d6Z6d7Z7d8Z8d9Z9d:Z:d;Z;d<Z<d=Z=d>Z>d?Z?d@Z@dAZAdBZBdCZCdDZDdEZEdFZFdGZGdHZHdIZIdJZJdKZKdLZLdMZMdNZNdOZOdPZPdQZQdRZRdSZSdTZTdUZUdVZVdWZWdXZXdYZYdZZZd[Z[iZ\e]e^��_��D]$\Z`Zaebea�ebd\�k�r�e`e\ea<�q�[`[ad]S)^�iiiiiiiii	i
iii
iiiiiiiiiiiiiiiiiii i!i"i#i$i%i&i'i(i)i*i+i,i-i.i/i0i1i2i3i4i5i6i7i8i9i:i;i<i=i>i?i@iAiBiCiDiEiFiGiHiIiJiKiLiMiNiOiPiQiRiSiTiUiViWiXiYiZi[�N)cZsingle_inputZ
file_inputZ
eval_inputZ	decoratorZ
decoratorsZ	decoratedZ
async_funcdefZfuncdefZ
parametersZ
typedargslistZtfpdefZvarargslistZvfpdefZstmtZsimple_stmtZ
small_stmtZ	expr_stmtZ	annassignZtestlist_star_exprZ	augassignZdel_stmtZ	pass_stmtZ	flow_stmtZ
break_stmtZ
continue_stmtZreturn_stmtZ
yield_stmtZ
raise_stmtZimport_stmtZimport_nameZimport_fromZimport_as_nameZdotted_as_nameZimport_as_namesZdotted_as_namesZdotted_nameZglobal_stmtZ
nonlocal_stmtZassert_stmtZ
compound_stmtZ
async_stmtZif_stmtZ
while_stmtZfor_stmtZtry_stmtZ	with_stmtZ	with_itemZ
except_clauseZsuiteZnamedexpr_testZtestZtest_nocondZlambdefZlambdef_nocondZor_testZand_testZnot_testZ
comparisonZcomp_opZ	star_expr�exprZxor_exprZand_exprZ
shift_exprZ
arith_exprZtermZfactorZpowerZ	atom_exprZatomZ
testlist_compZtrailerZ
subscriptlistZ	subscriptZsliceopZexprlistZtestlistZdictorsetmakerZclassdefZarglistZargumentZ	comp_iterZ
sync_comp_forZcomp_forZcomp_ifZ
encoding_declZ
yield_exprZ	yield_argZfunc_body_suiteZfunc_type_inputZ	func_typeZtypelistZsym_name�list�globals�items�_nameZ_value�type�r	r	�/usr/lib64/python3.8/symbol.py�<module>s�__pycache__/types.cpython-38.opt-2.pyc000064400000017425151153537610013530 0ustar00U

e5d�%�@s�ddlZdd�Zee�Zedd��Zeej�Zeej�Zeej	�Z
dd�Zee��Zdd	�Z
ee
��Zd
d�Ze�Zee�Ze��dd
�Ze�Zee�ZGdd�d�Zee�j�Zee�Zegj�Zeej�Zee�j�Zee j!�Z"ee#jd�Z$ee�Z%ze&�Wn:e&k
�r>e�'�dZ(ee(�Z)ee(j*�Z+dZ([(YnXeej�Z,eej-�Z.[[[
[[[d#dd�Z/dd�Z0d$dd�Z1dd�Z2Gdd�d�Z3Gdd�d�Z4dd �Z5d!d"�e6�D�Z7dS)%�NcCsdS�N�rrr�/usr/lib64/python3.8/types.py�_f�rcCsdSrrrrrr�<lambda>
rrcsd��fdd�}|jdS)N�csdSrrr��arr�fsz_cell_factory.<locals>.fr)�__closure__)rrr	r�
_cell_factorysr
ccs
dVdS)Nrrrrrr�_gsrc�sdSrrrrrr�_crrcCs
dVdSrrrrrr�_ag"src@seZdZdd�ZdS)�_CcCsdSrr��selfrrr�_m(rz_C._mN)�__name__�
__module__�__qualname__rrrrrr'sr�fromkeys�rcCsJt|�}t|||�\}}}|dk	r*||�||k	r:||d<||||f|�S)N�__orig_bases__)�
resolve_bases�
prepare_class)�name�bases�kwds�	exec_body�resolved_bases�meta�nsrrr�	new_classEsr$cCs�t|�}d}d}t|�D]j\}}t|t�r,qt|d�s8q|�|�}d}t|t�sZtd��q||||||d�<|t|�d7}q|s�|St|�S)NFr�__mro_entries__Tz#__mro_entries__ must return a tupler)	�list�	enumerate�
isinstance�type�hasattrr%�tuple�	TypeError�len)r�	new_bases�updated�shift�i�base�new_baserrrrOs"




rcCs~|dkri}nt|�}d|kr*|�d�}n|r<t|d�}nt}t|t�rTt||�}t|d�rp|j||f|�}ni}|||fS)N�	metaclassr�__prepare__)�dict�popr)r(�_calculate_metar*r5)rrrr"r#rrrrds


rcCs>|}|D]0}t|�}t||�r qt||�r0|}qtd��q|S)Nzxmetaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases)r)�
issubclassr,)r"r�winnerr2�	base_metarrrr8�s


r8c@sHeZdZddd�Zddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dS)�DynamicClassAttributeNcCs>||_||_||_|p|j|_|dk|_tt|dd��|_dS)N�__isabstractmethod__F)�fget�fset�fdel�__doc__�
overwrite_doc�bool�getattrr=)rr>r?r@�docrrr�__init__�s
zDynamicClassAttribute.__init__cCs6|dkr|jr|St��n|jdkr,td��|�|�S)Nzunreadable attribute)r=�AttributeErrorr>)r�instance�
ownerclassrrr�__get__�s
zDynamicClassAttribute.__get__cCs"|jdkrtd��|�||�dS)Nzcan't set attribute)r?rG)rrH�valuerrr�__set__�s
zDynamicClassAttribute.__set__cCs |jdkrtd��|�|�dS)Nzcan't delete attribute)r@rG)rrHrrr�
__delete__�s
z DynamicClassAttribute.__delete__cCs8|jr|jnd}t|�||j|j|p(|j�}|j|_|Sr)rBrAr)r?r@)rr>�fdoc�resultrrr�getter�szDynamicClassAttribute.gettercCs$t|�|j||j|j�}|j|_|Sr)r)r>r@rArB)rr?rOrrr�setter�szDynamicClassAttribute.settercCs$t|�|j|j||j�}|j|_|Sr)r)r>r?rArB)rr@rOrrr�deleter�szDynamicClassAttribute.deleter)NNNN)N)
rrrrFrJrLrMrPrQrRrrrrr<�s


	r<c@s�eZdZdd�Zdd�Zdd�Zdd�Zed	d
��Zedd��Z	ed
d��Z
edd��ZeZe	Z
e
ZeZdd�Zdd�ZeZdS)�_GeneratorWrappercCs2||_|jtk|_t|dd�|_t|dd�|_dS)Nrr)�_GeneratorWrapper__wrapped�	__class__�
GeneratorType�_GeneratorWrapper__isgenrDrr)r�genrrrrF�sz_GeneratorWrapper.__init__cCs|j�|�Sr)rT�send)r�valrrrrY�sz_GeneratorWrapper.sendcGs|jj|f|��Sr)rT�throw)r�tp�restrrrr[�sz_GeneratorWrapper.throwcCs
|j��Sr)rT�closerrrrr^�sz_GeneratorWrapper.closecCs|jjSr)rT�gi_coderrrrr_�sz_GeneratorWrapper.gi_codecCs|jjSr)rT�gi_framerrrrr`�sz_GeneratorWrapper.gi_framecCs|jjSr)rT�
gi_runningrrrrra�sz_GeneratorWrapper.gi_runningcCs|jjSr)rT�gi_yieldfromrrrrrb�sz_GeneratorWrapper.gi_yieldfromcCs
t|j�Sr)�nextrTrrrr�__next__�sz_GeneratorWrapper.__next__cCs|jr|jS|Sr)rWrTrrrr�__iter__�sz_GeneratorWrapper.__iter__N)rrrrFrYr[r^�propertyr_r`rarb�cr_code�cr_frame�
cr_running�cr_awaitrdre�	__await__rrrrrS�s&



rScs�t��std���jtkrft�dd�jtkrf�jj}|d@r@�S|d@rf�j}|j|jdBd��_�Sddl	}ddl
�|�����fdd	��}|S)
Nz$types.coroutine() expects a callable�__code__i�� �)�co_flagsrcsR�||�}|jtks*|jtkr.|jjd@r.|St|�j�rNt|�j�sNt|�S|S)Nrn)	rU�
CoroutineTyperVr_ror(�	Generator�	CoroutinerS)�args�kwargs�coro��_collections_abc�funcrr�wrappeds

�
�
�zcoroutine.<locals>.wrapped)�callabler,rU�FunctionTyperD�CodeTyperlro�replace�	functoolsrw�wraps)rxro�cor~ryrrvr�	coroutine�s"
�r�cCs g|]}|dd�dkr|�qS)Nr�_r)�.0�nrrr�
<listcomp>(sr�)rNN)rN)8�sysrr)r{�
LambdaTyperlr|�__dict__�MappingProxyType�implementation�SimpleNamespacer
�CellTyperrVrrpr^r�AsyncGeneratorTyperr�
MethodTyper-�BuiltinFunctionType�append�BuiltinMethodType�objectrF�WrapperDescriptorType�__str__�MethodWrapperType�str�join�MethodDescriptorTyper6�ClassMethodDescriptorType�
ModuleTyper,�exc_info�tb�
TracebackType�tb_frame�	FrameType�GetSetDescriptorType�__globals__�MemberDescriptorTyper$rrr8r<rSr��globals�__all__rrrr�<module>sZ













 :%4__pycache__/bdb.cpython-38.opt-1.pyc000064400000060533151153537610013110 0ustar00U

e5d8}�@s�dZddlZddlZddlZddlmZmZmZdddgZeeBeBZ	Gdd�de
�ZGdd�d�Zd	d
�Z
Gdd�d�Zdd
�Zdd�ZGdd�de�Zdd�Zdd�Zdd�ZdS)zDebugger basics�N)�CO_GENERATOR�CO_COROUTINE�CO_ASYNC_GENERATOR�BdbQuit�Bdb�
Breakpointc@seZdZdZdS)rz Exception to give up completely.N)�__name__�
__module__�__qualname__�__doc__�rr�/usr/lib64/python3.8/bdb.pyr
sc@sveZdZdZd[dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd\d&d'�Zd]d(d)�Zd*d+�Zd,d-�Zd.d/�Zd^d0d1�Zd2d3�Zd4d5�Zd_d7d8�Zd9d:�Zd;d<�Zd=d>�Z d?d@�Z!dAdB�Z"dCdD�Z#dEdF�Z$dGdH�Z%dIdJ�Z&dKdL�Z'dMdN�Z(d`dPdQ�Z)dadRdS�Z*dbdTdU�Z+dVdW�Z,dXdY�Z-dZe-_.dS)craGeneric Python debugger base class.

    This class takes care of details of the trace facility;
    a derived class should implement user interaction.
    The standard debugger class (pdb.Pdb) is an example.

    The optional skip argument must be an iterable of glob-style
    module name patterns.  The debugger will not step into frames
    that originate in a module that matches one of these patterns.
    Whether a frame is considered to originate in a certain module
    is determined by the __name__ in the frame globals.
    NcCs(|rt|�nd|_i|_i|_d|_dS)N)�set�skip�breaks�fncache�frame_returning)�selfrrrr
�__init__szBdb.__init__cCsR|d|dd�dkr|S|j�|�}|sNtj�|�}tj�|�}||j|<|S)a%Return canonical form of filename.

        For real filenames, the canonical form is a case-normalized (on
        case insensitive filesystems) absolute path.  'Filenames' with
        angle brackets, such as "<stdin>", generated in interactive
        mode, are returned unchanged.
        �<�����>)r�get�os�path�abspath�normcase)r�filename�canonicrrr
r%s
zBdb.canoniccCs&ddl}|��d|_|�dd�dS)z5Set values of attributes as ready to start debugging.rN)�	linecache�
checkcache�botframe�
_set_stopinfo)rr rrr
�reset6sz	Bdb.resetcCs�|jr
dS|dkr|�|�S|dkr0|�||�S|dkrD|�||�S|dkrX|�||�S|dkrf|jS|dkrt|jS|dkr�|jStd	t|��|jS)
aODispatch a trace function for debugged frames based on the event.

        This function is installed as the trace function for debugged
        frames. Its return value is the new trace function, which is
        usually itself. The default implementation decides how to
        dispatch a frame, depending on the type of event (passed in as a
        string) that is about to be executed.

        The event can be one of the following:
            line: A new line of code is going to be executed.
            call: A function is about to be called or another code block
                  is entered.
            return: A function or other code block is about to return.
            exception: An exception has occurred.
            c_call: A C function is about to be called.
            c_return: A C function has returned.
            c_exception: A C function has raised an exception.

        For the Python events, specialized functions (see the dispatch_*()
        methods) are called.  For the C events, no action is taken.

        The arg parameter depends on the previous event.
        N�lineZcall�returnZ	exceptionZc_callZc_exceptionZc_returnz*bdb.Bdb.dispatch: unknown debugging event:)�quitting�
dispatch_line�
dispatch_call�dispatch_return�dispatch_exception�trace_dispatch�print�repr)r�frameZevent�argrrr
r,=s$
zBdb.trace_dispatchcCs.|�|�s|�|�r(|�|�|jr(t�|jS)a	Invoke user function and return trace function for line event.

        If the debugger stops on the current line, invoke
        self.user_line(). Raise BdbQuit if self.quitting is set.
        Return self.trace_dispatch to continue tracing in this scope.
        )�	stop_here�
break_here�	user_liner'rr,�rr/rrr
r(hs

zBdb.dispatch_linecCsd|jdkr|j|_|jS|�|�s0|�|�s0dS|jrH|jjt@rH|jS|�	||�|j
r^t�|jS)aInvoke user function and return trace function for call event.

        If the debugger stops on this function call, invoke
        self.user_call(). Raise BbdQuit if self.quitting is set.
        Return self.trace_dispatch to continue tracing in this scope.
        N)r"�f_backr,r1�break_anywhere�	stopframe�f_code�co_flags�GENERATOR_AND_COROUTINE_FLAGS�	user_callr'r�rr/r0rrr
r)ts
zBdb.dispatch_callcCs||�|�s||jkrv|jr,|jjt@r,|jSz||_|�||�W5d|_X|j	rVt
�|j|krv|jdkrv|�dd�|jS)aInvoke user function and return trace function for return event.

        If the debugger stops on this function return, invoke
        self.user_return(). Raise BdbQuit if self.quitting is set.
        Return self.trace_dispatch to continue tracing in this scope.
        Nr)
r1�returnframer7r8r9r:r,r�user_returnr'r�
stoplinenor#r<rrr
r*�szBdb.dispatch_returncCs�|�|�rF|jjt@r.|dtkr.|ddks�|�||�|jr�t�nD|jr�||jk	r�|jjjt@r�|dtt	fkr�|�||�|jr�t�|j
S)aInvoke user function and return trace function for exception event.

        If the debugger stops on this exception, invoke
        self.user_exception(). Raise BdbQuit if self.quitting is set.
        Return self.trace_dispatch to continue tracing in this scope.
        r�N)r1r8r9r:�
StopIteration�user_exceptionr'rr7�
GeneratorExitr,r<rrr
r+�s$

�
���zBdb.dispatch_exceptioncCs.|dkrdS|jD]}t�||�rdSqdS)z4Return True if module_name matches any skip pattern.NFT)r�fnmatch)rZmodule_name�patternrrr
�is_skipped_module�s
zBdb.is_skipped_modulecCsN|jr|�|j�d��rdS||jkr@|jdkr4dS|j|jkS|jsJdSdS)z>Return True if frame is below the starting frame in the stack.rFrT)rrF�	f_globalsrr7r?�f_linenor4rrr
r1�s�

z
Bdb.stop_herecCs�|�|jj�}||jkrdS|j}||j|krJ|jj}||j|krJdSt|||�\}}|r�|j|_|r�|j	r�|�
t|j��dSdSdS)z�Return True if there is an effective breakpoint for this line.

        Check for line or function breakpoint and if in effect.
        Delete temporary breakpoints if effective() says to.
        FTN)rr8�co_filenamerrH�co_firstlineno�	effective�numberZ	currentbp�	temporary�do_clear�str)rr/r�lineno�bp�flagrrr
r2�s

zBdb.break_herecCstd��dS)zlRemove temporary breakpoint.

        Must implement in derived classes or get NotImplementedError.
        z)subclass of bdb must implement do_clear()N)�NotImplementedError)rr0rrr
rN�szBdb.do_clearcCs|�|jj�|jkS)zEReturn True if there is any breakpoint for frame's filename.
        )rr8rIrr4rrr
r6�szBdb.break_anywherecCsdS)z&Called if we might stop in a function.Nr)rr/Z
argument_listrrr
r;sz
Bdb.user_callcCsdS)z'Called when we stop or break at a line.Nrr4rrr
r3sz
Bdb.user_linecCsdS)z&Called when a return trap is set here.Nr)rr/Zreturn_valuerrr
r>	szBdb.user_returncCsdS)z$Called when we stop on an exception.Nr)rr/�exc_inforrr
rB
szBdb.user_exceptionrcCs||_||_d|_||_dS)z�Set the attributes for stopping.

        If stoplineno is greater than or equal to 0, then stop at line
        greater than or equal to the stopline.  If stoplineno is -1, then
        don't stop at all.
        FN)r7r=r'r?)rr7r=r?rrr
r#szBdb._set_stopinfocCs$|dkr|jd}|�|||�dS)zxStop when the line with the lineno greater than the current one is
        reached or when returning from current frame.Nr)rHr#)rr/rPrrr
�	set_until"s
z
Bdb.set_untilcCs0|jr |jj}|r |js |j|_|�dd�dS)zStop after one line of code.N)rr5�f_tracer,r#)rZcaller_framerrr
�set_step*s

zBdb.set_stepcCs|�|d�dS)z2Stop on the next line in or below the given frame.N)r#r4rrr
�set_next6szBdb.set_nextcCs.|jjt@r|�|dd�n|�|j|�dS)z)Stop when returning from the given frame.Nr)r8r9r:r#r5r4rrr
�
set_return:szBdb.set_returncCsL|dkrt��j}|��|r4|j|_||_|j}q|��t�|j�dS)znStart debugging from frame.

        If frame is not specified, debugging starts from caller's frame.
        N)	�sys�	_getframer5r$r,rVr"rW�settracer4rrr
�	set_traceAs
z
Bdb.set_tracecCsH|�|jdd�|jsDt�d�t��j}|rD||jk	rD|`|j}q*dS)z�Stop only at breakpoints or when finished.

        If there are no breakpoints, set the system trace function to None.
        Nr)r#r"rrZr\r[r5rVr4rrr
�set_continuePs

zBdb.set_continuecCs"|j|_d|_d|_t�d�dS)zuSet quitting attribute to True.

        Raises BdbQuit exception in the next call to a dispatch_*() method.
        NT)r"r7r=r'rZr\�rrrr
�set_quit_szBdb.set_quitFc
Csb|�|�}ddl}|�||�}|s.d||fS|j�|g�}||krN|�|�t|||||�}	dS)z�Set a new breakpoint for filename:lineno.

        If lineno doesn't exist for the filename, return an error message.
        The filename should be in canonical form.
        rNzLine %s:%d does not exist)rr �getliner�
setdefault�appendr)
rrrPrM�cond�funcnamer r%�listrQrrr
�	set_breakps

z
Bdb.set_breakcCs4||ftjkr|j|�|�|j|s0|j|=dS)aPrune breakpoints for filename:lineno.

        A list of breakpoints is maintained in the Bdb instance and in
        the Breakpoint class.  If a breakpoint in the Bdb instance no
        longer exists in the Breakpoint class, then it's removed from the
        Bdb instance.
        N)r�bplistr�remove�rrrPrrr
�
_prune_breaks�s
zBdb._prune_breakscCsj|�|�}||jkrd|S||j|kr6d||fStj||fdd�D]}|��qL|�||�dS)znDelete breakpoints for filename:lineno.

        If no breakpoints were set, return an error message.
        �There are no breakpoints in %szThere is no breakpoint at %s:%dN)rrrrh�deleteMerk)rrrPrQrrr
�clear_break�s


zBdb.clear_breakc
CsZz|�|�}Wn.tk
r<}zt|�WY�Sd}~XYnX|��|�|j|j�dS)zxDelete a breakpoint by its index in Breakpoint.bpbynumber.

        If arg is invalid, return an error message.
        N)�get_bpbynumber�
ValueErrorrOrmrk�filer%)rr0rQ�errrrr
�clear_bpbynumber�szBdb.clear_bpbynumbercCsX|�|�}||jkrd|S|j|D]$}tj||f}|D]}|��q<q&|j|=dS)z`Delete all breakpoints in filename.

        If none were set, return an error message.
        rlN)rrrrhrm)rrr%ZblistrQrrr
�clear_all_file_breaks�s

zBdb.clear_all_file_breakscCs,|js
dStjD]}|r|��qi|_dS)z]Delete all existing breakpoints.

        If none were set, return an error message.
        zThere are no breakpointsN)rr�
bpbynumberrm)rrQrrr
�clear_all_breaks�s

zBdb.clear_all_breakscCs�|std��zt|�}Wn"tk
r:td|�d�YnXztj|}Wn"tk
rltd|�d�YnX|dkr�td|��|S)z�Return a breakpoint by its index in Breakpoint.bybpnumber.

        For invalid arg values or if the breakpoint doesn't exist,
        raise a ValueError.
        zBreakpoint number expectedz Non-numeric breakpoint number %sNz!Breakpoint number %d out of rangezBreakpoint %d already deleted)rp�intrru�
IndexError)rr0rLrQrrr
ro�szBdb.get_bpbynumbercCs"|�|�}||jko ||j|kS)z9Return True if there is a breakpoint for filename:lineno.�rrrjrrr
�	get_break�s

�z
Bdb.get_breakcCs4|�|�}||jkr0||j|kr0tj||fp2gS)znReturn all breakpoints for filename:lineno.

        If no breakpoints are set, return an empty list.
        )rrrrhrjrrr
�
get_breaks�s

���zBdb.get_breakscCs&|�|�}||jkr|j|SgSdS)zrReturn all lines with breakpoints for filename.

        If no breakpoints are set, return an empty list.
        Nry)rrrrr
�get_file_breaks�s


zBdb.get_file_breakscCs|jS)z$Return all breakpoints that are set.)rr_rrr
�get_all_breaks�szBdb.get_all_breakscCs�g}|r|j|kr|j}|dk	rD|�||jf�||jkr<qD|j}q|��tdt|�d�}|dk	r�|�|j|j	f�|j}q^|dkr�tdt|�d�}||fS)z�Return a list of (frame, lineno) in a stack trace and a size.

        List starts with original calling frame, if there is one.
        Size may be number of frames above or below f.
        Nrr)
�tb_frame�tb_nextrcrHr"r5�reverse�max�len�	tb_lineno)r�f�t�stack�irrr
�	get_stack�s 
z
Bdb.get_stack�: cCs�ddl}ddl}|\}}|�|jj�}d||f}|jjrH||jj7}n|d7}|d7}d|jkr�|jd}	|d7}||�|	�7}|�|||j	�}
|
r�|||
�
�7}|S)a:Return a string with information about a stack entry.

        The stack entry frame_lineno is a (frame, lineno) tuple.  The
        return string contains the canonical filename, the function name
        or '<lambda>', the input arguments, the return value, and the
        line of code (if it exists).

        rNz%s(%r)z<lambda>z()Z
__return__z->)r �reprlibrr8rI�co_name�f_localsr.rarG�strip)rZframe_linenoZlprefixr r�r/rPr�s�rvr%rrr
�format_stack_entrys 	

zBdb.format_stack_entryc	Cs�|dkrddl}|j}|dkr"|}|��t|t�r@t|dd�}t�|j�z*zt
|||�Wntk
rrYnXW5d|_	t�d�XdS)z�Debug a statement executed via the exec() function.

        globals defaults to __main__.dict; locals defaults to globals.
        Nrz<string>�execT)�__main__�__dict__r$�
isinstancerO�compilerZr\r,r'r�r)r�cmd�globals�localsr�rrr
�run5s

zBdb.runc	Csz|dkrddl}|j}|dkr"|}|��t�|j�z,zt|||�WW�Stk
r^YnXW5d|_t�d�XdS)z�Debug an expression executed via the eval() function.

        globals defaults to __main__.dict; locals defaults to globals.
        NrT)	r�r�r$rZr\r,r'�evalr)r�exprr�r�r�rrr
�runevalKs
zBdb.runevalcCs|�|||�dS)z.For backwards-compatibility.  Defers to run().N)r�)rr�r�r�rrr
�runctx_sz
Bdb.runctxc	Os�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d	��|��t�|j	�d}z(z|||�}Wntk
r�YnXW5d
|_
t�d�X|S)zWDebug a single function call.

        Return the result of the function call.
        r@z6descriptor 'runcall' of 'Bdb' object needs an argument�funcrNz0Passing 'func' as keyword argument is deprecated)�
stacklevelz7runcall expected at least 1 positional argument, got %drT)r��	TypeError�pop�warnings�warn�DeprecationWarningr$rZr\r,r'r)�args�kwdsrr�r��resrrr
�runcallfs2

�
�
zBdb.runcallz($self, func, /, *args, **kwds))N)r)N)N)FNN)r�)NN)NN)/rr	r
rrrr$r,r(r)r*r+rFr1r2rNr6r;r3r>rBr#rUrWrXrYr]r^r`rgrkrnrsrtrvrorzr{r|r}r�r�r�r�r�r��__text_signature__rrrr
rs\
+	


�







cCst���dS)z<Start debugging with a Bdb instance from the caller's frame.N)rr]rrrr
r]�sr]c@sZeZdZdZdZiZdgZddd�Zdd�Zd	d
�Z	dd�Z
dd
d�Zdd�Zdd�Z
dS)ra�Breakpoint class.

    Implements temporary breakpoints, ignore counts, disabling and
    (re)-enabling, and conditionals.

    Breakpoints are indexed by number through bpbynumber and by
    the (file, line) tuple using bplist.  The former points to a
    single instance of class Breakpoint.  The latter points to a
    list of such instances since there may be more than one
    breakpoint per line.

    When creating a breakpoint, its associated filename should be
    in canonical form.  If funcname is defined, a breakpoint hit will be
    counted when the first line of that function is executed.  A
    conditional breakpoint always counts a hit.
    rNFcCs�||_d|_||_||_||_||_d|_d|_d|_t	j
|_t	j
d7_
|j�
|�||f|jkr||j||f�
|�n|g|j||f<dS)NTrr)re�func_first_executable_linerqr%rMrd�enabled�ignore�hitsr�nextrLrurcrh)rrqr%rMrdrerrr
r�szBreakpoint.__init__cCs>|j|jf}d|j|j<|j|�|�|j|s:|j|=dS)z�Delete the breakpoint from the list associated to a file:line.

        If it is the last breakpoint in that position, it also deletes
        the entry for the file:line.
        N)rqr%rurLrhri)r�indexrrr
rm�s

zBreakpoint.deleteMecCs
d|_dS)zMark the breakpoint as enabled.TN�r�r_rrr
�enable�szBreakpoint.enablecCs
d|_dS)z Mark the breakpoint as disabled.FNr�r_rrr
�disable�szBreakpoint.disablecCs"|dkrtj}t|��|d�dS)z�Print the output of bpformat().

        The optional out argument directs where the output is sent
        and defaults to standard output.
        N)rq)rZ�stdoutr-�bpformat)r�outrrr
�bpprint�szBreakpoint.bpprintcCs�|jrd}nd}|jr |d}n|d}d|j||j|jf}|jrT|d|jf7}|jrj|d|jf7}|jr�|jdkr�d	}nd
}|d|j|f7}|S)z�Return a string with information about the breakpoint.

        The information includes the breakpoint number, temporary
        status, file:line position, break condition, number of times to
        ignore, and number of times hit.

        zdel  zkeep zyes  zno   z%-4dbreakpoint   %s at %s:%dz
	stop only if %sz
	ignore next %d hitsrr��z"
	breakpoint already hit %d time%s)rMr�rLrqr%rdr�r�)rZdispZretZssrrr
r��s(
�
zBreakpoint.bpformatcCsd|j|j|jfS)z1Return a condensed description of the breakpoint.zbreakpoint %s at %s:%s)rLrqr%r_rrr
�__str__�szBreakpoint.__str__)FNN)N)rr	r
rr�rhrurrmr�r�r�r�r�rrrr
r�s


cCsN|js|j|jkrdSdS|jj|jkr,dS|js:|j|_|j|jkrJdSdS)aVReturn True if break should happen here.

    Whether a break should happen depends on the way that b (the breakpoint)
    was set.  If it was set via line number, check if b.line is the same as
    the one in the frame.  If it was set via function name, check if this is
    the right function and if it is on the first executable line.
    FT)rer%rHr8r�r�)�br/rrr
�
checkfuncnamesr�cCs�tj||f}|D]�}|jsqt||�s*q|jd7_|jsh|jdkrZ|jd8_qq�|dfSqzBt|j|j|j	�}|r�|jdkr�|jd8_n|dfWSWq|dfYSXqdS)aEDetermine which breakpoint for this file:line is to be acted upon.

    Called only if we know there is a breakpoint at this location.  Return
    the breakpoint that was triggered and a boolean that indicates if it is
    ok to delete a temporary breakpoint.  Return (None, None) if there is no
    matching breakpoint.
    rrTF)NN)
rrhr�r�r�rdr�r�rGr�)rqr%r/Z	possiblesr��valrrr
rK#s*


rKc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�TdbcCs |jj}|sd}td||�dS)N�???z+++ call)r8r�r-)rr/r��namerrr
r;Tsz
Tdb.user_callcCsTddl}|jj}|sd}|�|jj�}|�||j|j�}td||j|d|�	��dS)Nrr�z+++�:)
r r8r�rrIrarHrGr-r�)rr/r r��fnr%rrr
r3Xsz
Tdb.user_linecCstd|�dS)Nz
+++ return�r-)rr/Zretvalrrr
r>_szTdb.user_returncCstd|�|��dS)Nz
+++ exception)r-r^)rr/Z	exc_stuffrrr
rBas
zTdb.user_exceptionN)rr	r
r;r3r>rBrrrr
r�Ssr�cCs&td|d�t|d�}td|�dS)Nzfoo(�)�
zbar returned)r-�bar)�n�xrrr
�fooesr�cCstd|d�|dS)Nzbar(r�r@r�)�arrr
r�jsr�cCst�}|�d�dS)Nzimport bdb; bdb.foo(10))r�r�)r�rrr
�testnsr�)rrDrZr�inspectrrr�__all__r:�	Exceptionrrr]rr�rKr�r�r�r�rrrr
�<module>s(
{t"0__pycache__/difflib.cpython-38.opt-1.pyc000064400000164012151153537610013755 0ustar00U

e5dZH�@s8dZddddddddd	d
ddgZd
dlmZd
dlmZedd�Zdd�Z	Gdd�d�Z
d8dd�Zdd�ZGdd�d�Z
d
dlZe�d�jfdd�Zd9dd�Zdd �Zd:d#d	�Zd$d%�Zd;d&d�Zd'd(�Zd<d+d
�Zdefd,d�Zddefd-d.�Zd/Zd0Zd1Zd2ZGd3d�de�Z [d4d�Z!d5d6�Z"e#d7k�r4e"�dS)=ae
Module difflib -- helpers for computing deltas between objects.

Function get_close_matches(word, possibilities, n=3, cutoff=0.6):
    Use SequenceMatcher to return list of the best "good enough" matches.

Function context_diff(a, b):
    For two lists of strings, return a delta in context diff format.

Function ndiff(a, b):
    Return a delta: the difference between `a` and `b` (lists of strings).

Function restore(delta, which):
    Return one of the two sequences that generated an ndiff delta.

Function unified_diff(a, b):
    For two lists of strings, return a delta in unified diff format.

Class SequenceMatcher:
    A flexible class for comparing pairs of sequences of any type.

Class Differ:
    For producing human-readable deltas from sequences of lines of text.

Class HtmlDiff:
    For producing HTML side by side comparison with change highlights.
�get_close_matches�ndiff�restore�SequenceMatcher�Differ�IS_CHARACTER_JUNK�IS_LINE_JUNK�context_diff�unified_diff�
diff_bytes�HtmlDiff�Match�)�nlargest)�
namedtupleza b sizecCs|rd||SdS)Ng@��?�)�matches�lengthrr�/usr/lib64/python3.8/difflib.py�_calculate_ratio&src@steZdZdZddd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zddd�Zdd�Z
dd�Zdd�ZdS) ra�
    SequenceMatcher is a flexible class for comparing pairs of sequences of
    any type, so long as the sequence elements are hashable.  The basic
    algorithm predates, and is a little fancier than, an algorithm
    published in the late 1980's by Ratcliff and Obershelp under the
    hyperbolic name "gestalt pattern matching".  The basic idea is to find
    the longest contiguous matching subsequence that contains no "junk"
    elements (R-O doesn't address junk).  The same idea is then applied
    recursively to the pieces of the sequences to the left and to the right
    of the matching subsequence.  This does not yield minimal edit
    sequences, but does tend to yield matches that "look right" to people.

    SequenceMatcher tries to compute a "human-friendly diff" between two
    sequences.  Unlike e.g. UNIX(tm) diff, the fundamental notion is the
    longest *contiguous* & junk-free matching subsequence.  That's what
    catches peoples' eyes.  The Windows(tm) windiff has another interesting
    notion, pairing up elements that appear uniquely in each sequence.
    That, and the method here, appear to yield more intuitive difference
    reports than does diff.  This method appears to be the least vulnerable
    to synching up on blocks of "junk lines", though (like blank lines in
    ordinary text files, or maybe "<P>" lines in HTML files).  That may be
    because this is the only method of the 3 that has a *concept* of
    "junk" <wink>.

    Example, comparing two strings, and considering blanks to be "junk":

    >>> s = SequenceMatcher(lambda x: x == " ",
    ...                     "private Thread currentThread;",
    ...                     "private volatile Thread currentThread;")
    >>>

    .ratio() returns a float in [0, 1], measuring the "similarity" of the
    sequences.  As a rule of thumb, a .ratio() value over 0.6 means the
    sequences are close matches:

    >>> print(round(s.ratio(), 3))
    0.866
    >>>

    If you're only interested in where the sequences match,
    .get_matching_blocks() is handy:

    >>> for block in s.get_matching_blocks():
    ...     print("a[%d] and b[%d] match for %d elements" % block)
    a[0] and b[0] match for 8 elements
    a[8] and b[17] match for 21 elements
    a[29] and b[38] match for 0 elements

    Note that the last tuple returned by .get_matching_blocks() is always a
    dummy, (len(a), len(b), 0), and this is the only case in which the last
    tuple element (number of elements matched) is 0.

    If you want to know how to change the first sequence into the second,
    use .get_opcodes():

    >>> for opcode in s.get_opcodes():
    ...     print("%6s a[%d:%d] b[%d:%d]" % opcode)
     equal a[0:8] b[0:8]
    insert a[8:8] b[8:17]
     equal a[8:29] b[17:38]

    See the Differ class for a fancy human-friendly file differencer, which
    uses SequenceMatcher both to compare sequences of lines, and to compare
    sequences of characters within similar (near-matching) lines.

    See also function get_close_matches() in this module, which shows how
    simple code building on SequenceMatcher can be used to do useful work.

    Timing:  Basic R-O is cubic time worst case and quadratic time expected
    case.  SequenceMatcher is quadratic time for the worst case and has
    expected-case behavior dependent in a complicated way on how many
    elements the sequences have in common; best case time is linear.

    Methods:

    __init__(isjunk=None, a='', b='')
        Construct a SequenceMatcher.

    set_seqs(a, b)
        Set the two sequences to be compared.

    set_seq1(a)
        Set the first sequence to be compared.

    set_seq2(b)
        Set the second sequence to be compared.

    find_longest_match(alo, ahi, blo, bhi)
        Find longest matching block in a[alo:ahi] and b[blo:bhi].

    get_matching_blocks()
        Return list of triples describing matching subsequences.

    get_opcodes()
        Return list of 5-tuples describing how to turn a into b.

    ratio()
        Return a measure of the sequences' similarity (float in [0,1]).

    quick_ratio()
        Return an upper bound on .ratio() relatively quickly.

    real_quick_ratio()
        Return an upper bound on ratio() very quickly.
    N�TcCs(||_d|_|_||_|�||�dS)a!Construct a SequenceMatcher.

        Optional arg isjunk is None (the default), or a one-argument
        function that takes a sequence element and returns true iff the
        element is junk.  None is equivalent to passing "lambda x: 0", i.e.
        no elements are considered to be junk.  For example, pass
            lambda x: x in " \t"
        if you're comparing lines as sequences of characters, and don't
        want to synch up on blanks or hard tabs.

        Optional arg a is the first of two sequences to be compared.  By
        default, an empty string.  The elements of a must be hashable.  See
        also .set_seqs() and .set_seq1().

        Optional arg b is the second of two sequences to be compared.  By
        default, an empty string.  The elements of b must be hashable. See
        also .set_seqs() and .set_seq2().

        Optional arg autojunk should be set to False to disable the
        "automatic junk heuristic" that treats popular elements as junk
        (see module documentation for more information).
        N)�isjunk�a�b�autojunk�set_seqs)�selfrrrrrrr�__init__�s;zSequenceMatcher.__init__cCs|�|�|�|�dS)z�Set the two sequences to be compared.

        >>> s = SequenceMatcher()
        >>> s.set_seqs("abcd", "bcde")
        >>> s.ratio()
        0.75
        N)�set_seq1�set_seq2)rrrrrrr�s	
zSequenceMatcher.set_seqscCs$||jkrdS||_d|_|_dS)aMSet the first sequence to be compared.

        The second sequence to be compared is not changed.

        >>> s = SequenceMatcher(None, "abcd", "bcde")
        >>> s.ratio()
        0.75
        >>> s.set_seq1("bcde")
        >>> s.ratio()
        1.0
        >>>

        SequenceMatcher computes and caches detailed information about the
        second sequence, so if you want to compare one sequence S against
        many sequences, use .set_seq2(S) once and call .set_seq1(x)
        repeatedly for each of the other sequences.

        See also set_seqs() and set_seq2().
        N)r�matching_blocks�opcodes)rrrrrr�s
zSequenceMatcher.set_seq1cCs2||jkrdS||_d|_|_d|_|��dS)aMSet the second sequence to be compared.

        The first sequence to be compared is not changed.

        >>> s = SequenceMatcher(None, "abcd", "bcde")
        >>> s.ratio()
        0.75
        >>> s.set_seq2("abcd")
        >>> s.ratio()
        1.0
        >>>

        SequenceMatcher computes and caches detailed information about the
        second sequence, so if you want to compare one sequence S against
        many sequences, use .set_seq2(S) once and call .set_seq1(x)
        repeatedly for each of the other sequences.

        See also set_seqs() and set_seq1().
        N)rr r!�
fullbcount�_SequenceMatcher__chain_b)rrrrrr�s
zSequenceMatcher.set_seq2cCs�|j}i|_}t|�D]\}}|�|g�}|�|�qt�|_}|j}|r~|��D]}||�rV|�	|�qV|D]
}||=qrt�|_
}t|�}	|jr�|	dkr�|	dd}
|�
�D]\}}t|�|
kr�|�	|�q�|D]
}||=q�dS)N���d�)r�b2j�	enumerate�
setdefault�append�set�bjunkr�keys�addZbpopular�lenr�items)rrr'�i�elt�indicesZjunkrZpopular�nZntestZidxsrrrZ	__chain_b)s,
zSequenceMatcher.__chain_bcCs4|j|j|j|jjf\}}}}||d}	}
}i}g}
t||�D]�}|j}i}|�|||
�D]\}||krlq^||krxq�||dd�d}||<||kr^||d||d|}	}
}q^|}q@|	|k�r |
|k�r |||
d��s ||	d||
dk�r |	d|
d|d}	}
}q�|	||k�rt|
||k�rt|||
|��st||	|||
|k�rt|d7}�q |	|k�r�|
|k�r�|||
d��r�||	d||
dk�r�|	d|
d|d}	}
}�qt|	||k�r(|
||k�r(|||
|��r(||	|||
|k�r(|d}�q�t|	|
|�S)a�Find longest matching block in a[alo:ahi] and b[blo:bhi].

        If isjunk is not defined:

        Return (i,j,k) such that a[i:i+k] is equal to b[j:j+k], where
            alo <= i <= i+k <= ahi
            blo <= j <= j+k <= bhi
        and for all (i',j',k') meeting those conditions,
            k >= k'
            i <= i'
            and if i == i', j <= j'

        In other words, of all maximal matching blocks, return one that
        starts earliest in a, and of all those maximal matching blocks that
        start earliest in a, return the one that starts earliest in b.

        >>> s = SequenceMatcher(None, " abcd", "abcd abcd")
        >>> s.find_longest_match(0, 5, 0, 9)
        Match(a=0, b=4, size=5)

        If isjunk is defined, first the longest matching block is
        determined as above, but with the additional restriction that no
        junk element appears in the block.  Then that block is extended as
        far as possible by matching (only) junk elements on both sides.  So
        the resulting block never matches on junk except as identical junk
        happens to be adjacent to an "interesting" match.

        Here's the same example as before, but considering blanks to be
        junk.  That prevents " abcd" from matching the " abcd" at the tail
        end of the second sequence directly.  Instead only the "abcd" can
        match, and matches the leftmost "abcd" in the second sequence:

        >>> s = SequenceMatcher(lambda x: x==" ", " abcd", "abcd abcd")
        >>> s.find_longest_match(0, 5, 0, 9)
        Match(a=1, b=0, size=4)

        If no blocks match, return (alo, blo, 0).

        >>> s = SequenceMatcher(None, "ab", "c")
        >>> s.find_longest_match(0, 2, 0, 1)
        Match(a=0, b=0, size=0)
        r
r&)rrr'r,�__contains__�range�getr)r�alo�ahi�blo�bhirrr'ZisbjunkZbestiZbestjZbestsizeZj2lenZnothingr1Zj2lengetZnewj2len�j�krrr�find_longest_matchPsR8"����	�� ��z"SequenceMatcher.find_longest_matchcCs||jdk	r|jSt|j�t|j�}}d|d|fg}g}|r�|��\}}}}|�||||�\}	}
}}|r8|�|�||	kr�||
kr�|�||	||
f�|	||kr8|
||kr8|�|	|||
||f�q8|��d}
}}g}|D]V\}}}|
||k�r|||k�r||7}q�|�r,|�|
||f�|||}
}}q�|�rT|�|
||f�|�||df�tt	t
j|��|_|jS)aReturn list of triples describing matching subsequences.

        Each triple is of the form (i, j, n), and means that
        a[i:i+n] == b[j:j+n].  The triples are monotonically increasing in
        i and in j.  New in Python 2.5, it's also guaranteed that if
        (i, j, n) and (i', j', n') are adjacent triples in the list, and
        the second is not the last triple in the list, then i+n != i' or
        j+n != j'.  IOW, adjacent triples never describe adjacent equal
        blocks.

        The last triple is a dummy, (len(a), len(b), 0), and is the only
        triple with n==0.

        >>> s = SequenceMatcher(None, "abxcd", "abcd")
        >>> list(s.get_matching_blocks())
        [Match(a=0, b=0, size=2), Match(a=3, b=2, size=2), Match(a=5, b=4, size=0)]
        Nr
)r r/rr�popr>r*�sort�list�mapr�_make)r�la�lbZqueuer r8r9r:r;r1r<r=�x�i1�j1Zk1Znon_adjacent�i2�j2Zk2rrr�get_matching_blocks�s8


z#SequenceMatcher.get_matching_blockscCs�|jdk	r|jSd}}g|_}|��D]�\}}}d}||krN||krNd}n||kr\d}n||krhd}|r�|�|||||f�||||}}|r*|�d||||f�q*|S)a[Return list of 5-tuples describing how to turn a into b.

        Each tuple is of the form (tag, i1, i2, j1, j2).  The first tuple
        has i1 == j1 == 0, and remaining tuples have i1 == the i2 from the
        tuple preceding it, and likewise for j1 == the previous j2.

        The tags are strings, with these meanings:

        'replace':  a[i1:i2] should be replaced by b[j1:j2]
        'delete':   a[i1:i2] should be deleted.
                    Note that j1==j2 in this case.
        'insert':   b[j1:j2] should be inserted at a[i1:i1].
                    Note that i1==i2 in this case.
        'equal':    a[i1:i2] == b[j1:j2]

        >>> a = "qabxcd"
        >>> b = "abycdf"
        >>> s = SequenceMatcher(None, a, b)
        >>> for tag, i1, i2, j1, j2 in s.get_opcodes():
        ...    print(("%7s a[%d:%d] (%s) b[%d:%d] (%s)" %
        ...           (tag, i1, i2, a[i1:i2], j1, j2, b[j1:j2])))
         delete a[0:1] (q) b[0:0] ()
          equal a[1:3] (ab) b[0:2] (ab)
        replace a[3:4] (x) b[2:3] (y)
          equal a[4:6] (cd) b[3:5] (cd)
         insert a[6:6] () b[5:6] (f)
        Nr
r�replace�delete�insert�equal)r!rKr*)rr1r<Zanswer�ai�bj�size�tagrrr�get_opcodess$

zSequenceMatcher.get_opcodes�c
csn|��}|sdg}|dddkrZ|d\}}}}}|t|||�|t|||�|f|d<|dddkr�|d\}}}}}||t|||�|t|||�f|d<||}g}	|D]�\}}}}}|dk�r(|||k�r(|	�||t|||�|t|||�f�|	Vg}	t|||�t|||�}}|	�|||||f�q�|	�rjt|	�dk�rd|	dddk�sj|	VdS)a� Isolate change clusters by eliminating ranges with no changes.

        Return a generator of groups with up to n lines of context.
        Each group is in the same format as returned by get_opcodes().

        >>> from pprint import pprint
        >>> a = list(map(str, range(1,40)))
        >>> b = a[:]
        >>> b[8:8] = ['i']     # Make an insertion
        >>> b[20] += 'x'       # Make a replacement
        >>> b[23:28] = []      # Make a deletion
        >>> b[30] += 'y'       # Make another replacement
        >>> pprint(list(SequenceMatcher(None,a,b).get_grouped_opcodes()))
        [[('equal', 5, 8, 5, 8), ('insert', 8, 8, 8, 9), ('equal', 8, 11, 9, 12)],
         [('equal', 16, 19, 17, 20),
          ('replace', 19, 20, 20, 21),
          ('equal', 20, 22, 21, 23),
          ('delete', 22, 27, 23, 23),
          ('equal', 27, 30, 23, 26)],
         [('equal', 31, 34, 27, 30),
          ('replace', 34, 35, 30, 31),
          ('equal', 35, 38, 31, 34)]]
        )rOr
r&r
r&r
rO���r&N)rT�max�minr*r/)
rr4ZcodesrSrGrIrHrJZnn�grouprrr�get_grouped_opcodes<s(&&(&z#SequenceMatcher.get_grouped_opcodescCs0tdd�|��D��}t|t|j�t|j��S)a�Return a measure of the sequences' similarity (float in [0,1]).

        Where T is the total number of elements in both sequences, and
        M is the number of matches, this is 2.0*M / T.
        Note that this is 1 if the sequences are identical, and 0 if
        they have nothing in common.

        .ratio() is expensive to compute if you haven't already computed
        .get_matching_blocks() or .get_opcodes(), in which case you may
        want to try .quick_ratio() or .real_quick_ratio() first to get an
        upper bound.

        >>> s = SequenceMatcher(None, "abcd", "bcde")
        >>> s.ratio()
        0.75
        >>> s.quick_ratio()
        0.75
        >>> s.real_quick_ratio()
        1.0
        css|]}|dVqdS)rVNr)�.0Ztriplerrr�	<genexpr>�sz(SequenceMatcher.ratio.<locals>.<genexpr>)�sumrKrr/rr)rrrrr�rationszSequenceMatcher.ratiocCs�|jdkr4i|_}|jD]}|�|d�d||<q|j}i}|jd}}|jD]>}||�rf||}n|�|d�}|d||<|dkrP|d}qPt|t|j�t|j��S)z�Return an upper bound on ratio() relatively quickly.

        This isn't defined beyond that it is an upper bound on .ratio(), and
        is faster to compute.
        Nr
r&)r"rr7r5rrr/)rr"r2ZavailZavailhasrZnumbrrr�quick_ratio�s






zSequenceMatcher.quick_ratiocCs*t|j�t|j�}}tt||�||�S)z�Return an upper bound on ratio() very quickly.

        This isn't defined beyond that it is an upper bound on .ratio(), and
        is faster to compute than either .ratio() or .quick_ratio().
        )r/rrrrX)rrDrErrr�real_quick_ratio�sz SequenceMatcher.real_quick_ratio)NrrT)rU)�__name__�
__module__�__qualname__�__doc__rrrrr#r>rKrTrZr^r_r`rrrrr+sj
@,'nG7
2rU�333333�?cCs�|dkstd|f��d|kr*dks:ntd|f��g}t�}|�|�|D]D}|�|�|��|krR|��|krR|��|krR|�|��|f�qRt||�}dd�|D�S)a�Use SequenceMatcher to return list of the best "good enough" matches.

    word is a sequence for which close matches are desired (typically a
    string).

    possibilities is a list of sequences against which to match word
    (typically a list of strings).

    Optional arg n (default 3) is the maximum number of close matches to
    return.  n must be > 0.

    Optional arg cutoff (default 0.6) is a float in [0, 1].  Possibilities
    that don't score at least that similar to word are ignored.

    The best (no more than n) matches among the possibilities are returned
    in a list, sorted by similarity score, most similar first.

    >>> get_close_matches("appel", ["ape", "apple", "peach", "puppy"])
    ['apple', 'ape']
    >>> import keyword as _keyword
    >>> get_close_matches("wheel", _keyword.kwlist)
    ['while']
    >>> get_close_matches("Apple", _keyword.kwlist)
    []
    >>> get_close_matches("accept", _keyword.kwlist)
    ['except']
    r
zn must be > 0: %rgrz cutoff must be in [0.0, 1.0]: %rcSsg|]\}}|�qSrr)r[ZscorerFrrr�
<listcomp>�sz%get_close_matches.<locals>.<listcomp>)	�
ValueErrorrrrr`r_r^r*�	_nlargest)ZwordZ
possibilitiesr4�cutoff�result�srFrrrr�s"


�
�
cCsd�dd�t||�D��S)zAReplace whitespace with the original whitespace characters in `s`rcss*|]"\}}|dkr|��r|n|VqdS)� N)�isspace)r[�cZtag_crrrr\�s�z$_keep_original_ws.<locals>.<genexpr>)�join�zip)rkZtag_srrr�_keep_original_ws�s
�rqc@sJeZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)ra�

    Differ is a class for comparing sequences of lines of text, and
    producing human-readable differences or deltas.  Differ uses
    SequenceMatcher both to compare sequences of lines, and to compare
    sequences of characters within similar (near-matching) lines.

    Each line of a Differ delta begins with a two-letter code:

        '- '    line unique to sequence 1
        '+ '    line unique to sequence 2
        '  '    line common to both sequences
        '? '    line not present in either input sequence

    Lines beginning with '? ' attempt to guide the eye to intraline
    differences, and were not present in either input sequence.  These lines
    can be confusing if the sequences contain tab characters.

    Note that Differ makes no claim to produce a *minimal* diff.  To the
    contrary, minimal diffs are often counter-intuitive, because they synch
    up anywhere possible, sometimes accidental matches 100 pages apart.
    Restricting synch points to contiguous matches preserves some notion of
    locality, at the occasional cost of producing a longer diff.

    Example: Comparing two texts.

    First we set up the texts, sequences of individual single-line strings
    ending with newlines (such sequences can also be obtained from the
    `readlines()` method of file-like objects):

    >>> text1 = '''  1. Beautiful is better than ugly.
    ...   2. Explicit is better than implicit.
    ...   3. Simple is better than complex.
    ...   4. Complex is better than complicated.
    ... '''.splitlines(keepends=True)
    >>> len(text1)
    4
    >>> text1[0][-1]
    '\n'
    >>> text2 = '''  1. Beautiful is better than ugly.
    ...   3.   Simple is better than complex.
    ...   4. Complicated is better than complex.
    ...   5. Flat is better than nested.
    ... '''.splitlines(keepends=True)

    Next we instantiate a Differ object:

    >>> d = Differ()

    Note that when instantiating a Differ object we may pass functions to
    filter out line and character 'junk'.  See Differ.__init__ for details.

    Finally, we compare the two:

    >>> result = list(d.compare(text1, text2))

    'result' is a list of strings, so let's pretty-print it:

    >>> from pprint import pprint as _pprint
    >>> _pprint(result)
    ['    1. Beautiful is better than ugly.\n',
     '-   2. Explicit is better than implicit.\n',
     '-   3. Simple is better than complex.\n',
     '+   3.   Simple is better than complex.\n',
     '?     ++\n',
     '-   4. Complex is better than complicated.\n',
     '?            ^                     ---- ^\n',
     '+   4. Complicated is better than complex.\n',
     '?           ++++ ^                      ^\n',
     '+   5. Flat is better than nested.\n']

    As a single multi-line string it looks like this:

    >>> print(''.join(result), end="")
        1. Beautiful is better than ugly.
    -   2. Explicit is better than implicit.
    -   3. Simple is better than complex.
    +   3.   Simple is better than complex.
    ?     ++
    -   4. Complex is better than complicated.
    ?            ^                     ---- ^
    +   4. Complicated is better than complex.
    ?           ++++ ^                      ^
    +   5. Flat is better than nested.

    Methods:

    __init__(linejunk=None, charjunk=None)
        Construct a text differencer, with optional filters.

    compare(a, b)
        Compare two sequences of lines; generate the resulting delta.
    NcCs||_||_dS)a�
        Construct a text differencer, with optional filters.

        The two optional keyword parameters are for filter functions:

        - `linejunk`: A function that should accept a single string argument,
          and return true iff the string is junk. The module-level function
          `IS_LINE_JUNK` may be used to filter out lines without visible
          characters, except for at most one splat ('#').  It is recommended
          to leave linejunk None; the underlying SequenceMatcher class has
          an adaptive notion of "noise" lines that's better than any static
          definition the author has ever been able to craft.

        - `charjunk`: A function that should accept a string of length 1. The
          module-level function `IS_CHARACTER_JUNK` may be used to filter out
          whitespace characters (a blank or tab; **note**: bad idea to include
          newline in this!).  Use of IS_CHARACTER_JUNK is recommended.
        N��linejunk�charjunk)rrsrtrrrrHszDiffer.__init__c
	cs�t|j||�}|��D]�\}}}}}|dkrB|�||||||�}	n\|dkr\|�d|||�}	nB|dkrv|�d|||�}	n(|dkr�|�d|||�}	ntd|f��|	Ed	Hqd	S)
a�
        Compare two sequences of lines; generate the resulting delta.

        Each sequence must contain individual single-line strings ending with
        newlines. Such sequences can be obtained from the `readlines()` method
        of file-like objects.  The delta generated also consists of newline-
        terminated strings, ready to be printed as-is via the writeline()
        method of a file-like object.

        Example:

        >>> print(''.join(Differ().compare('one\ntwo\nthree\n'.splitlines(True),
        ...                                'ore\ntree\nemu\n'.splitlines(True))),
        ...       end="")
        - one
        ?  ^
        + ore
        ?  ^
        - two
        - three
        ?  -
        + tree
        + emu
        rLrM�-rN�+rOrl�unknown tag %rN)rrsrT�_fancy_replace�_dumprg)
rrr�cruncherrSr8r9r:r;�grrr�compare_szDiffer.compareccs&t||�D]}d|||fVq
dS)z4Generate comparison results for a same-tagged range.z%s %sN)r6)rrSrF�lo�hir1rrrry�szDiffer._dumpc
csn||||kr2|�d|||�}|�d|||�}n |�d|||�}|�d|||�}||fD]}	|	EdHqZdS)Nrvru)ry)
rrr8r9rr:r;�first�secondr{rrr�_plain_replace�szDiffer._plain_replaceccs:d\}}t|j�}	d\}
}t||�D]�}||}
|	�|
�t||�D]j}||}||
krl|
dkrD||}
}qD|	�|�|	��|krD|	��|krD|	��|krD|	��||}}}qDq$||kr�|
dkr�|�||||||�EdHdS|
|d}}}nd}
|�	||||||�EdH||||}}|
dk�r
d}}|	�
||�|	��D]�\}}}}}||||}}|dk�r�|d|7}|d|7}nb|dk�r�|d	|7}nJ|d
k�r�|d|7}n2|dk�r�|d
|7}|d
|7}ntd|f���qH|�
||||�EdHn
d|V|�	||d|||d|�EdHdS)aL
        When replacing one block of lines with another, search the blocks
        for *similar* lines; the best-matching pair (if any) is used as a
        synch point, and intraline difference marking is done on the
        similar pair. Lots of work, but often worth it.

        Example:

        >>> d = Differ()
        >>> results = d._fancy_replace(['abcDefghiJkl\n'], 0, 1,
        ...                            ['abcdefGhijkl\n'], 0, 1)
        >>> print(''.join(results), end="")
        - abcDefghiJkl
        ?    ^  ^  ^
        + abcdefGhijkl
        ?    ^  ^  ^
        )g�G�z��?g�?)NNNrrrL�^rMrurNrvrOrlrw�  r&)rrtr6rrr`r_r^r��
_fancy_helperrrTrg�_qformat)rrr8r9rr:r;Z
best_ratiorirzZeqiZeqjr<rQr1rPZbest_iZbest_jZaeltZbelt�atags�btagsrSZai1Zai2Zbj1Zbj2rDrErrrrx�s\




�
�





zDiffer._fancy_replaceccsbg}||kr<||kr*|�||||||�}qT|�d|||�}n||krT|�d|||�}|EdHdS)Nrurv)rxry)rrr8r9rr:r;r{rrrr��szDiffer._fancy_helperccsXt||���}t||���}d|V|r8d|�d�Vd|V|rTd|�d�VdS)a�
        Format "?" output and deal with tabs.

        Example:

        >>> d = Differ()
        >>> results = d._qformat('\tabcDefghiJkl\n', '\tabcdefGhijkl\n',
        ...                      '  ^ ^  ^      ', '  ^ ^  ^      ')
        >>> for line in results: print(repr(line))
        ...
        '- \tabcDefghiJkl\n'
        '? \t ^ ^  ^\n'
        '+ \tabcdefGhijkl\n'
        '? \t ^ ^  ^\n'
        �- z? �
�+ N)rq�rstrip)rZalineZbliner�r�rrrr�s

zDiffer._qformat)NN)rarbrcrdrr|ryr�rxr�r�rrrrr�s]
)^Nz
\s*(?:#\s*)?$cCs||�dk	S)z�
    Return True for ignorable line: iff `line` is blank or contains a single '#'.

    Examples:

    >>> IS_LINE_JUNK('\n')
    True
    >>> IS_LINE_JUNK('  #   \n')
    True
    >>> IS_LINE_JUNK('hello\n')
    False
    Nr)�lineZpatrrrr3s� 	cCs||kS)z�
    Return True for ignorable character: iff `ch` is a space or tab.

    Examples:

    >>> IS_CHARACTER_JUNK(' ')
    True
    >>> IS_CHARACTER_JUNK('\t')
    True
    >>> IS_CHARACTER_JUNK('\n')
    False
    >>> IS_CHARACTER_JUNK('x')
    False
    r)ZchZwsrrrrCscCs:|d}||}|dkr"d�|�S|s.|d8}d�||�S�z Convert range to the "ed" formatr&z{}z{},{}��format��start�stopZ	beginningrrrr�_format_range_unifiedZs
r�rr�ccsPt|||||||�d}td||��|�D�]}	|s|d}|rFd�|�nd}
|rXd�|�nd}d�||
|�Vd�|||�V|	d|	d	}}
t|d
|
d�}t|d|
d
�}d�|||�V|	D]�\}}}}}|dkr�|||�D]}d|Vq�q�|dk�r"|||�D]}d|V�q|dkr�|||�D]}d|V�q6q�q*dS)a�
    Compare two sequences of lines; generate the delta as a unified diff.

    Unified diffs are a compact way of showing line changes and a few
    lines of context.  The number of context lines is set by 'n' which
    defaults to three.

    By default, the diff control lines (those with ---, +++, or @@) are
    created with a trailing newline.  This is helpful so that inputs
    created from file.readlines() result in diffs that are suitable for
    file.writelines() since both the inputs and outputs have trailing
    newlines.

    For inputs that do not have trailing newlines, set the lineterm
    argument to "" so that the output will be uniformly newline free.

    The unidiff format normally has a header for filenames and modification
    times.  Any or all of these may be specified using strings for
    'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'.
    The modification times are normally expressed in the ISO 8601 format.

    Example:

    >>> for line in unified_diff('one two three four'.split(),
    ...             'zero one tree four'.split(), 'Original', 'Current',
    ...             '2005-01-26 23:30:50', '2010-04-02 10:20:52',
    ...             lineterm=''):
    ...     print(line)                 # doctest: +NORMALIZE_WHITESPACE
    --- Original        2005-01-26 23:30:50
    +++ Current         2010-04-02 10:20:52
    @@ -1,4 +1,4 @@
    +zero
     one
    -two
    -three
    +tree
     four
    FNT�	{}r�
--- {}{}{}z
+++ {}{}{}r
rVr&�rU�z@@ -{} +{} @@{}rOrl>rMrLru>rLrNrv)�_check_typesrrZr�r�)rr�fromfile�tofile�fromfiledate�
tofiledater4�lineterm�startedrY�fromdate�todater�last�file1_range�file2_rangerSrGrIrHrJr�rrrr	es0)
cCsB|d}||}|s|d8}|dkr.d�|�Sd�|||d�Sr�r�r�rrr�_format_range_context�s
r�ccs�t|||||||�tddddd�}d}	td||��|�D�]R}
|	s�d}	|rVd	�|�nd
}|rhd	�|�nd
}d�|||�Vd�|||�V|
d
|
d}
}d|Vt|
d|d�}d�||�Vtdd�|
D���r|
D]8\}}}}}|dkr�|||�D]}|||V�qq�t|
d|d�}d�||�Vtdd�|
D��r:|
D]<\}}}}}|dk�rP|||�D]}|||V�qt�qPq:dS)ah
    Compare two sequences of lines; generate the delta as a context diff.

    Context diffs are a compact way of showing line changes and a few
    lines of context.  The number of context lines is set by 'n' which
    defaults to three.

    By default, the diff control lines (those with *** or ---) are
    created with a trailing newline.  This is helpful so that inputs
    created from file.readlines() result in diffs that are suitable for
    file.writelines() since both the inputs and outputs have trailing
    newlines.

    For inputs that do not have trailing newlines, set the lineterm
    argument to "" so that the output will be uniformly newline free.

    The context diff format normally has a header for filenames and
    modification times.  Any or all of these may be specified using
    strings for 'fromfile', 'tofile', 'fromfiledate', and 'tofiledate'.
    The modification times are normally expressed in the ISO 8601 format.
    If not specified, the strings default to blanks.

    Example:

    >>> print(''.join(context_diff('one\ntwo\nthree\nfour\n'.splitlines(True),
    ...       'zero\none\ntree\nfour\n'.splitlines(True), 'Original', 'Current')),
    ...       end="")
    *** Original
    --- Current
    ***************
    *** 1,4 ****
      one
    ! two
    ! three
      four
    --- 1,4 ----
    + zero
      one
    ! tree
      four
    r�r�z! r�)rNrMrLrOFNTr�rz
*** {}{}{}r�r
rVz***************r&r�z
*** {} ****{}css |]\}}}}}|dkVqdS)>rMrLNr�r[rS�_rrrr\�szcontext_diff.<locals>.<genexpr>rNrUr�z
--- {} ----{}css |]\}}}}}|dkVqdS)>rLrNNrr�rrrr\srM)r��dictrrZr�r��any)rrr�r�r�r�r4r��prefixr�rYr�r�rr�r�rSrGrIr�r�r�rHrJrrrr�s4,

cGs�|r0t|dt�s0tdt|d�j|df��|r`t|dt�s`tdt|d�j|df��|D]}t|t�sdtd|f��qddS)Nr
z)lines to compare must be str, not %s (%r)z"all arguments must be str, not: %r)�
isinstance�str�	TypeError�typera)rr�args�argrrrr�s��
r���
c		cs~dd�}	tt|	|��}tt|	|��}|	|�}|	|�}|	|�}|	|�}|	|�}|||||||||�}
|
D]}|�dd�VqfdS)a�
    Compare `a` and `b`, two sequences of lines represented as bytes rather
    than str. This is a wrapper for `dfunc`, which is typically either
    unified_diff() or context_diff(). Inputs are losslessly converted to
    strings so that `dfunc` only has to worry about strings, and encoded
    back to bytes on return. This is necessary to compare files with
    unknown or inconsistent encoding. All other inputs (except `n`) must be
    bytes rather than str.
    c
SsRz|�dd�WStk
rL}z dt|�j|f}t|�|�W5d}~XYnXdS)N�ascii�surrogateescapez(all arguments must be bytes, not %s (%r))�decode�AttributeErrorr�rar�)rk�err�msgrrrr�"s�zdiff_bytes.<locals>.decoder�r�N)rArB�encode)Zdfuncrrr�r�r�r�r4r�r��linesr�rrrr
scCst||��||�S)aJ
    Compare `a` and `b` (lists of strings); return a `Differ`-style delta.

    Optional keyword parameters `linejunk` and `charjunk` are for filter
    functions, or can be None:

    - linejunk: A function that should accept a single string argument and
      return true iff the string is junk.  The default is None, and is
      recommended; the underlying SequenceMatcher class has an adaptive
      notion of "noise" lines.

    - charjunk: A function that accepts a character (string of length
      1), and returns true iff the character is junk. The default is
      the module-level function IS_CHARACTER_JUNK, which filters out
      whitespace characters (a blank or tab; note: it's a bad idea to
      include newline in this!).

    Tools/scripts/ndiff.py is a command-line front-end to this function.

    Example:

    >>> diff = ndiff('one\ntwo\nthree\n'.splitlines(keepends=True),
    ...              'ore\ntree\nemu\n'.splitlines(keepends=True))
    >>> print(''.join(diff), end="")
    - one
    ?  ^
    + ore
    ?  ^
    - two
    - three
    ?  -
    + tree
    + emu
    )rr|)rrrsrtrrrr5s#c#s�ddl}|�d��t||||��ddgf�fdd�	���fdd���fdd	�}|�}|dkrj|EdH�n|d
7}d}ddg|}	}
d}|dkr�zt|�\}}
}Wntk
r�YdSX|	|}||
|f|
|<|	d
7}	q�|	|kr�dV|}n|	}d}	|�r"|	|}|	d
7}	|
|V|d
8}q�|d
}z@|�rht|�\}}
}|�rP|d
}n|d
8}||
|fV�q,Wqvtk
�r�YdSXqvdS)
a�Returns generator yielding marked up from/to side by side differences.

    Arguments:
    fromlines -- list of text lines to compared to tolines
    tolines -- list of text lines to be compared to fromlines
    context -- number of context lines to display on each side of difference,
               if None, all from/to text lines will be generated.
    linejunk -- passed on to ndiff (see ndiff documentation)
    charjunk -- passed on to ndiff (see ndiff documentation)

    This function returns an iterator which returns a tuple:
    (from line tuple, to line tuple, boolean flag)

    from/to line tuple -- (line num, line text)
        line num -- integer or None (to indicate a context separation)
        line text -- original line text with following markers inserted:
            '\0+' -- marks start of added text
            '\0-' -- marks start of deleted text
            '\0^' -- marks start of changed text
            '\1' -- marks end of added/deleted/changed text

    boolean flag -- None indicates context separation, True indicates
        either "from" or "to" line contains a change, otherwise False.

    This function/iterator was originally developed to generate side by side
    file difference for making HTML pages (see HtmlDiff class for example
    usage).

    Note, this function utilizes the ndiff function to generate the side by
    side difference markup.  Optional ndiff arguments may be passed to this
    function and they in turn will be passed to ndiff.
    r
Nz
(\++|\-+|\^+)cs�||d7<|dkr2|||�d�dd�fS|dkr�|�d�|�d�}}g}|fdd�}��||�t|�D]<\}\}	}
|d|	�d|||	|
�d	||
d�}qt|dd�}n*|�d�dd�}|s�d
}d||d	}|||fS)aReturns line of text with user's change markup and line formatting.

        lines -- list of lines from the ndiff generator to produce a line of
                 text from.  When producing the line of text to return, the
                 lines used are removed from this list.
        format_key -- '+' return first line in list with "add" markup around
                          the entire line.
                      '-' return first line in list with "delete" markup around
                          the entire line.
                      '?' return first line in list with add/delete/change
                          intraline markup (indices obtained from second line)
                      None return first line in list with no markup
        side -- indice into the num_lines list (0=from,1=to)
        num_lines -- from/to current line number.  This is NOT intended to be a
                     passed parameter.  It is present as a keyword argument to
                     maintain memory of the current line numbers between calls
                     of this function.

        Note, this function is purposefully not defined at the module scope so
        that data it needs from its parent function (within whose context it
        is defined) does not need to be of module scope.
        r&Nr
r��?cSs&|�|�d�d|��g�|�d�S)Nr&r
)r*rY�span)Zmatch_object�sub_inforrr�record_sub_info�sz3_mdiff.<locals>._make_line.<locals>.record_sub_info��rl)r?�sub�reversed)r�Z
format_key�sideZ	num_lines�textZmarkersr�r��keyZbegin�end)�	change_rerr�
_make_line�s 2z_mdiff.<locals>._make_linec3sng}d\}}t|�dkr*|�t�d��qd�dd�|D��}|�d�rP|}�n�|�d�r|�|dd	��|dd
�dfVq�n�|�d�r�|d
8}�|d
d	�ddfVq�nl|�d�rֈ|d
d	�d}}|d
d	}}�n>|�d��r�|dd	��|dd
�dfVq�n|�d��r0�|dd	��|dd
�dfVqn�|�d
��r\|d
8}�|d
d	�ddfVqn�|�d��r�|d
7}d�|dd
�dfVqn�|�d��r�d�|dd
�}}|d
d	}}n^|�d��r�|d
7}d�|dd
�dfVqn2|�d��r�|dd�dd	��|dd
�dfVq|d	k�r0|d
7}dV�q|d	k�rL|d
8}dV�q0|�d��r\dS||dfVqdS)a�Yields from/to lines of text with a change indication.

        This function is an iterator.  It itself pulls lines from a
        differencing iterator, processes them and yields them.  When it can
        it yields both a "from" and a "to" line, otherwise it will yield one
        or the other.  In addition to yielding the lines of from/to text, a
        boolean flag is yielded to indicate if the text line(s) have
        differences in them.

        Note, this function is purposefully not defined at the module scope so
        that data it needs from its parent function (within whose context it
        is defined) does not need to be of module scope.
        )r
r
r��XrcSsg|]}|d�qS)r
r�r[r�rrrrf�sz2_mdiff.<locals>._line_iterator.<locals>.<listcomp>z-?+?r�r
r&Tz--++ruN)z--?+z--+r�z-+?z-?+z+--rv)r�z+-rlF)N�rr�T)r�NT)r/r*�nextro�
startswith)r�Znum_blanks_pendingZnum_blanks_to_yieldrk�	from_line�to_line)r��diff_lines_iteratorrr�_line_iterator�sd



$



z_mdiff.<locals>._line_iteratorc3s���}gg}}t|�dks(t|�dkr�zt|�\}}}Wntk
rPYdSX|dk	rh|�||f�|dk	r|�||f�q|�d�\}}|�d�\}}|||p�|fVqdS)atYields from/to lines of text with a change indication.

        This function is an iterator.  It itself pulls lines from the line
        iterator.  Its difference from that iterator is that this function
        always yields a pair of from/to text lines (with the change
        indication).  If necessary it will collect single from/to lines
        until it has a matching pair from/to pair to yield.

        Note, this function is purposefully not defined at the module scope so
        that data it needs from its parent function (within whose context it
        is defined) does not need to be of module scope.
        r
N)r/r��
StopIterationr*r?)Z
line_iterator�	fromlines�tolinesr�r��
found_diffZfromDiffZto_diff)r�rr�_line_pair_iterators

z#_mdiff.<locals>._line_pair_iteratorr&F)NNN)�re�compilerr�r�)r�r��contextrsrtr�r�Zline_pair_iteratorZlines_to_write�indexZcontextLinesr�r�r�r1r)r�r�r�r�r�_mdiffZsR"
8X!



r�an
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>

<head>
    <meta http-equiv="Content-Type"
          content="text/html; charset=%(charset)s" />
    <title></title>
    <style type="text/css">%(styles)s
    </style>
</head>

<body>
    %(table)s%(legend)s
</body>

</html>aH
        table.diff {font-family:Courier; border:medium;}
        .diff_header {background-color:#e0e0e0}
        td.diff_header {text-align:right}
        .diff_next {background-color:#c0c0c0}
        .diff_add {background-color:#aaffaa}
        .diff_chg {background-color:#ffff77}
        .diff_sub {background-color:#ffaaaa}aZ
    <table class="diff" id="difflib_chg_%(prefix)s_top"
           cellspacing="0" cellpadding="0" rules="groups" >
        <colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
        <colgroup></colgroup> <colgroup></colgroup> <colgroup></colgroup>
        %(header_row)s
        <tbody>
%(data_rows)s        </tbody>
    </table>a�
    <table class="diff" summary="Legends">
        <tr> <th colspan="2"> Legends </th> </tr>
        <tr> <td> <table border="" summary="Colors">
                      <tr><th> Colors </th> </tr>
                      <tr><td class="diff_add">&nbsp;Added&nbsp;</td></tr>
                      <tr><td class="diff_chg">Changed</td> </tr>
                      <tr><td class="diff_sub">Deleted</td> </tr>
                  </table></td>
             <td> <table border="" summary="Links">
                      <tr><th colspan="2"> Links </th> </tr>
                      <tr><td>(f)irst change</td> </tr>
                      <tr><td>(n)ext change</td> </tr>
                      <tr><td>(t)op</td> </tr>
                  </table></td> </tr>
    </table>c@s�eZdZdZeZeZeZeZdZddde	fdd�Z
dd
d�dd
�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zddd�ZdS) ra{For producing HTML side by side comparison with change highlights.

    This class can be used to create an HTML table (or a complete HTML file
    containing the table) showing a side by side, line by line comparison
    of text with inter-line and intra-line change highlights.  The table can
    be generated in either full or contextual difference mode.

    The following methods are provided for HTML generation:

    make_table -- generates HTML for a single side by side table
    make_file -- generates complete HTML file with a single side by side table

    See tools/scripts/diff.py for an example usage of this class.
    r
�NcCs||_||_||_||_dS)a�HtmlDiff instance initializer

        Arguments:
        tabsize -- tab stop spacing, defaults to 8.
        wrapcolumn -- column number where lines are broken and wrapped,
            defaults to None where lines are not wrapped.
        linejunk,charjunk -- keyword arguments passed into ndiff() (used by
            HtmlDiff() to generate the side by side HTML differences).  See
            ndiff() documentation for argument default values and descriptions.
        N)�_tabsize�_wrapcolumn�	_linejunk�	_charjunk)r�tabsizeZ
wrapcolumnrsrtrrrr�szHtmlDiff.__init__rF�zutf-8)�charsetcCs:|jt|j|j|j||||||d�|d��|d��|�S)aReturns HTML file of side by side comparison with change highlights

        Arguments:
        fromlines -- list of "from" lines
        tolines -- list of "to" lines
        fromdesc -- "from" file column header string
        todesc -- "to" file column header string
        context -- set to True for contextual differences (defaults to False
            which shows full differences).
        numlines -- number of context lines.  When context is set True,
            controls number of lines displayed before and after the change.
            When context is False, controls the number of lines to place
            the "next" link anchors before the next change (so click of
            "next" link jumps to just before the change).
        charset -- charset of the HTML document
        )r��numlines)ZstylesZlegend�tabler��xmlcharrefreplace)�_file_templater��_styles�_legend�
make_tabler�r�)rr�r��fromdesc�todescr�r�r�rrr�	make_file�s����zHtmlDiff.make_filecs8�fdd���fdd�|D�}�fdd�|D�}||fS)aReturns from/to line lists with tabs expanded and newlines removed.

        Instead of tab characters being replaced by the number of spaces
        needed to fill in to the next tab stop, this function will fill
        the space with tab characters.  This is done so that the difference
        algorithms can identify changes in a file when tabs are replaced by
        spaces and vice versa.  At the end of the HTML generation, the tab
        characters will be replaced with a nonbreakable space.
        cs6|�dd�}|��j�}|�dd�}|�dd��d�S)Nrlr��	r�)rL�
expandtabsr�r�)r�)rrr�expand_tabs�sz2HtmlDiff._tab_newline_replace.<locals>.expand_tabscsg|]}�|��qSrrr��r�rrrf�sz1HtmlDiff._tab_newline_replace.<locals>.<listcomp>csg|]}�|��qSrrr�r�rrrf�sr)rr�r�r)r�rr�_tab_newline_replace�s
	zHtmlDiff._tab_newline_replacecCs|s|�||f�dSt|�}|j}||ksB||�d�d|krT|�||f�dSd}d}d}||kr�||kr�||dkr�|d7}||}|d7}q`||dkr�|d7}d}q`|d7}|d7}q`|d|�}	||d�}
|r�|	d}	d||
}
|�||	f�|�|d|
�dS)	a�Builds list of text lines by splitting text lines at wrap point

        This function will determine if the input text line needs to be
        wrapped (split) into separate lines.  If so, the first wrap point
        will be determined and the first line appended to the output
        text line list.  This function is used recursively to handle
        the second part of the split line to further split it.
        Nr�rUr
rr&r��>)r*r/r��count�_split_line)rZ	data_listZline_numr�rRrWr1r4ZmarkZline1Zline2rrrr��s8


zHtmlDiff._split_lineccs�|D]�\}}}|dkr$|||fVq||\}}\}}gg}	}
|�|	||�|�|
||�|	sd|
r|	rt|	�d�}nd}|
r�|
�d�}nd}|||fVq\qdS)z5Returns iterator that splits (wraps) mdiff text linesNr
)rrl)r�r?)r�diffs�fromdata�todata�flagZfromlineZfromtextZtolineZtotext�fromlist�tolistrrr�
_line_wrapper0s 
zHtmlDiff._line_wrapperc	Cs�ggg}}}|D]r\}}}z4|�|jd|f|���|�|jd|f|���Wn(tk
rz|�d�|�d�YnX|�|�q|||fS)z�Collects mdiff output into separate lists

        Before storing the mdiff from/to data into a list, it is converted
        into a single line of text with HTML markup.
        r
r&N)r*�_format_liner�)rr�r�r��flaglistr�r�r�rrr�_collect_linesLs
zHtmlDiff._collect_linescCsrzd|}d|j||f}Wntk
r6d}YnX|�dd��dd��dd	�}|�d
d���}d|||fS)
aReturns HTML markup of "from" / "to" text lines

        side -- 0 or 1 indicating "from" or "to" text
        flag -- indicates if difference on line
        linenum -- line number (used for line number column)
        text -- line text to be marked up
        z%dz
 id="%s%s"r�&z&amp;r�z&gt;�<z&lt;rl�&nbsp;z<<td class="diff_header"%s>%s</td><td nowrap="nowrap">%s</td>)�_prefixr�rLr�)rr�r�Zlinenumr��idrrrr�as
�zHtmlDiff._format_linecCs0dtj}dtj}tjd7_||g|_dS)zCreate unique anchor prefixeszfrom%d_zto%d_r&N)r�_default_prefixr)rZ
fromprefix�toprefixrrr�_make_prefixxs

zHtmlDiff._make_prefixcCs�|jd}dgt|�}dgt|�}d\}	}
d}t|�D]V\}}
|
r�|
s�d}
|}td||g�}d||	f||<|	d7}	d||	f||<q:d}
q:|s�dg}dg}dg}d}|r�d	g}|}n
d
g}}|ds�d||d<d|||<|||||fS)
zMakes list of "next" linksr&r)r
Fr
Tz id="difflib_chg_%s_%d"z"<a href="#difflib_chg_%s_%d">n</a>Fz2<td></td><td>&nbsp;No Differences Found&nbsp;</td>z(<td></td><td>&nbsp;Empty File&nbsp;</td>z!<a href="#difflib_chg_%s_0">f</a>z#<a href="#difflib_chg_%s_top">t</a>)rr/r(rW)rr�r�r�r�r�r�next_id�	next_hrefZnum_chgZ	in_changer�r1r�rrr�_convert_flags�s>
�
zHtmlDiff._convert_flagsc
CsR|��|�||�\}}|r"|}nd}t||||j|jd�}|jrL|�|�}|�|�\}	}
}|�|	|
|||�\}	}
}}}
g}d}t	t
|��D]P}||dkr�|dkr�|�d�q�|�||
||||	||||
|f�q�|s�|�rddd|dd|f}nd	}|jt
d	�|�||jd
d�}|�dd
��dd��dd��dd��dd�S)a�Returns HTML table of side by side comparison with change highlights

        Arguments:
        fromlines -- list of "from" lines
        tolines -- list of "to" lines
        fromdesc -- "from" file column header string
        todesc -- "to" file column header string
        context -- set to True for contextual differences (defaults to False
            which shows full differences).
        numlines -- number of context lines.  When context is set True,
            controls number of lines displayed before and after the change.
            When context is False, controls the number of lines to place
            the "next" link anchors before the next change (so click of
            "next" link jumps to just before the change).
        NrrzV            <tr><td class="diff_next"%s>%s</td>%s<td class="diff_next">%s</td>%s</tr>
r
z)        </tbody>        
        <tbody>
z <thead><tr>%s%s%s%s</tr></thead>z!<th class="diff_next"><br /></th>z+<th colspan="2" class="diff_header">%s</th>rr&)Z	data_rows�
header_rowr�z+z<span class="diff_add">z-z<span class="diff_sub">z^z<span class="diff_chg">r�z</span>r�r)rr�r�r�r�r�r�r�r
r6r/r*�_table_templater�rorrL)rr�r�r�r�r�r�Z
context_linesr�r�r�r�r	rrkZfmtr1rr�rrrr��sl�
��

������zHtmlDiff.make_table)rrFr�)rrFr�)rarbrcrdr�r�rr�rrrr�r�r�r�r�r�rr
r�rrrrr�s2�
��7/�ccsnzddd�t|�}Wn"tk
r8td|�d�YnXd|f}|D]"}|dd�|krF|dd�VqFdS)a0
    Generate one of the two sequences that generated a delta.

    Given a `delta` produced by `Differ.compare()` or `ndiff()`, extract
    lines originating from file 1 or 2 (parameter `which`), stripping off line
    prefixes.

    Examples:

    >>> diff = ndiff('one\ntwo\nthree\n'.splitlines(keepends=True),
    ...              'ore\ntree\nemu\n'.splitlines(keepends=True))
    >>> diff = list(diff)
    >>> print(''.join(restore(diff, 1)), end="")
    one
    two
    three
    >>> print(''.join(restore(diff, 2)), end="")
    ore
    tree
    emu
    r�r�)r&r�z)unknown delta choice (must be 1 or 2): %rNr�r�)�int�KeyErrorrg)ZdeltaZwhichrS�prefixesr�rrrrs��cCsddl}ddl}|�|�S)Nr
)�doctest�difflibZtestmod)rrrrr�_test!sr�__main__)rUre)r�)rrrrrUr�)rrrrrUr�)r�r�r�r�rUr�)$rd�__all__�heapqrrh�collectionsrZ_namedtuplerrrrrqrr�r��matchrrr�r	r�rr�r
rr�r�r�rr��objectrrrrarrrr�<module>s��


1	I
�
I�
L�
%�
	
a 
__pycache__/pydoc.cpython-38.opt-2.pyc000064400000220241151153537610013472 0ustar00U

��.e̠�@s�dgZdZdZdZddlZddlZddlZddlZddl	Zddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZddlZddlZddlmZddlmZddlmZd	d
�Zdd�Zd
d�Zdd�Z dd�Z!dd�Z"dd�Z#e�$dej%�Z&dd�Z'dd�Z(dd�Z)dd�Z*dwd d!�Z+d"d#�Z,d$d%�Z-d&d'�Z.d(d)�Z/ifd*d+�Z0Gd,d-�d-e1�Z2d.d/�Z3difd0d1�Z4Gd2d3�d3�Z5Gd4d5�d5e�Z6Gd6d7�d7e5�Z7Gd8d9�d9e�Z8Gd:d;�d;e5�Z9Gd<d=�d=e9�Z:d>d?�a;d@dA�Z<dBdC�Z=dDdE�Z>dFdG�Z?dHdI�Z@dJdK�ZAdLdM�ZBdNdO�ZCdxdPdQ�ZDe9�ZEe:�ZFe7�ZGdydRdS�ZHdzdUdV�ZId{dWdX�ZJd|dYdZ�ZKd}d\d]�ZLGd^d_�d_�ZMeM�ZNGd`da�da�ZOdbdc�ZPddde�ZQd~dgdh�ZRddidjdk�dldm�ZSdndo�ZTdpdq�ZUdrds�ZVdtdu�ZWeXdvk�r�eW�dS)��helpzKa-Ping Yee <ping@lfw.org>z26 February 2001z�Guido van Rossum, for an excellent programming language.
Tommy Burnette, the original creator of manpy.
Paul Prescod, for all his work on onlinehelp.
Richard Chamberlain, for the first implementation of textdoc.
�N)�deque)�Repr)�format_exception_onlycCs\g}g}tjD]H}tj�|pd�}tj�|�}||krtj�|�r|�|�|�|�q|S�N�.)�sys�path�os�abspath�normcase�isdir�append)�dirsZnormdirs�dirZnormdir�r�/usr/lib64/python3.8/pydoc.py�pathdirsPs

rcCs.t�|�pt�|�}|r*t�dd|���p,dS)Nz^ *
�)�inspect�getdocZgetcomments�re�sub�rstrip)�object�resultrrrr\srcCsf|���d�}t|�dkr&|ddfSt|�dkrX|d��sX|dd�|dd��fSdd�|�fS)N�
�rr�)�strip�split�lenr�join)�doc�linesrrr�splitdocasr%cCs"|j}|j|kr|jd|}|Sr)�__name__�
__module__)r�modname�namerrr�	classnamejs
r*cCs>t�|�p:t�|�p:t�|�p:t�|�p:t�|�p:t�|�S�N)r�ismodule�isclass�	isroutineZisframeZistracebackZiscode�rrrr�isdataqs����r0cGs.|r*|d�|�|d��}|dd�}q|S)Nrrr)r"r )�textZpairsrrr�replacewsr2cCsXt|�|krTtd|dd�}td|d|�}|d|�d|t|�|d�S|S)Nr�r�...)r!�max)r1�maxlenZpreZpostrrr�cram~s
$r7z at 0x[0-9a-f]{6,16}(>+)$cCst�d|�S)Nz\1)�_re_stripidr�r1rrr�stripid�sr:cCs<t�|�rdSt�|�r8t|dd�}t�|�p4|dkSdS)NT�__self__F)r�ismethod�	isbuiltin�getattrr,)�fn�selfrrr�_is_bound_method�s

rAcCs^i}t�|tj�D]\}}d||<q|jD]}|�t|��q*|��D]}t||�||<qF|S�Nr)r�
getmembersr.�	__bases__�update�
allmethods�keysr>)�cl�methods�key�value�baserrrrF�s

rFcCs8g}g}|D]"}||�r$|�|�q|�|�q||fSr+�r)�s�	predicateZyesZno�xrrr�_split_list�srQcCs\|dkrdS|�d�r$|�d�r$dS|�d�r<t|d�r<dS|dk	rL||kS|�d�SdS)N>�	__slots__�__date__�__path__�__qualname__�__builtins__�__credits__�__doc__�
__author__�__version__�__file__r&�
__cached__r'�
__loader__�__spec__�__package__r�__r�_�_fieldsT)�
startswith�endswith�hasattr)r)�all�objrrr�visiblename�srhcCsXg}t�|�D]D\}}}}t�|�r@d}t|t�r@|jdkr@d}|�||||f�q|S)N�data descriptor�readonly property)r�classify_class_attrs�isdatadescriptor�
isinstance�property�fsetr)r�resultsr)�kind�clsrKrrrrk�s
rkcs\t|dg��z�fdd�t��D��Wntk
r>i�YnX�fdd�}|j|d�dS)Nrbcsi|]\}}||t���qSr)r!)�.0�ir))�fieldsrr�
<dictcomp>�sz#sort_attributes.<locals>.<dictcomp>cs��|dd�|dfS�Nr)�get)�attr)�field_orderrr�<lambda>��z!sort_attributes.<locals>.<lambda>�rJ)r>�	enumerate�	TypeError�sort)�attrsrZkeyfuncr)rzrur�sort_attributes�s
r�cCs:tj�|�r6dD]$}tj�tj�|d|��rdSqdS)N)z.pyz.pyc�__init__TF)r
r	r
�isfiler")r	�extrrr�	ispackage�s
r�cCs�|��}|dd�dks |��s0|��}|sq0q|��}|dd�dkrT|dd�}|dd�dkr�|dd�}|dd�dkr�|dd�}|��s�|��}|s�q�q�|�d�d	��}nd}|S)
Nr�#�zr"""r3�"""����\r)�readlinerr )�file�linerrrr�source_synopsis�s&r�c
	Cs t�|�j}|�|d�\}}|dks.||k�r|�ttjj��rJtjj	}n |�ttjj
��rftjj}nd}|dkr�zt�
|�}Wntk
r�YdSX|�t|�}W5QRXn^|d|�}tjjd||d�}ztj�|�}	WnYdSXtjd=|	j�r|	j��dnd}||f||<|S)N)NNZ__temp__��loaderr)r
�stat�st_mtimerxrd�tuple�	importlib�	machinery�BYTECODE_SUFFIXES�SourcelessFileLoader�EXTENSION_SUFFIXES�ExtensionFileLoader�tokenize�open�OSErrorr��util�spec_from_file_location�
_bootstrap�_loadr�modulesrX�
splitlines)
�filename�cache�mtimeZ
lastupdaterZ
loader_clsr�r��spec�modulerrr�synopsis�s6



�r�c@seZdZdd�Zdd�ZdS)�ErrorDuringImportcCs||_|\|_|_|_dSr+)r��excrK�tb)r@r��exc_inforrrr�#szErrorDuringImport.__init__cCs|jj}d|j||jfS)Nzproblem in %s - %s: %s)r�r&r�rK)r@r�rrr�__str__'szErrorDuringImport.__str__N)r&r'rUr�r�rrrrr�!sr�c		Cs�tjj}t|d��}||�t|��k}W5QRXtj�|�}tj�	|�\}}|r`tj
�||�}ntj
�||�}tjj
|||d�}ztj�|�WSt|t����YnXdS)N�rbr�)r�r��MAGIC_NUMBERr��readr!r
r	�basename�splitext�_bootstrap_externalr��SourceFileLoaderr�r�r�r�rr�)	r	�magicr�Zis_bytecoder�r)r�r�r�rrr�
importfile+sr�c	s z^|rT�tjkrT�tjkrT�fdd�tjD�}�g|D]}tj|||<tj|=q8t��}Wnzt��\}}}}	�tjkr�ttj�j|	��n>|tkr�t|j|	��n(t	|t
�r�|j�kr�YdSt�t����YnX��d�dd�D].}
zt
||
�}Wq�tk
�rYdSXq�|S)Ncsg|]}|��d�r|�qS)r)rc)rs�m�r	rr�
<listcomp>Qszsafeimport.<locals>.<listcomp>rr)rr��builtin_module_names�
__import__r�r�r[�SyntaxErrorr��
issubclass�ImportErrorr)r r>�AttributeError)r	�	forceloadr�ZsubsrJr�r�rKr��info�partrr�r�
safeimport=s.


r�c@sfeZdZej�ddejdd��Zddd�Z	d
dd�Z
e
ZZZ
ZZZe�d	�fd
d�ZdS)�Doc�
PYTHONDOCSz%https://docs.python.org/%d.%d/libraryNrcGs�||f|}zFt�|�r$|j|�WSt�|�r:|j|�WSt�|�rP|j|�WSWntk
rfYnXt�|�r||j	|�S|j
|�Sr+)rr,�	docmoduler-�docclassr.�
docroutiner�rl�docdata�docother)r@rr)�argsrrr�documentss




zDoc.documentcGs*d|odt|�t|�jf}t|��dS)Nz.don't know how to document object%s of type %s� )�repr�typer&r)r@rr)r��messagerrr�fail�s
�zDoc.failZstdlibcCs�zt�|�}Wntk
r&d}YnXtj�d|j�}tj�|�}t	|t
t��r�|jdksz|�|�r�|�tj�
|d��s�|jdkr�|�d�r�d|�d�|j��f}q�tj�
||j��d	�}nd}|S)
N�
(built-in)r�)
�errno�
exceptionsZgcZimp�marshal�posix�signalr�_threadZ	zipimportz
site-packages)z	xml.etreeztest.pydoc_mod)zhttp://zhttps://z%s/%s�/�.html)r�
getabsfilerr
�environrxr�r	rrmr�r&rcr"r�lower)r@rZbasedirr��doclocrrr�	getdocloc�s(
����
z
Doc.getdocloc)N)N)r&r'rUr
r�rxr�version_infor�r�r�r�r�r�r��docpropertyr��	sysconfigZget_pathr�rrrrr�ms��

r�c@sDeZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZeZdd�Z	eZ
d
S)�HTMLReprcCs,t�|�d|_|_d|_d|_|_dS�N��
�d�rr��maxlist�maxtuple�maxdict�	maxstring�maxother�r@rrrr��s
zHTMLRepr.__init__cCst|dddddd�S)N�&z&amp;�<z&lt;�>z&gt;)r2�r@r1rrr�escape�szHTMLRepr.escapecCst�||�Sr+)rr��r@rrrrr��sz
HTMLRepr.reprcCsZtt|�d�r@dd�t|�j���}t||�r@t||�||�S|�ttt	|��|j
��S�Nr&�repr_ra)rer�r"r&r r>r�r7r:r�r��r@rP�levelZ
methodnamerrr�repr1�s

zHTMLRepr.repr1cCs^t||j�}t|�}d|krJdt|dd�krJd|d|�|�|dSt�dd|�|��S)Nr��\\r�rrz-((\\[\\abfnrtv\'"]|\\[0-9]..|\\x..|\\u....)+)z<font color="#c040c0">\1</font>)r7r�r�r2r�rr�r@rPr�ZtestZtestreprrrr�repr_string�s�zHTMLRepr.repr_stringcCs@z|�ttt|��|j��WS|�d|jj�YSXdS�Nz
<%s instance>)r�r7r:r�r��	__class__r&�r@rPr�rrr�
repr_instance�szHTMLRepr.repr_instanceN)r&r'rUr�r�r�r�r��repr_strrZrepr_unicoderrrrr��sr�c@s�eZdZe�ZejZejZdd�Zd0dd�Zd1d	d
�Z	dd�Z
d
d�Zd2dd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdiiifdd�Zd3d d!�Zd4d"d#�Zddiifd$d%�Zd&d'�Zddiiidfd(d)�Zd5d*d+�ZeZd6d,d-�Zd7d.d/�ZdS)8�HTMLDoccCsd||fS)Nz�<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: %s</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body bgcolor="#f0f0f8">
%s
</body></html>r)r@�title�contentsrrr�page�s�zHTMLDoc.pagercCsd|||||pdfS)Na'
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="%s">
<td valign=bottom>&nbsp;<br>
<font color="%s" face="helvetica, arial">&nbsp;<br>%s</font></td
><td align=right valign=bottom
><font color="%s" face="helvetica, arial">%s</font></td></tr></table>
    �&nbsp;r)r@r�fgcol�bgcolZextrasrrr�heading�s�zHTMLDoc.heading�Nrc	
Cs^|dkrdd|d}d|||f}	|r@|	d||||f}	n|	d|||f}	|	d|S)Nz<tt>rz</tt>z�<p>
<table width="100%%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="%s">
<td colspan=3 valign=bottom>&nbsp;<br>
<font color="%s" face="helvetica, arial">%s</font></td></tr>
    zR
<tr bgcolor="%s"><td rowspan=2>%s</td>
<td colspan=2>%s</td></tr>
<tr><td>%s</td>z(
<tr><td bgcolor="%s">%s</td><td>%s</td>z'
<td width="100%%">%s</td></tr></table>r)
r@rr	r
r�widthZpreludeZ
marginaliaZgaprrrr�section�s�
��zHTMLDoc.sectioncGsd|}|j|f|��S)Nz<big><strong>%s</strong></big>)r)r@rr�rrr�
bigsectionszHTMLDoc.bigsectionc
Cs&|�|���}t|dddddddd�	S)N�

z
 
r�rr�<br>
)r��
expandtabsr2r�rrr�	preformat
s�zHTMLDoc.preformatr�cCs�d}t|�|d|}t|�D]X}|dd|}t|||||�D]$}|t|�krJ||||�d}qJ|d}q d|S)Nrrz<td width="%d%%" valign=top>r�rz</td>z7<table width="100%%" summary="list"><tr>%s</tr></table>)r!�range)r@�list�formatZcolsr�rows�colrtrrr�multicolumns
zHTMLDoc.multicolumncCsd|S)Nz<font color="#909090">%s</font>rr�rrr�greyr|zHTMLDoc.greycGs*|D] }||krd|||fSq|S)N�<a href="%s">%s</a>r)r@r)Zdicts�dictrrr�namelinkszHTMLDoc.namelinkcCsN|jtj�|j�}}t||�rDt||�|krDd|j|t||�fSt||�S)Nz<a href="%s.html#%s">%s</a>)r&rr�rxr'rer>r*)r@rr(r)r�rrr�	classlink%s�zHTMLDoc.classlinkcCsd|j|jfS�Nz<a href="%s.html">%s</a>)r&r�rrr�
modulelink-szHTMLDoc.modulelinkcCsR|\}}}}|r|�|�S|r,d||f}nd|}|rBd|}n|}d||fS)Nz
%s.%s.htmlz%s.htmlz"<strong>%s</strong>&nbsp;(package)r)r)r@Z
modpkginfor)r	r��shadowed�urlr1rrr�
modpkglink1s

zHTMLDoc.modpkglinkcCsd||fS)Nz<a href="file:%s">%s</a>r)r@r"r	rrr�filelink@szHTMLDoc.filelinkcCs�|p|j}g}d}t�d�}|�||�}	|	s0�qh|	��\}
}|�||||
���|	��\}}
}}}}|
r�||��dd�}|�d||f�n�|r�dt|�}|�d|||�f�n�|r�dt|�}|�d|||�f�n�|�r"|||d�d	k�r|�d
|�	||��n|�d|�n@|||d�d	k�rP|�|�	||||��n|�|�	||��|}q|�|||d���d�
|�S)
NrzD\b((http|ftp)://\S+[\w/]|RFC[- ]?(\d+)|PEP[- ]?(\d+)|(self\.)?(\w+))�"z&quot;rz'http://www.rfc-editor.org/rfc/rfc%d.txtz(http://www.python.org/dev/peps/pep-%04d/r�(zself.zself.<strong>%s</strong>r)r�r�compile�search�spanr�groupsr2�intrr")r@r1r��funcs�classesrIrp�here�pattern�match�start�endrfZschemeZrfcZpepZselfdotr)r"rrr�markupDs:

zHTMLDoc.markupc
Cs�d}|D]�}t|�td�kr�|\}}|d}||�||�}|r�||fkr�g}|D]}	|�|�|	|��qR|dd�|�d}|d}qt|�tg�kr|d|�|||�}qd	|S)
Nrrz"<dt><font face="helvetica, arial">r&�, �)z
</font></dt>z
<dd>
%s</dd>
z
<dl>
%s</dl>
)r�rrr"�
formattree)
r@�treer(�parentr�entry�c�bases�parentsrLrrrr6os&
�
zHTMLDoc.formattreec#
s�|j}z
|j}Wntk
r(d}YnX|�d�}g}tt|�d�D],}|�dd�|d|d��||f�qHd�||dd��}	d|	}
z&t�	|�}t
j�|�}��
||�}
Wntk
r�d}
YnXg}t|d��r6t|j�}|dd�d	k�r"|dd�d
k�r"|dd���}|�d��|��t|d��rX|���t|j���|�rp|
d
d�|�}
��|�}|dk	�r�dt�}nd}��|
ddd|
|�}t�|tj�}gi}}t�|tj�D]Z\}}|dk	�s�t�|��p�||k�r�t|||��r�|�||f�d|||<||<�q�|D]�\}}|jD]n}|j|j}}tj �!|�}||k�r@|�r@t||��r@t"||�|k�r@||k�r@|d|||<||<�q@�q2gi}}t�|tj#�D]p\}}|dk	�s�t�$|��s�t�|�|k�r�t|||��r�|�||f�d|||<t�%|��r�||||<�q�g}t�|t&�D]&\}}t|||��rN|�||f��qN��'t(|��j)||�}|�o�d|}|d|}t|d��rg}t*�+|j,�D]\}}} |�||| df��q�|�-���.|�j/�}!|��0ddd|!�}n.|�r<��.|�fdd��}!|��0ddd|!�}|�r�d d!�|D�}"��1t�2|"d�|�g}!|D]"\}}|!���3|||||���qj|��0d"dd#d$�|!��}|�r�g}!|D]"\}}|!���3|||||���q�|��0d%dd&d$�|!��}|�r:g}!|D]\}}|!���3||���q|��0d'dd(d)�|!��}t|d*��rn��'t|j4��j)�}!|��0d+dd|!�}t|d,��r���'t|j5��j)�}!|��0d-dd|!�}|S).Nrrz5<a href="%s.html"><font color="#ffffff">%s</font></a>r��)<big><big><strong>%s</strong></big></big>r�rZ��$Revision: �$z
version %srSz (%s)r4z-<br><a href="%(docloc)s">Module Reference</a>r�#ffffff�#7799eez<a href=".">index</a><br>r�z.html#z#-z<tt>%s</tt>z
<p>%s</p>
rTrzPackage Contentsz#aa55cccs��|d�SrB)r ��tr�rrr{�r|z#HTMLDoc.docmodule.<locals>.<lambda>ZModulescSsg|]\}}|�qSrr�rsrJrKrrrr��sz%HTMLDoc.docmodule.<locals>.<listcomp>ZClasses�#ee77aar�Z	Functionsz#eeaa77ZDataz#55aa55rrYZAuthorrWZCredits)6r&�__all__r�r rr!rr"rr��urllib�parseZquoter$rre�strrZrr�rSr��localsrrCr,r-�	getmodulerhrDr'rr�rxr>r.r=�
isfunctionr0r3rr�pkgutil�iter_modulesrTr�rr#rr6�getclasstreer�rYrW)#r@rr)�mod�ignoredrf�partsZlinksrtZ
linkedname�headr	r"r$r��versionr�rr�r-ZcdictrJrKrLr(r�r,Zfdict�datar#�modpkgs�importer�ispkgr�	classlistrr�rr��s*


��


$


�

�

 

���
��������zHTMLDoc.docmodulec	s��j}|p|}�j}g}	|	j�G�fdd�d�}
|
��tt����}t|�dkr�����d�|D]}�d��|�j	��qd�d���������fdd�}
����fd	d
�}��������fdd�}�fd
d�t
��D�}i�|D]n\}}}}d|d|�|<}zt�|�}Wntk
�r4YnXz|�|<Wq�t
k
�rXYq�Xq�|�rj|�rr|���n|dd�t|�fdd��\}}�tjk	�r��tjk�r�|}�q\n"��k�r�d}nd����j	�}|d7}t|��|
d||dd��}|
d||dd��}|
d||dd��}|d||dd��}|d||d d��}|d!||d"d��}|}�q\d#�|	�}	||k�r�d$||f}nd%|||f}|�r�g}|D]}|���|�j	���q�|d&d'�|�}d#}zt���}Wntt
fk
�rd}YnX|�r8t|�}|�r8|d(k�r8|��|�d)}t��}|�rT||�pPd#}��|�j����}|�otd*|}��|d+d,|	d-|�S).Ncs eZdZdd�Z�fdd�ZdS)z(HTMLDoc.docclass.<locals>.HorizontalRulecSs
d|_dSrw�Zneedoner�rrrr�sz1HTMLDoc.docclass.<locals>.HorizontalRule.__init__cs|jr�d�d|_dS)Nz<hr>
rr[r���pushrr�maybe	sz.HTMLDoc.docclass.<locals>.HorizontalRule.maybeN�r&r'rUr�r^rr\rr�HorizontalRulesr`rz&<dl><dt>Method resolution order:</dt>
z<dd>%s</dd>
�</dl>
cs�t||�\}}|r�����|�|D]d\}}}}zt�|�}Wn&tk
rf���||���YnX���||��������d�q&|S)Nr�rQr^r>�	Exceptionr�r���msgr�rO�okr)rq�homeclsrK�r-r,�hr�mdictrQrr]r@rr�spills"�
zHTMLDoc.docclass.<locals>.spillcsJt||�\}}|rF����|�|D]\}}}}���||���q&|Sr+�rQr^r�rd�rirQr]r@rr�spilldescriptors+sz*HTMLDoc.docclass.<locals>.spilldescriptorsc
s�t||�\}}|r�����|�|D]�\}}}}��t�|�|��}t|�sXt�|�rft|dd�}	nd}	|	dkr��d|�n0��t|��j	����}	d|	}	�d||	f��d�q&|S)NrXz<dl><dt>%s</dl>
z<dd><tt>%s</tt>z<dl><dt>%s%s</dl>
r)
rQr^r�r>�callablerrlr3rr)
rer�rOrfr)rqrgrKrLr#rhrr�	spilldata4s(�
z#HTMLDoc.docclass.<locals>.spilldatacs,g|]$\}}}}t|�d�r||||f�qS�)rg�rh�rsr)rqrrrKr/rrr�Is
�z$HTMLDoc.docclass.<locals>.<listcomp>r��-rcs|d�kS�NrrrC��	thisclassrrr{br|z"HTMLDoc.docclass.<locals>.<lambda>�defined here�inherited from %sz:<br>
z
Methods %scSs|ddkS�Nr�methodrrCrrrr{rr|zClass methods %scSs|ddkS�Nrzclass methodrrCrrrr{tr|zStatic methods %scSs|ddkS�Nrz
static methodrrCrrrr{vr|zReadonly properties %scSs|ddkS�NrrjrrCrrrr{xr|zData descriptors %scSs|ddkS�NrrirrCrrrr{zr|zData and other attributes %scSs|ddkS�NrrVrrCrrrr{|r|rz*<a name="%s">class <strong>%s</strong></a>z/<strong>%s</strong> = <a name="%s">class %s</a>�(%s)r4�()rz<tt>%s<br>&nbsp;</tt>z#000000z#ffc8d8r3)r&rDrrr�getmror!r^rr'rkr>rcr�popleftrQ�builtinsrr�r"�	signature�
ValueErrorrJr�rr3rr)r@rr)rQr,r-rR�realnamer;rr`�mrorLrkrnrpr�rJrqrgrK�anchor�	inherited�tagrr<�declr��argspecr#r)	r-r,rirjrQrr]r@rwrr��s�
�
	
�

�

�
�
�
�
�
�

��
zHTMLDoc.docclasscCs|�d|�|��S�N�=)rr�r�rrr�formatvalue�szHTMLDoc.formatvaluec	Cs�|j}|p|}|r|jpdd|}	d}
d}t|�r�|jj}|rZ||k	r�d|�||�}
n0|jdk	rzd|�|jj|�}
nd|�||�}
t�|�s�t�|�r�d}
nd}
||kr�d|	|f}nD|r�t�||g�|kr�d	|jd||f}d
}n|}d|	||f}d}t�	|��rlzt�
|�}Wnttfk
�r>d}YnX|�rlt
|�}|dk�rld
|}|d
d�}|�svd}|
||�|�|
�o�|�d|
�}|�r�d|S|�t|�|j|||�}|�o�d|}d||fSdS)Nrrtr� from � method of %s instance� unbound %s method�async z$<a name="%s"><strong>%s</strong></a>z<a href="#%s">%s</a>rz)<a name="%s"><strong>%s</strong></a> = %s�<lambda>z$<strong>%s</strong> <em>lambda</em> r��(...)z'<font face="helvetica, arial">%s</font>z<dl><dt>%s</dt></dl>
z<dd><tt>%s</tt></dd>z<dl><dt>%s</dt>%s</dl>
)r&rAr;rrr�iscoroutinefunction�isasyncgenfunction�getattr_staticr.r�r�rrJr�rr3rr)r@rr)rQr,r-rIrHr�r��note�skipdocs�imclass�asyncqualifierrZreallinkr�r�r�r#rrrr��s|
�
���

��zHTMLDoc.docroutinecCsNg}|j}|r|d|�|�t|�|j�}|r<|d|�|d�d�|�S)Nz!<dl><dt><strong>%s</strong></dt>
z<dd><tt>%s</tt></dd>
rar)rr3rrr"�r@rr)rQrHrpr]r#rrrr��szHTMLDoc.docdatacGs|rd|pd}||�|�S)Nz<strong>%s</strong> = r�r�)r@rr)rQrRZlhsrrrr��szHTMLDoc.docothercCs�g}|dkri}t�|g�D]<\}}}tdd�|D��r:q|�|d|||kf�d||<q|��|�||j�}|�|dd|�S)Ncss*|]"}dt|�kodknVqdS)i�i��N)�ord�rsZchrrr�	<genexpr>�sz HTMLDoc.index.<locals>.<genexpr>rrrArF)rNrO�anyrr�rr#r)r@rr!rWrXr)rYrrrr�index�s
z
HTMLDoc.index)r)rrNr)r�)N)NN)NNN)NN)N)r&r'rUr��_repr_instancer�r�rrrrrrrrrr r#r$r3r6r�r�r�r�r�r�r�r�rrrrr�sF

�

+

y&�
A

rc@s0eZdZdd�Zdd�Zdd�ZeZdd�Zd	S)
�TextReprcCs,t�|�d|_|_d|_d|_|_dSr�r�r�rrrr�
s
zTextRepr.__init__cCsTtt|�d�r@dd�t|�j���}t||�r@t||�||�Sttt|��|j	�Sr�)
rer�r"r&r r>r7r:r�r�r�rrrr�s

zTextRepr.repr1cCsHt||j�}t|�}d|krDdt|dd�krDd|d||dS|S)Nr�r�rr�r)r7r�r�r2r�rrrr�s
zTextRepr.repr_stringcCs4zttt|��|j�WSd|jjYSXdSr�)r7r:r�r�rr&rrrrr%szTextRepr.repr_instanceN)r&r'rUr�r�r�rrrrrrr�s
	r�c@szeZdZe�ZejZdd�Zddd�Zdd�Zdd
d�Z	ddd
�Z
ddd�Zdd�Zddd�Z
ddd�ZeZddd�ZdS)�TextDoccCsd�dd�|D��S)Nrcss|]}|d|VqdS)�Nrr�rrrr�5szTextDoc.bold.<locals>.<genexpr>)r"r�rrr�bold3szTextDoc.bold�    cs>|sdS�fdd�|�d�D�}|r4|d��|d<d�|�S)Nrcsg|]}�|�qSrr�rsr���prefixrrr�:sz"TextDoc.indent.<locals>.<listcomp>rr�)r rr")r@r1r�r$rr�r�indent7szTextDoc.indentcCs$|�|���}|�|�d|dS)Nrr)r�rr�)r@rrZclean_contentsrrrr>szTextDoc.sectionNrc
	s�d}|D]�}t|�td�krr|\}}||t|��}|rh||fkrh�fdd�|D�}	|dd�|	�}|d}qt|�tg�kr||�|�||d�}q|S)	Nrrc3s|]}t|��VqdSr+�r*)rsr:�r(rrr�Msz%TextDoc.formattree.<locals>.<genexpr>r�r4rr�)r�r*r"r6)
r@r7r(r8r�rr9r:r;r<rr�rr6Es"
�zTextDoc.formattreec	Cs$|j}tt|��\}}|�d||o(d|�}t|dd�}|�|�}|dk	r`||�d|d�}|rt||�d|�}g}	t�|tj�D]<\}
}|dk	s�t�	|�p�||kr�t
|
||�r�|	�|
|f�q�g}t�|tj�D]F\}
}|dk	�st�
|��st�	|�|kr�t
|
||�r�|�|
|f�q�g}
t�|t�D]&\}
}t
|
||��r.|
�|
|f��q.g}t�}t|d��r�t�|j�D]6\}}}|�|�|�r�|�|d�n
|�|��qx|��||�d	d
�|��}g}t�|tj�D]0\}
}|j�|d��r�|
|k�r�|�|
��q�|�r6|��||�dd
�|��}|	�r�d
d�|	D�}|�t�|d�|�g}|	D]\}
}|�|�||
|���qd||�dd
�|��}|�r�g}|D]\}
}|�|�||
|���q�||�dd
�|��}|
�r&g}|
D]"\}
}|�|j||
|dd���q�||�dd
�|��}t|d��r�t|j�}|dd�dk�rp|dd�dk�rp|dd���}||�d|�}t|d��r�||�dt|j ��}t|d��r�||�dt|j!��}t|d��r�||�d t|j"��}zt�#|�}Wnt$k
�rd!}YnX||�d"|�}|S)#N�NAME� - rGzMODULE REFERENCEa.

The following documentation is automatically generated from the Python
source files.  It may be incomplete, incorrect or include features that
are considered implementation detail and may vary between Python
implementations.  When in doubt, consult the module reference at the
location listed above.
ZDESCRIPTIONrT�
 (package)zPACKAGE CONTENTSrrZ
SUBMODULEScSsg|]\}}|�qSrrrErrrr��sz%TextDoc.docmodule.<locals>.<listcomp>r�CLASSES�	FUNCTIONS�F)r6ZDATArZr>r?r�r@ZVERSIONrSZDATErYZAUTHORrWZCREDITSr�ZFILE)%r&r%rrr>r�rrCr-rLrhrr.r=r0�setrerNrOrT�addr�r"r,rcr6rPr�r�rJrZrrSrYrWr�r)r@rr)rQZsynop�descrrfr�r-rJrKr,rVrWZ
modpkgs_namesrXr(rYZ
submodulesrZrrUr�rrrr�Us�
	�
��
��
�
$
zTextDoc.docmodulec	sL�j}|p|}�j}�jfdd�}||kr:d��|�}n��|�d|}|rlt||�}	|dd�|	�}g}
|
j�zt���}Wnt	t
fk
r�d}YnX|r�t|�}|r�|dkrʈ||d�t��}
|
r�|
d�t
t����}t|�d	k�r*�d
�|D]}�d||���q
�d�td
d�t���D�tjd�}t|�}d}|�r��d�|d|�D]}�d|��qn||k�r��dt||�d��d�G�fdd�d�}|�������fdd�}����fdd�}�����fdd�}�fdd�t��D�}|�r|�r*|���n|dd	�t|�fdd ��\}}�tjk	�rn�tjk�rn|}�qn ��k�r~d!}nd"t��j�}t|��|d#||d$d ��}|d%||d&d ��}|d'||d(d ��}|d)||d*d ��}|d+||d,d ��}|d-||d.d ��}|}�qd�|
�}
|
�s0|dS|d��|
��d/�dS)0NcSs
t||�Sr+r�)r:r�rrr�makename�sz"TextDoc.docclass.<locals>.makename�class z	 = class r�r4r�rrzMethod resolution order:r�rcss.|]&}|j�d�s|jdkrt|j�VqdS)rar�N)r&rcr'rJ)rsrrrrrr��s
�z#TextDoc.docclass.<locals>.<genexpr>r}r�zBuilt-in subclasses:z    ... and z other subclassescs eZdZdd�Z�fdd�ZdS)z(TextDoc.docclass.<locals>.HorizontalRulecSs
d|_dSrwr[r�rrrr��sz1TextDoc.docclass.<locals>.HorizontalRule.__init__cs|jr�d�d|_dS)NzF----------------------------------------------------------------------rr[r�r\rrr^�sz.TextDoc.docclass.<locals>.HorizontalRule.maybeNr_rr\rrr`�sr`c
s�t||�\}}|r~����|�|D]V\}}}}zt�|�}Wn&tk
rf���||���Yq&X���||����q&|Sr+rbrd�rirQrr]r@rrrk�s�zTextDoc.docclass.<locals>.spillcsJt||�\}}|rF����|�|D]\}}}}���||���q&|Sr+rlrdrmrrrnsz*TextDoc.docclass.<locals>.spilldescriptorsc
	s�t||�\}}|r�����|�|D]v\}}}}t|�sDt�|�rNt|�}nd}zt�|�}	Wntk
r~|j|}	YnX��j	|	|�d|d�d�q&|S)Nr�)r6r#r)
rQr^rorrlrr>r��__dict__r�)
rer�rOrfr)rqrgrKr#rgr�rrrps 
�z#TextDoc.docclass.<locals>.spilldatacs,g|]$\}}}}t|�d�r||||f�qSrqrrrsr/rrr�+s
�z$TextDoc.docclass.<locals>.<listcomp>rcs|d�kSrurrCrvrrr{4r|z"TextDoc.docclass.<locals>.<lambda>rxryzMethods %s:
cSs|ddkSrzrrCrrrr{Cr|zClass methods %s:
cSs|ddkSr|rrCrrrr{Er|zStatic methods %s:
cSs|ddkSr}rrCrrrr{Gr|zReadonly properties %s:
cSs|ddkSr~rrCrrrr{Ir|zData descriptors %s:
cSs|ddkSrrrCrrrr{Kr|zData and other attributes %s:
cSs|ddkSr�rrCrrrr{Mr|z |  )r&rDr'r��mapr"rrr�r�rrJrrr�r!�sortedr��__subclasses__r�rkr�rQr�rr*r�r�r)r@rr)rQrRr�r;r�rr<rr�r�r#r�rLZ
subclassesZno_of_subclassesZMAX_SUBCLASSES_TO_DISPLAYZsubclassnamer`rkrnrpr�r�r�r)rirQrr]r@rwrr��s�

�

��	
�

�

�
�
�
�
�
�
zTextDoc.docclasscCsd|�|�Sr�r�r�rrrr�WszTextDoc.formatvaluec	Cs�|j}|p|}d}d}t|�rn|jj}|rB||k	rndt||�}n,|jdk	r`dt|jj|�}ndt||�}t�|�s�t�|�r�d}	nd}	||kr�|�|�}
n,|r�t�	||g�|kr�d}|�|�d|}
d}t�
|��r<zt�|�}Wntt
fk
�rd}YnX|�r<t|�}|d	k�r<|�|�d
}
|dd�}|�sFd}|	|
||}
|�rd|
d
St|��ppd}|
d
|�o�|�|���d
SdS)Nrrr�r�r�r�r� = r�z lambda r�r�r)r&rAr;rr*rr�r�r�r�r.r�r�rrJrr�r)r@rr)rQrHr�r�r�r�r�rr�r�r�r#rrrr�[sV
�
�

zTextDoc.docroutinecCsTg}|j}|r$||�|��|d�t|�p.d}|rJ||�|��|d�d�|�S)Nrr)rr�rr�r"r�rrrr��szTextDoc.docdatac
Cs�|�|�}|rF|r|dpd|}|t|�}	|	dkrF|d|	�d}|rX|�|�dpZd|}|dk	r~|d|�t|��7}|S)Nr�rrr4r)r�r!r�r�rJ)
r@rr)rQr8r6r#r�r�Zchoprrrr��s
zTextDoc.docother)r�)Nr)NN)NN)NNN)NNN)NNNNN)r&r'rUr�r�r�r�r�rr6r�r�r�r�r�r�r�rrrrr�+s


e

7
r�c@seZdZdd�ZdS)�
_PlainTextDoccCs|Sr+rr�rrrr��sz_PlainTextDoc.boldN)r&r'rUr�rrrrr��sr�cCst�at|�dSr+)�getpager�pagerr9rrrr��sr�c	s@ttjd�stSttjd�s tStj��r4tj��s8tStj�d�pNtj�d���r�tj	dkrj�fdd�Stj�d�dkr��fd	d�S�fd
d�Stj�d�dkr�tStj	dkr�dd�Sttd�r�t�
d
�dkr�dd�Sddl}|��\}}t�
|�z8ttd��r$t�
d|�dk�r$dd�W�StW�SW5t�|�XdS)N�isattyZMANPAGERZPAGER�win32cstt|���Sr+��
tempfilepager�plainr9�Z	use_pagerrrr{�r|zgetpager.<locals>.<lambda>ZTERM)ZdumbZemacscstt|���Sr+)�	pipepagerr�r9r�rrr{�r|cs
t|��Sr+�r�r9r�rrr{�r|cSstt|�d�S)Nzmore <r�r9rrrr{�r|�systemz(less) 2>/dev/nullrcSs
t|d�S)NZlessr�r9rrrr{�r|z	more "%s"cSs
t|d�S)NZmorer�r9rrrr{�r|)rer�stdin�
plainpager�stdoutr�r
r�rx�platformr��tempfileZmkstemp�close�unlink�ttypager)r��fdr�rr�rr��s6


 r�cCst�dd|�S)Nz.r)rrr9rrrr��sr�c	Cs�ddl}|j|d|jd�}zDtj|jdd��*}z|�|�Wntk
rPYnXW5QRXWntk
rrYnXz|�	�Wq�Wqttk
r�YqtXqtdS)NrT)�shellr��backslashreplace)�errors)
�
subprocess�Popen�PIPE�io�
TextIOWrapperr��write�KeyboardInterruptr��wait)r1�cmdr��proc�piperrrr��sr�c
Cs~ddl}|���d}tj�|d�}t|ddtjdkr<t�d�ndd��}|�	|�W5QRXt�
|d|d�W5QRXdS)	Nrz	pydoc.out�wr�r�)r��encodingz "r%)r�ZTemporaryDirectoryr
r	r"r�rr��device_encodingr�r�)r1r�r�Ztempdirr�r�rrrr��s
��r�cCs$ttjdd�pd}|�|d��|�S)Nr��utf-8r�)r>rr��encode�decode)r1r�rrr�_escape_stdoutsr�c
Cs�tt|���d�}z2ddl}tj��}|�|�}|�|�dd�}Wn(t	t
tjfk
rld}dd�}YnX�z0zttj�dd��}Wntk
r�d}YnX|dkr�d}|d}}tj�d�|d|��d�||d��r�tj�d	�tj��|�}	|	d
k�rtj�d��q�n,|	dk�rJtj�d||d�|d}q�|	d
k�rn|||}|dk�rnd}tj�dd�||||��d�||}q�W5|�r�|�
||j|�XdS)NrrcSstj�d�SrB)rr�r�rrrrr{r|zttypager.<locals>.<lambda>cSstj��dd�dd�S)Nr�r)rr�r�rrrrr{r|ZLINESr�z
-- more --)�q�Qz
          
)�
r)�b�B�)r�r�r �ttyrr��filenoZ	tcgetattrZ	setcbreakr�r�r��UnsupportedOperationZ	tcsetattrZ	TCSAFLUSHr+r
r�rxr�r�r�r"�flush)
r1r$r�r��oldZgetchar�hr�Zincr:rrrr�	sL








&r�cCstj�tt|���dSr+)rr�r�r�r�r9rrrr�5sr�cCs�t�|�r>|jtjkr d|jSt|d�r4d|jSd|jSt�|�rRd|jSt�|�rtd|jj	|jj|jfSt�
|�r�d|jj	|jj|jfSt�|�r�d|jSt�|�r�d	|jSt�
|�r�d
|jSt|�jS)Nzbuilt-in module rTzpackage zmodule zbuilt-in function zgetset descriptor %s.%s.%szmember descriptor %s.%s.%sr�z	function zmethod )rr,r&rr�rer=Zisgetsetdescriptor�__objclass__r'Zismemberdescriptorr-rMr<r�)�thingrrr�describe9s6







�
�





r�c	Cs�dd�|�d�D�}d\}}|t|�kr\td�|d|d��|�}|r\||d}}qq\q|rf|}nt}||d�D],}zt||�}Wqvtk
r�YdSXqv|S)NcSsg|]}|r|�qSrr)rsr�rrrr�Vszlocate.<locals>.<listcomp>rrwr)r r!r�r"r�r>r�)r	r�rSr��nZ
nextmodulerr�rrr�locateTs r�cCsVt|t�r0t||�}|dkr(td|��||fSt|dd�}|t|t�rL|ndfSdS)Nz~No Python documentation found for %r.
Use help() to get the interactive help utility.
Use help(str) for help on the str class.r&)rmrJr�r�r>)r�r�rr)rrr�resolvems

�r�� Python Library Documentation: %scCs�|dkrt}t||�\}}t|�}t�|�}|rTd|krT|d|d|�d��7}n|rn||k	rn|d|j7}t�|�s�t�|�s�t�	|�s�t�
|�s�t|�}|d7}||d|�||�S)Nrz in z in module z objectr)
r1r�r�rrL�rfindr&r,r-r.rlr�r�)r�rr�Zrendererrr)r�r�rrr�
render_doc{s&

���rc
Csfz2|dkrtt|||��n|�t|||t��Wn.ttfk
r`}zt|�W5d}~XYnXdSr+)r�rr��	plaintextr�r��print)r�rr��outputrKrrrr#�sr#c
Cs�z`t||�\}}t�t|�t�||��}t|dddd��}|�|�W5QRXtd|d�Wn.tt	fk
r�}zt|�W5d}~XYnXdS)Nr�r�r�)r�Zwrote)
r��htmlrr�r�r�r�rr�r�)r�r�rr)rr�rKrrr�writedoc�srrcCs2|dkri}t�|g|�D]\}}}t|�qdSr+)rN�
walk_packagesr)r�pkgpathZdonerXr(rYrrr�	writedocs�s

r
cJ@s"eZdZddddddddddd	d
ddd
ddddddddddddddddddddd�#Zd d!�d"D�Zd�e�d'd(d)d*d+d,d-�Zd.d/d0d1d2d3d4d5d6d7d8d9d9d:d:d;�Ze��D]:\ZZ	e	D],Z
e�e
e�Zeekr�ed<eZeee
<q�q�d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdLdMdNdOdPdQddRdSdSdTdUdVdWdXdYdZd[d\d]d^d_d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{ddd|d}d~dd��IZd�d�d��Z
ed�d���Zed�d���Zd�d��Ze�Zefd�d��Zd�d��Zd�d��Zd�d��Zd�d��Zd�d�d��Zd�d��Zd�d��Zd�d��Zd�d�d��Zd�d�d��Zd�d��Zd�d�d��Z d�S)��Helperr�BOOLEAN�with)�assertr)�asyncr)�awaitr)�break�	while for)�classzCLASSES SPECIALMETHODS)�continuer)Zfunctionr)�del�BASICMETHODS�if)�elser�try)�forzbreak continue while�import)�globalznonlocal NAMESPACES)r�
TRUTHVALUE)r�MODULES)�in�SEQUENCEMETHODS�
COMPARISON)�lambdar�)�nonlocalzglobal NAMESPACES)�passr)�raise�
EXCEPTIONS)�returnr�)rr&)�whilezbreak continue if TRUTHVALUE)r
z CONTEXTMANAGERS EXCEPTIONS yield)�yieldr)#�False�None�True�and�asrrrrrr�defr�elifr�except�finallyr�fromrrrr�isr"r#�not�orr$r%r'rr(r
r)cCsg|]}dD]}||�qqS)��'r%r)rs�pr�rrrr��szHelper.<listcomp>)r��fr��ur8�'''r%r�)�+rt�*�**r�z//�%�<<�>>r��|�^�~r�r��<=�>=�==�!=�<>)r�r�rFrGrHrIrJ)rtrE)z+=z-=z*=z/=z%=z&=z|=z^=z<<=z>>=z**=z//=)rArBr�rCrDrE)�j�J)�STRINGS�	OPERATORSr!�UNARY�AUGMENTEDASSIGNMENT�BITWISE�COMPLEXzOPERATORS FORMATTING�POWERzTUPLES LISTS FUNCTIONSz ATTRIBUTES FLOAT MODULES OBJECTS�ELLIPSISzSLICINGS DICTIONARYLITERALSz	def classrM�PRIVATENAMESzPRIVATENAMES SPECIALMETHODSZ
BACKQUOTESzTUPLES FUNCTIONS CALLSzLISTS SUBSCRIPTS SLICINGS)r@r?�,rr4�:�@r�rar`�`r&r5�[�]r�)�typeszRSTRINGS UNICODE NUMBERS SEQUENCES MAPPINGS FUNCTIONS CLASSES MODULES FILES inspect)�stringsz4str UNICODE SEQUENCES STRINGMETHODS FORMATTING TYPES)zstring-methodszSTRINGS FORMATTING)Z
formatstringsrN)r]z:encodings unicode SEQUENCES STRINGMETHODS FORMATTING TYPES)ZnumberszINTEGER FLOAT COMPLEX TYPES)Zintegersz	int range)Zfloatingz
float math)Z	imaginaryz
complex cmath)Ztypesseqz$STRINGMETHODS FORMATTING range LISTS�DICTIONARIES)Ztypesfunctionsz	def TYPES)Ztypesmethodszclass def CLASSES TYPES)zbltin-code-objectszcompile FUNCTIONS TYPES)zbltin-type-objectsztypes TYPES�TYPES)zbltin-null-objectr)zbltin-ellipsis-object�SLICINGS)Zspecialattrsr)r\z!class SPECIALMETHODS PRIVATENAMES)Ztypesmodulesr)zoperator-summaryz�lambda or and not in is BOOLEAN COMPARISON BITWISE SHIFTING BINARY FORMATTING POWER UNARY ATTRIBUTES SUBSCRIPTS SLICINGS CALLS TUPLES LISTS DICTIONARIES�EXPRESSIONS)Zobjectsr_)ZspecialnameszbBASICMETHODS ATTRIBUTEMETHODS CALLABLEMETHODS SEQUENCEMETHODS MAPPINGMETHODS NUMBERMETHODS CLASSES)Z
customizationzhash repr str SPECIALMETHODS)zattribute-accesszATTRIBUTES SPECIALMETHODS)zcallable-typeszCALLS SPECIALMETHODS)�sequence-typesz(SEQUENCES SEQUENCEMETHODS SPECIALMETHODS)rbzMAPPINGS SPECIALMETHODS)z
numeric-typesz*NUMBERS AUGMENTEDASSIGNMENT SPECIALMETHODS)Z	execmodelz%NAMESPACES DYNAMICFEATURES EXCEPTIONS)Znamingz3global nonlocal ASSIGNMENT DELETION DYNAMICFEATURES)zdynamic-featuresr�
NAMESPACES)r�ztry except finally raise)Zconversionsr)Zidentifierszkeywords SPECIALIDENTIFIERS)z
id-classesr)zatom-identifiersr)z
atom-literalsz=STRINGS NUMBERS TUPLELITERALS LISTLITERALS DICTIONARYLITERALS�	SEQUENCES)Z	exprlistszTUPLES LITERALS)ztypesseq-mutable�LISTLITERALS)ZlistszLISTS LITERALS)Ztypesmapping�DICTIONARYLITERALS)rzDICTIONARIES LITERALS)zattribute-referencesz(getattr hasattr setattr ATTRIBUTEMETHODS)Z
subscriptionsr )Zslicingsr )Zcallsra)Zpowerra)Zunaryra)Zbinaryra)Zshiftingra)Zbitwisera)ZcomparisonszEXPRESSIONS BASICMETHODS)ZbooleanszEXPRESSIONS TRUTHVALUEr)Z
assignmentrP)Z	augassign�
NUMBERMETHODSrr')Zcompoundzfor while break continue)�truthz if while and or not BASICMETHODS)ZdebuggerZpdb)zcontext-managersr
)Ir_rMZ
STRINGMETHODSZ
FORMATTING�UNICODEZNUMBERSZINTEGERZFLOATrRrdZMAPPINGSr�ZMETHODSZCODEOBJECTSZTYPEOBJECTSZFRAMEOBJECTSZ
TRACEBACKSZNONErTZSPECIALATTRIBUTESr�rZPACKAGESrarNZ
PRECEDENCEZOBJECTSZSPECIALMETHODSrZATTRIBUTEMETHODSZCALLABLEMETHODSr ZMAPPINGMETHODSrgZ	EXECUTIONrcZDYNAMICFEATURESZSCOPINGZFRAMESr&ZCONVERSIONSZIDENTIFIERSZSPECIALIDENTIFIERSrUZLITERALSZTUPLESZ
TUPLELITERALSZLISTSrer^rfZ
ATTRIBUTESZ
SUBSCRIPTSr`ZCALLSrSrOZBINARYZSHIFTINGrQr!rZ	ASSERTIONZ
ASSIGNMENTrPZDELETIONZ	RETURNINGZ	IMPORTINGZCONDITIONALZLOOPINGrZ	DEBUGGINGZCONTEXTMANAGERSNcCs||_||_dSr+)�_input�_output)r@�inputrrrrr�^szHelper.__init__cCs|jp
tjSr+)rjrr�r�rrrrlbszHelper.inputcCs|jp
tjSr+)rkrr�r�rrrrfsz
Helper.outputcCs2t��dddkr|�dSd|jj|jjfS)Nrr3�?rz<%s.%s instance>)r�stackrr'rUr�rrr�__repr__js�zHelper.__repr__cCs6||jk	r|�|�n|��|��|j�d�dS)Na
You are now leaving help and returning to the Python interpreter.
If you want to ask for help on a particular object directly from the
interpreter, you can type "help(object)".  Executing "help('string')"
has the same effect as typing a particular string at the help> prompt.
)�_GoInteractiver�intro�interactrr��r@Zrequestrrr�__call__rs

zHelper.__call__c	Cs�|j�d�z|�d�}|s Wq�Wnttfk
r>Yq�YnX|��}t|�dkr�|d|dkrpdkr�nn |d|dd�kr�|dd�}|��dkr�q�|d	kr�|��q|�	|�qdS)
Nrzhelp> rrr�r7r)r��quitr)
rr��getliner��EOFErrorrr!r�rqrrsrrrrrs"

,�
zHelper.interactcCs8|jtjkrt|�S|j�|�|j��|j��SdSr+)rlrr�rr�r�r�)r@�promptrrrrv�s

zHelper.getlinecCs<t|�td�k�r|��}|dkr,|��n�|dkr>|��n�|dkrP|��n�|dkrb|��n�|dd�dkr�|�|��d�n�||jkr�|�|�nj|d	kr�t	t
|�d
�nR||jkr�|�|�n<||j
kr�|�|�n&|r�t	|d
|jd�nt	td
|jd�n$t|t��r|�nt	|d
|jd�|j�d�dS)
Nr�keywords�symbols�topicsr��zmodules r)r,r*r+zHelp on %s:)rr)r�r�listkeywords�listsymbols�
listtopics�listmodulesr rz�
showsymbolr#�evalry�	showtopicr{rkrJrmrrr�rsrrrr�s6






zHelper.helpcCs$|j�d�dtjdd���dS)Na�
Welcome to Python {0}'s help utility!

If this is your first time using Python, you should definitely check out
the tutorial on the Internet at https://docs.python.org/{0}/tutorial/.

Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules.  To quit this help utility and
return to the interpreter, just type "quit".

To get a list of available modules, keywords, symbols, or topics, type
"modules", "keywords", "symbols", or "topics".  Each module also comes
with a one-line summary of what it does; to list the modules whose name
or summary contain a given string such as "spam", type "modules spam".
z%d.%dr)rr�rrr�r�rrrrq�s
�zHelper.intror��Pc	
Cs�tt|��}||}t|�|d|}t|�D]v}t|�D]\}|||}|t|�kr<|j�||�||dkr<|j�dd|dt||��q<|j�d�q0dS)Nrr�r)rr�r!rrr�)	r@�items�columnsr
Zcolwr�rowrrtrrrr�s&zHelper.listcCs |j�d�|�|j���dS)NzN
Here is a list of the Python keywords.  Enter any keyword to get more help.

)rr�rryrGr�rrrr}�szHelper.listkeywordscCs |j�d�|�|j���dS)Nzx
Here is a list of the punctuation symbols which Python assigns special meaning
to. Enter any symbol to get more help.

)rr�rrzrGr�rrrr~�szHelper.listsymbolscCs |j�d�|�|j���dS)NzN
Here is a list of available topics.  Enter any topic name to get more help.

)rr�rr{rGr�rrrr�szHelper.listtopicscCs0zddl}Wn"tk
r.|j�d�YdSX|j�||j�|��}|sb|j�dt|��dSt|�td�kr~|�	||�S|\}}z|jj|}Wn*t
k
r�|j�dt|��YdSX|��d}|r�|p�dd|}|�r$ddl}dd�
|���d}	|�|	d	�}
|d
d�
|
�7}t|�dS)Nr�t
Sorry, topic and keyword documentation is not available because the
module "pydoc_data.topics" could not be found.
zno documentation found for %s
rrr��Related help topics: r4�Hz
%s
)�pydoc_data.topicsr�rr�r{rxryr�r�r��KeyErrorr�textwrapr"r Zwrapr�)r@�topic�
more_xrefs�
pydoc_data�target�label�xrefsr#r�r1Zwrapped_textrrrr��s4zHelper.showtopiccCs�zddl}Wntk
r"YdSX|j�||j�|��}|sFtd��t|t�r\|�||�S|\}}|jj|}|r�|pzdd|}||fS)Nr)r�rzcould not find topicrr�)	r�r�r{rxryr�rmrJ�	_gettopic)r@r�r�r�r�r�r�r#rrrr�s	
zHelper._gettopiccCs*|j|}|�d�\}}}|�||�dS)Nr�)rz�	partitionr�)r@�symbolr�r�rar�rrrr�!s
zHelper.showsymbolcsv|r |j�d�|��t|�nR|j�d�i}|fdd���fdd�}t�j�|d�|�|���|j�d�dS)	Nzy
Here is a list of modules whose name or summary contains '{}'.
If there are any, enter a module name to get more help.

zI
Please wait a moment while I gather a list of all available modules...

cSs>|r$|dd�dkr$|dd�d}|�d�dkr:d||<dS)N����	.__init__r�rrr)�find)r	r(r�r�rrr�callback4sz$Helper.listmodules.<locals>.callbackcs�d|d�dSr+rr��r�rr�onerror9sz#Helper.listmodules.<locals>.onerror�r�z�
Enter any module name to get more help.  Or, type "modules spam" to search
for modules whose name or summary contain the string "spam".
)rr�r�apropos�
ModuleScanner�runrrG)r@rJr�r�rr�rr�&s
�
zHelper.listmodules)r8r<r%r�)NN)r�r�)r)r)r)!r&r'rUryZ_strprefixesZ_symbols_inverserzr�r�Zsymbols_r�rxr{r�rnrlrrorrprtrrrvrrqrr}r~rr�r�r�r�rrrrr�sB�'���W



	


 
rc@seZdZddd�ZdS)r�Nc	Cs
|r|��}d|_i}tjD]p}|dkrd||<|dkrF|d|d�qt|�jpRd}|�d�d}|d|}|���|�dkr|d||�qtj	|d�D�]\\}	}}
|jr��q�|dkr�|d|d�q�zt�
|	|�}Wntk
r�Yq�YnX|j}t
|d	��rnz|�|�}
Wn(tk
�r:|�r2||�Yq�YnXtt�|
���pNd}t
|d
��rh|�|�}nd}n`ztj�|�}Wn(tk
�r�|�r�||�Yq�YnX|j�r�|j��dnd}t|dd�}|d|}|���|�dkr�||||�q�|�r|�dS)NF�__main__rrrrr�r��
get_source�get_filenamer[)r�rurr�r�rXr r�rNr�	_get_specr�r�rer�rcr�r��StringIOr�r�r�r�r�r�r>)r@r�rJZ	completerr��seenr(r)r�rXrYr�r��sourcer	r�rrrr�Gs`



zModuleScanner.run)NNN)r&r'rUr�rrrrr�Dsr�c	CsDdd�}dd�}t���"t�d�t�j|||d�W5QRXdS)NcSs6|dd�dkr |dd�d}t||o.d|�dS�Nr�r�r�z- )r�r	r(r�rrrr��szapropos.<locals>.callbackcSsdSr+rr�rrrr��szapropos.<locals>.onerror�ignorer�)�warnings�catch_warnings�filterwarningsr�r�)rJr�r�rrrr��s


r�cs�ddl�ddl�ddl�ddl�Gdd�d�jj��G�fdd�d�jj��G�����fdd�d�j�}||||�}|��|j	s�|j
s�t�d�q~|S)	Nrc@seZdZdd�Zdd�ZdS)z!_start_server.<locals>.DocHandlercSsX|j�d�rd}nd}|�d�|�dd|�|��|j�|�|j|��d��dS)Nz.css�text/css�	text/html��zContent-Typez%s; charset=UTF-8r�)	r	rdZ
send_responseZsend_headerZend_headersZwfiler��
urlhandlerr�)r@�content_typerrr�do_GET�s

��z(_start_server.<locals>.DocHandler.do_GETcWsdSr+r)r@r�rrr�log_message�sz-_start_server.<locals>.DocHandler.log_messageN)r&r'rUr�r�rrrr�
DocHandler�sr�cs(eZdZdd�Z�fdd�Zdd�ZdS)z _start_server.<locals>.DocServercSs6||_|j|f|_||_|j�||j|j�d|_dS�NF)�hostZaddressr�rLr��handlerru)r@r��portr�rrrr��s
z)_start_server.<locals>.DocServer.__init__cs>|js2��|j��gggd�\}}}|r|��q|��dSrB)ru�selectZsocketr�Zhandle_requestZserver_close)r@ZrdZwrZex�r�rr�serve_until_quit�s

z1_start_server.<locals>.DocServer.serve_until_quitcSs |j�|�|jr|�|�dSr+)rL�server_activater�r�rrrr��sz0_start_server.<locals>.DocServer.server_activateN)r&r'rUr�r�r�rr�rr�	DocServer�sr�cs:eZdZ�fdd�Z����fdd�Zdd�Zdd�Zd	S)
z#_start_server.<locals>.ServerThreadcs2||_||_t|�|_�j�|�d|_d|_dSr�)r�r�r+r��Threadr��serving�error)r@r�r�r�)�	threadingrrr��s
z,_start_server.<locals>.ServerThread.__init__c
sxzJ�jj�_��_�jj�_t|j��_�|j	|j
|j�}||_|�
�Wn(tk
rr}z
||_W5d}~XYnXdSr+)�server�
HTTPServerrLr�r�ZMessageZMessageClass�staticmethodr�r�r��ready�	docserverr�rcr�)r@Zdocsvr�e)r�r��email�httprrr�	s

z'_start_server.<locals>.ServerThread.runcSs,d|_|j|_|j|_d|j|jf|_dS)NTz
http://%s:%d/)r�r�Zserver_portr�r")r@r�rrrr�	sz)_start_server.<locals>.ServerThread.readycSs&d|j_|��d|_d|_d|_dS)NTF)r�rur"r�r"r�rrr�stop	s
z(_start_server.<locals>.ServerThread.stopN)r&r'rUr�r�r�r�r)r�r�r�r�r�rr�ServerThread�s
r�g{�G�z�?)
Zhttp.serverZ
email.messager�r�r�ZBaseHTTPRequestHandlerr�r�r1r�r��time�sleep)r��hostnamer�r��threadr)r�r�r�r�r�r�r�
_start_server�s8'r�r�c
s(G�fdd�dt�}|���fdd���fdd���fdd���fd	d
���fdd���fd
d���fdd���fdd����������fdd�}|�d�r�|dd�}|dk�rtj�tj�t��}tj�||�}t|��}d�|�	��W5QR�SQRXn|dk�r||�St
d||f��dS)NcseZdZ�fdd�ZdS)z_url_handler.<locals>._HTMLDoccsd}d|}d||��|fS)Nzpydoc_data/_pydoc.cssz1<link rel="stylesheet" type="text/css" href="%s">a<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Pydoc: %s</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
%s</head><body bgcolor="#f0f0f8">%s<div style="clear:both;padding-top:.5em;">%s</div>
</body></html>r)r@rr�css_pathZcss_link��html_navbarrrr2	s���z#_url_handler.<locals>._HTMLDoc.pageN)r&r'rUrrr�rr�_HTMLDoc0	sr�cs>��dt��t��dt��f�}d|��tjdd��fS)Nz%s [%s, %s]raZ
            <div style='float:left'>
                Python %s<br>%s
            </div>
            <div style='float:right'>
                <div style='text-align:center'>
                  <a href="index.html">Module Index</a>
                  : <a href="topics.html">Topics</a>
                  : <a href="keywords.html">Keywords</a>
                </div>
                <div>
                    <form action="get" style='display:inline;'>
                      <input type=text name=key size=15>
                      <input type=submit value="Get">
                    </form>&nbsp;
                    <form action="search" style='display:inline;'>
                      <input type=text name=key size=15>
                      <input type=submit value="Search">
                    </form>
                </div>
            </div>
            T)Zterse)r�r�Zpython_versionZpython_buildZpython_compiler)rU�rrrr�B	s
��z!_url_handler.<locals>.html_navbarcs�dd�}��ddd�}dd�tjD�}��||�}|d��d	dd
|�g}i}tjD]}|���||��qT|�d�dd
�|�fS)NcSsd||fSrr�r)rrr�	bltinlink`	sz3_url_handler.<locals>.html_index.<locals>.bltinlinkz7<big><big><strong>Index of Modules</strong></big></big>rArBcSsg|]}|dkr|�qS)r�r)rsr)rrrr�f	s�z4_url_handler.<locals>.html_index.<locals>.<listcomp>z<p>zBuilt-in ModulesrFz|<p align=right><font color="#909090" face="helvetica,arial"><strong>pydoc</strong> by Ka-Ping Yee&lt;ping@lfw.org&gt;</font>zIndex of Modulesr)	rrr�rrr	rr�r")r�r�namesrr�rr�rr�
html_index]	s*��
�z _url_handler.<locals>.html_indexc		s�g��fdd�}t���*t�d�dd�}t�j|||d�W5QRXdd�}g}��d	d
d�}�D]\}}|�||�|�qf|��d|d
d
d�|��}d|fS)Ncs:|dd�dkr |dd�d}��||o0d|f�dSr�rMr��Z
search_resultrrr�{	sz3_url_handler.<locals>.html_search.<locals>.callbackr�cSsdSr+rr�rrrr��	sz2_url_handler.<locals>.html_search.<locals>.onerrorr�cSsd||fSrrr�rrrr��	sz4_url_handler.<locals>.html_search.<locals>.bltinlinkz5<big><big><strong>Search Results</strong></big></big>rArBzkey = %srF�<br>zSearch Results)	r�r�r�r�r�rrrr")	rJr�r�r�rprr)r�rr�r�r�html_searchv	s,

��z!_url_handler.<locals>.html_searchcsLdd�}��ddd�}ttj���}��||�}|��ddd|�}d|fS)NcSsd||fS�Nz<a href="topic?key=%s">%s</a>rr�rrrr��	sz4_url_handler.<locals>.html_topics.<locals>.bltinlink�,<big><big><strong>INDEX</strong></big></big>rArBZTopicsrF)rr�rr{rGrr)r�rr�rr�rr�html_topics�	s��z!_url_handler.<locals>.html_topicscsL��ddd�}ttj���}dd�}��||�}|��ddd|�}d|fS)Nr�rArBcSsd||fSr�rr�rrrr��	sz6_url_handler.<locals>.html_keywords.<locals>.bltinlinkZKeywordsrF)rr�rryrGrr)rr�r�rr�rr�
html_keywords�	s��z#_url_handler.<locals>.html_keywordscs�t��}t||�}|�|�\}}||jkr0d}nd}��d|dd�}d��|�}��|dd|�}|r�t|�	��}dd	�}��
||�}��d
dd|�}d||fd�|||f�fS)
NZKEYWORDZTOPICr=rArBz
<pre>%s</pre>rFcSsd||fSr�rr�rrrr��	sz7_url_handler.<locals>.html_topicpage.<locals>.bltinlinkr�z%s %sr)
r�r�rr�ryrr3rr�r rrr")r�ZbufZhtmlhelprr�rrr�r�rr�html_topicpage�	s2

��
�z$_url_handler.<locals>.html_topicpagecs@t|dd�}|dkr$|dkr$td��t|�}��||�}||fS)Nr)r�r+zcould not find object)r�r�r�r�)r"rgr�contentr�rr�html_getobj�	sz!_url_handler.<locals>.html_getobjcsP��ddd�}d��fdd�tt|�|�D��}|��|dd|�}d||fS)	Nz,<big><big><strong>Error</strong></big></big>rArBr�c3s|]}��|�VqdSr+)r�r�r�rrr��	sz3_url_handler.<locals>.html_error.<locals>.<genexpr>z#bb0000z
Error - %s)rr"rr�r)r"r�rrr�rr�
html_error�	s���z _url_handler.<locals>.html_errorc
sr|}|�d�r|dd�}�z|dkr2��\}}n�|dkrF��\}}n�|dkrZ��\}}n�d|k�r$|�d�\}}}|dkr��|�\}}n�|dkr�z�|�\}}Wn tk
r��|�\}}YnXn\|d	k�r|dkr��\}}n4z�|�\}}Wn"tk
�r�|�\}}YnXntd
��n�|�\}}Wn2tk
�rd}z�||�\}}W5d}~XYnX��||�S)Nr����)rr�r{ryr�z
search?keyz	topic?keyzget?keyz
bad pydoc url)rdr�r�rcr)r"Zcomplete_urlrr��oprar�)rr�r�r�r�r�r�r�rr�
get_html_page�	s>



 z#_url_handler.<locals>.get_html_pager�rr�rr�z"unknown content type %r for url %s)rrcr
r	�dirname�realpathr[r"r��	readlinesr)r"r�r�r�Z	path_herer��fpr)	rr�r�r�r�r�r�r�r�r�_url_handler'	s*	
(


"
r�T�	localhost)�open_browserr�c	Cs�ddl}tt||�}|jr(t|j�dS|jr�d}|rB|�|j�z~zZtd|j�t|�|jr�t	d�}|�
�}|dkr|q�qZ|dkr�|�|j�qZt|�qZWnttfk
r�t�YnXW5|jr�|��td�XdS)Nrz"Server commands: [b]rowser, [q]uitzServer stoppedzServer ready atzserver> r�r�)
�
webbrowserr�r�r�rr�r�r"r�rlr�r�rw)r�r�r�r�ZserverthreadZserver_help_msgr�rrr�browse
s2
r�cCst|t�o|�tj�dkSrw)rmrJr�r
�sep)rPrrr�ispath9
sr�cCsvd|kstj|kst��|kr"dStj�t�}tj�|�}|��}||krbtj�||�sb|�|�|�	dt���|S)Nrr)
r
�curdir�getcwdr	r�r[�copy�samefile�remove�insert)Z
given_pathZargv0Z
stdlib_dirZ
script_dir�revised_pathrrr�_get_revised_path<
s

r�cCs,ttjtjd�}|dk	r(|tjdd�<dSrw)r�rr	�argv)r�rrr�_adjust_cli_sys_pathX
sr�cCs�ddl}Gdd�dt�}t��zv|�tjdd�d�\}}d}d}d}d}d}|D]\\}	}
|	dkrld	}d	}|	d
kr�t|
�WdS|	dkr�d	}|
}|	dkr�d	}|	d
krTd	}|
}qT|r�t|||d�WdS|s�|�|D]�}t|��rtj	�
|��std|��q�z`t|��r&tj	�|��r&t
|�}|�rXt|��rNtj	�|��rNt|�nt|�n
t�|�Wq�tk
�r�}zt|�W5d}~XYq�Xq�WnN|j|fk
�r�tj	�tj	�tjd��d}
tdj|
tjd��YnXdS)Nrc@seZdZdS)zcli.<locals>.BadUsageN)r&r'rUrrrr�BadUsagee
sr�rzbk:n:p:wFr�z-bTz-kz-pz-wz-n)r�r�zfile %r does not exista�pydoc - the Python documentation tool

{cmd} <name> ...
    Show text documentation on something.  <name> may be the name of a
    Python keyword, topic, function, module, or package, or a dotted
    reference to a class or function within a module or module in a
    package.  If <name> contains a '{sep}', it is used as the path to a
    Python source file to document. If name is 'keywords', 'topics',
    or 'modules', a listing of these things is displayed.

{cmd} -k <keyword>
    Search for a keyword in the synopsis lines of all available modules.

{cmd} -n <hostname>
    Start an HTTP server with the given hostname (default: localhost).

{cmd} -p <port>
    Start an HTTP server on the given port on the local machine.  Port
    number 0 can be used to get an arbitrary unused port.

{cmd} -b
    Start an HTTP server on an arbitrary unused port and open a Web browser
    to interactively browse documentation.  This option can be used in
    combination with -n and/or -p.

{cmd} -w <name> ...
    Write out the HTML documentation for a module to a file in the current
    directory.  If <name> contains a '{sep}', it is treated as a filename; if
    it names a directory, documentation is written for all the contents.
)r�r�)�getoptrcr�rr�r�r�r�r
r	�existsrr�r�r
r
rrr�r�r�r�rr�)r�r�Zoptsr�ZwritingZstart_serverr�r�r��opt�val�argrKr�rrr�clib
sd

 �rr�)NN)r)r)rrN)rrN)r)rN)r�)r)YrGrYrSrWr�Zimportlib._bootstrapr�Zimportlib._bootstrap_external�importlib.machinery�importlib.utilrr�r
rNr�rrr�r�r�Zurllib.parserHr��collectionsr�reprlibr�	tracebackrrrr%r*r0r2r7r'�
IGNORECASEr8r:rArFrQrhrkr�r�r�r�rcr�r�r�r�r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r1rrr�rr#rr
rrr�r�r�r�r�r�r�r�rr&rrrr�<module>'s�
	


'
0:*> ",

�
�


=
n%
U
__pycache__/rlcompleter.cpython-38.pyc000064400000013175151153537610013752 0ustar00U

e5d��@s�dZddlZddlZddlZdgZGdd�d�Zdd�ZzddlZWnek
r\dZ	Yn"Xe�
e�j�e�dd	��d
Z	dS)a1Word completion for GNU readline.

The completer completes keywords, built-ins and globals in a selectable
namespace (which defaults to __main__); when completing NAME.NAME..., it
evaluates (!) the expression up to the last dot and completes its attributes.

It's very cool to do "import sys" type "sys.", hit the completion key (twice),
and see the list of names defined by the sys module!

Tip: to use the tab key as the completion key, call

    readline.parse_and_bind("tab: complete")

Notes:

- Exceptions raised by the completer function are *ignored* (and generally cause
  the completion to fail).  This is a feature -- since readline sets the tty
  device in raw (or cbreak) mode, printing a traceback wouldn't work well
  without some complicated hoopla to save, reset and restore the tty state.

- The evaluation of the NAME.NAME... form may cause arbitrary application
  defined code to be executed if an object with a __getattr__ hook is found.
  Since it is the responsibility of the application (or the user) to enable this
  feature, I consider this an acceptable risk.  More complicated expressions
  (e.g. function calls or indexing operations) are *not* evaluated.

- When the original stdin is not a tty device, GNU readline is never
  used, and this module (and the readline module) are silently inactive.

�N�	Completerc@s6eZdZddd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
rNcCs6|rt|t�std��|dkr&d|_nd|_||_dS)a�Create a new completer for the command line.

        Completer([namespace]) -> completer instance.

        If unspecified, the default namespace where completions are performed
        is __main__ (technically, __main__.__dict__). Namespaces should be
        given as dictionaries.

        Completer instances should be used as the completion mechanism of
        readline via the set_completer() call:

        readline.set_completer(Completer(my_namespace).complete)
        znamespace must be a dictionaryN�r)�
isinstance�dict�	TypeError�use_main_ns�	namespace)�selfr�r
�#/usr/lib64/python3.8/rlcompleter.py�__init__'szCompleter.__init__cCs�|jrtj|_|��sB|dkr>tr8t�d�t��dSdSndS|dkrld|kr`|�	|�|_
n|�|�|_
z|j
|WStk
r�YdSXdS)z�Return the next possible completion for 'text'.

        This is called successively with state == 0, 1, 2, ... until it
        returns None.  The completion should begin with 'text'.

        r�	�N�.)
r�__main__�__dict__r�strip�_readline_available�readlineZinsert_textZ	redisplay�attr_matches�matches�global_matches�
IndexError)r	�text�stater
r
r�completeBs$
zCompleter.completecCst|�r|d}|S)N�()�callable)r	�val�wordr
r
r�_callable_postfixaszCompleter._callable_postfixc	Cs�ddl}g}dh}t|�}|jD]J}|d|�|kr |�|�|dkrP|d}n|dkr`|d}|�|�q |jtjfD]J}|��D]<\}}|d|�|kr�||kr�|�|�|�|�	||��q�qx|S)z�Compute matches when text is a simple name.

        Return a list of all keywords, built-in functions and names currently
        defined in self.namespace that match.

        rN�__builtins__>�try�finally�:>�break�None�pass�continue�False�True�else� )
�keyword�len�kwlist�add�appendr�builtinsr�itemsr )	r	rr-r�seen�nrZnspacerr
r
rrfs$



zCompleter.global_matchesc	Cshddl}|�d|�}|sgS|�dd�\}}zt||j�}Wntk
rTgYSXtt|��}|�d�t	|d�r�|�
d�|�t|j
��g}t|�}	|dkr�d	}
n|d	kr�d
}
nd}
|D]t}|d|	�|kr�|
r�|d|	d�|
ks�d||f}zt||�}
Wntk
�rYnX|�|
|�}|�|�q�|�s\|
�sF�q\|
d	k�rVd
}
q�d}
q�|��|S)a�Compute matches when text contains a dot.

        Assuming the text is of the form NAME.NAME....[NAME], and is
        evaluable in self.namespace, it will be evaluated and its attributes
        (as revealed by dir()) are used as possible completions.  (For class
        instances, class members are also considered.)

        WARNING: this can still invoke arbitrary C code, if an object
        with a __getattr__ hook is evaluated.

        rNz(\w+(\.\w+)*)\.(\w*)r�r!�	__class__r�_�__z%s.%s)�re�match�group�evalr�	Exception�set�dir�discard�hasattrr0�update�get_class_membersr7r.�getattrr r1�sort)r	rr:�m�expr�attrZ
thisobjectZwordsrr5Znoprefixrr;rr
r
rr�sR



��
zCompleter.attr_matches)N)�__name__�
__module__�__qualname__rrr rrr
r
r
rr&s

cCs.t|�}t|d�r*|jD]}|t|�}q|S)N�	__bases__)r@rBrMrD)�klassZret�baser
r
rrD�s


rDFcCs
t�d�S)N)r�
set_completerr
r
r
r�<lambda>��rQT)
�__doc__�atexitr2r�__all__rrDr�ImportErrorrrPr�registerr
r
r
r�<module>s
__pycache__/re.cpython-38.opt-1.pyc000064400000034130151153537610012761 0ustar00U

e5d�=�@s�dZddlZddlZddlZddlZzddlZWnek
rHdZYnXddddddd	d
ddd
ddddddddddddddddddgZd ZGd!d"�d"ej	�Z
e��e
j
�ejZd@d#d�ZdAd$d�ZdBd%d�ZdCd&d�ZdDd'd�ZdEd(d�ZdFd)d	�ZdGd*d
�ZdHd+d�Zd,d�ZdId-d
�Zd.d/�d0D�Zd1d�Zee�d2d��Zee�d2d��d2��ZiZd3Z d4d5�Z!e�"e �d6d7��Z#d8d9�Z$d:d;�Z%ddl&Z&d<d=�Z'e&�(ee'e!�Gd>d?�d?�Z)dS)Ja�Support for regular expressions (RE).

This module provides regular expression matching operations similar to
those found in Perl.  It supports both 8-bit and Unicode strings; both
the pattern and the strings being processed can contain null bytes and
characters outside the US ASCII range.

Regular expressions can contain both special and ordinary characters.
Most ordinary characters, like "A", "a", or "0", are the simplest
regular expressions; they simply match themselves.  You can
concatenate ordinary characters, so last matches the string 'last'.

The special characters are:
    "."      Matches any character except a newline.
    "^"      Matches the start of the string.
    "$"      Matches the end of the string or just before the newline at
             the end of the string.
    "*"      Matches 0 or more (greedy) repetitions of the preceding RE.
             Greedy means that it will match as many repetitions as possible.
    "+"      Matches 1 or more (greedy) repetitions of the preceding RE.
    "?"      Matches 0 or 1 (greedy) of the preceding RE.
    *?,+?,?? Non-greedy versions of the previous three special characters.
    {m,n}    Matches from m to n repetitions of the preceding RE.
    {m,n}?   Non-greedy version of the above.
    "\\"     Either escapes special characters or signals a special sequence.
    []       Indicates a set of characters.
             A "^" as the first character indicates a complementing set.
    "|"      A|B, creates an RE that will match either A or B.
    (...)    Matches the RE inside the parentheses.
             The contents can be retrieved or matched later in the string.
    (?aiLmsux) The letters set the corresponding flags defined below.
    (?:...)  Non-grouping version of regular parentheses.
    (?P<name>...) The substring matched by the group is accessible by name.
    (?P=name)     Matches the text matched earlier by the group named name.
    (?#...)  A comment; ignored.
    (?=...)  Matches if ... matches next, but doesn't consume the string.
    (?!...)  Matches if ... doesn't match next.
    (?<=...) Matches if preceded by ... (must be fixed length).
    (?<!...) Matches if not preceded by ... (must be fixed length).
    (?(id/name)yes|no) Matches yes pattern if the group with id/name matched,
                       the (optional) no pattern otherwise.

The special sequences consist of "\\" and a character from the list
below.  If the ordinary character is not on the list, then the
resulting RE will match the second character.
    \number  Matches the contents of the group of the same number.
    \A       Matches only at the start of the string.
    \Z       Matches only at the end of the string.
    \b       Matches the empty string, but only at the start or end of a word.
    \B       Matches the empty string, but not at the start or end of a word.
    \d       Matches any decimal digit; equivalent to the set [0-9] in
             bytes patterns or string patterns with the ASCII flag.
             In string patterns without the ASCII flag, it will match the whole
             range of Unicode digits.
    \D       Matches any non-digit character; equivalent to [^\d].
    \s       Matches any whitespace character; equivalent to [ \t\n\r\f\v] in
             bytes patterns or string patterns with the ASCII flag.
             In string patterns without the ASCII flag, it will match the whole
             range of Unicode whitespace characters.
    \S       Matches any non-whitespace character; equivalent to [^\s].
    \w       Matches any alphanumeric character; equivalent to [a-zA-Z0-9_]
             in bytes patterns or string patterns with the ASCII flag.
             In string patterns without the ASCII flag, it will match the
             range of Unicode alphanumeric characters (letters plus digits
             plus underscore).
             With LOCALE, it will match the set [0-9_] plus characters defined
             as letters for the current locale.
    \W       Matches the complement of \w.
    \\       Matches a literal backslash.

This module exports the following functions:
    match     Match a regular expression pattern to the beginning of a string.
    fullmatch Match a regular expression pattern to all of a string.
    search    Search a string for the presence of a pattern.
    sub       Substitute occurrences of a pattern found in a string.
    subn      Same as sub, but also return the number of substitutions made.
    split     Split a string by the occurrences of a pattern.
    findall   Find all occurrences of a pattern in a string.
    finditer  Return an iterator yielding a Match object for each match.
    compile   Compile a pattern into a Pattern object.
    purge     Clear the regular expression cache.
    escape    Backslash all non-alphanumerics in a string.

Each function other than purge and escape can take an optional 'flags' argument
consisting of one or more of the following module constants, joined by "|".
A, L, and U are mutually exclusive.
    A  ASCII       For string patterns, make \w, \W, \b, \B, \d, \D
                   match the corresponding ASCII character categories
                   (rather than the whole Unicode categories, which is the
                   default).
                   For bytes patterns, this flag is the only available
                   behaviour and needn't be specified.
    I  IGNORECASE  Perform case-insensitive matching.
    L  LOCALE      Make \w, \W, \b, \B, dependent on the current locale.
    M  MULTILINE   "^" matches the beginning of lines (after a newline)
                   as well as the string.
                   "$" matches the end of lines (before a newline) as well
                   as the end of the string.
    S  DOTALL      "." matches any character at all, including the newline.
    X  VERBOSE     Ignore whitespace and comments for nicer looking RE's.
    U  UNICODE     For compatibility only. Ignored for string patterns (it
                   is the default), and forbidden for bytes patterns.

This module also defines an exception 'error'.

�N�match�	fullmatch�search�sub�subn�split�findall�finditer�compile�purge�template�escape�error�Pattern�Match�A�I�L�M�S�X�U�ASCII�
IGNORECASE�LOCALE�	MULTILINE�DOTALL�VERBOSE�UNICODEz2.2.1c@speZdZejZZejZZ	ej
ZZej
ZZejZZejZZejZZejZZejZdd�Zej Z dS)�	RegexFlagcCs�|jdk	rd|j��S|j}g}|dk}|r2|}|jD],}||j@r8||jM}|�d|j���q8|rx|�t|��d�|�}|r�t|�dkr�d|�d�}n
d|��}|S)Nzre.r�|�z~(�)�~)�_name_�_value_�	__class__�append�hex�join�len)�self�value�members�negative�m�res�r1�/usr/lib64/python3.8/re.py�__repr__�s&




zRegexFlag.__repr__N)!�__name__�
__module__�__qualname__�sre_compile�SRE_FLAG_ASCIIrr�SRE_FLAG_IGNORECASErr�SRE_FLAG_LOCALErr�SRE_FLAG_UNICODErr�SRE_FLAG_MULTILINErr�SRE_FLAG_DOTALLrr�SRE_FLAG_VERBOSErr�SRE_FLAG_TEMPLATE�TEMPLATE�T�SRE_FLAG_DEBUG�DEBUGr3�object�__str__r1r1r1r2r�s







rcCst||��|�S)zqTry to apply the pattern at the start of the string, returning
    a Match object, or None if no match was found.)�_compiler��pattern�string�flagsr1r1r2r�scCst||��|�S)zkTry to apply the pattern to all of the string, returning
    a Match object, or None if no match was found.)rFrrGr1r1r2r�scCst||��|�S)ztScan through string looking for a match to the pattern, returning
    a Match object, or None if no match was found.)rFrrGr1r1r2r�scCst||��|||�S)aZReturn the string obtained by replacing the leftmost
    non-overlapping occurrences of the pattern in string by the
    replacement repl.  repl can be either a string or a callable;
    if a string, backslash escapes in it are processed.  If it is
    a callable, it's passed the Match object and must return
    a replacement string to be used.)rFr�rH�replrI�countrJr1r1r2r�scCst||��|||�S)a�Return a 2-tuple containing (new_string, number).
    new_string is the string obtained by replacing the leftmost
    non-overlapping occurrences of the pattern in the source
    string by the replacement repl.  number is the number of
    substitutions that were made. repl can be either a string or a
    callable; if a string, backslash escapes in it are processed.
    If it is a callable, it's passed the Match object and must
    return a replacement string to be used.)rFrrKr1r1r2r�s	cCst||��||�S)a�Split the source string by the occurrences of the pattern,
    returning a list containing the resulting substrings.  If
    capturing parentheses are used in pattern, then the text of all
    groups in the pattern are also returned as part of the resulting
    list.  If maxsplit is nonzero, at most maxsplit splits occur,
    and the remainder of the string is returned as the final element
    of the list.)rFr)rHrI�maxsplitrJr1r1r2r�scCst||��|�S)aReturn a list of all non-overlapping matches in the string.

    If one or more capturing groups are present in the pattern, return
    a list of groups; this will be a list of tuples if the pattern
    has more than one group.

    Empty matches are included in the result.)rFrrGr1r1r2r�scCst||��|�S)z�Return an iterator over all non-overlapping matches in the
    string.  For each match, the iterator returns a Match object.

    Empty matches are included in the result.)rFr	rGr1r1r2r	�scCs
t||�S)zACompile a regular expression pattern, returning a Pattern object.)rF�rHrJr1r1r2r
�scCst��t��dS)z#Clear the regular expression cachesN)�_cache�clear�
_compile_repl�cache_clearr1r1r1r2r�scCst||tB�S)z6Compile a template pattern, returning a Pattern object)rFrArOr1r1r2rscCsi|]}|dt|��qS)�\)�chr)�.0�ir1r1r2�
<dictcomp>srXs()[]{}?*+-|^$\.&~# 	

cCs2t|t�r|�t�St|d�}|�t��d�SdS)z0
    Escape special characters in a string.
    �latin1N)�
isinstance�str�	translate�_special_chars_map�encode)rHr1r1r2r
s


�ic
Cs�t|t�r|j}ztt|�||fWStk
r8YnXt|t�rT|rPtd��|St�	|�sft
d��t�||�}|t@s�t
t�tkr�ztttt��=Wntttfk
r�YnX|tt|�||f<|S)Nz5cannot process flags argument with a compiled patternz1first argument must be string or compiled pattern)rZrr,rP�type�KeyErrorr�
ValueErrorr7�isstring�	TypeErrorr
rCr*�	_MAXCACHE�next�iter�
StopIteration�RuntimeError)rHrJ�pr1r1r2rF!s.

�
rFcCst�||�S�N)�	sre_parse�parse_template)rLrHr1r1r2rR;srRcCst�||�}t�||�Srk)rlrm�expand_template)rHrrr1r1r2�_expand@srocCs>t||�}|ds.t|d�dkr.|ddS|fdd�}|S)Nrr!cSst�||�Srk)rlrn)rrr1r1r2�filterKsz_subx.<locals>.filter)rRr*)rHrrpr1r1r2�_subxEs

rqcCst|j|jffSrk)rFrHrJ)rjr1r1r2�_pickleSsrrc@seZdZddd�Zdd�ZdS)�Scannerrc
Cs�ddlm}m}t|t�r |j}||_g}t��}||_	|D]H\}}|�
�}	|�t�|||	ddt�
||�ffg��|�|	|d�q<t�||d|ffg�}t�|�|_dS)Nr)�BRANCH�
SUBPATTERN���)�
sre_constantsrtrurZrr,�lexiconrl�StaterJ�	opengroupr'�
SubPattern�parse�
closegroupr7r
�scanner)
r+rxrJrtrurj�s�phrase�action�gidr1r1r2�__init__\s

�zScanner.__init__c	Cs�g}|j}|j�|�j}d}|�}|s(q�|��}||kr:q�|j|jdd}t|�rj||_|||���}|dk	rz||�|}q|||d�fS)Nrr!)r'r~r�endrx�	lastindex�callable�group)	r+rI�resultr'rrWr/�jr�r1r1r2�scanms$zScanner.scanN)r)r4r5r6r�r�r1r1r1r2rs[s
rs)r)r)r)rr)rr)rr)r)r)r)r)*�__doc__�enumr7rl�	functools�_locale�ImportError�__all__�__version__�IntFlagr�globals�update�__members__rrrrrrrrr	r
rrr]r
r`rrrPrerF�	lru_cacherRrorq�copyregrr�picklersr1r1r1r2�<module>s�k
�#



	







	

__pycache__/symbol.cpython-38.opt-1.pyc000064400000004546151153537610013670 0ustar00U

��.e=�@s�dZdZdZdZdZdZdZdZdZd	Z	d
Z
dZdZd
Z
dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZd Z d!Z!d"Z"d#Z#d$Z$d%Z%d&Z&d'Z'd(Z(d)Z)d*Z*d+Z+d,Z,d-Z-d.Z.d/Z/d0Z0d1Z1d2Z2d3Z3d4Z4d5Z5d6Z6d7Z7d8Z8d9Z9d:Z:d;Z;d<Z<d=Z=d>Z>d?Z?d@Z@dAZAdBZBdCZCdDZDdEZEdFZFdGZGdHZHdIZIdJZJdKZKdLZLdMZMdNZNdOZOdPZPdQZQdRZRdSZSdTZTdUZUdVZVdWZWdXZXdYZYdZZZd[Z[d\Z\iZ]e^e_��`��D]$\ZaZbeceb�ecd]�k�r�eae]eb<�q�[a[bd^S)_z;Non-terminal symbols of Python grammar (from "graminit.h").�iiiiiiiii	i
iii
iiiiiiiiiiiiiiiiiii i!i"i#i$i%i&i'i(i)i*i+i,i-i.i/i0i1i2i3i4i5i6i7i8i9i:i;i<i=i>i?i@iAiBiCiDiEiFiGiHiIiJiKiLiMiNiOiPiQiRiSiTiUiViWiXiYiZi[�N)d�__doc__Zsingle_inputZ
file_inputZ
eval_inputZ	decoratorZ
decoratorsZ	decoratedZ
async_funcdefZfuncdefZ
parametersZ
typedargslistZtfpdefZvarargslistZvfpdefZstmtZsimple_stmtZ
small_stmtZ	expr_stmtZ	annassignZtestlist_star_exprZ	augassignZdel_stmtZ	pass_stmtZ	flow_stmtZ
break_stmtZ
continue_stmtZreturn_stmtZ
yield_stmtZ
raise_stmtZimport_stmtZimport_nameZimport_fromZimport_as_nameZdotted_as_nameZimport_as_namesZdotted_as_namesZdotted_nameZglobal_stmtZ
nonlocal_stmtZassert_stmtZ
compound_stmtZ
async_stmtZif_stmtZ
while_stmtZfor_stmtZtry_stmtZ	with_stmtZ	with_itemZ
except_clauseZsuiteZnamedexpr_testZtestZtest_nocondZlambdefZlambdef_nocondZor_testZand_testZnot_testZ
comparisonZcomp_opZ	star_expr�exprZxor_exprZand_exprZ
shift_exprZ
arith_exprZtermZfactorZpowerZ	atom_exprZatomZ
testlist_compZtrailerZ
subscriptlistZ	subscriptZsliceopZexprlistZtestlistZdictorsetmakerZclassdefZarglistZargumentZ	comp_iterZ
sync_comp_forZcomp_forZcomp_ifZ
encoding_declZ
yield_exprZ	yield_argZfunc_body_suiteZfunc_type_inputZ	func_typeZtypelistZsym_name�list�globals�items�_nameZ_value�type�r
r
�/usr/lib64/python3.8/symbol.py�<module>s�__pycache__/random.cpython-38.opt-1.pyc000064400000047216151153537610013644 0ustar00U

e5d�p�@sdZddlmZddlmZmZm	Z
mZm
ZddlmZmZmZmZddlmZddlmZmZddlm Z!m"Z#ddl$m$Z%dd	lZ&zdd
l'm(Z'Wn e)k
r�dd
l*m(Z'YnXddd
ddddddddddddddddddd d!d"gZ+d#ed$�ed%�Z,d%e
Z-ed&�Z.d'ed(�Z/d)Z0d*e0Z1dd	l2Z2Gd+d�de2j3�Z3Gd,d"�d"e3�Z4d-d.�Z5d5d0d1�Z6e3�Z7e7j8Z8e7j9Z9e7j:Z:e7j;Z;e7j<Z<e7j=Z=e7j>Z>e7j?Z?e7j@Z@e7jAZAe7jBZBe7jCZCe7jDZDe7jEZEe7jFZFe7jGZGe7jHZHe7jIZIe7jJZJe7jKZKe7jLZLe7jMZMeNe&d2��re&jOe7j8d3�ePd4k�re6�d	S)6a�Random variable generators.

    integers
    --------
           uniform within range

    sequences
    ---------
           pick random element
           pick random sample
           pick weighted random sample
           generate random permutation

    distributions on the real line:
    ------------------------------
           uniform
           triangular
           normal (Gaussian)
           lognormal
           negative exponential
           gamma
           beta
           pareto
           Weibull

    distributions on the circle (angles 0 to 2pi)
    ---------------------------------------------
           circular uniform
           von Mises

General notes on the underlying Mersenne Twister core generator:

* The period is 2**19937-1.
* It is one of the most extensively tested generators in existence.
* The random() method is implemented in C, executes in a single Python step,
  and is, therefore, threadsafe.

�)�warn)�log�exp�pi�e�ceil)�sqrt�acos�cos�sin)�urandom)�Set�Sequence)�
accumulate�repeat)�bisectN)�sha512�Random�seed�random�uniform�randint�choice�sample�	randrange�shuffle�
normalvariate�lognormvariate�expovariate�vonmisesvariate�gammavariate�
triangular�gauss�betavariate�
paretovariate�weibullvariate�getstate�setstate�getrandbits�choices�SystemRandom�g��@�@��?�@�5�cs$eZdZdZdZd?dd�Zdd�Zd@�fd	d
�	Z�fdd�Z�fd
d�Z	dd�Z
dd�Zdd�Zdde
fdd�Zdd�Zdd�Ze
de>fdd�ZeZdd�ZdAd d!�Zd"d#�ZdBddd$�d%d&�Zd'd(�ZdCd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Z d;d<�Z!d=d>�Z"�Z#S)Dra�Random number generator base class used by bound module functions.

    Used to instantiate instances of Random to get generators that don't
    share state.

    Class Random can also be subclassed if you want to use a different basic
    generator of your own devising: in that case, override the following
    methods:  random(), seed(), getstate(), and setstate().
    Optionally, implement a getrandbits() method so that randrange()
    can cover arbitrarily large ranges.

    �NcCs|�|�d|_dS)zeInitialize an instance.

        Optional argument x controls seeding, as for Random.seed().
        N)r�
gauss_next)�self�x�r6�/usr/lib64/python3.8/random.py�__init__^s
zRandom.__init__cKsJ|jD]>}d|jkrqFd|jkr.|j|_qFd|jkr|j|_qFqdS)aControl how subclasses generate random integers.

        The algorithm a subclass can use depends on the random() and/or
        getrandbits() implementation available to it and determines
        whether it can generate random integers from arbitrarily large
        ranges.
        �
_randbelowr(rN)�__mro__�__dict__�_randbelow_with_getrandbitsr9�_randbelow_without_getrandbits)�cls�kwargs�cr6r6r7�__init_subclass__gs	



zRandom.__init_subclass__r1cs�|dkr�t|ttf�r�t|t�r*|�d�n|}|rBt|d�d>nd}tt|�D]}d||Ad@}qP|t|�N}|dkr~dn|}|d	kr�t|tttf�r�t|t�r�|��}|t	|��
�7}t�|d
�}t
��|�d|_dS)aInitialize internal state from hashable object.

        None or no argument seeds from current time or from an operating
        system specific randomness source if available.

        If *a* is an int, all bits are used.

        For version 2 (the default), all of the bits are used if *a* is a str,
        bytes, or bytearray.  For version 1 (provided for reproducing random
        sequences from older versions of Python), the algorithm for str and
        bytes generates a narrower range of seeds.

        �zlatin-1r�iCBl����������r1�bigN)�
isinstance�str�bytes�decode�ord�map�len�	bytearray�encode�_sha512Zdigest�int�
from_bytes�superrr3)r4�a�versionr5r@��	__class__r6r7r{s
zRandom.seedcs|jt���|jfS)z9Return internal state; can be passed to setstate() later.)�VERSIONrSr&r3�r4rVr6r7r&�szRandom.getstatec
s�|d}|dkr*|\}}|_t��|�nt|dkr�|\}}|_ztdd�|D��}Wn(tk
r|}z
t|�W5d}~XYnXt��|�ntd||jf��dS)z:Restore internal state from object returned by getstate().rr2r1css|]}|dVqdS)lNr6)�.0r5r6r6r7�	<genexpr>�sz"Random.setstate.<locals>.<genexpr>Nz?state with version %s passed to Random.setstate() of version %s)r3rSr'�tuple�
ValueError�	TypeErrorrX)r4�staterUZ
internalstaterrVr6r7r'�s�zRandom.setstatecCs|��S�N)r&rYr6r6r7�__getstate__�szRandom.__getstate__cCs|�|�dSr`)r')r4r_r6r6r7�__setstate__�szRandom.__setstate__cCs|jd|��fS)Nr6)rWr&rYr6r6r7�
__reduce__�szRandom.__reduce__rBc
Cs||�}||krtd��|dkr:|dkr2|�|�Std��||�}||krRtd��||}|dkrx|dkrx||�|�S|dkr�td|||f��||�}||kr�td��|dkr�||d|}	n"|dkr�||d|}	ntd	��|	dkr�td��|||�|	�S)
z�Choose a random item from range(start, stop[, step]).

        This fixes the problem with randint() which includes the
        endpoint; in Python this is usually not what you want.

        z!non-integer arg 1 for randrange()Nrzempty range for randrange()z non-integer stop for randrange()rBz(empty range for randrange() (%d, %d, %d)z non-integer step for randrange()zzero step for randrange())r]r9)
r4�start�stop�step�_intZistartZistop�widthZistep�nr6r6r7r�s4

zRandom.randrangecCs|�||d�S)zJReturn random integer in range [a, b], including both end points.
        rB)r�r4rT�br6r6r7r�szRandom.randintcCs,|j}|��}||�}||kr(||�}q|S)zCReturn a random int in the range [0,n).  Raises ValueError if n==0.)r(�
bit_length)r4rir(�k�rr6r6r7r<�s
z"Random._randbelow_with_getrandbitscCsn|j}||kr$td�||�|�S|dkr4td��||}|||}|�}||kr^|�}qN|||�|S)z�Return a random int in the range [0,n).  Raises ValueError if n==0.

        The implementation does not use getrandbits, but only random.
        z�Underlying random() generator does not supply 
enough bits to choose from a population range this large.
To remove the range limitation, add a getrandbits() method.rzBoundary cannot be zero)r�_warnr])r4rirQ�maxsizerZrem�limitrnr6r6r7r=sz%Random._randbelow_without_getrandbitscCs:z|�t|��}Wntk
r0td�d�YnX||S)z2Choose a random element from a non-empty sequence.z$Cannot choose from an empty sequenceN)r9rMr]�
IndexError)r4�seq�ir6r6r7rs
z
Random.choicecCs�|dkrN|j}ttdt|���D]*}||d�}||||||<||<q nHt}ttdt|���D]0}||�|d�}||||||<||<qddS)z�Shuffle list x in place, and return None.

        Optional argument random is a 0-argument function returning a
        random float in [0.0, 1.0); if it is the default None, the
        standard random.random will be used.

        NrB)r9�reversed�rangerMrQ)r4r5r�	randbelowrt�jrgr6r6r7r%s	zRandom.shufflecCst|t�rt|�}t|t�s$td��|j}t|�}d|krF|ksPntd��dg|}d}|dkr�|dtt	|dd��7}||kr�t
|�}t|�D]0}|||�}	||	||<|||d	||	<q�nHt�}
|
j
}t|�D]2}||�}	|	|
kr�||�}	q�||	�||	||<q�|S)
a=Chooses k unique random elements from a population sequence or set.

        Returns a new list containing elements from the population while
        leaving the original population unchanged.  The resulting list is
        in selection order so that all sub-slices will also be valid random
        samples.  This allows raffle winners (the sample) to be partitioned
        into grand prize and second place winners (the subslices).

        Members of the population need not be hashable or unique.  If the
        population contains repeats, then each occurrence is a possible
        selection in the sample.

        To choose a sample in a range of integers, use range as an argument.
        This is especially fast and space efficient for sampling from a
        large population:   sample(range(10000000), 60)
        z>Population must be a sequence or set.  For dicts, use list(d).rz,Sample larger than population or is negativeN��r+r2rB)rG�_Setr\�	_Sequencer^r9rMr]�_ceil�_log�listrv�set�add)r4�
populationrmrwri�resultZsetsizeZpoolrtrxZselectedZselected_addr6r6r7r;s6)



z
Random.sample)�cum_weightsrmcs�|j�t����dkrV|dkrHt��d7�����fdd�td|�D�Stt|���n|dk	rftd��t���krztd��t��dd��d�������fd	d�td|�D�S)
z�Return a k sized list of population elements chosen with replacement.

        If the relative weights or cumulative weights are not specified,
        the selections are made with equal probability.

        N�csg|]}�������qSr6r6�rZrt)rgrir�rr6r7�
<listcomp>�sz"Random.choices.<locals>.<listcomp>z2Cannot specify both weights and cumulative weightsz3The number of weights does not match the populationrDrBcs$g|]}������d���qS)rr6r�)rr��hir�r�totalr6r7r��s�)	rrMrQ�_repeatr�_accumulater^r]�_bisect)r4r�Zweightsr�rmr6)rgrr�r�rir�rr�r7r)�s$�zRandom.choicescCs||||��S)zHGet a random number in the range [a, b) or [a, b] depending on rounding.�rrjr6r6r7r�szRandom.uniformr�r.cCs||��}z |dkrdn||||}Wntk
r@|YSX||krdd|}d|}||}}|||t||�S)z�Triangular distribution.

        Continuous distribution bounded by given lower and upper limits,
        and having a given mode value in-between.

        http://en.wikipedia.org/wiki/Triangular_distribution

        N��?r.)r�ZeroDivisionError�_sqrt)r4ZlowZhigh�mode�ur@r6r6r7r!�s	 

zRandom.triangularcCsP|j}|�}d|�}t|d|}||d}|t|�krqDq|||S)z\Normal distribution.

        mu is the mean, and sigma is the standard deviation.

        r.r�r-)r�
NV_MAGICCONSTr~)r4�mu�sigmar�u1�u2�zZzzr6r6r7r�s

zRandom.normalvariatecCst|�||��S)z�Log normal distribution.

        If you take the natural logarithm of this distribution, you'll get a
        normal distribution with mean mu and standard deviation sigma.
        mu can have any value, and sigma must be greater than zero.

        )�_expr)r4r�r�r6r6r7r�szRandom.lognormvariatecCstd|���|S)a^Exponential distribution.

        lambd is 1.0 divided by the desired mean.  It should be
        nonzero.  (The parameter would be called "lambda", but that is
        a reserved word in Python.)  Returned values range from 0 to
        positive infinity if lambd is positive, and from negative
        infinity to 0 if lambd is negative.

        r.)r~r)r4Zlambdr6r6r7r�szRandom.expovariatecCs�|j}|dkrt|�Sd|}|td||�}|�}tt|�}|||}|�}	|	d||ks�|	d|t|�kr4q�q4d|}
|
|d|
|}|�}|dkr�|t|�t}
n|t|�t}
|
S)aFCircular data distribution.

        mu is the mean angle, expressed in radians between 0 and 2*pi, and
        kappa is the concentration parameter, which must be greater than or
        equal to zero.  If kappa is equal to zero, this distribution reduces
        to a uniform random angle over the range 0 to 2*pi.

        g���ư>r�r.)r�TWOPIr��_cos�_pir��_acos)r4r�Zkappar�srnr�r��dr��q�fZu3Zthetar6r6r7r�s$
$zRandom.vonmisesvariatecCs~|dks|dkrtd��|j}|dkr�td|d�}|t}||}|�}d|kr`dksdqFqFd|�}t|d|�|}	|t|	�}
|||}|||	|
}|td|dks�|t|�krF|
|SqFn�|dkr�td|��|S|�}
t|t}||
}|dk�r$|d|}
nt|||�}
|�}|dk�r^||
|dk�rp�qrq�|t|
�kr�qrq�|
|SdS)	aZGamma distribution.  Not the gamma function!

        Conditions on the parameters are alpha > 0 and beta > 0.

        The probability distribution function is:

                    x ** (alpha - 1) * math.exp(-x / beta)
          pdf(x) =  --------------------------------------
                      math.gamma(alpha) * beta ** alpha

        r�z*gammavariate: alpha and beta must be > 0.0r.r,gH�����z>g�P���?r/N)r]rr��LOG4r~r��
SG_MAGICCONST�_e)r4�alpha�betarZainvZbbbZcccr�r��vr5r�rnr�rk�pr6r6r7r #s@
 

zRandom.gammavariatecCs`|j}|j}d|_|dkrT|�t}tdtd|���}t|�|}t|�||_|||S)z�Gaussian distribution.

        mu is the mean, and sigma is the standard deviation.  This is
        slightly faster than the normalvariate() function.

        Not thread-safe without a lock around calls.

        Ng�r.)rr3r�r�r~r��_sin)r4r�r�rr�Zx2piZg2radr6r6r7r"hs
zRandom.gausscCs0|�|d�}|dkrdS|||�|d�SdS)z�Beta distribution.

        Conditions on the parameters are alpha > 0 and beta > 0.
        Returned values range between 0 and 1.

        r.rr�N)r )r4r�r��yr6r6r7r#�s
zRandom.betavariatecCsd|��}d|d|S)z3Pareto distribution.  alpha is the shape parameter.r.r�)r4r�r�r6r6r7r$�szRandom.paretovariatecCs"d|��}|t|�d|S)zfWeibull distribution.

        alpha is the scale parameter and beta is the shape parameter.

        r.)rr~)r4r�r�r�r6r6r7r%�szRandom.weibullvariate)N)Nr1)N)N)r�r.N)$�__name__�
__module__�__qualname__�__doc__rXr8rArr&r'rarbrcrQrrr<�BPFr=r9rrrr)rr!rrrrr r"r#r$r%�
__classcell__r6r6rVr7rNs<

	 ,

G
0E5	c@s8eZdZdZdd�Zdd�Zdd�Zdd	�ZeZZ	d
S)r*z�Alternate random number generator using sources provided
    by the operating system (such as /dev/urandom on Unix or
    CryptGenRandom on Windows).

     Not available on all systems (see os.urandom() for details).
    cCst�td�d�d?tS)z3Get the next random number in the range [0.0, 1.0).rCrFr2)rQrR�_urandom�	RECIP_BPFrYr6r6r7r�szSystemRandom.randomcCs<|dkrtd��|dd}t�t|�d�}||d|?S)z:getrandbits(k) -> x.  Generates an int with k random bits.rz(number of bits must be greater than zerorC�rF)r]rQrRr�)r4rmZnumbytesr5r6r6r7r(�s
zSystemRandom.getrandbitscOsdS)z<Stub method.  Not used for a system random number generator.Nr6�r4�args�kwdsr6r6r7r�szSystemRandom.seedcOstd��dS)zAMethod should not be called for a system random number generator.z*System entropy source does not have state.N)�NotImplementedErrorr�r6r6r7�_notimplemented�szSystemRandom._notimplementedN)
r�r�r�r�rr(rr�r&r'r6r6r6r7r*�scCs�ddl}t|d|j�d}d}d}d}|��}t|�D]4}	||�}
||
7}||
|
}t|
|�}t|
|�}q6|��}tt||d�ddd	�||}t||||�}
td
||
||f�dS)Nr�timesr�g _�Bg _��r2zsec,� )�endz"avg %g, stddev %g, min %g, max %g
)	�time�printr��perf_counterrv�min�max�roundr�)ri�funcr�r�r�ZsqsumZsmallestZlargestZt0rtr5�t1ZavgZstddevr6r6r7�_test_generator�s(

�r���cCs�t|td�t|td�t|td�t|td�t|td�t|td�t|td�t|td�t|td�t|td�t|td	�t|td
�t|td�t|td�t|td�t|td
�dS)Nr6)r�r.)g{�G�z�?r.)皙�����?r.)r�r,)r�r.)g�������?r.)r.r.)r,r.)g4@r.)gi@r.)�@r�)r�r.gUUUUUU�?)	r�rrrrr r"r#r!)�Nr6r6r7�_test�s r��fork)Zafter_in_child�__main__)r�)Qr��warningsrroZmathrr~rr�rr�rr�rr}rr�r	r�r
r�rr��osrr��_collections_abcr
r{rr|�	itertoolsrr�rr�rr��_osrPr�ImportErrorZhashlib�__all__r�r�r�r�r�r�Z_randomrr*r�r�Z_instrrrr!rrrrrr)rrrrr r"r#r$r%r&r'r(�hasattr�register_at_forkr�r6r6r6r7�<module>s�'�
{

__pycache__/datetime.cpython-38.opt-2.pyc000064400000134612151153537610014156 0ustar00U

e5d�X�
@sRddlZddlZddlZdd�ZdZdZdZddd	dd
dd
ddd
dd
dg
Z	dgZ
dZe	dd�D]Ze
�
e�ee7Zq`[[dd�Zd
d�Zdd�Zdd�Zdd�Zed�Zed�Zed�Zdd�Zdddddddd d!d"d#d$d%g
Zdd&d'd(d)d*d+d,gZd-d.�Zdhd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�Zd:d;�Zd<d=�Z d>d?�Z!d@dA�Z"dBdC�Z#dDdE�Z$dFdG�Z%dHdI�Z&dJdK�Z'GdLdM�dM�Z(e(dN�e(_)e(dOdPdQdQdRdS�e(_*e(ddT�e(_+GdUdV�dV�Z,e,Z-e,ddd�e,_)e,ddWd�e,_*e(ddX�e,_+GdYdZ�dZ�Z.e.Z/Gd[d\�d\�ZeZ0eddd�e_)edPdQdQdR�e_*e(ddT�e_+Gd]d^�d^e,�Z1e1ddd�e1_)e1ddWddPdQdQdR�e1_*e(ddT�e1_+d_d`�Z2Gdadb�dbe.�Z3e3�4e(d��e3_5e3�4e(dPdQdc��e3_)e3�4e(dPdQdc��e3_*e1dddde3j5de�Z6zddfl7TWne8k
�r�YnXX[[
[	[[[[6[[[[#["[$[%[ [![[&[-[[[[[[[2[[[[0[/[[['[[[ddgl7m9Z9dS)i�NcCs||krdS||krdSdS)Nr�������x�yrr� /usr/lib64/python3.8/datetime.py�_cmpsr	ri'i۹7r���cCs$|ddko"|ddkp"|ddkS)N�r�d�r)�yearrrr�_is_leap%srcCs(|d}|d|d|d|dS)Nr�mr
rrr)rrrrr�_days_before_year)srcCs|dkrt|�rdSt|S)N��)r�_DAYS_IN_MONTH�r�monthrrr�_days_in_month.srcCst||dkot|�S�Nr)�_DAYS_BEFORE_MONTHrrrrr�_days_before_month5srcCs t||�}t|�t||�|S�N)rrr�rr�day�dimrrr�_ymd2ord:s
��r!i��e�c	Cs�|d8}t|t�\}}|dd}t|t�\}}t|t�\}}t|d�\}}||d|d|7}|dkst|dkr�|dddfS|dko�|d	kp�|dk}|d
d?}t||dko�|}||kr�|d8}|t||dko�|8}||8}|||dfS)
Nrrrrr
�r
���2r#r)�divmod�_DI400Y�_DI100Y�_DI4Yrr)	�nZn400rZn100Zn4Zn1ZleapyearrZ	precedingrrr�_ord2ymdSs"r-ZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDecZMonZTueZWedZThuZFriZSatZSunc	Cs>t|||�dd}t||�|}t�|||||||||f	�S�N��)r!r�_time�struct_time)	r�m�d�hh�mm�ssZdstflagZwdayZdnumrrr�_build_struct_time�sr8�autocCstdddddd�}|dkr&|r dnd	}n|d
kr6|d}z||}Wntk
r^td��YnX|�||||�SdS)
Nz{:02d}z
{:02d}:{:02d}z{:02d}:{:02d}:{:02d}z{:02d}:{:02d}:{:02d}.{:03d}z{:02d}:{:02d}:{:02d}.{:06d})�hours�minutes�seconds�milliseconds�microsecondsr9r>r<r=��zUnknown timespec value)�KeyError�
ValueError�format)r5r6r7�us�timespecZspecs�fmtrrr�_format_time�s�rFcCs�d}|dk	r�|jdkr"d}|}nd}t|tdd��\}}t|tdd��\}}|d|||f7}|sj|jr�|d	|j7}|jr�|d
|j7}|S)N�r�-�+r�r:�r;z%s%02d:%02dz:%02d�.%06d)�daysr(�	timedeltar>r<)�off�s�signr5r6r7rrr�_format_offset�s

rRcCs�d}d}d}g}|j}dt|�}}	||	k�r�||}
|d7}|
dk�r�||	k�r�||}
|d7}|
dkr�|dkr�dt|dd�}|�|��q�|
dk�r^|dk�rRd}t|d	��rR|��}|dk	�rRd
}|jdkr�|}d}t|tdd��\}
}t|tdd
��\}}|j}|j	}|�r,d||
|||f}n&|�rDd||
||f}nd||
|f}|�|�n^|
dk�r�|dk�r�d}t|d��r�|�
�}|dk	�r�|�dd�}|�|�n|d�||
�n|d�q$||
�q$d�|�}t
�||�S)Nrr�%�fz%06d�microsecond�zrG�	utcoffsetrIrHrJrKz%c%02d%02d%02d.%06dz%c%02d%02d%02dz
%c%02d%02d�Z�tznamez%%)�append�len�getattr�hasattrrWrMr(rNr<r>rY�replace�joinr1�strftime)�objectrB�	timetupleZfreplaceZzreplaceZZreplaceZ	newformat�push�ir,Zch�offsetrQ�h�restr3rP�urrr�_wrap_strftime�sl


�










ricCsjt|dd��}|ddkr,td|d��t|dd��}|ddkrPtd��t|dd	��}|||gS)
Nrr
rHzInvalid date separator: %sr#r0zInvalid date separator��
)�intrA)Zdtstrrrrrrr�_parse_isoformat_datesrmcCs
t|�}ddddg}d}tdd�D]t}||dkr:td��t|||d��||<|d7}|||d�}|rv|dkrzq�|dkr�td|��|d7}q"||k�r||dkr�td	��nN|d7}||}|d
kr�td	��t||d��|d<|dk�r|dd9<|S)Nrr%rzIncomplete time componentr�:zInvalid time separator: %c�.zInvalid microsecond component)r%r/r?)r[�rangerArl)�tstr�len_str�
time_comps�pos�compZ	next_charZ
len_remainderrrr�_parse_hh_mm_ss_ffs2



rvc
Cs�t|�}|dkrtd��|�d�dp2|�d�d}|dkrL|d|d�n|}t|�}d}|dkr�||d�}t|�dkr�td��t|�}td	d
�|D��r�tj}nD||ddkr�dnd}t|d|d|d|dd
�}	t||	�}|�|�|S)NrzIsoformat time too shortrHrrIr)r#rj�zMalformed time zone stringcss|]}|dkVqdS)rNr)�.0rrrr�	<genexpr>Tsz(_parse_isoformat_time.<locals>.<genexpr>rr%�r:r;r<r>)	r[rA�findrv�all�timezone�utcrNrZ)
rqrrZtz_posZtimestrrsZtziZtzstrZtz_compsZtzsignZtdrrr�_parse_isoformat_time;s,�
rcCs&|dk	r"t|t�s"tdt|���dS)Nz4tzinfo.tzname() must return None or string, not '%s')�
isinstance�str�	TypeError�type)�namerrr�
_check_tznameds�r�cCs^|dkrdSt|t�s*td|t|�f��td�|krHtd�ksZntd||f��dS)Nz3tzinfo.%s() must return None or timedelta, not '%s'rzN%s()=%s, must be strictly between -timedelta(hours=24) and timedelta(hours=24))r�rNr�r�rA)r�rerrr�_check_utc_offsetos

� �r�cCs�t|t�r|St|t�r td��z|��}Wntk
r@Yn"Xt|t�s^tdt|�j��|S|}z|��}Wntk
r�YnDXt|t�s�tdt|�j��ddl	}|j
dt|�jtdd�|Stdt|�j��dS)Nz$integer argument expected, got floatz$__index__ returned non-int (type %s)z"__int__ returned non-int (type %s)rz$an integer is required (got type %s)r)�
stacklevel)r�rl�floatr��	__index__�AttributeErrorr��__name__�__int__�warnings�warn�DeprecationWarning)�valueZorigr�rrr�_check_int_field{sB


�
����r�cCs�t|�}t|�}t|�}t|kr,tks@ntdttf|��d|krTdks`ntd|��t||�}d|kr~|ks�ntd||��|||fS)Nzyear must be in %d..%drr$zmonth must be in 1..12zday must be in 1..%d)r��MINYEAR�MAXYEARrArrrrr�_check_date_fields�s

r�cCs�t|�}t|�}t|�}t|�}d|kr4dks@ntd|��d|krTdks`ntd|��d|krtdks�ntd|��d|kr�dks�ntd|��|d	kr�td
|��|||||fS)Nr�zhour must be in 0..23�;zminute must be in 0..59zsecond must be in 0..59�?Bz microsecond must be in 0..999999)rrzfold must be either 0 or 1)r�rA)�hour�minute�secondrU�foldrrr�_check_time_fields�s




r�cCs|dk	rt|t�std��dS)Nz4tzinfo argument must be None or of a tzinfo subclass)r��tzinfor�)�tzrrr�_check_tzinfo_arg�sr�cCs tdt|�jt|�jf��dS)Nzcan't compare '%s' to '%s')r�r�r�rrrr�	_cmperror�s�r�cCsRt||�\}}|d9}|dkr&||kn||k}|sF||krN|ddkrN|d7}|S)Nrrr)r()�a�b�q�rZgreater_than_halfrrr�_divide_and_round�sr�c@seZdZdZd>dd�Zdd�Zdd�Zd	d
�Zedd��Z	ed
d��Z
edd��Zdd�ZeZ
dd�Zdd�Zdd�Zdd�Zdd�Zdd�ZeZdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Z d7d8�Z!d9d:�Z"d;d<�Z#d=S)?rN)�_days�_seconds�
_microseconds�	_hashcodercCs�d}}	}
||d7}||d|d7}||d7}t|t�rtt�|�\}}t�|d�\}}
t|
�}	t|�}nd}|}t|t�r�t�|�\}}t|�}||7}n|}t|d�\}}||7}|	t|�7}	|d	}t|t��rt||�}t|d
�\}}t|d�\}}||7}|	|7}	n@t|�}t|d
�\}}t|d�\}}||7}|	|7}	t||�}t|d
�\}}
|	|7}	t|	d�\}}	||7}t|�dk�r�td|��t	�
|�}||_|	|_|
|_
d
|_|S)Nrr0�<�r?g�@g�Q���.A�@B�ɚ;z$timedelta # of days is too large: %dr)r�r��_math�modfrlr(�round�abs�
OverflowErrorra�__new__r�r�r�r�)�clsrMr<r>r=r;r:Zweeksr4rPrCZdayfracZdaysecondsfracZdaysecondswholeZsecondsfracZusdouble�selfrrrr��sZ




ztimedelta.__new__cCspg}|jr|�d|j�|jr0|�d|j�|jrF|�d|j�|sT|�d�d|jj|jjd�|�fS)Nzdays=%dz
seconds=%dzmicroseconds=%d�0�	%s.%s(%s)�, )r�rZr�r��	__class__�
__module__�__qualname__r_)r��argsrrr�__repr__Ms
�ztimedelta.__repr__cCsdt|jd�\}}t|d�\}}d|||f}|jrLdd�}d||j�|}|jr`|d|j}|S)Nr�z%d:%02d:%02dcSs|t|�dkrdpdfS)NrrPrG)r�)r,rrr�plural`sz!timedelta.__str__.<locals>.pluralz
%d day%s, rL)r(r�r�r�)r�r6r7r5rPr�rrr�__str__[sztimedelta.__str__cCs|jd|jd|jdS�Nr�r�)rMr<r>�r�rrr�
total_secondsgs
��ztimedelta.total_secondscCs|jSr�r�r�rrrrMmsztimedelta.dayscCs|jSr)r�r�rrrr<rsztimedelta.secondscCs|jSr)r�r�rrrr>wsztimedelta.microsecondscCs2t|t�r.t|j|j|j|j|j|j�StSr�r�rNr�r�r��NotImplemented�r��otherrrr�__add__|s


�ztimedelta.__add__cCs2t|t�r.t|j|j|j|j|j|j�StSrr�r�rrr�__sub__�s


�ztimedelta.__sub__cCst|t�r||StSr)r�rNr�r�rrr�__rsub__�s

ztimedelta.__rsub__cCst|j|j|j�Sr)rNr�r�r�r�rrr�__neg__�s�ztimedelta.__neg__cCs|Srrr�rrr�__pos__�sztimedelta.__pos__cCs|jdkr|S|SdS�Nrr�r�rrr�__abs__�s
ztimedelta.__abs__cCs`t|t�r(t|j||j||j|�St|t�r\|��}|��\}}tddt	|||��St
Sr�)r�rlrNr�r�r�r��_to_microseconds�as_integer_ratior�r��r�r��usecr�r�rrr�__mul__�s

�
ztimedelta.__mul__cCs|jd|jd|jSr��r�r�r�r�rrrr��s�ztimedelta._to_microsecondscCsNt|ttf�stS|��}t|t�r0||��St|t�rJtdd||�SdSr�)r�rlrNr�r�)r�r�r�rrr�__floordiv__�s

ztimedelta.__floordiv__cCs~t|tttf�stS|��}t|t�r2||��St|t�rNtddt||��St|t�rz|��\}}tddt|||��SdSr�)r�rlr�rNr�r�r�r�r�rrr�__truediv__�s


ztimedelta.__truediv__cCs*t|t�r&|��|��}tdd|�StSr�)r�rNr�r�)r�r�r�rrr�__mod__�s
ztimedelta.__mod__cCs4t|t�r0t|��|���\}}|tdd|�fStSr�)r�rNr(r�r�)r�r�r�r�rrr�
__divmod__�s
�ztimedelta.__divmod__cCs t|t�r|�|�dkStSdSr��r�rNr	r�r�rrr�__eq__�s
ztimedelta.__eq__cCs t|t�r|�|�dkStSdSr�r�r�rrr�__le__�s
ztimedelta.__le__cCs t|t�r|�|�dkStSdSr�r�r�rrr�__lt__�s
ztimedelta.__lt__cCs t|t�r|�|�dkStSdSr�r�r�rrr�__ge__�s
ztimedelta.__ge__cCs t|t�r|�|�dkStSdSr�r�r�rrr�__gt__�s
ztimedelta.__gt__cCst|��|���Sr)r	�	_getstater�rrrr	�sztimedelta._cmpcCs|jdkrt|���|_|jS�Nr�r��hashr�r�rrr�__hash__�s
ztimedelta.__hash__cCs|jdkp|jdkp|jdkSr�r�r�rrr�__bool__s

��ztimedelta.__bool__cCs|j|j|jfSrr�r�rrrr�
sztimedelta._getstatecCs|j|��fSr�r�r�r�rrr�
__reduce__
sztimedelta.__reduce__N)rrrrrrr)$r�r�r��	__slots__r�r�r�r��propertyrMr<r>r��__radd__r�r�r�r�r�r��__rmul__r�r�r�r�r�r�r�r�r�r�r	r�r�r�r�rrrrrN�sP�
e


		
		rNi6e�r�r�r�r�)rMr:r;r<r>)r>c@s<eZdZdZdCdd�Zedd��Zedd��Zed	d
��Zedd��Z	ed
d��Z
dd�Zdd�Zdd�Z
dd�Zdd�ZeZedd��Zedd��Zedd��Zdd �Zd!d"�ZdDd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�ZeZ d5d6�Z!d7d8�Z"d9d:�Z#d;d<�Z$d=d>�Z%d?d@�Z&dAdB�Z'dS)E�date)�_year�_month�_dayr�NcCs�|dkr�t|ttf�r�t|�dkr�dt|dd��krBdkr�nnTt|t�r|z|�d�}Wntk
rztd��YnXt�	|�}|�
|�d|_|St|||�\}}}t�	|�}||_
||_||_d|_|S)	Nr
rrr%r$�latin1znFailed to encode latin1 string when unpickling a date object. pickle.load(data, encoding='latin1') is assumed.r)r��bytesr�r[�ord�encode�UnicodeEncodeErrorrArar��_date__setstater�r�r�r�r�)r�rrrr�rrrr�3s8�
���

�



zdate.__new__c	Cs(t�|�\	}}}}}}}}	}
||||�Sr)r1�	localtime)r��trr3r4r5r6r7�weekday�jday�dstrrr�
fromtimestampUszdate.fromtimestampcCst��}|�|�Sr�r1�timer��r�r�rrr�today[sz
date.todaycCst|�\}}}||||�Sr)r-)r�r,rr3r4rrr�fromordinalaszdate.fromordinalcCsHt|t�std��z|t|��WStk
rBtd|����YnXdS�N�#fromisoformat: argument must be str�Invalid isoformat string: )r�r�r�rm�	ExceptionrA)r��date_stringrrr�
fromisoformatks
zdate.fromisoformatc	Cs�t|krtks$ntd|����d|kr8dks�nd}|dkrrt|dd�d}|dksn|dkrrt|�rrd	}|r�td
|����d|kr�dks�ntd|�d
���|dd|d}t|�}||}|t|��S)NzYear is out of range: r�5Trr0r
r%FzInvalid week: rjzInvalid weekday: z (range is [1, 7]))r�r�rAr!r�_isoweek1mondayr-)	r�r�weekrZout_of_rangeZ
first_weekdayZ
day_offsetZday_1Zord_dayrrr�fromisocalendarws$�zdate.fromisocalendarcCs d|jj|jj|j|j|jfS)Nz%s.%s(%d, %d, %d))r�r�r�r�r�r�r�rrrr��s�z
date.__repr__cCs.|��dpd}dt|t|j|j|jfS)Nr0z%s %s %2d 00:00:00 %04d)�	toordinal�	_DAYNAMES�_MONTHNAMESr�r�r��r�r�rrr�ctime�s�z
date.ctimecCst|||���Sr)rirb�r�rErrrr`�sz
date.strftimecCs:t|t�stdt|�j��t|�dkr2|�|�St|�S�Nzmust be str, not %sr�r�r�r�r�r�r[r`rrrr�
__format__�s


zdate.__format__cCsd|j|j|jfS)Nz%04d-%02d-%02d)r�r�r�r�rrr�	isoformat�s	zdate.isoformatcCs|jSr)r�r�rrrr�sz	date.yearcCs|jSr)r�r�rrrr�sz
date.monthcCs|jSr)r�r�rrrr�szdate.daycCst|j|j|jdddd�S)Nrr)r8r�r�r�r�rrrrb�s�zdate.timetuplecCst|j|j|j�Sr)r!r�r�r�r�rrrr�szdate.toordinalcCs:|dkr|j}|dkr|j}|dkr*|j}t|�|||�Sr)r�r�r�r�)r�rrrrrrr^�szdate.replacecCst|t�r|�|�dkStSr��r�r�r	r�r�rrrr��s
zdate.__eq__cCst|t�r|�|�dkStSr�rr�rrrr�s
zdate.__le__cCst|t�r|�|�dkStSr�rr�rrrr�s
zdate.__lt__cCst|t�r|�|�dkStSr�rr�rrrr�
s
zdate.__ge__cCst|t�r|�|�dkStSr�rr�rrrr�s
zdate.__gt__cCsB|j|j|j}}}|j|j|j}}}t|||f|||f�Sr)r�r�r�r	)r�r�rr3r4Zy2Zm2Zd2rrrr	sz	date._cmpcCs|jdkrt|���|_|jSr�r�r�rrrr�s
z
date.__hash__cCsJt|t�rF|��|j}d|kr,tkr>nnt|��|�Std��tS)Nr�result out of range)	r�rNrrM�_MAXORDINALr�rr�r�)r�r��orrrr�%s
zdate.__add__cCsDt|t�r|t|j�St|t�r@|��}|��}t||�StSr)r�rNrMr�rr�)r�r��days1�days2rrrr�0s

zdate.__sub__cCs|��ddSr.�rr�rrrr�:szdate.weekdaycCs|��dpdS)Nr0rr�rrr�
isoweekday@szdate.isoweekdaycCs�|j}t|�}t|j|j|j�}t||d�\}}|dkr^|d8}t|�}t||d�\}}n$|dkr�|t|d�kr�|d7}d}||d|dfS)Nr0rr�4)r�r	r!r�r�r()r�r�week1mondayrr
rrrr�isocalendarEs
zdate.isocalendarcCs&t|jd�\}}t|||j|jg�fS�N�)r(r�r�r�r�)r��yhi�ylorrrr�cszdate._getstatecCs"|\}}|_|_|d||_dSr!)r�r�r�)r��stringr#r$rrr�
__setstategszdate.__setstatecCs|j|��fSrr�r�rrrr�kszdate.__reduce__)NN)NNN)(r�r�r�r�r��classmethodr�rrrrr�rr`rrr�r�rrrrbrr^r�r�r�r�r�r	r�r�r�r�r�rr r�r�r�rrrrr�sV
"


	

$



	
r�r$)rMc@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
r�rcCstd��dS)Nz&tzinfo subclass must override tzname()��NotImplementedError�r��dtrrrrY|sz
tzinfo.tznamecCstd��dS)Nz)tzinfo subclass must override utcoffset()r(r*rrrrW�sztzinfo.utcoffsetcCstd��dS)Nz#tzinfo subclass must override dst()r(r*rrrr��sz
tzinfo.dstcCs�t|t�std��|j|k	r$td��|��}|dkr<td��|��}|dkrTtd��||}|r�||7}|��}|dkr�td��||S)Nz&fromutc() requires a datetime argumentzdt.tzinfo is not selfz0fromutc() requires a non-None utcoffset() resultz*fromutc() requires a non-None dst() resultz;fromutc(): dt.dst gave inconsistent results; cannot convert)r��datetimer�r�rArWr�)r�r+ZdtoffZdtdst�deltarrr�fromutc�s"

ztzinfo.fromutccCsft|dd�}|r|�}nd}t|dd�}|r4|�}nt|dd�pBd}|dkrV|j|fS|j||fSdS)N�__getinitargs__r�__getstate__�__dict__)r\r�)r�Zgetinitargsr��getstate�staterrrr��s
ztzinfo.__reduce__N)	r�r�r�r�rYrWr�r.r�rrrrr�usr�c@s&eZdZdZdAdd�dd�Zedd��Zed	d
��Zedd��Zed
d��Z	edd��Z
edd��Zdd�Zdd�Z
dd�Zdd�Zdd�ZdBdd�Zd d!�Zd"d#�Zd$d%�ZdCd'd(�ZeZed)d*��Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�ZdDdd�d6d7�ZdEd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dS)Fr�)�_hour�_minute�_second�_microsecond�_tzinfor��_foldrN�r�cCs�t|ttf�r�t|�dkr�t|dd��d@dkr�t|t�rhz|�d�}Wntk
rftd��YnXt�	|�}|�
||p~d�d|_|St|||||�\}}}}}t
|�t�	|�}||_||_||_||_||_d|_||_|S)	Nr/rr�r&r�znFailed to encode latin1 string when unpickling a time object. pickle.load(data, encoding='latin1') is assumed.r)r�r�r�r[r�r�r�rArar��_time__setstater�r�r�r4r5r6r7r8r9)r�r�r�r�rUr�r�r�rrrr��s>
�
�

�
ztime.__new__cCs|jSr�r4r�rrrr��sz	time.hourcCs|jSr�r5r�rrrr�sztime.minutecCs|jSr�r6r�rrrr�sztime.secondcCs|jSr�r7r�rrrrUsztime.microsecondcCs|jSr�r8r�rrrr�sztime.tzinfocCs|jSr�r9r�rrrr�sz	time.foldcCs$t|t�r|j|dd�dkStSdS)NT��allow_mixedr�r�r�r	r�r�rrrr�s
ztime.__eq__cCs t|t�r|�|�dkStSdSr�rEr�rrrr�#s
ztime.__le__cCs t|t�r|�|�dkStSdSr�rEr�rrrr�)s
ztime.__lt__cCs t|t�r|�|�dkStSdSr�rEr�rrrr�/s
ztime.__ge__cCs t|t�r|�|�dkStSdSr�rEr�rrrr�5s
ztime.__gt__Fc
Cs�|j}|j}d}}||kr"d}n|��}|��}||k}|rht|j|j|j|jf|j|j|j|jf�S|dksx|dkr�|r�dStd��|jd|j|tdd�}|jd|j|tdd�}	t||j|jf|	|j|jf�S)NTrz$cannot compare naive and aware timesr�rrK)	r8rWr	r4r5r6r7r�rN)
r�r�rD�mytz�ottz�myoff�otoff�base_compareZmyhhmmZothhmmrrrr	;s2����z	time._cmpcCs�|jdkr�|jr|jdd�}n|}|��}|sBt|��d�|_nztt|j|j	d�|tdd��\}}|tdd�}d|kr�dkr�nntt
|||j|j��|_nt|||j|jf�|_|jS)	Nrrr:�r:r;rrJrKr&)
r�r�r^rWr�r�r(rNr�r�r�r�rU)r�r��tzoffrfr3rrrr�Ws
�z
time.__hash__cCs|��}t|�Sr)rWrR)r�rOrrr�_tzstrnsztime._tzstrcCs�|jdkrd|j|jf}n|jdkr2d|j}nd}d|jj|jj|j|j|f}|jdk	rx|dd�d|jd}|jr�|dd�d	}|S)
Nrz, %d, %dz, %drGz%s.%s(%d, %d%s)r�, tzinfo=%r�)�	, fold=1))	r7r6r�r�r�r4r5r8r9�r�rPrrrr�ss 

�
z
time.__repr__r9cCs0t|j|j|j|j|�}|��}|r,||7}|Sr)rFr4r5r6r7rM)r�rDrPr�rrrr�s
�ztime.isoformatcCsHt|t�std��z|t|��WStk
rBtd|����YnXdSr)r�r�r�rrrA)r�Ztime_stringrrrr�s
ztime.fromisoformatc	Cs(ddd|j|j|jdddf	}t|||�S)Nilrrr)r4r5r6ri)r�rErbrrrr`�s�z
time.strftimecCs:t|t�stdt|�j��t|�dkr2|�|�St|�Srrrrrrr�s


ztime.__format__cCs(|jdkrdS|j�d�}td|�|S�NrW�r8rWr��r�rerrrrW�s


ztime.utcoffsetcCs&|jdkrdS|j�d�}t|�|Sr�r8rYr��r�r�rrrrY�s

ztime.tznamecCs(|jdkrdS|j�d�}td|�|S�Nr��r8r�r�rTrrrr��s
	

ztime.dstTcCsl|dkr|j}|dkr|j}|dkr*|j}|dkr8|j}|dkrF|j}|dkrT|j}t|�||||||d�S�NTr:)r�r�r�rUr�r9r�)r�r�r�r�rUr�r�rrrr^�sztime.replacer%cCspt|jd�\}}t|d�\}}|j}|jr:|dkr:|d7}t||j|j|||g�}|jdkrb|fS||jfSdS�Nr"r%�)r(r7r4r9r�r5r6r8)r��protocol�us2�us3�us1rf�	basestaterrrr��s�
ztime._getstatecCst|dk	rt|t�std��|\}|_|_}}}|dkrHd|_|d|_nd|_||_|d>|Bd>|B|_||_dS)N�bad tzinfo state argr;rr[rrj)	r��
_tzinfo_classr�r5r6r9r4r7r8)r�r%r�rfr_r]r^rrrr&�sztime.__setstatecCs|j|�|�fSrr��r�r\rrr�
__reduce_ex__sztime.__reduce_ex__cCs
|�d�Sr�rdr�rrrr�sztime.__reduce__)rrrrN)F)r9)NNNNT)r%)#r�r�r�r�r�r�r�r�r�rUr�r�r�r�r�r�r�r	r�rMr�rr�r'rr`rrWrYr�r^r�r<rdr�rrrrr��sR(








		
��


r�c@s�eZdZejejZdcdd�dd�Zedd��Zedd	��Z	ed
d��Z
edd
��Zedd��Zedd��Z
edd��Zedddd��Zedd��Zededd��Zedd��Zedfdd��Zedd ��Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zdgdd�d/d0�Zd1d2�Zdhd3d4�Zd5d6�Zdid9d:�Zd;d<�Z d=d>�Z!ed?d@��Z"dAdB�Z#dCdD�Z$dEdF�Z%dGdH�Z&dIdJ�Z'dKdL�Z(dMdN�Z)dOdP�Z*djdRdS�Z+dTdU�Z,e,Z-dVdW�Z.dXdY�Z/dkd[d\�Z0d]d^�Z1d_d`�Z2dadb�Z3dS)lr,Nrr:c	Cst|ttf�r�t|�dkr�dt|dd��d@kr>dkr�nnVt|t�rxzt|d�}Wntk
rvtd��YnXt�|�}
|
�	||�d	|
_
|
St|||�\}}}t|||||	�\}}}}}	t
|�t�|�}
||
_||
_||
_||
_||
_||
_||
_||
_d	|
_
|	|
_|
S)
Nrkrrr%r;r$r�zrFailed to encode latin1 string when unpickling a datetime object. pickle.load(data, encoding='latin1') is assumed.r)r�r�r�r[r�r�rArar��_datetime__setstater�r�r�r�r�r�r�r4r5r6r7r8r9)r�rrrr�r�r�rUr�r�r�rrrr�sL��

�

�
zdatetime.__new__cCs|jSrr=r�rrrr�Csz
datetime.hourcCs|jSrr>r�rrrr�Hszdatetime.minutecCs|jSrr?r�rrrr�Mszdatetime.secondcCs|jSrr@r�rrrrURszdatetime.microsecondcCs|jSrrAr�rrrr�Wszdatetime.tzinfocCs|jSrrBr�rrrr�\sz
datetime.foldc	Cspt�|�\}}t|d�}|dkr4|d7}|d8}n|dkrL|d8}|d7}|rVtjntj}||�\	}}}	}
}}}
}}t|d�}||||	|
||||�}|dk�rbd}||kr�tj�	d�r�|S|||�dd�\}}}	}
}}||||	|
||||�}||t
d|�}|jdk�rl|||t
dd��dd�\}}}	}
}}||||	|
||||�}||k�rld|_n
|�
|�}|S)	Nr�r�rrr�r��winr/)r�r�r�r1�gmtimer��min�sys�platform�
startswithrNrMr9r.)r�r�r~r�ZfracrCZ	converterrr3r4r5r6r7r�r�r��result�max_fold_secondsZprobe1ZtransZprobe2rrr�_fromtimestamp`s4


 *

zdatetime._fromtimestampcCst|�|�||dk	|�Sr)r�ro)r�r�r�rrrr��szdatetime.fromtimestampcCs|�|dd�S)NT)ror�rrr�utcfromtimestamp�szdatetime.utcfromtimestampcCst��}|�||�Srr�)r�r�r�rrr�now�szdatetime.nowcCst��}|�|�Sr)r1r�rpr�rrr�utcnow�szdatetime.utcnowTcCs\t|t�std��t|t�s$td��|dkr2|j}||j|j|j|j|j	|j
|j||jd�	S)Nz%date argument must be a date instancez%time argument must be a time instanceTr:)
r��_date_classr��_time_classr�rrrr�r�r�rUr�)r�r�r�r�rrr�combine�s

�zdatetime.combinecCs�t|t�std��|dd�}|dd�}zt|�}Wn"tk
rXtd|����YnX|r�zt|�}Wq�tk
r�td|����Yq�Xndddddg}|||�S)Nrrrk�r)r�r�r�rmrAr)r�rZdstrrqZdate_componentsZtime_componentsrrrr�s
zdatetime.fromisoformatcCsD|��}|dkrd}n|r d}nd}t|j|j|j|j|j|j|�S)Nrrr)r�r8rrrr�r�r�)r�r�rrrrb�s�zdatetime.timetuplec
s�tddd��d}|�tdd�}�fdd�}||�|}||}||�}||kr�|||f|j}||�|}||kr�|Sn||}||}||�}	|	|kr�|S||kr�|Sttf|j||�S)N�rr�rcs>t�|�dd�\}}}}}}t||||||��tdd�S)Nr/rr)r1r�r,rN)rhrr3r4r5r6r7�Zepochrr�local�szdatetime._mktime.<locals>.local)r,rNr��maxri)
r�rnr�ryr�Zu1�t1Zu2r��t2rrxr�_mktime�s(zdatetime._mktimecCs0|jdkr |��}||jdS|t��SdS)Nr�)r8r}rU�_EPOCHr�rQrrr�	timestamp�s
zdatetime.timestampcCsT|��}|r||8}|j|j|j}}}|j|j|j}}}t||||||d�Sr�)rWrrrr�r�r�r8)r�rerr3r4r5r6r7rrr�utctimetupleszdatetime.utctimetuplecCst|j|j|j�Sr)r�r�r�r�r�rrrr�sz
datetime.datecCst|j|j|j|j|jd�S�Nr:)r�r�r�r�rUr�r�rrrr�sz
datetime.timecCs t|j|j|j|j|j|jd�Sr�)r�r�r�r�rUr8r�r�rrr�timetzs�zdatetime.timetzc	
Cs�|dkr|j}|dkr|j}|dkr*|j}|dkr8|j}|dkrF|j}|dkrT|j}|dkrb|j}|dkrp|j}|	dkr~|j}	t	|�|||||||||	d�	SrY)
rrrr�r�r�rUr�r�r�)
r�rrrr�r�r�rUr�r�rrrr^s.�zdatetime.replacecCs\|jdkr|��}n|ttdd�}t�|�}t|dd��}|j}|j}t	t|d�|�S)Nr)r<r/)
r�r}r~rNr1r�r,�	tm_gmtoff�tm_zoner})r�ZtsZlocaltmryZgmtoffZzonerrr�_local_timezone4s


zdatetime._local_timezonecCs�|dkr|��}nt|t�s$td��|j}|dkrF|��}|�|�}n,|�|�}|dkrr|jdd���}|�|�}||kr~|S||j|d�}|�|�S)Nz)tz argument must be an instance of tzinfo�r�)r�r�r�r�rWr^r.)r�r�rFZmyoffsetr~rrr�
astimezone@s 



zdatetime.astimezonecCs:|��dpd}dt|t|j|j|j|j|j|jfS)Nr0z%s %s %2d %02d:%02d:%02d %04d)	rr
rr�r�r4r5r6r�rrrrr[s�zdatetime.ctime�Tr9cCsNd|j|j|j|ft|j|j|j|j|�}|��}t	|�}|rJ||7}|S)Nz%04d-%02d-%02d%c)
r�r�r�rFr4r5r6r7rWrR)r��seprDrPrOr�rrrres��zdatetime.isoformatcCs�|j|j|j|j|j|j|jg}|ddkr2|d=|ddkrD|d=d|jj|jj	d�
tt|��f}|j
dk	r�|dd�d|j
d}|jr�|dd�d}|S)Nrrr�r�rNrOrP)r�r�r�r4r5r6r7r�r�r�r_�mapr�r8r9)r��LrPrrrr��s&��
zdatetime.__repr__cCs|jdd�S)N� )r�)rr�rrrr��szdatetime.__str__cCsddl}|�|||�Sr�)�	_strptimeZ_strptime_datetime)r�rrBr�rrr�strptime�szdatetime.strptimecCs(|jdkrdS|j�|�}td|�|SrRrSrTrrrrW�s


zdatetime.utcoffsetcCs&|jdkrdS|j�|�}t|�|SrrUrVrrrrY�s

zdatetime.tznamecCs(|jdkrdS|j�|�}td|�|SrWrXrTrrrr��s
	

zdatetime.dstcCs2t|t�r|j|dd�dkSt|t�s*tSdSdS)NTrCrF)r�r,r	r�r�r�rrrr��s


zdatetime.__eq__cCs4t|t�r|�|�dkSt|t�s&tSt||�dSr��r�r,r	r�r�r�r�rrrr��s


zdatetime.__le__cCs4t|t�r|�|�dkSt|t�s&tSt||�dSr�r�r�rrrr��s


zdatetime.__lt__cCs4t|t�r|�|�dkSt|t�s&tSt||�dSr�r�r�rrrr��s


zdatetime.__ge__cCs4t|t�r|�|�dkSt|t�s&tSt||�dSr�r�r�rrrr��s


zdatetime.__gt__Fc		Cs�|j}|j}d}}||kr"d}nT|��}|��}|rn||j|jd���krRdS||j|jd���krndS||k}|r�t|j|j|j|j|j	|j
|jf|j|j|j|j|j	|j
|jf�S|dks�|dkr�|r�dStd��||}|j
dkr�dS|r�dp�dS)NTr:rz(cannot compare naive and aware datetimesrrr)r8rWr^r�r	r�r�r�r4r5r6r7r�rM)	r�r�rDrFrGrHrIrJZdiffrrrr	�sF���
z
datetime._cmpc
Cs�t|t�stSt|��|j|j|j|jd�}||7}t|j	d�\}}t|d�\}}d|j
krhtkr�nn*t|��
t�|j
�t||||j|jd��Std��dS)Nrzr�r�rr�r)r�rNr�rr4r5r6r7r(r<rMrr�rur�rr�r>r8r�)r�r�r-r�Zremr�r�rrrr�s&
���zdatetime.__add__c	Cs�t|t�s"t|t�r||StS|��}|��}|j|jd|jd}|j|jd|jd}t|||||j|j�}|j	|j	kr�|S|�
�}|�
�}||kr�|S|dks�|dkr�td��|||S)Nr�r�z(cannot mix naive and timezone-aware time)r�r,rNr�rr6r5r4r7r8rWr�)	r�r�rrZsecs1Zsecs2�baserHrIrrrr�&s*



�zdatetime.__sub__cCs�|jdkr�|jr|jdd�}n|}|��}|dkrFt|��d�|_nDt|j|j|j	�}|j
d|jd|j}tt
|||j�|�|_|jS)Nrrr:r�r�)r�r�r^rWr�r�r!rrrr�r�r�rNrU)r�r�rLrMr<rrrr�>s
zdatetime.__hash__r%c	Cs�t|jd�\}}t|jd�\}}t|d�\}}|j}|jrJ|dkrJ|d7}t||||j|j|j|j	|||g
�}|j
dkr~|fS||j
fSdSrZ)r(r�r7r�r9r�r�r4r5r6r8)	r�r\r#r$r]r^r_r3r`rrrr�Os"�
zdatetime._getstatec	
Cs�|dk	rt|t�std��|\
}}}|_|_|_|_}}}|dkrTd|_|d|_nd|_||_|d||_	|d>|Bd>|B|_
||_dS)Nrar;rr[rr"rj)r�rbr�r�r4r5r6r9r�r�r7r8)	r�r%r�r#r$r3r_r]r^rrrr&^s"�zdatetime.__setstatecCs|j|�|�fSrr�rcrrrrdmszdatetime.__reduce_ex__cCs
|�d�Srrer�rrrr�pszdatetime.__reduce__)NNrrrrN)N)N)T)NNNNNNNT)N)r�r9)F)r%)4r�r�r�r�r�r�r�r�r�r�r�rUr�r�r'ror�rprqrrrurrbr}rr�r�r^r�r�rrr�r�r�rWrYr�r�r�r�r�r�r	r�r�r�r�r�rfrdr�rrrrr,s���$






+	



#	��



	

%
r,cCs8d}t|dd�}|dd}||}||kr4|d7}|S)Nr%rr/r0)r!)rZTHURSDAYZfirstdayZfirstweekdayrrrrr	ysr	c@s�eZdZdZe�Zefdd�Zeddd��Zdd�Z	d	d
�Z
dd�Zd
d�Zdd�Z
dd�Zdd�Zdd�Zdd�Zeddd�ZeZedd��ZdS)r})�_offset�_namecCslt|t�std��||jkr,|s&|jSd}nt|t�s>td��|j|krV|jks`ntd��|�	||�S)Nzoffset must be a timedeltazname must be a stringzYoffset must be a timedelta strictly between -timedelta(hours=24) and timedelta(hours=24).)
r�rNr��_Omittedr~r��
_minoffset�
_maxoffsetrA�_create)r�rer�rrrr��s


ztimezone.__new__NcCst�|�}||_||_|Sr)r�r�r�r�)r�rer�r�rrrr��s
ztimezone._createcCs|jdkr|jfS|j|jfSr)r�r�r�rrrr/�s
ztimezone.__getinitargs__cCst|t�r|j|jkStSr)r�r}r�r�r�rrrr��s
ztimezone.__eq__cCs
t|j�Sr)r�r�r�rrrr��sztimezone.__hash__cCsL||jkrdS|jdkr0d|jj|jj|jfSd|jj|jj|j|jfS)Nzdatetime.timezone.utcz	%s.%s(%r)z
%s.%s(%r, %r))r~r�r�r�r�r�r�rrrr��s


��ztimezone.__repr__cCs
|�d�Sr)rYr�rrrr��sztimezone.__str__cCs$t|t�s|dkr|jStd��dS)Nz8utcoffset() argument must be a datetime instance or None)r�r,r�r�r*rrrrW�sztimezone.utcoffsetcCs:t|t�s|dkr.|jdkr(|�|j�S|jStd��dS)Nz5tzname() argument must be a datetime instance or None)r�r,r��_name_from_offsetr�r�r*rrrrY�s

ztimezone.tznamecCs"t|t�s|dkrdStd��dS)Nz2dst() argument must be a datetime instance or None)r�r,r�r*rrrr��sztimezone.dstcCs2t|t�r&|j|k	rtd��||jStd��dS)Nzfromutc: dt.tzinfo is not selfz6fromutc() argument must be a datetime instance or None)r�r,r�rAr�r�r*rrrr.�s



ztimezone.fromutcr&r)r:r>c
Cs�|sdS|td�kr d}|}nd}t|tdd��\}}t|tdd��\}}|j}|j}|r�d|�|d�d	|d�d	|d�d
|d��	S|r�d|�|d�d	|d�d	|d��Sd|�|d�d	|d��S)NZUTCrrHrIrrJrKZ02drnroZ06d)rNr(r<r>)r-rQr:rgr;r<r>rrrr��s( ztimezone._name_from_offset)N)r�r�r�r�rar�r�r'r�r/r�r�r�r�rWrYr�r.rNr�r��staticmethodr�rrrrr}�s$	r}rKrwr�)�*)�__doc__)r9):r�r1Zmathr�rjr	r�r�rrrZdbmr rZrrrrr!r)r*r+r-rr
r8rFrRrirmrvrr�r�r�r�r�r�r�r�rNrirzZ
resolutionr�rsr�rbrtr,r	r}r�r~r~Z	_datetime�ImportErrorr�rrrr�<module>s�

	?�
@') 
=

�[DXatG
__pycache__/inspect.cpython-38.opt-2.pyc000064400000153635151153537610014035 0ustar00U

e5d��@s�dZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlmZddlmZmZe�Zej��D]\ZZeede<q�dZdd�Zd	d
�Zdd�Z d
d�Z!dd�Z"e#ed��rdd�Z$ndd�Z$e#ed��r&dd�Z%ndd�Z%dd�Z&dd�Z'dd�Z(dd �Z)d!d"�Z*d#d$�Z+d%d&�Z,d'd(�Z-d)d*�Z.d+d,�Z/d-d.�Z0d/d0�Z1d1d2�Z2d3d4�Z3d5d6�Z4d�d7d8�Z5ed9d:�Z6d;d<�Z7d=d>�Z8dd?�d@dA�Z9dBdC�Z:dDdE�Z;dFdG�Z<dHdI�Z=dJdK�Z>dLdM�Z?dNdO�Z@dPdQ�ZAd�dRdS�ZBiZCiZDd�dTdU�ZEdVdW�ZFdXdY�ZGGdZd[�d[eH�ZIGd\d]�d]�ZJd^d_�ZKd`da�ZLdbdc�ZMddde�ZNd�dgdh�ZOedidj�ZPdkdl�ZQedmdn�ZRdodp�ZSedqdr�ZTdsdt�ZUedudv�ZVdwdx�ZWd�dydz�ZXd{d|�ZYdddd}iieZd~d�d�d�d�d�d�d�eXfd�d��Z[eZd�d�d�d�d�d�fd�d��Z\d�d��Z]d�d��Z^d�d��Z_ed�d��Z`d�d��Zaed�d��Zbd�d�d��Zcd�d��Zded�d�ebje�Zfd�d�d��Zgd�d�d��Zhd�d��Zid�d�d��Zjd�d�d��Zkel�Zmd�d��Znd�d��Zod�d��Zpd�d��Zqd�d��Zremfd�d��Zsd�Ztd�Zud�Zvd�Zwd�d��Zxd�d��Zyd�Zzd�Z{d�Z|d�Z}d�d��Z~d�d„Ze�e�j��Z�e�e�j��Z�e�e�j�d��Z�e�e�e�ej�fZ�d�dńZ�d�d�dDŽZ�d�dɄZ�d�d˄Z�d�d̈́Z�d�dτZ�d�dфZ�d�d�dԄZ�d�d�dքZ��dd�d؄Z�d�d�dٜd�dۄZ�Gd�d݄d݃Z�Gd�d߄d߃Z�Gd�d�d�ej��Z�e�j�Z�e�j�Z�e�j�Z�e�j�Z�e�j�Z�e�d�e�d�e�d�e�d�e�d�iZ�Gd�d�d�Z�Gd�d�d�Z�Gd�d�d�Z�d�d�d�d�Z�d�d�Z�e�d�k�r�e��dS()zKa-Ping Yee <ping@lfw.org>z'Yury Selivanov <yselivanov@sprymix.com>�N)�
attrgetter)�
namedtuple�OrderedDictZCO_icCst|tj�S�N)�
isinstance�types�
ModuleType��object�r�/usr/lib64/python3.8/inspect.py�ismodule?sr
cCs
t|t�Sr)r�typer	rrr�isclassHsrcCst|tj�Sr)rr�
MethodTyper	rrr�ismethodPsrcCs:t|�st|�st|�rdSt|�}t|d�o8t|d�S)NF�__get__�__set__�rr�
isfunctionr�hasattr�r
�tprrr�ismethoddescriptorZsrcCs8t|�st|�st|�rdSt|�}t|d�p6t|d�S)NFr�
__delete__rrrrr�isdatadescriptornsr�MemberDescriptorTypecCst|tj�Sr)rrrr	rrr�ismemberdescriptor~srcCsdS�NFrr	rrrr�s�GetSetDescriptorTypecCst|tj�Sr)rrrr	rrr�isgetsetdescriptor�sr cCsdSrrr	rrrr �scCst|tj�Sr)rr�FunctionTyper	rrrr�srcCs6t|�r|j}qt�|�}t|�s&dSt|jj|@�Sr)r�__func__�	functools�_unwrap_partialr�bool�__code__�co_flags)�f�flagrrr�_has_code_flag�s
r*cCs
t|t�Sr)r*ZCO_GENERATOR��objrrr�isgeneratorfunction�sr-cCs
t|t�Sr)r*ZCO_COROUTINEr+rrr�iscoroutinefunction�sr.cCs
t|t�Sr)r*ZCO_ASYNC_GENERATORr+rrr�isasyncgenfunction�sr/cCst|tj�Sr)rr�AsyncGeneratorTyper	rrr�
isasyncgen�sr1cCst|tj�Sr)rr�
GeneratorTyper	rrr�isgenerator�sr3cCst|tj�Sr)rr�
CoroutineTyper	rrr�iscoroutine�sr5cCs6t|tj�p4t|tj�r(t|jjt@�p4t|tj	j
�Sr)rrr4r2r%�gi_coder'ZCO_ITERABLE_COROUTINE�collections�abc�	Awaitabler	rrr�isawaitable�s��r:cCst|tj�Sr)rr�
TracebackTyper	rrr�istraceback�sr<cCst|tj�Sr)rr�	FrameTyper	rrr�isframe�sr>cCst|tj�Sr)rr�CodeTyper	rrr�iscodesr@cCst|tj�Sr)rr�BuiltinFunctionTyper	rrr�	isbuiltinsrBcCs t|�pt|�pt|�pt|�Sr)rBrrrr	rrr�	isroutine&s���rCcCs�t|t�sdS|jt@rdStt|�tj�s0dSt|d�r>dS|j�	�D]\}}t
|dd�rHdSqH|jD]6}t
|dd�D]$}t
||d�}t
|dd�rzdSqzqjdS)NFT�__abstractmethods__�__isabstractmethod__r)rr�	__flags__�TPFLAGS_IS_ABSTRACT�
issubclassr8�ABCMetar�__dict__�items�getattr�	__bases__)r
�name�value�baserrr�
isabstract-s"



rQc	Cst|�r|ft|�}nd}g}t�}t|�}z:|jD].}|j��D]\}}t|tj	�rD|�
|�qDq6Wntk
r|YnX|D]~}	zt||	�}
|	|kr�t�Wn:tk
r�|D]}|	|jkr�|j|	}
q�q�Yq�YnX|r�||
�r�|�
|	|
f�|�
|	�q�|jdd�d�|S)NrcSs|dS)Nrr)Zpairrrr�<lambda>n�zgetmembers.<locals>.<lambda>��key)r�getmro�set�dirrMrJrKrr�DynamicClassAttribute�append�AttributeErrorrL�add�sort)r
Z	predicate�mro�results�	processed�namesrP�k�vrUrOrrr�
getmembersEs:




rd�	Attributezname kind defining_class objectcCsTt|�}tt|��}tdd�|D��}|f|}||}t|�}|D].}|j��D]\}}t|tj�rR|�	|�qRqDg}	t
�}
|D�]�}d}d}
d}||
k�rzz|dkr�td��t||�}
Wn"tk
r�}zW5d}~XYn�Xt|
d|�}||k�rzd}d}|D] }t||d�}||
k�r|}�q|D]B}z|�
||�}Wntk
�rXY�q(YnX||
k�r(|}�q(|dk	�rz|}|D]0}||jk�r~|j|}||k�r�|}�q��q~|dk�r�q�|
dk	�r�|
n|}t|ttjf��r�d}|}nFt|ttjf��rd}|}n*t|t��rd}|}nt|��r,d	}nd
}|	�	t||||��|
�|�q�|	S)Ncss|]}|ttfkr|VqdSr)rr
)�.0�clsrrr�	<genexpr>�sz'classify_class_attrs.<locals>.<genexpr>rJz)__dict__ is special, don't want the proxy�__objclass__z
static methodzclass method�property�method�data)rVr�tuplerXrJrKrrrYrZrW�	ExceptionrL�__getattr__r[�staticmethod�BuiltinMethodType�classmethod�ClassMethodDescriptorTyperjrCrer\)rgr^ZmetamroZclass_basesZ	all_basesrarPrbrc�resultr`rNZhomeclsZget_objZdict_obj�excZlast_clsZsrch_clsZsrch_objr,�kindrrr�classify_class_attrsss�












rwcCs|jSr)�__mro__)rgrrrrV�srV��stopcs|�dkrdd�}n�fdd�}|}t|�|i}t��}||�rx|j}t|�}||ks`t|�|krntd�|���|||<q6|S)NcSs
t|d�S�N�__wrapped__�r�r(rrr�_is_wrapper�szunwrap.<locals>._is_wrappercst|d�o�|�Sr{r}r~ryrrrsz!wrapper loop when unwrapping {!r})�id�sys�getrecursionlimitr|�len�
ValueError�format)�funcrzrr(ZmemoZrecursion_limitZid_funcrryr�unwrap�s

r�cCs|��}t|�t|���Sr)�
expandtabsr��lstrip)�lineZexplinerrr�
indentsizesr�cCsNtj�|j�}|dkrdS|j�d�dd�D]}t||�}q.t|�sJdS|S)N�.���)r��modules�get�
__module__�__qualname__�splitrLr)r�rgrNrrr�
_findclasssr�c	Cst|�rT|jD]@}|tk	rz
|j}Wntk
r<YqYnX|dk	r|SqdSt|�r�|jj}|j}t|�r�t	t	||d�d�|jkr�|}n|j
}�n$t|�r�|j}t|�}|dks�t	||�|k	r�dSn�t
|��r|j}|j}t|��r|jd||jk�r|}n|j
}n�t|t��rP|j}|j}t|�}|dk�sJt	||�|k	�r�dSnnt|��sdt|��r�|j}|j}t	||�|k	�r�dSt|��r�t	|dd�}t|t��r�||k�r�||SndS|jD]F}zt	||�j}Wntk
�r�Y�q�YnX|dk	�r�|S�q�dS)Nr"r��	__slots__)rrxr
�__doc__r[rr"�__name__�__self__rL�	__class__rr�rBr�rrj�fgetrrrir�dict)r,rP�docrN�selfrgr��slotsrrr�_finddoc sn



�


�



r�c	Cshz
|j}Wntk
r YdSX|dkrRzt|�}Wnttfk
rPYdSXt|t�s`dSt|�Sr)r�r[r��	TypeErrorr�str�cleandoc)r
r�rrr�getdoc^s

r�cCs�z|���d�}Wntk
r(YdSXtj}|dd�D]*}t|���}|r<t|�|}t||�}q<|r||d��|d<|tjkr�tdt|��D]}|||d�||<q�|r�|ds�|�	�q�|r�|ds�|�	d�q�d�
|�SdS)N�
�rr�)r�r��UnicodeErrorr��maxsizer�r��min�range�pop�join)r��linesZmarginr�Zcontent�indent�irrrr�qs(

r�cCs�t|�r(t|dd�r|jStd�|���t|�rht|d�rZtj�	|j
�}t|dd�rZ|jStd�|���t|�rv|j}t
|�r�|j}t|�r�|j}t|�r�|j}t|�r�|jStd�t|�j���dS)N�__file__z{!r} is a built-in moduler�z{!r} is a built-in classzVmodule, class, method, function, traceback, frame, or code object was expected, got {})r
rLr�r�r�rrr�r�r�r�rr"rr&r<�tb_framer>�f_coder@�co_filenamerr�)r
�modulerrr�getfile�s.
�r�cCsTtj�|�}dd�tj��D�}|��|D]"\}}|�|�r,|d|�Sq,dS)NcSsg|]}t|�|f�qSr)r�)rf�suffixrrr�
<listcomp>�s�z!getmodulename.<locals>.<listcomp>)�os�path�basename�	importlib�	machinery�all_suffixesr]�endswith)r�Zfname�suffixesZneglenr�rrr�
getmodulename�s�
r�cs�t|��tjjdd�}|tjjdd�7}t�fdd�|D��r`tj���dtjj	d�nt�fdd�tjj
D��r~dStj���r��Stt
|��dd�dk	r��S�tjkr��SdS)Nc3s|]}��|�VqdSr�r��rf�s��filenamerrrh�sz getsourcefile.<locals>.<genexpr>rc3s|]}��|�VqdSrr�r�r�rrrh�s�
__loader__)r�r�r��DEBUG_BYTECODE_SUFFIXES�OPTIMIZED_BYTECODE_SUFFIXES�anyr�r��splitext�SOURCE_SUFFIXES�EXTENSION_SUFFIXES�existsrL�	getmodule�	linecache�cache)r
Zall_bytecode_suffixesrr�r�
getsourcefile�s"
��
r�cCs,|dkrt|�pt|�}tj�tj�|��Sr)r�r�r�r��normcase�abspath)r
�	_filenamerrr�
getabsfile�sr�c
Cs�t|�r|St|d�r$tj�|j�S|dk	rD|tkrDtj�t|�Szt||�}Wntk
rhYdSX|tkr�tj�t|�Stj�	��
�D]\\}}t|�r�t|d�r�|j}|t�|d�kr�q�|t|<t|�}|j
t|<ttj�|�<q�|tk�rtj�t|�Stjd}t|d��s"dSt||j
��rJt||j
�}||k�rJ|Stjd}t||j
��r|t||j
�}	|	|k�r||SdS)Nr�r��__main__r��builtins)r
rr�r�r�r��
modulesbyfiler�r��copyrKr��_filesbymodnamer�r�r��realpathrL)
r
r��file�modnamer�r(�mainZ
mainobjectZbuiltinZ
builtinobjectrrrr��sJ
�

�




r�cCs�t|�}|rt�|�n$t|�}|�d�r4|�d�s<td��t||�}|rZt�||j	�}n
t�|�}|sptd��t
|�r�|dfSt|��r |j}t
�d|d�}g}tt|��D]F}|�||�}|r�||ddkr�||fS|�|�d	�|f�q�|�r|��||dd	fStd
��t|��r0|j}t|��r@|j}t|��rP|j}t|��r`|j}t|��r�t|d��s~td��|jd	}	t
�d
�}|	dk�r�z||	}
Wnt k
�r�td��YnX|�|
��rؐq�|	d	}	�q�||	fStd��dS)N�<�>zsource code not availablezcould not get source coderz^(\s*)class\s*z\b�cr�zcould not find class definition�co_firstlinenoz"could not find function definitionz>^(\s*def\s)|(\s*async\s+def\s)|(.*(?<!\w)lambda(:|\s))|^(\s*@)zlineno is out of boundszcould not find code object)!r�r��
checkcacher��
startswithr��OSErrorr��getlinesrJr
rr��re�compiler�r��matchrZ�groupr]rr"rr&r<r�r>r�r@rr��
IndexError)r
r�r�r�rNZpatZ
candidatesr�r��lnumr�rrr�
findsourcesf










r�c	Cs.zt|�\}}Wnttfk
r*YdSXt|�r�d}|rT|ddd�dkrTd}|t|�krz||��dkrz|d}qT|t|�kr�||dd�dkr�g}|}|t|�kr�||dd�dkr�|�||���|d}q�d�|�S�n>|dk�r*t	||�}|d}|dk�r*||�
�dd�dk�r*t	||�|k�r*||���
�g}|dk�r�|d}||���
�}|dd�dk�r�t	||�|k�r�|g|dd�<|d}|dk�r��q�||���
�}�qt|�r�|d��dk�r�g|dd�<�q�|�r |d��dk�r g|dd�<�q�d�|�SdS)	Nr�z#!r�)��#r�r�r�)r�r�r�r
r��striprZr�r�r�r�)r
r�r��startZcomments�endr�Zcommentrrr�getcommentsRsL
  

$�
$
r�c@seZdZdS)�
EndOfBlockN�r�r�r�rrrrr�sr�c@seZdZdd�Zdd�ZdS)�BlockFindercCs4d|_d|_d|_d|_d|_d|_d|_d|_dS)NrFr�)r��islambda�started�passline�indecorator�decoratorhasargs�last�	body_col0�r�rrr�__init__�szBlockFinder.__init__cCsr|jsB|jsB|dkrd|_n|dkr8|dkr2d|_d|_d|_�n,|dkrZ|jrVd|_�n|dkrv|jrtd|_d|_n�|tjkr�d|_|d|_|jr�t�|jr�|js�d|_n�|jr�n�|tj	kr�|j
dkr�|jr�|d	|_
|jd	|_d|_n�|tjk�r|jd	|_|jdk�rnt�nV|tj
k�rL|j
dk	�rn|d	|j
k�rn|d|_n"|jdk�rn|tj
tjfk�rnt�dS)
N�@T)�def�class�lambdar�(�)Frr�)r�r�r�r�r��tokenize�NEWLINEr�r��INDENTr�r��DEDENT�COMMENT�NL)r�r�tokenZsrowcolZerowcolr�rrr�
tokeneater�sL





zBlockFinder.tokeneaterN)r�r�r�r�rrrrrr��s
r�c	CsVt�}z(t�t|�j�}|D]}|j|�qWnttfk
rFYnX|d|j�Sr)	r�r�generate_tokens�iter�__next__rr��IndentationErrorr�)r�Zblockfinder�tokensZ_tokenrrr�getblock�srcCsbt|�}t|�\}}t|�r"|j}t|�s>t|�rF|jjdkrF|dfSt||d��|dfSdS)Nz<module>rr�)	r�r�r<r�r
r>r��co_namer�r
r�r�rrr�getsourcelines�s�
�rcCst|�\}}d�|�S)Nr�)rr�rrrr�	getsource�srcCsRg}|jtdd�d�|D]2}|�||jf�||kr|�t||||��q|S)Nr�r�rT)r]rrZrM�walktree)�classes�children�parentr_r�rrrr�srFcCs�i}g}|D]d}|jr^|jD]>}||kr0g||<|||krJ||�|�|r||krqpqq||kr|�|�q|D]}||krv|�|�qvt||d�Sr)rMrZr)r�uniquer�rootsr�rrrr�getclasstree�s"	
r�	Argumentszargs, varargs, varkwc	Cs�t|�std�|���|j}|j}|j}t|d|��}t||||��}d}||7}d}|jt@rx|j|}|d}d}|jt	@r�|j|}t
||||�S)Nz{!r} is not a code objectrr�)r@r�r��co_varnames�co_argcount�co_kwonlyargcount�listr'�
CO_VARARGS�CO_VARKEYWORDSr)	�cora�nargsZnkwargs�args�
kwonlyargs�step�varargs�varkwrrr�getargss"



r,�ArgSpeczargs varargs keywords defaultscCsDtjdtdd�t|�\}}}}}}}|s.|r6td��t||||�S)Nzhinspect.getargspec() is deprecated since Python 3.0, use inspect.signature() or inspect.getfullargspec()r���
stacklevelzgFunction has keyword-only parameters or annotations, use inspect.signature() API which can support them)�warnings�warn�DeprecationWarning�getfullargspecr�r-)r�r'r*r+�defaultsr(�kwonlydefaults�annrrr�
getargspec-s��r7�FullArgSpeczGargs, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotationsc
Cs|zt|ddtd�}Wn,tk
r@}ztd�|�W5d}~XYnXg}d}d}g}g}d}i}	d}i}
|j|jk	r||j|	d<|j��D]�}|j}|j	}
|t
kr�|�|
�|j|jk	r�||jf7}nv|t
kr�|�|
�|j|jk	r�||jf7}nJ|tkr�|
}n<|tk�r*|�|
�|j|jk	�r8|j|
|
<n|tk�r8|
}|j|jk	r�|j|	|
<q�|
�sZd}
|�sdd}t|||||||
|	�S)NF��follow_wrapper_chains�skip_bound_arg�sigclszunsupported callabler�return)�_signature_from_callable�	Signaturernr��return_annotation�empty�
parameters�valuesrvrN�_POSITIONAL_ONLYrZ�default�_POSITIONAL_OR_KEYWORD�_VAR_POSITIONAL�
_KEYWORD_ONLY�_VAR_KEYWORD�
annotationr8)r��sig�exr'r*r+Zposonlyargsr(r4�annotations�
kwdefaults�paramrvrNrrrr3Nsb�






�r3�ArgInfozargs varargs keywords localscCs t|j�\}}}t||||j�Sr)r,r�rP�f_locals)�framer'r*r+rrr�getargvalues�srScCsVt|dd�dkr t|��dd�St|t�rN|jd|fkr>|jS|jd|jSt|�S)Nr��typingztyping.r�r�r�)rL�repr�replacerrr�r�)rJZbase_modulerrr�formatannotation�s
rWcst|dd���fdd�}|S)Nr�cs
t|��Sr)rW)rJ�r�rr�_formatannotation�sz5formatannotationrelativeto.<locals>._formatannotation)rL)r
rYrrXr�formatannotationrelativeto�srZrcCsd|S�N�*r�rNrrrrR�rSrRcCsd|S�N�**rr]rrrrR�rScCsdt|�S�N�=�rU�rOrrrrR�rScCsd|S)Nz -> r)�textrrrrR�rSc
s<ddlm}
|
dtdd����fdd�}g}|rBt|�t|�}t|�D]:\}}||�}|rz||krz||
|||�}|�|�qJ|dk	r�|�|||���n|r�|�d�|r�|D]2}||�}|r�||kr�||
||�7}|�|�q�|dk	�r|�|	||���d	d
�|�d}d�k�r8||��d��7}|S)
Nr)r1zc`formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directlyr�r.cs(�|�}|�kr$|d��|�7}|S)Nz: r)�argrt�rMrW�	formatargrr�formatargandannotation�sz-formatargspec.<locals>.formatargandannotationr\r�, rr=)r0r1r2r��	enumeraterZr�)r'r*r+r4r(r5rMrg�
formatvarargs�formatvarkw�formatvalueZ
formatreturnsrWr1rh�specsZfirstdefaultr�re�specZ	kwonlyargrtrrfr�
formatargspec�s<�


rpcCsd|Sr[rr]rrrrRrScCsd|Sr^rr]rrrrRrScCsdt|�Sr`rbrcrrrrRrScCs�|||fdd�}g}	tt|��D]}
|	�|||
��q |rV|	�||�|||��|rt|	�||�|||��dd�|	�dS)NcSs||�|||�Srr)rN�localsrgrmrrr�convertsz formatargvalues.<locals>.convertrrir)r�r�rZr�)r'r*r+rqrgrkrlrmrrrnr�rrr�formatargvaluess�
rscs��fdd�|D�}t|�}|dkr,|d}n>|dkr@dj|�}n*dj|dd��}|dd�=d	�|�|}td
|||rzdnd|dkr�d
nd|f��dS)Ncsg|]}|�krt|��qSrrb)rfrN�rCrrr�sz&_missing_arguments.<locals>.<listcomp>r�rr�z	{} and {}z, {} and {}���riz*%s() missing %i required %s argument%s: %s�
positional�keyword-onlyr�r�)r�r�r�r�)�f_nameZargnames�posrCra�missingr��tailrrtr�_missing_argumentss 


��r|c
	s�t|�|}t�fdd�|D��}|r:|dk}	d|f}
n2|rTd}	d|t|�f}
nt|�dk}	tt|��}
d}|r�d}||dkr�d	nd||dkr�d	ndf}td
||
|	r�d	nd|||dkr�|s�dndf��dS)
Ncsg|]}|�kr|�qSrr)rfrertrrr�)sz_too_many.<locals>.<listcomp>r�zat least %dTz
from %d to %dr�z7 positional argument%s (and %d keyword-only argument%s)r�z5%s() takes %s positional argument%s but %d%s %s givenZwasZwere)r�r�r�)
rxr'Zkwonlyr*ZdefcountZgivenrCZatleastZkwonly_givenZpluralrKZ
kwonly_sig�msgrrtr�	_too_many's*���r~cOst|�}|\}}}}}}	}
|j}i}t|�rB|jdk	rB|jf|}t|�}
t|�}|r^t|�nd}t|
|�}t|�D]}|||||<qt|r�t||d��||<t||�}|r�i||<|�	�D]T\}}||kr�|s�t
d||f��||||<q�||k�rt
d||f��|||<q�|
|k�r<|�s<t||||||
|�|
|k�r�|d||�}|D]}||k�rZt||d|��qZt
|||d��D] \}}||k�r�||||<�q�d}|D]6}||k�r�|	�r�||	k�r�|	|||<n|d7}�q�|�rt||d|�|S)Nrz*%s() got an unexpected keyword argument %rz(%s() got multiple values for argument %rTr�F)r3r�rr�r�r�r�rmrWrKr�r~r|rj)r�rvZnamedror'r*r+r4r(r5r6rxZ	arg2valueZnum_posZnum_argsZnum_defaults�nr�Zpossible_kwargs�kwrOZreqrerz�kwargrrr�getcallargs<sh
�
�
�



r��ClosureVarsz"nonlocals globals builtins unboundc	Cs�t|�r|j}t|�s$td�|���|j}|jdkr:i}ndd�t|j|j�D�}|j	}|�
dtj�}t
|�rt|j}i}i}t�}|jD]d}|dkr�q�z||||<Wq�tk
r�z||||<Wntk
r�|�|�YnXYq�Xq�t||||�S)N�{!r} is not a Python functioncSsi|]\}}||j�qSr)�
cell_contents)rf�varZcellrrr�
<dictcomp>�s�z"getclosurevars.<locals>.<dictcomp>�__builtins__)�None�True�False)rr"rr�r�r&�__closure__�zip�co_freevars�__globals__r�r�rJr
rW�co_names�KeyErrorr\r�)	r��codeZ
nonlocal_varsZ	global_nsZ
builtin_nsZglobal_varsZbuiltin_varsZ
unbound_namesrNrrr�getclosurevarszs>	
�
�r��	Tracebackz+filename lineno function code_context indexr�cCs�t|�r|j}|j}n|j}t|�s2td�|���t|�p@t|�}|dkr�|d|d}zt	|�\}}Wnt
k
r�d}}Yq�Xtdt|t
|�|��}||||�}|d|}nd}}t|||jj||�S)Nz'{!r} is not a frame or traceback objectrr�r�)r<�	tb_linenor��f_linenor>r�r�r�r�r�r��maxr�r�r�r�r)rR�context�linenor�r�r�r��indexrrr�getframeinfo�s$r�cCs|jSr)r��rRrrr�	getlineno�sr��	FrameInfor�cCs2g}|r.|ft||�}|�t|��|j}q|Sr)r�rZr��f_back)rRr��	framelist�	frameinforrr�getouterframes�sr�cCs4g}|r0|jft||�}|�t|��|j}q|Sr)r�r�rZr��tb_next)�tbr�r�r�rrr�getinnerframes�sr�cCsttd�rt�d�SdS)N�	_getframer�)rr�r�rrrr�currentframe�sr�cCstt�d�|�S)Nr�)r�r�r��r�rrr�stack�sr�cCstt��d|�S)Nr�)r�r��exc_infor�rrr�trace�sr�cCstjd�|�S)Nrx)rrJr)�klassrrr�_static_getmrosr�cCs8i}zt�|d�}Wntk
r(YnXt�||t�S�NrJ)r
�__getattribute__r[r�r��	_sentinel)r,�attrZ
instance_dictrrr�_check_instancesr�c	CsHt|�D]:}tt|��tkrz|j|WStk
r@YqXqtSr)r��_shadowed_dictrr�rJr�)r�r��entryrrr�_check_class
sr�cCs(zt|�Wntk
r"YdSXdS�NFT)r�r�r+rrr�_is_types
r�c	Csntjd}t|�D]V}z|�|�d}Wntk
r<YqXt|�tjkr`|jdkr`|j|ks|Sqt	Sr�)
rrJr�rr�rrr�rir�)r��	dict_attrr�Z
class_dictrrrr�s
��
r�c	Cst}t|�s>t|�}t|�}|tks2t|�tjkrBt||�}n|}t||�}|tk	r�|tk	r�tt|�d�tk	r�tt|�d�tk	r�|S|tk	r�|S|tk	r�|S||kr�tt|��D]:}tt|��tkr�z|j	|WSt
k
r�Yq�Xq�|tk	r�|St|��dS)Nrr)r�r�rr�rrr�r�r�rJr�r[)r,r�rEZinstance_resultr�r�Zklass_resultr�rrr�getattr_static+s:�
�r��GEN_CREATED�GEN_RUNNING�
GEN_SUSPENDED�
GEN_CLOSEDcCs,|jr
tS|jdkrtS|jjdkr(tStS�Nr�)�
gi_runningr��gi_framer��f_lastir�r�)�	generatorrrr�getgeneratorstate`s	
r�cCs:t|�std�|���t|dd�}|dk	r2|jjSiSdS)Nz{!r} is not a Python generatorr�)r3r�r�rLr�rQ)r�rRrrr�getgeneratorlocalsrsr��CORO_CREATED�CORO_RUNNING�CORO_SUSPENDED�CORO_CLOSEDcCs,|jr
tS|jdkrtS|jjdkr(tStSr�)�
cr_runningr��cr_framer�r�r�r�)�	coroutinerrr�getcoroutinestate�s	
r�cCs"t|dd�}|dk	r|jSiSdS)Nr�)rLrQ)r�rRrrr�getcoroutinelocals�sr��
from_bytescCs8zt||�}Wntk
r$YdSXt|t�s4|SdSr)rLr[r�_NonUserDefinedCallables)rgZmethod_nameZmethrrr�"_signature_get_user_defined_method�s
r�c
Cs�|j}t|���}|jpd}|jp$i}|r2||}z|j||�}Wn6tk
rx}zd�|�}	t|	�|�W5d}~XYnXd}
|��D]�\}}z|j	|}
Wnt
k
r�YnjX|jtkr�|�
|�q�|jtkr�||kr�d}
|j|
d�||<n|�
|j�q�|jtk�r|j|
d�||<|
r�|jtk�rN||jtd�}|||<|�|�q�|jttfk�rj|�|�q�|jtkr�|�
|j�q�|j|��d�S)Nrz+partial object {!r} has incorrect argumentsFT)rE�rv�rB)rBrrKr'�keywords�bind_partialr�r�r��	argumentsr�rvrDr�rFrVrNrH�move_to_endrIrGrC)�wrapped_sig�partialZ
extra_argsZ
old_params�
new_paramsZpartial_argsZpartial_keywordsZbarLr}Ztransform_to_kwonly�
param_namerOZ	arg_valueZ	new_paramrrr�_signature_get_partial�sL







r�cCslt|j���}|r$|djttfkr,td��|dj}|ttfkrP|dd�}n|t	k	r`td��|j
|d�S)Nrzinvalid method signaturer�zinvalid argument typer�)rmrBrCrvrIrHr�rFrDrGrV)rK�paramsrvrrr�_signature_bound_methods
r�cCs&t|�p$t|�p$t|t�p$|ttfkSr)rBrrr�rr
r+rrr�_signature_is_builtin.s��
�r�cCs�t|�rt|�rdSt|dd�}t|dd�}t|dt�}t|dt�}t|dd�}t|tj�o�t|t�o�|dksxt|t�o�|dks�t|t	�o�t|t	�S)NFr�r&�__defaults__�__kwdefaults__�__annotations__)
�callablerrL�_voidrrr?r�rmr�)r,rNr�r4rNrMrrr�_signature_is_functionlike:s ����r�cCs<|�d�}|dkr|�d�}|�d�}|�d�}|d|�S)N�,r�r�:rar�)�find)roryZcposrrr�_signature_get_bound_paramSs




r�cCs |s|ddfSd}d}dd�|�d�D�}t|�j}t�|�}d}d}g}|j}	d}
tj}tj}t|�}
|D]�}
|
j	|
j
}}||kr�|dkr�|r�d}qld}|
d7}
ql|d	kr�d}|
d}ql||kr�|d
kr�|
}ql|r�d}||kr�|dks�|	d�|	|�|dkrl|	d
�qld�|�}|||fS)NcSsg|]}|�d��qS)�ascii)�encode)rf�lrrrr�}sz6_signature_strip_non_python_syntax.<locals>.<listcomp>r�Frr�Tr��/�$rri� r�)r�rrrrZr�OP�
ERRORTOKEN�nextr�stringr�)�	signature�self_parameter�last_positional_onlyr�r�Ztoken_streamZ
delayed_commaZskip_next_commardr\Zcurrent_parameterr�r��trr��clean_signaturerrr�"_signature_strip_non_python_syntaxjsP





r�Tc	s`ddl�|j�t|�\}}}d|d}z��|�}Wntk
rNd}YnXt|�j�sjtd�|���|j	d}	g��j
�t��d}i�t|dd�}
|
r�t
j�|
d�}|r�|j�t
j���	�fdd�����	fdd	��
G��
fd
d�d�j���f��������fdd
�	}t|	jj�}t|	jj�}
tj||
dd�}|dk	�rJ�j�n�j�ttt|���D](\}\}}|||�||k�r`�j��q`|	jj�r��j�||	jj���j�t|	jj |	jj!�D]\}}|||��q�|	jj"�r�j#�||	jj"��|dk	�rRt|dd�}|dk	}t$|�}|�r8|�s,|�r8��%d�n�dj&�jd�}|�d<|�|j
d�S)Nrzdef fooz: passz"{!r} builtin has invalid signaturer�cs|jdk	rtd��|jS)Nz'Annotations are not currently supported)rJr�re)�node)�astrr�
parse_name�s
z&_signature_fromstr.<locals>.parse_namecs|zt|��}Wn>tk
rLzt|��}Wntk
rFt��YnXYnXt|tttttt	d�f�rr��
|�St��dSr)�eval�	NameError�RuntimeErrorrr��int�float�bytesr%rZConstant)r�rO)r��module_dict�sys_module_dictrr�
wrap_value�s
z&_signature_fromstr.<locals>.wrap_valuecs(eZdZ��fdd�Z��fdd�ZdS)z,_signature_fromstr.<locals>.RewriteSymbolicscs\g}|}t|�j�r(|�|j�|j}qt|�j�s:t��|�|j�d�t	|��}�|�S)Nr�)
rrerZr�rO�Namer�r�r��reversed)r�r��arrO�r�rrr�visit_Attribute�sz<_signature_fromstr.<locals>.RewriteSymbolics.visit_Attributecst|j�j�st���|j�Sr)rZctxZLoadr�r�)r�r�rrr�
visit_Name�sz7_signature_fromstr.<locals>.RewriteSymbolics.visit_NameN)r�r�r�r	r
rrrr�RewriteSymbolics�srcs��|�}|�krdS|rp|tk	rpz���|�}��|�}Wntk
rR�}YnX|�kr`dS|�k	rl|n|}���|�|�d��dS�N�rErJ)�_emptyZvisitZliteral_evalr�rZ)Z	name_nodeZdefault_noderErN�o)�	Parameterrr�rA�invalidrvrBr�rr�p�s
z_signature_fromstr.<locals>.p)�	fillvaluer�r��r@)'r��_parameter_clsr��parse�SyntaxErrorrZModuler�r�ZbodyrAr
rLr�r�r�rJr�ZNodeTransformerrr'r4�	itertools�zip_longest�POSITIONAL_ONLY�POSITIONAL_OR_KEYWORDrjr"Zvararg�VAR_POSITIONAL�KEYWORD_ONLYr�r(Zkw_defaultsr��VAR_KEYWORDr
r�rV)rgr,r�r;r�r�r�Zprogramr�r(Zmodule_namerr'r4rr�rNrEZ_selfZself_isboundZ
self_ismoduler)rrr�rArrvrrBr�rrr�_signature_fromstr�sn�










rcCsBt|�std�|���t|dd�}|s4td�|���t||||�S)Nz%{!r} is not a Python builtin function�__text_signature__z#no signature found for builtin {!r})r�r�r�rLr�r)rgr�r;r�rrr�_signature_from_builtin<s�r!c	CsHd}t|�s(t|�rd}ntd�|���t|dd�}|rFt||||�S|j}|j}|j}|j	}|j
}	|d|�}
|j}||||�}|j}
|j
}|j}|r�t|�}nd}g}||}|	}|
d|�D]<}|r�tnt}|
�|t�}|�||||d��|r�|d8}q�t|
|d��D]L\}}|�r&tnt}|
�|t�}|�||||||d��|�r|d8}�q|jt@�r�|||}|
�|t�}|�|||td��|D]B}t}|dk	�r�|�|t�}|
�|t�}|�|||t|d���q�|jt@�r2||}|jt@�r
|d7}||}|
�|t�}|�|||td��|||
�d	t�|d
�S)NFTr�r r)rJrvr�)rJrvrEr=�r@�__validate_parameters__)rr�r�r�rLrrr&r r�co_posonlyargcountr!r�r�r�r�rDrFr�rrZrjr'r#rGrHr$rI)rgr�r;Zis_duck_functionr�rZ	func_codeZ	pos_countZ	arg_namesZ
posonly_countrvZkeyword_only_countZkeyword_onlyrMr4rNZpos_default_countrBZnon_default_countZposonly_leftrNrvrJ�offsetrEr�rrr�_signature_from_functionLs�

�

�
�

�
�
�r&)r:r;c
Cs�t|�std�|���t|tj�rDt|j|||d�}|r@t|�S|S|rtt	|dd�d�}t|tj�rtt||||d�Sz
|j
}Wntk
r�Yn&X|dk	r�t|t�s�td�|���|Sz
|j
}Wntk
r�YnvXt|tj��rLt|j|||d�}t||d�}t|j���d}|jtjk�r(|St|j���}|f|}	|j|	d	�St|��s`t|��rnt|||d
�St|��r�t|||d
�St|tj��r�t|j|||d�}t||�Sd}t|t��r�t t|�d�}
|
dk	�r�t|
|||d�}nJt |d�}|dk	�rt||||d�}n$t |d
�}|dk	�r4t||||d�}|dk�r@|j!dd�D]>}
z
|
j"}Wntk
�rpYnX|�rLt#|||�S�qLt|j!k�r@|j$t%j$k�r�|j&t%j&k�r�|�'t%�St(d�|���nrt|t)��s@t t|�d�}
|
dk	�r@zt|
|||d�}Wn8t(k
�r>}zd�|�}t(|�|�W5d}~XYnX|dk	�r\|�rXt|�S|St|tj*��r|d�|�}t(|��t(d�|���dS)Nz{!r} is not a callable objectr9cSs
t|d�S)N�
__signature__r}r~rrrrR�rSz*_signature_from_callable.<locals>.<lambda>ryz1unexpected object {!r} in __signature__ attributerrr�)r;�__call__�__new__r�r�z(no signature found for builtin type {!r}zno signature found for {!r}z,no signature found for builtin function {!r}z+callable {!r} is not supported by signature)+r�r�r�rrrr>r"r�r�r'r[r?�_partialmethodr#�
partialmethodr�r�rmrBrCrvrrrVrr�r&r�r!r�rr�rxr rr�r
r)�
from_callabler�r�rA)r,r:r;r<rKr+r�Zfirst_wrapped_paramZ
sig_paramsr�Zcall�newZinitrPZtext_sigrLr}rrrr>�s	��

��
�
�
��

�

�

�


�
�
�



r>c@seZdZdS)r�Nr�rrrrr�t	sr�c@seZdZdS)rNr�rrrrrx	src@s4eZdZdZdZdZdZdZdd�Ze	dd	��Z
d
S)�_ParameterKindrr�r���cCs|jSr)�_name_r�rrr�__str__�	sz_ParameterKind.__str__cCst|Sr)�_PARAM_NAME_MAPPINGr�rrr�description�	sz_ParameterKind.descriptionN)r�r�r�rrrrrr2rjr4rrrrr.|	sr.zpositional-onlyzpositional or keywordzvariadic positionalrwzvariadic keywordc@s�eZdZdZeZeZeZ	e
ZeZ
eZeed�dd�Zdd�Zdd�Zed	d
��Zedd��Zed
d��Zedd��Zeeeed�dd�Zdd�Zdd�Zdd�Zdd�ZdS)r)�_name�_kind�_default�_annotationr
cCszt|�|_Wn$tk
r2td|�d���YnX|tk	rd|jttfkrdd}|�|jj�}t|��||_||_	|tkr�td��t
|t�s�d�t|�j
�}t|��|ddkr�|dd���r�|jtkr�d	}|�|jj�}t|��t|_d
�|dd��}|���std�|���||_dS)Nzvalue z is not a valid Parameter.kindz({} parameters cannot have default valuesz*name is a required attribute for Parameterzname must be a str, not a {}rr�r�zLimplicit arguments must be passed as positional or keyword arguments, not {}z
implicit{}z"{!r} is not a valid parameter name)r.r6r�rrGrIr�r4r7r8rr�rr�r��isdigitrFrD�isidentifierr5)r�rNrvrErJr}rrrr��	s6

�
zParameter.__init__cCs t|�|j|jf|j|jd�fS)N�r7r8)rr5r6r7r8r�rrr�
__reduce__�	s
��zParameter.__reduce__cCs|d|_|d|_dS)Nr7r8r;�r��staterrr�__setstate__�	s
zParameter.__setstate__cCs|jSr)r5r�rrrrN�	szParameter.namecCs|jSr)r7r�rrrrE�	szParameter.defaultcCs|jSr)r8r�rrrrJ�	szParameter.annotationcCs|jSr)r6r�rrrrv�	szParameter.kind)rNrvrJrEcCsL|tkr|j}|tkr|j}|tkr*|j}|tkr8|j}t|�||||d�Sr)r�r5r6r8r7r)r�rNrvrJrErrrrV�	szParameter.replacecCs�|j}|j}|jtk	r(d�|t|j��}|jtk	rb|jtk	rPd�|t|j��}nd�|t|j��}|tkrtd|}n|t	kr�d|}|S)Nz{}: {}z{} = {}z{}={}r\r_)
rvr5r8rr�rWr7rUrGrI)r�rv�	formattedrrrr2
s
�


zParameter.__str__cCsd�|jj|�S)Nz	<{} "{}">�r�r�r�r�rrr�__repr__#
szParameter.__repr__cCst|j|j|j|jf�Sr)�hashrNrvrJrEr�rrr�__hash__&
szParameter.__hash__cCsJ||krdSt|t�stS|j|jkoH|j|jkoH|j|jkoH|j|jkS�NT)rr�NotImplementedr5r6r7r8�r��otherrrr�__eq__)
s

�
�
�zParameter.__eq__N)r�r�r�r�rDrrFrrGrrHrrIrrrAr�r<r?rjrNrErJrvr�rVr2rBrDrIrrrrr�	s4(



�rc@sdeZdZdZdd�Zedd��Zedd��Zedd	��Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dS)�BoundArguments)r��
_signature�__weakref__cCs||_||_dSr)r�rK)r�r�r�rrrr�G
szBoundArguments.__init__cCs|jSr)rKr�rrrr�K
szBoundArguments.signaturec	Cs~g}|jj��D]d\}}|jttfkr*qvz|j|}Wntk
rRYqvYqX|jtkrj|�	|�q|�
|�qt|�Sr)rKrBrKrvrIrHr�r�rG�extendrZrm)r�r'r�rOrerrrr'O
s
zBoundArguments.argsc	Cs�i}d}|jj��D]x\}}|sD|jttfkr4d}n||jkrDd}q|sJqz|j|}Wntk
rlYqX|jtkr�|�|�q|||<q|Sr�)	rKrBrKrvrIrHr�r��update)r��kwargsZkwargs_startedr�rOrerrrrOf
s&


zBoundArguments.kwargsc	Cs�|j}g}|jj��D]x\}}z|�|||f�Wqtk
r�|jtk	rV|j}n$|jt	krfd}n|jt
krvi}nYq|�||f�YqXqt|�|_dS)Nr)r�rKrBrKrZr�rErrvrGrIr)r�r�Z
new_argumentsrNrO�valrrr�apply_defaults�
s	


zBoundArguments.apply_defaultscCs2||krdSt|t�stS|j|jko0|j|jkSrE)rrJrFr�r�rGrrrrI�
s

�zBoundArguments.__eq__cCs|d|_|d|_dS)NrKr��rKr�r=rrrr?�
s
zBoundArguments.__setstate__cCs|j|jd�S)NrRrRr�rrr�__getstate__�
szBoundArguments.__getstate__cCs@g}|j��D]\}}|�d�||��qd�|jjd�|��S)Nz{}={!r}z	<{} ({})>ri)r�rKrZr�r�r�r�)r�r'rerOrrrrB�
szBoundArguments.__repr__N)r�r�r�r�r�rjr�r'rOrQrIr?rSrBrrrrrJ4
s


rJc@s�eZdZdZeZeZeZ	d+edd�dd�Z
edd��Zed	d
��Z
edd�dd
��Zedd��Zedd��Zeed�dd�Zdd�Zdd�Zdd�Zdd�dd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�ZdS),r?)�_return_annotation�_parametersNTr"cCs�|dkrt�}n�|r�t�}t}d}t|�D]�\}}|j}	|j}
|	|krdd}|�|j|	j�}t|��n|	|krtd}|	}|	ttfkr�|j	t
kr�|r�d}t|��nd}|
|kr�d�|
�}t|��|||
<q*ntdd�|D��}t�|�|_
||_dS)NFz7wrong parameter order: {} parameter before {} parameterz-non-default argument follows default argumentTzduplicate parameter name: {!r}css|]}|j|fVqdSrr]�rfrOrrrrhs�z%Signature.__init__.<locals>.<genexpr>)rrDrjrvrNr�r4r�rFrErr�MappingProxyTyperUrT)r�rBr@r#r�Ztop_kindZ
kind_defaults�idxrOrvrNr}rrrr��
sD��



�zSignature.__init__cCstjdtdd�t||�S)Nz_inspect.Signature.from_function() is deprecated since Python 3.5, use Signature.from_callable()r�r.)r0r1r2r&�rgr�rrr�
from_functions
�zSignature.from_functioncCstjdtdd�t||�S)Nz^inspect.Signature.from_builtin() is deprecated since Python 3.5, use Signature.from_callable()r�r.)r0r1r2r!rYrrr�from_builtins
�zSignature.from_builtin��follow_wrappedcCst|||d�S)N)r<r:)r>)rgr,r]rrrr,#s�zSignature.from_callablecCs|jSr)rUr�rrrrB)szSignature.parameterscCs|jSr�rTr�rrrr@-szSignature.return_annotation)rBr@cCs0|tkr|j��}|tkr |j}t|�||d�S)Nr)r�rBrCrTr)r�rBr@rrrrV1s
�zSignature.replacecCs8tdd�|j��D��}dd�|j��D�}|||jfS)Ncss|]}|jtkr|VqdSr)rvrHrVrrrrhAs
�z(Signature._hash_basis.<locals>.<genexpr>cSsi|]}|jtkr|j|�qSr)rvrHrNrVrrrr�Ds
�z)Signature._hash_basis.<locals>.<dictcomp>)rmrBrCr@)r�r��
kwo_paramsrrr�_hash_basis@szSignature._hash_basiscCs(|��\}}}t|���}t|||f�Sr)r`�	frozensetrCrC)r�r�r_r@rrrrDIszSignature.__hash__cCs*||krdSt|t�stS|��|��kSrE)rr?rFr`rGrrrrINs

zSignature.__eq__F�r�cCs�t�}t|j���}d}t|�}zt|�}Wn�tk
�rzt|�}	Wntk
rfYY�q�Yn�X|	jtkrzY�q�n�|	j|kr�|	jt	kr�d}
|
j
|	jd�}
t|
�d�|	f}Y�q�nP|	jtks�|	j
tk	r�|	f}Y�q�n.|r�|	f}Y�q�nd}
|
j
|	jd�}
t|
�d�Yq Xzt|�}	Wn tk
�r:td�d�Yq X|	jttfk�rVtd�d�|	jtk�r�|g}|�|�t|�||	j<�q�|	j|k�r�|	jt	k�r�tdj
|	jd��d�|||	j<q d}t�||�D]�}	|	jtk�r�|	}�q�|	jtk�r�q�|	j}
z|�|
�}WnFtk
�rN|�sJ|	jtk�rJ|	j
tk�rJtdj
|
d��d�Yn(X|	jt	k�rntdj
|	jd���|||
<�q�|�r�|dk	�r�|||j<ntdj
tt|��d���|�||�S)NrzA{arg!r} parameter is positional only, but was passed as a keyword)rez$missing a required argument: {arg!r}ztoo many positional argumentsz$multiple values for argument {arg!r}z*got an unexpected keyword argument {arg!r})rrrBrCr��
StopIterationrvrGrNrDr�r�rIrErrHrMrmr�chainr�r��_bound_arguments_cls)r�r'rOr�r�rBZ
parameters_exZarg_valsZarg_valrOr}rCZkwargs_paramr�rrr�_bindUs�




���
�������

��zSignature._bindcOs|�||�Sr�rf�r�r'rOrrr�bind�szSignature.bindcOs|j||dd�S)NTrbrgrhrrrr��szSignature.bind_partialcCs t|�t|j���fd|jifS�NrT)rrmrUrCrTr�rrrr<�s�zSignature.__reduce__cCs|d|_dSrjr^r=rrrr?�szSignature.__setstate__cCsd�|jj|�S)Nz<{} {}>rAr�rrrrB�szSignature.__repr__c	Cs�g}d}d}|j��D]d}t|�}|j}|tkr6d}n|rH|�d�d}|tkrVd}n|tkrp|rp|�d�d}|�|�q|r�|�d�d�d�	|��}|j
tk	r�t|j
�}|d�|�7}|S)NFTr�r\z({})riz -> {})
rBrCr�rvrDrZrGrHr�r�r@rrW)	r�rtZrender_pos_only_separatorZrender_kw_only_separatorrOr@rvZrenderedZannorrrr2�s0




zSignature.__str__)N)r�r�r�r�rrrJrerrAr�rrrZr[r,rjrBr@r�rVr`rDrIrfrir�r<r?rBr2rrrrr?�
s:�7



	r?r\cCstj||d�S)Nr\)r?r,)r,r]rrrr�sr�c
Cs�ddl}ddl}|��}|jddd�|jddddd	�|��}|j}|�d
�\}}}z|�|�}}	WnNtk
r�}
z0d�	|t
|
�j|
�}t|t
jd�t
�d
�W5d}
~
XYnX|r�|�d�}|	}|D]}
t||
�}q�|	jt
jk�rtdt
jd�t
�d�|j�r�td�	|��td�	t|	���td�	|	j��||	k�rxtd�	t|	j���t|	d��r�td�	|	j��n6zt|�\}}Wntk
�r�YnXtd�	|��td�ntt|��dS)Nrr
zCThe object to be analysed. It supports the 'module:qualname' syntax)�helpz-dz	--details�
store_truez9Display info about the module rather than its source code)�actionrkr�zFailed to import {} ({}: {}))r�r�r�z#Can't get info for builtin modules.r�z
Target: {}z
Origin: {}z
Cached: {}z
Loader: {}�__path__zSubmodule search path: {}zLine: {}r�)�argparser��ArgumentParser�add_argument�
parse_argsr
�	partition�
import_modulernr�rr��printr��stderr�exitr�rL�builtin_module_namesZdetailsr��
__cached__rUr�rrnr�r)ror��parserr'�targetZmod_nameZ	has_attrs�attrsr,r�rur}�parts�part�__r�rrr�_main$s`���



r�r�)N)N)N)F)N)r�)r�)r�)r�)r�)r)T)T)T)��
__author__r8�disZcollections.abcr7�enum�importlib.machineryr�rr�r�r�r�rrrr0r#r��operatorrrr�globalsZmod_dictZCOMPILER_FLAG_NAMESrKrbrcrGr
rrrrrrr rr*r-r.r/r1r3r5r:r<r>r@rBrCrQrdrerwrVr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rnr�r�rrrrrrr,r-r7r8r3rPrSrWrZr�rprsr|r~r�r�r�r�r�r��_fieldsr�r�r�r�r�r�r
r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr(Z_WrapperDescriptor�allZ_MethodWrapperr�rJZ_ClassMethodWrapperrAr�r�r�r�r�r�r�r�rr!r&r>r�r�IntEnumr.rrDrrFrrGrrHrrIr3rrJr?r�r�r�rrrr�<module>sx	




	
,
t$
>
	
.N->




�]


	�
;�
<
5

 



		0

�
LH

_�K�	k:
__pycache__/traceback.cpython-38.pyc000064400000046744151153537610013351 0ustar00U

e5d;\�@s:dZddlZddlZddlZddlZddddddd	d
ddd
ddddddddgZd3dd�Zdd�Zd4dd�Zd5dd	�Z	d6dd�Z
dZdZd7dd�Z
d8d d�Zd!d�Zd"d#�Zd$d%�Zd9d&d
�Zd:d'd�Zd;d(d
�Zd<d)d�Zd=d*d�Zd>d+d�Zd,d�ZGd-d�d�Zd.d�Zd/d�Zd0ZGd1d�de�ZGd2d�d�ZdS)?z@Extract, format and print information about Python stack traces.�N�
extract_stack�
extract_tb�format_exception�format_exception_only�format_list�format_stack�	format_tb�	print_exc�
format_exc�print_exception�
print_last�print_stack�print_tb�clear_frames�FrameSummary�StackSummary�TracebackException�
walk_stack�walk_tbcCs4|dkrtj}t�|���D]}t||dd�qdS)zyPrint the list of tuples as returned by extract_tb() or
    extract_stack() as a formatted stack trace to the given file.N���file�end)�sys�stderrr�	from_list�format�print)�extracted_listr�item�r �!/usr/lib64/python3.8/traceback.py�
print_listsr"cCst�|���S)a�Format a list of tuples or FrameSummary objects for printing.

    Given a list of tuples or FrameSummary objects as returned by
    extract_tb() or extract_stack(), return a list of strings ready
    for printing.

    Each string in the resulting list corresponds to the item with the
    same index in the argument list.  Each string ends in a newline;
    the strings may contain internal newlines as well, for those items
    whose source text line is not None.
    )rrr)rr r r!rscCstt||d�|d�dS)aPrint up to 'limit' stack trace entries from the traceback 'tb'.

    If 'limit' is omitted or None, all entries are printed.  If 'file'
    is omitted or None, the output goes to sys.stderr; otherwise
    'file' should be an open file or file-like object with a write()
    method.
    ��limit�rN)r"r)�tbr$rr r r!r-scCst||d���S)z5A shorthand for 'format_list(extract_tb(tb, limit))'.r#)rr�r&r$r r r!r7scCstjt|�|d�S)a#
    Return a StackSummary object representing a list of
    pre-processed entries from traceback.

    This is useful for alternate formatting of stack traces.  If
    'limit' is omitted or None, all entries are extracted.  A
    pre-processed stack trace entry is a FrameSummary object
    containing attributes filename, lineno, name, and line
    representing the information that is usually printed for a stack
    trace.  The line is a string with leading and trailing
    whitespace stripped; if the source is not available it is None.
    r#)r�extractrr'r r r!r;s
zG
The above exception was the direct cause of the following exception:

zF
During handling of the above exception, another exception occurred:

TcCsB|dkrtj}tt|�|||d�j|d�D]}t||dd�q*dS)a�Print exception up to 'limit' stack trace entries from 'tb' to 'file'.

    This differs from print_tb() in the following ways: (1) if
    traceback is not None, it prints a header "Traceback (most recent
    call last):"; (2) it prints the exception type and value after the
    stack trace; (3) if type is SyntaxError and value has the
    appropriate format, it prints the line where the syntax error
    occurred with a caret on the next line indicating the approximate
    position of the error.
    Nr#��chainrr)rrr�typerr)�etype�valuer&r$rr*�liner r r!rWs��
cCs ttt|�|||d�j|d��S)azFormat a stack trace and the exception information.

    The arguments have the same meaning as the corresponding arguments
    to print_exception().  The return value is a list of strings, each
    ending in a newline and some containing internal newlines.  When
    these lines are concatenated and printed, exactly the same text is
    printed as does print_exception().
    r#r))�listrr+r)r,r-r&r$r*r r r!rls��cCstt||d����S)aFormat the exception part of a traceback.

    The arguments are the exception type and value such as given by
    sys.last_type and sys.last_value. The return value is a list of
    strings, each ending in a newline.

    Normally, the list contains a single string; however, for
    SyntaxError exceptions, it contains several lines that (when
    printed) display detailed information about where the syntax
    error occurred.

    The message indicating which exception occurred is always the last
    string in the list.

    N)r/rr)r,r-r r r!r|scCs.t|�}|dks|sd|}nd||f}|S)Nz%s
z%s: %s
)�	_some_str)r,r-�valuestrr.r r r!�_format_final_exc_line�s

r2cCs*z
t|�WSdt|�jYSXdS)Nz<unprintable %s object>)�strr+�__name__)r-r r r!r0�s
r0cCstt��|||d��dS)z>Shorthand for 'print_exception(*sys.exc_info(), limit, file)'.�r$rr*N)rr�exc_infor5r r r!r	�scCsd�tt��||d���S)z%Like print_exc() but return a string.r�r$r*)�joinrrr6r7r r r!r
�scCs.ttd�std��ttjtjtj|||�dS)znThis is a shorthand for 'print_exception(sys.last_type,
    sys.last_value, sys.last_traceback, limit, file)'.�	last_typezno last exceptionN)�hasattrr�
ValueErrorrr9�
last_value�last_tracebackr5r r r!r�s
�cCs*|dkrt��j}tt||d�|d�dS)z�Print a stack trace from its invocation point.

    The optional 'f' argument can be used to specify an alternate
    stack frame at which to start. The optional 'limit' and 'file'
    arguments have the same meaning as for print_exception().
    Nr#r%)r�	_getframe�f_backr"r)�fr$rr r r!r
�s
cCs"|dkrt��j}tt||d��S)z5Shorthand for 'format_list(extract_stack(f, limit))'.Nr#)rr>r?rr)r@r$r r r!r�s
cCs0|dkrt��j}tjt|�|d�}|��|S)asExtract the raw traceback from the current stack frame.

    The return value has the same format as for extract_tb().  The
    optional 'f' and 'limit' arguments have the same meaning as for
    print_stack().  Each item in the list is a quadruple (filename,
    line number, function name, text), and the entries are in order
    from oldest to newest stack frame.
    Nr#)rr>r?rr(r�reverse)r@r$�stackr r r!r�s
	
cCs8|dk	r4z|j��Wntk
r*YnX|j}qdS)zEClear all references to local variables in the frames of a traceback.N)�tb_frame�clear�RuntimeError�tb_next�r&r r r!r�sc@sZeZdZdZdZdddd�dd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
edd��ZdS)ra,A single frame from a traceback.

    - :attr:`filename` The filename for the frame.
    - :attr:`lineno` The line within filename for the frame that was
      active when the frame was captured.
    - :attr:`name` The name of the function or method that was executing
      when the frame was captured.
    - :attr:`line` The text from the linecache module for the
      of code that was running when the frame was captured.
    - :attr:`locals` Either None if locals were not supplied, or a dict
      mapping the name to the repr() of the variable.
    )�filename�lineno�name�_line�localsTN)�lookup_linerLr.cCsB||_||_||_||_|r"|j|r8dd�|��D�nd|_dS)a�Construct a FrameSummary.

        :param lookup_line: If True, `linecache` is consulted for the source
            code line. Otherwise, the line will be looked up when first needed.
        :param locals: If supplied the frame locals, which will be captured as
            object representations.
        :param line: If provided, use this instead of looking up the line in
            the linecache.
        cSsi|]\}}|t|��qSr )�repr)�.0�k�vr r r!�
<dictcomp>sz)FrameSummary.__init__.<locals>.<dictcomp>N)rHrIrJrKr.�itemsrL)�selfrHrIrJrMrLr.r r r!�__init__�szFrameSummary.__init__cCs`t|t�r:|j|jko8|j|jko8|j|jko8|j|jkSt|t�r\|j|j|j|jf|kStS�N)	�
isinstancerrHrIrJrL�tupler.�NotImplemented�rT�otherr r r!�__eq__s

�
�
�
zFrameSummary.__eq__cCs|j|j|j|jf|SrV)rHrIrJr.)rT�posr r r!�__getitem__szFrameSummary.__getitem__cCst|j|j|j|jg�SrV)�iterrHrIrJr.�rTr r r!�__iter__szFrameSummary.__iter__cCsdj|j|j|jd�S)Nz7<FrameSummary file {filename}, line {lineno} in {name}>)rHrIrJ)rrHrIrJr`r r r!�__repr__s
�zFrameSummary.__repr__cCsdS)N�r r`r r r!�__len__szFrameSummary.__len__cCs&|jdkr t�|j|j���|_|jSrV)rK�	linecache�getlinerHrI�stripr`r r r!r.s
zFrameSummary.line)
r4�
__module__�__qualname__�__doc__�	__slots__rUr\r^rarbrd�propertyr.r r r r!r�s
�
ccs4|dkrt��jj}|dk	r0||jfV|j}qdS)z�Walk a stack yielding the frame and line number for each frame.

    This will follow f.f_back from the given frame. If no frame is given, the
    current stack is used. Usually used with StackSummary.extract.
    N)rr>r?�f_lineno)r@r r r!r$s
ccs"|dk	r|j|jfV|j}qdS)z�Walk a traceback yielding the frame and line number for each frame.

    This will follow tb.tb_next (and thus is in the opposite order to
    walk_stack). Usually used with StackSummary.extract.
    N)rC�	tb_linenorFrGr r r!r1s�c@s:eZdZdZedddd�dd��Zedd	��Zd
d�ZdS)rzA stack of frames.NTF�r$�lookup_lines�capture_localsc

Cs�|dkr(ttdd�}|dk	r(|dkr(d}|dk	rV|dkrFt�||�}ntj||d�}|�}t�}|D]Z\}}|j}	|	j}
|	j	}|�
|
�t�|
|j
�|r�|j}nd}|�t|
||d|d��qf|D]}
t�|
�q�|r�|D]
}|jq�|S)a?Create a StackSummary from a traceback or stack object.

        :param frame_gen: A generator that yields (frame, lineno) tuples to
            include in the stack.
        :param limit: None to include all frames or the number of frames to
            include.
        :param lookup_lines: If True, lookup lines for each frame immediately,
            otherwise lookup is deferred until the frame is rendered.
        :param capture_locals: If True, the local variables from each frame will
            be captured as object representations into the FrameSummary.
        N�tracebacklimitr)�maxlenF)rMrL)�getattrr�	itertools�islice�collections�deque�set�f_code�co_filename�co_name�addre�	lazycache�	f_globals�f_locals�appendr�
checkcacher.)
�klass�	frame_genr$rqrr�result�fnamesr@rI�corHrJr�r r r!r(As@
�
zStackSummary.extractc	CsLt�}|D]<}t|t�r$|�|�q
|\}}}}|�t||||d��q
|S)z�
        Create a StackSummary object from a supplied list of
        FrameSummary objects or old-style list of tuples.
        )r.)rrWrr�)r��a_listr��framerHrIrJr.r r r!rqs

zStackSummary.from_listc
Csng}d}d}d}d}|D�]}|dksT||jksT|dksT||jksT|dksT||jkr�|tkr�|t8}|�d|�d|dkr|dnd�d��|j}|j}|j}d}|d7}|tkr�qg}|�d	�|j|j|j��|jr�|�d
�|j����|j�r t	|j�
��D]\}}	|�dj||	d���q|�d�|��q|tk�rj|t8}|�d|�d|dk�r^dnd�d��|S)
aFormat the stack ready for printing.

        Returns a list of strings ready for printing.  Each string in the
        resulting list corresponds to a single frame from the stack.
        Each string ends in a newline; the strings may contain internal
        newlines as well, for those items with source text lines.

        For long sequences of the same frame and line, the first few
        repetitions are shown, followed by a summary line stating the exact
        number of further repetitions.
        Nrz  [Previous line repeated z
 more time��srz]
z  File "{}", line {}, in {}
�    {}
z    {name} = {value}
)rJr-)rHrIrJ�_RECURSIVE_CUTOFFr�rr.rgrL�sortedrSr8)
rTr��	last_file�	last_line�	last_name�countr��rowrJr-r r r!r�sZ
������
�zStackSummary.format)r4rhrirj�classmethodr(rrr r r r!r>s�/
c@s^eZdZdZddddd�dd�Zedd	��Zd
d�Zdd
�Zdd�Z	dd�Z
dd�dd�ZdS)ra�An exception ready for rendering.

    The traceback module captures enough attributes from the original exception
    to this intermediary form to ensure that no references are held, while
    still being able to fully print or format it.

    Use `from_exception` to create TracebackException instances from exception
    objects, or the constructor to create TracebackException instances from
    individual components.

    - :attr:`__cause__` A TracebackException of the original *__cause__*.
    - :attr:`__context__` A TracebackException of the original *__context__*.
    - :attr:`__suppress_context__` The *__suppress_context__* value from the
      original exception.
    - :attr:`stack` A `StackSummary` representing the traceback.
    - :attr:`exc_type` The class of the original traceback.
    - :attr:`filename` For syntax errors - the filename where the error
      occurred.
    - :attr:`lineno` For syntax errors - the linenumber where the error
      occurred.
    - :attr:`text` For syntax errors - the text where the error
      occurred.
    - :attr:`offset` For syntax errors - the offset into the text where the
      error occurred.
    - :attr:`msg` For syntax errors - the compiler error message.
    NTF�r$rqrr�_seenc	CsJ|dkrt�}|�t|��|r\|jdk	r\t|j�|kr\tt|j�|j|jj|d||d�}nd}|r�|jdk	r�t|j�|kr�tt|j�|j|jj|d||d�}	nd}	||_|	|_|r�|jnd|_t	j
t|�|||d�|_||_
t|�|_|�r8t|t��r8|j|_|j}
|
dk	�rt|
�nd|_|j|_|j|_|j|_|�rF|��dS)NFr�rp)rzr~�id�	__cause__rr+�
__traceback__�__context__�__suppress_context__rr(rrB�exc_typer0�_str�
issubclass�SyntaxErrorrHrIr3�text�offset�msg�_load_lines)rTr��	exc_value�
exc_tracebackr$rqrrr��cause�context�lnor r r!rU�sd��	��	��
zTracebackException.__init__cOs|t|�||jf|�|�S)z.Create a TracebackException from an exception.)r+r�)�cls�exc�args�kwargsr r r!�from_exceptionsz!TracebackException.from_exceptioncCs6|jD]
}|jq|jr"|j��|jr2|j��dS)z7Private API. force all lines in the stack to be loaded.N)rBr.r�r�r�)rTr�r r r!r�s

zTracebackException._load_linescCs|j|jkSrV)�__dict__rZr r r!r\szTracebackException.__eq__cCs|jSrV)r�r`r r r!�__str__szTracebackException.__str__ccs6|jdkrtd|j�VdS|jj}|jj}|dkr@|d|}t|jt�s^t||j�VdSd}|jdk	r�d�|j	pxd|j�Vn|j	dk	r�d�|j	�}|j
}|j}|dk	�rd�|���V|dk	�r|�
d	�}tt|�|�d
}|d|���}dd�|D�}d
�d�|��V|j�p d}d�|||�VdS)a�Format the exception part of the traceback.

        The return value is a generator of strings, each ending in a newline.

        Normally, the generator emits a single string; however, for
        SyntaxError exceptions, it emits several lines that (when
        printed) display detailed information about where the syntax
        error occurred.

        The message indicating which exception occurred is always the last
        string in the output.
        N)�__main__�builtins�.rz  File "{}", line {}
z<string>z ({})r��
r�css|]}|��r|pdVqdS)� N)�isspace)rO�cr r r!�	<genexpr>Msz;TracebackException.format_exception_only.<locals>.<genexpr>z    {}^
z<no detail available>z	{}: {}{}
)r�r2r�rirhr�r�rIrrHr�r�rg�rstrip�min�len�lstripr8r�)rT�stype�smod�filename_suffix�badliner��
caretspacer�r r r!r"s<

�



z(TracebackException.format_exception_onlyr)ccs�|rT|jdk	r*|jj|d�EdHtVn*|jdk	rT|jsT|jj|d�EdHtV|jrpdV|j��EdH|��EdHdS)a�Format the exception.

        If chain is not *True*, *__cause__* and *__context__* will not be formatted.

        The return value is a generator of strings, each ending in a newline and
        some containing internal newlines. `print_exception` is a wrapper around
        this method which just prints the lines to a file.

        The message indicating which exception occurred is always the last
        string in the output.
        Nr)z#Traceback (most recent call last):
)r�r�_cause_messager�r��_context_messagerBr)rTr*r r r!rRs

�zTracebackException.format)r4rhrirjrUr�r�r�r\r�rrr r r r!r�s�:
	0)N)NN)N)N)NNT)NT)NNT)NT)NNT)NNN)NN)NN) rjrxrvrer�__all__r"rrrrr�r�rrrr2r0r	r
rr
rrrrrrr�r/rrr r r r!�<module>sb�




��







A
z__pycache__/optparse.cpython-38.opt-2.pyc000064400000105515151153537610014217 0ustar00U

e5d���@s�dZddddddddd	d
ddd
ddddgZdZddlZddlZddlZdd�ZzddlmZmZWn$e	k
r�dd�Zdd�ZYnXeZ
Gdd�de�ZGdd
�d
e�Z
Gdd�de
�ZGdd�de�ZGd d�de�ZGd!d"�d"e�ZGd#d	�d	�ZGd$d
�d
e�ZGd%d�de�Zd&d'�Zd(d)�Zee
d*�fee
d*�fee
d+�fee
d,�fd-�Zd.d/�Zd0d�Zd1ZGd2d�d�Zd3Zd4ZGd5d�d�Z Gd6d�d�Z!Gd7d�de!�Z"Gd8d�de!�Z#d9d:�Z$eZ%dS);z1.5.3�Option�make_option�
SUPPRESS_HELP�SUPPRESS_USAGE�Values�OptionContainer�OptionGroup�OptionParser�
HelpFormatter�IndentedHelpFormatter�TitledHelpFormatter�
OptParseError�OptionError�OptionConflictError�OptionValueError�BadOptionError�check_choicea"
Copyright (c) 2001-2006 Gregory P. Ward.  All rights reserved.
Copyright (c) 2002-2006 Python Software Foundation.  All rights reserved.

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

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

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

  * Neither the name of the author nor the names of its
    contributors may be used to endorse or promote products derived from
    this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
�NcCsd|jjt|�|fS)Nz<%s at 0x%x: %s>)�	__class__�__name__�id��self�r� /usr/lib64/python3.8/optparse.py�_reprOsr)�gettext�ngettextcCs|S�Nr)�messagerrrr\srcCs|dkr|S|S�N�r)ZsingularZplural�nrrrr_src@seZdZdd�Zdd�ZdS)rcCs
||_dSr��msg�rr#rrr�__init__hszOptParseError.__init__cCs|jSrr"rrrr�__str__kszOptParseError.__str__N�r�
__module__�__qualname__r%r&rrrrrgsc@seZdZdd�Zdd�ZdS)r
cCs||_t|�|_dSr)r#�str�	option_id)rr#�optionrrrr%uszOptionError.__init__cCs |jrd|j|jfS|jSdS)Nz
option %s: %s)r+r#rrrrr&yszOptionError.__str__Nr'rrrrr
osc@seZdZdS)rN�rr(r)rrrrrsc@seZdZdS)rNr-rrrrr�sc@seZdZdd�Zdd�ZdS)rcCs
||_dSr)�opt_str�rr.rrrr%�szBadOptionError.__init__cCstd�|jS)Nzno such option: %s)�_r.rrrrr&�szBadOptionError.__str__Nr'rrrrr�sc@seZdZdd�Zdd�ZdS)�AmbiguousOptionErrorcCst�||�||_dSr)rr%�
possibilities)rr.r2rrrr%�szAmbiguousOptionError.__init__cCstd�|jd�|j�fS)Nzambiguous option: %s (%s?)�, )r0r.�joinr2rrrrr&�s�zAmbiguousOptionError.__str__Nr'rrrrr1�sr1c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd S)!r	Znonec	Cs�d|_||_|dkrLzttjd�}Wnttfk
rBd}YnX|d8}||_t|t	|d|d��|_
|_d|_d|_
d|_||_d|_i|_d|_d|_dS)	NZCOLUMNS�P��rz%defaultz%s %sz%s=%s)�parser�indent_increment�int�os�environ�KeyError�
ValueError�width�min�max�
help_position�max_help_position�current_indent�level�
help_width�short_first�default_tag�option_strings�_short_opt_fmt�
_long_opt_fmt�rr9rCr?rGrrrr%�s&
�
zHelpFormatter.__init__cCs
||_dSr)r8�rr8rrr�
set_parser�szHelpFormatter.set_parsercCs&|dkrtd|��d|d|_dS)N)�� z/invalid metavar delimiter for short options: %r�%s)r>rJ�rZdelimrrr�set_short_opt_delimiter�s
�z%HelpFormatter.set_short_opt_delimitercCs&|dkrtd|��d|d|_dS)N)�=rPz.invalid metavar delimiter for long options: %rrQ)r>rKrRrrr�set_long_opt_delimiter�s
�z$HelpFormatter.set_long_opt_delimitercCs"|j|j7_|jd7_dSr�rDr9rErrrr�indent�szHelpFormatter.indentcCs"|j|j8_|jd8_dSrrVrrrr�dedent�szHelpFormatter.dedentcCstd��dS�Nzsubclasses must implement��NotImplementedError�r�usagerrr�format_usage�szHelpFormatter.format_usagecCstd��dSrYrZ�rZheadingrrr�format_headingszHelpFormatter.format_headingcCs.t|j|jd�}d|j}tj||||d�S)N�rP)Zinitial_indentZsubsequent_indent)rAr?rD�textwrapZfill)r�textZ
text_widthrWrrr�_format_texts
�zHelpFormatter._format_textcCs|r|�|�dSdSdS�N�
rO�rd�r�descriptionrrr�format_descriptionsz HelpFormatter.format_descriptioncCs|rd|�|�dSdSdSrerg)r�epilogrrr�
format_epilogszHelpFormatter.format_epilogcCsP|jdks|js|jS|jj�|j�}|tks6|dkr<|j}|j�|jt	|��Sr)
r8rH�help�defaults�get�dest�
NO_DEFAULT�NO_DEFAULT_VALUE�replacer*)rr,Z
default_valuerrr�expand_defaultszHelpFormatter.expand_defaultcs�g}�j|}�j�jd}t|�|krBd�jd|f}�j}nd�jd||f}d}|�|�|jr���|�}t�|�j	�}|�d|d|df�|�
�fdd�|dd�D��n|d	d
kr�|�d
�d�|�S)Nr6�%*s%s
rOz	%*s%-*s  rcsg|]}d�jd|f�qS)rurO)rB)�.0�linerrr�
<listcomp>Es�z/HelpFormatter.format_option.<locals>.<listcomp>r ���rf)rIrBrD�len�appendrmrtrbZwraprF�extendr4)rr,�result�optsZ	opt_widthZindent_firstZ	help_textZ
help_linesrrr�
format_option(s&



�

zHelpFormatter.format_optioncCs�|��d}|jD],}|�|�}||j|<t|t|�|j�}q|��|jD]8}|jD],}|�|�}||j|<t|t|�|j�}qXqN|��|��t	|d|j
�|_t|j|jd�|_
dS)Nrr6ra)rW�option_list�format_option_stringsrIrArzrD�
option_groupsrXr@rCrBr?rF)rr8Zmax_len�optZstrings�grouprrr�store_option_stringsKs 






z"HelpFormatter.store_option_stringscst|��rF|jp|j�����fdd�|jD�}��fdd�|jD�}n|j}|j}�jrb||}n||}d�|�S)Ncsg|]}�j|�f�qSr)rJ)rvZsopt��metavarrrrrxas�z7HelpFormatter.format_option_strings.<locals>.<listcomp>csg|]}�j|�f�qSr)rK)rvZloptr�rrrxcs�r3)�takes_valuer�rp�upper�_short_opts�
_long_optsrGr4)rr,Z
short_optsZ	long_optsr~rr�rr�]s��
z#HelpFormatter.format_option_stringsN)rr(r)rrr%rNrSrUrWrXr^r`rdrjrlrtrr�r�rrrrr	�s +
#c@s&eZdZddd�Zdd�Zd	d
�ZdS)r
r6�Nr cCst�|||||�dSr�r	r%rLrrrr%ts�zIndentedHelpFormatter.__init__cCstd�|S)Nz
Usage: %s
)r0r\rrrr^|sz"IndentedHelpFormatter.format_usagecCsd|jd|fS)Nz%*s%s:
rO)rDr_rrrr`sz$IndentedHelpFormatter.format_heading)r6r�Nr �rr(r)r%r^r`rrrrr
ps�
c@s&eZdZd
dd�Zdd�Zdd	�ZdS)rrr�NcCst�|||||�dSrr�rLrrrr%�s�zTitledHelpFormatter.__init__cCsd|�td��|fS)Nz%s  %s
ZUsage)r`r0r\rrrr^�sz TitledHelpFormatter.format_usagecCsd|d|jt|�fS)Nz%s
%s
z=-)rErzr_rrrr`�sz"TitledHelpFormatter.format_heading)rr�Nrr�rrrrr�s�
cCsh|dd���dkrd}nD|dd���dkrDd}|dd�p@d}n|dd�dkrZd}nd}|||�S)	Nr6Z0x�Z0b�0r ��
)�lower)�val�type�radixrrr�
_parse_num�sr�cCs
t|t�Sr)r�r:)r�rrr�
_parse_int�sr�Zintegerzfloating-point�complex)r:�long�floatr�cCsHt|j\}}z
||�WStk
rBttd�|||f��YnXdS)Nzoption %s: invalid %s value: %r)�_builtin_cvtr�r>rr0)r,r��valueZcvtZwhatrrr�
check_builtin�s
�r�cCs:||jkr|Sd�tt|j��}ttd�|||f��dS)Nr3z.option %s: invalid choice: %r (choose from %s))�choicesr4�map�reprrr0)r,r�r�r�rrrr�s
��)ZNOZDEFAULTc@s�eZdZddddddddd	d
ddgZd
ZdZdZdZdZdZ	e
e
e
e
ed�ZdZ
dd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�ZeeeeeeegZ
d+d,�ZeZd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Z d7d8�Z!dS)9r�actionr�rp�default�nargs�constr��callback�
callback_args�callback_kwargsrmr�)
�store�store_const�
store_true�store_falser{�append_const�countr�rm�version)r�r�r�r�r{r�r�)r�r{r�)r�r{)r�r�)�stringr:r�r�r��choice)r:r�r�r�r�NcOsBg|_g|_|�|�}|�|�|�|�|jD]}||�q0dSr)r�r��_check_opt_strings�_set_opt_strings�
_set_attrs�
CHECK_METHODS)rr~�attrs�checkerrrrr%4s



zOption.__init__cCsdd�|D�}|std��|S)NcSsg|]}|r|�qSrr)rvr�rrrrxKsz-Option._check_opt_strings.<locals>.<listcomp>z+at least one option string must be supplied)�	TypeError)rr~rrrr�GszOption._check_opt_stringscCs�|D]�}t|�dkr$td||��qt|�dkrd|ddkrH|ddksVtd||��|j�|�q|dd�dkr�|ddks�td||��|j�|�qdS)	Nr6z>invalid option string %r: must be at least two characters longr�-r zMinvalid short option string %r: must be of the form -x, (x any non-dash char)�--zGinvalid long option string %r: must start with --, followed by non-dash)rzr
r�r{r�)rr~r�rrrr�Ps2������zOption._set_opt_stringscCsv|jD]F}||kr*t||||�||=q|dkr@t||t�qt||d�q|rrt|���}tdd�|�|��dS)Nr�zinvalid keyword arguments: %sr3)�ATTRS�setattrrq�sorted�keysr
r4)rr��attrrrrr�es
�zOption._set_attrscCs2|jdkrd|_n|j|jkr.td|j|��dS)Nr�zinvalid action: %r)r��ACTIONSr
rrrr�
_check_actionxs
zOption._check_actioncCs�|jdkr0|j|jkr�|jdk	r(d|_q�d|_n^t|jt�rF|jj|_|jdkrVd|_|j|jkrrtd|j|��|j|jkr�td|j|��dS)Nr�r�r*zinvalid option type: %rz$must not supply a type for action %r)	r�r��ALWAYS_TYPED_ACTIONSr��
isinstancer�TYPESr
�
TYPED_ACTIONSrrrr�_check_type~s 



�zOption._check_typecCsr|jdkrT|jdkr td|��qnt|jttf�sntdtt|j���d�d|��n|jdk	rntd|j|��dS)Nr�z/must supply a list of choices for type 'choice'z1choices must be a list of strings ('%s' supplied)�'r z#must not supply choices for type %r)r�r�r
r��tuple�listr*�splitrrrr�
_check_choice�s$

���
�zOption._check_choicecCs\|j|jkp|jdk	}|jdkrX|rX|jrH|jddd��dd�|_n|jdd|_dS)Nrr6r�r0r )r��
STORE_ACTIONSr�rpr�rsr�)rr�rrr�_check_dest�s�zOption._check_destcCs*|j|jkr&|jdk	r&td|j|��dS)Nz*'const' must not be supplied for action %r)r��
CONST_ACTIONSr�r
rrrr�_check_const�s
�zOption._check_constcCs<|j|jkr|jdkr8d|_n|jdk	r8td|j|��dS)Nr z*'nargs' must not be supplied for action %r)r�r�r�r
rrrr�_check_nargs�s

�zOption._check_nargscCs�|jdkrrt|j�s$td|j|��|jdk	rJt|jt�sJtd|j|��|jdk	r�t|jt�s�td|j|��nB|jdk	r�td|j|��|jdk	r�td|��|jdk	r�td|��dS)Nr�zcallback not callable: %rz3callback_args, if supplied, must be a tuple: not %rz4callback_kwargs, if supplied, must be a dict: not %rz.callback supplied (%r) for non-callback optionz.callback_args supplied for non-callback optionz0callback_kwargs supplied for non-callback option)	r��callabler�r
r�r�r�r��dictrrrr�_check_callback�sR

�

���

���
��
�
�zOption._check_callbackcCsd�|j|j�S)N�/)r4r�r�rrrrr&�szOption.__str__cCs
|jdk	Sr)r�rrrrr��szOption.takes_valuecCs|jr|jdS|jdSdS�Nr)r�r�rrrr�get_opt_string�s
zOption.get_opt_stringcCs*|j�|j�}|dkr|S||||�SdSr)�TYPE_CHECKERror�)rr�r�r�rrr�check_value�szOption.check_valuecs:|dk	r6�jdkr���|�St��fdd�|D��SdS)Nr csg|]}���|��qSr)r�)rv�v�r�rrrrxsz(Option.convert_value.<locals>.<listcomp>)r�r�r�)rr�r�rr�r�
convert_values
zOption.convert_valuecCs$|�||�}|�|j|j||||�Sr)r��take_actionr�rp)rr�r��valuesr8rrr�processs�zOption.processc	Cs:|dkrt|||��n|dkr2t|||j��n|dkrHt||d�n�|dkr^t||d�n�|dkrz|�|g��|�n�|dkr�|�|g��|j�n�|d	kr�t|||�|d
�d�n||dkr�|jp�d
}|jp�i}|j||||f|�|�nF|dk�r|��|��n*|dk�r(|�	�|��nt
d|j��dS)Nr�r�r�Tr�Fr{r�r�rr r�rrmr�zunknown action %r)r�r��ensure_valuer{r�r�r��
print_help�exit�
print_versionr>r�)	rr�rpr�r�r�r8�args�kwargsrrrr�s4





zOption.take_action)"rr(r)r�r�r�r�r�r�r�r�rr�r�r%r�r�r�r�r�r�r�r�r�r�r&r�__repr__r�r�r�r�r�r�rrrrr�sj�
�	
	�	ZSUPPRESSHELPZ
SUPPRESSUSAGEc@s^eZdZddd�Zdd�ZeZdd�Zdd	�Zd
d�Z	dd
�Z
ddd�Zddd�Zdd�Z
dS)rNcCs&|r"|��D]\}}t|||�qdSr)�itemsr�)rrnr�r�rrrr%9szValues.__init__cCs
t|j�Sr)r*�__dict__rrrrr&>szValues.__str__cCs2t|t�r|j|jkSt|t�r*|j|kStSdSr)r�rr�r��NotImplemented)r�otherrrr�__eq__Cs



z
Values.__eq__cCs6t|�D](}||kr||}|dk	rt|||�qdSr)�dirr�)rr�r�Zdvalrrr�_update_carefulKs
zValues._update_carefulcCs|j�|�dSr)r��update)rr�rrr�
_update_looseXszValues._update_loosecCs8|dkr|�|�n |dkr(|�|�ntd|��dS)N�carefulZloosezinvalid update mode: %r)r�r�r>)rr��moderrr�_update`s
zValues._updater�cCs&t|�tj|}|�t|�|�dSr)�
__import__�sys�modulesr��vars)r�modnamer��modrrr�read_modulehs
zValues.read_modulecCs&i}tt|���|�|�||�dSr)�exec�open�readr�)r�filenamer�r�rrr�	read_filemszValues.read_filecCs.t||�rt||�dkr$t|||�t||�Sr)�hasattr�getattrr�)rr�r�rrrr�rszValues.ensure_value)N)r�)r�)rr(r)r%r&rr�r�r�r�r�r�r�r�rrrrr7s



c@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!S)"rcCs&|��||_|�|�|�|�dSr)�_create_option_list�option_class�set_conflict_handler�set_description)rr�conflict_handlerrirrrr%�s
zOptionContainer.__init__cCsi|_i|_i|_dSr��
_short_opt�	_long_optrnrrrr�_create_option_mappings�sz'OptionContainer._create_option_mappingscCs|j|_|j|_|j|_dSrrrMrrr�_share_option_mappings�sz&OptionContainer._share_option_mappingscCs|dkrtd|��||_dS)N)�error�resolvez$invalid conflict_resolution value %r)r>r)r�handlerrrrr�sz$OptionContainer.set_conflict_handlercCs
||_dSr�rirhrrrr�szOptionContainer.set_descriptioncCs|jSrr
rrrr�get_description�szOptionContainer.get_descriptioncCs|`|`|`dSrrrrrr�destroy�szOptionContainer.destroycCs�g}|jD]"}||jkr
|�||j|f�q
|jD]"}||jkr4|�||j|f�q4|r�|j}|dkr�tdd�dd�|D��|��nd|dkr�|D]V\}}|�d�r�|j�	|�|j|=n|j�	|�|j|=|js�|js�|j
j�	|�q�dS)Nr
z conflicting option string(s): %sr3cSsg|]}|d�qS)rr)rv�corrrrx�sz3OptionContainer._check_conflict.<locals>.<listcomp>rr�)r�rr{r�rrrr4�
startswith�remove�	containerr�)rr,Z
conflict_optsr�rZc_optionrrr�_check_conflict�s2



��

zOptionContainer._check_conflictcOs�t|dt�r|j||�}n8t|�dkrL|sL|d}t|t�sTtd|��ntd��|�|�|j�|�||_	|j
D]}||j|<qv|jD]}||j
|<q�|jdk	r�|jtk	r�|j|j|j<n|j|jkr�d|j|j<|S)Nrr znot an Option instance: %r�invalid arguments)r�r*rrzrr�rr�r{rr�rr�rrpr�rqrn)rr�r�r,r�rrr�
add_option�s(





zOptionContainer.add_optioncCs|D]}|�|�qdSr)r)rr�r,rrr�add_optionsszOptionContainer.add_optionscCs|j�|�p|j�|�Sr)rrorr/rrr�
get_options
�zOptionContainer.get_optioncCs||jkp||jkSr)rrr/rrr�
has_options
�zOptionContainer.has_optioncCsn|j�|�}|dkr |j�|�}|dkr4td|��|jD]}|j|=q:|jD]}|j|=qN|jj�|�dS)Nzno such option %r)	rrorr>r�r�rr�r)rr.r,r�rrr�
remove_options



zOptionContainer.remove_optioncCs>|js
dSg}|jD]}|jtk	r|�|�|��qd�|�S�NrO)r�rmrr{rr4)r�	formatterr}r,rrr�format_option_helps

z"OptionContainer.format_option_helpcCs|�|���Sr)rjr�rrrrrrj(sz"OptionContainer.format_descriptioncCs:g}|jr|�|�|��|jr0|�|�|��d�|�S)Nrf)rir{rjr�rr4�rrr}rrr�format_help+szOptionContainer.format_helpN)rr(r)r%rr	rrrrrrrrrrrrjr rrrrrxs  			c@s6eZdZddd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
rNcCs$||_t�||j|j|�||_dSr)r8rr%rr�title)rr8r!rirrrr%6s�zOptionGroup.__init__cCsg|_|�|j�dSr)r�r	r8rrrrr<szOptionGroup._create_option_listcCs
||_dSr)r!)rr!rrr�	set_title@szOptionGroup.set_titlecCst�|�|`dSr)rrr�rrrrrCs
zOptionGroup.destroycCs0|�|j�}|��|t�||�7}|��|Sr)r`r!rWrr rXrrrrr Js
zOptionGroup.format_help)N)rr(r)r%rr"rr rrrrr4s

c
@s^eZdZgZddedddddddf
dd�Zdd�Zdd	�Zd
d�Zdd
�Z	dOdd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�ZdPd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�Zd6d7�Zd8d9�ZdQd;d<�Z d=d>�Z!d?d@�Z"dRdAdB�Z#dCdD�Z$dSdEdF�Z%dTdGdH�Z&dIdJ�Z'dUdKdL�Z(dVdMdN�Z)dS)WrNr
TcCsrt�||||�|�|�|	|_||_d|_d|_|dkr@t�}||_|j�	|�|
|_
|j||d�|��dS)NT)�add_help)
rr%�	set_usage�progr��allow_interspersed_args�process_default_valuesr
rrNrk�_populate_option_list�_init_parsing_state)rr]r�rr�rrirZadd_help_optionr%rkrrrr%�s(�
�zOptionParser.__init__cCs.t�|�|jD]}|��q|`|`|`dSr)rrr�r�r)rr�rrrr�s


zOptionParser.destroycCsg|_g|_|��dSr)r�r�rrrrrr�sz OptionParser._create_option_listcCs|jdddtd�d�dS)Nz-hz--helprmzshow this help message and exit�r�rm�rr0rrrr�_add_help_option�s�zOptionParser._add_help_optioncCs|jddtd�d�dS)Nz	--versionr�z&show program's version number and exitr*r+rrrr�_add_version_option�s�z OptionParser._add_version_optioncCs>|jr|�|j�|r |�|�|jr.|��|r:|��dSr)�standard_option_listrr�r-r,)rr�r#rrrr(�s
z"OptionParser._populate_option_listcCsd|_d|_d|_dSr)�rargs�largsr�rrrrr)�sz OptionParser._init_parsing_statecCsL|dkrtd�|_n4|tkr$d|_n$|���d�rB|dd�|_n||_dS)Nz%prog [options]zusage: �)r0r]rr�rr\rrrr$�szOptionParser.set_usagecCs
d|_dS)NT�r&rrrr�enable_interspersed_args�sz%OptionParser.enable_interspersed_argscCs
d|_dS)NFr2rrrr�disable_interspersed_argssz&OptionParser.disable_interspersed_argscCs
||_dSr)r')rr�rrr�set_process_default_valuessz'OptionParser.set_process_default_valuescCs||j|<dSr)rn)rrpr�rrr�set_defaultszOptionParser.set_defaultcKs|j�|�dSr)rnr�)rr�rrr�set_defaultsszOptionParser.set_defaultscCs*|jdd�}|jD]}|�|j�q|Sr)r�r�r|)rZoptionsr�rrr�_get_all_optionss
zOptionParser._get_all_optionscCs`|jst|j�S|j��}|��D]4}|�|j�}t|t�r"|�	�}|�
||�||j<q"t|�Sr)r'rrn�copyr8rorpr�r*r�r�)rrnr,r�r.rrr�get_default_valuess


zOptionParser.get_default_valuescOszt|dt�r t|f|�|�}nJt|�dkrb|sb|d}t|t�sNtd|��|j|k	rjtd��ntd��|j�|�|S)Nrr znot an OptionGroup instance: %rz"invalid OptionGroup (wrong parser)r)	r�r*rrzr�r8r>r�r{)rr�r�r�rrr�add_option_group+s


zOptionParser.add_option_groupcCs0|j�|�p|j�|�}|r,|j|k	r,|jSdSr)rrorr)rr.r,rrr�get_option_group;s
�zOptionParser.get_option_groupcCs&|dkrtjdd�S|dd�SdSr)r��argv)rr�rrr�	_get_argsEszOptionParser._get_argsc
Cs�|�|�}|dkr|��}||_g|_}||_z|�|||�}Wn4ttfk
rv}z|�t	|��W5d}~XYnX||}|�
||�Sr)r>r:r/r0r��
_process_argsrrr
r*�check_values)rr�r�r/r0�stop�errrrr�
parse_argsKs

 zOptionParser.parse_argscCs||fSrr)rr�r�rrrr@rszOptionParser.check_valuescCs�|r�|d}|dkr|d=dS|dd�dkr<|�||�q|dd�dkrft|�dkrf|�||�q|jr~|�|�|d=qdSqdS)Nrr�r6r r�)�_process_long_optrz�_process_short_optsr&r{)rr0r/r��argrrrr?s

zOptionParser._process_argscCst||j�Sr)�
_match_abbrevr)rr�rrr�_match_long_opt�szOptionParser._match_long_optc
Cs�|�d�}d|kr4|�dd�\}}|�d|�d}n|}d}|�|�}|j|}|��r�|j}t|�|kr�|�t	dd|�||d��q�|dkr�|�d�}	q�t
|d|��}	|d|�=n|r�|�td	�|�nd}	|�||	||�dS)
NrrTr TF�.%(option)s option requires %(number)d argument�/%(option)s option requires %(number)d arguments�r,Znumberz%s option does not take a value)
�popr��insertrHrr�r�rzr
rr�r0r�)
rr/r�rFr�Znext_argZhad_explicit_valuer,r�r�rrrrD�s6


��zOptionParser._process_long_optcCs�|�d�}d}d}|dd�D]�}d|}|j�|�}|d7}|sJt|��|��r�|t|�krv|�d||d��d}|j}	t|�|	kr�|�t	dd|	�||	d��q�|	dkr�|�d�}
q�t
|d|	��}
|d|	�=nd}
|�||
||�|rq�qdS)	NrFr r�TrIrJrK)rLrrorr�rzrMr�r
rr�r�)rr/r�rFrA�iZchr�r,r�r�rrrrE�s<
��z OptionParser._process_short_optscCs&|jdkrtj�tjd�S|jSdSr�)r%r;�path�basenamer�r=rrrr�
get_prog_names
zOptionParser.get_prog_namecCs|�d|���S)Nz%prog)rsrQ)r�srrr�expand_prog_nameszOptionParser.expand_prog_namecCs|�|j�Sr)rSrirrrrrszOptionParser.get_descriptionrcCs|rtj�|�t�|�dSr)r��stderr�writer�)rZstatusr#rrrr�szOptionParser.exitcCs(|�tj�|�dd|��|f�dS)Nr6z%s: error: %s
)�print_usager�rTr�rQr$rrrr
szOptionParser.errorcCs"|jr|j�|�|j��SdSdSr)r]rr^rSrrrr�	get_usage#s

�zOptionParser.get_usagecCs|jrt|��|d�dS�N)�file)r]�printrW�rrYrrrrV*s	zOptionParser.print_usagecCs|jr|�|j�SdSdSr)r�rSrrrr�get_version6szOptionParser.get_versioncCs|jrt|��|d�dSrX)r�rZr\r[rrrr�<szOptionParser.print_versioncCs�|dkr|j}|�|�g}|�|�td���|��|jrZ|�t�||��|�d�|j	D]}|�|�
|��|�d�q`|��d�|dd��S)NZOptionsrfrOry)
rr�r{r`r0rWr�rrr�r rXr4)rrr}r�rrrrGs


zOptionParser.format_option_helpcCs|�|j�Sr)rlrkrrrrrlXszOptionParser.format_epilogcCsn|dkr|j}g}|jr*|�|��d�|jrD|�|�|�d�|�|�|��|�|�|��d�|�Sre)	rr]r{rWrirjrrlr4rrrrr [szOptionParser.format_helpcCs |dkrtj}|�|���dSr)r��stdoutrUr r[rrrr�gszOptionParser.print_help)T)NN)rN)N)N)N)N)N)*rr(r)r.rr%rrr,r-r(r)r$r3r4r5r6r7r8r:r;r<r>rCr@r?rHrDrErQrSrr�r
rWrVr\r�rrlr r�rrrrrRs`F�
"

	

'
3	$)





csZ�|kr�S�fdd�|��D�}t|�dkr6|dS|sDt���n|��t�|��dS)Ncsg|]}|���r|�qSr)r)rvZword�rRrrrx�s
�z!_match_abbrev.<locals>.<listcomp>r r)r�rzr�sortr1)rRZwordmapr2rr^rrGts
rG)&�__version__�__all__Z
__copyright__r�r;rbrrr�ImportErrorr0�	Exceptionrr
rrrr1r	r
rr�r�r�r�r�r�rrqrrrrrrrrGrrrrr�<module>s�� 


P




�uA=&__pycache__/decimal.cpython-38.pyc000064400000000551151153537610013012 0ustar00U

e5d@�@svz0ddlTddlmZddlmZddlmZWn@ek
rpddlTddlmZddlmZddlmZYnXdS)�)�*)�__doc__)�__version__)�__libmpdec_version__N)Z_decimalrrr�ImportErrorZ
_pydecimal�rr�/usr/lib64/python3.8/decimal.py�<module>s__pycache__/contextvars.cpython-38.opt-2.pyc000064400000000365151153537610014737 0ustar00U

e5d��@s ddlmZmZmZmZdZdS)�)�Context�
ContextVar�Token�copy_contextN)Z_contextvarsrrrr�__all__�rr�#/usr/lib64/python3.8/contextvars.py�<module>s__pycache__/cProfile.cpython-38.pyc000064400000012577151153537610013172 0ustar00U

e5db�@s�dZdddgZddlZddlZddlZddd�Zddd�Zejje_ejje_Gd	d�dej�Z	d
d�Z
dd
�Zedkr~e�dS)zUPython interface for the 'lsprof' profiler.
   Compatible with the 'profile' module.
�run�runctx�Profile�N���cCst�t��|||�S�N)�
_pyprofile�_Utilsrr)�	statement�filename�sort�r� /usr/lib64/python3.8/cProfile.pyrscCst�t��|||||�Sr)rrrr)r	�globals�localsr
rrrr
rs�c@s`eZdZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
de
_dd�Zdd�Z
dS)ra`Profile(timer=None, timeunit=None, subcalls=True, builtins=True)

    Builds a profiler object using the specified timer function.
    The default timer is a fast built-in one based on real time.
    For custom timer functions returning integers, timeunit can
    be a float specifying a scale (i.e. how long each integer unit
    is, in seconds).
    rcCs$ddl}|�|����|���dS�Nr)�pstats�StatsZ
strip_dirsZ
sort_stats�print_stats)�selfrrrrr
r)szProfile.print_statsc	Cs8ddl}t|d��}|��|�|j|�W5QRXdS)Nr�wb)�marshal�open�create_stats�dump�stats)r�filer�frrr
�
dump_stats-szProfile.dump_statscCs|��|��dSr)�disable�snapshot_stats�rrrr
r3szProfile.create_statsc
Cs,|��}i|_i}|D]P}t|j�}|j}||j}|j}|j}i}	|	|t|j�<|||||	f|j|<q|D]�}|j	rlt|j�}|j	D]�}
z|t|
j�}	Wnt
k
r�Yq�YnX|
j}||
j}|
j}|
j}||	k�r|	|}||d7}||d7}||d7}||d7}||||f|	|<q�qldS)Nr���)Zgetstatsr�label�codeZ	callcountZreccallcountZ
inlinetimeZ	totaltime�idZcalls�KeyError)r�entriesZcallersdicts�entry�funcZncZccZttZctZcallersZsubentry�prevrrr
r7s>






zProfile.snapshot_statscCsddl}|j}|�|||�Sr)�__main__�__dict__r)r�cmdr,�dictrrr
r]szProfile.runcCs(|��zt|||�W5|��X|Sr)�enabler�exec)rr.rrrrr
rbs

zProfile.runctxcOs�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��|��z|||�W�S|��XdS)	Nr"z:descriptor 'runcall' of 'Profile' object needs an argumentr*rz0Passing 'func' as keyword argument is deprecated)�
stacklevelz7runcall expected at least 1 positional argument, got %dr!)�len�	TypeError�pop�warnings�warn�DeprecationWarningr0r)�args�kwrr*r6rrr
�runcallks&

�
�zProfile.runcallz($self, func, /, *args, **kw)cCs|��|Sr)r0r rrr
�	__enter__�szProfile.__enter__cGs|��dSr)r)r�exc_inforrr
�__exit__�szProfile.__exit__N)r)�__name__�
__module__�__qualname__�__doc__rrrrrrr;�__text_signature__r<r>rrrr
rs
&	cCs(t|t�rdd|fS|j|j|jfSdS)N�~r)�
isinstance�str�co_filename�co_firstlineno�co_name)r%rrr
r$�s

r$c
Cs�ddl}ddl}ddl}ddl}ddlm}d}||d�}d|_|jdddd	dd
�|jddd
ddt|j	j
�d�|jdddddd�|jdd�s�|��|�
d�|��\}}||jdd�<|jdk	r�|j�|j�|_t|�dk�r�|j�rd}	|j|dd�}
nR|d}|j�d|j�|��t�|��}t|��|d�}	W5QRX|dddd�}
zt|	|
d|j|j�Wn6tk
�r�}
zd|_|�
|
j�W5d}
~
XYnXn|��|S)Nr)�OptionParserzNcProfile.py [-o output_file_path] [-s sort] [-m module | scriptfile] [arg] ...)�usageFz-oz	--outfile�outfilezSave stats to <outfile>)�dest�help�defaultz-sz--sortrz?Sort order when printing to stdout, based on pstats.Stats classr)rMrNrO�choicesz-m�module�
store_truezProfile a library module)rM�actionrNrOr!r"z(run_module(modname, run_name='__main__'))�
run_module�modnamer1r,)�__file__r?�__package__�
__cached__) �os�sys�runpyrZoptparserJZallow_interspersed_argsZ
add_option�sortedrZsort_arg_dict_default�argvZprint_usage�exit�
parse_argsrL�path�abspathr3rQrT�insert�dirname�io�	open_code�compile�readrr�BrokenPipeError�stdout�errno)rYrZr[rrJrK�parserZoptionsr9r%ZglobsZprogname�fp�excrrr
�main�sd

�

�
�

�� rnr,)Nr)Nr)
rB�__all__Z_lsprofrdZprofilerrrZProfilerrr$rnr?rrrr
�<module>s




o;__pycache__/fnmatch.cpython-38.opt-1.pyc000064400000006435151153537610014002 0ustar00U

e5d��@sjdZddlZddlZddlZddlZddddgZdd�Zejdd	d
�dd��Zd
d�Z	dd�Z
dd�ZdS)a�Filename matching with shell patterns.

fnmatch(FILENAME, PATTERN) matches according to the local convention.
fnmatchcase(FILENAME, PATTERN) always takes case in account.

The functions operate by translating the pattern into a regular
expression.  They cache the compiled regular expressions for speed.

The function translate(PATTERN) returns a regular expression
corresponding to PATTERN.  (It does not compile it.)
�N�filter�fnmatch�fnmatchcase�	translatecCs"tj�|�}tj�|�}t||�S)a�Test whether FILENAME matches PATTERN.

    Patterns are Unix shell style:

    *       matches everything
    ?       matches any single character
    [seq]   matches any character in seq
    [!seq]  matches any char not in seq

    An initial period in FILENAME is not special.
    Both FILENAME and PATTERN are first case-normalized
    if the operating system requires it.
    If you don't want this, use fnmatchcase(FILENAME, PATTERN).
    )�os�path�normcaser)�name�pat�r�/usr/lib64/python3.8/fnmatch.pyrs�T)�maxsize�typedcCs<t|t�r(t|d�}t|�}t|d�}nt|�}t�|�jS)Nz
ISO-8859-1)�
isinstance�bytes�strr�re�compile�match)r
Zpat_strZres_str�resrrr�_compile_pattern&s

rcCshg}tj�|�}t|�}tjtkr@|D]}||�r&|�|�q&n$|D]}|tj�|��rD|�|�qD|S)zJConstruct a list from those elements of the iterable NAMES that match PAT.)rrrr�	posixpath�append)�namesr
�resultrr	rrrr0s
cCst|�}||�dk	S)z�Test whether FILENAME matches PATTERN, including case.

    This is a version of fnmatch() which doesn't case-normalize
    its arguments.
    N)r)r	r
rrrrr@sc	Cs�dt|�}}d}||k�r�||}|d}|dkr>|d}q|dkrP|d}q|dk�r�|}||krz||d	krz|d}||kr�||d
kr�|d}||kr�||d
kr�|d}q�||kr�|d}�q�|||�}d|kr�|�d
d�}n�g}||d	k�r|dn|d}|�d||�}|dk�r(�qN|�|||��|d}|d}�q|�|||��d�dd�|D��}t�dd|�}|d}|dd	k�r�d|dd�}n|ddk�r�d
|}d||f}q|t�|�}qd|S)zfTranslate a shell PATTERN to a regular expression.

    There is no way to quote meta-characters.
    r���*z.*�?�.�[�!�]z\[z--�\�\\��-�css"|]}|�dd��dd�VqdS)r$r%r'z\-N)�replace)�.0�srrr�	<genexpr>ts�ztranslate.<locals>.<genexpr>z([&~|])z\\\1�^N)r-r!z%s[%s]z	(?s:%s)\Z)�lenr)�findr�joinr�sub�escape)	r
�i�nr�c�jZstuffZchunks�krrrrJsV






�)�__doc__rrr�	functools�__all__r�	lru_cacherrrrrrrr�<module>s
	
__pycache__/asyncore.cpython-38.pyc000064400000037236151153537610013251 0ustar00U

e5d~N�@shdZddlZddlZddlZddlZddlZddlZddlmZm	Z	m
Z
mZmZm
Z
mZmZmZmZmZmZmZeee
eeeeh�ZzeWnek
r�iZYnXdd�ZGdd�de�ZeeefZdd	�Zd
d�Z dd
�Z!dd�Z"d&dd�Z#d'dd�Z$e$Z%d(dd�Z&Gdd�d�Z'Gdd�de'�Z(dd�Z)d)dd �Z*ej+d!k�rdGd"d#�d#�Z,Gd$d%�d%e'�Z-dS)*a�Basic infrastructure for asynchronous socket service clients and servers.

There are only two ways to have a program on a single processor do "more
than one thing at a time".  Multi-threaded programming is the simplest and
most popular way to do it, but there is another very different technique,
that lets you have nearly all the advantages of multi-threading, without
actually using multiple threads. it's really only practical if your program
is largely I/O bound. If your program is CPU bound, then pre-emptive
scheduled threads are probably what you really need. Network servers are
rarely CPU-bound, however.

If your operating system supports the select() system call in its I/O
library (and nearly all do), then you can use it to juggle multiple
communication channels at once; doing other work while your I/O is taking
place in the "background."  Although this strategy can seem strange and
complex, especially at first, it is in many ways easier to understand and
control than multi-threaded programming. The module documented here solves
many of the difficult problems for you, making the task of building
sophisticated high-performance network servers and clients a snap.
�N)
�EALREADY�EINPROGRESS�EWOULDBLOCK�
ECONNRESET�EINVAL�ENOTCONN�	ESHUTDOWN�EISCONN�EBADF�ECONNABORTED�EPIPE�EAGAIN�	errorcodec
CsHzt�|�WStttfk
rB|tkr6t|YSd|YSXdS)NzUnknown error %s)�os�strerror�
ValueError�
OverflowError�	NameErrorr)�err�r� /usr/lib64/python3.8/asyncore.py�	_strerrorDsrc@seZdZdS)�ExitNowN)�__name__�
__module__�__qualname__rrrrrLsrcCs:z|��Wn(tk
r"�Yn|��YnXdS�N)�handle_read_event�_reraised_exceptions�handle_error��objrrr�readQsr"cCs:z|��Wn(tk
r"�Yn|��YnXdSr)�handle_write_eventrrr rrr�writeYsr$cCs:z|��Wn(tk
r"�Yn|��YnXdSr)�handle_expt_eventrrr rrr�
_exceptionasr&c
Cs�zX|tj@r|��|tj@r&|��|tj@r8|��|tjtjBtj	B@rV|�
�Wnhtk
r�}z$|jdt
kr�|��n|�
�W5d}~XYn(tk
r��Yn|��YnXdS�Nr)�select�POLLINr�POLLOUTr#�POLLPRIr%ZPOLLHUPZPOLLERRZPOLLNVAL�handle_close�OSError�args�
_DISCONNECTEDrr)r!�flags�errr�	readwriteis"



r2�c	Cs<|dkrt}|�r8g}g}g}t|���D]L\}}|��}|��}|rP|�|�|rd|jsd|�|�|sl|r*|�|�q*g|kr�|kr�|kr�nnt�|�dSt	�	||||�\}}}|D] }|�
|�}|dkr�q�t|�q�|D]"}|�
|�}|dk�rq�t|�q�|D]&}|�
|�}|dk�r,�qt
|��qdSr)�
socket_map�list�items�readable�writable�append�	accepting�time�sleepr(�getr"r$r&)	�timeout�map�r�wr1�fdr!Zis_rZis_wrrr�poll}sD


"







rCcCs�|dkrt}|dk	r t|d�}t��}|r�t|���D]L\}}d}|��r\|tjtjBO}|�	�rt|j
st|tjO}|r8|�||�q8|�|�}|D]&\}}|�
|�}|dkr�q�t||�q�dS)Ni�r)r4�intr(rCr5r6r7r)r+r8r:r*�registerr=r2)r>r?ZpollsterrBr!r0r@rrr�poll2�s(


rF�>@FcCsb|dkrt}|r ttd�r t}nt}|dkr>|r^|||�q,n |r^|dkr^|||�|d}q>dS)NrCr�)r4�hasattrr(rFrC)r>Zuse_pollr?�countZpoll_funrrr�loop�s
rKc@s2eZdZdZdZdZdZdZdZe	dh�Z
dAdd�Zdd�ZdBdd	�Z
dCd
d�Zejejfdd
�ZdDdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�ZdEd'd(�Zd)d*�Z d+d,�Z!d-d.�Z"d/d0�Z#d1d2�Z$d3d4�Z%d5d6�Z&d7d8�Z'd9d:�Z(d;d<�Z)d=d>�Z*d?d@�Z+dS)F�
dispatcherFN�warningc
Cs�|dkrt|_n||_d|_|r�|�d�|�||�d|_z|��|_Wq�tk
r�}z*|j	dt
tfkrvd|_n|�|��W5d}~XYq�Xnd|_
dS�NrTF)r4�_map�_fileno�setblocking�
set_socket�	connectedZgetpeername�addrr-r.rr�del_channel�socket)�self�sockr?rrrr�__init__�s 

zdispatcher.__init__cCs�|jjd|jjg}|jr.|jr.|�d�n|jr>|�d�|jdk	r�z|�d|j�Wn$tk
r�|�t|j��YnXdd�	|�t
|�fS)N�.Z	listeningrSz%s:%dz<%s at %#x>� )�	__class__rrr:rTr9rS�	TypeError�repr�join�id)rWZstatusrrr�__repr__�s

zdispatcher.__repr__cCs|dkr|j}|||j<dSr)rOrP)rWr?rrr�add_channel	szdispatcher.add_channelcCs,|j}|dkr|j}||kr"||=d|_dSr)rPrO)rWr?rBrrrrUszdispatcher.del_channelcCs.||f|_t�||�}|�d�|�|�dSr')Zfamily_and_typerVrQrR)rWZfamily�typerXrrr�
create_sockets

zdispatcher.create_socketcCs||_|��|_|�|�dSr)rV�filenorPrb�rWrXr?rrrrRs
zdispatcher.set_socketcCsDz*|j�tjtj|j�tjtj�dB�Wntk
r>YnXdS)NrH)rVZ
setsockopt�
SOL_SOCKETZSO_REUSEADDR�
getsockoptr-�rWrrr�set_reuse_addr#s
���zdispatcher.set_reuse_addrcCsdS�NTrrirrrr74szdispatcher.readablecCsdSrkrrirrrr87szdispatcher.writablecCs(d|_tjdkr|dkrd}|j�|�S)NT�nt�)r:r�namerV�listen)rWZnumrrrro>szdispatcher.listencCs||_|j�|�Sr)rTrV�bind)rWrTrrrrpDszdispatcher.bindcCspd|_d|_|j�|�}|tttfks8|tkrBtj	dkrB||_
dS|dtfkr^||_
|��nt
|t|��dS)NFTrlr)rS�
connectingrVZ
connect_exrrrrrrnrTr	�handle_connect_eventr-r)rWZaddressrrrr�connectHs��
zdispatcher.connectc
Csvz|j��\}}WnVtk
r(YdStk
rh}z$|jdtttfkrVWY�
dS�W5d}~XYn
X||fSdSr')rV�acceptr]r-r.rrr
)rWZconnrT�whyrrrrtVs
zdispatcher.acceptc
Cstz|j�|�}|WStk
rn}z>|jdtkr<WY�*dS|jdtkr\|��WY�
dS�W5d}~XYnXdSr')rV�sendr-r.rr/r,)rW�data�resultrurrrrvds

zdispatcher.sendc
Csrz(|j�|�}|s |��WdS|WSWnDtk
rl}z&|jdtkrZ|��WY�
dS�W5d}~XYnXdS)N�r)rV�recvr,r-r.r/)rWZbuffer_sizerwrurrrrzqs

zdispatcher.recvc
Csnd|_d|_d|_|��|jdk	rjz|j��Wn6tk
rh}z|jdtt	fkrX�W5d}~XYnXdS)NFr)
rSr:rqrUrV�closer-r.rr
)rWrurrrr{�s
zdispatcher.closecCstj�dt|��dS)Nzlog: %s
)�sys�stderrr$�str)rW�messagerrr�log�szdispatcher.log�infocCs||jkrtd||f�dS)Nz%s: %s)�ignore_log_types�print)rWrrcrrr�log_info�s
zdispatcher.log_infocCs:|jr|��n&|js.|jr$|��|��n|��dSr)r:�
handle_acceptrSrqrr�handle_readrirrrr�s

zdispatcher.handle_read_eventcCs@|j�tjtj�}|dkr(t|t|���|��d|_d|_dSrN)	rVrhrg�SO_ERRORr-r�handle_connectrSrq�rWrrrrrr�szdispatcher.handle_connect_eventcCs*|jr
dS|js|jr|��|��dSr)r:rSrqrr�handle_writerirrrr#�szdispatcher.handle_write_eventcCs0|j�tjtj�}|dkr$|��n|��dSr')rVrhrgr�r,�handle_exptr�rrrr%�s
zdispatcher.handle_expt_eventcCsXt�\}}}}zt|�}Wndt|�}YnX|�d||||fd�|��dS)Nz)<__repr__(self) failed for object at %0x>z:uncaptured python exception, closing channel %s (%s:%s %s)�error)�compact_tracebackr^r`r�r,)rWZnil�t�v�tbinfoZ	self_reprrrrr�s��	zdispatcher.handle_errorcCs|�dd�dS)Nz!unhandled incoming priority eventrM�r�rirrrr��szdispatcher.handle_exptcCs|�dd�dS)Nzunhandled read eventrMr�rirrrr��szdispatcher.handle_readcCs|�dd�dS)Nzunhandled write eventrMr�rirrrr��szdispatcher.handle_writecCs|�dd�dS)Nzunhandled connect eventrMr�rirrrr��szdispatcher.handle_connectcCs|��}|dk	r|j|�dSr)rt�handle_accepted)rWZpairrrrr��szdispatcher.handle_acceptcCs|��|�dd�dS)Nzunhandled accepted eventrM)r{r�)rWrXrTrrrr��szdispatcher.handle_acceptedcCs|�dd�|��dS)Nzunhandled close eventrM)r�r{rirrrr,�szdispatcher.handle_close)NN)N)N)N)r�),rrr�debugrSr:rq�closingrT�	frozensetr�rYrarbrUrVZAF_INETZSOCK_STREAMrdrRrjr7r8rorprsrtrvrzr{r�r�rrrr#r%rr�r�r�r�r�r�r,rrrrrL�sJ

 

	


rLc@s6eZdZddd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�dispatcher_with_sendNcCst�|||�d|_dS)Nry)rLrY�
out_bufferrfrrrrY�szdispatcher_with_send.__init__cCs.d}t�||jdd��}|j|d�|_dS)Nri)rLrvr�)rWZnum_sentrrr�
initiate_sendsz"dispatcher_with_send.initiate_sendcCs|��dSr)r�rirrrr�sz!dispatcher_with_send.handle_writecCs|jpt|j�Sr)rS�lenr�rirrrr8szdispatcher_with_send.writablecCs0|jr|�dt|��|j||_|��dS)Nz
sending %s)r�r�r^r�r�)rWrwrrrrvszdispatcher_with_send.send)NN)rrrrYr�r�r8rvrrrrr��s

r�cCs�t��\}}}g}|std��|rL|�|jjj|jjjt|j	�f�|j
}q~|d\}}}d�dd�|D��}|||f|||fS)Nztraceback does not exist���r[cSsg|]}d|�qS)z
[%s|%s|%s]r)�.0�xrrr�
<listcomp>&sz%compact_traceback.<locals>.<listcomp>)r|�exc_info�AssertionErrorr9�tb_frame�f_code�co_filename�co_namer~�	tb_lineno�tb_nextr_)r�r��tbr��fileZfunction�liner�rrrr�s�r�cCs�|dkrt}t|���D]n}z|��Wqtk
r`}z|jdtkrJn|sP�W5d}~XYqtk
rt�Yq|s��YqXq|��dSr')	r4r5�valuesr{r-r.r
r�clear)r?Z
ignore_allr�rrr�	close_all)s 
r��posixc@sNeZdZdd�Zdd�Zdd�Zdd�Zdd
d�ZeZeZ	dd
�Z
dd�Zd	S)�file_wrappercCst�|�|_dSr)r�duprB�rWrBrrrrYNszfile_wrapper.__init__cCs*|jdkrtjd|t|d�|��dS)Nrzunclosed file %r)�source)rB�warnings�warn�ResourceWarningr{rirrr�__del__Qs

�zfile_wrapper.__del__cGstj|jf|��Sr)rr"rB�rWr.rrrrzWszfile_wrapper.recvcGstj|jf|��Sr)rr$rBr�rrrrvZszfile_wrapper.sendNcCs(|tjkr|tjkr|sdStd��dS)Nrz-Only asyncore specific behaviour implemented.)rVrgr��NotImplementedError)rW�levelZoptnameZbuflenrrrrh]s
��zfile_wrapper.getsockoptcCs(|jdkrdS|j}d|_t�|�dS)Nrr�)rBrr{r�rrrr{hs

zfile_wrapper.closecCs|jSr)rBrirrrreoszfile_wrapper.fileno)N)rrrrYr�rzrvrhr"r$r{rerrrrr�Is
r�c@seZdZddd�Zdd�ZdS)�file_dispatcherNcCsPt�|d|�d|_z|��}Wntk
r4YnX|�|�t�|d�dS)NTF)rLrYrSre�AttributeError�set_filer�set_blocking)rWrBr?rrrrYts
zfile_dispatcher.__init__cCs"t|�|_|j��|_|��dSr)r�rVrerPrbr�rrrr�s
zfile_dispatcher.set_file)N)rrrrYr�rrrrr�rs
r�)r3N)r3N)rGFNN)NF).�__doc__r(rVr|r;r�r�errnorrrrrrrr	r
rrr
rr�r/r4rr�	Exceptionr�KeyboardInterrupt�
SystemExitrr"r$r&r2rCrFZpoll3rKrLr�r�r�rnr�r�rrrr�<module>sD<�


'

*
)__pycache__/codecs.cpython-38.opt-1.pyc000064400000102246151153537610013617 0ustar00U

e5d;��,@s�dZddlZddlZzddlTWn.ek
rNZzede��W5dZ[XYnXddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0g,Zd1Zd2Z	Z
d3ZZd4Z
d5Zejd6kr�e
ZZe
ZneZZeZe
ZeZe
ZeZGd7d�de�ZGd8d�d�ZGd9d�de�ZGd:d;�d;e�ZGd<d�de�ZGd=d>�d>e�ZGd?d�de�ZGd@d�de�Z GdAd�d�Z!GdBd�d�Z"d\dFd�Z#d]dGd�Z$dHd�Z%dId �Z&dJd!�Z'dKd"�Z(dLd#�Z)dMd$�Z*d^dNd'�Z+d_dOd(�Z,dPdQ�Z-dRdS�Z.z4e/dD�Z0e/dT�Z1e/dU�Z2e/dV�Z3e/dW�Z4e/dX�Z5Wn.e6k
�r`dZ0dZ1dZ2dZ3dZ4dZ5YnXdZ7e7�rtddl8Z8e9dYk�r�e$ej:dZd[�e_:e$ej;d[dZ�e_;dS)`z� codecs -- Python Codec Registry, API and helpers.


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

�N)�*z%Failed to load the builtin codecs: %s�register�lookup�open�EncodedFile�BOM�BOM_BE�BOM_LE�BOM32_BE�BOM32_LE�BOM64_BE�BOM64_LE�BOM_UTF8�	BOM_UTF16�BOM_UTF16_LE�BOM_UTF16_BE�	BOM_UTF32�BOM_UTF32_LE�BOM_UTF32_BE�	CodecInfo�Codec�IncrementalEncoder�IncrementalDecoder�StreamReader�StreamWriter�StreamReaderWriter�
StreamRecoder�
getencoder�
getdecoder�getincrementalencoder�getincrementaldecoder�	getreader�	getwriter�encode�decode�
iterencode�
iterdecode�
strict_errors�
ignore_errors�replace_errors�xmlcharrefreplace_errors�backslashreplace_errors�namereplace_errors�register_error�lookup_errorss��s��s��s���littlec@s,eZdZdZdZd	dd�dd�Zdd�ZdS)
rz0Codec details when looking up the codec registryTN)�_is_text_encodingc
CsPt�|||||f�}	||	_||	_||	_||	_||	_||	_||	_|dk	rL||	_	|	S�N)
�tuple�__new__�namer#r$�incrementalencoder�incrementaldecoder�streamwriter�streamreaderr0)
�clsr#r$r8r7r5r6r4r0�self�r;�/usr/lib64/python3.8/codecs.pyr3^szCodecInfo.__new__cCsd|jj|jj|jt|�fS)Nz%<%s.%s object for encoding %s at %#x>)�	__class__�
__module__�__qualname__r4�id�r:r;r;r<�__repr__ms��zCodecInfo.__repr__)NNNNN)�__name__r>r?�__doc__r0r3rBr;r;r;r<rSs��c@s$eZdZdZddd�Zd	dd�ZdS)
ra9 Defines the interface for stateless encoders/decoders.

        The .encode()/.decode() methods may use different error
        handling schemes by providing the errors argument. These
        string values are predefined:

         'strict' - raise a ValueError error (or a subclass)
         'ignore' - ignore the character and continue with the next
         'replace' - replace with a suitable replacement character;
                    Python will use the official U+FFFD REPLACEMENT
                    CHARACTER for the builtin Unicode codecs on
                    decoding and '?' on encoding.
         'surrogateescape' - replace with private code points U+DCnn.
         'xmlcharrefreplace' - Replace with the appropriate XML
                               character reference (only for encoding).
         'backslashreplace'  - Replace with backslashed escape sequences.
         'namereplace'       - Replace with \N{...} escape sequences
                               (only for encoding).

        The set of allowed values can be extended via register_error.

    �strictcCst�dS)a# Encodes the object input and returns a tuple (output
            object, length consumed).

            errors defines the error handling to apply. It defaults to
            'strict' handling.

            The method may not store state in the Codec instance. Use
            StreamWriter for codecs which have to keep state in order to
            make encoding efficient.

            The encoder must be able to handle zero length input and
            return an empty object of the output object type in this
            situation.

        N��NotImplementedError�r:�input�errorsr;r;r<r#�szCodec.encodecCst�dS)a� Decodes the object input and returns a tuple (output
            object, length consumed).

            input must be an object which provides the bf_getreadbuf
            buffer slot. Python strings, buffer objects and memory
            mapped files are examples of objects providing this slot.

            errors defines the error handling to apply. It defaults to
            'strict' handling.

            The method may not store state in the Codec instance. Use
            StreamReader for codecs which have to keep state in order to
            make decoding efficient.

            The decoder must be able to handle zero length input and
            return an empty object of the output object type in this
            situation.

        NrFrHr;r;r<r$�szCodec.decodeN)rE)rE)rCr>r?rDr#r$r;r;r;r<rrs
c@s<eZdZdZddd�Zddd�Zdd	�Zd
d�Zdd
�ZdS)rz�
    An IncrementalEncoder encodes an input in multiple steps. The input can
    be passed piece by piece to the encode() method. The IncrementalEncoder
    remembers the state of the encoding process between calls to encode().
    rEcCs||_d|_dS)z�
        Creates an IncrementalEncoder instance.

        The IncrementalEncoder may use different error handling schemes by
        providing the errors keyword argument. See the module docstring
        for a list of possible values.
        �N)rJ�buffer�r:rJr;r;r<�__init__�szIncrementalEncoder.__init__FcCst�dS)zA
        Encodes input and returns the resulting object.
        NrF�r:rI�finalr;r;r<r#�szIncrementalEncoder.encodecCsdS)z:
        Resets the encoder to the initial state.
        Nr;rAr;r;r<�reset�szIncrementalEncoder.resetcCsdS)z:
        Return the current state of the encoder.
        rr;rAr;r;r<�getstate�szIncrementalEncoder.getstatecCsdS)zl
        Set the current state of the encoder. state must have been
        returned by getstate().
        Nr;�r:�stater;r;r<�setstate�szIncrementalEncoder.setstateN)rE)F)	rCr>r?rDrNr#rQrRrUr;r;r;r<r�s

c@sDeZdZdZddd�Zdd�Zddd	�Zd
d�Zdd
�Zdd�Z	dS)�BufferedIncrementalEncoderz�
    This subclass of IncrementalEncoder can be used as the baseclass for an
    incremental encoder if the encoder must keep some of the output in a
    buffer between calls to encode().
    rEcCst�||�d|_dS�NrK)rrNrLrMr;r;r<rN�sz#BufferedIncrementalEncoder.__init__cCst�dSr1rF�r:rIrJrPr;r;r<�_buffer_encode�sz)BufferedIncrementalEncoder._buffer_encodeFcCs0|j|}|�||j|�\}}||d�|_|Sr1)rLrYrJ�r:rIrP�data�result�consumedr;r;r<r#�s
z!BufferedIncrementalEncoder.encodecCst�|�d|_dSrW)rrQrLrAr;r;r<rQ�s
z BufferedIncrementalEncoder.resetcCs
|jpdS�Nr�rLrAr;r;r<rR�sz#BufferedIncrementalEncoder.getstatecCs|pd|_dSrWr_rSr;r;r<rU�sz#BufferedIncrementalEncoder.setstateN)rE)F)
rCr>r?rDrNrYr#rQrRrUr;r;r;r<rV�s

rVc@s<eZdZdZddd�Zddd�Zdd	�Zd
d�Zdd
�ZdS)rz�
    An IncrementalDecoder decodes an input in multiple steps. The input can
    be passed piece by piece to the decode() method. The IncrementalDecoder
    remembers the state of the decoding process between calls to decode().
    rEcCs
||_dS)z�
        Create an IncrementalDecoder instance.

        The IncrementalDecoder may use different error handling schemes by
        providing the errors keyword argument. See the module docstring
        for a list of possible values.
        N)rJrMr;r;r<rNszIncrementalDecoder.__init__FcCst�dS)z@
        Decode input and returns the resulting object.
        NrFrOr;r;r<r$szIncrementalDecoder.decodecCsdS)z9
        Reset the decoder to the initial state.
        Nr;rAr;r;r<rQszIncrementalDecoder.resetcCsdS)a	
        Return the current state of the decoder.

        This must be a (buffered_input, additional_state_info) tuple.
        buffered_input must be a bytes object containing bytes that
        were passed to decode() that have not yet been converted.
        additional_state_info must be a non-negative integer
        representing the state of the decoder WITHOUT yet having
        processed the contents of buffered_input.  In the initial state
        and after reset(), getstate() must return (b"", 0).
        )�rr;rAr;r;r<rRszIncrementalDecoder.getstatecCsdS)z�
        Set the current state of the decoder.

        state must have been returned by getstate().  The effect of
        setstate((b"", 0)) must be equivalent to reset().
        Nr;rSr;r;r<rU'szIncrementalDecoder.setstateN)rE)F)	rCr>r?rDrNr$rQrRrUr;r;r;r<r�s


c@sDeZdZdZddd�Zdd�Zddd	�Zd
d�Zdd
�Zdd�Z	dS)�BufferedIncrementalDecoderz�
    This subclass of IncrementalDecoder can be used as the baseclass for an
    incremental decoder if the decoder must be able to handle incomplete
    byte sequences.
    rEcCst�||�d|_dS�Nr`)rrNrLrMr;r;r<rN5sz#BufferedIncrementalDecoder.__init__cCst�dSr1rFrXr;r;r<�_buffer_decode:sz)BufferedIncrementalDecoder._buffer_decodeFcCs0|j|}|�||j|�\}}||d�|_|Sr1)rLrcrJrZr;r;r<r$?s
z!BufferedIncrementalDecoder.decodecCst�|�d|_dSrb)rrQrLrAr;r;r<rQGs
z BufferedIncrementalDecoder.resetcCs
|jdfSr^r_rAr;r;r<rRKsz#BufferedIncrementalDecoder.getstatecCs|d|_dSr^r_rSr;r;r<rUOsz#BufferedIncrementalDecoder.setstateN)rE)F)
rCr>r?rDrNrcr$rQrRrUr;r;r;r<ra/s

rac@sTeZdZddd�Zdd�Zdd�Zdd	�Zddd�Zefd
d�Z	dd�Z
dd�ZdS)rrEcCs||_||_dS)aw Creates a StreamWriter instance.

            stream must be a file-like object open for writing.

            The StreamWriter may use different error handling
            schemes by providing the errors keyword argument. These
            parameters are predefined:

             'strict' - raise a ValueError (or a subclass)
             'ignore' - ignore the character and continue with the next
             'replace'- replace with a suitable replacement character
             'xmlcharrefreplace' - Replace with the appropriate XML
                                   character reference.
             'backslashreplace'  - Replace with backslashed escape
                                   sequences.
             'namereplace'       - Replace with \N{...} escape sequences.

            The set of allowed parameter values can be extended via
            register_error.
        N)�streamrJ�r:rdrJr;r;r<rN\szStreamWriter.__init__cCs"|�||j�\}}|j�|�dS)z> Writes the object's contents encoded to self.stream.
        N)r#rJrd�write)r:�objectr[r]r;r;r<rfuszStreamWriter.writecCs|�d�|��dS)z[ Writes the concatenated list of strings to the stream
            using .write().
        rKN)rf�join�r:�listr;r;r<�
writelines|szStreamWriter.writelinescCsdS)a5 Flushes and resets the codec buffers used for keeping state.

            Calling this method should ensure that the data on the
            output is put into a clean state, that allows appending
            of new fresh data without having to rescan the whole
            stream to recover state.

        Nr;rAr;r;r<rQ�s
zStreamWriter.resetrcCs*|j�||�|dkr&|dkr&|��dSr^�rd�seekrQ�r:�offset�whencer;r;r<rm�szStreamWriter.seekcCs||j|�S�z? Inherit all other methods from the underlying stream.
        �rd�r:r4�getattrr;r;r<�__getattr__�szStreamWriter.__getattr__cCs|Sr1r;rAr;r;r<�	__enter__�szStreamWriter.__enter__cCs|j��dSr1�rd�close�r:�type�value�tbr;r;r<�__exit__�szStreamWriter.__exit__N)rE)r)rCr>r?rNrfrkrQrmrtrurvr}r;r;r;r<rZs

�
c@s�eZdZeZddd�Zd dd�Zd!dd	�Zd"dd
�Zd#dd�Z	dd�Z
d$dd�Zdd�Zdd�Z
efdd�Zdd�Zdd�Zd
S)%rrEcCs.||_||_d|_|��|_|j|_d|_dS)a� Creates a StreamReader instance.

            stream must be a file-like object open for reading.

            The StreamReader may use different error handling
            schemes by providing the errors keyword argument. These
            parameters are predefined:

             'strict' - raise a ValueError (or a subclass)
             'ignore' - ignore the character and continue with the next
             'replace'- replace with a suitable replacement character
             'backslashreplace' - Replace with backslashed escape sequences;

            The set of allowed parameter values can be extended via
            register_error.
        r`N)rdrJ�
bytebuffer�charbuffertype�_empty_charbuffer�
charbuffer�
linebufferrer;r;r<rN�s
zStreamReader.__init__cCst�dSr1rFrHr;r;r<r$�szStreamReader.decode���Fc
CsN|jr|j�|j�|_d|_|dkr(|}|dkrBt|j�|krB�q|dkrV|j��}n|j�|�}|j|}|st�qz|�||j	�\}}Wn`t
k
r�}zB|r�|�|d|j�|j	�\}}|jdd�}	t|	�dkrڂn�W5d}~XYnX||d�|_|j|7_|s(�qq(|dk�r,|j}
|j|_n|jd|�}
|j|d�|_|
S)a� Decodes data from the stream self.stream and returns the
            resulting object.

            chars indicates the number of decoded code points or bytes to
            return. read() will never return more data than requested,
            but it might return less, if there is not enough available.

            size indicates the approximate maximum number of decoded
            bytes or code points to read for decoding. The decoder
            can modify this setting as appropriate. The default value
            -1 indicates to read and decode as much as possible.  size
            is intended to prevent having to decode huge files in one
            step.

            If firstline is true, and a UnicodeDecodeError happens
            after the first line terminator in the input only the first line
            will be returned, the rest of the input will be kept until the
            next call to read().

            The method should use a greedy read strategy, meaning that
            it should read as much data as is allowed within the
            definition of the encoding and the given size, e.g.  if
            optional encoding endings or state markers are available
            on the stream, these should be read too.
        NrT��keepends�)
r�r�rhr��lenrd�readr~r$rJ�UnicodeDecodeError�start�
splitlines)r:�size�chars�	firstline�newdatar[�newchars�decodedbytes�exc�linesr\r;r;r<r��sD
�

zStreamReader.readNTc	Cs�|jrP|jd}|jd=t|j�dkr8|jd|_d|_|sL|jdd�d}|S|pVd}|j}|j|dd�}|r�t|t�r�|�d	�s�t|t	�r�|�d
�r�||jddd�7}||7}|jdd�}|�r�t|�dk�r8|d}|d=t|�dk�r|d|j7<||_d|_n|d|j|_|�s�|jdd�d}�q�|d}|djdd�d}||k�r�|j�
|dd��|j|_|�r�|}n|}�q�|�r�|dk	�r�|�r�|�s�|jdd�d}�q�|d
kr^|d9}q^|S)z� Read one line from the input stream and return the
            decoded data.

            size, if given, is passed as size argument to the
            read() method.

        rr�NFr��HT)r��
�
)r�r�r�i@�)r�r�r�r�r�r��
isinstance�str�endswith�bytesrh)	r:r�r��line�readsizer[r��line0withend�line0withoutendr;r;r<�readlinesd
��
�
zStreamReader.readlinecCs|��}|�|�S)aS Read all lines available on the input stream
            and return them as a list.

            Line breaks are implemented using the codec's decoder
            method and are included in the list entries.

            sizehint, if given, is ignored since there is no efficient
            way to finding the true end-of-line.

        )r�r�)r:�sizehintr�r[r;r;r<�	readlines^szStreamReader.readlinescCsd|_|j|_d|_dS)z� Resets the codec buffers used for keeping state.

            Note that no stream repositioning should take place.
            This method is primarily intended to be able to recover
            from decoding errors.

        r`N)r~r�r�r�rAr;r;r<rQms	zStreamReader.resetrcCs|j�||�|��dS)zp Set the input stream's current position.

            Resets the codec buffers used for keeping state.
        Nrlrnr;r;r<rmzszStreamReader.seekcCs|��}|r|St�dS)�4 Return the next decoded line from the input stream.N)r��
StopIteration)r:r�r;r;r<�__next__�szStreamReader.__next__cCs|Sr1r;rAr;r;r<�__iter__�szStreamReader.__iter__cCs||j|�Srqrrrsr;r;r<ru�szStreamReader.__getattr__cCs|Sr1r;rAr;r;r<rv�szStreamReader.__enter__cCs|j��dSr1rwryr;r;r<r}�szStreamReader.__exit__)rE)rE)r�r�F)NT)NT)r)rCr>r?r�rrNr$r�r�r�rQrmr�r�rtrurvr}r;r;r;r<r�s


P
K

�
c@s�eZdZdZdZd!dd�Zd"dd�Zd#d
d�Zd$dd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
d%dd�Zefdd�Zdd�Zdd �Zd	S)&ra StreamReaderWriter instances allow wrapping streams which
        work in both read and write modes.

        The design is such that one can use the factory functions
        returned by the codec.lookup() function to construct the
        instance.

    �unknownrEcCs(||_|||�|_|||�|_||_dS)aR Creates a StreamReaderWriter instance.

            stream must be a Stream-like object.

            Reader, Writer must be factory functions or classes
            providing the StreamReader, StreamWriter interface resp.

            Error handling is done in the same way as defined for the
            StreamWriter/Readers.

        N)rd�reader�writerrJ)r:rd�Reader�WriterrJr;r;r<rN�s
zStreamReaderWriter.__init__r�cCs|j�|�Sr1)r�r��r:r�r;r;r<r��szStreamReaderWriter.readNcCs|j�|�Sr1)r�r�r�r;r;r<r��szStreamReaderWriter.readlinecCs|j�|�Sr1)r�r�)r:r�r;r;r<r��szStreamReaderWriter.readlinescCs
t|j�S�r�)�nextr�rAr;r;r<r��szStreamReaderWriter.__next__cCs|Sr1r;rAr;r;r<r��szStreamReaderWriter.__iter__cCs|j�|�Sr1)r�rf)r:r[r;r;r<rf�szStreamReaderWriter.writecCs|j�|�Sr1)r�rkrir;r;r<rk�szStreamReaderWriter.writelinescCs|j��|j��dSr1�r�rQr�rAr;r;r<rQ�s
zStreamReaderWriter.resetrcCs6|j�||�|j��|dkr2|dkr2|j��dSr^)rdrmr�rQr�rnr;r;r<rm�s
zStreamReaderWriter.seekcCs||j|�Srqrrrsr;r;r<ru�szStreamReaderWriter.__getattr__cCs|Sr1r;rAr;r;r<rv�szStreamReaderWriter.__enter__cCs|j��dSr1rwryr;r;r<r}�szStreamReaderWriter.__exit__)rE)r�)N)N)r)rCr>r?rD�encodingrNr�r�r�r�r�rfrkrQrmrtrurvr}r;r;r;r<r�s 	




�
	c@s�eZdZdZdZdZd!dd�Zd"dd�Zd#d
d�Zd$dd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zd%dd�Zefdd�Zdd�Zdd �Zd	S)&raB StreamRecoder instances translate data from one encoding to another.

        They use the complete set of APIs returned by the
        codecs.lookup() function to implement their task.

        Data written to the StreamRecoder is first decoded into an
        intermediate format (depending on the "decode" codec) and then
        written to the underlying stream using an instance of the provided
        Writer class.

        In the other direction, data is read from the underlying stream using
        a Reader instance and then encoded and returned to the caller.

    r�rEcCs4||_||_||_|||�|_|||�|_||_dS)a� Creates a StreamRecoder instance which implements a two-way
            conversion: encode and decode work on the frontend (the
            data visible to .read() and .write()) while Reader and Writer
            work on the backend (the data in stream).

            You can use these objects to do transparent
            transcodings from e.g. latin-1 to utf-8 and back.

            stream must be a file-like object.

            encode and decode must adhere to the Codec interface; Reader and
            Writer must be factory functions or classes providing the
            StreamReader and StreamWriter interfaces resp.

            Error handling is done in the same way as defined for the
            StreamWriter/Readers.

        N)rdr#r$r�r�rJ)r:rdr#r$r�r�rJr;r;r<rNszStreamRecoder.__init__r�cCs"|j�|�}|�||j�\}}|Sr1)r�r�r#rJ�r:r�r[�bytesencodedr;r;r<r�#szStreamRecoder.readNcCs6|dkr|j��}n|j�|�}|�||j�\}}|Sr1)r�r�r#rJr�r;r;r<r�)s
zStreamRecoder.readlinecCs(|j��}|�||j�\}}|jdd�S)NTr�)r�r�r#rJr�)r:r�r[r�r;r;r<r�2s
zStreamRecoder.readlinescCs t|j�}|�||j�\}}|Sr�)r�r�r#rJ)r:r[r�r;r;r<r�8s
zStreamRecoder.__next__cCs|Sr1r;rAr;r;r<r�?szStreamRecoder.__iter__cCs|�||j�\}}|j�|�Sr1)r$rJr�rf)r:r[�bytesdecodedr;r;r<rfBszStreamRecoder.writecCs(d�|�}|�||j�\}}|j�|�Srb)rhr$rJr�rf)r:rjr[r�r;r;r<rkGs
zStreamRecoder.writelinescCs|j��|j��dSr1r�rAr;r;r<rQMs
zStreamRecoder.resetrcCs |j�||�|j�||�dSr1)r�rmr�rnr;r;r<rmRszStreamRecoder.seekcCs||j|�Srqrrrsr;r;r<ruXszStreamRecoder.__getattr__cCs|Sr1r;rAr;r;r<rv_szStreamRecoder.__enter__cCs|j��dSr1rwryr;r;r<r}bszStreamRecoder.__exit__)rE)r�)N)N)r)rCr>r?rD�
data_encoding�
file_encodingrNr�r�r�r�r�rfrkrQrmrtrurvr}r;r;r;r<r�s$�


	

�
�rrEr�cCst|dk	rd|kr|d}t�|||�}|dkr2|Sz&t|�}t||j|j|�}||_|WS|���YnXdS)aq Open an encoded file using the given mode and return
        a wrapped version providing transparent encoding/decoding.

        Note: The wrapped version will only accept the object format
        defined by the codecs, i.e. Unicode objects for most builtin
        codecs. Output is also codec dependent and will usually be
        Unicode as well.

        Underlying encoded files are always opened in binary mode.
        The default file mode is 'r', meaning to open the file in read mode.

        encoding specifies the encoding which is to be used for the
        file.

        errors may be given to define the error handling. It defaults
        to 'strict' which causes ValueErrors to be raised in case an
        encoding error occurs.

        buffering has the same meaning as for the builtin open() API.
        It defaults to -1 which means that the default buffer size will
        be used.

        The returned wrapped file object provides an extra attribute
        .encoding which allows querying the used encoding. This
        attribute is only available if an encoding was specified as
        parameter.

    N�b)�builtinsrrrr8r7r�rx)�filename�moder�rJ�	buffering�file�info�srwr;r;r<rgs�cCsF|dkr|}t|�}t|�}t||j|j|j|j|�}||_||_|S)a� Return a wrapped version of file which provides transparent
        encoding translation.

        Data written to the wrapped file is decoded according
        to the given data_encoding and then encoded to the underlying
        file using file_encoding. The intermediate data type
        will usually be Unicode but depends on the specified codecs.

        Bytes read from the file are decoded using file_encoding and then
        passed back to the caller encoded using data_encoding.

        If file_encoding is not given, it defaults to data_encoding.

        errors may be given to define the error handling. It defaults
        to 'strict' which causes ValueErrors to be raised in case an
        encoding error occurs.

        The returned wrapped file object provides two extra attributes
        .data_encoding and .file_encoding which reflect the given
        parameters of the same name. The attributes can be used for
        introspection by Python programs.

    N)rrr#r$r8r7r�r�)r�r�r�rJ�	data_info�	file_info�srr;r;r<r�s�cCs
t|�jS)z� Lookup up the codec for the given encoding and return
        its encoder function.

        Raises a LookupError in case the encoding cannot be found.

    )rr#�r�r;r;r<r�scCs
t|�jS)z� Lookup up the codec for the given encoding and return
        its decoder function.

        Raises a LookupError in case the encoding cannot be found.

    )rr$r�r;r;r<r�scCst|�j}|dkrt|��|S)z� Lookup up the codec for the given encoding and return
        its IncrementalEncoder class or factory function.

        Raises a LookupError in case the encoding cannot be found
        or the codecs doesn't provide an incremental encoder.

    N)rr5�LookupError)r��encoderr;r;r<r�s	
cCst|�j}|dkrt|��|S)z� Lookup up the codec for the given encoding and return
        its IncrementalDecoder class or factory function.

        Raises a LookupError in case the encoding cannot be found
        or the codecs doesn't provide an incremental decoder.

    N)rr6r�)r��decoderr;r;r<r �s	
cCs
t|�jS)z� Lookup up the codec for the given encoding and return
        its StreamReader class or factory function.

        Raises a LookupError in case the encoding cannot be found.

    )rr8r�r;r;r<r!�scCs
t|�jS)z� Lookup up the codec for the given encoding and return
        its StreamWriter class or factory function.

        Raises a LookupError in case the encoding cannot be found.

    )rr7r�r;r;r<r"�scksHt|�|f|�}|D]}|�|�}|r|Vq|�dd�}|rD|VdS)z�
    Encoding iterator.

    Encodes the input strings from the iterator using an IncrementalEncoder.

    errors and kwargs are passed through to the IncrementalEncoder
    constructor.
    rKTN)rr#)�iteratorr�rJ�kwargsr�rI�outputr;r;r<r%s	
cksHt|�|f|�}|D]}|�|�}|r|Vq|�dd�}|rD|VdS)z�
    Decoding iterator.

    Decodes the input strings from the iterator using an IncrementalDecoder.

    errors and kwargs are passed through to the IncrementalDecoder
    constructor.
    r`TN)r r$)r�r�rJr�r�rIr�r;r;r<r&s	
cCsdd�|D�S)z� make_identity_dict(rng) -> dict

        Return a dictionary where elements of the rng sequence are
        mapped to themselves.

    cSsi|]
}||�qSr;r;)�.0�ir;r;r<�
<dictcomp>/sz&make_identity_dict.<locals>.<dictcomp>r;)�rngr;r;r<�make_identity_dict'sr�cCs4i}|��D]"\}}||kr&|||<qd||<q|S)a� Creates an encoding map from a decoding map.

        If a target mapping in the decoding map occurs multiple
        times, then that target is mapped to None (undefined mapping),
        causing an exception when encountered by the charmap codec
        during translation.

        One example where this happens is cp875.py which decodes
        multiple character to \u001a.

    N)�items)�decoding_map�m�k�vr;r;r<�make_encoding_map1s


r��ignore�replace�xmlcharrefreplace�backslashreplace�namereplace�__main__zlatin-1zutf-8)r�NrEr�)NrE)rE)rE)<rDr��sys�_codecs�ImportErrorZwhy�SystemError�__all__rr	rrrrr�	byteorderrrrrr
r
rr2rrrgrrVrrarrrrrrrrrr r!r"r%r&r�r�r.r'r(r)r*r+r,r��_falseZ	encodingsrC�stdout�stdinr;r;r;r<�<module>s�	�
B("1+IzWt
0
&








__pycache__/uuid.cpython-38.opt-2.pyc000064400000040051151153537610013321 0ustar00U

&�.e3w�@sddlZddlZddlmZdZejdkr4dZZn ddlZe��Z	e	dkZe	dkZdd	d
dg\Z
ZZZ
eZeZGdd
�d
e�ZGdd�d�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zdaada zddl!Z!Wne"k
�rdZ!YnXd$d%�Z#d&d'�Z$d(d)�Z%d*d+�Z&e�rBeegZ'nJejd,k�rZeeegZ'n2ejd-k�rpeegZ'ne�r~egZ'neeeeegZ'ej(d.k�r�e$ge'Z)nej(d/k�r�e%ge'Z)ne'Z)da*dd0�d1d2�Z+da,d?d3d4�Z-d5d6�Z.d7d8�Z/d9d:�Z0ed;�Z1ed<�Z2ed=�Z3ed>�Z4dS)@�N)�EnumzKa-Ping Yee <ping@zesty.ca>)�win32�darwinFZAIXZLinuxzreserved for NCS compatibilityzspecified in RFC 4122z$reserved for Microsoft compatibilityzreserved for future definitionc@seZdZdZdZdZdS)�SafeUUIDr���N)�__name__�
__module__�__qualname__ZsafeZunsafe�unknown�rr�/usr/lib64/python3.8/uuid.pyrHsrc@s6eZdZdZd<ejd�dd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zedd��Zed d!��Zed"d#��Zed$d%��Zed&d'��Zed(d)��Zed*d+��Zed,d-��Zed.d/��Zed0d1��Zed2d3��Zed4d5��Zed6d7��Z ed8d9��Z!ed:d;��Z"dS)=�UUID)�int�is_safe�__weakref__N)rcCs�|||||g�d�dkr td��|dk	rl|�dd��dd�}|�d��dd�}t|�dkrbtd	��t|d
�}|dk	r�t|�d
kr�td��|ddd
�|ddd
�|ddd
�|dd�}|dk	r�t|�d
kr�td��tj|dd�}|dk	�rt|�dk�rtd��|\}}	}
}}}
d|k�r0dk�s:ntd��d|	k�rRdk�s\ntd��d|
k�rtdk�s~ntd��d|k�r�dk�s�ntd��d|k�r�dk�s�ntd��d|
k�r�dk�s�ntd ��|d>|B}|d!>|	d">B|
d#>B|d$>B|
B}|dk	�rDd|k�r:d%d&>k�sDntd'��|dk	�r�d%|k�rfdk�spntd(��|d)M}|d*O}|d+M}||d,>O}t�	|d-|�t�	|d.|�dS)/N�zGone of the hex, bytes, bytes_le, fields, or int arguments must be givenzurn:�zuuid:z{}�-� z$badly formed hexadecimal UUID string�z bytes_le is not a 16-char string�r���zbytes is not a 16-char string�big)�	byteorder�zfields is not a 6-tuplerlz*field 1 out of range (need a 32-bit value)iz*field 2 out of range (need a 16-bit value)z*field 3 out of range (need a 16-bit value)�z*field 4 out of range (need an 8-bit value)z*field 5 out of range (need an 8-bit value)�z*field 6 out of range (need a 48-bit value)�`�P�@�0��z*int is out of range (need a 128-bit value)zillegal version numberl�����l�����Lrr)
�count�	TypeError�replace�strip�len�
ValueError�int_�
from_bytes�object�__setattr__)�self�hex�bytes�bytes_le�fieldsr�versionr�time_low�time_mid�time_hi_version�clock_seq_hi_variant�
clock_seq_low�node�	clock_seqrrr�__init__�sx 
�
�
����

z
UUID.__init__cCs&d|ji}|jtjkr"|jj|d<|S�Nrr)rrrr
�value)r1�drrr�__getstate__�s
zUUID.__getstate__cCs:t�|d|d�t�|dd|kr.t|d�ntj�dSr?)r/r0rr
)r1�staterrr�__setstate__�s��zUUID.__setstate__cCst|t�r|j|jkStS�N��
isinstancer
r�NotImplemented�r1�otherrrr�__eq__�s
zUUID.__eq__cCst|t�r|j|jkStSrErFrIrrr�__lt__�s
zUUID.__lt__cCst|t�r|j|jkStSrErFrIrrr�__gt__�s
zUUID.__gt__cCst|t�r|j|jkStSrErFrIrrr�__le__�s
zUUID.__le__cCst|t�r|j|jkStSrErFrIrrr�__ge__s
zUUID.__ge__cCs
t|j�SrE)�hashr�r1rrr�__hash__sz
UUID.__hash__cCs|jSrE�rrQrrr�__int__szUUID.__int__cCsd|jjt|�fS)Nz%s(%r))�	__class__r�strrQrrr�__repr__sz
UUID.__repr__cCstd��dS)NzUUID objects are immutable)r()r1�namer@rrrr0szUUID.__setattr__cCsDd|j}d|dd�|dd�|dd�|dd�|dd�fS)N�%032xz%s-%s-%s-%s-%sr�r�rS)r1r2rrr�__str__s





�zUUID.__str__cCs|j�dd�S)Nrr)r�to_bytesrQrrrr3sz
UUID.bytescCs<|j}|ddd�|ddd�|ddd�|dd�S)Nrrrrr�r3)r1r3rrrr4s(
�z
UUID.bytes_lecCs|j|j|j|j|j|jfSrE)r7r8r9r:r;r<rQrrrr5 s
�zUUID.fieldscCs
|jd?S)NrrSrQrrrr7%sz
UUID.time_lowcCs|jd?d@S)Nr �rSrQrrrr8)sz
UUID.time_midcCs|jd?d@S)Nr!r_rSrQrrrr9-szUUID.time_hi_versioncCs|jd?d@S)N�8�rSrQrrrr:1szUUID.clock_seq_hi_variantcCs|jd?d@S)Nr"rarSrQrrrr;5szUUID.clock_seq_lowcCs|jd@d>|jd>B|jBS)N�r"r)r9r8r7rQrrr�time9s
��z	UUID.timecCs|jd@d>|jBS)N�?r)r:r;rQrrrr=>s�zUUID.clock_seqcCs
|jd@S)Nl���rSrQrrrr<Csz	UUID.nodecCs
d|jS)NrYrSrQrrrr2GszUUID.hexcCsdt|�S)Nz	urn:uuid:)rVrQrrr�urnKszUUID.urncCs2|jd@stS|jd@stS|jd@s*tStSdS)Nr%ll)r�RESERVED_NCS�RFC_4122�RESERVED_MICROSOFT�RESERVED_FUTURErQrrr�variantOs


zUUID.variantcCs |jtkrt|jd?d@�SdS)Nr&�)rjrgrrQrrrr6Zs
zUUID.version)NNNNNN)#rrr	�	__slots__rr
r>rBrDrKrLrMrNrOrRrTrWr0r\�propertyr3r4r5r7r8r9r:r;rcr=r<r2rerjr6rrrrr
Nsb4��V














r
c	Gs�ddl}ddl}ddl}|�|�}|dkrP|j�d�}|j||d�}|dkrPdSt|j�}d|d<|j|f||j	|j
|d�}|S)Nr)z/sbinz	/usr/sbin)�path�C�LC_ALL)�stdout�stderr�env)�os�shutil�
subprocessZwhich�pathsep�join�dict�environ�Popen�PIPEZDEVNULL)	�command�argsrtrurv�
executablernrs�procrrr�_popen`s

�r�cCs
|d@S)Nlr��macrrr�
_is_universal�sr�cCs�d}z�t|f|����}|s"WdS|��|jD]�}|������}tt|��D]x}|||krNzN|||�}	t|	�dd�d�}
t	|
�r�|
WW5QR�WS|p�|
}WqNt
tfk
r�YqNXqNq.W5QRXWntk
r�YnX|p�dS)N�:�r)
r��splitrq�lower�rstrip�ranger+rr)r�r,�
IndexError�OSError)r}r~Zhw_identifiersZ	get_index�first_local_macr��line�words�i�wordr�rrr�	_find_mac�s*
r�cCs4d}dD]&}td||dd��}|r*|SdSdS)N)shwaddrsethersaddress:slladdr)rz-az-avZifconfigcSs|dS�Nr#r�r�rrr�<lambda>�r�z#_ifconfig_getnode.<locals>.<lambda>�r�)�keywordsr~r�rrr�_ifconfig_getnode�sr�cCs tdddgdd��}|r|SdS)NZip�links
link/ethercSs|dSr�rr�rrrr��r�z_ip_getnode.<locals>.<lambda>r�r�rrr�_ip_getnode�sr�cCs�ddl}ddl}z|�|���}Wntk
r8YdSXtdd|�|�gdd��}|r\|Stdd|�|�gdd��}|r~|Stdd|�d|�gdd��}|r�|SdS)	NrZarpz-ancSsdS)Nrrr�rrrr��r�z_arp_getnode.<locals>.<lambda>cSs|dSr�rr�rrrr��r�z(%s)cSs|dS)N�rr�rrrr��r�)rt�socketZ
gethostbynameZgethostnamer�r��fsencode)rtr�Zip_addrr�rrr�_arp_getnode�s"�r�cCstdddgdd��S)NZlanscanz-aislan0cSsdS)Nrrr�rrrr��r�z"_lanscan_getnode.<locals>.<lambda>r�rrrr�_lanscan_getnode�sr�cCs&d}�z�tdd�}|sWdS|��|j������}z|�d�}Wn"tk
rdYW5QR�WdSX|jD]�}zl|����}||}t|�dkr�|�d�dkr�t	|�
dd�d�}t|�r�|WW5QR�WS|p�|}Wqlttfk
r�YqlXqlW5QRXWnt
k
�rYnX|�p$dS)	NZnetstatz-iasAddress�r�rr�r)r�rq�readliner�r��indexr,r+r'rr)r�r�r�)r�r�r�r�r�r�r�rrr�_netstat_getnode�s2

r�cCs<ddl}ddl}ddl}d}dddg}z:ddl}|�d�}|jj�|d�|�d|j	�
d��WnYnX|D]�}z$|j|j�
|d�dg|jd	d
�}Wntk
r�YqrYnX|�r|jD]d}	|	�d�d����}
|�d
|
�r�t|
�dd�d�}t|��r|W5QR�S|�p"|}q�W5QRXqr|�p:dS)Nrrzc:\windows\system32zc:\winnt\system32i,�mbcsZipconfigz/allZoem)rq�encoding�:rz((?:[0-9a-f][0-9a-f]-){5}[0-9a-f][0-9a-f]rr)rt�rerv�ctypes�create_string_buffer�windllZkernel32ZGetSystemDirectoryA�insertr@�decoder{rnrxr|r�rqr�r*r��	fullmatchrr)r�)rtr�rvr��dirsr��buffer�dirr�r�r@r�rrr�_ipconfig_getnode�s6

�



r�c	Cs6ddl}ddl}d}|��}|j|_|��|_}|��|�|�dkrLdS|�	�t
|j�D]�}|��|j
|_t|j|�|_|�|�dkr�q^|��|j|_t|j|�|_d�d�|_|��|_}|�|�dkr�q^|�	�|jdd�}t|�dk�rq^t�|d�}t|��r |S|�p(|}q^|�p4dS)Nr�*rrr)�	win32wnet�netbiosZNCBZNCBENUMZCommandZ	LANA_ENUMZBufferZ_packZNetbiosZ_unpackr�ZlengthZResetZNCBRESET�ordZlanaZLana_numZNCBASTAT�ljustZCallnameZADAPTER_STATUSZadapter_addressr+rr.r�)	r�r�r�ZncbZadaptersr�Zstatusr3r�rrr�_netbios_getnodes>
r�c
s�tdk	rdSdatjdkr8tt��j�d�d�dkr8ntdk	rPtj	a
tjadSz�ddl�ddl
�dg}tj�d�s~|�d�|D]�}z���j�|��}Wntk
r�Yq�YnXt|d	�r�|j���fd
d�a
da�qq�t|d
�r�|j�d�_��fdd�a
�qq�z�jj}Wnd}YnXt|dt|dd��aWn>tk
�r~}zddl}|�d|��t�W5d}~XYnXdS)NFr�.r�	Zuuid�win�c�uuid_generate_time_safecs ��d�}�|�}t|j�|fS�Nr�r�r3�raw)�_buffer�res)�_uuid_generate_time_safer�rr�_generate_time_safehs
r�T�uuid_generate_timecs ��d�}�|�t|j�dfSr�r�)r�)�_uuid_generate_timer�rrr�ss
ZUuidCreateSequentialZ
UuidCreatez/Could not find fallback ctypes uuid functions: )�_has_uuid_generate_time_safe�sys�platformrrt�uname�releaser��_uuidZgenerate_time_safer�Zhas_uuid_generate_time_safer�Zctypes.util�
startswith�appendZCDLL�utilZfind_library�	Exception�hasattrr�r�Zrestyper�Zrpcrt4�getattr�_UuidCreate�warnings�warn�
ImportWarning)Z	_libnamesZlibname�lib�excr�r)r�r�r�r�_load_system_functions:sT&






��r�cCst�t�\}}t|d�jS)Nr^)r�r�r
r<)�	uuid_time�_rrr�
_unix_getnode�s
r�cCs:ddl}t�|�d�}t|�dkr6tt|j�d�jSdS)Nrrr^)r�r�r�r�r
�bytes_r�r<)r�r�rrr�_windll_getnode�s

r�cCsddl}|�d�dBS)Nrr"l)�random�getrandbits)r�rrr�_random_getnode�sr�rr�posix�nt)�getterscCsdtdk	rtSttgD]H}z
|�aWnYqYnXtdk	rdtkrRdkrnqtSqdS)Nrr)�_node�_GETTERSr�)r��getterrrr�getnode�s	

 
r�cCst�tdk	rd||kr"dkrdnn>t�\}}zt|�}Wntk
rVtj}YnXt||d�Sddl}|��}|dd}tdk	r�|tkr�td}|a|dkr�ddl	}|�
d�}|d@}	|d?d	@}
|d
?d@}|d@}|d
?d@}
|dkr�t�}t|	|
||
||fdd�S)N)r3rr�dl@'Hw�
r#�l��rr_r"rbrarrd)r5r6)r�r�rr,r
r
rc�time_ns�_last_timestampr�r�r�)r<r=r�Zsafely_generatedrrcZnanosecondsZ	timestampr�r7r8r9r;r:rrr�uuid1�s> 

��r�cCs<ddlm}||jt|d�dd���}t|dd�dd�S)	Nr)�md5�utf-8F)Zusedforsecurityrr�r3r6)�hashlibr�r3�digestr
)�	namespacerXr�r�rrr�uuid3s�
r�cCstt�d�dd�S)Nrrr�)r
rt�urandomrrrr�uuid4sr�cCs8ddlm}||jt|d����}t|dd�dd�S)Nr)�sha1r�rrr�)r�r�r3r�r
)r�rXr�rPrrr�uuid5sr�z$6ba7b810-9dad-11d1-80b4-00c04fd430c8z$6ba7b811-9dad-11d1-80b4-00c04fd430c8z$6ba7b812-9dad-11d1-80b4-00c04fd430c8z$6ba7b814-9dad-11d1-80b4-00c04fd430c8)NN)5rtr��enumr�
__author__r�Z_AIXZ_LINUX�systemZ_platform_systemrfrgrhrirr-r3r�rr
r�r�r�r�r�r�r�r�r�r�r�r�r�r��ImportErrorr�r�r�r�Z_OS_GETTERSrXr�r�r�r�r�r�r�r�Z
NAMESPACE_DNSZ
NAMESPACE_URLZ
NAMESPACE_OIDZNAMESPACE_X500rrrr�<module>/s�

�"
$
T

�
'	__pycache__/modulefinder.cpython-38.pyc000064400000037365151153537610014106 0ustar00U

e5dn_�@sdZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ejdZejdZ
ejdZejdZeefZejZdZdZdZd	Zd
ZdZdZiZd
d�ZiZdd�Zddd�ZGdd�d�ZGdd�d�Zdd�Z e!dk�rz
e �Z"Wne#k
�re$d�YnXdS)z3Find modules used by a script, using introspection.�N�
LOAD_CONST�IMPORT_NAME�
STORE_NAME�STORE_GLOBAL������cCst�|g��|�dS�N)�packagePathMap�
setdefault�append)Zpackagename�path�r�$/usr/lib64/python3.8/modulefinder.py�AddPackagePath(srcCs|t|<dSr)�replacePackageMap)Zoldname�newnamerrr�ReplacePackage3srcCstjj��tjj�||�}|dkr8tdj|d�|d��|jtjjkrVddddt	ffS|jtjj
krtddddtffS|j}|j�
|�r�dtj�|�ddtffSt|jtjj�r�t}n<t|jtjj�r�t}n&t|jtjj�r�t}nddddtffSt�|�}tj�|�d}|||d|ffS)zDAn importlib reimplementation of imp.find_module (for our purposes).NzNo module named {name!r})�name�����rb)�	importlib�	machinery�
PathFinder�invalidate_caches�	find_spec�ImportError�format�loader�BuiltinImporter�
_C_BUILTIN�FrozenImporter�
_PY_FROZEN�origin�
is_package�osr�dirname�_PKG_DIRECTORY�
isinstance�SourceFileLoader�
_PY_SOURCE�ExtensionFileLoader�_C_EXTENSION�SourcelessFileLoader�_PY_COMPILED�
_SEARCH_ERROR�io�	open_code�splitext)rr�specZ	file_pathZkind�file�suffixrrr�_find_module7s*
r:c@seZdZddd�Zdd�ZdS)�ModuleNcCs(||_||_||_d|_i|_i|_dSr)�__name__�__file__�__path__�__code__�globalnames�starimports)�selfrr8rrrr�__init__fszModule.__init__cCsLd|jf}|jdk	r&|d|jf}|jdk	r@|d|jf}|d}|S)Nz	Module(%rz, %r�))r<r=r>)rB�srrr�__repr__ss

zModule.__repr__)NN)r<�
__module__�__qualname__rCrFrrrrr;ds

r;c@s�eZdZd6dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zd7dd�Z	d8dd�Z
dd�Zdd�Zd9dd�Z
dd�Zdd�Zdd�Zd d!�Zd:d"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd;d,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�ZdS)<�ModuleFinderNrcCsZ|dkrtj}||_i|_i|_||_d|_|dk	r8|ng|_|dk	rJ|ng|_g|_dS)Nr)	�sysr�modules�
badmodules�debug�indent�excludes�
replace_paths�processed_paths)rBrrMrOrPrrrrC~szModuleFinder.__init__cGsV||jkrRt|j�D]}tddd�qt|dd�|D]}tt|�dd�q6t�dS)N�   � ��end)rM�rangerN�print�repr)rB�level�str�args�i�argrrr�msg�s
zModuleFinder.msgcGs,|d}||jkr(|jd|_|j|�dS�Nrr�rMrNr^�rBr[rYrrr�msgin�s
zModuleFinder.msgincGs,|d}||jkr(|jd|_|j|�dSr_r`rarrr�msgout�s
zModuleFinder.msgoutc	CsB|�dd|�t�|�� }ddtf}|�d|||�W5QRXdS)Nr�
run_scriptrr�__main__)r^r4r5r.�load_module)rB�pathname�fp�stuffrrrrd�s
zModuleFinder.run_scriptc	CsTtj�|�\}}tj�|�\}}t�|�� }|dtf}|�||||�W5QRXdS)Nr)r)r�splitr6r4r5r.rf)rBrg�dirrZextrhrirrr�	load_file�s

zModuleFinder.load_filerc	Cs\|�dd||||�|j||d�}|�||�\}}|�||�}|sF|S|jrX|�||�dS)Nr�import_hook�rY)r^�determine_parent�find_head_package�	load_tailr>�ensure_fromlist)	rBr�caller�fromlistrY�parent�q�tail�mrrrrm�szModuleFinder.import_hookcCsN|�dd||�|r|dkr,|�dd�dS|j}|dkr�|jrH|d8}|dkrx|j|}||ksft�|�dd|�|S|�d�|kr�td��d�|�	d�d|��}|j|}|�dd|�|S|jr�|j|}||ks�t�|�dd|�|Sd|k�r>|�
d�}|d|�}|j|}|j|k�s,t�|�dd|�|S|�dd�dS)	N�rorzdetermine_parent -> Nonerzdetermine_parent ->�.zrelative importpath too deep)rbrcr<r>rK�AssertionError�countr �joinrj�rfind)rBrsrYZpnamerur\rrrro�sB





zModuleFinder.determine_parentcCs�|�dd||�d|kr@|�d�}|d|�}||dd�}n|}d}|r\d|j|f}n|}|�|||�}|r�|�dd||f�||fS|r�|}d}|�|||�}|r�|�dd||f�||fS|�dd|�td	|��dS)
Nryrprzrr�%s.%szfind_head_package ->�"raise ImportError: No module named�No module named )rb�findr<�
import_modulercr )rBrurr\�headrwZqnamervrrrrp�s.
zModuleFinder.find_head_packagecCs�|�dd||�|}|r�|�d�}|dkr2t|�}|d|�||dd�}}d|j|f}|�|||�}|s|�dd|�td|��q|�dd	|�|S)
Nryrqrzrrrr�r�zload_tail ->)rbr��lenr<r�rcr )rBrvrwrxr\r�Zmnamerrrrq�s
zModuleFinder.load_tailcCs�|�dd|||�|D]d}|dkrD|sz|�|�}|rz|�||d�qt||�sd|j|f}|�|||�}|std|��qdS)Nryrr�*rrr�)r^�find_all_submodulesrr�hasattrr<r�r )rBrxrt�	recursive�sub�all�subnameZsubmodrrrrrs

zModuleFinder.ensure_fromlistc
	Cs�|js
dSi}g}|tjjdd�7}|tjjdd�7}|tjjdd�7}|jD]�}zt�|�}Wn&tk
r�|�	dd|�YqTYnX|D]R}d}|D]0}t
|�}	||	d�|kr�|d|	�}q�q�|r�|dkr�|||<q�qT|��S)Nrzcan't list directoryrC)r>rr�EXTENSION_SUFFIXES�SOURCE_SUFFIXES�BYTECODE_SUFFIXESr)�listdir�OSErrorr^r��keys)
rBrxrK�suffixesrk�namesr�modZsuff�nrrrr�s.

z ModuleFinder.find_all_submodulescCs
|�dd|||�z|j|}Wntk
r4YnX|�dd|�|S||jkrb|�dd�dS|r�|jdkr�|�dd�dSz|�||o�|j|�\}}}Wn$tk
r�|�ddd�YdSXz|�	||||�}W5|r�|��X|r�t
|||�|�dd|�|S)Nrr�zimport_module ->zimport_module -> None)rbrK�KeyErrorrcrLr>�find_moduler �closerf�setattr)rBZpartname�fqnamerurxrhrgrirrrr�.s:
�
zModuleFinder.import_modulec
Cs(|\}}}|�dd||od|�|tkrF|�||�}|�dd|�|S|tkr`t|��|d�}	n||tkr�z|��}
tj	�
|
|i�Wn:tk
r�}z|�ddt|�|��W5d}~XYnXt
�t|
�dd��}	nd}	|�|�}||_|	�r|j�r|�|	�}	|	|_|�|	|�|�dd|�|S)Nrrfrhzload_module ->�execzraise ImportError: �)rbr+�load_packagercr.�compile�readr2r�_bootstrap_external�
_classify_pycr rZ�marshal�loads�
memoryview�
add_moduler=rP�replace_paths_in_coder?�	scan_code)rBr�rhrg�	file_infor9�mode�typerx�co�data�excrrrrfNs4


zModuleFinder.load_modulecCs<||jkri|j|<|r*d|j||j<nd|j|d<dS)Nr�-)rLr<)rBrrsrrr�_add_badmoduleks


zModuleFinder._add_badmodulecCsB||jkr|�||�dSz|j|||d�Wn~tk
rn}z"|�ddt|��|�||�W5d}~XYn�tk
r�}z"|�ddt|��|�||�W5d}~XYn�X|�r>|D]�}|d|}||jkr�|�||�q�z|j|||g|d�Wq�tk
�r:}z"|�ddt|��|�||�W5d}~XYq�Xq�dS)NrnrzImportError:zSyntaxError:rz)rLr�rmr r^rZ�SyntaxError)rBrrsrtrYr^r��fullnamerrr�_safe_import_hookss,

zModuleFinder._safe_import_hookccs�|j}|j}|j}dd�t�|�D�}t|�D]�\}\}}|tkrTd||ffVq.|tkr.|dkr.||dd||ddkr�tkr.nq.|||dd}	|||dd}
|	dkr�d|
||ffVq.d|	|
||ffVq.q.dS)	NcSs"g|]\}}}|tkr||f�qSr)�EXTENDED_ARG)�.0�_�opr]rrr�
<listcomp>�s�z-ModuleFinder.scan_opcodes.<locals>.<listcomp>�storerrr�absolute_import�relative_import)	�co_code�co_names�	co_consts�disZ_unpack_opargs�	enumerate�	STORE_OPSrr)rBr��coder��constsZopargsr\r�ZopargrYrtrrr�scan_opcodes�s(��
zModuleFinder.scan_opcodescCs�|j}|j}||�D�]F\}}|dkr8|\}d|j|<q|dk�r|\}}d}	|dk	rpd|krbd}	dd�|D�}|j|||dd�|	�r\d}
|jr�|j�|jd	|�}
|
dkr�|j�|�}
|
dk	r�|j�|
j�|j	�|
j	�|
j
dkr�d|j	|<n
d|j	|<q|d
k�rT|\}}}|�r0|j||||d�n"|j||d�}|j|jd|dd�qt|��q|j
D]"}
t|
t|���rd|�|
|��qddS)Nr�rr�rr�cSsg|]}|dkr|�qS)r�r)r��frrrr��sz*ModuleFinder.scan_code.<locals>.<listcomp>rnrzr�)r�r�r@r�r>rK�getr<�updaterAr?ro�RuntimeErrorr�r,r�r�)rBr�rxr��scannerZwhatr[rrtZ	have_starZmmrYru�crrrr��sH





zModuleFinder.scan_codecCs�|�dd||�t�|�}|r"|}|�|�}||_|g|_|jt�|g�|_|�d|j�\}}}z&|�	||||�|�
dd|�|W�S|r�|��XdS)Nrr�rCzload_package ->)rbrr�r�r=r>r
r�r�rfrc)rBr�rgrrxrhZbufrirrrr��s

zModuleFinder.load_packagecCs*||jkr|j|St|�|j|<}|Sr)rKr;)rBr�rxrrrr��s

zModuleFinder.add_modulecCsn|dk	r|jd|}n|}||jkr<|�dd|�t|��|dkrd|tjkr^ddddtffS|j}t||�S)Nrzrzfind_module -> Excludedr)	r<rOrcr rJ�builtin_module_namesr$rr:)rBrrrur�rrrr��s

zModuleFinder.find_modulecCst�tdd�tdd�t|j���}|D]B}|j|}|jrRtddd�ntddd�td||jpnd	�q0|��\}}|r�t�td
�|D]*}t|j|���}td|dd
�|��q�|�rt�tddd�td�|D]*}t|j|���}td|dd
�|��q�dS)z�Print a report to stdout, listing the found modules with their
        paths, as well as modules that are missing, or seem to be missing.
        z
  %-25s %s)�NameZFile)�----r��PrSrTrxz%-25srzMissing modules:�?z
imported fromz, z7Submodules that appear to be missing, but could also bez#global names in the parent package:N)	rW�sortedrKr�r>r=�any_missing_mayberLr})rBr��keyrx�missing�mayberZmodsrrr�reports0
zModuleFinder.reportcCs|��\}}||S)z�Return a list of modules that appear to be missing. Use
        any_missing_maybe() if you want to know which modules are
        certain to be missing, and which *may* be missing.
        )r�)rBr�r�rrr�any_missing"szModuleFinder.any_missingcCs�g}g}|jD]�}||jkrq|�d�}|dkr<|�|�q||dd�}|d|�}|j�|�}|dk	r�||j|kr�|�|�q�||jkr�q�|jr�|�|�q�|�|�q|�|�q|��|��||fS)a�Return two lists, one with modules that are certainly missing
        and one with modules that *may* be missing. The latter names could
        either be submodules *or* just global names in the package.

        The reason it can't always be determined is that it's impossible to
        tell which names are imported when "from module import *" is done
        with an extension module, short of actually importing it.
        rzrrN)	rLrOr~rrKr�r@rA�sort)rBr�r�rr\r�ZpkgnameZpkgrrrr�*s0	




zModuleFinder.any_missing_maybecCs�tj�|j�}}|jD]*\}}|�|�r||t|�d�}qDq|jr�||jkr�||krr|�	dd||f�n|�	dd|f�|j�
|�t|j�}t
t|��D](}t||t|��r�|�||�||<q�|jt|�|d�S)Nrzco_filename %r changed to %rz co_filename %r remains unchanged)r��co_filename)r)r�normpathr�rP�
startswithr�rMrQrcr�listr�rVr,r�r��replace�tuple)rBr�Znew_filenameZoriginal_filenamer��rr�r\rrrr�Xs&
��
z"ModuleFinder.replace_paths_in_code)NrNN)NNr)r)r)r)N)r<rGrHrCr^rbrcrdrlrmrorprqrrr�r�rfr�r�r�r�r�r�r�r�r�r�r�rrrrrI|s2
	

#
 
1
".rIc
Cs�ddl}z|�tjdd�d�\}}Wn2|jk
rX}zt|�WY�dSd}~XYnXd}d}g}g}|D]Z\}}	|dkr�|d}|dkr�d}|dkr�||	�tj�}|dkr�d}|dkrn|�|	�qn|s�d	}
n|d}
tj	dd�}tj	�
|
�|d<||}|dk�r.td
�|D]}tdt|���qt|||�}
|dd�D]`}|dk�r\d}�qF|�r�|dd�d
k�r�|
�
|dd�ddg�n
|
�
|�n
|
�|��qF|
�|
�|
��|
S)Nrrzdmp:qx:z-dz-mz-pz-qz-xzhello.pyzpath:rR���z.*r�)�getoptrJ�argv�errorrWrjr)�pathseprrr*rXrIrmrlrdr�)r�Zoptsr[r^rMZdomodsZaddpathZexclude�o�aZscriptr�item�mfr]rrr�testpsX


r�rez
[interrupted])N)%�__doc__r�Zimportlib._bootstrap_externalr�importlib.machineryr�r)r4rJ�types�warningsZopmaprrrrr�r�r3r.r2r0r+r$r&r
rrrr:r;rIr�r<r��KeyboardInterruptrWrrrr�<module>sL




-w;

__pycache__/abc.cpython-38.opt-1.pyc000064400000012330151153537610013076 0ustar00U

e5d��@s�dZdd�ZGdd�de�ZGdd�de�ZGdd�de�Zz,d	d
lm	Z	m
Z
mZmZm
Z
mZmZmZWn*ek
r�d	dlmZm	Z	de_YnXGd
d�de�ZGdd�ded�ZdS)z3Abstract Base Classes (ABCs) according to PEP 3119.cCs
d|_|S)a<A decorator indicating abstract methods.

    Requires that the metaclass is ABCMeta or derived from it.  A
    class that has a metaclass derived from ABCMeta cannot be
    instantiated unless all of its abstract methods are overridden.
    The abstract methods can be called using any of the normal
    'super' call mechanisms.  abstractmethod() may be used to declare
    abstract methods for properties and descriptors.

    Usage:

        class C(metaclass=ABCMeta):
            @abstractmethod
            def my_abstract_method(self, ...):
                ...
    T)�__isabstractmethod__)�funcobj�r�/usr/lib64/python3.8/abc.py�abstractmethodsrcs$eZdZdZdZ�fdd�Z�ZS)�abstractclassmethodztA decorator indicating abstract classmethods.

    Deprecated, use 'classmethod' with 'abstractmethod' instead.
    Tcsd|_t��|�dS�NT�r�super�__init__��self�callable��	__class__rrr
$szabstractclassmethod.__init__��__name__�
__module__�__qualname__�__doc__rr
�
__classcell__rrrrrsrcs$eZdZdZdZ�fdd�Z�ZS)�abstractstaticmethodzvA decorator indicating abstract staticmethods.

    Deprecated, use 'staticmethod' with 'abstractmethod' instead.
    Tcsd|_t��|�dSrrrrrrr
1szabstractstaticmethod.__init__rrrrrr)src@seZdZdZdZdS)�abstractpropertyzoA decorator indicating abstract properties.

    Deprecated, use 'property' with 'abstractmethod' instead.
    TN)rrrrrrrrrr6sr�)�get_cache_token�	_abc_init�
_abc_register�_abc_instancecheck�_abc_subclasscheck�	_get_dump�_reset_registry�
_reset_caches)�ABCMetar�abccsReZdZdZ�fdd�Zdd�Zdd�Zdd	�Zddd�Zd
d�Z	dd�Z
�ZS)r!a�Metaclass for defining Abstract Base Classes (ABCs).

        Use this metaclass to create an ABC.  An ABC can be subclassed
        directly, and then acts as a mix-in class.  You can also register
        unrelated concrete classes (even built-in classes) and unrelated
        ABCs as 'virtual subclasses' -- these and their descendants will
        be considered subclasses of the registering ABC by the built-in
        issubclass() function, but the registering ABC won't show up in
        their MRO (Method Resolution Order) nor will method
        implementations defined by the registering ABC be callable (not
        even via super()).
        cs"t�j||||f|�}t|�|S)N)r	�__new__r)�mcls�name�bases�	namespace�kwargs�clsrrrr#TszABCMeta.__new__cCs
t||�S)z{Register a virtual subclass of an ABC.

            Returns the subclass, to allow usage as a class decorator.
            )r�r)�subclassrrr�registerYszABCMeta.registercCs
t||�S)z'Override for isinstance(instance, cls).)r)r)�instancerrr�__instancecheck__`szABCMeta.__instancecheck__cCs
t||�S)z'Override for issubclass(subclass, cls).)rr*rrr�__subclasscheck__dszABCMeta.__subclasscheck__NcCs�td|j�d|j��|d�tdt���|d�t|�\}}}}td|��|d�td|��|d�td|��|d�td|��|d�d	S)
z'Debug helper to print the ABC registry.zClass: �.)�filezInv. counter: z_abc_registry: z_abc_cache: z_abc_negative_cache: z_abc_negative_cache_version: N)�printrrrr)r)r1�
_abc_registry�
_abc_cache�_abc_negative_cache�_abc_negative_cache_versionrrr�_dump_registryhs�
�zABCMeta._dump_registrycCst|�dS)z.Clear the registry (for debugging or testing).N)r�r)rrr�_abc_registry_cleartszABCMeta._abc_registry_clearcCst|�dS)z,Clear the caches (for debugging or testing).N)r r8rrr�_abc_caches_clearxszABCMeta._abc_caches_clear)N)rrrrr#r,r.r/r7r9r:rrrrrr!Gs
r!c@seZdZdZdZdS)�ABCzVHelper class that provides a standard way to create an ABC using
    inheritance.
    rN)rrrr�	__slots__rrrrr;}sr;)�	metaclassN)rr�classmethodr�staticmethodr�propertyr�_abcrrrrrrrr �ImportErrorZ_py_abcr!r�typer;rrrr�<module>s

	,6__pycache__/formatter.cpython-38.opt-2.pyc000064400000035403151153537610014363 0ustar00U

e5d';�@s�ddlZddlZejdedd�dZGdd�d�ZGdd�d�ZGd	d
�d
�ZGdd�de�ZGd
d�de�Z	ddd�Z
edkr�e
�dS)�Nz"the formatter module is deprecated�)�
stacklevelc@s�eZdZd'dd�Zdd�Zdd�Zdd	�Zd(d
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd)d#d$�Zd*d%d&�ZdS)+�
NullFormatterNcCs|dkrt�}||_dS�N)�
NullWriter�writer��selfr�r
�!/usr/lib64/python3.8/formatter.py�__init__)szNullFormatter.__init__cCsdSrr
�r	�	blankliner
r
r�
end_paragraph-�zNullFormatter.end_paragraphcCsdSrr
�r	r
r
r�add_line_break.rzNullFormatter.add_line_breakcOsdSrr
�r	�args�kwr
r
r�add_hor_rule/rzNullFormatter.add_hor_rulecCsdSrr
�r	�format�counterrr
r
r�add_label_data0rzNullFormatter.add_label_datacCsdSrr
�r	�datar
r
r�add_flowing_data1rzNullFormatter.add_flowing_datacCsdSrr
rr
r
r�add_literal_data2rzNullFormatter.add_literal_datacCsdSrr
rr
r
r�flush_softspace3rzNullFormatter.flush_softspacecCsdSrr
�r	�alignr
r
r�push_alignment4rzNullFormatter.push_alignmentcCsdSrr
rr
r
r�
pop_alignment5rzNullFormatter.pop_alignmentcCsdSrr
)r	�xr
r
r�	push_font6rzNullFormatter.push_fontcCsdSrr
rr
r
r�pop_font7rzNullFormatter.pop_fontcCsdSrr
)r	�marginr
r
r�push_margin8rzNullFormatter.push_margincCsdSrr
rr
r
r�
pop_margin9rzNullFormatter.pop_margincCsdSrr
�r	�spacingr
r
r�set_spacing:rzNullFormatter.set_spacingcGsdSrr
�r	�stylesr
r
r�
push_style;rzNullFormatter.push_style�cCsdSrr
�r	�nr
r
r�	pop_style<rzNullFormatter.pop_stylecCsdSrr
�r	�flagr
r
r�assert_line_data=rzNullFormatter.assert_line_data)N)N)r0)r0)�__name__�
__module__�__qualname__rrrrrrrrr"r#r%r&r(r)r,r/r3r6r
r
r
rrs$


rc@s�eZdZdd�Zdd�Zdd�Zdd�Zd-d
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd.d)d*�Zd/d+d,�Zd	S)0�AbstractFormattercCsR||_d|_g|_g|_g|_d|_g|_d|_d|_d|_	d|_
d|_d|_dS�Nr0r)
rr!�align_stack�
font_stack�margin_stackr+�style_stack�nospace�	softspace�para_end�parskip�
hard_break�
have_labelrr
r
rrNszAbstractFormatter.__init__cCs`|js|j��d|_|j|krD|jsD|j�||j�||_d|_d|_|_|_d|_dS�Nrr0)	rDr�send_line_breakrErC�send_paragraphr@rBrAr
r
r
rr]s
zAbstractFormatter.end_paragraphcCs8|js"|js"|j��d|_|_d|_|_d|_dSrF)rDrBrrGrErCr@rArr
r
rrhs

z AbstractFormatter.add_line_breakcOsF|js|j��|jj||�d|_|_d|_|_|_|_dSr;)	rDrrG�
send_hor_ruler@rErBrArCrr
r
rros

zAbstractFormatter.add_hor_ruleNcCs�|js|js|j��|js0|j�|r*dp,d�t|t�rP|j�|�	||��n|j�|�d|_
|_|_|_d|_|_dSr;)
rErDrrGrBrH�
isinstance�str�send_label_data�format_counterr@rArCrr
r
rrvs

z AbstractFormatter.add_label_datacCstd}|D]f}|dkr"|d|}q|dkrD|dkrn||�||�}q|dkrf|dkrn||�||�}q||}q|S)N��1z%dZaArZiI)�
format_letter�format_roman)r	rr�label�cr
r
rrM�s
z AbstractFormatter.format_countercCs<d}|dkr8t|dd�\}}tt|�|�}||}q|S)NrNrr0�)�divmod�chr�ord)r	�caserrRr$�sr
r
rrP�s
zAbstractFormatter.format_letterc	Cs�ddddg}dddg}d\}}|d	kr�t|d
�\}}|dkrV||||d|}nT|d
krt|||||}n6|dkr�||}|d}nd}||||}||}|d}q|dkr�|��S|S)N�ir$rS�m�v�l�d)rNrr�
�	r0��rN�I)rU�upper)	r	rXrZonesZfivesrR�indexr$rYr
r
rrQ�s&


zAbstractFormatter.format_romancCs�|sdS|dd���}|dd���}d�|���}|jrD|sDdS|sN|jrv|sh|jsdd|_d|_dS|jsvd|}d|_|_|_|_|_||_|j	�
|�dS)Nr0���� r)�isspace�join�splitr@rArCrDrBrEr�send_flowing_data)r	rZprespaceZ	postspacer
r
rr�s*

�z"AbstractFormatter.add_flowing_datacCsZ|sdS|jr|j�d�|dd�dk|_d|_|_|_|_|_|j�|�dS)Nrgrf�
r)	rArrkrDr@rBrCrE�send_literal_datarr
r
rr�s�z"AbstractFormatter.add_literal_datacCs:|jr6d|_|_|_|_|_d|_|j�d�dS�Nrr0rg)rArDrBrCrEr@rrkrr
r
rr�s�z!AbstractFormatter.flush_softspacecCs@|r.||jkr.|j�|�||_|j�|�n|j�|j�dSr)r!r�
new_alignmentr<�appendr r
r
rr"�s
z AbstractFormatter.push_alignmentcCsH|jr|jd=|jr2|jd|_}|j�|�nd|_|j�d�dS�Nrf)r<r!rror r
r
rr#�szAbstractFormatter.pop_alignmentc
Cs�|\}}}}|jr6d|_|_|_d|_|j�d�|jr~|jd\}}}}	|tkrZ|}|tkrf|}|tkrr|}|tkr~|	}||||f}|j�|�|j�	|�dS)Nrr0rgrf)
rArDrBr@rrkr=�AS_ISrp�new_font)
r	�font�sizerZ�bZttZcsizeZci�cbZcttr
r
rr%�s$zAbstractFormatter.push_fontcCs4|jr|jd=|jr |jd}nd}|j�|�dSrq)r=rrs�r	rtr
r
rr&�szAbstractFormatter.pop_fontcCsB|j�|�dd�|jD�}|s,|r,|d}|j�|t|��dS)NcSsg|]}|r|�qSr
r
��.0r[r
r
r�
<listcomp>sz1AbstractFormatter.push_margin.<locals>.<listcomp>rf)r>rpr�
new_margin�len)r	r'�fstackr
r
rr(s
zAbstractFormatter.push_margincCsF|jr|jd=dd�|jD�}|r,|d}nd}|j�|t|��dS)NrfcSsg|]}|r|�qSr
r
ryr
r
rr{
sz0AbstractFormatter.pop_margin.<locals>.<listcomp>)r>rr|r})r	r~r'r
r
rr)
s
zAbstractFormatter.pop_margincCs||_|j�|�dSr)r+r�new_spacingr*r
r
rr,szAbstractFormatter.set_spacingcGsV|jr*d|_|_|_d|_|j�d�|D]}|j�|�q.|j�t	|j��dSrn)
rArDrBr@rrkr?rp�
new_styles�tuple)r	r.Zstyler
r
rr/szAbstractFormatter.push_styler0cCs$|j|d�=|j�t|j��dSr)r?rr�r�r1r
r
rr3!szAbstractFormatter.pop_stylecCs$||_|_d|_|_|_dS�Nr)r@rDrBrCrEr4r
r
rr6%sz"AbstractFormatter.assert_line_data)N)r0)r0)r7r8r9rrrrrrMrPrQrrrr"r#r%r&r(r)r,r/r3r6r
r
r
rr:@s*
	
	
	
r:c@steZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)rcCsdSrr
rr
r
rr2rzNullWriter.__init__cCsdSrr
rr
r
r�flush3rzNullWriter.flushcCsdSrr
r r
r
rro4rzNullWriter.new_alignmentcCsdSrr
rxr
r
rrs5rzNullWriter.new_fontcCsdSrr
�r	r'�levelr
r
rr|6rzNullWriter.new_margincCsdSrr
r*r
r
rr7rzNullWriter.new_spacingcCsdSrr
r-r
r
rr�8rzNullWriter.new_stylescCsdSrr
r
r
r
rrH9rzNullWriter.send_paragraphcCsdSrr
rr
r
rrG:rzNullWriter.send_line_breakcOsdSrr
rr
r
rrI;rzNullWriter.send_hor_rulecCsdSrr
rr
r
rrL<rzNullWriter.send_label_datacCsdSrr
rr
r
rrk=rzNullWriter.send_flowing_datacCsdSrr
rr
r
rrm>rzNullWriter.send_literal_dataN)r7r8r9rr�rorsr|rr�rHrGrIrLrkrmr
r
r
rr*src@sdeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�AbstractWritercCstd|f�dS)Nznew_alignment(%r)��printr r
r
rroIszAbstractWriter.new_alignmentcCstd|f�dS)Nznew_font(%r)r�rxr
r
rrsLszAbstractWriter.new_fontcCstd||f�dS)Nznew_margin(%r, %d)r�r�r
r
rr|OszAbstractWriter.new_margincCstd|f�dS)Nznew_spacing(%r)r�r*r
r
rrRszAbstractWriter.new_spacingcCstd|f�dS)Nznew_styles(%r)r�r-r
r
rr�UszAbstractWriter.new_stylescCstd|f�dS)Nzsend_paragraph(%r)r�r
r
r
rrHXszAbstractWriter.send_paragraphcCstd�dS)Nzsend_line_break()r�rr
r
rrG[szAbstractWriter.send_line_breakcOstd�dS)Nzsend_hor_rule()r�rr
r
rrI^szAbstractWriter.send_hor_rulecCstd|f�dS)Nzsend_label_data(%r)r�rr
r
rrLaszAbstractWriter.send_label_datacCstd|f�dS)Nzsend_flowing_data(%r)r�rr
r
rrkdsz AbstractWriter.send_flowing_datacCstd|f�dS)Nzsend_literal_data(%r)r�rr
r
rrmgsz AbstractWriter.send_literal_dataN)r7r8r9rorsr|rr�rHrGrIrLrkrmr
r
r
rr�Asr�c@sFeZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dS)�
DumbWriterN�HcCs(|ptj|_||_t�|�|��dSr)�sys�stdout�file�maxcolrr�reset)r	r�r�r
r
rrts
zDumbWriter.__init__cCsd|_d|_dSr�)�col�atbreakrr
r
rr�zszDumbWriter.resetcCs |j�d|�d|_d|_dS�Nrlr�r��writer�r�r
r
r
rrH~szDumbWriter.send_paragraphcCs|j�d�d|_d|_dSr�r�rr
r
rrG�szDumbWriter.send_line_breakcOs:|j�d�|j�d|j�|j�d�d|_d|_dS)Nrl�-r)r�r�r�r�r�rr
r
rrI�s
zDumbWriter.send_hor_rulecCsV|j�|�|�d�}|dkr4d|_||dd�}|��}|jt|�|_d|_dS)Nrlrr0)r�r��rfindr��
expandtabsr}r�)r	rrZr
r
rrm�s
zDumbWriter.send_literal_datacCs�|sdS|jp|d��}|j}|j}|jj}|��D]N}|rl|t|�|kr\|d�d}n|d�|d}||�|t|�}d}q6||_|d��|_dS)Nrrlrgr0rf)r�rhr�r�r�r�rjr})r	rr�r�r�r�Zwordr
r
rrk�s$zDumbWriter.send_flowing_data)Nr�)
r7r8r9rr�rHrGrIrmrkr
r
r
rr�ks	

r�cCs�t�}t|�}|dk	r t|�}n$tjdd�r>ttjd�}ntj}z,|D]"}|dkrb|�d�qJ|�|�qJW5|tjk	r�|��X|�d�dS)Nr0rlr)	r�r:�openr��argv�stdin�closerr)r��w�f�fp�liner
r
r�test�s


r��__main__)N)r��warnings�warn�DeprecationWarningrrrr:rr�r�r�r7r
r
r
r�<module>s�"k*C
__pycache__/_pydecimal.cpython-38.opt-2.pyc000064400000232420151153537610014464 0ustar00U

e5d:}�%@s�dddddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$g%ZeZd%Zd&Zd'Zd(d)lZd(d)lZd(d)l	Z	zd(d*l
mZedd+�Z
Wnek
r�d,d-�Z
YnXdZdZdZdZdZdZdZdZd.Zd.Ze	jd/kr�d0Zd0Zd1Znd2Zd2Zd3Zeed4ZGd5d�de�ZGd6d�de�Z Gd7d�de�Z!Gd8d�de!�Z"Gd9d	�d	ee#�Z$Gd:d�de!�Z%Gd;d�de!e#�Z&Gd<d
�d
e�Z'Gd=d�de!�Z(Gd>d�de�Z)Gd?d�de�Z*Gd@d
�d
e'e)�Z+GdAd�de'e)e*�Z,GdBd�dee-�Z.e e$e'e+e)e,e!e*e.g	Z/e"e!e%e!e&e!e(e!iZ0eeeeeeeefZ1d(d)l2Z2e2�3dC�Z4dDd�Z5dEd�Z6[2d�dFd�Z7GdGd�de8�Z9d�dIdJ�Z:ej;�<e9�GdKdL�dLe8�Z=GdMd�de8�Z>GdNdO�dOe8�Z?d�dPdQ�Z@eAjBZCdRdS�ZDdTdU�ZEdVdW�ZFdXdY�ZGd�d[d\�ZHd]d^�ZId_d`�ZJGdadb�dbe8�ZKeK�jLZMd�dcdd�ZNdedf�ZOdgdh�ZPdidjdkdldmdndodpdqdr�	fdsdt�ZQd�dudv�ZRd�dwdx�ZSe>dyee$e+e!ggdzd{d4d(d|�ZTe>d}ee$e+e!e e,ggd~�ZUe>d}eggd~�ZVd(d)lWZWeW�XdeWjYeWjZB�j[Z\eW�Xd��j[Z]eW�Xd��j[Z^eW�Xd�eWjYeWj_B�Z`[Wzd(d)laZbWnek
�rYnXd�d�d��Zcd�d��Zdd�d��Zed�d�d��Zfd�d��Zgd�d��Zhe9d��Zie9d��Zje9d��Zke9d(�Zle9d4�Zme9d��ZneiejfZoe	jpjqZre	jpjsZte	jpjuZvewdperd�er�Zx[	d)S)��Decimal�Context�DecimalTuple�DefaultContext�BasicContext�ExtendedContext�DecimalException�Clamped�InvalidOperation�DivisionByZero�Inexact�Rounded�	Subnormal�Overflow�	Underflow�FloatOperation�DivisionImpossible�InvalidContext�ConversionSyntax�DivisionUndefined�
ROUND_DOWN�
ROUND_HALF_UP�ROUND_HALF_EVEN�
ROUND_CEILING�ROUND_FLOOR�ROUND_UP�ROUND_HALF_DOWN�
ROUND_05UP�
setcontext�
getcontext�localcontext�MAX_PREC�MAX_EMAX�MIN_EMIN�	MIN_ETINY�HAVE_THREADS�HAVE_CONTEXTVARZdecimalz1.70z2.4.2�N)�
namedtuplezsign digits exponentcGs|S�N�)�argsr)r)�"/usr/lib64/python3.8/_pydecimal.py�<lambda>��r,Tl����l��N�Zol������N�Zoi@�Ti����c@seZdZdd�ZdS)rcGsdSr(r)��self�contextr*r)r)r+�handle�szDecimalException.handleN��__name__�
__module__�__qualname__r2r)r)r)r+r�sc@seZdZdS)rN�r4r5r6r)r)r)r+r�sc@seZdZdd�ZdS)r	cGs,|r(t|dj|djdd�}|�|�StS)Nr&�nT)�_dec_from_triple�_sign�_int�_fix_nan�_NaN)r0r1r*�ansr)r)r+r2�s
zInvalidOperation.handleNr3r)r)r)r+r	�sc@seZdZdd�ZdS)rcGstSr(�r=r/r)r)r+r2szConversionSyntax.handleNr3r)r)r)r+rsc@seZdZdd�ZdS)r
cGst|Sr()�_SignedInfinity�r0r1�signr*r)r)r+r2szDivisionByZero.handleNr3r)r)r)r+r

s
c@seZdZdd�ZdS)rcGstSr(r?r/r)r)r+r2"szDivisionImpossible.handleNr3r)r)r)r+rsc@seZdZdd�ZdS)rcGstSr(r?r/r)r)r+r2-szDivisionUndefined.handleNr3r)r)r)r+r%sc@seZdZdS)rNr7r)r)r)r+r0sc@seZdZdd�ZdS)rcGstSr(r?r/r)r)r+r2GszInvalidContext.handleNr3r)r)r)r+r<sc@seZdZdS)rNr7r)r)r)r+rJsc@seZdZdS)r
Nr7r)r)r)r+r
Vsc@seZdZdd�ZdS)rcGs�|jttttfkrt|S|dkrR|jtkr4t|St|d|j|j	|jd�S|dkr�|jt
krlt|St|d|j|j	|jd�SdS)Nr&�9r.)�roundingrrrrr@rr9�prec�EmaxrrAr)r)r+r2ws"�
�
�zOverflow.handleNr3r)r)r)r+rasc@seZdZdS)rNr7r)r)r)r+r�sc@seZdZdS)rNr7r)r)r)r+r�sZdecimal_contextcCs8z
t��WStk
r2t�}t�|�|YSXdSr()�_current_context_var�get�LookupErrorr�set�r1r)r)r+r�s

cCs,|tttfkr|��}|��t�|�dSr()rrr�copy�clear_flagsrGrJrKr)r)r+r�scCs|dkrt�}t|�Sr()r�_ContextManager)Zctxr)r)r+r�s$c
@s�eZdZdZd�dd�Zedd��Zdd	�Zd
d�Zd�dd
�Z	dd�Z
dd�Zdd�Zd�dd�Z
d�dd�Zd�dd�Zd�dd�Zd�dd�Zd�dd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd�d)d*�Zd�d+d,�Zd�d-d.�Zd�d/d0�Zd�d2d3�Zd�d4d5�ZeZd�d6d7�Z�dd8d9�Z�dd:d;�Z e Z!�dd<d=�Z"d>d?�Z#�dd@dA�Z$�ddBdC�Z%�ddDdE�Z&�ddFdG�Z'�ddHdI�Z(�ddJdK�Z)�d	dLdM�Z*�d
dNdO�Z+dPdQ�Z,dRdS�Z-e-Z.e/dTdU��Z0e/dVdW��Z1dXdY�Z2dZd[�Z3d\d]�Z4d^d_�Z5d`da�Z6dbdc�Z7ddde�Z8dfdg�Z9dhdi�Z:djdk�Z;dldm�Z<dndo�Z=e>e6e7e8e9e:e;e<e=dp�Z?�ddqdr�Z@dsdt�ZAdudv�ZB�ddwdx�ZC�d
dydz�ZDd{d|�ZE�dd}d~�ZF�ddd��ZG�dd�d��ZH�dd�d��ZI�dd�d��ZJd�d��ZKd�d��ZL�dd�d��ZM�dd�d��ZNeNZO�dd�d��ZP�dd�d��ZQ�dd�d��ZRd�d��ZSd�d��ZTd�d��ZUd�d��ZV�dd�d��ZW�dd�d��ZX�dd�d��ZYd�d��ZZd�d��Z[�dd�d��Z\�dd�d��Z]d�d��Z^d�d��Z_d�d��Z`d�d��Za�dd�d��Zbd�d��Zcd�d��Zdd�d��Ze�dd�d��Zfd�d��Zgd�d��Zh�dd�d„Zid�dĄZj�d d�dƄZk�d!d�dȄZld�dʄZmd�d̄Zn�d"d�d΄Zo�d#d�dЄZp�d$d�d҄Zq�d%d�dԄZr�d&d�dքZs�d'd�d؄Zt�d(d�dڄZu�d)d�d܄Zv�d*d�dބZw�d+d�d�Zxd�d�Zy�d,d�d�Zz�d-d�d�Z{�d.d�d�Z|d�d�Z}d�d�Z~d�d�Z�d/d�d�Z�dS(0r)�_expr;r:�_is_special�0NcCs�t�|�}t|t��r$t|���dd��}|dkrP|dkr@t�}|�t	d|�S|�
d�dkrfd|_nd|_|�
d�}|dk	r�|�
d	�p�d}t|�
d
�p�d�}tt||��|_
|t|�|_d|_nZ|�
d
�}|dk	�rtt|p�d���d�|_
|�
d��rd|_nd|_nd|_
d|_d|_|St|t��rf|dk�rBd|_nd|_d|_tt|��|_
d|_|St|t��r�|j|_|j|_|j
|_
|j|_|St|t��r�|j|_t|j�|_
t|j�|_d|_|St|ttf��r"t|�dk�r�td��t|dt��r|ddk�std��|d|_|ddk�rHd|_
|d|_d|_n�g}	|dD]R}
t|
t��r�d|
k�r|dk�r�nn|	�s�|
dk�r�|	�|
�ntd���qT|ddk�r�d�tt|	��|_
|d|_d|_nDt|dt��rd�tt|	�p�dg��|_
|d|_d|_ntd��|St|t��rx|dk�r>t�}|�td�t�|�}|j|_|j|_|j
|_
|j|_|St d|��dS)N�_�zInvalid literal for Decimal: %rrB�-r.r&�intZfrac�exprQF�diag�signal�Nr8�FT�ztInvalid tuple size in creation of Decimal from list or tuple.  The list or tuple should have exactly three elements.�r&r.z|Invalid sign.  The first value in the tuple should be an integer; either 0 for a positive number or 1 for a negative number.��	zTThe second value in the tuple must be composed of integers in the range 0 through 9.�r8rYzUThe third value in the tuple must be an integer, or one of the strings 'F', 'n', 'N'.�;strict semantics for mixing floats and Decimals are enabledzCannot convert %r to Decimal)!�object�__new__�
isinstance�str�_parser�strip�replacer�_raise_errorr�groupr:rUr;�lenrOrP�lstrip�absr�_WorkReprBrV�list�tuple�
ValueError�append�join�map�floatr�
from_float�	TypeError)�cls�valuer1r0�m�intpart�fracpartrVrW�digitsZdigitr)r)r+rb
s�
�





(


�
zDecimal.__new__cCs�t|t�r,|dkrdnd}d}tt|��}nzt|t�r�t�|�sJt�|�rV|t|��St�	d|�dkrld}nd}t|��
�\}}|��d}t|d|�}ntd��t
|||�}|tkr�|S||�SdS)Nr&r.g�?�zargument must be int or float.)rcrUrdrlrt�_mathZisinfZisnan�reprZcopysign�as_integer_ratio�
bit_lengthrvr9r)rw�frB�k�coeffr8�d�resultr)r)r+ru�s$

zDecimal.from_floatcCs(|jr$|j}|dkrdS|dkr$dSdS)Nr8r.rYr]r&)rPrO)r0rVr)r)r+�_isnan�szDecimal._isnancCs|jdkr|jrdSdSdS)NrZ���r.r&)rOr:�r0r)r)r+�_isinfinity�s

zDecimal._isinfinitycCs||��}|dkrd}n|��}|s&|rx|dkr4t�}|dkrJ|�td|�S|dkr`|�td|�S|rn|�|�S|�|�SdS)NFr]�sNaNr&)r�rrhr	r<)r0�otherr1�self_is_nan�other_is_nanr)r)r+�_check_nans�s&
��

zDecimal._check_nanscCsv|dkrt�}|js|jrr|��r0|�td|�S|��rF|�td|�S|��r\|�td|�S|��rr|�td|�SdS)Nzcomparison involving sNaNzcomparison involving NaNr&)rrP�is_snanrhr	�is_qnan�r0r�r1r)r)r+�_compare_check_nans	s0����zDecimal._compare_check_nanscCs|jp|jdkS�NrQ�rPr;r�r)r)r+�__bool__*szDecimal.__bool__cCs|js|jr8|��}|��}||kr(dS||kr4dSdS|sP|sDdSd|jS|s^d|jS|j|jkrndS|j|jkr~dS|��}|��}||kr�|jd|j|j}|jd|j|j}||kr�dS||kr�d|jSd|jSn ||k�rd|jSd|jSdS)Nr&r�r.rQ)rPr�r:�adjustedr;rO)r0r�Zself_infZ	other_inf�
self_adjustedZother_adjusted�self_paddedZother_paddedr)r)r+�_cmp1s>


zDecimal._cmpcCs<t||dd�\}}|tkr|S|�||�r.dS|�|�dkS)NT)�equality_opFr&)�_convert_for_comparison�NotImplementedr�r�r�r)r)r+�__eq__qszDecimal.__eq__cCs<t||�\}}|tkr|S|�||�}|r.dS|�|�dkS�NFr&�r�r�r�r��r0r�r1r>r)r)r+�__lt__yszDecimal.__lt__cCs<t||�\}}|tkr|S|�||�}|r.dS|�|�dkSr�r�r�r)r)r+�__le__�szDecimal.__le__cCs<t||�\}}|tkr|S|�||�}|r.dS|�|�dkSr�r�r�r)r)r+�__gt__�szDecimal.__gt__cCs<t||�\}}|tkr|S|�||�}|r.dS|�|�dkSr�r�r�r)r)r+�__ge__�szDecimal.__ge__cCs>t|dd�}|js|r0|jr0|�||�}|r0|St|�|��S�NT��raiseit)�_convert_otherrPr�rr�r�r)r)r+�compare�szDecimal.comparecCs�|jr4|��rtd��n|��r$tS|jr0tStS|jdkrNtd|jt	�}ntt
|jt	�}t|j�|t	}|dkr||n|}|dkr�dS|S)Nz"Cannot hash a signaling NaN value.r&�
r����)
rPr�rv�is_nan�_PyHASH_NANr:�_PyHASH_INFrO�pow�_PyHASH_MODULUS�
_PyHASH_10INVrUr;)r0Zexp_hashZhash_r>r)r)r+�__hash__�s

zDecimal.__hash__cCst|jttt|j��|j�Sr()rr:rorsrUr;rOr�r)r)r+�as_tuple�szDecimal.as_tuplecCs�|jr |��rtd��ntd��|s(dSt|j�}|jdkrR|d|jd}}nn|j}|dkr�|ddkr�|d}|d8}qZ|j}t||@��d|�}|r�||L}||8}d||>}|j	r�|}||fS)Nz#cannot convert NaN to integer ratioz(cannot convert Infinity to integer ratior\r&r�r.r})
rPr�rp�
OverflowErrorrUr;rO�minr�r:)r0r8r�Zd5Zd2Zshift2r)r)r+r��s,



zDecimal.as_integer_ratiocCsdt|�S)Nz
Decimal('%s'))rdr�r)r)r+�__repr__szDecimal.__repr__Fc	Csbddg|j}|jrL|jdkr&|dS|jdkr>|d|jS|d|jS|jt|j�}|jdkrt|d	krt|}n6|s~d
}n,|jdkr�|d
dd
}n|d
dd
}|dkr�d}d
d||j}nL|t|j�kr�|jd|t|j�}d}n |jd|�}d
|j|d�}||k�r(d}n*|dk�r8t�}ddg|jd||}||||S)NrSrTrZZInfinityr8�NaNr�r&���r.rQr[�.�e�Ez%+d)r:rPrOr;rjr�capitals)	r0�engr1rB�
leftdigits�dotplacerzr{rVr)r)r+�__str__s:




zDecimal.__str__cCs|jd|d�S)NT)r�r1)r��r0r1r)r)r+�
to_eng_string;szDecimal.to_eng_stringcCsR|jr|j|d�}|r|S|dkr(t�}|s@|jtkr@|��}n|��}|�|�S�NrK)rPr�rrDr�copy_abs�copy_negate�_fix�r0r1r>r)r)r+�__neg__Ds
zDecimal.__neg__cCsR|jr|j|d�}|r|S|dkr(t�}|s@|jtkr@|��}nt|�}|�|�Sr�)rPr�rrDrr�rr�r�r)r)r+�__pos__Zs
zDecimal.__pos__TcCsJ|s|��S|jr&|j|d�}|r&|S|jr:|j|d�}n|j|d�}|Sr�)r�rPr�r:r�r�)r0�roundr1r>r)r)r+�__abs__oszDecimal.__abs__c
Csht|�}|tkr|S|dkr"t�}|js.|jr�|�||�}|rB|S|��rr|j|jkrj|��rj|�td�St	|�S|��r�t	|�St
|j|j�}d}|jt
kr�|j|jkr�d}|s�|s�t
|j|j�}|r�d}t|d|�}|�|�}|S|�st||j|jd�}|�||j�}|�|�}|S|�sVt||j|jd�}|�||j�}|�|�}|St|�}t|�}t|||j�\}}t�}	|j|jk�r�|j|jk�r�t|d|�}|�|�}|S|j|jk�r�||}}|jdk�r�d|	_|j|j|_|_nd|	_n&|jdk�rd|	_d\|_|_nd|	_|jdk�r<|j|j|	_n|j|j|	_|j|	_t	|	�}|�|�}|S)Nz
-INF + INFr&r.rQ)r&r&)r�r�rrPr�r�r:rhr	rr�rOrDrr9r��maxrE�_rescalerm�
_normalizerBrUrV)
r0r�r1r>rVZnegativezerorB�op1�op2r�r)r)r+�__add__�s|





zDecimal.__add__cCsHt|�}|tkr|S|js |jr6|j||d�}|r6|S|j|��|d�Sr�)r�r�rPr�r�r�r�r)r)r+�__sub__�szDecimal.__sub__cCs"t|�}|tkr|S|j||d�Sr�)r�r�r�r�r)r)r+�__rsub__�szDecimal.__rsub__cCs@t|�}|tkr|S|dkr"t�}|j|jA}|js:|jr�|�||�}|rN|S|��rn|sf|�td�St	|S|��r�|s�|�td�St	|S|j
|j
}|r�|s�t|d|�}|�|�}|S|j
dkr�t||j
|�}|�|�}|S|j
dk�r
t||j
|�}|�|�}|St|�}t|�}t|t|j|j�|�}|�|�}|S)Nz(+-)INF * 0z0 * (+-)INFrQ�1)r�r�rr:rPr�r�rhr	r@rOr9r�r;rmrdrU)r0r�r1Z
resultsignr>Z	resultexpr�r�r)r)r+�__mul__�sH




zDecimal.__mul__cCs�t|�}|tkrtS|dkr"t�}|j|jA}|js:|jr�|�||�}|rN|S|��rj|��rj|�td�S|��rzt	|S|��r�|�t
d�t|d|���S|s�|s�|�t
d�S|�td|�S|s�|j|j}d}n�t|j�t|j�|jd}|j|j|}t|�}t|�}	|dk�r:t|jd||	j�\}}
nt|j|	jd|�\}}
|
�rt|d	dk�r�|d7}n8|j|j}||k�r�|ddk�r�|d}|d7}�q�t|t|�|�}|�|�S)
Nz(+-)INF/(+-)INFzDivision by infinityrQz0 / 0zx / 0r&r.r�r})r�r�rr:rPr�r�rhr	r@rr9�Etinyrr
rOrjr;rErm�divmodrUrdr�)r0r�r1rBr>rVr��shiftr�r��	remainder�	ideal_expr)r)r+�__truediv__,sP

zDecimal.__truediv__cCs|j|jA}|��r|j}nt|j|j�}|��|��}|rN|��sN|dkrht|dd�|�||j�fS||jk�r
t	|�}t	|�}|j
|j
kr�|jd|j
|j
9_n|jd|j
|j
9_t|j|j�\}}	|d|jk�r
t|t
|�d�t|jt
|	�|�fS|�td�}
|
|
fS)Nr�rQr&r�z%quotient too large in //, % or divmod)r:r�rOr�r�r9r�rDrErmrVrUr�rdrhr)r0r�r1rBr��expdiffr�r��q�rr>r)r)r+�_dividegs0
���zDecimal._dividecCs"t|�}|tkr|S|j||d�Sr�)r�r�r�r�r)r)r+�__rtruediv__�szDecimal.__rtruediv__cCs�t|�}|tkr|S|dkr"t�}|�||�}|r:||fS|j|jA}|��r~|��rj|�td�}||fSt||�td�fS|s�|s�|�t	d�}||fS|�t
d|�|�td�fS|�||�\}}|�|�}||fS)Nzdivmod(INF, INF)�INF % xzdivmod(0, 0)�x // 0�x % 0)
r�r�rr�r:r�rhr	r@rr
r�r�)r0r�r1r>rBZquotientr�r)r)r+�
__divmod__�s4
�
�
zDecimal.__divmod__cCs"t|�}|tkr|S|j||d�Sr�)r�r�r�r�r)r)r+�__rdivmod__�szDecimal.__rdivmod__cCs�t|�}|tkr|S|dkr"t�}|�||�}|r6|S|��rJ|�td�S|sj|r^|�td�S|�td�S|�||�d}|�	|�}|S)Nr�r�z0 % 0r.)
r�r�rr�r�rhr	rr�r�)r0r�r1r>r�r)r)r+�__mod__�s"
zDecimal.__mod__cCs"t|�}|tkr|S|j||d�Sr�)r�r�r�r�r)r)r+�__rmod__�szDecimal.__rmod__cCs�|dkrt�}t|dd�}|�||�}|r.|S|��rB|�td�S|sb|rV|�td�S|�td�S|��r|t|�}|�|�St	|j
|j
�}|s�t|jd|�}|�|�S|�
�|�
�}||jdkr�|�t�S|dkr�|�||j�}|�|�St|�}t|�}|j|jk�r(|jd	|j|j9_n|jd	|j|j9_t|j|j�\}}	d
|	|d@|jk�r~|	|j8}	|d7}|d	|jk�r�|�t�S|j}
|	dk�r�d|
}
|	}	t|
t|	�|�}|�|�S)NTr�zremainder_near(infinity, x)zremainder_near(x, 0)zremainder_near(0, 0)rQr.r�r�r]r&)rr�r�r�rhr	rrr�r�rOr9r:r�rErr�rDrmrVrUr�rd)r0r�r1r>�ideal_exponentr�r�r�r�r�rBr)r)r+�remainder_near�s`���






zDecimal.remainder_nearcCs�t|�}|tkr|S|dkr"t�}|�||�}|r6|S|��rb|��rR|�td�St|j|jAS|s�|r�|�t	d|j|jA�S|�t
d�S|�||�dS)Nz
INF // INFr�z0 // 0r&)r�r�rr�r�rhr	r@r:r
rr�r�r)r)r+�__floordiv__'s&
�zDecimal.__floordiv__cCs"t|�}|tkr|S|j||d�Sr�)r�r�r�r�r)r)r+�
__rfloordiv__CszDecimal.__rfloordiv__cCs8|��r(|��rtd��|jr"dnd}nt|�}t|�S)Nz%Cannot convert signaling NaN to floatz-nan�nan)r�r�rpr:rdrt�r0�sr)r)r+�	__float__JszDecimal.__float__cCst|jr(|��rtd��n|��r(td��d|j}|jdkrT|t|j�d|jS|t|jd|j�pjd�SdS)NzCannot convert NaN to integerz"Cannot convert infinity to integerr�r&r�rQ)	rPr�rpr�r�r:rOrUr;r�r)r)r+�__int__Ts


zDecimal.__int__cCs|Sr(r)r�r)r)r+�realcszDecimal.realcCstd�S�Nr&�rr�r)r)r+�imaggszDecimal.imagcCs|Sr(r)r�r)r)r+�	conjugatekszDecimal.conjugatecCstt|��Sr()�complexrtr�r)r)r+�__complex__nszDecimal.__complex__cCsR|j}|j|j}t|�|krJ|t|�|d��d�}t|j||jd�St|�S)NrQT)	r;rE�clamprjrkr9r:rOr)r0r1ZpayloadZmax_payload_lenr)r)r+r<qszDecimal._fix_nancCsX|jr |��r|�|�St|�S|��}|��}|s�|j|g|j}tt	|j
|�|�}||j
krx|�t�t
|jd|�St|�St|j�|j
|j}||kr�|�td|j�}|�t�|�t�|S||k}|r�|}|j
|k�r�t|j�|j
|}	|	dk�rt
|jd|d�}d}	|j|j}
|
||	�}|jd|	��p>d}|dk�r~tt|�d�}t|�|jk�r~|dd�}|d7}||k�r�|�td|j�}nt
|j||�}|�r�|�r�|�t�|�r�|�t�|�r�|�t�|�t�|�s�|�t�|S|�r|�t�|jdk�rP|j
|k�rP|�t�|jd|j
|}
t
|j|
|�St|�S)NrQ�
above Emaxr&r�r.r�)rPr�r<rr��EtoprFr�r�r�rOrhrr9r:rjr;rErrr�_pick_rounding_functionrDrdrUrr
)r0r1r�r��exp_maxZnew_expZexp_minr>Zself_is_subnormalr|Zrounding_method�changedr�r�r)r)r+r�}sn
















zDecimal._fixcCst|j|�rdSdSdS)Nr&r�)�
_all_zerosr;�r0rEr)r)r+�_round_down�szDecimal._round_downcCs|�|�Sr()rrr)r)r+�	_round_up�szDecimal._round_upcCs*|j|dkrdSt|j|�r"dSdSdS)NZ56789r.r&r�)r;r�rr)r)r+�_round_half_up�s
zDecimal._round_half_upcCst|j|�rdS|�|�SdS)Nr���_exact_halfr;rrr)r)r+�_round_half_down�szDecimal._round_half_downcCs8t|j|�r*|dks&|j|ddkr*dS|�|�SdS)Nr&r.�02468r�rrr)r)r+�_round_half_even�s��zDecimal._round_half_evencCs |jr|�|�S|�|�SdSr(�r:rrr)r)r+�_round_ceilings
zDecimal._round_ceilingcCs |js|�|�S|�|�SdSr(r	rr)r)r+�_round_floor
s
zDecimal._round_floorcCs0|r |j|ddkr |�|�S|�|�SdS)Nr.Z05)r;rrr)r)r+�_round_05ups
zDecimal._round_05up)rrrrrrrrcCsb|dk	r2t|t�std��tdd|�}|�|�S|jrR|��rJtd��ntd��t|�	dt
��S)Nz+Second argument to round should be integralr&r��cannot round a NaN�cannot round an infinity)rcrUrvr9�quantizerPr�rpr�r�r)r0r8rVr)r)r+�	__round__&s/


zDecimal.__round__cCs0|jr |��rtd��ntd��t|�dt��S�Nr
rr&)rPr�rpr�rUr�rr�r)r)r+�	__floor__ds

zDecimal.__floor__cCs0|jr |��rtd��ntd��t|�dt��Sr)rPr�rpr�rUr�rr�r)r)r+�__ceil__ss

zDecimal.__ceil__cCst|dd�}t|dd�}|js$|jr�|dkr2t�}|jdkrJ|�td|�S|jdkrb|�td|�S|jdkrr|}nf|jdkr�|}nV|jdkr�|s�|�td�St|j|jA}n*|jdkr�|s�|�td�St|j|jA}n0t|j|jAt	t
|j�t
|j��|j|j�}|�||�S)	NTr�rYr�r8rZzINF * 0 in fmaz0 * INF in fma)
r�rPrrOrhr	r@r:r9rdrUr;r�)r0r�Zthirdr1�productr)r)r+�fma�s<




�
�
�zDecimal.fmacCs�t|�}|tkr|St|�}|tkr(|S|dkr6t�}|��}|��}|��}|sZ|sZ|r�|dkrp|�td|�S|dkr�|�td|�S|dkr�|�td|�S|r�|�|�S|r�|�|�S|�|�S|��r�|��r�|��s�|�td�S|dkr�|�td�S|�s|�td�S|��|j	k�r(|�td�S|�s@|�s@|�td�S|�
��rPd}n|j}tt
|��}t|���}t|���}	|j
|td	|j|�|}t|	j�D]}
t|d	|�}�q�t||	j
|�}t|t|�d�S)
Nr]r�z@pow() 3rd argument not allowed unless all arguments are integersr&zApow() 2nd argument cannot be negative when 3rd argument specifiedzpow() 3rd argument cannot be 0zSinsufficient precision: pow() 3rd argument must not have more than precision digitszXat least one of pow() 1st argument and 2nd argument must be nonzero; 0**0 is not definedr�)r�r�rr�rhr	r<�
_isintegerr�rE�_isevenr:rlrUrm�to_integral_valuer�rV�ranger9rd)r0r��modulor1r�r�Z
modulo_is_nanrB�base�exponent�ir)r)r+�
_power_modulo�s����


�������
zDecimal._power_modulocCs�t|�}|j|j}}|ddkr4|d}|d7}qt|�}|j|j}}|ddkrh|d}|d7}qJ|dk�r||9}|ddkr�|d}|d7}qz|dkr�dS|d|}	|jdkr�|	}	|��r�|jdkr�|jt|�}
t|	|
|d�}nd}tddd||	|�S|jdk�r�|d}|dk�r�||@|k�rBdSt	|�d}
|dd}|t
t|��k�rpdSt|
||�}
t|||�}|
dk�s�|dk�r�dS|
|k�r�dSd	|
}n�|d	k�r�t	|�d
d}
t
d	|
|�\}}|�r�dS|d	dk�r|d	}|
d8}
�q�|dd}|t
t|��k�r6dSt|
||�}
t|||�}|
dk�sf|dk�rjdS|
|k�rxdSd|
}ndS|d|k�r�dS|
|}tdt|�|�S|dk�r�|d|d}}n�|dk�r�t
tt||���|k�r�dSt	|�}|dk�r,t
tt|�|��|k�r,dS|d|}}|d|dk�r\dk�rtnn|d}|d}�q<|d	|d	k�r�dk�r�nn|d	}|d	}�qt|dk�rX|dk�r�||k�r�dSt
||�\}}|dk�r�dSdt	|�|>}t
|||d�\}}||k�r$�q<n||d||}�q�||k�rP|dk�sTdS|}|dk�r|||d
t|�k�r|dS||}||9}|d|k�r�dSt|�}|���r�|jdk�r�|jt|�}
t||
|t
|��}nd}td|d|||�S)Nr�r&r.r�rQ)r]����]�Ar}�r[r]�d)rmrUrVrBrr:rOr�r9�_nbitsrjrd�_decimal_lshift_exactr�rl�	_log10_lb)r0r��p�x�xc�xe�y�yc�yerr�ZzerosZ
last_digitr�Zemaxr�ryr8Zxc_bits�rem�ar�r�Zstr_xcr)r)r+�_power_exacts�:












&&$$


 zDecimal._power_exactcCs4|dk	r|�|||�St|�}|tkr*|S|dkr8t�}|�||�}|rL|S|sd|s`|�td�StSd}|jdkr�|�	�r�|�
�s�d}n|r�|�td�S|��}|s�|jdkr�t|dd�St
|S|��r�|jdkr�t
|St|dd�S|tk�r�|�	��rZ|jdk�rd}n||jk�r"|j}nt|�}|j|}|d|jk�rxd|j}|�t�n|�t�|�t�d|j}t|dd||�S|��}|���r�|jdk|dkk�r�t|dd�St
|Sd}d}	|��|��}
|dk|jdkk�r|
tt|j��k�rHt|d|jd�}n,|��}|
tt|��k�rHt|d|d�}|dk�r�|�||jd�}|dk	�r�|dk�r�td|j|j�}d}	|dk�r8|j}t|�}
|
j|
j}}t|�}|j|j}}|jdk�r�|}d	}t||||||�\}}|d
dtt|��|d�r�q(|d	7}�q�t|t|�|�}|	�r&|�	��s&t|j�|jk�r�|jdt|j�}t|j|jd||j|�}|� �}|�!�t"D]}d|j#|<�q�|�$|�}|�t�|j%t&�r�|�t'�|j%t(�r�|�t(d|j�t't&ttt)fD]}|j%|�r|�|��qn
|�$|�}|S)
Nz0 ** 0r&r.z+x ** y with x negative and y not an integerrQr�FTr[r}r�r�)*rr�r�rr�rhr	�_Oner:rrr�r9r@r�rErUrOrrr��_log10_exp_boundrjrdrFr�r2r;rmrVrB�_dpowerrLrM�_signals�trapsr��flagsr
rrr)r0r�rr1r>Zresult_signZ
multiplierrVZself_adj�exactZboundr�r)r*r+r,r-r.r/�extrar�r�Z
newcontextZ	exceptionr)r)r+�__pow__�s�
�













"�



zDecimal.__pow__cCs"t|�}|tkr|S|j||d�Sr�)r�r�r;r�r)r)r+�__rpow__�	szDecimal.__rpow__cCs�|dkrt�}|jr(|j|d�}|r(|S|�|�}|��r>|S|sPt|jdd�S|j|��g|j	}t
|j�}|j}|j|ddkr�||kr�|d7}|d8}qtt|j|jd|�|�S)NrKrQr&r.)
rrPr�r�r�r9r:rFr�r�rjr;rO)r0r1r>�dupr��endrVr)r)r+�	normalize�	s$


zDecimal.normalizecCs�t|dd�}|dkrt�}|dkr(|j}|js4|jr||�||�}|rH|S|��sX|��r||��rp|��rpt|�S|�td�S|�	�|j
kr�|jks�n|�td�S|s�t|j
d|j
�}|�|�S|��}||jkr�|�td�S||j
d|jk�r|�td�S|�|j
|�}|��|jk�r.|�td�St|j�|jk�rL|�td�S|�rl|��|jk�rl|�t�|j
|j
k�r�||k�r�|�t�|�t�|�|�}|S)	NTr�zquantize with one INFz)target exponent out of bounds in quantizerQz9exponent of quantize result too large for current contextr.z7quantize result has too many digits for current context)r�rrDrPr�r�rrhr	r�rOrFr9r:r�r�rEr�rjr;�Eminr
rr)r0rVrDr1r>r�r)r)r+r�	s`��

����




zDecimal.quantizecCsDt|dd�}|js|jr8|��r(|��p6|��o6|��S|j|jkSr�)r�rPr��is_infiniterOr�r)r)r+�same_quantum%
s	�zDecimal.same_quantumcCs�|jrt|�S|s t|jd|�S|j|krHt|j|jd|j||�St|j�|j|}|dkrzt|jd|d�}d}|j|}|||�}|jd|�p�d}|dkr�tt	|�d�}t|j||�S)NrQr&r�r.)
rPrr9r:rOr;rjr�rdrU)r0rVrDr|Z
this_functionr�r�r)r)r+r�4
s&
�

zDecimal._rescalecCsf|dkrtd��|js|s"t|�S|�|��d||�}|��|��krb|�|��d||�}|S)Nr&z'argument should be at least 1 in _roundr.)rprPrr�r�)r0�placesrDr>r)r)r+�_roundV
s

zDecimal._roundcCs�|jr"|j|d�}|r|St|�S|jdkr4t|�S|sFt|jdd�S|dkrTt�}|dkrb|j}|�d|�}||kr�|�	t
�|�	t�|S)NrKr&rQ)rPr�rrOr9r:rrDr�rhrr�r0rDr1r>r)r)r+�to_integral_exactm
s$



zDecimal.to_integral_exactcCs`|dkrt�}|dkr|j}|jr>|j|d�}|r6|St|�S|jdkrPt|�S|�d|�SdS)NrKr&)rrDrPr�rrOr�rEr)r)r+r�
s
zDecimal.to_integral_valuecCs�|dkrt�}|jrB|j|d�}|r(|S|��rB|jdkrBt|�S|sdt|jd|jd�}|�|�S|jdkrz|�	t
d�S|jd}t|�}|j
d?}|j
d@r�|jd}t|j�d?d}n|j}t|j�dd?}||}|dkr�|d|9}d	}	nt|d|�\}}
|
}	||8}d|}||}||k�r:�qJn||d?}�q"|	�oZ|||k}	|	�r�|dk�rz|d|}n|d|9}||7}n|d
dk�r�|d7}tdt|�|�}|��}|�t�}
|�|�}|
|_|S)NrKr&rQr]r.zsqrt(-x), x > 0r�r%Tr})rrPr�r�r:rr9rOr�rhr	rErmrVrUrjr;r�rd�
_shallow_copy�
_set_roundingrrD)r0r1r>rE�opr��c�lr�r9r�r8r�rDr)r)r+�sqrt�
s^










zDecimal.sqrtcCs�t|dd�}|dkrt�}|js&|jr~|��}|��}|s>|r~|dkrX|dkrX|�|�S|dkrr|dkrr|�|�S|�||�S|�|�}|dkr�|�|�}|dkr�|}n|}|�|�S�NTr�r.r&r��r�rrPr�r�r�r��
compare_total�r0r�r1ZsnZonrJr>r)r)r+r�s&


	
zDecimal.maxcCs�t|dd�}|dkrt�}|js&|jr~|��}|��}|s>|r~|dkrX|dkrX|�|�S|dkrr|dkrr|�|�S|�||�S|�|�}|dkr�|�|�}|dkr�|}n|}|�|�SrMrNrPr)r)r+r�*s&



zDecimal.mincCs8|jr
dS|jdkrdS|j|jd�}|dt|�kS)NFr&TrQ)rPrOr;rj)r0�restr)r)r+rLs
zDecimal._isintegercCs&|r|jdkrdS|jd|jdkS)Nr&Tr�r)rOr;r�r)r)r+rUszDecimal._isevencCs2z|jt|j�dWStk
r,YdSXdS)Nr.r&)rOrjr;rvr�r)r)r+r�[szDecimal.adjustedcCs|Sr(r)r�r)r)r+�	canonicalcszDecimal.canonicalcCs.t|dd�}|�||�}|r |S|j||d�S�NTr�rK)r�r�r�r�r)r)r+�compare_signalks
zDecimal.compare_signalcCs`t|dd�}|jr|jstS|js,|jr,tS|j}|��}|��}|sL|�r||kr�t|j�|jf}t|j�|jf}||kr�|r�tStS||kr�|r�tStStS|r�|dkr�tS|dkr�tS|dkr�tS|dkr�tSn2|dkr�tS|dkr�tS|dkr�tS|dk�rtS||k�rtS||k�r$tS|j|jk�r@|�r<tStS|j|jk�r\|�rXtStStS)NTr�r.r])	r�r:�_NegativeOner3r�rjr;�_ZerorO)r0r�r1rBZself_nanZ	other_nanZself_keyZ	other_keyr)r)r+rOwsf



zDecimal.compare_totalcCs&t|dd�}|��}|��}|�|�Sr�)r�r�rO)r0r�r1r��or)r)r+�compare_total_mag�szDecimal.compare_total_magcCstd|j|j|j�Sr�)r9r;rOrPr�r)r)r+r��szDecimal.copy_abscCs2|jrtd|j|j|j�Std|j|j|j�SdS)Nr&r.)r:r9r;rOrPr�r)r)r+r��szDecimal.copy_negatecCs"t|dd�}t|j|j|j|j�Sr�)r�r9r:r;rOrPr�r)r)r+�	copy_sign�s

�zDecimal.copy_signcCs�|dkrt�}|j|d�}|r"|S|��dkr2tS|s:tS|��dkrNt|�S|j}|��}|jdkr�|t	t
|jdd��kr�tdd|jd�}�n0|jdkr�|t	t
|�
�dd��kr�tdd|�
�d�}n�|jdk�r||k�rtddd|dd|�}n�|jdk�rD||dk�rDtdd|d|d�}n�t|�}|j|j}}|jdk�rl|}d}t||||�\}	}
|	d	d
t	t
|	��|d�r��q�|d7}�qptdt
|	�|
�}|��}|�t�}|�|�}||_|S)NrKr�r.r&r[r�rQrCr}r�)rr�r�rVr3rrEr�r:rjrdrFr9r�rmrUrVrB�_dexprGrHrr�rD)r0r1r>r)�adjrIrJr�r:r�rVrDr)r)r+rV�sH$( "

zDecimal.expcCsdS)NTr)r�r)r)r+�is_canonical'szDecimal.is_canonicalcCs|jSr()rPr�r)r)r+�	is_finite/szDecimal.is_finitecCs
|jdkS)NrZ�rOr�r)r)r+rA7szDecimal.is_infinitecCs
|jdkS)Nr_r^r�r)r)r+r�;szDecimal.is_nancCs*|js
|sdS|dkrt�}|j|��kS�NF)rPrr@r�r�r)r)r+�	is_normal?s

zDecimal.is_normalcCs
|jdkS)Nr8r^r�r)r)r+r�GszDecimal.is_qnancCs
|jdkS�Nr.)r:r�r)r)r+�	is_signedKszDecimal.is_signedcCs
|jdkS)NrYr^r�r)r)r+r�OszDecimal.is_snancCs*|js
|sdS|dkrt�}|��|jkSr_)rPrr�r@r�r)r)r+�is_subnormalSs

zDecimal.is_subnormalcCs|jo|jdkSr�r�r�r)r)r+�is_zero[szDecimal.is_zerocCs�|jt|j�d}|dkr4tt|dd��dS|dkrXttd|dd��dSt|�}|j|j}}|dkr�t|d|�}t|�}t|�t|�||kS|ttd||��dS)Nr.�r�r�r�r&�rOrjr;rdrmrUrV�r0r[rIrJr��numZdenr)r)r+�
_ln_exp_bound_szDecimal._ln_exp_boundc
Cs|dkrt�}|j|d�}|r"|S|s*tS|��dkr:tS|tkrFtS|jdkr\|�t	d�St
|�}|j|j}}|j
}||��d}t|||�}|ddttt|���|dr�q�|d7}q�tt|dk�tt|��|�}|��}|�t�}	|�|�}|	|_|S)	NrKr.zln of a negative valuer]r}r�r[r&)rr��_NegativeInfinityr��	_Infinityr3rVr:rhr	rmrUrVrEri�_dlogrjrdrlr9rGrHrr�rD�
r0r1r>rIrJr�r)rCr�rDr)r)r+�lnxs:
�$


z
Decimal.lncCs�|jt|j�d}|dkr,tt|��dS|dkrHttd|��dSt|�}|j|j}}|dkr�t|d|�}td|�}t|�t|�||kdStd||�}t|�||dkdS)	Nr.r�r�r&r���r]Z231rfrgr)r)r+r4�szDecimal._log10_exp_boundc
CsF|dkrt�}|j|d�}|r"|S|s*tS|��dkr:tS|jdkrP|�td�S|jddkr�|jdd�dt	|j�dkr�t
|jt	|j�d�}n�t|�}|j
|j}}|j}||��d}t|||�}|dd	t	tt|���|dr��q|d
7}q�tt
|dk�tt|��|�}|��}|�t�}	|�|�}|	|_|S)NrKr.zlog10 of a negative valuer&r�rQr]r}r�r[)rr�rjr�rkr:rhr	r;rjrrOrmrUrVrEr4�_dlog10rdrlr9rGrHrr�rDrmr)r)r+�log10�s:
�.$


z
Decimal.log10cCsV|j|d�}|r|S|dkr"t�}|��r.tS|s@|�tdd�St|���}|�|�S)NrKzlogb(0)r.)	r�rr�rkrhr
rr�r�r�r)r)r+�logb�s	zDecimal.logbcCs6|jdks|jdkrdS|jD]}|dkrdSqdS)Nr&FZ01T)r:rOr;)r0�digr)r)r+�
_islogical
s
zDecimal._islogicalcCs�|jt|�}|dkr$d||}n|dkr<||jd�}|jt|�}|dkr`d||}n|dkrx||jd�}||fS)Nr&rQ)rErj)r0r1�opa�opbZdifr)r)r+�
_fill_logical'
szDecimal._fill_logicalcCsz|dkrt�}t|dd�}|��r*|��s4|�t�S|�||j|j�\}}d�dd�t||�D��}t	d|�
d�ptdd�S)NTr�rScSs$g|]\}}tt|�t|�@��qSr)�rdrU��.0r1�br)r)r+�
<listcomp>B
sz'Decimal.logical_and.<locals>.<listcomp>r&rQ�rr�rtrhr	rwr;rr�zipr9rk�r0r�r1rurvr�r)r)r+�logical_and4
s
zDecimal.logical_andcCs(|dkrt�}|�tdd|jd�|�S)Nr&r�)r�logical_xorr9rEr�r)r)r+�logical_invertE
s
�zDecimal.logical_invertcCsz|dkrt�}t|dd�}|��r*|��s4|�t�S|�||j|j�\}}d�dd�t||�D��}t	d|�
d�ptdd�S)NTr�rScSs$g|]\}}tt|�t|�B��qSr)rxryr)r)r+r|Z
sz&Decimal.logical_or.<locals>.<listcomp>r&rQr}rr)r)r+�
logical_orL
s
zDecimal.logical_orcCsz|dkrt�}t|dd�}|��r*|��s4|�t�S|�||j|j�\}}d�dd�t||�D��}t	d|�
d�ptdd�S)NTr�rScSs$g|]\}}tt|�t|�A��qSr)rxryr)r)r+r|k
sz'Decimal.logical_xor.<locals>.<listcomp>r&rQr}rr)r)r+r�]
s
zDecimal.logical_xorcCs�t|dd�}|dkrt�}|js&|jr~|��}|��}|s>|r~|dkrX|dkrX|�|�S|dkrr|dkrr|�|�S|�||�S|���|���}|dkr�|�|�}|dkr�|}n|}|�|�SrM�	r�rrPr�r�r�r�r�rOrPr)r)r+�max_magn
s&


zDecimal.max_magcCs�t|dd�}|dkrt�}|js&|jr~|��}|��}|s>|r~|dkrX|dkrX|�|�S|dkrr|dkrr|�|�S|�||�S|���|���}|dkr�|�|�}|dkr�|}n|}|�|�SrMr�rPr)r)r+�min_mag�
s&


zDecimal.min_magcCs�|dkrt�}|j|d�}|r"|S|��dkr2tS|��dkrTtdd|j|���S|��}|�t	�|�
�|�|�}||kr�|S|�tdd|�
�d�|�S)NrKr�r.r&rCr�)rr�r�rjr9rEr�rLrHr�_ignore_all_flagsr�r�r��r0r1r>Znew_selfr)r)r+�
next_minus�
s$

�zDecimal.next_minuscCs�|dkrt�}|j|d�}|r"|S|��dkr2tS|��dkrTtdd|j|���S|��}|�t	�|�
�|�|�}||kr�|S|�tdd|�
�d�|�S)NrKr.r�rCr&r�)rr�r�rkr9rEr�rLrHrr�r�r�r�r�r)r)r+�	next_plus�
s$

�zDecimal.next_pluscCs�t|dd�}|dkrt�}|�||�}|r.|S|�|�}|dkrJ|�|�S|dkr^|�|�}n
|�|�}|��r�|�t	d|j
�|�t�|�t�nD|�
�|jkr�|�t�|�t�|�t�|�t�|s�|�t�|S)NTr�r&r�z Infinite result from next_toward)r�rr�r�rYr�r�r�rhrr:rrr�r@rr
r)r0r�r1r>Z
comparisonr)r)r+�next_toward�
s6	


�





zDecimal.next_towardcCs�|��rdS|��rdS|��}|dkr,dS|dkr8dS|��rN|jrJdSdS|dkr\t�}|j|d	�rv|jrrd
SdS|jr�dSd
SdS)Nr�r�r.z	+Infinityr�z	-Infinityz-Zeroz+ZerorKz
-Subnormalz
+Subnormalz-Normalz+Normal)r�r�r�rdr:rrc)r0r1�infr)r)r+�number_classs,zDecimal.number_classcCstd�S�Nr�r�r�r)r)r+�radix0sz
Decimal.radixcCs�|dkrt�}t|dd�}|�||�}|r.|S|jdkrB|�t�S|jt|�kr`|jksln|�t�S|��r|t	|�St|�}|j
}|jt|�}|dkr�d||}n|dkr�||d�}||d�|d|�}t|j
|�d�p�d|j�S�NTr�r&rQ�rr�r�rOrhr	rErUr�rr;rjr9r:rk)r0r�r1r>�torot�rotdig�topadZrotatedr)r)r+�rotate4s0

 
�zDecimal.rotatecCs�|dkrt�}t|dd�}|�||�}|r.|S|jdkrB|�t�Sd|j|j}d|j|j}|t|�krz|ks�n|�t�S|�	�r�t
|�St|j|j
|jt|��}|�|�}|S)NTr�r&r�r])rr�r�rOrhr	rFrErUr�rr9r:r;r�)r0r�r1r>ZliminfZlimsupr�r)r)r+�scalebUs"



zDecimal.scalebcCs|dkrt�}t|dd�}|�||�}|r.|S|jdkrB|�t�S|jt|�kr`|jksln|�t�S|��r|t	|�St|�}|j
}|jt|�}|dkr�d||}n|dkr�||d�}|dkr�|d|�}n|d|}||jd�}t|j
|�d��p
d|j�Sr�r�)r0r�r1r>r�r�r�Zshiftedr)r)r+r�ns6

 
�z
Decimal.shiftcCs|jt|�ffSr()�	__class__rdr�r)r)r+�
__reduce__�szDecimal.__reduce__cCst|�tkr|S|�t|��Sr(��typerr�rdr�r)r)r+�__copy__�szDecimal.__copy__cCst|�tkr|S|�t|��Sr(r�)r0Zmemor)r)r+�__deepcopy__�szDecimal.__deepcopy__cCsJ|dkrt�}t||d�}|jrXt|j|�}t|���}|ddkrL|d7}t|||�S|ddkrvddg|j|d<|ddkr�t	|j|j
|jd�}|j}|d}|dk	�r|ddkr�|�
|d	|�}nF|dd
kr�|�||�}n*|ddk�rt|j
�|k�r|�
||�}|�s@|jdk�r@|dd
k�r@|�d|�}|jt|j
�}	|ddk�r~|�sx|dk	�rxd	|}
nd	}
nB|dd
k�r�|	}
n.|ddk�r�|jdk�r�|	d
k�r�|	}
nd	}
|
dk�r�d}d|
|j
}nP|
t|j
�k�r|j
d|
t|j
�}d}n"|j
d|
��p d}|j
|
d�}|	|
}
t|j|||
|�S)N)�_localeconvr��%�g�Gr]�	precision�eEr.zfF%ZgGr&r�rQrS)r�_parse_format_specifierrP�_format_signr:rdr��
_format_alignr�r9r;rOrDrDr�rj�_format_number)r0Z	specifierr1r��specrB�bodyrDr�r�r�rzr{rVr)r)r+�
__format__�sZ
 

zDecimal.__format__)rQN)NN)N)N)N)N)N)N)FN)N)N)N)TN)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)NN)N)N)NN)N)NN)NN)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)N)NN)�r4r5r6�	__slots__rb�classmethodrur�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r��__radd__r�r�r��__rmul__r�r�r�r�r�r�r�r�r�r�r�r��	__trunc__�propertyr�r�r�r�r<r�rrrrrr
rr�dictr�rrrrrr2r;r<r?rrBr�rDrFr�to_integralrLr�r�rrr�rRrTrOrXr�r�rYrVr\r]rAr�r`r�rbr�rcrdrirnr4rqrrrtrwr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r)r)r)r+rs

,
 !@

	
	
	
	
2
4
	



V
7;!$K



f	�>,UnY="c*"	IK23
.*!'FcCs&t�t�}||_||_||_||_|Sr()rarbrr:r;rOrP)rBZcoefficientrZspecialr0r)r)r+r9�s
r9c@s$eZdZdd�Zdd�Zdd�ZdS)rNcCs|��|_dSr()rL�new_context)r0r�r)r)r+�__init__sz_ContextManager.__init__cCst�|_t|j�|jSr()r�
saved_contextrr�r�r)r)r+�	__enter__s
z_ContextManager.__enter__cCst|j�dSr()rr�)r0�t�v�tbr)r)r+�__exit__sz_ContextManager.__exit__N)r4r5r6r�r�r�r)r)r)r+rNsrNc	@s�eZdZd�dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
e
Zd�dd�Zdd�Zdd�Zdd�ZdZd d!�Zd"d#�Zd$d%�Zd�d'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Z d;d<�Z!d=d>�Z"d?d@�Z#dAdB�Z$dCdD�Z%dEdF�Z&dGdH�Z'dIdJ�Z(dKdL�Z)dMdN�Z*dOdP�Z+dQdR�Z,dSdT�Z-dUdV�Z.dWdX�Z/dYdZ�Z0d[d\�Z1d]d^�Z2d_d`�Z3dadb�Z4dcdd�Z5dedf�Z6dgdh�Z7didj�Z8dkdl�Z9dmdn�Z:dodp�Z;dqdr�Z<dsdt�Z=dudv�Z>dwdx�Z?dydz�Z@d{d|�ZAd}d~�ZBdd��ZCd�d��ZDd�d��ZEd�d��ZFd�d�d��ZGd�d��ZHd�d��ZId�d��ZJd�d��ZKd�d��ZLd�d��ZMd�d��ZNd�d��ZOd�d��ZPd�d��ZQd�d��ZRd�d��ZSd�d��ZTd�d��ZUeUZVdS)�rNc
s>zt}
Wntk
rYnX|dk	r*|n|
j|_|dk	r>|n|
j|_|dk	rR|n|
j|_|dk	rf|n|
j|_|dk	rz|n|
j|_|dk	r�|n|
j|_|	dkr�g|_n|	|_�dkr�|
j	�
�|_	n.t�t�s�t�fdd�t
�D��|_	n�|_	�dk�r
t�t
d�|_n0t�t��s4t�fdd�t
�D��|_n�|_dS)Nc3s|]}|t|�k�fVqdSr(�rU�rzr��r7r)r+�	<genexpr>Isz#Context.__init__.<locals>.<genexpr>r&c3s|]}|t|�k�fVqdSr(r�r��r8r)r+r�Ps)r�	NameErrorrErDr@rFr�r��_ignored_flagsr7rLrcr�r6�fromkeysr8)r0rErDr@rFr�r�r8r7r�Zdcr))r8r7r+r�0s.

zContext.__init__cCs�t|t�std|��|dkr<||kr�td||||f��nJ|dkrb||kr�td||||f��n$||ksr||kr�td||||f��t�|||�S)Nz%s must be an integer�-infz%s must be in [%s, %d]. got: %sr�z%s must be in [%d, %s]. got: %sz%s must be in [%d, %d]. got %s)rcrUrvrpra�__setattr__)r0�namerxZvminZvmaxr)r)r+�_set_integer_checkTs
zContext._set_integer_checkcCs`t|t�std|��|D]}|tkrtd|��qtD]}||kr8td|��q8t�|||�S)Nz%s must be a signal dictz%s is not a valid signal dict)rcr�rvr6�KeyErrorrar�)r0r�r��keyr)r)r+�_set_signal_dictbs
zContext._set_signal_dictcCs�|dkr|�||dd�S|dkr0|�||dd�S|dkrH|�||dd�S|dkr`|�||dd�S|d	krx|�||dd�S|d
kr�|tkr�td|��t�|||�S|dks�|d
kr�|�||�S|dkr�t�|||�Std|��dS)NrEr.r�r@r�r&rFr�r�rDz%s: invalid rounding moder8r7r�z.'decimal.Context' object has no attribute '%s')r��_rounding_modesrvrar�r��AttributeError)r0r�rxr)r)r+r�ms*�zContext.__setattr__cCstd|��dS)Nz%s cannot be deleted)r�)r0r�r)r)r+�__delattr__�szContext.__delattr__c	CsNdd�|j��D�}dd�|j��D�}|j|j|j|j|j|j|j	||ffS)NcSsg|]\}}|r|�qSr)r)�rzZsigr�r)r)r+r|�sz&Context.__reduce__.<locals>.<listcomp>cSsg|]\}}|r|�qSr)r)r�r)r)r+r|�s)
r8�itemsr7r�rErDr@rFr�r�)r0r8r7r)r)r+r��s��zContext.__reduce__cCs|g}|�dt|��dd�|j��D�}|�dd�|�d�dd�|j��D�}|�dd�|�d�d�|�d	S)
NzrContext(prec=%(prec)d, rounding=%(rounding)s, Emin=%(Emin)d, Emax=%(Emax)d, capitals=%(capitals)d, clamp=%(clamp)dcSsg|]\}}|r|j�qSr)�r4)rzr�r�r)r)r+r|�sz$Context.__repr__.<locals>.<listcomp>zflags=[z, �]cSsg|]\}}|r|j�qSr)r�)rzr�r�r)r)r+r|�sztraps=[�))rq�varsr8r�rrr7)r0r��namesr)r)r+r��s�zContext.__repr__cCs|jD]}d|j|<qdSr�r��r0�flagr)r)r+rM�s
zContext.clear_flagscCs|jD]}d|j|<qdSr�r�r�r)r)r+�clear_traps�s
zContext.clear_trapsc
Cs.t|j|j|j|j|j|j|j|j|j	�	}|Sr()
rrErDr@rFr�r�r8r7r��r0Zncr)r)r+rG�s�zContext._shallow_copyc
Cs6t|j|j|j|j|j|j|j��|j	��|j
�	}|Sr()rrErDr@rFr�r�r8rLr7r�r�r)r)r+rL�s�zContext.copycGsZt�||�}||jkr(|�j|f|��Sd|j|<|j|sN|�j|f|��S||��dSra)�_condition_maprHr�r2r8r7)r0Z	conditionZexplanationr*�errorr)r)r+rh�s


zContext._raise_errorcCs
|jt�Sr()�
_ignore_flagsr6r�r)r)r+r��szContext._ignore_all_flagscGs|jt|�|_t|�Sr()r�rn)r0r8r)r)r+r��szContext._ignore_flagscGs8|rt|dttf�r|d}|D]}|j�|�q"dSr�)rcrornr��remove)r0r8r�r)r)r+�
_regard_flags�szContext._regard_flagscCst|j|jd�Sra)rUr@rEr�r)r)r+r��sz
Context.EtinycCst|j|jd�Sra)rUrFrEr�r)r)r+r��szContext.EtopcCs|j}||_|Sr()rD)r0r�rDr)r)r+rH�szContext._set_roundingrQcCsjt|t�r*||��ksd|kr*|�td�St||d�}|��r`t|j�|j	|j
kr`|�td�S|�|�S)NrRzAtrailing or leading whitespace and underscores are not permitted.rKzdiagnostic info too long in NaN)rcrdrfrhrrr�rjr;rEr�r�)r0rhr�r)r)r+�create_decimal�s��zContext.create_decimalcCst�|�}|�|�Sr()rrur�)r0r�r�r)r)r+�create_decimal_from_floats
z!Context.create_decimal_from_floatcCst|dd�}|j|d�SrS)r�r��r0r1r)r)r+rl!szContext.abscCs8t|dd�}|j||d�}|tkr0td|��n|SdS�NTr�rK�Unable to convert %s to Decimal)r�r�r�rv�r0r1r{r�r)r)r+�add6s
zContext.addcCst|�|��Sr()rdr�r�r)r)r+�_applyKszContext._applycCst|t�std��|��S)Nz,canonical requires a Decimal as an argument.)rcrrvrRr�r)r)r+rRNs	
zContext.canonicalcCst|dd�}|j||d�SrS)r�r��r0r1r{r)r)r+r�[s!zContext.comparecCst|dd�}|j||d�SrS)r�rTr�r)r)r+rTs zContext.compare_signalcCst|dd�}|�|�Sr�)r�rOr�r)r)r+rO�szContext.compare_totalcCst|dd�}|�|�Sr�)r�rXr�r)r)r+rX�szContext.compare_total_magcCst|dd�}|��Sr�)r�r�r�r)r)r+r��s
zContext.copy_abscCst|dd�}t|�Sr�)r�rr�r)r)r+�copy_decimal�s
zContext.copy_decimalcCst|dd�}|��Sr�)r�r�r�r)r)r+r��s
zContext.copy_negatecCst|dd�}|�|�Sr�)r�rYr�r)r)r+rY�szContext.copy_signcCs8t|dd�}|j||d�}|tkr0td|��n|SdSr�)r�r�r�rvr�r)r)r+�divides
zContext.dividecCs8t|dd�}|j||d�}|tkr0td|��n|SdSr�)r�r�r�rvr�r)r)r+�
divide_int+s
zContext.divide_intcCs8t|dd�}|j||d�}|tkr0td|��n|SdSr�)r�r�r�rvr�r)r)r+r�Bs
zContext.divmodcCst|dd�}|j|d�SrS)r�rVr�r)r)r+rVWszContext.expcCst|dd�}|j|||d�SrS)r�r)r0r1r{rJr)r)r+roszContext.fmacCst|t�std��|��S)Nz/is_canonical requires a Decimal as an argument.)rcrrvr\r�r)r)r+r\�s	
zContext.is_canonicalcCst|dd�}|��Sr�)r�r]r�r)r)r+r]�szContext.is_finitecCst|dd�}|��Sr�)r�rAr�r)r)r+rA�szContext.is_infinitecCst|dd�}|��Sr�)r�r�r�r)r)r+r��s
zContext.is_nancCst|dd�}|j|d�SrS)r�r`r�r)r)r+r`�szContext.is_normalcCst|dd�}|��Sr�)r�r�r�r)r)r+r��szContext.is_qnancCst|dd�}|��Sr�)r�rbr�r)r)r+rb�szContext.is_signedcCst|dd�}|��Sr�)r�r�r�r)r)r+r��s
zContext.is_snancCst|dd�}|j|d�SrS)r�rcr�r)r)r+rcszContext.is_subnormalcCst|dd�}|��Sr�)r�rdr�r)r)r+rd%szContext.is_zerocCst|dd�}|j|d�SrS)r�rnr�r)r)r+rn6sz
Context.lncCst|dd�}|j|d�SrS)r�rqr�r)r)r+rqLsz
Context.log10cCst|dd�}|j|d�SrS)r�rrr�r)r)r+rrhszContext.logbcCst|dd�}|j||d�SrS)r�r�r�r)r)r+r��szContext.logical_andcCst|dd�}|j|d�SrS)r�r�r�r)r)r+r��szContext.logical_invertcCst|dd�}|j||d�SrS)r�r�r�r)r)r+r��szContext.logical_orcCst|dd�}|j||d�SrS)r�r�r�r)r)r+r��szContext.logical_xorcCst|dd�}|j||d�SrS)r�r�r�r)r)r+r��szContext.maxcCst|dd�}|j||d�SrS)r�r�r�r)r)r+r�szContext.max_magcCst|dd�}|j||d�SrS)r�r�r�r)r)r+r�szContext.mincCst|dd�}|j||d�SrS)r�r�r�r)r)r+r�-szContext.min_magcCst|dd�}|j|d�SrS)r�r�r�r)r)r+�minus>sz
Context.minuscCs8t|dd�}|j||d�}|tkr0td|��n|SdSr�)r�r�r�rvr�r)r)r+�multiplyOs
zContext.multiplycCst|dd�}|j|d�SrS)r�r�r�r)r)r+r�oszContext.next_minuscCst|dd�}|j|d�SrS)r�r�r�r)r)r+r��szContext.next_pluscCst|dd�}|j||d�SrS)r�r�r�r)r)r+r��s zContext.next_towardcCst|dd�}|j|d�SrS)r�r?r�r)r)r+r?�szContext.normalizecCst|dd�}|j|d�SrS)r�r�r�r)r)r+r��s/zContext.number_classcCst|dd�}|j|d�SrS)r�r�r�r)r)r+�plusszContext.pluscCs:t|dd�}|j|||d�}|tkr2td|��n|SdSr�)r�r;r�rv)r0r1r{rr�r)r)r+�powers
Iz
Context.powercCst|dd�}|j||d�SrS)r�rr�r)r)r+res7zContext.quantizecCstd�Sr�r�r�r)r)r+r��sz
Context.radixcCs8t|dd�}|j||d�}|tkr0td|��n|SdSr�)r�r�r�rvr�r)r)r+r��s
zContext.remaindercCst|dd�}|j||d�SrS)r�r�r�r)r)r+r��szContext.remainder_nearcCst|dd�}|j||d�SrS)r�r�r�r)r)r+r��szContext.rotatecCst|dd�}|�|�Sr�)r�rBr�r)r)r+rBszContext.same_quantumcCst|dd�}|j||d�SrS)r�r�r�r)r)r+r�$szContext.scalebcCst|dd�}|j||d�SrS)r�r�r�r)r)r+r�7sz
Context.shiftcCst|dd�}|j|d�SrS)r�rLr�r)r)r+rLUszContext.sqrtcCs8t|dd�}|j||d�}|tkr0td|��n|SdSr�)r�r�r�rvr�r)r)r+�subtractus
zContext.subtractcCst|dd�}|j|d�SrS)r�r�r�r)r)r+r��szContext.to_eng_stringcCst|dd�}|j|d�SrS)r�r�r�r)r)r+�
to_sci_string�szContext.to_sci_stringcCst|dd�}|j|d�SrS)r�rFr�r)r)r+rF�szContext.to_integral_exactcCst|dd�}|j|d�SrS)r�rr�r)r)r+r�szContext.to_integral_value)	NNNNNNNNN)N)rQ)N)Wr4r5r6r�r�r�r�r�r�r�rMr�rGrLr�rhr�r�r�r�r�r�rHr�r�rlr�r�rRr�rTrOrXr�r�r�rYr�r�r�rVrr\r]rAr�r`r�rbr�rcrdrnrqrrr�r�r�r�r�r�r�r�r�r�r�r�r�r?r�r�r�rr�r�r�r�rBr�r�rLr�r�r�rFrr�r)r)r)r+rs��
$



$#


%
 #2
P:&" c@s"eZdZdZddd�Zdd�ZdS)rm�rBrUrVNcCsf|dkrd|_d|_d|_nFt|t�rD|j|_t|j�|_|j|_n|d|_|d|_|d|_dS)Nr&r.r])rBrUrVrcrr:r;rO)r0rxr)r)r+r��s



z_WorkRep.__init__cCsd|j|j|jfS)Nz(%r, %r, %r)r�r�r)r)r+r�sz_WorkRep.__repr__)N)r4r5r6r�r�r�r)r)r)r+rm�s
rmcCs�|j|jkr|}|}n|}|}tt|j��}tt|j��}|jtd||d�}||jd|krpd|_||_|jd|j|j9_|j|_||fS)Nr�r]r.r�)rVrjrdrUr�)r�r�rEZtmpr�Ztmp_lenZ	other_lenrVr)r)r+r�sr�cCsb|dkrdS|dkr |d|Stt|��}t|�t|�d��}||krPdS|d|SdS)Nr&r�rQ)rdrlrj�rstrip)r8r�Zstr_nZval_nr)r)r+r'(sr'cCsB|dks|dkrtd��d}||kr>||||d?}}q|S)Nr&z3Both arguments to _sqrt_nearest should be positive.r.)rp)r8r1r{r)r)r+�
_sqrt_nearest=sr�cCs2d|>||?}}|d||d@|d@|kS)Nr.r]r))r*r�r{r�r)r)r+�_rshift_nearestLsr�cCs&t||�\}}|d||d@|kS)Nr]r.)r�)r1r{r�r�r)r)r+�_div_nearestTsr�r!c		Cs�||}d}||kr(t|�||>|ksD||krxt|�||?|krxt||d>|t||t||�|��}|d7}qtdtt|��d|�}t||�}t||�}t|ddd�D]}t||�t|||�}q�t|||�S)Nr&r.���r[r�)rlr�r�r�rUrjrdr)	r*�M�Lr-�R�TZyshift�wr�r)r)r+�_ilog\s"���


r�c
Cs�|d7}tt|��}||||dk}|dkr�d|}|||}|dkrZ|d|9}nt|d|�}t||�}t|�}t|||�}||}	nd}t|d|�}	t|	|d�S�Nr]r.r&r�r%)rjrdr�r��
_log10_digits)
rJr�r)rKr�r�r��log_dZlog_10Zlog_tenpowerr)r)r+rp�s 

rpc	Cs�|d7}tt|��}||||dk}|dkrr|||}|dkrR|d|9}nt|d|�}t|d|�}nd}|r�ttt|���d}||dkr�t|t||�d|�}q�d}nd}t||d�Sr�)rjrdr�r�rlr�)	rJr�r)rKr�r�r�r:Z	f_log_tenr)r)r+rl�s"rlc@seZdZdd�Zdd�ZdS)�
_Log10MemoizecCs
d|_dS)NZ/23025850929940456840179914546843642076011014886)r|r�r)r)r+r��sz_Log10Memoize.__init__cCs�|dkrtd��|t|j�kr�d}d||d}tttd||�d��}||d�d|krbql|d7}q"|�d�dd�|_t|jd|d	��S)
Nr&zp should be nonnegativer[r�r]r%rQr�r.)rprjr|rdr�r�r�rU)r0r)r:r�r|r)r)r+�	getdigits�s	
z_Log10Memoize.getdigitsN)r4r5r6r�r�r)r)r)r+r��sr�c	Cs�t||>|�}tdtt|��d|�}t||�}||>}t|ddd�D]}t|||||�}qPt|ddd�D]"}||d>}t||||�}q|||S)Nr�r[r.r&r�r])r&rUrjrdr�r)	r*r�r�r�r�r-ZMshiftrr�r)r)r+�_iexp�s
r�c	Cs�|d7}td|tt|��d�}||}||}|dkrH|d|}n|d|}t|t|��\}}t|d|�}tt|d|�d�||dfS)Nr]r&r.r�i�r[)r�rjrdr�r�r�r�)	rJr�r)r:r�r�ZcshiftZquotr0r)r)r+rZ$srZcCs�ttt|���|}t||||d�}||}|dkrJ||d|}nt||d|�}|dkr�tt|��|dk|dkkr�d|ddd|}	}
q�d|d|}	}
n,t||d|d�\}	}
t|	d�}	|
d7}
|	|
fS)Nr.r&r�)rjrdrlrlr�rZ)r+r,r.r/r)r{Zlxcr�Zpcr�rVr)r)r+r5Hs
r5r%�F�5�(�re�r�r})	r��2�3�4�5�6�7�8rCcCs0|dkrtd��t|�}dt|�||dS)Nr&z0The argument to _log10_lb should be nonnegative.r%)rprdrj)rJZ
correctionZstr_cr)r)r+r(rsr(cCsLt|t�r|St|t�r t|�S|r8t|t�r8t�|�S|rHtd|��tS)Nr�)rcrrUrtrurvr�)r�r�Zallow_floatr)r)r+r�}s


r�cCs�t|t�r||fSt|tj�rR|jsDt|jtt|j	�|j
�|j�}|t|j�fS|rrt|tj
�rr|jdkrr|j}t|t�r�t�}|r�d|jt<n|�td�|t�|�fSttfS)Nr&r.r`)rcr�_numbersZRationalrPr9r:rdrUr;�denominatorrO�	numeratorZComplexr�r�rtrr8rrhrur�)r0r�r�r1r)r)r+r��s(
�
�r�r$i?Bi���)rErDr7r8rFr@r�r�r^)rErDr7r8a�        # A numeric string consists of:
#    \s*
    (?P<sign>[-+])?              # an optional sign, followed by either...
    (
        (?=\d|\.\d)              # ...a number (with at least one digit)
        (?P<int>\d*)             # having a (possibly empty) integer part
        (\.(?P<frac>\d*))?       # followed by an optional fractional part
        (E(?P<exp>[-+]?\d+))?    # followed by an optional exponent, or...
    |
        Inf(inity)?              # ...an infinity, or...
    |
        (?P<signal>s)?           # ...an (optionally signaling)
        NaN                      # NaN
        (?P<diag>\d*)            # with (possibly empty) diagnostic info.
    )
#    \s*
    \Z
z0*$z50*$z�\A
(?:
   (?P<fill>.)?
   (?P<align>[<>=^])
)?
(?P<sign>[-+ ])?
(?P<alt>\#)?
(?P<zeropad>0)?
(?P<minimumwidth>(?!0)\d+)?
(?P<thousands_sep>,)?
(?:\.(?P<precision>0|(?!0)\d+))?
(?P<type>[eEfFgGn%])?
\Z
cCs�t�|�}|dkrtd|��|��}|d}|d}|ddk	|d<|drv|dk	rbtd|��|dk	rvtd|��|p|d|d<|p�d|d<|d	dkr�d
|d	<t|dp�d�|d<|d
dk	r�t|d
�|d
<|d
dkr�|ddks�|ddkr�d|d
<|ddk�rfd|d<|dk�r&t��}|ddk	�r@td|��|d|d<|d|d<|d|d<n*|ddk�r|d|d<ddg|d<d|d<|S)NzInvalid format specifier: �fill�align�zeropadz7Fill character conflicts with '0' in format specifier: z2Alignment conflicts with '0' in format specifier: � �>rBrT�minimumwidthrQr�r&r�ZgGnr.r8r��
thousands_sepzJExplicit thousands separator conflicts with 'n' type in format specifier: �grouping�
decimal_pointrSr[r�)�_parse_format_specifier_regex�matchrp�	groupdictrU�_locale�
localeconv)�format_specr�ryZformat_dictrrr)r)r+r�sT
��
�r�c	Cs�|d}|d}||t|�t|�}|d}|dkrF|||}nj|dkr\|||}nT|dkrr|||}n>|dkr�t|�d}|d|�||||d�}ntd	��|S)
Nrrr�<r�=�^r]zUnrecognised alignment field)rjrp)	rBr�r�rrZpaddingrr�Zhalfr)r)r+r�ms"r�cCspddlm}m}|sgS|ddkrJt|�dkrJ||dd�||d��S|dtjkrd|dd�Std��dS)Nr&)�chain�repeatr�r]r�z unrecognised format for grouping)�	itertoolsr!r"rjr�CHAR_MAXrp)rr!r"r)r)r+�_group_lengths�s
r%cCs�|d}|d}g}t|�D]�}|dkr0td��ttt|�|d�|�}|�d|t|�||d��|d|�}||8}|s�|dkr�q�|t|�8}qtt|�|d�}|�d|t|�||d��|�t|��S)Nrrr&zgroup length should be positiver.rQ)r%rpr�r�rjrqrr�reversed)r|r��	min_width�sepr�groupsrKr)r)r+�_insert_thousands_sep�s $$r*cCs$|rdS|ddkr|dSdSdS)NrTrBz +rSr))�is_negativer�r)r)r+r��s
r�cCs�t||�}|s|dr"|d|}|dks6|ddkr\ddddd�|d}|d	�||�7}|dd
krp|d
7}|dr�|dt|�t|�}nd}t|||�}t||||�S)
NZaltrr&r�r�r�r�)r�r�r�r�z{0}{1:+}r�rr)r��formatrjr*r�)r+rzr{rVr�rBZecharr'r)r)r+r��s
r�ZInfz-Infr�r�r])N)F)r&)r!)r!)FF)F)N)r.)y�__all__r4Z	__xname__�__version__Z__libmpdec_version__Zmathr~Znumbersr�sys�collectionsr'Z_namedtupler�ImportErrorrrrrrrrrr$r%�maxsizer r!r"r#�ArithmeticErrorrrr	r�ZeroDivisionErrorr
rrrrrr
rrrvrr6r�r�ZcontextvarsZ
ContextVarrGrrrrarr9�Number�registerrNrrmr�rUr�r&r'r�r�r�r�rprlr�r�r�r�rZr5r(r�r�rrr�re�compile�VERBOSE�
IGNORECASErrer�r�DOTALLrZlocalerr�r�r%r*r�r�rkrjr=rVr3rUr@�	hash_info�modulusr�r�r�r�r�r�r�r)r)r)r+�<module>us��#

&
���

.
^

0",#
%$+�

*���
�
�
P
%
)__pycache__/stat.cpython-38.pyc000064400000010426151153537610012371 0ustar00U

e5dm�
@sLdZdZdZdZdZdZdZdZdZd	Z	d
Z
dd�Zd
d�ZdZ
dZdZdZdZdZdZdZdZdZdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Z d*Z!d+Z"e"Z#d,Z$d-Z%d.Z&d/Z'd0Z(d-Z)d.Z*d/Z+d1Z,d2Z-d3Z.d	Z/dZ0dZ1dZ2dZ3dZ4dZ5dZ6d	Z7d3Z8d2Z9dZ:d4Z;d5Z<d6Z=d7Z>d8Z?ed9fed:fed;fed<fe
d=fed>fed?ffe)d@ffe*dAffe+e!Bd:fe!dBfe+dCffe-d@ffe.dAffe/e"Bd:fe"dBfe/dCffe1d@ffe2dAffe3e$BdDfe$dEfe3dCfff
Z@dFdG�ZAd2ZBd*ZCd/ZDd3ZEdZFdZGdZHd.ZIdZJd5ZKdZLdZMd+ZNd,ZOdZPd-ZQd4ZRzddHlSTWneTk
�rFYnXdIS)JzoConstants/functions for interpreting results of os.stat() and os.lstat().

Suggested usage: from stat import *
����������	cCs|d@S)zMReturn the portion of the file's mode that can be set by
    os.chmod().
    i����moderr�/usr/lib64/python3.8/stat.py�S_IMODEsrcCs|d@S)zLReturn the portion of the file's mode that describes the
    file type.
    i�rrrrr�S_IFMTsri@i i`i�ii�i�cCst|�tkS)z(Return True if mode is from a directory.)r�S_IFDIRrrrr�S_ISDIR2srcCst|�tkS)z<Return True if mode is from a character special device file.)r�S_IFCHRrrrr�S_ISCHR6srcCst|�tkS)z8Return True if mode is from a block special device file.)r�S_IFBLKrrrr�S_ISBLK:srcCst|�tkS)z+Return True if mode is from a regular file.)r�S_IFREGrrrr�S_ISREG>srcCst|�tkS)z0Return True if mode is from a FIFO (named pipe).)r�S_IFIFOrrrr�S_ISFIFOBsrcCst|�tkS)z,Return True if mode is from a symbolic link.)r�S_IFLNKrrrr�S_ISLNKFsrcCst|�tkS)z%Return True if mode is from a socket.)r�S_IFSOCKrrrr�S_ISSOCKJsrcCsdS)z#Return True if mode is from a door.Frrrrr�S_ISDOORNsrcCsdS)z*Return True if mode is from an event port.Frrrrr�S_ISPORTRsr cCsdS)z'Return True if mode is from a whiteout.Frrrrr�S_ISWHTVsr!iii���@i��8� �iiiii �l�s�-�b�d�c�p�r�w�S�x�t�TcCsJg}tD]6}|D]"\}}||@|kr|�|�qq|�d�qd�|�S)z;Convert a file's mode to a string of the form '-rwxrwxrwx'.r*�)�_filemode_table�append�join)r
Zperm�table�bit�charrrr�filemode�s
r<)�*N)U�__doc__�ST_MODE�ST_INO�ST_DEV�ST_NLINK�ST_UID�ST_GID�ST_SIZE�ST_ATIME�ST_MTIME�ST_CTIMErrrrrrrrr�S_IFDOOR�S_IFPORT�S_IFWHTrrrrrrrrr r!�S_ISUID�S_ISGID�S_ENFMT�S_ISVTX�S_IREAD�S_IWRITE�S_IEXEC�S_IRWXU�S_IRUSR�S_IWUSR�S_IXUSR�S_IRWXG�S_IRGRP�S_IWGRP�S_IXGRP�S_IRWXO�S_IROTH�S_IWOTH�S_IXOTH�	UF_NODUMP�UF_IMMUTABLE�	UF_APPEND�	UF_OPAQUE�UF_NOUNLINK�
UF_COMPRESSED�	UF_HIDDEN�SF_ARCHIVED�SF_IMMUTABLE�	SF_APPEND�SF_NOUNLINK�SF_SNAPSHOTr6r<�FILE_ATTRIBUTE_ARCHIVE�FILE_ATTRIBUTE_COMPRESSED�FILE_ATTRIBUTE_DEVICE�FILE_ATTRIBUTE_DIRECTORY�FILE_ATTRIBUTE_ENCRYPTED�FILE_ATTRIBUTE_HIDDEN�FILE_ATTRIBUTE_INTEGRITY_STREAM�FILE_ATTRIBUTE_NORMAL�"FILE_ATTRIBUTE_NOT_CONTENT_INDEXED�FILE_ATTRIBUTE_NO_SCRUB_DATA�FILE_ATTRIBUTE_OFFLINE�FILE_ATTRIBUTE_READONLY�FILE_ATTRIBUTE_REPARSE_POINT�FILE_ATTRIBUTE_SPARSE_FILE�FILE_ATTRIBUTE_SYSTEM�FILE_ATTRIBUTE_TEMPORARY�FILE_ATTRIBUTE_VIRTUAL�_stat�ImportErrorrrrr�<module>s�	�
�
�
��__pycache__/keyword.cpython-38.opt-2.pyc000064400000001075151153537610014042 0ustar00U

e5d��#@s`ddgZdddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$g#Zee�jZd%S)&�	iskeyword�kwlist�False�None�True�and�as�assert�async�await�break�class�continue�def�del�elif�else�except�finally�for�from�global�if�import�in�is�lambda�nonlocal�not�or�pass�raise�return�try�while�with�yieldN)�__all__r�	frozenset�__contains__r�r)r)�/usr/lib64/python3.8/keyword.py�<module>sJ�&__pycache__/pyclbr.cpython-38.opt-2.pyc000064400000015304151153537610013651 0ustar00U

e5d�;�@s�ddlZddlZddlZddlZddlmZmZmZddddgZ	iZ
Gdd�d�ZGd	d�de�ZGd
d�de�Z
dd�Zdd
d�Zddd�Zddd�Zddd�Zdd�Zdd�Zdd�Zdd�Zedkr�e�dS) �N)�NAME�DEDENT�OP�
readmodule�
readmodule_ex�Class�Functionc@seZdZdd�Zdd�ZdS)�_ObjectcCs(||_||_||_||_||_i|_dS�N)�module�name�file�lineno�parent�children��selfrrr
rr�r�/usr/lib64/python3.8/pyclbr.py�__init__6sz_Object.__init__cCs||j|<dSr
)r)rr�objrrr�	_addchild>sz_Object._addchildN)�__name__�
__module__�__qualname__rrrrrrr	4sr	c@seZdZddd�ZdS)rNcCst�||||||�dSr
)r	rrrrrrDszFunction.__init__)N)rrrrrrrrrBscs&eZdZd�fdd�	Zdd�Z�ZS)rNcs0t�||||||�|dkr gn||_i|_dSr
)r	r�super�methods)rrrrr
rr��	__class__rrrJszClass.__init__cCs||j|<dSr
)r)rrrrrr�
_addmethodOszClass._addmethod)N)rrrrr�
__classcell__rrrrrHscCs:t|j||j||�}|�||�t|t�r6|�||�|Sr
)rrr
r�
isinstancerr)�ob�	func_namerZnewfuncrrr�_nest_functionSs

r$cCs&t|j|||j||�}|�||�|Sr
)rrr
r)r"�
class_namerrZnewclassrrr�_nest_class[sr&cCs6i}t||pg���D]\}}t|t�r|||<q|Sr
)�_readmodule�itemsr!r)r�path�res�key�valuerrrras


cCst||p
g�Sr
)r')rr)rrrrmsc	Cs�|dk	rd||f}n|}|tkr*t|Si}|tjkrL|dkrL|t|<|S|�d�}|dkr�|d|�}||dd�}t|||�}|dk	r�d||f}d|kr�td�|���t||d|�Sd}	|dk	r�|}
n
|tj}
tj	�
||
�}|dk�rtd|��|d��|t|<|jdk	�r$|j|d<z|j
�|�}Wnttfk
�rR|YSX|dk�rb|S|j
�|�}
t|||
|||�S)	Nz%s.%s�.r��__path__zNo package named {}zno module named )r)�_modules�sys�builtin_module_names�rfindr'�ImportError�formatr)�	importlib�util�_find_spec_from_path�ModuleNotFoundError�submodule_search_locations�loader�
get_source�AttributeError�get_filename�_create_tree)rr)�	inpackage�
fullmodule�tree�i�packageZ	submoduler�fZsearch_path�spec�source�fnamerrrr'vsJ	





r'c!
CsHt�|�}g}t�|j�}�z|D�]�\}	}
}}}
|	tkr`|\}}|r^|dd|kr^|d=qBq"|
dkr�|\}}|r�|dd|kr�|d=qpt|�dd�\}	}}|	tkr�q"d}|r�|dd}t|||�}nt	||||�}|||<|�
||f�q"|
dk�r�|\}}|�r(|dd|k�r(|d=�qt|�dd�\}	}}|	tk�rJq"t|�dd�\}	}
}d}|
dk�r�g}d}g}t|�dd�\}	}
}|
dk�r|dk�rd	�|�}||k�r�||}nL|�d
�}t
|�dk�r|d}|d}|tk�rt|}||k�r||}|�
|�g}|
dk�r0|d7}nZ|
dk�rR|d8}|dk�r��q�n8|
d
k�rh|dk�rhn"|	ttfk�rz|dk�rz|�
|
��qz|}|�r�|dd}t||||�}nt|||||�}|||<|�
||f�q"|
dk�rh|ddk�rht|�}|D]d\}}zL|dk�r t||�n2zt|||�Wn tk
�rPt|g�YnXWnYnX�qq"|
dkr"|ddkr"t|�\}}
|r"|
dk�r�q"t|�}zt|||�}WnYq"YnX|D]X\}} ||k�r�|||| �p�|<n0|dk�r�|D] }|ddk�r�||||<�q��q�q"Wntk
�r:YnX|��|S)N���r.�defr��class�()�)�,�r-���rNrO�import�from�*�_)�io�StringIO�tokenize�generate_tokens�readliner�nextrr$r�append�join�split�lenr0rr&r�_getnamelistr'r4�_getname�
StopIteration�close)!rAr)rHrGrBr@rE�stack�g�	tokentype�token�startZ_end�_linerZ
thisindentr#Zcur_funcZcur_objr%Zinherit�names�levelr�n�c�m�dZ	cur_class�modules�modZ_mod2Zn2rrrr?�s�
















��



r?cCslg}t|�\}}|sqh|dkr,t|�\}}nd}|�||f�|dkr\d|kr\t|�d}q>|dkrqhq|S)N�asrO�
r.)rar\r[)rerjrrgZname2rrrr`Esr`cCs�g}t|�dd�\}}|tkr0|dkr0d|fS|�|�t|�dd�\}}|dkrXq�t|�dd�\}}|tkrvq�|�|�q:d�|�|fS)Nr�rTr-)r[rr\r])re�partsrfrgrrrra[s
rac
CsXddl}ztjd}Wnt}YnX|j�|�rj|j�|�g}|j�|�}|���	d�rn|dd�}ng}t
||�}dd�}t|��|dd�}d	}|�rT|�
�}t|t�r�q�t|d
�s�d|_t|t�r�t|j��|dd�}|D]}	|j||	_q�|�|�t|t��r,td�d|j|j|j|j��q�t|t�r�td
�d|j|j|j��q�dS)Nrr.z.py���cSst|dd�S)Nrr)�getattr)�arrr�<lambda>|�z_main.<locals>.<lambda>T)r+�reversert�indentz{}class {} {} {}� z{}def {} {})�osr1�argv�__file__r)�exists�dirname�basename�lower�endswithr�sorted�values�popr!�list�hasattrr|r	r�extendr�printr5rrrr)
r~rqr)rBZ
lineno_keyZobjsZindent_levelrZnew_objsr"rrr�_mainmsL





�
�
r��__main__)N)N)N)N)rVr1�importlib.utilr6rXrgrrr�__all__r0r	rrr$r&rrr'r?r`rar�rrrrr�<module>)s*


	
@&__pycache__/doctest.cpython-38.pyc000064400000224310151153537610013062 0ustar00U

e5d_��!@stdZdZdddddddd	d
ddd
ddddddddddddddddddd d!d"g!Zd#d$lZd#d$lZd#d$lZd#d$lZd#d$lZd#d$lZd#d$l	Z	d#d$l
Z
d#d$lZd#d$lZd#d%l
mZd#d&lmZed'd(�ZiZd)d�Zed�Zed�Zed�Zed�Zed�Zed�ZeeBeBeBeBeBZed
�Zed�Zed�Zed
�Zed�ZeeBeBeBeBZ d*Z!d+Z"d,d-�Z#dsd/d0�Z$d1d2�Z%d3d4�Z&dtd6d7�Z'd8d9�Z(Gd:d;�d;e�Z)d<d=�Z*d>d?�Z+d@dA�Z,GdBdC�dCej-�Z.dDdE�Z/GdFd�d�Z0GdGd�d�Z1GdHd�d�Z2GdId�d�Z3GdJd�d�Z4GdKd�d�Z5GdLd�de6�Z7GdMd�de6�Z8GdNd�de4�Z9d$a:dudQd�Z;dOd$d$d$d$dOd#d$dPe2�d$fdRd�Z<dvdTd�Z=d#a>dUd�Z?GdVdW�dWej@�ZAGdXdY�dYeA�ZBGdZd[�d[ejC�ZDdwd\d�ZEGd]d^�d^eA�ZFdOd$d$e2�d$fd_d`�ZGdad�ZHdbd�ZIdcd �ZJdxddd!�ZKdydedf�ZLdzdgd"�ZMGdhdi�di�ZNeNdjdkdldmdndo�ZOdpdq�ZPeQdrk�rpe
�ReP��d$S){a�Module doctest -- a framework for running examples in docstrings.

In simplest use, end each module M to be tested with:

def _test():
    import doctest
    doctest.testmod()

if __name__ == "__main__":
    _test()

Then running the module as a script will cause the examples in the
docstrings to get executed and verified:

python M.py

This won't display anything unless an example fails, in which case the
failing example(s) and the cause(s) of the failure(s) are printed to stdout
(why not stderr? because stderr is a lame hack <0.2 wink>), and the final
line of output is "Test failed.".

Run it with the -v switch instead:

python M.py -v

and a detailed report of all examples tried is printed to stdout, along
with assorted summaries at the end.

You can force verbose mode by passing "verbose=True" to testmod, or prohibit
it by passing "verbose=False".  In either of those cases, sys.argv is not
examined by testmod.

There are a variety of other ways to run doctests, including integration
with the unittest framework, and support for running non-Python text
files containing doctests.  There are also many ways to override parts
of doctest's default behaviors.  See the Library Reference Manual for
details.
zreStructuredText en�register_optionflag�DONT_ACCEPT_TRUE_FOR_1�DONT_ACCEPT_BLANKLINE�NORMALIZE_WHITESPACE�ELLIPSIS�SKIP�IGNORE_EXCEPTION_DETAIL�COMPARISON_FLAGS�REPORT_UDIFF�REPORT_CDIFF�REPORT_NDIFF�REPORT_ONLY_FIRST_FAILURE�REPORTING_FLAGS�	FAIL_FAST�Example�DocTest�
DocTestParser�
DocTestFinder�
DocTestRunner�
OutputChecker�DocTestFailure�UnexpectedException�DebugRunner�testmod�testfile�run_docstring_examples�DocTestSuite�DocFileSuite�set_unittest_reportflags�script_from_examples�
testsource�	debug_src�debug�N)�StringIO)�
namedtuple�TestResultszfailed attemptedcCst�|dtt�>�S)N�)�OPTIONFLAGS_BY_NAME�
setdefault�len��name�r,�/usr/lib64/python3.8/doctest.pyr�sz<BLANKLINE>z...cCs8d}tjD](}|�|d�}|tt|�kr
||jO}q
|S)z�
    Return the compiler-flags associated with the future features that
    have been imported into the given namespace (globs).
    r"N)�
__future__Zall_feature_names�get�getattrZ
compiler_flag)�globs�flagsZfnameZfeaturer,r,r-�_extract_future_flags�s
r3�cCsVt�|�r|St|t�r,t|t�t�dg�S|dkrJtjt�	|�j
dStd��dS)a�
    Return the module specified by `module`.  In particular:
      - If `module` is a module, then return module.
      - If `module` is a string, then import and return the
        module with that name.
      - If `module` is None, then return the calling module.
        The calling module is assumed to be the module of
        the stack frame at the given depth in the call stack.
    �*N�__name__z"Expected a module, string, or None)�inspect�ismodule�
isinstance�str�
__import__�globals�locals�sys�modules�	_getframe�	f_globals�	TypeError)�moduleZdepthr,r,r-�_normalize_module�s


rDcCsdD]}|�|d�}q|S)N)z
�
�
)�replace)�data�newliner,r,r-�_newline_convert�srJc
Cs�|rVt|d�}t||�}t|dd�dk	rVt|jd�rV|j�|�}|�|�}t|�|fSt||d��}|�	�|fW5QR�SQRXdS)N��
__loader__�get_data)�encoding)
rD�_module_relative_pathr0�hasattrrLrM�decoderJ�open�read)�filename�package�module_relativerNZ
file_contents�fr,r,r-�_load_testfile�s


rX�cCst�d|d|�S)z~
    Add the given number of space characters to the beginning of
    every non-blank line in `s`, and return the result.
    z
(?m)^(?!$)� )�re�sub)�s�indentr,r,r-�_indent�sr_cCs*t�}|\}}}tj||||d�|��S)zz
    Return a string containing a traceback message for the given
    exc_info tuple (as returned by sys.exc_info()).
    )�file)r#�	traceback�print_exception�getvalue)�exc_infoZexcout�exc_typeZexc_valZexc_tbr,r,r-�_exception_traceback�s
rfc@seZdZdd�Zddd�ZdS)�	_SpoofOutcCs$t�|�}|r |�d�s |d7}|S�NrF)r#rc�endswith)�self�resultr,r,r-rcs
z_SpoofOut.getvalueNcCs|�|�t�|�dS�N)�seekr#�truncate)rj�sizer,r,r-rn	s
z_SpoofOut.truncate)N)r6�
__module__�__qualname__rcrnr,r,r,r-rg�s	rgcCs�t|kr||kS|�t�}t|�dks*t�dt|�}}|d}|rb|�|�r^t|�}|d=ndS|d}|r�|�|�r�|t|�8}|d=ndS||kr�dS|D],}|�|||�}|dkr�dS|t|�7}q�dS)z_
    Essentially the only subtle case:
    >>> _ellipsis_match('aa...aa', 'aaa')
    False
    r4r"F���T)�ELLIPSIS_MARKER�splitr)�AssertionError�
startswithri�find)�want�gotZws�startpos�endpos�wr,r,r-�_ellipsis_matchs2


r}cCs|��}|rd|SdSdS)z)Return a commented form of the given linez# �#N)�rstrip)�liner,r,r-�
_comment_line?sr�cCshdt|�}}|�d�}|dkr$|}|�dd|�}|dkr>|}|�dd|�}|dkr\|d}|||�S)Nr"rF�:�.r&)r)rw�rfind)�msg�start�end�ir,r,r-�_strip_exception_detailsGs
r�c@s2eZdZdZdd�Zddd�Zdd�Zd	d
�ZdS)�_OutputRedirectingPdbz�
    A specialized version of the python debugger that redirects stdout
    to a given stream when interacting with the user.  Stdout is *not*
    redirected when traced code is executed.
    cCs(||_d|_tjj||dd�d|_dS)NFT)�stdout�nosigintr&)�_OutputRedirectingPdb__out�$_OutputRedirectingPdb__debugger_used�pdb�Pdb�__init__Zuse_rawinput)rj�outr,r,r-r�gsz_OutputRedirectingPdb.__init__NcCs*d|_|dkrt��j}tj�||�dS)NT)r�r>r@�f_backr�r��	set_trace)rj�framer,r,r-r�os
z_OutputRedirectingPdb.set_tracecCs|jrtj�|�dSrl)r�r�r��set_continue�rjr,r,r-r�usz"_OutputRedirectingPdb.set_continuecGs2tj}|jt_ztjj|f|��W�S|t_XdSrl)r>r�r�r�r��trace_dispatch)rj�args�save_stdoutr,r,r-r�{s
z$_OutputRedirectingPdb.trace_dispatch)N)r6rprq�__doc__r�r�r�r�r,r,r,r-r�as

r�cCs�t�|�std|��|�d�r(td��tjj|�d��}t	|d�rXtj�|j
�d}n�|jdkr�tt
j�dkr�t
jddkr�tj�t
jd�d}q�tj}nFt	|d�r�|jD]&}tj�||�}tj�|�r�|Sq�td	|j��tj�||�S)
NzExpected a module: %r�/z1Module-relative files may not have absolute paths�__file__r"�__main__��__path__zBCan't resolve paths relative to the module %r (it has no __file__))r7r8rBrv�
ValueError�os�path�joinrtrPr�r6r)r>�argv�curdirr��exists)rCZ	test_pathZbasedirZ	directory�fullpathr,r,r-rO�s(






�rOc@s*eZdZdZd
dd�Zdd�Zdd	�ZdS)ran
    A single doctest example, consisting of source code and expected
    output.  `Example` defines the following attributes:

      - source: A single Python statement, always ending with a newline.
        The constructor adds a newline if needed.

      - want: The expected output from running the source code (either
        from stdout, or a traceback in case of exception).  `want` ends
        with a newline unless it's empty, in which case it's an empty
        string.  The constructor adds a newline if needed.

      - exc_msg: The exception message generated by the example, if
        the example is expected to generate an exception; or `None` if
        it is not expected to generate an exception.  This exception
        message is compared against the return value of
        `traceback.format_exception_only()`.  `exc_msg` ends with a
        newline unless it's `None`.  The constructor adds a newline
        if needed.

      - lineno: The line number within the DocTest string containing
        this Example where the Example begins.  This line number is
        zero-based, with respect to the beginning of the DocTest.

      - indent: The example's indentation in the DocTest string.
        I.e., the number of space characters that precede the
        example's first prompt.

      - options: A dictionary mapping from option flags to True or
        False, which is used to override default options for this
        example.  Any option flags not contained in this dictionary
        are left at their default value (as specified by the
        DocTestRunner's optionflags).  By default, no options are set.
    Nr"cCsv|�d�s|d7}|r(|�d�s(|d7}|dk	rB|�d�sB|d7}||_||_||_||_|dkrfi}||_||_dSrh)ri�sourcerx�linenor^�options�exc_msg)rjr�rxr�r�r^r�r,r,r-r��s
zExample.__init__cCs\t|�t|�k	rtS|j|jkoZ|j|jkoZ|j|jkoZ|j|jkoZ|j|jkoZ|j|jkSrl)�type�NotImplementedr�rxr�r^r�r��rj�otherr,r,r-�__eq__�s
�
�
�
�
�zExample.__eq__cCst|j|j|j|j|jf�Srl)�hashr�rxr�r^r�r�r,r,r-�__hash__�s�zExample.__hash__)Nr"r"N)r6rprqr�r�r�r�r,r,r,r-r�s"�
c@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
rae
    A collection of doctest examples that should be run in a single
    namespace.  Each `DocTest` defines the following attributes:

      - examples: the list of examples.

      - globs: The namespace (aka globals) that the examples should
        be run in.

      - name: A name identifying the DocTest (typically, the name of
        the object whose docstring this DocTest was extracted from).

      - filename: The name of the file that this DocTest was extracted
        from, or `None` if the filename is unknown.

      - lineno: The line number within filename where this DocTest
        begins, or `None` if the line number is unavailable.  This
        line number is zero-based, with respect to the beginning of
        the file.

      - docstring: The string that the examples were extracted from,
        or `None` if the string is unavailable.
    cCs>t|t�rtd��||_||_|��|_||_||_||_	dS)z�
        Create a new DocTest containing the given examples.  The
        DocTest's globals are initialized with a copy of `globs`.
        z8DocTest no longer accepts str; use DocTestParser insteadN)
r9r:ru�examples�	docstring�copyr1r+rTr�)rjr�r1r+rTr�r�r,r,r-r�s�
zDocTest.__init__cCsRt|j�dkrd}n"t|j�dkr(d}ndt|j�}d|jj|j|j|j|fS)Nr"zno examplesr&z	1 examplez%d examplesz<%s %s from %s:%s (%s)>)r)r��	__class__r6r+rTr�)rjr�r,r,r-�__repr__s��zDocTest.__repr__cCs\t|�t|�k	rtS|j|jkoZ|j|jkoZ|j|jkoZ|j|jkoZ|j|jkoZ|j|jkSrl)r�r�r�r�r1r+rTr�r�r,r,r-r�)s
�
�
�
�
�zDocTest.__eq__cCst|j|j|j|jf�Srl)r�r�r+rTr�r�r,r,r-r�4szDocTest.__hash__cCs:t|t�stS|j|j|jt|�f|j|j|jt|�fkSrl)r9rr�r+rTr��idr�r,r,r-�__lt__8s

�zDocTest.__lt__N)	r6rprqr�r�r�r�r�r�r,r,r,r-r�sc@s�eZdZdZe�dejejB�Ze�dejejBej	B�Z
e�d�jZddd�Z
dd	�Zdd
d�Zdd
�Ze�dej�Zdd�Ze�dej�Zdd�Zdd�Zdd�ZdS)rzD
    A class used to parse strings containing doctest examples.
    a�
        # Source consists of a PS1 line followed by zero or more PS2 lines.
        (?P<source>
            (?:^(?P<indent> [ ]*) >>>    .*)    # PS1 line
            (?:\n           [ ]*  \.\.\. .*)*)  # PS2 lines
        \n?
        # Want consists of any non-blank lines that do not start with PS1.
        (?P<want> (?:(?![ ]*$)    # Not a blank line
                     (?![ ]*>>>)  # Not a line starting with PS1
                     .+$\n?       # But any other line
                  )*)
        a�
        # Grab the traceback header.  Different versions of Python have
        # said different things on the first traceback line.
        ^(?P<hdr> Traceback\ \(
            (?: most\ recent\ call\ last
            |   innermost\ last
            ) \) :
        )
        \s* $                # toss trailing whitespace on the header.
        (?P<stack> .*?)      # don't blink: absorb stuff until...
        ^ (?P<msg> \w+ .*)   #     a line *starts* with alphanum.
        z^[ ]*(#.*)?$�<string>c
s|��}|�|���dkr8d��fdd�|�d�D��}g}d\}}|j�|�D]�}|�|||����||�d||���7}|�	|||�\}}}	}
|�
|�s�|�t||	|
|�t|�
d��|d��||�d|��|���7}|��}qP|�||d��|S)	a=
        Divide the given string into examples and intervening text,
        and return them as a list of alternating Examples and strings.
        Line numbers for the Examples are 0-based.  The optional
        argument `name` is a name identifying this string, and is only
        used for error messages.
        r"rFcsg|]}|�d��qSrlr,��.0�l�Z
min_indentr,r-�
<listcomp>sz'DocTestParser.parse.<locals>.<listcomp>�r"r"r^)r�r^r�N)�
expandtabs�_min_indentr�rt�_EXAMPLE_RE�finditer�appendr��count�_parse_example�_IS_BLANK_OR_COMMENTrr)�groupr�)rj�stringr+�outputZcharnor��mr�r�rxr�r,r�r-�parsess*
�

�
zDocTestParser.parsecCst|�||�|||||�S)a"
        Extract all doctest examples from the given string, and
        collect them into a `DocTest` object.

        `globs`, `name`, `filename`, and `lineno` are attributes for
        the new `DocTest` object.  See the documentation for `DocTest`
        for more information.
        )r�get_examples)rjr�r1r+rTr�r,r,r-�get_doctest�s	�zDocTestParser.get_doctestcCsdd�|�||�D�S)a�
        Extract all doctest examples from the given string, and return
        them as a list of `Example` objects.  Line numbers are
        0-based, because it's most common in doctests that nothing
        interesting appears on the same line as opening triple-quote,
        and so the first interesting line is called "line 1" then.

        The optional argument `name` is a name identifying this
        string, and is only used for error messages.
        cSsg|]}t|t�r|�qSr,)r9r)r��xr,r,r-r��s
�z.DocTestParser.get_examples.<locals>.<listcomp>)r�)rjr�r+r,r,r-r��szDocTestParser.get_examplesc
s
t|�d���|�d��d�}|�|�||�|�|dd�d�d||�d��fdd	�|D��}|�d
�}|�d�}t|�dkr�t�d|d�r�|d=|�|d�||t|��d��fd
d	�|D��}|j�|�}|r�|�d�}nd}|�	|||�}	||	||fS)a�
        Given a regular expression match from `_EXAMPLE_RE` (`m`),
        return a pair `(source, want)`, where `source` is the matched
        example's source code (with prompts and indentation stripped);
        and `want` is the example's expected output (with indentation
        stripped).

        `name` is the string's name, and `lineno` is the line number
        where the example starts; both are used for error messages.
        r^r�rFr&NrZr�csg|]}|�dd��qS)rYNr,)r�Zsl�r^r,r-r��sz0DocTestParser._parse_example.<locals>.<listcomp>rxz *$rrcsg|]}|�d��qSrlr,)r�Zwlr�r,r-r��sr�)
r)r�rt�_check_prompt_blank�
_check_prefixr�r[�match�
_EXCEPTION_RE�
_find_options)
rjr�r+r��source_linesr�rx�
want_linesr�r�r,r�r-r��s& 


�zDocTestParser._parse_examplez#\s*doctest:\s*([^\n\'"]*)$c	Cs�i}|j�|�D]v}|�d��dd���}|D]V}|ddksN|dd�tkrdtd|d||f��t|dd�}|ddk||<q.q|r�|�|�r�td	|||f��|S)
a
        Return a dictionary containing option overrides extracted from
        option directives in the given source string.

        `name` is the string's name, and `lineno` is the line number
        where the example starts; both are used for error messages.
        r&�,rZr"z+-Nz7line %r of the doctest for %s has an invalid option: %r�+zSline %r of the doctest for %s has an option directive on a line with no example: %r)�_OPTION_DIRECTIVE_REr�r�rGrtr'r�r�)	rjr�r+r�r�r�Zoption_strings�option�flagr,r,r-r��s"���zDocTestParser._find_optionsz
^([ ]*)(?=\S)cCs2dd�|j�|�D�}t|�dkr*t|�SdSdS)z;Return the minimum indentation of any non-blank line in `s`cSsg|]}t|��qSr,)r))r�r^r,r,r-r�
sz-DocTestParser._min_indent.<locals>.<listcomp>r"N)�
_INDENT_RE�findallr)�min)rjr]�indentsr,r,r-r�szDocTestParser._min_indentc	Cs^t|�D]P\}}t|�|dkr||ddkrtd||d||||d�|f��qdS)a

        Given the lines of a source string (including prompts and
        leading indentation), check to make sure that every prompt is
        followed by a space character.  If any line is not followed by
        a space character, then raise ValueError.
        rYrKrZz8line %r of the docstring for %s lacks blank after %s: %rr&N)�	enumerater)r�)rj�linesr^r+r�r�r�r,r,r-r�s ��z!DocTestParser._check_prompt_blankcCs>t|�D]0\}}|r|�|�std||d||f��qdS)z�
        Check that every line in the given list starts with the given
        prefix; if any line does not, then raise a ValueError.
        zGline %r of the docstring for %s has inconsistent leading whitespace: %rr&N)r�rvr�)rjr��prefixr+r�r�r�r,r,r-r�s
�zDocTestParser._check_prefixN)r�)r�)r6rprqr�r[�compile�	MULTILINE�VERBOSEr��DOTALLr�r�r�r�r�r�r�r�r�r�r�r�r�r,r,r,r-rCs(
��
'
3�c@sNeZdZdZde�ddfdd�Zddd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)ra<
    A class used to extract the DocTests that are relevant to a given
    object, from its docstring and the docstrings of its contained
    objects.  Doctests can currently be extracted from the following
    object types: modules, functions, classes, methods, staticmethods,
    classmethods, and properties.
    FTcCs||_||_||_||_dS)at
        Create a new doctest finder.

        The optional argument `parser` specifies a class or
        function that should be used to create new DocTest objects (or
        objects that implement the same interface as DocTest).  The
        signature for this factory function should match the signature
        of the DocTest constructor.

        If the optional argument `recurse` is false, then `find` will
        only examine the given object, and not any contained objects.

        If the optional argument `exclude_empty` is false, then `find`
        will include tests for objects with empty docstrings.
        N)�_parser�_verbose�_recurse�_exclude_empty)rj�verbose�parser�recurse�
exclude_emptyr,r,r-r�7szDocTestFinder.__init__Nc		CsN|dkr.t|dd�}|dkr.tdt|�f��|dkr<d}n|dkrNt�|�}zt�|�}Wntk
rtd}YndX|s�t�|�}|d|dd�dks�d}|dkr�d}n*|dk	r�t�	||j
�}n
t�	|�}|s�d}|dkr�|dkr�i}n
|j
��}n|��}|dk	�r|�|�d|k�r(d|d<g}|�
||||||i�|��|S)	aj
        Return a list of the DocTests that are defined by the given
        object's docstring, or by any of its contained objects'
        docstrings.

        The optional parameter `module` is the module that contains
        the given object.  If the module is not specified or is None, then
        the test finder will attempt to automatically determine the
        correct module.  The object's module is used:

            - As a default namespace, if `globs` is not specified.
            - To prevent the DocTestFinder from extracting DocTests
              from objects that are imported from other modules.
            - To find the name of the file containing the object.
            - To help find the line number of the object within its
              file.

        Contained objects whose module does not match `module` are ignored.

        If `module` is False, no attempt to find the module will be made.
        This is obscure, of use mostly in tests:  if `module` is False, or
        is None but cannot be found automatically, then all objects are
        considered to belong to the (non-existent) module, so all contained
        objects will (recursively) be searched for doctests.

        The globals for each DocTest is formed by combining `globs`
        and `extraglobs` (bindings in `extraglobs` override bindings
        in `globs`).  A new copy of the globals dictionary is created
        for each DocTest.  If `globs` is not specified, then it
        defaults to the module's `__dict__`, if specified, or {}
        otherwise.  If `extraglobs` is not specified, then it defaults
        to {}.

        Nr6zJDocTestFinder.find: name must be given when obj.__name__ doesn't exist: %rFr"���z<]>r�)r0r�r�r7�	getmoduleZ
getsourcefilerBZgetfile�	linecache�getlines�__dict__r��update�_find�sort)	rj�objr+rCr1�
extraglobsr`r��testsr,r,r-rwMsL$�






zDocTestFinder.findcCs�|dkrdSt�|�dk	r(|t�|�kSt�|�r>|j|jkSt�|�r|t|d�r\|jj}nt|d�rn|j}ndS|j	|kSt�
|�r�|j	|jkSt|d�r�|j	|jkSt|t�r�dSt
d��dS)zY
        Return true if the given object is defined in the given
        module.
        NT�__objclass__rpz"object must be a class or function)r7r��
isfunctionr��__globals__ZismethoddescriptorrPr�rpr6�isclassr9�propertyr�)rjrC�objectZobj_modr,r,r-�_from_module�s(








zDocTestFinder._from_modulec
Cs|jrtd|�t|�|kr"dSd|t|�<|�|||||�}|dk	rR|�|�t�|�r�|jr�|j�	�D]P\}	}
d||	f}	t�
t�|
��s�t�|
�rl|�
||
�rl|�||
|	||||�qlt�|��rn|j�rnt|di��	�D]�\}	}
t|	t��stdt|	�f��t�
|
��sJt�|
��sJt�|
��sJt|
t��sJtdt|
�f��d||	f}	|�||
|	||||�q�t�|��r|j�r|j�	�D]�\}	}
t|
t��r�t||	�}
t|
t��r�t||	�j}
t�
|
��s�t�|
��s�t|
t��r�|�
||
��r�d||	f}	|�||
|	||||��q�dS)	zm
        Find tests for the given object and any contained objects, and
        add them to `tests`.
        zFinding tests in %sNr&z%s.%s�__test__z5DocTestFinder.find: __test__ keys must be strings: %rz`DocTestFinder.find: __test__ values must be strings, functions, methods, classes, or modules: %rz%s.__test__.%s)r��printr��	_get_testr�r7r8r�r��itemsZ	isroutineZunwraprrr�r0r9r:r�r��staticmethod�classmethod�__func__r)rjr�r�r+rCr�r1�seen�testZvalname�valr,r,r-r��sn
�
�������
�
��zDocTestFinder._findc		Cs�t|t�r|}nJz,|jdkr"d}n|j}t|t�s:t|�}Wnttfk
rXd}YnX|�||�}|jrt|stdS|dkr�d}n.t|dd�p�|j}|dd�dkr�|dd�}|j	�
|||||�S)zs
        Return a DocTest for the given object, if it defines a docstring;
        otherwise, return None.
        Nr�r�����.pycrr)r9r:r�rB�AttributeError�_find_linenor�r0r6r�r�)	rjr�r+rCr1r�r�r�rTr,r,r-rs,




�zDocTestFinder._get_testcCsd}t�|�rd}t�|�rb|dkr(dSt�dt|dd��}t|�D]\}}|�|�rF|}qbqFt�|�rr|j	}t�
|�r�|j}t�|�r�|j
}t�|�r�|j}t�|�r�t|dd�d}|dk	�r
|dkr�|dSt�d�}t|t|��D]}|�||�r�|Sq�dS)	z�
        Return a line number of the given object's docstring.  Note:
        this method assumes that the object has a docstring.
        Nr"z^\s*class\s*%s\br6�-�co_firstlinenor&z(^|.*:)\s*\w*("|\'))r7r8rr[r�r0r�r�Zismethodr
r��__code__Zistraceback�tb_frameZisframe�f_codeZiscode�ranger))rjr�r�r�Zpatr�r�r,r,r-r4s>


�








zDocTestFinder._find_lineno)NNNN)r6rprqr�rr�rwrr�rrr,r,r,r-r.s�

f?&c@s�eZdZdZdZddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Ze
�d�Zd dd�Zd!dd�Zd"dd�Zdd�ZdS)#ra3	
    A class used to run DocTest test cases, and accumulate statistics.
    The `run` method is used to process a single DocTest case.  It
    returns a tuple `(f, t)`, where `t` is the number of test cases
    tried, and `f` is the number of test cases that failed.

        >>> tests = DocTestFinder().find(_TestClass)
        >>> runner = DocTestRunner(verbose=False)
        >>> tests.sort(key = lambda test: test.name)
        >>> for test in tests:
        ...     print(test.name, '->', runner.run(test))
        _TestClass -> TestResults(failed=0, attempted=2)
        _TestClass.__init__ -> TestResults(failed=0, attempted=2)
        _TestClass.get -> TestResults(failed=0, attempted=2)
        _TestClass.square -> TestResults(failed=0, attempted=1)

    The `summarize` method prints a summary of all the test cases that
    have been run by the runner, and returns an aggregated `(f, t)`
    tuple:

        >>> runner.summarize(verbose=1)
        4 items passed all tests:
           2 tests in _TestClass
           2 tests in _TestClass.__init__
           2 tests in _TestClass.get
           1 tests in _TestClass.square
        7 tests in 4 items.
        7 passed and 0 failed.
        Test passed.
        TestResults(failed=0, attempted=7)

    The aggregated number of tried examples and failed examples is
    also available via the `tries` and `failures` attributes:

        >>> runner.tries
        7
        >>> runner.failures
        0

    The comparison between expected outputs and actual outputs is done
    by an `OutputChecker`.  This comparison may be customized with a
    number of option flags; see the documentation for `testmod` for
    more information.  If the option flags are insufficient, then the
    comparison may also be customized by passing a subclass of
    `OutputChecker` to the constructor.

    The test runner's display output can be controlled in two ways.
    First, an output function (`out) can be passed to
    `TestRunner.run`; this function will be called with strings that
    should be displayed.  It defaults to `sys.stdout.write`.  If
    capturing the output is not sufficient, then the display output
    can be also customized by subclassing DocTestRunner, and
    overriding the methods `report_start`, `report_success`,
    `report_unexpected_exception`, and `report_failure`.
    zF**********************************************************************Nr"cCsN|pt�|_|dkrdtjk}||_||_||_d|_d|_i|_	t
�|_dS)ac
        Create a new test runner.

        Optional keyword arg `checker` is the `OutputChecker` that
        should be used to compare the expected outputs and actual
        outputs of doctest examples.

        Optional keyword arg 'verbose' prints lots of stuff if true,
        only failures if false; by default, it's true iff '-v' is in
        sys.argv.

        Optional argument `optionflags` can be used to control how the
        test runner compares expected output to actual output, and how
        it displays failures.  See the documentation for `testmod` for
        more information.
        N�-vr")r�_checkerr>r�r��optionflags�original_optionflags�tries�failures�_name2ftrg�_fakeout)rj�checkerr�rr,r,r-r��s
zDocTestRunner.__init__cCsH|jrD|jr.|dt|j�dt|j��n|dt|j�d�dS)z�
        Report that the test runner is about to process the given
        example.  (Only displays a message if verbose=True)
        zTrying:
zExpecting:
zExpecting nothing
N)r�rxr_r�)rjr�r�exampler,r,r-�report_start�s���zDocTestRunner.report_startcCs|jr|d�dS)zt
        Report that the given example ran successfully.  (Only
        displays a message if verbose=True)
        zok
N)r��rjr�rr!ryr,r,r-�report_success�szDocTestRunner.report_successcCs&||�||�|j�|||j��dS)z7
        Report that the given example failed.
        N)�_failure_headerr�output_differencerr#r,r,r-�report_failure�s�zDocTestRunner.report_failurecCs$||�||�dtt|���dS)zO
        Report that the given example raised an unexpected exception.
        zException raised:
N)r%r_rf�rjr�rr!rdr,r,r-�report_unexpected_exception�s
�
�z)DocTestRunner.report_unexpected_exceptioncCs�|jg}|jrR|jdk	r4|jdk	r4|j|jd}nd}|�d|j||jf�n|�d|jd|jf�|�d�|j}|�t|��d�|�S)Nr&�?zFile "%s", line %s, in %szLine %s, in %szFailed example:rF)�DIVIDERrTr�r�r+r�r_r�)rjrr!r�r�r�r,r,r-r%�s�
zDocTestRunner._failure_headerc	Cs�d}}|j}td�\}}}	|jj}
t|j�D�]H\}}|jt@oH|dk}
||_|jr�|j��D],\}}|r||j|O_q`|j|M_q`|jt	@r�q.|d7}|
s�|�
|||�d|j|f}z,tt
|j|d|d�|j�|j��d}Wn4tk
�r�Ynt��}|j��YnX|j��}|j�d�|}|dk�r`|
|j||j��r�|}n|tj|dd��d}|
�s�|t|�7}|jdk�r�|	}nB|
|j||j��r�|}n*|jt@�r�|
t|j�t|�|j��r�|}||k�r�|
�sd|�||||�nf||k�r(|
�s|� ||||�|d7}n<||	k�rR|
�sH|�!||||�|d7}nd	�sdt"d
|f��|r.|jt#@r.�qzq.||_|�$|||�t%||�S)a�
        Run the examples in `test`.  Write the outcome of each example
        with one of the `DocTestRunner.report_*` methods, using the
        writer function `out`.  `compileflags` is the set of compiler
        flags that should be used to execute examples.  Return a tuple
        `(f, t)`, where `t` is the number of examples tried, and `f`
        is the number of examples that failed.  The examples are run
        in the namespace `test.globs`.
        r"rKr&z<doctest %s[%d]>ZsingleNr4rrFzunknown outcome)&rrr�check_outputr�r�rr�rrr"r+�execr�r�r1�debuggerr��KeyboardInterruptr>rdrrcrnrxra�format_exception_onlyrfr�rr�r$r'r)rur�_DocTestRunner__record_outcomer%)rjr�compileflagsr�rrr�SUCCESS�FAILUREZBOOMZcheck�
examplenumr!�quietZ
optionflagr
rTZ	exceptionryZoutcomer�r,r,r-Z__run�s�
�
��



�




�
zDocTestRunner.__runcCsL|j�|jd�\}}||||f|j|j<|j|7_|j|7_dS)z{
        Record the fact that the given DocTest (`test`) generated `f`
        failures out of `t` tried examples.
        r�N)rr/r+rr)rjrrW�t�f2�t2r,r,r-Z__record_outcome|szDocTestRunner.__record_outcomez.<doctest (?P<name>.+)\[(?P<examplenum>\d+)\]>$cCsV|j�|�}|rF|�d�|jjkrF|jjt|�d��}|jjdd�S|�	||�SdS)Nr+r5T��keepends)
�%_DocTestRunner__LINECACHE_FILENAME_REr�r�rr+r��intr��
splitlines�save_linecache_getlines)rjrT�module_globalsr�r!r,r,r-Z__patched_linecache_getlines�s
z*DocTestRunner.__patched_linecache_getlinesTc		s||_|dkrt|j�}tj�|dkrV�j��dks@���dkrH�j}n��fdd�}|jt_t�	�}t
j}t��|_
|j
��|j
jt
_tj|_|jt_tj}tjt_z|�|||�W�S�t_|t
_t�|�|jt_|t_|�r�|j��ddl}d|_XdS)aJ
        Run the examples in `test`, and display the results using the
        writer function `out`.

        The examples are run in the namespace `test.globs`.  If
        `clear_globs` is true (the default), then this namespace will
        be cleared after the test runs, to help with garbage
        collection.  If you would like to examine the namespace after
        the test completes, then use `clear_globs=False`.

        `compileflags` gives the set of flags that should be used by
        the Python compiler when running the examples.  If not
        specified, then it will default to the set of future-import
        flags that apply to `globs`.

        The output of each example is checked using
        `DocTestRunner.check_output`, and the results are formatted by
        the `DocTestRunner.report_*` methods.
        N�utf-8cs t|��d���}��|�dS)N�backslashreplace)r:�encode�write)r]�rNr�r,r-r��szDocTestRunner.run.<locals>.outr")rr3r1r>r�rN�lowerrDr�gettracer�r�r�r.�resetr�r�r?�*_DocTestRunner__patched_linecache_getlines�displayhook�__displayhook__�settrace�clear�builtins�_�_DocTestRunner__run)	rjrr2r��clear_globsZ
save_traceZsave_set_traceZsave_displayhookrNr,rEr-�run�s<





zDocTestRunner.runc
Cs�|dkr|j}g}g}g}d}}|j��D]b}|\}\}	}
|	|
ksHt�||
7}||	7}|
dkrl|�|�q,|	dkr�|�||
f�q,|�|�q,|r�|r�tt|�d�|��|D]}td|�q�|r�tt|�d�|��|D]\}}td||f�q�|�rFt|j�tt|�d�|��|D] \}\}	}
td|	|
|f��q$|�rrt|d	t|j�d
�t||d|d�|�r�td
|d�n|�r�td�t	||�S)a�
        Print a summary of all the test cases that have been run by
        this DocTestRunner, and return a tuple `(f, t)`, where `f` is
        the total number of failed examples, and `t` is the total
        number of tried examples.

        The optional `verbose` argument controls how detailed the
        summary is.  If the verbosity is not specified, then the
        DocTestRunner's verbosity is used.
        Nr"zitems had no tests:z   zitems passed all tests:z %3d tests in %szitems had failures:z %3d of %3d in %sztests inzitems.z
passed andzfailed.z***Test Failed***z	failures.zTest passed.)
r�rrrur�rr)r�r+r%)
rjr�ZnotestsZpassedZfailedZtotaltZtotalfr�r+rWr7�thingr�r,r,r-�	summarize�sR
zDocTestRunner.summarizecCsR|j}|j��D]<\}\}}||kr@||\}}||}||}||f||<qdSrl)rr)rjr��dr+rWr7r8r9r,r,r-�mergeszDocTestRunner.merge)NNr")N)NNT)N)r6rprqr�r+r�r"r$r'r)r%rPr1r[r�r<rIrRrTrVr,r,r,r-rhs9
$
}



I
9c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)ra_
    A class used to check the whether the actual output from a doctest
    example matches the expected output.  `OutputChecker` defines two
    methods: `check_output`, which compares a given pair of outputs,
    and returns true if they match; and `output_difference`, which
    returns a string describing the differences between two outputs.
    cCst|�dd�d�S)z=
        Convert string to hex-escaped ASCII string.
        �ASCIIrB)r:rC)rjr]r,r,r-�_toAscii(szOutputChecker._toAsciicCs�|�|�}|�|�}||kr dS|t@sH||fdkr8dS||fdkrHdS|t@s�t�dt�t�d|�}t�dd|�}||kr�dS|t@r�d�|�	��}d�|�	��}||kr�dS|t
@r�t||�r�dSdS)	a�
        Return True iff the actual output from an example (`got`)
        matches the expected output (`want`).  These strings are
        always considered to match if they are identical; but
        depending on what option flags the test runner is using,
        several non-exact match types are also possible.  See the
        documentation for `TestRunner` for more information about
        option flags.
        T)zTrue
z1
)zFalse
z0
z(?m)^%s\s*?$r�z(?m)^[^\S\n]+$rZF)rXrrr[r\�escape�BLANKLINE_MARKERrr�rtrr}�rjrxryrr,r,r-r,.s4

�
zOutputChecker.check_outputcCs<|ttBtB@sdS|t@r dS|�d�dko:|�d�dkS)NFTrFr4)r	r
rr�r[r,r,r-�_do_a_fancy_diffms��zOutputChecker._do_a_fancy_diffc
Cs8|j}|t@st�dt|�}|�|||�r�|jdd�}|jdd�}|t@rptj	||dd�}t
|�dd�}d}nf|t@r�tj||dd�}t
|�dd�}d}n8|t
@r�tjtjd	�}	t
|	�||��}d
}nds�td��d
|td�|��S|�r|�rdt|�t|�fS|�rdt|�S|�r0dt|�SdSdS)z�
        Return a string describing the differences between the
        expected output for a given example (`example`) and the actual
        output (`got`).  `optionflags` is the set of option flags used
        to compare `want` and `got`.
        z(?m)^[ ]*(?=
)Tr:r4)�nNz#unified diff with -expected +actualz-context diff with expected followed by actual)Zcharjunkzndiff with -expected +actualr"zBad diff optionzDifferences (%s):
r�zExpected:
%sGot:
%szExpected:
%sGot nothing
zExpected nothing
Got:
%szExpected nothing
Got nothing
)rxrr[r\rZr\r>r	�difflibZunified_diff�listr
Zcontext_diffrZDifferZIS_CHARACTER_JUNKZcomparerur_r�)
rjr!ryrrxr�Z	got_linesZdiffZkindZenginer,r,r-r&�s6zOutputChecker.output_differenceN)r6rprqr�rXr,r\r&r,r,r,r-r s
?c@s eZdZdZdd�Zdd�ZdS)rz�A DocTest example has failed in debugging mode.

    The exception instance has variables:

    - test: the DocTest object being run

    - example: the Example object that failed

    - got: the actual output
    cCs||_||_||_dSrl)rr!ry)rjrr!ryr,r,r-r��szDocTestFailure.__init__cCs
t|j�Srl�r:rr�r,r,r-�__str__�szDocTestFailure.__str__N�r6rprqr�r�rar,r,r,r-r�s
c@s eZdZdZdd�Zdd�ZdS)rz�A DocTest example has encountered an unexpected exception

    The exception instance has variables:

    - test: the DocTest object being run

    - example: the Example object that failed

    - exc_info: the exception info
    cCs||_||_||_dSrl)rr!rd)rjrr!rdr,r,r-r��szUnexpectedException.__init__cCs
t|j�Srlr`r�r,r,r-ra�szUnexpectedException.__str__Nrbr,r,r,r-r�s
c@s*eZdZdZd
dd�Zdd�Zdd	�ZdS)ra�	Run doc tests but raise an exception as soon as there is a failure.

       If an unexpected exception occurs, an UnexpectedException is raised.
       It contains the test, the example, and the original exception:

         >>> runner = DebugRunner(verbose=False)
         >>> test = DocTestParser().get_doctest('>>> raise KeyError\n42',
         ...                                    {}, 'foo', 'foo.py', 0)
         >>> try:
         ...     runner.run(test)
         ... except UnexpectedException as f:
         ...     failure = f

         >>> failure.test is test
         True

         >>> failure.example.want
         '42\n'

         >>> exc_info = failure.exc_info
         >>> raise exc_info[1] # Already has the traceback
         Traceback (most recent call last):
         ...
         KeyError

       We wrap the original exception to give the calling application
       access to the test and example information.

       If the output doesn't match, then a DocTestFailure is raised:

         >>> test = DocTestParser().get_doctest('''
         ...      >>> x = 1
         ...      >>> x
         ...      2
         ...      ''', {}, 'foo', 'foo.py', 0)

         >>> try:
         ...    runner.run(test)
         ... except DocTestFailure as f:
         ...    failure = f

       DocTestFailure objects provide access to the test:

         >>> failure.test is test
         True

       As well as to the example:

         >>> failure.example.want
         '2\n'

       and the actual output:

         >>> failure.got
         '1\n'

       If a failure or error occurs, the globals are left intact:

         >>> del test.globs['__builtins__']
         >>> test.globs
         {'x': 1}

         >>> test = DocTestParser().get_doctest('''
         ...      >>> x = 2
         ...      >>> raise KeyError
         ...      ''', {}, 'foo', 'foo.py', 0)

         >>> runner.run(test)
         Traceback (most recent call last):
         ...
         doctest.UnexpectedException: <DocTest foo from foo.py:0 (2 examples)>

         >>> del test.globs['__builtins__']
         >>> test.globs
         {'x': 2}

       But the globals are cleared if there is no error:

         >>> test = DocTestParser().get_doctest('''
         ...      >>> x = 2
         ...      ''', {}, 'foo', 'foo.py', 0)

         >>> runner.run(test)
         TestResults(failed=0, attempted=1)

         >>> test.globs
         {}

       NTcCs$t�||||d�}|r |j��|S)NF)rrRr1rM)rjrr2r�rQ�rr,r,r-rR3s
zDebugRunner.runcCst|||��dSrl)rr(r,r,r-r)9sz'DebugRunner.report_unexpected_exceptioncCst|||��dSrl)rr#r,r,r-r'<szDebugRunner.report_failure)NNT)r6rprqr�rRr)r'r,r,r,r-r�sZ
TFc	Cs�|dkrtj�d�}t�|�s,td|f��|dkr:|j}t|d�}	|rVt||d�}
nt	||d�}
|	j
||||d�D]}|
�|�qt|r�|
��t
dkr�|
a
n
t
�|
�t|
j|
j�S)a*
m=None, name=None, globs=None, verbose=None, report=True,
       optionflags=0, extraglobs=None, raise_on_error=False,
       exclude_empty=False

    Test examples in docstrings in functions and classes reachable
    from module m (or the current module if m is not supplied), starting
    with m.__doc__.

    Also test examples reachable from dict m.__test__ if it exists and is
    not None.  m.__test__ maps names to functions, classes and strings;
    function and class docstrings are tested even if the name is private;
    strings are tested directly, as if they were docstrings.

    Return (#failures, #tests).

    See help(doctest) for an overview.

    Optional keyword arg "name" gives the name of the module; by default
    use m.__name__.

    Optional keyword arg "globs" gives a dict to be used as the globals
    when executing examples; by default, use m.__dict__.  A copy of this
    dict is actually used for each docstring, so that each docstring's
    examples start with a clean slate.

    Optional keyword arg "extraglobs" gives a dictionary that should be
    merged into the globals that are used to execute examples.  By
    default, no extra globals are used.  This is new in 2.4.

    Optional keyword arg "verbose" prints lots of stuff if true, prints
    only failures if false; by default, it's true iff "-v" is in sys.argv.

    Optional keyword arg "report" prints a summary at the end when true,
    else prints nothing at the end.  In verbose mode, the summary is
    detailed, else very brief (in fact, empty if all tests passed).

    Optional keyword arg "optionflags" or's together module constants,
    and defaults to 0.  This is new in 2.3.  Possible values (see the
    docs for details):

        DONT_ACCEPT_TRUE_FOR_1
        DONT_ACCEPT_BLANKLINE
        NORMALIZE_WHITESPACE
        ELLIPSIS
        SKIP
        IGNORE_EXCEPTION_DETAIL
        REPORT_UDIFF
        REPORT_CDIFF
        REPORT_NDIFF
        REPORT_ONLY_FIRST_FAILURE

    Optional keyword arg "raise_on_error" raises an exception on the
    first unexpected exception or failure. This allows failures to be
    post-mortem debugged.

    Advanced tomfoolery:  testmod runs methods of a local instance of
    class doctest.Tester, then merges the results into (or creates)
    global Tester instance doctest.master.  Methods of doctest.master
    can be called directly too, if you want to do something unusual.
    Passing report=0 to testmod is especially useful then, to delay
    displaying a summary.  Invoke doctest.master.summarize(verbose)
    when you're done fiddling.
    Nr�ztestmod: module required; %r)r��r�r�r1r�)r>r?r/r7r8rBr6rrrrwrRrT�masterrVr%rr)r�r+r1r��reportrr��raise_on_errorr��finder�runnerrr,r,r-rHs$E


cCs�|r|std��t||||pd�\}}|dkr:tj�|�}|dkrHi}n|��}|dk	rb|�|�d|krrd|d<|	r�t||d�}
nt||d�}
|
�	||||d�}|
�
|�|r�|
��tdkr�|
an
t�
|
�t|
j|
j�S)a


    Test examples in the given file.  Return (#failures, #tests).

    Optional keyword arg "module_relative" specifies how filenames
    should be interpreted:

      - If "module_relative" is True (the default), then "filename"
         specifies a module-relative path.  By default, this path is
         relative to the calling module's directory; but if the
         "package" argument is specified, then it is relative to that
         package.  To ensure os-independence, "filename" should use
         "/" characters to separate path segments, and should not
         be an absolute path (i.e., it may not begin with "/").

      - If "module_relative" is False, then "filename" specifies an
        os-specific path.  The path may be absolute or relative (to
        the current working directory).

    Optional keyword arg "name" gives the name of the test; by default
    use the file's basename.

    Optional keyword argument "package" is a Python package or the
    name of a Python package whose directory should be used as the
    base directory for a module relative filename.  If no package is
    specified, then the calling module's directory is used as the base
    directory for module relative filenames.  It is an error to
    specify "package" if "module_relative" is False.

    Optional keyword arg "globs" gives a dict to be used as the globals
    when executing examples; by default, use {}.  A copy of this dict
    is actually used for each docstring, so that each docstring's
    examples start with a clean slate.

    Optional keyword arg "extraglobs" gives a dictionary that should be
    merged into the globals that are used to execute examples.  By
    default, no extra globals are used.

    Optional keyword arg "verbose" prints lots of stuff if true, prints
    only failures if false; by default, it's true iff "-v" is in sys.argv.

    Optional keyword arg "report" prints a summary at the end when true,
    else prints nothing at the end.  In verbose mode, the summary is
    detailed, else very brief (in fact, empty if all tests passed).

    Optional keyword arg "optionflags" or's together module constants,
    and defaults to 0.  Possible values (see the docs for details):

        DONT_ACCEPT_TRUE_FOR_1
        DONT_ACCEPT_BLANKLINE
        NORMALIZE_WHITESPACE
        ELLIPSIS
        SKIP
        IGNORE_EXCEPTION_DETAIL
        REPORT_UDIFF
        REPORT_CDIFF
        REPORT_NDIFF
        REPORT_ONLY_FIRST_FAILURE

    Optional keyword arg "raise_on_error" raises an exception on the
    first unexpected exception or failure. This allows failures to be
    post-mortem debugged.

    Optional keyword arg "parser" specifies a DocTestParser (or
    subclass) that should be used to extract tests from the files.

    Optional keyword arg "encoding" specifies an encoding that should
    be used to convert the file to unicode.

    Advanced tomfoolery:  testmod runs methods of a local instance of
    class doctest.Tester, then merges the results into (or creates)
    global Tester instance doctest.master.  Methods of doctest.master
    can be called directly too, if you want to do something unusual.
    Passing report=0 to testmod is especially useful then, to delay
    displaying a summary.  Invoke doctest.master.summarize(verbose)
    when you're done fiddling.
    �8Package may only be specified for module-relative paths.rANr6r�rdr")r�rXr�r��basenamer�r�rrr�rRrTrfrVr%rr)rTrVr+rUr1r�rgrr�rhr�rN�textrjrr,r,r-r�s2R�


�NoNamec	Cs@t|dd�}t||d�}|j|||d�D]}|j||d�q(dS)ar
    Test examples in the given object's docstring (`f`), using `globs`
    as globals.  Optional argument `name` is used in failure messages.
    If the optional argument `verbose` is true, then generate output
    even if there are no failures.

    `compileflags` gives the set of flags that should be used by the
    Python compiler when running the examples.  If not specified, then
    it will default to the set of future-import flags that apply to
    `globs`.

    Optional keyword arg `optionflags` specifies options for the
    testing and output.  See the documentation for `testmod` for more
    information.
    F)r�r�rd)r1)r2N)rrrwrR)	rWr1r�r+r2rrirjrr,r,r-r+scCs"|t@|krtd|��t}|a|S)a?Sets the unittest option flags.

    The old flag is returned so that a runner could restore the old
    value if it wished to:

      >>> import doctest
      >>> old = doctest._unittest_reportflags
      >>> doctest.set_unittest_reportflags(REPORT_NDIFF |
      ...                          REPORT_ONLY_FIRST_FAILURE) == old
      True

      >>> doctest._unittest_reportflags == (REPORT_NDIFF |
      ...                                   REPORT_ONLY_FIRST_FAILURE)
      True

    Only reporting flags can be set:

      >>> doctest.set_unittest_reportflags(ELLIPSIS)
      Traceback (most recent call last):
      ...
      ValueError: ('Only reporting flags allowed', 8)

      >>> doctest.set_unittest_reportflags(old) == (REPORT_NDIFF |
      ...                                   REPORT_ONLY_FIRST_FAILURE)
      True
    zOnly reporting flags allowed)r
r��_unittest_reportflags)r2�oldr,r,r-rHs

c@sleZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Ze
jZdd�ZdS)�DocTestCaser"NcCs.tj�|�||_||_||_||_||_dSrl)�unittest�TestCaser��_dt_optionflags�_dt_checker�_dt_test�	_dt_setUp�_dt_tearDown)rjrr�setUp�tearDownr r,r,r-r�nszDocTestCase.__init__cCs|j}|jdk	r|�|�dSrl)rvrw�rjrr,r,r-ryxs
zDocTestCase.setUpcCs(|j}|jdk	r|�|�|j��dSrl)rvrxr1rMr{r,r,r-rz~s

zDocTestCase.tearDowncCs~|j}tj}t�}|j}|t@s(|tO}t||jdd�}z d|_	|j
||jdd�\}}W5|t_X|rz|�|�
|�����dS)NF�rr r�zF----------------------------------------------------------------------)r�rQ)rvr>r�r#rtr
rorrur+rRrDZfailureException�format_failurerc)rjrrp�newrrjrrr,r,r-�runTest�s(��zDocTestCase.runTestcCsP|j}|jdkrd}n
d|j}d�|j�d�dd��}d|j|j|||fS)Nzunknown line numberz%sr�rrz:Failed doctest test for %s
  File "%s", line %s, in %s

%s)rvr�r�r+rtrT)rj�errrr�Zlnamer,r,r-r}�s

�zDocTestCase.format_failurecCs6|��t|j|jdd�}|j|jdd�|��dS)a�Run the test case without results and without catching exceptions

           The unit test framework includes a debug method on test cases
           and test suites to support post-mortem debugging.  The test code
           is run in such a way that errors are not caught.  This way a
           caller can catch the errors and initiate post-mortem debugging.

           The DocTestCase provides a debug method that raises
           UnexpectedException errors if there is an unexpected
           exception:

             >>> test = DocTestParser().get_doctest('>>> raise KeyError\n42',
             ...                {}, 'foo', 'foo.py', 0)
             >>> case = DocTestCase(test)
             >>> try:
             ...     case.debug()
             ... except UnexpectedException as f:
             ...     failure = f

           The UnexpectedException contains the test, the example, and
           the original exception:

             >>> failure.test is test
             True

             >>> failure.example.want
             '42\n'

             >>> exc_info = failure.exc_info
             >>> raise exc_info[1] # Already has the traceback
             Traceback (most recent call last):
             ...
             KeyError

           If the output doesn't match, then a DocTestFailure is raised:

             >>> test = DocTestParser().get_doctest('''
             ...      >>> x = 1
             ...      >>> x
             ...      2
             ...      ''', {}, 'foo', 'foo.py', 0)
             >>> case = DocTestCase(test)

             >>> try:
             ...    case.debug()
             ... except DocTestFailure as f:
             ...    failure = f

           DocTestFailure objects provide access to the test:

             >>> failure.test is test
             True

           As well as to the example:

             >>> failure.example.want
             '2\n'

           and the actual output:

             >>> failure.got
             '1\n'

           Fr|)rQN)ryrrtrurRrvrz)rjrjr,r,r-r!�sB�zDocTestCase.debugcCs|jjSrl�rvr+r�r,r,r-r��szDocTestCase.idcCsPt|�t|�k	rtS|j|jkoN|j|jkoN|j|jkoN|j|jkoN|j|jkSrl)r�r�rvrtrwrxrur�r,r,r-r��s
�
�
�
�zDocTestCase.__eq__cCst|j|j|j|jf�Srl)r�rtrwrxrur�r,r,r-r��s�zDocTestCase.__hash__cCs,|jj�d�}d|dd�|dd��fS)Nr�z%s (%s)rr)rvr+rtr�)rjr+r,r,r-r�	szDocTestCase.__repr__cCsd|jjS)Nz	Doctest: r�r�r,r,r-�shortDescription		szDocTestCase.shortDescription)r"NNN)r6rprqr�ryrzrr}r!r�r�r�r�rrar�r,r,r,r-rqls�

H
rqc@s0eZdZdd�Zdd�Zdd�Zdd�ZeZd	S)
�SkipDocTestCasecCs||_t�|d�dSrl)rCrqr�)rjrCr,r,r-r�
	szSkipDocTestCase.__init__cCs|�d�dS)Nz-DocTestSuite will not work with -O2 and above)ZskipTestr�r,r,r-ry	szSkipDocTestCase.setUpcCsdSrlr,r�r,r,r-�	test_skip	szSkipDocTestCase.test_skipcCsd|jjS)NzSkipping tests from %s)rCr6r�r,r,r-r�	sz SkipDocTestCase.shortDescriptionN)r6rprqr�ryr�r�rar,r,r,r-r�	s
r�c@seZdZdd�ZdS)�
_DocTestSuitecCsdSrlr,)rj�indexr,r,r-�_removeTestAtIndex	sz _DocTestSuite._removeTestAtIndexN)r6rprqr�r,r,r,r-r�	sr�c	Ks�|dkrt�}t|�}|j|||d�}|sNtjjdkrNt�}|�t|��|S|�	�t�}|D]T}t
|j�dkrtq`|js�|j
}|dd�dkr�|dd�}||_|�t|f|��q`|S)a
    Convert doctest tests for a module to a unittest test suite.

    This converts each documentation string in a module that
    contains doctest tests to a unittest test case.  If any of the
    tests in a doc string fail, then the test case fails.  An exception
    is raised showing the name of the file containing the test and a
    (sometimes approximate) line number.

    The `module` argument provides the module to be tested.  The argument
    can be either a module or a module name.

    If no argument is given, the calling module is used.

    A number of options may be provided as keyword arguments:

    setUp
      A set-up function.  This is called before running the
      tests in each file. The setUp function will be passed a DocTest
      object.  The setUp function can access the test globals as the
      globs attribute of the test passed.

    tearDown
      A tear-down function.  This is called after running the
      tests in each file.  The tearDown function will be passed a DocTest
      object.  The tearDown function can access the test globals as the
      globs attribute of the test passed.

    globs
      A dictionary containing initial global variables for the tests.

    optionflags
       A set of doctest option flags expressed as an integer.
    Nrer4r"rrrr)rrDrwr>r2�optimizer��addTestr�r�r)r�rTr�rq)	rCr1r�Ztest_finderr�r��suiterrTr,r,r-r#	s(%c@s$eZdZdd�Zdd�Zdd�ZdS)�DocFileCasecCsd�|jj�d��S)NrOr�)r�rvr+rtr�r,r,r-r�e	szDocFileCase.idcCs|jjSrl)rvrTr�r,r,r-r�h	szDocFileCase.__repr__cCsd|jj|jj|fS)Nz2Failed doctest test for %s
  File "%s", line 0

%s)rvr+rT)rjr�r,r,r-r}k	s�zDocFileCase.format_failureN)r6rprqr�r�r}r,r,r,r-r�c	sr�c
Ksv|dkri}n|��}|r&|s&td��t||||p4d�\}}d|krL||d<tj�|�}|�||||d�}	t|	f|�S)NrkrAr�r")r�r�rXr�r�rlr�r�)
r�rVrUr1r�rNr��docr+rr,r,r-�DocFileTestp	s�r�cOsDt�}|�dd�r$t|�d��|d<|D]}|�t|f|��q(|S)a�A unittest suite for one or more doctest files.

    The path to each doctest file is given as a string; the
    interpretation of that string depends on the keyword argument
    "module_relative".

    A number of options may be provided as keyword arguments:

    module_relative
      If "module_relative" is True, then the given file paths are
      interpreted as os-independent module-relative paths.  By
      default, these paths are relative to the calling module's
      directory; but if the "package" argument is specified, then
      they are relative to that package.  To ensure os-independence,
      "filename" should use "/" characters to separate path
      segments, and may not be an absolute path (i.e., it may not
      begin with "/").

      If "module_relative" is False, then the given file paths are
      interpreted as os-specific paths.  These paths may be absolute
      or relative (to the current working directory).

    package
      A Python package or the name of a Python package whose directory
      should be used as the base directory for module relative paths.
      If "package" is not specified, then the calling module's
      directory is used as the base directory for module relative
      filenames.  It is an error to specify "package" if
      "module_relative" is False.

    setUp
      A set-up function.  This is called before running the
      tests in each file. The setUp function will be passed a DocTest
      object.  The setUp function can access the test globals as the
      globs attribute of the test passed.

    tearDown
      A tear-down function.  This is called after running the
      tests in each file.  The tearDown function will be passed a DocTest
      object.  The tearDown function can access the test globals as the
      globs attribute of the test passed.

    globs
      A dictionary containing initial global variables for the tests.

    optionflags
      A set of doctest option flags expressed as an integer.

    parser
      A DocTestParser (or subclass) that should be used to extract
      tests from the files.

    encoding
      An encoding that will be used to convert the files to unicode.
    rVTrU)r�r/rDr�r�)�paths�kwr�r�r,r,r-r�	s8cCs�g}t��|�D]x}t|t�rh|�|jdd��|j}|r�|�d�|dd�|�d�dd�D�7}q|dd�|�d�dd�D�7}q|r�|ddkr�|��q�|r�|d	dkr�|�d	�q�d�	|�dS)
awExtract script from text with examples.

       Converts text with examples to a Python script.  Example input is
       converted to regular code.  Example output and all other words
       are converted to comments:

       >>> text = '''
       ...       Here are examples of simple math.
       ...
       ...           Python has super accurate integer addition
       ...
       ...           >>> 2 + 2
       ...           5
       ...
       ...           And very friendly error messages:
       ...
       ...           >>> 1/0
       ...           To Infinity
       ...           And
       ...           Beyond
       ...
       ...           You can use logic if you want:
       ...
       ...           >>> if 0:
       ...           ...    blah
       ...           ...    blah
       ...           ...
       ...
       ...           Ho hum
       ...           '''

       >>> print(script_from_examples(text))
       # Here are examples of simple math.
       #
       #     Python has super accurate integer addition
       #
       2 + 2
       # Expected:
       ## 5
       #
       #     And very friendly error messages:
       #
       1/0
       # Expected:
       ## To Infinity
       ## And
       ## Beyond
       #
       #     You can use logic if you want:
       #
       if 0:
          blah
          blah
       #
       #     Ho hum
       <BLANKLINE>
       Nrrz# Expected:cSsg|]}d|�qS)z## r,r�r,r,r-r�
sz(script_from_examples.<locals>.<listcomp>rFcSsg|]}t|��qSr,)r�r�r,r,r-r�
s�r~r")
rr�r9rr�r�rxrt�popr�)r]r�Zpiecerxr,r,r-r�	s :

"�

csJt|�}t��|�}�fdd�|D�}|s4t�d��|d}t|j�}|S)aExtract the test sources from a doctest docstring as a script.

    Provide the module (or dotted name of the module) containing the
    test to be debugged and the name (within the module) of the object
    with the doc string with tests to be debugged.
    csg|]}|j�kr|�qSr,r*)r�r7r*r,r-r�.
s
ztestsource.<locals>.<listcomp>znot found in testsr")rDrrwr�rr�)rCr+r�r�testsrcr,r*r-r%
s

cCst|�}t|||�dS)z4Debug a single doctest docstring, in argument `src`'N)r�debug_script)�src�pmr1r�r,r,r-r 5
scCs�ddl}|r|��}ni}|rvzt|||�Wq�tt��d�|jdd�}|��|�dt��d�Yq�Xn|jdd��	d|||�dS)z7Debug a test script.  `src` is the script, as a string.r"Nr&T)r�r4zexec(%r))
r�r�r-rr>rdr�rHZinteractionrR)r�r�r1r��pr,r,r-r�:
s
r�cCs$t|�}t||�}t|||j�dS)z�Debug a single doctest docstring.

    Provide the module (or dotted name of the module) containing the
    test to be debugged and the name (within the module) of the object
    with the docstring with tests to be debugged.
    N)rDrr�r�)rCr+r�r�r,r,r-r!N
s
c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�
_TestClassz�
    A pointless class, for sanity-checking of docstring testing.

    Methods:
        square()
        get()

    >>> _TestClass(13).get() + _TestClass(-12).get()
    1
    >>> hex(_TestClass(13).square().get())
    '0xa9'
    cCs
||_dS)z�val -> _TestClass object with associated value val.

        >>> t = _TestClass(123)
        >>> print(t.get())
        123
        N�r
)rjr
r,r,r-r�j
sz_TestClass.__init__cCs|jd|_|S)zosquare() -> square TestClass's associated value

        >>> _TestClass(13).square().get()
        169
        r4r�r�r,r,r-�squaret
sz_TestClass.squarecCs|jS)z~get() -> return TestClass's associated value.

        >>> x = _TestClass(-42)
        >>> print(x.get())
        -42
        r�r�r,r,r-r/~
sz_TestClass.getN)r6rprqr�r�r�r/r,r,r,r-r�\
s


r�z�
                      Example of a string object, searched as-is.
                      >>> x = 1; y = 2
                      >>> x + y, x * y
                      (3, 2)
                      a�
                                    In 2.2, boolean expressions displayed
                                    0 or 1.  By default, we still accept
                                    them.  This can be disabled by passing
                                    DONT_ACCEPT_TRUE_FOR_1 to the new
                                    optionflags argument.
                                    >>> 4 == 4
                                    1
                                    >>> 4 == 4
                                    True
                                    >>> 4 > 4
                                    0
                                    >>> 4 > 4
                                    False
                                    z�
                Blank lines can be marked with <BLANKLINE>:
                    >>> print('foo\n\nbar\n')
                    foo
                    <BLANKLINE>
                    bar
                    <BLANKLINE>
            z�
                If the ellipsis flag is used, then '...' can be used to
                elide substrings in the desired output:
                    >>> print(list(range(1000))) #doctest: +ELLIPSIS
                    [0, 1, 2, ..., 999]
            a�
                If the whitespace normalization flag is used, then
                differences in whitespace are ignored.
                    >>> print(list(range(30))) #doctest: +NORMALIZE_WHITESPACE
                    [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
                     15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
                     27, 28, 29]
            )r�r�zbool-int equivalencezblank linesZellipsiszwhitespace normalizationcCs"ddl}|jdd�}|jdddddd	�|jd
ddt��gd
d�|jddddd�|jdddd�|��}|j}|j}d}|jD]}|t|O}q�|j	r�|t
O}|D]v}|�d�r�tj
�|�\}}tj
�d|�t|dd��}	tj
d=t|	||d�\}
}nt|d||d�\}
}|
r�dSq�dS)Nr"zdoctest runner)Zdescriptionrz	--verbose�
store_trueFz'print very verbose output for all tests)�action�default�helpz-oz--optionr�zqspecify a doctest option flag to apply to the test run; may be specified more than once to apply multiple options)r��choicesr�r�z-fz--fail-fastzystop running tests after first failure (this is a shorthand for -o FAIL_FAST, and is in addition to any other -o options))r�r�r`r�z file containing the tests to run)�nargsr�z.py���rd)rVr�rr&)�argparse�ArgumentParser�add_argumentr'�keys�
parse_argsr`r�r�Z	fail_fastrrir�r�rtr>�insertr;rr)r�r�r�Z	testfilesr�r�r�rT�dirnamer�rrOr,r,r-�_test�
sL�
�
��

�
r�r�)r4)rY)	NNNNTr"NFF)FrnNr")NNNN)FN)FN)F)Sr�Z
__docformat__�__all__r.r^r7r�r�r�r[r>rarr�ior#�collectionsr$r%r'rrrrrrrrr	r
rrrr
rZrsr3rDrJrXr_rfrgr}r�r�r�r�rOrrrrrr�	Exceptionrrrrfrrrrorrsrqr�Z	TestSuiter�rr�r�rrrr r�r!r�rr�r6�exitr,r,r,r-�<module>	sF'�-
���������

1%.DKl<;n�
h�
{�
$!
@
�
IR


,	�3-
__pycache__/weakref.cpython-38.opt-2.pyc000064400000037516151153537610014013 0ustar00U

e5d�S�
@s�ddlmZmZmZmZmZmZmZmZddl	m
Z
mZddlZddl
Z
ddlZeefZdddddd	d
ddd
dddg
ZGdd�de�ZGdd
�d
ej�ZGdd�de�ZGdd�dej�ZGdd�d�ZdS)�)�getweakrefcount�getweakrefs�ref�proxy�CallableProxyType�	ProxyType�
ReferenceType�_remove_dead_weakref)�WeakSet�_IterationGuardNrrrr�WeakKeyDictionaryrrr�
ProxyTypes�WeakValueDictionaryr
�
WeakMethod�finalizecs@eZdZdZddd�Z�fdd�Zdd�Zd	d
�Zej	Z	�Z
S)r)�	_func_ref�
_meth_type�_alive�__weakref__Ncs~z|j}|j}Wn(tk
r8td�t|���d�YnX��fdd�}t�|||�}t||�|_t|�|_	d|_
t|��|S)Nz)argument should be a bound method, not {}cs&��}|jr"d|_�dk	r"�|�dS�NF)r)�arg�self��callbackZself_wr��/usr/lib64/python3.8/weakref.py�_cb3s
zWeakMethod.__new__.<locals>._cbT)�__self__�__func__�AttributeError�	TypeError�format�typer�__new__rrr)�clsZmethr�obj�funcrrrrrr#,s 
��
zWeakMethod.__new__cs2t���}|��}|dks"|dkr&dS|�||�S�N)�super�__call__rr)rr%r&��	__class__rrr)Bs

zWeakMethod.__call__cCs:t|t�r6|jr|js||kSt�||�o4|j|jkSdSr)�
isinstancerrr�__eq__r�r�otherrrrr-Is

zWeakMethod.__eq__cCs:t|t�r6|jr|js||k	St�||�p4|j|jkSdS�NT)r,rrr�__ne__rr.rrrr1Ps

zWeakMethod.__ne__)N)�__name__�
__module__�__qualname__�	__slots__r#r)r-r1r�__hash__�
__classcell__rrr*rr$s
c@s�eZdZd+dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�ZeZdd�Z
d,dd�Zdd�Zdd�ZeZdd�Zdd �Zd!d"�Zd#d$�Zd-d%d&�Zd.d'd(�Zd)d*�ZdS)/rrcKs>t|�tfdd�}||_g|_t�|_i|_|j|f|�dS)NcSs6|�}|dk	r2|jr$|j�|j�n||j|j�dSr')�
_iterating�_pending_removals�append�key�data)�wr�selfrefZ_atomic_removalrrrr�removegs
z,WeakValueDictionary.__init__.<locals>.remove)rr	�_remover9�setr8r<�update)rr/�kwr?rrr�__init__fs	zWeakValueDictionary.__init__cCs(|j}|j}|r$|��}t||�qdSr')r9r<�popr	)r�l�dr;rrr�_commit_removalsws
z$WeakValueDictionary._commit_removalscCs4|jr|��|j|�}|dkr,t|��n|SdSr'�r9rHr<�KeyError�rr;�orrr�__getitem__�s
zWeakValueDictionary.__getitem__cCs|jr|��|j|=dSr')r9rHr<�rr;rrr�__delitem__�szWeakValueDictionary.__delitem__cCs|jr|��t|j�Sr')r9rH�lenr<�rrrr�__len__�szWeakValueDictionary.__len__cCs>|jr|��z|j|�}Wntk
r4YdSX|dk	SrrIrKrrr�__contains__�sz WeakValueDictionary.__contains__cCsd|jjt|�fS�Nz<%s at %#x>�r+r2�idrQrrr�__repr__�szWeakValueDictionary.__repr__cCs&|jr|��t||j|�|j|<dSr')r9rH�KeyedRefr@r<�rr;�valuerrr�__setitem__�szWeakValueDictionary.__setitem__c	CsV|jr|��t�}t|��0|j��D]\}}|�}|dk	r(|||<q(W5QRX|Sr')r9rHrrr<�items)r�newr;r=rLrrr�copy�s
zWeakValueDictionary.copyc	Csjddlm}|jr|��|��}t|��6|j��D]$\}}|�}|dk	r6|||||�<q6W5QRX|S�Nr)�deepcopy)r^r`r9rHr+rr<r\)r�memor`r]r;r=rLrrr�__deepcopy__�s
z WeakValueDictionary.__deepcopy__NcCsP|jr|��z|j|}Wntk
r4|YSX|�}|dkrH|S|SdSr'rI)rr;�defaultr=rLrrr�get�s
zWeakValueDictionary.getc	csR|jr|��t|��2|j��D] \}}|�}|dk	r"||fVq"W5QRXdSr'�r9rHrr<r\)r�kr=�vrrrr\�s
zWeakValueDictionary.itemsc	csJ|jr|��t|��*|j��D]\}}|�dk	r"|Vq"W5QRXdSr're)rrfr=rrr�keys�s

zWeakValueDictionary.keysc	cs6|jr|��t|��|j��EdHW5QRXdSr'�r9rHrr<�valuesrQrrr�
itervaluerefs�s

z!WeakValueDictionary.itervaluerefsc	csJ|jr|��t|��*|j��D]}|�}|dk	r"|Vq"W5QRXdSr'ri�rr=r%rrrrj�s
zWeakValueDictionary.valuescCs8|jr|��|j��\}}|�}|dk	r||fSqdSr')r9rHr<�popitem)rr;r=rLrrrrm�szWeakValueDictionary.popitemcGs`|jr|��z|j�|��}Wntk
r8d}YnX|dkrX|rN|dSt|��n|SdS)Nr)r9rHr<rErJ)rr;�argsrLrrrrEs

zWeakValueDictionary.popcCs`z|j|�}Wntk
r(d}YnX|dkrX|jr@|��t||j|�|j|<|S|SdSr')r<rJr9rHrXr@)rr;rcrLrrr�
setdefaults
zWeakValueDictionary.setdefaultcKsz|jr|��|j}|dk	rRt|d�s.t|�}|��D]\}}t||j|�||<q6|��D]\}}t||j|�||<qZdS�Nr\)r9rHr<�hasattr�dictr\rXr@)rr/�kwargsrGr;rLrrrrBs
zWeakValueDictionary.updatecCs|jr|��t|j���Sr')r9rH�listr<rjrQrrr�	valuerefs(s
zWeakValueDictionary.valuerefs)r)N)N)N)r2r3r4rDrHrMrOrRrSrWr[r^�__copy__rbrdr\rh�__iter__rkrjrmrErorBrurrrrrZs,
			
			

cs(eZdZdZdd�Z�fdd�Z�ZS)rX�r;cCst�|||�}||_|Sr')rr#r;)r"�obrr;rrrrr#CszKeyedRef.__new__cst��||�dSr')r(rD)rryrr;r*rrrDHszKeyedRef.__init__)r2r3r4r5r#rDr7rrr*rrX7s
rXc@s�eZdZd*dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�ZeZdd�Z
d+dd�Zdd�Zdd�Zdd�ZeZdd�Zd d!�Zd"d#�Zd$d%�Zd,d&d'�Zd-d(d)�ZdS).rNcCsFi|_t|�fdd�}||_g|_t�|_d|_|dk	rB|�|�dS)NcSs.|�}|dk	r*|jr"|j�|�n|j|=dSr')r8r9r:r<)rfr>rrrrr?Ys
z*WeakKeyDictionary.__init__.<locals>.removeF)r<rr@r9rAr8�
_dirty_lenrB)rrrr?rrrrDWszWeakKeyDictionary.__init__cCs:|j}|j}|r6z||��=Wqtk
r2YqXqdSr')r9r<rErJ)rrFrGrrrrHhsz"WeakKeyDictionary._commit_removalscs&|j��fdd�|jD�|_d|_dS)Ncsg|]}|�kr|�qSrr)�.0rf�rGrr�
<listcomp>wsz5WeakKeyDictionary._scrub_removals.<locals>.<listcomp>F)r<r9rzrQrr|r�_scrub_removalsusz!WeakKeyDictionary._scrub_removalscCsd|_|jt|�=dSr0)rzr<rrNrrrrOzszWeakKeyDictionary.__delitem__cCs|jt|�Sr')r<rrNrrrrM~szWeakKeyDictionary.__getitem__cCs(|jr|jr|��t|j�t|j�Sr')rzr9r~rPr<rQrrrrR�szWeakKeyDictionary.__len__cCsd|jjt|�fSrTrUrQrrrrW�szWeakKeyDictionary.__repr__cCs||jt||j�<dSr')r<rr@rYrrrr[�szWeakKeyDictionary.__setitem__c	CsHt�}t|��0|j��D]\}}|�}|dk	r|||<qW5QRX|Sr')rrr<r\)rr]r;rZrLrrrr^�s
zWeakKeyDictionary.copyc	Cs\ddlm}|��}t|��6|j��D]$\}}|�}|dk	r(|||�||<q(W5QRX|Sr_)r^r`r+rr<r\)rrar`r]r;rZrLrrrrb�s
zWeakKeyDictionary.__deepcopy__cCs|j�t|�|�Sr')r<rdr�rr;rcrrrrd�szWeakKeyDictionary.getcCs.zt|�}Wntk
r"YdSX||jkSr)rr r<)rr;r=rrrrS�s
zWeakKeyDictionary.__contains__c	csDt|��2|j��D] \}}|�}|dk	r||fVqW5QRXdSr'�rr<r\)rr=rZr;rrrr\�s

zWeakKeyDictionary.itemsc	cs8t|��&|jD]}|�}|dk	r|VqW5QRXdSr')rr<rlrrrrh�s


zWeakKeyDictionary.keysc	cs<t|��*|j��D]\}}|�dk	r|VqW5QRXdSr'r�)rr=rZrrrrj�s

zWeakKeyDictionary.valuescCs
t|j�Sr')rtr<rQrrr�keyrefs�s
zWeakKeyDictionary.keyrefscCs0d|_|j��\}}|�}|dk	r||fSqdSr0)rzr<rm)rr;rZrLrrrrm�s
zWeakKeyDictionary.popitemcGsd|_|jjt|�f|��Sr0)rzr<rEr)rr;rnrrrrE�szWeakKeyDictionary.popcCs|j�t||j�|�Sr')r<rorr@rrrrro�szWeakKeyDictionary.setdefaultcKs\|j}|dk	rFt|d�s$ti�|�}|��D]\}}||t||j�<q,t|�rX|�|�dSrp)r<rqr"r\rr@rPrB)rrrrsrGr;rZrrrrB�s
zWeakKeyDictionary.update)N)N)N)N)r2r3r4rDrHr~rOrMrRrWr[r^rvrbrdrSr\rhrwrjr�rmrErorBrrrrrLs,

	


c@s�eZdZdZiZdZe��ZdZ	dZ
Gdd�d�Zdd�Zde_
dd	d
�Zdd�Zd
d�Zedd��Zedd��Zejdd��Zdd�Zedd��Zedd��ZdS)rrFc@seZdZdZdS)zfinalize._Info)�weakrefr&rnrs�atexit�indexN)r2r3r4r5rrrr�_Infosr�cOs>t|�dkr|^}}}}n�|s(td��n�d|krDtdt|�d��|�d�}t|�dkr~|^}}}ddl}|jdtdd	�nFd
|kr�tdt|�d��|�d
�}|^}}ddl}|jdtdd	�t|�}|js�ddl}|�	|j
�dt_|��}t
||�|_||_||_|�pd|_d|_t|j�|_||j|<dt_dS)
N�z<descriptor '__init__' of 'finalize' object needs an argumentr&z9finalize expected at least 2 positional arguments, got %d��rz0Passing 'func' as keyword argument is deprecated)�
stacklevelr%z/Passing 'obj' as keyword argument is deprecatedT)rPr rE�warnings�warn�DeprecationWarning�tuple�_registered_with_atexitr��register�	_exitfuncrr�rr�r&rnrs�next�_index_iterr��	_registry�_dirty)rnrsrr%r&r�r��inforrrrDsR

�

�
�
�
zfinalize.__init__z&($self, obj, func, /, *args, **kwargs)NcCs0|j�|d�}|r,|js,|j|j|jp(i�SdSr')r�rE�	_shutdownr&rnrs)r�_r�rrrr)1s
zfinalize.__call__cCsH|j�|�}|o|��}|dk	rD|j�|d�rD||j|j|jp@ifSdSr')r�rdr�rEr&rnrs�rr�r%rrr�detach8szfinalize.detachcCs:|j�|�}|o|��}|dk	r6||j|j|jp2ifSdSr')r�rdr�r&rnrsr�rrr�peek@sz
finalize.peekcCs
||jkSr')r�rQrrr�aliveHszfinalize.alivecCs|j�|�}t|�o|jSr'�r�rd�boolr�)rr�rrrr�Mszfinalize.atexitcCs|j�|�}|rt|�|_dSr'r�)rrZr�rrrr�SscCs^|j�|�}|o|��}|dkr6dt|�jt|�fSdt|�jt|�t|�jt|�fSdS)Nz<%s object at %#x; dead>z!<%s object at %#x; for %r at %#x>)r�rdr�r"r2rVr�rrrrWYs�zfinalize.__repr__cCs2dd�|j��D�}|jdd�d�dd�|D�S)NcSsg|]\}}|jr||f�qSr)r��r{�f�irrrr}esz-finalize._select_for_exit.<locals>.<listcomp>cSs
|djS)Nr�)r�)�itemrrr�<lambda>f�z+finalize._select_for_exit.<locals>.<lambda>rxcSsg|]\}}|�qSrrr�rrrr}gs)r�r\�sort)r$�Lrrr�_select_for_exitbszfinalize._select_for_exitcCs�d}z�|jr�ddl}|��r(d}|��d}|dks:tjrH|��}dt_|sNq�|�	�}z
|�Wq,t
k
r�tjt�
��Yq,Xq,W5dt_|r�|��XdS)NFTr)rr�Zenabler��gcZ	isenabledZdisabler�r�rE�	Exception�sys�
excepthook�exc_info)r$Zreenable_gcr�Zpendingr�rrrr�is,
zfinalize._exitfunc)N)r2r3r4r5r�r��	itertools�countr�r�r�r�rD�__text_signature__r)r�r��propertyr�r��setterrW�classmethodr�r�rrrrr�s.*



	
)�_weakrefrrrrrrrr	Z_weakrefsetr
r�_collections_abcr�r�r
�__all__r�MutableMappingrrXrrrrrr�<module>s.(
�6^__pycache__/csv.cpython-38.opt-2.pyc000064400000023221151153537610013146 0ustar00U

e5d?�@s<ddlZddlmZmZmZmZmZmZmZm	Z	m
Z
mZmZm
Z
mZmZddlmZddlmZddddd	d
ddd
ddddddddddddgZGdd
�d
�ZGdd�de�Zede�Gdd
�d
e�Zede�Gdd�de�Zede�Gd d�d�ZGd!d�d�ZzeWnek
�r(eZYnXGd"d�d�ZdS)#�N)�Error�__version__�writer�reader�register_dialect�unregister_dialect�get_dialect�
list_dialects�field_size_limit�
QUOTE_MINIMAL�	QUOTE_ALL�QUOTE_NONNUMERIC�
QUOTE_NONE�__doc__)�Dialect)�StringIOrrr
rrrr�excel�	excel_tabr
rrrrr	�Snifferrr�
DictReader�
DictWriter�unix_dialectc@s@eZdZdZdZdZdZdZdZdZ	dZ
dZdd�Zdd�Z
dS)r�FNcCs|jtkrd|_|��dS)NT)�	__class__r�_valid�	_validate��self�r�/usr/lib64/python3.8/csv.py�__init__*s
zDialect.__init__c
Cs@zt|�Wn.tk
r:}ztt|���W5d}~XYnXdS�N)�_Dialect�	TypeErrorr�str)r�errrr/szDialect._validate)�__name__�
__module__�__qualname__�_namer�	delimiter�	quotecharZ
escapechar�doublequote�skipinitialspace�lineterminator�quotingr rrrrrrsc@s$eZdZdZdZdZdZdZeZ	dS)r�,�"TF�
N)
r&r'r(r*r+r,r-r.rr/rrrrr6sc@seZdZdZdS)r�	N)r&r'r(r*rrrrr@sz	excel-tabc@s$eZdZdZdZdZdZdZeZ	dS)rr0r1TF�
N)
r&r'r(r*r+r,r-r.rr/rrrrrEsZunixc@s@eZdZddd�Zdd�Zedd��Zejd	d��Zd
d�ZdS)
rNrcOs6||_||_||_t||f|�|�|_||_d|_dS�Nr)�_fieldnames�restkey�restvalr�dialect�line_num)r�f�
fieldnamesr7r8r9�args�kwdsrrrr QszDictReader.__init__cCs|Sr!rrrrr�__iter__ZszDictReader.__iter__cCs@|jdkr0zt|j�|_Wntk
r.YnX|jj|_|jSr!)r6�nextr�
StopIterationr:rrrrr<]s

zDictReader.fieldnamescCs
||_dSr!)r6)r�valuerrrr<gscCs�|jdkr|jt|j�}|jj|_|gkr8t|j�}q$tt|j|��}t|j�}t|�}||krv||d�||j<n&||kr�|j|d�D]}|j||<q�|Sr5)	r:r<r@r�dict�zip�lenr7r8)r�row�dZlfZlr�keyrrr�__next__ks



zDictReader.__next__)NNNr)	r&r'r(r r?�propertyr<�setterrIrrrrrPs�
	
	
c@s6eZdZddd�Zdd�Zdd	�Zd
d�Zdd
�ZdS)rr�raisercOsB||_||_|��dkr$td|��||_t||f|�|�|_dS)N)rL�ignorez-extrasaction (%s) must be 'raise' or 'ignore')r<r8�lower�
ValueError�extrasactionr)rr;r<r8rPr9r=r>rrrr �s�zDictWriter.__init__cCstt|j|j��}|�|�Sr!)rCrDr<�writerow)r�headerrrr�writeheader�szDictWriter.writeheadercsN�jdkr8����j}|r8tdd�dd�|D������fdd��jD�S)NrLz(dict contains fields not in fieldnames: z, cSsg|]}t|��qSr)�repr)�.0�xrrr�
<listcomp>�sz,DictWriter._dict_to_list.<locals>.<listcomp>c3s|]}��|�j�VqdSr!)�getr8)rUrH��rowdictrrr�	<genexpr>�sz+DictWriter._dict_to_list.<locals>.<genexpr>)rP�keysr<rO�join)rrZZwrong_fieldsrrYr�
_dict_to_list�s
�zDictWriter._dict_to_listcCs|j�|�|��Sr!)rrQr^)rrZrrrrQ�szDictWriter.writerowcCs|j�t|j|��Sr!)r�	writerows�mapr^)rZrowdictsrrrr_�szDictWriter.writerowsN)rrLr)r&r'r(r rSr^rQr_rrrrr�s�

c@s6eZdZdd�Zddd�Zdd�Zdd	�Zd
d�ZdS)
rcCsdddddg|_dS)Nr0r3�;� �:)�	preferredrrrrr �szSniffer.__init__NcCsd|�||�\}}}}|s(|�||�\}}|s4td��Gdd�dt�}||_||_|pVd|_||_|S)NzCould not determine delimiterc@seZdZdZdZeZdS)zSniffer.sniff.<locals>.dialectZsniffedr2N)r&r'r(r)r.rr/rrrrr9�sr9r1)�_guess_quote_and_delimiter�_guess_delimiterrrr,r*r+r-)r�sample�
delimitersr+r,r*r-r9rrr�sniff�s
�
�
z
Sniffer.sniffc	Cs�g}dD]*}t�|tjtjB�}|�|�}|rq4q|s<dSi}i}d}|j}	|D]�}
|	dd}|
|}|r�|�|d�d||<z|	dd}|
|}Wntk
r�YqRYnX|r�|dks�||kr�|�|d�d||<z|	dd}Wntk
�rYqRYnX|
|rR|d7}qRt||jd�}
|�rXt||jd�}|||k}|d	k�r`d
}nd
}d}t�dt�	|�|
d�tj�}|�
|��r�d
}nd}|
|||fS)N)zI(?P<delim>[^\w\n"\'])(?P<space> ?)(?P<quote>["\']).*?(?P=quote)(?P=delim)zG(?:^|\n)(?P<quote>["\']).*?(?P=quote)(?P<delim>[^\w\n"\'])(?P<space> ?)zG(?P<delim>[^\w\n"\'])(?P<space> ?)(?P<quote>["\']).*?(?P=quote)(?:$|\n)z-(?:^|\n)(?P<quote>["\']).*?(?P=quote)(?:$|\n))rFNrr�quote��delimZspace�rHr4rz]((%(delim)s)|^)\W*%(quote)s[^%(delim)s\n]*%(quote)s[^%(delim)s\n]*%(quote)s\W*((%(delim)s)|$))rlrjTF)�re�compile�DOTALL�	MULTILINE�findall�
groupindexrX�KeyError�max�escape�search)r�datarhZmatchesZrestrZregexpZquotes�delimsZspacesrs�m�nrHr+rlr-Z	dq_regexpr,rrrre�s`




��z"Sniffer._guess_quote_and_delimitercCsttd|�d���}dd�td�D�}tdt|��}d}i}i}i}d|}	}
|	t|�k�rR|d7}||	|
�D]@}|D]6}|�|i�}
|�|�}|
�|d�d|
|<|
||<qxqp|��D]�}t||�	��}t|�dkr�|dddkr�q�t|�dk�rLt
|dd	�d
�||<|�||�||d||dtdd�|D��f||<q�|d||<q�|�	�}t
t||t|���}d
}d}t|�dk�r�||k�r�|D]T\}}|ddk�r�|ddk�r�|d||k�r�|dk�s�||k�r�|||<�q�|d8}�q�t|�dk�rDt|���d}|d�|�|d�d|�k}||fS|
}	|
|7}
qN|�s\dSt|�dk�r�|jD]@}||��k�rp|d�|�|d�d|�k}||fS�qpdd�|�	�D�}|��|dd}|d�|�|d�d|�k}||fS)Nr4cSsg|]}t|��qSr)�chr)rU�crrrrW-sz,Sniffer._guess_delimiter.<locals>.<listcomp>��
rrkcSs|dS)Nrkr)rVrrr�<lambda>G�z*Sniffer._guess_delimiter.<locals>.<lambda>rmcss|]}|dVqdS)rkNr)rU�itemrrrr[Lsz+Sniffer._guess_delimiter.<locals>.<genexpr>g�?g�������?g{�G�z�?z%c )rrcSsg|]\}}||f�qSrr)rU�k�vrrrrWvs���)�list�filter�split�range�minrErX�countr\�itemsru�remove�sum�floatrd�sort)rrxrh�asciiZchunkLengthZ	iterationZ
charFrequencyZmodesry�start�end�line�charZ
metaFrequencyZfreqr�ZmodeListZtotalZconsistencyZ	thresholdr�r�rlr-rGrrrrfs�

����

��zSniffer._guess_delimiterc
Cs�tt|�|�|��}t|�}t|�}i}t|�D]}d||<q0d}|D]�}|dkrVq�|d7}t|�|krlqFt|���D]x}	tt	t
fD]4}
z|
||	�Wq�Wq�ttfk
r�Yq�Xq�t||	�}
|
||	krx||	dkr�|
||	<qx||	=qxqFd}|�
�D]~\}	}t|�td�k�r@t||	�|k�r6|d7}n|d8}n<z|||	�Wn"ttfk
�rr|d7}Yn
X|d8}�q|dkS)Nr�rk)rrrir@rEr�r�r\�intr��complexrO�
OverflowErrorr��typer#)
rrgZrdrrR�columnsZcolumnTypes�i�checkedrF�colZthisTypeZ	hasHeaderZcolTyperrr�
has_headersJ






zSniffer.has_header)N)r&r'r(r rirerfr�rrrrr�s

Lg)rnZ_csvrrrrrrrr	r
rrr
rrrr"�ior�__all__rrrrrr��	NameErrorr�rrrrr�<module>sH@�


2
__pycache__/textwrap.cpython-38.opt-1.pyc000064400000032207151153537610014234 0ustar00U

e5d�K�@s�dZddlZddddddgZd	ZGd
d�d�Zddd�Zdd
d�Zdd�Ze�dej	�Z
e�dej	�Zdd�Zddd�Z
edkr�eed��dS)zText wrapping and filling.
�N�TextWrapper�wrap�fill�dedent�indent�shortenz	

 c
@s�eZdZdZiZed�ZeD]Zeeee�<qdZ	dZ
de�e�Z
de
dd�Ze�d	e	e
e
ed
�ej�Z[	[
[e�de
�Z[
e�d�Zd&ddd�dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�ZdS)'ra	
    Object for wrapping/filling text.  The public interface consists of
    the wrap() and fill() methods; the other methods are just there for
    subclasses to override in order to tweak the default behaviour.
    If you want to completely replace the main wrapping algorithm,
    you'll probably have to override _wrap_chunks().

    Several instance attributes control various aspects of wrapping:
      width (default: 70)
        the maximum width of wrapped lines (unless break_long_words
        is false)
      initial_indent (default: "")
        string that will be prepended to the first line of wrapped
        output.  Counts towards the line's width.
      subsequent_indent (default: "")
        string that will be prepended to all lines save the first
        of wrapped output; also counts towards each line's width.
      expand_tabs (default: true)
        Expand tabs in input text to spaces before further processing.
        Each tab will become 0 .. 'tabsize' spaces, depending on its position
        in its line.  If false, each tab is treated as a single character.
      tabsize (default: 8)
        Expand tabs in input text to 0 .. 'tabsize' spaces, unless
        'expand_tabs' is false.
      replace_whitespace (default: true)
        Replace all whitespace characters in the input text by spaces
        after tab expansion.  Note that if expand_tabs is false and
        replace_whitespace is true, every tab will be converted to a
        single space!
      fix_sentence_endings (default: false)
        Ensure that sentence-ending punctuation is always followed
        by two spaces.  Off by default because the algorithm is
        (unavoidably) imperfect.
      break_long_words (default: true)
        Break words longer than 'width'.  If false, those words will not
        be broken, and some lines might be longer than 'width'.
      break_on_hyphens (default: true)
        Allow breaking hyphenated words. If true, wrapping will occur
        preferably on whitespaces and right after hyphens part of
        compound words.
      drop_whitespace (default: true)
        Drop leading and trailing whitespace from lines.
      max_lines (default: None)
        Truncate wrapped lines.
      placeholder (default: ' [...]')
        Append to the last line of truncated text.
    � z[\w!"\'&.,?]z[^\d\W]z[%s]z[^�Na�
        ( # any whitespace
          %(ws)s+
        | # em-dash between words
          (?<=%(wp)s) -{2,} (?=\w)
        | # word, possibly hyphenated
          %(nws)s+? (?:
            # hyphenated word
              -(?: (?<=%(lt)s{2}-) | (?<=%(lt)s-%(lt)s-))
              (?= %(lt)s -? %(lt)s)
            | # end of word
              (?=%(ws)s|\Z)
            | # em-dash
              (?<=%(wp)s) (?=-{2,}\w)
            )
        ))Zwp�ltZwsZnwsz(%s+)z[a-z][\.\!\?][\"\']?\Z�F�TF�z [...])�	max_lines�placeholderc
CsL||_||_||_||_||_||_||_||_|	|_|
|_	||_
||_dS�N)�width�initial_indent�subsequent_indent�expand_tabs�replace_whitespace�fix_sentence_endings�break_long_words�drop_whitespace�break_on_hyphens�tabsizerr)
�selfrrrrrrrrrrrr�r� /usr/lib64/python3.8/textwrap.py�__init__sszTextWrapper.__init__cCs(|jr|�|j�}|jr$|�|j�}|S)z�_munge_whitespace(text : string) -> string

        Munge whitespace in text: expand tabs and convert all other
        whitespace characters to spaces.  Eg. " foo\tbar\n\nbaz"
        becomes " foo    bar  baz".
        )r�
expandtabsrr�	translate�unicode_whitespace_trans�r�textrrr�_munge_whitespace�s
zTextWrapper._munge_whitespacecCs6|jdkr|j�|�}n|j�|�}dd�|D�}|S)aN_split(text : string) -> [string]

        Split the text to wrap into indivisible chunks.  Chunks are
        not quite the same as words; see _wrap_chunks() for full
        details.  As an example, the text
          Look, goof-ball -- use the -b option!
        breaks into the following chunks:
          'Look,', ' ', 'goof-', 'ball', ' ', '--', ' ',
          'use', ' ', 'the', ' ', '-b', ' ', 'option!'
        if break_on_hyphens is True, or in:
          'Look,', ' ', 'goof-ball', ' ', '--', ' ',
          'use', ' ', 'the', ' ', '-b', ' ', option!'
        otherwise.
        TcSsg|]}|r|�qSrr)�.0�crrr�
<listcomp>�sz&TextWrapper._split.<locals>.<listcomp>)r�
wordsep_re�split�wordsep_simple_re�rr#�chunksrrr�_split�s

zTextWrapper._splitcCs\d}|jj}|t|�dkrX||ddkrN|||�rNd||d<|d7}q|d7}qdS)ag_fix_sentence_endings(chunks : [string])

        Correct for sentence endings buried in 'chunks'.  Eg. when the
        original text contains "... foo.\nBar ...", munge_whitespace()
        and split() will convert that to [..., "foo.", " ", "Bar", ...]
        which has one too few spaces; this method simply changes the one
        space to two.
        rr	rz  �N)�sentence_end_re�search�len)rr,�iZ	patsearchrrr�_fix_sentence_endings�s	
z!TextWrapper._fix_sentence_endingscCs^|dkrd}n||}|jrH|�|dd|��|d|d�|d<n|sZ|�|���dS)a
_handle_long_word(chunks : [string],
                             cur_line : [string],
                             cur_len : int, width : int)

        Handle a chunk of text (most likely a word, not whitespace) that
        is too long to fit in any line.
        r	���N)r�append�pop)rZreversed_chunks�cur_line�cur_lenrZ
space_leftrrr�_handle_long_word�s
zTextWrapper._handle_long_wordc	Cs�g}|jdkrtd|j��|jdk	rb|jdkr8|j}n|j}t|�t|j���|jkrbtd��|��|�r�g}d}|r�|j}n|j}|jt|�}|j	r�|d�
�dkr�|r�|d=|r�t|d�}|||kr�|�|���||7}q�q�q�|�r&t|d�|k�r&|�
||||�ttt|��}|j	�r\|�r\|d�
�dk�r\|t|d�8}|d=|rj|jdk�s�t|�d|jk�s�|�r�|j	�r�t|�dk�r�|d�
��s�||k�r�|�|d�|��qj|�r0|d�
��r|t|j�|k�r|�|j�|�|d�|���q�|t|d�8}|d=�q�|�rn|d��}t|�t|j�|jk�rn||j|d<�q�|�||j����q�qj|S)a�_wrap_chunks(chunks : [string]) -> [string]

        Wrap a sequence of text chunks and return a list of lines of
        length 'self.width' or less.  (If 'break_long_words' is false,
        some lines may be longer than this.)  Chunks correspond roughly
        to words and the whitespace between them: each chunk is
        indivisible (modulo 'break_long_words'), but a line break can
        come between any two chunks.  Chunks should not have internal
        whitespace; ie. a chunk is either all whitespace or a "word".
        Whitespace chunks will be removed from the beginning and end of
        lines, but apart from that whitespace is preserved.
        rzinvalid width %r (must be > 0)Nr	z#placeholder too large for max widthr4r)r�
ValueErrorrrrr1r�lstrip�reverser�stripr5r6r9�sum�map�join�rstrip)	rr,�linesrr7r8r�lZ	prev_linerrr�_wrap_chunks�s�




 ���
�
���
�zTextWrapper._wrap_chunkscCs|�|�}|�|�Sr)r$r-r"rrr�
_split_chunksPs
zTextWrapper._split_chunkscCs$|�|�}|jr|�|�|�|�S)a^wrap(text : string) -> [string]

        Reformat the single paragraph in 'text' so it fits in lines of
        no more than 'self.width' columns, and return a list of wrapped
        lines.  Tabs in 'text' are expanded with string.expandtabs(),
        and all other whitespace characters (including newline) are
        converted to space.
        )rErr3rDr+rrrrVs	

zTextWrapper.wrapcCsd�|�|��S)z�fill(text : string) -> string

        Reformat the single paragraph in 'text' to fit in lines of no
        more than 'self.width' columns, and return a new string
        containing the entire wrapped paragraph.
        �
)r@rr"rrrrdszTextWrapper.fill)
rrrTTFTTTr
)�__name__�
__module__�__qualname__�__doc__r!�ordZuspace�_whitespace�xZ
word_punctZletter�re�escapeZ
whitespaceZnowhitespace�compile�VERBOSEr(r*r/rr$r-r3r9rDrErrrrrrrsV0���
��!grcKstfd|i|��}|�|�S)a�Wrap a single paragraph of text, returning a list of wrapped lines.

    Reformat the single paragraph in 'text' so it fits in lines of no
    more than 'width' columns, and return a list of wrapped lines.  By
    default, tabs in 'text' are expanded with string.expandtabs(), and
    all other whitespace characters (including newline) are converted to
    space.  See TextWrapper class for available keyword args to customize
    wrapping behaviour.
    r)rr�r#r�kwargs�wrrrrps
cKstfd|i|��}|�|�S)a�Fill a single paragraph of text, returning a new string.

    Reformat the single paragraph in 'text' to fit in lines of no more
    than 'width' columns, and return a new string containing the entire
    wrapped paragraph.  As with wrap(), tabs are expanded and other
    whitespace characters converted to space.  See TextWrapper class for
    available keyword args to customize wrapping behaviour.
    r)rrrRrrrr}s	cKs,tf|dd�|��}|�d�|������S)a�Collapse and truncate the given text to fit in the given width.

    The text first has its whitespace collapsed.  If it then fits in
    the *width*, it is returned as is.  Otherwise, as many words
    as possible are joined and then the placeholder is appended::

        >>> textwrap.shorten("Hello  world!", width=12)
        'Hello world!'
        >>> textwrap.shorten("Hello  world!", width=11)
        'Hello [...]'
    r	)rrr)rrr@r=r)rRrrrr�sz^[ 	]+$z(^[ 	]*)(?:[^ 	
])cCs�d}t�d|�}t�|�}|D]b}|dkr0|}q|�|�r<q|�|�rL|}qtt||��D]$\}\}}||krZ|d|�}qqZqdr�|r�|�d�D]}q�|r�t�d|d|�}|S)a�Remove any common leading whitespace from every line in `text`.

    This can be used to make triple-quoted strings line up with the left
    edge of the display, while still presenting them in the source code
    in indented form.

    Note that tabs and spaces are both treated as whitespace, but they
    are not equal: the lines "  hello" and "\thello" are
    considered to have no common leading whitespace.

    Entirely blank lines are normalized to a newline character.
    NrrrFz(?m)^)	�_whitespace_only_re�sub�_leading_whitespace_re�findall�
startswith�	enumerate�zipr)rN)r#Zmargin�indentsrr2rM�y�linerrrr�s(


cs,�dkrdd�����fdd�}d�|��S)aFAdds 'prefix' to the beginning of selected lines in 'text'.

    If 'predicate' is provided, 'prefix' will only be added to the lines
    where 'predicate(line)' is True. If 'predicate' is not provided,
    it will default to adding 'prefix' to all non-empty lines that do not
    consist solely of whitespace characters.
    NcSs|��Sr)r=�r^rrr�	predicate�szindent.<locals>.predicatec3s*��d�D]}�|�r�|n|Vq
dS)NT)�
splitlinesr_�r`�prefixr#rr�prefixed_lines�szindent.<locals>.prefixed_linesr)r@)r#rcr`rdrrbrr�s�__main__z Hello there.
  This is indented.)r)r)N)rJrN�__all__rLrrrrrP�	MULTILINErUrWrrrG�printrrrr�<module>sa

3
__pycache__/trace.cpython-38.pyc000064400000047120151153537610012515 0ustar00U

e5d�t�@s�dZddgZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
mZddlZdZGdd�d�Zd	d
�Zdd�ZGd
d�d�Zdd�Zdd�Zddd�Zdd�ZGdd�d�Zdd�Zedkr�e�dS)a�program/module to trace Python program or function execution

Sample use, command line:
  trace.py -c -f counts --ignore-dir '$prefix' spam.py eggs
  trace.py -t --ignore-dir '$prefix' spam.py eggs
  trace.py --trackcalls spam.py eggs

Sample use, programmatically
  import sys

  # create a Trace object, telling it what to ignore, and whether to
  # do tracing or line-counting or both.
  tracer = trace.Trace(ignoredirs=[sys.base_prefix, sys.base_exec_prefix,],
                       trace=0, count=1)
  # run the new command using the given tracer
  tracer.run('main()')
  # make a report, placing output in /tmp
  r = tracer.results()
  r.write_results(show_missing=True, coverdir="/tmp")
�Trace�CoverageResults�N)�	monotonicz#pragma NO COVERc@seZdZddd�Zdd�ZdS)�_IgnoreNcCs:|s
t�nt|�|_|sgndd�|D�|_ddi|_dS)NcSsg|]}tj�|��qS�)�os�path�normpath��.0�drr�/usr/lib64/python3.8/trace.py�
<listcomp>Hs�z$_Ignore.__init__.<locals>.<listcomp>z<string>�)�set�_mods�_dirs�_ignore)�self�modules�dirsrrr
�__init__Fs
�z_Ignore.__init__cCs�||jkr|j|S||jkr,d|j|<dS|jD]"}|�|d�r2d|j|<dSq2|dkrld|j|<dS|jD]$}|�|tj�rrd|j|<dSqrd|j|<dS)Nr�.r)rr�
startswithrr�sep)r�filename�
modulename�modrrrr
�namesLs$









z
_Ignore.names)NN)�__name__�
__module__�__qualname__rrrrrr
rEs
rcCs tj�|�}tj�|�\}}|S)z-Return a plausible module name for the patch.)rr�basename�splitext)r�baser�extrrr
�_modnamewsr&cCs�tj�|�}d}tjD]@}tj�|�}|�|�r|t|�tjkrt|�t|�kr|}q|rr|t|�dd�}n|}tj�|�\}}|�tjd�}tj	r�|�tj	d�}tj�
|�\}}|�d�S)z,Return a plausible module name for the path.�rNr)rr�normcase�sysr�lenr�
splitdrive�replace�altsepr#�lstrip)rZcomparepathZlongest�dirr$Zdriverr%rrr
�_fullmodname~s 
r0c@s:eZdZddd�Zdd�Zdd�Zdd
d�Zddd
�ZdS)rNc
Cs�||_|jdkri|_|j��|_||_|jdkr8i|_|j��|_||_|jdkrZi|_|j��|_||_||_|jr�z@t|jd��}t�	|�\}}}W5QRX|�
|�|||��Wn@tt
tfk
r�}ztd|j|ftjd�W5d}~XYnXdS)N�rbzSkipping counts file %r: %s��file)�counts�copyZcounter�calledfuncs�callers�infile�outfile�open�pickle�load�update�	__class__�OSError�EOFError�
ValueError�printr)�stderr)rr4r6r8r7r9�f�errrrr
r�s2


��zCoverageResults.__init__cCs|�d�o|�d�S)z_Return True if the filename does not refer to a file
        we want to have reported.
        �<�>)r�endswith)rrrrr
�is_ignored_filename�sz#CoverageResults.is_ignored_filenamec	Csn|j}|j}|j}|j}|j}|j}|D]}|�|d�||||<q(|D]}d||<qJ|D]}d||<q\dS)z.Merge in the data from another CoverageResultsrrN)r4r6r7�get)	r�otherr4r6r7Zother_countsZother_calledfuncsZ
other_callers�keyrrr
r=�s
zCoverageResults.updateTFc"
Cs�|jr@t�td�|j}t|�D]\}}}td|||f�q"|jr�t�td�d}}	t|j�D]h\\}
}}\}
}}|
|kr�t�td|
d�|
}d}	|
|
kr�|	|
kr�td|
�|
}	td||||f�qfi}|jD].\}}|�|i�}||<|j||f||<q�i}|��D�]\}}|�|��r0�q|�d��rH|d	d
�}|d	k�rpt	j
�t	j
�|��}t
|�}n$|}t	j
�|��s�t	�|�t|�}|�r�t|�}ni}t�|�}t	j
�||d�}t|d��}t�|j�\}}W5QRX|�|||||�\}}|�r|�rtd
||�}||||f||<�q|�rt|�rttd�t|�D]&}||\}}}}td||��qL|j�r�z6t|jd�� } t�|j|j|jf| d�W5QRXWn6tk
�r�}!ztd|!tj d�W5d	}!~!XYnXd	S)af
        Write the coverage results.

        :param show_missing: Show lines that had no hits.
        :param summary: Include coverage summary per module.
        :param coverdir: If None, the results of each module are placed in its
                         directory, otherwise it is included in the directory
                         specified.
        zfunctions called:z*filename: %s, modulename: %s, funcname: %szcalling relationships:r'z***z  -->z    %s.%s -> %s.%sz.pycN���z.coverr1�dzlines   cov%   module   (path)z%5d   %3d%%   %s   (%s)�wbrz"Can't save counts files because %sr2)!r6rB�sortedr7r4rJ�itemsrIrHrr�dirname�abspathr&�exists�makedirsr0�_find_executable_linenos�	linecache�getlines�joinr:�tokenize�detect_encoding�readline�write_results_file�intr9r;�dumpr?r)rC)"rZshow_missing�summary�coverdirZcallsrr�funcnameZlastfileZ	lastcfileZpfileZpmodZpfunc�cfileZcmodZcfuncZper_file�lineno�	lines_hitZsums�countr/�lnotab�sourceZ	coverpath�fp�encoding�_�n_hits�n_linesZpercent�mrDrErrr
�
write_results�s�
��





��zCoverageResults.write_resultsc
Cs�zt|d|d�}Wn>tk
rP}z td||ftjd�WY�dSd}~XYnXd}d}	|��t|d�D]r\}
}|
|kr�|�d	||
�|	d7}	|d7}n.|
|kr�t|kr�|�d
�|d7}n
|�d�|�|�d��qjW5QRX|	|fS)
z'Return a coverage results file in path.�w�rjz3trace: Could not open %r for writing: %s - skippingr2)rrNrrz%5d: z>>>>>> z       �)	r:r?rBr)rC�	enumerate�write�PRAGMA_NOCOVER�
expandtabs)rr�linesrgrerjr9rErmrlrd�linerrr
r])s.��



z"CoverageResults.write_results_file)NNNNN)TFN)N)rr r!rrIr=ror]rrrr
r�s�

\cCs,i}t�|�D]\}}||krd||<q|S)z:Return dict where keys are lines in the line number table.r)�disZfindlinestarts)�code�strs�linenosrkrdrrr
�_find_lines_from_codeIs

r}cCs4t||�}|jD]}t�|�r|�t||��q|S)z<Return lineno dict for all code objects reachable from code.)r}�	co_consts�inspectZiscoder=�_find_lines)rzr{r|�crrr
r�Ss



r�c	Cs�i}tj}t||d��j}t�|j�}|D]R\}}}}	}
|tjkrv|tjkrv|\}}|	\}
}t||
d�D]}d||<qh|}q(W5QRX|S)z�Return a dict of possible docstring positions.

    The dict maps line numbers to strings.  There is an entry for
    line that contains only a string or a part of a triple-quoted
    string.
    rqr)�token�INDENTr:rZ�generate_tokensr\�STRING�range)rrjrZ
prev_ttyperD�tokZttypeZtstr�start�endrxZslineZscolZelineZecol�irrr
�
_find_strings_s


r�c
Cs�z(t�|��}|��}|j}W5QRXWn@tk
rh}z"td||ftjd�iWY�Sd}~XYnXt||d�}t	||�}t
||�S)zAReturn dict where keys are line numbers in the line number table.z%Not printing coverage data for %r: %sr2N�exec)rZr:�readrjr?rBr)rC�compiler�r�)rrD�progrjrErzr{rrr
rVvs��
rVc	@sveZdZddd�Zdd	�Zd d
d�Zdd
�Zde_dd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)!rrrrNFc

Cs�||_||_t||�|_i|_i|_d|_||_i|_i|_	i|_
d|_|	rTt�|_|rb|j
|_nZ|rp|j|_nL|r�|r�|j|_|j|_n2|r�|j|_|j|_n|r�|j|_|j|_nd|_dS)ax
        @param count true iff it should count number of times each
                     line is executed
        @param trace true iff it should print out each line that is
                     being counted
        @param countfuncs true iff it should just output a list of
                     (filename, modulename, funcname,) for functions
                     that were called at least once;  This overrides
                     `count' and `trace'
        @param ignoremods a list of the names of modules to ignore
        @param ignoredirs a list of the names of directories to ignore
                     all of the (recursive) contents of
        @param infile file from which to read stored counts to be
                     added into the results
        @param outfile file in which to write the results
        @param timing true iff timing information be displayed
        rNr)r8r9r�ignorer4Zpathtobasename�	donothing�trace�_calledfuncs�_callers�
_caller_cache�
start_time�_time�globaltrace_trackcallers�globaltrace�globaltrace_countfuncs�globaltrace_lt�localtrace_trace_and_count�
localtrace�localtrace_trace�localtrace_count)
rrfr��
countfuncs�countcallers�
ignoremods�
ignoredirsr8r9�timingrrr
r�s6




zTrace.__init__cCs ddl}|j}|�|||�dS)Nr)�__main__�__dict__�runctx)r�cmdr��dictrrr
�run�sz	Trace.runc	Csh|dkri}|dkri}|js6t�|j�t�|j�zt|||�W5|jsbt�d�t�d�XdS)N)r��	threading�settracer�r)r�)rr��globals�localsrrr
r��s
zTrace.runctxc	Os�t|�dkr|^}}}nV|s&td��nHd|krZ|�d�}|^}}ddl}|jdtdd�ntdt|�d��d}|js�t�|j	�z|||�}W5|js�t�d�X|S)	N�z8descriptor 'runfunc' of 'Trace' object needs an argument�funcrz0Passing 'func' as keyword argument is deprecated)�
stacklevelz7runfunc expected at least 1 positional argument, got %dr)
r*�	TypeError�pop�warnings�warn�DeprecationWarningr�r)r�r�)�args�kwrr�r��resultrrr
�runfunc�s.

�
�z
Trace.runfuncz($self, func, /, *args, **kw)c
Cs�|j}|j}|rt|�}nd}|j}d}||jkrL|j|dk	r�|j|}n�d|j|<dd�t�|�D�}t|�dkr�dd�t�|d�D�}t|�dkr�dd�t�|d�D�}	t|	�dkr�|	dj}||j|<|dk	r�d||f}|||fS)NcSsg|]}t�|�r|�qSr)rZ
isfunction)rrDrrr
r�s
�z1Trace.file_module_function_of.<locals>.<listcomp>rcSsg|]}t|t�r|�qSr)�
isinstancer�r
rrr
r�s
�rcSsg|]}t|d�r|�qS)�	__bases__)�hasattr)rr�rrr
r�s
�z%s.%s)	�f_code�co_filenamer&�co_namer��gcZ
get_referrersr*r)
r�framerzrrrbZclsnameZfuncsZdicts�classesrrr
�file_module_function_of�s,




zTrace.file_module_function_ofcCs0|dkr,|�|�}|�|j�}d|j||f<dS)zkHandler for call events.

        Adds information about who called who to the self._callers dict.
        �callrN)r��f_backr�)rr��why�arg�	this_funcZparent_funcrrr
r�
s
zTrace.globaltrace_trackcallerscCs |dkr|�|�}d|j|<dS)zoHandler for call events.

        Adds (filename, modulename, funcname) to the self._calledfuncs dict.
        r�rN)r�r�)rr�r�r�r�rrr
r�s
zTrace.globaltrace_countfuncscCsj|dkrf|j}|j�dd�}|rbt|�}|dk	rf|j�||�}|sf|jrZtd||jf�|j	SndSdS)z�Handler for call events.

        If the code block being entered is to be ignored, returns `None',
        else returns self.localtrace.
        r��__file__Nz! --- modulename: %s, funcname: %s)
r��	f_globalsrJr&r�rr�rBr�r�)rr�r�r�rzrrZ	ignore_itrrr
r�!s�zTrace.globaltrace_ltcCs�|dkr~|jj}|j}||f}|j�|d�d|j|<|jrTtdt�|jdd�tj	�
|�}td||t�||�fdd�|j
S)	Nrxrr�%.2f� �r��
%s(%d): %sr')r�r��f_linenor4rJr�rBr�rrr"rW�getliner�)rr�r�r�rrdrL�bnamerrr
r�8s
��z Trace.localtrace_trace_and_countcCsd|dkr^|jj}|j}|jr4tdt�|jdd�tj�|�}td||t	�
||�fdd�|jS)Nrxr�r�r�r�r')r�r�r�r�rBr�rrr"rWr�r�)rr�r�r�rrdr�rrr
r�Gs
��zTrace.localtrace_tracecCs<|dkr6|jj}|j}||f}|j�|d�d|j|<|jS)Nrxrr)r�r�r�r4rJr�)rr�r�r�rrdrLrrr
r�TszTrace.localtrace_countcCst|j|j|j|j|jd�S)N)r8r9r6r7)rr4r8r9r�r�)rrrr
�results\s

�z
Trace.results)	rrrrrrNNF)NN)rr r!rr�r�r��__text_signature__r�r�r�r�r�r�r�r�rrrr
r�s&�
2

)	
cs�ddl}|��}|jdddd�|�dd�}|jdd	d
dd�|jd
dd
dd�|jddd
dd�|jddd
dd�|�d�}|��}|jddd
dd�|jddd
dd�|jdddd �|jd!d"d#d �|jd$d%d
d&d�|jd'd(d
d)d�|jd*d+d
d,d�|�d-d.�}|jd/d0gd1d2�|jd3d0gd4d2�|jd5d
d6d7d2�|jd8d9d:d;�|jd<|jd=d;�|��}|j�r�t�	d>��t�	d?����fd@dA��dBdC�|j
D�|_
�fdDdC�|jD�|_|j�r�|j�s�|�
dE�t|j|jdF�}|�|j|j|j�St|j|j|j|jg��s |�
dG�|j�rB|j�s8|j�rB|�
dH�|j�r\|j�s\|�
dI�|jdk�rr|�
dJ�t|j|j|j|j|j
|j|j|j|jdK�	}z�|j�r�ddl}|j}|�|�\}	}
}|jf|j�t _!dL|j|
j"|
j#|
ddM�}n^|jf|j�t _!t$j%�&|j�t j%d<t'�(|j��}
t)|
�*�|jdN�}W5QRX|jdLdddO�}|�+|||�WnPt,k
�r�}zt �-dPt j!d|f�W5d}~XYnt.k
�r�YnX|�/�}|j0�s�|�|j|j|j�dS)QNrz	--version�versionz	trace 2.0)�actionr�zMain optionsz(One of these (or --report) must be givenz-cz--count�
store_truez�Count the number of times each line is executed and write the counts to <module>.cover for each module executed, in the module's directory. See also --coverdir, --file, --no-report below.)r��helpz-tz--tracez3Print each line to sys.stdout before it is executedz-lz--listfuncsz�Keep track of which functions are executed at least once and write the results to sys.stdout after the program exits. Cannot be specified alongside --trace or --count.z-Tz--trackcallsz^Keep track of caller/called pairs and write the results to sys.stdout after the program exits.Z	Modifiersz-rz--reportz�Generate a report from a counts file; does not execute any code. --file must specify the results file to read, which must have been created in a previous run with --count --file=FILEz-Rz--no-reportz^Do not generate the coverage report files. Useful if you want to accumulate over several runs.z-fz--filez+File to accumulate counts over several runs)r�z-Cz
--coverdirz�Directory where the report files go. The coverage report for <package>.<module> will be written to file <dir>/<package>/<module>.coverz-mz	--missingz?Annotate executable lines that were not executed with ">>>>>> "z-sz	--summaryz\Write a brief summary for each file to sys.stdout. Can only be used with --count or --reportz-gz--timingzQPrefix each line with the time since the program started. Only used while tracingZFilterszCan be specified multiple timesz--ignore-module�appendzqIgnore the given module(s) and its submodules (if it is a package). Accepts comma separated list of module names.)r��defaultr�z--ignore-dirzWIgnore files in the given directory (multiple directories can be joined by os.pathsep).z--moduleFzTrace a module. �progname�?zfile to run as main program)�nargsr��	argumentszarguments to the programZstdlibZ
platstdlibcs4tj�tj�|��}|�d���d��}tj�|�S)Nz$prefixz$exec_prefix)rr�
expanduser�
expandvarsr,r	)�s)�_exec_prefix�_prefixrr
�parse_ignore_dir�szmain.<locals>.parse_ignore_dircSs$g|]}|�d�D]}|���qqS)�,)�split�strip)rr�rrrr
r�s�zmain.<locals>.<listcomp>cs&g|]}|�tj�D]}�|��qqSr)r�r�pathsep)rr�r�)r�rr
r�s�z-r/--report requires -f/--file)r8r9zLmust specify one of --trace, --count, --report, --listfuncs, or --trackcallsz8cannot specify both --listfuncs and (--trace or --count)z3--summary can only be used with --count or --reportz3progname is missing: required with the main options)r�r�r�r�r8r9r�r�)rr��__package__�
__loader__�__spec__�
__cached__r�)r�rr�r�zCannot run file %r because: %s)1�argparse�ArgumentParser�add_argumentZadd_argument_groupZadd_mutually_exclusive_groupZ	REMAINDER�
parse_argsZ
ignore_dir�	sysconfigZget_pathZ
ignore_moduleZreportr3�errorrroZmissingr`ra�anyr�rfZ	listfuncsZ
trackcallsr�rr��module�runpyZ_get_module_detailsr�r�r)�argv�parent�loaderrrrR�io�	open_coder�r�r�r?�exit�
SystemExitr�Z	no_report)r��parserZgrpZ_grpZoptsr��tr�Zmodule_nameZmod_nameZmod_specrzZglobsrirEr)r�r�r�r
�mainbs��
�
�
�
�

�
���
�
�
��
�
�
��
�

�
�




��	�(r�r�)N)�__doc__�__all__r�rWrr)r�r�rZrr�ryr;�timerr�r�rurr&r0rr}r�r�rVrr�rrrrr
�<module>s<20

___pycache__/imaplib.cpython-38.opt-1.pyc000064400000114371151153537610013776 0ustar00U

e5df��*@s�dZdZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlmZmZm
Z
ddlmZzddlZdZWnek
r�dZYnXdd	d
ddd
gZdZdZdZdZdZdZdddddddddddddddddddddddddddddddddddddddddd�)Ze�d�Ze�d�Ze�d�Ze�dej�Z e�d�Z!e�d�Z"e�d�Z#e�d ej�Z$dZ%d Z&Gd!d�d�Z'e�r�Gd"d#�d#e'�Z(e�)d#�Gd$d	�d	e'�Z*Gd%d&�d&�Z+d'�,d(�Z-d)d*�e.e-d+d��D�Z/d,d
�Z0d-d�Z1d.d�Z2d/d
�Z3e4d0k�r�ddl5Z5ddl6Z6ze5�5ej7d+d�d1�\Z8Z9Wn.e5j:k
�rpZ;zd2\Z8Z9W5dZ;[;XYnXdZ<e8D]8\Z=Z;e=d3k�r�e>e;�Zne=d4k�rze;Z<e9�sze<fZ9�qze9�s�d5Z9e9dZ?e6�@�ZAe6�6d6eAe?�p�d7f�ZBd8eAd9d:�ZCd;eAeBffd<d=d>d?d@ddeCffdAdBdCdDdEdFdGdHdIfZDdJdKdLdMd?dddeCffdHdNfZEdOdP�ZF�ze<�rbe*e<�ZGne'e?�ZGeGjHdQk�r�eDd+d�ZDeG�IdReGjJ�eG�IdSeGjKf�eDD]\ZLZ9eFeLe9��q�eFdTdU�D]<ZMe�NdVeM�ZOeO�r�eO�Pd+�ZQneM�,�dWZQeFdXeQf��q�eED]T\ZLZ9eFeLe9�ZReLe9fdLk�r.�q
eRdW�,�ZSeS�sD�q
eFdYdZd[eSdWd\f��q
eTd]�Wn.eTd^�e�s�eTd_ej7d��YnXdS)`z�IMAP4 client.

Based on RFC 2060.

Public class:           IMAP4
Public variable:        Debug
Public functions:       Internaldate2tuple
                        Int2AP
                        ParseFlags
                        Time2Internaldate
z2.58�N)�datetime�timezone�	timedelta)�DEFAULT_BUFFER_SIZETF�IMAP4�IMAP4_stream�Internaldate2tuple�Int2AP�
ParseFlags�Time2Internaldate�
�i�)Z	IMAP4REV1ri@B)�AUTH�SELECTED)�NONAUTH)rrr�LOGOUT)r)r))�APPEND�AUTHENTICATE�
CAPABILITY�CHECK�CLOSE�COPY�CREATE�DELETE�	DELETEACL�ENABLE�EXAMINE�EXPUNGE�FETCH�GETACL�
GETANNOTATION�GETQUOTA�GETQUOTAROOT�MYRIGHTS�LIST�LOGINr�LSUBZMOVE�	NAMESPACE�NOOP�PARTIAL�	PROXYAUTH�RENAME�SEARCH�SELECT�SETACL�
SETANNOTATION�SETQUOTA�SORT�STARTTLS�STATUS�STORE�	SUBSCRIBE�THREAD�UID�UNSUBSCRIBEs\+( (?P<data>.*))?s.*FLAGS \((?P<flags>[^\)]*)\)s�.*INTERNALDATE "(?P<day>[ 0123][0-9])-(?P<mon>[A-Z][a-z][a-z])-(?P<year>[0-9][0-9][0-9][0-9]) (?P<hour>[0-9][0-9]):(?P<min>[0-9][0-9]):(?P<sec>[0-9][0-9]) (?P<zonen>[-+])(?P<zoneh>[0-9][0-9])(?P<zonem>[0-9][0-9])"s.*{(?P<size>\d+)}$s
\r\n|\r|\ns%\[(?P<type>[A-Z-]+)( (?P<data>.*))?\]s$\* (?P<type>[A-Z-]+)( (?P<data>.*))?s3\* (?P<data>\d+) (?P<type>[A-Z-]+)( (?P<data2>.*))?c@s�eZdZdZGdd�de�ZGdd�de�ZGdd�de�Zdefd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdefdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Z d9d:�Z!d;d<�Z"d=d>�Z#d?d@�Z$dAdB�Z%dCdD�Z&dEdF�Z'dGdH�Z(d�dKdL�Z)dMdN�Z*dOdP�Z+dQdR�Z,dSdT�Z-d�dUdV�Z.dWdX�Z/dYdZ�Z0d[d\�Z1d]d^�Z2d_d`�Z3dadb�Z4dcdd�Z5d�dgdh�Z6didj�Z7dkdl�Z8dmdn�Z9dodp�Z:d�drds�Z;dtdu�Z<dvdw�Z=dxdy�Z>dzd{�Z?d|d}�Z@d~d�ZAd�d��ZBd�d��ZCd�d��ZDd�d��ZEd�d��ZFd�d��ZGd�d��ZHd�d�d��ZId�d��ZJd�d��ZKd�d��ZLd�d��ZMd�d��ZNd�d��ZOdqS)�ra�IMAP4 client class.

    Instantiate with: IMAP4([host[, port]])

            host - host's name (default: localhost);
            port - port number (default: standard IMAP4 port).

    All IMAP4rev1 commands are supported by methods of the same
    name (in lower-case).

    All arguments to commands are converted to strings, except for
    AUTHENTICATE, and the last argument to APPEND which is passed as
    an IMAP4 literal.  If necessary (the string contains any
    non-printing characters or white-space and isn't enclosed with
    either parentheses or double quotes) each string is quoted.
    However, the 'password' argument to the LOGIN command is always
    quoted.  If you want to avoid having an argument string quoted
    (eg: the 'flags' argument to STORE) then enclose the string in
    parentheses (eg: "(\Deleted)").

    Each command returns a tuple: (type, [data, ...]) where 'type'
    is usually 'OK' or 'NO', and 'data' is either the text from the
    tagged response, or untagged results from command. Each 'data'
    is either a string, or a tuple. If a tuple, then the first part
    is the header of the response, and the second part contains
    the data (ie: 'literal' value).

    Errors raise the exception class <instance>.error("<reason>").
    IMAP4 server errors raise <instance>.abort("<reason>"),
    which is a sub-class of 'error'. Mailbox status changes
    from READ-WRITE to READ-ONLY raise the exception class
    <instance>.readonly("<reason>"), which is a sub-class of 'abort'.

    "error" exceptions imply a program error.
    "abort" exceptions imply the connection should be reset, and
            the command re-tried.
    "readonly" exceptions imply the command should be re-tried.

    Note: to use this module, you must read the RFCs pertaining to the
    IMAP4 protocol, as the semantics of the arguments to each IMAP4
    command are left to the invoker, not to mention the results. Also,
    most IMAP servers implement a sub-set of the commands available here.
    c@seZdZdS)zIMAP4.errorN��__name__�
__module__�__qualname__�r=r=�/usr/lib64/python3.8/imaplib.py�error�sr?c@seZdZdS)zIMAP4.abortNr9r=r=r=r>�abort�sr@c@seZdZdS)zIMAP4.readonlyNr9r=r=r=r>�readonly�srA�cCs�t|_d|_d|_i|_i|_d|_d|_d|_d|_	|�
�|�||�z|��Wn8t
k
r�z|��Wntk
r�YnX�YnXdS)NrrBFr)�Debug�debug�state�literal�tagged_commands�untagged_responses�continuation_response�is_readonly�tagnum�_tls_established�_mode_ascii�open�_connect�	Exception�shutdown�OSError��self�host�portr=r=r>�__init__�s&zIMAP4.__init__cCs0d|_d|_t�ttj�|_t�ttj�|_dS)NF�ascii)	�utf8_enabled�	_encoding�re�compile�_Literal�ASCII�Literal�_Untagged_status�Untagged_status�rTr=r=r>rM�szIMAP4._mode_asciicCs(d|_d|_t�t�|_t�t�|_dS)NT�utf-8)rYrZr[r\r]r_r`rarbr=r=r>�
_mode_utf8�szIMAP4._mode_utf8cCs�tt�dd��|_t�d|jdtj�|_|�	�|_
d|jkrHd|_nd|jkrZd|_n|�
|j
��|��tD]}||jkr�qr||_dS|�
d	��dS)
Nii��s(?P<tag>s"\d+) (?P<type>[A-Z]+) (?P<data>.*)ZPREAUTHr�OKrzserver not IMAP4 compliant)r	�randomZrandint�tagprer[r\r^�tagre�__version__�
_get_responseZwelcomerHrEr?�_get_capabilities�AllowedVersions�capabilities�PROTOCOL_VERSION)rT�versionr=r=r>rO�s*���



zIMAP4._connectcCs&|tkrt||���Std|��dS)NzUnknown IMAP4 command: '%s')�Commands�getattr�lower�AttributeError)rT�attrr=r=r>�__getattr__	szIMAP4.__getattr__cCs|S�Nr=rbr=r=r>�	__enter__szIMAP4.__enter__cGs4|jdkrdSz|��Wntk
r.YnXdS)Nr)rE�logoutrR)rT�argsr=r=r>�__exit__s
zIMAP4.__exit__cCs4|js
dn|j}t�d||j|j�t�||jf�S)Nzimaplib.open)rU�sys�auditrV�socketZcreate_connection)rTrUr=r=r>�_create_socketszIMAP4._create_socketcCs(||_||_|��|_|j�d�|_dS)z�Setup connection to remote server on "host:port"
            (default: localhost:standard IMAP4 port).
        This connection will be used by the routines:
            read, readline, send, shutdown.
        �rbN)rUrVr~�sock�makefile�filerSr=r=r>rN's
z
IMAP4.opencCs|j�|�S�zRead 'size' bytes from remote.)r��read�rT�sizer=r=r>r�3sz
IMAP4.readcCs.|j�td�}t|�tkr*|�dt��|S)�Read line from remote.�zgot more than %d bytes)r��readline�_MAXLINE�lenr?�rT�liner=r=r>r�8szIMAP4.readlinecCst�d||�|j�|�dS)�Send data to remote.zimaplib.sendN)r{r|r�Zsendall�rT�datar=r=r>�send@sz
IMAP4.sendc
Cst|j��zXz|j�tj�Wn@tk
r^}z"|jtjkrNt	|dd�dkrN�W5d}~XYnXW5|j��XdS)� Close I/O established in "open".Zwinerrorri&'N)
r��closer�rQr}Z	SHUT_RDWRrR�errnoZENOTCONNrq)rT�excr=r=r>rQFs
�zIMAP4.shutdowncCs|jS)zfReturn socket instance used to connect to IMAP4 server.

        socket = <instance>.socket()
        )r�rbr=r=r>r}VszIMAP4.socketcCsBd}|�ddg|�\}}|dr(||fS|��\}}|�|||�S)aReturn most recent 'RECENT' responses if any exist,
        else prompt server for an update using the 'NOOP' command.

        (typ, [data]) = <instance>.recent()

        'data' is None if no new messages,
        else list of RECENT responses, most recent last.
        ZRECENTreN���)�_untagged_response�noop�rT�name�typ�datr=r=r>�recentbs	zIMAP4.recentcCs|�|dg|���S)z�Return data for response 'code' if received, or None.

        Old value for response 'code' is cleared.

        (code, [data]) = <instance>.response(code)
        N)r��upper)rT�coder=r=r>�responsesszIMAP4.responsecCsxd}|sd}|r.|d|dfdkr2d|}nd}|r@t|�}nd}t�t|�}|jrbd|d	}||_|�||||�S)
z�Append message to named mailbox.

        (typ, [data]) = <instance>.append(mailbox, flags, date_time, message)

                All args except `message' can be None.
        r�INBOXrr���(�)�(%s)NsUTF8 (�))r�MapCRLF�sub�CRLFrYrF�_simple_command)rT�mailbox�flags�	date_time�messager�rFr=r=r>�append�s

zIMAP4.appendcCsP|��}t|�j|_|�d|�\}}|dkrB|�|d�dd���d|_||fS)asAuthenticate command - requires response processing.

        'mechanism' specifies which authentication mechanism is to
        be used - it must appear in <instance>.capabilities in the
        form AUTH=<mechanism>.

        'authobject' must be a callable object:

                data = authobject(response)

        It will be called to process server continuation responses; the
        response argument it is passed will be a bytes.  It should return bytes
        data that will be base64 encoded and sent to the server.  It should
        return None if the client abort response '*' should be sent instead.
        rrer�rc�replacer)r��_Authenticator�processrFr�r?�decoderE)rTZ	mechanismZ
authobject�mechr�r�r=r=r>�authenticate�szIMAP4.authenticatecCs d}|�|�\}}|�|||�S)zT(typ, [data]) = <instance>.capability()
        Fetch capabilities list from server.r�r�r�r�r=r=r>�
capability�szIMAP4.capabilitycCs
|�d�S)zRCheckpoint mailbox on server.

        (typ, [data]) = <instance>.check()
        r�r�rbr=r=r>�check�szIMAP4.checkcCs$z|�d�\}}W5d|_X||fS)z�Close currently selected mailbox.

        Deleted messages are removed from writable mailbox.
        This is the recommended command before 'LOGOUT'.

        (typ, [data]) = <instance>.close()
        rr)rEr��rTr�r�r=r=r>r��szIMAP4.closecCs|�d||�S)z�Copy 'message_set' messages onto end of 'new_mailbox'.

        (typ, [data]) = <instance>.copy(message_set, new_mailbox)
        rr�)rT�message_setZnew_mailboxr=r=r>�copy�sz
IMAP4.copycCs|�d|�S)zPCreate new mailbox.

        (typ, [data]) = <instance>.create(mailbox)
        rr��rTr�r=r=r>�create�szIMAP4.createcCs|�d|�S)zPDelete old mailbox.

        (typ, [data]) = <instance>.delete(mailbox)
        rr�r�r=r=r>�delete�szIMAP4.deletecCs|�d||�S)z�Delete the ACLs (remove any rights) set for who on mailbox.

        (typ, [data]) = <instance>.deleteacl(mailbox, who)
        rr�)rTr��whor=r=r>�	deleteacl�szIMAP4.deleteaclcCsHd|jkrt�d��|�d|�\}}|dkr@d|��kr@|��||fS)zkSend an RFC5161 enable string to the server.

        (typ, [data]) = <intance>.enable(capability)
        rzServer does not support ENABLErezUTF8=ACCEPT)rmrr?r�r�rd)rTr�r�r�r=r=r>�enable�s

zIMAP4.enablecCs d}|�|�\}}|�|||�S)z�Permanently remove deleted items from selected mailbox.

        Generates 'EXPUNGE' response for each deleted message.

        (typ, [data]) = <instance>.expunge()

        'data' is list of 'EXPUNGE'd message numbers in order received.
        rr�r�r=r=r>�expunges	z
IMAP4.expungecCs$d}|�|||�\}}|�|||�S)a#Fetch (parts of) messages.

        (typ, [data, ...]) = <instance>.fetch(message_set, message_parts)

        'message_parts' should be a string of selected parts
        enclosed in parentheses, eg: "(UID BODY[TEXT])".

        'data' are tuples of message part envelope and data.
        rr�)rTr�Z
message_partsr�r�r�r=r=r>�fetchs
zIMAP4.fetchcCs|�d|�\}}|�||d�S)zXGet the ACLs for a mailbox.

        (typ, [data]) = <instance>.getacl(mailbox)
        rZACLr��rTr�r�r�r=r=r>�getaclszIMAP4.getaclcCs"|�d|||�\}}|�||d�S)za(typ, [data]) = <instance>.getannotation(mailbox, entry, attribute)
        Retrieve ANNOTATIONs.r �
ANNOTATIONr�)rTr��entryZ	attributer�r�r=r=r>�
getannotation(szIMAP4.getannotationcCs|�d|�\}}|�||d�S)z�Get the quota root's resource usage and limits.

        Part of the IMAP4 QUOTA extension defined in rfc2087.

        (typ, [data]) = <instance>.getquota(root)
        r!�QUOTAr�)rT�rootr�r�r=r=r>�getquota0szIMAP4.getquotacCs@|�d|�\}}|�||d�\}}|�||d�\}}|||gfS)z�Get the list of quota roots for the named mailbox.

        (typ, [[QUOTAROOT responses...], [QUOTA responses]]) = <instance>.getquotaroot(mailbox)
        r"r�Z	QUOTAROOTr�)rTr�r�r�ZquotaZ	quotarootr=r=r>�getquotaroot;szIMAP4.getquotaroot�""�*cCs$d}|�|||�\}}|�|||�S)z�List mailbox names in directory matching pattern.

        (typ, [data]) = <instance>.list(directory='""', pattern='*')

        'data' is list of LIST responses.
        r$r��rTZ	directory�patternr�r�r�r=r=r>�listFsz
IMAP4.listcCs<|�d||�|��\}}|dkr.|�|d��d|_||fS)z�Identify client using plaintext password.

        (typ, [data]) = <instance>.login(user, password)

        NB: 'password' will be quoted.
        r%rer�r)r��_quoter?rE)rT�user�passwordr�r�r=r=r>�loginRs
zIMAP4.logincCs|||_|_|�d|j�S)zr Force use of CRAM-MD5 authentication.

        (typ, [data]) = <instance>.login_cram_md5(user, password)
        zCRAM-MD5)r�r�r��_CRAM_MD5_AUTH)rTr�r�r=r=r>�login_cram_md5`szIMAP4.login_cram_md5cCsBddl}t|jt�r |j�d�n|j}|jd|�||d���S)z1 Authobject to use with CRAM-MD5 authentication. rNrc� Zmd5)�hmac�
isinstancer��str�encoder�ZHMACZ	hexdigest)rTZ	challenger��pwdr=r=r>r�is
�zIMAP4._CRAM_MD5_AUTHcCs$d|_|�d�\}}|��||fS)z|Shutdown connection to server.

        (typ, [data]) = <instance>.logout()

        Returns server 'BYE' response.
        r)rEr�rQr�r=r=r>rxqszIMAP4.logoutcCs$d}|�|||�\}}|�|||�S)z�List 'subscribed' mailbox names in directory matching pattern.

        (typ, [data, ...]) = <instance>.lsub(directory='""', pattern='*')

        'data' are tuples of message part envelope and data.
        r&r�r�r=r=r>�lsub~sz
IMAP4.lsubcCs|�d|�\}}|�||d�S)z�Show my ACLs for a mailbox (i.e. the rights that I have on mailbox).

        (typ, [data]) = <instance>.myrights(mailbox)
        r#r�r�r=r=r>�myrights�szIMAP4.myrightscCs d}|�|�\}}|�|||�S)zb Returns IMAP namespaces ala rfc2342

        (typ, [data, ...]) = <instance>.namespace()
        r'r�r�r=r=r>�	namespace�szIMAP4.namespacecCs
|�d�S)zFSend NOOP command.

        (typ, [data]) = <instance>.noop()
        r(r�rbr=r=r>r��sz
IMAP4.noopcCs(d}|�|||||�\}}|�||d�S)z�Fetch truncated part of a message.

        (typ, [data, ...]) = <instance>.partial(message_num, message_part, start, length)

        'data' is tuple of message part envelope and data.
        r)rr�)rTZmessage_numZmessage_part�startZlengthr�r�r�r=r=r>�partial�sz
IMAP4.partialcCsd}|�d|�S)z�Assume authentication as "user".

        Allows an authorised administrator to proxy into any user's
        mailbox.

        (typ, [data]) = <instance>.proxyauth(user)
        r*r�)rTr�r�r=r=r>�	proxyauth�s	zIMAP4.proxyauthcCs|�d||�S)zkRename old mailbox name to new.

        (typ, [data]) = <instance>.rename(oldmailbox, newmailbox)
        r+r�)rTZ
oldmailboxZ
newmailboxr=r=r>�rename�szIMAP4.renamecGsTd}|r2|jrt�d��|j|d|f|��\}}n|j|f|��\}}|�|||�S)z�Search mailbox for matching messages.

        (typ, [data]) = <instance>.search(charset, criterion, ...)

        'data' is space separated list of matching message numbers.
        If UTF8 is enabled, charset MUST be None.
        r,z'Non-None charset not valid in UTF8 mode�CHARSET)rYrr?r�r�)rT�charsetZcriteriar�r�r�r=r=r>�search�s
zIMAP4.searchr�FcCsvi|_||_|rd}nd}|�||�\}}|dkr@d|_||fSd|_d|jkrb|sb|�d|��||j�dd	g�fS)
atSelect a mailbox.

        Flush all untagged responses.

        (typ, [data]) = <instance>.select(mailbox='INBOX', readonly=False)

        'data' is count of messages in mailbox ('EXISTS' response).

        Mandated responses are ('FLAGS', 'EXISTS', 'RECENT', 'UIDVALIDITY'), so
        other responses should be obtained via <instance>.response('FLAGS') etc.
        rr-rerr�	READ-ONLYz%s is not writable�EXISTSN)rHrJr�rErA�get)rTr�rAr�r�r�r=r=r>�select�s
�zIMAP4.selectcCs|�d|||�S)zZSet a mailbox acl.

        (typ, [data]) = <instance>.setacl(mailbox, who, what)
        r.r�)rTr�r�Zwhatr=r=r>�setacl�szIMAP4.setaclcGs |jd|��\}}|�||d�S)z_(typ, [data]) = <instance>.setannotation(mailbox[, entry, attribute]+)
        Set ANNOTATIONs.r/r�)r/r�)rTryr�r�r=r=r>�
setannotationszIMAP4.setannotationcCs |�d||�\}}|�||d�S)ziSet the quota root's resource limits.

        (typ, [data]) = <instance>.setquota(root, limits)
        r0r�r�)rTr�Zlimitsr�r�r=r=r>�setquota	szIMAP4.setquotacGsFd}|d|dfdkr d|}|j|||f|��\}}|�|||�S)z�IMAP4rev1 extension SORT command.

        (typ, [data]) = <instance>.sort(sort_criteria, charset, search_criteria, ...)
        r1rr�r�r�r�)rTZ
sort_criteriar��search_criteriar�r�r�r=r=r>�sorts
z
IMAP4.sortNcCs�d}ts|�d��|jr"|�d��||jkr6|�d��|dkrFt��}|�|�\}}|dkr�|j|j	|j
d�|_	|j	�d�|_d|_|�
�n
|�d	��|�|||�S)
Nr2zSSL support missingzTLS session already establishedzTLS not supported by serverre�Zserver_hostnamerTzCouldn't establish TLS session)�HAVE_SSLr?rLr@rm�ssl�_create_stdlib_contextr��wrap_socketr�rUr�r�rkr�)rT�ssl_contextr�r�r�r=r=r>�starttls s&



�

zIMAP4.starttlscCs$d}|�|||�\}}|�|||�S)zpRequest named status conditions for mailbox.

        (typ, [data]) = <instance>.status(mailbox, names)
        r3r�)rTr��namesr�r�r�r=r=r>�status7szIMAP4.statuscCs>|d|dfdkrd|}|�d|||�\}}|�||d�S)z�Alters flag dispositions for messages in mailbox.

        (typ, [data]) = <instance>.store(message_set, command, flags)
        rr�r�r�r4rr�)rTr��commandr�r�r�r=r=r>�storeCszIMAP4.storecCs|�d|�S)zYSubscribe to new mailbox.

        (typ, [data]) = <instance>.subscribe(mailbox)
        r5r�r�r=r=r>�	subscribeNszIMAP4.subscribecGs*d}|j|||f|��\}}|�|||�S)z�IMAPrev1 extension THREAD command.

        (type, [data]) = <instance>.thread(threading_algorithm, charset, search_criteria, ...)
        r6r�)rTZthreading_algorithmr�r�r�r�r�r=r=r>�threadVszIMAP4.threadc	Gs�|��}|tkr|�d|��|jt|krL|�d||jd�t|�f��d}|j||f|��\}}|dkrt|}nd}|�|||�S)z�Execute "command arg ..." with messages identified by UID,
                rather than message number.

        (typ, [data]) = <instance>.uid(command, arg1, arg2, ...)

        Returns response appropriate to 'command'.
        zUnknown IMAP4 UID command: %s�9command %s illegal in state %s, only allowed in states %s�, r7)r,r1r6r)r�rpr?rE�joinr�r�)rTr�ryr�r�r�r=r=r>�uid`s��z	IMAP4.uidcCs|�d|�S)z_Unsubscribe from old mailbox.

        (typ, [data]) = <instance>.unsubscribe(mailbox)
        r8r�r�r=r=r>�unsubscribeyszIMAP4.unsubscribecGs,|��}|tkr|jft|<|j|f|��S)aAllow simple extension commands
                notified by server in CAPABILITY response.

        Assumes command is legal in current state.

        (typ, [data]) = <instance>.xatom(name, arg, ...)

        Returns response appropriate to extension command `name'.
        )r�rprEr��rTr�ryr=r=r>�xatom�s
zIMAP4.xatomcCs8|dkrd}|j}||kr*||�|�n
|g||<dS�N�)rHr�r�)rTr�r�Zurr=r=r>�_append_untagged�szIMAP4._append_untaggedcCs,|j�d�}|r(|�|d�|jd���dS)N�BYEr�r�)rHr�r@r�rZ)rT�byer=r=r>�
_check_bye�szIMAP4._check_byec

Gs�|jt|kr4d|_|�d||jd�t|�f��dD]}||jkr8|j|=q8d|jkrj|jsj|�d��|��}t	||j
�}|d|}|D]0}|dkr�q�t|t�r�t	||j
�}|d|}q�|j}|dk	�r
d|_t
|�t
|j�kr�|}nd}|t	dt|�|j
�}z|�|t�Wn2tk
�rN}	z|�d|	��W5d}	~	XYnX|dk�r^|S|���r||j|�r^|S�q^|�r�||j�}z|�|�|�t�Wn2tk
�r�}	z|�d|	��W5d}	~	XYnX|�s^�q�q^|S)	Nr�r�re�NO�BADr�z#mailbox status changed to READ-ONLY� z {%s}zsocket error: %s)rErprFr?rrHrJrA�_new_tag�bytesrZr�r��type�_commandr�r�r�rRr@rjrGrI)
rTr�ryr��tagr��argrFZ	literator�valr=r=r>r�sb��


�


 



 zIMAP4._commandc
Cs�|dk}|s|��z|j||d�\}}Wnj|jk
r`}z|�d||f��W5d}~XYn6|jk
r�}z|�d||f��W5d}~XYnX|s�|��|dkr�|�d|||f��||fS)Nr)�
expect_byezcommand: %s => %srz%s command error: %s %s)r�_get_tagged_responser@r?)rTr�rrxr�r�rr=r=r>�_command_complete�s"$zIMAP4._command_completecCsJ|��\}}|dgkr |�d��t|d|j�}|��}t|���|_dS)Nz"no CAPABILITY response from serverr�)r�r?r�rZr��tuple�splitrmr�r=r=r>rk
s

zIMAP4._get_capabilitiescCs�|��}|�|j|�rp|j�d�}||jkr:|�d|��|j�d�}t||j�}|j�d�}||gf|j|<n�d}|�t	|�s�|�|j
|�r�|j�d�}|jdkr�|�t|�r�|j�d�|_dS|�d|��|j�d�}t||j�}|j�d�}|dk�rd}|�r|d|}|�|j
|��rZt|j�d	��}|�|�}|�|||f�|��}�q|�||�|d
k�r�|�t|��r�|j�d�}t||j�}|�||j�d��|S)Nrzunexpected tagged response: %rrr�Zdata2zunexpected response: %rrrr�r)�	_get_line�_matchrh�mo�grouprGr@r�rZ�Untagged_responsera�ContinuationrIr_�intr�r�
Response_code)rT�resprr�r�Zdat2r�r�r=r=r>rjsH



zIMAP4._get_responsec
Cs�|j|}|dk	r|j|=|S|rDd}|j�|d�}|dk	rD||fS|��z|��Wq|jk
r~}z�W5d}~XYqXqdS)Nr	)rGrH�poprrjr@)rTrr�resultr�r
rr=r=r>rcs
zIMAP4._get_tagged_responsecCs>|��}|s|�d��|�d�s.|�d|��|dd�}|S)Nzsocket error: EOFrz#socket error: unterminated line: %r���)r�r@�endswithr�r=r=r>r�s

zIMAP4._get_linecCs|�|�|_|jdk	Srv)�matchr)rTZcre�sr=r=r>r�szIMAP4._matchcCs2|jtt|j�|j�}|jd|_d|j|<|S)Nr�)rgrr�rKrZrG)rTrr=r=r>r�s
zIMAP4._new_tagcCs$|�dd�}|�dd�}d|dS)N�\z\\�"z\")r�)rTrr=r=r>r��szIMAP4._quotecGs|�||j|f|���Srv)rrrr=r=r>r��szIMAP4._simple_commandcCs8|dkr||fS||jkr$|dgfS|j�|�}||fS)Nr
)rHr%)rTr�r�r�r�r=r=r>r��s

zIMAP4._untagged_response)r�r�)r�r�)r�F)N)F)Tr:r;r<�__doc__rPr?r@rA�
IMAP4_PORTrWrMrdrOrurwrzr~rNr�r�r�rQr}r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rxr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrrkrjrrrrr�r�r��_mesgZ_dump_urZ_logZ	print_logr=r=r=r>r�s�,*
		
	



 	

M	P
!$c@s:eZdZdZdedddfdd�Zdd�Zdefdd	�ZdS)
�	IMAP4_SSLa3IMAP4 client class over SSL connection

        Instantiate with: IMAP4_SSL([host[, port[, keyfile[, certfile[, ssl_context]]]]])

                host - host's name (default: localhost);
                port - port number (default: standard IMAP4 SSL port);
                keyfile - PEM formatted file that contains your private key (default: None);
                certfile - PEM formatted certificate chain file (default: None);
                ssl_context - a SSLContext object that contains your certificate chain
                              and private key (default: None)
                Note: if ssl_context is provided, then parameters keyfile or
                certfile should not be set otherwise ValueError is raised.

        for more documentation see the docstring of the parent class IMAP4.
        rBNcCs�|dk	r|dk	rtd��|dk	r0|dk	r0td��|dk	s@|dk	rVddl}|�dtd�||_||_|dkrxtj||d�}||_t	�
|||�dS)Nz8ssl_context and keyfile arguments are mutually exclusivez9ssl_context and certfile arguments are mutually exclusiverzEkeyfile and certfile are deprecated, use a custom ssl_context instead�)�certfile�keyfile)�
ValueError�warnings�warn�DeprecationWarningr3r2r�r�r�rrW)rTrUrVr3r2r�r5r=r=r>rW�s$��zIMAP4_SSL.__init__cCst�|�}|jj||jd�S)Nr�)rr~r�r�rU)rTr�r=r=r>r~s
�zIMAP4_SSL._create_socketcCst�|||�dS)z�Setup connection to remote server on "host:port".
                (default: localhost:standard IMAP4 SSL port).
            This connection will be used by the routines:
                read, readline, send, shutdown.
            N)rrNrSr=r=r>rNszIMAP4_SSL.open)r:r;r<r-�IMAP4_SSL_PORTrWr~rNr=r=r=r>r0�s�
r0c@sBeZdZdZdd�Zddd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)rz�IMAP4 client class over a stream

    Instantiate with: IMAP4_stream(command)

            "command" - a string that can be passed to subprocess.Popen()

    for more documentation see the docstring of the parent class IMAP4.
    cCs||_t�|�dSrv)r�rrW)rTr�r=r=r>rW/szIMAP4_stream.__init__NcCsNd|_d|_d|_d|_tj|jttjtjddd�|_	|j	j
|_|j	j|_
dS)z�Setup a stream connection.
        This connection will be used by the routines:
            read, readline, send, shutdown.
        NT)�bufsize�stdin�stdout�shellZ	close_fds)rUrVr�r��
subprocess�Popenr�r�PIPEr�r:�	writefiler;�readfilerSr=r=r>rN4s�
zIMAP4_stream.opencCs|j�|�Sr�)rAr�r�r=r=r>r�DszIMAP4_stream.readcCs
|j��S)r�)rAr�rbr=r=r>r�IszIMAP4_stream.readlinecCs|j�|�|j��dS)r�N)r@�write�flushr�r=r=r>r�NszIMAP4_stream.sendcCs"|j��|j��|j��dS)r�N)rAr�r@r��waitrbr=r=r>rQTs

zIMAP4_stream.shutdown)NN)
r:r;r<r-rWrNr�r�r�rQr=r=r=r>r#s

c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r�zcPrivate class to provide en/decoding
            for base64-based authentication conversation.
    cCs
||_dSrv)r�)rTZmechinstr=r=r>rWbsz_Authenticator.__init__cCs&|�|�|��}|dkrdS|�|�S)N�*)r�r�r�)rTr�Zretr=r=r>r�esz_Authenticator.processcCsnd}t|t�r|�d�}|rjt|�dkrB|dd�}|dd�}n|}d}t�|�}|r||dd�}q|S)Nrrc�0r�)r�r�r�r��binasciiZ
b2a_base64)rT�inpZoup�t�er=r=r>r�ks	


z_Authenticator.encodecCs|sdSt�|�Sr)rGZ
a2b_base64)rTrHr=r=r>r��sz_Authenticator.decodeN)r:r;r<r-rWr�r�r�r=r=r=r>r�\s
r�z0 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Decr�cCsi|]\}}|��|d�qS)r�)r�)�.0�nr*r=r=r>�
<dictcomp>�srMr�c	Cs�t�|�}|sdSt|�d�}|�d�}t|�d��}t|�d��}t|�d��}t|�d��}t|�d��}t|�d	��}	t|�d
��}
|	d|
d}|dkr�|}||||||d
d
d
f	}t�|�|}
t�|
�S)z�Parse an IMAP4 INTERNALDATE string.

    Return corresponding local time.  The return value is a
    time.struct_time tuple or None if the string has wrong format.
    N�mon�zonen�day�year�hour�min�sec�zoneh�zonem�<�-r�)	�InternalDater)�Mon2numrr"�calendarZtimegm�time�	localtime)r$rrNrOrPrQrRrSrTrUrVZzoneZtt�utcr=r=r>r�s$

cCs@d}d}tt|��}|r<t|d�\}}|||d�|}q|S)z-Convert integer to A-P string representation.rsABCDEFGHIJKLMNOP�r�)r"�abs�divmod)ZnumrZAP�modr=r=r>r	�scCs$t�|�}|sdSt|�d����S)z-Convert IMAP4 flags response to python tuple.r=r�)�Flagsr)rrr)r$rr=r=r>r
�s
cCst|ttf�r"t�|tj���}n�t|t�r�z
|j	}WnZt
k
r�tjr�|d}|dkrpt�
t�|��d}tjtjf|}ntj}YnXt|d�}t|dd�dt|�i�}nLt|t�r�|jdkr�td��|}n*t|t�r�|d|dfd	kr�|Std
��d�t|j�}|�|�S)a�Convert date_time to IMAP4 INTERNALDATE representation.

    Return string in form: '"DD-Mmm-YYYY HH:MM:SS +HHMM"'.  The
    date_time argument can be a number (int or float) representing
    seconds since epoch (as returned by time.time()), a 9-tuple
    representing local time, an instance of time.struct_time (as
    returned by time.localtime()), an aware datetime instance or a
    double-quoted string.  In the last case, it is assumed to already
    be in the correct format.
    �r�)ZsecondsN��tzinfozdate_time must be awarer)r,r,zdate_time not of a known typez"%d-{}-%Y %H:%M:%S %z")r�r"�floatrZ
fromtimestamprr^Z
astimezoner�	tm_gmtoffrsr\�daylightr]�mktime�altzonerrfr4r��format�MonthsZmonth�strftime)r�ZdtZgmtoffZdstZdeltaZfmtr=r=r>r�s2�





�__main__zd:s:)r=r=z-dz-s)rBzIMAP password for %s on %s: Z	localhostzJFrom: %(user)s@localhost%(lf)sSubject: IMAP4 test%(lf)s%(lf)sdata...%(lf)s�
)r�Zlfr�)r�)�
/tmp/xxx 1)r�)rqz/tmp/yyy)r��
/tmp/yyz 2r�rs)r�)z/tmpzyy*)r�rr)r�)NZSUBJECTZtest)r�)�1z(FLAGS INTERNALDATE RFC822))r�)rt�FLAGSz
(\Deleted))r�r=)r�r=)r�r=)r�r=)r�r=)r�)ZUIDVALIDITY)r)r,ZALL)r�)r�)rxr=cCsLt�d||f�tt|�|�\}}t�d|||f�|dkrH|d�|S)Nz%s %sz%s => %s %sr
r)�Mr/rq)�cmdryr�r�r=r=r>�run'srxrzPROTOCOL_VERSION = %szCAPABILITIES = %rr�)z/tmp/zyy%z.*"([^"]+)"$r�r�rrz%sz:(FLAGS INTERNALDATE RFC822.SIZE RFC822.HEADER RFC822.TEXT)z
All tests OK.z
Tests failed.z8
If you would like to see debugging output,
try: %s -d5
)Ur-rirGr�rfr[r}r=r{r\r[rrr�iorr�r��ImportError�__all__r�rCr.r8rlr�rpr\r!rcrYr^r_r�r#r rar]r`rr0r�rr�rrm�	enumeraterZrr	r
rr:ZgetoptZgetpass�argvZoptlistryr?rZstream_command�optr"rUZgetuserZUSERZPASSWDZ	test_mesgZ	test_seq1Z	test_seq2rxrvrEr/rnrmrwZmlr)rr�pathr�r�printr=r=r=r>�<module>sZH
�	�/



	

�l4
9,
#
)





��


�
�__pycache__/socketserver.cpython-38.opt-1.pyc000064400000061423151153537610015077 0ustar00U

e5d�j�	@sdZdZddlZddlZddlZddlZddlZddlmZddl	m
Z	dddd	d
ddd
dg	Zeed�rxe�
dddg�eed�r�e�
ddddg�eed�r�ejZnejZGdd�d�ZGdd�de�ZGdd�de�Zeed�r�Gdd�d�ZGdd�de�ZGdd �d �ZGd!d�d�Zeed��rNGd"d�dee�ZGd#d�dee�ZGd$d	�d	ee�ZGd%d
�d
ee�Zeed��r�Gd&d�de�ZGd'd�de�ZGd(d�dee�ZGd)d�dee�Z Gd*d�d�Z!Gd+d�de!�Z"Gd,d-�d-e�Z#Gd.d
�d
e!�Z$dS)/aqGeneric socket server classes.

This module tries to capture the various aspects of defining a server:

For socket-based servers:

- address family:
        - AF_INET{,6}: IP (Internet Protocol) sockets (default)
        - AF_UNIX: Unix domain sockets
        - others, e.g. AF_DECNET are conceivable (see <socket.h>
- socket type:
        - SOCK_STREAM (reliable stream, e.g. TCP)
        - SOCK_DGRAM (datagrams, e.g. UDP)

For request-based servers (including socket-based):

- client address verification before further looking at the request
        (This is actually a hook for any processing that needs to look
         at the request before anything else, e.g. logging)
- how to handle multiple requests:
        - synchronous (one request is handled at a time)
        - forking (each request is handled by a new process)
        - threading (each request is handled by a new thread)

The classes in this module favor the server type that is simplest to
write: a synchronous TCP/IP server.  This is bad class design, but
saves some typing.  (There's also the issue that a deep class hierarchy
slows down method lookups.)

There are five classes in an inheritance diagram, four of which represent
synchronous servers of four types:

        +------------+
        | BaseServer |
        +------------+
              |
              v
        +-----------+        +------------------+
        | TCPServer |------->| UnixStreamServer |
        +-----------+        +------------------+
              |
              v
        +-----------+        +--------------------+
        | UDPServer |------->| UnixDatagramServer |
        +-----------+        +--------------------+

Note that UnixDatagramServer derives from UDPServer, not from
UnixStreamServer -- the only difference between an IP and a Unix
stream server is the address family, which is simply repeated in both
unix server classes.

Forking and threading versions of each type of server can be created
using the ForkingMixIn and ThreadingMixIn mix-in classes.  For
instance, a threading UDP server class is created as follows:

        class ThreadingUDPServer(ThreadingMixIn, UDPServer): pass

The Mix-in class must come first, since it overrides a method defined
in UDPServer! Setting the various member variables also changes
the behavior of the underlying server mechanism.

To implement a service, you must derive a class from
BaseRequestHandler and redefine its handle() method.  You can then run
various versions of the service by combining one of the server classes
with your request handler class.

The request handler class must be different for datagram or stream
services.  This can be hidden by using the request handler
subclasses StreamRequestHandler or DatagramRequestHandler.

Of course, you still have to use your head!

For instance, it makes no sense to use a forking server if the service
contains state in memory that can be modified by requests (since the
modifications in the child process would never reach the initial state
kept in the parent process and passed to each child).  In this case,
you can use a threading server, but you will probably have to use
locks to avoid two requests that come in nearly simultaneous to apply
conflicting changes to the server state.

On the other hand, if you are building e.g. an HTTP server, where all
data is stored externally (e.g. in the file system), a synchronous
class will essentially render the service "deaf" while one request is
being handled -- which may be for a very long time if a client is slow
to read all the data it has requested.  Here a threading or forking
server is appropriate.

In some cases, it may be appropriate to process part of a request
synchronously, but to finish processing in a forked child depending on
the request data.  This can be implemented by using a synchronous
server and doing an explicit fork in the request handler class
handle() method.

Another approach to handling multiple simultaneous requests in an
environment that supports neither threads nor fork (or where these are
too expensive or inappropriate for the service) is to maintain an
explicit table of partially finished requests and to use a selector to
decide which request to work on next (or whether to handle a new
incoming request).  This is particularly important for stream services
where each client can potentially be connected for a long time (if
threads or subprocesses cannot be used).

Future work:
- Standard classes for Sun RPC (which uses either UDP or TCP)
- Standard mix-in classes to implement various authentication
  and encryption schemes

XXX Open problems:
- What to do with out-of-band data?

BaseServer:
- split generic "request" functionality out into BaseServer class.
  Copyright (C) 2000  Luke Kenneth Casson Leighton <lkcl@samba.org>

  example: read entries from a SQL database (requires overriding
  get_request() to return a table entry from the database).
  entry is processed by a RequestHandlerClass.

z0.4�N)�BufferedIOBase)�	monotonic�
BaseServer�	TCPServer�	UDPServer�ThreadingUDPServer�ThreadingTCPServer�BaseRequestHandler�StreamRequestHandler�DatagramRequestHandler�ThreadingMixIn�fork�ForkingUDPServer�ForkingTCPServer�ForkingMixIn�AF_UNIX�UnixStreamServer�UnixDatagramServer�ThreadingUnixStreamServer�ThreadingUnixDatagramServer�PollSelectorc@s�eZdZdZdZdd�Zdd�Zd&dd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�ZdS)'ra�Base class for server classes.

    Methods for the caller:

    - __init__(server_address, RequestHandlerClass)
    - serve_forever(poll_interval=0.5)
    - shutdown()
    - handle_request()  # if you do not use serve_forever()
    - fileno() -> int   # for selector

    Methods that may be overridden:

    - server_bind()
    - server_activate()
    - get_request() -> request, client_address
    - handle_timeout()
    - verify_request(request, client_address)
    - server_close()
    - process_request(request, client_address)
    - shutdown_request(request)
    - close_request(request)
    - service_actions()
    - handle_error()

    Methods for derived classes:

    - finish_request(request, client_address)

    Class variables that may be overridden by derived classes or
    instances:

    - timeout
    - address_family
    - socket_type
    - allow_reuse_address

    Instance variables:

    - RequestHandlerClass
    - socket

    NcCs ||_||_t��|_d|_dS)�/Constructor.  May be extended, do not override.FN)�server_address�RequestHandlerClass�	threadingZEvent�_BaseServer__is_shut_down�_BaseServer__shutdown_request)�selfrr�r�$/usr/lib64/python3.8/socketserver.py�__init__�s
zBaseServer.__init__cCsdS�zSCalled by constructor to activate the server.

        May be overridden.

        Nr�rrrr�server_activate�szBaseServer.server_activate��?c	Cst|j��zRt��B}|�|tj�|jsP|�|�}|jr:qP|rF|�	�|�
�q"W5QRXW5d|_|j��XdS)z�Handle one request at a time until shutdown.

        Polls for shutdown every poll_interval seconds. Ignores
        self.timeout. If you need to do periodic tasks, do them in
        another thread.
        FN)r�clearr�set�_ServerSelector�register�	selectors�
EVENT_READ�select�_handle_request_noblock�service_actions)rZ
poll_interval�selector�readyrrr�
serve_forever�s

zBaseServer.serve_forevercCsd|_|j��dS)z�Stops the serve_forever loop.

        Blocks until the loop has finished. This must be called while
        serve_forever() is running in another thread, or it will
        deadlock.
        TN)rr�waitr"rrr�shutdown�szBaseServer.shutdowncCsdS)z�Called by the serve_forever() loop.

        May be overridden by a subclass / Mixin to implement any code that
        needs to be run during the loop.
        Nrr"rrrr-�szBaseServer.service_actionsc
Cs�|j��}|dkr|j}n|jdk	r0t||j�}|dk	rBt�|}t��f}|�|tj�|�	|�}|rz|�
�W5QR�S|dk	rX|t�}|dkrX|��W5QR�SqXW5QRXdS)zOHandle one request, possibly blocking.

        Respects self.timeout.
        Nr)�socketZ
gettimeout�timeout�min�timer'r(r)r*r+r,�handle_timeout)rr4Zdeadliner.r/rrr�handle_requests 




zBaseServer.handle_requestcCs�z|��\}}Wntk
r&YdSX|�||�r�z|�||�Wq�tk
rn|�||�|�|�Yq�|�|��Yq�Xn
|�|�dS)z�Handle one request, without blocking.

        I assume that selector.select() has returned that the socket is
        readable before this function was called, so there should be no risk of
        blocking in get_request().
        N)�get_request�OSError�verify_request�process_request�	Exception�handle_error�shutdown_request�r�request�client_addressrrrr,/s

z"BaseServer._handle_request_noblockcCsdS)zcCalled if no new request arrives within self.timeout.

        Overridden by ForkingMixIn.
        Nrr"rrrr7FszBaseServer.handle_timeoutcCsdS)znVerify the request.  May be overridden.

        Return True if we should proceed with this request.

        Trr@rrrr;MszBaseServer.verify_requestcCs|�||�|�|�dS)zVCall finish_request.

        Overridden by ForkingMixIn and ThreadingMixIn.

        N)�finish_requestr?r@rrrr<UszBaseServer.process_requestcCsdS�zDCalled to clean-up the server.

        May be overridden.

        Nrr"rrr�server_close^szBaseServer.server_closecCs|�|||�dS)z8Finish one request by instantiating RequestHandlerClass.N)rr@rrrrCfszBaseServer.finish_requestcCs|�|�dS�z3Called to shutdown and close an individual request.N��
close_request�rrArrrr?jszBaseServer.shutdown_requestcCsdS�z)Called to clean up an individual request.NrrIrrrrHnszBaseServer.close_requestcCs@tdtjd�td|tjd�ddl}|��tdtjd�dS)ztHandle an error gracefully.  May be overridden.

        The default is to print a traceback and continue.

        z(----------------------------------------)�filez4Exception happened during processing of request fromrN)�print�sys�stderr�	traceback�	print_exc)rrArBrOrrrr>rs�zBaseServer.handle_errorcCs|S�Nrr"rrr�	__enter__szBaseServer.__enter__cGs|��dSrQ)rE)r�argsrrr�__exit__�szBaseServer.__exit__)r$)�__name__�
__module__�__qualname__�__doc__r4r r#r0r2r-r8r,r7r;r<rErCr?rHr>rRrTrrrrr�s&+

	
c@sfeZdZdZejZejZdZ	dZ
ddd�Zdd�Zd	d
�Z
dd�Zd
d�Zdd�Zdd�Zdd�ZdS)ra3Base class for various socket-based server classes.

    Defaults to synchronous IP stream (i.e., TCP).

    Methods for the caller:

    - __init__(server_address, RequestHandlerClass, bind_and_activate=True)
    - serve_forever(poll_interval=0.5)
    - shutdown()
    - handle_request()  # if you don't use serve_forever()
    - fileno() -> int   # for selector

    Methods that may be overridden:

    - server_bind()
    - server_activate()
    - get_request() -> request, client_address
    - handle_timeout()
    - verify_request(request, client_address)
    - process_request(request, client_address)
    - shutdown_request(request)
    - close_request(request)
    - handle_error()

    Methods for derived classes:

    - finish_request(request, client_address)

    Class variables that may be overridden by derived classes or
    instances:

    - timeout
    - address_family
    - socket_type
    - request_queue_size (only for stream sockets)
    - allow_reuse_address

    Instance variables:

    - server_address
    - RequestHandlerClass
    - socket

    �FTcCsTt�|||�t�|j|j�|_|rPz|��|��Wn|���YnXdS)rN)rr r3�address_family�socket_type�server_bindr#rE)rrrZbind_and_activaterrrr �s�zTCPServer.__init__cCs8|jr|j�tjtjd�|j�|j�|j��|_dS)zOCalled by constructor to bind the socket.

        May be overridden.

        �N)�allow_reuse_addressr3�
setsockoptZ
SOL_SOCKETZSO_REUSEADDRZbindrZgetsocknamer"rrrr\�szTCPServer.server_bindcCs|j�|j�dSr!)r3Zlisten�request_queue_sizer"rrrr#�szTCPServer.server_activatecCs|j��dSrD)r3�closer"rrrrE�szTCPServer.server_closecCs
|j��S)zMReturn socket file number.

        Interface required by selector.

        )r3�filenor"rrrrb�szTCPServer.filenocCs
|j��S)zYGet the request and client address from the socket.

        May be overridden.

        )r3Zacceptr"rrrr9�szTCPServer.get_requestcCs4z|�tj�Wntk
r$YnX|�|�dSrF)r2r3ZSHUT_WRr:rHrIrrrr?�s
zTCPServer.shutdown_requestcCs|��dSrJ)rarIrrrrH�szTCPServer.close_requestN)T)rUrVrWrXr3ZAF_INETrZZSOCK_STREAMr[r`r^r r\r#rErbr9r?rHrrrrr�s-


c@s>eZdZdZdZejZdZdd�Z	dd�Z
dd	�Zd
d�ZdS)
rzUDP server class.Fi cCs |j�|j�\}}||jf|fSrQ)r3Zrecvfrom�max_packet_size)r�dataZclient_addrrrrr9szUDPServer.get_requestcCsdSrQrr"rrrr#szUDPServer.server_activatecCs|�|�dSrQrGrIrrrr?szUDPServer.shutdown_requestcCsdSrQrrIrrrrHszUDPServer.close_requestN)
rUrVrWrXr^r3Z
SOCK_DGRAMr[rcr9r#r?rHrrrrrscsVeZdZdZdZdZdZdZdd�dd	�Zd
d�Z	dd
�Z
dd�Z�fdd�Z�Z
S)rz5Mix-in class to handle each request in a new process.i,N�(TF��blockingc	Cs�|jdkrdSt|j�|jkrvz t�dd�\}}|j�|�Wqtk
r\|j��Yqtk
rrYqvYqXq|j�	�D]f}z.|r�dntj
}t�||�\}}|j�|�Wq�tk
r�|j�|�Yq�tk
r�Yq�Xq�dS)z7Internal routine to wait for children that have exited.N���r)�active_children�len�max_children�os�waitpid�discard�ChildProcessErrorr%r:�copy�WNOHANG)rrg�pid�_�flagsrrr�collect_children(s&
zForkingMixIn.collect_childrencCs|��dS)zvWait for zombies after self.timeout seconds of inactivity.

            May be extended, do not override.
            N�rur"rrrr7KszForkingMixIn.handle_timeoutcCs|��dS)z�Collect the zombie child processes regularly in the ForkingMixIn.

            service_actions is called in the BaseServer's serve_forever loop.
            Nrvr"rrrr-RszForkingMixIn.service_actionscCs�t��}|r8|jdkrt�|_|j�|�|�|�dSd}z:z|�||�d}Wn t	k
rr|�
||�YnXW5z|�|�W5t�|�XXdS)z-Fork a new subprocess to process the request.Nr]r)rlr
rir&�addrH�_exitr?rCr=r>)rrArBrrZstatusrrrr<Ys 

zForkingMixIn.process_requestcst���|j|jd�dS)Nrf)�superrEru�block_on_closer"��	__class__rrrErs
zForkingMixIn.server_close)rUrVrWrXr4rirkrzrur7r-r<rE�
__classcell__rrr{rrs#cs8eZdZdZ�fdd�Zdd�Zdd�Zdd	�Z�ZS)
�_Threadsz2
    Joinable list of all non-daemon threads.
    cs"|��|jrdSt��|�dSrQ)�reap�daemonry�append�r�threadr{rrr�{sz_Threads.appendcCsg|dd�|dd�<}|SrQr)r�resultrrr�pop_all�sz_Threads.pop_allcCs|��D]}|��qdSrQ)r��joinr�rrrr��sz
_Threads.joincCsdd�|D�|dd�<dS)Ncss|]}|��r|VqdSrQ)Zis_alive)�.0r�rrr�	<genexpr>�sz _Threads.reap.<locals>.<genexpr>rr"rrrr�sz
_Threads.reap)	rUrVrWrXr�r�r�rr}rrr{rr~ws
r~c@s eZdZdZdd�Zdd�ZdS)�
_NoThreadsz)
    Degenerate version of _Threads.
    cCsdSrQrr�rrrr��sz_NoThreads.appendcCsdSrQrr"rrrr��sz_NoThreads.joinN)rUrVrWrXr�r�rrrrr��sr�cs>eZdZdZdZdZe�Zdd�Zdd�Z	�fdd	�Z
�ZS)
rz4Mix-in class to handle each request in a new thread.FTc	CsHz6z|�||�Wn tk
r2|�||�YnXW5|�|�XdS)zgSame as in BaseServer but as a thread.

        In addition, exception handling is done here.

        N)r?rCr=r>r@rrr�process_request_thread�s
z%ThreadingMixIn.process_request_threadcCsL|jrt|��dt��tj|j||fd�}|j|_|j	�
|�|��dS)z*Start a new thread to process the request.�_threads)�targetrSN)rz�vars�
setdefaultr~rZThreadr��daemon_threadsr�r�r��start)rrArB�trrrr<�s�zThreadingMixIn.process_requestcst���|j��dSrQ)ryrEr�r�r"r{rrrE�s
zThreadingMixIn.server_close)rUrVrWrXr�rzr�r�r�r<rEr}rrr{rr�s

c@seZdZdS)rN�rUrVrWrrrrr�sc@seZdZdS)rNr�rrrrr�sc@seZdZdS)rNr�rrrrr�sc@seZdZdS)rNr�rrrrr�sc@seZdZejZdS)rN�rUrVrWr3rrZrrrrr�sc@seZdZejZdS)rNr�rrrrr�sc@seZdZdS)rNr�rrrrr�sc@seZdZdS)rNr�rrrrr�sc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r	a�Base class for request handler classes.

    This class is instantiated for each request to be handled.  The
    constructor sets the instance variables request, client_address
    and server, and then calls the handle() method.  To implement a
    specific service, all you need to do is to derive a class which
    defines a handle() method.

    The handle() method can find the request as self.request, the
    client address as self.client_address, and the server (in case it
    needs access to per-server information) as self.server.  Since a
    separate instance is created for each request, the handle() method
    can define other arbitrary instance variables.

    cCs6||_||_||_|��z|��W5|��XdSrQ)rArB�server�setup�finish�handle)rrArBr�rrrr �szBaseRequestHandler.__init__cCsdSrQrr"rrrr��szBaseRequestHandler.setupcCsdSrQrr"rrrr��szBaseRequestHandler.handlecCsdSrQrr"rrrr��szBaseRequestHandler.finishN)rUrVrWrXr r�r�r�rrrrr	�s

c@s0eZdZdZdZdZdZdZdd�Zdd	�Z	dS)
r
z4Define self.rfile and self.wfile for stream sockets.rhrNFcCsz|j|_|jdk	r |j�|j�|jr:|j�tjtjd�|j�	d|j
�|_|jdkrdt
|j�|_n|j�	d|j�|_dS)NT�rbr�wb)rAZ
connectionr4Z
settimeout�disable_nagle_algorithmr_r3ZIPPROTO_TCPZTCP_NODELAYZmakefile�rbufsize�rfile�wbufsize�
_SocketWriter�wfiler"rrrr�s

�
zStreamRequestHandler.setupcCsF|jjs.z|j��Wntjk
r,YnX|j��|j��dSrQ)r��closed�flushr3�errorrar�r"rrrr�#s
zStreamRequestHandler.finish)
rUrVrWrXr�r�r4r�r�r�rrrrr
s	
c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)r�z�Simple writable BufferedIOBase implementation for a socket

    Does not hold data in a buffer, avoiding any need to call flush().cCs
||_dSrQ)�_sock)rZsockrrrr 3sz_SocketWriter.__init__cCsdS)NTrr"rrr�writable6sz_SocketWriter.writablec
Cs2|j�|�t|��}|jW5QR�SQRXdSrQ)r�Zsendall�
memoryview�nbytes)r�bZviewrrr�write9s
z_SocketWriter.writecCs
|j��SrQ)r�rbr"rrrrb>sz_SocketWriter.filenoN)rUrVrWrXr r�r�rbrrrrr�.s
r�c@s eZdZdZdd�Zdd�ZdS)rz6Define self.rfile and self.wfile for datagram sockets.cCs2ddlm}|j\|_|_||j�|_|�|_dS)Nr)�BytesIO)�ior�rAZpacketr3r�r�)rr�rrrr�EszDatagramRequestHandler.setupcCs|j�|j��|j�dSrQ)r3Zsendtor��getvaluerBr"rrrr�KszDatagramRequestHandler.finishN)rUrVrWrXr�r�rrrrrAs)%rX�__version__r3r)rlrMrr�rr6r�__all__�hasattr�extendrr'ZSelectSelectorrrrr�listr~r�rrrrrrrrrr	r
r�rrrrr�<module>sbz�

�
n~
X(.-__pycache__/codeop.cpython-38.opt-1.pyc000064400000014423151153537610013627 0ustar00U

e5d��@sldZddlZddlZdd�ejD�ZdddgZdZd	d
�Zdd�Zddd�Z	Gdd�d�Z
Gdd�d�ZdS)a[Utilities to compile possibly incomplete Python source code.

This module provides two interfaces, broadly similar to the builtin
function compile(), which take program text, a filename and a 'mode'
and:

- Return code object if the command is complete and valid
- Return None if the command is incomplete
- Raise SyntaxError, ValueError or OverflowError if the command is a
  syntax error (OverflowError and ValueError can be produced by
  malformed literals).

Approach:

First, check if the source consists entirely of blank lines and
comments; if so, replace it with 'pass', because the built-in
parser doesn't always do the right thing for these.

Compile three times: as is, with \n, and with \n\n appended.  If it
compiles as is, it's complete.  If it compiles with one \n appended,
we expect more.  If it doesn't compile either way, we compare the
error we get when compiling with \n or \n\n appended.  If the errors
are the same, the code is broken.  But if the errors are different, we
expect more.  Not intuitive; not even guaranteed to hold in future
releases; but this matches the compiler's behavior from Python 1.4
through 2.2, at least.

Caveat:

It is possible (but not likely) that the parser stops parsing with a
successful outcome before reaching the end of the source; in this
case, trailing symbols may be ignored instead of causing an error.
For example, a backslash followed by two newlines may be followed by
arbitrary garbage.  This will be fixed once the API for the parser is
better.

The two interfaces are:

compile_command(source, filename, symbol):

    Compiles a single command in the manner described above.

CommandCompiler():

    Instances of this class have __call__ methods identical in
    signature to compile_command; the difference is that if the
    instance compiles program text containing a __future__ statement,
    the instance 'remembers' and compiles all subsequent program texts
    with the statement in force.

The module also provides another class:

Compile():

    Instances of this class act like the built-in function compile,
    but with 'memory' in the sense described above.
�NcCsg|]}tt|��qS�)�getattr�
__future__)�.0Zfnamerr�/usr/lib64/python3.8/codeop.py�
<listcomp>>s�r�compile_command�Compile�CommandCompilericCsZ|�d�D] }|��}|r
|ddkr
q8q
|dkr8d}d}}}d}}	}
z||||�}Wn"tk
r�}zW5d}~XYnXt����t�d�z||d||�}	Wn&tk
r�}z|}W5d}~XYnXz||d||�}
Wn(tk
�r}z|}W5d}~XYnXW5QRXz.|�r,|W�"S|	�sHt|�t|�k�rH|�W5d}}XdS)N�
r�#�eval�pass�errorz

)�split�strip�SyntaxError�warnings�catch_warnings�simplefilter�repr)�compiler�source�filename�symbol�line�errZerr1Zerr2�code�code1�code2�errr�_maybe_compileEs8

 r!cCst|||t�S�N)�compile�PyCF_DONT_IMPLY_DEDENT�rrrrrr�_compilensr&�<input>�singlecCstt|||�S)a�Compile a command and determine whether it is incomplete.

    Arguments:

    source -- the source string; may contain \n characters
    filename -- optional filename from which source was read; default
                "<input>"
    symbol -- optional grammar start symbol; "single" (default), "exec"
              or "eval"

    Return value / exceptions raised:

    - Return a code object if the command is complete and valid
    - Return None if the command is incomplete
    - Raise SyntaxError, ValueError or OverflowError if the command is a
      syntax error (OverflowError and ValueError can be produced by
      malformed literals).
    )r!r&r%rrrrqsc@s eZdZdZdd�Zdd�ZdS)r	z�Instances of this class behave much like the built-in compile
    function, but if one is used to compile text containing a future
    statement, it "remembers" and compiles all subsequent program texts
    with the statement in force.cCs
t|_dSr")r$�flags��selfrrr�__init__�szCompile.__init__cCs<t||||jd�}tD] }|j|j@r|j|jO_q|S)N�)r#r)�	_features�co_flagsZ
compiler_flag)r+rrrZcodeobZfeaturerrr�__call__�s
zCompile.__call__N��__name__�
__module__�__qualname__�__doc__r,r0rrrrr	�sc@s"eZdZdZdd�Zd	dd�ZdS)
r
a(Instances of this class have __call__ methods identical in
    signature to compile_command; the difference is that if the
    instance compiles program text containing a __future__ statement,
    the instance 'remembers' and compiles all subsequent program texts
    with the statement in force.cCst�|_dSr")r	rr*rrrr,�szCommandCompiler.__init__r'r(cCst|j|||�S)a�Compile a command and determine whether it is incomplete.

        Arguments:

        source -- the source string; may contain \n characters
        filename -- optional filename from which source was read;
                    default "<input>"
        symbol -- optional grammar start symbol; "single" (default) or
                  "eval"

        Return value / exceptions raised:

        - Return a code object if the command is complete and valid
        - Return None if the command is incomplete
        - Raise SyntaxError, ValueError or OverflowError if the command is a
          syntax error (OverflowError and ValueError can be produced by
          malformed literals).
        )r!r)r+rrrrrrr0�szCommandCompiler.__call__N)r'r(r1rrrrr
�s)r'r()r5rrZall_feature_namesr.�__all__r$r!r&rr	r
rrrr�<module>s:�
)
__pycache__/_compression.cpython-38.pyc000064400000010064151153537610014114 0ustar00U

e5d��@s:dZddlZejZGdd�dej�ZGdd�dej�ZdS)z7Internal classes used by the gzip, lzma and bz2 modules�Nc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�
BaseStreamzMode-checking helper functions.cCs|jrtd��dS)NzI/O operation on closed file)�closed�
ValueError��self�r�$/usr/lib64/python3.8/_compression.py�_check_not_closedszBaseStream._check_not_closedcCs|��st�d��dS)NzFile not open for reading)�readable�io�UnsupportedOperationrrrr�_check_can_readszBaseStream._check_can_readcCs|��st�d��dS)NzFile not open for writing)�writablerrrrrr�_check_can_writeszBaseStream._check_can_writecCs(|��st�d��|��s$t�d��dS)Nz3Seeking is only supported on files open for readingz3The underlying file object does not support seeking)r
rr�seekablerrrr�_check_can_seeks
zBaseStream._check_can_seekN)�__name__�
__module__�__qualname__�__doc__r	r
rrrrrrr	s
rcsjeZdZdZdd�Zddd�Z�fdd�Zd	d
�Zdd�Zddd�Z	dd�Z
ejfdd�Z
dd�Z�ZS)�DecompressReaderz5Adapts the decompressor API to a RawIOBase reader APIcCsdS)NTrrrrrr
$szDecompressReader.readablercKs>||_d|_d|_d|_||_||_|jf|j�|_||_dS)NFr���)�_fp�_eof�_pos�_size�_decomp_factory�_decomp_args�
_decompressor�_trailing_error)r�fpZdecomp_factoryZtrailing_errorZdecomp_argsrrr�__init__'szDecompressReader.__init__csd|_t���S�N)r�super�closer��	__class__rrr$;szDecompressReader.closecCs
|j��Sr")rrrrrrr?szDecompressReader.seekablec
CsPt|��:}|�d��$}|�t|��}||dt|��<W5QRXW5QRXt|�S)N�B)�
memoryview�cast�read�len)r�bZviewZ	byte_view�datarrr�readintoBs$zDecompressReader.readintorcCs�|dkr|��S|r|jrdSd}|jjr�|jjp<|j�t�}|sDq�|jf|j	�|_z|j�
||�}Wq�|jk
r�Yq�Yq�Xn4|jjr�|j�t�}|s�t
d��nd}|j�
||�}|r"q�q"|s�d|_|j|_dS|jt|�7_|S)Nr�zACompressed file ended before the end-of-stream marker was reachedT)�readallrr�eofZunused_datarr*�BUFFER_SIZErr�
decompressrZneeds_input�EOFErrorrrr+)r�sizer-Zrawblockrrrr*Hs@

��
zDecompressReader.readcCs,|j�d�d|_d|_|jf|j�|_dS)NrF)r�seekrrrrrrrrr�_rewindrszDecompressReader._rewindcCs�|tjkrnR|tjkr"|j|}n<|tjkrP|jdkrD|�tj�rDq6|j|}ntd�	|���||jkrr|�
�n
||j8}|dkr�|�ttj|��}|s�q�|t|�8}q||jS)NrzInvalid value for whence: {})
r�SEEK_SET�SEEK_CURr�SEEK_ENDrr*�DEFAULT_BUFFER_SIZEr�formatr7�minr+)r�offset�whencer-rrrr6xs&






zDecompressReader.seekcCs|jS)z!Return the current file position.)rrrrr�tell�szDecompressReader.tell)r)r)rrrrr
r!r$rr.r*r7rr8r6r@�
__classcell__rrr%rr!s

*r)rrr;r2�BufferedIOBaser�	RawIOBaserrrrr�<module>s__pycache__/dis.cpython-38.opt-1.pyc000064400000036702151153537610013141 0ustar00U

e5dZP�@sdZddlZddlZddlZddlZddlTddlmZddddd	d
ddd
ddgeZ[ejej	ej
eee
fZedZdedfedfedffZedZdZdd�ZdVddd�dd�ZdWdd�dd�Zdddd d!d"d#d$d%d&d'�
Zd(d)�Zd*d+�Zd,d�Zd-d.�Zdd�d/d�Ze� d0d1�Z!d2e!j"_d3e!j_d4e!j#_d5e!j$_d6e!j%_d7e!j&_d8e!j'_d9e!j(_d:Z)d;Z*Gd<d�de!�Z+dd=�d>d
�Z,d?d@�Z-dAdB�Z.dXdCdD�Z/dYdd�dFd�Z0ddd�dGdH�Z1dZdddI�dJdK�Z2dLdM�Z3e0Z4dNdO�Z5dPd�Z6dQd
�Z7GdRd�d�Z8dSdT�Z9e:dUk�re9�dS)[z0Disassembler of Python byte code into mnemonics.�N)�*)�__all__�	code_info�dis�disassemble�distb�disco�findlinestarts�
findlabels�	show_code�get_instructions�Instruction�Bytecode�FORMAT_VALUE)N��str�repr�ascii�
MAKE_FUNCTION)�defaultsZ
kwdefaultsZannotationsZclosurecCs6zt||d�}Wn tk
r0t||d�}YnX|S)z�Attempts to compile the given source, first as an expression and
       then as a statement if the first approach fails.

       Utility function to accept strings in functions that otherwise
       expect code objects
    �eval�exec)�compile�SyntaxError)�source�name�c�r�/usr/lib64/python3.8/dis.py�_try_compiles
r��file�depthcCsh|dkrt|d�dSt|d�r&|j}t|d�r8|j}n4t|d�rJ|j}n"t|d�r\|j}nt|d�rl|j}t|d�r�t|j�	��}|D]p\}}t
|t�r�td	||d�zt
|||d
�Wn0tk
r�}ztd||d�W5d}~XYnXt|d�q�nht|d��rt|||d
�nLt
|ttf��r6t||d�n.t
|t��rRt|||d
�ntd
t|�j��dS)a0Disassemble classes, methods, functions, and other compiled objects.

    With no argument, disassemble the last traceback.

    Compiled objects currently include generator objects, async generator
    objects, and coroutine objects, all of which store their code object
    in a special attribute.
    N�r!�__func__�__code__�gi_code�ag_code�cr_code�__dict__zDisassembly of %s:r zSorry:�co_code�(don't know how to disassemble %s objects)r�hasattrr$r%r&r'r(�sortedr)�items�
isinstance�
_have_code�printr�	TypeError�_disassemble_recursive�bytes�	bytearray�_disassemble_bytesr�_disassemble_str�type�__name__)�xr!r"r.rZx1�msgrrrr+s@	







 �r#cCsX|dkr@z
tj}Wntk
r0td�d�YnX|jr@|j}q2t|jj|j|d�dS)z2Disassemble a traceback (default: last traceback).Nz no last traceback to disassembler#)	�sys�last_traceback�AttributeError�RuntimeError�tb_nextr�tb_frame�f_code�tb_lasti)�tbr!rrrrXs
Z	OPTIMIZEDZ	NEWLOCALSZVARARGSZVARKEYWORDSZNESTEDZ	GENERATORZNOFREEZ	COROUTINEZITERABLE_COROUTINEZASYNC_GENERATOR)
������ �@��icCs`g}td�D]:}d|>}||@r|�t�|t|���||N}|sqVq|�t|��d�|�S)z+Return pretty representation of code flags.rJrE�, )�range�append�COMPILER_FLAG_NAMES�get�hex�join)�flags�names�i�flagrrr�pretty_flagsrsrYcCs�t|d�r|j}t|d�r"|j}n4t|d�r4|j}n"t|d�rF|j}nt|d�rV|j}t|t�rjt|d�}t|d�rx|St	dt
|�j��d	S)
zDHelper to handle methods, compiled or raw code objects, and strings.r$r%r&r'r(z
<disassembly>r*r+N)r,r$r%r&r'r(r/rrr2r8r9�r:rrr�_get_code_object�s"







�r[cCstt|��S)z1Formatted details of methods, functions, or code.)�_format_code_infor[rZrrrr�scCs�g}|�d|j�|�d|j�|�d|j�|�d|j�|�d|j�|�d|j�|�d|j�|�dt|j	��|j
r�|�d	�t|j
�D]}|�d
|�q�|jr�|�d�t|j�D]}|�d|�q�|j
�r|�d
�t|j
�D]}|�d|��q|j�rH|�d�t|j�D]}|�d|��q2|j�rz|�d�t|j�D]}|�d|��qdd�|�S)NzName:              %szFilename:          %szArgument count:    %szPositional-only arguments: %szKw-only arguments: %szNumber of locals:  %szStack size:        %szFlags:             %sz
Constants:z%4d: %rzNames:z%4d: %szVariable names:zFree variables:zCell variables:�
)rP�co_name�co_filename�co_argcount�co_posonlyargcount�co_kwonlyargcount�
co_nlocals�co_stacksizerY�co_flags�	co_consts�	enumerate�co_names�co_varnames�co_freevars�co_cellvarsrT)�co�linesZi_cZi_nrrrr\�s<




r\cCstt|�|d�dS)z}Print details of methods, functions, or code to *file*.

    If *file* is not provided, the output is printed on stdout.
    r#N)r1r)rlr!rrrr�s�_InstructionzBopname opcode arg argval argrepr offset starts_line is_jump_targetz!Human readable name for operationzNumeric code for operationz6Numeric argument to operation (if any), otherwise Nonez4Resolved arg value (if known), otherwise same as argz0Human readable description of operation argumentz1Start index of operation within bytecode sequencez4Line started by this opcode (if any), otherwise Nonez1True if other code jumps to here, otherwise False��c@seZdZdZddd�ZdS)	r
aKDetails for a bytecode operation

       Defined fields:
         opname - human readable name for operation
         opcode - numeric code for operation
         arg - numeric argument to operation (if any), otherwise None
         argval - resolved arg value (if known), otherwise same as arg
         argrepr - human readable description of operation argument
         offset - start index of operation within bytecode sequence
         starts_line - line started by this opcode (if any), otherwise None
         is_jump_target - True if other code jumps to here, otherwise False
    �FrGcCs�g}|r:|jdk	r,d|}|�||j�n|�d|�|rJ|�d�n
|�d�|jrf|�d�n
|�d�|�t|j��|��|�|j�t��|j	dk	r�|�t|j	��t
��|jr�|�d|jd	�d�|��
�S)
a%Format instruction details for inclusion in disassembly output

        *lineno_width* sets the width of the line number field (0 omits it)
        *mark_as_current* inserts a '-->' marker arrow as part of the line
        *offset_width* sets the width of the instruction offset field
        Nz%%%dd� z-->z   z>>z  �(�))�starts_linerP�is_jump_targetr�offset�rjust�opname�ljust�
_OPNAME_WIDTH�arg�_OPARG_WIDTH�argreprrT�rstrip)�self�lineno_widthZmark_as_current�offset_widthZfieldsZ
lineno_fmtrrr�_disassemble�s&



zInstruction._disassembleN)rqFrG)r9�
__module__�__qualname__�__doc__r�rrrrr
�s
)�
first_linecCsTt|�}|j|j}tt|��}|dk	r4||j}nd}t|j|j|j	|j
|||�S)a�Iterator for the opcodes in methods, functions or code

    Generates a series of Instruction named tuples giving the details of
    each operations in the supplied code.

    If *first_line* is not None, it indicates the line number that should
    be reported for the first source line in the disassembled code.
    Otherwise, the source line information (if any) is taken directly from
    the disassembled code object.
    Nr)r[rkrj�dictr	�co_firstlineno�_get_instructions_bytesr*rirhrf)r:r�rl�
cell_names�
linestarts�line_offsetrrrrs�cCs |}|dk	r||}|t|�fS)z�Helper to get optional details about const references

       Returns the dereferenced constant and its repr if the constant
       list is defined.
       Otherwise returns the constant index and its repr().
    N�r)Zconst_indexZ
const_list�argvalrrr�_get_const_infosr�cCs*|}|dk	r||}|}nt|�}||fS)z�Helper to get optional details about named references

       Returns the dereferenced name as both value and repr if the name
       list is defined.
       Otherwise returns the name index and its repr().
    Nr�)Z
name_indexZ	name_listr�r~rrr�_get_name_info'sr�c
#s�t|�}d}t|�D�]r\}	}
�|dk	rD|�|	d�}|dk	rD||7}|	|k}d}d}
�dk	�rl�}|
tkrzt�|�\}}
n�|
tkr�t�|�\}}
n�|
tkr�|	d�}dt|�}
n�|
t	kr�t�|�\}}
n�|
t
kr�t�}|}
n�|
tkr�t�|�\}}
nr|
t
k�rFt�d@\}}
|t�d@�f}|d�rl|
�r<|
d7}
|
d	7}
n&|
tk�rld��fd
d�tt�D��}
tt|
|
�||
|	||�VqdS)a&Iterate over the instructions in a bytecode string.

    Generates a sequence of Instruction namedtuples giving the details of each
    opcode.  Additional information about the code's runtime environment
    (e.g. variable names, constants) can be specified using optional
    arguments.

    NrrFzto rqrGrErNzwith formatc3s"|]\}}�d|>@r|VqdS)rENr)�.0rW�s�r|rr�	<genexpr>gs�z*_get_instructions_bytes.<locals>.<genexpr>)r
�_unpack_opargsrRZhasconstr�Zhasnamer��hasjrelrZhaslocalZ
hascompareZcmp_opZhasfreer�FORMAT_VALUE_CONVERTERS�boolrrTrg�MAKE_FUNCTION_FLAGSr
ry)�code�varnamesrV�	constants�cellsr�r��labelsrurw�oprvr�r~rr�rr�7sV






�r����c
Cs<|j|j}tt|��}t|j||j|j|j|||d�dS)zDisassemble a code object.r#N)	rkrjr�r	r6r*rirhrf)rl�lastir!r�r�rrrrms�cCspt||d�|dks|dkrl|dk	r,|d}|jD]8}t|d�r2t|d�td|f|d�t|||d�q2dS)Nr#rrEr*zDisassembly of %r:r )rrfr,r1r3)rlr!r"r:rrrr3ts


r3)r!r�c	Cs�|dk	}	|	r8t|���|}
|
dkr2tt|
��}q<d}nd}t|�d}|dkr^tt|��}
nd}
t|||||||d�D]J}|	o�|jdk	o�|jdk}|r�t|d�|j|k}t|�|||
�|d�qxdS)	Ni�rqrrFi'rG�r�r#)	�max�values�lenrr�rurwr1r�)r�r�r�rVr�r�r�r!r�Zshow_linenoZ	maxlinenor�Z	maxoffsetr�ZinstrZnew_source_lineZis_current_instrrrrr6s8�
��

�r6cKstt|d�f|�dS)z<Compile the source string, then disassemble the code object.z<dis>N)r3r)r�kwargsrrrr7�sr7ccsdd}tdt|�d�D]J}||}|tkrN||d|B}|tkrH|d>nd}nd}|||fVqdS)NrrFrErH)rOr�Z
HAVE_ARGUMENTZEXTENDED_ARG)r�Zextended_argrWr�r|rrrr��sr�cCs\g}t|�D]J\}}}|dk	r|tkr4|d|}n|tkr|}nq||kr|�|�q|S)z`Detect all offsets in a byte code which are jump targets.

    Return the list of offsets.

    NrF)r�r�ZhasjabsrP)r�r�rwr�r|Zlabelrrrr
�sc	cs�|jddd�}|jddd�}t|j�}d}|j}d}t||�D]P\}}|rz||krd||fV|}||7}||krzdS|dkr�|d8}||7}qB||kr�||fVdS)z�Find the offsets in a byte code which are start of lines in the source.

    Generate pairs (offset, lineno) as described in Python/compile.c.

    rNrFrErLrM)�	co_lnotabr�r*r��zip)	r�Zbyte_incrementsZline_incrementsZbytecode_lenZ
lastlineno�linenoZaddrZ	byte_incrZ	line_incrrrrr	�s&


c@sLeZdZdZddd�dd�Zdd�Zdd	�Zed
d��Zdd
�Z	dd�Z
dS)raThe bytecode operations of a piece of code

    Instantiate this with a function, method, other compiled object, string of
    code, or a code object (as returned by compile()).

    Iterating over this yields the bytecode operations as Instruction instances.
    N)r��current_offsetcCsdt|�|_}|dkr&|j|_d|_n||_||j|_|j|j|_tt	|��|_
||_||_dS)Nr)
r[�codeobjr�r��_line_offsetrkrj�_cell_namesr�r	�_linestarts�_original_objectr�)r�r:r�r�rlrrr�__init__�szBytecode.__init__c	Cs*|j}t|j|j|j|j|j|j|jd�S)Nr�)	r�r�r*rirhrfr�r�r�)r�rlrrr�__iter__�s�zBytecode.__iter__cCsd�|jj|j�S)Nz{}({!r}))�format�	__class__r9r��r�rrr�__repr__�s
�zBytecode.__repr__cCs |jr|j}q||jj|jd�S)z/ Construct a Bytecode from the given traceback )r�)r@rArBrC)�clsrDrrr�from_traceback�szBytecode.from_tracebackcCs
t|j�S)z3Return formatted information about the code object.)r\r�r�rrr�infosz
Bytecode.infocCsl|j}|jdk	r|j}nd}t���>}t|j|j|j|j|j	|j
|j||d�	|��W5QR�SQRXdS)z3Return a formatted view of the bytecode operations.Nr�)r�rVr�r�r�r�r!r�)
r�r��io�StringIOr6r*rirhrfr�r�r��getvalue)r�rlrw�outputrrrr
s


�zBytecode.dis)r9r�r�r�r�r�r��classmethodr�r�rrrrrr�s

c	Csfddl}|��}|jd|�d�ddd�|��}|j�}|��}W5QRXt||jjd�}t	|�dS)	z*Simple test program to disassemble a file.rN�infile�rb�?�-)r8�nargs�defaultr)
�argparse�ArgumentParser�add_argumentZFileType�
parse_argsr��readrrr)r��parser�argsr�rr�rrr�_testsr��__main__)N)N)NNNNNr)r�)r�NNNNN);r�r<�types�collectionsr�ZopcoderZ_opcodes_all�
MethodType�FunctionType�CodeTyper��staticmethodr8r0Zopmaprrrrr�rr�rrrrQrYr[rr\r�
namedtuplernryr|r�r~rwrurvr{r}r
rr�r�r�rr3r6r7rr�r
r	rr�r9rrrr�<module>s�
����
-�
 �4�
6��=
__pycache__/secrets.cpython-38.opt-2.pyc000064400000002156151153537610014027 0ustar00U

e5d��@s�ddddddddgZdd	lZdd	lZdd	lZdd
lmZddlmZe�Zej	Z
ejZdd�Zd
Z
ddd�Zddd�Zddd�Zd	S)�choice�	randbelow�randbits�SystemRandom�token_bytes�	token_hex�
token_urlsafe�compare_digest�N)r)rcCs|dkrtd��t�|�S)Nr	zUpper bound must be positive.)�
ValueError�_sysrandZ
_randbelow)Zexclusive_upper_bound�r�/usr/lib64/python3.8/secrets.pyrs� cCs|dkrt}t�|�S)N)�DEFAULT_ENTROPY�os�urandom��nbytesrrr
r#s
cCst�t|���d�S)N�ascii)�binasciiZhexlifyr�decoderrrr
r1scCst|�}t�|��d��d�S)N�=r)r�base64Zurlsafe_b64encode�rstripr)r�tokrrr
r>s
)N)N)N)�__all__rrrZhmacrZrandomrrZgetrandbitsrrrrrrrrrrr
�<module>	s$�


__pycache__/gzip.cpython-38.pyc000064400000043412151153537610012370 0ustar00U

e5d�S�@sdZddlZddlZddlZddlZddlZddlZddlZddlZdddddgZ	d\Z
ZZZ
Zd	\ZZd
ZdZdZd
edddfdd�Zdd�ZGdd�d�ZGdd�de�ZGdd�dej�ZGdd�dej�Zefdd�dd�Zdd�Zdd�Ze dk�re�dS)z�Functions that read and write gzipped files.

The user of the file doesn't have to worry about the compression,
but random access is not allowed.�N�BadGzipFile�GzipFile�open�compress�
decompress)�����)rrr��	�rbcCs�d|kr d|krPtd|f��n0|dk	r0td��|dk	r@td��|dk	rPtd��|�dd�}t|tttjf�r|t|||�}n,t|d	�s�t|d
�r�td|||�}nt	d��d|kr�t
�||||�S|SdS)aOpen a gzip-compressed file in binary or text mode.

    The filename argument can be an actual filename (a str or bytes object), or
    an existing file object to read from or write to.

    The mode argument can be "r", "rb", "w", "wb", "x", "xb", "a" or "ab" for
    binary mode, or "rt", "wt", "xt" or "at" for text mode. The default mode is
    "rb", and the default compresslevel is 9.

    For binary mode, this function is equivalent to the GzipFile constructor:
    GzipFile(filename, mode, compresslevel). In this case, the encoding, errors
    and newline arguments must not be provided.

    For text mode, a GzipFile object is created, and wrapped in an
    io.TextIOWrapper instance with the specified encoding, error handling
    behavior, and line ending(s).

    �t�bzInvalid mode: %rNz0Argument 'encoding' not supported in binary modez.Argument 'errors' not supported in binary modez/Argument 'newline' not supported in binary mode��read�writez1filename must be a str or bytes object, or a file)�
ValueError�replace�
isinstance�str�bytes�os�PathLiker�hasattr�	TypeError�io�
TextIOWrapper)�filename�mode�
compresslevel�encoding�errors�newlineZgz_modeZbinary_file�r%�/usr/lib64/python3.8/gzip.pyrs$cCs|�t�d|��dS)Nz<L)r�structZpack)�output�valuer%r%r&�write32uEsr*c@s<eZdZdZddd�Zdd�Zddd�Zd	d
�Zdd�Zd
S)�_PaddedFilez�Minimal read-only file object that prepends a string to the contents
    of an actual file. Shouldn't be used outside of gzip.py, as it lacks
    essential functionality.�cCs ||_t|�|_||_d|_dS�Nr)�_buffer�len�_length�file�_read)�self�f�prependr%r%r&�__init__Os
z_PaddedFile.__init__cCs~|jdkr|j�|�S|j||jkrJ|j}|j|7_|j||j�S|j}d|_|j|d�|j�||j|�SdS�N)r2r1rr0r.)r3�sizerr%r%r&rUs
�z_PaddedFile.readcCs>|jdkr||_n|jt|�8_dSt|j�|_d|_dSr-)r2r.r/r0)r3r5r%r%r&r5bs
z_PaddedFile.prependcCsd|_d|_|j�|�Sr7)r2r.r1�seek)r3Zoffr%r%r&r9ksz_PaddedFile.seekcCsdS�NTr%�r3r%r%r&�seekablepsz_PaddedFile.seekableN)r,)r,)	�__name__�
__module__�__qualname__�__doc__r6rr5r9r<r%r%r%r&r+Js

	r+c@seZdZdZdS)rz6Exception raised in some cases for invalid gzip files.N)r=r>r?r@r%r%r%r&rtsc@s�eZdZdZdZddeddfdd�Zedd��Zedd��Z	d	d
�Z
dd�Zd
d�Zdd�Z
d,dd�Zd-dd�Zdd�Zedd��Zdd�Zejfdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zejfd(d)�Zd.d*d+�ZdS)/ra
The GzipFile class simulates most of the methods of a file object with
    the exception of the truncate() method.

    This class only supports opening files in binary mode. If you need to open a
    compressed file in text mode, use the gzip.open() function.

    NcCs4|r"d|ksd|kr"td�|���|r6d|kr6|d7}|dkrTt�||pJd�}|_|dkr|t|dd�}t|ttf�s�d}n
t	�
|�}|dkr�t|d	d�}|�d
�r�t|_
t|�}t�|�|_||_nN|�d��rt|_
|�|�t�|tjtjtjd�|_||_ntd�|���||_|j
tk�r0|�|�dS)
aGConstructor for the GzipFile class.

        At least one of fileobj and filename must be given a
        non-trivial value.

        The new class instance is based on fileobj, which can be a regular
        file, an io.BytesIO object, or any other object which simulates a file.
        It defaults to None, in which case filename is opened to provide
        a file object.

        When fileobj is not None, the filename argument is only used to be
        included in the gzip file header, which may include the original
        filename of the uncompressed file.  It defaults to the filename of
        fileobj, if discernible; otherwise, it defaults to the empty string,
        and in this case the original filename is not included in the header.

        The mode argument can be any of 'r', 'rb', 'a', 'ab', 'w', 'wb', 'x', or
        'xb' depending on whether the file will be read or written.  The default
        is the mode of fileobj if discernible; otherwise, the default is 'rb'.
        A mode of 'r' is equivalent to one of 'rb', and similarly for 'w' and
        'wb', 'a' and 'ab', and 'x' and 'xb'.

        The compresslevel argument is an integer from 0 to 9 controlling the
        level of compression; 1 is fastest and produces the least compression,
        and 9 is slowest and produces the most compression. 0 is no compression
        at all. The default is 9.

        The mtime argument is an optional numeric timestamp to be written
        to the last modification time field in the stream when compressing.
        If omitted or None, the current time is used.

        r�UzInvalid mode: {!r}rNr�namerr �r)�w�a�xr)r�format�builtinsr�	myfileobj�getattrrrrr�fspath�
startswith�READr �_GzipReaderr�BufferedReaderr.rB�WRITE�_init_write�zlibZcompressobjZDEFLATED�	MAX_WBITSZ
DEF_MEM_LEVELr�_write_mtime�fileobj�_write_gzip_header)r3rr r!rU�mtime�rawr%r%r&r6�s@#


�zGzipFile.__init__cCsBddl}|�dtd�|jtkr<|jdd�dkr<|jdS|jS)Nrzuse the name attributer����.gz)�warnings�warn�DeprecationWarningr rPrB)r3r[r%r%r&r�s

zGzipFile.filenamecCs
|jjjS)z0Last modification time read from stream, or None)r.rX�_last_mtimer;r%r%r&rW�szGzipFile.mtimecCs.t|j�}d|dd�dtt|��dS)Nz<gzip r���� �>)�reprrU�hex�id)r3�sr%r%r&�__repr__�s
zGzipFile.__repr__cCs.||_t�d�|_d|_g|_d|_d|_dS�Nr,r)rBrR�crc32�crcr8Zwritebuf�bufsize�offset)r3rr%r%r&rQ�szGzipFile._init_writecCs|j�d�|j�d�z<tj�|j�}t|t�s<|�d�}|�	d�rR|dd�}Wnt
k
rld}YnXd}|rzt}|j�t|��d��|j
}|dkr�t��}t|jt|��|tkr�d}n|tkr�d	}nd
}|j�|�|j�d�|�r|j�|d
�dS)N���zlatin-1s.gzrYr,r�����)rUrr�path�basenamerBrr�encode�endswith�UnicodeEncodeError�FNAME�chrrT�timer*�int�_COMPRESS_LEVEL_BEST�_COMPRESS_LEVEL_FAST)r3r!Zfname�flagsrWZxflr%r%r&rV�s6



zGzipFile._write_gzip_headercCs�|��|jtkr&ddl}t|jd��|jdkr8td��t|t	�rLt
|�}nt|�}|j}|dkr�|j�
|j�|��|j|7_t�||j�|_|j|7_|S)Nrz$write() on read-only GzipFile objectz!write() on closed GzipFile object)�_check_not_closedr rP�errno�OSError�EBADFrUrrrr/�
memoryview�nbytesrrr8rRrhrirk)r3�datarZlengthr%r%r&rs 



zGzipFile.writer_cCs2|��|jtkr&ddl}t|jd��|j�|�S)Nrz$read() on write-only GzipFile object)r~r rMrr�r�r.r�r3r8rr%r%r&rs

z
GzipFile.readcCs@|��|jtkr&ddl}t|jd��|dkr4tj}|j�	|�S)zdImplements BufferedIOBase.read1()

        Reads up to a buffer's worth of data if size is negative.rNz%read1() on write-only GzipFile object)
r~r rMrr�r�r�DEFAULT_BUFFER_SIZEr.�read1r�r%r%r&r�&s
zGzipFile.read1cCs2|��|jtkr&ddl}t|jd��|j�|�S)Nrz$peek() on write-only GzipFile object)r~r rMrr�r�r.�peek)r3�nrr%r%r&r�3s

z
GzipFile.peekcCs
|jdkSr7�rUr;r%r%r&�closed:szGzipFile.closedcCs�|j}|dkrdSd|_zP|jtkrR|�|j���t||j	�t||j
d@�n|jtkrf|j��W5|j}|r�d|_|��XdS)N���)
rUrI�closer rPrr�flushr*rir8rMr.)r3rUrIr%r%r&r�>s

zGzipFile.closecCs4|��|jtkr0|j�|j�|��|j��dSr7)r~r rPrUrrr�)r3Z	zlib_moder%r%r&r�Qs
zGzipFile.flushcCs
|j��S)z�Invoke the underlying file object's fileno() method.

        This will raise AttributeError if the underlying file object
        doesn't support fileno().
        )rU�filenor;r%r%r&r�XszGzipFile.filenocCs"|jtkrtd��|j�d�dS)z[Return the uncompressed stream file position indicator to the
        beginning of the filezCan't rewind in write moderN)r rMr�r.r9r;r%r%r&�rewind`s
zGzipFile.rewindcCs
|jtkSr7)r rMr;r%r%r&�readablegszGzipFile.readablecCs
|jtkSr7)r rPr;r%r%r&�writablejszGzipFile.writablecCsdSr:r%r;r%r%r&r<mszGzipFile.seekablecCs�|jtkr�|tjkr2|tjkr*|j|}ntd��||jkrDtd��||j}d}t|d�D]}|�	|�q^|�	d|d�n |jt
kr�|��|j�
||�S|jS)NzSeek from end not supportedzNegative seek in write modes�rp)r rPr�SEEK_SET�SEEK_CURrkrr��rangerrMr~r.r9)r3rk�whence�count�chunk�ir%r%r&r9ps 





z
GzipFile.seekcCs|��|j�|�Sr7)r~r.�readline)r3r8r%r%r&r��szGzipFile.readline)r_)r_)r_)r=r>r?r@rIr{r6�propertyrrWrfrQrVrrr�r�r�r�rRZZ_SYNC_FLUSHr�r�r�r�r�r<rr�r9r�r%r%r%r&rxs:
�
I

 



csZeZdZ�fdd�Zdd�Zdd�Zdd�Zdd
d�Zdd
�Zdd�Z	�fdd�Z
�ZS)rNcs,t�jt|�tjtjd�d|_d|_dS)N)ZwbitsT)�superr6r+rRZ
decompressobjrS�_new_memberr^)r3�fp��	__class__r%r&r6�s
�z_GzipReader.__init__cCst�d�|_d|_dSrg)rRrh�_crc�_stream_sizer;r%r%r&�
_init_read�sz_GzipReader._init_readcCsF|j�|�}t|�|krB|j�|t|��}|s8td��||7}q|S)z�Read exactly *n* bytes from `self._fp`

        This method is required because self._fp may be unbuffered,
        i.e. return short reads.
        �ACompressed file ended before the end-of-stream marker was reached)�_fprr/�EOFError)r3r�r�rr%r%r&�_read_exact�s
z_GzipReader._read_exactcCs�|j�d�}|dkrdS|dkr,td|��t�d|�d��\}}|_|dkrVtd��|t@r|t�d	|�d��\}|�|�|t@r�|j�d
�}|r�|dkr�q�q�|t	@r�|j�d
�}|r�|dkr�q�q�|t
@r�|�d�dS)
Nrr,FrlzNot a gzipped file (%r)z<BBIxxr
zUnknown compression methodz<HrrpT)r�rrr'�unpackr�r^�FEXTRArw�FCOMMENT�FHCRC)r3�magic�method�flagZ	extra_lenrer%r%r&�_read_gzip_header�s0�

z_GzipReader._read_gzip_headerr_cCs�|dkr|��S|sdS|jjr>|��d|_|jf|j�|_|jrf|��|��s`|j	|_
dSd|_|j�t
j�}|j�||�}|jjdkr�|j�|jj�n|jjdkr�|j�|jj�|dkr�q�|dkrtd��q|�|�|j	t|�7_	|S)Nrr,TFr�)�readallZ
_decompressor�eof�	_read_eofr�Z_decomp_factoryZ_decomp_argsr�r�Z_posZ_sizer�rrr�rZunconsumed_tailr5Zunused_datar��_add_read_datar/)r3r8�bufZ
uncompressr%r%r&r�s:�

z_GzipReader.readcCs$t�||j�|_|jt|�|_dSr7)rRrhr�r�r/)r3r�r%r%r&r��sz_GzipReader._add_read_datacCs�t�d|�d��\}}||jkr<tdt|�t|j�f��n||jd@krRtd��d}|dkrl|j�d�}qV|r||j�	|�dS)Nz<IIr
zCRC check failed %s != %sr�z!Incorrect length of data producedrpr)
r'r�r�r�rrcr�r�rr5)r3rhZisize�cr%r%r&r��s

�
z_GzipReader._read_eofcst���d|_dSr:)r��_rewindr�r;r�r%r&r�s
z_GzipReader._rewind)r_)r=r>r?r6r�r�r�rr�r�r��
__classcell__r%r%r�r&rN�s!
3rN)rWc	Cs6t��}t|d||d��}|�|�W5QRX|��S)z�Compress data in one shot and return the compressed string.
    Optional argument is the compression level, in range of 0-9.
    �wb)rUr r!rW)r�BytesIOrr�getvalue)r�r!rWr�r4r%r%r&rsc
Cs0tt�|�d��}|��W5QR�SQRXdS)zYDecompress a gzip compressed string in one shot.
    Return the decompressed string.
    r�N)rrr�r)r�r4r%r%r&rsc	Cs�ddlm}|dd�}|��}|jdddd�|jd	dd
d�|jdddd
d�|jdddgdd�|��}t}|jr|t}n
|jr�t	}|j
D]�}|jr�|dkr�tddt
jjd�}t
jj}n>|dd�dkr�t
�d|���t|d�}t�|dd�d�}nB|dk�r"t
jj}tddt
jj|d�}nt�|d�}t|dd�}|�d�}|�sP�q^|�|��q<|t
jjk	�rt|��|t
jjk	r�|��q�dS)Nr)�ArgumentParserzeA simple command line interface for the gzip module: act like gzip, but do not delete the input file.)Zdescriptionz--fast�
store_truezcompress faster)�action�helpz--bestzcompress betterz-dz--decompresszact like gunzip instead of gzip�args�*�-r1)�nargs�default�metavarrr)rr rUrYrZzfilename doesn't end in .gz: r�)rr rUr!r�)�argparser�Zadd_mutually_exclusive_group�add_argument�
parse_args�_COMPRESS_LEVEL_TRADEOFFZfastr|Zbestr{r�rr�sys�stdin�buffer�stdout�exitrrHrrr�)	r��parser�groupr�r!�argr4�gr�r%r%r&�main'sR�
�



�
r��__main__)!r@r'r�ryrrRrHrZ_compression�__all__ZFTEXTr�r�rwr�rMrPr|r�r{rr*r+r�rZ
BaseStreamrZDecompressReaderrNrrr�r=r%r%r%r&�<module>s: �
,*	0
__pycache__/zipimport.cpython-38.opt-1.pyc000064400000041425151153537610014415 0ustar00U

e5d-x�@sRdZddlZddlmZmZddlZddlZddlZddl	Z	ddl
Z
ddlZddgZej
Z
ejdd�ZGdd�de�ZiZee
�ZdZd	Zd
ZGdd�d�Ze
dd
d
fe
ddd
fddfZdd�Zdd�Zdd�Zdd�ZdZdadd�Z dd�Z!dd �Z"d!d"�Z#ee#j$�Z%d#d$�Z&d%d&�Z'd'd(�Z(d)d*�Z)d+d,�Z*d-d.�Z+Gd/d0�d0�Z,dS)1aPzipimport provides support for importing Python modules from Zip archives.

This module exports three objects:
- zipimporter: a class; its constructor takes a path to a Zip archive.
- ZipImportError: exception raised by zipimporter objects. It's a
  subclass of ImportError, so it can be caught as ImportError, too.
- _zip_directory_cache: a dict, mapping archive paths to zip directory
  info dicts, as used in zipimporter._files.

It is usually not needed to use the zipimport module explicitly; it is
used by the builtin import mechanism for sys.path items that are paths
to Zip archives.
�N)�_unpack_uint16�_unpack_uint32�ZipImportError�zipimporter�c@seZdZdS)rN)�__name__�
__module__�__qualname__�r
r
�!/usr/lib64/python3.8/zipimport.pyr!s�sPKi��c@sleZdZdZdd�Zddd�Zddd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)ra�zipimporter(archivepath) -> zipimporter object

    Create a new zipimporter instance. 'archivepath' must be a path to
    a zipfile, or to a specific path inside a zipfile. For example, it can be
    '/tmp/myimport.zip', or '/tmp/myimport.zip/mydirectory', if mydirectory is a
    valid directory inside the archive.

    'ZipImportError is raised if 'archivepath' doesn't point to a valid Zip
    archive.

    The 'archive' attribute of zipimporter objects contains the name of the
    zipfile targeted.
    c	Cs$t|t�sddl}|�|�}|s,td|d��tr<|�tt�}g}zt�	|�}WnHt
tfk
r�t�|�\}}||kr�td|d��|}|�
|�Yq@X|jd@dkr�td|d��q�q@zt|}Wn$tk
r�t|�}|t|<YnX||_||_tj|ddd��|_|j�r |jt7_dS)Nrzarchive path is empty��pathznot a Zip filei�i����)�
isinstance�str�os�fsdecoder�alt_path_sep�replace�path_sep�_bootstrap_external�
_path_stat�OSError�
ValueError�_path_split�append�st_mode�_zip_directory_cache�KeyError�_read_directory�_files�archive�
_path_join�prefix)�selfrrr$�st�dirname�basename�filesr
r
r�__init__?s:

zzipimporter.__init__NcCsNt||�}|dk	r|gfSt||�}t||�rFd|j�t�|��gfSdgfS)a�find_loader(fullname, path=None) -> self, str or None.

        Search for a module specified by 'fullname'. 'fullname' must be the
        fully qualified (dotted) module name. It returns the zipimporter
        instance itself if the module was found, a string containing the
        full path name if it's possibly a portion of a namespace package,
        or None otherwise. The optional 'path' argument is ignored -- it's
        there for compatibility with the importer protocol.
        N)�_get_module_info�_get_module_path�_is_dirr"r)r%�fullnamer�mi�modpathr
r
r�find_loaderms



zzipimporter.find_loadercCs|�||�dS)a�find_module(fullname, path=None) -> self or None.

        Search for a module specified by 'fullname'. 'fullname' must be the
        fully qualified (dotted) module name. It returns the zipimporter
        instance itself if the module was found, or None if it wasn't.
        The optional 'path' argument is ignored -- it's there for compatibility
        with the importer protocol.
        r)r1)r%r.rr
r
r�find_module�s	zzipimporter.find_modulecCst||�\}}}|S)z�get_code(fullname) -> code object.

        Return the code object for the specified module. Raise ZipImportError
        if the module couldn't be found.
        ��_get_module_code�r%r.�code�	ispackager0r
r
r�get_code�szzipimporter.get_codecCsvtr|�tt�}|}|�|jt�r:|t|jt�d�}z|j|}Wn tk
rhtdd|��YnXt	|j|�S)z�get_data(pathname) -> string with file data.

        Return the data associated with 'pathname'. Raise OSError if
        the file wasn't found.
        Nr�)
rrr�
startswithr"�lenr!rr�	_get_data)r%�pathname�key�	toc_entryr
r
r�get_data�szzipimporter.get_datacCst||�\}}}|S)zjget_filename(fullname) -> filename string.

        Return the filename for the specified module.
        r3r5r
r
r�get_filename�szzipimporter.get_filenamecCs�t||�}|dkr$td|��|d��t||�}|r@t�|d�}n
|�d�}z|j|}Wntk
rnYdSXt|j|��	�S)z�get_source(fullname) -> source string.

        Return the source code for the specified module. Raise ZipImportError
        if the module couldn't be found, return None if the archive does
        contain the module, but has no source for it.
        N�can't find module ��name�__init__.py�.py)
r+rr,rr#r!rr<r"�decode)r%r.r/r�fullpathr?r
r
r�
get_source�s


zzipimporter.get_sourcecCs(t||�}|dkr$td|��|d��|S)z�is_package(fullname) -> bool.

        Return True if the module specified by fullname is a package.
        Raise ZipImportError if the module couldn't be found.
        NrBrC)r+r)r%r.r/r
r
r�
is_package�s
zzipimporter.is_packagecCs�t||�\}}}tj�|�}|dks.t|t�s@t|�}|tj|<||_zT|rlt||�}t�	|j
|�}|g|_t|d�s|t
|_
t�|j||�t||j�Wntj|=�YnXztj|}Wn$tk
r�td|�d���YnXt�d||�|S)z�load_module(fullname) -> module.

        Load the module specified by 'fullname'. 'fullname' must be the
        fully qualified (dotted) module name. It returns the imported
        module, or raises ZipImportError if it wasn't found.
        N�__builtins__zLoaded module z not found in sys.moduleszimport {} # loaded from Zip {})r4�sys�modules�getr�_module_type�
__loader__r,rr#r"�__path__�hasattrrK�_fix_up_module�__dict__�execr�ImportError�
_bootstrap�_verbose_message)r%r.r6r7r0�modrrHr
r
r�load_module�s0


zzipimporter.load_modulecCsXz|�|�sWdSWntk
r*YdSXtjsNddlm}|�t�dt_t||�S)z�Return the ResourceReader for a package in a zip file.

        If 'fullname' is a package within the zip file, return the
        'ResourceReader' object for the package.  Otherwise return None.
        Nr)�ResourceReaderT)rJr�_ZipImportResourceReader�_registered�
importlib.abcr[�register)r%r.r[r
r
r�get_resource_readers


zzipimporter.get_resource_readercCsd|j�t�|j�d�S)Nz<zipimporter object "z">)r"rr$)r%r
r
r�__repr__"szzipimporter.__repr__)N)N)rrr	�__doc__r*r1r2r8r@rArIrJrZr`rar
r
r
rr-s.
 


&z__init__.pycTrEF)z.pycTF)rFFFcCs|j|�d�dS)N�.�)r$�
rpartition)r%r.r
r
rr,4sr,cCs|t}||jkS�N)rr!)r%r�dirpathr
r
rr-8sr-cCs8t||�}tD]$\}}}||}||jkr|SqdSrf)r,�_zip_searchorderr!)r%r.r�suffix�
isbytecoder7rHr
r
rr+As


r+c	Cs�zt�|�}Wn&tk
r4td|��|d��YnX|���z$|�td�|��}|�t�}Wn&tk
r�td|��|d��YnXt|�tkr�td|��|d��|dd�t	k�r�z|�dd�|��}Wn&tk
r�td|��|d��YnXt
|ttd�}z|�|�|��}Wn(tk
�rJtd|��|d��YnX|�t	�}|dk�rrtd|��|d��|||t�}t|�tk�r�td|��|d��|t|�|}t
|d	d
��}t
|d
d��}	||k�r�td|��|d��||	k�r
td
|��|d��||8}||	}
|
dk�r6td|��|d��i}d}z|�|�Wn(tk
�rttd|��|d��YnX|�d�}t|�dk�r�td��|dd�dk�r��q�t|�dk�r�td��t|dd��}
t|dd	��}t|d	d��}t|dd
��}t
|d
d��}t
|dd��}t
|dd��}t|dd��}t|dd��}t|dd��}t
|dd��}|||}||	k�r�td|��|d��||
7}z|�|�}Wn(tk
�r�td|��|d��YnXt|�|k�r�td|��|d��z2t|�||��||k�r*td|��|d��Wn(tk
�rTtd|��|d��YnX|
d@�rj|��}n6z|�d�}Wn&tk
�r�|�d��t�}YnX|�dt�}t�||�}||||||||f}|||<|d 7}�qvW5QRXt�d!||�|S)"Nzcan't open Zip file: r
rd�can't read Zip file: �rznot a Zip file: zcorrupt Zip file: ���zbad central directory size: zbad central directory offset: z&bad central directory size or offset: �.�EOF read where not expectedsPK��
����� �"�*zbad local header offset: i�ascii�latin1�/rz!zipimport: found {} names in {!r})�_io�	open_coderr�seek�END_CENTRAL_DIR_SIZE�tell�readr;�STRING_END_ARCHIVE�max�MAX_COMMENT_LEN�rfindr�EOFErrorrrG�UnicodeDecodeError�	translate�cp437_tablerrrr#rWrX)r"�fp�header_position�buffer�	file_size�max_comment_start�data�pos�header_size�
header_offset�
arc_offsetr)�count�flags�compress�time�date�crc�	data_size�	name_size�
extra_size�comment_size�file_offsetrDr�tr
r
rr `s�
���

�


�
�






r u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ cCsltrt�d�td��daz<zddlm}Wn&tk
rRt�d�td��YnXW5daXt�d�|S)Nzzipimport: zlib UNAVAILABLE�)can't decompress data; zlib not availableTFr��
decompresszzipimport: zlib available)�_importing_zlibrWrXr�zlibr��	Exceptionr�r
r
r�_get_decompress_func�s


r�c	Cs�|\}}}}}}}}	|dkr$td��t�|���}
z|
�|�Wn&tk
rftd|��|d��YnX|
�d�}t|�dkr�td��|dd�dkr�td	|��|d��t|d
d��}t|dd��}
d||
}||7}z|
�|�Wn(tk
�rtd|��|d��YnX|
�|�}t|�|k�r4td��W5QRX|dk�rL|Sz
t	�}Wnt
k
�rttd
��YnX||d�S)Nrznegative data sizerkr
rwrqrlsPKzbad local file header: �rvzzipimport: can't read datar�i�)rr~rr�rr�r;r�rr�r�)r"r?�datapathr�r�r�r�r�r�r�r�r�r�r�r��raw_datar�r
r
rr<s>



r<cCst||�dkS)Nr)�abs)�t1�t2r
r
r�	_eq_mtimeAsr�cCs<||d�}zt�|||�}Wntk
r2YdSX|d@dk}|r�|d@dk}tjdkr�|shtjdkr�t||�}	|	dk	r�t�tj|	�}
zt�||
||�Wntk
r�YdSXnTt	||�\}}|�r
t
t|dd��|�r�t|dd	��|k�r
t�
d
|���dSt�|d	d��}
t|
t��s8td|�d���|
S)
N)rDrrrrd�never�alwaysrrrmrnzbytecode is stale for zcompiled module z is not a code object)r�
_classify_pycrV�_imp�check_hash_based_pycs�_get_pyc_source�source_hash�_RAW_MAGIC_NUMBER�_validate_hash_pyc�_get_mtime_and_size_of_sourcer�rrWrX�marshal�loadsr�
_code_type�	TypeError)r%r=rHr.r��exc_detailsr��
hash_based�check_source�source_bytesr��source_mtime�source_sizer6r
r
r�_unmarshal_codeKsX�
��
��
���r�cCs|�dd�}|�dd�}|S)Ns
�
�
)r)�sourcer
r
r�_normalize_line_endings~sr�cCst|�}t||ddd�S)NrUT)�dont_inherit)r��compile)r=r�r
r
r�_compile_source�sr�cCsDt�|d?d|d?d@|d@|d?|d?d@|d@dd	d	d	f	�S)
N�	i������?rdr)r��mktime)�dr�r
r
r�_parse_dostime�s



�r�c
Cs`z>|dd�}|j|}|d}|d}|d}t||�|fWStttfk
rZYdSXdS)Nrr���)rr)r!r�r�
IndexErrorr�)r%rr?r�r��uncompressed_sizer
r
rr��s
r�cCsB|dd�}z|j|}Wntk
r0YdSXt|j|�SdS)Nr)r!rr<r")r%rr?r
r
rr��sr�c	Cs�t||�}tD]�\}}}||}tjd|jt|dd�z|j|}Wntk
rXYqX|d}t|j|�}	|r�t	|||||	�}
n
t
||	�}
|
dkr�q|d}|
||fSqtd|��|d��dS)Nz
trying {}{}{}rd)�	verbosityrrBrC)r,rhrWrXr"rr!rr<r�r�r)r%r.rrirjr7rHr?r0r�r6r
r
rr4�s$

r4c@s<eZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
S)r\z�Private class used to support ZipImport.get_resource_reader().

    This class is allowed to reference all the innards and private parts of
    the zipimporter.
    FcCs||_||_dSrf)rr.)r%rr.r
r
rr*�sz!_ZipImportResourceReader.__init__cCs\|j�dd�}|�d|��}ddlm}z||j�|��WStk
rVt|��YnXdS)Nrcr}r)�BytesIO)r.r�ior�rr@r�FileNotFoundError)r%�resource�fullname_as_pathrr�r
r
r�
open_resource�sz&_ZipImportResourceReader.open_resourcecCst�dSrf)r�)r%r�r
r
r�
resource_path�sz&_ZipImportResourceReader.resource_pathcCsH|j�dd�}|�d|��}z|j�|�Wntk
rBYdSXdS)Nrcr}FT)r.rrr@r)r%rDr�rr
r
r�is_resource�sz$_ZipImportResourceReader.is_resourcec		cs�ddlm}||j�|j��}|�|jj�}|j}t�}|jj	D]f}z||��|�}Wnt
k
rnYq@YnX|jj}t|�dkr�|jVq@||kr@|�
|�|Vq@dS)Nr)�Path)�pathlibr�rrAr.�relative_tor"�parent�setr!rrDr;�add)	r%r��
fullname_path�
relative_path�package_path�subdirs_seen�filename�relative�parent_namer
r
r�contents�s 


z!_ZipImportResourceReader.contentsN)
rrr	rbr]r*r�r�r�r�r
r
r
rr\�s	r\)-rb�_frozen_importlib_externalrrr�_frozen_importlibrWr�r~r�rLr��__all__r�path_separatorsrrVrr�typerOr�r�r�rrhr,r-r+r r�r�r�r<r�r��__code__r�r�r�r�r�r�r4r\r
r
r
r�<module>sX�		~�.
.

__pycache__/weakref.cpython-38.opt-1.pyc000064400000046042151153537610014004 0ustar00U

e5d�S�
@s�dZddlmZmZmZmZmZmZmZm	Z	ddl
mZmZddl
Z
ddlZddlZeefZddddd	d
ddd
ddddg
ZGdd�de�ZGdd�de
j�ZGdd�de�ZGdd	�d	e
j�ZGdd�d�ZdS)z{Weak reference support for Python.

This module is an implementation of PEP 205:

http://www.python.org/dev/peps/pep-0205/
�)�getweakrefcount�getweakrefs�ref�proxy�CallableProxyType�	ProxyType�
ReferenceType�_remove_dead_weakref)�WeakSet�_IterationGuardNrrrr�WeakKeyDictionaryrrr�
ProxyTypes�WeakValueDictionaryr
�
WeakMethod�finalizecsDeZdZdZdZddd�Z�fdd�Zdd	�Zd
d�Ze	j
Z
�ZS)
rz�
    A custom `weakref.ref` subclass which simulates a weak reference to
    a bound method, working around the lifetime problem of bound methods.
    )�	_func_ref�
_meth_type�_alive�__weakref__Ncs~z|j}|j}Wn(tk
r8td�t|���d�YnX��fdd�}t�|||�}t||�|_t|�|_	d|_
t|��|S)Nz)argument should be a bound method, not {}cs&��}|jr"d|_�dk	r"�|�dS�NF)r)�arg�self��callbackZself_wr��/usr/lib64/python3.8/weakref.py�_cb3s
zWeakMethod.__new__.<locals>._cbT)�__self__�__func__�AttributeError�	TypeError�format�typer�__new__rrr)�clsZmethr�obj�funcrrrrrr#,s 
��
zWeakMethod.__new__cs2t���}|��}|dks"|dkr&dS|�||�S�N)�super�__call__rr)rr%r&��	__class__rrr)Bs

zWeakMethod.__call__cCs:t|t�r6|jr|js||kSt�||�o4|j|jkSdSr)�
isinstancerrr�__eq__r�r�otherrrrr-Is

zWeakMethod.__eq__cCs:t|t�r6|jr|js||k	St�||�p4|j|jkSdS�NT)r,rrr�__ne__rr.rrrr1Ps

zWeakMethod.__ne__)N)�__name__�
__module__�__qualname__�__doc__�	__slots__r#r)r-r1r�__hash__�
__classcell__rrr*rr$s
c@s�eZdZdZd,dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZeZ
dd�Zd-dd�Zdd�Zdd�ZeZdd�Zd d!�Zd"d#�Zd$d%�Zd.d&d'�Zd/d(d)�Zd*d+�ZdS)0rz�Mapping class that references values weakly.

    Entries in the dictionary will be discarded when no strong
    reference to the value exists anymore
    rcKs>t|�tfdd�}||_g|_t�|_i|_|j|f|�dS)NcSs6|�}|dk	r2|jr$|j�|j�n||j|j�dSr')�
_iterating�_pending_removals�append�key�data)�wr�selfrefZ_atomic_removalrrrr�removegs
z,WeakValueDictionary.__init__.<locals>.remove)rr	�_remover:�setr9r=�update)rr/�kwr@rrr�__init__fs	zWeakValueDictionary.__init__cCs(|j}|j}|r$|��}t||�qdSr')r:r=�popr	)r�l�dr<rrr�_commit_removalsws
z$WeakValueDictionary._commit_removalscCs4|jr|��|j|�}|dkr,t|��n|SdSr'�r:rIr=�KeyError�rr<�orrr�__getitem__�s
zWeakValueDictionary.__getitem__cCs|jr|��|j|=dSr')r:rIr=�rr<rrr�__delitem__�szWeakValueDictionary.__delitem__cCs|jr|��t|j�Sr')r:rI�lenr=�rrrr�__len__�szWeakValueDictionary.__len__cCs>|jr|��z|j|�}Wntk
r4YdSX|dk	SrrJrLrrr�__contains__�sz WeakValueDictionary.__contains__cCsd|jjt|�fS�Nz<%s at %#x>�r+r2�idrRrrr�__repr__�szWeakValueDictionary.__repr__cCs&|jr|��t||j|�|j|<dSr')r:rI�KeyedRefrAr=�rr<�valuerrr�__setitem__�szWeakValueDictionary.__setitem__c	CsV|jr|��t�}t|��0|j��D]\}}|�}|dk	r(|||<q(W5QRX|Sr')r:rIrrr=�items)r�newr<r>rMrrr�copy�s
zWeakValueDictionary.copyc	Csjddlm}|jr|��|��}t|��6|j��D]$\}}|�}|dk	r6|||||�<q6W5QRX|S�Nr)�deepcopy)r_rar:rIr+rr=r])r�memorar^r<r>rMrrr�__deepcopy__�s
z WeakValueDictionary.__deepcopy__NcCsP|jr|��z|j|}Wntk
r4|YSX|�}|dkrH|S|SdSr'rJ)rr<�defaultr>rMrrr�get�s
zWeakValueDictionary.getc	csR|jr|��t|��2|j��D] \}}|�}|dk	r"||fVq"W5QRXdSr'�r:rIrr=r])r�kr>�vrrrr]�s
zWeakValueDictionary.itemsc	csJ|jr|��t|��*|j��D]\}}|�dk	r"|Vq"W5QRXdSr'rf)rrgr>rrr�keys�s

zWeakValueDictionary.keysc	cs6|jr|��t|��|j��EdHW5QRXdS)a�Return an iterator that yields the weak references to the values.

        The references are not guaranteed to be 'live' at the time
        they are used, so the result of calling the references needs
        to be checked before being used.  This can be used to avoid
        creating references that will cause the garbage collector to
        keep the values around longer than needed.

        N�r:rIrr=�valuesrRrrr�
itervaluerefs�s

z!WeakValueDictionary.itervaluerefsc	csJ|jr|��t|��*|j��D]}|�}|dk	r"|Vq"W5QRXdSr'rj�rr>r%rrrrk�s
zWeakValueDictionary.valuescCs8|jr|��|j��\}}|�}|dk	r||fSqdSr')r:rIr=�popitem)rr<r>rMrrrrn�szWeakValueDictionary.popitemcGs`|jr|��z|j�|��}Wntk
r8d}YnX|dkrX|rN|dSt|��n|SdS)Nr)r:rIr=rFrK)rr<�argsrMrrrrFs

zWeakValueDictionary.popcCs`z|j|�}Wntk
r(d}YnX|dkrX|jr@|��t||j|�|j|<|S|SdSr')r=rKr:rIrYrA)rr<rdrMrrr�
setdefaults
zWeakValueDictionary.setdefaultcKsz|jr|��|j}|dk	rRt|d�s.t|�}|��D]\}}t||j|�||<q6|��D]\}}t||j|�||<qZdS�Nr])r:rIr=�hasattr�dictr]rYrA)rr/�kwargsrHr<rMrrrrCs
zWeakValueDictionary.updatecCs|jr|��t|j���S)a~Return a list of weak references to the values.

        The references are not guaranteed to be 'live' at the time
        they are used, so the result of calling the references needs
        to be checked before being used.  This can be used to avoid
        creating references that will cause the garbage collector to
        keep the values around longer than needed.

        )r:rI�listr=rkrRrrr�	valuerefs(s
zWeakValueDictionary.valuerefs)r)N)N)N)r2r3r4r5rErIrNrPrSrTrXr\r_�__copy__rcrer]ri�__iter__rlrkrnrFrprCrvrrrrrZs.
			
			

cs,eZdZdZdZdd�Z�fdd�Z�ZS)rYa[Specialized reference that includes a key corresponding to the value.

    This is used in the WeakValueDictionary to avoid having to create
    a function object for each key stored in the mapping.  A shared
    callback object can use the 'key' attribute of a KeyedRef instead
    of getting a reference to the key from an enclosing scope.

    �r<cCst�|||�}||_|Sr')rr#r<)r"�obrr<rrrrr#CszKeyedRef.__new__cst��||�dSr')r(rE)rrzrr<r*rrrEHszKeyedRef.__init__)r2r3r4r5r6r#rEr8rrr*rrY7s	rYc@s�eZdZdZd+dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZeZ
dd�Zd,dd�Zdd�Zdd�Zdd�ZeZdd �Zd!d"�Zd#d$�Zd%d&�Zd-d'd(�Zd.d)d*�ZdS)/ra� Mapping class that references keys weakly.

    Entries in the dictionary will be discarded when there is no
    longer a strong reference to the key. This can be used to
    associate additional data with an object owned by other parts of
    an application without adding attributes to those objects. This
    can be especially useful with objects that override attribute
    accesses.
    NcCsFi|_t|�fdd�}||_g|_t�|_d|_|dk	rB|�|�dS)NcSs.|�}|dk	r*|jr"|j�|�n|j|=dSr')r9r:r;r=)rgr?rrrrr@Ys
z*WeakKeyDictionary.__init__.<locals>.removeF)r=rrAr:rBr9�
_dirty_lenrC)rrsr@rrrrEWszWeakKeyDictionary.__init__cCs:|j}|j}|r6z||��=Wqtk
r2YqXqdSr')r:r=rFrK)rrGrHrrrrIhsz"WeakKeyDictionary._commit_removalscs&|j��fdd�|jD�|_d|_dS)Ncsg|]}|�kr|�qSrr)�.0rg�rHrr�
<listcomp>wsz5WeakKeyDictionary._scrub_removals.<locals>.<listcomp>F)r=r:r{rRrr}r�_scrub_removalsusz!WeakKeyDictionary._scrub_removalscCsd|_|jt|�=dSr0)r{r=rrOrrrrPzszWeakKeyDictionary.__delitem__cCs|jt|�Sr')r=rrOrrrrN~szWeakKeyDictionary.__getitem__cCs(|jr|jr|��t|j�t|j�Sr')r{r:rrQr=rRrrrrS�szWeakKeyDictionary.__len__cCsd|jjt|�fSrUrVrRrrrrX�szWeakKeyDictionary.__repr__cCs||jt||j�<dSr')r=rrArZrrrr\�szWeakKeyDictionary.__setitem__c	CsHt�}t|��0|j��D]\}}|�}|dk	r|||<qW5QRX|Sr')rrr=r])rr^r<r[rMrrrr_�s
zWeakKeyDictionary.copyc	Cs\ddlm}|��}t|��6|j��D]$\}}|�}|dk	r(|||�||<q(W5QRX|Sr`)r_rar+rr=r])rrbrar^r<r[rMrrrrc�s
zWeakKeyDictionary.__deepcopy__cCs|j�t|�|�Sr')r=rer�rr<rdrrrre�szWeakKeyDictionary.getcCs.zt|�}Wntk
r"YdSX||jkSr)rr r=)rr<r>rrrrT�s
zWeakKeyDictionary.__contains__c	csDt|��2|j��D] \}}|�}|dk	r||fVqW5QRXdSr'�rr=r])rr>r[r<rrrr]�s

zWeakKeyDictionary.itemsc	cs8t|��&|jD]}|�}|dk	r|VqW5QRXdSr')rr=rmrrrri�s


zWeakKeyDictionary.keysc	cs<t|��*|j��D]\}}|�dk	r|VqW5QRXdSr'r�)rr>r[rrrrk�s

zWeakKeyDictionary.valuescCs
t|j�S)azReturn a list of weak references to the keys.

        The references are not guaranteed to be 'live' at the time
        they are used, so the result of calling the references needs
        to be checked before being used.  This can be used to avoid
        creating references that will cause the garbage collector to
        keep the keys around longer than needed.

        )rur=rRrrr�keyrefs�s
zWeakKeyDictionary.keyrefscCs0d|_|j��\}}|�}|dk	r||fSqdSr0)r{r=rn)rr<r[rMrrrrn�s
zWeakKeyDictionary.popitemcGsd|_|jjt|�f|��Sr0)r{r=rFr)rr<rorrrrF�szWeakKeyDictionary.popcCs|j�t||j�|�Sr')r=rprrAr�rrrrp�szWeakKeyDictionary.setdefaultcKs\|j}|dk	rFt|d�s$ti�|�}|��D]\}}||t||j�<q,t|�rX|�|�dSrq)r=rrr"r]rrArQrC)rrsrtrHr<r[rrrrC�s
zWeakKeyDictionary.update)N)N)N)N)r2r3r4r5rErIrrPrNrSrXr\r_rwrcrerTr]rirxrkr�rnrFrprCrrrrrLs.


	


c@s�eZdZdZdZiZdZe��Z	dZ
dZGdd�d�Zdd�Z
de
_dd
d�Zdd
�Zdd�Zedd��Zedd��Zejdd��Zdd�Zedd��Zedd��Zd	S)raClass for finalization of weakrefable objects

    finalize(obj, func, *args, **kwargs) returns a callable finalizer
    object which will be called when obj is garbage collected. The
    first time the finalizer is called it evaluates func(*arg, **kwargs)
    and returns the result. After this the finalizer is dead, and
    calling it just returns None.

    When the program exits any remaining finalizers for which the
    atexit attribute is true will be run in reverse order of creation.
    By default atexit is true.
    rFc@seZdZdZdS)zfinalize._Info)�weakrefr&rort�atexit�indexN)r2r3r4r6rrrr�_Infosr�cOs>t|�dkr|^}}}}n�|s(td��n�d|krDtdt|�d��|�d�}t|�dkr~|^}}}ddl}|jdtdd	�nFd
|kr�tdt|�d��|�d
�}|^}}ddl}|jdtdd	�t|�}|js�ddl}|�	|j
�dt_|��}t
||�|_||_||_|�pd|_d|_t|j�|_||j|<dt_dS)
N�z<descriptor '__init__' of 'finalize' object needs an argumentr&z9finalize expected at least 2 positional arguments, got %d��rz0Passing 'func' as keyword argument is deprecated)�
stacklevelr%z/Passing 'obj' as keyword argument is deprecatedT)rQr rF�warnings�warn�DeprecationWarning�tuple�_registered_with_atexitr��register�	_exitfuncrr�rr�r&rort�next�_index_iterr��	_registry�_dirty)rortrr%r&r�r��inforrrrEsR

�

�
�
�
zfinalize.__init__z&($self, obj, func, /, *args, **kwargs)NcCs0|j�|d�}|r,|js,|j|j|jp(i�SdS)zZIf alive then mark as dead and return func(*args, **kwargs);
        otherwise return NoneN)r�rF�	_shutdownr&rort)r�_r�rrrr)1s
zfinalize.__call__cCsH|j�|�}|o|��}|dk	rD|j�|d�rD||j|j|jp@ifSdS)z^If alive then mark as dead and return (obj, func, args, kwargs);
        otherwise return NoneN)r�rer�rFr&rort�rr�r%rrr�detach8szfinalize.detachcCs:|j�|�}|o|��}|dk	r6||j|j|jp2ifSdS)zMIf alive then return (obj, func, args, kwargs);
        otherwise return NoneN)r�rer�r&rortr�rrr�peek@sz
finalize.peekcCs
||jkS)zWhether finalizer is alive)r�rRrrr�aliveHszfinalize.alivecCs|j�|�}t|�o|jS)z*Whether finalizer should be called at exit�r�re�boolr�)rr�rrrr�Mszfinalize.atexitcCs|j�|�}|rt|�|_dSr'r�)rr[r�rrrr�SscCs^|j�|�}|o|��}|dkr6dt|�jt|�fSdt|�jt|�t|�jt|�fSdS)Nz<%s object at %#x; dead>z!<%s object at %#x; for %r at %#x>)r�rer�r"r2rWr�rrrrXYs�zfinalize.__repr__cCs2dd�|j��D�}|jdd�d�dd�|D�S)NcSsg|]\}}|jr||f�qSr)r��r|�f�irrrr~esz-finalize._select_for_exit.<locals>.<listcomp>cSs
|djS)Nr�)r�)�itemrrr�<lambda>f�z+finalize._select_for_exit.<locals>.<lambda>rycSsg|]\}}|�qSrrr�rrrr~gs)r�r]�sort)r$�Lrrr�_select_for_exitbszfinalize._select_for_exitcCs�d}z�|jr�ddl}|��r(d}|��d}|dks:tjrH|��}dt_|sNq�|�	�}z
|�Wq,t
k
r�tjt�
��Yq,Xq,W5dt_|r�|��XdS)NFTr)rr�Zenabler��gcZ	isenabledZdisabler�r�rF�	Exception�sys�
excepthook�exc_info)r$Zreenable_gcr�Zpendingr�rrrr�is,
zfinalize._exitfunc)N)r2r3r4r5r6r�r��	itertools�countr�r�r�r�rE�__text_signature__r)r�r��propertyr�r��setterrX�classmethodr�r�rrrrr�s0*



	
)r5�_weakrefrrrrrrrr	Z_weakrefsetr
r�_collections_abcr�r�r
�__all__r�MutableMappingrrYrrrrrr�<module>s0(
�6^__pycache__/shelve.cpython-38.pyc000064400000022424151153537610012705 0ustar00U

e5dO!�@s�dZddlmZmZddlmZddlZddddgZGd	d
�d
ej	j
�ZGdd�dej	j
�ZGdd�de�Z
Gd
d�de�Zddd�ZdS)a�
Manage shelves of pickled objects.

A "shelf" is a persistent, dictionary-like object.  The difference
with dbm databases is that the values (not the keys!) in a shelf can
be essentially arbitrary Python objects -- anything that the "pickle"
module can handle.  This includes most class instances, recursive data
types, and objects containing lots of shared sub-objects.  The keys
are ordinary strings.

To summarize the interface (key is a string, data is an arbitrary
object):

        import shelve
        d = shelve.open(filename) # open, with (g)dbm filename -- no suffix

        d[key] = data   # store data at key (overwrites old data if
                        # using an existing key)
        data = d[key]   # retrieve a COPY of the data at key (raise
                        # KeyError if no such key) -- NOTE that this
                        # access returns a *copy* of the entry!
        del d[key]      # delete data stored at key (raises KeyError
                        # if no such key)
        flag = key in d # true if the key exists
        list = d.keys() # a list of all existing keys (slow!)

        d.close()       # close it

Dependent on the implementation, closing a persistent dictionary may
or may not be necessary to flush changes to disk.

Normally, d[key] returns a COPY of the entry.  This needs care when
mutable entries are mutated: for example, if d[key] is a list,
        d[key].append(anitem)
does NOT modify the entry d[key] itself, as stored in the persistent
mapping -- it only modifies the copy, which is then immediately
discarded, so that the append has NO effect whatsoever.  To append an
item to d[key] in a way that will affect the persistent mapping, use:
        data = d[key]
        data.append(anitem)
        d[key] = data

To avoid the problem with mutable entries, you may pass the keyword
argument writeback=True in the call to shelve.open.  When you use:
        d = shelve.open(filename, writeback=True)
then d keeps a cache of all entries you access, and writes them all back
to the persistent mapping when you call d.close().  This ensures that
such usage as d[key].append(anitem) works as intended.

However, using keyword argument writeback=True may consume vast amount
of memory for the cache, and it may make d.close() very slow, if you
access many of d's entries after opening it in this way: d has no way to
check which of the entries you access are mutable and/or which ones you
actually mutate, so it must cache, and write back at close, all of the
entries that you access.  You can call d.sync() to write back all the
entries in the cache, and empty the cache (d.sync() also synchronizes
the persistent dictionary on disk, if feasible).
�)�Pickler�	Unpickler)�BytesION�Shelf�
BsdDbShelf�DbfilenameShelf�openc@s8eZdZdZdd�ZeZZZZZ	Z
dd�ZdS)�_ClosedDictz>Marker for a closed dict.  Access attempts raise a ValueError.cGstd��dS)Nz!invalid operation on closed shelf)�
ValueError)�self�args�r
�/usr/lib64/python3.8/shelve.py�closedEsz_ClosedDict.closedcCsdS)Nz<Closed Dictionary>r
�rr
r
r�__repr__Isz_ClosedDict.__repr__N)�__name__�
__module__�__qualname__�__doc__r�__iter__�__len__�__getitem__�__setitem__�__delitem__�keysrr
r
r
rr	Bsr	c@s|eZdZdZddd�Zdd�Zd	d
�Zdd�Zd d
d�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)!rz�Base class for shelf implementations.

    This is initialized with a dictionary-like object.
    See the module's __doc__ string for an overview of the interface.
    NF�utf-8cCs.||_|dkrd}||_||_i|_||_dS)N�)�dict�	_protocol�	writeback�cache�keyencoding�rr�protocolr r"r
r
r�__init__TszShelf.__init__ccs"|j��D]}|�|j�Vq
dS�N)rr�decoder")r�kr
r
rr^szShelf.__iter__cCs
t|j�Sr&)�lenrrr
r
rrbsz
Shelf.__len__cCs|�|j�|jkSr&��encoder"r�r�keyr
r
r�__contains__eszShelf.__contains__cCs|�|j�|jkr||S|Sr&r*)rr-�defaultr
r
r�gethsz	Shelf.getcCsZz|j|}WnFtk
rTt|j|�|j��}t|���}|jrP||j|<YnX|Sr&)	r!�KeyErrorrrr+r"r�loadr �rr-�value�fr
r
rrmszShelf.__getitem__cCsF|jr||j|<t�}t||j�}|�|�|��|j|�|j	�<dSr&)
r r!rrr�dump�getvaluerr+r")rr-r4r5�pr
r
rrws

zShelf.__setitem__cCs6|j|�|j�=z|j|=Wntk
r0YnXdSr&)rr+r"r!r1r,r
r
rrs
zShelf.__delitem__cCs|Sr&r
rr
r
r�	__enter__�szShelf.__enter__cCs|��dSr&)�close)r�typer4�	tracebackr
r
r�__exit__�szShelf.__exit__cCsf|jdkrdSz0|��z|j��Wntk
r:YnXW5zt�|_Wnd|_YnXXdSr&)rr	�syncr:�AttributeErrorrr
r
rr:�s

zShelf.closecCst|d�sdS|��dS)Nr )�hasattrr:rr
r
r�__del__�s
z
Shelf.__del__cCsT|jr:|jr:d|_|j��D]\}}|||<qd|_i|_t|jd�rP|j��dS)NFTr>)r r!�itemsr@rr>)rr-�entryr
r
rr>�s
z
Shelf.sync)NFr)N)rrrrr%rrr.r0rrrr9r=r:rAr>r
r
r
rrMs �



c@sBeZdZdZddd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Z	dS)ra�Shelf implementation using the "BSD" db interface.

    This adds methods first(), next(), previous(), last() and
    set_location() that have no counterpart in [g]dbm databases.

    The actual database must be opened using one of the "bsddb"
    modules "open" routines (i.e. bsddb.hashopen, bsddb.btopen or
    bsddb.rnopen) and passed to the constructor.

    See the module's __doc__ string for an overview of the interface.
    NFrcCst�|||||�dSr&)rr%r#r
r
rr%�szBsdDbShelf.__init__cCs0|j�|�\}}t|�}|�|j�t|���fSr&)r�set_locationrr'r"rr2r3r
r
rrD�szBsdDbShelf.set_locationcCs.t|j�\}}t|�}|�|j�t|���fSr&)�nextrrr'r"rr2r3r
r
rrE�szBsdDbShelf.nextcCs.|j��\}}t|�}|�|j�t|���fSr&)r�previousrr'r"rr2r3r
r
rrF�szBsdDbShelf.previouscCs.|j��\}}t|�}|�|j�t|���fSr&)r�firstrr'r"rr2r3r
r
rrG�szBsdDbShelf.firstcCs.|j��\}}t|�}|�|j�t|���fSr&)r�lastrr'r"rr2r3r
r
rrH�szBsdDbShelf.last)NFr)
rrrrr%rDrErFrGrHr
r
r
rr�s�
c@seZdZdZddd�ZdS)rz�Shelf implementation using the "dbm" generic dbm interface.

    This is initialized with the filename for the dbm database.
    See the module's __doc__ string for an overview of the interface.
    �cNFcCs$ddl}t�||�||�||�dS)Nr)�dbmrr%r)r�filename�flagr$r rJr
r
rr%�szDbfilenameShelf.__init__)rINF)rrrrr%r
r
r
rr�srIFcCst||||�S)a�Open a persistent dictionary for reading and writing.

    The filename parameter is the base filename for the underlying
    database.  As a side-effect, an extension may be added to the
    filename and more than one file may be created.  The optional flag
    parameter has the same interpretation as the flag parameter of
    dbm.open(). The optional protocol parameter specifies the
    version of the pickle protocol.

    See the module's __doc__ string for an overview of the interface.
    )r)rKrLr$r r
r
rr�s
)rINF)r�picklerr�iorZcollections.abc�collections�__all__�abc�MutableMappingr	rrrrr
r
r
r�<module>s:b+__pycache__/uu.cpython-38.opt-2.pyc000064400000006730151153537610013012 0ustar00U

��.em�@sfddlZddlZddlZdddgZGdd�de�Zd
dd�dd�Zdd	d�Zd
d�Ze	dkrbe�dS)�N�Error�encode�decodec@seZdZdS)rN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.8/uu.pyr&sF��backtickc	Csjg}�zH|dkrtjj}n`t|t�rz|dkr8tj�|�}|dkrfzt�	|�j
}Wntk
rdYnXt|d�}|�
|�|dkr�tjj}nt|t�r�t|d�}|�
|�|dkr�d}|dkr�d}|�dd�}|�dd�}|�d	|d
@|f�d��|�d�}t|�d
k�r0|�tj||d��|�d�}�q|�rB|�d�n
|�d�W5|D]}|���qTXdS)N�-�rb�wbi��
z\n�
z\rzbegin %o %s
i��ascii�-rr
s`
end
s 
end
)�close�sys�stdin�buffer�
isinstance�str�os�path�basename�stat�st_mode�AttributeError�open�append�stdout�replace�writer�read�len�binasciiZb2a_uu)�in_file�out_file�name�moder�opened_files�f�datarrr	r)sF








c

Cspg}|dkrtjj}nt|t�r4t|d�}|�|��z|��}|sLt	d��|�
d�sXq8|�dd�}t|�dkr8|ddkr8zt
|d	d
�Wq�Wq8tk
r�Yq8Xq8|dk�r:|d�d��d�}tj�|�r�t	d
|����|�
tj��s*dtj��|k�s*tj�r:|�
tj��s*dtj��|k�r:t	d|�d���|dk�rRt
|d	d
�}|dk�rftjj}n0t|t��r�t|d�}t�||�|}|�|�|��}	|	�rD|	�d�dk�rDzt�|	�}
Wnjtj	k
�r,}zH|	ddd@ddd}t�|	d|��}
|�stj�d|�W5d}~XYnX|�|
�|��}	�q�|	�sRt	d��W5|D]}|���qZXdS)Nrr
z'No valid begin line found in input filesbegin� ��r��s 	
rz Cannot overwrite existing file: z..zRefusing to write to z due to directory traversalrsend� �?��zWarning: %s
zTruncated input file)rrrrrrr r�readliner�
startswith�splitr%�int�
ValueError�rstriprrr�exists�sep�altsepr!�chmod�stripr&Za2b_uu�stderrr#)
r'r(r*�quietr+r,ZhdrZ	hdrfields�fp�sr-�v�nbytesrrr	rcsr





��
��




"
cCs4ddl}|jdd�}|jdddddd	d
�|jddd
ddd	d
�|��\}}t|�dkrl|�d�t�d�tjj	}tj
j	}t|�dkr�|d}t|�dkr�|d}|jr�|jr�t
|t�r�t|d�}nttjdd�t�d�t||�nD|j�r&t
|t��rt|d�}nttjdd�t�d�t||�dS)Nrz'usage: %prog [-d] [-t] [input [output]])Zusagez-dz--decoderzDecode (instead of encode)?F�
store_true)�dest�help�default�actionz-tz--text�textz2data is text, encoded format unix-compatible text?r/zincorrect number of argumentsr1rz: cannot do -t to stdoutr
z: cannot do -t from stdin)�optparseZOptionParserZ
add_option�
parse_argsr%�errorr�exitrrr!rrMrrr�print�argvr)rN�parserZoptions�args�input�outputrrr	�test�s6




rX�__main__)NN)NNF)
r&rr�__all__�	ExceptionrrrrXrrrrr	�<module> s
:
J&__pycache__/pty.cpython-38.opt-2.pyc000064400000006050151153537610013170 0ustar00U

e5d��@s�ddlmZddlZddlZddlZdddgZdZdZdZdZdd�Z	d	d
�Z
dd�Zd
d�Zdd�Z
dd�Zdd�Zeefdd�Zeefdd�ZdS)�)�selectN�openpty�fork�spawn��c	Cs>z
t��WSttfk
r"YnXt�\}}t|�}||fS�N)�osr�AttributeError�OSError�_open_terminal�
slave_open)�	master_fd�
slave_name�slave_fd�r�/usr/lib64/python3.8/pty.pyrs

c	CsLzt��\}}Wnttfk
r(YnXt�|�}t�|�||fSt�Sr)r	rr
r�ttyname�closer)rrrrrr�master_open"s

rc
CsndD]\}dD]R}d||}zt�|tj�}Wntk
rFYqYnX|d||fSqtd��dS)NZpqrstuvwxyzPQRSTZ0123456789abcdefz/dev/ptyz/dev/ttyzout of pty devices)r	�open�O_RDWRr)�x�yZpty_name�fdrrrr2s
rcCsrt�|tj�}zddlm}m}Wntk
r:|YSXz|||d�|||d�Wntk
rlYnX|S)Nr)�ioctl�I_PUSHZptemZldterm)r	rrZfcntlrr�ImportErrorr)Ztty_name�resultrrrrrr
>s
r
c	Cs�zt��\}}Wnttfk
r(Yn4X|tkrTzt��Wntk
rRYnX||fSt�\}}t��}|tkr�t��t�|�t�	|t
�t�	|t�t�	|t�|tkr�t�|�t�
t�t�tj�}t�|�n
t�|�||fSr)r	�forkptyr
r�CHILD�setsidrrr�dup2�STDIN_FILENO�
STDOUT_FILENO�
STDERR_FILENOrrr)�pidrrrZtmp_fdrrrrPs0



cCs"|rt�||�}||d�}qdSr)r	�write)r�data�nrrr�_writenxsr*cCst�|d�S)Ni)r	�read)rrrr�_read~sr,cCsv|tg}t|gg�\}}}||krF||�}|s:|�|�nt�t|�t|kr|t�}|sf|�t�qt||�qdSr)r#r�remover	r'r$r*)r�master_read�
stdin_readZfdsZrfdsZwfdsZxfdsr(rrr�_copy�sr0cCs�t|�td�kr|f}t�d|�t�\}}|tkrHtj|df|��zt�t	�}t�
t	�d}Wntjk
r~d}YnXzt|||�Wn(t
k
r�|r�t�t	tj|�YnXt�|�t�|d�dS)N�z	pty.spawnrr)�type�sys�auditrr r	�execlp�ttyZ	tcgetattrr#Zsetraw�errorr0rZ	tcsetattrZ	TCSAFLUSHr�waitpid)�argvr.r/r&r�modeZrestorerrrr�s&




)rr	r3r6�__all__r#r$r%r rrrr
rr*r,r0rrrrr�<module>	s"
(__pycache__/pickle.cpython-38.pyc000064400000133476151153537610012700 0ustar00U

e5d��	@shdZddlmZddlmZddlmZmZmZddlm	Z	ddl
mZddlZddlm
Z
dd	lmZmZddlZddlZddlZddlZd
ddd
dddddg	ZzddlmZe�d�dZWnek
r�dZYnXeefZdZddddddddgZdZ d Z!Gd!d
�d
e"�Z#Gd"d�de#�Z$Gd#d�de#�Z%Gd$d%�d%e"�Z&zdd&l'm(Z(Wnek
�rldZ(YnXd'Z)d(Z*d)Z+d*Z,d+Z-d,Z.d-Z/d.Z0d/Z1d0Z2d1Z3d2Z4d3Z5d4Z6d5Z7d6Z8d7Z9d8Z:d9Z;d:Z<d;Z=d<Z>d=Z?d>Z@d?ZAd@ZBdAZCdBZDdCZEdDZFdEZGdFZHdGZIdHZJdIZKdJZLdKZMdLZNdMZOdNZPdOZQdPZRdQZSdRZTdSZUdTZVdUZWdVZXdWZYdXZZdYZ[dZZ\d[Z]d\Z^d]Z_eOeYeZe[gZ`d^Zad_Zbd`ZcdaZddbZedcZfddZgdeZhdfZidgZjdhZkdiZldjZmdkZndlZoe�pdmdn�eq�D��Gdodp�dp�ZrGdqdr�dr�Zsdsdt�Ztdudv�Zudwdx�Zvdydz�ZwGd{d|�d|�ZxGd}d~�d~�Zyd�ddd�d�d��Zzd�ddd�d�d��Z{dd�d�dd��d�d��Z|dd�d�dd��d�d��Z}z0dd�lm#Z#m$Z$m%Z%m~Z~mZm�Z�m�Z�m�Z�m�Z�Wn4ek
�r�exeyZ~Zeze{e|e}f\Z�Z�Z�Z�YnXd�d��Z�e�d�k�rdddl�Z�e�j�d�d��Z�e�j�d�e���d��d�d�d��e�j�d�d�d�d�d��e�j�d�d�d�d��e����Z�e�j��r*e��n:e�j��s<e����n(ddl�Z�e�j�D]Z�e�e��Z�e���e���qJdS)�a�Create portable serialized representations of Python objects.

See module copyreg for a mechanism for registering custom picklers.
See module pickletools source for extensive comments.

Classes:

    Pickler
    Unpickler

Functions:

    dump(object, file)
    dumps(object) -> string
    load(file) -> object
    loads(string) -> object

Misc variables:

    __version__
    format_version
    compatible_formats

�)�FunctionType)�dispatch_table)�_extension_registry�_inverted_registry�_extension_cache)�islice)�partialN)�maxsize)�pack�unpack�PickleError�
PicklingError�UnpicklingError�Pickler�	Unpickler�dump�dumps�load�loads)�PickleBufferrTFz4.0z1.0z1.1z1.2z1.3z2.0z3.0z5.0��c@seZdZdZdS)rz6A common base class for the other pickling exceptions.N��__name__�
__module__�__qualname__�__doc__�rr�/usr/lib64/python3.8/pickle.pyrIsc@seZdZdZdS)r
z]This exception is raised when an unpicklable object is passed to the
    dump() method.

    Nrrrrrr
Msc@seZdZdZdS)raThis exception is raised when there is a problem unpickling an object,
    such as a security violation.

    Note that other exceptions may also be raised during unpickling, including
    (but not necessarily limited to) AttributeError, EOFError, ImportError,
    and IndexError.

    NrrrrrrTsc@seZdZdd�ZdS)�_StopcCs
||_dS�N)�value��selfr!rrr�__init__bsz_Stop.__init__N)rrrr$rrrrrasr)�PyStringMap�(�.�0�1�2�F�I�J�K�L�M�N�P�Q�R�S�T�U�V�X�a�b�c�d�}�e�g�h�i�j�l�]�o�p�q�r�s�t�)�u�GsI01
sI00
�������������������������B�C��������������������������cCsg|]}t�d|�r|�qS)z[A-Z][A-Z0-9_]+$)�re�match)�.0�xrrr�
<listcomp>�srnc@sFeZdZdZdZdd�Zdd�Zdd�Zdd
d�Zdd
�Z	dd�Z
dS)�_FramerricCs||_d|_dSr )�
file_write�
current_frame)r#rprrrr$�sz_Framer.__init__cCst��|_dSr )�io�BytesIOrq�r#rrr�
start_framing�sz_Framer.start_framingcCs*|jr&|j��dkr&|jdd�d|_dS)NrT��force)rq�tell�commit_framertrrr�end_framing�sz_Framer.end_framingFcCsf|jrb|j}|��|jks|rb|��}|j}t|�|jkrP|ttdt|���||�t	�
�|_dS)N�<Q)rqrx�_FRAME_SIZE_TARGET�	getbufferrp�len�_FRAME_SIZE_MIN�FRAMEr
rrrs)r#rw�f�data�writerrrry�sz_Framer.commit_framecCs |jr|j�|�S|�|�SdSr )rqr�rp�r#r�rrrr��sz
_Framer.writecCs,|j}|jr|jdd�||�||�dS)NTrv)rprqry)r#�headerZpayloadr�rrr�write_large_bytes�s
z_Framer.write_large_bytesN)F)rrrrr|r$rurzryr�r�rrrrro�s
roc@s6eZdZddd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�	_UnframerNcCs||_||_d|_dSr )�	file_read�
file_readlinerq)r#r�r�Z	file_tellrrrr$	sz_Unframer.__init__cCs�|jrb|j�|�}|dkrJt|�dkrJd|_t|�}|�|�|dd�<|S|t|�kr^td��|St|�}|�|�|dd�<|SdS�Nr�$pickle exhausted before end of frame)rq�readintor~r�r)r#�buf�nrrrr�s�z_Unframer.readintocCsT|jrF|j�|�}|s.|dkr.d|_|�|�St|�|krBtd��|S|�|�SdSr�)rq�readr�r~r�r#r�r�rrrr�s
�z_Unframer.readcCsF|jr:|j��}|s"d|_|��S|ddkr6td��|S|��SdS)N����
r�)rq�readliner�rr�rrrr�,s
�z_Unframer.readlinecCs2|jr|j��dkrtd��t�|�|��|_dS)N�z4beginning of a new frame before end of current frame)rqr�rrrrsr��r#Z
frame_sizerrr�
load_frame9s
�z_Unframer.load_frame)N)rrrr$r�r�r�r�rrrrr�s



r�c	Csj|�d�D]V}|dkr&td�||���z|}t||�}Wq
tk
r^td�||��d�Yq
Xq
||fS)N�.z<locals>z&Can't get local attribute {!r} on {!r}z Can't get attribute {!r} on {!r})�split�AttributeError�format�getattr)�obj�nameZsubpath�parentrrr�
_getattributeBs"���
r�c	Cs�t|dd�}|dk	r|Stj����D]X\}}|dks&|dks&|dkrHq&z t||�d|krf|WSWq&tk
r|Yq&Xq&dS)z$Find the module an object belong to.rN�__main__Z__mp_main__r)r��sys�modules�copy�itemsr�r�)r�r��module_name�modulerrr�whichmoduleOs ��r�cCsh|dkrdS|��d?d}|j|ddd�}|dkrd|dkrd|dd	krd|d
d@dkrd|dd�}|S)
a�Encode a long to a two's complement little-endian binary string.
    Note that 0 is a special case, returning an empty string, to save a
    byte in the LONG1 pickling context.

    >>> encode_long(0)
    b''
    >>> encode_long(255)
    b'\xff\x00'
    >>> encode_long(32767)
    b'\xff\x7f'
    >>> encode_long(-256)
    b'\x00\xff'
    >>> encode_long(-32768)
    b'\x00\x80'
    >>> encode_long(-128)
    b'\x80'
    >>> encode_long(127)
    b'\x7f'
    >>>
    rr����littleT��	byteorderZsignedr������N)�
bit_length�to_bytes)rm�nbytes�resultrrr�encode_longbsr�cCstj|ddd�S)a\Decode a long from a two's complement little-endian binary string.

    >>> decode_long(b'')
    0
    >>> decode_long(b"\xff\x00")
    255
    >>> decode_long(b"\xff\x7f")
    32767
    >>> decode_long(b"\x00\xff")
    -256
    >>> decode_long(b"\x00\x80")
    -32768
    >>> decode_long(b"\x80")
    -128
    >>> decode_long(b"\x7f")
    127
    r�Tr�)�int�
from_bytes)r�rrr�decode_long�sr�c@s�eZdZd;ddd�dd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zd<dd�Z	dd�Z
dd�Zd=dd�ZiZ
dd�Zee
ed�<dd�Zee
e<dd�Zee
e<dd�Zee
e<d d!�Zee
e<d"d#�Zee
e<er�d$d%�Zee
e<d&d'�Zee
e<d(d)�Zee
e <d*d+�Z!e!e
e"<d,Z#d-d.�Z$d/d0�Z%e%e
e&<e'dk	�r@e%e
e'<d1d2�Z(d3d4�Z)e)e
e*<d5d6�Z+e+e
e,<d>d7d8�Z-d9d:�Z.e-e
e/<e.e
e<dS)?�_PicklerNT��fix_imports�buffer_callbackcCs�|dkrt}|dkrt}n"d|kr.tks<ntdt��|dk	rT|dkrTtd��||_z|j|_Wntk
r�td��YnXt|j�|_	|j	j|_|j	j
|_i|_t
|�|_|dk|_d|_|o�|dk|_dS)	a!This takes a binary file for writing a pickle data stream.

        The optional *protocol* argument tells the pickler to use the
        given protocol; supported protocols are 0, 1, 2, 3, 4 and 5.
        The default protocol is 4. It was introduced in Python 3.4, and
        is incompatible with previous versions.

        Specifying a negative protocol version selects the highest
        protocol version supported.  The higher the protocol used, the
        more recent the version of Python needed to read the pickle
        produced.

        The *file* argument must have a write() method that accepts a
        single bytes argument. It can thus be a file object opened for
        binary writing, an io.BytesIO instance, or any other custom
        object that meets this interface.

        If *fix_imports* is True and *protocol* is less than 3, pickle
        will try to map the new Python 3 names to the old module names
        used in Python 2, so that the pickle data stream is readable
        with Python 2.

        If *buffer_callback* is None (the default), buffer views are
        serialized into *file* as part of the pickle stream.

        If *buffer_callback* is not None, then it can be called any number
        of times with a buffer view.  If the callback returns a false value
        (such as None), the given buffer is out-of-band; otherwise the
        buffer is serialized in-band, i.e. inside the pickle stream.

        It is an error if *buffer_callback* is not None and *protocol*
        is None or smaller than 5.
        Nrzpickle protocol must be <= %drz#buffer_callback needs protocol >= 5z"file must have a 'write' attributer�r�)�DEFAULT_PROTOCOL�HIGHEST_PROTOCOL�
ValueError�_buffer_callbackr��_file_writer��	TypeErrorro�framerr��_write_large_bytes�memor��proto�bin�fastr�)r#�file�protocolr�r�rrrr$�s*#



z_Pickler.__init__cCs|j��dS)aClears the pickler's "memo".

        The memo is the data structure that remembers which objects the
        pickler has already seen, so that shared or recursive objects
        are pickled by reference and not by value.  This method is
        useful when re-using picklers.
        N)r��clearrtrrr�
clear_memo�sz_Pickler.clear_memocCsrt|d�std|jjf��|jdkr<|�ttd|j��|jdkrP|j�	�|�
|�|�t�|j��dS)z7Write a pickled representation of obj to the open file.r�z2Pickler.__init__() was not called by %s.__init__()��<BrN)
�hasattrr
�	__class__rr�r��PROTOr
r�ru�save�STOPrz�r#r�rrrr�s
�




z
_Pickler.dumpcCsL|jr
dSt|�|jkst�t|j�}|�|�|��||f|jt|�<dS)zStore an object in the memo.N)r��idr��AssertionErrorr~r��put)r#r��idxrrr�memoize�s
z_Pickler.memoizecCsT|jdkrtS|jr:|dkr*ttd|�Sttd|�Sntt|��d�dSdS)Nr�r��<I�ascii�
)	r��MEMOIZEr��BINPUTr
�LONG_BINPUT�PUT�repr�encode)r#r�rrrr�s
z_Pickler.putcCs@|jr*|dkrttd|�Sttd|�Stt|��d�dS)Nr�r�r�r�r�)r��BINGETr
�LONG_BINGET�GETr�r��r#�irrr�gets
z_Pickler.getc
Cs�|j��|�|�}|dk	r.|r.|�|�dS|j�t|��}|dk	r^|�|�|d��dSt}t	|dd�}|dk	r~||�}|tk�r@t
|�}|j�|�}|dk	r�|||�dSt	|dt��|�}|dk	r�||�}njt
|t
�r�|�|�dSt	|dd�}|dk	�r||j�}n0t	|dd�}|dk	�r.|�}ntd|j|f��t|t��r\|�||�dSt|t��sttd|��t|�}	d|	k�r�d	k�s�ntd
|��|j|d|i�dS)NrZreducer_overrider�
__reduce_ex__�
__reduce__zCan't pickle %r object: %rz%s must return string or tupler��z2Tuple returned by %s must have two to six elementsr�)r�ry�
persistent_id�	save_persr�r�r�r��NotImplementedr��type�dispatchr�
issubclass�save_globalr�r
r�
isinstance�str�tupler~�save_reduce)
r#r��save_persistent_id�pidrm�rv�reduce�tr��lrrrr�sZ









��z
_Pickler.savecCsdSr rr�rrrr�]sz_Pickler.persistent_idcCsb|jr |j|dd�|�t�n>z |�tt|��d�d�Wntk
r\td��YnXdS)NF)r�r�r��2persistent IDs in protocol 0 must be ASCII strings)	r�r�r��	BINPERSID�PERSIDr�r��UnicodeEncodeErrorr
�r#r�rrrr�as �z_Pickler.save_persc
Cs>t|t�std��t|�s"td��|j}|j}	t|dd�}
|jdkr�|
dkr�|\}}}t|d�sntd�	|
���|dk	r�||j
k	r�td	�	|
���|jd
kr�||�||�||�|	t�n,t|j
|f|�|�}||�|d�|	t�n�|jdk�r^|
dk�r^|d
}t|d��std��|dk	�r8||j
k	�r8td��|dd�}||�||�|	t�n||�||�|	t�|dk	�r�t|�|jk�r�|	t|�|jt|�d
��n
|�|�|dk	�r�|�|�|dk	�r�|�|�|dk	�r:|dk�r
||�|	t�n0||�||�||�|	t�|	t�|	t�dS)Nz'args from save_reduce() must be a tuplez(func from save_reduce() must be callabler�r��
__newobj_ex__�__new__z#args[0] from {} args has no __new__z(args[0] from {} args has the wrong classrr�
__newobj__rz+args[0] from __newobj__ args has no __new__z0args[0] from __newobj__ args has the wrong classr�)r�r�r
�callabler�r�r�r�r�r�r��	NEWOBJ_EXrr�REDUCE�NEWOBJr�r��POPr�r��_batch_appends�_batch_setitems�BUILD�TUPLE2)
r#�func�args�stateZ	listitemsZ	dictitemsZstate_setterr�r�r�Z	func_name�cls�kwargsrrrr�msz


��


��

"







z_Pickler.save_reducecCs|�t�dSr )r��NONEr�rrr�	save_none�sz_Pickler.save_nonecCs4|jdkr|�|rtnt�n|�|r*tnt�dS)Nr�)r�r��NEWTRUE�NEWFALSE�TRUE�FALSEr�rrr�	save_bool�s
z_Pickler.save_boolcCs.|jr~|dkrN|dkr.|�ttd|��dS|dkrN|�ttd|��dSd|krbdkr~nn|�ttd|��dS|jd	kr�t|�}t|�}|d
kr�|�t	td|�|�n|�t
td|�|�dSd|kr�dk�rnn|�tt|��
d�d�n|�tt|��
d�d
�dS)Nrr�r���<Hi�i����<ir�r�r�r�sL
)r�r��BININT1r
�BININT2�BININTr�r�r~�LONG1�LONG4�INTr�r��LONG�r#r�Zencodedr�rrr�	save_long�s*
z_Pickler.save_longcCs<|jr|�ttd|��n|�tt|��d�d�dS)N�>dr�r�)r�r��BINFLOATr
�FLOATr�r�r�rrr�
save_floatsz_Pickler.save_floatcCs�|jdkr@|s |jtd|d�n|jtjt|d�df|d�dSt|�}|dkrj|�tt	d|�|�nf|dkr�|jdkr�|�
tt	d	|�|�n<||jj
kr�|�
tt	d
|�|�n|�tt	d
|�|�|�|�dS)Nr�r�r��latin1r�r����rr{r�)r�r��bytes�codecsr�r�r~r��SHORT_BINBYTESr
r��	BINBYTES8r�r|�BINBYTESr��r#r�r�rrr�
save_bytess"
�z_Pickler.save_bytescCs�|jdkr:|s |jtd|d�n|jtt|�f|d�dSt|�}||jjkrf|�tt	d|�|�n|�
tt	d|�|�dS)Nrrr+r{)r�r��	bytearrayr.r~r�r|r��
BYTEARRAY8r
r�r3rrr�save_bytearray)s
z_Pickler.save_bytearrayc	Cs�|jdkrtd��|���t}|js*td��d}|jdk	rFt|�|��}|rp|jr`|�|���q�|�	|���n|�
t�|jr�|�
t�W5QRXdS)Nrz0PickleBuffer can only pickled with protocol >= 5zHPickleBuffer can not be pickled when pointing to a non-contiguous bufferT)
r�r
�raw�
contiguousr��bool�readonlyr4�tobytesr7r��NEXT_BUFFER�READONLY_BUFFER)r#r��mZin_bandrrr�save_picklebuffer8s



z_Pickler.save_picklebuffercCs|jr�|�dd�}t|�}|dkrF|jdkrF|�ttd|�|�nf|dkrp|jdkrp|�ttd|�|�n<||j	j
kr�|�ttd|�|�n|�ttd|�|�nT|�d	d
�}|�dd�}|�d
d�}|�dd�}|�dd�}|�t
|�d�d�|�|�dS)N�utf-8�
surrogatepassr�rr�r-r{r��\z\u005c�z\u0000�
z\u000a�
z\u000d�z\u001a�raw-unicode-escaper�)r�r�r~r�r��SHORT_BINUNICODEr
r��BINUNICODE8r�r|�
BINUNICODE�replace�UNICODEr�r%rrr�save_strRs&�z_Pickler.save_strcCs:|s(|jr|�t�n|�tt�dSt|�}|j}|j}|dkr�|jdkr�|D]}||�qRt	|�|kr�|�
|t	|�d�}|�t||�n|�t|�|�
|�dS|j}|t�|D]}||�q�t	|�|k�r$|�
|t	|�d�}|j�r|t|�n|t|d|�dS|t�|�
|�dS)Nr�r�rr�)r�r��EMPTY_TUPLE�MARK�TUPLEr~r�r�r�r�r�r
�_tuplesize2coder��POP_MARK)r#r�r�r�r�Zelementr�r�rrr�
save_tupleis:


z_Pickler.save_tuplecCs8|jr|�t�n|�tt�|�|�|�|�dSr )r�r��
EMPTY_LISTrP�LISTr�rr�rrr�	save_list�s

z_Pickler.save_listi�cCs�|j}|j}|js0|D]}||�|t�qdSt|�}tt||j��}t|�}|dkr||t	�|D]}||�qd|t
�n|r�||d�|t�||jkr8dSq8dS�Nr�r)r�r�r��APPEND�iter�listr�
_BATCHSIZEr~rP�APPENDS)r#r�r�r�rm�it�tmpr�rrrr�s(



z_Pickler._batch_appendscCs<|jr|�t�n|�tt�|�|�|�|���dSr )r�r��
EMPTY_DICTrP�DICTr�rr�r�rrr�	save_dict�s

z_Pickler.save_dictc	Cs�|j}|j}|js<|D] \}}||�||�|t�qdSt|�}tt||j��}t|�}|dkr�|t	�|D]\}}||�||�qp|t
�n(|r�|d\}}||�||�|t�||jkrDdSqDdSrX)r�r�r��SETITEMrZr[rr\r~rP�SETITEMS)	r#r�r�r��k�vr^r_r�rrrr�s0



z_Pickler._batch_setitemscCs�|j}|j}|jdkr0|jtt|�f|d�dS|t�|�|�t|�}tt	||j
��}t|�}|dkr�|t�|D]}||�qv|t
�||j
krJdSqJdS�Nrr+r)r�r�r�r��setr[�	EMPTY_SETr�rZrr\r~rP�ADDITEMS)r#r�r�r�r^Zbatchr��itemrrr�save_set�s"



z_Pickler.save_setcCs�|j}|j}|jdkr0|jtt|�f|d�dS|t�|D]}||�q<t|�|jkr||t	|�
|jt|�d��dS|t�|�|�dSrg)
r�r�r�r��	frozensetr[rPr�r�rSr��	FROZENSETr�)r#r�r�r�rkrrr�save_frozensets

 z_Pickler.save_frozensetc

Csd|j}|j}|dkr t|dd�}|dkr.|j}t||�}z(t|dd�tj|}t||�\}}Wn.t	t
tfk
r�td|||f�d�YnX||k	r�td|||f��|j
dk�r&t�||f�}	|	�r&|	dks�t�|	dkr�|ttd|	��n0|	d	k�r|ttd
|	��n|ttd|	��dS|�d�d}
||k�rB|
}|j
d
k�rl|�|�|�|�|t�n�||k	�r�|�t||
f�n�|j
dk�r�|tt|d�dt|d�d�n�|j�rtj}tj}||f|k�r�|||f\}}n||k�r||}z(|tt|d�dt|d�d�Wn,tk
�rTtd|||j
f�d�YnX|� |�dS)Nrr��levelz(Can't pickle %r: it's not found as %s.%sz2Can't pickle %r: it's not the same object as %s.%sr�r�r�rrrr�rr�rAr�r�z?can't pickle global identifier '%s.%s' using pickle protocol %i)!r�r�r�rr��
__import__r�r�r��ImportError�KeyErrorr�r
r�rr�r��EXT1r
�EXT2�EXT4�
rpartitionr��STACK_GLOBALr��GLOBALr.r��_compat_pickleZREVERSE_NAME_MAPPINGZREVERSE_IMPORT_MAPPINGrr�)
r#r�r�r�r�r�r�Zobj2r��codeZlastnameZr_name_mappingZr_import_mappingrrrr�s�

�����





��
��

���z_Pickler.save_globalcCs`|td�kr|jtd|d�S|tt�kr:|jttf|d�S|td�krV|jtd|d�S|�|�S)Nr r+.).)r�r�r�r�r�rrr�	save_typeasz_Pickler.save_type)N)T)NNNNN)N)0rrrr$r�rr�r�r�r�r�r�r�r�rr�rr:r&r�r*�floatr4r.r7r5�_HAVE_PICKLE_BUFFERr@rrNr�rTr�rWr[r\rrb�dictr%rrlrhrormr�r}rrrrrr��sj�9
	
F�
u1		

B	r�c@s�eZdZddddd�dd�Zdd	�Zd
d�Zdd
�ZiZdd�Zeee	d<dd�Z
e
eed<dd�Zeee
d<dd�Zeeed<dd�Zeeed<dd�Zeeed<dd�Zeeed<dd�Zeeed<dd �Zeeed<d!d"�Zeeed<d#d$�Zeeed<d%d&�Zeeed<d'd(�Z e ee!d<d)d*�Z"e"ee#d<d+d,�Z$e$ee%d<d-d.�Z&e&ee'd<d/d0�Z(d1d2�Z)e)ee*d<d3d4�Z+e+ee,d<d5d6�Z-e-ee.d<d7d8�Z/e/ee0d<d9d:�Z1e1ee2d<d;d<�Z3e3ee4d<d=d>�Z5e5ee6d<d?d@�Z7e7ee8d<dAdB�Z9e9ee:d<dCdD�Z;e;ee<d<dEdF�Z=e=ee>d<dGdH�Z?e?ee@d<dIdJ�ZAeAeeBd<dKdL�ZCeCeeDd<dMdN�ZEeEeeFd<dOdP�ZGeGeeHd<dQdR�ZIeIeeJd<dSdT�ZKeKeeLd<dUdV�ZMeMeeNd<dWdX�ZOeOeePd<dYdZ�ZQeQeeRd<d[d\�ZSeSeeTd<d]d^�ZUeUeeVd<d_d`�ZWeWeeXd<dadb�ZYdcdd�ZZeZee[d<dedf�Z\e\ee]d<dgdh�Z^e^ee_d<didj�Z`e`eead<dkdl�Zbebeecd<dmdn�Zdedeeed<dodp�Zfefeegd<dqdr�Zheheeid<dsdt�Zjejeekd<dudv�Zldwdx�Zmdydz�Zneneeod<d{d|�Zpepeeqd<d}d~�Zrereesd<dd��Zteteeud<d�d��Zveveewd<d�d��Zxexeeyd<d�d��Zzezee{d<d�d��Z|e|ee}d<d�d��Z~e~eed<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<d�d��Z�e�ee�d<dS)��
_UnpicklerT�ASCII�strictN�r��encoding�errors�bufferscCsH|dk	rt|�nd|_|j|_|j|_i|_||_||_d|_	||_
dS)a�This takes a binary file for reading a pickle data stream.

        The protocol version of the pickle is detected automatically, so
        no proto argument is needed.

        The argument *file* must have two methods, a read() method that
        takes an integer argument, and a readline() method that requires
        no arguments.  Both methods should return bytes.  Thus *file*
        can be a binary file object opened for reading, an io.BytesIO
        object, or any other custom object that meets this interface.

        The file-like object must have two methods, a read() method
        that takes an integer argument, and a readline() method that
        requires no arguments.  Both methods should return bytes.
        Thus file-like object can be a binary file object opened for
        reading, a BytesIO object, or any other custom object that
        meets this interface.

        If *buffers* is not None, it should be an iterable of buffer-enabled
        objects that is consumed each time the pickle stream references
        an out-of-band buffer view.  Such buffers have been given in order
        to the *buffer_callback* of a Pickler object.

        If *buffers* is None (the default), then the buffers are taken
        from the pickle stream, assuming they are serialized there.
        It is an error for *buffers* to be None if the pickle stream
        was produced with a non-None *buffer_callback*.

        Other optional arguments are *fix_imports*, *encoding* and
        *errors*, which are used to control compatibility support for
        pickle stream generated by Python 2.  If *fix_imports* is True,
        pickle will try to map the old Python 2 names to the new names
        used in Python 3.  The *encoding* and *errors* tell pickle how
        to decode 8-bit string instances pickled by Python 2; these
        default to 'ASCII' and 'strict', respectively. *encoding* can be
        'bytes' to read theses 8-bit string instances as bytes objects.
        Nr)rZ�_buffersr��_file_readliner��
_file_readr�r�r�r�r�)r#r�r�r�r�r�rrrr$rs'z_Unpickler.__init__c
Cs�t|d�std|jjf��t|j|j�|_|jj|_|jj	|_	|jj
|_
g|_g|_|jj
|_
d|_|j}|j}z4|d�}|s�t�t|t�s�t�||d|�qtWn,tk
r�}z|jWY�Sd}~XYnXdS)z�Read a pickled object representation from the open file.

        Return the reconstituted object hierarchy specified in the file.
        r�z4Unpickler.__init__() was not called by %s.__init__()rr�N)r�rr�rr�r�r��	_unframerr�r�r��	metastack�stack�appendr�r��EOFErrorr��bytes_typesr�rr!)r#r�r��keyZstopinstrrrr�s,
�



z_Unpickler.loadcCs |j}|j��|_|jj|_|Sr )r�r��popr��r#r�rrr�pop_mark�s
z_Unpickler.pop_markcCstd��dS)Nz%unsupported persistent id encountered)rrrrr�persistent_load�sz_Unpickler.persistent_loadcCs:|�d�d}d|kr"tks0ntd|��||_dS)Nr�rzunsupported pickle protocol: %d)r�r�r�r�)r#r�rrr�
load_proto�sz_Unpickler.load_protorcCs8td|�d��\}|tjkr(td|��|j�|�dS)Nr{�zframe size > sys.maxsize: %d)rr�r�r	r�r�r�r�rrrr��s
z_Unpickler.load_framecCsLz|��dd��d�}Wntk
r6td��YnX|�|�|��dS)Nr�r�r�)r��decode�UnicodeDecodeErrorrr�r�rrrr�load_persid�s�
z_Unpickler.load_persidcCs|j��}|�|�|��dSr )r�r�r�r�rrrr�load_binpersid�s
z_Unpickler.load_binpersidcCs|�d�dSr �r�rtrrr�	load_none�sz_Unpickler.load_nonecCs|�d�dS)NFr�rtrrr�
load_false�sz_Unpickler.load_falsecCs|�d�dS)NTr�rtrrr�	load_true�sz_Unpickler.load_truecCsL|��}|tdd�krd}n |tdd�kr4d}n
t|d�}|�|�dS)Nr�FTr)r�rrr�r�)r#r��valrrr�load_int�s
z_Unpickler.load_intcCs|�td|�d��d�dS)Nrrr�r�rr�rtrrr�load_binint�sz_Unpickler.load_binintcCs|�|�d�d�dSrX)r�r�rtrrr�load_binint1sz_Unpickler.load_binint1cCs|�td|�d��d�dS)Nrr�rr�rtrrr�load_binint2sz_Unpickler.load_binint2cCs@|��dd�}|r,|ddkr,|dd�}|�t|d��dS)Nr��Lr)r�r�r�)r#r�rrr�	load_longsz_Unpickler.load_longcCs*|�d�d}|�|�}|�t|��dSrX)r�r�r�r�rrr�
load_long1s
z_Unpickler.load_long1cCs>td|�d��\}|dkr"td��|�|�}|�t|��dS)Nrrrz#LONG pickle has negative byte count)rr�rr�r�r�rrr�
load_long4s

z_Unpickler.load_long4cCs|�t|��dd���dS�Nr�)r�r~r�rtrrr�
load_float!sz_Unpickler.load_floatcCs|�td|�d��d�dS)Nr'r�rr�rtrrr�
load_binfloat%sz_Unpickler.load_binfloatcCs"|jdkr|S|�|j|j�SdS)Nr.)r�r�r�r"rrr�_decode_string)s
z_Unpickler._decode_stringcCsl|��dd�}t|�dkrF|d|dkrF|ddkrF|dd�}ntd��|�|�t�|�d��dS)Nr�r�rs"'r�z)the STRING opcode argument must be quoted)r�r~rr�r�r/�
escape_decoder�rrr�load_string2s
(z_Unpickler.load_stringcCs@td|�d��\}|dkr"td��|�|�}|�|�|��dS)Nrrrz(BINSTRING pickle has negative byte count)rr�rr�r��r#r~r�rrr�load_binstring<s

z_Unpickler.load_binstringcCs:td|�d��\}|tkr&tdt��|�|�|��dS)Nr�rz2BINBYTES exceeds system's maximum size of %d bytes�rr�r	rr��r#r~rrr�
load_binbytesEs�z_Unpickler.load_binbytescCs |�t|��dd�d��dS)Nr�rH)r�r�r�rtrrr�load_unicodeMsz_Unpickler.load_unicodecCsBtd|�d��\}|tkr&tdt��|�t|�|�dd��dS)Nr�rz4BINUNICODE exceeds system's maximum size of %d bytesrArB�rr�r	rr�r�r�rrr�load_binunicodeQs�z_Unpickler.load_binunicodecCsBtd|�d��\}|tkr&tdt��|�t|�|�dd��dS)Nr{r�z5BINUNICODE8 exceeds system's maximum size of %d bytesrArBr�r�rrr�load_binunicode8Ys�z_Unpickler.load_binunicode8cCs:td|�d��\}|tkr&tdt��|�|�|��dS)Nr{r�z3BINBYTES8 exceeds system's maximum size of %d bytesr�r�rrr�load_binbytes8as�z_Unpickler.load_binbytes8cCsFtd|�d��\}|tkr&tdt��t|�}|�|�|�|�dS)Nr{r�z4BYTEARRAY8 exceeds system's maximum size of %d bytes)rr�r	rr5r�r�)r#r~�brrr�load_bytearray8is�
z_Unpickler.load_bytearray8cCsL|jdkrtd��zt|j�}Wntk
r<td��YnX|�|�dS)NzLpickle stream refers to out-of-band data but no *buffers* argument was givenznot enough out-of-band buffers)r�r�next�
StopIterationr�)r#r�rrr�load_next_bufferss
z_Unpickler.load_next_bufferc	Cs6|jd}t|��}|js(|��|jd<W5QRXdSr�)r��
memoryviewr;�
toreadonly)r#r�r?rrr�load_readonly_buffer~s

z_Unpickler.load_readonly_buffercCs,|�d�d}|�|�}|�|�|��dSrX)r�r�r�r�rrr�load_short_binstring�s
z_Unpickler.load_short_binstringcCs"|�d�d}|�|�|��dSrX)r�r�r�rrr�load_short_binbytes�sz_Unpickler.load_short_binbytescCs*|�d�d}|�t|�|�dd��dS)Nr�rrArB)r�r�r�r�rrr�load_short_binunicode�sz _Unpickler.load_short_binunicodecCs|��}|�t|��dSr )r�r�r�r�rrr�
load_tuple�sz_Unpickler.load_tuplecCs|�d�dS)Nrr�rtrrr�load_empty_tuple�sz_Unpickler.load_empty_tuplecCs|jdf|jd<dSr��r�rtrrr�load_tuple1�sz_Unpickler.load_tuple1cCs$|jd|jdfg|jdd�<dS)Nr�r�r�rtrrr�load_tuple2�sz_Unpickler.load_tuple2cCs,|jd|jd|jdfg|jdd�<dS)N���r�r�r�rtrrr�load_tuple3�sz_Unpickler.load_tuple3cCs|�g�dSr r�rtrrr�load_empty_list�sz_Unpickler.load_empty_listcCs|�i�dSr r�rtrrr�load_empty_dictionary�sz _Unpickler.load_empty_dictionarycCs|�t��dSr )r�rhrtrrr�load_empty_set�sz_Unpickler.load_empty_setcCs|��}|�t|��dSr )r�r�rmr�rrr�load_frozenset�sz_Unpickler.load_frozensetcCs|��}|�|�dSr )r�r�r�rrr�	load_list�sz_Unpickler.load_listcs4|����fdd�tdt��d�D�}|�|�dS)Ncsi|]}�|�|d�qS)r�r)rlr��r�rr�
<dictcomp>�s�z(_Unpickler.load_dict.<locals>.<dictcomp>rr�)r��ranger~r�)r#�drr�r�	load_dict�s

�z_Unpickler.load_dictc
Cs�|st|t�rt|d�rjz||�}Wqttk
rf}z$td|jt|�ft��d��W5d}~XYqtXn
|�|�}|�	|�dS)NZ__getinitargs__zin constructor for %s: %sr�)
r�r�r�r�rr�r��exc_inforr�)r#�klassrr!�errrrr�_instantiate�s��
�
z_Unpickler._instantiatecCsL|��dd��d�}|��dd��d�}|�||�}|�||���dS)Nr�r�)r�r��
find_classr�r��r#r�r�r�rrr�	load_inst�sz_Unpickler.load_instcCs"|��}|�d�}|�||�dS�Nr)r�r�r�)r#rrrrr�load_obj�s
z_Unpickler.load_objcCs2|j��}|j��}|j|f|��}|�|�dSr �r�r�rr�)r#rrr�rrr�load_newobj�s

z_Unpickler.load_newobjcCs>|j��}|j��}|j��}|j|f|�|�}|�|�dSr r�)r#rrrr�rrr�load_newobj_ex�s



z_Unpickler.load_newobj_excCsF|��dd��d�}|��dd��d�}|�||�}|�|�dS)Nr�rA)r�r�r�r�r�rrr�load_global�sz_Unpickler.load_globalcCsJ|j��}|j��}t|�tk	s,t|�tk	r4td��|�|�||��dS)NzSTACK_GLOBAL requires str)r�r�r�r�rr�r�)r#r�r�rrr�load_stack_global�s


z_Unpickler.load_stack_globalcCs|�d�d}|�|�dSrX)r��
get_extension�r#r|rrr�	load_ext1sz_Unpickler.load_ext1cCs td|�d��\}|�|�dS)Nrr��rr�r�r�rrr�	load_ext2	sz_Unpickler.load_ext2cCs td|�d��\}|�|�dS)Nrrr�r�rrr�	load_ext4sz_Unpickler.load_ext4cCspg}t�||�}||k	r&|�|�dSt�|�}|sP|dkrDtd��td|��|j|�}|t|<|�|�dS)NrzEXT specifies code <= 0zunregistered extension code %d)rr�r�rrr�r�)r#r|Znilr�r�rrrr�s


z_Unpickler.get_extensioncCs�t�d||�|jdkrT|jrT||ftjkr@tj||f\}}n|tjkrTtj|}t|dd�|jdkr~ttj	||�dSt
tj	||�SdS)Nzpickle.find_classr�rrpr)r��auditr�r�r{ZNAME_MAPPINGZIMPORT_MAPPINGrrr�r�r�)r#r�r�rrrr�#s


z_Unpickler.find_classcCs&|j}|��}|d}||�|d<dSr��r�r�)r#r�rrrrr�load_reduce1sz_Unpickler.load_reducecCs|jr|jd=n|��dSr�)r�r�rtrrr�load_pop8s
z_Unpickler.load_popcCs|��dSr )r�rtrrr�
load_pop_mark?sz_Unpickler.load_pop_markcCs|�|jd�dSr�)r�r�rtrrr�load_dupCsz_Unpickler.load_dupcCs(t|��dd��}|�|j|�dSr�)r�r�r�r�r�rrr�load_getGsz_Unpickler.load_getcCs"|�d�d}|�|j|�dSrX)r�r�r�r�rrr�load_bingetLsz_Unpickler.load_bingetcCs&td|�d��\}|�|j|�dS)Nr�r)rr�r�r�r�rrr�load_long_bingetQsz_Unpickler.load_long_bingetcCs8t|��dd��}|dkr$td��|jd|j|<dS)Nr�rznegative PUT argument)r�r�r�r�r�r�rrr�load_putVsz_Unpickler.load_putcCs2|�d�d}|dkrtd��|jd|j|<dS)Nr�rznegative BINPUT argumentr�)r�r�r�r�r�rrr�load_binput]sz_Unpickler.load_binputcCs6td|�d��\}|tkr"td��|jd|j|<dS)Nr�rznegative LONG_BINPUT argumentr�)rr�r	r�r�r�r�rrr�load_long_binputdsz_Unpickler.load_long_binputcCs|j}|jd|t|�<dSr�)r�r�r~)r#r�rrr�load_memoizeksz_Unpickler.load_memoizecCs$|j}|��}|d}|�|�dSr�)r�r�r�)r#r�r!r[rrr�load_appendpsz_Unpickler.load_appendcCsZ|��}|jd}z
|j}Wntk
r0YnX||�dS|j}|D]}||�qHdSr�)r�r��extendr�r�)r#r�Zlist_objr�r�rkrrr�load_appendsws

z_Unpickler.load_appendscCs*|j}|��}|��}|d}|||<dSr�r�)r#r�r!r�r�rrr�load_setitem�s
z_Unpickler.load_setitemcCs@|��}|jd}tdt|�d�D]}||d|||<q"dS)Nr�rr�r�)r�r�r�r~)r#r�r�r�rrr�
load_setitems�s
z_Unpickler.load_setitemscCsD|��}|jd}t|t�r(|�|�n|j}|D]}||�q2dSr�)r�r�r�rh�update�add)r#r�Zset_objr�rkrrr�
load_additems�s

z_Unpickler.load_additemsc
Cs�|j}|��}|d}t|dd�}|dk	r6||�dSd}t|t�rXt|�dkrX|\}}|r�|j}tj}|�	�D]*\}}	t
|�tkr�|	|||�<qp|	||<qp|r�|�	�D]\}}	t|||	�q�dS)Nr��__setstate__r�)
r�r�r�r�r�r~�__dict__r��internr�r�r��setattr)
r#r�r�inst�setstateZ	slotstateZ	inst_dictrrerfrrr�
load_build�s(
z_Unpickler.load_buildcCs"|j�|j�g|_|jj|_dSr )r�r�r�rtrrr�	load_mark�sz_Unpickler.load_markcCs|j��}t|��dSr )r�r�rr"rrr�	load_stop�s
z_Unpickler.load_stop)�rrrr$rr�r�r�r�r�r�r�r�r�r�r�r�rr�rr�rr�r#r�r r�rr�rr�r$r�r!r�r"r�r)r�r(r�r��STRINGr��	BINSTRINGr�r2r�rMr�rKr�rJr�r1r�r6r�r=r�r>r��SHORT_BINSTRINGr�r0r�rIr�rQr�rOr��TUPLE1r�rr��TUPLE3r�rUr�r`r�rir�rnr�rVr�rar�r��INSTr��OBJr�r	r�rr�rzr�ryr�rur�rvr�rwr�r�r�rr�r
r�rSr��DUPr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rYr�r]r�rcr�rdr�rjrr
rrPrr�rrrrr�ps*�0				r�r�cCst||||d��|�dS�Nr�)r�r)r�r�r�r�r�rrr�_dump�s
��rcCs8t��}t||||d��|�|��}t|t�s4t�|Sr)rrrsr�r�getvaluer�r�r�)r�r�r�r�r��resrrr�_dumps�s��rr�r�r�cCst|||||d���S)N�r�r�r�r�)r�r)r�r�r�r�r�rrr�_load�s�rcCs2t|t�rtd��t�|�}t|||||d���S)Nz%Can't load pickle from unicode stringr)r�r�r�rrrsr�r)�sr�r�r�r�r�rrr�_loads�s

�r)	rr
rrrrrrrcCsddl}|��Sr�)�doctestZtestmod)rrrr�_test�srr�z$display contents of the pickle files)Zdescription�pickle_file�br�*zthe pickle file)r��nargs�helpz-tz--test�
store_truezrun self-test suite)�actionrz-vz)run verbosely; only affects self-test run)N)N)�r�typesr�copyregrrrr�	itertoolsr�	functoolsrr�r	Zstructr
rrjrrr/r{�__all__�_picklerr�rrsr.r5r�Zformat_versionZcompatible_formatsr�r��	Exceptionrr
rrZorg.python.corer%rPr�r
rSrr)r#r rr$rrr�r�rrr	r
rMrKrYr
rzrar`r]r�r�r
r�rVrUrr�r�r�rcrQrOrdr(rrr�r	rurvrwrrrrrr!r"rRr2r0rIrJr1rirjrnrryr�r�r6r=r>r��dirror�r�r�r�r�r�r�rrrrrrrrrrrr�argparse�ArgumentParser�parser�add_argumentZFileType�
parse_argsrZtestrZ
print_helpZpprintr�r�rrrr�<module>sh�

�

?;
^]��	0

����

__pycache__/py_compile.cpython-38.pyc000064400000016332151153537610013560 0ustar00U

&�.e �@s�dZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddddgZ
Gdd�de�ZGdd�dej
�Zd	d
�Zdd
d�Zddd�Zedkr�e�e��dS)zqRoutine to "compile" a .py file to a .pyc file.

This module has intimate knowledge of the format of .pyc files.
�N�compile�main�PyCompileError�PycInvalidationModec@s"eZdZdZddd�Zdd�ZdS)	ra�Exception raised when an error occurs while attempting to
    compile the file.

    To raise this exception, use

        raise PyCompileError(exc_type,exc_value,file[,msg])

    where

        exc_type:   exception type to be used in error message
                    type name can be accesses as class variable
                    'exc_type_name'

        exc_value:  exception value to be used in error message
                    can be accesses as class variable 'exc_value'

        file:       name of file being compiled to be used in error message
                    can be accesses as class variable 'file'

        msg:        string message to be written as error message
                    If no value is given, a default exception message will be
                    given, consistent with 'standard' py_compile output.
                    message (or default) can be accesses as class variable
                    'msg'

    �cCst|j}|tkr2d�t�||��}|�dd|�}nd||f}t�||pJ||||�||_||_	||_
|pl||_dS)NrzFile "<string>"z	File "%s"z
Sorry: %s: %s)�__name__�SyntaxError�join�	traceback�format_exception_only�replace�	Exception�__init__�
exc_type_name�	exc_value�file�msg)�self�exc_typerrrr�tbtext�errmsg�r�"/usr/lib64/python3.8/py_compile.pyr.s�zPyCompileError.__init__cCs|jS)N)r)rrrr�__str__>szPyCompileError.__str__N)r)r�
__module__�__qualname__�__doc__rrrrrrrs
c@seZdZdZdZdZdS)r���N)rrr�	TIMESTAMP�CHECKED_HASH�UNCHECKED_HASHrrrrrBscCs(tj�d�rtj�d�stjStjSdS)N�SOURCE_DATE_EPOCH�RPM_BUILD_ROOT)�os�environ�getrr!r rrrr�_get_default_invalidation_modeHs

�r(F���c
Cs�|dkrt�}|dkrL|dkr@|dkr*|nd}tjj||d�}ntj�|�}tj�|�rld}t|�|���n*tj�	|�r�tj�
|�s�d}t|�|���tj�d|�}	|	�
|�}
z|	j|
|p�||d	�}Wndtk
�r*}zDt|j||p�|�}
|d
k�r|�r|
�ntj�|
jd�WY�dSd}~XYnXz tj�|�}|�rJt�|�Wntk
�rbYnX|tjk�r�|	�|�}tj�||d|d
�}n"tj�|
�}tj�|||tjk�}tj� |�}tj�!|||�|S)a�Byte-compile one Python source file to Python bytecode.

    :param file: The source file name.
    :param cfile: The target byte compiled file name.  When not given, this
        defaults to the PEP 3147/PEP 488 location.
    :param dfile: Purported file name, i.e. the file name that shows up in
        error messages.  Defaults to the source file name.
    :param doraise: Flag indicating whether or not an exception should be
        raised when a compile error is found.  If an exception occurs and this
        flag is set to False, a string indicating the nature of the exception
        will be printed, and the function will return to the caller. If an
        exception occurs and this flag is set to True, a PyCompileError
        exception will be raised.
    :param optimize: The optimization level for the compiler.  Valid values
        are -1, 0, 1 and 2.  A value of -1 means to use the optimization
        level of the current interpreter, as given by -O command line options.
    :param invalidation_mode:
    :param quiet: Return full output with False or 0, errors only with 1,
        and no output with 2.

    :return: Path to the resulting byte compiled file.

    Note that it isn't necessary to byte-compile Python modules for
    execution efficiency -- Python itself byte-compiles a module when
    it is loaded, and if it can, writes out the bytecode to the
    corresponding .pyc file.

    However, if a Python installation is shared between users, it is a
    good idea to byte-compile all modules upon installation, since
    other users may not be able to write in the source directories,
    and thus they won't be able to write the .pyc file, and then
    they would be byte-compiling every module each time it is loaded.
    This can slow down program start-up considerably.

    See compileall.py for a script/module that uses this module to
    byte-compile all installed files (or all files in selected
    directories).

    Do note that FileExistsError is raised if cfile ends up pointing at a
    non-regular file or symlink. Because the compilation uses a file renaming,
    the resulting file would be regular and thus not the same type of file as
    it was previously.
    Nrrr)�optimizationzc{} is a symlink and will be changed into a regular file if import writes a byte-compiled file to itzk{} is a non-regular file and will be changed into a regular one if import writes a byte-compiled file to itz<py_compile>)�	_optimizer�
�mtime�size)"r(�	importlib�util�cache_from_sourcer%�path�islink�FileExistsError�format�exists�isfile�	machinery�SourceFileLoader�get_data�source_to_coder
r�	__class__�sys�stderr�writer�dirname�makedirsrr �
path_stats�_bootstrap_external�_code_to_timestamp_pyc�source_hash�_code_to_hash_pycr!�
_calc_mode�
_write_atomic)r�cfile�dfile�doraise�optimize�invalidation_mode�quietr*r�loader�source_bytes�code�err�py_excr@�source_stats�bytecoderE�moderrrrPsd-�
�


��cCs|dkrtjdd�}d}|dgkr�tj��}|s4q�|�d�}zt|dd�Wq$tk
r�}zd}tj�d|j	�W5d}~XYq$t
k
r�}zd}tj�d|�W5d}~XYq$Xq$nV|D]P}zt|dd�Wq�tk
�r}zd}tj�d|j	�W5d}~XYq�Xq�|S)	a�Compile several source files.

    The files named in 'args' (or on the command line, if 'args' is
    not specified) are compiled and the resulting bytecode is cached
    in the normal manner.  This function does not search a directory
    structure to locate source files; it only compiles files named
    explicitly.  If '-' is the only parameter in args, the list of
    files is taken from standard input.

    Nrr�-r,T)rKz%s
)r=�argv�stdin�readline�rstriprrr>r?r�OSError)�args�rv�filename�errorrrrr�s.


"&&�__main__)NNFr)Nr)N)r�enumZimportlib._bootstrap_externalr/�importlib.machinery�importlib.utilr%Zos.pathr=r
�__all__r
r�Enumrr(rrr�exitrrrr�<module>s&0�
a
&__pycache__/xdrlib.cpython-38.opt-1.pyc000064400000020037151153537610013640 0ustar00U

e5d�@sxdZddlZddlmZddlmZddddgZGd	d�de�ZGd
d�de�Z	dd�Z
Gd
d�d�ZGdd�d�ZdS)zRImplements (a subset of) Sun XDR -- eXternal Data Representation.

See: RFC 1014

�N)�BytesIO��wraps�Error�Packer�Unpacker�ConversionErrorc@s(eZdZdZdd�Zdd�Zdd�ZdS)	rz�Exception class for this module. Use:

    except xdrlib.Error as var:
        # var has the Error instance for the exception

    Public ivars:
        msg -- contains the message

    cCs
||_dS�N)�msg)�selfr
�r�/usr/lib64/python3.8/xdrlib.py�__init__szError.__init__cCs
t|j�Sr	)�reprr
�rrrr
�__repr__szError.__repr__cCs
t|j�Sr	)�strr
rrrr
�__str__sz
Error.__str__N)�__name__�
__module__�__qualname__�__doc__rrrrrrr
rs	c@seZdZdS)rN)rrrrrrr
r scst���fdd��}|S)z5 Wrap any raised struct.errors in a ConversionError. c
sFz�||�WStjk
r@}zt|jd�d�W5d}~XYnXdS�Nr)�struct�errorr�args)r�value�e��functionrr
�result&sz&raise_conversion_error.<locals>.resultr)rr rrr
�raise_conversion_error#sr!c@s�eZdZdZdd�Zdd�Zdd�ZeZedd	��Z	ed
d��Z
e
Zdd
�Zdd�Z
e
Zedd��Zedd��Zdd�ZeZdd�ZeZeZdd�Zdd�Zdd�ZdS)rz0Pack various data representations into a buffer.cCs|��dSr	��resetrrrr
r2szPacker.__init__cCst�|_dSr	)r�_Packer__bufrrrr
r#5szPacker.resetcCs
|j��Sr	)r$�getvaluerrrr
�
get_buffer8szPacker.get_buffercCs|j�t�d|��dS)N�>L�r$�writerZpack�r�xrrr
�	pack_uint=szPacker.pack_uintcCs|j�t�d|��dS)N�>lr(r*rrr
�pack_intAszPacker.pack_intcCs"|r|j�d�n|j�d�dS)Nss)r$r)r*rrr
�	pack_boolGszPacker.pack_boolc
Cs�z|�|d?d@�Wn8ttjfk
rN}zt|jd�d�W5d}~XYnXz|�|d@�Wn8ttjfk
r�}zt|jd�d�W5d}~XYnXdS)N� l��r)r,�	TypeErrorrrrr)rr+rrrr
�pack_uhyperKs"zPacker.pack_uhypercCs|j�t�d|��dS)N�>fr(r*rrr
�
pack_floatWszPacker.pack_floatcCs|j�t�d|��dS)N�>dr(r*rrr
�pack_double[szPacker.pack_doublecCsP|dkrtd��|d|�}|ddd}||t|�d}|j�|�dS)Nr� fstring size must be nonnegative���)�
ValueError�lenr$r))r�n�s�datarrr
�pack_fstring_szPacker.pack_fstringcCs"t|�}|�|�|�||�dSr	)r<r,r@)rr>r=rrr
�pack_stringis
zPacker.pack_stringcCs*|D]}|�d�||�q|�d�dS)N�r)r,)r�list�	pack_item�itemrrr
�	pack_listqs

zPacker.pack_listcCs*t|�|krtd��|D]}||�qdS)Nzwrong array size)r<r;)rr=rCrDrErrr
�pack_farraywszPacker.pack_farraycCs$t|�}|�|�|�|||�dSr	)r<r,rG)rrCrDr=rrr
�
pack_array}s
zPacker.pack_arrayN)rrrrrr#r&Zget_bufr!r,r.Z	pack_enumr/r2Z
pack_hyperr4r6r@Zpack_fopaquerAZpack_opaqueZ
pack_bytesrFrGrHrrrr
r/s2




c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�ZeZdd�Z
dd�Zdd�Zdd�Zdd�Zdd�ZeZdd�ZeZeZd d!�Zd"d#�Zd$d%�Zd&S)'rz;Unpacks various data representations from the given buffer.cCs|�|�dSr	r"�rr?rrr
r�szUnpacker.__init__cCs||_d|_dSr)�_Unpacker__buf�_Unpacker__posrIrrr
r#�szUnpacker.resetcCs|jSr	�rKrrrr
�get_position�szUnpacker.get_positioncCs
||_dSr	rL)rZpositionrrr
�set_position�szUnpacker.set_positioncCs|jSr	)rJrrrr
r&�szUnpacker.get_buffercCs|jt|j�krtd��dS)Nzunextracted data remains)rKr<rJrrrrr
�done�sz
Unpacker.donecCsB|j}|d|_}|j||�}t|�dkr2t�t�d|�dS)Nr9r'r�rKrJr<�EOFErrorrZunpack�r�i�jr?rrr
�unpack_uint�szUnpacker.unpack_uintcCsB|j}|d|_}|j||�}t|�dkr2t�t�d|�dS)Nr9r-rrPrRrrr
�
unpack_int�szUnpacker.unpack_intcCst|���Sr	)�boolrVrrrr
�unpack_bool�szUnpacker.unpack_boolcCs |��}|��}t|�d>|BS)Nr0)rU�int)r�hi�lorrr
�
unpack_uhyper�szUnpacker.unpack_uhypercCs|��}|dkr|d}|S)Nll)r\r*rrr
�unpack_hyper�szUnpacker.unpack_hypercCsB|j}|d|_}|j||�}t|�dkr2t�t�d|�dS)Nr9r3rrPrRrrr
�unpack_float�szUnpacker.unpack_floatcCsB|j}|d|_}|j||�}t|�dkr2t�t�d|�dS)N�r5rrPrRrrr
�
unpack_double�szUnpacker.unpack_doublecCsT|dkrtd��|j}||ddd}|t|j�kr<t�||_|j|||�S)Nrr7r8r9)r;rKr<rJrQ)rr=rSrTrrr
�unpack_fstring�szUnpacker.unpack_fstringcCs|��}|�|�Sr	)rUra)rr=rrr
�
unpack_string�szUnpacker.unpack_stringcCsBg}|��}|dkrq>|dkr,td|f��|�}|�|�q|S)NrrBz0 or 1 expected, got %r)rUr�append)r�unpack_itemrCr+rErrr
�unpack_list�szUnpacker.unpack_listcCs"g}t|�D]}|�|��q|Sr	)�rangerc)rr=rdrCrSrrr
�
unpack_farray�szUnpacker.unpack_farraycCs|��}|�||�Sr	)rUrg)rrdr=rrr
�unpack_array�szUnpacker.unpack_arrayN)rrrrrr#rMrNr&rOrUrVZunpack_enumrXr\r]r^r`raZunpack_fopaquerbZ
unpack_opaqueZunpack_bytesrergrhrrrr
r�s.
)
rr�ior�	functoolsr�__all__�	Exceptionrrr!rrrrrr
�<module>sU__pycache__/struct.cpython-38.opt-2.pyc000064400000000514151153537610013677 0ustar00U

e5d�@s8ddddddddgZdd	lTdd
lmZddlmZdS)
ZcalcsizeZpackZ	pack_intoZunpackZunpack_fromZiter_unpackZStruct�error�)�*)�_clearcache)�__doc__N)�__all__Z_structrr�rr�/usr/lib64/python3.8/struct.py�<module>s�__pycache__/gettext.cpython-38.opt-1.pyc000064400000042735151153537610014051 0ustar00U

e5dj�@s�dZddlZddlZddlZddlZddddddd	d
ddd
ddddddddddgZej�ejdd�Z	e�
dejejB�Z
dd�Zdd�ZdZd d!�eed"�D�Zd#d$d%d&�ZdGd(d)�Zd*d+�Zd,d-�Zd.d/�ZGd0d�d�ZGd1d�de�ZdHd3d�ZiZd4gZdddd2efd5d�Zdedfd6d�Ziaiad7a dId8d	�Z!dJd9d
�Z"dKd:d�Z#d;d�Z$d<d�Z%d=d
�Z&d>d�Z'd?d�Z(d@d�Z)dAd�Z*dBd�Z+dCd�Z,dDd�Z-dEd�Z.dFd�Z/eZ0dS)La�Internationalization and localization support.

This module provides internationalization (I18N) and localization (L10N)
support for your Python programs by providing an interface to the GNU gettext
message catalog library.

I18N refers to the operation by which a program is made aware of multiple
languages.  L10N refers to the adaptation of your program, once
internationalized, to the local language and cultural habits.

�N�NullTranslations�GNUTranslations�Catalog�find�translation�install�
textdomain�bindtextdomain�bind_textdomain_codeset�dgettext�	dngettext�gettext�lgettext�	ldgettext�
ldngettext�	lngettext�ngettext�pgettext�	dpgettext�	npgettext�
dnpgettextZshare�localea�
        (?P<WHITESPACES>[ \t]+)                    | # spaces and horizontal tabs
        (?P<NUMBER>[0-9]+\b)                       | # decimal integer
        (?P<NAME>n\b)                              | # only n is allowed
        (?P<PARENTHESIS>[()])                      |
        (?P<OPERATOR>[-*/%+?:]|[><!]=?|==|&&|\|\|) | # !, *, /, %, +, -, <, >,
                                                     # <=, >=, ==, !=, &&, ||,
                                                     # ? :
                                                     # unary and bitwise ops
                                                     # not allowed
        (?P<INVALID>\w+|.)                           # invalid token
    ccsPt�t|�D]8}|j}|dkr q|�|�}|dkr>td|��|VqdVdS)NZWHITESPACESZINVALIDz invalid token in plural form: %s�)�re�finditer�_token_pattern�	lastgroup�group�
ValueError)�pluralZmoZkind�value�r!�/usr/lib64/python3.8/gettext.py�	_tokenizeWs
r#cCs|rtd|�Std�SdS)Nz#unexpected token in plural form: %szunexpected end of plural form)r)r r!r!r"�_errorbsr$))�||)�&&)z==z!=)�<�>z<=z>=)�+�-)�*�/�%cCs i|]\}}|D]
}||�qqSr!r!)�.0�iZops�opr!r!r"�
<dictcomp>ps
r1��or�andz//)r%r&r,���cCs�d}t|�}|dkr&|d7}t|�}q|dkrXt|�\}}d||f}|dkr�td��nP|dkrnd	||f}n:zt|d
�}Wntk
r�t|�d�YnXd||f}t|�}d}|tk�rt|}||krҐq|d
kr�|d
kr�d|}t�||�}t||d�\}	}d|||	f}|}q�||k�r4dk�r@nnd|}|dk�r�|dk�r�t|d�\}
}|dk�rtt|��t|�\}}d|
||f}|dk�r�d|}||fS)Nr�!znot �(z%s(%s)�)z%unbalanced parenthesis in plural form�nz%s%s�
z%s%d�d)��z(%s)r2z%s %s %sr=�?r�:z%s if %s else %s)�next�_parser�intr$�_binary_ops�	_c2py_ops�get)�tokensZpriority�result�nexttok�subr �jr/r0�rightZif_trueZif_falser!r!r"rAssP




rAcCsZzt|�}Wn(tk
r4td|jjf�d�YnXddl}|�d|jjftd�|S)Nz'Plural value must be an integer, got %srr=)�round�	TypeError�	__class__�__name__�warnings�warn�DeprecationWarning)r9r/rPr!r!r"�_as_int�s ����rScCs�t|�dkrtd��z|tt|��\}}|r2t|��d}|D]6}|dkr`|d7}|dkrptd��q:|dkr:|d8}q:d	ti}td
||�|dWStk
r�td��YnXdS)
z�Gets a C expression as used in PO files for plural forms and returns a
    Python function that implements an equivalent expression.
    i�z"plural form expression is too longrr7r2�z%plural form expression is too complexr8rSz�if True:
            def func(n):
                if not isinstance(n, int):
                    n = _as_int(n)
                return int(%s)
            �funcN)�lenrrAr#r$rS�exec�RecursionError)rrGrHZdepth�c�nsr!r!r"�c2py�s.

��
r[c
Cs4t�|�}d}d}d}d}|�d�}|dkrN||d�}|d|�}||O}nd}|�d�}|dkr�||d�}|d|�}||O}nd}|�d�}|dkr�||d�}|d|�}||O}nd}|}	g}
t|d�D]P}||@s�|	}||@r�||7}||@�r
||7}||@�r||7}|
�|�q�|
��|
S)	Nr2�r=r�@r�.�_)rZ	normalizer�range�append�reverse)
ZlocZCOMPONENT_CODESETZCOMPONENT_TERRITORYZCOMPONENT_MODIFIER�mask�posZmodifier�codesetZ	territoryZlanguageZretr/�valr!r!r"�_expand_lang�sJ









rgc@s�eZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zddd�ZdS) rNcCs.i|_d|_d|_d|_|dk	r*|�|�dS�N)�_info�_charset�_output_charset�	_fallbackrA��self�fpr!r!r"�__init__�szNullTranslations.__init__cCsdSrhr!rmr!r!r"rAszNullTranslations._parsecCs|jr|j�|�n||_dSrh)rl�add_fallback)rn�fallbackr!r!r"rq
szNullTranslations.add_fallbackcCs|jr|j�|�S|Srh)rlr
)rn�messager!r!r"r
szNullTranslations.gettextc
Csrddl}|�dtd�|jrR|���(|�ddt�|j�|�W5QR�SQRX|jrd|�|j�S|�t	�
��S)Nr�/lgettext() is deprecated, use gettext() insteadr\�ignore�.*\blgettext\b.*)rPrQrRrl�catch_warnings�filterwarningsrrk�encoder�getpreferredencoding)rnrsrPr!r!r"rs�
�zNullTranslations.lgettextcCs*|jr|j�|||�S|dkr"|S|SdS�Nr2)rlr)rn�msgid1�msgid2r9r!r!r"r"s
zNullTranslations.ngettextc
Cs�ddl}|�dtd�|jrV|���,|�ddt�|j�|||�W5QR�SQRX|dkrd|}n|}|jrz|�|j�S|�t	�
��S)Nr�1lngettext() is deprecated, use ngettext() insteadr\ru�.*\blngettext\b.*r2)rPrQrRrlrwrxrrkryrrz�rnr|r}r9rP�tmsgr!r!r"r*s"�
�"zNullTranslations.lngettextcCs|jr|j�||�S|Srh)rlr)rn�contextrsr!r!r"r;szNullTranslations.pgettextcCs,|jr|j�||||�S|dkr$|S|SdSr{)rlr)rnr�r|r}r9r!r!r"r@s
zNullTranslations.npgettextcCs|jSrh)ri�rnr!r!r"�infoHszNullTranslations.infocCs|jSrh)rjr�r!r!r"�charsetKszNullTranslations.charsetcCsddl}|�dtd�|jS)Nrzoutput_charset() is deprecatedr\�rPrQrRrk)rnrPr!r!r"�output_charsetNs�zNullTranslations.output_charsetcCs ddl}|�dtd�||_dS)Nrz"set_output_charset() is deprecatedr\r�)rnr�rPr!r!r"�set_output_charsetTs�z#NullTranslations.set_output_charsetcCsRddl}|j|jd<|dk	rNddddddh}|t|�@D]}t||�|j|<q8dS)	Nrr_r
rrrrr)�builtinsr
�__dict__�set�getattr)rn�namesr�Zallowed�namer!r!r"rZs�zNullTranslations.install)N)N)rO�
__module__�__qualname__rprArqr
rrrrrr�r�r�r�rr!r!r!r"r�s

c@s\eZdZdZdZdZdZdd�Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�ZdS)rl�*l�$<z%s%s)rr2cCs|d?|d@fS)z/Returns a tuple of major version, minor version�i��r!)rn�versionr!r!r"�
_get_versionspszGNUTranslations._get_versionsc"Cs�ddlm}t|dd�}i|_}dd�|_|��}t|�}|d|dd	��d}||jkr||d
|d	d��\}}	}
}d}n6||jkr�|d
|d	d��\}}	}
}d}nt	dd|��|�
|�\}
}|
|jkr�t	ddt|
�|��t
d|	�D�]}||||
|
d��\}}||}|||||d��\}}||}||k�r`||k�r`|||�}|||�}nt	dd|��|dk�rld}|�d�D]�}|����}|�s��q�|�d��r�|�d��r��q�d}}d|k�r|�dd�\}}|����}|��}||j|<|}n|�r|j|d|7<|dk�r8|�d�d|_n0|dk�r�|�d�}|d�d�d}t|�|_�q�|j�pvd}d|k�r�|�d�\}} |�d�}t||�}t|�D]\}}!t|!|�|||f<�q�nt||�|t||�<|
d7}
|d7}q�dS)z8Override this method to support alternative .mo formats.r)�unpackr�rcSst|dk�Sr{)rB)r9r!r!r"�<lambda>}�z(GNUTranslations._parse.<locals>.<lambda>z<INr=z<4IrTz<IIz>4Iz>IIzBad magic numberzBad version number �zFile is corrupt�
z	#-#-#-#-#r?r2�
zcontent-typezcharset=zplural-forms�;zplural=�ascii�)Zstructr�r��_catalogr�readrV�LE_MAGIC�BE_MAGIC�OSErrorr��VERSIONS�strr`�split�decode�strip�
startswith�endswith�lowerrirjr[�	enumerate)"rnror��filenameZcatalogZbufZbuflen�magicr�ZmsgcountZ	masteridxZtransidxZiiZ
major_versionZ
minor_versionr/ZmlenZmoffZmendZtlenZtoffZtend�msgr�ZlastkZb_item�item�k�vrr�r|r}�xr!r!r"rAtsv














zGNUTranslations._parsecCshddl}|�dtd�t�}|j�||�}||krH|jrD|j�|�S|}|jrZ|�	|j�S|�	t
���S)Nrrtr\)rPrQrR�objectr�rErlrrkryrrz)rnrsrP�missingr�r!r!r"r�s�zGNUTranslations.lgettextcCs�ddl}|�dtd�z|j||�|�f}Wn@tk
rn|jrX|j�|||�YS|dkrf|}n|}YnX|jr�|�	|j�S|�	t
���S)Nrr~r\r2)rPrQrRr�r�KeyErrorrlrrkryrrzr�r!r!r"r�s �
zGNUTranslations.lngettextcCs6t�}|j�||�}||kr2|jr.|j�|�S|S|Srh)r�r�rErlr
)rnrsr�r�r!r!r"r
�szGNUTranslations.gettextcCs^z|j||�|�f}Wn@tk
rX|jrB|j�|||�YS|dkrP|}n|}YnX|Sr{)r�rr�rlr)rnr|r}r9r�r!r!r"r�s
zGNUTranslations.ngettextcCsF|j||f}t�}|j�||�}||krB|jr>|j�||�S|S|Srh)�CONTEXTr�r�rErlr)rnr�rs�ctxt_msg_idr�r�r!r!r"rszGNUTranslations.pgettextc	Csn|j||f}z|j||�|�f}WnBtk
rh|jrR|j�||||�YS|dkr`|}n|}YnX|Sr{)r�r�rr�rlr)rnr�r|r}r9r�r�r!r!r"rs
zGNUTranslations.npgettextN)rOr�r�r�r�r�r�r�rArrr
rrrr!r!r!r"rdsY	
FcCs�|dkrt}|dkrRg}dD]"}tj�|�}|r|�d�}q@qd|krR|�d�g}|D]$}t|�D]}||krf|�|�qfqZ|r�g}	nd}	|D]J}|dkr�q�tj�||dd|�}
tj�	|
�r�|r�|	�|
�q�|
Sq�|	S)N)ZLANGUAGE�LC_ALL�LC_MESSAGESZLANGr?�Cr�z%s.mo)
�_default_localedir�os�environrEr�rarg�path�join�exists)�domain�	localedir�	languages�allZenvarrfZnelangsZlangZnelangrG�mofiler!r!r"rs8


Zunspecifiedc
Cs|dkrt}t|||dd�}|sB|r*t�Sddlm}t|d|��d}|D]�}	|tj�|	�f}
t	�
|
�}|dkr�t|	d��}t	�|
||��}W5QRXddl
}
|
�
|�}|tk	r�ddl}|�dtd�|r�|���|�d	d
t�|�|�W5QRX|dk�r|}qJ|�|�qJ|S)NT)r�r)�ENOENTz$No translation file found for domain�rbzparameter codeset is deprecatedr\ruz.*\bset_output_charset\b.*)rrr�errnor��FileNotFoundErrorr�r��abspath�
_translationsrE�open�
setdefault�copy�_unspecifiedrPrQrRrwrxr�rq)r�r�r�Zclass_rrreZmofilesr�rGr��key�tror�rPr!r!r"rCsH�

�
�
cCst||d|d�}|�|�dS)NT)rrre)rr)r�r�rer�r�r!r!r"rnsZmessagescCs|dk	r|atSrh)�_current_domain)r�r!r!r"r|scCs|dk	r|t|<t�|t�Srh)�_localedirsrEr�)r�r�r!r!r"r	�scCs0ddl}|�dtd�|dk	r&|t|<t�|�S)Nrz'bind_textdomain_codeset() is deprecatedr\)rPrQrR�_localecodesetsrE)r�rerPr!r!r"r
�s�cCs:zt|t�|d��}Wntk
r.|YSX|�|�Srh)rr�rEr�r
)r�rsr�r!r!r"r�s

c
Cs�ddl}|�dtd�t�|�}z<|���*|�ddt�t|t�|d�|d�}W5QRXWn&t	k
r�|�
|pzt���YSX|���&|�ddt�|�
|�W5QR�SQRXdS)Nrz1ldgettext() is deprecated, use dgettext() insteadr\ru�.*\bparameter codeset\b.*�rerv)rPrQrRr�rErwrxrr�r�ryrrzr)r�rsrPrer�r!r!r"r�s&�

�$
�cCsRzt|t�|d��}Wn,tk
rB|dkr6|YS|YSYnX|�|||�Sr{)rr�rEr�r)r�r|r}r9r�r!r!r"r�sc
Cs�ddl}|�dtd�t�|�}z<|���*|�ddt�t|t�|d�|d�}W5QRXWn8t	k
r�|dkrz|}n|}|�
|p�t���YSX|���*|�ddt�|�
|||�W5QR�SQRXdS)	Nrz3ldngettext() is deprecated, use dngettext() insteadr\rur�r�r2r)rPrQrRr�rErwrxrr�r�ryrrzr)r�r|r}r9rPrer�r�r!r!r"r�s,�

�$
�cCs<zt|t�|d��}Wntk
r.|YSX|�||�Srh)rr�rEr�r)r�r�rsr�r!r!r"r�s

cCsTzt|t�|d��}Wn,tk
rB|dkr6|YS|YSYnX|�||||�Sr{)rr�rEr�r)r�r�r|r}r9r�r!r!r"r�scCs
tt|�Srh)rr�)rsr!r!r"r
�sc
CsNddl}|�dtd�|���&|�ddt�tt|�W5QR�SQRXdS)Nrrtr\ruz.*\bldgettext\b.*)rPrQrRrwrxrr�)rsrPr!r!r"r�s�
�cCstt|||�Srh)rr�)r|r}r9r!r!r"r�sc
CsRddl}|�dtd�|���*|�ddt�tt|||�W5QR�SQRXdS)Nrr~r\ruz.*\bldngettext\b.*)rPrQrRrwrxrr�)r|r}r9rPr!r!r"r�s�
�cCstt||�Srh)rr�)r�rsr!r!r"r�scCstt||||�Srh)rr�)r�r|r}r9r!r!r"r�s)r5)NNF)N)N)N)1�__doc__rr�r�sys�__all__r�r��base_prefixr��compile�VERBOSE�DOTALLrr#r$rCr�rDrArSr[rgrrrr�r�rrr�r�r�rr	r
rrrrrrr
rrrrrrr!r!r!r"�<module>s�0�
�

1$*f7
&�
+




	
codeop.py000064400000014272151153537610006404 0ustar00r"""Utilities to compile possibly incomplete Python source code.

This module provides two interfaces, broadly similar to the builtin
function compile(), which take program text, a filename and a 'mode'
and:

- Return code object if the command is complete and valid
- Return None if the command is incomplete
- Raise SyntaxError, ValueError or OverflowError if the command is a
  syntax error (OverflowError and ValueError can be produced by
  malformed literals).

Approach:

First, check if the source consists entirely of blank lines and
comments; if so, replace it with 'pass', because the built-in
parser doesn't always do the right thing for these.

Compile three times: as is, with \n, and with \n\n appended.  If it
compiles as is, it's complete.  If it compiles with one \n appended,
we expect more.  If it doesn't compile either way, we compare the
error we get when compiling with \n or \n\n appended.  If the errors
are the same, the code is broken.  But if the errors are different, we
expect more.  Not intuitive; not even guaranteed to hold in future
releases; but this matches the compiler's behavior from Python 1.4
through 2.2, at least.

Caveat:

It is possible (but not likely) that the parser stops parsing with a
successful outcome before reaching the end of the source; in this
case, trailing symbols may be ignored instead of causing an error.
For example, a backslash followed by two newlines may be followed by
arbitrary garbage.  This will be fixed once the API for the parser is
better.

The two interfaces are:

compile_command(source, filename, symbol):

    Compiles a single command in the manner described above.

CommandCompiler():

    Instances of this class have __call__ methods identical in
    signature to compile_command; the difference is that if the
    instance compiles program text containing a __future__ statement,
    the instance 'remembers' and compiles all subsequent program texts
    with the statement in force.

The module also provides another class:

Compile():

    Instances of this class act like the built-in function compile,
    but with 'memory' in the sense described above.
"""

import __future__
import warnings

_features = [getattr(__future__, fname)
             for fname in __future__.all_feature_names]

__all__ = ["compile_command", "Compile", "CommandCompiler"]

PyCF_DONT_IMPLY_DEDENT = 0x200          # Matches pythonrun.h

def _maybe_compile(compiler, source, filename, symbol):
    # Check for source consisting of only blank lines and comments
    for line in source.split("\n"):
        line = line.strip()
        if line and line[0] != '#':
            break               # Leave it alone
    else:
        if symbol != "eval":
            source = "pass"     # Replace it with a 'pass' statement

    err = err1 = err2 = None
    code = code1 = code2 = None

    try:
        code = compiler(source, filename, symbol)
    except SyntaxError as err:
        pass

    # Catch syntax warnings after the first compile
    # to emit warnings (SyntaxWarning, DeprecationWarning) at most once.
    with warnings.catch_warnings():
        warnings.simplefilter("error")

        try:
            code1 = compiler(source + "\n", filename, symbol)
        except SyntaxError as e:
            err1 = e

        try:
            code2 = compiler(source + "\n\n", filename, symbol)
        except SyntaxError as e:
            err2 = e

    try:
        if code:
            return code
        if not code1 and repr(err1) == repr(err2):
            raise err1
    finally:
        err1 = err2 = None

def _compile(source, filename, symbol):
    return compile(source, filename, symbol, PyCF_DONT_IMPLY_DEDENT)

def compile_command(source, filename="<input>", symbol="single"):
    r"""Compile a command and determine whether it is incomplete.

    Arguments:

    source -- the source string; may contain \n characters
    filename -- optional filename from which source was read; default
                "<input>"
    symbol -- optional grammar start symbol; "single" (default), "exec"
              or "eval"

    Return value / exceptions raised:

    - Return a code object if the command is complete and valid
    - Return None if the command is incomplete
    - Raise SyntaxError, ValueError or OverflowError if the command is a
      syntax error (OverflowError and ValueError can be produced by
      malformed literals).
    """
    return _maybe_compile(_compile, source, filename, symbol)

class Compile:
    """Instances of this class behave much like the built-in compile
    function, but if one is used to compile text containing a future
    statement, it "remembers" and compiles all subsequent program texts
    with the statement in force."""
    def __init__(self):
        self.flags = PyCF_DONT_IMPLY_DEDENT

    def __call__(self, source, filename, symbol):
        codeob = compile(source, filename, symbol, self.flags, 1)
        for feature in _features:
            if codeob.co_flags & feature.compiler_flag:
                self.flags |= feature.compiler_flag
        return codeob

class CommandCompiler:
    """Instances of this class have __call__ methods identical in
    signature to compile_command; the difference is that if the
    instance compiles program text containing a __future__ statement,
    the instance 'remembers' and compiles all subsequent program texts
    with the statement in force."""

    def __init__(self,):
        self.compiler = Compile()

    def __call__(self, source, filename="<input>", symbol="single"):
        r"""Compile a command and determine whether it is incomplete.

        Arguments:

        source -- the source string; may contain \n characters
        filename -- optional filename from which source was read;
                    default "<input>"
        symbol -- optional grammar start symbol; "single" (default) or
                  "eval"

        Return value / exceptions raised:

        - Return a code object if the command is complete and valid
        - Return None if the command is incomplete
        - Raise SyntaxError, ValueError or OverflowError if the command is a
          syntax error (OverflowError and ValueError can be produced by
          malformed literals).
        """
        return _maybe_compile(self.compiler, source, filename, symbol)
ftplib.py000064400000104471151153537610006414 0ustar00"""An FTP client class and some helper functions.

Based on RFC 959: File Transfer Protocol (FTP), by J. Postel and J. Reynolds

Example:

>>> from ftplib import FTP
>>> ftp = FTP('ftp.python.org') # connect to host, default port
>>> ftp.login() # default, i.e.: user anonymous, passwd anonymous@
'230 Guest login ok, access restrictions apply.'
>>> ftp.retrlines('LIST') # list directory contents
total 9
drwxr-xr-x   8 root     wheel        1024 Jan  3  1994 .
drwxr-xr-x   8 root     wheel        1024 Jan  3  1994 ..
drwxr-xr-x   2 root     wheel        1024 Jan  3  1994 bin
drwxr-xr-x   2 root     wheel        1024 Jan  3  1994 etc
d-wxrwxr-x   2 ftp      wheel        1024 Sep  5 13:43 incoming
drwxr-xr-x   2 root     wheel        1024 Nov 17  1993 lib
drwxr-xr-x   6 1094     wheel        1024 Sep 13 19:07 pub
drwxr-xr-x   3 root     wheel        1024 Jan  3  1994 usr
-rw-r--r--   1 root     root          312 Aug  1  1994 welcome.msg
'226 Transfer complete.'
>>> ftp.quit()
'221 Goodbye.'
>>>

A nice test that reveals some of the network dialogue would be:
python ftplib.py -d localhost -l -p -l
"""

#
# Changes and improvements suggested by Steve Majewski.
# Modified by Jack to work on the mac.
# Modified by Siebren to support docstrings and PASV.
# Modified by Phil Schwartz to add storbinary and storlines callbacks.
# Modified by Giampaolo Rodola' to add TLS support.
#

import sys
import socket
from socket import _GLOBAL_DEFAULT_TIMEOUT

__all__ = ["FTP", "error_reply", "error_temp", "error_perm", "error_proto",
           "all_errors"]

# Magic number from <socket.h>
MSG_OOB = 0x1                           # Process data out of band


# The standard FTP server control port
FTP_PORT = 21
# The sizehint parameter passed to readline() calls
MAXLINE = 8192


# Exception raised when an error or invalid response is received
class Error(Exception): pass
class error_reply(Error): pass          # unexpected [123]xx reply
class error_temp(Error): pass           # 4xx errors
class error_perm(Error): pass           # 5xx errors
class error_proto(Error): pass          # response does not begin with [1-5]


# All exceptions (hopefully) that may be raised here and that aren't
# (always) programming errors on our side
all_errors = (Error, OSError, EOFError)


# Line terminators (we always output CRLF, but accept any of CRLF, CR, LF)
CRLF = '\r\n'
B_CRLF = b'\r\n'

# The class itself
class FTP:

    '''An FTP client class.

    To create a connection, call the class using these arguments:
            host, user, passwd, acct, timeout

    The first four arguments are all strings, and have default value ''.
    timeout must be numeric and defaults to None if not passed,
    meaning that no timeout will be set on any ftp socket(s)
    If a timeout is passed, then this is now the default timeout for all ftp
    socket operations for this instance.

    Then use self.connect() with optional host and port argument.

    To download a file, use ftp.retrlines('RETR ' + filename),
    or ftp.retrbinary() with slightly different arguments.
    To upload a file, use ftp.storlines() or ftp.storbinary(),
    which have an open file as argument (see their definitions
    below for details).
    The download/upload functions first issue appropriate TYPE
    and PORT or PASV commands.
    '''

    debugging = 0
    host = ''
    port = FTP_PORT
    maxline = MAXLINE
    sock = None
    file = None
    welcome = None
    passiveserver = 1
    encoding = "latin-1"
    # Disables https://bugs.python.org/issue43285 security if set to True.
    trust_server_pasv_ipv4_address = False

    # Initialization method (called by class instantiation).
    # Initialize host to localhost, port to standard ftp port
    # Optional arguments are host (for connect()),
    # and user, passwd, acct (for login())
    def __init__(self, host='', user='', passwd='', acct='',
                 timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=None):
        self.source_address = source_address
        self.timeout = timeout
        if host:
            self.connect(host)
            if user:
                self.login(user, passwd, acct)

    def __enter__(self):
        return self

    # Context management protocol: try to quit() if active
    def __exit__(self, *args):
        if self.sock is not None:
            try:
                self.quit()
            except (OSError, EOFError):
                pass
            finally:
                if self.sock is not None:
                    self.close()

    def connect(self, host='', port=0, timeout=-999, source_address=None):
        '''Connect to host.  Arguments are:
         - host: hostname to connect to (string, default previous host)
         - port: port to connect to (integer, default previous port)
         - timeout: the timeout to set against the ftp socket(s)
         - source_address: a 2-tuple (host, port) for the socket to bind
           to as its source address before connecting.
        '''
        if host != '':
            self.host = host
        if port > 0:
            self.port = port
        if timeout != -999:
            self.timeout = timeout
        if source_address is not None:
            self.source_address = source_address
        sys.audit("ftplib.connect", self, self.host, self.port)
        self.sock = socket.create_connection((self.host, self.port), self.timeout,
                                             source_address=self.source_address)
        self.af = self.sock.family
        self.file = self.sock.makefile('r', encoding=self.encoding)
        self.welcome = self.getresp()
        return self.welcome

    def getwelcome(self):
        '''Get the welcome message from the server.
        (this is read and squirreled away by connect())'''
        if self.debugging:
            print('*welcome*', self.sanitize(self.welcome))
        return self.welcome

    def set_debuglevel(self, level):
        '''Set the debugging level.
        The required argument level means:
        0: no debugging output (default)
        1: print commands and responses but not body text etc.
        2: also print raw lines read and sent before stripping CR/LF'''
        self.debugging = level
    debug = set_debuglevel

    def set_pasv(self, val):
        '''Use passive or active mode for data transfers.
        With a false argument, use the normal PORT mode,
        With a true argument, use the PASV command.'''
        self.passiveserver = val

    # Internal: "sanitize" a string for printing
    def sanitize(self, s):
        if s[:5] in {'pass ', 'PASS '}:
            i = len(s.rstrip('\r\n'))
            s = s[:5] + '*'*(i-5) + s[i:]
        return repr(s)

    # Internal: send one line to the server, appending CRLF
    def putline(self, line):
        if '\r' in line or '\n' in line:
            raise ValueError('an illegal newline character should not be contained')
        sys.audit("ftplib.sendcmd", self, line)
        line = line + CRLF
        if self.debugging > 1:
            print('*put*', self.sanitize(line))
        self.sock.sendall(line.encode(self.encoding))

    # Internal: send one command to the server (through putline())
    def putcmd(self, line):
        if self.debugging: print('*cmd*', self.sanitize(line))
        self.putline(line)

    # Internal: return one line from the server, stripping CRLF.
    # Raise EOFError if the connection is closed
    def getline(self):
        line = self.file.readline(self.maxline + 1)
        if len(line) > self.maxline:
            raise Error("got more than %d bytes" % self.maxline)
        if self.debugging > 1:
            print('*get*', self.sanitize(line))
        if not line:
            raise EOFError
        if line[-2:] == CRLF:
            line = line[:-2]
        elif line[-1:] in CRLF:
            line = line[:-1]
        return line

    # Internal: get a response from the server, which may possibly
    # consist of multiple lines.  Return a single string with no
    # trailing CRLF.  If the response consists of multiple lines,
    # these are separated by '\n' characters in the string
    def getmultiline(self):
        line = self.getline()
        if line[3:4] == '-':
            code = line[:3]
            while 1:
                nextline = self.getline()
                line = line + ('\n' + nextline)
                if nextline[:3] == code and \
                        nextline[3:4] != '-':
                    break
        return line

    # Internal: get a response from the server.
    # Raise various errors if the response indicates an error
    def getresp(self):
        resp = self.getmultiline()
        if self.debugging:
            print('*resp*', self.sanitize(resp))
        self.lastresp = resp[:3]
        c = resp[:1]
        if c in {'1', '2', '3'}:
            return resp
        if c == '4':
            raise error_temp(resp)
        if c == '5':
            raise error_perm(resp)
        raise error_proto(resp)

    def voidresp(self):
        """Expect a response beginning with '2'."""
        resp = self.getresp()
        if resp[:1] != '2':
            raise error_reply(resp)
        return resp

    def abort(self):
        '''Abort a file transfer.  Uses out-of-band data.
        This does not follow the procedure from the RFC to send Telnet
        IP and Synch; that doesn't seem to work with the servers I've
        tried.  Instead, just send the ABOR command as OOB data.'''
        line = b'ABOR' + B_CRLF
        if self.debugging > 1:
            print('*put urgent*', self.sanitize(line))
        self.sock.sendall(line, MSG_OOB)
        resp = self.getmultiline()
        if resp[:3] not in {'426', '225', '226'}:
            raise error_proto(resp)
        return resp

    def sendcmd(self, cmd):
        '''Send a command and return the response.'''
        self.putcmd(cmd)
        return self.getresp()

    def voidcmd(self, cmd):
        """Send a command and expect a response beginning with '2'."""
        self.putcmd(cmd)
        return self.voidresp()

    def sendport(self, host, port):
        '''Send a PORT command with the current host and the given
        port number.
        '''
        hbytes = host.split('.')
        pbytes = [repr(port//256), repr(port%256)]
        bytes = hbytes + pbytes
        cmd = 'PORT ' + ','.join(bytes)
        return self.voidcmd(cmd)

    def sendeprt(self, host, port):
        '''Send an EPRT command with the current host and the given port number.'''
        af = 0
        if self.af == socket.AF_INET:
            af = 1
        if self.af == socket.AF_INET6:
            af = 2
        if af == 0:
            raise error_proto('unsupported address family')
        fields = ['', repr(af), host, repr(port), '']
        cmd = 'EPRT ' + '|'.join(fields)
        return self.voidcmd(cmd)

    def makeport(self):
        '''Create a new socket and send a PORT command for it.'''
        sock = socket.create_server(("", 0), family=self.af, backlog=1)
        port = sock.getsockname()[1] # Get proper port
        host = self.sock.getsockname()[0] # Get proper host
        if self.af == socket.AF_INET:
            resp = self.sendport(host, port)
        else:
            resp = self.sendeprt(host, port)
        if self.timeout is not _GLOBAL_DEFAULT_TIMEOUT:
            sock.settimeout(self.timeout)
        return sock

    def makepasv(self):
        """Internal: Does the PASV or EPSV handshake -> (address, port)"""
        if self.af == socket.AF_INET:
            untrusted_host, port = parse227(self.sendcmd('PASV'))
            if self.trust_server_pasv_ipv4_address:
                host = untrusted_host
            else:
                host = self.sock.getpeername()[0]
        else:
            host, port = parse229(self.sendcmd('EPSV'), self.sock.getpeername())
        return host, port

    def ntransfercmd(self, cmd, rest=None):
        """Initiate a transfer over the data connection.

        If the transfer is active, send a port command and the
        transfer command, and accept the connection.  If the server is
        passive, send a pasv command, connect to it, and start the
        transfer command.  Either way, return the socket for the
        connection and the expected size of the transfer.  The
        expected size may be None if it could not be determined.

        Optional `rest' argument can be a string that is sent as the
        argument to a REST command.  This is essentially a server
        marker used to tell the server to skip over any data up to the
        given marker.
        """
        size = None
        if self.passiveserver:
            host, port = self.makepasv()
            conn = socket.create_connection((host, port), self.timeout,
                                            source_address=self.source_address)
            try:
                if rest is not None:
                    self.sendcmd("REST %s" % rest)
                resp = self.sendcmd(cmd)
                # Some servers apparently send a 200 reply to
                # a LIST or STOR command, before the 150 reply
                # (and way before the 226 reply). This seems to
                # be in violation of the protocol (which only allows
                # 1xx or error messages for LIST), so we just discard
                # this response.
                if resp[0] == '2':
                    resp = self.getresp()
                if resp[0] != '1':
                    raise error_reply(resp)
            except:
                conn.close()
                raise
        else:
            with self.makeport() as sock:
                if rest is not None:
                    self.sendcmd("REST %s" % rest)
                resp = self.sendcmd(cmd)
                # See above.
                if resp[0] == '2':
                    resp = self.getresp()
                if resp[0] != '1':
                    raise error_reply(resp)
                conn, sockaddr = sock.accept()
                if self.timeout is not _GLOBAL_DEFAULT_TIMEOUT:
                    conn.settimeout(self.timeout)
        if resp[:3] == '150':
            # this is conditional in case we received a 125
            size = parse150(resp)
        return conn, size

    def transfercmd(self, cmd, rest=None):
        """Like ntransfercmd() but returns only the socket."""
        return self.ntransfercmd(cmd, rest)[0]

    def login(self, user = '', passwd = '', acct = ''):
        '''Login, default anonymous.'''
        if not user:
            user = 'anonymous'
        if not passwd:
            passwd = ''
        if not acct:
            acct = ''
        if user == 'anonymous' and passwd in {'', '-'}:
            # If there is no anonymous ftp password specified
            # then we'll just use anonymous@
            # We don't send any other thing because:
            # - We want to remain anonymous
            # - We want to stop SPAM
            # - We don't want to let ftp sites to discriminate by the user,
            #   host or country.
            passwd = passwd + 'anonymous@'
        resp = self.sendcmd('USER ' + user)
        if resp[0] == '3':
            resp = self.sendcmd('PASS ' + passwd)
        if resp[0] == '3':
            resp = self.sendcmd('ACCT ' + acct)
        if resp[0] != '2':
            raise error_reply(resp)
        return resp

    def retrbinary(self, cmd, callback, blocksize=8192, rest=None):
        """Retrieve data in binary mode.  A new port is created for you.

        Args:
          cmd: A RETR command.
          callback: A single parameter callable to be called on each
                    block of data read.
          blocksize: The maximum number of bytes to read from the
                     socket at one time.  [default: 8192]
          rest: Passed to transfercmd().  [default: None]

        Returns:
          The response code.
        """
        self.voidcmd('TYPE I')
        with self.transfercmd(cmd, rest) as conn:
            while 1:
                data = conn.recv(blocksize)
                if not data:
                    break
                callback(data)
            # shutdown ssl layer
            if _SSLSocket is not None and isinstance(conn, _SSLSocket):
                conn.unwrap()
        return self.voidresp()

    def retrlines(self, cmd, callback = None):
        """Retrieve data in line mode.  A new port is created for you.

        Args:
          cmd: A RETR, LIST, or NLST command.
          callback: An optional single parameter callable that is called
                    for each line with the trailing CRLF stripped.
                    [default: print_line()]

        Returns:
          The response code.
        """
        if callback is None:
            callback = print_line
        resp = self.sendcmd('TYPE A')
        with self.transfercmd(cmd) as conn, \
                 conn.makefile('r', encoding=self.encoding) as fp:
            while 1:
                line = fp.readline(self.maxline + 1)
                if len(line) > self.maxline:
                    raise Error("got more than %d bytes" % self.maxline)
                if self.debugging > 2:
                    print('*retr*', repr(line))
                if not line:
                    break
                if line[-2:] == CRLF:
                    line = line[:-2]
                elif line[-1:] == '\n':
                    line = line[:-1]
                callback(line)
            # shutdown ssl layer
            if _SSLSocket is not None and isinstance(conn, _SSLSocket):
                conn.unwrap()
        return self.voidresp()

    def storbinary(self, cmd, fp, blocksize=8192, callback=None, rest=None):
        """Store a file in binary mode.  A new port is created for you.

        Args:
          cmd: A STOR command.
          fp: A file-like object with a read(num_bytes) method.
          blocksize: The maximum data size to read from fp and send over
                     the connection at once.  [default: 8192]
          callback: An optional single parameter callable that is called on
                    each block of data after it is sent.  [default: None]
          rest: Passed to transfercmd().  [default: None]

        Returns:
          The response code.
        """
        self.voidcmd('TYPE I')
        with self.transfercmd(cmd, rest) as conn:
            while 1:
                buf = fp.read(blocksize)
                if not buf:
                    break
                conn.sendall(buf)
                if callback:
                    callback(buf)
            # shutdown ssl layer
            if _SSLSocket is not None and isinstance(conn, _SSLSocket):
                conn.unwrap()
        return self.voidresp()

    def storlines(self, cmd, fp, callback=None):
        """Store a file in line mode.  A new port is created for you.

        Args:
          cmd: A STOR command.
          fp: A file-like object with a readline() method.
          callback: An optional single parameter callable that is called on
                    each line after it is sent.  [default: None]

        Returns:
          The response code.
        """
        self.voidcmd('TYPE A')
        with self.transfercmd(cmd) as conn:
            while 1:
                buf = fp.readline(self.maxline + 1)
                if len(buf) > self.maxline:
                    raise Error("got more than %d bytes" % self.maxline)
                if not buf:
                    break
                if buf[-2:] != B_CRLF:
                    if buf[-1] in B_CRLF: buf = buf[:-1]
                    buf = buf + B_CRLF
                conn.sendall(buf)
                if callback:
                    callback(buf)
            # shutdown ssl layer
            if _SSLSocket is not None and isinstance(conn, _SSLSocket):
                conn.unwrap()
        return self.voidresp()

    def acct(self, password):
        '''Send new account name.'''
        cmd = 'ACCT ' + password
        return self.voidcmd(cmd)

    def nlst(self, *args):
        '''Return a list of files in a given directory (default the current).'''
        cmd = 'NLST'
        for arg in args:
            cmd = cmd + (' ' + arg)
        files = []
        self.retrlines(cmd, files.append)
        return files

    def dir(self, *args):
        '''List a directory in long form.
        By default list current directory to stdout.
        Optional last argument is callback function; all
        non-empty arguments before it are concatenated to the
        LIST command.  (This *should* only be used for a pathname.)'''
        cmd = 'LIST'
        func = None
        if args[-1:] and type(args[-1]) != type(''):
            args, func = args[:-1], args[-1]
        for arg in args:
            if arg:
                cmd = cmd + (' ' + arg)
        self.retrlines(cmd, func)

    def mlsd(self, path="", facts=[]):
        '''List a directory in a standardized format by using MLSD
        command (RFC-3659). If path is omitted the current directory
        is assumed. "facts" is a list of strings representing the type
        of information desired (e.g. ["type", "size", "perm"]).

        Return a generator object yielding a tuple of two elements
        for every file found in path.
        First element is the file name, the second one is a dictionary
        including a variable number of "facts" depending on the server
        and whether "facts" argument has been provided.
        '''
        if facts:
            self.sendcmd("OPTS MLST " + ";".join(facts) + ";")
        if path:
            cmd = "MLSD %s" % path
        else:
            cmd = "MLSD"
        lines = []
        self.retrlines(cmd, lines.append)
        for line in lines:
            facts_found, _, name = line.rstrip(CRLF).partition(' ')
            entry = {}
            for fact in facts_found[:-1].split(";"):
                key, _, value = fact.partition("=")
                entry[key.lower()] = value
            yield (name, entry)

    def rename(self, fromname, toname):
        '''Rename a file.'''
        resp = self.sendcmd('RNFR ' + fromname)
        if resp[0] != '3':
            raise error_reply(resp)
        return self.voidcmd('RNTO ' + toname)

    def delete(self, filename):
        '''Delete a file.'''
        resp = self.sendcmd('DELE ' + filename)
        if resp[:3] in {'250', '200'}:
            return resp
        else:
            raise error_reply(resp)

    def cwd(self, dirname):
        '''Change to a directory.'''
        if dirname == '..':
            try:
                return self.voidcmd('CDUP')
            except error_perm as msg:
                if msg.args[0][:3] != '500':
                    raise
        elif dirname == '':
            dirname = '.'  # does nothing, but could return error
        cmd = 'CWD ' + dirname
        return self.voidcmd(cmd)

    def size(self, filename):
        '''Retrieve the size of a file.'''
        # The SIZE command is defined in RFC-3659
        resp = self.sendcmd('SIZE ' + filename)
        if resp[:3] == '213':
            s = resp[3:].strip()
            return int(s)

    def mkd(self, dirname):
        '''Make a directory, return its full pathname.'''
        resp = self.voidcmd('MKD ' + dirname)
        # fix around non-compliant implementations such as IIS shipped
        # with Windows server 2003
        if not resp.startswith('257'):
            return ''
        return parse257(resp)

    def rmd(self, dirname):
        '''Remove a directory.'''
        return self.voidcmd('RMD ' + dirname)

    def pwd(self):
        '''Return current working directory.'''
        resp = self.voidcmd('PWD')
        # fix around non-compliant implementations such as IIS shipped
        # with Windows server 2003
        if not resp.startswith('257'):
            return ''
        return parse257(resp)

    def quit(self):
        '''Quit, and close the connection.'''
        resp = self.voidcmd('QUIT')
        self.close()
        return resp

    def close(self):
        '''Close the connection without assuming anything about it.'''
        try:
            file = self.file
            self.file = None
            if file is not None:
                file.close()
        finally:
            sock = self.sock
            self.sock = None
            if sock is not None:
                sock.close()

try:
    import ssl
except ImportError:
    _SSLSocket = None
else:
    _SSLSocket = ssl.SSLSocket

    class FTP_TLS(FTP):
        '''A FTP subclass which adds TLS support to FTP as described
        in RFC-4217.

        Connect as usual to port 21 implicitly securing the FTP control
        connection before authenticating.

        Securing the data connection requires user to explicitly ask
        for it by calling prot_p() method.

        Usage example:
        >>> from ftplib import FTP_TLS
        >>> ftps = FTP_TLS('ftp.python.org')
        >>> ftps.login()  # login anonymously previously securing control channel
        '230 Guest login ok, access restrictions apply.'
        >>> ftps.prot_p()  # switch to secure data connection
        '200 Protection level set to P'
        >>> ftps.retrlines('LIST')  # list directory content securely
        total 9
        drwxr-xr-x   8 root     wheel        1024 Jan  3  1994 .
        drwxr-xr-x   8 root     wheel        1024 Jan  3  1994 ..
        drwxr-xr-x   2 root     wheel        1024 Jan  3  1994 bin
        drwxr-xr-x   2 root     wheel        1024 Jan  3  1994 etc
        d-wxrwxr-x   2 ftp      wheel        1024 Sep  5 13:43 incoming
        drwxr-xr-x   2 root     wheel        1024 Nov 17  1993 lib
        drwxr-xr-x   6 1094     wheel        1024 Sep 13 19:07 pub
        drwxr-xr-x   3 root     wheel        1024 Jan  3  1994 usr
        -rw-r--r--   1 root     root          312 Aug  1  1994 welcome.msg
        '226 Transfer complete.'
        >>> ftps.quit()
        '221 Goodbye.'
        >>>
        '''
        ssl_version = ssl.PROTOCOL_TLS_CLIENT

        def __init__(self, host='', user='', passwd='', acct='', keyfile=None,
                     certfile=None, context=None,
                     timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=None):
            if context is not None and keyfile is not None:
                raise ValueError("context and keyfile arguments are mutually "
                                 "exclusive")
            if context is not None and certfile is not None:
                raise ValueError("context and certfile arguments are mutually "
                                 "exclusive")
            if keyfile is not None or certfile is not None:
                import warnings
                warnings.warn("keyfile and certfile are deprecated, use a "
                              "custom context instead", DeprecationWarning, 2)
            self.keyfile = keyfile
            self.certfile = certfile
            if context is None:
                context = ssl._create_stdlib_context(self.ssl_version,
                                                     certfile=certfile,
                                                     keyfile=keyfile)
            self.context = context
            self._prot_p = False
            FTP.__init__(self, host, user, passwd, acct, timeout, source_address)

        def login(self, user='', passwd='', acct='', secure=True):
            if secure and not isinstance(self.sock, ssl.SSLSocket):
                self.auth()
            return FTP.login(self, user, passwd, acct)

        def auth(self):
            '''Set up secure control connection by using TLS/SSL.'''
            if isinstance(self.sock, ssl.SSLSocket):
                raise ValueError("Already using TLS")
            if self.ssl_version >= ssl.PROTOCOL_TLS:
                resp = self.voidcmd('AUTH TLS')
            else:
                resp = self.voidcmd('AUTH SSL')
            self.sock = self.context.wrap_socket(self.sock,
                                                 server_hostname=self.host)
            self.file = self.sock.makefile(mode='r', encoding=self.encoding)
            return resp

        def ccc(self):
            '''Switch back to a clear-text control connection.'''
            if not isinstance(self.sock, ssl.SSLSocket):
                raise ValueError("not using TLS")
            resp = self.voidcmd('CCC')
            self.sock = self.sock.unwrap()
            return resp

        def prot_p(self):
            '''Set up secure data connection.'''
            # PROT defines whether or not the data channel is to be protected.
            # Though RFC-2228 defines four possible protection levels,
            # RFC-4217 only recommends two, Clear and Private.
            # Clear (PROT C) means that no security is to be used on the
            # data-channel, Private (PROT P) means that the data-channel
            # should be protected by TLS.
            # PBSZ command MUST still be issued, but must have a parameter of
            # '0' to indicate that no buffering is taking place and the data
            # connection should not be encapsulated.
            self.voidcmd('PBSZ 0')
            resp = self.voidcmd('PROT P')
            self._prot_p = True
            return resp

        def prot_c(self):
            '''Set up clear text data connection.'''
            resp = self.voidcmd('PROT C')
            self._prot_p = False
            return resp

        # --- Overridden FTP methods

        def ntransfercmd(self, cmd, rest=None):
            conn, size = FTP.ntransfercmd(self, cmd, rest)
            if self._prot_p:
                conn = self.context.wrap_socket(conn,
                                                server_hostname=self.host)
            return conn, size

        def abort(self):
            # overridden as we can't pass MSG_OOB flag to sendall()
            line = b'ABOR' + B_CRLF
            self.sock.sendall(line)
            resp = self.getmultiline()
            if resp[:3] not in {'426', '225', '226'}:
                raise error_proto(resp)
            return resp

    __all__.append('FTP_TLS')
    all_errors = (Error, OSError, EOFError, ssl.SSLError)


_150_re = None

def parse150(resp):
    '''Parse the '150' response for a RETR request.
    Returns the expected transfer size or None; size is not guaranteed to
    be present in the 150 message.
    '''
    if resp[:3] != '150':
        raise error_reply(resp)
    global _150_re
    if _150_re is None:
        import re
        _150_re = re.compile(
            r"150 .* \((\d+) bytes\)", re.IGNORECASE | re.ASCII)
    m = _150_re.match(resp)
    if not m:
        return None
    return int(m.group(1))


_227_re = None

def parse227(resp):
    '''Parse the '227' response for a PASV request.
    Raises error_proto if it does not contain '(h1,h2,h3,h4,p1,p2)'
    Return ('host.addr.as.numbers', port#) tuple.'''

    if resp[:3] != '227':
        raise error_reply(resp)
    global _227_re
    if _227_re is None:
        import re
        _227_re = re.compile(r'(\d+),(\d+),(\d+),(\d+),(\d+),(\d+)', re.ASCII)
    m = _227_re.search(resp)
    if not m:
        raise error_proto(resp)
    numbers = m.groups()
    host = '.'.join(numbers[:4])
    port = (int(numbers[4]) << 8) + int(numbers[5])
    return host, port


def parse229(resp, peer):
    '''Parse the '229' response for an EPSV request.
    Raises error_proto if it does not contain '(|||port|)'
    Return ('host.addr.as.numbers', port#) tuple.'''

    if resp[:3] != '229':
        raise error_reply(resp)
    left = resp.find('(')
    if left < 0: raise error_proto(resp)
    right = resp.find(')', left + 1)
    if right < 0:
        raise error_proto(resp) # should contain '(|||port|)'
    if resp[left + 1] != resp[right - 1]:
        raise error_proto(resp)
    parts = resp[left + 1:right].split(resp[left+1])
    if len(parts) != 5:
        raise error_proto(resp)
    host = peer[0]
    port = int(parts[3])
    return host, port


def parse257(resp):
    '''Parse the '257' response for a MKD or PWD request.
    This is a response to a MKD or PWD request: a directory name.
    Returns the directoryname in the 257 reply.'''

    if resp[:3] != '257':
        raise error_reply(resp)
    if resp[3:5] != ' "':
        return '' # Not compliant to RFC 959, but UNIX ftpd does this
    dirname = ''
    i = 5
    n = len(resp)
    while i < n:
        c = resp[i]
        i = i+1
        if c == '"':
            if i >= n or resp[i] != '"':
                break
            i = i+1
        dirname = dirname + c
    return dirname


def print_line(line):
    '''Default retrlines callback to print a line.'''
    print(line)


def ftpcp(source, sourcename, target, targetname = '', type = 'I'):
    '''Copy file from one FTP-instance to another.'''
    if not targetname:
        targetname = sourcename
    type = 'TYPE ' + type
    source.voidcmd(type)
    target.voidcmd(type)
    sourcehost, sourceport = parse227(source.sendcmd('PASV'))
    target.sendport(sourcehost, sourceport)
    # RFC 959: the user must "listen" [...] BEFORE sending the
    # transfer request.
    # So: STOR before RETR, because here the target is a "user".
    treply = target.sendcmd('STOR ' + targetname)
    if treply[:3] not in {'125', '150'}:
        raise error_proto  # RFC 959
    sreply = source.sendcmd('RETR ' + sourcename)
    if sreply[:3] not in {'125', '150'}:
        raise error_proto  # RFC 959
    source.voidresp()
    target.voidresp()


def test():
    '''Test program.
    Usage: ftp [-d] [-r[file]] host [-l[dir]] [-d[dir]] [-p] [file] ...

    -d dir
    -l list
    -p password
    '''

    if len(sys.argv) < 2:
        print(test.__doc__)
        sys.exit(0)

    import netrc

    debugging = 0
    rcfile = None
    while sys.argv[1] == '-d':
        debugging = debugging+1
        del sys.argv[1]
    if sys.argv[1][:2] == '-r':
        # get name of alternate ~/.netrc file:
        rcfile = sys.argv[1][2:]
        del sys.argv[1]
    host = sys.argv[1]
    ftp = FTP(host)
    ftp.set_debuglevel(debugging)
    userid = passwd = acct = ''
    try:
        netrcobj = netrc.netrc(rcfile)
    except OSError:
        if rcfile is not None:
            sys.stderr.write("Could not open account file"
                             " -- using anonymous login.")
    else:
        try:
            userid, acct, passwd = netrcobj.authenticators(host)
        except KeyError:
            # no account for host
            sys.stderr.write(
                    "No account -- using anonymous login.")
    ftp.login(userid, passwd, acct)
    for file in sys.argv[2:]:
        if file[:2] == '-l':
            ftp.dir(file[2:])
        elif file[:2] == '-d':
            cmd = 'CWD'
            if file[2:]: cmd = cmd + ' ' + file[2:]
            resp = ftp.sendcmd(cmd)
        elif file == '-p':
            ftp.set_pasv(not ftp.passiveserver)
        else:
            ftp.retrbinary('RETR ' + file, \
                           sys.stdout.write, 1024)
    ftp.quit()


if __name__ == '__main__':
    test()
_markupbase.py000064400000034406151153537610007425 0ustar00"""Shared support for scanning document type declarations in HTML and XHTML.

This module is used as a foundation for the html.parser module.  It has no
documented public API and should not be used directly.

"""

import re

_declname_match = re.compile(r'[a-zA-Z][-_.a-zA-Z0-9]*\s*').match
_declstringlit_match = re.compile(r'(\'[^\']*\'|"[^"]*")\s*').match
_commentclose = re.compile(r'--\s*>')
_markedsectionclose = re.compile(r']\s*]\s*>')

# An analysis of the MS-Word extensions is available at
# http://www.planetpublish.com/xmlarena/xap/Thursday/WordtoXML.pdf

_msmarkedsectionclose = re.compile(r']\s*>')

del re


class ParserBase:
    """Parser base class which provides some common support methods used
    by the SGML/HTML and XHTML parsers."""

    def __init__(self):
        if self.__class__ is ParserBase:
            raise RuntimeError(
                "_markupbase.ParserBase must be subclassed")

    def error(self, message):
        raise NotImplementedError(
            "subclasses of ParserBase must override error()")

    def reset(self):
        self.lineno = 1
        self.offset = 0

    def getpos(self):
        """Return current line number and offset."""
        return self.lineno, self.offset

    # Internal -- update line number and offset.  This should be
    # called for each piece of data exactly once, in order -- in other
    # words the concatenation of all the input strings to this
    # function should be exactly the entire input.
    def updatepos(self, i, j):
        if i >= j:
            return j
        rawdata = self.rawdata
        nlines = rawdata.count("\n", i, j)
        if nlines:
            self.lineno = self.lineno + nlines
            pos = rawdata.rindex("\n", i, j) # Should not fail
            self.offset = j-(pos+1)
        else:
            self.offset = self.offset + j-i
        return j

    _decl_otherchars = ''

    # Internal -- parse declaration (for use by subclasses).
    def parse_declaration(self, i):
        # This is some sort of declaration; in "HTML as
        # deployed," this should only be the document type
        # declaration ("<!DOCTYPE html...>").
        # ISO 8879:1986, however, has more complex
        # declaration syntax for elements in <!...>, including:
        # --comment--
        # [marked section]
        # name in the following list: ENTITY, DOCTYPE, ELEMENT,
        # ATTLIST, NOTATION, SHORTREF, USEMAP,
        # LINKTYPE, LINK, IDLINK, USELINK, SYSTEM
        rawdata = self.rawdata
        j = i + 2
        assert rawdata[i:j] == "<!", "unexpected call to parse_declaration"
        if rawdata[j:j+1] == ">":
            # the empty comment <!>
            return j + 1
        if rawdata[j:j+1] in ("-", ""):
            # Start of comment followed by buffer boundary,
            # or just a buffer boundary.
            return -1
        # A simple, practical version could look like: ((name|stringlit) S*) + '>'
        n = len(rawdata)
        if rawdata[j:j+2] == '--': #comment
            # Locate --.*-- as the body of the comment
            return self.parse_comment(i)
        elif rawdata[j] == '[': #marked section
            # Locate [statusWord [...arbitrary SGML...]] as the body of the marked section
            # Where statusWord is one of TEMP, CDATA, IGNORE, INCLUDE, RCDATA
            # Note that this is extended by Microsoft Office "Save as Web" function
            # to include [if...] and [endif].
            return self.parse_marked_section(i)
        else: #all other declaration elements
            decltype, j = self._scan_name(j, i)
        if j < 0:
            return j
        if decltype == "doctype":
            self._decl_otherchars = ''
        while j < n:
            c = rawdata[j]
            if c == ">":
                # end of declaration syntax
                data = rawdata[i+2:j]
                if decltype == "doctype":
                    self.handle_decl(data)
                else:
                    # According to the HTML5 specs sections "8.2.4.44 Bogus
                    # comment state" and "8.2.4.45 Markup declaration open
                    # state", a comment token should be emitted.
                    # Calling unknown_decl provides more flexibility though.
                    self.unknown_decl(data)
                return j + 1
            if c in "\"'":
                m = _declstringlit_match(rawdata, j)
                if not m:
                    return -1 # incomplete
                j = m.end()
            elif c in "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ":
                name, j = self._scan_name(j, i)
            elif c in self._decl_otherchars:
                j = j + 1
            elif c == "[":
                # this could be handled in a separate doctype parser
                if decltype == "doctype":
                    j = self._parse_doctype_subset(j + 1, i)
                elif decltype in {"attlist", "linktype", "link", "element"}:
                    # must tolerate []'d groups in a content model in an element declaration
                    # also in data attribute specifications of attlist declaration
                    # also link type declaration subsets in linktype declarations
                    # also link attribute specification lists in link declarations
                    self.error("unsupported '[' char in %s declaration" % decltype)
                else:
                    self.error("unexpected '[' char in declaration")
            else:
                self.error(
                    "unexpected %r char in declaration" % rawdata[j])
            if j < 0:
                return j
        return -1 # incomplete

    # Internal -- parse a marked section
    # Override this to handle MS-word extension syntax <![if word]>content<![endif]>
    def parse_marked_section(self, i, report=1):
        rawdata= self.rawdata
        assert rawdata[i:i+3] == '<![', "unexpected call to parse_marked_section()"
        sectName, j = self._scan_name( i+3, i )
        if j < 0:
            return j
        if sectName in {"temp", "cdata", "ignore", "include", "rcdata"}:
            # look for standard ]]> ending
            match= _markedsectionclose.search(rawdata, i+3)
        elif sectName in {"if", "else", "endif"}:
            # look for MS Office ]> ending
            match= _msmarkedsectionclose.search(rawdata, i+3)
        else:
            self.error('unknown status keyword %r in marked section' % rawdata[i+3:j])
        if not match:
            return -1
        if report:
            j = match.start(0)
            self.unknown_decl(rawdata[i+3: j])
        return match.end(0)

    # Internal -- parse comment, return length or -1 if not terminated
    def parse_comment(self, i, report=1):
        rawdata = self.rawdata
        if rawdata[i:i+4] != '<!--':
            self.error('unexpected call to parse_comment()')
        match = _commentclose.search(rawdata, i+4)
        if not match:
            return -1
        if report:
            j = match.start(0)
            self.handle_comment(rawdata[i+4: j])
        return match.end(0)

    # Internal -- scan past the internal subset in a <!DOCTYPE declaration,
    # returning the index just past any whitespace following the trailing ']'.
    def _parse_doctype_subset(self, i, declstartpos):
        rawdata = self.rawdata
        n = len(rawdata)
        j = i
        while j < n:
            c = rawdata[j]
            if c == "<":
                s = rawdata[j:j+2]
                if s == "<":
                    # end of buffer; incomplete
                    return -1
                if s != "<!":
                    self.updatepos(declstartpos, j + 1)
                    self.error("unexpected char in internal subset (in %r)" % s)
                if (j + 2) == n:
                    # end of buffer; incomplete
                    return -1
                if (j + 4) > n:
                    # end of buffer; incomplete
                    return -1
                if rawdata[j:j+4] == "<!--":
                    j = self.parse_comment(j, report=0)
                    if j < 0:
                        return j
                    continue
                name, j = self._scan_name(j + 2, declstartpos)
                if j == -1:
                    return -1
                if name not in {"attlist", "element", "entity", "notation"}:
                    self.updatepos(declstartpos, j + 2)
                    self.error(
                        "unknown declaration %r in internal subset" % name)
                # handle the individual names
                meth = getattr(self, "_parse_doctype_" + name)
                j = meth(j, declstartpos)
                if j < 0:
                    return j
            elif c == "%":
                # parameter entity reference
                if (j + 1) == n:
                    # end of buffer; incomplete
                    return -1
                s, j = self._scan_name(j + 1, declstartpos)
                if j < 0:
                    return j
                if rawdata[j] == ";":
                    j = j + 1
            elif c == "]":
                j = j + 1
                while j < n and rawdata[j].isspace():
                    j = j + 1
                if j < n:
                    if rawdata[j] == ">":
                        return j
                    self.updatepos(declstartpos, j)
                    self.error("unexpected char after internal subset")
                else:
                    return -1
            elif c.isspace():
                j = j + 1
            else:
                self.updatepos(declstartpos, j)
                self.error("unexpected char %r in internal subset" % c)
        # end of buffer reached
        return -1

    # Internal -- scan past <!ELEMENT declarations
    def _parse_doctype_element(self, i, declstartpos):
        name, j = self._scan_name(i, declstartpos)
        if j == -1:
            return -1
        # style content model; just skip until '>'
        rawdata = self.rawdata
        if '>' in rawdata[j:]:
            return rawdata.find(">", j) + 1
        return -1

    # Internal -- scan past <!ATTLIST declarations
    def _parse_doctype_attlist(self, i, declstartpos):
        rawdata = self.rawdata
        name, j = self._scan_name(i, declstartpos)
        c = rawdata[j:j+1]
        if c == "":
            return -1
        if c == ">":
            return j + 1
        while 1:
            # scan a series of attribute descriptions; simplified:
            #   name type [value] [#constraint]
            name, j = self._scan_name(j, declstartpos)
            if j < 0:
                return j
            c = rawdata[j:j+1]
            if c == "":
                return -1
            if c == "(":
                # an enumerated type; look for ')'
                if ")" in rawdata[j:]:
                    j = rawdata.find(")", j) + 1
                else:
                    return -1
                while rawdata[j:j+1].isspace():
                    j = j + 1
                if not rawdata[j:]:
                    # end of buffer, incomplete
                    return -1
            else:
                name, j = self._scan_name(j, declstartpos)
            c = rawdata[j:j+1]
            if not c:
                return -1
            if c in "'\"":
                m = _declstringlit_match(rawdata, j)
                if m:
                    j = m.end()
                else:
                    return -1
                c = rawdata[j:j+1]
                if not c:
                    return -1
            if c == "#":
                if rawdata[j:] == "#":
                    # end of buffer
                    return -1
                name, j = self._scan_name(j + 1, declstartpos)
                if j < 0:
                    return j
                c = rawdata[j:j+1]
                if not c:
                    return -1
            if c == '>':
                # all done
                return j + 1

    # Internal -- scan past <!NOTATION declarations
    def _parse_doctype_notation(self, i, declstartpos):
        name, j = self._scan_name(i, declstartpos)
        if j < 0:
            return j
        rawdata = self.rawdata
        while 1:
            c = rawdata[j:j+1]
            if not c:
                # end of buffer; incomplete
                return -1
            if c == '>':
                return j + 1
            if c in "'\"":
                m = _declstringlit_match(rawdata, j)
                if not m:
                    return -1
                j = m.end()
            else:
                name, j = self._scan_name(j, declstartpos)
                if j < 0:
                    return j

    # Internal -- scan past <!ENTITY declarations
    def _parse_doctype_entity(self, i, declstartpos):
        rawdata = self.rawdata
        if rawdata[i:i+1] == "%":
            j = i + 1
            while 1:
                c = rawdata[j:j+1]
                if not c:
                    return -1
                if c.isspace():
                    j = j + 1
                else:
                    break
        else:
            j = i
        name, j = self._scan_name(j, declstartpos)
        if j < 0:
            return j
        while 1:
            c = self.rawdata[j:j+1]
            if not c:
                return -1
            if c in "'\"":
                m = _declstringlit_match(rawdata, j)
                if m:
                    j = m.end()
                else:
                    return -1    # incomplete
            elif c == ">":
                return j + 1
            else:
                name, j = self._scan_name(j, declstartpos)
                if j < 0:
                    return j

    # Internal -- scan a name token and the new position and the token, or
    # return -1 if we've reached the end of the buffer.
    def _scan_name(self, i, declstartpos):
        rawdata = self.rawdata
        n = len(rawdata)
        if i == n:
            return None, -1
        m = _declname_match(rawdata, i)
        if m:
            s = m.group()
            name = s.strip()
            if (i + len(s)) == n:
                return None, -1  # end of buffer
            return name.lower(), m.end()
        else:
            self.updatepos(declstartpos, i)
            self.error("expected name token at %r"
                       % rawdata[declstartpos:declstartpos+20])

    # To be overridden -- handlers for unknown objects
    def unknown_decl(self, data):
        pass
random.py000064400000070202151153537610006406 0ustar00"""Random variable generators.

    integers
    --------
           uniform within range

    sequences
    ---------
           pick random element
           pick random sample
           pick weighted random sample
           generate random permutation

    distributions on the real line:
    ------------------------------
           uniform
           triangular
           normal (Gaussian)
           lognormal
           negative exponential
           gamma
           beta
           pareto
           Weibull

    distributions on the circle (angles 0 to 2pi)
    ---------------------------------------------
           circular uniform
           von Mises

General notes on the underlying Mersenne Twister core generator:

* The period is 2**19937-1.
* It is one of the most extensively tested generators in existence.
* The random() method is implemented in C, executes in a single Python step,
  and is, therefore, threadsafe.

"""

from warnings import warn as _warn
from math import log as _log, exp as _exp, pi as _pi, e as _e, ceil as _ceil
from math import sqrt as _sqrt, acos as _acos, cos as _cos, sin as _sin
from os import urandom as _urandom
from _collections_abc import Set as _Set, Sequence as _Sequence
from itertools import accumulate as _accumulate, repeat as _repeat
from bisect import bisect as _bisect
import os as _os

try:
    # hashlib is pretty heavy to load, try lean internal module first
    from _sha512 import sha512 as _sha512
except ImportError:
    # fallback to official implementation
    from hashlib import sha512 as _sha512


__all__ = ["Random","seed","random","uniform","randint","choice","sample",
           "randrange","shuffle","normalvariate","lognormvariate",
           "expovariate","vonmisesvariate","gammavariate","triangular",
           "gauss","betavariate","paretovariate","weibullvariate",
           "getstate","setstate", "getrandbits", "choices",
           "SystemRandom"]

NV_MAGICCONST = 4 * _exp(-0.5)/_sqrt(2.0)
TWOPI = 2.0*_pi
LOG4 = _log(4.0)
SG_MAGICCONST = 1.0 + _log(4.5)
BPF = 53        # Number of bits in a float
RECIP_BPF = 2**-BPF


# Translated by Guido van Rossum from C source provided by
# Adrian Baddeley.  Adapted by Raymond Hettinger for use with
# the Mersenne Twister  and os.urandom() core generators.

import _random

class Random(_random.Random):
    """Random number generator base class used by bound module functions.

    Used to instantiate instances of Random to get generators that don't
    share state.

    Class Random can also be subclassed if you want to use a different basic
    generator of your own devising: in that case, override the following
    methods:  random(), seed(), getstate(), and setstate().
    Optionally, implement a getrandbits() method so that randrange()
    can cover arbitrarily large ranges.

    """

    VERSION = 3     # used by getstate/setstate

    def __init__(self, x=None):
        """Initialize an instance.

        Optional argument x controls seeding, as for Random.seed().
        """

        self.seed(x)
        self.gauss_next = None

    def __init_subclass__(cls, /, **kwargs):
        """Control how subclasses generate random integers.

        The algorithm a subclass can use depends on the random() and/or
        getrandbits() implementation available to it and determines
        whether it can generate random integers from arbitrarily large
        ranges.
        """

        for c in cls.__mro__:
            if '_randbelow' in c.__dict__:
                # just inherit it
                break
            if 'getrandbits' in c.__dict__:
                cls._randbelow = cls._randbelow_with_getrandbits
                break
            if 'random' in c.__dict__:
                cls._randbelow = cls._randbelow_without_getrandbits
                break

    def seed(self, a=None, version=2):
        """Initialize internal state from hashable object.

        None or no argument seeds from current time or from an operating
        system specific randomness source if available.

        If *a* is an int, all bits are used.

        For version 2 (the default), all of the bits are used if *a* is a str,
        bytes, or bytearray.  For version 1 (provided for reproducing random
        sequences from older versions of Python), the algorithm for str and
        bytes generates a narrower range of seeds.

        """

        if version == 1 and isinstance(a, (str, bytes)):
            a = a.decode('latin-1') if isinstance(a, bytes) else a
            x = ord(a[0]) << 7 if a else 0
            for c in map(ord, a):
                x = ((1000003 * x) ^ c) & 0xFFFFFFFFFFFFFFFF
            x ^= len(a)
            a = -2 if x == -1 else x

        if version == 2 and isinstance(a, (str, bytes, bytearray)):
            if isinstance(a, str):
                a = a.encode()
            a += _sha512(a).digest()
            a = int.from_bytes(a, 'big')

        super().seed(a)
        self.gauss_next = None

    def getstate(self):
        """Return internal state; can be passed to setstate() later."""
        return self.VERSION, super().getstate(), self.gauss_next

    def setstate(self, state):
        """Restore internal state from object returned by getstate()."""
        version = state[0]
        if version == 3:
            version, internalstate, self.gauss_next = state
            super().setstate(internalstate)
        elif version == 2:
            version, internalstate, self.gauss_next = state
            # In version 2, the state was saved as signed ints, which causes
            #   inconsistencies between 32/64-bit systems. The state is
            #   really unsigned 32-bit ints, so we convert negative ints from
            #   version 2 to positive longs for version 3.
            try:
                internalstate = tuple(x % (2**32) for x in internalstate)
            except ValueError as e:
                raise TypeError from e
            super().setstate(internalstate)
        else:
            raise ValueError("state with version %s passed to "
                             "Random.setstate() of version %s" %
                             (version, self.VERSION))

## ---- Methods below this point do not need to be overridden when
## ---- subclassing for the purpose of using a different core generator.

## -------------------- pickle support  -------------------

    # Issue 17489: Since __reduce__ was defined to fix #759889 this is no
    # longer called; we leave it here because it has been here since random was
    # rewritten back in 2001 and why risk breaking something.
    def __getstate__(self): # for pickle
        return self.getstate()

    def __setstate__(self, state):  # for pickle
        self.setstate(state)

    def __reduce__(self):
        return self.__class__, (), self.getstate()

## -------------------- integer methods  -------------------

    def randrange(self, start, stop=None, step=1, _int=int):
        """Choose a random item from range(start, stop[, step]).

        This fixes the problem with randint() which includes the
        endpoint; in Python this is usually not what you want.

        """

        # This code is a bit messy to make it fast for the
        # common case while still doing adequate error checking.
        istart = _int(start)
        if istart != start:
            raise ValueError("non-integer arg 1 for randrange()")
        if stop is None:
            if istart > 0:
                return self._randbelow(istart)
            raise ValueError("empty range for randrange()")

        # stop argument supplied.
        istop = _int(stop)
        if istop != stop:
            raise ValueError("non-integer stop for randrange()")
        width = istop - istart
        if step == 1 and width > 0:
            return istart + self._randbelow(width)
        if step == 1:
            raise ValueError("empty range for randrange() (%d, %d, %d)" % (istart, istop, width))

        # Non-unit step argument supplied.
        istep = _int(step)
        if istep != step:
            raise ValueError("non-integer step for randrange()")
        if istep > 0:
            n = (width + istep - 1) // istep
        elif istep < 0:
            n = (width + istep + 1) // istep
        else:
            raise ValueError("zero step for randrange()")

        if n <= 0:
            raise ValueError("empty range for randrange()")

        return istart + istep*self._randbelow(n)

    def randint(self, a, b):
        """Return random integer in range [a, b], including both end points.
        """

        return self.randrange(a, b+1)

    def _randbelow_with_getrandbits(self, n):
        "Return a random int in the range [0,n).  Raises ValueError if n==0."

        getrandbits = self.getrandbits
        k = n.bit_length()  # don't use (n-1) here because n can be 1
        r = getrandbits(k)          # 0 <= r < 2**k
        while r >= n:
            r = getrandbits(k)
        return r

    def _randbelow_without_getrandbits(self, n, int=int, maxsize=1<<BPF):
        """Return a random int in the range [0,n).  Raises ValueError if n==0.

        The implementation does not use getrandbits, but only random.
        """

        random = self.random
        if n >= maxsize:
            _warn("Underlying random() generator does not supply \n"
                "enough bits to choose from a population range this large.\n"
                "To remove the range limitation, add a getrandbits() method.")
            return int(random() * n)
        if n == 0:
            raise ValueError("Boundary cannot be zero")
        rem = maxsize % n
        limit = (maxsize - rem) / maxsize   # int(limit * maxsize) % n == 0
        r = random()
        while r >= limit:
            r = random()
        return int(r*maxsize) % n

    _randbelow = _randbelow_with_getrandbits

## -------------------- sequence methods  -------------------

    def choice(self, seq):
        """Choose a random element from a non-empty sequence."""
        try:
            i = self._randbelow(len(seq))
        except ValueError:
            raise IndexError('Cannot choose from an empty sequence') from None
        return seq[i]

    def shuffle(self, x, random=None):
        """Shuffle list x in place, and return None.

        Optional argument random is a 0-argument function returning a
        random float in [0.0, 1.0); if it is the default None, the
        standard random.random will be used.

        """

        if random is None:
            randbelow = self._randbelow
            for i in reversed(range(1, len(x))):
                # pick an element in x[:i+1] with which to exchange x[i]
                j = randbelow(i+1)
                x[i], x[j] = x[j], x[i]
        else:
            _int = int
            for i in reversed(range(1, len(x))):
                # pick an element in x[:i+1] with which to exchange x[i]
                j = _int(random() * (i+1))
                x[i], x[j] = x[j], x[i]

    def sample(self, population, k):
        """Chooses k unique random elements from a population sequence or set.

        Returns a new list containing elements from the population while
        leaving the original population unchanged.  The resulting list is
        in selection order so that all sub-slices will also be valid random
        samples.  This allows raffle winners (the sample) to be partitioned
        into grand prize and second place winners (the subslices).

        Members of the population need not be hashable or unique.  If the
        population contains repeats, then each occurrence is a possible
        selection in the sample.

        To choose a sample in a range of integers, use range as an argument.
        This is especially fast and space efficient for sampling from a
        large population:   sample(range(10000000), 60)
        """

        # Sampling without replacement entails tracking either potential
        # selections (the pool) in a list or previous selections in a set.

        # When the number of selections is small compared to the
        # population, then tracking selections is efficient, requiring
        # only a small set and an occasional reselection.  For
        # a larger number of selections, the pool tracking method is
        # preferred since the list takes less space than the
        # set and it doesn't suffer from frequent reselections.

        # The number of calls to _randbelow() is kept at or near k, the
        # theoretical minimum.  This is important because running time
        # is dominated by _randbelow() and because it extracts the
        # least entropy from the underlying random number generators.

        # Memory requirements are kept to the smaller of a k-length
        # set or an n-length list.

        # There are other sampling algorithms that do not require
        # auxiliary memory, but they were rejected because they made
        # too many calls to _randbelow(), making them slower and
        # causing them to eat more entropy than necessary.

        if isinstance(population, _Set):
            population = tuple(population)
        if not isinstance(population, _Sequence):
            raise TypeError("Population must be a sequence or set.  For dicts, use list(d).")
        randbelow = self._randbelow
        n = len(population)
        if not 0 <= k <= n:
            raise ValueError("Sample larger than population or is negative")
        result = [None] * k
        setsize = 21        # size of a small set minus size of an empty list
        if k > 5:
            setsize += 4 ** _ceil(_log(k * 3, 4)) # table size for big sets
        if n <= setsize:
            # An n-length list is smaller than a k-length set
            pool = list(population)
            for i in range(k):         # invariant:  non-selected at [0,n-i)
                j = randbelow(n-i)
                result[i] = pool[j]
                pool[j] = pool[n-i-1]   # move non-selected item into vacancy
        else:
            selected = set()
            selected_add = selected.add
            for i in range(k):
                j = randbelow(n)
                while j in selected:
                    j = randbelow(n)
                selected_add(j)
                result[i] = population[j]
        return result

    def choices(self, population, weights=None, *, cum_weights=None, k=1):
        """Return a k sized list of population elements chosen with replacement.

        If the relative weights or cumulative weights are not specified,
        the selections are made with equal probability.

        """
        random = self.random
        n = len(population)
        if cum_weights is None:
            if weights is None:
                _int = int
                n += 0.0    # convert to float for a small speed improvement
                return [population[_int(random() * n)] for i in _repeat(None, k)]
            cum_weights = list(_accumulate(weights))
        elif weights is not None:
            raise TypeError('Cannot specify both weights and cumulative weights')
        if len(cum_weights) != n:
            raise ValueError('The number of weights does not match the population')
        bisect = _bisect
        total = cum_weights[-1] + 0.0   # convert to float
        hi = n - 1
        return [population[bisect(cum_weights, random() * total, 0, hi)]
                for i in _repeat(None, k)]

## -------------------- real-valued distributions  -------------------

## -------------------- uniform distribution -------------------

    def uniform(self, a, b):
        "Get a random number in the range [a, b) or [a, b] depending on rounding."
        return a + (b-a) * self.random()

## -------------------- triangular --------------------

    def triangular(self, low=0.0, high=1.0, mode=None):
        """Triangular distribution.

        Continuous distribution bounded by given lower and upper limits,
        and having a given mode value in-between.

        http://en.wikipedia.org/wiki/Triangular_distribution

        """
        u = self.random()
        try:
            c = 0.5 if mode is None else (mode - low) / (high - low)
        except ZeroDivisionError:
            return low
        if u > c:
            u = 1.0 - u
            c = 1.0 - c
            low, high = high, low
        return low + (high - low) * _sqrt(u * c)

## -------------------- normal distribution --------------------

    def normalvariate(self, mu, sigma):
        """Normal distribution.

        mu is the mean, and sigma is the standard deviation.

        """
        # mu = mean, sigma = standard deviation

        # Uses Kinderman and Monahan method. Reference: Kinderman,
        # A.J. and Monahan, J.F., "Computer generation of random
        # variables using the ratio of uniform deviates", ACM Trans
        # Math Software, 3, (1977), pp257-260.

        random = self.random
        while 1:
            u1 = random()
            u2 = 1.0 - random()
            z = NV_MAGICCONST*(u1-0.5)/u2
            zz = z*z/4.0
            if zz <= -_log(u2):
                break
        return mu + z*sigma

## -------------------- lognormal distribution --------------------

    def lognormvariate(self, mu, sigma):
        """Log normal distribution.

        If you take the natural logarithm of this distribution, you'll get a
        normal distribution with mean mu and standard deviation sigma.
        mu can have any value, and sigma must be greater than zero.

        """
        return _exp(self.normalvariate(mu, sigma))

## -------------------- exponential distribution --------------------

    def expovariate(self, lambd):
        """Exponential distribution.

        lambd is 1.0 divided by the desired mean.  It should be
        nonzero.  (The parameter would be called "lambda", but that is
        a reserved word in Python.)  Returned values range from 0 to
        positive infinity if lambd is positive, and from negative
        infinity to 0 if lambd is negative.

        """
        # lambd: rate lambd = 1/mean
        # ('lambda' is a Python reserved word)

        # we use 1-random() instead of random() to preclude the
        # possibility of taking the log of zero.
        return -_log(1.0 - self.random())/lambd

## -------------------- von Mises distribution --------------------

    def vonmisesvariate(self, mu, kappa):
        """Circular data distribution.

        mu is the mean angle, expressed in radians between 0 and 2*pi, and
        kappa is the concentration parameter, which must be greater than or
        equal to zero.  If kappa is equal to zero, this distribution reduces
        to a uniform random angle over the range 0 to 2*pi.

        """
        # mu:    mean angle (in radians between 0 and 2*pi)
        # kappa: concentration parameter kappa (>= 0)
        # if kappa = 0 generate uniform random angle

        # Based upon an algorithm published in: Fisher, N.I.,
        # "Statistical Analysis of Circular Data", Cambridge
        # University Press, 1993.

        # Thanks to Magnus Kessler for a correction to the
        # implementation of step 4.

        random = self.random
        if kappa <= 1e-6:
            return TWOPI * random()

        s = 0.5 / kappa
        r = s + _sqrt(1.0 + s * s)

        while 1:
            u1 = random()
            z = _cos(_pi * u1)

            d = z / (r + z)
            u2 = random()
            if u2 < 1.0 - d * d or u2 <= (1.0 - d) * _exp(d):
                break

        q = 1.0 / r
        f = (q + z) / (1.0 + q * z)
        u3 = random()
        if u3 > 0.5:
            theta = (mu + _acos(f)) % TWOPI
        else:
            theta = (mu - _acos(f)) % TWOPI

        return theta

## -------------------- gamma distribution --------------------

    def gammavariate(self, alpha, beta):
        """Gamma distribution.  Not the gamma function!

        Conditions on the parameters are alpha > 0 and beta > 0.

        The probability distribution function is:

                    x ** (alpha - 1) * math.exp(-x / beta)
          pdf(x) =  --------------------------------------
                      math.gamma(alpha) * beta ** alpha

        """

        # alpha > 0, beta > 0, mean is alpha*beta, variance is alpha*beta**2

        # Warning: a few older sources define the gamma distribution in terms
        # of alpha > -1.0
        if alpha <= 0.0 or beta <= 0.0:
            raise ValueError('gammavariate: alpha and beta must be > 0.0')

        random = self.random
        if alpha > 1.0:

            # Uses R.C.H. Cheng, "The generation of Gamma
            # variables with non-integral shape parameters",
            # Applied Statistics, (1977), 26, No. 1, p71-74

            ainv = _sqrt(2.0 * alpha - 1.0)
            bbb = alpha - LOG4
            ccc = alpha + ainv

            while 1:
                u1 = random()
                if not 1e-7 < u1 < .9999999:
                    continue
                u2 = 1.0 - random()
                v = _log(u1/(1.0-u1))/ainv
                x = alpha*_exp(v)
                z = u1*u1*u2
                r = bbb+ccc*v-x
                if r + SG_MAGICCONST - 4.5*z >= 0.0 or r >= _log(z):
                    return x * beta

        elif alpha == 1.0:
            # expovariate(1/beta)
            return -_log(1.0 - random()) * beta

        else:   # alpha is between 0 and 1 (exclusive)

            # Uses ALGORITHM GS of Statistical Computing - Kennedy & Gentle

            while 1:
                u = random()
                b = (_e + alpha)/_e
                p = b*u
                if p <= 1.0:
                    x = p ** (1.0/alpha)
                else:
                    x = -_log((b-p)/alpha)
                u1 = random()
                if p > 1.0:
                    if u1 <= x ** (alpha - 1.0):
                        break
                elif u1 <= _exp(-x):
                    break
            return x * beta

## -------------------- Gauss (faster alternative) --------------------

    def gauss(self, mu, sigma):
        """Gaussian distribution.

        mu is the mean, and sigma is the standard deviation.  This is
        slightly faster than the normalvariate() function.

        Not thread-safe without a lock around calls.

        """

        # When x and y are two variables from [0, 1), uniformly
        # distributed, then
        #
        #    cos(2*pi*x)*sqrt(-2*log(1-y))
        #    sin(2*pi*x)*sqrt(-2*log(1-y))
        #
        # are two *independent* variables with normal distribution
        # (mu = 0, sigma = 1).
        # (Lambert Meertens)
        # (corrected version; bug discovered by Mike Miller, fixed by LM)

        # Multithreading note: When two threads call this function
        # simultaneously, it is possible that they will receive the
        # same return value.  The window is very small though.  To
        # avoid this, you have to use a lock around all calls.  (I
        # didn't want to slow this down in the serial case by using a
        # lock here.)

        random = self.random
        z = self.gauss_next
        self.gauss_next = None
        if z is None:
            x2pi = random() * TWOPI
            g2rad = _sqrt(-2.0 * _log(1.0 - random()))
            z = _cos(x2pi) * g2rad
            self.gauss_next = _sin(x2pi) * g2rad

        return mu + z*sigma

## -------------------- beta --------------------
## See
## http://mail.python.org/pipermail/python-bugs-list/2001-January/003752.html
## for Ivan Frohne's insightful analysis of why the original implementation:
##
##    def betavariate(self, alpha, beta):
##        # Discrete Event Simulation in C, pp 87-88.
##
##        y = self.expovariate(alpha)
##        z = self.expovariate(1.0/beta)
##        return z/(y+z)
##
## was dead wrong, and how it probably got that way.

    def betavariate(self, alpha, beta):
        """Beta distribution.

        Conditions on the parameters are alpha > 0 and beta > 0.
        Returned values range between 0 and 1.

        """

        # This version due to Janne Sinkkonen, and matches all the std
        # texts (e.g., Knuth Vol 2 Ed 3 pg 134 "the beta distribution").
        y = self.gammavariate(alpha, 1.0)
        if y == 0:
            return 0.0
        else:
            return y / (y + self.gammavariate(beta, 1.0))

## -------------------- Pareto --------------------

    def paretovariate(self, alpha):
        """Pareto distribution.  alpha is the shape parameter."""
        # Jain, pg. 495

        u = 1.0 - self.random()
        return 1.0 / u ** (1.0/alpha)

## -------------------- Weibull --------------------

    def weibullvariate(self, alpha, beta):
        """Weibull distribution.

        alpha is the scale parameter and beta is the shape parameter.

        """
        # Jain, pg. 499; bug fix courtesy Bill Arms

        u = 1.0 - self.random()
        return alpha * (-_log(u)) ** (1.0/beta)

## --------------- Operating System Random Source  ------------------

class SystemRandom(Random):
    """Alternate random number generator using sources provided
    by the operating system (such as /dev/urandom on Unix or
    CryptGenRandom on Windows).

     Not available on all systems (see os.urandom() for details).
    """

    def random(self):
        """Get the next random number in the range [0.0, 1.0)."""
        return (int.from_bytes(_urandom(7), 'big') >> 3) * RECIP_BPF

    def getrandbits(self, k):
        """getrandbits(k) -> x.  Generates an int with k random bits."""
        if k <= 0:
            raise ValueError('number of bits must be greater than zero')
        numbytes = (k + 7) // 8                       # bits / 8 and rounded up
        x = int.from_bytes(_urandom(numbytes), 'big')
        return x >> (numbytes * 8 - k)                # trim excess bits

    def seed(self, *args, **kwds):
        "Stub method.  Not used for a system random number generator."
        return None

    def _notimplemented(self, *args, **kwds):
        "Method should not be called for a system random number generator."
        raise NotImplementedError('System entropy source does not have state.')
    getstate = setstate = _notimplemented

## -------------------- test program --------------------

def _test_generator(n, func, args):
    import time
    print(n, 'times', func.__name__)
    total = 0.0
    sqsum = 0.0
    smallest = 1e10
    largest = -1e10
    t0 = time.perf_counter()
    for i in range(n):
        x = func(*args)
        total += x
        sqsum = sqsum + x*x
        smallest = min(x, smallest)
        largest = max(x, largest)
    t1 = time.perf_counter()
    print(round(t1-t0, 3), 'sec,', end=' ')
    avg = total/n
    stddev = _sqrt(sqsum/n - avg*avg)
    print('avg %g, stddev %g, min %g, max %g\n' % \
              (avg, stddev, smallest, largest))


def _test(N=2000):
    _test_generator(N, random, ())
    _test_generator(N, normalvariate, (0.0, 1.0))
    _test_generator(N, lognormvariate, (0.0, 1.0))
    _test_generator(N, vonmisesvariate, (0.0, 1.0))
    _test_generator(N, gammavariate, (0.01, 1.0))
    _test_generator(N, gammavariate, (0.1, 1.0))
    _test_generator(N, gammavariate, (0.1, 2.0))
    _test_generator(N, gammavariate, (0.5, 1.0))
    _test_generator(N, gammavariate, (0.9, 1.0))
    _test_generator(N, gammavariate, (1.0, 1.0))
    _test_generator(N, gammavariate, (2.0, 1.0))
    _test_generator(N, gammavariate, (20.0, 1.0))
    _test_generator(N, gammavariate, (200.0, 1.0))
    _test_generator(N, gauss, (0.0, 1.0))
    _test_generator(N, betavariate, (3.0, 3.0))
    _test_generator(N, triangular, (0.0, 1.0, 1.0/3.0))

# Create one instance, seeded from current time, and export its methods
# as module-level functions.  The functions share state across all uses
#(both in the user's code and in the Python libraries), but that's fine
# for most programs and is easier for the casual user than making them
# instantiate their own Random() instance.

_inst = Random()
seed = _inst.seed
random = _inst.random
uniform = _inst.uniform
triangular = _inst.triangular
randint = _inst.randint
choice = _inst.choice
randrange = _inst.randrange
sample = _inst.sample
shuffle = _inst.shuffle
choices = _inst.choices
normalvariate = _inst.normalvariate
lognormvariate = _inst.lognormvariate
expovariate = _inst.expovariate
vonmisesvariate = _inst.vonmisesvariate
gammavariate = _inst.gammavariate
gauss = _inst.gauss
betavariate = _inst.betavariate
paretovariate = _inst.paretovariate
weibullvariate = _inst.weibullvariate
getstate = _inst.getstate
setstate = _inst.setstate
getrandbits = _inst.getrandbits

if hasattr(_os, "fork"):
    _os.register_at_fork(after_in_child=_inst.seed)


if __name__ == '__main__':
    _test()
mailcap.py000064400000021553151153537610006541 0ustar00"""Mailcap file handling.  See RFC 1524."""

import os
import warnings
import re

__all__ = ["getcaps","findmatch"]


def lineno_sort_key(entry):
    # Sort in ascending order, with unspecified entries at the end
    if 'lineno' in entry:
        return 0, entry['lineno']
    else:
        return 1, 0

_find_unsafe = re.compile(r'[^\xa1-\U0010FFFF\w@+=:,./-]').search

class UnsafeMailcapInput(Warning):
    """Warning raised when refusing unsafe input"""


# Part 1: top-level interface.

def getcaps():
    """Return a dictionary containing the mailcap database.

    The dictionary maps a MIME type (in all lowercase, e.g. 'text/plain')
    to a list of dictionaries corresponding to mailcap entries.  The list
    collects all the entries for that MIME type from all available mailcap
    files.  Each dictionary contains key-value pairs for that MIME type,
    where the viewing command is stored with the key "view".

    """
    caps = {}
    lineno = 0
    for mailcap in listmailcapfiles():
        try:
            fp = open(mailcap, 'r')
        except OSError:
            continue
        with fp:
            morecaps, lineno = _readmailcapfile(fp, lineno)
        for key, value in morecaps.items():
            if not key in caps:
                caps[key] = value
            else:
                caps[key] = caps[key] + value
    return caps

def listmailcapfiles():
    """Return a list of all mailcap files found on the system."""
    # This is mostly a Unix thing, but we use the OS path separator anyway
    if 'MAILCAPS' in os.environ:
        pathstr = os.environ['MAILCAPS']
        mailcaps = pathstr.split(os.pathsep)
    else:
        if 'HOME' in os.environ:
            home = os.environ['HOME']
        else:
            # Don't bother with getpwuid()
            home = '.' # Last resort
        mailcaps = [home + '/.mailcap', '/etc/mailcap',
                '/usr/etc/mailcap', '/usr/local/etc/mailcap']
    return mailcaps


# Part 2: the parser.
def readmailcapfile(fp):
    """Read a mailcap file and return a dictionary keyed by MIME type."""
    warnings.warn('readmailcapfile is deprecated, use getcaps instead',
                  DeprecationWarning, 2)
    caps, _ = _readmailcapfile(fp, None)
    return caps


def _readmailcapfile(fp, lineno):
    """Read a mailcap file and return a dictionary keyed by MIME type.

    Each MIME type is mapped to an entry consisting of a list of
    dictionaries; the list will contain more than one such dictionary
    if a given MIME type appears more than once in the mailcap file.
    Each dictionary contains key-value pairs for that MIME type, where
    the viewing command is stored with the key "view".
    """
    caps = {}
    while 1:
        line = fp.readline()
        if not line: break
        # Ignore comments and blank lines
        if line[0] == '#' or line.strip() == '':
            continue
        nextline = line
        # Join continuation lines
        while nextline[-2:] == '\\\n':
            nextline = fp.readline()
            if not nextline: nextline = '\n'
            line = line[:-2] + nextline
        # Parse the line
        key, fields = parseline(line)
        if not (key and fields):
            continue
        if lineno is not None:
            fields['lineno'] = lineno
            lineno += 1
        # Normalize the key
        types = key.split('/')
        for j in range(len(types)):
            types[j] = types[j].strip()
        key = '/'.join(types).lower()
        # Update the database
        if key in caps:
            caps[key].append(fields)
        else:
            caps[key] = [fields]
    return caps, lineno

def parseline(line):
    """Parse one entry in a mailcap file and return a dictionary.

    The viewing command is stored as the value with the key "view",
    and the rest of the fields produce key-value pairs in the dict.
    """
    fields = []
    i, n = 0, len(line)
    while i < n:
        field, i = parsefield(line, i, n)
        fields.append(field)
        i = i+1 # Skip semicolon
    if len(fields) < 2:
        return None, None
    key, view, rest = fields[0], fields[1], fields[2:]
    fields = {'view': view}
    for field in rest:
        i = field.find('=')
        if i < 0:
            fkey = field
            fvalue = ""
        else:
            fkey = field[:i].strip()
            fvalue = field[i+1:].strip()
        if fkey in fields:
            # Ignore it
            pass
        else:
            fields[fkey] = fvalue
    return key, fields

def parsefield(line, i, n):
    """Separate one key-value pair in a mailcap entry."""
    start = i
    while i < n:
        c = line[i]
        if c == ';':
            break
        elif c == '\\':
            i = i+2
        else:
            i = i+1
    return line[start:i].strip(), i


# Part 3: using the database.

def findmatch(caps, MIMEtype, key='view', filename="/dev/null", plist=[]):
    """Find a match for a mailcap entry.

    Return a tuple containing the command line, and the mailcap entry
    used; (None, None) if no match is found.  This may invoke the
    'test' command of several matching entries before deciding which
    entry to use.

    """
    if _find_unsafe(filename):
        msg = "Refusing to use mailcap with filename %r. Use a safe temporary filename." % (filename,)
        warnings.warn(msg, UnsafeMailcapInput)
        return None, None
    entries = lookup(caps, MIMEtype, key)
    # XXX This code should somehow check for the needsterminal flag.
    for e in entries:
        if 'test' in e:
            test = subst(e['test'], filename, plist)
            if test is None:
                continue
            if test and os.system(test) != 0:
                continue
        command = subst(e[key], MIMEtype, filename, plist)
        if command is not None:
            return command, e
    return None, None

def lookup(caps, MIMEtype, key=None):
    entries = []
    if MIMEtype in caps:
        entries = entries + caps[MIMEtype]
    MIMEtypes = MIMEtype.split('/')
    MIMEtype = MIMEtypes[0] + '/*'
    if MIMEtype in caps:
        entries = entries + caps[MIMEtype]
    if key is not None:
        entries = [e for e in entries if key in e]
    entries = sorted(entries, key=lineno_sort_key)
    return entries

def subst(field, MIMEtype, filename, plist=[]):
    # XXX Actually, this is Unix-specific
    res = ''
    i, n = 0, len(field)
    while i < n:
        c = field[i]; i = i+1
        if c != '%':
            if c == '\\':
                c = field[i:i+1]; i = i+1
            res = res + c
        else:
            c = field[i]; i = i+1
            if c == '%':
                res = res + c
            elif c == 's':
                res = res + filename
            elif c == 't':
                if _find_unsafe(MIMEtype):
                    msg = "Refusing to substitute MIME type %r into a shell command." % (MIMEtype,)
                    warnings.warn(msg, UnsafeMailcapInput)
                    return None
                res = res + MIMEtype
            elif c == '{':
                start = i
                while i < n and field[i] != '}':
                    i = i+1
                name = field[start:i]
                i = i+1
                param = findparam(name, plist)
                if _find_unsafe(param):
                    msg = "Refusing to substitute parameter %r (%s) into a shell command" % (param, name)
                    warnings.warn(msg, UnsafeMailcapInput)
                    return None
                res = res + param
            # XXX To do:
            # %n == number of parts if type is multipart/*
            # %F == list of alternating type and filename for parts
            else:
                res = res + '%' + c
    return res

def findparam(name, plist):
    name = name.lower() + '='
    n = len(name)
    for p in plist:
        if p[:n].lower() == name:
            return p[n:]
    return ''


# Part 4: test program.

def test():
    import sys
    caps = getcaps()
    if not sys.argv[1:]:
        show(caps)
        return
    for i in range(1, len(sys.argv), 2):
        args = sys.argv[i:i+2]
        if len(args) < 2:
            print("usage: mailcap [MIMEtype file] ...")
            return
        MIMEtype = args[0]
        file = args[1]
        command, e = findmatch(caps, MIMEtype, 'view', file)
        if not command:
            print("No viewer found for", type)
        else:
            print("Executing:", command)
            sts = os.system(command)
            if sts:
                print("Exit status:", sts)

def show(caps):
    print("Mailcap files:")
    for fn in listmailcapfiles(): print("\t" + fn)
    print()
    if not caps: caps = getcaps()
    print("Mailcap entries:")
    print()
    ckeys = sorted(caps)
    for type in ckeys:
        print(type)
        entries = caps[type]
        for e in entries:
            keys = sorted(e)
            for k in keys:
                print("  %-15s" % k, e[k])
            print()

if __name__ == '__main__':
    test()
token.py000064400000004500151153537610006244 0ustar00"""Token constants."""
# Auto-generated by Tools/scripts/generate_token.py

__all__ = ['tok_name', 'ISTERMINAL', 'ISNONTERMINAL', 'ISEOF']

ENDMARKER = 0
NAME = 1
NUMBER = 2
STRING = 3
NEWLINE = 4
INDENT = 5
DEDENT = 6
LPAR = 7
RPAR = 8
LSQB = 9
RSQB = 10
COLON = 11
COMMA = 12
SEMI = 13
PLUS = 14
MINUS = 15
STAR = 16
SLASH = 17
VBAR = 18
AMPER = 19
LESS = 20
GREATER = 21
EQUAL = 22
DOT = 23
PERCENT = 24
LBRACE = 25
RBRACE = 26
EQEQUAL = 27
NOTEQUAL = 28
LESSEQUAL = 29
GREATEREQUAL = 30
TILDE = 31
CIRCUMFLEX = 32
LEFTSHIFT = 33
RIGHTSHIFT = 34
DOUBLESTAR = 35
PLUSEQUAL = 36
MINEQUAL = 37
STAREQUAL = 38
SLASHEQUAL = 39
PERCENTEQUAL = 40
AMPEREQUAL = 41
VBAREQUAL = 42
CIRCUMFLEXEQUAL = 43
LEFTSHIFTEQUAL = 44
RIGHTSHIFTEQUAL = 45
DOUBLESTAREQUAL = 46
DOUBLESLASH = 47
DOUBLESLASHEQUAL = 48
AT = 49
ATEQUAL = 50
RARROW = 51
ELLIPSIS = 52
COLONEQUAL = 53
OP = 54
AWAIT = 55
ASYNC = 56
TYPE_IGNORE = 57
TYPE_COMMENT = 58
# These aren't used by the C tokenizer but are needed for tokenize.py
ERRORTOKEN = 59
COMMENT = 60
NL = 61
ENCODING = 62
N_TOKENS = 63
# Special definitions for cooperation with parser
NT_OFFSET = 256

tok_name = {value: name
            for name, value in globals().items()
            if isinstance(value, int) and not name.startswith('_')}
__all__.extend(tok_name.values())

EXACT_TOKEN_TYPES = {
    '!=': NOTEQUAL,
    '%': PERCENT,
    '%=': PERCENTEQUAL,
    '&': AMPER,
    '&=': AMPEREQUAL,
    '(': LPAR,
    ')': RPAR,
    '*': STAR,
    '**': DOUBLESTAR,
    '**=': DOUBLESTAREQUAL,
    '*=': STAREQUAL,
    '+': PLUS,
    '+=': PLUSEQUAL,
    ',': COMMA,
    '-': MINUS,
    '-=': MINEQUAL,
    '->': RARROW,
    '.': DOT,
    '...': ELLIPSIS,
    '/': SLASH,
    '//': DOUBLESLASH,
    '//=': DOUBLESLASHEQUAL,
    '/=': SLASHEQUAL,
    ':': COLON,
    ':=': COLONEQUAL,
    ';': SEMI,
    '<': LESS,
    '<<': LEFTSHIFT,
    '<<=': LEFTSHIFTEQUAL,
    '<=': LESSEQUAL,
    '=': EQUAL,
    '==': EQEQUAL,
    '>': GREATER,
    '>=': GREATEREQUAL,
    '>>': RIGHTSHIFT,
    '>>=': RIGHTSHIFTEQUAL,
    '@': AT,
    '@=': ATEQUAL,
    '[': LSQB,
    ']': RSQB,
    '^': CIRCUMFLEX,
    '^=': CIRCUMFLEXEQUAL,
    '{': LBRACE,
    '|': VBAR,
    '|=': VBAREQUAL,
    '}': RBRACE,
    '~': TILDE,
}

def ISTERMINAL(x):
    return x < NT_OFFSET

def ISNONTERMINAL(x):
    return x >= NT_OFFSET

def ISEOF(x):
    return x == ENDMARKER
bz2.py000064400000030416151153537610005626 0ustar00"""Interface to the libbzip2 compression library.

This module provides a file interface, classes for incremental
(de)compression, and functions for one-shot (de)compression.
"""

__all__ = ["BZ2File", "BZ2Compressor", "BZ2Decompressor",
           "open", "compress", "decompress"]

__author__ = "Nadeem Vawda <nadeem.vawda@gmail.com>"

from builtins import open as _builtin_open
import io
import os
import warnings
import _compression
from threading import RLock

from _bz2 import BZ2Compressor, BZ2Decompressor


_MODE_CLOSED   = 0
_MODE_READ     = 1
# Value 2 no longer used
_MODE_WRITE    = 3

_sentinel = object()


class BZ2File(_compression.BaseStream):

    """A file object providing transparent bzip2 (de)compression.

    A BZ2File can act as a wrapper for an existing file object, or refer
    directly to a named file on disk.

    Note that BZ2File provides a *binary* file interface - data read is
    returned as bytes, and data to be written should be given as bytes.
    """

    def __init__(self, filename, mode="r", buffering=_sentinel, compresslevel=9):
        """Open a bzip2-compressed file.

        If filename is a str, bytes, or PathLike object, it gives the
        name of the file to be opened. Otherwise, it should be a file
        object, which will be used to read or write the compressed data.

        mode can be 'r' for reading (default), 'w' for (over)writing,
        'x' for creating exclusively, or 'a' for appending. These can
        equivalently be given as 'rb', 'wb', 'xb', and 'ab'.

        buffering is ignored since Python 3.0. Its use is deprecated.

        If mode is 'w', 'x' or 'a', compresslevel can be a number between 1
        and 9 specifying the level of compression: 1 produces the least
        compression, and 9 (default) produces the most compression.

        If mode is 'r', the input file may be the concatenation of
        multiple compressed streams.
        """
        # This lock must be recursive, so that BufferedIOBase's
        # writelines() does not deadlock.
        self._lock = RLock()
        self._fp = None
        self._closefp = False
        self._mode = _MODE_CLOSED

        if buffering is not _sentinel:
            warnings.warn("Use of 'buffering' argument is deprecated and ignored "
                          "since Python 3.0.",
                          DeprecationWarning,
                          stacklevel=2)

        if not (1 <= compresslevel <= 9):
            raise ValueError("compresslevel must be between 1 and 9")

        if mode in ("", "r", "rb"):
            mode = "rb"
            mode_code = _MODE_READ
        elif mode in ("w", "wb"):
            mode = "wb"
            mode_code = _MODE_WRITE
            self._compressor = BZ2Compressor(compresslevel)
        elif mode in ("x", "xb"):
            mode = "xb"
            mode_code = _MODE_WRITE
            self._compressor = BZ2Compressor(compresslevel)
        elif mode in ("a", "ab"):
            mode = "ab"
            mode_code = _MODE_WRITE
            self._compressor = BZ2Compressor(compresslevel)
        else:
            raise ValueError("Invalid mode: %r" % (mode,))

        if isinstance(filename, (str, bytes, os.PathLike)):
            self._fp = _builtin_open(filename, mode)
            self._closefp = True
            self._mode = mode_code
        elif hasattr(filename, "read") or hasattr(filename, "write"):
            self._fp = filename
            self._mode = mode_code
        else:
            raise TypeError("filename must be a str, bytes, file or PathLike object")

        if self._mode == _MODE_READ:
            raw = _compression.DecompressReader(self._fp,
                BZ2Decompressor, trailing_error=OSError)
            self._buffer = io.BufferedReader(raw)
        else:
            self._pos = 0

    def close(self):
        """Flush and close the file.

        May be called more than once without error. Once the file is
        closed, any other operation on it will raise a ValueError.
        """
        with self._lock:
            if self._mode == _MODE_CLOSED:
                return
            try:
                if self._mode == _MODE_READ:
                    self._buffer.close()
                elif self._mode == _MODE_WRITE:
                    self._fp.write(self._compressor.flush())
                    self._compressor = None
            finally:
                try:
                    if self._closefp:
                        self._fp.close()
                finally:
                    self._fp = None
                    self._closefp = False
                    self._mode = _MODE_CLOSED
                    self._buffer = None

    @property
    def closed(self):
        """True if this file is closed."""
        return self._mode == _MODE_CLOSED

    def fileno(self):
        """Return the file descriptor for the underlying file."""
        self._check_not_closed()
        return self._fp.fileno()

    def seekable(self):
        """Return whether the file supports seeking."""
        return self.readable() and self._buffer.seekable()

    def readable(self):
        """Return whether the file was opened for reading."""
        self._check_not_closed()
        return self._mode == _MODE_READ

    def writable(self):
        """Return whether the file was opened for writing."""
        self._check_not_closed()
        return self._mode == _MODE_WRITE

    def peek(self, n=0):
        """Return buffered data without advancing the file position.

        Always returns at least one byte of data, unless at EOF.
        The exact number of bytes returned is unspecified.
        """
        with self._lock:
            self._check_can_read()
            # Relies on the undocumented fact that BufferedReader.peek()
            # always returns at least one byte (except at EOF), independent
            # of the value of n
            return self._buffer.peek(n)

    def read(self, size=-1):
        """Read up to size uncompressed bytes from the file.

        If size is negative or omitted, read until EOF is reached.
        Returns b'' if the file is already at EOF.
        """
        with self._lock:
            self._check_can_read()
            return self._buffer.read(size)

    def read1(self, size=-1):
        """Read up to size uncompressed bytes, while trying to avoid
        making multiple reads from the underlying stream. Reads up to a
        buffer's worth of data if size is negative.

        Returns b'' if the file is at EOF.
        """
        with self._lock:
            self._check_can_read()
            if size < 0:
                size = io.DEFAULT_BUFFER_SIZE
            return self._buffer.read1(size)

    def readinto(self, b):
        """Read bytes into b.

        Returns the number of bytes read (0 for EOF).
        """
        with self._lock:
            self._check_can_read()
            return self._buffer.readinto(b)

    def readline(self, size=-1):
        """Read a line of uncompressed bytes from the file.

        The terminating newline (if present) is retained. If size is
        non-negative, no more than size bytes will be read (in which
        case the line may be incomplete). Returns b'' if already at EOF.
        """
        if not isinstance(size, int):
            if not hasattr(size, "__index__"):
                raise TypeError("Integer argument expected")
            size = size.__index__()
        with self._lock:
            self._check_can_read()
            return self._buffer.readline(size)

    def readlines(self, size=-1):
        """Read a list of lines of uncompressed bytes from the file.

        size can be specified to control the number of lines read: no
        further lines will be read once the total size of the lines read
        so far equals or exceeds size.
        """
        if not isinstance(size, int):
            if not hasattr(size, "__index__"):
                raise TypeError("Integer argument expected")
            size = size.__index__()
        with self._lock:
            self._check_can_read()
            return self._buffer.readlines(size)

    def write(self, data):
        """Write a byte string to the file.

        Returns the number of uncompressed bytes written, which is
        always len(data). Note that due to buffering, the file on disk
        may not reflect the data written until close() is called.
        """
        with self._lock:
            self._check_can_write()
            compressed = self._compressor.compress(data)
            self._fp.write(compressed)
            self._pos += len(data)
            return len(data)

    def writelines(self, seq):
        """Write a sequence of byte strings to the file.

        Returns the number of uncompressed bytes written.
        seq can be any iterable yielding byte strings.

        Line separators are not added between the written byte strings.
        """
        with self._lock:
            return _compression.BaseStream.writelines(self, seq)

    def seek(self, offset, whence=io.SEEK_SET):
        """Change the file position.

        The new position is specified by offset, relative to the
        position indicated by whence. Values for whence are:

            0: start of stream (default); offset must not be negative
            1: current stream position
            2: end of stream; offset must not be positive

        Returns the new file position.

        Note that seeking is emulated, so depending on the parameters,
        this operation may be extremely slow.
        """
        with self._lock:
            self._check_can_seek()
            return self._buffer.seek(offset, whence)

    def tell(self):
        """Return the current file position."""
        with self._lock:
            self._check_not_closed()
            if self._mode == _MODE_READ:
                return self._buffer.tell()
            return self._pos


def open(filename, mode="rb", compresslevel=9,
         encoding=None, errors=None, newline=None):
    """Open a bzip2-compressed file in binary or text mode.

    The filename argument can be an actual filename (a str, bytes, or
    PathLike object), or an existing file object to read from or write
    to.

    The mode argument can be "r", "rb", "w", "wb", "x", "xb", "a" or
    "ab" for binary mode, or "rt", "wt", "xt" or "at" for text mode.
    The default mode is "rb", and the default compresslevel is 9.

    For binary mode, this function is equivalent to the BZ2File
    constructor: BZ2File(filename, mode, compresslevel). In this case,
    the encoding, errors and newline arguments must not be provided.

    For text mode, a BZ2File object is created, and wrapped in an
    io.TextIOWrapper instance with the specified encoding, error
    handling behavior, and line ending(s).

    """
    if "t" in mode:
        if "b" in mode:
            raise ValueError("Invalid mode: %r" % (mode,))
    else:
        if encoding is not None:
            raise ValueError("Argument 'encoding' not supported in binary mode")
        if errors is not None:
            raise ValueError("Argument 'errors' not supported in binary mode")
        if newline is not None:
            raise ValueError("Argument 'newline' not supported in binary mode")

    bz_mode = mode.replace("t", "")
    binary_file = BZ2File(filename, bz_mode, compresslevel=compresslevel)

    if "t" in mode:
        return io.TextIOWrapper(binary_file, encoding, errors, newline)
    else:
        return binary_file


def compress(data, compresslevel=9):
    """Compress a block of data.

    compresslevel, if given, must be a number between 1 and 9.

    For incremental compression, use a BZ2Compressor object instead.
    """
    comp = BZ2Compressor(compresslevel)
    return comp.compress(data) + comp.flush()


def decompress(data):
    """Decompress a block of data.

    For incremental decompression, use a BZ2Decompressor object instead.
    """
    results = []
    while data:
        decomp = BZ2Decompressor()
        try:
            res = decomp.decompress(data)
        except OSError:
            if results:
                break  # Leftover data is not a valid bzip2 stream; ignore it.
            else:
                raise  # Error on the first iteration; bail out.
        results.append(res)
        if not decomp.eof:
            raise ValueError("Compressed data ended before the "
                             "end-of-stream marker was reached")
        data = decomp.unused_data
    return b"".join(results)
wave.py000064400000043466151153537610006104 0ustar00"""Stuff to parse WAVE files.

Usage.

Reading WAVE files:
      f = wave.open(file, 'r')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods read(), seek(), and close().
When the setpos() and rewind() methods are not used, the seek()
method is not  necessary.

This returns an instance of a class with the following public methods:
      getnchannels()  -- returns number of audio channels (1 for
                         mono, 2 for stereo)
      getsampwidth()  -- returns sample width in bytes
      getframerate()  -- returns sampling frequency
      getnframes()    -- returns number of audio frames
      getcomptype()   -- returns compression type ('NONE' for linear samples)
      getcompname()   -- returns human-readable version of
                         compression type ('not compressed' linear samples)
      getparams()     -- returns a namedtuple consisting of all of the
                         above in the above order
      getmarkers()    -- returns None (for compatibility with the
                         aifc module)
      getmark(id)     -- raises an error since the mark does not
                         exist (for compatibility with the aifc module)
      readframes(n)   -- returns at most n frames of audio
      rewind()        -- rewind to the beginning of the audio stream
      setpos(pos)     -- seek to the specified position
      tell()          -- return the current position
      close()         -- close the instance (make it unusable)
The position returned by tell() and the position given to setpos()
are compatible and have nothing to do with the actual position in the
file.
The close() method is called automatically when the class instance
is destroyed.

Writing WAVE files:
      f = wave.open(file, 'w')
where file is either the name of a file or an open file pointer.
The open file pointer must have methods write(), tell(), seek(), and
close().

This returns an instance of a class with the following public methods:
      setnchannels(n) -- set the number of channels
      setsampwidth(n) -- set the sample width
      setframerate(n) -- set the frame rate
      setnframes(n)   -- set the number of frames
      setcomptype(type, name)
                      -- set the compression type and the
                         human-readable compression type
      setparams(tuple)
                      -- set all parameters at once
      tell()          -- return current position in output file
      writeframesraw(data)
                      -- write audio frames without patching up the
                         file header
      writeframes(data)
                      -- write audio frames and patch up the file header
      close()         -- patch up the file header and close the
                         output file
You should set the parameters before the first writeframesraw or
writeframes.  The total number of frames does not need to be set,
but when it is set to the correct value, the header does not have to
be patched up.
It is best to first set all parameters, perhaps possibly the
compression type, and then write audio frames using writeframesraw.
When all frames have been written, either call writeframes(b'') or
close() to patch up the sizes in the header.
The close() method is called automatically when the class instance
is destroyed.
"""

import builtins

__all__ = ["open", "openfp", "Error", "Wave_read", "Wave_write"]

class Error(Exception):
    pass

WAVE_FORMAT_PCM = 0x0001

_array_fmts = None, 'b', 'h', None, 'i'

import audioop
import struct
import sys
from chunk import Chunk
from collections import namedtuple
import warnings

_wave_params = namedtuple('_wave_params',
                     'nchannels sampwidth framerate nframes comptype compname')

class Wave_read:
    """Variables used in this class:

    These variables are available to the user though appropriate
    methods of this class:
    _file -- the open file with methods read(), close(), and seek()
              set through the __init__() method
    _nchannels -- the number of audio channels
              available through the getnchannels() method
    _nframes -- the number of audio frames
              available through the getnframes() method
    _sampwidth -- the number of bytes per audio sample
              available through the getsampwidth() method
    _framerate -- the sampling frequency
              available through the getframerate() method
    _comptype -- the AIFF-C compression type ('NONE' if AIFF)
              available through the getcomptype() method
    _compname -- the human-readable AIFF-C compression type
              available through the getcomptype() method
    _soundpos -- the position in the audio stream
              available through the tell() method, set through the
              setpos() method

    These variables are used internally only:
    _fmt_chunk_read -- 1 iff the FMT chunk has been read
    _data_seek_needed -- 1 iff positioned correctly in audio
              file for readframes()
    _data_chunk -- instantiation of a chunk class for the DATA chunk
    _framesize -- size of one frame in the file
    """

    def initfp(self, file):
        self._convert = None
        self._soundpos = 0
        self._file = Chunk(file, bigendian = 0)
        if self._file.getname() != b'RIFF':
            raise Error('file does not start with RIFF id')
        if self._file.read(4) != b'WAVE':
            raise Error('not a WAVE file')
        self._fmt_chunk_read = 0
        self._data_chunk = None
        while 1:
            self._data_seek_needed = 1
            try:
                chunk = Chunk(self._file, bigendian = 0)
            except EOFError:
                break
            chunkname = chunk.getname()
            if chunkname == b'fmt ':
                self._read_fmt_chunk(chunk)
                self._fmt_chunk_read = 1
            elif chunkname == b'data':
                if not self._fmt_chunk_read:
                    raise Error('data chunk before fmt chunk')
                self._data_chunk = chunk
                self._nframes = chunk.chunksize // self._framesize
                self._data_seek_needed = 0
                break
            chunk.skip()
        if not self._fmt_chunk_read or not self._data_chunk:
            raise Error('fmt chunk and/or data chunk missing')

    def __init__(self, f):
        self._i_opened_the_file = None
        if isinstance(f, str):
            f = builtins.open(f, 'rb')
            self._i_opened_the_file = f
        # else, assume it is an open file object already
        try:
            self.initfp(f)
        except:
            if self._i_opened_the_file:
                f.close()
            raise

    def __del__(self):
        self.close()

    def __enter__(self):
        return self

    def __exit__(self, *args):
        self.close()

    #
    # User visible methods.
    #
    def getfp(self):
        return self._file

    def rewind(self):
        self._data_seek_needed = 1
        self._soundpos = 0

    def close(self):
        self._file = None
        file = self._i_opened_the_file
        if file:
            self._i_opened_the_file = None
            file.close()

    def tell(self):
        return self._soundpos

    def getnchannels(self):
        return self._nchannels

    def getnframes(self):
        return self._nframes

    def getsampwidth(self):
        return self._sampwidth

    def getframerate(self):
        return self._framerate

    def getcomptype(self):
        return self._comptype

    def getcompname(self):
        return self._compname

    def getparams(self):
        return _wave_params(self.getnchannels(), self.getsampwidth(),
                       self.getframerate(), self.getnframes(),
                       self.getcomptype(), self.getcompname())

    def getmarkers(self):
        return None

    def getmark(self, id):
        raise Error('no marks')

    def setpos(self, pos):
        if pos < 0 or pos > self._nframes:
            raise Error('position not in range')
        self._soundpos = pos
        self._data_seek_needed = 1

    def readframes(self, nframes):
        if self._data_seek_needed:
            self._data_chunk.seek(0, 0)
            pos = self._soundpos * self._framesize
            if pos:
                self._data_chunk.seek(pos, 0)
            self._data_seek_needed = 0
        if nframes == 0:
            return b''
        data = self._data_chunk.read(nframes * self._framesize)
        if self._sampwidth != 1 and sys.byteorder == 'big':
            data = audioop.byteswap(data, self._sampwidth)
        if self._convert and data:
            data = self._convert(data)
        self._soundpos = self._soundpos + len(data) // (self._nchannels * self._sampwidth)
        return data

    #
    # Internal methods.
    #

    def _read_fmt_chunk(self, chunk):
        try:
            wFormatTag, self._nchannels, self._framerate, dwAvgBytesPerSec, wBlockAlign = struct.unpack_from('<HHLLH', chunk.read(14))
        except struct.error:
            raise EOFError from None
        if wFormatTag == WAVE_FORMAT_PCM:
            try:
                sampwidth = struct.unpack_from('<H', chunk.read(2))[0]
            except struct.error:
                raise EOFError from None
            self._sampwidth = (sampwidth + 7) // 8
            if not self._sampwidth:
                raise Error('bad sample width')
        else:
            raise Error('unknown format: %r' % (wFormatTag,))
        if not self._nchannels:
            raise Error('bad # of channels')
        self._framesize = self._nchannels * self._sampwidth
        self._comptype = 'NONE'
        self._compname = 'not compressed'

class Wave_write:
    """Variables used in this class:

    These variables are user settable through appropriate methods
    of this class:
    _file -- the open file with methods write(), close(), tell(), seek()
              set through the __init__() method
    _comptype -- the AIFF-C compression type ('NONE' in AIFF)
              set through the setcomptype() or setparams() method
    _compname -- the human-readable AIFF-C compression type
              set through the setcomptype() or setparams() method
    _nchannels -- the number of audio channels
              set through the setnchannels() or setparams() method
    _sampwidth -- the number of bytes per audio sample
              set through the setsampwidth() or setparams() method
    _framerate -- the sampling frequency
              set through the setframerate() or setparams() method
    _nframes -- the number of audio frames written to the header
              set through the setnframes() or setparams() method

    These variables are used internally only:
    _datalength -- the size of the audio samples written to the header
    _nframeswritten -- the number of frames actually written
    _datawritten -- the size of the audio samples actually written
    """

    def __init__(self, f):
        self._i_opened_the_file = None
        if isinstance(f, str):
            f = builtins.open(f, 'wb')
            self._i_opened_the_file = f
        try:
            self.initfp(f)
        except:
            if self._i_opened_the_file:
                f.close()
            raise

    def initfp(self, file):
        self._file = file
        self._convert = None
        self._nchannels = 0
        self._sampwidth = 0
        self._framerate = 0
        self._nframes = 0
        self._nframeswritten = 0
        self._datawritten = 0
        self._datalength = 0
        self._headerwritten = False

    def __del__(self):
        self.close()

    def __enter__(self):
        return self

    def __exit__(self, *args):
        self.close()

    #
    # User visible methods.
    #
    def setnchannels(self, nchannels):
        if self._datawritten:
            raise Error('cannot change parameters after starting to write')
        if nchannels < 1:
            raise Error('bad # of channels')
        self._nchannels = nchannels

    def getnchannels(self):
        if not self._nchannels:
            raise Error('number of channels not set')
        return self._nchannels

    def setsampwidth(self, sampwidth):
        if self._datawritten:
            raise Error('cannot change parameters after starting to write')
        if sampwidth < 1 or sampwidth > 4:
            raise Error('bad sample width')
        self._sampwidth = sampwidth

    def getsampwidth(self):
        if not self._sampwidth:
            raise Error('sample width not set')
        return self._sampwidth

    def setframerate(self, framerate):
        if self._datawritten:
            raise Error('cannot change parameters after starting to write')
        if framerate <= 0:
            raise Error('bad frame rate')
        self._framerate = int(round(framerate))

    def getframerate(self):
        if not self._framerate:
            raise Error('frame rate not set')
        return self._framerate

    def setnframes(self, nframes):
        if self._datawritten:
            raise Error('cannot change parameters after starting to write')
        self._nframes = nframes

    def getnframes(self):
        return self._nframeswritten

    def setcomptype(self, comptype, compname):
        if self._datawritten:
            raise Error('cannot change parameters after starting to write')
        if comptype not in ('NONE',):
            raise Error('unsupported compression type')
        self._comptype = comptype
        self._compname = compname

    def getcomptype(self):
        return self._comptype

    def getcompname(self):
        return self._compname

    def setparams(self, params):
        nchannels, sampwidth, framerate, nframes, comptype, compname = params
        if self._datawritten:
            raise Error('cannot change parameters after starting to write')
        self.setnchannels(nchannels)
        self.setsampwidth(sampwidth)
        self.setframerate(framerate)
        self.setnframes(nframes)
        self.setcomptype(comptype, compname)

    def getparams(self):
        if not self._nchannels or not self._sampwidth or not self._framerate:
            raise Error('not all parameters set')
        return _wave_params(self._nchannels, self._sampwidth, self._framerate,
              self._nframes, self._comptype, self._compname)

    def setmark(self, id, pos, name):
        raise Error('setmark() not supported')

    def getmark(self, id):
        raise Error('no marks')

    def getmarkers(self):
        return None

    def tell(self):
        return self._nframeswritten

    def writeframesraw(self, data):
        if not isinstance(data, (bytes, bytearray)):
            data = memoryview(data).cast('B')
        self._ensure_header_written(len(data))
        nframes = len(data) // (self._sampwidth * self._nchannels)
        if self._convert:
            data = self._convert(data)
        if self._sampwidth != 1 and sys.byteorder == 'big':
            data = audioop.byteswap(data, self._sampwidth)
        self._file.write(data)
        self._datawritten += len(data)
        self._nframeswritten = self._nframeswritten + nframes

    def writeframes(self, data):
        self.writeframesraw(data)
        if self._datalength != self._datawritten:
            self._patchheader()

    def close(self):
        try:
            if self._file:
                self._ensure_header_written(0)
                if self._datalength != self._datawritten:
                    self._patchheader()
                self._file.flush()
        finally:
            self._file = None
            file = self._i_opened_the_file
            if file:
                self._i_opened_the_file = None
                file.close()

    #
    # Internal methods.
    #

    def _ensure_header_written(self, datasize):
        if not self._headerwritten:
            if not self._nchannels:
                raise Error('# channels not specified')
            if not self._sampwidth:
                raise Error('sample width not specified')
            if not self._framerate:
                raise Error('sampling rate not specified')
            self._write_header(datasize)

    def _write_header(self, initlength):
        assert not self._headerwritten
        self._file.write(b'RIFF')
        if not self._nframes:
            self._nframes = initlength // (self._nchannels * self._sampwidth)
        self._datalength = self._nframes * self._nchannels * self._sampwidth
        try:
            self._form_length_pos = self._file.tell()
        except (AttributeError, OSError):
            self._form_length_pos = None
        self._file.write(struct.pack('<L4s4sLHHLLHH4s',
            36 + self._datalength, b'WAVE', b'fmt ', 16,
            WAVE_FORMAT_PCM, self._nchannels, self._framerate,
            self._nchannels * self._framerate * self._sampwidth,
            self._nchannels * self._sampwidth,
            self._sampwidth * 8, b'data'))
        if self._form_length_pos is not None:
            self._data_length_pos = self._file.tell()
        self._file.write(struct.pack('<L', self._datalength))
        self._headerwritten = True

    def _patchheader(self):
        assert self._headerwritten
        if self._datawritten == self._datalength:
            return
        curpos = self._file.tell()
        self._file.seek(self._form_length_pos, 0)
        self._file.write(struct.pack('<L', 36 + self._datawritten))
        self._file.seek(self._data_length_pos, 0)
        self._file.write(struct.pack('<L', self._datawritten))
        self._file.seek(curpos, 0)
        self._datalength = self._datawritten

def open(f, mode=None):
    if mode is None:
        if hasattr(f, 'mode'):
            mode = f.mode
        else:
            mode = 'rb'
    if mode in ('r', 'rb'):
        return Wave_read(f)
    elif mode in ('w', 'wb'):
        return Wave_write(f)
    else:
        raise Error("mode must be 'r', 'rb', 'w', or 'wb'")

def openfp(f, mode=None):
    warnings.warn("wave.openfp is deprecated since Python 3.7. "
                  "Use wave.open instead.", DeprecationWarning, stacklevel=2)
    return open(f, mode=mode)
smtpd.py000075500000103625151153537610006266 0ustar00#! /usr/bin/python3.8
"""An RFC 5321 smtp proxy with optional RFC 1870 and RFC 6531 extensions.

Usage: %(program)s [options] [localhost:localport [remotehost:remoteport]]

Options:

    --nosetuid
    -n
        This program generally tries to setuid `nobody', unless this flag is
        set.  The setuid call will fail if this program is not run as root (in
        which case, use this flag).

    --version
    -V
        Print the version number and exit.

    --class classname
    -c classname
        Use `classname' as the concrete SMTP proxy class.  Uses `PureProxy' by
        default.

    --size limit
    -s limit
        Restrict the total size of the incoming message to "limit" number of
        bytes via the RFC 1870 SIZE extension.  Defaults to 33554432 bytes.

    --smtputf8
    -u
        Enable the SMTPUTF8 extension and behave as an RFC 6531 smtp proxy.

    --debug
    -d
        Turn on debugging prints.

    --help
    -h
        Print this message and exit.

Version: %(__version__)s

If localhost is not given then `localhost' is used, and if localport is not
given then 8025 is used.  If remotehost is not given then `localhost' is used,
and if remoteport is not given, then 25 is used.
"""

# Overview:
#
# This file implements the minimal SMTP protocol as defined in RFC 5321.  It
# has a hierarchy of classes which implement the backend functionality for the
# smtpd.  A number of classes are provided:
#
#   SMTPServer - the base class for the backend.  Raises NotImplementedError
#   if you try to use it.
#
#   DebuggingServer - simply prints each message it receives on stdout.
#
#   PureProxy - Proxies all messages to a real smtpd which does final
#   delivery.  One known problem with this class is that it doesn't handle
#   SMTP errors from the backend server at all.  This should be fixed
#   (contributions are welcome!).
#
#   MailmanProxy - An experimental hack to work with GNU Mailman
#   <www.list.org>.  Using this server as your real incoming smtpd, your
#   mailhost will automatically recognize and accept mail destined to Mailman
#   lists when those lists are created.  Every message not destined for a list
#   gets forwarded to a real backend smtpd, as with PureProxy.  Again, errors
#   are not handled correctly yet.
#
#
# Author: Barry Warsaw <barry@python.org>
#
# TODO:
#
# - support mailbox delivery
# - alias files
# - Handle more ESMTP extensions
# - handle error codes from the backend smtpd

import sys
import os
import errno
import getopt
import time
import socket
import asyncore
import asynchat
import collections
from warnings import warn
from email._header_value_parser import get_addr_spec, get_angle_addr

__all__ = [
    "SMTPChannel", "SMTPServer", "DebuggingServer", "PureProxy",
    "MailmanProxy",
]

program = sys.argv[0]
__version__ = 'Python SMTP proxy version 0.3'


class Devnull:
    def write(self, msg): pass
    def flush(self): pass


DEBUGSTREAM = Devnull()
NEWLINE = '\n'
COMMASPACE = ', '
DATA_SIZE_DEFAULT = 33554432


def usage(code, msg=''):
    print(__doc__ % globals(), file=sys.stderr)
    if msg:
        print(msg, file=sys.stderr)
    sys.exit(code)


class SMTPChannel(asynchat.async_chat):
    COMMAND = 0
    DATA = 1

    command_size_limit = 512
    command_size_limits = collections.defaultdict(lambda x=command_size_limit: x)

    @property
    def max_command_size_limit(self):
        try:
            return max(self.command_size_limits.values())
        except ValueError:
            return self.command_size_limit

    def __init__(self, server, conn, addr, data_size_limit=DATA_SIZE_DEFAULT,
                 map=None, enable_SMTPUTF8=False, decode_data=False):
        asynchat.async_chat.__init__(self, conn, map=map)
        self.smtp_server = server
        self.conn = conn
        self.addr = addr
        self.data_size_limit = data_size_limit
        self.enable_SMTPUTF8 = enable_SMTPUTF8
        self._decode_data = decode_data
        if enable_SMTPUTF8 and decode_data:
            raise ValueError("decode_data and enable_SMTPUTF8 cannot"
                             " be set to True at the same time")
        if decode_data:
            self._emptystring = ''
            self._linesep = '\r\n'
            self._dotsep = '.'
            self._newline = NEWLINE
        else:
            self._emptystring = b''
            self._linesep = b'\r\n'
            self._dotsep = ord(b'.')
            self._newline = b'\n'
        self._set_rset_state()
        self.seen_greeting = ''
        self.extended_smtp = False
        self.command_size_limits.clear()
        self.fqdn = socket.getfqdn()
        try:
            self.peer = conn.getpeername()
        except OSError as err:
            # a race condition  may occur if the other end is closing
            # before we can get the peername
            self.close()
            if err.args[0] != errno.ENOTCONN:
                raise
            return
        print('Peer:', repr(self.peer), file=DEBUGSTREAM)
        self.push('220 %s %s' % (self.fqdn, __version__))

    def _set_post_data_state(self):
        """Reset state variables to their post-DATA state."""
        self.smtp_state = self.COMMAND
        self.mailfrom = None
        self.rcpttos = []
        self.require_SMTPUTF8 = False
        self.num_bytes = 0
        self.set_terminator(b'\r\n')

    def _set_rset_state(self):
        """Reset all state variables except the greeting."""
        self._set_post_data_state()
        self.received_data = ''
        self.received_lines = []


    # properties for backwards-compatibility
    @property
    def __server(self):
        warn("Access to __server attribute on SMTPChannel is deprecated, "
            "use 'smtp_server' instead", DeprecationWarning, 2)
        return self.smtp_server
    @__server.setter
    def __server(self, value):
        warn("Setting __server attribute on SMTPChannel is deprecated, "
            "set 'smtp_server' instead", DeprecationWarning, 2)
        self.smtp_server = value

    @property
    def __line(self):
        warn("Access to __line attribute on SMTPChannel is deprecated, "
            "use 'received_lines' instead", DeprecationWarning, 2)
        return self.received_lines
    @__line.setter
    def __line(self, value):
        warn("Setting __line attribute on SMTPChannel is deprecated, "
            "set 'received_lines' instead", DeprecationWarning, 2)
        self.received_lines = value

    @property
    def __state(self):
        warn("Access to __state attribute on SMTPChannel is deprecated, "
            "use 'smtp_state' instead", DeprecationWarning, 2)
        return self.smtp_state
    @__state.setter
    def __state(self, value):
        warn("Setting __state attribute on SMTPChannel is deprecated, "
            "set 'smtp_state' instead", DeprecationWarning, 2)
        self.smtp_state = value

    @property
    def __greeting(self):
        warn("Access to __greeting attribute on SMTPChannel is deprecated, "
            "use 'seen_greeting' instead", DeprecationWarning, 2)
        return self.seen_greeting
    @__greeting.setter
    def __greeting(self, value):
        warn("Setting __greeting attribute on SMTPChannel is deprecated, "
            "set 'seen_greeting' instead", DeprecationWarning, 2)
        self.seen_greeting = value

    @property
    def __mailfrom(self):
        warn("Access to __mailfrom attribute on SMTPChannel is deprecated, "
            "use 'mailfrom' instead", DeprecationWarning, 2)
        return self.mailfrom
    @__mailfrom.setter
    def __mailfrom(self, value):
        warn("Setting __mailfrom attribute on SMTPChannel is deprecated, "
            "set 'mailfrom' instead", DeprecationWarning, 2)
        self.mailfrom = value

    @property
    def __rcpttos(self):
        warn("Access to __rcpttos attribute on SMTPChannel is deprecated, "
            "use 'rcpttos' instead", DeprecationWarning, 2)
        return self.rcpttos
    @__rcpttos.setter
    def __rcpttos(self, value):
        warn("Setting __rcpttos attribute on SMTPChannel is deprecated, "
            "set 'rcpttos' instead", DeprecationWarning, 2)
        self.rcpttos = value

    @property
    def __data(self):
        warn("Access to __data attribute on SMTPChannel is deprecated, "
            "use 'received_data' instead", DeprecationWarning, 2)
        return self.received_data
    @__data.setter
    def __data(self, value):
        warn("Setting __data attribute on SMTPChannel is deprecated, "
            "set 'received_data' instead", DeprecationWarning, 2)
        self.received_data = value

    @property
    def __fqdn(self):
        warn("Access to __fqdn attribute on SMTPChannel is deprecated, "
            "use 'fqdn' instead", DeprecationWarning, 2)
        return self.fqdn
    @__fqdn.setter
    def __fqdn(self, value):
        warn("Setting __fqdn attribute on SMTPChannel is deprecated, "
            "set 'fqdn' instead", DeprecationWarning, 2)
        self.fqdn = value

    @property
    def __peer(self):
        warn("Access to __peer attribute on SMTPChannel is deprecated, "
            "use 'peer' instead", DeprecationWarning, 2)
        return self.peer
    @__peer.setter
    def __peer(self, value):
        warn("Setting __peer attribute on SMTPChannel is deprecated, "
            "set 'peer' instead", DeprecationWarning, 2)
        self.peer = value

    @property
    def __conn(self):
        warn("Access to __conn attribute on SMTPChannel is deprecated, "
            "use 'conn' instead", DeprecationWarning, 2)
        return self.conn
    @__conn.setter
    def __conn(self, value):
        warn("Setting __conn attribute on SMTPChannel is deprecated, "
            "set 'conn' instead", DeprecationWarning, 2)
        self.conn = value

    @property
    def __addr(self):
        warn("Access to __addr attribute on SMTPChannel is deprecated, "
            "use 'addr' instead", DeprecationWarning, 2)
        return self.addr
    @__addr.setter
    def __addr(self, value):
        warn("Setting __addr attribute on SMTPChannel is deprecated, "
            "set 'addr' instead", DeprecationWarning, 2)
        self.addr = value

    # Overrides base class for convenience.
    def push(self, msg):
        asynchat.async_chat.push(self, bytes(
            msg + '\r\n', 'utf-8' if self.require_SMTPUTF8 else 'ascii'))

    # Implementation of base class abstract method
    def collect_incoming_data(self, data):
        limit = None
        if self.smtp_state == self.COMMAND:
            limit = self.max_command_size_limit
        elif self.smtp_state == self.DATA:
            limit = self.data_size_limit
        if limit and self.num_bytes > limit:
            return
        elif limit:
            self.num_bytes += len(data)
        if self._decode_data:
            self.received_lines.append(str(data, 'utf-8'))
        else:
            self.received_lines.append(data)

    # Implementation of base class abstract method
    def found_terminator(self):
        line = self._emptystring.join(self.received_lines)
        print('Data:', repr(line), file=DEBUGSTREAM)
        self.received_lines = []
        if self.smtp_state == self.COMMAND:
            sz, self.num_bytes = self.num_bytes, 0
            if not line:
                self.push('500 Error: bad syntax')
                return
            if not self._decode_data:
                line = str(line, 'utf-8')
            i = line.find(' ')
            if i < 0:
                command = line.upper()
                arg = None
            else:
                command = line[:i].upper()
                arg = line[i+1:].strip()
            max_sz = (self.command_size_limits[command]
                        if self.extended_smtp else self.command_size_limit)
            if sz > max_sz:
                self.push('500 Error: line too long')
                return
            method = getattr(self, 'smtp_' + command, None)
            if not method:
                self.push('500 Error: command "%s" not recognized' % command)
                return
            method(arg)
            return
        else:
            if self.smtp_state != self.DATA:
                self.push('451 Internal confusion')
                self.num_bytes = 0
                return
            if self.data_size_limit and self.num_bytes > self.data_size_limit:
                self.push('552 Error: Too much mail data')
                self.num_bytes = 0
                return
            # Remove extraneous carriage returns and de-transparency according
            # to RFC 5321, Section 4.5.2.
            data = []
            for text in line.split(self._linesep):
                if text and text[0] == self._dotsep:
                    data.append(text[1:])
                else:
                    data.append(text)
            self.received_data = self._newline.join(data)
            args = (self.peer, self.mailfrom, self.rcpttos, self.received_data)
            kwargs = {}
            if not self._decode_data:
                kwargs = {
                    'mail_options': self.mail_options,
                    'rcpt_options': self.rcpt_options,
                }
            status = self.smtp_server.process_message(*args, **kwargs)
            self._set_post_data_state()
            if not status:
                self.push('250 OK')
            else:
                self.push(status)

    # SMTP and ESMTP commands
    def smtp_HELO(self, arg):
        if not arg:
            self.push('501 Syntax: HELO hostname')
            return
        # See issue #21783 for a discussion of this behavior.
        if self.seen_greeting:
            self.push('503 Duplicate HELO/EHLO')
            return
        self._set_rset_state()
        self.seen_greeting = arg
        self.push('250 %s' % self.fqdn)

    def smtp_EHLO(self, arg):
        if not arg:
            self.push('501 Syntax: EHLO hostname')
            return
        # See issue #21783 for a discussion of this behavior.
        if self.seen_greeting:
            self.push('503 Duplicate HELO/EHLO')
            return
        self._set_rset_state()
        self.seen_greeting = arg
        self.extended_smtp = True
        self.push('250-%s' % self.fqdn)
        if self.data_size_limit:
            self.push('250-SIZE %s' % self.data_size_limit)
            self.command_size_limits['MAIL'] += 26
        if not self._decode_data:
            self.push('250-8BITMIME')
        if self.enable_SMTPUTF8:
            self.push('250-SMTPUTF8')
            self.command_size_limits['MAIL'] += 10
        self.push('250 HELP')

    def smtp_NOOP(self, arg):
        if arg:
            self.push('501 Syntax: NOOP')
        else:
            self.push('250 OK')

    def smtp_QUIT(self, arg):
        # args is ignored
        self.push('221 Bye')
        self.close_when_done()

    def _strip_command_keyword(self, keyword, arg):
        keylen = len(keyword)
        if arg[:keylen].upper() == keyword:
            return arg[keylen:].strip()
        return ''

    def _getaddr(self, arg):
        if not arg:
            return '', ''
        if arg.lstrip().startswith('<'):
            address, rest = get_angle_addr(arg)
        else:
            address, rest = get_addr_spec(arg)
        if not address:
            return address, rest
        return address.addr_spec, rest

    def _getparams(self, params):
        # Return params as dictionary. Return None if not all parameters
        # appear to be syntactically valid according to RFC 1869.
        result = {}
        for param in params:
            param, eq, value = param.partition('=')
            if not param.isalnum() or eq and not value:
                return None
            result[param] = value if eq else True
        return result

    def smtp_HELP(self, arg):
        if arg:
            extended = ' [SP <mail-parameters>]'
            lc_arg = arg.upper()
            if lc_arg == 'EHLO':
                self.push('250 Syntax: EHLO hostname')
            elif lc_arg == 'HELO':
                self.push('250 Syntax: HELO hostname')
            elif lc_arg == 'MAIL':
                msg = '250 Syntax: MAIL FROM: <address>'
                if self.extended_smtp:
                    msg += extended
                self.push(msg)
            elif lc_arg == 'RCPT':
                msg = '250 Syntax: RCPT TO: <address>'
                if self.extended_smtp:
                    msg += extended
                self.push(msg)
            elif lc_arg == 'DATA':
                self.push('250 Syntax: DATA')
            elif lc_arg == 'RSET':
                self.push('250 Syntax: RSET')
            elif lc_arg == 'NOOP':
                self.push('250 Syntax: NOOP')
            elif lc_arg == 'QUIT':
                self.push('250 Syntax: QUIT')
            elif lc_arg == 'VRFY':
                self.push('250 Syntax: VRFY <address>')
            else:
                self.push('501 Supported commands: EHLO HELO MAIL RCPT '
                          'DATA RSET NOOP QUIT VRFY')
        else:
            self.push('250 Supported commands: EHLO HELO MAIL RCPT DATA '
                      'RSET NOOP QUIT VRFY')

    def smtp_VRFY(self, arg):
        if arg:
            address, params = self._getaddr(arg)
            if address:
                self.push('252 Cannot VRFY user, but will accept message '
                          'and attempt delivery')
            else:
                self.push('502 Could not VRFY %s' % arg)
        else:
            self.push('501 Syntax: VRFY <address>')

    def smtp_MAIL(self, arg):
        if not self.seen_greeting:
            self.push('503 Error: send HELO first')
            return
        print('===> MAIL', arg, file=DEBUGSTREAM)
        syntaxerr = '501 Syntax: MAIL FROM: <address>'
        if self.extended_smtp:
            syntaxerr += ' [SP <mail-parameters>]'
        if arg is None:
            self.push(syntaxerr)
            return
        arg = self._strip_command_keyword('FROM:', arg)
        address, params = self._getaddr(arg)
        if not address:
            self.push(syntaxerr)
            return
        if not self.extended_smtp and params:
            self.push(syntaxerr)
            return
        if self.mailfrom:
            self.push('503 Error: nested MAIL command')
            return
        self.mail_options = params.upper().split()
        params = self._getparams(self.mail_options)
        if params is None:
            self.push(syntaxerr)
            return
        if not self._decode_data:
            body = params.pop('BODY', '7BIT')
            if body not in ['7BIT', '8BITMIME']:
                self.push('501 Error: BODY can only be one of 7BIT, 8BITMIME')
                return
        if self.enable_SMTPUTF8:
            smtputf8 = params.pop('SMTPUTF8', False)
            if smtputf8 is True:
                self.require_SMTPUTF8 = True
            elif smtputf8 is not False:
                self.push('501 Error: SMTPUTF8 takes no arguments')
                return
        size = params.pop('SIZE', None)
        if size:
            if not size.isdigit():
                self.push(syntaxerr)
                return
            elif self.data_size_limit and int(size) > self.data_size_limit:
                self.push('552 Error: message size exceeds fixed maximum message size')
                return
        if len(params.keys()) > 0:
            self.push('555 MAIL FROM parameters not recognized or not implemented')
            return
        self.mailfrom = address
        print('sender:', self.mailfrom, file=DEBUGSTREAM)
        self.push('250 OK')

    def smtp_RCPT(self, arg):
        if not self.seen_greeting:
            self.push('503 Error: send HELO first');
            return
        print('===> RCPT', arg, file=DEBUGSTREAM)
        if not self.mailfrom:
            self.push('503 Error: need MAIL command')
            return
        syntaxerr = '501 Syntax: RCPT TO: <address>'
        if self.extended_smtp:
            syntaxerr += ' [SP <mail-parameters>]'
        if arg is None:
            self.push(syntaxerr)
            return
        arg = self._strip_command_keyword('TO:', arg)
        address, params = self._getaddr(arg)
        if not address:
            self.push(syntaxerr)
            return
        if not self.extended_smtp and params:
            self.push(syntaxerr)
            return
        self.rcpt_options = params.upper().split()
        params = self._getparams(self.rcpt_options)
        if params is None:
            self.push(syntaxerr)
            return
        # XXX currently there are no options we recognize.
        if len(params.keys()) > 0:
            self.push('555 RCPT TO parameters not recognized or not implemented')
            return
        self.rcpttos.append(address)
        print('recips:', self.rcpttos, file=DEBUGSTREAM)
        self.push('250 OK')

    def smtp_RSET(self, arg):
        if arg:
            self.push('501 Syntax: RSET')
            return
        self._set_rset_state()
        self.push('250 OK')

    def smtp_DATA(self, arg):
        if not self.seen_greeting:
            self.push('503 Error: send HELO first');
            return
        if not self.rcpttos:
            self.push('503 Error: need RCPT command')
            return
        if arg:
            self.push('501 Syntax: DATA')
            return
        self.smtp_state = self.DATA
        self.set_terminator(b'\r\n.\r\n')
        self.push('354 End data with <CR><LF>.<CR><LF>')

    # Commands that have not been implemented
    def smtp_EXPN(self, arg):
        self.push('502 EXPN not implemented')


class SMTPServer(asyncore.dispatcher):
    # SMTPChannel class to use for managing client connections
    channel_class = SMTPChannel

    def __init__(self, localaddr, remoteaddr,
                 data_size_limit=DATA_SIZE_DEFAULT, map=None,
                 enable_SMTPUTF8=False, decode_data=False):
        self._localaddr = localaddr
        self._remoteaddr = remoteaddr
        self.data_size_limit = data_size_limit
        self.enable_SMTPUTF8 = enable_SMTPUTF8
        self._decode_data = decode_data
        if enable_SMTPUTF8 and decode_data:
            raise ValueError("decode_data and enable_SMTPUTF8 cannot"
                             " be set to True at the same time")
        asyncore.dispatcher.__init__(self, map=map)
        try:
            gai_results = socket.getaddrinfo(*localaddr,
                                             type=socket.SOCK_STREAM)
            self.create_socket(gai_results[0][0], gai_results[0][1])
            # try to re-use a server port if possible
            self.set_reuse_addr()
            self.bind(localaddr)
            self.listen(5)
        except:
            self.close()
            raise
        else:
            print('%s started at %s\n\tLocal addr: %s\n\tRemote addr:%s' % (
                self.__class__.__name__, time.ctime(time.time()),
                localaddr, remoteaddr), file=DEBUGSTREAM)

    def handle_accepted(self, conn, addr):
        print('Incoming connection from %s' % repr(addr), file=DEBUGSTREAM)
        channel = self.channel_class(self,
                                     conn,
                                     addr,
                                     self.data_size_limit,
                                     self._map,
                                     self.enable_SMTPUTF8,
                                     self._decode_data)

    # API for "doing something useful with the message"
    def process_message(self, peer, mailfrom, rcpttos, data, **kwargs):
        """Override this abstract method to handle messages from the client.

        peer is a tuple containing (ipaddr, port) of the client that made the
        socket connection to our smtp port.

        mailfrom is the raw address the client claims the message is coming
        from.

        rcpttos is a list of raw addresses the client wishes to deliver the
        message to.

        data is a string containing the entire full text of the message,
        headers (if supplied) and all.  It has been `de-transparencied'
        according to RFC 821, Section 4.5.2.  In other words, a line
        containing a `.' followed by other text has had the leading dot
        removed.

        kwargs is a dictionary containing additional information.  It is
        empty if decode_data=True was given as init parameter, otherwise
        it will contain the following keys:
            'mail_options': list of parameters to the mail command.  All
                            elements are uppercase strings.  Example:
                            ['BODY=8BITMIME', 'SMTPUTF8'].
            'rcpt_options': same, for the rcpt command.

        This function should return None for a normal `250 Ok' response;
        otherwise, it should return the desired response string in RFC 821
        format.

        """
        raise NotImplementedError


class DebuggingServer(SMTPServer):

    def _print_message_content(self, peer, data):
        inheaders = 1
        lines = data.splitlines()
        for line in lines:
            # headers first
            if inheaders and not line:
                peerheader = 'X-Peer: ' + peer[0]
                if not isinstance(data, str):
                    # decoded_data=false; make header match other binary output
                    peerheader = repr(peerheader.encode('utf-8'))
                print(peerheader)
                inheaders = 0
            if not isinstance(data, str):
                # Avoid spurious 'str on bytes instance' warning.
                line = repr(line)
            print(line)

    def process_message(self, peer, mailfrom, rcpttos, data, **kwargs):
        print('---------- MESSAGE FOLLOWS ----------')
        if kwargs:
            if kwargs.get('mail_options'):
                print('mail options: %s' % kwargs['mail_options'])
            if kwargs.get('rcpt_options'):
                print('rcpt options: %s\n' % kwargs['rcpt_options'])
        self._print_message_content(peer, data)
        print('------------ END MESSAGE ------------')


class PureProxy(SMTPServer):
    def __init__(self, *args, **kwargs):
        if 'enable_SMTPUTF8' in kwargs and kwargs['enable_SMTPUTF8']:
            raise ValueError("PureProxy does not support SMTPUTF8.")
        super(PureProxy, self).__init__(*args, **kwargs)

    def process_message(self, peer, mailfrom, rcpttos, data):
        lines = data.split('\n')
        # Look for the last header
        i = 0
        for line in lines:
            if not line:
                break
            i += 1
        lines.insert(i, 'X-Peer: %s' % peer[0])
        data = NEWLINE.join(lines)
        refused = self._deliver(mailfrom, rcpttos, data)
        # TBD: what to do with refused addresses?
        print('we got some refusals:', refused, file=DEBUGSTREAM)

    def _deliver(self, mailfrom, rcpttos, data):
        import smtplib
        refused = {}
        try:
            s = smtplib.SMTP()
            s.connect(self._remoteaddr[0], self._remoteaddr[1])
            try:
                refused = s.sendmail(mailfrom, rcpttos, data)
            finally:
                s.quit()
        except smtplib.SMTPRecipientsRefused as e:
            print('got SMTPRecipientsRefused', file=DEBUGSTREAM)
            refused = e.recipients
        except (OSError, smtplib.SMTPException) as e:
            print('got', e.__class__, file=DEBUGSTREAM)
            # All recipients were refused.  If the exception had an associated
            # error code, use it.  Otherwise,fake it with a non-triggering
            # exception code.
            errcode = getattr(e, 'smtp_code', -1)
            errmsg = getattr(e, 'smtp_error', 'ignore')
            for r in rcpttos:
                refused[r] = (errcode, errmsg)
        return refused


class MailmanProxy(PureProxy):
    def __init__(self, *args, **kwargs):
        if 'enable_SMTPUTF8' in kwargs and kwargs['enable_SMTPUTF8']:
            raise ValueError("MailmanProxy does not support SMTPUTF8.")
        super(PureProxy, self).__init__(*args, **kwargs)

    def process_message(self, peer, mailfrom, rcpttos, data):
        from io import StringIO
        from Mailman import Utils
        from Mailman import Message
        from Mailman import MailList
        # If the message is to a Mailman mailing list, then we'll invoke the
        # Mailman script directly, without going through the real smtpd.
        # Otherwise we'll forward it to the local proxy for disposition.
        listnames = []
        for rcpt in rcpttos:
            local = rcpt.lower().split('@')[0]
            # We allow the following variations on the theme
            #   listname
            #   listname-admin
            #   listname-owner
            #   listname-request
            #   listname-join
            #   listname-leave
            parts = local.split('-')
            if len(parts) > 2:
                continue
            listname = parts[0]
            if len(parts) == 2:
                command = parts[1]
            else:
                command = ''
            if not Utils.list_exists(listname) or command not in (
                    '', 'admin', 'owner', 'request', 'join', 'leave'):
                continue
            listnames.append((rcpt, listname, command))
        # Remove all list recipients from rcpttos and forward what we're not
        # going to take care of ourselves.  Linear removal should be fine
        # since we don't expect a large number of recipients.
        for rcpt, listname, command in listnames:
            rcpttos.remove(rcpt)
        # If there's any non-list destined recipients left,
        print('forwarding recips:', ' '.join(rcpttos), file=DEBUGSTREAM)
        if rcpttos:
            refused = self._deliver(mailfrom, rcpttos, data)
            # TBD: what to do with refused addresses?
            print('we got refusals:', refused, file=DEBUGSTREAM)
        # Now deliver directly to the list commands
        mlists = {}
        s = StringIO(data)
        msg = Message.Message(s)
        # These headers are required for the proper execution of Mailman.  All
        # MTAs in existence seem to add these if the original message doesn't
        # have them.
        if not msg.get('from'):
            msg['From'] = mailfrom
        if not msg.get('date'):
            msg['Date'] = time.ctime(time.time())
        for rcpt, listname, command in listnames:
            print('sending message to', rcpt, file=DEBUGSTREAM)
            mlist = mlists.get(listname)
            if not mlist:
                mlist = MailList.MailList(listname, lock=0)
                mlists[listname] = mlist
            # dispatch on the type of command
            if command == '':
                # post
                msg.Enqueue(mlist, tolist=1)
            elif command == 'admin':
                msg.Enqueue(mlist, toadmin=1)
            elif command == 'owner':
                msg.Enqueue(mlist, toowner=1)
            elif command == 'request':
                msg.Enqueue(mlist, torequest=1)
            elif command in ('join', 'leave'):
                # TBD: this is a hack!
                if command == 'join':
                    msg['Subject'] = 'subscribe'
                else:
                    msg['Subject'] = 'unsubscribe'
                msg.Enqueue(mlist, torequest=1)


class Options:
    setuid = True
    classname = 'PureProxy'
    size_limit = None
    enable_SMTPUTF8 = False


def parseargs():
    global DEBUGSTREAM
    try:
        opts, args = getopt.getopt(
            sys.argv[1:], 'nVhc:s:du',
            ['class=', 'nosetuid', 'version', 'help', 'size=', 'debug',
             'smtputf8'])
    except getopt.error as e:
        usage(1, e)

    options = Options()
    for opt, arg in opts:
        if opt in ('-h', '--help'):
            usage(0)
        elif opt in ('-V', '--version'):
            print(__version__)
            sys.exit(0)
        elif opt in ('-n', '--nosetuid'):
            options.setuid = False
        elif opt in ('-c', '--class'):
            options.classname = arg
        elif opt in ('-d', '--debug'):
            DEBUGSTREAM = sys.stderr
        elif opt in ('-u', '--smtputf8'):
            options.enable_SMTPUTF8 = True
        elif opt in ('-s', '--size'):
            try:
                int_size = int(arg)
                options.size_limit = int_size
            except:
                print('Invalid size: ' + arg, file=sys.stderr)
                sys.exit(1)

    # parse the rest of the arguments
    if len(args) < 1:
        localspec = 'localhost:8025'
        remotespec = 'localhost:25'
    elif len(args) < 2:
        localspec = args[0]
        remotespec = 'localhost:25'
    elif len(args) < 3:
        localspec = args[0]
        remotespec = args[1]
    else:
        usage(1, 'Invalid arguments: %s' % COMMASPACE.join(args))

    # split into host/port pairs
    i = localspec.find(':')
    if i < 0:
        usage(1, 'Bad local spec: %s' % localspec)
    options.localhost = localspec[:i]
    try:
        options.localport = int(localspec[i+1:])
    except ValueError:
        usage(1, 'Bad local port: %s' % localspec)
    i = remotespec.find(':')
    if i < 0:
        usage(1, 'Bad remote spec: %s' % remotespec)
    options.remotehost = remotespec[:i]
    try:
        options.remoteport = int(remotespec[i+1:])
    except ValueError:
        usage(1, 'Bad remote port: %s' % remotespec)
    return options


if __name__ == '__main__':
    options = parseargs()
    # Become nobody
    classname = options.classname
    if "." in classname:
        lastdot = classname.rfind(".")
        mod = __import__(classname[:lastdot], globals(), locals(), [""])
        classname = classname[lastdot+1:]
    else:
        import __main__ as mod
    class_ = getattr(mod, classname)
    proxy = class_((options.localhost, options.localport),
                   (options.remotehost, options.remoteport),
                   options.size_limit, enable_SMTPUTF8=options.enable_SMTPUTF8)
    if options.setuid:
        try:
            import pwd
        except ImportError:
            print('Cannot import module "pwd"; try running with -n option.', file=sys.stderr)
            sys.exit(1)
        nobody = pwd.getpwnam('nobody')[2]
        try:
            os.setuid(nobody)
        except PermissionError:
            print('Cannot setuid "nobody"; try running with -n option.', file=sys.stderr)
            sys.exit(1)
    try:
        asyncore.loop()
    except KeyboardInterrupt:
        pass
weakref.py000064400000051613151153537610006557 0ustar00"""Weak reference support for Python.

This module is an implementation of PEP 205:

http://www.python.org/dev/peps/pep-0205/
"""

# Naming convention: Variables named "wr" are weak reference objects;
# they are called this instead of "ref" to avoid name collisions with
# the module-global ref() function imported from _weakref.

from _weakref import (
     getweakrefcount,
     getweakrefs,
     ref,
     proxy,
     CallableProxyType,
     ProxyType,
     ReferenceType,
     _remove_dead_weakref)

from _weakrefset import WeakSet, _IterationGuard

import _collections_abc  # Import after _weakref to avoid circular import.
import sys
import itertools

ProxyTypes = (ProxyType, CallableProxyType)

__all__ = ["ref", "proxy", "getweakrefcount", "getweakrefs",
           "WeakKeyDictionary", "ReferenceType", "ProxyType",
           "CallableProxyType", "ProxyTypes", "WeakValueDictionary",
           "WeakSet", "WeakMethod", "finalize"]


class WeakMethod(ref):
    """
    A custom `weakref.ref` subclass which simulates a weak reference to
    a bound method, working around the lifetime problem of bound methods.
    """

    __slots__ = "_func_ref", "_meth_type", "_alive", "__weakref__"

    def __new__(cls, meth, callback=None):
        try:
            obj = meth.__self__
            func = meth.__func__
        except AttributeError:
            raise TypeError("argument should be a bound method, not {}"
                            .format(type(meth))) from None
        def _cb(arg):
            # The self-weakref trick is needed to avoid creating a reference
            # cycle.
            self = self_wr()
            if self._alive:
                self._alive = False
                if callback is not None:
                    callback(self)
        self = ref.__new__(cls, obj, _cb)
        self._func_ref = ref(func, _cb)
        self._meth_type = type(meth)
        self._alive = True
        self_wr = ref(self)
        return self

    def __call__(self):
        obj = super().__call__()
        func = self._func_ref()
        if obj is None or func is None:
            return None
        return self._meth_type(func, obj)

    def __eq__(self, other):
        if isinstance(other, WeakMethod):
            if not self._alive or not other._alive:
                return self is other
            return ref.__eq__(self, other) and self._func_ref == other._func_ref
        return False

    def __ne__(self, other):
        if isinstance(other, WeakMethod):
            if not self._alive or not other._alive:
                return self is not other
            return ref.__ne__(self, other) or self._func_ref != other._func_ref
        return True

    __hash__ = ref.__hash__


class WeakValueDictionary(_collections_abc.MutableMapping):
    """Mapping class that references values weakly.

    Entries in the dictionary will be discarded when no strong
    reference to the value exists anymore
    """
    # We inherit the constructor without worrying about the input
    # dictionary; since it uses our .update() method, we get the right
    # checks (if the other dictionary is a WeakValueDictionary,
    # objects are unwrapped on the way out, and we always wrap on the
    # way in).

    def __init__(self, other=(), /, **kw):
        def remove(wr, selfref=ref(self), _atomic_removal=_remove_dead_weakref):
            self = selfref()
            if self is not None:
                if self._iterating:
                    self._pending_removals.append(wr.key)
                else:
                    # Atomic removal is necessary since this function
                    # can be called asynchronously by the GC
                    _atomic_removal(self.data, wr.key)
        self._remove = remove
        # A list of keys to be removed
        self._pending_removals = []
        self._iterating = set()
        self.data = {}
        self.update(other, **kw)

    def _commit_removals(self):
        l = self._pending_removals
        d = self.data
        # We shouldn't encounter any KeyError, because this method should
        # always be called *before* mutating the dict.
        while l:
            key = l.pop()
            _remove_dead_weakref(d, key)

    def __getitem__(self, key):
        if self._pending_removals:
            self._commit_removals()
        o = self.data[key]()
        if o is None:
            raise KeyError(key)
        else:
            return o

    def __delitem__(self, key):
        if self._pending_removals:
            self._commit_removals()
        del self.data[key]

    def __len__(self):
        if self._pending_removals:
            self._commit_removals()
        return len(self.data)

    def __contains__(self, key):
        if self._pending_removals:
            self._commit_removals()
        try:
            o = self.data[key]()
        except KeyError:
            return False
        return o is not None

    def __repr__(self):
        return "<%s at %#x>" % (self.__class__.__name__, id(self))

    def __setitem__(self, key, value):
        if self._pending_removals:
            self._commit_removals()
        self.data[key] = KeyedRef(value, self._remove, key)

    def copy(self):
        if self._pending_removals:
            self._commit_removals()
        new = WeakValueDictionary()
        with _IterationGuard(self):
            for key, wr in self.data.items():
                o = wr()
                if o is not None:
                    new[key] = o
        return new

    __copy__ = copy

    def __deepcopy__(self, memo):
        from copy import deepcopy
        if self._pending_removals:
            self._commit_removals()
        new = self.__class__()
        with _IterationGuard(self):
            for key, wr in self.data.items():
                o = wr()
                if o is not None:
                    new[deepcopy(key, memo)] = o
        return new

    def get(self, key, default=None):
        if self._pending_removals:
            self._commit_removals()
        try:
            wr = self.data[key]
        except KeyError:
            return default
        else:
            o = wr()
            if o is None:
                # This should only happen
                return default
            else:
                return o

    def items(self):
        if self._pending_removals:
            self._commit_removals()
        with _IterationGuard(self):
            for k, wr in self.data.items():
                v = wr()
                if v is not None:
                    yield k, v

    def keys(self):
        if self._pending_removals:
            self._commit_removals()
        with _IterationGuard(self):
            for k, wr in self.data.items():
                if wr() is not None:
                    yield k

    __iter__ = keys

    def itervaluerefs(self):
        """Return an iterator that yields the weak references to the values.

        The references are not guaranteed to be 'live' at the time
        they are used, so the result of calling the references needs
        to be checked before being used.  This can be used to avoid
        creating references that will cause the garbage collector to
        keep the values around longer than needed.

        """
        if self._pending_removals:
            self._commit_removals()
        with _IterationGuard(self):
            yield from self.data.values()

    def values(self):
        if self._pending_removals:
            self._commit_removals()
        with _IterationGuard(self):
            for wr in self.data.values():
                obj = wr()
                if obj is not None:
                    yield obj

    def popitem(self):
        if self._pending_removals:
            self._commit_removals()
        while True:
            key, wr = self.data.popitem()
            o = wr()
            if o is not None:
                return key, o

    def pop(self, key, *args):
        if self._pending_removals:
            self._commit_removals()
        try:
            o = self.data.pop(key)()
        except KeyError:
            o = None
        if o is None:
            if args:
                return args[0]
            else:
                raise KeyError(key)
        else:
            return o

    def setdefault(self, key, default=None):
        try:
            o = self.data[key]()
        except KeyError:
            o = None
        if o is None:
            if self._pending_removals:
                self._commit_removals()
            self.data[key] = KeyedRef(default, self._remove, key)
            return default
        else:
            return o

    def update(self, other=None, /, **kwargs):
        if self._pending_removals:
            self._commit_removals()
        d = self.data
        if other is not None:
            if not hasattr(other, "items"):
                other = dict(other)
            for key, o in other.items():
                d[key] = KeyedRef(o, self._remove, key)
        for key, o in kwargs.items():
            d[key] = KeyedRef(o, self._remove, key)

    def valuerefs(self):
        """Return a list of weak references to the values.

        The references are not guaranteed to be 'live' at the time
        they are used, so the result of calling the references needs
        to be checked before being used.  This can be used to avoid
        creating references that will cause the garbage collector to
        keep the values around longer than needed.

        """
        if self._pending_removals:
            self._commit_removals()
        return list(self.data.values())


class KeyedRef(ref):
    """Specialized reference that includes a key corresponding to the value.

    This is used in the WeakValueDictionary to avoid having to create
    a function object for each key stored in the mapping.  A shared
    callback object can use the 'key' attribute of a KeyedRef instead
    of getting a reference to the key from an enclosing scope.

    """

    __slots__ = "key",

    def __new__(type, ob, callback, key):
        self = ref.__new__(type, ob, callback)
        self.key = key
        return self

    def __init__(self, ob, callback, key):
        super().__init__(ob, callback)


class WeakKeyDictionary(_collections_abc.MutableMapping):
    """ Mapping class that references keys weakly.

    Entries in the dictionary will be discarded when there is no
    longer a strong reference to the key. This can be used to
    associate additional data with an object owned by other parts of
    an application without adding attributes to those objects. This
    can be especially useful with objects that override attribute
    accesses.
    """

    def __init__(self, dict=None):
        self.data = {}
        def remove(k, selfref=ref(self)):
            self = selfref()
            if self is not None:
                if self._iterating:
                    self._pending_removals.append(k)
                else:
                    del self.data[k]
        self._remove = remove
        # A list of dead weakrefs (keys to be removed)
        self._pending_removals = []
        self._iterating = set()
        self._dirty_len = False
        if dict is not None:
            self.update(dict)

    def _commit_removals(self):
        # NOTE: We don't need to call this method before mutating the dict,
        # because a dead weakref never compares equal to a live weakref,
        # even if they happened to refer to equal objects.
        # However, it means keys may already have been removed.
        l = self._pending_removals
        d = self.data
        while l:
            try:
                del d[l.pop()]
            except KeyError:
                pass

    def _scrub_removals(self):
        d = self.data
        self._pending_removals = [k for k in self._pending_removals if k in d]
        self._dirty_len = False

    def __delitem__(self, key):
        self._dirty_len = True
        del self.data[ref(key)]

    def __getitem__(self, key):
        return self.data[ref(key)]

    def __len__(self):
        if self._dirty_len and self._pending_removals:
            # self._pending_removals may still contain keys which were
            # explicitly removed, we have to scrub them (see issue #21173).
            self._scrub_removals()
        return len(self.data) - len(self._pending_removals)

    def __repr__(self):
        return "<%s at %#x>" % (self.__class__.__name__, id(self))

    def __setitem__(self, key, value):
        self.data[ref(key, self._remove)] = value

    def copy(self):
        new = WeakKeyDictionary()
        with _IterationGuard(self):
            for key, value in self.data.items():
                o = key()
                if o is not None:
                    new[o] = value
        return new

    __copy__ = copy

    def __deepcopy__(self, memo):
        from copy import deepcopy
        new = self.__class__()
        with _IterationGuard(self):
            for key, value in self.data.items():
                o = key()
                if o is not None:
                    new[o] = deepcopy(value, memo)
        return new

    def get(self, key, default=None):
        return self.data.get(ref(key),default)

    def __contains__(self, key):
        try:
            wr = ref(key)
        except TypeError:
            return False
        return wr in self.data

    def items(self):
        with _IterationGuard(self):
            for wr, value in self.data.items():
                key = wr()
                if key is not None:
                    yield key, value

    def keys(self):
        with _IterationGuard(self):
            for wr in self.data:
                obj = wr()
                if obj is not None:
                    yield obj

    __iter__ = keys

    def values(self):
        with _IterationGuard(self):
            for wr, value in self.data.items():
                if wr() is not None:
                    yield value

    def keyrefs(self):
        """Return a list of weak references to the keys.

        The references are not guaranteed to be 'live' at the time
        they are used, so the result of calling the references needs
        to be checked before being used.  This can be used to avoid
        creating references that will cause the garbage collector to
        keep the keys around longer than needed.

        """
        return list(self.data)

    def popitem(self):
        self._dirty_len = True
        while True:
            key, value = self.data.popitem()
            o = key()
            if o is not None:
                return o, value

    def pop(self, key, *args):
        self._dirty_len = True
        return self.data.pop(ref(key), *args)

    def setdefault(self, key, default=None):
        return self.data.setdefault(ref(key, self._remove),default)

    def update(self, dict=None, /, **kwargs):
        d = self.data
        if dict is not None:
            if not hasattr(dict, "items"):
                dict = type({})(dict)
            for key, value in dict.items():
                d[ref(key, self._remove)] = value
        if len(kwargs):
            self.update(kwargs)


class finalize:
    """Class for finalization of weakrefable objects

    finalize(obj, func, *args, **kwargs) returns a callable finalizer
    object which will be called when obj is garbage collected. The
    first time the finalizer is called it evaluates func(*arg, **kwargs)
    and returns the result. After this the finalizer is dead, and
    calling it just returns None.

    When the program exits any remaining finalizers for which the
    atexit attribute is true will be run in reverse order of creation.
    By default atexit is true.
    """

    # Finalizer objects don't have any state of their own.  They are
    # just used as keys to lookup _Info objects in the registry.  This
    # ensures that they cannot be part of a ref-cycle.

    __slots__ = ()
    _registry = {}
    _shutdown = False
    _index_iter = itertools.count()
    _dirty = False
    _registered_with_atexit = False

    class _Info:
        __slots__ = ("weakref", "func", "args", "kwargs", "atexit", "index")

    def __init__(*args, **kwargs):
        if len(args) >= 3:
            self, obj, func, *args = args
        elif not args:
            raise TypeError("descriptor '__init__' of 'finalize' object "
                            "needs an argument")
        else:
            if 'func' not in kwargs:
                raise TypeError('finalize expected at least 2 positional '
                                'arguments, got %d' % (len(args)-1))
            func = kwargs.pop('func')
            if len(args) >= 2:
                self, obj, *args = args
                import warnings
                warnings.warn("Passing 'func' as keyword argument is deprecated",
                              DeprecationWarning, stacklevel=2)
            else:
                if 'obj' not in kwargs:
                    raise TypeError('finalize expected at least 2 positional '
                                    'arguments, got %d' % (len(args)-1))
                obj = kwargs.pop('obj')
                self, *args = args
                import warnings
                warnings.warn("Passing 'obj' as keyword argument is deprecated",
                              DeprecationWarning, stacklevel=2)
        args = tuple(args)

        if not self._registered_with_atexit:
            # We may register the exit function more than once because
            # of a thread race, but that is harmless
            import atexit
            atexit.register(self._exitfunc)
            finalize._registered_with_atexit = True
        info = self._Info()
        info.weakref = ref(obj, self)
        info.func = func
        info.args = args
        info.kwargs = kwargs or None
        info.atexit = True
        info.index = next(self._index_iter)
        self._registry[self] = info
        finalize._dirty = True
    __init__.__text_signature__ = '($self, obj, func, /, *args, **kwargs)'

    def __call__(self, _=None):
        """If alive then mark as dead and return func(*args, **kwargs);
        otherwise return None"""
        info = self._registry.pop(self, None)
        if info and not self._shutdown:
            return info.func(*info.args, **(info.kwargs or {}))

    def detach(self):
        """If alive then mark as dead and return (obj, func, args, kwargs);
        otherwise return None"""
        info = self._registry.get(self)
        obj = info and info.weakref()
        if obj is not None and self._registry.pop(self, None):
            return (obj, info.func, info.args, info.kwargs or {})

    def peek(self):
        """If alive then return (obj, func, args, kwargs);
        otherwise return None"""
        info = self._registry.get(self)
        obj = info and info.weakref()
        if obj is not None:
            return (obj, info.func, info.args, info.kwargs or {})

    @property
    def alive(self):
        """Whether finalizer is alive"""
        return self in self._registry

    @property
    def atexit(self):
        """Whether finalizer should be called at exit"""
        info = self._registry.get(self)
        return bool(info) and info.atexit

    @atexit.setter
    def atexit(self, value):
        info = self._registry.get(self)
        if info:
            info.atexit = bool(value)

    def __repr__(self):
        info = self._registry.get(self)
        obj = info and info.weakref()
        if obj is None:
            return '<%s object at %#x; dead>' % (type(self).__name__, id(self))
        else:
            return '<%s object at %#x; for %r at %#x>' % \
                (type(self).__name__, id(self), type(obj).__name__, id(obj))

    @classmethod
    def _select_for_exit(cls):
        # Return live finalizers marked for exit, oldest first
        L = [(f,i) for (f,i) in cls._registry.items() if i.atexit]
        L.sort(key=lambda item:item[1].index)
        return [f for (f,i) in L]

    @classmethod
    def _exitfunc(cls):
        # At shutdown invoke finalizers for which atexit is true.
        # This is called once all other non-daemonic threads have been
        # joined.
        reenable_gc = False
        try:
            if cls._registry:
                import gc
                if gc.isenabled():
                    reenable_gc = True
                    gc.disable()
                pending = None
                while True:
                    if pending is None or finalize._dirty:
                        pending = cls._select_for_exit()
                        finalize._dirty = False
                    if not pending:
                        break
                    f = pending.pop()
                    try:
                        # gc is disabled, so (assuming no daemonic
                        # threads) the following is the only line in
                        # this function which might trigger creation
                        # of a new finalizer
                        f()
                    except Exception:
                        sys.excepthook(*sys.exc_info())
                    assert f not in cls._registry
        finally:
            # prevent any more finalizers from executing during shutdown
            finalize._shutdown = True
            if reenable_gc:
                gc.enable()
_py_abc.py000064400000014055151153537610006526 0ustar00from _weakrefset import WeakSet


def get_cache_token():
    """Returns the current ABC cache token.

    The token is an opaque object (supporting equality testing) identifying the
    current version of the ABC cache for virtual subclasses. The token changes
    with every call to ``register()`` on any ABC.
    """
    return ABCMeta._abc_invalidation_counter


class ABCMeta(type):
    """Metaclass for defining Abstract Base Classes (ABCs).

    Use this metaclass to create an ABC.  An ABC can be subclassed
    directly, and then acts as a mix-in class.  You can also register
    unrelated concrete classes (even built-in classes) and unrelated
    ABCs as 'virtual subclasses' -- these and their descendants will
    be considered subclasses of the registering ABC by the built-in
    issubclass() function, but the registering ABC won't show up in
    their MRO (Method Resolution Order) nor will method
    implementations defined by the registering ABC be callable (not
    even via super()).
    """

    # A global counter that is incremented each time a class is
    # registered as a virtual subclass of anything.  It forces the
    # negative cache to be cleared before its next use.
    # Note: this counter is private. Use `abc.get_cache_token()` for
    #       external code.
    _abc_invalidation_counter = 0

    def __new__(mcls, name, bases, namespace, /, **kwargs):
        cls = super().__new__(mcls, name, bases, namespace, **kwargs)
        # Compute set of abstract method names
        abstracts = {name
                     for name, value in namespace.items()
                     if getattr(value, "__isabstractmethod__", False)}
        for base in bases:
            for name in getattr(base, "__abstractmethods__", set()):
                value = getattr(cls, name, None)
                if getattr(value, "__isabstractmethod__", False):
                    abstracts.add(name)
        cls.__abstractmethods__ = frozenset(abstracts)
        # Set up inheritance registry
        cls._abc_registry = WeakSet()
        cls._abc_cache = WeakSet()
        cls._abc_negative_cache = WeakSet()
        cls._abc_negative_cache_version = ABCMeta._abc_invalidation_counter
        return cls

    def register(cls, subclass):
        """Register a virtual subclass of an ABC.

        Returns the subclass, to allow usage as a class decorator.
        """
        if not isinstance(subclass, type):
            raise TypeError("Can only register classes")
        if issubclass(subclass, cls):
            return subclass  # Already a subclass
        # Subtle: test for cycles *after* testing for "already a subclass";
        # this means we allow X.register(X) and interpret it as a no-op.
        if issubclass(cls, subclass):
            # This would create a cycle, which is bad for the algorithm below
            raise RuntimeError("Refusing to create an inheritance cycle")
        cls._abc_registry.add(subclass)
        ABCMeta._abc_invalidation_counter += 1  # Invalidate negative cache
        return subclass

    def _dump_registry(cls, file=None):
        """Debug helper to print the ABC registry."""
        print(f"Class: {cls.__module__}.{cls.__qualname__}", file=file)
        print(f"Inv. counter: {get_cache_token()}", file=file)
        for name in cls.__dict__:
            if name.startswith("_abc_"):
                value = getattr(cls, name)
                if isinstance(value, WeakSet):
                    value = set(value)
                print(f"{name}: {value!r}", file=file)

    def _abc_registry_clear(cls):
        """Clear the registry (for debugging or testing)."""
        cls._abc_registry.clear()

    def _abc_caches_clear(cls):
        """Clear the caches (for debugging or testing)."""
        cls._abc_cache.clear()
        cls._abc_negative_cache.clear()

    def __instancecheck__(cls, instance):
        """Override for isinstance(instance, cls)."""
        # Inline the cache checking
        subclass = instance.__class__
        if subclass in cls._abc_cache:
            return True
        subtype = type(instance)
        if subtype is subclass:
            if (cls._abc_negative_cache_version ==
                ABCMeta._abc_invalidation_counter and
                subclass in cls._abc_negative_cache):
                return False
            # Fall back to the subclass check.
            return cls.__subclasscheck__(subclass)
        return any(cls.__subclasscheck__(c) for c in (subclass, subtype))

    def __subclasscheck__(cls, subclass):
        """Override for issubclass(subclass, cls)."""
        if not isinstance(subclass, type):
            raise TypeError('issubclass() arg 1 must be a class')
        # Check cache
        if subclass in cls._abc_cache:
            return True
        # Check negative cache; may have to invalidate
        if cls._abc_negative_cache_version < ABCMeta._abc_invalidation_counter:
            # Invalidate the negative cache
            cls._abc_negative_cache = WeakSet()
            cls._abc_negative_cache_version = ABCMeta._abc_invalidation_counter
        elif subclass in cls._abc_negative_cache:
            return False
        # Check the subclass hook
        ok = cls.__subclasshook__(subclass)
        if ok is not NotImplemented:
            assert isinstance(ok, bool)
            if ok:
                cls._abc_cache.add(subclass)
            else:
                cls._abc_negative_cache.add(subclass)
            return ok
        # Check if it's a direct subclass
        if cls in getattr(subclass, '__mro__', ()):
            cls._abc_cache.add(subclass)
            return True
        # Check if it's a subclass of a registered class (recursive)
        for rcls in cls._abc_registry:
            if issubclass(subclass, rcls):
                cls._abc_cache.add(subclass)
                return True
        # Check if it's a subclass of a subclass (recursive)
        for scls in cls.__subclasses__():
            if issubclass(subclass, scls):
                cls._abc_cache.add(subclass)
                return True
        # No dice; update negative cache
        cls._abc_negative_cache.add(subclass)
        return False
_bootlocale.py000064400000003411151153537610007406 0ustar00"""A minimal subset of the locale module used at interpreter startup
(imported by the _io module), in order to reduce startup time.

Don't import directly from third-party code; use the `locale` module instead!
"""

import sys
import _locale

if sys.platform.startswith("win"):
    def getpreferredencoding(do_setlocale=True):
        if sys.flags.utf8_mode:
            return 'UTF-8'
        return _locale._getdefaultlocale()[1]
else:
    try:
        _locale.CODESET
    except AttributeError:
        if hasattr(sys, 'getandroidapilevel'):
            # On Android langinfo.h and CODESET are missing, and UTF-8 is
            # always used in mbstowcs() and wcstombs().
            def getpreferredencoding(do_setlocale=True):
                return 'UTF-8'
        else:
            def getpreferredencoding(do_setlocale=True):
                if sys.flags.utf8_mode:
                    return 'UTF-8'
                # This path for legacy systems needs the more complex
                # getdefaultlocale() function, import the full locale module.
                import locale
                return locale.getpreferredencoding(do_setlocale)
    else:
        def getpreferredencoding(do_setlocale=True):
            assert not do_setlocale
            if sys.flags.utf8_mode:
                return 'UTF-8'
            result = _locale.nl_langinfo(_locale.CODESET)
            if not result and sys.platform == 'darwin':
                # nl_langinfo can return an empty string
                # when the setting has an invalid value.
                # Default to UTF-8 in that case because
                # UTF-8 is the default charset on OSX and
                # returning nothing will crash the
                # interpreter.
                result = 'UTF-8'
            return result
code.py000064400000024576151153537610006055 0ustar00"""Utilities needed to emulate Python's interactive interpreter.

"""

# Inspired by similar code by Jeff Epler and Fredrik Lundh.


import sys
import traceback
from codeop import CommandCompiler, compile_command

__all__ = ["InteractiveInterpreter", "InteractiveConsole", "interact",
           "compile_command"]

class InteractiveInterpreter:
    """Base class for InteractiveConsole.

    This class deals with parsing and interpreter state (the user's
    namespace); it doesn't deal with input buffering or prompting or
    input file naming (the filename is always passed in explicitly).

    """

    def __init__(self, locals=None):
        """Constructor.

        The optional 'locals' argument specifies the dictionary in
        which code will be executed; it defaults to a newly created
        dictionary with key "__name__" set to "__console__" and key
        "__doc__" set to None.

        """
        if locals is None:
            locals = {"__name__": "__console__", "__doc__": None}
        self.locals = locals
        self.compile = CommandCompiler()

    def runsource(self, source, filename="<input>", symbol="single"):
        """Compile and run some source in the interpreter.

        Arguments are as for compile_command().

        One of several things can happen:

        1) The input is incorrect; compile_command() raised an
        exception (SyntaxError or OverflowError).  A syntax traceback
        will be printed by calling the showsyntaxerror() method.

        2) The input is incomplete, and more input is required;
        compile_command() returned None.  Nothing happens.

        3) The input is complete; compile_command() returned a code
        object.  The code is executed by calling self.runcode() (which
        also handles run-time exceptions, except for SystemExit).

        The return value is True in case 2, False in the other cases (unless
        an exception is raised).  The return value can be used to
        decide whether to use sys.ps1 or sys.ps2 to prompt the next
        line.

        """
        try:
            code = self.compile(source, filename, symbol)
        except (OverflowError, SyntaxError, ValueError):
            # Case 1
            self.showsyntaxerror(filename)
            return False

        if code is None:
            # Case 2
            return True

        # Case 3
        self.runcode(code)
        return False

    def runcode(self, code):
        """Execute a code object.

        When an exception occurs, self.showtraceback() is called to
        display a traceback.  All exceptions are caught except
        SystemExit, which is reraised.

        A note about KeyboardInterrupt: this exception may occur
        elsewhere in this code, and may not always be caught.  The
        caller should be prepared to deal with it.

        """
        try:
            exec(code, self.locals)
        except SystemExit:
            raise
        except:
            self.showtraceback()

    def showsyntaxerror(self, filename=None):
        """Display the syntax error that just occurred.

        This doesn't display a stack trace because there isn't one.

        If a filename is given, it is stuffed in the exception instead
        of what was there before (because Python's parser always uses
        "<string>" when reading from a string).

        The output is written by self.write(), below.

        """
        type, value, tb = sys.exc_info()
        sys.last_type = type
        sys.last_value = value
        sys.last_traceback = tb
        if filename and type is SyntaxError:
            # Work hard to stuff the correct filename in the exception
            try:
                msg, (dummy_filename, lineno, offset, line) = value.args
            except ValueError:
                # Not the format we expect; leave it alone
                pass
            else:
                # Stuff in the right filename
                value = SyntaxError(msg, (filename, lineno, offset, line))
                sys.last_value = value
        if sys.excepthook is sys.__excepthook__:
            lines = traceback.format_exception_only(type, value)
            self.write(''.join(lines))
        else:
            # If someone has set sys.excepthook, we let that take precedence
            # over self.write
            sys.excepthook(type, value, tb)

    def showtraceback(self):
        """Display the exception that just occurred.

        We remove the first stack item because it is our own code.

        The output is written by self.write(), below.

        """
        sys.last_type, sys.last_value, last_tb = ei = sys.exc_info()
        sys.last_traceback = last_tb
        try:
            lines = traceback.format_exception(ei[0], ei[1], last_tb.tb_next)
            if sys.excepthook is sys.__excepthook__:
                self.write(''.join(lines))
            else:
                # If someone has set sys.excepthook, we let that take precedence
                # over self.write
                sys.excepthook(ei[0], ei[1], last_tb)
        finally:
            last_tb = ei = None

    def write(self, data):
        """Write a string.

        The base implementation writes to sys.stderr; a subclass may
        replace this with a different implementation.

        """
        sys.stderr.write(data)


class InteractiveConsole(InteractiveInterpreter):
    """Closely emulate the behavior of the interactive Python interpreter.

    This class builds on InteractiveInterpreter and adds prompting
    using the familiar sys.ps1 and sys.ps2, and input buffering.

    """

    def __init__(self, locals=None, filename="<console>"):
        """Constructor.

        The optional locals argument will be passed to the
        InteractiveInterpreter base class.

        The optional filename argument should specify the (file)name
        of the input stream; it will show up in tracebacks.

        """
        InteractiveInterpreter.__init__(self, locals)
        self.filename = filename
        self.resetbuffer()

    def resetbuffer(self):
        """Reset the input buffer."""
        self.buffer = []

    def interact(self, banner=None, exitmsg=None):
        """Closely emulate the interactive Python console.

        The optional banner argument specifies the banner to print
        before the first interaction; by default it prints a banner
        similar to the one printed by the real Python interpreter,
        followed by the current class name in parentheses (so as not
        to confuse this with the real interpreter -- since it's so
        close!).

        The optional exitmsg argument specifies the exit message
        printed when exiting. Pass the empty string to suppress
        printing an exit message. If exitmsg is not given or None,
        a default message is printed.

        """
        try:
            sys.ps1
        except AttributeError:
            sys.ps1 = ">>> "
        try:
            sys.ps2
        except AttributeError:
            sys.ps2 = "... "
        cprt = 'Type "help", "copyright", "credits" or "license" for more information.'
        if banner is None:
            self.write("Python %s on %s\n%s\n(%s)\n" %
                       (sys.version, sys.platform, cprt,
                        self.__class__.__name__))
        elif banner:
            self.write("%s\n" % str(banner))
        more = 0
        while 1:
            try:
                if more:
                    prompt = sys.ps2
                else:
                    prompt = sys.ps1
                try:
                    line = self.raw_input(prompt)
                except EOFError:
                    self.write("\n")
                    break
                else:
                    more = self.push(line)
            except KeyboardInterrupt:
                self.write("\nKeyboardInterrupt\n")
                self.resetbuffer()
                more = 0
        if exitmsg is None:
            self.write('now exiting %s...\n' % self.__class__.__name__)
        elif exitmsg != '':
            self.write('%s\n' % exitmsg)

    def push(self, line):
        """Push a line to the interpreter.

        The line should not have a trailing newline; it may have
        internal newlines.  The line is appended to a buffer and the
        interpreter's runsource() method is called with the
        concatenated contents of the buffer as source.  If this
        indicates that the command was executed or invalid, the buffer
        is reset; otherwise, the command is incomplete, and the buffer
        is left as it was after the line was appended.  The return
        value is 1 if more input is required, 0 if the line was dealt
        with in some way (this is the same as runsource()).

        """
        self.buffer.append(line)
        source = "\n".join(self.buffer)
        more = self.runsource(source, self.filename)
        if not more:
            self.resetbuffer()
        return more

    def raw_input(self, prompt=""):
        """Write a prompt and read a line.

        The returned line does not include the trailing newline.
        When the user enters the EOF key sequence, EOFError is raised.

        The base implementation uses the built-in function
        input(); a subclass may replace this with a different
        implementation.

        """
        return input(prompt)



def interact(banner=None, readfunc=None, local=None, exitmsg=None):
    """Closely emulate the interactive Python interpreter.

    This is a backwards compatible interface to the InteractiveConsole
    class.  When readfunc is not specified, it attempts to import the
    readline module to enable GNU readline if it is available.

    Arguments (all optional, all default to None):

    banner -- passed to InteractiveConsole.interact()
    readfunc -- if not None, replaces InteractiveConsole.raw_input()
    local -- passed to InteractiveInterpreter.__init__()
    exitmsg -- passed to InteractiveConsole.interact()

    """
    console = InteractiveConsole(local)
    if readfunc is not None:
        console.raw_input = readfunc
    else:
        try:
            import readline
        except ImportError:
            pass
    console.interact(banner, exitmsg)


if __name__ == "__main__":
    import argparse

    parser = argparse.ArgumentParser()
    parser.add_argument('-q', action='store_true',
                       help="don't print version and copyright messages")
    args = parser.parse_args()
    if args.q or sys.flags.quiet:
        banner = ''
    else:
        banner = None
    interact(banner)
pathlib.py000064400000146602151153537610006561 0ustar00import fnmatch
import functools
import io
import ntpath
import os
import posixpath
import re
import sys
from _collections_abc import Sequence
from errno import EINVAL, ENOENT, ENOTDIR, EBADF, ELOOP
from operator import attrgetter
from stat import S_ISDIR, S_ISLNK, S_ISREG, S_ISSOCK, S_ISBLK, S_ISCHR, S_ISFIFO
from urllib.parse import quote_from_bytes as urlquote_from_bytes


supports_symlinks = True
if os.name == 'nt':
    import nt
    if sys.getwindowsversion()[:2] >= (6, 0):
        from nt import _getfinalpathname
    else:
        supports_symlinks = False
        _getfinalpathname = None
else:
    nt = None


__all__ = [
    "PurePath", "PurePosixPath", "PureWindowsPath",
    "Path", "PosixPath", "WindowsPath",
    ]

#
# Internals
#

# EBADF - guard against macOS `stat` throwing EBADF
_IGNORED_ERROS = (ENOENT, ENOTDIR, EBADF, ELOOP)

_IGNORED_WINERRORS = (
    21,  # ERROR_NOT_READY - drive exists but is not accessible
    123, # ERROR_INVALID_NAME - fix for bpo-35306
    1921,  # ERROR_CANT_RESOLVE_FILENAME - fix for broken symlink pointing to itself
)

def _ignore_error(exception):
    return (getattr(exception, 'errno', None) in _IGNORED_ERROS or
            getattr(exception, 'winerror', None) in _IGNORED_WINERRORS)


def _is_wildcard_pattern(pat):
    # Whether this pattern needs actual matching using fnmatch, or can
    # be looked up directly as a file.
    return "*" in pat or "?" in pat or "[" in pat


class _Flavour(object):
    """A flavour implements a particular (platform-specific) set of path
    semantics."""

    def __init__(self):
        self.join = self.sep.join

    def parse_parts(self, parts):
        parsed = []
        sep = self.sep
        altsep = self.altsep
        drv = root = ''
        it = reversed(parts)
        for part in it:
            if not part:
                continue
            if altsep:
                part = part.replace(altsep, sep)
            drv, root, rel = self.splitroot(part)
            if sep in rel:
                for x in reversed(rel.split(sep)):
                    if x and x != '.':
                        parsed.append(sys.intern(x))
            else:
                if rel and rel != '.':
                    parsed.append(sys.intern(rel))
            if drv or root:
                if not drv:
                    # If no drive is present, try to find one in the previous
                    # parts. This makes the result of parsing e.g.
                    # ("C:", "/", "a") reasonably intuitive.
                    for part in it:
                        if not part:
                            continue
                        if altsep:
                            part = part.replace(altsep, sep)
                        drv = self.splitroot(part)[0]
                        if drv:
                            break
                break
        if drv or root:
            parsed.append(drv + root)
        parsed.reverse()
        return drv, root, parsed

    def join_parsed_parts(self, drv, root, parts, drv2, root2, parts2):
        """
        Join the two paths represented by the respective
        (drive, root, parts) tuples.  Return a new (drive, root, parts) tuple.
        """
        if root2:
            if not drv2 and drv:
                return drv, root2, [drv + root2] + parts2[1:]
        elif drv2:
            if drv2 == drv or self.casefold(drv2) == self.casefold(drv):
                # Same drive => second path is relative to the first
                return drv, root, parts + parts2[1:]
        else:
            # Second path is non-anchored (common case)
            return drv, root, parts + parts2
        return drv2, root2, parts2


class _WindowsFlavour(_Flavour):
    # Reference for Windows paths can be found at
    # http://msdn.microsoft.com/en-us/library/aa365247%28v=vs.85%29.aspx

    sep = '\\'
    altsep = '/'
    has_drv = True
    pathmod = ntpath

    is_supported = (os.name == 'nt')

    drive_letters = set('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ')
    ext_namespace_prefix = '\\\\?\\'

    reserved_names = (
        {'CON', 'PRN', 'AUX', 'NUL'} |
        {'COM%d' % i for i in range(1, 10)} |
        {'LPT%d' % i for i in range(1, 10)}
        )

    # Interesting findings about extended paths:
    # - '\\?\c:\a', '//?/c:\a' and '//?/c:/a' are all supported
    #   but '\\?\c:/a' is not
    # - extended paths are always absolute; "relative" extended paths will
    #   fail.

    def splitroot(self, part, sep=sep):
        first = part[0:1]
        second = part[1:2]
        if (second == sep and first == sep):
            # XXX extended paths should also disable the collapsing of "."
            # components (according to MSDN docs).
            prefix, part = self._split_extended_path(part)
            first = part[0:1]
            second = part[1:2]
        else:
            prefix = ''
        third = part[2:3]
        if (second == sep and first == sep and third != sep):
            # is a UNC path:
            # vvvvvvvvvvvvvvvvvvvvv root
            # \\machine\mountpoint\directory\etc\...
            #            directory ^^^^^^^^^^^^^^
            index = part.find(sep, 2)
            if index != -1:
                index2 = part.find(sep, index + 1)
                # a UNC path can't have two slashes in a row
                # (after the initial two)
                if index2 != index + 1:
                    if index2 == -1:
                        index2 = len(part)
                    if prefix:
                        return prefix + part[1:index2], sep, part[index2+1:]
                    else:
                        return part[:index2], sep, part[index2+1:]
        drv = root = ''
        if second == ':' and first in self.drive_letters:
            drv = part[:2]
            part = part[2:]
            first = third
        if first == sep:
            root = first
            part = part.lstrip(sep)
        return prefix + drv, root, part

    def casefold(self, s):
        return s.lower()

    def casefold_parts(self, parts):
        return [p.lower() for p in parts]

    def compile_pattern(self, pattern):
        return re.compile(fnmatch.translate(pattern), re.IGNORECASE).fullmatch

    def resolve(self, path, strict=False):
        s = str(path)
        if not s:
            return os.getcwd()
        previous_s = None
        if _getfinalpathname is not None:
            if strict:
                return self._ext_to_normal(_getfinalpathname(s))
            else:
                tail_parts = []  # End of the path after the first one not found
                while True:
                    try:
                        s = self._ext_to_normal(_getfinalpathname(s))
                    except FileNotFoundError:
                        previous_s = s
                        s, tail = os.path.split(s)
                        tail_parts.append(tail)
                        if previous_s == s:
                            return path
                    else:
                        return os.path.join(s, *reversed(tail_parts))
        # Means fallback on absolute
        return None

    def _split_extended_path(self, s, ext_prefix=ext_namespace_prefix):
        prefix = ''
        if s.startswith(ext_prefix):
            prefix = s[:4]
            s = s[4:]
            if s.startswith('UNC\\'):
                prefix += s[:3]
                s = '\\' + s[3:]
        return prefix, s

    def _ext_to_normal(self, s):
        # Turn back an extended path into a normal DOS-like path
        return self._split_extended_path(s)[1]

    def is_reserved(self, parts):
        # NOTE: the rules for reserved names seem somewhat complicated
        # (e.g. r"..\NUL" is reserved but not r"foo\NUL").
        # We err on the side of caution and return True for paths which are
        # not considered reserved by Windows.
        if not parts:
            return False
        if parts[0].startswith('\\\\'):
            # UNC paths are never reserved
            return False
        return parts[-1].partition('.')[0].upper() in self.reserved_names

    def make_uri(self, path):
        # Under Windows, file URIs use the UTF-8 encoding.
        drive = path.drive
        if len(drive) == 2 and drive[1] == ':':
            # It's a path on a local drive => 'file:///c:/a/b'
            rest = path.as_posix()[2:].lstrip('/')
            return 'file:///%s/%s' % (
                drive, urlquote_from_bytes(rest.encode('utf-8')))
        else:
            # It's a path on a network drive => 'file://host/share/a/b'
            return 'file:' + urlquote_from_bytes(path.as_posix().encode('utf-8'))

    def gethomedir(self, username):
        if 'USERPROFILE' in os.environ:
            userhome = os.environ['USERPROFILE']
        elif 'HOMEPATH' in os.environ:
            try:
                drv = os.environ['HOMEDRIVE']
            except KeyError:
                drv = ''
            userhome = drv + os.environ['HOMEPATH']
        else:
            raise RuntimeError("Can't determine home directory")

        if username:
            # Try to guess user home directory.  By default all users
            # directories are located in the same place and are named by
            # corresponding usernames.  If current user home directory points
            # to nonstandard place, this guess is likely wrong.
            if os.environ['USERNAME'] != username:
                drv, root, parts = self.parse_parts((userhome,))
                if parts[-1] != os.environ['USERNAME']:
                    raise RuntimeError("Can't determine home directory "
                                       "for %r" % username)
                parts[-1] = username
                if drv or root:
                    userhome = drv + root + self.join(parts[1:])
                else:
                    userhome = self.join(parts)
        return userhome

class _PosixFlavour(_Flavour):
    sep = '/'
    altsep = ''
    has_drv = False
    pathmod = posixpath

    is_supported = (os.name != 'nt')

    def splitroot(self, part, sep=sep):
        if part and part[0] == sep:
            stripped_part = part.lstrip(sep)
            # According to POSIX path resolution:
            # http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap04.html#tag_04_11
            # "A pathname that begins with two successive slashes may be
            # interpreted in an implementation-defined manner, although more
            # than two leading slashes shall be treated as a single slash".
            if len(part) - len(stripped_part) == 2:
                return '', sep * 2, stripped_part
            else:
                return '', sep, stripped_part
        else:
            return '', '', part

    def casefold(self, s):
        return s

    def casefold_parts(self, parts):
        return parts

    def compile_pattern(self, pattern):
        return re.compile(fnmatch.translate(pattern)).fullmatch

    def resolve(self, path, strict=False):
        sep = self.sep
        accessor = path._accessor
        seen = {}
        def _resolve(path, rest):
            if rest.startswith(sep):
                path = ''

            for name in rest.split(sep):
                if not name or name == '.':
                    # current dir
                    continue
                if name == '..':
                    # parent dir
                    path, _, _ = path.rpartition(sep)
                    continue
                if path.endswith(sep):
                    newpath = path + name
                else:
                    newpath = path + sep + name
                if newpath in seen:
                    # Already seen this path
                    path = seen[newpath]
                    if path is not None:
                        # use cached value
                        continue
                    # The symlink is not resolved, so we must have a symlink loop.
                    raise RuntimeError("Symlink loop from %r" % newpath)
                # Resolve the symbolic link
                try:
                    target = accessor.readlink(newpath)
                except OSError as e:
                    if e.errno != EINVAL and strict:
                        raise
                    # Not a symlink, or non-strict mode. We just leave the path
                    # untouched.
                    path = newpath
                else:
                    seen[newpath] = None # not resolved symlink
                    path = _resolve(path, target)
                    seen[newpath] = path # resolved symlink

            return path
        # NOTE: according to POSIX, getcwd() cannot contain path components
        # which are symlinks.
        base = '' if path.is_absolute() else os.getcwd()
        return _resolve(base, str(path)) or sep

    def is_reserved(self, parts):
        return False

    def make_uri(self, path):
        # We represent the path using the local filesystem encoding,
        # for portability to other applications.
        bpath = bytes(path)
        return 'file://' + urlquote_from_bytes(bpath)

    def gethomedir(self, username):
        if not username:
            try:
                return os.environ['HOME']
            except KeyError:
                import pwd
                return pwd.getpwuid(os.getuid()).pw_dir
        else:
            import pwd
            try:
                return pwd.getpwnam(username).pw_dir
            except KeyError:
                raise RuntimeError("Can't determine home directory "
                                   "for %r" % username)


_windows_flavour = _WindowsFlavour()
_posix_flavour = _PosixFlavour()


class _Accessor:
    """An accessor implements a particular (system-specific or not) way of
    accessing paths on the filesystem."""


class _NormalAccessor(_Accessor):

    stat = os.stat

    lstat = os.lstat

    open = os.open

    listdir = os.listdir

    scandir = os.scandir

    chmod = os.chmod

    if hasattr(os, "lchmod"):
        lchmod = os.lchmod
    else:
        def lchmod(self, pathobj, mode):
            raise NotImplementedError("lchmod() not available on this system")

    mkdir = os.mkdir

    unlink = os.unlink

    if hasattr(os, "link"):
        link_to = os.link
    else:
        @staticmethod
        def link_to(self, target):
            raise NotImplementedError("os.link() not available on this system")

    rmdir = os.rmdir

    rename = os.rename

    replace = os.replace

    if nt:
        if supports_symlinks:
            symlink = os.symlink
        else:
            def symlink(a, b, target_is_directory):
                raise NotImplementedError("symlink() not available on this system")
    else:
        # Under POSIX, os.symlink() takes two args
        @staticmethod
        def symlink(a, b, target_is_directory):
            return os.symlink(a, b)

    utime = os.utime

    # Helper for resolve()
    def readlink(self, path):
        return os.readlink(path)


_normal_accessor = _NormalAccessor()


#
# Globbing helpers
#

def _make_selector(pattern_parts, flavour):
    pat = pattern_parts[0]
    child_parts = pattern_parts[1:]
    if pat == '**':
        cls = _RecursiveWildcardSelector
    elif '**' in pat:
        raise ValueError("Invalid pattern: '**' can only be an entire path component")
    elif _is_wildcard_pattern(pat):
        cls = _WildcardSelector
    else:
        cls = _PreciseSelector
    return cls(pat, child_parts, flavour)

if hasattr(functools, "lru_cache"):
    _make_selector = functools.lru_cache()(_make_selector)


class _Selector:
    """A selector matches a specific glob pattern part against the children
    of a given path."""

    def __init__(self, child_parts, flavour):
        self.child_parts = child_parts
        if child_parts:
            self.successor = _make_selector(child_parts, flavour)
            self.dironly = True
        else:
            self.successor = _TerminatingSelector()
            self.dironly = False

    def select_from(self, parent_path):
        """Iterate over all child paths of `parent_path` matched by this
        selector.  This can contain parent_path itself."""
        path_cls = type(parent_path)
        is_dir = path_cls.is_dir
        exists = path_cls.exists
        scandir = parent_path._accessor.scandir
        if not is_dir(parent_path):
            return iter([])
        return self._select_from(parent_path, is_dir, exists, scandir)


class _TerminatingSelector:

    def _select_from(self, parent_path, is_dir, exists, scandir):
        yield parent_path


class _PreciseSelector(_Selector):

    def __init__(self, name, child_parts, flavour):
        self.name = name
        _Selector.__init__(self, child_parts, flavour)

    def _select_from(self, parent_path, is_dir, exists, scandir):
        try:
            path = parent_path._make_child_relpath(self.name)
            if (is_dir if self.dironly else exists)(path):
                for p in self.successor._select_from(path, is_dir, exists, scandir):
                    yield p
        except PermissionError:
            return


class _WildcardSelector(_Selector):

    def __init__(self, pat, child_parts, flavour):
        self.match = flavour.compile_pattern(pat)
        _Selector.__init__(self, child_parts, flavour)

    def _select_from(self, parent_path, is_dir, exists, scandir):
        try:
            with scandir(parent_path) as scandir_it:
                entries = list(scandir_it)
            for entry in entries:
                if self.dironly:
                    try:
                        # "entry.is_dir()" can raise PermissionError
                        # in some cases (see bpo-38894), which is not
                        # among the errors ignored by _ignore_error()
                        if not entry.is_dir():
                            continue
                    except OSError as e:
                        if not _ignore_error(e):
                            raise
                        continue
                name = entry.name
                if self.match(name):
                    path = parent_path._make_child_relpath(name)
                    for p in self.successor._select_from(path, is_dir, exists, scandir):
                        yield p
        except PermissionError:
            return


class _RecursiveWildcardSelector(_Selector):

    def __init__(self, pat, child_parts, flavour):
        _Selector.__init__(self, child_parts, flavour)

    def _iterate_directories(self, parent_path, is_dir, scandir):
        yield parent_path
        try:
            with scandir(parent_path) as scandir_it:
                entries = list(scandir_it)
            for entry in entries:
                entry_is_dir = False
                try:
                    entry_is_dir = entry.is_dir()
                except OSError as e:
                    if not _ignore_error(e):
                        raise
                if entry_is_dir and not entry.is_symlink():
                    path = parent_path._make_child_relpath(entry.name)
                    for p in self._iterate_directories(path, is_dir, scandir):
                        yield p
        except PermissionError:
            return

    def _select_from(self, parent_path, is_dir, exists, scandir):
        try:
            yielded = set()
            try:
                successor_select = self.successor._select_from
                for starting_point in self._iterate_directories(parent_path, is_dir, scandir):
                    for p in successor_select(starting_point, is_dir, exists, scandir):
                        if p not in yielded:
                            yield p
                            yielded.add(p)
            finally:
                yielded.clear()
        except PermissionError:
            return


#
# Public API
#

class _PathParents(Sequence):
    """This object provides sequence-like access to the logical ancestors
    of a path.  Don't try to construct it yourself."""
    __slots__ = ('_pathcls', '_drv', '_root', '_parts')

    def __init__(self, path):
        # We don't store the instance to avoid reference cycles
        self._pathcls = type(path)
        self._drv = path._drv
        self._root = path._root
        self._parts = path._parts

    def __len__(self):
        if self._drv or self._root:
            return len(self._parts) - 1
        else:
            return len(self._parts)

    def __getitem__(self, idx):
        if idx < 0 or idx >= len(self):
            raise IndexError(idx)
        return self._pathcls._from_parsed_parts(self._drv, self._root,
                                                self._parts[:-idx - 1])

    def __repr__(self):
        return "<{}.parents>".format(self._pathcls.__name__)


class PurePath(object):
    """Base class for manipulating paths without I/O.

    PurePath represents a filesystem path and offers operations which
    don't imply any actual filesystem I/O.  Depending on your system,
    instantiating a PurePath will return either a PurePosixPath or a
    PureWindowsPath object.  You can also instantiate either of these classes
    directly, regardless of your system.
    """
    __slots__ = (
        '_drv', '_root', '_parts',
        '_str', '_hash', '_pparts', '_cached_cparts',
    )

    def __new__(cls, *args):
        """Construct a PurePath from one or several strings and or existing
        PurePath objects.  The strings and path objects are combined so as
        to yield a canonicalized path, which is incorporated into the
        new PurePath object.
        """
        if cls is PurePath:
            cls = PureWindowsPath if os.name == 'nt' else PurePosixPath
        return cls._from_parts(args)

    def __reduce__(self):
        # Using the parts tuple helps share interned path parts
        # when pickling related paths.
        return (self.__class__, tuple(self._parts))

    @classmethod
    def _parse_args(cls, args):
        # This is useful when you don't want to create an instance, just
        # canonicalize some constructor arguments.
        parts = []
        for a in args:
            if isinstance(a, PurePath):
                parts += a._parts
            else:
                a = os.fspath(a)
                if isinstance(a, str):
                    # Force-cast str subclasses to str (issue #21127)
                    parts.append(str(a))
                else:
                    raise TypeError(
                        "argument should be a str object or an os.PathLike "
                        "object returning str, not %r"
                        % type(a))
        return cls._flavour.parse_parts(parts)

    @classmethod
    def _from_parts(cls, args, init=True):
        # We need to call _parse_args on the instance, so as to get the
        # right flavour.
        self = object.__new__(cls)
        drv, root, parts = self._parse_args(args)
        self._drv = drv
        self._root = root
        self._parts = parts
        if init:
            self._init()
        return self

    @classmethod
    def _from_parsed_parts(cls, drv, root, parts, init=True):
        self = object.__new__(cls)
        self._drv = drv
        self._root = root
        self._parts = parts
        if init:
            self._init()
        return self

    @classmethod
    def _format_parsed_parts(cls, drv, root, parts):
        if drv or root:
            return drv + root + cls._flavour.join(parts[1:])
        else:
            return cls._flavour.join(parts)

    def _init(self):
        # Overridden in concrete Path
        pass

    def _make_child(self, args):
        drv, root, parts = self._parse_args(args)
        drv, root, parts = self._flavour.join_parsed_parts(
            self._drv, self._root, self._parts, drv, root, parts)
        return self._from_parsed_parts(drv, root, parts)

    def __str__(self):
        """Return the string representation of the path, suitable for
        passing to system calls."""
        try:
            return self._str
        except AttributeError:
            self._str = self._format_parsed_parts(self._drv, self._root,
                                                  self._parts) or '.'
            return self._str

    def __fspath__(self):
        return str(self)

    def as_posix(self):
        """Return the string representation of the path with forward (/)
        slashes."""
        f = self._flavour
        return str(self).replace(f.sep, '/')

    def __bytes__(self):
        """Return the bytes representation of the path.  This is only
        recommended to use under Unix."""
        return os.fsencode(self)

    def __repr__(self):
        return "{}({!r})".format(self.__class__.__name__, self.as_posix())

    def as_uri(self):
        """Return the path as a 'file' URI."""
        if not self.is_absolute():
            raise ValueError("relative path can't be expressed as a file URI")
        return self._flavour.make_uri(self)

    @property
    def _cparts(self):
        # Cached casefolded parts, for hashing and comparison
        try:
            return self._cached_cparts
        except AttributeError:
            self._cached_cparts = self._flavour.casefold_parts(self._parts)
            return self._cached_cparts

    def __eq__(self, other):
        if not isinstance(other, PurePath):
            return NotImplemented
        return self._cparts == other._cparts and self._flavour is other._flavour

    def __hash__(self):
        try:
            return self._hash
        except AttributeError:
            self._hash = hash(tuple(self._cparts))
            return self._hash

    def __lt__(self, other):
        if not isinstance(other, PurePath) or self._flavour is not other._flavour:
            return NotImplemented
        return self._cparts < other._cparts

    def __le__(self, other):
        if not isinstance(other, PurePath) or self._flavour is not other._flavour:
            return NotImplemented
        return self._cparts <= other._cparts

    def __gt__(self, other):
        if not isinstance(other, PurePath) or self._flavour is not other._flavour:
            return NotImplemented
        return self._cparts > other._cparts

    def __ge__(self, other):
        if not isinstance(other, PurePath) or self._flavour is not other._flavour:
            return NotImplemented
        return self._cparts >= other._cparts

    drive = property(attrgetter('_drv'),
                     doc="""The drive prefix (letter or UNC path), if any.""")

    root = property(attrgetter('_root'),
                    doc="""The root of the path, if any.""")

    @property
    def anchor(self):
        """The concatenation of the drive and root, or ''."""
        anchor = self._drv + self._root
        return anchor

    @property
    def name(self):
        """The final path component, if any."""
        parts = self._parts
        if len(parts) == (1 if (self._drv or self._root) else 0):
            return ''
        return parts[-1]

    @property
    def suffix(self):
        """
        The final component's last suffix, if any.

        This includes the leading period. For example: '.txt'
        """
        name = self.name
        i = name.rfind('.')
        if 0 < i < len(name) - 1:
            return name[i:]
        else:
            return ''

    @property
    def suffixes(self):
        """
        A list of the final component's suffixes, if any.

        These include the leading periods. For example: ['.tar', '.gz']
        """
        name = self.name
        if name.endswith('.'):
            return []
        name = name.lstrip('.')
        return ['.' + suffix for suffix in name.split('.')[1:]]

    @property
    def stem(self):
        """The final path component, minus its last suffix."""
        name = self.name
        i = name.rfind('.')
        if 0 < i < len(name) - 1:
            return name[:i]
        else:
            return name

    def with_name(self, name):
        """Return a new path with the file name changed."""
        if not self.name:
            raise ValueError("%r has an empty name" % (self,))
        drv, root, parts = self._flavour.parse_parts((name,))
        if (not name or name[-1] in [self._flavour.sep, self._flavour.altsep]
            or drv or root or len(parts) != 1):
            raise ValueError("Invalid name %r" % (name))
        return self._from_parsed_parts(self._drv, self._root,
                                       self._parts[:-1] + [name])

    def with_suffix(self, suffix):
        """Return a new path with the file suffix changed.  If the path
        has no suffix, add given suffix.  If the given suffix is an empty
        string, remove the suffix from the path.
        """
        f = self._flavour
        if f.sep in suffix or f.altsep and f.altsep in suffix:
            raise ValueError("Invalid suffix %r" % (suffix,))
        if suffix and not suffix.startswith('.') or suffix == '.':
            raise ValueError("Invalid suffix %r" % (suffix))
        name = self.name
        if not name:
            raise ValueError("%r has an empty name" % (self,))
        old_suffix = self.suffix
        if not old_suffix:
            name = name + suffix
        else:
            name = name[:-len(old_suffix)] + suffix
        return self._from_parsed_parts(self._drv, self._root,
                                       self._parts[:-1] + [name])

    def relative_to(self, *other):
        """Return the relative path to another path identified by the passed
        arguments.  If the operation is not possible (because this is not
        a subpath of the other path), raise ValueError.
        """
        # For the purpose of this method, drive and root are considered
        # separate parts, i.e.:
        #   Path('c:/').relative_to('c:')  gives Path('/')
        #   Path('c:/').relative_to('/')   raise ValueError
        if not other:
            raise TypeError("need at least one argument")
        parts = self._parts
        drv = self._drv
        root = self._root
        if root:
            abs_parts = [drv, root] + parts[1:]
        else:
            abs_parts = parts
        to_drv, to_root, to_parts = self._parse_args(other)
        if to_root:
            to_abs_parts = [to_drv, to_root] + to_parts[1:]
        else:
            to_abs_parts = to_parts
        n = len(to_abs_parts)
        cf = self._flavour.casefold_parts
        if (root or drv) if n == 0 else cf(abs_parts[:n]) != cf(to_abs_parts):
            formatted = self._format_parsed_parts(to_drv, to_root, to_parts)
            raise ValueError("{!r} does not start with {!r}"
                             .format(str(self), str(formatted)))
        return self._from_parsed_parts('', root if n == 1 else '',
                                       abs_parts[n:])

    @property
    def parts(self):
        """An object providing sequence-like access to the
        components in the filesystem path."""
        # We cache the tuple to avoid building a new one each time .parts
        # is accessed.  XXX is this necessary?
        try:
            return self._pparts
        except AttributeError:
            self._pparts = tuple(self._parts)
            return self._pparts

    def joinpath(self, *args):
        """Combine this path with one or several arguments, and return a
        new path representing either a subpath (if all arguments are relative
        paths) or a totally different path (if one of the arguments is
        anchored).
        """
        return self._make_child(args)

    def __truediv__(self, key):
        try:
            return self._make_child((key,))
        except TypeError:
            return NotImplemented

    def __rtruediv__(self, key):
        try:
            return self._from_parts([key] + self._parts)
        except TypeError:
            return NotImplemented

    @property
    def parent(self):
        """The logical parent of the path."""
        drv = self._drv
        root = self._root
        parts = self._parts
        if len(parts) == 1 and (drv or root):
            return self
        return self._from_parsed_parts(drv, root, parts[:-1])

    @property
    def parents(self):
        """A sequence of this path's logical parents."""
        return _PathParents(self)

    def is_absolute(self):
        """True if the path is absolute (has both a root and, if applicable,
        a drive)."""
        if not self._root:
            return False
        return not self._flavour.has_drv or bool(self._drv)

    def is_reserved(self):
        """Return True if the path contains one of the special names reserved
        by the system, if any."""
        return self._flavour.is_reserved(self._parts)

    def match(self, path_pattern):
        """
        Return True if this path matches the given pattern.
        """
        cf = self._flavour.casefold
        path_pattern = cf(path_pattern)
        drv, root, pat_parts = self._flavour.parse_parts((path_pattern,))
        if not pat_parts:
            raise ValueError("empty pattern")
        if drv and drv != cf(self._drv):
            return False
        if root and root != cf(self._root):
            return False
        parts = self._cparts
        if drv or root:
            if len(pat_parts) != len(parts):
                return False
            pat_parts = pat_parts[1:]
        elif len(pat_parts) > len(parts):
            return False
        for part, pat in zip(reversed(parts), reversed(pat_parts)):
            if not fnmatch.fnmatchcase(part, pat):
                return False
        return True

# Can't subclass os.PathLike from PurePath and keep the constructor
# optimizations in PurePath._parse_args().
os.PathLike.register(PurePath)


class PurePosixPath(PurePath):
    """PurePath subclass for non-Windows systems.

    On a POSIX system, instantiating a PurePath should return this object.
    However, you can also instantiate it directly on any system.
    """
    _flavour = _posix_flavour
    __slots__ = ()


class PureWindowsPath(PurePath):
    """PurePath subclass for Windows systems.

    On a Windows system, instantiating a PurePath should return this object.
    However, you can also instantiate it directly on any system.
    """
    _flavour = _windows_flavour
    __slots__ = ()


# Filesystem-accessing classes


class Path(PurePath):
    """PurePath subclass that can make system calls.

    Path represents a filesystem path but unlike PurePath, also offers
    methods to do system calls on path objects. Depending on your system,
    instantiating a Path will return either a PosixPath or a WindowsPath
    object. You can also instantiate a PosixPath or WindowsPath directly,
    but cannot instantiate a WindowsPath on a POSIX system or vice versa.
    """
    __slots__ = (
        '_accessor',
        '_closed',
    )

    def __new__(cls, *args, **kwargs):
        if cls is Path:
            cls = WindowsPath if os.name == 'nt' else PosixPath
        self = cls._from_parts(args, init=False)
        if not self._flavour.is_supported:
            raise NotImplementedError("cannot instantiate %r on your system"
                                      % (cls.__name__,))
        self._init()
        return self

    def _init(self,
              # Private non-constructor arguments
              template=None,
              ):
        self._closed = False
        if template is not None:
            self._accessor = template._accessor
        else:
            self._accessor = _normal_accessor

    def _make_child_relpath(self, part):
        # This is an optimization used for dir walking.  `part` must be
        # a single part relative to this path.
        parts = self._parts + [part]
        return self._from_parsed_parts(self._drv, self._root, parts)

    def __enter__(self):
        if self._closed:
            self._raise_closed()
        return self

    def __exit__(self, t, v, tb):
        self._closed = True

    def _raise_closed(self):
        raise ValueError("I/O operation on closed path")

    def _opener(self, name, flags, mode=0o666):
        # A stub for the opener argument to built-in open()
        return self._accessor.open(self, flags, mode)

    def _raw_open(self, flags, mode=0o777):
        """
        Open the file pointed by this path and return a file descriptor,
        as os.open() does.
        """
        if self._closed:
            self._raise_closed()
        return self._accessor.open(self, flags, mode)

    # Public API

    @classmethod
    def cwd(cls):
        """Return a new path pointing to the current working directory
        (as returned by os.getcwd()).
        """
        return cls(os.getcwd())

    @classmethod
    def home(cls):
        """Return a new path pointing to the user's home directory (as
        returned by os.path.expanduser('~')).
        """
        return cls(cls()._flavour.gethomedir(None))

    def samefile(self, other_path):
        """Return whether other_path is the same or not as this file
        (as returned by os.path.samefile()).
        """
        st = self.stat()
        try:
            other_st = other_path.stat()
        except AttributeError:
            other_st = os.stat(other_path)
        return os.path.samestat(st, other_st)

    def iterdir(self):
        """Iterate over the files in this directory.  Does not yield any
        result for the special paths '.' and '..'.
        """
        if self._closed:
            self._raise_closed()
        for name in self._accessor.listdir(self):
            if name in {'.', '..'}:
                # Yielding a path object for these makes little sense
                continue
            yield self._make_child_relpath(name)
            if self._closed:
                self._raise_closed()

    def glob(self, pattern):
        """Iterate over this subtree and yield all existing files (of any
        kind, including directories) matching the given relative pattern.
        """
        if not pattern:
            raise ValueError("Unacceptable pattern: {!r}".format(pattern))
        drv, root, pattern_parts = self._flavour.parse_parts((pattern,))
        if drv or root:
            raise NotImplementedError("Non-relative patterns are unsupported")
        selector = _make_selector(tuple(pattern_parts), self._flavour)
        for p in selector.select_from(self):
            yield p

    def rglob(self, pattern):
        """Recursively yield all existing files (of any kind, including
        directories) matching the given relative pattern, anywhere in
        this subtree.
        """
        drv, root, pattern_parts = self._flavour.parse_parts((pattern,))
        if drv or root:
            raise NotImplementedError("Non-relative patterns are unsupported")
        selector = _make_selector(("**",) + tuple(pattern_parts), self._flavour)
        for p in selector.select_from(self):
            yield p

    def absolute(self):
        """Return an absolute version of this path.  This function works
        even if the path doesn't point to anything.

        No normalization is done, i.e. all '.' and '..' will be kept along.
        Use resolve() to get the canonical path to a file.
        """
        # XXX untested yet!
        if self._closed:
            self._raise_closed()
        if self.is_absolute():
            return self
        # FIXME this must defer to the specific flavour (and, under Windows,
        # use nt._getfullpathname())
        obj = self._from_parts([os.getcwd()] + self._parts, init=False)
        obj._init(template=self)
        return obj

    def resolve(self, strict=False):
        """
        Make the path absolute, resolving all symlinks on the way and also
        normalizing it (for example turning slashes into backslashes under
        Windows).
        """
        if self._closed:
            self._raise_closed()
        s = self._flavour.resolve(self, strict=strict)
        if s is None:
            # No symlink resolution => for consistency, raise an error if
            # the path doesn't exist or is forbidden
            self.stat()
            s = str(self.absolute())
        # Now we have no symlinks in the path, it's safe to normalize it.
        normed = self._flavour.pathmod.normpath(s)
        obj = self._from_parts((normed,), init=False)
        obj._init(template=self)
        return obj

    def stat(self):
        """
        Return the result of the stat() system call on this path, like
        os.stat() does.
        """
        return self._accessor.stat(self)

    def owner(self):
        """
        Return the login name of the file owner.
        """
        import pwd
        return pwd.getpwuid(self.stat().st_uid).pw_name

    def group(self):
        """
        Return the group name of the file gid.
        """
        import grp
        return grp.getgrgid(self.stat().st_gid).gr_name

    def open(self, mode='r', buffering=-1, encoding=None,
             errors=None, newline=None):
        """
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        """
        if self._closed:
            self._raise_closed()
        return io.open(self, mode, buffering, encoding, errors, newline,
                       opener=self._opener)

    def read_bytes(self):
        """
        Open the file in bytes mode, read it, and close the file.
        """
        with self.open(mode='rb') as f:
            return f.read()

    def read_text(self, encoding=None, errors=None):
        """
        Open the file in text mode, read it, and close the file.
        """
        with self.open(mode='r', encoding=encoding, errors=errors) as f:
            return f.read()

    def write_bytes(self, data):
        """
        Open the file in bytes mode, write to it, and close the file.
        """
        # type-check for the buffer interface before truncating the file
        view = memoryview(data)
        with self.open(mode='wb') as f:
            return f.write(view)

    def write_text(self, data, encoding=None, errors=None):
        """
        Open the file in text mode, write to it, and close the file.
        """
        if not isinstance(data, str):
            raise TypeError('data must be str, not %s' %
                            data.__class__.__name__)
        with self.open(mode='w', encoding=encoding, errors=errors) as f:
            return f.write(data)

    def touch(self, mode=0o666, exist_ok=True):
        """
        Create this file with the given access mode, if it doesn't exist.
        """
        if self._closed:
            self._raise_closed()
        if exist_ok:
            # First try to bump modification time
            # Implementation note: GNU touch uses the UTIME_NOW option of
            # the utimensat() / futimens() functions.
            try:
                self._accessor.utime(self, None)
            except OSError:
                # Avoid exception chaining
                pass
            else:
                return
        flags = os.O_CREAT | os.O_WRONLY
        if not exist_ok:
            flags |= os.O_EXCL
        fd = self._raw_open(flags, mode)
        os.close(fd)

    def mkdir(self, mode=0o777, parents=False, exist_ok=False):
        """
        Create a new directory at this given path.
        """
        if self._closed:
            self._raise_closed()
        try:
            self._accessor.mkdir(self, mode)
        except FileNotFoundError:
            if not parents or self.parent == self:
                raise
            self.parent.mkdir(parents=True, exist_ok=True)
            self.mkdir(mode, parents=False, exist_ok=exist_ok)
        except OSError:
            # Cannot rely on checking for EEXIST, since the operating system
            # could give priority to other errors like EACCES or EROFS
            if not exist_ok or not self.is_dir():
                raise

    def chmod(self, mode):
        """
        Change the permissions of the path, like os.chmod().
        """
        if self._closed:
            self._raise_closed()
        self._accessor.chmod(self, mode)

    def lchmod(self, mode):
        """
        Like chmod(), except if the path points to a symlink, the symlink's
        permissions are changed, rather than its target's.
        """
        if self._closed:
            self._raise_closed()
        self._accessor.lchmod(self, mode)

    def unlink(self, missing_ok=False):
        """
        Remove this file or link.
        If the path is a directory, use rmdir() instead.
        """
        if self._closed:
            self._raise_closed()
        try:
            self._accessor.unlink(self)
        except FileNotFoundError:
            if not missing_ok:
                raise

    def rmdir(self):
        """
        Remove this directory.  The directory must be empty.
        """
        if self._closed:
            self._raise_closed()
        self._accessor.rmdir(self)

    def lstat(self):
        """
        Like stat(), except if the path points to a symlink, the symlink's
        status information is returned, rather than its target's.
        """
        if self._closed:
            self._raise_closed()
        return self._accessor.lstat(self)

    def rename(self, target):
        """
        Rename this path to the target path.

        The target path may be absolute or relative. Relative paths are
        interpreted relative to the current working directory, *not* the
        directory of the Path object.

        Returns the new Path instance pointing to the target path.
        """
        if self._closed:
            self._raise_closed()
        self._accessor.rename(self, target)
        return self.__class__(target)

    def replace(self, target):
        """
        Rename this path to the target path, overwriting if that path exists.

        The target path may be absolute or relative. Relative paths are
        interpreted relative to the current working directory, *not* the
        directory of the Path object.

        Returns the new Path instance pointing to the target path.
        """
        if self._closed:
            self._raise_closed()
        self._accessor.replace(self, target)
        return self.__class__(target)

    def symlink_to(self, target, target_is_directory=False):
        """
        Make this path a symlink pointing to the target path.
        Note the order of arguments (link, target) is the reverse of os.symlink.
        """
        if self._closed:
            self._raise_closed()
        self._accessor.symlink(target, self, target_is_directory)

    def link_to(self, target):
        """
        Make the target path a hard link pointing to this path.

        Note this function does not make this path a hard link to *target*,
        despite the implication of the function and argument names. The order
        of arguments (target, link) is the reverse of Path.symlink_to, but
        matches that of os.link.

        """
        if self._closed:
            self._raise_closed()
        self._accessor.link_to(self, target)

    # Convenience functions for querying the stat results

    def exists(self):
        """
        Whether this path exists.
        """
        try:
            self.stat()
        except OSError as e:
            if not _ignore_error(e):
                raise
            return False
        except ValueError:
            # Non-encodable path
            return False
        return True

    def is_dir(self):
        """
        Whether this path is a directory.
        """
        try:
            return S_ISDIR(self.stat().st_mode)
        except OSError as e:
            if not _ignore_error(e):
                raise
            # Path doesn't exist or is a broken symlink
            # (see https://bitbucket.org/pitrou/pathlib/issue/12/)
            return False
        except ValueError:
            # Non-encodable path
            return False

    def is_file(self):
        """
        Whether this path is a regular file (also True for symlinks pointing
        to regular files).
        """
        try:
            return S_ISREG(self.stat().st_mode)
        except OSError as e:
            if not _ignore_error(e):
                raise
            # Path doesn't exist or is a broken symlink
            # (see https://bitbucket.org/pitrou/pathlib/issue/12/)
            return False
        except ValueError:
            # Non-encodable path
            return False

    def is_mount(self):
        """
        Check if this path is a POSIX mount point
        """
        # Need to exist and be a dir
        if not self.exists() or not self.is_dir():
            return False

        parent = Path(self.parent)
        try:
            parent_dev = parent.stat().st_dev
        except OSError:
            return False

        dev = self.stat().st_dev
        if dev != parent_dev:
            return True
        ino = self.stat().st_ino
        parent_ino = parent.stat().st_ino
        return ino == parent_ino

    def is_symlink(self):
        """
        Whether this path is a symbolic link.
        """
        try:
            return S_ISLNK(self.lstat().st_mode)
        except OSError as e:
            if not _ignore_error(e):
                raise
            # Path doesn't exist
            return False
        except ValueError:
            # Non-encodable path
            return False

    def is_block_device(self):
        """
        Whether this path is a block device.
        """
        try:
            return S_ISBLK(self.stat().st_mode)
        except OSError as e:
            if not _ignore_error(e):
                raise
            # Path doesn't exist or is a broken symlink
            # (see https://bitbucket.org/pitrou/pathlib/issue/12/)
            return False
        except ValueError:
            # Non-encodable path
            return False

    def is_char_device(self):
        """
        Whether this path is a character device.
        """
        try:
            return S_ISCHR(self.stat().st_mode)
        except OSError as e:
            if not _ignore_error(e):
                raise
            # Path doesn't exist or is a broken symlink
            # (see https://bitbucket.org/pitrou/pathlib/issue/12/)
            return False
        except ValueError:
            # Non-encodable path
            return False

    def is_fifo(self):
        """
        Whether this path is a FIFO.
        """
        try:
            return S_ISFIFO(self.stat().st_mode)
        except OSError as e:
            if not _ignore_error(e):
                raise
            # Path doesn't exist or is a broken symlink
            # (see https://bitbucket.org/pitrou/pathlib/issue/12/)
            return False
        except ValueError:
            # Non-encodable path
            return False

    def is_socket(self):
        """
        Whether this path is a socket.
        """
        try:
            return S_ISSOCK(self.stat().st_mode)
        except OSError as e:
            if not _ignore_error(e):
                raise
            # Path doesn't exist or is a broken symlink
            # (see https://bitbucket.org/pitrou/pathlib/issue/12/)
            return False
        except ValueError:
            # Non-encodable path
            return False

    def expanduser(self):
        """ Return a new path with expanded ~ and ~user constructs
        (as returned by os.path.expanduser)
        """
        if (not (self._drv or self._root) and
            self._parts and self._parts[0][:1] == '~'):
            homedir = self._flavour.gethomedir(self._parts[0][1:])
            return self._from_parts([homedir] + self._parts[1:])

        return self


class PosixPath(Path, PurePosixPath):
    """Path subclass for non-Windows systems.

    On a POSIX system, instantiating a Path should return this object.
    """
    __slots__ = ()

class WindowsPath(Path, PureWindowsPath):
    """Path subclass for Windows systems.

    On a Windows system, instantiating a Path should return this object.
    """
    __slots__ = ()

    def owner(self):
        raise NotImplementedError("Path.owner() is unsupported on this system")

    def group(self):
        raise NotImplementedError("Path.group() is unsupported on this system")

    def is_mount(self):
        raise NotImplementedError("Path.is_mount() is unsupported on this system")
stat.py000064400000012555151153537610006110 0ustar00"""Constants/functions for interpreting results of os.stat() and os.lstat().

Suggested usage: from stat import *
"""

# Indices for stat struct members in the tuple returned by os.stat()

ST_MODE  = 0
ST_INO   = 1
ST_DEV   = 2
ST_NLINK = 3
ST_UID   = 4
ST_GID   = 5
ST_SIZE  = 6
ST_ATIME = 7
ST_MTIME = 8
ST_CTIME = 9

# Extract bits from the mode

def S_IMODE(mode):
    """Return the portion of the file's mode that can be set by
    os.chmod().
    """
    return mode & 0o7777

def S_IFMT(mode):
    """Return the portion of the file's mode that describes the
    file type.
    """
    return mode & 0o170000

# Constants used as S_IFMT() for various file types
# (not all are implemented on all systems)

S_IFDIR  = 0o040000  # directory
S_IFCHR  = 0o020000  # character device
S_IFBLK  = 0o060000  # block device
S_IFREG  = 0o100000  # regular file
S_IFIFO  = 0o010000  # fifo (named pipe)
S_IFLNK  = 0o120000  # symbolic link
S_IFSOCK = 0o140000  # socket file
# Fallbacks for uncommon platform-specific constants
S_IFDOOR = 0
S_IFPORT = 0
S_IFWHT = 0

# Functions to test for each file type

def S_ISDIR(mode):
    """Return True if mode is from a directory."""
    return S_IFMT(mode) == S_IFDIR

def S_ISCHR(mode):
    """Return True if mode is from a character special device file."""
    return S_IFMT(mode) == S_IFCHR

def S_ISBLK(mode):
    """Return True if mode is from a block special device file."""
    return S_IFMT(mode) == S_IFBLK

def S_ISREG(mode):
    """Return True if mode is from a regular file."""
    return S_IFMT(mode) == S_IFREG

def S_ISFIFO(mode):
    """Return True if mode is from a FIFO (named pipe)."""
    return S_IFMT(mode) == S_IFIFO

def S_ISLNK(mode):
    """Return True if mode is from a symbolic link."""
    return S_IFMT(mode) == S_IFLNK

def S_ISSOCK(mode):
    """Return True if mode is from a socket."""
    return S_IFMT(mode) == S_IFSOCK

def S_ISDOOR(mode):
    """Return True if mode is from a door."""
    return False

def S_ISPORT(mode):
    """Return True if mode is from an event port."""
    return False

def S_ISWHT(mode):
    """Return True if mode is from a whiteout."""
    return False

# Names for permission bits

S_ISUID = 0o4000  # set UID bit
S_ISGID = 0o2000  # set GID bit
S_ENFMT = S_ISGID # file locking enforcement
S_ISVTX = 0o1000  # sticky bit
S_IREAD = 0o0400  # Unix V7 synonym for S_IRUSR
S_IWRITE = 0o0200 # Unix V7 synonym for S_IWUSR
S_IEXEC = 0o0100  # Unix V7 synonym for S_IXUSR
S_IRWXU = 0o0700  # mask for owner permissions
S_IRUSR = 0o0400  # read by owner
S_IWUSR = 0o0200  # write by owner
S_IXUSR = 0o0100  # execute by owner
S_IRWXG = 0o0070  # mask for group permissions
S_IRGRP = 0o0040  # read by group
S_IWGRP = 0o0020  # write by group
S_IXGRP = 0o0010  # execute by group
S_IRWXO = 0o0007  # mask for others (not in group) permissions
S_IROTH = 0o0004  # read by others
S_IWOTH = 0o0002  # write by others
S_IXOTH = 0o0001  # execute by others

# Names for file flags

UF_NODUMP    = 0x00000001  # do not dump file
UF_IMMUTABLE = 0x00000002  # file may not be changed
UF_APPEND    = 0x00000004  # file may only be appended to
UF_OPAQUE    = 0x00000008  # directory is opaque when viewed through a union stack
UF_NOUNLINK  = 0x00000010  # file may not be renamed or deleted
UF_COMPRESSED = 0x00000020 # OS X: file is hfs-compressed
UF_HIDDEN    = 0x00008000  # OS X: file should not be displayed
SF_ARCHIVED  = 0x00010000  # file may be archived
SF_IMMUTABLE = 0x00020000  # file may not be changed
SF_APPEND    = 0x00040000  # file may only be appended to
SF_NOUNLINK  = 0x00100000  # file may not be renamed or deleted
SF_SNAPSHOT  = 0x00200000  # file is a snapshot file


_filemode_table = (
    ((S_IFLNK,         "l"),
     (S_IFSOCK,        "s"),  # Must appear before IFREG and IFDIR as IFSOCK == IFREG | IFDIR
     (S_IFREG,         "-"),
     (S_IFBLK,         "b"),
     (S_IFDIR,         "d"),
     (S_IFCHR,         "c"),
     (S_IFIFO,         "p")),

    ((S_IRUSR,         "r"),),
    ((S_IWUSR,         "w"),),
    ((S_IXUSR|S_ISUID, "s"),
     (S_ISUID,         "S"),
     (S_IXUSR,         "x")),

    ((S_IRGRP,         "r"),),
    ((S_IWGRP,         "w"),),
    ((S_IXGRP|S_ISGID, "s"),
     (S_ISGID,         "S"),
     (S_IXGRP,         "x")),

    ((S_IROTH,         "r"),),
    ((S_IWOTH,         "w"),),
    ((S_IXOTH|S_ISVTX, "t"),
     (S_ISVTX,         "T"),
     (S_IXOTH,         "x"))
)

def filemode(mode):
    """Convert a file's mode to a string of the form '-rwxrwxrwx'."""
    perm = []
    for table in _filemode_table:
        for bit, char in table:
            if mode & bit == bit:
                perm.append(char)
                break
        else:
            perm.append("-")
    return "".join(perm)


# Windows FILE_ATTRIBUTE constants for interpreting os.stat()'s
# "st_file_attributes" member

FILE_ATTRIBUTE_ARCHIVE = 32
FILE_ATTRIBUTE_COMPRESSED = 2048
FILE_ATTRIBUTE_DEVICE = 64
FILE_ATTRIBUTE_DIRECTORY = 16
FILE_ATTRIBUTE_ENCRYPTED = 16384
FILE_ATTRIBUTE_HIDDEN = 2
FILE_ATTRIBUTE_INTEGRITY_STREAM = 32768
FILE_ATTRIBUTE_NORMAL = 128
FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = 8192
FILE_ATTRIBUTE_NO_SCRUB_DATA = 131072
FILE_ATTRIBUTE_OFFLINE = 4096
FILE_ATTRIBUTE_READONLY = 1
FILE_ATTRIBUTE_REPARSE_POINT = 1024
FILE_ATTRIBUTE_SPARSE_FILE = 512
FILE_ATTRIBUTE_SYSTEM = 4
FILE_ATTRIBUTE_TEMPORARY = 256
FILE_ATTRIBUTE_VIRTUAL = 65536


# If available, use C implementation
try:
    from _stat import *
except ImportError:
    pass
cProfile.py000075500000015542151153537610006702 0ustar00#! /usr/bin/python3.8

"""Python interface for the 'lsprof' profiler.
   Compatible with the 'profile' module.
"""

__all__ = ["run", "runctx", "Profile"]

import _lsprof
import io
import profile as _pyprofile

# ____________________________________________________________
# Simple interface

def run(statement, filename=None, sort=-1):
    return _pyprofile._Utils(Profile).run(statement, filename, sort)

def runctx(statement, globals, locals, filename=None, sort=-1):
    return _pyprofile._Utils(Profile).runctx(statement, globals, locals,
                                             filename, sort)

run.__doc__ = _pyprofile.run.__doc__
runctx.__doc__ = _pyprofile.runctx.__doc__

# ____________________________________________________________

class Profile(_lsprof.Profiler):
    """Profile(timer=None, timeunit=None, subcalls=True, builtins=True)

    Builds a profiler object using the specified timer function.
    The default timer is a fast built-in one based on real time.
    For custom timer functions returning integers, timeunit can
    be a float specifying a scale (i.e. how long each integer unit
    is, in seconds).
    """

    # Most of the functionality is in the base class.
    # This subclass only adds convenient and backward-compatible methods.

    def print_stats(self, sort=-1):
        import pstats
        pstats.Stats(self).strip_dirs().sort_stats(sort).print_stats()

    def dump_stats(self, file):
        import marshal
        with open(file, 'wb') as f:
            self.create_stats()
            marshal.dump(self.stats, f)

    def create_stats(self):
        self.disable()
        self.snapshot_stats()

    def snapshot_stats(self):
        entries = self.getstats()
        self.stats = {}
        callersdicts = {}
        # call information
        for entry in entries:
            func = label(entry.code)
            nc = entry.callcount         # ncalls column of pstats (before '/')
            cc = nc - entry.reccallcount # ncalls column of pstats (after '/')
            tt = entry.inlinetime        # tottime column of pstats
            ct = entry.totaltime         # cumtime column of pstats
            callers = {}
            callersdicts[id(entry.code)] = callers
            self.stats[func] = cc, nc, tt, ct, callers
        # subcall information
        for entry in entries:
            if entry.calls:
                func = label(entry.code)
                for subentry in entry.calls:
                    try:
                        callers = callersdicts[id(subentry.code)]
                    except KeyError:
                        continue
                    nc = subentry.callcount
                    cc = nc - subentry.reccallcount
                    tt = subentry.inlinetime
                    ct = subentry.totaltime
                    if func in callers:
                        prev = callers[func]
                        nc += prev[0]
                        cc += prev[1]
                        tt += prev[2]
                        ct += prev[3]
                    callers[func] = nc, cc, tt, ct

    # The following two methods can be called by clients to use
    # a profiler to profile a statement, given as a string.

    def run(self, cmd):
        import __main__
        dict = __main__.__dict__
        return self.runctx(cmd, dict, dict)

    def runctx(self, cmd, globals, locals):
        self.enable()
        try:
            exec(cmd, globals, locals)
        finally:
            self.disable()
        return self

    # This method is more useful to profile a single function call.
    def runcall(*args, **kw):
        if len(args) >= 2:
            self, func, *args = args
        elif not args:
            raise TypeError("descriptor 'runcall' of 'Profile' object "
                            "needs an argument")
        elif 'func' in kw:
            func = kw.pop('func')
            self, *args = args
            import warnings
            warnings.warn("Passing 'func' as keyword argument is deprecated",
                          DeprecationWarning, stacklevel=2)
        else:
            raise TypeError('runcall expected at least 1 positional argument, '
                            'got %d' % (len(args)-1))

        self.enable()
        try:
            return func(*args, **kw)
        finally:
            self.disable()
    runcall.__text_signature__ = '($self, func, /, *args, **kw)'

    def __enter__(self):
        self.enable()
        return self

    def __exit__(self, *exc_info):
        self.disable()

# ____________________________________________________________

def label(code):
    if isinstance(code, str):
        return ('~', 0, code)    # built-in functions ('~' sorts at the end)
    else:
        return (code.co_filename, code.co_firstlineno, code.co_name)

# ____________________________________________________________

def main():
    import os
    import sys
    import runpy
    import pstats
    from optparse import OptionParser
    usage = "cProfile.py [-o output_file_path] [-s sort] [-m module | scriptfile] [arg] ..."
    parser = OptionParser(usage=usage)
    parser.allow_interspersed_args = False
    parser.add_option('-o', '--outfile', dest="outfile",
        help="Save stats to <outfile>", default=None)
    parser.add_option('-s', '--sort', dest="sort",
        help="Sort order when printing to stdout, based on pstats.Stats class",
        default=-1,
        choices=sorted(pstats.Stats.sort_arg_dict_default))
    parser.add_option('-m', dest="module", action="store_true",
        help="Profile a library module", default=False)

    if not sys.argv[1:]:
        parser.print_usage()
        sys.exit(2)

    (options, args) = parser.parse_args()
    sys.argv[:] = args

    # The script that we're profiling may chdir, so capture the absolute path
    # to the output file at startup.
    if options.outfile is not None:
        options.outfile = os.path.abspath(options.outfile)

    if len(args) > 0:
        if options.module:
            code = "run_module(modname, run_name='__main__')"
            globs = {
                'run_module': runpy.run_module,
                'modname': args[0]
            }
        else:
            progname = args[0]
            sys.path.insert(0, os.path.dirname(progname))
            with io.open_code(progname) as fp:
                code = compile(fp.read(), progname, 'exec')
            globs = {
                '__file__': progname,
                '__name__': '__main__',
                '__package__': None,
                '__cached__': None,
            }
        try:
            runctx(code, globs, None, options.outfile, options.sort)
        except BrokenPipeError as exc:
            # Prevent "Exception ignored" during interpreter shutdown.
            sys.stdout = None
            sys.exit(exc.errno)
    else:
        parser.print_usage()
    return parser

# When invoked as main program, invoke the profiler on a script
if __name__ == '__main__':
    main()
_compression.py000064400000012334151153537610007630 0ustar00"""Internal classes used by the gzip, lzma and bz2 modules"""

import io


BUFFER_SIZE = io.DEFAULT_BUFFER_SIZE  # Compressed data read chunk size


class BaseStream(io.BufferedIOBase):
    """Mode-checking helper functions."""

    def _check_not_closed(self):
        if self.closed:
            raise ValueError("I/O operation on closed file")

    def _check_can_read(self):
        if not self.readable():
            raise io.UnsupportedOperation("File not open for reading")

    def _check_can_write(self):
        if not self.writable():
            raise io.UnsupportedOperation("File not open for writing")

    def _check_can_seek(self):
        if not self.readable():
            raise io.UnsupportedOperation("Seeking is only supported "
                                          "on files open for reading")
        if not self.seekable():
            raise io.UnsupportedOperation("The underlying file object "
                                          "does not support seeking")


class DecompressReader(io.RawIOBase):
    """Adapts the decompressor API to a RawIOBase reader API"""

    def readable(self):
        return True

    def __init__(self, fp, decomp_factory, trailing_error=(), **decomp_args):
        self._fp = fp
        self._eof = False
        self._pos = 0  # Current offset in decompressed stream

        # Set to size of decompressed stream once it is known, for SEEK_END
        self._size = -1

        # Save the decompressor factory and arguments.
        # If the file contains multiple compressed streams, each
        # stream will need a separate decompressor object. A new decompressor
        # object is also needed when implementing a backwards seek().
        self._decomp_factory = decomp_factory
        self._decomp_args = decomp_args
        self._decompressor = self._decomp_factory(**self._decomp_args)

        # Exception class to catch from decompressor signifying invalid
        # trailing data to ignore
        self._trailing_error = trailing_error

    def close(self):
        self._decompressor = None
        return super().close()

    def seekable(self):
        return self._fp.seekable()

    def readinto(self, b):
        with memoryview(b) as view, view.cast("B") as byte_view:
            data = self.read(len(byte_view))
            byte_view[:len(data)] = data
        return len(data)

    def read(self, size=-1):
        if size < 0:
            return self.readall()

        if not size or self._eof:
            return b""
        data = None  # Default if EOF is encountered
        # Depending on the input data, our call to the decompressor may not
        # return any data. In this case, try again after reading another block.
        while True:
            if self._decompressor.eof:
                rawblock = (self._decompressor.unused_data or
                            self._fp.read(BUFFER_SIZE))
                if not rawblock:
                    break
                # Continue to next stream.
                self._decompressor = self._decomp_factory(
                    **self._decomp_args)
                try:
                    data = self._decompressor.decompress(rawblock, size)
                except self._trailing_error:
                    # Trailing data isn't a valid compressed stream; ignore it.
                    break
            else:
                if self._decompressor.needs_input:
                    rawblock = self._fp.read(BUFFER_SIZE)
                    if not rawblock:
                        raise EOFError("Compressed file ended before the "
                                       "end-of-stream marker was reached")
                else:
                    rawblock = b""
                data = self._decompressor.decompress(rawblock, size)
            if data:
                break
        if not data:
            self._eof = True
            self._size = self._pos
            return b""
        self._pos += len(data)
        return data

    # Rewind the file to the beginning of the data stream.
    def _rewind(self):
        self._fp.seek(0)
        self._eof = False
        self._pos = 0
        self._decompressor = self._decomp_factory(**self._decomp_args)

    def seek(self, offset, whence=io.SEEK_SET):
        # Recalculate offset as an absolute file position.
        if whence == io.SEEK_SET:
            pass
        elif whence == io.SEEK_CUR:
            offset = self._pos + offset
        elif whence == io.SEEK_END:
            # Seeking relative to EOF - we need to know the file's size.
            if self._size < 0:
                while self.read(io.DEFAULT_BUFFER_SIZE):
                    pass
            offset = self._size + offset
        else:
            raise ValueError("Invalid value for whence: {}".format(whence))

        # Make it so that offset is the number of bytes to skip forward.
        if offset < self._pos:
            self._rewind()
        else:
            offset -= self._pos

        # Read and discard data until we reach the desired position.
        while offset > 0:
            data = self.read(min(io.DEFAULT_BUFFER_SIZE, offset))
            if not data:
                break
            offset -= len(data)

        return self._pos

    def tell(self):
        """Return the current file position."""
        return self._pos
argparse.py000064400000273417151153537610006747 0ustar00# Author: Steven J. Bethard <steven.bethard@gmail.com>.
# New maintainer as of 29 August 2019:  Raymond Hettinger <raymond.hettinger@gmail.com>

"""Command-line parsing library

This module is an optparse-inspired command-line parsing library that:

    - handles both optional and positional arguments
    - produces highly informative usage messages
    - supports parsers that dispatch to sub-parsers

The following is a simple usage example that sums integers from the
command-line and writes the result to a file::

    parser = argparse.ArgumentParser(
        description='sum the integers at the command line')
    parser.add_argument(
        'integers', metavar='int', nargs='+', type=int,
        help='an integer to be summed')
    parser.add_argument(
        '--log', default=sys.stdout, type=argparse.FileType('w'),
        help='the file where the sum should be written')
    args = parser.parse_args()
    args.log.write('%s' % sum(args.integers))
    args.log.close()

The module contains the following public classes:

    - ArgumentParser -- The main entry point for command-line parsing. As the
        example above shows, the add_argument() method is used to populate
        the parser with actions for optional and positional arguments. Then
        the parse_args() method is invoked to convert the args at the
        command-line into an object with attributes.

    - ArgumentError -- The exception raised by ArgumentParser objects when
        there are errors with the parser's actions. Errors raised while
        parsing the command-line are caught by ArgumentParser and emitted
        as command-line messages.

    - FileType -- A factory for defining types of files to be created. As the
        example above shows, instances of FileType are typically passed as
        the type= argument of add_argument() calls.

    - Action -- The base class for parser actions. Typically actions are
        selected by passing strings like 'store_true' or 'append_const' to
        the action= argument of add_argument(). However, for greater
        customization of ArgumentParser actions, subclasses of Action may
        be defined and passed as the action= argument.

    - HelpFormatter, RawDescriptionHelpFormatter, RawTextHelpFormatter,
        ArgumentDefaultsHelpFormatter -- Formatter classes which
        may be passed as the formatter_class= argument to the
        ArgumentParser constructor. HelpFormatter is the default,
        RawDescriptionHelpFormatter and RawTextHelpFormatter tell the parser
        not to change the formatting for help text, and
        ArgumentDefaultsHelpFormatter adds information about argument defaults
        to the help.

All other classes in this module are considered implementation details.
(Also note that HelpFormatter and RawDescriptionHelpFormatter are only
considered public as object names -- the API of the formatter objects is
still considered an implementation detail.)
"""

__version__ = '1.1'
__all__ = [
    'ArgumentParser',
    'ArgumentError',
    'ArgumentTypeError',
    'FileType',
    'HelpFormatter',
    'ArgumentDefaultsHelpFormatter',
    'RawDescriptionHelpFormatter',
    'RawTextHelpFormatter',
    'MetavarTypeHelpFormatter',
    'Namespace',
    'Action',
    'ONE_OR_MORE',
    'OPTIONAL',
    'PARSER',
    'REMAINDER',
    'SUPPRESS',
    'ZERO_OR_MORE',
]


import os as _os
import re as _re
import shutil as _shutil
import sys as _sys

from gettext import gettext as _, ngettext

SUPPRESS = '==SUPPRESS=='

OPTIONAL = '?'
ZERO_OR_MORE = '*'
ONE_OR_MORE = '+'
PARSER = 'A...'
REMAINDER = '...'
_UNRECOGNIZED_ARGS_ATTR = '_unrecognized_args'

# =============================
# Utility functions and classes
# =============================

class _AttributeHolder(object):
    """Abstract base class that provides __repr__.

    The __repr__ method returns a string in the format::
        ClassName(attr=name, attr=name, ...)
    The attributes are determined either by a class-level attribute,
    '_kwarg_names', or by inspecting the instance __dict__.
    """

    def __repr__(self):
        type_name = type(self).__name__
        arg_strings = []
        star_args = {}
        for arg in self._get_args():
            arg_strings.append(repr(arg))
        for name, value in self._get_kwargs():
            if name.isidentifier():
                arg_strings.append('%s=%r' % (name, value))
            else:
                star_args[name] = value
        if star_args:
            arg_strings.append('**%s' % repr(star_args))
        return '%s(%s)' % (type_name, ', '.join(arg_strings))

    def _get_kwargs(self):
        return sorted(self.__dict__.items())

    def _get_args(self):
        return []


def _copy_items(items):
    if items is None:
        return []
    # The copy module is used only in the 'append' and 'append_const'
    # actions, and it is needed only when the default value isn't a list.
    # Delay its import for speeding up the common case.
    if type(items) is list:
        return items[:]
    import copy
    return copy.copy(items)


# ===============
# Formatting Help
# ===============

class HelpFormatter(object):
    """Formatter for generating usage messages and argument help strings.

    Only the name of this class is considered a public API. All the methods
    provided by the class are considered an implementation detail.
    """

    def __init__(self,
                 prog,
                 indent_increment=2,
                 max_help_position=24,
                 width=None):

        # default setting for width
        if width is None:
            width = _shutil.get_terminal_size().columns
            width -= 2

        self._prog = prog
        self._indent_increment = indent_increment
        self._max_help_position = min(max_help_position,
                                      max(width - 20, indent_increment * 2))
        self._width = width

        self._current_indent = 0
        self._level = 0
        self._action_max_length = 0

        self._root_section = self._Section(self, None)
        self._current_section = self._root_section

        self._whitespace_matcher = _re.compile(r'\s+', _re.ASCII)
        self._long_break_matcher = _re.compile(r'\n\n\n+')

    # ===============================
    # Section and indentation methods
    # ===============================
    def _indent(self):
        self._current_indent += self._indent_increment
        self._level += 1

    def _dedent(self):
        self._current_indent -= self._indent_increment
        assert self._current_indent >= 0, 'Indent decreased below 0.'
        self._level -= 1

    class _Section(object):

        def __init__(self, formatter, parent, heading=None):
            self.formatter = formatter
            self.parent = parent
            self.heading = heading
            self.items = []

        def format_help(self):
            # format the indented section
            if self.parent is not None:
                self.formatter._indent()
            join = self.formatter._join_parts
            item_help = join([func(*args) for func, args in self.items])
            if self.parent is not None:
                self.formatter._dedent()

            # return nothing if the section was empty
            if not item_help:
                return ''

            # add the heading if the section was non-empty
            if self.heading is not SUPPRESS and self.heading is not None:
                current_indent = self.formatter._current_indent
                heading = '%*s%s:\n' % (current_indent, '', self.heading)
            else:
                heading = ''

            # join the section-initial newline, the heading and the help
            return join(['\n', heading, item_help, '\n'])

    def _add_item(self, func, args):
        self._current_section.items.append((func, args))

    # ========================
    # Message building methods
    # ========================
    def start_section(self, heading):
        self._indent()
        section = self._Section(self, self._current_section, heading)
        self._add_item(section.format_help, [])
        self._current_section = section

    def end_section(self):
        self._current_section = self._current_section.parent
        self._dedent()

    def add_text(self, text):
        if text is not SUPPRESS and text is not None:
            self._add_item(self._format_text, [text])

    def add_usage(self, usage, actions, groups, prefix=None):
        if usage is not SUPPRESS:
            args = usage, actions, groups, prefix
            self._add_item(self._format_usage, args)

    def add_argument(self, action):
        if action.help is not SUPPRESS:

            # find all invocations
            get_invocation = self._format_action_invocation
            invocations = [get_invocation(action)]
            for subaction in self._iter_indented_subactions(action):
                invocations.append(get_invocation(subaction))

            # update the maximum item length
            invocation_length = max([len(s) for s in invocations])
            action_length = invocation_length + self._current_indent
            self._action_max_length = max(self._action_max_length,
                                          action_length)

            # add the item to the list
            self._add_item(self._format_action, [action])

    def add_arguments(self, actions):
        for action in actions:
            self.add_argument(action)

    # =======================
    # Help-formatting methods
    # =======================
    def format_help(self):
        help = self._root_section.format_help()
        if help:
            help = self._long_break_matcher.sub('\n\n', help)
            help = help.strip('\n') + '\n'
        return help

    def _join_parts(self, part_strings):
        return ''.join([part
                        for part in part_strings
                        if part and part is not SUPPRESS])

    def _format_usage(self, usage, actions, groups, prefix):
        if prefix is None:
            prefix = _('usage: ')

        # if usage is specified, use that
        if usage is not None:
            usage = usage % dict(prog=self._prog)

        # if no optionals or positionals are available, usage is just prog
        elif usage is None and not actions:
            usage = '%(prog)s' % dict(prog=self._prog)

        # if optionals and positionals are available, calculate usage
        elif usage is None:
            prog = '%(prog)s' % dict(prog=self._prog)

            # split optionals from positionals
            optionals = []
            positionals = []
            for action in actions:
                if action.option_strings:
                    optionals.append(action)
                else:
                    positionals.append(action)

            # build full usage string
            format = self._format_actions_usage
            action_usage = format(optionals + positionals, groups)
            usage = ' '.join([s for s in [prog, action_usage] if s])

            # wrap the usage parts if it's too long
            text_width = self._width - self._current_indent
            if len(prefix) + len(usage) > text_width:

                # break usage into wrappable parts
                part_regexp = (
                    r'\(.*?\)+(?=\s|$)|'
                    r'\[.*?\]+(?=\s|$)|'
                    r'\S+'
                )
                opt_usage = format(optionals, groups)
                pos_usage = format(positionals, groups)
                opt_parts = _re.findall(part_regexp, opt_usage)
                pos_parts = _re.findall(part_regexp, pos_usage)
                assert ' '.join(opt_parts) == opt_usage
                assert ' '.join(pos_parts) == pos_usage

                # helper for wrapping lines
                def get_lines(parts, indent, prefix=None):
                    lines = []
                    line = []
                    if prefix is not None:
                        line_len = len(prefix) - 1
                    else:
                        line_len = len(indent) - 1
                    for part in parts:
                        if line_len + 1 + len(part) > text_width and line:
                            lines.append(indent + ' '.join(line))
                            line = []
                            line_len = len(indent) - 1
                        line.append(part)
                        line_len += len(part) + 1
                    if line:
                        lines.append(indent + ' '.join(line))
                    if prefix is not None:
                        lines[0] = lines[0][len(indent):]
                    return lines

                # if prog is short, follow it with optionals or positionals
                if len(prefix) + len(prog) <= 0.75 * text_width:
                    indent = ' ' * (len(prefix) + len(prog) + 1)
                    if opt_parts:
                        lines = get_lines([prog] + opt_parts, indent, prefix)
                        lines.extend(get_lines(pos_parts, indent))
                    elif pos_parts:
                        lines = get_lines([prog] + pos_parts, indent, prefix)
                    else:
                        lines = [prog]

                # if prog is long, put it on its own line
                else:
                    indent = ' ' * len(prefix)
                    parts = opt_parts + pos_parts
                    lines = get_lines(parts, indent)
                    if len(lines) > 1:
                        lines = []
                        lines.extend(get_lines(opt_parts, indent))
                        lines.extend(get_lines(pos_parts, indent))
                    lines = [prog] + lines

                # join lines into usage
                usage = '\n'.join(lines)

        # prefix with 'usage:'
        return '%s%s\n\n' % (prefix, usage)

    def _format_actions_usage(self, actions, groups):
        # find group indices and identify actions in groups
        group_actions = set()
        inserts = {}
        for group in groups:
            try:
                start = actions.index(group._group_actions[0])
            except ValueError:
                continue
            else:
                end = start + len(group._group_actions)
                if actions[start:end] == group._group_actions:
                    for action in group._group_actions:
                        group_actions.add(action)
                    if not group.required:
                        if start in inserts:
                            inserts[start] += ' ['
                        else:
                            inserts[start] = '['
                        if end in inserts:
                            inserts[end] += ']'
                        else:
                            inserts[end] = ']'
                    else:
                        if start in inserts:
                            inserts[start] += ' ('
                        else:
                            inserts[start] = '('
                        if end in inserts:
                            inserts[end] += ')'
                        else:
                            inserts[end] = ')'
                    for i in range(start + 1, end):
                        inserts[i] = '|'

        # collect all actions format strings
        parts = []
        for i, action in enumerate(actions):

            # suppressed arguments are marked with None
            # remove | separators for suppressed arguments
            if action.help is SUPPRESS:
                parts.append(None)
                if inserts.get(i) == '|':
                    inserts.pop(i)
                elif inserts.get(i + 1) == '|':
                    inserts.pop(i + 1)

            # produce all arg strings
            elif not action.option_strings:
                default = self._get_default_metavar_for_positional(action)
                part = self._format_args(action, default)

                # if it's in a group, strip the outer []
                if action in group_actions:
                    if part[0] == '[' and part[-1] == ']':
                        part = part[1:-1]

                # add the action string to the list
                parts.append(part)

            # produce the first way to invoke the option in brackets
            else:
                option_string = action.option_strings[0]

                # if the Optional doesn't take a value, format is:
                #    -s or --long
                if action.nargs == 0:
                    part = '%s' % option_string

                # if the Optional takes a value, format is:
                #    -s ARGS or --long ARGS
                else:
                    default = self._get_default_metavar_for_optional(action)
                    args_string = self._format_args(action, default)
                    part = '%s %s' % (option_string, args_string)

                # make it look optional if it's not required or in a group
                if not action.required and action not in group_actions:
                    part = '[%s]' % part

                # add the action string to the list
                parts.append(part)

        # insert things at the necessary indices
        for i in sorted(inserts, reverse=True):
            parts[i:i] = [inserts[i]]

        # join all the action items with spaces
        text = ' '.join([item for item in parts if item is not None])

        # clean up separators for mutually exclusive groups
        open = r'[\[(]'
        close = r'[\])]'
        text = _re.sub(r'(%s) ' % open, r'\1', text)
        text = _re.sub(r' (%s)' % close, r'\1', text)
        text = _re.sub(r'%s *%s' % (open, close), r'', text)
        text = _re.sub(r'\(([^|]*)\)', r'\1', text)
        text = text.strip()

        # return the text
        return text

    def _format_text(self, text):
        if '%(prog)' in text:
            text = text % dict(prog=self._prog)
        text_width = max(self._width - self._current_indent, 11)
        indent = ' ' * self._current_indent
        return self._fill_text(text, text_width, indent) + '\n\n'

    def _format_action(self, action):
        # determine the required width and the entry label
        help_position = min(self._action_max_length + 2,
                            self._max_help_position)
        help_width = max(self._width - help_position, 11)
        action_width = help_position - self._current_indent - 2
        action_header = self._format_action_invocation(action)

        # no help; start on same line and add a final newline
        if not action.help:
            tup = self._current_indent, '', action_header
            action_header = '%*s%s\n' % tup

        # short action name; start on the same line and pad two spaces
        elif len(action_header) <= action_width:
            tup = self._current_indent, '', action_width, action_header
            action_header = '%*s%-*s  ' % tup
            indent_first = 0

        # long action name; start on the next line
        else:
            tup = self._current_indent, '', action_header
            action_header = '%*s%s\n' % tup
            indent_first = help_position

        # collect the pieces of the action help
        parts = [action_header]

        # if there was help for the action, add lines of help text
        if action.help:
            help_text = self._expand_help(action)
            help_lines = self._split_lines(help_text, help_width)
            parts.append('%*s%s\n' % (indent_first, '', help_lines[0]))
            for line in help_lines[1:]:
                parts.append('%*s%s\n' % (help_position, '', line))

        # or add a newline if the description doesn't end with one
        elif not action_header.endswith('\n'):
            parts.append('\n')

        # if there are any sub-actions, add their help as well
        for subaction in self._iter_indented_subactions(action):
            parts.append(self._format_action(subaction))

        # return a single string
        return self._join_parts(parts)

    def _format_action_invocation(self, action):
        if not action.option_strings:
            default = self._get_default_metavar_for_positional(action)
            metavar, = self._metavar_formatter(action, default)(1)
            return metavar

        else:
            parts = []

            # if the Optional doesn't take a value, format is:
            #    -s, --long
            if action.nargs == 0:
                parts.extend(action.option_strings)

            # if the Optional takes a value, format is:
            #    -s ARGS, --long ARGS
            else:
                default = self._get_default_metavar_for_optional(action)
                args_string = self._format_args(action, default)
                for option_string in action.option_strings:
                    parts.append('%s %s' % (option_string, args_string))

            return ', '.join(parts)

    def _metavar_formatter(self, action, default_metavar):
        if action.metavar is not None:
            result = action.metavar
        elif action.choices is not None:
            choice_strs = [str(choice) for choice in action.choices]
            result = '{%s}' % ','.join(choice_strs)
        else:
            result = default_metavar

        def format(tuple_size):
            if isinstance(result, tuple):
                return result
            else:
                return (result, ) * tuple_size
        return format

    def _format_args(self, action, default_metavar):
        get_metavar = self._metavar_formatter(action, default_metavar)
        if action.nargs is None:
            result = '%s' % get_metavar(1)
        elif action.nargs == OPTIONAL:
            result = '[%s]' % get_metavar(1)
        elif action.nargs == ZERO_OR_MORE:
            result = '[%s [%s ...]]' % get_metavar(2)
        elif action.nargs == ONE_OR_MORE:
            result = '%s [%s ...]' % get_metavar(2)
        elif action.nargs == REMAINDER:
            result = '...'
        elif action.nargs == PARSER:
            result = '%s ...' % get_metavar(1)
        elif action.nargs == SUPPRESS:
            result = ''
        else:
            try:
                formats = ['%s' for _ in range(action.nargs)]
            except TypeError:
                raise ValueError("invalid nargs value") from None
            result = ' '.join(formats) % get_metavar(action.nargs)
        return result

    def _expand_help(self, action):
        params = dict(vars(action), prog=self._prog)
        for name in list(params):
            if params[name] is SUPPRESS:
                del params[name]
        for name in list(params):
            if hasattr(params[name], '__name__'):
                params[name] = params[name].__name__
        if params.get('choices') is not None:
            choices_str = ', '.join([str(c) for c in params['choices']])
            params['choices'] = choices_str
        return self._get_help_string(action) % params

    def _iter_indented_subactions(self, action):
        try:
            get_subactions = action._get_subactions
        except AttributeError:
            pass
        else:
            self._indent()
            yield from get_subactions()
            self._dedent()

    def _split_lines(self, text, width):
        text = self._whitespace_matcher.sub(' ', text).strip()
        # The textwrap module is used only for formatting help.
        # Delay its import for speeding up the common usage of argparse.
        import textwrap
        return textwrap.wrap(text, width)

    def _fill_text(self, text, width, indent):
        text = self._whitespace_matcher.sub(' ', text).strip()
        import textwrap
        return textwrap.fill(text, width,
                             initial_indent=indent,
                             subsequent_indent=indent)

    def _get_help_string(self, action):
        return action.help

    def _get_default_metavar_for_optional(self, action):
        return action.dest.upper()

    def _get_default_metavar_for_positional(self, action):
        return action.dest


class RawDescriptionHelpFormatter(HelpFormatter):
    """Help message formatter which retains any formatting in descriptions.

    Only the name of this class is considered a public API. All the methods
    provided by the class are considered an implementation detail.
    """

    def _fill_text(self, text, width, indent):
        return ''.join(indent + line for line in text.splitlines(keepends=True))


class RawTextHelpFormatter(RawDescriptionHelpFormatter):
    """Help message formatter which retains formatting of all help text.

    Only the name of this class is considered a public API. All the methods
    provided by the class are considered an implementation detail.
    """

    def _split_lines(self, text, width):
        return text.splitlines()


class ArgumentDefaultsHelpFormatter(HelpFormatter):
    """Help message formatter which adds default values to argument help.

    Only the name of this class is considered a public API. All the methods
    provided by the class are considered an implementation detail.
    """

    def _get_help_string(self, action):
        help = action.help
        if '%(default)' not in action.help:
            if action.default is not SUPPRESS:
                defaulting_nargs = [OPTIONAL, ZERO_OR_MORE]
                if action.option_strings or action.nargs in defaulting_nargs:
                    help += ' (default: %(default)s)'
        return help


class MetavarTypeHelpFormatter(HelpFormatter):
    """Help message formatter which uses the argument 'type' as the default
    metavar value (instead of the argument 'dest')

    Only the name of this class is considered a public API. All the methods
    provided by the class are considered an implementation detail.
    """

    def _get_default_metavar_for_optional(self, action):
        return action.type.__name__

    def _get_default_metavar_for_positional(self, action):
        return action.type.__name__



# =====================
# Options and Arguments
# =====================

def _get_action_name(argument):
    if argument is None:
        return None
    elif argument.option_strings:
        return  '/'.join(argument.option_strings)
    elif argument.metavar not in (None, SUPPRESS):
        return argument.metavar
    elif argument.dest not in (None, SUPPRESS):
        return argument.dest
    else:
        return None


class ArgumentError(Exception):
    """An error from creating or using an argument (optional or positional).

    The string value of this exception is the message, augmented with
    information about the argument that caused it.
    """

    def __init__(self, argument, message):
        self.argument_name = _get_action_name(argument)
        self.message = message

    def __str__(self):
        if self.argument_name is None:
            format = '%(message)s'
        else:
            format = 'argument %(argument_name)s: %(message)s'
        return format % dict(message=self.message,
                             argument_name=self.argument_name)


class ArgumentTypeError(Exception):
    """An error from trying to convert a command line string to a type."""
    pass


# ==============
# Action classes
# ==============

class Action(_AttributeHolder):
    """Information about how to convert command line strings to Python objects.

    Action objects are used by an ArgumentParser to represent the information
    needed to parse a single argument from one or more strings from the
    command line. The keyword arguments to the Action constructor are also
    all attributes of Action instances.

    Keyword Arguments:

        - option_strings -- A list of command-line option strings which
            should be associated with this action.

        - dest -- The name of the attribute to hold the created object(s)

        - nargs -- The number of command-line arguments that should be
            consumed. By default, one argument will be consumed and a single
            value will be produced.  Other values include:
                - N (an integer) consumes N arguments (and produces a list)
                - '?' consumes zero or one arguments
                - '*' consumes zero or more arguments (and produces a list)
                - '+' consumes one or more arguments (and produces a list)
            Note that the difference between the default and nargs=1 is that
            with the default, a single value will be produced, while with
            nargs=1, a list containing a single value will be produced.

        - const -- The value to be produced if the option is specified and the
            option uses an action that takes no values.

        - default -- The value to be produced if the option is not specified.

        - type -- A callable that accepts a single string argument, and
            returns the converted value.  The standard Python types str, int,
            float, and complex are useful examples of such callables.  If None,
            str is used.

        - choices -- A container of values that should be allowed. If not None,
            after a command-line argument has been converted to the appropriate
            type, an exception will be raised if it is not a member of this
            collection.

        - required -- True if the action must always be specified at the
            command line. This is only meaningful for optional command-line
            arguments.

        - help -- The help string describing the argument.

        - metavar -- The name to be used for the option's argument with the
            help string. If None, the 'dest' value will be used as the name.
    """

    def __init__(self,
                 option_strings,
                 dest,
                 nargs=None,
                 const=None,
                 default=None,
                 type=None,
                 choices=None,
                 required=False,
                 help=None,
                 metavar=None):
        self.option_strings = option_strings
        self.dest = dest
        self.nargs = nargs
        self.const = const
        self.default = default
        self.type = type
        self.choices = choices
        self.required = required
        self.help = help
        self.metavar = metavar

    def _get_kwargs(self):
        names = [
            'option_strings',
            'dest',
            'nargs',
            'const',
            'default',
            'type',
            'choices',
            'help',
            'metavar',
        ]
        return [(name, getattr(self, name)) for name in names]

    def __call__(self, parser, namespace, values, option_string=None):
        raise NotImplementedError(_('.__call__() not defined'))


class _StoreAction(Action):

    def __init__(self,
                 option_strings,
                 dest,
                 nargs=None,
                 const=None,
                 default=None,
                 type=None,
                 choices=None,
                 required=False,
                 help=None,
                 metavar=None):
        if nargs == 0:
            raise ValueError('nargs for store actions must be != 0; if you '
                             'have nothing to store, actions such as store '
                             'true or store const may be more appropriate')
        if const is not None and nargs != OPTIONAL:
            raise ValueError('nargs must be %r to supply const' % OPTIONAL)
        super(_StoreAction, self).__init__(
            option_strings=option_strings,
            dest=dest,
            nargs=nargs,
            const=const,
            default=default,
            type=type,
            choices=choices,
            required=required,
            help=help,
            metavar=metavar)

    def __call__(self, parser, namespace, values, option_string=None):
        setattr(namespace, self.dest, values)


class _StoreConstAction(Action):

    def __init__(self,
                 option_strings,
                 dest,
                 const,
                 default=None,
                 required=False,
                 help=None,
                 metavar=None):
        super(_StoreConstAction, self).__init__(
            option_strings=option_strings,
            dest=dest,
            nargs=0,
            const=const,
            default=default,
            required=required,
            help=help)

    def __call__(self, parser, namespace, values, option_string=None):
        setattr(namespace, self.dest, self.const)


class _StoreTrueAction(_StoreConstAction):

    def __init__(self,
                 option_strings,
                 dest,
                 default=False,
                 required=False,
                 help=None):
        super(_StoreTrueAction, self).__init__(
            option_strings=option_strings,
            dest=dest,
            const=True,
            default=default,
            required=required,
            help=help)


class _StoreFalseAction(_StoreConstAction):

    def __init__(self,
                 option_strings,
                 dest,
                 default=True,
                 required=False,
                 help=None):
        super(_StoreFalseAction, self).__init__(
            option_strings=option_strings,
            dest=dest,
            const=False,
            default=default,
            required=required,
            help=help)


class _AppendAction(Action):

    def __init__(self,
                 option_strings,
                 dest,
                 nargs=None,
                 const=None,
                 default=None,
                 type=None,
                 choices=None,
                 required=False,
                 help=None,
                 metavar=None):
        if nargs == 0:
            raise ValueError('nargs for append actions must be != 0; if arg '
                             'strings are not supplying the value to append, '
                             'the append const action may be more appropriate')
        if const is not None and nargs != OPTIONAL:
            raise ValueError('nargs must be %r to supply const' % OPTIONAL)
        super(_AppendAction, self).__init__(
            option_strings=option_strings,
            dest=dest,
            nargs=nargs,
            const=const,
            default=default,
            type=type,
            choices=choices,
            required=required,
            help=help,
            metavar=metavar)

    def __call__(self, parser, namespace, values, option_string=None):
        items = getattr(namespace, self.dest, None)
        items = _copy_items(items)
        items.append(values)
        setattr(namespace, self.dest, items)


class _AppendConstAction(Action):

    def __init__(self,
                 option_strings,
                 dest,
                 const,
                 default=None,
                 required=False,
                 help=None,
                 metavar=None):
        super(_AppendConstAction, self).__init__(
            option_strings=option_strings,
            dest=dest,
            nargs=0,
            const=const,
            default=default,
            required=required,
            help=help,
            metavar=metavar)

    def __call__(self, parser, namespace, values, option_string=None):
        items = getattr(namespace, self.dest, None)
        items = _copy_items(items)
        items.append(self.const)
        setattr(namespace, self.dest, items)


class _CountAction(Action):

    def __init__(self,
                 option_strings,
                 dest,
                 default=None,
                 required=False,
                 help=None):
        super(_CountAction, self).__init__(
            option_strings=option_strings,
            dest=dest,
            nargs=0,
            default=default,
            required=required,
            help=help)

    def __call__(self, parser, namespace, values, option_string=None):
        count = getattr(namespace, self.dest, None)
        if count is None:
            count = 0
        setattr(namespace, self.dest, count + 1)


class _HelpAction(Action):

    def __init__(self,
                 option_strings,
                 dest=SUPPRESS,
                 default=SUPPRESS,
                 help=None):
        super(_HelpAction, self).__init__(
            option_strings=option_strings,
            dest=dest,
            default=default,
            nargs=0,
            help=help)

    def __call__(self, parser, namespace, values, option_string=None):
        parser.print_help()
        parser.exit()


class _VersionAction(Action):

    def __init__(self,
                 option_strings,
                 version=None,
                 dest=SUPPRESS,
                 default=SUPPRESS,
                 help="show program's version number and exit"):
        super(_VersionAction, self).__init__(
            option_strings=option_strings,
            dest=dest,
            default=default,
            nargs=0,
            help=help)
        self.version = version

    def __call__(self, parser, namespace, values, option_string=None):
        version = self.version
        if version is None:
            version = parser.version
        formatter = parser._get_formatter()
        formatter.add_text(version)
        parser._print_message(formatter.format_help(), _sys.stdout)
        parser.exit()


class _SubParsersAction(Action):

    class _ChoicesPseudoAction(Action):

        def __init__(self, name, aliases, help):
            metavar = dest = name
            if aliases:
                metavar += ' (%s)' % ', '.join(aliases)
            sup = super(_SubParsersAction._ChoicesPseudoAction, self)
            sup.__init__(option_strings=[], dest=dest, help=help,
                         metavar=metavar)

    def __init__(self,
                 option_strings,
                 prog,
                 parser_class,
                 dest=SUPPRESS,
                 required=False,
                 help=None,
                 metavar=None):

        self._prog_prefix = prog
        self._parser_class = parser_class
        self._name_parser_map = {}
        self._choices_actions = []

        super(_SubParsersAction, self).__init__(
            option_strings=option_strings,
            dest=dest,
            nargs=PARSER,
            choices=self._name_parser_map,
            required=required,
            help=help,
            metavar=metavar)

    def add_parser(self, name, **kwargs):
        # set prog from the existing prefix
        if kwargs.get('prog') is None:
            kwargs['prog'] = '%s %s' % (self._prog_prefix, name)

        aliases = kwargs.pop('aliases', ())

        # create a pseudo-action to hold the choice help
        if 'help' in kwargs:
            help = kwargs.pop('help')
            choice_action = self._ChoicesPseudoAction(name, aliases, help)
            self._choices_actions.append(choice_action)

        # create the parser and add it to the map
        parser = self._parser_class(**kwargs)
        self._name_parser_map[name] = parser

        # make parser available under aliases also
        for alias in aliases:
            self._name_parser_map[alias] = parser

        return parser

    def _get_subactions(self):
        return self._choices_actions

    def __call__(self, parser, namespace, values, option_string=None):
        parser_name = values[0]
        arg_strings = values[1:]

        # set the parser name if requested
        if self.dest is not SUPPRESS:
            setattr(namespace, self.dest, parser_name)

        # select the parser
        try:
            parser = self._name_parser_map[parser_name]
        except KeyError:
            args = {'parser_name': parser_name,
                    'choices': ', '.join(self._name_parser_map)}
            msg = _('unknown parser %(parser_name)r (choices: %(choices)s)') % args
            raise ArgumentError(self, msg)

        # parse all the remaining options into the namespace
        # store any unrecognized options on the object, so that the top
        # level parser can decide what to do with them

        # In case this subparser defines new defaults, we parse them
        # in a new namespace object and then update the original
        # namespace for the relevant parts.
        subnamespace, arg_strings = parser.parse_known_args(arg_strings, None)
        for key, value in vars(subnamespace).items():
            setattr(namespace, key, value)

        if arg_strings:
            vars(namespace).setdefault(_UNRECOGNIZED_ARGS_ATTR, [])
            getattr(namespace, _UNRECOGNIZED_ARGS_ATTR).extend(arg_strings)

class _ExtendAction(_AppendAction):
    def __call__(self, parser, namespace, values, option_string=None):
        items = getattr(namespace, self.dest, None)
        items = _copy_items(items)
        items.extend(values)
        setattr(namespace, self.dest, items)

# ==============
# Type classes
# ==============

class FileType(object):
    """Factory for creating file object types

    Instances of FileType are typically passed as type= arguments to the
    ArgumentParser add_argument() method.

    Keyword Arguments:
        - mode -- A string indicating how the file is to be opened. Accepts the
            same values as the builtin open() function.
        - bufsize -- The file's desired buffer size. Accepts the same values as
            the builtin open() function.
        - encoding -- The file's encoding. Accepts the same values as the
            builtin open() function.
        - errors -- A string indicating how encoding and decoding errors are to
            be handled. Accepts the same value as the builtin open() function.
    """

    def __init__(self, mode='r', bufsize=-1, encoding=None, errors=None):
        self._mode = mode
        self._bufsize = bufsize
        self._encoding = encoding
        self._errors = errors

    def __call__(self, string):
        # the special argument "-" means sys.std{in,out}
        if string == '-':
            if 'r' in self._mode:
                return _sys.stdin
            elif 'w' in self._mode:
                return _sys.stdout
            else:
                msg = _('argument "-" with mode %r') % self._mode
                raise ValueError(msg)

        # all other arguments are used as file names
        try:
            return open(string, self._mode, self._bufsize, self._encoding,
                        self._errors)
        except OSError as e:
            args = {'filename': string, 'error': e}
            message = _("can't open '%(filename)s': %(error)s")
            raise ArgumentTypeError(message % args)

    def __repr__(self):
        args = self._mode, self._bufsize
        kwargs = [('encoding', self._encoding), ('errors', self._errors)]
        args_str = ', '.join([repr(arg) for arg in args if arg != -1] +
                             ['%s=%r' % (kw, arg) for kw, arg in kwargs
                              if arg is not None])
        return '%s(%s)' % (type(self).__name__, args_str)

# ===========================
# Optional and Positional Parsing
# ===========================

class Namespace(_AttributeHolder):
    """Simple object for storing attributes.

    Implements equality by attribute names and values, and provides a simple
    string representation.
    """

    def __init__(self, **kwargs):
        for name in kwargs:
            setattr(self, name, kwargs[name])

    def __eq__(self, other):
        if not isinstance(other, Namespace):
            return NotImplemented
        return vars(self) == vars(other)

    def __contains__(self, key):
        return key in self.__dict__


class _ActionsContainer(object):

    def __init__(self,
                 description,
                 prefix_chars,
                 argument_default,
                 conflict_handler):
        super(_ActionsContainer, self).__init__()

        self.description = description
        self.argument_default = argument_default
        self.prefix_chars = prefix_chars
        self.conflict_handler = conflict_handler

        # set up registries
        self._registries = {}

        # register actions
        self.register('action', None, _StoreAction)
        self.register('action', 'store', _StoreAction)
        self.register('action', 'store_const', _StoreConstAction)
        self.register('action', 'store_true', _StoreTrueAction)
        self.register('action', 'store_false', _StoreFalseAction)
        self.register('action', 'append', _AppendAction)
        self.register('action', 'append_const', _AppendConstAction)
        self.register('action', 'count', _CountAction)
        self.register('action', 'help', _HelpAction)
        self.register('action', 'version', _VersionAction)
        self.register('action', 'parsers', _SubParsersAction)
        self.register('action', 'extend', _ExtendAction)

        # raise an exception if the conflict handler is invalid
        self._get_handler()

        # action storage
        self._actions = []
        self._option_string_actions = {}

        # groups
        self._action_groups = []
        self._mutually_exclusive_groups = []

        # defaults storage
        self._defaults = {}

        # determines whether an "option" looks like a negative number
        self._negative_number_matcher = _re.compile(r'^-\d+$|^-\d*\.\d+$')

        # whether or not there are any optionals that look like negative
        # numbers -- uses a list so it can be shared and edited
        self._has_negative_number_optionals = []

    # ====================
    # Registration methods
    # ====================
    def register(self, registry_name, value, object):
        registry = self._registries.setdefault(registry_name, {})
        registry[value] = object

    def _registry_get(self, registry_name, value, default=None):
        return self._registries[registry_name].get(value, default)

    # ==================================
    # Namespace default accessor methods
    # ==================================
    def set_defaults(self, **kwargs):
        self._defaults.update(kwargs)

        # if these defaults match any existing arguments, replace
        # the previous default on the object with the new one
        for action in self._actions:
            if action.dest in kwargs:
                action.default = kwargs[action.dest]

    def get_default(self, dest):
        for action in self._actions:
            if action.dest == dest and action.default is not None:
                return action.default
        return self._defaults.get(dest, None)


    # =======================
    # Adding argument actions
    # =======================
    def add_argument(self, *args, **kwargs):
        """
        add_argument(dest, ..., name=value, ...)
        add_argument(option_string, option_string, ..., name=value, ...)
        """

        # if no positional args are supplied or only one is supplied and
        # it doesn't look like an option string, parse a positional
        # argument
        chars = self.prefix_chars
        if not args or len(args) == 1 and args[0][0] not in chars:
            if args and 'dest' in kwargs:
                raise ValueError('dest supplied twice for positional argument')
            kwargs = self._get_positional_kwargs(*args, **kwargs)

        # otherwise, we're adding an optional argument
        else:
            kwargs = self._get_optional_kwargs(*args, **kwargs)

        # if no default was supplied, use the parser-level default
        if 'default' not in kwargs:
            dest = kwargs['dest']
            if dest in self._defaults:
                kwargs['default'] = self._defaults[dest]
            elif self.argument_default is not None:
                kwargs['default'] = self.argument_default

        # create the action object, and add it to the parser
        action_class = self._pop_action_class(kwargs)
        if not callable(action_class):
            raise ValueError('unknown action "%s"' % (action_class,))
        action = action_class(**kwargs)

        # raise an error if the action type is not callable
        type_func = self._registry_get('type', action.type, action.type)
        if not callable(type_func):
            raise ValueError('%r is not callable' % (type_func,))

        if type_func is FileType:
            raise ValueError('%r is a FileType class object, instance of it'
                             ' must be passed' % (type_func,))

        # raise an error if the metavar does not match the type
        if hasattr(self, "_get_formatter"):
            try:
                self._get_formatter()._format_args(action, None)
            except TypeError:
                raise ValueError("length of metavar tuple does not match nargs")

        return self._add_action(action)

    def add_argument_group(self, *args, **kwargs):
        group = _ArgumentGroup(self, *args, **kwargs)
        self._action_groups.append(group)
        return group

    def add_mutually_exclusive_group(self, **kwargs):
        group = _MutuallyExclusiveGroup(self, **kwargs)
        self._mutually_exclusive_groups.append(group)
        return group

    def _add_action(self, action):
        # resolve any conflicts
        self._check_conflict(action)

        # add to actions list
        self._actions.append(action)
        action.container = self

        # index the action by any option strings it has
        for option_string in action.option_strings:
            self._option_string_actions[option_string] = action

        # set the flag if any option strings look like negative numbers
        for option_string in action.option_strings:
            if self._negative_number_matcher.match(option_string):
                if not self._has_negative_number_optionals:
                    self._has_negative_number_optionals.append(True)

        # return the created action
        return action

    def _remove_action(self, action):
        self._actions.remove(action)

    def _add_container_actions(self, container):
        # collect groups by titles
        title_group_map = {}
        for group in self._action_groups:
            if group.title in title_group_map:
                msg = _('cannot merge actions - two groups are named %r')
                raise ValueError(msg % (group.title))
            title_group_map[group.title] = group

        # map each action to its group
        group_map = {}
        for group in container._action_groups:

            # if a group with the title exists, use that, otherwise
            # create a new group matching the container's group
            if group.title not in title_group_map:
                title_group_map[group.title] = self.add_argument_group(
                    title=group.title,
                    description=group.description,
                    conflict_handler=group.conflict_handler)

            # map the actions to their new group
            for action in group._group_actions:
                group_map[action] = title_group_map[group.title]

        # add container's mutually exclusive groups
        # NOTE: if add_mutually_exclusive_group ever gains title= and
        # description= then this code will need to be expanded as above
        for group in container._mutually_exclusive_groups:
            mutex_group = self.add_mutually_exclusive_group(
                required=group.required)

            # map the actions to their new mutex group
            for action in group._group_actions:
                group_map[action] = mutex_group

        # add all actions to this container or their group
        for action in container._actions:
            group_map.get(action, self)._add_action(action)

    def _get_positional_kwargs(self, dest, **kwargs):
        # make sure required is not specified
        if 'required' in kwargs:
            msg = _("'required' is an invalid argument for positionals")
            raise TypeError(msg)

        # mark positional arguments as required if at least one is
        # always required
        if kwargs.get('nargs') not in [OPTIONAL, ZERO_OR_MORE]:
            kwargs['required'] = True
        if kwargs.get('nargs') == ZERO_OR_MORE and 'default' not in kwargs:
            kwargs['required'] = True

        # return the keyword arguments with no option strings
        return dict(kwargs, dest=dest, option_strings=[])

    def _get_optional_kwargs(self, *args, **kwargs):
        # determine short and long option strings
        option_strings = []
        long_option_strings = []
        for option_string in args:
            # error on strings that don't start with an appropriate prefix
            if not option_string[0] in self.prefix_chars:
                args = {'option': option_string,
                        'prefix_chars': self.prefix_chars}
                msg = _('invalid option string %(option)r: '
                        'must start with a character %(prefix_chars)r')
                raise ValueError(msg % args)

            # strings starting with two prefix characters are long options
            option_strings.append(option_string)
            if option_string[0] in self.prefix_chars:
                if len(option_string) > 1:
                    if option_string[1] in self.prefix_chars:
                        long_option_strings.append(option_string)

        # infer destination, '--foo-bar' -> 'foo_bar' and '-x' -> 'x'
        dest = kwargs.pop('dest', None)
        if dest is None:
            if long_option_strings:
                dest_option_string = long_option_strings[0]
            else:
                dest_option_string = option_strings[0]
            dest = dest_option_string.lstrip(self.prefix_chars)
            if not dest:
                msg = _('dest= is required for options like %r')
                raise ValueError(msg % option_string)
            dest = dest.replace('-', '_')

        # return the updated keyword arguments
        return dict(kwargs, dest=dest, option_strings=option_strings)

    def _pop_action_class(self, kwargs, default=None):
        action = kwargs.pop('action', default)
        return self._registry_get('action', action, action)

    def _get_handler(self):
        # determine function from conflict handler string
        handler_func_name = '_handle_conflict_%s' % self.conflict_handler
        try:
            return getattr(self, handler_func_name)
        except AttributeError:
            msg = _('invalid conflict_resolution value: %r')
            raise ValueError(msg % self.conflict_handler)

    def _check_conflict(self, action):

        # find all options that conflict with this option
        confl_optionals = []
        for option_string in action.option_strings:
            if option_string in self._option_string_actions:
                confl_optional = self._option_string_actions[option_string]
                confl_optionals.append((option_string, confl_optional))

        # resolve any conflicts
        if confl_optionals:
            conflict_handler = self._get_handler()
            conflict_handler(action, confl_optionals)

    def _handle_conflict_error(self, action, conflicting_actions):
        message = ngettext('conflicting option string: %s',
                           'conflicting option strings: %s',
                           len(conflicting_actions))
        conflict_string = ', '.join([option_string
                                     for option_string, action
                                     in conflicting_actions])
        raise ArgumentError(action, message % conflict_string)

    def _handle_conflict_resolve(self, action, conflicting_actions):

        # remove all conflicting options
        for option_string, action in conflicting_actions:

            # remove the conflicting option
            action.option_strings.remove(option_string)
            self._option_string_actions.pop(option_string, None)

            # if the option now has no option string, remove it from the
            # container holding it
            if not action.option_strings:
                action.container._remove_action(action)


class _ArgumentGroup(_ActionsContainer):

    def __init__(self, container, title=None, description=None, **kwargs):
        # add any missing keyword arguments by checking the container
        update = kwargs.setdefault
        update('conflict_handler', container.conflict_handler)
        update('prefix_chars', container.prefix_chars)
        update('argument_default', container.argument_default)
        super_init = super(_ArgumentGroup, self).__init__
        super_init(description=description, **kwargs)

        # group attributes
        self.title = title
        self._group_actions = []

        # share most attributes with the container
        self._registries = container._registries
        self._actions = container._actions
        self._option_string_actions = container._option_string_actions
        self._defaults = container._defaults
        self._has_negative_number_optionals = \
            container._has_negative_number_optionals
        self._mutually_exclusive_groups = container._mutually_exclusive_groups

    def _add_action(self, action):
        action = super(_ArgumentGroup, self)._add_action(action)
        self._group_actions.append(action)
        return action

    def _remove_action(self, action):
        super(_ArgumentGroup, self)._remove_action(action)
        self._group_actions.remove(action)


class _MutuallyExclusiveGroup(_ArgumentGroup):

    def __init__(self, container, required=False):
        super(_MutuallyExclusiveGroup, self).__init__(container)
        self.required = required
        self._container = container

    def _add_action(self, action):
        if action.required:
            msg = _('mutually exclusive arguments must be optional')
            raise ValueError(msg)
        action = self._container._add_action(action)
        self._group_actions.append(action)
        return action

    def _remove_action(self, action):
        self._container._remove_action(action)
        self._group_actions.remove(action)


class ArgumentParser(_AttributeHolder, _ActionsContainer):
    """Object for parsing command line strings into Python objects.

    Keyword Arguments:
        - prog -- The name of the program (default: sys.argv[0])
        - usage -- A usage message (default: auto-generated from arguments)
        - description -- A description of what the program does
        - epilog -- Text following the argument descriptions
        - parents -- Parsers whose arguments should be copied into this one
        - formatter_class -- HelpFormatter class for printing help messages
        - prefix_chars -- Characters that prefix optional arguments
        - fromfile_prefix_chars -- Characters that prefix files containing
            additional arguments
        - argument_default -- The default value for all arguments
        - conflict_handler -- String indicating how to handle conflicts
        - add_help -- Add a -h/-help option
        - allow_abbrev -- Allow long options to be abbreviated unambiguously
    """

    def __init__(self,
                 prog=None,
                 usage=None,
                 description=None,
                 epilog=None,
                 parents=[],
                 formatter_class=HelpFormatter,
                 prefix_chars='-',
                 fromfile_prefix_chars=None,
                 argument_default=None,
                 conflict_handler='error',
                 add_help=True,
                 allow_abbrev=True):

        superinit = super(ArgumentParser, self).__init__
        superinit(description=description,
                  prefix_chars=prefix_chars,
                  argument_default=argument_default,
                  conflict_handler=conflict_handler)

        # default setting for prog
        if prog is None:
            prog = _os.path.basename(_sys.argv[0])

        self.prog = prog
        self.usage = usage
        self.epilog = epilog
        self.formatter_class = formatter_class
        self.fromfile_prefix_chars = fromfile_prefix_chars
        self.add_help = add_help
        self.allow_abbrev = allow_abbrev

        add_group = self.add_argument_group
        self._positionals = add_group(_('positional arguments'))
        self._optionals = add_group(_('optional arguments'))
        self._subparsers = None

        # register types
        def identity(string):
            return string
        self.register('type', None, identity)

        # add help argument if necessary
        # (using explicit default to override global argument_default)
        default_prefix = '-' if '-' in prefix_chars else prefix_chars[0]
        if self.add_help:
            self.add_argument(
                default_prefix+'h', default_prefix*2+'help',
                action='help', default=SUPPRESS,
                help=_('show this help message and exit'))

        # add parent arguments and defaults
        for parent in parents:
            self._add_container_actions(parent)
            try:
                defaults = parent._defaults
            except AttributeError:
                pass
            else:
                self._defaults.update(defaults)

    # =======================
    # Pretty __repr__ methods
    # =======================
    def _get_kwargs(self):
        names = [
            'prog',
            'usage',
            'description',
            'formatter_class',
            'conflict_handler',
            'add_help',
        ]
        return [(name, getattr(self, name)) for name in names]

    # ==================================
    # Optional/Positional adding methods
    # ==================================
    def add_subparsers(self, **kwargs):
        if self._subparsers is not None:
            self.error(_('cannot have multiple subparser arguments'))

        # add the parser class to the arguments if it's not present
        kwargs.setdefault('parser_class', type(self))

        if 'title' in kwargs or 'description' in kwargs:
            title = _(kwargs.pop('title', 'subcommands'))
            description = _(kwargs.pop('description', None))
            self._subparsers = self.add_argument_group(title, description)
        else:
            self._subparsers = self._positionals

        # prog defaults to the usage message of this parser, skipping
        # optional arguments and with no "usage:" prefix
        if kwargs.get('prog') is None:
            formatter = self._get_formatter()
            positionals = self._get_positional_actions()
            groups = self._mutually_exclusive_groups
            formatter.add_usage(self.usage, positionals, groups, '')
            kwargs['prog'] = formatter.format_help().strip()

        # create the parsers action and add it to the positionals list
        parsers_class = self._pop_action_class(kwargs, 'parsers')
        action = parsers_class(option_strings=[], **kwargs)
        self._subparsers._add_action(action)

        # return the created parsers action
        return action

    def _add_action(self, action):
        if action.option_strings:
            self._optionals._add_action(action)
        else:
            self._positionals._add_action(action)
        return action

    def _get_optional_actions(self):
        return [action
                for action in self._actions
                if action.option_strings]

    def _get_positional_actions(self):
        return [action
                for action in self._actions
                if not action.option_strings]

    # =====================================
    # Command line argument parsing methods
    # =====================================
    def parse_args(self, args=None, namespace=None):
        args, argv = self.parse_known_args(args, namespace)
        if argv:
            msg = _('unrecognized arguments: %s')
            self.error(msg % ' '.join(argv))
        return args

    def parse_known_args(self, args=None, namespace=None):
        if args is None:
            # args default to the system args
            args = _sys.argv[1:]
        else:
            # make sure that args are mutable
            args = list(args)

        # default Namespace built from parser defaults
        if namespace is None:
            namespace = Namespace()

        # add any action defaults that aren't present
        for action in self._actions:
            if action.dest is not SUPPRESS:
                if not hasattr(namespace, action.dest):
                    if action.default is not SUPPRESS:
                        setattr(namespace, action.dest, action.default)

        # add any parser defaults that aren't present
        for dest in self._defaults:
            if not hasattr(namespace, dest):
                setattr(namespace, dest, self._defaults[dest])

        # parse the arguments and exit if there are any errors
        try:
            namespace, args = self._parse_known_args(args, namespace)
            if hasattr(namespace, _UNRECOGNIZED_ARGS_ATTR):
                args.extend(getattr(namespace, _UNRECOGNIZED_ARGS_ATTR))
                delattr(namespace, _UNRECOGNIZED_ARGS_ATTR)
            return namespace, args
        except ArgumentError:
            err = _sys.exc_info()[1]
            self.error(str(err))

    def _parse_known_args(self, arg_strings, namespace):
        # replace arg strings that are file references
        if self.fromfile_prefix_chars is not None:
            arg_strings = self._read_args_from_files(arg_strings)

        # map all mutually exclusive arguments to the other arguments
        # they can't occur with
        action_conflicts = {}
        for mutex_group in self._mutually_exclusive_groups:
            group_actions = mutex_group._group_actions
            for i, mutex_action in enumerate(mutex_group._group_actions):
                conflicts = action_conflicts.setdefault(mutex_action, [])
                conflicts.extend(group_actions[:i])
                conflicts.extend(group_actions[i + 1:])

        # find all option indices, and determine the arg_string_pattern
        # which has an 'O' if there is an option at an index,
        # an 'A' if there is an argument, or a '-' if there is a '--'
        option_string_indices = {}
        arg_string_pattern_parts = []
        arg_strings_iter = iter(arg_strings)
        for i, arg_string in enumerate(arg_strings_iter):

            # all args after -- are non-options
            if arg_string == '--':
                arg_string_pattern_parts.append('-')
                for arg_string in arg_strings_iter:
                    arg_string_pattern_parts.append('A')

            # otherwise, add the arg to the arg strings
            # and note the index if it was an option
            else:
                option_tuple = self._parse_optional(arg_string)
                if option_tuple is None:
                    pattern = 'A'
                else:
                    option_string_indices[i] = option_tuple
                    pattern = 'O'
                arg_string_pattern_parts.append(pattern)

        # join the pieces together to form the pattern
        arg_strings_pattern = ''.join(arg_string_pattern_parts)

        # converts arg strings to the appropriate and then takes the action
        seen_actions = set()
        seen_non_default_actions = set()

        def take_action(action, argument_strings, option_string=None):
            seen_actions.add(action)
            argument_values = self._get_values(action, argument_strings)

            # error if this argument is not allowed with other previously
            # seen arguments, assuming that actions that use the default
            # value don't really count as "present"
            if argument_values is not action.default:
                seen_non_default_actions.add(action)
                for conflict_action in action_conflicts.get(action, []):
                    if conflict_action in seen_non_default_actions:
                        msg = _('not allowed with argument %s')
                        action_name = _get_action_name(conflict_action)
                        raise ArgumentError(action, msg % action_name)

            # take the action if we didn't receive a SUPPRESS value
            # (e.g. from a default)
            if argument_values is not SUPPRESS:
                action(self, namespace, argument_values, option_string)

        # function to convert arg_strings into an optional action
        def consume_optional(start_index):

            # get the optional identified at this index
            option_tuple = option_string_indices[start_index]
            action, option_string, explicit_arg = option_tuple

            # identify additional optionals in the same arg string
            # (e.g. -xyz is the same as -x -y -z if no args are required)
            match_argument = self._match_argument
            action_tuples = []
            while True:

                # if we found no optional action, skip it
                if action is None:
                    extras.append(arg_strings[start_index])
                    return start_index + 1

                # if there is an explicit argument, try to match the
                # optional's string arguments to only this
                if explicit_arg is not None:
                    arg_count = match_argument(action, 'A')

                    # if the action is a single-dash option and takes no
                    # arguments, try to parse more single-dash options out
                    # of the tail of the option string
                    chars = self.prefix_chars
                    if arg_count == 0 and option_string[1] not in chars:
                        action_tuples.append((action, [], option_string))
                        char = option_string[0]
                        option_string = char + explicit_arg[0]
                        new_explicit_arg = explicit_arg[1:] or None
                        optionals_map = self._option_string_actions
                        if option_string in optionals_map:
                            action = optionals_map[option_string]
                            explicit_arg = new_explicit_arg
                        else:
                            msg = _('ignored explicit argument %r')
                            raise ArgumentError(action, msg % explicit_arg)

                    # if the action expect exactly one argument, we've
                    # successfully matched the option; exit the loop
                    elif arg_count == 1:
                        stop = start_index + 1
                        args = [explicit_arg]
                        action_tuples.append((action, args, option_string))
                        break

                    # error if a double-dash option did not use the
                    # explicit argument
                    else:
                        msg = _('ignored explicit argument %r')
                        raise ArgumentError(action, msg % explicit_arg)

                # if there is no explicit argument, try to match the
                # optional's string arguments with the following strings
                # if successful, exit the loop
                else:
                    start = start_index + 1
                    selected_patterns = arg_strings_pattern[start:]
                    arg_count = match_argument(action, selected_patterns)
                    stop = start + arg_count
                    args = arg_strings[start:stop]
                    action_tuples.append((action, args, option_string))
                    break

            # add the Optional to the list and return the index at which
            # the Optional's string args stopped
            assert action_tuples
            for action, args, option_string in action_tuples:
                take_action(action, args, option_string)
            return stop

        # the list of Positionals left to be parsed; this is modified
        # by consume_positionals()
        positionals = self._get_positional_actions()

        # function to convert arg_strings into positional actions
        def consume_positionals(start_index):
            # match as many Positionals as possible
            match_partial = self._match_arguments_partial
            selected_pattern = arg_strings_pattern[start_index:]
            arg_counts = match_partial(positionals, selected_pattern)

            # slice off the appropriate arg strings for each Positional
            # and add the Positional and its args to the list
            for action, arg_count in zip(positionals, arg_counts):
                args = arg_strings[start_index: start_index + arg_count]
                start_index += arg_count
                take_action(action, args)

            # slice off the Positionals that we just parsed and return the
            # index at which the Positionals' string args stopped
            positionals[:] = positionals[len(arg_counts):]
            return start_index

        # consume Positionals and Optionals alternately, until we have
        # passed the last option string
        extras = []
        start_index = 0
        if option_string_indices:
            max_option_string_index = max(option_string_indices)
        else:
            max_option_string_index = -1
        while start_index <= max_option_string_index:

            # consume any Positionals preceding the next option
            next_option_string_index = min([
                index
                for index in option_string_indices
                if index >= start_index])
            if start_index != next_option_string_index:
                positionals_end_index = consume_positionals(start_index)

                # only try to parse the next optional if we didn't consume
                # the option string during the positionals parsing
                if positionals_end_index > start_index:
                    start_index = positionals_end_index
                    continue
                else:
                    start_index = positionals_end_index

            # if we consumed all the positionals we could and we're not
            # at the index of an option string, there were extra arguments
            if start_index not in option_string_indices:
                strings = arg_strings[start_index:next_option_string_index]
                extras.extend(strings)
                start_index = next_option_string_index

            # consume the next optional and any arguments for it
            start_index = consume_optional(start_index)

        # consume any positionals following the last Optional
        stop_index = consume_positionals(start_index)

        # if we didn't consume all the argument strings, there were extras
        extras.extend(arg_strings[stop_index:])

        # make sure all required actions were present and also convert
        # action defaults which were not given as arguments
        required_actions = []
        for action in self._actions:
            if action not in seen_actions:
                if action.required:
                    required_actions.append(_get_action_name(action))
                else:
                    # Convert action default now instead of doing it before
                    # parsing arguments to avoid calling convert functions
                    # twice (which may fail) if the argument was given, but
                    # only if it was defined already in the namespace
                    if (action.default is not None and
                        isinstance(action.default, str) and
                        hasattr(namespace, action.dest) and
                        action.default is getattr(namespace, action.dest)):
                        setattr(namespace, action.dest,
                                self._get_value(action, action.default))

        if required_actions:
            self.error(_('the following arguments are required: %s') %
                       ', '.join(required_actions))

        # make sure all required groups had one option present
        for group in self._mutually_exclusive_groups:
            if group.required:
                for action in group._group_actions:
                    if action in seen_non_default_actions:
                        break

                # if no actions were used, report the error
                else:
                    names = [_get_action_name(action)
                             for action in group._group_actions
                             if action.help is not SUPPRESS]
                    msg = _('one of the arguments %s is required')
                    self.error(msg % ' '.join(names))

        # return the updated namespace and the extra arguments
        return namespace, extras

    def _read_args_from_files(self, arg_strings):
        # expand arguments referencing files
        new_arg_strings = []
        for arg_string in arg_strings:

            # for regular arguments, just add them back into the list
            if not arg_string or arg_string[0] not in self.fromfile_prefix_chars:
                new_arg_strings.append(arg_string)

            # replace arguments referencing files with the file content
            else:
                try:
                    with open(arg_string[1:]) as args_file:
                        arg_strings = []
                        for arg_line in args_file.read().splitlines():
                            for arg in self.convert_arg_line_to_args(arg_line):
                                arg_strings.append(arg)
                        arg_strings = self._read_args_from_files(arg_strings)
                        new_arg_strings.extend(arg_strings)
                except OSError:
                    err = _sys.exc_info()[1]
                    self.error(str(err))

        # return the modified argument list
        return new_arg_strings

    def convert_arg_line_to_args(self, arg_line):
        return [arg_line]

    def _match_argument(self, action, arg_strings_pattern):
        # match the pattern for this action to the arg strings
        nargs_pattern = self._get_nargs_pattern(action)
        match = _re.match(nargs_pattern, arg_strings_pattern)

        # raise an exception if we weren't able to find a match
        if match is None:
            nargs_errors = {
                None: _('expected one argument'),
                OPTIONAL: _('expected at most one argument'),
                ONE_OR_MORE: _('expected at least one argument'),
            }
            msg = nargs_errors.get(action.nargs)
            if msg is None:
                msg = ngettext('expected %s argument',
                               'expected %s arguments',
                               action.nargs) % action.nargs
            raise ArgumentError(action, msg)

        # return the number of arguments matched
        return len(match.group(1))

    def _match_arguments_partial(self, actions, arg_strings_pattern):
        # progressively shorten the actions list by slicing off the
        # final actions until we find a match
        result = []
        for i in range(len(actions), 0, -1):
            actions_slice = actions[:i]
            pattern = ''.join([self._get_nargs_pattern(action)
                               for action in actions_slice])
            match = _re.match(pattern, arg_strings_pattern)
            if match is not None:
                result.extend([len(string) for string in match.groups()])
                break

        # return the list of arg string counts
        return result

    def _parse_optional(self, arg_string):
        # if it's an empty string, it was meant to be a positional
        if not arg_string:
            return None

        # if it doesn't start with a prefix, it was meant to be positional
        if not arg_string[0] in self.prefix_chars:
            return None

        # if the option string is present in the parser, return the action
        if arg_string in self._option_string_actions:
            action = self._option_string_actions[arg_string]
            return action, arg_string, None

        # if it's just a single character, it was meant to be positional
        if len(arg_string) == 1:
            return None

        # if the option string before the "=" is present, return the action
        if '=' in arg_string:
            option_string, explicit_arg = arg_string.split('=', 1)
            if option_string in self._option_string_actions:
                action = self._option_string_actions[option_string]
                return action, option_string, explicit_arg

        # search through all possible prefixes of the option string
        # and all actions in the parser for possible interpretations
        option_tuples = self._get_option_tuples(arg_string)

        # if multiple actions match, the option string was ambiguous
        if len(option_tuples) > 1:
            options = ', '.join([option_string
                for action, option_string, explicit_arg in option_tuples])
            args = {'option': arg_string, 'matches': options}
            msg = _('ambiguous option: %(option)s could match %(matches)s')
            self.error(msg % args)

        # if exactly one action matched, this segmentation is good,
        # so return the parsed action
        elif len(option_tuples) == 1:
            option_tuple, = option_tuples
            return option_tuple

        # if it was not found as an option, but it looks like a negative
        # number, it was meant to be positional
        # unless there are negative-number-like options
        if self._negative_number_matcher.match(arg_string):
            if not self._has_negative_number_optionals:
                return None

        # if it contains a space, it was meant to be a positional
        if ' ' in arg_string:
            return None

        # it was meant to be an optional but there is no such option
        # in this parser (though it might be a valid option in a subparser)
        return None, arg_string, None

    def _get_option_tuples(self, option_string):
        result = []

        # option strings starting with two prefix characters are only
        # split at the '='
        chars = self.prefix_chars
        if option_string[0] in chars and option_string[1] in chars:
            if self.allow_abbrev:
                if '=' in option_string:
                    option_prefix, explicit_arg = option_string.split('=', 1)
                else:
                    option_prefix = option_string
                    explicit_arg = None
                for option_string in self._option_string_actions:
                    if option_string.startswith(option_prefix):
                        action = self._option_string_actions[option_string]
                        tup = action, option_string, explicit_arg
                        result.append(tup)

        # single character options can be concatenated with their arguments
        # but multiple character options always have to have their argument
        # separate
        elif option_string[0] in chars and option_string[1] not in chars:
            option_prefix = option_string
            explicit_arg = None
            short_option_prefix = option_string[:2]
            short_explicit_arg = option_string[2:]

            for option_string in self._option_string_actions:
                if option_string == short_option_prefix:
                    action = self._option_string_actions[option_string]
                    tup = action, option_string, short_explicit_arg
                    result.append(tup)
                elif option_string.startswith(option_prefix):
                    action = self._option_string_actions[option_string]
                    tup = action, option_string, explicit_arg
                    result.append(tup)

        # shouldn't ever get here
        else:
            self.error(_('unexpected option string: %s') % option_string)

        # return the collected option tuples
        return result

    def _get_nargs_pattern(self, action):
        # in all examples below, we have to allow for '--' args
        # which are represented as '-' in the pattern
        nargs = action.nargs

        # the default (None) is assumed to be a single argument
        if nargs is None:
            nargs_pattern = '(-*A-*)'

        # allow zero or one arguments
        elif nargs == OPTIONAL:
            nargs_pattern = '(-*A?-*)'

        # allow zero or more arguments
        elif nargs == ZERO_OR_MORE:
            nargs_pattern = '(-*[A-]*)'

        # allow one or more arguments
        elif nargs == ONE_OR_MORE:
            nargs_pattern = '(-*A[A-]*)'

        # allow any number of options or arguments
        elif nargs == REMAINDER:
            nargs_pattern = '([-AO]*)'

        # allow one argument followed by any number of options or arguments
        elif nargs == PARSER:
            nargs_pattern = '(-*A[-AO]*)'

        # suppress action, like nargs=0
        elif nargs == SUPPRESS:
            nargs_pattern = '(-*-*)'

        # all others should be integers
        else:
            nargs_pattern = '(-*%s-*)' % '-*'.join('A' * nargs)

        # if this is an optional action, -- is not allowed
        if action.option_strings:
            nargs_pattern = nargs_pattern.replace('-*', '')
            nargs_pattern = nargs_pattern.replace('-', '')

        # return the pattern
        return nargs_pattern

    # ========================
    # Alt command line argument parsing, allowing free intermix
    # ========================

    def parse_intermixed_args(self, args=None, namespace=None):
        args, argv = self.parse_known_intermixed_args(args, namespace)
        if argv:
            msg = _('unrecognized arguments: %s')
            self.error(msg % ' '.join(argv))
        return args

    def parse_known_intermixed_args(self, args=None, namespace=None):
        # returns a namespace and list of extras
        #
        # positional can be freely intermixed with optionals.  optionals are
        # first parsed with all positional arguments deactivated.  The 'extras'
        # are then parsed.  If the parser definition is incompatible with the
        # intermixed assumptions (e.g. use of REMAINDER, subparsers) a
        # TypeError is raised.
        #
        # positionals are 'deactivated' by setting nargs and default to
        # SUPPRESS.  This blocks the addition of that positional to the
        # namespace

        positionals = self._get_positional_actions()
        a = [action for action in positionals
             if action.nargs in [PARSER, REMAINDER]]
        if a:
            raise TypeError('parse_intermixed_args: positional arg'
                            ' with nargs=%s'%a[0].nargs)

        if [action.dest for group in self._mutually_exclusive_groups
            for action in group._group_actions if action in positionals]:
            raise TypeError('parse_intermixed_args: positional in'
                            ' mutuallyExclusiveGroup')

        try:
            save_usage = self.usage
            try:
                if self.usage is None:
                    # capture the full usage for use in error messages
                    self.usage = self.format_usage()[7:]
                for action in positionals:
                    # deactivate positionals
                    action.save_nargs = action.nargs
                    # action.nargs = 0
                    action.nargs = SUPPRESS
                    action.save_default = action.default
                    action.default = SUPPRESS
                namespace, remaining_args = self.parse_known_args(args,
                                                                  namespace)
                for action in positionals:
                    # remove the empty positional values from namespace
                    if (hasattr(namespace, action.dest)
                            and getattr(namespace, action.dest)==[]):
                        from warnings import warn
                        warn('Do not expect %s in %s' % (action.dest, namespace))
                        delattr(namespace, action.dest)
            finally:
                # restore nargs and usage before exiting
                for action in positionals:
                    action.nargs = action.save_nargs
                    action.default = action.save_default
            optionals = self._get_optional_actions()
            try:
                # parse positionals.  optionals aren't normally required, but
                # they could be, so make sure they aren't.
                for action in optionals:
                    action.save_required = action.required
                    action.required = False
                for group in self._mutually_exclusive_groups:
                    group.save_required = group.required
                    group.required = False
                namespace, extras = self.parse_known_args(remaining_args,
                                                          namespace)
            finally:
                # restore parser values before exiting
                for action in optionals:
                    action.required = action.save_required
                for group in self._mutually_exclusive_groups:
                    group.required = group.save_required
        finally:
            self.usage = save_usage
        return namespace, extras

    # ========================
    # Value conversion methods
    # ========================
    def _get_values(self, action, arg_strings):
        # for everything but PARSER, REMAINDER args, strip out first '--'
        if action.nargs not in [PARSER, REMAINDER]:
            try:
                arg_strings.remove('--')
            except ValueError:
                pass

        # optional argument produces a default when not present
        if not arg_strings and action.nargs == OPTIONAL:
            if action.option_strings:
                value = action.const
            else:
                value = action.default
            if isinstance(value, str):
                value = self._get_value(action, value)
                self._check_value(action, value)

        # when nargs='*' on a positional, if there were no command-line
        # args, use the default if it is anything other than None
        elif (not arg_strings and action.nargs == ZERO_OR_MORE and
              not action.option_strings):
            if action.default is not None:
                value = action.default
            else:
                value = arg_strings
            self._check_value(action, value)

        # single argument or optional argument produces a single value
        elif len(arg_strings) == 1 and action.nargs in [None, OPTIONAL]:
            arg_string, = arg_strings
            value = self._get_value(action, arg_string)
            self._check_value(action, value)

        # REMAINDER arguments convert all values, checking none
        elif action.nargs == REMAINDER:
            value = [self._get_value(action, v) for v in arg_strings]

        # PARSER arguments convert all values, but check only the first
        elif action.nargs == PARSER:
            value = [self._get_value(action, v) for v in arg_strings]
            self._check_value(action, value[0])

        # SUPPRESS argument does not put anything in the namespace
        elif action.nargs == SUPPRESS:
            value = SUPPRESS

        # all other types of nargs produce a list
        else:
            value = [self._get_value(action, v) for v in arg_strings]
            for v in value:
                self._check_value(action, v)

        # return the converted value
        return value

    def _get_value(self, action, arg_string):
        type_func = self._registry_get('type', action.type, action.type)
        if not callable(type_func):
            msg = _('%r is not callable')
            raise ArgumentError(action, msg % type_func)

        # convert the value to the appropriate type
        try:
            result = type_func(arg_string)

        # ArgumentTypeErrors indicate errors
        except ArgumentTypeError:
            name = getattr(action.type, '__name__', repr(action.type))
            msg = str(_sys.exc_info()[1])
            raise ArgumentError(action, msg)

        # TypeErrors or ValueErrors also indicate errors
        except (TypeError, ValueError):
            name = getattr(action.type, '__name__', repr(action.type))
            args = {'type': name, 'value': arg_string}
            msg = _('invalid %(type)s value: %(value)r')
            raise ArgumentError(action, msg % args)

        # return the converted value
        return result

    def _check_value(self, action, value):
        # converted value must be one of the choices (if specified)
        if action.choices is not None and value not in action.choices:
            args = {'value': value,
                    'choices': ', '.join(map(repr, action.choices))}
            msg = _('invalid choice: %(value)r (choose from %(choices)s)')
            raise ArgumentError(action, msg % args)

    # =======================
    # Help-formatting methods
    # =======================
    def format_usage(self):
        formatter = self._get_formatter()
        formatter.add_usage(self.usage, self._actions,
                            self._mutually_exclusive_groups)
        return formatter.format_help()

    def format_help(self):
        formatter = self._get_formatter()

        # usage
        formatter.add_usage(self.usage, self._actions,
                            self._mutually_exclusive_groups)

        # description
        formatter.add_text(self.description)

        # positionals, optionals and user-defined groups
        for action_group in self._action_groups:
            formatter.start_section(action_group.title)
            formatter.add_text(action_group.description)
            formatter.add_arguments(action_group._group_actions)
            formatter.end_section()

        # epilog
        formatter.add_text(self.epilog)

        # determine help from format above
        return formatter.format_help()

    def _get_formatter(self):
        return self.formatter_class(prog=self.prog)

    # =====================
    # Help-printing methods
    # =====================
    def print_usage(self, file=None):
        if file is None:
            file = _sys.stdout
        self._print_message(self.format_usage(), file)

    def print_help(self, file=None):
        if file is None:
            file = _sys.stdout
        self._print_message(self.format_help(), file)

    def _print_message(self, message, file=None):
        if message:
            if file is None:
                file = _sys.stderr
            file.write(message)

    # ===============
    # Exiting methods
    # ===============
    def exit(self, status=0, message=None):
        if message:
            self._print_message(message, _sys.stderr)
        _sys.exit(status)

    def error(self, message):
        """error(message: string)

        Prints a usage message incorporating the message to stderr and
        exits.

        If you override this in a subclass, it should not return -- it
        should either exit or raise an exception.
        """
        self.print_usage(_sys.stderr)
        args = {'prog': self.prog, 'message': message}
        self.exit(2, _('%(prog)s: error: %(message)s\n') % args)
quopri.py000075500000016124151153537610006453 0ustar00#! /usr/bin/python3.8

"""Conversions to/from quoted-printable transport encoding as per RFC 1521."""

# (Dec 1991 version).

__all__ = ["encode", "decode", "encodestring", "decodestring"]

ESCAPE = b'='
MAXLINESIZE = 76
HEX = b'0123456789ABCDEF'
EMPTYSTRING = b''

try:
    from binascii import a2b_qp, b2a_qp
except ImportError:
    a2b_qp = None
    b2a_qp = None


def needsquoting(c, quotetabs, header):
    """Decide whether a particular byte ordinal needs to be quoted.

    The 'quotetabs' flag indicates whether embedded tabs and spaces should be
    quoted.  Note that line-ending tabs and spaces are always encoded, as per
    RFC 1521.
    """
    assert isinstance(c, bytes)
    if c in b' \t':
        return quotetabs
    # if header, we have to escape _ because _ is used to escape space
    if c == b'_':
        return header
    return c == ESCAPE or not (b' ' <= c <= b'~')

def quote(c):
    """Quote a single character."""
    assert isinstance(c, bytes) and len(c)==1
    c = ord(c)
    return ESCAPE + bytes((HEX[c//16], HEX[c%16]))



def encode(input, output, quotetabs, header=False):
    """Read 'input', apply quoted-printable encoding, and write to 'output'.

    'input' and 'output' are binary file objects. The 'quotetabs' flag
    indicates whether embedded tabs and spaces should be quoted. Note that
    line-ending tabs and spaces are always encoded, as per RFC 1521.
    The 'header' flag indicates whether we are encoding spaces as _ as per RFC
    1522."""

    if b2a_qp is not None:
        data = input.read()
        odata = b2a_qp(data, quotetabs=quotetabs, header=header)
        output.write(odata)
        return

    def write(s, output=output, lineEnd=b'\n'):
        # RFC 1521 requires that the line ending in a space or tab must have
        # that trailing character encoded.
        if s and s[-1:] in b' \t':
            output.write(s[:-1] + quote(s[-1:]) + lineEnd)
        elif s == b'.':
            output.write(quote(s) + lineEnd)
        else:
            output.write(s + lineEnd)

    prevline = None
    while 1:
        line = input.readline()
        if not line:
            break
        outline = []
        # Strip off any readline induced trailing newline
        stripped = b''
        if line[-1:] == b'\n':
            line = line[:-1]
            stripped = b'\n'
        # Calculate the un-length-limited encoded line
        for c in line:
            c = bytes((c,))
            if needsquoting(c, quotetabs, header):
                c = quote(c)
            if header and c == b' ':
                outline.append(b'_')
            else:
                outline.append(c)
        # First, write out the previous line
        if prevline is not None:
            write(prevline)
        # Now see if we need any soft line breaks because of RFC-imposed
        # length limitations.  Then do the thisline->prevline dance.
        thisline = EMPTYSTRING.join(outline)
        while len(thisline) > MAXLINESIZE:
            # Don't forget to include the soft line break `=' sign in the
            # length calculation!
            write(thisline[:MAXLINESIZE-1], lineEnd=b'=\n')
            thisline = thisline[MAXLINESIZE-1:]
        # Write out the current line
        prevline = thisline
    # Write out the last line, without a trailing newline
    if prevline is not None:
        write(prevline, lineEnd=stripped)

def encodestring(s, quotetabs=False, header=False):
    if b2a_qp is not None:
        return b2a_qp(s, quotetabs=quotetabs, header=header)
    from io import BytesIO
    infp = BytesIO(s)
    outfp = BytesIO()
    encode(infp, outfp, quotetabs, header)
    return outfp.getvalue()



def decode(input, output, header=False):
    """Read 'input', apply quoted-printable decoding, and write to 'output'.
    'input' and 'output' are binary file objects.
    If 'header' is true, decode underscore as space (per RFC 1522)."""

    if a2b_qp is not None:
        data = input.read()
        odata = a2b_qp(data, header=header)
        output.write(odata)
        return

    new = b''
    while 1:
        line = input.readline()
        if not line: break
        i, n = 0, len(line)
        if n > 0 and line[n-1:n] == b'\n':
            partial = 0; n = n-1
            # Strip trailing whitespace
            while n > 0 and line[n-1:n] in b" \t\r":
                n = n-1
        else:
            partial = 1
        while i < n:
            c = line[i:i+1]
            if c == b'_' and header:
                new = new + b' '; i = i+1
            elif c != ESCAPE:
                new = new + c; i = i+1
            elif i+1 == n and not partial:
                partial = 1; break
            elif i+1 < n and line[i+1:i+2] == ESCAPE:
                new = new + ESCAPE; i = i+2
            elif i+2 < n and ishex(line[i+1:i+2]) and ishex(line[i+2:i+3]):
                new = new + bytes((unhex(line[i+1:i+3]),)); i = i+3
            else: # Bad escape sequence -- leave it in
                new = new + c; i = i+1
        if not partial:
            output.write(new + b'\n')
            new = b''
    if new:
        output.write(new)

def decodestring(s, header=False):
    if a2b_qp is not None:
        return a2b_qp(s, header=header)
    from io import BytesIO
    infp = BytesIO(s)
    outfp = BytesIO()
    decode(infp, outfp, header=header)
    return outfp.getvalue()



# Other helper functions
def ishex(c):
    """Return true if the byte ordinal 'c' is a hexadecimal digit in ASCII."""
    assert isinstance(c, bytes)
    return b'0' <= c <= b'9' or b'a' <= c <= b'f' or b'A' <= c <= b'F'

def unhex(s):
    """Get the integer value of a hexadecimal number."""
    bits = 0
    for c in s:
        c = bytes((c,))
        if b'0' <= c <= b'9':
            i = ord('0')
        elif b'a' <= c <= b'f':
            i = ord('a')-10
        elif b'A' <= c <= b'F':
            i = ord(b'A')-10
        else:
            assert False, "non-hex digit "+repr(c)
        bits = bits*16 + (ord(c) - i)
    return bits



def main():
    import sys
    import getopt
    try:
        opts, args = getopt.getopt(sys.argv[1:], 'td')
    except getopt.error as msg:
        sys.stdout = sys.stderr
        print(msg)
        print("usage: quopri [-t | -d] [file] ...")
        print("-t: quote tabs")
        print("-d: decode; default encode")
        sys.exit(2)
    deco = 0
    tabs = 0
    for o, a in opts:
        if o == '-t': tabs = 1
        if o == '-d': deco = 1
    if tabs and deco:
        sys.stdout = sys.stderr
        print("-t and -d are mutually exclusive")
        sys.exit(2)
    if not args: args = ['-']
    sts = 0
    for file in args:
        if file == '-':
            fp = sys.stdin.buffer
        else:
            try:
                fp = open(file, "rb")
            except OSError as msg:
                sys.stderr.write("%s: can't open (%s)\n" % (file, msg))
                sts = 1
                continue
        try:
            if deco:
                decode(fp, sys.stdout.buffer)
            else:
                encode(fp, sys.stdout.buffer, tabs)
        finally:
            if file != '-':
                fp.close()
    if sts:
        sys.exit(sts)



if __name__ == '__main__':
    main()
zipapp.py000064400000016557151153537610006446 0ustar00import contextlib
import os
import pathlib
import shutil
import stat
import sys
import zipfile

__all__ = ['ZipAppError', 'create_archive', 'get_interpreter']


# The __main__.py used if the users specifies "-m module:fn".
# Note that this will always be written as UTF-8 (module and
# function names can be non-ASCII in Python 3).
# We add a coding cookie even though UTF-8 is the default in Python 3
# because the resulting archive may be intended to be run under Python 2.
MAIN_TEMPLATE = """\
# -*- coding: utf-8 -*-
import {module}
{module}.{fn}()
"""


# The Windows launcher defaults to UTF-8 when parsing shebang lines if the
# file has no BOM. So use UTF-8 on Windows.
# On Unix, use the filesystem encoding.
if sys.platform.startswith('win'):
    shebang_encoding = 'utf-8'
else:
    shebang_encoding = sys.getfilesystemencoding()


class ZipAppError(ValueError):
    pass


@contextlib.contextmanager
def _maybe_open(archive, mode):
    if isinstance(archive, (str, os.PathLike)):
        with open(archive, mode) as f:
            yield f
    else:
        yield archive


def _write_file_prefix(f, interpreter):
    """Write a shebang line."""
    if interpreter:
        shebang = b'#!' + interpreter.encode(shebang_encoding) + b'\n'
        f.write(shebang)


def _copy_archive(archive, new_archive, interpreter=None):
    """Copy an application archive, modifying the shebang line."""
    with _maybe_open(archive, 'rb') as src:
        # Skip the shebang line from the source.
        # Read 2 bytes of the source and check if they are #!.
        first_2 = src.read(2)
        if first_2 == b'#!':
            # Discard the initial 2 bytes and the rest of the shebang line.
            first_2 = b''
            src.readline()

        with _maybe_open(new_archive, 'wb') as dst:
            _write_file_prefix(dst, interpreter)
            # If there was no shebang, "first_2" contains the first 2 bytes
            # of the source file, so write them before copying the rest
            # of the file.
            dst.write(first_2)
            shutil.copyfileobj(src, dst)

    if interpreter and isinstance(new_archive, str):
        os.chmod(new_archive, os.stat(new_archive).st_mode | stat.S_IEXEC)


def create_archive(source, target=None, interpreter=None, main=None,
                   filter=None, compressed=False):
    """Create an application archive from SOURCE.

    The SOURCE can be the name of a directory, or a filename or a file-like
    object referring to an existing archive.

    The content of SOURCE is packed into an application archive in TARGET,
    which can be a filename or a file-like object.  If SOURCE is a directory,
    TARGET can be omitted and will default to the name of SOURCE with .pyz
    appended.

    The created application archive will have a shebang line specifying
    that it should run with INTERPRETER (there will be no shebang line if
    INTERPRETER is None), and a __main__.py which runs MAIN (if MAIN is
    not specified, an existing __main__.py will be used).  It is an error
    to specify MAIN for anything other than a directory source with no
    __main__.py, and it is an error to omit MAIN if the directory has no
    __main__.py.
    """
    # Are we copying an existing archive?
    source_is_file = False
    if hasattr(source, 'read') and hasattr(source, 'readline'):
        source_is_file = True
    else:
        source = pathlib.Path(source)
        if source.is_file():
            source_is_file = True

    if source_is_file:
        _copy_archive(source, target, interpreter)
        return

    # We are creating a new archive from a directory.
    if not source.exists():
        raise ZipAppError("Source does not exist")
    has_main = (source / '__main__.py').is_file()
    if main and has_main:
        raise ZipAppError(
            "Cannot specify entry point if the source has __main__.py")
    if not (main or has_main):
        raise ZipAppError("Archive has no entry point")

    main_py = None
    if main:
        # Check that main has the right format.
        mod, sep, fn = main.partition(':')
        mod_ok = all(part.isidentifier() for part in mod.split('.'))
        fn_ok = all(part.isidentifier() for part in fn.split('.'))
        if not (sep == ':' and mod_ok and fn_ok):
            raise ZipAppError("Invalid entry point: " + main)
        main_py = MAIN_TEMPLATE.format(module=mod, fn=fn)

    if target is None:
        target = source.with_suffix('.pyz')
    elif not hasattr(target, 'write'):
        target = pathlib.Path(target)

    with _maybe_open(target, 'wb') as fd:
        _write_file_prefix(fd, interpreter)
        compression = (zipfile.ZIP_DEFLATED if compressed else
                       zipfile.ZIP_STORED)
        with zipfile.ZipFile(fd, 'w', compression=compression) as z:
            for child in source.rglob('*'):
                arcname = child.relative_to(source)
                if filter is None or filter(arcname):
                    z.write(child, arcname.as_posix())
            if main_py:
                z.writestr('__main__.py', main_py.encode('utf-8'))

    if interpreter and not hasattr(target, 'write'):
        target.chmod(target.stat().st_mode | stat.S_IEXEC)


def get_interpreter(archive):
    with _maybe_open(archive, 'rb') as f:
        if f.read(2) == b'#!':
            return f.readline().strip().decode(shebang_encoding)


def main(args=None):
    """Run the zipapp command line interface.

    The ARGS parameter lets you specify the argument list directly.
    Omitting ARGS (or setting it to None) works as for argparse, using
    sys.argv[1:] as the argument list.
    """
    import argparse

    parser = argparse.ArgumentParser()
    parser.add_argument('--output', '-o', default=None,
            help="The name of the output archive. "
                 "Required if SOURCE is an archive.")
    parser.add_argument('--python', '-p', default=None,
            help="The name of the Python interpreter to use "
                 "(default: no shebang line).")
    parser.add_argument('--main', '-m', default=None,
            help="The main function of the application "
                 "(default: use an existing __main__.py).")
    parser.add_argument('--compress', '-c', action='store_true',
            help="Compress files with the deflate method. "
                 "Files are stored uncompressed by default.")
    parser.add_argument('--info', default=False, action='store_true',
            help="Display the interpreter from the archive.")
    parser.add_argument('source',
            help="Source directory (or existing archive).")

    args = parser.parse_args(args)

    # Handle `python -m zipapp archive.pyz --info`.
    if args.info:
        if not os.path.isfile(args.source):
            raise SystemExit("Can only get info for an archive file")
        interpreter = get_interpreter(args.source)
        print("Interpreter: {}".format(interpreter or "<none>"))
        sys.exit(0)

    if os.path.isfile(args.source):
        if args.output is None or (os.path.exists(args.output) and
                                   os.path.samefile(args.source, args.output)):
            raise SystemExit("In-place editing of archives is not supported")
        if args.main:
            raise SystemExit("Cannot change the main function when copying")

    create_archive(args.source, args.output,
                   interpreter=args.python, main=args.main,
                   compressed=args.compress)


if __name__ == '__main__':
    main()
antigravity.py000064400000000735151153537610007473 0ustar00
import webbrowser
import hashlib

webbrowser.open("https://xkcd.com/353/")

def geohash(latitude, longitude, datedow):
    '''Compute geohash() using the Munroe algorithm.

    >>> geohash(37.421542, -122.085589, b'2005-05-26-10458.68')
    37.857713 -122.544543

    '''
    # https://xkcd.com/426/
    h = hashlib.md5(datedow).hexdigest()
    p, q = [('%f' % float.fromhex('0.' + x)) for x in (h[:16], h[16:32])]
    print('%d%s %d%s' % (latitude, p[1:], longitude, q[1:]))
_sysconfigdata__linux_x86_64-linux-gnu.py000064400000113156151153537610014451 0ustar00# system configuration generated and used by the sysconfig module
build_time_vars = {'ABIFLAGS': '',
 'AC_APPLE_UNIVERSAL_BUILD': 0,
 'AIX_GENUINE_CPLUSPLUS': 0,
 'ALT_SOABI': 0,
 'ANDROID_API_LEVEL': 0,
 'AR': 'ar',
 'ARFLAGS': 'rcs',
 'BASECFLAGS': '-Wno-unused-result -Wsign-compare',
 'BASECPPFLAGS': '-IObjects -IInclude -IPython',
 'BASEMODLIBS': '',
 'BINDIR': '/usr/bin',
 'BINLIBDEST': '/usr/lib64/python3.8',
 'BLDLIBRARY': '-L. -lpython3.8',
 'BLDSHARED': 'gcc -pthread -shared -Wl,-z,relro  -Wl,-z,now  -g  '
              '-Wl,-z,relro  -Wl,-z,now  -g',
 'BUILDEXE': '',
 'BUILDPYTHON': 'python',
 'BUILD_GNU_TYPE': 'x86_64-redhat-linux-gnu',
 'BYTESTR_DEPS': '\\',
 'CC': 'gcc -pthread',
 'CCSHARED': '-fPIC',
 'CFLAGS': '-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 '
           '-DNDEBUG  -O2 -g -pipe -Wall -Werror=format-security '
           '-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions '
           '-fstack-protector-strong -grecord-gcc-switches   -m64 '
           '-mtune=generic -fasynchronous-unwind-tables '
           '-fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC '
           '-fwrapv -O2 -g -pipe -Wall -Werror=format-security '
           '-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions '
           '-fstack-protector-strong -grecord-gcc-switches   -m64 '
           '-mtune=generic -fasynchronous-unwind-tables '
           '-fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC '
           '-fwrapv  -O2 -g -pipe -Wall -Werror=format-security '
           '-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions '
           '-fstack-protector-strong -grecord-gcc-switches   -m64 '
           '-mtune=generic -fasynchronous-unwind-tables '
           '-fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC '
           '-fwrapv',
 'CFLAGSFORSHARED': '-fPIC',
 'CFLAGS_ALIASING': '',
 'CONFIGFILES': 'configure configure.ac acconfig.h pyconfig.h.in '
                'Makefile.pre.in',
 'CONFIGURE_CFLAGS': '-O2 -g -pipe -Wall -Werror=format-security '
                     '-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS '
                     '-fexceptions -fstack-protector-strong '
                     '-grecord-gcc-switches   -m64 -mtune=generic '
                     '-fasynchronous-unwind-tables -fstack-clash-protection '
                     '-fcf-protection -D_GNU_SOURCE -fPIC -fwrapv',
 'CONFIGURE_CFLAGS_NODIST': '-O2 -g -pipe -Wall -Werror=format-security '
                            '-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS '
                            '-fexceptions -fstack-protector-strong '
                            '-grecord-gcc-switches '
                            '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 '
                            '-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 '
                            '-m64 -mtune=generic -fasynchronous-unwind-tables '
                            '-fstack-clash-protection -fcf-protection '
                            '-D_GNU_SOURCE -fPIC -fwrapv '
                            '-fno-semantic-interposition -flto '
                            '-fuse-linker-plugin -ffat-lto-objects '
                            '-flto-partition=none -g -std=c99 -Wextra '
                            '-Wno-unused-result -Wno-unused-parameter '
                            '-Wno-missing-field-initializers '
                            '-Werror=implicit-function-declaration',
 'CONFIGURE_CPPFLAGS': '',
 'CONFIGURE_LDFLAGS': '-Wl,-z,relro  -Wl,-z,now  -g',
 'CONFIGURE_LDFLAGS_NODIST': '-Wl,-z,relro  -Wl,-z,now '
                             '-specs=/usr/lib/rpm/redhat/redhat-hardened-ld '
                             '-fno-semantic-interposition -g  -flto '
                             '-fuse-linker-plugin -ffat-lto-objects '
                             '-flto-partition=none -g',
 'CONFIG_ARGS': "'--build=x86_64-redhat-linux-gnu' "
                "'--host=x86_64-redhat-linux-gnu' '--program-prefix=' "
                "'--disable-dependency-tracking' '--prefix=/usr' "
                "'--exec-prefix=/usr' '--bindir=/usr/bin' "
                "'--sbindir=/usr/sbin' '--sysconfdir=/etc' "
                "'--datadir=/usr/share' '--includedir=/usr/include' "
                "'--libdir=/usr/lib64' '--libexecdir=/usr/libexec' "
                "'--localstatedir=/var' '--sharedstatedir=/var/lib' "
                "'--mandir=/usr/share/man' '--infodir=/usr/share/info' "
                "'--enable-ipv6' '--enable-shared' '--with-computed-gotos=yes' "
                "'--with-dbmliborder=gdbm:ndbm:bdb' '--with-system-expat' "
                "'--with-system-ffi' '--enable-loadable-sqlite-extensions' "
                "'--with-dtrace' '--with-lto' "
                "'--with-ssl-default-suites=openssl' '--with-valgrind' "
                "'--without-ensurepip' '--enable-optimizations' "
                "'build_alias=x86_64-redhat-linux-gnu' "
                "'host_alias=x86_64-redhat-linux-gnu' 'CFLAGS= -O2 -g -pipe "
                '-Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 '
                '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions '
                '-fstack-protector-strong -grecord-gcc-switches   -m64 '
                '-mtune=generic -fasynchronous-unwind-tables '
                '-fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC '
                "-fwrapv ' 'LDFLAGS= -Wl,-z,relro  -Wl,-z,now  -g ' "
                "'CPPFLAGS=' "
                "'PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'",
 'CONFINCLUDEDIR': '/usr/include',
 'CONFINCLUDEPY': '/usr/include/python3.8',
 'COREPYTHONPATH': '',
 'COVERAGE_INFO': '/builddir/build/BUILD/Python-3.8.17/build/optimized/coverage.info',
 'COVERAGE_REPORT': '/builddir/build/BUILD/Python-3.8.17/build/optimized/lcov-report',
 'COVERAGE_REPORT_OPTIONS': '--no-branch-coverage --title "CPython lcov '
                            'report"',
 'CPPFLAGS': '-IObjects -IInclude -IPython -I. '
             '-I/builddir/build/BUILD/Python-3.8.17/Include',
 'CXX': 'g++ -pthread',
 'DESTDIRS': '/usr /usr/lib64 /usr/lib64/python3.8 '
             '/usr/lib64/python3.8/lib-dynload',
 'DESTLIB': '/usr/lib64/python3.8',
 'DESTPATH': '',
 'DESTSHARED': '/usr/lib64/python3.8/lib-dynload',
 'DFLAGS': '',
 'DIRMODE': 755,
 'DIST': 'README.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in '
         'Makefile.pre.in Include Lib Misc Ext-dummy',
 'DISTDIRS': 'Include Lib Misc Ext-dummy',
 'DISTFILES': 'README.rst ChangeLog configure configure.ac acconfig.h '
              'pyconfig.h.in Makefile.pre.in',
 'DLINCLDIR': '.',
 'DLLLIBRARY': '',
 'DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754': 0,
 'DOUBLE_IS_BIG_ENDIAN_IEEE754': 0,
 'DOUBLE_IS_LITTLE_ENDIAN_IEEE754': 1,
 'DTRACE': '/usr/bin/dtrace',
 'DTRACE_DEPS': '\\',
 'DTRACE_HEADERS': 'Include/pydtrace_probes.h',
 'DTRACE_OBJS': 'Python/pydtrace.o',
 'DYNLOADFILE': 'dynload_shlib.o',
 'ENABLE_IPV6': 1,
 'ENSUREPIP': 'no',
 'EXE': '',
 'EXEMODE': 755,
 'EXTRATESTOPTS': '',
 'EXT_SUFFIX': '.cpython-38-x86_64-linux-gnu.so',
 'FILEMODE': 644,
 'FLOAT_WORDS_BIGENDIAN': 0,
 'FLOCK_NEEDS_LIBBSD': 0,
 'GETPGRP_HAVE_ARG': 0,
 'GETTIMEOFDAY_NO_TZ': 0,
 'GITBRANCH': '',
 'GITTAG': '',
 'GITVERSION': '',
 'GNULD': 'yes',
 'HAVE_ACCEPT4': 1,
 'HAVE_ACOSH': 1,
 'HAVE_ADDRINFO': 1,
 'HAVE_ALARM': 1,
 'HAVE_ALIGNED_REQUIRED': 0,
 'HAVE_ALLOCA_H': 1,
 'HAVE_ALTZONE': 0,
 'HAVE_ASINH': 1,
 'HAVE_ASM_TYPES_H': 1,
 'HAVE_ATANH': 1,
 'HAVE_BIND_TEXTDOMAIN_CODESET': 1,
 'HAVE_BLUETOOTH_BLUETOOTH_H': 1,
 'HAVE_BLUETOOTH_H': 0,
 'HAVE_BROKEN_MBSTOWCS': 0,
 'HAVE_BROKEN_NICE': 0,
 'HAVE_BROKEN_PIPE_BUF': 0,
 'HAVE_BROKEN_POLL': 0,
 'HAVE_BROKEN_POSIX_SEMAPHORES': 0,
 'HAVE_BROKEN_PTHREAD_SIGMASK': 0,
 'HAVE_BROKEN_SEM_GETVALUE': 0,
 'HAVE_BROKEN_UNSETENV': 0,
 'HAVE_BUILTIN_ATOMIC': 1,
 'HAVE_CHFLAGS': 0,
 'HAVE_CHOWN': 1,
 'HAVE_CHROOT': 1,
 'HAVE_CLOCK': 1,
 'HAVE_CLOCK_GETRES': 1,
 'HAVE_CLOCK_GETTIME': 1,
 'HAVE_CLOCK_SETTIME': 1,
 'HAVE_COMPUTED_GOTOS': 1,
 'HAVE_CONFSTR': 1,
 'HAVE_CONIO_H': 0,
 'HAVE_COPYSIGN': 1,
 'HAVE_COPY_FILE_RANGE': 1,
 'HAVE_CRYPT_H': 1,
 'HAVE_CRYPT_R': 1,
 'HAVE_CTERMID': 1,
 'HAVE_CTERMID_R': 0,
 'HAVE_CURSES_FILTER': 1,
 'HAVE_CURSES_H': 1,
 'HAVE_CURSES_HAS_KEY': 1,
 'HAVE_CURSES_IMMEDOK': 1,
 'HAVE_CURSES_IS_PAD': 1,
 'HAVE_CURSES_IS_TERM_RESIZED': 1,
 'HAVE_CURSES_RESIZETERM': 1,
 'HAVE_CURSES_RESIZE_TERM': 1,
 'HAVE_CURSES_SYNCOK': 1,
 'HAVE_CURSES_TYPEAHEAD': 1,
 'HAVE_CURSES_USE_ENV': 1,
 'HAVE_CURSES_WCHGAT': 1,
 'HAVE_DECL_ISFINITE': 1,
 'HAVE_DECL_ISINF': 1,
 'HAVE_DECL_ISNAN': 1,
 'HAVE_DECL_RTLD_DEEPBIND': 1,
 'HAVE_DECL_RTLD_GLOBAL': 1,
 'HAVE_DECL_RTLD_LAZY': 1,
 'HAVE_DECL_RTLD_LOCAL': 1,
 'HAVE_DECL_RTLD_MEMBER': 0,
 'HAVE_DECL_RTLD_NODELETE': 1,
 'HAVE_DECL_RTLD_NOLOAD': 1,
 'HAVE_DECL_RTLD_NOW': 1,
 'HAVE_DECL_TZNAME': 0,
 'HAVE_DEVICE_MACROS': 1,
 'HAVE_DEV_PTC': 0,
 'HAVE_DEV_PTMX': 1,
 'HAVE_DIRECT_H': 0,
 'HAVE_DIRENT_D_TYPE': 1,
 'HAVE_DIRENT_H': 1,
 'HAVE_DIRFD': 1,
 'HAVE_DLFCN_H': 1,
 'HAVE_DLOPEN': 1,
 'HAVE_DUP2': 1,
 'HAVE_DUP3': 1,
 'HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH': 0,
 'HAVE_DYNAMIC_LOADING': 1,
 'HAVE_ENDIAN_H': 1,
 'HAVE_EPOLL': 1,
 'HAVE_EPOLL_CREATE1': 1,
 'HAVE_ERF': 1,
 'HAVE_ERFC': 1,
 'HAVE_ERRNO_H': 1,
 'HAVE_EXECV': 1,
 'HAVE_EXPLICIT_BZERO': 1,
 'HAVE_EXPLICIT_MEMSET': 0,
 'HAVE_EXPM1': 1,
 'HAVE_FACCESSAT': 1,
 'HAVE_FCHDIR': 1,
 'HAVE_FCHMOD': 1,
 'HAVE_FCHMODAT': 1,
 'HAVE_FCHOWN': 1,
 'HAVE_FCHOWNAT': 1,
 'HAVE_FCNTL_H': 1,
 'HAVE_FDATASYNC': 1,
 'HAVE_FDOPENDIR': 1,
 'HAVE_FDWALK': 0,
 'HAVE_FEXECVE': 1,
 'HAVE_FINITE': 1,
 'HAVE_FLOCK': 1,
 'HAVE_FORK': 1,
 'HAVE_FORKPTY': 1,
 'HAVE_FPATHCONF': 1,
 'HAVE_FSEEK64': 0,
 'HAVE_FSEEKO': 1,
 'HAVE_FSTATAT': 1,
 'HAVE_FSTATVFS': 1,
 'HAVE_FSYNC': 1,
 'HAVE_FTELL64': 0,
 'HAVE_FTELLO': 1,
 'HAVE_FTIME': 1,
 'HAVE_FTRUNCATE': 1,
 'HAVE_FUTIMENS': 1,
 'HAVE_FUTIMES': 1,
 'HAVE_FUTIMESAT': 1,
 'HAVE_GAI_STRERROR': 1,
 'HAVE_GAMMA': 1,
 'HAVE_GCC_ASM_FOR_MC68881': 0,
 'HAVE_GCC_ASM_FOR_X64': 1,
 'HAVE_GCC_ASM_FOR_X87': 1,
 'HAVE_GCC_UINT128_T': 1,
 'HAVE_GETADDRINFO': 1,
 'HAVE_GETC_UNLOCKED': 1,
 'HAVE_GETENTROPY': 1,
 'HAVE_GETGRGID_R': 1,
 'HAVE_GETGRNAM_R': 1,
 'HAVE_GETGROUPLIST': 1,
 'HAVE_GETGROUPS': 1,
 'HAVE_GETHOSTBYNAME': 0,
 'HAVE_GETHOSTBYNAME_R': 1,
 'HAVE_GETHOSTBYNAME_R_3_ARG': 0,
 'HAVE_GETHOSTBYNAME_R_5_ARG': 0,
 'HAVE_GETHOSTBYNAME_R_6_ARG': 1,
 'HAVE_GETITIMER': 1,
 'HAVE_GETLOADAVG': 1,
 'HAVE_GETLOGIN': 1,
 'HAVE_GETNAMEINFO': 1,
 'HAVE_GETPAGESIZE': 1,
 'HAVE_GETPEERNAME': 1,
 'HAVE_GETPGID': 1,
 'HAVE_GETPGRP': 1,
 'HAVE_GETPID': 1,
 'HAVE_GETPRIORITY': 1,
 'HAVE_GETPWENT': 1,
 'HAVE_GETPWNAM_R': 1,
 'HAVE_GETPWUID_R': 1,
 'HAVE_GETRANDOM': 1,
 'HAVE_GETRANDOM_SYSCALL': 1,
 'HAVE_GETRESGID': 1,
 'HAVE_GETRESUID': 1,
 'HAVE_GETSID': 1,
 'HAVE_GETSPENT': 1,
 'HAVE_GETSPNAM': 1,
 'HAVE_GETTIMEOFDAY': 1,
 'HAVE_GETWD': 1,
 'HAVE_GLIBC_MEMMOVE_BUG': 0,
 'HAVE_GRP_H': 1,
 'HAVE_HSTRERROR': 1,
 'HAVE_HTOLE64': 1,
 'HAVE_HYPOT': 1,
 'HAVE_IEEEFP_H': 0,
 'HAVE_IF_NAMEINDEX': 1,
 'HAVE_INET_ATON': 1,
 'HAVE_INET_PTON': 1,
 'HAVE_INITGROUPS': 1,
 'HAVE_INTTYPES_H': 1,
 'HAVE_IO_H': 0,
 'HAVE_IPA_PURE_CONST_BUG': 0,
 'HAVE_KILL': 1,
 'HAVE_KILLPG': 1,
 'HAVE_KQUEUE': 0,
 'HAVE_LANGINFO_H': 1,
 'HAVE_LARGEFILE_SUPPORT': 0,
 'HAVE_LCHFLAGS': 0,
 'HAVE_LCHMOD': 0,
 'HAVE_LCHOWN': 1,
 'HAVE_LGAMMA': 1,
 'HAVE_LIBDL': 1,
 'HAVE_LIBDLD': 0,
 'HAVE_LIBIEEE': 0,
 'HAVE_LIBINTL_H': 1,
 'HAVE_LIBREADLINE': 1,
 'HAVE_LIBRESOLV': 0,
 'HAVE_LIBSENDFILE': 0,
 'HAVE_LIBUTIL_H': 0,
 'HAVE_LINK': 1,
 'HAVE_LINKAT': 1,
 'HAVE_LINUX_CAN_BCM_H': 1,
 'HAVE_LINUX_CAN_H': 1,
 'HAVE_LINUX_CAN_RAW_FD_FRAMES': 1,
 'HAVE_LINUX_CAN_RAW_H': 1,
 'HAVE_LINUX_MEMFD_H': 1,
 'HAVE_LINUX_NETLINK_H': 1,
 'HAVE_LINUX_QRTR_H': 1,
 'HAVE_LINUX_RANDOM_H': 1,
 'HAVE_LINUX_TIPC_H': 1,
 'HAVE_LINUX_VM_SOCKETS_H': 1,
 'HAVE_LOCKF': 1,
 'HAVE_LOG1P': 1,
 'HAVE_LOG2': 1,
 'HAVE_LONG_DOUBLE': 1,
 'HAVE_LSTAT': 1,
 'HAVE_LUTIMES': 1,
 'HAVE_MADVISE': 1,
 'HAVE_MAKEDEV': 1,
 'HAVE_MBRTOWC': 1,
 'HAVE_MEMFD_CREATE': 1,
 'HAVE_MEMORY_H': 1,
 'HAVE_MEMRCHR': 1,
 'HAVE_MKDIRAT': 1,
 'HAVE_MKFIFO': 1,
 'HAVE_MKFIFOAT': 1,
 'HAVE_MKNOD': 1,
 'HAVE_MKNODAT': 1,
 'HAVE_MKTIME': 1,
 'HAVE_MMAP': 1,
 'HAVE_MREMAP': 1,
 'HAVE_NCURSES_H': 1,
 'HAVE_NDIR_H': 0,
 'HAVE_NETPACKET_PACKET_H': 1,
 'HAVE_NET_IF_H': 1,
 'HAVE_NICE': 1,
 'HAVE_OPENAT': 1,
 'HAVE_OPENPTY': 1,
 'HAVE_PATHCONF': 1,
 'HAVE_PAUSE': 1,
 'HAVE_PIPE2': 1,
 'HAVE_PLOCK': 0,
 'HAVE_POLL': 1,
 'HAVE_POLL_H': 1,
 'HAVE_POSIX_FADVISE': 1,
 'HAVE_POSIX_FALLOCATE': 1,
 'HAVE_POSIX_SPAWN': 1,
 'HAVE_POSIX_SPAWNP': 1,
 'HAVE_PREAD': 1,
 'HAVE_PREADV': 1,
 'HAVE_PREADV2': 1,
 'HAVE_PRLIMIT': 1,
 'HAVE_PROCESS_H': 0,
 'HAVE_PROTOTYPES': 1,
 'HAVE_PTHREAD_CONDATTR_SETCLOCK': 1,
 'HAVE_PTHREAD_DESTRUCTOR': 0,
 'HAVE_PTHREAD_GETCPUCLOCKID': 1,
 'HAVE_PTHREAD_H': 1,
 'HAVE_PTHREAD_INIT': 0,
 'HAVE_PTHREAD_KILL': 1,
 'HAVE_PTHREAD_SIGMASK': 1,
 'HAVE_PTY_H': 1,
 'HAVE_PUTENV': 1,
 'HAVE_PWRITE': 1,
 'HAVE_PWRITEV': 1,
 'HAVE_PWRITEV2': 1,
 'HAVE_READLINK': 1,
 'HAVE_READLINKAT': 1,
 'HAVE_READV': 1,
 'HAVE_REALPATH': 1,
 'HAVE_RENAMEAT': 1,
 'HAVE_RL_APPEND_HISTORY': 1,
 'HAVE_RL_CATCH_SIGNAL': 1,
 'HAVE_RL_COMPLETION_APPEND_CHARACTER': 1,
 'HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK': 1,
 'HAVE_RL_COMPLETION_MATCHES': 1,
 'HAVE_RL_COMPLETION_SUPPRESS_APPEND': 1,
 'HAVE_RL_PRE_INPUT_HOOK': 1,
 'HAVE_RL_RESIZE_TERMINAL': 1,
 'HAVE_ROUND': 1,
 'HAVE_RTPSPAWN': 0,
 'HAVE_SCHED_GET_PRIORITY_MAX': 1,
 'HAVE_SCHED_H': 1,
 'HAVE_SCHED_RR_GET_INTERVAL': 1,
 'HAVE_SCHED_SETAFFINITY': 1,
 'HAVE_SCHED_SETPARAM': 1,
 'HAVE_SCHED_SETSCHEDULER': 1,
 'HAVE_SEM_GETVALUE': 1,
 'HAVE_SEM_OPEN': 1,
 'HAVE_SEM_TIMEDWAIT': 1,
 'HAVE_SEM_UNLINK': 1,
 'HAVE_SENDFILE': 1,
 'HAVE_SETEGID': 1,
 'HAVE_SETEUID': 1,
 'HAVE_SETGID': 1,
 'HAVE_SETGROUPS': 1,
 'HAVE_SETHOSTNAME': 1,
 'HAVE_SETITIMER': 1,
 'HAVE_SETLOCALE': 1,
 'HAVE_SETPGID': 1,
 'HAVE_SETPGRP': 1,
 'HAVE_SETPRIORITY': 1,
 'HAVE_SETREGID': 1,
 'HAVE_SETRESGID': 1,
 'HAVE_SETRESUID': 1,
 'HAVE_SETREUID': 1,
 'HAVE_SETSID': 1,
 'HAVE_SETUID': 1,
 'HAVE_SETVBUF': 1,
 'HAVE_SHADOW_H': 1,
 'HAVE_SHM_OPEN': 1,
 'HAVE_SHM_UNLINK': 1,
 'HAVE_SIGACTION': 1,
 'HAVE_SIGALTSTACK': 1,
 'HAVE_SIGFILLSET': 1,
 'HAVE_SIGINFO_T_SI_BAND': 1,
 'HAVE_SIGINTERRUPT': 1,
 'HAVE_SIGNAL_H': 1,
 'HAVE_SIGPENDING': 1,
 'HAVE_SIGRELSE': 1,
 'HAVE_SIGTIMEDWAIT': 1,
 'HAVE_SIGWAIT': 1,
 'HAVE_SIGWAITINFO': 1,
 'HAVE_SNPRINTF': 1,
 'HAVE_SOCKADDR_ALG': 1,
 'HAVE_SOCKADDR_SA_LEN': 0,
 'HAVE_SOCKADDR_STORAGE': 1,
 'HAVE_SOCKETPAIR': 1,
 'HAVE_SPAWN_H': 1,
 'HAVE_SSIZE_T': 1,
 'HAVE_STATVFS': 1,
 'HAVE_STAT_TV_NSEC': 1,
 'HAVE_STAT_TV_NSEC2': 0,
 'HAVE_STDARG_PROTOTYPES': 1,
 'HAVE_STDINT_H': 1,
 'HAVE_STDLIB_H': 1,
 'HAVE_STD_ATOMIC': 1,
 'HAVE_STRDUP': 1,
 'HAVE_STRFTIME': 1,
 'HAVE_STRINGS_H': 1,
 'HAVE_STRING_H': 1,
 'HAVE_STRLCPY': 0,
 'HAVE_STROPTS_H': 0,
 'HAVE_STRSIGNAL': 1,
 'HAVE_STRUCT_PASSWD_PW_GECOS': 1,
 'HAVE_STRUCT_PASSWD_PW_PASSWD': 1,
 'HAVE_STRUCT_STAT_ST_BIRTHTIME': 0,
 'HAVE_STRUCT_STAT_ST_BLKSIZE': 1,
 'HAVE_STRUCT_STAT_ST_BLOCKS': 1,
 'HAVE_STRUCT_STAT_ST_FLAGS': 0,
 'HAVE_STRUCT_STAT_ST_GEN': 0,
 'HAVE_STRUCT_STAT_ST_RDEV': 1,
 'HAVE_STRUCT_TM_TM_ZONE': 1,
 'HAVE_SYMLINK': 1,
 'HAVE_SYMLINKAT': 1,
 'HAVE_SYNC': 1,
 'HAVE_SYSCONF': 1,
 'HAVE_SYSEXITS_H': 1,
 'HAVE_SYS_AUDIOIO_H': 0,
 'HAVE_SYS_BSDTTY_H': 0,
 'HAVE_SYS_DEVPOLL_H': 0,
 'HAVE_SYS_DIR_H': 0,
 'HAVE_SYS_ENDIAN_H': 0,
 'HAVE_SYS_EPOLL_H': 1,
 'HAVE_SYS_EVENT_H': 0,
 'HAVE_SYS_FILE_H': 1,
 'HAVE_SYS_IOCTL_H': 1,
 'HAVE_SYS_KERN_CONTROL_H': 0,
 'HAVE_SYS_LOADAVG_H': 0,
 'HAVE_SYS_LOCK_H': 0,
 'HAVE_SYS_MEMFD_H': 0,
 'HAVE_SYS_MKDEV_H': 0,
 'HAVE_SYS_MMAN_H': 1,
 'HAVE_SYS_MODEM_H': 0,
 'HAVE_SYS_NDIR_H': 0,
 'HAVE_SYS_PARAM_H': 1,
 'HAVE_SYS_POLL_H': 1,
 'HAVE_SYS_RANDOM_H': 1,
 'HAVE_SYS_RESOURCE_H': 1,
 'HAVE_SYS_SELECT_H': 1,
 'HAVE_SYS_SENDFILE_H': 1,
 'HAVE_SYS_SOCKET_H': 1,
 'HAVE_SYS_STATVFS_H': 1,
 'HAVE_SYS_STAT_H': 1,
 'HAVE_SYS_SYSCALL_H': 1,
 'HAVE_SYS_SYSMACROS_H': 1,
 'HAVE_SYS_SYS_DOMAIN_H': 0,
 'HAVE_SYS_TERMIO_H': 0,
 'HAVE_SYS_TIMES_H': 1,
 'HAVE_SYS_TIME_H': 1,
 'HAVE_SYS_TYPES_H': 1,
 'HAVE_SYS_UIO_H': 1,
 'HAVE_SYS_UN_H': 1,
 'HAVE_SYS_UTSNAME_H': 1,
 'HAVE_SYS_WAIT_H': 1,
 'HAVE_SYS_XATTR_H': 1,
 'HAVE_TCGETPGRP': 1,
 'HAVE_TCSETPGRP': 1,
 'HAVE_TEMPNAM': 1,
 'HAVE_TERMIOS_H': 1,
 'HAVE_TERM_H': 1,
 'HAVE_TGAMMA': 1,
 'HAVE_TIMEGM': 1,
 'HAVE_TIMES': 1,
 'HAVE_TMPFILE': 1,
 'HAVE_TMPNAM': 1,
 'HAVE_TMPNAM_R': 1,
 'HAVE_TM_ZONE': 1,
 'HAVE_TRUNCATE': 1,
 'HAVE_TZNAME': 0,
 'HAVE_UCS4_TCL': 0,
 'HAVE_UNAME': 1,
 'HAVE_UNISTD_H': 1,
 'HAVE_UNLINKAT': 1,
 'HAVE_UNSETENV': 1,
 'HAVE_USABLE_WCHAR_T': 0,
 'HAVE_UTIL_H': 0,
 'HAVE_UTIMENSAT': 1,
 'HAVE_UTIMES': 1,
 'HAVE_UTIME_H': 1,
 'HAVE_UUID_CREATE': 0,
 'HAVE_UUID_ENC_BE': 0,
 'HAVE_UUID_GENERATE_TIME_SAFE': 1,
 'HAVE_UUID_H': 0,
 'HAVE_UUID_UUID_H': 1,
 'HAVE_WAIT3': 1,
 'HAVE_WAIT4': 1,
 'HAVE_WAITID': 1,
 'HAVE_WAITPID': 1,
 'HAVE_WCHAR_H': 1,
 'HAVE_WCSCOLL': 1,
 'HAVE_WCSFTIME': 1,
 'HAVE_WCSXFRM': 1,
 'HAVE_WMEMCMP': 1,
 'HAVE_WORKING_TZSET': 1,
 'HAVE_WRITEV': 1,
 'HAVE_X509_VERIFY_PARAM_SET1_HOST': 1,
 'HAVE_ZLIB_COPY': 1,
 'HAVE__GETPTY': 0,
 'HOST_GNU_TYPE': 'x86_64-redhat-linux-gnu',
 'INCLDIRSTOMAKE': '/usr/include /usr/include /usr/include/python3.8 '
                   '/usr/include/python3.8',
 'INCLUDEDIR': '/usr/include',
 'INCLUDEPY': '/usr/include/python3.8',
 'INSTALL': '/usr/bin/install -c',
 'INSTALL_DATA': '/usr/bin/install -c -m 644',
 'INSTALL_PROGRAM': '/usr/bin/install -c',
 'INSTALL_SCRIPT': '/usr/bin/install -c',
 'INSTALL_SHARED': '/usr/bin/install -c -m 755',
 'INSTSONAME': 'libpython3.8.so.1.0',
 'IO_H': 'Modules/_io/_iomodule.h',
 'IO_OBJS': '\\',
 'LDCXXSHARED': 'g++ -pthread -shared',
 'LDFLAGS': '-Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -g',
 'LDLIBRARY': 'libpython3.8.so',
 'LDLIBRARYDIR': '',
 'LDSHARED': 'gcc -pthread -shared -Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  '
             '-Wl,-z,now  -g',
 'LDVERSION': '3.8',
 'LIBC': '',
 'LIBDEST': '/usr/lib64/python3.8',
 'LIBDIR': '/usr/lib64',
 'LIBFFI_INCLUDEDIR': '',
 'LIBM': '-lm',
 'LIBOBJDIR': 'Python/',
 'LIBOBJS': '',
 'LIBPC': '/usr/lib64/pkgconfig',
 'LIBPL': '/usr/lib64/python3.8/config-3.8-x86_64-linux-gnu',
 'LIBPYTHON': '',
 'LIBRARY': 'libpython3.8.a',
 'LIBRARY_OBJS': '\\',
 'LIBRARY_OBJS_OMIT_FROZEN': '\\',
 'LIBS': '-lcrypt -lpthread -ldl  -lutil -lm',
 'LIBSUBDIRS': 'tkinter tkinter/test tkinter/test/test_tkinter \\',
 'LINKCC': 'gcc',
 'LINKFORSHARED': '-Xlinker -export-dynamic',
 'LIPO_32BIT_FLAGS': '',
 'LIPO_INTEL64_FLAGS': '',
 'LLVM_PROF_ERR': 'no',
 'LLVM_PROF_FILE': '',
 'LLVM_PROF_MERGER': 'true',
 'LN': 'ln',
 'LOCALMODLIBS': '',
 'MACHDEP': 'linux',
 'MACHDEP_OBJS': '',
 'MACHDESTLIB': '/usr/lib64/python3.8',
 'MACOSX_DEPLOYMENT_TARGET': '',
 'MAINCC': 'gcc -pthread',
 'MAJOR_IN_MKDEV': 0,
 'MAJOR_IN_SYSMACROS': 1,
 'MAKESETUP': '/builddir/build/BUILD/Python-3.8.17/Modules/makesetup',
 'MANDIR': '/usr/share/man',
 'MKDIR_P': '/usr/bin/mkdir -p',
 'MODBUILT_NAMES': 'posix  errno  pwd  _sre  _codecs  _weakref  _functools  '
                   '_operator  _collections  _abc  itertools  atexit  _signal  '
                   '_stat  time  _thread  _locale  _io  faulthandler  '
                   '_tracemalloc  _symtable  xxsubtype',
 'MODDISABLED_NAMES': '',
 'MODLIBS': '',
 'MODOBJS': 'Modules/posixmodule.o  Modules/errnomodule.o  '
            'Modules/pwdmodule.o  Modules/_sre.o  Modules/_codecsmodule.o  '
            'Modules/_weakref.o  Modules/_functoolsmodule.o  '
            'Modules/_operator.o  Modules/_collectionsmodule.o  '
            'Modules/_abc.o  Modules/itertoolsmodule.o  '
            'Modules/atexitmodule.o  Modules/signalmodule.o  Modules/_stat.o  '
            'Modules/timemodule.o  Modules/_threadmodule.o  '
            'Modules/_localemodule.o  Modules/_iomodule.o Modules/iobase.o '
            'Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o '
            'Modules/textio.o Modules/stringio.o  Modules/faulthandler.o  '
            'Modules/_tracemalloc.o Modules/hashtable.o  '
            'Modules/symtablemodule.o  Modules/xxsubtype.o',
 'MODULE_OBJS': '\\',
 'MULTIARCH': 'x86_64-linux-gnu',
 'MULTIARCH_CPPFLAGS': '-DMULTIARCH=\\"x86_64-linux-gnu\\"',
 'MVWDELCH_IS_EXPRESSION': 1,
 'NO_AS_NEEDED': '-Wl,--no-as-needed',
 'OBJECT_OBJS': '\\',
 'OPENSSL_INCLUDES': '',
 'OPENSSL_LDFLAGS': '',
 'OPENSSL_LIBS': '-lssl -lcrypto',
 'OPT': '-DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe -Wall '
        '-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 '
        '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong '
        '-grecord-gcc-switches   -m64 -mtune=generic '
        '-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection '
        '-D_GNU_SOURCE -fPIC -fwrapv',
 'OTHER_LIBTOOL_OPT': '',
 'PACKAGE_BUGREPORT': 0,
 'PACKAGE_NAME': 0,
 'PACKAGE_STRING': 0,
 'PACKAGE_TARNAME': 0,
 'PACKAGE_URL': 0,
 'PACKAGE_VERSION': 0,
 'PARSER_HEADERS': '\\',
 'PARSER_OBJS': '\\ Parser/myreadline.o Parser/parsetok.o Parser/tokenizer.o',
 'PGO_PROF_GEN_FLAG': '-fprofile-generate',
 'PGO_PROF_USE_FLAG': '-fprofile-use -fprofile-correction',
 'POBJS': '\\',
 'POSIX_SEMAPHORES_NOT_ENABLED': 0,
 'PROFILE_TASK': '-m test --pgo',
 'PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT': 1,
 'PTHREAD_SYSTEM_SCHED_SUPPORTED': 1,
 'PY3LIBRARY': 'libpython3.so',
 'PYLONG_BITS_IN_DIGIT': 0,
 'PYTHON': 'python',
 'PYTHONFRAMEWORK': '',
 'PYTHONFRAMEWORKDIR': 'no-framework',
 'PYTHONFRAMEWORKINSTALLDIR': '',
 'PYTHONFRAMEWORKPREFIX': '',
 'PYTHONPATH': '',
 'PYTHON_FOR_BUILD': './python -E',
 'PYTHON_FOR_REGEN': 'python3.8',
 'PYTHON_HEADERS': '\\',
 'PYTHON_OBJS': '\\',
 'PY_BUILTIN_MODULE_CFLAGS': '-Wno-unused-result -Wsign-compare '
                             '-DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g '
                             '-pipe -Wall -Werror=format-security '
                             '-Wp,-D_FORTIFY_SOURCE=2 '
                             '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions '
                             '-fstack-protector-strong -grecord-gcc-switches   '
                             '-m64 -mtune=generic -fasynchronous-unwind-tables '
                             '-fstack-clash-protection -fcf-protection '
                             '-D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall '
                             '-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 '
                             '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions '
                             '-fstack-protector-strong -grecord-gcc-switches   '
                             '-m64 -mtune=generic -fasynchronous-unwind-tables '
                             '-fstack-clash-protection -fcf-protection '
                             '-D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall '
                             '-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 '
                             '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions '
                             '-fstack-protector-strong -grecord-gcc-switches   '
                             '-m64 -mtune=generic -fasynchronous-unwind-tables '
                             '-fstack-clash-protection -fcf-protection '
                             '-D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall '
                             '-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 '
                             '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions '
                             '-fstack-protector-strong -grecord-gcc-switches '
                             '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 '
                             '-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 '
                             '-m64 -mtune=generic -fasynchronous-unwind-tables '
                             '-fstack-clash-protection -fcf-protection '
                             '-D_GNU_SOURCE -fPIC -fwrapv '
                             '-fno-semantic-interposition -flto '
                             '-fuse-linker-plugin -ffat-lto-objects '
                             '-flto-partition=none -g -std=c99 -Wextra '
                             '-Wno-unused-result -Wno-unused-parameter '
                             '-Wno-missing-field-initializers '
                             '-Werror=implicit-function-declaration -O2 -g '
                             '-pipe -Wall -Werror=format-security '
                             '-Wp,-D_FORTIFY_SOURCE=2 '
                             '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions '
                             '-fstack-protector-strong -grecord-gcc-switches '
                             '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 '
                             '-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 '
                             '-m64 -mtune=generic -fasynchronous-unwind-tables '
                             '-fstack-clash-protection -fcf-protection '
                             '-D_GNU_SOURCE -fPIC -fwrapv '
                             '-fno-semantic-interposition  -fprofile-use '
                             '-fprofile-correction '
                             '-I/builddir/build/BUILD/Python-3.8.17/Include/internal '
                             '-IObjects -IInclude -IPython -I. '
                             '-I/builddir/build/BUILD/Python-3.8.17/Include '
                             '-fPIC -DPy_BUILD_CORE_BUILTIN',
 'PY_CFLAGS': '-Wno-unused-result -Wsign-compare '
              '-DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe -Wall '
              '-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 '
              '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong '
              '-grecord-gcc-switches   -m64 -mtune=generic '
              '-fasynchronous-unwind-tables -fstack-clash-protection '
              '-fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall '
              '-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 '
              '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong '
              '-grecord-gcc-switches   -m64 -mtune=generic '
              '-fasynchronous-unwind-tables -fstack-clash-protection '
              '-fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall '
              '-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 '
              '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong '
              '-grecord-gcc-switches   -m64 -mtune=generic '
              '-fasynchronous-unwind-tables -fstack-clash-protection '
              '-fcf-protection -D_GNU_SOURCE -fPIC -fwrapv',
 'PY_CFLAGS_NODIST': '-O2 -g -pipe -Wall -Werror=format-security '
                     '-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS '
                     '-fexceptions -fstack-protector-strong '
                     '-grecord-gcc-switches '
                     '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 '
                     '-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 '
                     '-mtune=generic -fasynchronous-unwind-tables '
                     '-fstack-clash-protection -fcf-protection -D_GNU_SOURCE '
                     '-fPIC -fwrapv -fno-semantic-interposition -flto '
                     '-fuse-linker-plugin -ffat-lto-objects '
                     '-flto-partition=none -g -std=c99 -Wextra '
                     '-Wno-unused-result -Wno-unused-parameter '
                     '-Wno-missing-field-initializers '
                     '-Werror=implicit-function-declaration -O2 -g -pipe -Wall '
                     '-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 '
                     '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions '
                     '-fstack-protector-strong -grecord-gcc-switches '
                     '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 '
                     '-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 '
                     '-mtune=generic -fasynchronous-unwind-tables '
                     '-fstack-clash-protection -fcf-protection -D_GNU_SOURCE '
                     '-fPIC -fwrapv -fno-semantic-interposition  -fprofile-use '
                     '-fprofile-correction '
                     '-I/builddir/build/BUILD/Python-3.8.17/Include/internal',
 'PY_COERCE_C_LOCALE': 1,
 'PY_CORE_CFLAGS': '-Wno-unused-result -Wsign-compare '
                   '-DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g -pipe '
                   '-Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 '
                   '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions '
                   '-fstack-protector-strong -grecord-gcc-switches   -m64 '
                   '-mtune=generic -fasynchronous-unwind-tables '
                   '-fstack-clash-protection -fcf-protection -D_GNU_SOURCE '
                   '-fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security '
                   '-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS '
                   '-fexceptions -fstack-protector-strong '
                   '-grecord-gcc-switches   -m64 -mtune=generic '
                   '-fasynchronous-unwind-tables -fstack-clash-protection '
                   '-fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe '
                   '-Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 '
                   '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions '
                   '-fstack-protector-strong -grecord-gcc-switches   -m64 '
                   '-mtune=generic -fasynchronous-unwind-tables '
                   '-fstack-clash-protection -fcf-protection -D_GNU_SOURCE '
                   '-fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security '
                   '-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS '
                   '-fexceptions -fstack-protector-strong '
                   '-grecord-gcc-switches '
                   '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 '
                   '-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 '
                   '-mtune=generic -fasynchronous-unwind-tables '
                   '-fstack-clash-protection -fcf-protection -D_GNU_SOURCE '
                   '-fPIC -fwrapv -fno-semantic-interposition -flto '
                   '-fuse-linker-plugin -ffat-lto-objects -flto-partition=none '
                   '-g -std=c99 -Wextra -Wno-unused-result '
                   '-Wno-unused-parameter -Wno-missing-field-initializers '
                   '-Werror=implicit-function-declaration -O2 -g -pipe -Wall '
                   '-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 '
                   '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions '
                   '-fstack-protector-strong -grecord-gcc-switches '
                   '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 '
                   '-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 '
                   '-mtune=generic -fasynchronous-unwind-tables '
                   '-fstack-clash-protection -fcf-protection -D_GNU_SOURCE '
                   '-fPIC -fwrapv -fno-semantic-interposition  -fprofile-use '
                   '-fprofile-correction '
                   '-I/builddir/build/BUILD/Python-3.8.17/Include/internal '
                   '-IObjects -IInclude -IPython -I. '
                   '-I/builddir/build/BUILD/Python-3.8.17/Include -fPIC '
                   '-DPy_BUILD_CORE',
 'PY_CORE_LDFLAGS': '-Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  '
                    '-g -Wl,-z,relro  -Wl,-z,now '
                    '-specs=/usr/lib/rpm/redhat/redhat-hardened-ld '
                    '-fno-semantic-interposition -g  -flto -fuse-linker-plugin '
                    '-ffat-lto-objects -flto-partition=none -g -Wl,-z,relro  '
                    '-Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '
                    '-fno-semantic-interposition -g -lcrypto',
 'PY_CPPFLAGS': '-IObjects -IInclude -IPython -I. '
                '-I/builddir/build/BUILD/Python-3.8.17/Include',
 'PY_FORMAT_SIZE_T': '"z"',
 'PY_LDFLAGS': '-Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -g',
 'PY_LDFLAGS_NODIST': '-Wl,-z,relro  -Wl,-z,now '
                      '-specs=/usr/lib/rpm/redhat/redhat-hardened-ld '
                      '-fno-semantic-interposition -g  -flto '
                      '-fuse-linker-plugin -ffat-lto-objects '
                      '-flto-partition=none -g -Wl,-z,relro  -Wl,-z,now '
                      '-specs=/usr/lib/rpm/redhat/redhat-hardened-ld '
                      '-fno-semantic-interposition -g',
 'PY_SSL_DEFAULT_CIPHERS': 2,
 'PY_SSL_DEFAULT_CIPHER_STRING': 0,
 'PY_STDMODULE_CFLAGS': '-Wno-unused-result -Wsign-compare '
                        '-DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2 -g '
                        '-pipe -Wall -Werror=format-security '
                        '-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS '
                        '-fexceptions -fstack-protector-strong '
                        '-grecord-gcc-switches   -m64 -mtune=generic '
                        '-fasynchronous-unwind-tables -fstack-clash-protection '
                        '-fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g '
                        '-pipe -Wall -Werror=format-security '
                        '-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS '
                        '-fexceptions -fstack-protector-strong '
                        '-grecord-gcc-switches   -m64 -mtune=generic '
                        '-fasynchronous-unwind-tables -fstack-clash-protection '
                        '-fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g '
                        '-pipe -Wall -Werror=format-security '
                        '-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS '
                        '-fexceptions -fstack-protector-strong '
                        '-grecord-gcc-switches   -m64 -mtune=generic '
                        '-fasynchronous-unwind-tables -fstack-clash-protection '
                        '-fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g '
                        '-pipe -Wall -Werror=format-security '
                        '-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS '
                        '-fexceptions -fstack-protector-strong '
                        '-grecord-gcc-switches '
                        '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 '
                        '-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 '
                        '-mtune=generic -fasynchronous-unwind-tables '
                        '-fstack-clash-protection -fcf-protection '
                        '-D_GNU_SOURCE -fPIC -fwrapv '
                        '-fno-semantic-interposition -flto -fuse-linker-plugin '
                        '-ffat-lto-objects -flto-partition=none -g -std=c99 '
                        '-Wextra -Wno-unused-result -Wno-unused-parameter '
                        '-Wno-missing-field-initializers '
                        '-Werror=implicit-function-declaration -O2 -g -pipe '
                        '-Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 '
                        '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions '
                        '-fstack-protector-strong -grecord-gcc-switches '
                        '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 '
                        '-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 '
                        '-mtune=generic -fasynchronous-unwind-tables '
                        '-fstack-clash-protection -fcf-protection '
                        '-D_GNU_SOURCE -fPIC -fwrapv '
                        '-fno-semantic-interposition  -fprofile-use '
                        '-fprofile-correction '
                        '-I/builddir/build/BUILD/Python-3.8.17/Include/internal '
                        '-IObjects -IInclude -IPython -I. '
                        '-I/builddir/build/BUILD/Python-3.8.17/Include -fPIC',
 'Py_DEBUG': 0,
 'Py_ENABLE_SHARED': 1,
 'Py_HASH_ALGORITHM': 0,
 'Py_TRACE_REFS': 0,
 'QUICKTESTOPTS': '-x test_subprocess test_io test_lib2to3 \\',
 'READELF': 'readelf',
 'RESSRCDIR': 'Mac/Resources/framework',
 'RETSIGTYPE': 'void',
 'RUNSHARED': 'LD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/optimized',
 'SCRIPTDIR': '/usr/lib64',
 'SETPGRP_HAVE_ARG': 0,
 'SGI_ABI': '@SGI_ABI@',
 'SHELL': '/bin/sh',
 'SHLIBS': '-lcrypt -lpthread -ldl  -lutil -lm',
 'SHLIB_SUFFIX': '.so',
 'SHM_NEEDS_LIBRT': 1,
 'SIGNED_RIGHT_SHIFT_ZERO_FILLS': 0,
 'SITEPATH': '',
 'SIZEOF_DOUBLE': 8,
 'SIZEOF_FLOAT': 4,
 'SIZEOF_FPOS_T': 16,
 'SIZEOF_INT': 4,
 'SIZEOF_LONG': 8,
 'SIZEOF_LONG_DOUBLE': 16,
 'SIZEOF_LONG_LONG': 8,
 'SIZEOF_OFF_T': 8,
 'SIZEOF_PID_T': 4,
 'SIZEOF_PTHREAD_KEY_T': 4,
 'SIZEOF_PTHREAD_T': 8,
 'SIZEOF_SHORT': 2,
 'SIZEOF_SIZE_T': 8,
 'SIZEOF_TIME_T': 8,
 'SIZEOF_UINTPTR_T': 8,
 'SIZEOF_VOID_P': 8,
 'SIZEOF_WCHAR_T': 4,
 'SIZEOF__BOOL': 1,
 'SOABI': 'cpython-38-x86_64-linux-gnu',
 'SRCDIRS': 'Parser Objects Python Modules Modules/_io Programs',
 'SRC_GDB_HOOKS': '/builddir/build/BUILD/Python-3.8.17/Tools/gdb/libpython.py',
 'STDC_HEADERS': 1,
 'STRICT_SYSV_CURSES': "/* Don't use ncurses extensions */",
 'STRIPFLAG': '-s',
 'SUBDIRS': '',
 'SUBDIRSTOO': 'Include Lib Misc',
 'SYSLIBS': '-lm',
 'SYS_SELECT_WITH_SYS_TIME': 1,
 'TCLTK_INCLUDES': '',
 'TCLTK_LIBS': '',
 'TESTOPTS': '',
 'TESTPATH': '',
 'TESTPYTHON': 'LD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/optimized '
               './python',
 'TESTPYTHONOPTS': '',
 'TESTRUNNER': 'LD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/optimized '
               './python '
               '/builddir/build/BUILD/Python-3.8.17/Tools/scripts/run_tests.py',
 'TESTTIMEOUT': 1200,
 'TIMEMODULE_LIB': 0,
 'TIME_WITH_SYS_TIME': 1,
 'TM_IN_SYS_TIME': 0,
 'UNICODE_DEPS': '\\',
 'UNIVERSALSDK': '',
 'UPDATE_FILE': 'python3.8 '
                '/builddir/build/BUILD/Python-3.8.17/Tools/scripts/update_file.py',
 'USE_COMPUTED_GOTOS': 1,
 'VERSION': '3.8',
 'VPATH': '/builddir/build/BUILD/Python-3.8.17',
 'WINDOW_HAS_FLAGS': 1,
 'WITH_DECIMAL_CONTEXTVAR': 1,
 'WITH_DOC_STRINGS': 1,
 'WITH_DTRACE': 1,
 'WITH_DYLD': 0,
 'WITH_LIBINTL': 0,
 'WITH_NEXT_FRAMEWORK': 0,
 'WITH_PYMALLOC': 1,
 'WITH_VALGRIND': 1,
 'X87_DOUBLE_ROUNDING': 0,
 'XMLLIBSUBDIRS': 'xml xml/dom xml/etree xml/parsers xml/sax',
 'abs_builddir': '/builddir/build/BUILD/Python-3.8.17/build/optimized',
 'abs_srcdir': '/builddir/build/BUILD/Python-3.8.17',
 'datarootdir': '/usr/share',
 'exec_prefix': '/usr',
 'prefix': '/usr',
 'srcdir': '/builddir/build/BUILD/Python-3.8.17'}
bdb.py000064400000076470151153537610005672 0ustar00"""Debugger basics"""

import fnmatch
import sys
import os
from inspect import CO_GENERATOR, CO_COROUTINE, CO_ASYNC_GENERATOR

__all__ = ["BdbQuit", "Bdb", "Breakpoint"]

GENERATOR_AND_COROUTINE_FLAGS = CO_GENERATOR | CO_COROUTINE | CO_ASYNC_GENERATOR


class BdbQuit(Exception):
    """Exception to give up completely."""


class Bdb:
    """Generic Python debugger base class.

    This class takes care of details of the trace facility;
    a derived class should implement user interaction.
    The standard debugger class (pdb.Pdb) is an example.

    The optional skip argument must be an iterable of glob-style
    module name patterns.  The debugger will not step into frames
    that originate in a module that matches one of these patterns.
    Whether a frame is considered to originate in a certain module
    is determined by the __name__ in the frame globals.
    """

    def __init__(self, skip=None):
        self.skip = set(skip) if skip else None
        self.breaks = {}
        self.fncache = {}
        self.frame_returning = None

    def canonic(self, filename):
        """Return canonical form of filename.

        For real filenames, the canonical form is a case-normalized (on
        case insensitive filesystems) absolute path.  'Filenames' with
        angle brackets, such as "<stdin>", generated in interactive
        mode, are returned unchanged.
        """
        if filename == "<" + filename[1:-1] + ">":
            return filename
        canonic = self.fncache.get(filename)
        if not canonic:
            canonic = os.path.abspath(filename)
            canonic = os.path.normcase(canonic)
            self.fncache[filename] = canonic
        return canonic

    def reset(self):
        """Set values of attributes as ready to start debugging."""
        import linecache
        linecache.checkcache()
        self.botframe = None
        self._set_stopinfo(None, None)

    def trace_dispatch(self, frame, event, arg):
        """Dispatch a trace function for debugged frames based on the event.

        This function is installed as the trace function for debugged
        frames. Its return value is the new trace function, which is
        usually itself. The default implementation decides how to
        dispatch a frame, depending on the type of event (passed in as a
        string) that is about to be executed.

        The event can be one of the following:
            line: A new line of code is going to be executed.
            call: A function is about to be called or another code block
                  is entered.
            return: A function or other code block is about to return.
            exception: An exception has occurred.
            c_call: A C function is about to be called.
            c_return: A C function has returned.
            c_exception: A C function has raised an exception.

        For the Python events, specialized functions (see the dispatch_*()
        methods) are called.  For the C events, no action is taken.

        The arg parameter depends on the previous event.
        """
        if self.quitting:
            return # None
        if event == 'line':
            return self.dispatch_line(frame)
        if event == 'call':
            return self.dispatch_call(frame, arg)
        if event == 'return':
            return self.dispatch_return(frame, arg)
        if event == 'exception':
            return self.dispatch_exception(frame, arg)
        if event == 'c_call':
            return self.trace_dispatch
        if event == 'c_exception':
            return self.trace_dispatch
        if event == 'c_return':
            return self.trace_dispatch
        print('bdb.Bdb.dispatch: unknown debugging event:', repr(event))
        return self.trace_dispatch

    def dispatch_line(self, frame):
        """Invoke user function and return trace function for line event.

        If the debugger stops on the current line, invoke
        self.user_line(). Raise BdbQuit if self.quitting is set.
        Return self.trace_dispatch to continue tracing in this scope.
        """
        if self.stop_here(frame) or self.break_here(frame):
            self.user_line(frame)
            if self.quitting: raise BdbQuit
        return self.trace_dispatch

    def dispatch_call(self, frame, arg):
        """Invoke user function and return trace function for call event.

        If the debugger stops on this function call, invoke
        self.user_call(). Raise BbdQuit if self.quitting is set.
        Return self.trace_dispatch to continue tracing in this scope.
        """
        # XXX 'arg' is no longer used
        if self.botframe is None:
            # First call of dispatch since reset()
            self.botframe = frame.f_back # (CT) Note that this may also be None!
            return self.trace_dispatch
        if not (self.stop_here(frame) or self.break_anywhere(frame)):
            # No need to trace this function
            return # None
        # Ignore call events in generator except when stepping.
        if self.stopframe and frame.f_code.co_flags & GENERATOR_AND_COROUTINE_FLAGS:
            return self.trace_dispatch
        self.user_call(frame, arg)
        if self.quitting: raise BdbQuit
        return self.trace_dispatch

    def dispatch_return(self, frame, arg):
        """Invoke user function and return trace function for return event.

        If the debugger stops on this function return, invoke
        self.user_return(). Raise BdbQuit if self.quitting is set.
        Return self.trace_dispatch to continue tracing in this scope.
        """
        if self.stop_here(frame) or frame == self.returnframe:
            # Ignore return events in generator except when stepping.
            if self.stopframe and frame.f_code.co_flags & GENERATOR_AND_COROUTINE_FLAGS:
                return self.trace_dispatch
            try:
                self.frame_returning = frame
                self.user_return(frame, arg)
            finally:
                self.frame_returning = None
            if self.quitting: raise BdbQuit
            # The user issued a 'next' or 'until' command.
            if self.stopframe is frame and self.stoplineno != -1:
                self._set_stopinfo(None, None)
        return self.trace_dispatch

    def dispatch_exception(self, frame, arg):
        """Invoke user function and return trace function for exception event.

        If the debugger stops on this exception, invoke
        self.user_exception(). Raise BdbQuit if self.quitting is set.
        Return self.trace_dispatch to continue tracing in this scope.
        """
        if self.stop_here(frame):
            # When stepping with next/until/return in a generator frame, skip
            # the internal StopIteration exception (with no traceback)
            # triggered by a subiterator run with the 'yield from' statement.
            if not (frame.f_code.co_flags & GENERATOR_AND_COROUTINE_FLAGS
                    and arg[0] is StopIteration and arg[2] is None):
                self.user_exception(frame, arg)
                if self.quitting: raise BdbQuit
        # Stop at the StopIteration or GeneratorExit exception when the user
        # has set stopframe in a generator by issuing a return command, or a
        # next/until command at the last statement in the generator before the
        # exception.
        elif (self.stopframe and frame is not self.stopframe
                and self.stopframe.f_code.co_flags & GENERATOR_AND_COROUTINE_FLAGS
                and arg[0] in (StopIteration, GeneratorExit)):
            self.user_exception(frame, arg)
            if self.quitting: raise BdbQuit

        return self.trace_dispatch

    # Normally derived classes don't override the following
    # methods, but they may if they want to redefine the
    # definition of stopping and breakpoints.

    def is_skipped_module(self, module_name):
        "Return True if module_name matches any skip pattern."
        if module_name is None:  # some modules do not have names
            return False
        for pattern in self.skip:
            if fnmatch.fnmatch(module_name, pattern):
                return True
        return False

    def stop_here(self, frame):
        "Return True if frame is below the starting frame in the stack."
        # (CT) stopframe may now also be None, see dispatch_call.
        # (CT) the former test for None is therefore removed from here.
        if self.skip and \
               self.is_skipped_module(frame.f_globals.get('__name__')):
            return False
        if frame is self.stopframe:
            if self.stoplineno == -1:
                return False
            return frame.f_lineno >= self.stoplineno
        if not self.stopframe:
            return True
        return False

    def break_here(self, frame):
        """Return True if there is an effective breakpoint for this line.

        Check for line or function breakpoint and if in effect.
        Delete temporary breakpoints if effective() says to.
        """
        filename = self.canonic(frame.f_code.co_filename)
        if filename not in self.breaks:
            return False
        lineno = frame.f_lineno
        if lineno not in self.breaks[filename]:
            # The line itself has no breakpoint, but maybe the line is the
            # first line of a function with breakpoint set by function name.
            lineno = frame.f_code.co_firstlineno
            if lineno not in self.breaks[filename]:
                return False

        # flag says ok to delete temp. bp
        (bp, flag) = effective(filename, lineno, frame)
        if bp:
            self.currentbp = bp.number
            if (flag and bp.temporary):
                self.do_clear(str(bp.number))
            return True
        else:
            return False

    def do_clear(self, arg):
        """Remove temporary breakpoint.

        Must implement in derived classes or get NotImplementedError.
        """
        raise NotImplementedError("subclass of bdb must implement do_clear()")

    def break_anywhere(self, frame):
        """Return True if there is any breakpoint for frame's filename.
        """
        return self.canonic(frame.f_code.co_filename) in self.breaks

    # Derived classes should override the user_* methods
    # to gain control.

    def user_call(self, frame, argument_list):
        """Called if we might stop in a function."""
        pass

    def user_line(self, frame):
        """Called when we stop or break at a line."""
        pass

    def user_return(self, frame, return_value):
        """Called when a return trap is set here."""
        pass

    def user_exception(self, frame, exc_info):
        """Called when we stop on an exception."""
        pass

    def _set_stopinfo(self, stopframe, returnframe, stoplineno=0):
        """Set the attributes for stopping.

        If stoplineno is greater than or equal to 0, then stop at line
        greater than or equal to the stopline.  If stoplineno is -1, then
        don't stop at all.
        """
        self.stopframe = stopframe
        self.returnframe = returnframe
        self.quitting = False
        # stoplineno >= 0 means: stop at line >= the stoplineno
        # stoplineno -1 means: don't stop at all
        self.stoplineno = stoplineno

    # Derived classes and clients can call the following methods
    # to affect the stepping state.

    def set_until(self, frame, lineno=None):
        """Stop when the line with the lineno greater than the current one is
        reached or when returning from current frame."""
        # the name "until" is borrowed from gdb
        if lineno is None:
            lineno = frame.f_lineno + 1
        self._set_stopinfo(frame, frame, lineno)

    def set_step(self):
        """Stop after one line of code."""
        # Issue #13183: pdb skips frames after hitting a breakpoint and running
        # step commands.
        # Restore the trace function in the caller (that may not have been set
        # for performance reasons) when returning from the current frame.
        if self.frame_returning:
            caller_frame = self.frame_returning.f_back
            if caller_frame and not caller_frame.f_trace:
                caller_frame.f_trace = self.trace_dispatch
        self._set_stopinfo(None, None)

    def set_next(self, frame):
        """Stop on the next line in or below the given frame."""
        self._set_stopinfo(frame, None)

    def set_return(self, frame):
        """Stop when returning from the given frame."""
        if frame.f_code.co_flags & GENERATOR_AND_COROUTINE_FLAGS:
            self._set_stopinfo(frame, None, -1)
        else:
            self._set_stopinfo(frame.f_back, frame)

    def set_trace(self, frame=None):
        """Start debugging from frame.

        If frame is not specified, debugging starts from caller's frame.
        """
        if frame is None:
            frame = sys._getframe().f_back
        self.reset()
        while frame:
            frame.f_trace = self.trace_dispatch
            self.botframe = frame
            frame = frame.f_back
        self.set_step()
        sys.settrace(self.trace_dispatch)

    def set_continue(self):
        """Stop only at breakpoints or when finished.

        If there are no breakpoints, set the system trace function to None.
        """
        # Don't stop except at breakpoints or when finished
        self._set_stopinfo(self.botframe, None, -1)
        if not self.breaks:
            # no breakpoints; run without debugger overhead
            sys.settrace(None)
            frame = sys._getframe().f_back
            while frame and frame is not self.botframe:
                del frame.f_trace
                frame = frame.f_back

    def set_quit(self):
        """Set quitting attribute to True.

        Raises BdbQuit exception in the next call to a dispatch_*() method.
        """
        self.stopframe = self.botframe
        self.returnframe = None
        self.quitting = True
        sys.settrace(None)

    # Derived classes and clients can call the following methods
    # to manipulate breakpoints.  These methods return an
    # error message if something went wrong, None if all is well.
    # Set_break prints out the breakpoint line and file:lineno.
    # Call self.get_*break*() to see the breakpoints or better
    # for bp in Breakpoint.bpbynumber: if bp: bp.bpprint().

    def set_break(self, filename, lineno, temporary=False, cond=None,
                  funcname=None):
        """Set a new breakpoint for filename:lineno.

        If lineno doesn't exist for the filename, return an error message.
        The filename should be in canonical form.
        """
        filename = self.canonic(filename)
        import linecache # Import as late as possible
        line = linecache.getline(filename, lineno)
        if not line:
            return 'Line %s:%d does not exist' % (filename, lineno)
        list = self.breaks.setdefault(filename, [])
        if lineno not in list:
            list.append(lineno)
        bp = Breakpoint(filename, lineno, temporary, cond, funcname)
        return None

    def _prune_breaks(self, filename, lineno):
        """Prune breakpoints for filename:lineno.

        A list of breakpoints is maintained in the Bdb instance and in
        the Breakpoint class.  If a breakpoint in the Bdb instance no
        longer exists in the Breakpoint class, then it's removed from the
        Bdb instance.
        """
        if (filename, lineno) not in Breakpoint.bplist:
            self.breaks[filename].remove(lineno)
        if not self.breaks[filename]:
            del self.breaks[filename]

    def clear_break(self, filename, lineno):
        """Delete breakpoints for filename:lineno.

        If no breakpoints were set, return an error message.
        """
        filename = self.canonic(filename)
        if filename not in self.breaks:
            return 'There are no breakpoints in %s' % filename
        if lineno not in self.breaks[filename]:
            return 'There is no breakpoint at %s:%d' % (filename, lineno)
        # If there's only one bp in the list for that file,line
        # pair, then remove the breaks entry
        for bp in Breakpoint.bplist[filename, lineno][:]:
            bp.deleteMe()
        self._prune_breaks(filename, lineno)
        return None

    def clear_bpbynumber(self, arg):
        """Delete a breakpoint by its index in Breakpoint.bpbynumber.

        If arg is invalid, return an error message.
        """
        try:
            bp = self.get_bpbynumber(arg)
        except ValueError as err:
            return str(err)
        bp.deleteMe()
        self._prune_breaks(bp.file, bp.line)
        return None

    def clear_all_file_breaks(self, filename):
        """Delete all breakpoints in filename.

        If none were set, return an error message.
        """
        filename = self.canonic(filename)
        if filename not in self.breaks:
            return 'There are no breakpoints in %s' % filename
        for line in self.breaks[filename]:
            blist = Breakpoint.bplist[filename, line]
            for bp in blist:
                bp.deleteMe()
        del self.breaks[filename]
        return None

    def clear_all_breaks(self):
        """Delete all existing breakpoints.

        If none were set, return an error message.
        """
        if not self.breaks:
            return 'There are no breakpoints'
        for bp in Breakpoint.bpbynumber:
            if bp:
                bp.deleteMe()
        self.breaks = {}
        return None

    def get_bpbynumber(self, arg):
        """Return a breakpoint by its index in Breakpoint.bybpnumber.

        For invalid arg values or if the breakpoint doesn't exist,
        raise a ValueError.
        """
        if not arg:
            raise ValueError('Breakpoint number expected')
        try:
            number = int(arg)
        except ValueError:
            raise ValueError('Non-numeric breakpoint number %s' % arg) from None
        try:
            bp = Breakpoint.bpbynumber[number]
        except IndexError:
            raise ValueError('Breakpoint number %d out of range' % number) from None
        if bp is None:
            raise ValueError('Breakpoint %d already deleted' % number)
        return bp

    def get_break(self, filename, lineno):
        """Return True if there is a breakpoint for filename:lineno."""
        filename = self.canonic(filename)
        return filename in self.breaks and \
            lineno in self.breaks[filename]

    def get_breaks(self, filename, lineno):
        """Return all breakpoints for filename:lineno.

        If no breakpoints are set, return an empty list.
        """
        filename = self.canonic(filename)
        return filename in self.breaks and \
            lineno in self.breaks[filename] and \
            Breakpoint.bplist[filename, lineno] or []

    def get_file_breaks(self, filename):
        """Return all lines with breakpoints for filename.

        If no breakpoints are set, return an empty list.
        """
        filename = self.canonic(filename)
        if filename in self.breaks:
            return self.breaks[filename]
        else:
            return []

    def get_all_breaks(self):
        """Return all breakpoints that are set."""
        return self.breaks

    # Derived classes and clients can call the following method
    # to get a data structure representing a stack trace.

    def get_stack(self, f, t):
        """Return a list of (frame, lineno) in a stack trace and a size.

        List starts with original calling frame, if there is one.
        Size may be number of frames above or below f.
        """
        stack = []
        if t and t.tb_frame is f:
            t = t.tb_next
        while f is not None:
            stack.append((f, f.f_lineno))
            if f is self.botframe:
                break
            f = f.f_back
        stack.reverse()
        i = max(0, len(stack) - 1)
        while t is not None:
            stack.append((t.tb_frame, t.tb_lineno))
            t = t.tb_next
        if f is None:
            i = max(0, len(stack) - 1)
        return stack, i

    def format_stack_entry(self, frame_lineno, lprefix=': '):
        """Return a string with information about a stack entry.

        The stack entry frame_lineno is a (frame, lineno) tuple.  The
        return string contains the canonical filename, the function name
        or '<lambda>', the input arguments, the return value, and the
        line of code (if it exists).

        """
        import linecache, reprlib
        frame, lineno = frame_lineno
        filename = self.canonic(frame.f_code.co_filename)
        s = '%s(%r)' % (filename, lineno)
        if frame.f_code.co_name:
            s += frame.f_code.co_name
        else:
            s += "<lambda>"
        s += '()'
        if '__return__' in frame.f_locals:
            rv = frame.f_locals['__return__']
            s += '->'
            s += reprlib.repr(rv)
        line = linecache.getline(filename, lineno, frame.f_globals)
        if line:
            s += lprefix + line.strip()
        return s

    # The following methods can be called by clients to use
    # a debugger to debug a statement or an expression.
    # Both can be given as a string, or a code object.

    def run(self, cmd, globals=None, locals=None):
        """Debug a statement executed via the exec() function.

        globals defaults to __main__.dict; locals defaults to globals.
        """
        if globals is None:
            import __main__
            globals = __main__.__dict__
        if locals is None:
            locals = globals
        self.reset()
        if isinstance(cmd, str):
            cmd = compile(cmd, "<string>", "exec")
        sys.settrace(self.trace_dispatch)
        try:
            exec(cmd, globals, locals)
        except BdbQuit:
            pass
        finally:
            self.quitting = True
            sys.settrace(None)

    def runeval(self, expr, globals=None, locals=None):
        """Debug an expression executed via the eval() function.

        globals defaults to __main__.dict; locals defaults to globals.
        """
        if globals is None:
            import __main__
            globals = __main__.__dict__
        if locals is None:
            locals = globals
        self.reset()
        sys.settrace(self.trace_dispatch)
        try:
            return eval(expr, globals, locals)
        except BdbQuit:
            pass
        finally:
            self.quitting = True
            sys.settrace(None)

    def runctx(self, cmd, globals, locals):
        """For backwards-compatibility.  Defers to run()."""
        # B/W compatibility
        self.run(cmd, globals, locals)

    # This method is more useful to debug a single function call.

    def runcall(*args, **kwds):
        """Debug a single function call.

        Return the result of the function call.
        """
        if len(args) >= 2:
            self, func, *args = args
        elif not args:
            raise TypeError("descriptor 'runcall' of 'Bdb' object "
                            "needs an argument")
        elif 'func' in kwds:
            func = kwds.pop('func')
            self, *args = args
            import warnings
            warnings.warn("Passing 'func' as keyword argument is deprecated",
                          DeprecationWarning, stacklevel=2)
        else:
            raise TypeError('runcall expected at least 1 positional argument, '
                            'got %d' % (len(args)-1))

        self.reset()
        sys.settrace(self.trace_dispatch)
        res = None
        try:
            res = func(*args, **kwds)
        except BdbQuit:
            pass
        finally:
            self.quitting = True
            sys.settrace(None)
        return res
    runcall.__text_signature__ = '($self, func, /, *args, **kwds)'


def set_trace():
    """Start debugging with a Bdb instance from the caller's frame."""
    Bdb().set_trace()


class Breakpoint:
    """Breakpoint class.

    Implements temporary breakpoints, ignore counts, disabling and
    (re)-enabling, and conditionals.

    Breakpoints are indexed by number through bpbynumber and by
    the (file, line) tuple using bplist.  The former points to a
    single instance of class Breakpoint.  The latter points to a
    list of such instances since there may be more than one
    breakpoint per line.

    When creating a breakpoint, its associated filename should be
    in canonical form.  If funcname is defined, a breakpoint hit will be
    counted when the first line of that function is executed.  A
    conditional breakpoint always counts a hit.
    """

    # XXX Keeping state in the class is a mistake -- this means
    # you cannot have more than one active Bdb instance.

    next = 1        # Next bp to be assigned
    bplist = {}     # indexed by (file, lineno) tuple
    bpbynumber = [None] # Each entry is None or an instance of Bpt
                # index 0 is unused, except for marking an
                # effective break .... see effective()

    def __init__(self, file, line, temporary=False, cond=None, funcname=None):
        self.funcname = funcname
        # Needed if funcname is not None.
        self.func_first_executable_line = None
        self.file = file    # This better be in canonical form!
        self.line = line
        self.temporary = temporary
        self.cond = cond
        self.enabled = True
        self.ignore = 0
        self.hits = 0
        self.number = Breakpoint.next
        Breakpoint.next += 1
        # Build the two lists
        self.bpbynumber.append(self)
        if (file, line) in self.bplist:
            self.bplist[file, line].append(self)
        else:
            self.bplist[file, line] = [self]

    def deleteMe(self):
        """Delete the breakpoint from the list associated to a file:line.

        If it is the last breakpoint in that position, it also deletes
        the entry for the file:line.
        """

        index = (self.file, self.line)
        self.bpbynumber[self.number] = None   # No longer in list
        self.bplist[index].remove(self)
        if not self.bplist[index]:
            # No more bp for this f:l combo
            del self.bplist[index]

    def enable(self):
        """Mark the breakpoint as enabled."""
        self.enabled = True

    def disable(self):
        """Mark the breakpoint as disabled."""
        self.enabled = False

    def bpprint(self, out=None):
        """Print the output of bpformat().

        The optional out argument directs where the output is sent
        and defaults to standard output.
        """
        if out is None:
            out = sys.stdout
        print(self.bpformat(), file=out)

    def bpformat(self):
        """Return a string with information about the breakpoint.

        The information includes the breakpoint number, temporary
        status, file:line position, break condition, number of times to
        ignore, and number of times hit.

        """
        if self.temporary:
            disp = 'del  '
        else:
            disp = 'keep '
        if self.enabled:
            disp = disp + 'yes  '
        else:
            disp = disp + 'no   '
        ret = '%-4dbreakpoint   %s at %s:%d' % (self.number, disp,
                                                self.file, self.line)
        if self.cond:
            ret += '\n\tstop only if %s' % (self.cond,)
        if self.ignore:
            ret += '\n\tignore next %d hits' % (self.ignore,)
        if self.hits:
            if self.hits > 1:
                ss = 's'
            else:
                ss = ''
            ret += '\n\tbreakpoint already hit %d time%s' % (self.hits, ss)
        return ret

    def __str__(self):
        "Return a condensed description of the breakpoint."
        return 'breakpoint %s at %s:%s' % (self.number, self.file, self.line)

# -----------end of Breakpoint class----------


def checkfuncname(b, frame):
    """Return True if break should happen here.

    Whether a break should happen depends on the way that b (the breakpoint)
    was set.  If it was set via line number, check if b.line is the same as
    the one in the frame.  If it was set via function name, check if this is
    the right function and if it is on the first executable line.
    """
    if not b.funcname:
        # Breakpoint was set via line number.
        if b.line != frame.f_lineno:
            # Breakpoint was set at a line with a def statement and the function
            # defined is called: don't break.
            return False
        return True

    # Breakpoint set via function name.
    if frame.f_code.co_name != b.funcname:
        # It's not a function call, but rather execution of def statement.
        return False

    # We are in the right frame.
    if not b.func_first_executable_line:
        # The function is entered for the 1st time.
        b.func_first_executable_line = frame.f_lineno

    if b.func_first_executable_line != frame.f_lineno:
        # But we are not at the first line number: don't break.
        return False
    return True


# Determines if there is an effective (active) breakpoint at this
# line of code.  Returns breakpoint number or 0 if none
def effective(file, line, frame):
    """Determine which breakpoint for this file:line is to be acted upon.

    Called only if we know there is a breakpoint at this location.  Return
    the breakpoint that was triggered and a boolean that indicates if it is
    ok to delete a temporary breakpoint.  Return (None, None) if there is no
    matching breakpoint.
    """
    possibles = Breakpoint.bplist[file, line]
    for b in possibles:
        if not b.enabled:
            continue
        if not checkfuncname(b, frame):
            continue
        # Count every hit when bp is enabled
        b.hits += 1
        if not b.cond:
            # If unconditional, and ignoring go on to next, else break
            if b.ignore > 0:
                b.ignore -= 1
                continue
            else:
                # breakpoint and marker that it's ok to delete if temporary
                return (b, True)
        else:
            # Conditional bp.
            # Ignore count applies only to those bpt hits where the
            # condition evaluates to true.
            try:
                val = eval(b.cond, frame.f_globals, frame.f_locals)
                if val:
                    if b.ignore > 0:
                        b.ignore -= 1
                        # continue
                    else:
                        return (b, True)
                # else:
                #   continue
            except:
                # if eval fails, most conservative thing is to stop on
                # breakpoint regardless of ignore count.  Don't delete
                # temporary, as another hint to user.
                return (b, False)
    return (None, None)


# -------------------- testing --------------------

class Tdb(Bdb):
    def user_call(self, frame, args):
        name = frame.f_code.co_name
        if not name: name = '???'
        print('+++ call', name, args)
    def user_line(self, frame):
        import linecache
        name = frame.f_code.co_name
        if not name: name = '???'
        fn = self.canonic(frame.f_code.co_filename)
        line = linecache.getline(fn, frame.f_lineno, frame.f_globals)
        print('+++', fn, frame.f_lineno, name, ':', line.strip())
    def user_return(self, frame, retval):
        print('+++ return', retval)
    def user_exception(self, frame, exc_stuff):
        print('+++ exception', exc_stuff)
        self.set_continue()

def foo(n):
    print('foo(', n, ')')
    x = bar(n*10)
    print('bar returned', x)

def bar(a):
    print('bar(', a, ')')
    return a/2

def test():
    t = Tdb()
    t.run('import bdb; bdb.foo(10)')
os.py000064400000114123151153537610005550 0ustar00r"""OS routines for NT or Posix depending on what system we're on.

This exports:
  - all functions from posix or nt, e.g. unlink, stat, etc.
  - os.path is either posixpath or ntpath
  - os.name is either 'posix' or 'nt'
  - os.curdir is a string representing the current directory (always '.')
  - os.pardir is a string representing the parent directory (always '..')
  - os.sep is the (or a most common) pathname separator ('/' or '\\')
  - os.extsep is the extension separator (always '.')
  - os.altsep is the alternate pathname separator (None or '/')
  - os.pathsep is the component separator used in $PATH etc
  - os.linesep is the line separator in text files ('\r' or '\n' or '\r\n')
  - os.defpath is the default search path for executables
  - os.devnull is the file path of the null device ('/dev/null', etc.)

Programs that import and use 'os' stand a better chance of being
portable between different platforms.  Of course, they must then
only use functions that are defined by all platforms (e.g., unlink
and opendir), and leave all pathname manipulation to os.path
(e.g., split and join).
"""

#'
import abc
import sys
import stat as st

from _collections_abc import _check_methods

_names = sys.builtin_module_names

# Note:  more names are added to __all__ later.
__all__ = ["altsep", "curdir", "pardir", "sep", "pathsep", "linesep",
           "defpath", "name", "path", "devnull", "SEEK_SET", "SEEK_CUR",
           "SEEK_END", "fsencode", "fsdecode", "get_exec_path", "fdopen",
           "popen", "extsep"]

def _exists(name):
    return name in globals()

def _get_exports_list(module):
    try:
        return list(module.__all__)
    except AttributeError:
        return [n for n in dir(module) if n[0] != '_']

# Any new dependencies of the os module and/or changes in path separator
# requires updating importlib as well.
if 'posix' in _names:
    name = 'posix'
    linesep = '\n'
    from posix import *
    try:
        from posix import _exit
        __all__.append('_exit')
    except ImportError:
        pass
    import posixpath as path

    try:
        from posix import _have_functions
    except ImportError:
        pass

    import posix
    __all__.extend(_get_exports_list(posix))
    del posix

elif 'nt' in _names:
    name = 'nt'
    linesep = '\r\n'
    from nt import *
    try:
        from nt import _exit
        __all__.append('_exit')
    except ImportError:
        pass
    import ntpath as path

    import nt
    __all__.extend(_get_exports_list(nt))
    del nt

    try:
        from nt import _have_functions
    except ImportError:
        pass

else:
    raise ImportError('no os specific module found')

sys.modules['os.path'] = path
from os.path import (curdir, pardir, sep, pathsep, defpath, extsep, altsep,
    devnull)

del _names


if _exists("_have_functions"):
    _globals = globals()
    def _add(str, fn):
        if (fn in _globals) and (str in _have_functions):
            _set.add(_globals[fn])

    _set = set()
    _add("HAVE_FACCESSAT",  "access")
    _add("HAVE_FCHMODAT",   "chmod")
    _add("HAVE_FCHOWNAT",   "chown")
    _add("HAVE_FSTATAT",    "stat")
    _add("HAVE_FUTIMESAT",  "utime")
    _add("HAVE_LINKAT",     "link")
    _add("HAVE_MKDIRAT",    "mkdir")
    _add("HAVE_MKFIFOAT",   "mkfifo")
    _add("HAVE_MKNODAT",    "mknod")
    _add("HAVE_OPENAT",     "open")
    _add("HAVE_READLINKAT", "readlink")
    _add("HAVE_RENAMEAT",   "rename")
    _add("HAVE_SYMLINKAT",  "symlink")
    _add("HAVE_UNLINKAT",   "unlink")
    _add("HAVE_UNLINKAT",   "rmdir")
    _add("HAVE_UTIMENSAT",  "utime")
    supports_dir_fd = _set

    _set = set()
    _add("HAVE_FACCESSAT",  "access")
    supports_effective_ids = _set

    _set = set()
    _add("HAVE_FCHDIR",     "chdir")
    _add("HAVE_FCHMOD",     "chmod")
    _add("HAVE_FCHOWN",     "chown")
    _add("HAVE_FDOPENDIR",  "listdir")
    _add("HAVE_FDOPENDIR",  "scandir")
    _add("HAVE_FEXECVE",    "execve")
    _set.add(stat) # fstat always works
    _add("HAVE_FTRUNCATE",  "truncate")
    _add("HAVE_FUTIMENS",   "utime")
    _add("HAVE_FUTIMES",    "utime")
    _add("HAVE_FPATHCONF",  "pathconf")
    if _exists("statvfs") and _exists("fstatvfs"): # mac os x10.3
        _add("HAVE_FSTATVFS", "statvfs")
    supports_fd = _set

    _set = set()
    _add("HAVE_FACCESSAT",  "access")
    # Some platforms don't support lchmod().  Often the function exists
    # anyway, as a stub that always returns ENOSUP or perhaps EOPNOTSUPP.
    # (No, I don't know why that's a good design.)  ./configure will detect
    # this and reject it--so HAVE_LCHMOD still won't be defined on such
    # platforms.  This is Very Helpful.
    #
    # However, sometimes platforms without a working lchmod() *do* have
    # fchmodat().  (Examples: Linux kernel 3.2 with glibc 2.15,
    # OpenIndiana 3.x.)  And fchmodat() has a flag that theoretically makes
    # it behave like lchmod().  So in theory it would be a suitable
    # replacement for lchmod().  But when lchmod() doesn't work, fchmodat()'s
    # flag doesn't work *either*.  Sadly ./configure isn't sophisticated
    # enough to detect this condition--it only determines whether or not
    # fchmodat() minimally works.
    #
    # Therefore we simply ignore fchmodat() when deciding whether or not
    # os.chmod supports follow_symlinks.  Just checking lchmod() is
    # sufficient.  After all--if you have a working fchmodat(), your
    # lchmod() almost certainly works too.
    #
    # _add("HAVE_FCHMODAT",   "chmod")
    _add("HAVE_FCHOWNAT",   "chown")
    _add("HAVE_FSTATAT",    "stat")
    _add("HAVE_LCHFLAGS",   "chflags")
    _add("HAVE_LCHMOD",     "chmod")
    if _exists("lchown"): # mac os x10.3
        _add("HAVE_LCHOWN", "chown")
    _add("HAVE_LINKAT",     "link")
    _add("HAVE_LUTIMES",    "utime")
    _add("HAVE_LSTAT",      "stat")
    _add("HAVE_FSTATAT",    "stat")
    _add("HAVE_UTIMENSAT",  "utime")
    _add("MS_WINDOWS",      "stat")
    supports_follow_symlinks = _set

    del _set
    del _have_functions
    del _globals
    del _add


# Python uses fixed values for the SEEK_ constants; they are mapped
# to native constants if necessary in posixmodule.c
# Other possible SEEK values are directly imported from posixmodule.c
SEEK_SET = 0
SEEK_CUR = 1
SEEK_END = 2

# Super directory utilities.
# (Inspired by Eric Raymond; the doc strings are mostly his)

def makedirs(name, mode=0o777, exist_ok=False):
    """makedirs(name [, mode=0o777][, exist_ok=False])

    Super-mkdir; create a leaf directory and all intermediate ones.  Works like
    mkdir, except that any intermediate path segment (not just the rightmost)
    will be created if it does not exist. If the target directory already
    exists, raise an OSError if exist_ok is False. Otherwise no exception is
    raised.  This is recursive.

    """
    head, tail = path.split(name)
    if not tail:
        head, tail = path.split(head)
    if head and tail and not path.exists(head):
        try:
            makedirs(head, exist_ok=exist_ok)
        except FileExistsError:
            # Defeats race condition when another thread created the path
            pass
        cdir = curdir
        if isinstance(tail, bytes):
            cdir = bytes(curdir, 'ASCII')
        if tail == cdir:           # xxx/newdir/. exists if xxx/newdir exists
            return
    try:
        mkdir(name, mode)
    except OSError:
        # Cannot rely on checking for EEXIST, since the operating system
        # could give priority to other errors like EACCES or EROFS
        if not exist_ok or not path.isdir(name):
            raise

def removedirs(name):
    """removedirs(name)

    Super-rmdir; remove a leaf directory and all empty intermediate
    ones.  Works like rmdir except that, if the leaf directory is
    successfully removed, directories corresponding to rightmost path
    segments will be pruned away until either the whole path is
    consumed or an error occurs.  Errors during this latter phase are
    ignored -- they generally mean that a directory was not empty.

    """
    rmdir(name)
    head, tail = path.split(name)
    if not tail:
        head, tail = path.split(head)
    while head and tail:
        try:
            rmdir(head)
        except OSError:
            break
        head, tail = path.split(head)

def renames(old, new):
    """renames(old, new)

    Super-rename; create directories as necessary and delete any left
    empty.  Works like rename, except creation of any intermediate
    directories needed to make the new pathname good is attempted
    first.  After the rename, directories corresponding to rightmost
    path segments of the old name will be pruned until either the
    whole path is consumed or a nonempty directory is found.

    Note: this function can fail with the new directory structure made
    if you lack permissions needed to unlink the leaf directory or
    file.

    """
    head, tail = path.split(new)
    if head and tail and not path.exists(head):
        makedirs(head)
    rename(old, new)
    head, tail = path.split(old)
    if head and tail:
        try:
            removedirs(head)
        except OSError:
            pass

__all__.extend(["makedirs", "removedirs", "renames"])

def walk(top, topdown=True, onerror=None, followlinks=False):
    """Directory tree generator.

    For each directory in the directory tree rooted at top (including top
    itself, but excluding '.' and '..'), yields a 3-tuple

        dirpath, dirnames, filenames

    dirpath is a string, the path to the directory.  dirnames is a list of
    the names of the subdirectories in dirpath (excluding '.' and '..').
    filenames is a list of the names of the non-directory files in dirpath.
    Note that the names in the lists are just names, with no path components.
    To get a full path (which begins with top) to a file or directory in
    dirpath, do os.path.join(dirpath, name).

    If optional arg 'topdown' is true or not specified, the triple for a
    directory is generated before the triples for any of its subdirectories
    (directories are generated top down).  If topdown is false, the triple
    for a directory is generated after the triples for all of its
    subdirectories (directories are generated bottom up).

    When topdown is true, the caller can modify the dirnames list in-place
    (e.g., via del or slice assignment), and walk will only recurse into the
    subdirectories whose names remain in dirnames; this can be used to prune the
    search, or to impose a specific order of visiting.  Modifying dirnames when
    topdown is false has no effect on the behavior of os.walk(), since the
    directories in dirnames have already been generated by the time dirnames
    itself is generated. No matter the value of topdown, the list of
    subdirectories is retrieved before the tuples for the directory and its
    subdirectories are generated.

    By default errors from the os.scandir() call are ignored.  If
    optional arg 'onerror' is specified, it should be a function; it
    will be called with one argument, an OSError instance.  It can
    report the error to continue with the walk, or raise the exception
    to abort the walk.  Note that the filename is available as the
    filename attribute of the exception object.

    By default, os.walk does not follow symbolic links to subdirectories on
    systems that support them.  In order to get this functionality, set the
    optional argument 'followlinks' to true.

    Caution:  if you pass a relative pathname for top, don't change the
    current working directory between resumptions of walk.  walk never
    changes the current directory, and assumes that the client doesn't
    either.

    Example:

    import os
    from os.path import join, getsize
    for root, dirs, files in os.walk('python/Lib/email'):
        print(root, "consumes", end="")
        print(sum(getsize(join(root, name)) for name in files), end="")
        print("bytes in", len(files), "non-directory files")
        if 'CVS' in dirs:
            dirs.remove('CVS')  # don't visit CVS directories

    """
    top = fspath(top)
    dirs = []
    nondirs = []
    walk_dirs = []

    # We may not have read permission for top, in which case we can't
    # get a list of the files the directory contains.  os.walk
    # always suppressed the exception then, rather than blow up for a
    # minor reason when (say) a thousand readable directories are still
    # left to visit.  That logic is copied here.
    try:
        # Note that scandir is global in this module due
        # to earlier import-*.
        scandir_it = scandir(top)
    except OSError as error:
        if onerror is not None:
            onerror(error)
        return

    with scandir_it:
        while True:
            try:
                try:
                    entry = next(scandir_it)
                except StopIteration:
                    break
            except OSError as error:
                if onerror is not None:
                    onerror(error)
                return

            try:
                is_dir = entry.is_dir()
            except OSError:
                # If is_dir() raises an OSError, consider that the entry is not
                # a directory, same behaviour than os.path.isdir().
                is_dir = False

            if is_dir:
                dirs.append(entry.name)
            else:
                nondirs.append(entry.name)

            if not topdown and is_dir:
                # Bottom-up: recurse into sub-directory, but exclude symlinks to
                # directories if followlinks is False
                if followlinks:
                    walk_into = True
                else:
                    try:
                        is_symlink = entry.is_symlink()
                    except OSError:
                        # If is_symlink() raises an OSError, consider that the
                        # entry is not a symbolic link, same behaviour than
                        # os.path.islink().
                        is_symlink = False
                    walk_into = not is_symlink

                if walk_into:
                    walk_dirs.append(entry.path)

    # Yield before recursion if going top down
    if topdown:
        yield top, dirs, nondirs

        # Recurse into sub-directories
        islink, join = path.islink, path.join
        for dirname in dirs:
            new_path = join(top, dirname)
            # Issue #23605: os.path.islink() is used instead of caching
            # entry.is_symlink() result during the loop on os.scandir() because
            # the caller can replace the directory entry during the "yield"
            # above.
            if followlinks or not islink(new_path):
                yield from walk(new_path, topdown, onerror, followlinks)
    else:
        # Recurse into sub-directories
        for new_path in walk_dirs:
            yield from walk(new_path, topdown, onerror, followlinks)
        # Yield after recursion if going bottom up
        yield top, dirs, nondirs

__all__.append("walk")

if {open, stat} <= supports_dir_fd and {scandir, stat} <= supports_fd:

    def fwalk(top=".", topdown=True, onerror=None, *, follow_symlinks=False, dir_fd=None):
        """Directory tree generator.

        This behaves exactly like walk(), except that it yields a 4-tuple

            dirpath, dirnames, filenames, dirfd

        `dirpath`, `dirnames` and `filenames` are identical to walk() output,
        and `dirfd` is a file descriptor referring to the directory `dirpath`.

        The advantage of fwalk() over walk() is that it's safe against symlink
        races (when follow_symlinks is False).

        If dir_fd is not None, it should be a file descriptor open to a directory,
          and top should be relative; top will then be relative to that directory.
          (dir_fd is always supported for fwalk.)

        Caution:
        Since fwalk() yields file descriptors, those are only valid until the
        next iteration step, so you should dup() them if you want to keep them
        for a longer period.

        Example:

        import os
        for root, dirs, files, rootfd in os.fwalk('python/Lib/email'):
            print(root, "consumes", end="")
            print(sum(os.stat(name, dir_fd=rootfd).st_size for name in files),
                  end="")
            print("bytes in", len(files), "non-directory files")
            if 'CVS' in dirs:
                dirs.remove('CVS')  # don't visit CVS directories
        """
        if not isinstance(top, int) or not hasattr(top, '__index__'):
            top = fspath(top)
        # Note: To guard against symlink races, we use the standard
        # lstat()/open()/fstat() trick.
        if not follow_symlinks:
            orig_st = stat(top, follow_symlinks=False, dir_fd=dir_fd)
        topfd = open(top, O_RDONLY, dir_fd=dir_fd)
        try:
            if (follow_symlinks or (st.S_ISDIR(orig_st.st_mode) and
                                    path.samestat(orig_st, stat(topfd)))):
                yield from _fwalk(topfd, top, isinstance(top, bytes),
                                  topdown, onerror, follow_symlinks)
        finally:
            close(topfd)

    def _fwalk(topfd, toppath, isbytes, topdown, onerror, follow_symlinks):
        # Note: This uses O(depth of the directory tree) file descriptors: if
        # necessary, it can be adapted to only require O(1) FDs, see issue
        # #13734.

        scandir_it = scandir(topfd)
        dirs = []
        nondirs = []
        entries = None if topdown or follow_symlinks else []
        for entry in scandir_it:
            name = entry.name
            if isbytes:
                name = fsencode(name)
            try:
                if entry.is_dir():
                    dirs.append(name)
                    if entries is not None:
                        entries.append(entry)
                else:
                    nondirs.append(name)
            except OSError:
                try:
                    # Add dangling symlinks, ignore disappeared files
                    if entry.is_symlink():
                        nondirs.append(name)
                except OSError:
                    pass

        if topdown:
            yield toppath, dirs, nondirs, topfd

        for name in dirs if entries is None else zip(dirs, entries):
            try:
                if not follow_symlinks:
                    if topdown:
                        orig_st = stat(name, dir_fd=topfd, follow_symlinks=False)
                    else:
                        assert entries is not None
                        name, entry = name
                        orig_st = entry.stat(follow_symlinks=False)
                dirfd = open(name, O_RDONLY, dir_fd=topfd)
            except OSError as err:
                if onerror is not None:
                    onerror(err)
                continue
            try:
                if follow_symlinks or path.samestat(orig_st, stat(dirfd)):
                    dirpath = path.join(toppath, name)
                    yield from _fwalk(dirfd, dirpath, isbytes,
                                      topdown, onerror, follow_symlinks)
            finally:
                close(dirfd)

        if not topdown:
            yield toppath, dirs, nondirs, topfd

    __all__.append("fwalk")

def execl(file, *args):
    """execl(file, *args)

    Execute the executable file with argument list args, replacing the
    current process. """
    execv(file, args)

def execle(file, *args):
    """execle(file, *args, env)

    Execute the executable file with argument list args and
    environment env, replacing the current process. """
    env = args[-1]
    execve(file, args[:-1], env)

def execlp(file, *args):
    """execlp(file, *args)

    Execute the executable file (which is searched for along $PATH)
    with argument list args, replacing the current process. """
    execvp(file, args)

def execlpe(file, *args):
    """execlpe(file, *args, env)

    Execute the executable file (which is searched for along $PATH)
    with argument list args and environment env, replacing the current
    process. """
    env = args[-1]
    execvpe(file, args[:-1], env)

def execvp(file, args):
    """execvp(file, args)

    Execute the executable file (which is searched for along $PATH)
    with argument list args, replacing the current process.
    args may be a list or tuple of strings. """
    _execvpe(file, args)

def execvpe(file, args, env):
    """execvpe(file, args, env)

    Execute the executable file (which is searched for along $PATH)
    with argument list args and environment env, replacing the
    current process.
    args may be a list or tuple of strings. """
    _execvpe(file, args, env)

__all__.extend(["execl","execle","execlp","execlpe","execvp","execvpe"])

def _execvpe(file, args, env=None):
    if env is not None:
        exec_func = execve
        argrest = (args, env)
    else:
        exec_func = execv
        argrest = (args,)
        env = environ

    if path.dirname(file):
        exec_func(file, *argrest)
        return
    saved_exc = None
    path_list = get_exec_path(env)
    if name != 'nt':
        file = fsencode(file)
        path_list = map(fsencode, path_list)
    for dir in path_list:
        fullname = path.join(dir, file)
        try:
            exec_func(fullname, *argrest)
        except (FileNotFoundError, NotADirectoryError) as e:
            last_exc = e
        except OSError as e:
            last_exc = e
            if saved_exc is None:
                saved_exc = e
    if saved_exc is not None:
        raise saved_exc
    raise last_exc


def get_exec_path(env=None):
    """Returns the sequence of directories that will be searched for the
    named executable (similar to a shell) when launching a process.

    *env* must be an environment variable dict or None.  If *env* is None,
    os.environ will be used.
    """
    # Use a local import instead of a global import to limit the number of
    # modules loaded at startup: the os module is always loaded at startup by
    # Python. It may also avoid a bootstrap issue.
    import warnings

    if env is None:
        env = environ

    # {b'PATH': ...}.get('PATH') and {'PATH': ...}.get(b'PATH') emit a
    # BytesWarning when using python -b or python -bb: ignore the warning
    with warnings.catch_warnings():
        warnings.simplefilter("ignore", BytesWarning)

        try:
            path_list = env.get('PATH')
        except TypeError:
            path_list = None

        if supports_bytes_environ:
            try:
                path_listb = env[b'PATH']
            except (KeyError, TypeError):
                pass
            else:
                if path_list is not None:
                    raise ValueError(
                        "env cannot contain 'PATH' and b'PATH' keys")
                path_list = path_listb

            if path_list is not None and isinstance(path_list, bytes):
                path_list = fsdecode(path_list)

    if path_list is None:
        path_list = defpath
    return path_list.split(pathsep)


# Change environ to automatically call putenv(), unsetenv if they exist.
from _collections_abc import MutableMapping

class _Environ(MutableMapping):
    def __init__(self, data, encodekey, decodekey, encodevalue, decodevalue, putenv, unsetenv):
        self.encodekey = encodekey
        self.decodekey = decodekey
        self.encodevalue = encodevalue
        self.decodevalue = decodevalue
        self.putenv = putenv
        self.unsetenv = unsetenv
        self._data = data

    def __getitem__(self, key):
        try:
            value = self._data[self.encodekey(key)]
        except KeyError:
            # raise KeyError with the original key value
            raise KeyError(key) from None
        return self.decodevalue(value)

    def __setitem__(self, key, value):
        key = self.encodekey(key)
        value = self.encodevalue(value)
        self.putenv(key, value)
        self._data[key] = value

    def __delitem__(self, key):
        encodedkey = self.encodekey(key)
        self.unsetenv(encodedkey)
        try:
            del self._data[encodedkey]
        except KeyError:
            # raise KeyError with the original key value
            raise KeyError(key) from None

    def __iter__(self):
        # list() from dict object is an atomic operation
        keys = list(self._data)
        for key in keys:
            yield self.decodekey(key)

    def __len__(self):
        return len(self._data)

    def __repr__(self):
        return 'environ({{{}}})'.format(', '.join(
            ('{!r}: {!r}'.format(self.decodekey(key), self.decodevalue(value))
            for key, value in self._data.items())))

    def copy(self):
        return dict(self)

    def setdefault(self, key, value):
        if key not in self:
            self[key] = value
        return self[key]

try:
    _putenv = putenv
except NameError:
    _putenv = lambda key, value: None
else:
    if "putenv" not in __all__:
        __all__.append("putenv")

try:
    _unsetenv = unsetenv
except NameError:
    _unsetenv = lambda key: _putenv(key, "")
else:
    if "unsetenv" not in __all__:
        __all__.append("unsetenv")

def _createenviron():
    if name == 'nt':
        # Where Env Var Names Must Be UPPERCASE
        def check_str(value):
            if not isinstance(value, str):
                raise TypeError("str expected, not %s" % type(value).__name__)
            return value
        encode = check_str
        decode = str
        def encodekey(key):
            return encode(key).upper()
        data = {}
        for key, value in environ.items():
            data[encodekey(key)] = value
    else:
        # Where Env Var Names Can Be Mixed Case
        encoding = sys.getfilesystemencoding()
        def encode(value):
            if not isinstance(value, str):
                raise TypeError("str expected, not %s" % type(value).__name__)
            return value.encode(encoding, 'surrogateescape')
        def decode(value):
            return value.decode(encoding, 'surrogateescape')
        encodekey = encode
        data = environ
    return _Environ(data,
        encodekey, decode,
        encode, decode,
        _putenv, _unsetenv)

# unicode environ
environ = _createenviron()
del _createenviron


def getenv(key, default=None):
    """Get an environment variable, return None if it doesn't exist.
    The optional second argument can specify an alternate default.
    key, default and the result are str."""
    return environ.get(key, default)

supports_bytes_environ = (name != 'nt')
__all__.extend(("getenv", "supports_bytes_environ"))

if supports_bytes_environ:
    def _check_bytes(value):
        if not isinstance(value, bytes):
            raise TypeError("bytes expected, not %s" % type(value).__name__)
        return value

    # bytes environ
    environb = _Environ(environ._data,
        _check_bytes, bytes,
        _check_bytes, bytes,
        _putenv, _unsetenv)
    del _check_bytes

    def getenvb(key, default=None):
        """Get an environment variable, return None if it doesn't exist.
        The optional second argument can specify an alternate default.
        key, default and the result are bytes."""
        return environb.get(key, default)

    __all__.extend(("environb", "getenvb"))

def _fscodec():
    encoding = sys.getfilesystemencoding()
    errors = sys.getfilesystemencodeerrors()

    def fsencode(filename):
        """Encode filename (an os.PathLike, bytes, or str) to the filesystem
        encoding with 'surrogateescape' error handler, return bytes unchanged.
        On Windows, use 'strict' error handler if the file system encoding is
        'mbcs' (which is the default encoding).
        """
        filename = fspath(filename)  # Does type-checking of `filename`.
        if isinstance(filename, str):
            return filename.encode(encoding, errors)
        else:
            return filename

    def fsdecode(filename):
        """Decode filename (an os.PathLike, bytes, or str) from the filesystem
        encoding with 'surrogateescape' error handler, return str unchanged. On
        Windows, use 'strict' error handler if the file system encoding is
        'mbcs' (which is the default encoding).
        """
        filename = fspath(filename)  # Does type-checking of `filename`.
        if isinstance(filename, bytes):
            return filename.decode(encoding, errors)
        else:
            return filename

    return fsencode, fsdecode

fsencode, fsdecode = _fscodec()
del _fscodec

# Supply spawn*() (probably only for Unix)
if _exists("fork") and not _exists("spawnv") and _exists("execv"):

    P_WAIT = 0
    P_NOWAIT = P_NOWAITO = 1

    __all__.extend(["P_WAIT", "P_NOWAIT", "P_NOWAITO"])

    # XXX Should we support P_DETACH?  I suppose it could fork()**2
    # and close the std I/O streams.  Also, P_OVERLAY is the same
    # as execv*()?

    def _spawnvef(mode, file, args, env, func):
        # Internal helper; func is the exec*() function to use
        if not isinstance(args, (tuple, list)):
            raise TypeError('argv must be a tuple or a list')
        if not args or not args[0]:
            raise ValueError('argv first element cannot be empty')
        pid = fork()
        if not pid:
            # Child
            try:
                if env is None:
                    func(file, args)
                else:
                    func(file, args, env)
            except:
                _exit(127)
        else:
            # Parent
            if mode == P_NOWAIT:
                return pid # Caller is responsible for waiting!
            while 1:
                wpid, sts = waitpid(pid, 0)
                if WIFSTOPPED(sts):
                    continue
                elif WIFSIGNALED(sts):
                    return -WTERMSIG(sts)
                elif WIFEXITED(sts):
                    return WEXITSTATUS(sts)
                else:
                    raise OSError("Not stopped, signaled or exited???")

    def spawnv(mode, file, args):
        """spawnv(mode, file, args) -> integer

Execute file with arguments from args in a subprocess.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. """
        return _spawnvef(mode, file, args, None, execv)

    def spawnve(mode, file, args, env):
        """spawnve(mode, file, args, env) -> integer

Execute file with arguments from args in a subprocess with the
specified environment.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. """
        return _spawnvef(mode, file, args, env, execve)

    # Note: spawnvp[e] isn't currently supported on Windows

    def spawnvp(mode, file, args):
        """spawnvp(mode, file, args) -> integer

Execute file (which is looked for along $PATH) with arguments from
args in a subprocess.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. """
        return _spawnvef(mode, file, args, None, execvp)

    def spawnvpe(mode, file, args, env):
        """spawnvpe(mode, file, args, env) -> integer

Execute file (which is looked for along $PATH) with arguments from
args in a subprocess with the supplied environment.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. """
        return _spawnvef(mode, file, args, env, execvpe)


    __all__.extend(["spawnv", "spawnve", "spawnvp", "spawnvpe"])


if _exists("spawnv"):
    # These aren't supplied by the basic Windows code
    # but can be easily implemented in Python

    def spawnl(mode, file, *args):
        """spawnl(mode, file, *args) -> integer

Execute file with arguments from args in a subprocess.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. """
        return spawnv(mode, file, args)

    def spawnle(mode, file, *args):
        """spawnle(mode, file, *args, env) -> integer

Execute file with arguments from args in a subprocess with the
supplied environment.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. """
        env = args[-1]
        return spawnve(mode, file, args[:-1], env)


    __all__.extend(["spawnl", "spawnle"])


if _exists("spawnvp"):
    # At the moment, Windows doesn't implement spawnvp[e],
    # so it won't have spawnlp[e] either.
    def spawnlp(mode, file, *args):
        """spawnlp(mode, file, *args) -> integer

Execute file (which is looked for along $PATH) with arguments from
args in a subprocess with the supplied environment.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. """
        return spawnvp(mode, file, args)

    def spawnlpe(mode, file, *args):
        """spawnlpe(mode, file, *args, env) -> integer

Execute file (which is looked for along $PATH) with arguments from
args in a subprocess with the supplied environment.
If mode == P_NOWAIT return the pid of the process.
If mode == P_WAIT return the process's exit code if it exits normally;
otherwise return -SIG, where SIG is the signal that killed it. """
        env = args[-1]
        return spawnvpe(mode, file, args[:-1], env)


    __all__.extend(["spawnlp", "spawnlpe"])


# Supply os.popen()
def popen(cmd, mode="r", buffering=-1):
    if not isinstance(cmd, str):
        raise TypeError("invalid cmd type (%s, expected string)" % type(cmd))
    if mode not in ("r", "w"):
        raise ValueError("invalid mode %r" % mode)
    if buffering == 0 or buffering is None:
        raise ValueError("popen() does not support unbuffered streams")
    import subprocess, io
    if mode == "r":
        proc = subprocess.Popen(cmd,
                                shell=True,
                                stdout=subprocess.PIPE,
                                bufsize=buffering)
        return _wrap_close(io.TextIOWrapper(proc.stdout), proc)
    else:
        proc = subprocess.Popen(cmd,
                                shell=True,
                                stdin=subprocess.PIPE,
                                bufsize=buffering)
        return _wrap_close(io.TextIOWrapper(proc.stdin), proc)

# Helper for popen() -- a proxy for a file whose close waits for the process
class _wrap_close:
    def __init__(self, stream, proc):
        self._stream = stream
        self._proc = proc
    def close(self):
        self._stream.close()
        returncode = self._proc.wait()
        if returncode == 0:
            return None
        if name == 'nt':
            return returncode
        else:
            return returncode << 8  # Shift left to match old behavior
    def __enter__(self):
        return self
    def __exit__(self, *args):
        self.close()
    def __getattr__(self, name):
        return getattr(self._stream, name)
    def __iter__(self):
        return iter(self._stream)

# Supply os.fdopen()
def fdopen(fd, *args, **kwargs):
    if not isinstance(fd, int):
        raise TypeError("invalid fd type (%s, expected integer)" % type(fd))
    import io
    return io.open(fd, *args, **kwargs)


# For testing purposes, make sure the function is available when the C
# implementation exists.
def _fspath(path):
    """Return the path representation of a path-like object.

    If str or bytes is passed in, it is returned unchanged. Otherwise the
    os.PathLike interface is used to get the path representation. If the
    path representation is not str or bytes, TypeError is raised. If the
    provided path is not str, bytes, or os.PathLike, TypeError is raised.
    """
    if isinstance(path, (str, bytes)):
        return path

    # Work from the object's type to match method resolution of other magic
    # methods.
    path_type = type(path)
    try:
        path_repr = path_type.__fspath__(path)
    except AttributeError:
        if hasattr(path_type, '__fspath__'):
            raise
        else:
            raise TypeError("expected str, bytes or os.PathLike object, "
                            "not " + path_type.__name__)
    if isinstance(path_repr, (str, bytes)):
        return path_repr
    else:
        raise TypeError("expected {}.__fspath__() to return str or bytes, "
                        "not {}".format(path_type.__name__,
                                        type(path_repr).__name__))

# If there is no C implementation, make the pure Python version the
# implementation as transparently as possible.
if not _exists('fspath'):
    fspath = _fspath
    fspath.__name__ = "fspath"


class PathLike(abc.ABC):

    """Abstract base class for implementing the file system path protocol."""

    @abc.abstractmethod
    def __fspath__(self):
        """Return the file system path representation of the object."""
        raise NotImplementedError

    @classmethod
    def __subclasshook__(cls, subclass):
        if cls is PathLike:
            return _check_methods(subclass, '__fspath__')
        return NotImplemented


if name == 'nt':
    class _AddedDllDirectory:
        def __init__(self, path, cookie, remove_dll_directory):
            self.path = path
            self._cookie = cookie
            self._remove_dll_directory = remove_dll_directory
        def close(self):
            self._remove_dll_directory(self._cookie)
            self.path = None
        def __enter__(self):
            return self
        def __exit__(self, *args):
            self.close()
        def __repr__(self):
            if self.path:
                return "<AddedDllDirectory({!r})>".format(self.path)
            return "<AddedDllDirectory()>"

    def add_dll_directory(path):
        """Add a path to the DLL search path.

        This search path is used when resolving dependencies for imported
        extension modules (the module itself is resolved through sys.path),
        and also by ctypes.

        Remove the directory by calling close() on the returned object or
        using it in a with statement.
        """
        import nt
        cookie = nt._add_dll_directory(path)
        return _AddedDllDirectory(
            path,
            cookie,
            nt._remove_dll_directory
        )
timeit.py000075500000032250151153537610006425 0ustar00#! /usr/bin/python3.8

"""Tool for measuring execution time of small code snippets.

This module avoids a number of common traps for measuring execution
times.  See also Tim Peters' introduction to the Algorithms chapter in
the Python Cookbook, published by O'Reilly.

Library usage: see the Timer class.

Command line usage:
    python timeit.py [-n N] [-r N] [-s S] [-p] [-h] [--] [statement]

Options:
  -n/--number N: how many times to execute 'statement' (default: see below)
  -r/--repeat N: how many times to repeat the timer (default 5)
  -s/--setup S: statement to be executed once initially (default 'pass').
                Execution time of this setup statement is NOT timed.
  -p/--process: use time.process_time() (default is time.perf_counter())
  -v/--verbose: print raw timing results; repeat for more digits precision
  -u/--unit: set the output time unit (nsec, usec, msec, or sec)
  -h/--help: print this usage message and exit
  --: separate options from statement, use when statement starts with -
  statement: statement to be timed (default 'pass')

A multi-line statement may be given by specifying each line as a
separate argument; indented lines are possible by enclosing an
argument in quotes and using leading spaces.  Multiple -s options are
treated similarly.

If -n is not given, a suitable number of loops is calculated by trying
increasing numbers from the sequence 1, 2, 5, 10, 20, 50, ... until the
total time is at least 0.2 seconds.

Note: there is a certain baseline overhead associated with executing a
pass statement.  It differs between versions.  The code here doesn't try
to hide it, but you should be aware of it.  The baseline overhead can be
measured by invoking the program without arguments.

Classes:

    Timer

Functions:

    timeit(string, string) -> float
    repeat(string, string) -> list
    default_timer() -> float

"""

import gc
import sys
import time
import itertools

__all__ = ["Timer", "timeit", "repeat", "default_timer"]

dummy_src_name = "<timeit-src>"
default_number = 1000000
default_repeat = 5
default_timer = time.perf_counter

_globals = globals

# Don't change the indentation of the template; the reindent() calls
# in Timer.__init__() depend on setup being indented 4 spaces and stmt
# being indented 8 spaces.
template = """
def inner(_it, _timer{init}):
    {setup}
    _t0 = _timer()
    for _i in _it:
        {stmt}
    _t1 = _timer()
    return _t1 - _t0
"""

def reindent(src, indent):
    """Helper to reindent a multi-line statement."""
    return src.replace("\n", "\n" + " "*indent)

class Timer:
    """Class for timing execution speed of small code snippets.

    The constructor takes a statement to be timed, an additional
    statement used for setup, and a timer function.  Both statements
    default to 'pass'; the timer function is platform-dependent (see
    module doc string).  If 'globals' is specified, the code will be
    executed within that namespace (as opposed to inside timeit's
    namespace).

    To measure the execution time of the first statement, use the
    timeit() method.  The repeat() method is a convenience to call
    timeit() multiple times and return a list of results.

    The statements may contain newlines, as long as they don't contain
    multi-line string literals.
    """

    def __init__(self, stmt="pass", setup="pass", timer=default_timer,
                 globals=None):
        """Constructor.  See class doc string."""
        self.timer = timer
        local_ns = {}
        global_ns = _globals() if globals is None else globals
        init = ''
        if isinstance(setup, str):
            # Check that the code can be compiled outside a function
            compile(setup, dummy_src_name, "exec")
            stmtprefix = setup + '\n'
            setup = reindent(setup, 4)
        elif callable(setup):
            local_ns['_setup'] = setup
            init += ', _setup=_setup'
            stmtprefix = ''
            setup = '_setup()'
        else:
            raise ValueError("setup is neither a string nor callable")
        if isinstance(stmt, str):
            # Check that the code can be compiled outside a function
            compile(stmtprefix + stmt, dummy_src_name, "exec")
            stmt = reindent(stmt, 8)
        elif callable(stmt):
            local_ns['_stmt'] = stmt
            init += ', _stmt=_stmt'
            stmt = '_stmt()'
        else:
            raise ValueError("stmt is neither a string nor callable")
        src = template.format(stmt=stmt, setup=setup, init=init)
        self.src = src  # Save for traceback display
        code = compile(src, dummy_src_name, "exec")
        exec(code, global_ns, local_ns)
        self.inner = local_ns["inner"]

    def print_exc(self, file=None):
        """Helper to print a traceback from the timed code.

        Typical use:

            t = Timer(...)       # outside the try/except
            try:
                t.timeit(...)    # or t.repeat(...)
            except:
                t.print_exc()

        The advantage over the standard traceback is that source lines
        in the compiled template will be displayed.

        The optional file argument directs where the traceback is
        sent; it defaults to sys.stderr.
        """
        import linecache, traceback
        if self.src is not None:
            linecache.cache[dummy_src_name] = (len(self.src),
                                               None,
                                               self.src.split("\n"),
                                               dummy_src_name)
        # else the source is already stored somewhere else

        traceback.print_exc(file=file)

    def timeit(self, number=default_number):
        """Time 'number' executions of the main statement.

        To be precise, this executes the setup statement once, and
        then returns the time it takes to execute the main statement
        a number of times, as a float measured in seconds.  The
        argument is the number of times through the loop, defaulting
        to one million.  The main statement, the setup statement and
        the timer function to be used are passed to the constructor.
        """
        it = itertools.repeat(None, number)
        gcold = gc.isenabled()
        gc.disable()
        try:
            timing = self.inner(it, self.timer)
        finally:
            if gcold:
                gc.enable()
        return timing

    def repeat(self, repeat=default_repeat, number=default_number):
        """Call timeit() a few times.

        This is a convenience function that calls the timeit()
        repeatedly, returning a list of results.  The first argument
        specifies how many times to call timeit(), defaulting to 5;
        the second argument specifies the timer argument, defaulting
        to one million.

        Note: it's tempting to calculate mean and standard deviation
        from the result vector and report these.  However, this is not
        very useful.  In a typical case, the lowest value gives a
        lower bound for how fast your machine can run the given code
        snippet; higher values in the result vector are typically not
        caused by variability in Python's speed, but by other
        processes interfering with your timing accuracy.  So the min()
        of the result is probably the only number you should be
        interested in.  After that, you should look at the entire
        vector and apply common sense rather than statistics.
        """
        r = []
        for i in range(repeat):
            t = self.timeit(number)
            r.append(t)
        return r

    def autorange(self, callback=None):
        """Return the number of loops and time taken so that total time >= 0.2.

        Calls the timeit method with increasing numbers from the sequence
        1, 2, 5, 10, 20, 50, ... until the time taken is at least 0.2
        second.  Returns (number, time_taken).

        If *callback* is given and is not None, it will be called after
        each trial with two arguments: ``callback(number, time_taken)``.
        """
        i = 1
        while True:
            for j in 1, 2, 5:
                number = i * j
                time_taken = self.timeit(number)
                if callback:
                    callback(number, time_taken)
                if time_taken >= 0.2:
                    return (number, time_taken)
            i *= 10

def timeit(stmt="pass", setup="pass", timer=default_timer,
           number=default_number, globals=None):
    """Convenience function to create Timer object and call timeit method."""
    return Timer(stmt, setup, timer, globals).timeit(number)

def repeat(stmt="pass", setup="pass", timer=default_timer,
           repeat=default_repeat, number=default_number, globals=None):
    """Convenience function to create Timer object and call repeat method."""
    return Timer(stmt, setup, timer, globals).repeat(repeat, number)

def main(args=None, *, _wrap_timer=None):
    """Main program, used when run as a script.

    The optional 'args' argument specifies the command line to be parsed,
    defaulting to sys.argv[1:].

    The return value is an exit code to be passed to sys.exit(); it
    may be None to indicate success.

    When an exception happens during timing, a traceback is printed to
    stderr and the return value is 1.  Exceptions at other times
    (including the template compilation) are not caught.

    '_wrap_timer' is an internal interface used for unit testing.  If it
    is not None, it must be a callable that accepts a timer function
    and returns another timer function (used for unit testing).
    """
    if args is None:
        args = sys.argv[1:]
    import getopt
    try:
        opts, args = getopt.getopt(args, "n:u:s:r:tcpvh",
                                   ["number=", "setup=", "repeat=",
                                    "time", "clock", "process",
                                    "verbose", "unit=", "help"])
    except getopt.error as err:
        print(err)
        print("use -h/--help for command line help")
        return 2

    timer = default_timer
    stmt = "\n".join(args) or "pass"
    number = 0 # auto-determine
    setup = []
    repeat = default_repeat
    verbose = 0
    time_unit = None
    units = {"nsec": 1e-9, "usec": 1e-6, "msec": 1e-3, "sec": 1.0}
    precision = 3
    for o, a in opts:
        if o in ("-n", "--number"):
            number = int(a)
        if o in ("-s", "--setup"):
            setup.append(a)
        if o in ("-u", "--unit"):
            if a in units:
                time_unit = a
            else:
                print("Unrecognized unit. Please select nsec, usec, msec, or sec.",
                    file=sys.stderr)
                return 2
        if o in ("-r", "--repeat"):
            repeat = int(a)
            if repeat <= 0:
                repeat = 1
        if o in ("-p", "--process"):
            timer = time.process_time
        if o in ("-v", "--verbose"):
            if verbose:
                precision += 1
            verbose += 1
        if o in ("-h", "--help"):
            print(__doc__, end=' ')
            return 0
    setup = "\n".join(setup) or "pass"

    # Include the current directory, so that local imports work (sys.path
    # contains the directory of this script, rather than the current
    # directory)
    import os
    sys.path.insert(0, os.curdir)
    if _wrap_timer is not None:
        timer = _wrap_timer(timer)

    t = Timer(stmt, setup, timer)
    if number == 0:
        # determine number so that 0.2 <= total time < 2.0
        callback = None
        if verbose:
            def callback(number, time_taken):
                msg = "{num} loop{s} -> {secs:.{prec}g} secs"
                plural = (number != 1)
                print(msg.format(num=number, s='s' if plural else '',
                                  secs=time_taken, prec=precision))
        try:
            number, _ = t.autorange(callback)
        except:
            t.print_exc()
            return 1

        if verbose:
            print()

    try:
        raw_timings = t.repeat(repeat, number)
    except:
        t.print_exc()
        return 1

    def format_time(dt):
        unit = time_unit

        if unit is not None:
            scale = units[unit]
        else:
            scales = [(scale, unit) for unit, scale in units.items()]
            scales.sort(reverse=True)
            for scale, unit in scales:
                if dt >= scale:
                    break

        return "%.*g %s" % (precision, dt / scale, unit)

    if verbose:
        print("raw times: %s" % ", ".join(map(format_time, raw_timings)))
        print()
    timings = [dt / number for dt in raw_timings]

    best = min(timings)
    print("%d loop%s, best of %d: %s per loop"
          % (number, 's' if number != 1 else '',
             repeat, format_time(best)))

    best = min(timings)
    worst = max(timings)
    if worst >= best * 4:
        import warnings
        warnings.warn_explicit("The test results are likely unreliable. "
                               "The worst time (%s) was more than four times "
                               "slower than the best time (%s)."
                               % (format_time(worst), format_time(best)),
                               UserWarning, '', 0)
    return None

if __name__ == "__main__":
    sys.exit(main())
runpy.py000064400000027424151153537610006313 0ustar00"""runpy.py - locating and running Python code using the module namespace

Provides support for locating and running Python scripts using the Python
module namespace instead of the native filesystem.

This allows Python code to play nicely with non-filesystem based PEP 302
importers when locating support scripts as well as when importing modules.
"""
# Written by Nick Coghlan <ncoghlan at gmail.com>
#    to implement PEP 338 (Executing Modules as Scripts)


import sys
import importlib.machinery # importlib first so we can test #15386 via -m
import importlib.util
import io
import types
import os
from pkgutil import read_code, get_importer

__all__ = [
    "run_module", "run_path",
]

class _TempModule(object):
    """Temporarily replace a module in sys.modules with an empty namespace"""
    def __init__(self, mod_name):
        self.mod_name = mod_name
        self.module = types.ModuleType(mod_name)
        self._saved_module = []

    def __enter__(self):
        mod_name = self.mod_name
        try:
            self._saved_module.append(sys.modules[mod_name])
        except KeyError:
            pass
        sys.modules[mod_name] = self.module
        return self

    def __exit__(self, *args):
        if self._saved_module:
            sys.modules[self.mod_name] = self._saved_module[0]
        else:
            del sys.modules[self.mod_name]
        self._saved_module = []

class _ModifiedArgv0(object):
    def __init__(self, value):
        self.value = value
        self._saved_value = self._sentinel = object()

    def __enter__(self):
        if self._saved_value is not self._sentinel:
            raise RuntimeError("Already preserving saved value")
        self._saved_value = sys.argv[0]
        sys.argv[0] = self.value

    def __exit__(self, *args):
        self.value = self._sentinel
        sys.argv[0] = self._saved_value

# TODO: Replace these helpers with importlib._bootstrap_external functions.
def _run_code(code, run_globals, init_globals=None,
              mod_name=None, mod_spec=None,
              pkg_name=None, script_name=None):
    """Helper to run code in nominated namespace"""
    if init_globals is not None:
        run_globals.update(init_globals)
    if mod_spec is None:
        loader = None
        fname = script_name
        cached = None
    else:
        loader = mod_spec.loader
        fname = mod_spec.origin
        cached = mod_spec.cached
        if pkg_name is None:
            pkg_name = mod_spec.parent
    run_globals.update(__name__ = mod_name,
                       __file__ = fname,
                       __cached__ = cached,
                       __doc__ = None,
                       __loader__ = loader,
                       __package__ = pkg_name,
                       __spec__ = mod_spec)
    exec(code, run_globals)
    return run_globals

def _run_module_code(code, init_globals=None,
                    mod_name=None, mod_spec=None,
                    pkg_name=None, script_name=None):
    """Helper to run code in new namespace with sys modified"""
    fname = script_name if mod_spec is None else mod_spec.origin
    with _TempModule(mod_name) as temp_module, _ModifiedArgv0(fname):
        mod_globals = temp_module.module.__dict__
        _run_code(code, mod_globals, init_globals,
                  mod_name, mod_spec, pkg_name, script_name)
    # Copy the globals of the temporary module, as they
    # may be cleared when the temporary module goes away
    return mod_globals.copy()

# Helper to get the full name, spec and code for a module
def _get_module_details(mod_name, error=ImportError):
    if mod_name.startswith("."):
        raise error("Relative module names not supported")
    pkg_name, _, _ = mod_name.rpartition(".")
    if pkg_name:
        # Try importing the parent to avoid catching initialization errors
        try:
            __import__(pkg_name)
        except ImportError as e:
            # If the parent or higher ancestor package is missing, let the
            # error be raised by find_spec() below and then be caught. But do
            # not allow other errors to be caught.
            if e.name is None or (e.name != pkg_name and
                    not pkg_name.startswith(e.name + ".")):
                raise
        # Warn if the module has already been imported under its normal name
        existing = sys.modules.get(mod_name)
        if existing is not None and not hasattr(existing, "__path__"):
            from warnings import warn
            msg = "{mod_name!r} found in sys.modules after import of " \
                "package {pkg_name!r}, but prior to execution of " \
                "{mod_name!r}; this may result in unpredictable " \
                "behaviour".format(mod_name=mod_name, pkg_name=pkg_name)
            warn(RuntimeWarning(msg))

    try:
        spec = importlib.util.find_spec(mod_name)
    except (ImportError, AttributeError, TypeError, ValueError) as ex:
        # This hack fixes an impedance mismatch between pkgutil and
        # importlib, where the latter raises other errors for cases where
        # pkgutil previously raised ImportError
        msg = "Error while finding module specification for {!r} ({}: {})"
        raise error(msg.format(mod_name, type(ex).__name__, ex)) from ex
    if spec is None:
        raise error("No module named %s" % mod_name)
    if spec.submodule_search_locations is not None:
        if mod_name == "__main__" or mod_name.endswith(".__main__"):
            raise error("Cannot use package as __main__ module")
        try:
            pkg_main_name = mod_name + ".__main__"
            return _get_module_details(pkg_main_name, error)
        except error as e:
            if mod_name not in sys.modules:
                raise  # No module loaded; being a package is irrelevant
            raise error(("%s; %r is a package and cannot " +
                               "be directly executed") %(e, mod_name))
    loader = spec.loader
    if loader is None:
        raise error("%r is a namespace package and cannot be executed"
                                                                 % mod_name)
    try:
        code = loader.get_code(mod_name)
    except ImportError as e:
        raise error(format(e)) from e
    if code is None:
        raise error("No code object available for %s" % mod_name)
    return mod_name, spec, code

class _Error(Exception):
    """Error that _run_module_as_main() should report without a traceback"""

# XXX ncoghlan: Should this be documented and made public?
# (Current thoughts: don't repeat the mistake that lead to its
# creation when run_module() no longer met the needs of
# mainmodule.c, but couldn't be changed because it was public)
def _run_module_as_main(mod_name, alter_argv=True):
    """Runs the designated module in the __main__ namespace

       Note that the executed module will have full access to the
       __main__ namespace. If this is not desirable, the run_module()
       function should be used to run the module code in a fresh namespace.

       At the very least, these variables in __main__ will be overwritten:
           __name__
           __file__
           __cached__
           __loader__
           __package__
    """
    try:
        if alter_argv or mod_name != "__main__": # i.e. -m switch
            mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
        else:          # i.e. directory or zipfile execution
            mod_name, mod_spec, code = _get_main_module_details(_Error)
    except _Error as exc:
        msg = "%s: %s" % (sys.executable, exc)
        sys.exit(msg)
    main_globals = sys.modules["__main__"].__dict__
    if alter_argv:
        sys.argv[0] = mod_spec.origin
    return _run_code(code, main_globals, None,
                     "__main__", mod_spec)

def run_module(mod_name, init_globals=None,
               run_name=None, alter_sys=False):
    """Execute a module's code without importing it

       Returns the resulting top level namespace dictionary
    """
    mod_name, mod_spec, code = _get_module_details(mod_name)
    if run_name is None:
        run_name = mod_name
    if alter_sys:
        return _run_module_code(code, init_globals, run_name, mod_spec)
    else:
        # Leave the sys module alone
        return _run_code(code, {}, init_globals, run_name, mod_spec)

def _get_main_module_details(error=ImportError):
    # Helper that gives a nicer error message when attempting to
    # execute a zipfile or directory by invoking __main__.py
    # Also moves the standard __main__ out of the way so that the
    # preexisting __loader__ entry doesn't cause issues
    main_name = "__main__"
    saved_main = sys.modules[main_name]
    del sys.modules[main_name]
    try:
        return _get_module_details(main_name)
    except ImportError as exc:
        if main_name in str(exc):
            raise error("can't find %r module in %r" %
                              (main_name, sys.path[0])) from exc
        raise
    finally:
        sys.modules[main_name] = saved_main


def _get_code_from_file(run_name, fname):
    # Check for a compiled file first
    decoded_path = os.path.abspath(os.fsdecode(fname))
    with io.open_code(decoded_path) as f:
        code = read_code(f)
    if code is None:
        # That didn't work, so try it as normal source code
        with io.open_code(decoded_path) as f:
            code = compile(f.read(), fname, 'exec')
    return code, fname

def run_path(path_name, init_globals=None, run_name=None):
    """Execute code located at the specified filesystem location

       Returns the resulting top level namespace dictionary

       The file path may refer directly to a Python script (i.e.
       one that could be directly executed with execfile) or else
       it may refer to a zipfile or directory containing a top
       level __main__.py script.
    """
    if run_name is None:
        run_name = "<run_path>"
    pkg_name = run_name.rpartition(".")[0]
    importer = get_importer(path_name)
    # Trying to avoid importing imp so as to not consume the deprecation warning.
    is_NullImporter = False
    if type(importer).__module__ == 'imp':
        if type(importer).__name__ == 'NullImporter':
            is_NullImporter = True
    if isinstance(importer, type(None)) or is_NullImporter:
        # Not a valid sys.path entry, so run the code directly
        # execfile() doesn't help as we want to allow compiled files
        code, fname = _get_code_from_file(run_name, path_name)
        return _run_module_code(code, init_globals, run_name,
                                pkg_name=pkg_name, script_name=fname)
    else:
        # Finder is defined for path, so add it to
        # the start of sys.path
        sys.path.insert(0, path_name)
        try:
            # Here's where things are a little different from the run_module
            # case. There, we only had to replace the module in sys while the
            # code was running and doing so was somewhat optional. Here, we
            # have no choice and we have to remove it even while we read the
            # code. If we don't do this, a __loader__ attribute in the
            # existing __main__ module may prevent location of the new module.
            mod_name, mod_spec, code = _get_main_module_details()
            with _TempModule(run_name) as temp_module, \
                 _ModifiedArgv0(path_name):
                mod_globals = temp_module.module.__dict__
                return _run_code(code, mod_globals, init_globals,
                                    run_name, mod_spec, pkg_name).copy()
        finally:
            try:
                sys.path.remove(path_name)
            except ValueError:
                pass


if __name__ == "__main__":
    # Run the module specified as the next command line argument
    if len(sys.argv) < 2:
        print("No module specified for execution", file=sys.stderr)
    else:
        del sys.argv[0] # Make the requested module sys.argv[0]
        _run_module_as_main(sys.argv[0])
encodings/raw_unicode_escape.py000064400000002270151153537610012716 0ustar00""" Python 'raw-unicode-escape' Codec


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

"""
import codecs

### Codec APIs

class Codec(codecs.Codec):

    # Note: Binding these as C functions will result in the class not
    # converting them to methods. This is intended.
    encode = codecs.raw_unicode_escape_encode
    decode = codecs.raw_unicode_escape_decode

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.raw_unicode_escape_encode(input, self.errors)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.raw_unicode_escape_decode(input, self.errors)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='raw-unicode-escape',
        encode=Codec.encode,
        decode=Codec.decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamwriter=StreamWriter,
        streamreader=StreamReader,
    )
encodings/tis_620.py000064400000030014151153537610010262 0ustar00""" Python Character Mapping Codec tis_620 generated from 'python-mappings/TIS-620.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='tis-620',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\x80'     #  0x80 -> <control>
    '\x81'     #  0x81 -> <control>
    '\x82'     #  0x82 -> <control>
    '\x83'     #  0x83 -> <control>
    '\x84'     #  0x84 -> <control>
    '\x85'     #  0x85 -> <control>
    '\x86'     #  0x86 -> <control>
    '\x87'     #  0x87 -> <control>
    '\x88'     #  0x88 -> <control>
    '\x89'     #  0x89 -> <control>
    '\x8a'     #  0x8A -> <control>
    '\x8b'     #  0x8B -> <control>
    '\x8c'     #  0x8C -> <control>
    '\x8d'     #  0x8D -> <control>
    '\x8e'     #  0x8E -> <control>
    '\x8f'     #  0x8F -> <control>
    '\x90'     #  0x90 -> <control>
    '\x91'     #  0x91 -> <control>
    '\x92'     #  0x92 -> <control>
    '\x93'     #  0x93 -> <control>
    '\x94'     #  0x94 -> <control>
    '\x95'     #  0x95 -> <control>
    '\x96'     #  0x96 -> <control>
    '\x97'     #  0x97 -> <control>
    '\x98'     #  0x98 -> <control>
    '\x99'     #  0x99 -> <control>
    '\x9a'     #  0x9A -> <control>
    '\x9b'     #  0x9B -> <control>
    '\x9c'     #  0x9C -> <control>
    '\x9d'     #  0x9D -> <control>
    '\x9e'     #  0x9E -> <control>
    '\x9f'     #  0x9F -> <control>
    '\ufffe'
    '\u0e01'   #  0xA1 -> THAI CHARACTER KO KAI
    '\u0e02'   #  0xA2 -> THAI CHARACTER KHO KHAI
    '\u0e03'   #  0xA3 -> THAI CHARACTER KHO KHUAT
    '\u0e04'   #  0xA4 -> THAI CHARACTER KHO KHWAI
    '\u0e05'   #  0xA5 -> THAI CHARACTER KHO KHON
    '\u0e06'   #  0xA6 -> THAI CHARACTER KHO RAKHANG
    '\u0e07'   #  0xA7 -> THAI CHARACTER NGO NGU
    '\u0e08'   #  0xA8 -> THAI CHARACTER CHO CHAN
    '\u0e09'   #  0xA9 -> THAI CHARACTER CHO CHING
    '\u0e0a'   #  0xAA -> THAI CHARACTER CHO CHANG
    '\u0e0b'   #  0xAB -> THAI CHARACTER SO SO
    '\u0e0c'   #  0xAC -> THAI CHARACTER CHO CHOE
    '\u0e0d'   #  0xAD -> THAI CHARACTER YO YING
    '\u0e0e'   #  0xAE -> THAI CHARACTER DO CHADA
    '\u0e0f'   #  0xAF -> THAI CHARACTER TO PATAK
    '\u0e10'   #  0xB0 -> THAI CHARACTER THO THAN
    '\u0e11'   #  0xB1 -> THAI CHARACTER THO NANGMONTHO
    '\u0e12'   #  0xB2 -> THAI CHARACTER THO PHUTHAO
    '\u0e13'   #  0xB3 -> THAI CHARACTER NO NEN
    '\u0e14'   #  0xB4 -> THAI CHARACTER DO DEK
    '\u0e15'   #  0xB5 -> THAI CHARACTER TO TAO
    '\u0e16'   #  0xB6 -> THAI CHARACTER THO THUNG
    '\u0e17'   #  0xB7 -> THAI CHARACTER THO THAHAN
    '\u0e18'   #  0xB8 -> THAI CHARACTER THO THONG
    '\u0e19'   #  0xB9 -> THAI CHARACTER NO NU
    '\u0e1a'   #  0xBA -> THAI CHARACTER BO BAIMAI
    '\u0e1b'   #  0xBB -> THAI CHARACTER PO PLA
    '\u0e1c'   #  0xBC -> THAI CHARACTER PHO PHUNG
    '\u0e1d'   #  0xBD -> THAI CHARACTER FO FA
    '\u0e1e'   #  0xBE -> THAI CHARACTER PHO PHAN
    '\u0e1f'   #  0xBF -> THAI CHARACTER FO FAN
    '\u0e20'   #  0xC0 -> THAI CHARACTER PHO SAMPHAO
    '\u0e21'   #  0xC1 -> THAI CHARACTER MO MA
    '\u0e22'   #  0xC2 -> THAI CHARACTER YO YAK
    '\u0e23'   #  0xC3 -> THAI CHARACTER RO RUA
    '\u0e24'   #  0xC4 -> THAI CHARACTER RU
    '\u0e25'   #  0xC5 -> THAI CHARACTER LO LING
    '\u0e26'   #  0xC6 -> THAI CHARACTER LU
    '\u0e27'   #  0xC7 -> THAI CHARACTER WO WAEN
    '\u0e28'   #  0xC8 -> THAI CHARACTER SO SALA
    '\u0e29'   #  0xC9 -> THAI CHARACTER SO RUSI
    '\u0e2a'   #  0xCA -> THAI CHARACTER SO SUA
    '\u0e2b'   #  0xCB -> THAI CHARACTER HO HIP
    '\u0e2c'   #  0xCC -> THAI CHARACTER LO CHULA
    '\u0e2d'   #  0xCD -> THAI CHARACTER O ANG
    '\u0e2e'   #  0xCE -> THAI CHARACTER HO NOKHUK
    '\u0e2f'   #  0xCF -> THAI CHARACTER PAIYANNOI
    '\u0e30'   #  0xD0 -> THAI CHARACTER SARA A
    '\u0e31'   #  0xD1 -> THAI CHARACTER MAI HAN-AKAT
    '\u0e32'   #  0xD2 -> THAI CHARACTER SARA AA
    '\u0e33'   #  0xD3 -> THAI CHARACTER SARA AM
    '\u0e34'   #  0xD4 -> THAI CHARACTER SARA I
    '\u0e35'   #  0xD5 -> THAI CHARACTER SARA II
    '\u0e36'   #  0xD6 -> THAI CHARACTER SARA UE
    '\u0e37'   #  0xD7 -> THAI CHARACTER SARA UEE
    '\u0e38'   #  0xD8 -> THAI CHARACTER SARA U
    '\u0e39'   #  0xD9 -> THAI CHARACTER SARA UU
    '\u0e3a'   #  0xDA -> THAI CHARACTER PHINTHU
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\u0e3f'   #  0xDF -> THAI CURRENCY SYMBOL BAHT
    '\u0e40'   #  0xE0 -> THAI CHARACTER SARA E
    '\u0e41'   #  0xE1 -> THAI CHARACTER SARA AE
    '\u0e42'   #  0xE2 -> THAI CHARACTER SARA O
    '\u0e43'   #  0xE3 -> THAI CHARACTER SARA AI MAIMUAN
    '\u0e44'   #  0xE4 -> THAI CHARACTER SARA AI MAIMALAI
    '\u0e45'   #  0xE5 -> THAI CHARACTER LAKKHANGYAO
    '\u0e46'   #  0xE6 -> THAI CHARACTER MAIYAMOK
    '\u0e47'   #  0xE7 -> THAI CHARACTER MAITAIKHU
    '\u0e48'   #  0xE8 -> THAI CHARACTER MAI EK
    '\u0e49'   #  0xE9 -> THAI CHARACTER MAI THO
    '\u0e4a'   #  0xEA -> THAI CHARACTER MAI TRI
    '\u0e4b'   #  0xEB -> THAI CHARACTER MAI CHATTAWA
    '\u0e4c'   #  0xEC -> THAI CHARACTER THANTHAKHAT
    '\u0e4d'   #  0xED -> THAI CHARACTER NIKHAHIT
    '\u0e4e'   #  0xEE -> THAI CHARACTER YAMAKKAN
    '\u0e4f'   #  0xEF -> THAI CHARACTER FONGMAN
    '\u0e50'   #  0xF0 -> THAI DIGIT ZERO
    '\u0e51'   #  0xF1 -> THAI DIGIT ONE
    '\u0e52'   #  0xF2 -> THAI DIGIT TWO
    '\u0e53'   #  0xF3 -> THAI DIGIT THREE
    '\u0e54'   #  0xF4 -> THAI DIGIT FOUR
    '\u0e55'   #  0xF5 -> THAI DIGIT FIVE
    '\u0e56'   #  0xF6 -> THAI DIGIT SIX
    '\u0e57'   #  0xF7 -> THAI DIGIT SEVEN
    '\u0e58'   #  0xF8 -> THAI DIGIT EIGHT
    '\u0e59'   #  0xF9 -> THAI DIGIT NINE
    '\u0e5a'   #  0xFA -> THAI CHARACTER ANGKHANKHU
    '\u0e5b'   #  0xFB -> THAI CHARACTER KHOMUT
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/iso2022_jp_ext.py000064400000002055151153537610011551 0ustar00#
# iso2022_jp_ext.py: Python Unicode Codec for ISO2022_JP_EXT
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#

import _codecs_iso2022, codecs
import _multibytecodec as mbc

codec = _codecs_iso2022.getcodec('iso2022_jp_ext')

class Codec(codecs.Codec):
    encode = codec.encode
    decode = codec.decode

class IncrementalEncoder(mbc.MultibyteIncrementalEncoder,
                         codecs.IncrementalEncoder):
    codec = codec

class IncrementalDecoder(mbc.MultibyteIncrementalDecoder,
                         codecs.IncrementalDecoder):
    codec = codec

class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader):
    codec = codec

class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
    codec = codec

def getregentry():
    return codecs.CodecInfo(
        name='iso2022_jp_ext',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/iso8859_8.py000064400000025434151153537610010465 0ustar00""" Python Character Mapping Codec iso8859_8 generated from 'MAPPINGS/ISO8859/8859-8.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='iso8859-8',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\x80'     #  0x80 -> <control>
    '\x81'     #  0x81 -> <control>
    '\x82'     #  0x82 -> <control>
    '\x83'     #  0x83 -> <control>
    '\x84'     #  0x84 -> <control>
    '\x85'     #  0x85 -> <control>
    '\x86'     #  0x86 -> <control>
    '\x87'     #  0x87 -> <control>
    '\x88'     #  0x88 -> <control>
    '\x89'     #  0x89 -> <control>
    '\x8a'     #  0x8A -> <control>
    '\x8b'     #  0x8B -> <control>
    '\x8c'     #  0x8C -> <control>
    '\x8d'     #  0x8D -> <control>
    '\x8e'     #  0x8E -> <control>
    '\x8f'     #  0x8F -> <control>
    '\x90'     #  0x90 -> <control>
    '\x91'     #  0x91 -> <control>
    '\x92'     #  0x92 -> <control>
    '\x93'     #  0x93 -> <control>
    '\x94'     #  0x94 -> <control>
    '\x95'     #  0x95 -> <control>
    '\x96'     #  0x96 -> <control>
    '\x97'     #  0x97 -> <control>
    '\x98'     #  0x98 -> <control>
    '\x99'     #  0x99 -> <control>
    '\x9a'     #  0x9A -> <control>
    '\x9b'     #  0x9B -> <control>
    '\x9c'     #  0x9C -> <control>
    '\x9d'     #  0x9D -> <control>
    '\x9e'     #  0x9E -> <control>
    '\x9f'     #  0x9F -> <control>
    '\xa0'     #  0xA0 -> NO-BREAK SPACE
    '\ufffe'
    '\xa2'     #  0xA2 -> CENT SIGN
    '\xa3'     #  0xA3 -> POUND SIGN
    '\xa4'     #  0xA4 -> CURRENCY SIGN
    '\xa5'     #  0xA5 -> YEN SIGN
    '\xa6'     #  0xA6 -> BROKEN BAR
    '\xa7'     #  0xA7 -> SECTION SIGN
    '\xa8'     #  0xA8 -> DIAERESIS
    '\xa9'     #  0xA9 -> COPYRIGHT SIGN
    '\xd7'     #  0xAA -> MULTIPLICATION SIGN
    '\xab'     #  0xAB -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xac'     #  0xAC -> NOT SIGN
    '\xad'     #  0xAD -> SOFT HYPHEN
    '\xae'     #  0xAE -> REGISTERED SIGN
    '\xaf'     #  0xAF -> MACRON
    '\xb0'     #  0xB0 -> DEGREE SIGN
    '\xb1'     #  0xB1 -> PLUS-MINUS SIGN
    '\xb2'     #  0xB2 -> SUPERSCRIPT TWO
    '\xb3'     #  0xB3 -> SUPERSCRIPT THREE
    '\xb4'     #  0xB4 -> ACUTE ACCENT
    '\xb5'     #  0xB5 -> MICRO SIGN
    '\xb6'     #  0xB6 -> PILCROW SIGN
    '\xb7'     #  0xB7 -> MIDDLE DOT
    '\xb8'     #  0xB8 -> CEDILLA
    '\xb9'     #  0xB9 -> SUPERSCRIPT ONE
    '\xf7'     #  0xBA -> DIVISION SIGN
    '\xbb'     #  0xBB -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbc'     #  0xBC -> VULGAR FRACTION ONE QUARTER
    '\xbd'     #  0xBD -> VULGAR FRACTION ONE HALF
    '\xbe'     #  0xBE -> VULGAR FRACTION THREE QUARTERS
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\u2017'   #  0xDF -> DOUBLE LOW LINE
    '\u05d0'   #  0xE0 -> HEBREW LETTER ALEF
    '\u05d1'   #  0xE1 -> HEBREW LETTER BET
    '\u05d2'   #  0xE2 -> HEBREW LETTER GIMEL
    '\u05d3'   #  0xE3 -> HEBREW LETTER DALET
    '\u05d4'   #  0xE4 -> HEBREW LETTER HE
    '\u05d5'   #  0xE5 -> HEBREW LETTER VAV
    '\u05d6'   #  0xE6 -> HEBREW LETTER ZAYIN
    '\u05d7'   #  0xE7 -> HEBREW LETTER HET
    '\u05d8'   #  0xE8 -> HEBREW LETTER TET
    '\u05d9'   #  0xE9 -> HEBREW LETTER YOD
    '\u05da'   #  0xEA -> HEBREW LETTER FINAL KAF
    '\u05db'   #  0xEB -> HEBREW LETTER KAF
    '\u05dc'   #  0xEC -> HEBREW LETTER LAMED
    '\u05dd'   #  0xED -> HEBREW LETTER FINAL MEM
    '\u05de'   #  0xEE -> HEBREW LETTER MEM
    '\u05df'   #  0xEF -> HEBREW LETTER FINAL NUN
    '\u05e0'   #  0xF0 -> HEBREW LETTER NUN
    '\u05e1'   #  0xF1 -> HEBREW LETTER SAMEKH
    '\u05e2'   #  0xF2 -> HEBREW LETTER AYIN
    '\u05e3'   #  0xF3 -> HEBREW LETTER FINAL PE
    '\u05e4'   #  0xF4 -> HEBREW LETTER PE
    '\u05e5'   #  0xF5 -> HEBREW LETTER FINAL TSADI
    '\u05e6'   #  0xF6 -> HEBREW LETTER TSADI
    '\u05e7'   #  0xF7 -> HEBREW LETTER QOF
    '\u05e8'   #  0xF8 -> HEBREW LETTER RESH
    '\u05e9'   #  0xF9 -> HEBREW LETTER SHIN
    '\u05ea'   #  0xFA -> HEBREW LETTER TAV
    '\ufffe'
    '\ufffe'
    '\u200e'   #  0xFD -> LEFT-TO-RIGHT MARK
    '\u200f'   #  0xFE -> RIGHT-TO-LEFT MARK
    '\ufffe'
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/undefined.py000064400000002423151153537610011040 0ustar00""" Python 'undefined' Codec

    This codec will always raise a ValueError exception when being
    used. It is intended for use by the site.py file to switch off
    automatic string to Unicode coercion.

Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

"""
import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        raise UnicodeError("undefined encoding")

    def decode(self,input,errors='strict'):
        raise UnicodeError("undefined encoding")

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        raise UnicodeError("undefined encoding")

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        raise UnicodeError("undefined encoding")

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='undefined',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamwriter=StreamWriter,
        streamreader=StreamReader,
    )
encodings/cp949.py000064400000001777151153537610007762 0ustar00#
# cp949.py: Python Unicode Codec for CP949
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#

import _codecs_kr, codecs
import _multibytecodec as mbc

codec = _codecs_kr.getcodec('cp949')

class Codec(codecs.Codec):
    encode = codec.encode
    decode = codec.decode

class IncrementalEncoder(mbc.MultibyteIncrementalEncoder,
                         codecs.IncrementalEncoder):
    codec = codec

class IncrementalDecoder(mbc.MultibyteIncrementalDecoder,
                         codecs.IncrementalDecoder):
    codec = codec

class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader):
    codec = codec

class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
    codec = codec

def getregentry():
    return codecs.CodecInfo(
        name='cp949',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/cp1253.py000064400000031446151153537610010023 0ustar00""" Python Character Mapping Codec cp1253 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1253.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp1253',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\u20ac'   #  0x80 -> EURO SIGN
    '\ufffe'   #  0x81 -> UNDEFINED
    '\u201a'   #  0x82 -> SINGLE LOW-9 QUOTATION MARK
    '\u0192'   #  0x83 -> LATIN SMALL LETTER F WITH HOOK
    '\u201e'   #  0x84 -> DOUBLE LOW-9 QUOTATION MARK
    '\u2026'   #  0x85 -> HORIZONTAL ELLIPSIS
    '\u2020'   #  0x86 -> DAGGER
    '\u2021'   #  0x87 -> DOUBLE DAGGER
    '\ufffe'   #  0x88 -> UNDEFINED
    '\u2030'   #  0x89 -> PER MILLE SIGN
    '\ufffe'   #  0x8A -> UNDEFINED
    '\u2039'   #  0x8B -> SINGLE LEFT-POINTING ANGLE QUOTATION MARK
    '\ufffe'   #  0x8C -> UNDEFINED
    '\ufffe'   #  0x8D -> UNDEFINED
    '\ufffe'   #  0x8E -> UNDEFINED
    '\ufffe'   #  0x8F -> UNDEFINED
    '\ufffe'   #  0x90 -> UNDEFINED
    '\u2018'   #  0x91 -> LEFT SINGLE QUOTATION MARK
    '\u2019'   #  0x92 -> RIGHT SINGLE QUOTATION MARK
    '\u201c'   #  0x93 -> LEFT DOUBLE QUOTATION MARK
    '\u201d'   #  0x94 -> RIGHT DOUBLE QUOTATION MARK
    '\u2022'   #  0x95 -> BULLET
    '\u2013'   #  0x96 -> EN DASH
    '\u2014'   #  0x97 -> EM DASH
    '\ufffe'   #  0x98 -> UNDEFINED
    '\u2122'   #  0x99 -> TRADE MARK SIGN
    '\ufffe'   #  0x9A -> UNDEFINED
    '\u203a'   #  0x9B -> SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
    '\ufffe'   #  0x9C -> UNDEFINED
    '\ufffe'   #  0x9D -> UNDEFINED
    '\ufffe'   #  0x9E -> UNDEFINED
    '\ufffe'   #  0x9F -> UNDEFINED
    '\xa0'     #  0xA0 -> NO-BREAK SPACE
    '\u0385'   #  0xA1 -> GREEK DIALYTIKA TONOS
    '\u0386'   #  0xA2 -> GREEK CAPITAL LETTER ALPHA WITH TONOS
    '\xa3'     #  0xA3 -> POUND SIGN
    '\xa4'     #  0xA4 -> CURRENCY SIGN
    '\xa5'     #  0xA5 -> YEN SIGN
    '\xa6'     #  0xA6 -> BROKEN BAR
    '\xa7'     #  0xA7 -> SECTION SIGN
    '\xa8'     #  0xA8 -> DIAERESIS
    '\xa9'     #  0xA9 -> COPYRIGHT SIGN
    '\ufffe'   #  0xAA -> UNDEFINED
    '\xab'     #  0xAB -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xac'     #  0xAC -> NOT SIGN
    '\xad'     #  0xAD -> SOFT HYPHEN
    '\xae'     #  0xAE -> REGISTERED SIGN
    '\u2015'   #  0xAF -> HORIZONTAL BAR
    '\xb0'     #  0xB0 -> DEGREE SIGN
    '\xb1'     #  0xB1 -> PLUS-MINUS SIGN
    '\xb2'     #  0xB2 -> SUPERSCRIPT TWO
    '\xb3'     #  0xB3 -> SUPERSCRIPT THREE
    '\u0384'   #  0xB4 -> GREEK TONOS
    '\xb5'     #  0xB5 -> MICRO SIGN
    '\xb6'     #  0xB6 -> PILCROW SIGN
    '\xb7'     #  0xB7 -> MIDDLE DOT
    '\u0388'   #  0xB8 -> GREEK CAPITAL LETTER EPSILON WITH TONOS
    '\u0389'   #  0xB9 -> GREEK CAPITAL LETTER ETA WITH TONOS
    '\u038a'   #  0xBA -> GREEK CAPITAL LETTER IOTA WITH TONOS
    '\xbb'     #  0xBB -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u038c'   #  0xBC -> GREEK CAPITAL LETTER OMICRON WITH TONOS
    '\xbd'     #  0xBD -> VULGAR FRACTION ONE HALF
    '\u038e'   #  0xBE -> GREEK CAPITAL LETTER UPSILON WITH TONOS
    '\u038f'   #  0xBF -> GREEK CAPITAL LETTER OMEGA WITH TONOS
    '\u0390'   #  0xC0 -> GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
    '\u0391'   #  0xC1 -> GREEK CAPITAL LETTER ALPHA
    '\u0392'   #  0xC2 -> GREEK CAPITAL LETTER BETA
    '\u0393'   #  0xC3 -> GREEK CAPITAL LETTER GAMMA
    '\u0394'   #  0xC4 -> GREEK CAPITAL LETTER DELTA
    '\u0395'   #  0xC5 -> GREEK CAPITAL LETTER EPSILON
    '\u0396'   #  0xC6 -> GREEK CAPITAL LETTER ZETA
    '\u0397'   #  0xC7 -> GREEK CAPITAL LETTER ETA
    '\u0398'   #  0xC8 -> GREEK CAPITAL LETTER THETA
    '\u0399'   #  0xC9 -> GREEK CAPITAL LETTER IOTA
    '\u039a'   #  0xCA -> GREEK CAPITAL LETTER KAPPA
    '\u039b'   #  0xCB -> GREEK CAPITAL LETTER LAMDA
    '\u039c'   #  0xCC -> GREEK CAPITAL LETTER MU
    '\u039d'   #  0xCD -> GREEK CAPITAL LETTER NU
    '\u039e'   #  0xCE -> GREEK CAPITAL LETTER XI
    '\u039f'   #  0xCF -> GREEK CAPITAL LETTER OMICRON
    '\u03a0'   #  0xD0 -> GREEK CAPITAL LETTER PI
    '\u03a1'   #  0xD1 -> GREEK CAPITAL LETTER RHO
    '\ufffe'   #  0xD2 -> UNDEFINED
    '\u03a3'   #  0xD3 -> GREEK CAPITAL LETTER SIGMA
    '\u03a4'   #  0xD4 -> GREEK CAPITAL LETTER TAU
    '\u03a5'   #  0xD5 -> GREEK CAPITAL LETTER UPSILON
    '\u03a6'   #  0xD6 -> GREEK CAPITAL LETTER PHI
    '\u03a7'   #  0xD7 -> GREEK CAPITAL LETTER CHI
    '\u03a8'   #  0xD8 -> GREEK CAPITAL LETTER PSI
    '\u03a9'   #  0xD9 -> GREEK CAPITAL LETTER OMEGA
    '\u03aa'   #  0xDA -> GREEK CAPITAL LETTER IOTA WITH DIALYTIKA
    '\u03ab'   #  0xDB -> GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA
    '\u03ac'   #  0xDC -> GREEK SMALL LETTER ALPHA WITH TONOS
    '\u03ad'   #  0xDD -> GREEK SMALL LETTER EPSILON WITH TONOS
    '\u03ae'   #  0xDE -> GREEK SMALL LETTER ETA WITH TONOS
    '\u03af'   #  0xDF -> GREEK SMALL LETTER IOTA WITH TONOS
    '\u03b0'   #  0xE0 -> GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
    '\u03b1'   #  0xE1 -> GREEK SMALL LETTER ALPHA
    '\u03b2'   #  0xE2 -> GREEK SMALL LETTER BETA
    '\u03b3'   #  0xE3 -> GREEK SMALL LETTER GAMMA
    '\u03b4'   #  0xE4 -> GREEK SMALL LETTER DELTA
    '\u03b5'   #  0xE5 -> GREEK SMALL LETTER EPSILON
    '\u03b6'   #  0xE6 -> GREEK SMALL LETTER ZETA
    '\u03b7'   #  0xE7 -> GREEK SMALL LETTER ETA
    '\u03b8'   #  0xE8 -> GREEK SMALL LETTER THETA
    '\u03b9'   #  0xE9 -> GREEK SMALL LETTER IOTA
    '\u03ba'   #  0xEA -> GREEK SMALL LETTER KAPPA
    '\u03bb'   #  0xEB -> GREEK SMALL LETTER LAMDA
    '\u03bc'   #  0xEC -> GREEK SMALL LETTER MU
    '\u03bd'   #  0xED -> GREEK SMALL LETTER NU
    '\u03be'   #  0xEE -> GREEK SMALL LETTER XI
    '\u03bf'   #  0xEF -> GREEK SMALL LETTER OMICRON
    '\u03c0'   #  0xF0 -> GREEK SMALL LETTER PI
    '\u03c1'   #  0xF1 -> GREEK SMALL LETTER RHO
    '\u03c2'   #  0xF2 -> GREEK SMALL LETTER FINAL SIGMA
    '\u03c3'   #  0xF3 -> GREEK SMALL LETTER SIGMA
    '\u03c4'   #  0xF4 -> GREEK SMALL LETTER TAU
    '\u03c5'   #  0xF5 -> GREEK SMALL LETTER UPSILON
    '\u03c6'   #  0xF6 -> GREEK SMALL LETTER PHI
    '\u03c7'   #  0xF7 -> GREEK SMALL LETTER CHI
    '\u03c8'   #  0xF8 -> GREEK SMALL LETTER PSI
    '\u03c9'   #  0xF9 -> GREEK SMALL LETTER OMEGA
    '\u03ca'   #  0xFA -> GREEK SMALL LETTER IOTA WITH DIALYTIKA
    '\u03cb'   #  0xFB -> GREEK SMALL LETTER UPSILON WITH DIALYTIKA
    '\u03cc'   #  0xFC -> GREEK SMALL LETTER OMICRON WITH TONOS
    '\u03cd'   #  0xFD -> GREEK SMALL LETTER UPSILON WITH TONOS
    '\u03ce'   #  0xFE -> GREEK SMALL LETTER OMEGA WITH TONOS
    '\ufffe'   #  0xFF -> UNDEFINED
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/shift_jis_2004.py000064400000002043151153537610011524 0ustar00#
# shift_jis_2004.py: Python Unicode Codec for SHIFT_JIS_2004
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#

import _codecs_jp, codecs
import _multibytecodec as mbc

codec = _codecs_jp.getcodec('shift_jis_2004')

class Codec(codecs.Codec):
    encode = codec.encode
    decode = codec.decode

class IncrementalEncoder(mbc.MultibyteIncrementalEncoder,
                         codecs.IncrementalEncoder):
    codec = codec

class IncrementalDecoder(mbc.MultibyteIncrementalDecoder,
                         codecs.IncrementalDecoder):
    codec = codec

class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader):
    codec = codec

class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
    codec = codec

def getregentry():
    return codecs.CodecInfo(
        name='shift_jis_2004',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/iso2022_kr.py000064400000002035151153537610010672 0ustar00#
# iso2022_kr.py: Python Unicode Codec for ISO2022_KR
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#

import _codecs_iso2022, codecs
import _multibytecodec as mbc

codec = _codecs_iso2022.getcodec('iso2022_kr')

class Codec(codecs.Codec):
    encode = codec.encode
    decode = codec.decode

class IncrementalEncoder(mbc.MultibyteIncrementalEncoder,
                         codecs.IncrementalEncoder):
    codec = codec

class IncrementalDecoder(mbc.MultibyteIncrementalDecoder,
                         codecs.IncrementalDecoder):
    codec = codec

class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader):
    codec = codec

class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
    codec = codec

def getregentry():
    return codecs.CodecInfo(
        name='iso2022_kr',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/mac_iceland.py000064400000032272151153537610011323 0ustar00""" Python Character Mapping Codec mac_iceland generated from 'MAPPINGS/VENDORS/APPLE/ICELAND.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='mac-iceland',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> CONTROL CHARACTER
    '\x01'     #  0x01 -> CONTROL CHARACTER
    '\x02'     #  0x02 -> CONTROL CHARACTER
    '\x03'     #  0x03 -> CONTROL CHARACTER
    '\x04'     #  0x04 -> CONTROL CHARACTER
    '\x05'     #  0x05 -> CONTROL CHARACTER
    '\x06'     #  0x06 -> CONTROL CHARACTER
    '\x07'     #  0x07 -> CONTROL CHARACTER
    '\x08'     #  0x08 -> CONTROL CHARACTER
    '\t'       #  0x09 -> CONTROL CHARACTER
    '\n'       #  0x0A -> CONTROL CHARACTER
    '\x0b'     #  0x0B -> CONTROL CHARACTER
    '\x0c'     #  0x0C -> CONTROL CHARACTER
    '\r'       #  0x0D -> CONTROL CHARACTER
    '\x0e'     #  0x0E -> CONTROL CHARACTER
    '\x0f'     #  0x0F -> CONTROL CHARACTER
    '\x10'     #  0x10 -> CONTROL CHARACTER
    '\x11'     #  0x11 -> CONTROL CHARACTER
    '\x12'     #  0x12 -> CONTROL CHARACTER
    '\x13'     #  0x13 -> CONTROL CHARACTER
    '\x14'     #  0x14 -> CONTROL CHARACTER
    '\x15'     #  0x15 -> CONTROL CHARACTER
    '\x16'     #  0x16 -> CONTROL CHARACTER
    '\x17'     #  0x17 -> CONTROL CHARACTER
    '\x18'     #  0x18 -> CONTROL CHARACTER
    '\x19'     #  0x19 -> CONTROL CHARACTER
    '\x1a'     #  0x1A -> CONTROL CHARACTER
    '\x1b'     #  0x1B -> CONTROL CHARACTER
    '\x1c'     #  0x1C -> CONTROL CHARACTER
    '\x1d'     #  0x1D -> CONTROL CHARACTER
    '\x1e'     #  0x1E -> CONTROL CHARACTER
    '\x1f'     #  0x1F -> CONTROL CHARACTER
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> CONTROL CHARACTER
    '\xc4'     #  0x80 -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\xc5'     #  0x81 -> LATIN CAPITAL LETTER A WITH RING ABOVE
    '\xc7'     #  0x82 -> LATIN CAPITAL LETTER C WITH CEDILLA
    '\xc9'     #  0x83 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\xd1'     #  0x84 -> LATIN CAPITAL LETTER N WITH TILDE
    '\xd6'     #  0x85 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xdc'     #  0x86 -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\xe1'     #  0x87 -> LATIN SMALL LETTER A WITH ACUTE
    '\xe0'     #  0x88 -> LATIN SMALL LETTER A WITH GRAVE
    '\xe2'     #  0x89 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\xe4'     #  0x8A -> LATIN SMALL LETTER A WITH DIAERESIS
    '\xe3'     #  0x8B -> LATIN SMALL LETTER A WITH TILDE
    '\xe5'     #  0x8C -> LATIN SMALL LETTER A WITH RING ABOVE
    '\xe7'     #  0x8D -> LATIN SMALL LETTER C WITH CEDILLA
    '\xe9'     #  0x8E -> LATIN SMALL LETTER E WITH ACUTE
    '\xe8'     #  0x8F -> LATIN SMALL LETTER E WITH GRAVE
    '\xea'     #  0x90 -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xeb'     #  0x91 -> LATIN SMALL LETTER E WITH DIAERESIS
    '\xed'     #  0x92 -> LATIN SMALL LETTER I WITH ACUTE
    '\xec'     #  0x93 -> LATIN SMALL LETTER I WITH GRAVE
    '\xee'     #  0x94 -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\xef'     #  0x95 -> LATIN SMALL LETTER I WITH DIAERESIS
    '\xf1'     #  0x96 -> LATIN SMALL LETTER N WITH TILDE
    '\xf3'     #  0x97 -> LATIN SMALL LETTER O WITH ACUTE
    '\xf2'     #  0x98 -> LATIN SMALL LETTER O WITH GRAVE
    '\xf4'     #  0x99 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xf6'     #  0x9A -> LATIN SMALL LETTER O WITH DIAERESIS
    '\xf5'     #  0x9B -> LATIN SMALL LETTER O WITH TILDE
    '\xfa'     #  0x9C -> LATIN SMALL LETTER U WITH ACUTE
    '\xf9'     #  0x9D -> LATIN SMALL LETTER U WITH GRAVE
    '\xfb'     #  0x9E -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\xfc'     #  0x9F -> LATIN SMALL LETTER U WITH DIAERESIS
    '\xdd'     #  0xA0 -> LATIN CAPITAL LETTER Y WITH ACUTE
    '\xb0'     #  0xA1 -> DEGREE SIGN
    '\xa2'     #  0xA2 -> CENT SIGN
    '\xa3'     #  0xA3 -> POUND SIGN
    '\xa7'     #  0xA4 -> SECTION SIGN
    '\u2022'   #  0xA5 -> BULLET
    '\xb6'     #  0xA6 -> PILCROW SIGN
    '\xdf'     #  0xA7 -> LATIN SMALL LETTER SHARP S
    '\xae'     #  0xA8 -> REGISTERED SIGN
    '\xa9'     #  0xA9 -> COPYRIGHT SIGN
    '\u2122'   #  0xAA -> TRADE MARK SIGN
    '\xb4'     #  0xAB -> ACUTE ACCENT
    '\xa8'     #  0xAC -> DIAERESIS
    '\u2260'   #  0xAD -> NOT EQUAL TO
    '\xc6'     #  0xAE -> LATIN CAPITAL LETTER AE
    '\xd8'     #  0xAF -> LATIN CAPITAL LETTER O WITH STROKE
    '\u221e'   #  0xB0 -> INFINITY
    '\xb1'     #  0xB1 -> PLUS-MINUS SIGN
    '\u2264'   #  0xB2 -> LESS-THAN OR EQUAL TO
    '\u2265'   #  0xB3 -> GREATER-THAN OR EQUAL TO
    '\xa5'     #  0xB4 -> YEN SIGN
    '\xb5'     #  0xB5 -> MICRO SIGN
    '\u2202'   #  0xB6 -> PARTIAL DIFFERENTIAL
    '\u2211'   #  0xB7 -> N-ARY SUMMATION
    '\u220f'   #  0xB8 -> N-ARY PRODUCT
    '\u03c0'   #  0xB9 -> GREEK SMALL LETTER PI
    '\u222b'   #  0xBA -> INTEGRAL
    '\xaa'     #  0xBB -> FEMININE ORDINAL INDICATOR
    '\xba'     #  0xBC -> MASCULINE ORDINAL INDICATOR
    '\u03a9'   #  0xBD -> GREEK CAPITAL LETTER OMEGA
    '\xe6'     #  0xBE -> LATIN SMALL LETTER AE
    '\xf8'     #  0xBF -> LATIN SMALL LETTER O WITH STROKE
    '\xbf'     #  0xC0 -> INVERTED QUESTION MARK
    '\xa1'     #  0xC1 -> INVERTED EXCLAMATION MARK
    '\xac'     #  0xC2 -> NOT SIGN
    '\u221a'   #  0xC3 -> SQUARE ROOT
    '\u0192'   #  0xC4 -> LATIN SMALL LETTER F WITH HOOK
    '\u2248'   #  0xC5 -> ALMOST EQUAL TO
    '\u2206'   #  0xC6 -> INCREMENT
    '\xab'     #  0xC7 -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbb'     #  0xC8 -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u2026'   #  0xC9 -> HORIZONTAL ELLIPSIS
    '\xa0'     #  0xCA -> NO-BREAK SPACE
    '\xc0'     #  0xCB -> LATIN CAPITAL LETTER A WITH GRAVE
    '\xc3'     #  0xCC -> LATIN CAPITAL LETTER A WITH TILDE
    '\xd5'     #  0xCD -> LATIN CAPITAL LETTER O WITH TILDE
    '\u0152'   #  0xCE -> LATIN CAPITAL LIGATURE OE
    '\u0153'   #  0xCF -> LATIN SMALL LIGATURE OE
    '\u2013'   #  0xD0 -> EN DASH
    '\u2014'   #  0xD1 -> EM DASH
    '\u201c'   #  0xD2 -> LEFT DOUBLE QUOTATION MARK
    '\u201d'   #  0xD3 -> RIGHT DOUBLE QUOTATION MARK
    '\u2018'   #  0xD4 -> LEFT SINGLE QUOTATION MARK
    '\u2019'   #  0xD5 -> RIGHT SINGLE QUOTATION MARK
    '\xf7'     #  0xD6 -> DIVISION SIGN
    '\u25ca'   #  0xD7 -> LOZENGE
    '\xff'     #  0xD8 -> LATIN SMALL LETTER Y WITH DIAERESIS
    '\u0178'   #  0xD9 -> LATIN CAPITAL LETTER Y WITH DIAERESIS
    '\u2044'   #  0xDA -> FRACTION SLASH
    '\u20ac'   #  0xDB -> EURO SIGN
    '\xd0'     #  0xDC -> LATIN CAPITAL LETTER ETH
    '\xf0'     #  0xDD -> LATIN SMALL LETTER ETH
    '\xde'     #  0xDE -> LATIN CAPITAL LETTER THORN
    '\xfe'     #  0xDF -> LATIN SMALL LETTER THORN
    '\xfd'     #  0xE0 -> LATIN SMALL LETTER Y WITH ACUTE
    '\xb7'     #  0xE1 -> MIDDLE DOT
    '\u201a'   #  0xE2 -> SINGLE LOW-9 QUOTATION MARK
    '\u201e'   #  0xE3 -> DOUBLE LOW-9 QUOTATION MARK
    '\u2030'   #  0xE4 -> PER MILLE SIGN
    '\xc2'     #  0xE5 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    '\xca'     #  0xE6 -> LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    '\xc1'     #  0xE7 -> LATIN CAPITAL LETTER A WITH ACUTE
    '\xcb'     #  0xE8 -> LATIN CAPITAL LETTER E WITH DIAERESIS
    '\xc8'     #  0xE9 -> LATIN CAPITAL LETTER E WITH GRAVE
    '\xcd'     #  0xEA -> LATIN CAPITAL LETTER I WITH ACUTE
    '\xce'     #  0xEB -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    '\xcf'     #  0xEC -> LATIN CAPITAL LETTER I WITH DIAERESIS
    '\xcc'     #  0xED -> LATIN CAPITAL LETTER I WITH GRAVE
    '\xd3'     #  0xEE -> LATIN CAPITAL LETTER O WITH ACUTE
    '\xd4'     #  0xEF -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    '\uf8ff'   #  0xF0 -> Apple logo
    '\xd2'     #  0xF1 -> LATIN CAPITAL LETTER O WITH GRAVE
    '\xda'     #  0xF2 -> LATIN CAPITAL LETTER U WITH ACUTE
    '\xdb'     #  0xF3 -> LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    '\xd9'     #  0xF4 -> LATIN CAPITAL LETTER U WITH GRAVE
    '\u0131'   #  0xF5 -> LATIN SMALL LETTER DOTLESS I
    '\u02c6'   #  0xF6 -> MODIFIER LETTER CIRCUMFLEX ACCENT
    '\u02dc'   #  0xF7 -> SMALL TILDE
    '\xaf'     #  0xF8 -> MACRON
    '\u02d8'   #  0xF9 -> BREVE
    '\u02d9'   #  0xFA -> DOT ABOVE
    '\u02da'   #  0xFB -> RING ABOVE
    '\xb8'     #  0xFC -> CEDILLA
    '\u02dd'   #  0xFD -> DOUBLE ACUTE ACCENT
    '\u02db'   #  0xFE -> OGONEK
    '\u02c7'   #  0xFF -> CARON
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/cp850.py000064400000102471151153537610007742 0ustar00""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP850.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_map)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_map)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp850',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )

### Decoding Map

decoding_map = codecs.make_identity_dict(range(256))
decoding_map.update({
    0x0080: 0x00c7,     #  LATIN CAPITAL LETTER C WITH CEDILLA
    0x0081: 0x00fc,     #  LATIN SMALL LETTER U WITH DIAERESIS
    0x0082: 0x00e9,     #  LATIN SMALL LETTER E WITH ACUTE
    0x0083: 0x00e2,     #  LATIN SMALL LETTER A WITH CIRCUMFLEX
    0x0084: 0x00e4,     #  LATIN SMALL LETTER A WITH DIAERESIS
    0x0085: 0x00e0,     #  LATIN SMALL LETTER A WITH GRAVE
    0x0086: 0x00e5,     #  LATIN SMALL LETTER A WITH RING ABOVE
    0x0087: 0x00e7,     #  LATIN SMALL LETTER C WITH CEDILLA
    0x0088: 0x00ea,     #  LATIN SMALL LETTER E WITH CIRCUMFLEX
    0x0089: 0x00eb,     #  LATIN SMALL LETTER E WITH DIAERESIS
    0x008a: 0x00e8,     #  LATIN SMALL LETTER E WITH GRAVE
    0x008b: 0x00ef,     #  LATIN SMALL LETTER I WITH DIAERESIS
    0x008c: 0x00ee,     #  LATIN SMALL LETTER I WITH CIRCUMFLEX
    0x008d: 0x00ec,     #  LATIN SMALL LETTER I WITH GRAVE
    0x008e: 0x00c4,     #  LATIN CAPITAL LETTER A WITH DIAERESIS
    0x008f: 0x00c5,     #  LATIN CAPITAL LETTER A WITH RING ABOVE
    0x0090: 0x00c9,     #  LATIN CAPITAL LETTER E WITH ACUTE
    0x0091: 0x00e6,     #  LATIN SMALL LIGATURE AE
    0x0092: 0x00c6,     #  LATIN CAPITAL LIGATURE AE
    0x0093: 0x00f4,     #  LATIN SMALL LETTER O WITH CIRCUMFLEX
    0x0094: 0x00f6,     #  LATIN SMALL LETTER O WITH DIAERESIS
    0x0095: 0x00f2,     #  LATIN SMALL LETTER O WITH GRAVE
    0x0096: 0x00fb,     #  LATIN SMALL LETTER U WITH CIRCUMFLEX
    0x0097: 0x00f9,     #  LATIN SMALL LETTER U WITH GRAVE
    0x0098: 0x00ff,     #  LATIN SMALL LETTER Y WITH DIAERESIS
    0x0099: 0x00d6,     #  LATIN CAPITAL LETTER O WITH DIAERESIS
    0x009a: 0x00dc,     #  LATIN CAPITAL LETTER U WITH DIAERESIS
    0x009b: 0x00f8,     #  LATIN SMALL LETTER O WITH STROKE
    0x009c: 0x00a3,     #  POUND SIGN
    0x009d: 0x00d8,     #  LATIN CAPITAL LETTER O WITH STROKE
    0x009e: 0x00d7,     #  MULTIPLICATION SIGN
    0x009f: 0x0192,     #  LATIN SMALL LETTER F WITH HOOK
    0x00a0: 0x00e1,     #  LATIN SMALL LETTER A WITH ACUTE
    0x00a1: 0x00ed,     #  LATIN SMALL LETTER I WITH ACUTE
    0x00a2: 0x00f3,     #  LATIN SMALL LETTER O WITH ACUTE
    0x00a3: 0x00fa,     #  LATIN SMALL LETTER U WITH ACUTE
    0x00a4: 0x00f1,     #  LATIN SMALL LETTER N WITH TILDE
    0x00a5: 0x00d1,     #  LATIN CAPITAL LETTER N WITH TILDE
    0x00a6: 0x00aa,     #  FEMININE ORDINAL INDICATOR
    0x00a7: 0x00ba,     #  MASCULINE ORDINAL INDICATOR
    0x00a8: 0x00bf,     #  INVERTED QUESTION MARK
    0x00a9: 0x00ae,     #  REGISTERED SIGN
    0x00aa: 0x00ac,     #  NOT SIGN
    0x00ab: 0x00bd,     #  VULGAR FRACTION ONE HALF
    0x00ac: 0x00bc,     #  VULGAR FRACTION ONE QUARTER
    0x00ad: 0x00a1,     #  INVERTED EXCLAMATION MARK
    0x00ae: 0x00ab,     #  LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00af: 0x00bb,     #  RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00b0: 0x2591,     #  LIGHT SHADE
    0x00b1: 0x2592,     #  MEDIUM SHADE
    0x00b2: 0x2593,     #  DARK SHADE
    0x00b3: 0x2502,     #  BOX DRAWINGS LIGHT VERTICAL
    0x00b4: 0x2524,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
    0x00b5: 0x00c1,     #  LATIN CAPITAL LETTER A WITH ACUTE
    0x00b6: 0x00c2,     #  LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    0x00b7: 0x00c0,     #  LATIN CAPITAL LETTER A WITH GRAVE
    0x00b8: 0x00a9,     #  COPYRIGHT SIGN
    0x00b9: 0x2563,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    0x00ba: 0x2551,     #  BOX DRAWINGS DOUBLE VERTICAL
    0x00bb: 0x2557,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
    0x00bc: 0x255d,     #  BOX DRAWINGS DOUBLE UP AND LEFT
    0x00bd: 0x00a2,     #  CENT SIGN
    0x00be: 0x00a5,     #  YEN SIGN
    0x00bf: 0x2510,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
    0x00c0: 0x2514,     #  BOX DRAWINGS LIGHT UP AND RIGHT
    0x00c1: 0x2534,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
    0x00c2: 0x252c,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    0x00c3: 0x251c,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    0x00c4: 0x2500,     #  BOX DRAWINGS LIGHT HORIZONTAL
    0x00c5: 0x253c,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    0x00c6: 0x00e3,     #  LATIN SMALL LETTER A WITH TILDE
    0x00c7: 0x00c3,     #  LATIN CAPITAL LETTER A WITH TILDE
    0x00c8: 0x255a,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
    0x00c9: 0x2554,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
    0x00ca: 0x2569,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    0x00cb: 0x2566,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    0x00cc: 0x2560,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    0x00cd: 0x2550,     #  BOX DRAWINGS DOUBLE HORIZONTAL
    0x00ce: 0x256c,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    0x00cf: 0x00a4,     #  CURRENCY SIGN
    0x00d0: 0x00f0,     #  LATIN SMALL LETTER ETH
    0x00d1: 0x00d0,     #  LATIN CAPITAL LETTER ETH
    0x00d2: 0x00ca,     #  LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    0x00d3: 0x00cb,     #  LATIN CAPITAL LETTER E WITH DIAERESIS
    0x00d4: 0x00c8,     #  LATIN CAPITAL LETTER E WITH GRAVE
    0x00d5: 0x0131,     #  LATIN SMALL LETTER DOTLESS I
    0x00d6: 0x00cd,     #  LATIN CAPITAL LETTER I WITH ACUTE
    0x00d7: 0x00ce,     #  LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    0x00d8: 0x00cf,     #  LATIN CAPITAL LETTER I WITH DIAERESIS
    0x00d9: 0x2518,     #  BOX DRAWINGS LIGHT UP AND LEFT
    0x00da: 0x250c,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
    0x00db: 0x2588,     #  FULL BLOCK
    0x00dc: 0x2584,     #  LOWER HALF BLOCK
    0x00dd: 0x00a6,     #  BROKEN BAR
    0x00de: 0x00cc,     #  LATIN CAPITAL LETTER I WITH GRAVE
    0x00df: 0x2580,     #  UPPER HALF BLOCK
    0x00e0: 0x00d3,     #  LATIN CAPITAL LETTER O WITH ACUTE
    0x00e1: 0x00df,     #  LATIN SMALL LETTER SHARP S
    0x00e2: 0x00d4,     #  LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    0x00e3: 0x00d2,     #  LATIN CAPITAL LETTER O WITH GRAVE
    0x00e4: 0x00f5,     #  LATIN SMALL LETTER O WITH TILDE
    0x00e5: 0x00d5,     #  LATIN CAPITAL LETTER O WITH TILDE
    0x00e6: 0x00b5,     #  MICRO SIGN
    0x00e7: 0x00fe,     #  LATIN SMALL LETTER THORN
    0x00e8: 0x00de,     #  LATIN CAPITAL LETTER THORN
    0x00e9: 0x00da,     #  LATIN CAPITAL LETTER U WITH ACUTE
    0x00ea: 0x00db,     #  LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    0x00eb: 0x00d9,     #  LATIN CAPITAL LETTER U WITH GRAVE
    0x00ec: 0x00fd,     #  LATIN SMALL LETTER Y WITH ACUTE
    0x00ed: 0x00dd,     #  LATIN CAPITAL LETTER Y WITH ACUTE
    0x00ee: 0x00af,     #  MACRON
    0x00ef: 0x00b4,     #  ACUTE ACCENT
    0x00f0: 0x00ad,     #  SOFT HYPHEN
    0x00f1: 0x00b1,     #  PLUS-MINUS SIGN
    0x00f2: 0x2017,     #  DOUBLE LOW LINE
    0x00f3: 0x00be,     #  VULGAR FRACTION THREE QUARTERS
    0x00f4: 0x00b6,     #  PILCROW SIGN
    0x00f5: 0x00a7,     #  SECTION SIGN
    0x00f6: 0x00f7,     #  DIVISION SIGN
    0x00f7: 0x00b8,     #  CEDILLA
    0x00f8: 0x00b0,     #  DEGREE SIGN
    0x00f9: 0x00a8,     #  DIAERESIS
    0x00fa: 0x00b7,     #  MIDDLE DOT
    0x00fb: 0x00b9,     #  SUPERSCRIPT ONE
    0x00fc: 0x00b3,     #  SUPERSCRIPT THREE
    0x00fd: 0x00b2,     #  SUPERSCRIPT TWO
    0x00fe: 0x25a0,     #  BLACK SQUARE
    0x00ff: 0x00a0,     #  NO-BREAK SPACE
})

### Decoding Table

decoding_table = (
    '\x00'     #  0x0000 -> NULL
    '\x01'     #  0x0001 -> START OF HEADING
    '\x02'     #  0x0002 -> START OF TEXT
    '\x03'     #  0x0003 -> END OF TEXT
    '\x04'     #  0x0004 -> END OF TRANSMISSION
    '\x05'     #  0x0005 -> ENQUIRY
    '\x06'     #  0x0006 -> ACKNOWLEDGE
    '\x07'     #  0x0007 -> BELL
    '\x08'     #  0x0008 -> BACKSPACE
    '\t'       #  0x0009 -> HORIZONTAL TABULATION
    '\n'       #  0x000a -> LINE FEED
    '\x0b'     #  0x000b -> VERTICAL TABULATION
    '\x0c'     #  0x000c -> FORM FEED
    '\r'       #  0x000d -> CARRIAGE RETURN
    '\x0e'     #  0x000e -> SHIFT OUT
    '\x0f'     #  0x000f -> SHIFT IN
    '\x10'     #  0x0010 -> DATA LINK ESCAPE
    '\x11'     #  0x0011 -> DEVICE CONTROL ONE
    '\x12'     #  0x0012 -> DEVICE CONTROL TWO
    '\x13'     #  0x0013 -> DEVICE CONTROL THREE
    '\x14'     #  0x0014 -> DEVICE CONTROL FOUR
    '\x15'     #  0x0015 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x0016 -> SYNCHRONOUS IDLE
    '\x17'     #  0x0017 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x0018 -> CANCEL
    '\x19'     #  0x0019 -> END OF MEDIUM
    '\x1a'     #  0x001a -> SUBSTITUTE
    '\x1b'     #  0x001b -> ESCAPE
    '\x1c'     #  0x001c -> FILE SEPARATOR
    '\x1d'     #  0x001d -> GROUP SEPARATOR
    '\x1e'     #  0x001e -> RECORD SEPARATOR
    '\x1f'     #  0x001f -> UNIT SEPARATOR
    ' '        #  0x0020 -> SPACE
    '!'        #  0x0021 -> EXCLAMATION MARK
    '"'        #  0x0022 -> QUOTATION MARK
    '#'        #  0x0023 -> NUMBER SIGN
    '$'        #  0x0024 -> DOLLAR SIGN
    '%'        #  0x0025 -> PERCENT SIGN
    '&'        #  0x0026 -> AMPERSAND
    "'"        #  0x0027 -> APOSTROPHE
    '('        #  0x0028 -> LEFT PARENTHESIS
    ')'        #  0x0029 -> RIGHT PARENTHESIS
    '*'        #  0x002a -> ASTERISK
    '+'        #  0x002b -> PLUS SIGN
    ','        #  0x002c -> COMMA
    '-'        #  0x002d -> HYPHEN-MINUS
    '.'        #  0x002e -> FULL STOP
    '/'        #  0x002f -> SOLIDUS
    '0'        #  0x0030 -> DIGIT ZERO
    '1'        #  0x0031 -> DIGIT ONE
    '2'        #  0x0032 -> DIGIT TWO
    '3'        #  0x0033 -> DIGIT THREE
    '4'        #  0x0034 -> DIGIT FOUR
    '5'        #  0x0035 -> DIGIT FIVE
    '6'        #  0x0036 -> DIGIT SIX
    '7'        #  0x0037 -> DIGIT SEVEN
    '8'        #  0x0038 -> DIGIT EIGHT
    '9'        #  0x0039 -> DIGIT NINE
    ':'        #  0x003a -> COLON
    ';'        #  0x003b -> SEMICOLON
    '<'        #  0x003c -> LESS-THAN SIGN
    '='        #  0x003d -> EQUALS SIGN
    '>'        #  0x003e -> GREATER-THAN SIGN
    '?'        #  0x003f -> QUESTION MARK
    '@'        #  0x0040 -> COMMERCIAL AT
    'A'        #  0x0041 -> LATIN CAPITAL LETTER A
    'B'        #  0x0042 -> LATIN CAPITAL LETTER B
    'C'        #  0x0043 -> LATIN CAPITAL LETTER C
    'D'        #  0x0044 -> LATIN CAPITAL LETTER D
    'E'        #  0x0045 -> LATIN CAPITAL LETTER E
    'F'        #  0x0046 -> LATIN CAPITAL LETTER F
    'G'        #  0x0047 -> LATIN CAPITAL LETTER G
    'H'        #  0x0048 -> LATIN CAPITAL LETTER H
    'I'        #  0x0049 -> LATIN CAPITAL LETTER I
    'J'        #  0x004a -> LATIN CAPITAL LETTER J
    'K'        #  0x004b -> LATIN CAPITAL LETTER K
    'L'        #  0x004c -> LATIN CAPITAL LETTER L
    'M'        #  0x004d -> LATIN CAPITAL LETTER M
    'N'        #  0x004e -> LATIN CAPITAL LETTER N
    'O'        #  0x004f -> LATIN CAPITAL LETTER O
    'P'        #  0x0050 -> LATIN CAPITAL LETTER P
    'Q'        #  0x0051 -> LATIN CAPITAL LETTER Q
    'R'        #  0x0052 -> LATIN CAPITAL LETTER R
    'S'        #  0x0053 -> LATIN CAPITAL LETTER S
    'T'        #  0x0054 -> LATIN CAPITAL LETTER T
    'U'        #  0x0055 -> LATIN CAPITAL LETTER U
    'V'        #  0x0056 -> LATIN CAPITAL LETTER V
    'W'        #  0x0057 -> LATIN CAPITAL LETTER W
    'X'        #  0x0058 -> LATIN CAPITAL LETTER X
    'Y'        #  0x0059 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x005a -> LATIN CAPITAL LETTER Z
    '['        #  0x005b -> LEFT SQUARE BRACKET
    '\\'       #  0x005c -> REVERSE SOLIDUS
    ']'        #  0x005d -> RIGHT SQUARE BRACKET
    '^'        #  0x005e -> CIRCUMFLEX ACCENT
    '_'        #  0x005f -> LOW LINE
    '`'        #  0x0060 -> GRAVE ACCENT
    'a'        #  0x0061 -> LATIN SMALL LETTER A
    'b'        #  0x0062 -> LATIN SMALL LETTER B
    'c'        #  0x0063 -> LATIN SMALL LETTER C
    'd'        #  0x0064 -> LATIN SMALL LETTER D
    'e'        #  0x0065 -> LATIN SMALL LETTER E
    'f'        #  0x0066 -> LATIN SMALL LETTER F
    'g'        #  0x0067 -> LATIN SMALL LETTER G
    'h'        #  0x0068 -> LATIN SMALL LETTER H
    'i'        #  0x0069 -> LATIN SMALL LETTER I
    'j'        #  0x006a -> LATIN SMALL LETTER J
    'k'        #  0x006b -> LATIN SMALL LETTER K
    'l'        #  0x006c -> LATIN SMALL LETTER L
    'm'        #  0x006d -> LATIN SMALL LETTER M
    'n'        #  0x006e -> LATIN SMALL LETTER N
    'o'        #  0x006f -> LATIN SMALL LETTER O
    'p'        #  0x0070 -> LATIN SMALL LETTER P
    'q'        #  0x0071 -> LATIN SMALL LETTER Q
    'r'        #  0x0072 -> LATIN SMALL LETTER R
    's'        #  0x0073 -> LATIN SMALL LETTER S
    't'        #  0x0074 -> LATIN SMALL LETTER T
    'u'        #  0x0075 -> LATIN SMALL LETTER U
    'v'        #  0x0076 -> LATIN SMALL LETTER V
    'w'        #  0x0077 -> LATIN SMALL LETTER W
    'x'        #  0x0078 -> LATIN SMALL LETTER X
    'y'        #  0x0079 -> LATIN SMALL LETTER Y
    'z'        #  0x007a -> LATIN SMALL LETTER Z
    '{'        #  0x007b -> LEFT CURLY BRACKET
    '|'        #  0x007c -> VERTICAL LINE
    '}'        #  0x007d -> RIGHT CURLY BRACKET
    '~'        #  0x007e -> TILDE
    '\x7f'     #  0x007f -> DELETE
    '\xc7'     #  0x0080 -> LATIN CAPITAL LETTER C WITH CEDILLA
    '\xfc'     #  0x0081 -> LATIN SMALL LETTER U WITH DIAERESIS
    '\xe9'     #  0x0082 -> LATIN SMALL LETTER E WITH ACUTE
    '\xe2'     #  0x0083 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\xe4'     #  0x0084 -> LATIN SMALL LETTER A WITH DIAERESIS
    '\xe0'     #  0x0085 -> LATIN SMALL LETTER A WITH GRAVE
    '\xe5'     #  0x0086 -> LATIN SMALL LETTER A WITH RING ABOVE
    '\xe7'     #  0x0087 -> LATIN SMALL LETTER C WITH CEDILLA
    '\xea'     #  0x0088 -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xeb'     #  0x0089 -> LATIN SMALL LETTER E WITH DIAERESIS
    '\xe8'     #  0x008a -> LATIN SMALL LETTER E WITH GRAVE
    '\xef'     #  0x008b -> LATIN SMALL LETTER I WITH DIAERESIS
    '\xee'     #  0x008c -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\xec'     #  0x008d -> LATIN SMALL LETTER I WITH GRAVE
    '\xc4'     #  0x008e -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\xc5'     #  0x008f -> LATIN CAPITAL LETTER A WITH RING ABOVE
    '\xc9'     #  0x0090 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\xe6'     #  0x0091 -> LATIN SMALL LIGATURE AE
    '\xc6'     #  0x0092 -> LATIN CAPITAL LIGATURE AE
    '\xf4'     #  0x0093 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xf6'     #  0x0094 -> LATIN SMALL LETTER O WITH DIAERESIS
    '\xf2'     #  0x0095 -> LATIN SMALL LETTER O WITH GRAVE
    '\xfb'     #  0x0096 -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\xf9'     #  0x0097 -> LATIN SMALL LETTER U WITH GRAVE
    '\xff'     #  0x0098 -> LATIN SMALL LETTER Y WITH DIAERESIS
    '\xd6'     #  0x0099 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xdc'     #  0x009a -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\xf8'     #  0x009b -> LATIN SMALL LETTER O WITH STROKE
    '\xa3'     #  0x009c -> POUND SIGN
    '\xd8'     #  0x009d -> LATIN CAPITAL LETTER O WITH STROKE
    '\xd7'     #  0x009e -> MULTIPLICATION SIGN
    '\u0192'   #  0x009f -> LATIN SMALL LETTER F WITH HOOK
    '\xe1'     #  0x00a0 -> LATIN SMALL LETTER A WITH ACUTE
    '\xed'     #  0x00a1 -> LATIN SMALL LETTER I WITH ACUTE
    '\xf3'     #  0x00a2 -> LATIN SMALL LETTER O WITH ACUTE
    '\xfa'     #  0x00a3 -> LATIN SMALL LETTER U WITH ACUTE
    '\xf1'     #  0x00a4 -> LATIN SMALL LETTER N WITH TILDE
    '\xd1'     #  0x00a5 -> LATIN CAPITAL LETTER N WITH TILDE
    '\xaa'     #  0x00a6 -> FEMININE ORDINAL INDICATOR
    '\xba'     #  0x00a7 -> MASCULINE ORDINAL INDICATOR
    '\xbf'     #  0x00a8 -> INVERTED QUESTION MARK
    '\xae'     #  0x00a9 -> REGISTERED SIGN
    '\xac'     #  0x00aa -> NOT SIGN
    '\xbd'     #  0x00ab -> VULGAR FRACTION ONE HALF
    '\xbc'     #  0x00ac -> VULGAR FRACTION ONE QUARTER
    '\xa1'     #  0x00ad -> INVERTED EXCLAMATION MARK
    '\xab'     #  0x00ae -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbb'     #  0x00af -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u2591'   #  0x00b0 -> LIGHT SHADE
    '\u2592'   #  0x00b1 -> MEDIUM SHADE
    '\u2593'   #  0x00b2 -> DARK SHADE
    '\u2502'   #  0x00b3 -> BOX DRAWINGS LIGHT VERTICAL
    '\u2524'   #  0x00b4 -> BOX DRAWINGS LIGHT VERTICAL AND LEFT
    '\xc1'     #  0x00b5 -> LATIN CAPITAL LETTER A WITH ACUTE
    '\xc2'     #  0x00b6 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    '\xc0'     #  0x00b7 -> LATIN CAPITAL LETTER A WITH GRAVE
    '\xa9'     #  0x00b8 -> COPYRIGHT SIGN
    '\u2563'   #  0x00b9 -> BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    '\u2551'   #  0x00ba -> BOX DRAWINGS DOUBLE VERTICAL
    '\u2557'   #  0x00bb -> BOX DRAWINGS DOUBLE DOWN AND LEFT
    '\u255d'   #  0x00bc -> BOX DRAWINGS DOUBLE UP AND LEFT
    '\xa2'     #  0x00bd -> CENT SIGN
    '\xa5'     #  0x00be -> YEN SIGN
    '\u2510'   #  0x00bf -> BOX DRAWINGS LIGHT DOWN AND LEFT
    '\u2514'   #  0x00c0 -> BOX DRAWINGS LIGHT UP AND RIGHT
    '\u2534'   #  0x00c1 -> BOX DRAWINGS LIGHT UP AND HORIZONTAL
    '\u252c'   #  0x00c2 -> BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    '\u251c'   #  0x00c3 -> BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    '\u2500'   #  0x00c4 -> BOX DRAWINGS LIGHT HORIZONTAL
    '\u253c'   #  0x00c5 -> BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    '\xe3'     #  0x00c6 -> LATIN SMALL LETTER A WITH TILDE
    '\xc3'     #  0x00c7 -> LATIN CAPITAL LETTER A WITH TILDE
    '\u255a'   #  0x00c8 -> BOX DRAWINGS DOUBLE UP AND RIGHT
    '\u2554'   #  0x00c9 -> BOX DRAWINGS DOUBLE DOWN AND RIGHT
    '\u2569'   #  0x00ca -> BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    '\u2566'   #  0x00cb -> BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    '\u2560'   #  0x00cc -> BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    '\u2550'   #  0x00cd -> BOX DRAWINGS DOUBLE HORIZONTAL
    '\u256c'   #  0x00ce -> BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    '\xa4'     #  0x00cf -> CURRENCY SIGN
    '\xf0'     #  0x00d0 -> LATIN SMALL LETTER ETH
    '\xd0'     #  0x00d1 -> LATIN CAPITAL LETTER ETH
    '\xca'     #  0x00d2 -> LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    '\xcb'     #  0x00d3 -> LATIN CAPITAL LETTER E WITH DIAERESIS
    '\xc8'     #  0x00d4 -> LATIN CAPITAL LETTER E WITH GRAVE
    '\u0131'   #  0x00d5 -> LATIN SMALL LETTER DOTLESS I
    '\xcd'     #  0x00d6 -> LATIN CAPITAL LETTER I WITH ACUTE
    '\xce'     #  0x00d7 -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    '\xcf'     #  0x00d8 -> LATIN CAPITAL LETTER I WITH DIAERESIS
    '\u2518'   #  0x00d9 -> BOX DRAWINGS LIGHT UP AND LEFT
    '\u250c'   #  0x00da -> BOX DRAWINGS LIGHT DOWN AND RIGHT
    '\u2588'   #  0x00db -> FULL BLOCK
    '\u2584'   #  0x00dc -> LOWER HALF BLOCK
    '\xa6'     #  0x00dd -> BROKEN BAR
    '\xcc'     #  0x00de -> LATIN CAPITAL LETTER I WITH GRAVE
    '\u2580'   #  0x00df -> UPPER HALF BLOCK
    '\xd3'     #  0x00e0 -> LATIN CAPITAL LETTER O WITH ACUTE
    '\xdf'     #  0x00e1 -> LATIN SMALL LETTER SHARP S
    '\xd4'     #  0x00e2 -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    '\xd2'     #  0x00e3 -> LATIN CAPITAL LETTER O WITH GRAVE
    '\xf5'     #  0x00e4 -> LATIN SMALL LETTER O WITH TILDE
    '\xd5'     #  0x00e5 -> LATIN CAPITAL LETTER O WITH TILDE
    '\xb5'     #  0x00e6 -> MICRO SIGN
    '\xfe'     #  0x00e7 -> LATIN SMALL LETTER THORN
    '\xde'     #  0x00e8 -> LATIN CAPITAL LETTER THORN
    '\xda'     #  0x00e9 -> LATIN CAPITAL LETTER U WITH ACUTE
    '\xdb'     #  0x00ea -> LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    '\xd9'     #  0x00eb -> LATIN CAPITAL LETTER U WITH GRAVE
    '\xfd'     #  0x00ec -> LATIN SMALL LETTER Y WITH ACUTE
    '\xdd'     #  0x00ed -> LATIN CAPITAL LETTER Y WITH ACUTE
    '\xaf'     #  0x00ee -> MACRON
    '\xb4'     #  0x00ef -> ACUTE ACCENT
    '\xad'     #  0x00f0 -> SOFT HYPHEN
    '\xb1'     #  0x00f1 -> PLUS-MINUS SIGN
    '\u2017'   #  0x00f2 -> DOUBLE LOW LINE
    '\xbe'     #  0x00f3 -> VULGAR FRACTION THREE QUARTERS
    '\xb6'     #  0x00f4 -> PILCROW SIGN
    '\xa7'     #  0x00f5 -> SECTION SIGN
    '\xf7'     #  0x00f6 -> DIVISION SIGN
    '\xb8'     #  0x00f7 -> CEDILLA
    '\xb0'     #  0x00f8 -> DEGREE SIGN
    '\xa8'     #  0x00f9 -> DIAERESIS
    '\xb7'     #  0x00fa -> MIDDLE DOT
    '\xb9'     #  0x00fb -> SUPERSCRIPT ONE
    '\xb3'     #  0x00fc -> SUPERSCRIPT THREE
    '\xb2'     #  0x00fd -> SUPERSCRIPT TWO
    '\u25a0'   #  0x00fe -> BLACK SQUARE
    '\xa0'     #  0x00ff -> NO-BREAK SPACE
)

### Encoding Map

encoding_map = {
    0x0000: 0x0000,     #  NULL
    0x0001: 0x0001,     #  START OF HEADING
    0x0002: 0x0002,     #  START OF TEXT
    0x0003: 0x0003,     #  END OF TEXT
    0x0004: 0x0004,     #  END OF TRANSMISSION
    0x0005: 0x0005,     #  ENQUIRY
    0x0006: 0x0006,     #  ACKNOWLEDGE
    0x0007: 0x0007,     #  BELL
    0x0008: 0x0008,     #  BACKSPACE
    0x0009: 0x0009,     #  HORIZONTAL TABULATION
    0x000a: 0x000a,     #  LINE FEED
    0x000b: 0x000b,     #  VERTICAL TABULATION
    0x000c: 0x000c,     #  FORM FEED
    0x000d: 0x000d,     #  CARRIAGE RETURN
    0x000e: 0x000e,     #  SHIFT OUT
    0x000f: 0x000f,     #  SHIFT IN
    0x0010: 0x0010,     #  DATA LINK ESCAPE
    0x0011: 0x0011,     #  DEVICE CONTROL ONE
    0x0012: 0x0012,     #  DEVICE CONTROL TWO
    0x0013: 0x0013,     #  DEVICE CONTROL THREE
    0x0014: 0x0014,     #  DEVICE CONTROL FOUR
    0x0015: 0x0015,     #  NEGATIVE ACKNOWLEDGE
    0x0016: 0x0016,     #  SYNCHRONOUS IDLE
    0x0017: 0x0017,     #  END OF TRANSMISSION BLOCK
    0x0018: 0x0018,     #  CANCEL
    0x0019: 0x0019,     #  END OF MEDIUM
    0x001a: 0x001a,     #  SUBSTITUTE
    0x001b: 0x001b,     #  ESCAPE
    0x001c: 0x001c,     #  FILE SEPARATOR
    0x001d: 0x001d,     #  GROUP SEPARATOR
    0x001e: 0x001e,     #  RECORD SEPARATOR
    0x001f: 0x001f,     #  UNIT SEPARATOR
    0x0020: 0x0020,     #  SPACE
    0x0021: 0x0021,     #  EXCLAMATION MARK
    0x0022: 0x0022,     #  QUOTATION MARK
    0x0023: 0x0023,     #  NUMBER SIGN
    0x0024: 0x0024,     #  DOLLAR SIGN
    0x0025: 0x0025,     #  PERCENT SIGN
    0x0026: 0x0026,     #  AMPERSAND
    0x0027: 0x0027,     #  APOSTROPHE
    0x0028: 0x0028,     #  LEFT PARENTHESIS
    0x0029: 0x0029,     #  RIGHT PARENTHESIS
    0x002a: 0x002a,     #  ASTERISK
    0x002b: 0x002b,     #  PLUS SIGN
    0x002c: 0x002c,     #  COMMA
    0x002d: 0x002d,     #  HYPHEN-MINUS
    0x002e: 0x002e,     #  FULL STOP
    0x002f: 0x002f,     #  SOLIDUS
    0x0030: 0x0030,     #  DIGIT ZERO
    0x0031: 0x0031,     #  DIGIT ONE
    0x0032: 0x0032,     #  DIGIT TWO
    0x0033: 0x0033,     #  DIGIT THREE
    0x0034: 0x0034,     #  DIGIT FOUR
    0x0035: 0x0035,     #  DIGIT FIVE
    0x0036: 0x0036,     #  DIGIT SIX
    0x0037: 0x0037,     #  DIGIT SEVEN
    0x0038: 0x0038,     #  DIGIT EIGHT
    0x0039: 0x0039,     #  DIGIT NINE
    0x003a: 0x003a,     #  COLON
    0x003b: 0x003b,     #  SEMICOLON
    0x003c: 0x003c,     #  LESS-THAN SIGN
    0x003d: 0x003d,     #  EQUALS SIGN
    0x003e: 0x003e,     #  GREATER-THAN SIGN
    0x003f: 0x003f,     #  QUESTION MARK
    0x0040: 0x0040,     #  COMMERCIAL AT
    0x0041: 0x0041,     #  LATIN CAPITAL LETTER A
    0x0042: 0x0042,     #  LATIN CAPITAL LETTER B
    0x0043: 0x0043,     #  LATIN CAPITAL LETTER C
    0x0044: 0x0044,     #  LATIN CAPITAL LETTER D
    0x0045: 0x0045,     #  LATIN CAPITAL LETTER E
    0x0046: 0x0046,     #  LATIN CAPITAL LETTER F
    0x0047: 0x0047,     #  LATIN CAPITAL LETTER G
    0x0048: 0x0048,     #  LATIN CAPITAL LETTER H
    0x0049: 0x0049,     #  LATIN CAPITAL LETTER I
    0x004a: 0x004a,     #  LATIN CAPITAL LETTER J
    0x004b: 0x004b,     #  LATIN CAPITAL LETTER K
    0x004c: 0x004c,     #  LATIN CAPITAL LETTER L
    0x004d: 0x004d,     #  LATIN CAPITAL LETTER M
    0x004e: 0x004e,     #  LATIN CAPITAL LETTER N
    0x004f: 0x004f,     #  LATIN CAPITAL LETTER O
    0x0050: 0x0050,     #  LATIN CAPITAL LETTER P
    0x0051: 0x0051,     #  LATIN CAPITAL LETTER Q
    0x0052: 0x0052,     #  LATIN CAPITAL LETTER R
    0x0053: 0x0053,     #  LATIN CAPITAL LETTER S
    0x0054: 0x0054,     #  LATIN CAPITAL LETTER T
    0x0055: 0x0055,     #  LATIN CAPITAL LETTER U
    0x0056: 0x0056,     #  LATIN CAPITAL LETTER V
    0x0057: 0x0057,     #  LATIN CAPITAL LETTER W
    0x0058: 0x0058,     #  LATIN CAPITAL LETTER X
    0x0059: 0x0059,     #  LATIN CAPITAL LETTER Y
    0x005a: 0x005a,     #  LATIN CAPITAL LETTER Z
    0x005b: 0x005b,     #  LEFT SQUARE BRACKET
    0x005c: 0x005c,     #  REVERSE SOLIDUS
    0x005d: 0x005d,     #  RIGHT SQUARE BRACKET
    0x005e: 0x005e,     #  CIRCUMFLEX ACCENT
    0x005f: 0x005f,     #  LOW LINE
    0x0060: 0x0060,     #  GRAVE ACCENT
    0x0061: 0x0061,     #  LATIN SMALL LETTER A
    0x0062: 0x0062,     #  LATIN SMALL LETTER B
    0x0063: 0x0063,     #  LATIN SMALL LETTER C
    0x0064: 0x0064,     #  LATIN SMALL LETTER D
    0x0065: 0x0065,     #  LATIN SMALL LETTER E
    0x0066: 0x0066,     #  LATIN SMALL LETTER F
    0x0067: 0x0067,     #  LATIN SMALL LETTER G
    0x0068: 0x0068,     #  LATIN SMALL LETTER H
    0x0069: 0x0069,     #  LATIN SMALL LETTER I
    0x006a: 0x006a,     #  LATIN SMALL LETTER J
    0x006b: 0x006b,     #  LATIN SMALL LETTER K
    0x006c: 0x006c,     #  LATIN SMALL LETTER L
    0x006d: 0x006d,     #  LATIN SMALL LETTER M
    0x006e: 0x006e,     #  LATIN SMALL LETTER N
    0x006f: 0x006f,     #  LATIN SMALL LETTER O
    0x0070: 0x0070,     #  LATIN SMALL LETTER P
    0x0071: 0x0071,     #  LATIN SMALL LETTER Q
    0x0072: 0x0072,     #  LATIN SMALL LETTER R
    0x0073: 0x0073,     #  LATIN SMALL LETTER S
    0x0074: 0x0074,     #  LATIN SMALL LETTER T
    0x0075: 0x0075,     #  LATIN SMALL LETTER U
    0x0076: 0x0076,     #  LATIN SMALL LETTER V
    0x0077: 0x0077,     #  LATIN SMALL LETTER W
    0x0078: 0x0078,     #  LATIN SMALL LETTER X
    0x0079: 0x0079,     #  LATIN SMALL LETTER Y
    0x007a: 0x007a,     #  LATIN SMALL LETTER Z
    0x007b: 0x007b,     #  LEFT CURLY BRACKET
    0x007c: 0x007c,     #  VERTICAL LINE
    0x007d: 0x007d,     #  RIGHT CURLY BRACKET
    0x007e: 0x007e,     #  TILDE
    0x007f: 0x007f,     #  DELETE
    0x00a0: 0x00ff,     #  NO-BREAK SPACE
    0x00a1: 0x00ad,     #  INVERTED EXCLAMATION MARK
    0x00a2: 0x00bd,     #  CENT SIGN
    0x00a3: 0x009c,     #  POUND SIGN
    0x00a4: 0x00cf,     #  CURRENCY SIGN
    0x00a5: 0x00be,     #  YEN SIGN
    0x00a6: 0x00dd,     #  BROKEN BAR
    0x00a7: 0x00f5,     #  SECTION SIGN
    0x00a8: 0x00f9,     #  DIAERESIS
    0x00a9: 0x00b8,     #  COPYRIGHT SIGN
    0x00aa: 0x00a6,     #  FEMININE ORDINAL INDICATOR
    0x00ab: 0x00ae,     #  LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00ac: 0x00aa,     #  NOT SIGN
    0x00ad: 0x00f0,     #  SOFT HYPHEN
    0x00ae: 0x00a9,     #  REGISTERED SIGN
    0x00af: 0x00ee,     #  MACRON
    0x00b0: 0x00f8,     #  DEGREE SIGN
    0x00b1: 0x00f1,     #  PLUS-MINUS SIGN
    0x00b2: 0x00fd,     #  SUPERSCRIPT TWO
    0x00b3: 0x00fc,     #  SUPERSCRIPT THREE
    0x00b4: 0x00ef,     #  ACUTE ACCENT
    0x00b5: 0x00e6,     #  MICRO SIGN
    0x00b6: 0x00f4,     #  PILCROW SIGN
    0x00b7: 0x00fa,     #  MIDDLE DOT
    0x00b8: 0x00f7,     #  CEDILLA
    0x00b9: 0x00fb,     #  SUPERSCRIPT ONE
    0x00ba: 0x00a7,     #  MASCULINE ORDINAL INDICATOR
    0x00bb: 0x00af,     #  RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00bc: 0x00ac,     #  VULGAR FRACTION ONE QUARTER
    0x00bd: 0x00ab,     #  VULGAR FRACTION ONE HALF
    0x00be: 0x00f3,     #  VULGAR FRACTION THREE QUARTERS
    0x00bf: 0x00a8,     #  INVERTED QUESTION MARK
    0x00c0: 0x00b7,     #  LATIN CAPITAL LETTER A WITH GRAVE
    0x00c1: 0x00b5,     #  LATIN CAPITAL LETTER A WITH ACUTE
    0x00c2: 0x00b6,     #  LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    0x00c3: 0x00c7,     #  LATIN CAPITAL LETTER A WITH TILDE
    0x00c4: 0x008e,     #  LATIN CAPITAL LETTER A WITH DIAERESIS
    0x00c5: 0x008f,     #  LATIN CAPITAL LETTER A WITH RING ABOVE
    0x00c6: 0x0092,     #  LATIN CAPITAL LIGATURE AE
    0x00c7: 0x0080,     #  LATIN CAPITAL LETTER C WITH CEDILLA
    0x00c8: 0x00d4,     #  LATIN CAPITAL LETTER E WITH GRAVE
    0x00c9: 0x0090,     #  LATIN CAPITAL LETTER E WITH ACUTE
    0x00ca: 0x00d2,     #  LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    0x00cb: 0x00d3,     #  LATIN CAPITAL LETTER E WITH DIAERESIS
    0x00cc: 0x00de,     #  LATIN CAPITAL LETTER I WITH GRAVE
    0x00cd: 0x00d6,     #  LATIN CAPITAL LETTER I WITH ACUTE
    0x00ce: 0x00d7,     #  LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    0x00cf: 0x00d8,     #  LATIN CAPITAL LETTER I WITH DIAERESIS
    0x00d0: 0x00d1,     #  LATIN CAPITAL LETTER ETH
    0x00d1: 0x00a5,     #  LATIN CAPITAL LETTER N WITH TILDE
    0x00d2: 0x00e3,     #  LATIN CAPITAL LETTER O WITH GRAVE
    0x00d3: 0x00e0,     #  LATIN CAPITAL LETTER O WITH ACUTE
    0x00d4: 0x00e2,     #  LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    0x00d5: 0x00e5,     #  LATIN CAPITAL LETTER O WITH TILDE
    0x00d6: 0x0099,     #  LATIN CAPITAL LETTER O WITH DIAERESIS
    0x00d7: 0x009e,     #  MULTIPLICATION SIGN
    0x00d8: 0x009d,     #  LATIN CAPITAL LETTER O WITH STROKE
    0x00d9: 0x00eb,     #  LATIN CAPITAL LETTER U WITH GRAVE
    0x00da: 0x00e9,     #  LATIN CAPITAL LETTER U WITH ACUTE
    0x00db: 0x00ea,     #  LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    0x00dc: 0x009a,     #  LATIN CAPITAL LETTER U WITH DIAERESIS
    0x00dd: 0x00ed,     #  LATIN CAPITAL LETTER Y WITH ACUTE
    0x00de: 0x00e8,     #  LATIN CAPITAL LETTER THORN
    0x00df: 0x00e1,     #  LATIN SMALL LETTER SHARP S
    0x00e0: 0x0085,     #  LATIN SMALL LETTER A WITH GRAVE
    0x00e1: 0x00a0,     #  LATIN SMALL LETTER A WITH ACUTE
    0x00e2: 0x0083,     #  LATIN SMALL LETTER A WITH CIRCUMFLEX
    0x00e3: 0x00c6,     #  LATIN SMALL LETTER A WITH TILDE
    0x00e4: 0x0084,     #  LATIN SMALL LETTER A WITH DIAERESIS
    0x00e5: 0x0086,     #  LATIN SMALL LETTER A WITH RING ABOVE
    0x00e6: 0x0091,     #  LATIN SMALL LIGATURE AE
    0x00e7: 0x0087,     #  LATIN SMALL LETTER C WITH CEDILLA
    0x00e8: 0x008a,     #  LATIN SMALL LETTER E WITH GRAVE
    0x00e9: 0x0082,     #  LATIN SMALL LETTER E WITH ACUTE
    0x00ea: 0x0088,     #  LATIN SMALL LETTER E WITH CIRCUMFLEX
    0x00eb: 0x0089,     #  LATIN SMALL LETTER E WITH DIAERESIS
    0x00ec: 0x008d,     #  LATIN SMALL LETTER I WITH GRAVE
    0x00ed: 0x00a1,     #  LATIN SMALL LETTER I WITH ACUTE
    0x00ee: 0x008c,     #  LATIN SMALL LETTER I WITH CIRCUMFLEX
    0x00ef: 0x008b,     #  LATIN SMALL LETTER I WITH DIAERESIS
    0x00f0: 0x00d0,     #  LATIN SMALL LETTER ETH
    0x00f1: 0x00a4,     #  LATIN SMALL LETTER N WITH TILDE
    0x00f2: 0x0095,     #  LATIN SMALL LETTER O WITH GRAVE
    0x00f3: 0x00a2,     #  LATIN SMALL LETTER O WITH ACUTE
    0x00f4: 0x0093,     #  LATIN SMALL LETTER O WITH CIRCUMFLEX
    0x00f5: 0x00e4,     #  LATIN SMALL LETTER O WITH TILDE
    0x00f6: 0x0094,     #  LATIN SMALL LETTER O WITH DIAERESIS
    0x00f7: 0x00f6,     #  DIVISION SIGN
    0x00f8: 0x009b,     #  LATIN SMALL LETTER O WITH STROKE
    0x00f9: 0x0097,     #  LATIN SMALL LETTER U WITH GRAVE
    0x00fa: 0x00a3,     #  LATIN SMALL LETTER U WITH ACUTE
    0x00fb: 0x0096,     #  LATIN SMALL LETTER U WITH CIRCUMFLEX
    0x00fc: 0x0081,     #  LATIN SMALL LETTER U WITH DIAERESIS
    0x00fd: 0x00ec,     #  LATIN SMALL LETTER Y WITH ACUTE
    0x00fe: 0x00e7,     #  LATIN SMALL LETTER THORN
    0x00ff: 0x0098,     #  LATIN SMALL LETTER Y WITH DIAERESIS
    0x0131: 0x00d5,     #  LATIN SMALL LETTER DOTLESS I
    0x0192: 0x009f,     #  LATIN SMALL LETTER F WITH HOOK
    0x2017: 0x00f2,     #  DOUBLE LOW LINE
    0x2500: 0x00c4,     #  BOX DRAWINGS LIGHT HORIZONTAL
    0x2502: 0x00b3,     #  BOX DRAWINGS LIGHT VERTICAL
    0x250c: 0x00da,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
    0x2510: 0x00bf,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
    0x2514: 0x00c0,     #  BOX DRAWINGS LIGHT UP AND RIGHT
    0x2518: 0x00d9,     #  BOX DRAWINGS LIGHT UP AND LEFT
    0x251c: 0x00c3,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    0x2524: 0x00b4,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
    0x252c: 0x00c2,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    0x2534: 0x00c1,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
    0x253c: 0x00c5,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    0x2550: 0x00cd,     #  BOX DRAWINGS DOUBLE HORIZONTAL
    0x2551: 0x00ba,     #  BOX DRAWINGS DOUBLE VERTICAL
    0x2554: 0x00c9,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
    0x2557: 0x00bb,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
    0x255a: 0x00c8,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
    0x255d: 0x00bc,     #  BOX DRAWINGS DOUBLE UP AND LEFT
    0x2560: 0x00cc,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    0x2563: 0x00b9,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    0x2566: 0x00cb,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    0x2569: 0x00ca,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    0x256c: 0x00ce,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    0x2580: 0x00df,     #  UPPER HALF BLOCK
    0x2584: 0x00dc,     #  LOWER HALF BLOCK
    0x2588: 0x00db,     #  FULL BLOCK
    0x2591: 0x00b0,     #  LIGHT SHADE
    0x2592: 0x00b1,     #  MEDIUM SHADE
    0x2593: 0x00b2,     #  DARK SHADE
    0x25a0: 0x00fe,     #  BLACK SQUARE
}
encodings/iso8859_4.py000064400000032100151153537610010445 0ustar00""" Python Character Mapping Codec iso8859_4 generated from 'MAPPINGS/ISO8859/8859-4.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='iso8859-4',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\x80'     #  0x80 -> <control>
    '\x81'     #  0x81 -> <control>
    '\x82'     #  0x82 -> <control>
    '\x83'     #  0x83 -> <control>
    '\x84'     #  0x84 -> <control>
    '\x85'     #  0x85 -> <control>
    '\x86'     #  0x86 -> <control>
    '\x87'     #  0x87 -> <control>
    '\x88'     #  0x88 -> <control>
    '\x89'     #  0x89 -> <control>
    '\x8a'     #  0x8A -> <control>
    '\x8b'     #  0x8B -> <control>
    '\x8c'     #  0x8C -> <control>
    '\x8d'     #  0x8D -> <control>
    '\x8e'     #  0x8E -> <control>
    '\x8f'     #  0x8F -> <control>
    '\x90'     #  0x90 -> <control>
    '\x91'     #  0x91 -> <control>
    '\x92'     #  0x92 -> <control>
    '\x93'     #  0x93 -> <control>
    '\x94'     #  0x94 -> <control>
    '\x95'     #  0x95 -> <control>
    '\x96'     #  0x96 -> <control>
    '\x97'     #  0x97 -> <control>
    '\x98'     #  0x98 -> <control>
    '\x99'     #  0x99 -> <control>
    '\x9a'     #  0x9A -> <control>
    '\x9b'     #  0x9B -> <control>
    '\x9c'     #  0x9C -> <control>
    '\x9d'     #  0x9D -> <control>
    '\x9e'     #  0x9E -> <control>
    '\x9f'     #  0x9F -> <control>
    '\xa0'     #  0xA0 -> NO-BREAK SPACE
    '\u0104'   #  0xA1 -> LATIN CAPITAL LETTER A WITH OGONEK
    '\u0138'   #  0xA2 -> LATIN SMALL LETTER KRA
    '\u0156'   #  0xA3 -> LATIN CAPITAL LETTER R WITH CEDILLA
    '\xa4'     #  0xA4 -> CURRENCY SIGN
    '\u0128'   #  0xA5 -> LATIN CAPITAL LETTER I WITH TILDE
    '\u013b'   #  0xA6 -> LATIN CAPITAL LETTER L WITH CEDILLA
    '\xa7'     #  0xA7 -> SECTION SIGN
    '\xa8'     #  0xA8 -> DIAERESIS
    '\u0160'   #  0xA9 -> LATIN CAPITAL LETTER S WITH CARON
    '\u0112'   #  0xAA -> LATIN CAPITAL LETTER E WITH MACRON
    '\u0122'   #  0xAB -> LATIN CAPITAL LETTER G WITH CEDILLA
    '\u0166'   #  0xAC -> LATIN CAPITAL LETTER T WITH STROKE
    '\xad'     #  0xAD -> SOFT HYPHEN
    '\u017d'   #  0xAE -> LATIN CAPITAL LETTER Z WITH CARON
    '\xaf'     #  0xAF -> MACRON
    '\xb0'     #  0xB0 -> DEGREE SIGN
    '\u0105'   #  0xB1 -> LATIN SMALL LETTER A WITH OGONEK
    '\u02db'   #  0xB2 -> OGONEK
    '\u0157'   #  0xB3 -> LATIN SMALL LETTER R WITH CEDILLA
    '\xb4'     #  0xB4 -> ACUTE ACCENT
    '\u0129'   #  0xB5 -> LATIN SMALL LETTER I WITH TILDE
    '\u013c'   #  0xB6 -> LATIN SMALL LETTER L WITH CEDILLA
    '\u02c7'   #  0xB7 -> CARON
    '\xb8'     #  0xB8 -> CEDILLA
    '\u0161'   #  0xB9 -> LATIN SMALL LETTER S WITH CARON
    '\u0113'   #  0xBA -> LATIN SMALL LETTER E WITH MACRON
    '\u0123'   #  0xBB -> LATIN SMALL LETTER G WITH CEDILLA
    '\u0167'   #  0xBC -> LATIN SMALL LETTER T WITH STROKE
    '\u014a'   #  0xBD -> LATIN CAPITAL LETTER ENG
    '\u017e'   #  0xBE -> LATIN SMALL LETTER Z WITH CARON
    '\u014b'   #  0xBF -> LATIN SMALL LETTER ENG
    '\u0100'   #  0xC0 -> LATIN CAPITAL LETTER A WITH MACRON
    '\xc1'     #  0xC1 -> LATIN CAPITAL LETTER A WITH ACUTE
    '\xc2'     #  0xC2 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    '\xc3'     #  0xC3 -> LATIN CAPITAL LETTER A WITH TILDE
    '\xc4'     #  0xC4 -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\xc5'     #  0xC5 -> LATIN CAPITAL LETTER A WITH RING ABOVE
    '\xc6'     #  0xC6 -> LATIN CAPITAL LETTER AE
    '\u012e'   #  0xC7 -> LATIN CAPITAL LETTER I WITH OGONEK
    '\u010c'   #  0xC8 -> LATIN CAPITAL LETTER C WITH CARON
    '\xc9'     #  0xC9 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\u0118'   #  0xCA -> LATIN CAPITAL LETTER E WITH OGONEK
    '\xcb'     #  0xCB -> LATIN CAPITAL LETTER E WITH DIAERESIS
    '\u0116'   #  0xCC -> LATIN CAPITAL LETTER E WITH DOT ABOVE
    '\xcd'     #  0xCD -> LATIN CAPITAL LETTER I WITH ACUTE
    '\xce'     #  0xCE -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    '\u012a'   #  0xCF -> LATIN CAPITAL LETTER I WITH MACRON
    '\u0110'   #  0xD0 -> LATIN CAPITAL LETTER D WITH STROKE
    '\u0145'   #  0xD1 -> LATIN CAPITAL LETTER N WITH CEDILLA
    '\u014c'   #  0xD2 -> LATIN CAPITAL LETTER O WITH MACRON
    '\u0136'   #  0xD3 -> LATIN CAPITAL LETTER K WITH CEDILLA
    '\xd4'     #  0xD4 -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    '\xd5'     #  0xD5 -> LATIN CAPITAL LETTER O WITH TILDE
    '\xd6'     #  0xD6 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xd7'     #  0xD7 -> MULTIPLICATION SIGN
    '\xd8'     #  0xD8 -> LATIN CAPITAL LETTER O WITH STROKE
    '\u0172'   #  0xD9 -> LATIN CAPITAL LETTER U WITH OGONEK
    '\xda'     #  0xDA -> LATIN CAPITAL LETTER U WITH ACUTE
    '\xdb'     #  0xDB -> LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    '\xdc'     #  0xDC -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\u0168'   #  0xDD -> LATIN CAPITAL LETTER U WITH TILDE
    '\u016a'   #  0xDE -> LATIN CAPITAL LETTER U WITH MACRON
    '\xdf'     #  0xDF -> LATIN SMALL LETTER SHARP S
    '\u0101'   #  0xE0 -> LATIN SMALL LETTER A WITH MACRON
    '\xe1'     #  0xE1 -> LATIN SMALL LETTER A WITH ACUTE
    '\xe2'     #  0xE2 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\xe3'     #  0xE3 -> LATIN SMALL LETTER A WITH TILDE
    '\xe4'     #  0xE4 -> LATIN SMALL LETTER A WITH DIAERESIS
    '\xe5'     #  0xE5 -> LATIN SMALL LETTER A WITH RING ABOVE
    '\xe6'     #  0xE6 -> LATIN SMALL LETTER AE
    '\u012f'   #  0xE7 -> LATIN SMALL LETTER I WITH OGONEK
    '\u010d'   #  0xE8 -> LATIN SMALL LETTER C WITH CARON
    '\xe9'     #  0xE9 -> LATIN SMALL LETTER E WITH ACUTE
    '\u0119'   #  0xEA -> LATIN SMALL LETTER E WITH OGONEK
    '\xeb'     #  0xEB -> LATIN SMALL LETTER E WITH DIAERESIS
    '\u0117'   #  0xEC -> LATIN SMALL LETTER E WITH DOT ABOVE
    '\xed'     #  0xED -> LATIN SMALL LETTER I WITH ACUTE
    '\xee'     #  0xEE -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\u012b'   #  0xEF -> LATIN SMALL LETTER I WITH MACRON
    '\u0111'   #  0xF0 -> LATIN SMALL LETTER D WITH STROKE
    '\u0146'   #  0xF1 -> LATIN SMALL LETTER N WITH CEDILLA
    '\u014d'   #  0xF2 -> LATIN SMALL LETTER O WITH MACRON
    '\u0137'   #  0xF3 -> LATIN SMALL LETTER K WITH CEDILLA
    '\xf4'     #  0xF4 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xf5'     #  0xF5 -> LATIN SMALL LETTER O WITH TILDE
    '\xf6'     #  0xF6 -> LATIN SMALL LETTER O WITH DIAERESIS
    '\xf7'     #  0xF7 -> DIVISION SIGN
    '\xf8'     #  0xF8 -> LATIN SMALL LETTER O WITH STROKE
    '\u0173'   #  0xF9 -> LATIN SMALL LETTER U WITH OGONEK
    '\xfa'     #  0xFA -> LATIN SMALL LETTER U WITH ACUTE
    '\xfb'     #  0xFB -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\xfc'     #  0xFC -> LATIN SMALL LETTER U WITH DIAERESIS
    '\u0169'   #  0xFD -> LATIN SMALL LETTER U WITH TILDE
    '\u016b'   #  0xFE -> LATIN SMALL LETTER U WITH MACRON
    '\u02d9'   #  0xFF -> DOT ABOVE
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/iso8859_3.py000064400000031441151153537610010453 0ustar00""" Python Character Mapping Codec iso8859_3 generated from 'MAPPINGS/ISO8859/8859-3.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='iso8859-3',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\x80'     #  0x80 -> <control>
    '\x81'     #  0x81 -> <control>
    '\x82'     #  0x82 -> <control>
    '\x83'     #  0x83 -> <control>
    '\x84'     #  0x84 -> <control>
    '\x85'     #  0x85 -> <control>
    '\x86'     #  0x86 -> <control>
    '\x87'     #  0x87 -> <control>
    '\x88'     #  0x88 -> <control>
    '\x89'     #  0x89 -> <control>
    '\x8a'     #  0x8A -> <control>
    '\x8b'     #  0x8B -> <control>
    '\x8c'     #  0x8C -> <control>
    '\x8d'     #  0x8D -> <control>
    '\x8e'     #  0x8E -> <control>
    '\x8f'     #  0x8F -> <control>
    '\x90'     #  0x90 -> <control>
    '\x91'     #  0x91 -> <control>
    '\x92'     #  0x92 -> <control>
    '\x93'     #  0x93 -> <control>
    '\x94'     #  0x94 -> <control>
    '\x95'     #  0x95 -> <control>
    '\x96'     #  0x96 -> <control>
    '\x97'     #  0x97 -> <control>
    '\x98'     #  0x98 -> <control>
    '\x99'     #  0x99 -> <control>
    '\x9a'     #  0x9A -> <control>
    '\x9b'     #  0x9B -> <control>
    '\x9c'     #  0x9C -> <control>
    '\x9d'     #  0x9D -> <control>
    '\x9e'     #  0x9E -> <control>
    '\x9f'     #  0x9F -> <control>
    '\xa0'     #  0xA0 -> NO-BREAK SPACE
    '\u0126'   #  0xA1 -> LATIN CAPITAL LETTER H WITH STROKE
    '\u02d8'   #  0xA2 -> BREVE
    '\xa3'     #  0xA3 -> POUND SIGN
    '\xa4'     #  0xA4 -> CURRENCY SIGN
    '\ufffe'
    '\u0124'   #  0xA6 -> LATIN CAPITAL LETTER H WITH CIRCUMFLEX
    '\xa7'     #  0xA7 -> SECTION SIGN
    '\xa8'     #  0xA8 -> DIAERESIS
    '\u0130'   #  0xA9 -> LATIN CAPITAL LETTER I WITH DOT ABOVE
    '\u015e'   #  0xAA -> LATIN CAPITAL LETTER S WITH CEDILLA
    '\u011e'   #  0xAB -> LATIN CAPITAL LETTER G WITH BREVE
    '\u0134'   #  0xAC -> LATIN CAPITAL LETTER J WITH CIRCUMFLEX
    '\xad'     #  0xAD -> SOFT HYPHEN
    '\ufffe'
    '\u017b'   #  0xAF -> LATIN CAPITAL LETTER Z WITH DOT ABOVE
    '\xb0'     #  0xB0 -> DEGREE SIGN
    '\u0127'   #  0xB1 -> LATIN SMALL LETTER H WITH STROKE
    '\xb2'     #  0xB2 -> SUPERSCRIPT TWO
    '\xb3'     #  0xB3 -> SUPERSCRIPT THREE
    '\xb4'     #  0xB4 -> ACUTE ACCENT
    '\xb5'     #  0xB5 -> MICRO SIGN
    '\u0125'   #  0xB6 -> LATIN SMALL LETTER H WITH CIRCUMFLEX
    '\xb7'     #  0xB7 -> MIDDLE DOT
    '\xb8'     #  0xB8 -> CEDILLA
    '\u0131'   #  0xB9 -> LATIN SMALL LETTER DOTLESS I
    '\u015f'   #  0xBA -> LATIN SMALL LETTER S WITH CEDILLA
    '\u011f'   #  0xBB -> LATIN SMALL LETTER G WITH BREVE
    '\u0135'   #  0xBC -> LATIN SMALL LETTER J WITH CIRCUMFLEX
    '\xbd'     #  0xBD -> VULGAR FRACTION ONE HALF
    '\ufffe'
    '\u017c'   #  0xBF -> LATIN SMALL LETTER Z WITH DOT ABOVE
    '\xc0'     #  0xC0 -> LATIN CAPITAL LETTER A WITH GRAVE
    '\xc1'     #  0xC1 -> LATIN CAPITAL LETTER A WITH ACUTE
    '\xc2'     #  0xC2 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    '\ufffe'
    '\xc4'     #  0xC4 -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\u010a'   #  0xC5 -> LATIN CAPITAL LETTER C WITH DOT ABOVE
    '\u0108'   #  0xC6 -> LATIN CAPITAL LETTER C WITH CIRCUMFLEX
    '\xc7'     #  0xC7 -> LATIN CAPITAL LETTER C WITH CEDILLA
    '\xc8'     #  0xC8 -> LATIN CAPITAL LETTER E WITH GRAVE
    '\xc9'     #  0xC9 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\xca'     #  0xCA -> LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    '\xcb'     #  0xCB -> LATIN CAPITAL LETTER E WITH DIAERESIS
    '\xcc'     #  0xCC -> LATIN CAPITAL LETTER I WITH GRAVE
    '\xcd'     #  0xCD -> LATIN CAPITAL LETTER I WITH ACUTE
    '\xce'     #  0xCE -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    '\xcf'     #  0xCF -> LATIN CAPITAL LETTER I WITH DIAERESIS
    '\ufffe'
    '\xd1'     #  0xD1 -> LATIN CAPITAL LETTER N WITH TILDE
    '\xd2'     #  0xD2 -> LATIN CAPITAL LETTER O WITH GRAVE
    '\xd3'     #  0xD3 -> LATIN CAPITAL LETTER O WITH ACUTE
    '\xd4'     #  0xD4 -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    '\u0120'   #  0xD5 -> LATIN CAPITAL LETTER G WITH DOT ABOVE
    '\xd6'     #  0xD6 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xd7'     #  0xD7 -> MULTIPLICATION SIGN
    '\u011c'   #  0xD8 -> LATIN CAPITAL LETTER G WITH CIRCUMFLEX
    '\xd9'     #  0xD9 -> LATIN CAPITAL LETTER U WITH GRAVE
    '\xda'     #  0xDA -> LATIN CAPITAL LETTER U WITH ACUTE
    '\xdb'     #  0xDB -> LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    '\xdc'     #  0xDC -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\u016c'   #  0xDD -> LATIN CAPITAL LETTER U WITH BREVE
    '\u015c'   #  0xDE -> LATIN CAPITAL LETTER S WITH CIRCUMFLEX
    '\xdf'     #  0xDF -> LATIN SMALL LETTER SHARP S
    '\xe0'     #  0xE0 -> LATIN SMALL LETTER A WITH GRAVE
    '\xe1'     #  0xE1 -> LATIN SMALL LETTER A WITH ACUTE
    '\xe2'     #  0xE2 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\ufffe'
    '\xe4'     #  0xE4 -> LATIN SMALL LETTER A WITH DIAERESIS
    '\u010b'   #  0xE5 -> LATIN SMALL LETTER C WITH DOT ABOVE
    '\u0109'   #  0xE6 -> LATIN SMALL LETTER C WITH CIRCUMFLEX
    '\xe7'     #  0xE7 -> LATIN SMALL LETTER C WITH CEDILLA
    '\xe8'     #  0xE8 -> LATIN SMALL LETTER E WITH GRAVE
    '\xe9'     #  0xE9 -> LATIN SMALL LETTER E WITH ACUTE
    '\xea'     #  0xEA -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xeb'     #  0xEB -> LATIN SMALL LETTER E WITH DIAERESIS
    '\xec'     #  0xEC -> LATIN SMALL LETTER I WITH GRAVE
    '\xed'     #  0xED -> LATIN SMALL LETTER I WITH ACUTE
    '\xee'     #  0xEE -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\xef'     #  0xEF -> LATIN SMALL LETTER I WITH DIAERESIS
    '\ufffe'
    '\xf1'     #  0xF1 -> LATIN SMALL LETTER N WITH TILDE
    '\xf2'     #  0xF2 -> LATIN SMALL LETTER O WITH GRAVE
    '\xf3'     #  0xF3 -> LATIN SMALL LETTER O WITH ACUTE
    '\xf4'     #  0xF4 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\u0121'   #  0xF5 -> LATIN SMALL LETTER G WITH DOT ABOVE
    '\xf6'     #  0xF6 -> LATIN SMALL LETTER O WITH DIAERESIS
    '\xf7'     #  0xF7 -> DIVISION SIGN
    '\u011d'   #  0xF8 -> LATIN SMALL LETTER G WITH CIRCUMFLEX
    '\xf9'     #  0xF9 -> LATIN SMALL LETTER U WITH GRAVE
    '\xfa'     #  0xFA -> LATIN SMALL LETTER U WITH ACUTE
    '\xfb'     #  0xFB -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\xfc'     #  0xFC -> LATIN SMALL LETTER U WITH DIAERESIS
    '\u016d'   #  0xFD -> LATIN SMALL LETTER U WITH BREVE
    '\u015d'   #  0xFE -> LATIN SMALL LETTER S WITH CIRCUMFLEX
    '\u02d9'   #  0xFF -> DOT ABOVE
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/mac_latin2.py000064400000033446151153537610011121 0ustar00""" Python Character Mapping Codec mac_latin2 generated from 'MAPPINGS/VENDORS/MICSFT/MAC/LATIN2.TXT' with gencodec.py.

Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
(c) Copyright 2000 Guido van Rossum.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='mac-latin2',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\xc4'     #  0x80 -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\u0100'   #  0x81 -> LATIN CAPITAL LETTER A WITH MACRON
    '\u0101'   #  0x82 -> LATIN SMALL LETTER A WITH MACRON
    '\xc9'     #  0x83 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\u0104'   #  0x84 -> LATIN CAPITAL LETTER A WITH OGONEK
    '\xd6'     #  0x85 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xdc'     #  0x86 -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\xe1'     #  0x87 -> LATIN SMALL LETTER A WITH ACUTE
    '\u0105'   #  0x88 -> LATIN SMALL LETTER A WITH OGONEK
    '\u010c'   #  0x89 -> LATIN CAPITAL LETTER C WITH CARON
    '\xe4'     #  0x8A -> LATIN SMALL LETTER A WITH DIAERESIS
    '\u010d'   #  0x8B -> LATIN SMALL LETTER C WITH CARON
    '\u0106'   #  0x8C -> LATIN CAPITAL LETTER C WITH ACUTE
    '\u0107'   #  0x8D -> LATIN SMALL LETTER C WITH ACUTE
    '\xe9'     #  0x8E -> LATIN SMALL LETTER E WITH ACUTE
    '\u0179'   #  0x8F -> LATIN CAPITAL LETTER Z WITH ACUTE
    '\u017a'   #  0x90 -> LATIN SMALL LETTER Z WITH ACUTE
    '\u010e'   #  0x91 -> LATIN CAPITAL LETTER D WITH CARON
    '\xed'     #  0x92 -> LATIN SMALL LETTER I WITH ACUTE
    '\u010f'   #  0x93 -> LATIN SMALL LETTER D WITH CARON
    '\u0112'   #  0x94 -> LATIN CAPITAL LETTER E WITH MACRON
    '\u0113'   #  0x95 -> LATIN SMALL LETTER E WITH MACRON
    '\u0116'   #  0x96 -> LATIN CAPITAL LETTER E WITH DOT ABOVE
    '\xf3'     #  0x97 -> LATIN SMALL LETTER O WITH ACUTE
    '\u0117'   #  0x98 -> LATIN SMALL LETTER E WITH DOT ABOVE
    '\xf4'     #  0x99 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xf6'     #  0x9A -> LATIN SMALL LETTER O WITH DIAERESIS
    '\xf5'     #  0x9B -> LATIN SMALL LETTER O WITH TILDE
    '\xfa'     #  0x9C -> LATIN SMALL LETTER U WITH ACUTE
    '\u011a'   #  0x9D -> LATIN CAPITAL LETTER E WITH CARON
    '\u011b'   #  0x9E -> LATIN SMALL LETTER E WITH CARON
    '\xfc'     #  0x9F -> LATIN SMALL LETTER U WITH DIAERESIS
    '\u2020'   #  0xA0 -> DAGGER
    '\xb0'     #  0xA1 -> DEGREE SIGN
    '\u0118'   #  0xA2 -> LATIN CAPITAL LETTER E WITH OGONEK
    '\xa3'     #  0xA3 -> POUND SIGN
    '\xa7'     #  0xA4 -> SECTION SIGN
    '\u2022'   #  0xA5 -> BULLET
    '\xb6'     #  0xA6 -> PILCROW SIGN
    '\xdf'     #  0xA7 -> LATIN SMALL LETTER SHARP S
    '\xae'     #  0xA8 -> REGISTERED SIGN
    '\xa9'     #  0xA9 -> COPYRIGHT SIGN
    '\u2122'   #  0xAA -> TRADE MARK SIGN
    '\u0119'   #  0xAB -> LATIN SMALL LETTER E WITH OGONEK
    '\xa8'     #  0xAC -> DIAERESIS
    '\u2260'   #  0xAD -> NOT EQUAL TO
    '\u0123'   #  0xAE -> LATIN SMALL LETTER G WITH CEDILLA
    '\u012e'   #  0xAF -> LATIN CAPITAL LETTER I WITH OGONEK
    '\u012f'   #  0xB0 -> LATIN SMALL LETTER I WITH OGONEK
    '\u012a'   #  0xB1 -> LATIN CAPITAL LETTER I WITH MACRON
    '\u2264'   #  0xB2 -> LESS-THAN OR EQUAL TO
    '\u2265'   #  0xB3 -> GREATER-THAN OR EQUAL TO
    '\u012b'   #  0xB4 -> LATIN SMALL LETTER I WITH MACRON
    '\u0136'   #  0xB5 -> LATIN CAPITAL LETTER K WITH CEDILLA
    '\u2202'   #  0xB6 -> PARTIAL DIFFERENTIAL
    '\u2211'   #  0xB7 -> N-ARY SUMMATION
    '\u0142'   #  0xB8 -> LATIN SMALL LETTER L WITH STROKE
    '\u013b'   #  0xB9 -> LATIN CAPITAL LETTER L WITH CEDILLA
    '\u013c'   #  0xBA -> LATIN SMALL LETTER L WITH CEDILLA
    '\u013d'   #  0xBB -> LATIN CAPITAL LETTER L WITH CARON
    '\u013e'   #  0xBC -> LATIN SMALL LETTER L WITH CARON
    '\u0139'   #  0xBD -> LATIN CAPITAL LETTER L WITH ACUTE
    '\u013a'   #  0xBE -> LATIN SMALL LETTER L WITH ACUTE
    '\u0145'   #  0xBF -> LATIN CAPITAL LETTER N WITH CEDILLA
    '\u0146'   #  0xC0 -> LATIN SMALL LETTER N WITH CEDILLA
    '\u0143'   #  0xC1 -> LATIN CAPITAL LETTER N WITH ACUTE
    '\xac'     #  0xC2 -> NOT SIGN
    '\u221a'   #  0xC3 -> SQUARE ROOT
    '\u0144'   #  0xC4 -> LATIN SMALL LETTER N WITH ACUTE
    '\u0147'   #  0xC5 -> LATIN CAPITAL LETTER N WITH CARON
    '\u2206'   #  0xC6 -> INCREMENT
    '\xab'     #  0xC7 -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbb'     #  0xC8 -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u2026'   #  0xC9 -> HORIZONTAL ELLIPSIS
    '\xa0'     #  0xCA -> NO-BREAK SPACE
    '\u0148'   #  0xCB -> LATIN SMALL LETTER N WITH CARON
    '\u0150'   #  0xCC -> LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
    '\xd5'     #  0xCD -> LATIN CAPITAL LETTER O WITH TILDE
    '\u0151'   #  0xCE -> LATIN SMALL LETTER O WITH DOUBLE ACUTE
    '\u014c'   #  0xCF -> LATIN CAPITAL LETTER O WITH MACRON
    '\u2013'   #  0xD0 -> EN DASH
    '\u2014'   #  0xD1 -> EM DASH
    '\u201c'   #  0xD2 -> LEFT DOUBLE QUOTATION MARK
    '\u201d'   #  0xD3 -> RIGHT DOUBLE QUOTATION MARK
    '\u2018'   #  0xD4 -> LEFT SINGLE QUOTATION MARK
    '\u2019'   #  0xD5 -> RIGHT SINGLE QUOTATION MARK
    '\xf7'     #  0xD6 -> DIVISION SIGN
    '\u25ca'   #  0xD7 -> LOZENGE
    '\u014d'   #  0xD8 -> LATIN SMALL LETTER O WITH MACRON
    '\u0154'   #  0xD9 -> LATIN CAPITAL LETTER R WITH ACUTE
    '\u0155'   #  0xDA -> LATIN SMALL LETTER R WITH ACUTE
    '\u0158'   #  0xDB -> LATIN CAPITAL LETTER R WITH CARON
    '\u2039'   #  0xDC -> SINGLE LEFT-POINTING ANGLE QUOTATION MARK
    '\u203a'   #  0xDD -> SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
    '\u0159'   #  0xDE -> LATIN SMALL LETTER R WITH CARON
    '\u0156'   #  0xDF -> LATIN CAPITAL LETTER R WITH CEDILLA
    '\u0157'   #  0xE0 -> LATIN SMALL LETTER R WITH CEDILLA
    '\u0160'   #  0xE1 -> LATIN CAPITAL LETTER S WITH CARON
    '\u201a'   #  0xE2 -> SINGLE LOW-9 QUOTATION MARK
    '\u201e'   #  0xE3 -> DOUBLE LOW-9 QUOTATION MARK
    '\u0161'   #  0xE4 -> LATIN SMALL LETTER S WITH CARON
    '\u015a'   #  0xE5 -> LATIN CAPITAL LETTER S WITH ACUTE
    '\u015b'   #  0xE6 -> LATIN SMALL LETTER S WITH ACUTE
    '\xc1'     #  0xE7 -> LATIN CAPITAL LETTER A WITH ACUTE
    '\u0164'   #  0xE8 -> LATIN CAPITAL LETTER T WITH CARON
    '\u0165'   #  0xE9 -> LATIN SMALL LETTER T WITH CARON
    '\xcd'     #  0xEA -> LATIN CAPITAL LETTER I WITH ACUTE
    '\u017d'   #  0xEB -> LATIN CAPITAL LETTER Z WITH CARON
    '\u017e'   #  0xEC -> LATIN SMALL LETTER Z WITH CARON
    '\u016a'   #  0xED -> LATIN CAPITAL LETTER U WITH MACRON
    '\xd3'     #  0xEE -> LATIN CAPITAL LETTER O WITH ACUTE
    '\xd4'     #  0xEF -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    '\u016b'   #  0xF0 -> LATIN SMALL LETTER U WITH MACRON
    '\u016e'   #  0xF1 -> LATIN CAPITAL LETTER U WITH RING ABOVE
    '\xda'     #  0xF2 -> LATIN CAPITAL LETTER U WITH ACUTE
    '\u016f'   #  0xF3 -> LATIN SMALL LETTER U WITH RING ABOVE
    '\u0170'   #  0xF4 -> LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
    '\u0171'   #  0xF5 -> LATIN SMALL LETTER U WITH DOUBLE ACUTE
    '\u0172'   #  0xF6 -> LATIN CAPITAL LETTER U WITH OGONEK
    '\u0173'   #  0xF7 -> LATIN SMALL LETTER U WITH OGONEK
    '\xdd'     #  0xF8 -> LATIN CAPITAL LETTER Y WITH ACUTE
    '\xfd'     #  0xF9 -> LATIN SMALL LETTER Y WITH ACUTE
    '\u0137'   #  0xFA -> LATIN SMALL LETTER K WITH CEDILLA
    '\u017b'   #  0xFB -> LATIN CAPITAL LETTER Z WITH DOT ABOVE
    '\u0141'   #  0xFC -> LATIN CAPITAL LETTER L WITH STROKE
    '\u017c'   #  0xFD -> LATIN SMALL LETTER Z WITH DOT ABOVE
    '\u0122'   #  0xFE -> LATIN CAPITAL LETTER G WITH CEDILLA
    '\u02c7'   #  0xFF -> CARON
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/iso8859_2.py000064400000032134151153537610010452 0ustar00""" Python Character Mapping Codec iso8859_2 generated from 'MAPPINGS/ISO8859/8859-2.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='iso8859-2',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\x80'     #  0x80 -> <control>
    '\x81'     #  0x81 -> <control>
    '\x82'     #  0x82 -> <control>
    '\x83'     #  0x83 -> <control>
    '\x84'     #  0x84 -> <control>
    '\x85'     #  0x85 -> <control>
    '\x86'     #  0x86 -> <control>
    '\x87'     #  0x87 -> <control>
    '\x88'     #  0x88 -> <control>
    '\x89'     #  0x89 -> <control>
    '\x8a'     #  0x8A -> <control>
    '\x8b'     #  0x8B -> <control>
    '\x8c'     #  0x8C -> <control>
    '\x8d'     #  0x8D -> <control>
    '\x8e'     #  0x8E -> <control>
    '\x8f'     #  0x8F -> <control>
    '\x90'     #  0x90 -> <control>
    '\x91'     #  0x91 -> <control>
    '\x92'     #  0x92 -> <control>
    '\x93'     #  0x93 -> <control>
    '\x94'     #  0x94 -> <control>
    '\x95'     #  0x95 -> <control>
    '\x96'     #  0x96 -> <control>
    '\x97'     #  0x97 -> <control>
    '\x98'     #  0x98 -> <control>
    '\x99'     #  0x99 -> <control>
    '\x9a'     #  0x9A -> <control>
    '\x9b'     #  0x9B -> <control>
    '\x9c'     #  0x9C -> <control>
    '\x9d'     #  0x9D -> <control>
    '\x9e'     #  0x9E -> <control>
    '\x9f'     #  0x9F -> <control>
    '\xa0'     #  0xA0 -> NO-BREAK SPACE
    '\u0104'   #  0xA1 -> LATIN CAPITAL LETTER A WITH OGONEK
    '\u02d8'   #  0xA2 -> BREVE
    '\u0141'   #  0xA3 -> LATIN CAPITAL LETTER L WITH STROKE
    '\xa4'     #  0xA4 -> CURRENCY SIGN
    '\u013d'   #  0xA5 -> LATIN CAPITAL LETTER L WITH CARON
    '\u015a'   #  0xA6 -> LATIN CAPITAL LETTER S WITH ACUTE
    '\xa7'     #  0xA7 -> SECTION SIGN
    '\xa8'     #  0xA8 -> DIAERESIS
    '\u0160'   #  0xA9 -> LATIN CAPITAL LETTER S WITH CARON
    '\u015e'   #  0xAA -> LATIN CAPITAL LETTER S WITH CEDILLA
    '\u0164'   #  0xAB -> LATIN CAPITAL LETTER T WITH CARON
    '\u0179'   #  0xAC -> LATIN CAPITAL LETTER Z WITH ACUTE
    '\xad'     #  0xAD -> SOFT HYPHEN
    '\u017d'   #  0xAE -> LATIN CAPITAL LETTER Z WITH CARON
    '\u017b'   #  0xAF -> LATIN CAPITAL LETTER Z WITH DOT ABOVE
    '\xb0'     #  0xB0 -> DEGREE SIGN
    '\u0105'   #  0xB1 -> LATIN SMALL LETTER A WITH OGONEK
    '\u02db'   #  0xB2 -> OGONEK
    '\u0142'   #  0xB3 -> LATIN SMALL LETTER L WITH STROKE
    '\xb4'     #  0xB4 -> ACUTE ACCENT
    '\u013e'   #  0xB5 -> LATIN SMALL LETTER L WITH CARON
    '\u015b'   #  0xB6 -> LATIN SMALL LETTER S WITH ACUTE
    '\u02c7'   #  0xB7 -> CARON
    '\xb8'     #  0xB8 -> CEDILLA
    '\u0161'   #  0xB9 -> LATIN SMALL LETTER S WITH CARON
    '\u015f'   #  0xBA -> LATIN SMALL LETTER S WITH CEDILLA
    '\u0165'   #  0xBB -> LATIN SMALL LETTER T WITH CARON
    '\u017a'   #  0xBC -> LATIN SMALL LETTER Z WITH ACUTE
    '\u02dd'   #  0xBD -> DOUBLE ACUTE ACCENT
    '\u017e'   #  0xBE -> LATIN SMALL LETTER Z WITH CARON
    '\u017c'   #  0xBF -> LATIN SMALL LETTER Z WITH DOT ABOVE
    '\u0154'   #  0xC0 -> LATIN CAPITAL LETTER R WITH ACUTE
    '\xc1'     #  0xC1 -> LATIN CAPITAL LETTER A WITH ACUTE
    '\xc2'     #  0xC2 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    '\u0102'   #  0xC3 -> LATIN CAPITAL LETTER A WITH BREVE
    '\xc4'     #  0xC4 -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\u0139'   #  0xC5 -> LATIN CAPITAL LETTER L WITH ACUTE
    '\u0106'   #  0xC6 -> LATIN CAPITAL LETTER C WITH ACUTE
    '\xc7'     #  0xC7 -> LATIN CAPITAL LETTER C WITH CEDILLA
    '\u010c'   #  0xC8 -> LATIN CAPITAL LETTER C WITH CARON
    '\xc9'     #  0xC9 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\u0118'   #  0xCA -> LATIN CAPITAL LETTER E WITH OGONEK
    '\xcb'     #  0xCB -> LATIN CAPITAL LETTER E WITH DIAERESIS
    '\u011a'   #  0xCC -> LATIN CAPITAL LETTER E WITH CARON
    '\xcd'     #  0xCD -> LATIN CAPITAL LETTER I WITH ACUTE
    '\xce'     #  0xCE -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    '\u010e'   #  0xCF -> LATIN CAPITAL LETTER D WITH CARON
    '\u0110'   #  0xD0 -> LATIN CAPITAL LETTER D WITH STROKE
    '\u0143'   #  0xD1 -> LATIN CAPITAL LETTER N WITH ACUTE
    '\u0147'   #  0xD2 -> LATIN CAPITAL LETTER N WITH CARON
    '\xd3'     #  0xD3 -> LATIN CAPITAL LETTER O WITH ACUTE
    '\xd4'     #  0xD4 -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    '\u0150'   #  0xD5 -> LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
    '\xd6'     #  0xD6 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xd7'     #  0xD7 -> MULTIPLICATION SIGN
    '\u0158'   #  0xD8 -> LATIN CAPITAL LETTER R WITH CARON
    '\u016e'   #  0xD9 -> LATIN CAPITAL LETTER U WITH RING ABOVE
    '\xda'     #  0xDA -> LATIN CAPITAL LETTER U WITH ACUTE
    '\u0170'   #  0xDB -> LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
    '\xdc'     #  0xDC -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\xdd'     #  0xDD -> LATIN CAPITAL LETTER Y WITH ACUTE
    '\u0162'   #  0xDE -> LATIN CAPITAL LETTER T WITH CEDILLA
    '\xdf'     #  0xDF -> LATIN SMALL LETTER SHARP S
    '\u0155'   #  0xE0 -> LATIN SMALL LETTER R WITH ACUTE
    '\xe1'     #  0xE1 -> LATIN SMALL LETTER A WITH ACUTE
    '\xe2'     #  0xE2 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\u0103'   #  0xE3 -> LATIN SMALL LETTER A WITH BREVE
    '\xe4'     #  0xE4 -> LATIN SMALL LETTER A WITH DIAERESIS
    '\u013a'   #  0xE5 -> LATIN SMALL LETTER L WITH ACUTE
    '\u0107'   #  0xE6 -> LATIN SMALL LETTER C WITH ACUTE
    '\xe7'     #  0xE7 -> LATIN SMALL LETTER C WITH CEDILLA
    '\u010d'   #  0xE8 -> LATIN SMALL LETTER C WITH CARON
    '\xe9'     #  0xE9 -> LATIN SMALL LETTER E WITH ACUTE
    '\u0119'   #  0xEA -> LATIN SMALL LETTER E WITH OGONEK
    '\xeb'     #  0xEB -> LATIN SMALL LETTER E WITH DIAERESIS
    '\u011b'   #  0xEC -> LATIN SMALL LETTER E WITH CARON
    '\xed'     #  0xED -> LATIN SMALL LETTER I WITH ACUTE
    '\xee'     #  0xEE -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\u010f'   #  0xEF -> LATIN SMALL LETTER D WITH CARON
    '\u0111'   #  0xF0 -> LATIN SMALL LETTER D WITH STROKE
    '\u0144'   #  0xF1 -> LATIN SMALL LETTER N WITH ACUTE
    '\u0148'   #  0xF2 -> LATIN SMALL LETTER N WITH CARON
    '\xf3'     #  0xF3 -> LATIN SMALL LETTER O WITH ACUTE
    '\xf4'     #  0xF4 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\u0151'   #  0xF5 -> LATIN SMALL LETTER O WITH DOUBLE ACUTE
    '\xf6'     #  0xF6 -> LATIN SMALL LETTER O WITH DIAERESIS
    '\xf7'     #  0xF7 -> DIVISION SIGN
    '\u0159'   #  0xF8 -> LATIN SMALL LETTER R WITH CARON
    '\u016f'   #  0xF9 -> LATIN SMALL LETTER U WITH RING ABOVE
    '\xfa'     #  0xFA -> LATIN SMALL LETTER U WITH ACUTE
    '\u0171'   #  0xFB -> LATIN SMALL LETTER U WITH DOUBLE ACUTE
    '\xfc'     #  0xFC -> LATIN SMALL LETTER U WITH DIAERESIS
    '\xfd'     #  0xFD -> LATIN SMALL LETTER Y WITH ACUTE
    '\u0163'   #  0xFE -> LATIN SMALL LETTER T WITH CEDILLA
    '\u02d9'   #  0xFF -> DOT ABOVE
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/rot_13.py000075500000004620151153537610010212 0ustar00#! /usr/bin/python3.8
""" Python Character Mapping Codec for ROT13.

This codec de/encodes from str to str.

Written by Marc-Andre Lemburg (mal@lemburg.com).
"""

import codecs

### Codec APIs

class Codec(codecs.Codec):
    def encode(self, input, errors='strict'):
        return (str.translate(input, rot13_map), len(input))

    def decode(self, input, errors='strict'):
        return (str.translate(input, rot13_map), len(input))

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return str.translate(input, rot13_map)

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return str.translate(input, rot13_map)

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='rot-13',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamwriter=StreamWriter,
        streamreader=StreamReader,
        _is_text_encoding=False,
    )

### Map

rot13_map = codecs.make_identity_dict(range(256))
rot13_map.update({
   0x0041: 0x004e,
   0x0042: 0x004f,
   0x0043: 0x0050,
   0x0044: 0x0051,
   0x0045: 0x0052,
   0x0046: 0x0053,
   0x0047: 0x0054,
   0x0048: 0x0055,
   0x0049: 0x0056,
   0x004a: 0x0057,
   0x004b: 0x0058,
   0x004c: 0x0059,
   0x004d: 0x005a,
   0x004e: 0x0041,
   0x004f: 0x0042,
   0x0050: 0x0043,
   0x0051: 0x0044,
   0x0052: 0x0045,
   0x0053: 0x0046,
   0x0054: 0x0047,
   0x0055: 0x0048,
   0x0056: 0x0049,
   0x0057: 0x004a,
   0x0058: 0x004b,
   0x0059: 0x004c,
   0x005a: 0x004d,
   0x0061: 0x006e,
   0x0062: 0x006f,
   0x0063: 0x0070,
   0x0064: 0x0071,
   0x0065: 0x0072,
   0x0066: 0x0073,
   0x0067: 0x0074,
   0x0068: 0x0075,
   0x0069: 0x0076,
   0x006a: 0x0077,
   0x006b: 0x0078,
   0x006c: 0x0079,
   0x006d: 0x007a,
   0x006e: 0x0061,
   0x006f: 0x0062,
   0x0070: 0x0063,
   0x0071: 0x0064,
   0x0072: 0x0065,
   0x0073: 0x0066,
   0x0074: 0x0067,
   0x0075: 0x0068,
   0x0076: 0x0069,
   0x0077: 0x006a,
   0x0078: 0x006b,
   0x0079: 0x006c,
   0x007a: 0x006d,
})

### Filter API

def rot13(infile, outfile):
    outfile.write(codecs.encode(infile.read(), 'rot-13'))

if __name__ == '__main__':
    import sys
    rot13(sys.stdin, sys.stdout)
encodings/cp1125.py000064400000103445151153537610010020 0ustar00""" Python Character Mapping Codec for CP1125

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_map)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_map)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp1125',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )

### Decoding Map

decoding_map = codecs.make_identity_dict(range(256))
decoding_map.update({
    0x0080: 0x0410,     #  CYRILLIC CAPITAL LETTER A
    0x0081: 0x0411,     #  CYRILLIC CAPITAL LETTER BE
    0x0082: 0x0412,     #  CYRILLIC CAPITAL LETTER VE
    0x0083: 0x0413,     #  CYRILLIC CAPITAL LETTER GHE
    0x0084: 0x0414,     #  CYRILLIC CAPITAL LETTER DE
    0x0085: 0x0415,     #  CYRILLIC CAPITAL LETTER IE
    0x0086: 0x0416,     #  CYRILLIC CAPITAL LETTER ZHE
    0x0087: 0x0417,     #  CYRILLIC CAPITAL LETTER ZE
    0x0088: 0x0418,     #  CYRILLIC CAPITAL LETTER I
    0x0089: 0x0419,     #  CYRILLIC CAPITAL LETTER SHORT I
    0x008a: 0x041a,     #  CYRILLIC CAPITAL LETTER KA
    0x008b: 0x041b,     #  CYRILLIC CAPITAL LETTER EL
    0x008c: 0x041c,     #  CYRILLIC CAPITAL LETTER EM
    0x008d: 0x041d,     #  CYRILLIC CAPITAL LETTER EN
    0x008e: 0x041e,     #  CYRILLIC CAPITAL LETTER O
    0x008f: 0x041f,     #  CYRILLIC CAPITAL LETTER PE
    0x0090: 0x0420,     #  CYRILLIC CAPITAL LETTER ER
    0x0091: 0x0421,     #  CYRILLIC CAPITAL LETTER ES
    0x0092: 0x0422,     #  CYRILLIC CAPITAL LETTER TE
    0x0093: 0x0423,     #  CYRILLIC CAPITAL LETTER U
    0x0094: 0x0424,     #  CYRILLIC CAPITAL LETTER EF
    0x0095: 0x0425,     #  CYRILLIC CAPITAL LETTER HA
    0x0096: 0x0426,     #  CYRILLIC CAPITAL LETTER TSE
    0x0097: 0x0427,     #  CYRILLIC CAPITAL LETTER CHE
    0x0098: 0x0428,     #  CYRILLIC CAPITAL LETTER SHA
    0x0099: 0x0429,     #  CYRILLIC CAPITAL LETTER SHCHA
    0x009a: 0x042a,     #  CYRILLIC CAPITAL LETTER HARD SIGN
    0x009b: 0x042b,     #  CYRILLIC CAPITAL LETTER YERU
    0x009c: 0x042c,     #  CYRILLIC CAPITAL LETTER SOFT SIGN
    0x009d: 0x042d,     #  CYRILLIC CAPITAL LETTER E
    0x009e: 0x042e,     #  CYRILLIC CAPITAL LETTER YU
    0x009f: 0x042f,     #  CYRILLIC CAPITAL LETTER YA
    0x00a0: 0x0430,     #  CYRILLIC SMALL LETTER A
    0x00a1: 0x0431,     #  CYRILLIC SMALL LETTER BE
    0x00a2: 0x0432,     #  CYRILLIC SMALL LETTER VE
    0x00a3: 0x0433,     #  CYRILLIC SMALL LETTER GHE
    0x00a4: 0x0434,     #  CYRILLIC SMALL LETTER DE
    0x00a5: 0x0435,     #  CYRILLIC SMALL LETTER IE
    0x00a6: 0x0436,     #  CYRILLIC SMALL LETTER ZHE
    0x00a7: 0x0437,     #  CYRILLIC SMALL LETTER ZE
    0x00a8: 0x0438,     #  CYRILLIC SMALL LETTER I
    0x00a9: 0x0439,     #  CYRILLIC SMALL LETTER SHORT I
    0x00aa: 0x043a,     #  CYRILLIC SMALL LETTER KA
    0x00ab: 0x043b,     #  CYRILLIC SMALL LETTER EL
    0x00ac: 0x043c,     #  CYRILLIC SMALL LETTER EM
    0x00ad: 0x043d,     #  CYRILLIC SMALL LETTER EN
    0x00ae: 0x043e,     #  CYRILLIC SMALL LETTER O
    0x00af: 0x043f,     #  CYRILLIC SMALL LETTER PE
    0x00b0: 0x2591,     #  LIGHT SHADE
    0x00b1: 0x2592,     #  MEDIUM SHADE
    0x00b2: 0x2593,     #  DARK SHADE
    0x00b3: 0x2502,     #  BOX DRAWINGS LIGHT VERTICAL
    0x00b4: 0x2524,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
    0x00b5: 0x2561,     #  BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
    0x00b6: 0x2562,     #  BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
    0x00b7: 0x2556,     #  BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
    0x00b8: 0x2555,     #  BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
    0x00b9: 0x2563,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    0x00ba: 0x2551,     #  BOX DRAWINGS DOUBLE VERTICAL
    0x00bb: 0x2557,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
    0x00bc: 0x255d,     #  BOX DRAWINGS DOUBLE UP AND LEFT
    0x00bd: 0x255c,     #  BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
    0x00be: 0x255b,     #  BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
    0x00bf: 0x2510,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
    0x00c0: 0x2514,     #  BOX DRAWINGS LIGHT UP AND RIGHT
    0x00c1: 0x2534,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
    0x00c2: 0x252c,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    0x00c3: 0x251c,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    0x00c4: 0x2500,     #  BOX DRAWINGS LIGHT HORIZONTAL
    0x00c5: 0x253c,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    0x00c6: 0x255e,     #  BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
    0x00c7: 0x255f,     #  BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
    0x00c8: 0x255a,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
    0x00c9: 0x2554,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
    0x00ca: 0x2569,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    0x00cb: 0x2566,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    0x00cc: 0x2560,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    0x00cd: 0x2550,     #  BOX DRAWINGS DOUBLE HORIZONTAL
    0x00ce: 0x256c,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    0x00cf: 0x2567,     #  BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
    0x00d0: 0x2568,     #  BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
    0x00d1: 0x2564,     #  BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
    0x00d2: 0x2565,     #  BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
    0x00d3: 0x2559,     #  BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
    0x00d4: 0x2558,     #  BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
    0x00d5: 0x2552,     #  BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
    0x00d6: 0x2553,     #  BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
    0x00d7: 0x256b,     #  BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
    0x00d8: 0x256a,     #  BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
    0x00d9: 0x2518,     #  BOX DRAWINGS LIGHT UP AND LEFT
    0x00da: 0x250c,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
    0x00db: 0x2588,     #  FULL BLOCK
    0x00dc: 0x2584,     #  LOWER HALF BLOCK
    0x00dd: 0x258c,     #  LEFT HALF BLOCK
    0x00de: 0x2590,     #  RIGHT HALF BLOCK
    0x00df: 0x2580,     #  UPPER HALF BLOCK
    0x00e0: 0x0440,     #  CYRILLIC SMALL LETTER ER
    0x00e1: 0x0441,     #  CYRILLIC SMALL LETTER ES
    0x00e2: 0x0442,     #  CYRILLIC SMALL LETTER TE
    0x00e3: 0x0443,     #  CYRILLIC SMALL LETTER U
    0x00e4: 0x0444,     #  CYRILLIC SMALL LETTER EF
    0x00e5: 0x0445,     #  CYRILLIC SMALL LETTER HA
    0x00e6: 0x0446,     #  CYRILLIC SMALL LETTER TSE
    0x00e7: 0x0447,     #  CYRILLIC SMALL LETTER CHE
    0x00e8: 0x0448,     #  CYRILLIC SMALL LETTER SHA
    0x00e9: 0x0449,     #  CYRILLIC SMALL LETTER SHCHA
    0x00ea: 0x044a,     #  CYRILLIC SMALL LETTER HARD SIGN
    0x00eb: 0x044b,     #  CYRILLIC SMALL LETTER YERU
    0x00ec: 0x044c,     #  CYRILLIC SMALL LETTER SOFT SIGN
    0x00ed: 0x044d,     #  CYRILLIC SMALL LETTER E
    0x00ee: 0x044e,     #  CYRILLIC SMALL LETTER YU
    0x00ef: 0x044f,     #  CYRILLIC SMALL LETTER YA
    0x00f0: 0x0401,     #  CYRILLIC CAPITAL LETTER IO
    0x00f1: 0x0451,     #  CYRILLIC SMALL LETTER IO
    0x00f2: 0x0490,     #  CYRILLIC CAPITAL LETTER GHE WITH UPTURN
    0x00f3: 0x0491,     #  CYRILLIC SMALL LETTER GHE WITH UPTURN
    0x00f4: 0x0404,     #  CYRILLIC CAPITAL LETTER UKRAINIAN IE
    0x00f5: 0x0454,     #  CYRILLIC SMALL LETTER UKRAINIAN IE
    0x00f6: 0x0406,     #  CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
    0x00f7: 0x0456,     #  CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
    0x00f8: 0x0407,     #  CYRILLIC CAPITAL LETTER YI
    0x00f9: 0x0457,     #  CYRILLIC SMALL LETTER YI
    0x00fa: 0x00b7,     #  MIDDLE DOT
    0x00fb: 0x221a,     #  SQUARE ROOT
    0x00fc: 0x2116,     #  NUMERO SIGN
    0x00fd: 0x00a4,     #  CURRENCY SIGN
    0x00fe: 0x25a0,     #  BLACK SQUARE
    0x00ff: 0x00a0,     #  NO-BREAK SPACE
})

### Decoding Table

decoding_table = (
    '\x00'     #  0x0000 -> NULL
    '\x01'     #  0x0001 -> START OF HEADING
    '\x02'     #  0x0002 -> START OF TEXT
    '\x03'     #  0x0003 -> END OF TEXT
    '\x04'     #  0x0004 -> END OF TRANSMISSION
    '\x05'     #  0x0005 -> ENQUIRY
    '\x06'     #  0x0006 -> ACKNOWLEDGE
    '\x07'     #  0x0007 -> BELL
    '\x08'     #  0x0008 -> BACKSPACE
    '\t'       #  0x0009 -> HORIZONTAL TABULATION
    '\n'       #  0x000a -> LINE FEED
    '\x0b'     #  0x000b -> VERTICAL TABULATION
    '\x0c'     #  0x000c -> FORM FEED
    '\r'       #  0x000d -> CARRIAGE RETURN
    '\x0e'     #  0x000e -> SHIFT OUT
    '\x0f'     #  0x000f -> SHIFT IN
    '\x10'     #  0x0010 -> DATA LINK ESCAPE
    '\x11'     #  0x0011 -> DEVICE CONTROL ONE
    '\x12'     #  0x0012 -> DEVICE CONTROL TWO
    '\x13'     #  0x0013 -> DEVICE CONTROL THREE
    '\x14'     #  0x0014 -> DEVICE CONTROL FOUR
    '\x15'     #  0x0015 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x0016 -> SYNCHRONOUS IDLE
    '\x17'     #  0x0017 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x0018 -> CANCEL
    '\x19'     #  0x0019 -> END OF MEDIUM
    '\x1a'     #  0x001a -> SUBSTITUTE
    '\x1b'     #  0x001b -> ESCAPE
    '\x1c'     #  0x001c -> FILE SEPARATOR
    '\x1d'     #  0x001d -> GROUP SEPARATOR
    '\x1e'     #  0x001e -> RECORD SEPARATOR
    '\x1f'     #  0x001f -> UNIT SEPARATOR
    ' '        #  0x0020 -> SPACE
    '!'        #  0x0021 -> EXCLAMATION MARK
    '"'        #  0x0022 -> QUOTATION MARK
    '#'        #  0x0023 -> NUMBER SIGN
    '$'        #  0x0024 -> DOLLAR SIGN
    '%'        #  0x0025 -> PERCENT SIGN
    '&'        #  0x0026 -> AMPERSAND
    "'"        #  0x0027 -> APOSTROPHE
    '('        #  0x0028 -> LEFT PARENTHESIS
    ')'        #  0x0029 -> RIGHT PARENTHESIS
    '*'        #  0x002a -> ASTERISK
    '+'        #  0x002b -> PLUS SIGN
    ','        #  0x002c -> COMMA
    '-'        #  0x002d -> HYPHEN-MINUS
    '.'        #  0x002e -> FULL STOP
    '/'        #  0x002f -> SOLIDUS
    '0'        #  0x0030 -> DIGIT ZERO
    '1'        #  0x0031 -> DIGIT ONE
    '2'        #  0x0032 -> DIGIT TWO
    '3'        #  0x0033 -> DIGIT THREE
    '4'        #  0x0034 -> DIGIT FOUR
    '5'        #  0x0035 -> DIGIT FIVE
    '6'        #  0x0036 -> DIGIT SIX
    '7'        #  0x0037 -> DIGIT SEVEN
    '8'        #  0x0038 -> DIGIT EIGHT
    '9'        #  0x0039 -> DIGIT NINE
    ':'        #  0x003a -> COLON
    ';'        #  0x003b -> SEMICOLON
    '<'        #  0x003c -> LESS-THAN SIGN
    '='        #  0x003d -> EQUALS SIGN
    '>'        #  0x003e -> GREATER-THAN SIGN
    '?'        #  0x003f -> QUESTION MARK
    '@'        #  0x0040 -> COMMERCIAL AT
    'A'        #  0x0041 -> LATIN CAPITAL LETTER A
    'B'        #  0x0042 -> LATIN CAPITAL LETTER B
    'C'        #  0x0043 -> LATIN CAPITAL LETTER C
    'D'        #  0x0044 -> LATIN CAPITAL LETTER D
    'E'        #  0x0045 -> LATIN CAPITAL LETTER E
    'F'        #  0x0046 -> LATIN CAPITAL LETTER F
    'G'        #  0x0047 -> LATIN CAPITAL LETTER G
    'H'        #  0x0048 -> LATIN CAPITAL LETTER H
    'I'        #  0x0049 -> LATIN CAPITAL LETTER I
    'J'        #  0x004a -> LATIN CAPITAL LETTER J
    'K'        #  0x004b -> LATIN CAPITAL LETTER K
    'L'        #  0x004c -> LATIN CAPITAL LETTER L
    'M'        #  0x004d -> LATIN CAPITAL LETTER M
    'N'        #  0x004e -> LATIN CAPITAL LETTER N
    'O'        #  0x004f -> LATIN CAPITAL LETTER O
    'P'        #  0x0050 -> LATIN CAPITAL LETTER P
    'Q'        #  0x0051 -> LATIN CAPITAL LETTER Q
    'R'        #  0x0052 -> LATIN CAPITAL LETTER R
    'S'        #  0x0053 -> LATIN CAPITAL LETTER S
    'T'        #  0x0054 -> LATIN CAPITAL LETTER T
    'U'        #  0x0055 -> LATIN CAPITAL LETTER U
    'V'        #  0x0056 -> LATIN CAPITAL LETTER V
    'W'        #  0x0057 -> LATIN CAPITAL LETTER W
    'X'        #  0x0058 -> LATIN CAPITAL LETTER X
    'Y'        #  0x0059 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x005a -> LATIN CAPITAL LETTER Z
    '['        #  0x005b -> LEFT SQUARE BRACKET
    '\\'       #  0x005c -> REVERSE SOLIDUS
    ']'        #  0x005d -> RIGHT SQUARE BRACKET
    '^'        #  0x005e -> CIRCUMFLEX ACCENT
    '_'        #  0x005f -> LOW LINE
    '`'        #  0x0060 -> GRAVE ACCENT
    'a'        #  0x0061 -> LATIN SMALL LETTER A
    'b'        #  0x0062 -> LATIN SMALL LETTER B
    'c'        #  0x0063 -> LATIN SMALL LETTER C
    'd'        #  0x0064 -> LATIN SMALL LETTER D
    'e'        #  0x0065 -> LATIN SMALL LETTER E
    'f'        #  0x0066 -> LATIN SMALL LETTER F
    'g'        #  0x0067 -> LATIN SMALL LETTER G
    'h'        #  0x0068 -> LATIN SMALL LETTER H
    'i'        #  0x0069 -> LATIN SMALL LETTER I
    'j'        #  0x006a -> LATIN SMALL LETTER J
    'k'        #  0x006b -> LATIN SMALL LETTER K
    'l'        #  0x006c -> LATIN SMALL LETTER L
    'm'        #  0x006d -> LATIN SMALL LETTER M
    'n'        #  0x006e -> LATIN SMALL LETTER N
    'o'        #  0x006f -> LATIN SMALL LETTER O
    'p'        #  0x0070 -> LATIN SMALL LETTER P
    'q'        #  0x0071 -> LATIN SMALL LETTER Q
    'r'        #  0x0072 -> LATIN SMALL LETTER R
    's'        #  0x0073 -> LATIN SMALL LETTER S
    't'        #  0x0074 -> LATIN SMALL LETTER T
    'u'        #  0x0075 -> LATIN SMALL LETTER U
    'v'        #  0x0076 -> LATIN SMALL LETTER V
    'w'        #  0x0077 -> LATIN SMALL LETTER W
    'x'        #  0x0078 -> LATIN SMALL LETTER X
    'y'        #  0x0079 -> LATIN SMALL LETTER Y
    'z'        #  0x007a -> LATIN SMALL LETTER Z
    '{'        #  0x007b -> LEFT CURLY BRACKET
    '|'        #  0x007c -> VERTICAL LINE
    '}'        #  0x007d -> RIGHT CURLY BRACKET
    '~'        #  0x007e -> TILDE
    '\x7f'     #  0x007f -> DELETE
    '\u0410'   #  0x0080 -> CYRILLIC CAPITAL LETTER A
    '\u0411'   #  0x0081 -> CYRILLIC CAPITAL LETTER BE
    '\u0412'   #  0x0082 -> CYRILLIC CAPITAL LETTER VE
    '\u0413'   #  0x0083 -> CYRILLIC CAPITAL LETTER GHE
    '\u0414'   #  0x0084 -> CYRILLIC CAPITAL LETTER DE
    '\u0415'   #  0x0085 -> CYRILLIC CAPITAL LETTER IE
    '\u0416'   #  0x0086 -> CYRILLIC CAPITAL LETTER ZHE
    '\u0417'   #  0x0087 -> CYRILLIC CAPITAL LETTER ZE
    '\u0418'   #  0x0088 -> CYRILLIC CAPITAL LETTER I
    '\u0419'   #  0x0089 -> CYRILLIC CAPITAL LETTER SHORT I
    '\u041a'   #  0x008a -> CYRILLIC CAPITAL LETTER KA
    '\u041b'   #  0x008b -> CYRILLIC CAPITAL LETTER EL
    '\u041c'   #  0x008c -> CYRILLIC CAPITAL LETTER EM
    '\u041d'   #  0x008d -> CYRILLIC CAPITAL LETTER EN
    '\u041e'   #  0x008e -> CYRILLIC CAPITAL LETTER O
    '\u041f'   #  0x008f -> CYRILLIC CAPITAL LETTER PE
    '\u0420'   #  0x0090 -> CYRILLIC CAPITAL LETTER ER
    '\u0421'   #  0x0091 -> CYRILLIC CAPITAL LETTER ES
    '\u0422'   #  0x0092 -> CYRILLIC CAPITAL LETTER TE
    '\u0423'   #  0x0093 -> CYRILLIC CAPITAL LETTER U
    '\u0424'   #  0x0094 -> CYRILLIC CAPITAL LETTER EF
    '\u0425'   #  0x0095 -> CYRILLIC CAPITAL LETTER HA
    '\u0426'   #  0x0096 -> CYRILLIC CAPITAL LETTER TSE
    '\u0427'   #  0x0097 -> CYRILLIC CAPITAL LETTER CHE
    '\u0428'   #  0x0098 -> CYRILLIC CAPITAL LETTER SHA
    '\u0429'   #  0x0099 -> CYRILLIC CAPITAL LETTER SHCHA
    '\u042a'   #  0x009a -> CYRILLIC CAPITAL LETTER HARD SIGN
    '\u042b'   #  0x009b -> CYRILLIC CAPITAL LETTER YERU
    '\u042c'   #  0x009c -> CYRILLIC CAPITAL LETTER SOFT SIGN
    '\u042d'   #  0x009d -> CYRILLIC CAPITAL LETTER E
    '\u042e'   #  0x009e -> CYRILLIC CAPITAL LETTER YU
    '\u042f'   #  0x009f -> CYRILLIC CAPITAL LETTER YA
    '\u0430'   #  0x00a0 -> CYRILLIC SMALL LETTER A
    '\u0431'   #  0x00a1 -> CYRILLIC SMALL LETTER BE
    '\u0432'   #  0x00a2 -> CYRILLIC SMALL LETTER VE
    '\u0433'   #  0x00a3 -> CYRILLIC SMALL LETTER GHE
    '\u0434'   #  0x00a4 -> CYRILLIC SMALL LETTER DE
    '\u0435'   #  0x00a5 -> CYRILLIC SMALL LETTER IE
    '\u0436'   #  0x00a6 -> CYRILLIC SMALL LETTER ZHE
    '\u0437'   #  0x00a7 -> CYRILLIC SMALL LETTER ZE
    '\u0438'   #  0x00a8 -> CYRILLIC SMALL LETTER I
    '\u0439'   #  0x00a9 -> CYRILLIC SMALL LETTER SHORT I
    '\u043a'   #  0x00aa -> CYRILLIC SMALL LETTER KA
    '\u043b'   #  0x00ab -> CYRILLIC SMALL LETTER EL
    '\u043c'   #  0x00ac -> CYRILLIC SMALL LETTER EM
    '\u043d'   #  0x00ad -> CYRILLIC SMALL LETTER EN
    '\u043e'   #  0x00ae -> CYRILLIC SMALL LETTER O
    '\u043f'   #  0x00af -> CYRILLIC SMALL LETTER PE
    '\u2591'   #  0x00b0 -> LIGHT SHADE
    '\u2592'   #  0x00b1 -> MEDIUM SHADE
    '\u2593'   #  0x00b2 -> DARK SHADE
    '\u2502'   #  0x00b3 -> BOX DRAWINGS LIGHT VERTICAL
    '\u2524'   #  0x00b4 -> BOX DRAWINGS LIGHT VERTICAL AND LEFT
    '\u2561'   #  0x00b5 -> BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
    '\u2562'   #  0x00b6 -> BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
    '\u2556'   #  0x00b7 -> BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
    '\u2555'   #  0x00b8 -> BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
    '\u2563'   #  0x00b9 -> BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    '\u2551'   #  0x00ba -> BOX DRAWINGS DOUBLE VERTICAL
    '\u2557'   #  0x00bb -> BOX DRAWINGS DOUBLE DOWN AND LEFT
    '\u255d'   #  0x00bc -> BOX DRAWINGS DOUBLE UP AND LEFT
    '\u255c'   #  0x00bd -> BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
    '\u255b'   #  0x00be -> BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
    '\u2510'   #  0x00bf -> BOX DRAWINGS LIGHT DOWN AND LEFT
    '\u2514'   #  0x00c0 -> BOX DRAWINGS LIGHT UP AND RIGHT
    '\u2534'   #  0x00c1 -> BOX DRAWINGS LIGHT UP AND HORIZONTAL
    '\u252c'   #  0x00c2 -> BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    '\u251c'   #  0x00c3 -> BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    '\u2500'   #  0x00c4 -> BOX DRAWINGS LIGHT HORIZONTAL
    '\u253c'   #  0x00c5 -> BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    '\u255e'   #  0x00c6 -> BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
    '\u255f'   #  0x00c7 -> BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
    '\u255a'   #  0x00c8 -> BOX DRAWINGS DOUBLE UP AND RIGHT
    '\u2554'   #  0x00c9 -> BOX DRAWINGS DOUBLE DOWN AND RIGHT
    '\u2569'   #  0x00ca -> BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    '\u2566'   #  0x00cb -> BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    '\u2560'   #  0x00cc -> BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    '\u2550'   #  0x00cd -> BOX DRAWINGS DOUBLE HORIZONTAL
    '\u256c'   #  0x00ce -> BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    '\u2567'   #  0x00cf -> BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
    '\u2568'   #  0x00d0 -> BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
    '\u2564'   #  0x00d1 -> BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
    '\u2565'   #  0x00d2 -> BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
    '\u2559'   #  0x00d3 -> BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
    '\u2558'   #  0x00d4 -> BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
    '\u2552'   #  0x00d5 -> BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
    '\u2553'   #  0x00d6 -> BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
    '\u256b'   #  0x00d7 -> BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
    '\u256a'   #  0x00d8 -> BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
    '\u2518'   #  0x00d9 -> BOX DRAWINGS LIGHT UP AND LEFT
    '\u250c'   #  0x00da -> BOX DRAWINGS LIGHT DOWN AND RIGHT
    '\u2588'   #  0x00db -> FULL BLOCK
    '\u2584'   #  0x00dc -> LOWER HALF BLOCK
    '\u258c'   #  0x00dd -> LEFT HALF BLOCK
    '\u2590'   #  0x00de -> RIGHT HALF BLOCK
    '\u2580'   #  0x00df -> UPPER HALF BLOCK
    '\u0440'   #  0x00e0 -> CYRILLIC SMALL LETTER ER
    '\u0441'   #  0x00e1 -> CYRILLIC SMALL LETTER ES
    '\u0442'   #  0x00e2 -> CYRILLIC SMALL LETTER TE
    '\u0443'   #  0x00e3 -> CYRILLIC SMALL LETTER U
    '\u0444'   #  0x00e4 -> CYRILLIC SMALL LETTER EF
    '\u0445'   #  0x00e5 -> CYRILLIC SMALL LETTER HA
    '\u0446'   #  0x00e6 -> CYRILLIC SMALL LETTER TSE
    '\u0447'   #  0x00e7 -> CYRILLIC SMALL LETTER CHE
    '\u0448'   #  0x00e8 -> CYRILLIC SMALL LETTER SHA
    '\u0449'   #  0x00e9 -> CYRILLIC SMALL LETTER SHCHA
    '\u044a'   #  0x00ea -> CYRILLIC SMALL LETTER HARD SIGN
    '\u044b'   #  0x00eb -> CYRILLIC SMALL LETTER YERU
    '\u044c'   #  0x00ec -> CYRILLIC SMALL LETTER SOFT SIGN
    '\u044d'   #  0x00ed -> CYRILLIC SMALL LETTER E
    '\u044e'   #  0x00ee -> CYRILLIC SMALL LETTER YU
    '\u044f'   #  0x00ef -> CYRILLIC SMALL LETTER YA
    '\u0401'   #  0x00f0 -> CYRILLIC CAPITAL LETTER IO
    '\u0451'   #  0x00f1 -> CYRILLIC SMALL LETTER IO
    '\u0490'   #  0x00f2 -> CYRILLIC CAPITAL LETTER GHE WITH UPTURN
    '\u0491'   #  0x00f3 -> CYRILLIC SMALL LETTER GHE WITH UPTURN
    '\u0404'   #  0x00f4 -> CYRILLIC CAPITAL LETTER UKRAINIAN IE
    '\u0454'   #  0x00f5 -> CYRILLIC SMALL LETTER UKRAINIAN IE
    '\u0406'   #  0x00f6 -> CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
    '\u0456'   #  0x00f7 -> CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
    '\u0407'   #  0x00f8 -> CYRILLIC CAPITAL LETTER YI
    '\u0457'   #  0x00f9 -> CYRILLIC SMALL LETTER YI
    '\xb7'     #  0x00fa -> MIDDLE DOT
    '\u221a'   #  0x00fb -> SQUARE ROOT
    '\u2116'   #  0x00fc -> NUMERO SIGN
    '\xa4'     #  0x00fd -> CURRENCY SIGN
    '\u25a0'   #  0x00fe -> BLACK SQUARE
    '\xa0'     #  0x00ff -> NO-BREAK SPACE
)

### Encoding Map

encoding_map = {
    0x0000: 0x0000,     #  NULL
    0x0001: 0x0001,     #  START OF HEADING
    0x0002: 0x0002,     #  START OF TEXT
    0x0003: 0x0003,     #  END OF TEXT
    0x0004: 0x0004,     #  END OF TRANSMISSION
    0x0005: 0x0005,     #  ENQUIRY
    0x0006: 0x0006,     #  ACKNOWLEDGE
    0x0007: 0x0007,     #  BELL
    0x0008: 0x0008,     #  BACKSPACE
    0x0009: 0x0009,     #  HORIZONTAL TABULATION
    0x000a: 0x000a,     #  LINE FEED
    0x000b: 0x000b,     #  VERTICAL TABULATION
    0x000c: 0x000c,     #  FORM FEED
    0x000d: 0x000d,     #  CARRIAGE RETURN
    0x000e: 0x000e,     #  SHIFT OUT
    0x000f: 0x000f,     #  SHIFT IN
    0x0010: 0x0010,     #  DATA LINK ESCAPE
    0x0011: 0x0011,     #  DEVICE CONTROL ONE
    0x0012: 0x0012,     #  DEVICE CONTROL TWO
    0x0013: 0x0013,     #  DEVICE CONTROL THREE
    0x0014: 0x0014,     #  DEVICE CONTROL FOUR
    0x0015: 0x0015,     #  NEGATIVE ACKNOWLEDGE
    0x0016: 0x0016,     #  SYNCHRONOUS IDLE
    0x0017: 0x0017,     #  END OF TRANSMISSION BLOCK
    0x0018: 0x0018,     #  CANCEL
    0x0019: 0x0019,     #  END OF MEDIUM
    0x001a: 0x001a,     #  SUBSTITUTE
    0x001b: 0x001b,     #  ESCAPE
    0x001c: 0x001c,     #  FILE SEPARATOR
    0x001d: 0x001d,     #  GROUP SEPARATOR
    0x001e: 0x001e,     #  RECORD SEPARATOR
    0x001f: 0x001f,     #  UNIT SEPARATOR
    0x0020: 0x0020,     #  SPACE
    0x0021: 0x0021,     #  EXCLAMATION MARK
    0x0022: 0x0022,     #  QUOTATION MARK
    0x0023: 0x0023,     #  NUMBER SIGN
    0x0024: 0x0024,     #  DOLLAR SIGN
    0x0025: 0x0025,     #  PERCENT SIGN
    0x0026: 0x0026,     #  AMPERSAND
    0x0027: 0x0027,     #  APOSTROPHE
    0x0028: 0x0028,     #  LEFT PARENTHESIS
    0x0029: 0x0029,     #  RIGHT PARENTHESIS
    0x002a: 0x002a,     #  ASTERISK
    0x002b: 0x002b,     #  PLUS SIGN
    0x002c: 0x002c,     #  COMMA
    0x002d: 0x002d,     #  HYPHEN-MINUS
    0x002e: 0x002e,     #  FULL STOP
    0x002f: 0x002f,     #  SOLIDUS
    0x0030: 0x0030,     #  DIGIT ZERO
    0x0031: 0x0031,     #  DIGIT ONE
    0x0032: 0x0032,     #  DIGIT TWO
    0x0033: 0x0033,     #  DIGIT THREE
    0x0034: 0x0034,     #  DIGIT FOUR
    0x0035: 0x0035,     #  DIGIT FIVE
    0x0036: 0x0036,     #  DIGIT SIX
    0x0037: 0x0037,     #  DIGIT SEVEN
    0x0038: 0x0038,     #  DIGIT EIGHT
    0x0039: 0x0039,     #  DIGIT NINE
    0x003a: 0x003a,     #  COLON
    0x003b: 0x003b,     #  SEMICOLON
    0x003c: 0x003c,     #  LESS-THAN SIGN
    0x003d: 0x003d,     #  EQUALS SIGN
    0x003e: 0x003e,     #  GREATER-THAN SIGN
    0x003f: 0x003f,     #  QUESTION MARK
    0x0040: 0x0040,     #  COMMERCIAL AT
    0x0041: 0x0041,     #  LATIN CAPITAL LETTER A
    0x0042: 0x0042,     #  LATIN CAPITAL LETTER B
    0x0043: 0x0043,     #  LATIN CAPITAL LETTER C
    0x0044: 0x0044,     #  LATIN CAPITAL LETTER D
    0x0045: 0x0045,     #  LATIN CAPITAL LETTER E
    0x0046: 0x0046,     #  LATIN CAPITAL LETTER F
    0x0047: 0x0047,     #  LATIN CAPITAL LETTER G
    0x0048: 0x0048,     #  LATIN CAPITAL LETTER H
    0x0049: 0x0049,     #  LATIN CAPITAL LETTER I
    0x004a: 0x004a,     #  LATIN CAPITAL LETTER J
    0x004b: 0x004b,     #  LATIN CAPITAL LETTER K
    0x004c: 0x004c,     #  LATIN CAPITAL LETTER L
    0x004d: 0x004d,     #  LATIN CAPITAL LETTER M
    0x004e: 0x004e,     #  LATIN CAPITAL LETTER N
    0x004f: 0x004f,     #  LATIN CAPITAL LETTER O
    0x0050: 0x0050,     #  LATIN CAPITAL LETTER P
    0x0051: 0x0051,     #  LATIN CAPITAL LETTER Q
    0x0052: 0x0052,     #  LATIN CAPITAL LETTER R
    0x0053: 0x0053,     #  LATIN CAPITAL LETTER S
    0x0054: 0x0054,     #  LATIN CAPITAL LETTER T
    0x0055: 0x0055,     #  LATIN CAPITAL LETTER U
    0x0056: 0x0056,     #  LATIN CAPITAL LETTER V
    0x0057: 0x0057,     #  LATIN CAPITAL LETTER W
    0x0058: 0x0058,     #  LATIN CAPITAL LETTER X
    0x0059: 0x0059,     #  LATIN CAPITAL LETTER Y
    0x005a: 0x005a,     #  LATIN CAPITAL LETTER Z
    0x005b: 0x005b,     #  LEFT SQUARE BRACKET
    0x005c: 0x005c,     #  REVERSE SOLIDUS
    0x005d: 0x005d,     #  RIGHT SQUARE BRACKET
    0x005e: 0x005e,     #  CIRCUMFLEX ACCENT
    0x005f: 0x005f,     #  LOW LINE
    0x0060: 0x0060,     #  GRAVE ACCENT
    0x0061: 0x0061,     #  LATIN SMALL LETTER A
    0x0062: 0x0062,     #  LATIN SMALL LETTER B
    0x0063: 0x0063,     #  LATIN SMALL LETTER C
    0x0064: 0x0064,     #  LATIN SMALL LETTER D
    0x0065: 0x0065,     #  LATIN SMALL LETTER E
    0x0066: 0x0066,     #  LATIN SMALL LETTER F
    0x0067: 0x0067,     #  LATIN SMALL LETTER G
    0x0068: 0x0068,     #  LATIN SMALL LETTER H
    0x0069: 0x0069,     #  LATIN SMALL LETTER I
    0x006a: 0x006a,     #  LATIN SMALL LETTER J
    0x006b: 0x006b,     #  LATIN SMALL LETTER K
    0x006c: 0x006c,     #  LATIN SMALL LETTER L
    0x006d: 0x006d,     #  LATIN SMALL LETTER M
    0x006e: 0x006e,     #  LATIN SMALL LETTER N
    0x006f: 0x006f,     #  LATIN SMALL LETTER O
    0x0070: 0x0070,     #  LATIN SMALL LETTER P
    0x0071: 0x0071,     #  LATIN SMALL LETTER Q
    0x0072: 0x0072,     #  LATIN SMALL LETTER R
    0x0073: 0x0073,     #  LATIN SMALL LETTER S
    0x0074: 0x0074,     #  LATIN SMALL LETTER T
    0x0075: 0x0075,     #  LATIN SMALL LETTER U
    0x0076: 0x0076,     #  LATIN SMALL LETTER V
    0x0077: 0x0077,     #  LATIN SMALL LETTER W
    0x0078: 0x0078,     #  LATIN SMALL LETTER X
    0x0079: 0x0079,     #  LATIN SMALL LETTER Y
    0x007a: 0x007a,     #  LATIN SMALL LETTER Z
    0x007b: 0x007b,     #  LEFT CURLY BRACKET
    0x007c: 0x007c,     #  VERTICAL LINE
    0x007d: 0x007d,     #  RIGHT CURLY BRACKET
    0x007e: 0x007e,     #  TILDE
    0x007f: 0x007f,     #  DELETE
    0x00a0: 0x00ff,     #  NO-BREAK SPACE
    0x00a4: 0x00fd,     #  CURRENCY SIGN
    0x00b7: 0x00fa,     #  MIDDLE DOT
    0x0401: 0x00f0,     #  CYRILLIC CAPITAL LETTER IO
    0x0404: 0x00f4,     #  CYRILLIC CAPITAL LETTER UKRAINIAN IE
    0x0406: 0x00f6,     #  CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
    0x0407: 0x00f8,     #  CYRILLIC CAPITAL LETTER YI
    0x0410: 0x0080,     #  CYRILLIC CAPITAL LETTER A
    0x0411: 0x0081,     #  CYRILLIC CAPITAL LETTER BE
    0x0412: 0x0082,     #  CYRILLIC CAPITAL LETTER VE
    0x0413: 0x0083,     #  CYRILLIC CAPITAL LETTER GHE
    0x0414: 0x0084,     #  CYRILLIC CAPITAL LETTER DE
    0x0415: 0x0085,     #  CYRILLIC CAPITAL LETTER IE
    0x0416: 0x0086,     #  CYRILLIC CAPITAL LETTER ZHE
    0x0417: 0x0087,     #  CYRILLIC CAPITAL LETTER ZE
    0x0418: 0x0088,     #  CYRILLIC CAPITAL LETTER I
    0x0419: 0x0089,     #  CYRILLIC CAPITAL LETTER SHORT I
    0x041a: 0x008a,     #  CYRILLIC CAPITAL LETTER KA
    0x041b: 0x008b,     #  CYRILLIC CAPITAL LETTER EL
    0x041c: 0x008c,     #  CYRILLIC CAPITAL LETTER EM
    0x041d: 0x008d,     #  CYRILLIC CAPITAL LETTER EN
    0x041e: 0x008e,     #  CYRILLIC CAPITAL LETTER O
    0x041f: 0x008f,     #  CYRILLIC CAPITAL LETTER PE
    0x0420: 0x0090,     #  CYRILLIC CAPITAL LETTER ER
    0x0421: 0x0091,     #  CYRILLIC CAPITAL LETTER ES
    0x0422: 0x0092,     #  CYRILLIC CAPITAL LETTER TE
    0x0423: 0x0093,     #  CYRILLIC CAPITAL LETTER U
    0x0424: 0x0094,     #  CYRILLIC CAPITAL LETTER EF
    0x0425: 0x0095,     #  CYRILLIC CAPITAL LETTER HA
    0x0426: 0x0096,     #  CYRILLIC CAPITAL LETTER TSE
    0x0427: 0x0097,     #  CYRILLIC CAPITAL LETTER CHE
    0x0428: 0x0098,     #  CYRILLIC CAPITAL LETTER SHA
    0x0429: 0x0099,     #  CYRILLIC CAPITAL LETTER SHCHA
    0x042a: 0x009a,     #  CYRILLIC CAPITAL LETTER HARD SIGN
    0x042b: 0x009b,     #  CYRILLIC CAPITAL LETTER YERU
    0x042c: 0x009c,     #  CYRILLIC CAPITAL LETTER SOFT SIGN
    0x042d: 0x009d,     #  CYRILLIC CAPITAL LETTER E
    0x042e: 0x009e,     #  CYRILLIC CAPITAL LETTER YU
    0x042f: 0x009f,     #  CYRILLIC CAPITAL LETTER YA
    0x0430: 0x00a0,     #  CYRILLIC SMALL LETTER A
    0x0431: 0x00a1,     #  CYRILLIC SMALL LETTER BE
    0x0432: 0x00a2,     #  CYRILLIC SMALL LETTER VE
    0x0433: 0x00a3,     #  CYRILLIC SMALL LETTER GHE
    0x0434: 0x00a4,     #  CYRILLIC SMALL LETTER DE
    0x0435: 0x00a5,     #  CYRILLIC SMALL LETTER IE
    0x0436: 0x00a6,     #  CYRILLIC SMALL LETTER ZHE
    0x0437: 0x00a7,     #  CYRILLIC SMALL LETTER ZE
    0x0438: 0x00a8,     #  CYRILLIC SMALL LETTER I
    0x0439: 0x00a9,     #  CYRILLIC SMALL LETTER SHORT I
    0x043a: 0x00aa,     #  CYRILLIC SMALL LETTER KA
    0x043b: 0x00ab,     #  CYRILLIC SMALL LETTER EL
    0x043c: 0x00ac,     #  CYRILLIC SMALL LETTER EM
    0x043d: 0x00ad,     #  CYRILLIC SMALL LETTER EN
    0x043e: 0x00ae,     #  CYRILLIC SMALL LETTER O
    0x043f: 0x00af,     #  CYRILLIC SMALL LETTER PE
    0x0440: 0x00e0,     #  CYRILLIC SMALL LETTER ER
    0x0441: 0x00e1,     #  CYRILLIC SMALL LETTER ES
    0x0442: 0x00e2,     #  CYRILLIC SMALL LETTER TE
    0x0443: 0x00e3,     #  CYRILLIC SMALL LETTER U
    0x0444: 0x00e4,     #  CYRILLIC SMALL LETTER EF
    0x0445: 0x00e5,     #  CYRILLIC SMALL LETTER HA
    0x0446: 0x00e6,     #  CYRILLIC SMALL LETTER TSE
    0x0447: 0x00e7,     #  CYRILLIC SMALL LETTER CHE
    0x0448: 0x00e8,     #  CYRILLIC SMALL LETTER SHA
    0x0449: 0x00e9,     #  CYRILLIC SMALL LETTER SHCHA
    0x044a: 0x00ea,     #  CYRILLIC SMALL LETTER HARD SIGN
    0x044b: 0x00eb,     #  CYRILLIC SMALL LETTER YERU
    0x044c: 0x00ec,     #  CYRILLIC SMALL LETTER SOFT SIGN
    0x044d: 0x00ed,     #  CYRILLIC SMALL LETTER E
    0x044e: 0x00ee,     #  CYRILLIC SMALL LETTER YU
    0x044f: 0x00ef,     #  CYRILLIC SMALL LETTER YA
    0x0451: 0x00f1,     #  CYRILLIC SMALL LETTER IO
    0x0454: 0x00f5,     #  CYRILLIC SMALL LETTER UKRAINIAN IE
    0x0456: 0x00f7,     #  CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
    0x0457: 0x00f9,     #  CYRILLIC SMALL LETTER YI
    0x0490: 0x00f2,     #  CYRILLIC CAPITAL LETTER GHE WITH UPTURN
    0x0491: 0x00f3,     #  CYRILLIC SMALL LETTER GHE WITH UPTURN
    0x2116: 0x00fc,     #  NUMERO SIGN
    0x221a: 0x00fb,     #  SQUARE ROOT
    0x2500: 0x00c4,     #  BOX DRAWINGS LIGHT HORIZONTAL
    0x2502: 0x00b3,     #  BOX DRAWINGS LIGHT VERTICAL
    0x250c: 0x00da,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
    0x2510: 0x00bf,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
    0x2514: 0x00c0,     #  BOX DRAWINGS LIGHT UP AND RIGHT
    0x2518: 0x00d9,     #  BOX DRAWINGS LIGHT UP AND LEFT
    0x251c: 0x00c3,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    0x2524: 0x00b4,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
    0x252c: 0x00c2,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    0x2534: 0x00c1,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
    0x253c: 0x00c5,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    0x2550: 0x00cd,     #  BOX DRAWINGS DOUBLE HORIZONTAL
    0x2551: 0x00ba,     #  BOX DRAWINGS DOUBLE VERTICAL
    0x2552: 0x00d5,     #  BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
    0x2553: 0x00d6,     #  BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
    0x2554: 0x00c9,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
    0x2555: 0x00b8,     #  BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
    0x2556: 0x00b7,     #  BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
    0x2557: 0x00bb,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
    0x2558: 0x00d4,     #  BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
    0x2559: 0x00d3,     #  BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
    0x255a: 0x00c8,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
    0x255b: 0x00be,     #  BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
    0x255c: 0x00bd,     #  BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
    0x255d: 0x00bc,     #  BOX DRAWINGS DOUBLE UP AND LEFT
    0x255e: 0x00c6,     #  BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
    0x255f: 0x00c7,     #  BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
    0x2560: 0x00cc,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    0x2561: 0x00b5,     #  BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
    0x2562: 0x00b6,     #  BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
    0x2563: 0x00b9,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    0x2564: 0x00d1,     #  BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
    0x2565: 0x00d2,     #  BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
    0x2566: 0x00cb,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    0x2567: 0x00cf,     #  BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
    0x2568: 0x00d0,     #  BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
    0x2569: 0x00ca,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    0x256a: 0x00d8,     #  BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
    0x256b: 0x00d7,     #  BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
    0x256c: 0x00ce,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    0x2580: 0x00df,     #  UPPER HALF BLOCK
    0x2584: 0x00dc,     #  LOWER HALF BLOCK
    0x2588: 0x00db,     #  FULL BLOCK
    0x258c: 0x00dd,     #  LEFT HALF BLOCK
    0x2590: 0x00de,     #  RIGHT HALF BLOCK
    0x2591: 0x00b0,     #  LIGHT SHADE
    0x2592: 0x00b1,     #  MEDIUM SHADE
    0x2593: 0x00b2,     #  DARK SHADE
    0x25a0: 0x00fe,     #  BLACK SQUARE
}
encodings/cp737.py000064400000103571151153537610007750 0ustar00""" Python Character Mapping Codec cp737 generated from 'VENDORS/MICSFT/PC/CP737.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_map)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_map)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp737',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )

### Decoding Map

decoding_map = codecs.make_identity_dict(range(256))
decoding_map.update({
    0x0080: 0x0391,     #  GREEK CAPITAL LETTER ALPHA
    0x0081: 0x0392,     #  GREEK CAPITAL LETTER BETA
    0x0082: 0x0393,     #  GREEK CAPITAL LETTER GAMMA
    0x0083: 0x0394,     #  GREEK CAPITAL LETTER DELTA
    0x0084: 0x0395,     #  GREEK CAPITAL LETTER EPSILON
    0x0085: 0x0396,     #  GREEK CAPITAL LETTER ZETA
    0x0086: 0x0397,     #  GREEK CAPITAL LETTER ETA
    0x0087: 0x0398,     #  GREEK CAPITAL LETTER THETA
    0x0088: 0x0399,     #  GREEK CAPITAL LETTER IOTA
    0x0089: 0x039a,     #  GREEK CAPITAL LETTER KAPPA
    0x008a: 0x039b,     #  GREEK CAPITAL LETTER LAMDA
    0x008b: 0x039c,     #  GREEK CAPITAL LETTER MU
    0x008c: 0x039d,     #  GREEK CAPITAL LETTER NU
    0x008d: 0x039e,     #  GREEK CAPITAL LETTER XI
    0x008e: 0x039f,     #  GREEK CAPITAL LETTER OMICRON
    0x008f: 0x03a0,     #  GREEK CAPITAL LETTER PI
    0x0090: 0x03a1,     #  GREEK CAPITAL LETTER RHO
    0x0091: 0x03a3,     #  GREEK CAPITAL LETTER SIGMA
    0x0092: 0x03a4,     #  GREEK CAPITAL LETTER TAU
    0x0093: 0x03a5,     #  GREEK CAPITAL LETTER UPSILON
    0x0094: 0x03a6,     #  GREEK CAPITAL LETTER PHI
    0x0095: 0x03a7,     #  GREEK CAPITAL LETTER CHI
    0x0096: 0x03a8,     #  GREEK CAPITAL LETTER PSI
    0x0097: 0x03a9,     #  GREEK CAPITAL LETTER OMEGA
    0x0098: 0x03b1,     #  GREEK SMALL LETTER ALPHA
    0x0099: 0x03b2,     #  GREEK SMALL LETTER BETA
    0x009a: 0x03b3,     #  GREEK SMALL LETTER GAMMA
    0x009b: 0x03b4,     #  GREEK SMALL LETTER DELTA
    0x009c: 0x03b5,     #  GREEK SMALL LETTER EPSILON
    0x009d: 0x03b6,     #  GREEK SMALL LETTER ZETA
    0x009e: 0x03b7,     #  GREEK SMALL LETTER ETA
    0x009f: 0x03b8,     #  GREEK SMALL LETTER THETA
    0x00a0: 0x03b9,     #  GREEK SMALL LETTER IOTA
    0x00a1: 0x03ba,     #  GREEK SMALL LETTER KAPPA
    0x00a2: 0x03bb,     #  GREEK SMALL LETTER LAMDA
    0x00a3: 0x03bc,     #  GREEK SMALL LETTER MU
    0x00a4: 0x03bd,     #  GREEK SMALL LETTER NU
    0x00a5: 0x03be,     #  GREEK SMALL LETTER XI
    0x00a6: 0x03bf,     #  GREEK SMALL LETTER OMICRON
    0x00a7: 0x03c0,     #  GREEK SMALL LETTER PI
    0x00a8: 0x03c1,     #  GREEK SMALL LETTER RHO
    0x00a9: 0x03c3,     #  GREEK SMALL LETTER SIGMA
    0x00aa: 0x03c2,     #  GREEK SMALL LETTER FINAL SIGMA
    0x00ab: 0x03c4,     #  GREEK SMALL LETTER TAU
    0x00ac: 0x03c5,     #  GREEK SMALL LETTER UPSILON
    0x00ad: 0x03c6,     #  GREEK SMALL LETTER PHI
    0x00ae: 0x03c7,     #  GREEK SMALL LETTER CHI
    0x00af: 0x03c8,     #  GREEK SMALL LETTER PSI
    0x00b0: 0x2591,     #  LIGHT SHADE
    0x00b1: 0x2592,     #  MEDIUM SHADE
    0x00b2: 0x2593,     #  DARK SHADE
    0x00b3: 0x2502,     #  BOX DRAWINGS LIGHT VERTICAL
    0x00b4: 0x2524,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
    0x00b5: 0x2561,     #  BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
    0x00b6: 0x2562,     #  BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
    0x00b7: 0x2556,     #  BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
    0x00b8: 0x2555,     #  BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
    0x00b9: 0x2563,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    0x00ba: 0x2551,     #  BOX DRAWINGS DOUBLE VERTICAL
    0x00bb: 0x2557,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
    0x00bc: 0x255d,     #  BOX DRAWINGS DOUBLE UP AND LEFT
    0x00bd: 0x255c,     #  BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
    0x00be: 0x255b,     #  BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
    0x00bf: 0x2510,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
    0x00c0: 0x2514,     #  BOX DRAWINGS LIGHT UP AND RIGHT
    0x00c1: 0x2534,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
    0x00c2: 0x252c,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    0x00c3: 0x251c,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    0x00c4: 0x2500,     #  BOX DRAWINGS LIGHT HORIZONTAL
    0x00c5: 0x253c,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    0x00c6: 0x255e,     #  BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
    0x00c7: 0x255f,     #  BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
    0x00c8: 0x255a,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
    0x00c9: 0x2554,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
    0x00ca: 0x2569,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    0x00cb: 0x2566,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    0x00cc: 0x2560,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    0x00cd: 0x2550,     #  BOX DRAWINGS DOUBLE HORIZONTAL
    0x00ce: 0x256c,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    0x00cf: 0x2567,     #  BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
    0x00d0: 0x2568,     #  BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
    0x00d1: 0x2564,     #  BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
    0x00d2: 0x2565,     #  BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
    0x00d3: 0x2559,     #  BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
    0x00d4: 0x2558,     #  BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
    0x00d5: 0x2552,     #  BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
    0x00d6: 0x2553,     #  BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
    0x00d7: 0x256b,     #  BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
    0x00d8: 0x256a,     #  BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
    0x00d9: 0x2518,     #  BOX DRAWINGS LIGHT UP AND LEFT
    0x00da: 0x250c,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
    0x00db: 0x2588,     #  FULL BLOCK
    0x00dc: 0x2584,     #  LOWER HALF BLOCK
    0x00dd: 0x258c,     #  LEFT HALF BLOCK
    0x00de: 0x2590,     #  RIGHT HALF BLOCK
    0x00df: 0x2580,     #  UPPER HALF BLOCK
    0x00e0: 0x03c9,     #  GREEK SMALL LETTER OMEGA
    0x00e1: 0x03ac,     #  GREEK SMALL LETTER ALPHA WITH TONOS
    0x00e2: 0x03ad,     #  GREEK SMALL LETTER EPSILON WITH TONOS
    0x00e3: 0x03ae,     #  GREEK SMALL LETTER ETA WITH TONOS
    0x00e4: 0x03ca,     #  GREEK SMALL LETTER IOTA WITH DIALYTIKA
    0x00e5: 0x03af,     #  GREEK SMALL LETTER IOTA WITH TONOS
    0x00e6: 0x03cc,     #  GREEK SMALL LETTER OMICRON WITH TONOS
    0x00e7: 0x03cd,     #  GREEK SMALL LETTER UPSILON WITH TONOS
    0x00e8: 0x03cb,     #  GREEK SMALL LETTER UPSILON WITH DIALYTIKA
    0x00e9: 0x03ce,     #  GREEK SMALL LETTER OMEGA WITH TONOS
    0x00ea: 0x0386,     #  GREEK CAPITAL LETTER ALPHA WITH TONOS
    0x00eb: 0x0388,     #  GREEK CAPITAL LETTER EPSILON WITH TONOS
    0x00ec: 0x0389,     #  GREEK CAPITAL LETTER ETA WITH TONOS
    0x00ed: 0x038a,     #  GREEK CAPITAL LETTER IOTA WITH TONOS
    0x00ee: 0x038c,     #  GREEK CAPITAL LETTER OMICRON WITH TONOS
    0x00ef: 0x038e,     #  GREEK CAPITAL LETTER UPSILON WITH TONOS
    0x00f0: 0x038f,     #  GREEK CAPITAL LETTER OMEGA WITH TONOS
    0x00f1: 0x00b1,     #  PLUS-MINUS SIGN
    0x00f2: 0x2265,     #  GREATER-THAN OR EQUAL TO
    0x00f3: 0x2264,     #  LESS-THAN OR EQUAL TO
    0x00f4: 0x03aa,     #  GREEK CAPITAL LETTER IOTA WITH DIALYTIKA
    0x00f5: 0x03ab,     #  GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA
    0x00f6: 0x00f7,     #  DIVISION SIGN
    0x00f7: 0x2248,     #  ALMOST EQUAL TO
    0x00f8: 0x00b0,     #  DEGREE SIGN
    0x00f9: 0x2219,     #  BULLET OPERATOR
    0x00fa: 0x00b7,     #  MIDDLE DOT
    0x00fb: 0x221a,     #  SQUARE ROOT
    0x00fc: 0x207f,     #  SUPERSCRIPT LATIN SMALL LETTER N
    0x00fd: 0x00b2,     #  SUPERSCRIPT TWO
    0x00fe: 0x25a0,     #  BLACK SQUARE
    0x00ff: 0x00a0,     #  NO-BREAK SPACE
})

### Decoding Table

decoding_table = (
    '\x00'     #  0x0000 -> NULL
    '\x01'     #  0x0001 -> START OF HEADING
    '\x02'     #  0x0002 -> START OF TEXT
    '\x03'     #  0x0003 -> END OF TEXT
    '\x04'     #  0x0004 -> END OF TRANSMISSION
    '\x05'     #  0x0005 -> ENQUIRY
    '\x06'     #  0x0006 -> ACKNOWLEDGE
    '\x07'     #  0x0007 -> BELL
    '\x08'     #  0x0008 -> BACKSPACE
    '\t'       #  0x0009 -> HORIZONTAL TABULATION
    '\n'       #  0x000a -> LINE FEED
    '\x0b'     #  0x000b -> VERTICAL TABULATION
    '\x0c'     #  0x000c -> FORM FEED
    '\r'       #  0x000d -> CARRIAGE RETURN
    '\x0e'     #  0x000e -> SHIFT OUT
    '\x0f'     #  0x000f -> SHIFT IN
    '\x10'     #  0x0010 -> DATA LINK ESCAPE
    '\x11'     #  0x0011 -> DEVICE CONTROL ONE
    '\x12'     #  0x0012 -> DEVICE CONTROL TWO
    '\x13'     #  0x0013 -> DEVICE CONTROL THREE
    '\x14'     #  0x0014 -> DEVICE CONTROL FOUR
    '\x15'     #  0x0015 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x0016 -> SYNCHRONOUS IDLE
    '\x17'     #  0x0017 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x0018 -> CANCEL
    '\x19'     #  0x0019 -> END OF MEDIUM
    '\x1a'     #  0x001a -> SUBSTITUTE
    '\x1b'     #  0x001b -> ESCAPE
    '\x1c'     #  0x001c -> FILE SEPARATOR
    '\x1d'     #  0x001d -> GROUP SEPARATOR
    '\x1e'     #  0x001e -> RECORD SEPARATOR
    '\x1f'     #  0x001f -> UNIT SEPARATOR
    ' '        #  0x0020 -> SPACE
    '!'        #  0x0021 -> EXCLAMATION MARK
    '"'        #  0x0022 -> QUOTATION MARK
    '#'        #  0x0023 -> NUMBER SIGN
    '$'        #  0x0024 -> DOLLAR SIGN
    '%'        #  0x0025 -> PERCENT SIGN
    '&'        #  0x0026 -> AMPERSAND
    "'"        #  0x0027 -> APOSTROPHE
    '('        #  0x0028 -> LEFT PARENTHESIS
    ')'        #  0x0029 -> RIGHT PARENTHESIS
    '*'        #  0x002a -> ASTERISK
    '+'        #  0x002b -> PLUS SIGN
    ','        #  0x002c -> COMMA
    '-'        #  0x002d -> HYPHEN-MINUS
    '.'        #  0x002e -> FULL STOP
    '/'        #  0x002f -> SOLIDUS
    '0'        #  0x0030 -> DIGIT ZERO
    '1'        #  0x0031 -> DIGIT ONE
    '2'        #  0x0032 -> DIGIT TWO
    '3'        #  0x0033 -> DIGIT THREE
    '4'        #  0x0034 -> DIGIT FOUR
    '5'        #  0x0035 -> DIGIT FIVE
    '6'        #  0x0036 -> DIGIT SIX
    '7'        #  0x0037 -> DIGIT SEVEN
    '8'        #  0x0038 -> DIGIT EIGHT
    '9'        #  0x0039 -> DIGIT NINE
    ':'        #  0x003a -> COLON
    ';'        #  0x003b -> SEMICOLON
    '<'        #  0x003c -> LESS-THAN SIGN
    '='        #  0x003d -> EQUALS SIGN
    '>'        #  0x003e -> GREATER-THAN SIGN
    '?'        #  0x003f -> QUESTION MARK
    '@'        #  0x0040 -> COMMERCIAL AT
    'A'        #  0x0041 -> LATIN CAPITAL LETTER A
    'B'        #  0x0042 -> LATIN CAPITAL LETTER B
    'C'        #  0x0043 -> LATIN CAPITAL LETTER C
    'D'        #  0x0044 -> LATIN CAPITAL LETTER D
    'E'        #  0x0045 -> LATIN CAPITAL LETTER E
    'F'        #  0x0046 -> LATIN CAPITAL LETTER F
    'G'        #  0x0047 -> LATIN CAPITAL LETTER G
    'H'        #  0x0048 -> LATIN CAPITAL LETTER H
    'I'        #  0x0049 -> LATIN CAPITAL LETTER I
    'J'        #  0x004a -> LATIN CAPITAL LETTER J
    'K'        #  0x004b -> LATIN CAPITAL LETTER K
    'L'        #  0x004c -> LATIN CAPITAL LETTER L
    'M'        #  0x004d -> LATIN CAPITAL LETTER M
    'N'        #  0x004e -> LATIN CAPITAL LETTER N
    'O'        #  0x004f -> LATIN CAPITAL LETTER O
    'P'        #  0x0050 -> LATIN CAPITAL LETTER P
    'Q'        #  0x0051 -> LATIN CAPITAL LETTER Q
    'R'        #  0x0052 -> LATIN CAPITAL LETTER R
    'S'        #  0x0053 -> LATIN CAPITAL LETTER S
    'T'        #  0x0054 -> LATIN CAPITAL LETTER T
    'U'        #  0x0055 -> LATIN CAPITAL LETTER U
    'V'        #  0x0056 -> LATIN CAPITAL LETTER V
    'W'        #  0x0057 -> LATIN CAPITAL LETTER W
    'X'        #  0x0058 -> LATIN CAPITAL LETTER X
    'Y'        #  0x0059 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x005a -> LATIN CAPITAL LETTER Z
    '['        #  0x005b -> LEFT SQUARE BRACKET
    '\\'       #  0x005c -> REVERSE SOLIDUS
    ']'        #  0x005d -> RIGHT SQUARE BRACKET
    '^'        #  0x005e -> CIRCUMFLEX ACCENT
    '_'        #  0x005f -> LOW LINE
    '`'        #  0x0060 -> GRAVE ACCENT
    'a'        #  0x0061 -> LATIN SMALL LETTER A
    'b'        #  0x0062 -> LATIN SMALL LETTER B
    'c'        #  0x0063 -> LATIN SMALL LETTER C
    'd'        #  0x0064 -> LATIN SMALL LETTER D
    'e'        #  0x0065 -> LATIN SMALL LETTER E
    'f'        #  0x0066 -> LATIN SMALL LETTER F
    'g'        #  0x0067 -> LATIN SMALL LETTER G
    'h'        #  0x0068 -> LATIN SMALL LETTER H
    'i'        #  0x0069 -> LATIN SMALL LETTER I
    'j'        #  0x006a -> LATIN SMALL LETTER J
    'k'        #  0x006b -> LATIN SMALL LETTER K
    'l'        #  0x006c -> LATIN SMALL LETTER L
    'm'        #  0x006d -> LATIN SMALL LETTER M
    'n'        #  0x006e -> LATIN SMALL LETTER N
    'o'        #  0x006f -> LATIN SMALL LETTER O
    'p'        #  0x0070 -> LATIN SMALL LETTER P
    'q'        #  0x0071 -> LATIN SMALL LETTER Q
    'r'        #  0x0072 -> LATIN SMALL LETTER R
    's'        #  0x0073 -> LATIN SMALL LETTER S
    't'        #  0x0074 -> LATIN SMALL LETTER T
    'u'        #  0x0075 -> LATIN SMALL LETTER U
    'v'        #  0x0076 -> LATIN SMALL LETTER V
    'w'        #  0x0077 -> LATIN SMALL LETTER W
    'x'        #  0x0078 -> LATIN SMALL LETTER X
    'y'        #  0x0079 -> LATIN SMALL LETTER Y
    'z'        #  0x007a -> LATIN SMALL LETTER Z
    '{'        #  0x007b -> LEFT CURLY BRACKET
    '|'        #  0x007c -> VERTICAL LINE
    '}'        #  0x007d -> RIGHT CURLY BRACKET
    '~'        #  0x007e -> TILDE
    '\x7f'     #  0x007f -> DELETE
    '\u0391'   #  0x0080 -> GREEK CAPITAL LETTER ALPHA
    '\u0392'   #  0x0081 -> GREEK CAPITAL LETTER BETA
    '\u0393'   #  0x0082 -> GREEK CAPITAL LETTER GAMMA
    '\u0394'   #  0x0083 -> GREEK CAPITAL LETTER DELTA
    '\u0395'   #  0x0084 -> GREEK CAPITAL LETTER EPSILON
    '\u0396'   #  0x0085 -> GREEK CAPITAL LETTER ZETA
    '\u0397'   #  0x0086 -> GREEK CAPITAL LETTER ETA
    '\u0398'   #  0x0087 -> GREEK CAPITAL LETTER THETA
    '\u0399'   #  0x0088 -> GREEK CAPITAL LETTER IOTA
    '\u039a'   #  0x0089 -> GREEK CAPITAL LETTER KAPPA
    '\u039b'   #  0x008a -> GREEK CAPITAL LETTER LAMDA
    '\u039c'   #  0x008b -> GREEK CAPITAL LETTER MU
    '\u039d'   #  0x008c -> GREEK CAPITAL LETTER NU
    '\u039e'   #  0x008d -> GREEK CAPITAL LETTER XI
    '\u039f'   #  0x008e -> GREEK CAPITAL LETTER OMICRON
    '\u03a0'   #  0x008f -> GREEK CAPITAL LETTER PI
    '\u03a1'   #  0x0090 -> GREEK CAPITAL LETTER RHO
    '\u03a3'   #  0x0091 -> GREEK CAPITAL LETTER SIGMA
    '\u03a4'   #  0x0092 -> GREEK CAPITAL LETTER TAU
    '\u03a5'   #  0x0093 -> GREEK CAPITAL LETTER UPSILON
    '\u03a6'   #  0x0094 -> GREEK CAPITAL LETTER PHI
    '\u03a7'   #  0x0095 -> GREEK CAPITAL LETTER CHI
    '\u03a8'   #  0x0096 -> GREEK CAPITAL LETTER PSI
    '\u03a9'   #  0x0097 -> GREEK CAPITAL LETTER OMEGA
    '\u03b1'   #  0x0098 -> GREEK SMALL LETTER ALPHA
    '\u03b2'   #  0x0099 -> GREEK SMALL LETTER BETA
    '\u03b3'   #  0x009a -> GREEK SMALL LETTER GAMMA
    '\u03b4'   #  0x009b -> GREEK SMALL LETTER DELTA
    '\u03b5'   #  0x009c -> GREEK SMALL LETTER EPSILON
    '\u03b6'   #  0x009d -> GREEK SMALL LETTER ZETA
    '\u03b7'   #  0x009e -> GREEK SMALL LETTER ETA
    '\u03b8'   #  0x009f -> GREEK SMALL LETTER THETA
    '\u03b9'   #  0x00a0 -> GREEK SMALL LETTER IOTA
    '\u03ba'   #  0x00a1 -> GREEK SMALL LETTER KAPPA
    '\u03bb'   #  0x00a2 -> GREEK SMALL LETTER LAMDA
    '\u03bc'   #  0x00a3 -> GREEK SMALL LETTER MU
    '\u03bd'   #  0x00a4 -> GREEK SMALL LETTER NU
    '\u03be'   #  0x00a5 -> GREEK SMALL LETTER XI
    '\u03bf'   #  0x00a6 -> GREEK SMALL LETTER OMICRON
    '\u03c0'   #  0x00a7 -> GREEK SMALL LETTER PI
    '\u03c1'   #  0x00a8 -> GREEK SMALL LETTER RHO
    '\u03c3'   #  0x00a9 -> GREEK SMALL LETTER SIGMA
    '\u03c2'   #  0x00aa -> GREEK SMALL LETTER FINAL SIGMA
    '\u03c4'   #  0x00ab -> GREEK SMALL LETTER TAU
    '\u03c5'   #  0x00ac -> GREEK SMALL LETTER UPSILON
    '\u03c6'   #  0x00ad -> GREEK SMALL LETTER PHI
    '\u03c7'   #  0x00ae -> GREEK SMALL LETTER CHI
    '\u03c8'   #  0x00af -> GREEK SMALL LETTER PSI
    '\u2591'   #  0x00b0 -> LIGHT SHADE
    '\u2592'   #  0x00b1 -> MEDIUM SHADE
    '\u2593'   #  0x00b2 -> DARK SHADE
    '\u2502'   #  0x00b3 -> BOX DRAWINGS LIGHT VERTICAL
    '\u2524'   #  0x00b4 -> BOX DRAWINGS LIGHT VERTICAL AND LEFT
    '\u2561'   #  0x00b5 -> BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
    '\u2562'   #  0x00b6 -> BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
    '\u2556'   #  0x00b7 -> BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
    '\u2555'   #  0x00b8 -> BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
    '\u2563'   #  0x00b9 -> BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    '\u2551'   #  0x00ba -> BOX DRAWINGS DOUBLE VERTICAL
    '\u2557'   #  0x00bb -> BOX DRAWINGS DOUBLE DOWN AND LEFT
    '\u255d'   #  0x00bc -> BOX DRAWINGS DOUBLE UP AND LEFT
    '\u255c'   #  0x00bd -> BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
    '\u255b'   #  0x00be -> BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
    '\u2510'   #  0x00bf -> BOX DRAWINGS LIGHT DOWN AND LEFT
    '\u2514'   #  0x00c0 -> BOX DRAWINGS LIGHT UP AND RIGHT
    '\u2534'   #  0x00c1 -> BOX DRAWINGS LIGHT UP AND HORIZONTAL
    '\u252c'   #  0x00c2 -> BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    '\u251c'   #  0x00c3 -> BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    '\u2500'   #  0x00c4 -> BOX DRAWINGS LIGHT HORIZONTAL
    '\u253c'   #  0x00c5 -> BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    '\u255e'   #  0x00c6 -> BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
    '\u255f'   #  0x00c7 -> BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
    '\u255a'   #  0x00c8 -> BOX DRAWINGS DOUBLE UP AND RIGHT
    '\u2554'   #  0x00c9 -> BOX DRAWINGS DOUBLE DOWN AND RIGHT
    '\u2569'   #  0x00ca -> BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    '\u2566'   #  0x00cb -> BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    '\u2560'   #  0x00cc -> BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    '\u2550'   #  0x00cd -> BOX DRAWINGS DOUBLE HORIZONTAL
    '\u256c'   #  0x00ce -> BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    '\u2567'   #  0x00cf -> BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
    '\u2568'   #  0x00d0 -> BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
    '\u2564'   #  0x00d1 -> BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
    '\u2565'   #  0x00d2 -> BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
    '\u2559'   #  0x00d3 -> BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
    '\u2558'   #  0x00d4 -> BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
    '\u2552'   #  0x00d5 -> BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
    '\u2553'   #  0x00d6 -> BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
    '\u256b'   #  0x00d7 -> BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
    '\u256a'   #  0x00d8 -> BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
    '\u2518'   #  0x00d9 -> BOX DRAWINGS LIGHT UP AND LEFT
    '\u250c'   #  0x00da -> BOX DRAWINGS LIGHT DOWN AND RIGHT
    '\u2588'   #  0x00db -> FULL BLOCK
    '\u2584'   #  0x00dc -> LOWER HALF BLOCK
    '\u258c'   #  0x00dd -> LEFT HALF BLOCK
    '\u2590'   #  0x00de -> RIGHT HALF BLOCK
    '\u2580'   #  0x00df -> UPPER HALF BLOCK
    '\u03c9'   #  0x00e0 -> GREEK SMALL LETTER OMEGA
    '\u03ac'   #  0x00e1 -> GREEK SMALL LETTER ALPHA WITH TONOS
    '\u03ad'   #  0x00e2 -> GREEK SMALL LETTER EPSILON WITH TONOS
    '\u03ae'   #  0x00e3 -> GREEK SMALL LETTER ETA WITH TONOS
    '\u03ca'   #  0x00e4 -> GREEK SMALL LETTER IOTA WITH DIALYTIKA
    '\u03af'   #  0x00e5 -> GREEK SMALL LETTER IOTA WITH TONOS
    '\u03cc'   #  0x00e6 -> GREEK SMALL LETTER OMICRON WITH TONOS
    '\u03cd'   #  0x00e7 -> GREEK SMALL LETTER UPSILON WITH TONOS
    '\u03cb'   #  0x00e8 -> GREEK SMALL LETTER UPSILON WITH DIALYTIKA
    '\u03ce'   #  0x00e9 -> GREEK SMALL LETTER OMEGA WITH TONOS
    '\u0386'   #  0x00ea -> GREEK CAPITAL LETTER ALPHA WITH TONOS
    '\u0388'   #  0x00eb -> GREEK CAPITAL LETTER EPSILON WITH TONOS
    '\u0389'   #  0x00ec -> GREEK CAPITAL LETTER ETA WITH TONOS
    '\u038a'   #  0x00ed -> GREEK CAPITAL LETTER IOTA WITH TONOS
    '\u038c'   #  0x00ee -> GREEK CAPITAL LETTER OMICRON WITH TONOS
    '\u038e'   #  0x00ef -> GREEK CAPITAL LETTER UPSILON WITH TONOS
    '\u038f'   #  0x00f0 -> GREEK CAPITAL LETTER OMEGA WITH TONOS
    '\xb1'     #  0x00f1 -> PLUS-MINUS SIGN
    '\u2265'   #  0x00f2 -> GREATER-THAN OR EQUAL TO
    '\u2264'   #  0x00f3 -> LESS-THAN OR EQUAL TO
    '\u03aa'   #  0x00f4 -> GREEK CAPITAL LETTER IOTA WITH DIALYTIKA
    '\u03ab'   #  0x00f5 -> GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA
    '\xf7'     #  0x00f6 -> DIVISION SIGN
    '\u2248'   #  0x00f7 -> ALMOST EQUAL TO
    '\xb0'     #  0x00f8 -> DEGREE SIGN
    '\u2219'   #  0x00f9 -> BULLET OPERATOR
    '\xb7'     #  0x00fa -> MIDDLE DOT
    '\u221a'   #  0x00fb -> SQUARE ROOT
    '\u207f'   #  0x00fc -> SUPERSCRIPT LATIN SMALL LETTER N
    '\xb2'     #  0x00fd -> SUPERSCRIPT TWO
    '\u25a0'   #  0x00fe -> BLACK SQUARE
    '\xa0'     #  0x00ff -> NO-BREAK SPACE
)

### Encoding Map

encoding_map = {
    0x0000: 0x0000,     #  NULL
    0x0001: 0x0001,     #  START OF HEADING
    0x0002: 0x0002,     #  START OF TEXT
    0x0003: 0x0003,     #  END OF TEXT
    0x0004: 0x0004,     #  END OF TRANSMISSION
    0x0005: 0x0005,     #  ENQUIRY
    0x0006: 0x0006,     #  ACKNOWLEDGE
    0x0007: 0x0007,     #  BELL
    0x0008: 0x0008,     #  BACKSPACE
    0x0009: 0x0009,     #  HORIZONTAL TABULATION
    0x000a: 0x000a,     #  LINE FEED
    0x000b: 0x000b,     #  VERTICAL TABULATION
    0x000c: 0x000c,     #  FORM FEED
    0x000d: 0x000d,     #  CARRIAGE RETURN
    0x000e: 0x000e,     #  SHIFT OUT
    0x000f: 0x000f,     #  SHIFT IN
    0x0010: 0x0010,     #  DATA LINK ESCAPE
    0x0011: 0x0011,     #  DEVICE CONTROL ONE
    0x0012: 0x0012,     #  DEVICE CONTROL TWO
    0x0013: 0x0013,     #  DEVICE CONTROL THREE
    0x0014: 0x0014,     #  DEVICE CONTROL FOUR
    0x0015: 0x0015,     #  NEGATIVE ACKNOWLEDGE
    0x0016: 0x0016,     #  SYNCHRONOUS IDLE
    0x0017: 0x0017,     #  END OF TRANSMISSION BLOCK
    0x0018: 0x0018,     #  CANCEL
    0x0019: 0x0019,     #  END OF MEDIUM
    0x001a: 0x001a,     #  SUBSTITUTE
    0x001b: 0x001b,     #  ESCAPE
    0x001c: 0x001c,     #  FILE SEPARATOR
    0x001d: 0x001d,     #  GROUP SEPARATOR
    0x001e: 0x001e,     #  RECORD SEPARATOR
    0x001f: 0x001f,     #  UNIT SEPARATOR
    0x0020: 0x0020,     #  SPACE
    0x0021: 0x0021,     #  EXCLAMATION MARK
    0x0022: 0x0022,     #  QUOTATION MARK
    0x0023: 0x0023,     #  NUMBER SIGN
    0x0024: 0x0024,     #  DOLLAR SIGN
    0x0025: 0x0025,     #  PERCENT SIGN
    0x0026: 0x0026,     #  AMPERSAND
    0x0027: 0x0027,     #  APOSTROPHE
    0x0028: 0x0028,     #  LEFT PARENTHESIS
    0x0029: 0x0029,     #  RIGHT PARENTHESIS
    0x002a: 0x002a,     #  ASTERISK
    0x002b: 0x002b,     #  PLUS SIGN
    0x002c: 0x002c,     #  COMMA
    0x002d: 0x002d,     #  HYPHEN-MINUS
    0x002e: 0x002e,     #  FULL STOP
    0x002f: 0x002f,     #  SOLIDUS
    0x0030: 0x0030,     #  DIGIT ZERO
    0x0031: 0x0031,     #  DIGIT ONE
    0x0032: 0x0032,     #  DIGIT TWO
    0x0033: 0x0033,     #  DIGIT THREE
    0x0034: 0x0034,     #  DIGIT FOUR
    0x0035: 0x0035,     #  DIGIT FIVE
    0x0036: 0x0036,     #  DIGIT SIX
    0x0037: 0x0037,     #  DIGIT SEVEN
    0x0038: 0x0038,     #  DIGIT EIGHT
    0x0039: 0x0039,     #  DIGIT NINE
    0x003a: 0x003a,     #  COLON
    0x003b: 0x003b,     #  SEMICOLON
    0x003c: 0x003c,     #  LESS-THAN SIGN
    0x003d: 0x003d,     #  EQUALS SIGN
    0x003e: 0x003e,     #  GREATER-THAN SIGN
    0x003f: 0x003f,     #  QUESTION MARK
    0x0040: 0x0040,     #  COMMERCIAL AT
    0x0041: 0x0041,     #  LATIN CAPITAL LETTER A
    0x0042: 0x0042,     #  LATIN CAPITAL LETTER B
    0x0043: 0x0043,     #  LATIN CAPITAL LETTER C
    0x0044: 0x0044,     #  LATIN CAPITAL LETTER D
    0x0045: 0x0045,     #  LATIN CAPITAL LETTER E
    0x0046: 0x0046,     #  LATIN CAPITAL LETTER F
    0x0047: 0x0047,     #  LATIN CAPITAL LETTER G
    0x0048: 0x0048,     #  LATIN CAPITAL LETTER H
    0x0049: 0x0049,     #  LATIN CAPITAL LETTER I
    0x004a: 0x004a,     #  LATIN CAPITAL LETTER J
    0x004b: 0x004b,     #  LATIN CAPITAL LETTER K
    0x004c: 0x004c,     #  LATIN CAPITAL LETTER L
    0x004d: 0x004d,     #  LATIN CAPITAL LETTER M
    0x004e: 0x004e,     #  LATIN CAPITAL LETTER N
    0x004f: 0x004f,     #  LATIN CAPITAL LETTER O
    0x0050: 0x0050,     #  LATIN CAPITAL LETTER P
    0x0051: 0x0051,     #  LATIN CAPITAL LETTER Q
    0x0052: 0x0052,     #  LATIN CAPITAL LETTER R
    0x0053: 0x0053,     #  LATIN CAPITAL LETTER S
    0x0054: 0x0054,     #  LATIN CAPITAL LETTER T
    0x0055: 0x0055,     #  LATIN CAPITAL LETTER U
    0x0056: 0x0056,     #  LATIN CAPITAL LETTER V
    0x0057: 0x0057,     #  LATIN CAPITAL LETTER W
    0x0058: 0x0058,     #  LATIN CAPITAL LETTER X
    0x0059: 0x0059,     #  LATIN CAPITAL LETTER Y
    0x005a: 0x005a,     #  LATIN CAPITAL LETTER Z
    0x005b: 0x005b,     #  LEFT SQUARE BRACKET
    0x005c: 0x005c,     #  REVERSE SOLIDUS
    0x005d: 0x005d,     #  RIGHT SQUARE BRACKET
    0x005e: 0x005e,     #  CIRCUMFLEX ACCENT
    0x005f: 0x005f,     #  LOW LINE
    0x0060: 0x0060,     #  GRAVE ACCENT
    0x0061: 0x0061,     #  LATIN SMALL LETTER A
    0x0062: 0x0062,     #  LATIN SMALL LETTER B
    0x0063: 0x0063,     #  LATIN SMALL LETTER C
    0x0064: 0x0064,     #  LATIN SMALL LETTER D
    0x0065: 0x0065,     #  LATIN SMALL LETTER E
    0x0066: 0x0066,     #  LATIN SMALL LETTER F
    0x0067: 0x0067,     #  LATIN SMALL LETTER G
    0x0068: 0x0068,     #  LATIN SMALL LETTER H
    0x0069: 0x0069,     #  LATIN SMALL LETTER I
    0x006a: 0x006a,     #  LATIN SMALL LETTER J
    0x006b: 0x006b,     #  LATIN SMALL LETTER K
    0x006c: 0x006c,     #  LATIN SMALL LETTER L
    0x006d: 0x006d,     #  LATIN SMALL LETTER M
    0x006e: 0x006e,     #  LATIN SMALL LETTER N
    0x006f: 0x006f,     #  LATIN SMALL LETTER O
    0x0070: 0x0070,     #  LATIN SMALL LETTER P
    0x0071: 0x0071,     #  LATIN SMALL LETTER Q
    0x0072: 0x0072,     #  LATIN SMALL LETTER R
    0x0073: 0x0073,     #  LATIN SMALL LETTER S
    0x0074: 0x0074,     #  LATIN SMALL LETTER T
    0x0075: 0x0075,     #  LATIN SMALL LETTER U
    0x0076: 0x0076,     #  LATIN SMALL LETTER V
    0x0077: 0x0077,     #  LATIN SMALL LETTER W
    0x0078: 0x0078,     #  LATIN SMALL LETTER X
    0x0079: 0x0079,     #  LATIN SMALL LETTER Y
    0x007a: 0x007a,     #  LATIN SMALL LETTER Z
    0x007b: 0x007b,     #  LEFT CURLY BRACKET
    0x007c: 0x007c,     #  VERTICAL LINE
    0x007d: 0x007d,     #  RIGHT CURLY BRACKET
    0x007e: 0x007e,     #  TILDE
    0x007f: 0x007f,     #  DELETE
    0x00a0: 0x00ff,     #  NO-BREAK SPACE
    0x00b0: 0x00f8,     #  DEGREE SIGN
    0x00b1: 0x00f1,     #  PLUS-MINUS SIGN
    0x00b2: 0x00fd,     #  SUPERSCRIPT TWO
    0x00b7: 0x00fa,     #  MIDDLE DOT
    0x00f7: 0x00f6,     #  DIVISION SIGN
    0x0386: 0x00ea,     #  GREEK CAPITAL LETTER ALPHA WITH TONOS
    0x0388: 0x00eb,     #  GREEK CAPITAL LETTER EPSILON WITH TONOS
    0x0389: 0x00ec,     #  GREEK CAPITAL LETTER ETA WITH TONOS
    0x038a: 0x00ed,     #  GREEK CAPITAL LETTER IOTA WITH TONOS
    0x038c: 0x00ee,     #  GREEK CAPITAL LETTER OMICRON WITH TONOS
    0x038e: 0x00ef,     #  GREEK CAPITAL LETTER UPSILON WITH TONOS
    0x038f: 0x00f0,     #  GREEK CAPITAL LETTER OMEGA WITH TONOS
    0x0391: 0x0080,     #  GREEK CAPITAL LETTER ALPHA
    0x0392: 0x0081,     #  GREEK CAPITAL LETTER BETA
    0x0393: 0x0082,     #  GREEK CAPITAL LETTER GAMMA
    0x0394: 0x0083,     #  GREEK CAPITAL LETTER DELTA
    0x0395: 0x0084,     #  GREEK CAPITAL LETTER EPSILON
    0x0396: 0x0085,     #  GREEK CAPITAL LETTER ZETA
    0x0397: 0x0086,     #  GREEK CAPITAL LETTER ETA
    0x0398: 0x0087,     #  GREEK CAPITAL LETTER THETA
    0x0399: 0x0088,     #  GREEK CAPITAL LETTER IOTA
    0x039a: 0x0089,     #  GREEK CAPITAL LETTER KAPPA
    0x039b: 0x008a,     #  GREEK CAPITAL LETTER LAMDA
    0x039c: 0x008b,     #  GREEK CAPITAL LETTER MU
    0x039d: 0x008c,     #  GREEK CAPITAL LETTER NU
    0x039e: 0x008d,     #  GREEK CAPITAL LETTER XI
    0x039f: 0x008e,     #  GREEK CAPITAL LETTER OMICRON
    0x03a0: 0x008f,     #  GREEK CAPITAL LETTER PI
    0x03a1: 0x0090,     #  GREEK CAPITAL LETTER RHO
    0x03a3: 0x0091,     #  GREEK CAPITAL LETTER SIGMA
    0x03a4: 0x0092,     #  GREEK CAPITAL LETTER TAU
    0x03a5: 0x0093,     #  GREEK CAPITAL LETTER UPSILON
    0x03a6: 0x0094,     #  GREEK CAPITAL LETTER PHI
    0x03a7: 0x0095,     #  GREEK CAPITAL LETTER CHI
    0x03a8: 0x0096,     #  GREEK CAPITAL LETTER PSI
    0x03a9: 0x0097,     #  GREEK CAPITAL LETTER OMEGA
    0x03aa: 0x00f4,     #  GREEK CAPITAL LETTER IOTA WITH DIALYTIKA
    0x03ab: 0x00f5,     #  GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA
    0x03ac: 0x00e1,     #  GREEK SMALL LETTER ALPHA WITH TONOS
    0x03ad: 0x00e2,     #  GREEK SMALL LETTER EPSILON WITH TONOS
    0x03ae: 0x00e3,     #  GREEK SMALL LETTER ETA WITH TONOS
    0x03af: 0x00e5,     #  GREEK SMALL LETTER IOTA WITH TONOS
    0x03b1: 0x0098,     #  GREEK SMALL LETTER ALPHA
    0x03b2: 0x0099,     #  GREEK SMALL LETTER BETA
    0x03b3: 0x009a,     #  GREEK SMALL LETTER GAMMA
    0x03b4: 0x009b,     #  GREEK SMALL LETTER DELTA
    0x03b5: 0x009c,     #  GREEK SMALL LETTER EPSILON
    0x03b6: 0x009d,     #  GREEK SMALL LETTER ZETA
    0x03b7: 0x009e,     #  GREEK SMALL LETTER ETA
    0x03b8: 0x009f,     #  GREEK SMALL LETTER THETA
    0x03b9: 0x00a0,     #  GREEK SMALL LETTER IOTA
    0x03ba: 0x00a1,     #  GREEK SMALL LETTER KAPPA
    0x03bb: 0x00a2,     #  GREEK SMALL LETTER LAMDA
    0x03bc: 0x00a3,     #  GREEK SMALL LETTER MU
    0x03bd: 0x00a4,     #  GREEK SMALL LETTER NU
    0x03be: 0x00a5,     #  GREEK SMALL LETTER XI
    0x03bf: 0x00a6,     #  GREEK SMALL LETTER OMICRON
    0x03c0: 0x00a7,     #  GREEK SMALL LETTER PI
    0x03c1: 0x00a8,     #  GREEK SMALL LETTER RHO
    0x03c2: 0x00aa,     #  GREEK SMALL LETTER FINAL SIGMA
    0x03c3: 0x00a9,     #  GREEK SMALL LETTER SIGMA
    0x03c4: 0x00ab,     #  GREEK SMALL LETTER TAU
    0x03c5: 0x00ac,     #  GREEK SMALL LETTER UPSILON
    0x03c6: 0x00ad,     #  GREEK SMALL LETTER PHI
    0x03c7: 0x00ae,     #  GREEK SMALL LETTER CHI
    0x03c8: 0x00af,     #  GREEK SMALL LETTER PSI
    0x03c9: 0x00e0,     #  GREEK SMALL LETTER OMEGA
    0x03ca: 0x00e4,     #  GREEK SMALL LETTER IOTA WITH DIALYTIKA
    0x03cb: 0x00e8,     #  GREEK SMALL LETTER UPSILON WITH DIALYTIKA
    0x03cc: 0x00e6,     #  GREEK SMALL LETTER OMICRON WITH TONOS
    0x03cd: 0x00e7,     #  GREEK SMALL LETTER UPSILON WITH TONOS
    0x03ce: 0x00e9,     #  GREEK SMALL LETTER OMEGA WITH TONOS
    0x207f: 0x00fc,     #  SUPERSCRIPT LATIN SMALL LETTER N
    0x2219: 0x00f9,     #  BULLET OPERATOR
    0x221a: 0x00fb,     #  SQUARE ROOT
    0x2248: 0x00f7,     #  ALMOST EQUAL TO
    0x2264: 0x00f3,     #  LESS-THAN OR EQUAL TO
    0x2265: 0x00f2,     #  GREATER-THAN OR EQUAL TO
    0x2500: 0x00c4,     #  BOX DRAWINGS LIGHT HORIZONTAL
    0x2502: 0x00b3,     #  BOX DRAWINGS LIGHT VERTICAL
    0x250c: 0x00da,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
    0x2510: 0x00bf,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
    0x2514: 0x00c0,     #  BOX DRAWINGS LIGHT UP AND RIGHT
    0x2518: 0x00d9,     #  BOX DRAWINGS LIGHT UP AND LEFT
    0x251c: 0x00c3,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    0x2524: 0x00b4,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
    0x252c: 0x00c2,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    0x2534: 0x00c1,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
    0x253c: 0x00c5,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    0x2550: 0x00cd,     #  BOX DRAWINGS DOUBLE HORIZONTAL
    0x2551: 0x00ba,     #  BOX DRAWINGS DOUBLE VERTICAL
    0x2552: 0x00d5,     #  BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
    0x2553: 0x00d6,     #  BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
    0x2554: 0x00c9,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
    0x2555: 0x00b8,     #  BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
    0x2556: 0x00b7,     #  BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
    0x2557: 0x00bb,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
    0x2558: 0x00d4,     #  BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
    0x2559: 0x00d3,     #  BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
    0x255a: 0x00c8,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
    0x255b: 0x00be,     #  BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
    0x255c: 0x00bd,     #  BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
    0x255d: 0x00bc,     #  BOX DRAWINGS DOUBLE UP AND LEFT
    0x255e: 0x00c6,     #  BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
    0x255f: 0x00c7,     #  BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
    0x2560: 0x00cc,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    0x2561: 0x00b5,     #  BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
    0x2562: 0x00b6,     #  BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
    0x2563: 0x00b9,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    0x2564: 0x00d1,     #  BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
    0x2565: 0x00d2,     #  BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
    0x2566: 0x00cb,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    0x2567: 0x00cf,     #  BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
    0x2568: 0x00d0,     #  BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
    0x2569: 0x00ca,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    0x256a: 0x00d8,     #  BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
    0x256b: 0x00d7,     #  BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
    0x256c: 0x00ce,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    0x2580: 0x00df,     #  UPPER HALF BLOCK
    0x2584: 0x00dc,     #  LOWER HALF BLOCK
    0x2588: 0x00db,     #  FULL BLOCK
    0x258c: 0x00dd,     #  LEFT HALF BLOCK
    0x2590: 0x00de,     #  RIGHT HALF BLOCK
    0x2591: 0x00b0,     #  LIGHT SHADE
    0x2592: 0x00b1,     #  MEDIUM SHADE
    0x2593: 0x00b2,     #  DARK SHADE
    0x25a0: 0x00fe,     #  BLACK SQUARE
}
encodings/mac_farsi.py000064400000035502151153537610011027 0ustar00""" Python Character Mapping Codec mac_farsi generated from 'MAPPINGS/VENDORS/APPLE/FARSI.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='mac-farsi',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> CONTROL CHARACTER
    '\x01'     #  0x01 -> CONTROL CHARACTER
    '\x02'     #  0x02 -> CONTROL CHARACTER
    '\x03'     #  0x03 -> CONTROL CHARACTER
    '\x04'     #  0x04 -> CONTROL CHARACTER
    '\x05'     #  0x05 -> CONTROL CHARACTER
    '\x06'     #  0x06 -> CONTROL CHARACTER
    '\x07'     #  0x07 -> CONTROL CHARACTER
    '\x08'     #  0x08 -> CONTROL CHARACTER
    '\t'       #  0x09 -> CONTROL CHARACTER
    '\n'       #  0x0A -> CONTROL CHARACTER
    '\x0b'     #  0x0B -> CONTROL CHARACTER
    '\x0c'     #  0x0C -> CONTROL CHARACTER
    '\r'       #  0x0D -> CONTROL CHARACTER
    '\x0e'     #  0x0E -> CONTROL CHARACTER
    '\x0f'     #  0x0F -> CONTROL CHARACTER
    '\x10'     #  0x10 -> CONTROL CHARACTER
    '\x11'     #  0x11 -> CONTROL CHARACTER
    '\x12'     #  0x12 -> CONTROL CHARACTER
    '\x13'     #  0x13 -> CONTROL CHARACTER
    '\x14'     #  0x14 -> CONTROL CHARACTER
    '\x15'     #  0x15 -> CONTROL CHARACTER
    '\x16'     #  0x16 -> CONTROL CHARACTER
    '\x17'     #  0x17 -> CONTROL CHARACTER
    '\x18'     #  0x18 -> CONTROL CHARACTER
    '\x19'     #  0x19 -> CONTROL CHARACTER
    '\x1a'     #  0x1A -> CONTROL CHARACTER
    '\x1b'     #  0x1B -> CONTROL CHARACTER
    '\x1c'     #  0x1C -> CONTROL CHARACTER
    '\x1d'     #  0x1D -> CONTROL CHARACTER
    '\x1e'     #  0x1E -> CONTROL CHARACTER
    '\x1f'     #  0x1F -> CONTROL CHARACTER
    ' '        #  0x20 -> SPACE, left-right
    '!'        #  0x21 -> EXCLAMATION MARK, left-right
    '"'        #  0x22 -> QUOTATION MARK, left-right
    '#'        #  0x23 -> NUMBER SIGN, left-right
    '$'        #  0x24 -> DOLLAR SIGN, left-right
    '%'        #  0x25 -> PERCENT SIGN, left-right
    '&'        #  0x26 -> AMPERSAND, left-right
    "'"        #  0x27 -> APOSTROPHE, left-right
    '('        #  0x28 -> LEFT PARENTHESIS, left-right
    ')'        #  0x29 -> RIGHT PARENTHESIS, left-right
    '*'        #  0x2A -> ASTERISK, left-right
    '+'        #  0x2B -> PLUS SIGN, left-right
    ','        #  0x2C -> COMMA, left-right; in Arabic-script context, displayed as 0x066C ARABIC THOUSANDS SEPARATOR
    '-'        #  0x2D -> HYPHEN-MINUS, left-right
    '.'        #  0x2E -> FULL STOP, left-right; in Arabic-script context, displayed as 0x066B ARABIC DECIMAL SEPARATOR
    '/'        #  0x2F -> SOLIDUS, left-right
    '0'        #  0x30 -> DIGIT ZERO;  in Arabic-script context, displayed as 0x06F0 EXTENDED ARABIC-INDIC DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE;   in Arabic-script context, displayed as 0x06F1 EXTENDED ARABIC-INDIC DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO;   in Arabic-script context, displayed as 0x06F2 EXTENDED ARABIC-INDIC DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE; in Arabic-script context, displayed as 0x06F3 EXTENDED ARABIC-INDIC DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR;  in Arabic-script context, displayed as 0x06F4 EXTENDED ARABIC-INDIC DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE;  in Arabic-script context, displayed as 0x06F5 EXTENDED ARABIC-INDIC DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX;   in Arabic-script context, displayed as 0x06F6 EXTENDED ARABIC-INDIC DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN; in Arabic-script context, displayed as 0x06F7 EXTENDED ARABIC-INDIC DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT; in Arabic-script context, displayed as 0x06F8 EXTENDED ARABIC-INDIC DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE;  in Arabic-script context, displayed as 0x06F9 EXTENDED ARABIC-INDIC DIGIT NINE
    ':'        #  0x3A -> COLON, left-right
    ';'        #  0x3B -> SEMICOLON, left-right
    '<'        #  0x3C -> LESS-THAN SIGN, left-right
    '='        #  0x3D -> EQUALS SIGN, left-right
    '>'        #  0x3E -> GREATER-THAN SIGN, left-right
    '?'        #  0x3F -> QUESTION MARK, left-right
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET, left-right
    '\\'       #  0x5C -> REVERSE SOLIDUS, left-right
    ']'        #  0x5D -> RIGHT SQUARE BRACKET, left-right
    '^'        #  0x5E -> CIRCUMFLEX ACCENT, left-right
    '_'        #  0x5F -> LOW LINE, left-right
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET, left-right
    '|'        #  0x7C -> VERTICAL LINE, left-right
    '}'        #  0x7D -> RIGHT CURLY BRACKET, left-right
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> CONTROL CHARACTER
    '\xc4'     #  0x80 -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\xa0'     #  0x81 -> NO-BREAK SPACE, right-left
    '\xc7'     #  0x82 -> LATIN CAPITAL LETTER C WITH CEDILLA
    '\xc9'     #  0x83 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\xd1'     #  0x84 -> LATIN CAPITAL LETTER N WITH TILDE
    '\xd6'     #  0x85 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xdc'     #  0x86 -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\xe1'     #  0x87 -> LATIN SMALL LETTER A WITH ACUTE
    '\xe0'     #  0x88 -> LATIN SMALL LETTER A WITH GRAVE
    '\xe2'     #  0x89 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\xe4'     #  0x8A -> LATIN SMALL LETTER A WITH DIAERESIS
    '\u06ba'   #  0x8B -> ARABIC LETTER NOON GHUNNA
    '\xab'     #  0x8C -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK, right-left
    '\xe7'     #  0x8D -> LATIN SMALL LETTER C WITH CEDILLA
    '\xe9'     #  0x8E -> LATIN SMALL LETTER E WITH ACUTE
    '\xe8'     #  0x8F -> LATIN SMALL LETTER E WITH GRAVE
    '\xea'     #  0x90 -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xeb'     #  0x91 -> LATIN SMALL LETTER E WITH DIAERESIS
    '\xed'     #  0x92 -> LATIN SMALL LETTER I WITH ACUTE
    '\u2026'   #  0x93 -> HORIZONTAL ELLIPSIS, right-left
    '\xee'     #  0x94 -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\xef'     #  0x95 -> LATIN SMALL LETTER I WITH DIAERESIS
    '\xf1'     #  0x96 -> LATIN SMALL LETTER N WITH TILDE
    '\xf3'     #  0x97 -> LATIN SMALL LETTER O WITH ACUTE
    '\xbb'     #  0x98 -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK, right-left
    '\xf4'     #  0x99 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xf6'     #  0x9A -> LATIN SMALL LETTER O WITH DIAERESIS
    '\xf7'     #  0x9B -> DIVISION SIGN, right-left
    '\xfa'     #  0x9C -> LATIN SMALL LETTER U WITH ACUTE
    '\xf9'     #  0x9D -> LATIN SMALL LETTER U WITH GRAVE
    '\xfb'     #  0x9E -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\xfc'     #  0x9F -> LATIN SMALL LETTER U WITH DIAERESIS
    ' '        #  0xA0 -> SPACE, right-left
    '!'        #  0xA1 -> EXCLAMATION MARK, right-left
    '"'        #  0xA2 -> QUOTATION MARK, right-left
    '#'        #  0xA3 -> NUMBER SIGN, right-left
    '$'        #  0xA4 -> DOLLAR SIGN, right-left
    '\u066a'   #  0xA5 -> ARABIC PERCENT SIGN
    '&'        #  0xA6 -> AMPERSAND, right-left
    "'"        #  0xA7 -> APOSTROPHE, right-left
    '('        #  0xA8 -> LEFT PARENTHESIS, right-left
    ')'        #  0xA9 -> RIGHT PARENTHESIS, right-left
    '*'        #  0xAA -> ASTERISK, right-left
    '+'        #  0xAB -> PLUS SIGN, right-left
    '\u060c'   #  0xAC -> ARABIC COMMA
    '-'        #  0xAD -> HYPHEN-MINUS, right-left
    '.'        #  0xAE -> FULL STOP, right-left
    '/'        #  0xAF -> SOLIDUS, right-left
    '\u06f0'   #  0xB0 -> EXTENDED ARABIC-INDIC DIGIT ZERO, right-left (need override)
    '\u06f1'   #  0xB1 -> EXTENDED ARABIC-INDIC DIGIT ONE, right-left (need override)
    '\u06f2'   #  0xB2 -> EXTENDED ARABIC-INDIC DIGIT TWO, right-left (need override)
    '\u06f3'   #  0xB3 -> EXTENDED ARABIC-INDIC DIGIT THREE, right-left (need override)
    '\u06f4'   #  0xB4 -> EXTENDED ARABIC-INDIC DIGIT FOUR, right-left (need override)
    '\u06f5'   #  0xB5 -> EXTENDED ARABIC-INDIC DIGIT FIVE, right-left (need override)
    '\u06f6'   #  0xB6 -> EXTENDED ARABIC-INDIC DIGIT SIX, right-left (need override)
    '\u06f7'   #  0xB7 -> EXTENDED ARABIC-INDIC DIGIT SEVEN, right-left (need override)
    '\u06f8'   #  0xB8 -> EXTENDED ARABIC-INDIC DIGIT EIGHT, right-left (need override)
    '\u06f9'   #  0xB9 -> EXTENDED ARABIC-INDIC DIGIT NINE, right-left (need override)
    ':'        #  0xBA -> COLON, right-left
    '\u061b'   #  0xBB -> ARABIC SEMICOLON
    '<'        #  0xBC -> LESS-THAN SIGN, right-left
    '='        #  0xBD -> EQUALS SIGN, right-left
    '>'        #  0xBE -> GREATER-THAN SIGN, right-left
    '\u061f'   #  0xBF -> ARABIC QUESTION MARK
    '\u274a'   #  0xC0 -> EIGHT TEARDROP-SPOKED PROPELLER ASTERISK, right-left
    '\u0621'   #  0xC1 -> ARABIC LETTER HAMZA
    '\u0622'   #  0xC2 -> ARABIC LETTER ALEF WITH MADDA ABOVE
    '\u0623'   #  0xC3 -> ARABIC LETTER ALEF WITH HAMZA ABOVE
    '\u0624'   #  0xC4 -> ARABIC LETTER WAW WITH HAMZA ABOVE
    '\u0625'   #  0xC5 -> ARABIC LETTER ALEF WITH HAMZA BELOW
    '\u0626'   #  0xC6 -> ARABIC LETTER YEH WITH HAMZA ABOVE
    '\u0627'   #  0xC7 -> ARABIC LETTER ALEF
    '\u0628'   #  0xC8 -> ARABIC LETTER BEH
    '\u0629'   #  0xC9 -> ARABIC LETTER TEH MARBUTA
    '\u062a'   #  0xCA -> ARABIC LETTER TEH
    '\u062b'   #  0xCB -> ARABIC LETTER THEH
    '\u062c'   #  0xCC -> ARABIC LETTER JEEM
    '\u062d'   #  0xCD -> ARABIC LETTER HAH
    '\u062e'   #  0xCE -> ARABIC LETTER KHAH
    '\u062f'   #  0xCF -> ARABIC LETTER DAL
    '\u0630'   #  0xD0 -> ARABIC LETTER THAL
    '\u0631'   #  0xD1 -> ARABIC LETTER REH
    '\u0632'   #  0xD2 -> ARABIC LETTER ZAIN
    '\u0633'   #  0xD3 -> ARABIC LETTER SEEN
    '\u0634'   #  0xD4 -> ARABIC LETTER SHEEN
    '\u0635'   #  0xD5 -> ARABIC LETTER SAD
    '\u0636'   #  0xD6 -> ARABIC LETTER DAD
    '\u0637'   #  0xD7 -> ARABIC LETTER TAH
    '\u0638'   #  0xD8 -> ARABIC LETTER ZAH
    '\u0639'   #  0xD9 -> ARABIC LETTER AIN
    '\u063a'   #  0xDA -> ARABIC LETTER GHAIN
    '['        #  0xDB -> LEFT SQUARE BRACKET, right-left
    '\\'       #  0xDC -> REVERSE SOLIDUS, right-left
    ']'        #  0xDD -> RIGHT SQUARE BRACKET, right-left
    '^'        #  0xDE -> CIRCUMFLEX ACCENT, right-left
    '_'        #  0xDF -> LOW LINE, right-left
    '\u0640'   #  0xE0 -> ARABIC TATWEEL
    '\u0641'   #  0xE1 -> ARABIC LETTER FEH
    '\u0642'   #  0xE2 -> ARABIC LETTER QAF
    '\u0643'   #  0xE3 -> ARABIC LETTER KAF
    '\u0644'   #  0xE4 -> ARABIC LETTER LAM
    '\u0645'   #  0xE5 -> ARABIC LETTER MEEM
    '\u0646'   #  0xE6 -> ARABIC LETTER NOON
    '\u0647'   #  0xE7 -> ARABIC LETTER HEH
    '\u0648'   #  0xE8 -> ARABIC LETTER WAW
    '\u0649'   #  0xE9 -> ARABIC LETTER ALEF MAKSURA
    '\u064a'   #  0xEA -> ARABIC LETTER YEH
    '\u064b'   #  0xEB -> ARABIC FATHATAN
    '\u064c'   #  0xEC -> ARABIC DAMMATAN
    '\u064d'   #  0xED -> ARABIC KASRATAN
    '\u064e'   #  0xEE -> ARABIC FATHA
    '\u064f'   #  0xEF -> ARABIC DAMMA
    '\u0650'   #  0xF0 -> ARABIC KASRA
    '\u0651'   #  0xF1 -> ARABIC SHADDA
    '\u0652'   #  0xF2 -> ARABIC SUKUN
    '\u067e'   #  0xF3 -> ARABIC LETTER PEH
    '\u0679'   #  0xF4 -> ARABIC LETTER TTEH
    '\u0686'   #  0xF5 -> ARABIC LETTER TCHEH
    '\u06d5'   #  0xF6 -> ARABIC LETTER AE
    '\u06a4'   #  0xF7 -> ARABIC LETTER VEH
    '\u06af'   #  0xF8 -> ARABIC LETTER GAF
    '\u0688'   #  0xF9 -> ARABIC LETTER DDAL
    '\u0691'   #  0xFA -> ARABIC LETTER RREH
    '{'        #  0xFB -> LEFT CURLY BRACKET, right-left
    '|'        #  0xFC -> VERTICAL LINE, right-left
    '}'        #  0xFD -> RIGHT CURLY BRACKET, right-left
    '\u0698'   #  0xFE -> ARABIC LETTER JEH
    '\u06d2'   #  0xFF -> ARABIC LETTER YEH BARREE
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/base64_codec.py000064400000002775151153537610011332 0ustar00"""Python 'base64_codec' Codec - base64 content transfer encoding.

This codec de/encodes from bytes to bytes.

Written by Marc-Andre Lemburg (mal@lemburg.com).
"""

import codecs
import base64

### Codec APIs

def base64_encode(input, errors='strict'):
    assert errors == 'strict'
    return (base64.encodebytes(input), len(input))

def base64_decode(input, errors='strict'):
    assert errors == 'strict'
    return (base64.decodebytes(input), len(input))

class Codec(codecs.Codec):
    def encode(self, input, errors='strict'):
        return base64_encode(input, errors)
    def decode(self, input, errors='strict'):
        return base64_decode(input, errors)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        assert self.errors == 'strict'
        return base64.encodebytes(input)

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        assert self.errors == 'strict'
        return base64.decodebytes(input)

class StreamWriter(Codec, codecs.StreamWriter):
    charbuffertype = bytes

class StreamReader(Codec, codecs.StreamReader):
    charbuffertype = bytes

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='base64',
        encode=base64_encode,
        decode=base64_decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamwriter=StreamWriter,
        streamreader=StreamReader,
        _is_text_encoding=False,
    )
encodings/iso8859_16.py000064400000032365151153537610010545 0ustar00""" Python Character Mapping Codec iso8859_16 generated from 'MAPPINGS/ISO8859/8859-16.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='iso8859-16',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\x80'     #  0x80 -> <control>
    '\x81'     #  0x81 -> <control>
    '\x82'     #  0x82 -> <control>
    '\x83'     #  0x83 -> <control>
    '\x84'     #  0x84 -> <control>
    '\x85'     #  0x85 -> <control>
    '\x86'     #  0x86 -> <control>
    '\x87'     #  0x87 -> <control>
    '\x88'     #  0x88 -> <control>
    '\x89'     #  0x89 -> <control>
    '\x8a'     #  0x8A -> <control>
    '\x8b'     #  0x8B -> <control>
    '\x8c'     #  0x8C -> <control>
    '\x8d'     #  0x8D -> <control>
    '\x8e'     #  0x8E -> <control>
    '\x8f'     #  0x8F -> <control>
    '\x90'     #  0x90 -> <control>
    '\x91'     #  0x91 -> <control>
    '\x92'     #  0x92 -> <control>
    '\x93'     #  0x93 -> <control>
    '\x94'     #  0x94 -> <control>
    '\x95'     #  0x95 -> <control>
    '\x96'     #  0x96 -> <control>
    '\x97'     #  0x97 -> <control>
    '\x98'     #  0x98 -> <control>
    '\x99'     #  0x99 -> <control>
    '\x9a'     #  0x9A -> <control>
    '\x9b'     #  0x9B -> <control>
    '\x9c'     #  0x9C -> <control>
    '\x9d'     #  0x9D -> <control>
    '\x9e'     #  0x9E -> <control>
    '\x9f'     #  0x9F -> <control>
    '\xa0'     #  0xA0 -> NO-BREAK SPACE
    '\u0104'   #  0xA1 -> LATIN CAPITAL LETTER A WITH OGONEK
    '\u0105'   #  0xA2 -> LATIN SMALL LETTER A WITH OGONEK
    '\u0141'   #  0xA3 -> LATIN CAPITAL LETTER L WITH STROKE
    '\u20ac'   #  0xA4 -> EURO SIGN
    '\u201e'   #  0xA5 -> DOUBLE LOW-9 QUOTATION MARK
    '\u0160'   #  0xA6 -> LATIN CAPITAL LETTER S WITH CARON
    '\xa7'     #  0xA7 -> SECTION SIGN
    '\u0161'   #  0xA8 -> LATIN SMALL LETTER S WITH CARON
    '\xa9'     #  0xA9 -> COPYRIGHT SIGN
    '\u0218'   #  0xAA -> LATIN CAPITAL LETTER S WITH COMMA BELOW
    '\xab'     #  0xAB -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u0179'   #  0xAC -> LATIN CAPITAL LETTER Z WITH ACUTE
    '\xad'     #  0xAD -> SOFT HYPHEN
    '\u017a'   #  0xAE -> LATIN SMALL LETTER Z WITH ACUTE
    '\u017b'   #  0xAF -> LATIN CAPITAL LETTER Z WITH DOT ABOVE
    '\xb0'     #  0xB0 -> DEGREE SIGN
    '\xb1'     #  0xB1 -> PLUS-MINUS SIGN
    '\u010c'   #  0xB2 -> LATIN CAPITAL LETTER C WITH CARON
    '\u0142'   #  0xB3 -> LATIN SMALL LETTER L WITH STROKE
    '\u017d'   #  0xB4 -> LATIN CAPITAL LETTER Z WITH CARON
    '\u201d'   #  0xB5 -> RIGHT DOUBLE QUOTATION MARK
    '\xb6'     #  0xB6 -> PILCROW SIGN
    '\xb7'     #  0xB7 -> MIDDLE DOT
    '\u017e'   #  0xB8 -> LATIN SMALL LETTER Z WITH CARON
    '\u010d'   #  0xB9 -> LATIN SMALL LETTER C WITH CARON
    '\u0219'   #  0xBA -> LATIN SMALL LETTER S WITH COMMA BELOW
    '\xbb'     #  0xBB -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u0152'   #  0xBC -> LATIN CAPITAL LIGATURE OE
    '\u0153'   #  0xBD -> LATIN SMALL LIGATURE OE
    '\u0178'   #  0xBE -> LATIN CAPITAL LETTER Y WITH DIAERESIS
    '\u017c'   #  0xBF -> LATIN SMALL LETTER Z WITH DOT ABOVE
    '\xc0'     #  0xC0 -> LATIN CAPITAL LETTER A WITH GRAVE
    '\xc1'     #  0xC1 -> LATIN CAPITAL LETTER A WITH ACUTE
    '\xc2'     #  0xC2 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    '\u0102'   #  0xC3 -> LATIN CAPITAL LETTER A WITH BREVE
    '\xc4'     #  0xC4 -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\u0106'   #  0xC5 -> LATIN CAPITAL LETTER C WITH ACUTE
    '\xc6'     #  0xC6 -> LATIN CAPITAL LETTER AE
    '\xc7'     #  0xC7 -> LATIN CAPITAL LETTER C WITH CEDILLA
    '\xc8'     #  0xC8 -> LATIN CAPITAL LETTER E WITH GRAVE
    '\xc9'     #  0xC9 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\xca'     #  0xCA -> LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    '\xcb'     #  0xCB -> LATIN CAPITAL LETTER E WITH DIAERESIS
    '\xcc'     #  0xCC -> LATIN CAPITAL LETTER I WITH GRAVE
    '\xcd'     #  0xCD -> LATIN CAPITAL LETTER I WITH ACUTE
    '\xce'     #  0xCE -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    '\xcf'     #  0xCF -> LATIN CAPITAL LETTER I WITH DIAERESIS
    '\u0110'   #  0xD0 -> LATIN CAPITAL LETTER D WITH STROKE
    '\u0143'   #  0xD1 -> LATIN CAPITAL LETTER N WITH ACUTE
    '\xd2'     #  0xD2 -> LATIN CAPITAL LETTER O WITH GRAVE
    '\xd3'     #  0xD3 -> LATIN CAPITAL LETTER O WITH ACUTE
    '\xd4'     #  0xD4 -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    '\u0150'   #  0xD5 -> LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
    '\xd6'     #  0xD6 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\u015a'   #  0xD7 -> LATIN CAPITAL LETTER S WITH ACUTE
    '\u0170'   #  0xD8 -> LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
    '\xd9'     #  0xD9 -> LATIN CAPITAL LETTER U WITH GRAVE
    '\xda'     #  0xDA -> LATIN CAPITAL LETTER U WITH ACUTE
    '\xdb'     #  0xDB -> LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    '\xdc'     #  0xDC -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\u0118'   #  0xDD -> LATIN CAPITAL LETTER E WITH OGONEK
    '\u021a'   #  0xDE -> LATIN CAPITAL LETTER T WITH COMMA BELOW
    '\xdf'     #  0xDF -> LATIN SMALL LETTER SHARP S
    '\xe0'     #  0xE0 -> LATIN SMALL LETTER A WITH GRAVE
    '\xe1'     #  0xE1 -> LATIN SMALL LETTER A WITH ACUTE
    '\xe2'     #  0xE2 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\u0103'   #  0xE3 -> LATIN SMALL LETTER A WITH BREVE
    '\xe4'     #  0xE4 -> LATIN SMALL LETTER A WITH DIAERESIS
    '\u0107'   #  0xE5 -> LATIN SMALL LETTER C WITH ACUTE
    '\xe6'     #  0xE6 -> LATIN SMALL LETTER AE
    '\xe7'     #  0xE7 -> LATIN SMALL LETTER C WITH CEDILLA
    '\xe8'     #  0xE8 -> LATIN SMALL LETTER E WITH GRAVE
    '\xe9'     #  0xE9 -> LATIN SMALL LETTER E WITH ACUTE
    '\xea'     #  0xEA -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xeb'     #  0xEB -> LATIN SMALL LETTER E WITH DIAERESIS
    '\xec'     #  0xEC -> LATIN SMALL LETTER I WITH GRAVE
    '\xed'     #  0xED -> LATIN SMALL LETTER I WITH ACUTE
    '\xee'     #  0xEE -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\xef'     #  0xEF -> LATIN SMALL LETTER I WITH DIAERESIS
    '\u0111'   #  0xF0 -> LATIN SMALL LETTER D WITH STROKE
    '\u0144'   #  0xF1 -> LATIN SMALL LETTER N WITH ACUTE
    '\xf2'     #  0xF2 -> LATIN SMALL LETTER O WITH GRAVE
    '\xf3'     #  0xF3 -> LATIN SMALL LETTER O WITH ACUTE
    '\xf4'     #  0xF4 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\u0151'   #  0xF5 -> LATIN SMALL LETTER O WITH DOUBLE ACUTE
    '\xf6'     #  0xF6 -> LATIN SMALL LETTER O WITH DIAERESIS
    '\u015b'   #  0xF7 -> LATIN SMALL LETTER S WITH ACUTE
    '\u0171'   #  0xF8 -> LATIN SMALL LETTER U WITH DOUBLE ACUTE
    '\xf9'     #  0xF9 -> LATIN SMALL LETTER U WITH GRAVE
    '\xfa'     #  0xFA -> LATIN SMALL LETTER U WITH ACUTE
    '\xfb'     #  0xFB -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\xfc'     #  0xFC -> LATIN SMALL LETTER U WITH DIAERESIS
    '\u0119'   #  0xFD -> LATIN SMALL LETTER E WITH OGONEK
    '\u021b'   #  0xFE -> LATIN SMALL LETTER T WITH COMMA BELOW
    '\xff'     #  0xFF -> LATIN SMALL LETTER Y WITH DIAERESIS
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/shift_jis.py000064400000002017151153537610011060 0ustar00#
# shift_jis.py: Python Unicode Codec for SHIFT_JIS
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#

import _codecs_jp, codecs
import _multibytecodec as mbc

codec = _codecs_jp.getcodec('shift_jis')

class Codec(codecs.Codec):
    encode = codec.encode
    decode = codec.decode

class IncrementalEncoder(mbc.MultibyteIncrementalEncoder,
                         codecs.IncrementalEncoder):
    codec = codec

class IncrementalDecoder(mbc.MultibyteIncrementalDecoder,
                         codecs.IncrementalDecoder):
    codec = codec

class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader):
    codec = codec

class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
    codec = codec

def getregentry():
    return codecs.CodecInfo(
        name='shift_jis',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/utf_7.py000064400000001662151153537610010127 0ustar00""" Python 'utf-7' Codec

Written by Brian Quinlan (brian@sweetapp.com).
"""
import codecs

### Codec APIs

encode = codecs.utf_7_encode

def decode(input, errors='strict'):
    return codecs.utf_7_decode(input, errors, True)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.utf_7_encode(input, self.errors)[0]

class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
    _buffer_decode = codecs.utf_7_decode

class StreamWriter(codecs.StreamWriter):
    encode = codecs.utf_7_encode

class StreamReader(codecs.StreamReader):
    decode = codecs.utf_7_decode

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='utf-7',
        encode=encode,
        decode=decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/ptcp154.py000064400000033277151153537610010312 0ustar00""" Python Character Mapping Codec generated from 'PTCP154.txt' with gencodec.py.

Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
(c) Copyright 2000 Guido van Rossum.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='ptcp154',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE (DEL)
    '\u0496'   #  0x80 -> CYRILLIC CAPITAL LETTER ZHE WITH DESCENDER
    '\u0492'   #  0x81 -> CYRILLIC CAPITAL LETTER GHE WITH STROKE
    '\u04ee'   #  0x82 -> CYRILLIC CAPITAL LETTER U WITH MACRON
    '\u0493'   #  0x83 -> CYRILLIC SMALL LETTER GHE WITH STROKE
    '\u201e'   #  0x84 -> DOUBLE LOW-9 QUOTATION MARK
    '\u2026'   #  0x85 -> HORIZONTAL ELLIPSIS
    '\u04b6'   #  0x86 -> CYRILLIC CAPITAL LETTER CHE WITH DESCENDER
    '\u04ae'   #  0x87 -> CYRILLIC CAPITAL LETTER STRAIGHT U
    '\u04b2'   #  0x88 -> CYRILLIC CAPITAL LETTER HA WITH DESCENDER
    '\u04af'   #  0x89 -> CYRILLIC SMALL LETTER STRAIGHT U
    '\u04a0'   #  0x8A -> CYRILLIC CAPITAL LETTER BASHKIR KA
    '\u04e2'   #  0x8B -> CYRILLIC CAPITAL LETTER I WITH MACRON
    '\u04a2'   #  0x8C -> CYRILLIC CAPITAL LETTER EN WITH DESCENDER
    '\u049a'   #  0x8D -> CYRILLIC CAPITAL LETTER KA WITH DESCENDER
    '\u04ba'   #  0x8E -> CYRILLIC CAPITAL LETTER SHHA
    '\u04b8'   #  0x8F -> CYRILLIC CAPITAL LETTER CHE WITH VERTICAL STROKE
    '\u0497'   #  0x90 -> CYRILLIC SMALL LETTER ZHE WITH DESCENDER
    '\u2018'   #  0x91 -> LEFT SINGLE QUOTATION MARK
    '\u2019'   #  0x92 -> RIGHT SINGLE QUOTATION MARK
    '\u201c'   #  0x93 -> LEFT DOUBLE QUOTATION MARK
    '\u201d'   #  0x94 -> RIGHT DOUBLE QUOTATION MARK
    '\u2022'   #  0x95 -> BULLET
    '\u2013'   #  0x96 -> EN DASH
    '\u2014'   #  0x97 -> EM DASH
    '\u04b3'   #  0x98 -> CYRILLIC SMALL LETTER HA WITH DESCENDER
    '\u04b7'   #  0x99 -> CYRILLIC SMALL LETTER CHE WITH DESCENDER
    '\u04a1'   #  0x9A -> CYRILLIC SMALL LETTER BASHKIR KA
    '\u04e3'   #  0x9B -> CYRILLIC SMALL LETTER I WITH MACRON
    '\u04a3'   #  0x9C -> CYRILLIC SMALL LETTER EN WITH DESCENDER
    '\u049b'   #  0x9D -> CYRILLIC SMALL LETTER KA WITH DESCENDER
    '\u04bb'   #  0x9E -> CYRILLIC SMALL LETTER SHHA
    '\u04b9'   #  0x9F -> CYRILLIC SMALL LETTER CHE WITH VERTICAL STROKE
    '\xa0'     #  0xA0 -> NO-BREAK SPACE
    '\u040e'   #  0xA1 -> CYRILLIC CAPITAL LETTER SHORT U (Byelorussian)
    '\u045e'   #  0xA2 -> CYRILLIC SMALL LETTER SHORT U (Byelorussian)
    '\u0408'   #  0xA3 -> CYRILLIC CAPITAL LETTER JE
    '\u04e8'   #  0xA4 -> CYRILLIC CAPITAL LETTER BARRED O
    '\u0498'   #  0xA5 -> CYRILLIC CAPITAL LETTER ZE WITH DESCENDER
    '\u04b0'   #  0xA6 -> CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE
    '\xa7'     #  0xA7 -> SECTION SIGN
    '\u0401'   #  0xA8 -> CYRILLIC CAPITAL LETTER IO
    '\xa9'     #  0xA9 -> COPYRIGHT SIGN
    '\u04d8'   #  0xAA -> CYRILLIC CAPITAL LETTER SCHWA
    '\xab'     #  0xAB -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xac'     #  0xAC -> NOT SIGN
    '\u04ef'   #  0xAD -> CYRILLIC SMALL LETTER U WITH MACRON
    '\xae'     #  0xAE -> REGISTERED SIGN
    '\u049c'   #  0xAF -> CYRILLIC CAPITAL LETTER KA WITH VERTICAL STROKE
    '\xb0'     #  0xB0 -> DEGREE SIGN
    '\u04b1'   #  0xB1 -> CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE
    '\u0406'   #  0xB2 -> CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
    '\u0456'   #  0xB3 -> CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
    '\u0499'   #  0xB4 -> CYRILLIC SMALL LETTER ZE WITH DESCENDER
    '\u04e9'   #  0xB5 -> CYRILLIC SMALL LETTER BARRED O
    '\xb6'     #  0xB6 -> PILCROW SIGN
    '\xb7'     #  0xB7 -> MIDDLE DOT
    '\u0451'   #  0xB8 -> CYRILLIC SMALL LETTER IO
    '\u2116'   #  0xB9 -> NUMERO SIGN
    '\u04d9'   #  0xBA -> CYRILLIC SMALL LETTER SCHWA
    '\xbb'     #  0xBB -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u0458'   #  0xBC -> CYRILLIC SMALL LETTER JE
    '\u04aa'   #  0xBD -> CYRILLIC CAPITAL LETTER ES WITH DESCENDER
    '\u04ab'   #  0xBE -> CYRILLIC SMALL LETTER ES WITH DESCENDER
    '\u049d'   #  0xBF -> CYRILLIC SMALL LETTER KA WITH VERTICAL STROKE
    '\u0410'   #  0xC0 -> CYRILLIC CAPITAL LETTER A
    '\u0411'   #  0xC1 -> CYRILLIC CAPITAL LETTER BE
    '\u0412'   #  0xC2 -> CYRILLIC CAPITAL LETTER VE
    '\u0413'   #  0xC3 -> CYRILLIC CAPITAL LETTER GHE
    '\u0414'   #  0xC4 -> CYRILLIC CAPITAL LETTER DE
    '\u0415'   #  0xC5 -> CYRILLIC CAPITAL LETTER IE
    '\u0416'   #  0xC6 -> CYRILLIC CAPITAL LETTER ZHE
    '\u0417'   #  0xC7 -> CYRILLIC CAPITAL LETTER ZE
    '\u0418'   #  0xC8 -> CYRILLIC CAPITAL LETTER I
    '\u0419'   #  0xC9 -> CYRILLIC CAPITAL LETTER SHORT I
    '\u041a'   #  0xCA -> CYRILLIC CAPITAL LETTER KA
    '\u041b'   #  0xCB -> CYRILLIC CAPITAL LETTER EL
    '\u041c'   #  0xCC -> CYRILLIC CAPITAL LETTER EM
    '\u041d'   #  0xCD -> CYRILLIC CAPITAL LETTER EN
    '\u041e'   #  0xCE -> CYRILLIC CAPITAL LETTER O
    '\u041f'   #  0xCF -> CYRILLIC CAPITAL LETTER PE
    '\u0420'   #  0xD0 -> CYRILLIC CAPITAL LETTER ER
    '\u0421'   #  0xD1 -> CYRILLIC CAPITAL LETTER ES
    '\u0422'   #  0xD2 -> CYRILLIC CAPITAL LETTER TE
    '\u0423'   #  0xD3 -> CYRILLIC CAPITAL LETTER U
    '\u0424'   #  0xD4 -> CYRILLIC CAPITAL LETTER EF
    '\u0425'   #  0xD5 -> CYRILLIC CAPITAL LETTER HA
    '\u0426'   #  0xD6 -> CYRILLIC CAPITAL LETTER TSE
    '\u0427'   #  0xD7 -> CYRILLIC CAPITAL LETTER CHE
    '\u0428'   #  0xD8 -> CYRILLIC CAPITAL LETTER SHA
    '\u0429'   #  0xD9 -> CYRILLIC CAPITAL LETTER SHCHA
    '\u042a'   #  0xDA -> CYRILLIC CAPITAL LETTER HARD SIGN
    '\u042b'   #  0xDB -> CYRILLIC CAPITAL LETTER YERU
    '\u042c'   #  0xDC -> CYRILLIC CAPITAL LETTER SOFT SIGN
    '\u042d'   #  0xDD -> CYRILLIC CAPITAL LETTER E
    '\u042e'   #  0xDE -> CYRILLIC CAPITAL LETTER YU
    '\u042f'   #  0xDF -> CYRILLIC CAPITAL LETTER YA
    '\u0430'   #  0xE0 -> CYRILLIC SMALL LETTER A
    '\u0431'   #  0xE1 -> CYRILLIC SMALL LETTER BE
    '\u0432'   #  0xE2 -> CYRILLIC SMALL LETTER VE
    '\u0433'   #  0xE3 -> CYRILLIC SMALL LETTER GHE
    '\u0434'   #  0xE4 -> CYRILLIC SMALL LETTER DE
    '\u0435'   #  0xE5 -> CYRILLIC SMALL LETTER IE
    '\u0436'   #  0xE6 -> CYRILLIC SMALL LETTER ZHE
    '\u0437'   #  0xE7 -> CYRILLIC SMALL LETTER ZE
    '\u0438'   #  0xE8 -> CYRILLIC SMALL LETTER I
    '\u0439'   #  0xE9 -> CYRILLIC SMALL LETTER SHORT I
    '\u043a'   #  0xEA -> CYRILLIC SMALL LETTER KA
    '\u043b'   #  0xEB -> CYRILLIC SMALL LETTER EL
    '\u043c'   #  0xEC -> CYRILLIC SMALL LETTER EM
    '\u043d'   #  0xED -> CYRILLIC SMALL LETTER EN
    '\u043e'   #  0xEE -> CYRILLIC SMALL LETTER O
    '\u043f'   #  0xEF -> CYRILLIC SMALL LETTER PE
    '\u0440'   #  0xF0 -> CYRILLIC SMALL LETTER ER
    '\u0441'   #  0xF1 -> CYRILLIC SMALL LETTER ES
    '\u0442'   #  0xF2 -> CYRILLIC SMALL LETTER TE
    '\u0443'   #  0xF3 -> CYRILLIC SMALL LETTER U
    '\u0444'   #  0xF4 -> CYRILLIC SMALL LETTER EF
    '\u0445'   #  0xF5 -> CYRILLIC SMALL LETTER HA
    '\u0446'   #  0xF6 -> CYRILLIC SMALL LETTER TSE
    '\u0447'   #  0xF7 -> CYRILLIC SMALL LETTER CHE
    '\u0448'   #  0xF8 -> CYRILLIC SMALL LETTER SHA
    '\u0449'   #  0xF9 -> CYRILLIC SMALL LETTER SHCHA
    '\u044a'   #  0xFA -> CYRILLIC SMALL LETTER HARD SIGN
    '\u044b'   #  0xFB -> CYRILLIC SMALL LETTER YERU
    '\u044c'   #  0xFC -> CYRILLIC SMALL LETTER SOFT SIGN
    '\u044d'   #  0xFD -> CYRILLIC SMALL LETTER E
    '\u044e'   #  0xFE -> CYRILLIC SMALL LETTER YU
    '\u044f'   #  0xFF -> CYRILLIC SMALL LETTER YA
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/iso8859_15.py000064400000031634151153537610010542 0ustar00""" Python Character Mapping Codec iso8859_15 generated from 'MAPPINGS/ISO8859/8859-15.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='iso8859-15',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\x80'     #  0x80 -> <control>
    '\x81'     #  0x81 -> <control>
    '\x82'     #  0x82 -> <control>
    '\x83'     #  0x83 -> <control>
    '\x84'     #  0x84 -> <control>
    '\x85'     #  0x85 -> <control>
    '\x86'     #  0x86 -> <control>
    '\x87'     #  0x87 -> <control>
    '\x88'     #  0x88 -> <control>
    '\x89'     #  0x89 -> <control>
    '\x8a'     #  0x8A -> <control>
    '\x8b'     #  0x8B -> <control>
    '\x8c'     #  0x8C -> <control>
    '\x8d'     #  0x8D -> <control>
    '\x8e'     #  0x8E -> <control>
    '\x8f'     #  0x8F -> <control>
    '\x90'     #  0x90 -> <control>
    '\x91'     #  0x91 -> <control>
    '\x92'     #  0x92 -> <control>
    '\x93'     #  0x93 -> <control>
    '\x94'     #  0x94 -> <control>
    '\x95'     #  0x95 -> <control>
    '\x96'     #  0x96 -> <control>
    '\x97'     #  0x97 -> <control>
    '\x98'     #  0x98 -> <control>
    '\x99'     #  0x99 -> <control>
    '\x9a'     #  0x9A -> <control>
    '\x9b'     #  0x9B -> <control>
    '\x9c'     #  0x9C -> <control>
    '\x9d'     #  0x9D -> <control>
    '\x9e'     #  0x9E -> <control>
    '\x9f'     #  0x9F -> <control>
    '\xa0'     #  0xA0 -> NO-BREAK SPACE
    '\xa1'     #  0xA1 -> INVERTED EXCLAMATION MARK
    '\xa2'     #  0xA2 -> CENT SIGN
    '\xa3'     #  0xA3 -> POUND SIGN
    '\u20ac'   #  0xA4 -> EURO SIGN
    '\xa5'     #  0xA5 -> YEN SIGN
    '\u0160'   #  0xA6 -> LATIN CAPITAL LETTER S WITH CARON
    '\xa7'     #  0xA7 -> SECTION SIGN
    '\u0161'   #  0xA8 -> LATIN SMALL LETTER S WITH CARON
    '\xa9'     #  0xA9 -> COPYRIGHT SIGN
    '\xaa'     #  0xAA -> FEMININE ORDINAL INDICATOR
    '\xab'     #  0xAB -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xac'     #  0xAC -> NOT SIGN
    '\xad'     #  0xAD -> SOFT HYPHEN
    '\xae'     #  0xAE -> REGISTERED SIGN
    '\xaf'     #  0xAF -> MACRON
    '\xb0'     #  0xB0 -> DEGREE SIGN
    '\xb1'     #  0xB1 -> PLUS-MINUS SIGN
    '\xb2'     #  0xB2 -> SUPERSCRIPT TWO
    '\xb3'     #  0xB3 -> SUPERSCRIPT THREE
    '\u017d'   #  0xB4 -> LATIN CAPITAL LETTER Z WITH CARON
    '\xb5'     #  0xB5 -> MICRO SIGN
    '\xb6'     #  0xB6 -> PILCROW SIGN
    '\xb7'     #  0xB7 -> MIDDLE DOT
    '\u017e'   #  0xB8 -> LATIN SMALL LETTER Z WITH CARON
    '\xb9'     #  0xB9 -> SUPERSCRIPT ONE
    '\xba'     #  0xBA -> MASCULINE ORDINAL INDICATOR
    '\xbb'     #  0xBB -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u0152'   #  0xBC -> LATIN CAPITAL LIGATURE OE
    '\u0153'   #  0xBD -> LATIN SMALL LIGATURE OE
    '\u0178'   #  0xBE -> LATIN CAPITAL LETTER Y WITH DIAERESIS
    '\xbf'     #  0xBF -> INVERTED QUESTION MARK
    '\xc0'     #  0xC0 -> LATIN CAPITAL LETTER A WITH GRAVE
    '\xc1'     #  0xC1 -> LATIN CAPITAL LETTER A WITH ACUTE
    '\xc2'     #  0xC2 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    '\xc3'     #  0xC3 -> LATIN CAPITAL LETTER A WITH TILDE
    '\xc4'     #  0xC4 -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\xc5'     #  0xC5 -> LATIN CAPITAL LETTER A WITH RING ABOVE
    '\xc6'     #  0xC6 -> LATIN CAPITAL LETTER AE
    '\xc7'     #  0xC7 -> LATIN CAPITAL LETTER C WITH CEDILLA
    '\xc8'     #  0xC8 -> LATIN CAPITAL LETTER E WITH GRAVE
    '\xc9'     #  0xC9 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\xca'     #  0xCA -> LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    '\xcb'     #  0xCB -> LATIN CAPITAL LETTER E WITH DIAERESIS
    '\xcc'     #  0xCC -> LATIN CAPITAL LETTER I WITH GRAVE
    '\xcd'     #  0xCD -> LATIN CAPITAL LETTER I WITH ACUTE
    '\xce'     #  0xCE -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    '\xcf'     #  0xCF -> LATIN CAPITAL LETTER I WITH DIAERESIS
    '\xd0'     #  0xD0 -> LATIN CAPITAL LETTER ETH
    '\xd1'     #  0xD1 -> LATIN CAPITAL LETTER N WITH TILDE
    '\xd2'     #  0xD2 -> LATIN CAPITAL LETTER O WITH GRAVE
    '\xd3'     #  0xD3 -> LATIN CAPITAL LETTER O WITH ACUTE
    '\xd4'     #  0xD4 -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    '\xd5'     #  0xD5 -> LATIN CAPITAL LETTER O WITH TILDE
    '\xd6'     #  0xD6 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xd7'     #  0xD7 -> MULTIPLICATION SIGN
    '\xd8'     #  0xD8 -> LATIN CAPITAL LETTER O WITH STROKE
    '\xd9'     #  0xD9 -> LATIN CAPITAL LETTER U WITH GRAVE
    '\xda'     #  0xDA -> LATIN CAPITAL LETTER U WITH ACUTE
    '\xdb'     #  0xDB -> LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    '\xdc'     #  0xDC -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\xdd'     #  0xDD -> LATIN CAPITAL LETTER Y WITH ACUTE
    '\xde'     #  0xDE -> LATIN CAPITAL LETTER THORN
    '\xdf'     #  0xDF -> LATIN SMALL LETTER SHARP S
    '\xe0'     #  0xE0 -> LATIN SMALL LETTER A WITH GRAVE
    '\xe1'     #  0xE1 -> LATIN SMALL LETTER A WITH ACUTE
    '\xe2'     #  0xE2 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\xe3'     #  0xE3 -> LATIN SMALL LETTER A WITH TILDE
    '\xe4'     #  0xE4 -> LATIN SMALL LETTER A WITH DIAERESIS
    '\xe5'     #  0xE5 -> LATIN SMALL LETTER A WITH RING ABOVE
    '\xe6'     #  0xE6 -> LATIN SMALL LETTER AE
    '\xe7'     #  0xE7 -> LATIN SMALL LETTER C WITH CEDILLA
    '\xe8'     #  0xE8 -> LATIN SMALL LETTER E WITH GRAVE
    '\xe9'     #  0xE9 -> LATIN SMALL LETTER E WITH ACUTE
    '\xea'     #  0xEA -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xeb'     #  0xEB -> LATIN SMALL LETTER E WITH DIAERESIS
    '\xec'     #  0xEC -> LATIN SMALL LETTER I WITH GRAVE
    '\xed'     #  0xED -> LATIN SMALL LETTER I WITH ACUTE
    '\xee'     #  0xEE -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\xef'     #  0xEF -> LATIN SMALL LETTER I WITH DIAERESIS
    '\xf0'     #  0xF0 -> LATIN SMALL LETTER ETH
    '\xf1'     #  0xF1 -> LATIN SMALL LETTER N WITH TILDE
    '\xf2'     #  0xF2 -> LATIN SMALL LETTER O WITH GRAVE
    '\xf3'     #  0xF3 -> LATIN SMALL LETTER O WITH ACUTE
    '\xf4'     #  0xF4 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xf5'     #  0xF5 -> LATIN SMALL LETTER O WITH TILDE
    '\xf6'     #  0xF6 -> LATIN SMALL LETTER O WITH DIAERESIS
    '\xf7'     #  0xF7 -> DIVISION SIGN
    '\xf8'     #  0xF8 -> LATIN SMALL LETTER O WITH STROKE
    '\xf9'     #  0xF9 -> LATIN SMALL LETTER U WITH GRAVE
    '\xfa'     #  0xFA -> LATIN SMALL LETTER U WITH ACUTE
    '\xfb'     #  0xFB -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\xfc'     #  0xFC -> LATIN SMALL LETTER U WITH DIAERESIS
    '\xfd'     #  0xFD -> LATIN SMALL LETTER Y WITH ACUTE
    '\xfe'     #  0xFE -> LATIN SMALL LETTER THORN
    '\xff'     #  0xFF -> LATIN SMALL LETTER Y WITH DIAERESIS
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/cp861.py000064400000103511151153537610007740 0ustar00""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP861.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_map)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_map)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp861',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )

### Decoding Map

decoding_map = codecs.make_identity_dict(range(256))
decoding_map.update({
    0x0080: 0x00c7,     #  LATIN CAPITAL LETTER C WITH CEDILLA
    0x0081: 0x00fc,     #  LATIN SMALL LETTER U WITH DIAERESIS
    0x0082: 0x00e9,     #  LATIN SMALL LETTER E WITH ACUTE
    0x0083: 0x00e2,     #  LATIN SMALL LETTER A WITH CIRCUMFLEX
    0x0084: 0x00e4,     #  LATIN SMALL LETTER A WITH DIAERESIS
    0x0085: 0x00e0,     #  LATIN SMALL LETTER A WITH GRAVE
    0x0086: 0x00e5,     #  LATIN SMALL LETTER A WITH RING ABOVE
    0x0087: 0x00e7,     #  LATIN SMALL LETTER C WITH CEDILLA
    0x0088: 0x00ea,     #  LATIN SMALL LETTER E WITH CIRCUMFLEX
    0x0089: 0x00eb,     #  LATIN SMALL LETTER E WITH DIAERESIS
    0x008a: 0x00e8,     #  LATIN SMALL LETTER E WITH GRAVE
    0x008b: 0x00d0,     #  LATIN CAPITAL LETTER ETH
    0x008c: 0x00f0,     #  LATIN SMALL LETTER ETH
    0x008d: 0x00de,     #  LATIN CAPITAL LETTER THORN
    0x008e: 0x00c4,     #  LATIN CAPITAL LETTER A WITH DIAERESIS
    0x008f: 0x00c5,     #  LATIN CAPITAL LETTER A WITH RING ABOVE
    0x0090: 0x00c9,     #  LATIN CAPITAL LETTER E WITH ACUTE
    0x0091: 0x00e6,     #  LATIN SMALL LIGATURE AE
    0x0092: 0x00c6,     #  LATIN CAPITAL LIGATURE AE
    0x0093: 0x00f4,     #  LATIN SMALL LETTER O WITH CIRCUMFLEX
    0x0094: 0x00f6,     #  LATIN SMALL LETTER O WITH DIAERESIS
    0x0095: 0x00fe,     #  LATIN SMALL LETTER THORN
    0x0096: 0x00fb,     #  LATIN SMALL LETTER U WITH CIRCUMFLEX
    0x0097: 0x00dd,     #  LATIN CAPITAL LETTER Y WITH ACUTE
    0x0098: 0x00fd,     #  LATIN SMALL LETTER Y WITH ACUTE
    0x0099: 0x00d6,     #  LATIN CAPITAL LETTER O WITH DIAERESIS
    0x009a: 0x00dc,     #  LATIN CAPITAL LETTER U WITH DIAERESIS
    0x009b: 0x00f8,     #  LATIN SMALL LETTER O WITH STROKE
    0x009c: 0x00a3,     #  POUND SIGN
    0x009d: 0x00d8,     #  LATIN CAPITAL LETTER O WITH STROKE
    0x009e: 0x20a7,     #  PESETA SIGN
    0x009f: 0x0192,     #  LATIN SMALL LETTER F WITH HOOK
    0x00a0: 0x00e1,     #  LATIN SMALL LETTER A WITH ACUTE
    0x00a1: 0x00ed,     #  LATIN SMALL LETTER I WITH ACUTE
    0x00a2: 0x00f3,     #  LATIN SMALL LETTER O WITH ACUTE
    0x00a3: 0x00fa,     #  LATIN SMALL LETTER U WITH ACUTE
    0x00a4: 0x00c1,     #  LATIN CAPITAL LETTER A WITH ACUTE
    0x00a5: 0x00cd,     #  LATIN CAPITAL LETTER I WITH ACUTE
    0x00a6: 0x00d3,     #  LATIN CAPITAL LETTER O WITH ACUTE
    0x00a7: 0x00da,     #  LATIN CAPITAL LETTER U WITH ACUTE
    0x00a8: 0x00bf,     #  INVERTED QUESTION MARK
    0x00a9: 0x2310,     #  REVERSED NOT SIGN
    0x00aa: 0x00ac,     #  NOT SIGN
    0x00ab: 0x00bd,     #  VULGAR FRACTION ONE HALF
    0x00ac: 0x00bc,     #  VULGAR FRACTION ONE QUARTER
    0x00ad: 0x00a1,     #  INVERTED EXCLAMATION MARK
    0x00ae: 0x00ab,     #  LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00af: 0x00bb,     #  RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00b0: 0x2591,     #  LIGHT SHADE
    0x00b1: 0x2592,     #  MEDIUM SHADE
    0x00b2: 0x2593,     #  DARK SHADE
    0x00b3: 0x2502,     #  BOX DRAWINGS LIGHT VERTICAL
    0x00b4: 0x2524,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
    0x00b5: 0x2561,     #  BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
    0x00b6: 0x2562,     #  BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
    0x00b7: 0x2556,     #  BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
    0x00b8: 0x2555,     #  BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
    0x00b9: 0x2563,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    0x00ba: 0x2551,     #  BOX DRAWINGS DOUBLE VERTICAL
    0x00bb: 0x2557,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
    0x00bc: 0x255d,     #  BOX DRAWINGS DOUBLE UP AND LEFT
    0x00bd: 0x255c,     #  BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
    0x00be: 0x255b,     #  BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
    0x00bf: 0x2510,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
    0x00c0: 0x2514,     #  BOX DRAWINGS LIGHT UP AND RIGHT
    0x00c1: 0x2534,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
    0x00c2: 0x252c,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    0x00c3: 0x251c,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    0x00c4: 0x2500,     #  BOX DRAWINGS LIGHT HORIZONTAL
    0x00c5: 0x253c,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    0x00c6: 0x255e,     #  BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
    0x00c7: 0x255f,     #  BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
    0x00c8: 0x255a,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
    0x00c9: 0x2554,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
    0x00ca: 0x2569,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    0x00cb: 0x2566,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    0x00cc: 0x2560,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    0x00cd: 0x2550,     #  BOX DRAWINGS DOUBLE HORIZONTAL
    0x00ce: 0x256c,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    0x00cf: 0x2567,     #  BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
    0x00d0: 0x2568,     #  BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
    0x00d1: 0x2564,     #  BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
    0x00d2: 0x2565,     #  BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
    0x00d3: 0x2559,     #  BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
    0x00d4: 0x2558,     #  BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
    0x00d5: 0x2552,     #  BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
    0x00d6: 0x2553,     #  BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
    0x00d7: 0x256b,     #  BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
    0x00d8: 0x256a,     #  BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
    0x00d9: 0x2518,     #  BOX DRAWINGS LIGHT UP AND LEFT
    0x00da: 0x250c,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
    0x00db: 0x2588,     #  FULL BLOCK
    0x00dc: 0x2584,     #  LOWER HALF BLOCK
    0x00dd: 0x258c,     #  LEFT HALF BLOCK
    0x00de: 0x2590,     #  RIGHT HALF BLOCK
    0x00df: 0x2580,     #  UPPER HALF BLOCK
    0x00e0: 0x03b1,     #  GREEK SMALL LETTER ALPHA
    0x00e1: 0x00df,     #  LATIN SMALL LETTER SHARP S
    0x00e2: 0x0393,     #  GREEK CAPITAL LETTER GAMMA
    0x00e3: 0x03c0,     #  GREEK SMALL LETTER PI
    0x00e4: 0x03a3,     #  GREEK CAPITAL LETTER SIGMA
    0x00e5: 0x03c3,     #  GREEK SMALL LETTER SIGMA
    0x00e6: 0x00b5,     #  MICRO SIGN
    0x00e7: 0x03c4,     #  GREEK SMALL LETTER TAU
    0x00e8: 0x03a6,     #  GREEK CAPITAL LETTER PHI
    0x00e9: 0x0398,     #  GREEK CAPITAL LETTER THETA
    0x00ea: 0x03a9,     #  GREEK CAPITAL LETTER OMEGA
    0x00eb: 0x03b4,     #  GREEK SMALL LETTER DELTA
    0x00ec: 0x221e,     #  INFINITY
    0x00ed: 0x03c6,     #  GREEK SMALL LETTER PHI
    0x00ee: 0x03b5,     #  GREEK SMALL LETTER EPSILON
    0x00ef: 0x2229,     #  INTERSECTION
    0x00f0: 0x2261,     #  IDENTICAL TO
    0x00f1: 0x00b1,     #  PLUS-MINUS SIGN
    0x00f2: 0x2265,     #  GREATER-THAN OR EQUAL TO
    0x00f3: 0x2264,     #  LESS-THAN OR EQUAL TO
    0x00f4: 0x2320,     #  TOP HALF INTEGRAL
    0x00f5: 0x2321,     #  BOTTOM HALF INTEGRAL
    0x00f6: 0x00f7,     #  DIVISION SIGN
    0x00f7: 0x2248,     #  ALMOST EQUAL TO
    0x00f8: 0x00b0,     #  DEGREE SIGN
    0x00f9: 0x2219,     #  BULLET OPERATOR
    0x00fa: 0x00b7,     #  MIDDLE DOT
    0x00fb: 0x221a,     #  SQUARE ROOT
    0x00fc: 0x207f,     #  SUPERSCRIPT LATIN SMALL LETTER N
    0x00fd: 0x00b2,     #  SUPERSCRIPT TWO
    0x00fe: 0x25a0,     #  BLACK SQUARE
    0x00ff: 0x00a0,     #  NO-BREAK SPACE
})

### Decoding Table

decoding_table = (
    '\x00'     #  0x0000 -> NULL
    '\x01'     #  0x0001 -> START OF HEADING
    '\x02'     #  0x0002 -> START OF TEXT
    '\x03'     #  0x0003 -> END OF TEXT
    '\x04'     #  0x0004 -> END OF TRANSMISSION
    '\x05'     #  0x0005 -> ENQUIRY
    '\x06'     #  0x0006 -> ACKNOWLEDGE
    '\x07'     #  0x0007 -> BELL
    '\x08'     #  0x0008 -> BACKSPACE
    '\t'       #  0x0009 -> HORIZONTAL TABULATION
    '\n'       #  0x000a -> LINE FEED
    '\x0b'     #  0x000b -> VERTICAL TABULATION
    '\x0c'     #  0x000c -> FORM FEED
    '\r'       #  0x000d -> CARRIAGE RETURN
    '\x0e'     #  0x000e -> SHIFT OUT
    '\x0f'     #  0x000f -> SHIFT IN
    '\x10'     #  0x0010 -> DATA LINK ESCAPE
    '\x11'     #  0x0011 -> DEVICE CONTROL ONE
    '\x12'     #  0x0012 -> DEVICE CONTROL TWO
    '\x13'     #  0x0013 -> DEVICE CONTROL THREE
    '\x14'     #  0x0014 -> DEVICE CONTROL FOUR
    '\x15'     #  0x0015 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x0016 -> SYNCHRONOUS IDLE
    '\x17'     #  0x0017 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x0018 -> CANCEL
    '\x19'     #  0x0019 -> END OF MEDIUM
    '\x1a'     #  0x001a -> SUBSTITUTE
    '\x1b'     #  0x001b -> ESCAPE
    '\x1c'     #  0x001c -> FILE SEPARATOR
    '\x1d'     #  0x001d -> GROUP SEPARATOR
    '\x1e'     #  0x001e -> RECORD SEPARATOR
    '\x1f'     #  0x001f -> UNIT SEPARATOR
    ' '        #  0x0020 -> SPACE
    '!'        #  0x0021 -> EXCLAMATION MARK
    '"'        #  0x0022 -> QUOTATION MARK
    '#'        #  0x0023 -> NUMBER SIGN
    '$'        #  0x0024 -> DOLLAR SIGN
    '%'        #  0x0025 -> PERCENT SIGN
    '&'        #  0x0026 -> AMPERSAND
    "'"        #  0x0027 -> APOSTROPHE
    '('        #  0x0028 -> LEFT PARENTHESIS
    ')'        #  0x0029 -> RIGHT PARENTHESIS
    '*'        #  0x002a -> ASTERISK
    '+'        #  0x002b -> PLUS SIGN
    ','        #  0x002c -> COMMA
    '-'        #  0x002d -> HYPHEN-MINUS
    '.'        #  0x002e -> FULL STOP
    '/'        #  0x002f -> SOLIDUS
    '0'        #  0x0030 -> DIGIT ZERO
    '1'        #  0x0031 -> DIGIT ONE
    '2'        #  0x0032 -> DIGIT TWO
    '3'        #  0x0033 -> DIGIT THREE
    '4'        #  0x0034 -> DIGIT FOUR
    '5'        #  0x0035 -> DIGIT FIVE
    '6'        #  0x0036 -> DIGIT SIX
    '7'        #  0x0037 -> DIGIT SEVEN
    '8'        #  0x0038 -> DIGIT EIGHT
    '9'        #  0x0039 -> DIGIT NINE
    ':'        #  0x003a -> COLON
    ';'        #  0x003b -> SEMICOLON
    '<'        #  0x003c -> LESS-THAN SIGN
    '='        #  0x003d -> EQUALS SIGN
    '>'        #  0x003e -> GREATER-THAN SIGN
    '?'        #  0x003f -> QUESTION MARK
    '@'        #  0x0040 -> COMMERCIAL AT
    'A'        #  0x0041 -> LATIN CAPITAL LETTER A
    'B'        #  0x0042 -> LATIN CAPITAL LETTER B
    'C'        #  0x0043 -> LATIN CAPITAL LETTER C
    'D'        #  0x0044 -> LATIN CAPITAL LETTER D
    'E'        #  0x0045 -> LATIN CAPITAL LETTER E
    'F'        #  0x0046 -> LATIN CAPITAL LETTER F
    'G'        #  0x0047 -> LATIN CAPITAL LETTER G
    'H'        #  0x0048 -> LATIN CAPITAL LETTER H
    'I'        #  0x0049 -> LATIN CAPITAL LETTER I
    'J'        #  0x004a -> LATIN CAPITAL LETTER J
    'K'        #  0x004b -> LATIN CAPITAL LETTER K
    'L'        #  0x004c -> LATIN CAPITAL LETTER L
    'M'        #  0x004d -> LATIN CAPITAL LETTER M
    'N'        #  0x004e -> LATIN CAPITAL LETTER N
    'O'        #  0x004f -> LATIN CAPITAL LETTER O
    'P'        #  0x0050 -> LATIN CAPITAL LETTER P
    'Q'        #  0x0051 -> LATIN CAPITAL LETTER Q
    'R'        #  0x0052 -> LATIN CAPITAL LETTER R
    'S'        #  0x0053 -> LATIN CAPITAL LETTER S
    'T'        #  0x0054 -> LATIN CAPITAL LETTER T
    'U'        #  0x0055 -> LATIN CAPITAL LETTER U
    'V'        #  0x0056 -> LATIN CAPITAL LETTER V
    'W'        #  0x0057 -> LATIN CAPITAL LETTER W
    'X'        #  0x0058 -> LATIN CAPITAL LETTER X
    'Y'        #  0x0059 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x005a -> LATIN CAPITAL LETTER Z
    '['        #  0x005b -> LEFT SQUARE BRACKET
    '\\'       #  0x005c -> REVERSE SOLIDUS
    ']'        #  0x005d -> RIGHT SQUARE BRACKET
    '^'        #  0x005e -> CIRCUMFLEX ACCENT
    '_'        #  0x005f -> LOW LINE
    '`'        #  0x0060 -> GRAVE ACCENT
    'a'        #  0x0061 -> LATIN SMALL LETTER A
    'b'        #  0x0062 -> LATIN SMALL LETTER B
    'c'        #  0x0063 -> LATIN SMALL LETTER C
    'd'        #  0x0064 -> LATIN SMALL LETTER D
    'e'        #  0x0065 -> LATIN SMALL LETTER E
    'f'        #  0x0066 -> LATIN SMALL LETTER F
    'g'        #  0x0067 -> LATIN SMALL LETTER G
    'h'        #  0x0068 -> LATIN SMALL LETTER H
    'i'        #  0x0069 -> LATIN SMALL LETTER I
    'j'        #  0x006a -> LATIN SMALL LETTER J
    'k'        #  0x006b -> LATIN SMALL LETTER K
    'l'        #  0x006c -> LATIN SMALL LETTER L
    'm'        #  0x006d -> LATIN SMALL LETTER M
    'n'        #  0x006e -> LATIN SMALL LETTER N
    'o'        #  0x006f -> LATIN SMALL LETTER O
    'p'        #  0x0070 -> LATIN SMALL LETTER P
    'q'        #  0x0071 -> LATIN SMALL LETTER Q
    'r'        #  0x0072 -> LATIN SMALL LETTER R
    's'        #  0x0073 -> LATIN SMALL LETTER S
    't'        #  0x0074 -> LATIN SMALL LETTER T
    'u'        #  0x0075 -> LATIN SMALL LETTER U
    'v'        #  0x0076 -> LATIN SMALL LETTER V
    'w'        #  0x0077 -> LATIN SMALL LETTER W
    'x'        #  0x0078 -> LATIN SMALL LETTER X
    'y'        #  0x0079 -> LATIN SMALL LETTER Y
    'z'        #  0x007a -> LATIN SMALL LETTER Z
    '{'        #  0x007b -> LEFT CURLY BRACKET
    '|'        #  0x007c -> VERTICAL LINE
    '}'        #  0x007d -> RIGHT CURLY BRACKET
    '~'        #  0x007e -> TILDE
    '\x7f'     #  0x007f -> DELETE
    '\xc7'     #  0x0080 -> LATIN CAPITAL LETTER C WITH CEDILLA
    '\xfc'     #  0x0081 -> LATIN SMALL LETTER U WITH DIAERESIS
    '\xe9'     #  0x0082 -> LATIN SMALL LETTER E WITH ACUTE
    '\xe2'     #  0x0083 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\xe4'     #  0x0084 -> LATIN SMALL LETTER A WITH DIAERESIS
    '\xe0'     #  0x0085 -> LATIN SMALL LETTER A WITH GRAVE
    '\xe5'     #  0x0086 -> LATIN SMALL LETTER A WITH RING ABOVE
    '\xe7'     #  0x0087 -> LATIN SMALL LETTER C WITH CEDILLA
    '\xea'     #  0x0088 -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xeb'     #  0x0089 -> LATIN SMALL LETTER E WITH DIAERESIS
    '\xe8'     #  0x008a -> LATIN SMALL LETTER E WITH GRAVE
    '\xd0'     #  0x008b -> LATIN CAPITAL LETTER ETH
    '\xf0'     #  0x008c -> LATIN SMALL LETTER ETH
    '\xde'     #  0x008d -> LATIN CAPITAL LETTER THORN
    '\xc4'     #  0x008e -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\xc5'     #  0x008f -> LATIN CAPITAL LETTER A WITH RING ABOVE
    '\xc9'     #  0x0090 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\xe6'     #  0x0091 -> LATIN SMALL LIGATURE AE
    '\xc6'     #  0x0092 -> LATIN CAPITAL LIGATURE AE
    '\xf4'     #  0x0093 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xf6'     #  0x0094 -> LATIN SMALL LETTER O WITH DIAERESIS
    '\xfe'     #  0x0095 -> LATIN SMALL LETTER THORN
    '\xfb'     #  0x0096 -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\xdd'     #  0x0097 -> LATIN CAPITAL LETTER Y WITH ACUTE
    '\xfd'     #  0x0098 -> LATIN SMALL LETTER Y WITH ACUTE
    '\xd6'     #  0x0099 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xdc'     #  0x009a -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\xf8'     #  0x009b -> LATIN SMALL LETTER O WITH STROKE
    '\xa3'     #  0x009c -> POUND SIGN
    '\xd8'     #  0x009d -> LATIN CAPITAL LETTER O WITH STROKE
    '\u20a7'   #  0x009e -> PESETA SIGN
    '\u0192'   #  0x009f -> LATIN SMALL LETTER F WITH HOOK
    '\xe1'     #  0x00a0 -> LATIN SMALL LETTER A WITH ACUTE
    '\xed'     #  0x00a1 -> LATIN SMALL LETTER I WITH ACUTE
    '\xf3'     #  0x00a2 -> LATIN SMALL LETTER O WITH ACUTE
    '\xfa'     #  0x00a3 -> LATIN SMALL LETTER U WITH ACUTE
    '\xc1'     #  0x00a4 -> LATIN CAPITAL LETTER A WITH ACUTE
    '\xcd'     #  0x00a5 -> LATIN CAPITAL LETTER I WITH ACUTE
    '\xd3'     #  0x00a6 -> LATIN CAPITAL LETTER O WITH ACUTE
    '\xda'     #  0x00a7 -> LATIN CAPITAL LETTER U WITH ACUTE
    '\xbf'     #  0x00a8 -> INVERTED QUESTION MARK
    '\u2310'   #  0x00a9 -> REVERSED NOT SIGN
    '\xac'     #  0x00aa -> NOT SIGN
    '\xbd'     #  0x00ab -> VULGAR FRACTION ONE HALF
    '\xbc'     #  0x00ac -> VULGAR FRACTION ONE QUARTER
    '\xa1'     #  0x00ad -> INVERTED EXCLAMATION MARK
    '\xab'     #  0x00ae -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbb'     #  0x00af -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u2591'   #  0x00b0 -> LIGHT SHADE
    '\u2592'   #  0x00b1 -> MEDIUM SHADE
    '\u2593'   #  0x00b2 -> DARK SHADE
    '\u2502'   #  0x00b3 -> BOX DRAWINGS LIGHT VERTICAL
    '\u2524'   #  0x00b4 -> BOX DRAWINGS LIGHT VERTICAL AND LEFT
    '\u2561'   #  0x00b5 -> BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
    '\u2562'   #  0x00b6 -> BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
    '\u2556'   #  0x00b7 -> BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
    '\u2555'   #  0x00b8 -> BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
    '\u2563'   #  0x00b9 -> BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    '\u2551'   #  0x00ba -> BOX DRAWINGS DOUBLE VERTICAL
    '\u2557'   #  0x00bb -> BOX DRAWINGS DOUBLE DOWN AND LEFT
    '\u255d'   #  0x00bc -> BOX DRAWINGS DOUBLE UP AND LEFT
    '\u255c'   #  0x00bd -> BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
    '\u255b'   #  0x00be -> BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
    '\u2510'   #  0x00bf -> BOX DRAWINGS LIGHT DOWN AND LEFT
    '\u2514'   #  0x00c0 -> BOX DRAWINGS LIGHT UP AND RIGHT
    '\u2534'   #  0x00c1 -> BOX DRAWINGS LIGHT UP AND HORIZONTAL
    '\u252c'   #  0x00c2 -> BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    '\u251c'   #  0x00c3 -> BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    '\u2500'   #  0x00c4 -> BOX DRAWINGS LIGHT HORIZONTAL
    '\u253c'   #  0x00c5 -> BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    '\u255e'   #  0x00c6 -> BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
    '\u255f'   #  0x00c7 -> BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
    '\u255a'   #  0x00c8 -> BOX DRAWINGS DOUBLE UP AND RIGHT
    '\u2554'   #  0x00c9 -> BOX DRAWINGS DOUBLE DOWN AND RIGHT
    '\u2569'   #  0x00ca -> BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    '\u2566'   #  0x00cb -> BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    '\u2560'   #  0x00cc -> BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    '\u2550'   #  0x00cd -> BOX DRAWINGS DOUBLE HORIZONTAL
    '\u256c'   #  0x00ce -> BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    '\u2567'   #  0x00cf -> BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
    '\u2568'   #  0x00d0 -> BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
    '\u2564'   #  0x00d1 -> BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
    '\u2565'   #  0x00d2 -> BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
    '\u2559'   #  0x00d3 -> BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
    '\u2558'   #  0x00d4 -> BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
    '\u2552'   #  0x00d5 -> BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
    '\u2553'   #  0x00d6 -> BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
    '\u256b'   #  0x00d7 -> BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
    '\u256a'   #  0x00d8 -> BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
    '\u2518'   #  0x00d9 -> BOX DRAWINGS LIGHT UP AND LEFT
    '\u250c'   #  0x00da -> BOX DRAWINGS LIGHT DOWN AND RIGHT
    '\u2588'   #  0x00db -> FULL BLOCK
    '\u2584'   #  0x00dc -> LOWER HALF BLOCK
    '\u258c'   #  0x00dd -> LEFT HALF BLOCK
    '\u2590'   #  0x00de -> RIGHT HALF BLOCK
    '\u2580'   #  0x00df -> UPPER HALF BLOCK
    '\u03b1'   #  0x00e0 -> GREEK SMALL LETTER ALPHA
    '\xdf'     #  0x00e1 -> LATIN SMALL LETTER SHARP S
    '\u0393'   #  0x00e2 -> GREEK CAPITAL LETTER GAMMA
    '\u03c0'   #  0x00e3 -> GREEK SMALL LETTER PI
    '\u03a3'   #  0x00e4 -> GREEK CAPITAL LETTER SIGMA
    '\u03c3'   #  0x00e5 -> GREEK SMALL LETTER SIGMA
    '\xb5'     #  0x00e6 -> MICRO SIGN
    '\u03c4'   #  0x00e7 -> GREEK SMALL LETTER TAU
    '\u03a6'   #  0x00e8 -> GREEK CAPITAL LETTER PHI
    '\u0398'   #  0x00e9 -> GREEK CAPITAL LETTER THETA
    '\u03a9'   #  0x00ea -> GREEK CAPITAL LETTER OMEGA
    '\u03b4'   #  0x00eb -> GREEK SMALL LETTER DELTA
    '\u221e'   #  0x00ec -> INFINITY
    '\u03c6'   #  0x00ed -> GREEK SMALL LETTER PHI
    '\u03b5'   #  0x00ee -> GREEK SMALL LETTER EPSILON
    '\u2229'   #  0x00ef -> INTERSECTION
    '\u2261'   #  0x00f0 -> IDENTICAL TO
    '\xb1'     #  0x00f1 -> PLUS-MINUS SIGN
    '\u2265'   #  0x00f2 -> GREATER-THAN OR EQUAL TO
    '\u2264'   #  0x00f3 -> LESS-THAN OR EQUAL TO
    '\u2320'   #  0x00f4 -> TOP HALF INTEGRAL
    '\u2321'   #  0x00f5 -> BOTTOM HALF INTEGRAL
    '\xf7'     #  0x00f6 -> DIVISION SIGN
    '\u2248'   #  0x00f7 -> ALMOST EQUAL TO
    '\xb0'     #  0x00f8 -> DEGREE SIGN
    '\u2219'   #  0x00f9 -> BULLET OPERATOR
    '\xb7'     #  0x00fa -> MIDDLE DOT
    '\u221a'   #  0x00fb -> SQUARE ROOT
    '\u207f'   #  0x00fc -> SUPERSCRIPT LATIN SMALL LETTER N
    '\xb2'     #  0x00fd -> SUPERSCRIPT TWO
    '\u25a0'   #  0x00fe -> BLACK SQUARE
    '\xa0'     #  0x00ff -> NO-BREAK SPACE
)

### Encoding Map

encoding_map = {
    0x0000: 0x0000,     #  NULL
    0x0001: 0x0001,     #  START OF HEADING
    0x0002: 0x0002,     #  START OF TEXT
    0x0003: 0x0003,     #  END OF TEXT
    0x0004: 0x0004,     #  END OF TRANSMISSION
    0x0005: 0x0005,     #  ENQUIRY
    0x0006: 0x0006,     #  ACKNOWLEDGE
    0x0007: 0x0007,     #  BELL
    0x0008: 0x0008,     #  BACKSPACE
    0x0009: 0x0009,     #  HORIZONTAL TABULATION
    0x000a: 0x000a,     #  LINE FEED
    0x000b: 0x000b,     #  VERTICAL TABULATION
    0x000c: 0x000c,     #  FORM FEED
    0x000d: 0x000d,     #  CARRIAGE RETURN
    0x000e: 0x000e,     #  SHIFT OUT
    0x000f: 0x000f,     #  SHIFT IN
    0x0010: 0x0010,     #  DATA LINK ESCAPE
    0x0011: 0x0011,     #  DEVICE CONTROL ONE
    0x0012: 0x0012,     #  DEVICE CONTROL TWO
    0x0013: 0x0013,     #  DEVICE CONTROL THREE
    0x0014: 0x0014,     #  DEVICE CONTROL FOUR
    0x0015: 0x0015,     #  NEGATIVE ACKNOWLEDGE
    0x0016: 0x0016,     #  SYNCHRONOUS IDLE
    0x0017: 0x0017,     #  END OF TRANSMISSION BLOCK
    0x0018: 0x0018,     #  CANCEL
    0x0019: 0x0019,     #  END OF MEDIUM
    0x001a: 0x001a,     #  SUBSTITUTE
    0x001b: 0x001b,     #  ESCAPE
    0x001c: 0x001c,     #  FILE SEPARATOR
    0x001d: 0x001d,     #  GROUP SEPARATOR
    0x001e: 0x001e,     #  RECORD SEPARATOR
    0x001f: 0x001f,     #  UNIT SEPARATOR
    0x0020: 0x0020,     #  SPACE
    0x0021: 0x0021,     #  EXCLAMATION MARK
    0x0022: 0x0022,     #  QUOTATION MARK
    0x0023: 0x0023,     #  NUMBER SIGN
    0x0024: 0x0024,     #  DOLLAR SIGN
    0x0025: 0x0025,     #  PERCENT SIGN
    0x0026: 0x0026,     #  AMPERSAND
    0x0027: 0x0027,     #  APOSTROPHE
    0x0028: 0x0028,     #  LEFT PARENTHESIS
    0x0029: 0x0029,     #  RIGHT PARENTHESIS
    0x002a: 0x002a,     #  ASTERISK
    0x002b: 0x002b,     #  PLUS SIGN
    0x002c: 0x002c,     #  COMMA
    0x002d: 0x002d,     #  HYPHEN-MINUS
    0x002e: 0x002e,     #  FULL STOP
    0x002f: 0x002f,     #  SOLIDUS
    0x0030: 0x0030,     #  DIGIT ZERO
    0x0031: 0x0031,     #  DIGIT ONE
    0x0032: 0x0032,     #  DIGIT TWO
    0x0033: 0x0033,     #  DIGIT THREE
    0x0034: 0x0034,     #  DIGIT FOUR
    0x0035: 0x0035,     #  DIGIT FIVE
    0x0036: 0x0036,     #  DIGIT SIX
    0x0037: 0x0037,     #  DIGIT SEVEN
    0x0038: 0x0038,     #  DIGIT EIGHT
    0x0039: 0x0039,     #  DIGIT NINE
    0x003a: 0x003a,     #  COLON
    0x003b: 0x003b,     #  SEMICOLON
    0x003c: 0x003c,     #  LESS-THAN SIGN
    0x003d: 0x003d,     #  EQUALS SIGN
    0x003e: 0x003e,     #  GREATER-THAN SIGN
    0x003f: 0x003f,     #  QUESTION MARK
    0x0040: 0x0040,     #  COMMERCIAL AT
    0x0041: 0x0041,     #  LATIN CAPITAL LETTER A
    0x0042: 0x0042,     #  LATIN CAPITAL LETTER B
    0x0043: 0x0043,     #  LATIN CAPITAL LETTER C
    0x0044: 0x0044,     #  LATIN CAPITAL LETTER D
    0x0045: 0x0045,     #  LATIN CAPITAL LETTER E
    0x0046: 0x0046,     #  LATIN CAPITAL LETTER F
    0x0047: 0x0047,     #  LATIN CAPITAL LETTER G
    0x0048: 0x0048,     #  LATIN CAPITAL LETTER H
    0x0049: 0x0049,     #  LATIN CAPITAL LETTER I
    0x004a: 0x004a,     #  LATIN CAPITAL LETTER J
    0x004b: 0x004b,     #  LATIN CAPITAL LETTER K
    0x004c: 0x004c,     #  LATIN CAPITAL LETTER L
    0x004d: 0x004d,     #  LATIN CAPITAL LETTER M
    0x004e: 0x004e,     #  LATIN CAPITAL LETTER N
    0x004f: 0x004f,     #  LATIN CAPITAL LETTER O
    0x0050: 0x0050,     #  LATIN CAPITAL LETTER P
    0x0051: 0x0051,     #  LATIN CAPITAL LETTER Q
    0x0052: 0x0052,     #  LATIN CAPITAL LETTER R
    0x0053: 0x0053,     #  LATIN CAPITAL LETTER S
    0x0054: 0x0054,     #  LATIN CAPITAL LETTER T
    0x0055: 0x0055,     #  LATIN CAPITAL LETTER U
    0x0056: 0x0056,     #  LATIN CAPITAL LETTER V
    0x0057: 0x0057,     #  LATIN CAPITAL LETTER W
    0x0058: 0x0058,     #  LATIN CAPITAL LETTER X
    0x0059: 0x0059,     #  LATIN CAPITAL LETTER Y
    0x005a: 0x005a,     #  LATIN CAPITAL LETTER Z
    0x005b: 0x005b,     #  LEFT SQUARE BRACKET
    0x005c: 0x005c,     #  REVERSE SOLIDUS
    0x005d: 0x005d,     #  RIGHT SQUARE BRACKET
    0x005e: 0x005e,     #  CIRCUMFLEX ACCENT
    0x005f: 0x005f,     #  LOW LINE
    0x0060: 0x0060,     #  GRAVE ACCENT
    0x0061: 0x0061,     #  LATIN SMALL LETTER A
    0x0062: 0x0062,     #  LATIN SMALL LETTER B
    0x0063: 0x0063,     #  LATIN SMALL LETTER C
    0x0064: 0x0064,     #  LATIN SMALL LETTER D
    0x0065: 0x0065,     #  LATIN SMALL LETTER E
    0x0066: 0x0066,     #  LATIN SMALL LETTER F
    0x0067: 0x0067,     #  LATIN SMALL LETTER G
    0x0068: 0x0068,     #  LATIN SMALL LETTER H
    0x0069: 0x0069,     #  LATIN SMALL LETTER I
    0x006a: 0x006a,     #  LATIN SMALL LETTER J
    0x006b: 0x006b,     #  LATIN SMALL LETTER K
    0x006c: 0x006c,     #  LATIN SMALL LETTER L
    0x006d: 0x006d,     #  LATIN SMALL LETTER M
    0x006e: 0x006e,     #  LATIN SMALL LETTER N
    0x006f: 0x006f,     #  LATIN SMALL LETTER O
    0x0070: 0x0070,     #  LATIN SMALL LETTER P
    0x0071: 0x0071,     #  LATIN SMALL LETTER Q
    0x0072: 0x0072,     #  LATIN SMALL LETTER R
    0x0073: 0x0073,     #  LATIN SMALL LETTER S
    0x0074: 0x0074,     #  LATIN SMALL LETTER T
    0x0075: 0x0075,     #  LATIN SMALL LETTER U
    0x0076: 0x0076,     #  LATIN SMALL LETTER V
    0x0077: 0x0077,     #  LATIN SMALL LETTER W
    0x0078: 0x0078,     #  LATIN SMALL LETTER X
    0x0079: 0x0079,     #  LATIN SMALL LETTER Y
    0x007a: 0x007a,     #  LATIN SMALL LETTER Z
    0x007b: 0x007b,     #  LEFT CURLY BRACKET
    0x007c: 0x007c,     #  VERTICAL LINE
    0x007d: 0x007d,     #  RIGHT CURLY BRACKET
    0x007e: 0x007e,     #  TILDE
    0x007f: 0x007f,     #  DELETE
    0x00a0: 0x00ff,     #  NO-BREAK SPACE
    0x00a1: 0x00ad,     #  INVERTED EXCLAMATION MARK
    0x00a3: 0x009c,     #  POUND SIGN
    0x00ab: 0x00ae,     #  LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00ac: 0x00aa,     #  NOT SIGN
    0x00b0: 0x00f8,     #  DEGREE SIGN
    0x00b1: 0x00f1,     #  PLUS-MINUS SIGN
    0x00b2: 0x00fd,     #  SUPERSCRIPT TWO
    0x00b5: 0x00e6,     #  MICRO SIGN
    0x00b7: 0x00fa,     #  MIDDLE DOT
    0x00bb: 0x00af,     #  RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00bc: 0x00ac,     #  VULGAR FRACTION ONE QUARTER
    0x00bd: 0x00ab,     #  VULGAR FRACTION ONE HALF
    0x00bf: 0x00a8,     #  INVERTED QUESTION MARK
    0x00c1: 0x00a4,     #  LATIN CAPITAL LETTER A WITH ACUTE
    0x00c4: 0x008e,     #  LATIN CAPITAL LETTER A WITH DIAERESIS
    0x00c5: 0x008f,     #  LATIN CAPITAL LETTER A WITH RING ABOVE
    0x00c6: 0x0092,     #  LATIN CAPITAL LIGATURE AE
    0x00c7: 0x0080,     #  LATIN CAPITAL LETTER C WITH CEDILLA
    0x00c9: 0x0090,     #  LATIN CAPITAL LETTER E WITH ACUTE
    0x00cd: 0x00a5,     #  LATIN CAPITAL LETTER I WITH ACUTE
    0x00d0: 0x008b,     #  LATIN CAPITAL LETTER ETH
    0x00d3: 0x00a6,     #  LATIN CAPITAL LETTER O WITH ACUTE
    0x00d6: 0x0099,     #  LATIN CAPITAL LETTER O WITH DIAERESIS
    0x00d8: 0x009d,     #  LATIN CAPITAL LETTER O WITH STROKE
    0x00da: 0x00a7,     #  LATIN CAPITAL LETTER U WITH ACUTE
    0x00dc: 0x009a,     #  LATIN CAPITAL LETTER U WITH DIAERESIS
    0x00dd: 0x0097,     #  LATIN CAPITAL LETTER Y WITH ACUTE
    0x00de: 0x008d,     #  LATIN CAPITAL LETTER THORN
    0x00df: 0x00e1,     #  LATIN SMALL LETTER SHARP S
    0x00e0: 0x0085,     #  LATIN SMALL LETTER A WITH GRAVE
    0x00e1: 0x00a0,     #  LATIN SMALL LETTER A WITH ACUTE
    0x00e2: 0x0083,     #  LATIN SMALL LETTER A WITH CIRCUMFLEX
    0x00e4: 0x0084,     #  LATIN SMALL LETTER A WITH DIAERESIS
    0x00e5: 0x0086,     #  LATIN SMALL LETTER A WITH RING ABOVE
    0x00e6: 0x0091,     #  LATIN SMALL LIGATURE AE
    0x00e7: 0x0087,     #  LATIN SMALL LETTER C WITH CEDILLA
    0x00e8: 0x008a,     #  LATIN SMALL LETTER E WITH GRAVE
    0x00e9: 0x0082,     #  LATIN SMALL LETTER E WITH ACUTE
    0x00ea: 0x0088,     #  LATIN SMALL LETTER E WITH CIRCUMFLEX
    0x00eb: 0x0089,     #  LATIN SMALL LETTER E WITH DIAERESIS
    0x00ed: 0x00a1,     #  LATIN SMALL LETTER I WITH ACUTE
    0x00f0: 0x008c,     #  LATIN SMALL LETTER ETH
    0x00f3: 0x00a2,     #  LATIN SMALL LETTER O WITH ACUTE
    0x00f4: 0x0093,     #  LATIN SMALL LETTER O WITH CIRCUMFLEX
    0x00f6: 0x0094,     #  LATIN SMALL LETTER O WITH DIAERESIS
    0x00f7: 0x00f6,     #  DIVISION SIGN
    0x00f8: 0x009b,     #  LATIN SMALL LETTER O WITH STROKE
    0x00fa: 0x00a3,     #  LATIN SMALL LETTER U WITH ACUTE
    0x00fb: 0x0096,     #  LATIN SMALL LETTER U WITH CIRCUMFLEX
    0x00fc: 0x0081,     #  LATIN SMALL LETTER U WITH DIAERESIS
    0x00fd: 0x0098,     #  LATIN SMALL LETTER Y WITH ACUTE
    0x00fe: 0x0095,     #  LATIN SMALL LETTER THORN
    0x0192: 0x009f,     #  LATIN SMALL LETTER F WITH HOOK
    0x0393: 0x00e2,     #  GREEK CAPITAL LETTER GAMMA
    0x0398: 0x00e9,     #  GREEK CAPITAL LETTER THETA
    0x03a3: 0x00e4,     #  GREEK CAPITAL LETTER SIGMA
    0x03a6: 0x00e8,     #  GREEK CAPITAL LETTER PHI
    0x03a9: 0x00ea,     #  GREEK CAPITAL LETTER OMEGA
    0x03b1: 0x00e0,     #  GREEK SMALL LETTER ALPHA
    0x03b4: 0x00eb,     #  GREEK SMALL LETTER DELTA
    0x03b5: 0x00ee,     #  GREEK SMALL LETTER EPSILON
    0x03c0: 0x00e3,     #  GREEK SMALL LETTER PI
    0x03c3: 0x00e5,     #  GREEK SMALL LETTER SIGMA
    0x03c4: 0x00e7,     #  GREEK SMALL LETTER TAU
    0x03c6: 0x00ed,     #  GREEK SMALL LETTER PHI
    0x207f: 0x00fc,     #  SUPERSCRIPT LATIN SMALL LETTER N
    0x20a7: 0x009e,     #  PESETA SIGN
    0x2219: 0x00f9,     #  BULLET OPERATOR
    0x221a: 0x00fb,     #  SQUARE ROOT
    0x221e: 0x00ec,     #  INFINITY
    0x2229: 0x00ef,     #  INTERSECTION
    0x2248: 0x00f7,     #  ALMOST EQUAL TO
    0x2261: 0x00f0,     #  IDENTICAL TO
    0x2264: 0x00f3,     #  LESS-THAN OR EQUAL TO
    0x2265: 0x00f2,     #  GREATER-THAN OR EQUAL TO
    0x2310: 0x00a9,     #  REVERSED NOT SIGN
    0x2320: 0x00f4,     #  TOP HALF INTEGRAL
    0x2321: 0x00f5,     #  BOTTOM HALF INTEGRAL
    0x2500: 0x00c4,     #  BOX DRAWINGS LIGHT HORIZONTAL
    0x2502: 0x00b3,     #  BOX DRAWINGS LIGHT VERTICAL
    0x250c: 0x00da,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
    0x2510: 0x00bf,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
    0x2514: 0x00c0,     #  BOX DRAWINGS LIGHT UP AND RIGHT
    0x2518: 0x00d9,     #  BOX DRAWINGS LIGHT UP AND LEFT
    0x251c: 0x00c3,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    0x2524: 0x00b4,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
    0x252c: 0x00c2,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    0x2534: 0x00c1,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
    0x253c: 0x00c5,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    0x2550: 0x00cd,     #  BOX DRAWINGS DOUBLE HORIZONTAL
    0x2551: 0x00ba,     #  BOX DRAWINGS DOUBLE VERTICAL
    0x2552: 0x00d5,     #  BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
    0x2553: 0x00d6,     #  BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
    0x2554: 0x00c9,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
    0x2555: 0x00b8,     #  BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
    0x2556: 0x00b7,     #  BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
    0x2557: 0x00bb,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
    0x2558: 0x00d4,     #  BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
    0x2559: 0x00d3,     #  BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
    0x255a: 0x00c8,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
    0x255b: 0x00be,     #  BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
    0x255c: 0x00bd,     #  BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
    0x255d: 0x00bc,     #  BOX DRAWINGS DOUBLE UP AND LEFT
    0x255e: 0x00c6,     #  BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
    0x255f: 0x00c7,     #  BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
    0x2560: 0x00cc,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    0x2561: 0x00b5,     #  BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
    0x2562: 0x00b6,     #  BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
    0x2563: 0x00b9,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    0x2564: 0x00d1,     #  BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
    0x2565: 0x00d2,     #  BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
    0x2566: 0x00cb,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    0x2567: 0x00cf,     #  BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
    0x2568: 0x00d0,     #  BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
    0x2569: 0x00ca,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    0x256a: 0x00d8,     #  BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
    0x256b: 0x00d7,     #  BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
    0x256c: 0x00ce,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    0x2580: 0x00df,     #  UPPER HALF BLOCK
    0x2584: 0x00dc,     #  LOWER HALF BLOCK
    0x2588: 0x00db,     #  FULL BLOCK
    0x258c: 0x00dd,     #  LEFT HALF BLOCK
    0x2590: 0x00de,     #  RIGHT HALF BLOCK
    0x2591: 0x00b0,     #  LIGHT SHADE
    0x2592: 0x00b1,     #  MEDIUM SHADE
    0x2593: 0x00b2,     #  DARK SHADE
    0x25a0: 0x00fe,     #  BLACK SQUARE
}
encodings/iso2022_jp_3.py000064400000002045151153537610011112 0ustar00#
# iso2022_jp_3.py: Python Unicode Codec for ISO2022_JP_3
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#

import _codecs_iso2022, codecs
import _multibytecodec as mbc

codec = _codecs_iso2022.getcodec('iso2022_jp_3')

class Codec(codecs.Codec):
    encode = codec.encode
    decode = codec.decode

class IncrementalEncoder(mbc.MultibyteIncrementalEncoder,
                         codecs.IncrementalEncoder):
    codec = codec

class IncrementalDecoder(mbc.MultibyteIncrementalDecoder,
                         codecs.IncrementalDecoder):
    codec = codec

class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader):
    codec = codec

class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
    codec = codec

def getregentry():
    return codecs.CodecInfo(
        name='iso2022_jp_3',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/mac_romanian.py000064400000032535151153537610011532 0ustar00""" Python Character Mapping Codec mac_romanian generated from 'MAPPINGS/VENDORS/APPLE/ROMANIAN.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='mac-romanian',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> CONTROL CHARACTER
    '\x01'     #  0x01 -> CONTROL CHARACTER
    '\x02'     #  0x02 -> CONTROL CHARACTER
    '\x03'     #  0x03 -> CONTROL CHARACTER
    '\x04'     #  0x04 -> CONTROL CHARACTER
    '\x05'     #  0x05 -> CONTROL CHARACTER
    '\x06'     #  0x06 -> CONTROL CHARACTER
    '\x07'     #  0x07 -> CONTROL CHARACTER
    '\x08'     #  0x08 -> CONTROL CHARACTER
    '\t'       #  0x09 -> CONTROL CHARACTER
    '\n'       #  0x0A -> CONTROL CHARACTER
    '\x0b'     #  0x0B -> CONTROL CHARACTER
    '\x0c'     #  0x0C -> CONTROL CHARACTER
    '\r'       #  0x0D -> CONTROL CHARACTER
    '\x0e'     #  0x0E -> CONTROL CHARACTER
    '\x0f'     #  0x0F -> CONTROL CHARACTER
    '\x10'     #  0x10 -> CONTROL CHARACTER
    '\x11'     #  0x11 -> CONTROL CHARACTER
    '\x12'     #  0x12 -> CONTROL CHARACTER
    '\x13'     #  0x13 -> CONTROL CHARACTER
    '\x14'     #  0x14 -> CONTROL CHARACTER
    '\x15'     #  0x15 -> CONTROL CHARACTER
    '\x16'     #  0x16 -> CONTROL CHARACTER
    '\x17'     #  0x17 -> CONTROL CHARACTER
    '\x18'     #  0x18 -> CONTROL CHARACTER
    '\x19'     #  0x19 -> CONTROL CHARACTER
    '\x1a'     #  0x1A -> CONTROL CHARACTER
    '\x1b'     #  0x1B -> CONTROL CHARACTER
    '\x1c'     #  0x1C -> CONTROL CHARACTER
    '\x1d'     #  0x1D -> CONTROL CHARACTER
    '\x1e'     #  0x1E -> CONTROL CHARACTER
    '\x1f'     #  0x1F -> CONTROL CHARACTER
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> CONTROL CHARACTER
    '\xc4'     #  0x80 -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\xc5'     #  0x81 -> LATIN CAPITAL LETTER A WITH RING ABOVE
    '\xc7'     #  0x82 -> LATIN CAPITAL LETTER C WITH CEDILLA
    '\xc9'     #  0x83 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\xd1'     #  0x84 -> LATIN CAPITAL LETTER N WITH TILDE
    '\xd6'     #  0x85 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xdc'     #  0x86 -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\xe1'     #  0x87 -> LATIN SMALL LETTER A WITH ACUTE
    '\xe0'     #  0x88 -> LATIN SMALL LETTER A WITH GRAVE
    '\xe2'     #  0x89 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\xe4'     #  0x8A -> LATIN SMALL LETTER A WITH DIAERESIS
    '\xe3'     #  0x8B -> LATIN SMALL LETTER A WITH TILDE
    '\xe5'     #  0x8C -> LATIN SMALL LETTER A WITH RING ABOVE
    '\xe7'     #  0x8D -> LATIN SMALL LETTER C WITH CEDILLA
    '\xe9'     #  0x8E -> LATIN SMALL LETTER E WITH ACUTE
    '\xe8'     #  0x8F -> LATIN SMALL LETTER E WITH GRAVE
    '\xea'     #  0x90 -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xeb'     #  0x91 -> LATIN SMALL LETTER E WITH DIAERESIS
    '\xed'     #  0x92 -> LATIN SMALL LETTER I WITH ACUTE
    '\xec'     #  0x93 -> LATIN SMALL LETTER I WITH GRAVE
    '\xee'     #  0x94 -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\xef'     #  0x95 -> LATIN SMALL LETTER I WITH DIAERESIS
    '\xf1'     #  0x96 -> LATIN SMALL LETTER N WITH TILDE
    '\xf3'     #  0x97 -> LATIN SMALL LETTER O WITH ACUTE
    '\xf2'     #  0x98 -> LATIN SMALL LETTER O WITH GRAVE
    '\xf4'     #  0x99 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xf6'     #  0x9A -> LATIN SMALL LETTER O WITH DIAERESIS
    '\xf5'     #  0x9B -> LATIN SMALL LETTER O WITH TILDE
    '\xfa'     #  0x9C -> LATIN SMALL LETTER U WITH ACUTE
    '\xf9'     #  0x9D -> LATIN SMALL LETTER U WITH GRAVE
    '\xfb'     #  0x9E -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\xfc'     #  0x9F -> LATIN SMALL LETTER U WITH DIAERESIS
    '\u2020'   #  0xA0 -> DAGGER
    '\xb0'     #  0xA1 -> DEGREE SIGN
    '\xa2'     #  0xA2 -> CENT SIGN
    '\xa3'     #  0xA3 -> POUND SIGN
    '\xa7'     #  0xA4 -> SECTION SIGN
    '\u2022'   #  0xA5 -> BULLET
    '\xb6'     #  0xA6 -> PILCROW SIGN
    '\xdf'     #  0xA7 -> LATIN SMALL LETTER SHARP S
    '\xae'     #  0xA8 -> REGISTERED SIGN
    '\xa9'     #  0xA9 -> COPYRIGHT SIGN
    '\u2122'   #  0xAA -> TRADE MARK SIGN
    '\xb4'     #  0xAB -> ACUTE ACCENT
    '\xa8'     #  0xAC -> DIAERESIS
    '\u2260'   #  0xAD -> NOT EQUAL TO
    '\u0102'   #  0xAE -> LATIN CAPITAL LETTER A WITH BREVE
    '\u0218'   #  0xAF -> LATIN CAPITAL LETTER S WITH COMMA BELOW # for Unicode 3.0 and later
    '\u221e'   #  0xB0 -> INFINITY
    '\xb1'     #  0xB1 -> PLUS-MINUS SIGN
    '\u2264'   #  0xB2 -> LESS-THAN OR EQUAL TO
    '\u2265'   #  0xB3 -> GREATER-THAN OR EQUAL TO
    '\xa5'     #  0xB4 -> YEN SIGN
    '\xb5'     #  0xB5 -> MICRO SIGN
    '\u2202'   #  0xB6 -> PARTIAL DIFFERENTIAL
    '\u2211'   #  0xB7 -> N-ARY SUMMATION
    '\u220f'   #  0xB8 -> N-ARY PRODUCT
    '\u03c0'   #  0xB9 -> GREEK SMALL LETTER PI
    '\u222b'   #  0xBA -> INTEGRAL
    '\xaa'     #  0xBB -> FEMININE ORDINAL INDICATOR
    '\xba'     #  0xBC -> MASCULINE ORDINAL INDICATOR
    '\u03a9'   #  0xBD -> GREEK CAPITAL LETTER OMEGA
    '\u0103'   #  0xBE -> LATIN SMALL LETTER A WITH BREVE
    '\u0219'   #  0xBF -> LATIN SMALL LETTER S WITH COMMA BELOW # for Unicode 3.0 and later
    '\xbf'     #  0xC0 -> INVERTED QUESTION MARK
    '\xa1'     #  0xC1 -> INVERTED EXCLAMATION MARK
    '\xac'     #  0xC2 -> NOT SIGN
    '\u221a'   #  0xC3 -> SQUARE ROOT
    '\u0192'   #  0xC4 -> LATIN SMALL LETTER F WITH HOOK
    '\u2248'   #  0xC5 -> ALMOST EQUAL TO
    '\u2206'   #  0xC6 -> INCREMENT
    '\xab'     #  0xC7 -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbb'     #  0xC8 -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u2026'   #  0xC9 -> HORIZONTAL ELLIPSIS
    '\xa0'     #  0xCA -> NO-BREAK SPACE
    '\xc0'     #  0xCB -> LATIN CAPITAL LETTER A WITH GRAVE
    '\xc3'     #  0xCC -> LATIN CAPITAL LETTER A WITH TILDE
    '\xd5'     #  0xCD -> LATIN CAPITAL LETTER O WITH TILDE
    '\u0152'   #  0xCE -> LATIN CAPITAL LIGATURE OE
    '\u0153'   #  0xCF -> LATIN SMALL LIGATURE OE
    '\u2013'   #  0xD0 -> EN DASH
    '\u2014'   #  0xD1 -> EM DASH
    '\u201c'   #  0xD2 -> LEFT DOUBLE QUOTATION MARK
    '\u201d'   #  0xD3 -> RIGHT DOUBLE QUOTATION MARK
    '\u2018'   #  0xD4 -> LEFT SINGLE QUOTATION MARK
    '\u2019'   #  0xD5 -> RIGHT SINGLE QUOTATION MARK
    '\xf7'     #  0xD6 -> DIVISION SIGN
    '\u25ca'   #  0xD7 -> LOZENGE
    '\xff'     #  0xD8 -> LATIN SMALL LETTER Y WITH DIAERESIS
    '\u0178'   #  0xD9 -> LATIN CAPITAL LETTER Y WITH DIAERESIS
    '\u2044'   #  0xDA -> FRACTION SLASH
    '\u20ac'   #  0xDB -> EURO SIGN
    '\u2039'   #  0xDC -> SINGLE LEFT-POINTING ANGLE QUOTATION MARK
    '\u203a'   #  0xDD -> SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
    '\u021a'   #  0xDE -> LATIN CAPITAL LETTER T WITH COMMA BELOW # for Unicode 3.0 and later
    '\u021b'   #  0xDF -> LATIN SMALL LETTER T WITH COMMA BELOW # for Unicode 3.0 and later
    '\u2021'   #  0xE0 -> DOUBLE DAGGER
    '\xb7'     #  0xE1 -> MIDDLE DOT
    '\u201a'   #  0xE2 -> SINGLE LOW-9 QUOTATION MARK
    '\u201e'   #  0xE3 -> DOUBLE LOW-9 QUOTATION MARK
    '\u2030'   #  0xE4 -> PER MILLE SIGN
    '\xc2'     #  0xE5 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    '\xca'     #  0xE6 -> LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    '\xc1'     #  0xE7 -> LATIN CAPITAL LETTER A WITH ACUTE
    '\xcb'     #  0xE8 -> LATIN CAPITAL LETTER E WITH DIAERESIS
    '\xc8'     #  0xE9 -> LATIN CAPITAL LETTER E WITH GRAVE
    '\xcd'     #  0xEA -> LATIN CAPITAL LETTER I WITH ACUTE
    '\xce'     #  0xEB -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    '\xcf'     #  0xEC -> LATIN CAPITAL LETTER I WITH DIAERESIS
    '\xcc'     #  0xED -> LATIN CAPITAL LETTER I WITH GRAVE
    '\xd3'     #  0xEE -> LATIN CAPITAL LETTER O WITH ACUTE
    '\xd4'     #  0xEF -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    '\uf8ff'   #  0xF0 -> Apple logo
    '\xd2'     #  0xF1 -> LATIN CAPITAL LETTER O WITH GRAVE
    '\xda'     #  0xF2 -> LATIN CAPITAL LETTER U WITH ACUTE
    '\xdb'     #  0xF3 -> LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    '\xd9'     #  0xF4 -> LATIN CAPITAL LETTER U WITH GRAVE
    '\u0131'   #  0xF5 -> LATIN SMALL LETTER DOTLESS I
    '\u02c6'   #  0xF6 -> MODIFIER LETTER CIRCUMFLEX ACCENT
    '\u02dc'   #  0xF7 -> SMALL TILDE
    '\xaf'     #  0xF8 -> MACRON
    '\u02d8'   #  0xF9 -> BREVE
    '\u02d9'   #  0xFA -> DOT ABOVE
    '\u02da'   #  0xFB -> RING ABOVE
    '\xb8'     #  0xFC -> CEDILLA
    '\u02dd'   #  0xFD -> DOUBLE ACUTE ACCENT
    '\u02db'   #  0xFE -> OGONEK
    '\u02c7'   #  0xFF -> CARON
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/iso8859_13.py000064400000031727151153537610010543 0ustar00""" Python Character Mapping Codec iso8859_13 generated from 'MAPPINGS/ISO8859/8859-13.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='iso8859-13',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\x80'     #  0x80 -> <control>
    '\x81'     #  0x81 -> <control>
    '\x82'     #  0x82 -> <control>
    '\x83'     #  0x83 -> <control>
    '\x84'     #  0x84 -> <control>
    '\x85'     #  0x85 -> <control>
    '\x86'     #  0x86 -> <control>
    '\x87'     #  0x87 -> <control>
    '\x88'     #  0x88 -> <control>
    '\x89'     #  0x89 -> <control>
    '\x8a'     #  0x8A -> <control>
    '\x8b'     #  0x8B -> <control>
    '\x8c'     #  0x8C -> <control>
    '\x8d'     #  0x8D -> <control>
    '\x8e'     #  0x8E -> <control>
    '\x8f'     #  0x8F -> <control>
    '\x90'     #  0x90 -> <control>
    '\x91'     #  0x91 -> <control>
    '\x92'     #  0x92 -> <control>
    '\x93'     #  0x93 -> <control>
    '\x94'     #  0x94 -> <control>
    '\x95'     #  0x95 -> <control>
    '\x96'     #  0x96 -> <control>
    '\x97'     #  0x97 -> <control>
    '\x98'     #  0x98 -> <control>
    '\x99'     #  0x99 -> <control>
    '\x9a'     #  0x9A -> <control>
    '\x9b'     #  0x9B -> <control>
    '\x9c'     #  0x9C -> <control>
    '\x9d'     #  0x9D -> <control>
    '\x9e'     #  0x9E -> <control>
    '\x9f'     #  0x9F -> <control>
    '\xa0'     #  0xA0 -> NO-BREAK SPACE
    '\u201d'   #  0xA1 -> RIGHT DOUBLE QUOTATION MARK
    '\xa2'     #  0xA2 -> CENT SIGN
    '\xa3'     #  0xA3 -> POUND SIGN
    '\xa4'     #  0xA4 -> CURRENCY SIGN
    '\u201e'   #  0xA5 -> DOUBLE LOW-9 QUOTATION MARK
    '\xa6'     #  0xA6 -> BROKEN BAR
    '\xa7'     #  0xA7 -> SECTION SIGN
    '\xd8'     #  0xA8 -> LATIN CAPITAL LETTER O WITH STROKE
    '\xa9'     #  0xA9 -> COPYRIGHT SIGN
    '\u0156'   #  0xAA -> LATIN CAPITAL LETTER R WITH CEDILLA
    '\xab'     #  0xAB -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xac'     #  0xAC -> NOT SIGN
    '\xad'     #  0xAD -> SOFT HYPHEN
    '\xae'     #  0xAE -> REGISTERED SIGN
    '\xc6'     #  0xAF -> LATIN CAPITAL LETTER AE
    '\xb0'     #  0xB0 -> DEGREE SIGN
    '\xb1'     #  0xB1 -> PLUS-MINUS SIGN
    '\xb2'     #  0xB2 -> SUPERSCRIPT TWO
    '\xb3'     #  0xB3 -> SUPERSCRIPT THREE
    '\u201c'   #  0xB4 -> LEFT DOUBLE QUOTATION MARK
    '\xb5'     #  0xB5 -> MICRO SIGN
    '\xb6'     #  0xB6 -> PILCROW SIGN
    '\xb7'     #  0xB7 -> MIDDLE DOT
    '\xf8'     #  0xB8 -> LATIN SMALL LETTER O WITH STROKE
    '\xb9'     #  0xB9 -> SUPERSCRIPT ONE
    '\u0157'   #  0xBA -> LATIN SMALL LETTER R WITH CEDILLA
    '\xbb'     #  0xBB -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbc'     #  0xBC -> VULGAR FRACTION ONE QUARTER
    '\xbd'     #  0xBD -> VULGAR FRACTION ONE HALF
    '\xbe'     #  0xBE -> VULGAR FRACTION THREE QUARTERS
    '\xe6'     #  0xBF -> LATIN SMALL LETTER AE
    '\u0104'   #  0xC0 -> LATIN CAPITAL LETTER A WITH OGONEK
    '\u012e'   #  0xC1 -> LATIN CAPITAL LETTER I WITH OGONEK
    '\u0100'   #  0xC2 -> LATIN CAPITAL LETTER A WITH MACRON
    '\u0106'   #  0xC3 -> LATIN CAPITAL LETTER C WITH ACUTE
    '\xc4'     #  0xC4 -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\xc5'     #  0xC5 -> LATIN CAPITAL LETTER A WITH RING ABOVE
    '\u0118'   #  0xC6 -> LATIN CAPITAL LETTER E WITH OGONEK
    '\u0112'   #  0xC7 -> LATIN CAPITAL LETTER E WITH MACRON
    '\u010c'   #  0xC8 -> LATIN CAPITAL LETTER C WITH CARON
    '\xc9'     #  0xC9 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\u0179'   #  0xCA -> LATIN CAPITAL LETTER Z WITH ACUTE
    '\u0116'   #  0xCB -> LATIN CAPITAL LETTER E WITH DOT ABOVE
    '\u0122'   #  0xCC -> LATIN CAPITAL LETTER G WITH CEDILLA
    '\u0136'   #  0xCD -> LATIN CAPITAL LETTER K WITH CEDILLA
    '\u012a'   #  0xCE -> LATIN CAPITAL LETTER I WITH MACRON
    '\u013b'   #  0xCF -> LATIN CAPITAL LETTER L WITH CEDILLA
    '\u0160'   #  0xD0 -> LATIN CAPITAL LETTER S WITH CARON
    '\u0143'   #  0xD1 -> LATIN CAPITAL LETTER N WITH ACUTE
    '\u0145'   #  0xD2 -> LATIN CAPITAL LETTER N WITH CEDILLA
    '\xd3'     #  0xD3 -> LATIN CAPITAL LETTER O WITH ACUTE
    '\u014c'   #  0xD4 -> LATIN CAPITAL LETTER O WITH MACRON
    '\xd5'     #  0xD5 -> LATIN CAPITAL LETTER O WITH TILDE
    '\xd6'     #  0xD6 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xd7'     #  0xD7 -> MULTIPLICATION SIGN
    '\u0172'   #  0xD8 -> LATIN CAPITAL LETTER U WITH OGONEK
    '\u0141'   #  0xD9 -> LATIN CAPITAL LETTER L WITH STROKE
    '\u015a'   #  0xDA -> LATIN CAPITAL LETTER S WITH ACUTE
    '\u016a'   #  0xDB -> LATIN CAPITAL LETTER U WITH MACRON
    '\xdc'     #  0xDC -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\u017b'   #  0xDD -> LATIN CAPITAL LETTER Z WITH DOT ABOVE
    '\u017d'   #  0xDE -> LATIN CAPITAL LETTER Z WITH CARON
    '\xdf'     #  0xDF -> LATIN SMALL LETTER SHARP S (German)
    '\u0105'   #  0xE0 -> LATIN SMALL LETTER A WITH OGONEK
    '\u012f'   #  0xE1 -> LATIN SMALL LETTER I WITH OGONEK
    '\u0101'   #  0xE2 -> LATIN SMALL LETTER A WITH MACRON
    '\u0107'   #  0xE3 -> LATIN SMALL LETTER C WITH ACUTE
    '\xe4'     #  0xE4 -> LATIN SMALL LETTER A WITH DIAERESIS
    '\xe5'     #  0xE5 -> LATIN SMALL LETTER A WITH RING ABOVE
    '\u0119'   #  0xE6 -> LATIN SMALL LETTER E WITH OGONEK
    '\u0113'   #  0xE7 -> LATIN SMALL LETTER E WITH MACRON
    '\u010d'   #  0xE8 -> LATIN SMALL LETTER C WITH CARON
    '\xe9'     #  0xE9 -> LATIN SMALL LETTER E WITH ACUTE
    '\u017a'   #  0xEA -> LATIN SMALL LETTER Z WITH ACUTE
    '\u0117'   #  0xEB -> LATIN SMALL LETTER E WITH DOT ABOVE
    '\u0123'   #  0xEC -> LATIN SMALL LETTER G WITH CEDILLA
    '\u0137'   #  0xED -> LATIN SMALL LETTER K WITH CEDILLA
    '\u012b'   #  0xEE -> LATIN SMALL LETTER I WITH MACRON
    '\u013c'   #  0xEF -> LATIN SMALL LETTER L WITH CEDILLA
    '\u0161'   #  0xF0 -> LATIN SMALL LETTER S WITH CARON
    '\u0144'   #  0xF1 -> LATIN SMALL LETTER N WITH ACUTE
    '\u0146'   #  0xF2 -> LATIN SMALL LETTER N WITH CEDILLA
    '\xf3'     #  0xF3 -> LATIN SMALL LETTER O WITH ACUTE
    '\u014d'   #  0xF4 -> LATIN SMALL LETTER O WITH MACRON
    '\xf5'     #  0xF5 -> LATIN SMALL LETTER O WITH TILDE
    '\xf6'     #  0xF6 -> LATIN SMALL LETTER O WITH DIAERESIS
    '\xf7'     #  0xF7 -> DIVISION SIGN
    '\u0173'   #  0xF8 -> LATIN SMALL LETTER U WITH OGONEK
    '\u0142'   #  0xF9 -> LATIN SMALL LETTER L WITH STROKE
    '\u015b'   #  0xFA -> LATIN SMALL LETTER S WITH ACUTE
    '\u016b'   #  0xFB -> LATIN SMALL LETTER U WITH MACRON
    '\xfc'     #  0xFC -> LATIN SMALL LETTER U WITH DIAERESIS
    '\u017c'   #  0xFD -> LATIN SMALL LETTER Z WITH DOT ABOVE
    '\u017e'   #  0xFE -> LATIN SMALL LETTER Z WITH CARON
    '\u2019'   #  0xFF -> RIGHT SINGLE QUOTATION MARK
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/koi8_u.py000064400000032702151153537610010300 0ustar00""" Python Character Mapping Codec koi8_u generated from 'python-mappings/KOI8-U.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='koi8-u',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\u2500'   #  0x80 -> BOX DRAWINGS LIGHT HORIZONTAL
    '\u2502'   #  0x81 -> BOX DRAWINGS LIGHT VERTICAL
    '\u250c'   #  0x82 -> BOX DRAWINGS LIGHT DOWN AND RIGHT
    '\u2510'   #  0x83 -> BOX DRAWINGS LIGHT DOWN AND LEFT
    '\u2514'   #  0x84 -> BOX DRAWINGS LIGHT UP AND RIGHT
    '\u2518'   #  0x85 -> BOX DRAWINGS LIGHT UP AND LEFT
    '\u251c'   #  0x86 -> BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    '\u2524'   #  0x87 -> BOX DRAWINGS LIGHT VERTICAL AND LEFT
    '\u252c'   #  0x88 -> BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    '\u2534'   #  0x89 -> BOX DRAWINGS LIGHT UP AND HORIZONTAL
    '\u253c'   #  0x8A -> BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    '\u2580'   #  0x8B -> UPPER HALF BLOCK
    '\u2584'   #  0x8C -> LOWER HALF BLOCK
    '\u2588'   #  0x8D -> FULL BLOCK
    '\u258c'   #  0x8E -> LEFT HALF BLOCK
    '\u2590'   #  0x8F -> RIGHT HALF BLOCK
    '\u2591'   #  0x90 -> LIGHT SHADE
    '\u2592'   #  0x91 -> MEDIUM SHADE
    '\u2593'   #  0x92 -> DARK SHADE
    '\u2320'   #  0x93 -> TOP HALF INTEGRAL
    '\u25a0'   #  0x94 -> BLACK SQUARE
    '\u2219'   #  0x95 -> BULLET OPERATOR
    '\u221a'   #  0x96 -> SQUARE ROOT
    '\u2248'   #  0x97 -> ALMOST EQUAL TO
    '\u2264'   #  0x98 -> LESS-THAN OR EQUAL TO
    '\u2265'   #  0x99 -> GREATER-THAN OR EQUAL TO
    '\xa0'     #  0x9A -> NO-BREAK SPACE
    '\u2321'   #  0x9B -> BOTTOM HALF INTEGRAL
    '\xb0'     #  0x9C -> DEGREE SIGN
    '\xb2'     #  0x9D -> SUPERSCRIPT TWO
    '\xb7'     #  0x9E -> MIDDLE DOT
    '\xf7'     #  0x9F -> DIVISION SIGN
    '\u2550'   #  0xA0 -> BOX DRAWINGS DOUBLE HORIZONTAL
    '\u2551'   #  0xA1 -> BOX DRAWINGS DOUBLE VERTICAL
    '\u2552'   #  0xA2 -> BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
    '\u0451'   #  0xA3 -> CYRILLIC SMALL LETTER IO
    '\u0454'   #  0xA4 -> CYRILLIC SMALL LETTER UKRAINIAN IE
    '\u2554'   #  0xA5 -> BOX DRAWINGS DOUBLE DOWN AND RIGHT
    '\u0456'   #  0xA6 -> CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
    '\u0457'   #  0xA7 -> CYRILLIC SMALL LETTER YI (UKRAINIAN)
    '\u2557'   #  0xA8 -> BOX DRAWINGS DOUBLE DOWN AND LEFT
    '\u2558'   #  0xA9 -> BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
    '\u2559'   #  0xAA -> BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
    '\u255a'   #  0xAB -> BOX DRAWINGS DOUBLE UP AND RIGHT
    '\u255b'   #  0xAC -> BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
    '\u0491'   #  0xAD -> CYRILLIC SMALL LETTER UKRAINIAN GHE WITH UPTURN
    '\u255d'   #  0xAE -> BOX DRAWINGS DOUBLE UP AND LEFT
    '\u255e'   #  0xAF -> BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
    '\u255f'   #  0xB0 -> BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
    '\u2560'   #  0xB1 -> BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    '\u2561'   #  0xB2 -> BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
    '\u0401'   #  0xB3 -> CYRILLIC CAPITAL LETTER IO
    '\u0404'   #  0xB4 -> CYRILLIC CAPITAL LETTER UKRAINIAN IE
    '\u2563'   #  0xB5 -> BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    '\u0406'   #  0xB6 -> CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
    '\u0407'   #  0xB7 -> CYRILLIC CAPITAL LETTER YI (UKRAINIAN)
    '\u2566'   #  0xB8 -> BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    '\u2567'   #  0xB9 -> BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
    '\u2568'   #  0xBA -> BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
    '\u2569'   #  0xBB -> BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    '\u256a'   #  0xBC -> BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
    '\u0490'   #  0xBD -> CYRILLIC CAPITAL LETTER UKRAINIAN GHE WITH UPTURN
    '\u256c'   #  0xBE -> BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    '\xa9'     #  0xBF -> COPYRIGHT SIGN
    '\u044e'   #  0xC0 -> CYRILLIC SMALL LETTER YU
    '\u0430'   #  0xC1 -> CYRILLIC SMALL LETTER A
    '\u0431'   #  0xC2 -> CYRILLIC SMALL LETTER BE
    '\u0446'   #  0xC3 -> CYRILLIC SMALL LETTER TSE
    '\u0434'   #  0xC4 -> CYRILLIC SMALL LETTER DE
    '\u0435'   #  0xC5 -> CYRILLIC SMALL LETTER IE
    '\u0444'   #  0xC6 -> CYRILLIC SMALL LETTER EF
    '\u0433'   #  0xC7 -> CYRILLIC SMALL LETTER GHE
    '\u0445'   #  0xC8 -> CYRILLIC SMALL LETTER HA
    '\u0438'   #  0xC9 -> CYRILLIC SMALL LETTER I
    '\u0439'   #  0xCA -> CYRILLIC SMALL LETTER SHORT I
    '\u043a'   #  0xCB -> CYRILLIC SMALL LETTER KA
    '\u043b'   #  0xCC -> CYRILLIC SMALL LETTER EL
    '\u043c'   #  0xCD -> CYRILLIC SMALL LETTER EM
    '\u043d'   #  0xCE -> CYRILLIC SMALL LETTER EN
    '\u043e'   #  0xCF -> CYRILLIC SMALL LETTER O
    '\u043f'   #  0xD0 -> CYRILLIC SMALL LETTER PE
    '\u044f'   #  0xD1 -> CYRILLIC SMALL LETTER YA
    '\u0440'   #  0xD2 -> CYRILLIC SMALL LETTER ER
    '\u0441'   #  0xD3 -> CYRILLIC SMALL LETTER ES
    '\u0442'   #  0xD4 -> CYRILLIC SMALL LETTER TE
    '\u0443'   #  0xD5 -> CYRILLIC SMALL LETTER U
    '\u0436'   #  0xD6 -> CYRILLIC SMALL LETTER ZHE
    '\u0432'   #  0xD7 -> CYRILLIC SMALL LETTER VE
    '\u044c'   #  0xD8 -> CYRILLIC SMALL LETTER SOFT SIGN
    '\u044b'   #  0xD9 -> CYRILLIC SMALL LETTER YERU
    '\u0437'   #  0xDA -> CYRILLIC SMALL LETTER ZE
    '\u0448'   #  0xDB -> CYRILLIC SMALL LETTER SHA
    '\u044d'   #  0xDC -> CYRILLIC SMALL LETTER E
    '\u0449'   #  0xDD -> CYRILLIC SMALL LETTER SHCHA
    '\u0447'   #  0xDE -> CYRILLIC SMALL LETTER CHE
    '\u044a'   #  0xDF -> CYRILLIC SMALL LETTER HARD SIGN
    '\u042e'   #  0xE0 -> CYRILLIC CAPITAL LETTER YU
    '\u0410'   #  0xE1 -> CYRILLIC CAPITAL LETTER A
    '\u0411'   #  0xE2 -> CYRILLIC CAPITAL LETTER BE
    '\u0426'   #  0xE3 -> CYRILLIC CAPITAL LETTER TSE
    '\u0414'   #  0xE4 -> CYRILLIC CAPITAL LETTER DE
    '\u0415'   #  0xE5 -> CYRILLIC CAPITAL LETTER IE
    '\u0424'   #  0xE6 -> CYRILLIC CAPITAL LETTER EF
    '\u0413'   #  0xE7 -> CYRILLIC CAPITAL LETTER GHE
    '\u0425'   #  0xE8 -> CYRILLIC CAPITAL LETTER HA
    '\u0418'   #  0xE9 -> CYRILLIC CAPITAL LETTER I
    '\u0419'   #  0xEA -> CYRILLIC CAPITAL LETTER SHORT I
    '\u041a'   #  0xEB -> CYRILLIC CAPITAL LETTER KA
    '\u041b'   #  0xEC -> CYRILLIC CAPITAL LETTER EL
    '\u041c'   #  0xED -> CYRILLIC CAPITAL LETTER EM
    '\u041d'   #  0xEE -> CYRILLIC CAPITAL LETTER EN
    '\u041e'   #  0xEF -> CYRILLIC CAPITAL LETTER O
    '\u041f'   #  0xF0 -> CYRILLIC CAPITAL LETTER PE
    '\u042f'   #  0xF1 -> CYRILLIC CAPITAL LETTER YA
    '\u0420'   #  0xF2 -> CYRILLIC CAPITAL LETTER ER
    '\u0421'   #  0xF3 -> CYRILLIC CAPITAL LETTER ES
    '\u0422'   #  0xF4 -> CYRILLIC CAPITAL LETTER TE
    '\u0423'   #  0xF5 -> CYRILLIC CAPITAL LETTER U
    '\u0416'   #  0xF6 -> CYRILLIC CAPITAL LETTER ZHE
    '\u0412'   #  0xF7 -> CYRILLIC CAPITAL LETTER VE
    '\u042c'   #  0xF8 -> CYRILLIC CAPITAL LETTER SOFT SIGN
    '\u042b'   #  0xF9 -> CYRILLIC CAPITAL LETTER YERU
    '\u0417'   #  0xFA -> CYRILLIC CAPITAL LETTER ZE
    '\u0428'   #  0xFB -> CYRILLIC CAPITAL LETTER SHA
    '\u042d'   #  0xFC -> CYRILLIC CAPITAL LETTER E
    '\u0429'   #  0xFD -> CYRILLIC CAPITAL LETTER SHCHA
    '\u0427'   #  0xFE -> CYRILLIC CAPITAL LETTER CHE
    '\u042a'   #  0xFF -> CYRILLIC CAPITAL LETTER HARD SIGN
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/iso2022_jp_2004.py000064400000002061151153537610011333 0ustar00#
# iso2022_jp_2004.py: Python Unicode Codec for ISO2022_JP_2004
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#

import _codecs_iso2022, codecs
import _multibytecodec as mbc

codec = _codecs_iso2022.getcodec('iso2022_jp_2004')

class Codec(codecs.Codec):
    encode = codec.encode
    decode = codec.decode

class IncrementalEncoder(mbc.MultibyteIncrementalEncoder,
                         codecs.IncrementalEncoder):
    codec = codec

class IncrementalDecoder(mbc.MultibyteIncrementalDecoder,
                         codecs.IncrementalDecoder):
    codec = codec

class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader):
    codec = codec

class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
    codec = codec

def getregentry():
    return codecs.CodecInfo(
        name='iso2022_jp_2004',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/cp775.py000064400000103254151153537610007750 0ustar00""" Python Character Mapping Codec cp775 generated from 'VENDORS/MICSFT/PC/CP775.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_map)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_map)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp775',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
### Decoding Map

decoding_map = codecs.make_identity_dict(range(256))
decoding_map.update({
    0x0080: 0x0106,     #  LATIN CAPITAL LETTER C WITH ACUTE
    0x0081: 0x00fc,     #  LATIN SMALL LETTER U WITH DIAERESIS
    0x0082: 0x00e9,     #  LATIN SMALL LETTER E WITH ACUTE
    0x0083: 0x0101,     #  LATIN SMALL LETTER A WITH MACRON
    0x0084: 0x00e4,     #  LATIN SMALL LETTER A WITH DIAERESIS
    0x0085: 0x0123,     #  LATIN SMALL LETTER G WITH CEDILLA
    0x0086: 0x00e5,     #  LATIN SMALL LETTER A WITH RING ABOVE
    0x0087: 0x0107,     #  LATIN SMALL LETTER C WITH ACUTE
    0x0088: 0x0142,     #  LATIN SMALL LETTER L WITH STROKE
    0x0089: 0x0113,     #  LATIN SMALL LETTER E WITH MACRON
    0x008a: 0x0156,     #  LATIN CAPITAL LETTER R WITH CEDILLA
    0x008b: 0x0157,     #  LATIN SMALL LETTER R WITH CEDILLA
    0x008c: 0x012b,     #  LATIN SMALL LETTER I WITH MACRON
    0x008d: 0x0179,     #  LATIN CAPITAL LETTER Z WITH ACUTE
    0x008e: 0x00c4,     #  LATIN CAPITAL LETTER A WITH DIAERESIS
    0x008f: 0x00c5,     #  LATIN CAPITAL LETTER A WITH RING ABOVE
    0x0090: 0x00c9,     #  LATIN CAPITAL LETTER E WITH ACUTE
    0x0091: 0x00e6,     #  LATIN SMALL LIGATURE AE
    0x0092: 0x00c6,     #  LATIN CAPITAL LIGATURE AE
    0x0093: 0x014d,     #  LATIN SMALL LETTER O WITH MACRON
    0x0094: 0x00f6,     #  LATIN SMALL LETTER O WITH DIAERESIS
    0x0095: 0x0122,     #  LATIN CAPITAL LETTER G WITH CEDILLA
    0x0096: 0x00a2,     #  CENT SIGN
    0x0097: 0x015a,     #  LATIN CAPITAL LETTER S WITH ACUTE
    0x0098: 0x015b,     #  LATIN SMALL LETTER S WITH ACUTE
    0x0099: 0x00d6,     #  LATIN CAPITAL LETTER O WITH DIAERESIS
    0x009a: 0x00dc,     #  LATIN CAPITAL LETTER U WITH DIAERESIS
    0x009b: 0x00f8,     #  LATIN SMALL LETTER O WITH STROKE
    0x009c: 0x00a3,     #  POUND SIGN
    0x009d: 0x00d8,     #  LATIN CAPITAL LETTER O WITH STROKE
    0x009e: 0x00d7,     #  MULTIPLICATION SIGN
    0x009f: 0x00a4,     #  CURRENCY SIGN
    0x00a0: 0x0100,     #  LATIN CAPITAL LETTER A WITH MACRON
    0x00a1: 0x012a,     #  LATIN CAPITAL LETTER I WITH MACRON
    0x00a2: 0x00f3,     #  LATIN SMALL LETTER O WITH ACUTE
    0x00a3: 0x017b,     #  LATIN CAPITAL LETTER Z WITH DOT ABOVE
    0x00a4: 0x017c,     #  LATIN SMALL LETTER Z WITH DOT ABOVE
    0x00a5: 0x017a,     #  LATIN SMALL LETTER Z WITH ACUTE
    0x00a6: 0x201d,     #  RIGHT DOUBLE QUOTATION MARK
    0x00a7: 0x00a6,     #  BROKEN BAR
    0x00a8: 0x00a9,     #  COPYRIGHT SIGN
    0x00a9: 0x00ae,     #  REGISTERED SIGN
    0x00aa: 0x00ac,     #  NOT SIGN
    0x00ab: 0x00bd,     #  VULGAR FRACTION ONE HALF
    0x00ac: 0x00bc,     #  VULGAR FRACTION ONE QUARTER
    0x00ad: 0x0141,     #  LATIN CAPITAL LETTER L WITH STROKE
    0x00ae: 0x00ab,     #  LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00af: 0x00bb,     #  RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00b0: 0x2591,     #  LIGHT SHADE
    0x00b1: 0x2592,     #  MEDIUM SHADE
    0x00b2: 0x2593,     #  DARK SHADE
    0x00b3: 0x2502,     #  BOX DRAWINGS LIGHT VERTICAL
    0x00b4: 0x2524,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
    0x00b5: 0x0104,     #  LATIN CAPITAL LETTER A WITH OGONEK
    0x00b6: 0x010c,     #  LATIN CAPITAL LETTER C WITH CARON
    0x00b7: 0x0118,     #  LATIN CAPITAL LETTER E WITH OGONEK
    0x00b8: 0x0116,     #  LATIN CAPITAL LETTER E WITH DOT ABOVE
    0x00b9: 0x2563,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    0x00ba: 0x2551,     #  BOX DRAWINGS DOUBLE VERTICAL
    0x00bb: 0x2557,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
    0x00bc: 0x255d,     #  BOX DRAWINGS DOUBLE UP AND LEFT
    0x00bd: 0x012e,     #  LATIN CAPITAL LETTER I WITH OGONEK
    0x00be: 0x0160,     #  LATIN CAPITAL LETTER S WITH CARON
    0x00bf: 0x2510,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
    0x00c0: 0x2514,     #  BOX DRAWINGS LIGHT UP AND RIGHT
    0x00c1: 0x2534,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
    0x00c2: 0x252c,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    0x00c3: 0x251c,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    0x00c4: 0x2500,     #  BOX DRAWINGS LIGHT HORIZONTAL
    0x00c5: 0x253c,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    0x00c6: 0x0172,     #  LATIN CAPITAL LETTER U WITH OGONEK
    0x00c7: 0x016a,     #  LATIN CAPITAL LETTER U WITH MACRON
    0x00c8: 0x255a,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
    0x00c9: 0x2554,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
    0x00ca: 0x2569,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    0x00cb: 0x2566,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    0x00cc: 0x2560,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    0x00cd: 0x2550,     #  BOX DRAWINGS DOUBLE HORIZONTAL
    0x00ce: 0x256c,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    0x00cf: 0x017d,     #  LATIN CAPITAL LETTER Z WITH CARON
    0x00d0: 0x0105,     #  LATIN SMALL LETTER A WITH OGONEK
    0x00d1: 0x010d,     #  LATIN SMALL LETTER C WITH CARON
    0x00d2: 0x0119,     #  LATIN SMALL LETTER E WITH OGONEK
    0x00d3: 0x0117,     #  LATIN SMALL LETTER E WITH DOT ABOVE
    0x00d4: 0x012f,     #  LATIN SMALL LETTER I WITH OGONEK
    0x00d5: 0x0161,     #  LATIN SMALL LETTER S WITH CARON
    0x00d6: 0x0173,     #  LATIN SMALL LETTER U WITH OGONEK
    0x00d7: 0x016b,     #  LATIN SMALL LETTER U WITH MACRON
    0x00d8: 0x017e,     #  LATIN SMALL LETTER Z WITH CARON
    0x00d9: 0x2518,     #  BOX DRAWINGS LIGHT UP AND LEFT
    0x00da: 0x250c,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
    0x00db: 0x2588,     #  FULL BLOCK
    0x00dc: 0x2584,     #  LOWER HALF BLOCK
    0x00dd: 0x258c,     #  LEFT HALF BLOCK
    0x00de: 0x2590,     #  RIGHT HALF BLOCK
    0x00df: 0x2580,     #  UPPER HALF BLOCK
    0x00e0: 0x00d3,     #  LATIN CAPITAL LETTER O WITH ACUTE
    0x00e1: 0x00df,     #  LATIN SMALL LETTER SHARP S (GERMAN)
    0x00e2: 0x014c,     #  LATIN CAPITAL LETTER O WITH MACRON
    0x00e3: 0x0143,     #  LATIN CAPITAL LETTER N WITH ACUTE
    0x00e4: 0x00f5,     #  LATIN SMALL LETTER O WITH TILDE
    0x00e5: 0x00d5,     #  LATIN CAPITAL LETTER O WITH TILDE
    0x00e6: 0x00b5,     #  MICRO SIGN
    0x00e7: 0x0144,     #  LATIN SMALL LETTER N WITH ACUTE
    0x00e8: 0x0136,     #  LATIN CAPITAL LETTER K WITH CEDILLA
    0x00e9: 0x0137,     #  LATIN SMALL LETTER K WITH CEDILLA
    0x00ea: 0x013b,     #  LATIN CAPITAL LETTER L WITH CEDILLA
    0x00eb: 0x013c,     #  LATIN SMALL LETTER L WITH CEDILLA
    0x00ec: 0x0146,     #  LATIN SMALL LETTER N WITH CEDILLA
    0x00ed: 0x0112,     #  LATIN CAPITAL LETTER E WITH MACRON
    0x00ee: 0x0145,     #  LATIN CAPITAL LETTER N WITH CEDILLA
    0x00ef: 0x2019,     #  RIGHT SINGLE QUOTATION MARK
    0x00f0: 0x00ad,     #  SOFT HYPHEN
    0x00f1: 0x00b1,     #  PLUS-MINUS SIGN
    0x00f2: 0x201c,     #  LEFT DOUBLE QUOTATION MARK
    0x00f3: 0x00be,     #  VULGAR FRACTION THREE QUARTERS
    0x00f4: 0x00b6,     #  PILCROW SIGN
    0x00f5: 0x00a7,     #  SECTION SIGN
    0x00f6: 0x00f7,     #  DIVISION SIGN
    0x00f7: 0x201e,     #  DOUBLE LOW-9 QUOTATION MARK
    0x00f8: 0x00b0,     #  DEGREE SIGN
    0x00f9: 0x2219,     #  BULLET OPERATOR
    0x00fa: 0x00b7,     #  MIDDLE DOT
    0x00fb: 0x00b9,     #  SUPERSCRIPT ONE
    0x00fc: 0x00b3,     #  SUPERSCRIPT THREE
    0x00fd: 0x00b2,     #  SUPERSCRIPT TWO
    0x00fe: 0x25a0,     #  BLACK SQUARE
    0x00ff: 0x00a0,     #  NO-BREAK SPACE
})

### Decoding Table

decoding_table = (
    '\x00'     #  0x0000 -> NULL
    '\x01'     #  0x0001 -> START OF HEADING
    '\x02'     #  0x0002 -> START OF TEXT
    '\x03'     #  0x0003 -> END OF TEXT
    '\x04'     #  0x0004 -> END OF TRANSMISSION
    '\x05'     #  0x0005 -> ENQUIRY
    '\x06'     #  0x0006 -> ACKNOWLEDGE
    '\x07'     #  0x0007 -> BELL
    '\x08'     #  0x0008 -> BACKSPACE
    '\t'       #  0x0009 -> HORIZONTAL TABULATION
    '\n'       #  0x000a -> LINE FEED
    '\x0b'     #  0x000b -> VERTICAL TABULATION
    '\x0c'     #  0x000c -> FORM FEED
    '\r'       #  0x000d -> CARRIAGE RETURN
    '\x0e'     #  0x000e -> SHIFT OUT
    '\x0f'     #  0x000f -> SHIFT IN
    '\x10'     #  0x0010 -> DATA LINK ESCAPE
    '\x11'     #  0x0011 -> DEVICE CONTROL ONE
    '\x12'     #  0x0012 -> DEVICE CONTROL TWO
    '\x13'     #  0x0013 -> DEVICE CONTROL THREE
    '\x14'     #  0x0014 -> DEVICE CONTROL FOUR
    '\x15'     #  0x0015 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x0016 -> SYNCHRONOUS IDLE
    '\x17'     #  0x0017 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x0018 -> CANCEL
    '\x19'     #  0x0019 -> END OF MEDIUM
    '\x1a'     #  0x001a -> SUBSTITUTE
    '\x1b'     #  0x001b -> ESCAPE
    '\x1c'     #  0x001c -> FILE SEPARATOR
    '\x1d'     #  0x001d -> GROUP SEPARATOR
    '\x1e'     #  0x001e -> RECORD SEPARATOR
    '\x1f'     #  0x001f -> UNIT SEPARATOR
    ' '        #  0x0020 -> SPACE
    '!'        #  0x0021 -> EXCLAMATION MARK
    '"'        #  0x0022 -> QUOTATION MARK
    '#'        #  0x0023 -> NUMBER SIGN
    '$'        #  0x0024 -> DOLLAR SIGN
    '%'        #  0x0025 -> PERCENT SIGN
    '&'        #  0x0026 -> AMPERSAND
    "'"        #  0x0027 -> APOSTROPHE
    '('        #  0x0028 -> LEFT PARENTHESIS
    ')'        #  0x0029 -> RIGHT PARENTHESIS
    '*'        #  0x002a -> ASTERISK
    '+'        #  0x002b -> PLUS SIGN
    ','        #  0x002c -> COMMA
    '-'        #  0x002d -> HYPHEN-MINUS
    '.'        #  0x002e -> FULL STOP
    '/'        #  0x002f -> SOLIDUS
    '0'        #  0x0030 -> DIGIT ZERO
    '1'        #  0x0031 -> DIGIT ONE
    '2'        #  0x0032 -> DIGIT TWO
    '3'        #  0x0033 -> DIGIT THREE
    '4'        #  0x0034 -> DIGIT FOUR
    '5'        #  0x0035 -> DIGIT FIVE
    '6'        #  0x0036 -> DIGIT SIX
    '7'        #  0x0037 -> DIGIT SEVEN
    '8'        #  0x0038 -> DIGIT EIGHT
    '9'        #  0x0039 -> DIGIT NINE
    ':'        #  0x003a -> COLON
    ';'        #  0x003b -> SEMICOLON
    '<'        #  0x003c -> LESS-THAN SIGN
    '='        #  0x003d -> EQUALS SIGN
    '>'        #  0x003e -> GREATER-THAN SIGN
    '?'        #  0x003f -> QUESTION MARK
    '@'        #  0x0040 -> COMMERCIAL AT
    'A'        #  0x0041 -> LATIN CAPITAL LETTER A
    'B'        #  0x0042 -> LATIN CAPITAL LETTER B
    'C'        #  0x0043 -> LATIN CAPITAL LETTER C
    'D'        #  0x0044 -> LATIN CAPITAL LETTER D
    'E'        #  0x0045 -> LATIN CAPITAL LETTER E
    'F'        #  0x0046 -> LATIN CAPITAL LETTER F
    'G'        #  0x0047 -> LATIN CAPITAL LETTER G
    'H'        #  0x0048 -> LATIN CAPITAL LETTER H
    'I'        #  0x0049 -> LATIN CAPITAL LETTER I
    'J'        #  0x004a -> LATIN CAPITAL LETTER J
    'K'        #  0x004b -> LATIN CAPITAL LETTER K
    'L'        #  0x004c -> LATIN CAPITAL LETTER L
    'M'        #  0x004d -> LATIN CAPITAL LETTER M
    'N'        #  0x004e -> LATIN CAPITAL LETTER N
    'O'        #  0x004f -> LATIN CAPITAL LETTER O
    'P'        #  0x0050 -> LATIN CAPITAL LETTER P
    'Q'        #  0x0051 -> LATIN CAPITAL LETTER Q
    'R'        #  0x0052 -> LATIN CAPITAL LETTER R
    'S'        #  0x0053 -> LATIN CAPITAL LETTER S
    'T'        #  0x0054 -> LATIN CAPITAL LETTER T
    'U'        #  0x0055 -> LATIN CAPITAL LETTER U
    'V'        #  0x0056 -> LATIN CAPITAL LETTER V
    'W'        #  0x0057 -> LATIN CAPITAL LETTER W
    'X'        #  0x0058 -> LATIN CAPITAL LETTER X
    'Y'        #  0x0059 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x005a -> LATIN CAPITAL LETTER Z
    '['        #  0x005b -> LEFT SQUARE BRACKET
    '\\'       #  0x005c -> REVERSE SOLIDUS
    ']'        #  0x005d -> RIGHT SQUARE BRACKET
    '^'        #  0x005e -> CIRCUMFLEX ACCENT
    '_'        #  0x005f -> LOW LINE
    '`'        #  0x0060 -> GRAVE ACCENT
    'a'        #  0x0061 -> LATIN SMALL LETTER A
    'b'        #  0x0062 -> LATIN SMALL LETTER B
    'c'        #  0x0063 -> LATIN SMALL LETTER C
    'd'        #  0x0064 -> LATIN SMALL LETTER D
    'e'        #  0x0065 -> LATIN SMALL LETTER E
    'f'        #  0x0066 -> LATIN SMALL LETTER F
    'g'        #  0x0067 -> LATIN SMALL LETTER G
    'h'        #  0x0068 -> LATIN SMALL LETTER H
    'i'        #  0x0069 -> LATIN SMALL LETTER I
    'j'        #  0x006a -> LATIN SMALL LETTER J
    'k'        #  0x006b -> LATIN SMALL LETTER K
    'l'        #  0x006c -> LATIN SMALL LETTER L
    'm'        #  0x006d -> LATIN SMALL LETTER M
    'n'        #  0x006e -> LATIN SMALL LETTER N
    'o'        #  0x006f -> LATIN SMALL LETTER O
    'p'        #  0x0070 -> LATIN SMALL LETTER P
    'q'        #  0x0071 -> LATIN SMALL LETTER Q
    'r'        #  0x0072 -> LATIN SMALL LETTER R
    's'        #  0x0073 -> LATIN SMALL LETTER S
    't'        #  0x0074 -> LATIN SMALL LETTER T
    'u'        #  0x0075 -> LATIN SMALL LETTER U
    'v'        #  0x0076 -> LATIN SMALL LETTER V
    'w'        #  0x0077 -> LATIN SMALL LETTER W
    'x'        #  0x0078 -> LATIN SMALL LETTER X
    'y'        #  0x0079 -> LATIN SMALL LETTER Y
    'z'        #  0x007a -> LATIN SMALL LETTER Z
    '{'        #  0x007b -> LEFT CURLY BRACKET
    '|'        #  0x007c -> VERTICAL LINE
    '}'        #  0x007d -> RIGHT CURLY BRACKET
    '~'        #  0x007e -> TILDE
    '\x7f'     #  0x007f -> DELETE
    '\u0106'   #  0x0080 -> LATIN CAPITAL LETTER C WITH ACUTE
    '\xfc'     #  0x0081 -> LATIN SMALL LETTER U WITH DIAERESIS
    '\xe9'     #  0x0082 -> LATIN SMALL LETTER E WITH ACUTE
    '\u0101'   #  0x0083 -> LATIN SMALL LETTER A WITH MACRON
    '\xe4'     #  0x0084 -> LATIN SMALL LETTER A WITH DIAERESIS
    '\u0123'   #  0x0085 -> LATIN SMALL LETTER G WITH CEDILLA
    '\xe5'     #  0x0086 -> LATIN SMALL LETTER A WITH RING ABOVE
    '\u0107'   #  0x0087 -> LATIN SMALL LETTER C WITH ACUTE
    '\u0142'   #  0x0088 -> LATIN SMALL LETTER L WITH STROKE
    '\u0113'   #  0x0089 -> LATIN SMALL LETTER E WITH MACRON
    '\u0156'   #  0x008a -> LATIN CAPITAL LETTER R WITH CEDILLA
    '\u0157'   #  0x008b -> LATIN SMALL LETTER R WITH CEDILLA
    '\u012b'   #  0x008c -> LATIN SMALL LETTER I WITH MACRON
    '\u0179'   #  0x008d -> LATIN CAPITAL LETTER Z WITH ACUTE
    '\xc4'     #  0x008e -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\xc5'     #  0x008f -> LATIN CAPITAL LETTER A WITH RING ABOVE
    '\xc9'     #  0x0090 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\xe6'     #  0x0091 -> LATIN SMALL LIGATURE AE
    '\xc6'     #  0x0092 -> LATIN CAPITAL LIGATURE AE
    '\u014d'   #  0x0093 -> LATIN SMALL LETTER O WITH MACRON
    '\xf6'     #  0x0094 -> LATIN SMALL LETTER O WITH DIAERESIS
    '\u0122'   #  0x0095 -> LATIN CAPITAL LETTER G WITH CEDILLA
    '\xa2'     #  0x0096 -> CENT SIGN
    '\u015a'   #  0x0097 -> LATIN CAPITAL LETTER S WITH ACUTE
    '\u015b'   #  0x0098 -> LATIN SMALL LETTER S WITH ACUTE
    '\xd6'     #  0x0099 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xdc'     #  0x009a -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\xf8'     #  0x009b -> LATIN SMALL LETTER O WITH STROKE
    '\xa3'     #  0x009c -> POUND SIGN
    '\xd8'     #  0x009d -> LATIN CAPITAL LETTER O WITH STROKE
    '\xd7'     #  0x009e -> MULTIPLICATION SIGN
    '\xa4'     #  0x009f -> CURRENCY SIGN
    '\u0100'   #  0x00a0 -> LATIN CAPITAL LETTER A WITH MACRON
    '\u012a'   #  0x00a1 -> LATIN CAPITAL LETTER I WITH MACRON
    '\xf3'     #  0x00a2 -> LATIN SMALL LETTER O WITH ACUTE
    '\u017b'   #  0x00a3 -> LATIN CAPITAL LETTER Z WITH DOT ABOVE
    '\u017c'   #  0x00a4 -> LATIN SMALL LETTER Z WITH DOT ABOVE
    '\u017a'   #  0x00a5 -> LATIN SMALL LETTER Z WITH ACUTE
    '\u201d'   #  0x00a6 -> RIGHT DOUBLE QUOTATION MARK
    '\xa6'     #  0x00a7 -> BROKEN BAR
    '\xa9'     #  0x00a8 -> COPYRIGHT SIGN
    '\xae'     #  0x00a9 -> REGISTERED SIGN
    '\xac'     #  0x00aa -> NOT SIGN
    '\xbd'     #  0x00ab -> VULGAR FRACTION ONE HALF
    '\xbc'     #  0x00ac -> VULGAR FRACTION ONE QUARTER
    '\u0141'   #  0x00ad -> LATIN CAPITAL LETTER L WITH STROKE
    '\xab'     #  0x00ae -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbb'     #  0x00af -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u2591'   #  0x00b0 -> LIGHT SHADE
    '\u2592'   #  0x00b1 -> MEDIUM SHADE
    '\u2593'   #  0x00b2 -> DARK SHADE
    '\u2502'   #  0x00b3 -> BOX DRAWINGS LIGHT VERTICAL
    '\u2524'   #  0x00b4 -> BOX DRAWINGS LIGHT VERTICAL AND LEFT
    '\u0104'   #  0x00b5 -> LATIN CAPITAL LETTER A WITH OGONEK
    '\u010c'   #  0x00b6 -> LATIN CAPITAL LETTER C WITH CARON
    '\u0118'   #  0x00b7 -> LATIN CAPITAL LETTER E WITH OGONEK
    '\u0116'   #  0x00b8 -> LATIN CAPITAL LETTER E WITH DOT ABOVE
    '\u2563'   #  0x00b9 -> BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    '\u2551'   #  0x00ba -> BOX DRAWINGS DOUBLE VERTICAL
    '\u2557'   #  0x00bb -> BOX DRAWINGS DOUBLE DOWN AND LEFT
    '\u255d'   #  0x00bc -> BOX DRAWINGS DOUBLE UP AND LEFT
    '\u012e'   #  0x00bd -> LATIN CAPITAL LETTER I WITH OGONEK
    '\u0160'   #  0x00be -> LATIN CAPITAL LETTER S WITH CARON
    '\u2510'   #  0x00bf -> BOX DRAWINGS LIGHT DOWN AND LEFT
    '\u2514'   #  0x00c0 -> BOX DRAWINGS LIGHT UP AND RIGHT
    '\u2534'   #  0x00c1 -> BOX DRAWINGS LIGHT UP AND HORIZONTAL
    '\u252c'   #  0x00c2 -> BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    '\u251c'   #  0x00c3 -> BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    '\u2500'   #  0x00c4 -> BOX DRAWINGS LIGHT HORIZONTAL
    '\u253c'   #  0x00c5 -> BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    '\u0172'   #  0x00c6 -> LATIN CAPITAL LETTER U WITH OGONEK
    '\u016a'   #  0x00c7 -> LATIN CAPITAL LETTER U WITH MACRON
    '\u255a'   #  0x00c8 -> BOX DRAWINGS DOUBLE UP AND RIGHT
    '\u2554'   #  0x00c9 -> BOX DRAWINGS DOUBLE DOWN AND RIGHT
    '\u2569'   #  0x00ca -> BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    '\u2566'   #  0x00cb -> BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    '\u2560'   #  0x00cc -> BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    '\u2550'   #  0x00cd -> BOX DRAWINGS DOUBLE HORIZONTAL
    '\u256c'   #  0x00ce -> BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    '\u017d'   #  0x00cf -> LATIN CAPITAL LETTER Z WITH CARON
    '\u0105'   #  0x00d0 -> LATIN SMALL LETTER A WITH OGONEK
    '\u010d'   #  0x00d1 -> LATIN SMALL LETTER C WITH CARON
    '\u0119'   #  0x00d2 -> LATIN SMALL LETTER E WITH OGONEK
    '\u0117'   #  0x00d3 -> LATIN SMALL LETTER E WITH DOT ABOVE
    '\u012f'   #  0x00d4 -> LATIN SMALL LETTER I WITH OGONEK
    '\u0161'   #  0x00d5 -> LATIN SMALL LETTER S WITH CARON
    '\u0173'   #  0x00d6 -> LATIN SMALL LETTER U WITH OGONEK
    '\u016b'   #  0x00d7 -> LATIN SMALL LETTER U WITH MACRON
    '\u017e'   #  0x00d8 -> LATIN SMALL LETTER Z WITH CARON
    '\u2518'   #  0x00d9 -> BOX DRAWINGS LIGHT UP AND LEFT
    '\u250c'   #  0x00da -> BOX DRAWINGS LIGHT DOWN AND RIGHT
    '\u2588'   #  0x00db -> FULL BLOCK
    '\u2584'   #  0x00dc -> LOWER HALF BLOCK
    '\u258c'   #  0x00dd -> LEFT HALF BLOCK
    '\u2590'   #  0x00de -> RIGHT HALF BLOCK
    '\u2580'   #  0x00df -> UPPER HALF BLOCK
    '\xd3'     #  0x00e0 -> LATIN CAPITAL LETTER O WITH ACUTE
    '\xdf'     #  0x00e1 -> LATIN SMALL LETTER SHARP S (GERMAN)
    '\u014c'   #  0x00e2 -> LATIN CAPITAL LETTER O WITH MACRON
    '\u0143'   #  0x00e3 -> LATIN CAPITAL LETTER N WITH ACUTE
    '\xf5'     #  0x00e4 -> LATIN SMALL LETTER O WITH TILDE
    '\xd5'     #  0x00e5 -> LATIN CAPITAL LETTER O WITH TILDE
    '\xb5'     #  0x00e6 -> MICRO SIGN
    '\u0144'   #  0x00e7 -> LATIN SMALL LETTER N WITH ACUTE
    '\u0136'   #  0x00e8 -> LATIN CAPITAL LETTER K WITH CEDILLA
    '\u0137'   #  0x00e9 -> LATIN SMALL LETTER K WITH CEDILLA
    '\u013b'   #  0x00ea -> LATIN CAPITAL LETTER L WITH CEDILLA
    '\u013c'   #  0x00eb -> LATIN SMALL LETTER L WITH CEDILLA
    '\u0146'   #  0x00ec -> LATIN SMALL LETTER N WITH CEDILLA
    '\u0112'   #  0x00ed -> LATIN CAPITAL LETTER E WITH MACRON
    '\u0145'   #  0x00ee -> LATIN CAPITAL LETTER N WITH CEDILLA
    '\u2019'   #  0x00ef -> RIGHT SINGLE QUOTATION MARK
    '\xad'     #  0x00f0 -> SOFT HYPHEN
    '\xb1'     #  0x00f1 -> PLUS-MINUS SIGN
    '\u201c'   #  0x00f2 -> LEFT DOUBLE QUOTATION MARK
    '\xbe'     #  0x00f3 -> VULGAR FRACTION THREE QUARTERS
    '\xb6'     #  0x00f4 -> PILCROW SIGN
    '\xa7'     #  0x00f5 -> SECTION SIGN
    '\xf7'     #  0x00f6 -> DIVISION SIGN
    '\u201e'   #  0x00f7 -> DOUBLE LOW-9 QUOTATION MARK
    '\xb0'     #  0x00f8 -> DEGREE SIGN
    '\u2219'   #  0x00f9 -> BULLET OPERATOR
    '\xb7'     #  0x00fa -> MIDDLE DOT
    '\xb9'     #  0x00fb -> SUPERSCRIPT ONE
    '\xb3'     #  0x00fc -> SUPERSCRIPT THREE
    '\xb2'     #  0x00fd -> SUPERSCRIPT TWO
    '\u25a0'   #  0x00fe -> BLACK SQUARE
    '\xa0'     #  0x00ff -> NO-BREAK SPACE
)

### Encoding Map

encoding_map = {
    0x0000: 0x0000,     #  NULL
    0x0001: 0x0001,     #  START OF HEADING
    0x0002: 0x0002,     #  START OF TEXT
    0x0003: 0x0003,     #  END OF TEXT
    0x0004: 0x0004,     #  END OF TRANSMISSION
    0x0005: 0x0005,     #  ENQUIRY
    0x0006: 0x0006,     #  ACKNOWLEDGE
    0x0007: 0x0007,     #  BELL
    0x0008: 0x0008,     #  BACKSPACE
    0x0009: 0x0009,     #  HORIZONTAL TABULATION
    0x000a: 0x000a,     #  LINE FEED
    0x000b: 0x000b,     #  VERTICAL TABULATION
    0x000c: 0x000c,     #  FORM FEED
    0x000d: 0x000d,     #  CARRIAGE RETURN
    0x000e: 0x000e,     #  SHIFT OUT
    0x000f: 0x000f,     #  SHIFT IN
    0x0010: 0x0010,     #  DATA LINK ESCAPE
    0x0011: 0x0011,     #  DEVICE CONTROL ONE
    0x0012: 0x0012,     #  DEVICE CONTROL TWO
    0x0013: 0x0013,     #  DEVICE CONTROL THREE
    0x0014: 0x0014,     #  DEVICE CONTROL FOUR
    0x0015: 0x0015,     #  NEGATIVE ACKNOWLEDGE
    0x0016: 0x0016,     #  SYNCHRONOUS IDLE
    0x0017: 0x0017,     #  END OF TRANSMISSION BLOCK
    0x0018: 0x0018,     #  CANCEL
    0x0019: 0x0019,     #  END OF MEDIUM
    0x001a: 0x001a,     #  SUBSTITUTE
    0x001b: 0x001b,     #  ESCAPE
    0x001c: 0x001c,     #  FILE SEPARATOR
    0x001d: 0x001d,     #  GROUP SEPARATOR
    0x001e: 0x001e,     #  RECORD SEPARATOR
    0x001f: 0x001f,     #  UNIT SEPARATOR
    0x0020: 0x0020,     #  SPACE
    0x0021: 0x0021,     #  EXCLAMATION MARK
    0x0022: 0x0022,     #  QUOTATION MARK
    0x0023: 0x0023,     #  NUMBER SIGN
    0x0024: 0x0024,     #  DOLLAR SIGN
    0x0025: 0x0025,     #  PERCENT SIGN
    0x0026: 0x0026,     #  AMPERSAND
    0x0027: 0x0027,     #  APOSTROPHE
    0x0028: 0x0028,     #  LEFT PARENTHESIS
    0x0029: 0x0029,     #  RIGHT PARENTHESIS
    0x002a: 0x002a,     #  ASTERISK
    0x002b: 0x002b,     #  PLUS SIGN
    0x002c: 0x002c,     #  COMMA
    0x002d: 0x002d,     #  HYPHEN-MINUS
    0x002e: 0x002e,     #  FULL STOP
    0x002f: 0x002f,     #  SOLIDUS
    0x0030: 0x0030,     #  DIGIT ZERO
    0x0031: 0x0031,     #  DIGIT ONE
    0x0032: 0x0032,     #  DIGIT TWO
    0x0033: 0x0033,     #  DIGIT THREE
    0x0034: 0x0034,     #  DIGIT FOUR
    0x0035: 0x0035,     #  DIGIT FIVE
    0x0036: 0x0036,     #  DIGIT SIX
    0x0037: 0x0037,     #  DIGIT SEVEN
    0x0038: 0x0038,     #  DIGIT EIGHT
    0x0039: 0x0039,     #  DIGIT NINE
    0x003a: 0x003a,     #  COLON
    0x003b: 0x003b,     #  SEMICOLON
    0x003c: 0x003c,     #  LESS-THAN SIGN
    0x003d: 0x003d,     #  EQUALS SIGN
    0x003e: 0x003e,     #  GREATER-THAN SIGN
    0x003f: 0x003f,     #  QUESTION MARK
    0x0040: 0x0040,     #  COMMERCIAL AT
    0x0041: 0x0041,     #  LATIN CAPITAL LETTER A
    0x0042: 0x0042,     #  LATIN CAPITAL LETTER B
    0x0043: 0x0043,     #  LATIN CAPITAL LETTER C
    0x0044: 0x0044,     #  LATIN CAPITAL LETTER D
    0x0045: 0x0045,     #  LATIN CAPITAL LETTER E
    0x0046: 0x0046,     #  LATIN CAPITAL LETTER F
    0x0047: 0x0047,     #  LATIN CAPITAL LETTER G
    0x0048: 0x0048,     #  LATIN CAPITAL LETTER H
    0x0049: 0x0049,     #  LATIN CAPITAL LETTER I
    0x004a: 0x004a,     #  LATIN CAPITAL LETTER J
    0x004b: 0x004b,     #  LATIN CAPITAL LETTER K
    0x004c: 0x004c,     #  LATIN CAPITAL LETTER L
    0x004d: 0x004d,     #  LATIN CAPITAL LETTER M
    0x004e: 0x004e,     #  LATIN CAPITAL LETTER N
    0x004f: 0x004f,     #  LATIN CAPITAL LETTER O
    0x0050: 0x0050,     #  LATIN CAPITAL LETTER P
    0x0051: 0x0051,     #  LATIN CAPITAL LETTER Q
    0x0052: 0x0052,     #  LATIN CAPITAL LETTER R
    0x0053: 0x0053,     #  LATIN CAPITAL LETTER S
    0x0054: 0x0054,     #  LATIN CAPITAL LETTER T
    0x0055: 0x0055,     #  LATIN CAPITAL LETTER U
    0x0056: 0x0056,     #  LATIN CAPITAL LETTER V
    0x0057: 0x0057,     #  LATIN CAPITAL LETTER W
    0x0058: 0x0058,     #  LATIN CAPITAL LETTER X
    0x0059: 0x0059,     #  LATIN CAPITAL LETTER Y
    0x005a: 0x005a,     #  LATIN CAPITAL LETTER Z
    0x005b: 0x005b,     #  LEFT SQUARE BRACKET
    0x005c: 0x005c,     #  REVERSE SOLIDUS
    0x005d: 0x005d,     #  RIGHT SQUARE BRACKET
    0x005e: 0x005e,     #  CIRCUMFLEX ACCENT
    0x005f: 0x005f,     #  LOW LINE
    0x0060: 0x0060,     #  GRAVE ACCENT
    0x0061: 0x0061,     #  LATIN SMALL LETTER A
    0x0062: 0x0062,     #  LATIN SMALL LETTER B
    0x0063: 0x0063,     #  LATIN SMALL LETTER C
    0x0064: 0x0064,     #  LATIN SMALL LETTER D
    0x0065: 0x0065,     #  LATIN SMALL LETTER E
    0x0066: 0x0066,     #  LATIN SMALL LETTER F
    0x0067: 0x0067,     #  LATIN SMALL LETTER G
    0x0068: 0x0068,     #  LATIN SMALL LETTER H
    0x0069: 0x0069,     #  LATIN SMALL LETTER I
    0x006a: 0x006a,     #  LATIN SMALL LETTER J
    0x006b: 0x006b,     #  LATIN SMALL LETTER K
    0x006c: 0x006c,     #  LATIN SMALL LETTER L
    0x006d: 0x006d,     #  LATIN SMALL LETTER M
    0x006e: 0x006e,     #  LATIN SMALL LETTER N
    0x006f: 0x006f,     #  LATIN SMALL LETTER O
    0x0070: 0x0070,     #  LATIN SMALL LETTER P
    0x0071: 0x0071,     #  LATIN SMALL LETTER Q
    0x0072: 0x0072,     #  LATIN SMALL LETTER R
    0x0073: 0x0073,     #  LATIN SMALL LETTER S
    0x0074: 0x0074,     #  LATIN SMALL LETTER T
    0x0075: 0x0075,     #  LATIN SMALL LETTER U
    0x0076: 0x0076,     #  LATIN SMALL LETTER V
    0x0077: 0x0077,     #  LATIN SMALL LETTER W
    0x0078: 0x0078,     #  LATIN SMALL LETTER X
    0x0079: 0x0079,     #  LATIN SMALL LETTER Y
    0x007a: 0x007a,     #  LATIN SMALL LETTER Z
    0x007b: 0x007b,     #  LEFT CURLY BRACKET
    0x007c: 0x007c,     #  VERTICAL LINE
    0x007d: 0x007d,     #  RIGHT CURLY BRACKET
    0x007e: 0x007e,     #  TILDE
    0x007f: 0x007f,     #  DELETE
    0x00a0: 0x00ff,     #  NO-BREAK SPACE
    0x00a2: 0x0096,     #  CENT SIGN
    0x00a3: 0x009c,     #  POUND SIGN
    0x00a4: 0x009f,     #  CURRENCY SIGN
    0x00a6: 0x00a7,     #  BROKEN BAR
    0x00a7: 0x00f5,     #  SECTION SIGN
    0x00a9: 0x00a8,     #  COPYRIGHT SIGN
    0x00ab: 0x00ae,     #  LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00ac: 0x00aa,     #  NOT SIGN
    0x00ad: 0x00f0,     #  SOFT HYPHEN
    0x00ae: 0x00a9,     #  REGISTERED SIGN
    0x00b0: 0x00f8,     #  DEGREE SIGN
    0x00b1: 0x00f1,     #  PLUS-MINUS SIGN
    0x00b2: 0x00fd,     #  SUPERSCRIPT TWO
    0x00b3: 0x00fc,     #  SUPERSCRIPT THREE
    0x00b5: 0x00e6,     #  MICRO SIGN
    0x00b6: 0x00f4,     #  PILCROW SIGN
    0x00b7: 0x00fa,     #  MIDDLE DOT
    0x00b9: 0x00fb,     #  SUPERSCRIPT ONE
    0x00bb: 0x00af,     #  RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00bc: 0x00ac,     #  VULGAR FRACTION ONE QUARTER
    0x00bd: 0x00ab,     #  VULGAR FRACTION ONE HALF
    0x00be: 0x00f3,     #  VULGAR FRACTION THREE QUARTERS
    0x00c4: 0x008e,     #  LATIN CAPITAL LETTER A WITH DIAERESIS
    0x00c5: 0x008f,     #  LATIN CAPITAL LETTER A WITH RING ABOVE
    0x00c6: 0x0092,     #  LATIN CAPITAL LIGATURE AE
    0x00c9: 0x0090,     #  LATIN CAPITAL LETTER E WITH ACUTE
    0x00d3: 0x00e0,     #  LATIN CAPITAL LETTER O WITH ACUTE
    0x00d5: 0x00e5,     #  LATIN CAPITAL LETTER O WITH TILDE
    0x00d6: 0x0099,     #  LATIN CAPITAL LETTER O WITH DIAERESIS
    0x00d7: 0x009e,     #  MULTIPLICATION SIGN
    0x00d8: 0x009d,     #  LATIN CAPITAL LETTER O WITH STROKE
    0x00dc: 0x009a,     #  LATIN CAPITAL LETTER U WITH DIAERESIS
    0x00df: 0x00e1,     #  LATIN SMALL LETTER SHARP S (GERMAN)
    0x00e4: 0x0084,     #  LATIN SMALL LETTER A WITH DIAERESIS
    0x00e5: 0x0086,     #  LATIN SMALL LETTER A WITH RING ABOVE
    0x00e6: 0x0091,     #  LATIN SMALL LIGATURE AE
    0x00e9: 0x0082,     #  LATIN SMALL LETTER E WITH ACUTE
    0x00f3: 0x00a2,     #  LATIN SMALL LETTER O WITH ACUTE
    0x00f5: 0x00e4,     #  LATIN SMALL LETTER O WITH TILDE
    0x00f6: 0x0094,     #  LATIN SMALL LETTER O WITH DIAERESIS
    0x00f7: 0x00f6,     #  DIVISION SIGN
    0x00f8: 0x009b,     #  LATIN SMALL LETTER O WITH STROKE
    0x00fc: 0x0081,     #  LATIN SMALL LETTER U WITH DIAERESIS
    0x0100: 0x00a0,     #  LATIN CAPITAL LETTER A WITH MACRON
    0x0101: 0x0083,     #  LATIN SMALL LETTER A WITH MACRON
    0x0104: 0x00b5,     #  LATIN CAPITAL LETTER A WITH OGONEK
    0x0105: 0x00d0,     #  LATIN SMALL LETTER A WITH OGONEK
    0x0106: 0x0080,     #  LATIN CAPITAL LETTER C WITH ACUTE
    0x0107: 0x0087,     #  LATIN SMALL LETTER C WITH ACUTE
    0x010c: 0x00b6,     #  LATIN CAPITAL LETTER C WITH CARON
    0x010d: 0x00d1,     #  LATIN SMALL LETTER C WITH CARON
    0x0112: 0x00ed,     #  LATIN CAPITAL LETTER E WITH MACRON
    0x0113: 0x0089,     #  LATIN SMALL LETTER E WITH MACRON
    0x0116: 0x00b8,     #  LATIN CAPITAL LETTER E WITH DOT ABOVE
    0x0117: 0x00d3,     #  LATIN SMALL LETTER E WITH DOT ABOVE
    0x0118: 0x00b7,     #  LATIN CAPITAL LETTER E WITH OGONEK
    0x0119: 0x00d2,     #  LATIN SMALL LETTER E WITH OGONEK
    0x0122: 0x0095,     #  LATIN CAPITAL LETTER G WITH CEDILLA
    0x0123: 0x0085,     #  LATIN SMALL LETTER G WITH CEDILLA
    0x012a: 0x00a1,     #  LATIN CAPITAL LETTER I WITH MACRON
    0x012b: 0x008c,     #  LATIN SMALL LETTER I WITH MACRON
    0x012e: 0x00bd,     #  LATIN CAPITAL LETTER I WITH OGONEK
    0x012f: 0x00d4,     #  LATIN SMALL LETTER I WITH OGONEK
    0x0136: 0x00e8,     #  LATIN CAPITAL LETTER K WITH CEDILLA
    0x0137: 0x00e9,     #  LATIN SMALL LETTER K WITH CEDILLA
    0x013b: 0x00ea,     #  LATIN CAPITAL LETTER L WITH CEDILLA
    0x013c: 0x00eb,     #  LATIN SMALL LETTER L WITH CEDILLA
    0x0141: 0x00ad,     #  LATIN CAPITAL LETTER L WITH STROKE
    0x0142: 0x0088,     #  LATIN SMALL LETTER L WITH STROKE
    0x0143: 0x00e3,     #  LATIN CAPITAL LETTER N WITH ACUTE
    0x0144: 0x00e7,     #  LATIN SMALL LETTER N WITH ACUTE
    0x0145: 0x00ee,     #  LATIN CAPITAL LETTER N WITH CEDILLA
    0x0146: 0x00ec,     #  LATIN SMALL LETTER N WITH CEDILLA
    0x014c: 0x00e2,     #  LATIN CAPITAL LETTER O WITH MACRON
    0x014d: 0x0093,     #  LATIN SMALL LETTER O WITH MACRON
    0x0156: 0x008a,     #  LATIN CAPITAL LETTER R WITH CEDILLA
    0x0157: 0x008b,     #  LATIN SMALL LETTER R WITH CEDILLA
    0x015a: 0x0097,     #  LATIN CAPITAL LETTER S WITH ACUTE
    0x015b: 0x0098,     #  LATIN SMALL LETTER S WITH ACUTE
    0x0160: 0x00be,     #  LATIN CAPITAL LETTER S WITH CARON
    0x0161: 0x00d5,     #  LATIN SMALL LETTER S WITH CARON
    0x016a: 0x00c7,     #  LATIN CAPITAL LETTER U WITH MACRON
    0x016b: 0x00d7,     #  LATIN SMALL LETTER U WITH MACRON
    0x0172: 0x00c6,     #  LATIN CAPITAL LETTER U WITH OGONEK
    0x0173: 0x00d6,     #  LATIN SMALL LETTER U WITH OGONEK
    0x0179: 0x008d,     #  LATIN CAPITAL LETTER Z WITH ACUTE
    0x017a: 0x00a5,     #  LATIN SMALL LETTER Z WITH ACUTE
    0x017b: 0x00a3,     #  LATIN CAPITAL LETTER Z WITH DOT ABOVE
    0x017c: 0x00a4,     #  LATIN SMALL LETTER Z WITH DOT ABOVE
    0x017d: 0x00cf,     #  LATIN CAPITAL LETTER Z WITH CARON
    0x017e: 0x00d8,     #  LATIN SMALL LETTER Z WITH CARON
    0x2019: 0x00ef,     #  RIGHT SINGLE QUOTATION MARK
    0x201c: 0x00f2,     #  LEFT DOUBLE QUOTATION MARK
    0x201d: 0x00a6,     #  RIGHT DOUBLE QUOTATION MARK
    0x201e: 0x00f7,     #  DOUBLE LOW-9 QUOTATION MARK
    0x2219: 0x00f9,     #  BULLET OPERATOR
    0x2500: 0x00c4,     #  BOX DRAWINGS LIGHT HORIZONTAL
    0x2502: 0x00b3,     #  BOX DRAWINGS LIGHT VERTICAL
    0x250c: 0x00da,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
    0x2510: 0x00bf,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
    0x2514: 0x00c0,     #  BOX DRAWINGS LIGHT UP AND RIGHT
    0x2518: 0x00d9,     #  BOX DRAWINGS LIGHT UP AND LEFT
    0x251c: 0x00c3,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    0x2524: 0x00b4,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
    0x252c: 0x00c2,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    0x2534: 0x00c1,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
    0x253c: 0x00c5,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    0x2550: 0x00cd,     #  BOX DRAWINGS DOUBLE HORIZONTAL
    0x2551: 0x00ba,     #  BOX DRAWINGS DOUBLE VERTICAL
    0x2554: 0x00c9,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
    0x2557: 0x00bb,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
    0x255a: 0x00c8,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
    0x255d: 0x00bc,     #  BOX DRAWINGS DOUBLE UP AND LEFT
    0x2560: 0x00cc,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    0x2563: 0x00b9,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    0x2566: 0x00cb,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    0x2569: 0x00ca,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    0x256c: 0x00ce,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    0x2580: 0x00df,     #  UPPER HALF BLOCK
    0x2584: 0x00dc,     #  LOWER HALF BLOCK
    0x2588: 0x00db,     #  FULL BLOCK
    0x258c: 0x00dd,     #  LEFT HALF BLOCK
    0x2590: 0x00de,     #  RIGHT HALF BLOCK
    0x2591: 0x00b0,     #  LIGHT SHADE
    0x2592: 0x00b1,     #  MEDIUM SHADE
    0x2593: 0x00b2,     #  DARK SHADE
    0x25a0: 0x00fe,     #  BLACK SQUARE
}
encodings/__init__.py000064400000012724151153537620010644 0ustar00""" Standard "encodings" Package

    Standard Python encoding modules are stored in this package
    directory.

    Codec modules must have names corresponding to normalized encoding
    names as defined in the normalize_encoding() function below, e.g.
    'utf-8' must be implemented by the module 'utf_8.py'.

    Each codec module must export the following interface:

    * getregentry() -> codecs.CodecInfo object
    The getregentry() API must return a CodecInfo object with encoder, decoder,
    incrementalencoder, incrementaldecoder, streamwriter and streamreader
    attributes which adhere to the Python Codec Interface Standard.

    In addition, a module may optionally also define the following
    APIs which are then used by the package's codec search function:

    * getaliases() -> sequence of encoding name strings to use as aliases

    Alias names returned by getaliases() must be normalized encoding
    names as defined by normalize_encoding().

Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

"""#"

import codecs
import sys
from . import aliases

_cache = {}
_unknown = '--unknown--'
_import_tail = ['*']
_aliases = aliases.aliases

class CodecRegistryError(LookupError, SystemError):
    pass

def normalize_encoding(encoding):

    """ Normalize an encoding name.

        Normalization works as follows: all non-alphanumeric
        characters except the dot used for Python package names are
        collapsed and replaced with a single underscore, e.g. '  -;#'
        becomes '_'. Leading and trailing underscores are removed.

        Note that encoding names should be ASCII only.

    """
    if isinstance(encoding, bytes):
        encoding = str(encoding, "ascii")

    chars = []
    punct = False
    for c in encoding:
        if c.isalnum() or c == '.':
            if punct and chars:
                chars.append('_')
            chars.append(c)
            punct = False
        else:
            punct = True
    return ''.join(chars)

def search_function(encoding):

    # Cache lookup
    entry = _cache.get(encoding, _unknown)
    if entry is not _unknown:
        return entry

    # Import the module:
    #
    # First try to find an alias for the normalized encoding
    # name and lookup the module using the aliased name, then try to
    # lookup the module using the standard import scheme, i.e. first
    # try in the encodings package, then at top-level.
    #
    norm_encoding = normalize_encoding(encoding)
    aliased_encoding = _aliases.get(norm_encoding) or \
                       _aliases.get(norm_encoding.replace('.', '_'))
    if aliased_encoding is not None:
        modnames = [aliased_encoding,
                    norm_encoding]
    else:
        modnames = [norm_encoding]
    for modname in modnames:
        if not modname or '.' in modname:
            continue
        try:
            # Import is absolute to prevent the possibly malicious import of a
            # module with side-effects that is not in the 'encodings' package.
            mod = __import__('encodings.' + modname, fromlist=_import_tail,
                             level=0)
        except ImportError:
            # ImportError may occur because 'encodings.(modname)' does not exist,
            # or because it imports a name that does not exist (see mbcs and oem)
            pass
        else:
            break
    else:
        mod = None

    try:
        getregentry = mod.getregentry
    except AttributeError:
        # Not a codec module
        mod = None

    if mod is None:
        # Cache misses
        _cache[encoding] = None
        return None

    # Now ask the module for the registry entry
    entry = getregentry()
    if not isinstance(entry, codecs.CodecInfo):
        if not 4 <= len(entry) <= 7:
            raise CodecRegistryError('module "%s" (%s) failed to register'
                                     % (mod.__name__, mod.__file__))
        if not callable(entry[0]) or not callable(entry[1]) or \
           (entry[2] is not None and not callable(entry[2])) or \
           (entry[3] is not None and not callable(entry[3])) or \
           (len(entry) > 4 and entry[4] is not None and not callable(entry[4])) or \
           (len(entry) > 5 and entry[5] is not None and not callable(entry[5])):
            raise CodecRegistryError('incompatible codecs in module "%s" (%s)'
                                     % (mod.__name__, mod.__file__))
        if len(entry)<7 or entry[6] is None:
            entry += (None,)*(6-len(entry)) + (mod.__name__.split(".", 1)[1],)
        entry = codecs.CodecInfo(*entry)

    # Cache the codec registry entry
    _cache[encoding] = entry

    # Register its aliases (without overwriting previously registered
    # aliases)
    try:
        codecaliases = mod.getaliases()
    except AttributeError:
        pass
    else:
        for alias in codecaliases:
            if alias not in _aliases:
                _aliases[alias] = modname

    # Return the registry entry
    return entry

# Register the search_function in the Python codec registry
codecs.register(search_function)

if sys.platform == 'win32':
    def _alias_mbcs(encoding):
        try:
            import _winapi
            ansi_code_page = "cp%s" % _winapi.GetACP()
            if encoding == ansi_code_page:
                import encodings.mbcs
                return encodings.mbcs.getregentry()
        except ImportError:
            # Imports may fail while we are shutting down
            pass

    codecs.register(_alias_mbcs)
encodings/hz.py000064400000001763151153537620007527 0ustar00#
# hz.py: Python Unicode Codec for HZ
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#

import _codecs_cn, codecs
import _multibytecodec as mbc

codec = _codecs_cn.getcodec('hz')

class Codec(codecs.Codec):
    encode = codec.encode
    decode = codec.decode

class IncrementalEncoder(mbc.MultibyteIncrementalEncoder,
                         codecs.IncrementalEncoder):
    codec = codec

class IncrementalDecoder(mbc.MultibyteIncrementalDecoder,
                         codecs.IncrementalDecoder):
    codec = codec

class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader):
    codec = codec

class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
    codec = codec

def getregentry():
    return codecs.CodecInfo(
        name='hz',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/cp437.py000064400000103404151153537620007741 0ustar00""" Python Character Mapping Codec cp437 generated from 'VENDORS/MICSFT/PC/CP437.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_map)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_map)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp437',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )

### Decoding Map

decoding_map = codecs.make_identity_dict(range(256))
decoding_map.update({
    0x0080: 0x00c7,     #  LATIN CAPITAL LETTER C WITH CEDILLA
    0x0081: 0x00fc,     #  LATIN SMALL LETTER U WITH DIAERESIS
    0x0082: 0x00e9,     #  LATIN SMALL LETTER E WITH ACUTE
    0x0083: 0x00e2,     #  LATIN SMALL LETTER A WITH CIRCUMFLEX
    0x0084: 0x00e4,     #  LATIN SMALL LETTER A WITH DIAERESIS
    0x0085: 0x00e0,     #  LATIN SMALL LETTER A WITH GRAVE
    0x0086: 0x00e5,     #  LATIN SMALL LETTER A WITH RING ABOVE
    0x0087: 0x00e7,     #  LATIN SMALL LETTER C WITH CEDILLA
    0x0088: 0x00ea,     #  LATIN SMALL LETTER E WITH CIRCUMFLEX
    0x0089: 0x00eb,     #  LATIN SMALL LETTER E WITH DIAERESIS
    0x008a: 0x00e8,     #  LATIN SMALL LETTER E WITH GRAVE
    0x008b: 0x00ef,     #  LATIN SMALL LETTER I WITH DIAERESIS
    0x008c: 0x00ee,     #  LATIN SMALL LETTER I WITH CIRCUMFLEX
    0x008d: 0x00ec,     #  LATIN SMALL LETTER I WITH GRAVE
    0x008e: 0x00c4,     #  LATIN CAPITAL LETTER A WITH DIAERESIS
    0x008f: 0x00c5,     #  LATIN CAPITAL LETTER A WITH RING ABOVE
    0x0090: 0x00c9,     #  LATIN CAPITAL LETTER E WITH ACUTE
    0x0091: 0x00e6,     #  LATIN SMALL LIGATURE AE
    0x0092: 0x00c6,     #  LATIN CAPITAL LIGATURE AE
    0x0093: 0x00f4,     #  LATIN SMALL LETTER O WITH CIRCUMFLEX
    0x0094: 0x00f6,     #  LATIN SMALL LETTER O WITH DIAERESIS
    0x0095: 0x00f2,     #  LATIN SMALL LETTER O WITH GRAVE
    0x0096: 0x00fb,     #  LATIN SMALL LETTER U WITH CIRCUMFLEX
    0x0097: 0x00f9,     #  LATIN SMALL LETTER U WITH GRAVE
    0x0098: 0x00ff,     #  LATIN SMALL LETTER Y WITH DIAERESIS
    0x0099: 0x00d6,     #  LATIN CAPITAL LETTER O WITH DIAERESIS
    0x009a: 0x00dc,     #  LATIN CAPITAL LETTER U WITH DIAERESIS
    0x009b: 0x00a2,     #  CENT SIGN
    0x009c: 0x00a3,     #  POUND SIGN
    0x009d: 0x00a5,     #  YEN SIGN
    0x009e: 0x20a7,     #  PESETA SIGN
    0x009f: 0x0192,     #  LATIN SMALL LETTER F WITH HOOK
    0x00a0: 0x00e1,     #  LATIN SMALL LETTER A WITH ACUTE
    0x00a1: 0x00ed,     #  LATIN SMALL LETTER I WITH ACUTE
    0x00a2: 0x00f3,     #  LATIN SMALL LETTER O WITH ACUTE
    0x00a3: 0x00fa,     #  LATIN SMALL LETTER U WITH ACUTE
    0x00a4: 0x00f1,     #  LATIN SMALL LETTER N WITH TILDE
    0x00a5: 0x00d1,     #  LATIN CAPITAL LETTER N WITH TILDE
    0x00a6: 0x00aa,     #  FEMININE ORDINAL INDICATOR
    0x00a7: 0x00ba,     #  MASCULINE ORDINAL INDICATOR
    0x00a8: 0x00bf,     #  INVERTED QUESTION MARK
    0x00a9: 0x2310,     #  REVERSED NOT SIGN
    0x00aa: 0x00ac,     #  NOT SIGN
    0x00ab: 0x00bd,     #  VULGAR FRACTION ONE HALF
    0x00ac: 0x00bc,     #  VULGAR FRACTION ONE QUARTER
    0x00ad: 0x00a1,     #  INVERTED EXCLAMATION MARK
    0x00ae: 0x00ab,     #  LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00af: 0x00bb,     #  RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00b0: 0x2591,     #  LIGHT SHADE
    0x00b1: 0x2592,     #  MEDIUM SHADE
    0x00b2: 0x2593,     #  DARK SHADE
    0x00b3: 0x2502,     #  BOX DRAWINGS LIGHT VERTICAL
    0x00b4: 0x2524,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
    0x00b5: 0x2561,     #  BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
    0x00b6: 0x2562,     #  BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
    0x00b7: 0x2556,     #  BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
    0x00b8: 0x2555,     #  BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
    0x00b9: 0x2563,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    0x00ba: 0x2551,     #  BOX DRAWINGS DOUBLE VERTICAL
    0x00bb: 0x2557,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
    0x00bc: 0x255d,     #  BOX DRAWINGS DOUBLE UP AND LEFT
    0x00bd: 0x255c,     #  BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
    0x00be: 0x255b,     #  BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
    0x00bf: 0x2510,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
    0x00c0: 0x2514,     #  BOX DRAWINGS LIGHT UP AND RIGHT
    0x00c1: 0x2534,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
    0x00c2: 0x252c,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    0x00c3: 0x251c,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    0x00c4: 0x2500,     #  BOX DRAWINGS LIGHT HORIZONTAL
    0x00c5: 0x253c,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    0x00c6: 0x255e,     #  BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
    0x00c7: 0x255f,     #  BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
    0x00c8: 0x255a,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
    0x00c9: 0x2554,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
    0x00ca: 0x2569,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    0x00cb: 0x2566,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    0x00cc: 0x2560,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    0x00cd: 0x2550,     #  BOX DRAWINGS DOUBLE HORIZONTAL
    0x00ce: 0x256c,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    0x00cf: 0x2567,     #  BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
    0x00d0: 0x2568,     #  BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
    0x00d1: 0x2564,     #  BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
    0x00d2: 0x2565,     #  BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
    0x00d3: 0x2559,     #  BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
    0x00d4: 0x2558,     #  BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
    0x00d5: 0x2552,     #  BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
    0x00d6: 0x2553,     #  BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
    0x00d7: 0x256b,     #  BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
    0x00d8: 0x256a,     #  BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
    0x00d9: 0x2518,     #  BOX DRAWINGS LIGHT UP AND LEFT
    0x00da: 0x250c,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
    0x00db: 0x2588,     #  FULL BLOCK
    0x00dc: 0x2584,     #  LOWER HALF BLOCK
    0x00dd: 0x258c,     #  LEFT HALF BLOCK
    0x00de: 0x2590,     #  RIGHT HALF BLOCK
    0x00df: 0x2580,     #  UPPER HALF BLOCK
    0x00e0: 0x03b1,     #  GREEK SMALL LETTER ALPHA
    0x00e1: 0x00df,     #  LATIN SMALL LETTER SHARP S
    0x00e2: 0x0393,     #  GREEK CAPITAL LETTER GAMMA
    0x00e3: 0x03c0,     #  GREEK SMALL LETTER PI
    0x00e4: 0x03a3,     #  GREEK CAPITAL LETTER SIGMA
    0x00e5: 0x03c3,     #  GREEK SMALL LETTER SIGMA
    0x00e6: 0x00b5,     #  MICRO SIGN
    0x00e7: 0x03c4,     #  GREEK SMALL LETTER TAU
    0x00e8: 0x03a6,     #  GREEK CAPITAL LETTER PHI
    0x00e9: 0x0398,     #  GREEK CAPITAL LETTER THETA
    0x00ea: 0x03a9,     #  GREEK CAPITAL LETTER OMEGA
    0x00eb: 0x03b4,     #  GREEK SMALL LETTER DELTA
    0x00ec: 0x221e,     #  INFINITY
    0x00ed: 0x03c6,     #  GREEK SMALL LETTER PHI
    0x00ee: 0x03b5,     #  GREEK SMALL LETTER EPSILON
    0x00ef: 0x2229,     #  INTERSECTION
    0x00f0: 0x2261,     #  IDENTICAL TO
    0x00f1: 0x00b1,     #  PLUS-MINUS SIGN
    0x00f2: 0x2265,     #  GREATER-THAN OR EQUAL TO
    0x00f3: 0x2264,     #  LESS-THAN OR EQUAL TO
    0x00f4: 0x2320,     #  TOP HALF INTEGRAL
    0x00f5: 0x2321,     #  BOTTOM HALF INTEGRAL
    0x00f6: 0x00f7,     #  DIVISION SIGN
    0x00f7: 0x2248,     #  ALMOST EQUAL TO
    0x00f8: 0x00b0,     #  DEGREE SIGN
    0x00f9: 0x2219,     #  BULLET OPERATOR
    0x00fa: 0x00b7,     #  MIDDLE DOT
    0x00fb: 0x221a,     #  SQUARE ROOT
    0x00fc: 0x207f,     #  SUPERSCRIPT LATIN SMALL LETTER N
    0x00fd: 0x00b2,     #  SUPERSCRIPT TWO
    0x00fe: 0x25a0,     #  BLACK SQUARE
    0x00ff: 0x00a0,     #  NO-BREAK SPACE
})

### Decoding Table

decoding_table = (
    '\x00'     #  0x0000 -> NULL
    '\x01'     #  0x0001 -> START OF HEADING
    '\x02'     #  0x0002 -> START OF TEXT
    '\x03'     #  0x0003 -> END OF TEXT
    '\x04'     #  0x0004 -> END OF TRANSMISSION
    '\x05'     #  0x0005 -> ENQUIRY
    '\x06'     #  0x0006 -> ACKNOWLEDGE
    '\x07'     #  0x0007 -> BELL
    '\x08'     #  0x0008 -> BACKSPACE
    '\t'       #  0x0009 -> HORIZONTAL TABULATION
    '\n'       #  0x000a -> LINE FEED
    '\x0b'     #  0x000b -> VERTICAL TABULATION
    '\x0c'     #  0x000c -> FORM FEED
    '\r'       #  0x000d -> CARRIAGE RETURN
    '\x0e'     #  0x000e -> SHIFT OUT
    '\x0f'     #  0x000f -> SHIFT IN
    '\x10'     #  0x0010 -> DATA LINK ESCAPE
    '\x11'     #  0x0011 -> DEVICE CONTROL ONE
    '\x12'     #  0x0012 -> DEVICE CONTROL TWO
    '\x13'     #  0x0013 -> DEVICE CONTROL THREE
    '\x14'     #  0x0014 -> DEVICE CONTROL FOUR
    '\x15'     #  0x0015 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x0016 -> SYNCHRONOUS IDLE
    '\x17'     #  0x0017 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x0018 -> CANCEL
    '\x19'     #  0x0019 -> END OF MEDIUM
    '\x1a'     #  0x001a -> SUBSTITUTE
    '\x1b'     #  0x001b -> ESCAPE
    '\x1c'     #  0x001c -> FILE SEPARATOR
    '\x1d'     #  0x001d -> GROUP SEPARATOR
    '\x1e'     #  0x001e -> RECORD SEPARATOR
    '\x1f'     #  0x001f -> UNIT SEPARATOR
    ' '        #  0x0020 -> SPACE
    '!'        #  0x0021 -> EXCLAMATION MARK
    '"'        #  0x0022 -> QUOTATION MARK
    '#'        #  0x0023 -> NUMBER SIGN
    '$'        #  0x0024 -> DOLLAR SIGN
    '%'        #  0x0025 -> PERCENT SIGN
    '&'        #  0x0026 -> AMPERSAND
    "'"        #  0x0027 -> APOSTROPHE
    '('        #  0x0028 -> LEFT PARENTHESIS
    ')'        #  0x0029 -> RIGHT PARENTHESIS
    '*'        #  0x002a -> ASTERISK
    '+'        #  0x002b -> PLUS SIGN
    ','        #  0x002c -> COMMA
    '-'        #  0x002d -> HYPHEN-MINUS
    '.'        #  0x002e -> FULL STOP
    '/'        #  0x002f -> SOLIDUS
    '0'        #  0x0030 -> DIGIT ZERO
    '1'        #  0x0031 -> DIGIT ONE
    '2'        #  0x0032 -> DIGIT TWO
    '3'        #  0x0033 -> DIGIT THREE
    '4'        #  0x0034 -> DIGIT FOUR
    '5'        #  0x0035 -> DIGIT FIVE
    '6'        #  0x0036 -> DIGIT SIX
    '7'        #  0x0037 -> DIGIT SEVEN
    '8'        #  0x0038 -> DIGIT EIGHT
    '9'        #  0x0039 -> DIGIT NINE
    ':'        #  0x003a -> COLON
    ';'        #  0x003b -> SEMICOLON
    '<'        #  0x003c -> LESS-THAN SIGN
    '='        #  0x003d -> EQUALS SIGN
    '>'        #  0x003e -> GREATER-THAN SIGN
    '?'        #  0x003f -> QUESTION MARK
    '@'        #  0x0040 -> COMMERCIAL AT
    'A'        #  0x0041 -> LATIN CAPITAL LETTER A
    'B'        #  0x0042 -> LATIN CAPITAL LETTER B
    'C'        #  0x0043 -> LATIN CAPITAL LETTER C
    'D'        #  0x0044 -> LATIN CAPITAL LETTER D
    'E'        #  0x0045 -> LATIN CAPITAL LETTER E
    'F'        #  0x0046 -> LATIN CAPITAL LETTER F
    'G'        #  0x0047 -> LATIN CAPITAL LETTER G
    'H'        #  0x0048 -> LATIN CAPITAL LETTER H
    'I'        #  0x0049 -> LATIN CAPITAL LETTER I
    'J'        #  0x004a -> LATIN CAPITAL LETTER J
    'K'        #  0x004b -> LATIN CAPITAL LETTER K
    'L'        #  0x004c -> LATIN CAPITAL LETTER L
    'M'        #  0x004d -> LATIN CAPITAL LETTER M
    'N'        #  0x004e -> LATIN CAPITAL LETTER N
    'O'        #  0x004f -> LATIN CAPITAL LETTER O
    'P'        #  0x0050 -> LATIN CAPITAL LETTER P
    'Q'        #  0x0051 -> LATIN CAPITAL LETTER Q
    'R'        #  0x0052 -> LATIN CAPITAL LETTER R
    'S'        #  0x0053 -> LATIN CAPITAL LETTER S
    'T'        #  0x0054 -> LATIN CAPITAL LETTER T
    'U'        #  0x0055 -> LATIN CAPITAL LETTER U
    'V'        #  0x0056 -> LATIN CAPITAL LETTER V
    'W'        #  0x0057 -> LATIN CAPITAL LETTER W
    'X'        #  0x0058 -> LATIN CAPITAL LETTER X
    'Y'        #  0x0059 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x005a -> LATIN CAPITAL LETTER Z
    '['        #  0x005b -> LEFT SQUARE BRACKET
    '\\'       #  0x005c -> REVERSE SOLIDUS
    ']'        #  0x005d -> RIGHT SQUARE BRACKET
    '^'        #  0x005e -> CIRCUMFLEX ACCENT
    '_'        #  0x005f -> LOW LINE
    '`'        #  0x0060 -> GRAVE ACCENT
    'a'        #  0x0061 -> LATIN SMALL LETTER A
    'b'        #  0x0062 -> LATIN SMALL LETTER B
    'c'        #  0x0063 -> LATIN SMALL LETTER C
    'd'        #  0x0064 -> LATIN SMALL LETTER D
    'e'        #  0x0065 -> LATIN SMALL LETTER E
    'f'        #  0x0066 -> LATIN SMALL LETTER F
    'g'        #  0x0067 -> LATIN SMALL LETTER G
    'h'        #  0x0068 -> LATIN SMALL LETTER H
    'i'        #  0x0069 -> LATIN SMALL LETTER I
    'j'        #  0x006a -> LATIN SMALL LETTER J
    'k'        #  0x006b -> LATIN SMALL LETTER K
    'l'        #  0x006c -> LATIN SMALL LETTER L
    'm'        #  0x006d -> LATIN SMALL LETTER M
    'n'        #  0x006e -> LATIN SMALL LETTER N
    'o'        #  0x006f -> LATIN SMALL LETTER O
    'p'        #  0x0070 -> LATIN SMALL LETTER P
    'q'        #  0x0071 -> LATIN SMALL LETTER Q
    'r'        #  0x0072 -> LATIN SMALL LETTER R
    's'        #  0x0073 -> LATIN SMALL LETTER S
    't'        #  0x0074 -> LATIN SMALL LETTER T
    'u'        #  0x0075 -> LATIN SMALL LETTER U
    'v'        #  0x0076 -> LATIN SMALL LETTER V
    'w'        #  0x0077 -> LATIN SMALL LETTER W
    'x'        #  0x0078 -> LATIN SMALL LETTER X
    'y'        #  0x0079 -> LATIN SMALL LETTER Y
    'z'        #  0x007a -> LATIN SMALL LETTER Z
    '{'        #  0x007b -> LEFT CURLY BRACKET
    '|'        #  0x007c -> VERTICAL LINE
    '}'        #  0x007d -> RIGHT CURLY BRACKET
    '~'        #  0x007e -> TILDE
    '\x7f'     #  0x007f -> DELETE
    '\xc7'     #  0x0080 -> LATIN CAPITAL LETTER C WITH CEDILLA
    '\xfc'     #  0x0081 -> LATIN SMALL LETTER U WITH DIAERESIS
    '\xe9'     #  0x0082 -> LATIN SMALL LETTER E WITH ACUTE
    '\xe2'     #  0x0083 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\xe4'     #  0x0084 -> LATIN SMALL LETTER A WITH DIAERESIS
    '\xe0'     #  0x0085 -> LATIN SMALL LETTER A WITH GRAVE
    '\xe5'     #  0x0086 -> LATIN SMALL LETTER A WITH RING ABOVE
    '\xe7'     #  0x0087 -> LATIN SMALL LETTER C WITH CEDILLA
    '\xea'     #  0x0088 -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xeb'     #  0x0089 -> LATIN SMALL LETTER E WITH DIAERESIS
    '\xe8'     #  0x008a -> LATIN SMALL LETTER E WITH GRAVE
    '\xef'     #  0x008b -> LATIN SMALL LETTER I WITH DIAERESIS
    '\xee'     #  0x008c -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\xec'     #  0x008d -> LATIN SMALL LETTER I WITH GRAVE
    '\xc4'     #  0x008e -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\xc5'     #  0x008f -> LATIN CAPITAL LETTER A WITH RING ABOVE
    '\xc9'     #  0x0090 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\xe6'     #  0x0091 -> LATIN SMALL LIGATURE AE
    '\xc6'     #  0x0092 -> LATIN CAPITAL LIGATURE AE
    '\xf4'     #  0x0093 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xf6'     #  0x0094 -> LATIN SMALL LETTER O WITH DIAERESIS
    '\xf2'     #  0x0095 -> LATIN SMALL LETTER O WITH GRAVE
    '\xfb'     #  0x0096 -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\xf9'     #  0x0097 -> LATIN SMALL LETTER U WITH GRAVE
    '\xff'     #  0x0098 -> LATIN SMALL LETTER Y WITH DIAERESIS
    '\xd6'     #  0x0099 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xdc'     #  0x009a -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\xa2'     #  0x009b -> CENT SIGN
    '\xa3'     #  0x009c -> POUND SIGN
    '\xa5'     #  0x009d -> YEN SIGN
    '\u20a7'   #  0x009e -> PESETA SIGN
    '\u0192'   #  0x009f -> LATIN SMALL LETTER F WITH HOOK
    '\xe1'     #  0x00a0 -> LATIN SMALL LETTER A WITH ACUTE
    '\xed'     #  0x00a1 -> LATIN SMALL LETTER I WITH ACUTE
    '\xf3'     #  0x00a2 -> LATIN SMALL LETTER O WITH ACUTE
    '\xfa'     #  0x00a3 -> LATIN SMALL LETTER U WITH ACUTE
    '\xf1'     #  0x00a4 -> LATIN SMALL LETTER N WITH TILDE
    '\xd1'     #  0x00a5 -> LATIN CAPITAL LETTER N WITH TILDE
    '\xaa'     #  0x00a6 -> FEMININE ORDINAL INDICATOR
    '\xba'     #  0x00a7 -> MASCULINE ORDINAL INDICATOR
    '\xbf'     #  0x00a8 -> INVERTED QUESTION MARK
    '\u2310'   #  0x00a9 -> REVERSED NOT SIGN
    '\xac'     #  0x00aa -> NOT SIGN
    '\xbd'     #  0x00ab -> VULGAR FRACTION ONE HALF
    '\xbc'     #  0x00ac -> VULGAR FRACTION ONE QUARTER
    '\xa1'     #  0x00ad -> INVERTED EXCLAMATION MARK
    '\xab'     #  0x00ae -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbb'     #  0x00af -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u2591'   #  0x00b0 -> LIGHT SHADE
    '\u2592'   #  0x00b1 -> MEDIUM SHADE
    '\u2593'   #  0x00b2 -> DARK SHADE
    '\u2502'   #  0x00b3 -> BOX DRAWINGS LIGHT VERTICAL
    '\u2524'   #  0x00b4 -> BOX DRAWINGS LIGHT VERTICAL AND LEFT
    '\u2561'   #  0x00b5 -> BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
    '\u2562'   #  0x00b6 -> BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
    '\u2556'   #  0x00b7 -> BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
    '\u2555'   #  0x00b8 -> BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
    '\u2563'   #  0x00b9 -> BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    '\u2551'   #  0x00ba -> BOX DRAWINGS DOUBLE VERTICAL
    '\u2557'   #  0x00bb -> BOX DRAWINGS DOUBLE DOWN AND LEFT
    '\u255d'   #  0x00bc -> BOX DRAWINGS DOUBLE UP AND LEFT
    '\u255c'   #  0x00bd -> BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
    '\u255b'   #  0x00be -> BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
    '\u2510'   #  0x00bf -> BOX DRAWINGS LIGHT DOWN AND LEFT
    '\u2514'   #  0x00c0 -> BOX DRAWINGS LIGHT UP AND RIGHT
    '\u2534'   #  0x00c1 -> BOX DRAWINGS LIGHT UP AND HORIZONTAL
    '\u252c'   #  0x00c2 -> BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    '\u251c'   #  0x00c3 -> BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    '\u2500'   #  0x00c4 -> BOX DRAWINGS LIGHT HORIZONTAL
    '\u253c'   #  0x00c5 -> BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    '\u255e'   #  0x00c6 -> BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
    '\u255f'   #  0x00c7 -> BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
    '\u255a'   #  0x00c8 -> BOX DRAWINGS DOUBLE UP AND RIGHT
    '\u2554'   #  0x00c9 -> BOX DRAWINGS DOUBLE DOWN AND RIGHT
    '\u2569'   #  0x00ca -> BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    '\u2566'   #  0x00cb -> BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    '\u2560'   #  0x00cc -> BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    '\u2550'   #  0x00cd -> BOX DRAWINGS DOUBLE HORIZONTAL
    '\u256c'   #  0x00ce -> BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    '\u2567'   #  0x00cf -> BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
    '\u2568'   #  0x00d0 -> BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
    '\u2564'   #  0x00d1 -> BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
    '\u2565'   #  0x00d2 -> BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
    '\u2559'   #  0x00d3 -> BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
    '\u2558'   #  0x00d4 -> BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
    '\u2552'   #  0x00d5 -> BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
    '\u2553'   #  0x00d6 -> BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
    '\u256b'   #  0x00d7 -> BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
    '\u256a'   #  0x00d8 -> BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
    '\u2518'   #  0x00d9 -> BOX DRAWINGS LIGHT UP AND LEFT
    '\u250c'   #  0x00da -> BOX DRAWINGS LIGHT DOWN AND RIGHT
    '\u2588'   #  0x00db -> FULL BLOCK
    '\u2584'   #  0x00dc -> LOWER HALF BLOCK
    '\u258c'   #  0x00dd -> LEFT HALF BLOCK
    '\u2590'   #  0x00de -> RIGHT HALF BLOCK
    '\u2580'   #  0x00df -> UPPER HALF BLOCK
    '\u03b1'   #  0x00e0 -> GREEK SMALL LETTER ALPHA
    '\xdf'     #  0x00e1 -> LATIN SMALL LETTER SHARP S
    '\u0393'   #  0x00e2 -> GREEK CAPITAL LETTER GAMMA
    '\u03c0'   #  0x00e3 -> GREEK SMALL LETTER PI
    '\u03a3'   #  0x00e4 -> GREEK CAPITAL LETTER SIGMA
    '\u03c3'   #  0x00e5 -> GREEK SMALL LETTER SIGMA
    '\xb5'     #  0x00e6 -> MICRO SIGN
    '\u03c4'   #  0x00e7 -> GREEK SMALL LETTER TAU
    '\u03a6'   #  0x00e8 -> GREEK CAPITAL LETTER PHI
    '\u0398'   #  0x00e9 -> GREEK CAPITAL LETTER THETA
    '\u03a9'   #  0x00ea -> GREEK CAPITAL LETTER OMEGA
    '\u03b4'   #  0x00eb -> GREEK SMALL LETTER DELTA
    '\u221e'   #  0x00ec -> INFINITY
    '\u03c6'   #  0x00ed -> GREEK SMALL LETTER PHI
    '\u03b5'   #  0x00ee -> GREEK SMALL LETTER EPSILON
    '\u2229'   #  0x00ef -> INTERSECTION
    '\u2261'   #  0x00f0 -> IDENTICAL TO
    '\xb1'     #  0x00f1 -> PLUS-MINUS SIGN
    '\u2265'   #  0x00f2 -> GREATER-THAN OR EQUAL TO
    '\u2264'   #  0x00f3 -> LESS-THAN OR EQUAL TO
    '\u2320'   #  0x00f4 -> TOP HALF INTEGRAL
    '\u2321'   #  0x00f5 -> BOTTOM HALF INTEGRAL
    '\xf7'     #  0x00f6 -> DIVISION SIGN
    '\u2248'   #  0x00f7 -> ALMOST EQUAL TO
    '\xb0'     #  0x00f8 -> DEGREE SIGN
    '\u2219'   #  0x00f9 -> BULLET OPERATOR
    '\xb7'     #  0x00fa -> MIDDLE DOT
    '\u221a'   #  0x00fb -> SQUARE ROOT
    '\u207f'   #  0x00fc -> SUPERSCRIPT LATIN SMALL LETTER N
    '\xb2'     #  0x00fd -> SUPERSCRIPT TWO
    '\u25a0'   #  0x00fe -> BLACK SQUARE
    '\xa0'     #  0x00ff -> NO-BREAK SPACE
)

### Encoding Map

encoding_map = {
    0x0000: 0x0000,     #  NULL
    0x0001: 0x0001,     #  START OF HEADING
    0x0002: 0x0002,     #  START OF TEXT
    0x0003: 0x0003,     #  END OF TEXT
    0x0004: 0x0004,     #  END OF TRANSMISSION
    0x0005: 0x0005,     #  ENQUIRY
    0x0006: 0x0006,     #  ACKNOWLEDGE
    0x0007: 0x0007,     #  BELL
    0x0008: 0x0008,     #  BACKSPACE
    0x0009: 0x0009,     #  HORIZONTAL TABULATION
    0x000a: 0x000a,     #  LINE FEED
    0x000b: 0x000b,     #  VERTICAL TABULATION
    0x000c: 0x000c,     #  FORM FEED
    0x000d: 0x000d,     #  CARRIAGE RETURN
    0x000e: 0x000e,     #  SHIFT OUT
    0x000f: 0x000f,     #  SHIFT IN
    0x0010: 0x0010,     #  DATA LINK ESCAPE
    0x0011: 0x0011,     #  DEVICE CONTROL ONE
    0x0012: 0x0012,     #  DEVICE CONTROL TWO
    0x0013: 0x0013,     #  DEVICE CONTROL THREE
    0x0014: 0x0014,     #  DEVICE CONTROL FOUR
    0x0015: 0x0015,     #  NEGATIVE ACKNOWLEDGE
    0x0016: 0x0016,     #  SYNCHRONOUS IDLE
    0x0017: 0x0017,     #  END OF TRANSMISSION BLOCK
    0x0018: 0x0018,     #  CANCEL
    0x0019: 0x0019,     #  END OF MEDIUM
    0x001a: 0x001a,     #  SUBSTITUTE
    0x001b: 0x001b,     #  ESCAPE
    0x001c: 0x001c,     #  FILE SEPARATOR
    0x001d: 0x001d,     #  GROUP SEPARATOR
    0x001e: 0x001e,     #  RECORD SEPARATOR
    0x001f: 0x001f,     #  UNIT SEPARATOR
    0x0020: 0x0020,     #  SPACE
    0x0021: 0x0021,     #  EXCLAMATION MARK
    0x0022: 0x0022,     #  QUOTATION MARK
    0x0023: 0x0023,     #  NUMBER SIGN
    0x0024: 0x0024,     #  DOLLAR SIGN
    0x0025: 0x0025,     #  PERCENT SIGN
    0x0026: 0x0026,     #  AMPERSAND
    0x0027: 0x0027,     #  APOSTROPHE
    0x0028: 0x0028,     #  LEFT PARENTHESIS
    0x0029: 0x0029,     #  RIGHT PARENTHESIS
    0x002a: 0x002a,     #  ASTERISK
    0x002b: 0x002b,     #  PLUS SIGN
    0x002c: 0x002c,     #  COMMA
    0x002d: 0x002d,     #  HYPHEN-MINUS
    0x002e: 0x002e,     #  FULL STOP
    0x002f: 0x002f,     #  SOLIDUS
    0x0030: 0x0030,     #  DIGIT ZERO
    0x0031: 0x0031,     #  DIGIT ONE
    0x0032: 0x0032,     #  DIGIT TWO
    0x0033: 0x0033,     #  DIGIT THREE
    0x0034: 0x0034,     #  DIGIT FOUR
    0x0035: 0x0035,     #  DIGIT FIVE
    0x0036: 0x0036,     #  DIGIT SIX
    0x0037: 0x0037,     #  DIGIT SEVEN
    0x0038: 0x0038,     #  DIGIT EIGHT
    0x0039: 0x0039,     #  DIGIT NINE
    0x003a: 0x003a,     #  COLON
    0x003b: 0x003b,     #  SEMICOLON
    0x003c: 0x003c,     #  LESS-THAN SIGN
    0x003d: 0x003d,     #  EQUALS SIGN
    0x003e: 0x003e,     #  GREATER-THAN SIGN
    0x003f: 0x003f,     #  QUESTION MARK
    0x0040: 0x0040,     #  COMMERCIAL AT
    0x0041: 0x0041,     #  LATIN CAPITAL LETTER A
    0x0042: 0x0042,     #  LATIN CAPITAL LETTER B
    0x0043: 0x0043,     #  LATIN CAPITAL LETTER C
    0x0044: 0x0044,     #  LATIN CAPITAL LETTER D
    0x0045: 0x0045,     #  LATIN CAPITAL LETTER E
    0x0046: 0x0046,     #  LATIN CAPITAL LETTER F
    0x0047: 0x0047,     #  LATIN CAPITAL LETTER G
    0x0048: 0x0048,     #  LATIN CAPITAL LETTER H
    0x0049: 0x0049,     #  LATIN CAPITAL LETTER I
    0x004a: 0x004a,     #  LATIN CAPITAL LETTER J
    0x004b: 0x004b,     #  LATIN CAPITAL LETTER K
    0x004c: 0x004c,     #  LATIN CAPITAL LETTER L
    0x004d: 0x004d,     #  LATIN CAPITAL LETTER M
    0x004e: 0x004e,     #  LATIN CAPITAL LETTER N
    0x004f: 0x004f,     #  LATIN CAPITAL LETTER O
    0x0050: 0x0050,     #  LATIN CAPITAL LETTER P
    0x0051: 0x0051,     #  LATIN CAPITAL LETTER Q
    0x0052: 0x0052,     #  LATIN CAPITAL LETTER R
    0x0053: 0x0053,     #  LATIN CAPITAL LETTER S
    0x0054: 0x0054,     #  LATIN CAPITAL LETTER T
    0x0055: 0x0055,     #  LATIN CAPITAL LETTER U
    0x0056: 0x0056,     #  LATIN CAPITAL LETTER V
    0x0057: 0x0057,     #  LATIN CAPITAL LETTER W
    0x0058: 0x0058,     #  LATIN CAPITAL LETTER X
    0x0059: 0x0059,     #  LATIN CAPITAL LETTER Y
    0x005a: 0x005a,     #  LATIN CAPITAL LETTER Z
    0x005b: 0x005b,     #  LEFT SQUARE BRACKET
    0x005c: 0x005c,     #  REVERSE SOLIDUS
    0x005d: 0x005d,     #  RIGHT SQUARE BRACKET
    0x005e: 0x005e,     #  CIRCUMFLEX ACCENT
    0x005f: 0x005f,     #  LOW LINE
    0x0060: 0x0060,     #  GRAVE ACCENT
    0x0061: 0x0061,     #  LATIN SMALL LETTER A
    0x0062: 0x0062,     #  LATIN SMALL LETTER B
    0x0063: 0x0063,     #  LATIN SMALL LETTER C
    0x0064: 0x0064,     #  LATIN SMALL LETTER D
    0x0065: 0x0065,     #  LATIN SMALL LETTER E
    0x0066: 0x0066,     #  LATIN SMALL LETTER F
    0x0067: 0x0067,     #  LATIN SMALL LETTER G
    0x0068: 0x0068,     #  LATIN SMALL LETTER H
    0x0069: 0x0069,     #  LATIN SMALL LETTER I
    0x006a: 0x006a,     #  LATIN SMALL LETTER J
    0x006b: 0x006b,     #  LATIN SMALL LETTER K
    0x006c: 0x006c,     #  LATIN SMALL LETTER L
    0x006d: 0x006d,     #  LATIN SMALL LETTER M
    0x006e: 0x006e,     #  LATIN SMALL LETTER N
    0x006f: 0x006f,     #  LATIN SMALL LETTER O
    0x0070: 0x0070,     #  LATIN SMALL LETTER P
    0x0071: 0x0071,     #  LATIN SMALL LETTER Q
    0x0072: 0x0072,     #  LATIN SMALL LETTER R
    0x0073: 0x0073,     #  LATIN SMALL LETTER S
    0x0074: 0x0074,     #  LATIN SMALL LETTER T
    0x0075: 0x0075,     #  LATIN SMALL LETTER U
    0x0076: 0x0076,     #  LATIN SMALL LETTER V
    0x0077: 0x0077,     #  LATIN SMALL LETTER W
    0x0078: 0x0078,     #  LATIN SMALL LETTER X
    0x0079: 0x0079,     #  LATIN SMALL LETTER Y
    0x007a: 0x007a,     #  LATIN SMALL LETTER Z
    0x007b: 0x007b,     #  LEFT CURLY BRACKET
    0x007c: 0x007c,     #  VERTICAL LINE
    0x007d: 0x007d,     #  RIGHT CURLY BRACKET
    0x007e: 0x007e,     #  TILDE
    0x007f: 0x007f,     #  DELETE
    0x00a0: 0x00ff,     #  NO-BREAK SPACE
    0x00a1: 0x00ad,     #  INVERTED EXCLAMATION MARK
    0x00a2: 0x009b,     #  CENT SIGN
    0x00a3: 0x009c,     #  POUND SIGN
    0x00a5: 0x009d,     #  YEN SIGN
    0x00aa: 0x00a6,     #  FEMININE ORDINAL INDICATOR
    0x00ab: 0x00ae,     #  LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00ac: 0x00aa,     #  NOT SIGN
    0x00b0: 0x00f8,     #  DEGREE SIGN
    0x00b1: 0x00f1,     #  PLUS-MINUS SIGN
    0x00b2: 0x00fd,     #  SUPERSCRIPT TWO
    0x00b5: 0x00e6,     #  MICRO SIGN
    0x00b7: 0x00fa,     #  MIDDLE DOT
    0x00ba: 0x00a7,     #  MASCULINE ORDINAL INDICATOR
    0x00bb: 0x00af,     #  RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00bc: 0x00ac,     #  VULGAR FRACTION ONE QUARTER
    0x00bd: 0x00ab,     #  VULGAR FRACTION ONE HALF
    0x00bf: 0x00a8,     #  INVERTED QUESTION MARK
    0x00c4: 0x008e,     #  LATIN CAPITAL LETTER A WITH DIAERESIS
    0x00c5: 0x008f,     #  LATIN CAPITAL LETTER A WITH RING ABOVE
    0x00c6: 0x0092,     #  LATIN CAPITAL LIGATURE AE
    0x00c7: 0x0080,     #  LATIN CAPITAL LETTER C WITH CEDILLA
    0x00c9: 0x0090,     #  LATIN CAPITAL LETTER E WITH ACUTE
    0x00d1: 0x00a5,     #  LATIN CAPITAL LETTER N WITH TILDE
    0x00d6: 0x0099,     #  LATIN CAPITAL LETTER O WITH DIAERESIS
    0x00dc: 0x009a,     #  LATIN CAPITAL LETTER U WITH DIAERESIS
    0x00df: 0x00e1,     #  LATIN SMALL LETTER SHARP S
    0x00e0: 0x0085,     #  LATIN SMALL LETTER A WITH GRAVE
    0x00e1: 0x00a0,     #  LATIN SMALL LETTER A WITH ACUTE
    0x00e2: 0x0083,     #  LATIN SMALL LETTER A WITH CIRCUMFLEX
    0x00e4: 0x0084,     #  LATIN SMALL LETTER A WITH DIAERESIS
    0x00e5: 0x0086,     #  LATIN SMALL LETTER A WITH RING ABOVE
    0x00e6: 0x0091,     #  LATIN SMALL LIGATURE AE
    0x00e7: 0x0087,     #  LATIN SMALL LETTER C WITH CEDILLA
    0x00e8: 0x008a,     #  LATIN SMALL LETTER E WITH GRAVE
    0x00e9: 0x0082,     #  LATIN SMALL LETTER E WITH ACUTE
    0x00ea: 0x0088,     #  LATIN SMALL LETTER E WITH CIRCUMFLEX
    0x00eb: 0x0089,     #  LATIN SMALL LETTER E WITH DIAERESIS
    0x00ec: 0x008d,     #  LATIN SMALL LETTER I WITH GRAVE
    0x00ed: 0x00a1,     #  LATIN SMALL LETTER I WITH ACUTE
    0x00ee: 0x008c,     #  LATIN SMALL LETTER I WITH CIRCUMFLEX
    0x00ef: 0x008b,     #  LATIN SMALL LETTER I WITH DIAERESIS
    0x00f1: 0x00a4,     #  LATIN SMALL LETTER N WITH TILDE
    0x00f2: 0x0095,     #  LATIN SMALL LETTER O WITH GRAVE
    0x00f3: 0x00a2,     #  LATIN SMALL LETTER O WITH ACUTE
    0x00f4: 0x0093,     #  LATIN SMALL LETTER O WITH CIRCUMFLEX
    0x00f6: 0x0094,     #  LATIN SMALL LETTER O WITH DIAERESIS
    0x00f7: 0x00f6,     #  DIVISION SIGN
    0x00f9: 0x0097,     #  LATIN SMALL LETTER U WITH GRAVE
    0x00fa: 0x00a3,     #  LATIN SMALL LETTER U WITH ACUTE
    0x00fb: 0x0096,     #  LATIN SMALL LETTER U WITH CIRCUMFLEX
    0x00fc: 0x0081,     #  LATIN SMALL LETTER U WITH DIAERESIS
    0x00ff: 0x0098,     #  LATIN SMALL LETTER Y WITH DIAERESIS
    0x0192: 0x009f,     #  LATIN SMALL LETTER F WITH HOOK
    0x0393: 0x00e2,     #  GREEK CAPITAL LETTER GAMMA
    0x0398: 0x00e9,     #  GREEK CAPITAL LETTER THETA
    0x03a3: 0x00e4,     #  GREEK CAPITAL LETTER SIGMA
    0x03a6: 0x00e8,     #  GREEK CAPITAL LETTER PHI
    0x03a9: 0x00ea,     #  GREEK CAPITAL LETTER OMEGA
    0x03b1: 0x00e0,     #  GREEK SMALL LETTER ALPHA
    0x03b4: 0x00eb,     #  GREEK SMALL LETTER DELTA
    0x03b5: 0x00ee,     #  GREEK SMALL LETTER EPSILON
    0x03c0: 0x00e3,     #  GREEK SMALL LETTER PI
    0x03c3: 0x00e5,     #  GREEK SMALL LETTER SIGMA
    0x03c4: 0x00e7,     #  GREEK SMALL LETTER TAU
    0x03c6: 0x00ed,     #  GREEK SMALL LETTER PHI
    0x207f: 0x00fc,     #  SUPERSCRIPT LATIN SMALL LETTER N
    0x20a7: 0x009e,     #  PESETA SIGN
    0x2219: 0x00f9,     #  BULLET OPERATOR
    0x221a: 0x00fb,     #  SQUARE ROOT
    0x221e: 0x00ec,     #  INFINITY
    0x2229: 0x00ef,     #  INTERSECTION
    0x2248: 0x00f7,     #  ALMOST EQUAL TO
    0x2261: 0x00f0,     #  IDENTICAL TO
    0x2264: 0x00f3,     #  LESS-THAN OR EQUAL TO
    0x2265: 0x00f2,     #  GREATER-THAN OR EQUAL TO
    0x2310: 0x00a9,     #  REVERSED NOT SIGN
    0x2320: 0x00f4,     #  TOP HALF INTEGRAL
    0x2321: 0x00f5,     #  BOTTOM HALF INTEGRAL
    0x2500: 0x00c4,     #  BOX DRAWINGS LIGHT HORIZONTAL
    0x2502: 0x00b3,     #  BOX DRAWINGS LIGHT VERTICAL
    0x250c: 0x00da,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
    0x2510: 0x00bf,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
    0x2514: 0x00c0,     #  BOX DRAWINGS LIGHT UP AND RIGHT
    0x2518: 0x00d9,     #  BOX DRAWINGS LIGHT UP AND LEFT
    0x251c: 0x00c3,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    0x2524: 0x00b4,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
    0x252c: 0x00c2,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    0x2534: 0x00c1,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
    0x253c: 0x00c5,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    0x2550: 0x00cd,     #  BOX DRAWINGS DOUBLE HORIZONTAL
    0x2551: 0x00ba,     #  BOX DRAWINGS DOUBLE VERTICAL
    0x2552: 0x00d5,     #  BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
    0x2553: 0x00d6,     #  BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
    0x2554: 0x00c9,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
    0x2555: 0x00b8,     #  BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
    0x2556: 0x00b7,     #  BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
    0x2557: 0x00bb,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
    0x2558: 0x00d4,     #  BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
    0x2559: 0x00d3,     #  BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
    0x255a: 0x00c8,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
    0x255b: 0x00be,     #  BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
    0x255c: 0x00bd,     #  BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
    0x255d: 0x00bc,     #  BOX DRAWINGS DOUBLE UP AND LEFT
    0x255e: 0x00c6,     #  BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
    0x255f: 0x00c7,     #  BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
    0x2560: 0x00cc,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    0x2561: 0x00b5,     #  BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
    0x2562: 0x00b6,     #  BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
    0x2563: 0x00b9,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    0x2564: 0x00d1,     #  BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
    0x2565: 0x00d2,     #  BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
    0x2566: 0x00cb,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    0x2567: 0x00cf,     #  BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
    0x2568: 0x00d0,     #  BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
    0x2569: 0x00ca,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    0x256a: 0x00d8,     #  BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
    0x256b: 0x00d7,     #  BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
    0x256c: 0x00ce,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    0x2580: 0x00df,     #  UPPER HALF BLOCK
    0x2584: 0x00dc,     #  LOWER HALF BLOCK
    0x2588: 0x00db,     #  FULL BLOCK
    0x258c: 0x00dd,     #  LEFT HALF BLOCK
    0x2590: 0x00de,     #  RIGHT HALF BLOCK
    0x2591: 0x00b0,     #  LIGHT SHADE
    0x2592: 0x00b1,     #  MEDIUM SHADE
    0x2593: 0x00b2,     #  DARK SHADE
    0x25a0: 0x00fe,     #  BLACK SQUARE
}
encodings/cp1006.py000064400000032400151153537620010007 0ustar00""" Python Character Mapping Codec cp1006 generated from 'MAPPINGS/VENDORS/MISC/CP1006.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp1006',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\x80'     #  0x80 -> <control>
    '\x81'     #  0x81 -> <control>
    '\x82'     #  0x82 -> <control>
    '\x83'     #  0x83 -> <control>
    '\x84'     #  0x84 -> <control>
    '\x85'     #  0x85 -> <control>
    '\x86'     #  0x86 -> <control>
    '\x87'     #  0x87 -> <control>
    '\x88'     #  0x88 -> <control>
    '\x89'     #  0x89 -> <control>
    '\x8a'     #  0x8A -> <control>
    '\x8b'     #  0x8B -> <control>
    '\x8c'     #  0x8C -> <control>
    '\x8d'     #  0x8D -> <control>
    '\x8e'     #  0x8E -> <control>
    '\x8f'     #  0x8F -> <control>
    '\x90'     #  0x90 -> <control>
    '\x91'     #  0x91 -> <control>
    '\x92'     #  0x92 -> <control>
    '\x93'     #  0x93 -> <control>
    '\x94'     #  0x94 -> <control>
    '\x95'     #  0x95 -> <control>
    '\x96'     #  0x96 -> <control>
    '\x97'     #  0x97 -> <control>
    '\x98'     #  0x98 -> <control>
    '\x99'     #  0x99 -> <control>
    '\x9a'     #  0x9A -> <control>
    '\x9b'     #  0x9B -> <control>
    '\x9c'     #  0x9C -> <control>
    '\x9d'     #  0x9D -> <control>
    '\x9e'     #  0x9E -> <control>
    '\x9f'     #  0x9F -> <control>
    '\xa0'     #  0xA0 -> NO-BREAK SPACE
    '\u06f0'   #  0xA1 -> EXTENDED ARABIC-INDIC DIGIT ZERO
    '\u06f1'   #  0xA2 -> EXTENDED ARABIC-INDIC DIGIT ONE
    '\u06f2'   #  0xA3 -> EXTENDED ARABIC-INDIC DIGIT TWO
    '\u06f3'   #  0xA4 -> EXTENDED ARABIC-INDIC DIGIT THREE
    '\u06f4'   #  0xA5 -> EXTENDED ARABIC-INDIC DIGIT FOUR
    '\u06f5'   #  0xA6 -> EXTENDED ARABIC-INDIC DIGIT FIVE
    '\u06f6'   #  0xA7 -> EXTENDED ARABIC-INDIC DIGIT SIX
    '\u06f7'   #  0xA8 -> EXTENDED ARABIC-INDIC DIGIT SEVEN
    '\u06f8'   #  0xA9 -> EXTENDED ARABIC-INDIC DIGIT EIGHT
    '\u06f9'   #  0xAA -> EXTENDED ARABIC-INDIC DIGIT NINE
    '\u060c'   #  0xAB -> ARABIC COMMA
    '\u061b'   #  0xAC -> ARABIC SEMICOLON
    '\xad'     #  0xAD -> SOFT HYPHEN
    '\u061f'   #  0xAE -> ARABIC QUESTION MARK
    '\ufe81'   #  0xAF -> ARABIC LETTER ALEF WITH MADDA ABOVE ISOLATED FORM
    '\ufe8d'   #  0xB0 -> ARABIC LETTER ALEF ISOLATED FORM
    '\ufe8e'   #  0xB1 -> ARABIC LETTER ALEF FINAL FORM
    '\ufe8e'   #  0xB2 -> ARABIC LETTER ALEF FINAL FORM
    '\ufe8f'   #  0xB3 -> ARABIC LETTER BEH ISOLATED FORM
    '\ufe91'   #  0xB4 -> ARABIC LETTER BEH INITIAL FORM
    '\ufb56'   #  0xB5 -> ARABIC LETTER PEH ISOLATED FORM
    '\ufb58'   #  0xB6 -> ARABIC LETTER PEH INITIAL FORM
    '\ufe93'   #  0xB7 -> ARABIC LETTER TEH MARBUTA ISOLATED FORM
    '\ufe95'   #  0xB8 -> ARABIC LETTER TEH ISOLATED FORM
    '\ufe97'   #  0xB9 -> ARABIC LETTER TEH INITIAL FORM
    '\ufb66'   #  0xBA -> ARABIC LETTER TTEH ISOLATED FORM
    '\ufb68'   #  0xBB -> ARABIC LETTER TTEH INITIAL FORM
    '\ufe99'   #  0xBC -> ARABIC LETTER THEH ISOLATED FORM
    '\ufe9b'   #  0xBD -> ARABIC LETTER THEH INITIAL FORM
    '\ufe9d'   #  0xBE -> ARABIC LETTER JEEM ISOLATED FORM
    '\ufe9f'   #  0xBF -> ARABIC LETTER JEEM INITIAL FORM
    '\ufb7a'   #  0xC0 -> ARABIC LETTER TCHEH ISOLATED FORM
    '\ufb7c'   #  0xC1 -> ARABIC LETTER TCHEH INITIAL FORM
    '\ufea1'   #  0xC2 -> ARABIC LETTER HAH ISOLATED FORM
    '\ufea3'   #  0xC3 -> ARABIC LETTER HAH INITIAL FORM
    '\ufea5'   #  0xC4 -> ARABIC LETTER KHAH ISOLATED FORM
    '\ufea7'   #  0xC5 -> ARABIC LETTER KHAH INITIAL FORM
    '\ufea9'   #  0xC6 -> ARABIC LETTER DAL ISOLATED FORM
    '\ufb84'   #  0xC7 -> ARABIC LETTER DAHAL ISOLATED FORMN
    '\ufeab'   #  0xC8 -> ARABIC LETTER THAL ISOLATED FORM
    '\ufead'   #  0xC9 -> ARABIC LETTER REH ISOLATED FORM
    '\ufb8c'   #  0xCA -> ARABIC LETTER RREH ISOLATED FORM
    '\ufeaf'   #  0xCB -> ARABIC LETTER ZAIN ISOLATED FORM
    '\ufb8a'   #  0xCC -> ARABIC LETTER JEH ISOLATED FORM
    '\ufeb1'   #  0xCD -> ARABIC LETTER SEEN ISOLATED FORM
    '\ufeb3'   #  0xCE -> ARABIC LETTER SEEN INITIAL FORM
    '\ufeb5'   #  0xCF -> ARABIC LETTER SHEEN ISOLATED FORM
    '\ufeb7'   #  0xD0 -> ARABIC LETTER SHEEN INITIAL FORM
    '\ufeb9'   #  0xD1 -> ARABIC LETTER SAD ISOLATED FORM
    '\ufebb'   #  0xD2 -> ARABIC LETTER SAD INITIAL FORM
    '\ufebd'   #  0xD3 -> ARABIC LETTER DAD ISOLATED FORM
    '\ufebf'   #  0xD4 -> ARABIC LETTER DAD INITIAL FORM
    '\ufec1'   #  0xD5 -> ARABIC LETTER TAH ISOLATED FORM
    '\ufec5'   #  0xD6 -> ARABIC LETTER ZAH ISOLATED FORM
    '\ufec9'   #  0xD7 -> ARABIC LETTER AIN ISOLATED FORM
    '\ufeca'   #  0xD8 -> ARABIC LETTER AIN FINAL FORM
    '\ufecb'   #  0xD9 -> ARABIC LETTER AIN INITIAL FORM
    '\ufecc'   #  0xDA -> ARABIC LETTER AIN MEDIAL FORM
    '\ufecd'   #  0xDB -> ARABIC LETTER GHAIN ISOLATED FORM
    '\ufece'   #  0xDC -> ARABIC LETTER GHAIN FINAL FORM
    '\ufecf'   #  0xDD -> ARABIC LETTER GHAIN INITIAL FORM
    '\ufed0'   #  0xDE -> ARABIC LETTER GHAIN MEDIAL FORM
    '\ufed1'   #  0xDF -> ARABIC LETTER FEH ISOLATED FORM
    '\ufed3'   #  0xE0 -> ARABIC LETTER FEH INITIAL FORM
    '\ufed5'   #  0xE1 -> ARABIC LETTER QAF ISOLATED FORM
    '\ufed7'   #  0xE2 -> ARABIC LETTER QAF INITIAL FORM
    '\ufed9'   #  0xE3 -> ARABIC LETTER KAF ISOLATED FORM
    '\ufedb'   #  0xE4 -> ARABIC LETTER KAF INITIAL FORM
    '\ufb92'   #  0xE5 -> ARABIC LETTER GAF ISOLATED FORM
    '\ufb94'   #  0xE6 -> ARABIC LETTER GAF INITIAL FORM
    '\ufedd'   #  0xE7 -> ARABIC LETTER LAM ISOLATED FORM
    '\ufedf'   #  0xE8 -> ARABIC LETTER LAM INITIAL FORM
    '\ufee0'   #  0xE9 -> ARABIC LETTER LAM MEDIAL FORM
    '\ufee1'   #  0xEA -> ARABIC LETTER MEEM ISOLATED FORM
    '\ufee3'   #  0xEB -> ARABIC LETTER MEEM INITIAL FORM
    '\ufb9e'   #  0xEC -> ARABIC LETTER NOON GHUNNA ISOLATED FORM
    '\ufee5'   #  0xED -> ARABIC LETTER NOON ISOLATED FORM
    '\ufee7'   #  0xEE -> ARABIC LETTER NOON INITIAL FORM
    '\ufe85'   #  0xEF -> ARABIC LETTER WAW WITH HAMZA ABOVE ISOLATED FORM
    '\ufeed'   #  0xF0 -> ARABIC LETTER WAW ISOLATED FORM
    '\ufba6'   #  0xF1 -> ARABIC LETTER HEH GOAL ISOLATED FORM
    '\ufba8'   #  0xF2 -> ARABIC LETTER HEH GOAL INITIAL FORM
    '\ufba9'   #  0xF3 -> ARABIC LETTER HEH GOAL MEDIAL FORM
    '\ufbaa'   #  0xF4 -> ARABIC LETTER HEH DOACHASHMEE ISOLATED FORM
    '\ufe80'   #  0xF5 -> ARABIC LETTER HAMZA ISOLATED FORM
    '\ufe89'   #  0xF6 -> ARABIC LETTER YEH WITH HAMZA ABOVE ISOLATED FORM
    '\ufe8a'   #  0xF7 -> ARABIC LETTER YEH WITH HAMZA ABOVE FINAL FORM
    '\ufe8b'   #  0xF8 -> ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM
    '\ufef1'   #  0xF9 -> ARABIC LETTER YEH ISOLATED FORM
    '\ufef2'   #  0xFA -> ARABIC LETTER YEH FINAL FORM
    '\ufef3'   #  0xFB -> ARABIC LETTER YEH INITIAL FORM
    '\ufbb0'   #  0xFC -> ARABIC LETTER YEH BARREE WITH HAMZA ABOVE ISOLATED FORM
    '\ufbae'   #  0xFD -> ARABIC LETTER YEH BARREE ISOLATED FORM
    '\ufe7c'   #  0xFE -> ARABIC SHADDA ISOLATED FORM
    '\ufe7d'   #  0xFF -> ARABIC SHADDA MEDIAL FORM
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/cp1258.py000064400000032064151153537620010026 0ustar00""" Python Character Mapping Codec cp1258 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1258.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp1258',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\u20ac'   #  0x80 -> EURO SIGN
    '\ufffe'   #  0x81 -> UNDEFINED
    '\u201a'   #  0x82 -> SINGLE LOW-9 QUOTATION MARK
    '\u0192'   #  0x83 -> LATIN SMALL LETTER F WITH HOOK
    '\u201e'   #  0x84 -> DOUBLE LOW-9 QUOTATION MARK
    '\u2026'   #  0x85 -> HORIZONTAL ELLIPSIS
    '\u2020'   #  0x86 -> DAGGER
    '\u2021'   #  0x87 -> DOUBLE DAGGER
    '\u02c6'   #  0x88 -> MODIFIER LETTER CIRCUMFLEX ACCENT
    '\u2030'   #  0x89 -> PER MILLE SIGN
    '\ufffe'   #  0x8A -> UNDEFINED
    '\u2039'   #  0x8B -> SINGLE LEFT-POINTING ANGLE QUOTATION MARK
    '\u0152'   #  0x8C -> LATIN CAPITAL LIGATURE OE
    '\ufffe'   #  0x8D -> UNDEFINED
    '\ufffe'   #  0x8E -> UNDEFINED
    '\ufffe'   #  0x8F -> UNDEFINED
    '\ufffe'   #  0x90 -> UNDEFINED
    '\u2018'   #  0x91 -> LEFT SINGLE QUOTATION MARK
    '\u2019'   #  0x92 -> RIGHT SINGLE QUOTATION MARK
    '\u201c'   #  0x93 -> LEFT DOUBLE QUOTATION MARK
    '\u201d'   #  0x94 -> RIGHT DOUBLE QUOTATION MARK
    '\u2022'   #  0x95 -> BULLET
    '\u2013'   #  0x96 -> EN DASH
    '\u2014'   #  0x97 -> EM DASH
    '\u02dc'   #  0x98 -> SMALL TILDE
    '\u2122'   #  0x99 -> TRADE MARK SIGN
    '\ufffe'   #  0x9A -> UNDEFINED
    '\u203a'   #  0x9B -> SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
    '\u0153'   #  0x9C -> LATIN SMALL LIGATURE OE
    '\ufffe'   #  0x9D -> UNDEFINED
    '\ufffe'   #  0x9E -> UNDEFINED
    '\u0178'   #  0x9F -> LATIN CAPITAL LETTER Y WITH DIAERESIS
    '\xa0'     #  0xA0 -> NO-BREAK SPACE
    '\xa1'     #  0xA1 -> INVERTED EXCLAMATION MARK
    '\xa2'     #  0xA2 -> CENT SIGN
    '\xa3'     #  0xA3 -> POUND SIGN
    '\xa4'     #  0xA4 -> CURRENCY SIGN
    '\xa5'     #  0xA5 -> YEN SIGN
    '\xa6'     #  0xA6 -> BROKEN BAR
    '\xa7'     #  0xA7 -> SECTION SIGN
    '\xa8'     #  0xA8 -> DIAERESIS
    '\xa9'     #  0xA9 -> COPYRIGHT SIGN
    '\xaa'     #  0xAA -> FEMININE ORDINAL INDICATOR
    '\xab'     #  0xAB -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xac'     #  0xAC -> NOT SIGN
    '\xad'     #  0xAD -> SOFT HYPHEN
    '\xae'     #  0xAE -> REGISTERED SIGN
    '\xaf'     #  0xAF -> MACRON
    '\xb0'     #  0xB0 -> DEGREE SIGN
    '\xb1'     #  0xB1 -> PLUS-MINUS SIGN
    '\xb2'     #  0xB2 -> SUPERSCRIPT TWO
    '\xb3'     #  0xB3 -> SUPERSCRIPT THREE
    '\xb4'     #  0xB4 -> ACUTE ACCENT
    '\xb5'     #  0xB5 -> MICRO SIGN
    '\xb6'     #  0xB6 -> PILCROW SIGN
    '\xb7'     #  0xB7 -> MIDDLE DOT
    '\xb8'     #  0xB8 -> CEDILLA
    '\xb9'     #  0xB9 -> SUPERSCRIPT ONE
    '\xba'     #  0xBA -> MASCULINE ORDINAL INDICATOR
    '\xbb'     #  0xBB -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbc'     #  0xBC -> VULGAR FRACTION ONE QUARTER
    '\xbd'     #  0xBD -> VULGAR FRACTION ONE HALF
    '\xbe'     #  0xBE -> VULGAR FRACTION THREE QUARTERS
    '\xbf'     #  0xBF -> INVERTED QUESTION MARK
    '\xc0'     #  0xC0 -> LATIN CAPITAL LETTER A WITH GRAVE
    '\xc1'     #  0xC1 -> LATIN CAPITAL LETTER A WITH ACUTE
    '\xc2'     #  0xC2 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    '\u0102'   #  0xC3 -> LATIN CAPITAL LETTER A WITH BREVE
    '\xc4'     #  0xC4 -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\xc5'     #  0xC5 -> LATIN CAPITAL LETTER A WITH RING ABOVE
    '\xc6'     #  0xC6 -> LATIN CAPITAL LETTER AE
    '\xc7'     #  0xC7 -> LATIN CAPITAL LETTER C WITH CEDILLA
    '\xc8'     #  0xC8 -> LATIN CAPITAL LETTER E WITH GRAVE
    '\xc9'     #  0xC9 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\xca'     #  0xCA -> LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    '\xcb'     #  0xCB -> LATIN CAPITAL LETTER E WITH DIAERESIS
    '\u0300'   #  0xCC -> COMBINING GRAVE ACCENT
    '\xcd'     #  0xCD -> LATIN CAPITAL LETTER I WITH ACUTE
    '\xce'     #  0xCE -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    '\xcf'     #  0xCF -> LATIN CAPITAL LETTER I WITH DIAERESIS
    '\u0110'   #  0xD0 -> LATIN CAPITAL LETTER D WITH STROKE
    '\xd1'     #  0xD1 -> LATIN CAPITAL LETTER N WITH TILDE
    '\u0309'   #  0xD2 -> COMBINING HOOK ABOVE
    '\xd3'     #  0xD3 -> LATIN CAPITAL LETTER O WITH ACUTE
    '\xd4'     #  0xD4 -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    '\u01a0'   #  0xD5 -> LATIN CAPITAL LETTER O WITH HORN
    '\xd6'     #  0xD6 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xd7'     #  0xD7 -> MULTIPLICATION SIGN
    '\xd8'     #  0xD8 -> LATIN CAPITAL LETTER O WITH STROKE
    '\xd9'     #  0xD9 -> LATIN CAPITAL LETTER U WITH GRAVE
    '\xda'     #  0xDA -> LATIN CAPITAL LETTER U WITH ACUTE
    '\xdb'     #  0xDB -> LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    '\xdc'     #  0xDC -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\u01af'   #  0xDD -> LATIN CAPITAL LETTER U WITH HORN
    '\u0303'   #  0xDE -> COMBINING TILDE
    '\xdf'     #  0xDF -> LATIN SMALL LETTER SHARP S
    '\xe0'     #  0xE0 -> LATIN SMALL LETTER A WITH GRAVE
    '\xe1'     #  0xE1 -> LATIN SMALL LETTER A WITH ACUTE
    '\xe2'     #  0xE2 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\u0103'   #  0xE3 -> LATIN SMALL LETTER A WITH BREVE
    '\xe4'     #  0xE4 -> LATIN SMALL LETTER A WITH DIAERESIS
    '\xe5'     #  0xE5 -> LATIN SMALL LETTER A WITH RING ABOVE
    '\xe6'     #  0xE6 -> LATIN SMALL LETTER AE
    '\xe7'     #  0xE7 -> LATIN SMALL LETTER C WITH CEDILLA
    '\xe8'     #  0xE8 -> LATIN SMALL LETTER E WITH GRAVE
    '\xe9'     #  0xE9 -> LATIN SMALL LETTER E WITH ACUTE
    '\xea'     #  0xEA -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xeb'     #  0xEB -> LATIN SMALL LETTER E WITH DIAERESIS
    '\u0301'   #  0xEC -> COMBINING ACUTE ACCENT
    '\xed'     #  0xED -> LATIN SMALL LETTER I WITH ACUTE
    '\xee'     #  0xEE -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\xef'     #  0xEF -> LATIN SMALL LETTER I WITH DIAERESIS
    '\u0111'   #  0xF0 -> LATIN SMALL LETTER D WITH STROKE
    '\xf1'     #  0xF1 -> LATIN SMALL LETTER N WITH TILDE
    '\u0323'   #  0xF2 -> COMBINING DOT BELOW
    '\xf3'     #  0xF3 -> LATIN SMALL LETTER O WITH ACUTE
    '\xf4'     #  0xF4 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\u01a1'   #  0xF5 -> LATIN SMALL LETTER O WITH HORN
    '\xf6'     #  0xF6 -> LATIN SMALL LETTER O WITH DIAERESIS
    '\xf7'     #  0xF7 -> DIVISION SIGN
    '\xf8'     #  0xF8 -> LATIN SMALL LETTER O WITH STROKE
    '\xf9'     #  0xF9 -> LATIN SMALL LETTER U WITH GRAVE
    '\xfa'     #  0xFA -> LATIN SMALL LETTER U WITH ACUTE
    '\xfb'     #  0xFB -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\xfc'     #  0xFC -> LATIN SMALL LETTER U WITH DIAERESIS
    '\u01b0'   #  0xFD -> LATIN SMALL LETTER U WITH HORN
    '\u20ab'   #  0xFE -> DONG SIGN
    '\xff'     #  0xFF -> LATIN SMALL LETTER Y WITH DIAERESIS
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/utf_32.py000064400000012011151153537620010174 0ustar00"""
Python 'utf-32' Codec
"""
import codecs, sys

### Codec APIs

encode = codecs.utf_32_encode

def decode(input, errors='strict'):
    return codecs.utf_32_decode(input, errors, True)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def __init__(self, errors='strict'):
        codecs.IncrementalEncoder.__init__(self, errors)
        self.encoder = None

    def encode(self, input, final=False):
        if self.encoder is None:
            result = codecs.utf_32_encode(input, self.errors)[0]
            if sys.byteorder == 'little':
                self.encoder = codecs.utf_32_le_encode
            else:
                self.encoder = codecs.utf_32_be_encode
            return result
        return self.encoder(input, self.errors)[0]

    def reset(self):
        codecs.IncrementalEncoder.reset(self)
        self.encoder = None

    def getstate(self):
        # state info we return to the caller:
        # 0: stream is in natural order for this platform
        # 2: endianness hasn't been determined yet
        # (we're never writing in unnatural order)
        return (2 if self.encoder is None else 0)

    def setstate(self, state):
        if state:
            self.encoder = None
        else:
            if sys.byteorder == 'little':
                self.encoder = codecs.utf_32_le_encode
            else:
                self.encoder = codecs.utf_32_be_encode

class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
    def __init__(self, errors='strict'):
        codecs.BufferedIncrementalDecoder.__init__(self, errors)
        self.decoder = None

    def _buffer_decode(self, input, errors, final):
        if self.decoder is None:
            (output, consumed, byteorder) = \
                codecs.utf_32_ex_decode(input, errors, 0, final)
            if byteorder == -1:
                self.decoder = codecs.utf_32_le_decode
            elif byteorder == 1:
                self.decoder = codecs.utf_32_be_decode
            elif consumed >= 4:
                raise UnicodeError("UTF-32 stream does not start with BOM")
            return (output, consumed)
        return self.decoder(input, self.errors, final)

    def reset(self):
        codecs.BufferedIncrementalDecoder.reset(self)
        self.decoder = None

    def getstate(self):
        # additional state info from the base class must be None here,
        # as it isn't passed along to the caller
        state = codecs.BufferedIncrementalDecoder.getstate(self)[0]
        # additional state info we pass to the caller:
        # 0: stream is in natural order for this platform
        # 1: stream is in unnatural order
        # 2: endianness hasn't been determined yet
        if self.decoder is None:
            return (state, 2)
        addstate = int((sys.byteorder == "big") !=
                       (self.decoder is codecs.utf_32_be_decode))
        return (state, addstate)

    def setstate(self, state):
        # state[1] will be ignored by BufferedIncrementalDecoder.setstate()
        codecs.BufferedIncrementalDecoder.setstate(self, state)
        state = state[1]
        if state == 0:
            self.decoder = (codecs.utf_32_be_decode
                            if sys.byteorder == "big"
                            else codecs.utf_32_le_decode)
        elif state == 1:
            self.decoder = (codecs.utf_32_le_decode
                            if sys.byteorder == "big"
                            else codecs.utf_32_be_decode)
        else:
            self.decoder = None

class StreamWriter(codecs.StreamWriter):
    def __init__(self, stream, errors='strict'):
        self.encoder = None
        codecs.StreamWriter.__init__(self, stream, errors)

    def reset(self):
        codecs.StreamWriter.reset(self)
        self.encoder = None

    def encode(self, input, errors='strict'):
        if self.encoder is None:
            result = codecs.utf_32_encode(input, errors)
            if sys.byteorder == 'little':
                self.encoder = codecs.utf_32_le_encode
            else:
                self.encoder = codecs.utf_32_be_encode
            return result
        else:
            return self.encoder(input, errors)

class StreamReader(codecs.StreamReader):

    def reset(self):
        codecs.StreamReader.reset(self)
        try:
            del self.decode
        except AttributeError:
            pass

    def decode(self, input, errors='strict'):
        (object, consumed, byteorder) = \
            codecs.utf_32_ex_decode(input, errors, 0, False)
        if byteorder == -1:
            self.decode = codecs.utf_32_le_decode
        elif byteorder == 1:
            self.decode = codecs.utf_32_be_decode
        elif consumed>=4:
            raise UnicodeError("UTF-32 stream does not start with BOM")
        return (object, consumed)

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='utf-32',
        encode=encode,
        decode=decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/charmap.py000064400000004044151153537620010514 0ustar00""" Generic Python Character Mapping Codec.

    Use this codec directly rather than through the automatic
    conversion mechanisms supplied by unicode() and .encode().


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    # Note: Binding these as C functions will result in the class not
    # converting them to methods. This is intended.
    encode = codecs.charmap_encode
    decode = codecs.charmap_decode

class IncrementalEncoder(codecs.IncrementalEncoder):
    def __init__(self, errors='strict', mapping=None):
        codecs.IncrementalEncoder.__init__(self, errors)
        self.mapping = mapping

    def encode(self, input, final=False):
        return codecs.charmap_encode(input, self.errors, self.mapping)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def __init__(self, errors='strict', mapping=None):
        codecs.IncrementalDecoder.__init__(self, errors)
        self.mapping = mapping

    def decode(self, input, final=False):
        return codecs.charmap_decode(input, self.errors, self.mapping)[0]

class StreamWriter(Codec,codecs.StreamWriter):

    def __init__(self,stream,errors='strict',mapping=None):
        codecs.StreamWriter.__init__(self,stream,errors)
        self.mapping = mapping

    def encode(self,input,errors='strict'):
        return Codec.encode(input,errors,self.mapping)

class StreamReader(Codec,codecs.StreamReader):

    def __init__(self,stream,errors='strict',mapping=None):
        codecs.StreamReader.__init__(self,stream,errors)
        self.mapping = mapping

    def decode(self,input,errors='strict'):
        return Codec.decode(input,errors,self.mapping)

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='charmap',
        encode=Codec.encode,
        decode=Codec.decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamwriter=StreamWriter,
        streamreader=StreamReader,
    )
encodings/cp1255.py000064400000030262151153537620010021 0ustar00""" Python Character Mapping Codec cp1255 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1255.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp1255',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\u20ac'   #  0x80 -> EURO SIGN
    '\ufffe'   #  0x81 -> UNDEFINED
    '\u201a'   #  0x82 -> SINGLE LOW-9 QUOTATION MARK
    '\u0192'   #  0x83 -> LATIN SMALL LETTER F WITH HOOK
    '\u201e'   #  0x84 -> DOUBLE LOW-9 QUOTATION MARK
    '\u2026'   #  0x85 -> HORIZONTAL ELLIPSIS
    '\u2020'   #  0x86 -> DAGGER
    '\u2021'   #  0x87 -> DOUBLE DAGGER
    '\u02c6'   #  0x88 -> MODIFIER LETTER CIRCUMFLEX ACCENT
    '\u2030'   #  0x89 -> PER MILLE SIGN
    '\ufffe'   #  0x8A -> UNDEFINED
    '\u2039'   #  0x8B -> SINGLE LEFT-POINTING ANGLE QUOTATION MARK
    '\ufffe'   #  0x8C -> UNDEFINED
    '\ufffe'   #  0x8D -> UNDEFINED
    '\ufffe'   #  0x8E -> UNDEFINED
    '\ufffe'   #  0x8F -> UNDEFINED
    '\ufffe'   #  0x90 -> UNDEFINED
    '\u2018'   #  0x91 -> LEFT SINGLE QUOTATION MARK
    '\u2019'   #  0x92 -> RIGHT SINGLE QUOTATION MARK
    '\u201c'   #  0x93 -> LEFT DOUBLE QUOTATION MARK
    '\u201d'   #  0x94 -> RIGHT DOUBLE QUOTATION MARK
    '\u2022'   #  0x95 -> BULLET
    '\u2013'   #  0x96 -> EN DASH
    '\u2014'   #  0x97 -> EM DASH
    '\u02dc'   #  0x98 -> SMALL TILDE
    '\u2122'   #  0x99 -> TRADE MARK SIGN
    '\ufffe'   #  0x9A -> UNDEFINED
    '\u203a'   #  0x9B -> SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
    '\ufffe'   #  0x9C -> UNDEFINED
    '\ufffe'   #  0x9D -> UNDEFINED
    '\ufffe'   #  0x9E -> UNDEFINED
    '\ufffe'   #  0x9F -> UNDEFINED
    '\xa0'     #  0xA0 -> NO-BREAK SPACE
    '\xa1'     #  0xA1 -> INVERTED EXCLAMATION MARK
    '\xa2'     #  0xA2 -> CENT SIGN
    '\xa3'     #  0xA3 -> POUND SIGN
    '\u20aa'   #  0xA4 -> NEW SHEQEL SIGN
    '\xa5'     #  0xA5 -> YEN SIGN
    '\xa6'     #  0xA6 -> BROKEN BAR
    '\xa7'     #  0xA7 -> SECTION SIGN
    '\xa8'     #  0xA8 -> DIAERESIS
    '\xa9'     #  0xA9 -> COPYRIGHT SIGN
    '\xd7'     #  0xAA -> MULTIPLICATION SIGN
    '\xab'     #  0xAB -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xac'     #  0xAC -> NOT SIGN
    '\xad'     #  0xAD -> SOFT HYPHEN
    '\xae'     #  0xAE -> REGISTERED SIGN
    '\xaf'     #  0xAF -> MACRON
    '\xb0'     #  0xB0 -> DEGREE SIGN
    '\xb1'     #  0xB1 -> PLUS-MINUS SIGN
    '\xb2'     #  0xB2 -> SUPERSCRIPT TWO
    '\xb3'     #  0xB3 -> SUPERSCRIPT THREE
    '\xb4'     #  0xB4 -> ACUTE ACCENT
    '\xb5'     #  0xB5 -> MICRO SIGN
    '\xb6'     #  0xB6 -> PILCROW SIGN
    '\xb7'     #  0xB7 -> MIDDLE DOT
    '\xb8'     #  0xB8 -> CEDILLA
    '\xb9'     #  0xB9 -> SUPERSCRIPT ONE
    '\xf7'     #  0xBA -> DIVISION SIGN
    '\xbb'     #  0xBB -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbc'     #  0xBC -> VULGAR FRACTION ONE QUARTER
    '\xbd'     #  0xBD -> VULGAR FRACTION ONE HALF
    '\xbe'     #  0xBE -> VULGAR FRACTION THREE QUARTERS
    '\xbf'     #  0xBF -> INVERTED QUESTION MARK
    '\u05b0'   #  0xC0 -> HEBREW POINT SHEVA
    '\u05b1'   #  0xC1 -> HEBREW POINT HATAF SEGOL
    '\u05b2'   #  0xC2 -> HEBREW POINT HATAF PATAH
    '\u05b3'   #  0xC3 -> HEBREW POINT HATAF QAMATS
    '\u05b4'   #  0xC4 -> HEBREW POINT HIRIQ
    '\u05b5'   #  0xC5 -> HEBREW POINT TSERE
    '\u05b6'   #  0xC6 -> HEBREW POINT SEGOL
    '\u05b7'   #  0xC7 -> HEBREW POINT PATAH
    '\u05b8'   #  0xC8 -> HEBREW POINT QAMATS
    '\u05b9'   #  0xC9 -> HEBREW POINT HOLAM
    '\ufffe'   #  0xCA -> UNDEFINED
    '\u05bb'   #  0xCB -> HEBREW POINT QUBUTS
    '\u05bc'   #  0xCC -> HEBREW POINT DAGESH OR MAPIQ
    '\u05bd'   #  0xCD -> HEBREW POINT METEG
    '\u05be'   #  0xCE -> HEBREW PUNCTUATION MAQAF
    '\u05bf'   #  0xCF -> HEBREW POINT RAFE
    '\u05c0'   #  0xD0 -> HEBREW PUNCTUATION PASEQ
    '\u05c1'   #  0xD1 -> HEBREW POINT SHIN DOT
    '\u05c2'   #  0xD2 -> HEBREW POINT SIN DOT
    '\u05c3'   #  0xD3 -> HEBREW PUNCTUATION SOF PASUQ
    '\u05f0'   #  0xD4 -> HEBREW LIGATURE YIDDISH DOUBLE VAV
    '\u05f1'   #  0xD5 -> HEBREW LIGATURE YIDDISH VAV YOD
    '\u05f2'   #  0xD6 -> HEBREW LIGATURE YIDDISH DOUBLE YOD
    '\u05f3'   #  0xD7 -> HEBREW PUNCTUATION GERESH
    '\u05f4'   #  0xD8 -> HEBREW PUNCTUATION GERSHAYIM
    '\ufffe'   #  0xD9 -> UNDEFINED
    '\ufffe'   #  0xDA -> UNDEFINED
    '\ufffe'   #  0xDB -> UNDEFINED
    '\ufffe'   #  0xDC -> UNDEFINED
    '\ufffe'   #  0xDD -> UNDEFINED
    '\ufffe'   #  0xDE -> UNDEFINED
    '\ufffe'   #  0xDF -> UNDEFINED
    '\u05d0'   #  0xE0 -> HEBREW LETTER ALEF
    '\u05d1'   #  0xE1 -> HEBREW LETTER BET
    '\u05d2'   #  0xE2 -> HEBREW LETTER GIMEL
    '\u05d3'   #  0xE3 -> HEBREW LETTER DALET
    '\u05d4'   #  0xE4 -> HEBREW LETTER HE
    '\u05d5'   #  0xE5 -> HEBREW LETTER VAV
    '\u05d6'   #  0xE6 -> HEBREW LETTER ZAYIN
    '\u05d7'   #  0xE7 -> HEBREW LETTER HET
    '\u05d8'   #  0xE8 -> HEBREW LETTER TET
    '\u05d9'   #  0xE9 -> HEBREW LETTER YOD
    '\u05da'   #  0xEA -> HEBREW LETTER FINAL KAF
    '\u05db'   #  0xEB -> HEBREW LETTER KAF
    '\u05dc'   #  0xEC -> HEBREW LETTER LAMED
    '\u05dd'   #  0xED -> HEBREW LETTER FINAL MEM
    '\u05de'   #  0xEE -> HEBREW LETTER MEM
    '\u05df'   #  0xEF -> HEBREW LETTER FINAL NUN
    '\u05e0'   #  0xF0 -> HEBREW LETTER NUN
    '\u05e1'   #  0xF1 -> HEBREW LETTER SAMEKH
    '\u05e2'   #  0xF2 -> HEBREW LETTER AYIN
    '\u05e3'   #  0xF3 -> HEBREW LETTER FINAL PE
    '\u05e4'   #  0xF4 -> HEBREW LETTER PE
    '\u05e5'   #  0xF5 -> HEBREW LETTER FINAL TSADI
    '\u05e6'   #  0xF6 -> HEBREW LETTER TSADI
    '\u05e7'   #  0xF7 -> HEBREW LETTER QOF
    '\u05e8'   #  0xF8 -> HEBREW LETTER RESH
    '\u05e9'   #  0xF9 -> HEBREW LETTER SHIN
    '\u05ea'   #  0xFA -> HEBREW LETTER TAV
    '\ufffe'   #  0xFB -> UNDEFINED
    '\ufffe'   #  0xFC -> UNDEFINED
    '\u200e'   #  0xFD -> LEFT-TO-RIGHT MARK
    '\u200f'   #  0xFE -> RIGHT-TO-LEFT MARK
    '\ufffe'   #  0xFF -> UNDEFINED
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/iso2022_jp_1.py000064400000002045151153537620011111 0ustar00#
# iso2022_jp_1.py: Python Unicode Codec for ISO2022_JP_1
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#

import _codecs_iso2022, codecs
import _multibytecodec as mbc

codec = _codecs_iso2022.getcodec('iso2022_jp_1')

class Codec(codecs.Codec):
    encode = codec.encode
    decode = codec.decode

class IncrementalEncoder(mbc.MultibyteIncrementalEncoder,
                         codecs.IncrementalEncoder):
    codec = codec

class IncrementalDecoder(mbc.MultibyteIncrementalDecoder,
                         codecs.IncrementalDecoder):
    codec = codec

class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader):
    codec = codec

class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
    codec = codec

def getregentry():
    return codecs.CodecInfo(
        name='iso2022_jp_1',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/cp720.py000064400000032566151153537620007746 0ustar00"""Python Character Mapping Codec cp720 generated on Windows:
Vista 6.0.6002 SP2 Multiprocessor Free with the command:
  python Tools/unicode/genwincodec.py 720
"""#"


import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp720',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'      #  0x00 -> CONTROL CHARACTER
    '\x01'      #  0x01 -> CONTROL CHARACTER
    '\x02'      #  0x02 -> CONTROL CHARACTER
    '\x03'      #  0x03 -> CONTROL CHARACTER
    '\x04'      #  0x04 -> CONTROL CHARACTER
    '\x05'      #  0x05 -> CONTROL CHARACTER
    '\x06'      #  0x06 -> CONTROL CHARACTER
    '\x07'      #  0x07 -> CONTROL CHARACTER
    '\x08'      #  0x08 -> CONTROL CHARACTER
    '\t'        #  0x09 -> CONTROL CHARACTER
    '\n'        #  0x0A -> CONTROL CHARACTER
    '\x0b'      #  0x0B -> CONTROL CHARACTER
    '\x0c'      #  0x0C -> CONTROL CHARACTER
    '\r'        #  0x0D -> CONTROL CHARACTER
    '\x0e'      #  0x0E -> CONTROL CHARACTER
    '\x0f'      #  0x0F -> CONTROL CHARACTER
    '\x10'      #  0x10 -> CONTROL CHARACTER
    '\x11'      #  0x11 -> CONTROL CHARACTER
    '\x12'      #  0x12 -> CONTROL CHARACTER
    '\x13'      #  0x13 -> CONTROL CHARACTER
    '\x14'      #  0x14 -> CONTROL CHARACTER
    '\x15'      #  0x15 -> CONTROL CHARACTER
    '\x16'      #  0x16 -> CONTROL CHARACTER
    '\x17'      #  0x17 -> CONTROL CHARACTER
    '\x18'      #  0x18 -> CONTROL CHARACTER
    '\x19'      #  0x19 -> CONTROL CHARACTER
    '\x1a'      #  0x1A -> CONTROL CHARACTER
    '\x1b'      #  0x1B -> CONTROL CHARACTER
    '\x1c'      #  0x1C -> CONTROL CHARACTER
    '\x1d'      #  0x1D -> CONTROL CHARACTER
    '\x1e'      #  0x1E -> CONTROL CHARACTER
    '\x1f'      #  0x1F -> CONTROL CHARACTER
    ' '         #  0x20 -> SPACE
    '!'         #  0x21 -> EXCLAMATION MARK
    '"'         #  0x22 -> QUOTATION MARK
    '#'         #  0x23 -> NUMBER SIGN
    '$'         #  0x24 -> DOLLAR SIGN
    '%'         #  0x25 -> PERCENT SIGN
    '&'         #  0x26 -> AMPERSAND
    "'"         #  0x27 -> APOSTROPHE
    '('         #  0x28 -> LEFT PARENTHESIS
    ')'         #  0x29 -> RIGHT PARENTHESIS
    '*'         #  0x2A -> ASTERISK
    '+'         #  0x2B -> PLUS SIGN
    ','         #  0x2C -> COMMA
    '-'         #  0x2D -> HYPHEN-MINUS
    '.'         #  0x2E -> FULL STOP
    '/'         #  0x2F -> SOLIDUS
    '0'         #  0x30 -> DIGIT ZERO
    '1'         #  0x31 -> DIGIT ONE
    '2'         #  0x32 -> DIGIT TWO
    '3'         #  0x33 -> DIGIT THREE
    '4'         #  0x34 -> DIGIT FOUR
    '5'         #  0x35 -> DIGIT FIVE
    '6'         #  0x36 -> DIGIT SIX
    '7'         #  0x37 -> DIGIT SEVEN
    '8'         #  0x38 -> DIGIT EIGHT
    '9'         #  0x39 -> DIGIT NINE
    ':'         #  0x3A -> COLON
    ';'         #  0x3B -> SEMICOLON
    '<'         #  0x3C -> LESS-THAN SIGN
    '='         #  0x3D -> EQUALS SIGN
    '>'         #  0x3E -> GREATER-THAN SIGN
    '?'         #  0x3F -> QUESTION MARK
    '@'         #  0x40 -> COMMERCIAL AT
    'A'         #  0x41 -> LATIN CAPITAL LETTER A
    'B'         #  0x42 -> LATIN CAPITAL LETTER B
    'C'         #  0x43 -> LATIN CAPITAL LETTER C
    'D'         #  0x44 -> LATIN CAPITAL LETTER D
    'E'         #  0x45 -> LATIN CAPITAL LETTER E
    'F'         #  0x46 -> LATIN CAPITAL LETTER F
    'G'         #  0x47 -> LATIN CAPITAL LETTER G
    'H'         #  0x48 -> LATIN CAPITAL LETTER H
    'I'         #  0x49 -> LATIN CAPITAL LETTER I
    'J'         #  0x4A -> LATIN CAPITAL LETTER J
    'K'         #  0x4B -> LATIN CAPITAL LETTER K
    'L'         #  0x4C -> LATIN CAPITAL LETTER L
    'M'         #  0x4D -> LATIN CAPITAL LETTER M
    'N'         #  0x4E -> LATIN CAPITAL LETTER N
    'O'         #  0x4F -> LATIN CAPITAL LETTER O
    'P'         #  0x50 -> LATIN CAPITAL LETTER P
    'Q'         #  0x51 -> LATIN CAPITAL LETTER Q
    'R'         #  0x52 -> LATIN CAPITAL LETTER R
    'S'         #  0x53 -> LATIN CAPITAL LETTER S
    'T'         #  0x54 -> LATIN CAPITAL LETTER T
    'U'         #  0x55 -> LATIN CAPITAL LETTER U
    'V'         #  0x56 -> LATIN CAPITAL LETTER V
    'W'         #  0x57 -> LATIN CAPITAL LETTER W
    'X'         #  0x58 -> LATIN CAPITAL LETTER X
    'Y'         #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'         #  0x5A -> LATIN CAPITAL LETTER Z
    '['         #  0x5B -> LEFT SQUARE BRACKET
    '\\'        #  0x5C -> REVERSE SOLIDUS
    ']'         #  0x5D -> RIGHT SQUARE BRACKET
    '^'         #  0x5E -> CIRCUMFLEX ACCENT
    '_'         #  0x5F -> LOW LINE
    '`'         #  0x60 -> GRAVE ACCENT
    'a'         #  0x61 -> LATIN SMALL LETTER A
    'b'         #  0x62 -> LATIN SMALL LETTER B
    'c'         #  0x63 -> LATIN SMALL LETTER C
    'd'         #  0x64 -> LATIN SMALL LETTER D
    'e'         #  0x65 -> LATIN SMALL LETTER E
    'f'         #  0x66 -> LATIN SMALL LETTER F
    'g'         #  0x67 -> LATIN SMALL LETTER G
    'h'         #  0x68 -> LATIN SMALL LETTER H
    'i'         #  0x69 -> LATIN SMALL LETTER I
    'j'         #  0x6A -> LATIN SMALL LETTER J
    'k'         #  0x6B -> LATIN SMALL LETTER K
    'l'         #  0x6C -> LATIN SMALL LETTER L
    'm'         #  0x6D -> LATIN SMALL LETTER M
    'n'         #  0x6E -> LATIN SMALL LETTER N
    'o'         #  0x6F -> LATIN SMALL LETTER O
    'p'         #  0x70 -> LATIN SMALL LETTER P
    'q'         #  0x71 -> LATIN SMALL LETTER Q
    'r'         #  0x72 -> LATIN SMALL LETTER R
    's'         #  0x73 -> LATIN SMALL LETTER S
    't'         #  0x74 -> LATIN SMALL LETTER T
    'u'         #  0x75 -> LATIN SMALL LETTER U
    'v'         #  0x76 -> LATIN SMALL LETTER V
    'w'         #  0x77 -> LATIN SMALL LETTER W
    'x'         #  0x78 -> LATIN SMALL LETTER X
    'y'         #  0x79 -> LATIN SMALL LETTER Y
    'z'         #  0x7A -> LATIN SMALL LETTER Z
    '{'         #  0x7B -> LEFT CURLY BRACKET
    '|'         #  0x7C -> VERTICAL LINE
    '}'         #  0x7D -> RIGHT CURLY BRACKET
    '~'         #  0x7E -> TILDE
    '\x7f'      #  0x7F -> CONTROL CHARACTER
    '\x80'
    '\x81'
    '\xe9'      #  0x82 -> LATIN SMALL LETTER E WITH ACUTE
    '\xe2'      #  0x83 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\x84'
    '\xe0'      #  0x85 -> LATIN SMALL LETTER A WITH GRAVE
    '\x86'
    '\xe7'      #  0x87 -> LATIN SMALL LETTER C WITH CEDILLA
    '\xea'      #  0x88 -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xeb'      #  0x89 -> LATIN SMALL LETTER E WITH DIAERESIS
    '\xe8'      #  0x8A -> LATIN SMALL LETTER E WITH GRAVE
    '\xef'      #  0x8B -> LATIN SMALL LETTER I WITH DIAERESIS
    '\xee'      #  0x8C -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\x8d'
    '\x8e'
    '\x8f'
    '\x90'
    '\u0651'    #  0x91 -> ARABIC SHADDA
    '\u0652'    #  0x92 -> ARABIC SUKUN
    '\xf4'      #  0x93 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xa4'      #  0x94 -> CURRENCY SIGN
    '\u0640'    #  0x95 -> ARABIC TATWEEL
    '\xfb'      #  0x96 -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\xf9'      #  0x97 -> LATIN SMALL LETTER U WITH GRAVE
    '\u0621'    #  0x98 -> ARABIC LETTER HAMZA
    '\u0622'    #  0x99 -> ARABIC LETTER ALEF WITH MADDA ABOVE
    '\u0623'    #  0x9A -> ARABIC LETTER ALEF WITH HAMZA ABOVE
    '\u0624'    #  0x9B -> ARABIC LETTER WAW WITH HAMZA ABOVE
    '\xa3'      #  0x9C -> POUND SIGN
    '\u0625'    #  0x9D -> ARABIC LETTER ALEF WITH HAMZA BELOW
    '\u0626'    #  0x9E -> ARABIC LETTER YEH WITH HAMZA ABOVE
    '\u0627'    #  0x9F -> ARABIC LETTER ALEF
    '\u0628'    #  0xA0 -> ARABIC LETTER BEH
    '\u0629'    #  0xA1 -> ARABIC LETTER TEH MARBUTA
    '\u062a'    #  0xA2 -> ARABIC LETTER TEH
    '\u062b'    #  0xA3 -> ARABIC LETTER THEH
    '\u062c'    #  0xA4 -> ARABIC LETTER JEEM
    '\u062d'    #  0xA5 -> ARABIC LETTER HAH
    '\u062e'    #  0xA6 -> ARABIC LETTER KHAH
    '\u062f'    #  0xA7 -> ARABIC LETTER DAL
    '\u0630'    #  0xA8 -> ARABIC LETTER THAL
    '\u0631'    #  0xA9 -> ARABIC LETTER REH
    '\u0632'    #  0xAA -> ARABIC LETTER ZAIN
    '\u0633'    #  0xAB -> ARABIC LETTER SEEN
    '\u0634'    #  0xAC -> ARABIC LETTER SHEEN
    '\u0635'    #  0xAD -> ARABIC LETTER SAD
    '\xab'      #  0xAE -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbb'      #  0xAF -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u2591'    #  0xB0 -> LIGHT SHADE
    '\u2592'    #  0xB1 -> MEDIUM SHADE
    '\u2593'    #  0xB2 -> DARK SHADE
    '\u2502'    #  0xB3 -> BOX DRAWINGS LIGHT VERTICAL
    '\u2524'    #  0xB4 -> BOX DRAWINGS LIGHT VERTICAL AND LEFT
    '\u2561'    #  0xB5 -> BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
    '\u2562'    #  0xB6 -> BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
    '\u2556'    #  0xB7 -> BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
    '\u2555'    #  0xB8 -> BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
    '\u2563'    #  0xB9 -> BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    '\u2551'    #  0xBA -> BOX DRAWINGS DOUBLE VERTICAL
    '\u2557'    #  0xBB -> BOX DRAWINGS DOUBLE DOWN AND LEFT
    '\u255d'    #  0xBC -> BOX DRAWINGS DOUBLE UP AND LEFT
    '\u255c'    #  0xBD -> BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
    '\u255b'    #  0xBE -> BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
    '\u2510'    #  0xBF -> BOX DRAWINGS LIGHT DOWN AND LEFT
    '\u2514'    #  0xC0 -> BOX DRAWINGS LIGHT UP AND RIGHT
    '\u2534'    #  0xC1 -> BOX DRAWINGS LIGHT UP AND HORIZONTAL
    '\u252c'    #  0xC2 -> BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    '\u251c'    #  0xC3 -> BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    '\u2500'    #  0xC4 -> BOX DRAWINGS LIGHT HORIZONTAL
    '\u253c'    #  0xC5 -> BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    '\u255e'    #  0xC6 -> BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
    '\u255f'    #  0xC7 -> BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
    '\u255a'    #  0xC8 -> BOX DRAWINGS DOUBLE UP AND RIGHT
    '\u2554'    #  0xC9 -> BOX DRAWINGS DOUBLE DOWN AND RIGHT
    '\u2569'    #  0xCA -> BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    '\u2566'    #  0xCB -> BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    '\u2560'    #  0xCC -> BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    '\u2550'    #  0xCD -> BOX DRAWINGS DOUBLE HORIZONTAL
    '\u256c'    #  0xCE -> BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    '\u2567'    #  0xCF -> BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
    '\u2568'    #  0xD0 -> BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
    '\u2564'    #  0xD1 -> BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
    '\u2565'    #  0xD2 -> BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
    '\u2559'    #  0xD3 -> BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
    '\u2558'    #  0xD4 -> BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
    '\u2552'    #  0xD5 -> BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
    '\u2553'    #  0xD6 -> BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
    '\u256b'    #  0xD7 -> BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
    '\u256a'    #  0xD8 -> BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
    '\u2518'    #  0xD9 -> BOX DRAWINGS LIGHT UP AND LEFT
    '\u250c'    #  0xDA -> BOX DRAWINGS LIGHT DOWN AND RIGHT
    '\u2588'    #  0xDB -> FULL BLOCK
    '\u2584'    #  0xDC -> LOWER HALF BLOCK
    '\u258c'    #  0xDD -> LEFT HALF BLOCK
    '\u2590'    #  0xDE -> RIGHT HALF BLOCK
    '\u2580'    #  0xDF -> UPPER HALF BLOCK
    '\u0636'    #  0xE0 -> ARABIC LETTER DAD
    '\u0637'    #  0xE1 -> ARABIC LETTER TAH
    '\u0638'    #  0xE2 -> ARABIC LETTER ZAH
    '\u0639'    #  0xE3 -> ARABIC LETTER AIN
    '\u063a'    #  0xE4 -> ARABIC LETTER GHAIN
    '\u0641'    #  0xE5 -> ARABIC LETTER FEH
    '\xb5'      #  0xE6 -> MICRO SIGN
    '\u0642'    #  0xE7 -> ARABIC LETTER QAF
    '\u0643'    #  0xE8 -> ARABIC LETTER KAF
    '\u0644'    #  0xE9 -> ARABIC LETTER LAM
    '\u0645'    #  0xEA -> ARABIC LETTER MEEM
    '\u0646'    #  0xEB -> ARABIC LETTER NOON
    '\u0647'    #  0xEC -> ARABIC LETTER HEH
    '\u0648'    #  0xED -> ARABIC LETTER WAW
    '\u0649'    #  0xEE -> ARABIC LETTER ALEF MAKSURA
    '\u064a'    #  0xEF -> ARABIC LETTER YEH
    '\u2261'    #  0xF0 -> IDENTICAL TO
    '\u064b'    #  0xF1 -> ARABIC FATHATAN
    '\u064c'    #  0xF2 -> ARABIC DAMMATAN
    '\u064d'    #  0xF3 -> ARABIC KASRATAN
    '\u064e'    #  0xF4 -> ARABIC FATHA
    '\u064f'    #  0xF5 -> ARABIC DAMMA
    '\u0650'    #  0xF6 -> ARABIC KASRA
    '\u2248'    #  0xF7 -> ALMOST EQUAL TO
    '\xb0'      #  0xF8 -> DEGREE SIGN
    '\u2219'    #  0xF9 -> BULLET OPERATOR
    '\xb7'      #  0xFA -> MIDDLE DOT
    '\u221a'    #  0xFB -> SQUARE ROOT
    '\u207f'    #  0xFC -> SUPERSCRIPT LATIN SMALL LETTER N
    '\xb2'      #  0xFD -> SUPERSCRIPT TWO
    '\u25a0'    #  0xFE -> BLACK SQUARE
    '\xa0'      #  0xFF -> NO-BREAK SPACE
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/cp875.py000064400000031066151153537620007753 0ustar00""" Python Character Mapping Codec cp875 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP875.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp875',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x9c'     #  0x04 -> CONTROL
    '\t'       #  0x05 -> HORIZONTAL TABULATION
    '\x86'     #  0x06 -> CONTROL
    '\x7f'     #  0x07 -> DELETE
    '\x97'     #  0x08 -> CONTROL
    '\x8d'     #  0x09 -> CONTROL
    '\x8e'     #  0x0A -> CONTROL
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x9d'     #  0x14 -> CONTROL
    '\x85'     #  0x15 -> CONTROL
    '\x08'     #  0x16 -> BACKSPACE
    '\x87'     #  0x17 -> CONTROL
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x92'     #  0x1A -> CONTROL
    '\x8f'     #  0x1B -> CONTROL
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    '\x80'     #  0x20 -> CONTROL
    '\x81'     #  0x21 -> CONTROL
    '\x82'     #  0x22 -> CONTROL
    '\x83'     #  0x23 -> CONTROL
    '\x84'     #  0x24 -> CONTROL
    '\n'       #  0x25 -> LINE FEED
    '\x17'     #  0x26 -> END OF TRANSMISSION BLOCK
    '\x1b'     #  0x27 -> ESCAPE
    '\x88'     #  0x28 -> CONTROL
    '\x89'     #  0x29 -> CONTROL
    '\x8a'     #  0x2A -> CONTROL
    '\x8b'     #  0x2B -> CONTROL
    '\x8c'     #  0x2C -> CONTROL
    '\x05'     #  0x2D -> ENQUIRY
    '\x06'     #  0x2E -> ACKNOWLEDGE
    '\x07'     #  0x2F -> BELL
    '\x90'     #  0x30 -> CONTROL
    '\x91'     #  0x31 -> CONTROL
    '\x16'     #  0x32 -> SYNCHRONOUS IDLE
    '\x93'     #  0x33 -> CONTROL
    '\x94'     #  0x34 -> CONTROL
    '\x95'     #  0x35 -> CONTROL
    '\x96'     #  0x36 -> CONTROL
    '\x04'     #  0x37 -> END OF TRANSMISSION
    '\x98'     #  0x38 -> CONTROL
    '\x99'     #  0x39 -> CONTROL
    '\x9a'     #  0x3A -> CONTROL
    '\x9b'     #  0x3B -> CONTROL
    '\x14'     #  0x3C -> DEVICE CONTROL FOUR
    '\x15'     #  0x3D -> NEGATIVE ACKNOWLEDGE
    '\x9e'     #  0x3E -> CONTROL
    '\x1a'     #  0x3F -> SUBSTITUTE
    ' '        #  0x40 -> SPACE
    '\u0391'   #  0x41 -> GREEK CAPITAL LETTER ALPHA
    '\u0392'   #  0x42 -> GREEK CAPITAL LETTER BETA
    '\u0393'   #  0x43 -> GREEK CAPITAL LETTER GAMMA
    '\u0394'   #  0x44 -> GREEK CAPITAL LETTER DELTA
    '\u0395'   #  0x45 -> GREEK CAPITAL LETTER EPSILON
    '\u0396'   #  0x46 -> GREEK CAPITAL LETTER ZETA
    '\u0397'   #  0x47 -> GREEK CAPITAL LETTER ETA
    '\u0398'   #  0x48 -> GREEK CAPITAL LETTER THETA
    '\u0399'   #  0x49 -> GREEK CAPITAL LETTER IOTA
    '['        #  0x4A -> LEFT SQUARE BRACKET
    '.'        #  0x4B -> FULL STOP
    '<'        #  0x4C -> LESS-THAN SIGN
    '('        #  0x4D -> LEFT PARENTHESIS
    '+'        #  0x4E -> PLUS SIGN
    '!'        #  0x4F -> EXCLAMATION MARK
    '&'        #  0x50 -> AMPERSAND
    '\u039a'   #  0x51 -> GREEK CAPITAL LETTER KAPPA
    '\u039b'   #  0x52 -> GREEK CAPITAL LETTER LAMDA
    '\u039c'   #  0x53 -> GREEK CAPITAL LETTER MU
    '\u039d'   #  0x54 -> GREEK CAPITAL LETTER NU
    '\u039e'   #  0x55 -> GREEK CAPITAL LETTER XI
    '\u039f'   #  0x56 -> GREEK CAPITAL LETTER OMICRON
    '\u03a0'   #  0x57 -> GREEK CAPITAL LETTER PI
    '\u03a1'   #  0x58 -> GREEK CAPITAL LETTER RHO
    '\u03a3'   #  0x59 -> GREEK CAPITAL LETTER SIGMA
    ']'        #  0x5A -> RIGHT SQUARE BRACKET
    '$'        #  0x5B -> DOLLAR SIGN
    '*'        #  0x5C -> ASTERISK
    ')'        #  0x5D -> RIGHT PARENTHESIS
    ';'        #  0x5E -> SEMICOLON
    '^'        #  0x5F -> CIRCUMFLEX ACCENT
    '-'        #  0x60 -> HYPHEN-MINUS
    '/'        #  0x61 -> SOLIDUS
    '\u03a4'   #  0x62 -> GREEK CAPITAL LETTER TAU
    '\u03a5'   #  0x63 -> GREEK CAPITAL LETTER UPSILON
    '\u03a6'   #  0x64 -> GREEK CAPITAL LETTER PHI
    '\u03a7'   #  0x65 -> GREEK CAPITAL LETTER CHI
    '\u03a8'   #  0x66 -> GREEK CAPITAL LETTER PSI
    '\u03a9'   #  0x67 -> GREEK CAPITAL LETTER OMEGA
    '\u03aa'   #  0x68 -> GREEK CAPITAL LETTER IOTA WITH DIALYTIKA
    '\u03ab'   #  0x69 -> GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA
    '|'        #  0x6A -> VERTICAL LINE
    ','        #  0x6B -> COMMA
    '%'        #  0x6C -> PERCENT SIGN
    '_'        #  0x6D -> LOW LINE
    '>'        #  0x6E -> GREATER-THAN SIGN
    '?'        #  0x6F -> QUESTION MARK
    '\xa8'     #  0x70 -> DIAERESIS
    '\u0386'   #  0x71 -> GREEK CAPITAL LETTER ALPHA WITH TONOS
    '\u0388'   #  0x72 -> GREEK CAPITAL LETTER EPSILON WITH TONOS
    '\u0389'   #  0x73 -> GREEK CAPITAL LETTER ETA WITH TONOS
    '\xa0'     #  0x74 -> NO-BREAK SPACE
    '\u038a'   #  0x75 -> GREEK CAPITAL LETTER IOTA WITH TONOS
    '\u038c'   #  0x76 -> GREEK CAPITAL LETTER OMICRON WITH TONOS
    '\u038e'   #  0x77 -> GREEK CAPITAL LETTER UPSILON WITH TONOS
    '\u038f'   #  0x78 -> GREEK CAPITAL LETTER OMEGA WITH TONOS
    '`'        #  0x79 -> GRAVE ACCENT
    ':'        #  0x7A -> COLON
    '#'        #  0x7B -> NUMBER SIGN
    '@'        #  0x7C -> COMMERCIAL AT
    "'"        #  0x7D -> APOSTROPHE
    '='        #  0x7E -> EQUALS SIGN
    '"'        #  0x7F -> QUOTATION MARK
    '\u0385'   #  0x80 -> GREEK DIALYTIKA TONOS
    'a'        #  0x81 -> LATIN SMALL LETTER A
    'b'        #  0x82 -> LATIN SMALL LETTER B
    'c'        #  0x83 -> LATIN SMALL LETTER C
    'd'        #  0x84 -> LATIN SMALL LETTER D
    'e'        #  0x85 -> LATIN SMALL LETTER E
    'f'        #  0x86 -> LATIN SMALL LETTER F
    'g'        #  0x87 -> LATIN SMALL LETTER G
    'h'        #  0x88 -> LATIN SMALL LETTER H
    'i'        #  0x89 -> LATIN SMALL LETTER I
    '\u03b1'   #  0x8A -> GREEK SMALL LETTER ALPHA
    '\u03b2'   #  0x8B -> GREEK SMALL LETTER BETA
    '\u03b3'   #  0x8C -> GREEK SMALL LETTER GAMMA
    '\u03b4'   #  0x8D -> GREEK SMALL LETTER DELTA
    '\u03b5'   #  0x8E -> GREEK SMALL LETTER EPSILON
    '\u03b6'   #  0x8F -> GREEK SMALL LETTER ZETA
    '\xb0'     #  0x90 -> DEGREE SIGN
    'j'        #  0x91 -> LATIN SMALL LETTER J
    'k'        #  0x92 -> LATIN SMALL LETTER K
    'l'        #  0x93 -> LATIN SMALL LETTER L
    'm'        #  0x94 -> LATIN SMALL LETTER M
    'n'        #  0x95 -> LATIN SMALL LETTER N
    'o'        #  0x96 -> LATIN SMALL LETTER O
    'p'        #  0x97 -> LATIN SMALL LETTER P
    'q'        #  0x98 -> LATIN SMALL LETTER Q
    'r'        #  0x99 -> LATIN SMALL LETTER R
    '\u03b7'   #  0x9A -> GREEK SMALL LETTER ETA
    '\u03b8'   #  0x9B -> GREEK SMALL LETTER THETA
    '\u03b9'   #  0x9C -> GREEK SMALL LETTER IOTA
    '\u03ba'   #  0x9D -> GREEK SMALL LETTER KAPPA
    '\u03bb'   #  0x9E -> GREEK SMALL LETTER LAMDA
    '\u03bc'   #  0x9F -> GREEK SMALL LETTER MU
    '\xb4'     #  0xA0 -> ACUTE ACCENT
    '~'        #  0xA1 -> TILDE
    's'        #  0xA2 -> LATIN SMALL LETTER S
    't'        #  0xA3 -> LATIN SMALL LETTER T
    'u'        #  0xA4 -> LATIN SMALL LETTER U
    'v'        #  0xA5 -> LATIN SMALL LETTER V
    'w'        #  0xA6 -> LATIN SMALL LETTER W
    'x'        #  0xA7 -> LATIN SMALL LETTER X
    'y'        #  0xA8 -> LATIN SMALL LETTER Y
    'z'        #  0xA9 -> LATIN SMALL LETTER Z
    '\u03bd'   #  0xAA -> GREEK SMALL LETTER NU
    '\u03be'   #  0xAB -> GREEK SMALL LETTER XI
    '\u03bf'   #  0xAC -> GREEK SMALL LETTER OMICRON
    '\u03c0'   #  0xAD -> GREEK SMALL LETTER PI
    '\u03c1'   #  0xAE -> GREEK SMALL LETTER RHO
    '\u03c3'   #  0xAF -> GREEK SMALL LETTER SIGMA
    '\xa3'     #  0xB0 -> POUND SIGN
    '\u03ac'   #  0xB1 -> GREEK SMALL LETTER ALPHA WITH TONOS
    '\u03ad'   #  0xB2 -> GREEK SMALL LETTER EPSILON WITH TONOS
    '\u03ae'   #  0xB3 -> GREEK SMALL LETTER ETA WITH TONOS
    '\u03ca'   #  0xB4 -> GREEK SMALL LETTER IOTA WITH DIALYTIKA
    '\u03af'   #  0xB5 -> GREEK SMALL LETTER IOTA WITH TONOS
    '\u03cc'   #  0xB6 -> GREEK SMALL LETTER OMICRON WITH TONOS
    '\u03cd'   #  0xB7 -> GREEK SMALL LETTER UPSILON WITH TONOS
    '\u03cb'   #  0xB8 -> GREEK SMALL LETTER UPSILON WITH DIALYTIKA
    '\u03ce'   #  0xB9 -> GREEK SMALL LETTER OMEGA WITH TONOS
    '\u03c2'   #  0xBA -> GREEK SMALL LETTER FINAL SIGMA
    '\u03c4'   #  0xBB -> GREEK SMALL LETTER TAU
    '\u03c5'   #  0xBC -> GREEK SMALL LETTER UPSILON
    '\u03c6'   #  0xBD -> GREEK SMALL LETTER PHI
    '\u03c7'   #  0xBE -> GREEK SMALL LETTER CHI
    '\u03c8'   #  0xBF -> GREEK SMALL LETTER PSI
    '{'        #  0xC0 -> LEFT CURLY BRACKET
    'A'        #  0xC1 -> LATIN CAPITAL LETTER A
    'B'        #  0xC2 -> LATIN CAPITAL LETTER B
    'C'        #  0xC3 -> LATIN CAPITAL LETTER C
    'D'        #  0xC4 -> LATIN CAPITAL LETTER D
    'E'        #  0xC5 -> LATIN CAPITAL LETTER E
    'F'        #  0xC6 -> LATIN CAPITAL LETTER F
    'G'        #  0xC7 -> LATIN CAPITAL LETTER G
    'H'        #  0xC8 -> LATIN CAPITAL LETTER H
    'I'        #  0xC9 -> LATIN CAPITAL LETTER I
    '\xad'     #  0xCA -> SOFT HYPHEN
    '\u03c9'   #  0xCB -> GREEK SMALL LETTER OMEGA
    '\u0390'   #  0xCC -> GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
    '\u03b0'   #  0xCD -> GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
    '\u2018'   #  0xCE -> LEFT SINGLE QUOTATION MARK
    '\u2015'   #  0xCF -> HORIZONTAL BAR
    '}'        #  0xD0 -> RIGHT CURLY BRACKET
    'J'        #  0xD1 -> LATIN CAPITAL LETTER J
    'K'        #  0xD2 -> LATIN CAPITAL LETTER K
    'L'        #  0xD3 -> LATIN CAPITAL LETTER L
    'M'        #  0xD4 -> LATIN CAPITAL LETTER M
    'N'        #  0xD5 -> LATIN CAPITAL LETTER N
    'O'        #  0xD6 -> LATIN CAPITAL LETTER O
    'P'        #  0xD7 -> LATIN CAPITAL LETTER P
    'Q'        #  0xD8 -> LATIN CAPITAL LETTER Q
    'R'        #  0xD9 -> LATIN CAPITAL LETTER R
    '\xb1'     #  0xDA -> PLUS-MINUS SIGN
    '\xbd'     #  0xDB -> VULGAR FRACTION ONE HALF
    '\x1a'     #  0xDC -> SUBSTITUTE
    '\u0387'   #  0xDD -> GREEK ANO TELEIA
    '\u2019'   #  0xDE -> RIGHT SINGLE QUOTATION MARK
    '\xa6'     #  0xDF -> BROKEN BAR
    '\\'       #  0xE0 -> REVERSE SOLIDUS
    '\x1a'     #  0xE1 -> SUBSTITUTE
    'S'        #  0xE2 -> LATIN CAPITAL LETTER S
    'T'        #  0xE3 -> LATIN CAPITAL LETTER T
    'U'        #  0xE4 -> LATIN CAPITAL LETTER U
    'V'        #  0xE5 -> LATIN CAPITAL LETTER V
    'W'        #  0xE6 -> LATIN CAPITAL LETTER W
    'X'        #  0xE7 -> LATIN CAPITAL LETTER X
    'Y'        #  0xE8 -> LATIN CAPITAL LETTER Y
    'Z'        #  0xE9 -> LATIN CAPITAL LETTER Z
    '\xb2'     #  0xEA -> SUPERSCRIPT TWO
    '\xa7'     #  0xEB -> SECTION SIGN
    '\x1a'     #  0xEC -> SUBSTITUTE
    '\x1a'     #  0xED -> SUBSTITUTE
    '\xab'     #  0xEE -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xac'     #  0xEF -> NOT SIGN
    '0'        #  0xF0 -> DIGIT ZERO
    '1'        #  0xF1 -> DIGIT ONE
    '2'        #  0xF2 -> DIGIT TWO
    '3'        #  0xF3 -> DIGIT THREE
    '4'        #  0xF4 -> DIGIT FOUR
    '5'        #  0xF5 -> DIGIT FIVE
    '6'        #  0xF6 -> DIGIT SIX
    '7'        #  0xF7 -> DIGIT SEVEN
    '8'        #  0xF8 -> DIGIT EIGHT
    '9'        #  0xF9 -> DIGIT NINE
    '\xb3'     #  0xFA -> SUPERSCRIPT THREE
    '\xa9'     #  0xFB -> COPYRIGHT SIGN
    '\x1a'     #  0xFC -> SUBSTITUTE
    '\x1a'     #  0xFD -> SUBSTITUTE
    '\xbb'     #  0xFE -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\x9f'     #  0xFF -> CONTROL
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/cp273.py000064400000033464151153537620007747 0ustar00""" Python Character Mapping Codec cp273 generated from 'python-mappings/CP273.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp273',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'      #  0x00 -> NULL (NUL)
    '\x01'      #  0x01 -> START OF HEADING (SOH)
    '\x02'      #  0x02 -> START OF TEXT (STX)
    '\x03'      #  0x03 -> END OF TEXT (ETX)
    '\x9c'      #  0x04 -> STRING TERMINATOR (ST)
    '\t'        #  0x05 -> CHARACTER TABULATION (HT)
    '\x86'      #  0x06 -> START OF SELECTED AREA (SSA)
    '\x7f'      #  0x07 -> DELETE (DEL)
    '\x97'      #  0x08 -> END OF GUARDED AREA (EPA)
    '\x8d'      #  0x09 -> REVERSE LINE FEED (RI)
    '\x8e'      #  0x0A -> SINGLE-SHIFT TWO (SS2)
    '\x0b'      #  0x0B -> LINE TABULATION (VT)
    '\x0c'      #  0x0C -> FORM FEED (FF)
    '\r'        #  0x0D -> CARRIAGE RETURN (CR)
    '\x0e'      #  0x0E -> SHIFT OUT (SO)
    '\x0f'      #  0x0F -> SHIFT IN (SI)
    '\x10'      #  0x10 -> DATALINK ESCAPE (DLE)
    '\x11'      #  0x11 -> DEVICE CONTROL ONE (DC1)
    '\x12'      #  0x12 -> DEVICE CONTROL TWO (DC2)
    '\x13'      #  0x13 -> DEVICE CONTROL THREE (DC3)
    '\x9d'      #  0x14 -> OPERATING SYSTEM COMMAND (OSC)
    '\x85'      #  0x15 -> NEXT LINE (NEL)
    '\x08'      #  0x16 -> BACKSPACE (BS)
    '\x87'      #  0x17 -> END OF SELECTED AREA (ESA)
    '\x18'      #  0x18 -> CANCEL (CAN)
    '\x19'      #  0x19 -> END OF MEDIUM (EM)
    '\x92'      #  0x1A -> PRIVATE USE TWO (PU2)
    '\x8f'      #  0x1B -> SINGLE-SHIFT THREE (SS3)
    '\x1c'      #  0x1C -> FILE SEPARATOR (IS4)
    '\x1d'      #  0x1D -> GROUP SEPARATOR (IS3)
    '\x1e'      #  0x1E -> RECORD SEPARATOR (IS2)
    '\x1f'      #  0x1F -> UNIT SEPARATOR (IS1)
    '\x80'      #  0x20 -> PADDING CHARACTER (PAD)
    '\x81'      #  0x21 -> HIGH OCTET PRESET (HOP)
    '\x82'      #  0x22 -> BREAK PERMITTED HERE (BPH)
    '\x83'      #  0x23 -> NO BREAK HERE (NBH)
    '\x84'      #  0x24 -> INDEX (IND)
    '\n'        #  0x25 -> LINE FEED (LF)
    '\x17'      #  0x26 -> END OF TRANSMISSION BLOCK (ETB)
    '\x1b'      #  0x27 -> ESCAPE (ESC)
    '\x88'      #  0x28 -> CHARACTER TABULATION SET (HTS)
    '\x89'      #  0x29 -> CHARACTER TABULATION WITH JUSTIFICATION (HTJ)
    '\x8a'      #  0x2A -> LINE TABULATION SET (VTS)
    '\x8b'      #  0x2B -> PARTIAL LINE FORWARD (PLD)
    '\x8c'      #  0x2C -> PARTIAL LINE BACKWARD (PLU)
    '\x05'      #  0x2D -> ENQUIRY (ENQ)
    '\x06'      #  0x2E -> ACKNOWLEDGE (ACK)
    '\x07'      #  0x2F -> BELL (BEL)
    '\x90'      #  0x30 -> DEVICE CONTROL STRING (DCS)
    '\x91'      #  0x31 -> PRIVATE USE ONE (PU1)
    '\x16'      #  0x32 -> SYNCHRONOUS IDLE (SYN)
    '\x93'      #  0x33 -> SET TRANSMIT STATE (STS)
    '\x94'      #  0x34 -> CANCEL CHARACTER (CCH)
    '\x95'      #  0x35 -> MESSAGE WAITING (MW)
    '\x96'      #  0x36 -> START OF GUARDED AREA (SPA)
    '\x04'      #  0x37 -> END OF TRANSMISSION (EOT)
    '\x98'      #  0x38 -> START OF STRING (SOS)
    '\x99'      #  0x39 -> SINGLE GRAPHIC CHARACTER INTRODUCER (SGCI)
    '\x9a'      #  0x3A -> SINGLE CHARACTER INTRODUCER (SCI)
    '\x9b'      #  0x3B -> CONTROL SEQUENCE INTRODUCER (CSI)
    '\x14'      #  0x3C -> DEVICE CONTROL FOUR (DC4)
    '\x15'      #  0x3D -> NEGATIVE ACKNOWLEDGE (NAK)
    '\x9e'      #  0x3E -> PRIVACY MESSAGE (PM)
    '\x1a'      #  0x3F -> SUBSTITUTE (SUB)
    ' '         #  0x40 -> SPACE
    '\xa0'      #  0x41 -> NO-BREAK SPACE
    '\xe2'      #  0x42 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '{'         #  0x43 -> LEFT CURLY BRACKET
    '\xe0'      #  0x44 -> LATIN SMALL LETTER A WITH GRAVE
    '\xe1'      #  0x45 -> LATIN SMALL LETTER A WITH ACUTE
    '\xe3'      #  0x46 -> LATIN SMALL LETTER A WITH TILDE
    '\xe5'      #  0x47 -> LATIN SMALL LETTER A WITH RING ABOVE
    '\xe7'      #  0x48 -> LATIN SMALL LETTER C WITH CEDILLA
    '\xf1'      #  0x49 -> LATIN SMALL LETTER N WITH TILDE
    '\xc4'      #  0x4A -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '.'         #  0x4B -> FULL STOP
    '<'         #  0x4C -> LESS-THAN SIGN
    '('         #  0x4D -> LEFT PARENTHESIS
    '+'         #  0x4E -> PLUS SIGN
    '!'         #  0x4F -> EXCLAMATION MARK
    '&'         #  0x50 -> AMPERSAND
    '\xe9'      #  0x51 -> LATIN SMALL LETTER E WITH ACUTE
    '\xea'      #  0x52 -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xeb'      #  0x53 -> LATIN SMALL LETTER E WITH DIAERESIS
    '\xe8'      #  0x54 -> LATIN SMALL LETTER E WITH GRAVE
    '\xed'      #  0x55 -> LATIN SMALL LETTER I WITH ACUTE
    '\xee'      #  0x56 -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\xef'      #  0x57 -> LATIN SMALL LETTER I WITH DIAERESIS
    '\xec'      #  0x58 -> LATIN SMALL LETTER I WITH GRAVE
    '~'         #  0x59 -> TILDE
    '\xdc'      #  0x5A -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '$'         #  0x5B -> DOLLAR SIGN
    '*'         #  0x5C -> ASTERISK
    ')'         #  0x5D -> RIGHT PARENTHESIS
    ';'         #  0x5E -> SEMICOLON
    '^'         #  0x5F -> CIRCUMFLEX ACCENT
    '-'         #  0x60 -> HYPHEN-MINUS
    '/'         #  0x61 -> SOLIDUS
    '\xc2'      #  0x62 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    '['         #  0x63 -> LEFT SQUARE BRACKET
    '\xc0'      #  0x64 -> LATIN CAPITAL LETTER A WITH GRAVE
    '\xc1'      #  0x65 -> LATIN CAPITAL LETTER A WITH ACUTE
    '\xc3'      #  0x66 -> LATIN CAPITAL LETTER A WITH TILDE
    '\xc5'      #  0x67 -> LATIN CAPITAL LETTER A WITH RING ABOVE
    '\xc7'      #  0x68 -> LATIN CAPITAL LETTER C WITH CEDILLA
    '\xd1'      #  0x69 -> LATIN CAPITAL LETTER N WITH TILDE
    '\xf6'      #  0x6A -> LATIN SMALL LETTER O WITH DIAERESIS
    ','         #  0x6B -> COMMA
    '%'         #  0x6C -> PERCENT SIGN
    '_'         #  0x6D -> LOW LINE
    '>'         #  0x6E -> GREATER-THAN SIGN
    '?'         #  0x6F -> QUESTION MARK
    '\xf8'      #  0x70 -> LATIN SMALL LETTER O WITH STROKE
    '\xc9'      #  0x71 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\xca'      #  0x72 -> LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    '\xcb'      #  0x73 -> LATIN CAPITAL LETTER E WITH DIAERESIS
    '\xc8'      #  0x74 -> LATIN CAPITAL LETTER E WITH GRAVE
    '\xcd'      #  0x75 -> LATIN CAPITAL LETTER I WITH ACUTE
    '\xce'      #  0x76 -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    '\xcf'      #  0x77 -> LATIN CAPITAL LETTER I WITH DIAERESIS
    '\xcc'      #  0x78 -> LATIN CAPITAL LETTER I WITH GRAVE
    '`'         #  0x79 -> GRAVE ACCENT
    ':'         #  0x7A -> COLON
    '#'         #  0x7B -> NUMBER SIGN
    '\xa7'      #  0x7C -> SECTION SIGN
    "'"         #  0x7D -> APOSTROPHE
    '='         #  0x7E -> EQUALS SIGN
    '"'         #  0x7F -> QUOTATION MARK
    '\xd8'      #  0x80 -> LATIN CAPITAL LETTER O WITH STROKE
    'a'         #  0x81 -> LATIN SMALL LETTER A
    'b'         #  0x82 -> LATIN SMALL LETTER B
    'c'         #  0x83 -> LATIN SMALL LETTER C
    'd'         #  0x84 -> LATIN SMALL LETTER D
    'e'         #  0x85 -> LATIN SMALL LETTER E
    'f'         #  0x86 -> LATIN SMALL LETTER F
    'g'         #  0x87 -> LATIN SMALL LETTER G
    'h'         #  0x88 -> LATIN SMALL LETTER H
    'i'         #  0x89 -> LATIN SMALL LETTER I
    '\xab'      #  0x8A -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbb'      #  0x8B -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xf0'      #  0x8C -> LATIN SMALL LETTER ETH (Icelandic)
    '\xfd'      #  0x8D -> LATIN SMALL LETTER Y WITH ACUTE
    '\xfe'      #  0x8E -> LATIN SMALL LETTER THORN (Icelandic)
    '\xb1'      #  0x8F -> PLUS-MINUS SIGN
    '\xb0'      #  0x90 -> DEGREE SIGN
    'j'         #  0x91 -> LATIN SMALL LETTER J
    'k'         #  0x92 -> LATIN SMALL LETTER K
    'l'         #  0x93 -> LATIN SMALL LETTER L
    'm'         #  0x94 -> LATIN SMALL LETTER M
    'n'         #  0x95 -> LATIN SMALL LETTER N
    'o'         #  0x96 -> LATIN SMALL LETTER O
    'p'         #  0x97 -> LATIN SMALL LETTER P
    'q'         #  0x98 -> LATIN SMALL LETTER Q
    'r'         #  0x99 -> LATIN SMALL LETTER R
    '\xaa'      #  0x9A -> FEMININE ORDINAL INDICATOR
    '\xba'      #  0x9B -> MASCULINE ORDINAL INDICATOR
    '\xe6'      #  0x9C -> LATIN SMALL LETTER AE
    '\xb8'      #  0x9D -> CEDILLA
    '\xc6'      #  0x9E -> LATIN CAPITAL LETTER AE
    '\xa4'      #  0x9F -> CURRENCY SIGN
    '\xb5'      #  0xA0 -> MICRO SIGN
    '\xdf'      #  0xA1 -> LATIN SMALL LETTER SHARP S (German)
    's'         #  0xA2 -> LATIN SMALL LETTER S
    't'         #  0xA3 -> LATIN SMALL LETTER T
    'u'         #  0xA4 -> LATIN SMALL LETTER U
    'v'         #  0xA5 -> LATIN SMALL LETTER V
    'w'         #  0xA6 -> LATIN SMALL LETTER W
    'x'         #  0xA7 -> LATIN SMALL LETTER X
    'y'         #  0xA8 -> LATIN SMALL LETTER Y
    'z'         #  0xA9 -> LATIN SMALL LETTER Z
    '\xa1'      #  0xAA -> INVERTED EXCLAMATION MARK
    '\xbf'      #  0xAB -> INVERTED QUESTION MARK
    '\xd0'      #  0xAC -> LATIN CAPITAL LETTER ETH (Icelandic)
    '\xdd'      #  0xAD -> LATIN CAPITAL LETTER Y WITH ACUTE
    '\xde'      #  0xAE -> LATIN CAPITAL LETTER THORN (Icelandic)
    '\xae'      #  0xAF -> REGISTERED SIGN
    '\xa2'      #  0xB0 -> CENT SIGN
    '\xa3'      #  0xB1 -> POUND SIGN
    '\xa5'      #  0xB2 -> YEN SIGN
    '\xb7'      #  0xB3 -> MIDDLE DOT
    '\xa9'      #  0xB4 -> COPYRIGHT SIGN
    '@'         #  0xB5 -> COMMERCIAL AT
    '\xb6'      #  0xB6 -> PILCROW SIGN
    '\xbc'      #  0xB7 -> VULGAR FRACTION ONE QUARTER
    '\xbd'      #  0xB8 -> VULGAR FRACTION ONE HALF
    '\xbe'      #  0xB9 -> VULGAR FRACTION THREE QUARTERS
    '\xac'      #  0xBA -> NOT SIGN
    '|'         #  0xBB -> VERTICAL LINE
    '\u203e'    #  0xBC -> OVERLINE
    '\xa8'      #  0xBD -> DIAERESIS
    '\xb4'      #  0xBE -> ACUTE ACCENT
    '\xd7'      #  0xBF -> MULTIPLICATION SIGN
    '\xe4'      #  0xC0 -> LATIN SMALL LETTER A WITH DIAERESIS
    'A'         #  0xC1 -> LATIN CAPITAL LETTER A
    'B'         #  0xC2 -> LATIN CAPITAL LETTER B
    'C'         #  0xC3 -> LATIN CAPITAL LETTER C
    'D'         #  0xC4 -> LATIN CAPITAL LETTER D
    'E'         #  0xC5 -> LATIN CAPITAL LETTER E
    'F'         #  0xC6 -> LATIN CAPITAL LETTER F
    'G'         #  0xC7 -> LATIN CAPITAL LETTER G
    'H'         #  0xC8 -> LATIN CAPITAL LETTER H
    'I'         #  0xC9 -> LATIN CAPITAL LETTER I
    '\xad'      #  0xCA -> SOFT HYPHEN
    '\xf4'      #  0xCB -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xa6'      #  0xCC -> BROKEN BAR
    '\xf2'      #  0xCD -> LATIN SMALL LETTER O WITH GRAVE
    '\xf3'      #  0xCE -> LATIN SMALL LETTER O WITH ACUTE
    '\xf5'      #  0xCF -> LATIN SMALL LETTER O WITH TILDE
    '\xfc'      #  0xD0 -> LATIN SMALL LETTER U WITH DIAERESIS
    'J'         #  0xD1 -> LATIN CAPITAL LETTER J
    'K'         #  0xD2 -> LATIN CAPITAL LETTER K
    'L'         #  0xD3 -> LATIN CAPITAL LETTER L
    'M'         #  0xD4 -> LATIN CAPITAL LETTER M
    'N'         #  0xD5 -> LATIN CAPITAL LETTER N
    'O'         #  0xD6 -> LATIN CAPITAL LETTER O
    'P'         #  0xD7 -> LATIN CAPITAL LETTER P
    'Q'         #  0xD8 -> LATIN CAPITAL LETTER Q
    'R'         #  0xD9 -> LATIN CAPITAL LETTER R
    '\xb9'      #  0xDA -> SUPERSCRIPT ONE
    '\xfb'      #  0xDB -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '}'         #  0xDC -> RIGHT CURLY BRACKET
    '\xf9'      #  0xDD -> LATIN SMALL LETTER U WITH GRAVE
    '\xfa'      #  0xDE -> LATIN SMALL LETTER U WITH ACUTE
    '\xff'      #  0xDF -> LATIN SMALL LETTER Y WITH DIAERESIS
    '\xd6'      #  0xE0 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xf7'      #  0xE1 -> DIVISION SIGN
    'S'         #  0xE2 -> LATIN CAPITAL LETTER S
    'T'         #  0xE3 -> LATIN CAPITAL LETTER T
    'U'         #  0xE4 -> LATIN CAPITAL LETTER U
    'V'         #  0xE5 -> LATIN CAPITAL LETTER V
    'W'         #  0xE6 -> LATIN CAPITAL LETTER W
    'X'         #  0xE7 -> LATIN CAPITAL LETTER X
    'Y'         #  0xE8 -> LATIN CAPITAL LETTER Y
    'Z'         #  0xE9 -> LATIN CAPITAL LETTER Z
    '\xb2'      #  0xEA -> SUPERSCRIPT TWO
    '\xd4'      #  0xEB -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    '\\'        #  0xEC -> REVERSE SOLIDUS
    '\xd2'      #  0xED -> LATIN CAPITAL LETTER O WITH GRAVE
    '\xd3'      #  0xEE -> LATIN CAPITAL LETTER O WITH ACUTE
    '\xd5'      #  0xEF -> LATIN CAPITAL LETTER O WITH TILDE
    '0'         #  0xF0 -> DIGIT ZERO
    '1'         #  0xF1 -> DIGIT ONE
    '2'         #  0xF2 -> DIGIT TWO
    '3'         #  0xF3 -> DIGIT THREE
    '4'         #  0xF4 -> DIGIT FOUR
    '5'         #  0xF5 -> DIGIT FIVE
    '6'         #  0xF6 -> DIGIT SIX
    '7'         #  0xF7 -> DIGIT SEVEN
    '8'         #  0xF8 -> DIGIT EIGHT
    '9'         #  0xF9 -> DIGIT NINE
    '\xb3'      #  0xFA -> SUPERSCRIPT THREE
    '\xdb'      #  0xFB -> LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    ']'         #  0xFC -> RIGHT SQUARE BRACKET
    '\xd9'      #  0xFD -> LATIN CAPITAL LETTER U WITH GRAVE
    '\xda'      #  0xFE -> LATIN CAPITAL LETTER U WITH ACUTE
    '\x9f'      #  0xFF -> APPLICATION PROGRAM COMMAND (APC)
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/cp950.py000064400000001777151153537620007753 0ustar00#
# cp950.py: Python Unicode Codec for CP950
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#

import _codecs_tw, codecs
import _multibytecodec as mbc

codec = _codecs_tw.getcodec('cp950')

class Codec(codecs.Codec):
    encode = codec.encode
    decode = codec.decode

class IncrementalEncoder(mbc.MultibyteIncrementalEncoder,
                         codecs.IncrementalEncoder):
    codec = codec

class IncrementalDecoder(mbc.MultibyteIncrementalDecoder,
                         codecs.IncrementalDecoder):
    codec = codec

class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader):
    codec = codec

class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
    codec = codec

def getregentry():
    return codecs.CodecInfo(
        name='cp950',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/utf_8.py000064400000001755151153537620010134 0ustar00""" Python 'utf-8' Codec


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

"""
import codecs

### Codec APIs

encode = codecs.utf_8_encode

def decode(input, errors='strict'):
    return codecs.utf_8_decode(input, errors, True)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.utf_8_encode(input, self.errors)[0]

class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
    _buffer_decode = codecs.utf_8_decode

class StreamWriter(codecs.StreamWriter):
    encode = codecs.utf_8_encode

class StreamReader(codecs.StreamReader):
    decode = codecs.utf_8_decode

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='utf-8',
        encode=encode,
        decode=decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/cp856.py000064400000030207151153537620007746 0ustar00""" Python Character Mapping Codec cp856 generated from 'MAPPINGS/VENDORS/MISC/CP856.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp856',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\u05d0'   #  0x80 -> HEBREW LETTER ALEF
    '\u05d1'   #  0x81 -> HEBREW LETTER BET
    '\u05d2'   #  0x82 -> HEBREW LETTER GIMEL
    '\u05d3'   #  0x83 -> HEBREW LETTER DALET
    '\u05d4'   #  0x84 -> HEBREW LETTER HE
    '\u05d5'   #  0x85 -> HEBREW LETTER VAV
    '\u05d6'   #  0x86 -> HEBREW LETTER ZAYIN
    '\u05d7'   #  0x87 -> HEBREW LETTER HET
    '\u05d8'   #  0x88 -> HEBREW LETTER TET
    '\u05d9'   #  0x89 -> HEBREW LETTER YOD
    '\u05da'   #  0x8A -> HEBREW LETTER FINAL KAF
    '\u05db'   #  0x8B -> HEBREW LETTER KAF
    '\u05dc'   #  0x8C -> HEBREW LETTER LAMED
    '\u05dd'   #  0x8D -> HEBREW LETTER FINAL MEM
    '\u05de'   #  0x8E -> HEBREW LETTER MEM
    '\u05df'   #  0x8F -> HEBREW LETTER FINAL NUN
    '\u05e0'   #  0x90 -> HEBREW LETTER NUN
    '\u05e1'   #  0x91 -> HEBREW LETTER SAMEKH
    '\u05e2'   #  0x92 -> HEBREW LETTER AYIN
    '\u05e3'   #  0x93 -> HEBREW LETTER FINAL PE
    '\u05e4'   #  0x94 -> HEBREW LETTER PE
    '\u05e5'   #  0x95 -> HEBREW LETTER FINAL TSADI
    '\u05e6'   #  0x96 -> HEBREW LETTER TSADI
    '\u05e7'   #  0x97 -> HEBREW LETTER QOF
    '\u05e8'   #  0x98 -> HEBREW LETTER RESH
    '\u05e9'   #  0x99 -> HEBREW LETTER SHIN
    '\u05ea'   #  0x9A -> HEBREW LETTER TAV
    '\ufffe'   #  0x9B -> UNDEFINED
    '\xa3'     #  0x9C -> POUND SIGN
    '\ufffe'   #  0x9D -> UNDEFINED
    '\xd7'     #  0x9E -> MULTIPLICATION SIGN
    '\ufffe'   #  0x9F -> UNDEFINED
    '\ufffe'   #  0xA0 -> UNDEFINED
    '\ufffe'   #  0xA1 -> UNDEFINED
    '\ufffe'   #  0xA2 -> UNDEFINED
    '\ufffe'   #  0xA3 -> UNDEFINED
    '\ufffe'   #  0xA4 -> UNDEFINED
    '\ufffe'   #  0xA5 -> UNDEFINED
    '\ufffe'   #  0xA6 -> UNDEFINED
    '\ufffe'   #  0xA7 -> UNDEFINED
    '\ufffe'   #  0xA8 -> UNDEFINED
    '\xae'     #  0xA9 -> REGISTERED SIGN
    '\xac'     #  0xAA -> NOT SIGN
    '\xbd'     #  0xAB -> VULGAR FRACTION ONE HALF
    '\xbc'     #  0xAC -> VULGAR FRACTION ONE QUARTER
    '\ufffe'   #  0xAD -> UNDEFINED
    '\xab'     #  0xAE -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbb'     #  0xAF -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u2591'   #  0xB0 -> LIGHT SHADE
    '\u2592'   #  0xB1 -> MEDIUM SHADE
    '\u2593'   #  0xB2 -> DARK SHADE
    '\u2502'   #  0xB3 -> BOX DRAWINGS LIGHT VERTICAL
    '\u2524'   #  0xB4 -> BOX DRAWINGS LIGHT VERTICAL AND LEFT
    '\ufffe'   #  0xB5 -> UNDEFINED
    '\ufffe'   #  0xB6 -> UNDEFINED
    '\ufffe'   #  0xB7 -> UNDEFINED
    '\xa9'     #  0xB8 -> COPYRIGHT SIGN
    '\u2563'   #  0xB9 -> BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    '\u2551'   #  0xBA -> BOX DRAWINGS DOUBLE VERTICAL
    '\u2557'   #  0xBB -> BOX DRAWINGS DOUBLE DOWN AND LEFT
    '\u255d'   #  0xBC -> BOX DRAWINGS DOUBLE UP AND LEFT
    '\xa2'     #  0xBD -> CENT SIGN
    '\xa5'     #  0xBE -> YEN SIGN
    '\u2510'   #  0xBF -> BOX DRAWINGS LIGHT DOWN AND LEFT
    '\u2514'   #  0xC0 -> BOX DRAWINGS LIGHT UP AND RIGHT
    '\u2534'   #  0xC1 -> BOX DRAWINGS LIGHT UP AND HORIZONTAL
    '\u252c'   #  0xC2 -> BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    '\u251c'   #  0xC3 -> BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    '\u2500'   #  0xC4 -> BOX DRAWINGS LIGHT HORIZONTAL
    '\u253c'   #  0xC5 -> BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    '\ufffe'   #  0xC6 -> UNDEFINED
    '\ufffe'   #  0xC7 -> UNDEFINED
    '\u255a'   #  0xC8 -> BOX DRAWINGS DOUBLE UP AND RIGHT
    '\u2554'   #  0xC9 -> BOX DRAWINGS DOUBLE DOWN AND RIGHT
    '\u2569'   #  0xCA -> BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    '\u2566'   #  0xCB -> BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    '\u2560'   #  0xCC -> BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    '\u2550'   #  0xCD -> BOX DRAWINGS DOUBLE HORIZONTAL
    '\u256c'   #  0xCE -> BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    '\xa4'     #  0xCF -> CURRENCY SIGN
    '\ufffe'   #  0xD0 -> UNDEFINED
    '\ufffe'   #  0xD1 -> UNDEFINED
    '\ufffe'   #  0xD2 -> UNDEFINED
    '\ufffe'   #  0xD3 -> UNDEFINEDS
    '\ufffe'   #  0xD4 -> UNDEFINED
    '\ufffe'   #  0xD5 -> UNDEFINED
    '\ufffe'   #  0xD6 -> UNDEFINEDE
    '\ufffe'   #  0xD7 -> UNDEFINED
    '\ufffe'   #  0xD8 -> UNDEFINED
    '\u2518'   #  0xD9 -> BOX DRAWINGS LIGHT UP AND LEFT
    '\u250c'   #  0xDA -> BOX DRAWINGS LIGHT DOWN AND RIGHT
    '\u2588'   #  0xDB -> FULL BLOCK
    '\u2584'   #  0xDC -> LOWER HALF BLOCK
    '\xa6'     #  0xDD -> BROKEN BAR
    '\ufffe'   #  0xDE -> UNDEFINED
    '\u2580'   #  0xDF -> UPPER HALF BLOCK
    '\ufffe'   #  0xE0 -> UNDEFINED
    '\ufffe'   #  0xE1 -> UNDEFINED
    '\ufffe'   #  0xE2 -> UNDEFINED
    '\ufffe'   #  0xE3 -> UNDEFINED
    '\ufffe'   #  0xE4 -> UNDEFINED
    '\ufffe'   #  0xE5 -> UNDEFINED
    '\xb5'     #  0xE6 -> MICRO SIGN
    '\ufffe'   #  0xE7 -> UNDEFINED
    '\ufffe'   #  0xE8 -> UNDEFINED
    '\ufffe'   #  0xE9 -> UNDEFINED
    '\ufffe'   #  0xEA -> UNDEFINED
    '\ufffe'   #  0xEB -> UNDEFINED
    '\ufffe'   #  0xEC -> UNDEFINED
    '\ufffe'   #  0xED -> UNDEFINED
    '\xaf'     #  0xEE -> MACRON
    '\xb4'     #  0xEF -> ACUTE ACCENT
    '\xad'     #  0xF0 -> SOFT HYPHEN
    '\xb1'     #  0xF1 -> PLUS-MINUS SIGN
    '\u2017'   #  0xF2 -> DOUBLE LOW LINE
    '\xbe'     #  0xF3 -> VULGAR FRACTION THREE QUARTERS
    '\xb6'     #  0xF4 -> PILCROW SIGN
    '\xa7'     #  0xF5 -> SECTION SIGN
    '\xf7'     #  0xF6 -> DIVISION SIGN
    '\xb8'     #  0xF7 -> CEDILLA
    '\xb0'     #  0xF8 -> DEGREE SIGN
    '\xa8'     #  0xF9 -> DIAERESIS
    '\xb7'     #  0xFA -> MIDDLE DOT
    '\xb9'     #  0xFB -> SUPERSCRIPT ONE
    '\xb3'     #  0xFC -> SUPERSCRIPT THREE
    '\xb2'     #  0xFD -> SUPERSCRIPT TWO
    '\u25a0'   #  0xFE -> BLACK SQUARE
    '\xa0'     #  0xFF -> NO-BREAK SPACE
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/mac_cyrillic.py000064400000032216151153537620011535 0ustar00""" Python Character Mapping Codec mac_cyrillic generated from 'MAPPINGS/VENDORS/APPLE/CYRILLIC.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='mac-cyrillic',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> CONTROL CHARACTER
    '\x01'     #  0x01 -> CONTROL CHARACTER
    '\x02'     #  0x02 -> CONTROL CHARACTER
    '\x03'     #  0x03 -> CONTROL CHARACTER
    '\x04'     #  0x04 -> CONTROL CHARACTER
    '\x05'     #  0x05 -> CONTROL CHARACTER
    '\x06'     #  0x06 -> CONTROL CHARACTER
    '\x07'     #  0x07 -> CONTROL CHARACTER
    '\x08'     #  0x08 -> CONTROL CHARACTER
    '\t'       #  0x09 -> CONTROL CHARACTER
    '\n'       #  0x0A -> CONTROL CHARACTER
    '\x0b'     #  0x0B -> CONTROL CHARACTER
    '\x0c'     #  0x0C -> CONTROL CHARACTER
    '\r'       #  0x0D -> CONTROL CHARACTER
    '\x0e'     #  0x0E -> CONTROL CHARACTER
    '\x0f'     #  0x0F -> CONTROL CHARACTER
    '\x10'     #  0x10 -> CONTROL CHARACTER
    '\x11'     #  0x11 -> CONTROL CHARACTER
    '\x12'     #  0x12 -> CONTROL CHARACTER
    '\x13'     #  0x13 -> CONTROL CHARACTER
    '\x14'     #  0x14 -> CONTROL CHARACTER
    '\x15'     #  0x15 -> CONTROL CHARACTER
    '\x16'     #  0x16 -> CONTROL CHARACTER
    '\x17'     #  0x17 -> CONTROL CHARACTER
    '\x18'     #  0x18 -> CONTROL CHARACTER
    '\x19'     #  0x19 -> CONTROL CHARACTER
    '\x1a'     #  0x1A -> CONTROL CHARACTER
    '\x1b'     #  0x1B -> CONTROL CHARACTER
    '\x1c'     #  0x1C -> CONTROL CHARACTER
    '\x1d'     #  0x1D -> CONTROL CHARACTER
    '\x1e'     #  0x1E -> CONTROL CHARACTER
    '\x1f'     #  0x1F -> CONTROL CHARACTER
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> CONTROL CHARACTER
    '\u0410'   #  0x80 -> CYRILLIC CAPITAL LETTER A
    '\u0411'   #  0x81 -> CYRILLIC CAPITAL LETTER BE
    '\u0412'   #  0x82 -> CYRILLIC CAPITAL LETTER VE
    '\u0413'   #  0x83 -> CYRILLIC CAPITAL LETTER GHE
    '\u0414'   #  0x84 -> CYRILLIC CAPITAL LETTER DE
    '\u0415'   #  0x85 -> CYRILLIC CAPITAL LETTER IE
    '\u0416'   #  0x86 -> CYRILLIC CAPITAL LETTER ZHE
    '\u0417'   #  0x87 -> CYRILLIC CAPITAL LETTER ZE
    '\u0418'   #  0x88 -> CYRILLIC CAPITAL LETTER I
    '\u0419'   #  0x89 -> CYRILLIC CAPITAL LETTER SHORT I
    '\u041a'   #  0x8A -> CYRILLIC CAPITAL LETTER KA
    '\u041b'   #  0x8B -> CYRILLIC CAPITAL LETTER EL
    '\u041c'   #  0x8C -> CYRILLIC CAPITAL LETTER EM
    '\u041d'   #  0x8D -> CYRILLIC CAPITAL LETTER EN
    '\u041e'   #  0x8E -> CYRILLIC CAPITAL LETTER O
    '\u041f'   #  0x8F -> CYRILLIC CAPITAL LETTER PE
    '\u0420'   #  0x90 -> CYRILLIC CAPITAL LETTER ER
    '\u0421'   #  0x91 -> CYRILLIC CAPITAL LETTER ES
    '\u0422'   #  0x92 -> CYRILLIC CAPITAL LETTER TE
    '\u0423'   #  0x93 -> CYRILLIC CAPITAL LETTER U
    '\u0424'   #  0x94 -> CYRILLIC CAPITAL LETTER EF
    '\u0425'   #  0x95 -> CYRILLIC CAPITAL LETTER HA
    '\u0426'   #  0x96 -> CYRILLIC CAPITAL LETTER TSE
    '\u0427'   #  0x97 -> CYRILLIC CAPITAL LETTER CHE
    '\u0428'   #  0x98 -> CYRILLIC CAPITAL LETTER SHA
    '\u0429'   #  0x99 -> CYRILLIC CAPITAL LETTER SHCHA
    '\u042a'   #  0x9A -> CYRILLIC CAPITAL LETTER HARD SIGN
    '\u042b'   #  0x9B -> CYRILLIC CAPITAL LETTER YERU
    '\u042c'   #  0x9C -> CYRILLIC CAPITAL LETTER SOFT SIGN
    '\u042d'   #  0x9D -> CYRILLIC CAPITAL LETTER E
    '\u042e'   #  0x9E -> CYRILLIC CAPITAL LETTER YU
    '\u042f'   #  0x9F -> CYRILLIC CAPITAL LETTER YA
    '\u2020'   #  0xA0 -> DAGGER
    '\xb0'     #  0xA1 -> DEGREE SIGN
    '\u0490'   #  0xA2 -> CYRILLIC CAPITAL LETTER GHE WITH UPTURN
    '\xa3'     #  0xA3 -> POUND SIGN
    '\xa7'     #  0xA4 -> SECTION SIGN
    '\u2022'   #  0xA5 -> BULLET
    '\xb6'     #  0xA6 -> PILCROW SIGN
    '\u0406'   #  0xA7 -> CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
    '\xae'     #  0xA8 -> REGISTERED SIGN
    '\xa9'     #  0xA9 -> COPYRIGHT SIGN
    '\u2122'   #  0xAA -> TRADE MARK SIGN
    '\u0402'   #  0xAB -> CYRILLIC CAPITAL LETTER DJE
    '\u0452'   #  0xAC -> CYRILLIC SMALL LETTER DJE
    '\u2260'   #  0xAD -> NOT EQUAL TO
    '\u0403'   #  0xAE -> CYRILLIC CAPITAL LETTER GJE
    '\u0453'   #  0xAF -> CYRILLIC SMALL LETTER GJE
    '\u221e'   #  0xB0 -> INFINITY
    '\xb1'     #  0xB1 -> PLUS-MINUS SIGN
    '\u2264'   #  0xB2 -> LESS-THAN OR EQUAL TO
    '\u2265'   #  0xB3 -> GREATER-THAN OR EQUAL TO
    '\u0456'   #  0xB4 -> CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
    '\xb5'     #  0xB5 -> MICRO SIGN
    '\u0491'   #  0xB6 -> CYRILLIC SMALL LETTER GHE WITH UPTURN
    '\u0408'   #  0xB7 -> CYRILLIC CAPITAL LETTER JE
    '\u0404'   #  0xB8 -> CYRILLIC CAPITAL LETTER UKRAINIAN IE
    '\u0454'   #  0xB9 -> CYRILLIC SMALL LETTER UKRAINIAN IE
    '\u0407'   #  0xBA -> CYRILLIC CAPITAL LETTER YI
    '\u0457'   #  0xBB -> CYRILLIC SMALL LETTER YI
    '\u0409'   #  0xBC -> CYRILLIC CAPITAL LETTER LJE
    '\u0459'   #  0xBD -> CYRILLIC SMALL LETTER LJE
    '\u040a'   #  0xBE -> CYRILLIC CAPITAL LETTER NJE
    '\u045a'   #  0xBF -> CYRILLIC SMALL LETTER NJE
    '\u0458'   #  0xC0 -> CYRILLIC SMALL LETTER JE
    '\u0405'   #  0xC1 -> CYRILLIC CAPITAL LETTER DZE
    '\xac'     #  0xC2 -> NOT SIGN
    '\u221a'   #  0xC3 -> SQUARE ROOT
    '\u0192'   #  0xC4 -> LATIN SMALL LETTER F WITH HOOK
    '\u2248'   #  0xC5 -> ALMOST EQUAL TO
    '\u2206'   #  0xC6 -> INCREMENT
    '\xab'     #  0xC7 -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbb'     #  0xC8 -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u2026'   #  0xC9 -> HORIZONTAL ELLIPSIS
    '\xa0'     #  0xCA -> NO-BREAK SPACE
    '\u040b'   #  0xCB -> CYRILLIC CAPITAL LETTER TSHE
    '\u045b'   #  0xCC -> CYRILLIC SMALL LETTER TSHE
    '\u040c'   #  0xCD -> CYRILLIC CAPITAL LETTER KJE
    '\u045c'   #  0xCE -> CYRILLIC SMALL LETTER KJE
    '\u0455'   #  0xCF -> CYRILLIC SMALL LETTER DZE
    '\u2013'   #  0xD0 -> EN DASH
    '\u2014'   #  0xD1 -> EM DASH
    '\u201c'   #  0xD2 -> LEFT DOUBLE QUOTATION MARK
    '\u201d'   #  0xD3 -> RIGHT DOUBLE QUOTATION MARK
    '\u2018'   #  0xD4 -> LEFT SINGLE QUOTATION MARK
    '\u2019'   #  0xD5 -> RIGHT SINGLE QUOTATION MARK
    '\xf7'     #  0xD6 -> DIVISION SIGN
    '\u201e'   #  0xD7 -> DOUBLE LOW-9 QUOTATION MARK
    '\u040e'   #  0xD8 -> CYRILLIC CAPITAL LETTER SHORT U
    '\u045e'   #  0xD9 -> CYRILLIC SMALL LETTER SHORT U
    '\u040f'   #  0xDA -> CYRILLIC CAPITAL LETTER DZHE
    '\u045f'   #  0xDB -> CYRILLIC SMALL LETTER DZHE
    '\u2116'   #  0xDC -> NUMERO SIGN
    '\u0401'   #  0xDD -> CYRILLIC CAPITAL LETTER IO
    '\u0451'   #  0xDE -> CYRILLIC SMALL LETTER IO
    '\u044f'   #  0xDF -> CYRILLIC SMALL LETTER YA
    '\u0430'   #  0xE0 -> CYRILLIC SMALL LETTER A
    '\u0431'   #  0xE1 -> CYRILLIC SMALL LETTER BE
    '\u0432'   #  0xE2 -> CYRILLIC SMALL LETTER VE
    '\u0433'   #  0xE3 -> CYRILLIC SMALL LETTER GHE
    '\u0434'   #  0xE4 -> CYRILLIC SMALL LETTER DE
    '\u0435'   #  0xE5 -> CYRILLIC SMALL LETTER IE
    '\u0436'   #  0xE6 -> CYRILLIC SMALL LETTER ZHE
    '\u0437'   #  0xE7 -> CYRILLIC SMALL LETTER ZE
    '\u0438'   #  0xE8 -> CYRILLIC SMALL LETTER I
    '\u0439'   #  0xE9 -> CYRILLIC SMALL LETTER SHORT I
    '\u043a'   #  0xEA -> CYRILLIC SMALL LETTER KA
    '\u043b'   #  0xEB -> CYRILLIC SMALL LETTER EL
    '\u043c'   #  0xEC -> CYRILLIC SMALL LETTER EM
    '\u043d'   #  0xED -> CYRILLIC SMALL LETTER EN
    '\u043e'   #  0xEE -> CYRILLIC SMALL LETTER O
    '\u043f'   #  0xEF -> CYRILLIC SMALL LETTER PE
    '\u0440'   #  0xF0 -> CYRILLIC SMALL LETTER ER
    '\u0441'   #  0xF1 -> CYRILLIC SMALL LETTER ES
    '\u0442'   #  0xF2 -> CYRILLIC SMALL LETTER TE
    '\u0443'   #  0xF3 -> CYRILLIC SMALL LETTER U
    '\u0444'   #  0xF4 -> CYRILLIC SMALL LETTER EF
    '\u0445'   #  0xF5 -> CYRILLIC SMALL LETTER HA
    '\u0446'   #  0xF6 -> CYRILLIC SMALL LETTER TSE
    '\u0447'   #  0xF7 -> CYRILLIC SMALL LETTER CHE
    '\u0448'   #  0xF8 -> CYRILLIC SMALL LETTER SHA
    '\u0449'   #  0xF9 -> CYRILLIC SMALL LETTER SHCHA
    '\u044a'   #  0xFA -> CYRILLIC SMALL LETTER HARD SIGN
    '\u044b'   #  0xFB -> CYRILLIC SMALL LETTER YERU
    '\u044c'   #  0xFC -> CYRILLIC SMALL LETTER SOFT SIGN
    '\u044d'   #  0xFD -> CYRILLIC SMALL LETTER E
    '\u044e'   #  0xFE -> CYRILLIC SMALL LETTER YU
    '\u20ac'   #  0xFF -> EURO SIGN
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/iso8859_11.py000064400000030057151153537620010535 0ustar00""" Python Character Mapping Codec iso8859_11 generated from 'MAPPINGS/ISO8859/8859-11.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='iso8859-11',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\x80'     #  0x80 -> <control>
    '\x81'     #  0x81 -> <control>
    '\x82'     #  0x82 -> <control>
    '\x83'     #  0x83 -> <control>
    '\x84'     #  0x84 -> <control>
    '\x85'     #  0x85 -> <control>
    '\x86'     #  0x86 -> <control>
    '\x87'     #  0x87 -> <control>
    '\x88'     #  0x88 -> <control>
    '\x89'     #  0x89 -> <control>
    '\x8a'     #  0x8A -> <control>
    '\x8b'     #  0x8B -> <control>
    '\x8c'     #  0x8C -> <control>
    '\x8d'     #  0x8D -> <control>
    '\x8e'     #  0x8E -> <control>
    '\x8f'     #  0x8F -> <control>
    '\x90'     #  0x90 -> <control>
    '\x91'     #  0x91 -> <control>
    '\x92'     #  0x92 -> <control>
    '\x93'     #  0x93 -> <control>
    '\x94'     #  0x94 -> <control>
    '\x95'     #  0x95 -> <control>
    '\x96'     #  0x96 -> <control>
    '\x97'     #  0x97 -> <control>
    '\x98'     #  0x98 -> <control>
    '\x99'     #  0x99 -> <control>
    '\x9a'     #  0x9A -> <control>
    '\x9b'     #  0x9B -> <control>
    '\x9c'     #  0x9C -> <control>
    '\x9d'     #  0x9D -> <control>
    '\x9e'     #  0x9E -> <control>
    '\x9f'     #  0x9F -> <control>
    '\xa0'     #  0xA0 -> NO-BREAK SPACE
    '\u0e01'   #  0xA1 -> THAI CHARACTER KO KAI
    '\u0e02'   #  0xA2 -> THAI CHARACTER KHO KHAI
    '\u0e03'   #  0xA3 -> THAI CHARACTER KHO KHUAT
    '\u0e04'   #  0xA4 -> THAI CHARACTER KHO KHWAI
    '\u0e05'   #  0xA5 -> THAI CHARACTER KHO KHON
    '\u0e06'   #  0xA6 -> THAI CHARACTER KHO RAKHANG
    '\u0e07'   #  0xA7 -> THAI CHARACTER NGO NGU
    '\u0e08'   #  0xA8 -> THAI CHARACTER CHO CHAN
    '\u0e09'   #  0xA9 -> THAI CHARACTER CHO CHING
    '\u0e0a'   #  0xAA -> THAI CHARACTER CHO CHANG
    '\u0e0b'   #  0xAB -> THAI CHARACTER SO SO
    '\u0e0c'   #  0xAC -> THAI CHARACTER CHO CHOE
    '\u0e0d'   #  0xAD -> THAI CHARACTER YO YING
    '\u0e0e'   #  0xAE -> THAI CHARACTER DO CHADA
    '\u0e0f'   #  0xAF -> THAI CHARACTER TO PATAK
    '\u0e10'   #  0xB0 -> THAI CHARACTER THO THAN
    '\u0e11'   #  0xB1 -> THAI CHARACTER THO NANGMONTHO
    '\u0e12'   #  0xB2 -> THAI CHARACTER THO PHUTHAO
    '\u0e13'   #  0xB3 -> THAI CHARACTER NO NEN
    '\u0e14'   #  0xB4 -> THAI CHARACTER DO DEK
    '\u0e15'   #  0xB5 -> THAI CHARACTER TO TAO
    '\u0e16'   #  0xB6 -> THAI CHARACTER THO THUNG
    '\u0e17'   #  0xB7 -> THAI CHARACTER THO THAHAN
    '\u0e18'   #  0xB8 -> THAI CHARACTER THO THONG
    '\u0e19'   #  0xB9 -> THAI CHARACTER NO NU
    '\u0e1a'   #  0xBA -> THAI CHARACTER BO BAIMAI
    '\u0e1b'   #  0xBB -> THAI CHARACTER PO PLA
    '\u0e1c'   #  0xBC -> THAI CHARACTER PHO PHUNG
    '\u0e1d'   #  0xBD -> THAI CHARACTER FO FA
    '\u0e1e'   #  0xBE -> THAI CHARACTER PHO PHAN
    '\u0e1f'   #  0xBF -> THAI CHARACTER FO FAN
    '\u0e20'   #  0xC0 -> THAI CHARACTER PHO SAMPHAO
    '\u0e21'   #  0xC1 -> THAI CHARACTER MO MA
    '\u0e22'   #  0xC2 -> THAI CHARACTER YO YAK
    '\u0e23'   #  0xC3 -> THAI CHARACTER RO RUA
    '\u0e24'   #  0xC4 -> THAI CHARACTER RU
    '\u0e25'   #  0xC5 -> THAI CHARACTER LO LING
    '\u0e26'   #  0xC6 -> THAI CHARACTER LU
    '\u0e27'   #  0xC7 -> THAI CHARACTER WO WAEN
    '\u0e28'   #  0xC8 -> THAI CHARACTER SO SALA
    '\u0e29'   #  0xC9 -> THAI CHARACTER SO RUSI
    '\u0e2a'   #  0xCA -> THAI CHARACTER SO SUA
    '\u0e2b'   #  0xCB -> THAI CHARACTER HO HIP
    '\u0e2c'   #  0xCC -> THAI CHARACTER LO CHULA
    '\u0e2d'   #  0xCD -> THAI CHARACTER O ANG
    '\u0e2e'   #  0xCE -> THAI CHARACTER HO NOKHUK
    '\u0e2f'   #  0xCF -> THAI CHARACTER PAIYANNOI
    '\u0e30'   #  0xD0 -> THAI CHARACTER SARA A
    '\u0e31'   #  0xD1 -> THAI CHARACTER MAI HAN-AKAT
    '\u0e32'   #  0xD2 -> THAI CHARACTER SARA AA
    '\u0e33'   #  0xD3 -> THAI CHARACTER SARA AM
    '\u0e34'   #  0xD4 -> THAI CHARACTER SARA I
    '\u0e35'   #  0xD5 -> THAI CHARACTER SARA II
    '\u0e36'   #  0xD6 -> THAI CHARACTER SARA UE
    '\u0e37'   #  0xD7 -> THAI CHARACTER SARA UEE
    '\u0e38'   #  0xD8 -> THAI CHARACTER SARA U
    '\u0e39'   #  0xD9 -> THAI CHARACTER SARA UU
    '\u0e3a'   #  0xDA -> THAI CHARACTER PHINTHU
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\u0e3f'   #  0xDF -> THAI CURRENCY SYMBOL BAHT
    '\u0e40'   #  0xE0 -> THAI CHARACTER SARA E
    '\u0e41'   #  0xE1 -> THAI CHARACTER SARA AE
    '\u0e42'   #  0xE2 -> THAI CHARACTER SARA O
    '\u0e43'   #  0xE3 -> THAI CHARACTER SARA AI MAIMUAN
    '\u0e44'   #  0xE4 -> THAI CHARACTER SARA AI MAIMALAI
    '\u0e45'   #  0xE5 -> THAI CHARACTER LAKKHANGYAO
    '\u0e46'   #  0xE6 -> THAI CHARACTER MAIYAMOK
    '\u0e47'   #  0xE7 -> THAI CHARACTER MAITAIKHU
    '\u0e48'   #  0xE8 -> THAI CHARACTER MAI EK
    '\u0e49'   #  0xE9 -> THAI CHARACTER MAI THO
    '\u0e4a'   #  0xEA -> THAI CHARACTER MAI TRI
    '\u0e4b'   #  0xEB -> THAI CHARACTER MAI CHATTAWA
    '\u0e4c'   #  0xEC -> THAI CHARACTER THANTHAKHAT
    '\u0e4d'   #  0xED -> THAI CHARACTER NIKHAHIT
    '\u0e4e'   #  0xEE -> THAI CHARACTER YAMAKKAN
    '\u0e4f'   #  0xEF -> THAI CHARACTER FONGMAN
    '\u0e50'   #  0xF0 -> THAI DIGIT ZERO
    '\u0e51'   #  0xF1 -> THAI DIGIT ONE
    '\u0e52'   #  0xF2 -> THAI DIGIT TWO
    '\u0e53'   #  0xF3 -> THAI DIGIT THREE
    '\u0e54'   #  0xF4 -> THAI DIGIT FOUR
    '\u0e55'   #  0xF5 -> THAI DIGIT FIVE
    '\u0e56'   #  0xF6 -> THAI DIGIT SIX
    '\u0e57'   #  0xF7 -> THAI DIGIT SEVEN
    '\u0e58'   #  0xF8 -> THAI DIGIT EIGHT
    '\u0e59'   #  0xF9 -> THAI DIGIT NINE
    '\u0e5a'   #  0xFA -> THAI CHARACTER ANGKHANKHU
    '\u0e5b'   #  0xFB -> THAI CHARACTER KHOMUT
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/mac_turkish.py000064400000032311151153537620011410 0ustar00""" Python Character Mapping Codec mac_turkish generated from 'MAPPINGS/VENDORS/APPLE/TURKISH.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='mac-turkish',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> CONTROL CHARACTER
    '\x01'     #  0x01 -> CONTROL CHARACTER
    '\x02'     #  0x02 -> CONTROL CHARACTER
    '\x03'     #  0x03 -> CONTROL CHARACTER
    '\x04'     #  0x04 -> CONTROL CHARACTER
    '\x05'     #  0x05 -> CONTROL CHARACTER
    '\x06'     #  0x06 -> CONTROL CHARACTER
    '\x07'     #  0x07 -> CONTROL CHARACTER
    '\x08'     #  0x08 -> CONTROL CHARACTER
    '\t'       #  0x09 -> CONTROL CHARACTER
    '\n'       #  0x0A -> CONTROL CHARACTER
    '\x0b'     #  0x0B -> CONTROL CHARACTER
    '\x0c'     #  0x0C -> CONTROL CHARACTER
    '\r'       #  0x0D -> CONTROL CHARACTER
    '\x0e'     #  0x0E -> CONTROL CHARACTER
    '\x0f'     #  0x0F -> CONTROL CHARACTER
    '\x10'     #  0x10 -> CONTROL CHARACTER
    '\x11'     #  0x11 -> CONTROL CHARACTER
    '\x12'     #  0x12 -> CONTROL CHARACTER
    '\x13'     #  0x13 -> CONTROL CHARACTER
    '\x14'     #  0x14 -> CONTROL CHARACTER
    '\x15'     #  0x15 -> CONTROL CHARACTER
    '\x16'     #  0x16 -> CONTROL CHARACTER
    '\x17'     #  0x17 -> CONTROL CHARACTER
    '\x18'     #  0x18 -> CONTROL CHARACTER
    '\x19'     #  0x19 -> CONTROL CHARACTER
    '\x1a'     #  0x1A -> CONTROL CHARACTER
    '\x1b'     #  0x1B -> CONTROL CHARACTER
    '\x1c'     #  0x1C -> CONTROL CHARACTER
    '\x1d'     #  0x1D -> CONTROL CHARACTER
    '\x1e'     #  0x1E -> CONTROL CHARACTER
    '\x1f'     #  0x1F -> CONTROL CHARACTER
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> CONTROL CHARACTER
    '\xc4'     #  0x80 -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\xc5'     #  0x81 -> LATIN CAPITAL LETTER A WITH RING ABOVE
    '\xc7'     #  0x82 -> LATIN CAPITAL LETTER C WITH CEDILLA
    '\xc9'     #  0x83 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\xd1'     #  0x84 -> LATIN CAPITAL LETTER N WITH TILDE
    '\xd6'     #  0x85 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xdc'     #  0x86 -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\xe1'     #  0x87 -> LATIN SMALL LETTER A WITH ACUTE
    '\xe0'     #  0x88 -> LATIN SMALL LETTER A WITH GRAVE
    '\xe2'     #  0x89 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\xe4'     #  0x8A -> LATIN SMALL LETTER A WITH DIAERESIS
    '\xe3'     #  0x8B -> LATIN SMALL LETTER A WITH TILDE
    '\xe5'     #  0x8C -> LATIN SMALL LETTER A WITH RING ABOVE
    '\xe7'     #  0x8D -> LATIN SMALL LETTER C WITH CEDILLA
    '\xe9'     #  0x8E -> LATIN SMALL LETTER E WITH ACUTE
    '\xe8'     #  0x8F -> LATIN SMALL LETTER E WITH GRAVE
    '\xea'     #  0x90 -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xeb'     #  0x91 -> LATIN SMALL LETTER E WITH DIAERESIS
    '\xed'     #  0x92 -> LATIN SMALL LETTER I WITH ACUTE
    '\xec'     #  0x93 -> LATIN SMALL LETTER I WITH GRAVE
    '\xee'     #  0x94 -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\xef'     #  0x95 -> LATIN SMALL LETTER I WITH DIAERESIS
    '\xf1'     #  0x96 -> LATIN SMALL LETTER N WITH TILDE
    '\xf3'     #  0x97 -> LATIN SMALL LETTER O WITH ACUTE
    '\xf2'     #  0x98 -> LATIN SMALL LETTER O WITH GRAVE
    '\xf4'     #  0x99 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xf6'     #  0x9A -> LATIN SMALL LETTER O WITH DIAERESIS
    '\xf5'     #  0x9B -> LATIN SMALL LETTER O WITH TILDE
    '\xfa'     #  0x9C -> LATIN SMALL LETTER U WITH ACUTE
    '\xf9'     #  0x9D -> LATIN SMALL LETTER U WITH GRAVE
    '\xfb'     #  0x9E -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\xfc'     #  0x9F -> LATIN SMALL LETTER U WITH DIAERESIS
    '\u2020'   #  0xA0 -> DAGGER
    '\xb0'     #  0xA1 -> DEGREE SIGN
    '\xa2'     #  0xA2 -> CENT SIGN
    '\xa3'     #  0xA3 -> POUND SIGN
    '\xa7'     #  0xA4 -> SECTION SIGN
    '\u2022'   #  0xA5 -> BULLET
    '\xb6'     #  0xA6 -> PILCROW SIGN
    '\xdf'     #  0xA7 -> LATIN SMALL LETTER SHARP S
    '\xae'     #  0xA8 -> REGISTERED SIGN
    '\xa9'     #  0xA9 -> COPYRIGHT SIGN
    '\u2122'   #  0xAA -> TRADE MARK SIGN
    '\xb4'     #  0xAB -> ACUTE ACCENT
    '\xa8'     #  0xAC -> DIAERESIS
    '\u2260'   #  0xAD -> NOT EQUAL TO
    '\xc6'     #  0xAE -> LATIN CAPITAL LETTER AE
    '\xd8'     #  0xAF -> LATIN CAPITAL LETTER O WITH STROKE
    '\u221e'   #  0xB0 -> INFINITY
    '\xb1'     #  0xB1 -> PLUS-MINUS SIGN
    '\u2264'   #  0xB2 -> LESS-THAN OR EQUAL TO
    '\u2265'   #  0xB3 -> GREATER-THAN OR EQUAL TO
    '\xa5'     #  0xB4 -> YEN SIGN
    '\xb5'     #  0xB5 -> MICRO SIGN
    '\u2202'   #  0xB6 -> PARTIAL DIFFERENTIAL
    '\u2211'   #  0xB7 -> N-ARY SUMMATION
    '\u220f'   #  0xB8 -> N-ARY PRODUCT
    '\u03c0'   #  0xB9 -> GREEK SMALL LETTER PI
    '\u222b'   #  0xBA -> INTEGRAL
    '\xaa'     #  0xBB -> FEMININE ORDINAL INDICATOR
    '\xba'     #  0xBC -> MASCULINE ORDINAL INDICATOR
    '\u03a9'   #  0xBD -> GREEK CAPITAL LETTER OMEGA
    '\xe6'     #  0xBE -> LATIN SMALL LETTER AE
    '\xf8'     #  0xBF -> LATIN SMALL LETTER O WITH STROKE
    '\xbf'     #  0xC0 -> INVERTED QUESTION MARK
    '\xa1'     #  0xC1 -> INVERTED EXCLAMATION MARK
    '\xac'     #  0xC2 -> NOT SIGN
    '\u221a'   #  0xC3 -> SQUARE ROOT
    '\u0192'   #  0xC4 -> LATIN SMALL LETTER F WITH HOOK
    '\u2248'   #  0xC5 -> ALMOST EQUAL TO
    '\u2206'   #  0xC6 -> INCREMENT
    '\xab'     #  0xC7 -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbb'     #  0xC8 -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u2026'   #  0xC9 -> HORIZONTAL ELLIPSIS
    '\xa0'     #  0xCA -> NO-BREAK SPACE
    '\xc0'     #  0xCB -> LATIN CAPITAL LETTER A WITH GRAVE
    '\xc3'     #  0xCC -> LATIN CAPITAL LETTER A WITH TILDE
    '\xd5'     #  0xCD -> LATIN CAPITAL LETTER O WITH TILDE
    '\u0152'   #  0xCE -> LATIN CAPITAL LIGATURE OE
    '\u0153'   #  0xCF -> LATIN SMALL LIGATURE OE
    '\u2013'   #  0xD0 -> EN DASH
    '\u2014'   #  0xD1 -> EM DASH
    '\u201c'   #  0xD2 -> LEFT DOUBLE QUOTATION MARK
    '\u201d'   #  0xD3 -> RIGHT DOUBLE QUOTATION MARK
    '\u2018'   #  0xD4 -> LEFT SINGLE QUOTATION MARK
    '\u2019'   #  0xD5 -> RIGHT SINGLE QUOTATION MARK
    '\xf7'     #  0xD6 -> DIVISION SIGN
    '\u25ca'   #  0xD7 -> LOZENGE
    '\xff'     #  0xD8 -> LATIN SMALL LETTER Y WITH DIAERESIS
    '\u0178'   #  0xD9 -> LATIN CAPITAL LETTER Y WITH DIAERESIS
    '\u011e'   #  0xDA -> LATIN CAPITAL LETTER G WITH BREVE
    '\u011f'   #  0xDB -> LATIN SMALL LETTER G WITH BREVE
    '\u0130'   #  0xDC -> LATIN CAPITAL LETTER I WITH DOT ABOVE
    '\u0131'   #  0xDD -> LATIN SMALL LETTER DOTLESS I
    '\u015e'   #  0xDE -> LATIN CAPITAL LETTER S WITH CEDILLA
    '\u015f'   #  0xDF -> LATIN SMALL LETTER S WITH CEDILLA
    '\u2021'   #  0xE0 -> DOUBLE DAGGER
    '\xb7'     #  0xE1 -> MIDDLE DOT
    '\u201a'   #  0xE2 -> SINGLE LOW-9 QUOTATION MARK
    '\u201e'   #  0xE3 -> DOUBLE LOW-9 QUOTATION MARK
    '\u2030'   #  0xE4 -> PER MILLE SIGN
    '\xc2'     #  0xE5 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    '\xca'     #  0xE6 -> LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    '\xc1'     #  0xE7 -> LATIN CAPITAL LETTER A WITH ACUTE
    '\xcb'     #  0xE8 -> LATIN CAPITAL LETTER E WITH DIAERESIS
    '\xc8'     #  0xE9 -> LATIN CAPITAL LETTER E WITH GRAVE
    '\xcd'     #  0xEA -> LATIN CAPITAL LETTER I WITH ACUTE
    '\xce'     #  0xEB -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    '\xcf'     #  0xEC -> LATIN CAPITAL LETTER I WITH DIAERESIS
    '\xcc'     #  0xED -> LATIN CAPITAL LETTER I WITH GRAVE
    '\xd3'     #  0xEE -> LATIN CAPITAL LETTER O WITH ACUTE
    '\xd4'     #  0xEF -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    '\uf8ff'   #  0xF0 -> Apple logo
    '\xd2'     #  0xF1 -> LATIN CAPITAL LETTER O WITH GRAVE
    '\xda'     #  0xF2 -> LATIN CAPITAL LETTER U WITH ACUTE
    '\xdb'     #  0xF3 -> LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    '\xd9'     #  0xF4 -> LATIN CAPITAL LETTER U WITH GRAVE
    '\uf8a0'   #  0xF5 -> undefined1
    '\u02c6'   #  0xF6 -> MODIFIER LETTER CIRCUMFLEX ACCENT
    '\u02dc'   #  0xF7 -> SMALL TILDE
    '\xaf'     #  0xF8 -> MACRON
    '\u02d8'   #  0xF9 -> BREVE
    '\u02d9'   #  0xFA -> DOT ABOVE
    '\u02da'   #  0xFB -> RING ABOVE
    '\xb8'     #  0xFC -> CEDILLA
    '\u02dd'   #  0xFD -> DOUBLE ACUTE ACCENT
    '\u02db'   #  0xFE -> OGONEK
    '\u02c7'   #  0xFF -> CARON
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/cp874.py000064400000030463151153537620007752 0ustar00""" Python Character Mapping Codec cp874 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP874.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp874',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\u20ac'   #  0x80 -> EURO SIGN
    '\ufffe'   #  0x81 -> UNDEFINED
    '\ufffe'   #  0x82 -> UNDEFINED
    '\ufffe'   #  0x83 -> UNDEFINED
    '\ufffe'   #  0x84 -> UNDEFINED
    '\u2026'   #  0x85 -> HORIZONTAL ELLIPSIS
    '\ufffe'   #  0x86 -> UNDEFINED
    '\ufffe'   #  0x87 -> UNDEFINED
    '\ufffe'   #  0x88 -> UNDEFINED
    '\ufffe'   #  0x89 -> UNDEFINED
    '\ufffe'   #  0x8A -> UNDEFINED
    '\ufffe'   #  0x8B -> UNDEFINED
    '\ufffe'   #  0x8C -> UNDEFINED
    '\ufffe'   #  0x8D -> UNDEFINED
    '\ufffe'   #  0x8E -> UNDEFINED
    '\ufffe'   #  0x8F -> UNDEFINED
    '\ufffe'   #  0x90 -> UNDEFINED
    '\u2018'   #  0x91 -> LEFT SINGLE QUOTATION MARK
    '\u2019'   #  0x92 -> RIGHT SINGLE QUOTATION MARK
    '\u201c'   #  0x93 -> LEFT DOUBLE QUOTATION MARK
    '\u201d'   #  0x94 -> RIGHT DOUBLE QUOTATION MARK
    '\u2022'   #  0x95 -> BULLET
    '\u2013'   #  0x96 -> EN DASH
    '\u2014'   #  0x97 -> EM DASH
    '\ufffe'   #  0x98 -> UNDEFINED
    '\ufffe'   #  0x99 -> UNDEFINED
    '\ufffe'   #  0x9A -> UNDEFINED
    '\ufffe'   #  0x9B -> UNDEFINED
    '\ufffe'   #  0x9C -> UNDEFINED
    '\ufffe'   #  0x9D -> UNDEFINED
    '\ufffe'   #  0x9E -> UNDEFINED
    '\ufffe'   #  0x9F -> UNDEFINED
    '\xa0'     #  0xA0 -> NO-BREAK SPACE
    '\u0e01'   #  0xA1 -> THAI CHARACTER KO KAI
    '\u0e02'   #  0xA2 -> THAI CHARACTER KHO KHAI
    '\u0e03'   #  0xA3 -> THAI CHARACTER KHO KHUAT
    '\u0e04'   #  0xA4 -> THAI CHARACTER KHO KHWAI
    '\u0e05'   #  0xA5 -> THAI CHARACTER KHO KHON
    '\u0e06'   #  0xA6 -> THAI CHARACTER KHO RAKHANG
    '\u0e07'   #  0xA7 -> THAI CHARACTER NGO NGU
    '\u0e08'   #  0xA8 -> THAI CHARACTER CHO CHAN
    '\u0e09'   #  0xA9 -> THAI CHARACTER CHO CHING
    '\u0e0a'   #  0xAA -> THAI CHARACTER CHO CHANG
    '\u0e0b'   #  0xAB -> THAI CHARACTER SO SO
    '\u0e0c'   #  0xAC -> THAI CHARACTER CHO CHOE
    '\u0e0d'   #  0xAD -> THAI CHARACTER YO YING
    '\u0e0e'   #  0xAE -> THAI CHARACTER DO CHADA
    '\u0e0f'   #  0xAF -> THAI CHARACTER TO PATAK
    '\u0e10'   #  0xB0 -> THAI CHARACTER THO THAN
    '\u0e11'   #  0xB1 -> THAI CHARACTER THO NANGMONTHO
    '\u0e12'   #  0xB2 -> THAI CHARACTER THO PHUTHAO
    '\u0e13'   #  0xB3 -> THAI CHARACTER NO NEN
    '\u0e14'   #  0xB4 -> THAI CHARACTER DO DEK
    '\u0e15'   #  0xB5 -> THAI CHARACTER TO TAO
    '\u0e16'   #  0xB6 -> THAI CHARACTER THO THUNG
    '\u0e17'   #  0xB7 -> THAI CHARACTER THO THAHAN
    '\u0e18'   #  0xB8 -> THAI CHARACTER THO THONG
    '\u0e19'   #  0xB9 -> THAI CHARACTER NO NU
    '\u0e1a'   #  0xBA -> THAI CHARACTER BO BAIMAI
    '\u0e1b'   #  0xBB -> THAI CHARACTER PO PLA
    '\u0e1c'   #  0xBC -> THAI CHARACTER PHO PHUNG
    '\u0e1d'   #  0xBD -> THAI CHARACTER FO FA
    '\u0e1e'   #  0xBE -> THAI CHARACTER PHO PHAN
    '\u0e1f'   #  0xBF -> THAI CHARACTER FO FAN
    '\u0e20'   #  0xC0 -> THAI CHARACTER PHO SAMPHAO
    '\u0e21'   #  0xC1 -> THAI CHARACTER MO MA
    '\u0e22'   #  0xC2 -> THAI CHARACTER YO YAK
    '\u0e23'   #  0xC3 -> THAI CHARACTER RO RUA
    '\u0e24'   #  0xC4 -> THAI CHARACTER RU
    '\u0e25'   #  0xC5 -> THAI CHARACTER LO LING
    '\u0e26'   #  0xC6 -> THAI CHARACTER LU
    '\u0e27'   #  0xC7 -> THAI CHARACTER WO WAEN
    '\u0e28'   #  0xC8 -> THAI CHARACTER SO SALA
    '\u0e29'   #  0xC9 -> THAI CHARACTER SO RUSI
    '\u0e2a'   #  0xCA -> THAI CHARACTER SO SUA
    '\u0e2b'   #  0xCB -> THAI CHARACTER HO HIP
    '\u0e2c'   #  0xCC -> THAI CHARACTER LO CHULA
    '\u0e2d'   #  0xCD -> THAI CHARACTER O ANG
    '\u0e2e'   #  0xCE -> THAI CHARACTER HO NOKHUK
    '\u0e2f'   #  0xCF -> THAI CHARACTER PAIYANNOI
    '\u0e30'   #  0xD0 -> THAI CHARACTER SARA A
    '\u0e31'   #  0xD1 -> THAI CHARACTER MAI HAN-AKAT
    '\u0e32'   #  0xD2 -> THAI CHARACTER SARA AA
    '\u0e33'   #  0xD3 -> THAI CHARACTER SARA AM
    '\u0e34'   #  0xD4 -> THAI CHARACTER SARA I
    '\u0e35'   #  0xD5 -> THAI CHARACTER SARA II
    '\u0e36'   #  0xD6 -> THAI CHARACTER SARA UE
    '\u0e37'   #  0xD7 -> THAI CHARACTER SARA UEE
    '\u0e38'   #  0xD8 -> THAI CHARACTER SARA U
    '\u0e39'   #  0xD9 -> THAI CHARACTER SARA UU
    '\u0e3a'   #  0xDA -> THAI CHARACTER PHINTHU
    '\ufffe'   #  0xDB -> UNDEFINED
    '\ufffe'   #  0xDC -> UNDEFINED
    '\ufffe'   #  0xDD -> UNDEFINED
    '\ufffe'   #  0xDE -> UNDEFINED
    '\u0e3f'   #  0xDF -> THAI CURRENCY SYMBOL BAHT
    '\u0e40'   #  0xE0 -> THAI CHARACTER SARA E
    '\u0e41'   #  0xE1 -> THAI CHARACTER SARA AE
    '\u0e42'   #  0xE2 -> THAI CHARACTER SARA O
    '\u0e43'   #  0xE3 -> THAI CHARACTER SARA AI MAIMUAN
    '\u0e44'   #  0xE4 -> THAI CHARACTER SARA AI MAIMALAI
    '\u0e45'   #  0xE5 -> THAI CHARACTER LAKKHANGYAO
    '\u0e46'   #  0xE6 -> THAI CHARACTER MAIYAMOK
    '\u0e47'   #  0xE7 -> THAI CHARACTER MAITAIKHU
    '\u0e48'   #  0xE8 -> THAI CHARACTER MAI EK
    '\u0e49'   #  0xE9 -> THAI CHARACTER MAI THO
    '\u0e4a'   #  0xEA -> THAI CHARACTER MAI TRI
    '\u0e4b'   #  0xEB -> THAI CHARACTER MAI CHATTAWA
    '\u0e4c'   #  0xEC -> THAI CHARACTER THANTHAKHAT
    '\u0e4d'   #  0xED -> THAI CHARACTER NIKHAHIT
    '\u0e4e'   #  0xEE -> THAI CHARACTER YAMAKKAN
    '\u0e4f'   #  0xEF -> THAI CHARACTER FONGMAN
    '\u0e50'   #  0xF0 -> THAI DIGIT ZERO
    '\u0e51'   #  0xF1 -> THAI DIGIT ONE
    '\u0e52'   #  0xF2 -> THAI DIGIT TWO
    '\u0e53'   #  0xF3 -> THAI DIGIT THREE
    '\u0e54'   #  0xF4 -> THAI DIGIT FOUR
    '\u0e55'   #  0xF5 -> THAI DIGIT FIVE
    '\u0e56'   #  0xF6 -> THAI DIGIT SIX
    '\u0e57'   #  0xF7 -> THAI DIGIT SEVEN
    '\u0e58'   #  0xF8 -> THAI DIGIT EIGHT
    '\u0e59'   #  0xF9 -> THAI DIGIT NINE
    '\u0e5a'   #  0xFA -> THAI CHARACTER ANGKHANKHU
    '\u0e5b'   #  0xFB -> THAI CHARACTER KHOMUT
    '\ufffe'   #  0xFC -> UNDEFINED
    '\ufffe'   #  0xFD -> UNDEFINED
    '\ufffe'   #  0xFE -> UNDEFINED
    '\ufffe'   #  0xFF -> UNDEFINED
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/mac_centeuro.py000064400000033426151153537620011553 0ustar00""" Python Character Mapping Codec mac_centeuro generated from 'MAPPINGS/VENDORS/APPLE/CENTEURO.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='mac-centeuro',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> CONTROL CHARACTER
    '\x01'     #  0x01 -> CONTROL CHARACTER
    '\x02'     #  0x02 -> CONTROL CHARACTER
    '\x03'     #  0x03 -> CONTROL CHARACTER
    '\x04'     #  0x04 -> CONTROL CHARACTER
    '\x05'     #  0x05 -> CONTROL CHARACTER
    '\x06'     #  0x06 -> CONTROL CHARACTER
    '\x07'     #  0x07 -> CONTROL CHARACTER
    '\x08'     #  0x08 -> CONTROL CHARACTER
    '\t'       #  0x09 -> CONTROL CHARACTER
    '\n'       #  0x0A -> CONTROL CHARACTER
    '\x0b'     #  0x0B -> CONTROL CHARACTER
    '\x0c'     #  0x0C -> CONTROL CHARACTER
    '\r'       #  0x0D -> CONTROL CHARACTER
    '\x0e'     #  0x0E -> CONTROL CHARACTER
    '\x0f'     #  0x0F -> CONTROL CHARACTER
    '\x10'     #  0x10 -> CONTROL CHARACTER
    '\x11'     #  0x11 -> CONTROL CHARACTER
    '\x12'     #  0x12 -> CONTROL CHARACTER
    '\x13'     #  0x13 -> CONTROL CHARACTER
    '\x14'     #  0x14 -> CONTROL CHARACTER
    '\x15'     #  0x15 -> CONTROL CHARACTER
    '\x16'     #  0x16 -> CONTROL CHARACTER
    '\x17'     #  0x17 -> CONTROL CHARACTER
    '\x18'     #  0x18 -> CONTROL CHARACTER
    '\x19'     #  0x19 -> CONTROL CHARACTER
    '\x1a'     #  0x1A -> CONTROL CHARACTER
    '\x1b'     #  0x1B -> CONTROL CHARACTER
    '\x1c'     #  0x1C -> CONTROL CHARACTER
    '\x1d'     #  0x1D -> CONTROL CHARACTER
    '\x1e'     #  0x1E -> CONTROL CHARACTER
    '\x1f'     #  0x1F -> CONTROL CHARACTER
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> CONTROL CHARACTER
    '\xc4'     #  0x80 -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\u0100'   #  0x81 -> LATIN CAPITAL LETTER A WITH MACRON
    '\u0101'   #  0x82 -> LATIN SMALL LETTER A WITH MACRON
    '\xc9'     #  0x83 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\u0104'   #  0x84 -> LATIN CAPITAL LETTER A WITH OGONEK
    '\xd6'     #  0x85 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xdc'     #  0x86 -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\xe1'     #  0x87 -> LATIN SMALL LETTER A WITH ACUTE
    '\u0105'   #  0x88 -> LATIN SMALL LETTER A WITH OGONEK
    '\u010c'   #  0x89 -> LATIN CAPITAL LETTER C WITH CARON
    '\xe4'     #  0x8A -> LATIN SMALL LETTER A WITH DIAERESIS
    '\u010d'   #  0x8B -> LATIN SMALL LETTER C WITH CARON
    '\u0106'   #  0x8C -> LATIN CAPITAL LETTER C WITH ACUTE
    '\u0107'   #  0x8D -> LATIN SMALL LETTER C WITH ACUTE
    '\xe9'     #  0x8E -> LATIN SMALL LETTER E WITH ACUTE
    '\u0179'   #  0x8F -> LATIN CAPITAL LETTER Z WITH ACUTE
    '\u017a'   #  0x90 -> LATIN SMALL LETTER Z WITH ACUTE
    '\u010e'   #  0x91 -> LATIN CAPITAL LETTER D WITH CARON
    '\xed'     #  0x92 -> LATIN SMALL LETTER I WITH ACUTE
    '\u010f'   #  0x93 -> LATIN SMALL LETTER D WITH CARON
    '\u0112'   #  0x94 -> LATIN CAPITAL LETTER E WITH MACRON
    '\u0113'   #  0x95 -> LATIN SMALL LETTER E WITH MACRON
    '\u0116'   #  0x96 -> LATIN CAPITAL LETTER E WITH DOT ABOVE
    '\xf3'     #  0x97 -> LATIN SMALL LETTER O WITH ACUTE
    '\u0117'   #  0x98 -> LATIN SMALL LETTER E WITH DOT ABOVE
    '\xf4'     #  0x99 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xf6'     #  0x9A -> LATIN SMALL LETTER O WITH DIAERESIS
    '\xf5'     #  0x9B -> LATIN SMALL LETTER O WITH TILDE
    '\xfa'     #  0x9C -> LATIN SMALL LETTER U WITH ACUTE
    '\u011a'   #  0x9D -> LATIN CAPITAL LETTER E WITH CARON
    '\u011b'   #  0x9E -> LATIN SMALL LETTER E WITH CARON
    '\xfc'     #  0x9F -> LATIN SMALL LETTER U WITH DIAERESIS
    '\u2020'   #  0xA0 -> DAGGER
    '\xb0'     #  0xA1 -> DEGREE SIGN
    '\u0118'   #  0xA2 -> LATIN CAPITAL LETTER E WITH OGONEK
    '\xa3'     #  0xA3 -> POUND SIGN
    '\xa7'     #  0xA4 -> SECTION SIGN
    '\u2022'   #  0xA5 -> BULLET
    '\xb6'     #  0xA6 -> PILCROW SIGN
    '\xdf'     #  0xA7 -> LATIN SMALL LETTER SHARP S
    '\xae'     #  0xA8 -> REGISTERED SIGN
    '\xa9'     #  0xA9 -> COPYRIGHT SIGN
    '\u2122'   #  0xAA -> TRADE MARK SIGN
    '\u0119'   #  0xAB -> LATIN SMALL LETTER E WITH OGONEK
    '\xa8'     #  0xAC -> DIAERESIS
    '\u2260'   #  0xAD -> NOT EQUAL TO
    '\u0123'   #  0xAE -> LATIN SMALL LETTER G WITH CEDILLA
    '\u012e'   #  0xAF -> LATIN CAPITAL LETTER I WITH OGONEK
    '\u012f'   #  0xB0 -> LATIN SMALL LETTER I WITH OGONEK
    '\u012a'   #  0xB1 -> LATIN CAPITAL LETTER I WITH MACRON
    '\u2264'   #  0xB2 -> LESS-THAN OR EQUAL TO
    '\u2265'   #  0xB3 -> GREATER-THAN OR EQUAL TO
    '\u012b'   #  0xB4 -> LATIN SMALL LETTER I WITH MACRON
    '\u0136'   #  0xB5 -> LATIN CAPITAL LETTER K WITH CEDILLA
    '\u2202'   #  0xB6 -> PARTIAL DIFFERENTIAL
    '\u2211'   #  0xB7 -> N-ARY SUMMATION
    '\u0142'   #  0xB8 -> LATIN SMALL LETTER L WITH STROKE
    '\u013b'   #  0xB9 -> LATIN CAPITAL LETTER L WITH CEDILLA
    '\u013c'   #  0xBA -> LATIN SMALL LETTER L WITH CEDILLA
    '\u013d'   #  0xBB -> LATIN CAPITAL LETTER L WITH CARON
    '\u013e'   #  0xBC -> LATIN SMALL LETTER L WITH CARON
    '\u0139'   #  0xBD -> LATIN CAPITAL LETTER L WITH ACUTE
    '\u013a'   #  0xBE -> LATIN SMALL LETTER L WITH ACUTE
    '\u0145'   #  0xBF -> LATIN CAPITAL LETTER N WITH CEDILLA
    '\u0146'   #  0xC0 -> LATIN SMALL LETTER N WITH CEDILLA
    '\u0143'   #  0xC1 -> LATIN CAPITAL LETTER N WITH ACUTE
    '\xac'     #  0xC2 -> NOT SIGN
    '\u221a'   #  0xC3 -> SQUARE ROOT
    '\u0144'   #  0xC4 -> LATIN SMALL LETTER N WITH ACUTE
    '\u0147'   #  0xC5 -> LATIN CAPITAL LETTER N WITH CARON
    '\u2206'   #  0xC6 -> INCREMENT
    '\xab'     #  0xC7 -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbb'     #  0xC8 -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u2026'   #  0xC9 -> HORIZONTAL ELLIPSIS
    '\xa0'     #  0xCA -> NO-BREAK SPACE
    '\u0148'   #  0xCB -> LATIN SMALL LETTER N WITH CARON
    '\u0150'   #  0xCC -> LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
    '\xd5'     #  0xCD -> LATIN CAPITAL LETTER O WITH TILDE
    '\u0151'   #  0xCE -> LATIN SMALL LETTER O WITH DOUBLE ACUTE
    '\u014c'   #  0xCF -> LATIN CAPITAL LETTER O WITH MACRON
    '\u2013'   #  0xD0 -> EN DASH
    '\u2014'   #  0xD1 -> EM DASH
    '\u201c'   #  0xD2 -> LEFT DOUBLE QUOTATION MARK
    '\u201d'   #  0xD3 -> RIGHT DOUBLE QUOTATION MARK
    '\u2018'   #  0xD4 -> LEFT SINGLE QUOTATION MARK
    '\u2019'   #  0xD5 -> RIGHT SINGLE QUOTATION MARK
    '\xf7'     #  0xD6 -> DIVISION SIGN
    '\u25ca'   #  0xD7 -> LOZENGE
    '\u014d'   #  0xD8 -> LATIN SMALL LETTER O WITH MACRON
    '\u0154'   #  0xD9 -> LATIN CAPITAL LETTER R WITH ACUTE
    '\u0155'   #  0xDA -> LATIN SMALL LETTER R WITH ACUTE
    '\u0158'   #  0xDB -> LATIN CAPITAL LETTER R WITH CARON
    '\u2039'   #  0xDC -> SINGLE LEFT-POINTING ANGLE QUOTATION MARK
    '\u203a'   #  0xDD -> SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
    '\u0159'   #  0xDE -> LATIN SMALL LETTER R WITH CARON
    '\u0156'   #  0xDF -> LATIN CAPITAL LETTER R WITH CEDILLA
    '\u0157'   #  0xE0 -> LATIN SMALL LETTER R WITH CEDILLA
    '\u0160'   #  0xE1 -> LATIN CAPITAL LETTER S WITH CARON
    '\u201a'   #  0xE2 -> SINGLE LOW-9 QUOTATION MARK
    '\u201e'   #  0xE3 -> DOUBLE LOW-9 QUOTATION MARK
    '\u0161'   #  0xE4 -> LATIN SMALL LETTER S WITH CARON
    '\u015a'   #  0xE5 -> LATIN CAPITAL LETTER S WITH ACUTE
    '\u015b'   #  0xE6 -> LATIN SMALL LETTER S WITH ACUTE
    '\xc1'     #  0xE7 -> LATIN CAPITAL LETTER A WITH ACUTE
    '\u0164'   #  0xE8 -> LATIN CAPITAL LETTER T WITH CARON
    '\u0165'   #  0xE9 -> LATIN SMALL LETTER T WITH CARON
    '\xcd'     #  0xEA -> LATIN CAPITAL LETTER I WITH ACUTE
    '\u017d'   #  0xEB -> LATIN CAPITAL LETTER Z WITH CARON
    '\u017e'   #  0xEC -> LATIN SMALL LETTER Z WITH CARON
    '\u016a'   #  0xED -> LATIN CAPITAL LETTER U WITH MACRON
    '\xd3'     #  0xEE -> LATIN CAPITAL LETTER O WITH ACUTE
    '\xd4'     #  0xEF -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    '\u016b'   #  0xF0 -> LATIN SMALL LETTER U WITH MACRON
    '\u016e'   #  0xF1 -> LATIN CAPITAL LETTER U WITH RING ABOVE
    '\xda'     #  0xF2 -> LATIN CAPITAL LETTER U WITH ACUTE
    '\u016f'   #  0xF3 -> LATIN SMALL LETTER U WITH RING ABOVE
    '\u0170'   #  0xF4 -> LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
    '\u0171'   #  0xF5 -> LATIN SMALL LETTER U WITH DOUBLE ACUTE
    '\u0172'   #  0xF6 -> LATIN CAPITAL LETTER U WITH OGONEK
    '\u0173'   #  0xF7 -> LATIN SMALL LETTER U WITH OGONEK
    '\xdd'     #  0xF8 -> LATIN CAPITAL LETTER Y WITH ACUTE
    '\xfd'     #  0xF9 -> LATIN SMALL LETTER Y WITH ACUTE
    '\u0137'   #  0xFA -> LATIN SMALL LETTER K WITH CEDILLA
    '\u017b'   #  0xFB -> LATIN CAPITAL LETTER Z WITH DOT ABOVE
    '\u0141'   #  0xFC -> LATIN CAPITAL LETTER L WITH STROKE
    '\u017c'   #  0xFD -> LATIN SMALL LETTER Z WITH DOT ABOVE
    '\u0122'   #  0xFE -> LATIN CAPITAL LETTER G WITH CEDILLA
    '\u02c7'   #  0xFF -> CARON
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/cp1250.py000064400000032566151153537620010025 0ustar00""" Python Character Mapping Codec cp1250 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1250.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp1250',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\u20ac'   #  0x80 -> EURO SIGN
    '\ufffe'   #  0x81 -> UNDEFINED
    '\u201a'   #  0x82 -> SINGLE LOW-9 QUOTATION MARK
    '\ufffe'   #  0x83 -> UNDEFINED
    '\u201e'   #  0x84 -> DOUBLE LOW-9 QUOTATION MARK
    '\u2026'   #  0x85 -> HORIZONTAL ELLIPSIS
    '\u2020'   #  0x86 -> DAGGER
    '\u2021'   #  0x87 -> DOUBLE DAGGER
    '\ufffe'   #  0x88 -> UNDEFINED
    '\u2030'   #  0x89 -> PER MILLE SIGN
    '\u0160'   #  0x8A -> LATIN CAPITAL LETTER S WITH CARON
    '\u2039'   #  0x8B -> SINGLE LEFT-POINTING ANGLE QUOTATION MARK
    '\u015a'   #  0x8C -> LATIN CAPITAL LETTER S WITH ACUTE
    '\u0164'   #  0x8D -> LATIN CAPITAL LETTER T WITH CARON
    '\u017d'   #  0x8E -> LATIN CAPITAL LETTER Z WITH CARON
    '\u0179'   #  0x8F -> LATIN CAPITAL LETTER Z WITH ACUTE
    '\ufffe'   #  0x90 -> UNDEFINED
    '\u2018'   #  0x91 -> LEFT SINGLE QUOTATION MARK
    '\u2019'   #  0x92 -> RIGHT SINGLE QUOTATION MARK
    '\u201c'   #  0x93 -> LEFT DOUBLE QUOTATION MARK
    '\u201d'   #  0x94 -> RIGHT DOUBLE QUOTATION MARK
    '\u2022'   #  0x95 -> BULLET
    '\u2013'   #  0x96 -> EN DASH
    '\u2014'   #  0x97 -> EM DASH
    '\ufffe'   #  0x98 -> UNDEFINED
    '\u2122'   #  0x99 -> TRADE MARK SIGN
    '\u0161'   #  0x9A -> LATIN SMALL LETTER S WITH CARON
    '\u203a'   #  0x9B -> SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
    '\u015b'   #  0x9C -> LATIN SMALL LETTER S WITH ACUTE
    '\u0165'   #  0x9D -> LATIN SMALL LETTER T WITH CARON
    '\u017e'   #  0x9E -> LATIN SMALL LETTER Z WITH CARON
    '\u017a'   #  0x9F -> LATIN SMALL LETTER Z WITH ACUTE
    '\xa0'     #  0xA0 -> NO-BREAK SPACE
    '\u02c7'   #  0xA1 -> CARON
    '\u02d8'   #  0xA2 -> BREVE
    '\u0141'   #  0xA3 -> LATIN CAPITAL LETTER L WITH STROKE
    '\xa4'     #  0xA4 -> CURRENCY SIGN
    '\u0104'   #  0xA5 -> LATIN CAPITAL LETTER A WITH OGONEK
    '\xa6'     #  0xA6 -> BROKEN BAR
    '\xa7'     #  0xA7 -> SECTION SIGN
    '\xa8'     #  0xA8 -> DIAERESIS
    '\xa9'     #  0xA9 -> COPYRIGHT SIGN
    '\u015e'   #  0xAA -> LATIN CAPITAL LETTER S WITH CEDILLA
    '\xab'     #  0xAB -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xac'     #  0xAC -> NOT SIGN
    '\xad'     #  0xAD -> SOFT HYPHEN
    '\xae'     #  0xAE -> REGISTERED SIGN
    '\u017b'   #  0xAF -> LATIN CAPITAL LETTER Z WITH DOT ABOVE
    '\xb0'     #  0xB0 -> DEGREE SIGN
    '\xb1'     #  0xB1 -> PLUS-MINUS SIGN
    '\u02db'   #  0xB2 -> OGONEK
    '\u0142'   #  0xB3 -> LATIN SMALL LETTER L WITH STROKE
    '\xb4'     #  0xB4 -> ACUTE ACCENT
    '\xb5'     #  0xB5 -> MICRO SIGN
    '\xb6'     #  0xB6 -> PILCROW SIGN
    '\xb7'     #  0xB7 -> MIDDLE DOT
    '\xb8'     #  0xB8 -> CEDILLA
    '\u0105'   #  0xB9 -> LATIN SMALL LETTER A WITH OGONEK
    '\u015f'   #  0xBA -> LATIN SMALL LETTER S WITH CEDILLA
    '\xbb'     #  0xBB -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u013d'   #  0xBC -> LATIN CAPITAL LETTER L WITH CARON
    '\u02dd'   #  0xBD -> DOUBLE ACUTE ACCENT
    '\u013e'   #  0xBE -> LATIN SMALL LETTER L WITH CARON
    '\u017c'   #  0xBF -> LATIN SMALL LETTER Z WITH DOT ABOVE
    '\u0154'   #  0xC0 -> LATIN CAPITAL LETTER R WITH ACUTE
    '\xc1'     #  0xC1 -> LATIN CAPITAL LETTER A WITH ACUTE
    '\xc2'     #  0xC2 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    '\u0102'   #  0xC3 -> LATIN CAPITAL LETTER A WITH BREVE
    '\xc4'     #  0xC4 -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\u0139'   #  0xC5 -> LATIN CAPITAL LETTER L WITH ACUTE
    '\u0106'   #  0xC6 -> LATIN CAPITAL LETTER C WITH ACUTE
    '\xc7'     #  0xC7 -> LATIN CAPITAL LETTER C WITH CEDILLA
    '\u010c'   #  0xC8 -> LATIN CAPITAL LETTER C WITH CARON
    '\xc9'     #  0xC9 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\u0118'   #  0xCA -> LATIN CAPITAL LETTER E WITH OGONEK
    '\xcb'     #  0xCB -> LATIN CAPITAL LETTER E WITH DIAERESIS
    '\u011a'   #  0xCC -> LATIN CAPITAL LETTER E WITH CARON
    '\xcd'     #  0xCD -> LATIN CAPITAL LETTER I WITH ACUTE
    '\xce'     #  0xCE -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    '\u010e'   #  0xCF -> LATIN CAPITAL LETTER D WITH CARON
    '\u0110'   #  0xD0 -> LATIN CAPITAL LETTER D WITH STROKE
    '\u0143'   #  0xD1 -> LATIN CAPITAL LETTER N WITH ACUTE
    '\u0147'   #  0xD2 -> LATIN CAPITAL LETTER N WITH CARON
    '\xd3'     #  0xD3 -> LATIN CAPITAL LETTER O WITH ACUTE
    '\xd4'     #  0xD4 -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    '\u0150'   #  0xD5 -> LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
    '\xd6'     #  0xD6 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xd7'     #  0xD7 -> MULTIPLICATION SIGN
    '\u0158'   #  0xD8 -> LATIN CAPITAL LETTER R WITH CARON
    '\u016e'   #  0xD9 -> LATIN CAPITAL LETTER U WITH RING ABOVE
    '\xda'     #  0xDA -> LATIN CAPITAL LETTER U WITH ACUTE
    '\u0170'   #  0xDB -> LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
    '\xdc'     #  0xDC -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\xdd'     #  0xDD -> LATIN CAPITAL LETTER Y WITH ACUTE
    '\u0162'   #  0xDE -> LATIN CAPITAL LETTER T WITH CEDILLA
    '\xdf'     #  0xDF -> LATIN SMALL LETTER SHARP S
    '\u0155'   #  0xE0 -> LATIN SMALL LETTER R WITH ACUTE
    '\xe1'     #  0xE1 -> LATIN SMALL LETTER A WITH ACUTE
    '\xe2'     #  0xE2 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\u0103'   #  0xE3 -> LATIN SMALL LETTER A WITH BREVE
    '\xe4'     #  0xE4 -> LATIN SMALL LETTER A WITH DIAERESIS
    '\u013a'   #  0xE5 -> LATIN SMALL LETTER L WITH ACUTE
    '\u0107'   #  0xE6 -> LATIN SMALL LETTER C WITH ACUTE
    '\xe7'     #  0xE7 -> LATIN SMALL LETTER C WITH CEDILLA
    '\u010d'   #  0xE8 -> LATIN SMALL LETTER C WITH CARON
    '\xe9'     #  0xE9 -> LATIN SMALL LETTER E WITH ACUTE
    '\u0119'   #  0xEA -> LATIN SMALL LETTER E WITH OGONEK
    '\xeb'     #  0xEB -> LATIN SMALL LETTER E WITH DIAERESIS
    '\u011b'   #  0xEC -> LATIN SMALL LETTER E WITH CARON
    '\xed'     #  0xED -> LATIN SMALL LETTER I WITH ACUTE
    '\xee'     #  0xEE -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\u010f'   #  0xEF -> LATIN SMALL LETTER D WITH CARON
    '\u0111'   #  0xF0 -> LATIN SMALL LETTER D WITH STROKE
    '\u0144'   #  0xF1 -> LATIN SMALL LETTER N WITH ACUTE
    '\u0148'   #  0xF2 -> LATIN SMALL LETTER N WITH CARON
    '\xf3'     #  0xF3 -> LATIN SMALL LETTER O WITH ACUTE
    '\xf4'     #  0xF4 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\u0151'   #  0xF5 -> LATIN SMALL LETTER O WITH DOUBLE ACUTE
    '\xf6'     #  0xF6 -> LATIN SMALL LETTER O WITH DIAERESIS
    '\xf7'     #  0xF7 -> DIVISION SIGN
    '\u0159'   #  0xF8 -> LATIN SMALL LETTER R WITH CARON
    '\u016f'   #  0xF9 -> LATIN SMALL LETTER U WITH RING ABOVE
    '\xfa'     #  0xFA -> LATIN SMALL LETTER U WITH ACUTE
    '\u0171'   #  0xFB -> LATIN SMALL LETTER U WITH DOUBLE ACUTE
    '\xfc'     #  0xFC -> LATIN SMALL LETTER U WITH DIAERESIS
    '\xfd'     #  0xFD -> LATIN SMALL LETTER Y WITH ACUTE
    '\u0163'   #  0xFE -> LATIN SMALL LETTER T WITH CEDILLA
    '\u02d9'   #  0xFF -> DOT ABOVE
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/mac_greek.py000064400000032631151153537620011021 0ustar00""" Python Character Mapping Codec mac_greek generated from 'MAPPINGS/VENDORS/APPLE/GREEK.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='mac-greek',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> CONTROL CHARACTER
    '\x01'     #  0x01 -> CONTROL CHARACTER
    '\x02'     #  0x02 -> CONTROL CHARACTER
    '\x03'     #  0x03 -> CONTROL CHARACTER
    '\x04'     #  0x04 -> CONTROL CHARACTER
    '\x05'     #  0x05 -> CONTROL CHARACTER
    '\x06'     #  0x06 -> CONTROL CHARACTER
    '\x07'     #  0x07 -> CONTROL CHARACTER
    '\x08'     #  0x08 -> CONTROL CHARACTER
    '\t'       #  0x09 -> CONTROL CHARACTER
    '\n'       #  0x0A -> CONTROL CHARACTER
    '\x0b'     #  0x0B -> CONTROL CHARACTER
    '\x0c'     #  0x0C -> CONTROL CHARACTER
    '\r'       #  0x0D -> CONTROL CHARACTER
    '\x0e'     #  0x0E -> CONTROL CHARACTER
    '\x0f'     #  0x0F -> CONTROL CHARACTER
    '\x10'     #  0x10 -> CONTROL CHARACTER
    '\x11'     #  0x11 -> CONTROL CHARACTER
    '\x12'     #  0x12 -> CONTROL CHARACTER
    '\x13'     #  0x13 -> CONTROL CHARACTER
    '\x14'     #  0x14 -> CONTROL CHARACTER
    '\x15'     #  0x15 -> CONTROL CHARACTER
    '\x16'     #  0x16 -> CONTROL CHARACTER
    '\x17'     #  0x17 -> CONTROL CHARACTER
    '\x18'     #  0x18 -> CONTROL CHARACTER
    '\x19'     #  0x19 -> CONTROL CHARACTER
    '\x1a'     #  0x1A -> CONTROL CHARACTER
    '\x1b'     #  0x1B -> CONTROL CHARACTER
    '\x1c'     #  0x1C -> CONTROL CHARACTER
    '\x1d'     #  0x1D -> CONTROL CHARACTER
    '\x1e'     #  0x1E -> CONTROL CHARACTER
    '\x1f'     #  0x1F -> CONTROL CHARACTER
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> CONTROL CHARACTER
    '\xc4'     #  0x80 -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\xb9'     #  0x81 -> SUPERSCRIPT ONE
    '\xb2'     #  0x82 -> SUPERSCRIPT TWO
    '\xc9'     #  0x83 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\xb3'     #  0x84 -> SUPERSCRIPT THREE
    '\xd6'     #  0x85 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xdc'     #  0x86 -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\u0385'   #  0x87 -> GREEK DIALYTIKA TONOS
    '\xe0'     #  0x88 -> LATIN SMALL LETTER A WITH GRAVE
    '\xe2'     #  0x89 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\xe4'     #  0x8A -> LATIN SMALL LETTER A WITH DIAERESIS
    '\u0384'   #  0x8B -> GREEK TONOS
    '\xa8'     #  0x8C -> DIAERESIS
    '\xe7'     #  0x8D -> LATIN SMALL LETTER C WITH CEDILLA
    '\xe9'     #  0x8E -> LATIN SMALL LETTER E WITH ACUTE
    '\xe8'     #  0x8F -> LATIN SMALL LETTER E WITH GRAVE
    '\xea'     #  0x90 -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xeb'     #  0x91 -> LATIN SMALL LETTER E WITH DIAERESIS
    '\xa3'     #  0x92 -> POUND SIGN
    '\u2122'   #  0x93 -> TRADE MARK SIGN
    '\xee'     #  0x94 -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\xef'     #  0x95 -> LATIN SMALL LETTER I WITH DIAERESIS
    '\u2022'   #  0x96 -> BULLET
    '\xbd'     #  0x97 -> VULGAR FRACTION ONE HALF
    '\u2030'   #  0x98 -> PER MILLE SIGN
    '\xf4'     #  0x99 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xf6'     #  0x9A -> LATIN SMALL LETTER O WITH DIAERESIS
    '\xa6'     #  0x9B -> BROKEN BAR
    '\u20ac'   #  0x9C -> EURO SIGN # before Mac OS 9.2.2, was SOFT HYPHEN
    '\xf9'     #  0x9D -> LATIN SMALL LETTER U WITH GRAVE
    '\xfb'     #  0x9E -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\xfc'     #  0x9F -> LATIN SMALL LETTER U WITH DIAERESIS
    '\u2020'   #  0xA0 -> DAGGER
    '\u0393'   #  0xA1 -> GREEK CAPITAL LETTER GAMMA
    '\u0394'   #  0xA2 -> GREEK CAPITAL LETTER DELTA
    '\u0398'   #  0xA3 -> GREEK CAPITAL LETTER THETA
    '\u039b'   #  0xA4 -> GREEK CAPITAL LETTER LAMDA
    '\u039e'   #  0xA5 -> GREEK CAPITAL LETTER XI
    '\u03a0'   #  0xA6 -> GREEK CAPITAL LETTER PI
    '\xdf'     #  0xA7 -> LATIN SMALL LETTER SHARP S
    '\xae'     #  0xA8 -> REGISTERED SIGN
    '\xa9'     #  0xA9 -> COPYRIGHT SIGN
    '\u03a3'   #  0xAA -> GREEK CAPITAL LETTER SIGMA
    '\u03aa'   #  0xAB -> GREEK CAPITAL LETTER IOTA WITH DIALYTIKA
    '\xa7'     #  0xAC -> SECTION SIGN
    '\u2260'   #  0xAD -> NOT EQUAL TO
    '\xb0'     #  0xAE -> DEGREE SIGN
    '\xb7'     #  0xAF -> MIDDLE DOT
    '\u0391'   #  0xB0 -> GREEK CAPITAL LETTER ALPHA
    '\xb1'     #  0xB1 -> PLUS-MINUS SIGN
    '\u2264'   #  0xB2 -> LESS-THAN OR EQUAL TO
    '\u2265'   #  0xB3 -> GREATER-THAN OR EQUAL TO
    '\xa5'     #  0xB4 -> YEN SIGN
    '\u0392'   #  0xB5 -> GREEK CAPITAL LETTER BETA
    '\u0395'   #  0xB6 -> GREEK CAPITAL LETTER EPSILON
    '\u0396'   #  0xB7 -> GREEK CAPITAL LETTER ZETA
    '\u0397'   #  0xB8 -> GREEK CAPITAL LETTER ETA
    '\u0399'   #  0xB9 -> GREEK CAPITAL LETTER IOTA
    '\u039a'   #  0xBA -> GREEK CAPITAL LETTER KAPPA
    '\u039c'   #  0xBB -> GREEK CAPITAL LETTER MU
    '\u03a6'   #  0xBC -> GREEK CAPITAL LETTER PHI
    '\u03ab'   #  0xBD -> GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA
    '\u03a8'   #  0xBE -> GREEK CAPITAL LETTER PSI
    '\u03a9'   #  0xBF -> GREEK CAPITAL LETTER OMEGA
    '\u03ac'   #  0xC0 -> GREEK SMALL LETTER ALPHA WITH TONOS
    '\u039d'   #  0xC1 -> GREEK CAPITAL LETTER NU
    '\xac'     #  0xC2 -> NOT SIGN
    '\u039f'   #  0xC3 -> GREEK CAPITAL LETTER OMICRON
    '\u03a1'   #  0xC4 -> GREEK CAPITAL LETTER RHO
    '\u2248'   #  0xC5 -> ALMOST EQUAL TO
    '\u03a4'   #  0xC6 -> GREEK CAPITAL LETTER TAU
    '\xab'     #  0xC7 -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbb'     #  0xC8 -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u2026'   #  0xC9 -> HORIZONTAL ELLIPSIS
    '\xa0'     #  0xCA -> NO-BREAK SPACE
    '\u03a5'   #  0xCB -> GREEK CAPITAL LETTER UPSILON
    '\u03a7'   #  0xCC -> GREEK CAPITAL LETTER CHI
    '\u0386'   #  0xCD -> GREEK CAPITAL LETTER ALPHA WITH TONOS
    '\u0388'   #  0xCE -> GREEK CAPITAL LETTER EPSILON WITH TONOS
    '\u0153'   #  0xCF -> LATIN SMALL LIGATURE OE
    '\u2013'   #  0xD0 -> EN DASH
    '\u2015'   #  0xD1 -> HORIZONTAL BAR
    '\u201c'   #  0xD2 -> LEFT DOUBLE QUOTATION MARK
    '\u201d'   #  0xD3 -> RIGHT DOUBLE QUOTATION MARK
    '\u2018'   #  0xD4 -> LEFT SINGLE QUOTATION MARK
    '\u2019'   #  0xD5 -> RIGHT SINGLE QUOTATION MARK
    '\xf7'     #  0xD6 -> DIVISION SIGN
    '\u0389'   #  0xD7 -> GREEK CAPITAL LETTER ETA WITH TONOS
    '\u038a'   #  0xD8 -> GREEK CAPITAL LETTER IOTA WITH TONOS
    '\u038c'   #  0xD9 -> GREEK CAPITAL LETTER OMICRON WITH TONOS
    '\u038e'   #  0xDA -> GREEK CAPITAL LETTER UPSILON WITH TONOS
    '\u03ad'   #  0xDB -> GREEK SMALL LETTER EPSILON WITH TONOS
    '\u03ae'   #  0xDC -> GREEK SMALL LETTER ETA WITH TONOS
    '\u03af'   #  0xDD -> GREEK SMALL LETTER IOTA WITH TONOS
    '\u03cc'   #  0xDE -> GREEK SMALL LETTER OMICRON WITH TONOS
    '\u038f'   #  0xDF -> GREEK CAPITAL LETTER OMEGA WITH TONOS
    '\u03cd'   #  0xE0 -> GREEK SMALL LETTER UPSILON WITH TONOS
    '\u03b1'   #  0xE1 -> GREEK SMALL LETTER ALPHA
    '\u03b2'   #  0xE2 -> GREEK SMALL LETTER BETA
    '\u03c8'   #  0xE3 -> GREEK SMALL LETTER PSI
    '\u03b4'   #  0xE4 -> GREEK SMALL LETTER DELTA
    '\u03b5'   #  0xE5 -> GREEK SMALL LETTER EPSILON
    '\u03c6'   #  0xE6 -> GREEK SMALL LETTER PHI
    '\u03b3'   #  0xE7 -> GREEK SMALL LETTER GAMMA
    '\u03b7'   #  0xE8 -> GREEK SMALL LETTER ETA
    '\u03b9'   #  0xE9 -> GREEK SMALL LETTER IOTA
    '\u03be'   #  0xEA -> GREEK SMALL LETTER XI
    '\u03ba'   #  0xEB -> GREEK SMALL LETTER KAPPA
    '\u03bb'   #  0xEC -> GREEK SMALL LETTER LAMDA
    '\u03bc'   #  0xED -> GREEK SMALL LETTER MU
    '\u03bd'   #  0xEE -> GREEK SMALL LETTER NU
    '\u03bf'   #  0xEF -> GREEK SMALL LETTER OMICRON
    '\u03c0'   #  0xF0 -> GREEK SMALL LETTER PI
    '\u03ce'   #  0xF1 -> GREEK SMALL LETTER OMEGA WITH TONOS
    '\u03c1'   #  0xF2 -> GREEK SMALL LETTER RHO
    '\u03c3'   #  0xF3 -> GREEK SMALL LETTER SIGMA
    '\u03c4'   #  0xF4 -> GREEK SMALL LETTER TAU
    '\u03b8'   #  0xF5 -> GREEK SMALL LETTER THETA
    '\u03c9'   #  0xF6 -> GREEK SMALL LETTER OMEGA
    '\u03c2'   #  0xF7 -> GREEK SMALL LETTER FINAL SIGMA
    '\u03c7'   #  0xF8 -> GREEK SMALL LETTER CHI
    '\u03c5'   #  0xF9 -> GREEK SMALL LETTER UPSILON
    '\u03b6'   #  0xFA -> GREEK SMALL LETTER ZETA
    '\u03ca'   #  0xFB -> GREEK SMALL LETTER IOTA WITH DIALYTIKA
    '\u03cb'   #  0xFC -> GREEK SMALL LETTER UPSILON WITH DIALYTIKA
    '\u0390'   #  0xFD -> GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
    '\u03b0'   #  0xFE -> GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
    '\xad'     #  0xFF -> SOFT HYPHEN # before Mac OS 9.2.2, was undefined
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/iso8859_7.py000064400000031054151153537620010460 0ustar00""" Python Character Mapping Codec iso8859_7 generated from 'MAPPINGS/ISO8859/8859-7.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='iso8859-7',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\x80'     #  0x80 -> <control>
    '\x81'     #  0x81 -> <control>
    '\x82'     #  0x82 -> <control>
    '\x83'     #  0x83 -> <control>
    '\x84'     #  0x84 -> <control>
    '\x85'     #  0x85 -> <control>
    '\x86'     #  0x86 -> <control>
    '\x87'     #  0x87 -> <control>
    '\x88'     #  0x88 -> <control>
    '\x89'     #  0x89 -> <control>
    '\x8a'     #  0x8A -> <control>
    '\x8b'     #  0x8B -> <control>
    '\x8c'     #  0x8C -> <control>
    '\x8d'     #  0x8D -> <control>
    '\x8e'     #  0x8E -> <control>
    '\x8f'     #  0x8F -> <control>
    '\x90'     #  0x90 -> <control>
    '\x91'     #  0x91 -> <control>
    '\x92'     #  0x92 -> <control>
    '\x93'     #  0x93 -> <control>
    '\x94'     #  0x94 -> <control>
    '\x95'     #  0x95 -> <control>
    '\x96'     #  0x96 -> <control>
    '\x97'     #  0x97 -> <control>
    '\x98'     #  0x98 -> <control>
    '\x99'     #  0x99 -> <control>
    '\x9a'     #  0x9A -> <control>
    '\x9b'     #  0x9B -> <control>
    '\x9c'     #  0x9C -> <control>
    '\x9d'     #  0x9D -> <control>
    '\x9e'     #  0x9E -> <control>
    '\x9f'     #  0x9F -> <control>
    '\xa0'     #  0xA0 -> NO-BREAK SPACE
    '\u2018'   #  0xA1 -> LEFT SINGLE QUOTATION MARK
    '\u2019'   #  0xA2 -> RIGHT SINGLE QUOTATION MARK
    '\xa3'     #  0xA3 -> POUND SIGN
    '\u20ac'   #  0xA4 -> EURO SIGN
    '\u20af'   #  0xA5 -> DRACHMA SIGN
    '\xa6'     #  0xA6 -> BROKEN BAR
    '\xa7'     #  0xA7 -> SECTION SIGN
    '\xa8'     #  0xA8 -> DIAERESIS
    '\xa9'     #  0xA9 -> COPYRIGHT SIGN
    '\u037a'   #  0xAA -> GREEK YPOGEGRAMMENI
    '\xab'     #  0xAB -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xac'     #  0xAC -> NOT SIGN
    '\xad'     #  0xAD -> SOFT HYPHEN
    '\ufffe'
    '\u2015'   #  0xAF -> HORIZONTAL BAR
    '\xb0'     #  0xB0 -> DEGREE SIGN
    '\xb1'     #  0xB1 -> PLUS-MINUS SIGN
    '\xb2'     #  0xB2 -> SUPERSCRIPT TWO
    '\xb3'     #  0xB3 -> SUPERSCRIPT THREE
    '\u0384'   #  0xB4 -> GREEK TONOS
    '\u0385'   #  0xB5 -> GREEK DIALYTIKA TONOS
    '\u0386'   #  0xB6 -> GREEK CAPITAL LETTER ALPHA WITH TONOS
    '\xb7'     #  0xB7 -> MIDDLE DOT
    '\u0388'   #  0xB8 -> GREEK CAPITAL LETTER EPSILON WITH TONOS
    '\u0389'   #  0xB9 -> GREEK CAPITAL LETTER ETA WITH TONOS
    '\u038a'   #  0xBA -> GREEK CAPITAL LETTER IOTA WITH TONOS
    '\xbb'     #  0xBB -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u038c'   #  0xBC -> GREEK CAPITAL LETTER OMICRON WITH TONOS
    '\xbd'     #  0xBD -> VULGAR FRACTION ONE HALF
    '\u038e'   #  0xBE -> GREEK CAPITAL LETTER UPSILON WITH TONOS
    '\u038f'   #  0xBF -> GREEK CAPITAL LETTER OMEGA WITH TONOS
    '\u0390'   #  0xC0 -> GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
    '\u0391'   #  0xC1 -> GREEK CAPITAL LETTER ALPHA
    '\u0392'   #  0xC2 -> GREEK CAPITAL LETTER BETA
    '\u0393'   #  0xC3 -> GREEK CAPITAL LETTER GAMMA
    '\u0394'   #  0xC4 -> GREEK CAPITAL LETTER DELTA
    '\u0395'   #  0xC5 -> GREEK CAPITAL LETTER EPSILON
    '\u0396'   #  0xC6 -> GREEK CAPITAL LETTER ZETA
    '\u0397'   #  0xC7 -> GREEK CAPITAL LETTER ETA
    '\u0398'   #  0xC8 -> GREEK CAPITAL LETTER THETA
    '\u0399'   #  0xC9 -> GREEK CAPITAL LETTER IOTA
    '\u039a'   #  0xCA -> GREEK CAPITAL LETTER KAPPA
    '\u039b'   #  0xCB -> GREEK CAPITAL LETTER LAMDA
    '\u039c'   #  0xCC -> GREEK CAPITAL LETTER MU
    '\u039d'   #  0xCD -> GREEK CAPITAL LETTER NU
    '\u039e'   #  0xCE -> GREEK CAPITAL LETTER XI
    '\u039f'   #  0xCF -> GREEK CAPITAL LETTER OMICRON
    '\u03a0'   #  0xD0 -> GREEK CAPITAL LETTER PI
    '\u03a1'   #  0xD1 -> GREEK CAPITAL LETTER RHO
    '\ufffe'
    '\u03a3'   #  0xD3 -> GREEK CAPITAL LETTER SIGMA
    '\u03a4'   #  0xD4 -> GREEK CAPITAL LETTER TAU
    '\u03a5'   #  0xD5 -> GREEK CAPITAL LETTER UPSILON
    '\u03a6'   #  0xD6 -> GREEK CAPITAL LETTER PHI
    '\u03a7'   #  0xD7 -> GREEK CAPITAL LETTER CHI
    '\u03a8'   #  0xD8 -> GREEK CAPITAL LETTER PSI
    '\u03a9'   #  0xD9 -> GREEK CAPITAL LETTER OMEGA
    '\u03aa'   #  0xDA -> GREEK CAPITAL LETTER IOTA WITH DIALYTIKA
    '\u03ab'   #  0xDB -> GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA
    '\u03ac'   #  0xDC -> GREEK SMALL LETTER ALPHA WITH TONOS
    '\u03ad'   #  0xDD -> GREEK SMALL LETTER EPSILON WITH TONOS
    '\u03ae'   #  0xDE -> GREEK SMALL LETTER ETA WITH TONOS
    '\u03af'   #  0xDF -> GREEK SMALL LETTER IOTA WITH TONOS
    '\u03b0'   #  0xE0 -> GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
    '\u03b1'   #  0xE1 -> GREEK SMALL LETTER ALPHA
    '\u03b2'   #  0xE2 -> GREEK SMALL LETTER BETA
    '\u03b3'   #  0xE3 -> GREEK SMALL LETTER GAMMA
    '\u03b4'   #  0xE4 -> GREEK SMALL LETTER DELTA
    '\u03b5'   #  0xE5 -> GREEK SMALL LETTER EPSILON
    '\u03b6'   #  0xE6 -> GREEK SMALL LETTER ZETA
    '\u03b7'   #  0xE7 -> GREEK SMALL LETTER ETA
    '\u03b8'   #  0xE8 -> GREEK SMALL LETTER THETA
    '\u03b9'   #  0xE9 -> GREEK SMALL LETTER IOTA
    '\u03ba'   #  0xEA -> GREEK SMALL LETTER KAPPA
    '\u03bb'   #  0xEB -> GREEK SMALL LETTER LAMDA
    '\u03bc'   #  0xEC -> GREEK SMALL LETTER MU
    '\u03bd'   #  0xED -> GREEK SMALL LETTER NU
    '\u03be'   #  0xEE -> GREEK SMALL LETTER XI
    '\u03bf'   #  0xEF -> GREEK SMALL LETTER OMICRON
    '\u03c0'   #  0xF0 -> GREEK SMALL LETTER PI
    '\u03c1'   #  0xF1 -> GREEK SMALL LETTER RHO
    '\u03c2'   #  0xF2 -> GREEK SMALL LETTER FINAL SIGMA
    '\u03c3'   #  0xF3 -> GREEK SMALL LETTER SIGMA
    '\u03c4'   #  0xF4 -> GREEK SMALL LETTER TAU
    '\u03c5'   #  0xF5 -> GREEK SMALL LETTER UPSILON
    '\u03c6'   #  0xF6 -> GREEK SMALL LETTER PHI
    '\u03c7'   #  0xF7 -> GREEK SMALL LETTER CHI
    '\u03c8'   #  0xF8 -> GREEK SMALL LETTER PSI
    '\u03c9'   #  0xF9 -> GREEK SMALL LETTER OMEGA
    '\u03ca'   #  0xFA -> GREEK SMALL LETTER IOTA WITH DIALYTIKA
    '\u03cb'   #  0xFB -> GREEK SMALL LETTER UPSILON WITH DIALYTIKA
    '\u03cc'   #  0xFC -> GREEK SMALL LETTER OMICRON WITH TONOS
    '\u03cd'   #  0xFD -> GREEK SMALL LETTER UPSILON WITH TONOS
    '\u03ce'   #  0xFE -> GREEK SMALL LETTER OMEGA WITH TONOS
    '\ufffe'
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/iso2022_jp_2.py000064400000002045151153537620011112 0ustar00#
# iso2022_jp_2.py: Python Unicode Codec for ISO2022_JP_2
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#

import _codecs_iso2022, codecs
import _multibytecodec as mbc

codec = _codecs_iso2022.getcodec('iso2022_jp_2')

class Codec(codecs.Codec):
    encode = codec.encode
    decode = codec.decode

class IncrementalEncoder(mbc.MultibyteIncrementalEncoder,
                         codecs.IncrementalEncoder):
    codec = codec

class IncrementalDecoder(mbc.MultibyteIncrementalDecoder,
                         codecs.IncrementalDecoder):
    codec = codec

class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader):
    codec = codec

class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
    codec = codec

def getregentry():
    return codecs.CodecInfo(
        name='iso2022_jp_2',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/utf_8_sig.py000064400000010045151153537620010766 0ustar00""" Python 'utf-8-sig' Codec
This work similar to UTF-8 with the following changes:

* On encoding/writing a UTF-8 encoded BOM will be prepended/written as the
  first three bytes.

* On decoding/reading if the first three bytes are a UTF-8 encoded BOM, these
  bytes will be skipped.
"""
import codecs

### Codec APIs

def encode(input, errors='strict'):
    return (codecs.BOM_UTF8 + codecs.utf_8_encode(input, errors)[0],
            len(input))

def decode(input, errors='strict'):
    prefix = 0
    if input[:3] == codecs.BOM_UTF8:
        input = input[3:]
        prefix = 3
    (output, consumed) = codecs.utf_8_decode(input, errors, True)
    return (output, consumed+prefix)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def __init__(self, errors='strict'):
        codecs.IncrementalEncoder.__init__(self, errors)
        self.first = 1

    def encode(self, input, final=False):
        if self.first:
            self.first = 0
            return codecs.BOM_UTF8 + \
                   codecs.utf_8_encode(input, self.errors)[0]
        else:
            return codecs.utf_8_encode(input, self.errors)[0]

    def reset(self):
        codecs.IncrementalEncoder.reset(self)
        self.first = 1

    def getstate(self):
        return self.first

    def setstate(self, state):
        self.first = state

class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
    def __init__(self, errors='strict'):
        codecs.BufferedIncrementalDecoder.__init__(self, errors)
        self.first = 1

    def _buffer_decode(self, input, errors, final):
        if self.first:
            if len(input) < 3:
                if codecs.BOM_UTF8.startswith(input):
                    # not enough data to decide if this really is a BOM
                    # => try again on the next call
                    return ("", 0)
                else:
                    self.first = 0
            else:
                self.first = 0
                if input[:3] == codecs.BOM_UTF8:
                    (output, consumed) = \
                       codecs.utf_8_decode(input[3:], errors, final)
                    return (output, consumed+3)
        return codecs.utf_8_decode(input, errors, final)

    def reset(self):
        codecs.BufferedIncrementalDecoder.reset(self)
        self.first = 1

    def getstate(self):
        state = codecs.BufferedIncrementalDecoder.getstate(self)
        # state[1] must be 0 here, as it isn't passed along to the caller
        return (state[0], self.first)

    def setstate(self, state):
        # state[1] will be ignored by BufferedIncrementalDecoder.setstate()
        codecs.BufferedIncrementalDecoder.setstate(self, state)
        self.first = state[1]

class StreamWriter(codecs.StreamWriter):
    def reset(self):
        codecs.StreamWriter.reset(self)
        try:
            del self.encode
        except AttributeError:
            pass

    def encode(self, input, errors='strict'):
        self.encode = codecs.utf_8_encode
        return encode(input, errors)

class StreamReader(codecs.StreamReader):
    def reset(self):
        codecs.StreamReader.reset(self)
        try:
            del self.decode
        except AttributeError:
            pass

    def decode(self, input, errors='strict'):
        if len(input) < 3:
            if codecs.BOM_UTF8.startswith(input):
                # not enough data to decide if this is a BOM
                # => try again on the next call
                return ("", 0)
        elif input[:3] == codecs.BOM_UTF8:
            self.decode = codecs.utf_8_decode
            (output, consumed) = codecs.utf_8_decode(input[3:],errors)
            return (output, consumed+3)
        # (else) no BOM present
        self.decode = codecs.utf_8_decode
        return codecs.utf_8_decode(input, errors)

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='utf-8-sig',
        encode=encode,
        decode=decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/ascii.py000064400000002340151153537620010166 0ustar00""" Python 'ascii' Codec


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

"""
import codecs

### Codec APIs

class Codec(codecs.Codec):

    # Note: Binding these as C functions will result in the class not
    # converting them to methods. This is intended.
    encode = codecs.ascii_encode
    decode = codecs.ascii_decode

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.ascii_encode(input, self.errors)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.ascii_decode(input, self.errors)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

class StreamConverter(StreamWriter,StreamReader):

    encode = codecs.ascii_decode
    decode = codecs.ascii_encode

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='ascii',
        encode=Codec.encode,
        decode=Codec.decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamwriter=StreamWriter,
        streamreader=StreamReader,
    )
encodings/cp866.py000064400000103134151153537620007747 0ustar00""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP866.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_map)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_map)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp866',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )

### Decoding Map

decoding_map = codecs.make_identity_dict(range(256))
decoding_map.update({
    0x0080: 0x0410,     #  CYRILLIC CAPITAL LETTER A
    0x0081: 0x0411,     #  CYRILLIC CAPITAL LETTER BE
    0x0082: 0x0412,     #  CYRILLIC CAPITAL LETTER VE
    0x0083: 0x0413,     #  CYRILLIC CAPITAL LETTER GHE
    0x0084: 0x0414,     #  CYRILLIC CAPITAL LETTER DE
    0x0085: 0x0415,     #  CYRILLIC CAPITAL LETTER IE
    0x0086: 0x0416,     #  CYRILLIC CAPITAL LETTER ZHE
    0x0087: 0x0417,     #  CYRILLIC CAPITAL LETTER ZE
    0x0088: 0x0418,     #  CYRILLIC CAPITAL LETTER I
    0x0089: 0x0419,     #  CYRILLIC CAPITAL LETTER SHORT I
    0x008a: 0x041a,     #  CYRILLIC CAPITAL LETTER KA
    0x008b: 0x041b,     #  CYRILLIC CAPITAL LETTER EL
    0x008c: 0x041c,     #  CYRILLIC CAPITAL LETTER EM
    0x008d: 0x041d,     #  CYRILLIC CAPITAL LETTER EN
    0x008e: 0x041e,     #  CYRILLIC CAPITAL LETTER O
    0x008f: 0x041f,     #  CYRILLIC CAPITAL LETTER PE
    0x0090: 0x0420,     #  CYRILLIC CAPITAL LETTER ER
    0x0091: 0x0421,     #  CYRILLIC CAPITAL LETTER ES
    0x0092: 0x0422,     #  CYRILLIC CAPITAL LETTER TE
    0x0093: 0x0423,     #  CYRILLIC CAPITAL LETTER U
    0x0094: 0x0424,     #  CYRILLIC CAPITAL LETTER EF
    0x0095: 0x0425,     #  CYRILLIC CAPITAL LETTER HA
    0x0096: 0x0426,     #  CYRILLIC CAPITAL LETTER TSE
    0x0097: 0x0427,     #  CYRILLIC CAPITAL LETTER CHE
    0x0098: 0x0428,     #  CYRILLIC CAPITAL LETTER SHA
    0x0099: 0x0429,     #  CYRILLIC CAPITAL LETTER SHCHA
    0x009a: 0x042a,     #  CYRILLIC CAPITAL LETTER HARD SIGN
    0x009b: 0x042b,     #  CYRILLIC CAPITAL LETTER YERU
    0x009c: 0x042c,     #  CYRILLIC CAPITAL LETTER SOFT SIGN
    0x009d: 0x042d,     #  CYRILLIC CAPITAL LETTER E
    0x009e: 0x042e,     #  CYRILLIC CAPITAL LETTER YU
    0x009f: 0x042f,     #  CYRILLIC CAPITAL LETTER YA
    0x00a0: 0x0430,     #  CYRILLIC SMALL LETTER A
    0x00a1: 0x0431,     #  CYRILLIC SMALL LETTER BE
    0x00a2: 0x0432,     #  CYRILLIC SMALL LETTER VE
    0x00a3: 0x0433,     #  CYRILLIC SMALL LETTER GHE
    0x00a4: 0x0434,     #  CYRILLIC SMALL LETTER DE
    0x00a5: 0x0435,     #  CYRILLIC SMALL LETTER IE
    0x00a6: 0x0436,     #  CYRILLIC SMALL LETTER ZHE
    0x00a7: 0x0437,     #  CYRILLIC SMALL LETTER ZE
    0x00a8: 0x0438,     #  CYRILLIC SMALL LETTER I
    0x00a9: 0x0439,     #  CYRILLIC SMALL LETTER SHORT I
    0x00aa: 0x043a,     #  CYRILLIC SMALL LETTER KA
    0x00ab: 0x043b,     #  CYRILLIC SMALL LETTER EL
    0x00ac: 0x043c,     #  CYRILLIC SMALL LETTER EM
    0x00ad: 0x043d,     #  CYRILLIC SMALL LETTER EN
    0x00ae: 0x043e,     #  CYRILLIC SMALL LETTER O
    0x00af: 0x043f,     #  CYRILLIC SMALL LETTER PE
    0x00b0: 0x2591,     #  LIGHT SHADE
    0x00b1: 0x2592,     #  MEDIUM SHADE
    0x00b2: 0x2593,     #  DARK SHADE
    0x00b3: 0x2502,     #  BOX DRAWINGS LIGHT VERTICAL
    0x00b4: 0x2524,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
    0x00b5: 0x2561,     #  BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
    0x00b6: 0x2562,     #  BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
    0x00b7: 0x2556,     #  BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
    0x00b8: 0x2555,     #  BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
    0x00b9: 0x2563,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    0x00ba: 0x2551,     #  BOX DRAWINGS DOUBLE VERTICAL
    0x00bb: 0x2557,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
    0x00bc: 0x255d,     #  BOX DRAWINGS DOUBLE UP AND LEFT
    0x00bd: 0x255c,     #  BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
    0x00be: 0x255b,     #  BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
    0x00bf: 0x2510,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
    0x00c0: 0x2514,     #  BOX DRAWINGS LIGHT UP AND RIGHT
    0x00c1: 0x2534,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
    0x00c2: 0x252c,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    0x00c3: 0x251c,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    0x00c4: 0x2500,     #  BOX DRAWINGS LIGHT HORIZONTAL
    0x00c5: 0x253c,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    0x00c6: 0x255e,     #  BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
    0x00c7: 0x255f,     #  BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
    0x00c8: 0x255a,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
    0x00c9: 0x2554,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
    0x00ca: 0x2569,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    0x00cb: 0x2566,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    0x00cc: 0x2560,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    0x00cd: 0x2550,     #  BOX DRAWINGS DOUBLE HORIZONTAL
    0x00ce: 0x256c,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    0x00cf: 0x2567,     #  BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
    0x00d0: 0x2568,     #  BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
    0x00d1: 0x2564,     #  BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
    0x00d2: 0x2565,     #  BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
    0x00d3: 0x2559,     #  BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
    0x00d4: 0x2558,     #  BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
    0x00d5: 0x2552,     #  BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
    0x00d6: 0x2553,     #  BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
    0x00d7: 0x256b,     #  BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
    0x00d8: 0x256a,     #  BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
    0x00d9: 0x2518,     #  BOX DRAWINGS LIGHT UP AND LEFT
    0x00da: 0x250c,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
    0x00db: 0x2588,     #  FULL BLOCK
    0x00dc: 0x2584,     #  LOWER HALF BLOCK
    0x00dd: 0x258c,     #  LEFT HALF BLOCK
    0x00de: 0x2590,     #  RIGHT HALF BLOCK
    0x00df: 0x2580,     #  UPPER HALF BLOCK
    0x00e0: 0x0440,     #  CYRILLIC SMALL LETTER ER
    0x00e1: 0x0441,     #  CYRILLIC SMALL LETTER ES
    0x00e2: 0x0442,     #  CYRILLIC SMALL LETTER TE
    0x00e3: 0x0443,     #  CYRILLIC SMALL LETTER U
    0x00e4: 0x0444,     #  CYRILLIC SMALL LETTER EF
    0x00e5: 0x0445,     #  CYRILLIC SMALL LETTER HA
    0x00e6: 0x0446,     #  CYRILLIC SMALL LETTER TSE
    0x00e7: 0x0447,     #  CYRILLIC SMALL LETTER CHE
    0x00e8: 0x0448,     #  CYRILLIC SMALL LETTER SHA
    0x00e9: 0x0449,     #  CYRILLIC SMALL LETTER SHCHA
    0x00ea: 0x044a,     #  CYRILLIC SMALL LETTER HARD SIGN
    0x00eb: 0x044b,     #  CYRILLIC SMALL LETTER YERU
    0x00ec: 0x044c,     #  CYRILLIC SMALL LETTER SOFT SIGN
    0x00ed: 0x044d,     #  CYRILLIC SMALL LETTER E
    0x00ee: 0x044e,     #  CYRILLIC SMALL LETTER YU
    0x00ef: 0x044f,     #  CYRILLIC SMALL LETTER YA
    0x00f0: 0x0401,     #  CYRILLIC CAPITAL LETTER IO
    0x00f1: 0x0451,     #  CYRILLIC SMALL LETTER IO
    0x00f2: 0x0404,     #  CYRILLIC CAPITAL LETTER UKRAINIAN IE
    0x00f3: 0x0454,     #  CYRILLIC SMALL LETTER UKRAINIAN IE
    0x00f4: 0x0407,     #  CYRILLIC CAPITAL LETTER YI
    0x00f5: 0x0457,     #  CYRILLIC SMALL LETTER YI
    0x00f6: 0x040e,     #  CYRILLIC CAPITAL LETTER SHORT U
    0x00f7: 0x045e,     #  CYRILLIC SMALL LETTER SHORT U
    0x00f8: 0x00b0,     #  DEGREE SIGN
    0x00f9: 0x2219,     #  BULLET OPERATOR
    0x00fa: 0x00b7,     #  MIDDLE DOT
    0x00fb: 0x221a,     #  SQUARE ROOT
    0x00fc: 0x2116,     #  NUMERO SIGN
    0x00fd: 0x00a4,     #  CURRENCY SIGN
    0x00fe: 0x25a0,     #  BLACK SQUARE
    0x00ff: 0x00a0,     #  NO-BREAK SPACE
})

### Decoding Table

decoding_table = (
    '\x00'     #  0x0000 -> NULL
    '\x01'     #  0x0001 -> START OF HEADING
    '\x02'     #  0x0002 -> START OF TEXT
    '\x03'     #  0x0003 -> END OF TEXT
    '\x04'     #  0x0004 -> END OF TRANSMISSION
    '\x05'     #  0x0005 -> ENQUIRY
    '\x06'     #  0x0006 -> ACKNOWLEDGE
    '\x07'     #  0x0007 -> BELL
    '\x08'     #  0x0008 -> BACKSPACE
    '\t'       #  0x0009 -> HORIZONTAL TABULATION
    '\n'       #  0x000a -> LINE FEED
    '\x0b'     #  0x000b -> VERTICAL TABULATION
    '\x0c'     #  0x000c -> FORM FEED
    '\r'       #  0x000d -> CARRIAGE RETURN
    '\x0e'     #  0x000e -> SHIFT OUT
    '\x0f'     #  0x000f -> SHIFT IN
    '\x10'     #  0x0010 -> DATA LINK ESCAPE
    '\x11'     #  0x0011 -> DEVICE CONTROL ONE
    '\x12'     #  0x0012 -> DEVICE CONTROL TWO
    '\x13'     #  0x0013 -> DEVICE CONTROL THREE
    '\x14'     #  0x0014 -> DEVICE CONTROL FOUR
    '\x15'     #  0x0015 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x0016 -> SYNCHRONOUS IDLE
    '\x17'     #  0x0017 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x0018 -> CANCEL
    '\x19'     #  0x0019 -> END OF MEDIUM
    '\x1a'     #  0x001a -> SUBSTITUTE
    '\x1b'     #  0x001b -> ESCAPE
    '\x1c'     #  0x001c -> FILE SEPARATOR
    '\x1d'     #  0x001d -> GROUP SEPARATOR
    '\x1e'     #  0x001e -> RECORD SEPARATOR
    '\x1f'     #  0x001f -> UNIT SEPARATOR
    ' '        #  0x0020 -> SPACE
    '!'        #  0x0021 -> EXCLAMATION MARK
    '"'        #  0x0022 -> QUOTATION MARK
    '#'        #  0x0023 -> NUMBER SIGN
    '$'        #  0x0024 -> DOLLAR SIGN
    '%'        #  0x0025 -> PERCENT SIGN
    '&'        #  0x0026 -> AMPERSAND
    "'"        #  0x0027 -> APOSTROPHE
    '('        #  0x0028 -> LEFT PARENTHESIS
    ')'        #  0x0029 -> RIGHT PARENTHESIS
    '*'        #  0x002a -> ASTERISK
    '+'        #  0x002b -> PLUS SIGN
    ','        #  0x002c -> COMMA
    '-'        #  0x002d -> HYPHEN-MINUS
    '.'        #  0x002e -> FULL STOP
    '/'        #  0x002f -> SOLIDUS
    '0'        #  0x0030 -> DIGIT ZERO
    '1'        #  0x0031 -> DIGIT ONE
    '2'        #  0x0032 -> DIGIT TWO
    '3'        #  0x0033 -> DIGIT THREE
    '4'        #  0x0034 -> DIGIT FOUR
    '5'        #  0x0035 -> DIGIT FIVE
    '6'        #  0x0036 -> DIGIT SIX
    '7'        #  0x0037 -> DIGIT SEVEN
    '8'        #  0x0038 -> DIGIT EIGHT
    '9'        #  0x0039 -> DIGIT NINE
    ':'        #  0x003a -> COLON
    ';'        #  0x003b -> SEMICOLON
    '<'        #  0x003c -> LESS-THAN SIGN
    '='        #  0x003d -> EQUALS SIGN
    '>'        #  0x003e -> GREATER-THAN SIGN
    '?'        #  0x003f -> QUESTION MARK
    '@'        #  0x0040 -> COMMERCIAL AT
    'A'        #  0x0041 -> LATIN CAPITAL LETTER A
    'B'        #  0x0042 -> LATIN CAPITAL LETTER B
    'C'        #  0x0043 -> LATIN CAPITAL LETTER C
    'D'        #  0x0044 -> LATIN CAPITAL LETTER D
    'E'        #  0x0045 -> LATIN CAPITAL LETTER E
    'F'        #  0x0046 -> LATIN CAPITAL LETTER F
    'G'        #  0x0047 -> LATIN CAPITAL LETTER G
    'H'        #  0x0048 -> LATIN CAPITAL LETTER H
    'I'        #  0x0049 -> LATIN CAPITAL LETTER I
    'J'        #  0x004a -> LATIN CAPITAL LETTER J
    'K'        #  0x004b -> LATIN CAPITAL LETTER K
    'L'        #  0x004c -> LATIN CAPITAL LETTER L
    'M'        #  0x004d -> LATIN CAPITAL LETTER M
    'N'        #  0x004e -> LATIN CAPITAL LETTER N
    'O'        #  0x004f -> LATIN CAPITAL LETTER O
    'P'        #  0x0050 -> LATIN CAPITAL LETTER P
    'Q'        #  0x0051 -> LATIN CAPITAL LETTER Q
    'R'        #  0x0052 -> LATIN CAPITAL LETTER R
    'S'        #  0x0053 -> LATIN CAPITAL LETTER S
    'T'        #  0x0054 -> LATIN CAPITAL LETTER T
    'U'        #  0x0055 -> LATIN CAPITAL LETTER U
    'V'        #  0x0056 -> LATIN CAPITAL LETTER V
    'W'        #  0x0057 -> LATIN CAPITAL LETTER W
    'X'        #  0x0058 -> LATIN CAPITAL LETTER X
    'Y'        #  0x0059 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x005a -> LATIN CAPITAL LETTER Z
    '['        #  0x005b -> LEFT SQUARE BRACKET
    '\\'       #  0x005c -> REVERSE SOLIDUS
    ']'        #  0x005d -> RIGHT SQUARE BRACKET
    '^'        #  0x005e -> CIRCUMFLEX ACCENT
    '_'        #  0x005f -> LOW LINE
    '`'        #  0x0060 -> GRAVE ACCENT
    'a'        #  0x0061 -> LATIN SMALL LETTER A
    'b'        #  0x0062 -> LATIN SMALL LETTER B
    'c'        #  0x0063 -> LATIN SMALL LETTER C
    'd'        #  0x0064 -> LATIN SMALL LETTER D
    'e'        #  0x0065 -> LATIN SMALL LETTER E
    'f'        #  0x0066 -> LATIN SMALL LETTER F
    'g'        #  0x0067 -> LATIN SMALL LETTER G
    'h'        #  0x0068 -> LATIN SMALL LETTER H
    'i'        #  0x0069 -> LATIN SMALL LETTER I
    'j'        #  0x006a -> LATIN SMALL LETTER J
    'k'        #  0x006b -> LATIN SMALL LETTER K
    'l'        #  0x006c -> LATIN SMALL LETTER L
    'm'        #  0x006d -> LATIN SMALL LETTER M
    'n'        #  0x006e -> LATIN SMALL LETTER N
    'o'        #  0x006f -> LATIN SMALL LETTER O
    'p'        #  0x0070 -> LATIN SMALL LETTER P
    'q'        #  0x0071 -> LATIN SMALL LETTER Q
    'r'        #  0x0072 -> LATIN SMALL LETTER R
    's'        #  0x0073 -> LATIN SMALL LETTER S
    't'        #  0x0074 -> LATIN SMALL LETTER T
    'u'        #  0x0075 -> LATIN SMALL LETTER U
    'v'        #  0x0076 -> LATIN SMALL LETTER V
    'w'        #  0x0077 -> LATIN SMALL LETTER W
    'x'        #  0x0078 -> LATIN SMALL LETTER X
    'y'        #  0x0079 -> LATIN SMALL LETTER Y
    'z'        #  0x007a -> LATIN SMALL LETTER Z
    '{'        #  0x007b -> LEFT CURLY BRACKET
    '|'        #  0x007c -> VERTICAL LINE
    '}'        #  0x007d -> RIGHT CURLY BRACKET
    '~'        #  0x007e -> TILDE
    '\x7f'     #  0x007f -> DELETE
    '\u0410'   #  0x0080 -> CYRILLIC CAPITAL LETTER A
    '\u0411'   #  0x0081 -> CYRILLIC CAPITAL LETTER BE
    '\u0412'   #  0x0082 -> CYRILLIC CAPITAL LETTER VE
    '\u0413'   #  0x0083 -> CYRILLIC CAPITAL LETTER GHE
    '\u0414'   #  0x0084 -> CYRILLIC CAPITAL LETTER DE
    '\u0415'   #  0x0085 -> CYRILLIC CAPITAL LETTER IE
    '\u0416'   #  0x0086 -> CYRILLIC CAPITAL LETTER ZHE
    '\u0417'   #  0x0087 -> CYRILLIC CAPITAL LETTER ZE
    '\u0418'   #  0x0088 -> CYRILLIC CAPITAL LETTER I
    '\u0419'   #  0x0089 -> CYRILLIC CAPITAL LETTER SHORT I
    '\u041a'   #  0x008a -> CYRILLIC CAPITAL LETTER KA
    '\u041b'   #  0x008b -> CYRILLIC CAPITAL LETTER EL
    '\u041c'   #  0x008c -> CYRILLIC CAPITAL LETTER EM
    '\u041d'   #  0x008d -> CYRILLIC CAPITAL LETTER EN
    '\u041e'   #  0x008e -> CYRILLIC CAPITAL LETTER O
    '\u041f'   #  0x008f -> CYRILLIC CAPITAL LETTER PE
    '\u0420'   #  0x0090 -> CYRILLIC CAPITAL LETTER ER
    '\u0421'   #  0x0091 -> CYRILLIC CAPITAL LETTER ES
    '\u0422'   #  0x0092 -> CYRILLIC CAPITAL LETTER TE
    '\u0423'   #  0x0093 -> CYRILLIC CAPITAL LETTER U
    '\u0424'   #  0x0094 -> CYRILLIC CAPITAL LETTER EF
    '\u0425'   #  0x0095 -> CYRILLIC CAPITAL LETTER HA
    '\u0426'   #  0x0096 -> CYRILLIC CAPITAL LETTER TSE
    '\u0427'   #  0x0097 -> CYRILLIC CAPITAL LETTER CHE
    '\u0428'   #  0x0098 -> CYRILLIC CAPITAL LETTER SHA
    '\u0429'   #  0x0099 -> CYRILLIC CAPITAL LETTER SHCHA
    '\u042a'   #  0x009a -> CYRILLIC CAPITAL LETTER HARD SIGN
    '\u042b'   #  0x009b -> CYRILLIC CAPITAL LETTER YERU
    '\u042c'   #  0x009c -> CYRILLIC CAPITAL LETTER SOFT SIGN
    '\u042d'   #  0x009d -> CYRILLIC CAPITAL LETTER E
    '\u042e'   #  0x009e -> CYRILLIC CAPITAL LETTER YU
    '\u042f'   #  0x009f -> CYRILLIC CAPITAL LETTER YA
    '\u0430'   #  0x00a0 -> CYRILLIC SMALL LETTER A
    '\u0431'   #  0x00a1 -> CYRILLIC SMALL LETTER BE
    '\u0432'   #  0x00a2 -> CYRILLIC SMALL LETTER VE
    '\u0433'   #  0x00a3 -> CYRILLIC SMALL LETTER GHE
    '\u0434'   #  0x00a4 -> CYRILLIC SMALL LETTER DE
    '\u0435'   #  0x00a5 -> CYRILLIC SMALL LETTER IE
    '\u0436'   #  0x00a6 -> CYRILLIC SMALL LETTER ZHE
    '\u0437'   #  0x00a7 -> CYRILLIC SMALL LETTER ZE
    '\u0438'   #  0x00a8 -> CYRILLIC SMALL LETTER I
    '\u0439'   #  0x00a9 -> CYRILLIC SMALL LETTER SHORT I
    '\u043a'   #  0x00aa -> CYRILLIC SMALL LETTER KA
    '\u043b'   #  0x00ab -> CYRILLIC SMALL LETTER EL
    '\u043c'   #  0x00ac -> CYRILLIC SMALL LETTER EM
    '\u043d'   #  0x00ad -> CYRILLIC SMALL LETTER EN
    '\u043e'   #  0x00ae -> CYRILLIC SMALL LETTER O
    '\u043f'   #  0x00af -> CYRILLIC SMALL LETTER PE
    '\u2591'   #  0x00b0 -> LIGHT SHADE
    '\u2592'   #  0x00b1 -> MEDIUM SHADE
    '\u2593'   #  0x00b2 -> DARK SHADE
    '\u2502'   #  0x00b3 -> BOX DRAWINGS LIGHT VERTICAL
    '\u2524'   #  0x00b4 -> BOX DRAWINGS LIGHT VERTICAL AND LEFT
    '\u2561'   #  0x00b5 -> BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
    '\u2562'   #  0x00b6 -> BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
    '\u2556'   #  0x00b7 -> BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
    '\u2555'   #  0x00b8 -> BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
    '\u2563'   #  0x00b9 -> BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    '\u2551'   #  0x00ba -> BOX DRAWINGS DOUBLE VERTICAL
    '\u2557'   #  0x00bb -> BOX DRAWINGS DOUBLE DOWN AND LEFT
    '\u255d'   #  0x00bc -> BOX DRAWINGS DOUBLE UP AND LEFT
    '\u255c'   #  0x00bd -> BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
    '\u255b'   #  0x00be -> BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
    '\u2510'   #  0x00bf -> BOX DRAWINGS LIGHT DOWN AND LEFT
    '\u2514'   #  0x00c0 -> BOX DRAWINGS LIGHT UP AND RIGHT
    '\u2534'   #  0x00c1 -> BOX DRAWINGS LIGHT UP AND HORIZONTAL
    '\u252c'   #  0x00c2 -> BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    '\u251c'   #  0x00c3 -> BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    '\u2500'   #  0x00c4 -> BOX DRAWINGS LIGHT HORIZONTAL
    '\u253c'   #  0x00c5 -> BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    '\u255e'   #  0x00c6 -> BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
    '\u255f'   #  0x00c7 -> BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
    '\u255a'   #  0x00c8 -> BOX DRAWINGS DOUBLE UP AND RIGHT
    '\u2554'   #  0x00c9 -> BOX DRAWINGS DOUBLE DOWN AND RIGHT
    '\u2569'   #  0x00ca -> BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    '\u2566'   #  0x00cb -> BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    '\u2560'   #  0x00cc -> BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    '\u2550'   #  0x00cd -> BOX DRAWINGS DOUBLE HORIZONTAL
    '\u256c'   #  0x00ce -> BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    '\u2567'   #  0x00cf -> BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
    '\u2568'   #  0x00d0 -> BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
    '\u2564'   #  0x00d1 -> BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
    '\u2565'   #  0x00d2 -> BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
    '\u2559'   #  0x00d3 -> BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
    '\u2558'   #  0x00d4 -> BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
    '\u2552'   #  0x00d5 -> BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
    '\u2553'   #  0x00d6 -> BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
    '\u256b'   #  0x00d7 -> BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
    '\u256a'   #  0x00d8 -> BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
    '\u2518'   #  0x00d9 -> BOX DRAWINGS LIGHT UP AND LEFT
    '\u250c'   #  0x00da -> BOX DRAWINGS LIGHT DOWN AND RIGHT
    '\u2588'   #  0x00db -> FULL BLOCK
    '\u2584'   #  0x00dc -> LOWER HALF BLOCK
    '\u258c'   #  0x00dd -> LEFT HALF BLOCK
    '\u2590'   #  0x00de -> RIGHT HALF BLOCK
    '\u2580'   #  0x00df -> UPPER HALF BLOCK
    '\u0440'   #  0x00e0 -> CYRILLIC SMALL LETTER ER
    '\u0441'   #  0x00e1 -> CYRILLIC SMALL LETTER ES
    '\u0442'   #  0x00e2 -> CYRILLIC SMALL LETTER TE
    '\u0443'   #  0x00e3 -> CYRILLIC SMALL LETTER U
    '\u0444'   #  0x00e4 -> CYRILLIC SMALL LETTER EF
    '\u0445'   #  0x00e5 -> CYRILLIC SMALL LETTER HA
    '\u0446'   #  0x00e6 -> CYRILLIC SMALL LETTER TSE
    '\u0447'   #  0x00e7 -> CYRILLIC SMALL LETTER CHE
    '\u0448'   #  0x00e8 -> CYRILLIC SMALL LETTER SHA
    '\u0449'   #  0x00e9 -> CYRILLIC SMALL LETTER SHCHA
    '\u044a'   #  0x00ea -> CYRILLIC SMALL LETTER HARD SIGN
    '\u044b'   #  0x00eb -> CYRILLIC SMALL LETTER YERU
    '\u044c'   #  0x00ec -> CYRILLIC SMALL LETTER SOFT SIGN
    '\u044d'   #  0x00ed -> CYRILLIC SMALL LETTER E
    '\u044e'   #  0x00ee -> CYRILLIC SMALL LETTER YU
    '\u044f'   #  0x00ef -> CYRILLIC SMALL LETTER YA
    '\u0401'   #  0x00f0 -> CYRILLIC CAPITAL LETTER IO
    '\u0451'   #  0x00f1 -> CYRILLIC SMALL LETTER IO
    '\u0404'   #  0x00f2 -> CYRILLIC CAPITAL LETTER UKRAINIAN IE
    '\u0454'   #  0x00f3 -> CYRILLIC SMALL LETTER UKRAINIAN IE
    '\u0407'   #  0x00f4 -> CYRILLIC CAPITAL LETTER YI
    '\u0457'   #  0x00f5 -> CYRILLIC SMALL LETTER YI
    '\u040e'   #  0x00f6 -> CYRILLIC CAPITAL LETTER SHORT U
    '\u045e'   #  0x00f7 -> CYRILLIC SMALL LETTER SHORT U
    '\xb0'     #  0x00f8 -> DEGREE SIGN
    '\u2219'   #  0x00f9 -> BULLET OPERATOR
    '\xb7'     #  0x00fa -> MIDDLE DOT
    '\u221a'   #  0x00fb -> SQUARE ROOT
    '\u2116'   #  0x00fc -> NUMERO SIGN
    '\xa4'     #  0x00fd -> CURRENCY SIGN
    '\u25a0'   #  0x00fe -> BLACK SQUARE
    '\xa0'     #  0x00ff -> NO-BREAK SPACE
)

### Encoding Map

encoding_map = {
    0x0000: 0x0000,     #  NULL
    0x0001: 0x0001,     #  START OF HEADING
    0x0002: 0x0002,     #  START OF TEXT
    0x0003: 0x0003,     #  END OF TEXT
    0x0004: 0x0004,     #  END OF TRANSMISSION
    0x0005: 0x0005,     #  ENQUIRY
    0x0006: 0x0006,     #  ACKNOWLEDGE
    0x0007: 0x0007,     #  BELL
    0x0008: 0x0008,     #  BACKSPACE
    0x0009: 0x0009,     #  HORIZONTAL TABULATION
    0x000a: 0x000a,     #  LINE FEED
    0x000b: 0x000b,     #  VERTICAL TABULATION
    0x000c: 0x000c,     #  FORM FEED
    0x000d: 0x000d,     #  CARRIAGE RETURN
    0x000e: 0x000e,     #  SHIFT OUT
    0x000f: 0x000f,     #  SHIFT IN
    0x0010: 0x0010,     #  DATA LINK ESCAPE
    0x0011: 0x0011,     #  DEVICE CONTROL ONE
    0x0012: 0x0012,     #  DEVICE CONTROL TWO
    0x0013: 0x0013,     #  DEVICE CONTROL THREE
    0x0014: 0x0014,     #  DEVICE CONTROL FOUR
    0x0015: 0x0015,     #  NEGATIVE ACKNOWLEDGE
    0x0016: 0x0016,     #  SYNCHRONOUS IDLE
    0x0017: 0x0017,     #  END OF TRANSMISSION BLOCK
    0x0018: 0x0018,     #  CANCEL
    0x0019: 0x0019,     #  END OF MEDIUM
    0x001a: 0x001a,     #  SUBSTITUTE
    0x001b: 0x001b,     #  ESCAPE
    0x001c: 0x001c,     #  FILE SEPARATOR
    0x001d: 0x001d,     #  GROUP SEPARATOR
    0x001e: 0x001e,     #  RECORD SEPARATOR
    0x001f: 0x001f,     #  UNIT SEPARATOR
    0x0020: 0x0020,     #  SPACE
    0x0021: 0x0021,     #  EXCLAMATION MARK
    0x0022: 0x0022,     #  QUOTATION MARK
    0x0023: 0x0023,     #  NUMBER SIGN
    0x0024: 0x0024,     #  DOLLAR SIGN
    0x0025: 0x0025,     #  PERCENT SIGN
    0x0026: 0x0026,     #  AMPERSAND
    0x0027: 0x0027,     #  APOSTROPHE
    0x0028: 0x0028,     #  LEFT PARENTHESIS
    0x0029: 0x0029,     #  RIGHT PARENTHESIS
    0x002a: 0x002a,     #  ASTERISK
    0x002b: 0x002b,     #  PLUS SIGN
    0x002c: 0x002c,     #  COMMA
    0x002d: 0x002d,     #  HYPHEN-MINUS
    0x002e: 0x002e,     #  FULL STOP
    0x002f: 0x002f,     #  SOLIDUS
    0x0030: 0x0030,     #  DIGIT ZERO
    0x0031: 0x0031,     #  DIGIT ONE
    0x0032: 0x0032,     #  DIGIT TWO
    0x0033: 0x0033,     #  DIGIT THREE
    0x0034: 0x0034,     #  DIGIT FOUR
    0x0035: 0x0035,     #  DIGIT FIVE
    0x0036: 0x0036,     #  DIGIT SIX
    0x0037: 0x0037,     #  DIGIT SEVEN
    0x0038: 0x0038,     #  DIGIT EIGHT
    0x0039: 0x0039,     #  DIGIT NINE
    0x003a: 0x003a,     #  COLON
    0x003b: 0x003b,     #  SEMICOLON
    0x003c: 0x003c,     #  LESS-THAN SIGN
    0x003d: 0x003d,     #  EQUALS SIGN
    0x003e: 0x003e,     #  GREATER-THAN SIGN
    0x003f: 0x003f,     #  QUESTION MARK
    0x0040: 0x0040,     #  COMMERCIAL AT
    0x0041: 0x0041,     #  LATIN CAPITAL LETTER A
    0x0042: 0x0042,     #  LATIN CAPITAL LETTER B
    0x0043: 0x0043,     #  LATIN CAPITAL LETTER C
    0x0044: 0x0044,     #  LATIN CAPITAL LETTER D
    0x0045: 0x0045,     #  LATIN CAPITAL LETTER E
    0x0046: 0x0046,     #  LATIN CAPITAL LETTER F
    0x0047: 0x0047,     #  LATIN CAPITAL LETTER G
    0x0048: 0x0048,     #  LATIN CAPITAL LETTER H
    0x0049: 0x0049,     #  LATIN CAPITAL LETTER I
    0x004a: 0x004a,     #  LATIN CAPITAL LETTER J
    0x004b: 0x004b,     #  LATIN CAPITAL LETTER K
    0x004c: 0x004c,     #  LATIN CAPITAL LETTER L
    0x004d: 0x004d,     #  LATIN CAPITAL LETTER M
    0x004e: 0x004e,     #  LATIN CAPITAL LETTER N
    0x004f: 0x004f,     #  LATIN CAPITAL LETTER O
    0x0050: 0x0050,     #  LATIN CAPITAL LETTER P
    0x0051: 0x0051,     #  LATIN CAPITAL LETTER Q
    0x0052: 0x0052,     #  LATIN CAPITAL LETTER R
    0x0053: 0x0053,     #  LATIN CAPITAL LETTER S
    0x0054: 0x0054,     #  LATIN CAPITAL LETTER T
    0x0055: 0x0055,     #  LATIN CAPITAL LETTER U
    0x0056: 0x0056,     #  LATIN CAPITAL LETTER V
    0x0057: 0x0057,     #  LATIN CAPITAL LETTER W
    0x0058: 0x0058,     #  LATIN CAPITAL LETTER X
    0x0059: 0x0059,     #  LATIN CAPITAL LETTER Y
    0x005a: 0x005a,     #  LATIN CAPITAL LETTER Z
    0x005b: 0x005b,     #  LEFT SQUARE BRACKET
    0x005c: 0x005c,     #  REVERSE SOLIDUS
    0x005d: 0x005d,     #  RIGHT SQUARE BRACKET
    0x005e: 0x005e,     #  CIRCUMFLEX ACCENT
    0x005f: 0x005f,     #  LOW LINE
    0x0060: 0x0060,     #  GRAVE ACCENT
    0x0061: 0x0061,     #  LATIN SMALL LETTER A
    0x0062: 0x0062,     #  LATIN SMALL LETTER B
    0x0063: 0x0063,     #  LATIN SMALL LETTER C
    0x0064: 0x0064,     #  LATIN SMALL LETTER D
    0x0065: 0x0065,     #  LATIN SMALL LETTER E
    0x0066: 0x0066,     #  LATIN SMALL LETTER F
    0x0067: 0x0067,     #  LATIN SMALL LETTER G
    0x0068: 0x0068,     #  LATIN SMALL LETTER H
    0x0069: 0x0069,     #  LATIN SMALL LETTER I
    0x006a: 0x006a,     #  LATIN SMALL LETTER J
    0x006b: 0x006b,     #  LATIN SMALL LETTER K
    0x006c: 0x006c,     #  LATIN SMALL LETTER L
    0x006d: 0x006d,     #  LATIN SMALL LETTER M
    0x006e: 0x006e,     #  LATIN SMALL LETTER N
    0x006f: 0x006f,     #  LATIN SMALL LETTER O
    0x0070: 0x0070,     #  LATIN SMALL LETTER P
    0x0071: 0x0071,     #  LATIN SMALL LETTER Q
    0x0072: 0x0072,     #  LATIN SMALL LETTER R
    0x0073: 0x0073,     #  LATIN SMALL LETTER S
    0x0074: 0x0074,     #  LATIN SMALL LETTER T
    0x0075: 0x0075,     #  LATIN SMALL LETTER U
    0x0076: 0x0076,     #  LATIN SMALL LETTER V
    0x0077: 0x0077,     #  LATIN SMALL LETTER W
    0x0078: 0x0078,     #  LATIN SMALL LETTER X
    0x0079: 0x0079,     #  LATIN SMALL LETTER Y
    0x007a: 0x007a,     #  LATIN SMALL LETTER Z
    0x007b: 0x007b,     #  LEFT CURLY BRACKET
    0x007c: 0x007c,     #  VERTICAL LINE
    0x007d: 0x007d,     #  RIGHT CURLY BRACKET
    0x007e: 0x007e,     #  TILDE
    0x007f: 0x007f,     #  DELETE
    0x00a0: 0x00ff,     #  NO-BREAK SPACE
    0x00a4: 0x00fd,     #  CURRENCY SIGN
    0x00b0: 0x00f8,     #  DEGREE SIGN
    0x00b7: 0x00fa,     #  MIDDLE DOT
    0x0401: 0x00f0,     #  CYRILLIC CAPITAL LETTER IO
    0x0404: 0x00f2,     #  CYRILLIC CAPITAL LETTER UKRAINIAN IE
    0x0407: 0x00f4,     #  CYRILLIC CAPITAL LETTER YI
    0x040e: 0x00f6,     #  CYRILLIC CAPITAL LETTER SHORT U
    0x0410: 0x0080,     #  CYRILLIC CAPITAL LETTER A
    0x0411: 0x0081,     #  CYRILLIC CAPITAL LETTER BE
    0x0412: 0x0082,     #  CYRILLIC CAPITAL LETTER VE
    0x0413: 0x0083,     #  CYRILLIC CAPITAL LETTER GHE
    0x0414: 0x0084,     #  CYRILLIC CAPITAL LETTER DE
    0x0415: 0x0085,     #  CYRILLIC CAPITAL LETTER IE
    0x0416: 0x0086,     #  CYRILLIC CAPITAL LETTER ZHE
    0x0417: 0x0087,     #  CYRILLIC CAPITAL LETTER ZE
    0x0418: 0x0088,     #  CYRILLIC CAPITAL LETTER I
    0x0419: 0x0089,     #  CYRILLIC CAPITAL LETTER SHORT I
    0x041a: 0x008a,     #  CYRILLIC CAPITAL LETTER KA
    0x041b: 0x008b,     #  CYRILLIC CAPITAL LETTER EL
    0x041c: 0x008c,     #  CYRILLIC CAPITAL LETTER EM
    0x041d: 0x008d,     #  CYRILLIC CAPITAL LETTER EN
    0x041e: 0x008e,     #  CYRILLIC CAPITAL LETTER O
    0x041f: 0x008f,     #  CYRILLIC CAPITAL LETTER PE
    0x0420: 0x0090,     #  CYRILLIC CAPITAL LETTER ER
    0x0421: 0x0091,     #  CYRILLIC CAPITAL LETTER ES
    0x0422: 0x0092,     #  CYRILLIC CAPITAL LETTER TE
    0x0423: 0x0093,     #  CYRILLIC CAPITAL LETTER U
    0x0424: 0x0094,     #  CYRILLIC CAPITAL LETTER EF
    0x0425: 0x0095,     #  CYRILLIC CAPITAL LETTER HA
    0x0426: 0x0096,     #  CYRILLIC CAPITAL LETTER TSE
    0x0427: 0x0097,     #  CYRILLIC CAPITAL LETTER CHE
    0x0428: 0x0098,     #  CYRILLIC CAPITAL LETTER SHA
    0x0429: 0x0099,     #  CYRILLIC CAPITAL LETTER SHCHA
    0x042a: 0x009a,     #  CYRILLIC CAPITAL LETTER HARD SIGN
    0x042b: 0x009b,     #  CYRILLIC CAPITAL LETTER YERU
    0x042c: 0x009c,     #  CYRILLIC CAPITAL LETTER SOFT SIGN
    0x042d: 0x009d,     #  CYRILLIC CAPITAL LETTER E
    0x042e: 0x009e,     #  CYRILLIC CAPITAL LETTER YU
    0x042f: 0x009f,     #  CYRILLIC CAPITAL LETTER YA
    0x0430: 0x00a0,     #  CYRILLIC SMALL LETTER A
    0x0431: 0x00a1,     #  CYRILLIC SMALL LETTER BE
    0x0432: 0x00a2,     #  CYRILLIC SMALL LETTER VE
    0x0433: 0x00a3,     #  CYRILLIC SMALL LETTER GHE
    0x0434: 0x00a4,     #  CYRILLIC SMALL LETTER DE
    0x0435: 0x00a5,     #  CYRILLIC SMALL LETTER IE
    0x0436: 0x00a6,     #  CYRILLIC SMALL LETTER ZHE
    0x0437: 0x00a7,     #  CYRILLIC SMALL LETTER ZE
    0x0438: 0x00a8,     #  CYRILLIC SMALL LETTER I
    0x0439: 0x00a9,     #  CYRILLIC SMALL LETTER SHORT I
    0x043a: 0x00aa,     #  CYRILLIC SMALL LETTER KA
    0x043b: 0x00ab,     #  CYRILLIC SMALL LETTER EL
    0x043c: 0x00ac,     #  CYRILLIC SMALL LETTER EM
    0x043d: 0x00ad,     #  CYRILLIC SMALL LETTER EN
    0x043e: 0x00ae,     #  CYRILLIC SMALL LETTER O
    0x043f: 0x00af,     #  CYRILLIC SMALL LETTER PE
    0x0440: 0x00e0,     #  CYRILLIC SMALL LETTER ER
    0x0441: 0x00e1,     #  CYRILLIC SMALL LETTER ES
    0x0442: 0x00e2,     #  CYRILLIC SMALL LETTER TE
    0x0443: 0x00e3,     #  CYRILLIC SMALL LETTER U
    0x0444: 0x00e4,     #  CYRILLIC SMALL LETTER EF
    0x0445: 0x00e5,     #  CYRILLIC SMALL LETTER HA
    0x0446: 0x00e6,     #  CYRILLIC SMALL LETTER TSE
    0x0447: 0x00e7,     #  CYRILLIC SMALL LETTER CHE
    0x0448: 0x00e8,     #  CYRILLIC SMALL LETTER SHA
    0x0449: 0x00e9,     #  CYRILLIC SMALL LETTER SHCHA
    0x044a: 0x00ea,     #  CYRILLIC SMALL LETTER HARD SIGN
    0x044b: 0x00eb,     #  CYRILLIC SMALL LETTER YERU
    0x044c: 0x00ec,     #  CYRILLIC SMALL LETTER SOFT SIGN
    0x044d: 0x00ed,     #  CYRILLIC SMALL LETTER E
    0x044e: 0x00ee,     #  CYRILLIC SMALL LETTER YU
    0x044f: 0x00ef,     #  CYRILLIC SMALL LETTER YA
    0x0451: 0x00f1,     #  CYRILLIC SMALL LETTER IO
    0x0454: 0x00f3,     #  CYRILLIC SMALL LETTER UKRAINIAN IE
    0x0457: 0x00f5,     #  CYRILLIC SMALL LETTER YI
    0x045e: 0x00f7,     #  CYRILLIC SMALL LETTER SHORT U
    0x2116: 0x00fc,     #  NUMERO SIGN
    0x2219: 0x00f9,     #  BULLET OPERATOR
    0x221a: 0x00fb,     #  SQUARE ROOT
    0x2500: 0x00c4,     #  BOX DRAWINGS LIGHT HORIZONTAL
    0x2502: 0x00b3,     #  BOX DRAWINGS LIGHT VERTICAL
    0x250c: 0x00da,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
    0x2510: 0x00bf,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
    0x2514: 0x00c0,     #  BOX DRAWINGS LIGHT UP AND RIGHT
    0x2518: 0x00d9,     #  BOX DRAWINGS LIGHT UP AND LEFT
    0x251c: 0x00c3,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    0x2524: 0x00b4,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
    0x252c: 0x00c2,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    0x2534: 0x00c1,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
    0x253c: 0x00c5,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    0x2550: 0x00cd,     #  BOX DRAWINGS DOUBLE HORIZONTAL
    0x2551: 0x00ba,     #  BOX DRAWINGS DOUBLE VERTICAL
    0x2552: 0x00d5,     #  BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
    0x2553: 0x00d6,     #  BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
    0x2554: 0x00c9,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
    0x2555: 0x00b8,     #  BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
    0x2556: 0x00b7,     #  BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
    0x2557: 0x00bb,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
    0x2558: 0x00d4,     #  BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
    0x2559: 0x00d3,     #  BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
    0x255a: 0x00c8,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
    0x255b: 0x00be,     #  BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
    0x255c: 0x00bd,     #  BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
    0x255d: 0x00bc,     #  BOX DRAWINGS DOUBLE UP AND LEFT
    0x255e: 0x00c6,     #  BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
    0x255f: 0x00c7,     #  BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
    0x2560: 0x00cc,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    0x2561: 0x00b5,     #  BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
    0x2562: 0x00b6,     #  BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
    0x2563: 0x00b9,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    0x2564: 0x00d1,     #  BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
    0x2565: 0x00d2,     #  BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
    0x2566: 0x00cb,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    0x2567: 0x00cf,     #  BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
    0x2568: 0x00d0,     #  BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
    0x2569: 0x00ca,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    0x256a: 0x00d8,     #  BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
    0x256b: 0x00d7,     #  BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
    0x256c: 0x00ce,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    0x2580: 0x00df,     #  UPPER HALF BLOCK
    0x2584: 0x00dc,     #  LOWER HALF BLOCK
    0x2588: 0x00db,     #  FULL BLOCK
    0x258c: 0x00dd,     #  LEFT HALF BLOCK
    0x2590: 0x00de,     #  RIGHT HALF BLOCK
    0x2591: 0x00b0,     #  LIGHT SHADE
    0x2592: 0x00b1,     #  MEDIUM SHADE
    0x2593: 0x00b2,     #  DARK SHADE
    0x25a0: 0x00fe,     #  BLACK SQUARE
}
encodings/iso8859_6.py000064400000025121151153537620010455 0ustar00""" Python Character Mapping Codec iso8859_6 generated from 'MAPPINGS/ISO8859/8859-6.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='iso8859-6',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\x80'     #  0x80 -> <control>
    '\x81'     #  0x81 -> <control>
    '\x82'     #  0x82 -> <control>
    '\x83'     #  0x83 -> <control>
    '\x84'     #  0x84 -> <control>
    '\x85'     #  0x85 -> <control>
    '\x86'     #  0x86 -> <control>
    '\x87'     #  0x87 -> <control>
    '\x88'     #  0x88 -> <control>
    '\x89'     #  0x89 -> <control>
    '\x8a'     #  0x8A -> <control>
    '\x8b'     #  0x8B -> <control>
    '\x8c'     #  0x8C -> <control>
    '\x8d'     #  0x8D -> <control>
    '\x8e'     #  0x8E -> <control>
    '\x8f'     #  0x8F -> <control>
    '\x90'     #  0x90 -> <control>
    '\x91'     #  0x91 -> <control>
    '\x92'     #  0x92 -> <control>
    '\x93'     #  0x93 -> <control>
    '\x94'     #  0x94 -> <control>
    '\x95'     #  0x95 -> <control>
    '\x96'     #  0x96 -> <control>
    '\x97'     #  0x97 -> <control>
    '\x98'     #  0x98 -> <control>
    '\x99'     #  0x99 -> <control>
    '\x9a'     #  0x9A -> <control>
    '\x9b'     #  0x9B -> <control>
    '\x9c'     #  0x9C -> <control>
    '\x9d'     #  0x9D -> <control>
    '\x9e'     #  0x9E -> <control>
    '\x9f'     #  0x9F -> <control>
    '\xa0'     #  0xA0 -> NO-BREAK SPACE
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\xa4'     #  0xA4 -> CURRENCY SIGN
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\u060c'   #  0xAC -> ARABIC COMMA
    '\xad'     #  0xAD -> SOFT HYPHEN
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\u061b'   #  0xBB -> ARABIC SEMICOLON
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\u061f'   #  0xBF -> ARABIC QUESTION MARK
    '\ufffe'
    '\u0621'   #  0xC1 -> ARABIC LETTER HAMZA
    '\u0622'   #  0xC2 -> ARABIC LETTER ALEF WITH MADDA ABOVE
    '\u0623'   #  0xC3 -> ARABIC LETTER ALEF WITH HAMZA ABOVE
    '\u0624'   #  0xC4 -> ARABIC LETTER WAW WITH HAMZA ABOVE
    '\u0625'   #  0xC5 -> ARABIC LETTER ALEF WITH HAMZA BELOW
    '\u0626'   #  0xC6 -> ARABIC LETTER YEH WITH HAMZA ABOVE
    '\u0627'   #  0xC7 -> ARABIC LETTER ALEF
    '\u0628'   #  0xC8 -> ARABIC LETTER BEH
    '\u0629'   #  0xC9 -> ARABIC LETTER TEH MARBUTA
    '\u062a'   #  0xCA -> ARABIC LETTER TEH
    '\u062b'   #  0xCB -> ARABIC LETTER THEH
    '\u062c'   #  0xCC -> ARABIC LETTER JEEM
    '\u062d'   #  0xCD -> ARABIC LETTER HAH
    '\u062e'   #  0xCE -> ARABIC LETTER KHAH
    '\u062f'   #  0xCF -> ARABIC LETTER DAL
    '\u0630'   #  0xD0 -> ARABIC LETTER THAL
    '\u0631'   #  0xD1 -> ARABIC LETTER REH
    '\u0632'   #  0xD2 -> ARABIC LETTER ZAIN
    '\u0633'   #  0xD3 -> ARABIC LETTER SEEN
    '\u0634'   #  0xD4 -> ARABIC LETTER SHEEN
    '\u0635'   #  0xD5 -> ARABIC LETTER SAD
    '\u0636'   #  0xD6 -> ARABIC LETTER DAD
    '\u0637'   #  0xD7 -> ARABIC LETTER TAH
    '\u0638'   #  0xD8 -> ARABIC LETTER ZAH
    '\u0639'   #  0xD9 -> ARABIC LETTER AIN
    '\u063a'   #  0xDA -> ARABIC LETTER GHAIN
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\u0640'   #  0xE0 -> ARABIC TATWEEL
    '\u0641'   #  0xE1 -> ARABIC LETTER FEH
    '\u0642'   #  0xE2 -> ARABIC LETTER QAF
    '\u0643'   #  0xE3 -> ARABIC LETTER KAF
    '\u0644'   #  0xE4 -> ARABIC LETTER LAM
    '\u0645'   #  0xE5 -> ARABIC LETTER MEEM
    '\u0646'   #  0xE6 -> ARABIC LETTER NOON
    '\u0647'   #  0xE7 -> ARABIC LETTER HEH
    '\u0648'   #  0xE8 -> ARABIC LETTER WAW
    '\u0649'   #  0xE9 -> ARABIC LETTER ALEF MAKSURA
    '\u064a'   #  0xEA -> ARABIC LETTER YEH
    '\u064b'   #  0xEB -> ARABIC FATHATAN
    '\u064c'   #  0xEC -> ARABIC DAMMATAN
    '\u064d'   #  0xED -> ARABIC KASRATAN
    '\u064e'   #  0xEE -> ARABIC FATHA
    '\u064f'   #  0xEF -> ARABIC DAMMA
    '\u0650'   #  0xF0 -> ARABIC KASRA
    '\u0651'   #  0xF1 -> ARABIC SHADDA
    '\u0652'   #  0xF2 -> ARABIC SUKUN
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
    '\ufffe'
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/cp852.py000064400000104272151153537620007746 0ustar00""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP852.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_map)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_map)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp852',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )

### Decoding Map

decoding_map = codecs.make_identity_dict(range(256))
decoding_map.update({
    0x0080: 0x00c7,     #  LATIN CAPITAL LETTER C WITH CEDILLA
    0x0081: 0x00fc,     #  LATIN SMALL LETTER U WITH DIAERESIS
    0x0082: 0x00e9,     #  LATIN SMALL LETTER E WITH ACUTE
    0x0083: 0x00e2,     #  LATIN SMALL LETTER A WITH CIRCUMFLEX
    0x0084: 0x00e4,     #  LATIN SMALL LETTER A WITH DIAERESIS
    0x0085: 0x016f,     #  LATIN SMALL LETTER U WITH RING ABOVE
    0x0086: 0x0107,     #  LATIN SMALL LETTER C WITH ACUTE
    0x0087: 0x00e7,     #  LATIN SMALL LETTER C WITH CEDILLA
    0x0088: 0x0142,     #  LATIN SMALL LETTER L WITH STROKE
    0x0089: 0x00eb,     #  LATIN SMALL LETTER E WITH DIAERESIS
    0x008a: 0x0150,     #  LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
    0x008b: 0x0151,     #  LATIN SMALL LETTER O WITH DOUBLE ACUTE
    0x008c: 0x00ee,     #  LATIN SMALL LETTER I WITH CIRCUMFLEX
    0x008d: 0x0179,     #  LATIN CAPITAL LETTER Z WITH ACUTE
    0x008e: 0x00c4,     #  LATIN CAPITAL LETTER A WITH DIAERESIS
    0x008f: 0x0106,     #  LATIN CAPITAL LETTER C WITH ACUTE
    0x0090: 0x00c9,     #  LATIN CAPITAL LETTER E WITH ACUTE
    0x0091: 0x0139,     #  LATIN CAPITAL LETTER L WITH ACUTE
    0x0092: 0x013a,     #  LATIN SMALL LETTER L WITH ACUTE
    0x0093: 0x00f4,     #  LATIN SMALL LETTER O WITH CIRCUMFLEX
    0x0094: 0x00f6,     #  LATIN SMALL LETTER O WITH DIAERESIS
    0x0095: 0x013d,     #  LATIN CAPITAL LETTER L WITH CARON
    0x0096: 0x013e,     #  LATIN SMALL LETTER L WITH CARON
    0x0097: 0x015a,     #  LATIN CAPITAL LETTER S WITH ACUTE
    0x0098: 0x015b,     #  LATIN SMALL LETTER S WITH ACUTE
    0x0099: 0x00d6,     #  LATIN CAPITAL LETTER O WITH DIAERESIS
    0x009a: 0x00dc,     #  LATIN CAPITAL LETTER U WITH DIAERESIS
    0x009b: 0x0164,     #  LATIN CAPITAL LETTER T WITH CARON
    0x009c: 0x0165,     #  LATIN SMALL LETTER T WITH CARON
    0x009d: 0x0141,     #  LATIN CAPITAL LETTER L WITH STROKE
    0x009e: 0x00d7,     #  MULTIPLICATION SIGN
    0x009f: 0x010d,     #  LATIN SMALL LETTER C WITH CARON
    0x00a0: 0x00e1,     #  LATIN SMALL LETTER A WITH ACUTE
    0x00a1: 0x00ed,     #  LATIN SMALL LETTER I WITH ACUTE
    0x00a2: 0x00f3,     #  LATIN SMALL LETTER O WITH ACUTE
    0x00a3: 0x00fa,     #  LATIN SMALL LETTER U WITH ACUTE
    0x00a4: 0x0104,     #  LATIN CAPITAL LETTER A WITH OGONEK
    0x00a5: 0x0105,     #  LATIN SMALL LETTER A WITH OGONEK
    0x00a6: 0x017d,     #  LATIN CAPITAL LETTER Z WITH CARON
    0x00a7: 0x017e,     #  LATIN SMALL LETTER Z WITH CARON
    0x00a8: 0x0118,     #  LATIN CAPITAL LETTER E WITH OGONEK
    0x00a9: 0x0119,     #  LATIN SMALL LETTER E WITH OGONEK
    0x00aa: 0x00ac,     #  NOT SIGN
    0x00ab: 0x017a,     #  LATIN SMALL LETTER Z WITH ACUTE
    0x00ac: 0x010c,     #  LATIN CAPITAL LETTER C WITH CARON
    0x00ad: 0x015f,     #  LATIN SMALL LETTER S WITH CEDILLA
    0x00ae: 0x00ab,     #  LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00af: 0x00bb,     #  RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00b0: 0x2591,     #  LIGHT SHADE
    0x00b1: 0x2592,     #  MEDIUM SHADE
    0x00b2: 0x2593,     #  DARK SHADE
    0x00b3: 0x2502,     #  BOX DRAWINGS LIGHT VERTICAL
    0x00b4: 0x2524,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
    0x00b5: 0x00c1,     #  LATIN CAPITAL LETTER A WITH ACUTE
    0x00b6: 0x00c2,     #  LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    0x00b7: 0x011a,     #  LATIN CAPITAL LETTER E WITH CARON
    0x00b8: 0x015e,     #  LATIN CAPITAL LETTER S WITH CEDILLA
    0x00b9: 0x2563,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    0x00ba: 0x2551,     #  BOX DRAWINGS DOUBLE VERTICAL
    0x00bb: 0x2557,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
    0x00bc: 0x255d,     #  BOX DRAWINGS DOUBLE UP AND LEFT
    0x00bd: 0x017b,     #  LATIN CAPITAL LETTER Z WITH DOT ABOVE
    0x00be: 0x017c,     #  LATIN SMALL LETTER Z WITH DOT ABOVE
    0x00bf: 0x2510,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
    0x00c0: 0x2514,     #  BOX DRAWINGS LIGHT UP AND RIGHT
    0x00c1: 0x2534,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
    0x00c2: 0x252c,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    0x00c3: 0x251c,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    0x00c4: 0x2500,     #  BOX DRAWINGS LIGHT HORIZONTAL
    0x00c5: 0x253c,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    0x00c6: 0x0102,     #  LATIN CAPITAL LETTER A WITH BREVE
    0x00c7: 0x0103,     #  LATIN SMALL LETTER A WITH BREVE
    0x00c8: 0x255a,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
    0x00c9: 0x2554,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
    0x00ca: 0x2569,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    0x00cb: 0x2566,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    0x00cc: 0x2560,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    0x00cd: 0x2550,     #  BOX DRAWINGS DOUBLE HORIZONTAL
    0x00ce: 0x256c,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    0x00cf: 0x00a4,     #  CURRENCY SIGN
    0x00d0: 0x0111,     #  LATIN SMALL LETTER D WITH STROKE
    0x00d1: 0x0110,     #  LATIN CAPITAL LETTER D WITH STROKE
    0x00d2: 0x010e,     #  LATIN CAPITAL LETTER D WITH CARON
    0x00d3: 0x00cb,     #  LATIN CAPITAL LETTER E WITH DIAERESIS
    0x00d4: 0x010f,     #  LATIN SMALL LETTER D WITH CARON
    0x00d5: 0x0147,     #  LATIN CAPITAL LETTER N WITH CARON
    0x00d6: 0x00cd,     #  LATIN CAPITAL LETTER I WITH ACUTE
    0x00d7: 0x00ce,     #  LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    0x00d8: 0x011b,     #  LATIN SMALL LETTER E WITH CARON
    0x00d9: 0x2518,     #  BOX DRAWINGS LIGHT UP AND LEFT
    0x00da: 0x250c,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
    0x00db: 0x2588,     #  FULL BLOCK
    0x00dc: 0x2584,     #  LOWER HALF BLOCK
    0x00dd: 0x0162,     #  LATIN CAPITAL LETTER T WITH CEDILLA
    0x00de: 0x016e,     #  LATIN CAPITAL LETTER U WITH RING ABOVE
    0x00df: 0x2580,     #  UPPER HALF BLOCK
    0x00e0: 0x00d3,     #  LATIN CAPITAL LETTER O WITH ACUTE
    0x00e1: 0x00df,     #  LATIN SMALL LETTER SHARP S
    0x00e2: 0x00d4,     #  LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    0x00e3: 0x0143,     #  LATIN CAPITAL LETTER N WITH ACUTE
    0x00e4: 0x0144,     #  LATIN SMALL LETTER N WITH ACUTE
    0x00e5: 0x0148,     #  LATIN SMALL LETTER N WITH CARON
    0x00e6: 0x0160,     #  LATIN CAPITAL LETTER S WITH CARON
    0x00e7: 0x0161,     #  LATIN SMALL LETTER S WITH CARON
    0x00e8: 0x0154,     #  LATIN CAPITAL LETTER R WITH ACUTE
    0x00e9: 0x00da,     #  LATIN CAPITAL LETTER U WITH ACUTE
    0x00ea: 0x0155,     #  LATIN SMALL LETTER R WITH ACUTE
    0x00eb: 0x0170,     #  LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
    0x00ec: 0x00fd,     #  LATIN SMALL LETTER Y WITH ACUTE
    0x00ed: 0x00dd,     #  LATIN CAPITAL LETTER Y WITH ACUTE
    0x00ee: 0x0163,     #  LATIN SMALL LETTER T WITH CEDILLA
    0x00ef: 0x00b4,     #  ACUTE ACCENT
    0x00f0: 0x00ad,     #  SOFT HYPHEN
    0x00f1: 0x02dd,     #  DOUBLE ACUTE ACCENT
    0x00f2: 0x02db,     #  OGONEK
    0x00f3: 0x02c7,     #  CARON
    0x00f4: 0x02d8,     #  BREVE
    0x00f5: 0x00a7,     #  SECTION SIGN
    0x00f6: 0x00f7,     #  DIVISION SIGN
    0x00f7: 0x00b8,     #  CEDILLA
    0x00f8: 0x00b0,     #  DEGREE SIGN
    0x00f9: 0x00a8,     #  DIAERESIS
    0x00fa: 0x02d9,     #  DOT ABOVE
    0x00fb: 0x0171,     #  LATIN SMALL LETTER U WITH DOUBLE ACUTE
    0x00fc: 0x0158,     #  LATIN CAPITAL LETTER R WITH CARON
    0x00fd: 0x0159,     #  LATIN SMALL LETTER R WITH CARON
    0x00fe: 0x25a0,     #  BLACK SQUARE
    0x00ff: 0x00a0,     #  NO-BREAK SPACE
})

### Decoding Table

decoding_table = (
    '\x00'     #  0x0000 -> NULL
    '\x01'     #  0x0001 -> START OF HEADING
    '\x02'     #  0x0002 -> START OF TEXT
    '\x03'     #  0x0003 -> END OF TEXT
    '\x04'     #  0x0004 -> END OF TRANSMISSION
    '\x05'     #  0x0005 -> ENQUIRY
    '\x06'     #  0x0006 -> ACKNOWLEDGE
    '\x07'     #  0x0007 -> BELL
    '\x08'     #  0x0008 -> BACKSPACE
    '\t'       #  0x0009 -> HORIZONTAL TABULATION
    '\n'       #  0x000a -> LINE FEED
    '\x0b'     #  0x000b -> VERTICAL TABULATION
    '\x0c'     #  0x000c -> FORM FEED
    '\r'       #  0x000d -> CARRIAGE RETURN
    '\x0e'     #  0x000e -> SHIFT OUT
    '\x0f'     #  0x000f -> SHIFT IN
    '\x10'     #  0x0010 -> DATA LINK ESCAPE
    '\x11'     #  0x0011 -> DEVICE CONTROL ONE
    '\x12'     #  0x0012 -> DEVICE CONTROL TWO
    '\x13'     #  0x0013 -> DEVICE CONTROL THREE
    '\x14'     #  0x0014 -> DEVICE CONTROL FOUR
    '\x15'     #  0x0015 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x0016 -> SYNCHRONOUS IDLE
    '\x17'     #  0x0017 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x0018 -> CANCEL
    '\x19'     #  0x0019 -> END OF MEDIUM
    '\x1a'     #  0x001a -> SUBSTITUTE
    '\x1b'     #  0x001b -> ESCAPE
    '\x1c'     #  0x001c -> FILE SEPARATOR
    '\x1d'     #  0x001d -> GROUP SEPARATOR
    '\x1e'     #  0x001e -> RECORD SEPARATOR
    '\x1f'     #  0x001f -> UNIT SEPARATOR
    ' '        #  0x0020 -> SPACE
    '!'        #  0x0021 -> EXCLAMATION MARK
    '"'        #  0x0022 -> QUOTATION MARK
    '#'        #  0x0023 -> NUMBER SIGN
    '$'        #  0x0024 -> DOLLAR SIGN
    '%'        #  0x0025 -> PERCENT SIGN
    '&'        #  0x0026 -> AMPERSAND
    "'"        #  0x0027 -> APOSTROPHE
    '('        #  0x0028 -> LEFT PARENTHESIS
    ')'        #  0x0029 -> RIGHT PARENTHESIS
    '*'        #  0x002a -> ASTERISK
    '+'        #  0x002b -> PLUS SIGN
    ','        #  0x002c -> COMMA
    '-'        #  0x002d -> HYPHEN-MINUS
    '.'        #  0x002e -> FULL STOP
    '/'        #  0x002f -> SOLIDUS
    '0'        #  0x0030 -> DIGIT ZERO
    '1'        #  0x0031 -> DIGIT ONE
    '2'        #  0x0032 -> DIGIT TWO
    '3'        #  0x0033 -> DIGIT THREE
    '4'        #  0x0034 -> DIGIT FOUR
    '5'        #  0x0035 -> DIGIT FIVE
    '6'        #  0x0036 -> DIGIT SIX
    '7'        #  0x0037 -> DIGIT SEVEN
    '8'        #  0x0038 -> DIGIT EIGHT
    '9'        #  0x0039 -> DIGIT NINE
    ':'        #  0x003a -> COLON
    ';'        #  0x003b -> SEMICOLON
    '<'        #  0x003c -> LESS-THAN SIGN
    '='        #  0x003d -> EQUALS SIGN
    '>'        #  0x003e -> GREATER-THAN SIGN
    '?'        #  0x003f -> QUESTION MARK
    '@'        #  0x0040 -> COMMERCIAL AT
    'A'        #  0x0041 -> LATIN CAPITAL LETTER A
    'B'        #  0x0042 -> LATIN CAPITAL LETTER B
    'C'        #  0x0043 -> LATIN CAPITAL LETTER C
    'D'        #  0x0044 -> LATIN CAPITAL LETTER D
    'E'        #  0x0045 -> LATIN CAPITAL LETTER E
    'F'        #  0x0046 -> LATIN CAPITAL LETTER F
    'G'        #  0x0047 -> LATIN CAPITAL LETTER G
    'H'        #  0x0048 -> LATIN CAPITAL LETTER H
    'I'        #  0x0049 -> LATIN CAPITAL LETTER I
    'J'        #  0x004a -> LATIN CAPITAL LETTER J
    'K'        #  0x004b -> LATIN CAPITAL LETTER K
    'L'        #  0x004c -> LATIN CAPITAL LETTER L
    'M'        #  0x004d -> LATIN CAPITAL LETTER M
    'N'        #  0x004e -> LATIN CAPITAL LETTER N
    'O'        #  0x004f -> LATIN CAPITAL LETTER O
    'P'        #  0x0050 -> LATIN CAPITAL LETTER P
    'Q'        #  0x0051 -> LATIN CAPITAL LETTER Q
    'R'        #  0x0052 -> LATIN CAPITAL LETTER R
    'S'        #  0x0053 -> LATIN CAPITAL LETTER S
    'T'        #  0x0054 -> LATIN CAPITAL LETTER T
    'U'        #  0x0055 -> LATIN CAPITAL LETTER U
    'V'        #  0x0056 -> LATIN CAPITAL LETTER V
    'W'        #  0x0057 -> LATIN CAPITAL LETTER W
    'X'        #  0x0058 -> LATIN CAPITAL LETTER X
    'Y'        #  0x0059 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x005a -> LATIN CAPITAL LETTER Z
    '['        #  0x005b -> LEFT SQUARE BRACKET
    '\\'       #  0x005c -> REVERSE SOLIDUS
    ']'        #  0x005d -> RIGHT SQUARE BRACKET
    '^'        #  0x005e -> CIRCUMFLEX ACCENT
    '_'        #  0x005f -> LOW LINE
    '`'        #  0x0060 -> GRAVE ACCENT
    'a'        #  0x0061 -> LATIN SMALL LETTER A
    'b'        #  0x0062 -> LATIN SMALL LETTER B
    'c'        #  0x0063 -> LATIN SMALL LETTER C
    'd'        #  0x0064 -> LATIN SMALL LETTER D
    'e'        #  0x0065 -> LATIN SMALL LETTER E
    'f'        #  0x0066 -> LATIN SMALL LETTER F
    'g'        #  0x0067 -> LATIN SMALL LETTER G
    'h'        #  0x0068 -> LATIN SMALL LETTER H
    'i'        #  0x0069 -> LATIN SMALL LETTER I
    'j'        #  0x006a -> LATIN SMALL LETTER J
    'k'        #  0x006b -> LATIN SMALL LETTER K
    'l'        #  0x006c -> LATIN SMALL LETTER L
    'm'        #  0x006d -> LATIN SMALL LETTER M
    'n'        #  0x006e -> LATIN SMALL LETTER N
    'o'        #  0x006f -> LATIN SMALL LETTER O
    'p'        #  0x0070 -> LATIN SMALL LETTER P
    'q'        #  0x0071 -> LATIN SMALL LETTER Q
    'r'        #  0x0072 -> LATIN SMALL LETTER R
    's'        #  0x0073 -> LATIN SMALL LETTER S
    't'        #  0x0074 -> LATIN SMALL LETTER T
    'u'        #  0x0075 -> LATIN SMALL LETTER U
    'v'        #  0x0076 -> LATIN SMALL LETTER V
    'w'        #  0x0077 -> LATIN SMALL LETTER W
    'x'        #  0x0078 -> LATIN SMALL LETTER X
    'y'        #  0x0079 -> LATIN SMALL LETTER Y
    'z'        #  0x007a -> LATIN SMALL LETTER Z
    '{'        #  0x007b -> LEFT CURLY BRACKET
    '|'        #  0x007c -> VERTICAL LINE
    '}'        #  0x007d -> RIGHT CURLY BRACKET
    '~'        #  0x007e -> TILDE
    '\x7f'     #  0x007f -> DELETE
    '\xc7'     #  0x0080 -> LATIN CAPITAL LETTER C WITH CEDILLA
    '\xfc'     #  0x0081 -> LATIN SMALL LETTER U WITH DIAERESIS
    '\xe9'     #  0x0082 -> LATIN SMALL LETTER E WITH ACUTE
    '\xe2'     #  0x0083 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\xe4'     #  0x0084 -> LATIN SMALL LETTER A WITH DIAERESIS
    '\u016f'   #  0x0085 -> LATIN SMALL LETTER U WITH RING ABOVE
    '\u0107'   #  0x0086 -> LATIN SMALL LETTER C WITH ACUTE
    '\xe7'     #  0x0087 -> LATIN SMALL LETTER C WITH CEDILLA
    '\u0142'   #  0x0088 -> LATIN SMALL LETTER L WITH STROKE
    '\xeb'     #  0x0089 -> LATIN SMALL LETTER E WITH DIAERESIS
    '\u0150'   #  0x008a -> LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
    '\u0151'   #  0x008b -> LATIN SMALL LETTER O WITH DOUBLE ACUTE
    '\xee'     #  0x008c -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\u0179'   #  0x008d -> LATIN CAPITAL LETTER Z WITH ACUTE
    '\xc4'     #  0x008e -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\u0106'   #  0x008f -> LATIN CAPITAL LETTER C WITH ACUTE
    '\xc9'     #  0x0090 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\u0139'   #  0x0091 -> LATIN CAPITAL LETTER L WITH ACUTE
    '\u013a'   #  0x0092 -> LATIN SMALL LETTER L WITH ACUTE
    '\xf4'     #  0x0093 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xf6'     #  0x0094 -> LATIN SMALL LETTER O WITH DIAERESIS
    '\u013d'   #  0x0095 -> LATIN CAPITAL LETTER L WITH CARON
    '\u013e'   #  0x0096 -> LATIN SMALL LETTER L WITH CARON
    '\u015a'   #  0x0097 -> LATIN CAPITAL LETTER S WITH ACUTE
    '\u015b'   #  0x0098 -> LATIN SMALL LETTER S WITH ACUTE
    '\xd6'     #  0x0099 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xdc'     #  0x009a -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\u0164'   #  0x009b -> LATIN CAPITAL LETTER T WITH CARON
    '\u0165'   #  0x009c -> LATIN SMALL LETTER T WITH CARON
    '\u0141'   #  0x009d -> LATIN CAPITAL LETTER L WITH STROKE
    '\xd7'     #  0x009e -> MULTIPLICATION SIGN
    '\u010d'   #  0x009f -> LATIN SMALL LETTER C WITH CARON
    '\xe1'     #  0x00a0 -> LATIN SMALL LETTER A WITH ACUTE
    '\xed'     #  0x00a1 -> LATIN SMALL LETTER I WITH ACUTE
    '\xf3'     #  0x00a2 -> LATIN SMALL LETTER O WITH ACUTE
    '\xfa'     #  0x00a3 -> LATIN SMALL LETTER U WITH ACUTE
    '\u0104'   #  0x00a4 -> LATIN CAPITAL LETTER A WITH OGONEK
    '\u0105'   #  0x00a5 -> LATIN SMALL LETTER A WITH OGONEK
    '\u017d'   #  0x00a6 -> LATIN CAPITAL LETTER Z WITH CARON
    '\u017e'   #  0x00a7 -> LATIN SMALL LETTER Z WITH CARON
    '\u0118'   #  0x00a8 -> LATIN CAPITAL LETTER E WITH OGONEK
    '\u0119'   #  0x00a9 -> LATIN SMALL LETTER E WITH OGONEK
    '\xac'     #  0x00aa -> NOT SIGN
    '\u017a'   #  0x00ab -> LATIN SMALL LETTER Z WITH ACUTE
    '\u010c'   #  0x00ac -> LATIN CAPITAL LETTER C WITH CARON
    '\u015f'   #  0x00ad -> LATIN SMALL LETTER S WITH CEDILLA
    '\xab'     #  0x00ae -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbb'     #  0x00af -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u2591'   #  0x00b0 -> LIGHT SHADE
    '\u2592'   #  0x00b1 -> MEDIUM SHADE
    '\u2593'   #  0x00b2 -> DARK SHADE
    '\u2502'   #  0x00b3 -> BOX DRAWINGS LIGHT VERTICAL
    '\u2524'   #  0x00b4 -> BOX DRAWINGS LIGHT VERTICAL AND LEFT
    '\xc1'     #  0x00b5 -> LATIN CAPITAL LETTER A WITH ACUTE
    '\xc2'     #  0x00b6 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    '\u011a'   #  0x00b7 -> LATIN CAPITAL LETTER E WITH CARON
    '\u015e'   #  0x00b8 -> LATIN CAPITAL LETTER S WITH CEDILLA
    '\u2563'   #  0x00b9 -> BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    '\u2551'   #  0x00ba -> BOX DRAWINGS DOUBLE VERTICAL
    '\u2557'   #  0x00bb -> BOX DRAWINGS DOUBLE DOWN AND LEFT
    '\u255d'   #  0x00bc -> BOX DRAWINGS DOUBLE UP AND LEFT
    '\u017b'   #  0x00bd -> LATIN CAPITAL LETTER Z WITH DOT ABOVE
    '\u017c'   #  0x00be -> LATIN SMALL LETTER Z WITH DOT ABOVE
    '\u2510'   #  0x00bf -> BOX DRAWINGS LIGHT DOWN AND LEFT
    '\u2514'   #  0x00c0 -> BOX DRAWINGS LIGHT UP AND RIGHT
    '\u2534'   #  0x00c1 -> BOX DRAWINGS LIGHT UP AND HORIZONTAL
    '\u252c'   #  0x00c2 -> BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    '\u251c'   #  0x00c3 -> BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    '\u2500'   #  0x00c4 -> BOX DRAWINGS LIGHT HORIZONTAL
    '\u253c'   #  0x00c5 -> BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    '\u0102'   #  0x00c6 -> LATIN CAPITAL LETTER A WITH BREVE
    '\u0103'   #  0x00c7 -> LATIN SMALL LETTER A WITH BREVE
    '\u255a'   #  0x00c8 -> BOX DRAWINGS DOUBLE UP AND RIGHT
    '\u2554'   #  0x00c9 -> BOX DRAWINGS DOUBLE DOWN AND RIGHT
    '\u2569'   #  0x00ca -> BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    '\u2566'   #  0x00cb -> BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    '\u2560'   #  0x00cc -> BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    '\u2550'   #  0x00cd -> BOX DRAWINGS DOUBLE HORIZONTAL
    '\u256c'   #  0x00ce -> BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    '\xa4'     #  0x00cf -> CURRENCY SIGN
    '\u0111'   #  0x00d0 -> LATIN SMALL LETTER D WITH STROKE
    '\u0110'   #  0x00d1 -> LATIN CAPITAL LETTER D WITH STROKE
    '\u010e'   #  0x00d2 -> LATIN CAPITAL LETTER D WITH CARON
    '\xcb'     #  0x00d3 -> LATIN CAPITAL LETTER E WITH DIAERESIS
    '\u010f'   #  0x00d4 -> LATIN SMALL LETTER D WITH CARON
    '\u0147'   #  0x00d5 -> LATIN CAPITAL LETTER N WITH CARON
    '\xcd'     #  0x00d6 -> LATIN CAPITAL LETTER I WITH ACUTE
    '\xce'     #  0x00d7 -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    '\u011b'   #  0x00d8 -> LATIN SMALL LETTER E WITH CARON
    '\u2518'   #  0x00d9 -> BOX DRAWINGS LIGHT UP AND LEFT
    '\u250c'   #  0x00da -> BOX DRAWINGS LIGHT DOWN AND RIGHT
    '\u2588'   #  0x00db -> FULL BLOCK
    '\u2584'   #  0x00dc -> LOWER HALF BLOCK
    '\u0162'   #  0x00dd -> LATIN CAPITAL LETTER T WITH CEDILLA
    '\u016e'   #  0x00de -> LATIN CAPITAL LETTER U WITH RING ABOVE
    '\u2580'   #  0x00df -> UPPER HALF BLOCK
    '\xd3'     #  0x00e0 -> LATIN CAPITAL LETTER O WITH ACUTE
    '\xdf'     #  0x00e1 -> LATIN SMALL LETTER SHARP S
    '\xd4'     #  0x00e2 -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    '\u0143'   #  0x00e3 -> LATIN CAPITAL LETTER N WITH ACUTE
    '\u0144'   #  0x00e4 -> LATIN SMALL LETTER N WITH ACUTE
    '\u0148'   #  0x00e5 -> LATIN SMALL LETTER N WITH CARON
    '\u0160'   #  0x00e6 -> LATIN CAPITAL LETTER S WITH CARON
    '\u0161'   #  0x00e7 -> LATIN SMALL LETTER S WITH CARON
    '\u0154'   #  0x00e8 -> LATIN CAPITAL LETTER R WITH ACUTE
    '\xda'     #  0x00e9 -> LATIN CAPITAL LETTER U WITH ACUTE
    '\u0155'   #  0x00ea -> LATIN SMALL LETTER R WITH ACUTE
    '\u0170'   #  0x00eb -> LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
    '\xfd'     #  0x00ec -> LATIN SMALL LETTER Y WITH ACUTE
    '\xdd'     #  0x00ed -> LATIN CAPITAL LETTER Y WITH ACUTE
    '\u0163'   #  0x00ee -> LATIN SMALL LETTER T WITH CEDILLA
    '\xb4'     #  0x00ef -> ACUTE ACCENT
    '\xad'     #  0x00f0 -> SOFT HYPHEN
    '\u02dd'   #  0x00f1 -> DOUBLE ACUTE ACCENT
    '\u02db'   #  0x00f2 -> OGONEK
    '\u02c7'   #  0x00f3 -> CARON
    '\u02d8'   #  0x00f4 -> BREVE
    '\xa7'     #  0x00f5 -> SECTION SIGN
    '\xf7'     #  0x00f6 -> DIVISION SIGN
    '\xb8'     #  0x00f7 -> CEDILLA
    '\xb0'     #  0x00f8 -> DEGREE SIGN
    '\xa8'     #  0x00f9 -> DIAERESIS
    '\u02d9'   #  0x00fa -> DOT ABOVE
    '\u0171'   #  0x00fb -> LATIN SMALL LETTER U WITH DOUBLE ACUTE
    '\u0158'   #  0x00fc -> LATIN CAPITAL LETTER R WITH CARON
    '\u0159'   #  0x00fd -> LATIN SMALL LETTER R WITH CARON
    '\u25a0'   #  0x00fe -> BLACK SQUARE
    '\xa0'     #  0x00ff -> NO-BREAK SPACE
)

### Encoding Map

encoding_map = {
    0x0000: 0x0000,     #  NULL
    0x0001: 0x0001,     #  START OF HEADING
    0x0002: 0x0002,     #  START OF TEXT
    0x0003: 0x0003,     #  END OF TEXT
    0x0004: 0x0004,     #  END OF TRANSMISSION
    0x0005: 0x0005,     #  ENQUIRY
    0x0006: 0x0006,     #  ACKNOWLEDGE
    0x0007: 0x0007,     #  BELL
    0x0008: 0x0008,     #  BACKSPACE
    0x0009: 0x0009,     #  HORIZONTAL TABULATION
    0x000a: 0x000a,     #  LINE FEED
    0x000b: 0x000b,     #  VERTICAL TABULATION
    0x000c: 0x000c,     #  FORM FEED
    0x000d: 0x000d,     #  CARRIAGE RETURN
    0x000e: 0x000e,     #  SHIFT OUT
    0x000f: 0x000f,     #  SHIFT IN
    0x0010: 0x0010,     #  DATA LINK ESCAPE
    0x0011: 0x0011,     #  DEVICE CONTROL ONE
    0x0012: 0x0012,     #  DEVICE CONTROL TWO
    0x0013: 0x0013,     #  DEVICE CONTROL THREE
    0x0014: 0x0014,     #  DEVICE CONTROL FOUR
    0x0015: 0x0015,     #  NEGATIVE ACKNOWLEDGE
    0x0016: 0x0016,     #  SYNCHRONOUS IDLE
    0x0017: 0x0017,     #  END OF TRANSMISSION BLOCK
    0x0018: 0x0018,     #  CANCEL
    0x0019: 0x0019,     #  END OF MEDIUM
    0x001a: 0x001a,     #  SUBSTITUTE
    0x001b: 0x001b,     #  ESCAPE
    0x001c: 0x001c,     #  FILE SEPARATOR
    0x001d: 0x001d,     #  GROUP SEPARATOR
    0x001e: 0x001e,     #  RECORD SEPARATOR
    0x001f: 0x001f,     #  UNIT SEPARATOR
    0x0020: 0x0020,     #  SPACE
    0x0021: 0x0021,     #  EXCLAMATION MARK
    0x0022: 0x0022,     #  QUOTATION MARK
    0x0023: 0x0023,     #  NUMBER SIGN
    0x0024: 0x0024,     #  DOLLAR SIGN
    0x0025: 0x0025,     #  PERCENT SIGN
    0x0026: 0x0026,     #  AMPERSAND
    0x0027: 0x0027,     #  APOSTROPHE
    0x0028: 0x0028,     #  LEFT PARENTHESIS
    0x0029: 0x0029,     #  RIGHT PARENTHESIS
    0x002a: 0x002a,     #  ASTERISK
    0x002b: 0x002b,     #  PLUS SIGN
    0x002c: 0x002c,     #  COMMA
    0x002d: 0x002d,     #  HYPHEN-MINUS
    0x002e: 0x002e,     #  FULL STOP
    0x002f: 0x002f,     #  SOLIDUS
    0x0030: 0x0030,     #  DIGIT ZERO
    0x0031: 0x0031,     #  DIGIT ONE
    0x0032: 0x0032,     #  DIGIT TWO
    0x0033: 0x0033,     #  DIGIT THREE
    0x0034: 0x0034,     #  DIGIT FOUR
    0x0035: 0x0035,     #  DIGIT FIVE
    0x0036: 0x0036,     #  DIGIT SIX
    0x0037: 0x0037,     #  DIGIT SEVEN
    0x0038: 0x0038,     #  DIGIT EIGHT
    0x0039: 0x0039,     #  DIGIT NINE
    0x003a: 0x003a,     #  COLON
    0x003b: 0x003b,     #  SEMICOLON
    0x003c: 0x003c,     #  LESS-THAN SIGN
    0x003d: 0x003d,     #  EQUALS SIGN
    0x003e: 0x003e,     #  GREATER-THAN SIGN
    0x003f: 0x003f,     #  QUESTION MARK
    0x0040: 0x0040,     #  COMMERCIAL AT
    0x0041: 0x0041,     #  LATIN CAPITAL LETTER A
    0x0042: 0x0042,     #  LATIN CAPITAL LETTER B
    0x0043: 0x0043,     #  LATIN CAPITAL LETTER C
    0x0044: 0x0044,     #  LATIN CAPITAL LETTER D
    0x0045: 0x0045,     #  LATIN CAPITAL LETTER E
    0x0046: 0x0046,     #  LATIN CAPITAL LETTER F
    0x0047: 0x0047,     #  LATIN CAPITAL LETTER G
    0x0048: 0x0048,     #  LATIN CAPITAL LETTER H
    0x0049: 0x0049,     #  LATIN CAPITAL LETTER I
    0x004a: 0x004a,     #  LATIN CAPITAL LETTER J
    0x004b: 0x004b,     #  LATIN CAPITAL LETTER K
    0x004c: 0x004c,     #  LATIN CAPITAL LETTER L
    0x004d: 0x004d,     #  LATIN CAPITAL LETTER M
    0x004e: 0x004e,     #  LATIN CAPITAL LETTER N
    0x004f: 0x004f,     #  LATIN CAPITAL LETTER O
    0x0050: 0x0050,     #  LATIN CAPITAL LETTER P
    0x0051: 0x0051,     #  LATIN CAPITAL LETTER Q
    0x0052: 0x0052,     #  LATIN CAPITAL LETTER R
    0x0053: 0x0053,     #  LATIN CAPITAL LETTER S
    0x0054: 0x0054,     #  LATIN CAPITAL LETTER T
    0x0055: 0x0055,     #  LATIN CAPITAL LETTER U
    0x0056: 0x0056,     #  LATIN CAPITAL LETTER V
    0x0057: 0x0057,     #  LATIN CAPITAL LETTER W
    0x0058: 0x0058,     #  LATIN CAPITAL LETTER X
    0x0059: 0x0059,     #  LATIN CAPITAL LETTER Y
    0x005a: 0x005a,     #  LATIN CAPITAL LETTER Z
    0x005b: 0x005b,     #  LEFT SQUARE BRACKET
    0x005c: 0x005c,     #  REVERSE SOLIDUS
    0x005d: 0x005d,     #  RIGHT SQUARE BRACKET
    0x005e: 0x005e,     #  CIRCUMFLEX ACCENT
    0x005f: 0x005f,     #  LOW LINE
    0x0060: 0x0060,     #  GRAVE ACCENT
    0x0061: 0x0061,     #  LATIN SMALL LETTER A
    0x0062: 0x0062,     #  LATIN SMALL LETTER B
    0x0063: 0x0063,     #  LATIN SMALL LETTER C
    0x0064: 0x0064,     #  LATIN SMALL LETTER D
    0x0065: 0x0065,     #  LATIN SMALL LETTER E
    0x0066: 0x0066,     #  LATIN SMALL LETTER F
    0x0067: 0x0067,     #  LATIN SMALL LETTER G
    0x0068: 0x0068,     #  LATIN SMALL LETTER H
    0x0069: 0x0069,     #  LATIN SMALL LETTER I
    0x006a: 0x006a,     #  LATIN SMALL LETTER J
    0x006b: 0x006b,     #  LATIN SMALL LETTER K
    0x006c: 0x006c,     #  LATIN SMALL LETTER L
    0x006d: 0x006d,     #  LATIN SMALL LETTER M
    0x006e: 0x006e,     #  LATIN SMALL LETTER N
    0x006f: 0x006f,     #  LATIN SMALL LETTER O
    0x0070: 0x0070,     #  LATIN SMALL LETTER P
    0x0071: 0x0071,     #  LATIN SMALL LETTER Q
    0x0072: 0x0072,     #  LATIN SMALL LETTER R
    0x0073: 0x0073,     #  LATIN SMALL LETTER S
    0x0074: 0x0074,     #  LATIN SMALL LETTER T
    0x0075: 0x0075,     #  LATIN SMALL LETTER U
    0x0076: 0x0076,     #  LATIN SMALL LETTER V
    0x0077: 0x0077,     #  LATIN SMALL LETTER W
    0x0078: 0x0078,     #  LATIN SMALL LETTER X
    0x0079: 0x0079,     #  LATIN SMALL LETTER Y
    0x007a: 0x007a,     #  LATIN SMALL LETTER Z
    0x007b: 0x007b,     #  LEFT CURLY BRACKET
    0x007c: 0x007c,     #  VERTICAL LINE
    0x007d: 0x007d,     #  RIGHT CURLY BRACKET
    0x007e: 0x007e,     #  TILDE
    0x007f: 0x007f,     #  DELETE
    0x00a0: 0x00ff,     #  NO-BREAK SPACE
    0x00a4: 0x00cf,     #  CURRENCY SIGN
    0x00a7: 0x00f5,     #  SECTION SIGN
    0x00a8: 0x00f9,     #  DIAERESIS
    0x00ab: 0x00ae,     #  LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00ac: 0x00aa,     #  NOT SIGN
    0x00ad: 0x00f0,     #  SOFT HYPHEN
    0x00b0: 0x00f8,     #  DEGREE SIGN
    0x00b4: 0x00ef,     #  ACUTE ACCENT
    0x00b8: 0x00f7,     #  CEDILLA
    0x00bb: 0x00af,     #  RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00c1: 0x00b5,     #  LATIN CAPITAL LETTER A WITH ACUTE
    0x00c2: 0x00b6,     #  LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    0x00c4: 0x008e,     #  LATIN CAPITAL LETTER A WITH DIAERESIS
    0x00c7: 0x0080,     #  LATIN CAPITAL LETTER C WITH CEDILLA
    0x00c9: 0x0090,     #  LATIN CAPITAL LETTER E WITH ACUTE
    0x00cb: 0x00d3,     #  LATIN CAPITAL LETTER E WITH DIAERESIS
    0x00cd: 0x00d6,     #  LATIN CAPITAL LETTER I WITH ACUTE
    0x00ce: 0x00d7,     #  LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    0x00d3: 0x00e0,     #  LATIN CAPITAL LETTER O WITH ACUTE
    0x00d4: 0x00e2,     #  LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    0x00d6: 0x0099,     #  LATIN CAPITAL LETTER O WITH DIAERESIS
    0x00d7: 0x009e,     #  MULTIPLICATION SIGN
    0x00da: 0x00e9,     #  LATIN CAPITAL LETTER U WITH ACUTE
    0x00dc: 0x009a,     #  LATIN CAPITAL LETTER U WITH DIAERESIS
    0x00dd: 0x00ed,     #  LATIN CAPITAL LETTER Y WITH ACUTE
    0x00df: 0x00e1,     #  LATIN SMALL LETTER SHARP S
    0x00e1: 0x00a0,     #  LATIN SMALL LETTER A WITH ACUTE
    0x00e2: 0x0083,     #  LATIN SMALL LETTER A WITH CIRCUMFLEX
    0x00e4: 0x0084,     #  LATIN SMALL LETTER A WITH DIAERESIS
    0x00e7: 0x0087,     #  LATIN SMALL LETTER C WITH CEDILLA
    0x00e9: 0x0082,     #  LATIN SMALL LETTER E WITH ACUTE
    0x00eb: 0x0089,     #  LATIN SMALL LETTER E WITH DIAERESIS
    0x00ed: 0x00a1,     #  LATIN SMALL LETTER I WITH ACUTE
    0x00ee: 0x008c,     #  LATIN SMALL LETTER I WITH CIRCUMFLEX
    0x00f3: 0x00a2,     #  LATIN SMALL LETTER O WITH ACUTE
    0x00f4: 0x0093,     #  LATIN SMALL LETTER O WITH CIRCUMFLEX
    0x00f6: 0x0094,     #  LATIN SMALL LETTER O WITH DIAERESIS
    0x00f7: 0x00f6,     #  DIVISION SIGN
    0x00fa: 0x00a3,     #  LATIN SMALL LETTER U WITH ACUTE
    0x00fc: 0x0081,     #  LATIN SMALL LETTER U WITH DIAERESIS
    0x00fd: 0x00ec,     #  LATIN SMALL LETTER Y WITH ACUTE
    0x0102: 0x00c6,     #  LATIN CAPITAL LETTER A WITH BREVE
    0x0103: 0x00c7,     #  LATIN SMALL LETTER A WITH BREVE
    0x0104: 0x00a4,     #  LATIN CAPITAL LETTER A WITH OGONEK
    0x0105: 0x00a5,     #  LATIN SMALL LETTER A WITH OGONEK
    0x0106: 0x008f,     #  LATIN CAPITAL LETTER C WITH ACUTE
    0x0107: 0x0086,     #  LATIN SMALL LETTER C WITH ACUTE
    0x010c: 0x00ac,     #  LATIN CAPITAL LETTER C WITH CARON
    0x010d: 0x009f,     #  LATIN SMALL LETTER C WITH CARON
    0x010e: 0x00d2,     #  LATIN CAPITAL LETTER D WITH CARON
    0x010f: 0x00d4,     #  LATIN SMALL LETTER D WITH CARON
    0x0110: 0x00d1,     #  LATIN CAPITAL LETTER D WITH STROKE
    0x0111: 0x00d0,     #  LATIN SMALL LETTER D WITH STROKE
    0x0118: 0x00a8,     #  LATIN CAPITAL LETTER E WITH OGONEK
    0x0119: 0x00a9,     #  LATIN SMALL LETTER E WITH OGONEK
    0x011a: 0x00b7,     #  LATIN CAPITAL LETTER E WITH CARON
    0x011b: 0x00d8,     #  LATIN SMALL LETTER E WITH CARON
    0x0139: 0x0091,     #  LATIN CAPITAL LETTER L WITH ACUTE
    0x013a: 0x0092,     #  LATIN SMALL LETTER L WITH ACUTE
    0x013d: 0x0095,     #  LATIN CAPITAL LETTER L WITH CARON
    0x013e: 0x0096,     #  LATIN SMALL LETTER L WITH CARON
    0x0141: 0x009d,     #  LATIN CAPITAL LETTER L WITH STROKE
    0x0142: 0x0088,     #  LATIN SMALL LETTER L WITH STROKE
    0x0143: 0x00e3,     #  LATIN CAPITAL LETTER N WITH ACUTE
    0x0144: 0x00e4,     #  LATIN SMALL LETTER N WITH ACUTE
    0x0147: 0x00d5,     #  LATIN CAPITAL LETTER N WITH CARON
    0x0148: 0x00e5,     #  LATIN SMALL LETTER N WITH CARON
    0x0150: 0x008a,     #  LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
    0x0151: 0x008b,     #  LATIN SMALL LETTER O WITH DOUBLE ACUTE
    0x0154: 0x00e8,     #  LATIN CAPITAL LETTER R WITH ACUTE
    0x0155: 0x00ea,     #  LATIN SMALL LETTER R WITH ACUTE
    0x0158: 0x00fc,     #  LATIN CAPITAL LETTER R WITH CARON
    0x0159: 0x00fd,     #  LATIN SMALL LETTER R WITH CARON
    0x015a: 0x0097,     #  LATIN CAPITAL LETTER S WITH ACUTE
    0x015b: 0x0098,     #  LATIN SMALL LETTER S WITH ACUTE
    0x015e: 0x00b8,     #  LATIN CAPITAL LETTER S WITH CEDILLA
    0x015f: 0x00ad,     #  LATIN SMALL LETTER S WITH CEDILLA
    0x0160: 0x00e6,     #  LATIN CAPITAL LETTER S WITH CARON
    0x0161: 0x00e7,     #  LATIN SMALL LETTER S WITH CARON
    0x0162: 0x00dd,     #  LATIN CAPITAL LETTER T WITH CEDILLA
    0x0163: 0x00ee,     #  LATIN SMALL LETTER T WITH CEDILLA
    0x0164: 0x009b,     #  LATIN CAPITAL LETTER T WITH CARON
    0x0165: 0x009c,     #  LATIN SMALL LETTER T WITH CARON
    0x016e: 0x00de,     #  LATIN CAPITAL LETTER U WITH RING ABOVE
    0x016f: 0x0085,     #  LATIN SMALL LETTER U WITH RING ABOVE
    0x0170: 0x00eb,     #  LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
    0x0171: 0x00fb,     #  LATIN SMALL LETTER U WITH DOUBLE ACUTE
    0x0179: 0x008d,     #  LATIN CAPITAL LETTER Z WITH ACUTE
    0x017a: 0x00ab,     #  LATIN SMALL LETTER Z WITH ACUTE
    0x017b: 0x00bd,     #  LATIN CAPITAL LETTER Z WITH DOT ABOVE
    0x017c: 0x00be,     #  LATIN SMALL LETTER Z WITH DOT ABOVE
    0x017d: 0x00a6,     #  LATIN CAPITAL LETTER Z WITH CARON
    0x017e: 0x00a7,     #  LATIN SMALL LETTER Z WITH CARON
    0x02c7: 0x00f3,     #  CARON
    0x02d8: 0x00f4,     #  BREVE
    0x02d9: 0x00fa,     #  DOT ABOVE
    0x02db: 0x00f2,     #  OGONEK
    0x02dd: 0x00f1,     #  DOUBLE ACUTE ACCENT
    0x2500: 0x00c4,     #  BOX DRAWINGS LIGHT HORIZONTAL
    0x2502: 0x00b3,     #  BOX DRAWINGS LIGHT VERTICAL
    0x250c: 0x00da,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
    0x2510: 0x00bf,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
    0x2514: 0x00c0,     #  BOX DRAWINGS LIGHT UP AND RIGHT
    0x2518: 0x00d9,     #  BOX DRAWINGS LIGHT UP AND LEFT
    0x251c: 0x00c3,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    0x2524: 0x00b4,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
    0x252c: 0x00c2,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    0x2534: 0x00c1,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
    0x253c: 0x00c5,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    0x2550: 0x00cd,     #  BOX DRAWINGS DOUBLE HORIZONTAL
    0x2551: 0x00ba,     #  BOX DRAWINGS DOUBLE VERTICAL
    0x2554: 0x00c9,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
    0x2557: 0x00bb,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
    0x255a: 0x00c8,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
    0x255d: 0x00bc,     #  BOX DRAWINGS DOUBLE UP AND LEFT
    0x2560: 0x00cc,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    0x2563: 0x00b9,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    0x2566: 0x00cb,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    0x2569: 0x00ca,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    0x256c: 0x00ce,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    0x2580: 0x00df,     #  UPPER HALF BLOCK
    0x2584: 0x00dc,     #  LOWER HALF BLOCK
    0x2588: 0x00db,     #  FULL BLOCK
    0x2591: 0x00b0,     #  LIGHT SHADE
    0x2592: 0x00b1,     #  MEDIUM SHADE
    0x2593: 0x00b2,     #  DARK SHADE
    0x25a0: 0x00fe,     #  BLACK SQUARE
}
encodings/punycode.py000064400000015343151153537620010733 0ustar00""" Codec for the Punicode encoding, as specified in RFC 3492

Written by Martin v. Löwis.
"""

import codecs

##################### Encoding #####################################

def segregate(str):
    """3.1 Basic code point segregation"""
    base = bytearray()
    extended = set()
    for c in str:
        if ord(c) < 128:
            base.append(ord(c))
        else:
            extended.add(c)
    extended = sorted(extended)
    return bytes(base), extended

def selective_len(str, max):
    """Return the length of str, considering only characters below max."""
    res = 0
    for c in str:
        if ord(c) < max:
            res += 1
    return res

def selective_find(str, char, index, pos):
    """Return a pair (index, pos), indicating the next occurrence of
    char in str. index is the position of the character considering
    only ordinals up to and including char, and pos is the position in
    the full string. index/pos is the starting position in the full
    string."""

    l = len(str)
    while 1:
        pos += 1
        if pos == l:
            return (-1, -1)
        c = str[pos]
        if c == char:
            return index+1, pos
        elif c < char:
            index += 1

def insertion_unsort(str, extended):
    """3.2 Insertion unsort coding"""
    oldchar = 0x80
    result = []
    oldindex = -1
    for c in extended:
        index = pos = -1
        char = ord(c)
        curlen = selective_len(str, char)
        delta = (curlen+1) * (char - oldchar)
        while 1:
            index,pos = selective_find(str,c,index,pos)
            if index == -1:
                break
            delta += index - oldindex
            result.append(delta-1)
            oldindex = index
            delta = 0
        oldchar = char

    return result

def T(j, bias):
    # Punycode parameters: tmin = 1, tmax = 26, base = 36
    res = 36 * (j + 1) - bias
    if res < 1: return 1
    if res > 26: return 26
    return res

digits = b"abcdefghijklmnopqrstuvwxyz0123456789"
def generate_generalized_integer(N, bias):
    """3.3 Generalized variable-length integers"""
    result = bytearray()
    j = 0
    while 1:
        t = T(j, bias)
        if N < t:
            result.append(digits[N])
            return bytes(result)
        result.append(digits[t + ((N - t) % (36 - t))])
        N = (N - t) // (36 - t)
        j += 1

def adapt(delta, first, numchars):
    if first:
        delta //= 700
    else:
        delta //= 2
    delta += delta // numchars
    # ((base - tmin) * tmax) // 2 == 455
    divisions = 0
    while delta > 455:
        delta = delta // 35 # base - tmin
        divisions += 36
    bias = divisions + (36 * delta // (delta + 38))
    return bias


def generate_integers(baselen, deltas):
    """3.4 Bias adaptation"""
    # Punycode parameters: initial bias = 72, damp = 700, skew = 38
    result = bytearray()
    bias = 72
    for points, delta in enumerate(deltas):
        s = generate_generalized_integer(delta, bias)
        result.extend(s)
        bias = adapt(delta, points==0, baselen+points+1)
    return bytes(result)

def punycode_encode(text):
    base, extended = segregate(text)
    deltas = insertion_unsort(text, extended)
    extended = generate_integers(len(base), deltas)
    if base:
        return base + b"-" + extended
    return extended

##################### Decoding #####################################

def decode_generalized_number(extended, extpos, bias, errors):
    """3.3 Generalized variable-length integers"""
    result = 0
    w = 1
    j = 0
    while 1:
        try:
            char = ord(extended[extpos])
        except IndexError:
            if errors == "strict":
                raise UnicodeError("incomplete punicode string")
            return extpos + 1, None
        extpos += 1
        if 0x41 <= char <= 0x5A: # A-Z
            digit = char - 0x41
        elif 0x30 <= char <= 0x39:
            digit = char - 22 # 0x30-26
        elif errors == "strict":
            raise UnicodeError("Invalid extended code point '%s'"
                               % extended[extpos-1])
        else:
            return extpos, None
        t = T(j, bias)
        result += digit * w
        if digit < t:
            return extpos, result
        w = w * (36 - t)
        j += 1


def insertion_sort(base, extended, errors):
    """3.2 Insertion unsort coding"""
    char = 0x80
    pos = -1
    bias = 72
    extpos = 0
    while extpos < len(extended):
        newpos, delta = decode_generalized_number(extended, extpos,
                                                  bias, errors)
        if delta is None:
            # There was an error in decoding. We can't continue because
            # synchronization is lost.
            return base
        pos += delta+1
        char += pos // (len(base) + 1)
        if char > 0x10FFFF:
            if errors == "strict":
                raise UnicodeError("Invalid character U+%x" % char)
            char = ord('?')
        pos = pos % (len(base) + 1)
        base = base[:pos] + chr(char) + base[pos:]
        bias = adapt(delta, (extpos == 0), len(base))
        extpos = newpos
    return base

def punycode_decode(text, errors):
    if isinstance(text, str):
        text = text.encode("ascii")
    if isinstance(text, memoryview):
        text = bytes(text)
    pos = text.rfind(b"-")
    if pos == -1:
        base = ""
        extended = str(text, "ascii").upper()
    else:
        base = str(text[:pos], "ascii", errors)
        extended = str(text[pos+1:], "ascii").upper()
    return insertion_sort(base, extended, errors)

### Codec APIs

class Codec(codecs.Codec):

    def encode(self, input, errors='strict'):
        res = punycode_encode(input)
        return res, len(input)

    def decode(self, input, errors='strict'):
        if errors not in ('strict', 'replace', 'ignore'):
            raise UnicodeError("Unsupported error handling "+errors)
        res = punycode_decode(input, errors)
        return res, len(input)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return punycode_encode(input)

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        if self.errors not in ('strict', 'replace', 'ignore'):
            raise UnicodeError("Unsupported error handling "+self.errors)
        return punycode_decode(input, self.errors)

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='punycode',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamwriter=StreamWriter,
        streamreader=StreamReader,
    )
encodings/mbcs.py000064400000002273151153537620010027 0ustar00""" Python 'mbcs' Codec for Windows


Cloned by Mark Hammond (mhammond@skippinet.com.au) from ascii.py,
which was written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

"""
# Import them explicitly to cause an ImportError
# on non-Windows systems
from codecs import mbcs_encode, mbcs_decode
# for IncrementalDecoder, IncrementalEncoder, ...
import codecs

### Codec APIs

encode = mbcs_encode

def decode(input, errors='strict'):
    return mbcs_decode(input, errors, True)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return mbcs_encode(input, self.errors)[0]

class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
    _buffer_decode = mbcs_decode

class StreamWriter(codecs.StreamWriter):
    encode = mbcs_encode

class StreamReader(codecs.StreamReader):
    decode = mbcs_decode

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='mbcs',
        encode=encode,
        decode=decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/hp_roman8.py000064400000032243151153537620010776 0ustar00""" Python Character Mapping Codec generated from 'hp_roman8.txt' with gencodec.py.

    Based on data from ftp://dkuug.dk/i18n/charmaps/HP-ROMAN8 (Keld Simonsen)

    Original source: LaserJet IIP Printer User's Manual HP part no
    33471-90901, Hewlet-Packard, June 1989.

    (Used with permission)

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='hp-roman8',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamwriter=StreamWriter,
        streamreader=StreamReader,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\x80'     #  0x80 -> <control>
    '\x81'     #  0x81 -> <control>
    '\x82'     #  0x82 -> <control>
    '\x83'     #  0x83 -> <control>
    '\x84'     #  0x84 -> <control>
    '\x85'     #  0x85 -> <control>
    '\x86'     #  0x86 -> <control>
    '\x87'     #  0x87 -> <control>
    '\x88'     #  0x88 -> <control>
    '\x89'     #  0x89 -> <control>
    '\x8a'     #  0x8A -> <control>
    '\x8b'     #  0x8B -> <control>
    '\x8c'     #  0x8C -> <control>
    '\x8d'     #  0x8D -> <control>
    '\x8e'     #  0x8E -> <control>
    '\x8f'     #  0x8F -> <control>
    '\x90'     #  0x90 -> <control>
    '\x91'     #  0x91 -> <control>
    '\x92'     #  0x92 -> <control>
    '\x93'     #  0x93 -> <control>
    '\x94'     #  0x94 -> <control>
    '\x95'     #  0x95 -> <control>
    '\x96'     #  0x96 -> <control>
    '\x97'     #  0x97 -> <control>
    '\x98'     #  0x98 -> <control>
    '\x99'     #  0x99 -> <control>
    '\x9a'     #  0x9A -> <control>
    '\x9b'     #  0x9B -> <control>
    '\x9c'     #  0x9C -> <control>
    '\x9d'     #  0x9D -> <control>
    '\x9e'     #  0x9E -> <control>
    '\x9f'     #  0x9F -> <control>
    '\xa0'     #  0xA0 -> NO-BREAK SPACE
    '\xc0'     #  0xA1 -> LATIN CAPITAL LETTER A WITH GRAVE
    '\xc2'     #  0xA2 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    '\xc8'     #  0xA3 -> LATIN CAPITAL LETTER E WITH GRAVE
    '\xca'     #  0xA4 -> LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    '\xcb'     #  0xA5 -> LATIN CAPITAL LETTER E WITH DIAERESIS
    '\xce'     #  0xA6 -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    '\xcf'     #  0xA7 -> LATIN CAPITAL LETTER I WITH DIAERESIS
    '\xb4'     #  0xA8 -> ACUTE ACCENT
    '\u02cb'   #  0xA9 -> MODIFIER LETTER GRAVE ACCENT (MANDARIN CHINESE FOURTH TONE)
    '\u02c6'   #  0xAA -> MODIFIER LETTER CIRCUMFLEX ACCENT
    '\xa8'     #  0xAB -> DIAERESIS
    '\u02dc'   #  0xAC -> SMALL TILDE
    '\xd9'     #  0xAD -> LATIN CAPITAL LETTER U WITH GRAVE
    '\xdb'     #  0xAE -> LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    '\u20a4'   #  0xAF -> LIRA SIGN
    '\xaf'     #  0xB0 -> MACRON
    '\xdd'     #  0xB1 -> LATIN CAPITAL LETTER Y WITH ACUTE
    '\xfd'     #  0xB2 -> LATIN SMALL LETTER Y WITH ACUTE
    '\xb0'     #  0xB3 -> DEGREE SIGN
    '\xc7'     #  0xB4 -> LATIN CAPITAL LETTER C WITH CEDILLA
    '\xe7'     #  0xB5 -> LATIN SMALL LETTER C WITH CEDILLA
    '\xd1'     #  0xB6 -> LATIN CAPITAL LETTER N WITH TILDE
    '\xf1'     #  0xB7 -> LATIN SMALL LETTER N WITH TILDE
    '\xa1'     #  0xB8 -> INVERTED EXCLAMATION MARK
    '\xbf'     #  0xB9 -> INVERTED QUESTION MARK
    '\xa4'     #  0xBA -> CURRENCY SIGN
    '\xa3'     #  0xBB -> POUND SIGN
    '\xa5'     #  0xBC -> YEN SIGN
    '\xa7'     #  0xBD -> SECTION SIGN
    '\u0192'   #  0xBE -> LATIN SMALL LETTER F WITH HOOK
    '\xa2'     #  0xBF -> CENT SIGN
    '\xe2'     #  0xC0 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\xea'     #  0xC1 -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xf4'     #  0xC2 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xfb'     #  0xC3 -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\xe1'     #  0xC4 -> LATIN SMALL LETTER A WITH ACUTE
    '\xe9'     #  0xC5 -> LATIN SMALL LETTER E WITH ACUTE
    '\xf3'     #  0xC6 -> LATIN SMALL LETTER O WITH ACUTE
    '\xfa'     #  0xC7 -> LATIN SMALL LETTER U WITH ACUTE
    '\xe0'     #  0xC8 -> LATIN SMALL LETTER A WITH GRAVE
    '\xe8'     #  0xC9 -> LATIN SMALL LETTER E WITH GRAVE
    '\xf2'     #  0xCA -> LATIN SMALL LETTER O WITH GRAVE
    '\xf9'     #  0xCB -> LATIN SMALL LETTER U WITH GRAVE
    '\xe4'     #  0xCC -> LATIN SMALL LETTER A WITH DIAERESIS
    '\xeb'     #  0xCD -> LATIN SMALL LETTER E WITH DIAERESIS
    '\xf6'     #  0xCE -> LATIN SMALL LETTER O WITH DIAERESIS
    '\xfc'     #  0xCF -> LATIN SMALL LETTER U WITH DIAERESIS
    '\xc5'     #  0xD0 -> LATIN CAPITAL LETTER A WITH RING ABOVE
    '\xee'     #  0xD1 -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\xd8'     #  0xD2 -> LATIN CAPITAL LETTER O WITH STROKE
    '\xc6'     #  0xD3 -> LATIN CAPITAL LETTER AE
    '\xe5'     #  0xD4 -> LATIN SMALL LETTER A WITH RING ABOVE
    '\xed'     #  0xD5 -> LATIN SMALL LETTER I WITH ACUTE
    '\xf8'     #  0xD6 -> LATIN SMALL LETTER O WITH STROKE
    '\xe6'     #  0xD7 -> LATIN SMALL LETTER AE
    '\xc4'     #  0xD8 -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\xec'     #  0xD9 -> LATIN SMALL LETTER I WITH GRAVE
    '\xd6'     #  0xDA -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xdc'     #  0xDB -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\xc9'     #  0xDC -> LATIN CAPITAL LETTER E WITH ACUTE
    '\xef'     #  0xDD -> LATIN SMALL LETTER I WITH DIAERESIS
    '\xdf'     #  0xDE -> LATIN SMALL LETTER SHARP S (GERMAN)
    '\xd4'     #  0xDF -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    '\xc1'     #  0xE0 -> LATIN CAPITAL LETTER A WITH ACUTE
    '\xc3'     #  0xE1 -> LATIN CAPITAL LETTER A WITH TILDE
    '\xe3'     #  0xE2 -> LATIN SMALL LETTER A WITH TILDE
    '\xd0'     #  0xE3 -> LATIN CAPITAL LETTER ETH (ICELANDIC)
    '\xf0'     #  0xE4 -> LATIN SMALL LETTER ETH (ICELANDIC)
    '\xcd'     #  0xE5 -> LATIN CAPITAL LETTER I WITH ACUTE
    '\xcc'     #  0xE6 -> LATIN CAPITAL LETTER I WITH GRAVE
    '\xd3'     #  0xE7 -> LATIN CAPITAL LETTER O WITH ACUTE
    '\xd2'     #  0xE8 -> LATIN CAPITAL LETTER O WITH GRAVE
    '\xd5'     #  0xE9 -> LATIN CAPITAL LETTER O WITH TILDE
    '\xf5'     #  0xEA -> LATIN SMALL LETTER O WITH TILDE
    '\u0160'   #  0xEB -> LATIN CAPITAL LETTER S WITH CARON
    '\u0161'   #  0xEC -> LATIN SMALL LETTER S WITH CARON
    '\xda'     #  0xED -> LATIN CAPITAL LETTER U WITH ACUTE
    '\u0178'   #  0xEE -> LATIN CAPITAL LETTER Y WITH DIAERESIS
    '\xff'     #  0xEF -> LATIN SMALL LETTER Y WITH DIAERESIS
    '\xde'     #  0xF0 -> LATIN CAPITAL LETTER THORN (ICELANDIC)
    '\xfe'     #  0xF1 -> LATIN SMALL LETTER THORN (ICELANDIC)
    '\xb7'     #  0xF2 -> MIDDLE DOT
    '\xb5'     #  0xF3 -> MICRO SIGN
    '\xb6'     #  0xF4 -> PILCROW SIGN
    '\xbe'     #  0xF5 -> VULGAR FRACTION THREE QUARTERS
    '\u2014'   #  0xF6 -> EM DASH
    '\xbc'     #  0xF7 -> VULGAR FRACTION ONE QUARTER
    '\xbd'     #  0xF8 -> VULGAR FRACTION ONE HALF
    '\xaa'     #  0xF9 -> FEMININE ORDINAL INDICATOR
    '\xba'     #  0xFA -> MASCULINE ORDINAL INDICATOR
    '\xab'     #  0xFB -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u25a0'   #  0xFC -> BLACK SQUARE
    '\xbb'     #  0xFD -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xb1'     #  0xFE -> PLUS-MINUS SIGN
    '\ufffe'
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/cp858.py000064400000102337151153537620007754 0ustar00""" Python Character Mapping Codec for CP858, modified from cp850.

"""

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_map)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_map)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp858',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )

### Decoding Map

decoding_map = codecs.make_identity_dict(range(256))
decoding_map.update({
    0x0080: 0x00c7,     #  LATIN CAPITAL LETTER C WITH CEDILLA
    0x0081: 0x00fc,     #  LATIN SMALL LETTER U WITH DIAERESIS
    0x0082: 0x00e9,     #  LATIN SMALL LETTER E WITH ACUTE
    0x0083: 0x00e2,     #  LATIN SMALL LETTER A WITH CIRCUMFLEX
    0x0084: 0x00e4,     #  LATIN SMALL LETTER A WITH DIAERESIS
    0x0085: 0x00e0,     #  LATIN SMALL LETTER A WITH GRAVE
    0x0086: 0x00e5,     #  LATIN SMALL LETTER A WITH RING ABOVE
    0x0087: 0x00e7,     #  LATIN SMALL LETTER C WITH CEDILLA
    0x0088: 0x00ea,     #  LATIN SMALL LETTER E WITH CIRCUMFLEX
    0x0089: 0x00eb,     #  LATIN SMALL LETTER E WITH DIAERESIS
    0x008a: 0x00e8,     #  LATIN SMALL LETTER E WITH GRAVE
    0x008b: 0x00ef,     #  LATIN SMALL LETTER I WITH DIAERESIS
    0x008c: 0x00ee,     #  LATIN SMALL LETTER I WITH CIRCUMFLEX
    0x008d: 0x00ec,     #  LATIN SMALL LETTER I WITH GRAVE
    0x008e: 0x00c4,     #  LATIN CAPITAL LETTER A WITH DIAERESIS
    0x008f: 0x00c5,     #  LATIN CAPITAL LETTER A WITH RING ABOVE
    0x0090: 0x00c9,     #  LATIN CAPITAL LETTER E WITH ACUTE
    0x0091: 0x00e6,     #  LATIN SMALL LIGATURE AE
    0x0092: 0x00c6,     #  LATIN CAPITAL LIGATURE AE
    0x0093: 0x00f4,     #  LATIN SMALL LETTER O WITH CIRCUMFLEX
    0x0094: 0x00f6,     #  LATIN SMALL LETTER O WITH DIAERESIS
    0x0095: 0x00f2,     #  LATIN SMALL LETTER O WITH GRAVE
    0x0096: 0x00fb,     #  LATIN SMALL LETTER U WITH CIRCUMFLEX
    0x0097: 0x00f9,     #  LATIN SMALL LETTER U WITH GRAVE
    0x0098: 0x00ff,     #  LATIN SMALL LETTER Y WITH DIAERESIS
    0x0099: 0x00d6,     #  LATIN CAPITAL LETTER O WITH DIAERESIS
    0x009a: 0x00dc,     #  LATIN CAPITAL LETTER U WITH DIAERESIS
    0x009b: 0x00f8,     #  LATIN SMALL LETTER O WITH STROKE
    0x009c: 0x00a3,     #  POUND SIGN
    0x009d: 0x00d8,     #  LATIN CAPITAL LETTER O WITH STROKE
    0x009e: 0x00d7,     #  MULTIPLICATION SIGN
    0x009f: 0x0192,     #  LATIN SMALL LETTER F WITH HOOK
    0x00a0: 0x00e1,     #  LATIN SMALL LETTER A WITH ACUTE
    0x00a1: 0x00ed,     #  LATIN SMALL LETTER I WITH ACUTE
    0x00a2: 0x00f3,     #  LATIN SMALL LETTER O WITH ACUTE
    0x00a3: 0x00fa,     #  LATIN SMALL LETTER U WITH ACUTE
    0x00a4: 0x00f1,     #  LATIN SMALL LETTER N WITH TILDE
    0x00a5: 0x00d1,     #  LATIN CAPITAL LETTER N WITH TILDE
    0x00a6: 0x00aa,     #  FEMININE ORDINAL INDICATOR
    0x00a7: 0x00ba,     #  MASCULINE ORDINAL INDICATOR
    0x00a8: 0x00bf,     #  INVERTED QUESTION MARK
    0x00a9: 0x00ae,     #  REGISTERED SIGN
    0x00aa: 0x00ac,     #  NOT SIGN
    0x00ab: 0x00bd,     #  VULGAR FRACTION ONE HALF
    0x00ac: 0x00bc,     #  VULGAR FRACTION ONE QUARTER
    0x00ad: 0x00a1,     #  INVERTED EXCLAMATION MARK
    0x00ae: 0x00ab,     #  LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00af: 0x00bb,     #  RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00b0: 0x2591,     #  LIGHT SHADE
    0x00b1: 0x2592,     #  MEDIUM SHADE
    0x00b2: 0x2593,     #  DARK SHADE
    0x00b3: 0x2502,     #  BOX DRAWINGS LIGHT VERTICAL
    0x00b4: 0x2524,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
    0x00b5: 0x00c1,     #  LATIN CAPITAL LETTER A WITH ACUTE
    0x00b6: 0x00c2,     #  LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    0x00b7: 0x00c0,     #  LATIN CAPITAL LETTER A WITH GRAVE
    0x00b8: 0x00a9,     #  COPYRIGHT SIGN
    0x00b9: 0x2563,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    0x00ba: 0x2551,     #  BOX DRAWINGS DOUBLE VERTICAL
    0x00bb: 0x2557,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
    0x00bc: 0x255d,     #  BOX DRAWINGS DOUBLE UP AND LEFT
    0x00bd: 0x00a2,     #  CENT SIGN
    0x00be: 0x00a5,     #  YEN SIGN
    0x00bf: 0x2510,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
    0x00c0: 0x2514,     #  BOX DRAWINGS LIGHT UP AND RIGHT
    0x00c1: 0x2534,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
    0x00c2: 0x252c,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    0x00c3: 0x251c,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    0x00c4: 0x2500,     #  BOX DRAWINGS LIGHT HORIZONTAL
    0x00c5: 0x253c,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    0x00c6: 0x00e3,     #  LATIN SMALL LETTER A WITH TILDE
    0x00c7: 0x00c3,     #  LATIN CAPITAL LETTER A WITH TILDE
    0x00c8: 0x255a,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
    0x00c9: 0x2554,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
    0x00ca: 0x2569,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    0x00cb: 0x2566,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    0x00cc: 0x2560,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    0x00cd: 0x2550,     #  BOX DRAWINGS DOUBLE HORIZONTAL
    0x00ce: 0x256c,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    0x00cf: 0x00a4,     #  CURRENCY SIGN
    0x00d0: 0x00f0,     #  LATIN SMALL LETTER ETH
    0x00d1: 0x00d0,     #  LATIN CAPITAL LETTER ETH
    0x00d2: 0x00ca,     #  LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    0x00d3: 0x00cb,     #  LATIN CAPITAL LETTER E WITH DIAERESIS
    0x00d4: 0x00c8,     #  LATIN CAPITAL LETTER E WITH GRAVE
    0x00d5: 0x20ac,     #  EURO SIGN
    0x00d6: 0x00cd,     #  LATIN CAPITAL LETTER I WITH ACUTE
    0x00d7: 0x00ce,     #  LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    0x00d8: 0x00cf,     #  LATIN CAPITAL LETTER I WITH DIAERESIS
    0x00d9: 0x2518,     #  BOX DRAWINGS LIGHT UP AND LEFT
    0x00da: 0x250c,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
    0x00db: 0x2588,     #  FULL BLOCK
    0x00dc: 0x2584,     #  LOWER HALF BLOCK
    0x00dd: 0x00a6,     #  BROKEN BAR
    0x00de: 0x00cc,     #  LATIN CAPITAL LETTER I WITH GRAVE
    0x00df: 0x2580,     #  UPPER HALF BLOCK
    0x00e0: 0x00d3,     #  LATIN CAPITAL LETTER O WITH ACUTE
    0x00e1: 0x00df,     #  LATIN SMALL LETTER SHARP S
    0x00e2: 0x00d4,     #  LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    0x00e3: 0x00d2,     #  LATIN CAPITAL LETTER O WITH GRAVE
    0x00e4: 0x00f5,     #  LATIN SMALL LETTER O WITH TILDE
    0x00e5: 0x00d5,     #  LATIN CAPITAL LETTER O WITH TILDE
    0x00e6: 0x00b5,     #  MICRO SIGN
    0x00e7: 0x00fe,     #  LATIN SMALL LETTER THORN
    0x00e8: 0x00de,     #  LATIN CAPITAL LETTER THORN
    0x00e9: 0x00da,     #  LATIN CAPITAL LETTER U WITH ACUTE
    0x00ea: 0x00db,     #  LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    0x00eb: 0x00d9,     #  LATIN CAPITAL LETTER U WITH GRAVE
    0x00ec: 0x00fd,     #  LATIN SMALL LETTER Y WITH ACUTE
    0x00ed: 0x00dd,     #  LATIN CAPITAL LETTER Y WITH ACUTE
    0x00ee: 0x00af,     #  MACRON
    0x00ef: 0x00b4,     #  ACUTE ACCENT
    0x00f0: 0x00ad,     #  SOFT HYPHEN
    0x00f1: 0x00b1,     #  PLUS-MINUS SIGN
    0x00f2: 0x2017,     #  DOUBLE LOW LINE
    0x00f3: 0x00be,     #  VULGAR FRACTION THREE QUARTERS
    0x00f4: 0x00b6,     #  PILCROW SIGN
    0x00f5: 0x00a7,     #  SECTION SIGN
    0x00f6: 0x00f7,     #  DIVISION SIGN
    0x00f7: 0x00b8,     #  CEDILLA
    0x00f8: 0x00b0,     #  DEGREE SIGN
    0x00f9: 0x00a8,     #  DIAERESIS
    0x00fa: 0x00b7,     #  MIDDLE DOT
    0x00fb: 0x00b9,     #  SUPERSCRIPT ONE
    0x00fc: 0x00b3,     #  SUPERSCRIPT THREE
    0x00fd: 0x00b2,     #  SUPERSCRIPT TWO
    0x00fe: 0x25a0,     #  BLACK SQUARE
    0x00ff: 0x00a0,     #  NO-BREAK SPACE
})

### Decoding Table

decoding_table = (
    '\x00'     #  0x0000 -> NULL
    '\x01'     #  0x0001 -> START OF HEADING
    '\x02'     #  0x0002 -> START OF TEXT
    '\x03'     #  0x0003 -> END OF TEXT
    '\x04'     #  0x0004 -> END OF TRANSMISSION
    '\x05'     #  0x0005 -> ENQUIRY
    '\x06'     #  0x0006 -> ACKNOWLEDGE
    '\x07'     #  0x0007 -> BELL
    '\x08'     #  0x0008 -> BACKSPACE
    '\t'       #  0x0009 -> HORIZONTAL TABULATION
    '\n'       #  0x000a -> LINE FEED
    '\x0b'     #  0x000b -> VERTICAL TABULATION
    '\x0c'     #  0x000c -> FORM FEED
    '\r'       #  0x000d -> CARRIAGE RETURN
    '\x0e'     #  0x000e -> SHIFT OUT
    '\x0f'     #  0x000f -> SHIFT IN
    '\x10'     #  0x0010 -> DATA LINK ESCAPE
    '\x11'     #  0x0011 -> DEVICE CONTROL ONE
    '\x12'     #  0x0012 -> DEVICE CONTROL TWO
    '\x13'     #  0x0013 -> DEVICE CONTROL THREE
    '\x14'     #  0x0014 -> DEVICE CONTROL FOUR
    '\x15'     #  0x0015 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x0016 -> SYNCHRONOUS IDLE
    '\x17'     #  0x0017 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x0018 -> CANCEL
    '\x19'     #  0x0019 -> END OF MEDIUM
    '\x1a'     #  0x001a -> SUBSTITUTE
    '\x1b'     #  0x001b -> ESCAPE
    '\x1c'     #  0x001c -> FILE SEPARATOR
    '\x1d'     #  0x001d -> GROUP SEPARATOR
    '\x1e'     #  0x001e -> RECORD SEPARATOR
    '\x1f'     #  0x001f -> UNIT SEPARATOR
    ' '        #  0x0020 -> SPACE
    '!'        #  0x0021 -> EXCLAMATION MARK
    '"'        #  0x0022 -> QUOTATION MARK
    '#'        #  0x0023 -> NUMBER SIGN
    '$'        #  0x0024 -> DOLLAR SIGN
    '%'        #  0x0025 -> PERCENT SIGN
    '&'        #  0x0026 -> AMPERSAND
    "'"        #  0x0027 -> APOSTROPHE
    '('        #  0x0028 -> LEFT PARENTHESIS
    ')'        #  0x0029 -> RIGHT PARENTHESIS
    '*'        #  0x002a -> ASTERISK
    '+'        #  0x002b -> PLUS SIGN
    ','        #  0x002c -> COMMA
    '-'        #  0x002d -> HYPHEN-MINUS
    '.'        #  0x002e -> FULL STOP
    '/'        #  0x002f -> SOLIDUS
    '0'        #  0x0030 -> DIGIT ZERO
    '1'        #  0x0031 -> DIGIT ONE
    '2'        #  0x0032 -> DIGIT TWO
    '3'        #  0x0033 -> DIGIT THREE
    '4'        #  0x0034 -> DIGIT FOUR
    '5'        #  0x0035 -> DIGIT FIVE
    '6'        #  0x0036 -> DIGIT SIX
    '7'        #  0x0037 -> DIGIT SEVEN
    '8'        #  0x0038 -> DIGIT EIGHT
    '9'        #  0x0039 -> DIGIT NINE
    ':'        #  0x003a -> COLON
    ';'        #  0x003b -> SEMICOLON
    '<'        #  0x003c -> LESS-THAN SIGN
    '='        #  0x003d -> EQUALS SIGN
    '>'        #  0x003e -> GREATER-THAN SIGN
    '?'        #  0x003f -> QUESTION MARK
    '@'        #  0x0040 -> COMMERCIAL AT
    'A'        #  0x0041 -> LATIN CAPITAL LETTER A
    'B'        #  0x0042 -> LATIN CAPITAL LETTER B
    'C'        #  0x0043 -> LATIN CAPITAL LETTER C
    'D'        #  0x0044 -> LATIN CAPITAL LETTER D
    'E'        #  0x0045 -> LATIN CAPITAL LETTER E
    'F'        #  0x0046 -> LATIN CAPITAL LETTER F
    'G'        #  0x0047 -> LATIN CAPITAL LETTER G
    'H'        #  0x0048 -> LATIN CAPITAL LETTER H
    'I'        #  0x0049 -> LATIN CAPITAL LETTER I
    'J'        #  0x004a -> LATIN CAPITAL LETTER J
    'K'        #  0x004b -> LATIN CAPITAL LETTER K
    'L'        #  0x004c -> LATIN CAPITAL LETTER L
    'M'        #  0x004d -> LATIN CAPITAL LETTER M
    'N'        #  0x004e -> LATIN CAPITAL LETTER N
    'O'        #  0x004f -> LATIN CAPITAL LETTER O
    'P'        #  0x0050 -> LATIN CAPITAL LETTER P
    'Q'        #  0x0051 -> LATIN CAPITAL LETTER Q
    'R'        #  0x0052 -> LATIN CAPITAL LETTER R
    'S'        #  0x0053 -> LATIN CAPITAL LETTER S
    'T'        #  0x0054 -> LATIN CAPITAL LETTER T
    'U'        #  0x0055 -> LATIN CAPITAL LETTER U
    'V'        #  0x0056 -> LATIN CAPITAL LETTER V
    'W'        #  0x0057 -> LATIN CAPITAL LETTER W
    'X'        #  0x0058 -> LATIN CAPITAL LETTER X
    'Y'        #  0x0059 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x005a -> LATIN CAPITAL LETTER Z
    '['        #  0x005b -> LEFT SQUARE BRACKET
    '\\'       #  0x005c -> REVERSE SOLIDUS
    ']'        #  0x005d -> RIGHT SQUARE BRACKET
    '^'        #  0x005e -> CIRCUMFLEX ACCENT
    '_'        #  0x005f -> LOW LINE
    '`'        #  0x0060 -> GRAVE ACCENT
    'a'        #  0x0061 -> LATIN SMALL LETTER A
    'b'        #  0x0062 -> LATIN SMALL LETTER B
    'c'        #  0x0063 -> LATIN SMALL LETTER C
    'd'        #  0x0064 -> LATIN SMALL LETTER D
    'e'        #  0x0065 -> LATIN SMALL LETTER E
    'f'        #  0x0066 -> LATIN SMALL LETTER F
    'g'        #  0x0067 -> LATIN SMALL LETTER G
    'h'        #  0x0068 -> LATIN SMALL LETTER H
    'i'        #  0x0069 -> LATIN SMALL LETTER I
    'j'        #  0x006a -> LATIN SMALL LETTER J
    'k'        #  0x006b -> LATIN SMALL LETTER K
    'l'        #  0x006c -> LATIN SMALL LETTER L
    'm'        #  0x006d -> LATIN SMALL LETTER M
    'n'        #  0x006e -> LATIN SMALL LETTER N
    'o'        #  0x006f -> LATIN SMALL LETTER O
    'p'        #  0x0070 -> LATIN SMALL LETTER P
    'q'        #  0x0071 -> LATIN SMALL LETTER Q
    'r'        #  0x0072 -> LATIN SMALL LETTER R
    's'        #  0x0073 -> LATIN SMALL LETTER S
    't'        #  0x0074 -> LATIN SMALL LETTER T
    'u'        #  0x0075 -> LATIN SMALL LETTER U
    'v'        #  0x0076 -> LATIN SMALL LETTER V
    'w'        #  0x0077 -> LATIN SMALL LETTER W
    'x'        #  0x0078 -> LATIN SMALL LETTER X
    'y'        #  0x0079 -> LATIN SMALL LETTER Y
    'z'        #  0x007a -> LATIN SMALL LETTER Z
    '{'        #  0x007b -> LEFT CURLY BRACKET
    '|'        #  0x007c -> VERTICAL LINE
    '}'        #  0x007d -> RIGHT CURLY BRACKET
    '~'        #  0x007e -> TILDE
    '\x7f'     #  0x007f -> DELETE
    '\xc7'     #  0x0080 -> LATIN CAPITAL LETTER C WITH CEDILLA
    '\xfc'     #  0x0081 -> LATIN SMALL LETTER U WITH DIAERESIS
    '\xe9'     #  0x0082 -> LATIN SMALL LETTER E WITH ACUTE
    '\xe2'     #  0x0083 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\xe4'     #  0x0084 -> LATIN SMALL LETTER A WITH DIAERESIS
    '\xe0'     #  0x0085 -> LATIN SMALL LETTER A WITH GRAVE
    '\xe5'     #  0x0086 -> LATIN SMALL LETTER A WITH RING ABOVE
    '\xe7'     #  0x0087 -> LATIN SMALL LETTER C WITH CEDILLA
    '\xea'     #  0x0088 -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xeb'     #  0x0089 -> LATIN SMALL LETTER E WITH DIAERESIS
    '\xe8'     #  0x008a -> LATIN SMALL LETTER E WITH GRAVE
    '\xef'     #  0x008b -> LATIN SMALL LETTER I WITH DIAERESIS
    '\xee'     #  0x008c -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\xec'     #  0x008d -> LATIN SMALL LETTER I WITH GRAVE
    '\xc4'     #  0x008e -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\xc5'     #  0x008f -> LATIN CAPITAL LETTER A WITH RING ABOVE
    '\xc9'     #  0x0090 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\xe6'     #  0x0091 -> LATIN SMALL LIGATURE AE
    '\xc6'     #  0x0092 -> LATIN CAPITAL LIGATURE AE
    '\xf4'     #  0x0093 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xf6'     #  0x0094 -> LATIN SMALL LETTER O WITH DIAERESIS
    '\xf2'     #  0x0095 -> LATIN SMALL LETTER O WITH GRAVE
    '\xfb'     #  0x0096 -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\xf9'     #  0x0097 -> LATIN SMALL LETTER U WITH GRAVE
    '\xff'     #  0x0098 -> LATIN SMALL LETTER Y WITH DIAERESIS
    '\xd6'     #  0x0099 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xdc'     #  0x009a -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\xf8'     #  0x009b -> LATIN SMALL LETTER O WITH STROKE
    '\xa3'     #  0x009c -> POUND SIGN
    '\xd8'     #  0x009d -> LATIN CAPITAL LETTER O WITH STROKE
    '\xd7'     #  0x009e -> MULTIPLICATION SIGN
    '\u0192'   #  0x009f -> LATIN SMALL LETTER F WITH HOOK
    '\xe1'     #  0x00a0 -> LATIN SMALL LETTER A WITH ACUTE
    '\xed'     #  0x00a1 -> LATIN SMALL LETTER I WITH ACUTE
    '\xf3'     #  0x00a2 -> LATIN SMALL LETTER O WITH ACUTE
    '\xfa'     #  0x00a3 -> LATIN SMALL LETTER U WITH ACUTE
    '\xf1'     #  0x00a4 -> LATIN SMALL LETTER N WITH TILDE
    '\xd1'     #  0x00a5 -> LATIN CAPITAL LETTER N WITH TILDE
    '\xaa'     #  0x00a6 -> FEMININE ORDINAL INDICATOR
    '\xba'     #  0x00a7 -> MASCULINE ORDINAL INDICATOR
    '\xbf'     #  0x00a8 -> INVERTED QUESTION MARK
    '\xae'     #  0x00a9 -> REGISTERED SIGN
    '\xac'     #  0x00aa -> NOT SIGN
    '\xbd'     #  0x00ab -> VULGAR FRACTION ONE HALF
    '\xbc'     #  0x00ac -> VULGAR FRACTION ONE QUARTER
    '\xa1'     #  0x00ad -> INVERTED EXCLAMATION MARK
    '\xab'     #  0x00ae -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbb'     #  0x00af -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u2591'   #  0x00b0 -> LIGHT SHADE
    '\u2592'   #  0x00b1 -> MEDIUM SHADE
    '\u2593'   #  0x00b2 -> DARK SHADE
    '\u2502'   #  0x00b3 -> BOX DRAWINGS LIGHT VERTICAL
    '\u2524'   #  0x00b4 -> BOX DRAWINGS LIGHT VERTICAL AND LEFT
    '\xc1'     #  0x00b5 -> LATIN CAPITAL LETTER A WITH ACUTE
    '\xc2'     #  0x00b6 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    '\xc0'     #  0x00b7 -> LATIN CAPITAL LETTER A WITH GRAVE
    '\xa9'     #  0x00b8 -> COPYRIGHT SIGN
    '\u2563'   #  0x00b9 -> BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    '\u2551'   #  0x00ba -> BOX DRAWINGS DOUBLE VERTICAL
    '\u2557'   #  0x00bb -> BOX DRAWINGS DOUBLE DOWN AND LEFT
    '\u255d'   #  0x00bc -> BOX DRAWINGS DOUBLE UP AND LEFT
    '\xa2'     #  0x00bd -> CENT SIGN
    '\xa5'     #  0x00be -> YEN SIGN
    '\u2510'   #  0x00bf -> BOX DRAWINGS LIGHT DOWN AND LEFT
    '\u2514'   #  0x00c0 -> BOX DRAWINGS LIGHT UP AND RIGHT
    '\u2534'   #  0x00c1 -> BOX DRAWINGS LIGHT UP AND HORIZONTAL
    '\u252c'   #  0x00c2 -> BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    '\u251c'   #  0x00c3 -> BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    '\u2500'   #  0x00c4 -> BOX DRAWINGS LIGHT HORIZONTAL
    '\u253c'   #  0x00c5 -> BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    '\xe3'     #  0x00c6 -> LATIN SMALL LETTER A WITH TILDE
    '\xc3'     #  0x00c7 -> LATIN CAPITAL LETTER A WITH TILDE
    '\u255a'   #  0x00c8 -> BOX DRAWINGS DOUBLE UP AND RIGHT
    '\u2554'   #  0x00c9 -> BOX DRAWINGS DOUBLE DOWN AND RIGHT
    '\u2569'   #  0x00ca -> BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    '\u2566'   #  0x00cb -> BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    '\u2560'   #  0x00cc -> BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    '\u2550'   #  0x00cd -> BOX DRAWINGS DOUBLE HORIZONTAL
    '\u256c'   #  0x00ce -> BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    '\xa4'     #  0x00cf -> CURRENCY SIGN
    '\xf0'     #  0x00d0 -> LATIN SMALL LETTER ETH
    '\xd0'     #  0x00d1 -> LATIN CAPITAL LETTER ETH
    '\xca'     #  0x00d2 -> LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    '\xcb'     #  0x00d3 -> LATIN CAPITAL LETTER E WITH DIAERESIS
    '\xc8'     #  0x00d4 -> LATIN CAPITAL LETTER E WITH GRAVE
    '\u20ac'   #  0x00d5 -> EURO SIGN
    '\xcd'     #  0x00d6 -> LATIN CAPITAL LETTER I WITH ACUTE
    '\xce'     #  0x00d7 -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    '\xcf'     #  0x00d8 -> LATIN CAPITAL LETTER I WITH DIAERESIS
    '\u2518'   #  0x00d9 -> BOX DRAWINGS LIGHT UP AND LEFT
    '\u250c'   #  0x00da -> BOX DRAWINGS LIGHT DOWN AND RIGHT
    '\u2588'   #  0x00db -> FULL BLOCK
    '\u2584'   #  0x00dc -> LOWER HALF BLOCK
    '\xa6'     #  0x00dd -> BROKEN BAR
    '\xcc'     #  0x00de -> LATIN CAPITAL LETTER I WITH GRAVE
    '\u2580'   #  0x00df -> UPPER HALF BLOCK
    '\xd3'     #  0x00e0 -> LATIN CAPITAL LETTER O WITH ACUTE
    '\xdf'     #  0x00e1 -> LATIN SMALL LETTER SHARP S
    '\xd4'     #  0x00e2 -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    '\xd2'     #  0x00e3 -> LATIN CAPITAL LETTER O WITH GRAVE
    '\xf5'     #  0x00e4 -> LATIN SMALL LETTER O WITH TILDE
    '\xd5'     #  0x00e5 -> LATIN CAPITAL LETTER O WITH TILDE
    '\xb5'     #  0x00e6 -> MICRO SIGN
    '\xfe'     #  0x00e7 -> LATIN SMALL LETTER THORN
    '\xde'     #  0x00e8 -> LATIN CAPITAL LETTER THORN
    '\xda'     #  0x00e9 -> LATIN CAPITAL LETTER U WITH ACUTE
    '\xdb'     #  0x00ea -> LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    '\xd9'     #  0x00eb -> LATIN CAPITAL LETTER U WITH GRAVE
    '\xfd'     #  0x00ec -> LATIN SMALL LETTER Y WITH ACUTE
    '\xdd'     #  0x00ed -> LATIN CAPITAL LETTER Y WITH ACUTE
    '\xaf'     #  0x00ee -> MACRON
    '\xb4'     #  0x00ef -> ACUTE ACCENT
    '\xad'     #  0x00f0 -> SOFT HYPHEN
    '\xb1'     #  0x00f1 -> PLUS-MINUS SIGN
    '\u2017'   #  0x00f2 -> DOUBLE LOW LINE
    '\xbe'     #  0x00f3 -> VULGAR FRACTION THREE QUARTERS
    '\xb6'     #  0x00f4 -> PILCROW SIGN
    '\xa7'     #  0x00f5 -> SECTION SIGN
    '\xf7'     #  0x00f6 -> DIVISION SIGN
    '\xb8'     #  0x00f7 -> CEDILLA
    '\xb0'     #  0x00f8 -> DEGREE SIGN
    '\xa8'     #  0x00f9 -> DIAERESIS
    '\xb7'     #  0x00fa -> MIDDLE DOT
    '\xb9'     #  0x00fb -> SUPERSCRIPT ONE
    '\xb3'     #  0x00fc -> SUPERSCRIPT THREE
    '\xb2'     #  0x00fd -> SUPERSCRIPT TWO
    '\u25a0'   #  0x00fe -> BLACK SQUARE
    '\xa0'     #  0x00ff -> NO-BREAK SPACE
)

### Encoding Map

encoding_map = {
    0x0000: 0x0000,     #  NULL
    0x0001: 0x0001,     #  START OF HEADING
    0x0002: 0x0002,     #  START OF TEXT
    0x0003: 0x0003,     #  END OF TEXT
    0x0004: 0x0004,     #  END OF TRANSMISSION
    0x0005: 0x0005,     #  ENQUIRY
    0x0006: 0x0006,     #  ACKNOWLEDGE
    0x0007: 0x0007,     #  BELL
    0x0008: 0x0008,     #  BACKSPACE
    0x0009: 0x0009,     #  HORIZONTAL TABULATION
    0x000a: 0x000a,     #  LINE FEED
    0x000b: 0x000b,     #  VERTICAL TABULATION
    0x000c: 0x000c,     #  FORM FEED
    0x000d: 0x000d,     #  CARRIAGE RETURN
    0x000e: 0x000e,     #  SHIFT OUT
    0x000f: 0x000f,     #  SHIFT IN
    0x0010: 0x0010,     #  DATA LINK ESCAPE
    0x0011: 0x0011,     #  DEVICE CONTROL ONE
    0x0012: 0x0012,     #  DEVICE CONTROL TWO
    0x0013: 0x0013,     #  DEVICE CONTROL THREE
    0x0014: 0x0014,     #  DEVICE CONTROL FOUR
    0x0015: 0x0015,     #  NEGATIVE ACKNOWLEDGE
    0x0016: 0x0016,     #  SYNCHRONOUS IDLE
    0x0017: 0x0017,     #  END OF TRANSMISSION BLOCK
    0x0018: 0x0018,     #  CANCEL
    0x0019: 0x0019,     #  END OF MEDIUM
    0x001a: 0x001a,     #  SUBSTITUTE
    0x001b: 0x001b,     #  ESCAPE
    0x001c: 0x001c,     #  FILE SEPARATOR
    0x001d: 0x001d,     #  GROUP SEPARATOR
    0x001e: 0x001e,     #  RECORD SEPARATOR
    0x001f: 0x001f,     #  UNIT SEPARATOR
    0x0020: 0x0020,     #  SPACE
    0x0021: 0x0021,     #  EXCLAMATION MARK
    0x0022: 0x0022,     #  QUOTATION MARK
    0x0023: 0x0023,     #  NUMBER SIGN
    0x0024: 0x0024,     #  DOLLAR SIGN
    0x0025: 0x0025,     #  PERCENT SIGN
    0x0026: 0x0026,     #  AMPERSAND
    0x0027: 0x0027,     #  APOSTROPHE
    0x0028: 0x0028,     #  LEFT PARENTHESIS
    0x0029: 0x0029,     #  RIGHT PARENTHESIS
    0x002a: 0x002a,     #  ASTERISK
    0x002b: 0x002b,     #  PLUS SIGN
    0x002c: 0x002c,     #  COMMA
    0x002d: 0x002d,     #  HYPHEN-MINUS
    0x002e: 0x002e,     #  FULL STOP
    0x002f: 0x002f,     #  SOLIDUS
    0x0030: 0x0030,     #  DIGIT ZERO
    0x0031: 0x0031,     #  DIGIT ONE
    0x0032: 0x0032,     #  DIGIT TWO
    0x0033: 0x0033,     #  DIGIT THREE
    0x0034: 0x0034,     #  DIGIT FOUR
    0x0035: 0x0035,     #  DIGIT FIVE
    0x0036: 0x0036,     #  DIGIT SIX
    0x0037: 0x0037,     #  DIGIT SEVEN
    0x0038: 0x0038,     #  DIGIT EIGHT
    0x0039: 0x0039,     #  DIGIT NINE
    0x003a: 0x003a,     #  COLON
    0x003b: 0x003b,     #  SEMICOLON
    0x003c: 0x003c,     #  LESS-THAN SIGN
    0x003d: 0x003d,     #  EQUALS SIGN
    0x003e: 0x003e,     #  GREATER-THAN SIGN
    0x003f: 0x003f,     #  QUESTION MARK
    0x0040: 0x0040,     #  COMMERCIAL AT
    0x0041: 0x0041,     #  LATIN CAPITAL LETTER A
    0x0042: 0x0042,     #  LATIN CAPITAL LETTER B
    0x0043: 0x0043,     #  LATIN CAPITAL LETTER C
    0x0044: 0x0044,     #  LATIN CAPITAL LETTER D
    0x0045: 0x0045,     #  LATIN CAPITAL LETTER E
    0x0046: 0x0046,     #  LATIN CAPITAL LETTER F
    0x0047: 0x0047,     #  LATIN CAPITAL LETTER G
    0x0048: 0x0048,     #  LATIN CAPITAL LETTER H
    0x0049: 0x0049,     #  LATIN CAPITAL LETTER I
    0x004a: 0x004a,     #  LATIN CAPITAL LETTER J
    0x004b: 0x004b,     #  LATIN CAPITAL LETTER K
    0x004c: 0x004c,     #  LATIN CAPITAL LETTER L
    0x004d: 0x004d,     #  LATIN CAPITAL LETTER M
    0x004e: 0x004e,     #  LATIN CAPITAL LETTER N
    0x004f: 0x004f,     #  LATIN CAPITAL LETTER O
    0x0050: 0x0050,     #  LATIN CAPITAL LETTER P
    0x0051: 0x0051,     #  LATIN CAPITAL LETTER Q
    0x0052: 0x0052,     #  LATIN CAPITAL LETTER R
    0x0053: 0x0053,     #  LATIN CAPITAL LETTER S
    0x0054: 0x0054,     #  LATIN CAPITAL LETTER T
    0x0055: 0x0055,     #  LATIN CAPITAL LETTER U
    0x0056: 0x0056,     #  LATIN CAPITAL LETTER V
    0x0057: 0x0057,     #  LATIN CAPITAL LETTER W
    0x0058: 0x0058,     #  LATIN CAPITAL LETTER X
    0x0059: 0x0059,     #  LATIN CAPITAL LETTER Y
    0x005a: 0x005a,     #  LATIN CAPITAL LETTER Z
    0x005b: 0x005b,     #  LEFT SQUARE BRACKET
    0x005c: 0x005c,     #  REVERSE SOLIDUS
    0x005d: 0x005d,     #  RIGHT SQUARE BRACKET
    0x005e: 0x005e,     #  CIRCUMFLEX ACCENT
    0x005f: 0x005f,     #  LOW LINE
    0x0060: 0x0060,     #  GRAVE ACCENT
    0x0061: 0x0061,     #  LATIN SMALL LETTER A
    0x0062: 0x0062,     #  LATIN SMALL LETTER B
    0x0063: 0x0063,     #  LATIN SMALL LETTER C
    0x0064: 0x0064,     #  LATIN SMALL LETTER D
    0x0065: 0x0065,     #  LATIN SMALL LETTER E
    0x0066: 0x0066,     #  LATIN SMALL LETTER F
    0x0067: 0x0067,     #  LATIN SMALL LETTER G
    0x0068: 0x0068,     #  LATIN SMALL LETTER H
    0x0069: 0x0069,     #  LATIN SMALL LETTER I
    0x006a: 0x006a,     #  LATIN SMALL LETTER J
    0x006b: 0x006b,     #  LATIN SMALL LETTER K
    0x006c: 0x006c,     #  LATIN SMALL LETTER L
    0x006d: 0x006d,     #  LATIN SMALL LETTER M
    0x006e: 0x006e,     #  LATIN SMALL LETTER N
    0x006f: 0x006f,     #  LATIN SMALL LETTER O
    0x0070: 0x0070,     #  LATIN SMALL LETTER P
    0x0071: 0x0071,     #  LATIN SMALL LETTER Q
    0x0072: 0x0072,     #  LATIN SMALL LETTER R
    0x0073: 0x0073,     #  LATIN SMALL LETTER S
    0x0074: 0x0074,     #  LATIN SMALL LETTER T
    0x0075: 0x0075,     #  LATIN SMALL LETTER U
    0x0076: 0x0076,     #  LATIN SMALL LETTER V
    0x0077: 0x0077,     #  LATIN SMALL LETTER W
    0x0078: 0x0078,     #  LATIN SMALL LETTER X
    0x0079: 0x0079,     #  LATIN SMALL LETTER Y
    0x007a: 0x007a,     #  LATIN SMALL LETTER Z
    0x007b: 0x007b,     #  LEFT CURLY BRACKET
    0x007c: 0x007c,     #  VERTICAL LINE
    0x007d: 0x007d,     #  RIGHT CURLY BRACKET
    0x007e: 0x007e,     #  TILDE
    0x007f: 0x007f,     #  DELETE
    0x00a0: 0x00ff,     #  NO-BREAK SPACE
    0x00a1: 0x00ad,     #  INVERTED EXCLAMATION MARK
    0x00a2: 0x00bd,     #  CENT SIGN
    0x00a3: 0x009c,     #  POUND SIGN
    0x00a4: 0x00cf,     #  CURRENCY SIGN
    0x00a5: 0x00be,     #  YEN SIGN
    0x00a6: 0x00dd,     #  BROKEN BAR
    0x00a7: 0x00f5,     #  SECTION SIGN
    0x00a8: 0x00f9,     #  DIAERESIS
    0x00a9: 0x00b8,     #  COPYRIGHT SIGN
    0x00aa: 0x00a6,     #  FEMININE ORDINAL INDICATOR
    0x00ab: 0x00ae,     #  LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00ac: 0x00aa,     #  NOT SIGN
    0x00ad: 0x00f0,     #  SOFT HYPHEN
    0x00ae: 0x00a9,     #  REGISTERED SIGN
    0x00af: 0x00ee,     #  MACRON
    0x00b0: 0x00f8,     #  DEGREE SIGN
    0x00b1: 0x00f1,     #  PLUS-MINUS SIGN
    0x00b2: 0x00fd,     #  SUPERSCRIPT TWO
    0x00b3: 0x00fc,     #  SUPERSCRIPT THREE
    0x00b4: 0x00ef,     #  ACUTE ACCENT
    0x00b5: 0x00e6,     #  MICRO SIGN
    0x00b6: 0x00f4,     #  PILCROW SIGN
    0x00b7: 0x00fa,     #  MIDDLE DOT
    0x00b8: 0x00f7,     #  CEDILLA
    0x00b9: 0x00fb,     #  SUPERSCRIPT ONE
    0x00ba: 0x00a7,     #  MASCULINE ORDINAL INDICATOR
    0x00bb: 0x00af,     #  RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00bc: 0x00ac,     #  VULGAR FRACTION ONE QUARTER
    0x00bd: 0x00ab,     #  VULGAR FRACTION ONE HALF
    0x00be: 0x00f3,     #  VULGAR FRACTION THREE QUARTERS
    0x00bf: 0x00a8,     #  INVERTED QUESTION MARK
    0x00c0: 0x00b7,     #  LATIN CAPITAL LETTER A WITH GRAVE
    0x00c1: 0x00b5,     #  LATIN CAPITAL LETTER A WITH ACUTE
    0x00c2: 0x00b6,     #  LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    0x00c3: 0x00c7,     #  LATIN CAPITAL LETTER A WITH TILDE
    0x00c4: 0x008e,     #  LATIN CAPITAL LETTER A WITH DIAERESIS
    0x00c5: 0x008f,     #  LATIN CAPITAL LETTER A WITH RING ABOVE
    0x00c6: 0x0092,     #  LATIN CAPITAL LIGATURE AE
    0x00c7: 0x0080,     #  LATIN CAPITAL LETTER C WITH CEDILLA
    0x00c8: 0x00d4,     #  LATIN CAPITAL LETTER E WITH GRAVE
    0x00c9: 0x0090,     #  LATIN CAPITAL LETTER E WITH ACUTE
    0x00ca: 0x00d2,     #  LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    0x00cb: 0x00d3,     #  LATIN CAPITAL LETTER E WITH DIAERESIS
    0x00cc: 0x00de,     #  LATIN CAPITAL LETTER I WITH GRAVE
    0x00cd: 0x00d6,     #  LATIN CAPITAL LETTER I WITH ACUTE
    0x00ce: 0x00d7,     #  LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    0x00cf: 0x00d8,     #  LATIN CAPITAL LETTER I WITH DIAERESIS
    0x00d0: 0x00d1,     #  LATIN CAPITAL LETTER ETH
    0x00d1: 0x00a5,     #  LATIN CAPITAL LETTER N WITH TILDE
    0x00d2: 0x00e3,     #  LATIN CAPITAL LETTER O WITH GRAVE
    0x00d3: 0x00e0,     #  LATIN CAPITAL LETTER O WITH ACUTE
    0x00d4: 0x00e2,     #  LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    0x00d5: 0x00e5,     #  LATIN CAPITAL LETTER O WITH TILDE
    0x00d6: 0x0099,     #  LATIN CAPITAL LETTER O WITH DIAERESIS
    0x00d7: 0x009e,     #  MULTIPLICATION SIGN
    0x00d8: 0x009d,     #  LATIN CAPITAL LETTER O WITH STROKE
    0x00d9: 0x00eb,     #  LATIN CAPITAL LETTER U WITH GRAVE
    0x00da: 0x00e9,     #  LATIN CAPITAL LETTER U WITH ACUTE
    0x00db: 0x00ea,     #  LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    0x00dc: 0x009a,     #  LATIN CAPITAL LETTER U WITH DIAERESIS
    0x00dd: 0x00ed,     #  LATIN CAPITAL LETTER Y WITH ACUTE
    0x00de: 0x00e8,     #  LATIN CAPITAL LETTER THORN
    0x00df: 0x00e1,     #  LATIN SMALL LETTER SHARP S
    0x00e0: 0x0085,     #  LATIN SMALL LETTER A WITH GRAVE
    0x00e1: 0x00a0,     #  LATIN SMALL LETTER A WITH ACUTE
    0x00e2: 0x0083,     #  LATIN SMALL LETTER A WITH CIRCUMFLEX
    0x00e3: 0x00c6,     #  LATIN SMALL LETTER A WITH TILDE
    0x00e4: 0x0084,     #  LATIN SMALL LETTER A WITH DIAERESIS
    0x00e5: 0x0086,     #  LATIN SMALL LETTER A WITH RING ABOVE
    0x00e6: 0x0091,     #  LATIN SMALL LIGATURE AE
    0x00e7: 0x0087,     #  LATIN SMALL LETTER C WITH CEDILLA
    0x00e8: 0x008a,     #  LATIN SMALL LETTER E WITH GRAVE
    0x00e9: 0x0082,     #  LATIN SMALL LETTER E WITH ACUTE
    0x00ea: 0x0088,     #  LATIN SMALL LETTER E WITH CIRCUMFLEX
    0x00eb: 0x0089,     #  LATIN SMALL LETTER E WITH DIAERESIS
    0x00ec: 0x008d,     #  LATIN SMALL LETTER I WITH GRAVE
    0x00ed: 0x00a1,     #  LATIN SMALL LETTER I WITH ACUTE
    0x00ee: 0x008c,     #  LATIN SMALL LETTER I WITH CIRCUMFLEX
    0x00ef: 0x008b,     #  LATIN SMALL LETTER I WITH DIAERESIS
    0x00f0: 0x00d0,     #  LATIN SMALL LETTER ETH
    0x00f1: 0x00a4,     #  LATIN SMALL LETTER N WITH TILDE
    0x00f2: 0x0095,     #  LATIN SMALL LETTER O WITH GRAVE
    0x00f3: 0x00a2,     #  LATIN SMALL LETTER O WITH ACUTE
    0x00f4: 0x0093,     #  LATIN SMALL LETTER O WITH CIRCUMFLEX
    0x00f5: 0x00e4,     #  LATIN SMALL LETTER O WITH TILDE
    0x00f6: 0x0094,     #  LATIN SMALL LETTER O WITH DIAERESIS
    0x00f7: 0x00f6,     #  DIVISION SIGN
    0x00f8: 0x009b,     #  LATIN SMALL LETTER O WITH STROKE
    0x00f9: 0x0097,     #  LATIN SMALL LETTER U WITH GRAVE
    0x00fa: 0x00a3,     #  LATIN SMALL LETTER U WITH ACUTE
    0x00fb: 0x0096,     #  LATIN SMALL LETTER U WITH CIRCUMFLEX
    0x00fc: 0x0081,     #  LATIN SMALL LETTER U WITH DIAERESIS
    0x00fd: 0x00ec,     #  LATIN SMALL LETTER Y WITH ACUTE
    0x00fe: 0x00e7,     #  LATIN SMALL LETTER THORN
    0x00ff: 0x0098,     #  LATIN SMALL LETTER Y WITH DIAERESIS
    0x20ac: 0x00d5,     #  EURO SIGN
    0x0192: 0x009f,     #  LATIN SMALL LETTER F WITH HOOK
    0x2017: 0x00f2,     #  DOUBLE LOW LINE
    0x2500: 0x00c4,     #  BOX DRAWINGS LIGHT HORIZONTAL
    0x2502: 0x00b3,     #  BOX DRAWINGS LIGHT VERTICAL
    0x250c: 0x00da,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
    0x2510: 0x00bf,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
    0x2514: 0x00c0,     #  BOX DRAWINGS LIGHT UP AND RIGHT
    0x2518: 0x00d9,     #  BOX DRAWINGS LIGHT UP AND LEFT
    0x251c: 0x00c3,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    0x2524: 0x00b4,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
    0x252c: 0x00c2,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    0x2534: 0x00c1,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
    0x253c: 0x00c5,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    0x2550: 0x00cd,     #  BOX DRAWINGS DOUBLE HORIZONTAL
    0x2551: 0x00ba,     #  BOX DRAWINGS DOUBLE VERTICAL
    0x2554: 0x00c9,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
    0x2557: 0x00bb,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
    0x255a: 0x00c8,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
    0x255d: 0x00bc,     #  BOX DRAWINGS DOUBLE UP AND LEFT
    0x2560: 0x00cc,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    0x2563: 0x00b9,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    0x2566: 0x00cb,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    0x2569: 0x00ca,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    0x256c: 0x00ce,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    0x2580: 0x00df,     #  UPPER HALF BLOCK
    0x2584: 0x00dc,     #  LOWER HALF BLOCK
    0x2588: 0x00db,     #  FULL BLOCK
    0x2591: 0x00b0,     #  LIGHT SHADE
    0x2592: 0x00b1,     #  MEDIUM SHADE
    0x2593: 0x00b2,     #  DARK SHADE
    0x25a0: 0x00fe,     #  BLACK SQUARE
}
encodings/zlib_codec.py000064400000004234151153537620011177 0ustar00"""Python 'zlib_codec' Codec - zlib compression encoding.

This codec de/encodes from bytes to bytes.

Written by Marc-Andre Lemburg (mal@lemburg.com).
"""

import codecs
import zlib # this codec needs the optional zlib module !

### Codec APIs

def zlib_encode(input, errors='strict'):
    assert errors == 'strict'
    return (zlib.compress(input), len(input))

def zlib_decode(input, errors='strict'):
    assert errors == 'strict'
    return (zlib.decompress(input), len(input))

class Codec(codecs.Codec):
    def encode(self, input, errors='strict'):
        return zlib_encode(input, errors)
    def decode(self, input, errors='strict'):
        return zlib_decode(input, errors)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def __init__(self, errors='strict'):
        assert errors == 'strict'
        self.errors = errors
        self.compressobj = zlib.compressobj()

    def encode(self, input, final=False):
        if final:
            c = self.compressobj.compress(input)
            return c + self.compressobj.flush()
        else:
            return self.compressobj.compress(input)

    def reset(self):
        self.compressobj = zlib.compressobj()

class IncrementalDecoder(codecs.IncrementalDecoder):
    def __init__(self, errors='strict'):
        assert errors == 'strict'
        self.errors = errors
        self.decompressobj = zlib.decompressobj()

    def decode(self, input, final=False):
        if final:
            c = self.decompressobj.decompress(input)
            return c + self.decompressobj.flush()
        else:
            return self.decompressobj.decompress(input)

    def reset(self):
        self.decompressobj = zlib.decompressobj()

class StreamWriter(Codec, codecs.StreamWriter):
    charbuffertype = bytes

class StreamReader(Codec, codecs.StreamReader):
    charbuffertype = bytes

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='zlib',
        encode=zlib_encode,
        decode=zlib_decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
        _is_text_encoding=False,
    )
encodings/mac_roman.py000064400000032250151153537620011035 0ustar00""" Python Character Mapping Codec mac_roman generated from 'MAPPINGS/VENDORS/APPLE/ROMAN.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='mac-roman',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> CONTROL CHARACTER
    '\x01'     #  0x01 -> CONTROL CHARACTER
    '\x02'     #  0x02 -> CONTROL CHARACTER
    '\x03'     #  0x03 -> CONTROL CHARACTER
    '\x04'     #  0x04 -> CONTROL CHARACTER
    '\x05'     #  0x05 -> CONTROL CHARACTER
    '\x06'     #  0x06 -> CONTROL CHARACTER
    '\x07'     #  0x07 -> CONTROL CHARACTER
    '\x08'     #  0x08 -> CONTROL CHARACTER
    '\t'       #  0x09 -> CONTROL CHARACTER
    '\n'       #  0x0A -> CONTROL CHARACTER
    '\x0b'     #  0x0B -> CONTROL CHARACTER
    '\x0c'     #  0x0C -> CONTROL CHARACTER
    '\r'       #  0x0D -> CONTROL CHARACTER
    '\x0e'     #  0x0E -> CONTROL CHARACTER
    '\x0f'     #  0x0F -> CONTROL CHARACTER
    '\x10'     #  0x10 -> CONTROL CHARACTER
    '\x11'     #  0x11 -> CONTROL CHARACTER
    '\x12'     #  0x12 -> CONTROL CHARACTER
    '\x13'     #  0x13 -> CONTROL CHARACTER
    '\x14'     #  0x14 -> CONTROL CHARACTER
    '\x15'     #  0x15 -> CONTROL CHARACTER
    '\x16'     #  0x16 -> CONTROL CHARACTER
    '\x17'     #  0x17 -> CONTROL CHARACTER
    '\x18'     #  0x18 -> CONTROL CHARACTER
    '\x19'     #  0x19 -> CONTROL CHARACTER
    '\x1a'     #  0x1A -> CONTROL CHARACTER
    '\x1b'     #  0x1B -> CONTROL CHARACTER
    '\x1c'     #  0x1C -> CONTROL CHARACTER
    '\x1d'     #  0x1D -> CONTROL CHARACTER
    '\x1e'     #  0x1E -> CONTROL CHARACTER
    '\x1f'     #  0x1F -> CONTROL CHARACTER
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> CONTROL CHARACTER
    '\xc4'     #  0x80 -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\xc5'     #  0x81 -> LATIN CAPITAL LETTER A WITH RING ABOVE
    '\xc7'     #  0x82 -> LATIN CAPITAL LETTER C WITH CEDILLA
    '\xc9'     #  0x83 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\xd1'     #  0x84 -> LATIN CAPITAL LETTER N WITH TILDE
    '\xd6'     #  0x85 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xdc'     #  0x86 -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\xe1'     #  0x87 -> LATIN SMALL LETTER A WITH ACUTE
    '\xe0'     #  0x88 -> LATIN SMALL LETTER A WITH GRAVE
    '\xe2'     #  0x89 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\xe4'     #  0x8A -> LATIN SMALL LETTER A WITH DIAERESIS
    '\xe3'     #  0x8B -> LATIN SMALL LETTER A WITH TILDE
    '\xe5'     #  0x8C -> LATIN SMALL LETTER A WITH RING ABOVE
    '\xe7'     #  0x8D -> LATIN SMALL LETTER C WITH CEDILLA
    '\xe9'     #  0x8E -> LATIN SMALL LETTER E WITH ACUTE
    '\xe8'     #  0x8F -> LATIN SMALL LETTER E WITH GRAVE
    '\xea'     #  0x90 -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xeb'     #  0x91 -> LATIN SMALL LETTER E WITH DIAERESIS
    '\xed'     #  0x92 -> LATIN SMALL LETTER I WITH ACUTE
    '\xec'     #  0x93 -> LATIN SMALL LETTER I WITH GRAVE
    '\xee'     #  0x94 -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\xef'     #  0x95 -> LATIN SMALL LETTER I WITH DIAERESIS
    '\xf1'     #  0x96 -> LATIN SMALL LETTER N WITH TILDE
    '\xf3'     #  0x97 -> LATIN SMALL LETTER O WITH ACUTE
    '\xf2'     #  0x98 -> LATIN SMALL LETTER O WITH GRAVE
    '\xf4'     #  0x99 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xf6'     #  0x9A -> LATIN SMALL LETTER O WITH DIAERESIS
    '\xf5'     #  0x9B -> LATIN SMALL LETTER O WITH TILDE
    '\xfa'     #  0x9C -> LATIN SMALL LETTER U WITH ACUTE
    '\xf9'     #  0x9D -> LATIN SMALL LETTER U WITH GRAVE
    '\xfb'     #  0x9E -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\xfc'     #  0x9F -> LATIN SMALL LETTER U WITH DIAERESIS
    '\u2020'   #  0xA0 -> DAGGER
    '\xb0'     #  0xA1 -> DEGREE SIGN
    '\xa2'     #  0xA2 -> CENT SIGN
    '\xa3'     #  0xA3 -> POUND SIGN
    '\xa7'     #  0xA4 -> SECTION SIGN
    '\u2022'   #  0xA5 -> BULLET
    '\xb6'     #  0xA6 -> PILCROW SIGN
    '\xdf'     #  0xA7 -> LATIN SMALL LETTER SHARP S
    '\xae'     #  0xA8 -> REGISTERED SIGN
    '\xa9'     #  0xA9 -> COPYRIGHT SIGN
    '\u2122'   #  0xAA -> TRADE MARK SIGN
    '\xb4'     #  0xAB -> ACUTE ACCENT
    '\xa8'     #  0xAC -> DIAERESIS
    '\u2260'   #  0xAD -> NOT EQUAL TO
    '\xc6'     #  0xAE -> LATIN CAPITAL LETTER AE
    '\xd8'     #  0xAF -> LATIN CAPITAL LETTER O WITH STROKE
    '\u221e'   #  0xB0 -> INFINITY
    '\xb1'     #  0xB1 -> PLUS-MINUS SIGN
    '\u2264'   #  0xB2 -> LESS-THAN OR EQUAL TO
    '\u2265'   #  0xB3 -> GREATER-THAN OR EQUAL TO
    '\xa5'     #  0xB4 -> YEN SIGN
    '\xb5'     #  0xB5 -> MICRO SIGN
    '\u2202'   #  0xB6 -> PARTIAL DIFFERENTIAL
    '\u2211'   #  0xB7 -> N-ARY SUMMATION
    '\u220f'   #  0xB8 -> N-ARY PRODUCT
    '\u03c0'   #  0xB9 -> GREEK SMALL LETTER PI
    '\u222b'   #  0xBA -> INTEGRAL
    '\xaa'     #  0xBB -> FEMININE ORDINAL INDICATOR
    '\xba'     #  0xBC -> MASCULINE ORDINAL INDICATOR
    '\u03a9'   #  0xBD -> GREEK CAPITAL LETTER OMEGA
    '\xe6'     #  0xBE -> LATIN SMALL LETTER AE
    '\xf8'     #  0xBF -> LATIN SMALL LETTER O WITH STROKE
    '\xbf'     #  0xC0 -> INVERTED QUESTION MARK
    '\xa1'     #  0xC1 -> INVERTED EXCLAMATION MARK
    '\xac'     #  0xC2 -> NOT SIGN
    '\u221a'   #  0xC3 -> SQUARE ROOT
    '\u0192'   #  0xC4 -> LATIN SMALL LETTER F WITH HOOK
    '\u2248'   #  0xC5 -> ALMOST EQUAL TO
    '\u2206'   #  0xC6 -> INCREMENT
    '\xab'     #  0xC7 -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbb'     #  0xC8 -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u2026'   #  0xC9 -> HORIZONTAL ELLIPSIS
    '\xa0'     #  0xCA -> NO-BREAK SPACE
    '\xc0'     #  0xCB -> LATIN CAPITAL LETTER A WITH GRAVE
    '\xc3'     #  0xCC -> LATIN CAPITAL LETTER A WITH TILDE
    '\xd5'     #  0xCD -> LATIN CAPITAL LETTER O WITH TILDE
    '\u0152'   #  0xCE -> LATIN CAPITAL LIGATURE OE
    '\u0153'   #  0xCF -> LATIN SMALL LIGATURE OE
    '\u2013'   #  0xD0 -> EN DASH
    '\u2014'   #  0xD1 -> EM DASH
    '\u201c'   #  0xD2 -> LEFT DOUBLE QUOTATION MARK
    '\u201d'   #  0xD3 -> RIGHT DOUBLE QUOTATION MARK
    '\u2018'   #  0xD4 -> LEFT SINGLE QUOTATION MARK
    '\u2019'   #  0xD5 -> RIGHT SINGLE QUOTATION MARK
    '\xf7'     #  0xD6 -> DIVISION SIGN
    '\u25ca'   #  0xD7 -> LOZENGE
    '\xff'     #  0xD8 -> LATIN SMALL LETTER Y WITH DIAERESIS
    '\u0178'   #  0xD9 -> LATIN CAPITAL LETTER Y WITH DIAERESIS
    '\u2044'   #  0xDA -> FRACTION SLASH
    '\u20ac'   #  0xDB -> EURO SIGN
    '\u2039'   #  0xDC -> SINGLE LEFT-POINTING ANGLE QUOTATION MARK
    '\u203a'   #  0xDD -> SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
    '\ufb01'   #  0xDE -> LATIN SMALL LIGATURE FI
    '\ufb02'   #  0xDF -> LATIN SMALL LIGATURE FL
    '\u2021'   #  0xE0 -> DOUBLE DAGGER
    '\xb7'     #  0xE1 -> MIDDLE DOT
    '\u201a'   #  0xE2 -> SINGLE LOW-9 QUOTATION MARK
    '\u201e'   #  0xE3 -> DOUBLE LOW-9 QUOTATION MARK
    '\u2030'   #  0xE4 -> PER MILLE SIGN
    '\xc2'     #  0xE5 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    '\xca'     #  0xE6 -> LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    '\xc1'     #  0xE7 -> LATIN CAPITAL LETTER A WITH ACUTE
    '\xcb'     #  0xE8 -> LATIN CAPITAL LETTER E WITH DIAERESIS
    '\xc8'     #  0xE9 -> LATIN CAPITAL LETTER E WITH GRAVE
    '\xcd'     #  0xEA -> LATIN CAPITAL LETTER I WITH ACUTE
    '\xce'     #  0xEB -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    '\xcf'     #  0xEC -> LATIN CAPITAL LETTER I WITH DIAERESIS
    '\xcc'     #  0xED -> LATIN CAPITAL LETTER I WITH GRAVE
    '\xd3'     #  0xEE -> LATIN CAPITAL LETTER O WITH ACUTE
    '\xd4'     #  0xEF -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    '\uf8ff'   #  0xF0 -> Apple logo
    '\xd2'     #  0xF1 -> LATIN CAPITAL LETTER O WITH GRAVE
    '\xda'     #  0xF2 -> LATIN CAPITAL LETTER U WITH ACUTE
    '\xdb'     #  0xF3 -> LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    '\xd9'     #  0xF4 -> LATIN CAPITAL LETTER U WITH GRAVE
    '\u0131'   #  0xF5 -> LATIN SMALL LETTER DOTLESS I
    '\u02c6'   #  0xF6 -> MODIFIER LETTER CIRCUMFLEX ACCENT
    '\u02dc'   #  0xF7 -> SMALL TILDE
    '\xaf'     #  0xF8 -> MACRON
    '\u02d8'   #  0xF9 -> BREVE
    '\u02d9'   #  0xFA -> DOT ABOVE
    '\u02da'   #  0xFB -> RING ABOVE
    '\xb8'     #  0xFC -> CEDILLA
    '\u02dd'   #  0xFD -> DOUBLE ACUTE ACCENT
    '\u02db'   #  0xFE -> OGONEK
    '\u02c7'   #  0xFF -> CARON
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/cp424.py000064400000027427151153537620007747 0ustar00""" Python Character Mapping Codec cp424 generated from 'MAPPINGS/VENDORS/MISC/CP424.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp424',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x9c'     #  0x04 -> SELECT
    '\t'       #  0x05 -> HORIZONTAL TABULATION
    '\x86'     #  0x06 -> REQUIRED NEW LINE
    '\x7f'     #  0x07 -> DELETE
    '\x97'     #  0x08 -> GRAPHIC ESCAPE
    '\x8d'     #  0x09 -> SUPERSCRIPT
    '\x8e'     #  0x0A -> REPEAT
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x9d'     #  0x14 -> RESTORE/ENABLE PRESENTATION
    '\x85'     #  0x15 -> NEW LINE
    '\x08'     #  0x16 -> BACKSPACE
    '\x87'     #  0x17 -> PROGRAM OPERATOR COMMUNICATION
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x92'     #  0x1A -> UNIT BACK SPACE
    '\x8f'     #  0x1B -> CUSTOMER USE ONE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    '\x80'     #  0x20 -> DIGIT SELECT
    '\x81'     #  0x21 -> START OF SIGNIFICANCE
    '\x82'     #  0x22 -> FIELD SEPARATOR
    '\x83'     #  0x23 -> WORD UNDERSCORE
    '\x84'     #  0x24 -> BYPASS OR INHIBIT PRESENTATION
    '\n'       #  0x25 -> LINE FEED
    '\x17'     #  0x26 -> END OF TRANSMISSION BLOCK
    '\x1b'     #  0x27 -> ESCAPE
    '\x88'     #  0x28 -> SET ATTRIBUTE
    '\x89'     #  0x29 -> START FIELD EXTENDED
    '\x8a'     #  0x2A -> SET MODE OR SWITCH
    '\x8b'     #  0x2B -> CONTROL SEQUENCE PREFIX
    '\x8c'     #  0x2C -> MODIFY FIELD ATTRIBUTE
    '\x05'     #  0x2D -> ENQUIRY
    '\x06'     #  0x2E -> ACKNOWLEDGE
    '\x07'     #  0x2F -> BELL
    '\x90'     #  0x30 -> <reserved>
    '\x91'     #  0x31 -> <reserved>
    '\x16'     #  0x32 -> SYNCHRONOUS IDLE
    '\x93'     #  0x33 -> INDEX RETURN
    '\x94'     #  0x34 -> PRESENTATION POSITION
    '\x95'     #  0x35 -> TRANSPARENT
    '\x96'     #  0x36 -> NUMERIC BACKSPACE
    '\x04'     #  0x37 -> END OF TRANSMISSION
    '\x98'     #  0x38 -> SUBSCRIPT
    '\x99'     #  0x39 -> INDENT TABULATION
    '\x9a'     #  0x3A -> REVERSE FORM FEED
    '\x9b'     #  0x3B -> CUSTOMER USE THREE
    '\x14'     #  0x3C -> DEVICE CONTROL FOUR
    '\x15'     #  0x3D -> NEGATIVE ACKNOWLEDGE
    '\x9e'     #  0x3E -> <reserved>
    '\x1a'     #  0x3F -> SUBSTITUTE
    ' '        #  0x40 -> SPACE
    '\u05d0'   #  0x41 -> HEBREW LETTER ALEF
    '\u05d1'   #  0x42 -> HEBREW LETTER BET
    '\u05d2'   #  0x43 -> HEBREW LETTER GIMEL
    '\u05d3'   #  0x44 -> HEBREW LETTER DALET
    '\u05d4'   #  0x45 -> HEBREW LETTER HE
    '\u05d5'   #  0x46 -> HEBREW LETTER VAV
    '\u05d6'   #  0x47 -> HEBREW LETTER ZAYIN
    '\u05d7'   #  0x48 -> HEBREW LETTER HET
    '\u05d8'   #  0x49 -> HEBREW LETTER TET
    '\xa2'     #  0x4A -> CENT SIGN
    '.'        #  0x4B -> FULL STOP
    '<'        #  0x4C -> LESS-THAN SIGN
    '('        #  0x4D -> LEFT PARENTHESIS
    '+'        #  0x4E -> PLUS SIGN
    '|'        #  0x4F -> VERTICAL LINE
    '&'        #  0x50 -> AMPERSAND
    '\u05d9'   #  0x51 -> HEBREW LETTER YOD
    '\u05da'   #  0x52 -> HEBREW LETTER FINAL KAF
    '\u05db'   #  0x53 -> HEBREW LETTER KAF
    '\u05dc'   #  0x54 -> HEBREW LETTER LAMED
    '\u05dd'   #  0x55 -> HEBREW LETTER FINAL MEM
    '\u05de'   #  0x56 -> HEBREW LETTER MEM
    '\u05df'   #  0x57 -> HEBREW LETTER FINAL NUN
    '\u05e0'   #  0x58 -> HEBREW LETTER NUN
    '\u05e1'   #  0x59 -> HEBREW LETTER SAMEKH
    '!'        #  0x5A -> EXCLAMATION MARK
    '$'        #  0x5B -> DOLLAR SIGN
    '*'        #  0x5C -> ASTERISK
    ')'        #  0x5D -> RIGHT PARENTHESIS
    ';'        #  0x5E -> SEMICOLON
    '\xac'     #  0x5F -> NOT SIGN
    '-'        #  0x60 -> HYPHEN-MINUS
    '/'        #  0x61 -> SOLIDUS
    '\u05e2'   #  0x62 -> HEBREW LETTER AYIN
    '\u05e3'   #  0x63 -> HEBREW LETTER FINAL PE
    '\u05e4'   #  0x64 -> HEBREW LETTER PE
    '\u05e5'   #  0x65 -> HEBREW LETTER FINAL TSADI
    '\u05e6'   #  0x66 -> HEBREW LETTER TSADI
    '\u05e7'   #  0x67 -> HEBREW LETTER QOF
    '\u05e8'   #  0x68 -> HEBREW LETTER RESH
    '\u05e9'   #  0x69 -> HEBREW LETTER SHIN
    '\xa6'     #  0x6A -> BROKEN BAR
    ','        #  0x6B -> COMMA
    '%'        #  0x6C -> PERCENT SIGN
    '_'        #  0x6D -> LOW LINE
    '>'        #  0x6E -> GREATER-THAN SIGN
    '?'        #  0x6F -> QUESTION MARK
    '\ufffe'   #  0x70 -> UNDEFINED
    '\u05ea'   #  0x71 -> HEBREW LETTER TAV
    '\ufffe'   #  0x72 -> UNDEFINED
    '\ufffe'   #  0x73 -> UNDEFINED
    '\xa0'     #  0x74 -> NO-BREAK SPACE
    '\ufffe'   #  0x75 -> UNDEFINED
    '\ufffe'   #  0x76 -> UNDEFINED
    '\ufffe'   #  0x77 -> UNDEFINED
    '\u2017'   #  0x78 -> DOUBLE LOW LINE
    '`'        #  0x79 -> GRAVE ACCENT
    ':'        #  0x7A -> COLON
    '#'        #  0x7B -> NUMBER SIGN
    '@'        #  0x7C -> COMMERCIAL AT
    "'"        #  0x7D -> APOSTROPHE
    '='        #  0x7E -> EQUALS SIGN
    '"'        #  0x7F -> QUOTATION MARK
    '\ufffe'   #  0x80 -> UNDEFINED
    'a'        #  0x81 -> LATIN SMALL LETTER A
    'b'        #  0x82 -> LATIN SMALL LETTER B
    'c'        #  0x83 -> LATIN SMALL LETTER C
    'd'        #  0x84 -> LATIN SMALL LETTER D
    'e'        #  0x85 -> LATIN SMALL LETTER E
    'f'        #  0x86 -> LATIN SMALL LETTER F
    'g'        #  0x87 -> LATIN SMALL LETTER G
    'h'        #  0x88 -> LATIN SMALL LETTER H
    'i'        #  0x89 -> LATIN SMALL LETTER I
    '\xab'     #  0x8A -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbb'     #  0x8B -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\ufffe'   #  0x8C -> UNDEFINED
    '\ufffe'   #  0x8D -> UNDEFINED
    '\ufffe'   #  0x8E -> UNDEFINED
    '\xb1'     #  0x8F -> PLUS-MINUS SIGN
    '\xb0'     #  0x90 -> DEGREE SIGN
    'j'        #  0x91 -> LATIN SMALL LETTER J
    'k'        #  0x92 -> LATIN SMALL LETTER K
    'l'        #  0x93 -> LATIN SMALL LETTER L
    'm'        #  0x94 -> LATIN SMALL LETTER M
    'n'        #  0x95 -> LATIN SMALL LETTER N
    'o'        #  0x96 -> LATIN SMALL LETTER O
    'p'        #  0x97 -> LATIN SMALL LETTER P
    'q'        #  0x98 -> LATIN SMALL LETTER Q
    'r'        #  0x99 -> LATIN SMALL LETTER R
    '\ufffe'   #  0x9A -> UNDEFINED
    '\ufffe'   #  0x9B -> UNDEFINED
    '\ufffe'   #  0x9C -> UNDEFINED
    '\xb8'     #  0x9D -> CEDILLA
    '\ufffe'   #  0x9E -> UNDEFINED
    '\xa4'     #  0x9F -> CURRENCY SIGN
    '\xb5'     #  0xA0 -> MICRO SIGN
    '~'        #  0xA1 -> TILDE
    's'        #  0xA2 -> LATIN SMALL LETTER S
    't'        #  0xA3 -> LATIN SMALL LETTER T
    'u'        #  0xA4 -> LATIN SMALL LETTER U
    'v'        #  0xA5 -> LATIN SMALL LETTER V
    'w'        #  0xA6 -> LATIN SMALL LETTER W
    'x'        #  0xA7 -> LATIN SMALL LETTER X
    'y'        #  0xA8 -> LATIN SMALL LETTER Y
    'z'        #  0xA9 -> LATIN SMALL LETTER Z
    '\ufffe'   #  0xAA -> UNDEFINED
    '\ufffe'   #  0xAB -> UNDEFINED
    '\ufffe'   #  0xAC -> UNDEFINED
    '\ufffe'   #  0xAD -> UNDEFINED
    '\ufffe'   #  0xAE -> UNDEFINED
    '\xae'     #  0xAF -> REGISTERED SIGN
    '^'        #  0xB0 -> CIRCUMFLEX ACCENT
    '\xa3'     #  0xB1 -> POUND SIGN
    '\xa5'     #  0xB2 -> YEN SIGN
    '\xb7'     #  0xB3 -> MIDDLE DOT
    '\xa9'     #  0xB4 -> COPYRIGHT SIGN
    '\xa7'     #  0xB5 -> SECTION SIGN
    '\xb6'     #  0xB6 -> PILCROW SIGN
    '\xbc'     #  0xB7 -> VULGAR FRACTION ONE QUARTER
    '\xbd'     #  0xB8 -> VULGAR FRACTION ONE HALF
    '\xbe'     #  0xB9 -> VULGAR FRACTION THREE QUARTERS
    '['        #  0xBA -> LEFT SQUARE BRACKET
    ']'        #  0xBB -> RIGHT SQUARE BRACKET
    '\xaf'     #  0xBC -> MACRON
    '\xa8'     #  0xBD -> DIAERESIS
    '\xb4'     #  0xBE -> ACUTE ACCENT
    '\xd7'     #  0xBF -> MULTIPLICATION SIGN
    '{'        #  0xC0 -> LEFT CURLY BRACKET
    'A'        #  0xC1 -> LATIN CAPITAL LETTER A
    'B'        #  0xC2 -> LATIN CAPITAL LETTER B
    'C'        #  0xC3 -> LATIN CAPITAL LETTER C
    'D'        #  0xC4 -> LATIN CAPITAL LETTER D
    'E'        #  0xC5 -> LATIN CAPITAL LETTER E
    'F'        #  0xC6 -> LATIN CAPITAL LETTER F
    'G'        #  0xC7 -> LATIN CAPITAL LETTER G
    'H'        #  0xC8 -> LATIN CAPITAL LETTER H
    'I'        #  0xC9 -> LATIN CAPITAL LETTER I
    '\xad'     #  0xCA -> SOFT HYPHEN
    '\ufffe'   #  0xCB -> UNDEFINED
    '\ufffe'   #  0xCC -> UNDEFINED
    '\ufffe'   #  0xCD -> UNDEFINED
    '\ufffe'   #  0xCE -> UNDEFINED
    '\ufffe'   #  0xCF -> UNDEFINED
    '}'        #  0xD0 -> RIGHT CURLY BRACKET
    'J'        #  0xD1 -> LATIN CAPITAL LETTER J
    'K'        #  0xD2 -> LATIN CAPITAL LETTER K
    'L'        #  0xD3 -> LATIN CAPITAL LETTER L
    'M'        #  0xD4 -> LATIN CAPITAL LETTER M
    'N'        #  0xD5 -> LATIN CAPITAL LETTER N
    'O'        #  0xD6 -> LATIN CAPITAL LETTER O
    'P'        #  0xD7 -> LATIN CAPITAL LETTER P
    'Q'        #  0xD8 -> LATIN CAPITAL LETTER Q
    'R'        #  0xD9 -> LATIN CAPITAL LETTER R
    '\xb9'     #  0xDA -> SUPERSCRIPT ONE
    '\ufffe'   #  0xDB -> UNDEFINED
    '\ufffe'   #  0xDC -> UNDEFINED
    '\ufffe'   #  0xDD -> UNDEFINED
    '\ufffe'   #  0xDE -> UNDEFINED
    '\ufffe'   #  0xDF -> UNDEFINED
    '\\'       #  0xE0 -> REVERSE SOLIDUS
    '\xf7'     #  0xE1 -> DIVISION SIGN
    'S'        #  0xE2 -> LATIN CAPITAL LETTER S
    'T'        #  0xE3 -> LATIN CAPITAL LETTER T
    'U'        #  0xE4 -> LATIN CAPITAL LETTER U
    'V'        #  0xE5 -> LATIN CAPITAL LETTER V
    'W'        #  0xE6 -> LATIN CAPITAL LETTER W
    'X'        #  0xE7 -> LATIN CAPITAL LETTER X
    'Y'        #  0xE8 -> LATIN CAPITAL LETTER Y
    'Z'        #  0xE9 -> LATIN CAPITAL LETTER Z
    '\xb2'     #  0xEA -> SUPERSCRIPT TWO
    '\ufffe'   #  0xEB -> UNDEFINED
    '\ufffe'   #  0xEC -> UNDEFINED
    '\ufffe'   #  0xED -> UNDEFINED
    '\ufffe'   #  0xEE -> UNDEFINED
    '\ufffe'   #  0xEF -> UNDEFINED
    '0'        #  0xF0 -> DIGIT ZERO
    '1'        #  0xF1 -> DIGIT ONE
    '2'        #  0xF2 -> DIGIT TWO
    '3'        #  0xF3 -> DIGIT THREE
    '4'        #  0xF4 -> DIGIT FOUR
    '5'        #  0xF5 -> DIGIT FIVE
    '6'        #  0xF6 -> DIGIT SIX
    '7'        #  0xF7 -> DIGIT SEVEN
    '8'        #  0xF8 -> DIGIT EIGHT
    '9'        #  0xF9 -> DIGIT NINE
    '\xb3'     #  0xFA -> SUPERSCRIPT THREE
    '\ufffe'   #  0xFB -> UNDEFINED
    '\ufffe'   #  0xFC -> UNDEFINED
    '\ufffe'   #  0xFD -> UNDEFINED
    '\ufffe'   #  0xFE -> UNDEFINED
    '\x9f'     #  0xFF -> EIGHT ONES
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/cp869.py000064400000100305151153537620007747 0ustar00""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP869.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_map)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_map)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp869',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )

### Decoding Map

decoding_map = codecs.make_identity_dict(range(256))
decoding_map.update({
    0x0080: None,       #  UNDEFINED
    0x0081: None,       #  UNDEFINED
    0x0082: None,       #  UNDEFINED
    0x0083: None,       #  UNDEFINED
    0x0084: None,       #  UNDEFINED
    0x0085: None,       #  UNDEFINED
    0x0086: 0x0386,     #  GREEK CAPITAL LETTER ALPHA WITH TONOS
    0x0087: None,       #  UNDEFINED
    0x0088: 0x00b7,     #  MIDDLE DOT
    0x0089: 0x00ac,     #  NOT SIGN
    0x008a: 0x00a6,     #  BROKEN BAR
    0x008b: 0x2018,     #  LEFT SINGLE QUOTATION MARK
    0x008c: 0x2019,     #  RIGHT SINGLE QUOTATION MARK
    0x008d: 0x0388,     #  GREEK CAPITAL LETTER EPSILON WITH TONOS
    0x008e: 0x2015,     #  HORIZONTAL BAR
    0x008f: 0x0389,     #  GREEK CAPITAL LETTER ETA WITH TONOS
    0x0090: 0x038a,     #  GREEK CAPITAL LETTER IOTA WITH TONOS
    0x0091: 0x03aa,     #  GREEK CAPITAL LETTER IOTA WITH DIALYTIKA
    0x0092: 0x038c,     #  GREEK CAPITAL LETTER OMICRON WITH TONOS
    0x0093: None,       #  UNDEFINED
    0x0094: None,       #  UNDEFINED
    0x0095: 0x038e,     #  GREEK CAPITAL LETTER UPSILON WITH TONOS
    0x0096: 0x03ab,     #  GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA
    0x0097: 0x00a9,     #  COPYRIGHT SIGN
    0x0098: 0x038f,     #  GREEK CAPITAL LETTER OMEGA WITH TONOS
    0x0099: 0x00b2,     #  SUPERSCRIPT TWO
    0x009a: 0x00b3,     #  SUPERSCRIPT THREE
    0x009b: 0x03ac,     #  GREEK SMALL LETTER ALPHA WITH TONOS
    0x009c: 0x00a3,     #  POUND SIGN
    0x009d: 0x03ad,     #  GREEK SMALL LETTER EPSILON WITH TONOS
    0x009e: 0x03ae,     #  GREEK SMALL LETTER ETA WITH TONOS
    0x009f: 0x03af,     #  GREEK SMALL LETTER IOTA WITH TONOS
    0x00a0: 0x03ca,     #  GREEK SMALL LETTER IOTA WITH DIALYTIKA
    0x00a1: 0x0390,     #  GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
    0x00a2: 0x03cc,     #  GREEK SMALL LETTER OMICRON WITH TONOS
    0x00a3: 0x03cd,     #  GREEK SMALL LETTER UPSILON WITH TONOS
    0x00a4: 0x0391,     #  GREEK CAPITAL LETTER ALPHA
    0x00a5: 0x0392,     #  GREEK CAPITAL LETTER BETA
    0x00a6: 0x0393,     #  GREEK CAPITAL LETTER GAMMA
    0x00a7: 0x0394,     #  GREEK CAPITAL LETTER DELTA
    0x00a8: 0x0395,     #  GREEK CAPITAL LETTER EPSILON
    0x00a9: 0x0396,     #  GREEK CAPITAL LETTER ZETA
    0x00aa: 0x0397,     #  GREEK CAPITAL LETTER ETA
    0x00ab: 0x00bd,     #  VULGAR FRACTION ONE HALF
    0x00ac: 0x0398,     #  GREEK CAPITAL LETTER THETA
    0x00ad: 0x0399,     #  GREEK CAPITAL LETTER IOTA
    0x00ae: 0x00ab,     #  LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00af: 0x00bb,     #  RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00b0: 0x2591,     #  LIGHT SHADE
    0x00b1: 0x2592,     #  MEDIUM SHADE
    0x00b2: 0x2593,     #  DARK SHADE
    0x00b3: 0x2502,     #  BOX DRAWINGS LIGHT VERTICAL
    0x00b4: 0x2524,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
    0x00b5: 0x039a,     #  GREEK CAPITAL LETTER KAPPA
    0x00b6: 0x039b,     #  GREEK CAPITAL LETTER LAMDA
    0x00b7: 0x039c,     #  GREEK CAPITAL LETTER MU
    0x00b8: 0x039d,     #  GREEK CAPITAL LETTER NU
    0x00b9: 0x2563,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    0x00ba: 0x2551,     #  BOX DRAWINGS DOUBLE VERTICAL
    0x00bb: 0x2557,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
    0x00bc: 0x255d,     #  BOX DRAWINGS DOUBLE UP AND LEFT
    0x00bd: 0x039e,     #  GREEK CAPITAL LETTER XI
    0x00be: 0x039f,     #  GREEK CAPITAL LETTER OMICRON
    0x00bf: 0x2510,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
    0x00c0: 0x2514,     #  BOX DRAWINGS LIGHT UP AND RIGHT
    0x00c1: 0x2534,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
    0x00c2: 0x252c,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    0x00c3: 0x251c,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    0x00c4: 0x2500,     #  BOX DRAWINGS LIGHT HORIZONTAL
    0x00c5: 0x253c,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    0x00c6: 0x03a0,     #  GREEK CAPITAL LETTER PI
    0x00c7: 0x03a1,     #  GREEK CAPITAL LETTER RHO
    0x00c8: 0x255a,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
    0x00c9: 0x2554,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
    0x00ca: 0x2569,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    0x00cb: 0x2566,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    0x00cc: 0x2560,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    0x00cd: 0x2550,     #  BOX DRAWINGS DOUBLE HORIZONTAL
    0x00ce: 0x256c,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    0x00cf: 0x03a3,     #  GREEK CAPITAL LETTER SIGMA
    0x00d0: 0x03a4,     #  GREEK CAPITAL LETTER TAU
    0x00d1: 0x03a5,     #  GREEK CAPITAL LETTER UPSILON
    0x00d2: 0x03a6,     #  GREEK CAPITAL LETTER PHI
    0x00d3: 0x03a7,     #  GREEK CAPITAL LETTER CHI
    0x00d4: 0x03a8,     #  GREEK CAPITAL LETTER PSI
    0x00d5: 0x03a9,     #  GREEK CAPITAL LETTER OMEGA
    0x00d6: 0x03b1,     #  GREEK SMALL LETTER ALPHA
    0x00d7: 0x03b2,     #  GREEK SMALL LETTER BETA
    0x00d8: 0x03b3,     #  GREEK SMALL LETTER GAMMA
    0x00d9: 0x2518,     #  BOX DRAWINGS LIGHT UP AND LEFT
    0x00da: 0x250c,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
    0x00db: 0x2588,     #  FULL BLOCK
    0x00dc: 0x2584,     #  LOWER HALF BLOCK
    0x00dd: 0x03b4,     #  GREEK SMALL LETTER DELTA
    0x00de: 0x03b5,     #  GREEK SMALL LETTER EPSILON
    0x00df: 0x2580,     #  UPPER HALF BLOCK
    0x00e0: 0x03b6,     #  GREEK SMALL LETTER ZETA
    0x00e1: 0x03b7,     #  GREEK SMALL LETTER ETA
    0x00e2: 0x03b8,     #  GREEK SMALL LETTER THETA
    0x00e3: 0x03b9,     #  GREEK SMALL LETTER IOTA
    0x00e4: 0x03ba,     #  GREEK SMALL LETTER KAPPA
    0x00e5: 0x03bb,     #  GREEK SMALL LETTER LAMDA
    0x00e6: 0x03bc,     #  GREEK SMALL LETTER MU
    0x00e7: 0x03bd,     #  GREEK SMALL LETTER NU
    0x00e8: 0x03be,     #  GREEK SMALL LETTER XI
    0x00e9: 0x03bf,     #  GREEK SMALL LETTER OMICRON
    0x00ea: 0x03c0,     #  GREEK SMALL LETTER PI
    0x00eb: 0x03c1,     #  GREEK SMALL LETTER RHO
    0x00ec: 0x03c3,     #  GREEK SMALL LETTER SIGMA
    0x00ed: 0x03c2,     #  GREEK SMALL LETTER FINAL SIGMA
    0x00ee: 0x03c4,     #  GREEK SMALL LETTER TAU
    0x00ef: 0x0384,     #  GREEK TONOS
    0x00f0: 0x00ad,     #  SOFT HYPHEN
    0x00f1: 0x00b1,     #  PLUS-MINUS SIGN
    0x00f2: 0x03c5,     #  GREEK SMALL LETTER UPSILON
    0x00f3: 0x03c6,     #  GREEK SMALL LETTER PHI
    0x00f4: 0x03c7,     #  GREEK SMALL LETTER CHI
    0x00f5: 0x00a7,     #  SECTION SIGN
    0x00f6: 0x03c8,     #  GREEK SMALL LETTER PSI
    0x00f7: 0x0385,     #  GREEK DIALYTIKA TONOS
    0x00f8: 0x00b0,     #  DEGREE SIGN
    0x00f9: 0x00a8,     #  DIAERESIS
    0x00fa: 0x03c9,     #  GREEK SMALL LETTER OMEGA
    0x00fb: 0x03cb,     #  GREEK SMALL LETTER UPSILON WITH DIALYTIKA
    0x00fc: 0x03b0,     #  GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
    0x00fd: 0x03ce,     #  GREEK SMALL LETTER OMEGA WITH TONOS
    0x00fe: 0x25a0,     #  BLACK SQUARE
    0x00ff: 0x00a0,     #  NO-BREAK SPACE
})

### Decoding Table

decoding_table = (
    '\x00'     #  0x0000 -> NULL
    '\x01'     #  0x0001 -> START OF HEADING
    '\x02'     #  0x0002 -> START OF TEXT
    '\x03'     #  0x0003 -> END OF TEXT
    '\x04'     #  0x0004 -> END OF TRANSMISSION
    '\x05'     #  0x0005 -> ENQUIRY
    '\x06'     #  0x0006 -> ACKNOWLEDGE
    '\x07'     #  0x0007 -> BELL
    '\x08'     #  0x0008 -> BACKSPACE
    '\t'       #  0x0009 -> HORIZONTAL TABULATION
    '\n'       #  0x000a -> LINE FEED
    '\x0b'     #  0x000b -> VERTICAL TABULATION
    '\x0c'     #  0x000c -> FORM FEED
    '\r'       #  0x000d -> CARRIAGE RETURN
    '\x0e'     #  0x000e -> SHIFT OUT
    '\x0f'     #  0x000f -> SHIFT IN
    '\x10'     #  0x0010 -> DATA LINK ESCAPE
    '\x11'     #  0x0011 -> DEVICE CONTROL ONE
    '\x12'     #  0x0012 -> DEVICE CONTROL TWO
    '\x13'     #  0x0013 -> DEVICE CONTROL THREE
    '\x14'     #  0x0014 -> DEVICE CONTROL FOUR
    '\x15'     #  0x0015 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x0016 -> SYNCHRONOUS IDLE
    '\x17'     #  0x0017 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x0018 -> CANCEL
    '\x19'     #  0x0019 -> END OF MEDIUM
    '\x1a'     #  0x001a -> SUBSTITUTE
    '\x1b'     #  0x001b -> ESCAPE
    '\x1c'     #  0x001c -> FILE SEPARATOR
    '\x1d'     #  0x001d -> GROUP SEPARATOR
    '\x1e'     #  0x001e -> RECORD SEPARATOR
    '\x1f'     #  0x001f -> UNIT SEPARATOR
    ' '        #  0x0020 -> SPACE
    '!'        #  0x0021 -> EXCLAMATION MARK
    '"'        #  0x0022 -> QUOTATION MARK
    '#'        #  0x0023 -> NUMBER SIGN
    '$'        #  0x0024 -> DOLLAR SIGN
    '%'        #  0x0025 -> PERCENT SIGN
    '&'        #  0x0026 -> AMPERSAND
    "'"        #  0x0027 -> APOSTROPHE
    '('        #  0x0028 -> LEFT PARENTHESIS
    ')'        #  0x0029 -> RIGHT PARENTHESIS
    '*'        #  0x002a -> ASTERISK
    '+'        #  0x002b -> PLUS SIGN
    ','        #  0x002c -> COMMA
    '-'        #  0x002d -> HYPHEN-MINUS
    '.'        #  0x002e -> FULL STOP
    '/'        #  0x002f -> SOLIDUS
    '0'        #  0x0030 -> DIGIT ZERO
    '1'        #  0x0031 -> DIGIT ONE
    '2'        #  0x0032 -> DIGIT TWO
    '3'        #  0x0033 -> DIGIT THREE
    '4'        #  0x0034 -> DIGIT FOUR
    '5'        #  0x0035 -> DIGIT FIVE
    '6'        #  0x0036 -> DIGIT SIX
    '7'        #  0x0037 -> DIGIT SEVEN
    '8'        #  0x0038 -> DIGIT EIGHT
    '9'        #  0x0039 -> DIGIT NINE
    ':'        #  0x003a -> COLON
    ';'        #  0x003b -> SEMICOLON
    '<'        #  0x003c -> LESS-THAN SIGN
    '='        #  0x003d -> EQUALS SIGN
    '>'        #  0x003e -> GREATER-THAN SIGN
    '?'        #  0x003f -> QUESTION MARK
    '@'        #  0x0040 -> COMMERCIAL AT
    'A'        #  0x0041 -> LATIN CAPITAL LETTER A
    'B'        #  0x0042 -> LATIN CAPITAL LETTER B
    'C'        #  0x0043 -> LATIN CAPITAL LETTER C
    'D'        #  0x0044 -> LATIN CAPITAL LETTER D
    'E'        #  0x0045 -> LATIN CAPITAL LETTER E
    'F'        #  0x0046 -> LATIN CAPITAL LETTER F
    'G'        #  0x0047 -> LATIN CAPITAL LETTER G
    'H'        #  0x0048 -> LATIN CAPITAL LETTER H
    'I'        #  0x0049 -> LATIN CAPITAL LETTER I
    'J'        #  0x004a -> LATIN CAPITAL LETTER J
    'K'        #  0x004b -> LATIN CAPITAL LETTER K
    'L'        #  0x004c -> LATIN CAPITAL LETTER L
    'M'        #  0x004d -> LATIN CAPITAL LETTER M
    'N'        #  0x004e -> LATIN CAPITAL LETTER N
    'O'        #  0x004f -> LATIN CAPITAL LETTER O
    'P'        #  0x0050 -> LATIN CAPITAL LETTER P
    'Q'        #  0x0051 -> LATIN CAPITAL LETTER Q
    'R'        #  0x0052 -> LATIN CAPITAL LETTER R
    'S'        #  0x0053 -> LATIN CAPITAL LETTER S
    'T'        #  0x0054 -> LATIN CAPITAL LETTER T
    'U'        #  0x0055 -> LATIN CAPITAL LETTER U
    'V'        #  0x0056 -> LATIN CAPITAL LETTER V
    'W'        #  0x0057 -> LATIN CAPITAL LETTER W
    'X'        #  0x0058 -> LATIN CAPITAL LETTER X
    'Y'        #  0x0059 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x005a -> LATIN CAPITAL LETTER Z
    '['        #  0x005b -> LEFT SQUARE BRACKET
    '\\'       #  0x005c -> REVERSE SOLIDUS
    ']'        #  0x005d -> RIGHT SQUARE BRACKET
    '^'        #  0x005e -> CIRCUMFLEX ACCENT
    '_'        #  0x005f -> LOW LINE
    '`'        #  0x0060 -> GRAVE ACCENT
    'a'        #  0x0061 -> LATIN SMALL LETTER A
    'b'        #  0x0062 -> LATIN SMALL LETTER B
    'c'        #  0x0063 -> LATIN SMALL LETTER C
    'd'        #  0x0064 -> LATIN SMALL LETTER D
    'e'        #  0x0065 -> LATIN SMALL LETTER E
    'f'        #  0x0066 -> LATIN SMALL LETTER F
    'g'        #  0x0067 -> LATIN SMALL LETTER G
    'h'        #  0x0068 -> LATIN SMALL LETTER H
    'i'        #  0x0069 -> LATIN SMALL LETTER I
    'j'        #  0x006a -> LATIN SMALL LETTER J
    'k'        #  0x006b -> LATIN SMALL LETTER K
    'l'        #  0x006c -> LATIN SMALL LETTER L
    'm'        #  0x006d -> LATIN SMALL LETTER M
    'n'        #  0x006e -> LATIN SMALL LETTER N
    'o'        #  0x006f -> LATIN SMALL LETTER O
    'p'        #  0x0070 -> LATIN SMALL LETTER P
    'q'        #  0x0071 -> LATIN SMALL LETTER Q
    'r'        #  0x0072 -> LATIN SMALL LETTER R
    's'        #  0x0073 -> LATIN SMALL LETTER S
    't'        #  0x0074 -> LATIN SMALL LETTER T
    'u'        #  0x0075 -> LATIN SMALL LETTER U
    'v'        #  0x0076 -> LATIN SMALL LETTER V
    'w'        #  0x0077 -> LATIN SMALL LETTER W
    'x'        #  0x0078 -> LATIN SMALL LETTER X
    'y'        #  0x0079 -> LATIN SMALL LETTER Y
    'z'        #  0x007a -> LATIN SMALL LETTER Z
    '{'        #  0x007b -> LEFT CURLY BRACKET
    '|'        #  0x007c -> VERTICAL LINE
    '}'        #  0x007d -> RIGHT CURLY BRACKET
    '~'        #  0x007e -> TILDE
    '\x7f'     #  0x007f -> DELETE
    '\ufffe'   #  0x0080 -> UNDEFINED
    '\ufffe'   #  0x0081 -> UNDEFINED
    '\ufffe'   #  0x0082 -> UNDEFINED
    '\ufffe'   #  0x0083 -> UNDEFINED
    '\ufffe'   #  0x0084 -> UNDEFINED
    '\ufffe'   #  0x0085 -> UNDEFINED
    '\u0386'   #  0x0086 -> GREEK CAPITAL LETTER ALPHA WITH TONOS
    '\ufffe'   #  0x0087 -> UNDEFINED
    '\xb7'     #  0x0088 -> MIDDLE DOT
    '\xac'     #  0x0089 -> NOT SIGN
    '\xa6'     #  0x008a -> BROKEN BAR
    '\u2018'   #  0x008b -> LEFT SINGLE QUOTATION MARK
    '\u2019'   #  0x008c -> RIGHT SINGLE QUOTATION MARK
    '\u0388'   #  0x008d -> GREEK CAPITAL LETTER EPSILON WITH TONOS
    '\u2015'   #  0x008e -> HORIZONTAL BAR
    '\u0389'   #  0x008f -> GREEK CAPITAL LETTER ETA WITH TONOS
    '\u038a'   #  0x0090 -> GREEK CAPITAL LETTER IOTA WITH TONOS
    '\u03aa'   #  0x0091 -> GREEK CAPITAL LETTER IOTA WITH DIALYTIKA
    '\u038c'   #  0x0092 -> GREEK CAPITAL LETTER OMICRON WITH TONOS
    '\ufffe'   #  0x0093 -> UNDEFINED
    '\ufffe'   #  0x0094 -> UNDEFINED
    '\u038e'   #  0x0095 -> GREEK CAPITAL LETTER UPSILON WITH TONOS
    '\u03ab'   #  0x0096 -> GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA
    '\xa9'     #  0x0097 -> COPYRIGHT SIGN
    '\u038f'   #  0x0098 -> GREEK CAPITAL LETTER OMEGA WITH TONOS
    '\xb2'     #  0x0099 -> SUPERSCRIPT TWO
    '\xb3'     #  0x009a -> SUPERSCRIPT THREE
    '\u03ac'   #  0x009b -> GREEK SMALL LETTER ALPHA WITH TONOS
    '\xa3'     #  0x009c -> POUND SIGN
    '\u03ad'   #  0x009d -> GREEK SMALL LETTER EPSILON WITH TONOS
    '\u03ae'   #  0x009e -> GREEK SMALL LETTER ETA WITH TONOS
    '\u03af'   #  0x009f -> GREEK SMALL LETTER IOTA WITH TONOS
    '\u03ca'   #  0x00a0 -> GREEK SMALL LETTER IOTA WITH DIALYTIKA
    '\u0390'   #  0x00a1 -> GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
    '\u03cc'   #  0x00a2 -> GREEK SMALL LETTER OMICRON WITH TONOS
    '\u03cd'   #  0x00a3 -> GREEK SMALL LETTER UPSILON WITH TONOS
    '\u0391'   #  0x00a4 -> GREEK CAPITAL LETTER ALPHA
    '\u0392'   #  0x00a5 -> GREEK CAPITAL LETTER BETA
    '\u0393'   #  0x00a6 -> GREEK CAPITAL LETTER GAMMA
    '\u0394'   #  0x00a7 -> GREEK CAPITAL LETTER DELTA
    '\u0395'   #  0x00a8 -> GREEK CAPITAL LETTER EPSILON
    '\u0396'   #  0x00a9 -> GREEK CAPITAL LETTER ZETA
    '\u0397'   #  0x00aa -> GREEK CAPITAL LETTER ETA
    '\xbd'     #  0x00ab -> VULGAR FRACTION ONE HALF
    '\u0398'   #  0x00ac -> GREEK CAPITAL LETTER THETA
    '\u0399'   #  0x00ad -> GREEK CAPITAL LETTER IOTA
    '\xab'     #  0x00ae -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbb'     #  0x00af -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u2591'   #  0x00b0 -> LIGHT SHADE
    '\u2592'   #  0x00b1 -> MEDIUM SHADE
    '\u2593'   #  0x00b2 -> DARK SHADE
    '\u2502'   #  0x00b3 -> BOX DRAWINGS LIGHT VERTICAL
    '\u2524'   #  0x00b4 -> BOX DRAWINGS LIGHT VERTICAL AND LEFT
    '\u039a'   #  0x00b5 -> GREEK CAPITAL LETTER KAPPA
    '\u039b'   #  0x00b6 -> GREEK CAPITAL LETTER LAMDA
    '\u039c'   #  0x00b7 -> GREEK CAPITAL LETTER MU
    '\u039d'   #  0x00b8 -> GREEK CAPITAL LETTER NU
    '\u2563'   #  0x00b9 -> BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    '\u2551'   #  0x00ba -> BOX DRAWINGS DOUBLE VERTICAL
    '\u2557'   #  0x00bb -> BOX DRAWINGS DOUBLE DOWN AND LEFT
    '\u255d'   #  0x00bc -> BOX DRAWINGS DOUBLE UP AND LEFT
    '\u039e'   #  0x00bd -> GREEK CAPITAL LETTER XI
    '\u039f'   #  0x00be -> GREEK CAPITAL LETTER OMICRON
    '\u2510'   #  0x00bf -> BOX DRAWINGS LIGHT DOWN AND LEFT
    '\u2514'   #  0x00c0 -> BOX DRAWINGS LIGHT UP AND RIGHT
    '\u2534'   #  0x00c1 -> BOX DRAWINGS LIGHT UP AND HORIZONTAL
    '\u252c'   #  0x00c2 -> BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    '\u251c'   #  0x00c3 -> BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    '\u2500'   #  0x00c4 -> BOX DRAWINGS LIGHT HORIZONTAL
    '\u253c'   #  0x00c5 -> BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    '\u03a0'   #  0x00c6 -> GREEK CAPITAL LETTER PI
    '\u03a1'   #  0x00c7 -> GREEK CAPITAL LETTER RHO
    '\u255a'   #  0x00c8 -> BOX DRAWINGS DOUBLE UP AND RIGHT
    '\u2554'   #  0x00c9 -> BOX DRAWINGS DOUBLE DOWN AND RIGHT
    '\u2569'   #  0x00ca -> BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    '\u2566'   #  0x00cb -> BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    '\u2560'   #  0x00cc -> BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    '\u2550'   #  0x00cd -> BOX DRAWINGS DOUBLE HORIZONTAL
    '\u256c'   #  0x00ce -> BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    '\u03a3'   #  0x00cf -> GREEK CAPITAL LETTER SIGMA
    '\u03a4'   #  0x00d0 -> GREEK CAPITAL LETTER TAU
    '\u03a5'   #  0x00d1 -> GREEK CAPITAL LETTER UPSILON
    '\u03a6'   #  0x00d2 -> GREEK CAPITAL LETTER PHI
    '\u03a7'   #  0x00d3 -> GREEK CAPITAL LETTER CHI
    '\u03a8'   #  0x00d4 -> GREEK CAPITAL LETTER PSI
    '\u03a9'   #  0x00d5 -> GREEK CAPITAL LETTER OMEGA
    '\u03b1'   #  0x00d6 -> GREEK SMALL LETTER ALPHA
    '\u03b2'   #  0x00d7 -> GREEK SMALL LETTER BETA
    '\u03b3'   #  0x00d8 -> GREEK SMALL LETTER GAMMA
    '\u2518'   #  0x00d9 -> BOX DRAWINGS LIGHT UP AND LEFT
    '\u250c'   #  0x00da -> BOX DRAWINGS LIGHT DOWN AND RIGHT
    '\u2588'   #  0x00db -> FULL BLOCK
    '\u2584'   #  0x00dc -> LOWER HALF BLOCK
    '\u03b4'   #  0x00dd -> GREEK SMALL LETTER DELTA
    '\u03b5'   #  0x00de -> GREEK SMALL LETTER EPSILON
    '\u2580'   #  0x00df -> UPPER HALF BLOCK
    '\u03b6'   #  0x00e0 -> GREEK SMALL LETTER ZETA
    '\u03b7'   #  0x00e1 -> GREEK SMALL LETTER ETA
    '\u03b8'   #  0x00e2 -> GREEK SMALL LETTER THETA
    '\u03b9'   #  0x00e3 -> GREEK SMALL LETTER IOTA
    '\u03ba'   #  0x00e4 -> GREEK SMALL LETTER KAPPA
    '\u03bb'   #  0x00e5 -> GREEK SMALL LETTER LAMDA
    '\u03bc'   #  0x00e6 -> GREEK SMALL LETTER MU
    '\u03bd'   #  0x00e7 -> GREEK SMALL LETTER NU
    '\u03be'   #  0x00e8 -> GREEK SMALL LETTER XI
    '\u03bf'   #  0x00e9 -> GREEK SMALL LETTER OMICRON
    '\u03c0'   #  0x00ea -> GREEK SMALL LETTER PI
    '\u03c1'   #  0x00eb -> GREEK SMALL LETTER RHO
    '\u03c3'   #  0x00ec -> GREEK SMALL LETTER SIGMA
    '\u03c2'   #  0x00ed -> GREEK SMALL LETTER FINAL SIGMA
    '\u03c4'   #  0x00ee -> GREEK SMALL LETTER TAU
    '\u0384'   #  0x00ef -> GREEK TONOS
    '\xad'     #  0x00f0 -> SOFT HYPHEN
    '\xb1'     #  0x00f1 -> PLUS-MINUS SIGN
    '\u03c5'   #  0x00f2 -> GREEK SMALL LETTER UPSILON
    '\u03c6'   #  0x00f3 -> GREEK SMALL LETTER PHI
    '\u03c7'   #  0x00f4 -> GREEK SMALL LETTER CHI
    '\xa7'     #  0x00f5 -> SECTION SIGN
    '\u03c8'   #  0x00f6 -> GREEK SMALL LETTER PSI
    '\u0385'   #  0x00f7 -> GREEK DIALYTIKA TONOS
    '\xb0'     #  0x00f8 -> DEGREE SIGN
    '\xa8'     #  0x00f9 -> DIAERESIS
    '\u03c9'   #  0x00fa -> GREEK SMALL LETTER OMEGA
    '\u03cb'   #  0x00fb -> GREEK SMALL LETTER UPSILON WITH DIALYTIKA
    '\u03b0'   #  0x00fc -> GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
    '\u03ce'   #  0x00fd -> GREEK SMALL LETTER OMEGA WITH TONOS
    '\u25a0'   #  0x00fe -> BLACK SQUARE
    '\xa0'     #  0x00ff -> NO-BREAK SPACE
)

### Encoding Map

encoding_map = {
    0x0000: 0x0000,     #  NULL
    0x0001: 0x0001,     #  START OF HEADING
    0x0002: 0x0002,     #  START OF TEXT
    0x0003: 0x0003,     #  END OF TEXT
    0x0004: 0x0004,     #  END OF TRANSMISSION
    0x0005: 0x0005,     #  ENQUIRY
    0x0006: 0x0006,     #  ACKNOWLEDGE
    0x0007: 0x0007,     #  BELL
    0x0008: 0x0008,     #  BACKSPACE
    0x0009: 0x0009,     #  HORIZONTAL TABULATION
    0x000a: 0x000a,     #  LINE FEED
    0x000b: 0x000b,     #  VERTICAL TABULATION
    0x000c: 0x000c,     #  FORM FEED
    0x000d: 0x000d,     #  CARRIAGE RETURN
    0x000e: 0x000e,     #  SHIFT OUT
    0x000f: 0x000f,     #  SHIFT IN
    0x0010: 0x0010,     #  DATA LINK ESCAPE
    0x0011: 0x0011,     #  DEVICE CONTROL ONE
    0x0012: 0x0012,     #  DEVICE CONTROL TWO
    0x0013: 0x0013,     #  DEVICE CONTROL THREE
    0x0014: 0x0014,     #  DEVICE CONTROL FOUR
    0x0015: 0x0015,     #  NEGATIVE ACKNOWLEDGE
    0x0016: 0x0016,     #  SYNCHRONOUS IDLE
    0x0017: 0x0017,     #  END OF TRANSMISSION BLOCK
    0x0018: 0x0018,     #  CANCEL
    0x0019: 0x0019,     #  END OF MEDIUM
    0x001a: 0x001a,     #  SUBSTITUTE
    0x001b: 0x001b,     #  ESCAPE
    0x001c: 0x001c,     #  FILE SEPARATOR
    0x001d: 0x001d,     #  GROUP SEPARATOR
    0x001e: 0x001e,     #  RECORD SEPARATOR
    0x001f: 0x001f,     #  UNIT SEPARATOR
    0x0020: 0x0020,     #  SPACE
    0x0021: 0x0021,     #  EXCLAMATION MARK
    0x0022: 0x0022,     #  QUOTATION MARK
    0x0023: 0x0023,     #  NUMBER SIGN
    0x0024: 0x0024,     #  DOLLAR SIGN
    0x0025: 0x0025,     #  PERCENT SIGN
    0x0026: 0x0026,     #  AMPERSAND
    0x0027: 0x0027,     #  APOSTROPHE
    0x0028: 0x0028,     #  LEFT PARENTHESIS
    0x0029: 0x0029,     #  RIGHT PARENTHESIS
    0x002a: 0x002a,     #  ASTERISK
    0x002b: 0x002b,     #  PLUS SIGN
    0x002c: 0x002c,     #  COMMA
    0x002d: 0x002d,     #  HYPHEN-MINUS
    0x002e: 0x002e,     #  FULL STOP
    0x002f: 0x002f,     #  SOLIDUS
    0x0030: 0x0030,     #  DIGIT ZERO
    0x0031: 0x0031,     #  DIGIT ONE
    0x0032: 0x0032,     #  DIGIT TWO
    0x0033: 0x0033,     #  DIGIT THREE
    0x0034: 0x0034,     #  DIGIT FOUR
    0x0035: 0x0035,     #  DIGIT FIVE
    0x0036: 0x0036,     #  DIGIT SIX
    0x0037: 0x0037,     #  DIGIT SEVEN
    0x0038: 0x0038,     #  DIGIT EIGHT
    0x0039: 0x0039,     #  DIGIT NINE
    0x003a: 0x003a,     #  COLON
    0x003b: 0x003b,     #  SEMICOLON
    0x003c: 0x003c,     #  LESS-THAN SIGN
    0x003d: 0x003d,     #  EQUALS SIGN
    0x003e: 0x003e,     #  GREATER-THAN SIGN
    0x003f: 0x003f,     #  QUESTION MARK
    0x0040: 0x0040,     #  COMMERCIAL AT
    0x0041: 0x0041,     #  LATIN CAPITAL LETTER A
    0x0042: 0x0042,     #  LATIN CAPITAL LETTER B
    0x0043: 0x0043,     #  LATIN CAPITAL LETTER C
    0x0044: 0x0044,     #  LATIN CAPITAL LETTER D
    0x0045: 0x0045,     #  LATIN CAPITAL LETTER E
    0x0046: 0x0046,     #  LATIN CAPITAL LETTER F
    0x0047: 0x0047,     #  LATIN CAPITAL LETTER G
    0x0048: 0x0048,     #  LATIN CAPITAL LETTER H
    0x0049: 0x0049,     #  LATIN CAPITAL LETTER I
    0x004a: 0x004a,     #  LATIN CAPITAL LETTER J
    0x004b: 0x004b,     #  LATIN CAPITAL LETTER K
    0x004c: 0x004c,     #  LATIN CAPITAL LETTER L
    0x004d: 0x004d,     #  LATIN CAPITAL LETTER M
    0x004e: 0x004e,     #  LATIN CAPITAL LETTER N
    0x004f: 0x004f,     #  LATIN CAPITAL LETTER O
    0x0050: 0x0050,     #  LATIN CAPITAL LETTER P
    0x0051: 0x0051,     #  LATIN CAPITAL LETTER Q
    0x0052: 0x0052,     #  LATIN CAPITAL LETTER R
    0x0053: 0x0053,     #  LATIN CAPITAL LETTER S
    0x0054: 0x0054,     #  LATIN CAPITAL LETTER T
    0x0055: 0x0055,     #  LATIN CAPITAL LETTER U
    0x0056: 0x0056,     #  LATIN CAPITAL LETTER V
    0x0057: 0x0057,     #  LATIN CAPITAL LETTER W
    0x0058: 0x0058,     #  LATIN CAPITAL LETTER X
    0x0059: 0x0059,     #  LATIN CAPITAL LETTER Y
    0x005a: 0x005a,     #  LATIN CAPITAL LETTER Z
    0x005b: 0x005b,     #  LEFT SQUARE BRACKET
    0x005c: 0x005c,     #  REVERSE SOLIDUS
    0x005d: 0x005d,     #  RIGHT SQUARE BRACKET
    0x005e: 0x005e,     #  CIRCUMFLEX ACCENT
    0x005f: 0x005f,     #  LOW LINE
    0x0060: 0x0060,     #  GRAVE ACCENT
    0x0061: 0x0061,     #  LATIN SMALL LETTER A
    0x0062: 0x0062,     #  LATIN SMALL LETTER B
    0x0063: 0x0063,     #  LATIN SMALL LETTER C
    0x0064: 0x0064,     #  LATIN SMALL LETTER D
    0x0065: 0x0065,     #  LATIN SMALL LETTER E
    0x0066: 0x0066,     #  LATIN SMALL LETTER F
    0x0067: 0x0067,     #  LATIN SMALL LETTER G
    0x0068: 0x0068,     #  LATIN SMALL LETTER H
    0x0069: 0x0069,     #  LATIN SMALL LETTER I
    0x006a: 0x006a,     #  LATIN SMALL LETTER J
    0x006b: 0x006b,     #  LATIN SMALL LETTER K
    0x006c: 0x006c,     #  LATIN SMALL LETTER L
    0x006d: 0x006d,     #  LATIN SMALL LETTER M
    0x006e: 0x006e,     #  LATIN SMALL LETTER N
    0x006f: 0x006f,     #  LATIN SMALL LETTER O
    0x0070: 0x0070,     #  LATIN SMALL LETTER P
    0x0071: 0x0071,     #  LATIN SMALL LETTER Q
    0x0072: 0x0072,     #  LATIN SMALL LETTER R
    0x0073: 0x0073,     #  LATIN SMALL LETTER S
    0x0074: 0x0074,     #  LATIN SMALL LETTER T
    0x0075: 0x0075,     #  LATIN SMALL LETTER U
    0x0076: 0x0076,     #  LATIN SMALL LETTER V
    0x0077: 0x0077,     #  LATIN SMALL LETTER W
    0x0078: 0x0078,     #  LATIN SMALL LETTER X
    0x0079: 0x0079,     #  LATIN SMALL LETTER Y
    0x007a: 0x007a,     #  LATIN SMALL LETTER Z
    0x007b: 0x007b,     #  LEFT CURLY BRACKET
    0x007c: 0x007c,     #  VERTICAL LINE
    0x007d: 0x007d,     #  RIGHT CURLY BRACKET
    0x007e: 0x007e,     #  TILDE
    0x007f: 0x007f,     #  DELETE
    0x00a0: 0x00ff,     #  NO-BREAK SPACE
    0x00a3: 0x009c,     #  POUND SIGN
    0x00a6: 0x008a,     #  BROKEN BAR
    0x00a7: 0x00f5,     #  SECTION SIGN
    0x00a8: 0x00f9,     #  DIAERESIS
    0x00a9: 0x0097,     #  COPYRIGHT SIGN
    0x00ab: 0x00ae,     #  LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00ac: 0x0089,     #  NOT SIGN
    0x00ad: 0x00f0,     #  SOFT HYPHEN
    0x00b0: 0x00f8,     #  DEGREE SIGN
    0x00b1: 0x00f1,     #  PLUS-MINUS SIGN
    0x00b2: 0x0099,     #  SUPERSCRIPT TWO
    0x00b3: 0x009a,     #  SUPERSCRIPT THREE
    0x00b7: 0x0088,     #  MIDDLE DOT
    0x00bb: 0x00af,     #  RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00bd: 0x00ab,     #  VULGAR FRACTION ONE HALF
    0x0384: 0x00ef,     #  GREEK TONOS
    0x0385: 0x00f7,     #  GREEK DIALYTIKA TONOS
    0x0386: 0x0086,     #  GREEK CAPITAL LETTER ALPHA WITH TONOS
    0x0388: 0x008d,     #  GREEK CAPITAL LETTER EPSILON WITH TONOS
    0x0389: 0x008f,     #  GREEK CAPITAL LETTER ETA WITH TONOS
    0x038a: 0x0090,     #  GREEK CAPITAL LETTER IOTA WITH TONOS
    0x038c: 0x0092,     #  GREEK CAPITAL LETTER OMICRON WITH TONOS
    0x038e: 0x0095,     #  GREEK CAPITAL LETTER UPSILON WITH TONOS
    0x038f: 0x0098,     #  GREEK CAPITAL LETTER OMEGA WITH TONOS
    0x0390: 0x00a1,     #  GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS
    0x0391: 0x00a4,     #  GREEK CAPITAL LETTER ALPHA
    0x0392: 0x00a5,     #  GREEK CAPITAL LETTER BETA
    0x0393: 0x00a6,     #  GREEK CAPITAL LETTER GAMMA
    0x0394: 0x00a7,     #  GREEK CAPITAL LETTER DELTA
    0x0395: 0x00a8,     #  GREEK CAPITAL LETTER EPSILON
    0x0396: 0x00a9,     #  GREEK CAPITAL LETTER ZETA
    0x0397: 0x00aa,     #  GREEK CAPITAL LETTER ETA
    0x0398: 0x00ac,     #  GREEK CAPITAL LETTER THETA
    0x0399: 0x00ad,     #  GREEK CAPITAL LETTER IOTA
    0x039a: 0x00b5,     #  GREEK CAPITAL LETTER KAPPA
    0x039b: 0x00b6,     #  GREEK CAPITAL LETTER LAMDA
    0x039c: 0x00b7,     #  GREEK CAPITAL LETTER MU
    0x039d: 0x00b8,     #  GREEK CAPITAL LETTER NU
    0x039e: 0x00bd,     #  GREEK CAPITAL LETTER XI
    0x039f: 0x00be,     #  GREEK CAPITAL LETTER OMICRON
    0x03a0: 0x00c6,     #  GREEK CAPITAL LETTER PI
    0x03a1: 0x00c7,     #  GREEK CAPITAL LETTER RHO
    0x03a3: 0x00cf,     #  GREEK CAPITAL LETTER SIGMA
    0x03a4: 0x00d0,     #  GREEK CAPITAL LETTER TAU
    0x03a5: 0x00d1,     #  GREEK CAPITAL LETTER UPSILON
    0x03a6: 0x00d2,     #  GREEK CAPITAL LETTER PHI
    0x03a7: 0x00d3,     #  GREEK CAPITAL LETTER CHI
    0x03a8: 0x00d4,     #  GREEK CAPITAL LETTER PSI
    0x03a9: 0x00d5,     #  GREEK CAPITAL LETTER OMEGA
    0x03aa: 0x0091,     #  GREEK CAPITAL LETTER IOTA WITH DIALYTIKA
    0x03ab: 0x0096,     #  GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA
    0x03ac: 0x009b,     #  GREEK SMALL LETTER ALPHA WITH TONOS
    0x03ad: 0x009d,     #  GREEK SMALL LETTER EPSILON WITH TONOS
    0x03ae: 0x009e,     #  GREEK SMALL LETTER ETA WITH TONOS
    0x03af: 0x009f,     #  GREEK SMALL LETTER IOTA WITH TONOS
    0x03b0: 0x00fc,     #  GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
    0x03b1: 0x00d6,     #  GREEK SMALL LETTER ALPHA
    0x03b2: 0x00d7,     #  GREEK SMALL LETTER BETA
    0x03b3: 0x00d8,     #  GREEK SMALL LETTER GAMMA
    0x03b4: 0x00dd,     #  GREEK SMALL LETTER DELTA
    0x03b5: 0x00de,     #  GREEK SMALL LETTER EPSILON
    0x03b6: 0x00e0,     #  GREEK SMALL LETTER ZETA
    0x03b7: 0x00e1,     #  GREEK SMALL LETTER ETA
    0x03b8: 0x00e2,     #  GREEK SMALL LETTER THETA
    0x03b9: 0x00e3,     #  GREEK SMALL LETTER IOTA
    0x03ba: 0x00e4,     #  GREEK SMALL LETTER KAPPA
    0x03bb: 0x00e5,     #  GREEK SMALL LETTER LAMDA
    0x03bc: 0x00e6,     #  GREEK SMALL LETTER MU
    0x03bd: 0x00e7,     #  GREEK SMALL LETTER NU
    0x03be: 0x00e8,     #  GREEK SMALL LETTER XI
    0x03bf: 0x00e9,     #  GREEK SMALL LETTER OMICRON
    0x03c0: 0x00ea,     #  GREEK SMALL LETTER PI
    0x03c1: 0x00eb,     #  GREEK SMALL LETTER RHO
    0x03c2: 0x00ed,     #  GREEK SMALL LETTER FINAL SIGMA
    0x03c3: 0x00ec,     #  GREEK SMALL LETTER SIGMA
    0x03c4: 0x00ee,     #  GREEK SMALL LETTER TAU
    0x03c5: 0x00f2,     #  GREEK SMALL LETTER UPSILON
    0x03c6: 0x00f3,     #  GREEK SMALL LETTER PHI
    0x03c7: 0x00f4,     #  GREEK SMALL LETTER CHI
    0x03c8: 0x00f6,     #  GREEK SMALL LETTER PSI
    0x03c9: 0x00fa,     #  GREEK SMALL LETTER OMEGA
    0x03ca: 0x00a0,     #  GREEK SMALL LETTER IOTA WITH DIALYTIKA
    0x03cb: 0x00fb,     #  GREEK SMALL LETTER UPSILON WITH DIALYTIKA
    0x03cc: 0x00a2,     #  GREEK SMALL LETTER OMICRON WITH TONOS
    0x03cd: 0x00a3,     #  GREEK SMALL LETTER UPSILON WITH TONOS
    0x03ce: 0x00fd,     #  GREEK SMALL LETTER OMEGA WITH TONOS
    0x2015: 0x008e,     #  HORIZONTAL BAR
    0x2018: 0x008b,     #  LEFT SINGLE QUOTATION MARK
    0x2019: 0x008c,     #  RIGHT SINGLE QUOTATION MARK
    0x2500: 0x00c4,     #  BOX DRAWINGS LIGHT HORIZONTAL
    0x2502: 0x00b3,     #  BOX DRAWINGS LIGHT VERTICAL
    0x250c: 0x00da,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
    0x2510: 0x00bf,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
    0x2514: 0x00c0,     #  BOX DRAWINGS LIGHT UP AND RIGHT
    0x2518: 0x00d9,     #  BOX DRAWINGS LIGHT UP AND LEFT
    0x251c: 0x00c3,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    0x2524: 0x00b4,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
    0x252c: 0x00c2,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    0x2534: 0x00c1,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
    0x253c: 0x00c5,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    0x2550: 0x00cd,     #  BOX DRAWINGS DOUBLE HORIZONTAL
    0x2551: 0x00ba,     #  BOX DRAWINGS DOUBLE VERTICAL
    0x2554: 0x00c9,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
    0x2557: 0x00bb,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
    0x255a: 0x00c8,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
    0x255d: 0x00bc,     #  BOX DRAWINGS DOUBLE UP AND LEFT
    0x2560: 0x00cc,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    0x2563: 0x00b9,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    0x2566: 0x00cb,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    0x2569: 0x00ca,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    0x256c: 0x00ce,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    0x2580: 0x00df,     #  UPPER HALF BLOCK
    0x2584: 0x00dc,     #  LOWER HALF BLOCK
    0x2588: 0x00db,     #  FULL BLOCK
    0x2591: 0x00b0,     #  LIGHT SHADE
    0x2592: 0x00b1,     #  MEDIUM SHADE
    0x2593: 0x00b2,     #  DARK SHADE
    0x25a0: 0x00fe,     #  BLACK SQUARE
}
encodings/unicode_escape.py000064400000002240151153537620012043 0ustar00""" Python 'unicode-escape' Codec


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

"""
import codecs

### Codec APIs

class Codec(codecs.Codec):

    # Note: Binding these as C functions will result in the class not
    # converting them to methods. This is intended.
    encode = codecs.unicode_escape_encode
    decode = codecs.unicode_escape_decode

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.unicode_escape_encode(input, self.errors)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.unicode_escape_decode(input, self.errors)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='unicode-escape',
        encode=Codec.encode,
        decode=Codec.decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamwriter=StreamWriter,
        streamreader=StreamReader,
    )
encodings/gb2312.py000064400000002003151153537620007772 0ustar00#
# gb2312.py: Python Unicode Codec for GB2312
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#

import _codecs_cn, codecs
import _multibytecodec as mbc

codec = _codecs_cn.getcodec('gb2312')

class Codec(codecs.Codec):
    encode = codec.encode
    decode = codec.decode

class IncrementalEncoder(mbc.MultibyteIncrementalEncoder,
                         codecs.IncrementalEncoder):
    codec = codec

class IncrementalDecoder(mbc.MultibyteIncrementalDecoder,
                         codecs.IncrementalDecoder):
    codec = codec

class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader):
    codec = codec

class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
    codec = codec

def getregentry():
    return codecs.CodecInfo(
        name='gb2312',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/cp500.py000064400000031501151153537620007726 0ustar00""" Python Character Mapping Codec cp500 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP500.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp500',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x9c'     #  0x04 -> CONTROL
    '\t'       #  0x05 -> HORIZONTAL TABULATION
    '\x86'     #  0x06 -> CONTROL
    '\x7f'     #  0x07 -> DELETE
    '\x97'     #  0x08 -> CONTROL
    '\x8d'     #  0x09 -> CONTROL
    '\x8e'     #  0x0A -> CONTROL
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x9d'     #  0x14 -> CONTROL
    '\x85'     #  0x15 -> CONTROL
    '\x08'     #  0x16 -> BACKSPACE
    '\x87'     #  0x17 -> CONTROL
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x92'     #  0x1A -> CONTROL
    '\x8f'     #  0x1B -> CONTROL
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    '\x80'     #  0x20 -> CONTROL
    '\x81'     #  0x21 -> CONTROL
    '\x82'     #  0x22 -> CONTROL
    '\x83'     #  0x23 -> CONTROL
    '\x84'     #  0x24 -> CONTROL
    '\n'       #  0x25 -> LINE FEED
    '\x17'     #  0x26 -> END OF TRANSMISSION BLOCK
    '\x1b'     #  0x27 -> ESCAPE
    '\x88'     #  0x28 -> CONTROL
    '\x89'     #  0x29 -> CONTROL
    '\x8a'     #  0x2A -> CONTROL
    '\x8b'     #  0x2B -> CONTROL
    '\x8c'     #  0x2C -> CONTROL
    '\x05'     #  0x2D -> ENQUIRY
    '\x06'     #  0x2E -> ACKNOWLEDGE
    '\x07'     #  0x2F -> BELL
    '\x90'     #  0x30 -> CONTROL
    '\x91'     #  0x31 -> CONTROL
    '\x16'     #  0x32 -> SYNCHRONOUS IDLE
    '\x93'     #  0x33 -> CONTROL
    '\x94'     #  0x34 -> CONTROL
    '\x95'     #  0x35 -> CONTROL
    '\x96'     #  0x36 -> CONTROL
    '\x04'     #  0x37 -> END OF TRANSMISSION
    '\x98'     #  0x38 -> CONTROL
    '\x99'     #  0x39 -> CONTROL
    '\x9a'     #  0x3A -> CONTROL
    '\x9b'     #  0x3B -> CONTROL
    '\x14'     #  0x3C -> DEVICE CONTROL FOUR
    '\x15'     #  0x3D -> NEGATIVE ACKNOWLEDGE
    '\x9e'     #  0x3E -> CONTROL
    '\x1a'     #  0x3F -> SUBSTITUTE
    ' '        #  0x40 -> SPACE
    '\xa0'     #  0x41 -> NO-BREAK SPACE
    '\xe2'     #  0x42 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\xe4'     #  0x43 -> LATIN SMALL LETTER A WITH DIAERESIS
    '\xe0'     #  0x44 -> LATIN SMALL LETTER A WITH GRAVE
    '\xe1'     #  0x45 -> LATIN SMALL LETTER A WITH ACUTE
    '\xe3'     #  0x46 -> LATIN SMALL LETTER A WITH TILDE
    '\xe5'     #  0x47 -> LATIN SMALL LETTER A WITH RING ABOVE
    '\xe7'     #  0x48 -> LATIN SMALL LETTER C WITH CEDILLA
    '\xf1'     #  0x49 -> LATIN SMALL LETTER N WITH TILDE
    '['        #  0x4A -> LEFT SQUARE BRACKET
    '.'        #  0x4B -> FULL STOP
    '<'        #  0x4C -> LESS-THAN SIGN
    '('        #  0x4D -> LEFT PARENTHESIS
    '+'        #  0x4E -> PLUS SIGN
    '!'        #  0x4F -> EXCLAMATION MARK
    '&'        #  0x50 -> AMPERSAND
    '\xe9'     #  0x51 -> LATIN SMALL LETTER E WITH ACUTE
    '\xea'     #  0x52 -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xeb'     #  0x53 -> LATIN SMALL LETTER E WITH DIAERESIS
    '\xe8'     #  0x54 -> LATIN SMALL LETTER E WITH GRAVE
    '\xed'     #  0x55 -> LATIN SMALL LETTER I WITH ACUTE
    '\xee'     #  0x56 -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\xef'     #  0x57 -> LATIN SMALL LETTER I WITH DIAERESIS
    '\xec'     #  0x58 -> LATIN SMALL LETTER I WITH GRAVE
    '\xdf'     #  0x59 -> LATIN SMALL LETTER SHARP S (GERMAN)
    ']'        #  0x5A -> RIGHT SQUARE BRACKET
    '$'        #  0x5B -> DOLLAR SIGN
    '*'        #  0x5C -> ASTERISK
    ')'        #  0x5D -> RIGHT PARENTHESIS
    ';'        #  0x5E -> SEMICOLON
    '^'        #  0x5F -> CIRCUMFLEX ACCENT
    '-'        #  0x60 -> HYPHEN-MINUS
    '/'        #  0x61 -> SOLIDUS
    '\xc2'     #  0x62 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    '\xc4'     #  0x63 -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\xc0'     #  0x64 -> LATIN CAPITAL LETTER A WITH GRAVE
    '\xc1'     #  0x65 -> LATIN CAPITAL LETTER A WITH ACUTE
    '\xc3'     #  0x66 -> LATIN CAPITAL LETTER A WITH TILDE
    '\xc5'     #  0x67 -> LATIN CAPITAL LETTER A WITH RING ABOVE
    '\xc7'     #  0x68 -> LATIN CAPITAL LETTER C WITH CEDILLA
    '\xd1'     #  0x69 -> LATIN CAPITAL LETTER N WITH TILDE
    '\xa6'     #  0x6A -> BROKEN BAR
    ','        #  0x6B -> COMMA
    '%'        #  0x6C -> PERCENT SIGN
    '_'        #  0x6D -> LOW LINE
    '>'        #  0x6E -> GREATER-THAN SIGN
    '?'        #  0x6F -> QUESTION MARK
    '\xf8'     #  0x70 -> LATIN SMALL LETTER O WITH STROKE
    '\xc9'     #  0x71 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\xca'     #  0x72 -> LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    '\xcb'     #  0x73 -> LATIN CAPITAL LETTER E WITH DIAERESIS
    '\xc8'     #  0x74 -> LATIN CAPITAL LETTER E WITH GRAVE
    '\xcd'     #  0x75 -> LATIN CAPITAL LETTER I WITH ACUTE
    '\xce'     #  0x76 -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    '\xcf'     #  0x77 -> LATIN CAPITAL LETTER I WITH DIAERESIS
    '\xcc'     #  0x78 -> LATIN CAPITAL LETTER I WITH GRAVE
    '`'        #  0x79 -> GRAVE ACCENT
    ':'        #  0x7A -> COLON
    '#'        #  0x7B -> NUMBER SIGN
    '@'        #  0x7C -> COMMERCIAL AT
    "'"        #  0x7D -> APOSTROPHE
    '='        #  0x7E -> EQUALS SIGN
    '"'        #  0x7F -> QUOTATION MARK
    '\xd8'     #  0x80 -> LATIN CAPITAL LETTER O WITH STROKE
    'a'        #  0x81 -> LATIN SMALL LETTER A
    'b'        #  0x82 -> LATIN SMALL LETTER B
    'c'        #  0x83 -> LATIN SMALL LETTER C
    'd'        #  0x84 -> LATIN SMALL LETTER D
    'e'        #  0x85 -> LATIN SMALL LETTER E
    'f'        #  0x86 -> LATIN SMALL LETTER F
    'g'        #  0x87 -> LATIN SMALL LETTER G
    'h'        #  0x88 -> LATIN SMALL LETTER H
    'i'        #  0x89 -> LATIN SMALL LETTER I
    '\xab'     #  0x8A -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbb'     #  0x8B -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xf0'     #  0x8C -> LATIN SMALL LETTER ETH (ICELANDIC)
    '\xfd'     #  0x8D -> LATIN SMALL LETTER Y WITH ACUTE
    '\xfe'     #  0x8E -> LATIN SMALL LETTER THORN (ICELANDIC)
    '\xb1'     #  0x8F -> PLUS-MINUS SIGN
    '\xb0'     #  0x90 -> DEGREE SIGN
    'j'        #  0x91 -> LATIN SMALL LETTER J
    'k'        #  0x92 -> LATIN SMALL LETTER K
    'l'        #  0x93 -> LATIN SMALL LETTER L
    'm'        #  0x94 -> LATIN SMALL LETTER M
    'n'        #  0x95 -> LATIN SMALL LETTER N
    'o'        #  0x96 -> LATIN SMALL LETTER O
    'p'        #  0x97 -> LATIN SMALL LETTER P
    'q'        #  0x98 -> LATIN SMALL LETTER Q
    'r'        #  0x99 -> LATIN SMALL LETTER R
    '\xaa'     #  0x9A -> FEMININE ORDINAL INDICATOR
    '\xba'     #  0x9B -> MASCULINE ORDINAL INDICATOR
    '\xe6'     #  0x9C -> LATIN SMALL LIGATURE AE
    '\xb8'     #  0x9D -> CEDILLA
    '\xc6'     #  0x9E -> LATIN CAPITAL LIGATURE AE
    '\xa4'     #  0x9F -> CURRENCY SIGN
    '\xb5'     #  0xA0 -> MICRO SIGN
    '~'        #  0xA1 -> TILDE
    's'        #  0xA2 -> LATIN SMALL LETTER S
    't'        #  0xA3 -> LATIN SMALL LETTER T
    'u'        #  0xA4 -> LATIN SMALL LETTER U
    'v'        #  0xA5 -> LATIN SMALL LETTER V
    'w'        #  0xA6 -> LATIN SMALL LETTER W
    'x'        #  0xA7 -> LATIN SMALL LETTER X
    'y'        #  0xA8 -> LATIN SMALL LETTER Y
    'z'        #  0xA9 -> LATIN SMALL LETTER Z
    '\xa1'     #  0xAA -> INVERTED EXCLAMATION MARK
    '\xbf'     #  0xAB -> INVERTED QUESTION MARK
    '\xd0'     #  0xAC -> LATIN CAPITAL LETTER ETH (ICELANDIC)
    '\xdd'     #  0xAD -> LATIN CAPITAL LETTER Y WITH ACUTE
    '\xde'     #  0xAE -> LATIN CAPITAL LETTER THORN (ICELANDIC)
    '\xae'     #  0xAF -> REGISTERED SIGN
    '\xa2'     #  0xB0 -> CENT SIGN
    '\xa3'     #  0xB1 -> POUND SIGN
    '\xa5'     #  0xB2 -> YEN SIGN
    '\xb7'     #  0xB3 -> MIDDLE DOT
    '\xa9'     #  0xB4 -> COPYRIGHT SIGN
    '\xa7'     #  0xB5 -> SECTION SIGN
    '\xb6'     #  0xB6 -> PILCROW SIGN
    '\xbc'     #  0xB7 -> VULGAR FRACTION ONE QUARTER
    '\xbd'     #  0xB8 -> VULGAR FRACTION ONE HALF
    '\xbe'     #  0xB9 -> VULGAR FRACTION THREE QUARTERS
    '\xac'     #  0xBA -> NOT SIGN
    '|'        #  0xBB -> VERTICAL LINE
    '\xaf'     #  0xBC -> MACRON
    '\xa8'     #  0xBD -> DIAERESIS
    '\xb4'     #  0xBE -> ACUTE ACCENT
    '\xd7'     #  0xBF -> MULTIPLICATION SIGN
    '{'        #  0xC0 -> LEFT CURLY BRACKET
    'A'        #  0xC1 -> LATIN CAPITAL LETTER A
    'B'        #  0xC2 -> LATIN CAPITAL LETTER B
    'C'        #  0xC3 -> LATIN CAPITAL LETTER C
    'D'        #  0xC4 -> LATIN CAPITAL LETTER D
    'E'        #  0xC5 -> LATIN CAPITAL LETTER E
    'F'        #  0xC6 -> LATIN CAPITAL LETTER F
    'G'        #  0xC7 -> LATIN CAPITAL LETTER G
    'H'        #  0xC8 -> LATIN CAPITAL LETTER H
    'I'        #  0xC9 -> LATIN CAPITAL LETTER I
    '\xad'     #  0xCA -> SOFT HYPHEN
    '\xf4'     #  0xCB -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xf6'     #  0xCC -> LATIN SMALL LETTER O WITH DIAERESIS
    '\xf2'     #  0xCD -> LATIN SMALL LETTER O WITH GRAVE
    '\xf3'     #  0xCE -> LATIN SMALL LETTER O WITH ACUTE
    '\xf5'     #  0xCF -> LATIN SMALL LETTER O WITH TILDE
    '}'        #  0xD0 -> RIGHT CURLY BRACKET
    'J'        #  0xD1 -> LATIN CAPITAL LETTER J
    'K'        #  0xD2 -> LATIN CAPITAL LETTER K
    'L'        #  0xD3 -> LATIN CAPITAL LETTER L
    'M'        #  0xD4 -> LATIN CAPITAL LETTER M
    'N'        #  0xD5 -> LATIN CAPITAL LETTER N
    'O'        #  0xD6 -> LATIN CAPITAL LETTER O
    'P'        #  0xD7 -> LATIN CAPITAL LETTER P
    'Q'        #  0xD8 -> LATIN CAPITAL LETTER Q
    'R'        #  0xD9 -> LATIN CAPITAL LETTER R
    '\xb9'     #  0xDA -> SUPERSCRIPT ONE
    '\xfb'     #  0xDB -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\xfc'     #  0xDC -> LATIN SMALL LETTER U WITH DIAERESIS
    '\xf9'     #  0xDD -> LATIN SMALL LETTER U WITH GRAVE
    '\xfa'     #  0xDE -> LATIN SMALL LETTER U WITH ACUTE
    '\xff'     #  0xDF -> LATIN SMALL LETTER Y WITH DIAERESIS
    '\\'       #  0xE0 -> REVERSE SOLIDUS
    '\xf7'     #  0xE1 -> DIVISION SIGN
    'S'        #  0xE2 -> LATIN CAPITAL LETTER S
    'T'        #  0xE3 -> LATIN CAPITAL LETTER T
    'U'        #  0xE4 -> LATIN CAPITAL LETTER U
    'V'        #  0xE5 -> LATIN CAPITAL LETTER V
    'W'        #  0xE6 -> LATIN CAPITAL LETTER W
    'X'        #  0xE7 -> LATIN CAPITAL LETTER X
    'Y'        #  0xE8 -> LATIN CAPITAL LETTER Y
    'Z'        #  0xE9 -> LATIN CAPITAL LETTER Z
    '\xb2'     #  0xEA -> SUPERSCRIPT TWO
    '\xd4'     #  0xEB -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    '\xd6'     #  0xEC -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xd2'     #  0xED -> LATIN CAPITAL LETTER O WITH GRAVE
    '\xd3'     #  0xEE -> LATIN CAPITAL LETTER O WITH ACUTE
    '\xd5'     #  0xEF -> LATIN CAPITAL LETTER O WITH TILDE
    '0'        #  0xF0 -> DIGIT ZERO
    '1'        #  0xF1 -> DIGIT ONE
    '2'        #  0xF2 -> DIGIT TWO
    '3'        #  0xF3 -> DIGIT THREE
    '4'        #  0xF4 -> DIGIT FOUR
    '5'        #  0xF5 -> DIGIT FIVE
    '6'        #  0xF6 -> DIGIT SIX
    '7'        #  0xF7 -> DIGIT SEVEN
    '8'        #  0xF8 -> DIGIT EIGHT
    '9'        #  0xF9 -> DIGIT NINE
    '\xb3'     #  0xFA -> SUPERSCRIPT THREE
    '\xdb'     #  0xFB -> LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    '\xdc'     #  0xFC -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\xd9'     #  0xFD -> LATIN CAPITAL LETTER U WITH GRAVE
    '\xda'     #  0xFE -> LATIN CAPITAL LETTER U WITH ACUTE
    '\x9f'     #  0xFF -> CONTROL
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/cp1252.py000064400000032307151153537620010020 0ustar00""" Python Character Mapping Codec cp1252 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1252.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp1252',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\u20ac'   #  0x80 -> EURO SIGN
    '\ufffe'   #  0x81 -> UNDEFINED
    '\u201a'   #  0x82 -> SINGLE LOW-9 QUOTATION MARK
    '\u0192'   #  0x83 -> LATIN SMALL LETTER F WITH HOOK
    '\u201e'   #  0x84 -> DOUBLE LOW-9 QUOTATION MARK
    '\u2026'   #  0x85 -> HORIZONTAL ELLIPSIS
    '\u2020'   #  0x86 -> DAGGER
    '\u2021'   #  0x87 -> DOUBLE DAGGER
    '\u02c6'   #  0x88 -> MODIFIER LETTER CIRCUMFLEX ACCENT
    '\u2030'   #  0x89 -> PER MILLE SIGN
    '\u0160'   #  0x8A -> LATIN CAPITAL LETTER S WITH CARON
    '\u2039'   #  0x8B -> SINGLE LEFT-POINTING ANGLE QUOTATION MARK
    '\u0152'   #  0x8C -> LATIN CAPITAL LIGATURE OE
    '\ufffe'   #  0x8D -> UNDEFINED
    '\u017d'   #  0x8E -> LATIN CAPITAL LETTER Z WITH CARON
    '\ufffe'   #  0x8F -> UNDEFINED
    '\ufffe'   #  0x90 -> UNDEFINED
    '\u2018'   #  0x91 -> LEFT SINGLE QUOTATION MARK
    '\u2019'   #  0x92 -> RIGHT SINGLE QUOTATION MARK
    '\u201c'   #  0x93 -> LEFT DOUBLE QUOTATION MARK
    '\u201d'   #  0x94 -> RIGHT DOUBLE QUOTATION MARK
    '\u2022'   #  0x95 -> BULLET
    '\u2013'   #  0x96 -> EN DASH
    '\u2014'   #  0x97 -> EM DASH
    '\u02dc'   #  0x98 -> SMALL TILDE
    '\u2122'   #  0x99 -> TRADE MARK SIGN
    '\u0161'   #  0x9A -> LATIN SMALL LETTER S WITH CARON
    '\u203a'   #  0x9B -> SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
    '\u0153'   #  0x9C -> LATIN SMALL LIGATURE OE
    '\ufffe'   #  0x9D -> UNDEFINED
    '\u017e'   #  0x9E -> LATIN SMALL LETTER Z WITH CARON
    '\u0178'   #  0x9F -> LATIN CAPITAL LETTER Y WITH DIAERESIS
    '\xa0'     #  0xA0 -> NO-BREAK SPACE
    '\xa1'     #  0xA1 -> INVERTED EXCLAMATION MARK
    '\xa2'     #  0xA2 -> CENT SIGN
    '\xa3'     #  0xA3 -> POUND SIGN
    '\xa4'     #  0xA4 -> CURRENCY SIGN
    '\xa5'     #  0xA5 -> YEN SIGN
    '\xa6'     #  0xA6 -> BROKEN BAR
    '\xa7'     #  0xA7 -> SECTION SIGN
    '\xa8'     #  0xA8 -> DIAERESIS
    '\xa9'     #  0xA9 -> COPYRIGHT SIGN
    '\xaa'     #  0xAA -> FEMININE ORDINAL INDICATOR
    '\xab'     #  0xAB -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xac'     #  0xAC -> NOT SIGN
    '\xad'     #  0xAD -> SOFT HYPHEN
    '\xae'     #  0xAE -> REGISTERED SIGN
    '\xaf'     #  0xAF -> MACRON
    '\xb0'     #  0xB0 -> DEGREE SIGN
    '\xb1'     #  0xB1 -> PLUS-MINUS SIGN
    '\xb2'     #  0xB2 -> SUPERSCRIPT TWO
    '\xb3'     #  0xB3 -> SUPERSCRIPT THREE
    '\xb4'     #  0xB4 -> ACUTE ACCENT
    '\xb5'     #  0xB5 -> MICRO SIGN
    '\xb6'     #  0xB6 -> PILCROW SIGN
    '\xb7'     #  0xB7 -> MIDDLE DOT
    '\xb8'     #  0xB8 -> CEDILLA
    '\xb9'     #  0xB9 -> SUPERSCRIPT ONE
    '\xba'     #  0xBA -> MASCULINE ORDINAL INDICATOR
    '\xbb'     #  0xBB -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbc'     #  0xBC -> VULGAR FRACTION ONE QUARTER
    '\xbd'     #  0xBD -> VULGAR FRACTION ONE HALF
    '\xbe'     #  0xBE -> VULGAR FRACTION THREE QUARTERS
    '\xbf'     #  0xBF -> INVERTED QUESTION MARK
    '\xc0'     #  0xC0 -> LATIN CAPITAL LETTER A WITH GRAVE
    '\xc1'     #  0xC1 -> LATIN CAPITAL LETTER A WITH ACUTE
    '\xc2'     #  0xC2 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    '\xc3'     #  0xC3 -> LATIN CAPITAL LETTER A WITH TILDE
    '\xc4'     #  0xC4 -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\xc5'     #  0xC5 -> LATIN CAPITAL LETTER A WITH RING ABOVE
    '\xc6'     #  0xC6 -> LATIN CAPITAL LETTER AE
    '\xc7'     #  0xC7 -> LATIN CAPITAL LETTER C WITH CEDILLA
    '\xc8'     #  0xC8 -> LATIN CAPITAL LETTER E WITH GRAVE
    '\xc9'     #  0xC9 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\xca'     #  0xCA -> LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    '\xcb'     #  0xCB -> LATIN CAPITAL LETTER E WITH DIAERESIS
    '\xcc'     #  0xCC -> LATIN CAPITAL LETTER I WITH GRAVE
    '\xcd'     #  0xCD -> LATIN CAPITAL LETTER I WITH ACUTE
    '\xce'     #  0xCE -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    '\xcf'     #  0xCF -> LATIN CAPITAL LETTER I WITH DIAERESIS
    '\xd0'     #  0xD0 -> LATIN CAPITAL LETTER ETH
    '\xd1'     #  0xD1 -> LATIN CAPITAL LETTER N WITH TILDE
    '\xd2'     #  0xD2 -> LATIN CAPITAL LETTER O WITH GRAVE
    '\xd3'     #  0xD3 -> LATIN CAPITAL LETTER O WITH ACUTE
    '\xd4'     #  0xD4 -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    '\xd5'     #  0xD5 -> LATIN CAPITAL LETTER O WITH TILDE
    '\xd6'     #  0xD6 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xd7'     #  0xD7 -> MULTIPLICATION SIGN
    '\xd8'     #  0xD8 -> LATIN CAPITAL LETTER O WITH STROKE
    '\xd9'     #  0xD9 -> LATIN CAPITAL LETTER U WITH GRAVE
    '\xda'     #  0xDA -> LATIN CAPITAL LETTER U WITH ACUTE
    '\xdb'     #  0xDB -> LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    '\xdc'     #  0xDC -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\xdd'     #  0xDD -> LATIN CAPITAL LETTER Y WITH ACUTE
    '\xde'     #  0xDE -> LATIN CAPITAL LETTER THORN
    '\xdf'     #  0xDF -> LATIN SMALL LETTER SHARP S
    '\xe0'     #  0xE0 -> LATIN SMALL LETTER A WITH GRAVE
    '\xe1'     #  0xE1 -> LATIN SMALL LETTER A WITH ACUTE
    '\xe2'     #  0xE2 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\xe3'     #  0xE3 -> LATIN SMALL LETTER A WITH TILDE
    '\xe4'     #  0xE4 -> LATIN SMALL LETTER A WITH DIAERESIS
    '\xe5'     #  0xE5 -> LATIN SMALL LETTER A WITH RING ABOVE
    '\xe6'     #  0xE6 -> LATIN SMALL LETTER AE
    '\xe7'     #  0xE7 -> LATIN SMALL LETTER C WITH CEDILLA
    '\xe8'     #  0xE8 -> LATIN SMALL LETTER E WITH GRAVE
    '\xe9'     #  0xE9 -> LATIN SMALL LETTER E WITH ACUTE
    '\xea'     #  0xEA -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xeb'     #  0xEB -> LATIN SMALL LETTER E WITH DIAERESIS
    '\xec'     #  0xEC -> LATIN SMALL LETTER I WITH GRAVE
    '\xed'     #  0xED -> LATIN SMALL LETTER I WITH ACUTE
    '\xee'     #  0xEE -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\xef'     #  0xEF -> LATIN SMALL LETTER I WITH DIAERESIS
    '\xf0'     #  0xF0 -> LATIN SMALL LETTER ETH
    '\xf1'     #  0xF1 -> LATIN SMALL LETTER N WITH TILDE
    '\xf2'     #  0xF2 -> LATIN SMALL LETTER O WITH GRAVE
    '\xf3'     #  0xF3 -> LATIN SMALL LETTER O WITH ACUTE
    '\xf4'     #  0xF4 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xf5'     #  0xF5 -> LATIN SMALL LETTER O WITH TILDE
    '\xf6'     #  0xF6 -> LATIN SMALL LETTER O WITH DIAERESIS
    '\xf7'     #  0xF7 -> DIVISION SIGN
    '\xf8'     #  0xF8 -> LATIN SMALL LETTER O WITH STROKE
    '\xf9'     #  0xF9 -> LATIN SMALL LETTER U WITH GRAVE
    '\xfa'     #  0xFA -> LATIN SMALL LETTER U WITH ACUTE
    '\xfb'     #  0xFB -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\xfc'     #  0xFC -> LATIN SMALL LETTER U WITH DIAERESIS
    '\xfd'     #  0xFD -> LATIN SMALL LETTER Y WITH ACUTE
    '\xfe'     #  0xFE -> LATIN SMALL LETTER THORN
    '\xff'     #  0xFF -> LATIN SMALL LETTER Y WITH DIAERESIS
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/koi8_r.py000064400000032723151153537620010301 0ustar00""" Python Character Mapping Codec koi8_r generated from 'MAPPINGS/VENDORS/MISC/KOI8-R.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='koi8-r',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\u2500'   #  0x80 -> BOX DRAWINGS LIGHT HORIZONTAL
    '\u2502'   #  0x81 -> BOX DRAWINGS LIGHT VERTICAL
    '\u250c'   #  0x82 -> BOX DRAWINGS LIGHT DOWN AND RIGHT
    '\u2510'   #  0x83 -> BOX DRAWINGS LIGHT DOWN AND LEFT
    '\u2514'   #  0x84 -> BOX DRAWINGS LIGHT UP AND RIGHT
    '\u2518'   #  0x85 -> BOX DRAWINGS LIGHT UP AND LEFT
    '\u251c'   #  0x86 -> BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    '\u2524'   #  0x87 -> BOX DRAWINGS LIGHT VERTICAL AND LEFT
    '\u252c'   #  0x88 -> BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    '\u2534'   #  0x89 -> BOX DRAWINGS LIGHT UP AND HORIZONTAL
    '\u253c'   #  0x8A -> BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    '\u2580'   #  0x8B -> UPPER HALF BLOCK
    '\u2584'   #  0x8C -> LOWER HALF BLOCK
    '\u2588'   #  0x8D -> FULL BLOCK
    '\u258c'   #  0x8E -> LEFT HALF BLOCK
    '\u2590'   #  0x8F -> RIGHT HALF BLOCK
    '\u2591'   #  0x90 -> LIGHT SHADE
    '\u2592'   #  0x91 -> MEDIUM SHADE
    '\u2593'   #  0x92 -> DARK SHADE
    '\u2320'   #  0x93 -> TOP HALF INTEGRAL
    '\u25a0'   #  0x94 -> BLACK SQUARE
    '\u2219'   #  0x95 -> BULLET OPERATOR
    '\u221a'   #  0x96 -> SQUARE ROOT
    '\u2248'   #  0x97 -> ALMOST EQUAL TO
    '\u2264'   #  0x98 -> LESS-THAN OR EQUAL TO
    '\u2265'   #  0x99 -> GREATER-THAN OR EQUAL TO
    '\xa0'     #  0x9A -> NO-BREAK SPACE
    '\u2321'   #  0x9B -> BOTTOM HALF INTEGRAL
    '\xb0'     #  0x9C -> DEGREE SIGN
    '\xb2'     #  0x9D -> SUPERSCRIPT TWO
    '\xb7'     #  0x9E -> MIDDLE DOT
    '\xf7'     #  0x9F -> DIVISION SIGN
    '\u2550'   #  0xA0 -> BOX DRAWINGS DOUBLE HORIZONTAL
    '\u2551'   #  0xA1 -> BOX DRAWINGS DOUBLE VERTICAL
    '\u2552'   #  0xA2 -> BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
    '\u0451'   #  0xA3 -> CYRILLIC SMALL LETTER IO
    '\u2553'   #  0xA4 -> BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
    '\u2554'   #  0xA5 -> BOX DRAWINGS DOUBLE DOWN AND RIGHT
    '\u2555'   #  0xA6 -> BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
    '\u2556'   #  0xA7 -> BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
    '\u2557'   #  0xA8 -> BOX DRAWINGS DOUBLE DOWN AND LEFT
    '\u2558'   #  0xA9 -> BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
    '\u2559'   #  0xAA -> BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
    '\u255a'   #  0xAB -> BOX DRAWINGS DOUBLE UP AND RIGHT
    '\u255b'   #  0xAC -> BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
    '\u255c'   #  0xAD -> BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
    '\u255d'   #  0xAE -> BOX DRAWINGS DOUBLE UP AND LEFT
    '\u255e'   #  0xAF -> BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
    '\u255f'   #  0xB0 -> BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
    '\u2560'   #  0xB1 -> BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    '\u2561'   #  0xB2 -> BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
    '\u0401'   #  0xB3 -> CYRILLIC CAPITAL LETTER IO
    '\u2562'   #  0xB4 -> BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
    '\u2563'   #  0xB5 -> BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    '\u2564'   #  0xB6 -> BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
    '\u2565'   #  0xB7 -> BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
    '\u2566'   #  0xB8 -> BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    '\u2567'   #  0xB9 -> BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
    '\u2568'   #  0xBA -> BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
    '\u2569'   #  0xBB -> BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    '\u256a'   #  0xBC -> BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
    '\u256b'   #  0xBD -> BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
    '\u256c'   #  0xBE -> BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    '\xa9'     #  0xBF -> COPYRIGHT SIGN
    '\u044e'   #  0xC0 -> CYRILLIC SMALL LETTER YU
    '\u0430'   #  0xC1 -> CYRILLIC SMALL LETTER A
    '\u0431'   #  0xC2 -> CYRILLIC SMALL LETTER BE
    '\u0446'   #  0xC3 -> CYRILLIC SMALL LETTER TSE
    '\u0434'   #  0xC4 -> CYRILLIC SMALL LETTER DE
    '\u0435'   #  0xC5 -> CYRILLIC SMALL LETTER IE
    '\u0444'   #  0xC6 -> CYRILLIC SMALL LETTER EF
    '\u0433'   #  0xC7 -> CYRILLIC SMALL LETTER GHE
    '\u0445'   #  0xC8 -> CYRILLIC SMALL LETTER HA
    '\u0438'   #  0xC9 -> CYRILLIC SMALL LETTER I
    '\u0439'   #  0xCA -> CYRILLIC SMALL LETTER SHORT I
    '\u043a'   #  0xCB -> CYRILLIC SMALL LETTER KA
    '\u043b'   #  0xCC -> CYRILLIC SMALL LETTER EL
    '\u043c'   #  0xCD -> CYRILLIC SMALL LETTER EM
    '\u043d'   #  0xCE -> CYRILLIC SMALL LETTER EN
    '\u043e'   #  0xCF -> CYRILLIC SMALL LETTER O
    '\u043f'   #  0xD0 -> CYRILLIC SMALL LETTER PE
    '\u044f'   #  0xD1 -> CYRILLIC SMALL LETTER YA
    '\u0440'   #  0xD2 -> CYRILLIC SMALL LETTER ER
    '\u0441'   #  0xD3 -> CYRILLIC SMALL LETTER ES
    '\u0442'   #  0xD4 -> CYRILLIC SMALL LETTER TE
    '\u0443'   #  0xD5 -> CYRILLIC SMALL LETTER U
    '\u0436'   #  0xD6 -> CYRILLIC SMALL LETTER ZHE
    '\u0432'   #  0xD7 -> CYRILLIC SMALL LETTER VE
    '\u044c'   #  0xD8 -> CYRILLIC SMALL LETTER SOFT SIGN
    '\u044b'   #  0xD9 -> CYRILLIC SMALL LETTER YERU
    '\u0437'   #  0xDA -> CYRILLIC SMALL LETTER ZE
    '\u0448'   #  0xDB -> CYRILLIC SMALL LETTER SHA
    '\u044d'   #  0xDC -> CYRILLIC SMALL LETTER E
    '\u0449'   #  0xDD -> CYRILLIC SMALL LETTER SHCHA
    '\u0447'   #  0xDE -> CYRILLIC SMALL LETTER CHE
    '\u044a'   #  0xDF -> CYRILLIC SMALL LETTER HARD SIGN
    '\u042e'   #  0xE0 -> CYRILLIC CAPITAL LETTER YU
    '\u0410'   #  0xE1 -> CYRILLIC CAPITAL LETTER A
    '\u0411'   #  0xE2 -> CYRILLIC CAPITAL LETTER BE
    '\u0426'   #  0xE3 -> CYRILLIC CAPITAL LETTER TSE
    '\u0414'   #  0xE4 -> CYRILLIC CAPITAL LETTER DE
    '\u0415'   #  0xE5 -> CYRILLIC CAPITAL LETTER IE
    '\u0424'   #  0xE6 -> CYRILLIC CAPITAL LETTER EF
    '\u0413'   #  0xE7 -> CYRILLIC CAPITAL LETTER GHE
    '\u0425'   #  0xE8 -> CYRILLIC CAPITAL LETTER HA
    '\u0418'   #  0xE9 -> CYRILLIC CAPITAL LETTER I
    '\u0419'   #  0xEA -> CYRILLIC CAPITAL LETTER SHORT I
    '\u041a'   #  0xEB -> CYRILLIC CAPITAL LETTER KA
    '\u041b'   #  0xEC -> CYRILLIC CAPITAL LETTER EL
    '\u041c'   #  0xED -> CYRILLIC CAPITAL LETTER EM
    '\u041d'   #  0xEE -> CYRILLIC CAPITAL LETTER EN
    '\u041e'   #  0xEF -> CYRILLIC CAPITAL LETTER O
    '\u041f'   #  0xF0 -> CYRILLIC CAPITAL LETTER PE
    '\u042f'   #  0xF1 -> CYRILLIC CAPITAL LETTER YA
    '\u0420'   #  0xF2 -> CYRILLIC CAPITAL LETTER ER
    '\u0421'   #  0xF3 -> CYRILLIC CAPITAL LETTER ES
    '\u0422'   #  0xF4 -> CYRILLIC CAPITAL LETTER TE
    '\u0423'   #  0xF5 -> CYRILLIC CAPITAL LETTER U
    '\u0416'   #  0xF6 -> CYRILLIC CAPITAL LETTER ZHE
    '\u0412'   #  0xF7 -> CYRILLIC CAPITAL LETTER VE
    '\u042c'   #  0xF8 -> CYRILLIC CAPITAL LETTER SOFT SIGN
    '\u042b'   #  0xF9 -> CYRILLIC CAPITAL LETTER YERU
    '\u0417'   #  0xFA -> CYRILLIC CAPITAL LETTER ZE
    '\u0428'   #  0xFB -> CYRILLIC CAPITAL LETTER SHA
    '\u042d'   #  0xFC -> CYRILLIC CAPITAL LETTER E
    '\u0429'   #  0xFD -> CYRILLIC CAPITAL LETTER SHCHA
    '\u0427'   #  0xFE -> CYRILLIC CAPITAL LETTER CHE
    '\u042a'   #  0xFF -> CYRILLIC CAPITAL LETTER HARD SIGN
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/cp862.py000064400000101132151153537620007737 0ustar00""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP862.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_map)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_map)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp862',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )

### Decoding Map

decoding_map = codecs.make_identity_dict(range(256))
decoding_map.update({
    0x0080: 0x05d0,     #  HEBREW LETTER ALEF
    0x0081: 0x05d1,     #  HEBREW LETTER BET
    0x0082: 0x05d2,     #  HEBREW LETTER GIMEL
    0x0083: 0x05d3,     #  HEBREW LETTER DALET
    0x0084: 0x05d4,     #  HEBREW LETTER HE
    0x0085: 0x05d5,     #  HEBREW LETTER VAV
    0x0086: 0x05d6,     #  HEBREW LETTER ZAYIN
    0x0087: 0x05d7,     #  HEBREW LETTER HET
    0x0088: 0x05d8,     #  HEBREW LETTER TET
    0x0089: 0x05d9,     #  HEBREW LETTER YOD
    0x008a: 0x05da,     #  HEBREW LETTER FINAL KAF
    0x008b: 0x05db,     #  HEBREW LETTER KAF
    0x008c: 0x05dc,     #  HEBREW LETTER LAMED
    0x008d: 0x05dd,     #  HEBREW LETTER FINAL MEM
    0x008e: 0x05de,     #  HEBREW LETTER MEM
    0x008f: 0x05df,     #  HEBREW LETTER FINAL NUN
    0x0090: 0x05e0,     #  HEBREW LETTER NUN
    0x0091: 0x05e1,     #  HEBREW LETTER SAMEKH
    0x0092: 0x05e2,     #  HEBREW LETTER AYIN
    0x0093: 0x05e3,     #  HEBREW LETTER FINAL PE
    0x0094: 0x05e4,     #  HEBREW LETTER PE
    0x0095: 0x05e5,     #  HEBREW LETTER FINAL TSADI
    0x0096: 0x05e6,     #  HEBREW LETTER TSADI
    0x0097: 0x05e7,     #  HEBREW LETTER QOF
    0x0098: 0x05e8,     #  HEBREW LETTER RESH
    0x0099: 0x05e9,     #  HEBREW LETTER SHIN
    0x009a: 0x05ea,     #  HEBREW LETTER TAV
    0x009b: 0x00a2,     #  CENT SIGN
    0x009c: 0x00a3,     #  POUND SIGN
    0x009d: 0x00a5,     #  YEN SIGN
    0x009e: 0x20a7,     #  PESETA SIGN
    0x009f: 0x0192,     #  LATIN SMALL LETTER F WITH HOOK
    0x00a0: 0x00e1,     #  LATIN SMALL LETTER A WITH ACUTE
    0x00a1: 0x00ed,     #  LATIN SMALL LETTER I WITH ACUTE
    0x00a2: 0x00f3,     #  LATIN SMALL LETTER O WITH ACUTE
    0x00a3: 0x00fa,     #  LATIN SMALL LETTER U WITH ACUTE
    0x00a4: 0x00f1,     #  LATIN SMALL LETTER N WITH TILDE
    0x00a5: 0x00d1,     #  LATIN CAPITAL LETTER N WITH TILDE
    0x00a6: 0x00aa,     #  FEMININE ORDINAL INDICATOR
    0x00a7: 0x00ba,     #  MASCULINE ORDINAL INDICATOR
    0x00a8: 0x00bf,     #  INVERTED QUESTION MARK
    0x00a9: 0x2310,     #  REVERSED NOT SIGN
    0x00aa: 0x00ac,     #  NOT SIGN
    0x00ab: 0x00bd,     #  VULGAR FRACTION ONE HALF
    0x00ac: 0x00bc,     #  VULGAR FRACTION ONE QUARTER
    0x00ad: 0x00a1,     #  INVERTED EXCLAMATION MARK
    0x00ae: 0x00ab,     #  LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00af: 0x00bb,     #  RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00b0: 0x2591,     #  LIGHT SHADE
    0x00b1: 0x2592,     #  MEDIUM SHADE
    0x00b2: 0x2593,     #  DARK SHADE
    0x00b3: 0x2502,     #  BOX DRAWINGS LIGHT VERTICAL
    0x00b4: 0x2524,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
    0x00b5: 0x2561,     #  BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
    0x00b6: 0x2562,     #  BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
    0x00b7: 0x2556,     #  BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
    0x00b8: 0x2555,     #  BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
    0x00b9: 0x2563,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    0x00ba: 0x2551,     #  BOX DRAWINGS DOUBLE VERTICAL
    0x00bb: 0x2557,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
    0x00bc: 0x255d,     #  BOX DRAWINGS DOUBLE UP AND LEFT
    0x00bd: 0x255c,     #  BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
    0x00be: 0x255b,     #  BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
    0x00bf: 0x2510,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
    0x00c0: 0x2514,     #  BOX DRAWINGS LIGHT UP AND RIGHT
    0x00c1: 0x2534,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
    0x00c2: 0x252c,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    0x00c3: 0x251c,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    0x00c4: 0x2500,     #  BOX DRAWINGS LIGHT HORIZONTAL
    0x00c5: 0x253c,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    0x00c6: 0x255e,     #  BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
    0x00c7: 0x255f,     #  BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
    0x00c8: 0x255a,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
    0x00c9: 0x2554,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
    0x00ca: 0x2569,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    0x00cb: 0x2566,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    0x00cc: 0x2560,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    0x00cd: 0x2550,     #  BOX DRAWINGS DOUBLE HORIZONTAL
    0x00ce: 0x256c,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    0x00cf: 0x2567,     #  BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
    0x00d0: 0x2568,     #  BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
    0x00d1: 0x2564,     #  BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
    0x00d2: 0x2565,     #  BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
    0x00d3: 0x2559,     #  BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
    0x00d4: 0x2558,     #  BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
    0x00d5: 0x2552,     #  BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
    0x00d6: 0x2553,     #  BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
    0x00d7: 0x256b,     #  BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
    0x00d8: 0x256a,     #  BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
    0x00d9: 0x2518,     #  BOX DRAWINGS LIGHT UP AND LEFT
    0x00da: 0x250c,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
    0x00db: 0x2588,     #  FULL BLOCK
    0x00dc: 0x2584,     #  LOWER HALF BLOCK
    0x00dd: 0x258c,     #  LEFT HALF BLOCK
    0x00de: 0x2590,     #  RIGHT HALF BLOCK
    0x00df: 0x2580,     #  UPPER HALF BLOCK
    0x00e0: 0x03b1,     #  GREEK SMALL LETTER ALPHA
    0x00e1: 0x00df,     #  LATIN SMALL LETTER SHARP S (GERMAN)
    0x00e2: 0x0393,     #  GREEK CAPITAL LETTER GAMMA
    0x00e3: 0x03c0,     #  GREEK SMALL LETTER PI
    0x00e4: 0x03a3,     #  GREEK CAPITAL LETTER SIGMA
    0x00e5: 0x03c3,     #  GREEK SMALL LETTER SIGMA
    0x00e6: 0x00b5,     #  MICRO SIGN
    0x00e7: 0x03c4,     #  GREEK SMALL LETTER TAU
    0x00e8: 0x03a6,     #  GREEK CAPITAL LETTER PHI
    0x00e9: 0x0398,     #  GREEK CAPITAL LETTER THETA
    0x00ea: 0x03a9,     #  GREEK CAPITAL LETTER OMEGA
    0x00eb: 0x03b4,     #  GREEK SMALL LETTER DELTA
    0x00ec: 0x221e,     #  INFINITY
    0x00ed: 0x03c6,     #  GREEK SMALL LETTER PHI
    0x00ee: 0x03b5,     #  GREEK SMALL LETTER EPSILON
    0x00ef: 0x2229,     #  INTERSECTION
    0x00f0: 0x2261,     #  IDENTICAL TO
    0x00f1: 0x00b1,     #  PLUS-MINUS SIGN
    0x00f2: 0x2265,     #  GREATER-THAN OR EQUAL TO
    0x00f3: 0x2264,     #  LESS-THAN OR EQUAL TO
    0x00f4: 0x2320,     #  TOP HALF INTEGRAL
    0x00f5: 0x2321,     #  BOTTOM HALF INTEGRAL
    0x00f6: 0x00f7,     #  DIVISION SIGN
    0x00f7: 0x2248,     #  ALMOST EQUAL TO
    0x00f8: 0x00b0,     #  DEGREE SIGN
    0x00f9: 0x2219,     #  BULLET OPERATOR
    0x00fa: 0x00b7,     #  MIDDLE DOT
    0x00fb: 0x221a,     #  SQUARE ROOT
    0x00fc: 0x207f,     #  SUPERSCRIPT LATIN SMALL LETTER N
    0x00fd: 0x00b2,     #  SUPERSCRIPT TWO
    0x00fe: 0x25a0,     #  BLACK SQUARE
    0x00ff: 0x00a0,     #  NO-BREAK SPACE
})

### Decoding Table

decoding_table = (
    '\x00'     #  0x0000 -> NULL
    '\x01'     #  0x0001 -> START OF HEADING
    '\x02'     #  0x0002 -> START OF TEXT
    '\x03'     #  0x0003 -> END OF TEXT
    '\x04'     #  0x0004 -> END OF TRANSMISSION
    '\x05'     #  0x0005 -> ENQUIRY
    '\x06'     #  0x0006 -> ACKNOWLEDGE
    '\x07'     #  0x0007 -> BELL
    '\x08'     #  0x0008 -> BACKSPACE
    '\t'       #  0x0009 -> HORIZONTAL TABULATION
    '\n'       #  0x000a -> LINE FEED
    '\x0b'     #  0x000b -> VERTICAL TABULATION
    '\x0c'     #  0x000c -> FORM FEED
    '\r'       #  0x000d -> CARRIAGE RETURN
    '\x0e'     #  0x000e -> SHIFT OUT
    '\x0f'     #  0x000f -> SHIFT IN
    '\x10'     #  0x0010 -> DATA LINK ESCAPE
    '\x11'     #  0x0011 -> DEVICE CONTROL ONE
    '\x12'     #  0x0012 -> DEVICE CONTROL TWO
    '\x13'     #  0x0013 -> DEVICE CONTROL THREE
    '\x14'     #  0x0014 -> DEVICE CONTROL FOUR
    '\x15'     #  0x0015 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x0016 -> SYNCHRONOUS IDLE
    '\x17'     #  0x0017 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x0018 -> CANCEL
    '\x19'     #  0x0019 -> END OF MEDIUM
    '\x1a'     #  0x001a -> SUBSTITUTE
    '\x1b'     #  0x001b -> ESCAPE
    '\x1c'     #  0x001c -> FILE SEPARATOR
    '\x1d'     #  0x001d -> GROUP SEPARATOR
    '\x1e'     #  0x001e -> RECORD SEPARATOR
    '\x1f'     #  0x001f -> UNIT SEPARATOR
    ' '        #  0x0020 -> SPACE
    '!'        #  0x0021 -> EXCLAMATION MARK
    '"'        #  0x0022 -> QUOTATION MARK
    '#'        #  0x0023 -> NUMBER SIGN
    '$'        #  0x0024 -> DOLLAR SIGN
    '%'        #  0x0025 -> PERCENT SIGN
    '&'        #  0x0026 -> AMPERSAND
    "'"        #  0x0027 -> APOSTROPHE
    '('        #  0x0028 -> LEFT PARENTHESIS
    ')'        #  0x0029 -> RIGHT PARENTHESIS
    '*'        #  0x002a -> ASTERISK
    '+'        #  0x002b -> PLUS SIGN
    ','        #  0x002c -> COMMA
    '-'        #  0x002d -> HYPHEN-MINUS
    '.'        #  0x002e -> FULL STOP
    '/'        #  0x002f -> SOLIDUS
    '0'        #  0x0030 -> DIGIT ZERO
    '1'        #  0x0031 -> DIGIT ONE
    '2'        #  0x0032 -> DIGIT TWO
    '3'        #  0x0033 -> DIGIT THREE
    '4'        #  0x0034 -> DIGIT FOUR
    '5'        #  0x0035 -> DIGIT FIVE
    '6'        #  0x0036 -> DIGIT SIX
    '7'        #  0x0037 -> DIGIT SEVEN
    '8'        #  0x0038 -> DIGIT EIGHT
    '9'        #  0x0039 -> DIGIT NINE
    ':'        #  0x003a -> COLON
    ';'        #  0x003b -> SEMICOLON
    '<'        #  0x003c -> LESS-THAN SIGN
    '='        #  0x003d -> EQUALS SIGN
    '>'        #  0x003e -> GREATER-THAN SIGN
    '?'        #  0x003f -> QUESTION MARK
    '@'        #  0x0040 -> COMMERCIAL AT
    'A'        #  0x0041 -> LATIN CAPITAL LETTER A
    'B'        #  0x0042 -> LATIN CAPITAL LETTER B
    'C'        #  0x0043 -> LATIN CAPITAL LETTER C
    'D'        #  0x0044 -> LATIN CAPITAL LETTER D
    'E'        #  0x0045 -> LATIN CAPITAL LETTER E
    'F'        #  0x0046 -> LATIN CAPITAL LETTER F
    'G'        #  0x0047 -> LATIN CAPITAL LETTER G
    'H'        #  0x0048 -> LATIN CAPITAL LETTER H
    'I'        #  0x0049 -> LATIN CAPITAL LETTER I
    'J'        #  0x004a -> LATIN CAPITAL LETTER J
    'K'        #  0x004b -> LATIN CAPITAL LETTER K
    'L'        #  0x004c -> LATIN CAPITAL LETTER L
    'M'        #  0x004d -> LATIN CAPITAL LETTER M
    'N'        #  0x004e -> LATIN CAPITAL LETTER N
    'O'        #  0x004f -> LATIN CAPITAL LETTER O
    'P'        #  0x0050 -> LATIN CAPITAL LETTER P
    'Q'        #  0x0051 -> LATIN CAPITAL LETTER Q
    'R'        #  0x0052 -> LATIN CAPITAL LETTER R
    'S'        #  0x0053 -> LATIN CAPITAL LETTER S
    'T'        #  0x0054 -> LATIN CAPITAL LETTER T
    'U'        #  0x0055 -> LATIN CAPITAL LETTER U
    'V'        #  0x0056 -> LATIN CAPITAL LETTER V
    'W'        #  0x0057 -> LATIN CAPITAL LETTER W
    'X'        #  0x0058 -> LATIN CAPITAL LETTER X
    'Y'        #  0x0059 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x005a -> LATIN CAPITAL LETTER Z
    '['        #  0x005b -> LEFT SQUARE BRACKET
    '\\'       #  0x005c -> REVERSE SOLIDUS
    ']'        #  0x005d -> RIGHT SQUARE BRACKET
    '^'        #  0x005e -> CIRCUMFLEX ACCENT
    '_'        #  0x005f -> LOW LINE
    '`'        #  0x0060 -> GRAVE ACCENT
    'a'        #  0x0061 -> LATIN SMALL LETTER A
    'b'        #  0x0062 -> LATIN SMALL LETTER B
    'c'        #  0x0063 -> LATIN SMALL LETTER C
    'd'        #  0x0064 -> LATIN SMALL LETTER D
    'e'        #  0x0065 -> LATIN SMALL LETTER E
    'f'        #  0x0066 -> LATIN SMALL LETTER F
    'g'        #  0x0067 -> LATIN SMALL LETTER G
    'h'        #  0x0068 -> LATIN SMALL LETTER H
    'i'        #  0x0069 -> LATIN SMALL LETTER I
    'j'        #  0x006a -> LATIN SMALL LETTER J
    'k'        #  0x006b -> LATIN SMALL LETTER K
    'l'        #  0x006c -> LATIN SMALL LETTER L
    'm'        #  0x006d -> LATIN SMALL LETTER M
    'n'        #  0x006e -> LATIN SMALL LETTER N
    'o'        #  0x006f -> LATIN SMALL LETTER O
    'p'        #  0x0070 -> LATIN SMALL LETTER P
    'q'        #  0x0071 -> LATIN SMALL LETTER Q
    'r'        #  0x0072 -> LATIN SMALL LETTER R
    's'        #  0x0073 -> LATIN SMALL LETTER S
    't'        #  0x0074 -> LATIN SMALL LETTER T
    'u'        #  0x0075 -> LATIN SMALL LETTER U
    'v'        #  0x0076 -> LATIN SMALL LETTER V
    'w'        #  0x0077 -> LATIN SMALL LETTER W
    'x'        #  0x0078 -> LATIN SMALL LETTER X
    'y'        #  0x0079 -> LATIN SMALL LETTER Y
    'z'        #  0x007a -> LATIN SMALL LETTER Z
    '{'        #  0x007b -> LEFT CURLY BRACKET
    '|'        #  0x007c -> VERTICAL LINE
    '}'        #  0x007d -> RIGHT CURLY BRACKET
    '~'        #  0x007e -> TILDE
    '\x7f'     #  0x007f -> DELETE
    '\u05d0'   #  0x0080 -> HEBREW LETTER ALEF
    '\u05d1'   #  0x0081 -> HEBREW LETTER BET
    '\u05d2'   #  0x0082 -> HEBREW LETTER GIMEL
    '\u05d3'   #  0x0083 -> HEBREW LETTER DALET
    '\u05d4'   #  0x0084 -> HEBREW LETTER HE
    '\u05d5'   #  0x0085 -> HEBREW LETTER VAV
    '\u05d6'   #  0x0086 -> HEBREW LETTER ZAYIN
    '\u05d7'   #  0x0087 -> HEBREW LETTER HET
    '\u05d8'   #  0x0088 -> HEBREW LETTER TET
    '\u05d9'   #  0x0089 -> HEBREW LETTER YOD
    '\u05da'   #  0x008a -> HEBREW LETTER FINAL KAF
    '\u05db'   #  0x008b -> HEBREW LETTER KAF
    '\u05dc'   #  0x008c -> HEBREW LETTER LAMED
    '\u05dd'   #  0x008d -> HEBREW LETTER FINAL MEM
    '\u05de'   #  0x008e -> HEBREW LETTER MEM
    '\u05df'   #  0x008f -> HEBREW LETTER FINAL NUN
    '\u05e0'   #  0x0090 -> HEBREW LETTER NUN
    '\u05e1'   #  0x0091 -> HEBREW LETTER SAMEKH
    '\u05e2'   #  0x0092 -> HEBREW LETTER AYIN
    '\u05e3'   #  0x0093 -> HEBREW LETTER FINAL PE
    '\u05e4'   #  0x0094 -> HEBREW LETTER PE
    '\u05e5'   #  0x0095 -> HEBREW LETTER FINAL TSADI
    '\u05e6'   #  0x0096 -> HEBREW LETTER TSADI
    '\u05e7'   #  0x0097 -> HEBREW LETTER QOF
    '\u05e8'   #  0x0098 -> HEBREW LETTER RESH
    '\u05e9'   #  0x0099 -> HEBREW LETTER SHIN
    '\u05ea'   #  0x009a -> HEBREW LETTER TAV
    '\xa2'     #  0x009b -> CENT SIGN
    '\xa3'     #  0x009c -> POUND SIGN
    '\xa5'     #  0x009d -> YEN SIGN
    '\u20a7'   #  0x009e -> PESETA SIGN
    '\u0192'   #  0x009f -> LATIN SMALL LETTER F WITH HOOK
    '\xe1'     #  0x00a0 -> LATIN SMALL LETTER A WITH ACUTE
    '\xed'     #  0x00a1 -> LATIN SMALL LETTER I WITH ACUTE
    '\xf3'     #  0x00a2 -> LATIN SMALL LETTER O WITH ACUTE
    '\xfa'     #  0x00a3 -> LATIN SMALL LETTER U WITH ACUTE
    '\xf1'     #  0x00a4 -> LATIN SMALL LETTER N WITH TILDE
    '\xd1'     #  0x00a5 -> LATIN CAPITAL LETTER N WITH TILDE
    '\xaa'     #  0x00a6 -> FEMININE ORDINAL INDICATOR
    '\xba'     #  0x00a7 -> MASCULINE ORDINAL INDICATOR
    '\xbf'     #  0x00a8 -> INVERTED QUESTION MARK
    '\u2310'   #  0x00a9 -> REVERSED NOT SIGN
    '\xac'     #  0x00aa -> NOT SIGN
    '\xbd'     #  0x00ab -> VULGAR FRACTION ONE HALF
    '\xbc'     #  0x00ac -> VULGAR FRACTION ONE QUARTER
    '\xa1'     #  0x00ad -> INVERTED EXCLAMATION MARK
    '\xab'     #  0x00ae -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbb'     #  0x00af -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u2591'   #  0x00b0 -> LIGHT SHADE
    '\u2592'   #  0x00b1 -> MEDIUM SHADE
    '\u2593'   #  0x00b2 -> DARK SHADE
    '\u2502'   #  0x00b3 -> BOX DRAWINGS LIGHT VERTICAL
    '\u2524'   #  0x00b4 -> BOX DRAWINGS LIGHT VERTICAL AND LEFT
    '\u2561'   #  0x00b5 -> BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
    '\u2562'   #  0x00b6 -> BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
    '\u2556'   #  0x00b7 -> BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
    '\u2555'   #  0x00b8 -> BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
    '\u2563'   #  0x00b9 -> BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    '\u2551'   #  0x00ba -> BOX DRAWINGS DOUBLE VERTICAL
    '\u2557'   #  0x00bb -> BOX DRAWINGS DOUBLE DOWN AND LEFT
    '\u255d'   #  0x00bc -> BOX DRAWINGS DOUBLE UP AND LEFT
    '\u255c'   #  0x00bd -> BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
    '\u255b'   #  0x00be -> BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
    '\u2510'   #  0x00bf -> BOX DRAWINGS LIGHT DOWN AND LEFT
    '\u2514'   #  0x00c0 -> BOX DRAWINGS LIGHT UP AND RIGHT
    '\u2534'   #  0x00c1 -> BOX DRAWINGS LIGHT UP AND HORIZONTAL
    '\u252c'   #  0x00c2 -> BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    '\u251c'   #  0x00c3 -> BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    '\u2500'   #  0x00c4 -> BOX DRAWINGS LIGHT HORIZONTAL
    '\u253c'   #  0x00c5 -> BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    '\u255e'   #  0x00c6 -> BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
    '\u255f'   #  0x00c7 -> BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
    '\u255a'   #  0x00c8 -> BOX DRAWINGS DOUBLE UP AND RIGHT
    '\u2554'   #  0x00c9 -> BOX DRAWINGS DOUBLE DOWN AND RIGHT
    '\u2569'   #  0x00ca -> BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    '\u2566'   #  0x00cb -> BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    '\u2560'   #  0x00cc -> BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    '\u2550'   #  0x00cd -> BOX DRAWINGS DOUBLE HORIZONTAL
    '\u256c'   #  0x00ce -> BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    '\u2567'   #  0x00cf -> BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
    '\u2568'   #  0x00d0 -> BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
    '\u2564'   #  0x00d1 -> BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
    '\u2565'   #  0x00d2 -> BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
    '\u2559'   #  0x00d3 -> BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
    '\u2558'   #  0x00d4 -> BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
    '\u2552'   #  0x00d5 -> BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
    '\u2553'   #  0x00d6 -> BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
    '\u256b'   #  0x00d7 -> BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
    '\u256a'   #  0x00d8 -> BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
    '\u2518'   #  0x00d9 -> BOX DRAWINGS LIGHT UP AND LEFT
    '\u250c'   #  0x00da -> BOX DRAWINGS LIGHT DOWN AND RIGHT
    '\u2588'   #  0x00db -> FULL BLOCK
    '\u2584'   #  0x00dc -> LOWER HALF BLOCK
    '\u258c'   #  0x00dd -> LEFT HALF BLOCK
    '\u2590'   #  0x00de -> RIGHT HALF BLOCK
    '\u2580'   #  0x00df -> UPPER HALF BLOCK
    '\u03b1'   #  0x00e0 -> GREEK SMALL LETTER ALPHA
    '\xdf'     #  0x00e1 -> LATIN SMALL LETTER SHARP S (GERMAN)
    '\u0393'   #  0x00e2 -> GREEK CAPITAL LETTER GAMMA
    '\u03c0'   #  0x00e3 -> GREEK SMALL LETTER PI
    '\u03a3'   #  0x00e4 -> GREEK CAPITAL LETTER SIGMA
    '\u03c3'   #  0x00e5 -> GREEK SMALL LETTER SIGMA
    '\xb5'     #  0x00e6 -> MICRO SIGN
    '\u03c4'   #  0x00e7 -> GREEK SMALL LETTER TAU
    '\u03a6'   #  0x00e8 -> GREEK CAPITAL LETTER PHI
    '\u0398'   #  0x00e9 -> GREEK CAPITAL LETTER THETA
    '\u03a9'   #  0x00ea -> GREEK CAPITAL LETTER OMEGA
    '\u03b4'   #  0x00eb -> GREEK SMALL LETTER DELTA
    '\u221e'   #  0x00ec -> INFINITY
    '\u03c6'   #  0x00ed -> GREEK SMALL LETTER PHI
    '\u03b5'   #  0x00ee -> GREEK SMALL LETTER EPSILON
    '\u2229'   #  0x00ef -> INTERSECTION
    '\u2261'   #  0x00f0 -> IDENTICAL TO
    '\xb1'     #  0x00f1 -> PLUS-MINUS SIGN
    '\u2265'   #  0x00f2 -> GREATER-THAN OR EQUAL TO
    '\u2264'   #  0x00f3 -> LESS-THAN OR EQUAL TO
    '\u2320'   #  0x00f4 -> TOP HALF INTEGRAL
    '\u2321'   #  0x00f5 -> BOTTOM HALF INTEGRAL
    '\xf7'     #  0x00f6 -> DIVISION SIGN
    '\u2248'   #  0x00f7 -> ALMOST EQUAL TO
    '\xb0'     #  0x00f8 -> DEGREE SIGN
    '\u2219'   #  0x00f9 -> BULLET OPERATOR
    '\xb7'     #  0x00fa -> MIDDLE DOT
    '\u221a'   #  0x00fb -> SQUARE ROOT
    '\u207f'   #  0x00fc -> SUPERSCRIPT LATIN SMALL LETTER N
    '\xb2'     #  0x00fd -> SUPERSCRIPT TWO
    '\u25a0'   #  0x00fe -> BLACK SQUARE
    '\xa0'     #  0x00ff -> NO-BREAK SPACE
)

### Encoding Map

encoding_map = {
    0x0000: 0x0000,     #  NULL
    0x0001: 0x0001,     #  START OF HEADING
    0x0002: 0x0002,     #  START OF TEXT
    0x0003: 0x0003,     #  END OF TEXT
    0x0004: 0x0004,     #  END OF TRANSMISSION
    0x0005: 0x0005,     #  ENQUIRY
    0x0006: 0x0006,     #  ACKNOWLEDGE
    0x0007: 0x0007,     #  BELL
    0x0008: 0x0008,     #  BACKSPACE
    0x0009: 0x0009,     #  HORIZONTAL TABULATION
    0x000a: 0x000a,     #  LINE FEED
    0x000b: 0x000b,     #  VERTICAL TABULATION
    0x000c: 0x000c,     #  FORM FEED
    0x000d: 0x000d,     #  CARRIAGE RETURN
    0x000e: 0x000e,     #  SHIFT OUT
    0x000f: 0x000f,     #  SHIFT IN
    0x0010: 0x0010,     #  DATA LINK ESCAPE
    0x0011: 0x0011,     #  DEVICE CONTROL ONE
    0x0012: 0x0012,     #  DEVICE CONTROL TWO
    0x0013: 0x0013,     #  DEVICE CONTROL THREE
    0x0014: 0x0014,     #  DEVICE CONTROL FOUR
    0x0015: 0x0015,     #  NEGATIVE ACKNOWLEDGE
    0x0016: 0x0016,     #  SYNCHRONOUS IDLE
    0x0017: 0x0017,     #  END OF TRANSMISSION BLOCK
    0x0018: 0x0018,     #  CANCEL
    0x0019: 0x0019,     #  END OF MEDIUM
    0x001a: 0x001a,     #  SUBSTITUTE
    0x001b: 0x001b,     #  ESCAPE
    0x001c: 0x001c,     #  FILE SEPARATOR
    0x001d: 0x001d,     #  GROUP SEPARATOR
    0x001e: 0x001e,     #  RECORD SEPARATOR
    0x001f: 0x001f,     #  UNIT SEPARATOR
    0x0020: 0x0020,     #  SPACE
    0x0021: 0x0021,     #  EXCLAMATION MARK
    0x0022: 0x0022,     #  QUOTATION MARK
    0x0023: 0x0023,     #  NUMBER SIGN
    0x0024: 0x0024,     #  DOLLAR SIGN
    0x0025: 0x0025,     #  PERCENT SIGN
    0x0026: 0x0026,     #  AMPERSAND
    0x0027: 0x0027,     #  APOSTROPHE
    0x0028: 0x0028,     #  LEFT PARENTHESIS
    0x0029: 0x0029,     #  RIGHT PARENTHESIS
    0x002a: 0x002a,     #  ASTERISK
    0x002b: 0x002b,     #  PLUS SIGN
    0x002c: 0x002c,     #  COMMA
    0x002d: 0x002d,     #  HYPHEN-MINUS
    0x002e: 0x002e,     #  FULL STOP
    0x002f: 0x002f,     #  SOLIDUS
    0x0030: 0x0030,     #  DIGIT ZERO
    0x0031: 0x0031,     #  DIGIT ONE
    0x0032: 0x0032,     #  DIGIT TWO
    0x0033: 0x0033,     #  DIGIT THREE
    0x0034: 0x0034,     #  DIGIT FOUR
    0x0035: 0x0035,     #  DIGIT FIVE
    0x0036: 0x0036,     #  DIGIT SIX
    0x0037: 0x0037,     #  DIGIT SEVEN
    0x0038: 0x0038,     #  DIGIT EIGHT
    0x0039: 0x0039,     #  DIGIT NINE
    0x003a: 0x003a,     #  COLON
    0x003b: 0x003b,     #  SEMICOLON
    0x003c: 0x003c,     #  LESS-THAN SIGN
    0x003d: 0x003d,     #  EQUALS SIGN
    0x003e: 0x003e,     #  GREATER-THAN SIGN
    0x003f: 0x003f,     #  QUESTION MARK
    0x0040: 0x0040,     #  COMMERCIAL AT
    0x0041: 0x0041,     #  LATIN CAPITAL LETTER A
    0x0042: 0x0042,     #  LATIN CAPITAL LETTER B
    0x0043: 0x0043,     #  LATIN CAPITAL LETTER C
    0x0044: 0x0044,     #  LATIN CAPITAL LETTER D
    0x0045: 0x0045,     #  LATIN CAPITAL LETTER E
    0x0046: 0x0046,     #  LATIN CAPITAL LETTER F
    0x0047: 0x0047,     #  LATIN CAPITAL LETTER G
    0x0048: 0x0048,     #  LATIN CAPITAL LETTER H
    0x0049: 0x0049,     #  LATIN CAPITAL LETTER I
    0x004a: 0x004a,     #  LATIN CAPITAL LETTER J
    0x004b: 0x004b,     #  LATIN CAPITAL LETTER K
    0x004c: 0x004c,     #  LATIN CAPITAL LETTER L
    0x004d: 0x004d,     #  LATIN CAPITAL LETTER M
    0x004e: 0x004e,     #  LATIN CAPITAL LETTER N
    0x004f: 0x004f,     #  LATIN CAPITAL LETTER O
    0x0050: 0x0050,     #  LATIN CAPITAL LETTER P
    0x0051: 0x0051,     #  LATIN CAPITAL LETTER Q
    0x0052: 0x0052,     #  LATIN CAPITAL LETTER R
    0x0053: 0x0053,     #  LATIN CAPITAL LETTER S
    0x0054: 0x0054,     #  LATIN CAPITAL LETTER T
    0x0055: 0x0055,     #  LATIN CAPITAL LETTER U
    0x0056: 0x0056,     #  LATIN CAPITAL LETTER V
    0x0057: 0x0057,     #  LATIN CAPITAL LETTER W
    0x0058: 0x0058,     #  LATIN CAPITAL LETTER X
    0x0059: 0x0059,     #  LATIN CAPITAL LETTER Y
    0x005a: 0x005a,     #  LATIN CAPITAL LETTER Z
    0x005b: 0x005b,     #  LEFT SQUARE BRACKET
    0x005c: 0x005c,     #  REVERSE SOLIDUS
    0x005d: 0x005d,     #  RIGHT SQUARE BRACKET
    0x005e: 0x005e,     #  CIRCUMFLEX ACCENT
    0x005f: 0x005f,     #  LOW LINE
    0x0060: 0x0060,     #  GRAVE ACCENT
    0x0061: 0x0061,     #  LATIN SMALL LETTER A
    0x0062: 0x0062,     #  LATIN SMALL LETTER B
    0x0063: 0x0063,     #  LATIN SMALL LETTER C
    0x0064: 0x0064,     #  LATIN SMALL LETTER D
    0x0065: 0x0065,     #  LATIN SMALL LETTER E
    0x0066: 0x0066,     #  LATIN SMALL LETTER F
    0x0067: 0x0067,     #  LATIN SMALL LETTER G
    0x0068: 0x0068,     #  LATIN SMALL LETTER H
    0x0069: 0x0069,     #  LATIN SMALL LETTER I
    0x006a: 0x006a,     #  LATIN SMALL LETTER J
    0x006b: 0x006b,     #  LATIN SMALL LETTER K
    0x006c: 0x006c,     #  LATIN SMALL LETTER L
    0x006d: 0x006d,     #  LATIN SMALL LETTER M
    0x006e: 0x006e,     #  LATIN SMALL LETTER N
    0x006f: 0x006f,     #  LATIN SMALL LETTER O
    0x0070: 0x0070,     #  LATIN SMALL LETTER P
    0x0071: 0x0071,     #  LATIN SMALL LETTER Q
    0x0072: 0x0072,     #  LATIN SMALL LETTER R
    0x0073: 0x0073,     #  LATIN SMALL LETTER S
    0x0074: 0x0074,     #  LATIN SMALL LETTER T
    0x0075: 0x0075,     #  LATIN SMALL LETTER U
    0x0076: 0x0076,     #  LATIN SMALL LETTER V
    0x0077: 0x0077,     #  LATIN SMALL LETTER W
    0x0078: 0x0078,     #  LATIN SMALL LETTER X
    0x0079: 0x0079,     #  LATIN SMALL LETTER Y
    0x007a: 0x007a,     #  LATIN SMALL LETTER Z
    0x007b: 0x007b,     #  LEFT CURLY BRACKET
    0x007c: 0x007c,     #  VERTICAL LINE
    0x007d: 0x007d,     #  RIGHT CURLY BRACKET
    0x007e: 0x007e,     #  TILDE
    0x007f: 0x007f,     #  DELETE
    0x00a0: 0x00ff,     #  NO-BREAK SPACE
    0x00a1: 0x00ad,     #  INVERTED EXCLAMATION MARK
    0x00a2: 0x009b,     #  CENT SIGN
    0x00a3: 0x009c,     #  POUND SIGN
    0x00a5: 0x009d,     #  YEN SIGN
    0x00aa: 0x00a6,     #  FEMININE ORDINAL INDICATOR
    0x00ab: 0x00ae,     #  LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00ac: 0x00aa,     #  NOT SIGN
    0x00b0: 0x00f8,     #  DEGREE SIGN
    0x00b1: 0x00f1,     #  PLUS-MINUS SIGN
    0x00b2: 0x00fd,     #  SUPERSCRIPT TWO
    0x00b5: 0x00e6,     #  MICRO SIGN
    0x00b7: 0x00fa,     #  MIDDLE DOT
    0x00ba: 0x00a7,     #  MASCULINE ORDINAL INDICATOR
    0x00bb: 0x00af,     #  RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00bc: 0x00ac,     #  VULGAR FRACTION ONE QUARTER
    0x00bd: 0x00ab,     #  VULGAR FRACTION ONE HALF
    0x00bf: 0x00a8,     #  INVERTED QUESTION MARK
    0x00d1: 0x00a5,     #  LATIN CAPITAL LETTER N WITH TILDE
    0x00df: 0x00e1,     #  LATIN SMALL LETTER SHARP S (GERMAN)
    0x00e1: 0x00a0,     #  LATIN SMALL LETTER A WITH ACUTE
    0x00ed: 0x00a1,     #  LATIN SMALL LETTER I WITH ACUTE
    0x00f1: 0x00a4,     #  LATIN SMALL LETTER N WITH TILDE
    0x00f3: 0x00a2,     #  LATIN SMALL LETTER O WITH ACUTE
    0x00f7: 0x00f6,     #  DIVISION SIGN
    0x00fa: 0x00a3,     #  LATIN SMALL LETTER U WITH ACUTE
    0x0192: 0x009f,     #  LATIN SMALL LETTER F WITH HOOK
    0x0393: 0x00e2,     #  GREEK CAPITAL LETTER GAMMA
    0x0398: 0x00e9,     #  GREEK CAPITAL LETTER THETA
    0x03a3: 0x00e4,     #  GREEK CAPITAL LETTER SIGMA
    0x03a6: 0x00e8,     #  GREEK CAPITAL LETTER PHI
    0x03a9: 0x00ea,     #  GREEK CAPITAL LETTER OMEGA
    0x03b1: 0x00e0,     #  GREEK SMALL LETTER ALPHA
    0x03b4: 0x00eb,     #  GREEK SMALL LETTER DELTA
    0x03b5: 0x00ee,     #  GREEK SMALL LETTER EPSILON
    0x03c0: 0x00e3,     #  GREEK SMALL LETTER PI
    0x03c3: 0x00e5,     #  GREEK SMALL LETTER SIGMA
    0x03c4: 0x00e7,     #  GREEK SMALL LETTER TAU
    0x03c6: 0x00ed,     #  GREEK SMALL LETTER PHI
    0x05d0: 0x0080,     #  HEBREW LETTER ALEF
    0x05d1: 0x0081,     #  HEBREW LETTER BET
    0x05d2: 0x0082,     #  HEBREW LETTER GIMEL
    0x05d3: 0x0083,     #  HEBREW LETTER DALET
    0x05d4: 0x0084,     #  HEBREW LETTER HE
    0x05d5: 0x0085,     #  HEBREW LETTER VAV
    0x05d6: 0x0086,     #  HEBREW LETTER ZAYIN
    0x05d7: 0x0087,     #  HEBREW LETTER HET
    0x05d8: 0x0088,     #  HEBREW LETTER TET
    0x05d9: 0x0089,     #  HEBREW LETTER YOD
    0x05da: 0x008a,     #  HEBREW LETTER FINAL KAF
    0x05db: 0x008b,     #  HEBREW LETTER KAF
    0x05dc: 0x008c,     #  HEBREW LETTER LAMED
    0x05dd: 0x008d,     #  HEBREW LETTER FINAL MEM
    0x05de: 0x008e,     #  HEBREW LETTER MEM
    0x05df: 0x008f,     #  HEBREW LETTER FINAL NUN
    0x05e0: 0x0090,     #  HEBREW LETTER NUN
    0x05e1: 0x0091,     #  HEBREW LETTER SAMEKH
    0x05e2: 0x0092,     #  HEBREW LETTER AYIN
    0x05e3: 0x0093,     #  HEBREW LETTER FINAL PE
    0x05e4: 0x0094,     #  HEBREW LETTER PE
    0x05e5: 0x0095,     #  HEBREW LETTER FINAL TSADI
    0x05e6: 0x0096,     #  HEBREW LETTER TSADI
    0x05e7: 0x0097,     #  HEBREW LETTER QOF
    0x05e8: 0x0098,     #  HEBREW LETTER RESH
    0x05e9: 0x0099,     #  HEBREW LETTER SHIN
    0x05ea: 0x009a,     #  HEBREW LETTER TAV
    0x207f: 0x00fc,     #  SUPERSCRIPT LATIN SMALL LETTER N
    0x20a7: 0x009e,     #  PESETA SIGN
    0x2219: 0x00f9,     #  BULLET OPERATOR
    0x221a: 0x00fb,     #  SQUARE ROOT
    0x221e: 0x00ec,     #  INFINITY
    0x2229: 0x00ef,     #  INTERSECTION
    0x2248: 0x00f7,     #  ALMOST EQUAL TO
    0x2261: 0x00f0,     #  IDENTICAL TO
    0x2264: 0x00f3,     #  LESS-THAN OR EQUAL TO
    0x2265: 0x00f2,     #  GREATER-THAN OR EQUAL TO
    0x2310: 0x00a9,     #  REVERSED NOT SIGN
    0x2320: 0x00f4,     #  TOP HALF INTEGRAL
    0x2321: 0x00f5,     #  BOTTOM HALF INTEGRAL
    0x2500: 0x00c4,     #  BOX DRAWINGS LIGHT HORIZONTAL
    0x2502: 0x00b3,     #  BOX DRAWINGS LIGHT VERTICAL
    0x250c: 0x00da,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
    0x2510: 0x00bf,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
    0x2514: 0x00c0,     #  BOX DRAWINGS LIGHT UP AND RIGHT
    0x2518: 0x00d9,     #  BOX DRAWINGS LIGHT UP AND LEFT
    0x251c: 0x00c3,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    0x2524: 0x00b4,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
    0x252c: 0x00c2,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    0x2534: 0x00c1,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
    0x253c: 0x00c5,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    0x2550: 0x00cd,     #  BOX DRAWINGS DOUBLE HORIZONTAL
    0x2551: 0x00ba,     #  BOX DRAWINGS DOUBLE VERTICAL
    0x2552: 0x00d5,     #  BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
    0x2553: 0x00d6,     #  BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
    0x2554: 0x00c9,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
    0x2555: 0x00b8,     #  BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
    0x2556: 0x00b7,     #  BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
    0x2557: 0x00bb,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
    0x2558: 0x00d4,     #  BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
    0x2559: 0x00d3,     #  BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
    0x255a: 0x00c8,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
    0x255b: 0x00be,     #  BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
    0x255c: 0x00bd,     #  BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
    0x255d: 0x00bc,     #  BOX DRAWINGS DOUBLE UP AND LEFT
    0x255e: 0x00c6,     #  BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
    0x255f: 0x00c7,     #  BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
    0x2560: 0x00cc,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    0x2561: 0x00b5,     #  BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
    0x2562: 0x00b6,     #  BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
    0x2563: 0x00b9,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    0x2564: 0x00d1,     #  BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
    0x2565: 0x00d2,     #  BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
    0x2566: 0x00cb,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    0x2567: 0x00cf,     #  BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
    0x2568: 0x00d0,     #  BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
    0x2569: 0x00ca,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    0x256a: 0x00d8,     #  BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
    0x256b: 0x00d7,     #  BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
    0x256c: 0x00ce,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    0x2580: 0x00df,     #  UPPER HALF BLOCK
    0x2584: 0x00dc,     #  LOWER HALF BLOCK
    0x2588: 0x00db,     #  FULL BLOCK
    0x258c: 0x00dd,     #  LEFT HALF BLOCK
    0x2590: 0x00de,     #  RIGHT HALF BLOCK
    0x2591: 0x00b0,     #  LIGHT SHADE
    0x2592: 0x00b1,     #  MEDIUM SHADE
    0x2593: 0x00b2,     #  DARK SHADE
    0x25a0: 0x00fe,     #  BLACK SQUARE
}
encodings/cp1256.py000064400000031016151153537620010020 0ustar00""" Python Character Mapping Codec cp1256 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1256.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp1256',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\u20ac'   #  0x80 -> EURO SIGN
    '\u067e'   #  0x81 -> ARABIC LETTER PEH
    '\u201a'   #  0x82 -> SINGLE LOW-9 QUOTATION MARK
    '\u0192'   #  0x83 -> LATIN SMALL LETTER F WITH HOOK
    '\u201e'   #  0x84 -> DOUBLE LOW-9 QUOTATION MARK
    '\u2026'   #  0x85 -> HORIZONTAL ELLIPSIS
    '\u2020'   #  0x86 -> DAGGER
    '\u2021'   #  0x87 -> DOUBLE DAGGER
    '\u02c6'   #  0x88 -> MODIFIER LETTER CIRCUMFLEX ACCENT
    '\u2030'   #  0x89 -> PER MILLE SIGN
    '\u0679'   #  0x8A -> ARABIC LETTER TTEH
    '\u2039'   #  0x8B -> SINGLE LEFT-POINTING ANGLE QUOTATION MARK
    '\u0152'   #  0x8C -> LATIN CAPITAL LIGATURE OE
    '\u0686'   #  0x8D -> ARABIC LETTER TCHEH
    '\u0698'   #  0x8E -> ARABIC LETTER JEH
    '\u0688'   #  0x8F -> ARABIC LETTER DDAL
    '\u06af'   #  0x90 -> ARABIC LETTER GAF
    '\u2018'   #  0x91 -> LEFT SINGLE QUOTATION MARK
    '\u2019'   #  0x92 -> RIGHT SINGLE QUOTATION MARK
    '\u201c'   #  0x93 -> LEFT DOUBLE QUOTATION MARK
    '\u201d'   #  0x94 -> RIGHT DOUBLE QUOTATION MARK
    '\u2022'   #  0x95 -> BULLET
    '\u2013'   #  0x96 -> EN DASH
    '\u2014'   #  0x97 -> EM DASH
    '\u06a9'   #  0x98 -> ARABIC LETTER KEHEH
    '\u2122'   #  0x99 -> TRADE MARK SIGN
    '\u0691'   #  0x9A -> ARABIC LETTER RREH
    '\u203a'   #  0x9B -> SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
    '\u0153'   #  0x9C -> LATIN SMALL LIGATURE OE
    '\u200c'   #  0x9D -> ZERO WIDTH NON-JOINER
    '\u200d'   #  0x9E -> ZERO WIDTH JOINER
    '\u06ba'   #  0x9F -> ARABIC LETTER NOON GHUNNA
    '\xa0'     #  0xA0 -> NO-BREAK SPACE
    '\u060c'   #  0xA1 -> ARABIC COMMA
    '\xa2'     #  0xA2 -> CENT SIGN
    '\xa3'     #  0xA3 -> POUND SIGN
    '\xa4'     #  0xA4 -> CURRENCY SIGN
    '\xa5'     #  0xA5 -> YEN SIGN
    '\xa6'     #  0xA6 -> BROKEN BAR
    '\xa7'     #  0xA7 -> SECTION SIGN
    '\xa8'     #  0xA8 -> DIAERESIS
    '\xa9'     #  0xA9 -> COPYRIGHT SIGN
    '\u06be'   #  0xAA -> ARABIC LETTER HEH DOACHASHMEE
    '\xab'     #  0xAB -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xac'     #  0xAC -> NOT SIGN
    '\xad'     #  0xAD -> SOFT HYPHEN
    '\xae'     #  0xAE -> REGISTERED SIGN
    '\xaf'     #  0xAF -> MACRON
    '\xb0'     #  0xB0 -> DEGREE SIGN
    '\xb1'     #  0xB1 -> PLUS-MINUS SIGN
    '\xb2'     #  0xB2 -> SUPERSCRIPT TWO
    '\xb3'     #  0xB3 -> SUPERSCRIPT THREE
    '\xb4'     #  0xB4 -> ACUTE ACCENT
    '\xb5'     #  0xB5 -> MICRO SIGN
    '\xb6'     #  0xB6 -> PILCROW SIGN
    '\xb7'     #  0xB7 -> MIDDLE DOT
    '\xb8'     #  0xB8 -> CEDILLA
    '\xb9'     #  0xB9 -> SUPERSCRIPT ONE
    '\u061b'   #  0xBA -> ARABIC SEMICOLON
    '\xbb'     #  0xBB -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbc'     #  0xBC -> VULGAR FRACTION ONE QUARTER
    '\xbd'     #  0xBD -> VULGAR FRACTION ONE HALF
    '\xbe'     #  0xBE -> VULGAR FRACTION THREE QUARTERS
    '\u061f'   #  0xBF -> ARABIC QUESTION MARK
    '\u06c1'   #  0xC0 -> ARABIC LETTER HEH GOAL
    '\u0621'   #  0xC1 -> ARABIC LETTER HAMZA
    '\u0622'   #  0xC2 -> ARABIC LETTER ALEF WITH MADDA ABOVE
    '\u0623'   #  0xC3 -> ARABIC LETTER ALEF WITH HAMZA ABOVE
    '\u0624'   #  0xC4 -> ARABIC LETTER WAW WITH HAMZA ABOVE
    '\u0625'   #  0xC5 -> ARABIC LETTER ALEF WITH HAMZA BELOW
    '\u0626'   #  0xC6 -> ARABIC LETTER YEH WITH HAMZA ABOVE
    '\u0627'   #  0xC7 -> ARABIC LETTER ALEF
    '\u0628'   #  0xC8 -> ARABIC LETTER BEH
    '\u0629'   #  0xC9 -> ARABIC LETTER TEH MARBUTA
    '\u062a'   #  0xCA -> ARABIC LETTER TEH
    '\u062b'   #  0xCB -> ARABIC LETTER THEH
    '\u062c'   #  0xCC -> ARABIC LETTER JEEM
    '\u062d'   #  0xCD -> ARABIC LETTER HAH
    '\u062e'   #  0xCE -> ARABIC LETTER KHAH
    '\u062f'   #  0xCF -> ARABIC LETTER DAL
    '\u0630'   #  0xD0 -> ARABIC LETTER THAL
    '\u0631'   #  0xD1 -> ARABIC LETTER REH
    '\u0632'   #  0xD2 -> ARABIC LETTER ZAIN
    '\u0633'   #  0xD3 -> ARABIC LETTER SEEN
    '\u0634'   #  0xD4 -> ARABIC LETTER SHEEN
    '\u0635'   #  0xD5 -> ARABIC LETTER SAD
    '\u0636'   #  0xD6 -> ARABIC LETTER DAD
    '\xd7'     #  0xD7 -> MULTIPLICATION SIGN
    '\u0637'   #  0xD8 -> ARABIC LETTER TAH
    '\u0638'   #  0xD9 -> ARABIC LETTER ZAH
    '\u0639'   #  0xDA -> ARABIC LETTER AIN
    '\u063a'   #  0xDB -> ARABIC LETTER GHAIN
    '\u0640'   #  0xDC -> ARABIC TATWEEL
    '\u0641'   #  0xDD -> ARABIC LETTER FEH
    '\u0642'   #  0xDE -> ARABIC LETTER QAF
    '\u0643'   #  0xDF -> ARABIC LETTER KAF
    '\xe0'     #  0xE0 -> LATIN SMALL LETTER A WITH GRAVE
    '\u0644'   #  0xE1 -> ARABIC LETTER LAM
    '\xe2'     #  0xE2 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\u0645'   #  0xE3 -> ARABIC LETTER MEEM
    '\u0646'   #  0xE4 -> ARABIC LETTER NOON
    '\u0647'   #  0xE5 -> ARABIC LETTER HEH
    '\u0648'   #  0xE6 -> ARABIC LETTER WAW
    '\xe7'     #  0xE7 -> LATIN SMALL LETTER C WITH CEDILLA
    '\xe8'     #  0xE8 -> LATIN SMALL LETTER E WITH GRAVE
    '\xe9'     #  0xE9 -> LATIN SMALL LETTER E WITH ACUTE
    '\xea'     #  0xEA -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xeb'     #  0xEB -> LATIN SMALL LETTER E WITH DIAERESIS
    '\u0649'   #  0xEC -> ARABIC LETTER ALEF MAKSURA
    '\u064a'   #  0xED -> ARABIC LETTER YEH
    '\xee'     #  0xEE -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\xef'     #  0xEF -> LATIN SMALL LETTER I WITH DIAERESIS
    '\u064b'   #  0xF0 -> ARABIC FATHATAN
    '\u064c'   #  0xF1 -> ARABIC DAMMATAN
    '\u064d'   #  0xF2 -> ARABIC KASRATAN
    '\u064e'   #  0xF3 -> ARABIC FATHA
    '\xf4'     #  0xF4 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\u064f'   #  0xF5 -> ARABIC DAMMA
    '\u0650'   #  0xF6 -> ARABIC KASRA
    '\xf7'     #  0xF7 -> DIVISION SIGN
    '\u0651'   #  0xF8 -> ARABIC SHADDA
    '\xf9'     #  0xF9 -> LATIN SMALL LETTER U WITH GRAVE
    '\u0652'   #  0xFA -> ARABIC SUKUN
    '\xfb'     #  0xFB -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\xfc'     #  0xFC -> LATIN SMALL LETTER U WITH DIAERESIS
    '\u200e'   #  0xFD -> LEFT-TO-RIGHT MARK
    '\u200f'   #  0xFE -> RIGHT-TO-LEFT MARK
    '\u06d2'   #  0xFF -> ARABIC LETTER YEH BARREE
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/koi8_t.py000064400000031611151153537620010276 0ustar00""" Python Character Mapping Codec koi8_t
"""
# http://ru.wikipedia.org/wiki/КОИ-8
# http://www.opensource.apple.com/source/libiconv/libiconv-4/libiconv/tests/KOI8-T.TXT

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='koi8-t',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\u049b'   #  0x80 -> CYRILLIC SMALL LETTER KA WITH DESCENDER
    '\u0493'   #  0x81 -> CYRILLIC SMALL LETTER GHE WITH STROKE
    '\u201a'   #  0x82 -> SINGLE LOW-9 QUOTATION MARK
    '\u0492'   #  0x83 -> CYRILLIC CAPITAL LETTER GHE WITH STROKE
    '\u201e'   #  0x84 -> DOUBLE LOW-9 QUOTATION MARK
    '\u2026'   #  0x85 -> HORIZONTAL ELLIPSIS
    '\u2020'   #  0x86 -> DAGGER
    '\u2021'   #  0x87 -> DOUBLE DAGGER
    '\ufffe'   #  0x88 -> UNDEFINED
    '\u2030'   #  0x89 -> PER MILLE SIGN
    '\u04b3'   #  0x8A -> CYRILLIC SMALL LETTER HA WITH DESCENDER
    '\u2039'   #  0x8B -> SINGLE LEFT-POINTING ANGLE QUOTATION MARK
    '\u04b2'   #  0x8C -> CYRILLIC CAPITAL LETTER HA WITH DESCENDER
    '\u04b7'   #  0x8D -> CYRILLIC SMALL LETTER CHE WITH DESCENDER
    '\u04b6'   #  0x8E -> CYRILLIC CAPITAL LETTER CHE WITH DESCENDER
    '\ufffe'   #  0x8F -> UNDEFINED
    '\u049a'   #  0x90 -> CYRILLIC CAPITAL LETTER KA WITH DESCENDER
    '\u2018'   #  0x91 -> LEFT SINGLE QUOTATION MARK
    '\u2019'   #  0x92 -> RIGHT SINGLE QUOTATION MARK
    '\u201c'   #  0x93 -> LEFT DOUBLE QUOTATION MARK
    '\u201d'   #  0x94 -> RIGHT DOUBLE QUOTATION MARK
    '\u2022'   #  0x95 -> BULLET
    '\u2013'   #  0x96 -> EN DASH
    '\u2014'   #  0x97 -> EM DASH
    '\ufffe'   #  0x98 -> UNDEFINED
    '\u2122'   #  0x99 -> TRADE MARK SIGN
    '\ufffe'   #  0x9A -> UNDEFINED
    '\u203a'   #  0x9B -> SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
    '\ufffe'   #  0x9C -> UNDEFINED
    '\ufffe'   #  0x9D -> UNDEFINED
    '\ufffe'   #  0x9E -> UNDEFINED
    '\ufffe'   #  0x9F -> UNDEFINED
    '\ufffe'   #  0xA0 -> UNDEFINED
    '\u04ef'   #  0xA1 -> CYRILLIC SMALL LETTER U WITH MACRON
    '\u04ee'   #  0xA2 -> CYRILLIC CAPITAL LETTER U WITH MACRON
    '\u0451'   #  0xA3 -> CYRILLIC SMALL LETTER IO
    '\xa4'     #  0xA4 -> CURRENCY SIGN
    '\u04e3'   #  0xA5 -> CYRILLIC SMALL LETTER I WITH MACRON
    '\xa6'     #  0xA6 -> BROKEN BAR
    '\xa7'     #  0xA7 -> SECTION SIGN
    '\ufffe'   #  0xA8 -> UNDEFINED
    '\ufffe'   #  0xA9 -> UNDEFINED
    '\ufffe'   #  0xAA -> UNDEFINED
    '\xab'     #  0xAB -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xac'     #  0xAC -> NOT SIGN
    '\xad'     #  0xAD -> SOFT HYPHEN
    '\xae'     #  0xAE -> REGISTERED SIGN
    '\ufffe'   #  0xAF -> UNDEFINED
    '\xb0'     #  0xB0 -> DEGREE SIGN
    '\xb1'     #  0xB1 -> PLUS-MINUS SIGN
    '\xb2'     #  0xB2 -> SUPERSCRIPT TWO
    '\u0401'   #  0xB3 -> CYRILLIC CAPITAL LETTER IO
    '\ufffe'   #  0xB4 -> UNDEFINED
    '\u04e2'   #  0xB5 -> CYRILLIC CAPITAL LETTER I WITH MACRON
    '\xb6'     #  0xB6 -> PILCROW SIGN
    '\xb7'     #  0xB7 -> MIDDLE DOT
    '\ufffe'   #  0xB8 -> UNDEFINED
    '\u2116'   #  0xB9 -> NUMERO SIGN
    '\ufffe'   #  0xBA -> UNDEFINED
    '\xbb'     #  0xBB -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\ufffe'   #  0xBC -> UNDEFINED
    '\ufffe'   #  0xBD -> UNDEFINED
    '\ufffe'   #  0xBE -> UNDEFINED
    '\xa9'     #  0xBF -> COPYRIGHT SIGN
    '\u044e'   #  0xC0 -> CYRILLIC SMALL LETTER YU
    '\u0430'   #  0xC1 -> CYRILLIC SMALL LETTER A
    '\u0431'   #  0xC2 -> CYRILLIC SMALL LETTER BE
    '\u0446'   #  0xC3 -> CYRILLIC SMALL LETTER TSE
    '\u0434'   #  0xC4 -> CYRILLIC SMALL LETTER DE
    '\u0435'   #  0xC5 -> CYRILLIC SMALL LETTER IE
    '\u0444'   #  0xC6 -> CYRILLIC SMALL LETTER EF
    '\u0433'   #  0xC7 -> CYRILLIC SMALL LETTER GHE
    '\u0445'   #  0xC8 -> CYRILLIC SMALL LETTER HA
    '\u0438'   #  0xC9 -> CYRILLIC SMALL LETTER I
    '\u0439'   #  0xCA -> CYRILLIC SMALL LETTER SHORT I
    '\u043a'   #  0xCB -> CYRILLIC SMALL LETTER KA
    '\u043b'   #  0xCC -> CYRILLIC SMALL LETTER EL
    '\u043c'   #  0xCD -> CYRILLIC SMALL LETTER EM
    '\u043d'   #  0xCE -> CYRILLIC SMALL LETTER EN
    '\u043e'   #  0xCF -> CYRILLIC SMALL LETTER O
    '\u043f'   #  0xD0 -> CYRILLIC SMALL LETTER PE
    '\u044f'   #  0xD1 -> CYRILLIC SMALL LETTER YA
    '\u0440'   #  0xD2 -> CYRILLIC SMALL LETTER ER
    '\u0441'   #  0xD3 -> CYRILLIC SMALL LETTER ES
    '\u0442'   #  0xD4 -> CYRILLIC SMALL LETTER TE
    '\u0443'   #  0xD5 -> CYRILLIC SMALL LETTER U
    '\u0436'   #  0xD6 -> CYRILLIC SMALL LETTER ZHE
    '\u0432'   #  0xD7 -> CYRILLIC SMALL LETTER VE
    '\u044c'   #  0xD8 -> CYRILLIC SMALL LETTER SOFT SIGN
    '\u044b'   #  0xD9 -> CYRILLIC SMALL LETTER YERU
    '\u0437'   #  0xDA -> CYRILLIC SMALL LETTER ZE
    '\u0448'   #  0xDB -> CYRILLIC SMALL LETTER SHA
    '\u044d'   #  0xDC -> CYRILLIC SMALL LETTER E
    '\u0449'   #  0xDD -> CYRILLIC SMALL LETTER SHCHA
    '\u0447'   #  0xDE -> CYRILLIC SMALL LETTER CHE
    '\u044a'   #  0xDF -> CYRILLIC SMALL LETTER HARD SIGN
    '\u042e'   #  0xE0 -> CYRILLIC CAPITAL LETTER YU
    '\u0410'   #  0xE1 -> CYRILLIC CAPITAL LETTER A
    '\u0411'   #  0xE2 -> CYRILLIC CAPITAL LETTER BE
    '\u0426'   #  0xE3 -> CYRILLIC CAPITAL LETTER TSE
    '\u0414'   #  0xE4 -> CYRILLIC CAPITAL LETTER DE
    '\u0415'   #  0xE5 -> CYRILLIC CAPITAL LETTER IE
    '\u0424'   #  0xE6 -> CYRILLIC CAPITAL LETTER EF
    '\u0413'   #  0xE7 -> CYRILLIC CAPITAL LETTER GHE
    '\u0425'   #  0xE8 -> CYRILLIC CAPITAL LETTER HA
    '\u0418'   #  0xE9 -> CYRILLIC CAPITAL LETTER I
    '\u0419'   #  0xEA -> CYRILLIC CAPITAL LETTER SHORT I
    '\u041a'   #  0xEB -> CYRILLIC CAPITAL LETTER KA
    '\u041b'   #  0xEC -> CYRILLIC CAPITAL LETTER EL
    '\u041c'   #  0xED -> CYRILLIC CAPITAL LETTER EM
    '\u041d'   #  0xEE -> CYRILLIC CAPITAL LETTER EN
    '\u041e'   #  0xEF -> CYRILLIC CAPITAL LETTER O
    '\u041f'   #  0xF0 -> CYRILLIC CAPITAL LETTER PE
    '\u042f'   #  0xF1 -> CYRILLIC CAPITAL LETTER YA
    '\u0420'   #  0xF2 -> CYRILLIC CAPITAL LETTER ER
    '\u0421'   #  0xF3 -> CYRILLIC CAPITAL LETTER ES
    '\u0422'   #  0xF4 -> CYRILLIC CAPITAL LETTER TE
    '\u0423'   #  0xF5 -> CYRILLIC CAPITAL LETTER U
    '\u0416'   #  0xF6 -> CYRILLIC CAPITAL LETTER ZHE
    '\u0412'   #  0xF7 -> CYRILLIC CAPITAL LETTER VE
    '\u042c'   #  0xF8 -> CYRILLIC CAPITAL LETTER SOFT SIGN
    '\u042b'   #  0xF9 -> CYRILLIC CAPITAL LETTER YERU
    '\u0417'   #  0xFA -> CYRILLIC CAPITAL LETTER ZE
    '\u0428'   #  0xFB -> CYRILLIC CAPITAL LETTER SHA
    '\u042d'   #  0xFC -> CYRILLIC CAPITAL LETTER E
    '\u0429'   #  0xFD -> CYRILLIC CAPITAL LETTER SHCHA
    '\u0427'   #  0xFE -> CYRILLIC CAPITAL LETTER CHE
    '\u042a'   #  0xFF -> CYRILLIC CAPITAL LETTER HARD SIGN
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/utf_16_be.py000064400000002015151153537620010647 0ustar00""" Python 'utf-16-be' Codec


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

"""
import codecs

### Codec APIs

encode = codecs.utf_16_be_encode

def decode(input, errors='strict'):
    return codecs.utf_16_be_decode(input, errors, True)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.utf_16_be_encode(input, self.errors)[0]

class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
    _buffer_decode = codecs.utf_16_be_decode

class StreamWriter(codecs.StreamWriter):
    encode = codecs.utf_16_be_encode

class StreamReader(codecs.StreamReader):
    decode = codecs.utf_16_be_decode

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='utf-16-be',
        encode=encode,
        decode=decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/cp1140.py000064400000031461151153537620010014 0ustar00""" Python Character Mapping Codec cp1140 generated from 'python-mappings/CP1140.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp1140',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x9c'     #  0x04 -> CONTROL
    '\t'       #  0x05 -> HORIZONTAL TABULATION
    '\x86'     #  0x06 -> CONTROL
    '\x7f'     #  0x07 -> DELETE
    '\x97'     #  0x08 -> CONTROL
    '\x8d'     #  0x09 -> CONTROL
    '\x8e'     #  0x0A -> CONTROL
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x9d'     #  0x14 -> CONTROL
    '\x85'     #  0x15 -> CONTROL
    '\x08'     #  0x16 -> BACKSPACE
    '\x87'     #  0x17 -> CONTROL
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x92'     #  0x1A -> CONTROL
    '\x8f'     #  0x1B -> CONTROL
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    '\x80'     #  0x20 -> CONTROL
    '\x81'     #  0x21 -> CONTROL
    '\x82'     #  0x22 -> CONTROL
    '\x83'     #  0x23 -> CONTROL
    '\x84'     #  0x24 -> CONTROL
    '\n'       #  0x25 -> LINE FEED
    '\x17'     #  0x26 -> END OF TRANSMISSION BLOCK
    '\x1b'     #  0x27 -> ESCAPE
    '\x88'     #  0x28 -> CONTROL
    '\x89'     #  0x29 -> CONTROL
    '\x8a'     #  0x2A -> CONTROL
    '\x8b'     #  0x2B -> CONTROL
    '\x8c'     #  0x2C -> CONTROL
    '\x05'     #  0x2D -> ENQUIRY
    '\x06'     #  0x2E -> ACKNOWLEDGE
    '\x07'     #  0x2F -> BELL
    '\x90'     #  0x30 -> CONTROL
    '\x91'     #  0x31 -> CONTROL
    '\x16'     #  0x32 -> SYNCHRONOUS IDLE
    '\x93'     #  0x33 -> CONTROL
    '\x94'     #  0x34 -> CONTROL
    '\x95'     #  0x35 -> CONTROL
    '\x96'     #  0x36 -> CONTROL
    '\x04'     #  0x37 -> END OF TRANSMISSION
    '\x98'     #  0x38 -> CONTROL
    '\x99'     #  0x39 -> CONTROL
    '\x9a'     #  0x3A -> CONTROL
    '\x9b'     #  0x3B -> CONTROL
    '\x14'     #  0x3C -> DEVICE CONTROL FOUR
    '\x15'     #  0x3D -> NEGATIVE ACKNOWLEDGE
    '\x9e'     #  0x3E -> CONTROL
    '\x1a'     #  0x3F -> SUBSTITUTE
    ' '        #  0x40 -> SPACE
    '\xa0'     #  0x41 -> NO-BREAK SPACE
    '\xe2'     #  0x42 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\xe4'     #  0x43 -> LATIN SMALL LETTER A WITH DIAERESIS
    '\xe0'     #  0x44 -> LATIN SMALL LETTER A WITH GRAVE
    '\xe1'     #  0x45 -> LATIN SMALL LETTER A WITH ACUTE
    '\xe3'     #  0x46 -> LATIN SMALL LETTER A WITH TILDE
    '\xe5'     #  0x47 -> LATIN SMALL LETTER A WITH RING ABOVE
    '\xe7'     #  0x48 -> LATIN SMALL LETTER C WITH CEDILLA
    '\xf1'     #  0x49 -> LATIN SMALL LETTER N WITH TILDE
    '\xa2'     #  0x4A -> CENT SIGN
    '.'        #  0x4B -> FULL STOP
    '<'        #  0x4C -> LESS-THAN SIGN
    '('        #  0x4D -> LEFT PARENTHESIS
    '+'        #  0x4E -> PLUS SIGN
    '|'        #  0x4F -> VERTICAL LINE
    '&'        #  0x50 -> AMPERSAND
    '\xe9'     #  0x51 -> LATIN SMALL LETTER E WITH ACUTE
    '\xea'     #  0x52 -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xeb'     #  0x53 -> LATIN SMALL LETTER E WITH DIAERESIS
    '\xe8'     #  0x54 -> LATIN SMALL LETTER E WITH GRAVE
    '\xed'     #  0x55 -> LATIN SMALL LETTER I WITH ACUTE
    '\xee'     #  0x56 -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\xef'     #  0x57 -> LATIN SMALL LETTER I WITH DIAERESIS
    '\xec'     #  0x58 -> LATIN SMALL LETTER I WITH GRAVE
    '\xdf'     #  0x59 -> LATIN SMALL LETTER SHARP S (GERMAN)
    '!'        #  0x5A -> EXCLAMATION MARK
    '$'        #  0x5B -> DOLLAR SIGN
    '*'        #  0x5C -> ASTERISK
    ')'        #  0x5D -> RIGHT PARENTHESIS
    ';'        #  0x5E -> SEMICOLON
    '\xac'     #  0x5F -> NOT SIGN
    '-'        #  0x60 -> HYPHEN-MINUS
    '/'        #  0x61 -> SOLIDUS
    '\xc2'     #  0x62 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    '\xc4'     #  0x63 -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\xc0'     #  0x64 -> LATIN CAPITAL LETTER A WITH GRAVE
    '\xc1'     #  0x65 -> LATIN CAPITAL LETTER A WITH ACUTE
    '\xc3'     #  0x66 -> LATIN CAPITAL LETTER A WITH TILDE
    '\xc5'     #  0x67 -> LATIN CAPITAL LETTER A WITH RING ABOVE
    '\xc7'     #  0x68 -> LATIN CAPITAL LETTER C WITH CEDILLA
    '\xd1'     #  0x69 -> LATIN CAPITAL LETTER N WITH TILDE
    '\xa6'     #  0x6A -> BROKEN BAR
    ','        #  0x6B -> COMMA
    '%'        #  0x6C -> PERCENT SIGN
    '_'        #  0x6D -> LOW LINE
    '>'        #  0x6E -> GREATER-THAN SIGN
    '?'        #  0x6F -> QUESTION MARK
    '\xf8'     #  0x70 -> LATIN SMALL LETTER O WITH STROKE
    '\xc9'     #  0x71 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\xca'     #  0x72 -> LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    '\xcb'     #  0x73 -> LATIN CAPITAL LETTER E WITH DIAERESIS
    '\xc8'     #  0x74 -> LATIN CAPITAL LETTER E WITH GRAVE
    '\xcd'     #  0x75 -> LATIN CAPITAL LETTER I WITH ACUTE
    '\xce'     #  0x76 -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    '\xcf'     #  0x77 -> LATIN CAPITAL LETTER I WITH DIAERESIS
    '\xcc'     #  0x78 -> LATIN CAPITAL LETTER I WITH GRAVE
    '`'        #  0x79 -> GRAVE ACCENT
    ':'        #  0x7A -> COLON
    '#'        #  0x7B -> NUMBER SIGN
    '@'        #  0x7C -> COMMERCIAL AT
    "'"        #  0x7D -> APOSTROPHE
    '='        #  0x7E -> EQUALS SIGN
    '"'        #  0x7F -> QUOTATION MARK
    '\xd8'     #  0x80 -> LATIN CAPITAL LETTER O WITH STROKE
    'a'        #  0x81 -> LATIN SMALL LETTER A
    'b'        #  0x82 -> LATIN SMALL LETTER B
    'c'        #  0x83 -> LATIN SMALL LETTER C
    'd'        #  0x84 -> LATIN SMALL LETTER D
    'e'        #  0x85 -> LATIN SMALL LETTER E
    'f'        #  0x86 -> LATIN SMALL LETTER F
    'g'        #  0x87 -> LATIN SMALL LETTER G
    'h'        #  0x88 -> LATIN SMALL LETTER H
    'i'        #  0x89 -> LATIN SMALL LETTER I
    '\xab'     #  0x8A -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbb'     #  0x8B -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xf0'     #  0x8C -> LATIN SMALL LETTER ETH (ICELANDIC)
    '\xfd'     #  0x8D -> LATIN SMALL LETTER Y WITH ACUTE
    '\xfe'     #  0x8E -> LATIN SMALL LETTER THORN (ICELANDIC)
    '\xb1'     #  0x8F -> PLUS-MINUS SIGN
    '\xb0'     #  0x90 -> DEGREE SIGN
    'j'        #  0x91 -> LATIN SMALL LETTER J
    'k'        #  0x92 -> LATIN SMALL LETTER K
    'l'        #  0x93 -> LATIN SMALL LETTER L
    'm'        #  0x94 -> LATIN SMALL LETTER M
    'n'        #  0x95 -> LATIN SMALL LETTER N
    'o'        #  0x96 -> LATIN SMALL LETTER O
    'p'        #  0x97 -> LATIN SMALL LETTER P
    'q'        #  0x98 -> LATIN SMALL LETTER Q
    'r'        #  0x99 -> LATIN SMALL LETTER R
    '\xaa'     #  0x9A -> FEMININE ORDINAL INDICATOR
    '\xba'     #  0x9B -> MASCULINE ORDINAL INDICATOR
    '\xe6'     #  0x9C -> LATIN SMALL LIGATURE AE
    '\xb8'     #  0x9D -> CEDILLA
    '\xc6'     #  0x9E -> LATIN CAPITAL LIGATURE AE
    '\u20ac'   #  0x9F -> EURO SIGN
    '\xb5'     #  0xA0 -> MICRO SIGN
    '~'        #  0xA1 -> TILDE
    's'        #  0xA2 -> LATIN SMALL LETTER S
    't'        #  0xA3 -> LATIN SMALL LETTER T
    'u'        #  0xA4 -> LATIN SMALL LETTER U
    'v'        #  0xA5 -> LATIN SMALL LETTER V
    'w'        #  0xA6 -> LATIN SMALL LETTER W
    'x'        #  0xA7 -> LATIN SMALL LETTER X
    'y'        #  0xA8 -> LATIN SMALL LETTER Y
    'z'        #  0xA9 -> LATIN SMALL LETTER Z
    '\xa1'     #  0xAA -> INVERTED EXCLAMATION MARK
    '\xbf'     #  0xAB -> INVERTED QUESTION MARK
    '\xd0'     #  0xAC -> LATIN CAPITAL LETTER ETH (ICELANDIC)
    '\xdd'     #  0xAD -> LATIN CAPITAL LETTER Y WITH ACUTE
    '\xde'     #  0xAE -> LATIN CAPITAL LETTER THORN (ICELANDIC)
    '\xae'     #  0xAF -> REGISTERED SIGN
    '^'        #  0xB0 -> CIRCUMFLEX ACCENT
    '\xa3'     #  0xB1 -> POUND SIGN
    '\xa5'     #  0xB2 -> YEN SIGN
    '\xb7'     #  0xB3 -> MIDDLE DOT
    '\xa9'     #  0xB4 -> COPYRIGHT SIGN
    '\xa7'     #  0xB5 -> SECTION SIGN
    '\xb6'     #  0xB6 -> PILCROW SIGN
    '\xbc'     #  0xB7 -> VULGAR FRACTION ONE QUARTER
    '\xbd'     #  0xB8 -> VULGAR FRACTION ONE HALF
    '\xbe'     #  0xB9 -> VULGAR FRACTION THREE QUARTERS
    '['        #  0xBA -> LEFT SQUARE BRACKET
    ']'        #  0xBB -> RIGHT SQUARE BRACKET
    '\xaf'     #  0xBC -> MACRON
    '\xa8'     #  0xBD -> DIAERESIS
    '\xb4'     #  0xBE -> ACUTE ACCENT
    '\xd7'     #  0xBF -> MULTIPLICATION SIGN
    '{'        #  0xC0 -> LEFT CURLY BRACKET
    'A'        #  0xC1 -> LATIN CAPITAL LETTER A
    'B'        #  0xC2 -> LATIN CAPITAL LETTER B
    'C'        #  0xC3 -> LATIN CAPITAL LETTER C
    'D'        #  0xC4 -> LATIN CAPITAL LETTER D
    'E'        #  0xC5 -> LATIN CAPITAL LETTER E
    'F'        #  0xC6 -> LATIN CAPITAL LETTER F
    'G'        #  0xC7 -> LATIN CAPITAL LETTER G
    'H'        #  0xC8 -> LATIN CAPITAL LETTER H
    'I'        #  0xC9 -> LATIN CAPITAL LETTER I
    '\xad'     #  0xCA -> SOFT HYPHEN
    '\xf4'     #  0xCB -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xf6'     #  0xCC -> LATIN SMALL LETTER O WITH DIAERESIS
    '\xf2'     #  0xCD -> LATIN SMALL LETTER O WITH GRAVE
    '\xf3'     #  0xCE -> LATIN SMALL LETTER O WITH ACUTE
    '\xf5'     #  0xCF -> LATIN SMALL LETTER O WITH TILDE
    '}'        #  0xD0 -> RIGHT CURLY BRACKET
    'J'        #  0xD1 -> LATIN CAPITAL LETTER J
    'K'        #  0xD2 -> LATIN CAPITAL LETTER K
    'L'        #  0xD3 -> LATIN CAPITAL LETTER L
    'M'        #  0xD4 -> LATIN CAPITAL LETTER M
    'N'        #  0xD5 -> LATIN CAPITAL LETTER N
    'O'        #  0xD6 -> LATIN CAPITAL LETTER O
    'P'        #  0xD7 -> LATIN CAPITAL LETTER P
    'Q'        #  0xD8 -> LATIN CAPITAL LETTER Q
    'R'        #  0xD9 -> LATIN CAPITAL LETTER R
    '\xb9'     #  0xDA -> SUPERSCRIPT ONE
    '\xfb'     #  0xDB -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\xfc'     #  0xDC -> LATIN SMALL LETTER U WITH DIAERESIS
    '\xf9'     #  0xDD -> LATIN SMALL LETTER U WITH GRAVE
    '\xfa'     #  0xDE -> LATIN SMALL LETTER U WITH ACUTE
    '\xff'     #  0xDF -> LATIN SMALL LETTER Y WITH DIAERESIS
    '\\'       #  0xE0 -> REVERSE SOLIDUS
    '\xf7'     #  0xE1 -> DIVISION SIGN
    'S'        #  0xE2 -> LATIN CAPITAL LETTER S
    'T'        #  0xE3 -> LATIN CAPITAL LETTER T
    'U'        #  0xE4 -> LATIN CAPITAL LETTER U
    'V'        #  0xE5 -> LATIN CAPITAL LETTER V
    'W'        #  0xE6 -> LATIN CAPITAL LETTER W
    'X'        #  0xE7 -> LATIN CAPITAL LETTER X
    'Y'        #  0xE8 -> LATIN CAPITAL LETTER Y
    'Z'        #  0xE9 -> LATIN CAPITAL LETTER Z
    '\xb2'     #  0xEA -> SUPERSCRIPT TWO
    '\xd4'     #  0xEB -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    '\xd6'     #  0xEC -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xd2'     #  0xED -> LATIN CAPITAL LETTER O WITH GRAVE
    '\xd3'     #  0xEE -> LATIN CAPITAL LETTER O WITH ACUTE
    '\xd5'     #  0xEF -> LATIN CAPITAL LETTER O WITH TILDE
    '0'        #  0xF0 -> DIGIT ZERO
    '1'        #  0xF1 -> DIGIT ONE
    '2'        #  0xF2 -> DIGIT TWO
    '3'        #  0xF3 -> DIGIT THREE
    '4'        #  0xF4 -> DIGIT FOUR
    '5'        #  0xF5 -> DIGIT FIVE
    '6'        #  0xF6 -> DIGIT SIX
    '7'        #  0xF7 -> DIGIT SEVEN
    '8'        #  0xF8 -> DIGIT EIGHT
    '9'        #  0xF9 -> DIGIT NINE
    '\xb3'     #  0xFA -> SUPERSCRIPT THREE
    '\xdb'     #  0xFB -> LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    '\xdc'     #  0xFC -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\xd9'     #  0xFD -> LATIN CAPITAL LETTER U WITH GRAVE
    '\xda'     #  0xFE -> LATIN CAPITAL LETTER U WITH ACUTE
    '\x9f'     #  0xFF -> CONTROL
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/iso8859_14.py000064400000032524151153537620010541 0ustar00""" Python Character Mapping Codec iso8859_14 generated from 'MAPPINGS/ISO8859/8859-14.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='iso8859-14',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\x80'     #  0x80 -> <control>
    '\x81'     #  0x81 -> <control>
    '\x82'     #  0x82 -> <control>
    '\x83'     #  0x83 -> <control>
    '\x84'     #  0x84 -> <control>
    '\x85'     #  0x85 -> <control>
    '\x86'     #  0x86 -> <control>
    '\x87'     #  0x87 -> <control>
    '\x88'     #  0x88 -> <control>
    '\x89'     #  0x89 -> <control>
    '\x8a'     #  0x8A -> <control>
    '\x8b'     #  0x8B -> <control>
    '\x8c'     #  0x8C -> <control>
    '\x8d'     #  0x8D -> <control>
    '\x8e'     #  0x8E -> <control>
    '\x8f'     #  0x8F -> <control>
    '\x90'     #  0x90 -> <control>
    '\x91'     #  0x91 -> <control>
    '\x92'     #  0x92 -> <control>
    '\x93'     #  0x93 -> <control>
    '\x94'     #  0x94 -> <control>
    '\x95'     #  0x95 -> <control>
    '\x96'     #  0x96 -> <control>
    '\x97'     #  0x97 -> <control>
    '\x98'     #  0x98 -> <control>
    '\x99'     #  0x99 -> <control>
    '\x9a'     #  0x9A -> <control>
    '\x9b'     #  0x9B -> <control>
    '\x9c'     #  0x9C -> <control>
    '\x9d'     #  0x9D -> <control>
    '\x9e'     #  0x9E -> <control>
    '\x9f'     #  0x9F -> <control>
    '\xa0'     #  0xA0 -> NO-BREAK SPACE
    '\u1e02'   #  0xA1 -> LATIN CAPITAL LETTER B WITH DOT ABOVE
    '\u1e03'   #  0xA2 -> LATIN SMALL LETTER B WITH DOT ABOVE
    '\xa3'     #  0xA3 -> POUND SIGN
    '\u010a'   #  0xA4 -> LATIN CAPITAL LETTER C WITH DOT ABOVE
    '\u010b'   #  0xA5 -> LATIN SMALL LETTER C WITH DOT ABOVE
    '\u1e0a'   #  0xA6 -> LATIN CAPITAL LETTER D WITH DOT ABOVE
    '\xa7'     #  0xA7 -> SECTION SIGN
    '\u1e80'   #  0xA8 -> LATIN CAPITAL LETTER W WITH GRAVE
    '\xa9'     #  0xA9 -> COPYRIGHT SIGN
    '\u1e82'   #  0xAA -> LATIN CAPITAL LETTER W WITH ACUTE
    '\u1e0b'   #  0xAB -> LATIN SMALL LETTER D WITH DOT ABOVE
    '\u1ef2'   #  0xAC -> LATIN CAPITAL LETTER Y WITH GRAVE
    '\xad'     #  0xAD -> SOFT HYPHEN
    '\xae'     #  0xAE -> REGISTERED SIGN
    '\u0178'   #  0xAF -> LATIN CAPITAL LETTER Y WITH DIAERESIS
    '\u1e1e'   #  0xB0 -> LATIN CAPITAL LETTER F WITH DOT ABOVE
    '\u1e1f'   #  0xB1 -> LATIN SMALL LETTER F WITH DOT ABOVE
    '\u0120'   #  0xB2 -> LATIN CAPITAL LETTER G WITH DOT ABOVE
    '\u0121'   #  0xB3 -> LATIN SMALL LETTER G WITH DOT ABOVE
    '\u1e40'   #  0xB4 -> LATIN CAPITAL LETTER M WITH DOT ABOVE
    '\u1e41'   #  0xB5 -> LATIN SMALL LETTER M WITH DOT ABOVE
    '\xb6'     #  0xB6 -> PILCROW SIGN
    '\u1e56'   #  0xB7 -> LATIN CAPITAL LETTER P WITH DOT ABOVE
    '\u1e81'   #  0xB8 -> LATIN SMALL LETTER W WITH GRAVE
    '\u1e57'   #  0xB9 -> LATIN SMALL LETTER P WITH DOT ABOVE
    '\u1e83'   #  0xBA -> LATIN SMALL LETTER W WITH ACUTE
    '\u1e60'   #  0xBB -> LATIN CAPITAL LETTER S WITH DOT ABOVE
    '\u1ef3'   #  0xBC -> LATIN SMALL LETTER Y WITH GRAVE
    '\u1e84'   #  0xBD -> LATIN CAPITAL LETTER W WITH DIAERESIS
    '\u1e85'   #  0xBE -> LATIN SMALL LETTER W WITH DIAERESIS
    '\u1e61'   #  0xBF -> LATIN SMALL LETTER S WITH DOT ABOVE
    '\xc0'     #  0xC0 -> LATIN CAPITAL LETTER A WITH GRAVE
    '\xc1'     #  0xC1 -> LATIN CAPITAL LETTER A WITH ACUTE
    '\xc2'     #  0xC2 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    '\xc3'     #  0xC3 -> LATIN CAPITAL LETTER A WITH TILDE
    '\xc4'     #  0xC4 -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\xc5'     #  0xC5 -> LATIN CAPITAL LETTER A WITH RING ABOVE
    '\xc6'     #  0xC6 -> LATIN CAPITAL LETTER AE
    '\xc7'     #  0xC7 -> LATIN CAPITAL LETTER C WITH CEDILLA
    '\xc8'     #  0xC8 -> LATIN CAPITAL LETTER E WITH GRAVE
    '\xc9'     #  0xC9 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\xca'     #  0xCA -> LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    '\xcb'     #  0xCB -> LATIN CAPITAL LETTER E WITH DIAERESIS
    '\xcc'     #  0xCC -> LATIN CAPITAL LETTER I WITH GRAVE
    '\xcd'     #  0xCD -> LATIN CAPITAL LETTER I WITH ACUTE
    '\xce'     #  0xCE -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    '\xcf'     #  0xCF -> LATIN CAPITAL LETTER I WITH DIAERESIS
    '\u0174'   #  0xD0 -> LATIN CAPITAL LETTER W WITH CIRCUMFLEX
    '\xd1'     #  0xD1 -> LATIN CAPITAL LETTER N WITH TILDE
    '\xd2'     #  0xD2 -> LATIN CAPITAL LETTER O WITH GRAVE
    '\xd3'     #  0xD3 -> LATIN CAPITAL LETTER O WITH ACUTE
    '\xd4'     #  0xD4 -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    '\xd5'     #  0xD5 -> LATIN CAPITAL LETTER O WITH TILDE
    '\xd6'     #  0xD6 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\u1e6a'   #  0xD7 -> LATIN CAPITAL LETTER T WITH DOT ABOVE
    '\xd8'     #  0xD8 -> LATIN CAPITAL LETTER O WITH STROKE
    '\xd9'     #  0xD9 -> LATIN CAPITAL LETTER U WITH GRAVE
    '\xda'     #  0xDA -> LATIN CAPITAL LETTER U WITH ACUTE
    '\xdb'     #  0xDB -> LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    '\xdc'     #  0xDC -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\xdd'     #  0xDD -> LATIN CAPITAL LETTER Y WITH ACUTE
    '\u0176'   #  0xDE -> LATIN CAPITAL LETTER Y WITH CIRCUMFLEX
    '\xdf'     #  0xDF -> LATIN SMALL LETTER SHARP S
    '\xe0'     #  0xE0 -> LATIN SMALL LETTER A WITH GRAVE
    '\xe1'     #  0xE1 -> LATIN SMALL LETTER A WITH ACUTE
    '\xe2'     #  0xE2 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\xe3'     #  0xE3 -> LATIN SMALL LETTER A WITH TILDE
    '\xe4'     #  0xE4 -> LATIN SMALL LETTER A WITH DIAERESIS
    '\xe5'     #  0xE5 -> LATIN SMALL LETTER A WITH RING ABOVE
    '\xe6'     #  0xE6 -> LATIN SMALL LETTER AE
    '\xe7'     #  0xE7 -> LATIN SMALL LETTER C WITH CEDILLA
    '\xe8'     #  0xE8 -> LATIN SMALL LETTER E WITH GRAVE
    '\xe9'     #  0xE9 -> LATIN SMALL LETTER E WITH ACUTE
    '\xea'     #  0xEA -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xeb'     #  0xEB -> LATIN SMALL LETTER E WITH DIAERESIS
    '\xec'     #  0xEC -> LATIN SMALL LETTER I WITH GRAVE
    '\xed'     #  0xED -> LATIN SMALL LETTER I WITH ACUTE
    '\xee'     #  0xEE -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\xef'     #  0xEF -> LATIN SMALL LETTER I WITH DIAERESIS
    '\u0175'   #  0xF0 -> LATIN SMALL LETTER W WITH CIRCUMFLEX
    '\xf1'     #  0xF1 -> LATIN SMALL LETTER N WITH TILDE
    '\xf2'     #  0xF2 -> LATIN SMALL LETTER O WITH GRAVE
    '\xf3'     #  0xF3 -> LATIN SMALL LETTER O WITH ACUTE
    '\xf4'     #  0xF4 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xf5'     #  0xF5 -> LATIN SMALL LETTER O WITH TILDE
    '\xf6'     #  0xF6 -> LATIN SMALL LETTER O WITH DIAERESIS
    '\u1e6b'   #  0xF7 -> LATIN SMALL LETTER T WITH DOT ABOVE
    '\xf8'     #  0xF8 -> LATIN SMALL LETTER O WITH STROKE
    '\xf9'     #  0xF9 -> LATIN SMALL LETTER U WITH GRAVE
    '\xfa'     #  0xFA -> LATIN SMALL LETTER U WITH ACUTE
    '\xfb'     #  0xFB -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\xfc'     #  0xFC -> LATIN SMALL LETTER U WITH DIAERESIS
    '\xfd'     #  0xFD -> LATIN SMALL LETTER Y WITH ACUTE
    '\u0177'   #  0xFE -> LATIN SMALL LETTER Y WITH CIRCUMFLEX
    '\xff'     #  0xFF -> LATIN SMALL LETTER Y WITH DIAERESIS
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/euc_jp.py000064400000002003151153537620010337 0ustar00#
# euc_jp.py: Python Unicode Codec for EUC_JP
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#

import _codecs_jp, codecs
import _multibytecodec as mbc

codec = _codecs_jp.getcodec('euc_jp')

class Codec(codecs.Codec):
    encode = codec.encode
    decode = codec.decode

class IncrementalEncoder(mbc.MultibyteIncrementalEncoder,
                         codecs.IncrementalEncoder):
    codec = codec

class IncrementalDecoder(mbc.MultibyteIncrementalDecoder,
                         codecs.IncrementalDecoder):
    codec = codec

class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader):
    codec = codec

class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
    codec = codec

def getregentry():
    return codecs.CodecInfo(
        name='euc_jp',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/__pycache__/punycode.cpython-38.opt-2.pyc000064400000013135151153537620016156 0ustar00U

e5d��@s�ddlZdd�Zdd�Zdd�Zdd	�Zd
d�ZdZd
d�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
Gdd�dej�ZGdd�dej�ZGdd �d ej�ZGd!d"�d"eej�ZGd#d$�d$eej�Zd%d&�ZdS)'�NcCsPt�}t�}|D]*}t|�dkr0|�t|��q|�|�qt|�}t|�|fS)N�)�	bytearray�set�ord�append�add�sorted�bytes)�str�base�extended�c�r�*/usr/lib64/python3.8/encodings/punycode.py�	segregate
srcCs&d}|D]}t|�|kr|d7}q|S)Nr�)r)r
�max�resr
rrr�
selective_lens

rcCsNt|�}|d7}||krdS||}||kr8|d|fS||kr|d7}qdS)Nr)���r)�len)r
�char�index�pos�lr
rrr�selective_findsrcCs�d}g}d}|D]r}d}}t|�}t||�}	|	d||}
t||||�\}}|dkrZq~|
||7}
|�|
d�|}d}
q>|}q|S)Nrrrr)rrrr)r
rZoldchar�resultZoldindexr
rrrZcurlen�deltarrr�insertion_unsort0s"
rcCs,d|d|}|dkrdS|dkr(dS|S)N�$r�r)�j�biasrrrr�TFsr#s$abcdefghijklmnopqrstuvwxyz0123456789cCsnt�}d}t||�}||kr2|�t|�t|�S|�t|||d|�||d|}|d7}q
dS)Nrrr)rr#r�digitsr	)�Nr"rr!�trrr�generate_generalized_integerNs
r'cCsX|r|d}n|d}|||7}d}|dkr@|d}|d7}q&|d||d}|S)Ni��ri��#r�&r)r�first�numcharsZ	divisionsr"rrr�adapt[s

r-cCsPt�}d}t|�D]4\}}t||�}|�|�t||dk||d�}qt|�S)N�Hrr)r�	enumerater'�extendr-r	)Zbaselen�deltasrr"Zpointsr�srrr�generate_integersjs

r3cCs8t|�\}}t||�}tt|�|�}|r4|d|S|S)N�-)rrr3r)�textrrr1rrr�punycode_encodeus
r6c
Csd}d}d}zt||�}Wn0tk
rL|dkr<td��|ddfYSX|d7}d|krjdkrxnn
|d}nHd|kr�dkr�nn
|d	}n&|dkr�td
||d��n|dfSt||�}	|||7}||	kr�||fS|d|	}|d7}qdS)Nrr�strictzincomplete punicode string�A�Z�0�9�z Invalid extended code point '%s'r)r�
IndexError�UnicodeErrorr#)
r�extposr"�errorsr�wr!r�digitr&rrr�decode_generalized_numbers2


�
rCc	Cs�d}d}d}d}|t|�kr�t||||�\}}|dkr:|S||d7}||t|�d7}|dkr~|dkrvtd|��td	�}|t|�d}|d|�t|�||d�}t||dkt|��}|}q|S)
Nrrr.rri��r7zInvalid character U+%x�?)rrCr>r�chrr-)	rrr@rrr"r?Znewposrrrr�insertion_sort�s,� rFcCs�t|t�r|�d�}t|t�r&t|�}|�d�}|dkrLd}t|d���}n.t|d|�d|�}t||dd�d���}t|||�S)N�asciir4r�r)�
isinstancer
�encode�
memoryviewr	�rfind�upperrF)r5r@rrrrrr�punycode_decode�s



rNc@s eZdZddd�Zddd�ZdS)	�Codecr7cCst|�}|t|�fS�N)r6r��self�inputr@rrrrrJ�szCodec.encodecCs*|dkrtd|��t||�}|t|�fS�N)r7�replace�ignorezUnsupported error handling )r>rNrrQrrr�decode�s
zCodec.decodeN)r7)r7)�__name__�
__module__�__qualname__rJrWrrrrrO�s
rOc@seZdZddd�ZdS)�IncrementalEncoderFcCst|�SrP)r6�rRrS�finalrrrrJ�szIncrementalEncoder.encodeN)F)rXrYrZrJrrrrr[�sr[c@seZdZddd�ZdS)�IncrementalDecoderFcCs$|jdkrtd|j��t||j�SrT)r@r>rNr\rrrrW�s
zIncrementalDecoder.decodeN)F)rXrYrZrWrrrrr^�sr^c@seZdZdS)�StreamWriterN�rXrYrZrrrrr_�sr_c@seZdZdS)�StreamReaderNr`rrrrra�srac	Cs tjdt�jt�jttttd�S)NZpunycode)�namerJrW�incrementalencoder�incrementaldecoder�streamwriter�streamreader)	�codecs�	CodecInforOrJrWr[r^r_rarrrr�getregentry�s�ri)rgrrrrr#r$r'r-r3r6rCrFrNrOr[r^r_rarirrrr�<module>s&

encodings/__pycache__/mac_latin2.cpython-38.opt-2.pyc000064400000004424151153537620016342 0ustar00U

e5d&7�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�,/usr/lib64/python3.8/encodings/mac_latin2.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
rs
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
r!src	Cs tjdt�jt�jttttd�S)Nz
mac-latin2)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry&s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ)
rrrrrrr#r�
charmap_buildrrrrr
�<module>
s�encodings/__pycache__/cp850.cpython-38.pyc000064400000016525151153537620014235 0ustar00U

e5d9��@sdZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�dd(d�d;�ddhd�d}dtd'd�dmd9d6d`dHdd+d4d|ddd!d#d3d�d&d�d~d:d>d2d�d�dvd�d�d�d�d�ddr�ddsdpdxd)d.d-d5dNdVddd�d�d�dddd�dd1dd0�dd��dd"�d�d�d�d �d!�d"�d#�d$�d%d=�d&�d'dad_�d(dM�d)d�d*d$�d+�d,d,�d-�d.dd�d/du�d0d%dd�dyd8dGd{dWddFdEddfd7d d?ddd<dnd�dcdbdgdqd*dzd�d�d�dw�d1��Z
dS(2z` Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP850.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp850.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp850)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$�������������������������������������������������������������������������������%�%�%�%�$%������c%�Q%�W%�]%���%�%�4%�,%�%�%�<%�����Z%�T%�i%�f%�`%�P%�l%������������1�������%�%�%�%����%����������������������������� ������������%�)���������������������������������r�rSrcrBrurdr�r�r�r^rLrTrPr�rOr�r�r�r�r�r�r�r�r�r�r�rMrUrRrQr�rNr]r[r\rmr4r5r8r&rzr6rxryr�r|r}r~rwrKr�r�r�r�r?rDrCr�r�r�r@r�r�r�r+rFr)rlr*r,r7r-r0r(r.r/r3rGr2r1rvrJr;rHr9r�r:r�rAr=rIr<r'r�r�r>u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�(rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDr�rSrcrBrurdr�r�r�r^rLrTrPr�rOr�r�r�r�r�r�r�r�r�r�r�rMrUrRrQr�rNr]r[r\rmr4r5r8r&rzr6rxryr�r|r}r~rwrKr�r�r�r�r?rDrCr�r�r�r@r�r�r�r+rFr)rlr*r,r7r-r0r(r.r/r3rGr2r1rvrJr;rHr9r�r:r�rAr=rIr<r'r�r�r>r{rEr�rjrYr�rerfrrirZrhrgrkrsr`rorarnrbrrr_rqrprtr�r�r�rVrWrXr�)�__doc__rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s$
����encodings/__pycache__/cp857.cpython-38.opt-1.pyc000064400000016501151153537620015175 0ustar00U

e5dt���@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddddedfdgdhdidjdkdldmdndodpdqdrdsdtduddvdwdxdydzd{d|d}d~ddd�d�d�d�d�d�d�d�d�d�d�d�d���d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�ddzd}d;�d
dgd�ddsd'd�d5d9da�ddHdd+d4�dddd!d#d3d�d&�dd{d:d>d2d�d�dud�d�d�d�d�ddq�ddrdo�dd)dvd-dNdVddd�dd�dddd�dd0�dd��dd"�d�d�d�d �d!�d"�d#�d$�d%d=�d&�d'd_�d(dM�d)d�d*d$�d+�d,d,�d-�d.d1dld��d/�d0�d1�d2dd�dwd8dGdydWd|dFdEdded`d d?ddd<dmd�dcdbdfdpd*dxd�d~d��d3�d4��Z
dS(5z` Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP857.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp857.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp857)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$���������������������������1������������������0���������^�_����������������������%�%�%�%�$%������c%�Q%�W%�]%���%�%�4%�,%�%�%�<%�����Z%�T%�i%�f%�`%�P%�l%����������������%�%�%�%����%�������������������������������������%�)��������������������������������r�rSrcrBrurdr�r�r�r^rwrTrPr�rOr�r�r�r�r�r�r�r�r�r�r�rvrUrRrQr�rNr]r[r\rmr4r5r8r&rzr6rxryr�r{r|r}��rKr�r�r�r�r?r�rCr�r�r�r@����r�r+rFr)rlr*r,r7r-r0r(r.r/rGr2r1��rJr;rHr9r�r:r�rAr=rIr<r'��r�u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ￾ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ￾×ÚÛÙìÿ¯´­±￾¾¶§÷¸°¨·¹³²■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r���r�r�r�r�r�r�r�r�r�r�r�r�r�r�)�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFr�rSrcrBrurdr�r�r�r^rwrTrPr�rOr�r�r�r�r�r�r�r�r�r�r�rvrUrRrQr�rNr]r[r\rmr4r5r8r&rzr6rxryr�r{r|r}rKr�r�r�r�r?r�rCr�r�r�r@r�r+rFr)rlr*r,r7r-r0r(r.r/rGrGr2r1rJr;rHr9r�r:r�rAr=rIr<r'r�rLrMr>r3rDrErjrYrrerfr~rirZrhrgrkrsr`rorarnrbrrr_rqrprtr�r�r�rVrWrXr�)�__doc__rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s
����encodings/__pycache__/big5.cpython-38.pyc000064400000002603151153537620014214 0ustar00U

e5d��@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�big5c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�&/usr/lib64/python3.8/encodings/big5.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_twrZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/utf_32.cpython-38.pyc000064400000011237151153537620014473 0ustar00U

e5d	�@sxdZddlZddlZejZddd�ZGdd�dej�ZGdd	�d	ej�ZGd
d�dej	�Z	Gdd
�d
ej
�Z
dd�ZdS)z
Python 'utf-32' Codec
�N�strictcCst�||d�S)NT)�codecs�
utf_32_decode)�input�errors�r�(/usr/lib64/python3.8/encodings/utf_32.py�decode
sr	c@s8eZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
S)�IncrementalEncoderrcCstj�||�d|_dS�N)rr
�__init__�encoder��selfrrrrrszIncrementalEncoder.__init__FcCsN|jdkr<t�||j�d}tjdkr0tj|_ntj|_|S|�||j�dS)Nr�little)r
r�
utf_32_encoder�sys�	byteorder�utf_32_le_encode�utf_32_be_encode)rr�final�resultrrr�encodes


zIncrementalEncoder.encodecCstj�|�d|_dSr)rr
�resetr
�rrrrrszIncrementalEncoder.resetcCs|jdkrdSdS)N�r)r
rrrr�getstate szIncrementalEncoder.getstatecCs,|rd|_ntjdkr tj|_ntj|_dS�Nr)r
rrrrr�r�staterrr�setstate's


zIncrementalEncoder.setstateN)r)F)�__name__�
__module__�__qualname__rrrrr rrrrr

s



r
c@s6eZdZd
dd�Zdd�Zdd�Zdd	�Zd
d�ZdS)�IncrementalDecoderrcCstj�||�d|_dSr)r�BufferedIncrementalDecoderr�decoderrrrrr1szIncrementalDecoder.__init__cCsl|jdkr\t�||d|�\}}}|dkr2tj|_n"|dkrDtj|_n|dkrTtd��||fS|�||j|�S)Nr������%UTF-32 stream does not start with BOM)r&r�utf_32_ex_decode�utf_32_le_decode�utf_32_be_decode�UnicodeErrorr)rrrr�output�consumedrrrr�_buffer_decode5s
�

z!IncrementalDecoder._buffer_decodecCstj�|�d|_dSr)rr%rr&rrrrrBszIncrementalDecoder.resetcCsDtj�|�d}|jdkr"|dfSttjdk|jtjkk�}||fS)Nrr�big)rr%rr&�intrrr-)rrZaddstaterrrrFs


�zIncrementalDecoder.getstatecCsdtj�||�|d}|dkr8tjdkr.tjntj|_n(|dkrZtjdkrPtjntj|_nd|_dS)Nr(rr2)rr%r rrr-r,r&rrrrr Ts����zIncrementalDecoder.setstateN)r)r!r"r#rr1rrr rrrrr$0s


r$c@s(eZdZd	dd�Zdd�Zd
dd�ZdS)�StreamWriterrcCsd|_tj�|||�dSr)r
rr4r)r�streamrrrrrdszStreamWriter.__init__cCstj�|�d|_dSr)rr4rr
rrrrrhszStreamWriter.resetcCsF|jdkr6t�||�}tjdkr*tj|_ntj|_|S|�||�SdSr)r
rrrrrr)rrrrrrrrls


zStreamWriter.encodeN)r)r)r!r"r#rrrrrrrr4cs
r4c@seZdZdd�Zddd�ZdS)�StreamReadercCs.tj�|�z|`Wntk
r(YnXdSr)rr6rr	�AttributeErrorrrrrrys
zStreamReader.resetrcCsRt�||dd�\}}}|dkr(tj|_n"|dkr:tj|_n|dkrJtd��||fS)NrFr'r(r)r*)rr+r,r	r-r.)rrr�objectr0rrrrr	�s�

zStreamReader.decodeN)r)r!r"r#rr	rrrrr6wsr6c	Cstjdttttttd�S)Nzutf-32)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)r�	CodecInforr	r
r$r6r4rrrr�getregentry�s�r?)r)�__doc__rrrrr	r
r%r$r4r6r?rrrr�<module>s
#3encodings/__pycache__/mac_farsi.cpython-38.pyc000064400000004544151153537620015320 0ustar00U

e5dB;�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zo Python Character Mapping Codec mac_farsi generated from 'MAPPINGS/VENDORS/APPLE/FARSI.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/mac_farsi.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	mac-farsi)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#uh	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Ä ÇÉÑÖÜáàâäں«çéèêëí…îïñó»ôö÷úùûü !"#$٪&'()*+،-./۰۱۲۳۴۵۶۷۸۹:؛<=>؟❊ءآأؤإئابةتثجحخدذرزسشصضطظعغ[\]^_ـفقكلمنهوىيًٌٍَُِّْپٹچەڤگڈڑ{|}ژے)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/aliases.cpython-38.opt-2.pyc000064400000013154151153537620015752 0ustar00U

e5dM=�G@s�ddddddddddddddddddddddddddddddddddddd	d	d
d
ddddd
d
ddddddddddddddddddddddddddddddddddddddddddddddddddddddd d d d!d!d!d"d"d"d#d#d#d#d$d$d$d$d%d%d%d&d&d'd'd'd(d)d)d)d*d*d*d*d*d*d*d+d,d,d,d,d,d,d,d,d-d-d-d.d/d/d/d/d/d0d0d0d1d1d1d2d2d3d3d4d4d5d5d6d6d7d7d7d8d8d8d8d8d8d9d9d9d:d:d:d;d;d;d;d;d;d<d<d<d=d=d=d=d=d>d>d>d>d>d>d?d?d?d?d?d?d@d@d@d@d@d@dAdAdAdAdAdBdBdBdBdBdBdBdCdCdCdCdCdCdCdCdDdDdDdDdDdEdEdEdEdEdEdFdFdGdHdHdHdIdIdIdIdIdIdIdIdIdIdIdIdJdKdLdMdMdNdNdOdPdPdQdQdQdQdRdRdRdSdTdTdTdTdUdUdUdVdVdVdWdXdXdXdXdXdYdYdZdZd[d[d\d\d]d^d_d_d_d`d`d`d`d`d`dadbdbdTd*d,ddc��FZddS)e�ascii�base64_codec�big5�	big5hkscs�	bz2_codec�cp037�cp1026�cp1125�cp1140�cp1250�cp1251�cp1252�cp1253�cp1254�cp1255�cp1256�cp1257�cp1258�cp273�cp424�cp437�cp500�cp775�cp850�cp852�cp855�cp857�cp858�cp860�cp861�cp862�cp863�cp864�cp865�cp866�cp869�cp932�cp949�cp950�euc_jis_2004�euc_jisx0213�euc_jp�euc_kr�gb18030�gb2312�gbk�	hex_codec�	hp_roman8�hz�
iso2022_jp�iso2022_jp_1�iso2022_jp_2�iso2022_jp_2004�iso2022_jp_3�iso2022_jp_ext�
iso2022_kr�
iso8859_10�
iso8859_11�
iso8859_13�
iso8859_14�
iso8859_15�
iso8859_16�	iso8859_2�	iso8859_3�	iso8859_4�	iso8859_5�	iso8859_6�	iso8859_7�	iso8859_8�	iso8859_9�johab�koi8_r�kz1048�latin_1�mac_cyrillic�	mac_greek�mac_iceland�
mac_latin2�	mac_roman�mac_turkish�mbcs�ptcp154�quopri_codec�rot_13�	shift_jis�shift_jis_2004�shift_jisx0213�tactis�tis_620�utf_16�	utf_16_be�	utf_16_le�utf_32�	utf_32_be�	utf_32_le�utf_7�utf_8�uu_codec�
zlib_codec(F�646zansi_x3.4_1968�ansi_x3_4_1968zansi_x3.4_1986�cp367�csascii�ibm367�	iso646_usziso_646.irv_1991�iso_ir_6�us�us_ascii�base64�base_64�big5_tw�csbig5�
big5_hkscs�hkscs�bz2�037�csibm037�ebcdic_cp_ca�ebcdic_cp_nl�ebcdic_cp_us�ebcdic_cp_wt�ibm037�ibm039�1026�	csibm1026�ibm1026�1125�ibm1125�cp866u�ruscii�1140�ibm1140�1250�windows_1250�1251�windows_1251�1252�windows_1252�1253�windows_1253�1254�windows_1254�1255�windows_1255�1256�windows_1256�1257�windows_1257�1258�windows_1258�273�ibm273�csibm273�424�csibm424�ebcdic_cp_he�ibm424�437�cspc8codepage437�ibm437�500�csibm500�ebcdic_cp_be�ebcdic_cp_ch�ibm500�775�
cspc775baltic�ibm775�850�cspc850multilingual�ibm850�852�cspcp852�ibm852�855�csibm855�ibm855�857�csibm857�ibm857�858�csibm858�ibm858�860�csibm860�ibm860�861�cp_is�csibm861�ibm861�862�cspc862latinhebrew�ibm862�863�csibm863�ibm863�864�csibm864�ibm864�865�csibm865�ibm865�866�csibm866�ibm866�869�cp_gr�csibm869�ibm869�932�ms932�mskanji�ms_kanji�949�ms949�uhc�950�ms950�jisx0213�
eucjis2004�euc_jis2004�eucjisx0213�eucjp�ujis�u_jis�euckr�korean�ksc5601�	ks_c_5601�ks_c_5601_1987�ksx1001�	ks_x_1001�gb18030_2000�chinese�csiso58gb231280�euc_cn�euccn�eucgb2312_cn�gb2312_1980�	gb2312_80�	iso_ir_58�936�cp936�ms936�hex�roman8�r8�
csHPRoman8�cp1051�ibm1051�hzgb�hz_gb�
hz_gb_2312�csiso2022jp�	iso2022jp�iso_2022_jp�iso2022jp_1�
iso_2022_jp_1�iso2022jp_2�
iso_2022_jp_2�iso_2022_jp_2004�iso2022jp_2004�iso2022jp_3�
iso_2022_jp_3�
iso2022jp_ext�iso_2022_jp_ext�csiso2022kr�	iso2022kr�iso_2022_kr�csisolatin6�iso_8859_10�iso_8859_10_1992�
iso_ir_157�l6�latin6�thai�iso_8859_11�iso_8859_11_2001�iso_8859_13�l7�latin7�iso_8859_14�iso_8859_14_1998�
iso_celtic�
iso_ir_199�l8�latin8�iso_8859_15�l9�latin9�iso_8859_16�iso_8859_16_2001�
iso_ir_226�l10�latin10�csisolatin2�
iso_8859_2�iso_8859_2_1987�
iso_ir_101�l2�latin2�csisolatin3�
iso_8859_3�iso_8859_3_1988�
iso_ir_109�l3�latin3�csisolatin4�
iso_8859_4�iso_8859_4_1988�
iso_ir_110�l4�latin4�csisolatincyrillic�cyrillic�
iso_8859_5�iso_8859_5_1988�
iso_ir_144�arabic�asmo_708�csisolatinarabic�ecma_114�
iso_8859_6�iso_8859_6_1987�
iso_ir_127�csisolatingreek�ecma_118�elot_928�greek�greek8�
iso_8859_7�iso_8859_7_1987�
iso_ir_126�csisolatinhebrew�hebrew�
iso_8859_8�iso_8859_8_1988�
iso_ir_138�csisolatin5�
iso_8859_9�iso_8859_9_1989�
iso_ir_148�l5�latin5�cp1361�ms1361�cskoi8r�kz_1048�rk1048�
strk1048_2002�8859�cp819�csisolatin1�ibm819�iso8859�	iso8859_1�
iso_8859_1�iso_8859_1_1987�
iso_ir_100�l1�latin�latin1�maccyrillic�macgreek�
maciceland�maccentraleurope�	maclatin2�	macintosh�macroman�
macturkish�ansi�dbcs�	csptcp154�pt154�cp154�cyrillic_asian�quopri�quoted_printable�quotedprintable�rot13�
csshiftjis�shiftjis�sjis�s_jis�shiftjis2004�	sjis_2004�
s_jis_2004�
shiftjisx0213�	sjisx0213�
s_jisx0213�tis260�tis620�	tis_620_0�tis_620_2529_0�tis_620_2529_1�
iso_ir_166�u16�utf16�unicodebigunmarked�utf_16be�unicodelittleunmarked�utf_16le�u32�utf32�utf_32be�utf_32le�u7�utf7�unicode_1_1_utf_7�u8�utf�utf8�	utf8_ucs2�	utf8_ucs4�cp65001�uu�zip�zlib�x_mac_japanese�x_mac_korean�x_mac_simp_chinese�x_mac_trad_chineseN)�aliases�r�r��)/usr/lib64/python3.8/encodings/aliases.py�<module>s�	�����encodings/__pycache__/koi8_t.cpython-38.opt-1.pyc000064400000004522151153537620015524 0ustar00U

e5d�3�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)z' Python Character Mapping Codec koi8_t
�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/koi8_t.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r
s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nzkoi8-t)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry"s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~қғ‚Ғ„…†‡￾‰ҳ‹ҲҷҶ￾Қ‘’“”•–—￾™￾›￾￾￾￾￾ӯӮё¤ӣ¦§￾￾￾«¬­®￾°±²Ё￾Ӣ¶·￾№￾»￾￾￾©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/iso8859_5.cpython-38.opt-1.pyc000064400000004570151153537620015706 0ustar00U

e5d�2�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zj Python Character Mapping Codec iso8859_5 generated from 'MAPPINGS/ISO8859/8859-5.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/iso8859_5.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	iso8859-5)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/euc_jis_2004.cpython-38.opt-1.pyc000064400000002623151153537620016415 0ustar00U

e5d�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�euc_jis_2004c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�./usr/lib64/python3.8/encodings/euc_jis_2004.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_jprZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/cp273.cpython-38.opt-2.pyc000064400000004365151153537620015173 0ustar00U

e5d47�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp273.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp273)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�œ	†—Ž
…‡’€‚ƒ„
ˆ‰Š‹Œ‘“”•–˜™š›ž  â{àáãåçñÄ.<(+!&éêëèíîïì~Ü$*);^-/Â[ÀÁÃÅÇÑö,%_>?øÉÊËÈÍÎÏÌ`:#§'="Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µßstuvwxyz¡¿ÐÝÞ®¢£¥·©@¶¼½¾¬|‾¨´×äABCDEFGHI­ô¦òóõüJKLMNOPQR¹û}ùúÿÖ÷STUVWXYZ²Ô\ÒÓÕ0123456789³Û]Ùڟ)
rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp869.cpython-38.pyc000064400000017272151153537620014247 0ustar00U

e5dŀ��@shdZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�dddddddddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�dd5�d�d�d�d�d�d�d�d�d�d �d!�d"dd|d�d�d#ddw�d$�d%d�d&d2�d'�d(�d)�d*�d+�d,�d-�d.�d/�d0�d1�d2�d3�d4�d5�d6�d7�d8�d9�d:�d;�d<�d=�d>�d?�d@�dA�dB�dC�dD�dE�dF�dG�dH�dI�dJ�dK�dL�dM�dN�dO�dPd��dQ�dRd#�dS�dT�dU�dV�dWd!�dX�dY�dZ�d[�d\�d]�d^�d_�d`�da�db�dcd6�dd�de�df�dg�dh�di�dj�dk�dl�dmddxd �dn�do��Z
dS(pz` Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP869.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp869.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp869)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$������ � �� �����������������������������������%�%�%�%�$%�����c%�Q%�W%�]%���%�%�4%�,%�%�%�<%���Z%�T%�i%�f%�`%�P%�l%�����������%�%�%�%���%�����������������������������������������%�)���������������������������������r���r9��r)r�r�r4�rKr(r���r�r�r6r7���r'���rL�rH���������������������������������������������������������������������������������������������������������������������u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~￾￾￾￾￾￾Ά￾·¬¦‘’Έ―ΉΊΪΌ￾￾ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�rr�r�rrr�r�r�r�rr�r�r�r�r�r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r	r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrr�r
r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r)�rr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwrxryrzr{r|r}r~rr�r�r�r�r�r�r�r�r�r�r�r�r�r9r)r�r�r4rKr(r�r�r�r6r7r'rLrHr�r�r&r,r.r/r1r2r5r>rArBrCrDrErFrGrIrJrRrSrTrUrZr[rcrdrlrmrnrorprqrrr0r3r8r:r;r<r�rsrtrurzr{r}r~rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r=r�r?r@r�r-r*r+rarPrwr\r]rvr`rQr_r^rbrjrWrfrXrerYrirVrhrgrkr|ryrxrMrNrOr�)�__doc__rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s
����encodings/__pycache__/mac_croatian.cpython-38.opt-1.pyc000064400000004646151153537620016756 0ustar00U

e5dA5�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zu Python Character Mapping Codec mac_croatian generated from 'MAPPINGS/VENDORS/APPLE/CROATIAN.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�./usr/lib64/python3.8/encodings/mac_croatian.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nzmac-croatian)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/latin_1.cpython-38.pyc000064400000003547151153537620014725 0ustar00U

e5d��@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�ZGd
d�dee�Zdd�ZdS)z� Python 'latin-1' Codec


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

�Nc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codecs�latin_1_encode�encode�latin_1_decode�decode�rr�)/usr/lib64/python3.8/encodings/latin_1.pyr
src@seZdZddd�ZdS)�IncrementalEncoderFcCst�||j�dS�Nr)rr�errors��self�input�finalrrrrszIncrementalEncoder.encodeN)F)rrrrrrrrr
sr
c@seZdZddd�ZdS)�IncrementalDecoderFcCst�||j�dSr)rr	rrrrrr
szIncrementalDecoder.decodeN)F)rrrr
rrrrrsrc@seZdZdS)�StreamWriterN�rrrrrrrrsrc@seZdZdS)�StreamReaderNrrrrrrsrc@seZdZejZejZdS)�StreamConverterN)rrrrr	rrr
rrrrr"src	Cstjdtjtjttttd�S)Nz	iso8859-1)�namerr
�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrr
r
rrrrrrr�getregentry)s�r)	�__doc__rrr
rrrrrrrrr�<module>sencodings/__pycache__/iso8859_16.cpython-38.opt-1.pyc000064400000004576151153537620015776 0ustar00U

e5d�4�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zl Python Character Mapping Codec iso8859_16 generated from 'MAPPINGS/ISO8859/8859-16.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�,/usr/lib64/python3.8/encodings/iso8859_16.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz
iso8859-16)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Чš©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/hp_roman8.cpython-38.pyc000064400000005101151153537620015255 0ustar00U

e5d�4�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)a- Python Character Mapping Codec generated from 'hp_roman8.txt' with gencodec.py.

    Based on data from ftp://dkuug.dk/i18n/charmaps/HP-ROMAN8 (Keld Simonsen)

    Original source: LaserJet IIP Printer User's Manual HP part no
    33471-90901, Hewlet-Packard, June 1989.

    (Used with permission)

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/hp_roman8.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
rs
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
r src@seZdZdS)�StreamReaderNrrrrr
r#src	Cs tjdt�jt�jttttd�S)Nz	hp-roman8)�namerr�incrementalencoder�incrementaldecoder�streamwriter�streamreader)	r�	CodecInforrrrrrrrrrr
�getregentry(s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±￾)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp860.cpython-38.pyc000064400000017223151153537620014232 0ustar00U

e5dy��@sRdZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�dd6�dd4�d�dd3�d�dd:d>�d�d�d�d�d �d!�d"�d#�d$�d%�d&�d'�d(�d)�d*�d+�d,�d-�d.d0�d/d��d0�d1�d2�d3�d4�d5�d6d=�d7�d8d+�d9�d:�d;�d<d,�d=dd�d>ddd�d?�d@d�dAdd1d�dBd'�dCd�dDd��dEd2d%d#d$�dF�dGd&d8d!d-d�dHdd�dIdd7d)�dJd �dKd�d?dd/d"�dLd;d<�dMdd(dv�dN�dOd5d9�dP�dQ�dRd�dS�dT�dUdqd*�dV�dW�dXd�d�d��dY�dZ��Z
dS([z` Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP860.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp860.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp860)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$������������������������������������������������������� �������������������������%�%�%�%�$%�a%�b%�V%�U%�c%�Q%�W%�]%�\%�[%�%�%�4%�,%�%�%�<%�^%�_%�Z%�T%�i%�f%�`%�P%�l%�g%�h%�d%�e%�Y%�X%�R%�S%�k%�j%�%�%�%�%�%�%�%����������������"����)"�a"��e"�d"� #�!#��H"��"��"� ��%�)���������������������������������r�rSrArB������rLrTrP���r�r�r���r��r���rMrUrRrQ�rNr7r,r5r4������r&r8r6r/��r>r1������rKrOrEr2r?������rCr<��r@����r�r+rFr)r*������r-r0r(r.��r3rG������rJr;rHr9r:�r��r=rI�r'���u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�(rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmr�rSrArBrLrTrPr�r�r�r�r�rMrUrRrQrNr7r,r5r4r&r8r6r/r>r1rKrOrEr2r?rCr<r@r�r+rFr)r*r-r0r(r.r3rGrJr;rHr9r:r�r=rIr'r�r�r�r�r�r�r�r�r�r�r�r�r�rDr�r�r�r�r�r�r�r�r�r�rjrYr�rerfrrirZrhrgrkrsr`r{r|ror^r]rarzryrnrdrcrbrlrmrrr[r\r_rwrxrqrurvrpr~r}rtr�r�r�r�r�rVrWrXr�)�__doc__rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s$
����encodings/__pycache__/shift_jisx0213.cpython-38.pyc000064400000002627151153537620016054 0ustar00U

e5d#�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�shift_jisx0213c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�0/usr/lib64/python3.8/encodings/shift_jisx0213.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_jprZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/utf_16.cpython-38.opt-2.pyc000064400000011167151153537620015437 0ustar00U

e5dt�@stddlZddlZejZddd�ZGdd�dej�ZGdd�dej�ZGd	d
�d
ej�ZGdd�dej	�Z	d
d�Z
dS)�N�strictcCst�||d�S)NT)�codecs�
utf_16_decode)�input�errors�r�(/usr/lib64/python3.8/encodings/utf_16.py�decodesr	c@s8eZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
S)�IncrementalEncoderrcCstj�||�d|_dS�N)rr
�__init__�encoder��selfrrrrrszIncrementalEncoder.__init__FcCsN|jdkr<t�||j�d}tjdkr0tj|_ntj|_|S|�||j�dS)Nr�little)r
r�
utf_16_encoder�sys�	byteorder�utf_16_le_encode�utf_16_be_encode)rr�final�resultrrr�encodes


zIncrementalEncoder.encodecCstj�|�d|_dSr)rr
�resetr
�rrrrr!szIncrementalEncoder.resetcCs|jdkrdSdS)N�r)r
rrrr�getstate%szIncrementalEncoder.getstatecCs,|rd|_ntjdkr tj|_ntj|_dS�Nr)r
rrrrr�r�staterrr�setstate,s


zIncrementalEncoder.setstateN)r)F)�__name__�
__module__�__qualname__rrrrr rrrrr
s



r
c@s6eZdZd
dd�Zdd�Zdd�Zdd	�Zd
d�ZdS)�IncrementalDecoderrcCstj�||�d|_dSr)r�BufferedIncrementalDecoderr�decoderrrrrr6szIncrementalDecoder.__init__cCsl|jdkr\t�||d|�\}}}|dkr2tj|_n"|dkrDtj|_n|dkrTtd��||fS|�||j|�S)Nr����r�%UTF-16 stream does not start with BOM)r&r�utf_16_ex_decode�utf_16_le_decode�utf_16_be_decode�UnicodeErrorr)rrrr�output�consumedrrrr�_buffer_decode:s
�

z!IncrementalDecoder._buffer_decodecCstj�|�d|_dSr)rr%rr&rrrrrGszIncrementalDecoder.resetcCsDtj�|�d}|jdkr"|dfSttjdk|jtjkk�}||fS)Nrr�big)rr%rr&�intrrr,)rrZaddstaterrrrKs


�zIncrementalDecoder.getstatecCsdtj�||�|d}|dkr8tjdkr.tjntj|_n(|dkrZtjdkrPtjntj|_nd|_dS)Nr(rr1)rr%r rrr,r+r&rrrrr Ys����zIncrementalDecoder.setstateN)r)r!r"r#rr0rrr rrrrr$5s


r$c@s(eZdZd	dd�Zdd�Zd
dd�ZdS)�StreamWriterrcCstj�|||�d|_dSr)rr3rr
)r�streamrrrrriszStreamWriter.__init__cCstj�|�d|_dSr)rr3rr
rrrrrmszStreamWriter.resetcCsF|jdkr6t�||�}tjdkr*tj|_ntj|_|S|�||�SdSr)r
rrrrrr)rrrrrrrrqs


zStreamWriter.encodeN)r)r)r!r"r#rrrrrrrr3hs
r3c@seZdZdd�Zddd�ZdS)�StreamReadercCs.tj�|�z|`Wntk
r(YnXdSr)rr5rr	�AttributeErrorrrrrr~s
zStreamReader.resetrcCsRt�||dd�\}}}|dkr(tj|_n"|dkr:tj|_n|dkrJtd��||fS)NrFr'r(rr))rr*r+r	r,r-)rrr�objectr/rrrrr	�s�

zStreamReader.decodeN)r)r!r"r#rr	rrrrr5|sr5c	Cstjdttttttd�S)Nzutf-16)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)r�	CodecInforr	r
r$r5r3rrrr�getregentry�s�r>)r)rrrrr	r
r%r$r3r5r>rrrr�<module>	s
#3encodings/__pycache__/cp500.cpython-38.pyc000064400000004570151153537620014222 0ustar00U

e5dA3�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zs Python Character Mapping Codec cp500 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP500.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp500.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp500)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�œ	†—Ž
…‡’€‚ƒ„
ˆ‰Š‹Œ‘“”•–˜™š›ž  âäàáãåçñ[.<(+!&éêëèíîïìß]$*);^-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'="Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®¢£¥·©§¶¼½¾¬|¯¨´×{ABCDEFGHI­ôöòóõ}JKLMNOPQR¹ûüùúÿ\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙڟ)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/iso2022_jp_3.cpython-38.opt-1.pyc000064400000002630151153537620016340 0ustar00U

e5d%�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�iso2022_jp_3c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�./usr/lib64/python3.8/encodings/iso2022_jp_3.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z_codecs_iso2022rZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/rot_13.cpython-38.pyc000064400000005673151153537620014507 0ustar00U

e5d�	�7@s dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdD�4�dEdF�Ze
dGk�rddlZeejej�dS)Hz� Python Character Mapping Codec for ROT13.

This codec de/encodes from str to str.

Written by Marc-Andre Lemburg (mal@lemburg.com).
�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�|t�t|�fS�N��str�	translate�	rot13_map�len��self�input�errors�r�(/usr/lib64/python3.8/encodings/rot_13.py�encodeszCodec.encodecCst�|t�t|�fSrrr
rrr�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrrr
s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�|t�Sr�rrr�rr�finalrrrrszIncrementalEncoder.encodeN)F)rrrrrrrrrsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�|t�SrrrrrrrszIncrementalDecoder.decodeN)F)rrrrrrrrrsrc@seZdZdS)�StreamWriterN�rrrrrrrrsrc@seZdZdS)�StreamReaderNrrrrrrsrc
Cs"tjdt�jt�jttttdd�S)N�rot-13F)�namerr�incrementalencoder�incrementaldecoder�streamwriter�streamreader�_is_text_encoding)	�codecs�	CodecInforrrrrrrrrrr�getregentry$s�r&��N�O�P�Q�R�S�T�U�V�W�X�Y�Z�A�B�C�D�E�F�G�H�I�J�K�L�M�n�o�p�q�r�s�t�u�v�w�x�y�z�a�b�c�d�e�f�g�h�i�j�k�l�m)4r5r6r7r8r9r:r;r<r=r>r?r@rAr(r)r*r+r,r-r.r/r0r1r2r3r4rOrPrQrRrSrTrUrVrWrXrYrZr[rBrCrDrErFrGrHrIrJrKrLrMrNcCs|�t�|��d��dS)Nr)�writer$r�read)ZinfileZoutfilerrr�rot13lsr^�__main__)�__doc__r$rrrrrr&�make_identity_dict�ranger�updater^r�sys�stdin�stdoutrrrr�<module>s��9
encodings/__pycache__/bz2_codec.cpython-38.pyc000064400000006334151153537620015225 0ustar00U

e5d��@s�dZddlZddlZddd�Zddd�ZGdd	�d	ej�ZGd
d�dej�ZGdd
�d
ej�ZGdd�deej�ZGdd�deej	�Z	dd�Z
dS)aPython 'bz2_codec' Codec - bz2 compression encoding.

This codec de/encodes from bytes to bytes and is therefore usable with
bytes.transform() and bytes.untransform().

Adapted by Raymond Hettinger from zlib_codec.py which was written
by Marc-Andre Lemburg (mal@lemburg.com).
�N�strictcCs|dkst�t�|�t|�fS�Nr)�AssertionError�bz2�compress�len��input�errors�r�+/usr/lib64/python3.8/encodings/bz2_codec.py�
bz2_encodesr
cCs|dkst�t�|�t|�fSr)rr�
decompressrrrrr�
bz2_decodesrc@s eZdZddd�Zddd�ZdS)	�CodecrcCs
t||�S�N)r
��selfr	r
rrr�encodeszCodec.encodecCs
t||�Sr)rrrrr�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrrrs
rc@s(eZdZd
dd�Zddd�Zdd�Zd	S)�IncrementalEncoderrcCs |dkst�||_t��|_dSr)rr
r�
BZ2Compressor�compressobj�rr
rrr�__init__szIncrementalEncoder.__init__FcCs.|r|j�|�}||j��S|j�|�SdSr)rr�flush)rr	�final�crrrr#szIncrementalEncoder.encodecCst��|_dSr)rrr�rrrr�reset*szIncrementalEncoder.resetN)r)F)rrrrrr"rrrrrs

rc@s(eZdZd
dd�Zddd�Zdd�Zd	S)�IncrementalDecoderrcCs |dkst�||_t��|_dSr)rr
r�BZ2Decompressor�
decompressobjrrrrr.szIncrementalDecoder.__init__FcCs*z|j�|�WStk
r$YdSXdS)N�)r%r�EOFError)rr	rrrrr3szIncrementalDecoder.decodecCst��|_dSr)rr$r%r!rrrr"9szIncrementalDecoder.resetN)r)F)rrrrrr"rrrrr#-s

r#c@seZdZeZdS)�StreamWriterN�rrr�bytes�charbuffertyperrrrr(<sr(c@seZdZeZdS)�StreamReaderNr)rrrrr,?sr,c
Cstjdttttttdd�S)NrF)�namerr�incrementalencoder�incrementaldecoder�streamwriter�streamreader�_is_text_encoding)�codecs�	CodecInfor
rrr#r(r,rrrr�getregentryDs�r5)r)r)�__doc__r3rr
rrrr#r(r,r5rrrr�<module>s	

encodings/__pycache__/ptcp154.cpython-38.opt-2.pyc000064400000004402151153537620015525 0ustar00U

e5d�6�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�)/usr/lib64/python3.8/encodings/ptcp154.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
rs
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
r!src	Cs tjdt�jt�jttttd�S)N�ptcp154)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry&s�r$u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя)
rrrrrrr$r�
charmap_buildrrrrr
�<module>
s�encodings/__pycache__/cp737.cpython-38.opt-1.pyc000064400000017752151153537620015203 0ustar00U

e5dy��@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d �d!�d"�d#�d$�d%�d&�d'�d(�d)�d*�d+�d,�d-�d.�d/�d0�d1�d2�d3�d4�d5�d6�d7�d8�d9�d:�d;�d<�d=�d>�d?�d@�dA�dB�dCd��dD�dE�dF�dG�dH�dI�dJ�dK�dL�dM�dN�dO�dP�dQ�dR�dS�dT�dU�dV�dW�dX�dY�dZ�d[d��d\�d]�d^�d_�d`�da�db�dc�dd�de�df�dg�dh�di�dj�dk�dl�dm�dnd��do�dp�dq�dr�ds�dt�du�dv�dw�dx�dy�dz�d{�d|�d}�d~�d�d��d��d��d��d��d��d��d��d��d�d�d�d��d��d���Z
dS(�zf Python Character Mapping Codec cp737 generated from 'VENDORS/MICSFT/PC/CP737.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp737.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)NZcp737)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#���������������������������������������������������������%�%�%�%�$%�a%�b%�V%�U%�c%�Q%�W%�]%�\%�[%�%�%�4%�,%�%�%�<%�^%�_%�Z%�T%�i%�f%�`%�P%�l%�g%�h%�d%�e%�Y%�X%�R%�S%�k%�j%�%�%�%�%�%�%�%�������������������������e"�d"����H"��"��"� ��%�)���������������������������������r����������������r�r�r�����r�������������������������������������������������������������������������������������������������������������������r���������u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�rrrrrrr
rrr
rrrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrr	rrrrrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r(rrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwrxryrzr{r|r}r~rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r�r�r�r�r�r�r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrOrNrPrQrRrSrTr�r�r�r�r�r�r�r�r�r�r�r�rirXrrdrer~rhrYrgrfrjrrr_rzr{rnr]r\r`ryrxrmrcrbrarkrlrqrZr[r^rvrwrprtruror}r|rsr�r�r�r�r�rUrVrWr�)�__doc__rrrrrrr#�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s$
����encodings/__pycache__/cp856.cpython-38.pyc000064400000004666151153537620014246 0ustar00U

e5d�0�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zj Python Character Mapping Codec cp856 generated from 'MAPPINGS/VENDORS/MISC/CP856.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp856.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)NZcp856)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~אבגדהוזחטיךכלםמןנסעףפץצקרשת￾£￾×￾￾￾￾￾￾￾￾￾￾®¬½¼￾«»░▒▓│┤￾￾￾©╣║╗╝¢¥┐└┴┬├─┼￾￾╚╔╩╦╠═╬¤￾￾￾￾￾￾￾￾￾┘┌█▄¦￾▀￾￾￾￾￾￾µ￾￾￾￾￾￾￾¯´­±‗¾¶§÷¸°¨·¹³²■ )�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/mac_turkish.cpython-38.opt-1.pyc000064400000004640151153537620016641 0ustar00U

e5d�4�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zs Python Character Mapping Codec mac_turkish generated from 'MAPPINGS/VENDORS/APPLE/TURKISH.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�-/usr/lib64/python3.8/encodings/mac_turkish.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nzmac-turkish)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/hex_codec.cpython-38.opt-2.pyc000064400000004073151153537620016252 0ustar00U

e5d��@s�ddlZddlZddd�Zddd�ZGdd�dej�ZGd	d
�d
ej�ZGdd�dej�ZGd
d�deej�ZGdd�deej�Zdd�Z	dS)�N�strictcCst�|�t|�fS�N)�binascii�b2a_hex�len��input�errors�r
�+/usr/lib64/python3.8/encodings/hex_codec.py�
hex_encode
srcCst�|�t|�fSr)r�a2b_hexrrr
r
r�
hex_decodesrc@s eZdZddd�Zddd�ZdS)	�CodecrcCs
t||�Sr)r��selfrr	r
r
r�encodeszCodec.encodecCs
t||�Sr)rrr
r
r�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrr
r
r
rrs
rc@seZdZddd�ZdS)�IncrementalEncoderFcCs
t�|�Sr)rr�rr�finalr
r
rrszIncrementalEncoder.encodeN)F)rrrrr
r
r
rrsrc@seZdZddd�ZdS)�IncrementalDecoderFcCs
t�|�Sr)rr
rr
r
rr!szIncrementalDecoder.decodeN)F)rrrrr
r
r
rr src@seZdZeZdS)�StreamWriterN�rrr�bytes�charbuffertyper
r
r
rr%src@seZdZeZdS)�StreamReaderNrr
r
r
rr(src
Cstjdttttttdd�S)N�hexF)�namerr�incrementalencoder�incrementaldecoder�streamwriter�streamreader�_is_text_encoding)�codecs�	CodecInforrrrrrr
r
r
r�getregentry-s�r))r)r)
r'rrrrrrrrr)r
r
r
r�<module>s

encodings/__pycache__/koi8_r.cpython-38.opt-1.pyc000064400000004653151153537620015527 0ustar00U

e5d�5�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zl Python Character Mapping Codec koi8_r generated from 'MAPPINGS/VENDORS/MISC/KOI8-R.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/koi8_r.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nzkoi8-r)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/koi8_u.cpython-38.opt-2.pyc000064400000004446151153537620015533 0ustar00U

e5d�5�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/koi8_u.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nzkoi8-u)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ)
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/shift_jisx0213.cpython-38.opt-2.pyc000064400000002627151153537620017014 0ustar00U

e5d#�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�shift_jisx0213c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�0/usr/lib64/python3.8/encodings/shift_jisx0213.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_jprZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/oem.cpython-38.pyc000064400000002766151153537620014160 0ustar00U

e5d��@s~dZddlmZmZddlZeZddd�ZGdd�dej�ZGd	d
�d
ej�ZGdd�dej	�Z	Gd
d�dej
�Z
dd�ZdS)z! Python 'oem' Codec for Windows

�)�
oem_encode�
oem_decodeN�strictcCst||d�S)NT)r)�input�errors�r�%/usr/lib64/python3.8/encodings/oem.py�decodesr	c@seZdZddd�ZdS)�IncrementalEncoderFcCst||j�dS)Nr)rr)�selfr�finalrrr�encodeszIncrementalEncoder.encodeN)F)�__name__�
__module__�__qualname__r
rrrrr
sr
c@seZdZeZdS)�IncrementalDecoderN)rrrr�_buffer_decoderrrrrsrc@seZdZeZdS)�StreamWriterN)rrrrr
rrrrrsrc@seZdZeZdS)�StreamReaderN)rrrrr	rrrrrsrc	Cstjdttttttd�S)NZoem)�namer
r	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)�codecs�	CodecInfor
r	r
rrrrrrr�getregentry s�r)r)�__doc__rrrr
r	r
�BufferedIncrementalDecoderrrrrrrrr�<module>s
encodings/__pycache__/euc_kr.cpython-38.pyc000064400000002607151153537620014642 0ustar00U

e5d�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�euc_krc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�(/usr/lib64/python3.8/encodings/euc_kr.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_krrZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/charmap.cpython-38.opt-2.pyc000064400000005047151153537620015746 0ustar00U

e5d$�@srddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdS)�Nc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codecs�charmap_encode�encode�charmap_decode�decode�rr�)/usr/lib64/python3.8/encodings/charmap.pyrsrc@s eZdZddd�Zd	dd�ZdS)
�IncrementalEncoder�strictNcCstj�||�||_dS�N)rr
�__init__�mapping��self�errorsrrrrrszIncrementalEncoder.__init__FcCst�||j|j�dS�Nr)rrrr�r�input�finalrrrrszIncrementalEncoder.encode)rN)F�rrrrrrrrrr
s
r
c@s eZdZddd�Zd	dd�ZdS)
�IncrementalDecoderrNcCstj�||�||_dSr)rrrrrrrrr!szIncrementalDecoder.__init__FcCst�||j|j�dSr)rr	rrrrrrr
%szIncrementalDecoder.decode)rN)F�rrrrr
rrrrr s
rc@s eZdZddd�Zddd�ZdS)	�StreamWriterrNcCstj�|||�||_dSr)rrrr�r�streamrrrrrr*szStreamWriter.__init__cCst�|||j�Sr)rrr�rrrrrrr.szStreamWriter.encode)rN)rrrrrrr(s
rc@s eZdZddd�Zddd�ZdS)	�StreamReaderrNcCstj�|||�||_dSr)rr rrrrrrr3szStreamReader.__init__cCst�|||j�Sr)rr
rrrrrr
7szStreamReader.decode)rN)rrrrrrr 1s
r c	Cstjdtjtjttttd�S)N�charmap)�namerr
�incrementalencoder�incrementaldecoder�streamwriter�streamreader)	r�	CodecInforrr
r
rrr rrrr�getregentry<s�r()rrr
rrr r(rrrr�<module>
s	encodings/__pycache__/shift_jis.cpython-38.opt-1.pyc000064400000002615151153537620016312 0ustar00U

e5d�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�	shift_jisc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�+/usr/lib64/python3.8/encodings/shift_jis.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_jprZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/shift_jisx0213.cpython-38.opt-1.pyc000064400000002627151153537620017013 0ustar00U

e5d#�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�shift_jisx0213c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�0/usr/lib64/python3.8/encodings/shift_jisx0213.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_jprZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/euc_kr.cpython-38.opt-2.pyc000064400000002607151153537620015602 0ustar00U

e5d�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�euc_krc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�(/usr/lib64/python3.8/encodings/euc_kr.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_krrZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/iso8859_8.cpython-38.opt-1.pyc000064400000004636151153537620015714 0ustar00U

e5d+�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zj Python Character Mapping Codec iso8859_8 generated from 'MAPPINGS/ISO8859/8859-8.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/iso8859_8.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	iso8859-8)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ￾¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾‗אבגדהוזחטיךכלםמןנסעףפץצקרשת￾￾‎‏￾)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/oem.cpython-38.opt-2.pyc000064400000002704151153537620015110 0ustar00U

e5d��@szddlmZmZddlZeZddd�ZGdd�dej�ZGdd	�d	ej�ZGd
d�dej�ZGdd
�d
ej	�Z	dd�Z
dS)�)�
oem_encode�
oem_decodeN�strictcCst||d�S)NT)r)�input�errors�r�%/usr/lib64/python3.8/encodings/oem.py�decodesr	c@seZdZddd�ZdS)�IncrementalEncoderFcCst||j�dS)Nr)rr)�selfr�finalrrr�encodeszIncrementalEncoder.encodeN)F)�__name__�
__module__�__qualname__r
rrrrr
sr
c@seZdZeZdS)�IncrementalDecoderN)rrrr�_buffer_decoderrrrrsrc@seZdZeZdS)�StreamWriterN)rrrrr
rrrrrsrc@seZdZeZdS)�StreamReaderN)rrrrr	rrrrrsrc	Cstjdttttttd�S)NZoem)�namer
r	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)�codecs�	CodecInfor
r	r
rrrrrrr�getregentry s�r)r)rrrr
r	r
�BufferedIncrementalDecoderrrrrrrrr�<module>s
encodings/__pycache__/cp855.cpython-38.opt-1.pyc000064400000017713151153537620015201 0ustar00U

e5d:��@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d �d!�d"�d#�d$�d%�d&�d'd�d��d(�d)�d*�d+�d,�d-�d.�d/�d0�d1�d2�d3�d4�d5�d6d>�d7�d8�d9�d:�d;�d<�d=�d>�d?�d@�dAd��dB�dC�dD�dE�dF�dG�dH�dI�dJ�dK�dL�dM�dN�dO�dP�dQ�dR�dS�dT�dU�dVd_�dW�dX�dY�dZ�d[�d\�d]�d^�d_�d`�da�db�dc�dd�de�df�dg�dh�di�dj�dk�dl�dm�dn�do�dp�dq�dr�ds�dt�du�dv�dw�dx�dy�dz�d{�d|d?�d}�d~�d�d��d��d��d��d��d��d��d��d��d��d��d���Z
dS(�z` Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP855.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp855.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp855)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$��R��S��Q��T��U��V��W��X��Y�	�Z�
�[��\��^��_��N�.�J�*�0��1��F�&�4��5��D�$�3����%�%�%�%�$%�E�%�8��c%�Q%�W%�]%�9��%�%�4%�,%�%�%�<%�:��Z%�T%�i%�f%�`%�P%�l%��;��<��=��>��?�%�%�%�%��O�%�/�@� �A�!�B�"�C�#�6��2��L�,�!��K�+�7��H�(�M�-�I�)�G�'��%�)���������������������������������r����ru��r����rT�r��������������rU�����������������������������������������������������������������������������������������������������������������������u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�rr�rr�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r
rr�r�r�r�r�r�r�r�rrrrr�r�rrrr�rrrr�rr�rr�r�r�r	rr�r�r�r�r�r�r�r�rrrrr�r�rrrr�rr
rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r(rr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwrxryrzr{r|r}r~rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rur�rTr�rUr+r'r)r-r/r1r3r5r7r9r;r=r?rArGrIr�rSrMrOr�r�r^rdrmrwryr{r}r�r�r�r�r�rQr\rKr�r�r�rEr�r�r�rCr�rFrHr�rRrLrNr�r�r]rcrlrvrxrzr|r~r�r�r�r�rPr[rJr�r�r�rDr�r�r�rBr�r*r&r(r,r.r0r2r4r6r8r:r<r>r@r�rjrYr�rerfrrirZrhrgrkrsr`rorarnrbrrr_rqrprtr�r�r�rVrWrXr�)�__doc__rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s$
����encodings/__pycache__/cp437.cpython-38.pyc000064400000017250151153537620014232 0ustar00U

e5d��@sVdZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�dd(�d�d�d�d�d�dd6�dd4�dd!d3�d�dd:d>�d�d�d�d�d�d d-�d!�d"d0�d#d��d$�d%�d&�d'�d(�d)�d*�d+�d,�d-d=�d.�d/�d0�d1d+�d2�d3d$�d4d,�d5�d6�d7�d8dddddddd�d9ddd1d�d:d'd&ddd��d;d2d%�d<d#�d=d�d>�d?d8�d@�dA�dB�dC�dD�dEd�dFd7�dGd)d �dHd�d?�dI�dJ�dK�dLd;d<d"d�dMdv�dN�dOd5�dP�dQ�dR�dS�dT�dU�dV�dWdqd*�dX�dY�dZd�d�d��d[�d\��Z
dS(]zf Python Character Mapping Codec cp437 generated from 'VENDORS/MICSFT/PC/CP437.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp437.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp437)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$������������������������������������������������������ ����������������#�������%�%�%�%�$%�a%�b%�V%�U%�c%�Q%�W%�]%�\%�[%�%�%�4%�,%�%�%�<%�^%�_%�Z%�T%�i%�f%�`%�P%�l%�g%�h%�d%�e%�Y%�X%�R%�S%�k%�j%�%�%�%�%�%�%�%����������������"����)"�a"��e"�d"� #�!#��H"��"��"� ��%�)���������������������������������r�rSrArB�rC����rLrTrP���r�r�r���r��r���rMrUrRrQ�rN������r4r5r8r&��r6��������������rK��������r?����������r@����r�r+rFr)��r*r,r7r-r0r(r.r/r3rGr2r1��rJr;rHr9�r:r��r=rIr<r'��r>u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�(rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnror�rSrArBrCrLrTrPr�r�r�r�r�rMrUrRrQrNr4r5r8r&r6rKr?r@r�r+rFr)r*r,r7r-r0r(r.r/r3rGr2r1rJr;rHr9r:r�r=rIr<r'r>rEr�r�r�r�r�r�r�r�r�r�r�r�r�rDr�r�r�r�r�r�r�r�rOr�r�rjrYr�rerfrrirZrhrgrkrsr`r{r|ror^r]rarzryrnrdrcrbrlrmrrr[r\r_rwrxrqrurvrpr~r}rtr�r�r�r�r�rVrWrXr�)�__doc__rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s$
����encodings/__pycache__/mac_cyrillic.cpython-38.opt-2.pyc000064400000004426151153537620016765 0ustar00U

e5d�4�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�./usr/lib64/python3.8/encodings/mac_cyrillic.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nzmac-cyrillic)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю€)
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/iso8859_7.cpython-38.opt-1.pyc000064400000004577151153537620015717 0ustar00U

e5d,2�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zj Python Character Mapping Codec iso8859_7 generated from 'MAPPINGS/ISO8859/8859-7.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/iso8859_7.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	iso8859-7)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­￾―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ￾ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ￾)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp737.cpython-38.pyc000064400000017752151153537620014244 0ustar00U

e5dy��@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d �d!�d"�d#�d$�d%�d&�d'�d(�d)�d*�d+�d,�d-�d.�d/�d0�d1�d2�d3�d4�d5�d6�d7�d8�d9�d:�d;�d<�d=�d>�d?�d@�dA�dB�dCd��dD�dE�dF�dG�dH�dI�dJ�dK�dL�dM�dN�dO�dP�dQ�dR�dS�dT�dU�dV�dW�dX�dY�dZ�d[d��d\�d]�d^�d_�d`�da�db�dc�dd�de�df�dg�dh�di�dj�dk�dl�dm�dnd��do�dp�dq�dr�ds�dt�du�dv�dw�dx�dy�dz�d{�d|�d}�d~�d�d��d��d��d��d��d��d��d��d��d�d�d�d��d��d���Z
dS(�zf Python Character Mapping Codec cp737 generated from 'VENDORS/MICSFT/PC/CP737.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp737.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)NZcp737)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#���������������������������������������������������������%�%�%�%�$%�a%�b%�V%�U%�c%�Q%�W%�]%�\%�[%�%�%�4%�,%�%�%�<%�^%�_%�Z%�T%�i%�f%�`%�P%�l%�g%�h%�d%�e%�Y%�X%�R%�S%�k%�j%�%�%�%�%�%�%�%�������������������������e"�d"����H"��"��"� ��%�)���������������������������������r����������������r�r�r�����r�������������������������������������������������������������������������������������������������������������������r���������u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�rrrrrrr
rrr
rrrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrr	rrrrrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r(rrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwrxryrzr{r|r}r~rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r�r�r�r�r�r�r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrOrNrPrQrRrSrTr�r�r�r�r�r�r�r�r�r�r�r�rirXrrdrer~rhrYrgrfrjrrr_rzr{rnr]r\r`ryrxrmrcrbrarkrlrqrZr[r^rvrwrprtruror}r|rsr�r�r�r�r�rUrVrWr�)�__doc__rrrrrrr#�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s$
����encodings/__pycache__/cp1026.cpython-38.opt-1.pyc000064400000004574151153537620015251 0ustar00U

e5d93�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zu Python Character Mapping Codec cp1026 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP1026.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1026.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1026)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�œ	†—Ž
…‡’€‚ƒ„
ˆ‰Š‹Œ‘“”•–˜™š›ž  âäàáãå{ñÇ.<(+!&éêëèíîïìßĞİ*);^-/ÂÄÀÁÃÅ[Ñş,%_>?øÉÊËÈÍÎÏÌı:ÖŞ'=ÜØabcdefghi«»}`¦±°jklmnopqrªºæ¸Æ¤µöstuvwxyz¡¿]$@®¢£¥·©§¶¼½¾¬|¯¨´×çABCDEFGHI­ô~òóõğJKLMNOPQR¹û\ùúÿü÷STUVWXYZ²Ô#ÒÓÕ0123456789³Û"Ùڟ)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/mac_latin2.cpython-38.opt-1.pyc000064400000005054151153537620016341 0ustar00U

e5d&7�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)a Python Character Mapping Codec mac_latin2 generated from 'MAPPINGS/VENDORS/MICSFT/MAC/LATIN2.TXT' with gencodec.py.

Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
(c) Copyright 2000 Guido van Rossum.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�,/usr/lib64/python3.8/encodings/mac_latin2.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
rs
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
r!src	Cs tjdt�jt�jttttd�S)Nz
mac-latin2)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry&s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s	�encodings/__pycache__/palmos.cpython-38.opt-2.pyc000064400000004412151153537620015621 0ustar00U

e5d�4�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/palmos.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
rs
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)NZpalmos)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry"s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹Œ♦♣♥♠‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ)
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/utf_16.cpython-38.pyc000064400000011412151153537620014470 0ustar00U

e5dt�@sxdZddlZddlZejZddd�ZGdd�dej�ZGdd	�d	ej�ZGd
d�dej	�Z	Gdd
�d
ej
�Z
dd�ZdS)z� Python 'utf-16' Codec


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

�N�strictcCst�||d�S)NT)�codecs�
utf_16_decode)�input�errors�r�(/usr/lib64/python3.8/encodings/utf_16.py�decodesr	c@s8eZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
S)�IncrementalEncoderrcCstj�||�d|_dS�N)rr
�__init__�encoder��selfrrrrrszIncrementalEncoder.__init__FcCsN|jdkr<t�||j�d}tjdkr0tj|_ntj|_|S|�||j�dS)Nr�little)r
r�
utf_16_encoder�sys�	byteorder�utf_16_le_encode�utf_16_be_encode)rr�final�resultrrr�encodes


zIncrementalEncoder.encodecCstj�|�d|_dSr)rr
�resetr
�rrrrr!szIncrementalEncoder.resetcCs|jdkrdSdS)N�r)r
rrrr�getstate%szIncrementalEncoder.getstatecCs,|rd|_ntjdkr tj|_ntj|_dS�Nr)r
rrrrr�r�staterrr�setstate,s


zIncrementalEncoder.setstateN)r)F)�__name__�
__module__�__qualname__rrrrr rrrrr
s



r
c@s6eZdZd
dd�Zdd�Zdd�Zdd	�Zd
d�ZdS)�IncrementalDecoderrcCstj�||�d|_dSr)r�BufferedIncrementalDecoderr�decoderrrrrr6szIncrementalDecoder.__init__cCsl|jdkr\t�||d|�\}}}|dkr2tj|_n"|dkrDtj|_n|dkrTtd��||fS|�||j|�S)Nr����r�%UTF-16 stream does not start with BOM)r&r�utf_16_ex_decode�utf_16_le_decode�utf_16_be_decode�UnicodeErrorr)rrrr�output�consumedrrrr�_buffer_decode:s
�

z!IncrementalDecoder._buffer_decodecCstj�|�d|_dSr)rr%rr&rrrrrGszIncrementalDecoder.resetcCsDtj�|�d}|jdkr"|dfSttjdk|jtjkk�}||fS)Nrr�big)rr%rr&�intrrr,)rrZaddstaterrrrKs


�zIncrementalDecoder.getstatecCsdtj�||�|d}|dkr8tjdkr.tjntj|_n(|dkrZtjdkrPtjntj|_nd|_dS)Nr(rr1)rr%r rrr,r+r&rrrrr Ys����zIncrementalDecoder.setstateN)r)r!r"r#rr0rrr rrrrr$5s


r$c@s(eZdZd	dd�Zdd�Zd
dd�ZdS)�StreamWriterrcCstj�|||�d|_dSr)rr3rr
)r�streamrrrrriszStreamWriter.__init__cCstj�|�d|_dSr)rr3rr
rrrrrmszStreamWriter.resetcCsF|jdkr6t�||�}tjdkr*tj|_ntj|_|S|�||�SdSr)r
rrrrrr)rrrrrrrrqs


zStreamWriter.encodeN)r)r)r!r"r#rrrrrrrr3hs
r3c@seZdZdd�Zddd�ZdS)�StreamReadercCs.tj�|�z|`Wntk
r(YnXdSr)rr5rr	�AttributeErrorrrrrr~s
zStreamReader.resetrcCsRt�||dd�\}}}|dkr(tj|_n"|dkr:tj|_n|dkrJtd��||fS)NrFr'r(rr))rr*r+r	r,r-)rrr�objectr/rrrrr	�s�

zStreamReader.decodeN)r)r!r"r#rr	rrrrr5|sr5c	Cstjdttttttd�S)Nzutf-16)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)r�	CodecInforr	r
r$r5r3rrrr�getregentry�s�r>)r)�__doc__rrrrr	r
r%r$r3r5r>rrrr�<module>s
#3encodings/__pycache__/iso8859_1.cpython-38.pyc000064400000004567151153537620014751 0ustar00U

e5dx3�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zj Python Character Mapping Codec iso8859_1 generated from 'MAPPINGS/ISO8859/8859-1.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/iso8859_1.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	iso8859-1)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp1258.cpython-38.opt-1.pyc000064400000004630151153537620015251 0ustar00U

e5d44�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zv Python Character Mapping Codec cp1258 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1258.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1258.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1258)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€￾‚ƒ„…†‡ˆ‰￾‹Œ￾￾￾￾‘’“”•–—˜™￾›œ￾￾Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp850.cpython-38.opt-1.pyc000064400000016525151153537620015174 0ustar00U

e5d9��@sdZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�dd(d�d;�ddhd�d}dtd'd�dmd9d6d`dHdd+d4d|ddd!d#d3d�d&d�d~d:d>d2d�d�dvd�d�d�d�d�ddr�ddsdpdxd)d.d-d5dNdVddd�d�d�dddd�dd1dd0�dd��dd"�d�d�d�d �d!�d"�d#�d$�d%d=�d&�d'dad_�d(dM�d)d�d*d$�d+�d,d,�d-�d.dd�d/du�d0d%dd�dyd8dGd{dWddFdEddfd7d d?ddd<dnd�dcdbdgdqd*dzd�d�d�dw�d1��Z
dS(2z` Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP850.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp850.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp850)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$�������������������������������������������������������������������������������%�%�%�%�$%������c%�Q%�W%�]%���%�%�4%�,%�%�%�<%�����Z%�T%�i%�f%�`%�P%�l%������������1�������%�%�%�%����%����������������������������� ������������%�)���������������������������������r�rSrcrBrurdr�r�r�r^rLrTrPr�rOr�r�r�r�r�r�r�r�r�r�r�rMrUrRrQr�rNr]r[r\rmr4r5r8r&rzr6rxryr�r|r}r~rwrKr�r�r�r�r?rDrCr�r�r�r@r�r�r�r+rFr)rlr*r,r7r-r0r(r.r/r3rGr2r1rvrJr;rHr9r�r:r�rAr=rIr<r'r�r�r>u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�(rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDr�rSrcrBrurdr�r�r�r^rLrTrPr�rOr�r�r�r�r�r�r�r�r�r�r�rMrUrRrQr�rNr]r[r\rmr4r5r8r&rzr6rxryr�r|r}r~rwrKr�r�r�r�r?rDrCr�r�r�r@r�r�r�r+rFr)rlr*r,r7r-r0r(r.r/r3rGr2r1rvrJr;rHr9r�r:r�rAr=rIr<r'r�r�r>r{rEr�rjrYr�rerfrrirZrhrgrkrsr`rorarnrbrrr_rqrprtr�r�r�rVrWrXr�)�__doc__rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s$
����encodings/__pycache__/base64_codec.cpython-38.opt-1.pyc000064400000004371151153537620016552 0ustar00U

e5d��@s�dZddlZddlZddd�Zddd�ZGdd	�d	ej�ZGd
d�dej�ZGdd
�d
ej�ZGdd�deej�ZGdd�deej	�Z	dd�Z
dS)z�Python 'base64_codec' Codec - base64 content transfer encoding.

This codec de/encodes from bytes to bytes.

Written by Marc-Andre Lemburg (mal@lemburg.com).
�N�strictcCst�|�t|�fS�N)�base64�encodebytes�len��input�errors�r
�./usr/lib64/python3.8/encodings/base64_codec.py�
base64_encode
srcCst�|�t|�fSr)r�decodebytesrrr
r
r�
base64_decodesrc@s eZdZddd�Zddd�ZdS)	�CodecrcCs
t||�Sr)r��selfrr	r
r
r�encodeszCodec.encodecCs
t||�Sr)rrr
r
r�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrr
r
r
rrs
rc@seZdZddd�ZdS)�IncrementalEncoderFcCs
t�|�Sr)rr�rr�finalr
r
rrszIncrementalEncoder.encodeN)F)rrrrr
r
r
rrsrc@seZdZddd�ZdS)�IncrementalDecoderFcCs
t�|�Sr)rr
rr
r
rr!szIncrementalDecoder.decodeN)F)rrrrr
r
r
rr src@seZdZeZdS)�StreamWriterN�rrr�bytes�charbuffertyper
r
r
rr%src@seZdZeZdS)�StreamReaderNrr
r
r
rr(src
Cstjdttttttdd�S)NrF)�namerr�incrementalencoder�incrementaldecoder�streamwriter�streamreader�_is_text_encoding)�codecs�	CodecInforrrrrrr
r
r
r�getregentry-s�r()r)r)�__doc__r&rrrrrrrrr(r
r
r
r�<module>s

encodings/__pycache__/mac_romanian.cpython-38.opt-2.pyc000064400000004441151153537620016754 0ustar00U

e5d]5�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�./usr/lib64/python3.8/encodings/mac_romanian.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nzmac-romanian)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ)
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp1255.cpython-38.pyc000064400000004650151153537620014311 0ustar00U

e5d�0�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zv Python Character Mapping Codec cp1255 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1255.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1255.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1255)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€￾‚ƒ„…†‡ˆ‰￾‹￾￾￾￾￾‘’“”•–—˜™￾›￾￾￾￾ ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹ￾ֻּֽ־ֿ׀ׁׂ׃װױײ׳״￾￾￾￾￾￾￾אבגדהוזחטיךכלםמןנסעףפץצקרשת￾￾‎‏￾)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp1258.cpython-38.pyc000064400000004630151153537620014312 0ustar00U

e5d44�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zv Python Character Mapping Codec cp1258 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1258.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1258.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1258)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€￾‚ƒ„…†‡ˆ‰￾‹Œ￾￾￾￾‘’“”•–—˜™￾›œ￾￾Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/bz2_codec.cpython-38.opt-2.pyc000064400000005532151153537620016164 0ustar00U

e5d��@s�ddlZddlZddd�Zddd�ZGdd�dej�ZGd	d
�d
ej�ZGdd�dej�ZGd
d�deej�ZGdd�deej�Zdd�Z	dS)�N�strictcCst�|�t|�fS�N)�bz2�compress�len��input�errors�r
�+/usr/lib64/python3.8/encodings/bz2_codec.py�
bz2_encodesrcCst�|�t|�fSr)r�
decompressrrr
r
r�
bz2_decodesrc@s eZdZddd�Zddd�ZdS)	�CodecrcCs
t||�Sr)r��selfrr	r
r
r�encodeszCodec.encodecCs
t||�Sr)rrr
r
r�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrr
r
r
rrs
rc@s(eZdZd
dd�Zddd�Zdd�Zd	S)�IncrementalEncoderrcCs||_t��|_dSr)r	r�
BZ2Compressor�compressobj�rr	r
r
r�__init__szIncrementalEncoder.__init__FcCs.|r|j�|�}||j��S|j�|�SdSr)rr�flush)rr�final�cr
r
rr#szIncrementalEncoder.encodecCst��|_dSr)rrr�rr
r
r�reset*szIncrementalEncoder.resetN)r)F)rrrrrr r
r
r
rrs

rc@s(eZdZd
dd�Zddd�Zdd�Zd	S)�IncrementalDecoderrcCs||_t��|_dSr)r	r�BZ2Decompressor�
decompressobjrr
r
rr.szIncrementalDecoder.__init__FcCs*z|j�|�WStk
r$YdSXdS)N�)r#r
�EOFError)rrrr
r
rr3szIncrementalDecoder.decodecCst��|_dSr)rr"r#rr
r
rr 9szIncrementalDecoder.resetN)r)F)rrrrrr r
r
r
rr!-s

r!c@seZdZeZdS)�StreamWriterN�rrr�bytes�charbuffertyper
r
r
rr&<sr&c@seZdZeZdS)�StreamReaderNr'r
r
r
rr*?sr*c
Cstjdttttttdd�S)NrF)�namerr�incrementalencoder�incrementaldecoder�streamwriter�streamreader�_is_text_encoding)�codecs�	CodecInforrrr!r&r*r
r
r
r�getregentryDs�r3)r)r)
r1rrrrrr!r&r*r3r
r
r
r�<module>
s

encodings/__pycache__/base64_codec.cpython-38.pyc000064400000004541151153537620015612 0ustar00U

e5d��@s�dZddlZddlZddd�Zddd�ZGdd	�d	ej�ZGd
d�dej�ZGdd
�d
ej�ZGdd�deej�ZGdd�deej	�Z	dd�Z
dS)z�Python 'base64_codec' Codec - base64 content transfer encoding.

This codec de/encodes from bytes to bytes.

Written by Marc-Andre Lemburg (mal@lemburg.com).
�N�strictcCs|dkst�t�|�t|�fS�Nr)�AssertionError�base64�encodebytes�len��input�errors�r�./usr/lib64/python3.8/encodings/base64_codec.py�
base64_encode
sr
cCs|dkst�t�|�t|�fSr)rr�decodebytesrrrrr�
base64_decodesrc@s eZdZddd�Zddd�ZdS)	�CodecrcCs
t||�S�N)r
��selfr	r
rrr�encodeszCodec.encodecCs
t||�Sr)rrrrr�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrrrs
rc@seZdZddd�ZdS)�IncrementalEncoderFcCs|jdkst�t�|�Sr)r
rrr�rr	�finalrrrrszIncrementalEncoder.encodeN)F)rrrrrrrrrsrc@seZdZddd�ZdS)�IncrementalDecoderFcCs|jdkst�t�|�Sr)r
rrrrrrrr!szIncrementalDecoder.decodeN)F)rrrrrrrrr src@seZdZeZdS)�StreamWriterN�rrr�bytes�charbuffertyperrrrr%src@seZdZeZdS)�StreamReaderNrrrrrr!(sr!c
Cstjdttttttdd�S)NrF)�namerr�incrementalencoder�incrementaldecoder�streamwriter�streamreader�_is_text_encoding)�codecs�	CodecInfor
rrrrr!rrrr�getregentry-s�r*)r)r)�__doc__r(rr
rrrrrr!r*rrrr�<module>s

encodings/__pycache__/quopri_codec.cpython-38.pyc000064400000004561151153537620016047 0ustar00U

e5d��@s�dZddlZddlZddlmZddd�Zddd�ZGd	d
�d
ej�ZGdd�dej�ZGd
d�dej	�Z	Gdd�deej
�Z
Gdd�deej�Zdd�ZdS)zQCodec for quoted-printable encoding.

This codec de/encodes from bytes to bytes.
�N)�BytesIO�strictcCs:|dkst�t|�}t�}tj||dd�|��t|�fS)NrT)Z	quotetabs)�AssertionErrorr�quopri�encode�getvalue�len��input�errors�f�g�r�./usr/lib64/python3.8/encodings/quopri_codec.py�
quopri_encode
s
rcCs6|dkst�t|�}t�}t�||�|��t|�fS)Nr)rrr�decoderrr	rrr�
quopri_decodes
rc@s eZdZddd�Zddd�ZdS)	�CodecrcCs
t||�S�N)r��selfr
rrrrrszCodec.encodecCs
t||�Sr)rrrrrrszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrrrs
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst||j�dS�Nr)rr�rr
�finalrrrrszIncrementalEncoder.encodeN)F)rrrrrrrrrsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst||j�dSr)rrrrrrr#szIncrementalDecoder.decodeN)F)rrrrrrrrr"src@seZdZeZdS)�StreamWriterN�rrr�bytes�charbuffertyperrrrr&src@seZdZeZdS)�StreamReaderNr rrrrr#)sr#c
Cstjdttttttdd�S)NrF)�namerr�incrementalencoder�incrementaldecoder�streamwriter�streamreader�_is_text_encoding)�codecs�	CodecInforrrrrr#rrrr�getregentry.s�r,)r)r)
�__doc__r*r�iorrrrrrrr#r,rrrr�<module>s

encodings/__pycache__/cp1256.cpython-38.pyc000064400000004622151153537620014311 0ustar00U

e5d2�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zv Python Character Mapping Codec cp1256 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1256.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1256.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1256)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/euc_kr.cpython-38.opt-1.pyc000064400000002607151153537620015601 0ustar00U

e5d�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�euc_krc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�(/usr/lib64/python3.8/encodings/euc_kr.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_krrZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/cp1254.cpython-38.opt-1.pyc000064400000004625151153537620015251 0ustar00U

e5d�4�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zv Python Character Mapping Codec cp1254 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1254.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1254.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1254)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€￾‚ƒ„…†‡ˆ‰Š‹Œ￾￾￾￾‘’“”•–—˜™š›œ￾￾Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp950.cpython-38.opt-1.pyc000064400000002605151153537620015167 0ustar00U

e5d��@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�cp950c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�'/usr/lib64/python3.8/encodings/cp950.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_twrZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/iso8859_2.cpython-38.pyc000064400000004567151153537620014752 0ustar00U

e5d\4�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zj Python Character Mapping Codec iso8859_2 generated from 'MAPPINGS/ISO8859/8859-2.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/iso8859_2.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	iso8859-2)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp857.cpython-38.opt-2.pyc000064400000016316151153537620015202 0ustar00U

e5dt���@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�Ze�ed��Z	e	�
dddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddddedfdgdhdidjdkdldmdndodpdqdrdsdtddudvdwdxdydzd{d|d}dd~dd�d�d�d�d�d�d�d�d�d�d�d���d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�ddyd|d:�ddfd~�d
drd&d�d4d8d`�ddGdd*d3�dddd d"d2d�d%�ddzd9d=d1d�d�dtdd�d�d�d�ddp�ddqdn�dd(dud,dMdUddd�dd�dddd�dd/�dd��dd!�d�d�d�d�d �d!�d"�d#�d$d<�d%�d&d^�d'dL�d(d�d)d#�d*�d+d+�d,�d-d0dkd��d.�d/�d0�d1dd�dvd7dFdxdVd{dEdDdddd_dd>dcd;dld�dbdadedod)dwd�d}d��d2�d3��ZdS(4�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp857.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp857)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$���������������������������1������������������0���������^�_����������������������%�%�%�%�$%������c%�Q%�W%�]%���%�%�4%�,%�%�%�<%�����Z%�T%�i%�f%�`%�P%�l%����������������%�%�%�%����%�������������������������������������%�)��������������������������������r�rSrcrBrurdr�r�r�r^rwrTrPr�rOr�r�r�r�r�r�r�r�r�r�r�rvrUrRrQr�rNr]r[r\rmr4r5r8r&rzr6rxryr�r{r|r}��rKr�r�r�r�r?r�rCr�r�r�r@����r�r+rFr)rlr*r,r7r-r0r(r.r/rGr2r1��rJr;rHr9r�r:r�rAr=rIr<r'��r�u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ￾ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ￾×ÚÛÙìÿ¯´­±￾¾¶§÷¸°¨·¹³²■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r���r�r�r�r�r�r�r�r�r�r�r�r�r�r�)�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFr�rSrcrBrurdr�r�r�r^rwrTrPr�rOr�r�r�r�r�r�r�r�r�r�r�rvrUrRrQr�rNr]r[r\rmr4r5r8r&rzr6rxryr�r{r|r}rKr�r�r�r�r?r�rCr�r�r�r@r�r+rFr)rlr*r,r7r-r0r(r.r/rGrGr2r1rJr;rHr9r�r:r�rAr=rIr<r'r�rLrMr>r3rDrErjrYrrerfr~rirZrhrgrkrsr`rorarnrbrrr_rqrprtr�r�r�rVrWrXr�)
rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s
����encodings/__pycache__/iso8859_5.cpython-38.opt-2.pyc000064400000004375151153537620015712 0ustar00U

e5d�2�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/iso8859_5.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	iso8859-5)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ)
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/rot_13.cpython-38.opt-2.pyc000064400000005445151153537620015444 0ustar00U

e5d�	�7@sddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�Ze�ed��Z	e	�
dddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdC�4�dDdE�ZedFk�rddl
Z
ee
je
j�dS)G�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�|t�t|�fS�N��str�	translate�	rot13_map�len��self�input�errors�r�(/usr/lib64/python3.8/encodings/rot_13.py�encodeszCodec.encodecCst�|t�t|�fSrrr
rrr�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrrr
s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�|t�Sr�rrr�rr�finalrrrrszIncrementalEncoder.encodeN)F)rrrrrrrrrsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�|t�SrrrrrrrszIncrementalDecoder.decodeN)F)rrrrrrrrrsrc@seZdZdS)�StreamWriterN�rrrrrrrrsrc@seZdZdS)�StreamReaderNrrrrrrsrc
Cs"tjdt�jt�jttttdd�S)N�rot-13F)�namerr�incrementalencoder�incrementaldecoder�streamwriter�streamreader�_is_text_encoding)	�codecs�	CodecInforrrrrrrrrrr�getregentry$s�r&��N�O�P�Q�R�S�T�U�V�W�X�Y�Z�A�B�C�D�E�F�G�H�I�J�K�L�M�n�o�p�q�r�s�t�u�v�w�x�y�z�a�b�c�d�e�f�g�h�i�j�k�l�m)4r5r6r7r8r9r:r;r<r=r>r?r@rAr(r)r*r+r,r-r.r/r0r1r2r3r4rOrPrQrRrSrTrUrVrWrXrYrZr[rBrCrDrErFrGrHrIrJrKrLrMrNcCs|�t�|��d��dS)Nr)�writer$r�read)ZinfileZoutfilerrr�rot13lsr^�__main__)r$rrrrrr&�make_identity_dict�ranger�updater^r�sys�stdin�stdoutrrrr�<module>	s��9
encodings/__pycache__/mac_arabic.cpython-38.opt-1.pyc000064400000017076151153537620016400 0ustar00U

e5ds��@sPdZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d0dd1d�d2d�d3d�d4d�d�d6d�d7d�d8d�d9d�d:d�d;dd�d=d�d>d�d?d�d�d�d�d�d�d�d�d�d�d�dJd�d�dLd�dMd�dNd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�dkd�dlddmd�dnd�dod�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�dd�d.d�d/d��d	�d
�d�d�d
�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d �d!�d"�d#�d$�d%�d&�d'�d(�d)�d*d(�d+�d,�d-�d.d�d/�d0d�d1d�d2�d3�d4�d5�d6�d7�d8d�d9�d:�d;�d<d�d=�d>�d?�d@ddd�dAd�dB�dCdddd d!�dDd"d$d%�dEd&�dF�dG�dH�dI�dJ�dK�dL�dM�dN�dO�dP�dQd)d'�dRd-d,�dSd+�dT�dU�dVd*�dW�dX�dY��Z
dS(Zz] Python Character Mapping Codec generated from 'VENDORS/APPLE/ARABIC.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�,/usr/lib64/python3.8/encodings/mac_arabic.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz
mac-arabic)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#�������������������������������������& ������������������ �!�"�#�$�j�&�'�(�)�*�+��-�.�/�`�a�b�c�d�e�f�g�h�i�:��<�=�>��J'�!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�[�\�]�^�_�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�~�y��������{�|�}���)���������������������������������r&����������r1���������������r=����������r%����r'��r(��������������r)��������r*����������r+������r-r,r.��r/����r2r4r3r5r6��r7r9r:��r;��r<r>�r?r@�rBrArCrD���uh	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Ä ÇÉÑÖÜáàâäں«çéèêëí…îïñó»ôö÷úùûü !"#$٪&'()*+،-./٠١٢٣٤٥٦٧٨٩:؛<=>؟❊ءآأؤإئابةتثجحخدذرزسشصضطظعغ[\]^_ـفقكلمنهوىيًٌٍَُِّْپٹچەڤگڈڑ{|}ژے���������	�
���
������������������r�r�r�r��%r�r�r�r�r��,r�r�r��0�1�2�3�4�5�6�7�8�9r��;r�r�r��?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Zr�r�r�r��`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�zr�~�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr�r�r�r�r�r�r�r�r�r�r�rrrr�rr�r�(rrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%rErErFrFrGrGrHrHrIrIr&rKrKrLrLrMrMrNrNrOrOrPrPr'rRrRrSrSrTrTr(r)r*r+r,r-r.r/r0r1r_r_r2rararbrbrcrcr3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNr�r�r�r�r�r�r�r�r�r�rOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrir�r�r�r�r�r�rjrkr&r1r=r%r'r(r)r*r+r-r,r.r/r2r4r3r5r6r7r9r:r;r<r>r?r@rBrArCrDrQr`rdrfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwrxryrzr{r|r}r~rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rUrVrWrXrYrZr[r\r]r^rJr�r�r�r�r�r�r�r�r0r�r�r8re)�__doc__rrrrrrr#�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s$
����encodings/__pycache__/utf_8.cpython-38.opt-2.pyc000064400000002716151153537620015360 0ustar00U

e5d��@slddlZejZddd�ZGdd�dej�ZGdd�dej�ZGd	d
�d
ej�ZGdd�dej�Zd
d�Z	dS)�N�strictcCst�||d�S)NT)�codecs�utf_8_decode)�input�errors�r�'/usr/lib64/python3.8/encodings/utf_8.py�decodesr	c@seZdZddd�ZdS)�IncrementalEncoderFcCst�||j�dS)Nr)r�utf_8_encoder)�selfr�finalrrr�encodeszIncrementalEncoder.encodeN)F)�__name__�
__module__�__qualname__rrrrrr
sr
c@seZdZejZdS)�IncrementalDecoderN)rrrrr�_buffer_decoderrrrrsrc@seZdZejZdS)�StreamWriterN)rrrrrrrrrrrsrc@seZdZejZdS)�StreamReaderN)rrrrrr	rrrrrsrc	Cstjdttttttd�S)Nzutf-8)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)r�	CodecInforr	r
rrrrrrr�getregentry!s�r)r)
rrrr	r
�BufferedIncrementalDecoderrrrrrrrr�<module>	s
encodings/__pycache__/big5hkscs.cpython-38.opt-2.pyc000064400000002615151153537620016213 0ustar00U

e5d�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�	big5hkscsc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�+/usr/lib64/python3.8/encodings/big5hkscs.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_hkrZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/mac_iceland.cpython-38.pyc000064400000004637151153537620015616 0ustar00U

e5d�4�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zs Python Character Mapping Codec mac_iceland generated from 'MAPPINGS/VENDORS/APPLE/ICELAND.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�-/usr/lib64/python3.8/encodings/mac_iceland.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nzmac-iceland)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp950.cpython-38.opt-2.pyc000064400000002605151153537620015170 0ustar00U

e5d��@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�cp950c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�'/usr/lib64/python3.8/encodings/cp950.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_twrZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/iso8859_6.cpython-38.pyc000064400000004644151153537620014752 0ustar00U

e5dQ*�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zj Python Character Mapping Codec iso8859_6 generated from 'MAPPINGS/ISO8859/8859-6.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/iso8859_6.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	iso8859-6)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ￾￾￾¤￾￾￾￾￾￾￾،­￾￾￾￾￾￾￾￾￾￾￾￾￾؛￾￾￾؟￾ءآأؤإئابةتثجحخدذرزسشصضطظعغ￾￾￾￾￾ـفقكلمنهوىيًٌٍَُِّْ￾￾￾￾￾￾￾￾￾￾￾￾￾)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/hp_roman8.cpython-38.opt-2.pyc000064400000004400151153537620016216 0ustar00U

e5d�4�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/hp_roman8.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
rs
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
r src@seZdZdS)�StreamReaderNrrrrr
r#src	Cs tjdt�jt�jttttd�S)Nz	hp-roman8)�namerr�incrementalencoder�incrementaldecoder�streamwriter�streamreader)	r�	CodecInforrrrrrrrrrr
�getregentry(s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±￾)
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp869.cpython-38.opt-1.pyc000064400000017272151153537620015206 0ustar00U

e5dŀ��@shdZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�dddddddddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�dd5�d�d�d�d�d�d�d�d�d�d �d!�d"dd|d�d�d#ddw�d$�d%d�d&d2�d'�d(�d)�d*�d+�d,�d-�d.�d/�d0�d1�d2�d3�d4�d5�d6�d7�d8�d9�d:�d;�d<�d=�d>�d?�d@�dA�dB�dC�dD�dE�dF�dG�dH�dI�dJ�dK�dL�dM�dN�dO�dPd��dQ�dRd#�dS�dT�dU�dV�dWd!�dX�dY�dZ�d[�d\�d]�d^�d_�d`�da�db�dcd6�dd�de�df�dg�dh�di�dj�dk�dl�dmddxd �dn�do��Z
dS(pz` Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP869.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp869.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp869)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$������ � �� �����������������������������������%�%�%�%�$%�����c%�Q%�W%�]%���%�%�4%�,%�%�%�<%���Z%�T%�i%�f%�`%�P%�l%�����������%�%�%�%���%�����������������������������������������%�)���������������������������������r���r9��r)r�r�r4�rKr(r���r�r�r6r7���r'���rL�rH���������������������������������������������������������������������������������������������������������������������u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~￾￾￾￾￾￾Ά￾·¬¦‘’Έ―ΉΊΪΌ￾￾ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�rr�r�rrr�r�r�r�rr�r�r�r�r�r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r	r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrr�r
r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r)�rr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwrxryrzr{r|r}r~rr�r�r�r�r�r�r�r�r�r�r�r�r�r9r)r�r�r4rKr(r�r�r�r6r7r'rLrHr�r�r&r,r.r/r1r2r5r>rArBrCrDrErFrGrIrJrRrSrTrUrZr[rcrdrlrmrnrorprqrrr0r3r8r:r;r<r�rsrtrurzr{r}r~rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r=r�r?r@r�r-r*r+rarPrwr\r]rvr`rQr_r^rbrjrWrfrXrerYrirVrhrgrkr|ryrxrMrNrOr�)�__doc__rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s
����encodings/__pycache__/utf_32_le.cpython-38.opt-1.pyc000064400000003011151153537620016101 0ustar00U

e5d��@spdZddlZejZddd�ZGdd�dej�ZGdd	�d	ej�ZGd
d�dej�ZGdd
�d
ej	�Z	dd�Z
dS)z
Python 'utf-32-le' Codec
�N�strictcCst�||d�S)NT)�codecs�utf_32_le_decode)�input�errors�r�+/usr/lib64/python3.8/encodings/utf_32_le.py�decode
sr	c@seZdZddd�ZdS)�IncrementalEncoderFcCst�||j�dS)Nr)r�utf_32_le_encoder)�selfr�finalrrr�encodeszIncrementalEncoder.encodeN)F)�__name__�
__module__�__qualname__rrrrrr

sr
c@seZdZejZdS)�IncrementalDecoderN)rrrrr�_buffer_decoderrrrrsrc@seZdZejZdS)�StreamWriterN)rrrrrrrrrrrsrc@seZdZejZdS)�StreamReaderN)rrrrrr	rrrrrsrc	Cstjdttttttd�S)Nz	utf-32-le)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)r�	CodecInforr	r
rrrrrrr�getregentrys�r)r)�__doc__rrrr	r
�BufferedIncrementalDecoderrrrrrrrr�<module>s
encodings/__pycache__/iso2022_jp.cpython-38.opt-2.pyc000064400000002624151153537620016122 0ustar00U

e5d�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�
iso2022_jpc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�,/usr/lib64/python3.8/encodings/iso2022_jp.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z_codecs_iso2022rZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/cp865.cpython-38.pyc000064400000017242151153537620014240 0ustar00U

e5d:��@sVdZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�dd(�d�d�d�d�dd6d+d4�dd!d3�dd:d>�d�d�d�d�d�d�d�d�d �d!d0�d"d��d#�d$�d%�d&�d'�d(�d)�d*�d+�d,d=�d-�d.d?�d/�d0�d1�d2d$�d3�d4d,�d5�d6�d7�d8dddddddd�d9ddd1d�d:d'd&ddd��d;d2d%�d<d#�d=d�d>�d?d8�d@�dA�dB�dC�dD�dEd�dFd7�dGd)d �dHd��dI�dJ�dK�dL�dMd;d<d"d�dNdv�dO�dPd5�dQ�dR�dS�dT�dUd-�dV�dWdqd*�dX�dY�dZd�d�d��d[�d\��Z
dS(]z` Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP865.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp865.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp865)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$������������������������������������������������������� ����������������#�������%�%�%�%�$%�a%�b%�V%�U%�c%�Q%�W%�]%�\%�[%�%�%�4%�,%�%�%�<%�^%�_%�Z%�T%�i%�f%�`%�P%�l%�g%�h%�d%�e%�Y%�X%�R%�S%�k%�j%�%�%�%�%�%�%�%����������������"����)"�a"��e"�d"� #�!#��H"��"��"� ��%�)���������������������������������r�rS�rBrU�����rLrTrP���r�r�r���r��r���rM�rRrQ�rN������r4r5r8r&��r6��������������rK��������r?��rC������r@����r�r+rFr)��r*r,r7r-r0r(r.r/r3rGr2r1��rJr;rHr9�r:r�rAr=rIr<r'��r>u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�(rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnror�rSrBrUrLrTrPr�r�r�r�r�rMrRrQrNr4r5r8r&r6rKr?rCr@r�r+rFr)r*r,r7r-r0r(r.r/r3rGr2r1rJr;rHr9r:r�rAr=rIr<r'r>rEr�r�r�r�r�r�r�r�r�r�r�r�r�rDr�r�r�r�r�r�r�r�rOr�r�rjrYr�rerfrrirZrhrgrkrsr`r{r|ror^r]rarzryrnrdrcrbrlrmrrr[r\r_rwrxrqrurvrpr~r}rtr�r�r�r�r�rVrWrXr�)�__doc__rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s$
����encodings/__pycache__/cp855.cpython-38.opt-2.pyc000064400000017530151153537620015177 0ustar00U

e5d:��@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�Ze�ed��Z	e	�
dddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d �d!�d"�d#�d$�d%�d&dd��d'�d(�d)�d*�d+�d,�d-�d.�d/�d0�d1�d2�d3�d4�d5d=�d6�d7�d8�d9�d:�d;�d<�d=�d>�d?�d@d��dA�dB�dC�dD�dE�dF�dG�dH�dI�dJ�dK�dL�dM�dN�dO�dP�dQ�dR�dS�dT�dUd^�dV�dW�dX�dY�dZ�d[�d\�d]�d^�d_�d`�da�db�dc�dd�de�df�dg�dh�di�dj�dk�dl�dm�dn�do�dp�dq�dr�ds�dt�du�dv�dw�dx�dy�dz�d{d>�d|�d}�d~�d�d��d��d��d��d��d��d��d��d��d��d���ZdS(��Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp855.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp855)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$��R��S��Q��T��U��V��W��X��Y�	�Z�
�[��\��^��_��N�.�J�*�0��1��F�&�4��5��D�$�3����%�%�%�%�$%�E�%�8��c%�Q%�W%�]%�9��%�%�4%�,%�%�%�<%�:��Z%�T%�i%�f%�`%�P%�l%��;��<��=��>��?�%�%�%�%��O�%�/�@� �A�!�B�"�C�#�6��2��L�,�!��K�+�7��H�(�M�-�I�)�G�'��%�)���������������������������������r����ru��r����rT�r��������������rU�����������������������������������������������������������������������������������������������������������������������u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�rr�rr�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r
rr�r�r�r�r�r�r�r�rrrrr�r�rrrr�rrrr�rr�rr�r�r�r	rr�r�r�r�r�r�r�r�rrrrr�r�rrrr�rr
rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r(rr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwrxryrzr{r|r}r~rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rur�rTr�rUr+r'r)r-r/r1r3r5r7r9r;r=r?rArGrIr�rSrMrOr�r�r^rdrmrwryr{r}r�r�r�r�r�rQr\rKr�r�r�rEr�r�r�rCr�rFrHr�rRrLrNr�r�r]rcrlrvrxrzr|r~r�r�r�r�rPr[rJr�r�r�rDr�r�r�rBr�r*r&r(r,r.r0r2r4r6r8r:r<r>r@r�rjrYr�rerfrrirZrhrgrkrsr`rorarnrbrrr_rqrprtr�r�r�rVrWrXr�)
rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s"
����encodings/__pycache__/iso8859_10.cpython-38.pyc000064400000004574151153537620015027 0ustar00U

e5d5�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zl Python Character Mapping Codec iso8859_10 generated from 'MAPPINGS/ISO8859/8859-10.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�,/usr/lib64/python3.8/encodings/iso8859_10.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz
iso8859-10)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨͧĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/iso8859_13.cpython-38.opt-1.pyc000064400000004577151153537620015774 0ustar00U

e5d�3�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zl Python Character Mapping Codec iso8859_13 generated from 'MAPPINGS/ISO8859/8859-13.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�,/usr/lib64/python3.8/encodings/iso8859_13.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz
iso8859-13)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/iso8859_9.cpython-38.opt-2.pyc000064400000004374151153537620015715 0ustar00U

e5dd3�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/iso8859_9.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	iso8859-9)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ)
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/mbcs.cpython-38.pyc000064400000003261151153537620014313 0ustar00U

e5d��@s~dZddlmZmZddlZeZddd�ZGdd�dej�ZGd	d
�d
ej�ZGdd�dej	�Z	Gd
d�dej
�Z
dd�ZdS)z� Python 'mbcs' Codec for Windows


Cloned by Mark Hammond (mhammond@skippinet.com.au) from ascii.py,
which was written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

�)�mbcs_encode�mbcs_decodeN�strictcCst||d�S)NT)r)�input�errors�r�&/usr/lib64/python3.8/encodings/mbcs.py�decodesr	c@seZdZddd�ZdS)�IncrementalEncoderFcCst||j�dS)Nr)rr)�selfr�finalrrr�encodeszIncrementalEncoder.encodeN)F)�__name__�
__module__�__qualname__r
rrrrr
sr
c@seZdZeZdS)�IncrementalDecoderN)rrrr�_buffer_decoderrrrrsrc@seZdZeZdS)�StreamWriterN)rrrrr
rrrrrsrc@seZdZeZdS)�StreamReaderN)rrrrr	rrrrr!src	Cstjdttttttd�S)N�mbcs)�namer
r	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)�codecs�	CodecInfor
r	r
rrrrrrr�getregentry&s�r)r)�__doc__rrrr
r	r
�BufferedIncrementalDecoderrrrrrrrr�<module>s
encodings/__pycache__/cp1258.cpython-38.opt-2.pyc000064400000004421151153537620015250 0ustar00U

e5d44�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1258.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1258)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€￾‚ƒ„…†‡ˆ‰￾‹Œ￾￾￾￾‘’“”•–—˜™￾›œ￾￾Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ)
rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/mac_centeuro.cpython-38.pyc000064400000004636151153537620016042 0ustar00U

e5d7�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zu Python Character Mapping Codec mac_centeuro generated from 'MAPPINGS/VENDORS/APPLE/CENTEURO.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�./usr/lib64/python3.8/encodings/mac_centeuro.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nzmac-centeuro)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/latin_1.cpython-38.opt-2.pyc000064400000003323151153537620015655 0ustar00U

e5d��@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�ZGdd
�d
ee�Zdd�ZdS)�Nc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codecs�latin_1_encode�encode�latin_1_decode�decode�rr�)/usr/lib64/python3.8/encodings/latin_1.pyr
src@seZdZddd�ZdS)�IncrementalEncoderFcCst�||j�dS�Nr)rr�errors��self�input�finalrrrrszIncrementalEncoder.encodeN)F)rrrrrrrrr
sr
c@seZdZddd�ZdS)�IncrementalDecoderFcCst�||j�dSr)rr	rrrrrr
szIncrementalDecoder.decodeN)F)rrrr
rrrrrsrc@seZdZdS)�StreamWriterN�rrrrrrrrsrc@seZdZdS)�StreamReaderNrrrrrrsrc@seZdZejZejZdS)�StreamConverterN)rrrrr	rrr
rrrrr"src	Cstjdtjtjttttd�S)Nz	iso8859-1)�namerr
�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrr
r
rrrrrrr�getregentry)s�r)rrr
rrrrrrrrr�<module>	sencodings/__pycache__/iso2022_jp_2.cpython-38.opt-1.pyc000064400000002630151153537620016337 0ustar00U

e5d%�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�iso2022_jp_2c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�./usr/lib64/python3.8/encodings/iso2022_jp_2.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z_codecs_iso2022rZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/cp1256.cpython-38.opt-2.pyc000064400000004413151153537620015247 0ustar00U

e5d2�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1256.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1256)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے)
rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/zlib_codec.cpython-38.opt-1.pyc000064400000005715151153537620016431 0ustar00U

e5d��@s�dZddlZddlZddd�Zddd�ZGdd	�d	ej�ZGd
d�dej�ZGdd
�d
ej�ZGdd�deej�ZGdd�deej	�Z	dd�Z
dS)z�Python 'zlib_codec' Codec - zlib compression encoding.

This codec de/encodes from bytes to bytes.

Written by Marc-Andre Lemburg (mal@lemburg.com).
�N�strictcCst�|�t|�fS�N)�zlib�compress�len��input�errors�r
�,/usr/lib64/python3.8/encodings/zlib_codec.py�zlib_encode
srcCst�|�t|�fSr)r�
decompressrrr
r
r�zlib_decodesrc@s eZdZddd�Zddd�ZdS)	�CodecrcCs
t||�Sr)r��selfrr	r
r
r�encodeszCodec.encodecCs
t||�Sr)rrr
r
r�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrr
r
r
rrs
rc@s(eZdZd
dd�Zddd�Zdd�Zd	S)�IncrementalEncoderrcCs||_t��|_dSr)r	r�compressobj�rr	r
r
r�__init__szIncrementalEncoder.__init__FcCs.|r|j�|�}||j��S|j�|�SdSr)rr�flush�rr�final�cr
r
rr!szIncrementalEncoder.encodecCst��|_dSr)rr�rr
r
r�reset(szIncrementalEncoder.resetN)r)F)rrrrrr r
r
r
rrs

rc@s(eZdZd
dd�Zddd�Zdd�Zd	S)�IncrementalDecoderrcCs||_t��|_dSr)r	r�
decompressobjrr
r
rr,szIncrementalDecoder.__init__FcCs.|r|j�|�}||j��S|j�|�SdSr)r"r
rrr
r
rr1szIncrementalDecoder.decodecCst��|_dSr)rr"rr
r
rr 8szIncrementalDecoder.resetN)r)F)rrrrrr r
r
r
rr!+s

r!c@seZdZeZdS)�StreamWriterN�rrr�bytes�charbuffertyper
r
r
rr#;sr#c@seZdZeZdS)�StreamReaderNr$r
r
r
rr'>sr'c
Cstjdttttttdd�S)NrF)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter�_is_text_encoding)�codecs�	CodecInforrrr!r'r#r
r
r
r�getregentryCs�r0)r)r)�__doc__r.rrrrrr!r#r'r0r
r
r
r�<module>s

encodings/__pycache__/cp1140.cpython-38.opt-1.pyc000064400000004556151153537620015246 0ustar00U

e5d13�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zf Python Character Mapping Codec cp1140 generated from 'python-mappings/CP1140.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1140.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1140)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�œ	†—Ž
…‡’€‚ƒ„
ˆ‰Š‹Œ‘“”•–˜™š›ž  âäàáãåçñ¢.<(+|&éêëèíîïìß!$*);¬-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'="Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ€µ~stuvwxyz¡¿ÐÝÞ®^£¥·©§¶¼½¾[]¯¨´×{ABCDEFGHI­ôöòóõ}JKLMNOPQR¹ûüùúÿ\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙڟ)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/big5hkscs.cpython-38.opt-1.pyc000064400000002615151153537620016212 0ustar00U

e5d�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�	big5hkscsc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�+/usr/lib64/python3.8/encodings/big5hkscs.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_hkrZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/cp864.cpython-38.opt-2.pyc000064400000017277151153537620015207 0ustar00U

e5d���@stddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�Ze�ed��Z	e	�
dddddddddddddddddd d!d"d#d$d%d&d'd(d)d*ddd+d,dd-d.d/ddd0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�dd��~�d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�d�d�dddd(�d�d�ddd#�d�d�d�d�d d�d!�d"�d#�d$�d%�d&�d'�d(�d)�d*�d+�d,�d-�d.�d/�d0�d1�d2�d3�d4�d5�d6�d7dH�d8�d9�d:�d;�d<�d=�d>�d?�d@�dA�dBd'�dCd-�dD�dE�dF�dG�dH�dI�dJ�dK�dLd%�dMd$�dN�dO�dP�dQ�dRdf�dS�dT�dU�dV�dW�dX�dY�dZde�d[�d\�d]�d^�d_�d`�da�db�dc�dd�de�df�dg�dh�di�dj�dk�dl�dm�dn�do�dp�dq�dr�ds�dt�du�dv��ZdS(w�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp864.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp864)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$��j���"�"�%�%�%�<%�$%�,%�%�4%�%�%�%�%��"������H"������������������`�a�b�c�d�e�f�g�h�i����������������������������������������������@������������������������������}��Q�����������������������%)~�%���������������������������������r_�rz����r>r{rD��r'r:�����r(���r?r<r;����������������������������������������������r}������������������������������������������������������������r|��������u�	

 !"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ￾￾ﻻﻼ￾ ­ﺂ£¤ﺄ￾￾ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■￾���������	�
���
������������������� �!�"�#�$�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~��r���r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r
rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�rr�r
r�r�r�rr�rr�rr�r�rrrr�rr	r�r�r�r�)�rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwrxryrzr{r|r}r~rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r_r�r�rzr>r{rDr'r:r(r?r<r;r}r|r7r9rKrZr^rr�rOrPrQrRrSrTrUrVrWrXr&r)r*r8r=r,r-r4r3r5r6r1r/r0r2r.r+r�r�r`rarErbrFrcrerfrGrHrgrhrIrirJrjrLrkrMrlrNrmrnrorprqr[rrr\rsr]rtr�rurvrwr~rdrxr�r�r�ryr�rYr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r@rArBrC)
rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s
����encodings/__pycache__/cp858.cpython-38.pyc000064400000016467151153537620014252 0ustar00U

e5d߄�@sdZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�dd(d�d;�ddhd�d}dtd'd�dmd9d6d`dHdd+d4d|ddd!d#d3d�d&d�d~d:d>d2d�d�dvd�d�d�d�d�ddr�ddsdpdxd)d.d-d5dNdVddd�d�d�dddd�dd1dd0�dd��dd"�d�d�d�d �d!�d"�d#�d$�d%d=�d&�d'dad_�d(dM�d)d�d*d$�d+�d,d,�d-�d.dd�d/du�d0d%dd�dyd8dGd{dWddFdEddfd7d d?ddd<dnd�dcdbdgdqd*dzd�d�d�dw�d1��Z
dS(2zA Python Character Mapping Codec for CP858, modified from cp850.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp858.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp858)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$�������������������������������������������������������������������������������%�%�%�%�$%������c%�Q%�W%�]%���%�%�4%�,%�%�%�<%�����Z%�T%�i%�f%�`%�P%�l%������������ �������%�%�%�%����%����������������������������� ������������%�)���������������������������������r�rSrcrBrurdr�r�r�r^rLrTrPr�rOr�r�r�r�r�r�r�r�r�r�r�rMrUrRrQr�rNr]r[r\rmr4r5r8r&rzr6rxryr�r|r}r~rwrKr�r�r�r�r?rDrCr�r�r�r@r�r�r�r+rFr)rlr*r,r7r-r0r(r.r/r3rGr2r1rvrJr;rHr9r�r:r�rAr=rIr<r'r�r�r>u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�(rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDr�rSrcrBrurdr�r�r�r^rLrTrPr�rOr�r�r�r�r�r�r�r�r�r�r�rMrUrRrQr�rNr]r[r\rmr4r5r8r&rzr6rxryr�r|r}r~rwrKr�r�r�r�r?rDrCr�r�r�r@r�r�r�r+rFr)rlr*r,r7r-r0r(r.r/r3rGr2r1rvrJr;rHr9r�r:r�rAr=rIr<r'r�r�r>r{rEr�rjrYr�rerfrrirZrhrgrkrsr`rorarnrbrrr_rqrprtr�r�r�rVrWrXr�)�__doc__rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s$
����encodings/__pycache__/mac_roman.cpython-38.pyc000064400000004635151153537620015331 0ustar00U

e5d�4�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zo Python Character Mapping Codec mac_roman generated from 'MAPPINGS/VENDORS/APPLE/ROMAN.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/mac_roman.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	mac-roman)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/shift_jis_2004.cpython-38.opt-1.pyc000064400000002627151153537620016762 0ustar00U

e5d#�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�shift_jis_2004c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�0/usr/lib64/python3.8/encodings/shift_jis_2004.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_jprZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/cp862.cpython-38.opt-1.pyc000064400000017537151153537620015203 0ustar00U

e5dZ��@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�d�dd6�dd4�d�dd3�d�dd:d>�dd-d0d�d=�dd+�dd,�d �d!�d"�d#�d$�d%�d&�d'�d(�d)�d*�d+d1�d,�d-�d.�d/�d0�d1�d2�d3�d4�d5�d6�d7�d8�d9�d:�d;�d<�d=�d>�d?�d@�dA�dB�dC�dD�dE�dF�dG�dH�dI�dJ�dK�dLd��dMd2�dN�dO�dP�dQ�dR�dS�dTd8�dU�dV�dW�dX�dY�dZ�d[�d\d7�d]�d^�d_�d`d�d?�da�db�dc�ddd;d<�de�df�dgdv�dh�did5�dj�dk�dl�dm�dn�do�dp�dqdq�dr�ds�dt�dud�d�d��dv�dw��Z
dS(xz` Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP862.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp862.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp862)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$����������������������������������������������������������� ����������������#�������%�%�%�%�$%�a%�b%�V%�U%�c%�Q%�W%�]%�\%�[%�%�%�4%�,%�%�%�<%�^%�_%�Z%�T%�i%�f%�`%�P%�l%�g%�h%�d%�e%�Y%�X%�R%�S%�k%�j%�%�%�%�%�%�%�%����������������"����)"�a"��e"�d"� #�!#��H"��"��"� ��%�)���������������������������������r�rSrArB�rC����rLrTrP���r�r�r���r��r���rMrUrRrQ�rN��������������������������������rK��������������������������r���rF����������������������rG������rJ��rH����r���rI�����u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�rr�r�r�r�r�r�rr	r�r�r�r�r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�rrr�r�rrr�rrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r
(rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwrxryrzr{r|r}r~rr�r�r�r�r�r�r�r�r�r�r�r�rSrArBrCrLrTrPr�r�r�r�r�rMrUrRrQrNrKr�rFrGrJrHr�rIrEr�r�r�r�r�r�r�r�r�r�r�r�r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@r�rDr�r�r�r�r�r�r�r�rOr�r�rjrYr�rerfrrirZrhrgrkrsr`r{r|ror^r]rarzryrnrdrcrbrlrmrrr[r\r_rwrxrqrurvrpr~r}rtr�r�r�r�r�rVrWrXr�)�__doc__rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s$
����encodings/__pycache__/__init__.cpython-38.opt-1.pyc000064400000007501151153537620016066 0ustar00U

e5d��@s�dZddlZddlZddlmZiZdZdgZejZGdd�de	e
�Zd	d
�Zdd�Z
e�e
�ejd
kr|dd�Ze�e�dS)a2 Standard "encodings" Package

    Standard Python encoding modules are stored in this package
    directory.

    Codec modules must have names corresponding to normalized encoding
    names as defined in the normalize_encoding() function below, e.g.
    'utf-8' must be implemented by the module 'utf_8.py'.

    Each codec module must export the following interface:

    * getregentry() -> codecs.CodecInfo object
    The getregentry() API must return a CodecInfo object with encoder, decoder,
    incrementalencoder, incrementaldecoder, streamwriter and streamreader
    attributes which adhere to the Python Codec Interface Standard.

    In addition, a module may optionally also define the following
    APIs which are then used by the package's codec search function:

    * getaliases() -> sequence of encoding name strings to use as aliases

    Alias names returned by getaliases() must be normalized encoding
    names as defined by normalize_encoding().

Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

�N�)�aliasesz--unknown--�*c@seZdZdS)�CodecRegistryErrorN)�__name__�
__module__�__qualname__�r	r	�*/usr/lib64/python3.8/encodings/__init__.pyr(srcCsft|t�rt|d�}g}d}|D]:}|��s4|dkrV|rF|rF|�d�|�|�d}q d}q d�|�S)ae Normalize an encoding name.

        Normalization works as follows: all non-alphanumeric
        characters except the dot used for Python package names are
        collapsed and replaced with a single underscore, e.g. '  -;#'
        becomes '_'. Leading and trailing underscores are removed.

        Note that encoding names should be ASCII only.

    �asciiF�.�_T�)�
isinstance�bytes�str�isalnum�append�join)�encoding�chars�punct�cr	r	r
�normalize_encoding+s



rc
	Csvt�|t�}|tk	r|St|�}t�|�p:t�|�dd��}|dk	rN||g}n|g}|D]B}|rXd|krjqXztd|tdd�}Wntk
r�YqXXq�qXd}z
|j	}Wnt
k
r�d}YnX|dkr�dt|<dS|�}t|tj
��s(dt|�k�rdk�sntd|j|jf��t|d��r�t|d	��r�|d
dk	�rVt|d
��r�|ddk	�rrt|d��r�t|�dk�r�|ddk	�r�t|d��r�t|�dk�r�|ddk	�r�t|d��s�td
|j|jf��t|�dk�s�|ddk�r|ddt|�|j�dd	�d	f7}tj
|�}|t|<z|��}Wnt
k
�rRYn X|D]}	|	tk�rX|t|	<�qX|S)Nrr
z
encodings.r)�fromlist�level��z#module "%s" (%s) failed to registerr���z'incompatible codecs in module "%s" (%s)�)N)�_cache�get�_unknownr�_aliases�replace�
__import__�_import_tail�ImportError�getregentry�AttributeErrorr�codecs�	CodecInfo�lenrr�__file__�callable�split�
getaliases)
r�entry�
norm_encoding�aliased_encoding�modnames�modname�modr*�codecaliases�aliasr	r	r
�search_functionFs�	
��
�



�
�
�
�
�
�
�
�
�
�
�
�(

r;Zwin32cCsNz4ddl}d|��}||kr2ddl}|j��WSWntk
rHYnXdS)Nrzcp%s)�_winapiZGetACPZencodings.mbcs�mbcsr*r))rr<Zansi_code_pageZ	encodingsr	r	r
�_alias_mbcs�sr>)�__doc__r,�sysrrr"r$r(r%�LookupError�SystemErrorrrr;�register�platformr>r	r	r	r
�<module>sU

encodings/__pycache__/cp850.cpython-38.opt-2.pyc000064400000016342151153537620015172 0ustar00U

e5d9��@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�Ze�ed��Z	e	�
dddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�dd'dd:�ddgd�d|dsd&d�dld8d5d_dGdd*d3d{ddd d"d2d�d%d�d}d9d=d1d�d�dud�d�d�d�d�ddq�ddrdodwd(d-d,d4dMdUddd�d�d�dddd�dd0dd/�dd��dd!�d�d�d�d�d �d!�d"�d#�d$d<�d%�d&d`d^�d'dL�d(d�d)d#�d*�d+d+�d,�d-dd�d.dt�d/d$dd�dxd7dFdzdVd~dEdDdded6dd>dcd;dmd�dbdadfdpd)dyd�d�d�dv�d0��ZdS(1�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp850.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp850)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$�������������������������������������������������������������������������������%�%�%�%�$%������c%�Q%�W%�]%���%�%�4%�,%�%�%�<%�����Z%�T%�i%�f%�`%�P%�l%������������1�������%�%�%�%����%����������������������������� ������������%�)���������������������������������r�rSrcrBrurdr�r�r�r^rLrTrPr�rOr�r�r�r�r�r�r�r�r�r�r�rMrUrRrQr�rNr]r[r\rmr4r5r8r&rzr6rxryr�r|r}r~rwrKr�r�r�r�r?rDrCr�r�r�r@r�r�r�r+rFr)rlr*r,r7r-r0r(r.r/r3rGr2r1rvrJr;rHr9r�r:r�rAr=rIr<r'r�r�r>u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�(rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDr�rSrcrBrurdr�r�r�r^rLrTrPr�rOr�r�r�r�r�r�r�r�r�r�r�rMrUrRrQr�rNr]r[r\rmr4r5r8r&rzr6rxryr�r|r}r~rwrKr�r�r�r�r?rDrCr�r�r�r@r�r�r�r+rFr)rlr*r,r7r-r0r(r.r/r3rGr2r1rvrJr;rHr9r�r:r�rAr=rIr<r'r�r�r>r{rEr�rjrYr�rerfrrirZrhrgrkrsr`rorarnrbrrr_rqrprtr�r�r�rVrWrXr�)
rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s"
����encodings/__pycache__/cp500.cpython-38.opt-1.pyc000064400000004570151153537620015161 0ustar00U

e5dA3�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zs Python Character Mapping Codec cp500 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP500.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp500.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp500)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�œ	†—Ž
…‡’€‚ƒ„
ˆ‰Š‹Œ‘“”•–˜™š›ž  âäàáãåçñ[.<(+!&éêëèíîïìß]$*);^-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'="Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®¢£¥·©§¶¼½¾¬|¯¨´×{ABCDEFGHI­ôöòóõ}JKLMNOPQR¹ûüùúÿ\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙڟ)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/unicode_escape.cpython-38.opt-2.pyc000064400000003065151153537620017277 0ustar00U

e5d��@srddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdS)�Nc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codecs�unicode_escape_encode�encode�unicode_escape_decode�decode�rr�0/usr/lib64/python3.8/encodings/unicode_escape.pyr
src@seZdZddd�ZdS)�IncrementalEncoderFcCst�||j�dS�Nr)rr�errors��self�input�finalrrrrszIncrementalEncoder.encodeN)F)rrrrrrrrr
sr
c@seZdZddd�ZdS)�IncrementalDecoderFcCst�||j�dSr)rr	rrrrrr
szIncrementalDecoder.decodeN)F)rrrr
rrrrrsrc@seZdZdS)�StreamWriterN�rrrrrrrrsrc@seZdZdS)�StreamReaderNrrrrrrsrc	Cstjdtjtjttttd�S)Nzunicode-escape)�namerr
�incrementalencoder�incrementaldecoder�streamwriter�streamreader)	r�	CodecInforrr
r
rrrrrrr�getregentry$s�r)rrr
rrrrrrrr�<module>	sencodings/__pycache__/utf_8.cpython-38.opt-1.pyc000064400000003140151153537620015347 0ustar00U

e5d��@spdZddlZejZddd�ZGdd�dej�ZGdd	�d	ej�ZGd
d�dej�ZGdd
�d
ej	�Z	dd�Z
dS)z� Python 'utf-8' Codec


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

�N�strictcCst�||d�S)NT)�codecs�utf_8_decode)�input�errors�r�'/usr/lib64/python3.8/encodings/utf_8.py�decodesr	c@seZdZddd�ZdS)�IncrementalEncoderFcCst�||j�dS)Nr)r�utf_8_encoder)�selfr�finalrrr�encodeszIncrementalEncoder.encodeN)F)�__name__�
__module__�__qualname__rrrrrr
sr
c@seZdZejZdS)�IncrementalDecoderN)rrrrr�_buffer_decoderrrrrsrc@seZdZejZdS)�StreamWriterN)rrrrrrrrrrrsrc@seZdZejZdS)�StreamReaderN)rrrrrr	rrrrrsrc	Cstjdttttttd�S)Nzutf-8)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)r�	CodecInforr	r
rrrrrrr�getregentry!s�r)r)�__doc__rrrr	r
�BufferedIncrementalDecoderrrrrrrrr�<module>s
encodings/__pycache__/euc_jisx0213.cpython-38.pyc000064400000002623151153537620015507 0ustar00U

e5d�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�euc_jisx0213c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�./usr/lib64/python3.8/encodings/euc_jisx0213.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_jprZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/gb2312.cpython-38.pyc000064400000002607151153537620014272 0ustar00U

e5d�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�gb2312c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�(/usr/lib64/python3.8/encodings/gb2312.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_cnrZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/tis_620.cpython-38.opt-1.pyc000064400000004721151153537620015516 0ustar00U

e5d0�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zh Python Character Mapping Codec tis_620 generated from 'python-mappings/TIS-620.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�)/usr/lib64/python3.8/encodings/tis_620.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nztis-620)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ￾กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู￾￾￾￾฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛￾￾￾￾)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/euc_jisx0213.cpython-38.opt-2.pyc000064400000002623151153537620016447 0ustar00U

e5d�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�euc_jisx0213c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�./usr/lib64/python3.8/encodings/euc_jisx0213.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_jprZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/iso8859_1.cpython-38.opt-1.pyc000064400000004567151153537620015710 0ustar00U

e5dx3�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zj Python Character Mapping Codec iso8859_1 generated from 'MAPPINGS/ISO8859/8859-1.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/iso8859_1.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	iso8859-1)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp856.cpython-38.opt-1.pyc000064400000004666151153537620015205 0ustar00U

e5d�0�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zj Python Character Mapping Codec cp856 generated from 'MAPPINGS/VENDORS/MISC/CP856.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp856.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)NZcp856)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~אבגדהוזחטיךכלםמןנסעףפץצקרשת￾£￾×￾￾￾￾￾￾￾￾￾￾®¬½¼￾«»░▒▓│┤￾￾￾©╣║╗╝¢¥┐└┴┬├─┼￾￾╚╔╩╦╠═╬¤￾￾￾￾￾￾￾￾￾┘┌█▄¦￾▀￾￾￾￾￾￾µ￾￾￾￾￾￾￾¯´­±‗¾¶§÷¸°¨·¹³²■ )�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp720.cpython-38.opt-2.pyc000064400000004452151153537620015165 0ustar00U

e5dv5�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp720.py�encode
szCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
rs
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)NZcp720)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry#s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€éâ„à†çêëèïّْô¤ـûùءآأؤ£إئابةتثجحخدذرزسشص«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ضطظعغفµقكلمنهوىي≡ًٌٍَُِ≈°∙·√ⁿ²■ )
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/iso8859_2.cpython-38.opt-1.pyc000064400000004567151153537620015711 0ustar00U

e5d\4�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zj Python Character Mapping Codec iso8859_2 generated from 'MAPPINGS/ISO8859/8859-2.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/iso8859_2.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	iso8859-2)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/base64_codec.cpython-38.opt-2.pyc000064400000004112151153537620016544 0ustar00U

e5d��@s�ddlZddlZddd�Zddd�ZGdd�dej�ZGd	d
�d
ej�ZGdd�dej�ZGd
d�deej�ZGdd�deej�Zdd�Z	dS)�N�strictcCst�|�t|�fS�N)�base64�encodebytes�len��input�errors�r
�./usr/lib64/python3.8/encodings/base64_codec.py�
base64_encode
srcCst�|�t|�fSr)r�decodebytesrrr
r
r�
base64_decodesrc@s eZdZddd�Zddd�ZdS)	�CodecrcCs
t||�Sr)r��selfrr	r
r
r�encodeszCodec.encodecCs
t||�Sr)rrr
r
r�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrr
r
r
rrs
rc@seZdZddd�ZdS)�IncrementalEncoderFcCs
t�|�Sr)rr�rr�finalr
r
rrszIncrementalEncoder.encodeN)F)rrrrr
r
r
rrsrc@seZdZddd�ZdS)�IncrementalDecoderFcCs
t�|�Sr)rr
rr
r
rr!szIncrementalDecoder.decodeN)F)rrrrr
r
r
rr src@seZdZeZdS)�StreamWriterN�rrr�bytes�charbuffertyper
r
r
rr%src@seZdZeZdS)�StreamReaderNrr
r
r
rr(src
Cstjdttttttdd�S)NrF)�namerr�incrementalencoder�incrementaldecoder�streamwriter�streamreader�_is_text_encoding)�codecs�	CodecInforrrrrrr
r
r
r�getregentry-s�r()r)r)
r&rrrrrrrrr(r
r
r
r�<module>s

encodings/__pycache__/ascii.cpython-38.pyc000064400000003533151153537620014461 0ustar00U

e5d��@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�ZGd
d�dee�Zdd�ZdS)z� Python 'ascii' Codec


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

�Nc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codecs�ascii_encode�encode�ascii_decode�decode�rr�'/usr/lib64/python3.8/encodings/ascii.pyr
src@seZdZddd�ZdS)�IncrementalEncoderFcCst�||j�dS�Nr)rr�errors��self�input�finalrrrrszIncrementalEncoder.encodeN)F)rrrrrrrrr
sr
c@seZdZddd�ZdS)�IncrementalDecoderFcCst�||j�dSr)rr	rrrrrr
szIncrementalDecoder.decodeN)F)rrrr
rrrrrsrc@seZdZdS)�StreamWriterN�rrrrrrrrsrc@seZdZdS)�StreamReaderNrrrrrrsrc@seZdZejZejZdS)�StreamConverterN)rrrrr	rrr
rrrrr"src	Cstjdtjtjttttd�S)N�ascii)�namerr
�incrementalencoder�incrementaldecoder�streamwriter�streamreader)	r�	CodecInforrr
r
rrrrrrr�getregentry)s�r )	�__doc__rrr
rrrrr rrrr�<module>sencodings/__pycache__/cp500.cpython-38.opt-2.pyc000064400000004364151153537620015163 0ustar00U

e5dA3�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp500.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp500)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�œ	†—Ž
…‡’€‚ƒ„
ˆ‰Š‹Œ‘“”•–˜™š›ž  âäàáãåçñ[.<(+!&éêëèíîïìß]$*);^-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'="Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®¢£¥·©§¶¼½¾¬|¯¨´×{ABCDEFGHI­ôöòóõ}JKLMNOPQR¹ûüùúÿ\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙڟ)
rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp1255.cpython-38.opt-1.pyc000064400000004650151153537620015250 0ustar00U

e5d�0�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zv Python Character Mapping Codec cp1255 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1255.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1255.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1255)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€￾‚ƒ„…†‡ˆ‰￾‹￾￾￾￾￾‘’“”•–—˜™￾›￾￾￾￾ ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹ￾ֻּֽ־ֿ׀ׁׂ׃װױײ׳״￾￾￾￾￾￾￾אבגדהוזחטיךכלםמןנסעףפץצקרשת￾￾‎‏￾)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp1251.cpython-38.opt-2.pyc000064400000004411151153537620015240 0ustar00U

e5d14�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1251.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1251)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—￾™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя)
rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp1255.cpython-38.opt-2.pyc000064400000004441151153537620015247 0ustar00U

e5d�0�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1255.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1255)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€￾‚ƒ„…†‡ˆ‰￾‹￾￾￾￾￾‘’“”•–—˜™￾›￾￾￾￾ ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹ￾ֻּֽ־ֿ׀ׁׂ׃װױײ׳״￾￾￾￾￾￾￾אבגדהוזחטיךכלםמןנסעףפץצקרשת￾￾‎‏￾)
rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/euc_jis_2004.cpython-38.pyc000064400000002623151153537620015456 0ustar00U

e5d�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�euc_jis_2004c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�./usr/lib64/python3.8/encodings/euc_jis_2004.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_jprZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/cp1254.cpython-38.pyc000064400000004625151153537620014312 0ustar00U

e5d�4�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zv Python Character Mapping Codec cp1254 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1254.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1254.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1254)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€￾‚ƒ„…†‡ˆ‰Š‹Œ￾￾￾￾‘’“”•–—˜™š›œ￾￾Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp1125.cpython-38.pyc000064400000017703151153537620014310 0ustar00U

e5d%��@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d �d!�d"�d#�d$�d%�d&�d'�d(�d)�d*�d+�d,�d-�d.�d/�d0�d1�d2�d3�d4�d5�d6�d7d��d8�d9�d:d��d;�d<�d=�d>�d?�d@�dA�dB�dC�dD�dE�dF�dG�dH�dI�dJ�dK�dL�dM�dN�dO�dP�dQ�dR�dS�dT�dU�dV�dW�dX�dY�dZ�d[�d\�d]�d^�d_�d`�da�db�dc�dd�de�df�dg�dh�di�dj�dk�dl�dm�dnd��do�dp�dq�dr�ds�dt�du�dv�dw�dx�dy�dz�d{�d|�d}�d~�d�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d���Z
dS(�z, Python Character Mapping Codec for CP1125

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1125.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1125)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$������������������ �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�%�%�%�%�$%�a%�b%�V%�U%�c%�Q%�W%�]%�\%�[%�%�%�4%�,%�%�%�<%�^%�_%�Z%�T%�i%�f%�`%�P%�l%�g%�h%�d%�e%�Y%�X%�R%�S%�k%�j%�%�%�%�%�%�%�%�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O��Q����T��V��W��"�!��%�)���������������������������������r����r�������������������r����������������������������������������������������������������������������������������������������������������������������u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r"r rrrrrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrr	r
rrr
rrrrrrrrrrrrrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r�rrr�r�r�r!(rr#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwrxryrzr{r|r}r~rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rjrYr�rerfrrirZrhrgrkrsr`r{r|ror^r]rarzryrnrdrcrbrlrmrrr[r\r_rwrxrqrurvrpr~r}rtr�r�r�r�r�rVrWrXr�)�__doc__rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s$
����encodings/__pycache__/iso2022_jp_2.cpython-38.pyc000064400000002630151153537620015400 0ustar00U

e5d%�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�iso2022_jp_2c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�./usr/lib64/python3.8/encodings/iso2022_jp_2.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z_codecs_iso2022rZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/cp932.cpython-38.opt-2.pyc000064400000002605151153537620015170 0ustar00U

e5d��@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�cp932c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�'/usr/lib64/python3.8/encodings/cp932.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_jprZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/kz1048.cpython-38.pyc000064400000004606151153537620014334 0ustar00U

e5d�5�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zl Python Character Mapping Codec kz1048 generated from 'MAPPINGS/VENDORS/MISC/KZ1048.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/kz1048.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�kz1048)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—￾™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/gb18030.cpython-38.opt-1.pyc000064400000002611151153537620015310 0ustar00U

e5d�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�gb18030c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�)/usr/lib64/python3.8/encodings/gb18030.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_cnrZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/mbcs.cpython-38.opt-1.pyc000064400000003261151153537620015252 0ustar00U

e5d��@s~dZddlmZmZddlZeZddd�ZGdd�dej�ZGd	d
�d
ej�ZGdd�dej	�Z	Gd
d�dej
�Z
dd�ZdS)z� Python 'mbcs' Codec for Windows


Cloned by Mark Hammond (mhammond@skippinet.com.au) from ascii.py,
which was written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

�)�mbcs_encode�mbcs_decodeN�strictcCst||d�S)NT)r)�input�errors�r�&/usr/lib64/python3.8/encodings/mbcs.py�decodesr	c@seZdZddd�ZdS)�IncrementalEncoderFcCst||j�dS)Nr)rr)�selfr�finalrrr�encodeszIncrementalEncoder.encodeN)F)�__name__�
__module__�__qualname__r
rrrrr
sr
c@seZdZeZdS)�IncrementalDecoderN)rrrr�_buffer_decoderrrrrsrc@seZdZeZdS)�StreamWriterN)rrrrr
rrrrrsrc@seZdZeZdS)�StreamReaderN)rrrrr	rrrrr!src	Cstjdttttttd�S)N�mbcs)�namer
r	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)�codecs�	CodecInfor
r	r
rrrrrrr�getregentry&s�r)r)�__doc__rrrr
r	r
�BufferedIncrementalDecoderrrrrrrrr�<module>s
encodings/__pycache__/iso8859_10.cpython-38.opt-1.pyc000064400000004574151153537620015766 0ustar00U

e5d5�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zl Python Character Mapping Codec iso8859_10 generated from 'MAPPINGS/ISO8859/8859-10.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�,/usr/lib64/python3.8/encodings/iso8859_10.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz
iso8859-10)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨͧĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp862.cpython-38.opt-2.pyc000064400000017354151153537620015201 0ustar00U

e5dZ��@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�Ze�ed��Z	e	�
dddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�dd5�dd3�d�dd2�d�dd9d=�dd,d/d�d<�dd*�dd+�d�d �d!�d"�d#�d$�d%�d&�d'�d(�d)�d*d0�d+�d,�d-�d.�d/�d0�d1�d2�d3�d4�d5�d6�d7�d8�d9�d:�d;�d<�d=�d>�d?�d@�dA�dB�dC�dD�dE�dF�dG�dH�dI�dJ�dKd��dLd1�dM�dN�dO�dP�dQ�dR�dSd7�dT�dU�dV�dW�dX�dY�dZ�d[d6�d\�d]�d^�d_d�d>�d`�da�db�dcd:d;�dd�de�dfdu�dg�dhd4�di�dj�dk�dl�dm�dn�do�dpdp�dq�dr�ds�dtd�d�d��du�dv��ZdS(w�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp862.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp862)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$����������������������������������������������������������� ����������������#�������%�%�%�%�$%�a%�b%�V%�U%�c%�Q%�W%�]%�\%�[%�%�%�4%�,%�%�%�<%�^%�_%�Z%�T%�i%�f%�`%�P%�l%�g%�h%�d%�e%�Y%�X%�R%�S%�k%�j%�%�%�%�%�%�%�%����������������"����)"�a"��e"�d"� #�!#��H"��"��"� ��%�)���������������������������������r�rSrArB�rC����rLrTrP���r�r�r���r��r���rMrUrRrQ�rN��������������������������������rK��������������������������r���rF����������������������rG������rJ��rH����r���rI�����u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�rr�r�r�r�r�r�rr	r�r�r�r�r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�rrr�r�rrr�rrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r
(rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwrxryrzr{r|r}r~rr�r�r�r�r�r�r�r�r�r�r�r�rSrArBrCrLrTrPr�r�r�r�r�rMrUrRrQrNrKr�rFrGrJrHr�rIrEr�r�r�r�r�r�r�r�r�r�r�r�r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@r�rDr�r�r�r�r�r�r�r�rOr�r�rjrYr�rerfrrirZrhrgrkrsr`r{r|ror^r]rarzryrnrdrcrbrlrmrrr[r\r_rwrxrqrurvrpr~r}rtr�r�r�r�r�rVrWrXr�)
rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s"
����encodings/__pycache__/cp1254.cpython-38.opt-2.pyc000064400000004416151153537620015250 0ustar00U

e5d�4�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1254.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1254)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€￾‚ƒ„…†‡ˆ‰Š‹Œ￾￾￾￾‘’“”•–—˜™š›œ￾￾Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ)
rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp1006.cpython-38.pyc000064400000004704151153537620014303 0ustar00U

e5d5�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zl Python Character Mapping Codec cp1006 generated from 'MAPPINGS/VENDORS/MISC/CP1006.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1006.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)NZcp1006)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ۰۱۲۳۴۵۶۷۸۹،؛­؟ﺁﺍﺎﺎﺏﺑﭖﭘﺓﺕﺗﭦﭨﺙﺛﺝﺟﭺﭼﺡﺣﺥﺧﺩﮄﺫﺭﮌﺯﮊﺱﺳﺵﺷﺹﺻﺽﺿﻁﻅﻉﻊﻋﻌﻍﻎﻏﻐﻑﻓﻕﻗﻙﻛﮒﮔﻝﻟﻠﻡﻣﮞﻥﻧﺅﻭﮦﮨﮩﮪﺀﺉﺊﺋﻱﻲﻳﮰﮮﹼﹽ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp863.cpython-38.opt-2.pyc000064400000017057151153537620015202 0ustar00U

e5d̅�@sPddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�Ze�ed��Z	e	�
dddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�dd��dd'�d�dd�d�d�dd/�d�d�dd2�dd6d9d=�d�d�d �d!�d"�d#�d$�d%d3�d&�d'�d(�d)�d*�d+�d,�d-�d.�d/�d0�d1�d2�d3�d4d*�d5�d6�d7d+�d8�d9�d:dd�d;ddddd�d<�d=d�d>�d?dd&d%�d@dd��dAd1�dB�dCd"�dD�dEd5�dF�dGdd,�dHd0d�dI�dJ�dK�dL�dM�dNdd4d�d>d(�dOd d<d:d;�dPd�dQdud�dR�dS�dTd#d$�dUd!�dV�dWd7dpd)d-�dX�dYd�d�d��dZ�d[��ZdS(\�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp863.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp863)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$�������������������������� ����������������������������������������#�������%�%�%�%�$%�a%�b%�V%�U%�c%�Q%�W%�]%�\%�[%�%�%�4%�,%�%�%�<%�^%�_%�Z%�T%�i%�f%�`%�P%�l%�g%�h%�d%�e%�Y%�X%�R%�S%�k%�j%�%�%�%�%�%�%�%����������������"����)"�a"��e"�d"� #�!#��H"��"��"� ��%�)���������������������������������r��rArBr>�rFr5rJ��rTrP��rMr�r�r�rLrGr�r,r�rK��rUrRrQrS�r4�r*��������r&r7r6r8r:����rNr;��������r?��������rC��rDr@����r�r+��r)��������r-r0r(r.r/����r2r1������rHr9��r��r=rIr<r'���u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�(rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnror�rArBr>rFr5rJrTrPrMr�r�r�rLrGr�r,r�rKrUrRrQrSr4r*r&r7r6r8r:rNr;r?rCrDr@r�r+r)r-r0r(r.r/r2r1rHr9r�r=rIr<r'rEr�r�r�r�r�r�r�r�r�r�r�r�r3r�r�r�r�r�r�r�r�r�rOr�r�rjrYr�rerfrrirZrhrgrkrsr`r{r|ror^r]rarzryrnrdrcrbrlrmrrr[r\r_rwrxrqrurvrpr~r}rtr�r�r�r�r�rVrWrXr�)
rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s"
����encodings/__pycache__/iso2022_jp.cpython-38.opt-1.pyc000064400000002624151153537620016121 0ustar00U

e5d�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�
iso2022_jpc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�,/usr/lib64/python3.8/encodings/iso2022_jp.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z_codecs_iso2022rZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/undefined.cpython-38.pyc000064400000004061151153537620015327 0ustar00U

e5d�@svdZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdS)a5 Python 'undefined' Codec

    This codec will always raise a ValueError exception when being
    used. It is intended for use by the site.py file to switch off
    automatic string to Unicode coercion.

Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCstd��dS�Nzundefined encoding��UnicodeError��self�input�errors�r�+/usr/lib64/python3.8/encodings/undefined.py�encodeszCodec.encodecCstd��dSrrrrrr�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__r
rrrrrrs
rc@seZdZddd�ZdS)�IncrementalEncoderFcCstd��dSrr�rr	�finalrrrr
szIncrementalEncoder.encodeN)F)rrrr
rrrrrsrc@seZdZddd�ZdS)�IncrementalDecoderFcCstd��dSrrrrrrrszIncrementalDecoder.decodeN)F)rrrrrrrrrsrc@seZdZdS)�StreamWriterN�rrrrrrrr src@seZdZdS)�StreamReaderNrrrrrr#src	Cs tjdt�jt�jttttd�S)NZ	undefined)�namer
r�incrementalencoder�incrementaldecoder�streamwriter�streamreader)	�codecs�	CodecInforr
rrrrrrrrr�getregentry(s�r )�__doc__rrrrrrr rrrr�<module>sencodings/__pycache__/iso8859_11.cpython-38.opt-1.pyc000064400000004732151153537620015763 0ustar00U

e5d/0�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zl Python Character Mapping Codec iso8859_11 generated from 'MAPPINGS/ISO8859/8859-11.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�,/usr/lib64/python3.8/encodings/iso8859_11.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz
iso8859-11)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู￾￾￾￾฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛￾￾￾￾)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/punycode.cpython-38.pyc000064400000014255151153537620015222 0ustar00U

e5d��@s�dZddlZdd�Zdd�Zdd�Zd	d
�Zdd�Zd
Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZGdd�dej�ZGdd�dej�ZGd d!�d!ej�ZGd"d#�d#eej�ZGd$d%�d%eej�Zd&d'�ZdS)(uY Codec for the Punicode encoding, as specified in RFC 3492

Written by Martin v. Löwis.
�NcCsPt�}t�}|D]*}t|�dkr0|�t|��q|�|�qt|�}t|�|fS)z 3.1 Basic code point segregation�)�	bytearray�set�ord�append�add�sorted�bytes)�str�base�extended�c�r�*/usr/lib64/python3.8/encodings/punycode.py�	segregate
srcCs&d}|D]}t|�|kr|d7}q|S)z@Return the length of str, considering only characters below max.r�)r)r
�max�resr
rrr�
selective_lens

rcCsNt|�}|d7}||krdS||}||kr8|d|fS||kr|d7}qdS)aReturn a pair (index, pos), indicating the next occurrence of
    char in str. index is the position of the character considering
    only ordinals up to and including char, and pos is the position in
    the full string. index/pos is the starting position in the full
    string.r)���rN)�len)r
�char�index�pos�lr
rrr�selective_findsrcCs�d}g}d}|D]r}d}}t|�}t||�}	|	d||}
t||||�\}}|dkrZq~|
||7}
|�|
d�|}d}
q>|}q|S)�3.2 Insertion unsort codingrrrr)rrrr)r
rZoldchar�resultZoldindexr
rrrZcurlen�deltarrr�insertion_unsort0s"
rcCs,d|d|}|dkrdS|dkr(dS|S)N�$r�r)�j�biasrrrr�TFsr$s$abcdefghijklmnopqrstuvwxyz0123456789cCsnt�}d}t||�}||kr2|�t|�t|�S|�t|||d|�||d|}|d7}q
dS)�(3.3 Generalized variable-length integersrr rN)rr$r�digitsr	)�Nr#rr"�trrr�generate_generalized_integerNs
r)cCsX|r|d}n|d}|||7}d}|dkr@|d}|d7}q&|d||d}|S)Ni��ri��#r �&r)r�first�numcharsZ	divisionsr#rrr�adapt[s

r/cCsPt�}d}t|�D]4\}}t||�}|�|�t||dk||d�}qt|�S)z3.4 Bias adaptation�Hrr)r�	enumerater)�extendr/r	)Zbaselen�deltasrr#Zpointsr�srrr�generate_integersjs

r5cCs8t|�\}}t||�}tt|�|�}|r4|d|S|S)N�-)rrr5r)�textrrr3rrr�punycode_encodeus
r8c
Csd}d}d}zt||�}Wn0tk
rL|dkr<td��|ddfYSX|d7}d|krjdkrxnn
|d}nHd|kr�d	kr�nn
|d
}n&|dkr�td||d��n|dfSt||�}	|||7}||	kr�||fS|d|	}|d7}qdS)
r%rr�strictzincomplete punicode stringN�A�Z�0�9�z Invalid extended code point '%s'r )r�
IndexError�UnicodeErrorr$)
r�extposr#�errorsr�wr"r�digitr(rrr�decode_generalized_numbers2


�
rEc	Cs�d}d}d}d}|t|�kr�t||||�\}}|dkr:|S||d7}||t|�d7}|dkr~|dkrvtd	|��td
�}|t|�d}|d|�t|�||d�}t||dkt|��}|}q|S)rrrr0rNri��r9zInvalid character U+%x�?)rrEr@r�chrr/)	rrrBrrr#rAZnewposrrrr�insertion_sort�s,� rHcCs�t|t�r|�d�}t|t�r&t|�}|�d�}|dkrLd}t|d���}n.t|d|�d|�}t||dd�d���}t|||�S)N�asciir6r�r)�
isinstancer
�encode�
memoryviewr	�rfind�upperrH)r7rBrrrrrr�punycode_decode�s



rPc@s eZdZddd�Zddd�ZdS)	�Codecr9cCst|�}|t|�fS�N)r8r��self�inputrBrrrrrL�szCodec.encodecCs*|dkrtd|��t||�}|t|�fS�N)r9�replace�ignorezUnsupported error handling )r@rPrrSrrr�decode�s
zCodec.decodeN)r9)r9)�__name__�
__module__�__qualname__rLrYrrrrrQ�s
rQc@seZdZddd�ZdS)�IncrementalEncoderFcCst|�SrR)r8�rTrU�finalrrrrL�szIncrementalEncoder.encodeN)F)rZr[r\rLrrrrr]�sr]c@seZdZddd�ZdS)�IncrementalDecoderFcCs$|jdkrtd|j��t||j�SrV)rBr@rPr^rrrrY�s
zIncrementalDecoder.decodeN)F)rZr[r\rYrrrrr`�sr`c@seZdZdS)�StreamWriterN�rZr[r\rrrrra�srac@seZdZdS)�StreamReaderNrbrrrrrc�srcc	Cs tjdt�jt�jttttd�S)NZpunycode)�namerLrY�incrementalencoder�incrementaldecoder�streamwriter�streamreader)	�codecs�	CodecInforQrLrYr]r`rarcrrrr�getregentry�s�rk)�__doc__rirrrrr$r&r)r/r5r8rErHrPrQr]r`rarcrkrrrr�<module>s(

encodings/__pycache__/cp866.cpython-38.pyc000064400000017757151153537620014254 0ustar00U

e5d\��@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d �d!�d"�d#�d$�d%�d&�d'�d(�d)�d*�d+�d,�d-�d.�d/�d0�d1�d2�d3�d4�d5�d6�d7�d8d��d9�d:�d;d��d<�d=�d>�d?�d@�dA�dB�dC�dD�dE�dF�dG�dH�dI�dJ�dK�dL�dM�dN�dO�dP�dQ�dR�dS�dT�dU�dV�dW�dX�dY�dZ�d[�d\�d]�d^�d_�d`�da�db�dc�dd�de�df�dg�dh�di�dj�dk�dl�dm�dnd��do�dp�dq�dr�ds�dt�du�dv�dw�dx�dy�dz�d{�d|�d}�d~�d�d��d��d��d��d��d��d��d��d��d�d��d��d��d��d���Z
dS(�z` Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP866.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp866.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp866)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$������������������ �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�%�%�%�%�$%�a%�b%�V%�U%�c%�Q%�W%�]%�\%�[%�%�%�4%�,%�%�%�<%�^%�_%�Z%�T%�i%�f%�`%�P%�l%�g%�h%�d%�e%�Y%�X%�R%�S%�k%�j%�%�%�%�%�%�%�%�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O��Q��T��W��^��"��"�!��%�)���������������������������������r����r������������r�������r����������������������������������������������������������������������������������������������������������������������������u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r!rrrrrrrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrr	r
rrr
rrrrrrrrrrrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r�r�rr�r�r (rr"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwrxryrzr{r|r}r~rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rjrYr�rerfrrirZrhrgrkrsr`r{r|ror^r]rarzryrnrdrcrbrlrmrrr[r\r_rwrxrqrurvrpr~r}rtr�r�r�r�r�rVrWrXr�)�__doc__rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s$
����encodings/__pycache__/cp1125.cpython-38.opt-1.pyc000064400000017703151153537620015247 0ustar00U

e5d%��@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d �d!�d"�d#�d$�d%�d&�d'�d(�d)�d*�d+�d,�d-�d.�d/�d0�d1�d2�d3�d4�d5�d6�d7d��d8�d9�d:d��d;�d<�d=�d>�d?�d@�dA�dB�dC�dD�dE�dF�dG�dH�dI�dJ�dK�dL�dM�dN�dO�dP�dQ�dR�dS�dT�dU�dV�dW�dX�dY�dZ�d[�d\�d]�d^�d_�d`�da�db�dc�dd�de�df�dg�dh�di�dj�dk�dl�dm�dnd��do�dp�dq�dr�ds�dt�du�dv�dw�dx�dy�dz�d{�d|�d}�d~�d�d��d��d��d��d��d��d��d��d��d��d��d��d��d��d���Z
dS(�z, Python Character Mapping Codec for CP1125

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1125.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1125)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$������������������ �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�%�%�%�%�$%�a%�b%�V%�U%�c%�Q%�W%�]%�\%�[%�%�%�4%�,%�%�%�<%�^%�_%�Z%�T%�i%�f%�`%�P%�l%�g%�h%�d%�e%�Y%�X%�R%�S%�k%�j%�%�%�%�%�%�%�%�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O��Q����T��V��W��"�!��%�)���������������������������������r����r�������������������r����������������������������������������������������������������������������������������������������������������������������u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r"r rrrrrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrr	r
rrr
rrrrrrrrrrrrrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r�rrr�r�r�r!(rr#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwrxryrzr{r|r}r~rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rjrYr�rerfrrirZrhrgrkrsr`r{r|ror^r]rarzryrnrdrcrbrlrmrrr[r\r_rwrxrqrurvrpr~r}rtr�r�r�r�r�rVrWrXr�)�__doc__rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s$
����encodings/__pycache__/cp874.cpython-38.opt-1.pyc000064400000004770151153537620015201 0ustar00U

e5d31�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zt Python Character Mapping Codec cp874 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP874.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp874.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)NZcp874)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€￾￾￾￾…￾￾￾￾￾￾￾￾￾￾￾‘’“”•–—￾￾￾￾￾￾￾￾ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู￾￾￾￾฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛￾￾￾￾)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp949.cpython-38.pyc000064400000002605151153537620014240 0ustar00U

e5d��@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�cp949c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�'/usr/lib64/python3.8/encodings/cp949.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_krrZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/zlib_codec.cpython-38.pyc000064400000006047151153537620015471 0ustar00U

e5d��@s�dZddlZddlZddd�Zddd�ZGdd	�d	ej�ZGd
d�dej�ZGdd
�d
ej�ZGdd�deej�ZGdd�deej	�Z	dd�Z
dS)z�Python 'zlib_codec' Codec - zlib compression encoding.

This codec de/encodes from bytes to bytes.

Written by Marc-Andre Lemburg (mal@lemburg.com).
�N�strictcCs|dkst�t�|�t|�fS�Nr)�AssertionError�zlib�compress�len��input�errors�r�,/usr/lib64/python3.8/encodings/zlib_codec.py�zlib_encode
sr
cCs|dkst�t�|�t|�fSr)rr�
decompressrrrrr�zlib_decodesrc@s eZdZddd�Zddd�ZdS)	�CodecrcCs
t||�S�N)r
��selfr	r
rrr�encodeszCodec.encodecCs
t||�Sr)rrrrr�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrrrs
rc@s(eZdZd
dd�Zddd�Zdd�Zd	S)�IncrementalEncoderrcCs |dkst�||_t��|_dSr)rr
r�compressobj�rr
rrr�__init__szIncrementalEncoder.__init__FcCs.|r|j�|�}||j��S|j�|�SdSr)rr�flush�rr	�final�crrrr!szIncrementalEncoder.encodecCst��|_dSr)rr�rrrr�reset(szIncrementalEncoder.resetN)r)F)rrrrrr"rrrrrs

rc@s(eZdZd
dd�Zddd�Zdd�Zd	S)�IncrementalDecoderrcCs |dkst�||_t��|_dSr)rr
r�
decompressobjrrrrr,szIncrementalDecoder.__init__FcCs.|r|j�|�}||j��S|j�|�SdSr)r$rrrrrrr1szIncrementalDecoder.decodecCst��|_dSr)rr$r!rrrr"8szIncrementalDecoder.resetN)r)F)rrrrrr"rrrrr#+s

r#c@seZdZeZdS)�StreamWriterN�rrr�bytes�charbuffertyperrrrr%;sr%c@seZdZeZdS)�StreamReaderNr&rrrrr)>sr)c
Cstjdttttttdd�S)NrF)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter�_is_text_encoding)�codecs�	CodecInfor
rrr#r)r%rrrr�getregentryCs�r2)r)r)�__doc__r0rr
rrrr#r%r)r2rrrr�<module>s

encodings/__pycache__/hp_roman8.cpython-38.opt-1.pyc000064400000005101151153537620016214 0ustar00U

e5d�4�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)a- Python Character Mapping Codec generated from 'hp_roman8.txt' with gencodec.py.

    Based on data from ftp://dkuug.dk/i18n/charmaps/HP-ROMAN8 (Keld Simonsen)

    Original source: LaserJet IIP Printer User's Manual HP part no
    33471-90901, Hewlet-Packard, June 1989.

    (Used with permission)

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/hp_roman8.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
rs
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
r src@seZdZdS)�StreamReaderNrrrrr
r#src	Cs tjdt�jt�jttttd�S)Nz	hp-roman8)�namerr�incrementalencoder�incrementaldecoder�streamwriter�streamreader)	r�	CodecInforrrrrrrrrrr
�getregentry(s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±￾)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/uu_codec.cpython-38.opt-2.pyc000064400000005523151153537620016120 0ustar00U

e5d#�@s�ddlZddlZddlmZddd�Zddd	�ZGd
d�dej�ZGdd
�d
ej�ZGdd�dej�ZGdd�deej	�Z	Gdd�deej
�Z
dd�ZdS)�N)�BytesIO�strict�<data>�c	Cs�t|�}t�}|j}|j}|�dd�}|�dd�}|d|d@|f�d��|d�}|rp|t�|��|d�}qT|d	�|��t|�fS)
N�
z\n�
z\rzbegin %o %s
i��ascii�-s 
end
)	r�read�write�replace�encode�binasciiZb2a_uu�getvalue�len)	�input�errors�filename�mode�infile�outfiler
r�chunk�r�*/usr/lib64/python3.8/encodings/uu_codec.py�	uu_encodes
rc

Cs�t|�}t�}|j}|j}|�}|s,td��|dd�dkrq@q|�}|r�|dkrTq�zt�|�}WnRtjk
r�}z2|ddd@ddd	}	t�|d|	��}W5d}~XYnX||�q@|s�td
��|��t|�fS)Nz"Missing "begin" line in input data�sbeginsend
r� �?��zTruncated input data)	r�readliner�
ValueErrorrZa2b_uu�Errorrr)
rrrrr r�s�data�v�nbytesrrr�	uu_decode%s*$
r'c@s eZdZddd�Zddd�ZdS)	�CodecrcCs
t||�S�N)r��selfrrrrrr
GszCodec.encodecCs
t||�Sr))r'r*rrr�decodeJszCodec.decodeN)r)r)�__name__�
__module__�__qualname__r
r,rrrrr(Fs
r(c@seZdZddd�ZdS)�IncrementalEncoderFcCst||j�dS�Nr)rr�r+r�finalrrrr
NszIncrementalEncoder.encodeN)F)r-r.r/r
rrrrr0Msr0c@seZdZddd�ZdS)�IncrementalDecoderFcCst||j�dSr1)r'rr2rrrr,RszIncrementalDecoder.decodeN)F)r-r.r/r,rrrrr4Qsr4c@seZdZeZdS)�StreamWriterN�r-r.r/�bytes�charbuffertyperrrrr5Usr5c@seZdZeZdS)�StreamReaderNr6rrrrr9Xsr9c
Cstjdttttttdd�S)N�uuF)�namer
r,�incrementalencoder�incrementaldecoder�streamreader�streamwriter�_is_text_encoding)�codecs�	CodecInforr'r0r4r9r5rrrr�getregentry]s�rC)rrr)r)rAr�iorrr'r(r0r4r5r9rCrrrr�<module>
s

!encodings/__pycache__/gb18030.cpython-38.pyc000064400000002611151153537620014351 0ustar00U

e5d�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�gb18030c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�)/usr/lib64/python3.8/encodings/gb18030.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_cnrZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/iso2022_jp_ext.cpython-38.opt-1.pyc000064400000002634151153537620017002 0ustar00U

e5d-�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�iso2022_jp_extc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�0/usr/lib64/python3.8/encodings/iso2022_jp_ext.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z_codecs_iso2022rZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/cp1006.cpython-38.opt-1.pyc000064400000004704151153537620015242 0ustar00U

e5d5�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zl Python Character Mapping Codec cp1006 generated from 'MAPPINGS/VENDORS/MISC/CP1006.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1006.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)NZcp1006)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ۰۱۲۳۴۵۶۷۸۹،؛­؟ﺁﺍﺎﺎﺏﺑﭖﭘﺓﺕﺗﭦﭨﺙﺛﺝﺟﭺﭼﺡﺣﺥﺧﺩﮄﺫﺭﮌﺯﮊﺱﺳﺵﺷﺹﺻﺽﺿﻁﻅﻉﻊﻋﻌﻍﻎﻏﻐﻑﻓﻕﻗﻙﻛﮒﮔﻝﻟﻠﻡﻣﮞﻥﻧﺅﻭﮦﮨﮩﮪﺀﺉﺊﺋﻱﻲﻳﮰﮮﹼﹽ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/iso8859_5.cpython-38.pyc000064400000004570151153537620014747 0ustar00U

e5d�2�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zj Python Character Mapping Codec iso8859_5 generated from 'MAPPINGS/ISO8859/8859-5.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/iso8859_5.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	iso8859-5)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp852.cpython-38.pyc000064400000017316151153537620014236 0ustar00U

e5d���@sldZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�d�d�d�dd��d�d�d�d�d�ddpd)d.�d d�d!�d"d�d#d1d0d��d$�d%�d&�d'�d(�d)�d*�d+�d,�d-d$�d.�d/�d0�d1dd_�d2�d3�d4d:�d5�d6dr�d7�d8d��d9�d:�d;�d<�d=�d>�d?�d@�dA�dBd�dC�dD�dE�dF�dG�dHdd|�dI�dJd�d��dKdd}d�dL�dM�dN�dOd�dP�dQd>�dR�dS�dTd�d2d#d3�dU�dVd�dWdy�dX�dY�dZ�d[ddFdE�d\df�d]d d?�d^�d_�d`�dadc�dbdgdqd*�dcd��dd�de�df�dg��Z
dS(hz` Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP852.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp852.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp852)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$�����������o����B���P�Q���y������9�:����=�>�Z�[�����d�e�A���
����������}�~����z��_���%�%�%�%�$%�����^�c%�Q%�W%�]%�{�|�%�%�4%�,%�%�%�<%���Z%�T%�i%�f%�`%�P%�l%��������G������%�%�%�%�b�n�%�������C�D�H�`�a�T���U�p����c������������������q�X�Y�%�)���������������������������������r����ru��r�r���rTrPr���r����r����r���rU�����r[r\��r4����r&��r6��ry��r|r}��������r�r���r?rD����r���r@r���r���rFr)��r*����r-��r(��r/��rGr2��������rHr9�r:r���rI�r'r���u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�(rr�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwrxryrzr�rur�r�rTrPr�r�r�r�rUr[r\r4r&r6ryr|r}r�r�r?rDr�r@r�r�rFr)r*r-r(r/rGr2rHr9r:r�rIr'r�rlrmrJrKr5r,rRrErxrzrwrvrNrOr]r~r7r8r;r<rCr.r�r�r{r�r0r1r�r�r�r�r=r>r^rSr�r�r�r�rArBr�r+r�r�r3rQrcrdrLrMr�r�r�r�r�rjrYr�rerfrrirZrhrgrkrsr`rorarnrbrrr_rqrprtr�r�r�rVrWrXr�)�__doc__rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s$
����encodings/__pycache__/iso2022_jp_3.cpython-38.pyc000064400000002630151153537620015401 0ustar00U

e5d%�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�iso2022_jp_3c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�./usr/lib64/python3.8/encodings/iso2022_jp_3.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z_codecs_iso2022rZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/cp860.cpython-38.opt-2.pyc000064400000017040151153537620015167 0ustar00U

e5dy��@sLddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�Ze�ed��Z	e	�
dddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�dd5�dd3�d�dd2�d�dd9d=�d�d�d�d�d�d �d!�d"�d#�d$�d%�d&�d'�d(�d)�d*�d+�d,�d-d/�d.d��d/�d0�d1�d2�d3�d4�d5d<�d6�d7d*�d8�d9�d:�d;d+�d<dd�d=ddd�d>�d?d�d@dd0d�dAd&�dBd�dCd��dDd1d$d"d#�dE�dFd%d7d d,d�dGdd�dHdd6d(�dId�dJd�d>dd.d!�dKd:d;�dLdd'du�dM�dNd4d8�dO�dP�dQd�dR�dS�dTdpd)�dU�dV�dWd�d�d��dX�dY��ZdS(Z�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp860.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp860)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$������������������������������������������������������� �������������������������%�%�%�%�$%�a%�b%�V%�U%�c%�Q%�W%�]%�\%�[%�%�%�4%�,%�%�%�<%�^%�_%�Z%�T%�i%�f%�`%�P%�l%�g%�h%�d%�e%�Y%�X%�R%�S%�k%�j%�%�%�%�%�%�%�%����������������"����)"�a"��e"�d"� #�!#��H"��"��"� ��%�)���������������������������������r�rSrArB������rLrTrP���r�r�r���r��r���rMrUrRrQ�rNr7r,r5r4������r&r8r6r/��r>r1������rKrOrEr2r?������rCr<��r@����r�r+rFr)r*������r-r0r(r.��r3rG������rJr;rHr9r:�r��r=rI�r'���u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�(rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmr�rSrArBrLrTrPr�r�r�r�r�rMrUrRrQrNr7r,r5r4r&r8r6r/r>r1rKrOrEr2r?rCr<r@r�r+rFr)r*r-r0r(r.r3rGrJr;rHr9r:r�r=rIr'r�r�r�r�r�r�r�r�r�r�r�r�r�rDr�r�r�r�r�r�r�r�r�r�rjrYr�rerfrrirZrhrgrkrsr`r{r|ror^r]rarzryrnrdrcrbrlrmrrr[r\r_rwrxrqrurvrpr~r}rtr�r�r�r�r�rVrWrXr�)
rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s"
����encodings/__pycache__/johab.cpython-38.opt-1.pyc000064400000002605151153537620015412 0ustar00U

e5d��@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�johabc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�'/usr/lib64/python3.8/encodings/johab.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_krrZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/utf_16.cpython-38.opt-1.pyc000064400000011412151153537620015427 0ustar00U

e5dt�@sxdZddlZddlZejZddd�ZGdd�dej�ZGdd	�d	ej�ZGd
d�dej	�Z	Gdd
�d
ej
�Z
dd�ZdS)z� Python 'utf-16' Codec


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

�N�strictcCst�||d�S)NT)�codecs�
utf_16_decode)�input�errors�r�(/usr/lib64/python3.8/encodings/utf_16.py�decodesr	c@s8eZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
S)�IncrementalEncoderrcCstj�||�d|_dS�N)rr
�__init__�encoder��selfrrrrrszIncrementalEncoder.__init__FcCsN|jdkr<t�||j�d}tjdkr0tj|_ntj|_|S|�||j�dS)Nr�little)r
r�
utf_16_encoder�sys�	byteorder�utf_16_le_encode�utf_16_be_encode)rr�final�resultrrr�encodes


zIncrementalEncoder.encodecCstj�|�d|_dSr)rr
�resetr
�rrrrr!szIncrementalEncoder.resetcCs|jdkrdSdS)N�r)r
rrrr�getstate%szIncrementalEncoder.getstatecCs,|rd|_ntjdkr tj|_ntj|_dS�Nr)r
rrrrr�r�staterrr�setstate,s


zIncrementalEncoder.setstateN)r)F)�__name__�
__module__�__qualname__rrrrr rrrrr
s



r
c@s6eZdZd
dd�Zdd�Zdd�Zdd	�Zd
d�ZdS)�IncrementalDecoderrcCstj�||�d|_dSr)r�BufferedIncrementalDecoderr�decoderrrrrr6szIncrementalDecoder.__init__cCsl|jdkr\t�||d|�\}}}|dkr2tj|_n"|dkrDtj|_n|dkrTtd��||fS|�||j|�S)Nr����r�%UTF-16 stream does not start with BOM)r&r�utf_16_ex_decode�utf_16_le_decode�utf_16_be_decode�UnicodeErrorr)rrrr�output�consumedrrrr�_buffer_decode:s
�

z!IncrementalDecoder._buffer_decodecCstj�|�d|_dSr)rr%rr&rrrrrGszIncrementalDecoder.resetcCsDtj�|�d}|jdkr"|dfSttjdk|jtjkk�}||fS)Nrr�big)rr%rr&�intrrr,)rrZaddstaterrrrKs


�zIncrementalDecoder.getstatecCsdtj�||�|d}|dkr8tjdkr.tjntj|_n(|dkrZtjdkrPtjntj|_nd|_dS)Nr(rr1)rr%r rrr,r+r&rrrrr Ys����zIncrementalDecoder.setstateN)r)r!r"r#rr0rrr rrrrr$5s


r$c@s(eZdZd	dd�Zdd�Zd
dd�ZdS)�StreamWriterrcCstj�|||�d|_dSr)rr3rr
)r�streamrrrrriszStreamWriter.__init__cCstj�|�d|_dSr)rr3rr
rrrrrmszStreamWriter.resetcCsF|jdkr6t�||�}tjdkr*tj|_ntj|_|S|�||�SdSr)r
rrrrrr)rrrrrrrrqs


zStreamWriter.encodeN)r)r)r!r"r#rrrrrrrr3hs
r3c@seZdZdd�Zddd�ZdS)�StreamReadercCs.tj�|�z|`Wntk
r(YnXdSr)rr5rr	�AttributeErrorrrrrr~s
zStreamReader.resetrcCsRt�||dd�\}}}|dkr(tj|_n"|dkr:tj|_n|dkrJtd��||fS)NrFr'r(rr))rr*r+r	r,r-)rrr�objectr/rrrrr	�s�

zStreamReader.decodeN)r)r!r"r#rr	rrrrr5|sr5c	Cstjdttttttd�S)Nzutf-16)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)r�	CodecInforr	r
r$r5r3rrrr�getregentry�s�r>)r)�__doc__rrrrr	r
r%r$r3r5r>rrrr�<module>s
#3encodings/__pycache__/iso8859_16.cpython-38.opt-2.pyc000064400000004401151153537620015762 0ustar00U

e5d�4�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�,/usr/lib64/python3.8/encodings/iso8859_16.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz
iso8859-16)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Чš©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ)
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/ptcp154.cpython-38.pyc000064400000004761151153537620014575 0ustar00U

e5d�6�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)z� Python Character Mapping Codec generated from 'PTCP154.txt' with gencodec.py.

Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
(c) Copyright 2000 Guido van Rossum.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�)/usr/lib64/python3.8/encodings/ptcp154.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
rs
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
r!src	Cs tjdt�jt�jttttd�S)N�ptcp154)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry&s�r$u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s	�encodings/__pycache__/koi8_t.cpython-38.opt-2.pyc000064400000004432151153537620015525 0ustar00U

e5d�3�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/koi8_t.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r
s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nzkoi8-t)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry"s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~қғ‚Ғ„…†‡￾‰ҳ‹ҲҷҶ￾Қ‘’“”•–—￾™￾›￾￾￾￾￾ӯӮё¤ӣ¦§￾￾￾«¬­®￾°±²Ё￾Ӣ¶·￾№￾»￾￾￾©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ)
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/kz1048.cpython-38.opt-2.pyc000064400000004411151153537620015266 0ustar00U

e5d�5�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/kz1048.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�kz1048)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—￾™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя)
rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp875.cpython-38.opt-1.pyc000064400000004565151153537620015204 0ustar00U

e5d62�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zs Python Character Mapping Codec cp875 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP875.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp875.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)NZcp875)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u}œ	†—Ž
…‡’€‚ƒ„
ˆ‰Š‹Œ‘“”•–˜™š›ž ΑΒΓΔΕΖΗΘΙ[.<(+!&ΚΛΜΝΞΟΠΡΣ]$*);^-/ΤΥΦΧΨΩΪΫ|,%_>?¨ΆΈΉ ΊΌΎΏ`:#@'="΅abcdefghiαβγδεζ°jklmnopqrηθικλμ´~stuvwxyzνξοπρσ£άέήϊίόύϋώςτυφχψ{ABCDEFGHI­ωΐΰ‘―}JKLMNOPQR±½·’¦\STUVWXYZ²§«¬0123456789³©»Ÿ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp852.cpython-38.opt-1.pyc000064400000017316151153537620015175 0ustar00U

e5d���@sldZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�d�d�d�dd��d�d�d�d�d�ddpd)d.�d d�d!�d"d�d#d1d0d��d$�d%�d&�d'�d(�d)�d*�d+�d,�d-d$�d.�d/�d0�d1dd_�d2�d3�d4d:�d5�d6dr�d7�d8d��d9�d:�d;�d<�d=�d>�d?�d@�dA�dBd�dC�dD�dE�dF�dG�dHdd|�dI�dJd�d��dKdd}d�dL�dM�dN�dOd�dP�dQd>�dR�dS�dTd�d2d#d3�dU�dVd�dWdy�dX�dY�dZ�d[ddFdE�d\df�d]d d?�d^�d_�d`�dadc�dbdgdqd*�dcd��dd�de�df�dg��Z
dS(hz` Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP852.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp852.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp852)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$�����������o����B���P�Q���y������9�:����=�>�Z�[�����d�e�A���
����������}�~����z��_���%�%�%�%�$%�����^�c%�Q%�W%�]%�{�|�%�%�4%�,%�%�%�<%���Z%�T%�i%�f%�`%�P%�l%��������G������%�%�%�%�b�n�%�������C�D�H�`�a�T���U�p����c������������������q�X�Y�%�)���������������������������������r����ru��r�r���rTrPr���r����r����r���rU�����r[r\��r4����r&��r6��ry��r|r}��������r�r���r?rD����r���r@r���r���rFr)��r*����r-��r(��r/��rGr2��������rHr9�r:r���rI�r'r���u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�(rr�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwrxryrzr�rur�r�rTrPr�r�r�r�rUr[r\r4r&r6ryr|r}r�r�r?rDr�r@r�r�rFr)r*r-r(r/rGr2rHr9r:r�rIr'r�rlrmrJrKr5r,rRrErxrzrwrvrNrOr]r~r7r8r;r<rCr.r�r�r{r�r0r1r�r�r�r�r=r>r^rSr�r�r�r�rArBr�r+r�r�r3rQrcrdrLrMr�r�r�r�r�rjrYr�rerfrrirZrhrgrkrsr`rorarnrbrrr_rqrprtr�r�r�rVrWrXr�)�__doc__rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s$
����encodings/__pycache__/cp875.cpython-38.pyc000064400000004565151153537620014245 0ustar00U

e5d62�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zs Python Character Mapping Codec cp875 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP875.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp875.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)NZcp875)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u}œ	†—Ž
…‡’€‚ƒ„
ˆ‰Š‹Œ‘“”•–˜™š›ž ΑΒΓΔΕΖΗΘΙ[.<(+!&ΚΛΜΝΞΟΠΡΣ]$*);^-/ΤΥΦΧΨΩΪΫ|,%_>?¨ΆΈΉ ΊΌΎΏ`:#@'="΅abcdefghiαβγδεζ°jklmnopqrηθικλμ´~stuvwxyzνξοπρσ£άέήϊίόύϋώςτυφχψ{ABCDEFGHI­ωΐΰ‘―}JKLMNOPQR±½·’¦\STUVWXYZ²§«¬0123456789³©»Ÿ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/mac_turkish.cpython-38.pyc000064400000004640151153537620015702 0ustar00U

e5d�4�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zs Python Character Mapping Codec mac_turkish generated from 'MAPPINGS/VENDORS/APPLE/TURKISH.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�-/usr/lib64/python3.8/encodings/mac_turkish.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nzmac-turkish)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/mac_greek.cpython-38.opt-2.pyc000064400000004414151153537620016245 0ustar00U

e5d�5�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/mac_greek.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	mac-greek)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­)
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp1140.cpython-38.opt-2.pyc000064400000004367151153537620015247 0ustar00U

e5d13�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1140.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1140)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�œ	†—Ž
…‡’€‚ƒ„
ˆ‰Š‹Œ‘“”•–˜™š›ž  âäàáãåçñ¢.<(+|&éêëèíîïìß!$*);¬-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'="Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ€µ~stuvwxyz¡¿ÐÝÞ®^£¥·©§¶¼½¾[]¯¨´×{ABCDEFGHI­ôöòóõ}JKLMNOPQR¹ûüùúÿ\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙڟ)
rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/mac_roman.cpython-38.opt-2.pyc000064400000004435151153537620016267 0ustar00U

e5d�4�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/mac_roman.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	mac-roman)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ)
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/raw_unicode_escape.cpython-38.opt-2.pyc000064400000003105151153537620020143 0ustar00U

e5d��@srddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdS)�Nc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codecs�raw_unicode_escape_encode�encode�raw_unicode_escape_decode�decode�rr�4/usr/lib64/python3.8/encodings/raw_unicode_escape.pyr
src@seZdZddd�ZdS)�IncrementalEncoderFcCst�||j�dS�Nr)rr�errors��self�input�finalrrrrszIncrementalEncoder.encodeN)F)rrrrrrrrr
sr
c@seZdZddd�ZdS)�IncrementalDecoderFcCst�||j�dSr)rr	rrrrrr
szIncrementalDecoder.decodeN)F)rrrr
rrrrrsrc@seZdZdS)�StreamWriterN�rrrrrrrrsrc@seZdZdS)�StreamReaderNrrrrrrsrc	Cstjdtjtjttttd�S)Nzraw-unicode-escape)�namerr
�incrementalencoder�incrementaldecoder�streamwriter�streamreader)	r�	CodecInforrr
r
rrrrrrr�getregentry$s�r)rrr
rrrrrrrr�<module>	sencodings/__pycache__/utf_32_be.cpython-38.opt-1.pyc000064400000003011151153537620016067 0ustar00U

e5d��@spdZddlZejZddd�ZGdd�dej�ZGdd	�d	ej�ZGd
d�dej�ZGdd
�d
ej	�Z	dd�Z
dS)z
Python 'utf-32-be' Codec
�N�strictcCst�||d�S)NT)�codecs�utf_32_be_decode)�input�errors�r�+/usr/lib64/python3.8/encodings/utf_32_be.py�decode
sr	c@seZdZddd�ZdS)�IncrementalEncoderFcCst�||j�dS)Nr)r�utf_32_be_encoder)�selfr�finalrrr�encodeszIncrementalEncoder.encodeN)F)�__name__�
__module__�__qualname__rrrrrr

sr
c@seZdZejZdS)�IncrementalDecoderN)rrrrr�_buffer_decoderrrrrsrc@seZdZejZdS)�StreamWriterN)rrrrrrrrrrrsrc@seZdZejZdS)�StreamReaderN)rrrrrr	rrrrrsrc	Cstjdttttttd�S)Nz	utf-32-be)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)r�	CodecInforr	r
rrrrrrr�getregentrys�r)r)�__doc__rrrr	r
�BufferedIncrementalDecoderrrrrrrrr�<module>s
encodings/__pycache__/utf_8_sig.cpython-38.pyc000064400000010704151153537620015256 0ustar00U

e5d%�@stdZddlZddd�Zddd�ZGdd	�d	ej�ZGd
d�dej�ZGdd
�d
ej�ZGdd�dej�Zdd�Z	dS)a Python 'utf-8-sig' Codec
This work similar to UTF-8 with the following changes:

* On encoding/writing a UTF-8 encoded BOM will be prepended/written as the
  first three bytes.

* On decoding/reading if the first three bytes are a UTF-8 encoded BOM, these
  bytes will be skipped.
�N�strictcCstjt�||�dt|�fS�Nr)�codecs�BOM_UTF8�utf_8_encode�len)�input�errors�r
�+/usr/lib64/python3.8/encodings/utf_8_sig.py�encodes�rcCsDd}|dd�tjkr&|dd�}d}t�||d�\}}|||fS)Nr�T)rr�utf_8_decode)rr	�prefix�output�consumedr
r
r�decodesrc@s8eZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
S)�IncrementalEncoderrcCstj�||�d|_dS�N�)rr�__init__�first��selfr	r
r
rrszIncrementalEncoder.__init__FcCs:|jr$d|_tjt�||j�dSt�||j�dSdSr)rrrrr	)rr�finalr
r
rrs�zIncrementalEncoder.encodecCstj�|�d|_dSr)rr�resetr�rr
r
rr'szIncrementalEncoder.resetcCs|jS�N�rrr
r
r�getstate+szIncrementalEncoder.getstatecCs
||_dSrr�r�stater
r
r�setstate.szIncrementalEncoder.setstateN)r)F)�__name__�
__module__�__qualname__rrrrr"r
r
r
rrs


rc@s6eZdZd
dd�Zdd�Zdd�Zdd	�Zd
d�ZdS)�IncrementalDecoderrcCstj�||�d|_dSr)r�BufferedIncrementalDecoderrrrr
r
rr2szIncrementalDecoder.__init__cCsv|jrht|�dkr*tj�|�r"dSd|_n>d|_|dd�tjkrht�|dd�||�\}}||dfSt�|||�S)Nr
��rr)rrrr�
startswithr)rrr	rrrr
r
r�_buffer_decode6s�z!IncrementalDecoder._buffer_decodecCstj�|�d|_dSr)rr'rrrr
r
rrGszIncrementalDecoder.resetcCstj�|�}|d|jfSr)rr'rrr r
r
rrKszIncrementalDecoder.getstatecCstj�||�|d|_dSr)rr'r"rr r
r
rr"PszIncrementalDecoder.setstateN)r)r#r$r%rr+rrr"r
r
r
rr&1s

r&c@seZdZdd�Zddd�ZdS)�StreamWritercCs.tj�|�z|`Wntk
r(YnXdSr)rr,rr�AttributeErrorrr
r
rrVs
zStreamWriter.resetrcCstj|_t||�Sr)rrr)rrr	r
r
rr]szStreamWriter.encodeN)r)r#r$r%rrr
r
r
rr,Usr,c@seZdZdd�Zddd�ZdS)�StreamReadercCs.tj�|�z|`Wntk
r(YnXdSr)rr.rrr-rr
r
rrbs
zStreamReader.resetrcCspt|�dkrtj�|�r\dSn>|dd�tjkr\tj|_t�|dd�|�\}}||dfStj|_t�||�S)Nr
r()rrrr*rr)rrr	rrr
r
rriszStreamReader.decodeN)r)r#r$r%rrr
r
r
rr.asr.c	Cstjdttttttd�S)Nz	utf-8-sig)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)r�	CodecInforrrr&r.r,r
r
r
r�getregentryys�r5)r)r)
�__doc__rrrrr'r&r,r.r5r
r
r
r�<module>s	

$encodings/__pycache__/cp437.cpython-38.opt-1.pyc000064400000017250151153537620015171 0ustar00U

e5d��@sVdZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�dd(�d�d�d�d�d�dd6�dd4�dd!d3�d�dd:d>�d�d�d�d�d�d d-�d!�d"d0�d#d��d$�d%�d&�d'�d(�d)�d*�d+�d,�d-d=�d.�d/�d0�d1d+�d2�d3d$�d4d,�d5�d6�d7�d8dddddddd�d9ddd1d�d:d'd&ddd��d;d2d%�d<d#�d=d�d>�d?d8�d@�dA�dB�dC�dD�dEd�dFd7�dGd)d �dHd�d?�dI�dJ�dK�dLd;d<d"d�dMdv�dN�dOd5�dP�dQ�dR�dS�dT�dU�dV�dWdqd*�dX�dY�dZd�d�d��d[�d\��Z
dS(]zf Python Character Mapping Codec cp437 generated from 'VENDORS/MICSFT/PC/CP437.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp437.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp437)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$������������������������������������������������������ ����������������#�������%�%�%�%�$%�a%�b%�V%�U%�c%�Q%�W%�]%�\%�[%�%�%�4%�,%�%�%�<%�^%�_%�Z%�T%�i%�f%�`%�P%�l%�g%�h%�d%�e%�Y%�X%�R%�S%�k%�j%�%�%�%�%�%�%�%����������������"����)"�a"��e"�d"� #�!#��H"��"��"� ��%�)���������������������������������r�rSrArB�rC����rLrTrP���r�r�r���r��r���rMrUrRrQ�rN������r4r5r8r&��r6��������������rK��������r?����������r@����r�r+rFr)��r*r,r7r-r0r(r.r/r3rGr2r1��rJr;rHr9�r:r��r=rIr<r'��r>u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�(rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnror�rSrArBrCrLrTrPr�r�r�r�r�rMrUrRrQrNr4r5r8r&r6rKr?r@r�r+rFr)r*r,r7r-r0r(r.r/r3rGr2r1rJr;rHr9r:r�r=rIr<r'r>rEr�r�r�r�r�r�r�r�r�r�r�r�r�rDr�r�r�r�r�r�r�r�rOr�r�rjrYr�rerfrrirZrhrgrkrsr`r{r|ror^r]rarzryrnrdrcrbrlrmrrr[r\r_rwrxrqrurvrpr~r}rtr�r�r�r�r�rVrWrXr�)�__doc__rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s$
����encodings/__pycache__/cp862.cpython-38.pyc000064400000017537151153537620014244 0ustar00U

e5dZ��@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�d�dd6�dd4�d�dd3�d�dd:d>�dd-d0d�d=�dd+�dd,�d �d!�d"�d#�d$�d%�d&�d'�d(�d)�d*�d+d1�d,�d-�d.�d/�d0�d1�d2�d3�d4�d5�d6�d7�d8�d9�d:�d;�d<�d=�d>�d?�d@�dA�dB�dC�dD�dE�dF�dG�dH�dI�dJ�dK�dLd��dMd2�dN�dO�dP�dQ�dR�dS�dTd8�dU�dV�dW�dX�dY�dZ�d[�d\d7�d]�d^�d_�d`d�d?�da�db�dc�ddd;d<�de�df�dgdv�dh�did5�dj�dk�dl�dm�dn�do�dp�dqdq�dr�ds�dt�dud�d�d��dv�dw��Z
dS(xz` Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP862.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp862.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp862)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$����������������������������������������������������������� ����������������#�������%�%�%�%�$%�a%�b%�V%�U%�c%�Q%�W%�]%�\%�[%�%�%�4%�,%�%�%�<%�^%�_%�Z%�T%�i%�f%�`%�P%�l%�g%�h%�d%�e%�Y%�X%�R%�S%�k%�j%�%�%�%�%�%�%�%����������������"����)"�a"��e"�d"� #�!#��H"��"��"� ��%�)���������������������������������r�rSrArB�rC����rLrTrP���r�r�r���r��r���rMrUrRrQ�rN��������������������������������rK��������������������������r���rF����������������������rG������rJ��rH����r���rI�����u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�rr�r�r�r�r�r�rr	r�r�r�r�r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�rrr�r�rrr�rrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r
(rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwrxryrzr{r|r}r~rr�r�r�r�r�r�r�r�r�r�r�r�rSrArBrCrLrTrPr�r�r�r�r�rMrUrRrQrNrKr�rFrGrJrHr�rIrEr�r�r�r�r�r�r�r�r�r�r�r�r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@r�rDr�r�r�r�r�r�r�r�rOr�r�rjrYr�rerfrrirZrhrgrkrsr`r{r|ror^r]rarzryrnrdrcrbrlrmrrr[r\r_rwrxrqrurvrpr~r}rtr�r�r�r�r�rVrWrXr�)�__doc__rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s$
����encodings/__pycache__/iso8859_13.cpython-38.opt-2.pyc000064400000004402151153537620015760 0ustar00U

e5d�3�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�,/usr/lib64/python3.8/encodings/iso8859_13.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz
iso8859-13)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’)
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp874.cpython-38.pyc000064400000004770151153537620014242 0ustar00U

e5d31�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zt Python Character Mapping Codec cp874 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP874.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp874.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)NZcp874)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€￾￾￾￾…￾￾￾￾￾￾￾￾￾￾￾‘’“”•–—￾￾￾￾￾￾￾￾ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู￾￾￾￾฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛￾￾￾￾)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/mac_centeuro.cpython-38.opt-1.pyc000064400000004636151153537620017001 0ustar00U

e5d7�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zu Python Character Mapping Codec mac_centeuro generated from 'MAPPINGS/VENDORS/APPLE/CENTEURO.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�./usr/lib64/python3.8/encodings/mac_centeuro.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nzmac-centeuro)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/gbk.cpython-38.opt-1.pyc000064400000002601151153537620015066 0ustar00U

e5d��@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�gbkc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�%/usr/lib64/python3.8/encodings/gbk.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_cnrZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/utf_16_be.cpython-38.opt-2.pyc000064400000002736151153537620016107 0ustar00U

e5d
�@slddlZejZddd�ZGdd�dej�ZGdd�dej�ZGd	d
�d
ej�ZGdd�dej�Zd
d�Z	dS)�N�strictcCst�||d�S)NT)�codecs�utf_16_be_decode)�input�errors�r�+/usr/lib64/python3.8/encodings/utf_16_be.py�decodesr	c@seZdZddd�ZdS)�IncrementalEncoderFcCst�||j�dS)Nr)r�utf_16_be_encoder)�selfr�finalrrr�encodeszIncrementalEncoder.encodeN)F)�__name__�
__module__�__qualname__rrrrrr
sr
c@seZdZejZdS)�IncrementalDecoderN)rrrrr�_buffer_decoderrrrrsrc@seZdZejZdS)�StreamWriterN)rrrrrrrrrrrsrc@seZdZejZdS)�StreamReaderN)rrrrrr	rrrrrsrc	Cstjdttttttd�S)Nz	utf-16-be)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)r�	CodecInforr	r
rrrrrrr�getregentry!s�r)r)
rrrr	r
�BufferedIncrementalDecoderrrrrrrrr�<module>	s
encodings/__pycache__/mac_cyrillic.cpython-38.pyc000064400000004634151153537620016026 0ustar00U

e5d�4�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zu Python Character Mapping Codec mac_cyrillic generated from 'MAPPINGS/VENDORS/APPLE/CYRILLIC.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�./usr/lib64/python3.8/encodings/mac_cyrillic.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nzmac-cyrillic)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю€)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/euc_jp.cpython-38.pyc000064400000002607151153537620014637 0ustar00U

e5d�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�euc_jpc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�(/usr/lib64/python3.8/encodings/euc_jp.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_jprZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/mac_iceland.cpython-38.opt-1.pyc000064400000004637151153537620016555 0ustar00U

e5d�4�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zs Python Character Mapping Codec mac_iceland generated from 'MAPPINGS/VENDORS/APPLE/ICELAND.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�-/usr/lib64/python3.8/encodings/mac_iceland.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nzmac-iceland)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/iso8859_3.cpython-38.opt-1.pyc000064400000004576151153537620015712 0ustar00U

e5d!3�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zj Python Character Mapping Codec iso8859_3 generated from 'MAPPINGS/ISO8859/8859-3.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/iso8859_3.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	iso8859-3)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤￾Ĥ§¨İŞĞĴ­￾ݰħ²³´µĥ·¸ışğĵ½￾żÀÁÂ￾ÄĊĈÇÈÉÊËÌÍÎÏ￾ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ￾äċĉçèéêëìíîï￾ñòóôġö÷ĝùúûüŭŝ˙)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp1253.cpython-38.opt-1.pyc000064400000004640151153537620015245 0ustar00U

e5d&3�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zv Python Character Mapping Codec cp1253 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1253.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1253.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1253)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€￾‚ƒ„…†‡￾‰￾‹￾￾￾￾￾‘’“”•–—￾™￾›￾￾￾￾ ΅Ά£¤¥¦§¨©￾«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ￾ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ￾)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp856.cpython-38.opt-2.pyc000064400000004473151153537620015202 0ustar00U

e5d�0�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp856.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)NZcp856)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~אבגדהוזחטיךכלםמןנסעףפץצקרשת￾£￾×￾￾￾￾￾￾￾￾￾￾®¬½¼￾«»░▒▓│┤￾￾￾©╣║╗╝¢¥┐└┴┬├─┼￾￾╚╔╩╦╠═╬¤￾￾￾￾￾￾￾￾￾┘┌█▄¦￾▀￾￾￾￾￾￾µ￾￾￾￾￾￾￾¯´­±‗¾¶§÷¸°¨·¹³²■ )
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp1250.cpython-38.pyc000064400000004623151153537620014304 0ustar00U

e5dv5�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zv Python Character Mapping Codec cp1250 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1250.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1250.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1250)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€￾‚￾„…†‡￾‰Š‹ŚŤŽŹ￾‘’“”•–—￾™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/iso2022_kr.cpython-38.opt-1.pyc000064400000002624151153537620016124 0ustar00U

e5d�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�
iso2022_krc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�,/usr/lib64/python3.8/encodings/iso2022_kr.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z_codecs_iso2022rZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/unicode_escape.cpython-38.opt-1.pyc000064400000003320151153537620017270 0ustar00U

e5d��@svdZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdS)z� Python 'unicode-escape' Codec


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

�Nc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codecs�unicode_escape_encode�encode�unicode_escape_decode�decode�rr�0/usr/lib64/python3.8/encodings/unicode_escape.pyr
src@seZdZddd�ZdS)�IncrementalEncoderFcCst�||j�dS�Nr)rr�errors��self�input�finalrrrrszIncrementalEncoder.encodeN)F)rrrrrrrrr
sr
c@seZdZddd�ZdS)�IncrementalDecoderFcCst�||j�dSr)rr	rrrrrr
szIncrementalDecoder.decodeN)F)rrrr
rrrrrsrc@seZdZdS)�StreamWriterN�rrrrrrrrsrc@seZdZdS)�StreamReaderNrrrrrrsrc	Cstjdtjtjttttd�S)Nzunicode-escape)�namerr
�incrementalencoder�incrementaldecoder�streamwriter�streamreader)	r�	CodecInforrr
r
rrrrrrr�getregentry$s�r)�__doc__rrr
rrrrrrrr�<module>sencodings/__pycache__/idna.cpython-38.opt-1.pyc000064400000012753151153537620015247 0ustar00U

e5d�#�@s�ddlZddlZddlZddlmZe�d�ZdZdZdd�Z	dd	�Z
d
d�ZGdd
�d
ej�ZGdd�dej
�ZGdd�dej�ZGdd�deej�ZGdd�deej�Zdd�ZdS)�N)�	ucd_3_2_0u[.。.。]sxn--zxn--cCs�g}|D] }t�|�rq|�t�|��qd�|�}t�d|�}|D]j}t�|�s�t�|�s�t�	|�s�t�
|�s�t�|�s�t�|�s�t�
|�s�t�|�s�t�|�rDtd|��qDdd�|D�}t|�r�tdd�|D��r�td��|d	r�|d
s�td��|S)N��NFKCzInvalid character %rcSsg|]}t�|��qS�)�
stringprepZin_table_d1��.0�xrr�&/usr/lib64/python3.8/encodings/idna.py�
<listcomp>)sznameprep.<locals>.<listcomp>css|]}t�|�VqdS)N)rZin_table_d2rrrr
�	<genexpr>1sznameprep.<locals>.<genexpr>zViolation of BIDI requirement 2r���zViolation of BIDI requirement 3)rZin_table_b1�appendZmap_table_b2�join�unicodedata�	normalizeZin_table_c12Zin_table_c22Zin_table_c3Zin_table_c4Zin_table_c5Zin_table_c6Zin_table_c7Zin_table_c8Zin_table_c9�UnicodeError�any)�labelZnewlabel�cZRandALrrr
�nameprepsB


��������	rcCs�z|�d�}Wntk
r"Yn*Xdt|�kr<dkrDnn|Std��t|�}z|�d�}Wntk
rvYn*Xdt|�kr�dkr�nn|Std��|�t�r�td��|�d�}t|}dt|�kr�dkr�nn|Std��dS)N�asciir�@�label empty or too longzLabel starts with ACE prefix�punycode)�encoder�lenr�
startswith�sace_prefix�
ace_prefix)rrrr
�ToASCII<s,

r cCs�t|t�rd}n,z|�d�}d}Wntk
r:d}YnX|stt|�}z|�d�}Wntk
rrtd��YnX|�t�s�t|d�S|tt�d�}|�	d�}t
|�}t|d���t|d�kr�td||��|S)NTrFzInvalid character in IDN labelrzIDNA does not round-trip)�
isinstance�bytesrrrrr�strr�decoder �lower)rZ
pure_asciiZlabel1�resultZlabel2rrr
�	ToUnicodegs*





r'c@s eZdZddd�Zddd�ZdS)	�Codec�strictcCs|dkrtd|��|sdSz|�d�}Wntk
r>YndX|�d�}|dd�D]&}dt|�krrdksVntd	��qVt|d�dkr�td
��|t|�fSt�}t�|�}|r�|ds�d}|d=nd}|D] }|r�|�d�|�t|��q�t	||�t|�fS)Nr)�unsupported error handling ��rr�.r
rrrzlabel too longr,)
rr�UnicodeEncodeError�splitr�	bytearray�dots�extendr r")�self�input�errorsr&�labelsr�trailing_dotrrr
r�s4



zCodec.encodecCs�|dkrtd|��|sdSt|t�s.t|�}t|kr`z|�d�t|�fWStk
r^YnX|�d�}|r�t|d�dkr�d}|d=nd	}g}|D]}|�t	|��q�d�
|�|t|�fS)
Nr)�Unsupported error handling �rrrr-r
r�.r)rr!r"rr$r�UnicodeDecodeErrorr/rr'r)r3r4r5r6r7r&rrrr
r$�s(

zCodec.decodeN)r))r))�__name__�
__module__�__qualname__rr$rrrr
r(�s
%r(c@seZdZdd�ZdS)�IncrementalEncoderc	Cs�|dkrtd|��|sdSt�|�}d}|rT|dsBd}|d=n|sT|d=|rTd}t�}d}|D]4}|r||�d�|d7}|�t|��|t|�7}qb||7}|t|�7}t|�|fS)	Nr)r*r+r,r
r-r�)rr1r/r0r2r rr"�	r3r4r5�finalr6r7r&�sizerrrr
�_buffer_encode�s2

z!IncrementalEncoder._buffer_encodeN)r<r=r>rDrrrr
r?�sr?c@seZdZdd�ZdS)�IncrementalDecoderc	Cs�|dkrtd|��|sdSt|t�r2t�|�}nt|d�}|�d�}d}|rt|dsbd}|d=n|st|d=|rtd}g}d}|D]*}|�t|��|r�|d	7}|t|�7}q�d�|�|}|t|�7}||fS)
Nr)r8r9rr:rr
rr@)	rr!r#r1r/rr'rrrArrr
�_buffer_decode�s6


z!IncrementalDecoder._buffer_decodeN)r<r=r>rFrrrr
rE�srEc@seZdZdS)�StreamWriterN�r<r=r>rrrr
rG"srGc@seZdZdS)�StreamReaderNrHrrrr
rI%srIc	Cs tjdt�jt�jttttd�S)NZidna)�namerr$�incrementalencoder�incrementaldecoder�streamwriter�streamreader)	�codecs�	CodecInfor(rr$r?rErGrIrrrr
�getregentry*s�rQ)r�rerOrr�compiler1rrrr r'r(�BufferedIncrementalEncoderr?�BufferedIncrementalDecoderrErGrIrQrrrr
�<module>s
.+)H#'encodings/__pycache__/cp863.cpython-38.opt-1.pyc000064400000017242151153537620015175 0ustar00U

e5d̅�@sVdZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�dd��dd(�d�dd�d�d�dd0�d�d�dd3�dd7d:d>�d�d �d!�d"�d#�d$�d%�d&d4�d'�d(�d)�d*�d+�d,�d-�d.�d/�d0�d1�d2�d3�d4�d5d+�d6�d7�d8d,�d9�d:�d;dd�d<ddddd�d=�d>d�d?�d@dd'd&�dAdd��dBd2�dC�dDd#�dE�dFd6�dG�dHdd-�dId1d�dJ�dK�dL�dM�dN�dOd d5d�d?d)�dPd!d=d;d<�dQd�dRdvd�dS�dT�dUd$d%�dVd"�dW�dXd8dqd*d.�dY�dZd�d�d��d[�d\��Z
dS(]z` Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP863.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp863.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp863)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$�������������������������� ����������������������������������������#�������%�%�%�%�$%�a%�b%�V%�U%�c%�Q%�W%�]%�\%�[%�%�%�4%�,%�%�%�<%�^%�_%�Z%�T%�i%�f%�`%�P%�l%�g%�h%�d%�e%�Y%�X%�R%�S%�k%�j%�%�%�%�%�%�%�%����������������"����)"�a"��e"�d"� #�!#��H"��"��"� ��%�)���������������������������������r��rArBr>�rFr5rJ��rTrP��rMr�r�r�rLrGr�r,r�rK��rUrRrQrS�r4�r*��������r&r7r6r8r:����rNr;��������r?��������rC��rDr@����r�r+��r)��������r-r0r(r.r/����r2r1������rHr9��r��r=rIr<r'���u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�(rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnror�rArBr>rFr5rJrTrPrMr�r�r�rLrGr�r,r�rKrUrRrQrSr4r*r&r7r6r8r:rNr;r?rCrDr@r�r+r)r-r0r(r.r/r2r1rHr9r�r=rIr<r'rEr�r�r�r�r�r�r�r�r�r�r�r�r3r�r�r�r�r�r�r�r�r�rOr�r�rjrYr�rerfrrirZrhrgrkrsr`r{r|ror^r]rarzryrnrdrcrbrlrmrrr[r\r_rwrxrqrurvrpr~r}rtr�r�r�r�r�rVrWrXr�)�__doc__rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s$
����encodings/__pycache__/cp932.cpython-38.opt-1.pyc000064400000002605151153537620015167 0ustar00U

e5d��@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�cp932c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�'/usr/lib64/python3.8/encodings/cp932.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_jprZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/iso8859_15.cpython-38.pyc000064400000004574151153537620015034 0ustar00U

e5d�3�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zl Python Character Mapping Codec iso8859_15 generated from 'MAPPINGS/ISO8859/8859-15.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�,/usr/lib64/python3.8/encodings/iso8859_15.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz
iso8859-15)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/johab.cpython-38.pyc000064400000002605151153537620014453 0ustar00U

e5d��@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�johabc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�'/usr/lib64/python3.8/encodings/johab.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_krrZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/iso8859_16.cpython-38.pyc000064400000004576151153537620015037 0ustar00U

e5d�4�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zl Python Character Mapping Codec iso8859_16 generated from 'MAPPINGS/ISO8859/8859-16.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�,/usr/lib64/python3.8/encodings/iso8859_16.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz
iso8859-16)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Чš©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/ascii.cpython-38.opt-1.pyc000064400000003533151153537620015420 0ustar00U

e5d��@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�ZGd
d�dee�Zdd�ZdS)z� Python 'ascii' Codec


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

�Nc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codecs�ascii_encode�encode�ascii_decode�decode�rr�'/usr/lib64/python3.8/encodings/ascii.pyr
src@seZdZddd�ZdS)�IncrementalEncoderFcCst�||j�dS�Nr)rr�errors��self�input�finalrrrrszIncrementalEncoder.encodeN)F)rrrrrrrrr
sr
c@seZdZddd�ZdS)�IncrementalDecoderFcCst�||j�dSr)rr	rrrrrr
szIncrementalDecoder.decodeN)F)rrrr
rrrrrsrc@seZdZdS)�StreamWriterN�rrrrrrrrsrc@seZdZdS)�StreamReaderNrrrrrrsrc@seZdZejZejZdS)�StreamConverterN)rrrrr	rrr
rrrrr"src	Cstjdtjtjttttd�S)N�ascii)�namerr
�incrementalencoder�incrementaldecoder�streamwriter�streamreader)	r�	CodecInforrr
r
rrrrrrr�getregentry)s�r )	�__doc__rrr
rrrrr rrrr�<module>sencodings/__pycache__/ascii.cpython-38.opt-2.pyc000064400000003311151153537620015413 0ustar00U

e5d��@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�ZGdd
�d
ee�Zdd�ZdS)�Nc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codecs�ascii_encode�encode�ascii_decode�decode�rr�'/usr/lib64/python3.8/encodings/ascii.pyr
src@seZdZddd�ZdS)�IncrementalEncoderFcCst�||j�dS�Nr)rr�errors��self�input�finalrrrrszIncrementalEncoder.encodeN)F)rrrrrrrrr
sr
c@seZdZddd�ZdS)�IncrementalDecoderFcCst�||j�dSr)rr	rrrrrr
szIncrementalDecoder.decodeN)F)rrrr
rrrrrsrc@seZdZdS)�StreamWriterN�rrrrrrrrsrc@seZdZdS)�StreamReaderNrrrrrrsrc@seZdZejZejZdS)�StreamConverterN)rrrrr	rrr
rrrrr"src	Cstjdtjtjttttd�S)N�ascii)�namerr
�incrementalencoder�incrementaldecoder�streamwriter�streamreader)	r�	CodecInforrr
r
rrrrrrr�getregentry)s�r )rrr
rrrrr rrrr�<module>	sencodings/__pycache__/koi8_r.cpython-38.pyc000064400000004653151153537620014570 0ustar00U

e5d�5�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zl Python Character Mapping Codec koi8_r generated from 'MAPPINGS/VENDORS/MISC/KOI8-R.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/koi8_r.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nzkoi8-r)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/iso2022_jp_ext.cpython-38.opt-2.pyc000064400000002634151153537620017003 0ustar00U

e5d-�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�iso2022_jp_extc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�0/usr/lib64/python3.8/encodings/iso2022_jp_ext.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z_codecs_iso2022rZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/euc_jp.cpython-38.opt-2.pyc000064400000002607151153537620015577 0ustar00U

e5d�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�euc_jpc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�(/usr/lib64/python3.8/encodings/euc_jp.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_jprZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/iso8859_11.cpython-38.opt-2.pyc000064400000004535151153537620015765 0ustar00U

e5d/0�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�,/usr/lib64/python3.8/encodings/iso8859_11.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz
iso8859-11)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู￾￾￾￾฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛￾￾￾￾)
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/mac_cyrillic.cpython-38.opt-1.pyc000064400000004634151153537620016765 0ustar00U

e5d�4�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zu Python Character Mapping Codec mac_cyrillic generated from 'MAPPINGS/VENDORS/APPLE/CYRILLIC.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�./usr/lib64/python3.8/encodings/mac_cyrillic.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nzmac-cyrillic)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю€)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp949.cpython-38.opt-2.pyc000064400000002605151153537620015200 0ustar00U

e5d��@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�cp949c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�'/usr/lib64/python3.8/encodings/cp949.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_krrZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/mac_iceland.cpython-38.opt-2.pyc000064400000004433151153537620016550 0ustar00U

e5d�4�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�-/usr/lib64/python3.8/encodings/mac_iceland.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nzmac-iceland)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ)
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/mac_arabic.cpython-38.opt-2.pyc000064400000016716151153537620016401 0ustar00U

e5ds��@sJddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�Ze�ed��Z	e	�
dddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d/dd0d�d1d�d2d�d3d�d�d5d�d6d�d7d�d8d�d9d�d:dd�d<d�d=d�d>d�d�d�d�d�d�d�d�d�d�d�dId�d�dKd�dLd�dMd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�djd�dkddld�dmd�dnd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�dd�d-d�d.d��d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d �d!�d"�d#�d$�d%�d&�d'�d(�d)d'�d*�d+�d,�d-d�d.�d/d�d0d�d1�d2�d3�d4�d5�d6�d7d�d8�d9�d:�d;d�d<�d=�d>�d?ddd�d@d�dA�dBddddd �dCd!d#d$�dDd%�dE�dF�dG�dH�dI�dJ�dK�dL�dM�dN�dO�dPd(d&�dQd,d+�dRd*�dS�dT�dUd)�dV�dW�dX��ZdS(Y�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�,/usr/lib64/python3.8/encodings/mac_arabic.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz
mac-arabic)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#�������������������������������������& ������������������ �!�"�#�$�j�&�'�(�)�*�+��-�.�/�`�a�b�c�d�e�f�g�h�i�:��<�=�>��J'�!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�[�\�]�^�_�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�~�y��������{�|�}���)���������������������������������r&����������r1���������������r=����������r%����r'��r(��������������r)��������r*����������r+������r-r,r.��r/����r2r4r3r5r6��r7r9r:��r;��r<r>�r?r@�rBrArCrD���uh	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Ä ÇÉÑÖÜáàâäں«çéèêëí…îïñó»ôö÷úùûü !"#$٪&'()*+،-./٠١٢٣٤٥٦٧٨٩:؛<=>؟❊ءآأؤإئابةتثجحخدذرزسشصضطظعغ[\]^_ـفقكلمنهوىيًٌٍَُِّْپٹچەڤگڈڑ{|}ژے���������	�
���
������������������r�r�r�r��%r�r�r�r�r��,r�r�r��0�1�2�3�4�5�6�7�8�9r��;r�r�r��?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Zr�r�r�r��`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�zr�~�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr�r�r�r�r�r�r�r�r�r�r�rrrr�rr�r�(rrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%rErErFrFrGrGrHrHrIrIr&rKrKrLrLrMrMrNrNrOrOrPrPr'rRrRrSrSrTrTr(r)r*r+r,r-r.r/r0r1r_r_r2rararbrbrcrcr3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNr�r�r�r�r�r�r�r�r�r�rOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrir�r�r�r�r�r�rjrkr&r1r=r%r'r(r)r*r+r-r,r.r/r2r4r3r5r6r7r9r:r;r<r>r?r@rBrArCrDrQr`rdrfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwrxryrzr{r|r}r~rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rUrVrWrXrYrZr[r\r]r^rJr�r�r�r�r�r�r�r�r0r�r�r8re)
rrrrrrr#�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s"
����encodings/__pycache__/cp775.cpython-38.opt-1.pyc000064400000017306151153537620015200 0ustar00U

e5d���@sfdZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/dd0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�dd�ds�dd8�d�dd7d+�d�ddd!�d�d�d�dd9d=d1�d�d�d�d �d!d�d"�d#�d$�d%�d&�d'�d(�d)�d*d&d�d+d$�d,�d-d��d.du�d/�d0�d1d��d2�d3�d4�d5dod��d6�d7�d8�d9�d:d:�d;�d<d�d=�d>d�d?�d@�dA�dB�dC�dD�dE�dF�dG�dH�dId�dt�dJd.d"d)�dK�dLd,d/�dMd-�dN�dOd6d��dPdd��dQ�dR�dS�dT�dU�dV�dW�dXd�dY�dZd d>�d[d;�d\d��d]�d^�d_dpd*�d`�da�dbd�d�d��dc�dd��Z
dS(ezf Python Character Mapping Codec cp775 generated from 'VENDORS/MICSFT/PC/CP775.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp775.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp775)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$���������#����B��V�W�+�y�����������M��"��Z�[������������*���{�|�z� �������A���%�%�%�%�$%�����c%�Q%�W%�]%�.�`�%�%�4%�,%�%�%�<%�r�j�Z%�T%�i%�f%�`%�P%�l%�}��
���/�a�s�k�~�%�%�%�%�%�%�%�����L�C�����D�6�7�;�<�F��E� ��� ����� ��"�����%�)���������������������������������r��r<rBrE�rLr��rM�rSrOr�rN�r�r�r�r��r�r�r��r��rTrQrPr��������r4r5r8����r6������������������r���r�r?rDrC������r@����r���������r*r,r7����r(������������������rG��r�r:r�rA���r'���u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£Ø×¤ĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�(rr�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwr�r<rBrErLr�rMrSrOr�rNr�r�r�r�r�r�r�r�rTrQrPr�r4r5r8r6r�r�r?rDrCr@r�r*r,r7r(rGr�r:r�rAr'r%r)rZrur&r-r[rvr�r/r]rxr\rwr;r+rFr2rbryr�r�r�r�rRr.r�r�r�r�r�r9r0r1r=r>rcrzrlr|rkr{r3rJrHrIrtr}r�r�rKr�r�rirXrrdrer~rhrYrgrfrjrrr_rnr`rmrarqr^rprorsr�r�r�r�r�rUrVrWr�)�__doc__rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s$����encodings/__pycache__/koi8_t.cpython-38.pyc000064400000004522151153537620014565 0ustar00U

e5d�3�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)z' Python Character Mapping Codec koi8_t
�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/koi8_t.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r
s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nzkoi8-t)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry"s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~қғ‚Ғ„…†‡￾‰ҳ‹ҲҷҶ￾Қ‘’“”•–—￾™￾›￾￾￾￾￾ӯӮё¤ӣ¦§￾￾￾«¬­®￾°±²Ё￾Ӣ¶·￾№￾»￾￾￾©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/gbk.cpython-38.pyc000064400000002601151153537620014127 0ustar00U

e5d��@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�gbkc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�%/usr/lib64/python3.8/encodings/gbk.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_cnrZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/utf_16_le.cpython-38.opt-2.pyc000064400000002736151153537620016121 0ustar00U

e5d
�@slddlZejZddd�ZGdd�dej�ZGdd�dej�ZGd	d
�d
ej�ZGdd�dej�Zd
d�Z	dS)�N�strictcCst�||d�S)NT)�codecs�utf_16_le_decode)�input�errors�r�+/usr/lib64/python3.8/encodings/utf_16_le.py�decodesr	c@seZdZddd�ZdS)�IncrementalEncoderFcCst�||j�dS)Nr)r�utf_16_le_encoder)�selfr�finalrrr�encodeszIncrementalEncoder.encodeN)F)�__name__�
__module__�__qualname__rrrrrr
sr
c@seZdZejZdS)�IncrementalDecoderN)rrrrr�_buffer_decoderrrrrsrc@seZdZejZdS)�StreamWriterN)rrrrrrrrrrrsrc@seZdZejZdS)�StreamReaderN)rrrrrr	rrrrrsrc	Cstjdttttttd�S)Nz	utf-16-le)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)r�	CodecInforr	r
rrrrrrr�getregentry!s�r)r)
rrrr	r
�BufferedIncrementalDecoderrrrrrrrr�<module>	s
encodings/__pycache__/iso2022_kr.cpython-38.pyc000064400000002624151153537620015165 0ustar00U

e5d�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�
iso2022_krc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�,/usr/lib64/python3.8/encodings/iso2022_kr.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z_codecs_iso2022rZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/euc_jis_2004.cpython-38.opt-2.pyc000064400000002623151153537620016416 0ustar00U

e5d�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�euc_jis_2004c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�./usr/lib64/python3.8/encodings/euc_jis_2004.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_jprZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/utf_8_sig.cpython-38.opt-1.pyc000064400000010704151153537620016215 0ustar00U

e5d%�@stdZddlZddd�Zddd�ZGdd	�d	ej�ZGd
d�dej�ZGdd
�d
ej�ZGdd�dej�Zdd�Z	dS)a Python 'utf-8-sig' Codec
This work similar to UTF-8 with the following changes:

* On encoding/writing a UTF-8 encoded BOM will be prepended/written as the
  first three bytes.

* On decoding/reading if the first three bytes are a UTF-8 encoded BOM, these
  bytes will be skipped.
�N�strictcCstjt�||�dt|�fS�Nr)�codecs�BOM_UTF8�utf_8_encode�len)�input�errors�r
�+/usr/lib64/python3.8/encodings/utf_8_sig.py�encodes�rcCsDd}|dd�tjkr&|dd�}d}t�||d�\}}|||fS)Nr�T)rr�utf_8_decode)rr	�prefix�output�consumedr
r
r�decodesrc@s8eZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
S)�IncrementalEncoderrcCstj�||�d|_dS�N�)rr�__init__�first��selfr	r
r
rrszIncrementalEncoder.__init__FcCs:|jr$d|_tjt�||j�dSt�||j�dSdSr)rrrrr	)rr�finalr
r
rrs�zIncrementalEncoder.encodecCstj�|�d|_dSr)rr�resetr�rr
r
rr'szIncrementalEncoder.resetcCs|jS�N�rrr
r
r�getstate+szIncrementalEncoder.getstatecCs
||_dSrr�r�stater
r
r�setstate.szIncrementalEncoder.setstateN)r)F)�__name__�
__module__�__qualname__rrrrr"r
r
r
rrs


rc@s6eZdZd
dd�Zdd�Zdd�Zdd	�Zd
d�ZdS)�IncrementalDecoderrcCstj�||�d|_dSr)r�BufferedIncrementalDecoderrrrr
r
rr2szIncrementalDecoder.__init__cCsv|jrht|�dkr*tj�|�r"dSd|_n>d|_|dd�tjkrht�|dd�||�\}}||dfSt�|||�S)Nr
��rr)rrrr�
startswithr)rrr	rrrr
r
r�_buffer_decode6s�z!IncrementalDecoder._buffer_decodecCstj�|�d|_dSr)rr'rrrr
r
rrGszIncrementalDecoder.resetcCstj�|�}|d|jfSr)rr'rrr r
r
rrKszIncrementalDecoder.getstatecCstj�||�|d|_dSr)rr'r"rr r
r
rr"PszIncrementalDecoder.setstateN)r)r#r$r%rr+rrr"r
r
r
rr&1s

r&c@seZdZdd�Zddd�ZdS)�StreamWritercCs.tj�|�z|`Wntk
r(YnXdSr)rr,rr�AttributeErrorrr
r
rrVs
zStreamWriter.resetrcCstj|_t||�Sr)rrr)rrr	r
r
rr]szStreamWriter.encodeN)r)r#r$r%rrr
r
r
rr,Usr,c@seZdZdd�Zddd�ZdS)�StreamReadercCs.tj�|�z|`Wntk
r(YnXdSr)rr.rrr-rr
r
rrbs
zStreamReader.resetrcCspt|�dkrtj�|�r\dSn>|dd�tjkr\tj|_t�|dd�|�\}}||dfStj|_t�||�S)Nr
r()rrrr*rr)rrr	rrr
r
rriszStreamReader.decodeN)r)r#r$r%rrr
r
r
rr.asr.c	Cstjdttttttd�S)Nz	utf-8-sig)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)r�	CodecInforrrr&r.r,r
r
r
r�getregentryys�r5)r)r)
�__doc__rrrrr'r&r,r.r5r
r
r
r�<module>s	

$encodings/__pycache__/mac_romanian.cpython-38.opt-1.pyc000064400000004647151153537620016763 0ustar00U

e5d]5�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zu Python Character Mapping Codec mac_romanian generated from 'MAPPINGS/VENDORS/APPLE/ROMANIAN.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�./usr/lib64/python3.8/encodings/mac_romanian.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nzmac-romanian)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp1256.cpython-38.opt-1.pyc000064400000004622151153537620015250 0ustar00U

e5d2�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zv Python Character Mapping Codec cp1256 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1256.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1256.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1256)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/gbk.cpython-38.opt-2.pyc000064400000002601151153537620015067 0ustar00U

e5d��@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�gbkc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�%/usr/lib64/python3.8/encodings/gbk.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_cnrZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/cp869.cpython-38.opt-2.pyc000064400000017107151153537620015204 0ustar00U

e5dŀ��@sbddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�Ze�ed��Z	e	�
ddddddddddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�dd4�d�d�d�d�d�d�d�d�d�d�d �d!dd{dd�d"ddv�d#�d$d�d%d1�d&�d'�d(�d)�d*�d+�d,�d-�d.�d/�d0�d1�d2�d3�d4�d5�d6�d7�d8�d9�d:�d;�d<�d=�d>�d?�d@�dA�dB�dC�dD�dE�dF�dG�dH�dI�dJ�dK�dL�dM�dN�dOd��dP�dQd"�dR�dS�dT�dU�dVd �dW�dX�dY�dZ�d[�d\�d]�d^�d_�d`�da�dbd5�dc�dd�de�df�dg�dh�di�dj�dk�dld~dwd�dm�dn��ZdS(o�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp869.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp869)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$������ � �� �����������������������������������%�%�%�%�$%�����c%�Q%�W%�]%���%�%�4%�,%�%�%�<%���Z%�T%�i%�f%�`%�P%�l%�����������%�%�%�%���%�����������������������������������������%�)���������������������������������r���r9��r)r�r�r4�rKr(r���r�r�r6r7���r'���rL�rH���������������������������������������������������������������������������������������������������������������������u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~￾￾￾￾￾￾Ά￾·¬¦‘’Έ―ΉΊΪΌ￾￾ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�rr�r�rrr�r�r�r�rr�r�r�r�r�r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r	r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrr�r
r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r)�rr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwrxryrzr{r|r}r~rr�r�r�r�r�r�r�r�r�r�r�r�r�r9r)r�r�r4rKr(r�r�r�r6r7r'rLrHr�r�r&r,r.r/r1r2r5r>rArBrCrDrErFrGrIrJrRrSrTrUrZr[rcrdrlrmrnrorprqrrr0r3r8r:r;r<r�rsrtrurzr{r}r~rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r=r�r?r@r�r-r*r+rarPrwr\r]rvr`rQr_r^rbrjrWrfrXrerYrirVrhrgrkr|ryrxrMrNrOr�)
rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s
����encodings/__pycache__/uu_codec.cpython-38.opt-1.pyc000064400000006170151153537620016116 0ustar00U

e5d#�@s�dZddlZddlZddlmZddd�Zdd	d
�ZGdd�dej�ZGd
d�dej�ZGdd�dej	�Z	Gdd�deej
�Z
Gdd�deej�Zdd�ZdS)aPython 'uu_codec' Codec - UU content transfer encoding.

This codec de/encodes from bytes to bytes.

Written by Marc-Andre Lemburg (mal@lemburg.com). Some details were
adapted from uu.py which was written by Lance Ellinghouse and
modified by Jack Jansen and Fredrik Lundh.
�N)�BytesIO�strict�<data>�c	Cs�t|�}t�}|j}|j}|�dd�}|�dd�}|d|d@|f�d��|d�}|rp|t�|��|d�}qT|d	�|��t|�fS)
N�
z\n�
z\rzbegin %o %s
i��ascii�-s 
end
)	r�read�write�replace�encode�binasciiZb2a_uu�getvalue�len)	�input�errors�filename�mode�infile�outfiler
r�chunk�r�*/usr/lib64/python3.8/encodings/uu_codec.py�	uu_encodes
rc

Cs�t|�}t�}|j}|j}|�}|s,td��|dd�dkrq@q|�}|r�|dkrTq�zt�|�}WnRtjk
r�}z2|ddd@ddd	}	t�|d|	��}W5d}~XYnX||�q@|s�td
��|��t|�fS)Nz"Missing "begin" line in input data�sbeginsend
r� �?��zTruncated input data)	r�readliner�
ValueErrorrZa2b_uu�Errorrr)
rrrrr r�s�data�v�nbytesrrr�	uu_decode%s*$
r'c@s eZdZddd�Zddd�ZdS)	�CodecrcCs
t||�S�N)r��selfrrrrrr
GszCodec.encodecCs
t||�Sr))r'r*rrr�decodeJszCodec.decodeN)r)r)�__name__�
__module__�__qualname__r
r,rrrrr(Fs
r(c@seZdZddd�ZdS)�IncrementalEncoderFcCst||j�dS�Nr)rr�r+r�finalrrrr
NszIncrementalEncoder.encodeN)F)r-r.r/r
rrrrr0Msr0c@seZdZddd�ZdS)�IncrementalDecoderFcCst||j�dSr1)r'rr2rrrr,RszIncrementalDecoder.decodeN)F)r-r.r/r,rrrrr4Qsr4c@seZdZeZdS)�StreamWriterN�r-r.r/�bytes�charbuffertyperrrrr5Usr5c@seZdZeZdS)�StreamReaderNr6rrrrr9Xsr9c
Cstjdttttttdd�S)N�uuF)�namer
r,�incrementalencoder�incrementaldecoder�streamreader�streamwriter�_is_text_encoding)�codecs�	CodecInforr'r0r4r9r5rrrr�getregentry]s�rC)rrr)r)
�__doc__rAr�iorrr'r(r0r4r5r9rCrrrr�<module>s	

!encodings/__pycache__/euc_jp.cpython-38.opt-1.pyc000064400000002607151153537620015576 0ustar00U

e5d�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�euc_jpc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�(/usr/lib64/python3.8/encodings/euc_jp.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_jprZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/mbcs.cpython-38.opt-2.pyc000064400000002710151153537620015251 0ustar00U

e5d��@szddlmZmZddlZeZddd�ZGdd�dej�ZGdd	�d	ej�ZGd
d�dej�ZGdd
�d
ej	�Z	dd�Z
dS)�)�mbcs_encode�mbcs_decodeN�strictcCst||d�S)NT)r)�input�errors�r�&/usr/lib64/python3.8/encodings/mbcs.py�decodesr	c@seZdZddd�ZdS)�IncrementalEncoderFcCst||j�dS)Nr)rr)�selfr�finalrrr�encodeszIncrementalEncoder.encodeN)F)�__name__�
__module__�__qualname__r
rrrrr
sr
c@seZdZeZdS)�IncrementalDecoderN)rrrr�_buffer_decoderrrrrsrc@seZdZeZdS)�StreamWriterN)rrrrr
rrrrrsrc@seZdZeZdS)�StreamReaderN)rrrrr	rrrrr!src	Cstjdttttttd�S)N�mbcs)�namer
r	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)�codecs�	CodecInfor
r	r
rrrrrrr�getregentry&s�r)r)rrrr
r	r
�BufferedIncrementalDecoderrrrrrrrr�<module>s
encodings/__pycache__/kz1048.cpython-38.opt-1.pyc000064400000004606151153537620015273 0ustar00U

e5d�5�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zl Python Character Mapping Codec kz1048 generated from 'MAPPINGS/VENDORS/MISC/KZ1048.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/kz1048.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�kz1048)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—￾™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/utf_32.cpython-38.opt-2.pyc000064400000011167151153537620015435 0ustar00U

e5d	�@stddlZddlZejZddd�ZGdd�dej�ZGdd�dej�ZGd	d
�d
ej�ZGdd�dej	�Z	d
d�Z
dS)�N�strictcCst�||d�S)NT)�codecs�
utf_32_decode)�input�errors�r�(/usr/lib64/python3.8/encodings/utf_32.py�decode
sr	c@s8eZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
S)�IncrementalEncoderrcCstj�||�d|_dS�N)rr
�__init__�encoder��selfrrrrrszIncrementalEncoder.__init__FcCsN|jdkr<t�||j�d}tjdkr0tj|_ntj|_|S|�||j�dS)Nr�little)r
r�
utf_32_encoder�sys�	byteorder�utf_32_le_encode�utf_32_be_encode)rr�final�resultrrr�encodes


zIncrementalEncoder.encodecCstj�|�d|_dSr)rr
�resetr
�rrrrrszIncrementalEncoder.resetcCs|jdkrdSdS)N�r)r
rrrr�getstate szIncrementalEncoder.getstatecCs,|rd|_ntjdkr tj|_ntj|_dS�Nr)r
rrrrr�r�staterrr�setstate's


zIncrementalEncoder.setstateN)r)F)�__name__�
__module__�__qualname__rrrrr rrrrr

s



r
c@s6eZdZd
dd�Zdd�Zdd�Zdd	�Zd
d�ZdS)�IncrementalDecoderrcCstj�||�d|_dSr)r�BufferedIncrementalDecoderr�decoderrrrrr1szIncrementalDecoder.__init__cCsl|jdkr\t�||d|�\}}}|dkr2tj|_n"|dkrDtj|_n|dkrTtd��||fS|�||j|�S)Nr������%UTF-32 stream does not start with BOM)r&r�utf_32_ex_decode�utf_32_le_decode�utf_32_be_decode�UnicodeErrorr)rrrr�output�consumedrrrr�_buffer_decode5s
�

z!IncrementalDecoder._buffer_decodecCstj�|�d|_dSr)rr%rr&rrrrrBszIncrementalDecoder.resetcCsDtj�|�d}|jdkr"|dfSttjdk|jtjkk�}||fS)Nrr�big)rr%rr&�intrrr-)rrZaddstaterrrrFs


�zIncrementalDecoder.getstatecCsdtj�||�|d}|dkr8tjdkr.tjntj|_n(|dkrZtjdkrPtjntj|_nd|_dS)Nr(rr2)rr%r rrr-r,r&rrrrr Ts����zIncrementalDecoder.setstateN)r)r!r"r#rr1rrr rrrrr$0s


r$c@s(eZdZd	dd�Zdd�Zd
dd�ZdS)�StreamWriterrcCsd|_tj�|||�dSr)r
rr4r)r�streamrrrrrdszStreamWriter.__init__cCstj�|�d|_dSr)rr4rr
rrrrrhszStreamWriter.resetcCsF|jdkr6t�||�}tjdkr*tj|_ntj|_|S|�||�SdSr)r
rrrrrr)rrrrrrrrls


zStreamWriter.encodeN)r)r)r!r"r#rrrrrrrr4cs
r4c@seZdZdd�Zddd�ZdS)�StreamReadercCs.tj�|�z|`Wntk
r(YnXdSr)rr6rr	�AttributeErrorrrrrrys
zStreamReader.resetrcCsRt�||dd�\}}}|dkr(tj|_n"|dkr:tj|_n|dkrJtd��||fS)NrFr'r(r)r*)rr+r,r	r-r.)rrr�objectr0rrrrr	�s�

zStreamReader.decodeN)r)r!r"r#rr	rrrrr6wsr6c	Cstjdttttttd�S)Nzutf-32)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)r�	CodecInforr	r
r$r6r4rrrr�getregentry�s�r?)r)rrrrr	r
r%r$r4r6r?rrrr�<module>s
#3encodings/__pycache__/cp866.cpython-38.opt-1.pyc000064400000017757151153537620015213 0ustar00U

e5d\��@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d �d!�d"�d#�d$�d%�d&�d'�d(�d)�d*�d+�d,�d-�d.�d/�d0�d1�d2�d3�d4�d5�d6�d7�d8d��d9�d:�d;d��d<�d=�d>�d?�d@�dA�dB�dC�dD�dE�dF�dG�dH�dI�dJ�dK�dL�dM�dN�dO�dP�dQ�dR�dS�dT�dU�dV�dW�dX�dY�dZ�d[�d\�d]�d^�d_�d`�da�db�dc�dd�de�df�dg�dh�di�dj�dk�dl�dm�dnd��do�dp�dq�dr�ds�dt�du�dv�dw�dx�dy�dz�d{�d|�d}�d~�d�d��d��d��d��d��d��d��d��d��d�d��d��d��d��d���Z
dS(�z` Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP866.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp866.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp866)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$������������������ �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�%�%�%�%�$%�a%�b%�V%�U%�c%�Q%�W%�]%�\%�[%�%�%�4%�,%�%�%�<%�^%�_%�Z%�T%�i%�f%�`%�P%�l%�g%�h%�d%�e%�Y%�X%�R%�S%�k%�j%�%�%�%�%�%�%�%�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O��Q��T��W��^��"��"�!��%�)���������������������������������r����r������������r�������r����������������������������������������������������������������������������������������������������������������������������u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r!rrrrrrrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrr	r
rrr
rrrrrrrrrrrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r�r�rr�r�r (rr"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwrxryrzr{r|r}r~rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rjrYr�rerfrrirZrhrgrkrsr`r{r|ror^r]rarzryrnrdrcrbrlrmrrr[r\r_rwrxrqrurvrpr~r}rtr�r�r�r�r�rVrWrXr�)�__doc__rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s$
����encodings/__pycache__/uu_codec.cpython-38.pyc000064400000006263151153537620015162 0ustar00U

e5d#�@s�dZddlZddlZddlmZddd�Zdd	d
�ZGdd�dej�ZGd
d�dej�ZGdd�dej	�Z	Gdd�deej
�Z
Gdd�deej�Zdd�ZdS)aPython 'uu_codec' Codec - UU content transfer encoding.

This codec de/encodes from bytes to bytes.

Written by Marc-Andre Lemburg (mal@lemburg.com). Some details were
adapted from uu.py which was written by Lance Ellinghouse and
modified by Jack Jansen and Fredrik Lundh.
�N)�BytesIO�strict�<data>�c	Cs�|dkst�t|�}t�}|j}|j}|�dd�}|�dd�}|d|d@|f�d��|d	�}|r||t�|��|d	�}q`|d
�|��t	|�fS)Nr�
z\n�
z\rzbegin %o %s
i��ascii�-s 
end
)
�AssertionErrorr�read�write�replace�encode�binasciiZb2a_uu�getvalue�len)	�input�errors�filename�mode�infile�outfilerr�chunk�r�*/usr/lib64/python3.8/encodings/uu_codec.py�	uu_encodes
rc

Cs�|dkst�t|�}t�}|j}|j}|�}|s8td��|dd�dkr&qLq&|�}|r�|dkr`q�zt�|�}WnRtjk
r�}z2|ddd@d	dd
}	t�|d|	��}W5d}~XYnX||�qL|s�td��|��t	|�fS)Nrz"Missing "begin" line in input data�sbeginsend
r� �?��zTruncated input data)
r
r�readliner�
ValueErrorrZa2b_uu�Errorrr)
rrrrr!r�s�data�v�nbytesrrr�	uu_decode%s,$
r(c@s eZdZddd�Zddd�ZdS)	�CodecrcCs
t||�S�N)r��selfrrrrrrGszCodec.encodecCs
t||�Sr*)r(r+rrr�decodeJszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rr-rrrrr)Fs
r)c@seZdZddd�ZdS)�IncrementalEncoderFcCst||j�dS�Nr)rr�r,r�finalrrrrNszIncrementalEncoder.encodeN)F)r.r/r0rrrrrr1Msr1c@seZdZddd�ZdS)�IncrementalDecoderFcCst||j�dSr2)r(rr3rrrr-RszIncrementalDecoder.decodeN)F)r.r/r0r-rrrrr5Qsr5c@seZdZeZdS)�StreamWriterN�r.r/r0�bytes�charbuffertyperrrrr6Usr6c@seZdZeZdS)�StreamReaderNr7rrrrr:Xsr:c
Cstjdttttttdd�S)N�uuF)�namerr-�incrementalencoder�incrementaldecoder�streamreader�streamwriter�_is_text_encoding)�codecs�	CodecInforr(r1r5r:r6rrrr�getregentry]s�rD)rrr)r)
�__doc__rBr�iorrr(r)r1r5r6r:rDrrrr�<module>s	

!encodings/__pycache__/gb2312.cpython-38.opt-1.pyc000064400000002607151153537620015231 0ustar00U

e5d�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�gb2312c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�(/usr/lib64/python3.8/encodings/gb2312.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_cnrZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/utf_32_be.cpython-38.opt-2.pyc000064400000002736151153537620016105 0ustar00U

e5d��@slddlZejZddd�ZGdd�dej�ZGdd�dej�ZGd	d
�d
ej�ZGdd�dej�Zd
d�Z	dS)�N�strictcCst�||d�S)NT)�codecs�utf_32_be_decode)�input�errors�r�+/usr/lib64/python3.8/encodings/utf_32_be.py�decode
sr	c@seZdZddd�ZdS)�IncrementalEncoderFcCst�||j�dS)Nr)r�utf_32_be_encoder)�selfr�finalrrr�encodeszIncrementalEncoder.encodeN)F)�__name__�
__module__�__qualname__rrrrrr

sr
c@seZdZejZdS)�IncrementalDecoderN)rrrrr�_buffer_decoderrrrrsrc@seZdZejZdS)�StreamWriterN)rrrrrrrrrrrsrc@seZdZejZdS)�StreamReaderN)rrrrrr	rrrrrsrc	Cstjdttttttd�S)Nz	utf-32-be)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)r�	CodecInforr	r
rrrrrrr�getregentrys�r)r)
rrrr	r
�BufferedIncrementalDecoderrrrrrrrr�<module>s
encodings/__pycache__/quopri_codec.cpython-38.opt-2.pyc000064400000004326151153537620017006 0ustar00U

e5d��@s�ddlZddlZddlmZddd�Zddd�ZGdd	�d	ej�ZGd
d�dej�ZGdd
�d
ej�ZGdd�deej	�Z	Gdd�deej
�Z
dd�ZdS)�N)�BytesIO�strictcCs.t|�}t�}tj||dd�|��t|�fS)NT)Z	quotetabs)r�quopri�encode�getvalue�len��input�errors�f�g�r
�./usr/lib64/python3.8/encodings/quopri_codec.py�
quopri_encode
srcCs*t|�}t�}t�||�|��t|�fS�N)rr�decoderrrr
r
r�
quopri_decodesrc@s eZdZddd�Zddd�ZdS)	�CodecrcCs
t||�Sr)r��selfr	r
r
r
rrszCodec.encodecCs
t||�Sr)rrr
r
rrszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrr
r
r
rrs
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst||j�dS�Nr)rr
�rr	�finalr
r
rrszIncrementalEncoder.encodeN)F)rrrrr
r
r
rrsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst||j�dSr)rr
rr
r
rr#szIncrementalDecoder.decodeN)F)rrrrr
r
r
rr"src@seZdZeZdS)�StreamWriterN�rrr�bytes�charbuffertyper
r
r
rr&src@seZdZeZdS)�StreamReaderNrr
r
r
rr")sr"c
Cstjdttttttdd�S)NrF)�namerr�incrementalencoder�incrementaldecoder�streamwriter�streamreader�_is_text_encoding)�codecs�	CodecInforrrrrr"r
r
r
r�getregentry.s�r+)r)r)r)r�iorrrrrrrr"r+r
r
r
r�<module>s

encodings/__pycache__/cp865.cpython-38.opt-2.pyc000064400000017057151153537620015204 0ustar00U

e5d:��@sPddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�Ze�ed��Z	e	�
dddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�dd'�d�d�d�d�dd5d*d3�dd d2�dd9d=�d�d�d�d�d�d�d�d�d�d d/�d!d��d"�d#�d$�d%�d&�d'�d(�d)�d*�d+d<�d,�d-d>�d.�d/�d0�d1d#�d2�d3d+�d4�d5�d6�d7dddddddd�d8ddd0d�d9d&d%ddd��d:d1d$�d;d"�d<d�d=�d>d7�d?�d@�dA�dB�dC�dDd�dEd6�dFd(d�dGd��dH�dI�dJ�dK�dLd:d;d!d�dMdu�dN�dOd4�dP�dQ�dR�dS�dTd,�dU�dVdpd)�dW�dX�dYd�d�d��dZ�d[��ZdS(\�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp865.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp865)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$������������������������������������������������������� ����������������#�������%�%�%�%�$%�a%�b%�V%�U%�c%�Q%�W%�]%�\%�[%�%�%�4%�,%�%�%�<%�^%�_%�Z%�T%�i%�f%�`%�P%�l%�g%�h%�d%�e%�Y%�X%�R%�S%�k%�j%�%�%�%�%�%�%�%����������������"����)"�a"��e"�d"� #�!#��H"��"��"� ��%�)���������������������������������r�rS�rBrU�����rLrTrP���r�r�r���r��r���rM�rRrQ�rN������r4r5r8r&��r6��������������rK��������r?��rC������r@����r�r+rFr)��r*r,r7r-r0r(r.r/r3rGr2r1��rJr;rHr9�r:r�rAr=rIr<r'��r>u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�(rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnror�rSrBrUrLrTrPr�r�r�r�r�rMrRrQrNr4r5r8r&r6rKr?rCr@r�r+rFr)r*r,r7r-r0r(r.r/r3rGr2r1rJr;rHr9r:r�rAr=rIr<r'r>rEr�r�r�r�r�r�r�r�r�r�r�r�r�rDr�r�r�r�r�r�r�r�rOr�r�rjrYr�rerfrrirZrhrgrkrsr`r{r|ror^r]rarzryrnrdrcrbrlrmrrr[r\r_rwrxrqrurvrpr~r}rtr�r�r�r�r�rVrWrXr�)
rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s"
����encodings/__pycache__/cp1006.cpython-38.opt-2.pyc000064400000004507151153537620015244 0ustar00U

e5d5�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1006.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)NZcp1006)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ۰۱۲۳۴۵۶۷۸۹،؛­؟ﺁﺍﺎﺎﺏﺑﭖﭘﺓﺕﺗﭦﭨﺙﺛﺝﺟﭺﭼﺡﺣﺥﺧﺩﮄﺫﺭﮌﺯﮊﺱﺳﺵﺷﺹﺻﺽﺿﻁﻅﻉﻊﻋﻌﻍﻎﻏﻐﻑﻓﻕﻗﻙﻛﮒﮔﻝﻟﻠﻡﻣﮞﻥﻧﺅﻭﮦﮨﮩﮪﺀﺉﺊﺋﻱﻲﻳﮰﮮﹼﹽ)
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp857.cpython-38.pyc000064400000016501151153537620014236 0ustar00U

e5dt���@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcddddedfdgdhdidjdkdldmdndodpdqdrdsdtduddvdwdxdydzd{d|d}d~ddd�d�d�d�d�d�d�d�d�d�d�d�d���d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�ddzd}d;�d
dgd�ddsd'd�d5d9da�ddHdd+d4�dddd!d#d3d�d&�dd{d:d>d2d�d�dud�d�d�d�d�ddq�ddrdo�dd)dvd-dNdVddd�dd�dddd�dd0�dd��dd"�d�d�d�d �d!�d"�d#�d$�d%d=�d&�d'd_�d(dM�d)d�d*d$�d+�d,d,�d-�d.d1dld��d/�d0�d1�d2dd�dwd8dGdydWd|dFdEdded`d d?ddd<dmd�dcdbdfdpd*dxd�d~d��d3�d4��Z
dS(5z` Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP857.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp857.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp857)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$���������������������������1������������������0���������^�_����������������������%�%�%�%�$%������c%�Q%�W%�]%���%�%�4%�,%�%�%�<%�����Z%�T%�i%�f%�`%�P%�l%����������������%�%�%�%����%�������������������������������������%�)��������������������������������r�rSrcrBrurdr�r�r�r^rwrTrPr�rOr�r�r�r�r�r�r�r�r�r�r�rvrUrRrQr�rNr]r[r\rmr4r5r8r&rzr6rxryr�r{r|r}��rKr�r�r�r�r?r�rCr�r�r�r@����r�r+rFr)rlr*r,r7r-r0r(r.r/rGr2r1��rJr;rHr9r�r:r�rAr=rIr<r'��r�u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ￾ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ￾×ÚÛÙìÿ¯´­±￾¾¶§÷¸°¨·¹³²■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r���r�r�r�r�r�r�r�r�r�r�r�r�r�r�)�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFr�rSrcrBrurdr�r�r�r^rwrTrPr�rOr�r�r�r�r�r�r�r�r�r�r�rvrUrRrQr�rNr]r[r\rmr4r5r8r&rzr6rxryr�r{r|r}rKr�r�r�r�r?r�rCr�r�r�r@r�r+rFr)rlr*r,r7r-r0r(r.r/rGrGr2r1rJr;rHr9r�r:r�rAr=rIr<r'r�rLrMr>r3rDrErjrYrrerfr~rirZrhrgrkrsr`rorarnrbrrr_rqrprtr�r�r�rVrWrXr�)�__doc__rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s
����encodings/__pycache__/koi8_u.cpython-38.opt-1.pyc000064400000004635151153537620015532 0ustar00U

e5d�5�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zf Python Character Mapping Codec koi8_u generated from 'python-mappings/KOI8-U.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/koi8_u.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nzkoi8-u)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/hex_codec.cpython-38.pyc000064400000004524151153537620015313 0ustar00U

e5d��@s�dZddlZddlZddd�Zddd�ZGdd	�d	ej�ZGd
d�dej�ZGdd
�d
ej�ZGdd�deej�ZGdd�deej	�Z	dd�Z
dS)z�Python 'hex_codec' Codec - 2-digit hex content transfer encoding.

This codec de/encodes from bytes to bytes.

Written by Marc-Andre Lemburg (mal@lemburg.com).
�N�strictcCs|dkst�t�|�t|�fS�Nr)�AssertionError�binascii�b2a_hex�len��input�errors�r�+/usr/lib64/python3.8/encodings/hex_codec.py�
hex_encode
sr
cCs|dkst�t�|�t|�fSr)rr�a2b_hexrrrrr�
hex_decodesrc@s eZdZddd�Zddd�ZdS)	�CodecrcCs
t||�S�N)r
��selfr	r
rrr�encodeszCodec.encodecCs
t||�Sr)rrrrr�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrrrs
rc@seZdZddd�ZdS)�IncrementalEncoderFcCs|jdkst�t�|�Sr)r
rrr�rr	�finalrrrrszIncrementalEncoder.encodeN)F)rrrrrrrrrsrc@seZdZddd�ZdS)�IncrementalDecoderFcCs|jdkst�t�|�Sr)r
rrrrrrrr!szIncrementalDecoder.decodeN)F)rrrrrrrrr src@seZdZeZdS)�StreamWriterN�rrr�bytes�charbuffertyperrrrr%src@seZdZeZdS)�StreamReaderNrrrrrr!(sr!c
Cstjdttttttdd�S)N�hexF)�namerr�incrementalencoder�incrementaldecoder�streamwriter�streamreader�_is_text_encoding)�codecs�	CodecInfor
rrrrr!rrrr�getregentry-s�r+)r)r)�__doc__r)rr
rrrrrr!r+rrrr�<module>s

encodings/__pycache__/iso8859_4.cpython-38.opt-2.pyc000064400000004374151153537620015710 0ustar00U

e5d@4�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/iso8859_4.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	iso8859-4)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤Ĩϧ¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩšēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖרŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙)
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp864.cpython-38.pyc000064400000017462151153537620014243 0ustar00U

e5d���@szdZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+ddd,d-dd.d/d0ddd1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�dd��~�d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�d�d�d�dded)�d�d�ddd$�d�d�d�d �d!d�d"�d#�d$�d%�d&�d'�d(�d)�d*�d+�d,�d-�d.�d/�d0�d1�d2�d3�d4�d5�d6�d7�d8dI�d9�d:�d;�d<�d=�d>�d?�d@�dA�dB�dCd(�dDd.�dE�dF�dG�dH�dI�dJ�dK�dL�dMd&�dNd%�dO�dP�dQ�dR�dSdg�dT�dU�dV�dW�dX�dY�dZ�d[df�d\�d]�d^�d_�d`�da�db�dc�dd�de�df�dg�dh�di�dj�dk�dl�dm�dn�do�dp�dq�dr�ds�dt�du�dv�dw��Z
dS(xz` Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP864.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp864.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp864)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$��j���"�"�%�%�%�<%�$%�,%�%�4%�%�%�%�%��"������H"������������������`�a�b�c�d�e�f�g�h�i����������������������������������������������@������������������������������}��Q�����������������������%)~�%���������������������������������r_�rz����r>r{rD��r'r:�����r(���r?r<r;����������������������������������������������r}������������������������������������������������������������r|��������u�	

 !"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ￾￾ﻻﻼ￾ ­ﺂ£¤ﺄ￾￾ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■￾���������	�
���
������������������� �!�"�#�$�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~��r���r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r
rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�rr�r
r�r�r�rr�rr�rr�r�rrrr�rr	r�r�r�r�)�rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwrxryrzr{r|r}r~rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r_r�r�rzr>r{rDr'r:r(r?r<r;r}r|r7r9rKrZr^rr�rOrPrQrRrSrTrUrVrWrXr&r)r*r8r=r,r-r4r3r5r6r1r/r0r2r.r+r�r�r`rarErbrFrcrerfrGrHrgrhrIrirJrjrLrkrMrlrNrmrnrorprqr[rrr\rsr]rtr�rurvrwr~rdrxr�r�r�ryr�rYr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r@rArBrC)�__doc__rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s
����encodings/__pycache__/mac_roman.cpython-38.opt-1.pyc000064400000004635151153537620016270 0ustar00U

e5d�4�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zo Python Character Mapping Codec mac_roman generated from 'MAPPINGS/VENDORS/APPLE/ROMAN.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/mac_roman.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	mac-roman)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp861.cpython-38.opt-2.pyc000064400000017057151153537620015200 0ustar00U

e5dI��@sPddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�Ze�ed��Z	e	�
dddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�dd*�dd'd d2�dd9d=�d�d�d�d�d�d�d�d�d�d �d!�d"�d#�d$�d%�d&d/�d'd��d(�d)�d*�d+�d,�d-�d.�d/�d0d<�d1�d2�d3�d4d#�d5d+�d6�d7�d8�d9�d:ddddddd�d;�d<ddd0d�d=�d>d%�d?�d@d�dd1�dA�dBd"�dCd�dDd6d7�dE�dF�dG�dH�dId3dd4�dJ�dKd(d�dLd�d>�dMd5�dN�dOd:d;d!d�dPdu�dQ�dR�dS�dT�dU�dVd�dWd,�dX�dYdpd)�dZd&dd�d�d�d$�d[��ZdS(\�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp861.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp861)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$������������������������������������������������������� �����������������#�������%�%�%�%�$%�a%�b%�V%�U%�c%�Q%�W%�]%�\%�[%�%�%�4%�,%�%�%�<%�^%�_%�Z%�T%�i%�f%�`%�P%�l%�g%�h%�d%�e%�Y%�X%�R%�S%�k%�j%�%�%�%�%�%�%�%����������������"����)"�a"��e"�d"� #�!#��H"��"��"� ��%�)���������������������������������r�rS�rB�������rTrP���r�r�r���r��r����rUrRrQ�rN�rJ����r4r5r8r&��r6������rK����r1����rL����r?��rC��rM��r@r=r3r�r+rFr)��r*r,r7r-r0r(r.r/��rG����r2����rHr9�r:r�rA�rIr<r'r>r;�u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�(rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnror�rSrBrTrPr�r�r�r�r�rUrRrQrNrJr4r5r8r&r6rKr1rLr?rCrMr@r=r3r�r+rFr)r*r,r7r-r0r(r.r/rGr2rHr9r:r�rArIr<r'r>r;rEr�r�r�r�r�r�r�r�r�r�r�r�r�rDr�r�r�r�r�r�r�r�rOr�r�rjrYr�rerfrrirZrhrgrkrsr`r{r|ror^r]rarzryrnrdrcrbrlrmrrr[r\r_rwrxrqrurvrpr~r}rtr�r�r�r�r�rVrWrXr�)
rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s"
����encodings/__pycache__/big5.cpython-38.opt-1.pyc000064400000002603151153537620015153 0ustar00U

e5d��@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�big5c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�&/usr/lib64/python3.8/encodings/big5.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_twrZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/iso2022_jp_ext.cpython-38.pyc000064400000002634151153537620016043 0ustar00U

e5d-�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�iso2022_jp_extc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�0/usr/lib64/python3.8/encodings/iso2022_jp_ext.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z_codecs_iso2022rZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/iso2022_jp_1.cpython-38.pyc000064400000002630151153537620015377 0ustar00U

e5d%�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�iso2022_jp_1c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�./usr/lib64/python3.8/encodings/iso2022_jp_1.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z_codecs_iso2022rZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/cp858.cpython-38.opt-2.pyc000064400000016343151153537620015203 0ustar00U

e5d߄�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�Ze�ed��Z	e	�
dddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�dd'dd:�ddgd�d|dsd&d�dld8d5d_dGdd*d3d{ddd d"d2d�d%d�d}d9d=d1d�d�dud�d�d�d�d�ddq�ddrdodwd(d-d,d4dMdUddd�d�d�dddd�dd0dd/�dd��dd!�d�d�d�d�d �d!�d"�d#�d$d<�d%�d&d`d^�d'dL�d(d�d)d#�d*�d+d+�d,�d-dd�d.dt�d/d$dd�dxd7dFdzdVd~dEdDdded6dd>dcd;dmd�dbdadfdpd)dyd�d�d�dv�d0��ZdS(1�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp858.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp858)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$�������������������������������������������������������������������������������%�%�%�%�$%������c%�Q%�W%�]%���%�%�4%�,%�%�%�<%�����Z%�T%�i%�f%�`%�P%�l%������������ �������%�%�%�%����%����������������������������� ������������%�)���������������������������������r�rSrcrBrurdr�r�r�r^rLrTrPr�rOr�r�r�r�r�r�r�r�r�r�r�rMrUrRrQr�rNr]r[r\rmr4r5r8r&rzr6rxryr�r|r}r~rwrKr�r�r�r�r?rDrCr�r�r�r@r�r�r�r+rFr)rlr*r,r7r-r0r(r.r/r3rGr2r1rvrJr;rHr9r�r:r�rAr=rIr<r'r�r�r>u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�(rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDr�rSrcrBrurdr�r�r�r^rLrTrPr�rOr�r�r�r�r�r�r�r�r�r�r�rMrUrRrQr�rNr]r[r\rmr4r5r8r&rzr6rxryr�r|r}r~rwrKr�r�r�r�r?rDrCr�r�r�r@r�r�r�r+rFr)rlr*r,r7r-r0r(r.r/r3rGr2r1rvrJr;rHr9r�r:r�rAr=rIr<r'r�r�r>r{rEr�rjrYr�rerfrrirZrhrgrkrsr`rorarnrbrrr_rqrprtr�r�r�rVrWrXr�)
rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s"
����encodings/__pycache__/cp1250.cpython-38.opt-2.pyc000064400000004414151153537620015242 0ustar00U

e5dv5�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1250.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1250)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€￾‚￾„…†‡￾‰Š‹ŚŤŽŹ￾‘’“”•–—￾™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙)
rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/utf_32_be.cpython-38.pyc000064400000003011151153537620015130 0ustar00U

e5d��@spdZddlZejZddd�ZGdd�dej�ZGdd	�d	ej�ZGd
d�dej�ZGdd
�d
ej	�Z	dd�Z
dS)z
Python 'utf-32-be' Codec
�N�strictcCst�||d�S)NT)�codecs�utf_32_be_decode)�input�errors�r�+/usr/lib64/python3.8/encodings/utf_32_be.py�decode
sr	c@seZdZddd�ZdS)�IncrementalEncoderFcCst�||j�dS)Nr)r�utf_32_be_encoder)�selfr�finalrrr�encodeszIncrementalEncoder.encodeN)F)�__name__�
__module__�__qualname__rrrrrr

sr
c@seZdZejZdS)�IncrementalDecoderN)rrrrr�_buffer_decoderrrrrsrc@seZdZejZdS)�StreamWriterN)rrrrrrrrrrrsrc@seZdZejZdS)�StreamReaderN)rrrrrr	rrrrrsrc	Cstjdttttttd�S)Nz	utf-32-be)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)r�	CodecInforr	r
rrrrrrr�getregentrys�r)r)�__doc__rrrr	r
�BufferedIncrementalDecoderrrrrrrrr�<module>s
encodings/__pycache__/hz.cpython-38.opt-1.pyc000064400000002577151153537620014760 0ustar00U

e5d��@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�hzc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�$/usr/lib64/python3.8/encodings/hz.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_cnrZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/hz.cpython-38.opt-2.pyc000064400000002577151153537620014761 0ustar00U

e5d��@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�hzc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�$/usr/lib64/python3.8/encodings/hz.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_cnrZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/cp037.cpython-38.opt-1.pyc000064400000004570151153537620015166 0ustar00U

e5dA3�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zs Python Character Mapping Codec cp037 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP037.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp037.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp037)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�œ	†—Ž
…‡’€‚ƒ„
ˆ‰Š‹Œ‘“”•–˜™š›ž  âäàáãåçñ¢.<(+|&éêëèíîïìß!$*);¬-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'="Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®^£¥·©§¶¼½¾[]¯¨´×{ABCDEFGHI­ôöòóõ}JKLMNOPQR¹ûüùúÿ\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙڟ)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/iso8859_14.cpython-38.opt-1.pyc000064400000004621151153537620015763 0ustar00U

e5dT5�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zl Python Character Mapping Codec iso8859_14 generated from 'MAPPINGS/ISO8859/8859-14.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�,/usr/lib64/python3.8/encodings/iso8859_14.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz
iso8859-14)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/zlib_codec.cpython-38.opt-2.pyc000064400000005447151153537620016434 0ustar00U

e5d��@s�ddlZddlZddd�Zddd�ZGdd�dej�ZGd	d
�d
ej�ZGdd�dej�ZGd
d�deej�ZGdd�deej�Zdd�Z	dS)�N�strictcCst�|�t|�fS�N)�zlib�compress�len��input�errors�r
�,/usr/lib64/python3.8/encodings/zlib_codec.py�zlib_encode
srcCst�|�t|�fSr)r�
decompressrrr
r
r�zlib_decodesrc@s eZdZddd�Zddd�ZdS)	�CodecrcCs
t||�Sr)r��selfrr	r
r
r�encodeszCodec.encodecCs
t||�Sr)rrr
r
r�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrr
r
r
rrs
rc@s(eZdZd
dd�Zddd�Zdd�Zd	S)�IncrementalEncoderrcCs||_t��|_dSr)r	r�compressobj�rr	r
r
r�__init__szIncrementalEncoder.__init__FcCs.|r|j�|�}||j��S|j�|�SdSr)rr�flush�rr�final�cr
r
rr!szIncrementalEncoder.encodecCst��|_dSr)rr�rr
r
r�reset(szIncrementalEncoder.resetN)r)F)rrrrrr r
r
r
rrs

rc@s(eZdZd
dd�Zddd�Zdd�Zd	S)�IncrementalDecoderrcCs||_t��|_dSr)r	r�
decompressobjrr
r
rr,szIncrementalDecoder.__init__FcCs.|r|j�|�}||j��S|j�|�SdSr)r"r
rrr
r
rr1szIncrementalDecoder.decodecCst��|_dSr)rr"rr
r
rr 8szIncrementalDecoder.resetN)r)F)rrrrrr r
r
r
rr!+s

r!c@seZdZeZdS)�StreamWriterN�rrr�bytes�charbuffertyper
r
r
rr#;sr#c@seZdZeZdS)�StreamReaderNr$r
r
r
rr'>sr'c
Cstjdttttttdd�S)NrF)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter�_is_text_encoding)�codecs�	CodecInforrrr!r'r#r
r
r
r�getregentryCs�r0)r)r)
r.rrrrrr!r#r'r0r
r
r
r�<module>s

encodings/__pycache__/cp1125.cpython-38.opt-2.pyc000064400000017604151153537620015250 0ustar00U

e5d%��@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�Ze�ed��Z	e	�
dddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d �d!�d"�d#�d$�d%�d&�d'�d(�d)�d*�d+�d,�d-�d.�d/�d0�d1�d2�d3�d4�d5�d6d��d7�d8�d9d��d:�d;�d<�d=�d>�d?�d@�dA�dB�dC�dD�dE�dF�dG�dH�dI�dJ�dK�dL�dM�dN�dO�dP�dQ�dR�dS�dT�dU�dV�dW�dX�dY�dZ�d[�d\�d]�d^�d_�d`�da�db�dc�dd�de�df�dg�dh�di�dj�dk�dl�dmd��dn�do�dp�dq�dr�ds�dt�du�dv�dw�dx�dy�dz�d{�d|�d}�d~�d�d��d��d��d��d��d��d��d��d��d��d��d��d��d���ZdS(��Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1125.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1125)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$������������������ �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�%�%�%�%�$%�a%�b%�V%�U%�c%�Q%�W%�]%�\%�[%�%�%�4%�,%�%�%�<%�^%�_%�Z%�T%�i%�f%�`%�P%�l%�g%�h%�d%�e%�Y%�X%�R%�S%�k%�j%�%�%�%�%�%�%�%�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O��Q����T��V��W��"�!��%�)���������������������������������r����r�������������������r����������������������������������������������������������������������������������������������������������������������������u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r"r rrrrrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrr	r
rrr
rrrrrrrrrrrrrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r�rrr�r�r�r!(rr#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwrxryrzr{r|r}r~rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rjrYr�rerfrrirZrhrgrkrsr`r{r|ror^r]rarzryrnrdrcrbrlrmrrr[r\r_rwrxrqrurvrpr~r}rtr�r�r�r�r�rVrWrXr�)
rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s"
����encodings/__pycache__/iso8859_14.cpython-38.pyc000064400000004621151153537620015024 0ustar00U

e5dT5�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zl Python Character Mapping Codec iso8859_14 generated from 'MAPPINGS/ISO8859/8859-14.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�,/usr/lib64/python3.8/encodings/iso8859_14.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz
iso8859-14)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/iso8859_11.cpython-38.pyc000064400000004732151153537620015024 0ustar00U

e5d/0�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zl Python Character Mapping Codec iso8859_11 generated from 'MAPPINGS/ISO8859/8859-11.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�,/usr/lib64/python3.8/encodings/iso8859_11.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz
iso8859-11)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู￾￾￾￾฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛￾￾￾￾)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp858.cpython-38.opt-1.pyc000064400000016467151153537620015211 0ustar00U

e5d߄�@sdZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�dd(d�d;�ddhd�d}dtd'd�dmd9d6d`dHdd+d4d|ddd!d#d3d�d&d�d~d:d>d2d�d�dvd�d�d�d�d�ddr�ddsdpdxd)d.d-d5dNdVddd�d�d�dddd�dd1dd0�dd��dd"�d�d�d�d �d!�d"�d#�d$�d%d=�d&�d'dad_�d(dM�d)d�d*d$�d+�d,d,�d-�d.dd�d/du�d0d%dd�dyd8dGd{dWddFdEddfd7d d?ddd<dnd�dcdbdgdqd*dzd�d�d�dw�d1��Z
dS(2zA Python Character Mapping Codec for CP858, modified from cp850.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp858.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp858)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$�������������������������������������������������������������������������������%�%�%�%�$%������c%�Q%�W%�]%���%�%�4%�,%�%�%�<%�����Z%�T%�i%�f%�`%�P%�l%������������ �������%�%�%�%����%����������������������������� ������������%�)���������������������������������r�rSrcrBrurdr�r�r�r^rLrTrPr�rOr�r�r�r�r�r�r�r�r�r�r�rMrUrRrQr�rNr]r[r\rmr4r5r8r&rzr6rxryr�r|r}r~rwrKr�r�r�r�r?rDrCr�r�r�r@r�r�r�r+rFr)rlr*r,r7r-r0r(r.r/r3rGr2r1rvrJr;rHr9r�r:r�rAr=rIr<r'r�r�r>u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�(rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDr�rSrcrBrurdr�r�r�r^rLrTrPr�rOr�r�r�r�r�r�r�r�r�r�r�rMrUrRrQr�rNr]r[r\rmr4r5r8r&rzr6rxryr�r|r}r~rwrKr�r�r�r�r?rDrCr�r�r�r@r�r�r�r+rFr)rlr*r,r7r-r0r(r.r/r3rGr2r1rvrJr;rHr9r�r:r�rAr=rIr<r'r�r�r>r{rEr�rjrYr�rerfrrirZrhrgrkrsr`rorarnrbrrr_rqrprtr�r�r�rVrWrXr�)�__doc__rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s$
����encodings/__pycache__/utf_32_le.cpython-38.opt-2.pyc000064400000002736151153537620016117 0ustar00U

e5d��@slddlZejZddd�ZGdd�dej�ZGdd�dej�ZGd	d
�d
ej�ZGdd�dej�Zd
d�Z	dS)�N�strictcCst�||d�S)NT)�codecs�utf_32_le_decode)�input�errors�r�+/usr/lib64/python3.8/encodings/utf_32_le.py�decode
sr	c@seZdZddd�ZdS)�IncrementalEncoderFcCst�||j�dS)Nr)r�utf_32_le_encoder)�selfr�finalrrr�encodeszIncrementalEncoder.encodeN)F)�__name__�
__module__�__qualname__rrrrrr

sr
c@seZdZejZdS)�IncrementalDecoderN)rrrrr�_buffer_decoderrrrrsrc@seZdZejZdS)�StreamWriterN)rrrrrrrrrrrsrc@seZdZejZdS)�StreamReaderN)rrrrrr	rrrrrsrc	Cstjdttttttd�S)Nz	utf-32-le)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)r�	CodecInforr	r
rrrrrrr�getregentrys�r)r)
rrrr	r
�BufferedIncrementalDecoderrrrrrrrr�<module>s
encodings/__pycache__/utf_8_sig.cpython-38.opt-2.pyc000064400000010226151153537620016215 0ustar00U

e5d%�@spddlZddd�Zddd�ZGdd�dej�ZGd	d
�d
ej�ZGdd�dej�ZGd
d�dej�Zdd�ZdS)�N�strictcCstjt�||�dt|�fS�Nr)�codecs�BOM_UTF8�utf_8_encode�len)�input�errors�r
�+/usr/lib64/python3.8/encodings/utf_8_sig.py�encodes�rcCsDd}|dd�tjkr&|dd�}d}t�||d�\}}|||fS)Nr�T)rr�utf_8_decode)rr	�prefix�output�consumedr
r
r�decodesrc@s8eZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
S)�IncrementalEncoderrcCstj�||�d|_dS�N�)rr�__init__�first��selfr	r
r
rrszIncrementalEncoder.__init__FcCs:|jr$d|_tjt�||j�dSt�||j�dSdSr)rrrrr	)rr�finalr
r
rrs�zIncrementalEncoder.encodecCstj�|�d|_dSr)rr�resetr�rr
r
rr'szIncrementalEncoder.resetcCs|jS�N�rrr
r
r�getstate+szIncrementalEncoder.getstatecCs
||_dSrr�r�stater
r
r�setstate.szIncrementalEncoder.setstateN)r)F)�__name__�
__module__�__qualname__rrrrr"r
r
r
rrs


rc@s6eZdZd
dd�Zdd�Zdd�Zdd	�Zd
d�ZdS)�IncrementalDecoderrcCstj�||�d|_dSr)r�BufferedIncrementalDecoderrrrr
r
rr2szIncrementalDecoder.__init__cCsv|jrht|�dkr*tj�|�r"dSd|_n>d|_|dd�tjkrht�|dd�||�\}}||dfSt�|||�S)Nr
��rr)rrrr�
startswithr)rrr	rrrr
r
r�_buffer_decode6s�z!IncrementalDecoder._buffer_decodecCstj�|�d|_dSr)rr'rrrr
r
rrGszIncrementalDecoder.resetcCstj�|�}|d|jfSr)rr'rrr r
r
rrKszIncrementalDecoder.getstatecCstj�||�|d|_dSr)rr'r"rr r
r
rr"PszIncrementalDecoder.setstateN)r)r#r$r%rr+rrr"r
r
r
rr&1s

r&c@seZdZdd�Zddd�ZdS)�StreamWritercCs.tj�|�z|`Wntk
r(YnXdSr)rr,rr�AttributeErrorrr
r
rrVs
zStreamWriter.resetrcCstj|_t||�Sr)rrr)rrr	r
r
rr]szStreamWriter.encodeN)r)r#r$r%rrr
r
r
rr,Usr,c@seZdZdd�Zddd�ZdS)�StreamReadercCs.tj�|�z|`Wntk
r(YnXdSr)rr.rrr-rr
r
rrbs
zStreamReader.resetrcCspt|�dkrtj�|�r\dSn>|dd�tjkr\tj|_t�|dd�|�\}}||dfStj|_t�||�S)Nr
r()rrrr*rr)rrr	rrr
r
rriszStreamReader.decodeN)r)r#r$r%rrr
r
r
rr.asr.c	Cstjdttttttd�S)Nz	utf-8-sig)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)r�	CodecInforrrr&r.r,r
r
r
r�getregentryys�r5)r)r)	rrrrr'r&r,r.r5r
r
r
r�<module>
s

$encodings/__pycache__/koi8_u.cpython-38.pyc000064400000004635151153537620014573 0ustar00U

e5d�5�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zf Python Character Mapping Codec koi8_u generated from 'python-mappings/KOI8-U.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/koi8_u.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nzkoi8-u)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/ptcp154.cpython-38.opt-1.pyc000064400000004761151153537620015534 0ustar00U

e5d�6�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)z� Python Character Mapping Codec generated from 'PTCP154.txt' with gencodec.py.

Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
(c) Copyright 2000 Guido van Rossum.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�)/usr/lib64/python3.8/encodings/ptcp154.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
rs
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
r!src	Cs tjdt�jt�jttttd�S)N�ptcp154)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry&s�r$u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s	�encodings/__pycache__/cp861.cpython-38.pyc000064400000017242151153537620014234 0ustar00U

e5dI��@sVdZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�dd+�dd(d!d3�dd:d>�d�d�d�d�d�d�d�d�d �d!�d"�d#�d$�d%�d&�d'd0�d(d��d)�d*�d+�d,�d-�d.�d/�d0�d1d=�d2�d3�d4�d5d$�d6d,�d7�d8�d9�d:�d;ddddddd�d<�d=ddd1d�d>�d?d&�d@�dAd�dd2�dB�dCd#�dDd�dEd7d8�dF�dG�dH�dI�dJd4dd5�dK�dLd)d �dMd�d?�dNd6�dO�dPd;d<d"d�dQdv�dR�dS�dT�dU�dV�dWd�dXd-�dY�dZdqd*�d[d'dd�d�d�d%�d\��Z
dS(]z` Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP861.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp861.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp861)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$������������������������������������������������������� �����������������#�������%�%�%�%�$%�a%�b%�V%�U%�c%�Q%�W%�]%�\%�[%�%�%�4%�,%�%�%�<%�^%�_%�Z%�T%�i%�f%�`%�P%�l%�g%�h%�d%�e%�Y%�X%�R%�S%�k%�j%�%�%�%�%�%�%�%����������������"����)"�a"��e"�d"� #�!#��H"��"��"� ��%�)���������������������������������r�rS�rB�������rTrP���r�r�r���r��r����rUrRrQ�rN�rJ����r4r5r8r&��r6������rK����r1����rL����r?��rC��rM��r@r=r3r�r+rFr)��r*r,r7r-r0r(r.r/��rG����r2����rHr9�r:r�rA�rIr<r'r>r;�u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�(rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnror�rSrBrTrPr�r�r�r�r�rUrRrQrNrJr4r5r8r&r6rKr1rLr?rCrMr@r=r3r�r+rFr)r*r,r7r-r0r(r.r/rGr2rHr9r:r�rArIr<r'r>r;rEr�r�r�r�r�r�r�r�r�r�r�r�r�rDr�r�r�r�r�r�r�r�rOr�r�rjrYr�rerfrrirZrhrgrkrsr`r{r|ror^r]rarzryrnrdrcrbrlrmrrr[r\r_rwrxrqrurvrpr~r}rtr�r�r�r�r�rVrWrXr�)�__doc__rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s$
����encodings/__pycache__/iso2022_jp_2004.cpython-38.opt-1.pyc000064400000002636151153537620016571 0ustar00U

e5d1�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�iso2022_jp_2004c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�1/usr/lib64/python3.8/encodings/iso2022_jp_2004.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z_codecs_iso2022rZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/cp1250.cpython-38.opt-1.pyc000064400000004623151153537620015243 0ustar00U

e5dv5�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zv Python Character Mapping Codec cp1250 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1250.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1250.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1250)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€￾‚￾„…†‡￾‰Š‹ŚŤŽŹ￾‘’“”•–—￾™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/utf_7.cpython-38.opt-2.pyc000064400000002716151153537620015357 0ustar00U

e5d��@slddlZejZddd�ZGdd�dej�ZGdd�dej�ZGd	d
�d
ej�ZGdd�dej�Zd
d�Z	dS)�N�strictcCst�||d�S)NT)�codecs�utf_7_decode)�input�errors�r�'/usr/lib64/python3.8/encodings/utf_7.py�decodesr	c@seZdZddd�ZdS)�IncrementalEncoderFcCst�||j�dS)Nr)r�utf_7_encoder)�selfr�finalrrr�encodeszIncrementalEncoder.encodeN)F)�__name__�
__module__�__qualname__rrrrrr
sr
c@seZdZejZdS)�IncrementalDecoderN)rrrrr�_buffer_decoderrrrrsrc@seZdZejZdS)�StreamWriterN)rrrrrrrrrrrsrc@seZdZejZdS)�StreamReaderN)rrrrrr	rrrrrsrc	Cstjdttttttd�S)Nzutf-7)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)r�	CodecInforr	r
rrrrrrr�getregentrys�r)r)
rrrr	r
�BufferedIncrementalDecoderrrrrrrrr�<module>s
encodings/__pycache__/cp720.cpython-38.opt-1.pyc000064400000004731151153537620015164 0ustar00U

e5dv5�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)z�Python Character Mapping Codec cp720 generated on Windows:
Vista 6.0.6002 SP2 Multiprocessor Free with the command:
  python Tools/unicode/genwincodec.py 720
�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp720.py�encode
szCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
rs
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)NZcp720)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry#s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€éâ„à†çêëèïّْô¤ـûùءآأؤ£إئابةتثجحخدذرزسشص«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ضطظعغفµقكلمنهوىي≡ًٌٍَُِ≈°∙·√ⁿ²■ )�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp437.cpython-38.opt-2.pyc000064400000017057151153537620015177 0ustar00U

e5d��@sPddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�Ze�ed��Z	e	�
dddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�dd'�d�d�d�d�d�dd5�dd3�dd d2�d�dd9d=�d�d�d�d�d�dd,�d �d!d/�d"d��d#�d$�d%�d&�d'�d(�d)�d*�d+�d,d<�d-�d.�d/�d0d*�d1�d2d#�d3d+�d4�d5�d6�d7dddddddd�d8ddd0d�d9d&d%ddd��d:d1d$�d;d"�d<d�d=�d>d7�d?�d@�dA�dB�dC�dDd�dEd6�dFd(d�dGd�d>�dH�dI�dJ�dKd:d;d!d�dLdu�dM�dNd4�dO�dP�dQ�dR�dS�dT�dU�dVdpd)�dW�dX�dYd�d�d��dZ�d[��ZdS(\�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp437.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp437)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$������������������������������������������������������ ����������������#�������%�%�%�%�$%�a%�b%�V%�U%�c%�Q%�W%�]%�\%�[%�%�%�4%�,%�%�%�<%�^%�_%�Z%�T%�i%�f%�`%�P%�l%�g%�h%�d%�e%�Y%�X%�R%�S%�k%�j%�%�%�%�%�%�%�%����������������"����)"�a"��e"�d"� #�!#��H"��"��"� ��%�)���������������������������������r�rSrArB�rC����rLrTrP���r�r�r���r��r���rMrUrRrQ�rN������r4r5r8r&��r6��������������rK��������r?����������r@����r�r+rFr)��r*r,r7r-r0r(r.r/r3rGr2r1��rJr;rHr9�r:r��r=rIr<r'��r>u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�(rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnror�rSrArBrCrLrTrPr�r�r�r�r�rMrUrRrQrNr4r5r8r&r6rKr?r@r�r+rFr)r*r,r7r-r0r(r.r/r3rGr2r1rJr;rHr9r:r�r=rIr<r'r>rEr�r�r�r�r�r�r�r�r�r�r�r�r�rDr�r�r�r�r�r�r�r�rOr�r�rjrYr�rerfrrirZrhrgrkrsr`r{r|ror^r]rarzryrnrdrcrbrlrmrrr[r\r_rwrxrqrurvrpr~r}rtr�r�r�r�r�rVrWrXr�)
rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s"
����encodings/__pycache__/undefined.cpython-38.opt-2.pyc000064400000003350151153537620016267 0ustar00U

e5d�@srddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCstd��dS�Nzundefined encoding��UnicodeError��self�input�errors�r�+/usr/lib64/python3.8/encodings/undefined.py�encodeszCodec.encodecCstd��dSrrrrrr�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__r
rrrrrrs
rc@seZdZddd�ZdS)�IncrementalEncoderFcCstd��dSrr�rr	�finalrrrr
szIncrementalEncoder.encodeN)F)rrrr
rrrrrsrc@seZdZddd�ZdS)�IncrementalDecoderFcCstd��dSrrrrrrrszIncrementalDecoder.decodeN)F)rrrrrrrrrsrc@seZdZdS)�StreamWriterN�rrrrrrrr src@seZdZdS)�StreamReaderNrrrrrr#src	Cs tjdt�jt�jttttd�S)NZ	undefined)�namer
r�incrementalencoder�incrementaldecoder�streamwriter�streamreader)	�codecs�	CodecInforr
rrrrrrrrr�getregentry(s�r )rrrrrrr rrrr�<module>sencodings/__pycache__/iso2022_jp_2004.cpython-38.pyc000064400000002636151153537620015632 0ustar00U

e5d1�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�iso2022_jp_2004c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�1/usr/lib64/python3.8/encodings/iso2022_jp_2004.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z_codecs_iso2022rZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/cp1251.cpython-38.opt-1.pyc000064400000004620151153537620015241 0ustar00U

e5d14�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zv Python Character Mapping Codec cp1251 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1251.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1251.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1251)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—￾™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/unicode_escape.cpython-38.pyc000064400000003320151153537620016331 0ustar00U

e5d��@svdZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdS)z� Python 'unicode-escape' Codec


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

�Nc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codecs�unicode_escape_encode�encode�unicode_escape_decode�decode�rr�0/usr/lib64/python3.8/encodings/unicode_escape.pyr
src@seZdZddd�ZdS)�IncrementalEncoderFcCst�||j�dS�Nr)rr�errors��self�input�finalrrrrszIncrementalEncoder.encodeN)F)rrrrrrrrr
sr
c@seZdZddd�ZdS)�IncrementalDecoderFcCst�||j�dSr)rr	rrrrrr
szIncrementalDecoder.decodeN)F)rrrr
rrrrrsrc@seZdZdS)�StreamWriterN�rrrrrrrrsrc@seZdZdS)�StreamReaderNrrrrrrsrc	Cstjdtjtjttttd�S)Nzunicode-escape)�namerr
�incrementalencoder�incrementaldecoder�streamwriter�streamreader)	r�	CodecInforrr
r
rrrrrrr�getregentry$s�r)�__doc__rrr
rrrrrrrr�<module>sencodings/__pycache__/cp737.cpython-38.opt-2.pyc000064400000017561151153537620015202 0ustar00U

e5dy��@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�Ze�ed��Z	e	�
dddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d �d!�d"�d#�d$�d%�d&�d'�d(�d)�d*�d+�d,�d-�d.�d/�d0�d1�d2�d3�d4�d5�d6�d7�d8�d9�d:�d;�d<�d=�d>�d?�d@�dA�dBd��dC�dD�dE�dF�dG�dH�dI�dJ�dK�dL�dM�dN�dO�dP�dQ�dR�dS�dT�dU�dV�dW�dX�dY�dZd��d[�d\�d]�d^�d_�d`�da�db�dc�dd�de�df�dg�dh�di�dj�dk�dl�dmd��dn�do�dp�dq�dr�ds�dt�du�dv�dw�dx�dy�dz�d{�d|�d}�d~�d�d��d��d��d��d��d��d��d��d�d�d�d��d��d���ZdS(��Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp737.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)NZcp737)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#���������������������������������������������������������%�%�%�%�$%�a%�b%�V%�U%�c%�Q%�W%�]%�\%�[%�%�%�4%�,%�%�%�<%�^%�_%�Z%�T%�i%�f%�`%�P%�l%�g%�h%�d%�e%�Y%�X%�R%�S%�k%�j%�%�%�%�%�%�%�%�������������������������e"�d"����H"��"��"� ��%�)���������������������������������r����������������r�r�r�����r�������������������������������������������������������������������������������������������������������������������r���������u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�rrrrrrr
rrr
rrrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrr	rrrrrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r(rrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwrxryrzr{r|r}r~rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r�r�r�r�r�r�r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrOrNrPrQrRrSrTr�r�r�r�r�r�r�r�r�r�r�r�rirXrrdrer~rhrYrgrfrjrrr_rzr{rnr]r\r`ryrxrmrcrbrarkrlrqrZr[r^rvrwrprtruror}r|rsr�r�r�r�r�rUrVrWr�)
rrrrrrr#�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s"
����encodings/__pycache__/shift_jis.cpython-38.opt-2.pyc000064400000002615151153537620016313 0ustar00U

e5d�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�	shift_jisc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�+/usr/lib64/python3.8/encodings/shift_jis.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_jprZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/cp775.cpython-38.opt-2.pyc000064400000017115151153537620015177 0ustar00U

e5d���@s`ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�Ze�ed��Z	e	�
dddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.dd/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�dd�dr�dd7�d�dd6d*�d�ddd �d�d�d�dd8d<d0�d�d�d�d�d d�d!�d"�d#�d$�d%�d&�d'�d(�d)d%d�d*d#�d+�d,d��d-dt�d.�d/�d0d��d1�d2�d3�d4dnd��d5�d6�d7�d8�d9d9�d:�d;d�d<�d=d~�d>�d?�d@�dA�dB�dC�dD�dE�dF�dG�dHd�ds�dId-d!d(�dJ�dKd+d.�dLd,�dM�dNd5d��dOdd��dP�dQ�dR�dS�dT�dU�dV�dWd�dX�dYdd=�dZd:�d[d��d\�d]�d^dod)�d_�d`�dad�dd��db�dc��ZdS(d�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp775.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp775)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$���������#����B��V�W�+�y�����������M��"��Z�[������������*���{�|�z� �������A���%�%�%�%�$%�����c%�Q%�W%�]%�.�`�%�%�4%�,%�%�%�<%�r�j�Z%�T%�i%�f%�`%�P%�l%�}��
���/�a�s�k�~�%�%�%�%�%�%�%�����L�C�����D�6�7�;�<�F��E� ��� ����� ��"�����%�)���������������������������������r��r<rBrE�rLr��rM�rSrOr�rN�r�r�r�r��r�r�r��r��rTrQrPr��������r4r5r8����r6������������������r���r�r?rDrC������r@����r���������r*r,r7����r(������������������rG��r�r:r�rA���r'���u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£Ø×¤ĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�(rr�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwr�r<rBrErLr�rMrSrOr�rNr�r�r�r�r�r�r�r�rTrQrPr�r4r5r8r6r�r�r?rDrCr@r�r*r,r7r(rGr�r:r�rAr'r%r)rZrur&r-r[rvr�r/r]rxr\rwr;r+rFr2rbryr�r�r�r�rRr.r�r�r�r�r�r9r0r1r=r>rcrzrlr|rkr{r3rJrHrIrtr}r�r�rKr�r�rirXrrdrer~rhrYrgrfrjrrr_rnr`rmrarqr^rprorsr�r�r�r�r�rUrVrWr�)
rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s"����encodings/__pycache__/cp273.cpython-38.opt-1.pyc000064400000004552151153537620015170 0ustar00U

e5d47�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zd Python Character Mapping Codec cp273 generated from 'python-mappings/CP273.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp273.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp273)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�œ	†—Ž
…‡’€‚ƒ„
ˆ‰Š‹Œ‘“”•–˜™š›ž  â{àáãåçñÄ.<(+!&éêëèíîïì~Ü$*);^-/Â[ÀÁÃÅÇÑö,%_>?øÉÊËÈÍÎÏÌ`:#§'="Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µßstuvwxyz¡¿ÐÝÞ®¢£¥·©@¶¼½¾¬|‾¨´×äABCDEFGHI­ô¦òóõüJKLMNOPQR¹û}ùúÿÖ÷STUVWXYZ²Ô\ÒÓÕ0123456789³Û]Ùڟ)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/raw_unicode_escape.cpython-38.pyc000064400000003344151153537620017210 0ustar00U

e5d��@svdZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdS)z� Python 'raw-unicode-escape' Codec


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

�Nc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codecs�raw_unicode_escape_encode�encode�raw_unicode_escape_decode�decode�rr�4/usr/lib64/python3.8/encodings/raw_unicode_escape.pyr
src@seZdZddd�ZdS)�IncrementalEncoderFcCst�||j�dS�Nr)rr�errors��self�input�finalrrrrszIncrementalEncoder.encodeN)F)rrrrrrrrr
sr
c@seZdZddd�ZdS)�IncrementalDecoderFcCst�||j�dSr)rr	rrrrrr
szIncrementalDecoder.decodeN)F)rrrr
rrrrrsrc@seZdZdS)�StreamWriterN�rrrrrrrrsrc@seZdZdS)�StreamReaderNrrrrrrsrc	Cstjdtjtjttttd�S)Nzraw-unicode-escape)�namerr
�incrementalencoder�incrementaldecoder�streamwriter�streamreader)	r�	CodecInforrr
r
rrrrrrr�getregentry$s�r)�__doc__rrr
rrrrrrrr�<module>sencodings/__pycache__/tis_620.cpython-38.pyc000064400000004721151153537620014557 0ustar00U

e5d0�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zh Python Character Mapping Codec tis_620 generated from 'python-mappings/TIS-620.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�)/usr/lib64/python3.8/encodings/tis_620.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nztis-620)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ￾กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู￾￾￾￾฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛￾￾￾￾)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/utf_8.cpython-38.pyc000064400000003140151153537620014410 0ustar00U

e5d��@spdZddlZejZddd�ZGdd�dej�ZGdd	�d	ej�ZGd
d�dej�ZGdd
�d
ej	�Z	dd�Z
dS)z� Python 'utf-8' Codec


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

�N�strictcCst�||d�S)NT)�codecs�utf_8_decode)�input�errors�r�'/usr/lib64/python3.8/encodings/utf_8.py�decodesr	c@seZdZddd�ZdS)�IncrementalEncoderFcCst�||j�dS)Nr)r�utf_8_encoder)�selfr�finalrrr�encodeszIncrementalEncoder.encodeN)F)�__name__�
__module__�__qualname__rrrrrr
sr
c@seZdZejZdS)�IncrementalDecoderN)rrrrr�_buffer_decoderrrrrsrc@seZdZejZdS)�StreamWriterN)rrrrrrrrrrrsrc@seZdZejZdS)�StreamReaderN)rrrrrr	rrrrrsrc	Cstjdttttttd�S)Nzutf-8)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)r�	CodecInforr	r
rrrrrrr�getregentry!s�r)r)�__doc__rrrr	r
�BufferedIncrementalDecoderrrrrrrrr�<module>s
encodings/__pycache__/__init__.cpython-38.opt-2.pyc000064400000004622151153537620016070 0ustar00U

e5d��@s|ddlZddlZddlmZiZdZdgZejZGdd�dee	�Z
dd	�Zd
d�Ze�
e�ejdkrxd
d�Ze�
e�dS)�N�)�aliasesz--unknown--�*c@seZdZdS)�CodecRegistryErrorN)�__name__�
__module__�__qualname__�r	r	�*/usr/lib64/python3.8/encodings/__init__.pyr(srcCsft|t�rt|d�}g}d}|D]:}|��s4|dkrV|rF|rF|�d�|�|�d}q d}q d�|�S)N�asciiF�.�_T�)�
isinstance�bytes�str�isalnum�append�join)�encoding�chars�punct�cr	r	r
�normalize_encoding+s



rc
	Csvt�|t�}|tk	r|St|�}t�|�p:t�|�dd��}|dk	rN||g}n|g}|D]B}|rXd|krjqXztd|tdd�}Wntk
r�YqXXq�qXd}z
|j	}Wnt
k
r�d}YnX|dkr�dt|<dS|�}t|tj
��s(dt|�k�rdk�sntd|j|jf��t|d��r�t|d	��r�|d
dk	�rVt|d
��r�|ddk	�rrt|d��r�t|�dk�r�|ddk	�r�t|d��r�t|�dk�r�|ddk	�r�t|d��s�td
|j|jf��t|�dk�s�|ddk�r|ddt|�|j�dd	�d	f7}tj
|�}|t|<z|��}Wnt
k
�rRYn X|D]}	|	tk�rX|t|	<�qX|S)Nrr
z
encodings.r)�fromlist�level��z#module "%s" (%s) failed to registerr���z'incompatible codecs in module "%s" (%s)�)N)�_cache�get�_unknownr�_aliases�replace�
__import__�_import_tail�ImportError�getregentry�AttributeErrorr�codecs�	CodecInfo�lenrr�__file__�callable�split�
getaliases)
r�entry�
norm_encoding�aliased_encoding�modnames�modname�modr*�codecaliases�aliasr	r	r
�search_functionFs�	
��
�



�
�
�
�
�
�
�
�
�
�
�
�(

r;Zwin32cCsNz4ddl}d|��}||kr2ddl}|j��WSWntk
rHYnXdS)Nrzcp%s)�_winapiZGetACPZencodings.mbcs�mbcsr*r))rr<Zansi_code_pageZ	encodingsr	r	r
�_alias_mbcs�sr>)r,�sysrrr"r$r(r%�LookupError�SystemErrorrrr;�register�platformr>r	r	r	r
�<module>sU

encodings/__pycache__/cp863.cpython-38.pyc000064400000017242151153537620014236 0ustar00U

e5d̅�@sVdZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�dd��dd(�d�dd�d�d�dd0�d�d�dd3�dd7d:d>�d�d �d!�d"�d#�d$�d%�d&d4�d'�d(�d)�d*�d+�d,�d-�d.�d/�d0�d1�d2�d3�d4�d5d+�d6�d7�d8d,�d9�d:�d;dd�d<ddddd�d=�d>d�d?�d@dd'd&�dAdd��dBd2�dC�dDd#�dE�dFd6�dG�dHdd-�dId1d�dJ�dK�dL�dM�dN�dOd d5d�d?d)�dPd!d=d;d<�dQd�dRdvd�dS�dT�dUd$d%�dVd"�dW�dXd8dqd*d.�dY�dZd�d�d��d[�d\��Z
dS(]z` Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP863.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp863.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp863)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$�������������������������� ����������������������������������������#�������%�%�%�%�$%�a%�b%�V%�U%�c%�Q%�W%�]%�\%�[%�%�%�4%�,%�%�%�<%�^%�_%�Z%�T%�i%�f%�`%�P%�l%�g%�h%�d%�e%�Y%�X%�R%�S%�k%�j%�%�%�%�%�%�%�%����������������"����)"�a"��e"�d"� #�!#��H"��"��"� ��%�)���������������������������������r��rArBr>�rFr5rJ��rTrP��rMr�r�r�rLrGr�r,r�rK��rUrRrQrS�r4�r*��������r&r7r6r8r:����rNr;��������r?��������rC��rDr@����r�r+��r)��������r-r0r(r.r/����r2r1������rHr9��r��r=rIr<r'���u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�(rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnror�rArBr>rFr5rJrTrPrMr�r�r�rLrGr�r,r�rKrUrRrQrSr4r*r&r7r6r8r:rNr;r?rCrDr@r�r+r)r-r0r(r.r/r2r1rHr9r�r=rIr<r'rEr�r�r�r�r�r�r�r�r�r�r�r�r3r�r�r�r�r�r�r�r�r�rOr�r�rjrYr�rerfrrirZrhrgrkrsr`r{r|ror^r]rarzryrnrdrcrbrlrmrrr[r\r_rwrxrqrurvrpr~r}rtr�r�r�r�r�rVrWrXr�)�__doc__rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s$
����encodings/__pycache__/cp1253.cpython-38.pyc000064400000004640151153537620014306 0ustar00U

e5d&3�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zv Python Character Mapping Codec cp1253 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1253.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1253.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1253)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€￾‚ƒ„…†‡￾‰￾‹￾￾￾￾￾‘’“”•–—￾™￾›￾￾￾￾ ΅Ά£¤¥¦§¨©￾«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ￾ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ￾)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp861.cpython-38.opt-1.pyc000064400000017242151153537620015173 0ustar00U

e5dI��@sVdZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�dd+�dd(d!d3�dd:d>�d�d�d�d�d�d�d�d�d �d!�d"�d#�d$�d%�d&�d'd0�d(d��d)�d*�d+�d,�d-�d.�d/�d0�d1d=�d2�d3�d4�d5d$�d6d,�d7�d8�d9�d:�d;ddddddd�d<�d=ddd1d�d>�d?d&�d@�dAd�dd2�dB�dCd#�dDd�dEd7d8�dF�dG�dH�dI�dJd4dd5�dK�dLd)d �dMd�d?�dNd6�dO�dPd;d<d"d�dQdv�dR�dS�dT�dU�dV�dWd�dXd-�dY�dZdqd*�d[d'dd�d�d�d%�d\��Z
dS(]z` Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP861.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp861.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp861)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$������������������������������������������������������� �����������������#�������%�%�%�%�$%�a%�b%�V%�U%�c%�Q%�W%�]%�\%�[%�%�%�4%�,%�%�%�<%�^%�_%�Z%�T%�i%�f%�`%�P%�l%�g%�h%�d%�e%�Y%�X%�R%�S%�k%�j%�%�%�%�%�%�%�%����������������"����)"�a"��e"�d"� #�!#��H"��"��"� ��%�)���������������������������������r�rS�rB�������rTrP���r�r�r���r��r����rUrRrQ�rN�rJ����r4r5r8r&��r6������rK����r1����rL����r?��rC��rM��r@r=r3r�r+rFr)��r*r,r7r-r0r(r.r/��rG����r2����rHr9�r:r�rA�rIr<r'r>r;�u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�(rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnror�rSrBrTrPr�r�r�r�r�rUrRrQrNrJr4r5r8r&r6rKr1rLr?rCrMr@r=r3r�r+rFr)r*r,r7r-r0r(r.r/rGr2rHr9r:r�rArIr<r'r>r;rEr�r�r�r�r�r�r�r�r�r�r�r�r�rDr�r�r�r�r�r�r�r�rOr�r�rjrYr�rerfrrirZrhrgrkrsr`r{r|ror^r]rarzryrnrdrcrbrlrmrrr[r\r_rwrxrqrurvrpr~r}rtr�r�r�r�r�rVrWrXr�)�__doc__rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s$
����encodings/__pycache__/cp865.cpython-38.opt-1.pyc000064400000017242151153537620015177 0ustar00U

e5d:��@sVdZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�dd(�d�d�d�d�dd6d+d4�dd!d3�dd:d>�d�d�d�d�d�d�d�d�d �d!d0�d"d��d#�d$�d%�d&�d'�d(�d)�d*�d+�d,d=�d-�d.d?�d/�d0�d1�d2d$�d3�d4d,�d5�d6�d7�d8dddddddd�d9ddd1d�d:d'd&ddd��d;d2d%�d<d#�d=d�d>�d?d8�d@�dA�dB�dC�dD�dEd�dFd7�dGd)d �dHd��dI�dJ�dK�dL�dMd;d<d"d�dNdv�dO�dPd5�dQ�dR�dS�dT�dUd-�dV�dWdqd*�dX�dY�dZd�d�d��d[�d\��Z
dS(]z` Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP865.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp865.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp865)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$������������������������������������������������������� ����������������#�������%�%�%�%�$%�a%�b%�V%�U%�c%�Q%�W%�]%�\%�[%�%�%�4%�,%�%�%�<%�^%�_%�Z%�T%�i%�f%�`%�P%�l%�g%�h%�d%�e%�Y%�X%�R%�S%�k%�j%�%�%�%�%�%�%�%����������������"����)"�a"��e"�d"� #�!#��H"��"��"� ��%�)���������������������������������r�rS�rBrU�����rLrTrP���r�r�r���r��r���rM�rRrQ�rN������r4r5r8r&��r6��������������rK��������r?��rC������r@����r�r+rFr)��r*r,r7r-r0r(r.r/r3rGr2r1��rJr;rHr9�r:r�rAr=rIr<r'��r>u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�(rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnror�rSrBrUrLrTrPr�r�r�r�r�rMrRrQrNr4r5r8r&r6rKr?rCr@r�r+rFr)r*r,r7r-r0r(r.r/r3rGr2r1rJr;rHr9r:r�rAr=rIr<r'r>rEr�r�r�r�r�r�r�r�r�r�r�r�r�rDr�r�r�r�r�r�r�r�rOr�r�rjrYr�rerfrrirZrhrgrkrsr`r{r|ror^r]rarzryrnrdrcrbrlrmrrr[r\r_rwrxrqrurvrpr~r}rtr�r�r�r�r�rVrWrXr�)�__doc__rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s$
����encodings/__pycache__/punycode.cpython-38.opt-1.pyc000064400000014255151153537620016161 0ustar00U

e5d��@s�dZddlZdd�Zdd�Zdd�Zd	d
�Zdd�Zd
Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZGdd�dej�ZGdd�dej�ZGd d!�d!ej�ZGd"d#�d#eej�ZGd$d%�d%eej�Zd&d'�ZdS)(uY Codec for the Punicode encoding, as specified in RFC 3492

Written by Martin v. Löwis.
�NcCsPt�}t�}|D]*}t|�dkr0|�t|��q|�|�qt|�}t|�|fS)z 3.1 Basic code point segregation�)�	bytearray�set�ord�append�add�sorted�bytes)�str�base�extended�c�r�*/usr/lib64/python3.8/encodings/punycode.py�	segregate
srcCs&d}|D]}t|�|kr|d7}q|S)z@Return the length of str, considering only characters below max.r�)r)r
�max�resr
rrr�
selective_lens

rcCsNt|�}|d7}||krdS||}||kr8|d|fS||kr|d7}qdS)aReturn a pair (index, pos), indicating the next occurrence of
    char in str. index is the position of the character considering
    only ordinals up to and including char, and pos is the position in
    the full string. index/pos is the starting position in the full
    string.r)���rN)�len)r
�char�index�pos�lr
rrr�selective_findsrcCs�d}g}d}|D]r}d}}t|�}t||�}	|	d||}
t||||�\}}|dkrZq~|
||7}
|�|
d�|}d}
q>|}q|S)�3.2 Insertion unsort codingrrrr)rrrr)r
rZoldchar�resultZoldindexr
rrrZcurlen�deltarrr�insertion_unsort0s"
rcCs,d|d|}|dkrdS|dkr(dS|S)N�$r�r)�j�biasrrrr�TFsr$s$abcdefghijklmnopqrstuvwxyz0123456789cCsnt�}d}t||�}||kr2|�t|�t|�S|�t|||d|�||d|}|d7}q
dS)�(3.3 Generalized variable-length integersrr rN)rr$r�digitsr	)�Nr#rr"�trrr�generate_generalized_integerNs
r)cCsX|r|d}n|d}|||7}d}|dkr@|d}|d7}q&|d||d}|S)Ni��ri��#r �&r)r�first�numcharsZ	divisionsr#rrr�adapt[s

r/cCsPt�}d}t|�D]4\}}t||�}|�|�t||dk||d�}qt|�S)z3.4 Bias adaptation�Hrr)r�	enumerater)�extendr/r	)Zbaselen�deltasrr#Zpointsr�srrr�generate_integersjs

r5cCs8t|�\}}t||�}tt|�|�}|r4|d|S|S)N�-)rrr5r)�textrrr3rrr�punycode_encodeus
r8c
Csd}d}d}zt||�}Wn0tk
rL|dkr<td��|ddfYSX|d7}d|krjdkrxnn
|d}nHd|kr�d	kr�nn
|d
}n&|dkr�td||d��n|dfSt||�}	|||7}||	kr�||fS|d|	}|d7}qdS)
r%rr�strictzincomplete punicode stringN�A�Z�0�9�z Invalid extended code point '%s'r )r�
IndexError�UnicodeErrorr$)
r�extposr#�errorsr�wr"r�digitr(rrr�decode_generalized_numbers2


�
rEc	Cs�d}d}d}d}|t|�kr�t||||�\}}|dkr:|S||d7}||t|�d7}|dkr~|dkrvtd	|��td
�}|t|�d}|d|�t|�||d�}t||dkt|��}|}q|S)rrrr0rNri��r9zInvalid character U+%x�?)rrEr@r�chrr/)	rrrBrrr#rAZnewposrrrr�insertion_sort�s,� rHcCs�t|t�r|�d�}t|t�r&t|�}|�d�}|dkrLd}t|d���}n.t|d|�d|�}t||dd�d���}t|||�S)N�asciir6r�r)�
isinstancer
�encode�
memoryviewr	�rfind�upperrH)r7rBrrrrrr�punycode_decode�s



rPc@s eZdZddd�Zddd�ZdS)	�Codecr9cCst|�}|t|�fS�N)r8r��self�inputrBrrrrrL�szCodec.encodecCs*|dkrtd|��t||�}|t|�fS�N)r9�replace�ignorezUnsupported error handling )r@rPrrSrrr�decode�s
zCodec.decodeN)r9)r9)�__name__�
__module__�__qualname__rLrYrrrrrQ�s
rQc@seZdZddd�ZdS)�IncrementalEncoderFcCst|�SrR)r8�rTrU�finalrrrrL�szIncrementalEncoder.encodeN)F)rZr[r\rLrrrrr]�sr]c@seZdZddd�ZdS)�IncrementalDecoderFcCs$|jdkrtd|j��t||j�SrV)rBr@rPr^rrrrY�s
zIncrementalDecoder.decodeN)F)rZr[r\rYrrrrr`�sr`c@seZdZdS)�StreamWriterN�rZr[r\rrrrra�srac@seZdZdS)�StreamReaderNrbrrrrrc�srcc	Cs tjdt�jt�jttttd�S)NZpunycode)�namerLrY�incrementalencoder�incrementaldecoder�streamwriter�streamreader)	�codecs�	CodecInforQrLrYr]r`rarcrrrr�getregentry�s�rk)�__doc__rirrrrr$r&r)r/r5r8rErHrPrQr]r`rarcrkrrrr�<module>s(

encodings/__pycache__/idna.cpython-38.opt-2.pyc000064400000012753151153537620015250 0ustar00U

e5d�#�@s�ddlZddlZddlZddlmZe�d�ZdZdZdd�Z	dd	�Z
d
d�ZGdd
�d
ej�ZGdd�dej
�ZGdd�dej�ZGdd�deej�ZGdd�deej�Zdd�ZdS)�N)�	ucd_3_2_0u[.。.。]sxn--zxn--cCs�g}|D] }t�|�rq|�t�|��qd�|�}t�d|�}|D]j}t�|�s�t�|�s�t�	|�s�t�
|�s�t�|�s�t�|�s�t�
|�s�t�|�s�t�|�rDtd|��qDdd�|D�}t|�r�tdd�|D��r�td��|d	r�|d
s�td��|S)N��NFKCzInvalid character %rcSsg|]}t�|��qS�)�
stringprepZin_table_d1��.0�xrr�&/usr/lib64/python3.8/encodings/idna.py�
<listcomp>)sznameprep.<locals>.<listcomp>css|]}t�|�VqdS)N)rZin_table_d2rrrr
�	<genexpr>1sznameprep.<locals>.<genexpr>zViolation of BIDI requirement 2r���zViolation of BIDI requirement 3)rZin_table_b1�appendZmap_table_b2�join�unicodedata�	normalizeZin_table_c12Zin_table_c22Zin_table_c3Zin_table_c4Zin_table_c5Zin_table_c6Zin_table_c7Zin_table_c8Zin_table_c9�UnicodeError�any)�labelZnewlabel�cZRandALrrr
�nameprepsB


��������	rcCs�z|�d�}Wntk
r"Yn*Xdt|�kr<dkrDnn|Std��t|�}z|�d�}Wntk
rvYn*Xdt|�kr�dkr�nn|Std��|�t�r�td��|�d�}t|}dt|�kr�dkr�nn|Std��dS)N�asciir�@�label empty or too longzLabel starts with ACE prefix�punycode)�encoder�lenr�
startswith�sace_prefix�
ace_prefix)rrrr
�ToASCII<s,

r cCs�t|t�rd}n,z|�d�}d}Wntk
r:d}YnX|stt|�}z|�d�}Wntk
rrtd��YnX|�t�s�t|d�S|tt�d�}|�	d�}t
|�}t|d���t|d�kr�td||��|S)NTrFzInvalid character in IDN labelrzIDNA does not round-trip)�
isinstance�bytesrrrrr�strr�decoder �lower)rZ
pure_asciiZlabel1�resultZlabel2rrr
�	ToUnicodegs*





r'c@s eZdZddd�Zddd�ZdS)	�Codec�strictcCs|dkrtd|��|sdSz|�d�}Wntk
r>YndX|�d�}|dd�D]&}dt|�krrdksVntd	��qVt|d�dkr�td
��|t|�fSt�}t�|�}|r�|ds�d}|d=nd}|D] }|r�|�d�|�t|��q�t	||�t|�fS)Nr)�unsupported error handling ��rr�.r
rrrzlabel too longr,)
rr�UnicodeEncodeError�splitr�	bytearray�dots�extendr r")�self�input�errorsr&�labelsr�trailing_dotrrr
r�s4



zCodec.encodecCs�|dkrtd|��|sdSt|t�s.t|�}t|kr`z|�d�t|�fWStk
r^YnX|�d�}|r�t|d�dkr�d}|d=nd	}g}|D]}|�t	|��q�d�
|�|t|�fS)
Nr)�Unsupported error handling �rrrr-r
r�.r)rr!r"rr$r�UnicodeDecodeErrorr/rr'r)r3r4r5r6r7r&rrrr
r$�s(

zCodec.decodeN)r))r))�__name__�
__module__�__qualname__rr$rrrr
r(�s
%r(c@seZdZdd�ZdS)�IncrementalEncoderc	Cs�|dkrtd|��|sdSt�|�}d}|rT|dsBd}|d=n|sT|d=|rTd}t�}d}|D]4}|r||�d�|d7}|�t|��|t|�7}qb||7}|t|�7}t|�|fS)	Nr)r*r+r,r
r-r�)rr1r/r0r2r rr"�	r3r4r5�finalr6r7r&�sizerrrr
�_buffer_encode�s2

z!IncrementalEncoder._buffer_encodeN)r<r=r>rDrrrr
r?�sr?c@seZdZdd�ZdS)�IncrementalDecoderc	Cs�|dkrtd|��|sdSt|t�r2t�|�}nt|d�}|�d�}d}|rt|dsbd}|d=n|st|d=|rtd}g}d}|D]*}|�t|��|r�|d	7}|t|�7}q�d�|�|}|t|�7}||fS)
Nr)r8r9rr:rr
rr@)	rr!r#r1r/rr'rrrArrr
�_buffer_decode�s6


z!IncrementalDecoder._buffer_decodeN)r<r=r>rFrrrr
rE�srEc@seZdZdS)�StreamWriterN�r<r=r>rrrr
rG"srGc@seZdZdS)�StreamReaderNrHrrrr
rI%srIc	Cs tjdt�jt�jttttd�S)NZidna)�namerr$�incrementalencoder�incrementaldecoder�streamwriter�streamreader)	�codecs�	CodecInfor(rr$r?rErGrIrrrr
�getregentry*s�rQ)r�rerOrr�compiler1rrrr r'r(�BufferedIncrementalEncoderr?�BufferedIncrementalDecoderrErGrIrQrrrr
�<module>s
.+)H#'encodings/__pycache__/hz.cpython-38.pyc000064400000002577151153537620014021 0ustar00U

e5d��@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�hzc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�$/usr/lib64/python3.8/encodings/hz.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_cnrZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/iso8859_3.cpython-38.pyc000064400000004576151153537620014753 0ustar00U

e5d!3�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zj Python Character Mapping Codec iso8859_3 generated from 'MAPPINGS/ISO8859/8859-3.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/iso8859_3.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	iso8859-3)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤￾Ĥ§¨İŞĞĴ­￾ݰħ²³´µĥ·¸ışğĵ½￾żÀÁÂ￾ÄĊĈÇÈÉÊËÌÍÎÏ￾ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ￾äċĉçèéêëìíîï￾ñòóôġö÷ĝùúûüŭŝ˙)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/hex_codec.cpython-38.opt-1.pyc000064400000004354151153537620016253 0ustar00U

e5d��@s�dZddlZddlZddd�Zddd�ZGdd	�d	ej�ZGd
d�dej�ZGdd
�d
ej�ZGdd�deej�ZGdd�deej	�Z	dd�Z
dS)z�Python 'hex_codec' Codec - 2-digit hex content transfer encoding.

This codec de/encodes from bytes to bytes.

Written by Marc-Andre Lemburg (mal@lemburg.com).
�N�strictcCst�|�t|�fS�N)�binascii�b2a_hex�len��input�errors�r
�+/usr/lib64/python3.8/encodings/hex_codec.py�
hex_encode
srcCst�|�t|�fSr)r�a2b_hexrrr
r
r�
hex_decodesrc@s eZdZddd�Zddd�ZdS)	�CodecrcCs
t||�Sr)r��selfrr	r
r
r�encodeszCodec.encodecCs
t||�Sr)rrr
r
r�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrr
r
r
rrs
rc@seZdZddd�ZdS)�IncrementalEncoderFcCs
t�|�Sr)rr�rr�finalr
r
rrszIncrementalEncoder.encodeN)F)rrrrr
r
r
rrsrc@seZdZddd�ZdS)�IncrementalDecoderFcCs
t�|�Sr)rr
rr
r
rr!szIncrementalDecoder.decodeN)F)rrrrr
r
r
rr src@seZdZeZdS)�StreamWriterN�rrr�bytes�charbuffertyper
r
r
rr%src@seZdZeZdS)�StreamReaderNrr
r
r
rr(src
Cstjdttttttdd�S)N�hexF)�namerr�incrementalencoder�incrementaldecoder�streamwriter�streamreader�_is_text_encoding)�codecs�	CodecInforrrrrrr
r
r
r�getregentry-s�r))r)r)�__doc__r'rrrrrrrrr)r
r
r
r�<module>s

encodings/__pycache__/iso2022_jp_2.cpython-38.opt-2.pyc000064400000002630151153537620016340 0ustar00U

e5d%�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�iso2022_jp_2c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�./usr/lib64/python3.8/encodings/iso2022_jp_2.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z_codecs_iso2022rZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/iso8859_9.cpython-38.opt-1.pyc000064400000004567151153537620015720 0ustar00U

e5dd3�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zj Python Character Mapping Codec iso8859_9 generated from 'MAPPINGS/ISO8859/8859-9.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/iso8859_9.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	iso8859-9)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp932.cpython-38.pyc000064400000002605151153537620014230 0ustar00U

e5d��@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�cp932c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�'/usr/lib64/python3.8/encodings/cp932.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_jprZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/cp949.cpython-38.opt-1.pyc000064400000002605151153537620015177 0ustar00U

e5d��@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�cp949c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�'/usr/lib64/python3.8/encodings/cp949.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_krrZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/raw_unicode_escape.cpython-38.opt-1.pyc000064400000003344151153537620020147 0ustar00U

e5d��@svdZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdS)z� Python 'raw-unicode-escape' Codec


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

�Nc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codecs�raw_unicode_escape_encode�encode�raw_unicode_escape_decode�decode�rr�4/usr/lib64/python3.8/encodings/raw_unicode_escape.pyr
src@seZdZddd�ZdS)�IncrementalEncoderFcCst�||j�dS�Nr)rr�errors��self�input�finalrrrrszIncrementalEncoder.encodeN)F)rrrrrrrrr
sr
c@seZdZddd�ZdS)�IncrementalDecoderFcCst�||j�dSr)rr	rrrrrr
szIncrementalDecoder.decodeN)F)rrrr
rrrrrsrc@seZdZdS)�StreamWriterN�rrrrrrrrsrc@seZdZdS)�StreamReaderNrrrrrrsrc	Cstjdtjtjttttd�S)Nzraw-unicode-escape)�namerr
�incrementalencoder�incrementaldecoder�streamwriter�streamreader)	r�	CodecInforrr
r
rrrrrrr�getregentry$s�r)�__doc__rrr
rrrrrrrr�<module>sencodings/__pycache__/iso2022_jp_1.cpython-38.opt-2.pyc000064400000002630151153537620016337 0ustar00U

e5d%�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�iso2022_jp_1c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�./usr/lib64/python3.8/encodings/iso2022_jp_1.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z_codecs_iso2022rZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/cp1252.cpython-38.opt-2.pyc000064400000004414151153537620015244 0ustar00U

e5d�4�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1252.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1252)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€￾‚ƒ„…†‡ˆ‰Š‹Œ￾Ž￾￾‘’“”•–—˜™š›œ￾žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ)
rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/iso8859_2.cpython-38.opt-2.pyc000064400000004374151153537620015706 0ustar00U

e5d\4�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/iso8859_2.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	iso8859-2)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙)
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/big5.cpython-38.opt-2.pyc000064400000002603151153537620015154 0ustar00U

e5d��@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�big5c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�&/usr/lib64/python3.8/encodings/big5.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_twrZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/palmos.cpython-38.opt-1.pyc000064400000004623151153537620015624 0ustar00U

e5d�4�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zx Python Character Mapping Codec for PalmOS 3.5.

Written by Sjoerd Mullender (sjoerd@acm.org); based on iso8859_15.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/palmos.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
rs
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)NZpalmos)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry"s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹Œ♦♣♥♠‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/iso8859_10.cpython-38.opt-2.pyc000064400000004377151153537620015770 0ustar00U

e5d5�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�,/usr/lib64/python3.8/encodings/iso8859_10.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz
iso8859-10)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨͧĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ)
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp037.cpython-38.pyc000064400000004570151153537620014227 0ustar00U

e5dA3�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zs Python Character Mapping Codec cp037 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP037.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp037.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp037)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�œ	†—Ž
…‡’€‚ƒ„
ˆ‰Š‹Œ‘“”•–˜™š›ž  âäàáãåçñ¢.<(+|&éêëèíîïìß!$*);¬-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'="Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®^£¥·©§¶¼½¾[]¯¨´×{ABCDEFGHI­ôöòóõ}JKLMNOPQR¹ûüùúÿ\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙڟ)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/rot_13.cpython-38.opt-1.pyc000064400000005673151153537620015446 0ustar00U

e5d�	�7@s dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdD�4�dEdF�Ze
dGk�rddlZeejej�dS)Hz� Python Character Mapping Codec for ROT13.

This codec de/encodes from str to str.

Written by Marc-Andre Lemburg (mal@lemburg.com).
�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�|t�t|�fS�N��str�	translate�	rot13_map�len��self�input�errors�r�(/usr/lib64/python3.8/encodings/rot_13.py�encodeszCodec.encodecCst�|t�t|�fSrrr
rrr�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrrr
s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�|t�Sr�rrr�rr�finalrrrrszIncrementalEncoder.encodeN)F)rrrrrrrrrsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�|t�SrrrrrrrszIncrementalDecoder.decodeN)F)rrrrrrrrrsrc@seZdZdS)�StreamWriterN�rrrrrrrrsrc@seZdZdS)�StreamReaderNrrrrrrsrc
Cs"tjdt�jt�jttttdd�S)N�rot-13F)�namerr�incrementalencoder�incrementaldecoder�streamwriter�streamreader�_is_text_encoding)	�codecs�	CodecInforrrrrrrrrrr�getregentry$s�r&��N�O�P�Q�R�S�T�U�V�W�X�Y�Z�A�B�C�D�E�F�G�H�I�J�K�L�M�n�o�p�q�r�s�t�u�v�w�x�y�z�a�b�c�d�e�f�g�h�i�j�k�l�m)4r5r6r7r8r9r:r;r<r=r>r?r@rAr(r)r*r+r,r-r.r/r0r1r2r3r4rOrPrQrRrSrTrUrVrWrXrYrZr[rBrCrDrErFrGrHrIrJrKrLrMrNcCs|�t�|��d��dS)Nr)�writer$r�read)ZinfileZoutfilerrr�rot13lsr^�__main__)�__doc__r$rrrrrr&�make_identity_dict�ranger�updater^r�sys�stdin�stdoutrrrr�<module>s��9
encodings/__pycache__/iso8859_8.cpython-38.opt-2.pyc000064400000004443151153537620015711 0ustar00U

e5d+�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/iso8859_8.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	iso8859-8)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ￾¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾‗אבגדהוזחטיךכלםמןנסעףפץצקרשת￾￾‎‏￾)
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/mac_greek.cpython-38.opt-1.pyc000064400000004614151153537620016246 0ustar00U

e5d�5�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zo Python Character Mapping Codec mac_greek generated from 'MAPPINGS/VENDORS/APPLE/GREEK.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/mac_greek.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	mac-greek)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/utf_16_le.cpython-38.opt-1.pyc000064400000003164151153537620016114 0ustar00U

e5d
�@spdZddlZejZddd�ZGdd�dej�ZGdd	�d	ej�ZGd
d�dej�ZGdd
�d
ej	�Z	dd�Z
dS)z� Python 'utf-16-le' Codec


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

�N�strictcCst�||d�S)NT)�codecs�utf_16_le_decode)�input�errors�r�+/usr/lib64/python3.8/encodings/utf_16_le.py�decodesr	c@seZdZddd�ZdS)�IncrementalEncoderFcCst�||j�dS)Nr)r�utf_16_le_encoder)�selfr�finalrrr�encodeszIncrementalEncoder.encodeN)F)�__name__�
__module__�__qualname__rrrrrr
sr
c@seZdZejZdS)�IncrementalDecoderN)rrrrr�_buffer_decoderrrrrsrc@seZdZejZdS)�StreamWriterN)rrrrrrrrrrrsrc@seZdZejZdS)�StreamReaderN)rrrrrr	rrrrrsrc	Cstjdttttttd�S)Nz	utf-16-le)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)r�	CodecInforr	r
rrrrrrr�getregentry!s�r)r)�__doc__rrrr	r
�BufferedIncrementalDecoderrrrrrrrr�<module>s
encodings/__pycache__/cp1257.cpython-38.opt-2.pyc000064400000004423151153537620015251 0ustar00U

e5d>4�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1257.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1257)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€￾‚￾„…†‡￾‰￾‹￾¨ˇ¸￾‘’“”•–—￾™￾›￾¯˛￾ ￾¢£¤￾¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙)
rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/shift_jis.cpython-38.pyc000064400000002615151153537620015353 0ustar00U

e5d�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�	shift_jisc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�+/usr/lib64/python3.8/encodings/shift_jis.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_jprZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/gb18030.cpython-38.opt-2.pyc000064400000002611151153537620015311 0ustar00U

e5d�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�gb18030c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�)/usr/lib64/python3.8/encodings/gb18030.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_cnrZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/cp875.cpython-38.opt-2.pyc000064400000004361151153537620015177 0ustar00U

e5d62�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp875.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)NZcp875)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u}œ	†—Ž
…‡’€‚ƒ„
ˆ‰Š‹Œ‘“”•–˜™š›ž ΑΒΓΔΕΖΗΘΙ[.<(+!&ΚΛΜΝΞΟΠΡΣ]$*);^-/ΤΥΦΧΨΩΪΫ|,%_>?¨ΆΈΉ ΊΌΎΏ`:#@'="΅abcdefghiαβγδεζ°jklmnopqrηθικλμ´~stuvwxyzνξοπρσ£άέήϊίόύϋώςτυφχψ{ABCDEFGHI­ωΐΰ‘―}JKLMNOPQR±½·’¦\STUVWXYZ²§«¬0123456789³©»Ÿ)
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/iso2022_kr.cpython-38.opt-2.pyc000064400000002624151153537620016125 0ustar00U

e5d�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�
iso2022_krc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�,/usr/lib64/python3.8/encodings/iso2022_kr.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z_codecs_iso2022rZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/aliases.cpython-38.pyc000064400000014274151153537620015016 0ustar00U

e5dM=�G@s�dZddddddddddddddddddddddddddddddddddd	d	d
d
ddddd
d
dddddddddddddddddddddddddddddddddddddddddddddddddddddd d d d!d!d!d"d"d"d#d#d#d$d$d$d$d%d%d%d%d&d&d&d'd'd(d(d(d)d*d*d*d+d+d+d+d+d+d+d,d-d-d-d-d-d-d-d-d.d.d.d/d0d0d0d0d0d1d1d1d2d2d2d3d3d4d4d5d5d6d6d7d7d8d8d8d9d9d9d9d9d9d:d:d:d;d;d;d<d<d<d<d<d<d=d=d=d>d>d>d>d>d?d?d?d?d?d?d@d@d@d@d@d@dAdAdAdAdAdAdBdBdBdBdBdCdCdCdCdCdCdCdDdDdDdDdDdDdDdDdEdEdEdEdEdFdFdFdFdFdFdGdGdHdIdIdIdJdJdJdJdJdJdJdJdJdJdJdJdKdLdMdNdNdOdOdPdQdQdRdRdRdRdSdSdSdTdUdUdUdUdVdVdVdWdWdWdXdYdYdYdYdYdZdZd[d[d\d\d]d]d^d_d`d`d`dadadadadadadbdcdcdUd+d-ddd��FZdeS)fa< Encoding Aliases Support

    This module is used by the encodings package search function to
    map encodings names to module names.

    Note that the search function normalizes the encoding names before
    doing the lookup, so the mapping will have to map normalized
    encoding names to module names.

    Contents:

        The following aliases dictionary contains mappings of all IANA
        character set names for which the Python core library provides
        codecs. In addition to these, a few Python specific codec
        aliases have also been added.

�ascii�base64_codec�big5�	big5hkscs�	bz2_codec�cp037�cp1026�cp1125�cp1140�cp1250�cp1251�cp1252�cp1253�cp1254�cp1255�cp1256�cp1257�cp1258�cp273�cp424�cp437�cp500�cp775�cp850�cp852�cp855�cp857�cp858�cp860�cp861�cp862�cp863�cp864�cp865�cp866�cp869�cp932�cp949�cp950�euc_jis_2004�euc_jisx0213�euc_jp�euc_kr�gb18030�gb2312�gbk�	hex_codec�	hp_roman8�hz�
iso2022_jp�iso2022_jp_1�iso2022_jp_2�iso2022_jp_2004�iso2022_jp_3�iso2022_jp_ext�
iso2022_kr�
iso8859_10�
iso8859_11�
iso8859_13�
iso8859_14�
iso8859_15�
iso8859_16�	iso8859_2�	iso8859_3�	iso8859_4�	iso8859_5�	iso8859_6�	iso8859_7�	iso8859_8�	iso8859_9�johab�koi8_r�kz1048�latin_1�mac_cyrillic�	mac_greek�mac_iceland�
mac_latin2�	mac_roman�mac_turkish�mbcs�ptcp154�quopri_codec�rot_13�	shift_jis�shift_jis_2004�shift_jisx0213�tactis�tis_620�utf_16�	utf_16_be�	utf_16_le�utf_32�	utf_32_be�	utf_32_le�utf_7�utf_8�uu_codec�
zlib_codec(F�646zansi_x3.4_1968�ansi_x3_4_1968zansi_x3.4_1986�cp367�csascii�ibm367�	iso646_usziso_646.irv_1991�iso_ir_6�us�us_ascii�base64�base_64�big5_tw�csbig5�
big5_hkscs�hkscs�bz2�037�csibm037�ebcdic_cp_ca�ebcdic_cp_nl�ebcdic_cp_us�ebcdic_cp_wt�ibm037�ibm039�1026�	csibm1026�ibm1026�1125�ibm1125�cp866u�ruscii�1140�ibm1140�1250�windows_1250�1251�windows_1251�1252�windows_1252�1253�windows_1253�1254�windows_1254�1255�windows_1255�1256�windows_1256�1257�windows_1257�1258�windows_1258�273�ibm273�csibm273�424�csibm424�ebcdic_cp_he�ibm424�437�cspc8codepage437�ibm437�500�csibm500�ebcdic_cp_be�ebcdic_cp_ch�ibm500�775�
cspc775baltic�ibm775�850�cspc850multilingual�ibm850�852�cspcp852�ibm852�855�csibm855�ibm855�857�csibm857�ibm857�858�csibm858�ibm858�860�csibm860�ibm860�861�cp_is�csibm861�ibm861�862�cspc862latinhebrew�ibm862�863�csibm863�ibm863�864�csibm864�ibm864�865�csibm865�ibm865�866�csibm866�ibm866�869�cp_gr�csibm869�ibm869�932�ms932�mskanji�ms_kanji�949�ms949�uhc�950�ms950�jisx0213�
eucjis2004�euc_jis2004�eucjisx0213�eucjp�ujis�u_jis�euckr�korean�ksc5601�	ks_c_5601�ks_c_5601_1987�ksx1001�	ks_x_1001�gb18030_2000�chinese�csiso58gb231280�euc_cn�euccn�eucgb2312_cn�gb2312_1980�	gb2312_80�	iso_ir_58�936�cp936�ms936�hex�roman8�r8�
csHPRoman8�cp1051�ibm1051�hzgb�hz_gb�
hz_gb_2312�csiso2022jp�	iso2022jp�iso_2022_jp�iso2022jp_1�
iso_2022_jp_1�iso2022jp_2�
iso_2022_jp_2�iso_2022_jp_2004�iso2022jp_2004�iso2022jp_3�
iso_2022_jp_3�
iso2022jp_ext�iso_2022_jp_ext�csiso2022kr�	iso2022kr�iso_2022_kr�csisolatin6�iso_8859_10�iso_8859_10_1992�
iso_ir_157�l6�latin6�thai�iso_8859_11�iso_8859_11_2001�iso_8859_13�l7�latin7�iso_8859_14�iso_8859_14_1998�
iso_celtic�
iso_ir_199�l8�latin8�iso_8859_15�l9�latin9�iso_8859_16�iso_8859_16_2001�
iso_ir_226�l10�latin10�csisolatin2�
iso_8859_2�iso_8859_2_1987�
iso_ir_101�l2�latin2�csisolatin3�
iso_8859_3�iso_8859_3_1988�
iso_ir_109�l3�latin3�csisolatin4�
iso_8859_4�iso_8859_4_1988�
iso_ir_110�l4�latin4�csisolatincyrillic�cyrillic�
iso_8859_5�iso_8859_5_1988�
iso_ir_144�arabic�asmo_708�csisolatinarabic�ecma_114�
iso_8859_6�iso_8859_6_1987�
iso_ir_127�csisolatingreek�ecma_118�elot_928�greek�greek8�
iso_8859_7�iso_8859_7_1987�
iso_ir_126�csisolatinhebrew�hebrew�
iso_8859_8�iso_8859_8_1988�
iso_ir_138�csisolatin5�
iso_8859_9�iso_8859_9_1989�
iso_ir_148�l5�latin5�cp1361�ms1361�cskoi8r�kz_1048�rk1048�
strk1048_2002�8859�cp819�csisolatin1�ibm819�iso8859�	iso8859_1�
iso_8859_1�iso_8859_1_1987�
iso_ir_100�l1�latin�latin1�maccyrillic�macgreek�
maciceland�maccentraleurope�	maclatin2�	macintosh�macroman�
macturkish�ansi�dbcs�	csptcp154�pt154�cp154�cyrillic_asian�quopri�quoted_printable�quotedprintable�rot13�
csshiftjis�shiftjis�sjis�s_jis�shiftjis2004�	sjis_2004�
s_jis_2004�
shiftjisx0213�	sjisx0213�
s_jisx0213�tis260�tis620�	tis_620_0�tis_620_2529_0�tis_620_2529_1�
iso_ir_166�u16�utf16�unicodebigunmarked�utf_16be�unicodelittleunmarked�utf_16le�u32�utf32�utf_32be�utf_32le�u7�utf7�unicode_1_1_utf_7�u8�utf�utf8�	utf8_ucs2�	utf8_ucs4�cp65001�uu�zip�zlib�x_mac_japanese�x_mac_korean�x_mac_simp_chinese�x_mac_trad_chineseN)�__doc__�aliases�r�r��)/usr/lib64/python3.8/encodings/aliases.py�<module>s�	�����encodings/__pycache__/big5hkscs.cpython-38.pyc000064400000002615151153537620015253 0ustar00U

e5d�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�	big5hkscsc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�+/usr/lib64/python3.8/encodings/big5hkscs.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_hkrZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/cp855.cpython-38.pyc000064400000017713151153537620014242 0ustar00U

e5d:��@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d �d!�d"�d#�d$�d%�d&�d'd�d��d(�d)�d*�d+�d,�d-�d.�d/�d0�d1�d2�d3�d4�d5�d6d>�d7�d8�d9�d:�d;�d<�d=�d>�d?�d@�dAd��dB�dC�dD�dE�dF�dG�dH�dI�dJ�dK�dL�dM�dN�dO�dP�dQ�dR�dS�dT�dU�dVd_�dW�dX�dY�dZ�d[�d\�d]�d^�d_�d`�da�db�dc�dd�de�df�dg�dh�di�dj�dk�dl�dm�dn�do�dp�dq�dr�ds�dt�du�dv�dw�dx�dy�dz�d{�d|d?�d}�d~�d�d��d��d��d��d��d��d��d��d��d��d��d���Z
dS(�z` Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP855.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp855.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp855)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$��R��S��Q��T��U��V��W��X��Y�	�Z�
�[��\��^��_��N�.�J�*�0��1��F�&�4��5��D�$�3����%�%�%�%�$%�E�%�8��c%�Q%�W%�]%�9��%�%�4%�,%�%�%�<%�:��Z%�T%�i%�f%�`%�P%�l%��;��<��=��>��?�%�%�%�%��O�%�/�@� �A�!�B�"�C�#�6��2��L�,�!��K�+�7��H�(�M�-�I�)�G�'��%�)���������������������������������r����ru��r����rT�r��������������rU�����������������������������������������������������������������������������������������������������������������������u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�rr�rr�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r
rr�r�r�r�r�r�r�r�rrrrr�r�rrrr�rrrr�rr�rr�r�r�r	rr�r�r�r�r�r�r�r�rrrrr�r�rrrr�rr
rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r(rr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwrxryrzr{r|r}r~rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rur�rTr�rUr+r'r)r-r/r1r3r5r7r9r;r=r?rArGrIr�rSrMrOr�r�r^rdrmrwryr{r}r�r�r�r�r�rQr\rKr�r�r�rEr�r�r�rCr�rFrHr�rRrLrNr�r�r]rcrlrvrxrzr|r~r�r�r�r�rPr[rJr�r�r�rDr�r�r�rBr�r*r&r(r,r.r0r2r4r6r8r:r<r>r@r�rjrYr�rerfrrirZrhrgrkrsr`rorarnrbrrr_rqrprtr�r�r�rVrWrXr�)�__doc__rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s$
����encodings/__pycache__/mac_centeuro.cpython-38.opt-2.pyc000064400000004430151153537620016772 0ustar00U

e5d7�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�./usr/lib64/python3.8/encodings/mac_centeuro.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nzmac-centeuro)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ)
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/iso2022_jp_3.cpython-38.opt-2.pyc000064400000002630151153537620016341 0ustar00U

e5d%�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�iso2022_jp_3c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�./usr/lib64/python3.8/encodings/iso2022_jp_3.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z_codecs_iso2022rZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/mac_croatian.cpython-38.opt-2.pyc000064400000004440151153537620016747 0ustar00U

e5dA5�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�./usr/lib64/python3.8/encodings/mac_croatian.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nzmac-croatian)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ)
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/gb2312.cpython-38.opt-2.pyc000064400000002607151153537620015232 0ustar00U

e5d�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�gb2312c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�(/usr/lib64/python3.8/encodings/gb2312.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_cnrZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/cp775.cpython-38.pyc000064400000017306151153537620014241 0ustar00U

e5d���@sfdZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/dd0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�dd�ds�dd8�d�dd7d+�d�ddd!�d�d�d�dd9d=d1�d�d�d�d �d!d�d"�d#�d$�d%�d&�d'�d(�d)�d*d&d�d+d$�d,�d-d��d.du�d/�d0�d1d��d2�d3�d4�d5dod��d6�d7�d8�d9�d:d:�d;�d<d�d=�d>d�d?�d@�dA�dB�dC�dD�dE�dF�dG�dH�dId�dt�dJd.d"d)�dK�dLd,d/�dMd-�dN�dOd6d��dPdd��dQ�dR�dS�dT�dU�dV�dW�dXd�dY�dZd d>�d[d;�d\d��d]�d^�d_dpd*�d`�da�dbd�d�d��dc�dd��Z
dS(ezf Python Character Mapping Codec cp775 generated from 'VENDORS/MICSFT/PC/CP775.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp775.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp775)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$���������#����B��V�W�+�y�����������M��"��Z�[������������*���{�|�z� �������A���%�%�%�%�$%�����c%�Q%�W%�]%�.�`�%�%�4%�,%�%�%�<%�r�j�Z%�T%�i%�f%�`%�P%�l%�}��
���/�a�s�k�~�%�%�%�%�%�%�%�����L�C�����D�6�7�;�<�F��E� ��� ����� ��"�����%�)���������������������������������r��r<rBrE�rLr��rM�rSrOr�rN�r�r�r�r��r�r�r��r��rTrQrPr��������r4r5r8����r6������������������r���r�r?rDrC������r@����r���������r*r,r7����r(������������������rG��r�r:r�rA���r'���u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£Ø×¤ĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�(rr�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwr�r<rBrErLr�rMrSrOr�rNr�r�r�r�r�r�r�r�rTrQrPr�r4r5r8r6r�r�r?rDrCr@r�r*r,r7r(rGr�r:r�rAr'r%r)rZrur&r-r[rvr�r/r]rxr\rwr;r+rFr2rbryr�r�r�r�rRr.r�r�r�r�r�r9r0r1r=r>rcrzrlr|rkr{r3rJrHrIrtr}r�r�rKr�r�rirXrrdrer~rhrYrgrfrjrrr_rnr`rmrarqr^rprorsr�r�r�r�r�rUrVrWr�)�__doc__rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s$����encodings/__pycache__/oem.cpython-38.opt-1.pyc000064400000002766151153537620015117 0ustar00U

e5d��@s~dZddlmZmZddlZeZddd�ZGdd�dej�ZGd	d
�d
ej�ZGdd�dej	�Z	Gd
d�dej
�Z
dd�ZdS)z! Python 'oem' Codec for Windows

�)�
oem_encode�
oem_decodeN�strictcCst||d�S)NT)r)�input�errors�r�%/usr/lib64/python3.8/encodings/oem.py�decodesr	c@seZdZddd�ZdS)�IncrementalEncoderFcCst||j�dS)Nr)rr)�selfr�finalrrr�encodeszIncrementalEncoder.encodeN)F)�__name__�
__module__�__qualname__r
rrrrr
sr
c@seZdZeZdS)�IncrementalDecoderN)rrrr�_buffer_decoderrrrrsrc@seZdZeZdS)�StreamWriterN)rrrrr
rrrrrsrc@seZdZeZdS)�StreamReaderN)rrrrr	rrrrrsrc	Cstjdttttttd�S)NZoem)�namer
r	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)�codecs�	CodecInfor
r	r
rrrrrrr�getregentry s�r)r)�__doc__rrrr
r	r
�BufferedIncrementalDecoderrrrrrrrr�<module>s
encodings/__pycache__/shift_jis_2004.cpython-38.pyc000064400000002627151153537620016023 0ustar00U

e5d#�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�shift_jis_2004c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�0/usr/lib64/python3.8/encodings/shift_jis_2004.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_jprZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/koi8_r.cpython-38.opt-2.pyc000064400000004456151153537620015531 0ustar00U

e5d�5�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/koi8_r.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nzkoi8-r)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ)
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/iso8859_13.cpython-38.pyc000064400000004577151153537620015035 0ustar00U

e5d�3�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zl Python Character Mapping Codec iso8859_13 generated from 'MAPPINGS/ISO8859/8859-13.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�,/usr/lib64/python3.8/encodings/iso8859_13.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz
iso8859-13)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/iso2022_jp_1.cpython-38.opt-1.pyc000064400000002630151153537620016336 0ustar00U

e5d%�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�iso2022_jp_1c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�./usr/lib64/python3.8/encodings/iso2022_jp_1.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z_codecs_iso2022rZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/cp874.cpython-38.opt-2.pyc000064400000004563151153537620015202 0ustar00U

e5d31�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp874.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)NZcp874)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€￾￾￾￾…￾￾￾￾￾￾￾￾￾￾￾‘’“”•–—￾￾￾￾￾￾￾￾ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู￾￾￾￾฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛￾￾￾￾)
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/mac_arabic.cpython-38.pyc000064400000017076151153537620015441 0ustar00U

e5ds��@sPdZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d0dd1d�d2d�d3d�d4d�d�d6d�d7d�d8d�d9d�d:d�d;dd�d=d�d>d�d?d�d�d�d�d�d�d�d�d�d�d�dJd�d�dLd�dMd�dNd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�dkd�dlddmd�dnd�dod�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�dd�d.d�d/d��d	�d
�d�d�d
�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d �d!�d"�d#�d$�d%�d&�d'�d(�d)�d*d(�d+�d,�d-�d.d�d/�d0d�d1d�d2�d3�d4�d5�d6�d7�d8d�d9�d:�d;�d<d�d=�d>�d?�d@ddd�dAd�dB�dCdddd d!�dDd"d$d%�dEd&�dF�dG�dH�dI�dJ�dK�dL�dM�dN�dO�dP�dQd)d'�dRd-d,�dSd+�dT�dU�dVd*�dW�dX�dY��Z
dS(Zz] Python Character Mapping Codec generated from 'VENDORS/APPLE/ARABIC.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�,/usr/lib64/python3.8/encodings/mac_arabic.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz
mac-arabic)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#�������������������������������������& ������������������ �!�"�#�$�j�&�'�(�)�*�+��-�.�/�`�a�b�c�d�e�f�g�h�i�:��<�=�>��J'�!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�[�\�]�^�_�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�~�y��������{�|�}���)���������������������������������r&����������r1���������������r=����������r%����r'��r(��������������r)��������r*����������r+������r-r,r.��r/����r2r4r3r5r6��r7r9r:��r;��r<r>�r?r@�rBrArCrD���uh	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Ä ÇÉÑÖÜáàâäں«çéèêëí…îïñó»ôö÷úùûü !"#$٪&'()*+،-./٠١٢٣٤٥٦٧٨٩:؛<=>؟❊ءآأؤإئابةتثجحخدذرزسشصضطظعغ[\]^_ـفقكلمنهوىيًٌٍَُِّْپٹچەڤگڈڑ{|}ژے���������	�
���
������������������r�r�r�r��%r�r�r�r�r��,r�r�r��0�1�2�3�4�5�6�7�8�9r��;r�r�r��?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Zr�r�r�r��`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�zr�~�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr�r�r�r�r�r�r�r�r�r�r�rrrr�rr�r�(rrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%rErErFrFrGrGrHrHrIrIr&rKrKrLrLrMrMrNrNrOrOrPrPr'rRrRrSrSrTrTr(r)r*r+r,r-r.r/r0r1r_r_r2rararbrbrcrcr3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNr�r�r�r�r�r�r�r�r�r�rOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrir�r�r�r�r�r�rjrkr&r1r=r%r'r(r)r*r+r-r,r.r/r2r4r3r5r6r7r9r:r;r<r>r?r@rBrArCrDrQr`rdrfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwrxryrzr{r|r}r~rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rUrVrWrXrYrZr[r\r]r^rJr�r�r�r�r�r�r�r�r0r�r�r8re)�__doc__rrrrrrr#�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s$
����encodings/__pycache__/cp864.cpython-38.opt-1.pyc000064400000017462151153537620015202 0ustar00U

e5d���@szdZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+ddd,d-dd.d/d0ddd1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�dd��~�d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�d�d�d�dded)�d�d�ddd$�d�d�d�d �d!d�d"�d#�d$�d%�d&�d'�d(�d)�d*�d+�d,�d-�d.�d/�d0�d1�d2�d3�d4�d5�d6�d7�d8dI�d9�d:�d;�d<�d=�d>�d?�d@�dA�dB�dCd(�dDd.�dE�dF�dG�dH�dI�dJ�dK�dL�dMd&�dNd%�dO�dP�dQ�dR�dSdg�dT�dU�dV�dW�dX�dY�dZ�d[df�d\�d]�d^�d_�d`�da�db�dc�dd�de�df�dg�dh�di�dj�dk�dl�dm�dn�do�dp�dq�dr�ds�dt�du�dv�dw��Z
dS(xz` Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP864.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp864.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp864)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$��j���"�"�%�%�%�<%�$%�,%�%�4%�%�%�%�%��"������H"������������������`�a�b�c�d�e�f�g�h�i����������������������������������������������@������������������������������}��Q�����������������������%)~�%���������������������������������r_�rz����r>r{rD��r'r:�����r(���r?r<r;����������������������������������������������r}������������������������������������������������������������r|��������u�	

 !"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ￾￾ﻻﻼ￾ ­ﺂ£¤ﺄ￾￾ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■￾���������	�
���
������������������� �!�"�#�$�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~��r���r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r
rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�rr�r
r�r�r�rr�rr�rr�r�rrrr�rr	r�r�r�r�)�rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwrxryrzr{r|r}r~rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r_r�r�rzr>r{rDr'r:r(r?r<r;r}r|r7r9rKrZr^rr�rOrPrQrRrSrTrUrVrWrXr&r)r*r8r=r,r-r4r3r5r6r1r/r0r2r.r+r�r�r`rarErbrFrcrerfrGrHrgrhrIrirJrjrLrkrMrlrNrmrnrorprqr[rrr\rsr]rtr�rurvrwr~rdrxr�r�r�ryr�rYr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r@rArBrC)�__doc__rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s
����encodings/__pycache__/iso2022_jp.cpython-38.pyc000064400000002624151153537620015162 0ustar00U

e5d�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�
iso2022_jpc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�,/usr/lib64/python3.8/encodings/iso2022_jp.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z_codecs_iso2022rZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/johab.cpython-38.opt-2.pyc000064400000002605151153537620015413 0ustar00U

e5d��@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�johabc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�'/usr/lib64/python3.8/encodings/johab.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_krrZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/undefined.cpython-38.opt-1.pyc000064400000004061151153537620016266 0ustar00U

e5d�@svdZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdS)a5 Python 'undefined' Codec

    This codec will always raise a ValueError exception when being
    used. It is intended for use by the site.py file to switch off
    automatic string to Unicode coercion.

Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCstd��dS�Nzundefined encoding��UnicodeError��self�input�errors�r�+/usr/lib64/python3.8/encodings/undefined.py�encodeszCodec.encodecCstd��dSrrrrrr�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__r
rrrrrrs
rc@seZdZddd�ZdS)�IncrementalEncoderFcCstd��dSrr�rr	�finalrrrr
szIncrementalEncoder.encodeN)F)rrrr
rrrrrsrc@seZdZddd�ZdS)�IncrementalDecoderFcCstd��dSrrrrrrrszIncrementalDecoder.decodeN)F)rrrrrrrrrsrc@seZdZdS)�StreamWriterN�rrrrrrrr src@seZdZdS)�StreamReaderNrrrrrr#src	Cs tjdt�jt�jttttd�S)NZ	undefined)�namer
r�incrementalencoder�incrementaldecoder�streamwriter�streamreader)	�codecs�	CodecInforr
rrrrrrrrr�getregentry(s�r )�__doc__rrrrrrr rrrr�<module>sencodings/__pycache__/iso8859_9.cpython-38.pyc000064400000004567151153537620014761 0ustar00U

e5dd3�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zj Python Character Mapping Codec iso8859_9 generated from 'MAPPINGS/ISO8859/8859-9.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/iso8859_9.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	iso8859-9)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/utf_16_be.cpython-38.opt-1.pyc000064400000003164151153537620016102 0ustar00U

e5d
�@spdZddlZejZddd�ZGdd�dej�ZGdd	�d	ej�ZGd
d�dej�ZGdd
�d
ej	�Z	dd�Z
dS)z� Python 'utf-16-be' Codec


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

�N�strictcCst�||d�S)NT)�codecs�utf_16_be_decode)�input�errors�r�+/usr/lib64/python3.8/encodings/utf_16_be.py�decodesr	c@seZdZddd�ZdS)�IncrementalEncoderFcCst�||j�dS)Nr)r�utf_16_be_encoder)�selfr�finalrrr�encodeszIncrementalEncoder.encodeN)F)�__name__�
__module__�__qualname__rrrrrr
sr
c@seZdZejZdS)�IncrementalDecoderN)rrrrr�_buffer_decoderrrrrsrc@seZdZejZdS)�StreamWriterN)rrrrrrrrrrrsrc@seZdZejZdS)�StreamReaderN)rrrrrr	rrrrrsrc	Cstjdttttttd�S)Nz	utf-16-be)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)r�	CodecInforr	r
rrrrrrr�getregentry!s�r)r)�__doc__rrrr	r
�BufferedIncrementalDecoderrrrrrrrr�<module>s
encodings/__pycache__/utf_7.cpython-38.opt-1.pyc000064400000003045151153537620015352 0ustar00U

e5d��@spdZddlZejZddd�ZGdd�dej�ZGdd	�d	ej�ZGd
d�dej�ZGdd
�d
ej	�Z	dd�Z
dS)zF Python 'utf-7' Codec

Written by Brian Quinlan (brian@sweetapp.com).
�N�strictcCst�||d�S)NT)�codecs�utf_7_decode)�input�errors�r�'/usr/lib64/python3.8/encodings/utf_7.py�decodesr	c@seZdZddd�ZdS)�IncrementalEncoderFcCst�||j�dS)Nr)r�utf_7_encoder)�selfr�finalrrr�encodeszIncrementalEncoder.encodeN)F)�__name__�
__module__�__qualname__rrrrrr
sr
c@seZdZejZdS)�IncrementalDecoderN)rrrrr�_buffer_decoderrrrrsrc@seZdZejZdS)�StreamWriterN)rrrrrrrrrrrsrc@seZdZejZdS)�StreamReaderN)rrrrrr	rrrrrsrc	Cstjdttttttd�S)Nzutf-7)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)r�	CodecInforr	r
rrrrrrr�getregentrys�r)r)�__doc__rrrr	r
�BufferedIncrementalDecoderrrrrrrrr�<module>s
encodings/__pycache__/utf_32_le.cpython-38.pyc000064400000003011151153537620015142 0ustar00U

e5d��@spdZddlZejZddd�ZGdd�dej�ZGdd	�d	ej�ZGd
d�dej�ZGdd
�d
ej	�Z	dd�Z
dS)z
Python 'utf-32-le' Codec
�N�strictcCst�||d�S)NT)�codecs�utf_32_le_decode)�input�errors�r�+/usr/lib64/python3.8/encodings/utf_32_le.py�decode
sr	c@seZdZddd�ZdS)�IncrementalEncoderFcCst�||j�dS)Nr)r�utf_32_le_encoder)�selfr�finalrrr�encodeszIncrementalEncoder.encodeN)F)�__name__�
__module__�__qualname__rrrrrr

sr
c@seZdZejZdS)�IncrementalDecoderN)rrrrr�_buffer_decoderrrrrsrc@seZdZejZdS)�StreamWriterN)rrrrrrrrrrrsrc@seZdZejZdS)�StreamReaderN)rrrrrr	rrrrrsrc	Cstjdttttttd�S)Nz	utf-32-le)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)r�	CodecInforr	r
rrrrrrr�getregentrys�r)r)�__doc__rrrr	r
�BufferedIncrementalDecoderrrrrrrrr�<module>s
encodings/__pycache__/cp424.cpython-38.pyc000064400000004626151153537620014231 0ustar00U

e5d/�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zj Python Character Mapping Codec cp424 generated from 'MAPPINGS/VENDORS/MISC/CP424.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp424.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp424)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�œ	†—Ž
…‡’€‚ƒ„
ˆ‰Š‹Œ‘“”•–˜™š›ž אבגדהוזחט¢.<(+|&יךכלםמןנס!$*);¬-/עףפץצקרש¦,%_>?￾ת￾￾ ￾￾￾‗`:#@'="￾abcdefghi«»￾￾￾±°jklmnopqr￾￾￾¸￾¤µ~stuvwxyz￾￾￾￾￾®^£¥·©§¶¼½¾[]¯¨´×{ABCDEFGHI­￾￾￾￾￾}JKLMNOPQR¹￾￾￾￾￾\÷STUVWXYZ²￾￾￾￾￾0123456789³￾￾￾￾Ÿ)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/utf_32.cpython-38.opt-1.pyc000064400000011237151153537620015432 0ustar00U

e5d	�@sxdZddlZddlZejZddd�ZGdd�dej�ZGdd	�d	ej�ZGd
d�dej	�Z	Gdd
�d
ej
�Z
dd�ZdS)z
Python 'utf-32' Codec
�N�strictcCst�||d�S)NT)�codecs�
utf_32_decode)�input�errors�r�(/usr/lib64/python3.8/encodings/utf_32.py�decode
sr	c@s8eZdZddd�Zddd�Zdd�Zd	d
�Zdd�Zd
S)�IncrementalEncoderrcCstj�||�d|_dS�N)rr
�__init__�encoder��selfrrrrrszIncrementalEncoder.__init__FcCsN|jdkr<t�||j�d}tjdkr0tj|_ntj|_|S|�||j�dS)Nr�little)r
r�
utf_32_encoder�sys�	byteorder�utf_32_le_encode�utf_32_be_encode)rr�final�resultrrr�encodes


zIncrementalEncoder.encodecCstj�|�d|_dSr)rr
�resetr
�rrrrrszIncrementalEncoder.resetcCs|jdkrdSdS)N�r)r
rrrr�getstate szIncrementalEncoder.getstatecCs,|rd|_ntjdkr tj|_ntj|_dS�Nr)r
rrrrr�r�staterrr�setstate's


zIncrementalEncoder.setstateN)r)F)�__name__�
__module__�__qualname__rrrrr rrrrr

s



r
c@s6eZdZd
dd�Zdd�Zdd�Zdd	�Zd
d�ZdS)�IncrementalDecoderrcCstj�||�d|_dSr)r�BufferedIncrementalDecoderr�decoderrrrrr1szIncrementalDecoder.__init__cCsl|jdkr\t�||d|�\}}}|dkr2tj|_n"|dkrDtj|_n|dkrTtd��||fS|�||j|�S)Nr������%UTF-32 stream does not start with BOM)r&r�utf_32_ex_decode�utf_32_le_decode�utf_32_be_decode�UnicodeErrorr)rrrr�output�consumedrrrr�_buffer_decode5s
�

z!IncrementalDecoder._buffer_decodecCstj�|�d|_dSr)rr%rr&rrrrrBszIncrementalDecoder.resetcCsDtj�|�d}|jdkr"|dfSttjdk|jtjkk�}||fS)Nrr�big)rr%rr&�intrrr-)rrZaddstaterrrrFs


�zIncrementalDecoder.getstatecCsdtj�||�|d}|dkr8tjdkr.tjntj|_n(|dkrZtjdkrPtjntj|_nd|_dS)Nr(rr2)rr%r rrr-r,r&rrrrr Ts����zIncrementalDecoder.setstateN)r)r!r"r#rr1rrr rrrrr$0s


r$c@s(eZdZd	dd�Zdd�Zd
dd�ZdS)�StreamWriterrcCsd|_tj�|||�dSr)r
rr4r)r�streamrrrrrdszStreamWriter.__init__cCstj�|�d|_dSr)rr4rr
rrrrrhszStreamWriter.resetcCsF|jdkr6t�||�}tjdkr*tj|_ntj|_|S|�||�SdSr)r
rrrrrr)rrrrrrrrls


zStreamWriter.encodeN)r)r)r!r"r#rrrrrrrr4cs
r4c@seZdZdd�Zddd�ZdS)�StreamReadercCs.tj�|�z|`Wntk
r(YnXdSr)rr6rr	�AttributeErrorrrrrrys
zStreamReader.resetrcCsRt�||dd�\}}}|dkr(tj|_n"|dkr:tj|_n|dkrJtd��||fS)NrFr'r(r)r*)rr+r,r	r-r.)rrr�objectr0rrrrr	�s�

zStreamReader.decodeN)r)r!r"r#rr	rrrrr6wsr6c	Cstjdttttttd�S)Nzutf-32)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)r�	CodecInforr	r
r$r6r4rrrr�getregentry�s�r?)r)�__doc__rrrrr	r
r%r$r4r6r?rrrr�<module>s
#3encodings/__pycache__/tis_620.cpython-38.opt-2.pyc000064400000004530151153537620015515 0ustar00U

e5d0�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�)/usr/lib64/python3.8/encodings/tis_620.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nztis-620)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ￾กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู￾￾￾￾฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛￾￾￾￾)
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/iso8859_4.cpython-38.opt-1.pyc000064400000004567151153537620015713 0ustar00U

e5d@4�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zj Python Character Mapping Codec iso8859_4 generated from 'MAPPINGS/ISO8859/8859-4.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/iso8859_4.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	iso8859-4)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤Ĩϧ¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩšēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖרŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/charmap.cpython-38.opt-1.pyc000064400000005515151153537620015745 0ustar00U

e5d$�@svdZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdS)a Generic Python Character Mapping Codec.

    Use this codec directly rather than through the automatic
    conversion mechanisms supplied by unicode() and .encode().


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

�Nc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codecs�charmap_encode�encode�charmap_decode�decode�rr�)/usr/lib64/python3.8/encodings/charmap.pyrsrc@s eZdZddd�Zd	dd�ZdS)
�IncrementalEncoder�strictNcCstj�||�||_dS�N)rr
�__init__�mapping��self�errorsrrrrrszIncrementalEncoder.__init__FcCst�||j|j�dS�Nr)rrrr�r�input�finalrrrrszIncrementalEncoder.encode)rN)F�rrrrrrrrrr
s
r
c@s eZdZddd�Zd	dd�ZdS)
�IncrementalDecoderrNcCstj�||�||_dSr)rrrrrrrrr!szIncrementalDecoder.__init__FcCst�||j|j�dSr)rr	rrrrrrr
%szIncrementalDecoder.decode)rN)F�rrrrr
rrrrr s
rc@s eZdZddd�Zddd�ZdS)	�StreamWriterrNcCstj�|||�||_dSr)rrrr�r�streamrrrrrr*szStreamWriter.__init__cCst�|||j�Sr)rrr�rrrrrrr.szStreamWriter.encode)rN)rrrrrrr(s
rc@s eZdZddd�Zddd�ZdS)	�StreamReaderrNcCstj�|||�||_dSr)rr rrrrrrr3szStreamReader.__init__cCst�|||j�Sr)rr
rrrrrr
7szStreamReader.decode)rN)rrrrrrr 1s
r c	Cstjdtjtjttttd�S)N�charmap)�namerr
�incrementalencoder�incrementaldecoder�streamwriter�streamreader)	r�	CodecInforrr
r
rrr rrrr�getregentry<s�r()�__doc__rrr
rrr r(rrrr�<module>s	encodings/__pycache__/cp1257.cpython-38.pyc000064400000004632151153537620014313 0ustar00U

e5d>4�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zv Python Character Mapping Codec cp1257 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1257.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1257.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1257)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€￾‚￾„…†‡￾‰￾‹￾¨ˇ¸￾‘’“”•–—￾™￾›￾¯˛￾ ￾¢£¤￾¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp1253.cpython-38.opt-2.pyc000064400000004431151153537620015244 0ustar00U

e5d&3�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1253.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1253)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€￾‚ƒ„…†‡￾‰￾‹￾￾￾￾￾‘’“”•–—￾™￾›￾￾￾￾ ΅Ά£¤¥¦§¨©￾«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ￾ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ￾)
rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/iso8859_14.cpython-38.opt-2.pyc000064400000004424151153537620015765 0ustar00U

e5dT5�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�,/usr/lib64/python3.8/encodings/iso8859_14.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz
iso8859-14)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ)
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/utf_16_be.cpython-38.pyc000064400000003164151153537620015143 0ustar00U

e5d
�@spdZddlZejZddd�ZGdd�dej�ZGdd	�d	ej�ZGd
d�dej�ZGdd
�d
ej	�Z	dd�Z
dS)z� Python 'utf-16-be' Codec


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

�N�strictcCst�||d�S)NT)�codecs�utf_16_be_decode)�input�errors�r�+/usr/lib64/python3.8/encodings/utf_16_be.py�decodesr	c@seZdZddd�ZdS)�IncrementalEncoderFcCst�||j�dS)Nr)r�utf_16_be_encoder)�selfr�finalrrr�encodeszIncrementalEncoder.encodeN)F)�__name__�
__module__�__qualname__rrrrrr
sr
c@seZdZejZdS)�IncrementalDecoderN)rrrrr�_buffer_decoderrrrrsrc@seZdZejZdS)�StreamWriterN)rrrrrrrrrrrsrc@seZdZejZdS)�StreamReaderN)rrrrrr	rrrrrsrc	Cstjdttttttd�S)Nz	utf-16-be)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)r�	CodecInforr	r
rrrrrrr�getregentry!s�r)r)�__doc__rrrr	r
�BufferedIncrementalDecoderrrrrrrrr�<module>s
encodings/__pycache__/mac_farsi.cpython-38.opt-1.pyc000064400000004544151153537620016257 0ustar00U

e5dB;�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zo Python Character Mapping Codec mac_farsi generated from 'MAPPINGS/VENDORS/APPLE/FARSI.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/mac_farsi.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	mac-farsi)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#uh	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Ä ÇÉÑÖÜáàâäں«çéèêëí…îïñó»ôö÷úùûü !"#$٪&'()*+،-./۰۱۲۳۴۵۶۷۸۹:؛<=>؟❊ءآأؤإئابةتثجحخدذرزسشصضطظعغ[\]^_ـفقكلمنهوىيًٌٍَُِّْپٹچەڤگڈڑ{|}ژے)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp1026.cpython-38.pyc000064400000004574151153537620014312 0ustar00U

e5d93�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zu Python Character Mapping Codec cp1026 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP1026.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1026.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1026)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�œ	†—Ž
…‡’€‚ƒ„
ˆ‰Š‹Œ‘“”•–˜™š›ž  âäàáãå{ñÇ.<(+!&éêëèíîïìßĞİ*);^-/ÂÄÀÁÃÅ[Ñş,%_>?øÉÊËÈÍÎÏÌı:ÖŞ'=ÜØabcdefghi«»}`¦±°jklmnopqrªºæ¸Æ¤µöstuvwxyz¡¿]$@®¢£¥·©§¶¼½¾¬|¯¨´×çABCDEFGHI­ô~òóõğJKLMNOPQR¹û\ùúÿü÷STUVWXYZ²Ô#ÒÓÕ0123456789³Û"Ùڟ)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp037.cpython-38.opt-2.pyc000064400000004364151153537620015170 0ustar00U

e5dA3�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp037.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp037)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�œ	†—Ž
…‡’€‚ƒ„
ˆ‰Š‹Œ‘“”•–˜™š›ž  âäàáãåçñ¢.<(+|&éêëèíîïìß!$*);¬-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'="Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®^£¥·©§¶¼½¾[]¯¨´×{ABCDEFGHI­ôöòóõ}JKLMNOPQR¹ûüùúÿ\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙڟ)
rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/iso8859_3.cpython-38.opt-2.pyc000064400000004403151153537620015700 0ustar00U

e5d!3�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/iso8859_3.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	iso8859-3)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤￾Ĥ§¨İŞĞĴ­￾ݰħ²³´µĥ·¸ışğĵ½￾żÀÁÂ￾ÄĊĈÇÈÉÊËÌÍÎÏ￾ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ￾äċĉçèéêëìíîï￾ñòóôġö÷ĝùúûüŭŝ˙)
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/iso8859_7.cpython-38.opt-2.pyc000064400000004404151153537620015705 0ustar00U

e5d,2�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/iso8859_7.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	iso8859-7)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­￾―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ￾ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ￾)
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/aliases.cpython-38.opt-1.pyc000064400000014274151153537620015755 0ustar00U

e5dM=�G@s�dZddddddddddddddddddddddddddddddddddd	d	d
d
ddddd
d
dddddddddddddddddddddddddddddddddddddddddddddddddddddd d d d!d!d!d"d"d"d#d#d#d$d$d$d$d%d%d%d%d&d&d&d'd'd(d(d(d)d*d*d*d+d+d+d+d+d+d+d,d-d-d-d-d-d-d-d-d.d.d.d/d0d0d0d0d0d1d1d1d2d2d2d3d3d4d4d5d5d6d6d7d7d8d8d8d9d9d9d9d9d9d:d:d:d;d;d;d<d<d<d<d<d<d=d=d=d>d>d>d>d>d?d?d?d?d?d?d@d@d@d@d@d@dAdAdAdAdAdAdBdBdBdBdBdCdCdCdCdCdCdCdDdDdDdDdDdDdDdDdEdEdEdEdEdFdFdFdFdFdFdGdGdHdIdIdIdJdJdJdJdJdJdJdJdJdJdJdJdKdLdMdNdNdOdOdPdQdQdRdRdRdRdSdSdSdTdUdUdUdUdVdVdVdWdWdWdXdYdYdYdYdYdZdZd[d[d\d\d]d]d^d_d`d`d`dadadadadadadbdcdcdUd+d-ddd��FZdeS)fa< Encoding Aliases Support

    This module is used by the encodings package search function to
    map encodings names to module names.

    Note that the search function normalizes the encoding names before
    doing the lookup, so the mapping will have to map normalized
    encoding names to module names.

    Contents:

        The following aliases dictionary contains mappings of all IANA
        character set names for which the Python core library provides
        codecs. In addition to these, a few Python specific codec
        aliases have also been added.

�ascii�base64_codec�big5�	big5hkscs�	bz2_codec�cp037�cp1026�cp1125�cp1140�cp1250�cp1251�cp1252�cp1253�cp1254�cp1255�cp1256�cp1257�cp1258�cp273�cp424�cp437�cp500�cp775�cp850�cp852�cp855�cp857�cp858�cp860�cp861�cp862�cp863�cp864�cp865�cp866�cp869�cp932�cp949�cp950�euc_jis_2004�euc_jisx0213�euc_jp�euc_kr�gb18030�gb2312�gbk�	hex_codec�	hp_roman8�hz�
iso2022_jp�iso2022_jp_1�iso2022_jp_2�iso2022_jp_2004�iso2022_jp_3�iso2022_jp_ext�
iso2022_kr�
iso8859_10�
iso8859_11�
iso8859_13�
iso8859_14�
iso8859_15�
iso8859_16�	iso8859_2�	iso8859_3�	iso8859_4�	iso8859_5�	iso8859_6�	iso8859_7�	iso8859_8�	iso8859_9�johab�koi8_r�kz1048�latin_1�mac_cyrillic�	mac_greek�mac_iceland�
mac_latin2�	mac_roman�mac_turkish�mbcs�ptcp154�quopri_codec�rot_13�	shift_jis�shift_jis_2004�shift_jisx0213�tactis�tis_620�utf_16�	utf_16_be�	utf_16_le�utf_32�	utf_32_be�	utf_32_le�utf_7�utf_8�uu_codec�
zlib_codec(F�646zansi_x3.4_1968�ansi_x3_4_1968zansi_x3.4_1986�cp367�csascii�ibm367�	iso646_usziso_646.irv_1991�iso_ir_6�us�us_ascii�base64�base_64�big5_tw�csbig5�
big5_hkscs�hkscs�bz2�037�csibm037�ebcdic_cp_ca�ebcdic_cp_nl�ebcdic_cp_us�ebcdic_cp_wt�ibm037�ibm039�1026�	csibm1026�ibm1026�1125�ibm1125�cp866u�ruscii�1140�ibm1140�1250�windows_1250�1251�windows_1251�1252�windows_1252�1253�windows_1253�1254�windows_1254�1255�windows_1255�1256�windows_1256�1257�windows_1257�1258�windows_1258�273�ibm273�csibm273�424�csibm424�ebcdic_cp_he�ibm424�437�cspc8codepage437�ibm437�500�csibm500�ebcdic_cp_be�ebcdic_cp_ch�ibm500�775�
cspc775baltic�ibm775�850�cspc850multilingual�ibm850�852�cspcp852�ibm852�855�csibm855�ibm855�857�csibm857�ibm857�858�csibm858�ibm858�860�csibm860�ibm860�861�cp_is�csibm861�ibm861�862�cspc862latinhebrew�ibm862�863�csibm863�ibm863�864�csibm864�ibm864�865�csibm865�ibm865�866�csibm866�ibm866�869�cp_gr�csibm869�ibm869�932�ms932�mskanji�ms_kanji�949�ms949�uhc�950�ms950�jisx0213�
eucjis2004�euc_jis2004�eucjisx0213�eucjp�ujis�u_jis�euckr�korean�ksc5601�	ks_c_5601�ks_c_5601_1987�ksx1001�	ks_x_1001�gb18030_2000�chinese�csiso58gb231280�euc_cn�euccn�eucgb2312_cn�gb2312_1980�	gb2312_80�	iso_ir_58�936�cp936�ms936�hex�roman8�r8�
csHPRoman8�cp1051�ibm1051�hzgb�hz_gb�
hz_gb_2312�csiso2022jp�	iso2022jp�iso_2022_jp�iso2022jp_1�
iso_2022_jp_1�iso2022jp_2�
iso_2022_jp_2�iso_2022_jp_2004�iso2022jp_2004�iso2022jp_3�
iso_2022_jp_3�
iso2022jp_ext�iso_2022_jp_ext�csiso2022kr�	iso2022kr�iso_2022_kr�csisolatin6�iso_8859_10�iso_8859_10_1992�
iso_ir_157�l6�latin6�thai�iso_8859_11�iso_8859_11_2001�iso_8859_13�l7�latin7�iso_8859_14�iso_8859_14_1998�
iso_celtic�
iso_ir_199�l8�latin8�iso_8859_15�l9�latin9�iso_8859_16�iso_8859_16_2001�
iso_ir_226�l10�latin10�csisolatin2�
iso_8859_2�iso_8859_2_1987�
iso_ir_101�l2�latin2�csisolatin3�
iso_8859_3�iso_8859_3_1988�
iso_ir_109�l3�latin3�csisolatin4�
iso_8859_4�iso_8859_4_1988�
iso_ir_110�l4�latin4�csisolatincyrillic�cyrillic�
iso_8859_5�iso_8859_5_1988�
iso_ir_144�arabic�asmo_708�csisolatinarabic�ecma_114�
iso_8859_6�iso_8859_6_1987�
iso_ir_127�csisolatingreek�ecma_118�elot_928�greek�greek8�
iso_8859_7�iso_8859_7_1987�
iso_ir_126�csisolatinhebrew�hebrew�
iso_8859_8�iso_8859_8_1988�
iso_ir_138�csisolatin5�
iso_8859_9�iso_8859_9_1989�
iso_ir_148�l5�latin5�cp1361�ms1361�cskoi8r�kz_1048�rk1048�
strk1048_2002�8859�cp819�csisolatin1�ibm819�iso8859�	iso8859_1�
iso_8859_1�iso_8859_1_1987�
iso_ir_100�l1�latin�latin1�maccyrillic�macgreek�
maciceland�maccentraleurope�	maclatin2�	macintosh�macroman�
macturkish�ansi�dbcs�	csptcp154�pt154�cp154�cyrillic_asian�quopri�quoted_printable�quotedprintable�rot13�
csshiftjis�shiftjis�sjis�s_jis�shiftjis2004�	sjis_2004�
s_jis_2004�
shiftjisx0213�	sjisx0213�
s_jisx0213�tis260�tis620�	tis_620_0�tis_620_2529_0�tis_620_2529_1�
iso_ir_166�u16�utf16�unicodebigunmarked�utf_16be�unicodelittleunmarked�utf_16le�u32�utf32�utf_32be�utf_32le�u7�utf7�unicode_1_1_utf_7�u8�utf�utf8�	utf8_ucs2�	utf8_ucs4�cp65001�uu�zip�zlib�x_mac_japanese�x_mac_korean�x_mac_simp_chinese�x_mac_trad_chineseN)�__doc__�aliases�r�r��)/usr/lib64/python3.8/encodings/aliases.py�<module>s�	�����encodings/__pycache__/mac_turkish.cpython-38.opt-2.pyc000064400000004434151153537620016643 0ustar00U

e5d�4�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�-/usr/lib64/python3.8/encodings/mac_turkish.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nzmac-turkish)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ)
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp1257.cpython-38.opt-1.pyc000064400000004632151153537620015252 0ustar00U

e5d>4�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zv Python Character Mapping Codec cp1257 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1257.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1257.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1257)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€￾‚￾„…†‡￾‰￾‹￾¨ˇ¸￾‘’“”•–—￾™￾›￾¯˛￾ ￾¢£¤￾¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp1026.cpython-38.opt-2.pyc000064400000004366151153537620015251 0ustar00U

e5d93�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1026.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1026)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�œ	†—Ž
…‡’€‚ƒ„
ˆ‰Š‹Œ‘“”•–˜™š›ž  âäàáãå{ñÇ.<(+!&éêëèíîïìßĞİ*);^-/ÂÄÀÁÃÅ[Ñş,%_>?øÉÊËÈÍÎÏÌı:ÖŞ'=ÜØabcdefghi«»}`¦±°jklmnopqrªºæ¸Æ¤µöstuvwxyz¡¿]$@®¢£¥·©§¶¼½¾¬|¯¨´×çABCDEFGHI­ô~òóõğJKLMNOPQR¹û\ùúÿü÷STUVWXYZ²Ô#ÒÓÕ0123456789³Û"Ùڟ)
rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/iso8859_4.cpython-38.pyc000064400000004567151153537620014754 0ustar00U

e5d@4�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zj Python Character Mapping Codec iso8859_4 generated from 'MAPPINGS/ISO8859/8859-4.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/iso8859_4.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	iso8859-4)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤Ĩϧ¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩšēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖרŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp852.cpython-38.opt-2.pyc000064400000017133151153537620015173 0ustar00U

e5d���@sfddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�Ze�ed��Z	e	�
dddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�d�d�dd��d�d�d�d�d�ddod(d-�dd�d �d!d�d"d0d/d��d#�d$�d%�d&�d'�d(�d)�d*�d+�d,d#�d-�d.�d/�d0dd^�d1�d2�d3d9�d4�d5dq�d6�d7d��d8�d9�d:�d;�d<�d=�d>�d?�d@�dAd�dB�dC�dD�dE�dF�dGdd{�dH�dId�d�dJdd|d�dK�dL�dM�dNd�dO�dPd=�dQ�dR�dSd�d1d"d2�dT�dUd�dVdx�dW�dX�dY�dZd~dEdD�d[de�d\dd>�d]�d^�d_�d`db�dadfdpd)�dbd��dc�dd�de�df��ZdS(g�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp852.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp852)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$�����������o����B���P�Q���y������9�:����=�>�Z�[�����d�e�A���
����������}�~����z��_���%�%�%�%�$%�����^�c%�Q%�W%�]%�{�|�%�%�4%�,%�%�%�<%���Z%�T%�i%�f%�`%�P%�l%��������G������%�%�%�%�b�n�%�������C�D�H�`�a�T���U�p����c������������������q�X�Y�%�)���������������������������������r����ru��r�r���rTrPr���r����r����r���rU�����r[r\��r4����r&��r6��ry��r|r}��������r�r���r?rD����r���r@r���r���rFr)��r*����r-��r(��r/��rGr2��������rHr9�r:r���rI�r'r���u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�(rr�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwrxryrzr�rur�r�rTrPr�r�r�r�rUr[r\r4r&r6ryr|r}r�r�r?rDr�r@r�r�rFr)r*r-r(r/rGr2rHr9r:r�rIr'r�rlrmrJrKr5r,rRrErxrzrwrvrNrOr]r~r7r8r;r<rCr.r�r�r{r�r0r1r�r�r�r�r=r>r^rSr�r�r�r�rArBr�r+r�r�r3rQrcrdrLrMr�r�r�r�r�rjrYr�rerfrrirZrhrgrkrsr`rorarnrbrrr_rqrprtr�r�r�rVrWrXr�)
rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s"
����encodings/__pycache__/cp1140.cpython-38.pyc000064400000004556151153537620014307 0ustar00U

e5d13�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zf Python Character Mapping Codec cp1140 generated from 'python-mappings/CP1140.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1140.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1140)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�œ	†—Ž
…‡’€‚ƒ„
ˆ‰Š‹Œ‘“”•–˜™š›ž  âäàáãåçñ¢.<(+|&éêëèíîïìß!$*);¬-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ`:#@'="Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ€µ~stuvwxyz¡¿ÐÝÞ®^£¥·©§¶¼½¾[]¯¨´×{ABCDEFGHI­ôöòóõ}JKLMNOPQR¹ûüùúÿ\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙڟ)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/euc_jisx0213.cpython-38.opt-1.pyc000064400000002623151153537620016446 0ustar00U

e5d�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�euc_jisx0213c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�./usr/lib64/python3.8/encodings/euc_jisx0213.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_jprZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/cp424.cpython-38.opt-2.pyc000064400000004433151153537620015165 0ustar00U

e5d/�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp424.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp424)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�œ	†—Ž
…‡’€‚ƒ„
ˆ‰Š‹Œ‘“”•–˜™š›ž אבגדהוזחט¢.<(+|&יךכלםמןנס!$*);¬-/עףפץצקרש¦,%_>?￾ת￾￾ ￾￾￾‗`:#@'="￾abcdefghi«»￾￾￾±°jklmnopqr￾￾￾¸￾¤µ~stuvwxyz￾￾￾￾￾®^£¥·©§¶¼½¾[]¯¨´×{ABCDEFGHI­￾￾￾￾￾}JKLMNOPQR¹￾￾￾￾￾\÷STUVWXYZ²￾￾￾￾￾0123456789³￾￾￾￾Ÿ)
rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp424.cpython-38.opt-1.pyc000064400000004626151153537620015170 0ustar00U

e5d/�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zj Python Character Mapping Codec cp424 generated from 'MAPPINGS/VENDORS/MISC/CP424.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp424.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp424)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�œ	†—Ž
…‡’€‚ƒ„
ˆ‰Š‹Œ‘“”•–˜™š›ž אבגדהוזחט¢.<(+|&יךכלםמןנס!$*);¬-/עףפץצקרש¦,%_>?￾ת￾￾ ￾￾￾‗`:#@'="￾abcdefghi«»￾￾￾±°jklmnopqr￾￾￾¸￾¤µ~stuvwxyz￾￾￾￾￾®^£¥·©§¶¼½¾[]¯¨´×{ABCDEFGHI­￾￾￾￾￾}JKLMNOPQR¹￾￾￾￾￾\÷STUVWXYZ²￾￾￾￾￾0123456789³￾￾￾￾Ÿ)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/iso8859_7.cpython-38.pyc000064400000004577151153537620014760 0ustar00U

e5d,2�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zj Python Character Mapping Codec iso8859_7 generated from 'MAPPINGS/ISO8859/8859-7.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/iso8859_7.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	iso8859-7)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­￾―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ￾ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ￾)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/mac_croatian.cpython-38.pyc000064400000004646151153537620016017 0ustar00U

e5dA5�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zu Python Character Mapping Codec mac_croatian generated from 'MAPPINGS/VENDORS/APPLE/CROATIAN.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�./usr/lib64/python3.8/encodings/mac_croatian.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nzmac-croatian)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/quopri_codec.cpython-38.opt-1.pyc000064400000004470151153537620017005 0ustar00U

e5d��@s�dZddlZddlZddlmZddd�Zddd�ZGd	d
�d
ej�ZGdd�dej�ZGd
d�dej	�Z	Gdd�deej
�Z
Gdd�deej�Zdd�ZdS)zQCodec for quoted-printable encoding.

This codec de/encodes from bytes to bytes.
�N)�BytesIO�strictcCs.t|�}t�}tj||dd�|��t|�fS)NT)Z	quotetabs)r�quopri�encode�getvalue�len��input�errors�f�g�r
�./usr/lib64/python3.8/encodings/quopri_codec.py�
quopri_encode
srcCs*t|�}t�}t�||�|��t|�fS�N)rr�decoderrrr
r
r�
quopri_decodesrc@s eZdZddd�Zddd�ZdS)	�CodecrcCs
t||�Sr)r��selfr	r
r
r
rrszCodec.encodecCs
t||�Sr)rrr
r
rrszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrr
r
r
rrs
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst||j�dS�Nr)rr
�rr	�finalr
r
rrszIncrementalEncoder.encodeN)F)rrrrr
r
r
rrsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst||j�dSr)rr
rr
r
rr#szIncrementalDecoder.decodeN)F)rrrrr
r
r
rr"src@seZdZeZdS)�StreamWriterN�rrr�bytes�charbuffertyper
r
r
rr&src@seZdZeZdS)�StreamReaderNrr
r
r
rr")sr"c
Cstjdttttttdd�S)NrF)�namerr�incrementalencoder�incrementaldecoder�streamwriter�streamreader�_is_text_encoding)�codecs�	CodecInforrrrrr"r
r
r
r�getregentry.s�r+)r)r)
�__doc__r)r�iorrrrrrrr"r+r
r
r
r�<module>s

encodings/__pycache__/iso2022_jp_2004.cpython-38.opt-2.pyc000064400000002636151153537620016572 0ustar00U

e5d1�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�iso2022_jp_2004c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�1/usr/lib64/python3.8/encodings/iso2022_jp_2004.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z_codecs_iso2022rZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/__init__.cpython-38.pyc000064400000007501151153537620015127 0ustar00U

e5d��@s�dZddlZddlZddlmZiZdZdgZejZGdd�de	e
�Zd	d
�Zdd�Z
e�e
�ejd
kr|dd�Ze�e�dS)a2 Standard "encodings" Package

    Standard Python encoding modules are stored in this package
    directory.

    Codec modules must have names corresponding to normalized encoding
    names as defined in the normalize_encoding() function below, e.g.
    'utf-8' must be implemented by the module 'utf_8.py'.

    Each codec module must export the following interface:

    * getregentry() -> codecs.CodecInfo object
    The getregentry() API must return a CodecInfo object with encoder, decoder,
    incrementalencoder, incrementaldecoder, streamwriter and streamreader
    attributes which adhere to the Python Codec Interface Standard.

    In addition, a module may optionally also define the following
    APIs which are then used by the package's codec search function:

    * getaliases() -> sequence of encoding name strings to use as aliases

    Alias names returned by getaliases() must be normalized encoding
    names as defined by normalize_encoding().

Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

�N�)�aliasesz--unknown--�*c@seZdZdS)�CodecRegistryErrorN)�__name__�
__module__�__qualname__�r	r	�*/usr/lib64/python3.8/encodings/__init__.pyr(srcCsft|t�rt|d�}g}d}|D]:}|��s4|dkrV|rF|rF|�d�|�|�d}q d}q d�|�S)ae Normalize an encoding name.

        Normalization works as follows: all non-alphanumeric
        characters except the dot used for Python package names are
        collapsed and replaced with a single underscore, e.g. '  -;#'
        becomes '_'. Leading and trailing underscores are removed.

        Note that encoding names should be ASCII only.

    �asciiF�.�_T�)�
isinstance�bytes�str�isalnum�append�join)�encoding�chars�punct�cr	r	r
�normalize_encoding+s



rc
	Csvt�|t�}|tk	r|St|�}t�|�p:t�|�dd��}|dk	rN||g}n|g}|D]B}|rXd|krjqXztd|tdd�}Wntk
r�YqXXq�qXd}z
|j	}Wnt
k
r�d}YnX|dkr�dt|<dS|�}t|tj
��s(dt|�k�rdk�sntd|j|jf��t|d��r�t|d	��r�|d
dk	�rVt|d
��r�|ddk	�rrt|d��r�t|�dk�r�|ddk	�r�t|d��r�t|�dk�r�|ddk	�r�t|d��s�td
|j|jf��t|�dk�s�|ddk�r|ddt|�|j�dd	�d	f7}tj
|�}|t|<z|��}Wnt
k
�rRYn X|D]}	|	tk�rX|t|	<�qX|S)Nrr
z
encodings.r)�fromlist�level��z#module "%s" (%s) failed to registerr���z'incompatible codecs in module "%s" (%s)�)N)�_cache�get�_unknownr�_aliases�replace�
__import__�_import_tail�ImportError�getregentry�AttributeErrorr�codecs�	CodecInfo�lenrr�__file__�callable�split�
getaliases)
r�entry�
norm_encoding�aliased_encoding�modnames�modname�modr*�codecaliases�aliasr	r	r
�search_functionFs�	
��
�



�
�
�
�
�
�
�
�
�
�
�
�(

r;Zwin32cCsNz4ddl}d|��}||kr2ddl}|j��WSWntk
rHYnXdS)Nrzcp%s)�_winapiZGetACPZencodings.mbcs�mbcsr*r))rr<Zansi_code_pageZ	encodingsr	r	r
�_alias_mbcs�sr>)�__doc__r,�sysrrr"r$r(r%�LookupError�SystemErrorrrr;�register�platformr>r	r	r	r
�<module>sU

encodings/__pycache__/bz2_codec.cpython-38.opt-1.pyc000064400000006202151153537620016156 0ustar00U

e5d��@s�dZddlZddlZddd�Zddd�ZGdd	�d	ej�ZGd
d�dej�ZGdd
�d
ej�ZGdd�deej�ZGdd�deej	�Z	dd�Z
dS)aPython 'bz2_codec' Codec - bz2 compression encoding.

This codec de/encodes from bytes to bytes and is therefore usable with
bytes.transform() and bytes.untransform().

Adapted by Raymond Hettinger from zlib_codec.py which was written
by Marc-Andre Lemburg (mal@lemburg.com).
�N�strictcCst�|�t|�fS�N)�bz2�compress�len��input�errors�r
�+/usr/lib64/python3.8/encodings/bz2_codec.py�
bz2_encodesrcCst�|�t|�fSr)r�
decompressrrr
r
r�
bz2_decodesrc@s eZdZddd�Zddd�ZdS)	�CodecrcCs
t||�Sr)r��selfrr	r
r
r�encodeszCodec.encodecCs
t||�Sr)rrr
r
r�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrr
r
r
rrs
rc@s(eZdZd
dd�Zddd�Zdd�Zd	S)�IncrementalEncoderrcCs||_t��|_dSr)r	r�
BZ2Compressor�compressobj�rr	r
r
r�__init__szIncrementalEncoder.__init__FcCs.|r|j�|�}||j��S|j�|�SdSr)rr�flush)rr�final�cr
r
rr#szIncrementalEncoder.encodecCst��|_dSr)rrr�rr
r
r�reset*szIncrementalEncoder.resetN)r)F)rrrrrr r
r
r
rrs

rc@s(eZdZd
dd�Zddd�Zdd�Zd	S)�IncrementalDecoderrcCs||_t��|_dSr)r	r�BZ2Decompressor�
decompressobjrr
r
rr.szIncrementalDecoder.__init__FcCs*z|j�|�WStk
r$YdSXdS)N�)r#r
�EOFError)rrrr
r
rr3szIncrementalDecoder.decodecCst��|_dSr)rr"r#rr
r
rr 9szIncrementalDecoder.resetN)r)F)rrrrrr r
r
r
rr!-s

r!c@seZdZeZdS)�StreamWriterN�rrr�bytes�charbuffertyper
r
r
rr&<sr&c@seZdZeZdS)�StreamReaderNr'r
r
r
rr*?sr*c
Cstjdttttttdd�S)NrF)�namerr�incrementalencoder�incrementaldecoder�streamwriter�streamreader�_is_text_encoding)�codecs�	CodecInforrrr!r&r*r
r
r
r�getregentryDs�r3)r)r)�__doc__r1rrrrrr!r&r*r3r
r
r
r�<module>s	

encodings/__pycache__/iso8859_1.cpython-38.opt-2.pyc000064400000004374151153537620015705 0ustar00U

e5dx3�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/iso8859_1.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	iso8859-1)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ)
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/utf_7.cpython-38.pyc000064400000003045151153537620014413 0ustar00U

e5d��@spdZddlZejZddd�ZGdd�dej�ZGdd	�d	ej�ZGd
d�dej�ZGdd
�d
ej	�Z	dd�Z
dS)zF Python 'utf-7' Codec

Written by Brian Quinlan (brian@sweetapp.com).
�N�strictcCst�||d�S)NT)�codecs�utf_7_decode)�input�errors�r�'/usr/lib64/python3.8/encodings/utf_7.py�decodesr	c@seZdZddd�ZdS)�IncrementalEncoderFcCst�||j�dS)Nr)r�utf_7_encoder)�selfr�finalrrr�encodeszIncrementalEncoder.encodeN)F)�__name__�
__module__�__qualname__rrrrrr
sr
c@seZdZejZdS)�IncrementalDecoderN)rrrrr�_buffer_decoderrrrrsrc@seZdZejZdS)�StreamWriterN)rrrrrrrrrrrsrc@seZdZejZdS)�StreamReaderN)rrrrrr	rrrrrsrc	Cstjdttttttd�S)Nzutf-7)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)r�	CodecInforr	r
rrrrrrr�getregentrys�r)r)�__doc__rrrr	r
�BufferedIncrementalDecoderrrrrrrrr�<module>s
encodings/__pycache__/iso8859_6.cpython-38.opt-1.pyc000064400000004644151153537620015711 0ustar00U

e5dQ*�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zj Python Character Mapping Codec iso8859_6 generated from 'MAPPINGS/ISO8859/8859-6.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/iso8859_6.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	iso8859-6)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ￾￾￾¤￾￾￾￾￾￾￾،­￾￾￾￾￾￾￾￾￾￾￾￾￾؛￾￾￾؟￾ءآأؤإئابةتثجحخدذرزسشصضطظعغ￾￾￾￾￾ـفقكلمنهوىيًٌٍَُِّْ￾￾￾￾￾￾￾￾￾￾￾￾￾)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/iso8859_8.cpython-38.pyc000064400000004636151153537620014755 0ustar00U

e5d+�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zj Python Character Mapping Codec iso8859_8 generated from 'MAPPINGS/ISO8859/8859-8.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/iso8859_8.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	iso8859-8)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ￾¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾￾‗אבגדהוזחטיךכלםמןנסעףפץצקרשת￾￾‎‏￾)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp866.cpython-38.opt-2.pyc000064400000017574151153537620015211 0ustar00U

e5d\��@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�Ze�ed��Z	e	�
dddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d �d!�d"�d#�d$�d%�d&�d'�d(�d)�d*�d+�d,�d-�d.�d/�d0�d1�d2�d3�d4�d5�d6�d7d��d8�d9�d:d��d;�d<�d=�d>�d?�d@�dA�dB�dC�dD�dE�dF�dG�dH�dI�dJ�dK�dL�dM�dN�dO�dP�dQ�dR�dS�dT�dU�dV�dW�dX�dY�dZ�d[�d\�d]�d^�d_�d`�da�db�dc�dd�de�df�dg�dh�di�dj�dk�dl�dmd��dn�do�dp�dq�dr�ds�dt�du�dv�dw�dx�dy�dz�d{�d|�d}�d~�d�d��d��d��d��d��d��d��d��d�d��d��d��d��d���ZdS(��Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp866.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp866)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$������������������ �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�%�%�%�%�$%�a%�b%�V%�U%�c%�Q%�W%�]%�\%�[%�%�%�4%�,%�%�%�<%�^%�_%�Z%�T%�i%�f%�`%�P%�l%�g%�h%�d%�e%�Y%�X%�R%�S%�k%�j%�%�%�%�%�%�%�%�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O��Q��T��W��^��"��"�!��%�)���������������������������������r����r������������r�������r����������������������������������������������������������������������������������������������������������������������������u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r!rrrrrrrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrr	r
rrr
rrrrrrrrrrrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r�r�rr�r�r (rr"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmrnrorprqrrrsrtrurvrwrxryrzr{r|r}r~rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rjrYr�rerfrrirZrhrgrkrsr`r{r|ror^r]rarzryrnrdrcrbrlrmrrr[r\r_rwrxrqrurvrpr~r}rtr�r�r�r�r�rVrWrXr�)
rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s"
����encodings/__pycache__/cp720.cpython-38.pyc000064400000004731151153537620014225 0ustar00U

e5dv5�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)z�Python Character Mapping Codec cp720 generated on Windows:
Vista 6.0.6002 SP2 Multiprocessor Free with the command:
  python Tools/unicode/genwincodec.py 720
�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp720.py�encode
szCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
rs
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)NZcp720)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry#s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€éâ„à†çêëèïّْô¤ـûùءآأؤ£إئابةتثجحخدذرزسشص«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ضطظعغفµقكلمنهوىي≡ًٌٍَُِ≈°∙·√ⁿ²■ )�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/iso8859_15.cpython-38.opt-2.pyc000064400000004377151153537620015775 0ustar00U

e5d�3�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�,/usr/lib64/python3.8/encodings/iso8859_15.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz
iso8859-15)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ)
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/charmap.cpython-38.pyc000064400000005515151153537620015006 0ustar00U

e5d$�@svdZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdS)a Generic Python Character Mapping Codec.

    Use this codec directly rather than through the automatic
    conversion mechanisms supplied by unicode() and .encode().


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

�Nc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codecs�charmap_encode�encode�charmap_decode�decode�rr�)/usr/lib64/python3.8/encodings/charmap.pyrsrc@s eZdZddd�Zd	dd�ZdS)
�IncrementalEncoder�strictNcCstj�||�||_dS�N)rr
�__init__�mapping��self�errorsrrrrrszIncrementalEncoder.__init__FcCst�||j|j�dS�Nr)rrrr�r�input�finalrrrrszIncrementalEncoder.encode)rN)F�rrrrrrrrrr
s
r
c@s eZdZddd�Zd	dd�ZdS)
�IncrementalDecoderrNcCstj�||�||_dSr)rrrrrrrrr!szIncrementalDecoder.__init__FcCst�||j|j�dSr)rr	rrrrrrr
%szIncrementalDecoder.decode)rN)F�rrrrr
rrrrr s
rc@s eZdZddd�Zddd�ZdS)	�StreamWriterrNcCstj�|||�||_dSr)rrrr�r�streamrrrrrr*szStreamWriter.__init__cCst�|||j�Sr)rrr�rrrrrrr.szStreamWriter.encode)rN)rrrrrrr(s
rc@s eZdZddd�Zddd�ZdS)	�StreamReaderrNcCstj�|||�||_dSr)rr rrrrrrr3szStreamReader.__init__cCst�|||j�Sr)rr
rrrrrr
7szStreamReader.decode)rN)rrrrrrr 1s
r c	Cstjdtjtjttttd�S)N�charmap)�namerr
�incrementalencoder�incrementaldecoder�streamwriter�streamreader)	r�	CodecInforrr
r
rrr rrrr�getregentry<s�r()�__doc__rrr
rrr r(rrrr�<module>s	encodings/__pycache__/mac_greek.cpython-38.pyc000064400000004614151153537620015307 0ustar00U

e5d�5�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zo Python Character Mapping Codec mac_greek generated from 'MAPPINGS/VENDORS/APPLE/GREEK.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/mac_greek.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	mac-greek)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ­)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/iso8859_6.cpython-38.opt-2.pyc000064400000004451151153537620015706 0ustar00U

e5dQ*�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/iso8859_6.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	iso8859-6)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ￾￾￾¤￾￾￾￾￾￾￾،­￾￾￾￾￾￾￾￾￾￾￾￾￾؛￾￾￾؟￾ءآأؤإئابةتثجحخدذرزسشصضطظعغ￾￾￾￾￾ـفقكلمنهوىيًٌٍَُِّْ￾￾￾￾￾￾￾￾￾￾￾￾￾)
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/latin_1.cpython-38.opt-1.pyc000064400000003547151153537620015664 0ustar00U

e5d��@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�ZGd
d�dee�Zdd�ZdS)z� Python 'latin-1' Codec


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

�Nc@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codecs�latin_1_encode�encode�latin_1_decode�decode�rr�)/usr/lib64/python3.8/encodings/latin_1.pyr
src@seZdZddd�ZdS)�IncrementalEncoderFcCst�||j�dS�Nr)rr�errors��self�input�finalrrrrszIncrementalEncoder.encodeN)F)rrrrrrrrr
sr
c@seZdZddd�ZdS)�IncrementalDecoderFcCst�||j�dSr)rr	rrrrrr
szIncrementalDecoder.decodeN)F)rrrr
rrrrrsrc@seZdZdS)�StreamWriterN�rrrrrrrrsrc@seZdZdS)�StreamReaderNrrrrrrsrc@seZdZejZejZdS)�StreamConverterN)rrrrr	rrr
rrrrr"src	Cstjdtjtjttttd�S)Nz	iso8859-1)�namerr
�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrr
r
rrrrrrr�getregentry)s�r)	�__doc__rrr
rrrrrrrrr�<module>sencodings/__pycache__/utf_16_le.cpython-38.pyc000064400000003164151153537620015155 0ustar00U

e5d
�@spdZddlZejZddd�ZGdd�dej�ZGdd	�d	ej�ZGd
d�dej�ZGdd
�d
ej	�Z	dd�Z
dS)z� Python 'utf-16-le' Codec


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

�N�strictcCst�||d�S)NT)�codecs�utf_16_le_decode)�input�errors�r�+/usr/lib64/python3.8/encodings/utf_16_le.py�decodesr	c@seZdZddd�ZdS)�IncrementalEncoderFcCst�||j�dS)Nr)r�utf_16_le_encoder)�selfr�finalrrr�encodeszIncrementalEncoder.encodeN)F)�__name__�
__module__�__qualname__rrrrrr
sr
c@seZdZejZdS)�IncrementalDecoderN)rrrrr�_buffer_decoderrrrrsrc@seZdZejZdS)�StreamWriterN)rrrrrrrrrrrsrc@seZdZejZdS)�StreamReaderN)rrrrrr	rrrrrsrc	Cstjdttttttd�S)Nz	utf-16-le)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)r�	CodecInforr	r
rrrrrrr�getregentry!s�r)r)�__doc__rrrr	r
�BufferedIncrementalDecoderrrrrrrrr�<module>s
encodings/__pycache__/shift_jis_2004.cpython-38.opt-2.pyc000064400000002627151153537620016763 0ustar00U

e5d#�@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�shift_jis_2004c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�0/usr/lib64/python3.8/encodings/shift_jis_2004.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_jprZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/mac_farsi.cpython-38.opt-2.pyc000064400000004344151153537620016256 0ustar00U

e5dB;�@s�ddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd	�d	eej�ZGd
d�deej�Zdd
�ZdZe�e�Z	dS)�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�+/usr/lib64/python3.8/encodings/mac_farsi.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz	mac-farsi)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#uh	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Ä ÇÉÑÖÜáàâäں«çéèêëí…îïñó»ôö÷úùûü !"#$٪&'()*+،-./۰۱۲۳۴۵۶۷۸۹:؛<=>؟❊ءآأؤإئابةتثجحخدذرزسشصضطظعغ[\]^_ـفقكلمنهوىيًٌٍَُِّْپٹچەڤگڈڑ{|}ژے)
rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp273.cpython-38.pyc000064400000004552151153537620014231 0ustar00U

e5d47�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zd Python Character Mapping Codec cp273 generated from 'python-mappings/CP273.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp273.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp273)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�œ	†—Ž
…‡’€‚ƒ„
ˆ‰Š‹Œ‘“”•–˜™š›ž  â{àáãåçñÄ.<(+!&éêëèíîïì~Ü$*);^-/Â[ÀÁÃÅÇÑö,%_>?øÉÊËÈÍÎÏÌ`:#§'="Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µßstuvwxyz¡¿ÐÝÞ®¢£¥·©@¶¼½¾¬|‾¨´×äABCDEFGHI­ô¦òóõüJKLMNOPQR¹û}ùúÿÖ÷STUVWXYZ²Ô\ÒÓÕ0123456789³Û]Ùڟ)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/idna.cpython-38.pyc000064400000012753151153537620014310 0ustar00U

e5d�#�@s�ddlZddlZddlZddlmZe�d�ZdZdZdd�Z	dd	�Z
d
d�ZGdd
�d
ej�ZGdd�dej
�ZGdd�dej�ZGdd�deej�ZGdd�deej�Zdd�ZdS)�N)�	ucd_3_2_0u[.。.。]sxn--zxn--cCs�g}|D] }t�|�rq|�t�|��qd�|�}t�d|�}|D]j}t�|�s�t�|�s�t�	|�s�t�
|�s�t�|�s�t�|�s�t�
|�s�t�|�s�t�|�rDtd|��qDdd�|D�}t|�r�tdd�|D��r�td��|d	r�|d
s�td��|S)N��NFKCzInvalid character %rcSsg|]}t�|��qS�)�
stringprepZin_table_d1��.0�xrr�&/usr/lib64/python3.8/encodings/idna.py�
<listcomp>)sznameprep.<locals>.<listcomp>css|]}t�|�VqdS)N)rZin_table_d2rrrr
�	<genexpr>1sznameprep.<locals>.<genexpr>zViolation of BIDI requirement 2r���zViolation of BIDI requirement 3)rZin_table_b1�appendZmap_table_b2�join�unicodedata�	normalizeZin_table_c12Zin_table_c22Zin_table_c3Zin_table_c4Zin_table_c5Zin_table_c6Zin_table_c7Zin_table_c8Zin_table_c9�UnicodeError�any)�labelZnewlabel�cZRandALrrr
�nameprepsB


��������	rcCs�z|�d�}Wntk
r"Yn*Xdt|�kr<dkrDnn|Std��t|�}z|�d�}Wntk
rvYn*Xdt|�kr�dkr�nn|Std��|�t�r�td��|�d�}t|}dt|�kr�dkr�nn|Std��dS)N�asciir�@�label empty or too longzLabel starts with ACE prefix�punycode)�encoder�lenr�
startswith�sace_prefix�
ace_prefix)rrrr
�ToASCII<s,

r cCs�t|t�rd}n,z|�d�}d}Wntk
r:d}YnX|stt|�}z|�d�}Wntk
rrtd��YnX|�t�s�t|d�S|tt�d�}|�	d�}t
|�}t|d���t|d�kr�td||��|S)NTrFzInvalid character in IDN labelrzIDNA does not round-trip)�
isinstance�bytesrrrrr�strr�decoder �lower)rZ
pure_asciiZlabel1�resultZlabel2rrr
�	ToUnicodegs*





r'c@s eZdZddd�Zddd�ZdS)	�Codec�strictcCs|dkrtd|��|sdSz|�d�}Wntk
r>YndX|�d�}|dd�D]&}dt|�krrdksVntd	��qVt|d�dkr�td
��|t|�fSt�}t�|�}|r�|ds�d}|d=nd}|D] }|r�|�d�|�t|��q�t	||�t|�fS)Nr)�unsupported error handling ��rr�.r
rrrzlabel too longr,)
rr�UnicodeEncodeError�splitr�	bytearray�dots�extendr r")�self�input�errorsr&�labelsr�trailing_dotrrr
r�s4



zCodec.encodecCs�|dkrtd|��|sdSt|t�s.t|�}t|kr`z|�d�t|�fWStk
r^YnX|�d�}|r�t|d�dkr�d}|d=nd	}g}|D]}|�t	|��q�d�
|�|t|�fS)
Nr)�Unsupported error handling �rrrr-r
r�.r)rr!r"rr$r�UnicodeDecodeErrorr/rr'r)r3r4r5r6r7r&rrrr
r$�s(

zCodec.decodeN)r))r))�__name__�
__module__�__qualname__rr$rrrr
r(�s
%r(c@seZdZdd�ZdS)�IncrementalEncoderc	Cs�|dkrtd|��|sdSt�|�}d}|rT|dsBd}|d=n|sT|d=|rTd}t�}d}|D]4}|r||�d�|d7}|�t|��|t|�7}qb||7}|t|�7}t|�|fS)	Nr)r*r+r,r
r-r�)rr1r/r0r2r rr"�	r3r4r5�finalr6r7r&�sizerrrr
�_buffer_encode�s2

z!IncrementalEncoder._buffer_encodeN)r<r=r>rDrrrr
r?�sr?c@seZdZdd�ZdS)�IncrementalDecoderc	Cs�|dkrtd|��|sdSt|t�r2t�|�}nt|d�}|�d�}d}|rt|dsbd}|d=n|st|d=|rtd}g}d}|D]*}|�t|��|r�|d	7}|t|�7}q�d�|�|}|t|�7}||fS)
Nr)r8r9rr:rr
rr@)	rr!r#r1r/rr'rrrArrr
�_buffer_decode�s6


z!IncrementalDecoder._buffer_decodeN)r<r=r>rFrrrr
rE�srEc@seZdZdS)�StreamWriterN�r<r=r>rrrr
rG"srGc@seZdZdS)�StreamReaderNrHrrrr
rI%srIc	Cs tjdt�jt�jttttd�S)NZidna)�namerr$�incrementalencoder�incrementaldecoder�streamwriter�streamreader)	�codecs�	CodecInfor(rr$r?rErGrIrrrr
�getregentry*s�rQ)r�rerOrr�compiler1rrrr r'r(�BufferedIncrementalEncoderr?�BufferedIncrementalDecoderrErGrIrQrrrr
�<module>s
.+)H#'encodings/__pycache__/mac_romanian.cpython-38.pyc000064400000004647151153537620016024 0ustar00U

e5d]5�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zu Python Character Mapping Codec mac_romanian generated from 'MAPPINGS/VENDORS/APPLE/ROMANIAN.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�./usr/lib64/python3.8/encodings/mac_romanian.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nzmac-romanian)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/mac_latin2.cpython-38.pyc000064400000005054151153537620015402 0ustar00U

e5d&7�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)a Python Character Mapping Codec mac_latin2 generated from 'MAPPINGS/VENDORS/MICSFT/MAC/LATIN2.TXT' with gencodec.py.

Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
(c) Copyright 2000 Guido van Rossum.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�,/usr/lib64/python3.8/encodings/mac_latin2.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
rs
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
r!src	Cs tjdt�jt�jttttd�S)Nz
mac-latin2)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry&s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s	�encodings/__pycache__/cp1252.cpython-38.opt-1.pyc000064400000004623151153537620015245 0ustar00U

e5d�4�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zv Python Character Mapping Codec cp1252 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1252.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1252.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1252)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€￾‚ƒ„…†‡ˆ‰Š‹Œ￾Ž￾￾‘’“”•–—˜™š›œ￾žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/palmos.cpython-38.pyc000064400000004623151153537620014665 0ustar00U

e5d�4�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zx Python Character Mapping Codec for PalmOS 3.5.

Written by Sjoerd Mullender (sjoerd@acm.org); based on iso8859_15.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/palmos.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
rs
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)NZpalmos)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry"s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹Œ♦♣♥♠‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/iso8859_15.cpython-38.opt-1.pyc000064400000004574151153537620015773 0ustar00U

e5d�3�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zl Python Character Mapping Codec iso8859_15 generated from 'MAPPINGS/ISO8859/8859-15.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�,/usr/lib64/python3.8/encodings/iso8859_15.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)Nz
iso8859-15)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r#u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ)�__doc__rrrrrrr#r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp860.cpython-38.opt-1.pyc000064400000017223151153537620015171 0ustar00U

e5dy��@sRdZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�Ze�e	d��Z
e
�ddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzd{d|d}d~dd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d����d�Zdd�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d�d��d�d�d�d�d�d�d�d�d�d	�d
�d�d�d
�d�d�d�d�d�d�d�d�dd6�dd4�d�dd3�d�dd:d>�d�d�d�d�d �d!�d"�d#�d$�d%�d&�d'�d(�d)�d*�d+�d,�d-�d.d0�d/d��d0�d1�d2�d3�d4�d5�d6d=�d7�d8d+�d9�d:�d;�d<d,�d=dd�d>ddd�d?�d@d�dAdd1d�dBd'�dCd�dDd��dEd2d%d#d$�dF�dGd&d8d!d-d�dHdd�dIdd7d)�dJd �dKd�d?dd/d"�dLd;d<�dMdd(dv�dN�dOd5d9�dP�dQ�dRd�dS�dT�dUdqd*�dV�dW�dXd�d�d��dY�dZ��Z
dS([z` Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP860.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_map��self�input�errors�r�'/usr/lib64/python3.8/encodings/cp860.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp860)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$������������������������������������������������������� �������������������������%�%�%�%�$%�a%�b%�V%�U%�c%�Q%�W%�]%�\%�[%�%�%�4%�,%�%�%�<%�^%�_%�Z%�T%�i%�f%�`%�P%�l%�g%�h%�d%�e%�Y%�X%�R%�S%�k%�j%�%�%�%�%�%�%�%����������������"����)"�a"��e"�d"� #�!#��H"��"��"� ��%�)���������������������������������r�rSrArB������rLrTrP���r�r�r���r��r���rMrUrRrQ�rNr7r,r5r4������r&r8r6r/��r>r1������rKrOrEr2r?������rCr<��r@����r�r+rFr)r*������r-r0r(r.��r3rG������rJr;rHr9r:�r��r=rI�r'���u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ���������	�
���
������������������� �!�"�#�$�%�&�'�(�)�*�+�,�-�.�/�0�1�2�3�4�5�6�7�8�9�:�;�<�=�>�?�@�A�B�C�D�E�F�G�H�I�J�K�L�M�N�O�P�Q�R�S�T�U�V�W�X�Y�Z�[�\�]�^�_�`�a�b�c�d�e�f�g�h�i�j�k�l�m�n�o�p�q�r�s�t�u�v�w�x�y�z�{�|�}�~�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�(rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrrrrr	r
rrr
rrrrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErFrGrHrIrJrKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr[r\r]r^r_r`rarbrcrdrerfrgrhrirjrkrlrmr�rSrArBrLrTrPr�r�r�r�r�rMrUrRrQrNr7r,r5r4r&r8r6r/r>r1rKrOrEr2r?rCr<r@r�r+rFr)r*r-r0r(r.r3rGrJr;rHr9r:r�r=rIr'r�r�r�r�r�r�r�r�r�r�r�r�r�rDr�r�r�r�r�r�r�r�r�r�rjrYr�rerfrrirZrhrgrkrsr`r{r|ror^r]rarzryrnrdrcrbrlrmrrr[r\r_rwrxrqrurvrpr~r}rtr�r�r�r�r�rVrWrXr�)�__doc__rrrrrrr$�make_identity_dict�range�decoding_map�updaterrrrrr
�<module>s$
����encodings/__pycache__/cp1252.cpython-38.pyc000064400000004623151153537620014306 0ustar00U

e5d�4�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zv Python Character Mapping Codec cp1252 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1252.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1252.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1252)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€￾‚ƒ„…†‡ˆ‰Š‹Œ￾Ž￾￾‘’“”•–—˜™š›œ￾žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/__pycache__/cp950.cpython-38.pyc000064400000002605151153537620014230 0ustar00U

e5d��@s�ddlZddlZddlZe�d�ZGdd�dej�ZGdd�dejej�ZGdd�dej	ej
�Z
Gd	d
�d
eejej�ZGdd�deej
ej�Zd
d�ZdS)�N�cp950c@seZdZejZejZdS)�CodecN)�__name__�
__module__�__qualname__�codec�encode�decode�r
r
�'/usr/lib64/python3.8/encodings/cp950.pyrsrc@seZdZeZdS)�IncrementalEncoderN�rrrrr
r
r
rrsrc@seZdZeZdS)�IncrementalDecoderNr
r
r
r
rrsrc@seZdZeZdS)�StreamReaderNr
r
r
r
rrsrc@seZdZeZdS)�StreamWriterNr
r
r
r
rrsrc	Cs tjdt�jt�jttttd�S)Nr)�namerr	�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	�codecs�	CodecInforrr	rrrrr
r
r
r�getregentrys�r)Z
_codecs_twrZ_multibytecodecZmbcZgetcodecrrZMultibyteIncrementalEncoderrZMultibyteIncrementalDecoderrZMultibyteStreamReaderrZMultibyteStreamWriterrrr
r
r
r�<module>s
��encodings/__pycache__/cp1251.cpython-38.pyc000064400000004620151153537620014302 0ustar00U

e5d14�@s�dZddlZGdd�dej�ZGdd�dej�ZGdd�dej�ZGd	d
�d
eej�ZGdd�deej�Zd
d�ZdZe�	e�Z
dS)zv Python Character Mapping Codec cp1251 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1251.TXT' with gencodec.py.

�Nc@s eZdZddd�Zddd�ZdS)	�Codec�strictcCst�||t�S�N)�codecs�charmap_encode�encoding_table��self�input�errors�r�(/usr/lib64/python3.8/encodings/cp1251.py�encodeszCodec.encodecCst�||t�Sr)r�charmap_decode�decoding_tablerrrr
�decodeszCodec.decodeN)r)r)�__name__�
__module__�__qualname__rrrrrr
r	s
rc@seZdZddd�ZdS)�IncrementalEncoderFcCst�||jt�dS�Nr)rrrr�r	r
�finalrrr
rszIncrementalEncoder.encodeN)F)rrrrrrrr
rsrc@seZdZddd�ZdS)�IncrementalDecoderFcCst�||jt�dSr)rrrrrrrr
rszIncrementalDecoder.decodeN)F)rrrrrrrr
rsrc@seZdZdS)�StreamWriterN�rrrrrrr
rsrc@seZdZdS)�StreamReaderNrrrrr
rsrc	Cs tjdt�jt�jttttd�S)N�cp1251)�namerr�incrementalencoder�incrementaldecoder�streamreader�streamwriter)	r�	CodecInforrrrrrrrrrr
�getregentry!s�r$u�	

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—￾™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя)�__doc__rrrrrrr$r�
charmap_buildrrrrr
�<module>s�encodings/shift_jisx0213.py000064400000002043151153537620011556 0ustar00#
# shift_jisx0213.py: Python Unicode Codec for SHIFT_JISX0213
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#

import _codecs_jp, codecs
import _multibytecodec as mbc

codec = _codecs_jp.getcodec('shift_jisx0213')

class Codec(codecs.Codec):
    encode = codec.encode
    decode = codec.decode

class IncrementalEncoder(mbc.MultibyteIncrementalEncoder,
                         codecs.IncrementalEncoder):
    codec = codec

class IncrementalDecoder(mbc.MultibyteIncrementalDecoder,
                         codecs.IncrementalDecoder):
    codec = codec

class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader):
    codec = codec

class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
    codec = codec

def getregentry():
    return codecs.CodecInfo(
        name='shift_jisx0213',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/euc_jis_2004.py000064400000002033151153537620011163 0ustar00#
# euc_jis_2004.py: Python Unicode Codec for EUC_JIS_2004
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#

import _codecs_jp, codecs
import _multibytecodec as mbc

codec = _codecs_jp.getcodec('euc_jis_2004')

class Codec(codecs.Codec):
    encode = codec.encode
    decode = codec.decode

class IncrementalEncoder(mbc.MultibyteIncrementalEncoder,
                         codecs.IncrementalEncoder):
    codec = codec

class IncrementalDecoder(mbc.MultibyteIncrementalDecoder,
                         codecs.IncrementalDecoder):
    codec = codec

class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader):
    codec = codec

class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
    codec = codec

def getregentry():
    return codecs.CodecInfo(
        name='euc_jis_2004',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/utf_32_le.py000064400000001642151153537620010664 0ustar00"""
Python 'utf-32-le' Codec
"""
import codecs

### Codec APIs

encode = codecs.utf_32_le_encode

def decode(input, errors='strict'):
    return codecs.utf_32_le_decode(input, errors, True)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.utf_32_le_encode(input, self.errors)[0]

class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
    _buffer_decode = codecs.utf_32_le_decode

class StreamWriter(codecs.StreamWriter):
    encode = codecs.utf_32_le_encode

class StreamReader(codecs.StreamReader):
    decode = codecs.utf_32_le_decode

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='utf-32-le',
        encode=encode,
        decode=decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/iso8859_5.py000064400000031327151153537620010461 0ustar00""" Python Character Mapping Codec iso8859_5 generated from 'MAPPINGS/ISO8859/8859-5.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='iso8859-5',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\x80'     #  0x80 -> <control>
    '\x81'     #  0x81 -> <control>
    '\x82'     #  0x82 -> <control>
    '\x83'     #  0x83 -> <control>
    '\x84'     #  0x84 -> <control>
    '\x85'     #  0x85 -> <control>
    '\x86'     #  0x86 -> <control>
    '\x87'     #  0x87 -> <control>
    '\x88'     #  0x88 -> <control>
    '\x89'     #  0x89 -> <control>
    '\x8a'     #  0x8A -> <control>
    '\x8b'     #  0x8B -> <control>
    '\x8c'     #  0x8C -> <control>
    '\x8d'     #  0x8D -> <control>
    '\x8e'     #  0x8E -> <control>
    '\x8f'     #  0x8F -> <control>
    '\x90'     #  0x90 -> <control>
    '\x91'     #  0x91 -> <control>
    '\x92'     #  0x92 -> <control>
    '\x93'     #  0x93 -> <control>
    '\x94'     #  0x94 -> <control>
    '\x95'     #  0x95 -> <control>
    '\x96'     #  0x96 -> <control>
    '\x97'     #  0x97 -> <control>
    '\x98'     #  0x98 -> <control>
    '\x99'     #  0x99 -> <control>
    '\x9a'     #  0x9A -> <control>
    '\x9b'     #  0x9B -> <control>
    '\x9c'     #  0x9C -> <control>
    '\x9d'     #  0x9D -> <control>
    '\x9e'     #  0x9E -> <control>
    '\x9f'     #  0x9F -> <control>
    '\xa0'     #  0xA0 -> NO-BREAK SPACE
    '\u0401'   #  0xA1 -> CYRILLIC CAPITAL LETTER IO
    '\u0402'   #  0xA2 -> CYRILLIC CAPITAL LETTER DJE
    '\u0403'   #  0xA3 -> CYRILLIC CAPITAL LETTER GJE
    '\u0404'   #  0xA4 -> CYRILLIC CAPITAL LETTER UKRAINIAN IE
    '\u0405'   #  0xA5 -> CYRILLIC CAPITAL LETTER DZE
    '\u0406'   #  0xA6 -> CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
    '\u0407'   #  0xA7 -> CYRILLIC CAPITAL LETTER YI
    '\u0408'   #  0xA8 -> CYRILLIC CAPITAL LETTER JE
    '\u0409'   #  0xA9 -> CYRILLIC CAPITAL LETTER LJE
    '\u040a'   #  0xAA -> CYRILLIC CAPITAL LETTER NJE
    '\u040b'   #  0xAB -> CYRILLIC CAPITAL LETTER TSHE
    '\u040c'   #  0xAC -> CYRILLIC CAPITAL LETTER KJE
    '\xad'     #  0xAD -> SOFT HYPHEN
    '\u040e'   #  0xAE -> CYRILLIC CAPITAL LETTER SHORT U
    '\u040f'   #  0xAF -> CYRILLIC CAPITAL LETTER DZHE
    '\u0410'   #  0xB0 -> CYRILLIC CAPITAL LETTER A
    '\u0411'   #  0xB1 -> CYRILLIC CAPITAL LETTER BE
    '\u0412'   #  0xB2 -> CYRILLIC CAPITAL LETTER VE
    '\u0413'   #  0xB3 -> CYRILLIC CAPITAL LETTER GHE
    '\u0414'   #  0xB4 -> CYRILLIC CAPITAL LETTER DE
    '\u0415'   #  0xB5 -> CYRILLIC CAPITAL LETTER IE
    '\u0416'   #  0xB6 -> CYRILLIC CAPITAL LETTER ZHE
    '\u0417'   #  0xB7 -> CYRILLIC CAPITAL LETTER ZE
    '\u0418'   #  0xB8 -> CYRILLIC CAPITAL LETTER I
    '\u0419'   #  0xB9 -> CYRILLIC CAPITAL LETTER SHORT I
    '\u041a'   #  0xBA -> CYRILLIC CAPITAL LETTER KA
    '\u041b'   #  0xBB -> CYRILLIC CAPITAL LETTER EL
    '\u041c'   #  0xBC -> CYRILLIC CAPITAL LETTER EM
    '\u041d'   #  0xBD -> CYRILLIC CAPITAL LETTER EN
    '\u041e'   #  0xBE -> CYRILLIC CAPITAL LETTER O
    '\u041f'   #  0xBF -> CYRILLIC CAPITAL LETTER PE
    '\u0420'   #  0xC0 -> CYRILLIC CAPITAL LETTER ER
    '\u0421'   #  0xC1 -> CYRILLIC CAPITAL LETTER ES
    '\u0422'   #  0xC2 -> CYRILLIC CAPITAL LETTER TE
    '\u0423'   #  0xC3 -> CYRILLIC CAPITAL LETTER U
    '\u0424'   #  0xC4 -> CYRILLIC CAPITAL LETTER EF
    '\u0425'   #  0xC5 -> CYRILLIC CAPITAL LETTER HA
    '\u0426'   #  0xC6 -> CYRILLIC CAPITAL LETTER TSE
    '\u0427'   #  0xC7 -> CYRILLIC CAPITAL LETTER CHE
    '\u0428'   #  0xC8 -> CYRILLIC CAPITAL LETTER SHA
    '\u0429'   #  0xC9 -> CYRILLIC CAPITAL LETTER SHCHA
    '\u042a'   #  0xCA -> CYRILLIC CAPITAL LETTER HARD SIGN
    '\u042b'   #  0xCB -> CYRILLIC CAPITAL LETTER YERU
    '\u042c'   #  0xCC -> CYRILLIC CAPITAL LETTER SOFT SIGN
    '\u042d'   #  0xCD -> CYRILLIC CAPITAL LETTER E
    '\u042e'   #  0xCE -> CYRILLIC CAPITAL LETTER YU
    '\u042f'   #  0xCF -> CYRILLIC CAPITAL LETTER YA
    '\u0430'   #  0xD0 -> CYRILLIC SMALL LETTER A
    '\u0431'   #  0xD1 -> CYRILLIC SMALL LETTER BE
    '\u0432'   #  0xD2 -> CYRILLIC SMALL LETTER VE
    '\u0433'   #  0xD3 -> CYRILLIC SMALL LETTER GHE
    '\u0434'   #  0xD4 -> CYRILLIC SMALL LETTER DE
    '\u0435'   #  0xD5 -> CYRILLIC SMALL LETTER IE
    '\u0436'   #  0xD6 -> CYRILLIC SMALL LETTER ZHE
    '\u0437'   #  0xD7 -> CYRILLIC SMALL LETTER ZE
    '\u0438'   #  0xD8 -> CYRILLIC SMALL LETTER I
    '\u0439'   #  0xD9 -> CYRILLIC SMALL LETTER SHORT I
    '\u043a'   #  0xDA -> CYRILLIC SMALL LETTER KA
    '\u043b'   #  0xDB -> CYRILLIC SMALL LETTER EL
    '\u043c'   #  0xDC -> CYRILLIC SMALL LETTER EM
    '\u043d'   #  0xDD -> CYRILLIC SMALL LETTER EN
    '\u043e'   #  0xDE -> CYRILLIC SMALL LETTER O
    '\u043f'   #  0xDF -> CYRILLIC SMALL LETTER PE
    '\u0440'   #  0xE0 -> CYRILLIC SMALL LETTER ER
    '\u0441'   #  0xE1 -> CYRILLIC SMALL LETTER ES
    '\u0442'   #  0xE2 -> CYRILLIC SMALL LETTER TE
    '\u0443'   #  0xE3 -> CYRILLIC SMALL LETTER U
    '\u0444'   #  0xE4 -> CYRILLIC SMALL LETTER EF
    '\u0445'   #  0xE5 -> CYRILLIC SMALL LETTER HA
    '\u0446'   #  0xE6 -> CYRILLIC SMALL LETTER TSE
    '\u0447'   #  0xE7 -> CYRILLIC SMALL LETTER CHE
    '\u0448'   #  0xE8 -> CYRILLIC SMALL LETTER SHA
    '\u0449'   #  0xE9 -> CYRILLIC SMALL LETTER SHCHA
    '\u044a'   #  0xEA -> CYRILLIC SMALL LETTER HARD SIGN
    '\u044b'   #  0xEB -> CYRILLIC SMALL LETTER YERU
    '\u044c'   #  0xEC -> CYRILLIC SMALL LETTER SOFT SIGN
    '\u044d'   #  0xED -> CYRILLIC SMALL LETTER E
    '\u044e'   #  0xEE -> CYRILLIC SMALL LETTER YU
    '\u044f'   #  0xEF -> CYRILLIC SMALL LETTER YA
    '\u2116'   #  0xF0 -> NUMERO SIGN
    '\u0451'   #  0xF1 -> CYRILLIC SMALL LETTER IO
    '\u0452'   #  0xF2 -> CYRILLIC SMALL LETTER DJE
    '\u0453'   #  0xF3 -> CYRILLIC SMALL LETTER GJE
    '\u0454'   #  0xF4 -> CYRILLIC SMALL LETTER UKRAINIAN IE
    '\u0455'   #  0xF5 -> CYRILLIC SMALL LETTER DZE
    '\u0456'   #  0xF6 -> CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
    '\u0457'   #  0xF7 -> CYRILLIC SMALL LETTER YI
    '\u0458'   #  0xF8 -> CYRILLIC SMALL LETTER JE
    '\u0459'   #  0xF9 -> CYRILLIC SMALL LETTER LJE
    '\u045a'   #  0xFA -> CYRILLIC SMALL LETTER NJE
    '\u045b'   #  0xFB -> CYRILLIC SMALL LETTER TSHE
    '\u045c'   #  0xFC -> CYRILLIC SMALL LETTER KJE
    '\xa7'     #  0xFD -> SECTION SIGN
    '\u045e'   #  0xFE -> CYRILLIC SMALL LETTER SHORT U
    '\u045f'   #  0xFF -> CYRILLIC SMALL LETTER DZHE
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/cp1251.py000064400000032061151153537620010014 0ustar00""" Python Character Mapping Codec cp1251 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1251.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp1251',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\u0402'   #  0x80 -> CYRILLIC CAPITAL LETTER DJE
    '\u0403'   #  0x81 -> CYRILLIC CAPITAL LETTER GJE
    '\u201a'   #  0x82 -> SINGLE LOW-9 QUOTATION MARK
    '\u0453'   #  0x83 -> CYRILLIC SMALL LETTER GJE
    '\u201e'   #  0x84 -> DOUBLE LOW-9 QUOTATION MARK
    '\u2026'   #  0x85 -> HORIZONTAL ELLIPSIS
    '\u2020'   #  0x86 -> DAGGER
    '\u2021'   #  0x87 -> DOUBLE DAGGER
    '\u20ac'   #  0x88 -> EURO SIGN
    '\u2030'   #  0x89 -> PER MILLE SIGN
    '\u0409'   #  0x8A -> CYRILLIC CAPITAL LETTER LJE
    '\u2039'   #  0x8B -> SINGLE LEFT-POINTING ANGLE QUOTATION MARK
    '\u040a'   #  0x8C -> CYRILLIC CAPITAL LETTER NJE
    '\u040c'   #  0x8D -> CYRILLIC CAPITAL LETTER KJE
    '\u040b'   #  0x8E -> CYRILLIC CAPITAL LETTER TSHE
    '\u040f'   #  0x8F -> CYRILLIC CAPITAL LETTER DZHE
    '\u0452'   #  0x90 -> CYRILLIC SMALL LETTER DJE
    '\u2018'   #  0x91 -> LEFT SINGLE QUOTATION MARK
    '\u2019'   #  0x92 -> RIGHT SINGLE QUOTATION MARK
    '\u201c'   #  0x93 -> LEFT DOUBLE QUOTATION MARK
    '\u201d'   #  0x94 -> RIGHT DOUBLE QUOTATION MARK
    '\u2022'   #  0x95 -> BULLET
    '\u2013'   #  0x96 -> EN DASH
    '\u2014'   #  0x97 -> EM DASH
    '\ufffe'   #  0x98 -> UNDEFINED
    '\u2122'   #  0x99 -> TRADE MARK SIGN
    '\u0459'   #  0x9A -> CYRILLIC SMALL LETTER LJE
    '\u203a'   #  0x9B -> SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
    '\u045a'   #  0x9C -> CYRILLIC SMALL LETTER NJE
    '\u045c'   #  0x9D -> CYRILLIC SMALL LETTER KJE
    '\u045b'   #  0x9E -> CYRILLIC SMALL LETTER TSHE
    '\u045f'   #  0x9F -> CYRILLIC SMALL LETTER DZHE
    '\xa0'     #  0xA0 -> NO-BREAK SPACE
    '\u040e'   #  0xA1 -> CYRILLIC CAPITAL LETTER SHORT U
    '\u045e'   #  0xA2 -> CYRILLIC SMALL LETTER SHORT U
    '\u0408'   #  0xA3 -> CYRILLIC CAPITAL LETTER JE
    '\xa4'     #  0xA4 -> CURRENCY SIGN
    '\u0490'   #  0xA5 -> CYRILLIC CAPITAL LETTER GHE WITH UPTURN
    '\xa6'     #  0xA6 -> BROKEN BAR
    '\xa7'     #  0xA7 -> SECTION SIGN
    '\u0401'   #  0xA8 -> CYRILLIC CAPITAL LETTER IO
    '\xa9'     #  0xA9 -> COPYRIGHT SIGN
    '\u0404'   #  0xAA -> CYRILLIC CAPITAL LETTER UKRAINIAN IE
    '\xab'     #  0xAB -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xac'     #  0xAC -> NOT SIGN
    '\xad'     #  0xAD -> SOFT HYPHEN
    '\xae'     #  0xAE -> REGISTERED SIGN
    '\u0407'   #  0xAF -> CYRILLIC CAPITAL LETTER YI
    '\xb0'     #  0xB0 -> DEGREE SIGN
    '\xb1'     #  0xB1 -> PLUS-MINUS SIGN
    '\u0406'   #  0xB2 -> CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
    '\u0456'   #  0xB3 -> CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
    '\u0491'   #  0xB4 -> CYRILLIC SMALL LETTER GHE WITH UPTURN
    '\xb5'     #  0xB5 -> MICRO SIGN
    '\xb6'     #  0xB6 -> PILCROW SIGN
    '\xb7'     #  0xB7 -> MIDDLE DOT
    '\u0451'   #  0xB8 -> CYRILLIC SMALL LETTER IO
    '\u2116'   #  0xB9 -> NUMERO SIGN
    '\u0454'   #  0xBA -> CYRILLIC SMALL LETTER UKRAINIAN IE
    '\xbb'     #  0xBB -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u0458'   #  0xBC -> CYRILLIC SMALL LETTER JE
    '\u0405'   #  0xBD -> CYRILLIC CAPITAL LETTER DZE
    '\u0455'   #  0xBE -> CYRILLIC SMALL LETTER DZE
    '\u0457'   #  0xBF -> CYRILLIC SMALL LETTER YI
    '\u0410'   #  0xC0 -> CYRILLIC CAPITAL LETTER A
    '\u0411'   #  0xC1 -> CYRILLIC CAPITAL LETTER BE
    '\u0412'   #  0xC2 -> CYRILLIC CAPITAL LETTER VE
    '\u0413'   #  0xC3 -> CYRILLIC CAPITAL LETTER GHE
    '\u0414'   #  0xC4 -> CYRILLIC CAPITAL LETTER DE
    '\u0415'   #  0xC5 -> CYRILLIC CAPITAL LETTER IE
    '\u0416'   #  0xC6 -> CYRILLIC CAPITAL LETTER ZHE
    '\u0417'   #  0xC7 -> CYRILLIC CAPITAL LETTER ZE
    '\u0418'   #  0xC8 -> CYRILLIC CAPITAL LETTER I
    '\u0419'   #  0xC9 -> CYRILLIC CAPITAL LETTER SHORT I
    '\u041a'   #  0xCA -> CYRILLIC CAPITAL LETTER KA
    '\u041b'   #  0xCB -> CYRILLIC CAPITAL LETTER EL
    '\u041c'   #  0xCC -> CYRILLIC CAPITAL LETTER EM
    '\u041d'   #  0xCD -> CYRILLIC CAPITAL LETTER EN
    '\u041e'   #  0xCE -> CYRILLIC CAPITAL LETTER O
    '\u041f'   #  0xCF -> CYRILLIC CAPITAL LETTER PE
    '\u0420'   #  0xD0 -> CYRILLIC CAPITAL LETTER ER
    '\u0421'   #  0xD1 -> CYRILLIC CAPITAL LETTER ES
    '\u0422'   #  0xD2 -> CYRILLIC CAPITAL LETTER TE
    '\u0423'   #  0xD3 -> CYRILLIC CAPITAL LETTER U
    '\u0424'   #  0xD4 -> CYRILLIC CAPITAL LETTER EF
    '\u0425'   #  0xD5 -> CYRILLIC CAPITAL LETTER HA
    '\u0426'   #  0xD6 -> CYRILLIC CAPITAL LETTER TSE
    '\u0427'   #  0xD7 -> CYRILLIC CAPITAL LETTER CHE
    '\u0428'   #  0xD8 -> CYRILLIC CAPITAL LETTER SHA
    '\u0429'   #  0xD9 -> CYRILLIC CAPITAL LETTER SHCHA
    '\u042a'   #  0xDA -> CYRILLIC CAPITAL LETTER HARD SIGN
    '\u042b'   #  0xDB -> CYRILLIC CAPITAL LETTER YERU
    '\u042c'   #  0xDC -> CYRILLIC CAPITAL LETTER SOFT SIGN
    '\u042d'   #  0xDD -> CYRILLIC CAPITAL LETTER E
    '\u042e'   #  0xDE -> CYRILLIC CAPITAL LETTER YU
    '\u042f'   #  0xDF -> CYRILLIC CAPITAL LETTER YA
    '\u0430'   #  0xE0 -> CYRILLIC SMALL LETTER A
    '\u0431'   #  0xE1 -> CYRILLIC SMALL LETTER BE
    '\u0432'   #  0xE2 -> CYRILLIC SMALL LETTER VE
    '\u0433'   #  0xE3 -> CYRILLIC SMALL LETTER GHE
    '\u0434'   #  0xE4 -> CYRILLIC SMALL LETTER DE
    '\u0435'   #  0xE5 -> CYRILLIC SMALL LETTER IE
    '\u0436'   #  0xE6 -> CYRILLIC SMALL LETTER ZHE
    '\u0437'   #  0xE7 -> CYRILLIC SMALL LETTER ZE
    '\u0438'   #  0xE8 -> CYRILLIC SMALL LETTER I
    '\u0439'   #  0xE9 -> CYRILLIC SMALL LETTER SHORT I
    '\u043a'   #  0xEA -> CYRILLIC SMALL LETTER KA
    '\u043b'   #  0xEB -> CYRILLIC SMALL LETTER EL
    '\u043c'   #  0xEC -> CYRILLIC SMALL LETTER EM
    '\u043d'   #  0xED -> CYRILLIC SMALL LETTER EN
    '\u043e'   #  0xEE -> CYRILLIC SMALL LETTER O
    '\u043f'   #  0xEF -> CYRILLIC SMALL LETTER PE
    '\u0440'   #  0xF0 -> CYRILLIC SMALL LETTER ER
    '\u0441'   #  0xF1 -> CYRILLIC SMALL LETTER ES
    '\u0442'   #  0xF2 -> CYRILLIC SMALL LETTER TE
    '\u0443'   #  0xF3 -> CYRILLIC SMALL LETTER U
    '\u0444'   #  0xF4 -> CYRILLIC SMALL LETTER EF
    '\u0445'   #  0xF5 -> CYRILLIC SMALL LETTER HA
    '\u0446'   #  0xF6 -> CYRILLIC SMALL LETTER TSE
    '\u0447'   #  0xF7 -> CYRILLIC SMALL LETTER CHE
    '\u0448'   #  0xF8 -> CYRILLIC SMALL LETTER SHA
    '\u0449'   #  0xF9 -> CYRILLIC SMALL LETTER SHCHA
    '\u044a'   #  0xFA -> CYRILLIC SMALL LETTER HARD SIGN
    '\u044b'   #  0xFB -> CYRILLIC SMALL LETTER YERU
    '\u044c'   #  0xFC -> CYRILLIC SMALL LETTER SOFT SIGN
    '\u044d'   #  0xFD -> CYRILLIC SMALL LETTER E
    '\u044e'   #  0xFE -> CYRILLIC SMALL LETTER YU
    '\u044f'   #  0xFF -> CYRILLIC SMALL LETTER YA
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/bz2_codec.py000064400000004311151153537620010730 0ustar00"""Python 'bz2_codec' Codec - bz2 compression encoding.

This codec de/encodes from bytes to bytes and is therefore usable with
bytes.transform() and bytes.untransform().

Adapted by Raymond Hettinger from zlib_codec.py which was written
by Marc-Andre Lemburg (mal@lemburg.com).
"""

import codecs
import bz2 # this codec needs the optional bz2 module !

### Codec APIs

def bz2_encode(input, errors='strict'):
    assert errors == 'strict'
    return (bz2.compress(input), len(input))

def bz2_decode(input, errors='strict'):
    assert errors == 'strict'
    return (bz2.decompress(input), len(input))

class Codec(codecs.Codec):
    def encode(self, input, errors='strict'):
        return bz2_encode(input, errors)
    def decode(self, input, errors='strict'):
        return bz2_decode(input, errors)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def __init__(self, errors='strict'):
        assert errors == 'strict'
        self.errors = errors
        self.compressobj = bz2.BZ2Compressor()

    def encode(self, input, final=False):
        if final:
            c = self.compressobj.compress(input)
            return c + self.compressobj.flush()
        else:
            return self.compressobj.compress(input)

    def reset(self):
        self.compressobj = bz2.BZ2Compressor()

class IncrementalDecoder(codecs.IncrementalDecoder):
    def __init__(self, errors='strict'):
        assert errors == 'strict'
        self.errors = errors
        self.decompressobj = bz2.BZ2Decompressor()

    def decode(self, input, final=False):
        try:
            return self.decompressobj.decompress(input)
        except EOFError:
            return ''

    def reset(self):
        self.decompressobj = bz2.BZ2Decompressor()

class StreamWriter(Codec, codecs.StreamWriter):
    charbuffertype = bytes

class StreamReader(Codec, codecs.StreamReader):
    charbuffertype = bytes

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name="bz2",
        encode=bz2_encode,
        decode=bz2_decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamwriter=StreamWriter,
        streamreader=StreamReader,
        _is_text_encoding=False,
    )
encodings/idna.py000064400000021612151153537620010014 0ustar00# This module implements the RFCs 3490 (IDNA) and 3491 (Nameprep)

import stringprep, re, codecs
from unicodedata import ucd_3_2_0 as unicodedata

# IDNA section 3.1
dots = re.compile("[\u002E\u3002\uFF0E\uFF61]")

# IDNA section 5
ace_prefix = b"xn--"
sace_prefix = "xn--"

# This assumes query strings, so AllowUnassigned is true
def nameprep(label):
    # Map
    newlabel = []
    for c in label:
        if stringprep.in_table_b1(c):
            # Map to nothing
            continue
        newlabel.append(stringprep.map_table_b2(c))
    label = "".join(newlabel)

    # Normalize
    label = unicodedata.normalize("NFKC", label)

    # Prohibit
    for c in label:
        if stringprep.in_table_c12(c) or \
           stringprep.in_table_c22(c) or \
           stringprep.in_table_c3(c) or \
           stringprep.in_table_c4(c) or \
           stringprep.in_table_c5(c) or \
           stringprep.in_table_c6(c) or \
           stringprep.in_table_c7(c) or \
           stringprep.in_table_c8(c) or \
           stringprep.in_table_c9(c):
            raise UnicodeError("Invalid character %r" % c)

    # Check bidi
    RandAL = [stringprep.in_table_d1(x) for x in label]
    if any(RandAL):
        # There is a RandAL char in the string. Must perform further
        # tests:
        # 1) The characters in section 5.8 MUST be prohibited.
        # This is table C.8, which was already checked
        # 2) If a string contains any RandALCat character, the string
        # MUST NOT contain any LCat character.
        if any(stringprep.in_table_d2(x) for x in label):
            raise UnicodeError("Violation of BIDI requirement 2")
        # 3) If a string contains any RandALCat character, a
        # RandALCat character MUST be the first character of the
        # string, and a RandALCat character MUST be the last
        # character of the string.
        if not RandAL[0] or not RandAL[-1]:
            raise UnicodeError("Violation of BIDI requirement 3")

    return label

def ToASCII(label):
    try:
        # Step 1: try ASCII
        label = label.encode("ascii")
    except UnicodeError:
        pass
    else:
        # Skip to step 3: UseSTD3ASCIIRules is false, so
        # Skip to step 8.
        if 0 < len(label) < 64:
            return label
        raise UnicodeError("label empty or too long")

    # Step 2: nameprep
    label = nameprep(label)

    # Step 3: UseSTD3ASCIIRules is false
    # Step 4: try ASCII
    try:
        label = label.encode("ascii")
    except UnicodeError:
        pass
    else:
        # Skip to step 8.
        if 0 < len(label) < 64:
            return label
        raise UnicodeError("label empty or too long")

    # Step 5: Check ACE prefix
    if label.startswith(sace_prefix):
        raise UnicodeError("Label starts with ACE prefix")

    # Step 6: Encode with PUNYCODE
    label = label.encode("punycode")

    # Step 7: Prepend ACE prefix
    label = ace_prefix + label

    # Step 8: Check size
    if 0 < len(label) < 64:
        return label
    raise UnicodeError("label empty or too long")

def ToUnicode(label):
    # Step 1: Check for ASCII
    if isinstance(label, bytes):
        pure_ascii = True
    else:
        try:
            label = label.encode("ascii")
            pure_ascii = True
        except UnicodeError:
            pure_ascii = False
    if not pure_ascii:
        # Step 2: Perform nameprep
        label = nameprep(label)
        # It doesn't say this, but apparently, it should be ASCII now
        try:
            label = label.encode("ascii")
        except UnicodeError:
            raise UnicodeError("Invalid character in IDN label")
    # Step 3: Check for ACE prefix
    if not label.startswith(ace_prefix):
        return str(label, "ascii")

    # Step 4: Remove ACE prefix
    label1 = label[len(ace_prefix):]

    # Step 5: Decode using PUNYCODE
    result = label1.decode("punycode")

    # Step 6: Apply ToASCII
    label2 = ToASCII(result)

    # Step 7: Compare the result of step 6 with the one of step 3
    # label2 will already be in lower case.
    if str(label, "ascii").lower() != str(label2, "ascii"):
        raise UnicodeError("IDNA does not round-trip", label, label2)

    # Step 8: return the result of step 5
    return result

### Codec APIs

class Codec(codecs.Codec):
    def encode(self, input, errors='strict'):

        if errors != 'strict':
            # IDNA is quite clear that implementations must be strict
            raise UnicodeError("unsupported error handling "+errors)

        if not input:
            return b'', 0

        try:
            result = input.encode('ascii')
        except UnicodeEncodeError:
            pass
        else:
            # ASCII name: fast path
            labels = result.split(b'.')
            for label in labels[:-1]:
                if not (0 < len(label) < 64):
                    raise UnicodeError("label empty or too long")
            if len(labels[-1]) >= 64:
                raise UnicodeError("label too long")
            return result, len(input)

        result = bytearray()
        labels = dots.split(input)
        if labels and not labels[-1]:
            trailing_dot = b'.'
            del labels[-1]
        else:
            trailing_dot = b''
        for label in labels:
            if result:
                # Join with U+002E
                result.extend(b'.')
            result.extend(ToASCII(label))
        return bytes(result+trailing_dot), len(input)

    def decode(self, input, errors='strict'):

        if errors != 'strict':
            raise UnicodeError("Unsupported error handling "+errors)

        if not input:
            return "", 0

        # IDNA allows decoding to operate on Unicode strings, too.
        if not isinstance(input, bytes):
            # XXX obviously wrong, see #3232
            input = bytes(input)

        if ace_prefix not in input:
            # Fast path
            try:
                return input.decode('ascii'), len(input)
            except UnicodeDecodeError:
                pass

        labels = input.split(b".")

        if labels and len(labels[-1]) == 0:
            trailing_dot = '.'
            del labels[-1]
        else:
            trailing_dot = ''

        result = []
        for label in labels:
            result.append(ToUnicode(label))

        return ".".join(result)+trailing_dot, len(input)

class IncrementalEncoder(codecs.BufferedIncrementalEncoder):
    def _buffer_encode(self, input, errors, final):
        if errors != 'strict':
            # IDNA is quite clear that implementations must be strict
            raise UnicodeError("unsupported error handling "+errors)

        if not input:
            return (b'', 0)

        labels = dots.split(input)
        trailing_dot = b''
        if labels:
            if not labels[-1]:
                trailing_dot = b'.'
                del labels[-1]
            elif not final:
                # Keep potentially unfinished label until the next call
                del labels[-1]
                if labels:
                    trailing_dot = b'.'

        result = bytearray()
        size = 0
        for label in labels:
            if size:
                # Join with U+002E
                result.extend(b'.')
                size += 1
            result.extend(ToASCII(label))
            size += len(label)

        result += trailing_dot
        size += len(trailing_dot)
        return (bytes(result), size)

class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
    def _buffer_decode(self, input, errors, final):
        if errors != 'strict':
            raise UnicodeError("Unsupported error handling "+errors)

        if not input:
            return ("", 0)

        # IDNA allows decoding to operate on Unicode strings, too.
        if isinstance(input, str):
            labels = dots.split(input)
        else:
            # Must be ASCII string
            input = str(input, "ascii")
            labels = input.split(".")

        trailing_dot = ''
        if labels:
            if not labels[-1]:
                trailing_dot = '.'
                del labels[-1]
            elif not final:
                # Keep potentially unfinished label until the next call
                del labels[-1]
                if labels:
                    trailing_dot = '.'

        result = []
        size = 0
        for label in labels:
            result.append(ToUnicode(label))
            if size:
                size += 1
            size += len(label)

        result = ".".join(result) + trailing_dot
        size += len(trailing_dot)
        return (result, size)

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='idna',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamwriter=StreamWriter,
        streamreader=StreamReader,
    )
encodings/cp1026.py000064400000031471151153537620010020 0ustar00""" Python Character Mapping Codec cp1026 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP1026.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp1026',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x9c'     #  0x04 -> CONTROL
    '\t'       #  0x05 -> HORIZONTAL TABULATION
    '\x86'     #  0x06 -> CONTROL
    '\x7f'     #  0x07 -> DELETE
    '\x97'     #  0x08 -> CONTROL
    '\x8d'     #  0x09 -> CONTROL
    '\x8e'     #  0x0A -> CONTROL
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x9d'     #  0x14 -> CONTROL
    '\x85'     #  0x15 -> CONTROL
    '\x08'     #  0x16 -> BACKSPACE
    '\x87'     #  0x17 -> CONTROL
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x92'     #  0x1A -> CONTROL
    '\x8f'     #  0x1B -> CONTROL
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    '\x80'     #  0x20 -> CONTROL
    '\x81'     #  0x21 -> CONTROL
    '\x82'     #  0x22 -> CONTROL
    '\x83'     #  0x23 -> CONTROL
    '\x84'     #  0x24 -> CONTROL
    '\n'       #  0x25 -> LINE FEED
    '\x17'     #  0x26 -> END OF TRANSMISSION BLOCK
    '\x1b'     #  0x27 -> ESCAPE
    '\x88'     #  0x28 -> CONTROL
    '\x89'     #  0x29 -> CONTROL
    '\x8a'     #  0x2A -> CONTROL
    '\x8b'     #  0x2B -> CONTROL
    '\x8c'     #  0x2C -> CONTROL
    '\x05'     #  0x2D -> ENQUIRY
    '\x06'     #  0x2E -> ACKNOWLEDGE
    '\x07'     #  0x2F -> BELL
    '\x90'     #  0x30 -> CONTROL
    '\x91'     #  0x31 -> CONTROL
    '\x16'     #  0x32 -> SYNCHRONOUS IDLE
    '\x93'     #  0x33 -> CONTROL
    '\x94'     #  0x34 -> CONTROL
    '\x95'     #  0x35 -> CONTROL
    '\x96'     #  0x36 -> CONTROL
    '\x04'     #  0x37 -> END OF TRANSMISSION
    '\x98'     #  0x38 -> CONTROL
    '\x99'     #  0x39 -> CONTROL
    '\x9a'     #  0x3A -> CONTROL
    '\x9b'     #  0x3B -> CONTROL
    '\x14'     #  0x3C -> DEVICE CONTROL FOUR
    '\x15'     #  0x3D -> NEGATIVE ACKNOWLEDGE
    '\x9e'     #  0x3E -> CONTROL
    '\x1a'     #  0x3F -> SUBSTITUTE
    ' '        #  0x40 -> SPACE
    '\xa0'     #  0x41 -> NO-BREAK SPACE
    '\xe2'     #  0x42 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\xe4'     #  0x43 -> LATIN SMALL LETTER A WITH DIAERESIS
    '\xe0'     #  0x44 -> LATIN SMALL LETTER A WITH GRAVE
    '\xe1'     #  0x45 -> LATIN SMALL LETTER A WITH ACUTE
    '\xe3'     #  0x46 -> LATIN SMALL LETTER A WITH TILDE
    '\xe5'     #  0x47 -> LATIN SMALL LETTER A WITH RING ABOVE
    '{'        #  0x48 -> LEFT CURLY BRACKET
    '\xf1'     #  0x49 -> LATIN SMALL LETTER N WITH TILDE
    '\xc7'     #  0x4A -> LATIN CAPITAL LETTER C WITH CEDILLA
    '.'        #  0x4B -> FULL STOP
    '<'        #  0x4C -> LESS-THAN SIGN
    '('        #  0x4D -> LEFT PARENTHESIS
    '+'        #  0x4E -> PLUS SIGN
    '!'        #  0x4F -> EXCLAMATION MARK
    '&'        #  0x50 -> AMPERSAND
    '\xe9'     #  0x51 -> LATIN SMALL LETTER E WITH ACUTE
    '\xea'     #  0x52 -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xeb'     #  0x53 -> LATIN SMALL LETTER E WITH DIAERESIS
    '\xe8'     #  0x54 -> LATIN SMALL LETTER E WITH GRAVE
    '\xed'     #  0x55 -> LATIN SMALL LETTER I WITH ACUTE
    '\xee'     #  0x56 -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\xef'     #  0x57 -> LATIN SMALL LETTER I WITH DIAERESIS
    '\xec'     #  0x58 -> LATIN SMALL LETTER I WITH GRAVE
    '\xdf'     #  0x59 -> LATIN SMALL LETTER SHARP S (GERMAN)
    '\u011e'   #  0x5A -> LATIN CAPITAL LETTER G WITH BREVE
    '\u0130'   #  0x5B -> LATIN CAPITAL LETTER I WITH DOT ABOVE
    '*'        #  0x5C -> ASTERISK
    ')'        #  0x5D -> RIGHT PARENTHESIS
    ';'        #  0x5E -> SEMICOLON
    '^'        #  0x5F -> CIRCUMFLEX ACCENT
    '-'        #  0x60 -> HYPHEN-MINUS
    '/'        #  0x61 -> SOLIDUS
    '\xc2'     #  0x62 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    '\xc4'     #  0x63 -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\xc0'     #  0x64 -> LATIN CAPITAL LETTER A WITH GRAVE
    '\xc1'     #  0x65 -> LATIN CAPITAL LETTER A WITH ACUTE
    '\xc3'     #  0x66 -> LATIN CAPITAL LETTER A WITH TILDE
    '\xc5'     #  0x67 -> LATIN CAPITAL LETTER A WITH RING ABOVE
    '['        #  0x68 -> LEFT SQUARE BRACKET
    '\xd1'     #  0x69 -> LATIN CAPITAL LETTER N WITH TILDE
    '\u015f'   #  0x6A -> LATIN SMALL LETTER S WITH CEDILLA
    ','        #  0x6B -> COMMA
    '%'        #  0x6C -> PERCENT SIGN
    '_'        #  0x6D -> LOW LINE
    '>'        #  0x6E -> GREATER-THAN SIGN
    '?'        #  0x6F -> QUESTION MARK
    '\xf8'     #  0x70 -> LATIN SMALL LETTER O WITH STROKE
    '\xc9'     #  0x71 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\xca'     #  0x72 -> LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    '\xcb'     #  0x73 -> LATIN CAPITAL LETTER E WITH DIAERESIS
    '\xc8'     #  0x74 -> LATIN CAPITAL LETTER E WITH GRAVE
    '\xcd'     #  0x75 -> LATIN CAPITAL LETTER I WITH ACUTE
    '\xce'     #  0x76 -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    '\xcf'     #  0x77 -> LATIN CAPITAL LETTER I WITH DIAERESIS
    '\xcc'     #  0x78 -> LATIN CAPITAL LETTER I WITH GRAVE
    '\u0131'   #  0x79 -> LATIN SMALL LETTER DOTLESS I
    ':'        #  0x7A -> COLON
    '\xd6'     #  0x7B -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\u015e'   #  0x7C -> LATIN CAPITAL LETTER S WITH CEDILLA
    "'"        #  0x7D -> APOSTROPHE
    '='        #  0x7E -> EQUALS SIGN
    '\xdc'     #  0x7F -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\xd8'     #  0x80 -> LATIN CAPITAL LETTER O WITH STROKE
    'a'        #  0x81 -> LATIN SMALL LETTER A
    'b'        #  0x82 -> LATIN SMALL LETTER B
    'c'        #  0x83 -> LATIN SMALL LETTER C
    'd'        #  0x84 -> LATIN SMALL LETTER D
    'e'        #  0x85 -> LATIN SMALL LETTER E
    'f'        #  0x86 -> LATIN SMALL LETTER F
    'g'        #  0x87 -> LATIN SMALL LETTER G
    'h'        #  0x88 -> LATIN SMALL LETTER H
    'i'        #  0x89 -> LATIN SMALL LETTER I
    '\xab'     #  0x8A -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbb'     #  0x8B -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '}'        #  0x8C -> RIGHT CURLY BRACKET
    '`'        #  0x8D -> GRAVE ACCENT
    '\xa6'     #  0x8E -> BROKEN BAR
    '\xb1'     #  0x8F -> PLUS-MINUS SIGN
    '\xb0'     #  0x90 -> DEGREE SIGN
    'j'        #  0x91 -> LATIN SMALL LETTER J
    'k'        #  0x92 -> LATIN SMALL LETTER K
    'l'        #  0x93 -> LATIN SMALL LETTER L
    'm'        #  0x94 -> LATIN SMALL LETTER M
    'n'        #  0x95 -> LATIN SMALL LETTER N
    'o'        #  0x96 -> LATIN SMALL LETTER O
    'p'        #  0x97 -> LATIN SMALL LETTER P
    'q'        #  0x98 -> LATIN SMALL LETTER Q
    'r'        #  0x99 -> LATIN SMALL LETTER R
    '\xaa'     #  0x9A -> FEMININE ORDINAL INDICATOR
    '\xba'     #  0x9B -> MASCULINE ORDINAL INDICATOR
    '\xe6'     #  0x9C -> LATIN SMALL LIGATURE AE
    '\xb8'     #  0x9D -> CEDILLA
    '\xc6'     #  0x9E -> LATIN CAPITAL LIGATURE AE
    '\xa4'     #  0x9F -> CURRENCY SIGN
    '\xb5'     #  0xA0 -> MICRO SIGN
    '\xf6'     #  0xA1 -> LATIN SMALL LETTER O WITH DIAERESIS
    's'        #  0xA2 -> LATIN SMALL LETTER S
    't'        #  0xA3 -> LATIN SMALL LETTER T
    'u'        #  0xA4 -> LATIN SMALL LETTER U
    'v'        #  0xA5 -> LATIN SMALL LETTER V
    'w'        #  0xA6 -> LATIN SMALL LETTER W
    'x'        #  0xA7 -> LATIN SMALL LETTER X
    'y'        #  0xA8 -> LATIN SMALL LETTER Y
    'z'        #  0xA9 -> LATIN SMALL LETTER Z
    '\xa1'     #  0xAA -> INVERTED EXCLAMATION MARK
    '\xbf'     #  0xAB -> INVERTED QUESTION MARK
    ']'        #  0xAC -> RIGHT SQUARE BRACKET
    '$'        #  0xAD -> DOLLAR SIGN
    '@'        #  0xAE -> COMMERCIAL AT
    '\xae'     #  0xAF -> REGISTERED SIGN
    '\xa2'     #  0xB0 -> CENT SIGN
    '\xa3'     #  0xB1 -> POUND SIGN
    '\xa5'     #  0xB2 -> YEN SIGN
    '\xb7'     #  0xB3 -> MIDDLE DOT
    '\xa9'     #  0xB4 -> COPYRIGHT SIGN
    '\xa7'     #  0xB5 -> SECTION SIGN
    '\xb6'     #  0xB6 -> PILCROW SIGN
    '\xbc'     #  0xB7 -> VULGAR FRACTION ONE QUARTER
    '\xbd'     #  0xB8 -> VULGAR FRACTION ONE HALF
    '\xbe'     #  0xB9 -> VULGAR FRACTION THREE QUARTERS
    '\xac'     #  0xBA -> NOT SIGN
    '|'        #  0xBB -> VERTICAL LINE
    '\xaf'     #  0xBC -> MACRON
    '\xa8'     #  0xBD -> DIAERESIS
    '\xb4'     #  0xBE -> ACUTE ACCENT
    '\xd7'     #  0xBF -> MULTIPLICATION SIGN
    '\xe7'     #  0xC0 -> LATIN SMALL LETTER C WITH CEDILLA
    'A'        #  0xC1 -> LATIN CAPITAL LETTER A
    'B'        #  0xC2 -> LATIN CAPITAL LETTER B
    'C'        #  0xC3 -> LATIN CAPITAL LETTER C
    'D'        #  0xC4 -> LATIN CAPITAL LETTER D
    'E'        #  0xC5 -> LATIN CAPITAL LETTER E
    'F'        #  0xC6 -> LATIN CAPITAL LETTER F
    'G'        #  0xC7 -> LATIN CAPITAL LETTER G
    'H'        #  0xC8 -> LATIN CAPITAL LETTER H
    'I'        #  0xC9 -> LATIN CAPITAL LETTER I
    '\xad'     #  0xCA -> SOFT HYPHEN
    '\xf4'     #  0xCB -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '~'        #  0xCC -> TILDE
    '\xf2'     #  0xCD -> LATIN SMALL LETTER O WITH GRAVE
    '\xf3'     #  0xCE -> LATIN SMALL LETTER O WITH ACUTE
    '\xf5'     #  0xCF -> LATIN SMALL LETTER O WITH TILDE
    '\u011f'   #  0xD0 -> LATIN SMALL LETTER G WITH BREVE
    'J'        #  0xD1 -> LATIN CAPITAL LETTER J
    'K'        #  0xD2 -> LATIN CAPITAL LETTER K
    'L'        #  0xD3 -> LATIN CAPITAL LETTER L
    'M'        #  0xD4 -> LATIN CAPITAL LETTER M
    'N'        #  0xD5 -> LATIN CAPITAL LETTER N
    'O'        #  0xD6 -> LATIN CAPITAL LETTER O
    'P'        #  0xD7 -> LATIN CAPITAL LETTER P
    'Q'        #  0xD8 -> LATIN CAPITAL LETTER Q
    'R'        #  0xD9 -> LATIN CAPITAL LETTER R
    '\xb9'     #  0xDA -> SUPERSCRIPT ONE
    '\xfb'     #  0xDB -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\\'       #  0xDC -> REVERSE SOLIDUS
    '\xf9'     #  0xDD -> LATIN SMALL LETTER U WITH GRAVE
    '\xfa'     #  0xDE -> LATIN SMALL LETTER U WITH ACUTE
    '\xff'     #  0xDF -> LATIN SMALL LETTER Y WITH DIAERESIS
    '\xfc'     #  0xE0 -> LATIN SMALL LETTER U WITH DIAERESIS
    '\xf7'     #  0xE1 -> DIVISION SIGN
    'S'        #  0xE2 -> LATIN CAPITAL LETTER S
    'T'        #  0xE3 -> LATIN CAPITAL LETTER T
    'U'        #  0xE4 -> LATIN CAPITAL LETTER U
    'V'        #  0xE5 -> LATIN CAPITAL LETTER V
    'W'        #  0xE6 -> LATIN CAPITAL LETTER W
    'X'        #  0xE7 -> LATIN CAPITAL LETTER X
    'Y'        #  0xE8 -> LATIN CAPITAL LETTER Y
    'Z'        #  0xE9 -> LATIN CAPITAL LETTER Z
    '\xb2'     #  0xEA -> SUPERSCRIPT TWO
    '\xd4'     #  0xEB -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    '#'        #  0xEC -> NUMBER SIGN
    '\xd2'     #  0xED -> LATIN CAPITAL LETTER O WITH GRAVE
    '\xd3'     #  0xEE -> LATIN CAPITAL LETTER O WITH ACUTE
    '\xd5'     #  0xEF -> LATIN CAPITAL LETTER O WITH TILDE
    '0'        #  0xF0 -> DIGIT ZERO
    '1'        #  0xF1 -> DIGIT ONE
    '2'        #  0xF2 -> DIGIT TWO
    '3'        #  0xF3 -> DIGIT THREE
    '4'        #  0xF4 -> DIGIT FOUR
    '5'        #  0xF5 -> DIGIT FIVE
    '6'        #  0xF6 -> DIGIT SIX
    '7'        #  0xF7 -> DIGIT SEVEN
    '8'        #  0xF8 -> DIGIT EIGHT
    '9'        #  0xF9 -> DIGIT NINE
    '\xb3'     #  0xFA -> SUPERSCRIPT THREE
    '\xdb'     #  0xFB -> LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    '"'        #  0xFC -> QUOTATION MARK
    '\xd9'     #  0xFD -> LATIN CAPITAL LETTER U WITH GRAVE
    '\xda'     #  0xFE -> LATIN CAPITAL LETTER U WITH ACUTE
    '\x9f'     #  0xFF -> CONTROL
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/iso8859_10.py000064400000032425151153537620010535 0ustar00""" Python Character Mapping Codec iso8859_10 generated from 'MAPPINGS/ISO8859/8859-10.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='iso8859-10',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\x80'     #  0x80 -> <control>
    '\x81'     #  0x81 -> <control>
    '\x82'     #  0x82 -> <control>
    '\x83'     #  0x83 -> <control>
    '\x84'     #  0x84 -> <control>
    '\x85'     #  0x85 -> <control>
    '\x86'     #  0x86 -> <control>
    '\x87'     #  0x87 -> <control>
    '\x88'     #  0x88 -> <control>
    '\x89'     #  0x89 -> <control>
    '\x8a'     #  0x8A -> <control>
    '\x8b'     #  0x8B -> <control>
    '\x8c'     #  0x8C -> <control>
    '\x8d'     #  0x8D -> <control>
    '\x8e'     #  0x8E -> <control>
    '\x8f'     #  0x8F -> <control>
    '\x90'     #  0x90 -> <control>
    '\x91'     #  0x91 -> <control>
    '\x92'     #  0x92 -> <control>
    '\x93'     #  0x93 -> <control>
    '\x94'     #  0x94 -> <control>
    '\x95'     #  0x95 -> <control>
    '\x96'     #  0x96 -> <control>
    '\x97'     #  0x97 -> <control>
    '\x98'     #  0x98 -> <control>
    '\x99'     #  0x99 -> <control>
    '\x9a'     #  0x9A -> <control>
    '\x9b'     #  0x9B -> <control>
    '\x9c'     #  0x9C -> <control>
    '\x9d'     #  0x9D -> <control>
    '\x9e'     #  0x9E -> <control>
    '\x9f'     #  0x9F -> <control>
    '\xa0'     #  0xA0 -> NO-BREAK SPACE
    '\u0104'   #  0xA1 -> LATIN CAPITAL LETTER A WITH OGONEK
    '\u0112'   #  0xA2 -> LATIN CAPITAL LETTER E WITH MACRON
    '\u0122'   #  0xA3 -> LATIN CAPITAL LETTER G WITH CEDILLA
    '\u012a'   #  0xA4 -> LATIN CAPITAL LETTER I WITH MACRON
    '\u0128'   #  0xA5 -> LATIN CAPITAL LETTER I WITH TILDE
    '\u0136'   #  0xA6 -> LATIN CAPITAL LETTER K WITH CEDILLA
    '\xa7'     #  0xA7 -> SECTION SIGN
    '\u013b'   #  0xA8 -> LATIN CAPITAL LETTER L WITH CEDILLA
    '\u0110'   #  0xA9 -> LATIN CAPITAL LETTER D WITH STROKE
    '\u0160'   #  0xAA -> LATIN CAPITAL LETTER S WITH CARON
    '\u0166'   #  0xAB -> LATIN CAPITAL LETTER T WITH STROKE
    '\u017d'   #  0xAC -> LATIN CAPITAL LETTER Z WITH CARON
    '\xad'     #  0xAD -> SOFT HYPHEN
    '\u016a'   #  0xAE -> LATIN CAPITAL LETTER U WITH MACRON
    '\u014a'   #  0xAF -> LATIN CAPITAL LETTER ENG
    '\xb0'     #  0xB0 -> DEGREE SIGN
    '\u0105'   #  0xB1 -> LATIN SMALL LETTER A WITH OGONEK
    '\u0113'   #  0xB2 -> LATIN SMALL LETTER E WITH MACRON
    '\u0123'   #  0xB3 -> LATIN SMALL LETTER G WITH CEDILLA
    '\u012b'   #  0xB4 -> LATIN SMALL LETTER I WITH MACRON
    '\u0129'   #  0xB5 -> LATIN SMALL LETTER I WITH TILDE
    '\u0137'   #  0xB6 -> LATIN SMALL LETTER K WITH CEDILLA
    '\xb7'     #  0xB7 -> MIDDLE DOT
    '\u013c'   #  0xB8 -> LATIN SMALL LETTER L WITH CEDILLA
    '\u0111'   #  0xB9 -> LATIN SMALL LETTER D WITH STROKE
    '\u0161'   #  0xBA -> LATIN SMALL LETTER S WITH CARON
    '\u0167'   #  0xBB -> LATIN SMALL LETTER T WITH STROKE
    '\u017e'   #  0xBC -> LATIN SMALL LETTER Z WITH CARON
    '\u2015'   #  0xBD -> HORIZONTAL BAR
    '\u016b'   #  0xBE -> LATIN SMALL LETTER U WITH MACRON
    '\u014b'   #  0xBF -> LATIN SMALL LETTER ENG
    '\u0100'   #  0xC0 -> LATIN CAPITAL LETTER A WITH MACRON
    '\xc1'     #  0xC1 -> LATIN CAPITAL LETTER A WITH ACUTE
    '\xc2'     #  0xC2 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    '\xc3'     #  0xC3 -> LATIN CAPITAL LETTER A WITH TILDE
    '\xc4'     #  0xC4 -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\xc5'     #  0xC5 -> LATIN CAPITAL LETTER A WITH RING ABOVE
    '\xc6'     #  0xC6 -> LATIN CAPITAL LETTER AE
    '\u012e'   #  0xC7 -> LATIN CAPITAL LETTER I WITH OGONEK
    '\u010c'   #  0xC8 -> LATIN CAPITAL LETTER C WITH CARON
    '\xc9'     #  0xC9 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\u0118'   #  0xCA -> LATIN CAPITAL LETTER E WITH OGONEK
    '\xcb'     #  0xCB -> LATIN CAPITAL LETTER E WITH DIAERESIS
    '\u0116'   #  0xCC -> LATIN CAPITAL LETTER E WITH DOT ABOVE
    '\xcd'     #  0xCD -> LATIN CAPITAL LETTER I WITH ACUTE
    '\xce'     #  0xCE -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    '\xcf'     #  0xCF -> LATIN CAPITAL LETTER I WITH DIAERESIS
    '\xd0'     #  0xD0 -> LATIN CAPITAL LETTER ETH (Icelandic)
    '\u0145'   #  0xD1 -> LATIN CAPITAL LETTER N WITH CEDILLA
    '\u014c'   #  0xD2 -> LATIN CAPITAL LETTER O WITH MACRON
    '\xd3'     #  0xD3 -> LATIN CAPITAL LETTER O WITH ACUTE
    '\xd4'     #  0xD4 -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    '\xd5'     #  0xD5 -> LATIN CAPITAL LETTER O WITH TILDE
    '\xd6'     #  0xD6 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\u0168'   #  0xD7 -> LATIN CAPITAL LETTER U WITH TILDE
    '\xd8'     #  0xD8 -> LATIN CAPITAL LETTER O WITH STROKE
    '\u0172'   #  0xD9 -> LATIN CAPITAL LETTER U WITH OGONEK
    '\xda'     #  0xDA -> LATIN CAPITAL LETTER U WITH ACUTE
    '\xdb'     #  0xDB -> LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    '\xdc'     #  0xDC -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\xdd'     #  0xDD -> LATIN CAPITAL LETTER Y WITH ACUTE
    '\xde'     #  0xDE -> LATIN CAPITAL LETTER THORN (Icelandic)
    '\xdf'     #  0xDF -> LATIN SMALL LETTER SHARP S (German)
    '\u0101'   #  0xE0 -> LATIN SMALL LETTER A WITH MACRON
    '\xe1'     #  0xE1 -> LATIN SMALL LETTER A WITH ACUTE
    '\xe2'     #  0xE2 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\xe3'     #  0xE3 -> LATIN SMALL LETTER A WITH TILDE
    '\xe4'     #  0xE4 -> LATIN SMALL LETTER A WITH DIAERESIS
    '\xe5'     #  0xE5 -> LATIN SMALL LETTER A WITH RING ABOVE
    '\xe6'     #  0xE6 -> LATIN SMALL LETTER AE
    '\u012f'   #  0xE7 -> LATIN SMALL LETTER I WITH OGONEK
    '\u010d'   #  0xE8 -> LATIN SMALL LETTER C WITH CARON
    '\xe9'     #  0xE9 -> LATIN SMALL LETTER E WITH ACUTE
    '\u0119'   #  0xEA -> LATIN SMALL LETTER E WITH OGONEK
    '\xeb'     #  0xEB -> LATIN SMALL LETTER E WITH DIAERESIS
    '\u0117'   #  0xEC -> LATIN SMALL LETTER E WITH DOT ABOVE
    '\xed'     #  0xED -> LATIN SMALL LETTER I WITH ACUTE
    '\xee'     #  0xEE -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\xef'     #  0xEF -> LATIN SMALL LETTER I WITH DIAERESIS
    '\xf0'     #  0xF0 -> LATIN SMALL LETTER ETH (Icelandic)
    '\u0146'   #  0xF1 -> LATIN SMALL LETTER N WITH CEDILLA
    '\u014d'   #  0xF2 -> LATIN SMALL LETTER O WITH MACRON
    '\xf3'     #  0xF3 -> LATIN SMALL LETTER O WITH ACUTE
    '\xf4'     #  0xF4 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xf5'     #  0xF5 -> LATIN SMALL LETTER O WITH TILDE
    '\xf6'     #  0xF6 -> LATIN SMALL LETTER O WITH DIAERESIS
    '\u0169'   #  0xF7 -> LATIN SMALL LETTER U WITH TILDE
    '\xf8'     #  0xF8 -> LATIN SMALL LETTER O WITH STROKE
    '\u0173'   #  0xF9 -> LATIN SMALL LETTER U WITH OGONEK
    '\xfa'     #  0xFA -> LATIN SMALL LETTER U WITH ACUTE
    '\xfb'     #  0xFB -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\xfc'     #  0xFC -> LATIN SMALL LETTER U WITH DIAERESIS
    '\xfd'     #  0xFD -> LATIN SMALL LETTER Y WITH ACUTE
    '\xfe'     #  0xFE -> LATIN SMALL LETTER THORN (Icelandic)
    '\u0138'   #  0xFF -> LATIN SMALL LETTER KRA
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/euc_jisx0213.py000064400000002033151153537620011214 0ustar00#
# euc_jisx0213.py: Python Unicode Codec for EUC_JISX0213
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#

import _codecs_jp, codecs
import _multibytecodec as mbc

codec = _codecs_jp.getcodec('euc_jisx0213')

class Codec(codecs.Codec):
    encode = codec.encode
    decode = codec.decode

class IncrementalEncoder(mbc.MultibyteIncrementalEncoder,
                         codecs.IncrementalEncoder):
    codec = codec

class IncrementalDecoder(mbc.MultibyteIncrementalDecoder,
                         codecs.IncrementalDecoder):
    codec = codec

class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader):
    codec = codec

class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
    codec = codec

def getregentry():
    return codecs.CodecInfo(
        name='euc_jisx0213',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/cp863.py000064400000102714151153537620007747 0ustar00""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP863.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_map)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_map)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp863',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )

### Decoding Map

decoding_map = codecs.make_identity_dict(range(256))
decoding_map.update({
    0x0080: 0x00c7,     #  LATIN CAPITAL LETTER C WITH CEDILLA
    0x0081: 0x00fc,     #  LATIN SMALL LETTER U WITH DIAERESIS
    0x0082: 0x00e9,     #  LATIN SMALL LETTER E WITH ACUTE
    0x0083: 0x00e2,     #  LATIN SMALL LETTER A WITH CIRCUMFLEX
    0x0084: 0x00c2,     #  LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    0x0085: 0x00e0,     #  LATIN SMALL LETTER A WITH GRAVE
    0x0086: 0x00b6,     #  PILCROW SIGN
    0x0087: 0x00e7,     #  LATIN SMALL LETTER C WITH CEDILLA
    0x0088: 0x00ea,     #  LATIN SMALL LETTER E WITH CIRCUMFLEX
    0x0089: 0x00eb,     #  LATIN SMALL LETTER E WITH DIAERESIS
    0x008a: 0x00e8,     #  LATIN SMALL LETTER E WITH GRAVE
    0x008b: 0x00ef,     #  LATIN SMALL LETTER I WITH DIAERESIS
    0x008c: 0x00ee,     #  LATIN SMALL LETTER I WITH CIRCUMFLEX
    0x008d: 0x2017,     #  DOUBLE LOW LINE
    0x008e: 0x00c0,     #  LATIN CAPITAL LETTER A WITH GRAVE
    0x008f: 0x00a7,     #  SECTION SIGN
    0x0090: 0x00c9,     #  LATIN CAPITAL LETTER E WITH ACUTE
    0x0091: 0x00c8,     #  LATIN CAPITAL LETTER E WITH GRAVE
    0x0092: 0x00ca,     #  LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    0x0093: 0x00f4,     #  LATIN SMALL LETTER O WITH CIRCUMFLEX
    0x0094: 0x00cb,     #  LATIN CAPITAL LETTER E WITH DIAERESIS
    0x0095: 0x00cf,     #  LATIN CAPITAL LETTER I WITH DIAERESIS
    0x0096: 0x00fb,     #  LATIN SMALL LETTER U WITH CIRCUMFLEX
    0x0097: 0x00f9,     #  LATIN SMALL LETTER U WITH GRAVE
    0x0098: 0x00a4,     #  CURRENCY SIGN
    0x0099: 0x00d4,     #  LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    0x009a: 0x00dc,     #  LATIN CAPITAL LETTER U WITH DIAERESIS
    0x009b: 0x00a2,     #  CENT SIGN
    0x009c: 0x00a3,     #  POUND SIGN
    0x009d: 0x00d9,     #  LATIN CAPITAL LETTER U WITH GRAVE
    0x009e: 0x00db,     #  LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    0x009f: 0x0192,     #  LATIN SMALL LETTER F WITH HOOK
    0x00a0: 0x00a6,     #  BROKEN BAR
    0x00a1: 0x00b4,     #  ACUTE ACCENT
    0x00a2: 0x00f3,     #  LATIN SMALL LETTER O WITH ACUTE
    0x00a3: 0x00fa,     #  LATIN SMALL LETTER U WITH ACUTE
    0x00a4: 0x00a8,     #  DIAERESIS
    0x00a5: 0x00b8,     #  CEDILLA
    0x00a6: 0x00b3,     #  SUPERSCRIPT THREE
    0x00a7: 0x00af,     #  MACRON
    0x00a8: 0x00ce,     #  LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    0x00a9: 0x2310,     #  REVERSED NOT SIGN
    0x00aa: 0x00ac,     #  NOT SIGN
    0x00ab: 0x00bd,     #  VULGAR FRACTION ONE HALF
    0x00ac: 0x00bc,     #  VULGAR FRACTION ONE QUARTER
    0x00ad: 0x00be,     #  VULGAR FRACTION THREE QUARTERS
    0x00ae: 0x00ab,     #  LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00af: 0x00bb,     #  RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00b0: 0x2591,     #  LIGHT SHADE
    0x00b1: 0x2592,     #  MEDIUM SHADE
    0x00b2: 0x2593,     #  DARK SHADE
    0x00b3: 0x2502,     #  BOX DRAWINGS LIGHT VERTICAL
    0x00b4: 0x2524,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
    0x00b5: 0x2561,     #  BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
    0x00b6: 0x2562,     #  BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
    0x00b7: 0x2556,     #  BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
    0x00b8: 0x2555,     #  BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
    0x00b9: 0x2563,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    0x00ba: 0x2551,     #  BOX DRAWINGS DOUBLE VERTICAL
    0x00bb: 0x2557,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
    0x00bc: 0x255d,     #  BOX DRAWINGS DOUBLE UP AND LEFT
    0x00bd: 0x255c,     #  BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
    0x00be: 0x255b,     #  BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
    0x00bf: 0x2510,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
    0x00c0: 0x2514,     #  BOX DRAWINGS LIGHT UP AND RIGHT
    0x00c1: 0x2534,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
    0x00c2: 0x252c,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    0x00c3: 0x251c,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    0x00c4: 0x2500,     #  BOX DRAWINGS LIGHT HORIZONTAL
    0x00c5: 0x253c,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    0x00c6: 0x255e,     #  BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
    0x00c7: 0x255f,     #  BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
    0x00c8: 0x255a,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
    0x00c9: 0x2554,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
    0x00ca: 0x2569,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    0x00cb: 0x2566,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    0x00cc: 0x2560,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    0x00cd: 0x2550,     #  BOX DRAWINGS DOUBLE HORIZONTAL
    0x00ce: 0x256c,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    0x00cf: 0x2567,     #  BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
    0x00d0: 0x2568,     #  BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
    0x00d1: 0x2564,     #  BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
    0x00d2: 0x2565,     #  BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
    0x00d3: 0x2559,     #  BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
    0x00d4: 0x2558,     #  BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
    0x00d5: 0x2552,     #  BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
    0x00d6: 0x2553,     #  BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
    0x00d7: 0x256b,     #  BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
    0x00d8: 0x256a,     #  BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
    0x00d9: 0x2518,     #  BOX DRAWINGS LIGHT UP AND LEFT
    0x00da: 0x250c,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
    0x00db: 0x2588,     #  FULL BLOCK
    0x00dc: 0x2584,     #  LOWER HALF BLOCK
    0x00dd: 0x258c,     #  LEFT HALF BLOCK
    0x00de: 0x2590,     #  RIGHT HALF BLOCK
    0x00df: 0x2580,     #  UPPER HALF BLOCK
    0x00e0: 0x03b1,     #  GREEK SMALL LETTER ALPHA
    0x00e1: 0x00df,     #  LATIN SMALL LETTER SHARP S
    0x00e2: 0x0393,     #  GREEK CAPITAL LETTER GAMMA
    0x00e3: 0x03c0,     #  GREEK SMALL LETTER PI
    0x00e4: 0x03a3,     #  GREEK CAPITAL LETTER SIGMA
    0x00e5: 0x03c3,     #  GREEK SMALL LETTER SIGMA
    0x00e6: 0x00b5,     #  MICRO SIGN
    0x00e7: 0x03c4,     #  GREEK SMALL LETTER TAU
    0x00e8: 0x03a6,     #  GREEK CAPITAL LETTER PHI
    0x00e9: 0x0398,     #  GREEK CAPITAL LETTER THETA
    0x00ea: 0x03a9,     #  GREEK CAPITAL LETTER OMEGA
    0x00eb: 0x03b4,     #  GREEK SMALL LETTER DELTA
    0x00ec: 0x221e,     #  INFINITY
    0x00ed: 0x03c6,     #  GREEK SMALL LETTER PHI
    0x00ee: 0x03b5,     #  GREEK SMALL LETTER EPSILON
    0x00ef: 0x2229,     #  INTERSECTION
    0x00f0: 0x2261,     #  IDENTICAL TO
    0x00f1: 0x00b1,     #  PLUS-MINUS SIGN
    0x00f2: 0x2265,     #  GREATER-THAN OR EQUAL TO
    0x00f3: 0x2264,     #  LESS-THAN OR EQUAL TO
    0x00f4: 0x2320,     #  TOP HALF INTEGRAL
    0x00f5: 0x2321,     #  BOTTOM HALF INTEGRAL
    0x00f6: 0x00f7,     #  DIVISION SIGN
    0x00f7: 0x2248,     #  ALMOST EQUAL TO
    0x00f8: 0x00b0,     #  DEGREE SIGN
    0x00f9: 0x2219,     #  BULLET OPERATOR
    0x00fa: 0x00b7,     #  MIDDLE DOT
    0x00fb: 0x221a,     #  SQUARE ROOT
    0x00fc: 0x207f,     #  SUPERSCRIPT LATIN SMALL LETTER N
    0x00fd: 0x00b2,     #  SUPERSCRIPT TWO
    0x00fe: 0x25a0,     #  BLACK SQUARE
    0x00ff: 0x00a0,     #  NO-BREAK SPACE
})

### Decoding Table

decoding_table = (
    '\x00'     #  0x0000 -> NULL
    '\x01'     #  0x0001 -> START OF HEADING
    '\x02'     #  0x0002 -> START OF TEXT
    '\x03'     #  0x0003 -> END OF TEXT
    '\x04'     #  0x0004 -> END OF TRANSMISSION
    '\x05'     #  0x0005 -> ENQUIRY
    '\x06'     #  0x0006 -> ACKNOWLEDGE
    '\x07'     #  0x0007 -> BELL
    '\x08'     #  0x0008 -> BACKSPACE
    '\t'       #  0x0009 -> HORIZONTAL TABULATION
    '\n'       #  0x000a -> LINE FEED
    '\x0b'     #  0x000b -> VERTICAL TABULATION
    '\x0c'     #  0x000c -> FORM FEED
    '\r'       #  0x000d -> CARRIAGE RETURN
    '\x0e'     #  0x000e -> SHIFT OUT
    '\x0f'     #  0x000f -> SHIFT IN
    '\x10'     #  0x0010 -> DATA LINK ESCAPE
    '\x11'     #  0x0011 -> DEVICE CONTROL ONE
    '\x12'     #  0x0012 -> DEVICE CONTROL TWO
    '\x13'     #  0x0013 -> DEVICE CONTROL THREE
    '\x14'     #  0x0014 -> DEVICE CONTROL FOUR
    '\x15'     #  0x0015 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x0016 -> SYNCHRONOUS IDLE
    '\x17'     #  0x0017 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x0018 -> CANCEL
    '\x19'     #  0x0019 -> END OF MEDIUM
    '\x1a'     #  0x001a -> SUBSTITUTE
    '\x1b'     #  0x001b -> ESCAPE
    '\x1c'     #  0x001c -> FILE SEPARATOR
    '\x1d'     #  0x001d -> GROUP SEPARATOR
    '\x1e'     #  0x001e -> RECORD SEPARATOR
    '\x1f'     #  0x001f -> UNIT SEPARATOR
    ' '        #  0x0020 -> SPACE
    '!'        #  0x0021 -> EXCLAMATION MARK
    '"'        #  0x0022 -> QUOTATION MARK
    '#'        #  0x0023 -> NUMBER SIGN
    '$'        #  0x0024 -> DOLLAR SIGN
    '%'        #  0x0025 -> PERCENT SIGN
    '&'        #  0x0026 -> AMPERSAND
    "'"        #  0x0027 -> APOSTROPHE
    '('        #  0x0028 -> LEFT PARENTHESIS
    ')'        #  0x0029 -> RIGHT PARENTHESIS
    '*'        #  0x002a -> ASTERISK
    '+'        #  0x002b -> PLUS SIGN
    ','        #  0x002c -> COMMA
    '-'        #  0x002d -> HYPHEN-MINUS
    '.'        #  0x002e -> FULL STOP
    '/'        #  0x002f -> SOLIDUS
    '0'        #  0x0030 -> DIGIT ZERO
    '1'        #  0x0031 -> DIGIT ONE
    '2'        #  0x0032 -> DIGIT TWO
    '3'        #  0x0033 -> DIGIT THREE
    '4'        #  0x0034 -> DIGIT FOUR
    '5'        #  0x0035 -> DIGIT FIVE
    '6'        #  0x0036 -> DIGIT SIX
    '7'        #  0x0037 -> DIGIT SEVEN
    '8'        #  0x0038 -> DIGIT EIGHT
    '9'        #  0x0039 -> DIGIT NINE
    ':'        #  0x003a -> COLON
    ';'        #  0x003b -> SEMICOLON
    '<'        #  0x003c -> LESS-THAN SIGN
    '='        #  0x003d -> EQUALS SIGN
    '>'        #  0x003e -> GREATER-THAN SIGN
    '?'        #  0x003f -> QUESTION MARK
    '@'        #  0x0040 -> COMMERCIAL AT
    'A'        #  0x0041 -> LATIN CAPITAL LETTER A
    'B'        #  0x0042 -> LATIN CAPITAL LETTER B
    'C'        #  0x0043 -> LATIN CAPITAL LETTER C
    'D'        #  0x0044 -> LATIN CAPITAL LETTER D
    'E'        #  0x0045 -> LATIN CAPITAL LETTER E
    'F'        #  0x0046 -> LATIN CAPITAL LETTER F
    'G'        #  0x0047 -> LATIN CAPITAL LETTER G
    'H'        #  0x0048 -> LATIN CAPITAL LETTER H
    'I'        #  0x0049 -> LATIN CAPITAL LETTER I
    'J'        #  0x004a -> LATIN CAPITAL LETTER J
    'K'        #  0x004b -> LATIN CAPITAL LETTER K
    'L'        #  0x004c -> LATIN CAPITAL LETTER L
    'M'        #  0x004d -> LATIN CAPITAL LETTER M
    'N'        #  0x004e -> LATIN CAPITAL LETTER N
    'O'        #  0x004f -> LATIN CAPITAL LETTER O
    'P'        #  0x0050 -> LATIN CAPITAL LETTER P
    'Q'        #  0x0051 -> LATIN CAPITAL LETTER Q
    'R'        #  0x0052 -> LATIN CAPITAL LETTER R
    'S'        #  0x0053 -> LATIN CAPITAL LETTER S
    'T'        #  0x0054 -> LATIN CAPITAL LETTER T
    'U'        #  0x0055 -> LATIN CAPITAL LETTER U
    'V'        #  0x0056 -> LATIN CAPITAL LETTER V
    'W'        #  0x0057 -> LATIN CAPITAL LETTER W
    'X'        #  0x0058 -> LATIN CAPITAL LETTER X
    'Y'        #  0x0059 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x005a -> LATIN CAPITAL LETTER Z
    '['        #  0x005b -> LEFT SQUARE BRACKET
    '\\'       #  0x005c -> REVERSE SOLIDUS
    ']'        #  0x005d -> RIGHT SQUARE BRACKET
    '^'        #  0x005e -> CIRCUMFLEX ACCENT
    '_'        #  0x005f -> LOW LINE
    '`'        #  0x0060 -> GRAVE ACCENT
    'a'        #  0x0061 -> LATIN SMALL LETTER A
    'b'        #  0x0062 -> LATIN SMALL LETTER B
    'c'        #  0x0063 -> LATIN SMALL LETTER C
    'd'        #  0x0064 -> LATIN SMALL LETTER D
    'e'        #  0x0065 -> LATIN SMALL LETTER E
    'f'        #  0x0066 -> LATIN SMALL LETTER F
    'g'        #  0x0067 -> LATIN SMALL LETTER G
    'h'        #  0x0068 -> LATIN SMALL LETTER H
    'i'        #  0x0069 -> LATIN SMALL LETTER I
    'j'        #  0x006a -> LATIN SMALL LETTER J
    'k'        #  0x006b -> LATIN SMALL LETTER K
    'l'        #  0x006c -> LATIN SMALL LETTER L
    'm'        #  0x006d -> LATIN SMALL LETTER M
    'n'        #  0x006e -> LATIN SMALL LETTER N
    'o'        #  0x006f -> LATIN SMALL LETTER O
    'p'        #  0x0070 -> LATIN SMALL LETTER P
    'q'        #  0x0071 -> LATIN SMALL LETTER Q
    'r'        #  0x0072 -> LATIN SMALL LETTER R
    's'        #  0x0073 -> LATIN SMALL LETTER S
    't'        #  0x0074 -> LATIN SMALL LETTER T
    'u'        #  0x0075 -> LATIN SMALL LETTER U
    'v'        #  0x0076 -> LATIN SMALL LETTER V
    'w'        #  0x0077 -> LATIN SMALL LETTER W
    'x'        #  0x0078 -> LATIN SMALL LETTER X
    'y'        #  0x0079 -> LATIN SMALL LETTER Y
    'z'        #  0x007a -> LATIN SMALL LETTER Z
    '{'        #  0x007b -> LEFT CURLY BRACKET
    '|'        #  0x007c -> VERTICAL LINE
    '}'        #  0x007d -> RIGHT CURLY BRACKET
    '~'        #  0x007e -> TILDE
    '\x7f'     #  0x007f -> DELETE
    '\xc7'     #  0x0080 -> LATIN CAPITAL LETTER C WITH CEDILLA
    '\xfc'     #  0x0081 -> LATIN SMALL LETTER U WITH DIAERESIS
    '\xe9'     #  0x0082 -> LATIN SMALL LETTER E WITH ACUTE
    '\xe2'     #  0x0083 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\xc2'     #  0x0084 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    '\xe0'     #  0x0085 -> LATIN SMALL LETTER A WITH GRAVE
    '\xb6'     #  0x0086 -> PILCROW SIGN
    '\xe7'     #  0x0087 -> LATIN SMALL LETTER C WITH CEDILLA
    '\xea'     #  0x0088 -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xeb'     #  0x0089 -> LATIN SMALL LETTER E WITH DIAERESIS
    '\xe8'     #  0x008a -> LATIN SMALL LETTER E WITH GRAVE
    '\xef'     #  0x008b -> LATIN SMALL LETTER I WITH DIAERESIS
    '\xee'     #  0x008c -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\u2017'   #  0x008d -> DOUBLE LOW LINE
    '\xc0'     #  0x008e -> LATIN CAPITAL LETTER A WITH GRAVE
    '\xa7'     #  0x008f -> SECTION SIGN
    '\xc9'     #  0x0090 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\xc8'     #  0x0091 -> LATIN CAPITAL LETTER E WITH GRAVE
    '\xca'     #  0x0092 -> LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    '\xf4'     #  0x0093 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xcb'     #  0x0094 -> LATIN CAPITAL LETTER E WITH DIAERESIS
    '\xcf'     #  0x0095 -> LATIN CAPITAL LETTER I WITH DIAERESIS
    '\xfb'     #  0x0096 -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\xf9'     #  0x0097 -> LATIN SMALL LETTER U WITH GRAVE
    '\xa4'     #  0x0098 -> CURRENCY SIGN
    '\xd4'     #  0x0099 -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    '\xdc'     #  0x009a -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\xa2'     #  0x009b -> CENT SIGN
    '\xa3'     #  0x009c -> POUND SIGN
    '\xd9'     #  0x009d -> LATIN CAPITAL LETTER U WITH GRAVE
    '\xdb'     #  0x009e -> LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    '\u0192'   #  0x009f -> LATIN SMALL LETTER F WITH HOOK
    '\xa6'     #  0x00a0 -> BROKEN BAR
    '\xb4'     #  0x00a1 -> ACUTE ACCENT
    '\xf3'     #  0x00a2 -> LATIN SMALL LETTER O WITH ACUTE
    '\xfa'     #  0x00a3 -> LATIN SMALL LETTER U WITH ACUTE
    '\xa8'     #  0x00a4 -> DIAERESIS
    '\xb8'     #  0x00a5 -> CEDILLA
    '\xb3'     #  0x00a6 -> SUPERSCRIPT THREE
    '\xaf'     #  0x00a7 -> MACRON
    '\xce'     #  0x00a8 -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    '\u2310'   #  0x00a9 -> REVERSED NOT SIGN
    '\xac'     #  0x00aa -> NOT SIGN
    '\xbd'     #  0x00ab -> VULGAR FRACTION ONE HALF
    '\xbc'     #  0x00ac -> VULGAR FRACTION ONE QUARTER
    '\xbe'     #  0x00ad -> VULGAR FRACTION THREE QUARTERS
    '\xab'     #  0x00ae -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbb'     #  0x00af -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u2591'   #  0x00b0 -> LIGHT SHADE
    '\u2592'   #  0x00b1 -> MEDIUM SHADE
    '\u2593'   #  0x00b2 -> DARK SHADE
    '\u2502'   #  0x00b3 -> BOX DRAWINGS LIGHT VERTICAL
    '\u2524'   #  0x00b4 -> BOX DRAWINGS LIGHT VERTICAL AND LEFT
    '\u2561'   #  0x00b5 -> BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
    '\u2562'   #  0x00b6 -> BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
    '\u2556'   #  0x00b7 -> BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
    '\u2555'   #  0x00b8 -> BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
    '\u2563'   #  0x00b9 -> BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    '\u2551'   #  0x00ba -> BOX DRAWINGS DOUBLE VERTICAL
    '\u2557'   #  0x00bb -> BOX DRAWINGS DOUBLE DOWN AND LEFT
    '\u255d'   #  0x00bc -> BOX DRAWINGS DOUBLE UP AND LEFT
    '\u255c'   #  0x00bd -> BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
    '\u255b'   #  0x00be -> BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
    '\u2510'   #  0x00bf -> BOX DRAWINGS LIGHT DOWN AND LEFT
    '\u2514'   #  0x00c0 -> BOX DRAWINGS LIGHT UP AND RIGHT
    '\u2534'   #  0x00c1 -> BOX DRAWINGS LIGHT UP AND HORIZONTAL
    '\u252c'   #  0x00c2 -> BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    '\u251c'   #  0x00c3 -> BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    '\u2500'   #  0x00c4 -> BOX DRAWINGS LIGHT HORIZONTAL
    '\u253c'   #  0x00c5 -> BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    '\u255e'   #  0x00c6 -> BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
    '\u255f'   #  0x00c7 -> BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
    '\u255a'   #  0x00c8 -> BOX DRAWINGS DOUBLE UP AND RIGHT
    '\u2554'   #  0x00c9 -> BOX DRAWINGS DOUBLE DOWN AND RIGHT
    '\u2569'   #  0x00ca -> BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    '\u2566'   #  0x00cb -> BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    '\u2560'   #  0x00cc -> BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    '\u2550'   #  0x00cd -> BOX DRAWINGS DOUBLE HORIZONTAL
    '\u256c'   #  0x00ce -> BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    '\u2567'   #  0x00cf -> BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
    '\u2568'   #  0x00d0 -> BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
    '\u2564'   #  0x00d1 -> BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
    '\u2565'   #  0x00d2 -> BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
    '\u2559'   #  0x00d3 -> BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
    '\u2558'   #  0x00d4 -> BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
    '\u2552'   #  0x00d5 -> BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
    '\u2553'   #  0x00d6 -> BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
    '\u256b'   #  0x00d7 -> BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
    '\u256a'   #  0x00d8 -> BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
    '\u2518'   #  0x00d9 -> BOX DRAWINGS LIGHT UP AND LEFT
    '\u250c'   #  0x00da -> BOX DRAWINGS LIGHT DOWN AND RIGHT
    '\u2588'   #  0x00db -> FULL BLOCK
    '\u2584'   #  0x00dc -> LOWER HALF BLOCK
    '\u258c'   #  0x00dd -> LEFT HALF BLOCK
    '\u2590'   #  0x00de -> RIGHT HALF BLOCK
    '\u2580'   #  0x00df -> UPPER HALF BLOCK
    '\u03b1'   #  0x00e0 -> GREEK SMALL LETTER ALPHA
    '\xdf'     #  0x00e1 -> LATIN SMALL LETTER SHARP S
    '\u0393'   #  0x00e2 -> GREEK CAPITAL LETTER GAMMA
    '\u03c0'   #  0x00e3 -> GREEK SMALL LETTER PI
    '\u03a3'   #  0x00e4 -> GREEK CAPITAL LETTER SIGMA
    '\u03c3'   #  0x00e5 -> GREEK SMALL LETTER SIGMA
    '\xb5'     #  0x00e6 -> MICRO SIGN
    '\u03c4'   #  0x00e7 -> GREEK SMALL LETTER TAU
    '\u03a6'   #  0x00e8 -> GREEK CAPITAL LETTER PHI
    '\u0398'   #  0x00e9 -> GREEK CAPITAL LETTER THETA
    '\u03a9'   #  0x00ea -> GREEK CAPITAL LETTER OMEGA
    '\u03b4'   #  0x00eb -> GREEK SMALL LETTER DELTA
    '\u221e'   #  0x00ec -> INFINITY
    '\u03c6'   #  0x00ed -> GREEK SMALL LETTER PHI
    '\u03b5'   #  0x00ee -> GREEK SMALL LETTER EPSILON
    '\u2229'   #  0x00ef -> INTERSECTION
    '\u2261'   #  0x00f0 -> IDENTICAL TO
    '\xb1'     #  0x00f1 -> PLUS-MINUS SIGN
    '\u2265'   #  0x00f2 -> GREATER-THAN OR EQUAL TO
    '\u2264'   #  0x00f3 -> LESS-THAN OR EQUAL TO
    '\u2320'   #  0x00f4 -> TOP HALF INTEGRAL
    '\u2321'   #  0x00f5 -> BOTTOM HALF INTEGRAL
    '\xf7'     #  0x00f6 -> DIVISION SIGN
    '\u2248'   #  0x00f7 -> ALMOST EQUAL TO
    '\xb0'     #  0x00f8 -> DEGREE SIGN
    '\u2219'   #  0x00f9 -> BULLET OPERATOR
    '\xb7'     #  0x00fa -> MIDDLE DOT
    '\u221a'   #  0x00fb -> SQUARE ROOT
    '\u207f'   #  0x00fc -> SUPERSCRIPT LATIN SMALL LETTER N
    '\xb2'     #  0x00fd -> SUPERSCRIPT TWO
    '\u25a0'   #  0x00fe -> BLACK SQUARE
    '\xa0'     #  0x00ff -> NO-BREAK SPACE
)

### Encoding Map

encoding_map = {
    0x0000: 0x0000,     #  NULL
    0x0001: 0x0001,     #  START OF HEADING
    0x0002: 0x0002,     #  START OF TEXT
    0x0003: 0x0003,     #  END OF TEXT
    0x0004: 0x0004,     #  END OF TRANSMISSION
    0x0005: 0x0005,     #  ENQUIRY
    0x0006: 0x0006,     #  ACKNOWLEDGE
    0x0007: 0x0007,     #  BELL
    0x0008: 0x0008,     #  BACKSPACE
    0x0009: 0x0009,     #  HORIZONTAL TABULATION
    0x000a: 0x000a,     #  LINE FEED
    0x000b: 0x000b,     #  VERTICAL TABULATION
    0x000c: 0x000c,     #  FORM FEED
    0x000d: 0x000d,     #  CARRIAGE RETURN
    0x000e: 0x000e,     #  SHIFT OUT
    0x000f: 0x000f,     #  SHIFT IN
    0x0010: 0x0010,     #  DATA LINK ESCAPE
    0x0011: 0x0011,     #  DEVICE CONTROL ONE
    0x0012: 0x0012,     #  DEVICE CONTROL TWO
    0x0013: 0x0013,     #  DEVICE CONTROL THREE
    0x0014: 0x0014,     #  DEVICE CONTROL FOUR
    0x0015: 0x0015,     #  NEGATIVE ACKNOWLEDGE
    0x0016: 0x0016,     #  SYNCHRONOUS IDLE
    0x0017: 0x0017,     #  END OF TRANSMISSION BLOCK
    0x0018: 0x0018,     #  CANCEL
    0x0019: 0x0019,     #  END OF MEDIUM
    0x001a: 0x001a,     #  SUBSTITUTE
    0x001b: 0x001b,     #  ESCAPE
    0x001c: 0x001c,     #  FILE SEPARATOR
    0x001d: 0x001d,     #  GROUP SEPARATOR
    0x001e: 0x001e,     #  RECORD SEPARATOR
    0x001f: 0x001f,     #  UNIT SEPARATOR
    0x0020: 0x0020,     #  SPACE
    0x0021: 0x0021,     #  EXCLAMATION MARK
    0x0022: 0x0022,     #  QUOTATION MARK
    0x0023: 0x0023,     #  NUMBER SIGN
    0x0024: 0x0024,     #  DOLLAR SIGN
    0x0025: 0x0025,     #  PERCENT SIGN
    0x0026: 0x0026,     #  AMPERSAND
    0x0027: 0x0027,     #  APOSTROPHE
    0x0028: 0x0028,     #  LEFT PARENTHESIS
    0x0029: 0x0029,     #  RIGHT PARENTHESIS
    0x002a: 0x002a,     #  ASTERISK
    0x002b: 0x002b,     #  PLUS SIGN
    0x002c: 0x002c,     #  COMMA
    0x002d: 0x002d,     #  HYPHEN-MINUS
    0x002e: 0x002e,     #  FULL STOP
    0x002f: 0x002f,     #  SOLIDUS
    0x0030: 0x0030,     #  DIGIT ZERO
    0x0031: 0x0031,     #  DIGIT ONE
    0x0032: 0x0032,     #  DIGIT TWO
    0x0033: 0x0033,     #  DIGIT THREE
    0x0034: 0x0034,     #  DIGIT FOUR
    0x0035: 0x0035,     #  DIGIT FIVE
    0x0036: 0x0036,     #  DIGIT SIX
    0x0037: 0x0037,     #  DIGIT SEVEN
    0x0038: 0x0038,     #  DIGIT EIGHT
    0x0039: 0x0039,     #  DIGIT NINE
    0x003a: 0x003a,     #  COLON
    0x003b: 0x003b,     #  SEMICOLON
    0x003c: 0x003c,     #  LESS-THAN SIGN
    0x003d: 0x003d,     #  EQUALS SIGN
    0x003e: 0x003e,     #  GREATER-THAN SIGN
    0x003f: 0x003f,     #  QUESTION MARK
    0x0040: 0x0040,     #  COMMERCIAL AT
    0x0041: 0x0041,     #  LATIN CAPITAL LETTER A
    0x0042: 0x0042,     #  LATIN CAPITAL LETTER B
    0x0043: 0x0043,     #  LATIN CAPITAL LETTER C
    0x0044: 0x0044,     #  LATIN CAPITAL LETTER D
    0x0045: 0x0045,     #  LATIN CAPITAL LETTER E
    0x0046: 0x0046,     #  LATIN CAPITAL LETTER F
    0x0047: 0x0047,     #  LATIN CAPITAL LETTER G
    0x0048: 0x0048,     #  LATIN CAPITAL LETTER H
    0x0049: 0x0049,     #  LATIN CAPITAL LETTER I
    0x004a: 0x004a,     #  LATIN CAPITAL LETTER J
    0x004b: 0x004b,     #  LATIN CAPITAL LETTER K
    0x004c: 0x004c,     #  LATIN CAPITAL LETTER L
    0x004d: 0x004d,     #  LATIN CAPITAL LETTER M
    0x004e: 0x004e,     #  LATIN CAPITAL LETTER N
    0x004f: 0x004f,     #  LATIN CAPITAL LETTER O
    0x0050: 0x0050,     #  LATIN CAPITAL LETTER P
    0x0051: 0x0051,     #  LATIN CAPITAL LETTER Q
    0x0052: 0x0052,     #  LATIN CAPITAL LETTER R
    0x0053: 0x0053,     #  LATIN CAPITAL LETTER S
    0x0054: 0x0054,     #  LATIN CAPITAL LETTER T
    0x0055: 0x0055,     #  LATIN CAPITAL LETTER U
    0x0056: 0x0056,     #  LATIN CAPITAL LETTER V
    0x0057: 0x0057,     #  LATIN CAPITAL LETTER W
    0x0058: 0x0058,     #  LATIN CAPITAL LETTER X
    0x0059: 0x0059,     #  LATIN CAPITAL LETTER Y
    0x005a: 0x005a,     #  LATIN CAPITAL LETTER Z
    0x005b: 0x005b,     #  LEFT SQUARE BRACKET
    0x005c: 0x005c,     #  REVERSE SOLIDUS
    0x005d: 0x005d,     #  RIGHT SQUARE BRACKET
    0x005e: 0x005e,     #  CIRCUMFLEX ACCENT
    0x005f: 0x005f,     #  LOW LINE
    0x0060: 0x0060,     #  GRAVE ACCENT
    0x0061: 0x0061,     #  LATIN SMALL LETTER A
    0x0062: 0x0062,     #  LATIN SMALL LETTER B
    0x0063: 0x0063,     #  LATIN SMALL LETTER C
    0x0064: 0x0064,     #  LATIN SMALL LETTER D
    0x0065: 0x0065,     #  LATIN SMALL LETTER E
    0x0066: 0x0066,     #  LATIN SMALL LETTER F
    0x0067: 0x0067,     #  LATIN SMALL LETTER G
    0x0068: 0x0068,     #  LATIN SMALL LETTER H
    0x0069: 0x0069,     #  LATIN SMALL LETTER I
    0x006a: 0x006a,     #  LATIN SMALL LETTER J
    0x006b: 0x006b,     #  LATIN SMALL LETTER K
    0x006c: 0x006c,     #  LATIN SMALL LETTER L
    0x006d: 0x006d,     #  LATIN SMALL LETTER M
    0x006e: 0x006e,     #  LATIN SMALL LETTER N
    0x006f: 0x006f,     #  LATIN SMALL LETTER O
    0x0070: 0x0070,     #  LATIN SMALL LETTER P
    0x0071: 0x0071,     #  LATIN SMALL LETTER Q
    0x0072: 0x0072,     #  LATIN SMALL LETTER R
    0x0073: 0x0073,     #  LATIN SMALL LETTER S
    0x0074: 0x0074,     #  LATIN SMALL LETTER T
    0x0075: 0x0075,     #  LATIN SMALL LETTER U
    0x0076: 0x0076,     #  LATIN SMALL LETTER V
    0x0077: 0x0077,     #  LATIN SMALL LETTER W
    0x0078: 0x0078,     #  LATIN SMALL LETTER X
    0x0079: 0x0079,     #  LATIN SMALL LETTER Y
    0x007a: 0x007a,     #  LATIN SMALL LETTER Z
    0x007b: 0x007b,     #  LEFT CURLY BRACKET
    0x007c: 0x007c,     #  VERTICAL LINE
    0x007d: 0x007d,     #  RIGHT CURLY BRACKET
    0x007e: 0x007e,     #  TILDE
    0x007f: 0x007f,     #  DELETE
    0x00a0: 0x00ff,     #  NO-BREAK SPACE
    0x00a2: 0x009b,     #  CENT SIGN
    0x00a3: 0x009c,     #  POUND SIGN
    0x00a4: 0x0098,     #  CURRENCY SIGN
    0x00a6: 0x00a0,     #  BROKEN BAR
    0x00a7: 0x008f,     #  SECTION SIGN
    0x00a8: 0x00a4,     #  DIAERESIS
    0x00ab: 0x00ae,     #  LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00ac: 0x00aa,     #  NOT SIGN
    0x00af: 0x00a7,     #  MACRON
    0x00b0: 0x00f8,     #  DEGREE SIGN
    0x00b1: 0x00f1,     #  PLUS-MINUS SIGN
    0x00b2: 0x00fd,     #  SUPERSCRIPT TWO
    0x00b3: 0x00a6,     #  SUPERSCRIPT THREE
    0x00b4: 0x00a1,     #  ACUTE ACCENT
    0x00b5: 0x00e6,     #  MICRO SIGN
    0x00b6: 0x0086,     #  PILCROW SIGN
    0x00b7: 0x00fa,     #  MIDDLE DOT
    0x00b8: 0x00a5,     #  CEDILLA
    0x00bb: 0x00af,     #  RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00bc: 0x00ac,     #  VULGAR FRACTION ONE QUARTER
    0x00bd: 0x00ab,     #  VULGAR FRACTION ONE HALF
    0x00be: 0x00ad,     #  VULGAR FRACTION THREE QUARTERS
    0x00c0: 0x008e,     #  LATIN CAPITAL LETTER A WITH GRAVE
    0x00c2: 0x0084,     #  LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    0x00c7: 0x0080,     #  LATIN CAPITAL LETTER C WITH CEDILLA
    0x00c8: 0x0091,     #  LATIN CAPITAL LETTER E WITH GRAVE
    0x00c9: 0x0090,     #  LATIN CAPITAL LETTER E WITH ACUTE
    0x00ca: 0x0092,     #  LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    0x00cb: 0x0094,     #  LATIN CAPITAL LETTER E WITH DIAERESIS
    0x00ce: 0x00a8,     #  LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    0x00cf: 0x0095,     #  LATIN CAPITAL LETTER I WITH DIAERESIS
    0x00d4: 0x0099,     #  LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    0x00d9: 0x009d,     #  LATIN CAPITAL LETTER U WITH GRAVE
    0x00db: 0x009e,     #  LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    0x00dc: 0x009a,     #  LATIN CAPITAL LETTER U WITH DIAERESIS
    0x00df: 0x00e1,     #  LATIN SMALL LETTER SHARP S
    0x00e0: 0x0085,     #  LATIN SMALL LETTER A WITH GRAVE
    0x00e2: 0x0083,     #  LATIN SMALL LETTER A WITH CIRCUMFLEX
    0x00e7: 0x0087,     #  LATIN SMALL LETTER C WITH CEDILLA
    0x00e8: 0x008a,     #  LATIN SMALL LETTER E WITH GRAVE
    0x00e9: 0x0082,     #  LATIN SMALL LETTER E WITH ACUTE
    0x00ea: 0x0088,     #  LATIN SMALL LETTER E WITH CIRCUMFLEX
    0x00eb: 0x0089,     #  LATIN SMALL LETTER E WITH DIAERESIS
    0x00ee: 0x008c,     #  LATIN SMALL LETTER I WITH CIRCUMFLEX
    0x00ef: 0x008b,     #  LATIN SMALL LETTER I WITH DIAERESIS
    0x00f3: 0x00a2,     #  LATIN SMALL LETTER O WITH ACUTE
    0x00f4: 0x0093,     #  LATIN SMALL LETTER O WITH CIRCUMFLEX
    0x00f7: 0x00f6,     #  DIVISION SIGN
    0x00f9: 0x0097,     #  LATIN SMALL LETTER U WITH GRAVE
    0x00fa: 0x00a3,     #  LATIN SMALL LETTER U WITH ACUTE
    0x00fb: 0x0096,     #  LATIN SMALL LETTER U WITH CIRCUMFLEX
    0x00fc: 0x0081,     #  LATIN SMALL LETTER U WITH DIAERESIS
    0x0192: 0x009f,     #  LATIN SMALL LETTER F WITH HOOK
    0x0393: 0x00e2,     #  GREEK CAPITAL LETTER GAMMA
    0x0398: 0x00e9,     #  GREEK CAPITAL LETTER THETA
    0x03a3: 0x00e4,     #  GREEK CAPITAL LETTER SIGMA
    0x03a6: 0x00e8,     #  GREEK CAPITAL LETTER PHI
    0x03a9: 0x00ea,     #  GREEK CAPITAL LETTER OMEGA
    0x03b1: 0x00e0,     #  GREEK SMALL LETTER ALPHA
    0x03b4: 0x00eb,     #  GREEK SMALL LETTER DELTA
    0x03b5: 0x00ee,     #  GREEK SMALL LETTER EPSILON
    0x03c0: 0x00e3,     #  GREEK SMALL LETTER PI
    0x03c3: 0x00e5,     #  GREEK SMALL LETTER SIGMA
    0x03c4: 0x00e7,     #  GREEK SMALL LETTER TAU
    0x03c6: 0x00ed,     #  GREEK SMALL LETTER PHI
    0x2017: 0x008d,     #  DOUBLE LOW LINE
    0x207f: 0x00fc,     #  SUPERSCRIPT LATIN SMALL LETTER N
    0x2219: 0x00f9,     #  BULLET OPERATOR
    0x221a: 0x00fb,     #  SQUARE ROOT
    0x221e: 0x00ec,     #  INFINITY
    0x2229: 0x00ef,     #  INTERSECTION
    0x2248: 0x00f7,     #  ALMOST EQUAL TO
    0x2261: 0x00f0,     #  IDENTICAL TO
    0x2264: 0x00f3,     #  LESS-THAN OR EQUAL TO
    0x2265: 0x00f2,     #  GREATER-THAN OR EQUAL TO
    0x2310: 0x00a9,     #  REVERSED NOT SIGN
    0x2320: 0x00f4,     #  TOP HALF INTEGRAL
    0x2321: 0x00f5,     #  BOTTOM HALF INTEGRAL
    0x2500: 0x00c4,     #  BOX DRAWINGS LIGHT HORIZONTAL
    0x2502: 0x00b3,     #  BOX DRAWINGS LIGHT VERTICAL
    0x250c: 0x00da,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
    0x2510: 0x00bf,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
    0x2514: 0x00c0,     #  BOX DRAWINGS LIGHT UP AND RIGHT
    0x2518: 0x00d9,     #  BOX DRAWINGS LIGHT UP AND LEFT
    0x251c: 0x00c3,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    0x2524: 0x00b4,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
    0x252c: 0x00c2,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    0x2534: 0x00c1,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
    0x253c: 0x00c5,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    0x2550: 0x00cd,     #  BOX DRAWINGS DOUBLE HORIZONTAL
    0x2551: 0x00ba,     #  BOX DRAWINGS DOUBLE VERTICAL
    0x2552: 0x00d5,     #  BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
    0x2553: 0x00d6,     #  BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
    0x2554: 0x00c9,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
    0x2555: 0x00b8,     #  BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
    0x2556: 0x00b7,     #  BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
    0x2557: 0x00bb,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
    0x2558: 0x00d4,     #  BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
    0x2559: 0x00d3,     #  BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
    0x255a: 0x00c8,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
    0x255b: 0x00be,     #  BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
    0x255c: 0x00bd,     #  BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
    0x255d: 0x00bc,     #  BOX DRAWINGS DOUBLE UP AND LEFT
    0x255e: 0x00c6,     #  BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
    0x255f: 0x00c7,     #  BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
    0x2560: 0x00cc,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    0x2561: 0x00b5,     #  BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
    0x2562: 0x00b6,     #  BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
    0x2563: 0x00b9,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    0x2564: 0x00d1,     #  BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
    0x2565: 0x00d2,     #  BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
    0x2566: 0x00cb,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    0x2567: 0x00cf,     #  BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
    0x2568: 0x00d0,     #  BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
    0x2569: 0x00ca,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    0x256a: 0x00d8,     #  BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
    0x256b: 0x00d7,     #  BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
    0x256c: 0x00ce,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    0x2580: 0x00df,     #  UPPER HALF BLOCK
    0x2584: 0x00dc,     #  LOWER HALF BLOCK
    0x2588: 0x00db,     #  FULL BLOCK
    0x258c: 0x00dd,     #  LEFT HALF BLOCK
    0x2590: 0x00de,     #  RIGHT HALF BLOCK
    0x2591: 0x00b0,     #  LIGHT SHADE
    0x2592: 0x00b1,     #  MEDIUM SHADE
    0x2593: 0x00b2,     #  DARK SHADE
    0x25a0: 0x00fe,     #  BLACK SQUARE
}
encodings/mac_arabic.py000064400000107163151153537620011150 0ustar00""" Python Character Mapping Codec generated from 'VENDORS/APPLE/ARABIC.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_map)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_map)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='mac-arabic',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )

### Decoding Map

decoding_map = codecs.make_identity_dict(range(256))
decoding_map.update({
    0x0080: 0x00c4,     #  LATIN CAPITAL LETTER A WITH DIAERESIS
    0x0081: 0x00a0,     #  NO-BREAK SPACE, right-left
    0x0082: 0x00c7,     #  LATIN CAPITAL LETTER C WITH CEDILLA
    0x0083: 0x00c9,     #  LATIN CAPITAL LETTER E WITH ACUTE
    0x0084: 0x00d1,     #  LATIN CAPITAL LETTER N WITH TILDE
    0x0085: 0x00d6,     #  LATIN CAPITAL LETTER O WITH DIAERESIS
    0x0086: 0x00dc,     #  LATIN CAPITAL LETTER U WITH DIAERESIS
    0x0087: 0x00e1,     #  LATIN SMALL LETTER A WITH ACUTE
    0x0088: 0x00e0,     #  LATIN SMALL LETTER A WITH GRAVE
    0x0089: 0x00e2,     #  LATIN SMALL LETTER A WITH CIRCUMFLEX
    0x008a: 0x00e4,     #  LATIN SMALL LETTER A WITH DIAERESIS
    0x008b: 0x06ba,     #  ARABIC LETTER NOON GHUNNA
    0x008c: 0x00ab,     #  LEFT-POINTING DOUBLE ANGLE QUOTATION MARK, right-left
    0x008d: 0x00e7,     #  LATIN SMALL LETTER C WITH CEDILLA
    0x008e: 0x00e9,     #  LATIN SMALL LETTER E WITH ACUTE
    0x008f: 0x00e8,     #  LATIN SMALL LETTER E WITH GRAVE
    0x0090: 0x00ea,     #  LATIN SMALL LETTER E WITH CIRCUMFLEX
    0x0091: 0x00eb,     #  LATIN SMALL LETTER E WITH DIAERESIS
    0x0092: 0x00ed,     #  LATIN SMALL LETTER I WITH ACUTE
    0x0093: 0x2026,     #  HORIZONTAL ELLIPSIS, right-left
    0x0094: 0x00ee,     #  LATIN SMALL LETTER I WITH CIRCUMFLEX
    0x0095: 0x00ef,     #  LATIN SMALL LETTER I WITH DIAERESIS
    0x0096: 0x00f1,     #  LATIN SMALL LETTER N WITH TILDE
    0x0097: 0x00f3,     #  LATIN SMALL LETTER O WITH ACUTE
    0x0098: 0x00bb,     #  RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK, right-left
    0x0099: 0x00f4,     #  LATIN SMALL LETTER O WITH CIRCUMFLEX
    0x009a: 0x00f6,     #  LATIN SMALL LETTER O WITH DIAERESIS
    0x009b: 0x00f7,     #  DIVISION SIGN, right-left
    0x009c: 0x00fa,     #  LATIN SMALL LETTER U WITH ACUTE
    0x009d: 0x00f9,     #  LATIN SMALL LETTER U WITH GRAVE
    0x009e: 0x00fb,     #  LATIN SMALL LETTER U WITH CIRCUMFLEX
    0x009f: 0x00fc,     #  LATIN SMALL LETTER U WITH DIAERESIS
    0x00a0: 0x0020,     #  SPACE, right-left
    0x00a1: 0x0021,     #  EXCLAMATION MARK, right-left
    0x00a2: 0x0022,     #  QUOTATION MARK, right-left
    0x00a3: 0x0023,     #  NUMBER SIGN, right-left
    0x00a4: 0x0024,     #  DOLLAR SIGN, right-left
    0x00a5: 0x066a,     #  ARABIC PERCENT SIGN
    0x00a6: 0x0026,     #  AMPERSAND, right-left
    0x00a7: 0x0027,     #  APOSTROPHE, right-left
    0x00a8: 0x0028,     #  LEFT PARENTHESIS, right-left
    0x00a9: 0x0029,     #  RIGHT PARENTHESIS, right-left
    0x00aa: 0x002a,     #  ASTERISK, right-left
    0x00ab: 0x002b,     #  PLUS SIGN, right-left
    0x00ac: 0x060c,     #  ARABIC COMMA
    0x00ad: 0x002d,     #  HYPHEN-MINUS, right-left
    0x00ae: 0x002e,     #  FULL STOP, right-left
    0x00af: 0x002f,     #  SOLIDUS, right-left
    0x00b0: 0x0660,     #  ARABIC-INDIC DIGIT ZERO, right-left (need override)
    0x00b1: 0x0661,     #  ARABIC-INDIC DIGIT ONE, right-left (need override)
    0x00b2: 0x0662,     #  ARABIC-INDIC DIGIT TWO, right-left (need override)
    0x00b3: 0x0663,     #  ARABIC-INDIC DIGIT THREE, right-left (need override)
    0x00b4: 0x0664,     #  ARABIC-INDIC DIGIT FOUR, right-left (need override)
    0x00b5: 0x0665,     #  ARABIC-INDIC DIGIT FIVE, right-left (need override)
    0x00b6: 0x0666,     #  ARABIC-INDIC DIGIT SIX, right-left (need override)
    0x00b7: 0x0667,     #  ARABIC-INDIC DIGIT SEVEN, right-left (need override)
    0x00b8: 0x0668,     #  ARABIC-INDIC DIGIT EIGHT, right-left (need override)
    0x00b9: 0x0669,     #  ARABIC-INDIC DIGIT NINE, right-left (need override)
    0x00ba: 0x003a,     #  COLON, right-left
    0x00bb: 0x061b,     #  ARABIC SEMICOLON
    0x00bc: 0x003c,     #  LESS-THAN SIGN, right-left
    0x00bd: 0x003d,     #  EQUALS SIGN, right-left
    0x00be: 0x003e,     #  GREATER-THAN SIGN, right-left
    0x00bf: 0x061f,     #  ARABIC QUESTION MARK
    0x00c0: 0x274a,     #  EIGHT TEARDROP-SPOKED PROPELLER ASTERISK, right-left
    0x00c1: 0x0621,     #  ARABIC LETTER HAMZA
    0x00c2: 0x0622,     #  ARABIC LETTER ALEF WITH MADDA ABOVE
    0x00c3: 0x0623,     #  ARABIC LETTER ALEF WITH HAMZA ABOVE
    0x00c4: 0x0624,     #  ARABIC LETTER WAW WITH HAMZA ABOVE
    0x00c5: 0x0625,     #  ARABIC LETTER ALEF WITH HAMZA BELOW
    0x00c6: 0x0626,     #  ARABIC LETTER YEH WITH HAMZA ABOVE
    0x00c7: 0x0627,     #  ARABIC LETTER ALEF
    0x00c8: 0x0628,     #  ARABIC LETTER BEH
    0x00c9: 0x0629,     #  ARABIC LETTER TEH MARBUTA
    0x00ca: 0x062a,     #  ARABIC LETTER TEH
    0x00cb: 0x062b,     #  ARABIC LETTER THEH
    0x00cc: 0x062c,     #  ARABIC LETTER JEEM
    0x00cd: 0x062d,     #  ARABIC LETTER HAH
    0x00ce: 0x062e,     #  ARABIC LETTER KHAH
    0x00cf: 0x062f,     #  ARABIC LETTER DAL
    0x00d0: 0x0630,     #  ARABIC LETTER THAL
    0x00d1: 0x0631,     #  ARABIC LETTER REH
    0x00d2: 0x0632,     #  ARABIC LETTER ZAIN
    0x00d3: 0x0633,     #  ARABIC LETTER SEEN
    0x00d4: 0x0634,     #  ARABIC LETTER SHEEN
    0x00d5: 0x0635,     #  ARABIC LETTER SAD
    0x00d6: 0x0636,     #  ARABIC LETTER DAD
    0x00d7: 0x0637,     #  ARABIC LETTER TAH
    0x00d8: 0x0638,     #  ARABIC LETTER ZAH
    0x00d9: 0x0639,     #  ARABIC LETTER AIN
    0x00da: 0x063a,     #  ARABIC LETTER GHAIN
    0x00db: 0x005b,     #  LEFT SQUARE BRACKET, right-left
    0x00dc: 0x005c,     #  REVERSE SOLIDUS, right-left
    0x00dd: 0x005d,     #  RIGHT SQUARE BRACKET, right-left
    0x00de: 0x005e,     #  CIRCUMFLEX ACCENT, right-left
    0x00df: 0x005f,     #  LOW LINE, right-left
    0x00e0: 0x0640,     #  ARABIC TATWEEL
    0x00e1: 0x0641,     #  ARABIC LETTER FEH
    0x00e2: 0x0642,     #  ARABIC LETTER QAF
    0x00e3: 0x0643,     #  ARABIC LETTER KAF
    0x00e4: 0x0644,     #  ARABIC LETTER LAM
    0x00e5: 0x0645,     #  ARABIC LETTER MEEM
    0x00e6: 0x0646,     #  ARABIC LETTER NOON
    0x00e7: 0x0647,     #  ARABIC LETTER HEH
    0x00e8: 0x0648,     #  ARABIC LETTER WAW
    0x00e9: 0x0649,     #  ARABIC LETTER ALEF MAKSURA
    0x00ea: 0x064a,     #  ARABIC LETTER YEH
    0x00eb: 0x064b,     #  ARABIC FATHATAN
    0x00ec: 0x064c,     #  ARABIC DAMMATAN
    0x00ed: 0x064d,     #  ARABIC KASRATAN
    0x00ee: 0x064e,     #  ARABIC FATHA
    0x00ef: 0x064f,     #  ARABIC DAMMA
    0x00f0: 0x0650,     #  ARABIC KASRA
    0x00f1: 0x0651,     #  ARABIC SHADDA
    0x00f2: 0x0652,     #  ARABIC SUKUN
    0x00f3: 0x067e,     #  ARABIC LETTER PEH
    0x00f4: 0x0679,     #  ARABIC LETTER TTEH
    0x00f5: 0x0686,     #  ARABIC LETTER TCHEH
    0x00f6: 0x06d5,     #  ARABIC LETTER AE
    0x00f7: 0x06a4,     #  ARABIC LETTER VEH
    0x00f8: 0x06af,     #  ARABIC LETTER GAF
    0x00f9: 0x0688,     #  ARABIC LETTER DDAL
    0x00fa: 0x0691,     #  ARABIC LETTER RREH
    0x00fb: 0x007b,     #  LEFT CURLY BRACKET, right-left
    0x00fc: 0x007c,     #  VERTICAL LINE, right-left
    0x00fd: 0x007d,     #  RIGHT CURLY BRACKET, right-left
    0x00fe: 0x0698,     #  ARABIC LETTER JEH
    0x00ff: 0x06d2,     #  ARABIC LETTER YEH BARREE
})

### Decoding Table

decoding_table = (
    '\x00'     #  0x0000 -> CONTROL CHARACTER
    '\x01'     #  0x0001 -> CONTROL CHARACTER
    '\x02'     #  0x0002 -> CONTROL CHARACTER
    '\x03'     #  0x0003 -> CONTROL CHARACTER
    '\x04'     #  0x0004 -> CONTROL CHARACTER
    '\x05'     #  0x0005 -> CONTROL CHARACTER
    '\x06'     #  0x0006 -> CONTROL CHARACTER
    '\x07'     #  0x0007 -> CONTROL CHARACTER
    '\x08'     #  0x0008 -> CONTROL CHARACTER
    '\t'       #  0x0009 -> CONTROL CHARACTER
    '\n'       #  0x000a -> CONTROL CHARACTER
    '\x0b'     #  0x000b -> CONTROL CHARACTER
    '\x0c'     #  0x000c -> CONTROL CHARACTER
    '\r'       #  0x000d -> CONTROL CHARACTER
    '\x0e'     #  0x000e -> CONTROL CHARACTER
    '\x0f'     #  0x000f -> CONTROL CHARACTER
    '\x10'     #  0x0010 -> CONTROL CHARACTER
    '\x11'     #  0x0011 -> CONTROL CHARACTER
    '\x12'     #  0x0012 -> CONTROL CHARACTER
    '\x13'     #  0x0013 -> CONTROL CHARACTER
    '\x14'     #  0x0014 -> CONTROL CHARACTER
    '\x15'     #  0x0015 -> CONTROL CHARACTER
    '\x16'     #  0x0016 -> CONTROL CHARACTER
    '\x17'     #  0x0017 -> CONTROL CHARACTER
    '\x18'     #  0x0018 -> CONTROL CHARACTER
    '\x19'     #  0x0019 -> CONTROL CHARACTER
    '\x1a'     #  0x001a -> CONTROL CHARACTER
    '\x1b'     #  0x001b -> CONTROL CHARACTER
    '\x1c'     #  0x001c -> CONTROL CHARACTER
    '\x1d'     #  0x001d -> CONTROL CHARACTER
    '\x1e'     #  0x001e -> CONTROL CHARACTER
    '\x1f'     #  0x001f -> CONTROL CHARACTER
    ' '        #  0x0020 -> SPACE, left-right
    '!'        #  0x0021 -> EXCLAMATION MARK, left-right
    '"'        #  0x0022 -> QUOTATION MARK, left-right
    '#'        #  0x0023 -> NUMBER SIGN, left-right
    '$'        #  0x0024 -> DOLLAR SIGN, left-right
    '%'        #  0x0025 -> PERCENT SIGN, left-right
    '&'        #  0x0026 -> AMPERSAND, left-right
    "'"        #  0x0027 -> APOSTROPHE, left-right
    '('        #  0x0028 -> LEFT PARENTHESIS, left-right
    ')'        #  0x0029 -> RIGHT PARENTHESIS, left-right
    '*'        #  0x002a -> ASTERISK, left-right
    '+'        #  0x002b -> PLUS SIGN, left-right
    ','        #  0x002c -> COMMA, left-right; in Arabic-script context, displayed as 0x066C ARABIC THOUSANDS SEPARATOR
    '-'        #  0x002d -> HYPHEN-MINUS, left-right
    '.'        #  0x002e -> FULL STOP, left-right; in Arabic-script context, displayed as 0x066B ARABIC DECIMAL SEPARATOR
    '/'        #  0x002f -> SOLIDUS, left-right
    '0'        #  0x0030 -> DIGIT ZERO;  in Arabic-script context, displayed as 0x0660 ARABIC-INDIC DIGIT ZERO
    '1'        #  0x0031 -> DIGIT ONE;   in Arabic-script context, displayed as 0x0661 ARABIC-INDIC DIGIT ONE
    '2'        #  0x0032 -> DIGIT TWO;   in Arabic-script context, displayed as 0x0662 ARABIC-INDIC DIGIT TWO
    '3'        #  0x0033 -> DIGIT THREE; in Arabic-script context, displayed as 0x0663 ARABIC-INDIC DIGIT THREE
    '4'        #  0x0034 -> DIGIT FOUR;  in Arabic-script context, displayed as 0x0664 ARABIC-INDIC DIGIT FOUR
    '5'        #  0x0035 -> DIGIT FIVE;  in Arabic-script context, displayed as 0x0665 ARABIC-INDIC DIGIT FIVE
    '6'        #  0x0036 -> DIGIT SIX;   in Arabic-script context, displayed as 0x0666 ARABIC-INDIC DIGIT SIX
    '7'        #  0x0037 -> DIGIT SEVEN; in Arabic-script context, displayed as 0x0667 ARABIC-INDIC DIGIT SEVEN
    '8'        #  0x0038 -> DIGIT EIGHT; in Arabic-script context, displayed as 0x0668 ARABIC-INDIC DIGIT EIGHT
    '9'        #  0x0039 -> DIGIT NINE;  in Arabic-script context, displayed as 0x0669 ARABIC-INDIC DIGIT NINE
    ':'        #  0x003a -> COLON, left-right
    ';'        #  0x003b -> SEMICOLON, left-right
    '<'        #  0x003c -> LESS-THAN SIGN, left-right
    '='        #  0x003d -> EQUALS SIGN, left-right
    '>'        #  0x003e -> GREATER-THAN SIGN, left-right
    '?'        #  0x003f -> QUESTION MARK, left-right
    '@'        #  0x0040 -> COMMERCIAL AT
    'A'        #  0x0041 -> LATIN CAPITAL LETTER A
    'B'        #  0x0042 -> LATIN CAPITAL LETTER B
    'C'        #  0x0043 -> LATIN CAPITAL LETTER C
    'D'        #  0x0044 -> LATIN CAPITAL LETTER D
    'E'        #  0x0045 -> LATIN CAPITAL LETTER E
    'F'        #  0x0046 -> LATIN CAPITAL LETTER F
    'G'        #  0x0047 -> LATIN CAPITAL LETTER G
    'H'        #  0x0048 -> LATIN CAPITAL LETTER H
    'I'        #  0x0049 -> LATIN CAPITAL LETTER I
    'J'        #  0x004a -> LATIN CAPITAL LETTER J
    'K'        #  0x004b -> LATIN CAPITAL LETTER K
    'L'        #  0x004c -> LATIN CAPITAL LETTER L
    'M'        #  0x004d -> LATIN CAPITAL LETTER M
    'N'        #  0x004e -> LATIN CAPITAL LETTER N
    'O'        #  0x004f -> LATIN CAPITAL LETTER O
    'P'        #  0x0050 -> LATIN CAPITAL LETTER P
    'Q'        #  0x0051 -> LATIN CAPITAL LETTER Q
    'R'        #  0x0052 -> LATIN CAPITAL LETTER R
    'S'        #  0x0053 -> LATIN CAPITAL LETTER S
    'T'        #  0x0054 -> LATIN CAPITAL LETTER T
    'U'        #  0x0055 -> LATIN CAPITAL LETTER U
    'V'        #  0x0056 -> LATIN CAPITAL LETTER V
    'W'        #  0x0057 -> LATIN CAPITAL LETTER W
    'X'        #  0x0058 -> LATIN CAPITAL LETTER X
    'Y'        #  0x0059 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x005a -> LATIN CAPITAL LETTER Z
    '['        #  0x005b -> LEFT SQUARE BRACKET, left-right
    '\\'       #  0x005c -> REVERSE SOLIDUS, left-right
    ']'        #  0x005d -> RIGHT SQUARE BRACKET, left-right
    '^'        #  0x005e -> CIRCUMFLEX ACCENT, left-right
    '_'        #  0x005f -> LOW LINE, left-right
    '`'        #  0x0060 -> GRAVE ACCENT
    'a'        #  0x0061 -> LATIN SMALL LETTER A
    'b'        #  0x0062 -> LATIN SMALL LETTER B
    'c'        #  0x0063 -> LATIN SMALL LETTER C
    'd'        #  0x0064 -> LATIN SMALL LETTER D
    'e'        #  0x0065 -> LATIN SMALL LETTER E
    'f'        #  0x0066 -> LATIN SMALL LETTER F
    'g'        #  0x0067 -> LATIN SMALL LETTER G
    'h'        #  0x0068 -> LATIN SMALL LETTER H
    'i'        #  0x0069 -> LATIN SMALL LETTER I
    'j'        #  0x006a -> LATIN SMALL LETTER J
    'k'        #  0x006b -> LATIN SMALL LETTER K
    'l'        #  0x006c -> LATIN SMALL LETTER L
    'm'        #  0x006d -> LATIN SMALL LETTER M
    'n'        #  0x006e -> LATIN SMALL LETTER N
    'o'        #  0x006f -> LATIN SMALL LETTER O
    'p'        #  0x0070 -> LATIN SMALL LETTER P
    'q'        #  0x0071 -> LATIN SMALL LETTER Q
    'r'        #  0x0072 -> LATIN SMALL LETTER R
    's'        #  0x0073 -> LATIN SMALL LETTER S
    't'        #  0x0074 -> LATIN SMALL LETTER T
    'u'        #  0x0075 -> LATIN SMALL LETTER U
    'v'        #  0x0076 -> LATIN SMALL LETTER V
    'w'        #  0x0077 -> LATIN SMALL LETTER W
    'x'        #  0x0078 -> LATIN SMALL LETTER X
    'y'        #  0x0079 -> LATIN SMALL LETTER Y
    'z'        #  0x007a -> LATIN SMALL LETTER Z
    '{'        #  0x007b -> LEFT CURLY BRACKET, left-right
    '|'        #  0x007c -> VERTICAL LINE, left-right
    '}'        #  0x007d -> RIGHT CURLY BRACKET, left-right
    '~'        #  0x007e -> TILDE
    '\x7f'     #  0x007f -> CONTROL CHARACTER
    '\xc4'     #  0x0080 -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\xa0'     #  0x0081 -> NO-BREAK SPACE, right-left
    '\xc7'     #  0x0082 -> LATIN CAPITAL LETTER C WITH CEDILLA
    '\xc9'     #  0x0083 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\xd1'     #  0x0084 -> LATIN CAPITAL LETTER N WITH TILDE
    '\xd6'     #  0x0085 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xdc'     #  0x0086 -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\xe1'     #  0x0087 -> LATIN SMALL LETTER A WITH ACUTE
    '\xe0'     #  0x0088 -> LATIN SMALL LETTER A WITH GRAVE
    '\xe2'     #  0x0089 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\xe4'     #  0x008a -> LATIN SMALL LETTER A WITH DIAERESIS
    '\u06ba'   #  0x008b -> ARABIC LETTER NOON GHUNNA
    '\xab'     #  0x008c -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK, right-left
    '\xe7'     #  0x008d -> LATIN SMALL LETTER C WITH CEDILLA
    '\xe9'     #  0x008e -> LATIN SMALL LETTER E WITH ACUTE
    '\xe8'     #  0x008f -> LATIN SMALL LETTER E WITH GRAVE
    '\xea'     #  0x0090 -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xeb'     #  0x0091 -> LATIN SMALL LETTER E WITH DIAERESIS
    '\xed'     #  0x0092 -> LATIN SMALL LETTER I WITH ACUTE
    '\u2026'   #  0x0093 -> HORIZONTAL ELLIPSIS, right-left
    '\xee'     #  0x0094 -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\xef'     #  0x0095 -> LATIN SMALL LETTER I WITH DIAERESIS
    '\xf1'     #  0x0096 -> LATIN SMALL LETTER N WITH TILDE
    '\xf3'     #  0x0097 -> LATIN SMALL LETTER O WITH ACUTE
    '\xbb'     #  0x0098 -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK, right-left
    '\xf4'     #  0x0099 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xf6'     #  0x009a -> LATIN SMALL LETTER O WITH DIAERESIS
    '\xf7'     #  0x009b -> DIVISION SIGN, right-left
    '\xfa'     #  0x009c -> LATIN SMALL LETTER U WITH ACUTE
    '\xf9'     #  0x009d -> LATIN SMALL LETTER U WITH GRAVE
    '\xfb'     #  0x009e -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\xfc'     #  0x009f -> LATIN SMALL LETTER U WITH DIAERESIS
    ' '        #  0x00a0 -> SPACE, right-left
    '!'        #  0x00a1 -> EXCLAMATION MARK, right-left
    '"'        #  0x00a2 -> QUOTATION MARK, right-left
    '#'        #  0x00a3 -> NUMBER SIGN, right-left
    '$'        #  0x00a4 -> DOLLAR SIGN, right-left
    '\u066a'   #  0x00a5 -> ARABIC PERCENT SIGN
    '&'        #  0x00a6 -> AMPERSAND, right-left
    "'"        #  0x00a7 -> APOSTROPHE, right-left
    '('        #  0x00a8 -> LEFT PARENTHESIS, right-left
    ')'        #  0x00a9 -> RIGHT PARENTHESIS, right-left
    '*'        #  0x00aa -> ASTERISK, right-left
    '+'        #  0x00ab -> PLUS SIGN, right-left
    '\u060c'   #  0x00ac -> ARABIC COMMA
    '-'        #  0x00ad -> HYPHEN-MINUS, right-left
    '.'        #  0x00ae -> FULL STOP, right-left
    '/'        #  0x00af -> SOLIDUS, right-left
    '\u0660'   #  0x00b0 -> ARABIC-INDIC DIGIT ZERO, right-left (need override)
    '\u0661'   #  0x00b1 -> ARABIC-INDIC DIGIT ONE, right-left (need override)
    '\u0662'   #  0x00b2 -> ARABIC-INDIC DIGIT TWO, right-left (need override)
    '\u0663'   #  0x00b3 -> ARABIC-INDIC DIGIT THREE, right-left (need override)
    '\u0664'   #  0x00b4 -> ARABIC-INDIC DIGIT FOUR, right-left (need override)
    '\u0665'   #  0x00b5 -> ARABIC-INDIC DIGIT FIVE, right-left (need override)
    '\u0666'   #  0x00b6 -> ARABIC-INDIC DIGIT SIX, right-left (need override)
    '\u0667'   #  0x00b7 -> ARABIC-INDIC DIGIT SEVEN, right-left (need override)
    '\u0668'   #  0x00b8 -> ARABIC-INDIC DIGIT EIGHT, right-left (need override)
    '\u0669'   #  0x00b9 -> ARABIC-INDIC DIGIT NINE, right-left (need override)
    ':'        #  0x00ba -> COLON, right-left
    '\u061b'   #  0x00bb -> ARABIC SEMICOLON
    '<'        #  0x00bc -> LESS-THAN SIGN, right-left
    '='        #  0x00bd -> EQUALS SIGN, right-left
    '>'        #  0x00be -> GREATER-THAN SIGN, right-left
    '\u061f'   #  0x00bf -> ARABIC QUESTION MARK
    '\u274a'   #  0x00c0 -> EIGHT TEARDROP-SPOKED PROPELLER ASTERISK, right-left
    '\u0621'   #  0x00c1 -> ARABIC LETTER HAMZA
    '\u0622'   #  0x00c2 -> ARABIC LETTER ALEF WITH MADDA ABOVE
    '\u0623'   #  0x00c3 -> ARABIC LETTER ALEF WITH HAMZA ABOVE
    '\u0624'   #  0x00c4 -> ARABIC LETTER WAW WITH HAMZA ABOVE
    '\u0625'   #  0x00c5 -> ARABIC LETTER ALEF WITH HAMZA BELOW
    '\u0626'   #  0x00c6 -> ARABIC LETTER YEH WITH HAMZA ABOVE
    '\u0627'   #  0x00c7 -> ARABIC LETTER ALEF
    '\u0628'   #  0x00c8 -> ARABIC LETTER BEH
    '\u0629'   #  0x00c9 -> ARABIC LETTER TEH MARBUTA
    '\u062a'   #  0x00ca -> ARABIC LETTER TEH
    '\u062b'   #  0x00cb -> ARABIC LETTER THEH
    '\u062c'   #  0x00cc -> ARABIC LETTER JEEM
    '\u062d'   #  0x00cd -> ARABIC LETTER HAH
    '\u062e'   #  0x00ce -> ARABIC LETTER KHAH
    '\u062f'   #  0x00cf -> ARABIC LETTER DAL
    '\u0630'   #  0x00d0 -> ARABIC LETTER THAL
    '\u0631'   #  0x00d1 -> ARABIC LETTER REH
    '\u0632'   #  0x00d2 -> ARABIC LETTER ZAIN
    '\u0633'   #  0x00d3 -> ARABIC LETTER SEEN
    '\u0634'   #  0x00d4 -> ARABIC LETTER SHEEN
    '\u0635'   #  0x00d5 -> ARABIC LETTER SAD
    '\u0636'   #  0x00d6 -> ARABIC LETTER DAD
    '\u0637'   #  0x00d7 -> ARABIC LETTER TAH
    '\u0638'   #  0x00d8 -> ARABIC LETTER ZAH
    '\u0639'   #  0x00d9 -> ARABIC LETTER AIN
    '\u063a'   #  0x00da -> ARABIC LETTER GHAIN
    '['        #  0x00db -> LEFT SQUARE BRACKET, right-left
    '\\'       #  0x00dc -> REVERSE SOLIDUS, right-left
    ']'        #  0x00dd -> RIGHT SQUARE BRACKET, right-left
    '^'        #  0x00de -> CIRCUMFLEX ACCENT, right-left
    '_'        #  0x00df -> LOW LINE, right-left
    '\u0640'   #  0x00e0 -> ARABIC TATWEEL
    '\u0641'   #  0x00e1 -> ARABIC LETTER FEH
    '\u0642'   #  0x00e2 -> ARABIC LETTER QAF
    '\u0643'   #  0x00e3 -> ARABIC LETTER KAF
    '\u0644'   #  0x00e4 -> ARABIC LETTER LAM
    '\u0645'   #  0x00e5 -> ARABIC LETTER MEEM
    '\u0646'   #  0x00e6 -> ARABIC LETTER NOON
    '\u0647'   #  0x00e7 -> ARABIC LETTER HEH
    '\u0648'   #  0x00e8 -> ARABIC LETTER WAW
    '\u0649'   #  0x00e9 -> ARABIC LETTER ALEF MAKSURA
    '\u064a'   #  0x00ea -> ARABIC LETTER YEH
    '\u064b'   #  0x00eb -> ARABIC FATHATAN
    '\u064c'   #  0x00ec -> ARABIC DAMMATAN
    '\u064d'   #  0x00ed -> ARABIC KASRATAN
    '\u064e'   #  0x00ee -> ARABIC FATHA
    '\u064f'   #  0x00ef -> ARABIC DAMMA
    '\u0650'   #  0x00f0 -> ARABIC KASRA
    '\u0651'   #  0x00f1 -> ARABIC SHADDA
    '\u0652'   #  0x00f2 -> ARABIC SUKUN
    '\u067e'   #  0x00f3 -> ARABIC LETTER PEH
    '\u0679'   #  0x00f4 -> ARABIC LETTER TTEH
    '\u0686'   #  0x00f5 -> ARABIC LETTER TCHEH
    '\u06d5'   #  0x00f6 -> ARABIC LETTER AE
    '\u06a4'   #  0x00f7 -> ARABIC LETTER VEH
    '\u06af'   #  0x00f8 -> ARABIC LETTER GAF
    '\u0688'   #  0x00f9 -> ARABIC LETTER DDAL
    '\u0691'   #  0x00fa -> ARABIC LETTER RREH
    '{'        #  0x00fb -> LEFT CURLY BRACKET, right-left
    '|'        #  0x00fc -> VERTICAL LINE, right-left
    '}'        #  0x00fd -> RIGHT CURLY BRACKET, right-left
    '\u0698'   #  0x00fe -> ARABIC LETTER JEH
    '\u06d2'   #  0x00ff -> ARABIC LETTER YEH BARREE
)

### Encoding Map

encoding_map = {
    0x0000: 0x0000,     #  CONTROL CHARACTER
    0x0001: 0x0001,     #  CONTROL CHARACTER
    0x0002: 0x0002,     #  CONTROL CHARACTER
    0x0003: 0x0003,     #  CONTROL CHARACTER
    0x0004: 0x0004,     #  CONTROL CHARACTER
    0x0005: 0x0005,     #  CONTROL CHARACTER
    0x0006: 0x0006,     #  CONTROL CHARACTER
    0x0007: 0x0007,     #  CONTROL CHARACTER
    0x0008: 0x0008,     #  CONTROL CHARACTER
    0x0009: 0x0009,     #  CONTROL CHARACTER
    0x000a: 0x000a,     #  CONTROL CHARACTER
    0x000b: 0x000b,     #  CONTROL CHARACTER
    0x000c: 0x000c,     #  CONTROL CHARACTER
    0x000d: 0x000d,     #  CONTROL CHARACTER
    0x000e: 0x000e,     #  CONTROL CHARACTER
    0x000f: 0x000f,     #  CONTROL CHARACTER
    0x0010: 0x0010,     #  CONTROL CHARACTER
    0x0011: 0x0011,     #  CONTROL CHARACTER
    0x0012: 0x0012,     #  CONTROL CHARACTER
    0x0013: 0x0013,     #  CONTROL CHARACTER
    0x0014: 0x0014,     #  CONTROL CHARACTER
    0x0015: 0x0015,     #  CONTROL CHARACTER
    0x0016: 0x0016,     #  CONTROL CHARACTER
    0x0017: 0x0017,     #  CONTROL CHARACTER
    0x0018: 0x0018,     #  CONTROL CHARACTER
    0x0019: 0x0019,     #  CONTROL CHARACTER
    0x001a: 0x001a,     #  CONTROL CHARACTER
    0x001b: 0x001b,     #  CONTROL CHARACTER
    0x001c: 0x001c,     #  CONTROL CHARACTER
    0x001d: 0x001d,     #  CONTROL CHARACTER
    0x001e: 0x001e,     #  CONTROL CHARACTER
    0x001f: 0x001f,     #  CONTROL CHARACTER
    0x0020: 0x0020,     #  SPACE, left-right
    0x0020: 0x00a0,     #  SPACE, right-left
    0x0021: 0x0021,     #  EXCLAMATION MARK, left-right
    0x0021: 0x00a1,     #  EXCLAMATION MARK, right-left
    0x0022: 0x0022,     #  QUOTATION MARK, left-right
    0x0022: 0x00a2,     #  QUOTATION MARK, right-left
    0x0023: 0x0023,     #  NUMBER SIGN, left-right
    0x0023: 0x00a3,     #  NUMBER SIGN, right-left
    0x0024: 0x0024,     #  DOLLAR SIGN, left-right
    0x0024: 0x00a4,     #  DOLLAR SIGN, right-left
    0x0025: 0x0025,     #  PERCENT SIGN, left-right
    0x0026: 0x0026,     #  AMPERSAND, left-right
    0x0026: 0x00a6,     #  AMPERSAND, right-left
    0x0027: 0x0027,     #  APOSTROPHE, left-right
    0x0027: 0x00a7,     #  APOSTROPHE, right-left
    0x0028: 0x0028,     #  LEFT PARENTHESIS, left-right
    0x0028: 0x00a8,     #  LEFT PARENTHESIS, right-left
    0x0029: 0x0029,     #  RIGHT PARENTHESIS, left-right
    0x0029: 0x00a9,     #  RIGHT PARENTHESIS, right-left
    0x002a: 0x002a,     #  ASTERISK, left-right
    0x002a: 0x00aa,     #  ASTERISK, right-left
    0x002b: 0x002b,     #  PLUS SIGN, left-right
    0x002b: 0x00ab,     #  PLUS SIGN, right-left
    0x002c: 0x002c,     #  COMMA, left-right; in Arabic-script context, displayed as 0x066C ARABIC THOUSANDS SEPARATOR
    0x002d: 0x002d,     #  HYPHEN-MINUS, left-right
    0x002d: 0x00ad,     #  HYPHEN-MINUS, right-left
    0x002e: 0x002e,     #  FULL STOP, left-right; in Arabic-script context, displayed as 0x066B ARABIC DECIMAL SEPARATOR
    0x002e: 0x00ae,     #  FULL STOP, right-left
    0x002f: 0x002f,     #  SOLIDUS, left-right
    0x002f: 0x00af,     #  SOLIDUS, right-left
    0x0030: 0x0030,     #  DIGIT ZERO;  in Arabic-script context, displayed as 0x0660 ARABIC-INDIC DIGIT ZERO
    0x0031: 0x0031,     #  DIGIT ONE;   in Arabic-script context, displayed as 0x0661 ARABIC-INDIC DIGIT ONE
    0x0032: 0x0032,     #  DIGIT TWO;   in Arabic-script context, displayed as 0x0662 ARABIC-INDIC DIGIT TWO
    0x0033: 0x0033,     #  DIGIT THREE; in Arabic-script context, displayed as 0x0663 ARABIC-INDIC DIGIT THREE
    0x0034: 0x0034,     #  DIGIT FOUR;  in Arabic-script context, displayed as 0x0664 ARABIC-INDIC DIGIT FOUR
    0x0035: 0x0035,     #  DIGIT FIVE;  in Arabic-script context, displayed as 0x0665 ARABIC-INDIC DIGIT FIVE
    0x0036: 0x0036,     #  DIGIT SIX;   in Arabic-script context, displayed as 0x0666 ARABIC-INDIC DIGIT SIX
    0x0037: 0x0037,     #  DIGIT SEVEN; in Arabic-script context, displayed as 0x0667 ARABIC-INDIC DIGIT SEVEN
    0x0038: 0x0038,     #  DIGIT EIGHT; in Arabic-script context, displayed as 0x0668 ARABIC-INDIC DIGIT EIGHT
    0x0039: 0x0039,     #  DIGIT NINE;  in Arabic-script context, displayed as 0x0669 ARABIC-INDIC DIGIT NINE
    0x003a: 0x003a,     #  COLON, left-right
    0x003a: 0x00ba,     #  COLON, right-left
    0x003b: 0x003b,     #  SEMICOLON, left-right
    0x003c: 0x003c,     #  LESS-THAN SIGN, left-right
    0x003c: 0x00bc,     #  LESS-THAN SIGN, right-left
    0x003d: 0x003d,     #  EQUALS SIGN, left-right
    0x003d: 0x00bd,     #  EQUALS SIGN, right-left
    0x003e: 0x003e,     #  GREATER-THAN SIGN, left-right
    0x003e: 0x00be,     #  GREATER-THAN SIGN, right-left
    0x003f: 0x003f,     #  QUESTION MARK, left-right
    0x0040: 0x0040,     #  COMMERCIAL AT
    0x0041: 0x0041,     #  LATIN CAPITAL LETTER A
    0x0042: 0x0042,     #  LATIN CAPITAL LETTER B
    0x0043: 0x0043,     #  LATIN CAPITAL LETTER C
    0x0044: 0x0044,     #  LATIN CAPITAL LETTER D
    0x0045: 0x0045,     #  LATIN CAPITAL LETTER E
    0x0046: 0x0046,     #  LATIN CAPITAL LETTER F
    0x0047: 0x0047,     #  LATIN CAPITAL LETTER G
    0x0048: 0x0048,     #  LATIN CAPITAL LETTER H
    0x0049: 0x0049,     #  LATIN CAPITAL LETTER I
    0x004a: 0x004a,     #  LATIN CAPITAL LETTER J
    0x004b: 0x004b,     #  LATIN CAPITAL LETTER K
    0x004c: 0x004c,     #  LATIN CAPITAL LETTER L
    0x004d: 0x004d,     #  LATIN CAPITAL LETTER M
    0x004e: 0x004e,     #  LATIN CAPITAL LETTER N
    0x004f: 0x004f,     #  LATIN CAPITAL LETTER O
    0x0050: 0x0050,     #  LATIN CAPITAL LETTER P
    0x0051: 0x0051,     #  LATIN CAPITAL LETTER Q
    0x0052: 0x0052,     #  LATIN CAPITAL LETTER R
    0x0053: 0x0053,     #  LATIN CAPITAL LETTER S
    0x0054: 0x0054,     #  LATIN CAPITAL LETTER T
    0x0055: 0x0055,     #  LATIN CAPITAL LETTER U
    0x0056: 0x0056,     #  LATIN CAPITAL LETTER V
    0x0057: 0x0057,     #  LATIN CAPITAL LETTER W
    0x0058: 0x0058,     #  LATIN CAPITAL LETTER X
    0x0059: 0x0059,     #  LATIN CAPITAL LETTER Y
    0x005a: 0x005a,     #  LATIN CAPITAL LETTER Z
    0x005b: 0x005b,     #  LEFT SQUARE BRACKET, left-right
    0x005b: 0x00db,     #  LEFT SQUARE BRACKET, right-left
    0x005c: 0x005c,     #  REVERSE SOLIDUS, left-right
    0x005c: 0x00dc,     #  REVERSE SOLIDUS, right-left
    0x005d: 0x005d,     #  RIGHT SQUARE BRACKET, left-right
    0x005d: 0x00dd,     #  RIGHT SQUARE BRACKET, right-left
    0x005e: 0x005e,     #  CIRCUMFLEX ACCENT, left-right
    0x005e: 0x00de,     #  CIRCUMFLEX ACCENT, right-left
    0x005f: 0x005f,     #  LOW LINE, left-right
    0x005f: 0x00df,     #  LOW LINE, right-left
    0x0060: 0x0060,     #  GRAVE ACCENT
    0x0061: 0x0061,     #  LATIN SMALL LETTER A
    0x0062: 0x0062,     #  LATIN SMALL LETTER B
    0x0063: 0x0063,     #  LATIN SMALL LETTER C
    0x0064: 0x0064,     #  LATIN SMALL LETTER D
    0x0065: 0x0065,     #  LATIN SMALL LETTER E
    0x0066: 0x0066,     #  LATIN SMALL LETTER F
    0x0067: 0x0067,     #  LATIN SMALL LETTER G
    0x0068: 0x0068,     #  LATIN SMALL LETTER H
    0x0069: 0x0069,     #  LATIN SMALL LETTER I
    0x006a: 0x006a,     #  LATIN SMALL LETTER J
    0x006b: 0x006b,     #  LATIN SMALL LETTER K
    0x006c: 0x006c,     #  LATIN SMALL LETTER L
    0x006d: 0x006d,     #  LATIN SMALL LETTER M
    0x006e: 0x006e,     #  LATIN SMALL LETTER N
    0x006f: 0x006f,     #  LATIN SMALL LETTER O
    0x0070: 0x0070,     #  LATIN SMALL LETTER P
    0x0071: 0x0071,     #  LATIN SMALL LETTER Q
    0x0072: 0x0072,     #  LATIN SMALL LETTER R
    0x0073: 0x0073,     #  LATIN SMALL LETTER S
    0x0074: 0x0074,     #  LATIN SMALL LETTER T
    0x0075: 0x0075,     #  LATIN SMALL LETTER U
    0x0076: 0x0076,     #  LATIN SMALL LETTER V
    0x0077: 0x0077,     #  LATIN SMALL LETTER W
    0x0078: 0x0078,     #  LATIN SMALL LETTER X
    0x0079: 0x0079,     #  LATIN SMALL LETTER Y
    0x007a: 0x007a,     #  LATIN SMALL LETTER Z
    0x007b: 0x007b,     #  LEFT CURLY BRACKET, left-right
    0x007b: 0x00fb,     #  LEFT CURLY BRACKET, right-left
    0x007c: 0x007c,     #  VERTICAL LINE, left-right
    0x007c: 0x00fc,     #  VERTICAL LINE, right-left
    0x007d: 0x007d,     #  RIGHT CURLY BRACKET, left-right
    0x007d: 0x00fd,     #  RIGHT CURLY BRACKET, right-left
    0x007e: 0x007e,     #  TILDE
    0x007f: 0x007f,     #  CONTROL CHARACTER
    0x00a0: 0x0081,     #  NO-BREAK SPACE, right-left
    0x00ab: 0x008c,     #  LEFT-POINTING DOUBLE ANGLE QUOTATION MARK, right-left
    0x00bb: 0x0098,     #  RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK, right-left
    0x00c4: 0x0080,     #  LATIN CAPITAL LETTER A WITH DIAERESIS
    0x00c7: 0x0082,     #  LATIN CAPITAL LETTER C WITH CEDILLA
    0x00c9: 0x0083,     #  LATIN CAPITAL LETTER E WITH ACUTE
    0x00d1: 0x0084,     #  LATIN CAPITAL LETTER N WITH TILDE
    0x00d6: 0x0085,     #  LATIN CAPITAL LETTER O WITH DIAERESIS
    0x00dc: 0x0086,     #  LATIN CAPITAL LETTER U WITH DIAERESIS
    0x00e0: 0x0088,     #  LATIN SMALL LETTER A WITH GRAVE
    0x00e1: 0x0087,     #  LATIN SMALL LETTER A WITH ACUTE
    0x00e2: 0x0089,     #  LATIN SMALL LETTER A WITH CIRCUMFLEX
    0x00e4: 0x008a,     #  LATIN SMALL LETTER A WITH DIAERESIS
    0x00e7: 0x008d,     #  LATIN SMALL LETTER C WITH CEDILLA
    0x00e8: 0x008f,     #  LATIN SMALL LETTER E WITH GRAVE
    0x00e9: 0x008e,     #  LATIN SMALL LETTER E WITH ACUTE
    0x00ea: 0x0090,     #  LATIN SMALL LETTER E WITH CIRCUMFLEX
    0x00eb: 0x0091,     #  LATIN SMALL LETTER E WITH DIAERESIS
    0x00ed: 0x0092,     #  LATIN SMALL LETTER I WITH ACUTE
    0x00ee: 0x0094,     #  LATIN SMALL LETTER I WITH CIRCUMFLEX
    0x00ef: 0x0095,     #  LATIN SMALL LETTER I WITH DIAERESIS
    0x00f1: 0x0096,     #  LATIN SMALL LETTER N WITH TILDE
    0x00f3: 0x0097,     #  LATIN SMALL LETTER O WITH ACUTE
    0x00f4: 0x0099,     #  LATIN SMALL LETTER O WITH CIRCUMFLEX
    0x00f6: 0x009a,     #  LATIN SMALL LETTER O WITH DIAERESIS
    0x00f7: 0x009b,     #  DIVISION SIGN, right-left
    0x00f9: 0x009d,     #  LATIN SMALL LETTER U WITH GRAVE
    0x00fa: 0x009c,     #  LATIN SMALL LETTER U WITH ACUTE
    0x00fb: 0x009e,     #  LATIN SMALL LETTER U WITH CIRCUMFLEX
    0x00fc: 0x009f,     #  LATIN SMALL LETTER U WITH DIAERESIS
    0x060c: 0x00ac,     #  ARABIC COMMA
    0x061b: 0x00bb,     #  ARABIC SEMICOLON
    0x061f: 0x00bf,     #  ARABIC QUESTION MARK
    0x0621: 0x00c1,     #  ARABIC LETTER HAMZA
    0x0622: 0x00c2,     #  ARABIC LETTER ALEF WITH MADDA ABOVE
    0x0623: 0x00c3,     #  ARABIC LETTER ALEF WITH HAMZA ABOVE
    0x0624: 0x00c4,     #  ARABIC LETTER WAW WITH HAMZA ABOVE
    0x0625: 0x00c5,     #  ARABIC LETTER ALEF WITH HAMZA BELOW
    0x0626: 0x00c6,     #  ARABIC LETTER YEH WITH HAMZA ABOVE
    0x0627: 0x00c7,     #  ARABIC LETTER ALEF
    0x0628: 0x00c8,     #  ARABIC LETTER BEH
    0x0629: 0x00c9,     #  ARABIC LETTER TEH MARBUTA
    0x062a: 0x00ca,     #  ARABIC LETTER TEH
    0x062b: 0x00cb,     #  ARABIC LETTER THEH
    0x062c: 0x00cc,     #  ARABIC LETTER JEEM
    0x062d: 0x00cd,     #  ARABIC LETTER HAH
    0x062e: 0x00ce,     #  ARABIC LETTER KHAH
    0x062f: 0x00cf,     #  ARABIC LETTER DAL
    0x0630: 0x00d0,     #  ARABIC LETTER THAL
    0x0631: 0x00d1,     #  ARABIC LETTER REH
    0x0632: 0x00d2,     #  ARABIC LETTER ZAIN
    0x0633: 0x00d3,     #  ARABIC LETTER SEEN
    0x0634: 0x00d4,     #  ARABIC LETTER SHEEN
    0x0635: 0x00d5,     #  ARABIC LETTER SAD
    0x0636: 0x00d6,     #  ARABIC LETTER DAD
    0x0637: 0x00d7,     #  ARABIC LETTER TAH
    0x0638: 0x00d8,     #  ARABIC LETTER ZAH
    0x0639: 0x00d9,     #  ARABIC LETTER AIN
    0x063a: 0x00da,     #  ARABIC LETTER GHAIN
    0x0640: 0x00e0,     #  ARABIC TATWEEL
    0x0641: 0x00e1,     #  ARABIC LETTER FEH
    0x0642: 0x00e2,     #  ARABIC LETTER QAF
    0x0643: 0x00e3,     #  ARABIC LETTER KAF
    0x0644: 0x00e4,     #  ARABIC LETTER LAM
    0x0645: 0x00e5,     #  ARABIC LETTER MEEM
    0x0646: 0x00e6,     #  ARABIC LETTER NOON
    0x0647: 0x00e7,     #  ARABIC LETTER HEH
    0x0648: 0x00e8,     #  ARABIC LETTER WAW
    0x0649: 0x00e9,     #  ARABIC LETTER ALEF MAKSURA
    0x064a: 0x00ea,     #  ARABIC LETTER YEH
    0x064b: 0x00eb,     #  ARABIC FATHATAN
    0x064c: 0x00ec,     #  ARABIC DAMMATAN
    0x064d: 0x00ed,     #  ARABIC KASRATAN
    0x064e: 0x00ee,     #  ARABIC FATHA
    0x064f: 0x00ef,     #  ARABIC DAMMA
    0x0650: 0x00f0,     #  ARABIC KASRA
    0x0651: 0x00f1,     #  ARABIC SHADDA
    0x0652: 0x00f2,     #  ARABIC SUKUN
    0x0660: 0x00b0,     #  ARABIC-INDIC DIGIT ZERO, right-left (need override)
    0x0661: 0x00b1,     #  ARABIC-INDIC DIGIT ONE, right-left (need override)
    0x0662: 0x00b2,     #  ARABIC-INDIC DIGIT TWO, right-left (need override)
    0x0663: 0x00b3,     #  ARABIC-INDIC DIGIT THREE, right-left (need override)
    0x0664: 0x00b4,     #  ARABIC-INDIC DIGIT FOUR, right-left (need override)
    0x0665: 0x00b5,     #  ARABIC-INDIC DIGIT FIVE, right-left (need override)
    0x0666: 0x00b6,     #  ARABIC-INDIC DIGIT SIX, right-left (need override)
    0x0667: 0x00b7,     #  ARABIC-INDIC DIGIT SEVEN, right-left (need override)
    0x0668: 0x00b8,     #  ARABIC-INDIC DIGIT EIGHT, right-left (need override)
    0x0669: 0x00b9,     #  ARABIC-INDIC DIGIT NINE, right-left (need override)
    0x066a: 0x00a5,     #  ARABIC PERCENT SIGN
    0x0679: 0x00f4,     #  ARABIC LETTER TTEH
    0x067e: 0x00f3,     #  ARABIC LETTER PEH
    0x0686: 0x00f5,     #  ARABIC LETTER TCHEH
    0x0688: 0x00f9,     #  ARABIC LETTER DDAL
    0x0691: 0x00fa,     #  ARABIC LETTER RREH
    0x0698: 0x00fe,     #  ARABIC LETTER JEH
    0x06a4: 0x00f7,     #  ARABIC LETTER VEH
    0x06af: 0x00f8,     #  ARABIC LETTER GAF
    0x06ba: 0x008b,     #  ARABIC LETTER NOON GHUNNA
    0x06d2: 0x00ff,     #  ARABIC LETTER YEH BARREE
    0x06d5: 0x00f6,     #  ARABIC LETTER AE
    0x2026: 0x0093,     #  HORIZONTAL ELLIPSIS, right-left
    0x274a: 0x00c0,     #  EIGHT TEARDROP-SPOKED PROPELLER ASTERISK, right-left
}
encodings/cp1254.py000064400000032276151153537620010027 0ustar00""" Python Character Mapping Codec cp1254 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1254.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp1254',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\u20ac'   #  0x80 -> EURO SIGN
    '\ufffe'   #  0x81 -> UNDEFINED
    '\u201a'   #  0x82 -> SINGLE LOW-9 QUOTATION MARK
    '\u0192'   #  0x83 -> LATIN SMALL LETTER F WITH HOOK
    '\u201e'   #  0x84 -> DOUBLE LOW-9 QUOTATION MARK
    '\u2026'   #  0x85 -> HORIZONTAL ELLIPSIS
    '\u2020'   #  0x86 -> DAGGER
    '\u2021'   #  0x87 -> DOUBLE DAGGER
    '\u02c6'   #  0x88 -> MODIFIER LETTER CIRCUMFLEX ACCENT
    '\u2030'   #  0x89 -> PER MILLE SIGN
    '\u0160'   #  0x8A -> LATIN CAPITAL LETTER S WITH CARON
    '\u2039'   #  0x8B -> SINGLE LEFT-POINTING ANGLE QUOTATION MARK
    '\u0152'   #  0x8C -> LATIN CAPITAL LIGATURE OE
    '\ufffe'   #  0x8D -> UNDEFINED
    '\ufffe'   #  0x8E -> UNDEFINED
    '\ufffe'   #  0x8F -> UNDEFINED
    '\ufffe'   #  0x90 -> UNDEFINED
    '\u2018'   #  0x91 -> LEFT SINGLE QUOTATION MARK
    '\u2019'   #  0x92 -> RIGHT SINGLE QUOTATION MARK
    '\u201c'   #  0x93 -> LEFT DOUBLE QUOTATION MARK
    '\u201d'   #  0x94 -> RIGHT DOUBLE QUOTATION MARK
    '\u2022'   #  0x95 -> BULLET
    '\u2013'   #  0x96 -> EN DASH
    '\u2014'   #  0x97 -> EM DASH
    '\u02dc'   #  0x98 -> SMALL TILDE
    '\u2122'   #  0x99 -> TRADE MARK SIGN
    '\u0161'   #  0x9A -> LATIN SMALL LETTER S WITH CARON
    '\u203a'   #  0x9B -> SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
    '\u0153'   #  0x9C -> LATIN SMALL LIGATURE OE
    '\ufffe'   #  0x9D -> UNDEFINED
    '\ufffe'   #  0x9E -> UNDEFINED
    '\u0178'   #  0x9F -> LATIN CAPITAL LETTER Y WITH DIAERESIS
    '\xa0'     #  0xA0 -> NO-BREAK SPACE
    '\xa1'     #  0xA1 -> INVERTED EXCLAMATION MARK
    '\xa2'     #  0xA2 -> CENT SIGN
    '\xa3'     #  0xA3 -> POUND SIGN
    '\xa4'     #  0xA4 -> CURRENCY SIGN
    '\xa5'     #  0xA5 -> YEN SIGN
    '\xa6'     #  0xA6 -> BROKEN BAR
    '\xa7'     #  0xA7 -> SECTION SIGN
    '\xa8'     #  0xA8 -> DIAERESIS
    '\xa9'     #  0xA9 -> COPYRIGHT SIGN
    '\xaa'     #  0xAA -> FEMININE ORDINAL INDICATOR
    '\xab'     #  0xAB -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xac'     #  0xAC -> NOT SIGN
    '\xad'     #  0xAD -> SOFT HYPHEN
    '\xae'     #  0xAE -> REGISTERED SIGN
    '\xaf'     #  0xAF -> MACRON
    '\xb0'     #  0xB0 -> DEGREE SIGN
    '\xb1'     #  0xB1 -> PLUS-MINUS SIGN
    '\xb2'     #  0xB2 -> SUPERSCRIPT TWO
    '\xb3'     #  0xB3 -> SUPERSCRIPT THREE
    '\xb4'     #  0xB4 -> ACUTE ACCENT
    '\xb5'     #  0xB5 -> MICRO SIGN
    '\xb6'     #  0xB6 -> PILCROW SIGN
    '\xb7'     #  0xB7 -> MIDDLE DOT
    '\xb8'     #  0xB8 -> CEDILLA
    '\xb9'     #  0xB9 -> SUPERSCRIPT ONE
    '\xba'     #  0xBA -> MASCULINE ORDINAL INDICATOR
    '\xbb'     #  0xBB -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbc'     #  0xBC -> VULGAR FRACTION ONE QUARTER
    '\xbd'     #  0xBD -> VULGAR FRACTION ONE HALF
    '\xbe'     #  0xBE -> VULGAR FRACTION THREE QUARTERS
    '\xbf'     #  0xBF -> INVERTED QUESTION MARK
    '\xc0'     #  0xC0 -> LATIN CAPITAL LETTER A WITH GRAVE
    '\xc1'     #  0xC1 -> LATIN CAPITAL LETTER A WITH ACUTE
    '\xc2'     #  0xC2 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    '\xc3'     #  0xC3 -> LATIN CAPITAL LETTER A WITH TILDE
    '\xc4'     #  0xC4 -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\xc5'     #  0xC5 -> LATIN CAPITAL LETTER A WITH RING ABOVE
    '\xc6'     #  0xC6 -> LATIN CAPITAL LETTER AE
    '\xc7'     #  0xC7 -> LATIN CAPITAL LETTER C WITH CEDILLA
    '\xc8'     #  0xC8 -> LATIN CAPITAL LETTER E WITH GRAVE
    '\xc9'     #  0xC9 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\xca'     #  0xCA -> LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    '\xcb'     #  0xCB -> LATIN CAPITAL LETTER E WITH DIAERESIS
    '\xcc'     #  0xCC -> LATIN CAPITAL LETTER I WITH GRAVE
    '\xcd'     #  0xCD -> LATIN CAPITAL LETTER I WITH ACUTE
    '\xce'     #  0xCE -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    '\xcf'     #  0xCF -> LATIN CAPITAL LETTER I WITH DIAERESIS
    '\u011e'   #  0xD0 -> LATIN CAPITAL LETTER G WITH BREVE
    '\xd1'     #  0xD1 -> LATIN CAPITAL LETTER N WITH TILDE
    '\xd2'     #  0xD2 -> LATIN CAPITAL LETTER O WITH GRAVE
    '\xd3'     #  0xD3 -> LATIN CAPITAL LETTER O WITH ACUTE
    '\xd4'     #  0xD4 -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    '\xd5'     #  0xD5 -> LATIN CAPITAL LETTER O WITH TILDE
    '\xd6'     #  0xD6 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xd7'     #  0xD7 -> MULTIPLICATION SIGN
    '\xd8'     #  0xD8 -> LATIN CAPITAL LETTER O WITH STROKE
    '\xd9'     #  0xD9 -> LATIN CAPITAL LETTER U WITH GRAVE
    '\xda'     #  0xDA -> LATIN CAPITAL LETTER U WITH ACUTE
    '\xdb'     #  0xDB -> LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    '\xdc'     #  0xDC -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\u0130'   #  0xDD -> LATIN CAPITAL LETTER I WITH DOT ABOVE
    '\u015e'   #  0xDE -> LATIN CAPITAL LETTER S WITH CEDILLA
    '\xdf'     #  0xDF -> LATIN SMALL LETTER SHARP S
    '\xe0'     #  0xE0 -> LATIN SMALL LETTER A WITH GRAVE
    '\xe1'     #  0xE1 -> LATIN SMALL LETTER A WITH ACUTE
    '\xe2'     #  0xE2 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\xe3'     #  0xE3 -> LATIN SMALL LETTER A WITH TILDE
    '\xe4'     #  0xE4 -> LATIN SMALL LETTER A WITH DIAERESIS
    '\xe5'     #  0xE5 -> LATIN SMALL LETTER A WITH RING ABOVE
    '\xe6'     #  0xE6 -> LATIN SMALL LETTER AE
    '\xe7'     #  0xE7 -> LATIN SMALL LETTER C WITH CEDILLA
    '\xe8'     #  0xE8 -> LATIN SMALL LETTER E WITH GRAVE
    '\xe9'     #  0xE9 -> LATIN SMALL LETTER E WITH ACUTE
    '\xea'     #  0xEA -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xeb'     #  0xEB -> LATIN SMALL LETTER E WITH DIAERESIS
    '\xec'     #  0xEC -> LATIN SMALL LETTER I WITH GRAVE
    '\xed'     #  0xED -> LATIN SMALL LETTER I WITH ACUTE
    '\xee'     #  0xEE -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\xef'     #  0xEF -> LATIN SMALL LETTER I WITH DIAERESIS
    '\u011f'   #  0xF0 -> LATIN SMALL LETTER G WITH BREVE
    '\xf1'     #  0xF1 -> LATIN SMALL LETTER N WITH TILDE
    '\xf2'     #  0xF2 -> LATIN SMALL LETTER O WITH GRAVE
    '\xf3'     #  0xF3 -> LATIN SMALL LETTER O WITH ACUTE
    '\xf4'     #  0xF4 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xf5'     #  0xF5 -> LATIN SMALL LETTER O WITH TILDE
    '\xf6'     #  0xF6 -> LATIN SMALL LETTER O WITH DIAERESIS
    '\xf7'     #  0xF7 -> DIVISION SIGN
    '\xf8'     #  0xF8 -> LATIN SMALL LETTER O WITH STROKE
    '\xf9'     #  0xF9 -> LATIN SMALL LETTER U WITH GRAVE
    '\xfa'     #  0xFA -> LATIN SMALL LETTER U WITH ACUTE
    '\xfb'     #  0xFB -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\xfc'     #  0xFC -> LATIN SMALL LETTER U WITH DIAERESIS
    '\u0131'   #  0xFD -> LATIN SMALL LETTER DOTLESS I
    '\u015f'   #  0xFE -> LATIN SMALL LETTER S WITH CEDILLA
    '\xff'     #  0xFF -> LATIN SMALL LETTER Y WITH DIAERESIS
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/cp1257.py000064400000032076151153537620010030 0ustar00""" Python Character Mapping Codec cp1257 generated from 'MAPPINGS/VENDORS/MICSFT/WINDOWS/CP1257.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp1257',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\u20ac'   #  0x80 -> EURO SIGN
    '\ufffe'   #  0x81 -> UNDEFINED
    '\u201a'   #  0x82 -> SINGLE LOW-9 QUOTATION MARK
    '\ufffe'   #  0x83 -> UNDEFINED
    '\u201e'   #  0x84 -> DOUBLE LOW-9 QUOTATION MARK
    '\u2026'   #  0x85 -> HORIZONTAL ELLIPSIS
    '\u2020'   #  0x86 -> DAGGER
    '\u2021'   #  0x87 -> DOUBLE DAGGER
    '\ufffe'   #  0x88 -> UNDEFINED
    '\u2030'   #  0x89 -> PER MILLE SIGN
    '\ufffe'   #  0x8A -> UNDEFINED
    '\u2039'   #  0x8B -> SINGLE LEFT-POINTING ANGLE QUOTATION MARK
    '\ufffe'   #  0x8C -> UNDEFINED
    '\xa8'     #  0x8D -> DIAERESIS
    '\u02c7'   #  0x8E -> CARON
    '\xb8'     #  0x8F -> CEDILLA
    '\ufffe'   #  0x90 -> UNDEFINED
    '\u2018'   #  0x91 -> LEFT SINGLE QUOTATION MARK
    '\u2019'   #  0x92 -> RIGHT SINGLE QUOTATION MARK
    '\u201c'   #  0x93 -> LEFT DOUBLE QUOTATION MARK
    '\u201d'   #  0x94 -> RIGHT DOUBLE QUOTATION MARK
    '\u2022'   #  0x95 -> BULLET
    '\u2013'   #  0x96 -> EN DASH
    '\u2014'   #  0x97 -> EM DASH
    '\ufffe'   #  0x98 -> UNDEFINED
    '\u2122'   #  0x99 -> TRADE MARK SIGN
    '\ufffe'   #  0x9A -> UNDEFINED
    '\u203a'   #  0x9B -> SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
    '\ufffe'   #  0x9C -> UNDEFINED
    '\xaf'     #  0x9D -> MACRON
    '\u02db'   #  0x9E -> OGONEK
    '\ufffe'   #  0x9F -> UNDEFINED
    '\xa0'     #  0xA0 -> NO-BREAK SPACE
    '\ufffe'   #  0xA1 -> UNDEFINED
    '\xa2'     #  0xA2 -> CENT SIGN
    '\xa3'     #  0xA3 -> POUND SIGN
    '\xa4'     #  0xA4 -> CURRENCY SIGN
    '\ufffe'   #  0xA5 -> UNDEFINED
    '\xa6'     #  0xA6 -> BROKEN BAR
    '\xa7'     #  0xA7 -> SECTION SIGN
    '\xd8'     #  0xA8 -> LATIN CAPITAL LETTER O WITH STROKE
    '\xa9'     #  0xA9 -> COPYRIGHT SIGN
    '\u0156'   #  0xAA -> LATIN CAPITAL LETTER R WITH CEDILLA
    '\xab'     #  0xAB -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xac'     #  0xAC -> NOT SIGN
    '\xad'     #  0xAD -> SOFT HYPHEN
    '\xae'     #  0xAE -> REGISTERED SIGN
    '\xc6'     #  0xAF -> LATIN CAPITAL LETTER AE
    '\xb0'     #  0xB0 -> DEGREE SIGN
    '\xb1'     #  0xB1 -> PLUS-MINUS SIGN
    '\xb2'     #  0xB2 -> SUPERSCRIPT TWO
    '\xb3'     #  0xB3 -> SUPERSCRIPT THREE
    '\xb4'     #  0xB4 -> ACUTE ACCENT
    '\xb5'     #  0xB5 -> MICRO SIGN
    '\xb6'     #  0xB6 -> PILCROW SIGN
    '\xb7'     #  0xB7 -> MIDDLE DOT
    '\xf8'     #  0xB8 -> LATIN SMALL LETTER O WITH STROKE
    '\xb9'     #  0xB9 -> SUPERSCRIPT ONE
    '\u0157'   #  0xBA -> LATIN SMALL LETTER R WITH CEDILLA
    '\xbb'     #  0xBB -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbc'     #  0xBC -> VULGAR FRACTION ONE QUARTER
    '\xbd'     #  0xBD -> VULGAR FRACTION ONE HALF
    '\xbe'     #  0xBE -> VULGAR FRACTION THREE QUARTERS
    '\xe6'     #  0xBF -> LATIN SMALL LETTER AE
    '\u0104'   #  0xC0 -> LATIN CAPITAL LETTER A WITH OGONEK
    '\u012e'   #  0xC1 -> LATIN CAPITAL LETTER I WITH OGONEK
    '\u0100'   #  0xC2 -> LATIN CAPITAL LETTER A WITH MACRON
    '\u0106'   #  0xC3 -> LATIN CAPITAL LETTER C WITH ACUTE
    '\xc4'     #  0xC4 -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\xc5'     #  0xC5 -> LATIN CAPITAL LETTER A WITH RING ABOVE
    '\u0118'   #  0xC6 -> LATIN CAPITAL LETTER E WITH OGONEK
    '\u0112'   #  0xC7 -> LATIN CAPITAL LETTER E WITH MACRON
    '\u010c'   #  0xC8 -> LATIN CAPITAL LETTER C WITH CARON
    '\xc9'     #  0xC9 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\u0179'   #  0xCA -> LATIN CAPITAL LETTER Z WITH ACUTE
    '\u0116'   #  0xCB -> LATIN CAPITAL LETTER E WITH DOT ABOVE
    '\u0122'   #  0xCC -> LATIN CAPITAL LETTER G WITH CEDILLA
    '\u0136'   #  0xCD -> LATIN CAPITAL LETTER K WITH CEDILLA
    '\u012a'   #  0xCE -> LATIN CAPITAL LETTER I WITH MACRON
    '\u013b'   #  0xCF -> LATIN CAPITAL LETTER L WITH CEDILLA
    '\u0160'   #  0xD0 -> LATIN CAPITAL LETTER S WITH CARON
    '\u0143'   #  0xD1 -> LATIN CAPITAL LETTER N WITH ACUTE
    '\u0145'   #  0xD2 -> LATIN CAPITAL LETTER N WITH CEDILLA
    '\xd3'     #  0xD3 -> LATIN CAPITAL LETTER O WITH ACUTE
    '\u014c'   #  0xD4 -> LATIN CAPITAL LETTER O WITH MACRON
    '\xd5'     #  0xD5 -> LATIN CAPITAL LETTER O WITH TILDE
    '\xd6'     #  0xD6 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xd7'     #  0xD7 -> MULTIPLICATION SIGN
    '\u0172'   #  0xD8 -> LATIN CAPITAL LETTER U WITH OGONEK
    '\u0141'   #  0xD9 -> LATIN CAPITAL LETTER L WITH STROKE
    '\u015a'   #  0xDA -> LATIN CAPITAL LETTER S WITH ACUTE
    '\u016a'   #  0xDB -> LATIN CAPITAL LETTER U WITH MACRON
    '\xdc'     #  0xDC -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\u017b'   #  0xDD -> LATIN CAPITAL LETTER Z WITH DOT ABOVE
    '\u017d'   #  0xDE -> LATIN CAPITAL LETTER Z WITH CARON
    '\xdf'     #  0xDF -> LATIN SMALL LETTER SHARP S
    '\u0105'   #  0xE0 -> LATIN SMALL LETTER A WITH OGONEK
    '\u012f'   #  0xE1 -> LATIN SMALL LETTER I WITH OGONEK
    '\u0101'   #  0xE2 -> LATIN SMALL LETTER A WITH MACRON
    '\u0107'   #  0xE3 -> LATIN SMALL LETTER C WITH ACUTE
    '\xe4'     #  0xE4 -> LATIN SMALL LETTER A WITH DIAERESIS
    '\xe5'     #  0xE5 -> LATIN SMALL LETTER A WITH RING ABOVE
    '\u0119'   #  0xE6 -> LATIN SMALL LETTER E WITH OGONEK
    '\u0113'   #  0xE7 -> LATIN SMALL LETTER E WITH MACRON
    '\u010d'   #  0xE8 -> LATIN SMALL LETTER C WITH CARON
    '\xe9'     #  0xE9 -> LATIN SMALL LETTER E WITH ACUTE
    '\u017a'   #  0xEA -> LATIN SMALL LETTER Z WITH ACUTE
    '\u0117'   #  0xEB -> LATIN SMALL LETTER E WITH DOT ABOVE
    '\u0123'   #  0xEC -> LATIN SMALL LETTER G WITH CEDILLA
    '\u0137'   #  0xED -> LATIN SMALL LETTER K WITH CEDILLA
    '\u012b'   #  0xEE -> LATIN SMALL LETTER I WITH MACRON
    '\u013c'   #  0xEF -> LATIN SMALL LETTER L WITH CEDILLA
    '\u0161'   #  0xF0 -> LATIN SMALL LETTER S WITH CARON
    '\u0144'   #  0xF1 -> LATIN SMALL LETTER N WITH ACUTE
    '\u0146'   #  0xF2 -> LATIN SMALL LETTER N WITH CEDILLA
    '\xf3'     #  0xF3 -> LATIN SMALL LETTER O WITH ACUTE
    '\u014d'   #  0xF4 -> LATIN SMALL LETTER O WITH MACRON
    '\xf5'     #  0xF5 -> LATIN SMALL LETTER O WITH TILDE
    '\xf6'     #  0xF6 -> LATIN SMALL LETTER O WITH DIAERESIS
    '\xf7'     #  0xF7 -> DIVISION SIGN
    '\u0173'   #  0xF8 -> LATIN SMALL LETTER U WITH OGONEK
    '\u0142'   #  0xF9 -> LATIN SMALL LETTER L WITH STROKE
    '\u015b'   #  0xFA -> LATIN SMALL LETTER S WITH ACUTE
    '\u016b'   #  0xFB -> LATIN SMALL LETTER U WITH MACRON
    '\xfc'     #  0xFC -> LATIN SMALL LETTER U WITH DIAERESIS
    '\u017c'   #  0xFD -> LATIN SMALL LETTER Z WITH DOT ABOVE
    '\u017e'   #  0xFE -> LATIN SMALL LETTER Z WITH CARON
    '\u02d9'   #  0xFF -> DOT ABOVE
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/iso2022_jp.py000064400000002035151153537620010670 0ustar00#
# iso2022_jp.py: Python Unicode Codec for ISO2022_JP
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#

import _codecs_iso2022, codecs
import _multibytecodec as mbc

codec = _codecs_iso2022.getcodec('iso2022_jp')

class Codec(codecs.Codec):
    encode = codec.encode
    decode = codec.decode

class IncrementalEncoder(mbc.MultibyteIncrementalEncoder,
                         codecs.IncrementalEncoder):
    codec = codec

class IncrementalDecoder(mbc.MultibyteIncrementalDecoder,
                         codecs.IncrementalDecoder):
    codec = codec

class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader):
    codec = codec

class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
    codec = codec

def getregentry():
    return codecs.CodecInfo(
        name='iso2022_jp',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/utf_16_le.py000064400000002015151153537620010661 0ustar00""" Python 'utf-16-le' Codec


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

"""
import codecs

### Codec APIs

encode = codecs.utf_16_le_encode

def decode(input, errors='strict'):
    return codecs.utf_16_le_decode(input, errors, True)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.utf_16_le_encode(input, self.errors)[0]

class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
    _buffer_decode = codecs.utf_16_le_decode

class StreamWriter(codecs.StreamWriter):
    encode = codecs.utf_16_le_encode

class StreamReader(codecs.StreamReader):
    decode = codecs.utf_16_le_decode

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='utf-16-le',
        encode=encode,
        decode=decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/cp037.py000064400000031501151153537620007733 0ustar00""" Python Character Mapping Codec cp037 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP037.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp037',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x9c'     #  0x04 -> CONTROL
    '\t'       #  0x05 -> HORIZONTAL TABULATION
    '\x86'     #  0x06 -> CONTROL
    '\x7f'     #  0x07 -> DELETE
    '\x97'     #  0x08 -> CONTROL
    '\x8d'     #  0x09 -> CONTROL
    '\x8e'     #  0x0A -> CONTROL
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x9d'     #  0x14 -> CONTROL
    '\x85'     #  0x15 -> CONTROL
    '\x08'     #  0x16 -> BACKSPACE
    '\x87'     #  0x17 -> CONTROL
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x92'     #  0x1A -> CONTROL
    '\x8f'     #  0x1B -> CONTROL
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    '\x80'     #  0x20 -> CONTROL
    '\x81'     #  0x21 -> CONTROL
    '\x82'     #  0x22 -> CONTROL
    '\x83'     #  0x23 -> CONTROL
    '\x84'     #  0x24 -> CONTROL
    '\n'       #  0x25 -> LINE FEED
    '\x17'     #  0x26 -> END OF TRANSMISSION BLOCK
    '\x1b'     #  0x27 -> ESCAPE
    '\x88'     #  0x28 -> CONTROL
    '\x89'     #  0x29 -> CONTROL
    '\x8a'     #  0x2A -> CONTROL
    '\x8b'     #  0x2B -> CONTROL
    '\x8c'     #  0x2C -> CONTROL
    '\x05'     #  0x2D -> ENQUIRY
    '\x06'     #  0x2E -> ACKNOWLEDGE
    '\x07'     #  0x2F -> BELL
    '\x90'     #  0x30 -> CONTROL
    '\x91'     #  0x31 -> CONTROL
    '\x16'     #  0x32 -> SYNCHRONOUS IDLE
    '\x93'     #  0x33 -> CONTROL
    '\x94'     #  0x34 -> CONTROL
    '\x95'     #  0x35 -> CONTROL
    '\x96'     #  0x36 -> CONTROL
    '\x04'     #  0x37 -> END OF TRANSMISSION
    '\x98'     #  0x38 -> CONTROL
    '\x99'     #  0x39 -> CONTROL
    '\x9a'     #  0x3A -> CONTROL
    '\x9b'     #  0x3B -> CONTROL
    '\x14'     #  0x3C -> DEVICE CONTROL FOUR
    '\x15'     #  0x3D -> NEGATIVE ACKNOWLEDGE
    '\x9e'     #  0x3E -> CONTROL
    '\x1a'     #  0x3F -> SUBSTITUTE
    ' '        #  0x40 -> SPACE
    '\xa0'     #  0x41 -> NO-BREAK SPACE
    '\xe2'     #  0x42 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\xe4'     #  0x43 -> LATIN SMALL LETTER A WITH DIAERESIS
    '\xe0'     #  0x44 -> LATIN SMALL LETTER A WITH GRAVE
    '\xe1'     #  0x45 -> LATIN SMALL LETTER A WITH ACUTE
    '\xe3'     #  0x46 -> LATIN SMALL LETTER A WITH TILDE
    '\xe5'     #  0x47 -> LATIN SMALL LETTER A WITH RING ABOVE
    '\xe7'     #  0x48 -> LATIN SMALL LETTER C WITH CEDILLA
    '\xf1'     #  0x49 -> LATIN SMALL LETTER N WITH TILDE
    '\xa2'     #  0x4A -> CENT SIGN
    '.'        #  0x4B -> FULL STOP
    '<'        #  0x4C -> LESS-THAN SIGN
    '('        #  0x4D -> LEFT PARENTHESIS
    '+'        #  0x4E -> PLUS SIGN
    '|'        #  0x4F -> VERTICAL LINE
    '&'        #  0x50 -> AMPERSAND
    '\xe9'     #  0x51 -> LATIN SMALL LETTER E WITH ACUTE
    '\xea'     #  0x52 -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xeb'     #  0x53 -> LATIN SMALL LETTER E WITH DIAERESIS
    '\xe8'     #  0x54 -> LATIN SMALL LETTER E WITH GRAVE
    '\xed'     #  0x55 -> LATIN SMALL LETTER I WITH ACUTE
    '\xee'     #  0x56 -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\xef'     #  0x57 -> LATIN SMALL LETTER I WITH DIAERESIS
    '\xec'     #  0x58 -> LATIN SMALL LETTER I WITH GRAVE
    '\xdf'     #  0x59 -> LATIN SMALL LETTER SHARP S (GERMAN)
    '!'        #  0x5A -> EXCLAMATION MARK
    '$'        #  0x5B -> DOLLAR SIGN
    '*'        #  0x5C -> ASTERISK
    ')'        #  0x5D -> RIGHT PARENTHESIS
    ';'        #  0x5E -> SEMICOLON
    '\xac'     #  0x5F -> NOT SIGN
    '-'        #  0x60 -> HYPHEN-MINUS
    '/'        #  0x61 -> SOLIDUS
    '\xc2'     #  0x62 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    '\xc4'     #  0x63 -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\xc0'     #  0x64 -> LATIN CAPITAL LETTER A WITH GRAVE
    '\xc1'     #  0x65 -> LATIN CAPITAL LETTER A WITH ACUTE
    '\xc3'     #  0x66 -> LATIN CAPITAL LETTER A WITH TILDE
    '\xc5'     #  0x67 -> LATIN CAPITAL LETTER A WITH RING ABOVE
    '\xc7'     #  0x68 -> LATIN CAPITAL LETTER C WITH CEDILLA
    '\xd1'     #  0x69 -> LATIN CAPITAL LETTER N WITH TILDE
    '\xa6'     #  0x6A -> BROKEN BAR
    ','        #  0x6B -> COMMA
    '%'        #  0x6C -> PERCENT SIGN
    '_'        #  0x6D -> LOW LINE
    '>'        #  0x6E -> GREATER-THAN SIGN
    '?'        #  0x6F -> QUESTION MARK
    '\xf8'     #  0x70 -> LATIN SMALL LETTER O WITH STROKE
    '\xc9'     #  0x71 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\xca'     #  0x72 -> LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    '\xcb'     #  0x73 -> LATIN CAPITAL LETTER E WITH DIAERESIS
    '\xc8'     #  0x74 -> LATIN CAPITAL LETTER E WITH GRAVE
    '\xcd'     #  0x75 -> LATIN CAPITAL LETTER I WITH ACUTE
    '\xce'     #  0x76 -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    '\xcf'     #  0x77 -> LATIN CAPITAL LETTER I WITH DIAERESIS
    '\xcc'     #  0x78 -> LATIN CAPITAL LETTER I WITH GRAVE
    '`'        #  0x79 -> GRAVE ACCENT
    ':'        #  0x7A -> COLON
    '#'        #  0x7B -> NUMBER SIGN
    '@'        #  0x7C -> COMMERCIAL AT
    "'"        #  0x7D -> APOSTROPHE
    '='        #  0x7E -> EQUALS SIGN
    '"'        #  0x7F -> QUOTATION MARK
    '\xd8'     #  0x80 -> LATIN CAPITAL LETTER O WITH STROKE
    'a'        #  0x81 -> LATIN SMALL LETTER A
    'b'        #  0x82 -> LATIN SMALL LETTER B
    'c'        #  0x83 -> LATIN SMALL LETTER C
    'd'        #  0x84 -> LATIN SMALL LETTER D
    'e'        #  0x85 -> LATIN SMALL LETTER E
    'f'        #  0x86 -> LATIN SMALL LETTER F
    'g'        #  0x87 -> LATIN SMALL LETTER G
    'h'        #  0x88 -> LATIN SMALL LETTER H
    'i'        #  0x89 -> LATIN SMALL LETTER I
    '\xab'     #  0x8A -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbb'     #  0x8B -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xf0'     #  0x8C -> LATIN SMALL LETTER ETH (ICELANDIC)
    '\xfd'     #  0x8D -> LATIN SMALL LETTER Y WITH ACUTE
    '\xfe'     #  0x8E -> LATIN SMALL LETTER THORN (ICELANDIC)
    '\xb1'     #  0x8F -> PLUS-MINUS SIGN
    '\xb0'     #  0x90 -> DEGREE SIGN
    'j'        #  0x91 -> LATIN SMALL LETTER J
    'k'        #  0x92 -> LATIN SMALL LETTER K
    'l'        #  0x93 -> LATIN SMALL LETTER L
    'm'        #  0x94 -> LATIN SMALL LETTER M
    'n'        #  0x95 -> LATIN SMALL LETTER N
    'o'        #  0x96 -> LATIN SMALL LETTER O
    'p'        #  0x97 -> LATIN SMALL LETTER P
    'q'        #  0x98 -> LATIN SMALL LETTER Q
    'r'        #  0x99 -> LATIN SMALL LETTER R
    '\xaa'     #  0x9A -> FEMININE ORDINAL INDICATOR
    '\xba'     #  0x9B -> MASCULINE ORDINAL INDICATOR
    '\xe6'     #  0x9C -> LATIN SMALL LIGATURE AE
    '\xb8'     #  0x9D -> CEDILLA
    '\xc6'     #  0x9E -> LATIN CAPITAL LIGATURE AE
    '\xa4'     #  0x9F -> CURRENCY SIGN
    '\xb5'     #  0xA0 -> MICRO SIGN
    '~'        #  0xA1 -> TILDE
    's'        #  0xA2 -> LATIN SMALL LETTER S
    't'        #  0xA3 -> LATIN SMALL LETTER T
    'u'        #  0xA4 -> LATIN SMALL LETTER U
    'v'        #  0xA5 -> LATIN SMALL LETTER V
    'w'        #  0xA6 -> LATIN SMALL LETTER W
    'x'        #  0xA7 -> LATIN SMALL LETTER X
    'y'        #  0xA8 -> LATIN SMALL LETTER Y
    'z'        #  0xA9 -> LATIN SMALL LETTER Z
    '\xa1'     #  0xAA -> INVERTED EXCLAMATION MARK
    '\xbf'     #  0xAB -> INVERTED QUESTION MARK
    '\xd0'     #  0xAC -> LATIN CAPITAL LETTER ETH (ICELANDIC)
    '\xdd'     #  0xAD -> LATIN CAPITAL LETTER Y WITH ACUTE
    '\xde'     #  0xAE -> LATIN CAPITAL LETTER THORN (ICELANDIC)
    '\xae'     #  0xAF -> REGISTERED SIGN
    '^'        #  0xB0 -> CIRCUMFLEX ACCENT
    '\xa3'     #  0xB1 -> POUND SIGN
    '\xa5'     #  0xB2 -> YEN SIGN
    '\xb7'     #  0xB3 -> MIDDLE DOT
    '\xa9'     #  0xB4 -> COPYRIGHT SIGN
    '\xa7'     #  0xB5 -> SECTION SIGN
    '\xb6'     #  0xB6 -> PILCROW SIGN
    '\xbc'     #  0xB7 -> VULGAR FRACTION ONE QUARTER
    '\xbd'     #  0xB8 -> VULGAR FRACTION ONE HALF
    '\xbe'     #  0xB9 -> VULGAR FRACTION THREE QUARTERS
    '['        #  0xBA -> LEFT SQUARE BRACKET
    ']'        #  0xBB -> RIGHT SQUARE BRACKET
    '\xaf'     #  0xBC -> MACRON
    '\xa8'     #  0xBD -> DIAERESIS
    '\xb4'     #  0xBE -> ACUTE ACCENT
    '\xd7'     #  0xBF -> MULTIPLICATION SIGN
    '{'        #  0xC0 -> LEFT CURLY BRACKET
    'A'        #  0xC1 -> LATIN CAPITAL LETTER A
    'B'        #  0xC2 -> LATIN CAPITAL LETTER B
    'C'        #  0xC3 -> LATIN CAPITAL LETTER C
    'D'        #  0xC4 -> LATIN CAPITAL LETTER D
    'E'        #  0xC5 -> LATIN CAPITAL LETTER E
    'F'        #  0xC6 -> LATIN CAPITAL LETTER F
    'G'        #  0xC7 -> LATIN CAPITAL LETTER G
    'H'        #  0xC8 -> LATIN CAPITAL LETTER H
    'I'        #  0xC9 -> LATIN CAPITAL LETTER I
    '\xad'     #  0xCA -> SOFT HYPHEN
    '\xf4'     #  0xCB -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xf6'     #  0xCC -> LATIN SMALL LETTER O WITH DIAERESIS
    '\xf2'     #  0xCD -> LATIN SMALL LETTER O WITH GRAVE
    '\xf3'     #  0xCE -> LATIN SMALL LETTER O WITH ACUTE
    '\xf5'     #  0xCF -> LATIN SMALL LETTER O WITH TILDE
    '}'        #  0xD0 -> RIGHT CURLY BRACKET
    'J'        #  0xD1 -> LATIN CAPITAL LETTER J
    'K'        #  0xD2 -> LATIN CAPITAL LETTER K
    'L'        #  0xD3 -> LATIN CAPITAL LETTER L
    'M'        #  0xD4 -> LATIN CAPITAL LETTER M
    'N'        #  0xD5 -> LATIN CAPITAL LETTER N
    'O'        #  0xD6 -> LATIN CAPITAL LETTER O
    'P'        #  0xD7 -> LATIN CAPITAL LETTER P
    'Q'        #  0xD8 -> LATIN CAPITAL LETTER Q
    'R'        #  0xD9 -> LATIN CAPITAL LETTER R
    '\xb9'     #  0xDA -> SUPERSCRIPT ONE
    '\xfb'     #  0xDB -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\xfc'     #  0xDC -> LATIN SMALL LETTER U WITH DIAERESIS
    '\xf9'     #  0xDD -> LATIN SMALL LETTER U WITH GRAVE
    '\xfa'     #  0xDE -> LATIN SMALL LETTER U WITH ACUTE
    '\xff'     #  0xDF -> LATIN SMALL LETTER Y WITH DIAERESIS
    '\\'       #  0xE0 -> REVERSE SOLIDUS
    '\xf7'     #  0xE1 -> DIVISION SIGN
    'S'        #  0xE2 -> LATIN CAPITAL LETTER S
    'T'        #  0xE3 -> LATIN CAPITAL LETTER T
    'U'        #  0xE4 -> LATIN CAPITAL LETTER U
    'V'        #  0xE5 -> LATIN CAPITAL LETTER V
    'W'        #  0xE6 -> LATIN CAPITAL LETTER W
    'X'        #  0xE7 -> LATIN CAPITAL LETTER X
    'Y'        #  0xE8 -> LATIN CAPITAL LETTER Y
    'Z'        #  0xE9 -> LATIN CAPITAL LETTER Z
    '\xb2'     #  0xEA -> SUPERSCRIPT TWO
    '\xd4'     #  0xEB -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    '\xd6'     #  0xEC -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xd2'     #  0xED -> LATIN CAPITAL LETTER O WITH GRAVE
    '\xd3'     #  0xEE -> LATIN CAPITAL LETTER O WITH ACUTE
    '\xd5'     #  0xEF -> LATIN CAPITAL LETTER O WITH TILDE
    '0'        #  0xF0 -> DIGIT ZERO
    '1'        #  0xF1 -> DIGIT ONE
    '2'        #  0xF2 -> DIGIT TWO
    '3'        #  0xF3 -> DIGIT THREE
    '4'        #  0xF4 -> DIGIT FOUR
    '5'        #  0xF5 -> DIGIT FIVE
    '6'        #  0xF6 -> DIGIT SIX
    '7'        #  0xF7 -> DIGIT SEVEN
    '8'        #  0xF8 -> DIGIT EIGHT
    '9'        #  0xF9 -> DIGIT NINE
    '\xb3'     #  0xFA -> SUPERSCRIPT THREE
    '\xdb'     #  0xFB -> LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    '\xdc'     #  0xFC -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\xd9'     #  0xFD -> LATIN CAPITAL LETTER U WITH GRAVE
    '\xda'     #  0xFE -> LATIN CAPITAL LETTER U WITH ACUTE
    '\x9f'     #  0xFF -> CONTROL
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/latin_1.py000064400000002360151153537620010427 0ustar00""" Python 'latin-1' Codec


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

"""
import codecs

### Codec APIs

class Codec(codecs.Codec):

    # Note: Binding these as C functions will result in the class not
    # converting them to methods. This is intended.
    encode = codecs.latin_1_encode
    decode = codecs.latin_1_decode

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.latin_1_encode(input,self.errors)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.latin_1_decode(input,self.errors)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

class StreamConverter(StreamWriter,StreamReader):

    encode = codecs.latin_1_decode
    decode = codecs.latin_1_encode

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='iso8859-1',
        encode=Codec.encode,
        decode=Codec.decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/quopri_codec.py000064400000002765151153537620011565 0ustar00"""Codec for quoted-printable encoding.

This codec de/encodes from bytes to bytes.
"""

import codecs
import quopri
from io import BytesIO

def quopri_encode(input, errors='strict'):
    assert errors == 'strict'
    f = BytesIO(input)
    g = BytesIO()
    quopri.encode(f, g, quotetabs=True)
    return (g.getvalue(), len(input))

def quopri_decode(input, errors='strict'):
    assert errors == 'strict'
    f = BytesIO(input)
    g = BytesIO()
    quopri.decode(f, g)
    return (g.getvalue(), len(input))

class Codec(codecs.Codec):
    def encode(self, input, errors='strict'):
        return quopri_encode(input, errors)
    def decode(self, input, errors='strict'):
        return quopri_decode(input, errors)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return quopri_encode(input, self.errors)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return quopri_decode(input, self.errors)[0]

class StreamWriter(Codec, codecs.StreamWriter):
    charbuffertype = bytes

class StreamReader(Codec, codecs.StreamReader):
    charbuffertype = bytes

# encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='quopri',
        encode=quopri_encode,
        decode=quopri_decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamwriter=StreamWriter,
        streamreader=StreamReader,
        _is_text_encoding=False,
    )
encodings/cp932.py000064400000001777151153537620007753 0ustar00#
# cp932.py: Python Unicode Codec for CP932
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#

import _codecs_jp, codecs
import _multibytecodec as mbc

codec = _codecs_jp.getcodec('cp932')

class Codec(codecs.Codec):
    encode = codec.encode
    decode = codec.decode

class IncrementalEncoder(mbc.MultibyteIncrementalEncoder,
                         codecs.IncrementalEncoder):
    codec = codec

class IncrementalDecoder(mbc.MultibyteIncrementalDecoder,
                         codecs.IncrementalDecoder):
    codec = codec

class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader):
    codec = codec

class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
    codec = codec

def getregentry():
    return codecs.CodecInfo(
        name='cp932',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/cp855.py000064400000102072151153537620007745 0ustar00""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP855.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_map)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_map)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp855',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )

### Decoding Map

decoding_map = codecs.make_identity_dict(range(256))
decoding_map.update({
    0x0080: 0x0452,     #  CYRILLIC SMALL LETTER DJE
    0x0081: 0x0402,     #  CYRILLIC CAPITAL LETTER DJE
    0x0082: 0x0453,     #  CYRILLIC SMALL LETTER GJE
    0x0083: 0x0403,     #  CYRILLIC CAPITAL LETTER GJE
    0x0084: 0x0451,     #  CYRILLIC SMALL LETTER IO
    0x0085: 0x0401,     #  CYRILLIC CAPITAL LETTER IO
    0x0086: 0x0454,     #  CYRILLIC SMALL LETTER UKRAINIAN IE
    0x0087: 0x0404,     #  CYRILLIC CAPITAL LETTER UKRAINIAN IE
    0x0088: 0x0455,     #  CYRILLIC SMALL LETTER DZE
    0x0089: 0x0405,     #  CYRILLIC CAPITAL LETTER DZE
    0x008a: 0x0456,     #  CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
    0x008b: 0x0406,     #  CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
    0x008c: 0x0457,     #  CYRILLIC SMALL LETTER YI
    0x008d: 0x0407,     #  CYRILLIC CAPITAL LETTER YI
    0x008e: 0x0458,     #  CYRILLIC SMALL LETTER JE
    0x008f: 0x0408,     #  CYRILLIC CAPITAL LETTER JE
    0x0090: 0x0459,     #  CYRILLIC SMALL LETTER LJE
    0x0091: 0x0409,     #  CYRILLIC CAPITAL LETTER LJE
    0x0092: 0x045a,     #  CYRILLIC SMALL LETTER NJE
    0x0093: 0x040a,     #  CYRILLIC CAPITAL LETTER NJE
    0x0094: 0x045b,     #  CYRILLIC SMALL LETTER TSHE
    0x0095: 0x040b,     #  CYRILLIC CAPITAL LETTER TSHE
    0x0096: 0x045c,     #  CYRILLIC SMALL LETTER KJE
    0x0097: 0x040c,     #  CYRILLIC CAPITAL LETTER KJE
    0x0098: 0x045e,     #  CYRILLIC SMALL LETTER SHORT U
    0x0099: 0x040e,     #  CYRILLIC CAPITAL LETTER SHORT U
    0x009a: 0x045f,     #  CYRILLIC SMALL LETTER DZHE
    0x009b: 0x040f,     #  CYRILLIC CAPITAL LETTER DZHE
    0x009c: 0x044e,     #  CYRILLIC SMALL LETTER YU
    0x009d: 0x042e,     #  CYRILLIC CAPITAL LETTER YU
    0x009e: 0x044a,     #  CYRILLIC SMALL LETTER HARD SIGN
    0x009f: 0x042a,     #  CYRILLIC CAPITAL LETTER HARD SIGN
    0x00a0: 0x0430,     #  CYRILLIC SMALL LETTER A
    0x00a1: 0x0410,     #  CYRILLIC CAPITAL LETTER A
    0x00a2: 0x0431,     #  CYRILLIC SMALL LETTER BE
    0x00a3: 0x0411,     #  CYRILLIC CAPITAL LETTER BE
    0x00a4: 0x0446,     #  CYRILLIC SMALL LETTER TSE
    0x00a5: 0x0426,     #  CYRILLIC CAPITAL LETTER TSE
    0x00a6: 0x0434,     #  CYRILLIC SMALL LETTER DE
    0x00a7: 0x0414,     #  CYRILLIC CAPITAL LETTER DE
    0x00a8: 0x0435,     #  CYRILLIC SMALL LETTER IE
    0x00a9: 0x0415,     #  CYRILLIC CAPITAL LETTER IE
    0x00aa: 0x0444,     #  CYRILLIC SMALL LETTER EF
    0x00ab: 0x0424,     #  CYRILLIC CAPITAL LETTER EF
    0x00ac: 0x0433,     #  CYRILLIC SMALL LETTER GHE
    0x00ad: 0x0413,     #  CYRILLIC CAPITAL LETTER GHE
    0x00ae: 0x00ab,     #  LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00af: 0x00bb,     #  RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00b0: 0x2591,     #  LIGHT SHADE
    0x00b1: 0x2592,     #  MEDIUM SHADE
    0x00b2: 0x2593,     #  DARK SHADE
    0x00b3: 0x2502,     #  BOX DRAWINGS LIGHT VERTICAL
    0x00b4: 0x2524,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
    0x00b5: 0x0445,     #  CYRILLIC SMALL LETTER HA
    0x00b6: 0x0425,     #  CYRILLIC CAPITAL LETTER HA
    0x00b7: 0x0438,     #  CYRILLIC SMALL LETTER I
    0x00b8: 0x0418,     #  CYRILLIC CAPITAL LETTER I
    0x00b9: 0x2563,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    0x00ba: 0x2551,     #  BOX DRAWINGS DOUBLE VERTICAL
    0x00bb: 0x2557,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
    0x00bc: 0x255d,     #  BOX DRAWINGS DOUBLE UP AND LEFT
    0x00bd: 0x0439,     #  CYRILLIC SMALL LETTER SHORT I
    0x00be: 0x0419,     #  CYRILLIC CAPITAL LETTER SHORT I
    0x00bf: 0x2510,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
    0x00c0: 0x2514,     #  BOX DRAWINGS LIGHT UP AND RIGHT
    0x00c1: 0x2534,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
    0x00c2: 0x252c,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    0x00c3: 0x251c,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    0x00c4: 0x2500,     #  BOX DRAWINGS LIGHT HORIZONTAL
    0x00c5: 0x253c,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    0x00c6: 0x043a,     #  CYRILLIC SMALL LETTER KA
    0x00c7: 0x041a,     #  CYRILLIC CAPITAL LETTER KA
    0x00c8: 0x255a,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
    0x00c9: 0x2554,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
    0x00ca: 0x2569,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    0x00cb: 0x2566,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    0x00cc: 0x2560,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    0x00cd: 0x2550,     #  BOX DRAWINGS DOUBLE HORIZONTAL
    0x00ce: 0x256c,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    0x00cf: 0x00a4,     #  CURRENCY SIGN
    0x00d0: 0x043b,     #  CYRILLIC SMALL LETTER EL
    0x00d1: 0x041b,     #  CYRILLIC CAPITAL LETTER EL
    0x00d2: 0x043c,     #  CYRILLIC SMALL LETTER EM
    0x00d3: 0x041c,     #  CYRILLIC CAPITAL LETTER EM
    0x00d4: 0x043d,     #  CYRILLIC SMALL LETTER EN
    0x00d5: 0x041d,     #  CYRILLIC CAPITAL LETTER EN
    0x00d6: 0x043e,     #  CYRILLIC SMALL LETTER O
    0x00d7: 0x041e,     #  CYRILLIC CAPITAL LETTER O
    0x00d8: 0x043f,     #  CYRILLIC SMALL LETTER PE
    0x00d9: 0x2518,     #  BOX DRAWINGS LIGHT UP AND LEFT
    0x00da: 0x250c,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
    0x00db: 0x2588,     #  FULL BLOCK
    0x00dc: 0x2584,     #  LOWER HALF BLOCK
    0x00dd: 0x041f,     #  CYRILLIC CAPITAL LETTER PE
    0x00de: 0x044f,     #  CYRILLIC SMALL LETTER YA
    0x00df: 0x2580,     #  UPPER HALF BLOCK
    0x00e0: 0x042f,     #  CYRILLIC CAPITAL LETTER YA
    0x00e1: 0x0440,     #  CYRILLIC SMALL LETTER ER
    0x00e2: 0x0420,     #  CYRILLIC CAPITAL LETTER ER
    0x00e3: 0x0441,     #  CYRILLIC SMALL LETTER ES
    0x00e4: 0x0421,     #  CYRILLIC CAPITAL LETTER ES
    0x00e5: 0x0442,     #  CYRILLIC SMALL LETTER TE
    0x00e6: 0x0422,     #  CYRILLIC CAPITAL LETTER TE
    0x00e7: 0x0443,     #  CYRILLIC SMALL LETTER U
    0x00e8: 0x0423,     #  CYRILLIC CAPITAL LETTER U
    0x00e9: 0x0436,     #  CYRILLIC SMALL LETTER ZHE
    0x00ea: 0x0416,     #  CYRILLIC CAPITAL LETTER ZHE
    0x00eb: 0x0432,     #  CYRILLIC SMALL LETTER VE
    0x00ec: 0x0412,     #  CYRILLIC CAPITAL LETTER VE
    0x00ed: 0x044c,     #  CYRILLIC SMALL LETTER SOFT SIGN
    0x00ee: 0x042c,     #  CYRILLIC CAPITAL LETTER SOFT SIGN
    0x00ef: 0x2116,     #  NUMERO SIGN
    0x00f0: 0x00ad,     #  SOFT HYPHEN
    0x00f1: 0x044b,     #  CYRILLIC SMALL LETTER YERU
    0x00f2: 0x042b,     #  CYRILLIC CAPITAL LETTER YERU
    0x00f3: 0x0437,     #  CYRILLIC SMALL LETTER ZE
    0x00f4: 0x0417,     #  CYRILLIC CAPITAL LETTER ZE
    0x00f5: 0x0448,     #  CYRILLIC SMALL LETTER SHA
    0x00f6: 0x0428,     #  CYRILLIC CAPITAL LETTER SHA
    0x00f7: 0x044d,     #  CYRILLIC SMALL LETTER E
    0x00f8: 0x042d,     #  CYRILLIC CAPITAL LETTER E
    0x00f9: 0x0449,     #  CYRILLIC SMALL LETTER SHCHA
    0x00fa: 0x0429,     #  CYRILLIC CAPITAL LETTER SHCHA
    0x00fb: 0x0447,     #  CYRILLIC SMALL LETTER CHE
    0x00fc: 0x0427,     #  CYRILLIC CAPITAL LETTER CHE
    0x00fd: 0x00a7,     #  SECTION SIGN
    0x00fe: 0x25a0,     #  BLACK SQUARE
    0x00ff: 0x00a0,     #  NO-BREAK SPACE
})

### Decoding Table

decoding_table = (
    '\x00'     #  0x0000 -> NULL
    '\x01'     #  0x0001 -> START OF HEADING
    '\x02'     #  0x0002 -> START OF TEXT
    '\x03'     #  0x0003 -> END OF TEXT
    '\x04'     #  0x0004 -> END OF TRANSMISSION
    '\x05'     #  0x0005 -> ENQUIRY
    '\x06'     #  0x0006 -> ACKNOWLEDGE
    '\x07'     #  0x0007 -> BELL
    '\x08'     #  0x0008 -> BACKSPACE
    '\t'       #  0x0009 -> HORIZONTAL TABULATION
    '\n'       #  0x000a -> LINE FEED
    '\x0b'     #  0x000b -> VERTICAL TABULATION
    '\x0c'     #  0x000c -> FORM FEED
    '\r'       #  0x000d -> CARRIAGE RETURN
    '\x0e'     #  0x000e -> SHIFT OUT
    '\x0f'     #  0x000f -> SHIFT IN
    '\x10'     #  0x0010 -> DATA LINK ESCAPE
    '\x11'     #  0x0011 -> DEVICE CONTROL ONE
    '\x12'     #  0x0012 -> DEVICE CONTROL TWO
    '\x13'     #  0x0013 -> DEVICE CONTROL THREE
    '\x14'     #  0x0014 -> DEVICE CONTROL FOUR
    '\x15'     #  0x0015 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x0016 -> SYNCHRONOUS IDLE
    '\x17'     #  0x0017 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x0018 -> CANCEL
    '\x19'     #  0x0019 -> END OF MEDIUM
    '\x1a'     #  0x001a -> SUBSTITUTE
    '\x1b'     #  0x001b -> ESCAPE
    '\x1c'     #  0x001c -> FILE SEPARATOR
    '\x1d'     #  0x001d -> GROUP SEPARATOR
    '\x1e'     #  0x001e -> RECORD SEPARATOR
    '\x1f'     #  0x001f -> UNIT SEPARATOR
    ' '        #  0x0020 -> SPACE
    '!'        #  0x0021 -> EXCLAMATION MARK
    '"'        #  0x0022 -> QUOTATION MARK
    '#'        #  0x0023 -> NUMBER SIGN
    '$'        #  0x0024 -> DOLLAR SIGN
    '%'        #  0x0025 -> PERCENT SIGN
    '&'        #  0x0026 -> AMPERSAND
    "'"        #  0x0027 -> APOSTROPHE
    '('        #  0x0028 -> LEFT PARENTHESIS
    ')'        #  0x0029 -> RIGHT PARENTHESIS
    '*'        #  0x002a -> ASTERISK
    '+'        #  0x002b -> PLUS SIGN
    ','        #  0x002c -> COMMA
    '-'        #  0x002d -> HYPHEN-MINUS
    '.'        #  0x002e -> FULL STOP
    '/'        #  0x002f -> SOLIDUS
    '0'        #  0x0030 -> DIGIT ZERO
    '1'        #  0x0031 -> DIGIT ONE
    '2'        #  0x0032 -> DIGIT TWO
    '3'        #  0x0033 -> DIGIT THREE
    '4'        #  0x0034 -> DIGIT FOUR
    '5'        #  0x0035 -> DIGIT FIVE
    '6'        #  0x0036 -> DIGIT SIX
    '7'        #  0x0037 -> DIGIT SEVEN
    '8'        #  0x0038 -> DIGIT EIGHT
    '9'        #  0x0039 -> DIGIT NINE
    ':'        #  0x003a -> COLON
    ';'        #  0x003b -> SEMICOLON
    '<'        #  0x003c -> LESS-THAN SIGN
    '='        #  0x003d -> EQUALS SIGN
    '>'        #  0x003e -> GREATER-THAN SIGN
    '?'        #  0x003f -> QUESTION MARK
    '@'        #  0x0040 -> COMMERCIAL AT
    'A'        #  0x0041 -> LATIN CAPITAL LETTER A
    'B'        #  0x0042 -> LATIN CAPITAL LETTER B
    'C'        #  0x0043 -> LATIN CAPITAL LETTER C
    'D'        #  0x0044 -> LATIN CAPITAL LETTER D
    'E'        #  0x0045 -> LATIN CAPITAL LETTER E
    'F'        #  0x0046 -> LATIN CAPITAL LETTER F
    'G'        #  0x0047 -> LATIN CAPITAL LETTER G
    'H'        #  0x0048 -> LATIN CAPITAL LETTER H
    'I'        #  0x0049 -> LATIN CAPITAL LETTER I
    'J'        #  0x004a -> LATIN CAPITAL LETTER J
    'K'        #  0x004b -> LATIN CAPITAL LETTER K
    'L'        #  0x004c -> LATIN CAPITAL LETTER L
    'M'        #  0x004d -> LATIN CAPITAL LETTER M
    'N'        #  0x004e -> LATIN CAPITAL LETTER N
    'O'        #  0x004f -> LATIN CAPITAL LETTER O
    'P'        #  0x0050 -> LATIN CAPITAL LETTER P
    'Q'        #  0x0051 -> LATIN CAPITAL LETTER Q
    'R'        #  0x0052 -> LATIN CAPITAL LETTER R
    'S'        #  0x0053 -> LATIN CAPITAL LETTER S
    'T'        #  0x0054 -> LATIN CAPITAL LETTER T
    'U'        #  0x0055 -> LATIN CAPITAL LETTER U
    'V'        #  0x0056 -> LATIN CAPITAL LETTER V
    'W'        #  0x0057 -> LATIN CAPITAL LETTER W
    'X'        #  0x0058 -> LATIN CAPITAL LETTER X
    'Y'        #  0x0059 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x005a -> LATIN CAPITAL LETTER Z
    '['        #  0x005b -> LEFT SQUARE BRACKET
    '\\'       #  0x005c -> REVERSE SOLIDUS
    ']'        #  0x005d -> RIGHT SQUARE BRACKET
    '^'        #  0x005e -> CIRCUMFLEX ACCENT
    '_'        #  0x005f -> LOW LINE
    '`'        #  0x0060 -> GRAVE ACCENT
    'a'        #  0x0061 -> LATIN SMALL LETTER A
    'b'        #  0x0062 -> LATIN SMALL LETTER B
    'c'        #  0x0063 -> LATIN SMALL LETTER C
    'd'        #  0x0064 -> LATIN SMALL LETTER D
    'e'        #  0x0065 -> LATIN SMALL LETTER E
    'f'        #  0x0066 -> LATIN SMALL LETTER F
    'g'        #  0x0067 -> LATIN SMALL LETTER G
    'h'        #  0x0068 -> LATIN SMALL LETTER H
    'i'        #  0x0069 -> LATIN SMALL LETTER I
    'j'        #  0x006a -> LATIN SMALL LETTER J
    'k'        #  0x006b -> LATIN SMALL LETTER K
    'l'        #  0x006c -> LATIN SMALL LETTER L
    'm'        #  0x006d -> LATIN SMALL LETTER M
    'n'        #  0x006e -> LATIN SMALL LETTER N
    'o'        #  0x006f -> LATIN SMALL LETTER O
    'p'        #  0x0070 -> LATIN SMALL LETTER P
    'q'        #  0x0071 -> LATIN SMALL LETTER Q
    'r'        #  0x0072 -> LATIN SMALL LETTER R
    's'        #  0x0073 -> LATIN SMALL LETTER S
    't'        #  0x0074 -> LATIN SMALL LETTER T
    'u'        #  0x0075 -> LATIN SMALL LETTER U
    'v'        #  0x0076 -> LATIN SMALL LETTER V
    'w'        #  0x0077 -> LATIN SMALL LETTER W
    'x'        #  0x0078 -> LATIN SMALL LETTER X
    'y'        #  0x0079 -> LATIN SMALL LETTER Y
    'z'        #  0x007a -> LATIN SMALL LETTER Z
    '{'        #  0x007b -> LEFT CURLY BRACKET
    '|'        #  0x007c -> VERTICAL LINE
    '}'        #  0x007d -> RIGHT CURLY BRACKET
    '~'        #  0x007e -> TILDE
    '\x7f'     #  0x007f -> DELETE
    '\u0452'   #  0x0080 -> CYRILLIC SMALL LETTER DJE
    '\u0402'   #  0x0081 -> CYRILLIC CAPITAL LETTER DJE
    '\u0453'   #  0x0082 -> CYRILLIC SMALL LETTER GJE
    '\u0403'   #  0x0083 -> CYRILLIC CAPITAL LETTER GJE
    '\u0451'   #  0x0084 -> CYRILLIC SMALL LETTER IO
    '\u0401'   #  0x0085 -> CYRILLIC CAPITAL LETTER IO
    '\u0454'   #  0x0086 -> CYRILLIC SMALL LETTER UKRAINIAN IE
    '\u0404'   #  0x0087 -> CYRILLIC CAPITAL LETTER UKRAINIAN IE
    '\u0455'   #  0x0088 -> CYRILLIC SMALL LETTER DZE
    '\u0405'   #  0x0089 -> CYRILLIC CAPITAL LETTER DZE
    '\u0456'   #  0x008a -> CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
    '\u0406'   #  0x008b -> CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
    '\u0457'   #  0x008c -> CYRILLIC SMALL LETTER YI
    '\u0407'   #  0x008d -> CYRILLIC CAPITAL LETTER YI
    '\u0458'   #  0x008e -> CYRILLIC SMALL LETTER JE
    '\u0408'   #  0x008f -> CYRILLIC CAPITAL LETTER JE
    '\u0459'   #  0x0090 -> CYRILLIC SMALL LETTER LJE
    '\u0409'   #  0x0091 -> CYRILLIC CAPITAL LETTER LJE
    '\u045a'   #  0x0092 -> CYRILLIC SMALL LETTER NJE
    '\u040a'   #  0x0093 -> CYRILLIC CAPITAL LETTER NJE
    '\u045b'   #  0x0094 -> CYRILLIC SMALL LETTER TSHE
    '\u040b'   #  0x0095 -> CYRILLIC CAPITAL LETTER TSHE
    '\u045c'   #  0x0096 -> CYRILLIC SMALL LETTER KJE
    '\u040c'   #  0x0097 -> CYRILLIC CAPITAL LETTER KJE
    '\u045e'   #  0x0098 -> CYRILLIC SMALL LETTER SHORT U
    '\u040e'   #  0x0099 -> CYRILLIC CAPITAL LETTER SHORT U
    '\u045f'   #  0x009a -> CYRILLIC SMALL LETTER DZHE
    '\u040f'   #  0x009b -> CYRILLIC CAPITAL LETTER DZHE
    '\u044e'   #  0x009c -> CYRILLIC SMALL LETTER YU
    '\u042e'   #  0x009d -> CYRILLIC CAPITAL LETTER YU
    '\u044a'   #  0x009e -> CYRILLIC SMALL LETTER HARD SIGN
    '\u042a'   #  0x009f -> CYRILLIC CAPITAL LETTER HARD SIGN
    '\u0430'   #  0x00a0 -> CYRILLIC SMALL LETTER A
    '\u0410'   #  0x00a1 -> CYRILLIC CAPITAL LETTER A
    '\u0431'   #  0x00a2 -> CYRILLIC SMALL LETTER BE
    '\u0411'   #  0x00a3 -> CYRILLIC CAPITAL LETTER BE
    '\u0446'   #  0x00a4 -> CYRILLIC SMALL LETTER TSE
    '\u0426'   #  0x00a5 -> CYRILLIC CAPITAL LETTER TSE
    '\u0434'   #  0x00a6 -> CYRILLIC SMALL LETTER DE
    '\u0414'   #  0x00a7 -> CYRILLIC CAPITAL LETTER DE
    '\u0435'   #  0x00a8 -> CYRILLIC SMALL LETTER IE
    '\u0415'   #  0x00a9 -> CYRILLIC CAPITAL LETTER IE
    '\u0444'   #  0x00aa -> CYRILLIC SMALL LETTER EF
    '\u0424'   #  0x00ab -> CYRILLIC CAPITAL LETTER EF
    '\u0433'   #  0x00ac -> CYRILLIC SMALL LETTER GHE
    '\u0413'   #  0x00ad -> CYRILLIC CAPITAL LETTER GHE
    '\xab'     #  0x00ae -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbb'     #  0x00af -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u2591'   #  0x00b0 -> LIGHT SHADE
    '\u2592'   #  0x00b1 -> MEDIUM SHADE
    '\u2593'   #  0x00b2 -> DARK SHADE
    '\u2502'   #  0x00b3 -> BOX DRAWINGS LIGHT VERTICAL
    '\u2524'   #  0x00b4 -> BOX DRAWINGS LIGHT VERTICAL AND LEFT
    '\u0445'   #  0x00b5 -> CYRILLIC SMALL LETTER HA
    '\u0425'   #  0x00b6 -> CYRILLIC CAPITAL LETTER HA
    '\u0438'   #  0x00b7 -> CYRILLIC SMALL LETTER I
    '\u0418'   #  0x00b8 -> CYRILLIC CAPITAL LETTER I
    '\u2563'   #  0x00b9 -> BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    '\u2551'   #  0x00ba -> BOX DRAWINGS DOUBLE VERTICAL
    '\u2557'   #  0x00bb -> BOX DRAWINGS DOUBLE DOWN AND LEFT
    '\u255d'   #  0x00bc -> BOX DRAWINGS DOUBLE UP AND LEFT
    '\u0439'   #  0x00bd -> CYRILLIC SMALL LETTER SHORT I
    '\u0419'   #  0x00be -> CYRILLIC CAPITAL LETTER SHORT I
    '\u2510'   #  0x00bf -> BOX DRAWINGS LIGHT DOWN AND LEFT
    '\u2514'   #  0x00c0 -> BOX DRAWINGS LIGHT UP AND RIGHT
    '\u2534'   #  0x00c1 -> BOX DRAWINGS LIGHT UP AND HORIZONTAL
    '\u252c'   #  0x00c2 -> BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    '\u251c'   #  0x00c3 -> BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    '\u2500'   #  0x00c4 -> BOX DRAWINGS LIGHT HORIZONTAL
    '\u253c'   #  0x00c5 -> BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    '\u043a'   #  0x00c6 -> CYRILLIC SMALL LETTER KA
    '\u041a'   #  0x00c7 -> CYRILLIC CAPITAL LETTER KA
    '\u255a'   #  0x00c8 -> BOX DRAWINGS DOUBLE UP AND RIGHT
    '\u2554'   #  0x00c9 -> BOX DRAWINGS DOUBLE DOWN AND RIGHT
    '\u2569'   #  0x00ca -> BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    '\u2566'   #  0x00cb -> BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    '\u2560'   #  0x00cc -> BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    '\u2550'   #  0x00cd -> BOX DRAWINGS DOUBLE HORIZONTAL
    '\u256c'   #  0x00ce -> BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    '\xa4'     #  0x00cf -> CURRENCY SIGN
    '\u043b'   #  0x00d0 -> CYRILLIC SMALL LETTER EL
    '\u041b'   #  0x00d1 -> CYRILLIC CAPITAL LETTER EL
    '\u043c'   #  0x00d2 -> CYRILLIC SMALL LETTER EM
    '\u041c'   #  0x00d3 -> CYRILLIC CAPITAL LETTER EM
    '\u043d'   #  0x00d4 -> CYRILLIC SMALL LETTER EN
    '\u041d'   #  0x00d5 -> CYRILLIC CAPITAL LETTER EN
    '\u043e'   #  0x00d6 -> CYRILLIC SMALL LETTER O
    '\u041e'   #  0x00d7 -> CYRILLIC CAPITAL LETTER O
    '\u043f'   #  0x00d8 -> CYRILLIC SMALL LETTER PE
    '\u2518'   #  0x00d9 -> BOX DRAWINGS LIGHT UP AND LEFT
    '\u250c'   #  0x00da -> BOX DRAWINGS LIGHT DOWN AND RIGHT
    '\u2588'   #  0x00db -> FULL BLOCK
    '\u2584'   #  0x00dc -> LOWER HALF BLOCK
    '\u041f'   #  0x00dd -> CYRILLIC CAPITAL LETTER PE
    '\u044f'   #  0x00de -> CYRILLIC SMALL LETTER YA
    '\u2580'   #  0x00df -> UPPER HALF BLOCK
    '\u042f'   #  0x00e0 -> CYRILLIC CAPITAL LETTER YA
    '\u0440'   #  0x00e1 -> CYRILLIC SMALL LETTER ER
    '\u0420'   #  0x00e2 -> CYRILLIC CAPITAL LETTER ER
    '\u0441'   #  0x00e3 -> CYRILLIC SMALL LETTER ES
    '\u0421'   #  0x00e4 -> CYRILLIC CAPITAL LETTER ES
    '\u0442'   #  0x00e5 -> CYRILLIC SMALL LETTER TE
    '\u0422'   #  0x00e6 -> CYRILLIC CAPITAL LETTER TE
    '\u0443'   #  0x00e7 -> CYRILLIC SMALL LETTER U
    '\u0423'   #  0x00e8 -> CYRILLIC CAPITAL LETTER U
    '\u0436'   #  0x00e9 -> CYRILLIC SMALL LETTER ZHE
    '\u0416'   #  0x00ea -> CYRILLIC CAPITAL LETTER ZHE
    '\u0432'   #  0x00eb -> CYRILLIC SMALL LETTER VE
    '\u0412'   #  0x00ec -> CYRILLIC CAPITAL LETTER VE
    '\u044c'   #  0x00ed -> CYRILLIC SMALL LETTER SOFT SIGN
    '\u042c'   #  0x00ee -> CYRILLIC CAPITAL LETTER SOFT SIGN
    '\u2116'   #  0x00ef -> NUMERO SIGN
    '\xad'     #  0x00f0 -> SOFT HYPHEN
    '\u044b'   #  0x00f1 -> CYRILLIC SMALL LETTER YERU
    '\u042b'   #  0x00f2 -> CYRILLIC CAPITAL LETTER YERU
    '\u0437'   #  0x00f3 -> CYRILLIC SMALL LETTER ZE
    '\u0417'   #  0x00f4 -> CYRILLIC CAPITAL LETTER ZE
    '\u0448'   #  0x00f5 -> CYRILLIC SMALL LETTER SHA
    '\u0428'   #  0x00f6 -> CYRILLIC CAPITAL LETTER SHA
    '\u044d'   #  0x00f7 -> CYRILLIC SMALL LETTER E
    '\u042d'   #  0x00f8 -> CYRILLIC CAPITAL LETTER E
    '\u0449'   #  0x00f9 -> CYRILLIC SMALL LETTER SHCHA
    '\u0429'   #  0x00fa -> CYRILLIC CAPITAL LETTER SHCHA
    '\u0447'   #  0x00fb -> CYRILLIC SMALL LETTER CHE
    '\u0427'   #  0x00fc -> CYRILLIC CAPITAL LETTER CHE
    '\xa7'     #  0x00fd -> SECTION SIGN
    '\u25a0'   #  0x00fe -> BLACK SQUARE
    '\xa0'     #  0x00ff -> NO-BREAK SPACE
)

### Encoding Map

encoding_map = {
    0x0000: 0x0000,     #  NULL
    0x0001: 0x0001,     #  START OF HEADING
    0x0002: 0x0002,     #  START OF TEXT
    0x0003: 0x0003,     #  END OF TEXT
    0x0004: 0x0004,     #  END OF TRANSMISSION
    0x0005: 0x0005,     #  ENQUIRY
    0x0006: 0x0006,     #  ACKNOWLEDGE
    0x0007: 0x0007,     #  BELL
    0x0008: 0x0008,     #  BACKSPACE
    0x0009: 0x0009,     #  HORIZONTAL TABULATION
    0x000a: 0x000a,     #  LINE FEED
    0x000b: 0x000b,     #  VERTICAL TABULATION
    0x000c: 0x000c,     #  FORM FEED
    0x000d: 0x000d,     #  CARRIAGE RETURN
    0x000e: 0x000e,     #  SHIFT OUT
    0x000f: 0x000f,     #  SHIFT IN
    0x0010: 0x0010,     #  DATA LINK ESCAPE
    0x0011: 0x0011,     #  DEVICE CONTROL ONE
    0x0012: 0x0012,     #  DEVICE CONTROL TWO
    0x0013: 0x0013,     #  DEVICE CONTROL THREE
    0x0014: 0x0014,     #  DEVICE CONTROL FOUR
    0x0015: 0x0015,     #  NEGATIVE ACKNOWLEDGE
    0x0016: 0x0016,     #  SYNCHRONOUS IDLE
    0x0017: 0x0017,     #  END OF TRANSMISSION BLOCK
    0x0018: 0x0018,     #  CANCEL
    0x0019: 0x0019,     #  END OF MEDIUM
    0x001a: 0x001a,     #  SUBSTITUTE
    0x001b: 0x001b,     #  ESCAPE
    0x001c: 0x001c,     #  FILE SEPARATOR
    0x001d: 0x001d,     #  GROUP SEPARATOR
    0x001e: 0x001e,     #  RECORD SEPARATOR
    0x001f: 0x001f,     #  UNIT SEPARATOR
    0x0020: 0x0020,     #  SPACE
    0x0021: 0x0021,     #  EXCLAMATION MARK
    0x0022: 0x0022,     #  QUOTATION MARK
    0x0023: 0x0023,     #  NUMBER SIGN
    0x0024: 0x0024,     #  DOLLAR SIGN
    0x0025: 0x0025,     #  PERCENT SIGN
    0x0026: 0x0026,     #  AMPERSAND
    0x0027: 0x0027,     #  APOSTROPHE
    0x0028: 0x0028,     #  LEFT PARENTHESIS
    0x0029: 0x0029,     #  RIGHT PARENTHESIS
    0x002a: 0x002a,     #  ASTERISK
    0x002b: 0x002b,     #  PLUS SIGN
    0x002c: 0x002c,     #  COMMA
    0x002d: 0x002d,     #  HYPHEN-MINUS
    0x002e: 0x002e,     #  FULL STOP
    0x002f: 0x002f,     #  SOLIDUS
    0x0030: 0x0030,     #  DIGIT ZERO
    0x0031: 0x0031,     #  DIGIT ONE
    0x0032: 0x0032,     #  DIGIT TWO
    0x0033: 0x0033,     #  DIGIT THREE
    0x0034: 0x0034,     #  DIGIT FOUR
    0x0035: 0x0035,     #  DIGIT FIVE
    0x0036: 0x0036,     #  DIGIT SIX
    0x0037: 0x0037,     #  DIGIT SEVEN
    0x0038: 0x0038,     #  DIGIT EIGHT
    0x0039: 0x0039,     #  DIGIT NINE
    0x003a: 0x003a,     #  COLON
    0x003b: 0x003b,     #  SEMICOLON
    0x003c: 0x003c,     #  LESS-THAN SIGN
    0x003d: 0x003d,     #  EQUALS SIGN
    0x003e: 0x003e,     #  GREATER-THAN SIGN
    0x003f: 0x003f,     #  QUESTION MARK
    0x0040: 0x0040,     #  COMMERCIAL AT
    0x0041: 0x0041,     #  LATIN CAPITAL LETTER A
    0x0042: 0x0042,     #  LATIN CAPITAL LETTER B
    0x0043: 0x0043,     #  LATIN CAPITAL LETTER C
    0x0044: 0x0044,     #  LATIN CAPITAL LETTER D
    0x0045: 0x0045,     #  LATIN CAPITAL LETTER E
    0x0046: 0x0046,     #  LATIN CAPITAL LETTER F
    0x0047: 0x0047,     #  LATIN CAPITAL LETTER G
    0x0048: 0x0048,     #  LATIN CAPITAL LETTER H
    0x0049: 0x0049,     #  LATIN CAPITAL LETTER I
    0x004a: 0x004a,     #  LATIN CAPITAL LETTER J
    0x004b: 0x004b,     #  LATIN CAPITAL LETTER K
    0x004c: 0x004c,     #  LATIN CAPITAL LETTER L
    0x004d: 0x004d,     #  LATIN CAPITAL LETTER M
    0x004e: 0x004e,     #  LATIN CAPITAL LETTER N
    0x004f: 0x004f,     #  LATIN CAPITAL LETTER O
    0x0050: 0x0050,     #  LATIN CAPITAL LETTER P
    0x0051: 0x0051,     #  LATIN CAPITAL LETTER Q
    0x0052: 0x0052,     #  LATIN CAPITAL LETTER R
    0x0053: 0x0053,     #  LATIN CAPITAL LETTER S
    0x0054: 0x0054,     #  LATIN CAPITAL LETTER T
    0x0055: 0x0055,     #  LATIN CAPITAL LETTER U
    0x0056: 0x0056,     #  LATIN CAPITAL LETTER V
    0x0057: 0x0057,     #  LATIN CAPITAL LETTER W
    0x0058: 0x0058,     #  LATIN CAPITAL LETTER X
    0x0059: 0x0059,     #  LATIN CAPITAL LETTER Y
    0x005a: 0x005a,     #  LATIN CAPITAL LETTER Z
    0x005b: 0x005b,     #  LEFT SQUARE BRACKET
    0x005c: 0x005c,     #  REVERSE SOLIDUS
    0x005d: 0x005d,     #  RIGHT SQUARE BRACKET
    0x005e: 0x005e,     #  CIRCUMFLEX ACCENT
    0x005f: 0x005f,     #  LOW LINE
    0x0060: 0x0060,     #  GRAVE ACCENT
    0x0061: 0x0061,     #  LATIN SMALL LETTER A
    0x0062: 0x0062,     #  LATIN SMALL LETTER B
    0x0063: 0x0063,     #  LATIN SMALL LETTER C
    0x0064: 0x0064,     #  LATIN SMALL LETTER D
    0x0065: 0x0065,     #  LATIN SMALL LETTER E
    0x0066: 0x0066,     #  LATIN SMALL LETTER F
    0x0067: 0x0067,     #  LATIN SMALL LETTER G
    0x0068: 0x0068,     #  LATIN SMALL LETTER H
    0x0069: 0x0069,     #  LATIN SMALL LETTER I
    0x006a: 0x006a,     #  LATIN SMALL LETTER J
    0x006b: 0x006b,     #  LATIN SMALL LETTER K
    0x006c: 0x006c,     #  LATIN SMALL LETTER L
    0x006d: 0x006d,     #  LATIN SMALL LETTER M
    0x006e: 0x006e,     #  LATIN SMALL LETTER N
    0x006f: 0x006f,     #  LATIN SMALL LETTER O
    0x0070: 0x0070,     #  LATIN SMALL LETTER P
    0x0071: 0x0071,     #  LATIN SMALL LETTER Q
    0x0072: 0x0072,     #  LATIN SMALL LETTER R
    0x0073: 0x0073,     #  LATIN SMALL LETTER S
    0x0074: 0x0074,     #  LATIN SMALL LETTER T
    0x0075: 0x0075,     #  LATIN SMALL LETTER U
    0x0076: 0x0076,     #  LATIN SMALL LETTER V
    0x0077: 0x0077,     #  LATIN SMALL LETTER W
    0x0078: 0x0078,     #  LATIN SMALL LETTER X
    0x0079: 0x0079,     #  LATIN SMALL LETTER Y
    0x007a: 0x007a,     #  LATIN SMALL LETTER Z
    0x007b: 0x007b,     #  LEFT CURLY BRACKET
    0x007c: 0x007c,     #  VERTICAL LINE
    0x007d: 0x007d,     #  RIGHT CURLY BRACKET
    0x007e: 0x007e,     #  TILDE
    0x007f: 0x007f,     #  DELETE
    0x00a0: 0x00ff,     #  NO-BREAK SPACE
    0x00a4: 0x00cf,     #  CURRENCY SIGN
    0x00a7: 0x00fd,     #  SECTION SIGN
    0x00ab: 0x00ae,     #  LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00ad: 0x00f0,     #  SOFT HYPHEN
    0x00bb: 0x00af,     #  RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x0401: 0x0085,     #  CYRILLIC CAPITAL LETTER IO
    0x0402: 0x0081,     #  CYRILLIC CAPITAL LETTER DJE
    0x0403: 0x0083,     #  CYRILLIC CAPITAL LETTER GJE
    0x0404: 0x0087,     #  CYRILLIC CAPITAL LETTER UKRAINIAN IE
    0x0405: 0x0089,     #  CYRILLIC CAPITAL LETTER DZE
    0x0406: 0x008b,     #  CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
    0x0407: 0x008d,     #  CYRILLIC CAPITAL LETTER YI
    0x0408: 0x008f,     #  CYRILLIC CAPITAL LETTER JE
    0x0409: 0x0091,     #  CYRILLIC CAPITAL LETTER LJE
    0x040a: 0x0093,     #  CYRILLIC CAPITAL LETTER NJE
    0x040b: 0x0095,     #  CYRILLIC CAPITAL LETTER TSHE
    0x040c: 0x0097,     #  CYRILLIC CAPITAL LETTER KJE
    0x040e: 0x0099,     #  CYRILLIC CAPITAL LETTER SHORT U
    0x040f: 0x009b,     #  CYRILLIC CAPITAL LETTER DZHE
    0x0410: 0x00a1,     #  CYRILLIC CAPITAL LETTER A
    0x0411: 0x00a3,     #  CYRILLIC CAPITAL LETTER BE
    0x0412: 0x00ec,     #  CYRILLIC CAPITAL LETTER VE
    0x0413: 0x00ad,     #  CYRILLIC CAPITAL LETTER GHE
    0x0414: 0x00a7,     #  CYRILLIC CAPITAL LETTER DE
    0x0415: 0x00a9,     #  CYRILLIC CAPITAL LETTER IE
    0x0416: 0x00ea,     #  CYRILLIC CAPITAL LETTER ZHE
    0x0417: 0x00f4,     #  CYRILLIC CAPITAL LETTER ZE
    0x0418: 0x00b8,     #  CYRILLIC CAPITAL LETTER I
    0x0419: 0x00be,     #  CYRILLIC CAPITAL LETTER SHORT I
    0x041a: 0x00c7,     #  CYRILLIC CAPITAL LETTER KA
    0x041b: 0x00d1,     #  CYRILLIC CAPITAL LETTER EL
    0x041c: 0x00d3,     #  CYRILLIC CAPITAL LETTER EM
    0x041d: 0x00d5,     #  CYRILLIC CAPITAL LETTER EN
    0x041e: 0x00d7,     #  CYRILLIC CAPITAL LETTER O
    0x041f: 0x00dd,     #  CYRILLIC CAPITAL LETTER PE
    0x0420: 0x00e2,     #  CYRILLIC CAPITAL LETTER ER
    0x0421: 0x00e4,     #  CYRILLIC CAPITAL LETTER ES
    0x0422: 0x00e6,     #  CYRILLIC CAPITAL LETTER TE
    0x0423: 0x00e8,     #  CYRILLIC CAPITAL LETTER U
    0x0424: 0x00ab,     #  CYRILLIC CAPITAL LETTER EF
    0x0425: 0x00b6,     #  CYRILLIC CAPITAL LETTER HA
    0x0426: 0x00a5,     #  CYRILLIC CAPITAL LETTER TSE
    0x0427: 0x00fc,     #  CYRILLIC CAPITAL LETTER CHE
    0x0428: 0x00f6,     #  CYRILLIC CAPITAL LETTER SHA
    0x0429: 0x00fa,     #  CYRILLIC CAPITAL LETTER SHCHA
    0x042a: 0x009f,     #  CYRILLIC CAPITAL LETTER HARD SIGN
    0x042b: 0x00f2,     #  CYRILLIC CAPITAL LETTER YERU
    0x042c: 0x00ee,     #  CYRILLIC CAPITAL LETTER SOFT SIGN
    0x042d: 0x00f8,     #  CYRILLIC CAPITAL LETTER E
    0x042e: 0x009d,     #  CYRILLIC CAPITAL LETTER YU
    0x042f: 0x00e0,     #  CYRILLIC CAPITAL LETTER YA
    0x0430: 0x00a0,     #  CYRILLIC SMALL LETTER A
    0x0431: 0x00a2,     #  CYRILLIC SMALL LETTER BE
    0x0432: 0x00eb,     #  CYRILLIC SMALL LETTER VE
    0x0433: 0x00ac,     #  CYRILLIC SMALL LETTER GHE
    0x0434: 0x00a6,     #  CYRILLIC SMALL LETTER DE
    0x0435: 0x00a8,     #  CYRILLIC SMALL LETTER IE
    0x0436: 0x00e9,     #  CYRILLIC SMALL LETTER ZHE
    0x0437: 0x00f3,     #  CYRILLIC SMALL LETTER ZE
    0x0438: 0x00b7,     #  CYRILLIC SMALL LETTER I
    0x0439: 0x00bd,     #  CYRILLIC SMALL LETTER SHORT I
    0x043a: 0x00c6,     #  CYRILLIC SMALL LETTER KA
    0x043b: 0x00d0,     #  CYRILLIC SMALL LETTER EL
    0x043c: 0x00d2,     #  CYRILLIC SMALL LETTER EM
    0x043d: 0x00d4,     #  CYRILLIC SMALL LETTER EN
    0x043e: 0x00d6,     #  CYRILLIC SMALL LETTER O
    0x043f: 0x00d8,     #  CYRILLIC SMALL LETTER PE
    0x0440: 0x00e1,     #  CYRILLIC SMALL LETTER ER
    0x0441: 0x00e3,     #  CYRILLIC SMALL LETTER ES
    0x0442: 0x00e5,     #  CYRILLIC SMALL LETTER TE
    0x0443: 0x00e7,     #  CYRILLIC SMALL LETTER U
    0x0444: 0x00aa,     #  CYRILLIC SMALL LETTER EF
    0x0445: 0x00b5,     #  CYRILLIC SMALL LETTER HA
    0x0446: 0x00a4,     #  CYRILLIC SMALL LETTER TSE
    0x0447: 0x00fb,     #  CYRILLIC SMALL LETTER CHE
    0x0448: 0x00f5,     #  CYRILLIC SMALL LETTER SHA
    0x0449: 0x00f9,     #  CYRILLIC SMALL LETTER SHCHA
    0x044a: 0x009e,     #  CYRILLIC SMALL LETTER HARD SIGN
    0x044b: 0x00f1,     #  CYRILLIC SMALL LETTER YERU
    0x044c: 0x00ed,     #  CYRILLIC SMALL LETTER SOFT SIGN
    0x044d: 0x00f7,     #  CYRILLIC SMALL LETTER E
    0x044e: 0x009c,     #  CYRILLIC SMALL LETTER YU
    0x044f: 0x00de,     #  CYRILLIC SMALL LETTER YA
    0x0451: 0x0084,     #  CYRILLIC SMALL LETTER IO
    0x0452: 0x0080,     #  CYRILLIC SMALL LETTER DJE
    0x0453: 0x0082,     #  CYRILLIC SMALL LETTER GJE
    0x0454: 0x0086,     #  CYRILLIC SMALL LETTER UKRAINIAN IE
    0x0455: 0x0088,     #  CYRILLIC SMALL LETTER DZE
    0x0456: 0x008a,     #  CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
    0x0457: 0x008c,     #  CYRILLIC SMALL LETTER YI
    0x0458: 0x008e,     #  CYRILLIC SMALL LETTER JE
    0x0459: 0x0090,     #  CYRILLIC SMALL LETTER LJE
    0x045a: 0x0092,     #  CYRILLIC SMALL LETTER NJE
    0x045b: 0x0094,     #  CYRILLIC SMALL LETTER TSHE
    0x045c: 0x0096,     #  CYRILLIC SMALL LETTER KJE
    0x045e: 0x0098,     #  CYRILLIC SMALL LETTER SHORT U
    0x045f: 0x009a,     #  CYRILLIC SMALL LETTER DZHE
    0x2116: 0x00ef,     #  NUMERO SIGN
    0x2500: 0x00c4,     #  BOX DRAWINGS LIGHT HORIZONTAL
    0x2502: 0x00b3,     #  BOX DRAWINGS LIGHT VERTICAL
    0x250c: 0x00da,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
    0x2510: 0x00bf,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
    0x2514: 0x00c0,     #  BOX DRAWINGS LIGHT UP AND RIGHT
    0x2518: 0x00d9,     #  BOX DRAWINGS LIGHT UP AND LEFT
    0x251c: 0x00c3,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    0x2524: 0x00b4,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
    0x252c: 0x00c2,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    0x2534: 0x00c1,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
    0x253c: 0x00c5,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    0x2550: 0x00cd,     #  BOX DRAWINGS DOUBLE HORIZONTAL
    0x2551: 0x00ba,     #  BOX DRAWINGS DOUBLE VERTICAL
    0x2554: 0x00c9,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
    0x2557: 0x00bb,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
    0x255a: 0x00c8,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
    0x255d: 0x00bc,     #  BOX DRAWINGS DOUBLE UP AND LEFT
    0x2560: 0x00cc,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    0x2563: 0x00b9,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    0x2566: 0x00cb,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    0x2569: 0x00ca,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    0x256c: 0x00ce,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    0x2580: 0x00df,     #  UPPER HALF BLOCK
    0x2584: 0x00dc,     #  LOWER HALF BLOCK
    0x2588: 0x00db,     #  FULL BLOCK
    0x2591: 0x00b0,     #  LIGHT SHADE
    0x2592: 0x00b1,     #  MEDIUM SHADE
    0x2593: 0x00b2,     #  DARK SHADE
    0x25a0: 0x00fe,     #  BLACK SQUARE
}
encodings/cp865.py000064400000103472151153537630007754 0ustar00""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP865.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_map)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_map)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp865',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )

### Decoding Map

decoding_map = codecs.make_identity_dict(range(256))
decoding_map.update({
    0x0080: 0x00c7,     #  LATIN CAPITAL LETTER C WITH CEDILLA
    0x0081: 0x00fc,     #  LATIN SMALL LETTER U WITH DIAERESIS
    0x0082: 0x00e9,     #  LATIN SMALL LETTER E WITH ACUTE
    0x0083: 0x00e2,     #  LATIN SMALL LETTER A WITH CIRCUMFLEX
    0x0084: 0x00e4,     #  LATIN SMALL LETTER A WITH DIAERESIS
    0x0085: 0x00e0,     #  LATIN SMALL LETTER A WITH GRAVE
    0x0086: 0x00e5,     #  LATIN SMALL LETTER A WITH RING ABOVE
    0x0087: 0x00e7,     #  LATIN SMALL LETTER C WITH CEDILLA
    0x0088: 0x00ea,     #  LATIN SMALL LETTER E WITH CIRCUMFLEX
    0x0089: 0x00eb,     #  LATIN SMALL LETTER E WITH DIAERESIS
    0x008a: 0x00e8,     #  LATIN SMALL LETTER E WITH GRAVE
    0x008b: 0x00ef,     #  LATIN SMALL LETTER I WITH DIAERESIS
    0x008c: 0x00ee,     #  LATIN SMALL LETTER I WITH CIRCUMFLEX
    0x008d: 0x00ec,     #  LATIN SMALL LETTER I WITH GRAVE
    0x008e: 0x00c4,     #  LATIN CAPITAL LETTER A WITH DIAERESIS
    0x008f: 0x00c5,     #  LATIN CAPITAL LETTER A WITH RING ABOVE
    0x0090: 0x00c9,     #  LATIN CAPITAL LETTER E WITH ACUTE
    0x0091: 0x00e6,     #  LATIN SMALL LIGATURE AE
    0x0092: 0x00c6,     #  LATIN CAPITAL LIGATURE AE
    0x0093: 0x00f4,     #  LATIN SMALL LETTER O WITH CIRCUMFLEX
    0x0094: 0x00f6,     #  LATIN SMALL LETTER O WITH DIAERESIS
    0x0095: 0x00f2,     #  LATIN SMALL LETTER O WITH GRAVE
    0x0096: 0x00fb,     #  LATIN SMALL LETTER U WITH CIRCUMFLEX
    0x0097: 0x00f9,     #  LATIN SMALL LETTER U WITH GRAVE
    0x0098: 0x00ff,     #  LATIN SMALL LETTER Y WITH DIAERESIS
    0x0099: 0x00d6,     #  LATIN CAPITAL LETTER O WITH DIAERESIS
    0x009a: 0x00dc,     #  LATIN CAPITAL LETTER U WITH DIAERESIS
    0x009b: 0x00f8,     #  LATIN SMALL LETTER O WITH STROKE
    0x009c: 0x00a3,     #  POUND SIGN
    0x009d: 0x00d8,     #  LATIN CAPITAL LETTER O WITH STROKE
    0x009e: 0x20a7,     #  PESETA SIGN
    0x009f: 0x0192,     #  LATIN SMALL LETTER F WITH HOOK
    0x00a0: 0x00e1,     #  LATIN SMALL LETTER A WITH ACUTE
    0x00a1: 0x00ed,     #  LATIN SMALL LETTER I WITH ACUTE
    0x00a2: 0x00f3,     #  LATIN SMALL LETTER O WITH ACUTE
    0x00a3: 0x00fa,     #  LATIN SMALL LETTER U WITH ACUTE
    0x00a4: 0x00f1,     #  LATIN SMALL LETTER N WITH TILDE
    0x00a5: 0x00d1,     #  LATIN CAPITAL LETTER N WITH TILDE
    0x00a6: 0x00aa,     #  FEMININE ORDINAL INDICATOR
    0x00a7: 0x00ba,     #  MASCULINE ORDINAL INDICATOR
    0x00a8: 0x00bf,     #  INVERTED QUESTION MARK
    0x00a9: 0x2310,     #  REVERSED NOT SIGN
    0x00aa: 0x00ac,     #  NOT SIGN
    0x00ab: 0x00bd,     #  VULGAR FRACTION ONE HALF
    0x00ac: 0x00bc,     #  VULGAR FRACTION ONE QUARTER
    0x00ad: 0x00a1,     #  INVERTED EXCLAMATION MARK
    0x00ae: 0x00ab,     #  LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00af: 0x00a4,     #  CURRENCY SIGN
    0x00b0: 0x2591,     #  LIGHT SHADE
    0x00b1: 0x2592,     #  MEDIUM SHADE
    0x00b2: 0x2593,     #  DARK SHADE
    0x00b3: 0x2502,     #  BOX DRAWINGS LIGHT VERTICAL
    0x00b4: 0x2524,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
    0x00b5: 0x2561,     #  BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
    0x00b6: 0x2562,     #  BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
    0x00b7: 0x2556,     #  BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
    0x00b8: 0x2555,     #  BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
    0x00b9: 0x2563,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    0x00ba: 0x2551,     #  BOX DRAWINGS DOUBLE VERTICAL
    0x00bb: 0x2557,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
    0x00bc: 0x255d,     #  BOX DRAWINGS DOUBLE UP AND LEFT
    0x00bd: 0x255c,     #  BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
    0x00be: 0x255b,     #  BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
    0x00bf: 0x2510,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
    0x00c0: 0x2514,     #  BOX DRAWINGS LIGHT UP AND RIGHT
    0x00c1: 0x2534,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
    0x00c2: 0x252c,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    0x00c3: 0x251c,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    0x00c4: 0x2500,     #  BOX DRAWINGS LIGHT HORIZONTAL
    0x00c5: 0x253c,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    0x00c6: 0x255e,     #  BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
    0x00c7: 0x255f,     #  BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
    0x00c8: 0x255a,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
    0x00c9: 0x2554,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
    0x00ca: 0x2569,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    0x00cb: 0x2566,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    0x00cc: 0x2560,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    0x00cd: 0x2550,     #  BOX DRAWINGS DOUBLE HORIZONTAL
    0x00ce: 0x256c,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    0x00cf: 0x2567,     #  BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
    0x00d0: 0x2568,     #  BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
    0x00d1: 0x2564,     #  BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
    0x00d2: 0x2565,     #  BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
    0x00d3: 0x2559,     #  BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
    0x00d4: 0x2558,     #  BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
    0x00d5: 0x2552,     #  BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
    0x00d6: 0x2553,     #  BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
    0x00d7: 0x256b,     #  BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
    0x00d8: 0x256a,     #  BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
    0x00d9: 0x2518,     #  BOX DRAWINGS LIGHT UP AND LEFT
    0x00da: 0x250c,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
    0x00db: 0x2588,     #  FULL BLOCK
    0x00dc: 0x2584,     #  LOWER HALF BLOCK
    0x00dd: 0x258c,     #  LEFT HALF BLOCK
    0x00de: 0x2590,     #  RIGHT HALF BLOCK
    0x00df: 0x2580,     #  UPPER HALF BLOCK
    0x00e0: 0x03b1,     #  GREEK SMALL LETTER ALPHA
    0x00e1: 0x00df,     #  LATIN SMALL LETTER SHARP S
    0x00e2: 0x0393,     #  GREEK CAPITAL LETTER GAMMA
    0x00e3: 0x03c0,     #  GREEK SMALL LETTER PI
    0x00e4: 0x03a3,     #  GREEK CAPITAL LETTER SIGMA
    0x00e5: 0x03c3,     #  GREEK SMALL LETTER SIGMA
    0x00e6: 0x00b5,     #  MICRO SIGN
    0x00e7: 0x03c4,     #  GREEK SMALL LETTER TAU
    0x00e8: 0x03a6,     #  GREEK CAPITAL LETTER PHI
    0x00e9: 0x0398,     #  GREEK CAPITAL LETTER THETA
    0x00ea: 0x03a9,     #  GREEK CAPITAL LETTER OMEGA
    0x00eb: 0x03b4,     #  GREEK SMALL LETTER DELTA
    0x00ec: 0x221e,     #  INFINITY
    0x00ed: 0x03c6,     #  GREEK SMALL LETTER PHI
    0x00ee: 0x03b5,     #  GREEK SMALL LETTER EPSILON
    0x00ef: 0x2229,     #  INTERSECTION
    0x00f0: 0x2261,     #  IDENTICAL TO
    0x00f1: 0x00b1,     #  PLUS-MINUS SIGN
    0x00f2: 0x2265,     #  GREATER-THAN OR EQUAL TO
    0x00f3: 0x2264,     #  LESS-THAN OR EQUAL TO
    0x00f4: 0x2320,     #  TOP HALF INTEGRAL
    0x00f5: 0x2321,     #  BOTTOM HALF INTEGRAL
    0x00f6: 0x00f7,     #  DIVISION SIGN
    0x00f7: 0x2248,     #  ALMOST EQUAL TO
    0x00f8: 0x00b0,     #  DEGREE SIGN
    0x00f9: 0x2219,     #  BULLET OPERATOR
    0x00fa: 0x00b7,     #  MIDDLE DOT
    0x00fb: 0x221a,     #  SQUARE ROOT
    0x00fc: 0x207f,     #  SUPERSCRIPT LATIN SMALL LETTER N
    0x00fd: 0x00b2,     #  SUPERSCRIPT TWO
    0x00fe: 0x25a0,     #  BLACK SQUARE
    0x00ff: 0x00a0,     #  NO-BREAK SPACE
})

### Decoding Table

decoding_table = (
    '\x00'     #  0x0000 -> NULL
    '\x01'     #  0x0001 -> START OF HEADING
    '\x02'     #  0x0002 -> START OF TEXT
    '\x03'     #  0x0003 -> END OF TEXT
    '\x04'     #  0x0004 -> END OF TRANSMISSION
    '\x05'     #  0x0005 -> ENQUIRY
    '\x06'     #  0x0006 -> ACKNOWLEDGE
    '\x07'     #  0x0007 -> BELL
    '\x08'     #  0x0008 -> BACKSPACE
    '\t'       #  0x0009 -> HORIZONTAL TABULATION
    '\n'       #  0x000a -> LINE FEED
    '\x0b'     #  0x000b -> VERTICAL TABULATION
    '\x0c'     #  0x000c -> FORM FEED
    '\r'       #  0x000d -> CARRIAGE RETURN
    '\x0e'     #  0x000e -> SHIFT OUT
    '\x0f'     #  0x000f -> SHIFT IN
    '\x10'     #  0x0010 -> DATA LINK ESCAPE
    '\x11'     #  0x0011 -> DEVICE CONTROL ONE
    '\x12'     #  0x0012 -> DEVICE CONTROL TWO
    '\x13'     #  0x0013 -> DEVICE CONTROL THREE
    '\x14'     #  0x0014 -> DEVICE CONTROL FOUR
    '\x15'     #  0x0015 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x0016 -> SYNCHRONOUS IDLE
    '\x17'     #  0x0017 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x0018 -> CANCEL
    '\x19'     #  0x0019 -> END OF MEDIUM
    '\x1a'     #  0x001a -> SUBSTITUTE
    '\x1b'     #  0x001b -> ESCAPE
    '\x1c'     #  0x001c -> FILE SEPARATOR
    '\x1d'     #  0x001d -> GROUP SEPARATOR
    '\x1e'     #  0x001e -> RECORD SEPARATOR
    '\x1f'     #  0x001f -> UNIT SEPARATOR
    ' '        #  0x0020 -> SPACE
    '!'        #  0x0021 -> EXCLAMATION MARK
    '"'        #  0x0022 -> QUOTATION MARK
    '#'        #  0x0023 -> NUMBER SIGN
    '$'        #  0x0024 -> DOLLAR SIGN
    '%'        #  0x0025 -> PERCENT SIGN
    '&'        #  0x0026 -> AMPERSAND
    "'"        #  0x0027 -> APOSTROPHE
    '('        #  0x0028 -> LEFT PARENTHESIS
    ')'        #  0x0029 -> RIGHT PARENTHESIS
    '*'        #  0x002a -> ASTERISK
    '+'        #  0x002b -> PLUS SIGN
    ','        #  0x002c -> COMMA
    '-'        #  0x002d -> HYPHEN-MINUS
    '.'        #  0x002e -> FULL STOP
    '/'        #  0x002f -> SOLIDUS
    '0'        #  0x0030 -> DIGIT ZERO
    '1'        #  0x0031 -> DIGIT ONE
    '2'        #  0x0032 -> DIGIT TWO
    '3'        #  0x0033 -> DIGIT THREE
    '4'        #  0x0034 -> DIGIT FOUR
    '5'        #  0x0035 -> DIGIT FIVE
    '6'        #  0x0036 -> DIGIT SIX
    '7'        #  0x0037 -> DIGIT SEVEN
    '8'        #  0x0038 -> DIGIT EIGHT
    '9'        #  0x0039 -> DIGIT NINE
    ':'        #  0x003a -> COLON
    ';'        #  0x003b -> SEMICOLON
    '<'        #  0x003c -> LESS-THAN SIGN
    '='        #  0x003d -> EQUALS SIGN
    '>'        #  0x003e -> GREATER-THAN SIGN
    '?'        #  0x003f -> QUESTION MARK
    '@'        #  0x0040 -> COMMERCIAL AT
    'A'        #  0x0041 -> LATIN CAPITAL LETTER A
    'B'        #  0x0042 -> LATIN CAPITAL LETTER B
    'C'        #  0x0043 -> LATIN CAPITAL LETTER C
    'D'        #  0x0044 -> LATIN CAPITAL LETTER D
    'E'        #  0x0045 -> LATIN CAPITAL LETTER E
    'F'        #  0x0046 -> LATIN CAPITAL LETTER F
    'G'        #  0x0047 -> LATIN CAPITAL LETTER G
    'H'        #  0x0048 -> LATIN CAPITAL LETTER H
    'I'        #  0x0049 -> LATIN CAPITAL LETTER I
    'J'        #  0x004a -> LATIN CAPITAL LETTER J
    'K'        #  0x004b -> LATIN CAPITAL LETTER K
    'L'        #  0x004c -> LATIN CAPITAL LETTER L
    'M'        #  0x004d -> LATIN CAPITAL LETTER M
    'N'        #  0x004e -> LATIN CAPITAL LETTER N
    'O'        #  0x004f -> LATIN CAPITAL LETTER O
    'P'        #  0x0050 -> LATIN CAPITAL LETTER P
    'Q'        #  0x0051 -> LATIN CAPITAL LETTER Q
    'R'        #  0x0052 -> LATIN CAPITAL LETTER R
    'S'        #  0x0053 -> LATIN CAPITAL LETTER S
    'T'        #  0x0054 -> LATIN CAPITAL LETTER T
    'U'        #  0x0055 -> LATIN CAPITAL LETTER U
    'V'        #  0x0056 -> LATIN CAPITAL LETTER V
    'W'        #  0x0057 -> LATIN CAPITAL LETTER W
    'X'        #  0x0058 -> LATIN CAPITAL LETTER X
    'Y'        #  0x0059 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x005a -> LATIN CAPITAL LETTER Z
    '['        #  0x005b -> LEFT SQUARE BRACKET
    '\\'       #  0x005c -> REVERSE SOLIDUS
    ']'        #  0x005d -> RIGHT SQUARE BRACKET
    '^'        #  0x005e -> CIRCUMFLEX ACCENT
    '_'        #  0x005f -> LOW LINE
    '`'        #  0x0060 -> GRAVE ACCENT
    'a'        #  0x0061 -> LATIN SMALL LETTER A
    'b'        #  0x0062 -> LATIN SMALL LETTER B
    'c'        #  0x0063 -> LATIN SMALL LETTER C
    'd'        #  0x0064 -> LATIN SMALL LETTER D
    'e'        #  0x0065 -> LATIN SMALL LETTER E
    'f'        #  0x0066 -> LATIN SMALL LETTER F
    'g'        #  0x0067 -> LATIN SMALL LETTER G
    'h'        #  0x0068 -> LATIN SMALL LETTER H
    'i'        #  0x0069 -> LATIN SMALL LETTER I
    'j'        #  0x006a -> LATIN SMALL LETTER J
    'k'        #  0x006b -> LATIN SMALL LETTER K
    'l'        #  0x006c -> LATIN SMALL LETTER L
    'm'        #  0x006d -> LATIN SMALL LETTER M
    'n'        #  0x006e -> LATIN SMALL LETTER N
    'o'        #  0x006f -> LATIN SMALL LETTER O
    'p'        #  0x0070 -> LATIN SMALL LETTER P
    'q'        #  0x0071 -> LATIN SMALL LETTER Q
    'r'        #  0x0072 -> LATIN SMALL LETTER R
    's'        #  0x0073 -> LATIN SMALL LETTER S
    't'        #  0x0074 -> LATIN SMALL LETTER T
    'u'        #  0x0075 -> LATIN SMALL LETTER U
    'v'        #  0x0076 -> LATIN SMALL LETTER V
    'w'        #  0x0077 -> LATIN SMALL LETTER W
    'x'        #  0x0078 -> LATIN SMALL LETTER X
    'y'        #  0x0079 -> LATIN SMALL LETTER Y
    'z'        #  0x007a -> LATIN SMALL LETTER Z
    '{'        #  0x007b -> LEFT CURLY BRACKET
    '|'        #  0x007c -> VERTICAL LINE
    '}'        #  0x007d -> RIGHT CURLY BRACKET
    '~'        #  0x007e -> TILDE
    '\x7f'     #  0x007f -> DELETE
    '\xc7'     #  0x0080 -> LATIN CAPITAL LETTER C WITH CEDILLA
    '\xfc'     #  0x0081 -> LATIN SMALL LETTER U WITH DIAERESIS
    '\xe9'     #  0x0082 -> LATIN SMALL LETTER E WITH ACUTE
    '\xe2'     #  0x0083 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\xe4'     #  0x0084 -> LATIN SMALL LETTER A WITH DIAERESIS
    '\xe0'     #  0x0085 -> LATIN SMALL LETTER A WITH GRAVE
    '\xe5'     #  0x0086 -> LATIN SMALL LETTER A WITH RING ABOVE
    '\xe7'     #  0x0087 -> LATIN SMALL LETTER C WITH CEDILLA
    '\xea'     #  0x0088 -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xeb'     #  0x0089 -> LATIN SMALL LETTER E WITH DIAERESIS
    '\xe8'     #  0x008a -> LATIN SMALL LETTER E WITH GRAVE
    '\xef'     #  0x008b -> LATIN SMALL LETTER I WITH DIAERESIS
    '\xee'     #  0x008c -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\xec'     #  0x008d -> LATIN SMALL LETTER I WITH GRAVE
    '\xc4'     #  0x008e -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\xc5'     #  0x008f -> LATIN CAPITAL LETTER A WITH RING ABOVE
    '\xc9'     #  0x0090 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\xe6'     #  0x0091 -> LATIN SMALL LIGATURE AE
    '\xc6'     #  0x0092 -> LATIN CAPITAL LIGATURE AE
    '\xf4'     #  0x0093 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xf6'     #  0x0094 -> LATIN SMALL LETTER O WITH DIAERESIS
    '\xf2'     #  0x0095 -> LATIN SMALL LETTER O WITH GRAVE
    '\xfb'     #  0x0096 -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\xf9'     #  0x0097 -> LATIN SMALL LETTER U WITH GRAVE
    '\xff'     #  0x0098 -> LATIN SMALL LETTER Y WITH DIAERESIS
    '\xd6'     #  0x0099 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xdc'     #  0x009a -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\xf8'     #  0x009b -> LATIN SMALL LETTER O WITH STROKE
    '\xa3'     #  0x009c -> POUND SIGN
    '\xd8'     #  0x009d -> LATIN CAPITAL LETTER O WITH STROKE
    '\u20a7'   #  0x009e -> PESETA SIGN
    '\u0192'   #  0x009f -> LATIN SMALL LETTER F WITH HOOK
    '\xe1'     #  0x00a0 -> LATIN SMALL LETTER A WITH ACUTE
    '\xed'     #  0x00a1 -> LATIN SMALL LETTER I WITH ACUTE
    '\xf3'     #  0x00a2 -> LATIN SMALL LETTER O WITH ACUTE
    '\xfa'     #  0x00a3 -> LATIN SMALL LETTER U WITH ACUTE
    '\xf1'     #  0x00a4 -> LATIN SMALL LETTER N WITH TILDE
    '\xd1'     #  0x00a5 -> LATIN CAPITAL LETTER N WITH TILDE
    '\xaa'     #  0x00a6 -> FEMININE ORDINAL INDICATOR
    '\xba'     #  0x00a7 -> MASCULINE ORDINAL INDICATOR
    '\xbf'     #  0x00a8 -> INVERTED QUESTION MARK
    '\u2310'   #  0x00a9 -> REVERSED NOT SIGN
    '\xac'     #  0x00aa -> NOT SIGN
    '\xbd'     #  0x00ab -> VULGAR FRACTION ONE HALF
    '\xbc'     #  0x00ac -> VULGAR FRACTION ONE QUARTER
    '\xa1'     #  0x00ad -> INVERTED EXCLAMATION MARK
    '\xab'     #  0x00ae -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xa4'     #  0x00af -> CURRENCY SIGN
    '\u2591'   #  0x00b0 -> LIGHT SHADE
    '\u2592'   #  0x00b1 -> MEDIUM SHADE
    '\u2593'   #  0x00b2 -> DARK SHADE
    '\u2502'   #  0x00b3 -> BOX DRAWINGS LIGHT VERTICAL
    '\u2524'   #  0x00b4 -> BOX DRAWINGS LIGHT VERTICAL AND LEFT
    '\u2561'   #  0x00b5 -> BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
    '\u2562'   #  0x00b6 -> BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
    '\u2556'   #  0x00b7 -> BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
    '\u2555'   #  0x00b8 -> BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
    '\u2563'   #  0x00b9 -> BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    '\u2551'   #  0x00ba -> BOX DRAWINGS DOUBLE VERTICAL
    '\u2557'   #  0x00bb -> BOX DRAWINGS DOUBLE DOWN AND LEFT
    '\u255d'   #  0x00bc -> BOX DRAWINGS DOUBLE UP AND LEFT
    '\u255c'   #  0x00bd -> BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
    '\u255b'   #  0x00be -> BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
    '\u2510'   #  0x00bf -> BOX DRAWINGS LIGHT DOWN AND LEFT
    '\u2514'   #  0x00c0 -> BOX DRAWINGS LIGHT UP AND RIGHT
    '\u2534'   #  0x00c1 -> BOX DRAWINGS LIGHT UP AND HORIZONTAL
    '\u252c'   #  0x00c2 -> BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    '\u251c'   #  0x00c3 -> BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    '\u2500'   #  0x00c4 -> BOX DRAWINGS LIGHT HORIZONTAL
    '\u253c'   #  0x00c5 -> BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    '\u255e'   #  0x00c6 -> BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
    '\u255f'   #  0x00c7 -> BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
    '\u255a'   #  0x00c8 -> BOX DRAWINGS DOUBLE UP AND RIGHT
    '\u2554'   #  0x00c9 -> BOX DRAWINGS DOUBLE DOWN AND RIGHT
    '\u2569'   #  0x00ca -> BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    '\u2566'   #  0x00cb -> BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    '\u2560'   #  0x00cc -> BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    '\u2550'   #  0x00cd -> BOX DRAWINGS DOUBLE HORIZONTAL
    '\u256c'   #  0x00ce -> BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    '\u2567'   #  0x00cf -> BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
    '\u2568'   #  0x00d0 -> BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
    '\u2564'   #  0x00d1 -> BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
    '\u2565'   #  0x00d2 -> BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
    '\u2559'   #  0x00d3 -> BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
    '\u2558'   #  0x00d4 -> BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
    '\u2552'   #  0x00d5 -> BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
    '\u2553'   #  0x00d6 -> BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
    '\u256b'   #  0x00d7 -> BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
    '\u256a'   #  0x00d8 -> BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
    '\u2518'   #  0x00d9 -> BOX DRAWINGS LIGHT UP AND LEFT
    '\u250c'   #  0x00da -> BOX DRAWINGS LIGHT DOWN AND RIGHT
    '\u2588'   #  0x00db -> FULL BLOCK
    '\u2584'   #  0x00dc -> LOWER HALF BLOCK
    '\u258c'   #  0x00dd -> LEFT HALF BLOCK
    '\u2590'   #  0x00de -> RIGHT HALF BLOCK
    '\u2580'   #  0x00df -> UPPER HALF BLOCK
    '\u03b1'   #  0x00e0 -> GREEK SMALL LETTER ALPHA
    '\xdf'     #  0x00e1 -> LATIN SMALL LETTER SHARP S
    '\u0393'   #  0x00e2 -> GREEK CAPITAL LETTER GAMMA
    '\u03c0'   #  0x00e3 -> GREEK SMALL LETTER PI
    '\u03a3'   #  0x00e4 -> GREEK CAPITAL LETTER SIGMA
    '\u03c3'   #  0x00e5 -> GREEK SMALL LETTER SIGMA
    '\xb5'     #  0x00e6 -> MICRO SIGN
    '\u03c4'   #  0x00e7 -> GREEK SMALL LETTER TAU
    '\u03a6'   #  0x00e8 -> GREEK CAPITAL LETTER PHI
    '\u0398'   #  0x00e9 -> GREEK CAPITAL LETTER THETA
    '\u03a9'   #  0x00ea -> GREEK CAPITAL LETTER OMEGA
    '\u03b4'   #  0x00eb -> GREEK SMALL LETTER DELTA
    '\u221e'   #  0x00ec -> INFINITY
    '\u03c6'   #  0x00ed -> GREEK SMALL LETTER PHI
    '\u03b5'   #  0x00ee -> GREEK SMALL LETTER EPSILON
    '\u2229'   #  0x00ef -> INTERSECTION
    '\u2261'   #  0x00f0 -> IDENTICAL TO
    '\xb1'     #  0x00f1 -> PLUS-MINUS SIGN
    '\u2265'   #  0x00f2 -> GREATER-THAN OR EQUAL TO
    '\u2264'   #  0x00f3 -> LESS-THAN OR EQUAL TO
    '\u2320'   #  0x00f4 -> TOP HALF INTEGRAL
    '\u2321'   #  0x00f5 -> BOTTOM HALF INTEGRAL
    '\xf7'     #  0x00f6 -> DIVISION SIGN
    '\u2248'   #  0x00f7 -> ALMOST EQUAL TO
    '\xb0'     #  0x00f8 -> DEGREE SIGN
    '\u2219'   #  0x00f9 -> BULLET OPERATOR
    '\xb7'     #  0x00fa -> MIDDLE DOT
    '\u221a'   #  0x00fb -> SQUARE ROOT
    '\u207f'   #  0x00fc -> SUPERSCRIPT LATIN SMALL LETTER N
    '\xb2'     #  0x00fd -> SUPERSCRIPT TWO
    '\u25a0'   #  0x00fe -> BLACK SQUARE
    '\xa0'     #  0x00ff -> NO-BREAK SPACE
)

### Encoding Map

encoding_map = {
    0x0000: 0x0000,     #  NULL
    0x0001: 0x0001,     #  START OF HEADING
    0x0002: 0x0002,     #  START OF TEXT
    0x0003: 0x0003,     #  END OF TEXT
    0x0004: 0x0004,     #  END OF TRANSMISSION
    0x0005: 0x0005,     #  ENQUIRY
    0x0006: 0x0006,     #  ACKNOWLEDGE
    0x0007: 0x0007,     #  BELL
    0x0008: 0x0008,     #  BACKSPACE
    0x0009: 0x0009,     #  HORIZONTAL TABULATION
    0x000a: 0x000a,     #  LINE FEED
    0x000b: 0x000b,     #  VERTICAL TABULATION
    0x000c: 0x000c,     #  FORM FEED
    0x000d: 0x000d,     #  CARRIAGE RETURN
    0x000e: 0x000e,     #  SHIFT OUT
    0x000f: 0x000f,     #  SHIFT IN
    0x0010: 0x0010,     #  DATA LINK ESCAPE
    0x0011: 0x0011,     #  DEVICE CONTROL ONE
    0x0012: 0x0012,     #  DEVICE CONTROL TWO
    0x0013: 0x0013,     #  DEVICE CONTROL THREE
    0x0014: 0x0014,     #  DEVICE CONTROL FOUR
    0x0015: 0x0015,     #  NEGATIVE ACKNOWLEDGE
    0x0016: 0x0016,     #  SYNCHRONOUS IDLE
    0x0017: 0x0017,     #  END OF TRANSMISSION BLOCK
    0x0018: 0x0018,     #  CANCEL
    0x0019: 0x0019,     #  END OF MEDIUM
    0x001a: 0x001a,     #  SUBSTITUTE
    0x001b: 0x001b,     #  ESCAPE
    0x001c: 0x001c,     #  FILE SEPARATOR
    0x001d: 0x001d,     #  GROUP SEPARATOR
    0x001e: 0x001e,     #  RECORD SEPARATOR
    0x001f: 0x001f,     #  UNIT SEPARATOR
    0x0020: 0x0020,     #  SPACE
    0x0021: 0x0021,     #  EXCLAMATION MARK
    0x0022: 0x0022,     #  QUOTATION MARK
    0x0023: 0x0023,     #  NUMBER SIGN
    0x0024: 0x0024,     #  DOLLAR SIGN
    0x0025: 0x0025,     #  PERCENT SIGN
    0x0026: 0x0026,     #  AMPERSAND
    0x0027: 0x0027,     #  APOSTROPHE
    0x0028: 0x0028,     #  LEFT PARENTHESIS
    0x0029: 0x0029,     #  RIGHT PARENTHESIS
    0x002a: 0x002a,     #  ASTERISK
    0x002b: 0x002b,     #  PLUS SIGN
    0x002c: 0x002c,     #  COMMA
    0x002d: 0x002d,     #  HYPHEN-MINUS
    0x002e: 0x002e,     #  FULL STOP
    0x002f: 0x002f,     #  SOLIDUS
    0x0030: 0x0030,     #  DIGIT ZERO
    0x0031: 0x0031,     #  DIGIT ONE
    0x0032: 0x0032,     #  DIGIT TWO
    0x0033: 0x0033,     #  DIGIT THREE
    0x0034: 0x0034,     #  DIGIT FOUR
    0x0035: 0x0035,     #  DIGIT FIVE
    0x0036: 0x0036,     #  DIGIT SIX
    0x0037: 0x0037,     #  DIGIT SEVEN
    0x0038: 0x0038,     #  DIGIT EIGHT
    0x0039: 0x0039,     #  DIGIT NINE
    0x003a: 0x003a,     #  COLON
    0x003b: 0x003b,     #  SEMICOLON
    0x003c: 0x003c,     #  LESS-THAN SIGN
    0x003d: 0x003d,     #  EQUALS SIGN
    0x003e: 0x003e,     #  GREATER-THAN SIGN
    0x003f: 0x003f,     #  QUESTION MARK
    0x0040: 0x0040,     #  COMMERCIAL AT
    0x0041: 0x0041,     #  LATIN CAPITAL LETTER A
    0x0042: 0x0042,     #  LATIN CAPITAL LETTER B
    0x0043: 0x0043,     #  LATIN CAPITAL LETTER C
    0x0044: 0x0044,     #  LATIN CAPITAL LETTER D
    0x0045: 0x0045,     #  LATIN CAPITAL LETTER E
    0x0046: 0x0046,     #  LATIN CAPITAL LETTER F
    0x0047: 0x0047,     #  LATIN CAPITAL LETTER G
    0x0048: 0x0048,     #  LATIN CAPITAL LETTER H
    0x0049: 0x0049,     #  LATIN CAPITAL LETTER I
    0x004a: 0x004a,     #  LATIN CAPITAL LETTER J
    0x004b: 0x004b,     #  LATIN CAPITAL LETTER K
    0x004c: 0x004c,     #  LATIN CAPITAL LETTER L
    0x004d: 0x004d,     #  LATIN CAPITAL LETTER M
    0x004e: 0x004e,     #  LATIN CAPITAL LETTER N
    0x004f: 0x004f,     #  LATIN CAPITAL LETTER O
    0x0050: 0x0050,     #  LATIN CAPITAL LETTER P
    0x0051: 0x0051,     #  LATIN CAPITAL LETTER Q
    0x0052: 0x0052,     #  LATIN CAPITAL LETTER R
    0x0053: 0x0053,     #  LATIN CAPITAL LETTER S
    0x0054: 0x0054,     #  LATIN CAPITAL LETTER T
    0x0055: 0x0055,     #  LATIN CAPITAL LETTER U
    0x0056: 0x0056,     #  LATIN CAPITAL LETTER V
    0x0057: 0x0057,     #  LATIN CAPITAL LETTER W
    0x0058: 0x0058,     #  LATIN CAPITAL LETTER X
    0x0059: 0x0059,     #  LATIN CAPITAL LETTER Y
    0x005a: 0x005a,     #  LATIN CAPITAL LETTER Z
    0x005b: 0x005b,     #  LEFT SQUARE BRACKET
    0x005c: 0x005c,     #  REVERSE SOLIDUS
    0x005d: 0x005d,     #  RIGHT SQUARE BRACKET
    0x005e: 0x005e,     #  CIRCUMFLEX ACCENT
    0x005f: 0x005f,     #  LOW LINE
    0x0060: 0x0060,     #  GRAVE ACCENT
    0x0061: 0x0061,     #  LATIN SMALL LETTER A
    0x0062: 0x0062,     #  LATIN SMALL LETTER B
    0x0063: 0x0063,     #  LATIN SMALL LETTER C
    0x0064: 0x0064,     #  LATIN SMALL LETTER D
    0x0065: 0x0065,     #  LATIN SMALL LETTER E
    0x0066: 0x0066,     #  LATIN SMALL LETTER F
    0x0067: 0x0067,     #  LATIN SMALL LETTER G
    0x0068: 0x0068,     #  LATIN SMALL LETTER H
    0x0069: 0x0069,     #  LATIN SMALL LETTER I
    0x006a: 0x006a,     #  LATIN SMALL LETTER J
    0x006b: 0x006b,     #  LATIN SMALL LETTER K
    0x006c: 0x006c,     #  LATIN SMALL LETTER L
    0x006d: 0x006d,     #  LATIN SMALL LETTER M
    0x006e: 0x006e,     #  LATIN SMALL LETTER N
    0x006f: 0x006f,     #  LATIN SMALL LETTER O
    0x0070: 0x0070,     #  LATIN SMALL LETTER P
    0x0071: 0x0071,     #  LATIN SMALL LETTER Q
    0x0072: 0x0072,     #  LATIN SMALL LETTER R
    0x0073: 0x0073,     #  LATIN SMALL LETTER S
    0x0074: 0x0074,     #  LATIN SMALL LETTER T
    0x0075: 0x0075,     #  LATIN SMALL LETTER U
    0x0076: 0x0076,     #  LATIN SMALL LETTER V
    0x0077: 0x0077,     #  LATIN SMALL LETTER W
    0x0078: 0x0078,     #  LATIN SMALL LETTER X
    0x0079: 0x0079,     #  LATIN SMALL LETTER Y
    0x007a: 0x007a,     #  LATIN SMALL LETTER Z
    0x007b: 0x007b,     #  LEFT CURLY BRACKET
    0x007c: 0x007c,     #  VERTICAL LINE
    0x007d: 0x007d,     #  RIGHT CURLY BRACKET
    0x007e: 0x007e,     #  TILDE
    0x007f: 0x007f,     #  DELETE
    0x00a0: 0x00ff,     #  NO-BREAK SPACE
    0x00a1: 0x00ad,     #  INVERTED EXCLAMATION MARK
    0x00a3: 0x009c,     #  POUND SIGN
    0x00a4: 0x00af,     #  CURRENCY SIGN
    0x00aa: 0x00a6,     #  FEMININE ORDINAL INDICATOR
    0x00ab: 0x00ae,     #  LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00ac: 0x00aa,     #  NOT SIGN
    0x00b0: 0x00f8,     #  DEGREE SIGN
    0x00b1: 0x00f1,     #  PLUS-MINUS SIGN
    0x00b2: 0x00fd,     #  SUPERSCRIPT TWO
    0x00b5: 0x00e6,     #  MICRO SIGN
    0x00b7: 0x00fa,     #  MIDDLE DOT
    0x00ba: 0x00a7,     #  MASCULINE ORDINAL INDICATOR
    0x00bc: 0x00ac,     #  VULGAR FRACTION ONE QUARTER
    0x00bd: 0x00ab,     #  VULGAR FRACTION ONE HALF
    0x00bf: 0x00a8,     #  INVERTED QUESTION MARK
    0x00c4: 0x008e,     #  LATIN CAPITAL LETTER A WITH DIAERESIS
    0x00c5: 0x008f,     #  LATIN CAPITAL LETTER A WITH RING ABOVE
    0x00c6: 0x0092,     #  LATIN CAPITAL LIGATURE AE
    0x00c7: 0x0080,     #  LATIN CAPITAL LETTER C WITH CEDILLA
    0x00c9: 0x0090,     #  LATIN CAPITAL LETTER E WITH ACUTE
    0x00d1: 0x00a5,     #  LATIN CAPITAL LETTER N WITH TILDE
    0x00d6: 0x0099,     #  LATIN CAPITAL LETTER O WITH DIAERESIS
    0x00d8: 0x009d,     #  LATIN CAPITAL LETTER O WITH STROKE
    0x00dc: 0x009a,     #  LATIN CAPITAL LETTER U WITH DIAERESIS
    0x00df: 0x00e1,     #  LATIN SMALL LETTER SHARP S
    0x00e0: 0x0085,     #  LATIN SMALL LETTER A WITH GRAVE
    0x00e1: 0x00a0,     #  LATIN SMALL LETTER A WITH ACUTE
    0x00e2: 0x0083,     #  LATIN SMALL LETTER A WITH CIRCUMFLEX
    0x00e4: 0x0084,     #  LATIN SMALL LETTER A WITH DIAERESIS
    0x00e5: 0x0086,     #  LATIN SMALL LETTER A WITH RING ABOVE
    0x00e6: 0x0091,     #  LATIN SMALL LIGATURE AE
    0x00e7: 0x0087,     #  LATIN SMALL LETTER C WITH CEDILLA
    0x00e8: 0x008a,     #  LATIN SMALL LETTER E WITH GRAVE
    0x00e9: 0x0082,     #  LATIN SMALL LETTER E WITH ACUTE
    0x00ea: 0x0088,     #  LATIN SMALL LETTER E WITH CIRCUMFLEX
    0x00eb: 0x0089,     #  LATIN SMALL LETTER E WITH DIAERESIS
    0x00ec: 0x008d,     #  LATIN SMALL LETTER I WITH GRAVE
    0x00ed: 0x00a1,     #  LATIN SMALL LETTER I WITH ACUTE
    0x00ee: 0x008c,     #  LATIN SMALL LETTER I WITH CIRCUMFLEX
    0x00ef: 0x008b,     #  LATIN SMALL LETTER I WITH DIAERESIS
    0x00f1: 0x00a4,     #  LATIN SMALL LETTER N WITH TILDE
    0x00f2: 0x0095,     #  LATIN SMALL LETTER O WITH GRAVE
    0x00f3: 0x00a2,     #  LATIN SMALL LETTER O WITH ACUTE
    0x00f4: 0x0093,     #  LATIN SMALL LETTER O WITH CIRCUMFLEX
    0x00f6: 0x0094,     #  LATIN SMALL LETTER O WITH DIAERESIS
    0x00f7: 0x00f6,     #  DIVISION SIGN
    0x00f8: 0x009b,     #  LATIN SMALL LETTER O WITH STROKE
    0x00f9: 0x0097,     #  LATIN SMALL LETTER U WITH GRAVE
    0x00fa: 0x00a3,     #  LATIN SMALL LETTER U WITH ACUTE
    0x00fb: 0x0096,     #  LATIN SMALL LETTER U WITH CIRCUMFLEX
    0x00fc: 0x0081,     #  LATIN SMALL LETTER U WITH DIAERESIS
    0x00ff: 0x0098,     #  LATIN SMALL LETTER Y WITH DIAERESIS
    0x0192: 0x009f,     #  LATIN SMALL LETTER F WITH HOOK
    0x0393: 0x00e2,     #  GREEK CAPITAL LETTER GAMMA
    0x0398: 0x00e9,     #  GREEK CAPITAL LETTER THETA
    0x03a3: 0x00e4,     #  GREEK CAPITAL LETTER SIGMA
    0x03a6: 0x00e8,     #  GREEK CAPITAL LETTER PHI
    0x03a9: 0x00ea,     #  GREEK CAPITAL LETTER OMEGA
    0x03b1: 0x00e0,     #  GREEK SMALL LETTER ALPHA
    0x03b4: 0x00eb,     #  GREEK SMALL LETTER DELTA
    0x03b5: 0x00ee,     #  GREEK SMALL LETTER EPSILON
    0x03c0: 0x00e3,     #  GREEK SMALL LETTER PI
    0x03c3: 0x00e5,     #  GREEK SMALL LETTER SIGMA
    0x03c4: 0x00e7,     #  GREEK SMALL LETTER TAU
    0x03c6: 0x00ed,     #  GREEK SMALL LETTER PHI
    0x207f: 0x00fc,     #  SUPERSCRIPT LATIN SMALL LETTER N
    0x20a7: 0x009e,     #  PESETA SIGN
    0x2219: 0x00f9,     #  BULLET OPERATOR
    0x221a: 0x00fb,     #  SQUARE ROOT
    0x221e: 0x00ec,     #  INFINITY
    0x2229: 0x00ef,     #  INTERSECTION
    0x2248: 0x00f7,     #  ALMOST EQUAL TO
    0x2261: 0x00f0,     #  IDENTICAL TO
    0x2264: 0x00f3,     #  LESS-THAN OR EQUAL TO
    0x2265: 0x00f2,     #  GREATER-THAN OR EQUAL TO
    0x2310: 0x00a9,     #  REVERSED NOT SIGN
    0x2320: 0x00f4,     #  TOP HALF INTEGRAL
    0x2321: 0x00f5,     #  BOTTOM HALF INTEGRAL
    0x2500: 0x00c4,     #  BOX DRAWINGS LIGHT HORIZONTAL
    0x2502: 0x00b3,     #  BOX DRAWINGS LIGHT VERTICAL
    0x250c: 0x00da,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
    0x2510: 0x00bf,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
    0x2514: 0x00c0,     #  BOX DRAWINGS LIGHT UP AND RIGHT
    0x2518: 0x00d9,     #  BOX DRAWINGS LIGHT UP AND LEFT
    0x251c: 0x00c3,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    0x2524: 0x00b4,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
    0x252c: 0x00c2,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    0x2534: 0x00c1,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
    0x253c: 0x00c5,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    0x2550: 0x00cd,     #  BOX DRAWINGS DOUBLE HORIZONTAL
    0x2551: 0x00ba,     #  BOX DRAWINGS DOUBLE VERTICAL
    0x2552: 0x00d5,     #  BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
    0x2553: 0x00d6,     #  BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
    0x2554: 0x00c9,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
    0x2555: 0x00b8,     #  BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
    0x2556: 0x00b7,     #  BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
    0x2557: 0x00bb,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
    0x2558: 0x00d4,     #  BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
    0x2559: 0x00d3,     #  BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
    0x255a: 0x00c8,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
    0x255b: 0x00be,     #  BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
    0x255c: 0x00bd,     #  BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
    0x255d: 0x00bc,     #  BOX DRAWINGS DOUBLE UP AND LEFT
    0x255e: 0x00c6,     #  BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
    0x255f: 0x00c7,     #  BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
    0x2560: 0x00cc,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    0x2561: 0x00b5,     #  BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
    0x2562: 0x00b6,     #  BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
    0x2563: 0x00b9,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    0x2564: 0x00d1,     #  BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
    0x2565: 0x00d2,     #  BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
    0x2566: 0x00cb,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    0x2567: 0x00cf,     #  BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
    0x2568: 0x00d0,     #  BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
    0x2569: 0x00ca,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    0x256a: 0x00d8,     #  BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
    0x256b: 0x00d7,     #  BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
    0x256c: 0x00ce,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    0x2580: 0x00df,     #  UPPER HALF BLOCK
    0x2584: 0x00dc,     #  LOWER HALF BLOCK
    0x2588: 0x00db,     #  FULL BLOCK
    0x258c: 0x00dd,     #  LEFT HALF BLOCK
    0x2590: 0x00de,     #  RIGHT HALF BLOCK
    0x2591: 0x00b0,     #  LIGHT SHADE
    0x2592: 0x00b1,     #  MEDIUM SHADE
    0x2593: 0x00b2,     #  DARK SHADE
    0x25a0: 0x00fe,     #  BLACK SQUARE
}
encodings/cp864.py000064400000101577151153537630007757 0ustar00""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP864.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_map)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_map)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp864',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )

### Decoding Map

decoding_map = codecs.make_identity_dict(range(256))
decoding_map.update({
    0x0025: 0x066a,     #  ARABIC PERCENT SIGN
    0x0080: 0x00b0,     #  DEGREE SIGN
    0x0081: 0x00b7,     #  MIDDLE DOT
    0x0082: 0x2219,     #  BULLET OPERATOR
    0x0083: 0x221a,     #  SQUARE ROOT
    0x0084: 0x2592,     #  MEDIUM SHADE
    0x0085: 0x2500,     #  FORMS LIGHT HORIZONTAL
    0x0086: 0x2502,     #  FORMS LIGHT VERTICAL
    0x0087: 0x253c,     #  FORMS LIGHT VERTICAL AND HORIZONTAL
    0x0088: 0x2524,     #  FORMS LIGHT VERTICAL AND LEFT
    0x0089: 0x252c,     #  FORMS LIGHT DOWN AND HORIZONTAL
    0x008a: 0x251c,     #  FORMS LIGHT VERTICAL AND RIGHT
    0x008b: 0x2534,     #  FORMS LIGHT UP AND HORIZONTAL
    0x008c: 0x2510,     #  FORMS LIGHT DOWN AND LEFT
    0x008d: 0x250c,     #  FORMS LIGHT DOWN AND RIGHT
    0x008e: 0x2514,     #  FORMS LIGHT UP AND RIGHT
    0x008f: 0x2518,     #  FORMS LIGHT UP AND LEFT
    0x0090: 0x03b2,     #  GREEK SMALL BETA
    0x0091: 0x221e,     #  INFINITY
    0x0092: 0x03c6,     #  GREEK SMALL PHI
    0x0093: 0x00b1,     #  PLUS-OR-MINUS SIGN
    0x0094: 0x00bd,     #  FRACTION 1/2
    0x0095: 0x00bc,     #  FRACTION 1/4
    0x0096: 0x2248,     #  ALMOST EQUAL TO
    0x0097: 0x00ab,     #  LEFT POINTING GUILLEMET
    0x0098: 0x00bb,     #  RIGHT POINTING GUILLEMET
    0x0099: 0xfef7,     #  ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE ISOLATED FORM
    0x009a: 0xfef8,     #  ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE FINAL FORM
    0x009b: None,       #  UNDEFINED
    0x009c: None,       #  UNDEFINED
    0x009d: 0xfefb,     #  ARABIC LIGATURE LAM WITH ALEF ISOLATED FORM
    0x009e: 0xfefc,     #  ARABIC LIGATURE LAM WITH ALEF FINAL FORM
    0x009f: None,       #  UNDEFINED
    0x00a1: 0x00ad,     #  SOFT HYPHEN
    0x00a2: 0xfe82,     #  ARABIC LETTER ALEF WITH MADDA ABOVE FINAL FORM
    0x00a5: 0xfe84,     #  ARABIC LETTER ALEF WITH HAMZA ABOVE FINAL FORM
    0x00a6: None,       #  UNDEFINED
    0x00a7: None,       #  UNDEFINED
    0x00a8: 0xfe8e,     #  ARABIC LETTER ALEF FINAL FORM
    0x00a9: 0xfe8f,     #  ARABIC LETTER BEH ISOLATED FORM
    0x00aa: 0xfe95,     #  ARABIC LETTER TEH ISOLATED FORM
    0x00ab: 0xfe99,     #  ARABIC LETTER THEH ISOLATED FORM
    0x00ac: 0x060c,     #  ARABIC COMMA
    0x00ad: 0xfe9d,     #  ARABIC LETTER JEEM ISOLATED FORM
    0x00ae: 0xfea1,     #  ARABIC LETTER HAH ISOLATED FORM
    0x00af: 0xfea5,     #  ARABIC LETTER KHAH ISOLATED FORM
    0x00b0: 0x0660,     #  ARABIC-INDIC DIGIT ZERO
    0x00b1: 0x0661,     #  ARABIC-INDIC DIGIT ONE
    0x00b2: 0x0662,     #  ARABIC-INDIC DIGIT TWO
    0x00b3: 0x0663,     #  ARABIC-INDIC DIGIT THREE
    0x00b4: 0x0664,     #  ARABIC-INDIC DIGIT FOUR
    0x00b5: 0x0665,     #  ARABIC-INDIC DIGIT FIVE
    0x00b6: 0x0666,     #  ARABIC-INDIC DIGIT SIX
    0x00b7: 0x0667,     #  ARABIC-INDIC DIGIT SEVEN
    0x00b8: 0x0668,     #  ARABIC-INDIC DIGIT EIGHT
    0x00b9: 0x0669,     #  ARABIC-INDIC DIGIT NINE
    0x00ba: 0xfed1,     #  ARABIC LETTER FEH ISOLATED FORM
    0x00bb: 0x061b,     #  ARABIC SEMICOLON
    0x00bc: 0xfeb1,     #  ARABIC LETTER SEEN ISOLATED FORM
    0x00bd: 0xfeb5,     #  ARABIC LETTER SHEEN ISOLATED FORM
    0x00be: 0xfeb9,     #  ARABIC LETTER SAD ISOLATED FORM
    0x00bf: 0x061f,     #  ARABIC QUESTION MARK
    0x00c0: 0x00a2,     #  CENT SIGN
    0x00c1: 0xfe80,     #  ARABIC LETTER HAMZA ISOLATED FORM
    0x00c2: 0xfe81,     #  ARABIC LETTER ALEF WITH MADDA ABOVE ISOLATED FORM
    0x00c3: 0xfe83,     #  ARABIC LETTER ALEF WITH HAMZA ABOVE ISOLATED FORM
    0x00c4: 0xfe85,     #  ARABIC LETTER WAW WITH HAMZA ABOVE ISOLATED FORM
    0x00c5: 0xfeca,     #  ARABIC LETTER AIN FINAL FORM
    0x00c6: 0xfe8b,     #  ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM
    0x00c7: 0xfe8d,     #  ARABIC LETTER ALEF ISOLATED FORM
    0x00c8: 0xfe91,     #  ARABIC LETTER BEH INITIAL FORM
    0x00c9: 0xfe93,     #  ARABIC LETTER TEH MARBUTA ISOLATED FORM
    0x00ca: 0xfe97,     #  ARABIC LETTER TEH INITIAL FORM
    0x00cb: 0xfe9b,     #  ARABIC LETTER THEH INITIAL FORM
    0x00cc: 0xfe9f,     #  ARABIC LETTER JEEM INITIAL FORM
    0x00cd: 0xfea3,     #  ARABIC LETTER HAH INITIAL FORM
    0x00ce: 0xfea7,     #  ARABIC LETTER KHAH INITIAL FORM
    0x00cf: 0xfea9,     #  ARABIC LETTER DAL ISOLATED FORM
    0x00d0: 0xfeab,     #  ARABIC LETTER THAL ISOLATED FORM
    0x00d1: 0xfead,     #  ARABIC LETTER REH ISOLATED FORM
    0x00d2: 0xfeaf,     #  ARABIC LETTER ZAIN ISOLATED FORM
    0x00d3: 0xfeb3,     #  ARABIC LETTER SEEN INITIAL FORM
    0x00d4: 0xfeb7,     #  ARABIC LETTER SHEEN INITIAL FORM
    0x00d5: 0xfebb,     #  ARABIC LETTER SAD INITIAL FORM
    0x00d6: 0xfebf,     #  ARABIC LETTER DAD INITIAL FORM
    0x00d7: 0xfec1,     #  ARABIC LETTER TAH ISOLATED FORM
    0x00d8: 0xfec5,     #  ARABIC LETTER ZAH ISOLATED FORM
    0x00d9: 0xfecb,     #  ARABIC LETTER AIN INITIAL FORM
    0x00da: 0xfecf,     #  ARABIC LETTER GHAIN INITIAL FORM
    0x00db: 0x00a6,     #  BROKEN VERTICAL BAR
    0x00dc: 0x00ac,     #  NOT SIGN
    0x00dd: 0x00f7,     #  DIVISION SIGN
    0x00de: 0x00d7,     #  MULTIPLICATION SIGN
    0x00df: 0xfec9,     #  ARABIC LETTER AIN ISOLATED FORM
    0x00e0: 0x0640,     #  ARABIC TATWEEL
    0x00e1: 0xfed3,     #  ARABIC LETTER FEH INITIAL FORM
    0x00e2: 0xfed7,     #  ARABIC LETTER QAF INITIAL FORM
    0x00e3: 0xfedb,     #  ARABIC LETTER KAF INITIAL FORM
    0x00e4: 0xfedf,     #  ARABIC LETTER LAM INITIAL FORM
    0x00e5: 0xfee3,     #  ARABIC LETTER MEEM INITIAL FORM
    0x00e6: 0xfee7,     #  ARABIC LETTER NOON INITIAL FORM
    0x00e7: 0xfeeb,     #  ARABIC LETTER HEH INITIAL FORM
    0x00e8: 0xfeed,     #  ARABIC LETTER WAW ISOLATED FORM
    0x00e9: 0xfeef,     #  ARABIC LETTER ALEF MAKSURA ISOLATED FORM
    0x00ea: 0xfef3,     #  ARABIC LETTER YEH INITIAL FORM
    0x00eb: 0xfebd,     #  ARABIC LETTER DAD ISOLATED FORM
    0x00ec: 0xfecc,     #  ARABIC LETTER AIN MEDIAL FORM
    0x00ed: 0xfece,     #  ARABIC LETTER GHAIN FINAL FORM
    0x00ee: 0xfecd,     #  ARABIC LETTER GHAIN ISOLATED FORM
    0x00ef: 0xfee1,     #  ARABIC LETTER MEEM ISOLATED FORM
    0x00f0: 0xfe7d,     #  ARABIC SHADDA MEDIAL FORM
    0x00f1: 0x0651,     #  ARABIC SHADDAH
    0x00f2: 0xfee5,     #  ARABIC LETTER NOON ISOLATED FORM
    0x00f3: 0xfee9,     #  ARABIC LETTER HEH ISOLATED FORM
    0x00f4: 0xfeec,     #  ARABIC LETTER HEH MEDIAL FORM
    0x00f5: 0xfef0,     #  ARABIC LETTER ALEF MAKSURA FINAL FORM
    0x00f6: 0xfef2,     #  ARABIC LETTER YEH FINAL FORM
    0x00f7: 0xfed0,     #  ARABIC LETTER GHAIN MEDIAL FORM
    0x00f8: 0xfed5,     #  ARABIC LETTER QAF ISOLATED FORM
    0x00f9: 0xfef5,     #  ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE ISOLATED FORM
    0x00fa: 0xfef6,     #  ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE FINAL FORM
    0x00fb: 0xfedd,     #  ARABIC LETTER LAM ISOLATED FORM
    0x00fc: 0xfed9,     #  ARABIC LETTER KAF ISOLATED FORM
    0x00fd: 0xfef1,     #  ARABIC LETTER YEH ISOLATED FORM
    0x00fe: 0x25a0,     #  BLACK SQUARE
    0x00ff: None,       #  UNDEFINED
})

### Decoding Table

decoding_table = (
    '\x00'     #  0x0000 -> NULL
    '\x01'     #  0x0001 -> START OF HEADING
    '\x02'     #  0x0002 -> START OF TEXT
    '\x03'     #  0x0003 -> END OF TEXT
    '\x04'     #  0x0004 -> END OF TRANSMISSION
    '\x05'     #  0x0005 -> ENQUIRY
    '\x06'     #  0x0006 -> ACKNOWLEDGE
    '\x07'     #  0x0007 -> BELL
    '\x08'     #  0x0008 -> BACKSPACE
    '\t'       #  0x0009 -> HORIZONTAL TABULATION
    '\n'       #  0x000a -> LINE FEED
    '\x0b'     #  0x000b -> VERTICAL TABULATION
    '\x0c'     #  0x000c -> FORM FEED
    '\r'       #  0x000d -> CARRIAGE RETURN
    '\x0e'     #  0x000e -> SHIFT OUT
    '\x0f'     #  0x000f -> SHIFT IN
    '\x10'     #  0x0010 -> DATA LINK ESCAPE
    '\x11'     #  0x0011 -> DEVICE CONTROL ONE
    '\x12'     #  0x0012 -> DEVICE CONTROL TWO
    '\x13'     #  0x0013 -> DEVICE CONTROL THREE
    '\x14'     #  0x0014 -> DEVICE CONTROL FOUR
    '\x15'     #  0x0015 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x0016 -> SYNCHRONOUS IDLE
    '\x17'     #  0x0017 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x0018 -> CANCEL
    '\x19'     #  0x0019 -> END OF MEDIUM
    '\x1a'     #  0x001a -> SUBSTITUTE
    '\x1b'     #  0x001b -> ESCAPE
    '\x1c'     #  0x001c -> FILE SEPARATOR
    '\x1d'     #  0x001d -> GROUP SEPARATOR
    '\x1e'     #  0x001e -> RECORD SEPARATOR
    '\x1f'     #  0x001f -> UNIT SEPARATOR
    ' '        #  0x0020 -> SPACE
    '!'        #  0x0021 -> EXCLAMATION MARK
    '"'        #  0x0022 -> QUOTATION MARK
    '#'        #  0x0023 -> NUMBER SIGN
    '$'        #  0x0024 -> DOLLAR SIGN
    '\u066a'   #  0x0025 -> ARABIC PERCENT SIGN
    '&'        #  0x0026 -> AMPERSAND
    "'"        #  0x0027 -> APOSTROPHE
    '('        #  0x0028 -> LEFT PARENTHESIS
    ')'        #  0x0029 -> RIGHT PARENTHESIS
    '*'        #  0x002a -> ASTERISK
    '+'        #  0x002b -> PLUS SIGN
    ','        #  0x002c -> COMMA
    '-'        #  0x002d -> HYPHEN-MINUS
    '.'        #  0x002e -> FULL STOP
    '/'        #  0x002f -> SOLIDUS
    '0'        #  0x0030 -> DIGIT ZERO
    '1'        #  0x0031 -> DIGIT ONE
    '2'        #  0x0032 -> DIGIT TWO
    '3'        #  0x0033 -> DIGIT THREE
    '4'        #  0x0034 -> DIGIT FOUR
    '5'        #  0x0035 -> DIGIT FIVE
    '6'        #  0x0036 -> DIGIT SIX
    '7'        #  0x0037 -> DIGIT SEVEN
    '8'        #  0x0038 -> DIGIT EIGHT
    '9'        #  0x0039 -> DIGIT NINE
    ':'        #  0x003a -> COLON
    ';'        #  0x003b -> SEMICOLON
    '<'        #  0x003c -> LESS-THAN SIGN
    '='        #  0x003d -> EQUALS SIGN
    '>'        #  0x003e -> GREATER-THAN SIGN
    '?'        #  0x003f -> QUESTION MARK
    '@'        #  0x0040 -> COMMERCIAL AT
    'A'        #  0x0041 -> LATIN CAPITAL LETTER A
    'B'        #  0x0042 -> LATIN CAPITAL LETTER B
    'C'        #  0x0043 -> LATIN CAPITAL LETTER C
    'D'        #  0x0044 -> LATIN CAPITAL LETTER D
    'E'        #  0x0045 -> LATIN CAPITAL LETTER E
    'F'        #  0x0046 -> LATIN CAPITAL LETTER F
    'G'        #  0x0047 -> LATIN CAPITAL LETTER G
    'H'        #  0x0048 -> LATIN CAPITAL LETTER H
    'I'        #  0x0049 -> LATIN CAPITAL LETTER I
    'J'        #  0x004a -> LATIN CAPITAL LETTER J
    'K'        #  0x004b -> LATIN CAPITAL LETTER K
    'L'        #  0x004c -> LATIN CAPITAL LETTER L
    'M'        #  0x004d -> LATIN CAPITAL LETTER M
    'N'        #  0x004e -> LATIN CAPITAL LETTER N
    'O'        #  0x004f -> LATIN CAPITAL LETTER O
    'P'        #  0x0050 -> LATIN CAPITAL LETTER P
    'Q'        #  0x0051 -> LATIN CAPITAL LETTER Q
    'R'        #  0x0052 -> LATIN CAPITAL LETTER R
    'S'        #  0x0053 -> LATIN CAPITAL LETTER S
    'T'        #  0x0054 -> LATIN CAPITAL LETTER T
    'U'        #  0x0055 -> LATIN CAPITAL LETTER U
    'V'        #  0x0056 -> LATIN CAPITAL LETTER V
    'W'        #  0x0057 -> LATIN CAPITAL LETTER W
    'X'        #  0x0058 -> LATIN CAPITAL LETTER X
    'Y'        #  0x0059 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x005a -> LATIN CAPITAL LETTER Z
    '['        #  0x005b -> LEFT SQUARE BRACKET
    '\\'       #  0x005c -> REVERSE SOLIDUS
    ']'        #  0x005d -> RIGHT SQUARE BRACKET
    '^'        #  0x005e -> CIRCUMFLEX ACCENT
    '_'        #  0x005f -> LOW LINE
    '`'        #  0x0060 -> GRAVE ACCENT
    'a'        #  0x0061 -> LATIN SMALL LETTER A
    'b'        #  0x0062 -> LATIN SMALL LETTER B
    'c'        #  0x0063 -> LATIN SMALL LETTER C
    'd'        #  0x0064 -> LATIN SMALL LETTER D
    'e'        #  0x0065 -> LATIN SMALL LETTER E
    'f'        #  0x0066 -> LATIN SMALL LETTER F
    'g'        #  0x0067 -> LATIN SMALL LETTER G
    'h'        #  0x0068 -> LATIN SMALL LETTER H
    'i'        #  0x0069 -> LATIN SMALL LETTER I
    'j'        #  0x006a -> LATIN SMALL LETTER J
    'k'        #  0x006b -> LATIN SMALL LETTER K
    'l'        #  0x006c -> LATIN SMALL LETTER L
    'm'        #  0x006d -> LATIN SMALL LETTER M
    'n'        #  0x006e -> LATIN SMALL LETTER N
    'o'        #  0x006f -> LATIN SMALL LETTER O
    'p'        #  0x0070 -> LATIN SMALL LETTER P
    'q'        #  0x0071 -> LATIN SMALL LETTER Q
    'r'        #  0x0072 -> LATIN SMALL LETTER R
    's'        #  0x0073 -> LATIN SMALL LETTER S
    't'        #  0x0074 -> LATIN SMALL LETTER T
    'u'        #  0x0075 -> LATIN SMALL LETTER U
    'v'        #  0x0076 -> LATIN SMALL LETTER V
    'w'        #  0x0077 -> LATIN SMALL LETTER W
    'x'        #  0x0078 -> LATIN SMALL LETTER X
    'y'        #  0x0079 -> LATIN SMALL LETTER Y
    'z'        #  0x007a -> LATIN SMALL LETTER Z
    '{'        #  0x007b -> LEFT CURLY BRACKET
    '|'        #  0x007c -> VERTICAL LINE
    '}'        #  0x007d -> RIGHT CURLY BRACKET
    '~'        #  0x007e -> TILDE
    '\x7f'     #  0x007f -> DELETE
    '\xb0'     #  0x0080 -> DEGREE SIGN
    '\xb7'     #  0x0081 -> MIDDLE DOT
    '\u2219'   #  0x0082 -> BULLET OPERATOR
    '\u221a'   #  0x0083 -> SQUARE ROOT
    '\u2592'   #  0x0084 -> MEDIUM SHADE
    '\u2500'   #  0x0085 -> FORMS LIGHT HORIZONTAL
    '\u2502'   #  0x0086 -> FORMS LIGHT VERTICAL
    '\u253c'   #  0x0087 -> FORMS LIGHT VERTICAL AND HORIZONTAL
    '\u2524'   #  0x0088 -> FORMS LIGHT VERTICAL AND LEFT
    '\u252c'   #  0x0089 -> FORMS LIGHT DOWN AND HORIZONTAL
    '\u251c'   #  0x008a -> FORMS LIGHT VERTICAL AND RIGHT
    '\u2534'   #  0x008b -> FORMS LIGHT UP AND HORIZONTAL
    '\u2510'   #  0x008c -> FORMS LIGHT DOWN AND LEFT
    '\u250c'   #  0x008d -> FORMS LIGHT DOWN AND RIGHT
    '\u2514'   #  0x008e -> FORMS LIGHT UP AND RIGHT
    '\u2518'   #  0x008f -> FORMS LIGHT UP AND LEFT
    '\u03b2'   #  0x0090 -> GREEK SMALL BETA
    '\u221e'   #  0x0091 -> INFINITY
    '\u03c6'   #  0x0092 -> GREEK SMALL PHI
    '\xb1'     #  0x0093 -> PLUS-OR-MINUS SIGN
    '\xbd'     #  0x0094 -> FRACTION 1/2
    '\xbc'     #  0x0095 -> FRACTION 1/4
    '\u2248'   #  0x0096 -> ALMOST EQUAL TO
    '\xab'     #  0x0097 -> LEFT POINTING GUILLEMET
    '\xbb'     #  0x0098 -> RIGHT POINTING GUILLEMET
    '\ufef7'   #  0x0099 -> ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE ISOLATED FORM
    '\ufef8'   #  0x009a -> ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE FINAL FORM
    '\ufffe'   #  0x009b -> UNDEFINED
    '\ufffe'   #  0x009c -> UNDEFINED
    '\ufefb'   #  0x009d -> ARABIC LIGATURE LAM WITH ALEF ISOLATED FORM
    '\ufefc'   #  0x009e -> ARABIC LIGATURE LAM WITH ALEF FINAL FORM
    '\ufffe'   #  0x009f -> UNDEFINED
    '\xa0'     #  0x00a0 -> NON-BREAKING SPACE
    '\xad'     #  0x00a1 -> SOFT HYPHEN
    '\ufe82'   #  0x00a2 -> ARABIC LETTER ALEF WITH MADDA ABOVE FINAL FORM
    '\xa3'     #  0x00a3 -> POUND SIGN
    '\xa4'     #  0x00a4 -> CURRENCY SIGN
    '\ufe84'   #  0x00a5 -> ARABIC LETTER ALEF WITH HAMZA ABOVE FINAL FORM
    '\ufffe'   #  0x00a6 -> UNDEFINED
    '\ufffe'   #  0x00a7 -> UNDEFINED
    '\ufe8e'   #  0x00a8 -> ARABIC LETTER ALEF FINAL FORM
    '\ufe8f'   #  0x00a9 -> ARABIC LETTER BEH ISOLATED FORM
    '\ufe95'   #  0x00aa -> ARABIC LETTER TEH ISOLATED FORM
    '\ufe99'   #  0x00ab -> ARABIC LETTER THEH ISOLATED FORM
    '\u060c'   #  0x00ac -> ARABIC COMMA
    '\ufe9d'   #  0x00ad -> ARABIC LETTER JEEM ISOLATED FORM
    '\ufea1'   #  0x00ae -> ARABIC LETTER HAH ISOLATED FORM
    '\ufea5'   #  0x00af -> ARABIC LETTER KHAH ISOLATED FORM
    '\u0660'   #  0x00b0 -> ARABIC-INDIC DIGIT ZERO
    '\u0661'   #  0x00b1 -> ARABIC-INDIC DIGIT ONE
    '\u0662'   #  0x00b2 -> ARABIC-INDIC DIGIT TWO
    '\u0663'   #  0x00b3 -> ARABIC-INDIC DIGIT THREE
    '\u0664'   #  0x00b4 -> ARABIC-INDIC DIGIT FOUR
    '\u0665'   #  0x00b5 -> ARABIC-INDIC DIGIT FIVE
    '\u0666'   #  0x00b6 -> ARABIC-INDIC DIGIT SIX
    '\u0667'   #  0x00b7 -> ARABIC-INDIC DIGIT SEVEN
    '\u0668'   #  0x00b8 -> ARABIC-INDIC DIGIT EIGHT
    '\u0669'   #  0x00b9 -> ARABIC-INDIC DIGIT NINE
    '\ufed1'   #  0x00ba -> ARABIC LETTER FEH ISOLATED FORM
    '\u061b'   #  0x00bb -> ARABIC SEMICOLON
    '\ufeb1'   #  0x00bc -> ARABIC LETTER SEEN ISOLATED FORM
    '\ufeb5'   #  0x00bd -> ARABIC LETTER SHEEN ISOLATED FORM
    '\ufeb9'   #  0x00be -> ARABIC LETTER SAD ISOLATED FORM
    '\u061f'   #  0x00bf -> ARABIC QUESTION MARK
    '\xa2'     #  0x00c0 -> CENT SIGN
    '\ufe80'   #  0x00c1 -> ARABIC LETTER HAMZA ISOLATED FORM
    '\ufe81'   #  0x00c2 -> ARABIC LETTER ALEF WITH MADDA ABOVE ISOLATED FORM
    '\ufe83'   #  0x00c3 -> ARABIC LETTER ALEF WITH HAMZA ABOVE ISOLATED FORM
    '\ufe85'   #  0x00c4 -> ARABIC LETTER WAW WITH HAMZA ABOVE ISOLATED FORM
    '\ufeca'   #  0x00c5 -> ARABIC LETTER AIN FINAL FORM
    '\ufe8b'   #  0x00c6 -> ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM
    '\ufe8d'   #  0x00c7 -> ARABIC LETTER ALEF ISOLATED FORM
    '\ufe91'   #  0x00c8 -> ARABIC LETTER BEH INITIAL FORM
    '\ufe93'   #  0x00c9 -> ARABIC LETTER TEH MARBUTA ISOLATED FORM
    '\ufe97'   #  0x00ca -> ARABIC LETTER TEH INITIAL FORM
    '\ufe9b'   #  0x00cb -> ARABIC LETTER THEH INITIAL FORM
    '\ufe9f'   #  0x00cc -> ARABIC LETTER JEEM INITIAL FORM
    '\ufea3'   #  0x00cd -> ARABIC LETTER HAH INITIAL FORM
    '\ufea7'   #  0x00ce -> ARABIC LETTER KHAH INITIAL FORM
    '\ufea9'   #  0x00cf -> ARABIC LETTER DAL ISOLATED FORM
    '\ufeab'   #  0x00d0 -> ARABIC LETTER THAL ISOLATED FORM
    '\ufead'   #  0x00d1 -> ARABIC LETTER REH ISOLATED FORM
    '\ufeaf'   #  0x00d2 -> ARABIC LETTER ZAIN ISOLATED FORM
    '\ufeb3'   #  0x00d3 -> ARABIC LETTER SEEN INITIAL FORM
    '\ufeb7'   #  0x00d4 -> ARABIC LETTER SHEEN INITIAL FORM
    '\ufebb'   #  0x00d5 -> ARABIC LETTER SAD INITIAL FORM
    '\ufebf'   #  0x00d6 -> ARABIC LETTER DAD INITIAL FORM
    '\ufec1'   #  0x00d7 -> ARABIC LETTER TAH ISOLATED FORM
    '\ufec5'   #  0x00d8 -> ARABIC LETTER ZAH ISOLATED FORM
    '\ufecb'   #  0x00d9 -> ARABIC LETTER AIN INITIAL FORM
    '\ufecf'   #  0x00da -> ARABIC LETTER GHAIN INITIAL FORM
    '\xa6'     #  0x00db -> BROKEN VERTICAL BAR
    '\xac'     #  0x00dc -> NOT SIGN
    '\xf7'     #  0x00dd -> DIVISION SIGN
    '\xd7'     #  0x00de -> MULTIPLICATION SIGN
    '\ufec9'   #  0x00df -> ARABIC LETTER AIN ISOLATED FORM
    '\u0640'   #  0x00e0 -> ARABIC TATWEEL
    '\ufed3'   #  0x00e1 -> ARABIC LETTER FEH INITIAL FORM
    '\ufed7'   #  0x00e2 -> ARABIC LETTER QAF INITIAL FORM
    '\ufedb'   #  0x00e3 -> ARABIC LETTER KAF INITIAL FORM
    '\ufedf'   #  0x00e4 -> ARABIC LETTER LAM INITIAL FORM
    '\ufee3'   #  0x00e5 -> ARABIC LETTER MEEM INITIAL FORM
    '\ufee7'   #  0x00e6 -> ARABIC LETTER NOON INITIAL FORM
    '\ufeeb'   #  0x00e7 -> ARABIC LETTER HEH INITIAL FORM
    '\ufeed'   #  0x00e8 -> ARABIC LETTER WAW ISOLATED FORM
    '\ufeef'   #  0x00e9 -> ARABIC LETTER ALEF MAKSURA ISOLATED FORM
    '\ufef3'   #  0x00ea -> ARABIC LETTER YEH INITIAL FORM
    '\ufebd'   #  0x00eb -> ARABIC LETTER DAD ISOLATED FORM
    '\ufecc'   #  0x00ec -> ARABIC LETTER AIN MEDIAL FORM
    '\ufece'   #  0x00ed -> ARABIC LETTER GHAIN FINAL FORM
    '\ufecd'   #  0x00ee -> ARABIC LETTER GHAIN ISOLATED FORM
    '\ufee1'   #  0x00ef -> ARABIC LETTER MEEM ISOLATED FORM
    '\ufe7d'   #  0x00f0 -> ARABIC SHADDA MEDIAL FORM
    '\u0651'   #  0x00f1 -> ARABIC SHADDAH
    '\ufee5'   #  0x00f2 -> ARABIC LETTER NOON ISOLATED FORM
    '\ufee9'   #  0x00f3 -> ARABIC LETTER HEH ISOLATED FORM
    '\ufeec'   #  0x00f4 -> ARABIC LETTER HEH MEDIAL FORM
    '\ufef0'   #  0x00f5 -> ARABIC LETTER ALEF MAKSURA FINAL FORM
    '\ufef2'   #  0x00f6 -> ARABIC LETTER YEH FINAL FORM
    '\ufed0'   #  0x00f7 -> ARABIC LETTER GHAIN MEDIAL FORM
    '\ufed5'   #  0x00f8 -> ARABIC LETTER QAF ISOLATED FORM
    '\ufef5'   #  0x00f9 -> ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE ISOLATED FORM
    '\ufef6'   #  0x00fa -> ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE FINAL FORM
    '\ufedd'   #  0x00fb -> ARABIC LETTER LAM ISOLATED FORM
    '\ufed9'   #  0x00fc -> ARABIC LETTER KAF ISOLATED FORM
    '\ufef1'   #  0x00fd -> ARABIC LETTER YEH ISOLATED FORM
    '\u25a0'   #  0x00fe -> BLACK SQUARE
    '\ufffe'   #  0x00ff -> UNDEFINED
)

### Encoding Map

encoding_map = {
    0x0000: 0x0000,     #  NULL
    0x0001: 0x0001,     #  START OF HEADING
    0x0002: 0x0002,     #  START OF TEXT
    0x0003: 0x0003,     #  END OF TEXT
    0x0004: 0x0004,     #  END OF TRANSMISSION
    0x0005: 0x0005,     #  ENQUIRY
    0x0006: 0x0006,     #  ACKNOWLEDGE
    0x0007: 0x0007,     #  BELL
    0x0008: 0x0008,     #  BACKSPACE
    0x0009: 0x0009,     #  HORIZONTAL TABULATION
    0x000a: 0x000a,     #  LINE FEED
    0x000b: 0x000b,     #  VERTICAL TABULATION
    0x000c: 0x000c,     #  FORM FEED
    0x000d: 0x000d,     #  CARRIAGE RETURN
    0x000e: 0x000e,     #  SHIFT OUT
    0x000f: 0x000f,     #  SHIFT IN
    0x0010: 0x0010,     #  DATA LINK ESCAPE
    0x0011: 0x0011,     #  DEVICE CONTROL ONE
    0x0012: 0x0012,     #  DEVICE CONTROL TWO
    0x0013: 0x0013,     #  DEVICE CONTROL THREE
    0x0014: 0x0014,     #  DEVICE CONTROL FOUR
    0x0015: 0x0015,     #  NEGATIVE ACKNOWLEDGE
    0x0016: 0x0016,     #  SYNCHRONOUS IDLE
    0x0017: 0x0017,     #  END OF TRANSMISSION BLOCK
    0x0018: 0x0018,     #  CANCEL
    0x0019: 0x0019,     #  END OF MEDIUM
    0x001a: 0x001a,     #  SUBSTITUTE
    0x001b: 0x001b,     #  ESCAPE
    0x001c: 0x001c,     #  FILE SEPARATOR
    0x001d: 0x001d,     #  GROUP SEPARATOR
    0x001e: 0x001e,     #  RECORD SEPARATOR
    0x001f: 0x001f,     #  UNIT SEPARATOR
    0x0020: 0x0020,     #  SPACE
    0x0021: 0x0021,     #  EXCLAMATION MARK
    0x0022: 0x0022,     #  QUOTATION MARK
    0x0023: 0x0023,     #  NUMBER SIGN
    0x0024: 0x0024,     #  DOLLAR SIGN
    0x0026: 0x0026,     #  AMPERSAND
    0x0027: 0x0027,     #  APOSTROPHE
    0x0028: 0x0028,     #  LEFT PARENTHESIS
    0x0029: 0x0029,     #  RIGHT PARENTHESIS
    0x002a: 0x002a,     #  ASTERISK
    0x002b: 0x002b,     #  PLUS SIGN
    0x002c: 0x002c,     #  COMMA
    0x002d: 0x002d,     #  HYPHEN-MINUS
    0x002e: 0x002e,     #  FULL STOP
    0x002f: 0x002f,     #  SOLIDUS
    0x0030: 0x0030,     #  DIGIT ZERO
    0x0031: 0x0031,     #  DIGIT ONE
    0x0032: 0x0032,     #  DIGIT TWO
    0x0033: 0x0033,     #  DIGIT THREE
    0x0034: 0x0034,     #  DIGIT FOUR
    0x0035: 0x0035,     #  DIGIT FIVE
    0x0036: 0x0036,     #  DIGIT SIX
    0x0037: 0x0037,     #  DIGIT SEVEN
    0x0038: 0x0038,     #  DIGIT EIGHT
    0x0039: 0x0039,     #  DIGIT NINE
    0x003a: 0x003a,     #  COLON
    0x003b: 0x003b,     #  SEMICOLON
    0x003c: 0x003c,     #  LESS-THAN SIGN
    0x003d: 0x003d,     #  EQUALS SIGN
    0x003e: 0x003e,     #  GREATER-THAN SIGN
    0x003f: 0x003f,     #  QUESTION MARK
    0x0040: 0x0040,     #  COMMERCIAL AT
    0x0041: 0x0041,     #  LATIN CAPITAL LETTER A
    0x0042: 0x0042,     #  LATIN CAPITAL LETTER B
    0x0043: 0x0043,     #  LATIN CAPITAL LETTER C
    0x0044: 0x0044,     #  LATIN CAPITAL LETTER D
    0x0045: 0x0045,     #  LATIN CAPITAL LETTER E
    0x0046: 0x0046,     #  LATIN CAPITAL LETTER F
    0x0047: 0x0047,     #  LATIN CAPITAL LETTER G
    0x0048: 0x0048,     #  LATIN CAPITAL LETTER H
    0x0049: 0x0049,     #  LATIN CAPITAL LETTER I
    0x004a: 0x004a,     #  LATIN CAPITAL LETTER J
    0x004b: 0x004b,     #  LATIN CAPITAL LETTER K
    0x004c: 0x004c,     #  LATIN CAPITAL LETTER L
    0x004d: 0x004d,     #  LATIN CAPITAL LETTER M
    0x004e: 0x004e,     #  LATIN CAPITAL LETTER N
    0x004f: 0x004f,     #  LATIN CAPITAL LETTER O
    0x0050: 0x0050,     #  LATIN CAPITAL LETTER P
    0x0051: 0x0051,     #  LATIN CAPITAL LETTER Q
    0x0052: 0x0052,     #  LATIN CAPITAL LETTER R
    0x0053: 0x0053,     #  LATIN CAPITAL LETTER S
    0x0054: 0x0054,     #  LATIN CAPITAL LETTER T
    0x0055: 0x0055,     #  LATIN CAPITAL LETTER U
    0x0056: 0x0056,     #  LATIN CAPITAL LETTER V
    0x0057: 0x0057,     #  LATIN CAPITAL LETTER W
    0x0058: 0x0058,     #  LATIN CAPITAL LETTER X
    0x0059: 0x0059,     #  LATIN CAPITAL LETTER Y
    0x005a: 0x005a,     #  LATIN CAPITAL LETTER Z
    0x005b: 0x005b,     #  LEFT SQUARE BRACKET
    0x005c: 0x005c,     #  REVERSE SOLIDUS
    0x005d: 0x005d,     #  RIGHT SQUARE BRACKET
    0x005e: 0x005e,     #  CIRCUMFLEX ACCENT
    0x005f: 0x005f,     #  LOW LINE
    0x0060: 0x0060,     #  GRAVE ACCENT
    0x0061: 0x0061,     #  LATIN SMALL LETTER A
    0x0062: 0x0062,     #  LATIN SMALL LETTER B
    0x0063: 0x0063,     #  LATIN SMALL LETTER C
    0x0064: 0x0064,     #  LATIN SMALL LETTER D
    0x0065: 0x0065,     #  LATIN SMALL LETTER E
    0x0066: 0x0066,     #  LATIN SMALL LETTER F
    0x0067: 0x0067,     #  LATIN SMALL LETTER G
    0x0068: 0x0068,     #  LATIN SMALL LETTER H
    0x0069: 0x0069,     #  LATIN SMALL LETTER I
    0x006a: 0x006a,     #  LATIN SMALL LETTER J
    0x006b: 0x006b,     #  LATIN SMALL LETTER K
    0x006c: 0x006c,     #  LATIN SMALL LETTER L
    0x006d: 0x006d,     #  LATIN SMALL LETTER M
    0x006e: 0x006e,     #  LATIN SMALL LETTER N
    0x006f: 0x006f,     #  LATIN SMALL LETTER O
    0x0070: 0x0070,     #  LATIN SMALL LETTER P
    0x0071: 0x0071,     #  LATIN SMALL LETTER Q
    0x0072: 0x0072,     #  LATIN SMALL LETTER R
    0x0073: 0x0073,     #  LATIN SMALL LETTER S
    0x0074: 0x0074,     #  LATIN SMALL LETTER T
    0x0075: 0x0075,     #  LATIN SMALL LETTER U
    0x0076: 0x0076,     #  LATIN SMALL LETTER V
    0x0077: 0x0077,     #  LATIN SMALL LETTER W
    0x0078: 0x0078,     #  LATIN SMALL LETTER X
    0x0079: 0x0079,     #  LATIN SMALL LETTER Y
    0x007a: 0x007a,     #  LATIN SMALL LETTER Z
    0x007b: 0x007b,     #  LEFT CURLY BRACKET
    0x007c: 0x007c,     #  VERTICAL LINE
    0x007d: 0x007d,     #  RIGHT CURLY BRACKET
    0x007e: 0x007e,     #  TILDE
    0x007f: 0x007f,     #  DELETE
    0x00a0: 0x00a0,     #  NON-BREAKING SPACE
    0x00a2: 0x00c0,     #  CENT SIGN
    0x00a3: 0x00a3,     #  POUND SIGN
    0x00a4: 0x00a4,     #  CURRENCY SIGN
    0x00a6: 0x00db,     #  BROKEN VERTICAL BAR
    0x00ab: 0x0097,     #  LEFT POINTING GUILLEMET
    0x00ac: 0x00dc,     #  NOT SIGN
    0x00ad: 0x00a1,     #  SOFT HYPHEN
    0x00b0: 0x0080,     #  DEGREE SIGN
    0x00b1: 0x0093,     #  PLUS-OR-MINUS SIGN
    0x00b7: 0x0081,     #  MIDDLE DOT
    0x00bb: 0x0098,     #  RIGHT POINTING GUILLEMET
    0x00bc: 0x0095,     #  FRACTION 1/4
    0x00bd: 0x0094,     #  FRACTION 1/2
    0x00d7: 0x00de,     #  MULTIPLICATION SIGN
    0x00f7: 0x00dd,     #  DIVISION SIGN
    0x03b2: 0x0090,     #  GREEK SMALL BETA
    0x03c6: 0x0092,     #  GREEK SMALL PHI
    0x060c: 0x00ac,     #  ARABIC COMMA
    0x061b: 0x00bb,     #  ARABIC SEMICOLON
    0x061f: 0x00bf,     #  ARABIC QUESTION MARK
    0x0640: 0x00e0,     #  ARABIC TATWEEL
    0x0651: 0x00f1,     #  ARABIC SHADDAH
    0x0660: 0x00b0,     #  ARABIC-INDIC DIGIT ZERO
    0x0661: 0x00b1,     #  ARABIC-INDIC DIGIT ONE
    0x0662: 0x00b2,     #  ARABIC-INDIC DIGIT TWO
    0x0663: 0x00b3,     #  ARABIC-INDIC DIGIT THREE
    0x0664: 0x00b4,     #  ARABIC-INDIC DIGIT FOUR
    0x0665: 0x00b5,     #  ARABIC-INDIC DIGIT FIVE
    0x0666: 0x00b6,     #  ARABIC-INDIC DIGIT SIX
    0x0667: 0x00b7,     #  ARABIC-INDIC DIGIT SEVEN
    0x0668: 0x00b8,     #  ARABIC-INDIC DIGIT EIGHT
    0x0669: 0x00b9,     #  ARABIC-INDIC DIGIT NINE
    0x066a: 0x0025,     #  ARABIC PERCENT SIGN
    0x2219: 0x0082,     #  BULLET OPERATOR
    0x221a: 0x0083,     #  SQUARE ROOT
    0x221e: 0x0091,     #  INFINITY
    0x2248: 0x0096,     #  ALMOST EQUAL TO
    0x2500: 0x0085,     #  FORMS LIGHT HORIZONTAL
    0x2502: 0x0086,     #  FORMS LIGHT VERTICAL
    0x250c: 0x008d,     #  FORMS LIGHT DOWN AND RIGHT
    0x2510: 0x008c,     #  FORMS LIGHT DOWN AND LEFT
    0x2514: 0x008e,     #  FORMS LIGHT UP AND RIGHT
    0x2518: 0x008f,     #  FORMS LIGHT UP AND LEFT
    0x251c: 0x008a,     #  FORMS LIGHT VERTICAL AND RIGHT
    0x2524: 0x0088,     #  FORMS LIGHT VERTICAL AND LEFT
    0x252c: 0x0089,     #  FORMS LIGHT DOWN AND HORIZONTAL
    0x2534: 0x008b,     #  FORMS LIGHT UP AND HORIZONTAL
    0x253c: 0x0087,     #  FORMS LIGHT VERTICAL AND HORIZONTAL
    0x2592: 0x0084,     #  MEDIUM SHADE
    0x25a0: 0x00fe,     #  BLACK SQUARE
    0xfe7d: 0x00f0,     #  ARABIC SHADDA MEDIAL FORM
    0xfe80: 0x00c1,     #  ARABIC LETTER HAMZA ISOLATED FORM
    0xfe81: 0x00c2,     #  ARABIC LETTER ALEF WITH MADDA ABOVE ISOLATED FORM
    0xfe82: 0x00a2,     #  ARABIC LETTER ALEF WITH MADDA ABOVE FINAL FORM
    0xfe83: 0x00c3,     #  ARABIC LETTER ALEF WITH HAMZA ABOVE ISOLATED FORM
    0xfe84: 0x00a5,     #  ARABIC LETTER ALEF WITH HAMZA ABOVE FINAL FORM
    0xfe85: 0x00c4,     #  ARABIC LETTER WAW WITH HAMZA ABOVE ISOLATED FORM
    0xfe8b: 0x00c6,     #  ARABIC LETTER YEH WITH HAMZA ABOVE INITIAL FORM
    0xfe8d: 0x00c7,     #  ARABIC LETTER ALEF ISOLATED FORM
    0xfe8e: 0x00a8,     #  ARABIC LETTER ALEF FINAL FORM
    0xfe8f: 0x00a9,     #  ARABIC LETTER BEH ISOLATED FORM
    0xfe91: 0x00c8,     #  ARABIC LETTER BEH INITIAL FORM
    0xfe93: 0x00c9,     #  ARABIC LETTER TEH MARBUTA ISOLATED FORM
    0xfe95: 0x00aa,     #  ARABIC LETTER TEH ISOLATED FORM
    0xfe97: 0x00ca,     #  ARABIC LETTER TEH INITIAL FORM
    0xfe99: 0x00ab,     #  ARABIC LETTER THEH ISOLATED FORM
    0xfe9b: 0x00cb,     #  ARABIC LETTER THEH INITIAL FORM
    0xfe9d: 0x00ad,     #  ARABIC LETTER JEEM ISOLATED FORM
    0xfe9f: 0x00cc,     #  ARABIC LETTER JEEM INITIAL FORM
    0xfea1: 0x00ae,     #  ARABIC LETTER HAH ISOLATED FORM
    0xfea3: 0x00cd,     #  ARABIC LETTER HAH INITIAL FORM
    0xfea5: 0x00af,     #  ARABIC LETTER KHAH ISOLATED FORM
    0xfea7: 0x00ce,     #  ARABIC LETTER KHAH INITIAL FORM
    0xfea9: 0x00cf,     #  ARABIC LETTER DAL ISOLATED FORM
    0xfeab: 0x00d0,     #  ARABIC LETTER THAL ISOLATED FORM
    0xfead: 0x00d1,     #  ARABIC LETTER REH ISOLATED FORM
    0xfeaf: 0x00d2,     #  ARABIC LETTER ZAIN ISOLATED FORM
    0xfeb1: 0x00bc,     #  ARABIC LETTER SEEN ISOLATED FORM
    0xfeb3: 0x00d3,     #  ARABIC LETTER SEEN INITIAL FORM
    0xfeb5: 0x00bd,     #  ARABIC LETTER SHEEN ISOLATED FORM
    0xfeb7: 0x00d4,     #  ARABIC LETTER SHEEN INITIAL FORM
    0xfeb9: 0x00be,     #  ARABIC LETTER SAD ISOLATED FORM
    0xfebb: 0x00d5,     #  ARABIC LETTER SAD INITIAL FORM
    0xfebd: 0x00eb,     #  ARABIC LETTER DAD ISOLATED FORM
    0xfebf: 0x00d6,     #  ARABIC LETTER DAD INITIAL FORM
    0xfec1: 0x00d7,     #  ARABIC LETTER TAH ISOLATED FORM
    0xfec5: 0x00d8,     #  ARABIC LETTER ZAH ISOLATED FORM
    0xfec9: 0x00df,     #  ARABIC LETTER AIN ISOLATED FORM
    0xfeca: 0x00c5,     #  ARABIC LETTER AIN FINAL FORM
    0xfecb: 0x00d9,     #  ARABIC LETTER AIN INITIAL FORM
    0xfecc: 0x00ec,     #  ARABIC LETTER AIN MEDIAL FORM
    0xfecd: 0x00ee,     #  ARABIC LETTER GHAIN ISOLATED FORM
    0xfece: 0x00ed,     #  ARABIC LETTER GHAIN FINAL FORM
    0xfecf: 0x00da,     #  ARABIC LETTER GHAIN INITIAL FORM
    0xfed0: 0x00f7,     #  ARABIC LETTER GHAIN MEDIAL FORM
    0xfed1: 0x00ba,     #  ARABIC LETTER FEH ISOLATED FORM
    0xfed3: 0x00e1,     #  ARABIC LETTER FEH INITIAL FORM
    0xfed5: 0x00f8,     #  ARABIC LETTER QAF ISOLATED FORM
    0xfed7: 0x00e2,     #  ARABIC LETTER QAF INITIAL FORM
    0xfed9: 0x00fc,     #  ARABIC LETTER KAF ISOLATED FORM
    0xfedb: 0x00e3,     #  ARABIC LETTER KAF INITIAL FORM
    0xfedd: 0x00fb,     #  ARABIC LETTER LAM ISOLATED FORM
    0xfedf: 0x00e4,     #  ARABIC LETTER LAM INITIAL FORM
    0xfee1: 0x00ef,     #  ARABIC LETTER MEEM ISOLATED FORM
    0xfee3: 0x00e5,     #  ARABIC LETTER MEEM INITIAL FORM
    0xfee5: 0x00f2,     #  ARABIC LETTER NOON ISOLATED FORM
    0xfee7: 0x00e6,     #  ARABIC LETTER NOON INITIAL FORM
    0xfee9: 0x00f3,     #  ARABIC LETTER HEH ISOLATED FORM
    0xfeeb: 0x00e7,     #  ARABIC LETTER HEH INITIAL FORM
    0xfeec: 0x00f4,     #  ARABIC LETTER HEH MEDIAL FORM
    0xfeed: 0x00e8,     #  ARABIC LETTER WAW ISOLATED FORM
    0xfeef: 0x00e9,     #  ARABIC LETTER ALEF MAKSURA ISOLATED FORM
    0xfef0: 0x00f5,     #  ARABIC LETTER ALEF MAKSURA FINAL FORM
    0xfef1: 0x00fd,     #  ARABIC LETTER YEH ISOLATED FORM
    0xfef2: 0x00f6,     #  ARABIC LETTER YEH FINAL FORM
    0xfef3: 0x00ea,     #  ARABIC LETTER YEH INITIAL FORM
    0xfef5: 0x00f9,     #  ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE ISOLATED FORM
    0xfef6: 0x00fa,     #  ARABIC LIGATURE LAM WITH ALEF WITH MADDA ABOVE FINAL FORM
    0xfef7: 0x0099,     #  ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE ISOLATED FORM
    0xfef8: 0x009a,     #  ARABIC LIGATURE LAM WITH ALEF WITH HAMZA ABOVE FINAL FORM
    0xfefb: 0x009d,     #  ARABIC LIGATURE LAM WITH ALEF ISOLATED FORM
    0xfefc: 0x009e,     #  ARABIC LIGATURE LAM WITH ALEF FINAL FORM
}
encodings/gbk.py000064400000001767151153537630007656 0ustar00#
# gbk.py: Python Unicode Codec for GBK
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#

import _codecs_cn, codecs
import _multibytecodec as mbc

codec = _codecs_cn.getcodec('gbk')

class Codec(codecs.Codec):
    encode = codec.encode
    decode = codec.decode

class IncrementalEncoder(mbc.MultibyteIncrementalEncoder,
                         codecs.IncrementalEncoder):
    codec = codec

class IncrementalDecoder(mbc.MultibyteIncrementalDecoder,
                         codecs.IncrementalDecoder):
    codec = codec

class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader):
    codec = codec

class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
    codec = codec

def getregentry():
    return codecs.CodecInfo(
        name='gbk',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/cp857.py000064400000102164151153537630007752 0ustar00""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP857.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_map)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_map)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp857',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )

### Decoding Map

decoding_map = codecs.make_identity_dict(range(256))
decoding_map.update({
    0x0080: 0x00c7,     #  LATIN CAPITAL LETTER C WITH CEDILLA
    0x0081: 0x00fc,     #  LATIN SMALL LETTER U WITH DIAERESIS
    0x0082: 0x00e9,     #  LATIN SMALL LETTER E WITH ACUTE
    0x0083: 0x00e2,     #  LATIN SMALL LETTER A WITH CIRCUMFLEX
    0x0084: 0x00e4,     #  LATIN SMALL LETTER A WITH DIAERESIS
    0x0085: 0x00e0,     #  LATIN SMALL LETTER A WITH GRAVE
    0x0086: 0x00e5,     #  LATIN SMALL LETTER A WITH RING ABOVE
    0x0087: 0x00e7,     #  LATIN SMALL LETTER C WITH CEDILLA
    0x0088: 0x00ea,     #  LATIN SMALL LETTER E WITH CIRCUMFLEX
    0x0089: 0x00eb,     #  LATIN SMALL LETTER E WITH DIAERESIS
    0x008a: 0x00e8,     #  LATIN SMALL LETTER E WITH GRAVE
    0x008b: 0x00ef,     #  LATIN SMALL LETTER I WITH DIAERESIS
    0x008c: 0x00ee,     #  LATIN SMALL LETTER I WITH CIRCUMFLEX
    0x008d: 0x0131,     #  LATIN SMALL LETTER DOTLESS I
    0x008e: 0x00c4,     #  LATIN CAPITAL LETTER A WITH DIAERESIS
    0x008f: 0x00c5,     #  LATIN CAPITAL LETTER A WITH RING ABOVE
    0x0090: 0x00c9,     #  LATIN CAPITAL LETTER E WITH ACUTE
    0x0091: 0x00e6,     #  LATIN SMALL LIGATURE AE
    0x0092: 0x00c6,     #  LATIN CAPITAL LIGATURE AE
    0x0093: 0x00f4,     #  LATIN SMALL LETTER O WITH CIRCUMFLEX
    0x0094: 0x00f6,     #  LATIN SMALL LETTER O WITH DIAERESIS
    0x0095: 0x00f2,     #  LATIN SMALL LETTER O WITH GRAVE
    0x0096: 0x00fb,     #  LATIN SMALL LETTER U WITH CIRCUMFLEX
    0x0097: 0x00f9,     #  LATIN SMALL LETTER U WITH GRAVE
    0x0098: 0x0130,     #  LATIN CAPITAL LETTER I WITH DOT ABOVE
    0x0099: 0x00d6,     #  LATIN CAPITAL LETTER O WITH DIAERESIS
    0x009a: 0x00dc,     #  LATIN CAPITAL LETTER U WITH DIAERESIS
    0x009b: 0x00f8,     #  LATIN SMALL LETTER O WITH STROKE
    0x009c: 0x00a3,     #  POUND SIGN
    0x009d: 0x00d8,     #  LATIN CAPITAL LETTER O WITH STROKE
    0x009e: 0x015e,     #  LATIN CAPITAL LETTER S WITH CEDILLA
    0x009f: 0x015f,     #  LATIN SMALL LETTER S WITH CEDILLA
    0x00a0: 0x00e1,     #  LATIN SMALL LETTER A WITH ACUTE
    0x00a1: 0x00ed,     #  LATIN SMALL LETTER I WITH ACUTE
    0x00a2: 0x00f3,     #  LATIN SMALL LETTER O WITH ACUTE
    0x00a3: 0x00fa,     #  LATIN SMALL LETTER U WITH ACUTE
    0x00a4: 0x00f1,     #  LATIN SMALL LETTER N WITH TILDE
    0x00a5: 0x00d1,     #  LATIN CAPITAL LETTER N WITH TILDE
    0x00a6: 0x011e,     #  LATIN CAPITAL LETTER G WITH BREVE
    0x00a7: 0x011f,     #  LATIN SMALL LETTER G WITH BREVE
    0x00a8: 0x00bf,     #  INVERTED QUESTION MARK
    0x00a9: 0x00ae,     #  REGISTERED SIGN
    0x00aa: 0x00ac,     #  NOT SIGN
    0x00ab: 0x00bd,     #  VULGAR FRACTION ONE HALF
    0x00ac: 0x00bc,     #  VULGAR FRACTION ONE QUARTER
    0x00ad: 0x00a1,     #  INVERTED EXCLAMATION MARK
    0x00ae: 0x00ab,     #  LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00af: 0x00bb,     #  RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00b0: 0x2591,     #  LIGHT SHADE
    0x00b1: 0x2592,     #  MEDIUM SHADE
    0x00b2: 0x2593,     #  DARK SHADE
    0x00b3: 0x2502,     #  BOX DRAWINGS LIGHT VERTICAL
    0x00b4: 0x2524,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
    0x00b5: 0x00c1,     #  LATIN CAPITAL LETTER A WITH ACUTE
    0x00b6: 0x00c2,     #  LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    0x00b7: 0x00c0,     #  LATIN CAPITAL LETTER A WITH GRAVE
    0x00b8: 0x00a9,     #  COPYRIGHT SIGN
    0x00b9: 0x2563,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    0x00ba: 0x2551,     #  BOX DRAWINGS DOUBLE VERTICAL
    0x00bb: 0x2557,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
    0x00bc: 0x255d,     #  BOX DRAWINGS DOUBLE UP AND LEFT
    0x00bd: 0x00a2,     #  CENT SIGN
    0x00be: 0x00a5,     #  YEN SIGN
    0x00bf: 0x2510,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
    0x00c0: 0x2514,     #  BOX DRAWINGS LIGHT UP AND RIGHT
    0x00c1: 0x2534,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
    0x00c2: 0x252c,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    0x00c3: 0x251c,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    0x00c4: 0x2500,     #  BOX DRAWINGS LIGHT HORIZONTAL
    0x00c5: 0x253c,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    0x00c6: 0x00e3,     #  LATIN SMALL LETTER A WITH TILDE
    0x00c7: 0x00c3,     #  LATIN CAPITAL LETTER A WITH TILDE
    0x00c8: 0x255a,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
    0x00c9: 0x2554,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
    0x00ca: 0x2569,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    0x00cb: 0x2566,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    0x00cc: 0x2560,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    0x00cd: 0x2550,     #  BOX DRAWINGS DOUBLE HORIZONTAL
    0x00ce: 0x256c,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    0x00cf: 0x00a4,     #  CURRENCY SIGN
    0x00d0: 0x00ba,     #  MASCULINE ORDINAL INDICATOR
    0x00d1: 0x00aa,     #  FEMININE ORDINAL INDICATOR
    0x00d2: 0x00ca,     #  LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    0x00d3: 0x00cb,     #  LATIN CAPITAL LETTER E WITH DIAERESIS
    0x00d4: 0x00c8,     #  LATIN CAPITAL LETTER E WITH GRAVE
    0x00d5: None,       #  UNDEFINED
    0x00d6: 0x00cd,     #  LATIN CAPITAL LETTER I WITH ACUTE
    0x00d7: 0x00ce,     #  LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    0x00d8: 0x00cf,     #  LATIN CAPITAL LETTER I WITH DIAERESIS
    0x00d9: 0x2518,     #  BOX DRAWINGS LIGHT UP AND LEFT
    0x00da: 0x250c,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
    0x00db: 0x2588,     #  FULL BLOCK
    0x00dc: 0x2584,     #  LOWER HALF BLOCK
    0x00dd: 0x00a6,     #  BROKEN BAR
    0x00de: 0x00cc,     #  LATIN CAPITAL LETTER I WITH GRAVE
    0x00df: 0x2580,     #  UPPER HALF BLOCK
    0x00e0: 0x00d3,     #  LATIN CAPITAL LETTER O WITH ACUTE
    0x00e1: 0x00df,     #  LATIN SMALL LETTER SHARP S
    0x00e2: 0x00d4,     #  LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    0x00e3: 0x00d2,     #  LATIN CAPITAL LETTER O WITH GRAVE
    0x00e4: 0x00f5,     #  LATIN SMALL LETTER O WITH TILDE
    0x00e5: 0x00d5,     #  LATIN CAPITAL LETTER O WITH TILDE
    0x00e6: 0x00b5,     #  MICRO SIGN
    0x00e7: None,       #  UNDEFINED
    0x00e8: 0x00d7,     #  MULTIPLICATION SIGN
    0x00e9: 0x00da,     #  LATIN CAPITAL LETTER U WITH ACUTE
    0x00ea: 0x00db,     #  LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    0x00eb: 0x00d9,     #  LATIN CAPITAL LETTER U WITH GRAVE
    0x00ed: 0x00ff,     #  LATIN SMALL LETTER Y WITH DIAERESIS
    0x00ee: 0x00af,     #  MACRON
    0x00ef: 0x00b4,     #  ACUTE ACCENT
    0x00f0: 0x00ad,     #  SOFT HYPHEN
    0x00f1: 0x00b1,     #  PLUS-MINUS SIGN
    0x00f2: None,       #  UNDEFINED
    0x00f3: 0x00be,     #  VULGAR FRACTION THREE QUARTERS
    0x00f4: 0x00b6,     #  PILCROW SIGN
    0x00f5: 0x00a7,     #  SECTION SIGN
    0x00f6: 0x00f7,     #  DIVISION SIGN
    0x00f7: 0x00b8,     #  CEDILLA
    0x00f8: 0x00b0,     #  DEGREE SIGN
    0x00f9: 0x00a8,     #  DIAERESIS
    0x00fa: 0x00b7,     #  MIDDLE DOT
    0x00fb: 0x00b9,     #  SUPERSCRIPT ONE
    0x00fc: 0x00b3,     #  SUPERSCRIPT THREE
    0x00fd: 0x00b2,     #  SUPERSCRIPT TWO
    0x00fe: 0x25a0,     #  BLACK SQUARE
    0x00ff: 0x00a0,     #  NO-BREAK SPACE
})

### Decoding Table

decoding_table = (
    '\x00'     #  0x0000 -> NULL
    '\x01'     #  0x0001 -> START OF HEADING
    '\x02'     #  0x0002 -> START OF TEXT
    '\x03'     #  0x0003 -> END OF TEXT
    '\x04'     #  0x0004 -> END OF TRANSMISSION
    '\x05'     #  0x0005 -> ENQUIRY
    '\x06'     #  0x0006 -> ACKNOWLEDGE
    '\x07'     #  0x0007 -> BELL
    '\x08'     #  0x0008 -> BACKSPACE
    '\t'       #  0x0009 -> HORIZONTAL TABULATION
    '\n'       #  0x000a -> LINE FEED
    '\x0b'     #  0x000b -> VERTICAL TABULATION
    '\x0c'     #  0x000c -> FORM FEED
    '\r'       #  0x000d -> CARRIAGE RETURN
    '\x0e'     #  0x000e -> SHIFT OUT
    '\x0f'     #  0x000f -> SHIFT IN
    '\x10'     #  0x0010 -> DATA LINK ESCAPE
    '\x11'     #  0x0011 -> DEVICE CONTROL ONE
    '\x12'     #  0x0012 -> DEVICE CONTROL TWO
    '\x13'     #  0x0013 -> DEVICE CONTROL THREE
    '\x14'     #  0x0014 -> DEVICE CONTROL FOUR
    '\x15'     #  0x0015 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x0016 -> SYNCHRONOUS IDLE
    '\x17'     #  0x0017 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x0018 -> CANCEL
    '\x19'     #  0x0019 -> END OF MEDIUM
    '\x1a'     #  0x001a -> SUBSTITUTE
    '\x1b'     #  0x001b -> ESCAPE
    '\x1c'     #  0x001c -> FILE SEPARATOR
    '\x1d'     #  0x001d -> GROUP SEPARATOR
    '\x1e'     #  0x001e -> RECORD SEPARATOR
    '\x1f'     #  0x001f -> UNIT SEPARATOR
    ' '        #  0x0020 -> SPACE
    '!'        #  0x0021 -> EXCLAMATION MARK
    '"'        #  0x0022 -> QUOTATION MARK
    '#'        #  0x0023 -> NUMBER SIGN
    '$'        #  0x0024 -> DOLLAR SIGN
    '%'        #  0x0025 -> PERCENT SIGN
    '&'        #  0x0026 -> AMPERSAND
    "'"        #  0x0027 -> APOSTROPHE
    '('        #  0x0028 -> LEFT PARENTHESIS
    ')'        #  0x0029 -> RIGHT PARENTHESIS
    '*'        #  0x002a -> ASTERISK
    '+'        #  0x002b -> PLUS SIGN
    ','        #  0x002c -> COMMA
    '-'        #  0x002d -> HYPHEN-MINUS
    '.'        #  0x002e -> FULL STOP
    '/'        #  0x002f -> SOLIDUS
    '0'        #  0x0030 -> DIGIT ZERO
    '1'        #  0x0031 -> DIGIT ONE
    '2'        #  0x0032 -> DIGIT TWO
    '3'        #  0x0033 -> DIGIT THREE
    '4'        #  0x0034 -> DIGIT FOUR
    '5'        #  0x0035 -> DIGIT FIVE
    '6'        #  0x0036 -> DIGIT SIX
    '7'        #  0x0037 -> DIGIT SEVEN
    '8'        #  0x0038 -> DIGIT EIGHT
    '9'        #  0x0039 -> DIGIT NINE
    ':'        #  0x003a -> COLON
    ';'        #  0x003b -> SEMICOLON
    '<'        #  0x003c -> LESS-THAN SIGN
    '='        #  0x003d -> EQUALS SIGN
    '>'        #  0x003e -> GREATER-THAN SIGN
    '?'        #  0x003f -> QUESTION MARK
    '@'        #  0x0040 -> COMMERCIAL AT
    'A'        #  0x0041 -> LATIN CAPITAL LETTER A
    'B'        #  0x0042 -> LATIN CAPITAL LETTER B
    'C'        #  0x0043 -> LATIN CAPITAL LETTER C
    'D'        #  0x0044 -> LATIN CAPITAL LETTER D
    'E'        #  0x0045 -> LATIN CAPITAL LETTER E
    'F'        #  0x0046 -> LATIN CAPITAL LETTER F
    'G'        #  0x0047 -> LATIN CAPITAL LETTER G
    'H'        #  0x0048 -> LATIN CAPITAL LETTER H
    'I'        #  0x0049 -> LATIN CAPITAL LETTER I
    'J'        #  0x004a -> LATIN CAPITAL LETTER J
    'K'        #  0x004b -> LATIN CAPITAL LETTER K
    'L'        #  0x004c -> LATIN CAPITAL LETTER L
    'M'        #  0x004d -> LATIN CAPITAL LETTER M
    'N'        #  0x004e -> LATIN CAPITAL LETTER N
    'O'        #  0x004f -> LATIN CAPITAL LETTER O
    'P'        #  0x0050 -> LATIN CAPITAL LETTER P
    'Q'        #  0x0051 -> LATIN CAPITAL LETTER Q
    'R'        #  0x0052 -> LATIN CAPITAL LETTER R
    'S'        #  0x0053 -> LATIN CAPITAL LETTER S
    'T'        #  0x0054 -> LATIN CAPITAL LETTER T
    'U'        #  0x0055 -> LATIN CAPITAL LETTER U
    'V'        #  0x0056 -> LATIN CAPITAL LETTER V
    'W'        #  0x0057 -> LATIN CAPITAL LETTER W
    'X'        #  0x0058 -> LATIN CAPITAL LETTER X
    'Y'        #  0x0059 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x005a -> LATIN CAPITAL LETTER Z
    '['        #  0x005b -> LEFT SQUARE BRACKET
    '\\'       #  0x005c -> REVERSE SOLIDUS
    ']'        #  0x005d -> RIGHT SQUARE BRACKET
    '^'        #  0x005e -> CIRCUMFLEX ACCENT
    '_'        #  0x005f -> LOW LINE
    '`'        #  0x0060 -> GRAVE ACCENT
    'a'        #  0x0061 -> LATIN SMALL LETTER A
    'b'        #  0x0062 -> LATIN SMALL LETTER B
    'c'        #  0x0063 -> LATIN SMALL LETTER C
    'd'        #  0x0064 -> LATIN SMALL LETTER D
    'e'        #  0x0065 -> LATIN SMALL LETTER E
    'f'        #  0x0066 -> LATIN SMALL LETTER F
    'g'        #  0x0067 -> LATIN SMALL LETTER G
    'h'        #  0x0068 -> LATIN SMALL LETTER H
    'i'        #  0x0069 -> LATIN SMALL LETTER I
    'j'        #  0x006a -> LATIN SMALL LETTER J
    'k'        #  0x006b -> LATIN SMALL LETTER K
    'l'        #  0x006c -> LATIN SMALL LETTER L
    'm'        #  0x006d -> LATIN SMALL LETTER M
    'n'        #  0x006e -> LATIN SMALL LETTER N
    'o'        #  0x006f -> LATIN SMALL LETTER O
    'p'        #  0x0070 -> LATIN SMALL LETTER P
    'q'        #  0x0071 -> LATIN SMALL LETTER Q
    'r'        #  0x0072 -> LATIN SMALL LETTER R
    's'        #  0x0073 -> LATIN SMALL LETTER S
    't'        #  0x0074 -> LATIN SMALL LETTER T
    'u'        #  0x0075 -> LATIN SMALL LETTER U
    'v'        #  0x0076 -> LATIN SMALL LETTER V
    'w'        #  0x0077 -> LATIN SMALL LETTER W
    'x'        #  0x0078 -> LATIN SMALL LETTER X
    'y'        #  0x0079 -> LATIN SMALL LETTER Y
    'z'        #  0x007a -> LATIN SMALL LETTER Z
    '{'        #  0x007b -> LEFT CURLY BRACKET
    '|'        #  0x007c -> VERTICAL LINE
    '}'        #  0x007d -> RIGHT CURLY BRACKET
    '~'        #  0x007e -> TILDE
    '\x7f'     #  0x007f -> DELETE
    '\xc7'     #  0x0080 -> LATIN CAPITAL LETTER C WITH CEDILLA
    '\xfc'     #  0x0081 -> LATIN SMALL LETTER U WITH DIAERESIS
    '\xe9'     #  0x0082 -> LATIN SMALL LETTER E WITH ACUTE
    '\xe2'     #  0x0083 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\xe4'     #  0x0084 -> LATIN SMALL LETTER A WITH DIAERESIS
    '\xe0'     #  0x0085 -> LATIN SMALL LETTER A WITH GRAVE
    '\xe5'     #  0x0086 -> LATIN SMALL LETTER A WITH RING ABOVE
    '\xe7'     #  0x0087 -> LATIN SMALL LETTER C WITH CEDILLA
    '\xea'     #  0x0088 -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xeb'     #  0x0089 -> LATIN SMALL LETTER E WITH DIAERESIS
    '\xe8'     #  0x008a -> LATIN SMALL LETTER E WITH GRAVE
    '\xef'     #  0x008b -> LATIN SMALL LETTER I WITH DIAERESIS
    '\xee'     #  0x008c -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\u0131'   #  0x008d -> LATIN SMALL LETTER DOTLESS I
    '\xc4'     #  0x008e -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\xc5'     #  0x008f -> LATIN CAPITAL LETTER A WITH RING ABOVE
    '\xc9'     #  0x0090 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\xe6'     #  0x0091 -> LATIN SMALL LIGATURE AE
    '\xc6'     #  0x0092 -> LATIN CAPITAL LIGATURE AE
    '\xf4'     #  0x0093 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xf6'     #  0x0094 -> LATIN SMALL LETTER O WITH DIAERESIS
    '\xf2'     #  0x0095 -> LATIN SMALL LETTER O WITH GRAVE
    '\xfb'     #  0x0096 -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\xf9'     #  0x0097 -> LATIN SMALL LETTER U WITH GRAVE
    '\u0130'   #  0x0098 -> LATIN CAPITAL LETTER I WITH DOT ABOVE
    '\xd6'     #  0x0099 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xdc'     #  0x009a -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\xf8'     #  0x009b -> LATIN SMALL LETTER O WITH STROKE
    '\xa3'     #  0x009c -> POUND SIGN
    '\xd8'     #  0x009d -> LATIN CAPITAL LETTER O WITH STROKE
    '\u015e'   #  0x009e -> LATIN CAPITAL LETTER S WITH CEDILLA
    '\u015f'   #  0x009f -> LATIN SMALL LETTER S WITH CEDILLA
    '\xe1'     #  0x00a0 -> LATIN SMALL LETTER A WITH ACUTE
    '\xed'     #  0x00a1 -> LATIN SMALL LETTER I WITH ACUTE
    '\xf3'     #  0x00a2 -> LATIN SMALL LETTER O WITH ACUTE
    '\xfa'     #  0x00a3 -> LATIN SMALL LETTER U WITH ACUTE
    '\xf1'     #  0x00a4 -> LATIN SMALL LETTER N WITH TILDE
    '\xd1'     #  0x00a5 -> LATIN CAPITAL LETTER N WITH TILDE
    '\u011e'   #  0x00a6 -> LATIN CAPITAL LETTER G WITH BREVE
    '\u011f'   #  0x00a7 -> LATIN SMALL LETTER G WITH BREVE
    '\xbf'     #  0x00a8 -> INVERTED QUESTION MARK
    '\xae'     #  0x00a9 -> REGISTERED SIGN
    '\xac'     #  0x00aa -> NOT SIGN
    '\xbd'     #  0x00ab -> VULGAR FRACTION ONE HALF
    '\xbc'     #  0x00ac -> VULGAR FRACTION ONE QUARTER
    '\xa1'     #  0x00ad -> INVERTED EXCLAMATION MARK
    '\xab'     #  0x00ae -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbb'     #  0x00af -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u2591'   #  0x00b0 -> LIGHT SHADE
    '\u2592'   #  0x00b1 -> MEDIUM SHADE
    '\u2593'   #  0x00b2 -> DARK SHADE
    '\u2502'   #  0x00b3 -> BOX DRAWINGS LIGHT VERTICAL
    '\u2524'   #  0x00b4 -> BOX DRAWINGS LIGHT VERTICAL AND LEFT
    '\xc1'     #  0x00b5 -> LATIN CAPITAL LETTER A WITH ACUTE
    '\xc2'     #  0x00b6 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    '\xc0'     #  0x00b7 -> LATIN CAPITAL LETTER A WITH GRAVE
    '\xa9'     #  0x00b8 -> COPYRIGHT SIGN
    '\u2563'   #  0x00b9 -> BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    '\u2551'   #  0x00ba -> BOX DRAWINGS DOUBLE VERTICAL
    '\u2557'   #  0x00bb -> BOX DRAWINGS DOUBLE DOWN AND LEFT
    '\u255d'   #  0x00bc -> BOX DRAWINGS DOUBLE UP AND LEFT
    '\xa2'     #  0x00bd -> CENT SIGN
    '\xa5'     #  0x00be -> YEN SIGN
    '\u2510'   #  0x00bf -> BOX DRAWINGS LIGHT DOWN AND LEFT
    '\u2514'   #  0x00c0 -> BOX DRAWINGS LIGHT UP AND RIGHT
    '\u2534'   #  0x00c1 -> BOX DRAWINGS LIGHT UP AND HORIZONTAL
    '\u252c'   #  0x00c2 -> BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    '\u251c'   #  0x00c3 -> BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    '\u2500'   #  0x00c4 -> BOX DRAWINGS LIGHT HORIZONTAL
    '\u253c'   #  0x00c5 -> BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    '\xe3'     #  0x00c6 -> LATIN SMALL LETTER A WITH TILDE
    '\xc3'     #  0x00c7 -> LATIN CAPITAL LETTER A WITH TILDE
    '\u255a'   #  0x00c8 -> BOX DRAWINGS DOUBLE UP AND RIGHT
    '\u2554'   #  0x00c9 -> BOX DRAWINGS DOUBLE DOWN AND RIGHT
    '\u2569'   #  0x00ca -> BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    '\u2566'   #  0x00cb -> BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    '\u2560'   #  0x00cc -> BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    '\u2550'   #  0x00cd -> BOX DRAWINGS DOUBLE HORIZONTAL
    '\u256c'   #  0x00ce -> BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    '\xa4'     #  0x00cf -> CURRENCY SIGN
    '\xba'     #  0x00d0 -> MASCULINE ORDINAL INDICATOR
    '\xaa'     #  0x00d1 -> FEMININE ORDINAL INDICATOR
    '\xca'     #  0x00d2 -> LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    '\xcb'     #  0x00d3 -> LATIN CAPITAL LETTER E WITH DIAERESIS
    '\xc8'     #  0x00d4 -> LATIN CAPITAL LETTER E WITH GRAVE
    '\ufffe'   #  0x00d5 -> UNDEFINED
    '\xcd'     #  0x00d6 -> LATIN CAPITAL LETTER I WITH ACUTE
    '\xce'     #  0x00d7 -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    '\xcf'     #  0x00d8 -> LATIN CAPITAL LETTER I WITH DIAERESIS
    '\u2518'   #  0x00d9 -> BOX DRAWINGS LIGHT UP AND LEFT
    '\u250c'   #  0x00da -> BOX DRAWINGS LIGHT DOWN AND RIGHT
    '\u2588'   #  0x00db -> FULL BLOCK
    '\u2584'   #  0x00dc -> LOWER HALF BLOCK
    '\xa6'     #  0x00dd -> BROKEN BAR
    '\xcc'     #  0x00de -> LATIN CAPITAL LETTER I WITH GRAVE
    '\u2580'   #  0x00df -> UPPER HALF BLOCK
    '\xd3'     #  0x00e0 -> LATIN CAPITAL LETTER O WITH ACUTE
    '\xdf'     #  0x00e1 -> LATIN SMALL LETTER SHARP S
    '\xd4'     #  0x00e2 -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    '\xd2'     #  0x00e3 -> LATIN CAPITAL LETTER O WITH GRAVE
    '\xf5'     #  0x00e4 -> LATIN SMALL LETTER O WITH TILDE
    '\xd5'     #  0x00e5 -> LATIN CAPITAL LETTER O WITH TILDE
    '\xb5'     #  0x00e6 -> MICRO SIGN
    '\ufffe'   #  0x00e7 -> UNDEFINED
    '\xd7'     #  0x00e8 -> MULTIPLICATION SIGN
    '\xda'     #  0x00e9 -> LATIN CAPITAL LETTER U WITH ACUTE
    '\xdb'     #  0x00ea -> LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    '\xd9'     #  0x00eb -> LATIN CAPITAL LETTER U WITH GRAVE
    '\xec'     #  0x00ec -> LATIN SMALL LETTER I WITH GRAVE
    '\xff'     #  0x00ed -> LATIN SMALL LETTER Y WITH DIAERESIS
    '\xaf'     #  0x00ee -> MACRON
    '\xb4'     #  0x00ef -> ACUTE ACCENT
    '\xad'     #  0x00f0 -> SOFT HYPHEN
    '\xb1'     #  0x00f1 -> PLUS-MINUS SIGN
    '\ufffe'   #  0x00f2 -> UNDEFINED
    '\xbe'     #  0x00f3 -> VULGAR FRACTION THREE QUARTERS
    '\xb6'     #  0x00f4 -> PILCROW SIGN
    '\xa7'     #  0x00f5 -> SECTION SIGN
    '\xf7'     #  0x00f6 -> DIVISION SIGN
    '\xb8'     #  0x00f7 -> CEDILLA
    '\xb0'     #  0x00f8 -> DEGREE SIGN
    '\xa8'     #  0x00f9 -> DIAERESIS
    '\xb7'     #  0x00fa -> MIDDLE DOT
    '\xb9'     #  0x00fb -> SUPERSCRIPT ONE
    '\xb3'     #  0x00fc -> SUPERSCRIPT THREE
    '\xb2'     #  0x00fd -> SUPERSCRIPT TWO
    '\u25a0'   #  0x00fe -> BLACK SQUARE
    '\xa0'     #  0x00ff -> NO-BREAK SPACE
)

### Encoding Map

encoding_map = {
    0x0000: 0x0000,     #  NULL
    0x0001: 0x0001,     #  START OF HEADING
    0x0002: 0x0002,     #  START OF TEXT
    0x0003: 0x0003,     #  END OF TEXT
    0x0004: 0x0004,     #  END OF TRANSMISSION
    0x0005: 0x0005,     #  ENQUIRY
    0x0006: 0x0006,     #  ACKNOWLEDGE
    0x0007: 0x0007,     #  BELL
    0x0008: 0x0008,     #  BACKSPACE
    0x0009: 0x0009,     #  HORIZONTAL TABULATION
    0x000a: 0x000a,     #  LINE FEED
    0x000b: 0x000b,     #  VERTICAL TABULATION
    0x000c: 0x000c,     #  FORM FEED
    0x000d: 0x000d,     #  CARRIAGE RETURN
    0x000e: 0x000e,     #  SHIFT OUT
    0x000f: 0x000f,     #  SHIFT IN
    0x0010: 0x0010,     #  DATA LINK ESCAPE
    0x0011: 0x0011,     #  DEVICE CONTROL ONE
    0x0012: 0x0012,     #  DEVICE CONTROL TWO
    0x0013: 0x0013,     #  DEVICE CONTROL THREE
    0x0014: 0x0014,     #  DEVICE CONTROL FOUR
    0x0015: 0x0015,     #  NEGATIVE ACKNOWLEDGE
    0x0016: 0x0016,     #  SYNCHRONOUS IDLE
    0x0017: 0x0017,     #  END OF TRANSMISSION BLOCK
    0x0018: 0x0018,     #  CANCEL
    0x0019: 0x0019,     #  END OF MEDIUM
    0x001a: 0x001a,     #  SUBSTITUTE
    0x001b: 0x001b,     #  ESCAPE
    0x001c: 0x001c,     #  FILE SEPARATOR
    0x001d: 0x001d,     #  GROUP SEPARATOR
    0x001e: 0x001e,     #  RECORD SEPARATOR
    0x001f: 0x001f,     #  UNIT SEPARATOR
    0x0020: 0x0020,     #  SPACE
    0x0021: 0x0021,     #  EXCLAMATION MARK
    0x0022: 0x0022,     #  QUOTATION MARK
    0x0023: 0x0023,     #  NUMBER SIGN
    0x0024: 0x0024,     #  DOLLAR SIGN
    0x0025: 0x0025,     #  PERCENT SIGN
    0x0026: 0x0026,     #  AMPERSAND
    0x0027: 0x0027,     #  APOSTROPHE
    0x0028: 0x0028,     #  LEFT PARENTHESIS
    0x0029: 0x0029,     #  RIGHT PARENTHESIS
    0x002a: 0x002a,     #  ASTERISK
    0x002b: 0x002b,     #  PLUS SIGN
    0x002c: 0x002c,     #  COMMA
    0x002d: 0x002d,     #  HYPHEN-MINUS
    0x002e: 0x002e,     #  FULL STOP
    0x002f: 0x002f,     #  SOLIDUS
    0x0030: 0x0030,     #  DIGIT ZERO
    0x0031: 0x0031,     #  DIGIT ONE
    0x0032: 0x0032,     #  DIGIT TWO
    0x0033: 0x0033,     #  DIGIT THREE
    0x0034: 0x0034,     #  DIGIT FOUR
    0x0035: 0x0035,     #  DIGIT FIVE
    0x0036: 0x0036,     #  DIGIT SIX
    0x0037: 0x0037,     #  DIGIT SEVEN
    0x0038: 0x0038,     #  DIGIT EIGHT
    0x0039: 0x0039,     #  DIGIT NINE
    0x003a: 0x003a,     #  COLON
    0x003b: 0x003b,     #  SEMICOLON
    0x003c: 0x003c,     #  LESS-THAN SIGN
    0x003d: 0x003d,     #  EQUALS SIGN
    0x003e: 0x003e,     #  GREATER-THAN SIGN
    0x003f: 0x003f,     #  QUESTION MARK
    0x0040: 0x0040,     #  COMMERCIAL AT
    0x0041: 0x0041,     #  LATIN CAPITAL LETTER A
    0x0042: 0x0042,     #  LATIN CAPITAL LETTER B
    0x0043: 0x0043,     #  LATIN CAPITAL LETTER C
    0x0044: 0x0044,     #  LATIN CAPITAL LETTER D
    0x0045: 0x0045,     #  LATIN CAPITAL LETTER E
    0x0046: 0x0046,     #  LATIN CAPITAL LETTER F
    0x0047: 0x0047,     #  LATIN CAPITAL LETTER G
    0x0048: 0x0048,     #  LATIN CAPITAL LETTER H
    0x0049: 0x0049,     #  LATIN CAPITAL LETTER I
    0x004a: 0x004a,     #  LATIN CAPITAL LETTER J
    0x004b: 0x004b,     #  LATIN CAPITAL LETTER K
    0x004c: 0x004c,     #  LATIN CAPITAL LETTER L
    0x004d: 0x004d,     #  LATIN CAPITAL LETTER M
    0x004e: 0x004e,     #  LATIN CAPITAL LETTER N
    0x004f: 0x004f,     #  LATIN CAPITAL LETTER O
    0x0050: 0x0050,     #  LATIN CAPITAL LETTER P
    0x0051: 0x0051,     #  LATIN CAPITAL LETTER Q
    0x0052: 0x0052,     #  LATIN CAPITAL LETTER R
    0x0053: 0x0053,     #  LATIN CAPITAL LETTER S
    0x0054: 0x0054,     #  LATIN CAPITAL LETTER T
    0x0055: 0x0055,     #  LATIN CAPITAL LETTER U
    0x0056: 0x0056,     #  LATIN CAPITAL LETTER V
    0x0057: 0x0057,     #  LATIN CAPITAL LETTER W
    0x0058: 0x0058,     #  LATIN CAPITAL LETTER X
    0x0059: 0x0059,     #  LATIN CAPITAL LETTER Y
    0x005a: 0x005a,     #  LATIN CAPITAL LETTER Z
    0x005b: 0x005b,     #  LEFT SQUARE BRACKET
    0x005c: 0x005c,     #  REVERSE SOLIDUS
    0x005d: 0x005d,     #  RIGHT SQUARE BRACKET
    0x005e: 0x005e,     #  CIRCUMFLEX ACCENT
    0x005f: 0x005f,     #  LOW LINE
    0x0060: 0x0060,     #  GRAVE ACCENT
    0x0061: 0x0061,     #  LATIN SMALL LETTER A
    0x0062: 0x0062,     #  LATIN SMALL LETTER B
    0x0063: 0x0063,     #  LATIN SMALL LETTER C
    0x0064: 0x0064,     #  LATIN SMALL LETTER D
    0x0065: 0x0065,     #  LATIN SMALL LETTER E
    0x0066: 0x0066,     #  LATIN SMALL LETTER F
    0x0067: 0x0067,     #  LATIN SMALL LETTER G
    0x0068: 0x0068,     #  LATIN SMALL LETTER H
    0x0069: 0x0069,     #  LATIN SMALL LETTER I
    0x006a: 0x006a,     #  LATIN SMALL LETTER J
    0x006b: 0x006b,     #  LATIN SMALL LETTER K
    0x006c: 0x006c,     #  LATIN SMALL LETTER L
    0x006d: 0x006d,     #  LATIN SMALL LETTER M
    0x006e: 0x006e,     #  LATIN SMALL LETTER N
    0x006f: 0x006f,     #  LATIN SMALL LETTER O
    0x0070: 0x0070,     #  LATIN SMALL LETTER P
    0x0071: 0x0071,     #  LATIN SMALL LETTER Q
    0x0072: 0x0072,     #  LATIN SMALL LETTER R
    0x0073: 0x0073,     #  LATIN SMALL LETTER S
    0x0074: 0x0074,     #  LATIN SMALL LETTER T
    0x0075: 0x0075,     #  LATIN SMALL LETTER U
    0x0076: 0x0076,     #  LATIN SMALL LETTER V
    0x0077: 0x0077,     #  LATIN SMALL LETTER W
    0x0078: 0x0078,     #  LATIN SMALL LETTER X
    0x0079: 0x0079,     #  LATIN SMALL LETTER Y
    0x007a: 0x007a,     #  LATIN SMALL LETTER Z
    0x007b: 0x007b,     #  LEFT CURLY BRACKET
    0x007c: 0x007c,     #  VERTICAL LINE
    0x007d: 0x007d,     #  RIGHT CURLY BRACKET
    0x007e: 0x007e,     #  TILDE
    0x007f: 0x007f,     #  DELETE
    0x00a0: 0x00ff,     #  NO-BREAK SPACE
    0x00a1: 0x00ad,     #  INVERTED EXCLAMATION MARK
    0x00a2: 0x00bd,     #  CENT SIGN
    0x00a3: 0x009c,     #  POUND SIGN
    0x00a4: 0x00cf,     #  CURRENCY SIGN
    0x00a5: 0x00be,     #  YEN SIGN
    0x00a6: 0x00dd,     #  BROKEN BAR
    0x00a7: 0x00f5,     #  SECTION SIGN
    0x00a8: 0x00f9,     #  DIAERESIS
    0x00a9: 0x00b8,     #  COPYRIGHT SIGN
    0x00aa: 0x00d1,     #  FEMININE ORDINAL INDICATOR
    0x00ab: 0x00ae,     #  LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00ac: 0x00aa,     #  NOT SIGN
    0x00ad: 0x00f0,     #  SOFT HYPHEN
    0x00ae: 0x00a9,     #  REGISTERED SIGN
    0x00af: 0x00ee,     #  MACRON
    0x00b0: 0x00f8,     #  DEGREE SIGN
    0x00b1: 0x00f1,     #  PLUS-MINUS SIGN
    0x00b2: 0x00fd,     #  SUPERSCRIPT TWO
    0x00b3: 0x00fc,     #  SUPERSCRIPT THREE
    0x00b4: 0x00ef,     #  ACUTE ACCENT
    0x00b5: 0x00e6,     #  MICRO SIGN
    0x00b6: 0x00f4,     #  PILCROW SIGN
    0x00b7: 0x00fa,     #  MIDDLE DOT
    0x00b8: 0x00f7,     #  CEDILLA
    0x00b9: 0x00fb,     #  SUPERSCRIPT ONE
    0x00ba: 0x00d0,     #  MASCULINE ORDINAL INDICATOR
    0x00bb: 0x00af,     #  RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00bc: 0x00ac,     #  VULGAR FRACTION ONE QUARTER
    0x00bd: 0x00ab,     #  VULGAR FRACTION ONE HALF
    0x00be: 0x00f3,     #  VULGAR FRACTION THREE QUARTERS
    0x00bf: 0x00a8,     #  INVERTED QUESTION MARK
    0x00c0: 0x00b7,     #  LATIN CAPITAL LETTER A WITH GRAVE
    0x00c1: 0x00b5,     #  LATIN CAPITAL LETTER A WITH ACUTE
    0x00c2: 0x00b6,     #  LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    0x00c3: 0x00c7,     #  LATIN CAPITAL LETTER A WITH TILDE
    0x00c4: 0x008e,     #  LATIN CAPITAL LETTER A WITH DIAERESIS
    0x00c5: 0x008f,     #  LATIN CAPITAL LETTER A WITH RING ABOVE
    0x00c6: 0x0092,     #  LATIN CAPITAL LIGATURE AE
    0x00c7: 0x0080,     #  LATIN CAPITAL LETTER C WITH CEDILLA
    0x00c8: 0x00d4,     #  LATIN CAPITAL LETTER E WITH GRAVE
    0x00c9: 0x0090,     #  LATIN CAPITAL LETTER E WITH ACUTE
    0x00ca: 0x00d2,     #  LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    0x00cb: 0x00d3,     #  LATIN CAPITAL LETTER E WITH DIAERESIS
    0x00cc: 0x00de,     #  LATIN CAPITAL LETTER I WITH GRAVE
    0x00cd: 0x00d6,     #  LATIN CAPITAL LETTER I WITH ACUTE
    0x00ce: 0x00d7,     #  LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    0x00cf: 0x00d8,     #  LATIN CAPITAL LETTER I WITH DIAERESIS
    0x00d1: 0x00a5,     #  LATIN CAPITAL LETTER N WITH TILDE
    0x00d2: 0x00e3,     #  LATIN CAPITAL LETTER O WITH GRAVE
    0x00d3: 0x00e0,     #  LATIN CAPITAL LETTER O WITH ACUTE
    0x00d4: 0x00e2,     #  LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    0x00d5: 0x00e5,     #  LATIN CAPITAL LETTER O WITH TILDE
    0x00d6: 0x0099,     #  LATIN CAPITAL LETTER O WITH DIAERESIS
    0x00d7: 0x00e8,     #  MULTIPLICATION SIGN
    0x00d8: 0x009d,     #  LATIN CAPITAL LETTER O WITH STROKE
    0x00d9: 0x00eb,     #  LATIN CAPITAL LETTER U WITH GRAVE
    0x00da: 0x00e9,     #  LATIN CAPITAL LETTER U WITH ACUTE
    0x00db: 0x00ea,     #  LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    0x00dc: 0x009a,     #  LATIN CAPITAL LETTER U WITH DIAERESIS
    0x00df: 0x00e1,     #  LATIN SMALL LETTER SHARP S
    0x00e0: 0x0085,     #  LATIN SMALL LETTER A WITH GRAVE
    0x00e1: 0x00a0,     #  LATIN SMALL LETTER A WITH ACUTE
    0x00e2: 0x0083,     #  LATIN SMALL LETTER A WITH CIRCUMFLEX
    0x00e3: 0x00c6,     #  LATIN SMALL LETTER A WITH TILDE
    0x00e4: 0x0084,     #  LATIN SMALL LETTER A WITH DIAERESIS
    0x00e5: 0x0086,     #  LATIN SMALL LETTER A WITH RING ABOVE
    0x00e6: 0x0091,     #  LATIN SMALL LIGATURE AE
    0x00e7: 0x0087,     #  LATIN SMALL LETTER C WITH CEDILLA
    0x00e8: 0x008a,     #  LATIN SMALL LETTER E WITH GRAVE
    0x00e9: 0x0082,     #  LATIN SMALL LETTER E WITH ACUTE
    0x00ea: 0x0088,     #  LATIN SMALL LETTER E WITH CIRCUMFLEX
    0x00eb: 0x0089,     #  LATIN SMALL LETTER E WITH DIAERESIS
    0x00ec: 0x00ec,     #  LATIN SMALL LETTER I WITH GRAVE
    0x00ed: 0x00a1,     #  LATIN SMALL LETTER I WITH ACUTE
    0x00ee: 0x008c,     #  LATIN SMALL LETTER I WITH CIRCUMFLEX
    0x00ef: 0x008b,     #  LATIN SMALL LETTER I WITH DIAERESIS
    0x00f1: 0x00a4,     #  LATIN SMALL LETTER N WITH TILDE
    0x00f2: 0x0095,     #  LATIN SMALL LETTER O WITH GRAVE
    0x00f3: 0x00a2,     #  LATIN SMALL LETTER O WITH ACUTE
    0x00f4: 0x0093,     #  LATIN SMALL LETTER O WITH CIRCUMFLEX
    0x00f5: 0x00e4,     #  LATIN SMALL LETTER O WITH TILDE
    0x00f6: 0x0094,     #  LATIN SMALL LETTER O WITH DIAERESIS
    0x00f7: 0x00f6,     #  DIVISION SIGN
    0x00f8: 0x009b,     #  LATIN SMALL LETTER O WITH STROKE
    0x00f9: 0x0097,     #  LATIN SMALL LETTER U WITH GRAVE
    0x00fa: 0x00a3,     #  LATIN SMALL LETTER U WITH ACUTE
    0x00fb: 0x0096,     #  LATIN SMALL LETTER U WITH CIRCUMFLEX
    0x00fc: 0x0081,     #  LATIN SMALL LETTER U WITH DIAERESIS
    0x00ff: 0x00ed,     #  LATIN SMALL LETTER Y WITH DIAERESIS
    0x011e: 0x00a6,     #  LATIN CAPITAL LETTER G WITH BREVE
    0x011f: 0x00a7,     #  LATIN SMALL LETTER G WITH BREVE
    0x0130: 0x0098,     #  LATIN CAPITAL LETTER I WITH DOT ABOVE
    0x0131: 0x008d,     #  LATIN SMALL LETTER DOTLESS I
    0x015e: 0x009e,     #  LATIN CAPITAL LETTER S WITH CEDILLA
    0x015f: 0x009f,     #  LATIN SMALL LETTER S WITH CEDILLA
    0x2500: 0x00c4,     #  BOX DRAWINGS LIGHT HORIZONTAL
    0x2502: 0x00b3,     #  BOX DRAWINGS LIGHT VERTICAL
    0x250c: 0x00da,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
    0x2510: 0x00bf,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
    0x2514: 0x00c0,     #  BOX DRAWINGS LIGHT UP AND RIGHT
    0x2518: 0x00d9,     #  BOX DRAWINGS LIGHT UP AND LEFT
    0x251c: 0x00c3,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    0x2524: 0x00b4,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
    0x252c: 0x00c2,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    0x2534: 0x00c1,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
    0x253c: 0x00c5,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    0x2550: 0x00cd,     #  BOX DRAWINGS DOUBLE HORIZONTAL
    0x2551: 0x00ba,     #  BOX DRAWINGS DOUBLE VERTICAL
    0x2554: 0x00c9,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
    0x2557: 0x00bb,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
    0x255a: 0x00c8,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
    0x255d: 0x00bc,     #  BOX DRAWINGS DOUBLE UP AND LEFT
    0x2560: 0x00cc,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    0x2563: 0x00b9,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    0x2566: 0x00cb,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    0x2569: 0x00ca,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    0x256c: 0x00ce,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    0x2580: 0x00df,     #  UPPER HALF BLOCK
    0x2584: 0x00dc,     #  LOWER HALF BLOCK
    0x2588: 0x00db,     #  FULL BLOCK
    0x2591: 0x00b0,     #  LIGHT SHADE
    0x2592: 0x00b1,     #  MEDIUM SHADE
    0x2593: 0x00b2,     #  DARK SHADE
    0x25a0: 0x00fe,     #  BLACK SQUARE
}
encodings/gb18030.py000064400000002007151153537630010063 0ustar00#
# gb18030.py: Python Unicode Codec for GB18030
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#

import _codecs_cn, codecs
import _multibytecodec as mbc

codec = _codecs_cn.getcodec('gb18030')

class Codec(codecs.Codec):
    encode = codec.encode
    decode = codec.decode

class IncrementalEncoder(mbc.MultibyteIncrementalEncoder,
                         codecs.IncrementalEncoder):
    codec = codec

class IncrementalDecoder(mbc.MultibyteIncrementalDecoder,
                         codecs.IncrementalDecoder):
    codec = codec

class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader):
    codec = codec

class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
    codec = codec

def getregentry():
    return codecs.CodecInfo(
        name='gb18030',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/iso8859_9.py000064400000031544151153537630010467 0ustar00""" Python Character Mapping Codec iso8859_9 generated from 'MAPPINGS/ISO8859/8859-9.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='iso8859-9',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\x80'     #  0x80 -> <control>
    '\x81'     #  0x81 -> <control>
    '\x82'     #  0x82 -> <control>
    '\x83'     #  0x83 -> <control>
    '\x84'     #  0x84 -> <control>
    '\x85'     #  0x85 -> <control>
    '\x86'     #  0x86 -> <control>
    '\x87'     #  0x87 -> <control>
    '\x88'     #  0x88 -> <control>
    '\x89'     #  0x89 -> <control>
    '\x8a'     #  0x8A -> <control>
    '\x8b'     #  0x8B -> <control>
    '\x8c'     #  0x8C -> <control>
    '\x8d'     #  0x8D -> <control>
    '\x8e'     #  0x8E -> <control>
    '\x8f'     #  0x8F -> <control>
    '\x90'     #  0x90 -> <control>
    '\x91'     #  0x91 -> <control>
    '\x92'     #  0x92 -> <control>
    '\x93'     #  0x93 -> <control>
    '\x94'     #  0x94 -> <control>
    '\x95'     #  0x95 -> <control>
    '\x96'     #  0x96 -> <control>
    '\x97'     #  0x97 -> <control>
    '\x98'     #  0x98 -> <control>
    '\x99'     #  0x99 -> <control>
    '\x9a'     #  0x9A -> <control>
    '\x9b'     #  0x9B -> <control>
    '\x9c'     #  0x9C -> <control>
    '\x9d'     #  0x9D -> <control>
    '\x9e'     #  0x9E -> <control>
    '\x9f'     #  0x9F -> <control>
    '\xa0'     #  0xA0 -> NO-BREAK SPACE
    '\xa1'     #  0xA1 -> INVERTED EXCLAMATION MARK
    '\xa2'     #  0xA2 -> CENT SIGN
    '\xa3'     #  0xA3 -> POUND SIGN
    '\xa4'     #  0xA4 -> CURRENCY SIGN
    '\xa5'     #  0xA5 -> YEN SIGN
    '\xa6'     #  0xA6 -> BROKEN BAR
    '\xa7'     #  0xA7 -> SECTION SIGN
    '\xa8'     #  0xA8 -> DIAERESIS
    '\xa9'     #  0xA9 -> COPYRIGHT SIGN
    '\xaa'     #  0xAA -> FEMININE ORDINAL INDICATOR
    '\xab'     #  0xAB -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xac'     #  0xAC -> NOT SIGN
    '\xad'     #  0xAD -> SOFT HYPHEN
    '\xae'     #  0xAE -> REGISTERED SIGN
    '\xaf'     #  0xAF -> MACRON
    '\xb0'     #  0xB0 -> DEGREE SIGN
    '\xb1'     #  0xB1 -> PLUS-MINUS SIGN
    '\xb2'     #  0xB2 -> SUPERSCRIPT TWO
    '\xb3'     #  0xB3 -> SUPERSCRIPT THREE
    '\xb4'     #  0xB4 -> ACUTE ACCENT
    '\xb5'     #  0xB5 -> MICRO SIGN
    '\xb6'     #  0xB6 -> PILCROW SIGN
    '\xb7'     #  0xB7 -> MIDDLE DOT
    '\xb8'     #  0xB8 -> CEDILLA
    '\xb9'     #  0xB9 -> SUPERSCRIPT ONE
    '\xba'     #  0xBA -> MASCULINE ORDINAL INDICATOR
    '\xbb'     #  0xBB -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbc'     #  0xBC -> VULGAR FRACTION ONE QUARTER
    '\xbd'     #  0xBD -> VULGAR FRACTION ONE HALF
    '\xbe'     #  0xBE -> VULGAR FRACTION THREE QUARTERS
    '\xbf'     #  0xBF -> INVERTED QUESTION MARK
    '\xc0'     #  0xC0 -> LATIN CAPITAL LETTER A WITH GRAVE
    '\xc1'     #  0xC1 -> LATIN CAPITAL LETTER A WITH ACUTE
    '\xc2'     #  0xC2 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    '\xc3'     #  0xC3 -> LATIN CAPITAL LETTER A WITH TILDE
    '\xc4'     #  0xC4 -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\xc5'     #  0xC5 -> LATIN CAPITAL LETTER A WITH RING ABOVE
    '\xc6'     #  0xC6 -> LATIN CAPITAL LETTER AE
    '\xc7'     #  0xC7 -> LATIN CAPITAL LETTER C WITH CEDILLA
    '\xc8'     #  0xC8 -> LATIN CAPITAL LETTER E WITH GRAVE
    '\xc9'     #  0xC9 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\xca'     #  0xCA -> LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    '\xcb'     #  0xCB -> LATIN CAPITAL LETTER E WITH DIAERESIS
    '\xcc'     #  0xCC -> LATIN CAPITAL LETTER I WITH GRAVE
    '\xcd'     #  0xCD -> LATIN CAPITAL LETTER I WITH ACUTE
    '\xce'     #  0xCE -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    '\xcf'     #  0xCF -> LATIN CAPITAL LETTER I WITH DIAERESIS
    '\u011e'   #  0xD0 -> LATIN CAPITAL LETTER G WITH BREVE
    '\xd1'     #  0xD1 -> LATIN CAPITAL LETTER N WITH TILDE
    '\xd2'     #  0xD2 -> LATIN CAPITAL LETTER O WITH GRAVE
    '\xd3'     #  0xD3 -> LATIN CAPITAL LETTER O WITH ACUTE
    '\xd4'     #  0xD4 -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    '\xd5'     #  0xD5 -> LATIN CAPITAL LETTER O WITH TILDE
    '\xd6'     #  0xD6 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xd7'     #  0xD7 -> MULTIPLICATION SIGN
    '\xd8'     #  0xD8 -> LATIN CAPITAL LETTER O WITH STROKE
    '\xd9'     #  0xD9 -> LATIN CAPITAL LETTER U WITH GRAVE
    '\xda'     #  0xDA -> LATIN CAPITAL LETTER U WITH ACUTE
    '\xdb'     #  0xDB -> LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    '\xdc'     #  0xDC -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\u0130'   #  0xDD -> LATIN CAPITAL LETTER I WITH DOT ABOVE
    '\u015e'   #  0xDE -> LATIN CAPITAL LETTER S WITH CEDILLA
    '\xdf'     #  0xDF -> LATIN SMALL LETTER SHARP S
    '\xe0'     #  0xE0 -> LATIN SMALL LETTER A WITH GRAVE
    '\xe1'     #  0xE1 -> LATIN SMALL LETTER A WITH ACUTE
    '\xe2'     #  0xE2 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\xe3'     #  0xE3 -> LATIN SMALL LETTER A WITH TILDE
    '\xe4'     #  0xE4 -> LATIN SMALL LETTER A WITH DIAERESIS
    '\xe5'     #  0xE5 -> LATIN SMALL LETTER A WITH RING ABOVE
    '\xe6'     #  0xE6 -> LATIN SMALL LETTER AE
    '\xe7'     #  0xE7 -> LATIN SMALL LETTER C WITH CEDILLA
    '\xe8'     #  0xE8 -> LATIN SMALL LETTER E WITH GRAVE
    '\xe9'     #  0xE9 -> LATIN SMALL LETTER E WITH ACUTE
    '\xea'     #  0xEA -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xeb'     #  0xEB -> LATIN SMALL LETTER E WITH DIAERESIS
    '\xec'     #  0xEC -> LATIN SMALL LETTER I WITH GRAVE
    '\xed'     #  0xED -> LATIN SMALL LETTER I WITH ACUTE
    '\xee'     #  0xEE -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\xef'     #  0xEF -> LATIN SMALL LETTER I WITH DIAERESIS
    '\u011f'   #  0xF0 -> LATIN SMALL LETTER G WITH BREVE
    '\xf1'     #  0xF1 -> LATIN SMALL LETTER N WITH TILDE
    '\xf2'     #  0xF2 -> LATIN SMALL LETTER O WITH GRAVE
    '\xf3'     #  0xF3 -> LATIN SMALL LETTER O WITH ACUTE
    '\xf4'     #  0xF4 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xf5'     #  0xF5 -> LATIN SMALL LETTER O WITH TILDE
    '\xf6'     #  0xF6 -> LATIN SMALL LETTER O WITH DIAERESIS
    '\xf7'     #  0xF7 -> DIVISION SIGN
    '\xf8'     #  0xF8 -> LATIN SMALL LETTER O WITH STROKE
    '\xf9'     #  0xF9 -> LATIN SMALL LETTER U WITH GRAVE
    '\xfa'     #  0xFA -> LATIN SMALL LETTER U WITH ACUTE
    '\xfb'     #  0xFB -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\xfc'     #  0xFC -> LATIN SMALL LETTER U WITH DIAERESIS
    '\u0131'   #  0xFD -> LATIN SMALL LETTER DOTLESS I
    '\u015f'   #  0xFE -> LATIN SMALL LETTER S WITH CEDILLA
    '\xff'     #  0xFF -> LATIN SMALL LETTER Y WITH DIAERESIS
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/euc_kr.py000064400000002003151153537630010343 0ustar00#
# euc_kr.py: Python Unicode Codec for EUC_KR
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#

import _codecs_kr, codecs
import _multibytecodec as mbc

codec = _codecs_kr.getcodec('euc_kr')

class Codec(codecs.Codec):
    encode = codec.encode
    decode = codec.decode

class IncrementalEncoder(mbc.MultibyteIncrementalEncoder,
                         codecs.IncrementalEncoder):
    codec = codec

class IncrementalDecoder(mbc.MultibyteIncrementalDecoder,
                         codecs.IncrementalDecoder):
    codec = codec

class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader):
    codec = codec

class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
    codec = codec

def getregentry():
    return codecs.CodecInfo(
        name='euc_kr',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/palmos.py000064400000032317151153537630010401 0ustar00""" Python Character Mapping Codec for PalmOS 3.5.

Written by Sjoerd Mullender (sjoerd@acm.org); based on iso8859_15.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):
    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='palmos',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\u20ac'   #  0x80 -> EURO SIGN
    '\x81'     #  0x81 -> <control>
    '\u201a'   #  0x82 -> SINGLE LOW-9 QUOTATION MARK
    '\u0192'   #  0x83 -> LATIN SMALL LETTER F WITH HOOK
    '\u201e'   #  0x84 -> DOUBLE LOW-9 QUOTATION MARK
    '\u2026'   #  0x85 -> HORIZONTAL ELLIPSIS
    '\u2020'   #  0x86 -> DAGGER
    '\u2021'   #  0x87 -> DOUBLE DAGGER
    '\u02c6'   #  0x88 -> MODIFIER LETTER CIRCUMFLEX ACCENT
    '\u2030'   #  0x89 -> PER MILLE SIGN
    '\u0160'   #  0x8A -> LATIN CAPITAL LETTER S WITH CARON
    '\u2039'   #  0x8B -> SINGLE LEFT-POINTING ANGLE QUOTATION MARK
    '\u0152'   #  0x8C -> LATIN CAPITAL LIGATURE OE
    '\u2666'   #  0x8D -> BLACK DIAMOND SUIT
    '\u2663'   #  0x8E -> BLACK CLUB SUIT
    '\u2665'   #  0x8F -> BLACK HEART SUIT
    '\u2660'   #  0x90 -> BLACK SPADE SUIT
    '\u2018'   #  0x91 -> LEFT SINGLE QUOTATION MARK
    '\u2019'   #  0x92 -> RIGHT SINGLE QUOTATION MARK
    '\u201c'   #  0x93 -> LEFT DOUBLE QUOTATION MARK
    '\u201d'   #  0x94 -> RIGHT DOUBLE QUOTATION MARK
    '\u2022'   #  0x95 -> BULLET
    '\u2013'   #  0x96 -> EN DASH
    '\u2014'   #  0x97 -> EM DASH
    '\u02dc'   #  0x98 -> SMALL TILDE
    '\u2122'   #  0x99 -> TRADE MARK SIGN
    '\u0161'   #  0x9A -> LATIN SMALL LETTER S WITH CARON
    '\x9b'     #  0x9B -> <control>
    '\u0153'   #  0x9C -> LATIN SMALL LIGATURE OE
    '\x9d'     #  0x9D -> <control>
    '\x9e'     #  0x9E -> <control>
    '\u0178'   #  0x9F -> LATIN CAPITAL LETTER Y WITH DIAERESIS
    '\xa0'     #  0xA0 -> NO-BREAK SPACE
    '\xa1'     #  0xA1 -> INVERTED EXCLAMATION MARK
    '\xa2'     #  0xA2 -> CENT SIGN
    '\xa3'     #  0xA3 -> POUND SIGN
    '\xa4'     #  0xA4 -> CURRENCY SIGN
    '\xa5'     #  0xA5 -> YEN SIGN
    '\xa6'     #  0xA6 -> BROKEN BAR
    '\xa7'     #  0xA7 -> SECTION SIGN
    '\xa8'     #  0xA8 -> DIAERESIS
    '\xa9'     #  0xA9 -> COPYRIGHT SIGN
    '\xaa'     #  0xAA -> FEMININE ORDINAL INDICATOR
    '\xab'     #  0xAB -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xac'     #  0xAC -> NOT SIGN
    '\xad'     #  0xAD -> SOFT HYPHEN
    '\xae'     #  0xAE -> REGISTERED SIGN
    '\xaf'     #  0xAF -> MACRON
    '\xb0'     #  0xB0 -> DEGREE SIGN
    '\xb1'     #  0xB1 -> PLUS-MINUS SIGN
    '\xb2'     #  0xB2 -> SUPERSCRIPT TWO
    '\xb3'     #  0xB3 -> SUPERSCRIPT THREE
    '\xb4'     #  0xB4 -> ACUTE ACCENT
    '\xb5'     #  0xB5 -> MICRO SIGN
    '\xb6'     #  0xB6 -> PILCROW SIGN
    '\xb7'     #  0xB7 -> MIDDLE DOT
    '\xb8'     #  0xB8 -> CEDILLA
    '\xb9'     #  0xB9 -> SUPERSCRIPT ONE
    '\xba'     #  0xBA -> MASCULINE ORDINAL INDICATOR
    '\xbb'     #  0xBB -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbc'     #  0xBC -> VULGAR FRACTION ONE QUARTER
    '\xbd'     #  0xBD -> VULGAR FRACTION ONE HALF
    '\xbe'     #  0xBE -> VULGAR FRACTION THREE QUARTERS
    '\xbf'     #  0xBF -> INVERTED QUESTION MARK
    '\xc0'     #  0xC0 -> LATIN CAPITAL LETTER A WITH GRAVE
    '\xc1'     #  0xC1 -> LATIN CAPITAL LETTER A WITH ACUTE
    '\xc2'     #  0xC2 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    '\xc3'     #  0xC3 -> LATIN CAPITAL LETTER A WITH TILDE
    '\xc4'     #  0xC4 -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\xc5'     #  0xC5 -> LATIN CAPITAL LETTER A WITH RING ABOVE
    '\xc6'     #  0xC6 -> LATIN CAPITAL LETTER AE
    '\xc7'     #  0xC7 -> LATIN CAPITAL LETTER C WITH CEDILLA
    '\xc8'     #  0xC8 -> LATIN CAPITAL LETTER E WITH GRAVE
    '\xc9'     #  0xC9 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\xca'     #  0xCA -> LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    '\xcb'     #  0xCB -> LATIN CAPITAL LETTER E WITH DIAERESIS
    '\xcc'     #  0xCC -> LATIN CAPITAL LETTER I WITH GRAVE
    '\xcd'     #  0xCD -> LATIN CAPITAL LETTER I WITH ACUTE
    '\xce'     #  0xCE -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    '\xcf'     #  0xCF -> LATIN CAPITAL LETTER I WITH DIAERESIS
    '\xd0'     #  0xD0 -> LATIN CAPITAL LETTER ETH (Icelandic)
    '\xd1'     #  0xD1 -> LATIN CAPITAL LETTER N WITH TILDE
    '\xd2'     #  0xD2 -> LATIN CAPITAL LETTER O WITH GRAVE
    '\xd3'     #  0xD3 -> LATIN CAPITAL LETTER O WITH ACUTE
    '\xd4'     #  0xD4 -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    '\xd5'     #  0xD5 -> LATIN CAPITAL LETTER O WITH TILDE
    '\xd6'     #  0xD6 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xd7'     #  0xD7 -> MULTIPLICATION SIGN
    '\xd8'     #  0xD8 -> LATIN CAPITAL LETTER O WITH STROKE
    '\xd9'     #  0xD9 -> LATIN CAPITAL LETTER U WITH GRAVE
    '\xda'     #  0xDA -> LATIN CAPITAL LETTER U WITH ACUTE
    '\xdb'     #  0xDB -> LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    '\xdc'     #  0xDC -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\xdd'     #  0xDD -> LATIN CAPITAL LETTER Y WITH ACUTE
    '\xde'     #  0xDE -> LATIN CAPITAL LETTER THORN (Icelandic)
    '\xdf'     #  0xDF -> LATIN SMALL LETTER SHARP S (German)
    '\xe0'     #  0xE0 -> LATIN SMALL LETTER A WITH GRAVE
    '\xe1'     #  0xE1 -> LATIN SMALL LETTER A WITH ACUTE
    '\xe2'     #  0xE2 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\xe3'     #  0xE3 -> LATIN SMALL LETTER A WITH TILDE
    '\xe4'     #  0xE4 -> LATIN SMALL LETTER A WITH DIAERESIS
    '\xe5'     #  0xE5 -> LATIN SMALL LETTER A WITH RING ABOVE
    '\xe6'     #  0xE6 -> LATIN SMALL LETTER AE
    '\xe7'     #  0xE7 -> LATIN SMALL LETTER C WITH CEDILLA
    '\xe8'     #  0xE8 -> LATIN SMALL LETTER E WITH GRAVE
    '\xe9'     #  0xE9 -> LATIN SMALL LETTER E WITH ACUTE
    '\xea'     #  0xEA -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xeb'     #  0xEB -> LATIN SMALL LETTER E WITH DIAERESIS
    '\xec'     #  0xEC -> LATIN SMALL LETTER I WITH GRAVE
    '\xed'     #  0xED -> LATIN SMALL LETTER I WITH ACUTE
    '\xee'     #  0xEE -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\xef'     #  0xEF -> LATIN SMALL LETTER I WITH DIAERESIS
    '\xf0'     #  0xF0 -> LATIN SMALL LETTER ETH (Icelandic)
    '\xf1'     #  0xF1 -> LATIN SMALL LETTER N WITH TILDE
    '\xf2'     #  0xF2 -> LATIN SMALL LETTER O WITH GRAVE
    '\xf3'     #  0xF3 -> LATIN SMALL LETTER O WITH ACUTE
    '\xf4'     #  0xF4 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xf5'     #  0xF5 -> LATIN SMALL LETTER O WITH TILDE
    '\xf6'     #  0xF6 -> LATIN SMALL LETTER O WITH DIAERESIS
    '\xf7'     #  0xF7 -> DIVISION SIGN
    '\xf8'     #  0xF8 -> LATIN SMALL LETTER O WITH STROKE
    '\xf9'     #  0xF9 -> LATIN SMALL LETTER U WITH GRAVE
    '\xfa'     #  0xFA -> LATIN SMALL LETTER U WITH ACUTE
    '\xfb'     #  0xFB -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\xfc'     #  0xFC -> LATIN SMALL LETTER U WITH DIAERESIS
    '\xfd'     #  0xFD -> LATIN SMALL LETTER Y WITH ACUTE
    '\xfe'     #  0xFE -> LATIN SMALL LETTER THORN (Icelandic)
    '\xff'     #  0xFF -> LATIN SMALL LETTER Y WITH DIAERESIS
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/oem.py000064400000001773151153537630007670 0ustar00""" Python 'oem' Codec for Windows

"""
# Import them explicitly to cause an ImportError
# on non-Windows systems
from codecs import oem_encode, oem_decode
# for IncrementalDecoder, IncrementalEncoder, ...
import codecs

### Codec APIs

encode = oem_encode

def decode(input, errors='strict'):
    return oem_decode(input, errors, True)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return oem_encode(input, self.errors)[0]

class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
    _buffer_decode = oem_decode

class StreamWriter(codecs.StreamWriter):
    encode = oem_encode

class StreamReader(codecs.StreamReader):
    decode = oem_decode

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='oem',
        encode=encode,
        decode=decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/johab.py000064400000001777151153537630010177 0ustar00#
# johab.py: Python Unicode Codec for JOHAB
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#

import _codecs_kr, codecs
import _multibytecodec as mbc

codec = _codecs_kr.getcodec('johab')

class Codec(codecs.Codec):
    encode = codec.encode
    decode = codec.decode

class IncrementalEncoder(mbc.MultibyteIncrementalEncoder,
                         codecs.IncrementalEncoder):
    codec = codec

class IncrementalDecoder(mbc.MultibyteIncrementalDecoder,
                         codecs.IncrementalDecoder):
    codec = codec

class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader):
    codec = codec

class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
    codec = codec

def getregentry():
    return codecs.CodecInfo(
        name='johab',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/aliases.py000064400000036515151153537630010533 0ustar00""" Encoding Aliases Support

    This module is used by the encodings package search function to
    map encodings names to module names.

    Note that the search function normalizes the encoding names before
    doing the lookup, so the mapping will have to map normalized
    encoding names to module names.

    Contents:

        The following aliases dictionary contains mappings of all IANA
        character set names for which the Python core library provides
        codecs. In addition to these, a few Python specific codec
        aliases have also been added.

"""
aliases = {

    # Please keep this list sorted alphabetically by value !

    # ascii codec
    '646'                : 'ascii',
    'ansi_x3.4_1968'     : 'ascii',
    'ansi_x3_4_1968'     : 'ascii', # some email headers use this non-standard name
    'ansi_x3.4_1986'     : 'ascii',
    'cp367'              : 'ascii',
    'csascii'            : 'ascii',
    'ibm367'             : 'ascii',
    'iso646_us'          : 'ascii',
    'iso_646.irv_1991'   : 'ascii',
    'iso_ir_6'           : 'ascii',
    'us'                 : 'ascii',
    'us_ascii'           : 'ascii',

    # base64_codec codec
    'base64'             : 'base64_codec',
    'base_64'            : 'base64_codec',

    # big5 codec
    'big5_tw'            : 'big5',
    'csbig5'             : 'big5',

    # big5hkscs codec
    'big5_hkscs'         : 'big5hkscs',
    'hkscs'              : 'big5hkscs',

    # bz2_codec codec
    'bz2'                : 'bz2_codec',

    # cp037 codec
    '037'                : 'cp037',
    'csibm037'           : 'cp037',
    'ebcdic_cp_ca'       : 'cp037',
    'ebcdic_cp_nl'       : 'cp037',
    'ebcdic_cp_us'       : 'cp037',
    'ebcdic_cp_wt'       : 'cp037',
    'ibm037'             : 'cp037',
    'ibm039'             : 'cp037',

    # cp1026 codec
    '1026'               : 'cp1026',
    'csibm1026'          : 'cp1026',
    'ibm1026'            : 'cp1026',

    # cp1125 codec
    '1125'                : 'cp1125',
    'ibm1125'             : 'cp1125',
    'cp866u'              : 'cp1125',
    'ruscii'              : 'cp1125',

    # cp1140 codec
    '1140'               : 'cp1140',
    'ibm1140'            : 'cp1140',

    # cp1250 codec
    '1250'               : 'cp1250',
    'windows_1250'       : 'cp1250',

    # cp1251 codec
    '1251'               : 'cp1251',
    'windows_1251'       : 'cp1251',

    # cp1252 codec
    '1252'               : 'cp1252',
    'windows_1252'       : 'cp1252',

    # cp1253 codec
    '1253'               : 'cp1253',
    'windows_1253'       : 'cp1253',

    # cp1254 codec
    '1254'               : 'cp1254',
    'windows_1254'       : 'cp1254',

    # cp1255 codec
    '1255'               : 'cp1255',
    'windows_1255'       : 'cp1255',

    # cp1256 codec
    '1256'               : 'cp1256',
    'windows_1256'       : 'cp1256',

    # cp1257 codec
    '1257'               : 'cp1257',
    'windows_1257'       : 'cp1257',

    # cp1258 codec
    '1258'               : 'cp1258',
    'windows_1258'       : 'cp1258',

    # cp273 codec
    '273'                : 'cp273',
    'ibm273'             : 'cp273',
    'csibm273'           : 'cp273',

    # cp424 codec
    '424'                : 'cp424',
    'csibm424'           : 'cp424',
    'ebcdic_cp_he'       : 'cp424',
    'ibm424'             : 'cp424',

    # cp437 codec
    '437'                : 'cp437',
    'cspc8codepage437'   : 'cp437',
    'ibm437'             : 'cp437',

    # cp500 codec
    '500'                : 'cp500',
    'csibm500'           : 'cp500',
    'ebcdic_cp_be'       : 'cp500',
    'ebcdic_cp_ch'       : 'cp500',
    'ibm500'             : 'cp500',

    # cp775 codec
    '775'                : 'cp775',
    'cspc775baltic'      : 'cp775',
    'ibm775'             : 'cp775',

    # cp850 codec
    '850'                : 'cp850',
    'cspc850multilingual' : 'cp850',
    'ibm850'             : 'cp850',

    # cp852 codec
    '852'                : 'cp852',
    'cspcp852'           : 'cp852',
    'ibm852'             : 'cp852',

    # cp855 codec
    '855'                : 'cp855',
    'csibm855'           : 'cp855',
    'ibm855'             : 'cp855',

    # cp857 codec
    '857'                : 'cp857',
    'csibm857'           : 'cp857',
    'ibm857'             : 'cp857',

    # cp858 codec
    '858'                : 'cp858',
    'csibm858'           : 'cp858',
    'ibm858'             : 'cp858',

    # cp860 codec
    '860'                : 'cp860',
    'csibm860'           : 'cp860',
    'ibm860'             : 'cp860',

    # cp861 codec
    '861'                : 'cp861',
    'cp_is'              : 'cp861',
    'csibm861'           : 'cp861',
    'ibm861'             : 'cp861',

    # cp862 codec
    '862'                : 'cp862',
    'cspc862latinhebrew' : 'cp862',
    'ibm862'             : 'cp862',

    # cp863 codec
    '863'                : 'cp863',
    'csibm863'           : 'cp863',
    'ibm863'             : 'cp863',

    # cp864 codec
    '864'                : 'cp864',
    'csibm864'           : 'cp864',
    'ibm864'             : 'cp864',

    # cp865 codec
    '865'                : 'cp865',
    'csibm865'           : 'cp865',
    'ibm865'             : 'cp865',

    # cp866 codec
    '866'                : 'cp866',
    'csibm866'           : 'cp866',
    'ibm866'             : 'cp866',

    # cp869 codec
    '869'                : 'cp869',
    'cp_gr'              : 'cp869',
    'csibm869'           : 'cp869',
    'ibm869'             : 'cp869',

    # cp932 codec
    '932'                : 'cp932',
    'ms932'              : 'cp932',
    'mskanji'            : 'cp932',
    'ms_kanji'           : 'cp932',

    # cp949 codec
    '949'                : 'cp949',
    'ms949'              : 'cp949',
    'uhc'                : 'cp949',

    # cp950 codec
    '950'                : 'cp950',
    'ms950'              : 'cp950',

    # euc_jis_2004 codec
    'jisx0213'           : 'euc_jis_2004',
    'eucjis2004'         : 'euc_jis_2004',
    'euc_jis2004'        : 'euc_jis_2004',

    # euc_jisx0213 codec
    'eucjisx0213'        : 'euc_jisx0213',

    # euc_jp codec
    'eucjp'              : 'euc_jp',
    'ujis'               : 'euc_jp',
    'u_jis'              : 'euc_jp',

    # euc_kr codec
    'euckr'              : 'euc_kr',
    'korean'             : 'euc_kr',
    'ksc5601'            : 'euc_kr',
    'ks_c_5601'          : 'euc_kr',
    'ks_c_5601_1987'     : 'euc_kr',
    'ksx1001'            : 'euc_kr',
    'ks_x_1001'          : 'euc_kr',

    # gb18030 codec
    'gb18030_2000'       : 'gb18030',

    # gb2312 codec
    'chinese'            : 'gb2312',
    'csiso58gb231280'    : 'gb2312',
    'euc_cn'             : 'gb2312',
    'euccn'              : 'gb2312',
    'eucgb2312_cn'       : 'gb2312',
    'gb2312_1980'        : 'gb2312',
    'gb2312_80'          : 'gb2312',
    'iso_ir_58'          : 'gb2312',

    # gbk codec
    '936'                : 'gbk',
    'cp936'              : 'gbk',
    'ms936'              : 'gbk',

    # hex_codec codec
    'hex'                : 'hex_codec',

    # hp_roman8 codec
    'roman8'             : 'hp_roman8',
    'r8'                 : 'hp_roman8',
    'csHPRoman8'         : 'hp_roman8',
    'cp1051'             : 'hp_roman8',
    'ibm1051'            : 'hp_roman8',

    # hz codec
    'hzgb'               : 'hz',
    'hz_gb'              : 'hz',
    'hz_gb_2312'         : 'hz',

    # iso2022_jp codec
    'csiso2022jp'        : 'iso2022_jp',
    'iso2022jp'          : 'iso2022_jp',
    'iso_2022_jp'        : 'iso2022_jp',

    # iso2022_jp_1 codec
    'iso2022jp_1'        : 'iso2022_jp_1',
    'iso_2022_jp_1'      : 'iso2022_jp_1',

    # iso2022_jp_2 codec
    'iso2022jp_2'        : 'iso2022_jp_2',
    'iso_2022_jp_2'      : 'iso2022_jp_2',

    # iso2022_jp_2004 codec
    'iso_2022_jp_2004'   : 'iso2022_jp_2004',
    'iso2022jp_2004'     : 'iso2022_jp_2004',

    # iso2022_jp_3 codec
    'iso2022jp_3'        : 'iso2022_jp_3',
    'iso_2022_jp_3'      : 'iso2022_jp_3',

    # iso2022_jp_ext codec
    'iso2022jp_ext'      : 'iso2022_jp_ext',
    'iso_2022_jp_ext'    : 'iso2022_jp_ext',

    # iso2022_kr codec
    'csiso2022kr'        : 'iso2022_kr',
    'iso2022kr'          : 'iso2022_kr',
    'iso_2022_kr'        : 'iso2022_kr',

    # iso8859_10 codec
    'csisolatin6'        : 'iso8859_10',
    'iso_8859_10'        : 'iso8859_10',
    'iso_8859_10_1992'   : 'iso8859_10',
    'iso_ir_157'         : 'iso8859_10',
    'l6'                 : 'iso8859_10',
    'latin6'             : 'iso8859_10',

    # iso8859_11 codec
    'thai'               : 'iso8859_11',
    'iso_8859_11'        : 'iso8859_11',
    'iso_8859_11_2001'   : 'iso8859_11',

    # iso8859_13 codec
    'iso_8859_13'        : 'iso8859_13',
    'l7'                 : 'iso8859_13',
    'latin7'             : 'iso8859_13',

    # iso8859_14 codec
    'iso_8859_14'        : 'iso8859_14',
    'iso_8859_14_1998'   : 'iso8859_14',
    'iso_celtic'         : 'iso8859_14',
    'iso_ir_199'         : 'iso8859_14',
    'l8'                 : 'iso8859_14',
    'latin8'             : 'iso8859_14',

    # iso8859_15 codec
    'iso_8859_15'        : 'iso8859_15',
    'l9'                 : 'iso8859_15',
    'latin9'             : 'iso8859_15',

    # iso8859_16 codec
    'iso_8859_16'        : 'iso8859_16',
    'iso_8859_16_2001'   : 'iso8859_16',
    'iso_ir_226'         : 'iso8859_16',
    'l10'                : 'iso8859_16',
    'latin10'            : 'iso8859_16',

    # iso8859_2 codec
    'csisolatin2'        : 'iso8859_2',
    'iso_8859_2'         : 'iso8859_2',
    'iso_8859_2_1987'    : 'iso8859_2',
    'iso_ir_101'         : 'iso8859_2',
    'l2'                 : 'iso8859_2',
    'latin2'             : 'iso8859_2',

    # iso8859_3 codec
    'csisolatin3'        : 'iso8859_3',
    'iso_8859_3'         : 'iso8859_3',
    'iso_8859_3_1988'    : 'iso8859_3',
    'iso_ir_109'         : 'iso8859_3',
    'l3'                 : 'iso8859_3',
    'latin3'             : 'iso8859_3',

    # iso8859_4 codec
    'csisolatin4'        : 'iso8859_4',
    'iso_8859_4'         : 'iso8859_4',
    'iso_8859_4_1988'    : 'iso8859_4',
    'iso_ir_110'         : 'iso8859_4',
    'l4'                 : 'iso8859_4',
    'latin4'             : 'iso8859_4',

    # iso8859_5 codec
    'csisolatincyrillic' : 'iso8859_5',
    'cyrillic'           : 'iso8859_5',
    'iso_8859_5'         : 'iso8859_5',
    'iso_8859_5_1988'    : 'iso8859_5',
    'iso_ir_144'         : 'iso8859_5',

    # iso8859_6 codec
    'arabic'             : 'iso8859_6',
    'asmo_708'           : 'iso8859_6',
    'csisolatinarabic'   : 'iso8859_6',
    'ecma_114'           : 'iso8859_6',
    'iso_8859_6'         : 'iso8859_6',
    'iso_8859_6_1987'    : 'iso8859_6',
    'iso_ir_127'         : 'iso8859_6',

    # iso8859_7 codec
    'csisolatingreek'    : 'iso8859_7',
    'ecma_118'           : 'iso8859_7',
    'elot_928'           : 'iso8859_7',
    'greek'              : 'iso8859_7',
    'greek8'             : 'iso8859_7',
    'iso_8859_7'         : 'iso8859_7',
    'iso_8859_7_1987'    : 'iso8859_7',
    'iso_ir_126'         : 'iso8859_7',

    # iso8859_8 codec
    'csisolatinhebrew'   : 'iso8859_8',
    'hebrew'             : 'iso8859_8',
    'iso_8859_8'         : 'iso8859_8',
    'iso_8859_8_1988'    : 'iso8859_8',
    'iso_ir_138'         : 'iso8859_8',

    # iso8859_9 codec
    'csisolatin5'        : 'iso8859_9',
    'iso_8859_9'         : 'iso8859_9',
    'iso_8859_9_1989'    : 'iso8859_9',
    'iso_ir_148'         : 'iso8859_9',
    'l5'                 : 'iso8859_9',
    'latin5'             : 'iso8859_9',

    # johab codec
    'cp1361'             : 'johab',
    'ms1361'             : 'johab',

    # koi8_r codec
    'cskoi8r'            : 'koi8_r',

    # kz1048 codec
    'kz_1048'           : 'kz1048',
    'rk1048'            : 'kz1048',
    'strk1048_2002'     : 'kz1048',

    # latin_1 codec
    #
    # Note that the latin_1 codec is implemented internally in C and a
    # lot faster than the charmap codec iso8859_1 which uses the same
    # encoding. This is why we discourage the use of the iso8859_1
    # codec and alias it to latin_1 instead.
    #
    '8859'               : 'latin_1',
    'cp819'              : 'latin_1',
    'csisolatin1'        : 'latin_1',
    'ibm819'             : 'latin_1',
    'iso8859'            : 'latin_1',
    'iso8859_1'          : 'latin_1',
    'iso_8859_1'         : 'latin_1',
    'iso_8859_1_1987'    : 'latin_1',
    'iso_ir_100'         : 'latin_1',
    'l1'                 : 'latin_1',
    'latin'              : 'latin_1',
    'latin1'             : 'latin_1',

    # mac_cyrillic codec
    'maccyrillic'        : 'mac_cyrillic',

    # mac_greek codec
    'macgreek'           : 'mac_greek',

    # mac_iceland codec
    'maciceland'         : 'mac_iceland',

    # mac_latin2 codec
    'maccentraleurope'   : 'mac_latin2',
    'maclatin2'          : 'mac_latin2',

    # mac_roman codec
    'macintosh'          : 'mac_roman',
    'macroman'           : 'mac_roman',

    # mac_turkish codec
    'macturkish'         : 'mac_turkish',

    # mbcs codec
    'ansi'               : 'mbcs',
    'dbcs'               : 'mbcs',

    # ptcp154 codec
    'csptcp154'          : 'ptcp154',
    'pt154'              : 'ptcp154',
    'cp154'              : 'ptcp154',
    'cyrillic_asian'     : 'ptcp154',

    # quopri_codec codec
    'quopri'             : 'quopri_codec',
    'quoted_printable'   : 'quopri_codec',
    'quotedprintable'    : 'quopri_codec',

    # rot_13 codec
    'rot13'              : 'rot_13',

    # shift_jis codec
    'csshiftjis'         : 'shift_jis',
    'shiftjis'           : 'shift_jis',
    'sjis'               : 'shift_jis',
    's_jis'              : 'shift_jis',

    # shift_jis_2004 codec
    'shiftjis2004'       : 'shift_jis_2004',
    'sjis_2004'          : 'shift_jis_2004',
    's_jis_2004'         : 'shift_jis_2004',

    # shift_jisx0213 codec
    'shiftjisx0213'      : 'shift_jisx0213',
    'sjisx0213'          : 'shift_jisx0213',
    's_jisx0213'         : 'shift_jisx0213',

    # tactis codec
    'tis260'             : 'tactis',

    # tis_620 codec
    'tis620'             : 'tis_620',
    'tis_620_0'          : 'tis_620',
    'tis_620_2529_0'     : 'tis_620',
    'tis_620_2529_1'     : 'tis_620',
    'iso_ir_166'         : 'tis_620',

    # utf_16 codec
    'u16'                : 'utf_16',
    'utf16'              : 'utf_16',

    # utf_16_be codec
    'unicodebigunmarked' : 'utf_16_be',
    'utf_16be'           : 'utf_16_be',

    # utf_16_le codec
    'unicodelittleunmarked' : 'utf_16_le',
    'utf_16le'           : 'utf_16_le',

    # utf_32 codec
    'u32'                : 'utf_32',
    'utf32'              : 'utf_32',

    # utf_32_be codec
    'utf_32be'           : 'utf_32_be',

    # utf_32_le codec
    'utf_32le'           : 'utf_32_le',

    # utf_7 codec
    'u7'                 : 'utf_7',
    'utf7'               : 'utf_7',
    'unicode_1_1_utf_7'  : 'utf_7',

    # utf_8 codec
    'u8'                 : 'utf_8',
    'utf'                : 'utf_8',
    'utf8'               : 'utf_8',
    'utf8_ucs2'          : 'utf_8',
    'utf8_ucs4'          : 'utf_8',
    'cp65001'            : 'utf_8',

    # uu_codec codec
    'uu'                 : 'uu_codec',

    # zlib_codec codec
    'zip'                : 'zlib_codec',
    'zlib'               : 'zlib_codec',

    # temporary mac CJK aliases, will be replaced by proper codecs in 3.1
    'x_mac_japanese'      : 'shift_jis',
    'x_mac_korean'        : 'euc_kr',
    'x_mac_simp_chinese'  : 'gb2312',
    'x_mac_trad_chinese'  : 'big5',
}
encodings/big5.py000064400000001773151153537630007736 0ustar00#
# big5.py: Python Unicode Codec for BIG5
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#

import _codecs_tw, codecs
import _multibytecodec as mbc

codec = _codecs_tw.getcodec('big5')

class Codec(codecs.Codec):
    encode = codec.encode
    decode = codec.decode

class IncrementalEncoder(mbc.MultibyteIncrementalEncoder,
                         codecs.IncrementalEncoder):
    codec = codec

class IncrementalDecoder(mbc.MultibyteIncrementalDecoder,
                         codecs.IncrementalDecoder):
    codec = codec

class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader):
    codec = codec

class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
    codec = codec

def getregentry():
    return codecs.CodecInfo(
        name='big5',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/utf_16.py000064400000012164151153537630010210 0ustar00""" Python 'utf-16' Codec


Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

"""
import codecs, sys

### Codec APIs

encode = codecs.utf_16_encode

def decode(input, errors='strict'):
    return codecs.utf_16_decode(input, errors, True)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def __init__(self, errors='strict'):
        codecs.IncrementalEncoder.__init__(self, errors)
        self.encoder = None

    def encode(self, input, final=False):
        if self.encoder is None:
            result = codecs.utf_16_encode(input, self.errors)[0]
            if sys.byteorder == 'little':
                self.encoder = codecs.utf_16_le_encode
            else:
                self.encoder = codecs.utf_16_be_encode
            return result
        return self.encoder(input, self.errors)[0]

    def reset(self):
        codecs.IncrementalEncoder.reset(self)
        self.encoder = None

    def getstate(self):
        # state info we return to the caller:
        # 0: stream is in natural order for this platform
        # 2: endianness hasn't been determined yet
        # (we're never writing in unnatural order)
        return (2 if self.encoder is None else 0)

    def setstate(self, state):
        if state:
            self.encoder = None
        else:
            if sys.byteorder == 'little':
                self.encoder = codecs.utf_16_le_encode
            else:
                self.encoder = codecs.utf_16_be_encode

class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
    def __init__(self, errors='strict'):
        codecs.BufferedIncrementalDecoder.__init__(self, errors)
        self.decoder = None

    def _buffer_decode(self, input, errors, final):
        if self.decoder is None:
            (output, consumed, byteorder) = \
                codecs.utf_16_ex_decode(input, errors, 0, final)
            if byteorder == -1:
                self.decoder = codecs.utf_16_le_decode
            elif byteorder == 1:
                self.decoder = codecs.utf_16_be_decode
            elif consumed >= 2:
                raise UnicodeError("UTF-16 stream does not start with BOM")
            return (output, consumed)
        return self.decoder(input, self.errors, final)

    def reset(self):
        codecs.BufferedIncrementalDecoder.reset(self)
        self.decoder = None

    def getstate(self):
        # additional state info from the base class must be None here,
        # as it isn't passed along to the caller
        state = codecs.BufferedIncrementalDecoder.getstate(self)[0]
        # additional state info we pass to the caller:
        # 0: stream is in natural order for this platform
        # 1: stream is in unnatural order
        # 2: endianness hasn't been determined yet
        if self.decoder is None:
            return (state, 2)
        addstate = int((sys.byteorder == "big") !=
                       (self.decoder is codecs.utf_16_be_decode))
        return (state, addstate)

    def setstate(self, state):
        # state[1] will be ignored by BufferedIncrementalDecoder.setstate()
        codecs.BufferedIncrementalDecoder.setstate(self, state)
        state = state[1]
        if state == 0:
            self.decoder = (codecs.utf_16_be_decode
                            if sys.byteorder == "big"
                            else codecs.utf_16_le_decode)
        elif state == 1:
            self.decoder = (codecs.utf_16_le_decode
                            if sys.byteorder == "big"
                            else codecs.utf_16_be_decode)
        else:
            self.decoder = None

class StreamWriter(codecs.StreamWriter):
    def __init__(self, stream, errors='strict'):
        codecs.StreamWriter.__init__(self, stream, errors)
        self.encoder = None

    def reset(self):
        codecs.StreamWriter.reset(self)
        self.encoder = None

    def encode(self, input, errors='strict'):
        if self.encoder is None:
            result = codecs.utf_16_encode(input, errors)
            if sys.byteorder == 'little':
                self.encoder = codecs.utf_16_le_encode
            else:
                self.encoder = codecs.utf_16_be_encode
            return result
        else:
            return self.encoder(input, errors)

class StreamReader(codecs.StreamReader):

    def reset(self):
        codecs.StreamReader.reset(self)
        try:
            del self.decode
        except AttributeError:
            pass

    def decode(self, input, errors='strict'):
        (object, consumed, byteorder) = \
            codecs.utf_16_ex_decode(input, errors, 0, False)
        if byteorder == -1:
            self.decode = codecs.utf_16_le_decode
        elif byteorder == 1:
            self.decode = codecs.utf_16_be_decode
        elif consumed>=2:
            raise UnicodeError("UTF-16 stream does not start with BOM")
        return (object, consumed)

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='utf-16',
        encode=encode,
        decode=decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/utf_32_be.py000064400000001642151153537630010653 0ustar00"""
Python 'utf-32-be' Codec
"""
import codecs

### Codec APIs

encode = codecs.utf_32_be_encode

def decode(input, errors='strict'):
    return codecs.utf_32_be_decode(input, errors, True)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.utf_32_be_encode(input, self.errors)[0]

class IncrementalDecoder(codecs.BufferedIncrementalDecoder):
    _buffer_decode = codecs.utf_32_be_decode

class StreamWriter(codecs.StreamWriter):
    encode = codecs.utf_32_be_encode

class StreamReader(codecs.StreamReader):
    decode = codecs.utf_32_be_decode

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='utf-32-be',
        encode=encode,
        decode=decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/mac_croatian.py000064400000032501151153537630011521 0ustar00""" Python Character Mapping Codec mac_croatian generated from 'MAPPINGS/VENDORS/APPLE/CROATIAN.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='mac-croatian',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> CONTROL CHARACTER
    '\x01'     #  0x01 -> CONTROL CHARACTER
    '\x02'     #  0x02 -> CONTROL CHARACTER
    '\x03'     #  0x03 -> CONTROL CHARACTER
    '\x04'     #  0x04 -> CONTROL CHARACTER
    '\x05'     #  0x05 -> CONTROL CHARACTER
    '\x06'     #  0x06 -> CONTROL CHARACTER
    '\x07'     #  0x07 -> CONTROL CHARACTER
    '\x08'     #  0x08 -> CONTROL CHARACTER
    '\t'       #  0x09 -> CONTROL CHARACTER
    '\n'       #  0x0A -> CONTROL CHARACTER
    '\x0b'     #  0x0B -> CONTROL CHARACTER
    '\x0c'     #  0x0C -> CONTROL CHARACTER
    '\r'       #  0x0D -> CONTROL CHARACTER
    '\x0e'     #  0x0E -> CONTROL CHARACTER
    '\x0f'     #  0x0F -> CONTROL CHARACTER
    '\x10'     #  0x10 -> CONTROL CHARACTER
    '\x11'     #  0x11 -> CONTROL CHARACTER
    '\x12'     #  0x12 -> CONTROL CHARACTER
    '\x13'     #  0x13 -> CONTROL CHARACTER
    '\x14'     #  0x14 -> CONTROL CHARACTER
    '\x15'     #  0x15 -> CONTROL CHARACTER
    '\x16'     #  0x16 -> CONTROL CHARACTER
    '\x17'     #  0x17 -> CONTROL CHARACTER
    '\x18'     #  0x18 -> CONTROL CHARACTER
    '\x19'     #  0x19 -> CONTROL CHARACTER
    '\x1a'     #  0x1A -> CONTROL CHARACTER
    '\x1b'     #  0x1B -> CONTROL CHARACTER
    '\x1c'     #  0x1C -> CONTROL CHARACTER
    '\x1d'     #  0x1D -> CONTROL CHARACTER
    '\x1e'     #  0x1E -> CONTROL CHARACTER
    '\x1f'     #  0x1F -> CONTROL CHARACTER
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> CONTROL CHARACTER
    '\xc4'     #  0x80 -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\xc5'     #  0x81 -> LATIN CAPITAL LETTER A WITH RING ABOVE
    '\xc7'     #  0x82 -> LATIN CAPITAL LETTER C WITH CEDILLA
    '\xc9'     #  0x83 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\xd1'     #  0x84 -> LATIN CAPITAL LETTER N WITH TILDE
    '\xd6'     #  0x85 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xdc'     #  0x86 -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\xe1'     #  0x87 -> LATIN SMALL LETTER A WITH ACUTE
    '\xe0'     #  0x88 -> LATIN SMALL LETTER A WITH GRAVE
    '\xe2'     #  0x89 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\xe4'     #  0x8A -> LATIN SMALL LETTER A WITH DIAERESIS
    '\xe3'     #  0x8B -> LATIN SMALL LETTER A WITH TILDE
    '\xe5'     #  0x8C -> LATIN SMALL LETTER A WITH RING ABOVE
    '\xe7'     #  0x8D -> LATIN SMALL LETTER C WITH CEDILLA
    '\xe9'     #  0x8E -> LATIN SMALL LETTER E WITH ACUTE
    '\xe8'     #  0x8F -> LATIN SMALL LETTER E WITH GRAVE
    '\xea'     #  0x90 -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xeb'     #  0x91 -> LATIN SMALL LETTER E WITH DIAERESIS
    '\xed'     #  0x92 -> LATIN SMALL LETTER I WITH ACUTE
    '\xec'     #  0x93 -> LATIN SMALL LETTER I WITH GRAVE
    '\xee'     #  0x94 -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\xef'     #  0x95 -> LATIN SMALL LETTER I WITH DIAERESIS
    '\xf1'     #  0x96 -> LATIN SMALL LETTER N WITH TILDE
    '\xf3'     #  0x97 -> LATIN SMALL LETTER O WITH ACUTE
    '\xf2'     #  0x98 -> LATIN SMALL LETTER O WITH GRAVE
    '\xf4'     #  0x99 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xf6'     #  0x9A -> LATIN SMALL LETTER O WITH DIAERESIS
    '\xf5'     #  0x9B -> LATIN SMALL LETTER O WITH TILDE
    '\xfa'     #  0x9C -> LATIN SMALL LETTER U WITH ACUTE
    '\xf9'     #  0x9D -> LATIN SMALL LETTER U WITH GRAVE
    '\xfb'     #  0x9E -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\xfc'     #  0x9F -> LATIN SMALL LETTER U WITH DIAERESIS
    '\u2020'   #  0xA0 -> DAGGER
    '\xb0'     #  0xA1 -> DEGREE SIGN
    '\xa2'     #  0xA2 -> CENT SIGN
    '\xa3'     #  0xA3 -> POUND SIGN
    '\xa7'     #  0xA4 -> SECTION SIGN
    '\u2022'   #  0xA5 -> BULLET
    '\xb6'     #  0xA6 -> PILCROW SIGN
    '\xdf'     #  0xA7 -> LATIN SMALL LETTER SHARP S
    '\xae'     #  0xA8 -> REGISTERED SIGN
    '\u0160'   #  0xA9 -> LATIN CAPITAL LETTER S WITH CARON
    '\u2122'   #  0xAA -> TRADE MARK SIGN
    '\xb4'     #  0xAB -> ACUTE ACCENT
    '\xa8'     #  0xAC -> DIAERESIS
    '\u2260'   #  0xAD -> NOT EQUAL TO
    '\u017d'   #  0xAE -> LATIN CAPITAL LETTER Z WITH CARON
    '\xd8'     #  0xAF -> LATIN CAPITAL LETTER O WITH STROKE
    '\u221e'   #  0xB0 -> INFINITY
    '\xb1'     #  0xB1 -> PLUS-MINUS SIGN
    '\u2264'   #  0xB2 -> LESS-THAN OR EQUAL TO
    '\u2265'   #  0xB3 -> GREATER-THAN OR EQUAL TO
    '\u2206'   #  0xB4 -> INCREMENT
    '\xb5'     #  0xB5 -> MICRO SIGN
    '\u2202'   #  0xB6 -> PARTIAL DIFFERENTIAL
    '\u2211'   #  0xB7 -> N-ARY SUMMATION
    '\u220f'   #  0xB8 -> N-ARY PRODUCT
    '\u0161'   #  0xB9 -> LATIN SMALL LETTER S WITH CARON
    '\u222b'   #  0xBA -> INTEGRAL
    '\xaa'     #  0xBB -> FEMININE ORDINAL INDICATOR
    '\xba'     #  0xBC -> MASCULINE ORDINAL INDICATOR
    '\u03a9'   #  0xBD -> GREEK CAPITAL LETTER OMEGA
    '\u017e'   #  0xBE -> LATIN SMALL LETTER Z WITH CARON
    '\xf8'     #  0xBF -> LATIN SMALL LETTER O WITH STROKE
    '\xbf'     #  0xC0 -> INVERTED QUESTION MARK
    '\xa1'     #  0xC1 -> INVERTED EXCLAMATION MARK
    '\xac'     #  0xC2 -> NOT SIGN
    '\u221a'   #  0xC3 -> SQUARE ROOT
    '\u0192'   #  0xC4 -> LATIN SMALL LETTER F WITH HOOK
    '\u2248'   #  0xC5 -> ALMOST EQUAL TO
    '\u0106'   #  0xC6 -> LATIN CAPITAL LETTER C WITH ACUTE
    '\xab'     #  0xC7 -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u010c'   #  0xC8 -> LATIN CAPITAL LETTER C WITH CARON
    '\u2026'   #  0xC9 -> HORIZONTAL ELLIPSIS
    '\xa0'     #  0xCA -> NO-BREAK SPACE
    '\xc0'     #  0xCB -> LATIN CAPITAL LETTER A WITH GRAVE
    '\xc3'     #  0xCC -> LATIN CAPITAL LETTER A WITH TILDE
    '\xd5'     #  0xCD -> LATIN CAPITAL LETTER O WITH TILDE
    '\u0152'   #  0xCE -> LATIN CAPITAL LIGATURE OE
    '\u0153'   #  0xCF -> LATIN SMALL LIGATURE OE
    '\u0110'   #  0xD0 -> LATIN CAPITAL LETTER D WITH STROKE
    '\u2014'   #  0xD1 -> EM DASH
    '\u201c'   #  0xD2 -> LEFT DOUBLE QUOTATION MARK
    '\u201d'   #  0xD3 -> RIGHT DOUBLE QUOTATION MARK
    '\u2018'   #  0xD4 -> LEFT SINGLE QUOTATION MARK
    '\u2019'   #  0xD5 -> RIGHT SINGLE QUOTATION MARK
    '\xf7'     #  0xD6 -> DIVISION SIGN
    '\u25ca'   #  0xD7 -> LOZENGE
    '\uf8ff'   #  0xD8 -> Apple logo
    '\xa9'     #  0xD9 -> COPYRIGHT SIGN
    '\u2044'   #  0xDA -> FRACTION SLASH
    '\u20ac'   #  0xDB -> EURO SIGN
    '\u2039'   #  0xDC -> SINGLE LEFT-POINTING ANGLE QUOTATION MARK
    '\u203a'   #  0xDD -> SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
    '\xc6'     #  0xDE -> LATIN CAPITAL LETTER AE
    '\xbb'     #  0xDF -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u2013'   #  0xE0 -> EN DASH
    '\xb7'     #  0xE1 -> MIDDLE DOT
    '\u201a'   #  0xE2 -> SINGLE LOW-9 QUOTATION MARK
    '\u201e'   #  0xE3 -> DOUBLE LOW-9 QUOTATION MARK
    '\u2030'   #  0xE4 -> PER MILLE SIGN
    '\xc2'     #  0xE5 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    '\u0107'   #  0xE6 -> LATIN SMALL LETTER C WITH ACUTE
    '\xc1'     #  0xE7 -> LATIN CAPITAL LETTER A WITH ACUTE
    '\u010d'   #  0xE8 -> LATIN SMALL LETTER C WITH CARON
    '\xc8'     #  0xE9 -> LATIN CAPITAL LETTER E WITH GRAVE
    '\xcd'     #  0xEA -> LATIN CAPITAL LETTER I WITH ACUTE
    '\xce'     #  0xEB -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    '\xcf'     #  0xEC -> LATIN CAPITAL LETTER I WITH DIAERESIS
    '\xcc'     #  0xED -> LATIN CAPITAL LETTER I WITH GRAVE
    '\xd3'     #  0xEE -> LATIN CAPITAL LETTER O WITH ACUTE
    '\xd4'     #  0xEF -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    '\u0111'   #  0xF0 -> LATIN SMALL LETTER D WITH STROKE
    '\xd2'     #  0xF1 -> LATIN CAPITAL LETTER O WITH GRAVE
    '\xda'     #  0xF2 -> LATIN CAPITAL LETTER U WITH ACUTE
    '\xdb'     #  0xF3 -> LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    '\xd9'     #  0xF4 -> LATIN CAPITAL LETTER U WITH GRAVE
    '\u0131'   #  0xF5 -> LATIN SMALL LETTER DOTLESS I
    '\u02c6'   #  0xF6 -> MODIFIER LETTER CIRCUMFLEX ACCENT
    '\u02dc'   #  0xF7 -> SMALL TILDE
    '\xaf'     #  0xF8 -> MACRON
    '\u03c0'   #  0xF9 -> GREEK SMALL LETTER PI
    '\xcb'     #  0xFA -> LATIN CAPITAL LETTER E WITH DIAERESIS
    '\u02da'   #  0xFB -> RING ABOVE
    '\xb8'     #  0xFC -> CEDILLA
    '\xca'     #  0xFD -> LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    '\xe6'     #  0xFE -> LATIN SMALL LETTER AE
    '\u02c7'   #  0xFF -> CARON
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/cp860.py000064400000103571151153537630007747 0ustar00""" Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP860.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_map)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_map)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='cp860',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )

### Decoding Map

decoding_map = codecs.make_identity_dict(range(256))
decoding_map.update({
    0x0080: 0x00c7,     #  LATIN CAPITAL LETTER C WITH CEDILLA
    0x0081: 0x00fc,     #  LATIN SMALL LETTER U WITH DIAERESIS
    0x0082: 0x00e9,     #  LATIN SMALL LETTER E WITH ACUTE
    0x0083: 0x00e2,     #  LATIN SMALL LETTER A WITH CIRCUMFLEX
    0x0084: 0x00e3,     #  LATIN SMALL LETTER A WITH TILDE
    0x0085: 0x00e0,     #  LATIN SMALL LETTER A WITH GRAVE
    0x0086: 0x00c1,     #  LATIN CAPITAL LETTER A WITH ACUTE
    0x0087: 0x00e7,     #  LATIN SMALL LETTER C WITH CEDILLA
    0x0088: 0x00ea,     #  LATIN SMALL LETTER E WITH CIRCUMFLEX
    0x0089: 0x00ca,     #  LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    0x008a: 0x00e8,     #  LATIN SMALL LETTER E WITH GRAVE
    0x008b: 0x00cd,     #  LATIN CAPITAL LETTER I WITH ACUTE
    0x008c: 0x00d4,     #  LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    0x008d: 0x00ec,     #  LATIN SMALL LETTER I WITH GRAVE
    0x008e: 0x00c3,     #  LATIN CAPITAL LETTER A WITH TILDE
    0x008f: 0x00c2,     #  LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    0x0090: 0x00c9,     #  LATIN CAPITAL LETTER E WITH ACUTE
    0x0091: 0x00c0,     #  LATIN CAPITAL LETTER A WITH GRAVE
    0x0092: 0x00c8,     #  LATIN CAPITAL LETTER E WITH GRAVE
    0x0093: 0x00f4,     #  LATIN SMALL LETTER O WITH CIRCUMFLEX
    0x0094: 0x00f5,     #  LATIN SMALL LETTER O WITH TILDE
    0x0095: 0x00f2,     #  LATIN SMALL LETTER O WITH GRAVE
    0x0096: 0x00da,     #  LATIN CAPITAL LETTER U WITH ACUTE
    0x0097: 0x00f9,     #  LATIN SMALL LETTER U WITH GRAVE
    0x0098: 0x00cc,     #  LATIN CAPITAL LETTER I WITH GRAVE
    0x0099: 0x00d5,     #  LATIN CAPITAL LETTER O WITH TILDE
    0x009a: 0x00dc,     #  LATIN CAPITAL LETTER U WITH DIAERESIS
    0x009b: 0x00a2,     #  CENT SIGN
    0x009c: 0x00a3,     #  POUND SIGN
    0x009d: 0x00d9,     #  LATIN CAPITAL LETTER U WITH GRAVE
    0x009e: 0x20a7,     #  PESETA SIGN
    0x009f: 0x00d3,     #  LATIN CAPITAL LETTER O WITH ACUTE
    0x00a0: 0x00e1,     #  LATIN SMALL LETTER A WITH ACUTE
    0x00a1: 0x00ed,     #  LATIN SMALL LETTER I WITH ACUTE
    0x00a2: 0x00f3,     #  LATIN SMALL LETTER O WITH ACUTE
    0x00a3: 0x00fa,     #  LATIN SMALL LETTER U WITH ACUTE
    0x00a4: 0x00f1,     #  LATIN SMALL LETTER N WITH TILDE
    0x00a5: 0x00d1,     #  LATIN CAPITAL LETTER N WITH TILDE
    0x00a6: 0x00aa,     #  FEMININE ORDINAL INDICATOR
    0x00a7: 0x00ba,     #  MASCULINE ORDINAL INDICATOR
    0x00a8: 0x00bf,     #  INVERTED QUESTION MARK
    0x00a9: 0x00d2,     #  LATIN CAPITAL LETTER O WITH GRAVE
    0x00aa: 0x00ac,     #  NOT SIGN
    0x00ab: 0x00bd,     #  VULGAR FRACTION ONE HALF
    0x00ac: 0x00bc,     #  VULGAR FRACTION ONE QUARTER
    0x00ad: 0x00a1,     #  INVERTED EXCLAMATION MARK
    0x00ae: 0x00ab,     #  LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00af: 0x00bb,     #  RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00b0: 0x2591,     #  LIGHT SHADE
    0x00b1: 0x2592,     #  MEDIUM SHADE
    0x00b2: 0x2593,     #  DARK SHADE
    0x00b3: 0x2502,     #  BOX DRAWINGS LIGHT VERTICAL
    0x00b4: 0x2524,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
    0x00b5: 0x2561,     #  BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
    0x00b6: 0x2562,     #  BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
    0x00b7: 0x2556,     #  BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
    0x00b8: 0x2555,     #  BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
    0x00b9: 0x2563,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    0x00ba: 0x2551,     #  BOX DRAWINGS DOUBLE VERTICAL
    0x00bb: 0x2557,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
    0x00bc: 0x255d,     #  BOX DRAWINGS DOUBLE UP AND LEFT
    0x00bd: 0x255c,     #  BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
    0x00be: 0x255b,     #  BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
    0x00bf: 0x2510,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
    0x00c0: 0x2514,     #  BOX DRAWINGS LIGHT UP AND RIGHT
    0x00c1: 0x2534,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
    0x00c2: 0x252c,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    0x00c3: 0x251c,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    0x00c4: 0x2500,     #  BOX DRAWINGS LIGHT HORIZONTAL
    0x00c5: 0x253c,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    0x00c6: 0x255e,     #  BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
    0x00c7: 0x255f,     #  BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
    0x00c8: 0x255a,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
    0x00c9: 0x2554,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
    0x00ca: 0x2569,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    0x00cb: 0x2566,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    0x00cc: 0x2560,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    0x00cd: 0x2550,     #  BOX DRAWINGS DOUBLE HORIZONTAL
    0x00ce: 0x256c,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    0x00cf: 0x2567,     #  BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
    0x00d0: 0x2568,     #  BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
    0x00d1: 0x2564,     #  BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
    0x00d2: 0x2565,     #  BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
    0x00d3: 0x2559,     #  BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
    0x00d4: 0x2558,     #  BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
    0x00d5: 0x2552,     #  BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
    0x00d6: 0x2553,     #  BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
    0x00d7: 0x256b,     #  BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
    0x00d8: 0x256a,     #  BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
    0x00d9: 0x2518,     #  BOX DRAWINGS LIGHT UP AND LEFT
    0x00da: 0x250c,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
    0x00db: 0x2588,     #  FULL BLOCK
    0x00dc: 0x2584,     #  LOWER HALF BLOCK
    0x00dd: 0x258c,     #  LEFT HALF BLOCK
    0x00de: 0x2590,     #  RIGHT HALF BLOCK
    0x00df: 0x2580,     #  UPPER HALF BLOCK
    0x00e0: 0x03b1,     #  GREEK SMALL LETTER ALPHA
    0x00e1: 0x00df,     #  LATIN SMALL LETTER SHARP S
    0x00e2: 0x0393,     #  GREEK CAPITAL LETTER GAMMA
    0x00e3: 0x03c0,     #  GREEK SMALL LETTER PI
    0x00e4: 0x03a3,     #  GREEK CAPITAL LETTER SIGMA
    0x00e5: 0x03c3,     #  GREEK SMALL LETTER SIGMA
    0x00e6: 0x00b5,     #  MICRO SIGN
    0x00e7: 0x03c4,     #  GREEK SMALL LETTER TAU
    0x00e8: 0x03a6,     #  GREEK CAPITAL LETTER PHI
    0x00e9: 0x0398,     #  GREEK CAPITAL LETTER THETA
    0x00ea: 0x03a9,     #  GREEK CAPITAL LETTER OMEGA
    0x00eb: 0x03b4,     #  GREEK SMALL LETTER DELTA
    0x00ec: 0x221e,     #  INFINITY
    0x00ed: 0x03c6,     #  GREEK SMALL LETTER PHI
    0x00ee: 0x03b5,     #  GREEK SMALL LETTER EPSILON
    0x00ef: 0x2229,     #  INTERSECTION
    0x00f0: 0x2261,     #  IDENTICAL TO
    0x00f1: 0x00b1,     #  PLUS-MINUS SIGN
    0x00f2: 0x2265,     #  GREATER-THAN OR EQUAL TO
    0x00f3: 0x2264,     #  LESS-THAN OR EQUAL TO
    0x00f4: 0x2320,     #  TOP HALF INTEGRAL
    0x00f5: 0x2321,     #  BOTTOM HALF INTEGRAL
    0x00f6: 0x00f7,     #  DIVISION SIGN
    0x00f7: 0x2248,     #  ALMOST EQUAL TO
    0x00f8: 0x00b0,     #  DEGREE SIGN
    0x00f9: 0x2219,     #  BULLET OPERATOR
    0x00fa: 0x00b7,     #  MIDDLE DOT
    0x00fb: 0x221a,     #  SQUARE ROOT
    0x00fc: 0x207f,     #  SUPERSCRIPT LATIN SMALL LETTER N
    0x00fd: 0x00b2,     #  SUPERSCRIPT TWO
    0x00fe: 0x25a0,     #  BLACK SQUARE
    0x00ff: 0x00a0,     #  NO-BREAK SPACE
})

### Decoding Table

decoding_table = (
    '\x00'     #  0x0000 -> NULL
    '\x01'     #  0x0001 -> START OF HEADING
    '\x02'     #  0x0002 -> START OF TEXT
    '\x03'     #  0x0003 -> END OF TEXT
    '\x04'     #  0x0004 -> END OF TRANSMISSION
    '\x05'     #  0x0005 -> ENQUIRY
    '\x06'     #  0x0006 -> ACKNOWLEDGE
    '\x07'     #  0x0007 -> BELL
    '\x08'     #  0x0008 -> BACKSPACE
    '\t'       #  0x0009 -> HORIZONTAL TABULATION
    '\n'       #  0x000a -> LINE FEED
    '\x0b'     #  0x000b -> VERTICAL TABULATION
    '\x0c'     #  0x000c -> FORM FEED
    '\r'       #  0x000d -> CARRIAGE RETURN
    '\x0e'     #  0x000e -> SHIFT OUT
    '\x0f'     #  0x000f -> SHIFT IN
    '\x10'     #  0x0010 -> DATA LINK ESCAPE
    '\x11'     #  0x0011 -> DEVICE CONTROL ONE
    '\x12'     #  0x0012 -> DEVICE CONTROL TWO
    '\x13'     #  0x0013 -> DEVICE CONTROL THREE
    '\x14'     #  0x0014 -> DEVICE CONTROL FOUR
    '\x15'     #  0x0015 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x0016 -> SYNCHRONOUS IDLE
    '\x17'     #  0x0017 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x0018 -> CANCEL
    '\x19'     #  0x0019 -> END OF MEDIUM
    '\x1a'     #  0x001a -> SUBSTITUTE
    '\x1b'     #  0x001b -> ESCAPE
    '\x1c'     #  0x001c -> FILE SEPARATOR
    '\x1d'     #  0x001d -> GROUP SEPARATOR
    '\x1e'     #  0x001e -> RECORD SEPARATOR
    '\x1f'     #  0x001f -> UNIT SEPARATOR
    ' '        #  0x0020 -> SPACE
    '!'        #  0x0021 -> EXCLAMATION MARK
    '"'        #  0x0022 -> QUOTATION MARK
    '#'        #  0x0023 -> NUMBER SIGN
    '$'        #  0x0024 -> DOLLAR SIGN
    '%'        #  0x0025 -> PERCENT SIGN
    '&'        #  0x0026 -> AMPERSAND
    "'"        #  0x0027 -> APOSTROPHE
    '('        #  0x0028 -> LEFT PARENTHESIS
    ')'        #  0x0029 -> RIGHT PARENTHESIS
    '*'        #  0x002a -> ASTERISK
    '+'        #  0x002b -> PLUS SIGN
    ','        #  0x002c -> COMMA
    '-'        #  0x002d -> HYPHEN-MINUS
    '.'        #  0x002e -> FULL STOP
    '/'        #  0x002f -> SOLIDUS
    '0'        #  0x0030 -> DIGIT ZERO
    '1'        #  0x0031 -> DIGIT ONE
    '2'        #  0x0032 -> DIGIT TWO
    '3'        #  0x0033 -> DIGIT THREE
    '4'        #  0x0034 -> DIGIT FOUR
    '5'        #  0x0035 -> DIGIT FIVE
    '6'        #  0x0036 -> DIGIT SIX
    '7'        #  0x0037 -> DIGIT SEVEN
    '8'        #  0x0038 -> DIGIT EIGHT
    '9'        #  0x0039 -> DIGIT NINE
    ':'        #  0x003a -> COLON
    ';'        #  0x003b -> SEMICOLON
    '<'        #  0x003c -> LESS-THAN SIGN
    '='        #  0x003d -> EQUALS SIGN
    '>'        #  0x003e -> GREATER-THAN SIGN
    '?'        #  0x003f -> QUESTION MARK
    '@'        #  0x0040 -> COMMERCIAL AT
    'A'        #  0x0041 -> LATIN CAPITAL LETTER A
    'B'        #  0x0042 -> LATIN CAPITAL LETTER B
    'C'        #  0x0043 -> LATIN CAPITAL LETTER C
    'D'        #  0x0044 -> LATIN CAPITAL LETTER D
    'E'        #  0x0045 -> LATIN CAPITAL LETTER E
    'F'        #  0x0046 -> LATIN CAPITAL LETTER F
    'G'        #  0x0047 -> LATIN CAPITAL LETTER G
    'H'        #  0x0048 -> LATIN CAPITAL LETTER H
    'I'        #  0x0049 -> LATIN CAPITAL LETTER I
    'J'        #  0x004a -> LATIN CAPITAL LETTER J
    'K'        #  0x004b -> LATIN CAPITAL LETTER K
    'L'        #  0x004c -> LATIN CAPITAL LETTER L
    'M'        #  0x004d -> LATIN CAPITAL LETTER M
    'N'        #  0x004e -> LATIN CAPITAL LETTER N
    'O'        #  0x004f -> LATIN CAPITAL LETTER O
    'P'        #  0x0050 -> LATIN CAPITAL LETTER P
    'Q'        #  0x0051 -> LATIN CAPITAL LETTER Q
    'R'        #  0x0052 -> LATIN CAPITAL LETTER R
    'S'        #  0x0053 -> LATIN CAPITAL LETTER S
    'T'        #  0x0054 -> LATIN CAPITAL LETTER T
    'U'        #  0x0055 -> LATIN CAPITAL LETTER U
    'V'        #  0x0056 -> LATIN CAPITAL LETTER V
    'W'        #  0x0057 -> LATIN CAPITAL LETTER W
    'X'        #  0x0058 -> LATIN CAPITAL LETTER X
    'Y'        #  0x0059 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x005a -> LATIN CAPITAL LETTER Z
    '['        #  0x005b -> LEFT SQUARE BRACKET
    '\\'       #  0x005c -> REVERSE SOLIDUS
    ']'        #  0x005d -> RIGHT SQUARE BRACKET
    '^'        #  0x005e -> CIRCUMFLEX ACCENT
    '_'        #  0x005f -> LOW LINE
    '`'        #  0x0060 -> GRAVE ACCENT
    'a'        #  0x0061 -> LATIN SMALL LETTER A
    'b'        #  0x0062 -> LATIN SMALL LETTER B
    'c'        #  0x0063 -> LATIN SMALL LETTER C
    'd'        #  0x0064 -> LATIN SMALL LETTER D
    'e'        #  0x0065 -> LATIN SMALL LETTER E
    'f'        #  0x0066 -> LATIN SMALL LETTER F
    'g'        #  0x0067 -> LATIN SMALL LETTER G
    'h'        #  0x0068 -> LATIN SMALL LETTER H
    'i'        #  0x0069 -> LATIN SMALL LETTER I
    'j'        #  0x006a -> LATIN SMALL LETTER J
    'k'        #  0x006b -> LATIN SMALL LETTER K
    'l'        #  0x006c -> LATIN SMALL LETTER L
    'm'        #  0x006d -> LATIN SMALL LETTER M
    'n'        #  0x006e -> LATIN SMALL LETTER N
    'o'        #  0x006f -> LATIN SMALL LETTER O
    'p'        #  0x0070 -> LATIN SMALL LETTER P
    'q'        #  0x0071 -> LATIN SMALL LETTER Q
    'r'        #  0x0072 -> LATIN SMALL LETTER R
    's'        #  0x0073 -> LATIN SMALL LETTER S
    't'        #  0x0074 -> LATIN SMALL LETTER T
    'u'        #  0x0075 -> LATIN SMALL LETTER U
    'v'        #  0x0076 -> LATIN SMALL LETTER V
    'w'        #  0x0077 -> LATIN SMALL LETTER W
    'x'        #  0x0078 -> LATIN SMALL LETTER X
    'y'        #  0x0079 -> LATIN SMALL LETTER Y
    'z'        #  0x007a -> LATIN SMALL LETTER Z
    '{'        #  0x007b -> LEFT CURLY BRACKET
    '|'        #  0x007c -> VERTICAL LINE
    '}'        #  0x007d -> RIGHT CURLY BRACKET
    '~'        #  0x007e -> TILDE
    '\x7f'     #  0x007f -> DELETE
    '\xc7'     #  0x0080 -> LATIN CAPITAL LETTER C WITH CEDILLA
    '\xfc'     #  0x0081 -> LATIN SMALL LETTER U WITH DIAERESIS
    '\xe9'     #  0x0082 -> LATIN SMALL LETTER E WITH ACUTE
    '\xe2'     #  0x0083 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\xe3'     #  0x0084 -> LATIN SMALL LETTER A WITH TILDE
    '\xe0'     #  0x0085 -> LATIN SMALL LETTER A WITH GRAVE
    '\xc1'     #  0x0086 -> LATIN CAPITAL LETTER A WITH ACUTE
    '\xe7'     #  0x0087 -> LATIN SMALL LETTER C WITH CEDILLA
    '\xea'     #  0x0088 -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xca'     #  0x0089 -> LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    '\xe8'     #  0x008a -> LATIN SMALL LETTER E WITH GRAVE
    '\xcd'     #  0x008b -> LATIN CAPITAL LETTER I WITH ACUTE
    '\xd4'     #  0x008c -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    '\xec'     #  0x008d -> LATIN SMALL LETTER I WITH GRAVE
    '\xc3'     #  0x008e -> LATIN CAPITAL LETTER A WITH TILDE
    '\xc2'     #  0x008f -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    '\xc9'     #  0x0090 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\xc0'     #  0x0091 -> LATIN CAPITAL LETTER A WITH GRAVE
    '\xc8'     #  0x0092 -> LATIN CAPITAL LETTER E WITH GRAVE
    '\xf4'     #  0x0093 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xf5'     #  0x0094 -> LATIN SMALL LETTER O WITH TILDE
    '\xf2'     #  0x0095 -> LATIN SMALL LETTER O WITH GRAVE
    '\xda'     #  0x0096 -> LATIN CAPITAL LETTER U WITH ACUTE
    '\xf9'     #  0x0097 -> LATIN SMALL LETTER U WITH GRAVE
    '\xcc'     #  0x0098 -> LATIN CAPITAL LETTER I WITH GRAVE
    '\xd5'     #  0x0099 -> LATIN CAPITAL LETTER O WITH TILDE
    '\xdc'     #  0x009a -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\xa2'     #  0x009b -> CENT SIGN
    '\xa3'     #  0x009c -> POUND SIGN
    '\xd9'     #  0x009d -> LATIN CAPITAL LETTER U WITH GRAVE
    '\u20a7'   #  0x009e -> PESETA SIGN
    '\xd3'     #  0x009f -> LATIN CAPITAL LETTER O WITH ACUTE
    '\xe1'     #  0x00a0 -> LATIN SMALL LETTER A WITH ACUTE
    '\xed'     #  0x00a1 -> LATIN SMALL LETTER I WITH ACUTE
    '\xf3'     #  0x00a2 -> LATIN SMALL LETTER O WITH ACUTE
    '\xfa'     #  0x00a3 -> LATIN SMALL LETTER U WITH ACUTE
    '\xf1'     #  0x00a4 -> LATIN SMALL LETTER N WITH TILDE
    '\xd1'     #  0x00a5 -> LATIN CAPITAL LETTER N WITH TILDE
    '\xaa'     #  0x00a6 -> FEMININE ORDINAL INDICATOR
    '\xba'     #  0x00a7 -> MASCULINE ORDINAL INDICATOR
    '\xbf'     #  0x00a8 -> INVERTED QUESTION MARK
    '\xd2'     #  0x00a9 -> LATIN CAPITAL LETTER O WITH GRAVE
    '\xac'     #  0x00aa -> NOT SIGN
    '\xbd'     #  0x00ab -> VULGAR FRACTION ONE HALF
    '\xbc'     #  0x00ac -> VULGAR FRACTION ONE QUARTER
    '\xa1'     #  0x00ad -> INVERTED EXCLAMATION MARK
    '\xab'     #  0x00ae -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbb'     #  0x00af -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u2591'   #  0x00b0 -> LIGHT SHADE
    '\u2592'   #  0x00b1 -> MEDIUM SHADE
    '\u2593'   #  0x00b2 -> DARK SHADE
    '\u2502'   #  0x00b3 -> BOX DRAWINGS LIGHT VERTICAL
    '\u2524'   #  0x00b4 -> BOX DRAWINGS LIGHT VERTICAL AND LEFT
    '\u2561'   #  0x00b5 -> BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
    '\u2562'   #  0x00b6 -> BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
    '\u2556'   #  0x00b7 -> BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
    '\u2555'   #  0x00b8 -> BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
    '\u2563'   #  0x00b9 -> BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    '\u2551'   #  0x00ba -> BOX DRAWINGS DOUBLE VERTICAL
    '\u2557'   #  0x00bb -> BOX DRAWINGS DOUBLE DOWN AND LEFT
    '\u255d'   #  0x00bc -> BOX DRAWINGS DOUBLE UP AND LEFT
    '\u255c'   #  0x00bd -> BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
    '\u255b'   #  0x00be -> BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
    '\u2510'   #  0x00bf -> BOX DRAWINGS LIGHT DOWN AND LEFT
    '\u2514'   #  0x00c0 -> BOX DRAWINGS LIGHT UP AND RIGHT
    '\u2534'   #  0x00c1 -> BOX DRAWINGS LIGHT UP AND HORIZONTAL
    '\u252c'   #  0x00c2 -> BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    '\u251c'   #  0x00c3 -> BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    '\u2500'   #  0x00c4 -> BOX DRAWINGS LIGHT HORIZONTAL
    '\u253c'   #  0x00c5 -> BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    '\u255e'   #  0x00c6 -> BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
    '\u255f'   #  0x00c7 -> BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
    '\u255a'   #  0x00c8 -> BOX DRAWINGS DOUBLE UP AND RIGHT
    '\u2554'   #  0x00c9 -> BOX DRAWINGS DOUBLE DOWN AND RIGHT
    '\u2569'   #  0x00ca -> BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    '\u2566'   #  0x00cb -> BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    '\u2560'   #  0x00cc -> BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    '\u2550'   #  0x00cd -> BOX DRAWINGS DOUBLE HORIZONTAL
    '\u256c'   #  0x00ce -> BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    '\u2567'   #  0x00cf -> BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
    '\u2568'   #  0x00d0 -> BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
    '\u2564'   #  0x00d1 -> BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
    '\u2565'   #  0x00d2 -> BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
    '\u2559'   #  0x00d3 -> BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
    '\u2558'   #  0x00d4 -> BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
    '\u2552'   #  0x00d5 -> BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
    '\u2553'   #  0x00d6 -> BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
    '\u256b'   #  0x00d7 -> BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
    '\u256a'   #  0x00d8 -> BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
    '\u2518'   #  0x00d9 -> BOX DRAWINGS LIGHT UP AND LEFT
    '\u250c'   #  0x00da -> BOX DRAWINGS LIGHT DOWN AND RIGHT
    '\u2588'   #  0x00db -> FULL BLOCK
    '\u2584'   #  0x00dc -> LOWER HALF BLOCK
    '\u258c'   #  0x00dd -> LEFT HALF BLOCK
    '\u2590'   #  0x00de -> RIGHT HALF BLOCK
    '\u2580'   #  0x00df -> UPPER HALF BLOCK
    '\u03b1'   #  0x00e0 -> GREEK SMALL LETTER ALPHA
    '\xdf'     #  0x00e1 -> LATIN SMALL LETTER SHARP S
    '\u0393'   #  0x00e2 -> GREEK CAPITAL LETTER GAMMA
    '\u03c0'   #  0x00e3 -> GREEK SMALL LETTER PI
    '\u03a3'   #  0x00e4 -> GREEK CAPITAL LETTER SIGMA
    '\u03c3'   #  0x00e5 -> GREEK SMALL LETTER SIGMA
    '\xb5'     #  0x00e6 -> MICRO SIGN
    '\u03c4'   #  0x00e7 -> GREEK SMALL LETTER TAU
    '\u03a6'   #  0x00e8 -> GREEK CAPITAL LETTER PHI
    '\u0398'   #  0x00e9 -> GREEK CAPITAL LETTER THETA
    '\u03a9'   #  0x00ea -> GREEK CAPITAL LETTER OMEGA
    '\u03b4'   #  0x00eb -> GREEK SMALL LETTER DELTA
    '\u221e'   #  0x00ec -> INFINITY
    '\u03c6'   #  0x00ed -> GREEK SMALL LETTER PHI
    '\u03b5'   #  0x00ee -> GREEK SMALL LETTER EPSILON
    '\u2229'   #  0x00ef -> INTERSECTION
    '\u2261'   #  0x00f0 -> IDENTICAL TO
    '\xb1'     #  0x00f1 -> PLUS-MINUS SIGN
    '\u2265'   #  0x00f2 -> GREATER-THAN OR EQUAL TO
    '\u2264'   #  0x00f3 -> LESS-THAN OR EQUAL TO
    '\u2320'   #  0x00f4 -> TOP HALF INTEGRAL
    '\u2321'   #  0x00f5 -> BOTTOM HALF INTEGRAL
    '\xf7'     #  0x00f6 -> DIVISION SIGN
    '\u2248'   #  0x00f7 -> ALMOST EQUAL TO
    '\xb0'     #  0x00f8 -> DEGREE SIGN
    '\u2219'   #  0x00f9 -> BULLET OPERATOR
    '\xb7'     #  0x00fa -> MIDDLE DOT
    '\u221a'   #  0x00fb -> SQUARE ROOT
    '\u207f'   #  0x00fc -> SUPERSCRIPT LATIN SMALL LETTER N
    '\xb2'     #  0x00fd -> SUPERSCRIPT TWO
    '\u25a0'   #  0x00fe -> BLACK SQUARE
    '\xa0'     #  0x00ff -> NO-BREAK SPACE
)

### Encoding Map

encoding_map = {
    0x0000: 0x0000,     #  NULL
    0x0001: 0x0001,     #  START OF HEADING
    0x0002: 0x0002,     #  START OF TEXT
    0x0003: 0x0003,     #  END OF TEXT
    0x0004: 0x0004,     #  END OF TRANSMISSION
    0x0005: 0x0005,     #  ENQUIRY
    0x0006: 0x0006,     #  ACKNOWLEDGE
    0x0007: 0x0007,     #  BELL
    0x0008: 0x0008,     #  BACKSPACE
    0x0009: 0x0009,     #  HORIZONTAL TABULATION
    0x000a: 0x000a,     #  LINE FEED
    0x000b: 0x000b,     #  VERTICAL TABULATION
    0x000c: 0x000c,     #  FORM FEED
    0x000d: 0x000d,     #  CARRIAGE RETURN
    0x000e: 0x000e,     #  SHIFT OUT
    0x000f: 0x000f,     #  SHIFT IN
    0x0010: 0x0010,     #  DATA LINK ESCAPE
    0x0011: 0x0011,     #  DEVICE CONTROL ONE
    0x0012: 0x0012,     #  DEVICE CONTROL TWO
    0x0013: 0x0013,     #  DEVICE CONTROL THREE
    0x0014: 0x0014,     #  DEVICE CONTROL FOUR
    0x0015: 0x0015,     #  NEGATIVE ACKNOWLEDGE
    0x0016: 0x0016,     #  SYNCHRONOUS IDLE
    0x0017: 0x0017,     #  END OF TRANSMISSION BLOCK
    0x0018: 0x0018,     #  CANCEL
    0x0019: 0x0019,     #  END OF MEDIUM
    0x001a: 0x001a,     #  SUBSTITUTE
    0x001b: 0x001b,     #  ESCAPE
    0x001c: 0x001c,     #  FILE SEPARATOR
    0x001d: 0x001d,     #  GROUP SEPARATOR
    0x001e: 0x001e,     #  RECORD SEPARATOR
    0x001f: 0x001f,     #  UNIT SEPARATOR
    0x0020: 0x0020,     #  SPACE
    0x0021: 0x0021,     #  EXCLAMATION MARK
    0x0022: 0x0022,     #  QUOTATION MARK
    0x0023: 0x0023,     #  NUMBER SIGN
    0x0024: 0x0024,     #  DOLLAR SIGN
    0x0025: 0x0025,     #  PERCENT SIGN
    0x0026: 0x0026,     #  AMPERSAND
    0x0027: 0x0027,     #  APOSTROPHE
    0x0028: 0x0028,     #  LEFT PARENTHESIS
    0x0029: 0x0029,     #  RIGHT PARENTHESIS
    0x002a: 0x002a,     #  ASTERISK
    0x002b: 0x002b,     #  PLUS SIGN
    0x002c: 0x002c,     #  COMMA
    0x002d: 0x002d,     #  HYPHEN-MINUS
    0x002e: 0x002e,     #  FULL STOP
    0x002f: 0x002f,     #  SOLIDUS
    0x0030: 0x0030,     #  DIGIT ZERO
    0x0031: 0x0031,     #  DIGIT ONE
    0x0032: 0x0032,     #  DIGIT TWO
    0x0033: 0x0033,     #  DIGIT THREE
    0x0034: 0x0034,     #  DIGIT FOUR
    0x0035: 0x0035,     #  DIGIT FIVE
    0x0036: 0x0036,     #  DIGIT SIX
    0x0037: 0x0037,     #  DIGIT SEVEN
    0x0038: 0x0038,     #  DIGIT EIGHT
    0x0039: 0x0039,     #  DIGIT NINE
    0x003a: 0x003a,     #  COLON
    0x003b: 0x003b,     #  SEMICOLON
    0x003c: 0x003c,     #  LESS-THAN SIGN
    0x003d: 0x003d,     #  EQUALS SIGN
    0x003e: 0x003e,     #  GREATER-THAN SIGN
    0x003f: 0x003f,     #  QUESTION MARK
    0x0040: 0x0040,     #  COMMERCIAL AT
    0x0041: 0x0041,     #  LATIN CAPITAL LETTER A
    0x0042: 0x0042,     #  LATIN CAPITAL LETTER B
    0x0043: 0x0043,     #  LATIN CAPITAL LETTER C
    0x0044: 0x0044,     #  LATIN CAPITAL LETTER D
    0x0045: 0x0045,     #  LATIN CAPITAL LETTER E
    0x0046: 0x0046,     #  LATIN CAPITAL LETTER F
    0x0047: 0x0047,     #  LATIN CAPITAL LETTER G
    0x0048: 0x0048,     #  LATIN CAPITAL LETTER H
    0x0049: 0x0049,     #  LATIN CAPITAL LETTER I
    0x004a: 0x004a,     #  LATIN CAPITAL LETTER J
    0x004b: 0x004b,     #  LATIN CAPITAL LETTER K
    0x004c: 0x004c,     #  LATIN CAPITAL LETTER L
    0x004d: 0x004d,     #  LATIN CAPITAL LETTER M
    0x004e: 0x004e,     #  LATIN CAPITAL LETTER N
    0x004f: 0x004f,     #  LATIN CAPITAL LETTER O
    0x0050: 0x0050,     #  LATIN CAPITAL LETTER P
    0x0051: 0x0051,     #  LATIN CAPITAL LETTER Q
    0x0052: 0x0052,     #  LATIN CAPITAL LETTER R
    0x0053: 0x0053,     #  LATIN CAPITAL LETTER S
    0x0054: 0x0054,     #  LATIN CAPITAL LETTER T
    0x0055: 0x0055,     #  LATIN CAPITAL LETTER U
    0x0056: 0x0056,     #  LATIN CAPITAL LETTER V
    0x0057: 0x0057,     #  LATIN CAPITAL LETTER W
    0x0058: 0x0058,     #  LATIN CAPITAL LETTER X
    0x0059: 0x0059,     #  LATIN CAPITAL LETTER Y
    0x005a: 0x005a,     #  LATIN CAPITAL LETTER Z
    0x005b: 0x005b,     #  LEFT SQUARE BRACKET
    0x005c: 0x005c,     #  REVERSE SOLIDUS
    0x005d: 0x005d,     #  RIGHT SQUARE BRACKET
    0x005e: 0x005e,     #  CIRCUMFLEX ACCENT
    0x005f: 0x005f,     #  LOW LINE
    0x0060: 0x0060,     #  GRAVE ACCENT
    0x0061: 0x0061,     #  LATIN SMALL LETTER A
    0x0062: 0x0062,     #  LATIN SMALL LETTER B
    0x0063: 0x0063,     #  LATIN SMALL LETTER C
    0x0064: 0x0064,     #  LATIN SMALL LETTER D
    0x0065: 0x0065,     #  LATIN SMALL LETTER E
    0x0066: 0x0066,     #  LATIN SMALL LETTER F
    0x0067: 0x0067,     #  LATIN SMALL LETTER G
    0x0068: 0x0068,     #  LATIN SMALL LETTER H
    0x0069: 0x0069,     #  LATIN SMALL LETTER I
    0x006a: 0x006a,     #  LATIN SMALL LETTER J
    0x006b: 0x006b,     #  LATIN SMALL LETTER K
    0x006c: 0x006c,     #  LATIN SMALL LETTER L
    0x006d: 0x006d,     #  LATIN SMALL LETTER M
    0x006e: 0x006e,     #  LATIN SMALL LETTER N
    0x006f: 0x006f,     #  LATIN SMALL LETTER O
    0x0070: 0x0070,     #  LATIN SMALL LETTER P
    0x0071: 0x0071,     #  LATIN SMALL LETTER Q
    0x0072: 0x0072,     #  LATIN SMALL LETTER R
    0x0073: 0x0073,     #  LATIN SMALL LETTER S
    0x0074: 0x0074,     #  LATIN SMALL LETTER T
    0x0075: 0x0075,     #  LATIN SMALL LETTER U
    0x0076: 0x0076,     #  LATIN SMALL LETTER V
    0x0077: 0x0077,     #  LATIN SMALL LETTER W
    0x0078: 0x0078,     #  LATIN SMALL LETTER X
    0x0079: 0x0079,     #  LATIN SMALL LETTER Y
    0x007a: 0x007a,     #  LATIN SMALL LETTER Z
    0x007b: 0x007b,     #  LEFT CURLY BRACKET
    0x007c: 0x007c,     #  VERTICAL LINE
    0x007d: 0x007d,     #  RIGHT CURLY BRACKET
    0x007e: 0x007e,     #  TILDE
    0x007f: 0x007f,     #  DELETE
    0x00a0: 0x00ff,     #  NO-BREAK SPACE
    0x00a1: 0x00ad,     #  INVERTED EXCLAMATION MARK
    0x00a2: 0x009b,     #  CENT SIGN
    0x00a3: 0x009c,     #  POUND SIGN
    0x00aa: 0x00a6,     #  FEMININE ORDINAL INDICATOR
    0x00ab: 0x00ae,     #  LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00ac: 0x00aa,     #  NOT SIGN
    0x00b0: 0x00f8,     #  DEGREE SIGN
    0x00b1: 0x00f1,     #  PLUS-MINUS SIGN
    0x00b2: 0x00fd,     #  SUPERSCRIPT TWO
    0x00b5: 0x00e6,     #  MICRO SIGN
    0x00b7: 0x00fa,     #  MIDDLE DOT
    0x00ba: 0x00a7,     #  MASCULINE ORDINAL INDICATOR
    0x00bb: 0x00af,     #  RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    0x00bc: 0x00ac,     #  VULGAR FRACTION ONE QUARTER
    0x00bd: 0x00ab,     #  VULGAR FRACTION ONE HALF
    0x00bf: 0x00a8,     #  INVERTED QUESTION MARK
    0x00c0: 0x0091,     #  LATIN CAPITAL LETTER A WITH GRAVE
    0x00c1: 0x0086,     #  LATIN CAPITAL LETTER A WITH ACUTE
    0x00c2: 0x008f,     #  LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    0x00c3: 0x008e,     #  LATIN CAPITAL LETTER A WITH TILDE
    0x00c7: 0x0080,     #  LATIN CAPITAL LETTER C WITH CEDILLA
    0x00c8: 0x0092,     #  LATIN CAPITAL LETTER E WITH GRAVE
    0x00c9: 0x0090,     #  LATIN CAPITAL LETTER E WITH ACUTE
    0x00ca: 0x0089,     #  LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    0x00cc: 0x0098,     #  LATIN CAPITAL LETTER I WITH GRAVE
    0x00cd: 0x008b,     #  LATIN CAPITAL LETTER I WITH ACUTE
    0x00d1: 0x00a5,     #  LATIN CAPITAL LETTER N WITH TILDE
    0x00d2: 0x00a9,     #  LATIN CAPITAL LETTER O WITH GRAVE
    0x00d3: 0x009f,     #  LATIN CAPITAL LETTER O WITH ACUTE
    0x00d4: 0x008c,     #  LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    0x00d5: 0x0099,     #  LATIN CAPITAL LETTER O WITH TILDE
    0x00d9: 0x009d,     #  LATIN CAPITAL LETTER U WITH GRAVE
    0x00da: 0x0096,     #  LATIN CAPITAL LETTER U WITH ACUTE
    0x00dc: 0x009a,     #  LATIN CAPITAL LETTER U WITH DIAERESIS
    0x00df: 0x00e1,     #  LATIN SMALL LETTER SHARP S
    0x00e0: 0x0085,     #  LATIN SMALL LETTER A WITH GRAVE
    0x00e1: 0x00a0,     #  LATIN SMALL LETTER A WITH ACUTE
    0x00e2: 0x0083,     #  LATIN SMALL LETTER A WITH CIRCUMFLEX
    0x00e3: 0x0084,     #  LATIN SMALL LETTER A WITH TILDE
    0x00e7: 0x0087,     #  LATIN SMALL LETTER C WITH CEDILLA
    0x00e8: 0x008a,     #  LATIN SMALL LETTER E WITH GRAVE
    0x00e9: 0x0082,     #  LATIN SMALL LETTER E WITH ACUTE
    0x00ea: 0x0088,     #  LATIN SMALL LETTER E WITH CIRCUMFLEX
    0x00ec: 0x008d,     #  LATIN SMALL LETTER I WITH GRAVE
    0x00ed: 0x00a1,     #  LATIN SMALL LETTER I WITH ACUTE
    0x00f1: 0x00a4,     #  LATIN SMALL LETTER N WITH TILDE
    0x00f2: 0x0095,     #  LATIN SMALL LETTER O WITH GRAVE
    0x00f3: 0x00a2,     #  LATIN SMALL LETTER O WITH ACUTE
    0x00f4: 0x0093,     #  LATIN SMALL LETTER O WITH CIRCUMFLEX
    0x00f5: 0x0094,     #  LATIN SMALL LETTER O WITH TILDE
    0x00f7: 0x00f6,     #  DIVISION SIGN
    0x00f9: 0x0097,     #  LATIN SMALL LETTER U WITH GRAVE
    0x00fa: 0x00a3,     #  LATIN SMALL LETTER U WITH ACUTE
    0x00fc: 0x0081,     #  LATIN SMALL LETTER U WITH DIAERESIS
    0x0393: 0x00e2,     #  GREEK CAPITAL LETTER GAMMA
    0x0398: 0x00e9,     #  GREEK CAPITAL LETTER THETA
    0x03a3: 0x00e4,     #  GREEK CAPITAL LETTER SIGMA
    0x03a6: 0x00e8,     #  GREEK CAPITAL LETTER PHI
    0x03a9: 0x00ea,     #  GREEK CAPITAL LETTER OMEGA
    0x03b1: 0x00e0,     #  GREEK SMALL LETTER ALPHA
    0x03b4: 0x00eb,     #  GREEK SMALL LETTER DELTA
    0x03b5: 0x00ee,     #  GREEK SMALL LETTER EPSILON
    0x03c0: 0x00e3,     #  GREEK SMALL LETTER PI
    0x03c3: 0x00e5,     #  GREEK SMALL LETTER SIGMA
    0x03c4: 0x00e7,     #  GREEK SMALL LETTER TAU
    0x03c6: 0x00ed,     #  GREEK SMALL LETTER PHI
    0x207f: 0x00fc,     #  SUPERSCRIPT LATIN SMALL LETTER N
    0x20a7: 0x009e,     #  PESETA SIGN
    0x2219: 0x00f9,     #  BULLET OPERATOR
    0x221a: 0x00fb,     #  SQUARE ROOT
    0x221e: 0x00ec,     #  INFINITY
    0x2229: 0x00ef,     #  INTERSECTION
    0x2248: 0x00f7,     #  ALMOST EQUAL TO
    0x2261: 0x00f0,     #  IDENTICAL TO
    0x2264: 0x00f3,     #  LESS-THAN OR EQUAL TO
    0x2265: 0x00f2,     #  GREATER-THAN OR EQUAL TO
    0x2320: 0x00f4,     #  TOP HALF INTEGRAL
    0x2321: 0x00f5,     #  BOTTOM HALF INTEGRAL
    0x2500: 0x00c4,     #  BOX DRAWINGS LIGHT HORIZONTAL
    0x2502: 0x00b3,     #  BOX DRAWINGS LIGHT VERTICAL
    0x250c: 0x00da,     #  BOX DRAWINGS LIGHT DOWN AND RIGHT
    0x2510: 0x00bf,     #  BOX DRAWINGS LIGHT DOWN AND LEFT
    0x2514: 0x00c0,     #  BOX DRAWINGS LIGHT UP AND RIGHT
    0x2518: 0x00d9,     #  BOX DRAWINGS LIGHT UP AND LEFT
    0x251c: 0x00c3,     #  BOX DRAWINGS LIGHT VERTICAL AND RIGHT
    0x2524: 0x00b4,     #  BOX DRAWINGS LIGHT VERTICAL AND LEFT
    0x252c: 0x00c2,     #  BOX DRAWINGS LIGHT DOWN AND HORIZONTAL
    0x2534: 0x00c1,     #  BOX DRAWINGS LIGHT UP AND HORIZONTAL
    0x253c: 0x00c5,     #  BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL
    0x2550: 0x00cd,     #  BOX DRAWINGS DOUBLE HORIZONTAL
    0x2551: 0x00ba,     #  BOX DRAWINGS DOUBLE VERTICAL
    0x2552: 0x00d5,     #  BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE
    0x2553: 0x00d6,     #  BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE
    0x2554: 0x00c9,     #  BOX DRAWINGS DOUBLE DOWN AND RIGHT
    0x2555: 0x00b8,     #  BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE
    0x2556: 0x00b7,     #  BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE
    0x2557: 0x00bb,     #  BOX DRAWINGS DOUBLE DOWN AND LEFT
    0x2558: 0x00d4,     #  BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE
    0x2559: 0x00d3,     #  BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE
    0x255a: 0x00c8,     #  BOX DRAWINGS DOUBLE UP AND RIGHT
    0x255b: 0x00be,     #  BOX DRAWINGS UP SINGLE AND LEFT DOUBLE
    0x255c: 0x00bd,     #  BOX DRAWINGS UP DOUBLE AND LEFT SINGLE
    0x255d: 0x00bc,     #  BOX DRAWINGS DOUBLE UP AND LEFT
    0x255e: 0x00c6,     #  BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE
    0x255f: 0x00c7,     #  BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE
    0x2560: 0x00cc,     #  BOX DRAWINGS DOUBLE VERTICAL AND RIGHT
    0x2561: 0x00b5,     #  BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE
    0x2562: 0x00b6,     #  BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE
    0x2563: 0x00b9,     #  BOX DRAWINGS DOUBLE VERTICAL AND LEFT
    0x2564: 0x00d1,     #  BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE
    0x2565: 0x00d2,     #  BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE
    0x2566: 0x00cb,     #  BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL
    0x2567: 0x00cf,     #  BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE
    0x2568: 0x00d0,     #  BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE
    0x2569: 0x00ca,     #  BOX DRAWINGS DOUBLE UP AND HORIZONTAL
    0x256a: 0x00d8,     #  BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE
    0x256b: 0x00d7,     #  BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE
    0x256c: 0x00ce,     #  BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL
    0x2580: 0x00df,     #  UPPER HALF BLOCK
    0x2584: 0x00dc,     #  LOWER HALF BLOCK
    0x2588: 0x00db,     #  FULL BLOCK
    0x258c: 0x00dd,     #  LEFT HALF BLOCK
    0x2590: 0x00de,     #  RIGHT HALF BLOCK
    0x2591: 0x00b0,     #  LIGHT SHADE
    0x2592: 0x00b1,     #  MEDIUM SHADE
    0x2593: 0x00b2,     #  DARK SHADE
    0x25a0: 0x00fe,     #  BLACK SQUARE
}
encodings/iso8859_1.py000064400000031570151153537630010456 0ustar00""" Python Character Mapping Codec iso8859_1 generated from 'MAPPINGS/ISO8859/8859-1.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self,input,errors='strict'):
        return codecs.charmap_encode(input,errors,encoding_table)

    def decode(self,input,errors='strict'):
        return codecs.charmap_decode(input,errors,decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input,self.errors,encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input,self.errors,decoding_table)[0]

class StreamWriter(Codec,codecs.StreamWriter):
    pass

class StreamReader(Codec,codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='iso8859-1',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'     #  0x00 -> NULL
    '\x01'     #  0x01 -> START OF HEADING
    '\x02'     #  0x02 -> START OF TEXT
    '\x03'     #  0x03 -> END OF TEXT
    '\x04'     #  0x04 -> END OF TRANSMISSION
    '\x05'     #  0x05 -> ENQUIRY
    '\x06'     #  0x06 -> ACKNOWLEDGE
    '\x07'     #  0x07 -> BELL
    '\x08'     #  0x08 -> BACKSPACE
    '\t'       #  0x09 -> HORIZONTAL TABULATION
    '\n'       #  0x0A -> LINE FEED
    '\x0b'     #  0x0B -> VERTICAL TABULATION
    '\x0c'     #  0x0C -> FORM FEED
    '\r'       #  0x0D -> CARRIAGE RETURN
    '\x0e'     #  0x0E -> SHIFT OUT
    '\x0f'     #  0x0F -> SHIFT IN
    '\x10'     #  0x10 -> DATA LINK ESCAPE
    '\x11'     #  0x11 -> DEVICE CONTROL ONE
    '\x12'     #  0x12 -> DEVICE CONTROL TWO
    '\x13'     #  0x13 -> DEVICE CONTROL THREE
    '\x14'     #  0x14 -> DEVICE CONTROL FOUR
    '\x15'     #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'     #  0x16 -> SYNCHRONOUS IDLE
    '\x17'     #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'     #  0x18 -> CANCEL
    '\x19'     #  0x19 -> END OF MEDIUM
    '\x1a'     #  0x1A -> SUBSTITUTE
    '\x1b'     #  0x1B -> ESCAPE
    '\x1c'     #  0x1C -> FILE SEPARATOR
    '\x1d'     #  0x1D -> GROUP SEPARATOR
    '\x1e'     #  0x1E -> RECORD SEPARATOR
    '\x1f'     #  0x1F -> UNIT SEPARATOR
    ' '        #  0x20 -> SPACE
    '!'        #  0x21 -> EXCLAMATION MARK
    '"'        #  0x22 -> QUOTATION MARK
    '#'        #  0x23 -> NUMBER SIGN
    '$'        #  0x24 -> DOLLAR SIGN
    '%'        #  0x25 -> PERCENT SIGN
    '&'        #  0x26 -> AMPERSAND
    "'"        #  0x27 -> APOSTROPHE
    '('        #  0x28 -> LEFT PARENTHESIS
    ')'        #  0x29 -> RIGHT PARENTHESIS
    '*'        #  0x2A -> ASTERISK
    '+'        #  0x2B -> PLUS SIGN
    ','        #  0x2C -> COMMA
    '-'        #  0x2D -> HYPHEN-MINUS
    '.'        #  0x2E -> FULL STOP
    '/'        #  0x2F -> SOLIDUS
    '0'        #  0x30 -> DIGIT ZERO
    '1'        #  0x31 -> DIGIT ONE
    '2'        #  0x32 -> DIGIT TWO
    '3'        #  0x33 -> DIGIT THREE
    '4'        #  0x34 -> DIGIT FOUR
    '5'        #  0x35 -> DIGIT FIVE
    '6'        #  0x36 -> DIGIT SIX
    '7'        #  0x37 -> DIGIT SEVEN
    '8'        #  0x38 -> DIGIT EIGHT
    '9'        #  0x39 -> DIGIT NINE
    ':'        #  0x3A -> COLON
    ';'        #  0x3B -> SEMICOLON
    '<'        #  0x3C -> LESS-THAN SIGN
    '='        #  0x3D -> EQUALS SIGN
    '>'        #  0x3E -> GREATER-THAN SIGN
    '?'        #  0x3F -> QUESTION MARK
    '@'        #  0x40 -> COMMERCIAL AT
    'A'        #  0x41 -> LATIN CAPITAL LETTER A
    'B'        #  0x42 -> LATIN CAPITAL LETTER B
    'C'        #  0x43 -> LATIN CAPITAL LETTER C
    'D'        #  0x44 -> LATIN CAPITAL LETTER D
    'E'        #  0x45 -> LATIN CAPITAL LETTER E
    'F'        #  0x46 -> LATIN CAPITAL LETTER F
    'G'        #  0x47 -> LATIN CAPITAL LETTER G
    'H'        #  0x48 -> LATIN CAPITAL LETTER H
    'I'        #  0x49 -> LATIN CAPITAL LETTER I
    'J'        #  0x4A -> LATIN CAPITAL LETTER J
    'K'        #  0x4B -> LATIN CAPITAL LETTER K
    'L'        #  0x4C -> LATIN CAPITAL LETTER L
    'M'        #  0x4D -> LATIN CAPITAL LETTER M
    'N'        #  0x4E -> LATIN CAPITAL LETTER N
    'O'        #  0x4F -> LATIN CAPITAL LETTER O
    'P'        #  0x50 -> LATIN CAPITAL LETTER P
    'Q'        #  0x51 -> LATIN CAPITAL LETTER Q
    'R'        #  0x52 -> LATIN CAPITAL LETTER R
    'S'        #  0x53 -> LATIN CAPITAL LETTER S
    'T'        #  0x54 -> LATIN CAPITAL LETTER T
    'U'        #  0x55 -> LATIN CAPITAL LETTER U
    'V'        #  0x56 -> LATIN CAPITAL LETTER V
    'W'        #  0x57 -> LATIN CAPITAL LETTER W
    'X'        #  0x58 -> LATIN CAPITAL LETTER X
    'Y'        #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'        #  0x5A -> LATIN CAPITAL LETTER Z
    '['        #  0x5B -> LEFT SQUARE BRACKET
    '\\'       #  0x5C -> REVERSE SOLIDUS
    ']'        #  0x5D -> RIGHT SQUARE BRACKET
    '^'        #  0x5E -> CIRCUMFLEX ACCENT
    '_'        #  0x5F -> LOW LINE
    '`'        #  0x60 -> GRAVE ACCENT
    'a'        #  0x61 -> LATIN SMALL LETTER A
    'b'        #  0x62 -> LATIN SMALL LETTER B
    'c'        #  0x63 -> LATIN SMALL LETTER C
    'd'        #  0x64 -> LATIN SMALL LETTER D
    'e'        #  0x65 -> LATIN SMALL LETTER E
    'f'        #  0x66 -> LATIN SMALL LETTER F
    'g'        #  0x67 -> LATIN SMALL LETTER G
    'h'        #  0x68 -> LATIN SMALL LETTER H
    'i'        #  0x69 -> LATIN SMALL LETTER I
    'j'        #  0x6A -> LATIN SMALL LETTER J
    'k'        #  0x6B -> LATIN SMALL LETTER K
    'l'        #  0x6C -> LATIN SMALL LETTER L
    'm'        #  0x6D -> LATIN SMALL LETTER M
    'n'        #  0x6E -> LATIN SMALL LETTER N
    'o'        #  0x6F -> LATIN SMALL LETTER O
    'p'        #  0x70 -> LATIN SMALL LETTER P
    'q'        #  0x71 -> LATIN SMALL LETTER Q
    'r'        #  0x72 -> LATIN SMALL LETTER R
    's'        #  0x73 -> LATIN SMALL LETTER S
    't'        #  0x74 -> LATIN SMALL LETTER T
    'u'        #  0x75 -> LATIN SMALL LETTER U
    'v'        #  0x76 -> LATIN SMALL LETTER V
    'w'        #  0x77 -> LATIN SMALL LETTER W
    'x'        #  0x78 -> LATIN SMALL LETTER X
    'y'        #  0x79 -> LATIN SMALL LETTER Y
    'z'        #  0x7A -> LATIN SMALL LETTER Z
    '{'        #  0x7B -> LEFT CURLY BRACKET
    '|'        #  0x7C -> VERTICAL LINE
    '}'        #  0x7D -> RIGHT CURLY BRACKET
    '~'        #  0x7E -> TILDE
    '\x7f'     #  0x7F -> DELETE
    '\x80'     #  0x80 -> <control>
    '\x81'     #  0x81 -> <control>
    '\x82'     #  0x82 -> <control>
    '\x83'     #  0x83 -> <control>
    '\x84'     #  0x84 -> <control>
    '\x85'     #  0x85 -> <control>
    '\x86'     #  0x86 -> <control>
    '\x87'     #  0x87 -> <control>
    '\x88'     #  0x88 -> <control>
    '\x89'     #  0x89 -> <control>
    '\x8a'     #  0x8A -> <control>
    '\x8b'     #  0x8B -> <control>
    '\x8c'     #  0x8C -> <control>
    '\x8d'     #  0x8D -> <control>
    '\x8e'     #  0x8E -> <control>
    '\x8f'     #  0x8F -> <control>
    '\x90'     #  0x90 -> <control>
    '\x91'     #  0x91 -> <control>
    '\x92'     #  0x92 -> <control>
    '\x93'     #  0x93 -> <control>
    '\x94'     #  0x94 -> <control>
    '\x95'     #  0x95 -> <control>
    '\x96'     #  0x96 -> <control>
    '\x97'     #  0x97 -> <control>
    '\x98'     #  0x98 -> <control>
    '\x99'     #  0x99 -> <control>
    '\x9a'     #  0x9A -> <control>
    '\x9b'     #  0x9B -> <control>
    '\x9c'     #  0x9C -> <control>
    '\x9d'     #  0x9D -> <control>
    '\x9e'     #  0x9E -> <control>
    '\x9f'     #  0x9F -> <control>
    '\xa0'     #  0xA0 -> NO-BREAK SPACE
    '\xa1'     #  0xA1 -> INVERTED EXCLAMATION MARK
    '\xa2'     #  0xA2 -> CENT SIGN
    '\xa3'     #  0xA3 -> POUND SIGN
    '\xa4'     #  0xA4 -> CURRENCY SIGN
    '\xa5'     #  0xA5 -> YEN SIGN
    '\xa6'     #  0xA6 -> BROKEN BAR
    '\xa7'     #  0xA7 -> SECTION SIGN
    '\xa8'     #  0xA8 -> DIAERESIS
    '\xa9'     #  0xA9 -> COPYRIGHT SIGN
    '\xaa'     #  0xAA -> FEMININE ORDINAL INDICATOR
    '\xab'     #  0xAB -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xac'     #  0xAC -> NOT SIGN
    '\xad'     #  0xAD -> SOFT HYPHEN
    '\xae'     #  0xAE -> REGISTERED SIGN
    '\xaf'     #  0xAF -> MACRON
    '\xb0'     #  0xB0 -> DEGREE SIGN
    '\xb1'     #  0xB1 -> PLUS-MINUS SIGN
    '\xb2'     #  0xB2 -> SUPERSCRIPT TWO
    '\xb3'     #  0xB3 -> SUPERSCRIPT THREE
    '\xb4'     #  0xB4 -> ACUTE ACCENT
    '\xb5'     #  0xB5 -> MICRO SIGN
    '\xb6'     #  0xB6 -> PILCROW SIGN
    '\xb7'     #  0xB7 -> MIDDLE DOT
    '\xb8'     #  0xB8 -> CEDILLA
    '\xb9'     #  0xB9 -> SUPERSCRIPT ONE
    '\xba'     #  0xBA -> MASCULINE ORDINAL INDICATOR
    '\xbb'     #  0xBB -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xbc'     #  0xBC -> VULGAR FRACTION ONE QUARTER
    '\xbd'     #  0xBD -> VULGAR FRACTION ONE HALF
    '\xbe'     #  0xBE -> VULGAR FRACTION THREE QUARTERS
    '\xbf'     #  0xBF -> INVERTED QUESTION MARK
    '\xc0'     #  0xC0 -> LATIN CAPITAL LETTER A WITH GRAVE
    '\xc1'     #  0xC1 -> LATIN CAPITAL LETTER A WITH ACUTE
    '\xc2'     #  0xC2 -> LATIN CAPITAL LETTER A WITH CIRCUMFLEX
    '\xc3'     #  0xC3 -> LATIN CAPITAL LETTER A WITH TILDE
    '\xc4'     #  0xC4 -> LATIN CAPITAL LETTER A WITH DIAERESIS
    '\xc5'     #  0xC5 -> LATIN CAPITAL LETTER A WITH RING ABOVE
    '\xc6'     #  0xC6 -> LATIN CAPITAL LETTER AE
    '\xc7'     #  0xC7 -> LATIN CAPITAL LETTER C WITH CEDILLA
    '\xc8'     #  0xC8 -> LATIN CAPITAL LETTER E WITH GRAVE
    '\xc9'     #  0xC9 -> LATIN CAPITAL LETTER E WITH ACUTE
    '\xca'     #  0xCA -> LATIN CAPITAL LETTER E WITH CIRCUMFLEX
    '\xcb'     #  0xCB -> LATIN CAPITAL LETTER E WITH DIAERESIS
    '\xcc'     #  0xCC -> LATIN CAPITAL LETTER I WITH GRAVE
    '\xcd'     #  0xCD -> LATIN CAPITAL LETTER I WITH ACUTE
    '\xce'     #  0xCE -> LATIN CAPITAL LETTER I WITH CIRCUMFLEX
    '\xcf'     #  0xCF -> LATIN CAPITAL LETTER I WITH DIAERESIS
    '\xd0'     #  0xD0 -> LATIN CAPITAL LETTER ETH (Icelandic)
    '\xd1'     #  0xD1 -> LATIN CAPITAL LETTER N WITH TILDE
    '\xd2'     #  0xD2 -> LATIN CAPITAL LETTER O WITH GRAVE
    '\xd3'     #  0xD3 -> LATIN CAPITAL LETTER O WITH ACUTE
    '\xd4'     #  0xD4 -> LATIN CAPITAL LETTER O WITH CIRCUMFLEX
    '\xd5'     #  0xD5 -> LATIN CAPITAL LETTER O WITH TILDE
    '\xd6'     #  0xD6 -> LATIN CAPITAL LETTER O WITH DIAERESIS
    '\xd7'     #  0xD7 -> MULTIPLICATION SIGN
    '\xd8'     #  0xD8 -> LATIN CAPITAL LETTER O WITH STROKE
    '\xd9'     #  0xD9 -> LATIN CAPITAL LETTER U WITH GRAVE
    '\xda'     #  0xDA -> LATIN CAPITAL LETTER U WITH ACUTE
    '\xdb'     #  0xDB -> LATIN CAPITAL LETTER U WITH CIRCUMFLEX
    '\xdc'     #  0xDC -> LATIN CAPITAL LETTER U WITH DIAERESIS
    '\xdd'     #  0xDD -> LATIN CAPITAL LETTER Y WITH ACUTE
    '\xde'     #  0xDE -> LATIN CAPITAL LETTER THORN (Icelandic)
    '\xdf'     #  0xDF -> LATIN SMALL LETTER SHARP S (German)
    '\xe0'     #  0xE0 -> LATIN SMALL LETTER A WITH GRAVE
    '\xe1'     #  0xE1 -> LATIN SMALL LETTER A WITH ACUTE
    '\xe2'     #  0xE2 -> LATIN SMALL LETTER A WITH CIRCUMFLEX
    '\xe3'     #  0xE3 -> LATIN SMALL LETTER A WITH TILDE
    '\xe4'     #  0xE4 -> LATIN SMALL LETTER A WITH DIAERESIS
    '\xe5'     #  0xE5 -> LATIN SMALL LETTER A WITH RING ABOVE
    '\xe6'     #  0xE6 -> LATIN SMALL LETTER AE
    '\xe7'     #  0xE7 -> LATIN SMALL LETTER C WITH CEDILLA
    '\xe8'     #  0xE8 -> LATIN SMALL LETTER E WITH GRAVE
    '\xe9'     #  0xE9 -> LATIN SMALL LETTER E WITH ACUTE
    '\xea'     #  0xEA -> LATIN SMALL LETTER E WITH CIRCUMFLEX
    '\xeb'     #  0xEB -> LATIN SMALL LETTER E WITH DIAERESIS
    '\xec'     #  0xEC -> LATIN SMALL LETTER I WITH GRAVE
    '\xed'     #  0xED -> LATIN SMALL LETTER I WITH ACUTE
    '\xee'     #  0xEE -> LATIN SMALL LETTER I WITH CIRCUMFLEX
    '\xef'     #  0xEF -> LATIN SMALL LETTER I WITH DIAERESIS
    '\xf0'     #  0xF0 -> LATIN SMALL LETTER ETH (Icelandic)
    '\xf1'     #  0xF1 -> LATIN SMALL LETTER N WITH TILDE
    '\xf2'     #  0xF2 -> LATIN SMALL LETTER O WITH GRAVE
    '\xf3'     #  0xF3 -> LATIN SMALL LETTER O WITH ACUTE
    '\xf4'     #  0xF4 -> LATIN SMALL LETTER O WITH CIRCUMFLEX
    '\xf5'     #  0xF5 -> LATIN SMALL LETTER O WITH TILDE
    '\xf6'     #  0xF6 -> LATIN SMALL LETTER O WITH DIAERESIS
    '\xf7'     #  0xF7 -> DIVISION SIGN
    '\xf8'     #  0xF8 -> LATIN SMALL LETTER O WITH STROKE
    '\xf9'     #  0xF9 -> LATIN SMALL LETTER U WITH GRAVE
    '\xfa'     #  0xFA -> LATIN SMALL LETTER U WITH ACUTE
    '\xfb'     #  0xFB -> LATIN SMALL LETTER U WITH CIRCUMFLEX
    '\xfc'     #  0xFC -> LATIN SMALL LETTER U WITH DIAERESIS
    '\xfd'     #  0xFD -> LATIN SMALL LETTER Y WITH ACUTE
    '\xfe'     #  0xFE -> LATIN SMALL LETTER THORN (Icelandic)
    '\xff'     #  0xFF -> LATIN SMALL LETTER Y WITH DIAERESIS
)

### Encoding table
encoding_table=codecs.charmap_build(decoding_table)
encodings/kz1048.py000064400000032633151153537630010050 0ustar00""" Python Character Mapping Codec kz1048 generated from 'MAPPINGS/VENDORS/MISC/KZ1048.TXT' with gencodec.py.

"""#"

import codecs

### Codec APIs

class Codec(codecs.Codec):

    def encode(self, input, errors='strict'):
        return codecs.charmap_encode(input, errors, encoding_table)

    def decode(self, input, errors='strict'):
        return codecs.charmap_decode(input, errors, decoding_table)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return codecs.charmap_encode(input, self.errors, encoding_table)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return codecs.charmap_decode(input, self.errors, decoding_table)[0]

class StreamWriter(Codec, codecs.StreamWriter):
    pass

class StreamReader(Codec, codecs.StreamReader):
    pass

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='kz1048',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )


### Decoding Table

decoding_table = (
    '\x00'      #  0x00 -> NULL
    '\x01'      #  0x01 -> START OF HEADING
    '\x02'      #  0x02 -> START OF TEXT
    '\x03'      #  0x03 -> END OF TEXT
    '\x04'      #  0x04 -> END OF TRANSMISSION
    '\x05'      #  0x05 -> ENQUIRY
    '\x06'      #  0x06 -> ACKNOWLEDGE
    '\x07'      #  0x07 -> BELL
    '\x08'      #  0x08 -> BACKSPACE
    '\t'        #  0x09 -> HORIZONTAL TABULATION
    '\n'        #  0x0A -> LINE FEED
    '\x0b'      #  0x0B -> VERTICAL TABULATION
    '\x0c'      #  0x0C -> FORM FEED
    '\r'        #  0x0D -> CARRIAGE RETURN
    '\x0e'      #  0x0E -> SHIFT OUT
    '\x0f'      #  0x0F -> SHIFT IN
    '\x10'      #  0x10 -> DATA LINK ESCAPE
    '\x11'      #  0x11 -> DEVICE CONTROL ONE
    '\x12'      #  0x12 -> DEVICE CONTROL TWO
    '\x13'      #  0x13 -> DEVICE CONTROL THREE
    '\x14'      #  0x14 -> DEVICE CONTROL FOUR
    '\x15'      #  0x15 -> NEGATIVE ACKNOWLEDGE
    '\x16'      #  0x16 -> SYNCHRONOUS IDLE
    '\x17'      #  0x17 -> END OF TRANSMISSION BLOCK
    '\x18'      #  0x18 -> CANCEL
    '\x19'      #  0x19 -> END OF MEDIUM
    '\x1a'      #  0x1A -> SUBSTITUTE
    '\x1b'      #  0x1B -> ESCAPE
    '\x1c'      #  0x1C -> FILE SEPARATOR
    '\x1d'      #  0x1D -> GROUP SEPARATOR
    '\x1e'      #  0x1E -> RECORD SEPARATOR
    '\x1f'      #  0x1F -> UNIT SEPARATOR
    ' '         #  0x20 -> SPACE
    '!'         #  0x21 -> EXCLAMATION MARK
    '"'         #  0x22 -> QUOTATION MARK
    '#'         #  0x23 -> NUMBER SIGN
    '$'         #  0x24 -> DOLLAR SIGN
    '%'         #  0x25 -> PERCENT SIGN
    '&'         #  0x26 -> AMPERSAND
    "'"         #  0x27 -> APOSTROPHE
    '('         #  0x28 -> LEFT PARENTHESIS
    ')'         #  0x29 -> RIGHT PARENTHESIS
    '*'         #  0x2A -> ASTERISK
    '+'         #  0x2B -> PLUS SIGN
    ','         #  0x2C -> COMMA
    '-'         #  0x2D -> HYPHEN-MINUS
    '.'         #  0x2E -> FULL STOP
    '/'         #  0x2F -> SOLIDUS
    '0'         #  0x30 -> DIGIT ZERO
    '1'         #  0x31 -> DIGIT ONE
    '2'         #  0x32 -> DIGIT TWO
    '3'         #  0x33 -> DIGIT THREE
    '4'         #  0x34 -> DIGIT FOUR
    '5'         #  0x35 -> DIGIT FIVE
    '6'         #  0x36 -> DIGIT SIX
    '7'         #  0x37 -> DIGIT SEVEN
    '8'         #  0x38 -> DIGIT EIGHT
    '9'         #  0x39 -> DIGIT NINE
    ':'         #  0x3A -> COLON
    ';'         #  0x3B -> SEMICOLON
    '<'         #  0x3C -> LESS-THAN SIGN
    '='         #  0x3D -> EQUALS SIGN
    '>'         #  0x3E -> GREATER-THAN SIGN
    '?'         #  0x3F -> QUESTION MARK
    '@'         #  0x40 -> COMMERCIAL AT
    'A'         #  0x41 -> LATIN CAPITAL LETTER A
    'B'         #  0x42 -> LATIN CAPITAL LETTER B
    'C'         #  0x43 -> LATIN CAPITAL LETTER C
    'D'         #  0x44 -> LATIN CAPITAL LETTER D
    'E'         #  0x45 -> LATIN CAPITAL LETTER E
    'F'         #  0x46 -> LATIN CAPITAL LETTER F
    'G'         #  0x47 -> LATIN CAPITAL LETTER G
    'H'         #  0x48 -> LATIN CAPITAL LETTER H
    'I'         #  0x49 -> LATIN CAPITAL LETTER I
    'J'         #  0x4A -> LATIN CAPITAL LETTER J
    'K'         #  0x4B -> LATIN CAPITAL LETTER K
    'L'         #  0x4C -> LATIN CAPITAL LETTER L
    'M'         #  0x4D -> LATIN CAPITAL LETTER M
    'N'         #  0x4E -> LATIN CAPITAL LETTER N
    'O'         #  0x4F -> LATIN CAPITAL LETTER O
    'P'         #  0x50 -> LATIN CAPITAL LETTER P
    'Q'         #  0x51 -> LATIN CAPITAL LETTER Q
    'R'         #  0x52 -> LATIN CAPITAL LETTER R
    'S'         #  0x53 -> LATIN CAPITAL LETTER S
    'T'         #  0x54 -> LATIN CAPITAL LETTER T
    'U'         #  0x55 -> LATIN CAPITAL LETTER U
    'V'         #  0x56 -> LATIN CAPITAL LETTER V
    'W'         #  0x57 -> LATIN CAPITAL LETTER W
    'X'         #  0x58 -> LATIN CAPITAL LETTER X
    'Y'         #  0x59 -> LATIN CAPITAL LETTER Y
    'Z'         #  0x5A -> LATIN CAPITAL LETTER Z
    '['         #  0x5B -> LEFT SQUARE BRACKET
    '\\'        #  0x5C -> REVERSE SOLIDUS
    ']'         #  0x5D -> RIGHT SQUARE BRACKET
    '^'         #  0x5E -> CIRCUMFLEX ACCENT
    '_'         #  0x5F -> LOW LINE
    '`'         #  0x60 -> GRAVE ACCENT
    'a'         #  0x61 -> LATIN SMALL LETTER A
    'b'         #  0x62 -> LATIN SMALL LETTER B
    'c'         #  0x63 -> LATIN SMALL LETTER C
    'd'         #  0x64 -> LATIN SMALL LETTER D
    'e'         #  0x65 -> LATIN SMALL LETTER E
    'f'         #  0x66 -> LATIN SMALL LETTER F
    'g'         #  0x67 -> LATIN SMALL LETTER G
    'h'         #  0x68 -> LATIN SMALL LETTER H
    'i'         #  0x69 -> LATIN SMALL LETTER I
    'j'         #  0x6A -> LATIN SMALL LETTER J
    'k'         #  0x6B -> LATIN SMALL LETTER K
    'l'         #  0x6C -> LATIN SMALL LETTER L
    'm'         #  0x6D -> LATIN SMALL LETTER M
    'n'         #  0x6E -> LATIN SMALL LETTER N
    'o'         #  0x6F -> LATIN SMALL LETTER O
    'p'         #  0x70 -> LATIN SMALL LETTER P
    'q'         #  0x71 -> LATIN SMALL LETTER Q
    'r'         #  0x72 -> LATIN SMALL LETTER R
    's'         #  0x73 -> LATIN SMALL LETTER S
    't'         #  0x74 -> LATIN SMALL LETTER T
    'u'         #  0x75 -> LATIN SMALL LETTER U
    'v'         #  0x76 -> LATIN SMALL LETTER V
    'w'         #  0x77 -> LATIN SMALL LETTER W
    'x'         #  0x78 -> LATIN SMALL LETTER X
    'y'         #  0x79 -> LATIN SMALL LETTER Y
    'z'         #  0x7A -> LATIN SMALL LETTER Z
    '{'         #  0x7B -> LEFT CURLY BRACKET
    '|'         #  0x7C -> VERTICAL LINE
    '}'         #  0x7D -> RIGHT CURLY BRACKET
    '~'         #  0x7E -> TILDE
    '\x7f'      #  0x7F -> DELETE
    '\u0402'    #  0x80 -> CYRILLIC CAPITAL LETTER DJE
    '\u0403'    #  0x81 -> CYRILLIC CAPITAL LETTER GJE
    '\u201a'    #  0x82 -> SINGLE LOW-9 QUOTATION MARK
    '\u0453'    #  0x83 -> CYRILLIC SMALL LETTER GJE
    '\u201e'    #  0x84 -> DOUBLE LOW-9 QUOTATION MARK
    '\u2026'    #  0x85 -> HORIZONTAL ELLIPSIS
    '\u2020'    #  0x86 -> DAGGER
    '\u2021'    #  0x87 -> DOUBLE DAGGER
    '\u20ac'    #  0x88 -> EURO SIGN
    '\u2030'    #  0x89 -> PER MILLE SIGN
    '\u0409'    #  0x8A -> CYRILLIC CAPITAL LETTER LJE
    '\u2039'    #  0x8B -> SINGLE LEFT-POINTING ANGLE QUOTATION MARK
    '\u040a'    #  0x8C -> CYRILLIC CAPITAL LETTER NJE
    '\u049a'    #  0x8D -> CYRILLIC CAPITAL LETTER KA WITH DESCENDER
    '\u04ba'    #  0x8E -> CYRILLIC CAPITAL LETTER SHHA
    '\u040f'    #  0x8F -> CYRILLIC CAPITAL LETTER DZHE
    '\u0452'    #  0x90 -> CYRILLIC SMALL LETTER DJE
    '\u2018'    #  0x91 -> LEFT SINGLE QUOTATION MARK
    '\u2019'    #  0x92 -> RIGHT SINGLE QUOTATION MARK
    '\u201c'    #  0x93 -> LEFT DOUBLE QUOTATION MARK
    '\u201d'    #  0x94 -> RIGHT DOUBLE QUOTATION MARK
    '\u2022'    #  0x95 -> BULLET
    '\u2013'    #  0x96 -> EN DASH
    '\u2014'    #  0x97 -> EM DASH
    '\ufffe'    #  0x98 -> UNDEFINED
    '\u2122'    #  0x99 -> TRADE MARK SIGN
    '\u0459'    #  0x9A -> CYRILLIC SMALL LETTER LJE
    '\u203a'    #  0x9B -> SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
    '\u045a'    #  0x9C -> CYRILLIC SMALL LETTER NJE
    '\u049b'    #  0x9D -> CYRILLIC SMALL LETTER KA WITH DESCENDER
    '\u04bb'    #  0x9E -> CYRILLIC SMALL LETTER SHHA
    '\u045f'    #  0x9F -> CYRILLIC SMALL LETTER DZHE
    '\xa0'      #  0xA0 -> NO-BREAK SPACE
    '\u04b0'    #  0xA1 -> CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE
    '\u04b1'    #  0xA2 -> CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE
    '\u04d8'    #  0xA3 -> CYRILLIC CAPITAL LETTER SCHWA
    '\xa4'      #  0xA4 -> CURRENCY SIGN
    '\u04e8'    #  0xA5 -> CYRILLIC CAPITAL LETTER BARRED O
    '\xa6'      #  0xA6 -> BROKEN BAR
    '\xa7'      #  0xA7 -> SECTION SIGN
    '\u0401'    #  0xA8 -> CYRILLIC CAPITAL LETTER IO
    '\xa9'      #  0xA9 -> COPYRIGHT SIGN
    '\u0492'    #  0xAA -> CYRILLIC CAPITAL LETTER GHE WITH STROKE
    '\xab'      #  0xAB -> LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\xac'      #  0xAC -> NOT SIGN
    '\xad'      #  0xAD -> SOFT HYPHEN
    '\xae'      #  0xAE -> REGISTERED SIGN
    '\u04ae'    #  0xAF -> CYRILLIC CAPITAL LETTER STRAIGHT U
    '\xb0'      #  0xB0 -> DEGREE SIGN
    '\xb1'      #  0xB1 -> PLUS-MINUS SIGN
    '\u0406'    #  0xB2 -> CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
    '\u0456'    #  0xB3 -> CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
    '\u04e9'    #  0xB4 -> CYRILLIC SMALL LETTER BARRED O
    '\xb5'      #  0xB5 -> MICRO SIGN
    '\xb6'      #  0xB6 -> PILCROW SIGN
    '\xb7'      #  0xB7 -> MIDDLE DOT
    '\u0451'    #  0xB8 -> CYRILLIC SMALL LETTER IO
    '\u2116'    #  0xB9 -> NUMERO SIGN
    '\u0493'    #  0xBA -> CYRILLIC SMALL LETTER GHE WITH STROKE
    '\xbb'      #  0xBB -> RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    '\u04d9'    #  0xBC -> CYRILLIC SMALL LETTER SCHWA
    '\u04a2'    #  0xBD -> CYRILLIC CAPITAL LETTER EN WITH DESCENDER
    '\u04a3'    #  0xBE -> CYRILLIC SMALL LETTER EN WITH DESCENDER
    '\u04af'    #  0xBF -> CYRILLIC SMALL LETTER STRAIGHT U
    '\u0410'    #  0xC0 -> CYRILLIC CAPITAL LETTER A
    '\u0411'    #  0xC1 -> CYRILLIC CAPITAL LETTER BE
    '\u0412'    #  0xC2 -> CYRILLIC CAPITAL LETTER VE
    '\u0413'    #  0xC3 -> CYRILLIC CAPITAL LETTER GHE
    '\u0414'    #  0xC4 -> CYRILLIC CAPITAL LETTER DE
    '\u0415'    #  0xC5 -> CYRILLIC CAPITAL LETTER IE
    '\u0416'    #  0xC6 -> CYRILLIC CAPITAL LETTER ZHE
    '\u0417'    #  0xC7 -> CYRILLIC CAPITAL LETTER ZE
    '\u0418'    #  0xC8 -> CYRILLIC CAPITAL LETTER I
    '\u0419'    #  0xC9 -> CYRILLIC CAPITAL LETTER SHORT I
    '\u041a'    #  0xCA -> CYRILLIC CAPITAL LETTER KA
    '\u041b'    #  0xCB -> CYRILLIC CAPITAL LETTER EL
    '\u041c'    #  0xCC -> CYRILLIC CAPITAL LETTER EM
    '\u041d'    #  0xCD -> CYRILLIC CAPITAL LETTER EN
    '\u041e'    #  0xCE -> CYRILLIC CAPITAL LETTER O
    '\u041f'    #  0xCF -> CYRILLIC CAPITAL LETTER PE
    '\u0420'    #  0xD0 -> CYRILLIC CAPITAL LETTER ER
    '\u0421'    #  0xD1 -> CYRILLIC CAPITAL LETTER ES
    '\u0422'    #  0xD2 -> CYRILLIC CAPITAL LETTER TE
    '\u0423'    #  0xD3 -> CYRILLIC CAPITAL LETTER U
    '\u0424'    #  0xD4 -> CYRILLIC CAPITAL LETTER EF
    '\u0425'    #  0xD5 -> CYRILLIC CAPITAL LETTER HA
    '\u0426'    #  0xD6 -> CYRILLIC CAPITAL LETTER TSE
    '\u0427'    #  0xD7 -> CYRILLIC CAPITAL LETTER CHE
    '\u0428'    #  0xD8 -> CYRILLIC CAPITAL LETTER SHA
    '\u0429'    #  0xD9 -> CYRILLIC CAPITAL LETTER SHCHA
    '\u042a'    #  0xDA -> CYRILLIC CAPITAL LETTER HARD SIGN
    '\u042b'    #  0xDB -> CYRILLIC CAPITAL LETTER YERU
    '\u042c'    #  0xDC -> CYRILLIC CAPITAL LETTER SOFT SIGN
    '\u042d'    #  0xDD -> CYRILLIC CAPITAL LETTER E
    '\u042e'    #  0xDE -> CYRILLIC CAPITAL LETTER YU
    '\u042f'    #  0xDF -> CYRILLIC CAPITAL LETTER YA
    '\u0430'    #  0xE0 -> CYRILLIC SMALL LETTER A
    '\u0431'    #  0xE1 -> CYRILLIC SMALL LETTER BE
    '\u0432'    #  0xE2 -> CYRILLIC SMALL LETTER VE
    '\u0433'    #  0xE3 -> CYRILLIC SMALL LETTER GHE
    '\u0434'    #  0xE4 -> CYRILLIC SMALL LETTER DE
    '\u0435'    #  0xE5 -> CYRILLIC SMALL LETTER IE
    '\u0436'    #  0xE6 -> CYRILLIC SMALL LETTER ZHE
    '\u0437'    #  0xE7 -> CYRILLIC SMALL LETTER ZE
    '\u0438'    #  0xE8 -> CYRILLIC SMALL LETTER I
    '\u0439'    #  0xE9 -> CYRILLIC SMALL LETTER SHORT I
    '\u043a'    #  0xEA -> CYRILLIC SMALL LETTER KA
    '\u043b'    #  0xEB -> CYRILLIC SMALL LETTER EL
    '\u043c'    #  0xEC -> CYRILLIC SMALL LETTER EM
    '\u043d'    #  0xED -> CYRILLIC SMALL LETTER EN
    '\u043e'    #  0xEE -> CYRILLIC SMALL LETTER O
    '\u043f'    #  0xEF -> CYRILLIC SMALL LETTER PE
    '\u0440'    #  0xF0 -> CYRILLIC SMALL LETTER ER
    '\u0441'    #  0xF1 -> CYRILLIC SMALL LETTER ES
    '\u0442'    #  0xF2 -> CYRILLIC SMALL LETTER TE
    '\u0443'    #  0xF3 -> CYRILLIC SMALL LETTER U
    '\u0444'    #  0xF4 -> CYRILLIC SMALL LETTER EF
    '\u0445'    #  0xF5 -> CYRILLIC SMALL LETTER HA
    '\u0446'    #  0xF6 -> CYRILLIC SMALL LETTER TSE
    '\u0447'    #  0xF7 -> CYRILLIC SMALL LETTER CHE
    '\u0448'    #  0xF8 -> CYRILLIC SMALL LETTER SHA
    '\u0449'    #  0xF9 -> CYRILLIC SMALL LETTER SHCHA
    '\u044a'    #  0xFA -> CYRILLIC SMALL LETTER HARD SIGN
    '\u044b'    #  0xFB -> CYRILLIC SMALL LETTER YERU
    '\u044c'    #  0xFC -> CYRILLIC SMALL LETTER SOFT SIGN
    '\u044d'    #  0xFD -> CYRILLIC SMALL LETTER E
    '\u044e'    #  0xFE -> CYRILLIC SMALL LETTER YU
    '\u044f'    #  0xFF -> CYRILLIC SMALL LETTER YA
)

### Encoding table
encoding_table = codecs.charmap_build(decoding_table)
encodings/uu_codec.py000064400000005443151153537630010674 0ustar00"""Python 'uu_codec' Codec - UU content transfer encoding.

This codec de/encodes from bytes to bytes.

Written by Marc-Andre Lemburg (mal@lemburg.com). Some details were
adapted from uu.py which was written by Lance Ellinghouse and
modified by Jack Jansen and Fredrik Lundh.
"""

import codecs
import binascii
from io import BytesIO

### Codec APIs

def uu_encode(input, errors='strict', filename='<data>', mode=0o666):
    assert errors == 'strict'
    infile = BytesIO(input)
    outfile = BytesIO()
    read = infile.read
    write = outfile.write

    # Remove newline chars from filename
    filename = filename.replace('\n','\\n')
    filename = filename.replace('\r','\\r')

    # Encode
    write(('begin %o %s\n' % (mode & 0o777, filename)).encode('ascii'))
    chunk = read(45)
    while chunk:
        write(binascii.b2a_uu(chunk))
        chunk = read(45)
    write(b' \nend\n')

    return (outfile.getvalue(), len(input))

def uu_decode(input, errors='strict'):
    assert errors == 'strict'
    infile = BytesIO(input)
    outfile = BytesIO()
    readline = infile.readline
    write = outfile.write

    # Find start of encoded data
    while 1:
        s = readline()
        if not s:
            raise ValueError('Missing "begin" line in input data')
        if s[:5] == b'begin':
            break

    # Decode
    while True:
        s = readline()
        if not s or s == b'end\n':
            break
        try:
            data = binascii.a2b_uu(s)
        except binascii.Error as v:
            # Workaround for broken uuencoders by /Fredrik Lundh
            nbytes = (((s[0]-32) & 63) * 4 + 5) // 3
            data = binascii.a2b_uu(s[:nbytes])
            #sys.stderr.write("Warning: %s\n" % str(v))
        write(data)
    if not s:
        raise ValueError('Truncated input data')

    return (outfile.getvalue(), len(input))

class Codec(codecs.Codec):
    def encode(self, input, errors='strict'):
        return uu_encode(input, errors)

    def decode(self, input, errors='strict'):
        return uu_decode(input, errors)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return uu_encode(input, self.errors)[0]

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        return uu_decode(input, self.errors)[0]

class StreamWriter(Codec, codecs.StreamWriter):
    charbuffertype = bytes

class StreamReader(Codec, codecs.StreamReader):
    charbuffertype = bytes

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='uu',
        encode=uu_encode,
        decode=uu_decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
        _is_text_encoding=False,
    )
encodings/big5hkscs.py000064400000002017151153537630010762 0ustar00#
# big5hkscs.py: Python Unicode Codec for BIG5HKSCS
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#

import _codecs_hk, codecs
import _multibytecodec as mbc

codec = _codecs_hk.getcodec('big5hkscs')

class Codec(codecs.Codec):
    encode = codec.encode
    decode = codec.decode

class IncrementalEncoder(mbc.MultibyteIncrementalEncoder,
                         codecs.IncrementalEncoder):
    codec = codec

class IncrementalDecoder(mbc.MultibyteIncrementalDecoder,
                         codecs.IncrementalDecoder):
    codec = codec

class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader):
    codec = codec

class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter):
    codec = codec

def getregentry():
    return codecs.CodecInfo(
        name='big5hkscs',
        encode=Codec().encode,
        decode=Codec().decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamreader=StreamReader,
        streamwriter=StreamWriter,
    )
encodings/hex_codec.py000064400000002744151153537630011030 0ustar00"""Python 'hex_codec' Codec - 2-digit hex content transfer encoding.

This codec de/encodes from bytes to bytes.

Written by Marc-Andre Lemburg (mal@lemburg.com).
"""

import codecs
import binascii

### Codec APIs

def hex_encode(input, errors='strict'):
    assert errors == 'strict'
    return (binascii.b2a_hex(input), len(input))

def hex_decode(input, errors='strict'):
    assert errors == 'strict'
    return (binascii.a2b_hex(input), len(input))

class Codec(codecs.Codec):
    def encode(self, input, errors='strict'):
        return hex_encode(input, errors)
    def decode(self, input, errors='strict'):
        return hex_decode(input, errors)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        assert self.errors == 'strict'
        return binascii.b2a_hex(input)

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        assert self.errors == 'strict'
        return binascii.a2b_hex(input)

class StreamWriter(Codec, codecs.StreamWriter):
    charbuffertype = bytes

class StreamReader(Codec, codecs.StreamReader):
    charbuffertype = bytes

### encodings module API

def getregentry():
    return codecs.CodecInfo(
        name='hex',
        encode=hex_encode,
        decode=hex_decode,
        incrementalencoder=IncrementalEncoder,
        incrementaldecoder=IncrementalDecoder,
        streamwriter=StreamWriter,
        streamreader=StreamReader,
        _is_text_encoding=False,
    )
fractions.py000064400000057411151153537630007127 0ustar00# Originally contributed by Sjoerd Mullender.
# Significantly modified by Jeffrey Yasskin <jyasskin at gmail.com>.

"""Fraction, infinite-precision, real numbers."""

from decimal import Decimal
import math
import numbers
import operator
import re
import sys

__all__ = ['Fraction', 'gcd']



def gcd(a, b):
    """Calculate the Greatest Common Divisor of a and b.

    Unless b==0, the result will have the same sign as b (so that when
    b is divided by it, the result comes out positive).
    """
    import warnings
    warnings.warn('fractions.gcd() is deprecated. Use math.gcd() instead.',
                  DeprecationWarning, 2)
    if type(a) is int is type(b):
        if (b or a) < 0:
            return -math.gcd(a, b)
        return math.gcd(a, b)
    return _gcd(a, b)

def _gcd(a, b):
    # Supports non-integers for backward compatibility.
    while b:
        a, b = b, a%b
    return a

# Constants related to the hash implementation;  hash(x) is based
# on the reduction of x modulo the prime _PyHASH_MODULUS.
_PyHASH_MODULUS = sys.hash_info.modulus
# Value to be used for rationals that reduce to infinity modulo
# _PyHASH_MODULUS.
_PyHASH_INF = sys.hash_info.inf

_RATIONAL_FORMAT = re.compile(r"""
    \A\s*                      # optional whitespace at the start, then
    (?P<sign>[-+]?)            # an optional sign, then
    (?=\d|\.\d)                # lookahead for digit or .digit
    (?P<num>\d*)               # numerator (possibly empty)
    (?:                        # followed by
       (?:/(?P<denom>\d+))?    # an optional denominator
    |                          # or
       (?:\.(?P<decimal>\d*))? # an optional fractional part
       (?:E(?P<exp>[-+]?\d+))? # and optional exponent
    )
    \s*\Z                      # and optional whitespace to finish
""", re.VERBOSE | re.IGNORECASE)


class Fraction(numbers.Rational):
    """This class implements rational numbers.

    In the two-argument form of the constructor, Fraction(8, 6) will
    produce a rational number equivalent to 4/3. Both arguments must
    be Rational. The numerator defaults to 0 and the denominator
    defaults to 1 so that Fraction(3) == 3 and Fraction() == 0.

    Fractions can also be constructed from:

      - numeric strings similar to those accepted by the
        float constructor (for example, '-2.3' or '1e10')

      - strings of the form '123/456'

      - float and Decimal instances

      - other Rational instances (including integers)

    """

    __slots__ = ('_numerator', '_denominator')

    # We're immutable, so use __new__ not __init__
    def __new__(cls, numerator=0, denominator=None, *, _normalize=True):
        """Constructs a Rational.

        Takes a string like '3/2' or '1.5', another Rational instance, a
        numerator/denominator pair, or a float.

        Examples
        --------

        >>> Fraction(10, -8)
        Fraction(-5, 4)
        >>> Fraction(Fraction(1, 7), 5)
        Fraction(1, 35)
        >>> Fraction(Fraction(1, 7), Fraction(2, 3))
        Fraction(3, 14)
        >>> Fraction('314')
        Fraction(314, 1)
        >>> Fraction('-35/4')
        Fraction(-35, 4)
        >>> Fraction('3.1415') # conversion from numeric string
        Fraction(6283, 2000)
        >>> Fraction('-47e-2') # string may include a decimal exponent
        Fraction(-47, 100)
        >>> Fraction(1.47)  # direct construction from float (exact conversion)
        Fraction(6620291452234629, 4503599627370496)
        >>> Fraction(2.25)
        Fraction(9, 4)
        >>> Fraction(Decimal('1.47'))
        Fraction(147, 100)

        """
        self = super(Fraction, cls).__new__(cls)

        if denominator is None:
            if type(numerator) is int:
                self._numerator = numerator
                self._denominator = 1
                return self

            elif isinstance(numerator, numbers.Rational):
                self._numerator = numerator.numerator
                self._denominator = numerator.denominator
                return self

            elif isinstance(numerator, (float, Decimal)):
                # Exact conversion
                self._numerator, self._denominator = numerator.as_integer_ratio()
                return self

            elif isinstance(numerator, str):
                # Handle construction from strings.
                m = _RATIONAL_FORMAT.match(numerator)
                if m is None:
                    raise ValueError('Invalid literal for Fraction: %r' %
                                     numerator)
                numerator = int(m.group('num') or '0')
                denom = m.group('denom')
                if denom:
                    denominator = int(denom)
                else:
                    denominator = 1
                    decimal = m.group('decimal')
                    if decimal:
                        scale = 10**len(decimal)
                        numerator = numerator * scale + int(decimal)
                        denominator *= scale
                    exp = m.group('exp')
                    if exp:
                        exp = int(exp)
                        if exp >= 0:
                            numerator *= 10**exp
                        else:
                            denominator *= 10**-exp
                if m.group('sign') == '-':
                    numerator = -numerator

            else:
                raise TypeError("argument should be a string "
                                "or a Rational instance")

        elif type(numerator) is int is type(denominator):
            pass # *very* normal case

        elif (isinstance(numerator, numbers.Rational) and
            isinstance(denominator, numbers.Rational)):
            numerator, denominator = (
                numerator.numerator * denominator.denominator,
                denominator.numerator * numerator.denominator
                )
        else:
            raise TypeError("both arguments should be "
                            "Rational instances")

        if denominator == 0:
            raise ZeroDivisionError('Fraction(%s, 0)' % numerator)
        if _normalize:
            if type(numerator) is int is type(denominator):
                # *very* normal case
                g = math.gcd(numerator, denominator)
                if denominator < 0:
                    g = -g
            else:
                g = _gcd(numerator, denominator)
            numerator //= g
            denominator //= g
        self._numerator = numerator
        self._denominator = denominator
        return self

    @classmethod
    def from_float(cls, f):
        """Converts a finite float to a rational number, exactly.

        Beware that Fraction.from_float(0.3) != Fraction(3, 10).

        """
        if isinstance(f, numbers.Integral):
            return cls(f)
        elif not isinstance(f, float):
            raise TypeError("%s.from_float() only takes floats, not %r (%s)" %
                            (cls.__name__, f, type(f).__name__))
        return cls(*f.as_integer_ratio())

    @classmethod
    def from_decimal(cls, dec):
        """Converts a finite Decimal instance to a rational number, exactly."""
        from decimal import Decimal
        if isinstance(dec, numbers.Integral):
            dec = Decimal(int(dec))
        elif not isinstance(dec, Decimal):
            raise TypeError(
                "%s.from_decimal() only takes Decimals, not %r (%s)" %
                (cls.__name__, dec, type(dec).__name__))
        return cls(*dec.as_integer_ratio())

    def as_integer_ratio(self):
        """Return the integer ratio as a tuple.

        Return a tuple of two integers, whose ratio is equal to the
        Fraction and with a positive denominator.
        """
        return (self._numerator, self._denominator)

    def limit_denominator(self, max_denominator=1000000):
        """Closest Fraction to self with denominator at most max_denominator.

        >>> Fraction('3.141592653589793').limit_denominator(10)
        Fraction(22, 7)
        >>> Fraction('3.141592653589793').limit_denominator(100)
        Fraction(311, 99)
        >>> Fraction(4321, 8765).limit_denominator(10000)
        Fraction(4321, 8765)

        """
        # Algorithm notes: For any real number x, define a *best upper
        # approximation* to x to be a rational number p/q such that:
        #
        #   (1) p/q >= x, and
        #   (2) if p/q > r/s >= x then s > q, for any rational r/s.
        #
        # Define *best lower approximation* similarly.  Then it can be
        # proved that a rational number is a best upper or lower
        # approximation to x if, and only if, it is a convergent or
        # semiconvergent of the (unique shortest) continued fraction
        # associated to x.
        #
        # To find a best rational approximation with denominator <= M,
        # we find the best upper and lower approximations with
        # denominator <= M and take whichever of these is closer to x.
        # In the event of a tie, the bound with smaller denominator is
        # chosen.  If both denominators are equal (which can happen
        # only when max_denominator == 1 and self is midway between
        # two integers) the lower bound---i.e., the floor of self, is
        # taken.

        if max_denominator < 1:
            raise ValueError("max_denominator should be at least 1")
        if self._denominator <= max_denominator:
            return Fraction(self)

        p0, q0, p1, q1 = 0, 1, 1, 0
        n, d = self._numerator, self._denominator
        while True:
            a = n//d
            q2 = q0+a*q1
            if q2 > max_denominator:
                break
            p0, q0, p1, q1 = p1, q1, p0+a*p1, q2
            n, d = d, n-a*d

        k = (max_denominator-q0)//q1
        bound1 = Fraction(p0+k*p1, q0+k*q1)
        bound2 = Fraction(p1, q1)
        if abs(bound2 - self) <= abs(bound1-self):
            return bound2
        else:
            return bound1

    @property
    def numerator(a):
        return a._numerator

    @property
    def denominator(a):
        return a._denominator

    def __repr__(self):
        """repr(self)"""
        return '%s(%s, %s)' % (self.__class__.__name__,
                               self._numerator, self._denominator)

    def __str__(self):
        """str(self)"""
        if self._denominator == 1:
            return str(self._numerator)
        else:
            return '%s/%s' % (self._numerator, self._denominator)

    def _operator_fallbacks(monomorphic_operator, fallback_operator):
        """Generates forward and reverse operators given a purely-rational
        operator and a function from the operator module.

        Use this like:
        __op__, __rop__ = _operator_fallbacks(just_rational_op, operator.op)

        In general, we want to implement the arithmetic operations so
        that mixed-mode operations either call an implementation whose
        author knew about the types of both arguments, or convert both
        to the nearest built in type and do the operation there. In
        Fraction, that means that we define __add__ and __radd__ as:

            def __add__(self, other):
                # Both types have numerators/denominator attributes,
                # so do the operation directly
                if isinstance(other, (int, Fraction)):
                    return Fraction(self.numerator * other.denominator +
                                    other.numerator * self.denominator,
                                    self.denominator * other.denominator)
                # float and complex don't have those operations, but we
                # know about those types, so special case them.
                elif isinstance(other, float):
                    return float(self) + other
                elif isinstance(other, complex):
                    return complex(self) + other
                # Let the other type take over.
                return NotImplemented

            def __radd__(self, other):
                # radd handles more types than add because there's
                # nothing left to fall back to.
                if isinstance(other, numbers.Rational):
                    return Fraction(self.numerator * other.denominator +
                                    other.numerator * self.denominator,
                                    self.denominator * other.denominator)
                elif isinstance(other, Real):
                    return float(other) + float(self)
                elif isinstance(other, Complex):
                    return complex(other) + complex(self)
                return NotImplemented


        There are 5 different cases for a mixed-type addition on
        Fraction. I'll refer to all of the above code that doesn't
        refer to Fraction, float, or complex as "boilerplate". 'r'
        will be an instance of Fraction, which is a subtype of
        Rational (r : Fraction <: Rational), and b : B <:
        Complex. The first three involve 'r + b':

            1. If B <: Fraction, int, float, or complex, we handle
               that specially, and all is well.
            2. If Fraction falls back to the boilerplate code, and it
               were to return a value from __add__, we'd miss the
               possibility that B defines a more intelligent __radd__,
               so the boilerplate should return NotImplemented from
               __add__. In particular, we don't handle Rational
               here, even though we could get an exact answer, in case
               the other type wants to do something special.
            3. If B <: Fraction, Python tries B.__radd__ before
               Fraction.__add__. This is ok, because it was
               implemented with knowledge of Fraction, so it can
               handle those instances before delegating to Real or
               Complex.

        The next two situations describe 'b + r'. We assume that b
        didn't know about Fraction in its implementation, and that it
        uses similar boilerplate code:

            4. If B <: Rational, then __radd_ converts both to the
               builtin rational type (hey look, that's us) and
               proceeds.
            5. Otherwise, __radd__ tries to find the nearest common
               base ABC, and fall back to its builtin type. Since this
               class doesn't subclass a concrete type, there's no
               implementation to fall back to, so we need to try as
               hard as possible to return an actual value, or the user
               will get a TypeError.

        """
        def forward(a, b):
            if isinstance(b, (int, Fraction)):
                return monomorphic_operator(a, b)
            elif isinstance(b, float):
                return fallback_operator(float(a), b)
            elif isinstance(b, complex):
                return fallback_operator(complex(a), b)
            else:
                return NotImplemented
        forward.__name__ = '__' + fallback_operator.__name__ + '__'
        forward.__doc__ = monomorphic_operator.__doc__

        def reverse(b, a):
            if isinstance(a, numbers.Rational):
                # Includes ints.
                return monomorphic_operator(a, b)
            elif isinstance(a, numbers.Real):
                return fallback_operator(float(a), float(b))
            elif isinstance(a, numbers.Complex):
                return fallback_operator(complex(a), complex(b))
            else:
                return NotImplemented
        reverse.__name__ = '__r' + fallback_operator.__name__ + '__'
        reverse.__doc__ = monomorphic_operator.__doc__

        return forward, reverse

    def _add(a, b):
        """a + b"""
        da, db = a.denominator, b.denominator
        return Fraction(a.numerator * db + b.numerator * da,
                        da * db)

    __add__, __radd__ = _operator_fallbacks(_add, operator.add)

    def _sub(a, b):
        """a - b"""
        da, db = a.denominator, b.denominator
        return Fraction(a.numerator * db - b.numerator * da,
                        da * db)

    __sub__, __rsub__ = _operator_fallbacks(_sub, operator.sub)

    def _mul(a, b):
        """a * b"""
        return Fraction(a.numerator * b.numerator, a.denominator * b.denominator)

    __mul__, __rmul__ = _operator_fallbacks(_mul, operator.mul)

    def _div(a, b):
        """a / b"""
        return Fraction(a.numerator * b.denominator,
                        a.denominator * b.numerator)

    __truediv__, __rtruediv__ = _operator_fallbacks(_div, operator.truediv)

    def _floordiv(a, b):
        """a // b"""
        return (a.numerator * b.denominator) // (a.denominator * b.numerator)

    __floordiv__, __rfloordiv__ = _operator_fallbacks(_floordiv, operator.floordiv)

    def _divmod(a, b):
        """(a // b, a % b)"""
        da, db = a.denominator, b.denominator
        div, n_mod = divmod(a.numerator * db, da * b.numerator)
        return div, Fraction(n_mod, da * db)

    __divmod__, __rdivmod__ = _operator_fallbacks(_divmod, divmod)

    def _mod(a, b):
        """a % b"""
        da, db = a.denominator, b.denominator
        return Fraction((a.numerator * db) % (b.numerator * da), da * db)

    __mod__, __rmod__ = _operator_fallbacks(_mod, operator.mod)

    def __pow__(a, b):
        """a ** b

        If b is not an integer, the result will be a float or complex
        since roots are generally irrational. If b is an integer, the
        result will be rational.

        """
        if isinstance(b, numbers.Rational):
            if b.denominator == 1:
                power = b.numerator
                if power >= 0:
                    return Fraction(a._numerator ** power,
                                    a._denominator ** power,
                                    _normalize=False)
                elif a._numerator >= 0:
                    return Fraction(a._denominator ** -power,
                                    a._numerator ** -power,
                                    _normalize=False)
                else:
                    return Fraction((-a._denominator) ** -power,
                                    (-a._numerator) ** -power,
                                    _normalize=False)
            else:
                # A fractional power will generally produce an
                # irrational number.
                return float(a) ** float(b)
        else:
            return float(a) ** b

    def __rpow__(b, a):
        """a ** b"""
        if b._denominator == 1 and b._numerator >= 0:
            # If a is an int, keep it that way if possible.
            return a ** b._numerator

        if isinstance(a, numbers.Rational):
            return Fraction(a.numerator, a.denominator) ** b

        if b._denominator == 1:
            return a ** b._numerator

        return a ** float(b)

    def __pos__(a):
        """+a: Coerces a subclass instance to Fraction"""
        return Fraction(a._numerator, a._denominator, _normalize=False)

    def __neg__(a):
        """-a"""
        return Fraction(-a._numerator, a._denominator, _normalize=False)

    def __abs__(a):
        """abs(a)"""
        return Fraction(abs(a._numerator), a._denominator, _normalize=False)

    def __trunc__(a):
        """trunc(a)"""
        if a._numerator < 0:
            return -(-a._numerator // a._denominator)
        else:
            return a._numerator // a._denominator

    def __floor__(a):
        """math.floor(a)"""
        return a.numerator // a.denominator

    def __ceil__(a):
        """math.ceil(a)"""
        # The negations cleverly convince floordiv to return the ceiling.
        return -(-a.numerator // a.denominator)

    def __round__(self, ndigits=None):
        """round(self, ndigits)

        Rounds half toward even.
        """
        if ndigits is None:
            floor, remainder = divmod(self.numerator, self.denominator)
            if remainder * 2 < self.denominator:
                return floor
            elif remainder * 2 > self.denominator:
                return floor + 1
            # Deal with the half case:
            elif floor % 2 == 0:
                return floor
            else:
                return floor + 1
        shift = 10**abs(ndigits)
        # See _operator_fallbacks.forward to check that the results of
        # these operations will always be Fraction and therefore have
        # round().
        if ndigits > 0:
            return Fraction(round(self * shift), shift)
        else:
            return Fraction(round(self / shift) * shift)

    def __hash__(self):
        """hash(self)"""

        # XXX since this method is expensive, consider caching the result

        # In order to make sure that the hash of a Fraction agrees
        # with the hash of a numerically equal integer, float or
        # Decimal instance, we follow the rules for numeric hashes
        # outlined in the documentation.  (See library docs, 'Built-in
        # Types').

        # dinv is the inverse of self._denominator modulo the prime
        # _PyHASH_MODULUS, or 0 if self._denominator is divisible by
        # _PyHASH_MODULUS.
        dinv = pow(self._denominator, _PyHASH_MODULUS - 2, _PyHASH_MODULUS)
        if not dinv:
            hash_ = _PyHASH_INF
        else:
            hash_ = abs(self._numerator) * dinv % _PyHASH_MODULUS
        result = hash_ if self >= 0 else -hash_
        return -2 if result == -1 else result

    def __eq__(a, b):
        """a == b"""
        if type(b) is int:
            return a._numerator == b and a._denominator == 1
        if isinstance(b, numbers.Rational):
            return (a._numerator == b.numerator and
                    a._denominator == b.denominator)
        if isinstance(b, numbers.Complex) and b.imag == 0:
            b = b.real
        if isinstance(b, float):
            if math.isnan(b) or math.isinf(b):
                # comparisons with an infinity or nan should behave in
                # the same way for any finite a, so treat a as zero.
                return 0.0 == b
            else:
                return a == a.from_float(b)
        else:
            # Since a doesn't know how to compare with b, let's give b
            # a chance to compare itself with a.
            return NotImplemented

    def _richcmp(self, other, op):
        """Helper for comparison operators, for internal use only.

        Implement comparison between a Rational instance `self`, and
        either another Rational instance or a float `other`.  If
        `other` is not a Rational instance or a float, return
        NotImplemented. `op` should be one of the six standard
        comparison operators.

        """
        # convert other to a Rational instance where reasonable.
        if isinstance(other, numbers.Rational):
            return op(self._numerator * other.denominator,
                      self._denominator * other.numerator)
        if isinstance(other, float):
            if math.isnan(other) or math.isinf(other):
                return op(0.0, other)
            else:
                return op(self, self.from_float(other))
        else:
            return NotImplemented

    def __lt__(a, b):
        """a < b"""
        return a._richcmp(b, operator.lt)

    def __gt__(a, b):
        """a > b"""
        return a._richcmp(b, operator.gt)

    def __le__(a, b):
        """a <= b"""
        return a._richcmp(b, operator.le)

    def __ge__(a, b):
        """a >= b"""
        return a._richcmp(b, operator.ge)

    def __bool__(a):
        """a != 0"""
        # bpo-39274: Use bool() because (a._numerator != 0) can return an
        # object which is not a bool.
        return bool(a._numerator)

    # support for pickling, copy, and deepcopy

    def __reduce__(self):
        return (self.__class__, (str(self),))

    def __copy__(self):
        if type(self) == Fraction:
            return self     # I'm immutable; therefore I am my own clone
        return self.__class__(self._numerator, self._denominator)

    def __deepcopy__(self, memo):
        if type(self) == Fraction:
            return self     # My components are also immutable
        return self.__class__(self._numerator, self._denominator)
glob.py000064400000013101151153537630006046 0ustar00"""Filename globbing utility."""

import os
import re
import fnmatch
import sys

__all__ = ["glob", "iglob", "escape"]

def glob(pathname, *, recursive=False):
    """Return a list of paths matching a pathname pattern.

    The pattern may contain simple shell-style wildcards a la
    fnmatch. However, unlike fnmatch, filenames starting with a
    dot are special cases that are not matched by '*' and '?'
    patterns.

    If recursive is true, the pattern '**' will match any files and
    zero or more directories and subdirectories.
    """
    return list(iglob(pathname, recursive=recursive))

def iglob(pathname, *, recursive=False):
    """Return an iterator which yields the paths matching a pathname pattern.

    The pattern may contain simple shell-style wildcards a la
    fnmatch. However, unlike fnmatch, filenames starting with a
    dot are special cases that are not matched by '*' and '?'
    patterns.

    If recursive is true, the pattern '**' will match any files and
    zero or more directories and subdirectories.
    """
    sys.audit("glob.glob", pathname, recursive)
    it = _iglob(pathname, recursive, False)
    if recursive and _isrecursive(pathname):
        s = next(it)  # skip empty string
        assert not s
    return it

def _iglob(pathname, recursive, dironly):
    dirname, basename = os.path.split(pathname)
    if not has_magic(pathname):
        assert not dironly
        if basename:
            if os.path.lexists(pathname):
                yield pathname
        else:
            # Patterns ending with a slash should match only directories
            if os.path.isdir(dirname):
                yield pathname
        return
    if not dirname:
        if recursive and _isrecursive(basename):
            yield from _glob2(dirname, basename, dironly)
        else:
            yield from _glob1(dirname, basename, dironly)
        return
    # `os.path.split()` returns the argument itself as a dirname if it is a
    # drive or UNC path.  Prevent an infinite recursion if a drive or UNC path
    # contains magic characters (i.e. r'\\?\C:').
    if dirname != pathname and has_magic(dirname):
        dirs = _iglob(dirname, recursive, True)
    else:
        dirs = [dirname]
    if has_magic(basename):
        if recursive and _isrecursive(basename):
            glob_in_dir = _glob2
        else:
            glob_in_dir = _glob1
    else:
        glob_in_dir = _glob0
    for dirname in dirs:
        for name in glob_in_dir(dirname, basename, dironly):
            yield os.path.join(dirname, name)

# These 2 helper functions non-recursively glob inside a literal directory.
# They return a list of basenames.  _glob1 accepts a pattern while _glob0
# takes a literal basename (so it only has to check for its existence).

def _glob1(dirname, pattern, dironly):
    names = list(_iterdir(dirname, dironly))
    if not _ishidden(pattern):
        names = (x for x in names if not _ishidden(x))
    return fnmatch.filter(names, pattern)

def _glob0(dirname, basename, dironly):
    if not basename:
        # `os.path.split()` returns an empty basename for paths ending with a
        # directory separator.  'q*x/' should match only directories.
        if os.path.isdir(dirname):
            return [basename]
    else:
        if os.path.lexists(os.path.join(dirname, basename)):
            return [basename]
    return []

# Following functions are not public but can be used by third-party code.

def glob0(dirname, pattern):
    return _glob0(dirname, pattern, False)

def glob1(dirname, pattern):
    return _glob1(dirname, pattern, False)

# This helper function recursively yields relative pathnames inside a literal
# directory.

def _glob2(dirname, pattern, dironly):
    assert _isrecursive(pattern)
    yield pattern[:0]
    yield from _rlistdir(dirname, dironly)

# If dironly is false, yields all file names inside a directory.
# If dironly is true, yields only directory names.
def _iterdir(dirname, dironly):
    if not dirname:
        if isinstance(dirname, bytes):
            dirname = bytes(os.curdir, 'ASCII')
        else:
            dirname = os.curdir
    try:
        with os.scandir(dirname) as it:
            for entry in it:
                try:
                    if not dironly or entry.is_dir():
                        yield entry.name
                except OSError:
                    pass
    except OSError:
        return

# Recursively yields relative pathnames inside a literal directory.
def _rlistdir(dirname, dironly):
    names = list(_iterdir(dirname, dironly))
    for x in names:
        if not _ishidden(x):
            yield x
            path = os.path.join(dirname, x) if dirname else x
            for y in _rlistdir(path, dironly):
                yield os.path.join(x, y)


magic_check = re.compile('([*?[])')
magic_check_bytes = re.compile(b'([*?[])')

def has_magic(s):
    if isinstance(s, bytes):
        match = magic_check_bytes.search(s)
    else:
        match = magic_check.search(s)
    return match is not None

def _ishidden(path):
    return path[0] in ('.', b'.'[0])

def _isrecursive(pattern):
    if isinstance(pattern, bytes):
        return pattern == b'**'
    else:
        return pattern == '**'

def escape(pathname):
    """Escape all special characters.
    """
    # Escaping is done by wrapping any of "*?[" between square brackets.
    # Metacharacters do not work in the drive part and shouldn't be escaped.
    drive, pathname = os.path.splitdrive(pathname)
    if isinstance(pathname, bytes):
        pathname = magic_check_bytes.sub(br'[\1]', pathname)
    else:
        pathname = magic_check.sub(r'[\1]', pathname)
    return drive + pathname
secrets.py000064400000003766151153537630006613 0ustar00"""Generate cryptographically strong pseudo-random numbers suitable for
managing secrets such as account authentication, tokens, and similar.

See PEP 506 for more information.
https://www.python.org/dev/peps/pep-0506/

"""

__all__ = ['choice', 'randbelow', 'randbits', 'SystemRandom',
           'token_bytes', 'token_hex', 'token_urlsafe',
           'compare_digest',
           ]


import base64
import binascii
import os

from hmac import compare_digest
from random import SystemRandom

_sysrand = SystemRandom()

randbits = _sysrand.getrandbits
choice = _sysrand.choice

def randbelow(exclusive_upper_bound):
    """Return a random int in the range [0, n)."""
    if exclusive_upper_bound <= 0:
        raise ValueError("Upper bound must be positive.")
    return _sysrand._randbelow(exclusive_upper_bound)

DEFAULT_ENTROPY = 32  # number of bytes to return by default

def token_bytes(nbytes=None):
    """Return a random byte string containing *nbytes* bytes.

    If *nbytes* is ``None`` or not supplied, a reasonable
    default is used.

    >>> token_bytes(16)  #doctest:+SKIP
    b'\\xebr\\x17D*t\\xae\\xd4\\xe3S\\xb6\\xe2\\xebP1\\x8b'

    """
    if nbytes is None:
        nbytes = DEFAULT_ENTROPY
    return os.urandom(nbytes)

def token_hex(nbytes=None):
    """Return a random text string, in hexadecimal.

    The string has *nbytes* random bytes, each byte converted to two
    hex digits.  If *nbytes* is ``None`` or not supplied, a reasonable
    default is used.

    >>> token_hex(16)  #doctest:+SKIP
    'f9bf78b9a18ce6d46a0cd2b0b86df9da'

    """
    return binascii.hexlify(token_bytes(nbytes)).decode('ascii')

def token_urlsafe(nbytes=None):
    """Return a random URL-safe text string, in Base64 encoding.

    The string has *nbytes* random bytes.  If *nbytes* is ``None``
    or not supplied, a reasonable default is used.

    >>> token_urlsafe(16)  #doctest:+SKIP
    'Drmhze6EPcv0fN_81Bj-nA'

    """
    tok = token_bytes(nbytes)
    return base64.urlsafe_b64encode(tok).rstrip(b'=').decode('ascii')
sre_constants.py000064400000015762151153537630010027 0ustar00#
# Secret Labs' Regular Expression Engine
#
# various symbols used by the regular expression engine.
# run this script to update the _sre include files!
#
# Copyright (c) 1998-2001 by Secret Labs AB.  All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#

"""Internal support module for sre"""

# update when constants are added or removed

MAGIC = 20171005

from _sre import MAXREPEAT, MAXGROUPS

# SRE standard exception (access as sre.error)
# should this really be here?

class error(Exception):
    """Exception raised for invalid regular expressions.

    Attributes:

        msg: The unformatted error message
        pattern: The regular expression pattern
        pos: The index in the pattern where compilation failed (may be None)
        lineno: The line corresponding to pos (may be None)
        colno: The column corresponding to pos (may be None)
    """

    __module__ = 're'

    def __init__(self, msg, pattern=None, pos=None):
        self.msg = msg
        self.pattern = pattern
        self.pos = pos
        if pattern is not None and pos is not None:
            msg = '%s at position %d' % (msg, pos)
            if isinstance(pattern, str):
                newline = '\n'
            else:
                newline = b'\n'
            self.lineno = pattern.count(newline, 0, pos) + 1
            self.colno = pos - pattern.rfind(newline, 0, pos)
            if newline in pattern:
                msg = '%s (line %d, column %d)' % (msg, self.lineno, self.colno)
        else:
            self.lineno = self.colno = None
        super().__init__(msg)


class _NamedIntConstant(int):
    def __new__(cls, value, name):
        self = super(_NamedIntConstant, cls).__new__(cls, value)
        self.name = name
        return self

    def __repr__(self):
        return self.name

MAXREPEAT = _NamedIntConstant(MAXREPEAT, 'MAXREPEAT')

def _makecodes(names):
    names = names.strip().split()
    items = [_NamedIntConstant(i, name) for i, name in enumerate(names)]
    globals().update({item.name: item for item in items})
    return items

# operators
# failure=0 success=1 (just because it looks better that way :-)
OPCODES = _makecodes("""
    FAILURE SUCCESS

    ANY ANY_ALL
    ASSERT ASSERT_NOT
    AT
    BRANCH
    CALL
    CATEGORY
    CHARSET BIGCHARSET
    GROUPREF GROUPREF_EXISTS
    IN
    INFO
    JUMP
    LITERAL
    MARK
    MAX_UNTIL
    MIN_UNTIL
    NOT_LITERAL
    NEGATE
    RANGE
    REPEAT
    REPEAT_ONE
    SUBPATTERN
    MIN_REPEAT_ONE

    GROUPREF_IGNORE
    IN_IGNORE
    LITERAL_IGNORE
    NOT_LITERAL_IGNORE

    GROUPREF_LOC_IGNORE
    IN_LOC_IGNORE
    LITERAL_LOC_IGNORE
    NOT_LITERAL_LOC_IGNORE

    GROUPREF_UNI_IGNORE
    IN_UNI_IGNORE
    LITERAL_UNI_IGNORE
    NOT_LITERAL_UNI_IGNORE
    RANGE_UNI_IGNORE

    MIN_REPEAT MAX_REPEAT
""")
del OPCODES[-2:] # remove MIN_REPEAT and MAX_REPEAT

# positions
ATCODES = _makecodes("""
    AT_BEGINNING AT_BEGINNING_LINE AT_BEGINNING_STRING
    AT_BOUNDARY AT_NON_BOUNDARY
    AT_END AT_END_LINE AT_END_STRING

    AT_LOC_BOUNDARY AT_LOC_NON_BOUNDARY

    AT_UNI_BOUNDARY AT_UNI_NON_BOUNDARY
""")

# categories
CHCODES = _makecodes("""
    CATEGORY_DIGIT CATEGORY_NOT_DIGIT
    CATEGORY_SPACE CATEGORY_NOT_SPACE
    CATEGORY_WORD CATEGORY_NOT_WORD
    CATEGORY_LINEBREAK CATEGORY_NOT_LINEBREAK

    CATEGORY_LOC_WORD CATEGORY_LOC_NOT_WORD

    CATEGORY_UNI_DIGIT CATEGORY_UNI_NOT_DIGIT
    CATEGORY_UNI_SPACE CATEGORY_UNI_NOT_SPACE
    CATEGORY_UNI_WORD CATEGORY_UNI_NOT_WORD
    CATEGORY_UNI_LINEBREAK CATEGORY_UNI_NOT_LINEBREAK
""")


# replacement operations for "ignore case" mode
OP_IGNORE = {
    LITERAL: LITERAL_IGNORE,
    NOT_LITERAL: NOT_LITERAL_IGNORE,
}

OP_LOCALE_IGNORE = {
    LITERAL: LITERAL_LOC_IGNORE,
    NOT_LITERAL: NOT_LITERAL_LOC_IGNORE,
}

OP_UNICODE_IGNORE = {
    LITERAL: LITERAL_UNI_IGNORE,
    NOT_LITERAL: NOT_LITERAL_UNI_IGNORE,
}

AT_MULTILINE = {
    AT_BEGINNING: AT_BEGINNING_LINE,
    AT_END: AT_END_LINE
}

AT_LOCALE = {
    AT_BOUNDARY: AT_LOC_BOUNDARY,
    AT_NON_BOUNDARY: AT_LOC_NON_BOUNDARY
}

AT_UNICODE = {
    AT_BOUNDARY: AT_UNI_BOUNDARY,
    AT_NON_BOUNDARY: AT_UNI_NON_BOUNDARY
}

CH_LOCALE = {
    CATEGORY_DIGIT: CATEGORY_DIGIT,
    CATEGORY_NOT_DIGIT: CATEGORY_NOT_DIGIT,
    CATEGORY_SPACE: CATEGORY_SPACE,
    CATEGORY_NOT_SPACE: CATEGORY_NOT_SPACE,
    CATEGORY_WORD: CATEGORY_LOC_WORD,
    CATEGORY_NOT_WORD: CATEGORY_LOC_NOT_WORD,
    CATEGORY_LINEBREAK: CATEGORY_LINEBREAK,
    CATEGORY_NOT_LINEBREAK: CATEGORY_NOT_LINEBREAK
}

CH_UNICODE = {
    CATEGORY_DIGIT: CATEGORY_UNI_DIGIT,
    CATEGORY_NOT_DIGIT: CATEGORY_UNI_NOT_DIGIT,
    CATEGORY_SPACE: CATEGORY_UNI_SPACE,
    CATEGORY_NOT_SPACE: CATEGORY_UNI_NOT_SPACE,
    CATEGORY_WORD: CATEGORY_UNI_WORD,
    CATEGORY_NOT_WORD: CATEGORY_UNI_NOT_WORD,
    CATEGORY_LINEBREAK: CATEGORY_UNI_LINEBREAK,
    CATEGORY_NOT_LINEBREAK: CATEGORY_UNI_NOT_LINEBREAK
}

# flags
SRE_FLAG_TEMPLATE = 1 # template mode (disable backtracking)
SRE_FLAG_IGNORECASE = 2 # case insensitive
SRE_FLAG_LOCALE = 4 # honour system locale
SRE_FLAG_MULTILINE = 8 # treat target as multiline string
SRE_FLAG_DOTALL = 16 # treat target as a single string
SRE_FLAG_UNICODE = 32 # use unicode "locale"
SRE_FLAG_VERBOSE = 64 # ignore whitespace and comments
SRE_FLAG_DEBUG = 128 # debugging
SRE_FLAG_ASCII = 256 # use ascii "locale"

# flags for INFO primitive
SRE_INFO_PREFIX = 1 # has prefix
SRE_INFO_LITERAL = 2 # entire pattern is literal (given by prefix)
SRE_INFO_CHARSET = 4 # pattern starts with character from given set

if __name__ == "__main__":
    def dump(f, d, prefix):
        items = sorted(d)
        for item in items:
            f.write("#define %s_%s %d\n" % (prefix, item, item))
    with open("sre_constants.h", "w") as f:
        f.write("""\
/*
 * Secret Labs' Regular Expression Engine
 *
 * regular expression matching engine
 *
 * NOTE: This file is generated by sre_constants.py.  If you need
 * to change anything in here, edit sre_constants.py and run it.
 *
 * Copyright (c) 1997-2001 by Secret Labs AB.  All rights reserved.
 *
 * See the _sre.c file for information on usage and redistribution.
 */

""")

        f.write("#define SRE_MAGIC %d\n" % MAGIC)

        dump(f, OPCODES, "SRE_OP")
        dump(f, ATCODES, "SRE")
        dump(f, CHCODES, "SRE")

        f.write("#define SRE_FLAG_TEMPLATE %d\n" % SRE_FLAG_TEMPLATE)
        f.write("#define SRE_FLAG_IGNORECASE %d\n" % SRE_FLAG_IGNORECASE)
        f.write("#define SRE_FLAG_LOCALE %d\n" % SRE_FLAG_LOCALE)
        f.write("#define SRE_FLAG_MULTILINE %d\n" % SRE_FLAG_MULTILINE)
        f.write("#define SRE_FLAG_DOTALL %d\n" % SRE_FLAG_DOTALL)
        f.write("#define SRE_FLAG_UNICODE %d\n" % SRE_FLAG_UNICODE)
        f.write("#define SRE_FLAG_VERBOSE %d\n" % SRE_FLAG_VERBOSE)
        f.write("#define SRE_FLAG_DEBUG %d\n" % SRE_FLAG_DEBUG)
        f.write("#define SRE_FLAG_ASCII %d\n" % SRE_FLAG_ASCII)

        f.write("#define SRE_INFO_PREFIX %d\n" % SRE_INFO_PREFIX)
        f.write("#define SRE_INFO_LITERAL %d\n" % SRE_INFO_LITERAL)
        f.write("#define SRE_INFO_CHARSET %d\n" % SRE_INFO_CHARSET)

    print("done")
xdrlib.py000064400000013431151153537630006415 0ustar00"""Implements (a subset of) Sun XDR -- eXternal Data Representation.

See: RFC 1014

"""

import struct
from io import BytesIO
from functools import wraps

__all__ = ["Error", "Packer", "Unpacker", "ConversionError"]

# exceptions
class Error(Exception):
    """Exception class for this module. Use:

    except xdrlib.Error as var:
        # var has the Error instance for the exception

    Public ivars:
        msg -- contains the message

    """
    def __init__(self, msg):
        self.msg = msg
    def __repr__(self):
        return repr(self.msg)
    def __str__(self):
        return str(self.msg)


class ConversionError(Error):
    pass

def raise_conversion_error(function):
    """ Wrap any raised struct.errors in a ConversionError. """

    @wraps(function)
    def result(self, value):
        try:
            return function(self, value)
        except struct.error as e:
            raise ConversionError(e.args[0]) from None
    return result


class Packer:
    """Pack various data representations into a buffer."""

    def __init__(self):
        self.reset()

    def reset(self):
        self.__buf = BytesIO()

    def get_buffer(self):
        return self.__buf.getvalue()
    # backwards compatibility
    get_buf = get_buffer

    @raise_conversion_error
    def pack_uint(self, x):
        self.__buf.write(struct.pack('>L', x))

    @raise_conversion_error
    def pack_int(self, x):
        self.__buf.write(struct.pack('>l', x))

    pack_enum = pack_int

    def pack_bool(self, x):
        if x: self.__buf.write(b'\0\0\0\1')
        else: self.__buf.write(b'\0\0\0\0')

    def pack_uhyper(self, x):
        try:
            self.pack_uint(x>>32 & 0xffffffff)
        except (TypeError, struct.error) as e:
            raise ConversionError(e.args[0]) from None
        try:
            self.pack_uint(x & 0xffffffff)
        except (TypeError, struct.error) as e:
            raise ConversionError(e.args[0]) from None

    pack_hyper = pack_uhyper

    @raise_conversion_error
    def pack_float(self, x):
        self.__buf.write(struct.pack('>f', x))

    @raise_conversion_error
    def pack_double(self, x):
        self.__buf.write(struct.pack('>d', x))

    def pack_fstring(self, n, s):
        if n < 0:
            raise ValueError('fstring size must be nonnegative')
        data = s[:n]
        n = ((n+3)//4)*4
        data = data + (n - len(data)) * b'\0'
        self.__buf.write(data)

    pack_fopaque = pack_fstring

    def pack_string(self, s):
        n = len(s)
        self.pack_uint(n)
        self.pack_fstring(n, s)

    pack_opaque = pack_string
    pack_bytes = pack_string

    def pack_list(self, list, pack_item):
        for item in list:
            self.pack_uint(1)
            pack_item(item)
        self.pack_uint(0)

    def pack_farray(self, n, list, pack_item):
        if len(list) != n:
            raise ValueError('wrong array size')
        for item in list:
            pack_item(item)

    def pack_array(self, list, pack_item):
        n = len(list)
        self.pack_uint(n)
        self.pack_farray(n, list, pack_item)



class Unpacker:
    """Unpacks various data representations from the given buffer."""

    def __init__(self, data):
        self.reset(data)

    def reset(self, data):
        self.__buf = data
        self.__pos = 0

    def get_position(self):
        return self.__pos

    def set_position(self, position):
        self.__pos = position

    def get_buffer(self):
        return self.__buf

    def done(self):
        if self.__pos < len(self.__buf):
            raise Error('unextracted data remains')

    def unpack_uint(self):
        i = self.__pos
        self.__pos = j = i+4
        data = self.__buf[i:j]
        if len(data) < 4:
            raise EOFError
        return struct.unpack('>L', data)[0]

    def unpack_int(self):
        i = self.__pos
        self.__pos = j = i+4
        data = self.__buf[i:j]
        if len(data) < 4:
            raise EOFError
        return struct.unpack('>l', data)[0]

    unpack_enum = unpack_int

    def unpack_bool(self):
        return bool(self.unpack_int())

    def unpack_uhyper(self):
        hi = self.unpack_uint()
        lo = self.unpack_uint()
        return int(hi)<<32 | lo

    def unpack_hyper(self):
        x = self.unpack_uhyper()
        if x >= 0x8000000000000000:
            x = x - 0x10000000000000000
        return x

    def unpack_float(self):
        i = self.__pos
        self.__pos = j = i+4
        data = self.__buf[i:j]
        if len(data) < 4:
            raise EOFError
        return struct.unpack('>f', data)[0]

    def unpack_double(self):
        i = self.__pos
        self.__pos = j = i+8
        data = self.__buf[i:j]
        if len(data) < 8:
            raise EOFError
        return struct.unpack('>d', data)[0]

    def unpack_fstring(self, n):
        if n < 0:
            raise ValueError('fstring size must be nonnegative')
        i = self.__pos
        j = i + (n+3)//4*4
        if j > len(self.__buf):
            raise EOFError
        self.__pos = j
        return self.__buf[i:i+n]

    unpack_fopaque = unpack_fstring

    def unpack_string(self):
        n = self.unpack_uint()
        return self.unpack_fstring(n)

    unpack_opaque = unpack_string
    unpack_bytes = unpack_string

    def unpack_list(self, unpack_item):
        list = []
        while 1:
            x = self.unpack_uint()
            if x == 0: break
            if x != 1:
                raise ConversionError('0 or 1 expected, got %r' % (x,))
            item = unpack_item()
            list.append(item)
        return list

    def unpack_farray(self, n, unpack_item):
        list = []
        for i in range(n):
            list.append(unpack_item())
        return list

    def unpack_array(self, unpack_item):
        n = self.unpack_uint()
        return self.unpack_farray(n, unpack_item)
shutil.py000064400000145061151153537630006446 0ustar00"""Utility functions for copying and archiving files and directory trees.

XXX The functions here don't copy the resource fork or other metadata on Mac.

"""

import os
import sys
import stat
import fnmatch
import collections
import errno

try:
    import zlib
    del zlib
    _ZLIB_SUPPORTED = True
except ImportError:
    _ZLIB_SUPPORTED = False

try:
    import bz2
    del bz2
    _BZ2_SUPPORTED = True
except ImportError:
    _BZ2_SUPPORTED = False

try:
    import lzma
    del lzma
    _LZMA_SUPPORTED = True
except ImportError:
    _LZMA_SUPPORTED = False

try:
    from pwd import getpwnam
except ImportError:
    getpwnam = None

try:
    from grp import getgrnam
except ImportError:
    getgrnam = None

_WINDOWS = os.name == 'nt'
posix = nt = None
if os.name == 'posix':
    import posix
elif _WINDOWS:
    import nt

COPY_BUFSIZE = 1024 * 1024 if _WINDOWS else 64 * 1024
_USE_CP_SENDFILE = hasattr(os, "sendfile") and sys.platform.startswith("linux")
_HAS_FCOPYFILE = posix and hasattr(posix, "_fcopyfile")  # macOS

# CMD defaults in Windows 10
_WIN_DEFAULT_PATHEXT = ".COM;.EXE;.BAT;.CMD;.VBS;.JS;.WS;.MSC"

__all__ = ["copyfileobj", "copyfile", "copymode", "copystat", "copy", "copy2",
           "copytree", "move", "rmtree", "Error", "SpecialFileError",
           "ExecError", "make_archive", "get_archive_formats",
           "register_archive_format", "unregister_archive_format",
           "get_unpack_formats", "register_unpack_format",
           "unregister_unpack_format", "unpack_archive",
           "ignore_patterns", "chown", "which", "get_terminal_size",
           "SameFileError"]
           # disk_usage is added later, if available on the platform

class Error(OSError):
    pass

class SameFileError(Error):
    """Raised when source and destination are the same file."""

class SpecialFileError(OSError):
    """Raised when trying to do a kind of operation (e.g. copying) which is
    not supported on a special file (e.g. a named pipe)"""

class ExecError(OSError):
    """Raised when a command could not be executed"""

class ReadError(OSError):
    """Raised when an archive cannot be read"""

class RegistryError(Exception):
    """Raised when a registry operation with the archiving
    and unpacking registries fails"""

class _GiveupOnFastCopy(Exception):
    """Raised as a signal to fallback on using raw read()/write()
    file copy when fast-copy functions fail to do so.
    """

def _fastcopy_fcopyfile(fsrc, fdst, flags):
    """Copy a regular file content or metadata by using high-performance
    fcopyfile(3) syscall (macOS).
    """
    try:
        infd = fsrc.fileno()
        outfd = fdst.fileno()
    except Exception as err:
        raise _GiveupOnFastCopy(err)  # not a regular file

    try:
        posix._fcopyfile(infd, outfd, flags)
    except OSError as err:
        err.filename = fsrc.name
        err.filename2 = fdst.name
        if err.errno in {errno.EINVAL, errno.ENOTSUP}:
            raise _GiveupOnFastCopy(err)
        else:
            raise err from None

def _fastcopy_sendfile(fsrc, fdst):
    """Copy data from one regular mmap-like fd to another by using
    high-performance sendfile(2) syscall.
    This should work on Linux >= 2.6.33 only.
    """
    # Note: copyfileobj() is left alone in order to not introduce any
    # unexpected breakage. Possible risks by using zero-copy calls
    # in copyfileobj() are:
    # - fdst cannot be open in "a"(ppend) mode
    # - fsrc and fdst may be open in "t"(ext) mode
    # - fsrc may be a BufferedReader (which hides unread data in a buffer),
    #   GzipFile (which decompresses data), HTTPResponse (which decodes
    #   chunks).
    # - possibly others (e.g. encrypted fs/partition?)
    global _USE_CP_SENDFILE
    try:
        infd = fsrc.fileno()
        outfd = fdst.fileno()
    except Exception as err:
        raise _GiveupOnFastCopy(err)  # not a regular file

    # Hopefully the whole file will be copied in a single call.
    # sendfile() is called in a loop 'till EOF is reached (0 return)
    # so a bufsize smaller or bigger than the actual file size
    # should not make any difference, also in case the file content
    # changes while being copied.
    try:
        blocksize = max(os.fstat(infd).st_size, 2 ** 23)  # min 8MiB
    except OSError:
        blocksize = 2 ** 27  # 128MiB
    # On 32-bit architectures truncate to 1GiB to avoid OverflowError,
    # see bpo-38319.
    if sys.maxsize < 2 ** 32:
        blocksize = min(blocksize, 2 ** 30)

    offset = 0
    while True:
        try:
            sent = os.sendfile(outfd, infd, offset, blocksize)
        except OSError as err:
            # ...in oder to have a more informative exception.
            err.filename = fsrc.name
            err.filename2 = fdst.name

            if err.errno == errno.ENOTSOCK:
                # sendfile() on this platform (probably Linux < 2.6.33)
                # does not support copies between regular files (only
                # sockets).
                _USE_CP_SENDFILE = False
                raise _GiveupOnFastCopy(err)

            if err.errno == errno.ENOSPC:  # filesystem is full
                raise err from None

            # Give up on first call and if no data was copied.
            if offset == 0 and os.lseek(outfd, 0, os.SEEK_CUR) == 0:
                raise _GiveupOnFastCopy(err)

            raise err
        else:
            if sent == 0:
                break  # EOF
            offset += sent

def _copyfileobj_readinto(fsrc, fdst, length=COPY_BUFSIZE):
    """readinto()/memoryview() based variant of copyfileobj().
    *fsrc* must support readinto() method and both files must be
    open in binary mode.
    """
    # Localize variable access to minimize overhead.
    fsrc_readinto = fsrc.readinto
    fdst_write = fdst.write
    with memoryview(bytearray(length)) as mv:
        while True:
            n = fsrc_readinto(mv)
            if not n:
                break
            elif n < length:
                with mv[:n] as smv:
                    fdst.write(smv)
            else:
                fdst_write(mv)

def copyfileobj(fsrc, fdst, length=0):
    """copy data from file-like object fsrc to file-like object fdst"""
    # Localize variable access to minimize overhead.
    if not length:
        length = COPY_BUFSIZE
    fsrc_read = fsrc.read
    fdst_write = fdst.write
    while True:
        buf = fsrc_read(length)
        if not buf:
            break
        fdst_write(buf)

def _samefile(src, dst):
    # Macintosh, Unix.
    if isinstance(src, os.DirEntry) and hasattr(os.path, 'samestat'):
        try:
            return os.path.samestat(src.stat(), os.stat(dst))
        except OSError:
            return False

    if hasattr(os.path, 'samefile'):
        try:
            return os.path.samefile(src, dst)
        except OSError:
            return False

    # All other platforms: check for same pathname.
    return (os.path.normcase(os.path.abspath(src)) ==
            os.path.normcase(os.path.abspath(dst)))

def _stat(fn):
    return fn.stat() if isinstance(fn, os.DirEntry) else os.stat(fn)

def _islink(fn):
    return fn.is_symlink() if isinstance(fn, os.DirEntry) else os.path.islink(fn)

def copyfile(src, dst, *, follow_symlinks=True):
    """Copy data from src to dst in the most efficient way possible.

    If follow_symlinks is not set and src is a symbolic link, a new
    symlink will be created instead of copying the file it points to.

    """
    sys.audit("shutil.copyfile", src, dst)

    if _samefile(src, dst):
        raise SameFileError("{!r} and {!r} are the same file".format(src, dst))

    file_size = 0
    for i, fn in enumerate([src, dst]):
        try:
            st = _stat(fn)
        except OSError:
            # File most likely does not exist
            pass
        else:
            # XXX What about other special files? (sockets, devices...)
            if stat.S_ISFIFO(st.st_mode):
                fn = fn.path if isinstance(fn, os.DirEntry) else fn
                raise SpecialFileError("`%s` is a named pipe" % fn)
            if _WINDOWS and i == 0:
                file_size = st.st_size

    if not follow_symlinks and _islink(src):
        os.symlink(os.readlink(src), dst)
    else:
        with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
            # macOS
            if _HAS_FCOPYFILE:
                try:
                    _fastcopy_fcopyfile(fsrc, fdst, posix._COPYFILE_DATA)
                    return dst
                except _GiveupOnFastCopy:
                    pass
            # Linux
            elif _USE_CP_SENDFILE:
                try:
                    _fastcopy_sendfile(fsrc, fdst)
                    return dst
                except _GiveupOnFastCopy:
                    pass
            # Windows, see:
            # https://github.com/python/cpython/pull/7160#discussion_r195405230
            elif _WINDOWS and file_size > 0:
                _copyfileobj_readinto(fsrc, fdst, min(file_size, COPY_BUFSIZE))
                return dst

            copyfileobj(fsrc, fdst)

    return dst

def copymode(src, dst, *, follow_symlinks=True):
    """Copy mode bits from src to dst.

    If follow_symlinks is not set, symlinks aren't followed if and only
    if both `src` and `dst` are symlinks.  If `lchmod` isn't available
    (e.g. Linux) this method does nothing.

    """
    sys.audit("shutil.copymode", src, dst)

    if not follow_symlinks and _islink(src) and os.path.islink(dst):
        if hasattr(os, 'lchmod'):
            stat_func, chmod_func = os.lstat, os.lchmod
        else:
            return
    else:
        stat_func, chmod_func = _stat, os.chmod

    st = stat_func(src)
    chmod_func(dst, stat.S_IMODE(st.st_mode))

if hasattr(os, 'listxattr'):
    def _copyxattr(src, dst, *, follow_symlinks=True):
        """Copy extended filesystem attributes from `src` to `dst`.

        Overwrite existing attributes.

        If `follow_symlinks` is false, symlinks won't be followed.

        """

        try:
            names = os.listxattr(src, follow_symlinks=follow_symlinks)
        except OSError as e:
            if e.errno not in (errno.ENOTSUP, errno.ENODATA, errno.EINVAL):
                raise
            return
        for name in names:
            try:
                value = os.getxattr(src, name, follow_symlinks=follow_symlinks)
                os.setxattr(dst, name, value, follow_symlinks=follow_symlinks)
            except OSError as e:
                if e.errno not in (errno.EPERM, errno.ENOTSUP, errno.ENODATA,
                                   errno.EINVAL):
                    raise
else:
    def _copyxattr(*args, **kwargs):
        pass

def copystat(src, dst, *, follow_symlinks=True):
    """Copy file metadata

    Copy the permission bits, last access time, last modification time, and
    flags from `src` to `dst`. On Linux, copystat() also copies the "extended
    attributes" where possible. The file contents, owner, and group are
    unaffected. `src` and `dst` are path-like objects or path names given as
    strings.

    If the optional flag `follow_symlinks` is not set, symlinks aren't
    followed if and only if both `src` and `dst` are symlinks.
    """
    sys.audit("shutil.copystat", src, dst)

    def _nop(*args, ns=None, follow_symlinks=None):
        pass

    # follow symlinks (aka don't not follow symlinks)
    follow = follow_symlinks or not (_islink(src) and os.path.islink(dst))
    if follow:
        # use the real function if it exists
        def lookup(name):
            return getattr(os, name, _nop)
    else:
        # use the real function only if it exists
        # *and* it supports follow_symlinks
        def lookup(name):
            fn = getattr(os, name, _nop)
            if fn in os.supports_follow_symlinks:
                return fn
            return _nop

    if isinstance(src, os.DirEntry):
        st = src.stat(follow_symlinks=follow)
    else:
        st = lookup("stat")(src, follow_symlinks=follow)
    mode = stat.S_IMODE(st.st_mode)
    lookup("utime")(dst, ns=(st.st_atime_ns, st.st_mtime_ns),
        follow_symlinks=follow)
    # We must copy extended attributes before the file is (potentially)
    # chmod()'ed read-only, otherwise setxattr() will error with -EACCES.
    _copyxattr(src, dst, follow_symlinks=follow)
    try:
        lookup("chmod")(dst, mode, follow_symlinks=follow)
    except NotImplementedError:
        # if we got a NotImplementedError, it's because
        #   * follow_symlinks=False,
        #   * lchown() is unavailable, and
        #   * either
        #       * fchownat() is unavailable or
        #       * fchownat() doesn't implement AT_SYMLINK_NOFOLLOW.
        #         (it returned ENOSUP.)
        # therefore we're out of options--we simply cannot chown the
        # symlink.  give up, suppress the error.
        # (which is what shutil always did in this circumstance.)
        pass
    if hasattr(st, 'st_flags'):
        try:
            lookup("chflags")(dst, st.st_flags, follow_symlinks=follow)
        except OSError as why:
            for err in 'EOPNOTSUPP', 'ENOTSUP':
                if hasattr(errno, err) and why.errno == getattr(errno, err):
                    break
            else:
                raise

def copy(src, dst, *, follow_symlinks=True):
    """Copy data and mode bits ("cp src dst"). Return the file's destination.

    The destination may be a directory.

    If follow_symlinks is false, symlinks won't be followed. This
    resembles GNU's "cp -P src dst".

    If source and destination are the same file, a SameFileError will be
    raised.

    """
    if os.path.isdir(dst):
        dst = os.path.join(dst, os.path.basename(src))
    copyfile(src, dst, follow_symlinks=follow_symlinks)
    copymode(src, dst, follow_symlinks=follow_symlinks)
    return dst

def copy2(src, dst, *, follow_symlinks=True):
    """Copy data and metadata. Return the file's destination.

    Metadata is copied with copystat(). Please see the copystat function
    for more information.

    The destination may be a directory.

    If follow_symlinks is false, symlinks won't be followed. This
    resembles GNU's "cp -P src dst".
    """
    if os.path.isdir(dst):
        dst = os.path.join(dst, os.path.basename(src))
    copyfile(src, dst, follow_symlinks=follow_symlinks)
    copystat(src, dst, follow_symlinks=follow_symlinks)
    return dst

def ignore_patterns(*patterns):
    """Function that can be used as copytree() ignore parameter.

    Patterns is a sequence of glob-style patterns
    that are used to exclude files"""
    def _ignore_patterns(path, names):
        ignored_names = []
        for pattern in patterns:
            ignored_names.extend(fnmatch.filter(names, pattern))
        return set(ignored_names)
    return _ignore_patterns

def _copytree(entries, src, dst, symlinks, ignore, copy_function,
              ignore_dangling_symlinks, dirs_exist_ok=False):
    if ignore is not None:
        ignored_names = ignore(os.fspath(src), [x.name for x in entries])
    else:
        ignored_names = set()

    os.makedirs(dst, exist_ok=dirs_exist_ok)
    errors = []
    use_srcentry = copy_function is copy2 or copy_function is copy

    for srcentry in entries:
        if srcentry.name in ignored_names:
            continue
        srcname = os.path.join(src, srcentry.name)
        dstname = os.path.join(dst, srcentry.name)
        srcobj = srcentry if use_srcentry else srcname
        try:
            is_symlink = srcentry.is_symlink()
            if is_symlink and os.name == 'nt':
                # Special check for directory junctions, which appear as
                # symlinks but we want to recurse.
                lstat = srcentry.stat(follow_symlinks=False)
                if lstat.st_reparse_tag == stat.IO_REPARSE_TAG_MOUNT_POINT:
                    is_symlink = False
            if is_symlink:
                linkto = os.readlink(srcname)
                if symlinks:
                    # We can't just leave it to `copy_function` because legacy
                    # code with a custom `copy_function` may rely on copytree
                    # doing the right thing.
                    os.symlink(linkto, dstname)
                    copystat(srcobj, dstname, follow_symlinks=not symlinks)
                else:
                    # ignore dangling symlink if the flag is on
                    if not os.path.exists(linkto) and ignore_dangling_symlinks:
                        continue
                    # otherwise let the copy occur. copy2 will raise an error
                    if srcentry.is_dir():
                        copytree(srcobj, dstname, symlinks, ignore,
                                 copy_function, dirs_exist_ok=dirs_exist_ok)
                    else:
                        copy_function(srcobj, dstname)
            elif srcentry.is_dir():
                copytree(srcobj, dstname, symlinks, ignore, copy_function,
                         dirs_exist_ok=dirs_exist_ok)
            else:
                # Will raise a SpecialFileError for unsupported file types
                copy_function(srcobj, dstname)
        # catch the Error from the recursive copytree so that we can
        # continue with other files
        except Error as err:
            errors.extend(err.args[0])
        except OSError as why:
            errors.append((srcname, dstname, str(why)))
    try:
        copystat(src, dst)
    except OSError as why:
        # Copying file access times may fail on Windows
        if getattr(why, 'winerror', None) is None:
            errors.append((src, dst, str(why)))
    if errors:
        raise Error(errors)
    return dst

def copytree(src, dst, symlinks=False, ignore=None, copy_function=copy2,
             ignore_dangling_symlinks=False, dirs_exist_ok=False):
    """Recursively copy a directory tree and return the destination directory.

    dirs_exist_ok dictates whether to raise an exception in case dst or any
    missing parent directory already exists.

    If exception(s) occur, an Error is raised with a list of reasons.

    If the optional symlinks flag is true, symbolic links in the
    source tree result in symbolic links in the destination tree; if
    it is false, the contents of the files pointed to by symbolic
    links are copied. If the file pointed by the symlink doesn't
    exist, an exception will be added in the list of errors raised in
    an Error exception at the end of the copy process.

    You can set the optional ignore_dangling_symlinks flag to true if you
    want to silence this exception. Notice that this has no effect on
    platforms that don't support os.symlink.

    The optional ignore argument is a callable. If given, it
    is called with the `src` parameter, which is the directory
    being visited by copytree(), and `names` which is the list of
    `src` contents, as returned by os.listdir():

        callable(src, names) -> ignored_names

    Since copytree() is called recursively, the callable will be
    called once for each directory that is copied. It returns a
    list of names relative to the `src` directory that should
    not be copied.

    The optional copy_function argument is a callable that will be used
    to copy each file. It will be called with the source path and the
    destination path as arguments. By default, copy2() is used, but any
    function that supports the same signature (like copy()) can be used.

    """
    sys.audit("shutil.copytree", src, dst)
    with os.scandir(src) as itr:
        entries = list(itr)
    return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
                     ignore=ignore, copy_function=copy_function,
                     ignore_dangling_symlinks=ignore_dangling_symlinks,
                     dirs_exist_ok=dirs_exist_ok)

if hasattr(os.stat_result, 'st_file_attributes'):
    # Special handling for directory junctions to make them behave like
    # symlinks for shutil.rmtree, since in general they do not appear as
    # regular links.
    def _rmtree_isdir(entry):
        try:
            st = entry.stat(follow_symlinks=False)
            return (stat.S_ISDIR(st.st_mode) and not
                (st.st_file_attributes & stat.FILE_ATTRIBUTE_REPARSE_POINT
                 and st.st_reparse_tag == stat.IO_REPARSE_TAG_MOUNT_POINT))
        except OSError:
            return False

    def _rmtree_islink(path):
        try:
            st = os.lstat(path)
            return (stat.S_ISLNK(st.st_mode) or
                (st.st_file_attributes & stat.FILE_ATTRIBUTE_REPARSE_POINT
                 and st.st_reparse_tag == stat.IO_REPARSE_TAG_MOUNT_POINT))
        except OSError:
            return False
else:
    def _rmtree_isdir(entry):
        try:
            return entry.is_dir(follow_symlinks=False)
        except OSError:
            return False

    def _rmtree_islink(path):
        return os.path.islink(path)

# version vulnerable to race conditions
def _rmtree_unsafe(path, onerror):
    try:
        with os.scandir(path) as scandir_it:
            entries = list(scandir_it)
    except OSError:
        onerror(os.scandir, path, sys.exc_info())
        entries = []
    for entry in entries:
        fullname = entry.path
        if _rmtree_isdir(entry):
            try:
                if entry.is_symlink():
                    # This can only happen if someone replaces
                    # a directory with a symlink after the call to
                    # os.scandir or entry.is_dir above.
                    raise OSError("Cannot call rmtree on a symbolic link")
            except OSError:
                onerror(os.path.islink, fullname, sys.exc_info())
                continue
            _rmtree_unsafe(fullname, onerror)
        else:
            try:
                os.unlink(fullname)
            except OSError:
                onerror(os.unlink, fullname, sys.exc_info())
    try:
        os.rmdir(path)
    except OSError:
        onerror(os.rmdir, path, sys.exc_info())

# Version using fd-based APIs to protect against races
def _rmtree_safe_fd(topfd, path, onerror):
    try:
        with os.scandir(topfd) as scandir_it:
            entries = list(scandir_it)
    except OSError as err:
        err.filename = path
        onerror(os.scandir, path, sys.exc_info())
        return
    for entry in entries:
        fullname = os.path.join(path, entry.name)
        try:
            is_dir = entry.is_dir(follow_symlinks=False)
        except OSError:
            is_dir = False
        else:
            if is_dir:
                try:
                    orig_st = entry.stat(follow_symlinks=False)
                    is_dir = stat.S_ISDIR(orig_st.st_mode)
                except OSError:
                    onerror(os.lstat, fullname, sys.exc_info())
                    continue
        if is_dir:
            try:
                dirfd = os.open(entry.name, os.O_RDONLY, dir_fd=topfd)
            except OSError:
                onerror(os.open, fullname, sys.exc_info())
            else:
                try:
                    if os.path.samestat(orig_st, os.fstat(dirfd)):
                        _rmtree_safe_fd(dirfd, fullname, onerror)
                        try:
                            os.rmdir(entry.name, dir_fd=topfd)
                        except OSError:
                            onerror(os.rmdir, fullname, sys.exc_info())
                    else:
                        try:
                            # This can only happen if someone replaces
                            # a directory with a symlink after the call to
                            # os.scandir or stat.S_ISDIR above.
                            raise OSError("Cannot call rmtree on a symbolic "
                                          "link")
                        except OSError:
                            onerror(os.path.islink, fullname, sys.exc_info())
                finally:
                    os.close(dirfd)
        else:
            try:
                os.unlink(entry.name, dir_fd=topfd)
            except OSError:
                onerror(os.unlink, fullname, sys.exc_info())

_use_fd_functions = ({os.open, os.stat, os.unlink, os.rmdir} <=
                     os.supports_dir_fd and
                     os.scandir in os.supports_fd and
                     os.stat in os.supports_follow_symlinks)

def rmtree(path, ignore_errors=False, onerror=None):
    """Recursively delete a directory tree.

    If ignore_errors is set, errors are ignored; otherwise, if onerror
    is set, it is called to handle the error with arguments (func,
    path, exc_info) where func is platform and implementation dependent;
    path is the argument to that function that caused it to fail; and
    exc_info is a tuple returned by sys.exc_info().  If ignore_errors
    is false and onerror is None, an exception is raised.

    """
    sys.audit("shutil.rmtree", path)
    if ignore_errors:
        def onerror(*args):
            pass
    elif onerror is None:
        def onerror(*args):
            raise
    if _use_fd_functions:
        # While the unsafe rmtree works fine on bytes, the fd based does not.
        if isinstance(path, bytes):
            path = os.fsdecode(path)
        # Note: To guard against symlink races, we use the standard
        # lstat()/open()/fstat() trick.
        try:
            orig_st = os.lstat(path)
        except Exception:
            onerror(os.lstat, path, sys.exc_info())
            return
        try:
            fd = os.open(path, os.O_RDONLY)
        except Exception:
            onerror(os.open, path, sys.exc_info())
            return
        try:
            if os.path.samestat(orig_st, os.fstat(fd)):
                _rmtree_safe_fd(fd, path, onerror)
                try:
                    os.rmdir(path)
                except OSError:
                    onerror(os.rmdir, path, sys.exc_info())
            else:
                try:
                    # symlinks to directories are forbidden, see bug #1669
                    raise OSError("Cannot call rmtree on a symbolic link")
                except OSError:
                    onerror(os.path.islink, path, sys.exc_info())
        finally:
            os.close(fd)
    else:
        try:
            if _rmtree_islink(path):
                # symlinks to directories are forbidden, see bug #1669
                raise OSError("Cannot call rmtree on a symbolic link")
        except OSError:
            onerror(os.path.islink, path, sys.exc_info())
            # can't continue even if onerror hook returns
            return
        return _rmtree_unsafe(path, onerror)

# Allow introspection of whether or not the hardening against symlink
# attacks is supported on the current platform
rmtree.avoids_symlink_attacks = _use_fd_functions

def _basename(path):
    # A basename() variant which first strips the trailing slash, if present.
    # Thus we always get the last component of the path, even for directories.
    sep = os.path.sep + (os.path.altsep or '')
    return os.path.basename(path.rstrip(sep))

def move(src, dst, copy_function=copy2):
    """Recursively move a file or directory to another location. This is
    similar to the Unix "mv" command. Return the file or directory's
    destination.

    If the destination is a directory or a symlink to a directory, the source
    is moved inside the directory. The destination path must not already
    exist.

    If the destination already exists but is not a directory, it may be
    overwritten depending on os.rename() semantics.

    If the destination is on our current filesystem, then rename() is used.
    Otherwise, src is copied to the destination and then removed. Symlinks are
    recreated under the new name if os.rename() fails because of cross
    filesystem renames.

    The optional `copy_function` argument is a callable that will be used
    to copy the source or it will be delegated to `copytree`.
    By default, copy2() is used, but any function that supports the same
    signature (like copy()) can be used.

    A lot more could be done here...  A look at a mv.c shows a lot of
    the issues this implementation glosses over.

    """
    sys.audit("shutil.move", src, dst)
    real_dst = dst
    if os.path.isdir(dst):
        if _samefile(src, dst):
            # We might be on a case insensitive filesystem,
            # perform the rename anyway.
            os.rename(src, dst)
            return

        real_dst = os.path.join(dst, _basename(src))
        if os.path.exists(real_dst):
            raise Error("Destination path '%s' already exists" % real_dst)
    try:
        os.rename(src, real_dst)
    except OSError:
        if os.path.islink(src):
            linkto = os.readlink(src)
            os.symlink(linkto, real_dst)
            os.unlink(src)
        elif os.path.isdir(src):
            if _destinsrc(src, dst):
                raise Error("Cannot move a directory '%s' into itself"
                            " '%s'." % (src, dst))
            if (_is_immutable(src)
                    or (not os.access(src, os.W_OK) and os.listdir(src)
                        and sys.platform == 'darwin')):
                raise PermissionError("Cannot move the non-empty directory "
                                      "'%s': Lacking write permission to '%s'."
                                      % (src, src))
            copytree(src, real_dst, copy_function=copy_function,
                     symlinks=True)
            rmtree(src)
        else:
            copy_function(src, real_dst)
            os.unlink(src)
    return real_dst

def _destinsrc(src, dst):
    src = os.path.abspath(src)
    dst = os.path.abspath(dst)
    if not src.endswith(os.path.sep):
        src += os.path.sep
    if not dst.endswith(os.path.sep):
        dst += os.path.sep
    return dst.startswith(src)

def _is_immutable(src):
    st = _stat(src)
    immutable_states = [stat.UF_IMMUTABLE, stat.SF_IMMUTABLE]
    return hasattr(st, 'st_flags') and st.st_flags in immutable_states

def _get_gid(name):
    """Returns a gid, given a group name."""
    if getgrnam is None or name is None:
        return None
    try:
        result = getgrnam(name)
    except KeyError:
        result = None
    if result is not None:
        return result[2]
    return None

def _get_uid(name):
    """Returns an uid, given a user name."""
    if getpwnam is None or name is None:
        return None
    try:
        result = getpwnam(name)
    except KeyError:
        result = None
    if result is not None:
        return result[2]
    return None

def _make_tarball(base_name, base_dir, compress="gzip", verbose=0, dry_run=0,
                  owner=None, group=None, logger=None):
    """Create a (possibly compressed) tar file from all the files under
    'base_dir'.

    'compress' must be "gzip" (the default), "bzip2", "xz", or None.

    'owner' and 'group' can be used to define an owner and a group for the
    archive that is being built. If not provided, the current owner and group
    will be used.

    The output tar file will be named 'base_name' +  ".tar", possibly plus
    the appropriate compression extension (".gz", ".bz2", or ".xz").

    Returns the output filename.
    """
    if compress is None:
        tar_compression = ''
    elif _ZLIB_SUPPORTED and compress == 'gzip':
        tar_compression = 'gz'
    elif _BZ2_SUPPORTED and compress == 'bzip2':
        tar_compression = 'bz2'
    elif _LZMA_SUPPORTED and compress == 'xz':
        tar_compression = 'xz'
    else:
        raise ValueError("bad value for 'compress', or compression format not "
                         "supported : {0}".format(compress))

    import tarfile  # late import for breaking circular dependency

    compress_ext = '.' + tar_compression if compress else ''
    archive_name = base_name + '.tar' + compress_ext
    archive_dir = os.path.dirname(archive_name)

    if archive_dir and not os.path.exists(archive_dir):
        if logger is not None:
            logger.info("creating %s", archive_dir)
        if not dry_run:
            os.makedirs(archive_dir)

    # creating the tarball
    if logger is not None:
        logger.info('Creating tar archive')

    uid = _get_uid(owner)
    gid = _get_gid(group)

    def _set_uid_gid(tarinfo):
        if gid is not None:
            tarinfo.gid = gid
            tarinfo.gname = group
        if uid is not None:
            tarinfo.uid = uid
            tarinfo.uname = owner
        return tarinfo

    if not dry_run:
        tar = tarfile.open(archive_name, 'w|%s' % tar_compression)
        try:
            tar.add(base_dir, filter=_set_uid_gid)
        finally:
            tar.close()

    return archive_name

def _make_zipfile(base_name, base_dir, verbose=0, dry_run=0, logger=None):
    """Create a zip file from all the files under 'base_dir'.

    The output zip file will be named 'base_name' + ".zip".  Returns the
    name of the output zip file.
    """
    import zipfile  # late import for breaking circular dependency

    zip_filename = base_name + ".zip"
    archive_dir = os.path.dirname(base_name)

    if archive_dir and not os.path.exists(archive_dir):
        if logger is not None:
            logger.info("creating %s", archive_dir)
        if not dry_run:
            os.makedirs(archive_dir)

    if logger is not None:
        logger.info("creating '%s' and adding '%s' to it",
                    zip_filename, base_dir)

    if not dry_run:
        with zipfile.ZipFile(zip_filename, "w",
                             compression=zipfile.ZIP_DEFLATED) as zf:
            path = os.path.normpath(base_dir)
            if path != os.curdir:
                zf.write(path, path)
                if logger is not None:
                    logger.info("adding '%s'", path)
            for dirpath, dirnames, filenames in os.walk(base_dir):
                for name in sorted(dirnames):
                    path = os.path.normpath(os.path.join(dirpath, name))
                    zf.write(path, path)
                    if logger is not None:
                        logger.info("adding '%s'", path)
                for name in filenames:
                    path = os.path.normpath(os.path.join(dirpath, name))
                    if os.path.isfile(path):
                        zf.write(path, path)
                        if logger is not None:
                            logger.info("adding '%s'", path)

    return zip_filename

_ARCHIVE_FORMATS = {
    'tar':   (_make_tarball, [('compress', None)], "uncompressed tar file"),
}

if _ZLIB_SUPPORTED:
    _ARCHIVE_FORMATS['gztar'] = (_make_tarball, [('compress', 'gzip')],
                                "gzip'ed tar-file")
    _ARCHIVE_FORMATS['zip'] = (_make_zipfile, [], "ZIP file")

if _BZ2_SUPPORTED:
    _ARCHIVE_FORMATS['bztar'] = (_make_tarball, [('compress', 'bzip2')],
                                "bzip2'ed tar-file")

if _LZMA_SUPPORTED:
    _ARCHIVE_FORMATS['xztar'] = (_make_tarball, [('compress', 'xz')],
                                "xz'ed tar-file")

def get_archive_formats():
    """Returns a list of supported formats for archiving and unarchiving.

    Each element of the returned sequence is a tuple (name, description)
    """
    formats = [(name, registry[2]) for name, registry in
               _ARCHIVE_FORMATS.items()]
    formats.sort()
    return formats

def register_archive_format(name, function, extra_args=None, description=''):
    """Registers an archive format.

    name is the name of the format. function is the callable that will be
    used to create archives. If provided, extra_args is a sequence of
    (name, value) tuples that will be passed as arguments to the callable.
    description can be provided to describe the format, and will be returned
    by the get_archive_formats() function.
    """
    if extra_args is None:
        extra_args = []
    if not callable(function):
        raise TypeError('The %s object is not callable' % function)
    if not isinstance(extra_args, (tuple, list)):
        raise TypeError('extra_args needs to be a sequence')
    for element in extra_args:
        if not isinstance(element, (tuple, list)) or len(element) !=2:
            raise TypeError('extra_args elements are : (arg_name, value)')

    _ARCHIVE_FORMATS[name] = (function, extra_args, description)

def unregister_archive_format(name):
    del _ARCHIVE_FORMATS[name]

def make_archive(base_name, format, root_dir=None, base_dir=None, verbose=0,
                 dry_run=0, owner=None, group=None, logger=None):
    """Create an archive file (eg. zip or tar).

    'base_name' is the name of the file to create, minus any format-specific
    extension; 'format' is the archive format: one of "zip", "tar", "gztar",
    "bztar", or "xztar".  Or any other registered format.

    'root_dir' is a directory that will be the root directory of the
    archive; ie. we typically chdir into 'root_dir' before creating the
    archive.  'base_dir' is the directory where we start archiving from;
    ie. 'base_dir' will be the common prefix of all files and
    directories in the archive.  'root_dir' and 'base_dir' both default
    to the current directory.  Returns the name of the archive file.

    'owner' and 'group' are used when creating a tar archive. By default,
    uses the current owner and group.
    """
    sys.audit("shutil.make_archive", base_name, format, root_dir, base_dir)
    save_cwd = os.getcwd()
    if root_dir is not None:
        if logger is not None:
            logger.debug("changing into '%s'", root_dir)
        base_name = os.path.abspath(base_name)
        if not dry_run:
            os.chdir(root_dir)

    if base_dir is None:
        base_dir = os.curdir

    kwargs = {'dry_run': dry_run, 'logger': logger}

    try:
        format_info = _ARCHIVE_FORMATS[format]
    except KeyError:
        raise ValueError("unknown archive format '%s'" % format) from None

    func = format_info[0]
    for arg, val in format_info[1]:
        kwargs[arg] = val

    if format != 'zip':
        kwargs['owner'] = owner
        kwargs['group'] = group

    try:
        filename = func(base_name, base_dir, **kwargs)
    finally:
        if root_dir is not None:
            if logger is not None:
                logger.debug("changing back to '%s'", save_cwd)
            os.chdir(save_cwd)

    return filename


def get_unpack_formats():
    """Returns a list of supported formats for unpacking.

    Each element of the returned sequence is a tuple
    (name, extensions, description)
    """
    formats = [(name, info[0], info[3]) for name, info in
               _UNPACK_FORMATS.items()]
    formats.sort()
    return formats

def _check_unpack_options(extensions, function, extra_args):
    """Checks what gets registered as an unpacker."""
    # first make sure no other unpacker is registered for this extension
    existing_extensions = {}
    for name, info in _UNPACK_FORMATS.items():
        for ext in info[0]:
            existing_extensions[ext] = name

    for extension in extensions:
        if extension in existing_extensions:
            msg = '%s is already registered for "%s"'
            raise RegistryError(msg % (extension,
                                       existing_extensions[extension]))

    if not callable(function):
        raise TypeError('The registered function must be a callable')


def register_unpack_format(name, extensions, function, extra_args=None,
                           description=''):
    """Registers an unpack format.

    `name` is the name of the format. `extensions` is a list of extensions
    corresponding to the format.

    `function` is the callable that will be
    used to unpack archives. The callable will receive archives to unpack.
    If it's unable to handle an archive, it needs to raise a ReadError
    exception.

    If provided, `extra_args` is a sequence of
    (name, value) tuples that will be passed as arguments to the callable.
    description can be provided to describe the format, and will be returned
    by the get_unpack_formats() function.
    """
    if extra_args is None:
        extra_args = []
    _check_unpack_options(extensions, function, extra_args)
    _UNPACK_FORMATS[name] = extensions, function, extra_args, description

def unregister_unpack_format(name):
    """Removes the pack format from the registry."""
    del _UNPACK_FORMATS[name]

def _ensure_directory(path):
    """Ensure that the parent directory of `path` exists"""
    dirname = os.path.dirname(path)
    if not os.path.isdir(dirname):
        os.makedirs(dirname)

def _unpack_zipfile(filename, extract_dir):
    """Unpack zip `filename` to `extract_dir`
    """
    import zipfile  # late import for breaking circular dependency

    if not zipfile.is_zipfile(filename):
        raise ReadError("%s is not a zip file" % filename)

    zip = zipfile.ZipFile(filename)
    try:
        for info in zip.infolist():
            name = info.filename

            # don't extract absolute paths or ones with .. in them
            if name.startswith('/') or '..' in name:
                continue

            target = os.path.join(extract_dir, *name.split('/'))
            if not target:
                continue

            _ensure_directory(target)
            if not name.endswith('/'):
                # file
                data = zip.read(info.filename)
                f = open(target, 'wb')
                try:
                    f.write(data)
                finally:
                    f.close()
                    del data
    finally:
        zip.close()

def _unpack_tarfile(filename, extract_dir, *, filter=None):
    """Unpack tar/tar.gz/tar.bz2/tar.xz `filename` to `extract_dir`
    """
    import tarfile  # late import for breaking circular dependency
    try:
        tarobj = tarfile.open(filename)
    except tarfile.TarError:
        raise ReadError(
            "%s is not a compressed or uncompressed tar file" % filename)
    try:
        tarobj.extractall(extract_dir, filter=filter)
    finally:
        tarobj.close()

_UNPACK_FORMATS = {
    'tar':   (['.tar'], _unpack_tarfile, [], "uncompressed tar file"),
    'zip':   (['.zip'], _unpack_zipfile, [], "ZIP file"),
}

if _ZLIB_SUPPORTED:
    _UNPACK_FORMATS['gztar'] = (['.tar.gz', '.tgz'], _unpack_tarfile, [],
                                "gzip'ed tar-file")

if _BZ2_SUPPORTED:
    _UNPACK_FORMATS['bztar'] = (['.tar.bz2', '.tbz2'], _unpack_tarfile, [],
                                "bzip2'ed tar-file")

if _LZMA_SUPPORTED:
    _UNPACK_FORMATS['xztar'] = (['.tar.xz', '.txz'], _unpack_tarfile, [],
                                "xz'ed tar-file")

def _find_unpack_format(filename):
    for name, info in _UNPACK_FORMATS.items():
        for extension in info[0]:
            if filename.endswith(extension):
                return name
    return None

def unpack_archive(filename, extract_dir=None, format=None, *, filter=None):
    """Unpack an archive.

    `filename` is the name of the archive.

    `extract_dir` is the name of the target directory, where the archive
    is unpacked. If not provided, the current working directory is used.

    `format` is the archive format: one of "zip", "tar", "gztar", "bztar",
    or "xztar".  Or any other registered format.  If not provided,
    unpack_archive will use the filename extension and see if an unpacker
    was registered for that extension.

    In case none is found, a ValueError is raised.

    If `filter` is given, it is passed to the underlying
    extraction function.
    """
    sys.audit("shutil.unpack_archive", filename, extract_dir, format)

    if extract_dir is None:
        extract_dir = os.getcwd()

    extract_dir = os.fspath(extract_dir)
    filename = os.fspath(filename)

    if filter is None:
        filter_kwargs = {}
    else:
        filter_kwargs = {'filter': filter}
    if format is not None:
        try:
            format_info = _UNPACK_FORMATS[format]
        except KeyError:
            raise ValueError("Unknown unpack format '{0}'".format(format)) from None

        func = format_info[1]
        func(filename, extract_dir, **dict(format_info[2]), **filter_kwargs)
    else:
        # we need to look at the registered unpackers supported extensions
        format = _find_unpack_format(filename)
        if format is None:
            raise ReadError("Unknown archive format '{0}'".format(filename))

        func = _UNPACK_FORMATS[format][1]
        kwargs = dict(_UNPACK_FORMATS[format][2])
        kwargs.update(filter_kwargs)
        func(filename, extract_dir, **kwargs)


if hasattr(os, 'statvfs'):

    __all__.append('disk_usage')
    _ntuple_diskusage = collections.namedtuple('usage', 'total used free')
    _ntuple_diskusage.total.__doc__ = 'Total space in bytes'
    _ntuple_diskusage.used.__doc__ = 'Used space in bytes'
    _ntuple_diskusage.free.__doc__ = 'Free space in bytes'

    def disk_usage(path):
        """Return disk usage statistics about the given path.

        Returned value is a named tuple with attributes 'total', 'used' and
        'free', which are the amount of total, used and free space, in bytes.
        """
        st = os.statvfs(path)
        free = st.f_bavail * st.f_frsize
        total = st.f_blocks * st.f_frsize
        used = (st.f_blocks - st.f_bfree) * st.f_frsize
        return _ntuple_diskusage(total, used, free)

elif _WINDOWS:

    __all__.append('disk_usage')
    _ntuple_diskusage = collections.namedtuple('usage', 'total used free')

    def disk_usage(path):
        """Return disk usage statistics about the given path.

        Returned values is a named tuple with attributes 'total', 'used' and
        'free', which are the amount of total, used and free space, in bytes.
        """
        total, free = nt._getdiskusage(path)
        used = total - free
        return _ntuple_diskusage(total, used, free)


def chown(path, user=None, group=None):
    """Change owner user and group of the given path.

    user and group can be the uid/gid or the user/group names, and in that case,
    they are converted to their respective uid/gid.
    """
    sys.audit('shutil.chown', path, user, group)

    if user is None and group is None:
        raise ValueError("user and/or group must be set")

    _user = user
    _group = group

    # -1 means don't change it
    if user is None:
        _user = -1
    # user can either be an int (the uid) or a string (the system username)
    elif isinstance(user, str):
        _user = _get_uid(user)
        if _user is None:
            raise LookupError("no such user: {!r}".format(user))

    if group is None:
        _group = -1
    elif not isinstance(group, int):
        _group = _get_gid(group)
        if _group is None:
            raise LookupError("no such group: {!r}".format(group))

    os.chown(path, _user, _group)

def get_terminal_size(fallback=(80, 24)):
    """Get the size of the terminal window.

    For each of the two dimensions, the environment variable, COLUMNS
    and LINES respectively, is checked. If the variable is defined and
    the value is a positive integer, it is used.

    When COLUMNS or LINES is not defined, which is the common case,
    the terminal connected to sys.__stdout__ is queried
    by invoking os.get_terminal_size.

    If the terminal size cannot be successfully queried, either because
    the system doesn't support querying, or because we are not
    connected to a terminal, the value given in fallback parameter
    is used. Fallback defaults to (80, 24) which is the default
    size used by many terminal emulators.

    The value returned is a named tuple of type os.terminal_size.
    """
    # columns, lines are the working values
    try:
        columns = int(os.environ['COLUMNS'])
    except (KeyError, ValueError):
        columns = 0

    try:
        lines = int(os.environ['LINES'])
    except (KeyError, ValueError):
        lines = 0

    # only query if necessary
    if columns <= 0 or lines <= 0:
        try:
            size = os.get_terminal_size(sys.__stdout__.fileno())
        except (AttributeError, ValueError, OSError):
            # stdout is None, closed, detached, or not a terminal, or
            # os.get_terminal_size() is unsupported
            size = os.terminal_size(fallback)
        if columns <= 0:
            columns = size.columns
        if lines <= 0:
            lines = size.lines

    return os.terminal_size((columns, lines))


# Check that a given file can be accessed with the correct mode.
# Additionally check that `file` is not a directory, as on Windows
# directories pass the os.access check.
def _access_check(fn, mode):
    return (os.path.exists(fn) and os.access(fn, mode)
            and not os.path.isdir(fn))


def which(cmd, mode=os.F_OK | os.X_OK, path=None):
    """Given a command, mode, and a PATH string, return the path which
    conforms to the given mode on the PATH, or None if there is no such
    file.

    `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result
    of os.environ.get("PATH"), or can be overridden with a custom search
    path.

    """
    # If we're given a path with a directory part, look it up directly rather
    # than referring to PATH directories. This includes checking relative to the
    # current directory, e.g. ./script
    if os.path.dirname(cmd):
        if _access_check(cmd, mode):
            return cmd
        return None

    use_bytes = isinstance(cmd, bytes)

    if path is None:
        path = os.environ.get("PATH", None)
        if path is None:
            try:
                path = os.confstr("CS_PATH")
            except (AttributeError, ValueError):
                # os.confstr() or CS_PATH is not available
                path = os.defpath
        # bpo-35755: Don't use os.defpath if the PATH environment variable is
        # set to an empty string

    # PATH='' doesn't match, whereas PATH=':' looks in the current directory
    if not path:
        return None

    if use_bytes:
        path = os.fsencode(path)
        path = path.split(os.fsencode(os.pathsep))
    else:
        path = os.fsdecode(path)
        path = path.split(os.pathsep)

    if sys.platform == "win32":
        # The current directory takes precedence on Windows.
        curdir = os.curdir
        if use_bytes:
            curdir = os.fsencode(curdir)
        if curdir not in path:
            path.insert(0, curdir)

        # PATHEXT is necessary to check on Windows.
        pathext_source = os.getenv("PATHEXT") or _WIN_DEFAULT_PATHEXT
        pathext = [ext for ext in pathext_source.split(os.pathsep) if ext]

        if use_bytes:
            pathext = [os.fsencode(ext) for ext in pathext]
        # See if the given file matches any of the expected path extensions.
        # This will allow us to short circuit when given "python.exe".
        # If it does match, only test that one, otherwise we have to try
        # others.
        if any(cmd.lower().endswith(ext.lower()) for ext in pathext):
            files = [cmd]
        else:
            files = [cmd + ext for ext in pathext]
    else:
        # On other platforms you don't have things like PATHEXT to tell you
        # what file suffixes are executable, so just pass on cmd as-is.
        files = [cmd]

    seen = set()
    for dir in path:
        normdir = os.path.normcase(dir)
        if not normdir in seen:
            seen.add(normdir)
            for thefile in files:
                name = os.path.join(dir, thefile)
                if _access_check(name, mode):
                    return name
    return None
poplib.py000064400000035345151153537630006426 0ustar00"""A POP3 client class.

Based on the J. Myers POP3 draft, Jan. 96
"""

# Author: David Ascher <david_ascher@brown.edu>
#         [heavily stealing from nntplib.py]
# Updated: Piers Lauder <piers@cs.su.oz.au> [Jul '97]
# String method conversion and test jig improvements by ESR, February 2001.
# Added the POP3_SSL class. Methods loosely based on IMAP_SSL. Hector Urtubia <urtubia@mrbook.org> Aug 2003

# Example (see the test function at the end of this file)

# Imports

import errno
import re
import socket
import sys

try:
    import ssl
    HAVE_SSL = True
except ImportError:
    HAVE_SSL = False

__all__ = ["POP3","error_proto"]

# Exception raised when an error or invalid response is received:

class error_proto(Exception): pass

# Standard Port
POP3_PORT = 110

# POP SSL PORT
POP3_SSL_PORT = 995

# Line terminators (we always output CRLF, but accept any of CRLF, LFCR, LF)
CR = b'\r'
LF = b'\n'
CRLF = CR+LF

# maximal line length when calling readline(). This is to prevent
# reading arbitrary length lines. RFC 1939 limits POP3 line length to
# 512 characters, including CRLF. We have selected 2048 just to be on
# the safe side.
_MAXLINE = 2048


class POP3:

    """This class supports both the minimal and optional command sets.
    Arguments can be strings or integers (where appropriate)
    (e.g.: retr(1) and retr('1') both work equally well.

    Minimal Command Set:
            USER name               user(name)
            PASS string             pass_(string)
            STAT                    stat()
            LIST [msg]              list(msg = None)
            RETR msg                retr(msg)
            DELE msg                dele(msg)
            NOOP                    noop()
            RSET                    rset()
            QUIT                    quit()

    Optional Commands (some servers support these):
            RPOP name               rpop(name)
            APOP name digest        apop(name, digest)
            TOP msg n               top(msg, n)
            UIDL [msg]              uidl(msg = None)
            CAPA                    capa()
            STLS                    stls()
            UTF8                    utf8()

    Raises one exception: 'error_proto'.

    Instantiate with:
            POP3(hostname, port=110)

    NB:     the POP protocol locks the mailbox from user
            authorization until QUIT, so be sure to get in, suck
            the messages, and quit, each time you access the
            mailbox.

            POP is a line-based protocol, which means large mail
            messages consume lots of python cycles reading them
            line-by-line.

            If it's available on your mail server, use IMAP4
            instead, it doesn't suffer from the two problems
            above.
    """

    encoding = 'UTF-8'

    def __init__(self, host, port=POP3_PORT,
                 timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
        self.host = host
        self.port = port
        self._tls_established = False
        sys.audit("poplib.connect", self, host, port)
        self.sock = self._create_socket(timeout)
        self.file = self.sock.makefile('rb')
        self._debugging = 0
        self.welcome = self._getresp()

    def _create_socket(self, timeout):
        return socket.create_connection((self.host, self.port), timeout)

    def _putline(self, line):
        if self._debugging > 1: print('*put*', repr(line))
        sys.audit("poplib.putline", self, line)
        self.sock.sendall(line + CRLF)


    # Internal: send one command to the server (through _putline())

    def _putcmd(self, line):
        if self._debugging: print('*cmd*', repr(line))
        line = bytes(line, self.encoding)
        self._putline(line)


    # Internal: return one line from the server, stripping CRLF.
    # This is where all the CPU time of this module is consumed.
    # Raise error_proto('-ERR EOF') if the connection is closed.

    def _getline(self):
        line = self.file.readline(_MAXLINE + 1)
        if len(line) > _MAXLINE:
            raise error_proto('line too long')

        if self._debugging > 1: print('*get*', repr(line))
        if not line: raise error_proto('-ERR EOF')
        octets = len(line)
        # server can send any combination of CR & LF
        # however, 'readline()' returns lines ending in LF
        # so only possibilities are ...LF, ...CRLF, CR...LF
        if line[-2:] == CRLF:
            return line[:-2], octets
        if line[:1] == CR:
            return line[1:-1], octets
        return line[:-1], octets


    # Internal: get a response from the server.
    # Raise 'error_proto' if the response doesn't start with '+'.

    def _getresp(self):
        resp, o = self._getline()
        if self._debugging > 1: print('*resp*', repr(resp))
        if not resp.startswith(b'+'):
            raise error_proto(resp)
        return resp


    # Internal: get a response plus following text from the server.

    def _getlongresp(self):
        resp = self._getresp()
        list = []; octets = 0
        line, o = self._getline()
        while line != b'.':
            if line.startswith(b'..'):
                o = o-1
                line = line[1:]
            octets = octets + o
            list.append(line)
            line, o = self._getline()
        return resp, list, octets


    # Internal: send a command and get the response

    def _shortcmd(self, line):
        self._putcmd(line)
        return self._getresp()


    # Internal: send a command and get the response plus following text

    def _longcmd(self, line):
        self._putcmd(line)
        return self._getlongresp()


    # These can be useful:

    def getwelcome(self):
        return self.welcome


    def set_debuglevel(self, level):
        self._debugging = level


    # Here are all the POP commands:

    def user(self, user):
        """Send user name, return response

        (should indicate password required).
        """
        return self._shortcmd('USER %s' % user)


    def pass_(self, pswd):
        """Send password, return response

        (response includes message count, mailbox size).

        NB: mailbox is locked by server from here to 'quit()'
        """
        return self._shortcmd('PASS %s' % pswd)


    def stat(self):
        """Get mailbox status.

        Result is tuple of 2 ints (message count, mailbox size)
        """
        retval = self._shortcmd('STAT')
        rets = retval.split()
        if self._debugging: print('*stat*', repr(rets))
        numMessages = int(rets[1])
        sizeMessages = int(rets[2])
        return (numMessages, sizeMessages)


    def list(self, which=None):
        """Request listing, return result.

        Result without a message number argument is in form
        ['response', ['mesg_num octets', ...], octets].

        Result when a message number argument is given is a
        single response: the "scan listing" for that message.
        """
        if which is not None:
            return self._shortcmd('LIST %s' % which)
        return self._longcmd('LIST')


    def retr(self, which):
        """Retrieve whole message number 'which'.

        Result is in form ['response', ['line', ...], octets].
        """
        return self._longcmd('RETR %s' % which)


    def dele(self, which):
        """Delete message number 'which'.

        Result is 'response'.
        """
        return self._shortcmd('DELE %s' % which)


    def noop(self):
        """Does nothing.

        One supposes the response indicates the server is alive.
        """
        return self._shortcmd('NOOP')


    def rset(self):
        """Unmark all messages marked for deletion."""
        return self._shortcmd('RSET')


    def quit(self):
        """Signoff: commit changes on server, unlock mailbox, close connection."""
        resp = self._shortcmd('QUIT')
        self.close()
        return resp

    def close(self):
        """Close the connection without assuming anything about it."""
        try:
            file = self.file
            self.file = None
            if file is not None:
                file.close()
        finally:
            sock = self.sock
            self.sock = None
            if sock is not None:
                try:
                    sock.shutdown(socket.SHUT_RDWR)
                except OSError as exc:
                    # The server might already have closed the connection.
                    # On Windows, this may result in WSAEINVAL (error 10022):
                    # An invalid operation was attempted.
                    if (exc.errno != errno.ENOTCONN
                       and getattr(exc, 'winerror', 0) != 10022):
                        raise
                finally:
                    sock.close()

    #__del__ = quit


    # optional commands:

    def rpop(self, user):
        """Not sure what this does."""
        return self._shortcmd('RPOP %s' % user)


    timestamp = re.compile(br'\+OK.[^<]*(<.*>)')

    def apop(self, user, password):
        """Authorisation

        - only possible if server has supplied a timestamp in initial greeting.

        Args:
                user     - mailbox user;
                password - mailbox password.

        NB: mailbox is locked by server from here to 'quit()'
        """
        secret = bytes(password, self.encoding)
        m = self.timestamp.match(self.welcome)
        if not m:
            raise error_proto('-ERR APOP not supported by server')
        import hashlib
        digest = m.group(1)+secret
        digest = hashlib.md5(digest).hexdigest()
        return self._shortcmd('APOP %s %s' % (user, digest))


    def top(self, which, howmuch):
        """Retrieve message header of message number 'which'
        and first 'howmuch' lines of message body.

        Result is in form ['response', ['line', ...], octets].
        """
        return self._longcmd('TOP %s %s' % (which, howmuch))


    def uidl(self, which=None):
        """Return message digest (unique id) list.

        If 'which', result contains unique id for that message
        in the form 'response mesgnum uid', otherwise result is
        the list ['response', ['mesgnum uid', ...], octets]
        """
        if which is not None:
            return self._shortcmd('UIDL %s' % which)
        return self._longcmd('UIDL')


    def utf8(self):
        """Try to enter UTF-8 mode (see RFC 6856). Returns server response.
        """
        return self._shortcmd('UTF8')


    def capa(self):
        """Return server capabilities (RFC 2449) as a dictionary
        >>> c=poplib.POP3('localhost')
        >>> c.capa()
        {'IMPLEMENTATION': ['Cyrus', 'POP3', 'server', 'v2.2.12'],
         'TOP': [], 'LOGIN-DELAY': ['0'], 'AUTH-RESP-CODE': [],
         'EXPIRE': ['NEVER'], 'USER': [], 'STLS': [], 'PIPELINING': [],
         'UIDL': [], 'RESP-CODES': []}
        >>>

        Really, according to RFC 2449, the cyrus folks should avoid
        having the implementation split into multiple arguments...
        """
        def _parsecap(line):
            lst = line.decode('ascii').split()
            return lst[0], lst[1:]

        caps = {}
        try:
            resp = self._longcmd('CAPA')
            rawcaps = resp[1]
            for capline in rawcaps:
                capnm, capargs = _parsecap(capline)
                caps[capnm] = capargs
        except error_proto as _err:
            raise error_proto('-ERR CAPA not supported by server')
        return caps


    def stls(self, context=None):
        """Start a TLS session on the active connection as specified in RFC 2595.

                context - a ssl.SSLContext
        """
        if not HAVE_SSL:
            raise error_proto('-ERR TLS support missing')
        if self._tls_established:
            raise error_proto('-ERR TLS session already established')
        caps = self.capa()
        if not 'STLS' in caps:
            raise error_proto('-ERR STLS not supported by server')
        if context is None:
            context = ssl._create_stdlib_context()
        resp = self._shortcmd('STLS')
        self.sock = context.wrap_socket(self.sock,
                                        server_hostname=self.host)
        self.file = self.sock.makefile('rb')
        self._tls_established = True
        return resp


if HAVE_SSL:

    class POP3_SSL(POP3):
        """POP3 client class over SSL connection

        Instantiate with: POP3_SSL(hostname, port=995, keyfile=None, certfile=None,
                                   context=None)

               hostname - the hostname of the pop3 over ssl server
               port - port number
               keyfile - PEM formatted file that contains your private key
               certfile - PEM formatted certificate chain file
               context - a ssl.SSLContext

        See the methods of the parent class POP3 for more documentation.
        """

        def __init__(self, host, port=POP3_SSL_PORT, keyfile=None, certfile=None,
                     timeout=socket._GLOBAL_DEFAULT_TIMEOUT, context=None):
            if context is not None and keyfile is not None:
                raise ValueError("context and keyfile arguments are mutually "
                                 "exclusive")
            if context is not None and certfile is not None:
                raise ValueError("context and certfile arguments are mutually "
                                 "exclusive")
            if keyfile is not None or certfile is not None:
                import warnings
                warnings.warn("keyfile and certfile are deprecated, use a "
                              "custom context instead", DeprecationWarning, 2)
            self.keyfile = keyfile
            self.certfile = certfile
            if context is None:
                context = ssl._create_stdlib_context(certfile=certfile,
                                                     keyfile=keyfile)
            self.context = context
            POP3.__init__(self, host, port, timeout)

        def _create_socket(self, timeout):
            sock = POP3._create_socket(self, timeout)
            sock = self.context.wrap_socket(sock,
                                            server_hostname=self.host)
            return sock

        def stls(self, keyfile=None, certfile=None, context=None):
            """The method unconditionally raises an exception since the
            STLS command doesn't make any sense on an already established
            SSL/TLS session.
            """
            raise error_proto('-ERR TLS session already established')

    __all__.append("POP3_SSL")

if __name__ == "__main__":
    import sys
    a = POP3(sys.argv[1])
    print(a.getwelcome())
    a.user(sys.argv[2])
    a.pass_(sys.argv[3])
    a.list()
    (numMsgs, totalSize) = a.stat()
    for i in range(1, numMsgs + 1):
        (header, msg, octets) = a.retr(i)
        print("Message %d:" % i)
        for line in msg:
            print('   ' + line)
        print('-----------------------')
    a.quit()
socketserver.py000064400000065240151153537630007655 0ustar00"""Generic socket server classes.

This module tries to capture the various aspects of defining a server:

For socket-based servers:

- address family:
        - AF_INET{,6}: IP (Internet Protocol) sockets (default)
        - AF_UNIX: Unix domain sockets
        - others, e.g. AF_DECNET are conceivable (see <socket.h>
- socket type:
        - SOCK_STREAM (reliable stream, e.g. TCP)
        - SOCK_DGRAM (datagrams, e.g. UDP)

For request-based servers (including socket-based):

- client address verification before further looking at the request
        (This is actually a hook for any processing that needs to look
         at the request before anything else, e.g. logging)
- how to handle multiple requests:
        - synchronous (one request is handled at a time)
        - forking (each request is handled by a new process)
        - threading (each request is handled by a new thread)

The classes in this module favor the server type that is simplest to
write: a synchronous TCP/IP server.  This is bad class design, but
saves some typing.  (There's also the issue that a deep class hierarchy
slows down method lookups.)

There are five classes in an inheritance diagram, four of which represent
synchronous servers of four types:

        +------------+
        | BaseServer |
        +------------+
              |
              v
        +-----------+        +------------------+
        | TCPServer |------->| UnixStreamServer |
        +-----------+        +------------------+
              |
              v
        +-----------+        +--------------------+
        | UDPServer |------->| UnixDatagramServer |
        +-----------+        +--------------------+

Note that UnixDatagramServer derives from UDPServer, not from
UnixStreamServer -- the only difference between an IP and a Unix
stream server is the address family, which is simply repeated in both
unix server classes.

Forking and threading versions of each type of server can be created
using the ForkingMixIn and ThreadingMixIn mix-in classes.  For
instance, a threading UDP server class is created as follows:

        class ThreadingUDPServer(ThreadingMixIn, UDPServer): pass

The Mix-in class must come first, since it overrides a method defined
in UDPServer! Setting the various member variables also changes
the behavior of the underlying server mechanism.

To implement a service, you must derive a class from
BaseRequestHandler and redefine its handle() method.  You can then run
various versions of the service by combining one of the server classes
with your request handler class.

The request handler class must be different for datagram or stream
services.  This can be hidden by using the request handler
subclasses StreamRequestHandler or DatagramRequestHandler.

Of course, you still have to use your head!

For instance, it makes no sense to use a forking server if the service
contains state in memory that can be modified by requests (since the
modifications in the child process would never reach the initial state
kept in the parent process and passed to each child).  In this case,
you can use a threading server, but you will probably have to use
locks to avoid two requests that come in nearly simultaneous to apply
conflicting changes to the server state.

On the other hand, if you are building e.g. an HTTP server, where all
data is stored externally (e.g. in the file system), a synchronous
class will essentially render the service "deaf" while one request is
being handled -- which may be for a very long time if a client is slow
to read all the data it has requested.  Here a threading or forking
server is appropriate.

In some cases, it may be appropriate to process part of a request
synchronously, but to finish processing in a forked child depending on
the request data.  This can be implemented by using a synchronous
server and doing an explicit fork in the request handler class
handle() method.

Another approach to handling multiple simultaneous requests in an
environment that supports neither threads nor fork (or where these are
too expensive or inappropriate for the service) is to maintain an
explicit table of partially finished requests and to use a selector to
decide which request to work on next (or whether to handle a new
incoming request).  This is particularly important for stream services
where each client can potentially be connected for a long time (if
threads or subprocesses cannot be used).

Future work:
- Standard classes for Sun RPC (which uses either UDP or TCP)
- Standard mix-in classes to implement various authentication
  and encryption schemes

XXX Open problems:
- What to do with out-of-band data?

BaseServer:
- split generic "request" functionality out into BaseServer class.
  Copyright (C) 2000  Luke Kenneth Casson Leighton <lkcl@samba.org>

  example: read entries from a SQL database (requires overriding
  get_request() to return a table entry from the database).
  entry is processed by a RequestHandlerClass.

"""

# Author of the BaseServer patch: Luke Kenneth Casson Leighton

__version__ = "0.4"


import socket
import selectors
import os
import sys
import threading
from io import BufferedIOBase
from time import monotonic as time

__all__ = ["BaseServer", "TCPServer", "UDPServer",
           "ThreadingUDPServer", "ThreadingTCPServer",
           "BaseRequestHandler", "StreamRequestHandler",
           "DatagramRequestHandler", "ThreadingMixIn"]
if hasattr(os, "fork"):
    __all__.extend(["ForkingUDPServer","ForkingTCPServer", "ForkingMixIn"])
if hasattr(socket, "AF_UNIX"):
    __all__.extend(["UnixStreamServer","UnixDatagramServer",
                    "ThreadingUnixStreamServer",
                    "ThreadingUnixDatagramServer"])

# poll/select have the advantage of not requiring any extra file descriptor,
# contrarily to epoll/kqueue (also, they require a single syscall).
if hasattr(selectors, 'PollSelector'):
    _ServerSelector = selectors.PollSelector
else:
    _ServerSelector = selectors.SelectSelector


class BaseServer:

    """Base class for server classes.

    Methods for the caller:

    - __init__(server_address, RequestHandlerClass)
    - serve_forever(poll_interval=0.5)
    - shutdown()
    - handle_request()  # if you do not use serve_forever()
    - fileno() -> int   # for selector

    Methods that may be overridden:

    - server_bind()
    - server_activate()
    - get_request() -> request, client_address
    - handle_timeout()
    - verify_request(request, client_address)
    - server_close()
    - process_request(request, client_address)
    - shutdown_request(request)
    - close_request(request)
    - service_actions()
    - handle_error()

    Methods for derived classes:

    - finish_request(request, client_address)

    Class variables that may be overridden by derived classes or
    instances:

    - timeout
    - address_family
    - socket_type
    - allow_reuse_address

    Instance variables:

    - RequestHandlerClass
    - socket

    """

    timeout = None

    def __init__(self, server_address, RequestHandlerClass):
        """Constructor.  May be extended, do not override."""
        self.server_address = server_address
        self.RequestHandlerClass = RequestHandlerClass
        self.__is_shut_down = threading.Event()
        self.__shutdown_request = False

    def server_activate(self):
        """Called by constructor to activate the server.

        May be overridden.

        """
        pass

    def serve_forever(self, poll_interval=0.5):
        """Handle one request at a time until shutdown.

        Polls for shutdown every poll_interval seconds. Ignores
        self.timeout. If you need to do periodic tasks, do them in
        another thread.
        """
        self.__is_shut_down.clear()
        try:
            # XXX: Consider using another file descriptor or connecting to the
            # socket to wake this up instead of polling. Polling reduces our
            # responsiveness to a shutdown request and wastes cpu at all other
            # times.
            with _ServerSelector() as selector:
                selector.register(self, selectors.EVENT_READ)

                while not self.__shutdown_request:
                    ready = selector.select(poll_interval)
                    # bpo-35017: shutdown() called during select(), exit immediately.
                    if self.__shutdown_request:
                        break
                    if ready:
                        self._handle_request_noblock()

                    self.service_actions()
        finally:
            self.__shutdown_request = False
            self.__is_shut_down.set()

    def shutdown(self):
        """Stops the serve_forever loop.

        Blocks until the loop has finished. This must be called while
        serve_forever() is running in another thread, or it will
        deadlock.
        """
        self.__shutdown_request = True
        self.__is_shut_down.wait()

    def service_actions(self):
        """Called by the serve_forever() loop.

        May be overridden by a subclass / Mixin to implement any code that
        needs to be run during the loop.
        """
        pass

    # The distinction between handling, getting, processing and finishing a
    # request is fairly arbitrary.  Remember:
    #
    # - handle_request() is the top-level call.  It calls selector.select(),
    #   get_request(), verify_request() and process_request()
    # - get_request() is different for stream or datagram sockets
    # - process_request() is the place that may fork a new process or create a
    #   new thread to finish the request
    # - finish_request() instantiates the request handler class; this
    #   constructor will handle the request all by itself

    def handle_request(self):
        """Handle one request, possibly blocking.

        Respects self.timeout.
        """
        # Support people who used socket.settimeout() to escape
        # handle_request before self.timeout was available.
        timeout = self.socket.gettimeout()
        if timeout is None:
            timeout = self.timeout
        elif self.timeout is not None:
            timeout = min(timeout, self.timeout)
        if timeout is not None:
            deadline = time() + timeout

        # Wait until a request arrives or the timeout expires - the loop is
        # necessary to accommodate early wakeups due to EINTR.
        with _ServerSelector() as selector:
            selector.register(self, selectors.EVENT_READ)

            while True:
                ready = selector.select(timeout)
                if ready:
                    return self._handle_request_noblock()
                else:
                    if timeout is not None:
                        timeout = deadline - time()
                        if timeout < 0:
                            return self.handle_timeout()

    def _handle_request_noblock(self):
        """Handle one request, without blocking.

        I assume that selector.select() has returned that the socket is
        readable before this function was called, so there should be no risk of
        blocking in get_request().
        """
        try:
            request, client_address = self.get_request()
        except OSError:
            return
        if self.verify_request(request, client_address):
            try:
                self.process_request(request, client_address)
            except Exception:
                self.handle_error(request, client_address)
                self.shutdown_request(request)
            except:
                self.shutdown_request(request)
                raise
        else:
            self.shutdown_request(request)

    def handle_timeout(self):
        """Called if no new request arrives within self.timeout.

        Overridden by ForkingMixIn.
        """
        pass

    def verify_request(self, request, client_address):
        """Verify the request.  May be overridden.

        Return True if we should proceed with this request.

        """
        return True

    def process_request(self, request, client_address):
        """Call finish_request.

        Overridden by ForkingMixIn and ThreadingMixIn.

        """
        self.finish_request(request, client_address)
        self.shutdown_request(request)

    def server_close(self):
        """Called to clean-up the server.

        May be overridden.

        """
        pass

    def finish_request(self, request, client_address):
        """Finish one request by instantiating RequestHandlerClass."""
        self.RequestHandlerClass(request, client_address, self)

    def shutdown_request(self, request):
        """Called to shutdown and close an individual request."""
        self.close_request(request)

    def close_request(self, request):
        """Called to clean up an individual request."""
        pass

    def handle_error(self, request, client_address):
        """Handle an error gracefully.  May be overridden.

        The default is to print a traceback and continue.

        """
        print('-'*40, file=sys.stderr)
        print('Exception happened during processing of request from',
            client_address, file=sys.stderr)
        import traceback
        traceback.print_exc()
        print('-'*40, file=sys.stderr)

    def __enter__(self):
        return self

    def __exit__(self, *args):
        self.server_close()


class TCPServer(BaseServer):

    """Base class for various socket-based server classes.

    Defaults to synchronous IP stream (i.e., TCP).

    Methods for the caller:

    - __init__(server_address, RequestHandlerClass, bind_and_activate=True)
    - serve_forever(poll_interval=0.5)
    - shutdown()
    - handle_request()  # if you don't use serve_forever()
    - fileno() -> int   # for selector

    Methods that may be overridden:

    - server_bind()
    - server_activate()
    - get_request() -> request, client_address
    - handle_timeout()
    - verify_request(request, client_address)
    - process_request(request, client_address)
    - shutdown_request(request)
    - close_request(request)
    - handle_error()

    Methods for derived classes:

    - finish_request(request, client_address)

    Class variables that may be overridden by derived classes or
    instances:

    - timeout
    - address_family
    - socket_type
    - request_queue_size (only for stream sockets)
    - allow_reuse_address

    Instance variables:

    - server_address
    - RequestHandlerClass
    - socket

    """

    address_family = socket.AF_INET

    socket_type = socket.SOCK_STREAM

    request_queue_size = 5

    allow_reuse_address = False

    def __init__(self, server_address, RequestHandlerClass, bind_and_activate=True):
        """Constructor.  May be extended, do not override."""
        BaseServer.__init__(self, server_address, RequestHandlerClass)
        self.socket = socket.socket(self.address_family,
                                    self.socket_type)
        if bind_and_activate:
            try:
                self.server_bind()
                self.server_activate()
            except:
                self.server_close()
                raise

    def server_bind(self):
        """Called by constructor to bind the socket.

        May be overridden.

        """
        if self.allow_reuse_address:
            self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
        self.socket.bind(self.server_address)
        self.server_address = self.socket.getsockname()

    def server_activate(self):
        """Called by constructor to activate the server.

        May be overridden.

        """
        self.socket.listen(self.request_queue_size)

    def server_close(self):
        """Called to clean-up the server.

        May be overridden.

        """
        self.socket.close()

    def fileno(self):
        """Return socket file number.

        Interface required by selector.

        """
        return self.socket.fileno()

    def get_request(self):
        """Get the request and client address from the socket.

        May be overridden.

        """
        return self.socket.accept()

    def shutdown_request(self, request):
        """Called to shutdown and close an individual request."""
        try:
            #explicitly shutdown.  socket.close() merely releases
            #the socket and waits for GC to perform the actual close.
            request.shutdown(socket.SHUT_WR)
        except OSError:
            pass #some platforms may raise ENOTCONN here
        self.close_request(request)

    def close_request(self, request):
        """Called to clean up an individual request."""
        request.close()


class UDPServer(TCPServer):

    """UDP server class."""

    allow_reuse_address = False

    socket_type = socket.SOCK_DGRAM

    max_packet_size = 8192

    def get_request(self):
        data, client_addr = self.socket.recvfrom(self.max_packet_size)
        return (data, self.socket), client_addr

    def server_activate(self):
        # No need to call listen() for UDP.
        pass

    def shutdown_request(self, request):
        # No need to shutdown anything.
        self.close_request(request)

    def close_request(self, request):
        # No need to close anything.
        pass

if hasattr(os, "fork"):
    class ForkingMixIn:
        """Mix-in class to handle each request in a new process."""

        timeout = 300
        active_children = None
        max_children = 40
        # If true, server_close() waits until all child processes complete.
        block_on_close = True

        def collect_children(self, *, blocking=False):
            """Internal routine to wait for children that have exited."""
            if self.active_children is None:
                return

            # If we're above the max number of children, wait and reap them until
            # we go back below threshold. Note that we use waitpid(-1) below to be
            # able to collect children in size(<defunct children>) syscalls instead
            # of size(<children>): the downside is that this might reap children
            # which we didn't spawn, which is why we only resort to this when we're
            # above max_children.
            while len(self.active_children) >= self.max_children:
                try:
                    pid, _ = os.waitpid(-1, 0)
                    self.active_children.discard(pid)
                except ChildProcessError:
                    # we don't have any children, we're done
                    self.active_children.clear()
                except OSError:
                    break

            # Now reap all defunct children.
            for pid in self.active_children.copy():
                try:
                    flags = 0 if blocking else os.WNOHANG
                    pid, _ = os.waitpid(pid, flags)
                    # if the child hasn't exited yet, pid will be 0 and ignored by
                    # discard() below
                    self.active_children.discard(pid)
                except ChildProcessError:
                    # someone else reaped it
                    self.active_children.discard(pid)
                except OSError:
                    pass

        def handle_timeout(self):
            """Wait for zombies after self.timeout seconds of inactivity.

            May be extended, do not override.
            """
            self.collect_children()

        def service_actions(self):
            """Collect the zombie child processes regularly in the ForkingMixIn.

            service_actions is called in the BaseServer's serve_forever loop.
            """
            self.collect_children()

        def process_request(self, request, client_address):
            """Fork a new subprocess to process the request."""
            pid = os.fork()
            if pid:
                # Parent process
                if self.active_children is None:
                    self.active_children = set()
                self.active_children.add(pid)
                self.close_request(request)
                return
            else:
                # Child process.
                # This must never return, hence os._exit()!
                status = 1
                try:
                    self.finish_request(request, client_address)
                    status = 0
                except Exception:
                    self.handle_error(request, client_address)
                finally:
                    try:
                        self.shutdown_request(request)
                    finally:
                        os._exit(status)

        def server_close(self):
            super().server_close()
            self.collect_children(blocking=self.block_on_close)


class _Threads(list):
    """
    Joinable list of all non-daemon threads.
    """
    def append(self, thread):
        self.reap()
        if thread.daemon:
            return
        super().append(thread)

    def pop_all(self):
        self[:], result = [], self[:]
        return result

    def join(self):
        for thread in self.pop_all():
            thread.join()

    def reap(self):
        self[:] = (thread for thread in self if thread.is_alive())


class _NoThreads:
    """
    Degenerate version of _Threads.
    """
    def append(self, thread):
        pass

    def join(self):
        pass


class ThreadingMixIn:
    """Mix-in class to handle each request in a new thread."""

    # Decides how threads will act upon termination of the
    # main process
    daemon_threads = False
    # If true, server_close() waits until all non-daemonic threads terminate.
    block_on_close = True
    # Threads object
    # used by server_close() to wait for all threads completion.
    _threads = _NoThreads()

    def process_request_thread(self, request, client_address):
        """Same as in BaseServer but as a thread.

        In addition, exception handling is done here.

        """
        try:
            self.finish_request(request, client_address)
        except Exception:
            self.handle_error(request, client_address)
        finally:
            self.shutdown_request(request)

    def process_request(self, request, client_address):
        """Start a new thread to process the request."""
        if self.block_on_close:
            vars(self).setdefault('_threads', _Threads())
        t = threading.Thread(target = self.process_request_thread,
                             args = (request, client_address))
        t.daemon = self.daemon_threads
        self._threads.append(t)
        t.start()

    def server_close(self):
        super().server_close()
        self._threads.join()


if hasattr(os, "fork"):
    class ForkingUDPServer(ForkingMixIn, UDPServer): pass
    class ForkingTCPServer(ForkingMixIn, TCPServer): pass

class ThreadingUDPServer(ThreadingMixIn, UDPServer): pass
class ThreadingTCPServer(ThreadingMixIn, TCPServer): pass

if hasattr(socket, 'AF_UNIX'):

    class UnixStreamServer(TCPServer):
        address_family = socket.AF_UNIX

    class UnixDatagramServer(UDPServer):
        address_family = socket.AF_UNIX

    class ThreadingUnixStreamServer(ThreadingMixIn, UnixStreamServer): pass

    class ThreadingUnixDatagramServer(ThreadingMixIn, UnixDatagramServer): pass

class BaseRequestHandler:

    """Base class for request handler classes.

    This class is instantiated for each request to be handled.  The
    constructor sets the instance variables request, client_address
    and server, and then calls the handle() method.  To implement a
    specific service, all you need to do is to derive a class which
    defines a handle() method.

    The handle() method can find the request as self.request, the
    client address as self.client_address, and the server (in case it
    needs access to per-server information) as self.server.  Since a
    separate instance is created for each request, the handle() method
    can define other arbitrary instance variables.

    """

    def __init__(self, request, client_address, server):
        self.request = request
        self.client_address = client_address
        self.server = server
        self.setup()
        try:
            self.handle()
        finally:
            self.finish()

    def setup(self):
        pass

    def handle(self):
        pass

    def finish(self):
        pass


# The following two classes make it possible to use the same service
# class for stream or datagram servers.
# Each class sets up these instance variables:
# - rfile: a file object from which receives the request is read
# - wfile: a file object to which the reply is written
# When the handle() method returns, wfile is flushed properly


class StreamRequestHandler(BaseRequestHandler):

    """Define self.rfile and self.wfile for stream sockets."""

    # Default buffer sizes for rfile, wfile.
    # We default rfile to buffered because otherwise it could be
    # really slow for large data (a getc() call per byte); we make
    # wfile unbuffered because (a) often after a write() we want to
    # read and we need to flush the line; (b) big writes to unbuffered
    # files are typically optimized by stdio even when big reads
    # aren't.
    rbufsize = -1
    wbufsize = 0

    # A timeout to apply to the request socket, if not None.
    timeout = None

    # Disable nagle algorithm for this socket, if True.
    # Use only when wbufsize != 0, to avoid small packets.
    disable_nagle_algorithm = False

    def setup(self):
        self.connection = self.request
        if self.timeout is not None:
            self.connection.settimeout(self.timeout)
        if self.disable_nagle_algorithm:
            self.connection.setsockopt(socket.IPPROTO_TCP,
                                       socket.TCP_NODELAY, True)
        self.rfile = self.connection.makefile('rb', self.rbufsize)
        if self.wbufsize == 0:
            self.wfile = _SocketWriter(self.connection)
        else:
            self.wfile = self.connection.makefile('wb', self.wbufsize)

    def finish(self):
        if not self.wfile.closed:
            try:
                self.wfile.flush()
            except socket.error:
                # A final socket error may have occurred here, such as
                # the local error ECONNABORTED.
                pass
        self.wfile.close()
        self.rfile.close()

class _SocketWriter(BufferedIOBase):
    """Simple writable BufferedIOBase implementation for a socket

    Does not hold data in a buffer, avoiding any need to call flush()."""

    def __init__(self, sock):
        self._sock = sock

    def writable(self):
        return True

    def write(self, b):
        self._sock.sendall(b)
        with memoryview(b) as view:
            return view.nbytes

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

class DatagramRequestHandler(BaseRequestHandler):

    """Define self.rfile and self.wfile for datagram sockets."""

    def setup(self):
        from io import BytesIO
        self.packet, self.socket = self.request
        self.rfile = BytesIO(self.packet)
        self.wfile = BytesIO()

    def finish(self):
        self.socket.sendto(self.wfile.getvalue(), self.client_address)
heapq.py000064400000054535151153537630006241 0ustar00"""Heap queue algorithm (a.k.a. priority queue).

Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0.  For the sake of comparison,
non-existing elements are considered to be infinite.  The interesting
property of a heap is that a[0] is always its smallest element.

Usage:

heap = []            # creates an empty heap
heappush(heap, item) # pushes a new item on the heap
item = heappop(heap) # pops the smallest item from the heap
item = heap[0]       # smallest item on the heap without popping it
heapify(x)           # transforms list into a heap, in-place, in linear time
item = heapreplace(heap, item) # pops and returns smallest item, and adds
                               # new item; the heap size is unchanged

Our API differs from textbook heap algorithms as follows:

- We use 0-based indexing.  This makes the relationship between the
  index for a node and the indexes for its children slightly less
  obvious, but is more suitable since Python uses 0-based indexing.

- Our heappop() method returns the smallest item, not the largest.

These two make it possible to view the heap as a regular Python list
without surprises: heap[0] is the smallest item, and heap.sort()
maintains the heap invariant!
"""

# Original code by Kevin O'Connor, augmented by Tim Peters and Raymond Hettinger

__about__ = """Heap queues

[explanation by François Pinard]

Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0.  For the sake of comparison,
non-existing elements are considered to be infinite.  The interesting
property of a heap is that a[0] is always its smallest element.

The strange invariant above is meant to be an efficient memory
representation for a tournament.  The numbers below are `k', not a[k]:

                                   0

                  1                                 2

          3               4                5               6

      7       8       9       10      11      12      13      14

    15 16   17 18   19 20   21 22   23 24   25 26   27 28   29 30


In the tree above, each cell `k' is topping `2*k+1' and `2*k+2'.  In
a usual binary tournament we see in sports, each cell is the winner
over the two cells it tops, and we can trace the winner down the tree
to see all opponents s/he had.  However, in many computer applications
of such tournaments, we do not need to trace the history of a winner.
To be more memory efficient, when a winner is promoted, we try to
replace it by something else at a lower level, and the rule becomes
that a cell and the two cells it tops contain three different items,
but the top cell "wins" over the two topped cells.

If this heap invariant is protected at all time, index 0 is clearly
the overall winner.  The simplest algorithmic way to remove it and
find the "next" winner is to move some loser (let's say cell 30 in the
diagram above) into the 0 position, and then percolate this new 0 down
the tree, exchanging values, until the invariant is re-established.
This is clearly logarithmic on the total number of items in the tree.
By iterating over all items, you get an O(n ln n) sort.

A nice feature of this sort is that you can efficiently insert new
items while the sort is going on, provided that the inserted items are
not "better" than the last 0'th element you extracted.  This is
especially useful in simulation contexts, where the tree holds all
incoming events, and the "win" condition means the smallest scheduled
time.  When an event schedule other events for execution, they are
scheduled into the future, so they can easily go into the heap.  So, a
heap is a good structure for implementing schedulers (this is what I
used for my MIDI sequencer :-).

Various structures for implementing schedulers have been extensively
studied, and heaps are good for this, as they are reasonably speedy,
the speed is almost constant, and the worst case is not much different
than the average case.  However, there are other representations which
are more efficient overall, yet the worst cases might be terrible.

Heaps are also very useful in big disk sorts.  You most probably all
know that a big sort implies producing "runs" (which are pre-sorted
sequences, which size is usually related to the amount of CPU memory),
followed by a merging passes for these runs, which merging is often
very cleverly organised[1].  It is very important that the initial
sort produces the longest runs possible.  Tournaments are a good way
to that.  If, using all the memory available to hold a tournament, you
replace and percolate items that happen to fit the current run, you'll
produce runs which are twice the size of the memory for random input,
and much better for input fuzzily ordered.

Moreover, if you output the 0'th item on disk and get an input which
may not fit in the current tournament (because the value "wins" over
the last output value), it cannot fit in the heap, so the size of the
heap decreases.  The freed memory could be cleverly reused immediately
for progressively building a second heap, which grows at exactly the
same rate the first heap is melting.  When the first heap completely
vanishes, you switch heaps and start a new run.  Clever and quite
effective!

In a word, heaps are useful memory structures to know.  I use them in
a few applications, and I think it is good to keep a `heap' module
around. :-)

--------------------
[1] The disk balancing algorithms which are current, nowadays, are
more annoying than clever, and this is a consequence of the seeking
capabilities of the disks.  On devices which cannot seek, like big
tape drives, the story was quite different, and one had to be very
clever to ensure (far in advance) that each tape movement will be the
most effective possible (that is, will best participate at
"progressing" the merge).  Some tapes were even able to read
backwards, and this was also used to avoid the rewinding time.
Believe me, real good tape sorts were quite spectacular to watch!
From all times, sorting has always been a Great Art! :-)
"""

__all__ = ['heappush', 'heappop', 'heapify', 'heapreplace', 'merge',
           'nlargest', 'nsmallest', 'heappushpop']

def heappush(heap, item):
    """Push item onto heap, maintaining the heap invariant."""
    heap.append(item)
    _siftdown(heap, 0, len(heap)-1)

def heappop(heap):
    """Pop the smallest item off the heap, maintaining the heap invariant."""
    lastelt = heap.pop()    # raises appropriate IndexError if heap is empty
    if heap:
        returnitem = heap[0]
        heap[0] = lastelt
        _siftup(heap, 0)
        return returnitem
    return lastelt

def heapreplace(heap, item):
    """Pop and return the current smallest value, and add the new item.

    This is more efficient than heappop() followed by heappush(), and can be
    more appropriate when using a fixed-size heap.  Note that the value
    returned may be larger than item!  That constrains reasonable uses of
    this routine unless written as part of a conditional replacement:

        if item > heap[0]:
            item = heapreplace(heap, item)
    """
    returnitem = heap[0]    # raises appropriate IndexError if heap is empty
    heap[0] = item
    _siftup(heap, 0)
    return returnitem

def heappushpop(heap, item):
    """Fast version of a heappush followed by a heappop."""
    if heap and heap[0] < item:
        item, heap[0] = heap[0], item
        _siftup(heap, 0)
    return item

def heapify(x):
    """Transform list into a heap, in-place, in O(len(x)) time."""
    n = len(x)
    # Transform bottom-up.  The largest index there's any point to looking at
    # is the largest with a child index in-range, so must have 2*i + 1 < n,
    # or i < (n-1)/2.  If n is even = 2*j, this is (2*j-1)/2 = j-1/2 so
    # j-1 is the largest, which is n//2 - 1.  If n is odd = 2*j+1, this is
    # (2*j+1-1)/2 = j so j-1 is the largest, and that's again n//2-1.
    for i in reversed(range(n//2)):
        _siftup(x, i)

def _heappop_max(heap):
    """Maxheap version of a heappop."""
    lastelt = heap.pop()    # raises appropriate IndexError if heap is empty
    if heap:
        returnitem = heap[0]
        heap[0] = lastelt
        _siftup_max(heap, 0)
        return returnitem
    return lastelt

def _heapreplace_max(heap, item):
    """Maxheap version of a heappop followed by a heappush."""
    returnitem = heap[0]    # raises appropriate IndexError if heap is empty
    heap[0] = item
    _siftup_max(heap, 0)
    return returnitem

def _heapify_max(x):
    """Transform list into a maxheap, in-place, in O(len(x)) time."""
    n = len(x)
    for i in reversed(range(n//2)):
        _siftup_max(x, i)

# 'heap' is a heap at all indices >= startpos, except possibly for pos.  pos
# is the index of a leaf with a possibly out-of-order value.  Restore the
# heap invariant.
def _siftdown(heap, startpos, pos):
    newitem = heap[pos]
    # Follow the path to the root, moving parents down until finding a place
    # newitem fits.
    while pos > startpos:
        parentpos = (pos - 1) >> 1
        parent = heap[parentpos]
        if newitem < parent:
            heap[pos] = parent
            pos = parentpos
            continue
        break
    heap[pos] = newitem

# The child indices of heap index pos are already heaps, and we want to make
# a heap at index pos too.  We do this by bubbling the smaller child of
# pos up (and so on with that child's children, etc) until hitting a leaf,
# then using _siftdown to move the oddball originally at index pos into place.
#
# We *could* break out of the loop as soon as we find a pos where newitem <=
# both its children, but turns out that's not a good idea, and despite that
# many books write the algorithm that way.  During a heap pop, the last array
# element is sifted in, and that tends to be large, so that comparing it
# against values starting from the root usually doesn't pay (= usually doesn't
# get us out of the loop early).  See Knuth, Volume 3, where this is
# explained and quantified in an exercise.
#
# Cutting the # of comparisons is important, since these routines have no
# way to extract "the priority" from an array element, so that intelligence
# is likely to be hiding in custom comparison methods, or in array elements
# storing (priority, record) tuples.  Comparisons are thus potentially
# expensive.
#
# On random arrays of length 1000, making this change cut the number of
# comparisons made by heapify() a little, and those made by exhaustive
# heappop() a lot, in accord with theory.  Here are typical results from 3
# runs (3 just to demonstrate how small the variance is):
#
# Compares needed by heapify     Compares needed by 1000 heappops
# --------------------------     --------------------------------
# 1837 cut to 1663               14996 cut to 8680
# 1855 cut to 1659               14966 cut to 8678
# 1847 cut to 1660               15024 cut to 8703
#
# Building the heap by using heappush() 1000 times instead required
# 2198, 2148, and 2219 compares:  heapify() is more efficient, when
# you can use it.
#
# The total compares needed by list.sort() on the same lists were 8627,
# 8627, and 8632 (this should be compared to the sum of heapify() and
# heappop() compares):  list.sort() is (unsurprisingly!) more efficient
# for sorting.

def _siftup(heap, pos):
    endpos = len(heap)
    startpos = pos
    newitem = heap[pos]
    # Bubble up the smaller child until hitting a leaf.
    childpos = 2*pos + 1    # leftmost child position
    while childpos < endpos:
        # Set childpos to index of smaller child.
        rightpos = childpos + 1
        if rightpos < endpos and not heap[childpos] < heap[rightpos]:
            childpos = rightpos
        # Move the smaller child up.
        heap[pos] = heap[childpos]
        pos = childpos
        childpos = 2*pos + 1
    # The leaf at pos is empty now.  Put newitem there, and bubble it up
    # to its final resting place (by sifting its parents down).
    heap[pos] = newitem
    _siftdown(heap, startpos, pos)

def _siftdown_max(heap, startpos, pos):
    'Maxheap variant of _siftdown'
    newitem = heap[pos]
    # Follow the path to the root, moving parents down until finding a place
    # newitem fits.
    while pos > startpos:
        parentpos = (pos - 1) >> 1
        parent = heap[parentpos]
        if parent < newitem:
            heap[pos] = parent
            pos = parentpos
            continue
        break
    heap[pos] = newitem

def _siftup_max(heap, pos):
    'Maxheap variant of _siftup'
    endpos = len(heap)
    startpos = pos
    newitem = heap[pos]
    # Bubble up the larger child until hitting a leaf.
    childpos = 2*pos + 1    # leftmost child position
    while childpos < endpos:
        # Set childpos to index of larger child.
        rightpos = childpos + 1
        if rightpos < endpos and not heap[rightpos] < heap[childpos]:
            childpos = rightpos
        # Move the larger child up.
        heap[pos] = heap[childpos]
        pos = childpos
        childpos = 2*pos + 1
    # The leaf at pos is empty now.  Put newitem there, and bubble it up
    # to its final resting place (by sifting its parents down).
    heap[pos] = newitem
    _siftdown_max(heap, startpos, pos)

def merge(*iterables, key=None, reverse=False):
    '''Merge multiple sorted inputs into a single sorted output.

    Similar to sorted(itertools.chain(*iterables)) but returns a generator,
    does not pull the data into memory all at once, and assumes that each of
    the input streams is already sorted (smallest to largest).

    >>> list(merge([1,3,5,7], [0,2,4,8], [5,10,15,20], [], [25]))
    [0, 1, 2, 3, 4, 5, 5, 7, 8, 10, 15, 20, 25]

    If *key* is not None, applies a key function to each element to determine
    its sort order.

    >>> list(merge(['dog', 'horse'], ['cat', 'fish', 'kangaroo'], key=len))
    ['dog', 'cat', 'fish', 'horse', 'kangaroo']

    '''

    h = []
    h_append = h.append

    if reverse:
        _heapify = _heapify_max
        _heappop = _heappop_max
        _heapreplace = _heapreplace_max
        direction = -1
    else:
        _heapify = heapify
        _heappop = heappop
        _heapreplace = heapreplace
        direction = 1

    if key is None:
        for order, it in enumerate(map(iter, iterables)):
            try:
                next = it.__next__
                h_append([next(), order * direction, next])
            except StopIteration:
                pass
        _heapify(h)
        while len(h) > 1:
            try:
                while True:
                    value, order, next = s = h[0]
                    yield value
                    s[0] = next()           # raises StopIteration when exhausted
                    _heapreplace(h, s)      # restore heap condition
            except StopIteration:
                _heappop(h)                 # remove empty iterator
        if h:
            # fast case when only a single iterator remains
            value, order, next = h[0]
            yield value
            yield from next.__self__
        return

    for order, it in enumerate(map(iter, iterables)):
        try:
            next = it.__next__
            value = next()
            h_append([key(value), order * direction, value, next])
        except StopIteration:
            pass
    _heapify(h)
    while len(h) > 1:
        try:
            while True:
                key_value, order, value, next = s = h[0]
                yield value
                value = next()
                s[0] = key(value)
                s[2] = value
                _heapreplace(h, s)
        except StopIteration:
            _heappop(h)
    if h:
        key_value, order, value, next = h[0]
        yield value
        yield from next.__self__


# Algorithm notes for nlargest() and nsmallest()
# ==============================================
#
# Make a single pass over the data while keeping the k most extreme values
# in a heap.  Memory consumption is limited to keeping k values in a list.
#
# Measured performance for random inputs:
#
#                                   number of comparisons
#    n inputs     k-extreme values  (average of 5 trials)   % more than min()
# -------------   ----------------  ---------------------   -----------------
#      1,000           100                  3,317               231.7%
#     10,000           100                 14,046                40.5%
#    100,000           100                105,749                 5.7%
#  1,000,000           100              1,007,751                 0.8%
# 10,000,000           100             10,009,401                 0.1%
#
# Theoretical number of comparisons for k smallest of n random inputs:
#
# Step   Comparisons                  Action
# ----   --------------------------   ---------------------------
#  1     1.66 * k                     heapify the first k-inputs
#  2     n - k                        compare remaining elements to top of heap
#  3     k * (1 + lg2(k)) * ln(n/k)   replace the topmost value on the heap
#  4     k * lg2(k) - (k/2)           final sort of the k most extreme values
#
# Combining and simplifying for a rough estimate gives:
#
#        comparisons = n + k * (log(k, 2) * log(n/k) + log(k, 2) + log(n/k))
#
# Computing the number of comparisons for step 3:
# -----------------------------------------------
# * For the i-th new value from the iterable, the probability of being in the
#   k most extreme values is k/i.  For example, the probability of the 101st
#   value seen being in the 100 most extreme values is 100/101.
# * If the value is a new extreme value, the cost of inserting it into the
#   heap is 1 + log(k, 2).
# * The probability times the cost gives:
#            (k/i) * (1 + log(k, 2))
# * Summing across the remaining n-k elements gives:
#            sum((k/i) * (1 + log(k, 2)) for i in range(k+1, n+1))
# * This reduces to:
#            (H(n) - H(k)) * k * (1 + log(k, 2))
# * Where H(n) is the n-th harmonic number estimated by:
#            gamma = 0.5772156649
#            H(n) = log(n, e) + gamma + 1 / (2 * n)
#   http://en.wikipedia.org/wiki/Harmonic_series_(mathematics)#Rate_of_divergence
# * Substituting the H(n) formula:
#            comparisons = k * (1 + log(k, 2)) * (log(n/k, e) + (1/n - 1/k) / 2)
#
# Worst-case for step 3:
# ----------------------
# In the worst case, the input data is reversed sorted so that every new element
# must be inserted in the heap:
#
#             comparisons = 1.66 * k + log(k, 2) * (n - k)
#
# Alternative Algorithms
# ----------------------
# Other algorithms were not used because they:
# 1) Took much more auxiliary memory,
# 2) Made multiple passes over the data.
# 3) Made more comparisons in common cases (small k, large n, semi-random input).
# See the more detailed comparison of approach at:
# http://code.activestate.com/recipes/577573-compare-algorithms-for-heapqsmallest

def nsmallest(n, iterable, key=None):
    """Find the n smallest elements in a dataset.

    Equivalent to:  sorted(iterable, key=key)[:n]
    """

    # Short-cut for n==1 is to use min()
    if n == 1:
        it = iter(iterable)
        sentinel = object()
        result = min(it, default=sentinel, key=key)
        return [] if result is sentinel else [result]

    # When n>=size, it's faster to use sorted()
    try:
        size = len(iterable)
    except (TypeError, AttributeError):
        pass
    else:
        if n >= size:
            return sorted(iterable, key=key)[:n]

    # When key is none, use simpler decoration
    if key is None:
        it = iter(iterable)
        # put the range(n) first so that zip() doesn't
        # consume one too many elements from the iterator
        result = [(elem, i) for i, elem in zip(range(n), it)]
        if not result:
            return result
        _heapify_max(result)
        top = result[0][0]
        order = n
        _heapreplace = _heapreplace_max
        for elem in it:
            if elem < top:
                _heapreplace(result, (elem, order))
                top, _order = result[0]
                order += 1
        result.sort()
        return [elem for (elem, order) in result]

    # General case, slowest method
    it = iter(iterable)
    result = [(key(elem), i, elem) for i, elem in zip(range(n), it)]
    if not result:
        return result
    _heapify_max(result)
    top = result[0][0]
    order = n
    _heapreplace = _heapreplace_max
    for elem in it:
        k = key(elem)
        if k < top:
            _heapreplace(result, (k, order, elem))
            top, _order, _elem = result[0]
            order += 1
    result.sort()
    return [elem for (k, order, elem) in result]

def nlargest(n, iterable, key=None):
    """Find the n largest elements in a dataset.

    Equivalent to:  sorted(iterable, key=key, reverse=True)[:n]
    """

    # Short-cut for n==1 is to use max()
    if n == 1:
        it = iter(iterable)
        sentinel = object()
        result = max(it, default=sentinel, key=key)
        return [] if result is sentinel else [result]

    # When n>=size, it's faster to use sorted()
    try:
        size = len(iterable)
    except (TypeError, AttributeError):
        pass
    else:
        if n >= size:
            return sorted(iterable, key=key, reverse=True)[:n]

    # When key is none, use simpler decoration
    if key is None:
        it = iter(iterable)
        result = [(elem, i) for i, elem in zip(range(0, -n, -1), it)]
        if not result:
            return result
        heapify(result)
        top = result[0][0]
        order = -n
        _heapreplace = heapreplace
        for elem in it:
            if top < elem:
                _heapreplace(result, (elem, order))
                top, _order = result[0]
                order -= 1
        result.sort(reverse=True)
        return [elem for (elem, order) in result]

    # General case, slowest method
    it = iter(iterable)
    result = [(key(elem), i, elem) for i, elem in zip(range(0, -n, -1), it)]
    if not result:
        return result
    heapify(result)
    top = result[0][0]
    order = -n
    _heapreplace = heapreplace
    for elem in it:
        k = key(elem)
        if top < k:
            _heapreplace(result, (k, order, elem))
            top, _order, _elem = result[0]
            order -= 1
    result.sort(reverse=True)
    return [elem for (k, order, elem) in result]

# If available, use C implementation
try:
    from _heapq import *
except ImportError:
    pass
try:
    from _heapq import _heapreplace_max
except ImportError:
    pass
try:
    from _heapq import _heapify_max
except ImportError:
    pass
try:
    from _heapq import _heappop_max
except ImportError:
    pass


if __name__ == "__main__":

    import doctest # pragma: no cover
    print(doctest.testmod()) # pragma: no cover
ast.py000064400000045442151153537630005727 0ustar00"""
    ast
    ~~~

    The `ast` module helps Python applications to process trees of the Python
    abstract syntax grammar.  The abstract syntax itself might change with
    each Python release; this module helps to find out programmatically what
    the current grammar looks like and allows modifications of it.

    An abstract syntax tree can be generated by passing `ast.PyCF_ONLY_AST` as
    a flag to the `compile()` builtin function or by using the `parse()`
    function from this module.  The result will be a tree of objects whose
    classes all inherit from `ast.AST`.

    A modified abstract syntax tree can be compiled into a Python code object
    using the built-in `compile()` function.

    Additionally various helper functions are provided that make working with
    the trees simpler.  The main intention of the helper functions and this
    module in general is to provide an easy to use interface for libraries
    that work tightly with the python syntax (template engines for example).


    :copyright: Copyright 2008 by Armin Ronacher.
    :license: Python License.
"""
from _ast import *


def parse(source, filename='<unknown>', mode='exec', *,
          type_comments=False, feature_version=None):
    """
    Parse the source into an AST node.
    Equivalent to compile(source, filename, mode, PyCF_ONLY_AST).
    Pass type_comments=True to get back type comments where the syntax allows.
    """
    flags = PyCF_ONLY_AST
    if type_comments:
        flags |= PyCF_TYPE_COMMENTS
    if isinstance(feature_version, tuple):
        major, minor = feature_version  # Should be a 2-tuple.
        assert major == 3
        feature_version = minor
    elif feature_version is None:
        feature_version = -1
    # Else it should be an int giving the minor version for 3.x.
    return compile(source, filename, mode, flags,
                   _feature_version=feature_version)


def literal_eval(node_or_string):
    """
    Safely evaluate an expression node or a string containing a Python
    expression.  The string or node provided may only consist of the following
    Python literal structures: strings, bytes, numbers, tuples, lists, dicts,
    sets, booleans, and None.
    """
    if isinstance(node_or_string, str):
        node_or_string = parse(node_or_string, mode='eval')
    if isinstance(node_or_string, Expression):
        node_or_string = node_or_string.body
    def _raise_malformed_node(node):
        raise ValueError(f'malformed node or string: {node!r}')
    def _convert_num(node):
        if not isinstance(node, Constant) or type(node.value) not in (int, float, complex):
            _raise_malformed_node(node)
        return node.value
    def _convert_signed_num(node):
        if isinstance(node, UnaryOp) and isinstance(node.op, (UAdd, USub)):
            operand = _convert_num(node.operand)
            if isinstance(node.op, UAdd):
                return + operand
            else:
                return - operand
        return _convert_num(node)
    def _convert(node):
        if isinstance(node, Constant):
            return node.value
        elif isinstance(node, Tuple):
            return tuple(map(_convert, node.elts))
        elif isinstance(node, List):
            return list(map(_convert, node.elts))
        elif isinstance(node, Set):
            return set(map(_convert, node.elts))
        elif isinstance(node, Dict):
            if len(node.keys) != len(node.values):
                _raise_malformed_node(node)
            return dict(zip(map(_convert, node.keys),
                            map(_convert, node.values)))
        elif isinstance(node, BinOp) and isinstance(node.op, (Add, Sub)):
            left = _convert_signed_num(node.left)
            right = _convert_num(node.right)
            if isinstance(left, (int, float)) and isinstance(right, complex):
                if isinstance(node.op, Add):
                    return left + right
                else:
                    return left - right
        return _convert_signed_num(node)
    return _convert(node_or_string)


def dump(node, annotate_fields=True, include_attributes=False):
    """
    Return a formatted dump of the tree in node.  This is mainly useful for
    debugging purposes.  If annotate_fields is true (by default),
    the returned string will show the names and the values for fields.
    If annotate_fields is false, the result string will be more compact by
    omitting unambiguous field names.  Attributes such as line
    numbers and column offsets are not dumped by default.  If this is wanted,
    include_attributes can be set to true.
    """
    def _format(node):
        if isinstance(node, AST):
            args = []
            keywords = annotate_fields
            for field in node._fields:
                try:
                    value = getattr(node, field)
                except AttributeError:
                    keywords = True
                else:
                    if keywords:
                        args.append('%s=%s' % (field, _format(value)))
                    else:
                        args.append(_format(value))
            if include_attributes and node._attributes:
                for a in node._attributes:
                    try:
                        args.append('%s=%s' % (a, _format(getattr(node, a))))
                    except AttributeError:
                        pass
            return '%s(%s)' % (node.__class__.__name__, ', '.join(args))
        elif isinstance(node, list):
            return '[%s]' % ', '.join(_format(x) for x in node)
        return repr(node)
    if not isinstance(node, AST):
        raise TypeError('expected AST, got %r' % node.__class__.__name__)
    return _format(node)


def copy_location(new_node, old_node):
    """
    Copy source location (`lineno`, `col_offset`, `end_lineno`, and `end_col_offset`
    attributes) from *old_node* to *new_node* if possible, and return *new_node*.
    """
    for attr in 'lineno', 'col_offset', 'end_lineno', 'end_col_offset':
        if attr in old_node._attributes and attr in new_node._attributes:
            value = getattr(old_node, attr, None)
            # end_lineno and end_col_offset are optional attributes, and they
            # should be copied whether the value is None or not.
            if value is not None or (
                hasattr(old_node, attr) and attr.startswith("end_")
            ):
                setattr(new_node, attr, value)
    return new_node


def fix_missing_locations(node):
    """
    When you compile a node tree with compile(), the compiler expects lineno and
    col_offset attributes for every node that supports them.  This is rather
    tedious to fill in for generated nodes, so this helper adds these attributes
    recursively where not already set, by setting them to the values of the
    parent node.  It works recursively starting at *node*.
    """
    def _fix(node, lineno, col_offset, end_lineno, end_col_offset):
        if 'lineno' in node._attributes:
            if not hasattr(node, 'lineno'):
                node.lineno = lineno
            else:
                lineno = node.lineno
        if 'end_lineno' in node._attributes:
            if not hasattr(node, 'end_lineno'):
                node.end_lineno = end_lineno
            else:
                end_lineno = node.end_lineno
        if 'col_offset' in node._attributes:
            if not hasattr(node, 'col_offset'):
                node.col_offset = col_offset
            else:
                col_offset = node.col_offset
        if 'end_col_offset' in node._attributes:
            if not hasattr(node, 'end_col_offset'):
                node.end_col_offset = end_col_offset
            else:
                end_col_offset = node.end_col_offset
        for child in iter_child_nodes(node):
            _fix(child, lineno, col_offset, end_lineno, end_col_offset)
    _fix(node, 1, 0, 1, 0)
    return node


def increment_lineno(node, n=1):
    """
    Increment the line number and end line number of each node in the tree
    starting at *node* by *n*. This is useful to "move code" to a different
    location in a file.
    """
    for child in walk(node):
        if 'lineno' in child._attributes:
            child.lineno = getattr(child, 'lineno', 0) + n
        if (
            "end_lineno" in child._attributes
            and (end_lineno := getattr(child, "end_lineno", 0)) is not None
        ):
            child.end_lineno = end_lineno + n
    return node


def iter_fields(node):
    """
    Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields``
    that is present on *node*.
    """
    for field in node._fields:
        try:
            yield field, getattr(node, field)
        except AttributeError:
            pass


def iter_child_nodes(node):
    """
    Yield all direct child nodes of *node*, that is, all fields that are nodes
    and all items of fields that are lists of nodes.
    """
    for name, field in iter_fields(node):
        if isinstance(field, AST):
            yield field
        elif isinstance(field, list):
            for item in field:
                if isinstance(item, AST):
                    yield item


def get_docstring(node, clean=True):
    """
    Return the docstring for the given node or None if no docstring can
    be found.  If the node provided does not have docstrings a TypeError
    will be raised.

    If *clean* is `True`, all tabs are expanded to spaces and any whitespace
    that can be uniformly removed from the second line onwards is removed.
    """
    if not isinstance(node, (AsyncFunctionDef, FunctionDef, ClassDef, Module)):
        raise TypeError("%r can't have docstrings" % node.__class__.__name__)
    if not(node.body and isinstance(node.body[0], Expr)):
        return None
    node = node.body[0].value
    if isinstance(node, Str):
        text = node.s
    elif isinstance(node, Constant) and isinstance(node.value, str):
        text = node.value
    else:
        return None
    if clean:
        import inspect
        text = inspect.cleandoc(text)
    return text


def _splitlines_no_ff(source):
    """Split a string into lines ignoring form feed and other chars.

    This mimics how the Python parser splits source code.
    """
    idx = 0
    lines = []
    next_line = ''
    while idx < len(source):
        c = source[idx]
        next_line += c
        idx += 1
        # Keep \r\n together
        if c == '\r' and idx < len(source) and source[idx] == '\n':
            next_line += '\n'
            idx += 1
        if c in '\r\n':
            lines.append(next_line)
            next_line = ''

    if next_line:
        lines.append(next_line)
    return lines


def _pad_whitespace(source):
    r"""Replace all chars except '\f\t' in a line with spaces."""
    result = ''
    for c in source:
        if c in '\f\t':
            result += c
        else:
            result += ' '
    return result


def get_source_segment(source, node, *, padded=False):
    """Get source code segment of the *source* that generated *node*.

    If some location information (`lineno`, `end_lineno`, `col_offset`,
    or `end_col_offset`) is missing, return None.

    If *padded* is `True`, the first line of a multi-line statement will
    be padded with spaces to match its original position.
    """
    try:
        lineno = node.lineno - 1
        end_lineno = node.end_lineno - 1
        col_offset = node.col_offset
        end_col_offset = node.end_col_offset
    except AttributeError:
        return None

    lines = _splitlines_no_ff(source)
    if end_lineno == lineno:
        return lines[lineno].encode()[col_offset:end_col_offset].decode()

    if padded:
        padding = _pad_whitespace(lines[lineno].encode()[:col_offset].decode())
    else:
        padding = ''

    first = padding + lines[lineno].encode()[col_offset:].decode()
    last = lines[end_lineno].encode()[:end_col_offset].decode()
    lines = lines[lineno+1:end_lineno]

    lines.insert(0, first)
    lines.append(last)
    return ''.join(lines)


def walk(node):
    """
    Recursively yield all descendant nodes in the tree starting at *node*
    (including *node* itself), in no specified order.  This is useful if you
    only want to modify nodes in place and don't care about the context.
    """
    from collections import deque
    todo = deque([node])
    while todo:
        node = todo.popleft()
        todo.extend(iter_child_nodes(node))
        yield node


class NodeVisitor(object):
    """
    A node visitor base class that walks the abstract syntax tree and calls a
    visitor function for every node found.  This function may return a value
    which is forwarded by the `visit` method.

    This class is meant to be subclassed, with the subclass adding visitor
    methods.

    Per default the visitor functions for the nodes are ``'visit_'`` +
    class name of the node.  So a `TryFinally` node visit function would
    be `visit_TryFinally`.  This behavior can be changed by overriding
    the `visit` method.  If no visitor function exists for a node
    (return value `None`) the `generic_visit` visitor is used instead.

    Don't use the `NodeVisitor` if you want to apply changes to nodes during
    traversing.  For this a special visitor exists (`NodeTransformer`) that
    allows modifications.
    """

    def visit(self, node):
        """Visit a node."""
        method = 'visit_' + node.__class__.__name__
        visitor = getattr(self, method, self.generic_visit)
        return visitor(node)

    def generic_visit(self, node):
        """Called if no explicit visitor function exists for a node."""
        for field, value in iter_fields(node):
            if isinstance(value, list):
                for item in value:
                    if isinstance(item, AST):
                        self.visit(item)
            elif isinstance(value, AST):
                self.visit(value)

    def visit_Constant(self, node):
        value = node.value
        type_name = _const_node_type_names.get(type(value))
        if type_name is None:
            for cls, name in _const_node_type_names.items():
                if isinstance(value, cls):
                    type_name = name
                    break
        if type_name is not None:
            method = 'visit_' + type_name
            try:
                visitor = getattr(self, method)
            except AttributeError:
                pass
            else:
                import warnings
                warnings.warn(f"{method} is deprecated; add visit_Constant",
                              PendingDeprecationWarning, 2)
                return visitor(node)
        return self.generic_visit(node)


class NodeTransformer(NodeVisitor):
    """
    A :class:`NodeVisitor` subclass that walks the abstract syntax tree and
    allows modification of nodes.

    The `NodeTransformer` will walk the AST and use the return value of the
    visitor methods to replace or remove the old node.  If the return value of
    the visitor method is ``None``, the node will be removed from its location,
    otherwise it is replaced with the return value.  The return value may be the
    original node in which case no replacement takes place.

    Here is an example transformer that rewrites all occurrences of name lookups
    (``foo``) to ``data['foo']``::

       class RewriteName(NodeTransformer):

           def visit_Name(self, node):
               return Subscript(
                   value=Name(id='data', ctx=Load()),
                   slice=Index(value=Str(s=node.id)),
                   ctx=node.ctx
               )

    Keep in mind that if the node you're operating on has child nodes you must
    either transform the child nodes yourself or call the :meth:`generic_visit`
    method for the node first.

    For nodes that were part of a collection of statements (that applies to all
    statement nodes), the visitor may also return a list of nodes rather than
    just a single node.

    Usually you use the transformer like this::

       node = YourTransformer().visit(node)
    """

    def generic_visit(self, node):
        for field, old_value in iter_fields(node):
            if isinstance(old_value, list):
                new_values = []
                for value in old_value:
                    if isinstance(value, AST):
                        value = self.visit(value)
                        if value is None:
                            continue
                        elif not isinstance(value, AST):
                            new_values.extend(value)
                            continue
                    new_values.append(value)
                old_value[:] = new_values
            elif isinstance(old_value, AST):
                new_node = self.visit(old_value)
                if new_node is None:
                    delattr(node, field)
                else:
                    setattr(node, field, new_node)
        return node


# The following code is for backward compatibility.
# It will be removed in future.

def _getter(self):
    return self.value

def _setter(self, value):
    self.value = value

Constant.n = property(_getter, _setter)
Constant.s = property(_getter, _setter)

class _ABC(type):

    def __instancecheck__(cls, inst):
        if not isinstance(inst, Constant):
            return False
        if cls in _const_types:
            try:
                value = inst.value
            except AttributeError:
                return False
            else:
                return (
                    isinstance(value, _const_types[cls]) and
                    not isinstance(value, _const_types_not.get(cls, ()))
                )
        return type.__instancecheck__(cls, inst)

def _new(cls, *args, **kwargs):
    for key in kwargs:
        if key not in cls._fields:
            # arbitrary keyword arguments are accepted
            continue
        pos = cls._fields.index(key)
        if pos < len(args):
            raise TypeError(f"{cls.__name__} got multiple values for argument {key!r}")
    if cls in _const_types:
        return Constant(*args, **kwargs)
    return Constant.__new__(cls, *args, **kwargs)

class Num(Constant, metaclass=_ABC):
    _fields = ('n',)
    __new__ = _new

class Str(Constant, metaclass=_ABC):
    _fields = ('s',)
    __new__ = _new

class Bytes(Constant, metaclass=_ABC):
    _fields = ('s',)
    __new__ = _new

class NameConstant(Constant, metaclass=_ABC):
    __new__ = _new

class Ellipsis(Constant, metaclass=_ABC):
    _fields = ()

    def __new__(cls, *args, **kwargs):
        if cls is Ellipsis:
            return Constant(..., *args, **kwargs)
        return Constant.__new__(cls, *args, **kwargs)

_const_types = {
    Num: (int, float, complex),
    Str: (str,),
    Bytes: (bytes,),
    NameConstant: (type(None), bool),
    Ellipsis: (type(...),),
}
_const_types_not = {
    Num: (bool,),
}
_const_node_type_names = {
    bool: 'NameConstant',  # should be before int
    type(None): 'NameConstant',
    int: 'Num',
    float: 'Num',
    complex: 'Num',
    str: 'Str',
    bytes: 'Bytes',
    type(...): 'Ellipsis',
}
copy.py000064400000020725151153537630006107 0ustar00"""Generic (shallow and deep) copying operations.

Interface summary:

        import copy

        x = copy.copy(y)        # make a shallow copy of y
        x = copy.deepcopy(y)    # make a deep copy of y

For module specific errors, copy.Error is raised.

The difference between shallow and deep copying is only relevant for
compound objects (objects that contain other objects, like lists or
class instances).

- A shallow copy constructs a new compound object and then (to the
  extent possible) inserts *the same objects* into it that the
  original contains.

- A deep copy constructs a new compound object and then, recursively,
  inserts *copies* into it of the objects found in the original.

Two problems often exist with deep copy operations that don't exist
with shallow copy operations:

 a) recursive objects (compound objects that, directly or indirectly,
    contain a reference to themselves) may cause a recursive loop

 b) because deep copy copies *everything* it may copy too much, e.g.
    administrative data structures that should be shared even between
    copies

Python's deep copy operation avoids these problems by:

 a) keeping a table of objects already copied during the current
    copying pass

 b) letting user-defined classes override the copying operation or the
    set of components copied

This version does not copy types like module, class, function, method,
nor stack trace, stack frame, nor file, socket, window, nor array, nor
any similar types.

Classes can use the same interfaces to control copying that they use
to control pickling: they can define methods called __getinitargs__(),
__getstate__() and __setstate__().  See the documentation for module
"pickle" for information on these methods.
"""

import types
import weakref
from copyreg import dispatch_table

class Error(Exception):
    pass
error = Error   # backward compatibility

try:
    from org.python.core import PyStringMap
except ImportError:
    PyStringMap = None

__all__ = ["Error", "copy", "deepcopy"]

def copy(x):
    """Shallow copy operation on arbitrary Python objects.

    See the module's __doc__ string for more info.
    """

    cls = type(x)

    copier = _copy_dispatch.get(cls)
    if copier:
        return copier(x)

    if issubclass(cls, type):
        # treat it as a regular class:
        return _copy_immutable(x)

    copier = getattr(cls, "__copy__", None)
    if copier is not None:
        return copier(x)

    reductor = dispatch_table.get(cls)
    if reductor is not None:
        rv = reductor(x)
    else:
        reductor = getattr(x, "__reduce_ex__", None)
        if reductor is not None:
            rv = reductor(4)
        else:
            reductor = getattr(x, "__reduce__", None)
            if reductor:
                rv = reductor()
            else:
                raise Error("un(shallow)copyable object of type %s" % cls)

    if isinstance(rv, str):
        return x
    return _reconstruct(x, None, *rv)


_copy_dispatch = d = {}

def _copy_immutable(x):
    return x
for t in (type(None), int, float, bool, complex, str, tuple,
          bytes, frozenset, type, range, slice, property,
          types.BuiltinFunctionType, type(Ellipsis), type(NotImplemented),
          types.FunctionType, weakref.ref):
    d[t] = _copy_immutable
t = getattr(types, "CodeType", None)
if t is not None:
    d[t] = _copy_immutable

d[list] = list.copy
d[dict] = dict.copy
d[set] = set.copy
d[bytearray] = bytearray.copy

if PyStringMap is not None:
    d[PyStringMap] = PyStringMap.copy

del d, t

def deepcopy(x, memo=None, _nil=[]):
    """Deep copy operation on arbitrary Python objects.

    See the module's __doc__ string for more info.
    """

    if memo is None:
        memo = {}

    d = id(x)
    y = memo.get(d, _nil)
    if y is not _nil:
        return y

    cls = type(x)

    copier = _deepcopy_dispatch.get(cls)
    if copier is not None:
        y = copier(x, memo)
    else:
        if issubclass(cls, type):
            y = _deepcopy_atomic(x, memo)
        else:
            copier = getattr(x, "__deepcopy__", None)
            if copier is not None:
                y = copier(memo)
            else:
                reductor = dispatch_table.get(cls)
                if reductor:
                    rv = reductor(x)
                else:
                    reductor = getattr(x, "__reduce_ex__", None)
                    if reductor is not None:
                        rv = reductor(4)
                    else:
                        reductor = getattr(x, "__reduce__", None)
                        if reductor:
                            rv = reductor()
                        else:
                            raise Error(
                                "un(deep)copyable object of type %s" % cls)
                if isinstance(rv, str):
                    y = x
                else:
                    y = _reconstruct(x, memo, *rv)

    # If is its own copy, don't memoize.
    if y is not x:
        memo[d] = y
        _keep_alive(x, memo) # Make sure x lives at least as long as d
    return y

_deepcopy_dispatch = d = {}

def _deepcopy_atomic(x, memo):
    return x
d[type(None)] = _deepcopy_atomic
d[type(Ellipsis)] = _deepcopy_atomic
d[type(NotImplemented)] = _deepcopy_atomic
d[int] = _deepcopy_atomic
d[float] = _deepcopy_atomic
d[bool] = _deepcopy_atomic
d[complex] = _deepcopy_atomic
d[bytes] = _deepcopy_atomic
d[str] = _deepcopy_atomic
d[types.CodeType] = _deepcopy_atomic
d[type] = _deepcopy_atomic
d[types.BuiltinFunctionType] = _deepcopy_atomic
d[types.FunctionType] = _deepcopy_atomic
d[weakref.ref] = _deepcopy_atomic
d[property] = _deepcopy_atomic

def _deepcopy_list(x, memo, deepcopy=deepcopy):
    y = []
    memo[id(x)] = y
    append = y.append
    for a in x:
        append(deepcopy(a, memo))
    return y
d[list] = _deepcopy_list

def _deepcopy_tuple(x, memo, deepcopy=deepcopy):
    y = [deepcopy(a, memo) for a in x]
    # We're not going to put the tuple in the memo, but it's still important we
    # check for it, in case the tuple contains recursive mutable structures.
    try:
        return memo[id(x)]
    except KeyError:
        pass
    for k, j in zip(x, y):
        if k is not j:
            y = tuple(y)
            break
    else:
        y = x
    return y
d[tuple] = _deepcopy_tuple

def _deepcopy_dict(x, memo, deepcopy=deepcopy):
    y = {}
    memo[id(x)] = y
    for key, value in x.items():
        y[deepcopy(key, memo)] = deepcopy(value, memo)
    return y
d[dict] = _deepcopy_dict
if PyStringMap is not None:
    d[PyStringMap] = _deepcopy_dict

def _deepcopy_method(x, memo): # Copy instance methods
    return type(x)(x.__func__, deepcopy(x.__self__, memo))
d[types.MethodType] = _deepcopy_method

del d

def _keep_alive(x, memo):
    """Keeps a reference to the object x in the memo.

    Because we remember objects by their id, we have
    to assure that possibly temporary objects are kept
    alive by referencing them.
    We store a reference at the id of the memo, which should
    normally not be used unless someone tries to deepcopy
    the memo itself...
    """
    try:
        memo[id(memo)].append(x)
    except KeyError:
        # aha, this is the first one :-)
        memo[id(memo)]=[x]

def _reconstruct(x, memo, func, args,
                 state=None, listiter=None, dictiter=None,
                 deepcopy=deepcopy):
    deep = memo is not None
    if deep and args:
        args = (deepcopy(arg, memo) for arg in args)
    y = func(*args)
    if deep:
        memo[id(x)] = y

    if state is not None:
        if deep:
            state = deepcopy(state, memo)
        if hasattr(y, '__setstate__'):
            y.__setstate__(state)
        else:
            if isinstance(state, tuple) and len(state) == 2:
                state, slotstate = state
            else:
                slotstate = None
            if state is not None:
                y.__dict__.update(state)
            if slotstate is not None:
                for key, value in slotstate.items():
                    setattr(y, key, value)

    if listiter is not None:
        if deep:
            for item in listiter:
                item = deepcopy(item, memo)
                y.append(item)
        else:
            for item in listiter:
                y.append(item)
    if dictiter is not None:
        if deep:
            for key, value in dictiter:
                key = deepcopy(key, memo)
                value = deepcopy(value, memo)
                y[key] = value
        else:
            for key, value in dictiter:
                y[key] = value
    return y

del types, weakref, PyStringMap
mimetypes.py000064400000052240151153537630007146 0ustar00"""Guess the MIME type of a file.

This module defines two useful functions:

guess_type(url, strict=True) -- guess the MIME type and encoding of a URL.

guess_extension(type, strict=True) -- guess the extension for a given MIME type.

It also contains the following, for tuning the behavior:

Data:

knownfiles -- list of files to parse
inited -- flag set when init() has been called
suffix_map -- dictionary mapping suffixes to suffixes
encodings_map -- dictionary mapping suffixes to encodings
types_map -- dictionary mapping suffixes to types

Functions:

init([files]) -- parse a list of files, default knownfiles (on Windows, the
  default values are taken from the registry)
read_mime_types(file) -- parse one file, return a dictionary or None
"""

import os
import sys
import posixpath
import urllib.parse
try:
    import winreg as _winreg
except ImportError:
    _winreg = None

__all__ = [
    "knownfiles", "inited", "MimeTypes",
    "guess_type", "guess_all_extensions", "guess_extension",
    "add_type", "init", "read_mime_types",
    "suffix_map", "encodings_map", "types_map", "common_types"
]

knownfiles = [
    "/etc/mime.types",
    "/etc/httpd/mime.types",                    # Mac OS X
    "/etc/httpd/conf/mime.types",               # Apache
    "/etc/apache/mime.types",                   # Apache 1
    "/etc/apache2/mime.types",                  # Apache 2
    "/usr/local/etc/httpd/conf/mime.types",
    "/usr/local/lib/netscape/mime.types",
    "/usr/local/etc/httpd/conf/mime.types",     # Apache 1.2
    "/usr/local/etc/mime.types",                # Apache 1.3
    ]

inited = False
_db = None


class MimeTypes:
    """MIME-types datastore.

    This datastore can handle information from mime.types-style files
    and supports basic determination of MIME type from a filename or
    URL, and can guess a reasonable extension given a MIME type.
    """

    def __init__(self, filenames=(), strict=True):
        if not inited:
            init()
        self.encodings_map = _encodings_map_default.copy()
        self.suffix_map = _suffix_map_default.copy()
        self.types_map = ({}, {}) # dict for (non-strict, strict)
        self.types_map_inv = ({}, {})
        for (ext, type) in _types_map_default.items():
            self.add_type(type, ext, True)
        for (ext, type) in _common_types_default.items():
            self.add_type(type, ext, False)
        for name in filenames:
            self.read(name, strict)

    def add_type(self, type, ext, strict=True):
        """Add a mapping between a type and an extension.

        When the extension is already known, the new
        type will replace the old one. When the type
        is already known the extension will be added
        to the list of known extensions.

        If strict is true, information will be added to
        list of standard types, else to the list of non-standard
        types.
        """
        self.types_map[strict][ext] = type
        exts = self.types_map_inv[strict].setdefault(type, [])
        if ext not in exts:
            exts.append(ext)

    def guess_type(self, url, strict=True):
        """Guess the type of a file which is either a URL or a path-like object.

        Return value is a tuple (type, encoding) where type is None if
        the type can't be guessed (no or unknown suffix) or a string
        of the form type/subtype, usable for a MIME Content-type
        header; and encoding is None for no encoding or the name of
        the program used to encode (e.g. compress or gzip).  The
        mappings are table driven.  Encoding suffixes are case
        sensitive; type suffixes are first tried case sensitive, then
        case insensitive.

        The suffixes .tgz, .taz and .tz (case sensitive!) are all
        mapped to '.tar.gz'.  (This is table-driven too, using the
        dictionary suffix_map.)

        Optional `strict' argument when False adds a bunch of commonly found,
        but non-standard types.
        """
        url = os.fspath(url)
        scheme, url = urllib.parse._splittype(url)
        if scheme == 'data':
            # syntax of data URLs:
            # dataurl   := "data:" [ mediatype ] [ ";base64" ] "," data
            # mediatype := [ type "/" subtype ] *( ";" parameter )
            # data      := *urlchar
            # parameter := attribute "=" value
            # type/subtype defaults to "text/plain"
            comma = url.find(',')
            if comma < 0:
                # bad data URL
                return None, None
            semi = url.find(';', 0, comma)
            if semi >= 0:
                type = url[:semi]
            else:
                type = url[:comma]
            if '=' in type or '/' not in type:
                type = 'text/plain'
            return type, None           # never compressed, so encoding is None
        base, ext = posixpath.splitext(url)
        while ext in self.suffix_map:
            base, ext = posixpath.splitext(base + self.suffix_map[ext])
        if ext in self.encodings_map:
            encoding = self.encodings_map[ext]
            base, ext = posixpath.splitext(base)
        else:
            encoding = None
        types_map = self.types_map[True]
        if ext in types_map:
            return types_map[ext], encoding
        elif ext.lower() in types_map:
            return types_map[ext.lower()], encoding
        elif strict:
            return None, encoding
        types_map = self.types_map[False]
        if ext in types_map:
            return types_map[ext], encoding
        elif ext.lower() in types_map:
            return types_map[ext.lower()], encoding
        else:
            return None, encoding

    def guess_all_extensions(self, type, strict=True):
        """Guess the extensions for a file based on its MIME type.

        Return value is a list of strings giving the possible filename
        extensions, including the leading dot ('.').  The extension is not
        guaranteed to have been associated with any particular data stream,
        but would be mapped to the MIME type `type' by guess_type().

        Optional `strict' argument when false adds a bunch of commonly found,
        but non-standard types.
        """
        type = type.lower()
        extensions = self.types_map_inv[True].get(type, [])
        if not strict:
            for ext in self.types_map_inv[False].get(type, []):
                if ext not in extensions:
                    extensions.append(ext)
        return extensions

    def guess_extension(self, type, strict=True):
        """Guess the extension for a file based on its MIME type.

        Return value is a string giving a filename extension,
        including the leading dot ('.').  The extension is not
        guaranteed to have been associated with any particular data
        stream, but would be mapped to the MIME type `type' by
        guess_type().  If no extension can be guessed for `type', None
        is returned.

        Optional `strict' argument when false adds a bunch of commonly found,
        but non-standard types.
        """
        extensions = self.guess_all_extensions(type, strict)
        if not extensions:
            return None
        return extensions[0]

    def read(self, filename, strict=True):
        """
        Read a single mime.types-format file, specified by pathname.

        If strict is true, information will be added to
        list of standard types, else to the list of non-standard
        types.
        """
        with open(filename, encoding='utf-8') as fp:
            self.readfp(fp, strict)

    def readfp(self, fp, strict=True):
        """
        Read a single mime.types-format file.

        If strict is true, information will be added to
        list of standard types, else to the list of non-standard
        types.
        """
        while 1:
            line = fp.readline()
            if not line:
                break
            words = line.split()
            for i in range(len(words)):
                if words[i][0] == '#':
                    del words[i:]
                    break
            if not words:
                continue
            type, suffixes = words[0], words[1:]
            for suff in suffixes:
                self.add_type(type, '.' + suff, strict)

    def read_windows_registry(self, strict=True):
        """
        Load the MIME types database from Windows registry.

        If strict is true, information will be added to
        list of standard types, else to the list of non-standard
        types.
        """

        # Windows only
        if not _winreg:
            return

        def enum_types(mimedb):
            i = 0
            while True:
                try:
                    ctype = _winreg.EnumKey(mimedb, i)
                except OSError:
                    break
                else:
                    if '\0' not in ctype:
                        yield ctype
                i += 1

        with _winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT, '') as hkcr:
            for subkeyname in enum_types(hkcr):
                try:
                    with _winreg.OpenKey(hkcr, subkeyname) as subkey:
                        # Only check file extensions
                        if not subkeyname.startswith("."):
                            continue
                        # raises OSError if no 'Content Type' value
                        mimetype, datatype = _winreg.QueryValueEx(
                            subkey, 'Content Type')
                        if datatype != _winreg.REG_SZ:
                            continue
                        self.add_type(mimetype, subkeyname, strict)
                except OSError:
                    continue

def guess_type(url, strict=True):
    """Guess the type of a file based on its URL.

    Return value is a tuple (type, encoding) where type is None if the
    type can't be guessed (no or unknown suffix) or a string of the
    form type/subtype, usable for a MIME Content-type header; and
    encoding is None for no encoding or the name of the program used
    to encode (e.g. compress or gzip).  The mappings are table
    driven.  Encoding suffixes are case sensitive; type suffixes are
    first tried case sensitive, then case insensitive.

    The suffixes .tgz, .taz and .tz (case sensitive!) are all mapped
    to ".tar.gz".  (This is table-driven too, using the dictionary
    suffix_map).

    Optional `strict' argument when false adds a bunch of commonly found, but
    non-standard types.
    """
    if _db is None:
        init()
    return _db.guess_type(url, strict)


def guess_all_extensions(type, strict=True):
    """Guess the extensions for a file based on its MIME type.

    Return value is a list of strings giving the possible filename
    extensions, including the leading dot ('.').  The extension is not
    guaranteed to have been associated with any particular data
    stream, but would be mapped to the MIME type `type' by
    guess_type().  If no extension can be guessed for `type', None
    is returned.

    Optional `strict' argument when false adds a bunch of commonly found,
    but non-standard types.
    """
    if _db is None:
        init()
    return _db.guess_all_extensions(type, strict)

def guess_extension(type, strict=True):
    """Guess the extension for a file based on its MIME type.

    Return value is a string giving a filename extension, including the
    leading dot ('.').  The extension is not guaranteed to have been
    associated with any particular data stream, but would be mapped to the
    MIME type `type' by guess_type().  If no extension can be guessed for
    `type', None is returned.

    Optional `strict' argument when false adds a bunch of commonly found,
    but non-standard types.
    """
    if _db is None:
        init()
    return _db.guess_extension(type, strict)

def add_type(type, ext, strict=True):
    """Add a mapping between a type and an extension.

    When the extension is already known, the new
    type will replace the old one. When the type
    is already known the extension will be added
    to the list of known extensions.

    If strict is true, information will be added to
    list of standard types, else to the list of non-standard
    types.
    """
    if _db is None:
        init()
    return _db.add_type(type, ext, strict)


def init(files=None):
    global suffix_map, types_map, encodings_map, common_types
    global inited, _db
    inited = True    # so that MimeTypes.__init__() doesn't call us again

    if files is None or _db is None:
        db = MimeTypes()
        if _winreg:
            db.read_windows_registry()

        if files is None:
            files = knownfiles
        else:
            files = knownfiles + list(files)
    else:
        db = _db

    for file in files:
        if os.path.isfile(file):
            db.read(file)
    encodings_map = db.encodings_map
    suffix_map = db.suffix_map
    types_map = db.types_map[True]
    common_types = db.types_map[False]
    # Make the DB a global variable now that it is fully initialized
    _db = db


def read_mime_types(file):
    try:
        f = open(file, encoding='utf-8')
    except OSError:
        return None
    with f:
        db = MimeTypes()
        db.readfp(f, True)
        return db.types_map[True]


def _default_mime_types():
    global suffix_map, _suffix_map_default
    global encodings_map, _encodings_map_default
    global types_map, _types_map_default
    global common_types, _common_types_default

    suffix_map = _suffix_map_default = {
        '.svgz': '.svg.gz',
        '.tgz': '.tar.gz',
        '.taz': '.tar.gz',
        '.tz': '.tar.gz',
        '.tbz2': '.tar.bz2',
        '.txz': '.tar.xz',
        }

    encodings_map = _encodings_map_default = {
        '.gz': 'gzip',
        '.Z': 'compress',
        '.bz2': 'bzip2',
        '.xz': 'xz',
        }

    # Before adding new types, make sure they are either registered with IANA,
    # at http://www.iana.org/assignments/media-types
    # or extensions, i.e. using the x- prefix

    # If you add to these, please keep them sorted by mime type.
    # Make sure the entry with the preferred file extension for a particular mime type
    # appears before any others of the same mimetype.
    types_map = _types_map_default = {
        '.js'     : 'application/javascript',
        '.mjs'    : 'application/javascript',
        '.json'   : 'application/json',
        '.webmanifest': 'application/manifest+json',
        '.doc'    : 'application/msword',
        '.dot'    : 'application/msword',
        '.wiz'    : 'application/msword',
        '.bin'    : 'application/octet-stream',
        '.a'      : 'application/octet-stream',
        '.dll'    : 'application/octet-stream',
        '.exe'    : 'application/octet-stream',
        '.o'      : 'application/octet-stream',
        '.obj'    : 'application/octet-stream',
        '.so'     : 'application/octet-stream',
        '.oda'    : 'application/oda',
        '.pdf'    : 'application/pdf',
        '.p7c'    : 'application/pkcs7-mime',
        '.ps'     : 'application/postscript',
        '.ai'     : 'application/postscript',
        '.eps'    : 'application/postscript',
        '.m3u'    : 'application/vnd.apple.mpegurl',
        '.m3u8'   : 'application/vnd.apple.mpegurl',
        '.xls'    : 'application/vnd.ms-excel',
        '.xlb'    : 'application/vnd.ms-excel',
        '.ppt'    : 'application/vnd.ms-powerpoint',
        '.pot'    : 'application/vnd.ms-powerpoint',
        '.ppa'    : 'application/vnd.ms-powerpoint',
        '.pps'    : 'application/vnd.ms-powerpoint',
        '.pwz'    : 'application/vnd.ms-powerpoint',
        '.wasm'   : 'application/wasm',
        '.bcpio'  : 'application/x-bcpio',
        '.cpio'   : 'application/x-cpio',
        '.csh'    : 'application/x-csh',
        '.dvi'    : 'application/x-dvi',
        '.gtar'   : 'application/x-gtar',
        '.hdf'    : 'application/x-hdf',
        '.h5'     : 'application/x-hdf5',
        '.latex'  : 'application/x-latex',
        '.mif'    : 'application/x-mif',
        '.cdf'    : 'application/x-netcdf',
        '.nc'     : 'application/x-netcdf',
        '.p12'    : 'application/x-pkcs12',
        '.pfx'    : 'application/x-pkcs12',
        '.ram'    : 'application/x-pn-realaudio',
        '.pyc'    : 'application/x-python-code',
        '.pyo'    : 'application/x-python-code',
        '.sh'     : 'application/x-sh',
        '.shar'   : 'application/x-shar',
        '.swf'    : 'application/x-shockwave-flash',
        '.sv4cpio': 'application/x-sv4cpio',
        '.sv4crc' : 'application/x-sv4crc',
        '.tar'    : 'application/x-tar',
        '.tcl'    : 'application/x-tcl',
        '.tex'    : 'application/x-tex',
        '.texi'   : 'application/x-texinfo',
        '.texinfo': 'application/x-texinfo',
        '.roff'   : 'application/x-troff',
        '.t'      : 'application/x-troff',
        '.tr'     : 'application/x-troff',
        '.man'    : 'application/x-troff-man',
        '.me'     : 'application/x-troff-me',
        '.ms'     : 'application/x-troff-ms',
        '.ustar'  : 'application/x-ustar',
        '.src'    : 'application/x-wais-source',
        '.xsl'    : 'application/xml',
        '.rdf'    : 'application/xml',
        '.wsdl'   : 'application/xml',
        '.xpdl'   : 'application/xml',
        '.zip'    : 'application/zip',
        '.au'     : 'audio/basic',
        '.snd'    : 'audio/basic',
        '.mp3'    : 'audio/mpeg',
        '.mp2'    : 'audio/mpeg',
        '.aif'    : 'audio/x-aiff',
        '.aifc'   : 'audio/x-aiff',
        '.aiff'   : 'audio/x-aiff',
        '.ra'     : 'audio/x-pn-realaudio',
        '.wav'    : 'audio/x-wav',
        '.bmp'    : 'image/bmp',
        '.gif'    : 'image/gif',
        '.ief'    : 'image/ief',
        '.jpg'    : 'image/jpeg',
        '.jpe'    : 'image/jpeg',
        '.jpeg'   : 'image/jpeg',
        '.png'    : 'image/png',
        '.svg'    : 'image/svg+xml',
        '.tiff'   : 'image/tiff',
        '.tif'    : 'image/tiff',
        '.ico'    : 'image/vnd.microsoft.icon',
        '.ras'    : 'image/x-cmu-raster',
        '.bmp'    : 'image/x-ms-bmp',
        '.pnm'    : 'image/x-portable-anymap',
        '.pbm'    : 'image/x-portable-bitmap',
        '.pgm'    : 'image/x-portable-graymap',
        '.ppm'    : 'image/x-portable-pixmap',
        '.rgb'    : 'image/x-rgb',
        '.xbm'    : 'image/x-xbitmap',
        '.xpm'    : 'image/x-xpixmap',
        '.xwd'    : 'image/x-xwindowdump',
        '.eml'    : 'message/rfc822',
        '.mht'    : 'message/rfc822',
        '.mhtml'  : 'message/rfc822',
        '.nws'    : 'message/rfc822',
        '.css'    : 'text/css',
        '.csv'    : 'text/csv',
        '.html'   : 'text/html',
        '.htm'    : 'text/html',
        '.txt'    : 'text/plain',
        '.bat'    : 'text/plain',
        '.c'      : 'text/plain',
        '.h'      : 'text/plain',
        '.ksh'    : 'text/plain',
        '.pl'     : 'text/plain',
        '.rtx'    : 'text/richtext',
        '.tsv'    : 'text/tab-separated-values',
        '.py'     : 'text/x-python',
        '.etx'    : 'text/x-setext',
        '.sgm'    : 'text/x-sgml',
        '.sgml'   : 'text/x-sgml',
        '.vcf'    : 'text/x-vcard',
        '.xml'    : 'text/xml',
        '.mp4'    : 'video/mp4',
        '.mpeg'   : 'video/mpeg',
        '.m1v'    : 'video/mpeg',
        '.mpa'    : 'video/mpeg',
        '.mpe'    : 'video/mpeg',
        '.mpg'    : 'video/mpeg',
        '.mov'    : 'video/quicktime',
        '.qt'     : 'video/quicktime',
        '.webm'   : 'video/webm',
        '.avi'    : 'video/x-msvideo',
        '.movie'  : 'video/x-sgi-movie',
        }

    # These are non-standard types, commonly found in the wild.  They will
    # only match if strict=0 flag is given to the API methods.

    # Please sort these too
    common_types = _common_types_default = {
        '.rtf' : 'application/rtf',
        '.midi': 'audio/midi',
        '.mid' : 'audio/midi',
        '.jpg' : 'image/jpg',
        '.pict': 'image/pict',
        '.pct' : 'image/pict',
        '.pic' : 'image/pict',
        '.xul' : 'text/xul',
        }


_default_mime_types()


def _main():
    import getopt

    USAGE = """\
Usage: mimetypes.py [options] type

Options:
    --help / -h       -- print this message and exit
    --lenient / -l    -- additionally search of some common, but non-standard
                         types.
    --extension / -e  -- guess extension instead of type

More than one type argument may be given.
"""

    def usage(code, msg=''):
        print(USAGE)
        if msg: print(msg)
        sys.exit(code)

    try:
        opts, args = getopt.getopt(sys.argv[1:], 'hle',
                                   ['help', 'lenient', 'extension'])
    except getopt.error as msg:
        usage(1, msg)

    strict = 1
    extension = 0
    for opt, arg in opts:
        if opt in ('-h', '--help'):
            usage(0)
        elif opt in ('-l', '--lenient'):
            strict = 0
        elif opt in ('-e', '--extension'):
            extension = 1
    for gtype in args:
        if extension:
            guess = guess_extension(gtype, strict)
            if not guess: print("I don't know anything about type", gtype)
            else: print(guess)
        else:
            guess, encoding = guess_type(gtype, strict)
            if not guess: print("I don't know anything about type", gtype)
            else: print('type:', guess, 'encoding:', encoding)


if __name__ == '__main__':
    _main()
queue.py000064400000026134151153537630006261 0ustar00'''A multi-producer, multi-consumer queue.'''

import threading
from collections import deque
from heapq import heappush, heappop
from time import monotonic as time
try:
    from _queue import SimpleQueue
except ImportError:
    SimpleQueue = None

__all__ = ['Empty', 'Full', 'Queue', 'PriorityQueue', 'LifoQueue', 'SimpleQueue']


try:
    from _queue import Empty
except ImportError:
    class Empty(Exception):
        'Exception raised by Queue.get(block=0)/get_nowait().'
        pass

class Full(Exception):
    'Exception raised by Queue.put(block=0)/put_nowait().'
    pass


class Queue:
    '''Create a queue object with a given maximum size.

    If maxsize is <= 0, the queue size is infinite.
    '''

    def __init__(self, maxsize=0):
        self.maxsize = maxsize
        self._init(maxsize)

        # mutex must be held whenever the queue is mutating.  All methods
        # that acquire mutex must release it before returning.  mutex
        # is shared between the three conditions, so acquiring and
        # releasing the conditions also acquires and releases mutex.
        self.mutex = threading.Lock()

        # Notify not_empty whenever an item is added to the queue; a
        # thread waiting to get is notified then.
        self.not_empty = threading.Condition(self.mutex)

        # Notify not_full whenever an item is removed from the queue;
        # a thread waiting to put is notified then.
        self.not_full = threading.Condition(self.mutex)

        # Notify all_tasks_done whenever the number of unfinished tasks
        # drops to zero; thread waiting to join() is notified to resume
        self.all_tasks_done = threading.Condition(self.mutex)
        self.unfinished_tasks = 0

    def task_done(self):
        '''Indicate that a formerly enqueued task is complete.

        Used by Queue consumer threads.  For each get() used to fetch a task,
        a subsequent call to task_done() tells the queue that the processing
        on the task is complete.

        If a join() is currently blocking, it will resume when all items
        have been processed (meaning that a task_done() call was received
        for every item that had been put() into the queue).

        Raises a ValueError if called more times than there were items
        placed in the queue.
        '''
        with self.all_tasks_done:
            unfinished = self.unfinished_tasks - 1
            if unfinished <= 0:
                if unfinished < 0:
                    raise ValueError('task_done() called too many times')
                self.all_tasks_done.notify_all()
            self.unfinished_tasks = unfinished

    def join(self):
        '''Blocks until all items in the Queue have been gotten and processed.

        The count of unfinished tasks goes up whenever an item is added to the
        queue. The count goes down whenever a consumer thread calls task_done()
        to indicate the item was retrieved and all work on it is complete.

        When the count of unfinished tasks drops to zero, join() unblocks.
        '''
        with self.all_tasks_done:
            while self.unfinished_tasks:
                self.all_tasks_done.wait()

    def qsize(self):
        '''Return the approximate size of the queue (not reliable!).'''
        with self.mutex:
            return self._qsize()

    def empty(self):
        '''Return True if the queue is empty, False otherwise (not reliable!).

        This method is likely to be removed at some point.  Use qsize() == 0
        as a direct substitute, but be aware that either approach risks a race
        condition where a queue can grow before the result of empty() or
        qsize() can be used.

        To create code that needs to wait for all queued tasks to be
        completed, the preferred technique is to use the join() method.
        '''
        with self.mutex:
            return not self._qsize()

    def full(self):
        '''Return True if the queue is full, False otherwise (not reliable!).

        This method is likely to be removed at some point.  Use qsize() >= n
        as a direct substitute, but be aware that either approach risks a race
        condition where a queue can shrink before the result of full() or
        qsize() can be used.
        '''
        with self.mutex:
            return 0 < self.maxsize <= self._qsize()

    def put(self, item, block=True, timeout=None):
        '''Put an item into the queue.

        If optional args 'block' is true and 'timeout' is None (the default),
        block if necessary until a free slot is available. If 'timeout' is
        a non-negative number, it blocks at most 'timeout' seconds and raises
        the Full exception if no free slot was available within that time.
        Otherwise ('block' is false), put an item on the queue if a free slot
        is immediately available, else raise the Full exception ('timeout'
        is ignored in that case).
        '''
        with self.not_full:
            if self.maxsize > 0:
                if not block:
                    if self._qsize() >= self.maxsize:
                        raise Full
                elif timeout is None:
                    while self._qsize() >= self.maxsize:
                        self.not_full.wait()
                elif timeout < 0:
                    raise ValueError("'timeout' must be a non-negative number")
                else:
                    endtime = time() + timeout
                    while self._qsize() >= self.maxsize:
                        remaining = endtime - time()
                        if remaining <= 0.0:
                            raise Full
                        self.not_full.wait(remaining)
            self._put(item)
            self.unfinished_tasks += 1
            self.not_empty.notify()

    def get(self, block=True, timeout=None):
        '''Remove and return an item from the queue.

        If optional args 'block' is true and 'timeout' is None (the default),
        block if necessary until an item is available. If 'timeout' is
        a non-negative number, it blocks at most 'timeout' seconds and raises
        the Empty exception if no item was available within that time.
        Otherwise ('block' is false), return an item if one is immediately
        available, else raise the Empty exception ('timeout' is ignored
        in that case).
        '''
        with self.not_empty:
            if not block:
                if not self._qsize():
                    raise Empty
            elif timeout is None:
                while not self._qsize():
                    self.not_empty.wait()
            elif timeout < 0:
                raise ValueError("'timeout' must be a non-negative number")
            else:
                endtime = time() + timeout
                while not self._qsize():
                    remaining = endtime - time()
                    if remaining <= 0.0:
                        raise Empty
                    self.not_empty.wait(remaining)
            item = self._get()
            self.not_full.notify()
            return item

    def put_nowait(self, item):
        '''Put an item into the queue without blocking.

        Only enqueue the item if a free slot is immediately available.
        Otherwise raise the Full exception.
        '''
        return self.put(item, block=False)

    def get_nowait(self):
        '''Remove and return an item from the queue without blocking.

        Only get an item if one is immediately available. Otherwise
        raise the Empty exception.
        '''
        return self.get(block=False)

    # Override these methods to implement other queue organizations
    # (e.g. stack or priority queue).
    # These will only be called with appropriate locks held

    # Initialize the queue representation
    def _init(self, maxsize):
        self.queue = deque()

    def _qsize(self):
        return len(self.queue)

    # Put a new item in the queue
    def _put(self, item):
        self.queue.append(item)

    # Get an item from the queue
    def _get(self):
        return self.queue.popleft()


class PriorityQueue(Queue):
    '''Variant of Queue that retrieves open entries in priority order (lowest first).

    Entries are typically tuples of the form:  (priority number, data).
    '''

    def _init(self, maxsize):
        self.queue = []

    def _qsize(self):
        return len(self.queue)

    def _put(self, item):
        heappush(self.queue, item)

    def _get(self):
        return heappop(self.queue)


class LifoQueue(Queue):
    '''Variant of Queue that retrieves most recently added entries first.'''

    def _init(self, maxsize):
        self.queue = []

    def _qsize(self):
        return len(self.queue)

    def _put(self, item):
        self.queue.append(item)

    def _get(self):
        return self.queue.pop()


class _PySimpleQueue:
    '''Simple, unbounded FIFO queue.

    This pure Python implementation is not reentrant.
    '''
    # Note: while this pure Python version provides fairness
    # (by using a threading.Semaphore which is itself fair, being based
    #  on threading.Condition), fairness is not part of the API contract.
    # This allows the C version to use a different implementation.

    def __init__(self):
        self._queue = deque()
        self._count = threading.Semaphore(0)

    def put(self, item, block=True, timeout=None):
        '''Put the item on the queue.

        The optional 'block' and 'timeout' arguments are ignored, as this method
        never blocks.  They are provided for compatibility with the Queue class.
        '''
        self._queue.append(item)
        self._count.release()

    def get(self, block=True, timeout=None):
        '''Remove and return an item from the queue.

        If optional args 'block' is true and 'timeout' is None (the default),
        block if necessary until an item is available. If 'timeout' is
        a non-negative number, it blocks at most 'timeout' seconds and raises
        the Empty exception if no item was available within that time.
        Otherwise ('block' is false), return an item if one is immediately
        available, else raise the Empty exception ('timeout' is ignored
        in that case).
        '''
        if timeout is not None and timeout < 0:
            raise ValueError("'timeout' must be a non-negative number")
        if not self._count.acquire(block, timeout):
            raise Empty
        return self._queue.popleft()

    def put_nowait(self, item):
        '''Put an item into the queue without blocking.

        This is exactly equivalent to `put(item)` and is only provided
        for compatibility with the Queue class.
        '''
        return self.put(item, block=False)

    def get_nowait(self):
        '''Remove and return an item from the queue without blocking.

        Only get an item if one is immediately available. Otherwise
        raise the Empty exception.
        '''
        return self.get(block=False)

    def empty(self):
        '''Return True if the queue is empty, False otherwise (not reliable!).'''
        return len(self._queue) == 0

    def qsize(self):
        '''Return the approximate size of the queue (not reliable!).'''
        return len(self._queue)


if SimpleQueue is None:
    SimpleQueue = _PySimpleQueue
stringprep.py000064400000031165151153537630007332 0ustar00# This file is generated by mkstringprep.py. DO NOT EDIT.
"""Library that exposes various tables found in the StringPrep RFC 3454.

There are two kinds of tables: sets, for which a member test is provided,
and mappings, for which a mapping function is provided.
"""

from unicodedata import ucd_3_2_0 as unicodedata

assert unicodedata.unidata_version == '3.2.0'

def in_table_a1(code):
    if unicodedata.category(code) != 'Cn': return False
    c = ord(code)
    if 0xFDD0 <= c < 0xFDF0: return False
    return (c & 0xFFFF) not in (0xFFFE, 0xFFFF)


b1_set = set([173, 847, 6150, 6155, 6156, 6157, 8203, 8204, 8205, 8288, 65279] + list(range(65024,65040)))
def in_table_b1(code):
    return ord(code) in b1_set


b3_exceptions = {
0xb5:'\u03bc', 0xdf:'ss', 0x130:'i\u0307', 0x149:'\u02bcn',
0x17f:'s', 0x1f0:'j\u030c', 0x345:'\u03b9', 0x37a:' \u03b9',
0x390:'\u03b9\u0308\u0301', 0x3b0:'\u03c5\u0308\u0301', 0x3c2:'\u03c3', 0x3d0:'\u03b2',
0x3d1:'\u03b8', 0x3d2:'\u03c5', 0x3d3:'\u03cd', 0x3d4:'\u03cb',
0x3d5:'\u03c6', 0x3d6:'\u03c0', 0x3f0:'\u03ba', 0x3f1:'\u03c1',
0x3f2:'\u03c3', 0x3f5:'\u03b5', 0x587:'\u0565\u0582', 0x1e96:'h\u0331',
0x1e97:'t\u0308', 0x1e98:'w\u030a', 0x1e99:'y\u030a', 0x1e9a:'a\u02be',
0x1e9b:'\u1e61', 0x1f50:'\u03c5\u0313', 0x1f52:'\u03c5\u0313\u0300', 0x1f54:'\u03c5\u0313\u0301',
0x1f56:'\u03c5\u0313\u0342', 0x1f80:'\u1f00\u03b9', 0x1f81:'\u1f01\u03b9', 0x1f82:'\u1f02\u03b9',
0x1f83:'\u1f03\u03b9', 0x1f84:'\u1f04\u03b9', 0x1f85:'\u1f05\u03b9', 0x1f86:'\u1f06\u03b9',
0x1f87:'\u1f07\u03b9', 0x1f88:'\u1f00\u03b9', 0x1f89:'\u1f01\u03b9', 0x1f8a:'\u1f02\u03b9',
0x1f8b:'\u1f03\u03b9', 0x1f8c:'\u1f04\u03b9', 0x1f8d:'\u1f05\u03b9', 0x1f8e:'\u1f06\u03b9',
0x1f8f:'\u1f07\u03b9', 0x1f90:'\u1f20\u03b9', 0x1f91:'\u1f21\u03b9', 0x1f92:'\u1f22\u03b9',
0x1f93:'\u1f23\u03b9', 0x1f94:'\u1f24\u03b9', 0x1f95:'\u1f25\u03b9', 0x1f96:'\u1f26\u03b9',
0x1f97:'\u1f27\u03b9', 0x1f98:'\u1f20\u03b9', 0x1f99:'\u1f21\u03b9', 0x1f9a:'\u1f22\u03b9',
0x1f9b:'\u1f23\u03b9', 0x1f9c:'\u1f24\u03b9', 0x1f9d:'\u1f25\u03b9', 0x1f9e:'\u1f26\u03b9',
0x1f9f:'\u1f27\u03b9', 0x1fa0:'\u1f60\u03b9', 0x1fa1:'\u1f61\u03b9', 0x1fa2:'\u1f62\u03b9',
0x1fa3:'\u1f63\u03b9', 0x1fa4:'\u1f64\u03b9', 0x1fa5:'\u1f65\u03b9', 0x1fa6:'\u1f66\u03b9',
0x1fa7:'\u1f67\u03b9', 0x1fa8:'\u1f60\u03b9', 0x1fa9:'\u1f61\u03b9', 0x1faa:'\u1f62\u03b9',
0x1fab:'\u1f63\u03b9', 0x1fac:'\u1f64\u03b9', 0x1fad:'\u1f65\u03b9', 0x1fae:'\u1f66\u03b9',
0x1faf:'\u1f67\u03b9', 0x1fb2:'\u1f70\u03b9', 0x1fb3:'\u03b1\u03b9', 0x1fb4:'\u03ac\u03b9',
0x1fb6:'\u03b1\u0342', 0x1fb7:'\u03b1\u0342\u03b9', 0x1fbc:'\u03b1\u03b9', 0x1fbe:'\u03b9',
0x1fc2:'\u1f74\u03b9', 0x1fc3:'\u03b7\u03b9', 0x1fc4:'\u03ae\u03b9', 0x1fc6:'\u03b7\u0342',
0x1fc7:'\u03b7\u0342\u03b9', 0x1fcc:'\u03b7\u03b9', 0x1fd2:'\u03b9\u0308\u0300', 0x1fd3:'\u03b9\u0308\u0301',
0x1fd6:'\u03b9\u0342', 0x1fd7:'\u03b9\u0308\u0342', 0x1fe2:'\u03c5\u0308\u0300', 0x1fe3:'\u03c5\u0308\u0301',
0x1fe4:'\u03c1\u0313', 0x1fe6:'\u03c5\u0342', 0x1fe7:'\u03c5\u0308\u0342', 0x1ff2:'\u1f7c\u03b9',
0x1ff3:'\u03c9\u03b9', 0x1ff4:'\u03ce\u03b9', 0x1ff6:'\u03c9\u0342', 0x1ff7:'\u03c9\u0342\u03b9',
0x1ffc:'\u03c9\u03b9', 0x20a8:'rs', 0x2102:'c', 0x2103:'\xb0c',
0x2107:'\u025b', 0x2109:'\xb0f', 0x210b:'h', 0x210c:'h',
0x210d:'h', 0x2110:'i', 0x2111:'i', 0x2112:'l',
0x2115:'n', 0x2116:'no', 0x2119:'p', 0x211a:'q',
0x211b:'r', 0x211c:'r', 0x211d:'r', 0x2120:'sm',
0x2121:'tel', 0x2122:'tm', 0x2124:'z', 0x2128:'z',
0x212c:'b', 0x212d:'c', 0x2130:'e', 0x2131:'f',
0x2133:'m', 0x213e:'\u03b3', 0x213f:'\u03c0', 0x2145:'d',
0x3371:'hpa', 0x3373:'au', 0x3375:'ov', 0x3380:'pa',
0x3381:'na', 0x3382:'\u03bca', 0x3383:'ma', 0x3384:'ka',
0x3385:'kb', 0x3386:'mb', 0x3387:'gb', 0x338a:'pf',
0x338b:'nf', 0x338c:'\u03bcf', 0x3390:'hz', 0x3391:'khz',
0x3392:'mhz', 0x3393:'ghz', 0x3394:'thz', 0x33a9:'pa',
0x33aa:'kpa', 0x33ab:'mpa', 0x33ac:'gpa', 0x33b4:'pv',
0x33b5:'nv', 0x33b6:'\u03bcv', 0x33b7:'mv', 0x33b8:'kv',
0x33b9:'mv', 0x33ba:'pw', 0x33bb:'nw', 0x33bc:'\u03bcw',
0x33bd:'mw', 0x33be:'kw', 0x33bf:'mw', 0x33c0:'k\u03c9',
0x33c1:'m\u03c9', 0x33c3:'bq', 0x33c6:'c\u2215kg', 0x33c7:'co.',
0x33c8:'db', 0x33c9:'gy', 0x33cb:'hp', 0x33cd:'kk',
0x33ce:'km', 0x33d7:'ph', 0x33d9:'ppm', 0x33da:'pr',
0x33dc:'sv', 0x33dd:'wb', 0xfb00:'ff', 0xfb01:'fi',
0xfb02:'fl', 0xfb03:'ffi', 0xfb04:'ffl', 0xfb05:'st',
0xfb06:'st', 0xfb13:'\u0574\u0576', 0xfb14:'\u0574\u0565', 0xfb15:'\u0574\u056b',
0xfb16:'\u057e\u0576', 0xfb17:'\u0574\u056d', 0x1d400:'a', 0x1d401:'b',
0x1d402:'c', 0x1d403:'d', 0x1d404:'e', 0x1d405:'f',
0x1d406:'g', 0x1d407:'h', 0x1d408:'i', 0x1d409:'j',
0x1d40a:'k', 0x1d40b:'l', 0x1d40c:'m', 0x1d40d:'n',
0x1d40e:'o', 0x1d40f:'p', 0x1d410:'q', 0x1d411:'r',
0x1d412:'s', 0x1d413:'t', 0x1d414:'u', 0x1d415:'v',
0x1d416:'w', 0x1d417:'x', 0x1d418:'y', 0x1d419:'z',
0x1d434:'a', 0x1d435:'b', 0x1d436:'c', 0x1d437:'d',
0x1d438:'e', 0x1d439:'f', 0x1d43a:'g', 0x1d43b:'h',
0x1d43c:'i', 0x1d43d:'j', 0x1d43e:'k', 0x1d43f:'l',
0x1d440:'m', 0x1d441:'n', 0x1d442:'o', 0x1d443:'p',
0x1d444:'q', 0x1d445:'r', 0x1d446:'s', 0x1d447:'t',
0x1d448:'u', 0x1d449:'v', 0x1d44a:'w', 0x1d44b:'x',
0x1d44c:'y', 0x1d44d:'z', 0x1d468:'a', 0x1d469:'b',
0x1d46a:'c', 0x1d46b:'d', 0x1d46c:'e', 0x1d46d:'f',
0x1d46e:'g', 0x1d46f:'h', 0x1d470:'i', 0x1d471:'j',
0x1d472:'k', 0x1d473:'l', 0x1d474:'m', 0x1d475:'n',
0x1d476:'o', 0x1d477:'p', 0x1d478:'q', 0x1d479:'r',
0x1d47a:'s', 0x1d47b:'t', 0x1d47c:'u', 0x1d47d:'v',
0x1d47e:'w', 0x1d47f:'x', 0x1d480:'y', 0x1d481:'z',
0x1d49c:'a', 0x1d49e:'c', 0x1d49f:'d', 0x1d4a2:'g',
0x1d4a5:'j', 0x1d4a6:'k', 0x1d4a9:'n', 0x1d4aa:'o',
0x1d4ab:'p', 0x1d4ac:'q', 0x1d4ae:'s', 0x1d4af:'t',
0x1d4b0:'u', 0x1d4b1:'v', 0x1d4b2:'w', 0x1d4b3:'x',
0x1d4b4:'y', 0x1d4b5:'z', 0x1d4d0:'a', 0x1d4d1:'b',
0x1d4d2:'c', 0x1d4d3:'d', 0x1d4d4:'e', 0x1d4d5:'f',
0x1d4d6:'g', 0x1d4d7:'h', 0x1d4d8:'i', 0x1d4d9:'j',
0x1d4da:'k', 0x1d4db:'l', 0x1d4dc:'m', 0x1d4dd:'n',
0x1d4de:'o', 0x1d4df:'p', 0x1d4e0:'q', 0x1d4e1:'r',
0x1d4e2:'s', 0x1d4e3:'t', 0x1d4e4:'u', 0x1d4e5:'v',
0x1d4e6:'w', 0x1d4e7:'x', 0x1d4e8:'y', 0x1d4e9:'z',
0x1d504:'a', 0x1d505:'b', 0x1d507:'d', 0x1d508:'e',
0x1d509:'f', 0x1d50a:'g', 0x1d50d:'j', 0x1d50e:'k',
0x1d50f:'l', 0x1d510:'m', 0x1d511:'n', 0x1d512:'o',
0x1d513:'p', 0x1d514:'q', 0x1d516:'s', 0x1d517:'t',
0x1d518:'u', 0x1d519:'v', 0x1d51a:'w', 0x1d51b:'x',
0x1d51c:'y', 0x1d538:'a', 0x1d539:'b', 0x1d53b:'d',
0x1d53c:'e', 0x1d53d:'f', 0x1d53e:'g', 0x1d540:'i',
0x1d541:'j', 0x1d542:'k', 0x1d543:'l', 0x1d544:'m',
0x1d546:'o', 0x1d54a:'s', 0x1d54b:'t', 0x1d54c:'u',
0x1d54d:'v', 0x1d54e:'w', 0x1d54f:'x', 0x1d550:'y',
0x1d56c:'a', 0x1d56d:'b', 0x1d56e:'c', 0x1d56f:'d',
0x1d570:'e', 0x1d571:'f', 0x1d572:'g', 0x1d573:'h',
0x1d574:'i', 0x1d575:'j', 0x1d576:'k', 0x1d577:'l',
0x1d578:'m', 0x1d579:'n', 0x1d57a:'o', 0x1d57b:'p',
0x1d57c:'q', 0x1d57d:'r', 0x1d57e:'s', 0x1d57f:'t',
0x1d580:'u', 0x1d581:'v', 0x1d582:'w', 0x1d583:'x',
0x1d584:'y', 0x1d585:'z', 0x1d5a0:'a', 0x1d5a1:'b',
0x1d5a2:'c', 0x1d5a3:'d', 0x1d5a4:'e', 0x1d5a5:'f',
0x1d5a6:'g', 0x1d5a7:'h', 0x1d5a8:'i', 0x1d5a9:'j',
0x1d5aa:'k', 0x1d5ab:'l', 0x1d5ac:'m', 0x1d5ad:'n',
0x1d5ae:'o', 0x1d5af:'p', 0x1d5b0:'q', 0x1d5b1:'r',
0x1d5b2:'s', 0x1d5b3:'t', 0x1d5b4:'u', 0x1d5b5:'v',
0x1d5b6:'w', 0x1d5b7:'x', 0x1d5b8:'y', 0x1d5b9:'z',
0x1d5d4:'a', 0x1d5d5:'b', 0x1d5d6:'c', 0x1d5d7:'d',
0x1d5d8:'e', 0x1d5d9:'f', 0x1d5da:'g', 0x1d5db:'h',
0x1d5dc:'i', 0x1d5dd:'j', 0x1d5de:'k', 0x1d5df:'l',
0x1d5e0:'m', 0x1d5e1:'n', 0x1d5e2:'o', 0x1d5e3:'p',
0x1d5e4:'q', 0x1d5e5:'r', 0x1d5e6:'s', 0x1d5e7:'t',
0x1d5e8:'u', 0x1d5e9:'v', 0x1d5ea:'w', 0x1d5eb:'x',
0x1d5ec:'y', 0x1d5ed:'z', 0x1d608:'a', 0x1d609:'b',
0x1d60a:'c', 0x1d60b:'d', 0x1d60c:'e', 0x1d60d:'f',
0x1d60e:'g', 0x1d60f:'h', 0x1d610:'i', 0x1d611:'j',
0x1d612:'k', 0x1d613:'l', 0x1d614:'m', 0x1d615:'n',
0x1d616:'o', 0x1d617:'p', 0x1d618:'q', 0x1d619:'r',
0x1d61a:'s', 0x1d61b:'t', 0x1d61c:'u', 0x1d61d:'v',
0x1d61e:'w', 0x1d61f:'x', 0x1d620:'y', 0x1d621:'z',
0x1d63c:'a', 0x1d63d:'b', 0x1d63e:'c', 0x1d63f:'d',
0x1d640:'e', 0x1d641:'f', 0x1d642:'g', 0x1d643:'h',
0x1d644:'i', 0x1d645:'j', 0x1d646:'k', 0x1d647:'l',
0x1d648:'m', 0x1d649:'n', 0x1d64a:'o', 0x1d64b:'p',
0x1d64c:'q', 0x1d64d:'r', 0x1d64e:'s', 0x1d64f:'t',
0x1d650:'u', 0x1d651:'v', 0x1d652:'w', 0x1d653:'x',
0x1d654:'y', 0x1d655:'z', 0x1d670:'a', 0x1d671:'b',
0x1d672:'c', 0x1d673:'d', 0x1d674:'e', 0x1d675:'f',
0x1d676:'g', 0x1d677:'h', 0x1d678:'i', 0x1d679:'j',
0x1d67a:'k', 0x1d67b:'l', 0x1d67c:'m', 0x1d67d:'n',
0x1d67e:'o', 0x1d67f:'p', 0x1d680:'q', 0x1d681:'r',
0x1d682:'s', 0x1d683:'t', 0x1d684:'u', 0x1d685:'v',
0x1d686:'w', 0x1d687:'x', 0x1d688:'y', 0x1d689:'z',
0x1d6a8:'\u03b1', 0x1d6a9:'\u03b2', 0x1d6aa:'\u03b3', 0x1d6ab:'\u03b4',
0x1d6ac:'\u03b5', 0x1d6ad:'\u03b6', 0x1d6ae:'\u03b7', 0x1d6af:'\u03b8',
0x1d6b0:'\u03b9', 0x1d6b1:'\u03ba', 0x1d6b2:'\u03bb', 0x1d6b3:'\u03bc',
0x1d6b4:'\u03bd', 0x1d6b5:'\u03be', 0x1d6b6:'\u03bf', 0x1d6b7:'\u03c0',
0x1d6b8:'\u03c1', 0x1d6b9:'\u03b8', 0x1d6ba:'\u03c3', 0x1d6bb:'\u03c4',
0x1d6bc:'\u03c5', 0x1d6bd:'\u03c6', 0x1d6be:'\u03c7', 0x1d6bf:'\u03c8',
0x1d6c0:'\u03c9', 0x1d6d3:'\u03c3', 0x1d6e2:'\u03b1', 0x1d6e3:'\u03b2',
0x1d6e4:'\u03b3', 0x1d6e5:'\u03b4', 0x1d6e6:'\u03b5', 0x1d6e7:'\u03b6',
0x1d6e8:'\u03b7', 0x1d6e9:'\u03b8', 0x1d6ea:'\u03b9', 0x1d6eb:'\u03ba',
0x1d6ec:'\u03bb', 0x1d6ed:'\u03bc', 0x1d6ee:'\u03bd', 0x1d6ef:'\u03be',
0x1d6f0:'\u03bf', 0x1d6f1:'\u03c0', 0x1d6f2:'\u03c1', 0x1d6f3:'\u03b8',
0x1d6f4:'\u03c3', 0x1d6f5:'\u03c4', 0x1d6f6:'\u03c5', 0x1d6f7:'\u03c6',
0x1d6f8:'\u03c7', 0x1d6f9:'\u03c8', 0x1d6fa:'\u03c9', 0x1d70d:'\u03c3',
0x1d71c:'\u03b1', 0x1d71d:'\u03b2', 0x1d71e:'\u03b3', 0x1d71f:'\u03b4',
0x1d720:'\u03b5', 0x1d721:'\u03b6', 0x1d722:'\u03b7', 0x1d723:'\u03b8',
0x1d724:'\u03b9', 0x1d725:'\u03ba', 0x1d726:'\u03bb', 0x1d727:'\u03bc',
0x1d728:'\u03bd', 0x1d729:'\u03be', 0x1d72a:'\u03bf', 0x1d72b:'\u03c0',
0x1d72c:'\u03c1', 0x1d72d:'\u03b8', 0x1d72e:'\u03c3', 0x1d72f:'\u03c4',
0x1d730:'\u03c5', 0x1d731:'\u03c6', 0x1d732:'\u03c7', 0x1d733:'\u03c8',
0x1d734:'\u03c9', 0x1d747:'\u03c3', 0x1d756:'\u03b1', 0x1d757:'\u03b2',
0x1d758:'\u03b3', 0x1d759:'\u03b4', 0x1d75a:'\u03b5', 0x1d75b:'\u03b6',
0x1d75c:'\u03b7', 0x1d75d:'\u03b8', 0x1d75e:'\u03b9', 0x1d75f:'\u03ba',
0x1d760:'\u03bb', 0x1d761:'\u03bc', 0x1d762:'\u03bd', 0x1d763:'\u03be',
0x1d764:'\u03bf', 0x1d765:'\u03c0', 0x1d766:'\u03c1', 0x1d767:'\u03b8',
0x1d768:'\u03c3', 0x1d769:'\u03c4', 0x1d76a:'\u03c5', 0x1d76b:'\u03c6',
0x1d76c:'\u03c7', 0x1d76d:'\u03c8', 0x1d76e:'\u03c9', 0x1d781:'\u03c3',
0x1d790:'\u03b1', 0x1d791:'\u03b2', 0x1d792:'\u03b3', 0x1d793:'\u03b4',
0x1d794:'\u03b5', 0x1d795:'\u03b6', 0x1d796:'\u03b7', 0x1d797:'\u03b8',
0x1d798:'\u03b9', 0x1d799:'\u03ba', 0x1d79a:'\u03bb', 0x1d79b:'\u03bc',
0x1d79c:'\u03bd', 0x1d79d:'\u03be', 0x1d79e:'\u03bf', 0x1d79f:'\u03c0',
0x1d7a0:'\u03c1', 0x1d7a1:'\u03b8', 0x1d7a2:'\u03c3', 0x1d7a3:'\u03c4',
0x1d7a4:'\u03c5', 0x1d7a5:'\u03c6', 0x1d7a6:'\u03c7', 0x1d7a7:'\u03c8',
0x1d7a8:'\u03c9', 0x1d7bb:'\u03c3', }

def map_table_b3(code):
    r = b3_exceptions.get(ord(code))
    if r is not None: return r
    return code.lower()


def map_table_b2(a):
    al = map_table_b3(a)
    b = unicodedata.normalize("NFKC", al)
    bl = "".join([map_table_b3(ch) for ch in b])
    c = unicodedata.normalize("NFKC", bl)
    if b != c:
        return c
    else:
        return al


def in_table_c11(code):
    return code == " "


def in_table_c12(code):
    return unicodedata.category(code) == "Zs" and code != " "

def in_table_c11_c12(code):
    return unicodedata.category(code) == "Zs"


def in_table_c21(code):
    return ord(code) < 128 and unicodedata.category(code) == "Cc"

c22_specials = set([1757, 1807, 6158, 8204, 8205, 8232, 8233, 65279] + list(range(8288,8292)) + list(range(8298,8304)) + list(range(65529,65533)) + list(range(119155,119163)))
def in_table_c22(code):
    c = ord(code)
    if c < 128: return False
    if unicodedata.category(code) == "Cc": return True
    return c in c22_specials

def in_table_c21_c22(code):
    return unicodedata.category(code) == "Cc" or \
           ord(code) in c22_specials


def in_table_c3(code):
    return unicodedata.category(code) == "Co"


def in_table_c4(code):
    c = ord(code)
    if c < 0xFDD0: return False
    if c < 0xFDF0: return True
    return (ord(code) & 0xFFFF) in (0xFFFE, 0xFFFF)


def in_table_c5(code):
    return unicodedata.category(code) == "Cs"


c6_set = set(range(65529,65534))
def in_table_c6(code):
    return ord(code) in c6_set


c7_set = set(range(12272,12284))
def in_table_c7(code):
    return ord(code) in c7_set


c8_set = set([832, 833, 8206, 8207] + list(range(8234,8239)) + list(range(8298,8304)))
def in_table_c8(code):
    return ord(code) in c8_set


c9_set = set([917505] + list(range(917536,917632)))
def in_table_c9(code):
    return ord(code) in c9_set


def in_table_d1(code):
    return unicodedata.bidirectional(code) in ("R","AL")


def in_table_d2(code):
    return unicodedata.bidirectional(code) == "L"
wsgiref/util.py000064400000013333151153537630007555 0ustar00"""Miscellaneous WSGI-related Utilities"""

import posixpath

__all__ = [
    'FileWrapper', 'guess_scheme', 'application_uri', 'request_uri',
    'shift_path_info', 'setup_testing_defaults',
]


class FileWrapper:
    """Wrapper to convert file-like objects to iterables"""

    def __init__(self, filelike, blksize=8192):
        self.filelike = filelike
        self.blksize = blksize
        if hasattr(filelike,'close'):
            self.close = filelike.close

    def __getitem__(self,key):
        import warnings
        warnings.warn(
            "FileWrapper's __getitem__ method ignores 'key' parameter. "
            "Use iterator protocol instead.",
            DeprecationWarning,
            stacklevel=2
        )
        data = self.filelike.read(self.blksize)
        if data:
            return data
        raise IndexError

    def __iter__(self):
        return self

    def __next__(self):
        data = self.filelike.read(self.blksize)
        if data:
            return data
        raise StopIteration

def guess_scheme(environ):
    """Return a guess for whether 'wsgi.url_scheme' should be 'http' or 'https'
    """
    if environ.get("HTTPS") in ('yes','on','1'):
        return 'https'
    else:
        return 'http'

def application_uri(environ):
    """Return the application's base URI (no PATH_INFO or QUERY_STRING)"""
    url = environ['wsgi.url_scheme']+'://'
    from urllib.parse import quote

    if environ.get('HTTP_HOST'):
        url += environ['HTTP_HOST']
    else:
        url += environ['SERVER_NAME']

        if environ['wsgi.url_scheme'] == 'https':
            if environ['SERVER_PORT'] != '443':
                url += ':' + environ['SERVER_PORT']
        else:
            if environ['SERVER_PORT'] != '80':
                url += ':' + environ['SERVER_PORT']

    url += quote(environ.get('SCRIPT_NAME') or '/', encoding='latin1')
    return url

def request_uri(environ, include_query=True):
    """Return the full request URI, optionally including the query string"""
    url = application_uri(environ)
    from urllib.parse import quote
    path_info = quote(environ.get('PATH_INFO',''), safe='/;=,', encoding='latin1')
    if not environ.get('SCRIPT_NAME'):
        url += path_info[1:]
    else:
        url += path_info
    if include_query and environ.get('QUERY_STRING'):
        url += '?' + environ['QUERY_STRING']
    return url

def shift_path_info(environ):
    """Shift a name from PATH_INFO to SCRIPT_NAME, returning it

    If there are no remaining path segments in PATH_INFO, return None.
    Note: 'environ' is modified in-place; use a copy if you need to keep
    the original PATH_INFO or SCRIPT_NAME.

    Note: when PATH_INFO is just a '/', this returns '' and appends a trailing
    '/' to SCRIPT_NAME, even though empty path segments are normally ignored,
    and SCRIPT_NAME doesn't normally end in a '/'.  This is intentional
    behavior, to ensure that an application can tell the difference between
    '/x' and '/x/' when traversing to objects.
    """
    path_info = environ.get('PATH_INFO','')
    if not path_info:
        return None

    path_parts = path_info.split('/')
    path_parts[1:-1] = [p for p in path_parts[1:-1] if p and p != '.']
    name = path_parts[1]
    del path_parts[1]

    script_name = environ.get('SCRIPT_NAME','')
    script_name = posixpath.normpath(script_name+'/'+name)
    if script_name.endswith('/'):
        script_name = script_name[:-1]
    if not name and not script_name.endswith('/'):
        script_name += '/'

    environ['SCRIPT_NAME'] = script_name
    environ['PATH_INFO']   = '/'.join(path_parts)

    # Special case: '/.' on PATH_INFO doesn't get stripped,
    # because we don't strip the last element of PATH_INFO
    # if there's only one path part left.  Instead of fixing this
    # above, we fix it here so that PATH_INFO gets normalized to
    # an empty string in the environ.
    if name=='.':
        name = None
    return name

def setup_testing_defaults(environ):
    """Update 'environ' with trivial defaults for testing purposes

    This adds various parameters required for WSGI, including HTTP_HOST,
    SERVER_NAME, SERVER_PORT, REQUEST_METHOD, SCRIPT_NAME, PATH_INFO,
    and all of the wsgi.* variables.  It only supplies default values,
    and does not replace any existing settings for these variables.

    This routine is intended to make it easier for unit tests of WSGI
    servers and applications to set up dummy environments.  It should *not*
    be used by actual WSGI servers or applications, since the data is fake!
    """

    environ.setdefault('SERVER_NAME','127.0.0.1')
    environ.setdefault('SERVER_PROTOCOL','HTTP/1.0')

    environ.setdefault('HTTP_HOST',environ['SERVER_NAME'])
    environ.setdefault('REQUEST_METHOD','GET')

    if 'SCRIPT_NAME' not in environ and 'PATH_INFO' not in environ:
        environ.setdefault('SCRIPT_NAME','')
        environ.setdefault('PATH_INFO','/')

    environ.setdefault('wsgi.version', (1,0))
    environ.setdefault('wsgi.run_once', 0)
    environ.setdefault('wsgi.multithread', 0)
    environ.setdefault('wsgi.multiprocess', 0)

    from io import StringIO, BytesIO
    environ.setdefault('wsgi.input', BytesIO())
    environ.setdefault('wsgi.errors', StringIO())
    environ.setdefault('wsgi.url_scheme',guess_scheme(environ))

    if environ['wsgi.url_scheme']=='http':
        environ.setdefault('SERVER_PORT', '80')
    elif environ['wsgi.url_scheme']=='https':
        environ.setdefault('SERVER_PORT', '443')



_hoppish = {
    'connection', 'keep-alive', 'proxy-authenticate',
    'proxy-authorization', 'te', 'trailers', 'transfer-encoding',
    'upgrade'
}.__contains__

def is_hop_by_hop(header_name):
    """Return true if 'header_name' is an HTTP/1.1 "Hop-by-Hop" header"""
    return _hoppish(header_name.lower())
wsgiref/__init__.py000064400000001113151153537630010330 0ustar00"""wsgiref -- a WSGI (PEP 3333) Reference Library

Current Contents:

* util -- Miscellaneous useful functions and wrappers

* headers -- Manage response headers

* handlers -- base classes for server/gateway implementations

* simple_server -- a simple BaseHTTPServer that supports WSGI

* validate -- validation wrapper that sits between an app and a server
  to detect errors in either

To-Do:

* cgi_gateway -- Run WSGI apps under CGI (pending a deployment standard)

* cgi_wrapper -- Run CGI apps under WSGI

* router -- a simple middleware component that handles URL traversal
"""
wsgiref/handlers.py000064400000052245151153537630010405 0ustar00"""Base classes for server/gateway implementations"""

from .util import FileWrapper, guess_scheme, is_hop_by_hop
from .headers import Headers

import sys, os, time

__all__ = [
    'BaseHandler', 'SimpleHandler', 'BaseCGIHandler', 'CGIHandler',
    'IISCGIHandler', 'read_environ'
]

# Weekday and month names for HTTP date/time formatting; always English!
_weekdayname = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
_monthname = [None, # Dummy so we can use 1-based month numbers
              "Jan", "Feb", "Mar", "Apr", "May", "Jun",
              "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]

def format_date_time(timestamp):
    year, month, day, hh, mm, ss, wd, y, z = time.gmtime(timestamp)
    return "%s, %02d %3s %4d %02d:%02d:%02d GMT" % (
        _weekdayname[wd], day, _monthname[month], year, hh, mm, ss
    )

_is_request = {
    'SCRIPT_NAME', 'PATH_INFO', 'QUERY_STRING', 'REQUEST_METHOD', 'AUTH_TYPE',
    'CONTENT_TYPE', 'CONTENT_LENGTH', 'HTTPS', 'REMOTE_USER', 'REMOTE_IDENT',
}.__contains__

def _needs_transcode(k):
    return _is_request(k) or k.startswith('HTTP_') or k.startswith('SSL_') \
        or (k.startswith('REDIRECT_') and _needs_transcode(k[9:]))

def read_environ():
    """Read environment, fixing HTTP variables"""
    enc = sys.getfilesystemencoding()
    esc = 'surrogateescape'
    try:
        ''.encode('utf-8', esc)
    except LookupError:
        esc = 'replace'
    environ = {}

    # Take the basic environment from native-unicode os.environ. Attempt to
    # fix up the variables that come from the HTTP request to compensate for
    # the bytes->unicode decoding step that will already have taken place.
    for k, v in os.environ.items():
        if _needs_transcode(k):

            # On win32, the os.environ is natively Unicode. Different servers
            # decode the request bytes using different encodings.
            if sys.platform == 'win32':
                software = os.environ.get('SERVER_SOFTWARE', '').lower()

                # On IIS, the HTTP request will be decoded as UTF-8 as long
                # as the input is a valid UTF-8 sequence. Otherwise it is
                # decoded using the system code page (mbcs), with no way to
                # detect this has happened. Because UTF-8 is the more likely
                # encoding, and mbcs is inherently unreliable (an mbcs string
                # that happens to be valid UTF-8 will not be decoded as mbcs)
                # always recreate the original bytes as UTF-8.
                if software.startswith('microsoft-iis/'):
                    v = v.encode('utf-8').decode('iso-8859-1')

                # Apache mod_cgi writes bytes-as-unicode (as if ISO-8859-1) direct
                # to the Unicode environ. No modification needed.
                elif software.startswith('apache/'):
                    pass

                # Python 3's http.server.CGIHTTPRequestHandler decodes
                # using the urllib.unquote default of UTF-8, amongst other
                # issues.
                elif (
                    software.startswith('simplehttp/')
                    and 'python/3' in software
                ):
                    v = v.encode('utf-8').decode('iso-8859-1')

                # For other servers, guess that they have written bytes to
                # the environ using stdio byte-oriented interfaces, ending up
                # with the system code page.
                else:
                    v = v.encode(enc, 'replace').decode('iso-8859-1')

            # Recover bytes from unicode environ, using surrogate escapes
            # where available (Python 3.1+).
            else:
                v = v.encode(enc, esc).decode('iso-8859-1')

        environ[k] = v
    return environ


class BaseHandler:
    """Manage the invocation of a WSGI application"""

    # Configuration parameters; can override per-subclass or per-instance
    wsgi_version = (1,0)
    wsgi_multithread = True
    wsgi_multiprocess = True
    wsgi_run_once = False

    origin_server = True    # We are transmitting direct to client
    http_version  = "1.0"   # Version that should be used for response
    server_software = None  # String name of server software, if any

    # os_environ is used to supply configuration from the OS environment:
    # by default it's a copy of 'os.environ' as of import time, but you can
    # override this in e.g. your __init__ method.
    os_environ= read_environ()

    # Collaborator classes
    wsgi_file_wrapper = FileWrapper     # set to None to disable
    headers_class = Headers             # must be a Headers-like class

    # Error handling (also per-subclass or per-instance)
    traceback_limit = None  # Print entire traceback to self.get_stderr()
    error_status = "500 Internal Server Error"
    error_headers = [('Content-Type','text/plain')]
    error_body = b"A server error occurred.  Please contact the administrator."

    # State variables (don't mess with these)
    status = result = None
    headers_sent = False
    headers = None
    bytes_sent = 0

    def run(self, application):
        """Invoke the application"""
        # Note to self: don't move the close()!  Asynchronous servers shouldn't
        # call close() from finish_response(), so if you close() anywhere but
        # the double-error branch here, you'll break asynchronous servers by
        # prematurely closing.  Async servers must return from 'run()' without
        # closing if there might still be output to iterate over.
        try:
            self.setup_environ()
            self.result = application(self.environ, self.start_response)
            self.finish_response()
        except (ConnectionAbortedError, BrokenPipeError, ConnectionResetError):
            # We expect the client to close the connection abruptly from time
            # to time.
            return
        except:
            try:
                self.handle_error()
            except:
                # If we get an error handling an error, just give up already!
                self.close()
                raise   # ...and let the actual server figure it out.


    def setup_environ(self):
        """Set up the environment for one request"""

        env = self.environ = self.os_environ.copy()
        self.add_cgi_vars()

        env['wsgi.input']        = self.get_stdin()
        env['wsgi.errors']       = self.get_stderr()
        env['wsgi.version']      = self.wsgi_version
        env['wsgi.run_once']     = self.wsgi_run_once
        env['wsgi.url_scheme']   = self.get_scheme()
        env['wsgi.multithread']  = self.wsgi_multithread
        env['wsgi.multiprocess'] = self.wsgi_multiprocess

        if self.wsgi_file_wrapper is not None:
            env['wsgi.file_wrapper'] = self.wsgi_file_wrapper

        if self.origin_server and self.server_software:
            env.setdefault('SERVER_SOFTWARE',self.server_software)


    def finish_response(self):
        """Send any iterable data, then close self and the iterable

        Subclasses intended for use in asynchronous servers will
        want to redefine this method, such that it sets up callbacks
        in the event loop to iterate over the data, and to call
        'self.close()' once the response is finished.
        """
        try:
            if not self.result_is_file() or not self.sendfile():
                for data in self.result:
                    self.write(data)
                self.finish_content()
        except:
            # Call close() on the iterable returned by the WSGI application
            # in case of an exception.
            if hasattr(self.result, 'close'):
                self.result.close()
            raise
        else:
            # We only call close() when no exception is raised, because it
            # will set status, result, headers, and environ fields to None.
            # See bpo-29183 for more details.
            self.close()


    def get_scheme(self):
        """Return the URL scheme being used"""
        return guess_scheme(self.environ)


    def set_content_length(self):
        """Compute Content-Length or switch to chunked encoding if possible"""
        try:
            blocks = len(self.result)
        except (TypeError,AttributeError,NotImplementedError):
            pass
        else:
            if blocks==1:
                self.headers['Content-Length'] = str(self.bytes_sent)
                return
        # XXX Try for chunked encoding if origin server and client is 1.1


    def cleanup_headers(self):
        """Make any necessary header changes or defaults

        Subclasses can extend this to add other defaults.
        """
        if 'Content-Length' not in self.headers:
            self.set_content_length()

    def start_response(self, status, headers,exc_info=None):
        """'start_response()' callable as specified by PEP 3333"""

        if exc_info:
            try:
                if self.headers_sent:
                    # Re-raise original exception if headers sent
                    raise exc_info[0](exc_info[1]).with_traceback(exc_info[2])
            finally:
                exc_info = None        # avoid dangling circular ref
        elif self.headers is not None:
            raise AssertionError("Headers already set!")

        self.status = status
        self.headers = self.headers_class(headers)
        status = self._convert_string_type(status, "Status")
        assert len(status)>=4,"Status must be at least 4 characters"
        assert status[:3].isdigit(), "Status message must begin w/3-digit code"
        assert status[3]==" ", "Status message must have a space after code"

        if __debug__:
            for name, val in headers:
                name = self._convert_string_type(name, "Header name")
                val = self._convert_string_type(val, "Header value")
                assert not is_hop_by_hop(name),\
                       f"Hop-by-hop header, '{name}: {val}', not allowed"

        return self.write

    def _convert_string_type(self, value, title):
        """Convert/check value type."""
        if type(value) is str:
            return value
        raise AssertionError(
            "{0} must be of type str (got {1})".format(title, repr(value))
        )

    def send_preamble(self):
        """Transmit version/status/date/server, via self._write()"""
        if self.origin_server:
            if self.client_is_modern():
                self._write(('HTTP/%s %s\r\n' % (self.http_version,self.status)).encode('iso-8859-1'))
                if 'Date' not in self.headers:
                    self._write(
                        ('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1')
                    )
                if self.server_software and 'Server' not in self.headers:
                    self._write(('Server: %s\r\n' % self.server_software).encode('iso-8859-1'))
        else:
            self._write(('Status: %s\r\n' % self.status).encode('iso-8859-1'))

    def write(self, data):
        """'write()' callable as specified by PEP 3333"""

        assert type(data) is bytes, \
            "write() argument must be a bytes instance"

        if not self.status:
            raise AssertionError("write() before start_response()")

        elif not self.headers_sent:
            # Before the first output, send the stored headers
            self.bytes_sent = len(data)    # make sure we know content-length
            self.send_headers()
        else:
            self.bytes_sent += len(data)

        # XXX check Content-Length and truncate if too many bytes written?
        self._write(data)
        self._flush()


    def sendfile(self):
        """Platform-specific file transmission

        Override this method in subclasses to support platform-specific
        file transmission.  It is only called if the application's
        return iterable ('self.result') is an instance of
        'self.wsgi_file_wrapper'.

        This method should return a true value if it was able to actually
        transmit the wrapped file-like object using a platform-specific
        approach.  It should return a false value if normal iteration
        should be used instead.  An exception can be raised to indicate
        that transmission was attempted, but failed.

        NOTE: this method should call 'self.send_headers()' if
        'self.headers_sent' is false and it is going to attempt direct
        transmission of the file.
        """
        return False   # No platform-specific transmission by default


    def finish_content(self):
        """Ensure headers and content have both been sent"""
        if not self.headers_sent:
            # Only zero Content-Length if not set by the application (so
            # that HEAD requests can be satisfied properly, see #3839)
            self.headers.setdefault('Content-Length', "0")
            self.send_headers()
        else:
            pass # XXX check if content-length was too short?

    def close(self):
        """Close the iterable (if needed) and reset all instance vars

        Subclasses may want to also drop the client connection.
        """
        try:
            if hasattr(self.result,'close'):
                self.result.close()
        finally:
            self.result = self.headers = self.status = self.environ = None
            self.bytes_sent = 0; self.headers_sent = False


    def send_headers(self):
        """Transmit headers to the client, via self._write()"""
        self.cleanup_headers()
        self.headers_sent = True
        if not self.origin_server or self.client_is_modern():
            self.send_preamble()
            self._write(bytes(self.headers))


    def result_is_file(self):
        """True if 'self.result' is an instance of 'self.wsgi_file_wrapper'"""
        wrapper = self.wsgi_file_wrapper
        return wrapper is not None and isinstance(self.result,wrapper)


    def client_is_modern(self):
        """True if client can accept status and headers"""
        return self.environ['SERVER_PROTOCOL'].upper() != 'HTTP/0.9'


    def log_exception(self,exc_info):
        """Log the 'exc_info' tuple in the server log

        Subclasses may override to retarget the output or change its format.
        """
        try:
            from traceback import print_exception
            stderr = self.get_stderr()
            print_exception(
                exc_info[0], exc_info[1], exc_info[2],
                self.traceback_limit, stderr
            )
            stderr.flush()
        finally:
            exc_info = None

    def handle_error(self):
        """Log current error, and send error output to client if possible"""
        self.log_exception(sys.exc_info())
        if not self.headers_sent:
            self.result = self.error_output(self.environ, self.start_response)
            self.finish_response()
        # XXX else: attempt advanced recovery techniques for HTML or text?

    def error_output(self, environ, start_response):
        """WSGI mini-app to create error output

        By default, this just uses the 'error_status', 'error_headers',
        and 'error_body' attributes to generate an output page.  It can
        be overridden in a subclass to dynamically generate diagnostics,
        choose an appropriate message for the user's preferred language, etc.

        Note, however, that it's not recommended from a security perspective to
        spit out diagnostics to any old user; ideally, you should have to do
        something special to enable diagnostic output, which is why we don't
        include any here!
        """
        start_response(self.error_status,self.error_headers[:],sys.exc_info())
        return [self.error_body]


    # Pure abstract methods; *must* be overridden in subclasses

    def _write(self,data):
        """Override in subclass to buffer data for send to client

        It's okay if this method actually transmits the data; BaseHandler
        just separates write and flush operations for greater efficiency
        when the underlying system actually has such a distinction.
        """
        raise NotImplementedError

    def _flush(self):
        """Override in subclass to force sending of recent '_write()' calls

        It's okay if this method is a no-op (i.e., if '_write()' actually
        sends the data.
        """
        raise NotImplementedError

    def get_stdin(self):
        """Override in subclass to return suitable 'wsgi.input'"""
        raise NotImplementedError

    def get_stderr(self):
        """Override in subclass to return suitable 'wsgi.errors'"""
        raise NotImplementedError

    def add_cgi_vars(self):
        """Override in subclass to insert CGI variables in 'self.environ'"""
        raise NotImplementedError


class SimpleHandler(BaseHandler):
    """Handler that's just initialized with streams, environment, etc.

    This handler subclass is intended for synchronous HTTP/1.0 origin servers,
    and handles sending the entire response output, given the correct inputs.

    Usage::

        handler = SimpleHandler(
            inp,out,err,env, multithread=False, multiprocess=True
        )
        handler.run(app)"""

    def __init__(self,stdin,stdout,stderr,environ,
        multithread=True, multiprocess=False
    ):
        self.stdin = stdin
        self.stdout = stdout
        self.stderr = stderr
        self.base_env = environ
        self.wsgi_multithread = multithread
        self.wsgi_multiprocess = multiprocess

    def get_stdin(self):
        return self.stdin

    def get_stderr(self):
        return self.stderr

    def add_cgi_vars(self):
        self.environ.update(self.base_env)

    def _write(self,data):
        result = self.stdout.write(data)
        if result is None or result == len(data):
            return
        from warnings import warn
        warn("SimpleHandler.stdout.write() should not do partial writes",
            DeprecationWarning)
        while True:
            data = data[result:]
            if not data:
                break
            result = self.stdout.write(data)

    def _flush(self):
        self.stdout.flush()
        self._flush = self.stdout.flush


class BaseCGIHandler(SimpleHandler):

    """CGI-like systems using input/output/error streams and environ mapping

    Usage::

        handler = BaseCGIHandler(inp,out,err,env)
        handler.run(app)

    This handler class is useful for gateway protocols like ReadyExec and
    FastCGI, that have usable input/output/error streams and an environment
    mapping.  It's also the base class for CGIHandler, which just uses
    sys.stdin, os.environ, and so on.

    The constructor also takes keyword arguments 'multithread' and
    'multiprocess' (defaulting to 'True' and 'False' respectively) to control
    the configuration sent to the application.  It sets 'origin_server' to
    False (to enable CGI-like output), and assumes that 'wsgi.run_once' is
    False.
    """

    origin_server = False


class CGIHandler(BaseCGIHandler):

    """CGI-based invocation via sys.stdin/stdout/stderr and os.environ

    Usage::

        CGIHandler().run(app)

    The difference between this class and BaseCGIHandler is that it always
    uses 'wsgi.run_once' of 'True', 'wsgi.multithread' of 'False', and
    'wsgi.multiprocess' of 'True'.  It does not take any initialization
    parameters, but always uses 'sys.stdin', 'os.environ', and friends.

    If you need to override any of these parameters, use BaseCGIHandler
    instead.
    """

    wsgi_run_once = True
    # Do not allow os.environ to leak between requests in Google App Engine
    # and other multi-run CGI use cases.  This is not easily testable.
    # See http://bugs.python.org/issue7250
    os_environ = {}

    def __init__(self):
        BaseCGIHandler.__init__(
            self, sys.stdin.buffer, sys.stdout.buffer, sys.stderr,
            read_environ(), multithread=False, multiprocess=True
        )


class IISCGIHandler(BaseCGIHandler):
    """CGI-based invocation with workaround for IIS path bug

    This handler should be used in preference to CGIHandler when deploying on
    Microsoft IIS without having set the config allowPathInfo option (IIS>=7)
    or metabase allowPathInfoForScriptMappings (IIS<7).
    """
    wsgi_run_once = True
    os_environ = {}

    # By default, IIS gives a PATH_INFO that duplicates the SCRIPT_NAME at
    # the front, causing problems for WSGI applications that wish to implement
    # routing. This handler strips any such duplicated path.

    # IIS can be configured to pass the correct PATH_INFO, but this causes
    # another bug where PATH_TRANSLATED is wrong. Luckily this variable is
    # rarely used and is not guaranteed by WSGI. On IIS<7, though, the
    # setting can only be made on a vhost level, affecting all other script
    # mappings, many of which break when exposed to the PATH_TRANSLATED bug.
    # For this reason IIS<7 is almost never deployed with the fix. (Even IIS7
    # rarely uses it because there is still no UI for it.)

    # There is no way for CGI code to tell whether the option was set, so a
    # separate handler class is provided.
    def __init__(self):
        environ= read_environ()
        path = environ.get('PATH_INFO', '')
        script = environ.get('SCRIPT_NAME', '')
        if (path+'/').startswith(script+'/'):
            environ['PATH_INFO'] = path[len(script):]
        BaseCGIHandler.__init__(
            self, sys.stdin.buffer, sys.stdout.buffer, sys.stderr,
            environ, multithread=False, multiprocess=True
        )
wsgiref/headers.py000064400000015156151153537630010220 0ustar00"""Manage HTTP Response Headers

Much of this module is red-handedly pilfered from email.message in the stdlib,
so portions are Copyright (C) 2001,2002 Python Software Foundation, and were
written by Barry Warsaw.
"""

# Regular expression that matches `special' characters in parameters, the
# existence of which force quoting of the parameter value.
import re
tspecials = re.compile(r'[ \(\)<>@,;:\\"/\[\]\?=]')

def _formatparam(param, value=None, quote=1):
    """Convenience function to format and return a key=value pair.

    This will quote the value if needed or if quote is true.
    """
    if value is not None and len(value) > 0:
        if quote or tspecials.search(value):
            value = value.replace('\\', '\\\\').replace('"', r'\"')
            return '%s="%s"' % (param, value)
        else:
            return '%s=%s' % (param, value)
    else:
        return param


class Headers:
    """Manage a collection of HTTP response headers"""

    def __init__(self, headers=None):
        headers = headers if headers is not None else []
        if type(headers) is not list:
            raise TypeError("Headers must be a list of name/value tuples")
        self._headers = headers
        if __debug__:
            for k, v in headers:
                self._convert_string_type(k)
                self._convert_string_type(v)

    def _convert_string_type(self, value):
        """Convert/check value type."""
        if type(value) is str:
            return value
        raise AssertionError("Header names/values must be"
            " of type str (got {0})".format(repr(value)))

    def __len__(self):
        """Return the total number of headers, including duplicates."""
        return len(self._headers)

    def __setitem__(self, name, val):
        """Set the value of a header."""
        del self[name]
        self._headers.append(
            (self._convert_string_type(name), self._convert_string_type(val)))

    def __delitem__(self,name):
        """Delete all occurrences of a header, if present.

        Does *not* raise an exception if the header is missing.
        """
        name = self._convert_string_type(name.lower())
        self._headers[:] = [kv for kv in self._headers if kv[0].lower() != name]

    def __getitem__(self,name):
        """Get the first header value for 'name'

        Return None if the header is missing instead of raising an exception.

        Note that if the header appeared multiple times, the first exactly which
        occurrence gets returned is undefined.  Use getall() to get all
        the values matching a header field name.
        """
        return self.get(name)

    def __contains__(self, name):
        """Return true if the message contains the header."""
        return self.get(name) is not None


    def get_all(self, name):
        """Return a list of all the values for the named field.

        These will be sorted in the order they appeared in the original header
        list or were added to this instance, and may contain duplicates.  Any
        fields deleted and re-inserted are always appended to the header list.
        If no fields exist with the given name, returns an empty list.
        """
        name = self._convert_string_type(name.lower())
        return [kv[1] for kv in self._headers if kv[0].lower()==name]


    def get(self,name,default=None):
        """Get the first header value for 'name', or return 'default'"""
        name = self._convert_string_type(name.lower())
        for k,v in self._headers:
            if k.lower()==name:
                return v
        return default


    def keys(self):
        """Return a list of all the header field names.

        These will be sorted in the order they appeared in the original header
        list, or were added to this instance, and may contain duplicates.
        Any fields deleted and re-inserted are always appended to the header
        list.
        """
        return [k for k, v in self._headers]

    def values(self):
        """Return a list of all header values.

        These will be sorted in the order they appeared in the original header
        list, or were added to this instance, and may contain duplicates.
        Any fields deleted and re-inserted are always appended to the header
        list.
        """
        return [v for k, v in self._headers]

    def items(self):
        """Get all the header fields and values.

        These will be sorted in the order they were in the original header
        list, or were added to this instance, and may contain duplicates.
        Any fields deleted and re-inserted are always appended to the header
        list.
        """
        return self._headers[:]

    def __repr__(self):
        return "%s(%r)" % (self.__class__.__name__, self._headers)

    def __str__(self):
        """str() returns the formatted headers, complete with end line,
        suitable for direct HTTP transmission."""
        return '\r\n'.join(["%s: %s" % kv for kv in self._headers]+['',''])

    def __bytes__(self):
        return str(self).encode('iso-8859-1')

    def setdefault(self,name,value):
        """Return first matching header value for 'name', or 'value'

        If there is no header named 'name', add a new header with name 'name'
        and value 'value'."""
        result = self.get(name)
        if result is None:
            self._headers.append((self._convert_string_type(name),
                self._convert_string_type(value)))
            return value
        else:
            return result

    def add_header(self, _name, _value, **_params):
        """Extended header setting.

        _name is the header field to add.  keyword arguments can be used to set
        additional parameters for the header field, with underscores converted
        to dashes.  Normally the parameter will be added as key="value" unless
        value is None, in which case only the key will be added.

        Example:

        h.add_header('content-disposition', 'attachment', filename='bud.gif')

        Note that unlike the corresponding 'email.message' method, this does
        *not* handle '(charset, language, value)' tuples: all values must be
        strings or None.
        """
        parts = []
        if _value is not None:
            _value = self._convert_string_type(_value)
            parts.append(_value)
        for k, v in _params.items():
            k = self._convert_string_type(k)
            if v is None:
                parts.append(k.replace('_', '-'))
            else:
                v = self._convert_string_type(v)
                parts.append(_formatparam(k.replace('_', '-'), v))
        self._headers.append((self._convert_string_type(_name), "; ".join(parts)))
wsgiref/simple_server.py000064400000012063151153537630011456 0ustar00"""BaseHTTPServer that implements the Python WSGI protocol (PEP 3333)

This is both an example of how WSGI can be implemented, and a basis for running
simple web applications on a local machine, such as might be done when testing
or debugging an application.  It has not been reviewed for security issues,
however, and we strongly recommend that you use a "real" web server for
production use.

For example usage, see the 'if __name__=="__main__"' block at the end of the
module.  See also the BaseHTTPServer module docs for other API information.
"""

from http.server import BaseHTTPRequestHandler, HTTPServer
import sys
import urllib.parse
from wsgiref.handlers import SimpleHandler
from platform import python_implementation

__version__ = "0.2"
__all__ = ['WSGIServer', 'WSGIRequestHandler', 'demo_app', 'make_server']


server_version = "WSGIServer/" + __version__
sys_version = python_implementation() + "/" + sys.version.split()[0]
software_version = server_version + ' ' + sys_version


class ServerHandler(SimpleHandler):

    server_software = software_version

    def close(self):
        try:
            self.request_handler.log_request(
                self.status.split(' ',1)[0], self.bytes_sent
            )
        finally:
            SimpleHandler.close(self)



class WSGIServer(HTTPServer):

    """BaseHTTPServer that implements the Python WSGI protocol"""

    application = None

    def server_bind(self):
        """Override server_bind to store the server name."""
        HTTPServer.server_bind(self)
        self.setup_environ()

    def setup_environ(self):
        # Set up base environment
        env = self.base_environ = {}
        env['SERVER_NAME'] = self.server_name
        env['GATEWAY_INTERFACE'] = 'CGI/1.1'
        env['SERVER_PORT'] = str(self.server_port)
        env['REMOTE_HOST']=''
        env['CONTENT_LENGTH']=''
        env['SCRIPT_NAME'] = ''

    def get_app(self):
        return self.application

    def set_app(self,application):
        self.application = application



class WSGIRequestHandler(BaseHTTPRequestHandler):

    server_version = "WSGIServer/" + __version__

    def get_environ(self):
        env = self.server.base_environ.copy()
        env['SERVER_PROTOCOL'] = self.request_version
        env['SERVER_SOFTWARE'] = self.server_version
        env['REQUEST_METHOD'] = self.command
        if '?' in self.path:
            path,query = self.path.split('?',1)
        else:
            path,query = self.path,''

        env['PATH_INFO'] = urllib.parse.unquote(path, 'iso-8859-1')
        env['QUERY_STRING'] = query

        host = self.address_string()
        if host != self.client_address[0]:
            env['REMOTE_HOST'] = host
        env['REMOTE_ADDR'] = self.client_address[0]

        if self.headers.get('content-type') is None:
            env['CONTENT_TYPE'] = self.headers.get_content_type()
        else:
            env['CONTENT_TYPE'] = self.headers['content-type']

        length = self.headers.get('content-length')
        if length:
            env['CONTENT_LENGTH'] = length

        for k, v in self.headers.items():
            k=k.replace('-','_').upper(); v=v.strip()
            if k in env:
                continue                    # skip content length, type,etc.
            if 'HTTP_'+k in env:
                env['HTTP_'+k] += ','+v     # comma-separate multiple headers
            else:
                env['HTTP_'+k] = v
        return env

    def get_stderr(self):
        return sys.stderr

    def handle(self):
        """Handle a single HTTP request"""

        self.raw_requestline = self.rfile.readline(65537)
        if len(self.raw_requestline) > 65536:
            self.requestline = ''
            self.request_version = ''
            self.command = ''
            self.send_error(414)
            return

        if not self.parse_request(): # An error code has been sent, just exit
            return

        handler = ServerHandler(
            self.rfile, self.wfile, self.get_stderr(), self.get_environ(),
            multithread=False,
        )
        handler.request_handler = self      # backpointer for logging
        handler.run(self.server.get_app())



def demo_app(environ,start_response):
    from io import StringIO
    stdout = StringIO()
    print("Hello world!", file=stdout)
    print(file=stdout)
    h = sorted(environ.items())
    for k,v in h:
        print(k,'=',repr(v), file=stdout)
    start_response("200 OK", [('Content-Type','text/plain; charset=utf-8')])
    return [stdout.getvalue().encode("utf-8")]


def make_server(
    host, port, app, server_class=WSGIServer, handler_class=WSGIRequestHandler
):
    """Create a new WSGI server listening on `host` and `port` for `app`"""
    server = server_class((host, port), handler_class)
    server.set_app(app)
    return server


if __name__ == '__main__':
    with make_server('', 8000, demo_app) as httpd:
        sa = httpd.socket.getsockname()
        print("Serving HTTP on", sa[0], "port", sa[1], "...")
        import webbrowser
        webbrowser.open('http://localhost:8000/xyz?abc')
        httpd.handle_request()  # serve one request, then exit
wsgiref/__pycache__/validate.cpython-38.pyc000064400000034645151153537630014670 0ustar00U

e5d�:�@s�dZdgZddlZddlZddlZe�d�Ze�d�ZGdd�de�Z	dd	�Z
d
d�Zdd�ZGd
d�d�Z
Gdd�d�ZGdd�d�ZGdd�d�ZGdd�d�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�ZdS)'a&
Middleware to check for obedience to the WSGI specification.

Some of the things this checks:

* Signature of the application and start_response (including that
  keyword arguments are not used).

* Environment checks:

  - Environment is a dictionary (and not a subclass).

  - That all the required keys are in the environment: REQUEST_METHOD,
    SERVER_NAME, SERVER_PORT, wsgi.version, wsgi.input, wsgi.errors,
    wsgi.multithread, wsgi.multiprocess, wsgi.run_once

  - That HTTP_CONTENT_TYPE and HTTP_CONTENT_LENGTH are not in the
    environment (these headers should appear as CONTENT_LENGTH and
    CONTENT_TYPE).

  - Warns if QUERY_STRING is missing, as the cgi module acts
    unpredictably in that case.

  - That CGI-style variables (that don't contain a .) have
    (non-unicode) string values

  - That wsgi.version is a tuple

  - That wsgi.url_scheme is 'http' or 'https' (@@: is this too
    restrictive?)

  - Warns if the REQUEST_METHOD is not known (@@: probably too
    restrictive).

  - That SCRIPT_NAME and PATH_INFO are empty or start with /

  - That at least one of SCRIPT_NAME or PATH_INFO are set.

  - That CONTENT_LENGTH is a positive integer.

  - That SCRIPT_NAME is not '/' (it should be '', and PATH_INFO should
    be '/').

  - That wsgi.input has the methods read, readline, readlines, and
    __iter__

  - That wsgi.errors has the methods flush, write, writelines

* The status is a string, contains a space, starts with an integer,
  and that integer is in range (> 100).

* That the headers is a list (not a subclass, not another kind of
  sequence).

* That the items of the headers are tuples of strings.

* That there is no 'status' header (that is used in CGI, but not in
  WSGI).

* That the headers don't contain newlines or colons, end in _ or -, or
  contain characters codes below 037.

* That Content-Type is given if there is content (CGI often has a
  default content type, but WSGI does not).

* That no Content-Type is given when there is no content (@@: is this
  too restrictive?)

* That the exc_info argument to start_response is a tuple or None.

* That all calls to the writer are with strings, and no other methods
  on the writer are accessed.

* That wsgi.input is used properly:

  - .read() is called with exactly one argument

  - That it returns a string

  - That readline, readlines, and __iter__ return strings

  - That .close() is not called

  - No other methods are provided

* That wsgi.errors is used properly:

  - .write() and .writelines() is called with a string

  - That .close() is not called, and no other methods are provided.

* The response iterator:

  - That it is not a string (it should be a list of a single string; a
    string will work, but perform horribly).

  - That .__next__() returns a string

  - That the iterator is not iterated over until start_response has
    been called (that can signal either a server or application
    error).

  - That .close() is called (doesn't raise exception, only prints to
    sys.stderr, because we only know it isn't called when the object
    is garbage collected).
�	validator�Nz^[a-zA-Z][a-zA-Z0-9\-_]*$z[\000-\037]c@seZdZdZdS)�WSGIWarningz:
    Raised in response to WSGI-spec-related warnings
    N)�__name__�
__module__�__qualname__�__doc__�rr�(/usr/lib64/python3.8/wsgiref/validate.pyrysrcGs|st|��dS�N)�AssertionError)Zcond�argsrrr	�assert_~sr
cCs(t|�tkr|Std�|t|����dS)Nz!{0} must be of type str (got {1}))�type�strr�format�repr)�value�titlerrr	�check_string_type�s
�rcs�fdd�}|S)a�
    When applied between a WSGI server and a WSGI application, this
    middleware will check for WSGI compliancy on a number of levels.
    This middleware does not modify the request or response in any
    way, but will raise an AssertionError if anything seems off
    (except for a failure to close the application iterator, which
    will be printed to stderr -- there's no way to raise an exception
    at that point).
    cs�tt|�dkd�t|d�|\}�t|�g���fdd�}t|d�|d<t|d�|d<�||�}t|dk	oz|dkd	�t|�t|��S)
N�zTwo arguments required�No keyword arguments allowedcs�tt|�dkpt|�dkd|f�t|d�|d}|d}t|�dkrV|d}nd}t|�t|�t||�t|���d�t�|��S)Nr�zInvalid number of arguments: %srr�)r
�len�check_status�
check_headers�check_content_type�check_exc_info�append�WriteWrapper)r�kw�status�headers�exc_info�Zstart_responseZstart_response_startedrr	�start_response_wrapper�s�


z;validator.<locals>.lint_app.<locals>.start_response_wrapper�
wsgi.input�wsgi.errorsFz>The application must return an iterator, if only an empty list)r
r�
check_environ�InputWrapper�ErrorWrapper�check_iterator�IteratorWrapper)rr �environr%�iterator��applicationr$r	�lint_app�s
�zvalidator.<locals>.lint_appr)r0r1rr/r	r�s)c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)r)cCs
||_dSr
)�input)�self�
wsgi_inputrrr	�__init__�szInputWrapper.__init__cGs0tt|�dk�|jj|�}tt|�tk�|S�Nr)r
rr2�readr�bytes�r3r�vrrr	r7�szInputWrapper.readcGs0tt|�dk�|jj|�}tt|�tk�|Sr6)r
rr2�readlinerr8r9rrr	r;�szInputWrapper.readlinecGsJtt|�dk�|jj|�}tt|�tk�|D]}tt|�tk�q0|Sr6)r
rr2�	readlinesr�listr8)r3r�lines�linerrr	r<�szInputWrapper.readlinesccs|��}|sdS|VqdSr
)r;)r3r?rrr	�__iter__�szInputWrapper.__iter__cCstdd�dS)Nrz input.close() must not be called�r
�r3rrr	�close�szInputWrapper.closeN)	rrrr5r7r;r<r@rCrrrr	r)�sr)c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)r*cCs
||_dSr
)�errors)r3�wsgi_errorsrrr	r5�szErrorWrapper.__init__cCs tt|�tk�|j�|�dSr
)r
rrrD�write�r3�srrr	rF�szErrorWrapper.writecCs|j��dSr
)rD�flushrBrrr	rI�szErrorWrapper.flushcCs|D]}|�|�qdSr
)rF)r3�seqr?rrr	�
writelines�szErrorWrapper.writelinescCstdd�dS)Nrz!errors.close() must not be calledrArBrrr	rC�szErrorWrapper.closeN)rrrr5rFrIrKrCrrrr	r*�s
r*c@seZdZdd�Zdd�ZdS)rcCs
||_dSr
)�writer)r3Zwsgi_writerrrr	r5�szWriteWrapper.__init__cCstt|�tk�|�|�dSr
)r
rr8rLrGrrr	�__call__�szWriteWrapper.__call__N)rrrr5rMrrrr	r�src@seZdZdd�Zdd�ZdS)�PartialIteratorWrappercCs
||_dSr
�r.)r3�
wsgi_iteratorrrr	r5szPartialIteratorWrapper.__init__cCst|jd�Sr
)r,r.rBrrr	r@szPartialIteratorWrapper.__iter__N)rrrr5r@rrrr	rN�srNc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)r,cCs ||_t|�|_d|_||_dS)NF)�original_iterator�iterr.�closed�check_start_response)r3rPrTrrr	r5	s
zIteratorWrapper.__init__cCs|Sr
rrBrrr	r@szIteratorWrapper.__iter__cCsTt|jd�t|j�}t|�tk	r4tdd|f�|jdk	rPt|jd�d|_|S)NzIterator read after closedFz$Iterator yielded non-bytestring (%r)zjThe application returns and we started iterating over its body, but start_response has not yet been called)r
rS�nextr.rr8rT)r3r:rrr	�__next__s�

�zIteratorWrapper.__next__cCs d|_t|jd�r|j��dS)NTrC)rS�hasattrrQrCrBrrr	rCszIteratorWrapper.closecCs"|jstj�d�t|jd�dS)Nz/Iterator garbage collected without being closed)rS�sys�stderrrFr
rBrrr	�__del__#s��zIteratorWrapper.__del__N)rrrr5r@rVrCrZrrrr	r,s
r,cCs�tt|�tkdt|�|f�dD]}t||kd|f�q"dD]"}t||kd||dd�f�q@d|krxt�dt�|��D]:}d	|kr�q�tt||�tkd
|t||�||f�q�tt|d�tkd|df�t|d
dkd|d
�t	|d�t
|d�|ddk�r0t�d|dt�t|�d��pL|d�d�d|d�t|�d��pv|d�d�d|d�|�d��r�tt
|d�dkd|d�|�d��s�td|kd�t|�d�dkd�dS)Nz:Environment is not of the right type: %r (environment: %r))	�REQUEST_METHODZSERVER_NAMEZSERVER_PORT�wsgi.versionr&r'zwsgi.multithreadzwsgi.multiprocessz
wsgi.run_oncez$Environment missing required key: %r)ZHTTP_CONTENT_TYPEZHTTP_CONTENT_LENGTHz8Environment should not have the key: %s (use %s instead)�ZQUERY_STRINGz�QUERY_STRING is not in the WSGI environment; the cgi module will use sys.argv when this variable is missing, so application errors are more likely�.z9Environmental variable %s is not a string: %r (value: %r)r\z#wsgi.version should be a tuple (%r)zwsgi.url_scheme)ZhttpZhttpszwsgi.url_scheme unknown: %rr&r'r[)ZGETZHEADZPOSTZOPTIONSZPATCHZPUTZDELETEZTRACEzUnknown REQUEST_METHOD: %rZSCRIPT_NAME�/z$SCRIPT_NAME doesn't start with /: %rZ	PATH_INFOz"PATH_INFO doesn't start with /: %rZCONTENT_LENGTHrzInvalid CONTENT_LENGTH: %rzgOne of SCRIPT_NAME or PATH_INFO are required (PATH_INFO should at least be '/' if SCRIPT_NAME is empty)zOSCRIPT_NAME cannot be '/'; it should instead be '', and PATH_INFO should be '/')r
r�dict�warnings�warnr�keysr�tuple�check_input�check_errors�get�
startswith�int)r-�keyrrr	r(*sx
���������
�
�
�
�
���r(cCs&dD]}tt||�d||f�qdS)N)r7r;r<r@z-wsgi.input (%r) doesn't have the attribute %s�r
rW)r4�attrrrr	reks
��recCs&dD]}tt||�d||f�qdS)N)rIrFrKz.wsgi.errors (%r) doesn't have the attribute %srk)rErlrrr	rfqs
��rfcCsvt|d�}|�dd�d}tt|�dkd|�t|�}t|dkd|�t|�dksb|dd	krrt�d
|t�dS)N�Statusrrrz)Status codes must be three characters: %r�dzStatus code is invalid: %r�� zjThe status string (%r) should be a three-digit integer followed by a single space and a status explanation)r�splitr
rrirarbr)r!Zstatus_codeZ
status_intrrr	rws
���rcCstt|�tkd|t|�f�|D]�}tt|�tkd|t|�f�tt|�dk�|\}}t|d�}t|d�}t|��dkd|�td|ko�d	|kd
|�tt�|�d|�t|�	d�o�|�	d
�d|�t
�|�r"tdd|t
�|��d�f�q"dS)Nz%Headers (%r) must be of type list: %rz1Individual headers (%r) must be of type tuple: %rr�Header namezHeader valuer!zyThe Status header cannot be used; it conflicts with CGI script, and HTTP status is not given through headers (value: %r).�
�:z,Header names may not contain ':' or '\n': %rzBad header name: %r�-�_z#Names may not end in '-' or '_': %rrz#Bad header value: %r (bad char: %r))r
rr=rdrr�lower�	header_re�search�endswith�bad_header_value_re�group)r"�item�namerrrr	r�s>
��
��

����
�rcCs|t|d�}t|�dd�d�}d}|D]:\}}t|d�}|��dkr&||krRdStdd|�q&||krxtdd|�dS)	Nrmrr)��i0rrzcontent-typezJContent-Type header found in a %s response, which must not return content.z,No Content-Type header found in headers (%s))rrirqrwr
)r!r"�codeZNO_MESSAGE_BODYr~rrrr	r�s

�rcCs*t|dkpt|�tkd|t|�f�dS)Nz exc_info (%r) is not a tuple: %r)r
rrd)r#rrr	r�s�rcCstt|ttf�d�dS)NzwYou should not return a string as your application iterator, instead return a single-item list containing a bytestring.)r
�
isinstancerr8rOrrr	r+�s�r+)r�__all__�rerXra�compilerxr{�Warningrr
rrr)r*rrNr,r(rerfrrrrr+rrrr	�<module>s.j

7#		#Awsgiref/__pycache__/validate.cpython-38.opt-2.pyc000064400000025564151153537630015630 0ustar00U

e5d�:�@s�dgZddlZddlZddlZe�d�Ze�d�ZGdd�de�Zdd�Z	d	d
�Z
dd�ZGdd
�d
�ZGdd�d�Z
Gdd�d�ZGdd�d�ZGdd�d�Zdd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�ZdS)&�	validator�Nz^[a-zA-Z][a-zA-Z0-9\-_]*$z[\000-\037]c@seZdZdS)�WSGIWarningN)�__name__�
__module__�__qualname__�rr�(/usr/lib64/python3.8/wsgiref/validate.pyrysrcGs|st|��dS�N)�AssertionError)Zcond�argsrrr�assert_~srcCs(t|�tkr|Std�|t|����dS)Nz!{0} must be of type str (got {1}))�type�strr
�format�repr)�value�titlerrr�check_string_type�s
�rcs�fdd�}|S)Ncs�tt|�dkd�t|d�|\}�t|�g���fdd�}t|d�|d<t|d�|d<�||�}t|dk	oz|dkd	�t|�t|��S)
N�zTwo arguments required�No keyword arguments allowedcs�tt|�dkpt|�dkd|f�t|d�|d}|d}t|�dkrV|d}nd}t|�t|�t||�t|���d�t�|��S)Nr�zInvalid number of arguments: %srr�)r�len�check_status�
check_headers�check_content_type�check_exc_info�append�WriteWrapper)r�kw�status�headers�exc_info�Zstart_responseZstart_response_startedrr�start_response_wrapper�s�


z;validator.<locals>.lint_app.<locals>.start_response_wrapper�
wsgi.input�wsgi.errorsFz>The application must return an iterator, if only an empty list)rr�
check_environ�InputWrapper�ErrorWrapper�check_iterator�IteratorWrapper)rr�environr$�iterator��applicationr#r�lint_app�s
�zvalidator.<locals>.lint_appr)r/r0rr.rr�s)c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)r(cCs
||_dSr	)�input)�self�
wsgi_inputrrr�__init__�szInputWrapper.__init__cGs0tt|�dk�|jj|�}tt|�tk�|S�Nr)rrr1�readr
�bytes�r2r�vrrrr6�szInputWrapper.readcGs0tt|�dk�|jj|�}tt|�tk�|Sr5)rrr1�readliner
r7r8rrrr:�szInputWrapper.readlinecGsJtt|�dk�|jj|�}tt|�tk�|D]}tt|�tk�q0|Sr5)rrr1�	readlinesr
�listr7)r2r�lines�linerrrr;�szInputWrapper.readlinesccs|��}|sdS|VqdSr	)r:)r2r>rrr�__iter__�szInputWrapper.__iter__cCstdd�dS)Nrz input.close() must not be called�r�r2rrr�close�szInputWrapper.closeN)	rrrr4r6r:r;r?rBrrrrr(�sr(c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)r)cCs
||_dSr	)�errors)r2�wsgi_errorsrrrr4�szErrorWrapper.__init__cCs tt|�tk�|j�|�dSr	)rr
rrC�write�r2�srrrrE�szErrorWrapper.writecCs|j��dSr	)rC�flushrArrrrH�szErrorWrapper.flushcCs|D]}|�|�qdSr	)rE)r2�seqr>rrr�
writelines�szErrorWrapper.writelinescCstdd�dS)Nrz!errors.close() must not be calledr@rArrrrB�szErrorWrapper.closeN)rrrr4rErHrJrBrrrrr)�s
r)c@seZdZdd�Zdd�ZdS)rcCs
||_dSr	)�writer)r2Zwsgi_writerrrrr4�szWriteWrapper.__init__cCstt|�tk�|�|�dSr	)rr
r7rKrFrrr�__call__�szWriteWrapper.__call__N)rrrr4rLrrrrr�src@seZdZdd�Zdd�ZdS)�PartialIteratorWrappercCs
||_dSr	�r-)r2�
wsgi_iteratorrrrr4szPartialIteratorWrapper.__init__cCst|jd�Sr	)r+r-rArrrr?szPartialIteratorWrapper.__iter__N)rrrr4r?rrrrrM�srMc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)r+cCs ||_t|�|_d|_||_dS)NF)�original_iterator�iterr-�closed�check_start_response)r2rOrSrrrr4	s
zIteratorWrapper.__init__cCs|Sr	rrArrrr?szIteratorWrapper.__iter__cCsTt|jd�t|j�}t|�tk	r4tdd|f�|jdk	rPt|jd�d|_|S)NzIterator read after closedFz$Iterator yielded non-bytestring (%r)zjThe application returns and we started iterating over its body, but start_response has not yet been called)rrR�nextr-r
r7rS)r2r9rrr�__next__s�

�zIteratorWrapper.__next__cCs d|_t|jd�r|j��dS)NTrB)rR�hasattrrPrBrArrrrBszIteratorWrapper.closecCs"|jstj�d�t|jd�dS)Nz/Iterator garbage collected without being closed)rR�sys�stderrrErrArrr�__del__#s��zIteratorWrapper.__del__N)rrrr4r?rUrBrYrrrrr+s
r+cCs�tt|�tkdt|�|f�dD]}t||kd|f�q"dD]"}t||kd||dd�f�q@d|krxt�dt�|��D]:}d	|kr�q�tt||�tkd
|t||�||f�q�tt|d�tkd|df�t|d
dkd|d
�t	|d�t
|d�|ddk�r0t�d|dt�t|�d��pL|d�d�d|d�t|�d��pv|d�d�d|d�|�d��r�tt
|d�dkd|d�|�d��s�td|kd�t|�d�dkd�dS)Nz:Environment is not of the right type: %r (environment: %r))	�REQUEST_METHODZSERVER_NAMEZSERVER_PORT�wsgi.versionr%r&zwsgi.multithreadzwsgi.multiprocessz
wsgi.run_oncez$Environment missing required key: %r)ZHTTP_CONTENT_TYPEZHTTP_CONTENT_LENGTHz8Environment should not have the key: %s (use %s instead)�ZQUERY_STRINGz�QUERY_STRING is not in the WSGI environment; the cgi module will use sys.argv when this variable is missing, so application errors are more likely�.z9Environmental variable %s is not a string: %r (value: %r)r[z#wsgi.version should be a tuple (%r)zwsgi.url_scheme)ZhttpZhttpszwsgi.url_scheme unknown: %rr%r&rZ)ZGETZHEADZPOSTZOPTIONSZPATCHZPUTZDELETEZTRACEzUnknown REQUEST_METHOD: %rZSCRIPT_NAME�/z$SCRIPT_NAME doesn't start with /: %rZ	PATH_INFOz"PATH_INFO doesn't start with /: %rZCONTENT_LENGTHrzInvalid CONTENT_LENGTH: %rzgOne of SCRIPT_NAME or PATH_INFO are required (PATH_INFO should at least be '/' if SCRIPT_NAME is empty)zOSCRIPT_NAME cannot be '/'; it should instead be '', and PATH_INFO should be '/')rr
�dict�warnings�warnr�keysr�tuple�check_input�check_errors�get�
startswith�int)r,�keyrrrr'*sx
���������
�
�
�
�
���r'cCs&dD]}tt||�d||f�qdS)N)r6r:r;r?z-wsgi.input (%r) doesn't have the attribute %s�rrV)r3�attrrrrrdks
��rdcCs&dD]}tt||�d||f�qdS)N)rHrErJz.wsgi.errors (%r) doesn't have the attribute %srj)rDrkrrrreqs
��recCsvt|d�}|�dd�d}tt|�dkd|�t|�}t|dkd|�t|�dksb|dd	krrt�d
|t�dS)N�Statusrrrz)Status codes must be three characters: %r�dzStatus code is invalid: %r�� zjThe status string (%r) should be a three-digit integer followed by a single space and a status explanation)r�splitrrrhr`rar)r Zstatus_codeZ
status_intrrrrws
���rcCstt|�tkd|t|�f�|D]�}tt|�tkd|t|�f�tt|�dk�|\}}t|d�}t|d�}t|��dkd|�td|ko�d	|kd
|�tt�|�d|�t|�	d�o�|�	d
�d|�t
�|�r"tdd|t
�|��d�f�q"dS)Nz%Headers (%r) must be of type list: %rz1Individual headers (%r) must be of type tuple: %rr�Header namezHeader valuer zyThe Status header cannot be used; it conflicts with CGI script, and HTTP status is not given through headers (value: %r).�
�:z,Header names may not contain ':' or '\n': %rzBad header name: %r�-�_z#Names may not end in '-' or '_': %rrz#Bad header value: %r (bad char: %r))rr
r<rcrr�lower�	header_re�search�endswith�bad_header_value_re�group)r!�item�namerrrrr�s>
��
��

����
�rcCs|t|d�}t|�dd�d�}d}|D]:\}}t|d�}|��dkr&||krRdStdd|�q&||krxtdd|�dS)	Nrlrr)��i0rqzcontent-typezJContent-Type header found in a %s response, which must not return content.z,No Content-Type header found in headers (%s))rrhrprvr)r r!�codeZNO_MESSAGE_BODYr}rrrrr�s

�rcCs*t|dkpt|�tkd|t|�f�dS)Nz exc_info (%r) is not a tuple: %r)rr
rc)r"rrrr�s�rcCstt|ttf�d�dS)NzwYou should not return a string as your application iterator, instead return a single-item list containing a bytestring.)r�
isinstancerr7rNrrrr*�s�r*)�__all__�rerWr`�compilerwrz�Warningrrrrr(r)rrMr+r'rdrerrrrr*rrrr�<module>os,

7#		#Awsgiref/__pycache__/headers.cpython-38.opt-1.pyc000064400000017031151153537630015437 0ustar00U

e5dn�@s2dZddlZe�d�Zd	dd�ZGdd�d�ZdS)
z�Manage HTTP Response Headers

Much of this module is red-handedly pilfered from email.message in the stdlib,
so portions are Copyright (C) 2001,2002 Python Software Foundation, and were
written by Barry Warsaw.
�Nz[ \(\)<>@,;:\\"/\[\]\?=]�cCsX|dk	rPt|�dkrP|s"t�|�rB|�dd��dd�}d||fSd||fSn|SdS)	z~Convenience function to format and return a key=value pair.

    This will quote the value if needed or if quote is true.
    Nr�\z\\�"z\"z%s="%s"z%s=%s)�len�	tspecials�search�replace)Zparam�valueZquote�r
�'/usr/lib64/python3.8/wsgiref/headers.py�_formatparam
src@s�eZdZdZd%dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zd&dd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�ZdS)'�Headersz,Manage a collection of HTTP response headersNcCs.|dk	r|ng}t|�tk	r$td��||_dS)Nz+Headers must be a list of name/value tuples)�type�list�	TypeError�_headers)�selfZheadersr
r
r�__init__s
zHeaders.__init__cCs&t|�tkr|Std�t|����dS)zConvert/check value type.z1Header names/values must be of type str (got {0})N)r�str�AssertionError�format�repr)rr	r
r
r�_convert_string_type)s
�zHeaders._convert_string_typecCs
t|j�S)z9Return the total number of headers, including duplicates.)rr�rr
r
r�__len__0szHeaders.__len__cCs&||=|j�|�|�|�|�f�dS)zSet the value of a header.N)r�appendr)r�name�valr
r
r�__setitem__4s�zHeaders.__setitem__cs0|�������fdd�|jD�|jdd�<dS)zyDelete all occurrences of a header, if present.

        Does *not* raise an exception if the header is missing.
        cs g|]}|d���kr|�qS)r��lower��.0Zkv�rr
r�
<listcomp>@sz'Headers.__delitem__.<locals>.<listcomp>N�rr r�rrr
r#r�__delitem__:szHeaders.__delitem__cCs
|�|�S)aHGet the first header value for 'name'

        Return None if the header is missing instead of raising an exception.

        Note that if the header appeared multiple times, the first exactly which
        occurrence gets returned is undefined.  Use getall() to get all
        the values matching a header field name.
        ��getr&r
r
r�__getitem__Bs	zHeaders.__getitem__cCs|�|�dk	S)z/Return true if the message contains the header.Nr(r&r
r
r�__contains__MszHeaders.__contains__cs"|�������fdd�|jD�S)aqReturn a list of all the values for the named field.

        These will be sorted in the order they appeared in the original header
        list or were added to this instance, and may contain duplicates.  Any
        fields deleted and re-inserted are always appended to the header list.
        If no fields exist with the given name, returns an empty list.
        cs$g|]}|d���kr|d�qS)rrrr!r#r
rr$[sz#Headers.get_all.<locals>.<listcomp>r%r&r
r#r�get_allRszHeaders.get_allcCs6|�|���}|jD]\}}|��|kr|Sq|S)z:Get the first header value for 'name', or return 'default'r%)rr�default�k�vr
r
rr)^s

zHeaders.getcCsdd�|jD�S)a*Return a list of all the header field names.

        These will be sorted in the order they appeared in the original header
        list, or were added to this instance, and may contain duplicates.
        Any fields deleted and re-inserted are always appended to the header
        list.
        cSsg|]\}}|�qSr
r
�r"r.r/r
r
rr$osz Headers.keys.<locals>.<listcomp>�rrr
r
r�keysgszHeaders.keyscCsdd�|jD�S)a!Return a list of all header values.

        These will be sorted in the order they appeared in the original header
        list, or were added to this instance, and may contain duplicates.
        Any fields deleted and re-inserted are always appended to the header
        list.
        cSsg|]\}}|�qSr
r
r0r
r
rr$ysz"Headers.values.<locals>.<listcomp>r1rr
r
r�valuesqszHeaders.valuescCs|jdd�S)aGet all the header fields and values.

        These will be sorted in the order they were in the original header
        list, or were added to this instance, and may contain duplicates.
        Any fields deleted and re-inserted are always appended to the header
        list.
        Nr1rr
r
r�items{sz
Headers.itemscCsd|jj|jfS)Nz%s(%r))�	__class__�__name__rrr
r
r�__repr__�szHeaders.__repr__cCsd�dd�|jD�ddg�S)zkstr() returns the formatted headers, complete with end line,
        suitable for direct HTTP transmission.z
cSsg|]}d|�qS)z%s: %sr
r!r
r
rr$�sz#Headers.__str__.<locals>.<listcomp>�)�joinrrr
r
r�__str__�szHeaders.__str__cCst|��d�S)Nz
iso-8859-1)r�encoderr
r
r�	__bytes__�szHeaders.__bytes__cCs:|�|�}|dkr2|j�|�|�|�|�f�|S|SdS)z�Return first matching header value for 'name', or 'value'

        If there is no header named 'name', add a new header with name 'name'
        and value 'value'.N)r)rrr)rrr	�resultr
r
r�
setdefault�s
�zHeaders.setdefaultcKs�g}|dk	r |�|�}|�|�|��D]P\}}|�|�}|dkrV|�|�dd��q(|�|�}|�t|�dd�|��q(|j�|�|�d�|�f�dS)afExtended header setting.

        _name is the header field to add.  keyword arguments can be used to set
        additional parameters for the header field, with underscores converted
        to dashes.  Normally the parameter will be added as key="value" unless
        value is None, in which case only the key will be added.

        Example:

        h.add_header('content-disposition', 'attachment', filename='bud.gif')

        Note that unlike the corresponding 'email.message' method, this does
        *not* handle '(charset, language, value)' tuples: all values must be
        strings or None.
        N�_�-z; )rrr4rrrr9)r�_nameZ_valueZ_params�partsr.r/r
r
r�
add_header�s



zHeaders.add_header)N)N)r6�
__module__�__qualname__�__doc__rrrrr'r*r+r,r)r2r3r4r7r:r<r>rCr
r
r
rr
s$


	



r
)Nr)rF�re�compilerrr
r
r
r
r�<module>s	

wsgiref/__pycache__/headers.cpython-38.pyc000064400000017116151153537630014504 0ustar00U

e5dn�@s2dZddlZe�d�Zd	dd�ZGdd�d�ZdS)
z�Manage HTTP Response Headers

Much of this module is red-handedly pilfered from email.message in the stdlib,
so portions are Copyright (C) 2001,2002 Python Software Foundation, and were
written by Barry Warsaw.
�Nz[ \(\)<>@,;:\\"/\[\]\?=]�cCsX|dk	rPt|�dkrP|s"t�|�rB|�dd��dd�}d||fSd||fSn|SdS)	z~Convenience function to format and return a key=value pair.

    This will quote the value if needed or if quote is true.
    Nr�\z\\�"z\"z%s="%s"z%s=%s)�len�	tspecials�search�replace)Zparam�valueZquote�r
�'/usr/lib64/python3.8/wsgiref/headers.py�_formatparam
src@s�eZdZdZd%dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zd&dd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�ZdS)'�Headersz,Manage a collection of HTTP response headersNcCsP|dk	r|ng}t|�tk	r$td��||_|D]\}}|�|�|�|�q.dS)Nz+Headers must be a list of name/value tuples)�type�list�	TypeError�_headers�_convert_string_type)�selfZheaders�k�vr
r
r�__init__s
zHeaders.__init__cCs&t|�tkr|Std�t|����dS)zConvert/check value type.z1Header names/values must be of type str (got {0})N)r�str�AssertionError�format�repr)rr	r
r
rr)s
�zHeaders._convert_string_typecCs
t|j�S)z9Return the total number of headers, including duplicates.)rr�rr
r
r�__len__0szHeaders.__len__cCs&||=|j�|�|�|�|�f�dS)zSet the value of a header.N)r�appendr)r�name�valr
r
r�__setitem__4s�zHeaders.__setitem__cs0|�������fdd�|jD�|jdd�<dS)zyDelete all occurrences of a header, if present.

        Does *not* raise an exception if the header is missing.
        cs g|]}|d���kr|�qS)r��lower��.0Zkv�rr
r�
<listcomp>@sz'Headers.__delitem__.<locals>.<listcomp>N�rr"r�rrr
r%r�__delitem__:szHeaders.__delitem__cCs
|�|�S)aHGet the first header value for 'name'

        Return None if the header is missing instead of raising an exception.

        Note that if the header appeared multiple times, the first exactly which
        occurrence gets returned is undefined.  Use getall() to get all
        the values matching a header field name.
        ��getr(r
r
r�__getitem__Bs	zHeaders.__getitem__cCs|�|�dk	S)z/Return true if the message contains the header.Nr*r(r
r
r�__contains__MszHeaders.__contains__cs"|�������fdd�|jD�S)aqReturn a list of all the values for the named field.

        These will be sorted in the order they appeared in the original header
        list or were added to this instance, and may contain duplicates.  Any
        fields deleted and re-inserted are always appended to the header list.
        If no fields exist with the given name, returns an empty list.
        cs$g|]}|d���kr|d�qS)rrr!r#r%r
rr&[sz#Headers.get_all.<locals>.<listcomp>r'r(r
r%r�get_allRszHeaders.get_allcCs6|�|���}|jD]\}}|��|kr|Sq|S)z:Get the first header value for 'name', or return 'default'r')rr�defaultrrr
r
rr+^s

zHeaders.getcCsdd�|jD�S)a*Return a list of all the header field names.

        These will be sorted in the order they appeared in the original header
        list, or were added to this instance, and may contain duplicates.
        Any fields deleted and re-inserted are always appended to the header
        list.
        cSsg|]\}}|�qSr
r
�r$rrr
r
rr&osz Headers.keys.<locals>.<listcomp>�rrr
r
r�keysgszHeaders.keyscCsdd�|jD�S)a!Return a list of all header values.

        These will be sorted in the order they appeared in the original header
        list, or were added to this instance, and may contain duplicates.
        Any fields deleted and re-inserted are always appended to the header
        list.
        cSsg|]\}}|�qSr
r
r0r
r
rr&ysz"Headers.values.<locals>.<listcomp>r1rr
r
r�valuesqszHeaders.valuescCs|jdd�S)aGet all the header fields and values.

        These will be sorted in the order they were in the original header
        list, or were added to this instance, and may contain duplicates.
        Any fields deleted and re-inserted are always appended to the header
        list.
        Nr1rr
r
r�items{sz
Headers.itemscCsd|jj|jfS)Nz%s(%r))�	__class__�__name__rrr
r
r�__repr__�szHeaders.__repr__cCsd�dd�|jD�ddg�S)zkstr() returns the formatted headers, complete with end line,
        suitable for direct HTTP transmission.z
cSsg|]}d|�qS)z%s: %sr
r#r
r
rr&�sz#Headers.__str__.<locals>.<listcomp>�)�joinrrr
r
r�__str__�szHeaders.__str__cCst|��d�S)Nz
iso-8859-1)r�encoderr
r
r�	__bytes__�szHeaders.__bytes__cCs:|�|�}|dkr2|j�|�|�|�|�f�|S|SdS)z�Return first matching header value for 'name', or 'value'

        If there is no header named 'name', add a new header with name 'name'
        and value 'value'.N)r+rrr)rrr	�resultr
r
r�
setdefault�s
�zHeaders.setdefaultcKs�g}|dk	r |�|�}|�|�|��D]P\}}|�|�}|dkrV|�|�dd��q(|�|�}|�t|�dd�|��q(|j�|�|�d�|�f�dS)afExtended header setting.

        _name is the header field to add.  keyword arguments can be used to set
        additional parameters for the header field, with underscores converted
        to dashes.  Normally the parameter will be added as key="value" unless
        value is None, in which case only the key will be added.

        Example:

        h.add_header('content-disposition', 'attachment', filename='bud.gif')

        Note that unlike the corresponding 'email.message' method, this does
        *not* handle '(charset, language, value)' tuples: all values must be
        strings or None.
        N�_�-z; )rrr4rrrr9)r�_nameZ_valueZ_params�partsrrr
r
r�
add_header�s



zHeaders.add_header)N)N)r6�
__module__�__qualname__�__doc__rrrr r)r,r-r.r+r2r3r4r7r:r<r>rCr
r
r
rr
s$


	



r
)Nr)rF�re�compilerrr
r
r
r
r�<module>s	

wsgiref/__pycache__/validate.cpython-38.opt-1.pyc000064400000034645151153537630015627 0ustar00U

e5d�:�@s�dZdgZddlZddlZddlZe�d�Ze�d�ZGdd�de�Z	dd	�Z
d
d�Zdd�ZGd
d�d�Z
Gdd�d�ZGdd�d�ZGdd�d�ZGdd�d�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�ZdS)'a&
Middleware to check for obedience to the WSGI specification.

Some of the things this checks:

* Signature of the application and start_response (including that
  keyword arguments are not used).

* Environment checks:

  - Environment is a dictionary (and not a subclass).

  - That all the required keys are in the environment: REQUEST_METHOD,
    SERVER_NAME, SERVER_PORT, wsgi.version, wsgi.input, wsgi.errors,
    wsgi.multithread, wsgi.multiprocess, wsgi.run_once

  - That HTTP_CONTENT_TYPE and HTTP_CONTENT_LENGTH are not in the
    environment (these headers should appear as CONTENT_LENGTH and
    CONTENT_TYPE).

  - Warns if QUERY_STRING is missing, as the cgi module acts
    unpredictably in that case.

  - That CGI-style variables (that don't contain a .) have
    (non-unicode) string values

  - That wsgi.version is a tuple

  - That wsgi.url_scheme is 'http' or 'https' (@@: is this too
    restrictive?)

  - Warns if the REQUEST_METHOD is not known (@@: probably too
    restrictive).

  - That SCRIPT_NAME and PATH_INFO are empty or start with /

  - That at least one of SCRIPT_NAME or PATH_INFO are set.

  - That CONTENT_LENGTH is a positive integer.

  - That SCRIPT_NAME is not '/' (it should be '', and PATH_INFO should
    be '/').

  - That wsgi.input has the methods read, readline, readlines, and
    __iter__

  - That wsgi.errors has the methods flush, write, writelines

* The status is a string, contains a space, starts with an integer,
  and that integer is in range (> 100).

* That the headers is a list (not a subclass, not another kind of
  sequence).

* That the items of the headers are tuples of strings.

* That there is no 'status' header (that is used in CGI, but not in
  WSGI).

* That the headers don't contain newlines or colons, end in _ or -, or
  contain characters codes below 037.

* That Content-Type is given if there is content (CGI often has a
  default content type, but WSGI does not).

* That no Content-Type is given when there is no content (@@: is this
  too restrictive?)

* That the exc_info argument to start_response is a tuple or None.

* That all calls to the writer are with strings, and no other methods
  on the writer are accessed.

* That wsgi.input is used properly:

  - .read() is called with exactly one argument

  - That it returns a string

  - That readline, readlines, and __iter__ return strings

  - That .close() is not called

  - No other methods are provided

* That wsgi.errors is used properly:

  - .write() and .writelines() is called with a string

  - That .close() is not called, and no other methods are provided.

* The response iterator:

  - That it is not a string (it should be a list of a single string; a
    string will work, but perform horribly).

  - That .__next__() returns a string

  - That the iterator is not iterated over until start_response has
    been called (that can signal either a server or application
    error).

  - That .close() is called (doesn't raise exception, only prints to
    sys.stderr, because we only know it isn't called when the object
    is garbage collected).
�	validator�Nz^[a-zA-Z][a-zA-Z0-9\-_]*$z[\000-\037]c@seZdZdZdS)�WSGIWarningz:
    Raised in response to WSGI-spec-related warnings
    N)�__name__�
__module__�__qualname__�__doc__�rr�(/usr/lib64/python3.8/wsgiref/validate.pyrysrcGs|st|��dS�N)�AssertionError)Zcond�argsrrr	�assert_~sr
cCs(t|�tkr|Std�|t|����dS)Nz!{0} must be of type str (got {1}))�type�strr�format�repr)�value�titlerrr	�check_string_type�s
�rcs�fdd�}|S)a�
    When applied between a WSGI server and a WSGI application, this
    middleware will check for WSGI compliancy on a number of levels.
    This middleware does not modify the request or response in any
    way, but will raise an AssertionError if anything seems off
    (except for a failure to close the application iterator, which
    will be printed to stderr -- there's no way to raise an exception
    at that point).
    cs�tt|�dkd�t|d�|\}�t|�g���fdd�}t|d�|d<t|d�|d<�||�}t|dk	oz|dkd	�t|�t|��S)
N�zTwo arguments required�No keyword arguments allowedcs�tt|�dkpt|�dkd|f�t|d�|d}|d}t|�dkrV|d}nd}t|�t|�t||�t|���d�t�|��S)Nr�zInvalid number of arguments: %srr�)r
�len�check_status�
check_headers�check_content_type�check_exc_info�append�WriteWrapper)r�kw�status�headers�exc_info�Zstart_responseZstart_response_startedrr	�start_response_wrapper�s�


z;validator.<locals>.lint_app.<locals>.start_response_wrapper�
wsgi.input�wsgi.errorsFz>The application must return an iterator, if only an empty list)r
r�
check_environ�InputWrapper�ErrorWrapper�check_iterator�IteratorWrapper)rr �environr%�iterator��applicationr$r	�lint_app�s
�zvalidator.<locals>.lint_appr)r0r1rr/r	r�s)c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)r)cCs
||_dSr
)�input)�self�
wsgi_inputrrr	�__init__�szInputWrapper.__init__cGs0tt|�dk�|jj|�}tt|�tk�|S�Nr)r
rr2�readr�bytes�r3r�vrrr	r7�szInputWrapper.readcGs0tt|�dk�|jj|�}tt|�tk�|Sr6)r
rr2�readlinerr8r9rrr	r;�szInputWrapper.readlinecGsJtt|�dk�|jj|�}tt|�tk�|D]}tt|�tk�q0|Sr6)r
rr2�	readlinesr�listr8)r3r�lines�linerrr	r<�szInputWrapper.readlinesccs|��}|sdS|VqdSr
)r;)r3r?rrr	�__iter__�szInputWrapper.__iter__cCstdd�dS)Nrz input.close() must not be called�r
�r3rrr	�close�szInputWrapper.closeN)	rrrr5r7r;r<r@rCrrrr	r)�sr)c@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)r*cCs
||_dSr
)�errors)r3�wsgi_errorsrrr	r5�szErrorWrapper.__init__cCs tt|�tk�|j�|�dSr
)r
rrrD�write�r3�srrr	rF�szErrorWrapper.writecCs|j��dSr
)rD�flushrBrrr	rI�szErrorWrapper.flushcCs|D]}|�|�qdSr
)rF)r3�seqr?rrr	�
writelines�szErrorWrapper.writelinescCstdd�dS)Nrz!errors.close() must not be calledrArBrrr	rC�szErrorWrapper.closeN)rrrr5rFrIrKrCrrrr	r*�s
r*c@seZdZdd�Zdd�ZdS)rcCs
||_dSr
)�writer)r3Zwsgi_writerrrr	r5�szWriteWrapper.__init__cCstt|�tk�|�|�dSr
)r
rr8rLrGrrr	�__call__�szWriteWrapper.__call__N)rrrr5rMrrrr	r�src@seZdZdd�Zdd�ZdS)�PartialIteratorWrappercCs
||_dSr
�r.)r3�
wsgi_iteratorrrr	r5szPartialIteratorWrapper.__init__cCst|jd�Sr
)r,r.rBrrr	r@szPartialIteratorWrapper.__iter__N)rrrr5r@rrrr	rN�srNc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)r,cCs ||_t|�|_d|_||_dS)NF)�original_iterator�iterr.�closed�check_start_response)r3rPrTrrr	r5	s
zIteratorWrapper.__init__cCs|Sr
rrBrrr	r@szIteratorWrapper.__iter__cCsTt|jd�t|j�}t|�tk	r4tdd|f�|jdk	rPt|jd�d|_|S)NzIterator read after closedFz$Iterator yielded non-bytestring (%r)zjThe application returns and we started iterating over its body, but start_response has not yet been called)r
rS�nextr.rr8rT)r3r:rrr	�__next__s�

�zIteratorWrapper.__next__cCs d|_t|jd�r|j��dS)NTrC)rS�hasattrrQrCrBrrr	rCszIteratorWrapper.closecCs"|jstj�d�t|jd�dS)Nz/Iterator garbage collected without being closed)rS�sys�stderrrFr
rBrrr	�__del__#s��zIteratorWrapper.__del__N)rrrr5r@rVrCrZrrrr	r,s
r,cCs�tt|�tkdt|�|f�dD]}t||kd|f�q"dD]"}t||kd||dd�f�q@d|krxt�dt�|��D]:}d	|kr�q�tt||�tkd
|t||�||f�q�tt|d�tkd|df�t|d
dkd|d
�t	|d�t
|d�|ddk�r0t�d|dt�t|�d��pL|d�d�d|d�t|�d��pv|d�d�d|d�|�d��r�tt
|d�dkd|d�|�d��s�td|kd�t|�d�dkd�dS)Nz:Environment is not of the right type: %r (environment: %r))	�REQUEST_METHODZSERVER_NAMEZSERVER_PORT�wsgi.versionr&r'zwsgi.multithreadzwsgi.multiprocessz
wsgi.run_oncez$Environment missing required key: %r)ZHTTP_CONTENT_TYPEZHTTP_CONTENT_LENGTHz8Environment should not have the key: %s (use %s instead)�ZQUERY_STRINGz�QUERY_STRING is not in the WSGI environment; the cgi module will use sys.argv when this variable is missing, so application errors are more likely�.z9Environmental variable %s is not a string: %r (value: %r)r\z#wsgi.version should be a tuple (%r)zwsgi.url_scheme)ZhttpZhttpszwsgi.url_scheme unknown: %rr&r'r[)ZGETZHEADZPOSTZOPTIONSZPATCHZPUTZDELETEZTRACEzUnknown REQUEST_METHOD: %rZSCRIPT_NAME�/z$SCRIPT_NAME doesn't start with /: %rZ	PATH_INFOz"PATH_INFO doesn't start with /: %rZCONTENT_LENGTHrzInvalid CONTENT_LENGTH: %rzgOne of SCRIPT_NAME or PATH_INFO are required (PATH_INFO should at least be '/' if SCRIPT_NAME is empty)zOSCRIPT_NAME cannot be '/'; it should instead be '', and PATH_INFO should be '/')r
r�dict�warnings�warnr�keysr�tuple�check_input�check_errors�get�
startswith�int)r-�keyrrr	r(*sx
���������
�
�
�
�
���r(cCs&dD]}tt||�d||f�qdS)N)r7r;r<r@z-wsgi.input (%r) doesn't have the attribute %s�r
rW)r4�attrrrr	reks
��recCs&dD]}tt||�d||f�qdS)N)rIrFrKz.wsgi.errors (%r) doesn't have the attribute %srk)rErlrrr	rfqs
��rfcCsvt|d�}|�dd�d}tt|�dkd|�t|�}t|dkd|�t|�dksb|dd	krrt�d
|t�dS)N�Statusrrrz)Status codes must be three characters: %r�dzStatus code is invalid: %r�� zjThe status string (%r) should be a three-digit integer followed by a single space and a status explanation)r�splitr
rrirarbr)r!Zstatus_codeZ
status_intrrr	rws
���rcCstt|�tkd|t|�f�|D]�}tt|�tkd|t|�f�tt|�dk�|\}}t|d�}t|d�}t|��dkd|�td|ko�d	|kd
|�tt�|�d|�t|�	d�o�|�	d
�d|�t
�|�r"tdd|t
�|��d�f�q"dS)Nz%Headers (%r) must be of type list: %rz1Individual headers (%r) must be of type tuple: %rr�Header namezHeader valuer!zyThe Status header cannot be used; it conflicts with CGI script, and HTTP status is not given through headers (value: %r).�
�:z,Header names may not contain ':' or '\n': %rzBad header name: %r�-�_z#Names may not end in '-' or '_': %rrz#Bad header value: %r (bad char: %r))r
rr=rdrr�lower�	header_re�search�endswith�bad_header_value_re�group)r"�item�namerrrr	r�s>
��
��

����
�rcCs|t|d�}t|�dd�d�}d}|D]:\}}t|d�}|��dkr&||krRdStdd|�q&||krxtdd|�dS)	Nrmrr)��i0rrzcontent-typezJContent-Type header found in a %s response, which must not return content.z,No Content-Type header found in headers (%s))rrirqrwr
)r!r"�codeZNO_MESSAGE_BODYr~rrrr	r�s

�rcCs*t|dkpt|�tkd|t|�f�dS)Nz exc_info (%r) is not a tuple: %r)r
rrd)r#rrr	r�s�rcCstt|ttf�d�dS)NzwYou should not return a string as your application iterator, instead return a single-item list containing a bytestring.)r
�
isinstancerr8rOrrr	r+�s�r+)r�__all__�rerXra�compilerxr{�Warningrr
rrr)r*rrNr,r(rerfrrrrr+rrrr	�<module>s.j

7#		#Awsgiref/__pycache__/__init__.cpython-38.opt-1.pyc000064400000001326151153537630015563 0ustar00U

e5dK�@sdZdS)aDwsgiref -- a WSGI (PEP 3333) Reference Library

Current Contents:

* util -- Miscellaneous useful functions and wrappers

* headers -- Manage response headers

* handlers -- base classes for server/gateway implementations

* simple_server -- a simple BaseHTTPServer that supports WSGI

* validate -- validation wrapper that sits between an app and a server
  to detect errors in either

To-Do:

* cgi_gateway -- Run WSGI apps under CGI (pending a deployment standard)

* cgi_wrapper -- Run CGI apps under WSGI

* router -- a simple middleware component that handles URL traversal
N)�__doc__�rr�(/usr/lib64/python3.8/wsgiref/__init__.py�<module>�wsgiref/__pycache__/util.cpython-38.opt-2.pyc000064400000007403151153537630015004 0ustar00U

e5d��@srddlZddddddgZGdd�d�Zd	d�Zd
d�Zddd�Zd
d�Zdd�ZddddddddhjZ	dd�Z
dS)�N�FileWrapper�guess_scheme�application_uri�request_uri�shift_path_info�setup_testing_defaultsc@s.eZdZddd�Zdd�Zdd�Zdd	�Zd
S)r� cCs"||_||_t|d�r|j|_dS)N�close)�filelike�blksize�hasattrr	)�selfr
r�r�$/usr/lib64/python3.8/wsgiref/util.py�__init__s
zFileWrapper.__init__cCs6ddl}|jdtdd�|j�|j�}|r.|St�dS)NrzXFileWrapper's __getitem__ method ignores 'key' parameter. Use iterator protocol instead.�)�
stacklevel)�warnings�warn�DeprecationWarningr
�readr�
IndexError)r
�keyr�datarrr�__getitem__s�zFileWrapper.__getitem__cCs|S�Nr)r
rrr�__iter__!szFileWrapper.__iter__cCs|j�|j�}|r|St�dSr)r
rr�
StopIteration)r
rrrr�__next__$szFileWrapper.__next__N)r)�__name__�
__module__�__qualname__rrrrrrrrrs

cCs|�d�dkrdSdSdS)NZHTTPS)ZyesZon�1�https�http)�get)�environrrrr*scCs�|dd}ddlm}|�d�r0||d7}nR||d7}|ddkrf|dd	kr�|d
|d7}n|ddkr�|d
|d7}|||�d�p�d
dd�7}|S)N�wsgi.url_schemez://r��quote�	HTTP_HOST�SERVER_NAMEr#�SERVER_PORT�443�:�80�SCRIPT_NAME�/�latin1)�encoding)�urllib.parser)r%)r&�urlr)rrrr2s
TcCspt|�}ddlm}||�dd�ddd�}|�d�sF||d	d�7}n||7}|rl|�d
�rl|d|d
7}|S)Nrr(�	PATH_INFO�z/;=,r2)Zsafer3r0�ZQUERY_STRING�?)rr4r)r%)r&Z
include_queryr5r)�	path_inforrrrFs
cCs�|�dd�}|sdS|�d�}dd�|dd�D�|dd�<|d}|d=|�dd�}t�|d|�}|�d�r~|dd�}|s�|�d�s�|d7}||d<d�|�|d<|d	kr�d}|S)
Nr6r7r1cSsg|]}|r|dkr|�qS)�.r)�.0�prrr�
<listcomp>esz#shift_path_info.<locals>.<listcomp>r8���r0r;)r%�split�	posixpath�normpath�endswith�join)r&r:�
path_parts�nameZscript_namerrrrSs$


cCs�|�dd�|�dd�|�d|d�|�dd�d|kr\d	|kr\|�dd
�|�d	d�|�dd
�|�dd�|�dd�|�dd�ddlm}m}|�d|��|�d|��|�dt|��|ddkr�|�dd�n|ddkr�|�dd�dS)Nr+z	127.0.0.1ZSERVER_PROTOCOLzHTTP/1.0r*ZREQUEST_METHODZGETr0r6r7r1zwsgi.version)r8rz
wsgi.run_oncerzwsgi.multithreadzwsgi.multiprocess)�StringIO�BytesIOz
wsgi.inputzwsgi.errorsr'r$r,r/r#r-)�
setdefault�iorGrHr)r&rGrHrrrr|s&
Z
connectionz
keep-alivezproxy-authenticatezproxy-authorizationZteZtrailersztransfer-encodingZupgradecCst|���Sr)�_hoppish�lower)Zheader_namerrr�
is_hop_by_hop�srM)T)rA�__all__rrrrrr�__contains__rKrMrrrr�<module>s.�

))�wsgiref/__pycache__/handlers.cpython-38.opt-2.pyc000064400000024515151153537630015632 0ustar00U

e5d�T�
@s�ddlmZmZmZddlmZddlZddlZddlZddddd	d
gZ	ddd
ddddgZ
dddddddddddddg
Zdd�Zd d!d"d#d$d%d&d'd(d)h
j
Zd*d+�Zd,d
�ZGd-d�d�ZGd.d�de�ZGd/d�de�ZGd0d�de�ZGd1d	�d	e�ZdS)2�)�FileWrapper�guess_scheme�
is_hop_by_hop)�Headers�N�BaseHandler�
SimpleHandler�BaseCGIHandler�
CGIHandler�
IISCGIHandler�read_environZMonZTueZWedZThuZFriZSatZSunZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDecc
	Cs:t�|�\	}}}}}}}}}	dt||t|||||fS)Nz#%s, %02d %3s %4d %02d:%02d:%02d GMT)�time�gmtime�_weekdayname�
_monthname)
Z	timestampZyearZmonthZdayZhhZmmZssZwd�y�z�r�(/usr/lib64/python3.8/wsgiref/handlers.py�format_date_times�r�SCRIPT_NAME�	PATH_INFOZQUERY_STRINGZREQUEST_METHODZ	AUTH_TYPEZCONTENT_TYPEZCONTENT_LENGTHZHTTPSZREMOTE_USERZREMOTE_IDENTcCs6t|�p4|�d�p4|�d�p4|�d�o4t|dd��S)NZHTTP_ZSSL_Z	REDIRECT_�	)�_is_request�
startswith�_needs_transcode)�krrrrs�rcCs�t��}d}zd�d|�Wntk
r4d}YnXi}tj��D]�\}}t|�r�tjdkr�tj�	dd��
�}|�d�r�|�d��d�}q�|�d	�r�q�|�d
�r�d|kr�|�d��d�}q�|�|d��d�}n|�||��d�}|||<qD|S)N�surrogateescape�zutf-8�replaceZwin32�SERVER_SOFTWAREzmicrosoft-iis/�
iso-8859-1zapache/zsimplehttp/zpython/3)
�sys�getfilesystemencoding�encode�LookupError�os�environ�itemsr�platform�get�lowerr�decode)�encZescr'r�vZsoftwarerrrr"s0

	

��
c@seZdZdZdZdZdZdZdZdZ	e
�ZeZ
eZdZdZdgZdZdZZdZdZd	Zd
d�Zdd
�Zdd�Zdd�Zdd�Zdd�Zd:dd�Zdd�Z dd�Z!dd�Z"dd�Z#d d!�Z$d"d#�Z%d$d%�Z&d&d'�Z'd(d)�Z(d*d+�Z)d,d-�Z*d.d/�Z+d0d1�Z,d2d3�Z-d4d5�Z.d6d7�Z/d8d9�Z0dS);r)rrTFz1.0Nz500 Internal Server Error)zContent-Typez
text/plains;A server error occurred.  Please contact the administrator.rc
Cstz$|��||j|j�|_|��WnJtttfk
r@YdSz|��Wn|�	��YnXYnXdS�N)
�
setup_environr'�start_response�result�finish_response�ConnectionAbortedError�BrokenPipeError�ConnectionResetError�handle_error�close)�selfZapplicationrrr�run�szBaseHandler.runcCs�|j��}|_|��|��|d<|��|d<|j|d<|j|d<|��|d<|j	|d<|j
|d<|jdk	rx|j|d<|jr�|j
r�|�d	|j
�dS)
Nz
wsgi.inputzwsgi.errorszwsgi.versionz
wsgi.run_oncezwsgi.url_schemezwsgi.multithreadzwsgi.multiprocesszwsgi.file_wrapperr )�
os_environ�copyr'�add_cgi_vars�	get_stdin�
get_stderr�wsgi_version�
wsgi_run_once�
get_scheme�wsgi_multithread�wsgi_multiprocess�wsgi_file_wrapper�
origin_server�server_software�
setdefault)r9�envrrrr0�s





zBaseHandler.setup_environcCsdz2|��r|��s0|jD]}|�|�q|��Wn$t|jd�rP|j���Yn
X|��dS)Nr8)�result_is_file�sendfiler2�write�finish_content�hasattrr8�r9�datarrrr3�s

zBaseHandler.finish_responsecCs
t|j�Sr/)rr'�r9rrrrB�szBaseHandler.get_schemec
CsJzt|j�}Wntttfk
r(YnX|dkrFt|j�|jd<dSdS)Nr�Content-Length)�lenr2�	TypeError�AttributeError�NotImplementedError�str�
bytes_sent�headers)r9Zblocksrrr�set_content_length�szBaseHandler.set_content_lengthcCsd|jkr|��dS)NrR)rYrZrQrrr�cleanup_headers�s
zBaseHandler.cleanup_headerscCsh|r2z$|jr&|d|d��|d��W5d}Xn|jdk	rDtd��||_|�|�|_|�|d�}|jS)Nrr�zHeaders already set!ZStatus)�headers_sent�with_tracebackrY�AssertionError�status�
headers_class�_convert_string_typerL)r9r`rY�exc_inforrrr1�s
zBaseHandler.start_responsecCs(t|�tkr|Std�|t|����dS)Nz!{0} must be of type str (got {1}))�typerWr_�format�repr)r9�value�titlerrrrb�s
�z BaseHandler._convert_string_typecCs�|jrx|��r�|�d|j|jf�d��d|jkrP|�dtt����d��|j	r�d|jkr�|�d|j	�d��n|�d|j�d��dS)NzHTTP/%s %s
r!ZDatez
Date: %s
ZServerzServer: %s
zStatus: %s
)
rF�client_is_modern�_write�http_versionr`r$rYrr
rGrQrrr�
send_preambles
�zBaseHandler.send_preamblecCsR|jstd��n,|js*t|�|_|��n|jt|�7_|�|�|��dS)Nzwrite() before start_response())r`r_r]rSrX�send_headersrj�_flushrOrrrrLs



zBaseHandler.writecCsdS)NFrrQrrrrK)szBaseHandler.sendfilecCs"|js|j�dd�|��ndS)NrR�0)r]rYrHrmrQrrrrM>s
zBaseHandler.finish_contentc	CsFzt|jd�r|j��W5d|_|_|_|_d|_d|_XdS)NrFr8)r2rYr`r'rXr]rNr8rQrrrr8HszBaseHandler.closecCs8|��d|_|jr|��r4|��|�t|j��dS)NT)r[r]rFrirlrj�bytesrYrQrrrrmUs
zBaseHandler.send_headerscCs|j}|dk	ot|j|�Sr/)rE�
isinstancer2)r9�wrapperrrrrJ^szBaseHandler.result_is_filecCs|jd��dkS)NZSERVER_PROTOCOLzHTTP/0.9)r'�upperrQrrrridszBaseHandler.client_is_moderncCsJz>ddlm}|��}||d|d|d|j|�|��W5d}XdS)Nr)�print_exceptionrr\)�	tracebackrtr?�traceback_limit�flush)r9rcrt�stderrrrr�
log_exceptionis�zBaseHandler.log_exceptioncCs2|�t���|js.|�|j|j�|_|��dSr/)	ryr"rcr]�error_outputr'r1r2r3rQrrrr7yszBaseHandler.handle_errorcCs$||j|jdd�t���|jgSr/)�error_status�
error_headersr"rc�
error_body)r9r'r1rrrrz�s
zBaseHandler.error_outputcCst�dSr/�rVrOrrrrj�szBaseHandler._writecCst�dSr/r~rQrrrrn�szBaseHandler._flushcCst�dSr/r~rQrrrr>�szBaseHandler.get_stdincCst�dSr/r~rQrrrr?�szBaseHandler.get_stderrcCst�dSr/r~rQrrrr=�szBaseHandler.add_cgi_vars)N)1�__name__�
__module__�__qualname__r@rCrDrArFrkrGrr;rrErrarvr{r|r}r`r2r]rYrXr:r0r3rBrZr[r1rbrlrLrKrMr8rmrJriryr7rzrjrnr>r?r=rrrrr^sT



		c@s>eZdZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�ZdS)rTFcCs(||_||_||_||_||_||_dSr/)�stdin�stdoutrx�base_envrCrD)r9r�r�rxr'�multithread�multiprocessrrr�__init__�szSimpleHandler.__init__cCs|jSr/)r�rQrrrr>�szSimpleHandler.get_stdincCs|jSr/)rxrQrrrr?�szSimpleHandler.get_stderrcCs|j�|j�dSr/)r'�updater�rQrrrr=�szSimpleHandler.add_cgi_varscCs^|j�|�}|dks |t|�kr$dSddlm}|dt�||d�}|sLqZ|j�|�}q:dS)Nr)�warnz9SimpleHandler.stdout.write() should not do partial writes)r�rLrS�warningsr��DeprecationWarning)r9rPr2r�rrrrj�s�zSimpleHandler._writecCs|j��|jj|_dSr/)r�rwrnrQrrrrn�s
zSimpleHandler._flushN)TF)	rr�r�r�r>r?r=rjrnrrrrr�s�


c@seZdZdZdS)r	FN)rr�r�rFrrrrr	�sc@seZdZdZiZdd�ZdS)r
Tc	Cs(tj|tjjtjjtjt�ddd�dS)NFT�r�r�)r	r�r"r��bufferr�rxrrQrrrr�s�zCGIHandler.__init__N�rr�r�rAr;r�rrrrr
�sc@seZdZdZiZdd�ZdS)rTc	Csjt�}|�dd�}|�dd�}|d�|d�rD|t|�d�|d<tj|tjjtj	jtj
|ddd�dS)Nrrr�/FTr�)rr*rrSr	r�r"r�r�r�rx)r9r'�pathZscriptrrrr�2s�zIISCGIHandler.__init__Nr�rrrrrs)�utilrrrrYrr"r&r
�__all__rrr�__contains__rrrrrr	r
rrrrr�<module>sZ���<V2wsgiref/__pycache__/simple_server.cpython-38.pyc000064400000012217151153537630015745 0ustar00U

e5d3�	@s dZddlmZmZddlZddlZddlmZddl	m
Z
dZddd	d
gZdeZ
e
�dej��dZe
d
eZGdd�de�ZGdd�de�ZGdd�de�Zdd	�Zeefdd
�Zedk�redde��BZej��Zededdedd�ddlZe�d�e��W5QRXdS)a!BaseHTTPServer that implements the Python WSGI protocol (PEP 3333)

This is both an example of how WSGI can be implemented, and a basis for running
simple web applications on a local machine, such as might be done when testing
or debugging an application.  It has not been reviewed for security issues,
however, and we strongly recommend that you use a "real" web server for
production use.

For example usage, see the 'if __name__=="__main__"' block at the end of the
module.  See also the BaseHTTPServer module docs for other API information.
�)�BaseHTTPRequestHandler�
HTTPServerN)�
SimpleHandler)�python_implementationz0.2�
WSGIServer�WSGIRequestHandler�demo_app�make_server�WSGIServer/�/� c@seZdZeZdd�ZdS)�
ServerHandlerc	Cs4z"|j�|j�dd�d|j�W5t�|�XdS)Nr�r)r�close�request_handlerZlog_requestZstatus�splitZ
bytes_sent��self�r�-/usr/lib64/python3.8/wsgiref/simple_server.pyr s�zServerHandler.closeN)�__name__�
__module__�__qualname__�software_versionZserver_softwarerrrrrr
sr
c@s4eZdZdZdZdd�Zdd�Zdd�Zd	d
�ZdS)rz7BaseHTTPServer that implements the Python WSGI protocolNcCst�|�|��dS)z.Override server_bind to store the server name.N)r�server_bind�
setup_environrrrrr0s
zWSGIServer.server_bindcCsFi}|_|j|d<d|d<t|j�|d<d|d<d|d<d|d<dS)	NZSERVER_NAMEzCGI/1.1ZGATEWAY_INTERFACEZSERVER_PORT��REMOTE_HOST�CONTENT_LENGTHZSCRIPT_NAME)�base_environZserver_name�strZserver_port)r�envrrrr5s

zWSGIServer.setup_environcCs|jS�N��applicationrrrr�get_app?szWSGIServer.get_appcCs
||_dSr"r#)rr$rrr�set_appBszWSGIServer.set_app)	rrr�__doc__r$rrr%r&rrrrr*s
c@s,eZdZdeZdd�Zdd�Zdd�ZdS)	rr
cCsP|jj��}|j|d<|j|d<|j|d<d|jkrH|j�dd�\}}n|jd}}tj	�
|d�|d<||d	<|��}||jd
kr�||d<|jd
|d<|j
�d
�dkr�|j
��|d<n|j
d
|d<|j
�d�}|r�||d<|j
��D]`\}}|�dd���}|��}||k�rq�d||k�r>|d|d|7<q�||d|<q�|S)NZSERVER_PROTOCOLZSERVER_SOFTWAREZREQUEST_METHOD�?rrz
iso-8859-1Z	PATH_INFOZQUERY_STRINGrrZREMOTE_ADDRzcontent-typeZCONTENT_TYPEzcontent-lengthr�-�_ZHTTP_�,)�serverr�copy�request_version�server_version�command�pathr�urllib�parseZunquoteZaddress_stringZclient_addressZheaders�getZget_content_type�items�replace�upper�strip)rr!r1Zquery�hostZlength�k�vrrr�get_environKs8




zWSGIRequestHandler.get_environcCstjSr")�sys�stderrrrrr�
get_stderrpszWSGIRequestHandler.get_stderrcCs�|j�d�|_t|j�dkr<d|_d|_d|_|�d�dS|��sHdSt	|j|j
|��|��dd�}||_
|�|j���dS)zHandle a single HTTP requestiiri�NF)Zmultithread)Zrfile�readlineZraw_requestline�lenZrequestliner.r0Z
send_errorZ
parse_requestr
Zwfiler?r<r�runr,r%)rZhandlerrrr�handless$
�zWSGIRequestHandler.handleN)rrr�__version__r/r<r?rCrrrrrGs%cCsrddlm}|�}td|d�t|d�t|���}|D]\}}t|dt|�|d�q8|ddg�|���d�gS)	Nr)�StringIOzHello world!)�file�=z200 OK)zContent-Typeztext/plain; charset=utf-8zutf-8)�iorE�print�sortedr5�repr�getvalue�encode)�environZstart_responserE�stdout�hr:r;rrrr�s
cCs|||f|�}|�|�|S)zACreate a new WSGI server listening on `host` and `port` for `app`)r&)r9�portZappZserver_classZ
handler_classr,rrrr	�s
�__main__ri@zServing HTTP onrQrz...zhttp://localhost:8000/xyz?abc) r'Zhttp.serverrrr=Zurllib.parser2Zwsgiref.handlersr�platformrrD�__all__r/�versionr�sys_versionrr
rrrr	rZhttpdZsocketZgetsocknameZsarIZ
webbrowser�openZhandle_requestrrrr�<module>s0C
�
	


wsgiref/__pycache__/handlers.cpython-38.pyc000064400000040100151153537630014656 0ustar00U

e5d�T�
@sdZddlmZmZmZddlmZddlZddlZddl	Z	dddd	d
dgZ
dd
dddddgZdddddddddddddg
Zdd �Z
d!d"d#d$d%d&d'd(d)d*h
jZd+d,�Zd-d�ZGd.d�d�ZGd/d�de�ZGd0d�de�ZGd1d	�d	e�ZGd2d
�d
e�ZdS)3z/Base classes for server/gateway implementations�)�FileWrapper�guess_scheme�
is_hop_by_hop)�Headers�N�BaseHandler�
SimpleHandler�BaseCGIHandler�
CGIHandler�
IISCGIHandler�read_environZMonZTueZWedZThuZFriZSatZSunZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDecc
	Cs:t�|�\	}}}}}}}}}	dt||t|||||fS)Nz#%s, %02d %3s %4d %02d:%02d:%02d GMT)�time�gmtime�_weekdayname�
_monthname)
Z	timestampZyearZmonthZdayZhhZmmZssZwd�y�z�r�(/usr/lib64/python3.8/wsgiref/handlers.py�format_date_times�r�SCRIPT_NAME�	PATH_INFOZQUERY_STRINGZREQUEST_METHODZ	AUTH_TYPEZCONTENT_TYPEZCONTENT_LENGTHZHTTPSZREMOTE_USERZREMOTE_IDENTcCs6t|�p4|�d�p4|�d�p4|�d�o4t|dd��S)NZHTTP_ZSSL_Z	REDIRECT_�	)�_is_request�
startswith�_needs_transcode)�krrrrs�rcCs�t��}d}zd�d|�Wntk
r4d}YnXi}tj��D]�\}}t|�r�tjdkr�tj�	dd��
�}|�d�r�|�d��d�}q�|�d	�r�q�|�d
�r�d|kr�|�d��d�}q�|�|d��d�}n|�||��d�}|||<qD|S)z'Read environment, fixing HTTP variables�surrogateescape�zutf-8�replaceZwin32�SERVER_SOFTWAREzmicrosoft-iis/�
iso-8859-1zapache/zsimplehttp/zpython/3)
�sys�getfilesystemencoding�encode�LookupError�os�environ�itemsr�platform�get�lowerr�decode)�encZescr'r�vZsoftwarerrrr"s0

	

��
c@s"eZdZdZdZdZdZdZdZdZ	dZ
e�Ze
ZeZdZdZdgZd	ZdZZdZdZd
Zdd�Zd
d�Zdd�Zdd�Zdd�Zdd�Zd;dd�Z dd�Z!dd�Z"dd�Z#dd �Z$d!d"�Z%d#d$�Z&d%d&�Z'd'd(�Z(d)d*�Z)d+d,�Z*d-d.�Z+d/d0�Z,d1d2�Z-d3d4�Z.d5d6�Z/d7d8�Z0d9d:�Z1dS)<rz+Manage the invocation of a WSGI application)rrTFz1.0Nz500 Internal Server Error)zContent-Typez
text/plains;A server error occurred.  Please contact the administrator.rc
Cstz$|��||j|j�|_|��WnJtttfk
r@YdSz|��Wn|�	��YnXYnXdS)zInvoke the applicationN)
�
setup_environr'�start_response�result�finish_response�ConnectionAbortedError�BrokenPipeError�ConnectionResetError�handle_error�close)�selfZapplicationrrr�run�szBaseHandler.runcCs�|j��}|_|��|��|d<|��|d<|j|d<|j|d<|��|d<|j	|d<|j
|d<|jdk	rx|j|d	<|jr�|j
r�|�d
|j
�dS)z&Set up the environment for one requestz
wsgi.inputzwsgi.errorszwsgi.versionz
wsgi.run_oncezwsgi.url_schemezwsgi.multithreadzwsgi.multiprocessNzwsgi.file_wrapperr )�
os_environ�copyr'�add_cgi_vars�	get_stdin�
get_stderr�wsgi_version�
wsgi_run_once�
get_scheme�wsgi_multithread�wsgi_multiprocess�wsgi_file_wrapper�
origin_server�server_software�
setdefault)r8�envrrrr/�s





zBaseHandler.setup_environcCsdz2|��r|��s0|jD]}|�|�q|��Wn$t|jd�rP|j���Yn
X|��dS)a>Send any iterable data, then close self and the iterable

        Subclasses intended for use in asynchronous servers will
        want to redefine this method, such that it sets up callbacks
        in the event loop to iterate over the data, and to call
        'self.close()' once the response is finished.
        r7N)�result_is_file�sendfiler1�write�finish_content�hasattrr7�r8�datarrrr2�s

zBaseHandler.finish_responsecCs
t|j�S)z Return the URL scheme being used)rr'�r8rrrrA�szBaseHandler.get_schemec
CsJzt|j�}Wntttfk
r(YnX|dkrFt|j�|jd<dSdS)z@Compute Content-Length or switch to chunked encoding if possibler�Content-LengthN)�lenr1�	TypeError�AttributeError�NotImplementedError�str�
bytes_sent�headers)r8Zblocksrrr�set_content_length�szBaseHandler.set_content_lengthcCsd|jkr|��dS)zqMake any necessary header changes or defaults

        Subclasses can extend this to add other defaults.
        rQN)rXrYrPrrr�cleanup_headers�s
zBaseHandler.cleanup_headerscCs�|r2z$|jr&|d|d��|d��W5d}Xn|jdk	rDtd��||_|�|�|_|�|d�}t|�dksvtd��|dd	���s�td
��|d	dks�td��|D]>\}}|�|d
�}|�|d�}t	|�r�td|�d|�d���q�|j
S)z4'start_response()' callable as specified by PEP 3333Nrr�zHeaders already set!ZStatus�z$Status must be at least 4 characters�z(Status message must begin w/3-digit code� z+Status message must have a space after codezHeader namezHeader valuezHop-by-hop header, 'z: z', not allowed)�headers_sent�with_tracebackrX�AssertionError�status�
headers_class�_convert_string_typerR�isdigitrrK)r8rbrX�exc_info�name�valrrrr0�s(

�zBaseHandler.start_responsecCs(t|�tkr|Std�|t|����dS)zConvert/check value type.z!{0} must be of type str (got {1})N)�typerVra�format�repr)r8�value�titlerrrrd�s
�z BaseHandler._convert_string_typecCs�|jrx|��r�|�d|j|jf�d��d|jkrP|�dtt����d��|j	r�d|jkr�|�d|j	�d��n|�d|j�d��dS)	z6Transmit version/status/date/server, via self._write()zHTTP/%s %s
r!ZDatez
Date: %s
ZServerzServer: %s
zStatus: %s
N)
rE�client_is_modern�_write�http_versionrbr$rXrr
rFrPrrr�
send_preambles
�zBaseHandler.send_preamblecCsft|�tkstd��|js$td��n,|js>t|�|_|��n|jt|�7_|�|�|�	�dS)z+'write()' callable as specified by PEP 3333z)write() argument must be a bytes instancezwrite() before start_response()N)
ri�bytesrarbr_rRrW�send_headersro�_flushrNrrrrKs�



zBaseHandler.writecCsdS)aPlatform-specific file transmission

        Override this method in subclasses to support platform-specific
        file transmission.  It is only called if the application's
        return iterable ('self.result') is an instance of
        'self.wsgi_file_wrapper'.

        This method should return a true value if it was able to actually
        transmit the wrapped file-like object using a platform-specific
        approach.  It should return a false value if normal iteration
        should be used instead.  An exception can be raised to indicate
        that transmission was attempted, but failed.

        NOTE: this method should call 'self.send_headers()' if
        'self.headers_sent' is false and it is going to attempt direct
        transmission of the file.
        FrrPrrrrJ)szBaseHandler.sendfilecCs"|js|j�dd�|��ndS)z.Ensure headers and content have both been sentrQ�0N)r_rXrGrsrPrrrrL>s
zBaseHandler.finish_contentc	CsFzt|jd�r|j��W5d|_|_|_|_d|_d|_XdS)z�Close the iterable (if needed) and reset all instance vars

        Subclasses may want to also drop the client connection.
        NrFr7)r1rXrbr'rWr_rMr7rPrrrr7HszBaseHandler.closecCs8|��d|_|jr|��r4|��|�t|j��dS)z1Transmit headers to the client, via self._write()TN)rZr_rErnrqrorrrXrPrrrrsUs
zBaseHandler.send_headerscCs|j}|dk	ot|j|�S)z@True if 'self.result' is an instance of 'self.wsgi_file_wrapper'N)rD�
isinstancer1)r8�wrapperrrrrI^szBaseHandler.result_is_filecCs|jd��dkS)z,True if client can accept status and headersZSERVER_PROTOCOLzHTTP/0.9)r'�upperrPrrrrndszBaseHandler.client_is_moderncCsJz>ddlm}|��}||d|d|d|j|�|��W5d}XdS)z�Log the 'exc_info' tuple in the server log

        Subclasses may override to retarget the output or change its format.
        Nr)�print_exceptionrr[)�	tracebackryr>�traceback_limit�flush)r8rfry�stderrrrr�
log_exceptionis�zBaseHandler.log_exceptioncCs2|�t���|js.|�|j|j�|_|��dS)z>Log current error, and send error output to client if possibleN)	r~r"rfr_�error_outputr'r0r1r2rPrrrr6yszBaseHandler.handle_errorcCs$||j|jdd�t���|jgS)aZWSGI mini-app to create error output

        By default, this just uses the 'error_status', 'error_headers',
        and 'error_body' attributes to generate an output page.  It can
        be overridden in a subclass to dynamically generate diagnostics,
        choose an appropriate message for the user's preferred language, etc.

        Note, however, that it's not recommended from a security perspective to
        spit out diagnostics to any old user; ideally, you should have to do
        something special to enable diagnostic output, which is why we don't
        include any here!
        N)�error_status�
error_headersr"rf�
error_body)r8r'r0rrrr�s
zBaseHandler.error_outputcCst�dS)aOverride in subclass to buffer data for send to client

        It's okay if this method actually transmits the data; BaseHandler
        just separates write and flush operations for greater efficiency
        when the underlying system actually has such a distinction.
        N�rUrNrrrro�szBaseHandler._writecCst�dS)z�Override in subclass to force sending of recent '_write()' calls

        It's okay if this method is a no-op (i.e., if '_write()' actually
        sends the data.
        Nr�rPrrrrt�szBaseHandler._flushcCst�dS)z4Override in subclass to return suitable 'wsgi.input'Nr�rPrrrr=�szBaseHandler.get_stdincCst�dS)z5Override in subclass to return suitable 'wsgi.errors'Nr�rPrrrr>�szBaseHandler.get_stderrcCst�dS)z>Override in subclass to insert CGI variables in 'self.environ'Nr�rPrrrr<�szBaseHandler.add_cgi_vars)N)2�__name__�
__module__�__qualname__�__doc__r?rBrCr@rErprFrr:rrDrrcr{r�r�r�rbr1r_rXrWr9r/r2rArYrZr0rdrqrKrJrLr7rsrIrnr~r6rrortr=r>r<rrrrr^sV



		c@sBeZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dS)raqHandler that's just initialized with streams, environment, etc.

    This handler subclass is intended for synchronous HTTP/1.0 origin servers,
    and handles sending the entire response output, given the correct inputs.

    Usage::

        handler = SimpleHandler(
            inp,out,err,env, multithread=False, multiprocess=True
        )
        handler.run(app)TFcCs(||_||_||_||_||_||_dS�N)�stdin�stdoutr}�base_envrBrC)r8r�r�r}r'�multithread�multiprocessrrr�__init__�szSimpleHandler.__init__cCs|jSr�)r�rPrrrr=�szSimpleHandler.get_stdincCs|jSr�)r}rPrrrr>�szSimpleHandler.get_stderrcCs|j�|j�dSr�)r'�updater�rPrrrr<�szSimpleHandler.add_cgi_varscCs^|j�|�}|dks |t|�kr$dSddlm}|dt�||d�}|sLqZ|j�|�}q:dS)Nr)�warnz9SimpleHandler.stdout.write() should not do partial writes)r�rKrR�warningsr��DeprecationWarning)r8rOr1r�rrrro�s�zSimpleHandler._writecCs|j��|jj|_dSr�)r�r|rtrPrrrrt�s
zSimpleHandler._flushN)TF)
r�r�r�r�r�r=r>r<rortrrrrr�s
�


c@seZdZdZdZdS)r	a�CGI-like systems using input/output/error streams and environ mapping

    Usage::

        handler = BaseCGIHandler(inp,out,err,env)
        handler.run(app)

    This handler class is useful for gateway protocols like ReadyExec and
    FastCGI, that have usable input/output/error streams and an environment
    mapping.  It's also the base class for CGIHandler, which just uses
    sys.stdin, os.environ, and so on.

    The constructor also takes keyword arguments 'multithread' and
    'multiprocess' (defaulting to 'True' and 'False' respectively) to control
    the configuration sent to the application.  It sets 'origin_server' to
    False (to enable CGI-like output), and assumes that 'wsgi.run_once' is
    False.
    FN)r�r�r�r�rErrrrr	�sc@s eZdZdZdZiZdd�ZdS)r
a�CGI-based invocation via sys.stdin/stdout/stderr and os.environ

    Usage::

        CGIHandler().run(app)

    The difference between this class and BaseCGIHandler is that it always
    uses 'wsgi.run_once' of 'True', 'wsgi.multithread' of 'False', and
    'wsgi.multiprocess' of 'True'.  It does not take any initialization
    parameters, but always uses 'sys.stdin', 'os.environ', and friends.

    If you need to override any of these parameters, use BaseCGIHandler
    instead.
    Tc	Cs(tj|tjjtjjtjt�ddd�dS)NFT�r�r�)r	r�r"r��bufferr�r}rrPrrrr�s�zCGIHandler.__init__N�r�r�r�r�r@r:r�rrrrr
�sc@s eZdZdZdZiZdd�ZdS)raCGI-based invocation with workaround for IIS path bug

    This handler should be used in preference to CGIHandler when deploying on
    Microsoft IIS without having set the config allowPathInfo option (IIS>=7)
    or metabase allowPathInfoForScriptMappings (IIS<7).
    Tc	Csjt�}|�dd�}|�dd�}|d�|d�rD|t|�d�|d<tj|tjjtj	jtj
|ddd�dS)Nrrr�/FTr�)rr*rrRr	r�r"r�r�r�r})r8r'�pathZscriptrrrr�2s�zIISCGIHandler.__init__Nr�rrrrrs)r��utilrrrrXrr"r&r
�__all__rrr�__contains__rrrrrr	r
rrrrr�<module>s\���<V2wsgiref/__pycache__/util.cpython-38.opt-1.pyc000064400000012446151153537630015006 0ustar00U

e5d��@svdZddlZddddddgZGd	d�d�Zd
d�Zdd�Zdd
d�Zdd�Zdd�Zddddddddhj	Z
dd�ZdS)z$Miscellaneous WSGI-related Utilities�N�FileWrapper�guess_scheme�application_uri�request_uri�shift_path_info�setup_testing_defaultsc@s2eZdZdZddd�Zdd�Zdd�Zd	d
�ZdS)
rz1Wrapper to convert file-like objects to iterables� cCs"||_||_t|d�r|j|_dS)N�close)�filelike�blksize�hasattrr	)�selfr
r�r�$/usr/lib64/python3.8/wsgiref/util.py�__init__s
zFileWrapper.__init__cCs6ddl}|jdtdd�|j�|j�}|r.|St�dS)NrzXFileWrapper's __getitem__ method ignores 'key' parameter. Use iterator protocol instead.�)�
stacklevel)�warnings�warn�DeprecationWarningr
�readr�
IndexError)r
�keyr�datarrr�__getitem__s�zFileWrapper.__getitem__cCs|S�Nr)r
rrr�__iter__!szFileWrapper.__iter__cCs|j�|j�}|r|St�dSr)r
rr�
StopIteration)r
rrrr�__next__$szFileWrapper.__next__N)r)�__name__�
__module__�__qualname__�__doc__rrrrrrrrrs


cCs|�d�dkrdSdSdS)zMReturn a guess for whether 'wsgi.url_scheme' should be 'http' or 'https'
    ZHTTPS)ZyesZon�1�https�httpN)�get)�environrrrr*scCs�|dd}ddlm}|�d�r0||d7}nR||d7}|ddkrf|dd	kr�|d
|d7}n|ddkr�|d
|d7}|||�d�p�d
dd�7}|S)z@Return the application's base URI (no PATH_INFO or QUERY_STRING)�wsgi.url_schemez://r��quote�	HTTP_HOST�SERVER_NAMEr$�SERVER_PORT�443�:�80�SCRIPT_NAME�/�latin1)�encoding)�urllib.parser*r&)r'�urlr*rrrr2s
TcCspt|�}ddlm}||�dd�ddd�}|�d�sF||d	d
�7}n||7}|rl|�d�rl|d|d7}|S)
zBReturn the full request URI, optionally including the query stringrr)�	PATH_INFO�z/;=,r3)Zsafer4r1�NZQUERY_STRING�?)rr5r*r&)r'Z
include_queryr6r*�	path_inforrrrFs
cCs�|�dd�}|sdS|�d�}dd�|dd�D�|dd�<|d}|d=|�d	d�}t�|d|�}|�d�r~|dd�}|s�|�d�s�|d7}||d	<d�|�|d<|d
kr�d}|S)aZShift a name from PATH_INFO to SCRIPT_NAME, returning it

    If there are no remaining path segments in PATH_INFO, return None.
    Note: 'environ' is modified in-place; use a copy if you need to keep
    the original PATH_INFO or SCRIPT_NAME.

    Note: when PATH_INFO is just a '/', this returns '' and appends a trailing
    '/' to SCRIPT_NAME, even though empty path segments are normally ignored,
    and SCRIPT_NAME doesn't normally end in a '/'.  This is intentional
    behavior, to ensure that an application can tell the difference between
    '/x' and '/x/' when traversing to objects.
    r7r8Nr2cSsg|]}|r|dkr|�qS)�.r)�.0�prrr�
<listcomp>esz#shift_path_info.<locals>.<listcomp>r9���r1r<)r&�split�	posixpath�normpath�endswith�join)r'r;�
path_parts�nameZscript_namerrrrSs$


cCs�|�dd�|�dd�|�d|d�|�dd�d|kr\d	|kr\|�dd
�|�d	d�|�dd
�|�dd�|�dd�|�dd�ddlm}m}|�d|��|�d|��|�dt|��|ddkr�|�dd�n|ddkr�|�dd�dS)a:Update 'environ' with trivial defaults for testing purposes

    This adds various parameters required for WSGI, including HTTP_HOST,
    SERVER_NAME, SERVER_PORT, REQUEST_METHOD, SCRIPT_NAME, PATH_INFO,
    and all of the wsgi.* variables.  It only supplies default values,
    and does not replace any existing settings for these variables.

    This routine is intended to make it easier for unit tests of WSGI
    servers and applications to set up dummy environments.  It should *not*
    be used by actual WSGI servers or applications, since the data is fake!
    r,z	127.0.0.1ZSERVER_PROTOCOLzHTTP/1.0r+ZREQUEST_METHODZGETr1r7r8r2zwsgi.version)r9rz
wsgi.run_oncerzwsgi.multithreadzwsgi.multiprocess)�StringIO�BytesIOz
wsgi.inputzwsgi.errorsr(r%r-r0r$r.N)�
setdefault�iorHrIr)r'rHrIrrrr|s&
Z
connectionz
keep-alivezproxy-authenticatezproxy-authorizationZteZtrailersztransfer-encodingZupgradecCst|���S)z?Return true if 'header_name' is an HTTP/1.1 "Hop-by-Hop" header)�_hoppish�lower)Zheader_namerrr�
is_hop_by_hop�srN)T)r"rB�__all__rrrrrr�__contains__rLrNrrrr�<module>s0�

))�wsgiref/__pycache__/simple_server.cpython-38.opt-1.pyc000064400000012217151153537630016704 0ustar00U

e5d3�	@s dZddlmZmZddlZddlZddlmZddl	m
Z
dZddd	d
gZdeZ
e
�dej��dZe
d
eZGdd�de�ZGdd�de�ZGdd�de�Zdd	�Zeefdd
�Zedk�redde��BZej��Zededdedd�ddlZe�d�e��W5QRXdS)a!BaseHTTPServer that implements the Python WSGI protocol (PEP 3333)

This is both an example of how WSGI can be implemented, and a basis for running
simple web applications on a local machine, such as might be done when testing
or debugging an application.  It has not been reviewed for security issues,
however, and we strongly recommend that you use a "real" web server for
production use.

For example usage, see the 'if __name__=="__main__"' block at the end of the
module.  See also the BaseHTTPServer module docs for other API information.
�)�BaseHTTPRequestHandler�
HTTPServerN)�
SimpleHandler)�python_implementationz0.2�
WSGIServer�WSGIRequestHandler�demo_app�make_server�WSGIServer/�/� c@seZdZeZdd�ZdS)�
ServerHandlerc	Cs4z"|j�|j�dd�d|j�W5t�|�XdS)Nr�r)r�close�request_handlerZlog_requestZstatus�splitZ
bytes_sent��self�r�-/usr/lib64/python3.8/wsgiref/simple_server.pyr s�zServerHandler.closeN)�__name__�
__module__�__qualname__�software_versionZserver_softwarerrrrrr
sr
c@s4eZdZdZdZdd�Zdd�Zdd�Zd	d
�ZdS)rz7BaseHTTPServer that implements the Python WSGI protocolNcCst�|�|��dS)z.Override server_bind to store the server name.N)r�server_bind�
setup_environrrrrr0s
zWSGIServer.server_bindcCsFi}|_|j|d<d|d<t|j�|d<d|d<d|d<d|d<dS)	NZSERVER_NAMEzCGI/1.1ZGATEWAY_INTERFACEZSERVER_PORT��REMOTE_HOST�CONTENT_LENGTHZSCRIPT_NAME)�base_environZserver_name�strZserver_port)r�envrrrr5s

zWSGIServer.setup_environcCs|jS�N��applicationrrrr�get_app?szWSGIServer.get_appcCs
||_dSr"r#)rr$rrr�set_appBszWSGIServer.set_app)	rrr�__doc__r$rrr%r&rrrrr*s
c@s,eZdZdeZdd�Zdd�Zdd�ZdS)	rr
cCsP|jj��}|j|d<|j|d<|j|d<d|jkrH|j�dd�\}}n|jd}}tj	�
|d�|d<||d	<|��}||jd
kr�||d<|jd
|d<|j
�d
�dkr�|j
��|d<n|j
d
|d<|j
�d�}|r�||d<|j
��D]`\}}|�dd���}|��}||k�rq�d||k�r>|d|d|7<q�||d|<q�|S)NZSERVER_PROTOCOLZSERVER_SOFTWAREZREQUEST_METHOD�?rrz
iso-8859-1Z	PATH_INFOZQUERY_STRINGrrZREMOTE_ADDRzcontent-typeZCONTENT_TYPEzcontent-lengthr�-�_ZHTTP_�,)�serverr�copy�request_version�server_version�command�pathr�urllib�parseZunquoteZaddress_stringZclient_addressZheaders�getZget_content_type�items�replace�upper�strip)rr!r1Zquery�hostZlength�k�vrrr�get_environKs8




zWSGIRequestHandler.get_environcCstjSr")�sys�stderrrrrr�
get_stderrpszWSGIRequestHandler.get_stderrcCs�|j�d�|_t|j�dkr<d|_d|_d|_|�d�dS|��sHdSt	|j|j
|��|��dd�}||_
|�|j���dS)zHandle a single HTTP requestiiri�NF)Zmultithread)Zrfile�readlineZraw_requestline�lenZrequestliner.r0Z
send_errorZ
parse_requestr
Zwfiler?r<r�runr,r%)rZhandlerrrr�handless$
�zWSGIRequestHandler.handleN)rrr�__version__r/r<r?rCrrrrrGs%cCsrddlm}|�}td|d�t|d�t|���}|D]\}}t|dt|�|d�q8|ddg�|���d�gS)	Nr)�StringIOzHello world!)�file�=z200 OK)zContent-Typeztext/plain; charset=utf-8zutf-8)�iorE�print�sortedr5�repr�getvalue�encode)�environZstart_responserE�stdout�hr:r;rrrr�s
cCs|||f|�}|�|�|S)zACreate a new WSGI server listening on `host` and `port` for `app`)r&)r9�portZappZserver_classZ
handler_classr,rrrr	�s
�__main__ri@zServing HTTP onrQrz...zhttp://localhost:8000/xyz?abc) r'Zhttp.serverrrr=Zurllib.parser2Zwsgiref.handlersr�platformrrD�__all__r/�versionr�sys_versionrr
rrrr	rZhttpdZsocketZgetsocknameZsarIZ
webbrowser�openZhandle_requestrrrr�<module>s0C
�
	


wsgiref/__pycache__/__init__.cpython-38.opt-2.pyc000064400000000203151153537630015555 0ustar00U

e5dK�@sdS)N�rrr�(/usr/lib64/python3.8/wsgiref/__init__.py�<module>�wsgiref/__pycache__/headers.cpython-38.opt-2.pyc000064400000010574151153537630015445 0ustar00U

e5dn�@s.ddlZe�d�Zddd�ZGdd�d�ZdS)	�Nz[ \(\)<>@,;:\\"/\[\]\?=]�cCsX|dk	rPt|�dkrP|s"t�|�rB|�dd��dd�}d||fSd||fSn|SdS)Nr�\z\\�"z\"z%s="%s"z%s=%s)�len�	tspecials�search�replace)Zparam�valueZquote�r
�'/usr/lib64/python3.8/wsgiref/headers.py�_formatparam
src@s�eZdZd$dd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
d%dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�ZdS)&�HeadersNcCs.|dk	r|ng}t|�tk	r$td��||_dS)Nz+Headers must be a list of name/value tuples)�type�list�	TypeError�_headers)�selfZheadersr
r
r�__init__s
zHeaders.__init__cCs&t|�tkr|Std�t|����dS)Nz1Header names/values must be of type str (got {0}))r�str�AssertionError�format�repr)rr	r
r
r�_convert_string_type)s
�zHeaders._convert_string_typecCs
t|j�S�N)rr�rr
r
r�__len__0szHeaders.__len__cCs&||=|j�|�|�|�|�f�dSr)r�appendr)r�name�valr
r
r�__setitem__4s�zHeaders.__setitem__cs0|�������fdd�|jD�|jdd�<dS)Ncs g|]}|d���kr|�qS)r��lower��.0Zkv�rr
r�
<listcomp>@sz'Headers.__delitem__.<locals>.<listcomp>�rr!r�rrr
r$r�__delitem__:szHeaders.__delitem__cCs
|�|�Sr��getr'r
r
r�__getitem__Bs	zHeaders.__getitem__cCs|�|�dk	Srr)r'r
r
r�__contains__MszHeaders.__contains__cs"|�������fdd�|jD�S)Ncs$g|]}|d���kr|d�qS)rrr r"r$r
rr%[sz#Headers.get_all.<locals>.<listcomp>r&r'r
r$r�get_allRszHeaders.get_allcCs6|�|���}|jD]\}}|��|kr|Sq|Srr&)rr�default�k�vr
r
rr*^s

zHeaders.getcCsdd�|jD�S)NcSsg|]\}}|�qSr
r
�r#r/r0r
r
rr%osz Headers.keys.<locals>.<listcomp>�rrr
r
r�keysgszHeaders.keyscCsdd�|jD�S)NcSsg|]\}}|�qSr
r
r1r
r
rr%ysz"Headers.values.<locals>.<listcomp>r2rr
r
r�valuesqszHeaders.valuescCs|jdd�Srr2rr
r
r�items{sz
Headers.itemscCsd|jj|jfS)Nz%s(%r))�	__class__�__name__rrr
r
r�__repr__�szHeaders.__repr__cCsd�dd�|jD�ddg�S)Nz
cSsg|]}d|�qS)z%s: %sr
r"r
r
rr%�sz#Headers.__str__.<locals>.<listcomp>�)�joinrrr
r
r�__str__�szHeaders.__str__cCst|��d�S)Nz
iso-8859-1)r�encoderr
r
r�	__bytes__�szHeaders.__bytes__cCs:|�|�}|dkr2|j�|�|�|�|�f�|S|SdSr)r*rrr)rrr	�resultr
r
r�
setdefault�s
�zHeaders.setdefaultcKs�g}|dk	r |�|�}|�|�|��D]P\}}|�|�}|dkrV|�|�dd��q(|�|�}|�t|�dd�|��q(|j�|�|�d�|�f�dS)N�_�-z; )rrr5rrrr:)r�_nameZ_valueZ_params�partsr/r0r
r
r�
add_header�s



zHeaders.add_header)N)N)r7�
__module__�__qualname__rrrrr(r+r,r-r*r3r4r5r8r;r=r?rDr
r
r
rr
s"


	



r
)Nr)�re�compilerrr
r
r
r
r�<module>
s

wsgiref/__pycache__/simple_server.cpython-38.opt-2.pyc000064400000010612151153537630016702 0ustar00U

e5d3�	@sddlmZmZddlZddlZddlmZddlm	Z	dZ
dddd	gZd
e
Ze	�dej
��dZedeZGd
d�de�ZGdd�de�ZGdd�de�Zdd�Zeefdd	�Zedk�redde��BZej��Zededdedd�ddlZe�d�e��W5QRXdS)�)�BaseHTTPRequestHandler�
HTTPServerN)�
SimpleHandler)�python_implementationz0.2�
WSGIServer�WSGIRequestHandler�demo_app�make_server�WSGIServer/�/� c@seZdZeZdd�ZdS)�
ServerHandlerc	Cs4z"|j�|j�dd�d|j�W5t�|�XdS)Nr�r)r�close�request_handlerZlog_requestZstatus�splitZ
bytes_sent��self�r�-/usr/lib64/python3.8/wsgiref/simple_server.pyr s�zServerHandler.closeN)�__name__�
__module__�__qualname__�software_versionZserver_softwarerrrrrr
sr
c@s0eZdZdZdd�Zdd�Zdd�Zdd	�ZdS)
rNcCst�|�|��dS�N)r�server_bind�
setup_environrrrrr0s
zWSGIServer.server_bindcCsFi}|_|j|d<d|d<t|j�|d<d|d<d|d<d|d<dS)	NZSERVER_NAMEzCGI/1.1ZGATEWAY_INTERFACEZSERVER_PORT��REMOTE_HOST�CONTENT_LENGTHZSCRIPT_NAME)�base_environZserver_name�strZserver_port)r�envrrrr5s

zWSGIServer.setup_environcCs|jSr��applicationrrrr�get_app?szWSGIServer.get_appcCs
||_dSrr#)rr$rrr�set_appBszWSGIServer.set_app)rrrr$rrr%r&rrrrr*s

c@s,eZdZdeZdd�Zdd�Zdd�ZdS)	rr
cCsP|jj��}|j|d<|j|d<|j|d<d|jkrH|j�dd�\}}n|jd}}tj	�
|d�|d<||d	<|��}||jd
kr�||d<|jd
|d<|j
�d
�dkr�|j
��|d<n|j
d
|d<|j
�d�}|r�||d<|j
��D]`\}}|�dd���}|��}||k�rq�d||k�r>|d|d|7<q�||d|<q�|S)NZSERVER_PROTOCOLZSERVER_SOFTWAREZREQUEST_METHOD�?rrz
iso-8859-1Z	PATH_INFOZQUERY_STRINGrrZREMOTE_ADDRzcontent-typeZCONTENT_TYPEzcontent-lengthr�-�_ZHTTP_�,)�serverr �copy�request_version�server_version�command�pathr�urllib�parseZunquoteZaddress_stringZclient_addressZheaders�getZget_content_type�items�replace�upper�strip)rr"r0Zquery�hostZlength�k�vrrr�get_environKs8




zWSGIRequestHandler.get_environcCstjSr)�sys�stderrrrrr�
get_stderrpszWSGIRequestHandler.get_stderrcCs�|j�d�|_t|j�dkr<d|_d|_d|_|�d�dS|��sHdSt	|j|j
|��|��dd�}||_
|�|j���dS)Niiri�F)Zmultithread)Zrfile�readlineZraw_requestline�lenZrequestliner-r/Z
send_errorZ
parse_requestr
Zwfiler>r;r�runr+r%)rZhandlerrrr�handless$
�zWSGIRequestHandler.handleN)rrr�__version__r.r;r>rBrrrrrGs%cCsrddlm}|�}td|d�t|d�t|���}|D]\}}t|dt|�|d�q8|ddg�|���d�gS)	Nr)�StringIOzHello world!)�file�=z200 OK)zContent-Typeztext/plain; charset=utf-8zutf-8)�iorD�print�sortedr4�repr�getvalue�encode)�environZstart_responserD�stdout�hr9r:rrrr�s
cCs|||f|�}|�|�|Sr)r&)r8�portZappZserver_classZ
handler_classr+rrrr	�s
�__main__ri@zServing HTTP onrPrz...zhttp://localhost:8000/xyz?abc)Zhttp.serverrrr<Zurllib.parser1Zwsgiref.handlersr�platformrrC�__all__r.�versionr�sys_versionrr
rrrr	rZhttpdZsocketZgetsocknameZsarHZ
webbrowser�openZhandle_requestrrrr�<module>
s.C
�
	


wsgiref/__pycache__/util.cpython-38.pyc000064400000012446151153537630014047 0ustar00U

e5d��@svdZddlZddddddgZGd	d�d�Zd
d�Zdd�Zdd
d�Zdd�Zdd�Zddddddddhj	Z
dd�ZdS)z$Miscellaneous WSGI-related Utilities�N�FileWrapper�guess_scheme�application_uri�request_uri�shift_path_info�setup_testing_defaultsc@s2eZdZdZddd�Zdd�Zdd�Zd	d
�ZdS)
rz1Wrapper to convert file-like objects to iterables� cCs"||_||_t|d�r|j|_dS)N�close)�filelike�blksize�hasattrr	)�selfr
r�r�$/usr/lib64/python3.8/wsgiref/util.py�__init__s
zFileWrapper.__init__cCs6ddl}|jdtdd�|j�|j�}|r.|St�dS)NrzXFileWrapper's __getitem__ method ignores 'key' parameter. Use iterator protocol instead.�)�
stacklevel)�warnings�warn�DeprecationWarningr
�readr�
IndexError)r
�keyr�datarrr�__getitem__s�zFileWrapper.__getitem__cCs|S�Nr)r
rrr�__iter__!szFileWrapper.__iter__cCs|j�|j�}|r|St�dSr)r
rr�
StopIteration)r
rrrr�__next__$szFileWrapper.__next__N)r)�__name__�
__module__�__qualname__�__doc__rrrrrrrrrs


cCs|�d�dkrdSdSdS)zMReturn a guess for whether 'wsgi.url_scheme' should be 'http' or 'https'
    ZHTTPS)ZyesZon�1�https�httpN)�get)�environrrrr*scCs�|dd}ddlm}|�d�r0||d7}nR||d7}|ddkrf|dd	kr�|d
|d7}n|ddkr�|d
|d7}|||�d�p�d
dd�7}|S)z@Return the application's base URI (no PATH_INFO or QUERY_STRING)�wsgi.url_schemez://r��quote�	HTTP_HOST�SERVER_NAMEr$�SERVER_PORT�443�:�80�SCRIPT_NAME�/�latin1)�encoding)�urllib.parser*r&)r'�urlr*rrrr2s
TcCspt|�}ddlm}||�dd�ddd�}|�d�sF||d	d
�7}n||7}|rl|�d�rl|d|d7}|S)
zBReturn the full request URI, optionally including the query stringrr)�	PATH_INFO�z/;=,r3)Zsafer4r1�NZQUERY_STRING�?)rr5r*r&)r'Z
include_queryr6r*�	path_inforrrrFs
cCs�|�dd�}|sdS|�d�}dd�|dd�D�|dd�<|d}|d=|�d	d�}t�|d|�}|�d�r~|dd�}|s�|�d�s�|d7}||d	<d�|�|d<|d
kr�d}|S)aZShift a name from PATH_INFO to SCRIPT_NAME, returning it

    If there are no remaining path segments in PATH_INFO, return None.
    Note: 'environ' is modified in-place; use a copy if you need to keep
    the original PATH_INFO or SCRIPT_NAME.

    Note: when PATH_INFO is just a '/', this returns '' and appends a trailing
    '/' to SCRIPT_NAME, even though empty path segments are normally ignored,
    and SCRIPT_NAME doesn't normally end in a '/'.  This is intentional
    behavior, to ensure that an application can tell the difference between
    '/x' and '/x/' when traversing to objects.
    r7r8Nr2cSsg|]}|r|dkr|�qS)�.r)�.0�prrr�
<listcomp>esz#shift_path_info.<locals>.<listcomp>r9���r1r<)r&�split�	posixpath�normpath�endswith�join)r'r;�
path_parts�nameZscript_namerrrrSs$


cCs�|�dd�|�dd�|�d|d�|�dd�d|kr\d	|kr\|�dd
�|�d	d�|�dd
�|�dd�|�dd�|�dd�ddlm}m}|�d|��|�d|��|�dt|��|ddkr�|�dd�n|ddkr�|�dd�dS)a:Update 'environ' with trivial defaults for testing purposes

    This adds various parameters required for WSGI, including HTTP_HOST,
    SERVER_NAME, SERVER_PORT, REQUEST_METHOD, SCRIPT_NAME, PATH_INFO,
    and all of the wsgi.* variables.  It only supplies default values,
    and does not replace any existing settings for these variables.

    This routine is intended to make it easier for unit tests of WSGI
    servers and applications to set up dummy environments.  It should *not*
    be used by actual WSGI servers or applications, since the data is fake!
    r,z	127.0.0.1ZSERVER_PROTOCOLzHTTP/1.0r+ZREQUEST_METHODZGETr1r7r8r2zwsgi.version)r9rz
wsgi.run_oncerzwsgi.multithreadzwsgi.multiprocess)�StringIO�BytesIOz
wsgi.inputzwsgi.errorsr(r%r-r0r$r.N)�
setdefault�iorHrIr)r'rHrIrrrr|s&
Z
connectionz
keep-alivezproxy-authenticatezproxy-authorizationZteZtrailersztransfer-encodingZupgradecCst|���S)z?Return true if 'header_name' is an HTTP/1.1 "Hop-by-Hop" header)�_hoppish�lower)Zheader_namerrr�
is_hop_by_hop�srN)T)r"rB�__all__rrrrrr�__contains__rLrNrrrr�<module>s0�

))�wsgiref/__pycache__/handlers.cpython-38.opt-1.pyc000064400000037156151153537630015636 0ustar00U

e5d�T�
@sdZddlmZmZmZddlmZddlZddlZddl	Z	dddd	d
dgZ
dd
dddddgZdddddddddddddg
Zdd �Z
d!d"d#d$d%d&d'd(d)d*h
jZd+d,�Zd-d�ZGd.d�d�ZGd/d�de�ZGd0d�de�ZGd1d	�d	e�ZGd2d
�d
e�ZdS)3z/Base classes for server/gateway implementations�)�FileWrapper�guess_scheme�
is_hop_by_hop)�Headers�N�BaseHandler�
SimpleHandler�BaseCGIHandler�
CGIHandler�
IISCGIHandler�read_environZMonZTueZWedZThuZFriZSatZSunZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDecc
	Cs:t�|�\	}}}}}}}}}	dt||t|||||fS)Nz#%s, %02d %3s %4d %02d:%02d:%02d GMT)�time�gmtime�_weekdayname�
_monthname)
Z	timestampZyearZmonthZdayZhhZmmZssZwd�y�z�r�(/usr/lib64/python3.8/wsgiref/handlers.py�format_date_times�r�SCRIPT_NAME�	PATH_INFOZQUERY_STRINGZREQUEST_METHODZ	AUTH_TYPEZCONTENT_TYPEZCONTENT_LENGTHZHTTPSZREMOTE_USERZREMOTE_IDENTcCs6t|�p4|�d�p4|�d�p4|�d�o4t|dd��S)NZHTTP_ZSSL_Z	REDIRECT_�	)�_is_request�
startswith�_needs_transcode)�krrrrs�rcCs�t��}d}zd�d|�Wntk
r4d}YnXi}tj��D]�\}}t|�r�tjdkr�tj�	dd��
�}|�d�r�|�d��d�}q�|�d	�r�q�|�d
�r�d|kr�|�d��d�}q�|�|d��d�}n|�||��d�}|||<qD|S)z'Read environment, fixing HTTP variables�surrogateescape�zutf-8�replaceZwin32�SERVER_SOFTWAREzmicrosoft-iis/�
iso-8859-1zapache/zsimplehttp/zpython/3)
�sys�getfilesystemencoding�encode�LookupError�os�environ�itemsr�platform�get�lowerr�decode)�encZescr'r�vZsoftwarerrrr"s0

	

��
c@s"eZdZdZdZdZdZdZdZdZ	dZ
e�Ze
ZeZdZdZdgZd	ZdZZdZdZd
Zdd�Zd
d�Zdd�Zdd�Zdd�Zdd�Zd;dd�Z dd�Z!dd�Z"dd�Z#dd �Z$d!d"�Z%d#d$�Z&d%d&�Z'd'd(�Z(d)d*�Z)d+d,�Z*d-d.�Z+d/d0�Z,d1d2�Z-d3d4�Z.d5d6�Z/d7d8�Z0d9d:�Z1dS)<rz+Manage the invocation of a WSGI application)rrTFz1.0Nz500 Internal Server Error)zContent-Typez
text/plains;A server error occurred.  Please contact the administrator.rc
Cstz$|��||j|j�|_|��WnJtttfk
r@YdSz|��Wn|�	��YnXYnXdS)zInvoke the applicationN)
�
setup_environr'�start_response�result�finish_response�ConnectionAbortedError�BrokenPipeError�ConnectionResetError�handle_error�close)�selfZapplicationrrr�run�szBaseHandler.runcCs�|j��}|_|��|��|d<|��|d<|j|d<|j|d<|��|d<|j	|d<|j
|d<|jdk	rx|j|d	<|jr�|j
r�|�d
|j
�dS)z&Set up the environment for one requestz
wsgi.inputzwsgi.errorszwsgi.versionz
wsgi.run_oncezwsgi.url_schemezwsgi.multithreadzwsgi.multiprocessNzwsgi.file_wrapperr )�
os_environ�copyr'�add_cgi_vars�	get_stdin�
get_stderr�wsgi_version�
wsgi_run_once�
get_scheme�wsgi_multithread�wsgi_multiprocess�wsgi_file_wrapper�
origin_server�server_software�
setdefault)r8�envrrrr/�s





zBaseHandler.setup_environcCsdz2|��r|��s0|jD]}|�|�q|��Wn$t|jd�rP|j���Yn
X|��dS)a>Send any iterable data, then close self and the iterable

        Subclasses intended for use in asynchronous servers will
        want to redefine this method, such that it sets up callbacks
        in the event loop to iterate over the data, and to call
        'self.close()' once the response is finished.
        r7N)�result_is_file�sendfiler1�write�finish_content�hasattrr7�r8�datarrrr2�s

zBaseHandler.finish_responsecCs
t|j�S)z Return the URL scheme being used)rr'�r8rrrrA�szBaseHandler.get_schemec
CsJzt|j�}Wntttfk
r(YnX|dkrFt|j�|jd<dSdS)z@Compute Content-Length or switch to chunked encoding if possibler�Content-LengthN)�lenr1�	TypeError�AttributeError�NotImplementedError�str�
bytes_sent�headers)r8Zblocksrrr�set_content_length�szBaseHandler.set_content_lengthcCsd|jkr|��dS)zqMake any necessary header changes or defaults

        Subclasses can extend this to add other defaults.
        rQN)rXrYrPrrr�cleanup_headers�s
zBaseHandler.cleanup_headerscCsh|r2z$|jr&|d|d��|d��W5d}Xn|jdk	rDtd��||_|�|�|_|�|d�}|jS)z4'start_response()' callable as specified by PEP 3333Nrr�zHeaders already set!ZStatus)�headers_sent�with_tracebackrX�AssertionError�status�
headers_class�_convert_string_typerK)r8r_rX�exc_inforrrr0�s
zBaseHandler.start_responsecCs(t|�tkr|Std�|t|����dS)zConvert/check value type.z!{0} must be of type str (got {1})N)�typerVr^�format�repr)r8�value�titlerrrra�s
�z BaseHandler._convert_string_typecCs�|jrx|��r�|�d|j|jf�d��d|jkrP|�dtt����d��|j	r�d|jkr�|�d|j	�d��n|�d|j�d��dS)	z6Transmit version/status/date/server, via self._write()zHTTP/%s %s
r!ZDatez
Date: %s
ZServerzServer: %s
zStatus: %s
N)
rE�client_is_modern�_write�http_versionr_r$rXrr
rFrPrrr�
send_preambles
�zBaseHandler.send_preamblecCsR|jstd��n,|js*t|�|_|��n|jt|�7_|�|�|��dS)z+'write()' callable as specified by PEP 3333zwrite() before start_response()N)r_r^r\rRrW�send_headersri�_flushrNrrrrKs



zBaseHandler.writecCsdS)aPlatform-specific file transmission

        Override this method in subclasses to support platform-specific
        file transmission.  It is only called if the application's
        return iterable ('self.result') is an instance of
        'self.wsgi_file_wrapper'.

        This method should return a true value if it was able to actually
        transmit the wrapped file-like object using a platform-specific
        approach.  It should return a false value if normal iteration
        should be used instead.  An exception can be raised to indicate
        that transmission was attempted, but failed.

        NOTE: this method should call 'self.send_headers()' if
        'self.headers_sent' is false and it is going to attempt direct
        transmission of the file.
        FrrPrrrrJ)szBaseHandler.sendfilecCs"|js|j�dd�|��ndS)z.Ensure headers and content have both been sentrQ�0N)r\rXrGrlrPrrrrL>s
zBaseHandler.finish_contentc	CsFzt|jd�r|j��W5d|_|_|_|_d|_d|_XdS)z�Close the iterable (if needed) and reset all instance vars

        Subclasses may want to also drop the client connection.
        NrFr7)r1rXr_r'rWr\rMr7rPrrrr7HszBaseHandler.closecCs8|��d|_|jr|��r4|��|�t|j��dS)z1Transmit headers to the client, via self._write()TN)rZr\rErhrkri�bytesrXrPrrrrlUs
zBaseHandler.send_headerscCs|j}|dk	ot|j|�S)z@True if 'self.result' is an instance of 'self.wsgi_file_wrapper'N)rD�
isinstancer1)r8�wrapperrrrrI^szBaseHandler.result_is_filecCs|jd��dkS)z,True if client can accept status and headersZSERVER_PROTOCOLzHTTP/0.9)r'�upperrPrrrrhdszBaseHandler.client_is_moderncCsJz>ddlm}|��}||d|d|d|j|�|��W5d}XdS)z�Log the 'exc_info' tuple in the server log

        Subclasses may override to retarget the output or change its format.
        Nr)�print_exceptionrr[)�	tracebackrsr>�traceback_limit�flush)r8rbrs�stderrrrr�
log_exceptionis�zBaseHandler.log_exceptioncCs2|�t���|js.|�|j|j�|_|��dS)z>Log current error, and send error output to client if possibleN)	rxr"rbr\�error_outputr'r0r1r2rPrrrr6yszBaseHandler.handle_errorcCs$||j|jdd�t���|jgS)aZWSGI mini-app to create error output

        By default, this just uses the 'error_status', 'error_headers',
        and 'error_body' attributes to generate an output page.  It can
        be overridden in a subclass to dynamically generate diagnostics,
        choose an appropriate message for the user's preferred language, etc.

        Note, however, that it's not recommended from a security perspective to
        spit out diagnostics to any old user; ideally, you should have to do
        something special to enable diagnostic output, which is why we don't
        include any here!
        N)�error_status�
error_headersr"rb�
error_body)r8r'r0rrrry�s
zBaseHandler.error_outputcCst�dS)aOverride in subclass to buffer data for send to client

        It's okay if this method actually transmits the data; BaseHandler
        just separates write and flush operations for greater efficiency
        when the underlying system actually has such a distinction.
        N�rUrNrrrri�szBaseHandler._writecCst�dS)z�Override in subclass to force sending of recent '_write()' calls

        It's okay if this method is a no-op (i.e., if '_write()' actually
        sends the data.
        Nr}rPrrrrm�szBaseHandler._flushcCst�dS)z4Override in subclass to return suitable 'wsgi.input'Nr}rPrrrr=�szBaseHandler.get_stdincCst�dS)z5Override in subclass to return suitable 'wsgi.errors'Nr}rPrrrr>�szBaseHandler.get_stderrcCst�dS)z>Override in subclass to insert CGI variables in 'self.environ'Nr}rPrrrr<�szBaseHandler.add_cgi_vars)N)2�__name__�
__module__�__qualname__�__doc__r?rBrCr@rErjrFrr:rrDrr`rurzr{r|r_r1r\rXrWr9r/r2rArYrZr0rarkrKrJrLr7rlrIrhrxr6ryrirmr=r>r<rrrrr^sV



		c@sBeZdZdZddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dS)raqHandler that's just initialized with streams, environment, etc.

    This handler subclass is intended for synchronous HTTP/1.0 origin servers,
    and handles sending the entire response output, given the correct inputs.

    Usage::

        handler = SimpleHandler(
            inp,out,err,env, multithread=False, multiprocess=True
        )
        handler.run(app)TFcCs(||_||_||_||_||_||_dS�N)�stdin�stdoutrw�base_envrBrC)r8r�r�rwr'�multithread�multiprocessrrr�__init__�szSimpleHandler.__init__cCs|jSr�)r�rPrrrr=�szSimpleHandler.get_stdincCs|jSr�)rwrPrrrr>�szSimpleHandler.get_stderrcCs|j�|j�dSr�)r'�updater�rPrrrr<�szSimpleHandler.add_cgi_varscCs^|j�|�}|dks |t|�kr$dSddlm}|dt�||d�}|sLqZ|j�|�}q:dS)Nr)�warnz9SimpleHandler.stdout.write() should not do partial writes)r�rKrR�warningsr��DeprecationWarning)r8rOr1r�rrrri�s�zSimpleHandler._writecCs|j��|jj|_dSr�)r�rvrmrPrrrrm�s
zSimpleHandler._flushN)TF)
r~rr�r�r�r=r>r<rirmrrrrr�s
�


c@seZdZdZdZdS)r	a�CGI-like systems using input/output/error streams and environ mapping

    Usage::

        handler = BaseCGIHandler(inp,out,err,env)
        handler.run(app)

    This handler class is useful for gateway protocols like ReadyExec and
    FastCGI, that have usable input/output/error streams and an environment
    mapping.  It's also the base class for CGIHandler, which just uses
    sys.stdin, os.environ, and so on.

    The constructor also takes keyword arguments 'multithread' and
    'multiprocess' (defaulting to 'True' and 'False' respectively) to control
    the configuration sent to the application.  It sets 'origin_server' to
    False (to enable CGI-like output), and assumes that 'wsgi.run_once' is
    False.
    FN)r~rr�r�rErrrrr	�sc@s eZdZdZdZiZdd�ZdS)r
a�CGI-based invocation via sys.stdin/stdout/stderr and os.environ

    Usage::

        CGIHandler().run(app)

    The difference between this class and BaseCGIHandler is that it always
    uses 'wsgi.run_once' of 'True', 'wsgi.multithread' of 'False', and
    'wsgi.multiprocess' of 'True'.  It does not take any initialization
    parameters, but always uses 'sys.stdin', 'os.environ', and friends.

    If you need to override any of these parameters, use BaseCGIHandler
    instead.
    Tc	Cs(tj|tjjtjjtjt�ddd�dS)NFT�r�r�)r	r�r"r��bufferr�rwrrPrrrr�s�zCGIHandler.__init__N�r~rr�r�r@r:r�rrrrr
�sc@s eZdZdZdZiZdd�ZdS)raCGI-based invocation with workaround for IIS path bug

    This handler should be used in preference to CGIHandler when deploying on
    Microsoft IIS without having set the config allowPathInfo option (IIS>=7)
    or metabase allowPathInfoForScriptMappings (IIS<7).
    Tc	Csjt�}|�dd�}|�dd�}|d�|d�rD|t|�d�|d<tj|tjjtj	jtj
|ddd�dS)Nrrr�/FTr�)rr*rrRr	r�r"r�r�r�rw)r8r'�pathZscriptrrrr�2s�zIISCGIHandler.__init__Nr�rrrrrs)r��utilrrrrXrr"r&r
�__all__rrr�__contains__rrrrrr	r
rrrrr�<module>s\���<V2wsgiref/__pycache__/__init__.cpython-38.pyc000064400000001326151153537630014624 0ustar00U

e5dK�@sdZdS)aDwsgiref -- a WSGI (PEP 3333) Reference Library

Current Contents:

* util -- Miscellaneous useful functions and wrappers

* headers -- Manage response headers

* handlers -- base classes for server/gateway implementations

* simple_server -- a simple BaseHTTPServer that supports WSGI

* validate -- validation wrapper that sits between an app and a server
  to detect errors in either

To-Do:

* cgi_gateway -- Run WSGI apps under CGI (pending a deployment standard)

* cgi_wrapper -- Run CGI apps under WSGI

* router -- a simple middleware component that handles URL traversal
N)�__doc__�rr�(/usr/lib64/python3.8/wsgiref/__init__.py�<module>�wsgiref/validate.py000064400000035373151153537630010401 0ustar00# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
# Also licenced under the Apache License, 2.0: http://opensource.org/licenses/apache2.0.php
# Licensed to PSF under a Contributor Agreement
"""
Middleware to check for obedience to the WSGI specification.

Some of the things this checks:

* Signature of the application and start_response (including that
  keyword arguments are not used).

* Environment checks:

  - Environment is a dictionary (and not a subclass).

  - That all the required keys are in the environment: REQUEST_METHOD,
    SERVER_NAME, SERVER_PORT, wsgi.version, wsgi.input, wsgi.errors,
    wsgi.multithread, wsgi.multiprocess, wsgi.run_once

  - That HTTP_CONTENT_TYPE and HTTP_CONTENT_LENGTH are not in the
    environment (these headers should appear as CONTENT_LENGTH and
    CONTENT_TYPE).

  - Warns if QUERY_STRING is missing, as the cgi module acts
    unpredictably in that case.

  - That CGI-style variables (that don't contain a .) have
    (non-unicode) string values

  - That wsgi.version is a tuple

  - That wsgi.url_scheme is 'http' or 'https' (@@: is this too
    restrictive?)

  - Warns if the REQUEST_METHOD is not known (@@: probably too
    restrictive).

  - That SCRIPT_NAME and PATH_INFO are empty or start with /

  - That at least one of SCRIPT_NAME or PATH_INFO are set.

  - That CONTENT_LENGTH is a positive integer.

  - That SCRIPT_NAME is not '/' (it should be '', and PATH_INFO should
    be '/').

  - That wsgi.input has the methods read, readline, readlines, and
    __iter__

  - That wsgi.errors has the methods flush, write, writelines

* The status is a string, contains a space, starts with an integer,
  and that integer is in range (> 100).

* That the headers is a list (not a subclass, not another kind of
  sequence).

* That the items of the headers are tuples of strings.

* That there is no 'status' header (that is used in CGI, but not in
  WSGI).

* That the headers don't contain newlines or colons, end in _ or -, or
  contain characters codes below 037.

* That Content-Type is given if there is content (CGI often has a
  default content type, but WSGI does not).

* That no Content-Type is given when there is no content (@@: is this
  too restrictive?)

* That the exc_info argument to start_response is a tuple or None.

* That all calls to the writer are with strings, and no other methods
  on the writer are accessed.

* That wsgi.input is used properly:

  - .read() is called with exactly one argument

  - That it returns a string

  - That readline, readlines, and __iter__ return strings

  - That .close() is not called

  - No other methods are provided

* That wsgi.errors is used properly:

  - .write() and .writelines() is called with a string

  - That .close() is not called, and no other methods are provided.

* The response iterator:

  - That it is not a string (it should be a list of a single string; a
    string will work, but perform horribly).

  - That .__next__() returns a string

  - That the iterator is not iterated over until start_response has
    been called (that can signal either a server or application
    error).

  - That .close() is called (doesn't raise exception, only prints to
    sys.stderr, because we only know it isn't called when the object
    is garbage collected).
"""
__all__ = ['validator']


import re
import sys
import warnings

header_re = re.compile(r'^[a-zA-Z][a-zA-Z0-9\-_]*$')
bad_header_value_re = re.compile(r'[\000-\037]')

class WSGIWarning(Warning):
    """
    Raised in response to WSGI-spec-related warnings
    """

def assert_(cond, *args):
    if not cond:
        raise AssertionError(*args)

def check_string_type(value, title):
    if type (value) is str:
        return value
    raise AssertionError(
        "{0} must be of type str (got {1})".format(title, repr(value)))

def validator(application):

    """
    When applied between a WSGI server and a WSGI application, this
    middleware will check for WSGI compliancy on a number of levels.
    This middleware does not modify the request or response in any
    way, but will raise an AssertionError if anything seems off
    (except for a failure to close the application iterator, which
    will be printed to stderr -- there's no way to raise an exception
    at that point).
    """

    def lint_app(*args, **kw):
        assert_(len(args) == 2, "Two arguments required")
        assert_(not kw, "No keyword arguments allowed")
        environ, start_response = args

        check_environ(environ)

        # We use this to check if the application returns without
        # calling start_response:
        start_response_started = []

        def start_response_wrapper(*args, **kw):
            assert_(len(args) == 2 or len(args) == 3, (
                "Invalid number of arguments: %s" % (args,)))
            assert_(not kw, "No keyword arguments allowed")
            status = args[0]
            headers = args[1]
            if len(args) == 3:
                exc_info = args[2]
            else:
                exc_info = None

            check_status(status)
            check_headers(headers)
            check_content_type(status, headers)
            check_exc_info(exc_info)

            start_response_started.append(None)
            return WriteWrapper(start_response(*args))

        environ['wsgi.input'] = InputWrapper(environ['wsgi.input'])
        environ['wsgi.errors'] = ErrorWrapper(environ['wsgi.errors'])

        iterator = application(environ, start_response_wrapper)
        assert_(iterator is not None and iterator != False,
            "The application must return an iterator, if only an empty list")

        check_iterator(iterator)

        return IteratorWrapper(iterator, start_response_started)

    return lint_app

class InputWrapper:

    def __init__(self, wsgi_input):
        self.input = wsgi_input

    def read(self, *args):
        assert_(len(args) == 1)
        v = self.input.read(*args)
        assert_(type(v) is bytes)
        return v

    def readline(self, *args):
        assert_(len(args) <= 1)
        v = self.input.readline(*args)
        assert_(type(v) is bytes)
        return v

    def readlines(self, *args):
        assert_(len(args) <= 1)
        lines = self.input.readlines(*args)
        assert_(type(lines) is list)
        for line in lines:
            assert_(type(line) is bytes)
        return lines

    def __iter__(self):
        while 1:
            line = self.readline()
            if not line:
                return
            yield line

    def close(self):
        assert_(0, "input.close() must not be called")

class ErrorWrapper:

    def __init__(self, wsgi_errors):
        self.errors = wsgi_errors

    def write(self, s):
        assert_(type(s) is str)
        self.errors.write(s)

    def flush(self):
        self.errors.flush()

    def writelines(self, seq):
        for line in seq:
            self.write(line)

    def close(self):
        assert_(0, "errors.close() must not be called")

class WriteWrapper:

    def __init__(self, wsgi_writer):
        self.writer = wsgi_writer

    def __call__(self, s):
        assert_(type(s) is bytes)
        self.writer(s)

class PartialIteratorWrapper:

    def __init__(self, wsgi_iterator):
        self.iterator = wsgi_iterator

    def __iter__(self):
        # We want to make sure __iter__ is called
        return IteratorWrapper(self.iterator, None)

class IteratorWrapper:

    def __init__(self, wsgi_iterator, check_start_response):
        self.original_iterator = wsgi_iterator
        self.iterator = iter(wsgi_iterator)
        self.closed = False
        self.check_start_response = check_start_response

    def __iter__(self):
        return self

    def __next__(self):
        assert_(not self.closed,
            "Iterator read after closed")
        v = next(self.iterator)
        if type(v) is not bytes:
            assert_(False, "Iterator yielded non-bytestring (%r)" % (v,))
        if self.check_start_response is not None:
            assert_(self.check_start_response,
                "The application returns and we started iterating over its body, but start_response has not yet been called")
            self.check_start_response = None
        return v

    def close(self):
        self.closed = True
        if hasattr(self.original_iterator, 'close'):
            self.original_iterator.close()

    def __del__(self):
        if not self.closed:
            sys.stderr.write(
                "Iterator garbage collected without being closed")
        assert_(self.closed,
            "Iterator garbage collected without being closed")

def check_environ(environ):
    assert_(type(environ) is dict,
        "Environment is not of the right type: %r (environment: %r)"
        % (type(environ), environ))

    for key in ['REQUEST_METHOD', 'SERVER_NAME', 'SERVER_PORT',
                'wsgi.version', 'wsgi.input', 'wsgi.errors',
                'wsgi.multithread', 'wsgi.multiprocess',
                'wsgi.run_once']:
        assert_(key in environ,
            "Environment missing required key: %r" % (key,))

    for key in ['HTTP_CONTENT_TYPE', 'HTTP_CONTENT_LENGTH']:
        assert_(key not in environ,
            "Environment should not have the key: %s "
            "(use %s instead)" % (key, key[5:]))

    if 'QUERY_STRING' not in environ:
        warnings.warn(
            'QUERY_STRING is not in the WSGI environment; the cgi '
            'module will use sys.argv when this variable is missing, '
            'so application errors are more likely',
            WSGIWarning)

    for key in environ.keys():
        if '.' in key:
            # Extension, we don't care about its type
            continue
        assert_(type(environ[key]) is str,
            "Environmental variable %s is not a string: %r (value: %r)"
            % (key, type(environ[key]), environ[key]))

    assert_(type(environ['wsgi.version']) is tuple,
        "wsgi.version should be a tuple (%r)" % (environ['wsgi.version'],))
    assert_(environ['wsgi.url_scheme'] in ('http', 'https'),
        "wsgi.url_scheme unknown: %r" % environ['wsgi.url_scheme'])

    check_input(environ['wsgi.input'])
    check_errors(environ['wsgi.errors'])

    # @@: these need filling out:
    if environ['REQUEST_METHOD'] not in (
        'GET', 'HEAD', 'POST', 'OPTIONS', 'PATCH', 'PUT', 'DELETE', 'TRACE'):
        warnings.warn(
            "Unknown REQUEST_METHOD: %r" % environ['REQUEST_METHOD'],
            WSGIWarning)

    assert_(not environ.get('SCRIPT_NAME')
            or environ['SCRIPT_NAME'].startswith('/'),
        "SCRIPT_NAME doesn't start with /: %r" % environ['SCRIPT_NAME'])
    assert_(not environ.get('PATH_INFO')
            or environ['PATH_INFO'].startswith('/'),
        "PATH_INFO doesn't start with /: %r" % environ['PATH_INFO'])
    if environ.get('CONTENT_LENGTH'):
        assert_(int(environ['CONTENT_LENGTH']) >= 0,
            "Invalid CONTENT_LENGTH: %r" % environ['CONTENT_LENGTH'])

    if not environ.get('SCRIPT_NAME'):
        assert_('PATH_INFO' in environ,
            "One of SCRIPT_NAME or PATH_INFO are required (PATH_INFO "
            "should at least be '/' if SCRIPT_NAME is empty)")
    assert_(environ.get('SCRIPT_NAME') != '/',
        "SCRIPT_NAME cannot be '/'; it should instead be '', and "
        "PATH_INFO should be '/'")

def check_input(wsgi_input):
    for attr in ['read', 'readline', 'readlines', '__iter__']:
        assert_(hasattr(wsgi_input, attr),
            "wsgi.input (%r) doesn't have the attribute %s"
            % (wsgi_input, attr))

def check_errors(wsgi_errors):
    for attr in ['flush', 'write', 'writelines']:
        assert_(hasattr(wsgi_errors, attr),
            "wsgi.errors (%r) doesn't have the attribute %s"
            % (wsgi_errors, attr))

def check_status(status):
    status = check_string_type(status, "Status")
    # Implicitly check that we can turn it into an integer:
    status_code = status.split(None, 1)[0]
    assert_(len(status_code) == 3,
        "Status codes must be three characters: %r" % status_code)
    status_int = int(status_code)
    assert_(status_int >= 100, "Status code is invalid: %r" % status_int)
    if len(status) < 4 or status[3] != ' ':
        warnings.warn(
            "The status string (%r) should be a three-digit integer "
            "followed by a single space and a status explanation"
            % status, WSGIWarning)

def check_headers(headers):
    assert_(type(headers) is list,
        "Headers (%r) must be of type list: %r"
        % (headers, type(headers)))
    for item in headers:
        assert_(type(item) is tuple,
            "Individual headers (%r) must be of type tuple: %r"
            % (item, type(item)))
        assert_(len(item) == 2)
        name, value = item
        name = check_string_type(name, "Header name")
        value = check_string_type(value, "Header value")
        assert_(name.lower() != 'status',
            "The Status header cannot be used; it conflicts with CGI "
            "script, and HTTP status is not given through headers "
            "(value: %r)." % value)
        assert_('\n' not in name and ':' not in name,
            "Header names may not contain ':' or '\\n': %r" % name)
        assert_(header_re.search(name), "Bad header name: %r" % name)
        assert_(not name.endswith('-') and not name.endswith('_'),
            "Names may not end in '-' or '_': %r" % name)
        if bad_header_value_re.search(value):
            assert_(0, "Bad header value: %r (bad char: %r)"
            % (value, bad_header_value_re.search(value).group(0)))

def check_content_type(status, headers):
    status = check_string_type(status, "Status")
    code = int(status.split(None, 1)[0])
    # @@: need one more person to verify this interpretation of RFC 2616
    #     http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
    NO_MESSAGE_BODY = (204, 304)
    for name, value in headers:
        name = check_string_type(name, "Header name")
        if name.lower() == 'content-type':
            if code not in NO_MESSAGE_BODY:
                return
            assert_(0, ("Content-Type header found in a %s response, "
                        "which must not return content.") % code)
    if code not in NO_MESSAGE_BODY:
        assert_(0, "No Content-Type header found in headers (%s)" % headers)

def check_exc_info(exc_info):
    assert_(exc_info is None or type(exc_info) is tuple,
        "exc_info (%r) is not a tuple: %r" % (exc_info, type(exc_info)))
    # More exc_info checks?

def check_iterator(iterator):
    # Technically a bytestring is legal, which is why it's a really bad
    # idea, because it may cause the response to be returned
    # character-by-character
    assert_(not isinstance(iterator, (str, bytes)),
        "You should not return a string as your application iterator, "
        "instead return a single-item list containing a bytestring.")
importlib/util.py000064400000026067151153537630010120 0ustar00"""Utility code for constructing importers, etc."""
from . import abc
from ._bootstrap import module_from_spec
from ._bootstrap import _resolve_name
from ._bootstrap import spec_from_loader
from ._bootstrap import _find_spec
from ._bootstrap_external import MAGIC_NUMBER
from ._bootstrap_external import _RAW_MAGIC_NUMBER
from ._bootstrap_external import cache_from_source
from ._bootstrap_external import decode_source
from ._bootstrap_external import source_from_cache
from ._bootstrap_external import spec_from_file_location

from contextlib import contextmanager
import _imp
import functools
import sys
import types
import warnings


def source_hash(source_bytes):
    "Return the hash of *source_bytes* as used in hash-based pyc files."
    return _imp.source_hash(_RAW_MAGIC_NUMBER, source_bytes)


def resolve_name(name, package):
    """Resolve a relative module name to an absolute one."""
    if not name.startswith('.'):
        return name
    elif not package:
        raise ValueError(f'no package specified for {repr(name)} '
                         '(required for relative module names)')
    level = 0
    for character in name:
        if character != '.':
            break
        level += 1
    return _resolve_name(name[level:], package, level)


def _find_spec_from_path(name, path=None):
    """Return the spec for the specified module.

    First, sys.modules is checked to see if the module was already imported. If
    so, then sys.modules[name].__spec__ is returned. If that happens to be
    set to None, then ValueError is raised. If the module is not in
    sys.modules, then sys.meta_path is searched for a suitable spec with the
    value of 'path' given to the finders. None is returned if no spec could
    be found.

    Dotted names do not have their parent packages implicitly imported. You will
    most likely need to explicitly import all parent packages in the proper
    order for a submodule to get the correct spec.

    """
    if name not in sys.modules:
        return _find_spec(name, path)
    else:
        module = sys.modules[name]
        if module is None:
            return None
        try:
            spec = module.__spec__
        except AttributeError:
            raise ValueError('{}.__spec__ is not set'.format(name)) from None
        else:
            if spec is None:
                raise ValueError('{}.__spec__ is None'.format(name))
            return spec


def find_spec(name, package=None):
    """Return the spec for the specified module.

    First, sys.modules is checked to see if the module was already imported. If
    so, then sys.modules[name].__spec__ is returned. If that happens to be
    set to None, then ValueError is raised. If the module is not in
    sys.modules, then sys.meta_path is searched for a suitable spec with the
    value of 'path' given to the finders. None is returned if no spec could
    be found.

    If the name is for submodule (contains a dot), the parent module is
    automatically imported.

    The name and package arguments work the same as importlib.import_module().
    In other words, relative module names (with leading dots) work.

    """
    fullname = resolve_name(name, package) if name.startswith('.') else name
    if fullname not in sys.modules:
        parent_name = fullname.rpartition('.')[0]
        if parent_name:
            parent = __import__(parent_name, fromlist=['__path__'])
            try:
                parent_path = parent.__path__
            except AttributeError as e:
                raise ModuleNotFoundError(
                    f"__path__ attribute not found on {parent_name!r} "
                    f"while trying to find {fullname!r}", name=fullname) from e
        else:
            parent_path = None
        return _find_spec(fullname, parent_path)
    else:
        module = sys.modules[fullname]
        if module is None:
            return None
        try:
            spec = module.__spec__
        except AttributeError:
            raise ValueError('{}.__spec__ is not set'.format(name)) from None
        else:
            if spec is None:
                raise ValueError('{}.__spec__ is None'.format(name))
            return spec


@contextmanager
def _module_to_load(name):
    is_reload = name in sys.modules

    module = sys.modules.get(name)
    if not is_reload:
        # This must be done before open() is called as the 'io' module
        # implicitly imports 'locale' and would otherwise trigger an
        # infinite loop.
        module = type(sys)(name)
        # This must be done before putting the module in sys.modules
        # (otherwise an optimization shortcut in import.c becomes wrong)
        module.__initializing__ = True
        sys.modules[name] = module
    try:
        yield module
    except Exception:
        if not is_reload:
            try:
                del sys.modules[name]
            except KeyError:
                pass
    finally:
        module.__initializing__ = False


def set_package(fxn):
    """Set __package__ on the returned module.

    This function is deprecated.

    """
    @functools.wraps(fxn)
    def set_package_wrapper(*args, **kwargs):
        warnings.warn('The import system now takes care of this automatically.',
                      DeprecationWarning, stacklevel=2)
        module = fxn(*args, **kwargs)
        if getattr(module, '__package__', None) is None:
            module.__package__ = module.__name__
            if not hasattr(module, '__path__'):
                module.__package__ = module.__package__.rpartition('.')[0]
        return module
    return set_package_wrapper


def set_loader(fxn):
    """Set __loader__ on the returned module.

    This function is deprecated.

    """
    @functools.wraps(fxn)
    def set_loader_wrapper(self, *args, **kwargs):
        warnings.warn('The import system now takes care of this automatically.',
                      DeprecationWarning, stacklevel=2)
        module = fxn(self, *args, **kwargs)
        if getattr(module, '__loader__', None) is None:
            module.__loader__ = self
        return module
    return set_loader_wrapper


def module_for_loader(fxn):
    """Decorator to handle selecting the proper module for loaders.

    The decorated function is passed the module to use instead of the module
    name. The module passed in to the function is either from sys.modules if
    it already exists or is a new module. If the module is new, then __name__
    is set the first argument to the method, __loader__ is set to self, and
    __package__ is set accordingly (if self.is_package() is defined) will be set
    before it is passed to the decorated function (if self.is_package() does
    not work for the module it will be set post-load).

    If an exception is raised and the decorator created the module it is
    subsequently removed from sys.modules.

    The decorator assumes that the decorated function takes the module name as
    the second argument.

    """
    warnings.warn('The import system now takes care of this automatically.',
                  DeprecationWarning, stacklevel=2)
    @functools.wraps(fxn)
    def module_for_loader_wrapper(self, fullname, *args, **kwargs):
        with _module_to_load(fullname) as module:
            module.__loader__ = self
            try:
                is_package = self.is_package(fullname)
            except (ImportError, AttributeError):
                pass
            else:
                if is_package:
                    module.__package__ = fullname
                else:
                    module.__package__ = fullname.rpartition('.')[0]
            # If __package__ was not set above, __import__() will do it later.
            return fxn(self, module, *args, **kwargs)

    return module_for_loader_wrapper


class _LazyModule(types.ModuleType):

    """A subclass of the module type which triggers loading upon attribute access."""

    def __getattribute__(self, attr):
        """Trigger the load of the module and return the attribute."""
        # All module metadata must be garnered from __spec__ in order to avoid
        # using mutated values.
        # Stop triggering this method.
        self.__class__ = types.ModuleType
        # Get the original name to make sure no object substitution occurred
        # in sys.modules.
        original_name = self.__spec__.name
        # Figure out exactly what attributes were mutated between the creation
        # of the module and now.
        attrs_then = self.__spec__.loader_state['__dict__']
        original_type = self.__spec__.loader_state['__class__']
        attrs_now = self.__dict__
        attrs_updated = {}
        for key, value in attrs_now.items():
            # Code that set the attribute may have kept a reference to the
            # assigned object, making identity more important than equality.
            if key not in attrs_then:
                attrs_updated[key] = value
            elif id(attrs_now[key]) != id(attrs_then[key]):
                attrs_updated[key] = value
        self.__spec__.loader.exec_module(self)
        # If exec_module() was used directly there is no guarantee the module
        # object was put into sys.modules.
        if original_name in sys.modules:
            if id(self) != id(sys.modules[original_name]):
                raise ValueError(f"module object for {original_name!r} "
                                  "substituted in sys.modules during a lazy "
                                  "load")
        # Update after loading since that's what would happen in an eager
        # loading situation.
        self.__dict__.update(attrs_updated)
        return getattr(self, attr)

    def __delattr__(self, attr):
        """Trigger the load and then perform the deletion."""
        # To trigger the load and raise an exception if the attribute
        # doesn't exist.
        self.__getattribute__(attr)
        delattr(self, attr)


class LazyLoader(abc.Loader):

    """A loader that creates a module which defers loading until attribute access."""

    @staticmethod
    def __check_eager_loader(loader):
        if not hasattr(loader, 'exec_module'):
            raise TypeError('loader must define exec_module()')

    @classmethod
    def factory(cls, loader):
        """Construct a callable which returns the eager loader made lazy."""
        cls.__check_eager_loader(loader)
        return lambda *args, **kwargs: cls(loader(*args, **kwargs))

    def __init__(self, loader):
        self.__check_eager_loader(loader)
        self.loader = loader

    def create_module(self, spec):
        return self.loader.create_module(spec)

    def exec_module(self, module):
        """Make the module load lazily."""
        module.__spec__.loader = self.loader
        module.__loader__ = self.loader
        # Don't need to worry about deep-copying as trying to set an attribute
        # on an object would have triggered the load,
        # e.g. ``module.__spec__.loader = None`` would trigger a load from
        # trying to access module.__spec__.
        loader_state = {}
        loader_state['__dict__'] = module.__dict__.copy()
        loader_state['__class__'] = module.__class__
        module.__spec__.loader_state = loader_state
        module.__class__ = _LazyModule
importlib/_bootstrap.py000064400000115334151153537630011313 0ustar00"""Core implementation of import.

This module is NOT meant to be directly imported! It has been designed such
that it can be bootstrapped into Python as the implementation of import. As
such it requires the injection of specific modules and attributes in order to
work. One should use importlib as the public-facing version of this module.

"""
#
# IMPORTANT: Whenever making changes to this module, be sure to run a top-level
# `make regen-importlib` followed by `make` in order to get the frozen version
# of the module updated. Not doing so will result in the Makefile to fail for
# all others who don't have a ./python around to freeze the module
# in the early stages of compilation.
#

# See importlib._setup() for what is injected into the global namespace.

# When editing this code be aware that code executed at import time CANNOT
# reference any injected objects! This includes not only global code but also
# anything specified at the class level.

# Bootstrap-related code ######################################################

_bootstrap_external = None

def _wrap(new, old):
    """Simple substitute for functools.update_wrapper."""
    for replace in ['__module__', '__name__', '__qualname__', '__doc__']:
        if hasattr(old, replace):
            setattr(new, replace, getattr(old, replace))
    new.__dict__.update(old.__dict__)


def _new_module(name):
    return type(sys)(name)


# Module-level locking ########################################################

# A dict mapping module names to weakrefs of _ModuleLock instances
# Dictionary protected by the global import lock
_module_locks = {}
# A dict mapping thread ids to _ModuleLock instances
_blocking_on = {}


class _DeadlockError(RuntimeError):
    pass


class _ModuleLock:
    """A recursive lock implementation which is able to detect deadlocks
    (e.g. thread 1 trying to take locks A then B, and thread 2 trying to
    take locks B then A).
    """

    def __init__(self, name):
        self.lock = _thread.allocate_lock()
        self.wakeup = _thread.allocate_lock()
        self.name = name
        self.owner = None
        self.count = 0
        self.waiters = 0

    def has_deadlock(self):
        # Deadlock avoidance for concurrent circular imports.
        me = _thread.get_ident()
        tid = self.owner
        while True:
            lock = _blocking_on.get(tid)
            if lock is None:
                return False
            tid = lock.owner
            if tid == me:
                return True

    def acquire(self):
        """
        Acquire the module lock.  If a potential deadlock is detected,
        a _DeadlockError is raised.
        Otherwise, the lock is always acquired and True is returned.
        """
        tid = _thread.get_ident()
        _blocking_on[tid] = self
        try:
            while True:
                with self.lock:
                    if self.count == 0 or self.owner == tid:
                        self.owner = tid
                        self.count += 1
                        return True
                    if self.has_deadlock():
                        raise _DeadlockError('deadlock detected by %r' % self)
                    if self.wakeup.acquire(False):
                        self.waiters += 1
                # Wait for a release() call
                self.wakeup.acquire()
                self.wakeup.release()
        finally:
            del _blocking_on[tid]

    def release(self):
        tid = _thread.get_ident()
        with self.lock:
            if self.owner != tid:
                raise RuntimeError('cannot release un-acquired lock')
            assert self.count > 0
            self.count -= 1
            if self.count == 0:
                self.owner = None
                if self.waiters:
                    self.waiters -= 1
                    self.wakeup.release()

    def __repr__(self):
        return '_ModuleLock({!r}) at {}'.format(self.name, id(self))


class _DummyModuleLock:
    """A simple _ModuleLock equivalent for Python builds without
    multi-threading support."""

    def __init__(self, name):
        self.name = name
        self.count = 0

    def acquire(self):
        self.count += 1
        return True

    def release(self):
        if self.count == 0:
            raise RuntimeError('cannot release un-acquired lock')
        self.count -= 1

    def __repr__(self):
        return '_DummyModuleLock({!r}) at {}'.format(self.name, id(self))


class _ModuleLockManager:

    def __init__(self, name):
        self._name = name
        self._lock = None

    def __enter__(self):
        self._lock = _get_module_lock(self._name)
        self._lock.acquire()

    def __exit__(self, *args, **kwargs):
        self._lock.release()


# The following two functions are for consumption by Python/import.c.

def _get_module_lock(name):
    """Get or create the module lock for a given module name.

    Acquire/release internally the global import lock to protect
    _module_locks."""

    _imp.acquire_lock()
    try:
        try:
            lock = _module_locks[name]()
        except KeyError:
            lock = None

        if lock is None:
            if _thread is None:
                lock = _DummyModuleLock(name)
            else:
                lock = _ModuleLock(name)

            def cb(ref, name=name):
                _imp.acquire_lock()
                try:
                    # bpo-31070: Check if another thread created a new lock
                    # after the previous lock was destroyed
                    # but before the weakref callback was called.
                    if _module_locks.get(name) is ref:
                        del _module_locks[name]
                finally:
                    _imp.release_lock()

            _module_locks[name] = _weakref.ref(lock, cb)
    finally:
        _imp.release_lock()

    return lock


def _lock_unlock_module(name):
    """Acquires then releases the module lock for a given module name.

    This is used to ensure a module is completely initialized, in the
    event it is being imported by another thread.
    """
    lock = _get_module_lock(name)
    try:
        lock.acquire()
    except _DeadlockError:
        # Concurrent circular import, we'll accept a partially initialized
        # module object.
        pass
    else:
        lock.release()

# Frame stripping magic ###############################################
def _call_with_frames_removed(f, *args, **kwds):
    """remove_importlib_frames in import.c will always remove sequences
    of importlib frames that end with a call to this function

    Use it instead of a normal call in places where including the importlib
    frames introduces unwanted noise into the traceback (e.g. when executing
    module code)
    """
    return f(*args, **kwds)


def _verbose_message(message, *args, verbosity=1):
    """Print the message to stderr if -v/PYTHONVERBOSE is turned on."""
    if sys.flags.verbose >= verbosity:
        if not message.startswith(('#', 'import ')):
            message = '# ' + message
        print(message.format(*args), file=sys.stderr)


def _requires_builtin(fxn):
    """Decorator to verify the named module is built-in."""
    def _requires_builtin_wrapper(self, fullname):
        if fullname not in sys.builtin_module_names:
            raise ImportError('{!r} is not a built-in module'.format(fullname),
                              name=fullname)
        return fxn(self, fullname)
    _wrap(_requires_builtin_wrapper, fxn)
    return _requires_builtin_wrapper


def _requires_frozen(fxn):
    """Decorator to verify the named module is frozen."""
    def _requires_frozen_wrapper(self, fullname):
        if not _imp.is_frozen(fullname):
            raise ImportError('{!r} is not a frozen module'.format(fullname),
                              name=fullname)
        return fxn(self, fullname)
    _wrap(_requires_frozen_wrapper, fxn)
    return _requires_frozen_wrapper


# Typically used by loader classes as a method replacement.
def _load_module_shim(self, fullname):
    """Load the specified module into sys.modules and return it.

    This method is deprecated.  Use loader.exec_module instead.

    """
    spec = spec_from_loader(fullname, self)
    if fullname in sys.modules:
        module = sys.modules[fullname]
        _exec(spec, module)
        return sys.modules[fullname]
    else:
        return _load(spec)

# Module specifications #######################################################

def _module_repr(module):
    # The implementation of ModuleType.__repr__().
    loader = getattr(module, '__loader__', None)
    if hasattr(loader, 'module_repr'):
        # As soon as BuiltinImporter, FrozenImporter, and NamespaceLoader
        # drop their implementations for module_repr. we can add a
        # deprecation warning here.
        try:
            return loader.module_repr(module)
        except Exception:
            pass
    try:
        spec = module.__spec__
    except AttributeError:
        pass
    else:
        if spec is not None:
            return _module_repr_from_spec(spec)

    # We could use module.__class__.__name__ instead of 'module' in the
    # various repr permutations.
    try:
        name = module.__name__
    except AttributeError:
        name = '?'
    try:
        filename = module.__file__
    except AttributeError:
        if loader is None:
            return '<module {!r}>'.format(name)
        else:
            return '<module {!r} ({!r})>'.format(name, loader)
    else:
        return '<module {!r} from {!r}>'.format(name, filename)


class ModuleSpec:
    """The specification for a module, used for loading.

    A module's spec is the source for information about the module.  For
    data associated with the module, including source, use the spec's
    loader.

    `name` is the absolute name of the module.  `loader` is the loader
    to use when loading the module.  `parent` is the name of the
    package the module is in.  The parent is derived from the name.

    `is_package` determines if the module is considered a package or
    not.  On modules this is reflected by the `__path__` attribute.

    `origin` is the specific location used by the loader from which to
    load the module, if that information is available.  When filename is
    set, origin will match.

    `has_location` indicates that a spec's "origin" reflects a location.
    When this is True, `__file__` attribute of the module is set.

    `cached` is the location of the cached bytecode file, if any.  It
    corresponds to the `__cached__` attribute.

    `submodule_search_locations` is the sequence of path entries to
    search when importing submodules.  If set, is_package should be
    True--and False otherwise.

    Packages are simply modules that (may) have submodules.  If a spec
    has a non-None value in `submodule_search_locations`, the import
    system will consider modules loaded from the spec as packages.

    Only finders (see importlib.abc.MetaPathFinder and
    importlib.abc.PathEntryFinder) should modify ModuleSpec instances.

    """

    def __init__(self, name, loader, *, origin=None, loader_state=None,
                 is_package=None):
        self.name = name
        self.loader = loader
        self.origin = origin
        self.loader_state = loader_state
        self.submodule_search_locations = [] if is_package else None

        # file-location attributes
        self._set_fileattr = False
        self._cached = None

    def __repr__(self):
        args = ['name={!r}'.format(self.name),
                'loader={!r}'.format(self.loader)]
        if self.origin is not None:
            args.append('origin={!r}'.format(self.origin))
        if self.submodule_search_locations is not None:
            args.append('submodule_search_locations={}'
                        .format(self.submodule_search_locations))
        return '{}({})'.format(self.__class__.__name__, ', '.join(args))

    def __eq__(self, other):
        smsl = self.submodule_search_locations
        try:
            return (self.name == other.name and
                    self.loader == other.loader and
                    self.origin == other.origin and
                    smsl == other.submodule_search_locations and
                    self.cached == other.cached and
                    self.has_location == other.has_location)
        except AttributeError:
            return False

    @property
    def cached(self):
        if self._cached is None:
            if self.origin is not None and self._set_fileattr:
                if _bootstrap_external is None:
                    raise NotImplementedError
                self._cached = _bootstrap_external._get_cached(self.origin)
        return self._cached

    @cached.setter
    def cached(self, cached):
        self._cached = cached

    @property
    def parent(self):
        """The name of the module's parent."""
        if self.submodule_search_locations is None:
            return self.name.rpartition('.')[0]
        else:
            return self.name

    @property
    def has_location(self):
        return self._set_fileattr

    @has_location.setter
    def has_location(self, value):
        self._set_fileattr = bool(value)


def spec_from_loader(name, loader, *, origin=None, is_package=None):
    """Return a module spec based on various loader methods."""
    if hasattr(loader, 'get_filename'):
        if _bootstrap_external is None:
            raise NotImplementedError
        spec_from_file_location = _bootstrap_external.spec_from_file_location

        if is_package is None:
            return spec_from_file_location(name, loader=loader)
        search = [] if is_package else None
        return spec_from_file_location(name, loader=loader,
                                       submodule_search_locations=search)

    if is_package is None:
        if hasattr(loader, 'is_package'):
            try:
                is_package = loader.is_package(name)
            except ImportError:
                is_package = None  # aka, undefined
        else:
            # the default
            is_package = False

    return ModuleSpec(name, loader, origin=origin, is_package=is_package)


def _spec_from_module(module, loader=None, origin=None):
    # This function is meant for use in _setup().
    try:
        spec = module.__spec__
    except AttributeError:
        pass
    else:
        if spec is not None:
            return spec

    name = module.__name__
    if loader is None:
        try:
            loader = module.__loader__
        except AttributeError:
            # loader will stay None.
            pass
    try:
        location = module.__file__
    except AttributeError:
        location = None
    if origin is None:
        if location is None:
            try:
                origin = loader._ORIGIN
            except AttributeError:
                origin = None
        else:
            origin = location
    try:
        cached = module.__cached__
    except AttributeError:
        cached = None
    try:
        submodule_search_locations = list(module.__path__)
    except AttributeError:
        submodule_search_locations = None

    spec = ModuleSpec(name, loader, origin=origin)
    spec._set_fileattr = False if location is None else True
    spec.cached = cached
    spec.submodule_search_locations = submodule_search_locations
    return spec


def _init_module_attrs(spec, module, *, override=False):
    # The passed-in module may be not support attribute assignment,
    # in which case we simply don't set the attributes.
    # __name__
    if (override or getattr(module, '__name__', None) is None):
        try:
            module.__name__ = spec.name
        except AttributeError:
            pass
    # __loader__
    if override or getattr(module, '__loader__', None) is None:
        loader = spec.loader
        if loader is None:
            # A backward compatibility hack.
            if spec.submodule_search_locations is not None:
                if _bootstrap_external is None:
                    raise NotImplementedError
                _NamespaceLoader = _bootstrap_external._NamespaceLoader

                loader = _NamespaceLoader.__new__(_NamespaceLoader)
                loader._path = spec.submodule_search_locations
                spec.loader = loader
                # While the docs say that module.__file__ is not set for
                # built-in modules, and the code below will avoid setting it if
                # spec.has_location is false, this is incorrect for namespace
                # packages.  Namespace packages have no location, but their
                # __spec__.origin is None, and thus their module.__file__
                # should also be None for consistency.  While a bit of a hack,
                # this is the best place to ensure this consistency.
                #
                # See # https://docs.python.org/3/library/importlib.html#importlib.abc.Loader.load_module
                # and bpo-32305
                module.__file__ = None
        try:
            module.__loader__ = loader
        except AttributeError:
            pass
    # __package__
    if override or getattr(module, '__package__', None) is None:
        try:
            module.__package__ = spec.parent
        except AttributeError:
            pass
    # __spec__
    try:
        module.__spec__ = spec
    except AttributeError:
        pass
    # __path__
    if override or getattr(module, '__path__', None) is None:
        if spec.submodule_search_locations is not None:
            try:
                module.__path__ = spec.submodule_search_locations
            except AttributeError:
                pass
    # __file__/__cached__
    if spec.has_location:
        if override or getattr(module, '__file__', None) is None:
            try:
                module.__file__ = spec.origin
            except AttributeError:
                pass

        if override or getattr(module, '__cached__', None) is None:
            if spec.cached is not None:
                try:
                    module.__cached__ = spec.cached
                except AttributeError:
                    pass
    return module


def module_from_spec(spec):
    """Create a module based on the provided spec."""
    # Typically loaders will not implement create_module().
    module = None
    if hasattr(spec.loader, 'create_module'):
        # If create_module() returns `None` then it means default
        # module creation should be used.
        module = spec.loader.create_module(spec)
    elif hasattr(spec.loader, 'exec_module'):
        raise ImportError('loaders that define exec_module() '
                          'must also define create_module()')
    if module is None:
        module = _new_module(spec.name)
    _init_module_attrs(spec, module)
    return module


def _module_repr_from_spec(spec):
    """Return the repr to use for the module."""
    # We mostly replicate _module_repr() using the spec attributes.
    name = '?' if spec.name is None else spec.name
    if spec.origin is None:
        if spec.loader is None:
            return '<module {!r}>'.format(name)
        else:
            return '<module {!r} ({!r})>'.format(name, spec.loader)
    else:
        if spec.has_location:
            return '<module {!r} from {!r}>'.format(name, spec.origin)
        else:
            return '<module {!r} ({})>'.format(spec.name, spec.origin)


# Used by importlib.reload() and _load_module_shim().
def _exec(spec, module):
    """Execute the spec's specified module in an existing module's namespace."""
    name = spec.name
    with _ModuleLockManager(name):
        if sys.modules.get(name) is not module:
            msg = 'module {!r} not in sys.modules'.format(name)
            raise ImportError(msg, name=name)
        try:
            if spec.loader is None:
                if spec.submodule_search_locations is None:
                    raise ImportError('missing loader', name=spec.name)
                # Namespace package.
                _init_module_attrs(spec, module, override=True)
            else:
                _init_module_attrs(spec, module, override=True)
                if not hasattr(spec.loader, 'exec_module'):
                    # (issue19713) Once BuiltinImporter and ExtensionFileLoader
                    # have exec_module() implemented, we can add a deprecation
                    # warning here.
                    spec.loader.load_module(name)
                else:
                    spec.loader.exec_module(module)
        finally:
            # Update the order of insertion into sys.modules for module
            # clean-up at shutdown.
            module = sys.modules.pop(spec.name)
            sys.modules[spec.name] = module
    return module


def _load_backward_compatible(spec):
    # (issue19713) Once BuiltinImporter and ExtensionFileLoader
    # have exec_module() implemented, we can add a deprecation
    # warning here.
    try:
        spec.loader.load_module(spec.name)
    except:
        if spec.name in sys.modules:
            module = sys.modules.pop(spec.name)
            sys.modules[spec.name] = module
        raise
    # The module must be in sys.modules at this point!
    # Move it to the end of sys.modules.
    module = sys.modules.pop(spec.name)
    sys.modules[spec.name] = module
    if getattr(module, '__loader__', None) is None:
        try:
            module.__loader__ = spec.loader
        except AttributeError:
            pass
    if getattr(module, '__package__', None) is None:
        try:
            # Since module.__path__ may not line up with
            # spec.submodule_search_paths, we can't necessarily rely
            # on spec.parent here.
            module.__package__ = module.__name__
            if not hasattr(module, '__path__'):
                module.__package__ = spec.name.rpartition('.')[0]
        except AttributeError:
            pass
    if getattr(module, '__spec__', None) is None:
        try:
            module.__spec__ = spec
        except AttributeError:
            pass
    return module

def _load_unlocked(spec):
    # A helper for direct use by the import system.
    if spec.loader is not None:
        # Not a namespace package.
        if not hasattr(spec.loader, 'exec_module'):
            return _load_backward_compatible(spec)

    module = module_from_spec(spec)

    # This must be done before putting the module in sys.modules
    # (otherwise an optimization shortcut in import.c becomes
    # wrong).
    spec._initializing = True
    try:
        sys.modules[spec.name] = module
        try:
            if spec.loader is None:
                if spec.submodule_search_locations is None:
                    raise ImportError('missing loader', name=spec.name)
                # A namespace package so do nothing.
            else:
                spec.loader.exec_module(module)
        except:
            try:
                del sys.modules[spec.name]
            except KeyError:
                pass
            raise
        # Move the module to the end of sys.modules.
        # We don't ensure that the import-related module attributes get
        # set in the sys.modules replacement case.  Such modules are on
        # their own.
        module = sys.modules.pop(spec.name)
        sys.modules[spec.name] = module
        _verbose_message('import {!r} # {!r}', spec.name, spec.loader)
    finally:
        spec._initializing = False

    return module

# A method used during testing of _load_unlocked() and by
# _load_module_shim().
def _load(spec):
    """Return a new module object, loaded by the spec's loader.

    The module is not added to its parent.

    If a module is already in sys.modules, that existing module gets
    clobbered.

    """
    with _ModuleLockManager(spec.name):
        return _load_unlocked(spec)


# Loaders #####################################################################

class BuiltinImporter:

    """Meta path import for built-in modules.

    All methods are either class or static methods to avoid the need to
    instantiate the class.

    """

    @staticmethod
    def module_repr(module):
        """Return repr for the module.

        The method is deprecated.  The import machinery does the job itself.

        """
        return '<module {!r} (built-in)>'.format(module.__name__)

    @classmethod
    def find_spec(cls, fullname, path=None, target=None):
        if path is not None:
            return None
        if _imp.is_builtin(fullname):
            return spec_from_loader(fullname, cls, origin='built-in')
        else:
            return None

    @classmethod
    def find_module(cls, fullname, path=None):
        """Find the built-in module.

        If 'path' is ever specified then the search is considered a failure.

        This method is deprecated.  Use find_spec() instead.

        """
        spec = cls.find_spec(fullname, path)
        return spec.loader if spec is not None else None

    @classmethod
    def create_module(self, spec):
        """Create a built-in module"""
        if spec.name not in sys.builtin_module_names:
            raise ImportError('{!r} is not a built-in module'.format(spec.name),
                              name=spec.name)
        return _call_with_frames_removed(_imp.create_builtin, spec)

    @classmethod
    def exec_module(self, module):
        """Exec a built-in module"""
        _call_with_frames_removed(_imp.exec_builtin, module)

    @classmethod
    @_requires_builtin
    def get_code(cls, fullname):
        """Return None as built-in modules do not have code objects."""
        return None

    @classmethod
    @_requires_builtin
    def get_source(cls, fullname):
        """Return None as built-in modules do not have source code."""
        return None

    @classmethod
    @_requires_builtin
    def is_package(cls, fullname):
        """Return False as built-in modules are never packages."""
        return False

    load_module = classmethod(_load_module_shim)


class FrozenImporter:

    """Meta path import for frozen modules.

    All methods are either class or static methods to avoid the need to
    instantiate the class.

    """

    _ORIGIN = "frozen"

    @staticmethod
    def module_repr(m):
        """Return repr for the module.

        The method is deprecated.  The import machinery does the job itself.

        """
        return '<module {!r} ({})>'.format(m.__name__, FrozenImporter._ORIGIN)

    @classmethod
    def find_spec(cls, fullname, path=None, target=None):
        if _imp.is_frozen(fullname):
            return spec_from_loader(fullname, cls, origin=cls._ORIGIN)
        else:
            return None

    @classmethod
    def find_module(cls, fullname, path=None):
        """Find a frozen module.

        This method is deprecated.  Use find_spec() instead.

        """
        return cls if _imp.is_frozen(fullname) else None

    @classmethod
    def create_module(cls, spec):
        """Use default semantics for module creation."""

    @staticmethod
    def exec_module(module):
        name = module.__spec__.name
        if not _imp.is_frozen(name):
            raise ImportError('{!r} is not a frozen module'.format(name),
                              name=name)
        code = _call_with_frames_removed(_imp.get_frozen_object, name)
        exec(code, module.__dict__)

    @classmethod
    def load_module(cls, fullname):
        """Load a frozen module.

        This method is deprecated.  Use exec_module() instead.

        """
        return _load_module_shim(cls, fullname)

    @classmethod
    @_requires_frozen
    def get_code(cls, fullname):
        """Return the code object for the frozen module."""
        return _imp.get_frozen_object(fullname)

    @classmethod
    @_requires_frozen
    def get_source(cls, fullname):
        """Return None as frozen modules do not have source code."""
        return None

    @classmethod
    @_requires_frozen
    def is_package(cls, fullname):
        """Return True if the frozen module is a package."""
        return _imp.is_frozen_package(fullname)


# Import itself ###############################################################

class _ImportLockContext:

    """Context manager for the import lock."""

    def __enter__(self):
        """Acquire the import lock."""
        _imp.acquire_lock()

    def __exit__(self, exc_type, exc_value, exc_traceback):
        """Release the import lock regardless of any raised exceptions."""
        _imp.release_lock()


def _resolve_name(name, package, level):
    """Resolve a relative module name to an absolute one."""
    bits = package.rsplit('.', level - 1)
    if len(bits) < level:
        raise ValueError('attempted relative import beyond top-level package')
    base = bits[0]
    return '{}.{}'.format(base, name) if name else base


def _find_spec_legacy(finder, name, path):
    # This would be a good place for a DeprecationWarning if
    # we ended up going that route.
    loader = finder.find_module(name, path)
    if loader is None:
        return None
    return spec_from_loader(name, loader)


def _find_spec(name, path, target=None):
    """Find a module's spec."""
    meta_path = sys.meta_path
    if meta_path is None:
        # PyImport_Cleanup() is running or has been called.
        raise ImportError("sys.meta_path is None, Python is likely "
                          "shutting down")

    if not meta_path:
        _warnings.warn('sys.meta_path is empty', ImportWarning)

    # We check sys.modules here for the reload case.  While a passed-in
    # target will usually indicate a reload there is no guarantee, whereas
    # sys.modules provides one.
    is_reload = name in sys.modules
    for finder in meta_path:
        with _ImportLockContext():
            try:
                find_spec = finder.find_spec
            except AttributeError:
                spec = _find_spec_legacy(finder, name, path)
                if spec is None:
                    continue
            else:
                spec = find_spec(name, path, target)
        if spec is not None:
            # The parent import may have already imported this module.
            if not is_reload and name in sys.modules:
                module = sys.modules[name]
                try:
                    __spec__ = module.__spec__
                except AttributeError:
                    # We use the found spec since that is the one that
                    # we would have used if the parent module hadn't
                    # beaten us to the punch.
                    return spec
                else:
                    if __spec__ is None:
                        return spec
                    else:
                        return __spec__
            else:
                return spec
    else:
        return None


def _sanity_check(name, package, level):
    """Verify arguments are "sane"."""
    if not isinstance(name, str):
        raise TypeError('module name must be str, not {}'.format(type(name)))
    if level < 0:
        raise ValueError('level must be >= 0')
    if level > 0:
        if not isinstance(package, str):
            raise TypeError('__package__ not set to a string')
        elif not package:
            raise ImportError('attempted relative import with no known parent '
                              'package')
    if not name and level == 0:
        raise ValueError('Empty module name')


_ERR_MSG_PREFIX = 'No module named '
_ERR_MSG = _ERR_MSG_PREFIX + '{!r}'

def _find_and_load_unlocked(name, import_):
    path = None
    parent = name.rpartition('.')[0]
    if parent:
        if parent not in sys.modules:
            _call_with_frames_removed(import_, parent)
        # Crazy side-effects!
        if name in sys.modules:
            return sys.modules[name]
        parent_module = sys.modules[parent]
        try:
            path = parent_module.__path__
        except AttributeError:
            msg = (_ERR_MSG + '; {!r} is not a package').format(name, parent)
            raise ModuleNotFoundError(msg, name=name) from None
    spec = _find_spec(name, path)
    if spec is None:
        raise ModuleNotFoundError(_ERR_MSG.format(name), name=name)
    else:
        module = _load_unlocked(spec)
    if parent:
        # Set the module as an attribute on its parent.
        parent_module = sys.modules[parent]
        setattr(parent_module, name.rpartition('.')[2], module)
    return module


_NEEDS_LOADING = object()


def _find_and_load(name, import_):
    """Find and load the module."""
    with _ModuleLockManager(name):
        module = sys.modules.get(name, _NEEDS_LOADING)
        if module is _NEEDS_LOADING:
            return _find_and_load_unlocked(name, import_)

    if module is None:
        message = ('import of {} halted; '
                   'None in sys.modules'.format(name))
        raise ModuleNotFoundError(message, name=name)

    _lock_unlock_module(name)
    return module


def _gcd_import(name, package=None, level=0):
    """Import and return the module based on its name, the package the call is
    being made from, and the level adjustment.

    This function represents the greatest common denominator of functionality
    between import_module and __import__. This includes setting __package__ if
    the loader did not.

    """
    _sanity_check(name, package, level)
    if level > 0:
        name = _resolve_name(name, package, level)
    return _find_and_load(name, _gcd_import)


def _handle_fromlist(module, fromlist, import_, *, recursive=False):
    """Figure out what __import__ should return.

    The import_ parameter is a callable which takes the name of module to
    import. It is required to decouple the function from assuming importlib's
    import implementation is desired.

    """
    # The hell that is fromlist ...
    # If a package was imported, try to import stuff from fromlist.
    for x in fromlist:
        if not isinstance(x, str):
            if recursive:
                where = module.__name__ + '.__all__'
            else:
                where = "``from list''"
            raise TypeError(f"Item in {where} must be str, "
                            f"not {type(x).__name__}")
        elif x == '*':
            if not recursive and hasattr(module, '__all__'):
                _handle_fromlist(module, module.__all__, import_,
                                 recursive=True)
        elif not hasattr(module, x):
            from_name = '{}.{}'.format(module.__name__, x)
            try:
                _call_with_frames_removed(import_, from_name)
            except ModuleNotFoundError as exc:
                # Backwards-compatibility dictates we ignore failed
                # imports triggered by fromlist for modules that don't
                # exist.
                if (exc.name == from_name and
                    sys.modules.get(from_name, _NEEDS_LOADING) is not None):
                    continue
                raise
    return module


def _calc___package__(globals):
    """Calculate what __package__ should be.

    __package__ is not guaranteed to be defined or could be set to None
    to represent that its proper value is unknown.

    """
    package = globals.get('__package__')
    spec = globals.get('__spec__')
    if package is not None:
        if spec is not None and package != spec.parent:
            _warnings.warn("__package__ != __spec__.parent "
                           f"({package!r} != {spec.parent!r})",
                           ImportWarning, stacklevel=3)
        return package
    elif spec is not None:
        return spec.parent
    else:
        _warnings.warn("can't resolve package from __spec__ or __package__, "
                       "falling back on __name__ and __path__",
                       ImportWarning, stacklevel=3)
        package = globals['__name__']
        if '__path__' not in globals:
            package = package.rpartition('.')[0]
    return package


def __import__(name, globals=None, locals=None, fromlist=(), level=0):
    """Import a module.

    The 'globals' argument is used to infer where the import is occurring from
    to handle relative imports. The 'locals' argument is ignored. The
    'fromlist' argument specifies what should exist as attributes on the module
    being imported (e.g. ``from module import <fromlist>``).  The 'level'
    argument represents the package location to import from in a relative
    import (e.g. ``from ..pkg import mod`` would have a 'level' of 2).

    """
    if level == 0:
        module = _gcd_import(name)
    else:
        globals_ = globals if globals is not None else {}
        package = _calc___package__(globals_)
        module = _gcd_import(name, package, level)
    if not fromlist:
        # Return up to the first dot in 'name'. This is complicated by the fact
        # that 'name' may be relative.
        if level == 0:
            return _gcd_import(name.partition('.')[0])
        elif not name:
            return module
        else:
            # Figure out where to slice the module's name up to the first dot
            # in 'name'.
            cut_off = len(name) - len(name.partition('.')[0])
            # Slice end needs to be positive to alleviate need to special-case
            # when ``'.' not in name``.
            return sys.modules[module.__name__[:len(module.__name__)-cut_off]]
    elif hasattr(module, '__path__'):
        return _handle_fromlist(module, fromlist, _gcd_import)
    else:
        return module


def _builtin_from_name(name):
    spec = BuiltinImporter.find_spec(name)
    if spec is None:
        raise ImportError('no built-in module named ' + name)
    return _load_unlocked(spec)


def _setup(sys_module, _imp_module):
    """Setup importlib by importing needed built-in modules and injecting them
    into the global namespace.

    As sys is needed for sys.modules access and _imp is needed to load built-in
    modules, those two modules must be explicitly passed in.

    """
    global _imp, sys
    _imp = _imp_module
    sys = sys_module

    # Set up the spec for existing builtin/frozen modules.
    module_type = type(sys)
    for name, module in sys.modules.items():
        if isinstance(module, module_type):
            if name in sys.builtin_module_names:
                loader = BuiltinImporter
            elif _imp.is_frozen(name):
                loader = FrozenImporter
            else:
                continue
            spec = _spec_from_module(module, loader)
            _init_module_attrs(spec, module)

    # Directly load built-in modules needed during bootstrap.
    self_module = sys.modules[__name__]
    for builtin_name in ('_thread', '_warnings', '_weakref'):
        if builtin_name not in sys.modules:
            builtin_module = _builtin_from_name(builtin_name)
        else:
            builtin_module = sys.modules[builtin_name]
        setattr(self_module, builtin_name, builtin_module)


def _install(sys_module, _imp_module):
    """Install importers for builtin and frozen modules"""
    _setup(sys_module, _imp_module)

    sys.meta_path.append(BuiltinImporter)
    sys.meta_path.append(FrozenImporter)


def _install_external_importers():
    """Install importers that require external filesystem access"""
    global _bootstrap_external
    import _frozen_importlib_external
    _bootstrap_external = _frozen_importlib_external
    _frozen_importlib_external._install(sys.modules[__name__])
importlib/__init__.py000064400000013655151153537630010701 0ustar00"""A pure Python implementation of import."""
__all__ = ['__import__', 'import_module', 'invalidate_caches', 'reload']

# Bootstrap help #####################################################

# Until bootstrapping is complete, DO NOT import any modules that attempt
# to import importlib._bootstrap (directly or indirectly). Since this
# partially initialised package would be present in sys.modules, those
# modules would get an uninitialised copy of the source version, instead
# of a fully initialised version (either the frozen one or the one
# initialised below if the frozen one is not available).
import _imp  # Just the builtin component, NOT the full Python module
import sys

try:
    import _frozen_importlib as _bootstrap
except ImportError:
    from . import _bootstrap
    _bootstrap._setup(sys, _imp)
else:
    # importlib._bootstrap is the built-in import, ensure we don't create
    # a second copy of the module.
    _bootstrap.__name__ = 'importlib._bootstrap'
    _bootstrap.__package__ = 'importlib'
    try:
        _bootstrap.__file__ = __file__.replace('__init__.py', '_bootstrap.py')
    except NameError:
        # __file__ is not guaranteed to be defined, e.g. if this code gets
        # frozen by a tool like cx_Freeze.
        pass
    sys.modules['importlib._bootstrap'] = _bootstrap

try:
    import _frozen_importlib_external as _bootstrap_external
except ImportError:
    from . import _bootstrap_external
    _bootstrap_external._setup(_bootstrap)
    _bootstrap._bootstrap_external = _bootstrap_external
else:
    _bootstrap_external.__name__ = 'importlib._bootstrap_external'
    _bootstrap_external.__package__ = 'importlib'
    try:
        _bootstrap_external.__file__ = __file__.replace('__init__.py', '_bootstrap_external.py')
    except NameError:
        # __file__ is not guaranteed to be defined, e.g. if this code gets
        # frozen by a tool like cx_Freeze.
        pass
    sys.modules['importlib._bootstrap_external'] = _bootstrap_external

# To simplify imports in test code
_pack_uint32 = _bootstrap_external._pack_uint32
_unpack_uint32 = _bootstrap_external._unpack_uint32

# Fully bootstrapped at this point, import whatever you like, circular
# dependencies and startup overhead minimisation permitting :)

import types
import warnings


# Public API #########################################################

from ._bootstrap import __import__


def invalidate_caches():
    """Call the invalidate_caches() method on all meta path finders stored in
    sys.meta_path (where implemented)."""
    for finder in sys.meta_path:
        if hasattr(finder, 'invalidate_caches'):
            finder.invalidate_caches()


def find_loader(name, path=None):
    """Return the loader for the specified module.

    This is a backward-compatible wrapper around find_spec().

    This function is deprecated in favor of importlib.util.find_spec().

    """
    warnings.warn('Deprecated since Python 3.4. '
                  'Use importlib.util.find_spec() instead.',
                  DeprecationWarning, stacklevel=2)
    try:
        loader = sys.modules[name].__loader__
        if loader is None:
            raise ValueError('{}.__loader__ is None'.format(name))
        else:
            return loader
    except KeyError:
        pass
    except AttributeError:
        raise ValueError('{}.__loader__ is not set'.format(name)) from None

    spec = _bootstrap._find_spec(name, path)
    # We won't worry about malformed specs (missing attributes).
    if spec is None:
        return None
    if spec.loader is None:
        if spec.submodule_search_locations is None:
            raise ImportError('spec for {} missing loader'.format(name),
                              name=name)
        raise ImportError('namespace packages do not have loaders',
                          name=name)
    return spec.loader


def import_module(name, package=None):
    """Import a module.

    The 'package' argument is required when performing a relative import. It
    specifies the package to use as the anchor point from which to resolve the
    relative import to an absolute import.

    """
    level = 0
    if name.startswith('.'):
        if not package:
            msg = ("the 'package' argument is required to perform a relative "
                   "import for {!r}")
            raise TypeError(msg.format(name))
        for character in name:
            if character != '.':
                break
            level += 1
    return _bootstrap._gcd_import(name[level:], package, level)


_RELOADING = {}


def reload(module):
    """Reload the module and return it.

    The module must have been successfully imported before.

    """
    if not module or not isinstance(module, types.ModuleType):
        raise TypeError("reload() argument must be a module")
    try:
        name = module.__spec__.name
    except AttributeError:
        name = module.__name__

    if sys.modules.get(name) is not module:
        msg = "module {} not in sys.modules"
        raise ImportError(msg.format(name), name=name)
    if name in _RELOADING:
        return _RELOADING[name]
    _RELOADING[name] = module
    try:
        parent_name = name.rpartition('.')[0]
        if parent_name:
            try:
                parent = sys.modules[parent_name]
            except KeyError:
                msg = "parent {!r} not in sys.modules"
                raise ImportError(msg.format(parent_name),
                                  name=parent_name) from None
            else:
                pkgpath = parent.__path__
        else:
            pkgpath = None
        target = module
        spec = module.__spec__ = _bootstrap._find_spec(name, pkgpath, target)
        if spec is None:
            raise ModuleNotFoundError(f"spec not found for the module {name!r}", name=name)
        _bootstrap._exec(spec, module)
        # The module may have replaced itself in sys.modules!
        return sys.modules[name]
    finally:
        try:
            del _RELOADING[name]
        except KeyError:
            pass
importlib/resources.py000064400000022500151153537630011141 0ustar00import os
import tempfile

from . import abc as resources_abc
from contextlib import contextmanager, suppress
from importlib import import_module
from importlib.abc import ResourceLoader
from io import BytesIO, TextIOWrapper
from pathlib import Path
from types import ModuleType
from typing import Iterable, Iterator, Optional, Set, Union   # noqa: F401
from typing import cast
from typing.io import BinaryIO, TextIO
from zipimport import ZipImportError


__all__ = [
    'Package',
    'Resource',
    'contents',
    'is_resource',
    'open_binary',
    'open_text',
    'path',
    'read_binary',
    'read_text',
    ]


Package = Union[str, ModuleType]
Resource = Union[str, os.PathLike]


def _get_package(package) -> ModuleType:
    """Take a package name or module object and return the module.

    If a name, the module is imported.  If the passed or imported module
    object is not a package, raise an exception.
    """
    if hasattr(package, '__spec__'):
        if package.__spec__.submodule_search_locations is None:
            raise TypeError('{!r} is not a package'.format(
                package.__spec__.name))
        else:
            return package
    else:
        module = import_module(package)
        if module.__spec__.submodule_search_locations is None:
            raise TypeError('{!r} is not a package'.format(package))
        else:
            return module


def _normalize_path(path) -> str:
    """Normalize a path by ensuring it is a string.

    If the resulting string contains path separators, an exception is raised.
    """
    parent, file_name = os.path.split(path)
    if parent:
        raise ValueError('{!r} must be only a file name'.format(path))
    else:
        return file_name


def _get_resource_reader(
        package: ModuleType) -> Optional[resources_abc.ResourceReader]:
    # Return the package's loader if it's a ResourceReader.  We can't use
    # a issubclass() check here because apparently abc.'s __subclasscheck__()
    # hook wants to create a weak reference to the object, but
    # zipimport.zipimporter does not support weak references, resulting in a
    # TypeError.  That seems terrible.
    spec = package.__spec__
    if hasattr(spec.loader, 'get_resource_reader'):
        return cast(resources_abc.ResourceReader,
                    spec.loader.get_resource_reader(spec.name))
    return None


def _check_location(package):
    if package.__spec__.origin is None or not package.__spec__.has_location:
        raise FileNotFoundError(f'Package has no location {package!r}')


def open_binary(package: Package, resource: Resource) -> BinaryIO:
    """Return a file-like object opened for binary reading of the resource."""
    resource = _normalize_path(resource)
    package = _get_package(package)
    reader = _get_resource_reader(package)
    if reader is not None:
        return reader.open_resource(resource)
    _check_location(package)
    absolute_package_path = os.path.abspath(package.__spec__.origin)
    package_path = os.path.dirname(absolute_package_path)
    full_path = os.path.join(package_path, resource)
    try:
        return open(full_path, mode='rb')
    except OSError:
        # Just assume the loader is a resource loader; all the relevant
        # importlib.machinery loaders are and an AttributeError for
        # get_data() will make it clear what is needed from the loader.
        loader = cast(ResourceLoader, package.__spec__.loader)
        data = None
        if hasattr(package.__spec__.loader, 'get_data'):
            with suppress(OSError):
                data = loader.get_data(full_path)
        if data is None:
            package_name = package.__spec__.name
            message = '{!r} resource not found in {!r}'.format(
                resource, package_name)
            raise FileNotFoundError(message)
        else:
            return BytesIO(data)


def open_text(package: Package,
              resource: Resource,
              encoding: str = 'utf-8',
              errors: str = 'strict') -> TextIO:
    """Return a file-like object opened for text reading of the resource."""
    resource = _normalize_path(resource)
    package = _get_package(package)
    reader = _get_resource_reader(package)
    if reader is not None:
        return TextIOWrapper(reader.open_resource(resource), encoding, errors)
    _check_location(package)
    absolute_package_path = os.path.abspath(package.__spec__.origin)
    package_path = os.path.dirname(absolute_package_path)
    full_path = os.path.join(package_path, resource)
    try:
        return open(full_path, mode='r', encoding=encoding, errors=errors)
    except OSError:
        # Just assume the loader is a resource loader; all the relevant
        # importlib.machinery loaders are and an AttributeError for
        # get_data() will make it clear what is needed from the loader.
        loader = cast(ResourceLoader, package.__spec__.loader)
        data = None
        if hasattr(package.__spec__.loader, 'get_data'):
            with suppress(OSError):
                data = loader.get_data(full_path)
        if data is None:
            package_name = package.__spec__.name
            message = '{!r} resource not found in {!r}'.format(
                resource, package_name)
            raise FileNotFoundError(message)
        else:
            return TextIOWrapper(BytesIO(data), encoding, errors)


def read_binary(package: Package, resource: Resource) -> bytes:
    """Return the binary contents of the resource."""
    resource = _normalize_path(resource)
    package = _get_package(package)
    with open_binary(package, resource) as fp:
        return fp.read()


def read_text(package: Package,
              resource: Resource,
              encoding: str = 'utf-8',
              errors: str = 'strict') -> str:
    """Return the decoded string of the resource.

    The decoding-related arguments have the same semantics as those of
    bytes.decode().
    """
    resource = _normalize_path(resource)
    package = _get_package(package)
    with open_text(package, resource, encoding, errors) as fp:
        return fp.read()


@contextmanager
def path(package: Package, resource: Resource) -> Iterator[Path]:
    """A context manager providing a file path object to the resource.

    If the resource does not already exist on its own on the file system,
    a temporary file will be created. If the file was created, the file
    will be deleted upon exiting the context manager (no exception is
    raised if the file was deleted prior to the context manager
    exiting).
    """
    resource = _normalize_path(resource)
    package = _get_package(package)
    reader = _get_resource_reader(package)
    if reader is not None:
        try:
            yield Path(reader.resource_path(resource))
            return
        except FileNotFoundError:
            pass
    else:
        _check_location(package)
    # Fall-through for both the lack of resource_path() *and* if
    # resource_path() raises FileNotFoundError.
    file_path = None
    if package.__spec__.origin is not None:
        package_directory = Path(package.__spec__.origin).parent
        file_path = package_directory / resource
    if file_path is not None and file_path.exists():
        yield file_path
    else:
        with open_binary(package, resource) as fp:
            data = fp.read()
        # Not using tempfile.NamedTemporaryFile as it leads to deeper 'try'
        # blocks due to the need to close the temporary file to work on
        # Windows properly.
        fd, raw_path = tempfile.mkstemp()
        try:
            os.write(fd, data)
            os.close(fd)
            yield Path(raw_path)
        finally:
            try:
                os.remove(raw_path)
            except FileNotFoundError:
                pass


def is_resource(package: Package, name: str) -> bool:
    """True if 'name' is a resource inside 'package'.

    Directories are *not* resources.
    """
    package = _get_package(package)
    _normalize_path(name)
    reader = _get_resource_reader(package)
    if reader is not None:
        return reader.is_resource(name)
    try:
        package_contents = set(contents(package))
    except (NotADirectoryError, FileNotFoundError):
        return False
    if name not in package_contents:
        return False
    # Just because the given file_name lives as an entry in the package's
    # contents doesn't necessarily mean it's a resource.  Directories are not
    # resources, so let's try to find out if it's a directory or not.
    path = Path(package.__spec__.origin).parent / name
    return path.is_file()


def contents(package: Package) -> Iterable[str]:
    """Return an iterable of entries in 'package'.

    Note that not all entries are resources.  Specifically, directories are
    not considered resources.  Use `is_resource()` on each entry returned here
    to check if it is a resource or not.
    """
    package = _get_package(package)
    reader = _get_resource_reader(package)
    if reader is not None:
        return reader.contents()
    # Is the package a namespace package?  By definition, namespace packages
    # cannot have resources.  We could use _check_location() and catch the
    # exception, but that's extra work, so just inline the check.
    elif package.__spec__.origin is None or not package.__spec__.has_location:
        return ()
    else:
        package_directory = Path(package.__spec__.origin).parent
        return os.listdir(package_directory)
importlib/machinery.py000064400000001514151153537630011110 0ustar00"""The machinery of importlib: finders, loaders, hooks, etc."""

import _imp

from ._bootstrap import ModuleSpec
from ._bootstrap import BuiltinImporter
from ._bootstrap import FrozenImporter
from ._bootstrap_external import (SOURCE_SUFFIXES, DEBUG_BYTECODE_SUFFIXES,
                     OPTIMIZED_BYTECODE_SUFFIXES, BYTECODE_SUFFIXES,
                     EXTENSION_SUFFIXES)
from ._bootstrap_external import WindowsRegistryFinder
from ._bootstrap_external import PathFinder
from ._bootstrap_external import FileFinder
from ._bootstrap_external import SourceFileLoader
from ._bootstrap_external import SourcelessFileLoader
from ._bootstrap_external import ExtensionFileLoader


def all_suffixes():
    """Returns a list of all recognized module suffixes for this process"""
    return SOURCE_SUFFIXES + BYTECODE_SUFFIXES + EXTENSION_SUFFIXES
importlib/__pycache__/_bootstrap.cpython-38.opt-1.pyc000064400000067637151153537630016554 0ustar00U

e5dܚ�@s�dZdadd�Zdd�ZiZiZGdd�de�ZGdd	�d	�ZGd
d�d�Z	Gdd
�d
�Z
dd�Zdd�Zdd�Z
dd�dd�Zdd�Zdd�Zdd�Zdd�ZGd d!�d!�Zddd"�d#d$�Zd^d%d&�Zd'd(�d)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�ZGd7d8�d8�ZGd9d:�d:�ZGd;d<�d<�Zd=d>�Z d?d@�Z!d_dAdB�Z"dCdD�Z#dEZ$e$dFZ%dGdH�Z&e'�Z(dIdJ�Z)d`dLdM�Z*d'dN�dOdP�Z+dQdR�Z,dadTdU�Z-dVdW�Z.dXdY�Z/dZd[�Z0d\d]�Z1dS)baSCore implementation of import.

This module is NOT meant to be directly imported! It has been designed such
that it can be bootstrapped into Python as the implementation of import. As
such it requires the injection of specific modules and attributes in order to
work. One should use importlib as the public-facing version of this module.

NcCs8dD] }t||�rt||t||��q|j�|j�dS)z/Simple substitute for functools.update_wrapper.)�
__module__�__name__�__qualname__�__doc__N)�hasattr�setattr�getattr�__dict__�update)�new�old�replace�r
�,/usr/lib64/python3.8/importlib/_bootstrap.py�_wraps
rcCstt�|�S�N)�type�sys��namer
r
r�_new_module#src@seZdZdS)�_DeadlockErrorN)rrrr
r
r
rr0src@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�_ModuleLockz�A recursive lock implementation which is able to detect deadlocks
    (e.g. thread 1 trying to take locks A then B, and thread 2 trying to
    take locks B then A).
    cCs0t��|_t��|_||_d|_d|_d|_dS�N�)�_thread�
allocate_lock�lock�wakeupr�owner�count�waiters��selfrr
r
r�__init__:s

z_ModuleLock.__init__cCs<t��}|j}t�|�}|dkr$dS|j}||krdSqdS)NFT)r�	get_identr�_blocking_on�get)r"�me�tidrr
r
r�has_deadlockBs
z_ModuleLock.has_deadlockc	Cs�t��}|t|<z�|j�n|jdks.|j|krT||_|jd7_W5QR�W�VdS|��rhtd|��|j�	d�r�|j
d7_
W5QRX|j�	�|j��qW5t|=XdS)z�
        Acquire the module lock.  If a potential deadlock is detected,
        a _DeadlockError is raised.
        Otherwise, the lock is always acquired and True is returned.
        r�Tzdeadlock detected by %rFN)rr$r%rrrr)rr�acquirer �release�r"r(r
r
rr+Ns
z_ModuleLock.acquirec	Cslt��}|j�T|j|kr"td��|jd8_|jdkr^d|_|jr^|jd8_|j��W5QRXdS)N�cannot release un-acquired lockr*r)	rr$rr�RuntimeErrorrr rr,r-r
r
rr,gs

z_ModuleLock.releasecCsd�|jt|��S)Nz_ModuleLock({!r}) at {}��formatr�id�r"r
r
r�__repr__tsz_ModuleLock.__repr__N)	rrrrr#r)r+r,r4r
r
r
rr4s
rc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�_DummyModuleLockzVA simple _ModuleLock equivalent for Python builds without
    multi-threading support.cCs||_d|_dSr)rrr!r
r
rr#|sz_DummyModuleLock.__init__cCs|jd7_dS)Nr*T)rr3r
r
rr+�sz_DummyModuleLock.acquirecCs$|jdkrtd��|jd8_dS)Nrr.r*)rr/r3r
r
rr,�s
z_DummyModuleLock.releasecCsd�|jt|��S)Nz_DummyModuleLock({!r}) at {}r0r3r
r
rr4�sz_DummyModuleLock.__repr__N)rrrrr#r+r,r4r
r
r
rr5xs
r5c@s$eZdZdd�Zdd�Zdd�ZdS)�_ModuleLockManagercCs||_d|_dSr)�_name�_lockr!r
r
rr#�sz_ModuleLockManager.__init__cCst|j�|_|j��dSr)�_get_module_lockr7r8r+r3r
r
r�	__enter__�sz_ModuleLockManager.__enter__cOs|j��dSr)r8r,)r"�args�kwargsr
r
r�__exit__�sz_ModuleLockManager.__exit__N)rrrr#r:r=r
r
r
rr6�sr6cCs�t��zjzt|�}Wntk
r0d}YnX|dkrptdkrLt|�}nt|�}|fdd�}t�	||�t|<W5t��X|S)z�Get or create the module lock for a given module name.

    Acquire/release internally the global import lock to protect
    _module_locks.NcSs0t��zt�|�|krt|=W5t��XdSr)�_imp�acquire_lock�release_lock�
_module_locksr&)�refrr
r
r�cb�s

z_get_module_lock.<locals>.cb)
r>r?r@rA�KeyErrorrr5r�_weakrefrB)rrrCr
r
rr9�s


r9cCs6t|�}z|��Wntk
r(Yn
X|��dS)z�Acquires then releases the module lock for a given module name.

    This is used to ensure a module is completely initialized, in the
    event it is being imported by another thread.
    N)r9r+rr,)rrr
r
r�_lock_unlock_module�srFcOs
|||�S)a.remove_importlib_frames in import.c will always remove sequences
    of importlib frames that end with a call to this function

    Use it instead of a normal call in places where including the importlib
    frames introduces unwanted noise into the traceback (e.g. when executing
    module code)
    r
)�fr;�kwdsr
r
r�_call_with_frames_removed�srIr*)�	verbositycGs6tjj|kr2|�d�sd|}t|j|�tjd�dS)z=Print the message to stderr if -v/PYTHONVERBOSE is turned on.)�#zimport z# )�fileN)r�flags�verbose�
startswith�printr1�stderr)�messagerJr;r
r
r�_verbose_message�s
rScs�fdd�}t|��|S)z1Decorator to verify the named module is built-in.cs&|tjkrtd�|�|d���||�S)N�{!r} is not a built-in moduler)r�builtin_module_names�ImportErrorr1�r"�fullname��fxnr
r�_requires_builtin_wrapper�s


�z4_requires_builtin.<locals>._requires_builtin_wrapper�r)rZr[r
rYr�_requires_builtin�s
r]cs�fdd�}t|��|S)z/Decorator to verify the named module is frozen.cs&t�|�std�|�|d���||�S�Nz{!r} is not a frozen moduler)r>�	is_frozenrVr1rWrYr
r�_requires_frozen_wrapper�s


�z2_requires_frozen.<locals>._requires_frozen_wrapperr\)rZr`r
rYr�_requires_frozen�s
racCs>t||�}|tjkr2tj|}t||�tj|St|�SdS)z�Load the specified module into sys.modules and return it.

    This method is deprecated.  Use loader.exec_module instead.

    N)�spec_from_loaderr�modules�_exec�_load)r"rX�spec�moduler
r
r�_load_module_shim�s




rhcCs�t|dd�}t|d�r8z|�|�WStk
r6YnXz
|j}Wntk
rVYnX|dk	rht|�Sz
|j}Wntk
r�d}YnXz
|j}Wn:tk
r�|dkr�d�	|�YSd�	||�YSYnXd�	||�SdS)N�
__loader__�module_repr�?�
<module {!r}>�<module {!r} ({!r})>�<module {!r} from {!r}>)
rrrj�	Exception�__spec__�AttributeError�_module_repr_from_specr�__file__r1)rg�loaderrfr�filenamer
r
r�_module_repr
s.




rvc@sreZdZdZdddd�dd�Zdd�Zdd	�Zed
d��Zej	dd��Zed
d��Z
edd��Zej	dd��ZdS)�
ModuleSpeca�The specification for a module, used for loading.

    A module's spec is the source for information about the module.  For
    data associated with the module, including source, use the spec's
    loader.

    `name` is the absolute name of the module.  `loader` is the loader
    to use when loading the module.  `parent` is the name of the
    package the module is in.  The parent is derived from the name.

    `is_package` determines if the module is considered a package or
    not.  On modules this is reflected by the `__path__` attribute.

    `origin` is the specific location used by the loader from which to
    load the module, if that information is available.  When filename is
    set, origin will match.

    `has_location` indicates that a spec's "origin" reflects a location.
    When this is True, `__file__` attribute of the module is set.

    `cached` is the location of the cached bytecode file, if any.  It
    corresponds to the `__cached__` attribute.

    `submodule_search_locations` is the sequence of path entries to
    search when importing submodules.  If set, is_package should be
    True--and False otherwise.

    Packages are simply modules that (may) have submodules.  If a spec
    has a non-None value in `submodule_search_locations`, the import
    system will consider modules loaded from the spec as packages.

    Only finders (see importlib.abc.MetaPathFinder and
    importlib.abc.PathEntryFinder) should modify ModuleSpec instances.

    N)�origin�loader_state�
is_packagecCs6||_||_||_||_|r gnd|_d|_d|_dS�NF)rrtrxry�submodule_search_locations�
_set_fileattr�_cached)r"rrtrxryrzr
r
rr#VszModuleSpec.__init__cCsfd�|j�d�|j�g}|jdk	r4|�d�|j��|jdk	rP|�d�|j��d�|jjd�|��S)Nz	name={!r}zloader={!r}zorigin={!r}zsubmodule_search_locations={}z{}({})z, )	r1rrtrx�appendr|�	__class__r�join)r"r;r
r
rr4bs

�

�zModuleSpec.__repr__cCsj|j}zH|j|jkoL|j|jkoL|j|jkoL||jkoL|j|jkoL|j|jkWStk
rdYdSXdSr{)r|rrtrx�cached�has_locationrq)r"�other�smslr
r
r�__eq__ls
�
��
�
�zModuleSpec.__eq__cCs:|jdkr4|jdk	r4|jr4tdkr&t�t�|j�|_|jSr)r~rxr}�_bootstrap_external�NotImplementedError�_get_cachedr3r
r
rr�xs
zModuleSpec.cachedcCs
||_dSr)r~)r"r�r
r
rr��scCs$|jdkr|j�d�dS|jSdS)z The name of the module's parent.N�.r)r|r�
rpartitionr3r
r
r�parent�s
zModuleSpec.parentcCs|jSr)r}r3r
r
rr��szModuleSpec.has_locationcCst|�|_dSr)�boolr})r"�valuer
r
rr��s)rrrrr#r4r��propertyr��setterr�r�r
r
r
rrw1s $�




rw�rxrzcCs�t|d�rJtdkrt�tj}|dkr0|||d�S|r8gnd}||||d�S|dkr�t|d�r�z|�|�}Wq�tk
r�d}Yq�Xnd}t||||d�S)z5Return a module spec based on various loader methods.�get_filenameN)rt)rtr|rzFr�)rr�r��spec_from_file_locationrzrVrw)rrtrxrzr��searchr
r
rrb�s$
�
rbcCs8z
|j}Wntk
rYnX|dk	r,|S|j}|dkrZz
|j}Wntk
rXYnXz
|j}Wntk
r|d}YnX|dkr�|dkr�z
|j}Wq�tk
r�d}Yq�Xn|}z
|j}Wntk
r�d}YnXzt|j�}Wntk
�rd}YnXt	|||d�}|dk�r"dnd|_
||_||_|S)N�rxFT)
rprqrrirs�_ORIGIN�
__cached__�list�__path__rwr}r�r|)rgrtrxrfr�locationr�r|r
r
r�_spec_from_module�sH







r�F��overridecCs�|st|dd�dkr6z|j|_Wntk
r4YnX|sJt|dd�dkr�|j}|dkr�|jdk	r�tdkrnt�tj}|�	|�}|j|_
||_d|_z
||_Wntk
r�YnX|s�t|dd�dkr�z|j
|_Wntk
r�YnXz
||_Wntk
�rYnX|�s"t|dd�dk�rR|jdk	�rRz|j|_Wntk
�rPYnX|j�r�|�srt|dd�dk�r�z|j|_Wntk
�r�YnX|�s�t|dd�dk�r�|jdk	�r�z|j|_Wntk
�r�YnX|S)Nrri�__package__r�rsr�)rrrrqrtr|r�r��_NamespaceLoader�__new__�_pathrsrir�r�rpr�r�rxr�r�)rfrgr�rtr�r
r
r�_init_module_attrs�s`



r�cCsRd}t|jd�r|j�|�}nt|jd�r2td��|dkrDt|j�}t||�|S)z+Create a module based on the provided spec.N�
create_module�exec_modulezBloaders that define exec_module() must also define create_module())rrtr�rVrrr��rfrgr
r
r�module_from_spec%s

r�cCsj|jdkrdn|j}|jdkrB|jdkr2d�|�Sd�||j�Sn$|jrVd�||j�Sd�|j|j�SdS)z&Return the repr to use for the module.Nrkrlrmrn�<module {!r} ({})>)rrxrtr1r�)rfrr
r
rrr6s


rrc
Cs�|j}t|���tj�|�|k	r6d�|�}t||d��zj|jdkrj|j	dkrZtd|jd��t
||dd�n4t
||dd�t|jd�s�|j�|�n|j�
|�W5tj�|j�}|tj|j<XW5QRX|S)zFExecute the spec's specified module in an existing module's namespace.zmodule {!r} not in sys.modulesrN�missing loaderTr�r�)rr6rrcr&r1rV�poprtr|r�r�load_moduler�)rfrgr�msgr
r
rrdGs"



rdcCsz|j�|j�Wn4|jtjkr@tj�|j�}|tj|j<�YnXtj�|j�}|tj|j<t|dd�dkr�z|j|_Wntk
r�YnXt|dd�dkr�z(|j	|_
t|d�s�|j�d�d|_
Wntk
r�YnXt|dd�dk�rz
||_
Wntk
�rYnX|S)Nrir�r�r�rrp)rtr�rrrcr�rrirqrr�rr�rpr�r
r
r�_load_backward_compatiblees6

r�cCs�|jdk	rt|jd�st|�St|�}d|_z�|tj|j<z4|jdkr`|jdkrlt	d|jd��n|j�
|�Wn2ztj|j=Wntk
r�YnX�YnXtj�|j�}|tj|j<t
d|j|j�W5d|_X|S)Nr�TFr�rzimport {!r} # {!r})rtrr�r��
_initializingrrcrr|rVr�rDr�rSr�r
r
r�_load_unlocked�s.


r�c
Cs*t|j��t|�W5QR�SQRXdS)z�Return a new module object, loaded by the spec's loader.

    The module is not added to its parent.

    If a module is already in sys.modules, that existing module gets
    clobbered.

    N)r6rr�)rfr
r
rre�s	rec@s�eZdZdZedd��Zeddd��Zeddd��Zed	d
��Z	edd��Z
eed
d���Zeedd���Z
eedd���Zee�ZdS)�BuiltinImporterz�Meta path import for built-in modules.

    All methods are either class or static methods to avoid the need to
    instantiate the class.

    cCsd�|j�S)�sReturn repr for the module.

        The method is deprecated.  The import machinery does the job itself.

        z<module {!r} (built-in)>)r1r)rgr
r
rrj�szBuiltinImporter.module_reprNcCs,|dk	rdSt�|�r$t||dd�SdSdS)Nzbuilt-inr�)r>�
is_builtinrb��clsrX�path�targetr
r
r�	find_spec�s

zBuiltinImporter.find_speccCs|�||�}|dk	r|jSdS)z�Find the built-in module.

        If 'path' is ever specified then the search is considered a failure.

        This method is deprecated.  Use find_spec() instead.

        N)r�rt)r�rXr�rfr
r
r�find_module�s	zBuiltinImporter.find_modulecCs.|jtjkr"td�|j�|jd��ttj|�S)zCreate a built-in modulerTr)rrrUrVr1rIr>�create_builtin)r"rfr
r
rr��s
�zBuiltinImporter.create_modulecCsttj|�dS)zExec a built-in moduleN)rIr>�exec_builtin)r"rgr
r
rr��szBuiltinImporter.exec_modulecCsdS)z9Return None as built-in modules do not have code objects.Nr
�r�rXr
r
r�get_code�szBuiltinImporter.get_codecCsdS)z8Return None as built-in modules do not have source code.Nr
r�r
r
r�
get_source�szBuiltinImporter.get_sourcecCsdS)z4Return False as built-in modules are never packages.Fr
r�r
r
rrzszBuiltinImporter.is_package)NN)N)rrrr�staticmethodrj�classmethodr�r�r�r�r]r�r�rzrhr�r
r
r
rr��s*


r�c@s�eZdZdZdZedd��Zeddd��Zeddd	��Z	ed
d��Z
edd
��Zedd��Zee
dd���Zee
dd���Zee
dd���ZdS)�FrozenImporterz�Meta path import for frozen modules.

    All methods are either class or static methods to avoid the need to
    instantiate the class.

    �frozencCsd�|jtj�S)r�r�)r1rr�r�)�mr
r
rrjszFrozenImporter.module_reprNcCs"t�|�rt|||jd�SdSdS)Nr�)r>r_rbr�r�r
r
rr� s
zFrozenImporter.find_speccCst�|�r|SdS)z]Find a frozen module.

        This method is deprecated.  Use find_spec() instead.

        N)r>r_)r�rXr�r
r
rr�'szFrozenImporter.find_modulecCsdS)z*Use default semantics for module creation.Nr
)r�rfr
r
rr�0szFrozenImporter.create_modulecCs@|jj}t�|�s$td�|�|d��ttj|�}t||j	�dSr^)
rprr>r_rVr1rI�get_frozen_object�execr)rgr�coder
r
rr�4s

�zFrozenImporter.exec_modulecCs
t||�S)z_Load a frozen module.

        This method is deprecated.  Use exec_module() instead.

        )rhr�r
r
rr�=szFrozenImporter.load_modulecCs
t�|�S)z-Return the code object for the frozen module.)r>r�r�r
r
rr�FszFrozenImporter.get_codecCsdS)z6Return None as frozen modules do not have source code.Nr
r�r
r
rr�LszFrozenImporter.get_sourcecCs
t�|�S)z.Return True if the frozen module is a package.)r>�is_frozen_packager�r
r
rrzRszFrozenImporter.is_package)NN)N)rrrrr�r�rjr�r�r�r�r�r�rar�r�rzr
r
r
rr�s.



r�c@s eZdZdZdd�Zdd�ZdS)�_ImportLockContextz$Context manager for the import lock.cCst��dS)zAcquire the import lock.N)r>r?r3r
r
rr:_sz_ImportLockContext.__enter__cCst��dS)z<Release the import lock regardless of any raised exceptions.N)r>r@)r"�exc_type�	exc_value�
exc_tracebackr
r
rr=csz_ImportLockContext.__exit__N)rrrrr:r=r
r
r
rr�[sr�cCs@|�d|d�}t|�|kr$td��|d}|r<d�||�S|S)z2Resolve a relative module name to an absolute one.r�r*z2attempted relative import beyond top-level packager�{}.{})�rsplit�len�
ValueErrorr1)r�package�level�bits�baser
r
r�
_resolve_namehs
r�cCs"|�||�}|dkrdSt||�Sr)r�rb)�finderrr�rtr
r
r�_find_spec_legacyqsr�c

Cstj}|dkrtd��|s&t�dt�|tjk}|D]�}t��Tz
|j}Wn6t	k
r�t
|||�}|dkr|YW5QR�q4YnX||||�}W5QRX|dk	r4|�s�|tjk�r�tj|}z
|j}	Wnt	k
r�|YSX|	dkr�|S|	Sq4|Sq4dS)zFind a module's spec.Nz5sys.meta_path is None, Python is likely shutting downzsys.meta_path is empty)r�	meta_pathrV�	_warnings�warn�
ImportWarningrcr�r�rqr�rp)
rr�r�r��	is_reloadr�r�rfrgrpr
r
r�
_find_speczs6





r�cCslt|t�std�t|����|dkr,td��|dkrTt|t�sHtd��n|sTtd��|sh|dkrhtd��dS)zVerify arguments are "sane".zmodule name must be str, not {}rzlevel must be >= 0z__package__ not set to a stringz6attempted relative import with no known parent packagezEmpty module nameN)�
isinstance�str�	TypeErrorr1rr�rV�rr�r�r
r
r�
_sanity_check�s


r�zNo module named z{!r}cCs�d}|�d�d}|r�|tjkr*t||�|tjkr>tj|Stj|}z
|j}Wn2tk
r�td�||�}t||d�d�YnXt	||�}|dkr�tt�|�|d��nt
|�}|r�tj|}t||�d�d|�|S)Nr�rz; {!r} is not a packager�)r�rrcrIr�rq�_ERR_MSGr1�ModuleNotFoundErrorr�r�r)r�import_r�r��
parent_moduler�rfrgr
r
r�_find_and_load_unlocked�s*







r�c
Csjt|��2tj�|t�}|tkr6t||�W5QR�SW5QRX|dkr^d�|�}t||d��t|�|S)zFind and load the module.Nz(import of {} halted; None in sys.modulesr)	r6rrcr&�_NEEDS_LOADINGr�r1r�rF)rr�rgrRr
r
r�_find_and_load�s
 �r�rcCs*t|||�|dkr t|||�}t|t�S)a2Import and return the module based on its name, the package the call is
    being made from, and the level adjustment.

    This function represents the greatest common denominator of functionality
    between import_module and __import__. This includes setting __package__ if
    the loader did not.

    r)r�r�r��_gcd_importr�r
r
rr��s	r���	recursivecCs�|D]�}t|t�sB|r"|jd}nd}td|�dt|�j����q|dkrl|s�t|d�r�t||j|dd�qt||�sd	�|j|�}zt	||�Wqt
k
r�}z*|j|kr�tj
�|t�d
k	r�WY�q�W5d
}~XYqXq|S)z�Figure out what __import__ should return.

    The import_ parameter is a callable which takes the name of module to
    import. It is required to decouple the function from assuming importlib's
    import implementation is desired.

    z.__all__z
``from list''zItem in z must be str, not �*�__all__Tr�r�N)r�r�rr�rr�_handle_fromlistr�r1rIr�rrrcr&r�)rg�fromlistr�r��x�where�	from_name�excr
r
rr��s,


�

�r�cCs�|�d�}|�d�}|dk	rR|dk	rN||jkrNtjd|�d|j�d�tdd�|S|dk	r`|jStjd	tdd�|d
}d|kr�|�d�d
}|S)z�Calculate what __package__ should be.

    __package__ is not guaranteed to be defined or could be set to None
    to represent that its proper value is unknown.

    r�rpNz __package__ != __spec__.parent (z != �)�)�
stacklevelzYcan't resolve package from __spec__ or __package__, falling back on __name__ and __path__rr�r�r)r&r�r�r�r�r�)�globalsr�rfr
r
r�_calc___package__s&

��r�r
c	Cs�|dkrt|�}n$|dk	r|ni}t|�}t|||�}|s�|dkrTt|�d�d�S|s\|St|�t|�d�d�}tj|jdt|j�|�Snt|d�r�t||t�S|SdS)a�Import a module.

    The 'globals' argument is used to infer where the import is occurring from
    to handle relative imports. The 'locals' argument is ignored. The
    'fromlist' argument specifies what should exist as attributes on the module
    being imported (e.g. ``from module import <fromlist>``).  The 'level'
    argument represents the package location to import from in a relative
    import (e.g. ``from ..pkg import mod`` would have a 'level' of 2).

    rNr�r�)	r�r��	partitionr�rrcrrr�)	rr��localsr�r�rg�globals_r��cut_offr
r
r�
__import__9s
 
r�cCs&t�|�}|dkrtd|��t|�S)Nzno built-in module named )r�r�rVr�)rrfr
r
r�_builtin_from_name^s
r�c
Cs�|a|att�}tj��D]H\}}t||�r|tjkr<t}nt�|�rt	}nqt
||�}t||�qtjt}dD].}|tjkr�t
|�}	n
tj|}	t|||	�qrdS)z�Setup importlib by importing needed built-in modules and injecting them
    into the global namespace.

    As sys is needed for sys.modules access and _imp is needed to load built-in
    modules, those two modules must be explicitly passed in.

    )rr�rEN)r>rrrc�itemsr�rUr�r_r�r�r�rr�r)
�
sys_module�_imp_module�module_typerrgrtrf�self_module�builtin_name�builtin_moduler
r
r�_setupes$	







rcCs&t||�tj�t�tj�t�dS)z0Install importers for builtin and frozen modulesN)rrr�rr�r�)r�rr
r
r�_install�s
rcCs ddl}|a|�tjt�dS)z9Install importers that require external filesystem accessrN)�_frozen_importlib_externalr�rrrcr)rr
r
r�_install_external_importers�sr)NN)N)Nr)NNr
r)2rr�rrrAr%r/rrr5r6r9rFrIrSr]rarhrvrwrbr�r�r�rrrdr�r�rer�r�r�r�r�r�r��_ERR_MSG_PREFIXr�r��objectr�r�r�r�r�r�r�rrrr
r
r
r�<module>s^D%$e
-H%*IO
		
/
%
%#importlib/__pycache__/resources.cpython-38.pyc000064400000014560151153537630015436 0ustar00U

e5d@%�	@s�ddlZddlZddlmZddlmZmZddlm	Z	ddl
mZddlm
Z
mZddlmZdd	lmZdd
lmZmZmZmZmZddlmZddlmZmZdd
lmZdddddddddg	Zee efZ!ee ej"fZ#ed�dd�Z$e d�dd�Z%eeej&d�dd�Z'dd �Z(e!e#ed!�d"d�Z)d-e!e#e e ed%�d&d�Z*e!e#e+d!�d'd�Z,d.e!e#e e e d%�d(d�Z-ee!e#eed!�d)d��Z.e!e e/d*�d+d�Z0e!ee d�d,d�Z1dS)/�N�)�abc)�contextmanager�suppress)�
import_module)�ResourceLoader)�BytesIO�
TextIOWrapper)�Path)�
ModuleType)�Iterable�Iterator�Optional�Set�Union)�cast)�BinaryIO�TextIO)�ZipImportError�Package�Resource�contents�is_resource�open_binary�	open_text�path�read_binary�	read_text)�returncCs\t|d�r0|jjdkr*td�|jj���qX|Sn(t|�}|jjdkrTtd�|���n|SdS)z�Take a package name or module object and return the module.

    If a name, the module is imported.  If the passed or imported module
    object is not a package, raise an exception.
    �__spec__Nz{!r} is not a package)�hasattrr�submodule_search_locations�	TypeError�format�namer)�package�module�r'�+/usr/lib64/python3.8/importlib/resources.py�_get_package"s
�r)cCs,tj�|�\}}|r$td�|���n|SdS)z�Normalize a path by ensuring it is a string.

    If the resulting string contains path separators, an exception is raised.
    z{!r} must be only a file nameN)�osr�split�
ValueErrorr#)r�parent�	file_namer'r'r(�_normalize_path6sr/)r%rcCs,|j}t|jd�r(ttj|j�|j��SdS)N�get_resource_reader)rr �loaderr�
resources_abc�ResourceReaderr0r$)r%�specr'r'r(�_get_resource_readerBs�r5cCs&|jjdks|jjs"td|����dS)NzPackage has no location )r�origin�has_location�FileNotFoundError)r%r'r'r(�_check_locationPsr9)r%�resourcerc
Cs�t|�}t|�}t|�}|dk	r*|�|�St|�tj�|jj	�}tj�
|�}tj�||�}zt|dd�WSt
k
r�tt|jj�}d}t|jjd�r�tt
��|�|�}W5QRX|dkr�|jj}d�||�}	t|	��nt|�YSYnXdS)zDReturn a file-like object opened for binary reading of the resource.N�rb)�mode�get_data�{!r} resource not found in {!r})r/r)r5�
open_resourcer9r*r�abspathrr6�dirname�join�open�OSErrorrrr1r rr=r$r#r8r)
r%r:�reader�absolute_package_path�package_path�	full_pathr1�data�package_name�messager'r'r(rUs2

�
�utf-8�strict)r%r:�encoding�errorsrcCs
t|�}t|�}t|�}|dk	r2t|�|�||�St|�tj�|j	j
�}tj�|�}tj�||�}zt
|d||d�WStk
�rtt|j	j�}d}	t|j	jd�r�tt��|�|�}	W5QRX|	dkr�|j	j}
d�||
�}t|��ntt|	�||�YSYnXdS)zBReturn a file-like object opened for text reading of the resource.N�r)r<rNrOr=r>)r/r)r5r	r?r9r*rr@rr6rArBrCrDrrr1r rr=r$r#r8r)r%r:rNrOrErFrGrHr1rIrJrKr'r'r(rts2
�
c
Cs:t|�}t|�}t||��}|��W5QR�SQRXdS)z+Return the binary contents of the resource.N)r/r)r�read)r%r:�fpr'r'r(r�sc
Cs>t|�}t|�}t||||��}|��W5QR�SQRXdS)z�Return the decoded string of the resource.

    The decoding-related arguments have the same semantics as those of
    bytes.decode().
    N)r/r)rrQ)r%r:rNrOrRr'r'r(r�s	c	cst|�}t|�}t|�}|dk	rNzt|�|��VWdStk
rJYqVXnt|�d}|jjdk	r|t|jj�j	}||}|dk	r�|�
�r�|Vnxt||��}|��}W5QRXt
��\}}z$t�||�t�|�t|�VW5zt�|�Wntk
�rYnXXdS)akA context manager providing a file path object to the resource.

    If the resource does not already exist on its own on the file system,
    a temporary file will be created. If the file was created, the file
    will be deleted upon exiting the context manager (no exception is
    raised if the file was deleted prior to the context manager
    exiting).
    N)r/r)r5r
�
resource_pathr8r9rr6r-�existsrrQ�tempfileZmkstempr*�remove�write�close)	r%r:rEZ	file_path�package_directoryrRrI�fdZraw_pathr'r'r(r�s6

)r%r$rc	Cs|t|�}t|�t|�}|dk	r*|�|�Sztt|��}Wnttfk
rTYdSX||krbdSt|j	j
�j|}|��S)zYTrue if 'name' is a resource inside 'package'.

    Directories are *not* resources.
    NF)
r)r/r5r�setr�NotADirectoryErrorr8r
rr6r-�is_file)r%r$rEZpackage_contentsrr'r'r(r�s
cCsTt|�}t|�}|dk	r |��S|jjdks4|jjs8dSt|jj�j}t�	|�SdS)z�Return an iterable of entries in 'package'.

    Note that not all entries are resources.  Specifically, directories are
    not considered resources.  Use `is_resource()` on each entry returned here
    to check if it is a resource or not.
    Nr')
r)r5rrr6r7r
r-r*�listdir)r%rErYr'r'r(r�s)rLrM)rLrM)2r*rU�rr2�
contextlibrr�	importlibr�
importlib.abcr�iorr	�pathlibr
�typesr�typingrr
rrrrZ	typing.iorrZ	zipimportr�__all__�strr�PathLikerr)r/r3r5r9rr�bytesrrr�boolrrr'r'r'r(�<module>sh�

�!��"
��.importlib/__pycache__/_bootstrap_external.cpython-38.opt-2.pyc000064400000103317151153537630020441 0ustar00U

&�.e��@s�ddladdlZddladdlZddlZtjdkZerHddlZddl	Z	nddl
Zer^ddgZndgZedZe
e�Zd�e�Zdd�eD�ZdZd	ZeeZd
d�Zdd
�Zdd�Zdd�Zer�dd�Zndd�Zdd�Zdd�Zdd�Zdd�Zdd�Ze�r
dd �Znd!d �Zdd#d$�Ze ej!�Z"d%�#d&d'�d(Z$e%�&e$d'�Z'd)Z(d*Z)d+gZ*d,gZ+e+Z,Z-d�dd-�d.d/�Z.d0d1�Z/d2d3�Z0d4d5�Z1d6d7�Z2d8d9�Z3d:d;�Z4d<d=�Z5d>d?�Z6d@dA�Z7d�dBdC�Z8d�dDdE�Z9d�dGdH�Z:dIdJ�Z;e<�Z=d�de=dK�dLdM�Z>GdNdO�dO�Z?GdPdQ�dQ�Z@GdRdS�dSe@�ZAGdTdU�dU�ZBGdVdW�dWeBeA�ZCGdXdY�dYeBe@�ZDgZEGdZd[�d[eBe@�ZFGd\d]�d]�ZGGd^d_�d_�ZHGd`da�da�ZIGdbdc�dc�ZJd�ddde�ZKdfdg�ZLdhdi�ZMdjdk�ZNdldmdndodpdqdrdsdtdudvdwdxdydzd{d|�ZOd}d~�ZPdS)��NZwin32�\�/�cCsh|]}d|���qS��:���.0�srr�5/usr/lib64/python3.8/importlib/_bootstrap_external.py�	<setcomp>/sr)�win)�cygwin�darwincs<tj�t�r0tj�t�rd�nd��fdd�}ndd�}|S)N�PYTHONCASEOKsPYTHONCASEOKcs
�tjkS�N)�_os�environr��keyrr�_relax_case@sz%_make_relax_case.<locals>._relax_casecSsdS)NFrrrrrrDs)�sys�platform�
startswith�_CASE_INSENSITIVE_PLATFORMS�#_CASE_INSENSITIVE_PLATFORMS_STR_KEY)rrrr�_make_relax_case9srcCst|�d@�dd�S)N�����little)�int�to_bytes)�xrrr�_pack_uint32Jsr#cCst�|d�S�Nr�r �
from_bytes��datarrr�_unpack_uint32Osr)cCst�|d�Sr$r%r'rrr�_unpack_uint16Tsr*cGs�|sdSt|�dkr|dSd}g}ttj|�D]z\}}|�t�sL|�t�rf|�t�pX|}t	|g}q0|�d�r�|�
�|�
�kr�|}|g}q�|�|�q0|p�|}|�|�q0dd�|D�}t|�dkr�|ds�|t	S|t	�|�S)Nr�rrcSsg|]}|r|�t��qSr��rstrip�path_separators�r	�prrr�
<listcomp>rs�_path_join.<locals>.<listcomp>)
�len�mapr�_path_splitrootr�path_sep_tuple�endswithr-r.�path_sep�casefold�append�join)�
path_parts�root�pathZnew_root�tailrrr�
_path_join[s*
r@cGst�dd�|D��S)NcSsg|]}|r|�t��qSrr,)r	�partrrrr1{s�r2)r8r;)r<rrrr@ys
�csBt�fdd�tD��}|dkr&d�fS�d|��|dd�fS)Nc3s|]}��|�VqdSr)�rfindr/�r>rr�	<genexpr>�sz_path_split.<locals>.<genexpr>rrr+)�maxr.)r>�irrCr�_path_splitsrGcCs
t�|�Sr)r�statrCrrr�
_path_stat�srIcCs2zt|�}Wntk
r"YdSX|jd@|kS)NFi�)rI�OSError�st_mode)r>�mode�	stat_inforrr�_path_is_mode_type�s
rNcCs
t|d�S)Ni�)rNrCrrr�_path_isfile�srOcCs|st��}t|d�S)Ni@)r�getcwdrNrCrrr�_path_isdir�srQcCs>|sdSt�|�d�dd�}t|�dko<|�d�p<|�d�S)NFrrrr+z\\)rr5�replacer3rr7)r>r=rrr�_path_isabs�srScCs
|�t�Sr)rr.rCrrrrS�s�cCs�d�|t|��}t�|tjtjBtjB|d@�}z2t�|d��}|�	|�W5QRXt�
||�Wn:tk
r�zt�|�Wntk
r�YnX�YnXdS)N�{}.{}rT�wb)
�format�idr�open�O_EXCL�O_CREAT�O_WRONLY�_io�FileIO�writerRrJ�unlink)r>r(rL�path_tmp�fd�filerrr�
_write_atomic�s�rdiU
�rs
�__pycache__zopt-z.pyz.pyc)�optimizationcCsX|dk	r4t�dt�|dk	r(d}t|��|r0dnd}t�|�}t|�\}}|�d�\}}}tj	j
}	|	dkrrtd��d�|r~|n|||	g�}
|dkr�tj
jdkr�d}ntj
j}t|�}|dkr�|��s�td�|���d	�|
t|�}
|
td}tjdk	�rLt|��stt��|�}|dd
k�r8|dtk�r8|dd�}ttj|�t�|�St|t|�S)NzFthe debug_override parameter is deprecated; use 'optimization' insteadz2debug_override or optimization must be set to Nonerr+�.�$sys.implementation.cache_tag is Nonerz{!r} is not alphanumericz{}.{}{}rre)�	_warnings�warn�DeprecationWarning�	TypeErrorr�fspathrG�
rpartitionr�implementation�	cache_tag�NotImplementedErrorr;�flags�optimize�str�isalnum�
ValueErrorrW�_OPT�BYTECODE_SUFFIXES�pycache_prefixrSr@rPr.�lstrip�_PYCACHE)r>�debug_overriderg�message�headr?�base�sep�rest�tag�almost_filename�filenamerrr�cache_from_sourcebsH�
	
�r�c
Cs.tjjdkrtd��t�|�}t|�\}}d}tjdk	rftj�t	�}|�
|t�rf|t|�d�}d}|s�t|�\}}|t
kr�tt
�d|����|�d�}|dkr�td|����n\|dk�r|�dd	�d
}|�
t�s�tdt����|tt�d�}|���std|�d
���|�d�d}	t||	td�S)NriFTz not bottom-level directory in rh>re�zexpected only 2 or 3 dots in r�re���z5optimization portion of filename does not start with zoptimization level z is not an alphanumeric valuer)rrprqrrrrnrGrzr-r.rr8r3r|rw�count�rsplitrxrv�	partitionr@�SOURCE_SUFFIXES)
r>r�pycache_filename�found_in_pycache_prefix�
stripped_path�pycache�	dot_countrg�	opt_level�
base_filenamerrr�source_from_cache�s4	





r�c	Cs~t|�dkrdS|�d�\}}}|r8|��dd�dkr<|Szt|�}Wn$ttfk
rl|dd�}YnXt|�rz|S|S)Nrrh�������py)r3ro�lowerr�rrrwrO)�
bytecode_pathr��_�	extension�source_pathrrr�_get_sourcefile�sr�cCsJ|�tt��r0z
t|�WStk
r,YqFXn|�tt��rB|SdSdSr)r7�tupler�r�rrry)r�rrr�_get_cached�s
r�cCs4zt|�j}Wntk
r&d}YnX|dO}|S)NrT�)rIrKrJ)r>rLrrr�
_calc_mode�s
r�csDd�fdd�	}z
tj}Wntk
r4dd�}YnX||��|S)NcsB|dkr|j}n |j|kr0td|j|f|d���||f|�|�S)Nzloader for %s cannot handle %s��name)r��ImportError)�selfr��args�kwargs��methodrr�_check_name_wrappers
��z(_check_name.<locals>._check_name_wrappercSs8dD] }t||�rt||t||��q|j�|j�dS)N)�
__module__�__name__�__qualname__�__doc__)�hasattr�setattr�getattr�__dict__�update)�new�oldrRrrr�_wraps
z_check_name.<locals>._wrap)N)�
_bootstrapr��	NameError)r�r�r�rr�r�_check_name�s

r�cCs<|�|�\}}|dkr8t|�r8d}t�|�|d�t�|S)Nz,Not importing directory {}: missing __init__r)�find_loaderr3rjrkrW�
ImportWarning)r��fullname�loader�portions�msgrrr�_find_module_shims

r�cCs�|dd�}|tkr<d|�d|��}t�d|�t|f|��t|�dkrfd|��}t�d|�t|��t|dd��}|d@r�d	|�d
|��}t|f|��|S)Nrzbad magic number in z: �{}�z(reached EOF while reading pyc header of ����zinvalid flags z in )�MAGIC_NUMBERr��_verbose_messager�r3�EOFErrorr))r(r��exc_details�magicr~rsrrr�
_classify_pyc)s
r�cCspt|dd��|d@kr:d|��}t�d|�t|f|��|dk	rlt|dd��|d@krltd|��f|��dS)Nr��rzbytecode is stale for r�r�)r)r�r�r�)r(�source_mtime�source_sizer�r�r~rrr�_validate_timestamp_pycJs
�r�cCs&|dd�|kr"td|��f|��dS)Nr�r�z.hash in bytecode doesn't match hash of source )r�)r(�source_hashr�r�rrr�_validate_hash_pycfs��r�cCsPt�|�}t|t�r8t�d|�|dk	r4t�||�|Std�	|�||d��dS)Nzcode object from {!r}zNon-code object in {!r}�r�r>)
�marshal�loads�
isinstance�
_code_typer�r��_imp�_fix_co_filenamer�rW)r(r�r�r��coderrr�_compile_bytecode~s


�r�cCsFtt�}|�td��|�t|��|�t|��|�t�|��|S�Nr��	bytearrayr��extendr#r��dumps)r��mtimer�r(rrr�_code_to_timestamp_pyc�sr�TcCs@tt�}d|d>B}|�t|��|�|�|�t�|��|S)Nr+r�)r�r��checkedr(rsrrr�_code_to_hash_pyc�s
r�cCs>ddl}t�|�j}|�|�}t�dd�}|�|�|d��S)NrT)�tokenizer]�BytesIO�readline�detect_encoding�IncrementalNewlineDecoder�decode)�source_bytesr��source_bytes_readline�encoding�newline_decoderrrr�
decode_source�s

r��r��submodule_search_locationsc	Cs|dkr<d}t|d�rFz|�|�}WqFtk
r8YqFXn
t�|�}tj|||d�}d|_|dkr�t�D]*\}}|�	t
|��rj|||�}||_q�qjdS|tkr�t|d�r�z|�
|�}Wntk
r�Yq�X|r�g|_n||_|jgk�r|�rt|�d}|j�|�|S)Nz	<unknown>�get_filename��originT�
is_packager)r�r�r�rrnr��
ModuleSpec�
_set_fileattr�_get_supported_file_loadersr7r�r��	_POPULATEr�r�rGr:)	r��locationr�r��spec�loader_class�suffixesr��dirnamerrr�spec_from_file_location�s>



r�c@sLeZdZdZdZdZedd��Zedd��Zed
d	d
��Z	eddd��Z
dS)�WindowsRegistryFinderz;Software\Python\PythonCore\{sys_version}\Modules\{fullname}zASoftware\Python\PythonCore\{sys_version}\Modules\{fullname}\DebugFcCs8zt�tj|�WStk
r2t�tj|�YSXdSr)�_winreg�OpenKey�HKEY_CURRENT_USERrJ�HKEY_LOCAL_MACHINE)�clsrrrr�_open_registrysz$WindowsRegistryFinder._open_registryc	Csr|jr|j}n|j}|j|dtjdd�d�}z&|�|��}t�|d�}W5QRXWnt	k
rlYdSX|S)Nz%d.%dre)r��sys_versionr)
�DEBUG_BUILD�REGISTRY_KEY_DEBUG�REGISTRY_KEYrWr�version_inforr��
QueryValuerJ)rr��registry_keyr�hkey�filepathrrr�_search_registrys�z&WindowsRegistryFinder._search_registryNcCsz|�|�}|dkrdSzt|�Wntk
r8YdSXt�D]4\}}|�t|��r@tj||||�|d�}|Sq@dS)Nr�)rrIrJr�r7r�r��spec_from_loader)rr�r>�targetr
r�r�r�rrr�	find_specs
�zWindowsRegistryFinder.find_speccCs"|�||�}|dk	r|jSdSdSr�rr��rr�r>r�rrr�find_module'sz!WindowsRegistryFinder.find_module)NN)N)r�r�r�rrr�classmethodrrrrrrrrr��s��

r�c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�
_LoaderBasicscCs@t|�|��d}|�dd�d}|�d�d}|dko>|dkS)Nr+rhrre�__init__)rGr�r�ro)r�r�r��
filename_base�	tail_namerrrr�:sz_LoaderBasics.is_packagecCsdSrr�r�r�rrr�
create_moduleBsz_LoaderBasics.create_modulecCs8|�|j�}|dkr$td�|j���t�t||j�dS)Nz4cannot load module {!r} when get_code() returns None)�get_coder�r�rWr��_call_with_frames_removed�execr�)r��moduler�rrr�exec_moduleEs�z_LoaderBasics.exec_modulecCst�||�Sr)r��_load_module_shim�r�r�rrr�load_moduleMsz_LoaderBasics.load_moduleN)r�r�r�r�rr r#rrrrr5src@sJeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�d
d�Zdd�Z	dS)�SourceLoadercCst�dSr)rJ�r�r>rrr�
path_mtimeTszSourceLoader.path_mtimecCsd|�|�iS)Nr�)r&r%rrr�
path_stats\szSourceLoader.path_statscCs|�||�Sr)�set_data)r�r��
cache_pathr(rrr�_cache_bytecodejszSourceLoader._cache_bytecodecCsdSrr)r�r>r(rrrr(tszSourceLoader.set_datac
CsR|�|�}z|�|�}Wn0tk
rH}ztd|d�|�W5d}~XYnXt|�S)Nz'source not available through get_data()r�)r��get_datarJr�r�)r�r�r>r��excrrr�
get_source{s
��zSourceLoader.get_sourcer�)�	_optimizecCstjt||dd|d�S)NrT)�dont_inheritrt)r�r�compile)r�r(r>r.rrr�source_to_code�s�zSourceLoader.source_to_codec	Cs"|�|�}d}d}d}d}d}zt|�}Wntk
rDd}Y�n0Xz|�|�}	Wntk
rjY�n
Xt|	d�}z|�|�}
Wntk
r�Yn�X||d�}z�t|
||�}t|
�dd�}
|d@dk}|�r$|d@dk}t	j
d	k�r8|s�t	j
d
k�r8|�|�}t	�t|�}t
|
|||�nt|
||	d||�Wnttfk
�rTYn Xt�d||�t|
|||d
�S|dk�r�|�|�}|�||�}t�d|�tj�s|dk	�r|dk	�r|�r�|dk�r�t	�|�}t|||�}
nt||t|��}
z|�|||
�Wntk
�rYnX|S)NFTr�r�r�r+rre�never�always�sizez
{} matches {})r�r�r�zcode object from {})r�r�rrr'rJr r+r��
memoryviewr��check_hash_based_pycsr��_RAW_MAGIC_NUMBERr�r�r�r�r�r�r�r1r�dont_write_bytecoder�r�r3r*)r�r�r�r�r�r��
hash_based�check_sourcer��str(r�rs�
bytes_data�code_objectrrrr�s�
���
�����

�

�zSourceLoader.get_codeN)
r�r�r�r&r'r*r(r-r1rrrrrr$Rs

r$csxeZdZdd�Zdd�Zdd�Ze�fdd��Zed	d
��Zdd�Z	ed
d��Z
dd�Zdd�Zdd�Z
dd�Z�ZS)�
FileLoadercCs||_||_dSrr�)r�r�r>rrrr�szFileLoader.__init__cCs|j|jko|j|jkSr��	__class__r��r��otherrrr�__eq__�s
�zFileLoader.__eq__cCst|j�t|j�ASr��hashr�r>�r�rrr�__hash__�szFileLoader.__hash__cstt|��|�Sr)�superr>r#r"�r@rrr#�s
zFileLoader.load_modulecCs|jSrrCr"rrrr�szFileLoader.get_filenamec
Csft|ttf�r:t�t|���}|��W5QR�SQRXn(t�|d��}|��W5QR�SQRXdS)N�r)r�r$�ExtensionFileLoaderr]�	open_coderu�readr^)r�r>rcrrrr+s
zFileLoader.get_datacCs|�|�r|SdSr)r��r�rrrr�get_resource_readers
zFileLoader.get_resource_readercCs tt|j�d|�}t�|d�S)NrrJ)r@rGr>r]r^�r��resourcer>rrr�
open_resourceszFileLoader.open_resourcecCs&|�|�st�tt|j�d|�}|Sr�)�is_resource�FileNotFoundErrorr@rGr>rPrrr�
resource_paths
zFileLoader.resource_pathcCs(t|krdStt|j�d|�}t|�S)NFr)r8r@rGr>rO�r�r�r>rrrrS szFileLoader.is_resourcecCstt�t|j�d��Sr�)�iterr�listdirrGr>rFrrr�contents&szFileLoader.contents)r�r�r�rrCrGr�r#r�r+rOrRrUrSrY�
__classcell__rrrIrr>�s

r>c@s*eZdZdd�Zdd�Zdd�dd�Zd	S)
�SourceFileLoadercCst|�}|j|jd�S)N)r�r4)rI�st_mtime�st_size)r�r>r;rrrr'.szSourceFileLoader.path_statscCst|�}|j|||d�S)N��_mode)r�r()r�r�r�r(rLrrrr*3sz SourceFileLoader._cache_bytecoderTr^c	Cs�t|�\}}g}|r4t|�s4t|�\}}|�|�qt|�D]l}t||�}zt�|�Wq<tk
rpYq<Yq<tk
r�}zt	�
d||�WY�dSd}~XYq<Xq<zt|||�t	�
d|�Wn0tk
r�}zt	�
d||�W5d}~XYnXdS)Nzcould not create {!r}: {!r}zcreated {!r})rGrQr:�reversedr@r�mkdir�FileExistsErrorrJr�r�rd)	r�r>r(r_�parentr�r<rAr,rrrr(8s0
��zSourceFileLoader.set_dataN)r�r�r�r'r*r(rrrrr[*sr[c@seZdZdd�Zdd�ZdS)�SourcelessFileLoadercCsD|�|�}|�|�}||d�}t|||�tt|�dd�||d�S)Nr�r�)r�r�)r�r+r�r�r5)r�r�r>r(r�rrrr[s

��zSourcelessFileLoader.get_codecCsdSrrr"rrrr-kszSourcelessFileLoader.get_sourceN)r�r�r�rr-rrrrrdWsrdc@sXeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
edd��ZdS)rKcCs@||_t|�s6ztt��|�}Wntk
r4YnX||_dSr)r�rSr@rrPrJr>rVrrrr|szExtensionFileLoader.__init__cCs|j|jko|j|jkSrr?rArrrrC�s
�zExtensionFileLoader.__eq__cCst|j�t|j�ASrrDrFrrrrG�szExtensionFileLoader.__hash__cCs$t�tj|�}t�d|j|j�|S)Nz&extension module {!r} loaded from {!r})r�rr��create_dynamicr�r�r>)r�r�rrrrr�s��z!ExtensionFileLoader.create_modulecCs$t�tj|�t�d|j|j�dS)Nz(extension module {!r} executed from {!r})r�rr��exec_dynamicr�r�r>rNrrrr �s
�zExtensionFileLoader.exec_modulecs$t|j�d�t�fdd�tD��S)Nr+c3s|]}�d|kVqdS)rNr�r	�suffix��	file_namerrrD�s�z1ExtensionFileLoader.is_package.<locals>.<genexpr>)rGr>�any�EXTENSION_SUFFIXESr"rrirr��s�zExtensionFileLoader.is_packagecCsdSrrr"rrrr�szExtensionFileLoader.get_codecCsdSrrr"rrrr-�szExtensionFileLoader.get_sourcecCs|jSrrCr"rrrr��sz ExtensionFileLoader.get_filenameN)
r�r�r�rrCrGrr r�rr-r�r�rrrrrKts	rKc@sdeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�_NamespacePathcCs$||_||_t|���|_||_dSr)�_name�_pathr��_get_parent_path�_last_parent_path�_path_finder�r�r�r>�path_finderrrrr�sz_NamespacePath.__init__cCs&|j�d�\}}}|dkrdS|dfS)Nrhr)rr>�__path__)rnro)r�rc�dot�merrr�_find_parent_path_names�sz&_NamespacePath._find_parent_path_namescCs|��\}}ttj||�Sr)rxr�r�modules)r��parent_module_name�path_attr_namerrrrp�sz_NamespacePath._get_parent_pathcCsPt|���}||jkrJ|�|j|�}|dk	rD|jdkrD|jrD|j|_||_|jSr)r�rprqrrrnr�r�ro)r��parent_pathr�rrr�_recalculate�s
z_NamespacePath._recalculatecCst|���Sr)rWr}rFrrr�__iter__�sz_NamespacePath.__iter__cCs|��|Sr�r})r��indexrrr�__getitem__�sz_NamespacePath.__getitem__cCs||j|<dSr)ro)r�r�r>rrr�__setitem__�sz_NamespacePath.__setitem__cCst|���Sr)r3r}rFrrr�__len__�sz_NamespacePath.__len__cCsd�|j�S)Nz_NamespacePath({!r}))rWrorFrrr�__repr__�sz_NamespacePath.__repr__cCs||��kSrr�r��itemrrr�__contains__�sz_NamespacePath.__contains__cCs|j�|�dSr)ror:r�rrrr:�sz_NamespacePath.appendN)r�r�r�rrxrpr}r~r�r�r�r�r�r:rrrrrm�s

rmc@sPeZdZdd�Zedd��Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�ZdS)�_NamespaceLoadercCst|||�|_dSr)rmrorsrrrr�sz_NamespaceLoader.__init__cCsd�|j�S)Nz<module {!r} (namespace)>)rWr�)rrrrr�module_repr�sz_NamespaceLoader.module_reprcCsdS)NTrr"rrrr��sz_NamespaceLoader.is_packagecCsdS�Nrrr"rrrr-�sz_NamespaceLoader.get_sourcecCstddddd�S)Nrz<string>rT)r/)r0r"rrrrsz_NamespaceLoader.get_codecCsdSrrrrrrrsz_NamespaceLoader.create_modulecCsdSrrrNrrrr sz_NamespaceLoader.exec_modulecCst�d|j�t�||�S)Nz&namespace module loaded with path {!r})r�r�ror!r"rrrr#	s�z_NamespaceLoader.load_moduleN)r�r�r�rrr�r�r-rrr r#rrrrr��s
r�c@sreZdZedd��Zedd��Zedd��Zedd��Zedd
d��Zeddd
��Z	eddd��Z
edd��Zd	S)�
PathFindercCs@ttj���D],\}}|dkr(tj|=qt|d�r|��qdS)N�invalidate_caches)�listr�path_importer_cache�itemsr�r�)rr��finderrrrr�s


zPathFinder.invalidate_cachesc	CsTtjdk	rtjst�dt�tjD],}z||�WStk
rLYq"Yq"Xq"dS)Nzsys.path_hooks is empty)r�
path_hooksrjrkr�r�)rr>�hookrrr�_path_hooks%s
zPathFinder._path_hookscCsh|dkr,zt��}Wntk
r*YdSXztj|}Wn(tk
rb|�|�}|tj|<YnX|Sr�)rrPrTrr��KeyErrorr�)rr>r�rrr�_path_importer_cache2s
zPathFinder._path_importer_cachecCsRt|d�r|�|�\}}n|�|�}g}|dk	r<t�||�St�|d�}||_|S)Nr�)r�r�rr�rr�r�)rr�r�r�r�r�rrr�_legacy_get_specHs

zPathFinder._legacy_get_specNc	Cs�g}|D]�}t|ttf�sq|�|�}|dk	rt|d�rF|�||�}n|�||�}|dkr\q|jdk	rn|S|j}|dkr�t	d��|�
|�qt�|d�}||_|S)Nrzspec missing loader)
r�ru�bytesr�r�rr�r�r�r�r�r�r�)	rr�r>r�namespace_path�entryr�r�r�rrr�	_get_specWs(


zPathFinder._get_speccCsd|dkrtj}|�|||�}|dkr(dS|jdkr\|j}|rVd|_t|||j�|_|SdSn|SdSr)rr>r�r�r�r�rm)rr�r>rr�r�rrrrws
zPathFinder.find_speccCs|�||�}|dkrdS|jSrrrrrrr�szPathFinder.find_modulecOsddlm}|j||�S)Nr)�MetadataPathFinder)�importlib.metadatar��find_distributions)rr�r�r�rrrr��s
zPathFinder.find_distributions)N)NN)N)r�r�r�rr�r�r�r�r�rrr�rrrrr�s 
	


r�c@sVeZdZdd�Zdd�ZeZdd�Zdd�Zdd
d�Z	dd
�Z
edd��Zdd�Z
d	S)�
FileFindercspg}|D] \�}|��fdd�|D��q||_|p6d|_t|j�sVtt��|j�|_d|_t�|_	t�|_
dS)Nc3s|]}|�fVqdSrrrg�r�rrrD�sz&FileFinder.__init__.<locals>.<genexpr>rhr�)r��_loadersr>rSr@rrP�_path_mtime�set�_path_cache�_relaxed_path_cache)r�r>�loader_details�loadersr�rr�rr�s

zFileFinder.__init__cCs
d|_dS)Nr�)r�rFrrrr��szFileFinder.invalidate_cachescCs*|�|�}|dkrdgfS|j|jp&gfSr)rr�r�)r�r�r�rrrr��s
zFileFinder.find_loadercCs|||�}t||||d�S)Nr�)r�)r�r�r�r>�smslrr�rrrr��s
�zFileFinder._get_specNc	Cs�d}|�d�d}zt|jp"t���j}Wntk
rBd}YnX||jkr\|��||_t	�rr|j
}|��}n
|j}|}||kr�t
|j|�}|jD]:\}	}
d|	}t
||�}t|�r�|�|
|||g|�Sq�t|�}|jD]r\}	}
zt
|j||	�}Wntk
�rYdSXtjd|dd�||	|kr�t|�r�|�|
||d|�Sq�|�r~t�d|�t�|d�}
|g|
_|
SdS)	NFrhrer�rz	trying {})�	verbosityzpossible namespace for {})rorIr>rrPr\rJr��_fill_cacherr�r�r�r@r�rOr�rQrwr�r�r�r�)r�r�r�is_namespace�tail_moduler��cache�cache_module�	base_pathrhr��
init_filename�	full_pathr�rrrr�sP





�
zFileFinder.find_specc	
Cs�|j}zt�|pt���}Wntttfk
r:g}YnXtj�	d�sTt
|�|_nJt
�}|D]8}|�d�\}}}|r�d�
||���}n|}|�|�q^||_tj�	t�r�dd�|D�|_dS)Nr
rhrUcSsh|]}|���qSr)r�)r	�fnrrrr*sz)FileFinder._fill_cache.<locals>.<setcomp>)r>rrXrPrT�PermissionError�NotADirectoryErrorrrrr�r�r�rWr��addrr�)	r�r>rY�lower_suffix_contentsr�r�rvrh�new_namerrrr�
s"
zFileFinder._fill_cachecs��fdd�}|S)Ncs"t|�std|d���|f���S)Nzonly directories are supportedrC)rQr�rC�rr�rr�path_hook_for_FileFinder6sz6FileFinder.path_hook.<locals>.path_hook_for_FileFinderr)rr�r�rr�r�	path_hook,s
zFileFinder.path_hookcCsd�|j�S)NzFileFinder({!r}))rWr>rFrrrr�>szFileFinder.__repr__)N)r�r�r�rr�r�rr�r�rr�rr�r�rrrrr��s	
3
r�cCs�|�d�}|�d�}|sB|r$|j}n||kr8t||�}n
t||�}|sTt|||d�}z$||d<||d<||d<||d<Wntk
r�YnXdS)N�
__loader__�__spec__r��__file__�
__cached__)�getr�rdr[r��	Exception)�nsr��pathname�	cpathnamer�r�rrr�_fix_up_moduleDs"


r�cCs*ttt���f}ttf}ttf}|||gSr)rK�_alternative_architecturesr��extension_suffixesr[r�rdry)�
extensions�source�bytecoderrrr�[sr�c	Cs�|atjatjatjt}dD]0}|tjkr8t�|�}n
tj|}t|||�qddgfdddgff}|D]X\}}|d}|tjkr�tj|}q�qjzt�|�}Wq�Wqjtk
r�YqjYqjXqjtd��t|d|�t|d	|�t|d
d�|��t|dd
d�|D��t�d�}	t|d|	�t�d�}
t|d|
�|dk�rXt�d�}t|d|�t|dt	��t
�tt�
���|dk�r�t�d�dt
k�r�dt_dS)N)r]rj�builtinsr��posixr�ntrrzimportlib requires posix or ntrr8r.r�_pathseps_with_coloncSsh|]}d|���qSrrrrrrr�sz_setup.<locals>.<setcomp>�_thread�_weakref�winregr�rz.pywz_d.pydT)r�rr�ryr��_builtin_from_namer�r�r;rrlr�r�r�r�r:r�r)�_bootstrap_module�self_module�builtin_name�builtin_module�
os_details�
builtin_osr.r8�	os_module�
thread_module�weakref_module�
winreg_modulerrr�_setupfsL













r�cCs2t|�t�}tj�tj|�g�tj�t	�dSr)
r�r�rr�r�r�r��	meta_pathr:r�)r��supported_loadersrrr�_install�sr��-arm-linux-gnueabihf.�-armeb-linux-gnueabihf.�-mips64-linux-gnuabi64.�-mips64el-linux-gnuabi64.�-powerpc-linux-gnu.�-powerpc-linux-gnuspe.�-powerpc64-linux-gnu.�-powerpc64le-linux-gnu.�-arm-linux-gnueabi.�-armeb-linux-gnueabi.�-mips64-linux-gnu.�-mips64el-linux-gnu.�-ppc-linux-gnu.�-ppc-linux-gnuspe.�-ppc64-linux-gnu.�-ppc64le-linux-gnu.)r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�cCsF|D]<}t��D].\}}||kr|�|�||��|Sqq|Sr)�	_ARCH_MAPr�r:rR)r�rh�original�alternativerrrr��sr�)rT)N)NNN)rr)T)N)N)Qr�r]rrjr�r�_MS_WINDOWSr�rr�r�r.r8r�r6r;r�r�%_CASE_INSENSITIVE_PLATFORMS_BYTES_KEYrrr#r)r*r@rGrIrNrOrQrSrd�type�__code__r�r!r�r r&r7r|rxr�ry�DEBUG_BYTECODE_SUFFIXES�OPTIMIZED_BYTECODE_SUFFIXESr�r�r�r�r�r�r�r�r�r�r�r�r�r��objectr�r�r�rr$r>r[rdrlrKrmr�r�r�r�r�r�r�r�r�rrrr�<module>s�



�

	



G(!



�D@H-:?*
A	�importlib/__pycache__/abc.cpython-38.pyc000064400000032407151153537630014151 0ustar00U

e5dI2�
@s�dZddlmZddlmZddlmZzddlZWn2ek
rfZzejdkrR�dZW5dZ[XYnXzddl	Z	Wn&ek
r�ZzeZ	W5dZ[XYnXddl
Z
ddlZdd	�ZGd
d�de
j
d�ZGd
d�de�Zeeejejejej�Gdd�de�Zeeej�Gdd�de
j
d�ZGdd�de�ZGdd�de�Zeeejej�Gdd�de�Zeeej�Gdd�dejee�Zeeejej�Gdd�dejee�Zeeej�Gdd�de
j
d�Zeeej�dS)z(Abstract base classes related to import.�)�
_bootstrap)�_bootstrap_external)�	machinery�N�_frozen_importlibc	Gs\|D]R}|�|�tdk	rztt|j�}Wn tk
rJtt|j�}YnX|�|�qdS)N)�registerr�getattr�__name__�AttributeError�_frozen_importlib_external)�abstract_cls�classes�cls�
frozen_cls�r�%/usr/lib64/python3.8/importlib/abc.py�	_registers
rc@s eZdZdZejddd��ZdS)�Findera<Legacy abstract base class for import finders.

    It may be subclassed for compatibility with legacy third party
    reimplementations of the import system.  Otherwise, finder
    implementations should derive from the more specific MetaPathFinder
    or PathEntryFinder ABCs.

    Deprecated since Python 3.3
    NcCsdS)z�An abstract method that should find a module.
        The fullname is a str and the optional path is a str or None.
        Returns a Loader object or None.
        Nr)�self�fullname�pathrrr�find_module*szFinder.find_module)N)r	�
__module__�__qualname__�__doc__�abc�abstractmethodrrrrrrs
r)�	metaclassc@s eZdZdZdd�Zdd�ZdS)�MetaPathFinderz8Abstract base class for import finders on sys.meta_path.cCs<tjdtdd�t|d�sdS|�||�}|dk	r8|jSdS)a_Return a loader for the module.

        If no module is found, return None.  The fullname is a str and
        the path is a list of strings or None.

        This method is deprecated since Python 3.4 in favor of
        finder.find_spec(). If find_spec() exists then backwards-compatible
        functionality is provided for this method.

        zxMetaPathFinder.find_module() is deprecated since Python 3.4 in favor of MetaPathFinder.find_spec() (available since 3.4)���
stacklevel�	find_specN)�warnings�warn�DeprecationWarning�hasattrr"�loader)rrr�foundrrrr9s�
zMetaPathFinder.find_modulecCsdS)z�An optional method for clearing the finder's cache, if any.
        This method is used by importlib.invalidate_caches().
        Nr�rrrr�invalidate_cachesNsz MetaPathFinder.invalidate_cachesN)r	rrrrr*rrrrr2src@s&eZdZdZdd�ZejZdd�ZdS)�PathEntryFinderz>Abstract base class for path entry finders used by PathFinder.cCs\tjdtdd�t|d�s"dgfS|�|�}|dk	rP|js@g}n|j}|j|fSdgfSdS)a[Return (loader, namespace portion) for the path entry.

        The fullname is a str.  The namespace portion is a sequence of
        path entries contributing to part of a namespace package. The
        sequence may be empty.  If loader is not None, the portion will
        be ignored.

        The portion will be discarded if another path entry finder
        locates the module as a normal module or package.

        This method is deprecated since Python 3.4 in favor of
        finder.find_spec(). If find_spec() is provided than backwards-compatible
        functionality is provided.
        zzPathEntryFinder.find_loader() is deprecated since Python 3.4 in favor of PathEntryFinder.find_spec() (available since 3.4)rr r"N)r#r$r%r&r"�submodule_search_locationsr')rrr(�portionsrrr�find_loader^s�


zPathEntryFinder.find_loadercCsdS)z�An optional method for clearing the finder's cache, if any.
        This method is used by PathFinder.invalidate_caches().
        Nrr)rrrr*�sz!PathEntryFinder.invalidate_cachesN)	r	rrrr.r�_find_module_shimrr*rrrrr+Ws r+c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�Loaderz'Abstract base class for import loaders.cCsdS)z�Return a module to initialize and into which to load.

        This method should raise ImportError if anything prevents it
        from creating a new module.  It may return None to indicate
        that the spec should create the new module.
        Nr)r�specrrr�
create_module�szLoader.create_modulecCst|d�st�t�||�S)a�Return the loaded module.

        The module must be added to sys.modules and have import-related
        attributes set properly.  The fullname is a str.

        ImportError is raised on failure.

        This method is deprecated in favor of loader.exec_module(). If
        exec_module() exists then it is used to provide a backwards-compatible
        functionality for this method.

        �exec_module)r&�ImportErrorr�_load_module_shim�rrrrr�load_module�s
zLoader.load_modulecCst�dS)z�Return a module's repr.

        Used by the module type when the method does not raise
        NotImplementedError.

        This method is deprecated.

        N)�NotImplementedError)r�modulerrr�module_repr�s
zLoader.module_reprN)r	rrrr2r7r:rrrrr0�s
r0c@seZdZdZejdd��ZdS)�ResourceLoaderz�Abstract base class for loaders which can return data from their
    back-end storage.

    This ABC represents one of the optional protocols specified by PEP 302.

    cCst�dS)zwAbstract method which when implemented should return the bytes for
        the specified path.  The path must be a str.N)�OSError�rrrrr�get_data�szResourceLoader.get_dataN)r	rrrrrr>rrrrr;�sr;c@sLeZdZdZdd�Zdd�Zejdd��Ze	dd	d
��Z
ejj
Z
ejjZdS)
�
InspectLoaderz�Abstract base class for loaders which support inspection about the
    modules they can load.

    This ABC represents one of the optional protocols specified by PEP 302.

    cCst�dS)z�Optional method which when implemented should return whether the
        module is a package.  The fullname is a str.  Returns a bool.

        Raises ImportError if the module cannot be found.
        N�r4r6rrr�
is_package�szInspectLoader.is_packagecCs |�|�}|dkrdS|�|�S)aMethod which returns the code object for the module.

        The fullname is a str.  Returns a types.CodeType if possible, else
        returns None if a code object does not make sense
        (e.g. built-in module). Raises ImportError if the module cannot be
        found.
        N)�
get_source�source_to_code)rr�sourcerrr�get_code�s
zInspectLoader.get_codecCst�dS)z�Abstract method which should return the source code for the
        module.  The fullname is a str.  Returns a str.

        Raises ImportError if the module cannot be found.
        Nr@r6rrrrB�szInspectLoader.get_source�<string>cCst||ddd�S)z�Compile 'data' into a code object.

        The 'data' argument can be anything that compile() can handle. The'path'
        argument should be where the data was retrieved (when applicable).�execT)�dont_inherit)�compile)�datarrrrrC�szInspectLoader.source_to_codeN)rF)r	rrrrArErrrB�staticmethodrCr�
_LoaderBasicsr3r7rrrrr?�s

r?c@s&eZdZdZejdd��Zdd�ZdS)�ExecutionLoaderz�Abstract base class for loaders that wish to support the execution of
    modules as scripts.

    This ABC represents one of the optional protocols specified in PEP 302.

    cCst�dS)z�Abstract method which should return the value that __file__ is to be
        set to.

        Raises ImportError if the module cannot be found.
        Nr@r6rrr�get_filenameszExecutionLoader.get_filenamecCsT|�|�}|dkrdSz|�|�}Wntk
rB|�|�YSX|�||�SdS)z�Method to return the code object for fullname.

        Should return None if not applicable (e.g. built-in module).
        Raise ImportError if the module cannot be found.
        N)rBrNr4rC)rrrDrrrrrEs
zExecutionLoader.get_codeN)r	rrrrrrNrErrrrrM�s
rMc@seZdZdZdS)�
FileLoaderz[Abstract base class partially implementing the ResourceLoader and
    ExecutionLoader ABCs.N)r	rrrrrrrrO!srOc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�SourceLoadera�Abstract base class for loading source code (and optionally any
    corresponding bytecode).

    To support loading from source code, the abstractmethods inherited from
    ResourceLoader and ExecutionLoader need to be implemented. To also support
    loading from bytecode, the optional methods specified directly by this ABC
    is required.

    Inherited abstractmethods not implemented in this ABC:

        * ResourceLoader.get_data
        * ExecutionLoader.get_filename

    cCs$|jjtjkrt�t|�|�d�S)z6Return the (int) modification time for the path (str).�mtime)�
path_stats�__func__rPr<�intr=rrr�
path_mtime;szSourceLoader.path_mtimecCs |jjtjkrt�d|�|�iS)aReturn a metadata dict for the source pointed to by the path (str).
        Possible keys:
        - 'mtime' (mandatory) is the numeric timestamp of last source
          code modification;
        - 'size' (optional) is the size in bytes of the source code.
        rQ)rUrSrPr<r=rrrrRAszSourceLoader.path_statscCsdS)aWrite the bytes to the path (if possible).

        Accepts a str path and data as bytes.

        Any needed intermediary directories are to be created. If for some
        reason the file cannot be written because of permissions, fail
        silently.
        Nr)rrrJrrr�set_dataLszSourceLoader.set_dataN)r	rrrrUrRrVrrrrrP*srPc@sHeZdZdZejdd��Zejdd��Zejdd��Zejdd	��Z	d
S)�ResourceReaderz�Abstract base class to provide resource-reading support.

    Loaders that support resource reading are expected to implement
    the ``get_resource_reader(fullname)`` method and have it either return None
    or an object compatible with this ABC.
    cCst�dS)aReturn an opened, file-like object for binary reading.

        The 'resource' argument is expected to represent only a file name
        and thus not contain any subdirectory components.

        If the resource cannot be found, FileNotFoundError is raised.
        N��FileNotFoundError�r�resourcerrr�
open_resourcebs	zResourceReader.open_resourcecCst�dS)a!Return the file system path to the specified resource.

        The 'resource' argument is expected to represent only a file name
        and thus not contain any subdirectory components.

        If the resource does not exist on the file system, raise
        FileNotFoundError.
        NrXrZrrr�
resource_pathms
zResourceReader.resource_pathcCst�dS)z7Return True if the named 'name' is consider a resource.NrX)r�namerrr�is_resourceyszResourceReader.is_resourcecCsgS)z?Return an iterable of strings over the contents of the package.rr)rrr�contents~szResourceReader.contentsN)
r	rrrrrr\r]r_r`rrrrrWYs



rW) r�rrrrr4�excr^rrr#r�ABCMetarr�BuiltinImporter�FrozenImporter�
PathFinder�WindowsRegistryFinderr+�
FileFinderr0r;r?rM�ExtensionFileLoaderrO�SourceFileLoader�SourcelessFileLoaderrPrWrrrr�<module>sL
!�./2"�,+importlib/__pycache__/__init__.cpython-38.opt-1.pyc000064400000007260151153537630016121 0ustar00U

e5d��@sjdZddddgZddlZddlZzddlZWn,ek
rXddlmZe�ee�Yn@Xd	e_	d
e_
ze�dd�e_Wne
k
r�YnXeejd	<zddlZWn0ek
r�dd
lmZe�e�ee_YnBXde_	d
e_
ze�dd�e_Wne
k
�r
YnXeejd<ejZejZddlZddlZddlmZdd�Zddd�Zddd�ZiZdd�ZdS)z'A pure Python implementation of import.�
__import__�
import_module�invalidate_caches�reload�N�)�
_bootstrapzimportlib._bootstrap�	importlibz__init__.pyz
_bootstrap.py)�_bootstrap_externalzimportlib._bootstrap_externalz_bootstrap_external.py)rcCs"tjD]}t|d�r|��qdS)zmCall the invalidate_caches() method on all meta path finders stored in
    sys.meta_path (where implemented).rN)�sys�	meta_path�hasattrr)�finder�r�*/usr/lib64/python3.8/importlib/__init__.pyrBs

cCs�tjdtdd�z.tj|j}|dkr6td�|���n|WSWn6tk
rRYn$t	k
rttd�|��d�YnXt
�||�}|dkr�dS|jdkr�|j
dkr�td�|�|d��td	|d��|jS)
z�Return the loader for the specified module.

    This is a backward-compatible wrapper around find_spec().

    This function is deprecated in favor of importlib.util.find_spec().

    zDDeprecated since Python 3.4. Use importlib.util.find_spec() instead.�)�
stacklevelNz{}.__loader__ is Nonez{}.__loader__ is not setzspec for {} missing loader��namez&namespace packages do not have loaders)�warnings�warn�DeprecationWarningr
�modules�
__loader__�
ValueError�format�KeyError�AttributeErrorr�
_find_spec�loader�submodule_search_locations�ImportError)r�pathr�specrrr�find_loaderJs2�



��r#cCsXd}|�d�rB|s$d}t|�|���|D]}|dkr8qB|d7}q(t�||d�||�S)z�Import a module.

    The 'package' argument is required when performing a relative import. It
    specifies the package to use as the anchor point from which to resolve the
    relative import to an absolute import.

    r�.zHthe 'package' argument is required to perform a relative import for {!r}rN)�
startswith�	TypeErrorrr�_gcd_import)r�package�level�msg�	characterrrrrms

cCsP|rt|tj�std��z|jj}Wntk
r>|j}YnXtj	�
|�|k	rfd}t|�|�|d��|t
krvt
|S|t
|<z�|�d�d}|r�ztj	|}Wn,tk
r�d}t|�|�|d�d�Yq�X|j}nd}|}t�|||�}|_|dk�rtd|��|d��t�||�tj	|W�Sz
t
|=Wntk
�rHYnXXdS)	zcReload the module and return it.

    The module must have been successfully imported before.

    z"reload() argument must be a modulezmodule {} not in sys.modulesrr$rzparent {!r} not in sys.modulesNzspec not found for the module )�
isinstance�types�
ModuleTyper&�__spec__rr�__name__r
r�getr r�
_RELOADINGr�
rpartition�__path__rr�ModuleNotFoundError�_exec)�modulerr*�parent_name�parent�pkgpath�targetr"rrrr�sH
��

)N)N)�__doc__�__all__�_impr
�_frozen_importlibrr ��_setupr0�__package__�__file__�replace�	NameErrorr�_frozen_importlib_externalr	�_pack_uint32�_unpack_uint32r-rrrr#rr2rrrrr�<module>sL




#
importlib/__pycache__/_bootstrap_external.cpython-38.opt-1.pyc000064400000131204151153537630020434 0ustar00U

&�.e��@s�dZddladdlZddladdlZddlZtjdkZerLddlZ	ddl
Z
nddlZ	erbddgZndgZedZ
ee�Zd�e�Zdd�eD�Zd	Zd
ZeeZdd�Zd
d�Zdd�Zdd�Zer�dd�Zndd�Zdd�Zdd�Zdd�Zdd�Zdd�Ze�rd d!�Znd"d!�Zd�d$d%�Z e!e j"�Z#d&�$d'd(�d)Z%e&�'e%d(�Z(d*Z)d+Z*d,gZ+d-gZ,e,Z-Z.d�dd.�d/d0�Z/d1d2�Z0d3d4�Z1d5d6�Z2d7d8�Z3d9d:�Z4d;d<�Z5d=d>�Z6d?d@�Z7dAdB�Z8d�dCdD�Z9d�dEdF�Z:d�dHdI�Z;dJdK�Z<e=�Z>d�de>dL�dMdN�Z?GdOdP�dP�Z@GdQdR�dR�ZAGdSdT�dTeA�ZBGdUdV�dV�ZCGdWdX�dXeCeB�ZDGdYdZ�dZeCeA�ZEgZFGd[d\�d\eCeA�ZGGd]d^�d^�ZHGd_d`�d`�ZIGdadb�db�ZJGdcdd�dd�ZKd�dedf�ZLdgdh�ZMdidj�ZNdkdl�ZOdmdndodpdqdrdsdtdudvdwdxdydzd{d|d}�ZPd~d�ZQdS)�a^Core implementation of path-based import.

This module is NOT meant to be directly imported! It has been designed such
that it can be bootstrapped into Python as the implementation of import. As
such it requires the injection of specific modules and attributes in order to
work. One should use importlib as the public-facing version of this module.

�NZwin32�\�/�cCsh|]}d|���qS��:���.0�srr�5/usr/lib64/python3.8/importlib/_bootstrap_external.py�	<setcomp>/sr)�win)�cygwin�darwincs<tj�t�r0tj�t�rd�nd��fdd�}ndd�}|S)N�PYTHONCASEOKsPYTHONCASEOKcs
�tjkS)�5True if filenames must be checked case-insensitively.)�_os�environr��keyrr�_relax_case@sz%_make_relax_case.<locals>._relax_casecSsdS)rFrrrrrrDs)�sys�platform�
startswith�_CASE_INSENSITIVE_PLATFORMS�#_CASE_INSENSITIVE_PLATFORMS_STR_KEY)rrrr�_make_relax_case9srcCst|�d@�dd�S)z*Convert a 32-bit integer to little-endian.�����little)�int�to_bytes)�xrrr�_pack_uint32Jsr#cCst�|d�S)z/Convert 4 bytes in little-endian to an integer.r�r �
from_bytes��datarrr�_unpack_uint32Osr(cCst�|d�S)z/Convert 2 bytes in little-endian to an integer.rr$r&rrr�_unpack_uint16Tsr)cGs�|sdSt|�dkr|dSd}g}ttj|�D]z\}}|�t�sL|�t�rf|�t�pX|}t	|g}q0|�d�r�|�
�|�
�kr�|}|g}q�|�|�q0|p�|}|�|�q0dd�|D�}t|�dkr�|ds�|t	S|t	�|�S)�Replacement for os.path.join().r�rrcSsg|]}|r|�t��qSr��rstrip�path_separators�r	�prrr�
<listcomp>rs�_path_join.<locals>.<listcomp>)
�len�mapr�_path_splitrootr�path_sep_tuple�endswithr-r.�path_sep�casefold�append�join)�
path_parts�root�pathZnew_root�tailrrr�
_path_join[s*
r@cGst�dd�|D��S)r*cSsg|]}|r|�t��qSrr,)r	�partrrrr1{s�r2)r8r;)r<rrrr@ys
�csBt�fdd�tD��}|dkr&d�fS�d|��|dd�fS)z Replacement for os.path.split().c3s|]}��|�VqdS�N)�rfindr/�r>rr�	<genexpr>�sz_path_split.<locals>.<genexpr>rrNr+)�maxr.)r>�irrDr�_path_splitsrHcCs
t�|�S)z~Stat the path.

    Made a separate function to make it easier to override in experiments
    (e.g. cache stat results).

    )r�statrDrrr�
_path_stat�srJcCs2zt|�}Wntk
r"YdSX|jd@|kS)z1Test whether the path is the specified mode type.Fi�)rJ�OSError�st_mode)r>�mode�	stat_inforrr�_path_is_mode_type�s
rOcCs
t|d�S)zReplacement for os.path.isfile.i�)rOrDrrr�_path_isfile�srPcCs|st��}t|d�S)zReplacement for os.path.isdir.i@)r�getcwdrOrDrrr�_path_isdir�srRcCs>|sdSt�|�d�dd�}t|�dko<|�d�p<|�d�S)�Replacement for os.path.isabs.Frrrr+z\\)rr5�replacer3rr7)r>r=rrr�_path_isabs�srUcCs
|�t�S)rS)rr.rDrrrrU�s�cCs�d�|t|��}t�|tjtjBtjB|d@�}z2t�|d��}|�	|�W5QRXt�
||�Wn:tk
r�zt�|�Wntk
r�YnX�YnXdS)z�Best-effort function to write data to a path atomically.
    Be prepared to handle a FileExistsError if concurrent writing of the
    temporary file is attempted.�{}.{}rV�wbN)
�format�idr�open�O_EXCL�O_CREAT�O_WRONLY�_io�FileIO�writerTrK�unlink)r>r'rM�path_tmp�fd�filerrr�
_write_atomic�s�rfiU
�rs
�__pycache__zopt-z.pyz.pyc)�optimizationcCsX|dk	r4t�dt�|dk	r(d}t|��|r0dnd}t�|�}t|�\}}|�d�\}}}tj	j
}	|	dkrrtd��d�|r~|n|||	g�}
|dkr�tj
jdkr�d}ntj
j}t|�}|dkr�|��s�td	�|���d
�|
t|�}
|
td}tjdk	�rLt|��stt��|�}|ddk�r8|dtk�r8|dd�}ttj|�t�|�St|t|�S)
a�Given the path to a .py file, return the path to its .pyc file.

    The .py file does not need to exist; this simply returns the path to the
    .pyc file calculated as if the .py file were imported.

    The 'optimization' parameter controls the presumed optimization level of
    the bytecode file. If 'optimization' is not None, the string representation
    of the argument is taken and verified to be alphanumeric (else ValueError
    is raised).

    The debug_override parameter is deprecated. If debug_override is not None,
    a True value is the same as setting 'optimization' to the empty string
    while a False value is equivalent to setting 'optimization' to '1'.

    If sys.implementation.cache_tag is None then NotImplementedError is raised.

    NzFthe debug_override parameter is deprecated; use 'optimization' insteadz2debug_override or optimization must be set to Nonerr+�.�$sys.implementation.cache_tag is Nonerz{!r} is not alphanumericz{}.{}{}rrg)�	_warnings�warn�DeprecationWarning�	TypeErrorr�fspathrH�
rpartitionr�implementation�	cache_tag�NotImplementedErrorr;�flags�optimize�str�isalnum�
ValueErrorrY�_OPT�BYTECODE_SUFFIXES�pycache_prefixrUr@rQr.�lstrip�_PYCACHE)r>�debug_overrideri�message�headr?�base�sep�rest�tag�almost_filename�filenamerrr�cache_from_sourcebsH�
	
�r�c
Cs.tjjdkrtd��t�|�}t|�\}}d}tjdk	rftj�t	�}|�
|t�rf|t|�d�}d}|s�t|�\}}|t
kr�tt
�d|����|�d�}|dkr�td|����n\|d	k�r|�dd
�d}|�
t�s�tdt����|tt�d�}|���std
|�d���|�d�d}	t||	td�S)anGiven the path to a .pyc. file, return the path to its .py file.

    The .pyc file does not need to exist; this simply returns the path to
    the .py file calculated to correspond to the .pyc file.  If path does
    not conform to PEP 3147/488 format, ValueError will be raised. If
    sys.implementation.cache_tag is None then NotImplementedError is raised.

    NrkFTz not bottom-level directory in rj>rg�zexpected only 2 or 3 dots in r�rg���z5optimization portion of filename does not start with zoptimization level z is not an alphanumeric valuer)rrrrsrtrrprHr|r-r.rr8r3r~ry�count�rsplitrzrx�	partitionr@�SOURCE_SUFFIXES)
r>r��pycache_filename�found_in_pycache_prefix�
stripped_path�pycache�	dot_countri�	opt_level�
base_filenamerrr�source_from_cache�s4	





r�c	Cs~t|�dkrdS|�d�\}}}|r8|��dd�dkr<|Szt|�}Wn$ttfk
rl|dd�}YnXt|�rz|S|S)z�Convert a bytecode file path to a source path (if possible).

    This function exists purely for backwards-compatibility for
    PyImport_ExecCodeModuleWithFilenames() in the C API.

    rNrj�������py)r3rq�lowerr�rtryrP)�
bytecode_pathr��_�	extension�source_pathrrr�_get_sourcefile�sr�cCsJ|�tt��r0z
t|�WStk
r,YqFXn|�tt��rB|SdSdSrB)r7�tupler�r�rtr{)r�rrr�_get_cached�s
r�cCs4zt|�j}Wntk
r&d}YnX|dO}|S)z3Calculate the mode permissions for a bytecode file.rV�)rJrLrK)r>rMrrr�
_calc_mode�s
r�csDd�fdd�	}z
tj}Wntk
r4dd�}YnX||��|S)z�Decorator to verify that the module being requested matches the one the
    loader can handle.

    The first argument (self) must define _name which the second argument is
    compared against. If the comparison fails then ImportError is raised.

    NcsB|dkr|j}n |j|kr0td|j|f|d���||f|�|�S)Nzloader for %s cannot handle %s��name)r��ImportError)�selfr��args�kwargs��methodrr�_check_name_wrappers
��z(_check_name.<locals>._check_name_wrappercSs8dD] }t||�rt||t||��q|j�|j�dS)N)�
__module__�__name__�__qualname__�__doc__)�hasattr�setattr�getattr�__dict__�update)�new�oldrTrrr�_wraps
z_check_name.<locals>._wrap)N)�
_bootstrapr��	NameError)r�r�r�rr�r�_check_name�s

r�cCs<|�|�\}}|dkr8t|�r8d}t�|�|d�t�|S)z�Try to find a loader for the specified module by delegating to
    self.find_loader().

    This method is deprecated in favor of finder.find_spec().

    Nz,Not importing directory {}: missing __init__r)�find_loaderr3rlrmrY�
ImportWarning)r��fullname�loader�portions�msgrrr�_find_module_shims

r�cCs�|dd�}|tkr<d|�d|��}t�d|�t|f|��t|�dkrfd|��}t�d|�t|��t|dd��}|d	@r�d
|�d|��}t|f|��|S)aTPerform basic validity checking of a pyc header and return the flags field,
    which determines how the pyc should be further validated against the source.

    *data* is the contents of the pyc file. (Only the first 16 bytes are
    required, though.)

    *name* is the name of the module being imported. It is used for logging.

    *exc_details* is a dictionary passed to ImportError if it raised for
    improved debugging.

    ImportError is raised when the magic number is incorrect or when the flags
    field is invalid. EOFError is raised when the data is found to be truncated.

    Nrzbad magic number in z: �{}�z(reached EOF while reading pyc header of ����zinvalid flags z in )�MAGIC_NUMBERr��_verbose_messager�r3�EOFErrorr()r'r��exc_details�magicr�rurrr�
_classify_pyc)s
r�cCspt|dd��|d@kr:d|��}t�d|�t|f|��|dk	rlt|dd��|d@krltd|��f|��dS)aValidate a pyc against the source last-modified time.

    *data* is the contents of the pyc file. (Only the first 16 bytes are
    required.)

    *source_mtime* is the last modified timestamp of the source file.

    *source_size* is None or the size of the source file in bytes.

    *name* is the name of the module being imported. It is used for logging.

    *exc_details* is a dictionary passed to ImportError if it raised for
    improved debugging.

    An ImportError is raised if the bytecode is stale.

    r��rzbytecode is stale for r�Nr�)r(r�r�r�)r'�source_mtime�source_sizer�r�r�rrr�_validate_timestamp_pycJs
�r�cCs&|dd�|kr"td|��f|��dS)a�Validate a hash-based pyc by checking the real source hash against the one in
    the pyc header.

    *data* is the contents of the pyc file. (Only the first 16 bytes are
    required.)

    *source_hash* is the importlib.util.source_hash() of the source file.

    *name* is the name of the module being imported. It is used for logging.

    *exc_details* is a dictionary passed to ImportError if it raised for
    improved debugging.

    An ImportError is raised if the bytecode is stale.

    r�r�z.hash in bytecode doesn't match hash of source N)r�)r'�source_hashr�r�rrr�_validate_hash_pycfs��r�cCsPt�|�}t|t�r8t�d|�|dk	r4t�||�|Std�	|�||d��dS)z#Compile bytecode as found in a pyc.zcode object from {!r}NzNon-code object in {!r}�r�r>)
�marshal�loads�
isinstance�
_code_typer�r��_imp�_fix_co_filenamer�rY)r'r�r�r��coderrr�_compile_bytecode~s


�r�cCsFtt�}|�td��|�t|��|�t|��|�t�|��|S)z+Produce the data for a timestamp-based pyc.r��	bytearrayr��extendr#r��dumps)r��mtimer�r'rrr�_code_to_timestamp_pyc�sr�TcCs@tt�}d|d>B}|�t|��|�|�|�t�|��|S)z&Produce the data for a hash-based pyc.r+r�)r�r��checkedr'rurrr�_code_to_hash_pyc�s
r�cCs>ddl}t�|�j}|�|�}t�dd�}|�|�|d��S)zyDecode bytes representing source code and return the string.

    Universal newline support is used in the decoding.
    rNT)�tokenizer_�BytesIO�readline�detect_encoding�IncrementalNewlineDecoder�decode)�source_bytesr��source_bytes_readline�encoding�newline_decoderrrr�
decode_source�s

r��r��submodule_search_locationsc	Cs|dkr<d}t|d�rFz|�|�}WqFtk
r8YqFXn
t�|�}tj|||d�}d|_|dkr�t�D]*\}}|�	t
|��rj|||�}||_q�qjdS|tkr�t|d�r�z|�
|�}Wntk
r�Yq�X|r�g|_n||_|jgk�r|�rt|�d}|j�|�|S)a=Return a module spec based on a file location.

    To indicate that the module is a package, set
    submodule_search_locations to a list of directory paths.  An
    empty list is sufficient, though its not otherwise useful to the
    import system.

    The loader must take a spec as its only __init__() arg.

    Nz	<unknown>�get_filename��originT�
is_packager)r�r�r�rrpr��
ModuleSpec�
_set_fileattr�_get_supported_file_loadersr7r�r��	_POPULATEr�r�rHr:)	r��locationr�r��spec�loader_class�suffixesr��dirnamerrr�spec_from_file_location�s>



r�c@sPeZdZdZdZdZdZedd��Zedd��Z	edd
d��Z
eddd
��Zd	S)�WindowsRegistryFinderz>Meta path finder for modules declared in the Windows registry.z;Software\Python\PythonCore\{sys_version}\Modules\{fullname}zASoftware\Python\PythonCore\{sys_version}\Modules\{fullname}\DebugFcCs8zt�tj|�WStk
r2t�tj|�YSXdSrB)�_winreg�OpenKey�HKEY_CURRENT_USERrK�HKEY_LOCAL_MACHINE)�clsrrrr�_open_registrysz$WindowsRegistryFinder._open_registryc	Csr|jr|j}n|j}|j|dtjdd�d�}z&|�|��}t�|d�}W5QRXWnt	k
rlYdSX|S)Nz%d.%drg)r��sys_versionr)
�DEBUG_BUILD�REGISTRY_KEY_DEBUG�REGISTRY_KEYrYr�version_inforr�
QueryValuerK)rr��registry_keyr�hkey�filepathrrr�_search_registrys�z&WindowsRegistryFinder._search_registryNcCsz|�|�}|dkrdSzt|�Wntk
r8YdSXt�D]4\}}|�t|��r@tj||||�|d�}|Sq@dS)Nr�)rrJrKr�r7r�r��spec_from_loader)rr�r>�targetrr�r�r�rrr�	find_specs
�zWindowsRegistryFinder.find_speccCs"|�||�}|dk	r|jSdSdS)zlFind module named in the registry.

        This method is deprecated.  Use exec_module() instead.

        N�rr��rr�r>r�rrr�find_module'sz!WindowsRegistryFinder.find_module)NN)N)r�r�r�r�r	rr�classmethodrrrrrrrrr��s��

r�c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�
_LoaderBasicszSBase class of common code needed by both SourceLoader and
    SourcelessFileLoader.cCs@t|�|��d}|�dd�d}|�d�d}|dko>|dkS)z�Concrete implementation of InspectLoader.is_package by checking if
        the path returned by get_filename has a filename of '__init__.py'.r+rjrrg�__init__)rHr�r�rq)r�r�r��
filename_base�	tail_namerrrr�:sz_LoaderBasics.is_packagecCsdS�z*Use default semantics for module creation.Nr�r�r�rrr�
create_moduleBsz_LoaderBasics.create_modulecCs8|�|j�}|dkr$td�|j���t�t||j�dS)zExecute the module.Nz4cannot load module {!r} when get_code() returns None)�get_coder�r�rYr��_call_with_frames_removed�execr�)r��moduler�rrr�exec_moduleEs�z_LoaderBasics.exec_modulecCst�||�S)zThis module is deprecated.)r��_load_module_shim�r�r�rrr�load_moduleMsz_LoaderBasics.load_moduleN)r�r�r�r�r�rr"r%rrrrr5s
rc@sJeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�d
d�Zdd�Z	dS)�SourceLoadercCst�dS)z�Optional method that returns the modification time (an int) for the
        specified path (a str).

        Raises OSError when the path cannot be handled.
        N)rK�r�r>rrr�
path_mtimeTszSourceLoader.path_mtimecCsd|�|�iS)a�Optional method returning a metadata dict for the specified
        path (a str).

        Possible keys:
        - 'mtime' (mandatory) is the numeric timestamp of last source
          code modification;
        - 'size' (optional) is the size in bytes of the source code.

        Implementing this method allows the loader to read bytecode files.
        Raises OSError when the path cannot be handled.
        r�)r(r'rrr�
path_stats\szSourceLoader.path_statscCs|�||�S)z�Optional method which writes data (bytes) to a file path (a str).

        Implementing this method allows for the writing of bytecode files.

        The source path is needed in order to correctly transfer permissions
        )�set_data)r�r��
cache_pathr'rrr�_cache_bytecodejszSourceLoader._cache_bytecodecCsdS)z�Optional method which writes data (bytes) to a file path (a str).

        Implementing this method allows for the writing of bytecode files.
        Nr)r�r>r'rrrr*tszSourceLoader.set_datac
CsR|�|�}z|�|�}Wn0tk
rH}ztd|d�|�W5d}~XYnXt|�S)z4Concrete implementation of InspectLoader.get_source.z'source not available through get_data()r�N)r��get_datarKr�r�)r�r�r>r��excrrr�
get_source{s
��zSourceLoader.get_sourcer�)�	_optimizecCstjt||dd|d�S)z�Return the code object compiled from source.

        The 'data' argument can be any object type that compile() supports.
        r T)�dont_inheritrv)r�r�compile)r�r'r>r0rrr�source_to_code�s�zSourceLoader.source_to_codec	Cs"|�|�}d}d}d}d}d}zt|�}Wntk
rDd}Y�n0Xz|�|�}	Wntk
rjY�n
Xt|	d�}z|�|�}
Wntk
r�Yn�X||d�}z�t|
||�}t|
�dd�}
|d@dk}|�r$|d	@dk}t	j
d
k�r8|s�t	j
dk�r8|�|�}t	�t|�}t
|
|||�nt|
||	d||�Wnttfk
�rTYn Xt�d
||�t|
|||d�S|dk�r�|�|�}|�||�}t�d|�tj�s|dk	�r|dk	�r|�r�|dk�r�t	�|�}t|||�}
nt||t|��}
z|�|||
�Wntk
�rYnX|S)z�Concrete implementation of InspectLoader.get_code.

        Reading of bytecode requires path_stats to be implemented. To write
        bytecode, set_data must also be implemented.

        NFTr�r�r�r+rrg�never�always�sizez
{} matches {})r�r�r�zcode object from {})r�r�rtr)rKr r-r��
memoryviewr��check_hash_based_pycsr��_RAW_MAGIC_NUMBERr�r�r�r�r�r�r�r3r�dont_write_bytecoder�r�r3r,)r�r�r�r�r�r��
hash_based�check_sourcer��str'r�ru�
bytes_data�code_objectrrrr�s�
���
�����

�

�zSourceLoader.get_codeN)
r�r�r�r(r)r,r*r/r3rrrrrr&Rs

r&cs|eZdZdZdd�Zdd�Zdd�Ze�fdd	��Zed
d��Z	dd
�Z
edd��Zdd�Zdd�Z
dd�Zdd�Z�ZS)�
FileLoaderzgBase file loader class which implements the loader protocol methods that
    require file system usage.cCs||_||_dS)zKCache the module name and the path to the file found by the
        finder.Nr�)r�r�r>rrrr�szFileLoader.__init__cCs|j|jko|j|jkSrB��	__class__r��r��otherrrr�__eq__�s
�zFileLoader.__eq__cCst|j�t|j�ASrB��hashr�r>�r�rrr�__hash__�szFileLoader.__hash__cstt|��|�S)zdLoad a module from a file.

        This method is deprecated.  Use exec_module() instead.

        )�superr@r%r$�rBrrr%�s
zFileLoader.load_modulecCs|jS�z:Return the path to the source file as found by the finder.rDr$rrrr�szFileLoader.get_filenamec
Csft|ttf�r:t�t|���}|��W5QR�SQRXn(t�|d��}|��W5QR�SQRXdS)z'Return the data from path as raw bytes.�rN)r�r&�ExtensionFileLoaderr_�	open_coderw�readr`)r�r>rerrrr-s
zFileLoader.get_datacCs|�|�r|SdSrB)r��r�r!rrr�get_resource_readers
zFileLoader.get_resource_readercCs tt|j�d|�}t�|d�S)NrrM)r@rHr>r_r`�r��resourcer>rrr�
open_resourceszFileLoader.open_resourcecCs&|�|�st�tt|j�d|�}|S�Nr)�is_resource�FileNotFoundErrorr@rHr>rSrrr�
resource_paths
zFileLoader.resource_pathcCs(t|krdStt|j�d|�}t|�S)NFr)r8r@rHr>rP�r�r�r>rrrrW szFileLoader.is_resourcecCstt�t|j�d��SrV)�iterr�listdirrHr>rHrrr�contents&szFileLoader.contents)r�r�r�r�rrErIr�r%r�r-rRrUrYrWr]�
__classcell__rrrKrr@�s

r@c@s.eZdZdZdd�Zdd�Zdd�dd	�Zd
S)�SourceFileLoaderz>Concrete implementation of SourceLoader using the file system.cCst|�}|j|jd�S)z!Return the metadata for the path.)r�r6)rJ�st_mtime�st_size)r�r>r=rrrr).szSourceFileLoader.path_statscCst|�}|j|||d�S)N��_mode)r�r*)r�r�r�r'rMrrrr,3sz SourceFileLoader._cache_bytecoderVrbc	Cs�t|�\}}g}|r4t|�s4t|�\}}|�|�qt|�D]l}t||�}zt�|�Wq<tk
rpYq<Yq<tk
r�}zt	�
d||�WY�dSd}~XYq<Xq<zt|||�t	�
d|�Wn0tk
r�}zt	�
d||�W5d}~XYnXdS)zWrite bytes data to a file.zcould not create {!r}: {!r}Nzcreated {!r})rHrRr:�reversedr@r�mkdir�FileExistsErrorrKr�r�rf)	r�r>r'rc�parentr�r<rAr.rrrr*8s0
��zSourceFileLoader.set_dataN)r�r�r�r�r)r,r*rrrrr_*sr_c@s eZdZdZdd�Zdd�ZdS)�SourcelessFileLoaderz-Loader which handles sourceless file imports.cCsD|�|�}|�|�}||d�}t|||�tt|�dd�||d�S)Nr�r�)r�r�)r�r-r�r�r7)r�r�r>r'r�rrrr[s

��zSourcelessFileLoader.get_codecCsdS)z'Return None as there is no source code.Nrr$rrrr/kszSourcelessFileLoader.get_sourceN)r�r�r�r�rr/rrrrrhWsrhc@s\eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zedd��Z
dS)rNz]Loader for extension modules.

    The constructor is designed to work with FileFinder.

    cCs@||_t|�s6ztt��|�}Wntk
r4YnX||_dSrB)r�rUr@rrQrKr>rZrrrr|szExtensionFileLoader.__init__cCs|j|jko|j|jkSrBrArCrrrrE�s
�zExtensionFileLoader.__eq__cCst|j�t|j�ASrBrFrHrrrrI�szExtensionFileLoader.__hash__cCs$t�tj|�}t�d|j|j�|S)z&Create an unitialized extension modulez&extension module {!r} loaded from {!r})r�rr��create_dynamicr�r�r>)r�r�r!rrrr�s��z!ExtensionFileLoader.create_modulecCs$t�tj|�t�d|j|j�dS)zInitialize an extension modulez(extension module {!r} executed from {!r}N)r�rr��exec_dynamicr�r�r>rQrrrr"�s
�zExtensionFileLoader.exec_modulecs$t|j�d�t�fdd�tD��S)z1Return True if the extension module is a package.r+c3s|]}�d|kVqdS)rNr�r	�suffix��	file_namerrrE�s�z1ExtensionFileLoader.is_package.<locals>.<genexpr>)rHr>�any�EXTENSION_SUFFIXESr$rrmrr��s�zExtensionFileLoader.is_packagecCsdS)z?Return None as an extension module cannot create a code object.Nrr$rrrr�szExtensionFileLoader.get_codecCsdS)z5Return None as extension modules have no source code.Nrr$rrrr/�szExtensionFileLoader.get_sourcecCs|jSrLrDr$rrrr��sz ExtensionFileLoader.get_filenameN)r�r�r�r�rrErIrr"r�rr/r�r�rrrrrNts	rNc@sheZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�_NamespacePatha&Represents a namespace package's path.  It uses the module name
    to find its parent module, and from there it looks up the parent's
    __path__.  When this changes, the module's own path is recomputed,
    using path_finder.  For top-level modules, the parent module's path
    is sys.path.cCs$||_||_t|���|_||_dSrB)�_name�_pathr��_get_parent_path�_last_parent_path�_path_finder�r�r�r>�path_finderrrrr�sz_NamespacePath.__init__cCs&|j�d�\}}}|dkrdS|dfS)z>Returns a tuple of (parent-module-name, parent-path-attr-name)rjr)rr>�__path__)rrrq)r�rg�dot�merrr�_find_parent_path_names�sz&_NamespacePath._find_parent_path_namescCs|��\}}ttj||�SrB)r|r�r�modules)r��parent_module_name�path_attr_namerrrrt�sz_NamespacePath._get_parent_pathcCsPt|���}||jkrJ|�|j|�}|dk	rD|jdkrD|jrD|j|_||_|jSrB)r�rtrurvrrr�r�rs)r��parent_pathr�rrr�_recalculate�s
z_NamespacePath._recalculatecCst|���SrB)r[r�rHrrr�__iter__�sz_NamespacePath.__iter__cCs|��|SrB�r�)r��indexrrr�__getitem__�sz_NamespacePath.__getitem__cCs||j|<dSrB)rs)r�r�r>rrr�__setitem__�sz_NamespacePath.__setitem__cCst|���SrB)r3r�rHrrr�__len__�sz_NamespacePath.__len__cCsd�|j�S)Nz_NamespacePath({!r}))rYrsrHrrr�__repr__�sz_NamespacePath.__repr__cCs||��kSrBr��r��itemrrr�__contains__�sz_NamespacePath.__contains__cCs|j�|�dSrB)rsr:r�rrrr:�sz_NamespacePath.appendN)r�r�r�r�rr|rtr�r�r�r�r�r�r�r:rrrrrq�s

rqc@sPeZdZdd�Zedd��Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�ZdS)�_NamespaceLoadercCst|||�|_dSrB)rqrsrwrrrr�sz_NamespaceLoader.__init__cCsd�|j�S)zsReturn repr for the module.

        The method is deprecated.  The import machinery does the job itself.

        z<module {!r} (namespace)>)rYr�)rr!rrr�module_repr�sz_NamespaceLoader.module_reprcCsdS)NTrr$rrrr��sz_NamespaceLoader.is_packagecCsdS)Nrrr$rrrr/�sz_NamespaceLoader.get_sourcecCstddddd�S)Nrz<string>r T)r1)r2r$rrrrsz_NamespaceLoader.get_codecCsdSrrrrrrrsz_NamespaceLoader.create_modulecCsdSrBrrQrrrr"sz_NamespaceLoader.exec_modulecCst�d|j�t�||�S)zbLoad a namespace module.

        This method is deprecated.  Use exec_module() instead.

        z&namespace module loaded with path {!r})r�r�rsr#r$rrrr%	s�z_NamespaceLoader.load_moduleN)r�r�r�rrr�r�r/rrr"r%rrrrr��s
r�c@sveZdZdZedd��Zedd��Zedd��Zedd	��Zeddd��Z	edd
d��Z
eddd��Zedd��Zd
S)�
PathFinderz>Meta path finder for sys.path and package __path__ attributes.cCs@ttj���D],\}}|dkr(tj|=qt|d�r|��qdS)z}Call the invalidate_caches() method on all path entry finders
        stored in sys.path_importer_caches (where implemented).N�invalidate_caches)�listr�path_importer_cache�itemsr�r�)rr��finderrrrr�s


zPathFinder.invalidate_cachesc	CsTtjdk	rtjst�dt�tjD],}z||�WStk
rLYq"Yq"Xq"dS)z.Search sys.path_hooks for a finder for 'path'.Nzsys.path_hooks is empty)r�
path_hooksrlrmr�r�)rr>�hookrrr�_path_hooks%s
zPathFinder._path_hookscCsh|dkr,zt��}Wntk
r*YdSXztj|}Wn(tk
rb|�|�}|tj|<YnX|S)z�Get the finder for the path entry from sys.path_importer_cache.

        If the path entry is not in the cache, find the appropriate finder
        and cache it. If no finder is available, store None.

        rN)rrQrXrr��KeyErrorr�)rr>r�rrr�_path_importer_cache2s
zPathFinder._path_importer_cachecCsRt|d�r|�|�\}}n|�|�}g}|dk	r<t�||�St�|d�}||_|S)Nr�)r�r�rr�rr�r�)rr�r�r�r�r�rrr�_legacy_get_specHs

zPathFinder._legacy_get_specNc	Cs�g}|D]�}t|ttf�sq|�|�}|dk	rt|d�rF|�||�}n|�||�}|dkr\q|jdk	rn|S|j}|dkr�t	d��|�
|�qt�|d�}||_|S)z?Find the loader or namespace_path for this module/package name.Nrzspec missing loader)
r�rw�bytesr�r�rr�r�r�r�r�r�r�)	rr�r>r�namespace_path�entryr�r�r�rrr�	_get_specWs(


zPathFinder._get_speccCsd|dkrtj}|�|||�}|dkr(dS|jdkr\|j}|rVd|_t|||j�|_|SdSn|SdS)z�Try to find a spec for 'fullname' on sys.path or 'path'.

        The search is based on sys.path_hooks and sys.path_importer_cache.
        N)rr>r�r�r�r�rq)rr�r>rr�r�rrrrws
zPathFinder.find_speccCs|�||�}|dkrdS|jS)z�find the module on sys.path or 'path' based on sys.path_hooks and
        sys.path_importer_cache.

        This method is deprecated.  Use find_spec() instead.

        Nrrrrrr�szPathFinder.find_modulecOsddlm}|j||�S)a 
        Find distributions.

        Return an iterable of all Distribution instances capable of
        loading the metadata for packages matching ``context.name``
        (or all names if ``None`` indicated) along the paths in the list
        of directories ``context.path``.
        r)�MetadataPathFinder)�importlib.metadatar��find_distributions)rr�r�r�rrrr��s
zPathFinder.find_distributions)N)NN)N)
r�r�r�r�rr�r�r�r�r�rrr�rrrrr�s"
	


r�c@sZeZdZdZdd�Zdd�ZeZdd�Zdd	�Z	ddd�Z
d
d�Zedd��Z
dd�Zd
S)�
FileFinderz�File-based finder.

    Interactions with the file system are cached for performance, being
    refreshed when the directory the finder is handling has been modified.

    cspg}|D] \�}|��fdd�|D��q||_|p6d|_t|j�sVtt��|j�|_d|_t�|_	t�|_
dS)z�Initialize with the path to search on and a variable number of
        2-tuples containing the loader and the file suffixes the loader
        recognizes.c3s|]}|�fVqdSrBrrk�r�rrrE�sz&FileFinder.__init__.<locals>.<genexpr>rjr�N)r��_loadersr>rUr@rrQ�_path_mtime�set�_path_cache�_relaxed_path_cache)r�r>�loader_details�loadersr�rr�rr�s

zFileFinder.__init__cCs
d|_dS)zInvalidate the directory mtime.r�N)r�rHrrrr��szFileFinder.invalidate_cachescCs*|�|�}|dkrdgfS|j|jp&gfS)z�Try to find a loader for the specified module, or the namespace
        package portions. Returns (loader, list-of-portions).

        This method is deprecated.  Use find_spec() instead.

        N)rr�r�)r�r�r�rrrr��s
zFileFinder.find_loadercCs|||�}t||||d�S)Nr�)r�)r�r�r�r>�smslrr�rrrr��s
�zFileFinder._get_specNc	Cs�d}|�d�d}zt|jp"t���j}Wntk
rBd}YnX||jkr\|��||_t	�rr|j
}|��}n
|j}|}||kr�t
|j|�}|jD]:\}	}
d|	}t
||�}t|�r�|�|
|||g|�Sq�t|�}|jD]r\}	}
zt
|j||	�}Wntk
�rYdSXtjd|dd�||	|kr�t|�r�|�|
||d|�Sq�|�r~t�d	|�t�|d�}
|g|
_|
SdS)
zoTry to find a spec for the specified module.

        Returns the matching spec, or None if not found.
        Frjrgr�rNz	trying {})�	verbosityzpossible namespace for {})rqrJr>rrQr`rKr��_fill_cacherr�r�r�r@r�rPr�rRryr�r�r�r�)r�r�r�is_namespace�tail_moduler��cache�cache_module�	base_pathrlr��
init_filename�	full_pathr�rrrr�sP





�
zFileFinder.find_specc	
Cs�|j}zt�|pt���}Wntttfk
r:g}YnXtj�	d�sTt
|�|_nJt
�}|D]8}|�d�\}}}|r�d�
||���}n|}|�|�q^||_tj�	t�r�dd�|D�|_dS)zDFill the cache of potential modules and packages for this directory.r
rjrWcSsh|]}|���qSr)r�)r	�fnrrrr*sz)FileFinder._fill_cache.<locals>.<setcomp>N)r>rr\rQrX�PermissionError�NotADirectoryErrorrrrr�r�r�rYr��addrr�)	r�r>r]�lower_suffix_contentsr�r�rzrl�new_namerrrr�
s"
zFileFinder._fill_cachecs��fdd�}|S)aA class method which returns a closure to use on sys.path_hook
        which will return an instance using the specified loaders and the path
        called on the closure.

        If the path called on the closure is not a directory, ImportError is
        raised.

        cs"t|�std|d���|f���S)z-Path hook for importlib.machinery.FileFinder.zonly directories are supportedrD)rRr�rD�rr�rr�path_hook_for_FileFinder6sz6FileFinder.path_hook.<locals>.path_hook_for_FileFinderr)rr�r�rr�r�	path_hook,s
zFileFinder.path_hookcCsd�|j�S)NzFileFinder({!r}))rYr>rHrrrr�>szFileFinder.__repr__)N)r�r�r�r�rr�r�rr�r�rr�rr�r�rrrrr��s
3
r�cCs�|�d�}|�d�}|sB|r$|j}n||kr8t||�}n
t||�}|sTt|||d�}z$||d<||d<||d<||d<Wntk
r�YnXdS)N�
__loader__�__spec__r��__file__�
__cached__)�getr�rhr_r��	Exception)�nsr��pathname�	cpathnamer�r�rrr�_fix_up_moduleDs"


r�cCs*ttt���f}ttf}ttf}|||gS)z_Returns a list of file-based module loaders.

    Each item is a tuple (loader, suffixes).
    )rN�_alternative_architecturesr��extension_suffixesr_r�rhr{)�
extensions�source�bytecoderrrr�[sr�c	Cs�|atjatjatjt}dD]0}|tjkr8t�|�}n
tj|}t|||�qddgfdddgff}|D]X\}}|d}|tjkr�tj|}q�qjzt�|�}Wq�Wqjtk
r�YqjYqjXqjtd��t|d|�t|d	|�t|d
d�|��t|dd
d�|D��t�d�}	t|d|	�t�d�}
t|d|
�|dk�rXt�d�}t|d|�t|dt	��t
�tt�
���|dk�r�t�d�dt
k�r�dt_dS)z�Setup the path-based importers for importlib by importing needed
    built-in modules and injecting them into the global namespace.

    Other components are extracted from the core bootstrap module.

    )r_rl�builtinsr��posixr�ntrrzimportlib requires posix or ntrr8r.r�_pathseps_with_coloncSsh|]}d|���qSrrrrrrr�sz_setup.<locals>.<setcomp>�_thread�_weakref�winregrrz.pywz_d.pydTN)r�rr�r}r��_builtin_from_namer�r�r;rrpr�r�r�r�r:r�r)�_bootstrap_module�self_module�builtin_name�builtin_module�
os_details�
builtin_osr.r8�	os_module�
thread_module�weakref_module�
winreg_modulerrr�_setupfsL













r�cCs2t|�t�}tj�tj|�g�tj�t	�dS)z)Install the path-based import components.N)
r�r�rr�r�r�r��	meta_pathr:r�)r��supported_loadersrrr�_install�sr��-arm-linux-gnueabihf.�-armeb-linux-gnueabihf.�-mips64-linux-gnuabi64.�-mips64el-linux-gnuabi64.�-powerpc-linux-gnu.�-powerpc-linux-gnuspe.�-powerpc64-linux-gnu.�-powerpc64le-linux-gnu.�-arm-linux-gnueabi.�-armeb-linux-gnueabi.�-mips64-linux-gnu.�-mips64el-linux-gnu.�-ppc-linux-gnu.�-ppc-linux-gnuspe.�-ppc64-linux-gnu.�-ppc64le-linux-gnu.)r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�cCsF|D]<}t��D].\}}||kr|�|�||��|Sqq|S)z�Add a suffix with an alternative architecture name
    to the list of suffixes so an extension built with
    the default (upstream) setting is loadable with our Pythons
    )�	_ARCH_MAPr�r:rT)r�rl�original�alternativerrrr��sr�)rV)N)NNN)rr)T)N)N)Rr�r�r_rrlr�r�_MS_WINDOWSr�rr�r�r.r8r�r6r;r�r�%_CASE_INSENSITIVE_PLATFORMS_BYTES_KEYrrr#r(r)r@rHrJrOrPrRrUrf�type�__code__r�r!r�r r%r9r~rzr�r{�DEBUG_BYTECODE_SUFFIXES�OPTIMIZED_BYTECODE_SUFFIXESr�r�r�r�r�r�r�r�r�r�r�r�r�r��objectr�r�r�rr&r@r_rhrprNrqr�r�r�r�r�r�r�r�r�rrrr�<module>s�



�

	



G(!



�D@H-:?*
A	�importlib/__pycache__/util.cpython-38.opt-2.pyc000064400000014431151153537630015336 0ustar00U

e5d7,�@s(ddlmZddlmZddlmZddlmZddlmZddlmZddlm	Z	ddlm
Z
dd	lmZdd
lmZddlm
Z
dd
lmZddlZddlZddlZddlZddlZdd�Zdd�Zd#dd�Zd$dd�Zedd��Zdd�Zdd�Zdd�ZGdd �d ej�ZGd!d"�d"ej�Z dS)%�)�abc)�module_from_spec)�
_resolve_name)�spec_from_loader)�
_find_spec)�MAGIC_NUMBER)�_RAW_MAGIC_NUMBER)�cache_from_source)�
decode_source)�source_from_cache)�spec_from_file_location�)�contextmanagerNcCst�t|�S�N)�_imp�source_hashr)�source_bytes�r�&/usr/lib64/python3.8/importlib/util.pyrsrcCs\|�d�s|S|s&tdt|��d���d}|D]}|dkr>qH|d7}q.t||d�||�S)N�.zno package specified for z% (required for relative module names)r
r)�
startswith�
ValueError�reprr)�name�package�level�	characterrrr�resolve_names

rcCsx|tjkrt||�Stj|}|dkr*dSz
|j}Wn$tk
rXtd�|��d�YnX|dkrptd�|���|SdS)N�{}.__spec__ is not set�{}.__spec__ is None)�sys�modulesr�__spec__�AttributeErrorr�format)r�path�module�specrrr�_find_spec_from_path*s



r(c	
Cs�|�d�rt||�n|}|tjkr�|�d�d}|r�t|dgd�}z
|j}Wq�tk
r�}ztd|�d|��|d�|�W5d}~XYq�Xnd}t	||�Stj|}|dkr�dSz
|j
}Wn$tk
r�td�|��d�YnX|dkr�td	�|���|SdS)
Nrr
�__path__)�fromlistz __path__ attribute not found on z while trying to find )rrr)
rrr r!�
rpartition�
__import__r)r#�ModuleNotFoundErrorrr"rr$)	rr�fullname�parent_name�parent�parent_path�er&r'rrr�	find_specIs4

��


r3ccs�|tjk}tj�|�}|s6tt�|�}d|_|tj|<zJz
|VWn:tk
r||sxztj|=Wntk
rvYnXYnXW5d|_XdS)NTF)r r!�get�type�__initializing__�	Exception�KeyError)r�	is_reloadr&rrr�_module_to_loadvs


r:cst����fdd��}|S)NcsRtjdtdd��||�}t|dd�dkrN|j|_t|d�sN|j�d�d|_|S)N�7The import system now takes care of this automatically.���
stacklevel�__package__r)rr
)�warnings�warn�DeprecationWarning�getattr�__name__r?�hasattrr+)�args�kwargsr&��fxnrr�set_package_wrapper�s�

z(set_package.<locals>.set_package_wrapper��	functools�wraps)rIrJrrHr�set_package�s	rNcst����fdd��}|S)Ncs:tjdtdd��|f|�|�}t|dd�dkr6||_|S)Nr;r<r=�
__loader__)r@rArBrCrO)�selfrFrGr&rHrr�set_loader_wrapper�s�z&set_loader.<locals>.set_loader_wrapperrK)rIrQrrHr�
set_loader�srRcs*tjdtdd�t����fdd��}|S)Nr;r<r=c
s|t|��j}||_z|�|�}Wnttfk
r6YnX|rD||_n|�d�d|_�||f|�|�W5QR�SQRXdS)Nrr
)r:rO�
is_package�ImportErrorr#r?r+)rPr.rFrGr&rSrHrr�module_for_loader_wrapper�s
z4module_for_loader.<locals>.module_for_loader_wrapper)r@rArBrLrM)rIrUrrHr�module_for_loader�s�rVc@seZdZdd�Zdd�ZdS)�_LazyModulec	Cs�tj|_|jj}|jjd}|jjd}|j}i}|��D]:\}}||krT|||<q:t||�t||�kr:|||<q:|jj	�
|�|tjkr�t|�ttj|�kr�t
d|�d���|j�|�t||�S)N�__dict__�	__class__zmodule object for z. substituted in sys.modules during a lazy load)�types�
ModuleTyperYr"r�loader_staterX�items�id�loader�exec_moduler r!r�updaterC)	rP�attr�
original_name�
attrs_then�
original_type�	attrs_now�
attrs_updated�key�valuerrr�__getattribute__�s"


z_LazyModule.__getattribute__cCs|�|�t||�dSr)rj�delattr)rPrbrrr�__delattr__s
z_LazyModule.__delattr__N)rD�
__module__�__qualname__rjrlrrrrrW�s#rWc@s<eZdZedd��Zedd��Zdd�Zdd�Zd	d
�Z	dS)�
LazyLoadercCst|d�std��dS)Nr`z loader must define exec_module())rE�	TypeError)r_rrr�__check_eager_loaders
zLazyLoader.__check_eager_loadercs������fdd�S)Ncs��||��Srr)rFrG��clsr_rr�<lambda>�z$LazyLoader.factory.<locals>.<lambda>)�_LazyLoader__check_eager_loaderrrrrrr�factorys
zLazyLoader.factorycCs|�|�||_dSr)rvr_)rPr_rrr�__init__s
zLazyLoader.__init__cCs|j�|�Sr)r_�
create_module)rPr'rrrryszLazyLoader.create_modulecCs@|j|j_|j|_i}|j��|d<|j|d<||j_t|_dS)NrXrY)r_r"rOrX�copyrYr\rW)rPr&r\rrrr` s

zLazyLoader.exec_moduleN)
rDrmrn�staticmethodrv�classmethodrwrxryr`rrrrro
s

ro)N)N)!�r�
_bootstraprrrr�_bootstrap_externalrrr	r
rr�
contextlibrrrLr rZr@rrr(r3r:rNrRrVr[rW�Loaderrorrrr�<module>s6

-
'/importlib/__pycache__/_bootstrap_external.cpython-38.pyc000064400000132103151153537630017474 0ustar00U

&�.e��@sdZddladdlZddladdlZddlZtjdkZerLddlZ	ddl
Z
nddlZ	erbddgZndgZe
dd�eD��s~t�edZee�Zd�e�Zd	d
�eD�ZdZdZeeZd
d�Zdd�Zdd�Zdd�Zer�dd�Zndd�Zdd�Zdd�Zdd�Zdd�Zd d!�Z e�r$d"d#�Z!nd$d#�Z!d�d&d'�Z"e#e"j$�Z%d(�&d)d*�d+Z'e(�)e'd*�Z*d,Z+d-Z,d.gZ-d/gZ.e.Z/Z0d�dd0�d1d2�Z1d3d4�Z2d5d6�Z3d7d8�Z4d9d:�Z5d;d<�Z6d=d>�Z7d?d@�Z8dAdB�Z9dCdD�Z:d�dEdF�Z;d�dGdH�Z<d�dJdK�Z=dLdM�Z>e?�Z@d�de@dN�dOdP�ZAGdQdR�dR�ZBGdSdT�dT�ZCGdUdV�dVeC�ZDGdWdX�dX�ZEGdYdZ�dZeEeD�ZFGd[d\�d\eEeC�ZGgZHGd]d^�d^eEeC�ZIGd_d`�d`�ZJGdadb�db�ZKGdcdd�dd�ZLGdedf�df�ZMd�dgdh�ZNdidj�ZOdkdl�ZPdmdn�ZQdodpdqdrdsdtdudvdwdxdydzd{d|d}d~d�ZRd�d��ZSdS)�a^Core implementation of path-based import.

This module is NOT meant to be directly imported! It has been designed such
that it can be bootstrapped into Python as the implementation of import. As
such it requires the injection of specific modules and attributes in order to
work. One should use importlib as the public-facing version of this module.

�NZwin32�\�/ccs|]}t|�dkVqdS��N��len��.0�sep�r�5/usr/lib64/python3.8/importlib/_bootstrap_external.py�	<genexpr>+sr
�cCsh|]}d|���qS��:r�r	�srrr�	<setcomp>/sr)�win)�cygwin�darwincs<tj�t�r0tj�t�rd�nd��fdd�}ndd�}|S)N�PYTHONCASEOKsPYTHONCASEOKcs
�tjkS)�5True if filenames must be checked case-insensitively.)�_os�environr��keyrr�_relax_case@sz%_make_relax_case.<locals>._relax_casecSsdS)rFrrrrrrDs)�sys�platform�
startswith�_CASE_INSENSITIVE_PLATFORMS�#_CASE_INSENSITIVE_PLATFORMS_STR_KEY)rrrr�_make_relax_case9sr#cCst|�d@�dd�S)z*Convert a 32-bit integer to little-endian.�����little)�int�to_bytes)�xrrr�_pack_uint32Jsr*cCst|�dkst�t�|d�S)z/Convert 4 bytes in little-endian to an integer.r%r&�r�AssertionErrorr'�
from_bytes��datarrr�_unpack_uint32Osr0cCst|�dkst�t�|d�S)z/Convert 2 bytes in little-endian to an integer.�r&r+r.rrr�_unpack_uint16Tsr2cGs�|sdSt|�dkr|dSd}g}ttj|�D]z\}}|�t�sL|�t�rf|�t�pX|}t	|g}q0|�d�r�|�
�|�
�kr�|}|g}q�|�|�q0|p�|}|�|�q0dd�|D�}t|�dkr�|ds�|t	S|t	�|�S)�Replacement for os.path.join().rrrrcSsg|]}|r|�t��qSr��rstrip�path_separators�r	�prrr�
<listcomp>rs�_path_join.<locals>.<listcomp>)
r�mapr�_path_splitrootr �path_sep_tuple�endswithr5r6�path_sep�casefold�append�join)�
path_parts�root�pathZnew_root�tailrrr�
_path_join[s*
rGcGst�dd�|D��S)r3cSsg|]}|r|�t��qSrr4)r	�partrrrr9{s�r:)r?rB)rCrrrrGys
�csBt�fdd�tD��}|dkr&d�fS�d|��|dd�fS)z Replacement for os.path.split().c3s|]}��|�VqdS�N)�rfindr7�rErrr
�sz_path_split.<locals>.<genexpr>rrNr)�maxr6)rE�irrKr�_path_splitsrNcCs
t�|�S)z~Stat the path.

    Made a separate function to make it easier to override in experiments
    (e.g. cache stat results).

    )r�statrKrrr�
_path_stat�srPcCs2zt|�}Wntk
r"YdSX|jd@|kS)z1Test whether the path is the specified mode type.Fi�)rP�OSError�st_mode)rE�mode�	stat_inforrr�_path_is_mode_type�s
rUcCs
t|d�S)zReplacement for os.path.isfile.i�)rUrKrrr�_path_isfile�srVcCs|st��}t|d�S)zReplacement for os.path.isdir.i@)r�getcwdrUrKrrr�_path_isdir�srXcCs>|sdSt�|�d�dd�}t|�dko<|�d�p<|�d�S)�Replacement for os.path.isabs.Frrrrz\\)rr<�replacerr r>)rErDrrr�_path_isabs�sr[cCs
|�t�S)rY)r r6rKrrrr[�s�cCs�d�|t|��}t�|tjtjBtjB|d@�}z2t�|d��}|�	|�W5QRXt�
||�Wn:tk
r�zt�|�Wntk
r�YnX�YnXdS)z�Best-effort function to write data to a path atomically.
    Be prepared to handle a FileExistsError if concurrent writing of the
    temporary file is attempted.�{}.{}r\�wbN)
�format�idr�open�O_EXCL�O_CREAT�O_WRONLY�_io�FileIO�writerZrQ�unlink)rEr/rS�path_tmp�fd�filerrr�
_write_atomic�s�rliU
r1r&s
�__pycache__zopt-z.pyz.pyc)�optimizationcCsX|dk	r4t�dt�|dk	r(d}t|��|r0dnd}t�|�}t|�\}}|�d�\}}}tj	j
}	|	dkrrtd��d�|r~|n|||	g�}
|dkr�tj
jdkr�d}ntj
j}t|�}|dkr�|��s�td	�|���d
�|
t|�}
|
td}tjdk	�rLt|��stt��|�}|ddk�r8|dtk�r8|dd�}ttj|�t�|�St|t|�S)
a�Given the path to a .py file, return the path to its .pyc file.

    The .py file does not need to exist; this simply returns the path to the
    .pyc file calculated as if the .py file were imported.

    The 'optimization' parameter controls the presumed optimization level of
    the bytecode file. If 'optimization' is not None, the string representation
    of the argument is taken and verified to be alphanumeric (else ValueError
    is raised).

    The debug_override parameter is deprecated. If debug_override is not None,
    a True value is the same as setting 'optimization' to the empty string
    while a False value is equivalent to setting 'optimization' to '1'.

    If sys.implementation.cache_tag is None then NotImplementedError is raised.

    NzFthe debug_override parameter is deprecated; use 'optimization' insteadz2debug_override or optimization must be set to Nonerr�.�$sys.implementation.cache_tag is Nonerz{!r} is not alphanumericz{}.{}{}rr1)�	_warnings�warn�DeprecationWarning�	TypeErrorr�fspathrN�
rpartitionr�implementation�	cache_tag�NotImplementedErrorrB�flags�optimize�str�isalnum�
ValueErrorr_�_OPT�BYTECODE_SUFFIXES�pycache_prefixr[rGrWr6�lstrip�_PYCACHE)rE�debug_overridern�message�headrF�baser
�rest�tag�almost_filename�filenamerrr�cache_from_sourcebsH�
	
�r�c
Cs.tjjdkrtd��t�|�}t|�\}}d}tjdk	rftj�t	�}|�
|t�rf|t|�d�}d}|s�t|�\}}|t
kr�tt
�d|����|�d�}|dkr�td|����n\|d	k�r|�dd
�d}|�
t�s�tdt����|tt�d�}|���std
|�d���|�d�d}	t||	td�S)anGiven the path to a .pyc. file, return the path to its .py file.

    The .pyc file does not need to exist; this simply returns the path to
    the .py file calculated to correspond to the .pyc file.  If path does
    not conform to PEP 3147/488 format, ValueError will be raised. If
    sys.implementation.cache_tag is None then NotImplementedError is raised.

    NrpFTz not bottom-level directory in ro>r1�zexpected only 2 or 3 dots in r�r1���z5optimization portion of filename does not start with zoptimization level z is not an alphanumeric valuer)rrwrxryrrurNr�r5r6r r?rr�r~�count�rsplitrr}�	partitionrG�SOURCE_SUFFIXES)
rEr��pycache_filename�found_in_pycache_prefix�
stripped_path�pycache�	dot_countrn�	opt_level�
base_filenamerrr�source_from_cache�s4	





r�c	Cs~t|�dkrdS|�d�\}}}|r8|��dd�dkr<|Szt|�}Wn$ttfk
rl|dd�}YnXt|�rz|S|S)z�Convert a bytecode file path to a source path (if possible).

    This function exists purely for backwards-compatibility for
    PyImport_ExecCodeModuleWithFilenames() in the C API.

    rNro�������py)rrv�lowerr�ryr~rV)�
bytecode_pathr��_�	extension�source_pathrrr�_get_sourcefile�sr�cCsJ|�tt��r0z
t|�WStk
r,YqFXn|�tt��rB|SdSdSrI)r>�tupler�r�ryr�)r�rrr�_get_cached�s
r�cCs4zt|�j}Wntk
r&d}YnX|dO}|S)z3Calculate the mode permissions for a bytecode file.r\�)rPrRrQ)rErSrrr�
_calc_mode�s
r�csDd�fdd�	}z
tj}Wntk
r4dd�}YnX||��|S)z�Decorator to verify that the module being requested matches the one the
    loader can handle.

    The first argument (self) must define _name which the second argument is
    compared against. If the comparison fails then ImportError is raised.

    NcsB|dkr|j}n |j|kr0td|j|f|d���||f|�|�S)Nzloader for %s cannot handle %s��name)r��ImportError)�selfr��args�kwargs��methodrr�_check_name_wrappers
��z(_check_name.<locals>._check_name_wrappercSs8dD] }t||�rt||t||��q|j�|j�dS)N)�
__module__�__name__�__qualname__�__doc__)�hasattr�setattr�getattr�__dict__�update)�new�oldrZrrr�_wraps
z_check_name.<locals>._wrap)N)�
_bootstrapr��	NameError)r�r�r�rr�r�_check_name�s

r�cCs<|�|�\}}|dkr8t|�r8d}t�|�|d�t�|S)z�Try to find a loader for the specified module by delegating to
    self.find_loader().

    This method is deprecated in favor of finder.find_spec().

    Nz,Not importing directory {}: missing __init__r)�find_loaderrrqrrr_�
ImportWarning)r��fullname�loader�portions�msgrrr�_find_module_shims

r�cCs�|dd�}|tkr<d|�d|��}t�d|�t|f|��t|�dkrfd|��}t�d|�t|��t|dd��}|d	@r�d
|�d|��}t|f|��|S)aTPerform basic validity checking of a pyc header and return the flags field,
    which determines how the pyc should be further validated against the source.

    *data* is the contents of the pyc file. (Only the first 16 bytes are
    required, though.)

    *name* is the name of the module being imported. It is used for logging.

    *exc_details* is a dictionary passed to ImportError if it raised for
    improved debugging.

    ImportError is raised when the magic number is incorrect or when the flags
    field is invalid. EOFError is raised when the data is found to be truncated.

    Nr%zbad magic number in z: �{}�z(reached EOF while reading pyc header of ����zinvalid flags z in )�MAGIC_NUMBERr��_verbose_messager�r�EOFErrorr0)r/r��exc_details�magicr�rzrrr�
_classify_pyc)s
r�cCspt|dd��|d@kr:d|��}t�d|�t|f|��|dk	rlt|dd��|d@krltd|��f|��dS)aValidate a pyc against the source last-modified time.

    *data* is the contents of the pyc file. (Only the first 16 bytes are
    required.)

    *source_mtime* is the last modified timestamp of the source file.

    *source_size* is None or the size of the source file in bytes.

    *name* is the name of the module being imported. It is used for logging.

    *exc_details* is a dictionary passed to ImportError if it raised for
    improved debugging.

    An ImportError is raised if the bytecode is stale.

    r��r$zbytecode is stale for r�Nr�)r0r�r�r�)r/�source_mtime�source_sizer�r�r�rrr�_validate_timestamp_pycJs
�r�cCs&|dd�|kr"td|��f|��dS)a�Validate a hash-based pyc by checking the real source hash against the one in
    the pyc header.

    *data* is the contents of the pyc file. (Only the first 16 bytes are
    required.)

    *source_hash* is the importlib.util.source_hash() of the source file.

    *name* is the name of the module being imported. It is used for logging.

    *exc_details* is a dictionary passed to ImportError if it raised for
    improved debugging.

    An ImportError is raised if the bytecode is stale.

    r�r�z.hash in bytecode doesn't match hash of source N)r�)r/�source_hashr�r�rrr�_validate_hash_pycfs��r�cCsPt�|�}t|t�r8t�d|�|dk	r4t�||�|Std�	|�||d��dS)z#Compile bytecode as found in a pyc.zcode object from {!r}NzNon-code object in {!r}�r�rE)
�marshal�loads�
isinstance�
_code_typer�r��_imp�_fix_co_filenamer�r_)r/r�r�r��coderrr�_compile_bytecode~s


�r�cCsFtt�}|�td��|�t|��|�t|��|�t�|��|S)z+Produce the data for a timestamp-based pyc.r)�	bytearrayr��extendr*r��dumps)r��mtimer�r/rrr�_code_to_timestamp_pyc�sr�TcCsPtt�}d|d>B}|�t|��t|�dks2t�|�|�|�t�|��|S)z&Produce the data for a hash-based pyc.rr�)r�r�r�r*rr,r�r�)r�r��checkedr/rzrrr�_code_to_hash_pyc�s
r�cCs>ddl}t�|�j}|�|�}t�dd�}|�|�|d��S)zyDecode bytes representing source code and return the string.

    Universal newline support is used in the decoding.
    rNT)�tokenizere�BytesIO�readline�detect_encoding�IncrementalNewlineDecoder�decode)�source_bytesr��source_bytes_readline�encoding�newline_decoderrrr�
decode_source�s

r��r��submodule_search_locationsc	Cs|dkr<d}t|d�rFz|�|�}WqFtk
r8YqFXn
t�|�}tj|||d�}d|_|dkr�t�D]*\}}|�	t
|��rj|||�}||_q�qjdS|tkr�t|d�r�z|�
|�}Wntk
r�Yq�X|r�g|_n||_|jgk�r|�rt|�d}|j�|�|S)a=Return a module spec based on a file location.

    To indicate that the module is a package, set
    submodule_search_locations to a list of directory paths.  An
    empty list is sufficient, though its not otherwise useful to the
    import system.

    The loader must take a spec as its only __init__() arg.

    Nz	<unknown>�get_filename��originT�
is_packager)r�r�r�rrur��
ModuleSpec�
_set_fileattr�_get_supported_file_loadersr>r�r��	_POPULATEr�r�rNrA)	r��locationr�r��spec�loader_class�suffixesr��dirnamerrr�spec_from_file_location�s>



rc@sPeZdZdZdZdZdZedd��Zedd��Z	edd
d��Z
eddd
��Zd	S)�WindowsRegistryFinderz>Meta path finder for modules declared in the Windows registry.z;Software\Python\PythonCore\{sys_version}\Modules\{fullname}zASoftware\Python\PythonCore\{sys_version}\Modules\{fullname}\DebugFcCs8zt�tj|�WStk
r2t�tj|�YSXdSrI)�_winreg�OpenKey�HKEY_CURRENT_USERrQ�HKEY_LOCAL_MACHINE)�clsrrrr�_open_registrysz$WindowsRegistryFinder._open_registryc	Csr|jr|j}n|j}|j|dtjdd�d�}z&|�|��}t�|d�}W5QRXWnt	k
rlYdSX|S)Nz%d.%dr1)r��sys_versionr)
�DEBUG_BUILD�REGISTRY_KEY_DEBUG�REGISTRY_KEYr_r�version_inforr�
QueryValuerQ)rr��registry_keyr�hkey�filepathrrr�_search_registrys�z&WindowsRegistryFinder._search_registryNcCsz|�|�}|dkrdSzt|�Wntk
r8YdSXt�D]4\}}|�t|��r@tj||||�|d�}|Sq@dS)Nr�)rrPrQr�r>r�r��spec_from_loader)rr�rE�targetrr�r�r�rrr�	find_specs
�zWindowsRegistryFinder.find_speccCs"|�||�}|dk	r|jSdSdS)zlFind module named in the registry.

        This method is deprecated.  Use exec_module() instead.

        N�rr��rr�rEr�rrr�find_module'sz!WindowsRegistryFinder.find_module)NN)N)r�r�r�r�rrr
�classmethodrrrrrrrrr�s��

rc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�
_LoaderBasicszSBase class of common code needed by both SourceLoader and
    SourcelessFileLoader.cCs@t|�|��d}|�dd�d}|�d�d}|dko>|dkS)z�Concrete implementation of InspectLoader.is_package by checking if
        the path returned by get_filename has a filename of '__init__.py'.rrorr1�__init__)rNr�r�rv)r�r�r��
filename_base�	tail_namerrrr�:sz_LoaderBasics.is_packagecCsdS�z*Use default semantics for module creation.Nr�r�r�rrr�
create_moduleBsz_LoaderBasics.create_modulecCs8|�|j�}|dkr$td�|j���t�t||j�dS)zExecute the module.Nz4cannot load module {!r} when get_code() returns None)�get_coder�r�r_r��_call_with_frames_removed�execr�)r��moduler�rrr�exec_moduleEs�z_LoaderBasics.exec_modulecCst�||�S)zThis module is deprecated.)r��_load_module_shim�r�r�rrr�load_moduleMsz_LoaderBasics.load_moduleN)r�r�r�r�r�r r%r(rrrrr5s
rc@sJeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�d
d�Zdd�Z	dS)�SourceLoadercCst�dS)z�Optional method that returns the modification time (an int) for the
        specified path (a str).

        Raises OSError when the path cannot be handled.
        N)rQ�r�rErrr�
path_mtimeTszSourceLoader.path_mtimecCsd|�|�iS)a�Optional method returning a metadata dict for the specified
        path (a str).

        Possible keys:
        - 'mtime' (mandatory) is the numeric timestamp of last source
          code modification;
        - 'size' (optional) is the size in bytes of the source code.

        Implementing this method allows the loader to read bytecode files.
        Raises OSError when the path cannot be handled.
        r�)r+r*rrr�
path_stats\szSourceLoader.path_statscCs|�||�S)z�Optional method which writes data (bytes) to a file path (a str).

        Implementing this method allows for the writing of bytecode files.

        The source path is needed in order to correctly transfer permissions
        )�set_data)r�r��
cache_pathr/rrr�_cache_bytecodejszSourceLoader._cache_bytecodecCsdS)z�Optional method which writes data (bytes) to a file path (a str).

        Implementing this method allows for the writing of bytecode files.
        Nr)r�rEr/rrrr-tszSourceLoader.set_datac
CsR|�|�}z|�|�}Wn0tk
rH}ztd|d�|�W5d}~XYnXt|�S)z4Concrete implementation of InspectLoader.get_source.z'source not available through get_data()r�N)r��get_datarQr�r�)r�r�rEr��excrrr�
get_source{s
��zSourceLoader.get_sourcer�)�	_optimizecCstjt||dd|d�S)z�Return the code object compiled from source.

        The 'data' argument can be any object type that compile() supports.
        r#T)�dont_inheritr{)r�r"�compile)r�r/rEr3rrr�source_to_code�s�zSourceLoader.source_to_codec	Cs"|�|�}d}d}d}d}d}zt|�}Wntk
rDd}Y�n0Xz|�|�}	Wntk
rjY�n
Xt|	d�}z|�|�}
Wntk
r�Yn�X||d�}z�t|
||�}t|
�dd�}
|d@dk}|�r$|d	@dk}t	j
d
k�r8|s�t	j
dk�r8|�|�}t	�t|�}t
|
|||�nt|
||	d||�Wnttfk
�rTYn Xt�d
||�t|
|||d�S|dk�r�|�|�}|�||�}t�d|�tj�s|dk	�r|dk	�r|�r�|dk�r�t	�|�}t|||�}
nt||t|��}
z|�|||
�Wntk
�rYnX|S)z�Concrete implementation of InspectLoader.get_code.

        Reading of bytecode requires path_stats to be implemented. To write
        bytecode, set_data must also be implemented.

        NFTr�r�r�rrr1�never�always�sizez
{} matches {})r�r�r�zcode object from {})r�r�ryr,rQr'r0r��
memoryviewr��check_hash_based_pycsr��_RAW_MAGIC_NUMBERr�r�r�r�r�r�r�r6r�dont_write_bytecoder�r�rr/)r�r�r�r�r�r��
hash_based�check_sourcer��str/r�rz�
bytes_data�code_objectrrrr!�s�
���
�����

�

�zSourceLoader.get_codeN)
r�r�r�r+r,r/r-r2r6r!rrrrr)Rs

r)cs|eZdZdZdd�Zdd�Zdd�Ze�fdd	��Zed
d��Z	dd
�Z
edd��Zdd�Zdd�Z
dd�Zdd�Z�ZS)�
FileLoaderzgBase file loader class which implements the loader protocol methods that
    require file system usage.cCs||_||_dS)zKCache the module name and the path to the file found by the
        finder.Nr�)r�r�rErrrr�szFileLoader.__init__cCs|j|jko|j|jkSrI��	__class__r��r��otherrrr�__eq__�s
�zFileLoader.__eq__cCst|j�t|j�ASrI��hashr�rE�r�rrr�__hash__�szFileLoader.__hash__cstt|��|�S)zdLoad a module from a file.

        This method is deprecated.  Use exec_module() instead.

        )�superrCr(r'�rErrr(�s
zFileLoader.load_modulecCs|jS�z:Return the path to the source file as found by the finder.rKr'rrrr�szFileLoader.get_filenamec
Csft|ttf�r:t�t|���}|��W5QR�SQRXn(t�|d��}|��W5QR�SQRXdS)z'Return the data from path as raw bytes.�rN)r�r)�ExtensionFileLoaderre�	open_coder|�readrf)r�rErkrrrr0s
zFileLoader.get_datacCs|�|�r|SdSrI)r��r�r$rrr�get_resource_readers
zFileLoader.get_resource_readercCs tt|j�d|�}t�|d�S)NrrP)rGrNrErerf�r��resourcerErrr�
open_resourceszFileLoader.open_resourcecCs&|�|�st�tt|j�d|�}|S�Nr)�is_resource�FileNotFoundErrorrGrNrErVrrr�
resource_paths
zFileLoader.resource_pathcCs(t|krdStt|j�d|�}t|�S)NFr)r?rGrNrErV�r�r�rErrrrZ szFileLoader.is_resourcecCstt�t|j�d��SrY)�iterr�listdirrNrErKrrr�contents&szFileLoader.contents)r�r�r�r�rrHrLr�r(r�r0rUrXr\rZr`�
__classcell__rrrNrrC�s

rCc@s.eZdZdZdd�Zdd�Zdd�dd	�Zd
S)�SourceFileLoaderz>Concrete implementation of SourceLoader using the file system.cCst|�}|j|jd�S)z!Return the metadata for the path.)r�r9)rP�st_mtime�st_size)r�rEr@rrrr,.szSourceFileLoader.path_statscCst|�}|j|||d�S)N��_mode)r�r-)r�r�r�r/rSrrrr/3sz SourceFileLoader._cache_bytecoder\rec	Cs�t|�\}}g}|r4t|�s4t|�\}}|�|�qt|�D]l}t||�}zt�|�Wq<tk
rpYq<Yq<tk
r�}zt	�
d||�WY�dSd}~XYq<Xq<zt|||�t	�
d|�Wn0tk
r�}zt	�
d||�W5d}~XYnXdS)zWrite bytes data to a file.zcould not create {!r}: {!r}Nzcreated {!r})rNrXrA�reversedrGr�mkdir�FileExistsErrorrQr�r�rl)	r�rEr/rf�parentr�rCrHr1rrrr-8s0
��zSourceFileLoader.set_dataN)r�r�r�r�r,r/r-rrrrrb*srbc@s eZdZdZdd�Zdd�ZdS)�SourcelessFileLoaderz-Loader which handles sourceless file imports.cCsD|�|�}|�|�}||d�}t|||�tt|�dd�||d�S)Nr�r�)r�r�)r�r0r�r�r:)r�r�rEr/r�rrrr![s

��zSourcelessFileLoader.get_codecCsdS)z'Return None as there is no source code.Nrr'rrrr2kszSourcelessFileLoader.get_sourceN)r�r�r�r�r!r2rrrrrkWsrkc@s\eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zedd��Z
dS)rQz]Loader for extension modules.

    The constructor is designed to work with FileFinder.

    cCs@||_t|�s6ztt��|�}Wntk
r4YnX||_dSrI)r�r[rGrrWrQrEr]rrrr|szExtensionFileLoader.__init__cCs|j|jko|j|jkSrIrDrFrrrrH�s
�zExtensionFileLoader.__eq__cCst|j�t|j�ASrIrIrKrrrrL�szExtensionFileLoader.__hash__cCs$t�tj|�}t�d|j|j�|S)z&Create an unitialized extension modulez&extension module {!r} loaded from {!r})r�r"r��create_dynamicr�r�rE)r�r�r$rrrr �s��z!ExtensionFileLoader.create_modulecCs$t�tj|�t�d|j|j�dS)zInitialize an extension modulez(extension module {!r} executed from {!r}N)r�r"r��exec_dynamicr�r�rErTrrrr%�s
�zExtensionFileLoader.exec_modulecs$t|j�d�t�fdd�tD��S)z1Return True if the extension module is a package.rc3s|]}�d|kVqdS)rNr�r	�suffix��	file_namerrr
�s�z1ExtensionFileLoader.is_package.<locals>.<genexpr>)rNrE�any�EXTENSION_SUFFIXESr'rrprr��s�zExtensionFileLoader.is_packagecCsdS)z?Return None as an extension module cannot create a code object.Nrr'rrrr!�szExtensionFileLoader.get_codecCsdS)z5Return None as extension modules have no source code.Nrr'rrrr2�szExtensionFileLoader.get_sourcecCs|jSrOrKr'rrrr��sz ExtensionFileLoader.get_filenameN)r�r�r�r�rrHrLr r%r�r!r2r�r�rrrrrQts	rQc@sheZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�_NamespacePatha&Represents a namespace package's path.  It uses the module name
    to find its parent module, and from there it looks up the parent's
    __path__.  When this changes, the module's own path is recomputed,
    using path_finder.  For top-level modules, the parent module's path
    is sys.path.cCs$||_||_t|���|_||_dSrI)�_name�_pathr��_get_parent_path�_last_parent_path�_path_finder�r�r�rE�path_finderrrrr�sz_NamespacePath.__init__cCs&|j�d�\}}}|dkrdS|dfS)z>Returns a tuple of (parent-module-name, parent-path-attr-name)ror)rrE�__path__)rurv)r�rj�dot�merrr�_find_parent_path_names�sz&_NamespacePath._find_parent_path_namescCs|��\}}ttj||�SrI)rr�r�modules)r��parent_module_name�path_attr_namerrrrw�sz_NamespacePath._get_parent_pathcCsPt|���}||jkrJ|�|j|�}|dk	rD|jdkrD|jrD|j|_||_|jSrI)r�rwrxryrur�r�rv)r��parent_pathr�rrr�_recalculate�s
z_NamespacePath._recalculatecCst|���SrI)r^r�rKrrr�__iter__�sz_NamespacePath.__iter__cCs|��|SrI�r�)r��indexrrr�__getitem__�sz_NamespacePath.__getitem__cCs||j|<dSrI)rv)r�r�rErrr�__setitem__�sz_NamespacePath.__setitem__cCst|���SrI)rr�rKrrr�__len__�sz_NamespacePath.__len__cCsd�|j�S)Nz_NamespacePath({!r}))r_rvrKrrr�__repr__�sz_NamespacePath.__repr__cCs||��kSrIr��r��itemrrr�__contains__�sz_NamespacePath.__contains__cCs|j�|�dSrI)rvrAr�rrrrA�sz_NamespacePath.appendN)r�r�r�r�rrrwr�r�r�r�r�r�r�rArrrrrt�s

rtc@sPeZdZdd�Zedd��Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�ZdS)�_NamespaceLoadercCst|||�|_dSrI)rtrvrzrrrr�sz_NamespaceLoader.__init__cCsd�|j�S)zsReturn repr for the module.

        The method is deprecated.  The import machinery does the job itself.

        z<module {!r} (namespace)>)r_r�)rr$rrr�module_repr�sz_NamespaceLoader.module_reprcCsdS)NTrr'rrrr��sz_NamespaceLoader.is_packagecCsdS)Nrrr'rrrr2�sz_NamespaceLoader.get_sourcecCstddddd�S)Nrz<string>r#T)r4)r5r'rrrr!sz_NamespaceLoader.get_codecCsdSrrrrrrr sz_NamespaceLoader.create_modulecCsdSrIrrTrrrr%sz_NamespaceLoader.exec_modulecCst�d|j�t�||�S)zbLoad a namespace module.

        This method is deprecated.  Use exec_module() instead.

        z&namespace module loaded with path {!r})r�r�rvr&r'rrrr(	s�z_NamespaceLoader.load_moduleN)r�r�r�rrr�r�r2r!r r%r(rrrrr��s
r�c@sveZdZdZedd��Zedd��Zedd��Zedd	��Zeddd��Z	edd
d��Z
eddd��Zedd��Zd
S)�
PathFinderz>Meta path finder for sys.path and package __path__ attributes.cCs@ttj���D],\}}|dkr(tj|=qt|d�r|��qdS)z}Call the invalidate_caches() method on all path entry finders
        stored in sys.path_importer_caches (where implemented).N�invalidate_caches)�listr�path_importer_cache�itemsr�r�)rr��finderrrrr�s


zPathFinder.invalidate_cachesc	CsTtjdk	rtjst�dt�tjD],}z||�WStk
rLYq"Yq"Xq"dS)z.Search sys.path_hooks for a finder for 'path'.Nzsys.path_hooks is empty)r�
path_hooksrqrrr�r�)rrE�hookrrr�_path_hooks%s
zPathFinder._path_hookscCsh|dkr,zt��}Wntk
r*YdSXztj|}Wn(tk
rb|�|�}|tj|<YnX|S)z�Get the finder for the path entry from sys.path_importer_cache.

        If the path entry is not in the cache, find the appropriate finder
        and cache it. If no finder is available, store None.

        rN)rrWr[rr��KeyErrorr�)rrEr�rrr�_path_importer_cache2s
zPathFinder._path_importer_cachecCsRt|d�r|�|�\}}n|�|�}g}|dk	r<t�||�St�|d�}||_|S)Nr�)r�r�rr�rr�r�)rr�r�r�r�r�rrr�_legacy_get_specHs

zPathFinder._legacy_get_specNc	Cs�g}|D]�}t|ttf�sq|�|�}|dk	rt|d�rF|�||�}n|�||�}|dkr\q|jdk	rn|S|j}|dkr�t	d��|�
|�qt�|d�}||_|S)z?Find the loader or namespace_path for this module/package name.Nrzspec missing loader)
r�r|�bytesr�r�rr�r�r�r�r�r�r�)	rr�rEr�namespace_path�entryr�r�r�rrr�	_get_specWs(


zPathFinder._get_speccCsd|dkrtj}|�|||�}|dkr(dS|jdkr\|j}|rVd|_t|||j�|_|SdSn|SdS)z�Try to find a spec for 'fullname' on sys.path or 'path'.

        The search is based on sys.path_hooks and sys.path_importer_cache.
        N)rrEr�r�r�r�rt)rr�rErr�r�rrrrws
zPathFinder.find_speccCs|�||�}|dkrdS|jS)z�find the module on sys.path or 'path' based on sys.path_hooks and
        sys.path_importer_cache.

        This method is deprecated.  Use find_spec() instead.

        Nrrrrrr�szPathFinder.find_modulecOsddlm}|j||�S)a 
        Find distributions.

        Return an iterable of all Distribution instances capable of
        loading the metadata for packages matching ``context.name``
        (or all names if ``None`` indicated) along the paths in the list
        of directories ``context.path``.
        r)�MetadataPathFinder)�importlib.metadatar��find_distributions)rr�r�r�rrrr��s
zPathFinder.find_distributions)N)NN)N)
r�r�r�r�rr�r�r�r�r�rrr�rrrrr�s"
	


r�c@sZeZdZdZdd�Zdd�ZeZdd�Zdd	�Z	ddd�Z
d
d�Zedd��Z
dd�Zd
S)�
FileFinderz�File-based finder.

    Interactions with the file system are cached for performance, being
    refreshed when the directory the finder is handling has been modified.

    cspg}|D] \�}|��fdd�|D��q||_|p6d|_t|j�sVtt��|j�|_d|_t�|_	t�|_
dS)z�Initialize with the path to search on and a variable number of
        2-tuples containing the loader and the file suffixes the loader
        recognizes.c3s|]}|�fVqdSrIrrn�r�rrr
�sz&FileFinder.__init__.<locals>.<genexpr>ror�N)r��_loadersrEr[rGrrW�_path_mtime�set�_path_cache�_relaxed_path_cache)r�rE�loader_details�loadersr�rr�rr�s

zFileFinder.__init__cCs
d|_dS)zInvalidate the directory mtime.r�N)r�rKrrrr��szFileFinder.invalidate_cachescCs*|�|�}|dkrdgfS|j|jp&gfS)z�Try to find a loader for the specified module, or the namespace
        package portions. Returns (loader, list-of-portions).

        This method is deprecated.  Use find_spec() instead.

        N)rr�r�)r�r�r�rrrr��s
zFileFinder.find_loadercCs|||�}t||||d�S)Nr�)r)r�r�r�rE�smslrr�rrrr��s
�zFileFinder._get_specNc	Cs�d}|�d�d}zt|jp"t���j}Wntk
rBd}YnX||jkr\|��||_t	�rr|j
}|��}n
|j}|}||kr�t
|j|�}|jD]:\}	}
d|	}t
||�}t|�r�|�|
|||g|�Sq�t|�}|jD]r\}	}
zt
|j||	�}Wntk
�rYdSXtjd|dd�||	|kr�t|�r�|�|
||d|�Sq�|�r~t�d	|�t�|d�}
|g|
_|
SdS)
zoTry to find a spec for the specified module.

        Returns the matching spec, or None if not found.
        Fror1r�rNz	trying {})�	verbosityzpossible namespace for {})rvrPrErrWrcrQr��_fill_cacherr�r�r�rGr�rVr�rXr~r�r�r�r�)r�r�r�is_namespace�tail_moduler��cache�cache_module�	base_pathror��
init_filename�	full_pathr�rrrr�sP





�
zFileFinder.find_specc	
Cs�|j}zt�|pt���}Wntttfk
r:g}YnXtj�	d�sTt
|�|_nJt
�}|D]8}|�d�\}}}|r�d�
||���}n|}|�|�q^||_tj�	t�r�dd�|D�|_dS)zDFill the cache of potential modules and packages for this directory.rror]cSsh|]}|���qSr)r�)r	�fnrrrr*sz)FileFinder._fill_cache.<locals>.<setcomp>N)rErr_rWr[�PermissionError�NotADirectoryErrorrrr r�r�r�r_r��addr!r�)	r�rEr`�lower_suffix_contentsr�r�r}ro�new_namerrrr�
s"
zFileFinder._fill_cachecs��fdd�}|S)aA class method which returns a closure to use on sys.path_hook
        which will return an instance using the specified loaders and the path
        called on the closure.

        If the path called on the closure is not a directory, ImportError is
        raised.

        cs"t|�std|d���|f���S)z-Path hook for importlib.machinery.FileFinder.zonly directories are supportedrK)rXr�rK�rr�rr�path_hook_for_FileFinder6sz6FileFinder.path_hook.<locals>.path_hook_for_FileFinderr)rr�r�rr�r�	path_hook,s
zFileFinder.path_hookcCsd�|j�S)NzFileFinder({!r}))r_rErKrrrr�>szFileFinder.__repr__)N)r�r�r�r�rr�r�rr�r�rr�rr�r�rrrrr��s
3
r�cCs�|�d�}|�d�}|sB|r$|j}n||kr8t||�}n
t||�}|sTt|||d�}z$||d<||d<||d<||d<Wntk
r�YnXdS)N�
__loader__�__spec__r��__file__�
__cached__)�getr�rkrbr�	Exception)�nsr��pathname�	cpathnamer�r�rrr�_fix_up_moduleDs"


r�cCs*ttt���f}ttf}ttf}|||gS)z_Returns a list of file-based module loaders.

    Each item is a tuple (loader, suffixes).
    )rQ�_alternative_architecturesr��extension_suffixesrbr�rkr�)�
extensions�source�bytecoderrrr�[sr�c	Cs�|atjatjatjt}dD]0}|tjkr8t�|�}n
tj|}t|||�qddgfdddgff}|D]n\}}tdd�|D��s�t�|d}|tjkr�tj|}q�qjzt�|�}Wq�Wqjt	k
r�YqjYqjXqjt	d	��t|d
|�t|d|�t|dd
�
|��t|ddd�|D��t�d�}	t|d|	�t�d�}
t|d|
�|dk�rnt�d�}t|d|�t|dt��t�
tt����|dk�r�t�d�dtk�r�dt_dS)z�Setup the path-based importers for importlib by importing needed
    built-in modules and injecting them into the global namespace.

    Other components are extracted from the core bootstrap module.

    )rerq�builtinsr��posixr�ntrcss|]}t|�dkVqdSrrrrrrr
sz_setup.<locals>.<genexpr>rzimportlib requires posix or ntrr?r6r�_pathseps_with_coloncSsh|]}d|���qSrrrrrrr�sz_setup.<locals>.<setcomp>�_thread�_weakref�winregrrz.pywz_d.pydTN)r�rr�r�r��_builtin_from_namer��allr,r�rBr#rsr�r�r�r�rArr
)�_bootstrap_module�self_module�builtin_name�builtin_module�
os_details�
builtin_osr6r?�	os_module�
thread_module�weakref_module�
winreg_modulerrr�_setupfsN













r�cCs2t|�t�}tj�tj|�g�tj�t	�dS)z)Install the path-based import components.N)
r�r�rr�r�r�r��	meta_pathrAr�)r��supported_loadersrrr�_install�sr��-arm-linux-gnueabihf.�-armeb-linux-gnueabihf.�-mips64-linux-gnuabi64.�-mips64el-linux-gnuabi64.�-powerpc-linux-gnu.�-powerpc-linux-gnuspe.�-powerpc64-linux-gnu.�-powerpc64le-linux-gnu.�-arm-linux-gnueabi.�-armeb-linux-gnueabi.�-mips64-linux-gnu.�-mips64el-linux-gnu.�-ppc-linux-gnu.�-ppc-linux-gnuspe.�-ppc64-linux-gnu.�-ppc64le-linux-gnu.)r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�cCsF|D]<}t��D].\}}||kr|�|�||��|Sqq|S)z�Add a suffix with an alternative architecture name
    to the list of suffixes so an extension built with
    the default (upstream) setting is loadable with our Pythons
    )�	_ARCH_MAPr�rArZ)r�ro�original�alternativerrrr��sr�)r\)N)NNN)rr)T)N)N)Tr�r�rerrqr�r�_MS_WINDOWSr�rr�r�r6r�r,r?r�r=rBr�r"�%_CASE_INSENSITIVE_PLATFORMS_BYTES_KEYr!r#r*r0r2rGrNrPrUrVrXr[rl�type�__code__r�r(r�r'r-r<r�rr�r��DEBUG_BYTECODE_SUFFIXES�OPTIMIZED_BYTECODE_SUFFIXESr�r�r�r�r�r�r�r�r�r�r�r�r�r��objectr�rrrr)rCrbrkrsrQrtr�r�r�r�r�r�r�r�r�rrrr�<module>s�



�

	



G(!



�D@H-:?*
A	�importlib/__pycache__/_bootstrap.cpython-38.pyc000064400000067677151153537630015621 0ustar00U

e5dܚ�@s�dZdadd�Zdd�ZiZiZGdd�de�ZGdd	�d	�ZGd
d�d�Z	Gdd
�d
�Z
dd�Zdd�Zdd�Z
dd�dd�Zdd�Zdd�Zdd�Zdd�ZGd d!�d!�Zddd"�d#d$�Zd^d%d&�Zd'd(�d)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�ZGd7d8�d8�ZGd9d:�d:�ZGd;d<�d<�Zd=d>�Z d?d@�Z!d_dAdB�Z"dCdD�Z#dEZ$e$dFZ%dGdH�Z&e'�Z(dIdJ�Z)d`dLdM�Z*d'dN�dOdP�Z+dQdR�Z,dadTdU�Z-dVdW�Z.dXdY�Z/dZd[�Z0d\d]�Z1dS)baSCore implementation of import.

This module is NOT meant to be directly imported! It has been designed such
that it can be bootstrapped into Python as the implementation of import. As
such it requires the injection of specific modules and attributes in order to
work. One should use importlib as the public-facing version of this module.

NcCs8dD] }t||�rt||t||��q|j�|j�dS)z/Simple substitute for functools.update_wrapper.)�
__module__�__name__�__qualname__�__doc__N)�hasattr�setattr�getattr�__dict__�update)�new�old�replace�r
�,/usr/lib64/python3.8/importlib/_bootstrap.py�_wraps
rcCstt�|�S�N)�type�sys��namer
r
r�_new_module#src@seZdZdS)�_DeadlockErrorN)rrrr
r
r
rr0src@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�_ModuleLockz�A recursive lock implementation which is able to detect deadlocks
    (e.g. thread 1 trying to take locks A then B, and thread 2 trying to
    take locks B then A).
    cCs0t��|_t��|_||_d|_d|_d|_dS�N�)�_thread�
allocate_lock�lock�wakeupr�owner�count�waiters��selfrr
r
r�__init__:s

z_ModuleLock.__init__cCs<t��}|j}t�|�}|dkr$dS|j}||krdSqdS)NFT)r�	get_identr�_blocking_on�get)r"�me�tidrr
r
r�has_deadlockBs
z_ModuleLock.has_deadlockc	Cs�t��}|t|<z�|j�n|jdks.|j|krT||_|jd7_W5QR�W�VdS|��rhtd|��|j�	d�r�|j
d7_
W5QRX|j�	�|j��qW5t|=XdS)z�
        Acquire the module lock.  If a potential deadlock is detected,
        a _DeadlockError is raised.
        Otherwise, the lock is always acquired and True is returned.
        r�Tzdeadlock detected by %rFN)rr$r%rrrr)rr�acquirer �release�r"r(r
r
rr+Ns
z_ModuleLock.acquirec	Cszt��}|j�b|j|kr"td��|jdks0t�|jd8_|jdkrld|_|jrl|jd8_|j�	�W5QRXdS)N�cannot release un-acquired lockrr*)
rr$rr�RuntimeErrorr�AssertionErrorr rr,r-r
r
rr,gs

z_ModuleLock.releasecCsd�|jt|��S)Nz_ModuleLock({!r}) at {}��formatr�id�r"r
r
r�__repr__tsz_ModuleLock.__repr__N)	rrrrr#r)r+r,r5r
r
r
rr4s
rc@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�_DummyModuleLockzVA simple _ModuleLock equivalent for Python builds without
    multi-threading support.cCs||_d|_dSr)rrr!r
r
rr#|sz_DummyModuleLock.__init__cCs|jd7_dS)Nr*T)rr4r
r
rr+�sz_DummyModuleLock.acquirecCs$|jdkrtd��|jd8_dS)Nrr.r*)rr/r4r
r
rr,�s
z_DummyModuleLock.releasecCsd�|jt|��S)Nz_DummyModuleLock({!r}) at {}r1r4r
r
rr5�sz_DummyModuleLock.__repr__N)rrrrr#r+r,r5r
r
r
rr6xs
r6c@s$eZdZdd�Zdd�Zdd�ZdS)�_ModuleLockManagercCs||_d|_dSr)�_name�_lockr!r
r
rr#�sz_ModuleLockManager.__init__cCst|j�|_|j��dSr)�_get_module_lockr8r9r+r4r
r
r�	__enter__�sz_ModuleLockManager.__enter__cOs|j��dSr)r9r,)r"�args�kwargsr
r
r�__exit__�sz_ModuleLockManager.__exit__N)rrrr#r;r>r
r
r
rr7�sr7cCs�t��zjzt|�}Wntk
r0d}YnX|dkrptdkrLt|�}nt|�}|fdd�}t�	||�t|<W5t��X|S)z�Get or create the module lock for a given module name.

    Acquire/release internally the global import lock to protect
    _module_locks.NcSs0t��zt�|�|krt|=W5t��XdSr)�_imp�acquire_lock�release_lock�
_module_locksr&)�refrr
r
r�cb�s

z_get_module_lock.<locals>.cb)
r?r@rArB�KeyErrorrr6r�_weakrefrC)rrrDr
r
rr:�s


r:cCs6t|�}z|��Wntk
r(Yn
X|��dS)z�Acquires then releases the module lock for a given module name.

    This is used to ensure a module is completely initialized, in the
    event it is being imported by another thread.
    N)r:r+rr,)rrr
r
r�_lock_unlock_module�srGcOs
|||�S)a.remove_importlib_frames in import.c will always remove sequences
    of importlib frames that end with a call to this function

    Use it instead of a normal call in places where including the importlib
    frames introduces unwanted noise into the traceback (e.g. when executing
    module code)
    r
)�fr<�kwdsr
r
r�_call_with_frames_removed�srJr*)�	verbositycGs6tjj|kr2|�d�sd|}t|j|�tjd�dS)z=Print the message to stderr if -v/PYTHONVERBOSE is turned on.)�#zimport z# )�fileN)r�flags�verbose�
startswith�printr2�stderr)�messagerKr<r
r
r�_verbose_message�s
rTcs�fdd�}t|��|S)z1Decorator to verify the named module is built-in.cs&|tjkrtd�|�|d���||�S)N�{!r} is not a built-in moduler)r�builtin_module_names�ImportErrorr2�r"�fullname��fxnr
r�_requires_builtin_wrapper�s


�z4_requires_builtin.<locals>._requires_builtin_wrapper�r)r[r\r
rZr�_requires_builtin�s
r^cs�fdd�}t|��|S)z/Decorator to verify the named module is frozen.cs&t�|�std�|�|d���||�S�Nz{!r} is not a frozen moduler)r?�	is_frozenrWr2rXrZr
r�_requires_frozen_wrapper�s


�z2_requires_frozen.<locals>._requires_frozen_wrapperr])r[rar
rZr�_requires_frozen�s
rbcCs>t||�}|tjkr2tj|}t||�tj|St|�SdS)z�Load the specified module into sys.modules and return it.

    This method is deprecated.  Use loader.exec_module instead.

    N)�spec_from_loaderr�modules�_exec�_load)r"rY�spec�moduler
r
r�_load_module_shim�s




ricCs�t|dd�}t|d�r8z|�|�WStk
r6YnXz
|j}Wntk
rVYnX|dk	rht|�Sz
|j}Wntk
r�d}YnXz
|j}Wn:tk
r�|dkr�d�	|�YSd�	||�YSYnXd�	||�SdS)N�
__loader__�module_repr�?�
<module {!r}>�<module {!r} ({!r})>�<module {!r} from {!r}>)
rrrk�	Exception�__spec__�AttributeError�_module_repr_from_specr�__file__r2)rh�loaderrgr�filenamer
r
r�_module_repr
s.




rwc@sreZdZdZdddd�dd�Zdd�Zdd	�Zed
d��Zej	dd��Zed
d��Z
edd��Zej	dd��ZdS)�
ModuleSpeca�The specification for a module, used for loading.

    A module's spec is the source for information about the module.  For
    data associated with the module, including source, use the spec's
    loader.

    `name` is the absolute name of the module.  `loader` is the loader
    to use when loading the module.  `parent` is the name of the
    package the module is in.  The parent is derived from the name.

    `is_package` determines if the module is considered a package or
    not.  On modules this is reflected by the `__path__` attribute.

    `origin` is the specific location used by the loader from which to
    load the module, if that information is available.  When filename is
    set, origin will match.

    `has_location` indicates that a spec's "origin" reflects a location.
    When this is True, `__file__` attribute of the module is set.

    `cached` is the location of the cached bytecode file, if any.  It
    corresponds to the `__cached__` attribute.

    `submodule_search_locations` is the sequence of path entries to
    search when importing submodules.  If set, is_package should be
    True--and False otherwise.

    Packages are simply modules that (may) have submodules.  If a spec
    has a non-None value in `submodule_search_locations`, the import
    system will consider modules loaded from the spec as packages.

    Only finders (see importlib.abc.MetaPathFinder and
    importlib.abc.PathEntryFinder) should modify ModuleSpec instances.

    N)�origin�loader_state�
is_packagecCs6||_||_||_||_|r gnd|_d|_d|_dS�NF)rruryrz�submodule_search_locations�
_set_fileattr�_cached)r"rruryrzr{r
r
rr#VszModuleSpec.__init__cCsfd�|j�d�|j�g}|jdk	r4|�d�|j��|jdk	rP|�d�|j��d�|jjd�|��S)Nz	name={!r}zloader={!r}zorigin={!r}zsubmodule_search_locations={}z{}({})z, )	r2rrury�appendr}�	__class__r�join)r"r<r
r
rr5bs

�

�zModuleSpec.__repr__cCsj|j}zH|j|jkoL|j|jkoL|j|jkoL||jkoL|j|jkoL|j|jkWStk
rdYdSXdSr|)r}rrury�cached�has_locationrr)r"�other�smslr
r
r�__eq__ls
�
��
�
�zModuleSpec.__eq__cCs:|jdkr4|jdk	r4|jr4tdkr&t�t�|j�|_|jSr)rryr~�_bootstrap_external�NotImplementedError�_get_cachedr4r
r
rr�xs
zModuleSpec.cachedcCs
||_dSr)r)r"r�r
r
rr��scCs$|jdkr|j�d�dS|jSdS)z The name of the module's parent.N�.r)r}r�
rpartitionr4r
r
r�parent�s
zModuleSpec.parentcCs|jSr)r~r4r
r
rr��szModuleSpec.has_locationcCst|�|_dSr)�boolr~)r"�valuer
r
rr��s)rrrrr#r5r��propertyr��setterr�r�r
r
r
rrx1s $�




rx�ryr{cCs�t|d�rJtdkrt�tj}|dkr0|||d�S|r8gnd}||||d�S|dkr�t|d�r�z|�|�}Wq�tk
r�d}Yq�Xnd}t||||d�S)z5Return a module spec based on various loader methods.�get_filenameN)ru)rur}r{Fr�)rr�r��spec_from_file_locationr{rWrx)rruryr{r��searchr
r
rrc�s$
�
rccCs8z
|j}Wntk
rYnX|dk	r,|S|j}|dkrZz
|j}Wntk
rXYnXz
|j}Wntk
r|d}YnX|dkr�|dkr�z
|j}Wq�tk
r�d}Yq�Xn|}z
|j}Wntk
r�d}YnXzt|j�}Wntk
�rd}YnXt	|||d�}|dk�r"dnd|_
||_||_|S)N�ryFT)
rqrrrrjrt�_ORIGIN�
__cached__�list�__path__rxr~r�r})rhruryrgr�locationr�r}r
r
r�_spec_from_module�sH







r�F��overridecCs�|st|dd�dkr6z|j|_Wntk
r4YnX|sJt|dd�dkr�|j}|dkr�|jdk	r�tdkrnt�tj}|�	|�}|j|_
||_d|_z
||_Wntk
r�YnX|s�t|dd�dkr�z|j
|_Wntk
r�YnXz
||_Wntk
�rYnX|�s"t|dd�dk�rR|jdk	�rRz|j|_Wntk
�rPYnX|j�r�|�srt|dd�dk�r�z|j|_Wntk
�r�YnX|�s�t|dd�dk�r�|jdk	�r�z|j|_Wntk
�r�YnX|S)Nrrj�__package__r�rtr�)rrrrrrur}r�r��_NamespaceLoader�__new__�_pathrtrjr�r�rqr�r�ryr�r�)rgrhr�rur�r
r
r�_init_module_attrs�s`



r�cCsRd}t|jd�r|j�|�}nt|jd�r2td��|dkrDt|j�}t||�|S)z+Create a module based on the provided spec.N�
create_module�exec_modulezBloaders that define exec_module() must also define create_module())rrur�rWrrr��rgrhr
r
r�module_from_spec%s

r�cCsj|jdkrdn|j}|jdkrB|jdkr2d�|�Sd�||j�Sn$|jrVd�||j�Sd�|j|j�SdS)z&Return the repr to use for the module.Nrlrmrnro�<module {!r} ({})>)rryrur2r�)rgrr
r
rrs6s


rsc
Cs�|j}t|���tj�|�|k	r6d�|�}t||d��zj|jdkrj|j	dkrZtd|jd��t
||dd�n4t
||dd�t|jd�s�|j�|�n|j�
|�W5tj�|j�}|tj|j<XW5QRX|S)zFExecute the spec's specified module in an existing module's namespace.zmodule {!r} not in sys.modulesrN�missing loaderTr�r�)rr7rrdr&r2rW�poprur}r�r�load_moduler�)rgrhr�msgr
r
rreGs"



recCsz|j�|j�Wn4|jtjkr@tj�|j�}|tj|j<�YnXtj�|j�}|tj|j<t|dd�dkr�z|j|_Wntk
r�YnXt|dd�dkr�z(|j	|_
t|d�s�|j�d�d|_
Wntk
r�YnXt|dd�dk�rz
||_
Wntk
�rYnX|S)Nrjr�r�r�rrq)rur�rrrdr�rrjrrrr�rr�rqr�r
r
r�_load_backward_compatiblees6

r�cCs�|jdk	rt|jd�st|�St|�}d|_z�|tj|j<z4|jdkr`|jdkrlt	d|jd��n|j�
|�Wn2ztj|j=Wntk
r�YnX�YnXtj�|j�}|tj|j<t
d|j|j�W5d|_X|S)Nr�TFr�rzimport {!r} # {!r})rurr�r��
_initializingrrdrr}rWr�rEr�rTr�r
r
r�_load_unlocked�s.


r�c
Cs*t|j��t|�W5QR�SQRXdS)z�Return a new module object, loaded by the spec's loader.

    The module is not added to its parent.

    If a module is already in sys.modules, that existing module gets
    clobbered.

    N)r7rr�)rgr
r
rrf�s	rfc@s�eZdZdZedd��Zeddd��Zeddd��Zed	d
��Z	edd��Z
eed
d���Zeedd���Z
eedd���Zee�ZdS)�BuiltinImporterz�Meta path import for built-in modules.

    All methods are either class or static methods to avoid the need to
    instantiate the class.

    cCsd�|j�S)�sReturn repr for the module.

        The method is deprecated.  The import machinery does the job itself.

        z<module {!r} (built-in)>)r2r)rhr
r
rrk�szBuiltinImporter.module_reprNcCs,|dk	rdSt�|�r$t||dd�SdSdS)Nzbuilt-inr�)r?�
is_builtinrc��clsrY�path�targetr
r
r�	find_spec�s

zBuiltinImporter.find_speccCs|�||�}|dk	r|jSdS)z�Find the built-in module.

        If 'path' is ever specified then the search is considered a failure.

        This method is deprecated.  Use find_spec() instead.

        N)r�ru)r�rYr�rgr
r
r�find_module�s	zBuiltinImporter.find_modulecCs.|jtjkr"td�|j�|jd��ttj|�S)zCreate a built-in modulerUr)rrrVrWr2rJr?�create_builtin)r"rgr
r
rr��s
�zBuiltinImporter.create_modulecCsttj|�dS)zExec a built-in moduleN)rJr?�exec_builtin)r"rhr
r
rr��szBuiltinImporter.exec_modulecCsdS)z9Return None as built-in modules do not have code objects.Nr
�r�rYr
r
r�get_code�szBuiltinImporter.get_codecCsdS)z8Return None as built-in modules do not have source code.Nr
r�r
r
r�
get_source�szBuiltinImporter.get_sourcecCsdS)z4Return False as built-in modules are never packages.Fr
r�r
r
rr{szBuiltinImporter.is_package)NN)N)rrrr�staticmethodrk�classmethodr�r�r�r�r^r�r�r{rir�r
r
r
rr��s*


r�c@s�eZdZdZdZedd��Zeddd��Zeddd	��Z	ed
d��Z
edd
��Zedd��Zee
dd���Zee
dd���Zee
dd���ZdS)�FrozenImporterz�Meta path import for frozen modules.

    All methods are either class or static methods to avoid the need to
    instantiate the class.

    �frozencCsd�|jtj�S)r�r�)r2rr�r�)�mr
r
rrkszFrozenImporter.module_reprNcCs"t�|�rt|||jd�SdSdS)Nr�)r?r`rcr�r�r
r
rr� s
zFrozenImporter.find_speccCst�|�r|SdS)z]Find a frozen module.

        This method is deprecated.  Use find_spec() instead.

        N)r?r`)r�rYr�r
r
rr�'szFrozenImporter.find_modulecCsdS)z*Use default semantics for module creation.Nr
)r�rgr
r
rr�0szFrozenImporter.create_modulecCs@|jj}t�|�s$td�|�|d��ttj|�}t||j	�dSr_)
rqrr?r`rWr2rJ�get_frozen_object�execr)rhr�coder
r
rr�4s

�zFrozenImporter.exec_modulecCs
t||�S)z_Load a frozen module.

        This method is deprecated.  Use exec_module() instead.

        )rir�r
r
rr�=szFrozenImporter.load_modulecCs
t�|�S)z-Return the code object for the frozen module.)r?r�r�r
r
rr�FszFrozenImporter.get_codecCsdS)z6Return None as frozen modules do not have source code.Nr
r�r
r
rr�LszFrozenImporter.get_sourcecCs
t�|�S)z.Return True if the frozen module is a package.)r?�is_frozen_packager�r
r
rr{RszFrozenImporter.is_package)NN)N)rrrrr�r�rkr�r�r�r�r�r�rbr�r�r{r
r
r
rr�s.



r�c@s eZdZdZdd�Zdd�ZdS)�_ImportLockContextz$Context manager for the import lock.cCst��dS)zAcquire the import lock.N)r?r@r4r
r
rr;_sz_ImportLockContext.__enter__cCst��dS)z<Release the import lock regardless of any raised exceptions.N)r?rA)r"�exc_type�	exc_value�
exc_tracebackr
r
rr>csz_ImportLockContext.__exit__N)rrrrr;r>r
r
r
rr�[sr�cCs@|�d|d�}t|�|kr$td��|d}|r<d�||�S|S)z2Resolve a relative module name to an absolute one.r�r*z2attempted relative import beyond top-level packager�{}.{})�rsplit�len�
ValueErrorr2)r�package�level�bits�baser
r
r�
_resolve_namehs
r�cCs"|�||�}|dkrdSt||�Sr)r�rc)�finderrr�rur
r
r�_find_spec_legacyqsr�c

Cstj}|dkrtd��|s&t�dt�|tjk}|D]�}t��Tz
|j}Wn6t	k
r�t
|||�}|dkr|YW5QR�q4YnX||||�}W5QRX|dk	r4|�s�|tjk�r�tj|}z
|j}	Wnt	k
r�|YSX|	dkr�|S|	Sq4|Sq4dS)zFind a module's spec.Nz5sys.meta_path is None, Python is likely shutting downzsys.meta_path is empty)r�	meta_pathrW�	_warnings�warn�
ImportWarningrdr�r�rrr�rq)
rr�r�r��	is_reloadr�r�rgrhrqr
r
r�
_find_speczs6





r�cCslt|t�std�t|����|dkr,td��|dkrTt|t�sHtd��n|sTtd��|sh|dkrhtd��dS)zVerify arguments are "sane".zmodule name must be str, not {}rzlevel must be >= 0z__package__ not set to a stringz6attempted relative import with no known parent packagezEmpty module nameN)�
isinstance�str�	TypeErrorr2rr�rW�rr�r�r
r
r�
_sanity_check�s


r�zNo module named z{!r}cCs�d}|�d�d}|r�|tjkr*t||�|tjkr>tj|Stj|}z
|j}Wn2tk
r�td�||�}t||d�d�YnXt	||�}|dkr�tt�|�|d��nt
|�}|r�tj|}t||�d�d|�|S)Nr�rz; {!r} is not a packager�)r�rrdrJr�rr�_ERR_MSGr2�ModuleNotFoundErrorr�r�r)r�import_r�r��
parent_moduler�rgrhr
r
r�_find_and_load_unlocked�s*







r�c
Csjt|��2tj�|t�}|tkr6t||�W5QR�SW5QRX|dkr^d�|�}t||d��t|�|S)zFind and load the module.Nz(import of {} halted; None in sys.modulesr)	r7rrdr&�_NEEDS_LOADINGr�r2r�rG)rr�rhrSr
r
r�_find_and_load�s
 �r�rcCs*t|||�|dkr t|||�}t|t�S)a2Import and return the module based on its name, the package the call is
    being made from, and the level adjustment.

    This function represents the greatest common denominator of functionality
    between import_module and __import__. This includes setting __package__ if
    the loader did not.

    r)r�r�r��_gcd_importr�r
r
rr��s	r���	recursivecCs�|D]�}t|t�sB|r"|jd}nd}td|�dt|�j����q|dkrl|s�t|d�r�t||j|dd�qt||�sd	�|j|�}zt	||�Wqt
k
r�}z*|j|kr�tj
�|t�d
k	r�WY�q�W5d
}~XYqXq|S)z�Figure out what __import__ should return.

    The import_ parameter is a callable which takes the name of module to
    import. It is required to decouple the function from assuming importlib's
    import implementation is desired.

    z.__all__z
``from list''zItem in z must be str, not �*�__all__Tr�r�N)r�r�rr�rr�_handle_fromlistr�r2rJr�rrrdr&r�)rh�fromlistr�r��x�where�	from_name�excr
r
rr��s,


�

�r�cCs�|�d�}|�d�}|dk	rR|dk	rN||jkrNtjd|�d|j�d�tdd�|S|dk	r`|jStjd	tdd�|d
}d|kr�|�d�d
}|S)z�Calculate what __package__ should be.

    __package__ is not guaranteed to be defined or could be set to None
    to represent that its proper value is unknown.

    r�rqNz __package__ != __spec__.parent (z != �)�)�
stacklevelzYcan't resolve package from __spec__ or __package__, falling back on __name__ and __path__rr�r�r)r&r�r�r�r�r�)�globalsr�rgr
r
r�_calc___package__s&

��r�r
c	Cs�|dkrt|�}n$|dk	r|ni}t|�}t|||�}|s�|dkrTt|�d�d�S|s\|St|�t|�d�d�}tj|jdt|j�|�Snt|d�r�t||t�S|SdS)a�Import a module.

    The 'globals' argument is used to infer where the import is occurring from
    to handle relative imports. The 'locals' argument is ignored. The
    'fromlist' argument specifies what should exist as attributes on the module
    being imported (e.g. ``from module import <fromlist>``).  The 'level'
    argument represents the package location to import from in a relative
    import (e.g. ``from ..pkg import mod`` would have a 'level' of 2).

    rNr�r�)	r�r��	partitionr�rrdrrr�)	rr��localsr�r�rh�globals_r��cut_offr
r
r�
__import__9s
 
r�cCs&t�|�}|dkrtd|��t|�S)Nzno built-in module named )r�r�rWr�)rrgr
r
r�_builtin_from_name^s
r�c
Cs�|a|att�}tj��D]H\}}t||�r|tjkr<t}nt�|�rt	}nqt
||�}t||�qtjt}dD].}|tjkr�t
|�}	n
tj|}	t|||	�qrdS)z�Setup importlib by importing needed built-in modules and injecting them
    into the global namespace.

    As sys is needed for sys.modules access and _imp is needed to load built-in
    modules, those two modules must be explicitly passed in.

    )rr�rFN)r?rrrd�itemsr�rVr�r`r�r�r�rr�r)
�
sys_module�_imp_module�module_typerrhrurg�self_module�builtin_name�builtin_moduler
r
r�_setupes$	







rcCs&t||�tj�t�tj�t�dS)z0Install importers for builtin and frozen modulesN)rrr�r�r�r�)rrr
r
r�_install�s
rcCs ddl}|a|�tjt�dS)z9Install importers that require external filesystem accessrN)�_frozen_importlib_externalr�rrrdr)rr
r
r�_install_external_importers�sr	)NN)N)Nr)NNr
r)2rr�rrrBr%r/rrr6r7r:rGrJrTr^rbrirwrxrcr�r�r�rsrer�r�rfr�r�r�r�r�r�r��_ERR_MSG_PREFIXr�r��objectr�r�r�r�r�r�r�rrr	r
r
r
r�<module>s^D%$e
-H%*IO
		
/
%
%#importlib/__pycache__/_bootstrap.cpython-38.opt-2.pyc000064400000052470151153537630016542 0ustar00U

e5dܚ�@s�dadd�Zdd�ZiZiZGdd�de�ZGdd�d�ZGd	d
�d
�ZGdd�d�Z	d
d�Z
dd�Zdd�Zdd�dd�Z
dd�Zdd�Zdd�Zdd�ZGdd �d �Zddd!�d"d#�Zd]d$d%�Zd&d'�d(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2d3�Zd4d5�ZGd6d7�d7�ZGd8d9�d9�ZGd:d;�d;�Zd<d=�Zd>d?�Z d^d@dA�Z!dBdC�Z"dDZ#e#dEZ$dFdG�Z%e&�Z'dHdI�Z(d_dKdL�Z)d&dM�dNdO�Z*dPdQ�Z+d`dSdT�Z,dUdV�Z-dWdX�Z.dYdZ�Z/d[d\�Z0dS)aNcCs8dD] }t||�rt||t||��q|j�|j�dS)N)�
__module__�__name__�__qualname__�__doc__)�hasattr�setattr�getattr�__dict__�update)�new�old�replace�r
�,/usr/lib64/python3.8/importlib/_bootstrap.py�_wraps
rcCstt�|�S�N)�type�sys��namer
r
r�_new_module#src@seZdZdS)�_DeadlockErrorN)rrrr
r
r
rr0src@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�_ModuleLockcCs0t��|_t��|_||_d|_d|_d|_dS�N�)�_thread�
allocate_lock�lock�wakeupr�owner�count�waiters��selfrr
r
r�__init__:s

z_ModuleLock.__init__cCs<t��}|j}t�|�}|dkr$dS|j}||krdSqdS)NFT)r�	get_identr�_blocking_on�get)r"�me�tidrr
r
r�has_deadlockBs
z_ModuleLock.has_deadlockc	Cs�t��}|t|<z�|j�n|jdks.|j|krT||_|jd7_W5QR�W�VdS|��rhtd|��|j�	d�r�|j
d7_
W5QRX|j�	�|j��qW5t|=XdS)Nr�Tzdeadlock detected by %rF)rr$r%rrrr)rr�acquirer �release�r"r(r
r
rr+Ns
z_ModuleLock.acquirec	Cslt��}|j�T|j|kr"td��|jd8_|jdkr^d|_|jr^|jd8_|j��W5QRXdS)N�cannot release un-acquired lockr*r)	rr$rr�RuntimeErrorrr rr,r-r
r
rr,gs

z_ModuleLock.releasecCsd�|jt|��S)Nz_ModuleLock({!r}) at {}��formatr�id�r"r
r
r�__repr__tsz_ModuleLock.__repr__N)rrrr#r)r+r,r4r
r
r
rr4s

rc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�_DummyModuleLockcCs||_d|_dSr)rrr!r
r
rr#|sz_DummyModuleLock.__init__cCs|jd7_dS)Nr*T)rr3r
r
rr+�sz_DummyModuleLock.acquirecCs$|jdkrtd��|jd8_dS)Nrr.r*)rr/r3r
r
rr,�s
z_DummyModuleLock.releasecCsd�|jt|��S)Nz_DummyModuleLock({!r}) at {}r0r3r
r
rr4�sz_DummyModuleLock.__repr__N)rrrr#r+r,r4r
r
r
rr5xsr5c@s$eZdZdd�Zdd�Zdd�ZdS)�_ModuleLockManagercCs||_d|_dSr)�_name�_lockr!r
r
rr#�sz_ModuleLockManager.__init__cCst|j�|_|j��dSr)�_get_module_lockr7r8r+r3r
r
r�	__enter__�sz_ModuleLockManager.__enter__cOs|j��dSr)r8r,)r"�args�kwargsr
r
r�__exit__�sz_ModuleLockManager.__exit__N)rrrr#r:r=r
r
r
rr6�sr6cCs�t��zjzt|�}Wntk
r0d}YnX|dkrptdkrLt|�}nt|�}|fdd�}t�	||�t|<W5t��X|S)NcSs0t��zt�|�|krt|=W5t��XdSr)�_imp�acquire_lock�release_lock�
_module_locksr&)�refrr
r
r�cb�s

z_get_module_lock.<locals>.cb)
r>r?r@rA�KeyErrorrr5r�_weakrefrB)rrrCr
r
rr9�s


r9cCs6t|�}z|��Wntk
r(Yn
X|��dSr)r9r+rr,)rrr
r
r�_lock_unlock_module�srFcOs
|||�Srr
)�fr;�kwdsr
r
r�_call_with_frames_removed�srIr*)�	verbositycGs6tjj|kr2|�d�sd|}t|j|�tjd�dS)N)�#zimport z# )�file)r�flags�verbose�
startswith�printr1�stderr)�messagerJr;r
r
r�_verbose_message�s
rScs�fdd�}t|��|S)Ncs&|tjkrtd�|�|d���||�S�Nz{!r} is not a built-in moduler)r�builtin_module_names�ImportErrorr1�r"�fullname��fxnr
r�_requires_builtin_wrapper�s


�z4_requires_builtin.<locals>._requires_builtin_wrapper�r)rZr[r
rYr�_requires_builtin�s
r]cs�fdd�}t|��|S)Ncs&t�|�std�|�|d���||�S�Nz{!r} is not a frozen moduler)r>�	is_frozenrVr1rWrYr
r�_requires_frozen_wrapper�s


�z2_requires_frozen.<locals>._requires_frozen_wrapperr\)rZr`r
rYr�_requires_frozen�s
racCs>t||�}|tjkr2tj|}t||�tj|St|�SdSr)�spec_from_loaderr�modules�_exec�_load)r"rX�spec�moduler
r
r�_load_module_shim�s




rhcCs�t|dd�}t|d�r8z|�|�WStk
r6YnXz
|j}Wntk
rVYnX|dk	rht|�Sz
|j}Wntk
r�d}YnXz
|j}Wn:tk
r�|dkr�d�	|�YSd�	||�YSYnXd�	||�SdS)N�
__loader__�module_repr�?�
<module {!r}>�<module {!r} ({!r})>�<module {!r} from {!r}>)
rrrj�	Exception�__spec__�AttributeError�_module_repr_from_specr�__file__r1)rg�loaderrfr�filenamer
r
r�_module_repr
s.




rvc@sneZdZdddd�dd�Zdd�Zdd�Zed	d
��Zejdd
��Zedd
��Z	edd��Z
e
jdd��Z
dS)�
ModuleSpecN)�origin�loader_state�
is_packagecCs6||_||_||_||_|r gnd|_d|_d|_dS�NF)rrtrxry�submodule_search_locations�
_set_fileattr�_cached)r"rrtrxryrzr
r
rr#VszModuleSpec.__init__cCsfd�|j�d�|j�g}|jdk	r4|�d�|j��|jdk	rP|�d�|j��d�|jjd�|��S)Nz	name={!r}zloader={!r}zorigin={!r}zsubmodule_search_locations={}z{}({})z, )	r1rrtrx�appendr|�	__class__r�join)r"r;r
r
rr4bs

�

�zModuleSpec.__repr__cCsj|j}zH|j|jkoL|j|jkoL|j|jkoL||jkoL|j|jkoL|j|jkWStk
rdYdSXdSr{)r|rrtrx�cached�has_locationrq)r"�other�smslr
r
r�__eq__ls
�
��
�
�zModuleSpec.__eq__cCs:|jdkr4|jdk	r4|jr4tdkr&t�t�|j�|_|jSr)r~rxr}�_bootstrap_external�NotImplementedError�_get_cachedr3r
r
rr�xs
zModuleSpec.cachedcCs
||_dSr)r~)r"r�r
r
rr��scCs$|jdkr|j�d�dS|jSdS)N�.r)r|r�
rpartitionr3r
r
r�parent�s
zModuleSpec.parentcCs|jSr)r}r3r
r
rr��szModuleSpec.has_locationcCst|�|_dSr)�boolr})r"�valuer
r
rr��s)rrrr#r4r��propertyr��setterr�r�r
r
r
rrw1s%�




rw�rxrzcCs�t|d�rJtdkrt�tj}|dkr0|||d�S|r8gnd}||||d�S|dkr�t|d�r�z|�|�}Wq�tk
r�d}Yq�Xnd}t||||d�S)N�get_filename)rt)rtr|rzFr�)rr�r��spec_from_file_locationrzrVrw)rrtrxrzr��searchr
r
rrb�s$
�
rbcCs8z
|j}Wntk
rYnX|dk	r,|S|j}|dkrZz
|j}Wntk
rXYnXz
|j}Wntk
r|d}YnX|dkr�|dkr�z
|j}Wq�tk
r�d}Yq�Xn|}z
|j}Wntk
r�d}YnXzt|j�}Wntk
�rd}YnXt	|||d�}|dk�r"dnd|_
||_||_|S)N�rxFT)
rprqrrirs�_ORIGIN�
__cached__�list�__path__rwr}r�r|)rgrtrxrfr�locationr�r|r
r
r�_spec_from_module�sH







r�F��overridecCs�|st|dd�dkr6z|j|_Wntk
r4YnX|sJt|dd�dkr�|j}|dkr�|jdk	r�tdkrnt�tj}|�	|�}|j|_
||_d|_z
||_Wntk
r�YnX|s�t|dd�dkr�z|j
|_Wntk
r�YnXz
||_Wntk
�rYnX|�s"t|dd�dk�rR|jdk	�rRz|j|_Wntk
�rPYnX|j�r�|�srt|dd�dk�r�z|j|_Wntk
�r�YnX|�s�t|dd�dk�r�|jdk	�r�z|j|_Wntk
�r�YnX|S)Nrri�__package__r�rsr�)rrrrqrtr|r�r��_NamespaceLoader�__new__�_pathrsrir�r�rpr�r�rxr�r�)rfrgr�rtr�r
r
r�_init_module_attrs�s`



r�cCsRd}t|jd�r|j�|�}nt|jd�r2td��|dkrDt|j�}t||�|S)N�
create_module�exec_modulezBloaders that define exec_module() must also define create_module())rrtr�rVrrr��rfrgr
r
r�module_from_spec%s

r�cCsj|jdkrdn|j}|jdkrB|jdkr2d�|�Sd�||j�Sn$|jrVd�||j�Sd�|j|j�SdS)Nrkrlrmrn�<module {!r} ({})>)rrxrtr1r�)rfrr
r
rrr6s


rrc
Cs�|j}t|���tj�|�|k	r6d�|�}t||d��zj|jdkrj|j	dkrZtd|jd��t
||dd�n4t
||dd�t|jd�s�|j�|�n|j�
|�W5tj�|j�}|tj|j<XW5QRX|S)Nzmodule {!r} not in sys.modulesr�missing loaderTr�r�)rr6rrcr&r1rV�poprtr|r�r�load_moduler�)rfrgr�msgr
r
rrdGs"



rdcCsz|j�|j�Wn4|jtjkr@tj�|j�}|tj|j<�YnXtj�|j�}|tj|j<t|dd�dkr�z|j|_Wntk
r�YnXt|dd�dkr�z(|j	|_
t|d�s�|j�d�d|_
Wntk
r�YnXt|dd�dk�rz
||_
Wntk
�rYnX|S)Nrir�r�r�rrp)rtr�rrrcr�rrirqrr�rr�rpr�r
r
r�_load_backward_compatiblees6

r�cCs�|jdk	rt|jd�st|�St|�}d|_z�|tj|j<z4|jdkr`|jdkrlt	d|jd��n|j�
|�Wn2ztj|j=Wntk
r�YnX�YnXtj�|j�}|tj|j<t
d|j|j�W5d|_X|S)Nr�TFr�rzimport {!r} # {!r})rtrr�r��
_initializingrrcrr|rVr�rDr�rSr�r
r
r�_load_unlocked�s.


r�c
Cs*t|j��t|�W5QR�SQRXdSr)r6rr�)rfr
r
rre�s	rec@s�eZdZedd��Zeddd��Zeddd��Zedd	��Zed
d��Z	ee
dd
���Zee
dd���Zee
dd���Z
ee�ZdS)�BuiltinImportercCsd�|j�S)Nz<module {!r} (built-in)>)r1r)rgr
r
rrj�szBuiltinImporter.module_reprNcCs,|dk	rdSt�|�r$t||dd�SdSdS)Nzbuilt-inr�)r>�
is_builtinrb��clsrX�path�targetr
r
r�	find_spec�s

zBuiltinImporter.find_speccCs|�||�}|dk	r|jSdSr)r�rt)r�rXr�rfr
r
r�find_module�s	zBuiltinImporter.find_modulecCs.|jtjkr"td�|j�|jd��ttj|�SrT)rrrUrVr1rIr>�create_builtin)r"rfr
r
rr��s
�zBuiltinImporter.create_modulecCsttj|�dSr)rIr>�exec_builtin)r"rgr
r
rr��szBuiltinImporter.exec_modulecCsdSrr
�r�rXr
r
r�get_code�szBuiltinImporter.get_codecCsdSrr
r�r
r
r�
get_source�szBuiltinImporter.get_sourcecCsdSr{r
r�r
r
rrzszBuiltinImporter.is_package)NN)N)rrr�staticmethodrj�classmethodr�r�r�r�r]r�r�rzrhr�r
r
r
rr��s(	


r�c@s�eZdZdZedd��Zeddd��Zeddd��Zed	d
��Z	edd��Z
ed
d��Zeedd���Z
eedd���Zeedd���ZdS)�FrozenImporter�frozencCsd�|jtj�S)Nr�)r1rr�r�)�mr
r
rrjszFrozenImporter.module_reprNcCs"t�|�rt|||jd�SdSdS)Nr�)r>r_rbr�r�r
r
rr� s
zFrozenImporter.find_speccCst�|�r|SdSr)r>r_)r�rXr�r
r
rr�'szFrozenImporter.find_modulecCsdSrr
)r�rfr
r
rr�0szFrozenImporter.create_modulecCs@|jj}t�|�s$td�|�|d��ttj|�}t||j	�dSr^)
rprr>r_rVr1rI�get_frozen_object�execr)rgr�coder
r
rr�4s

�zFrozenImporter.exec_modulecCs
t||�Sr)rhr�r
r
rr�=szFrozenImporter.load_modulecCs
t�|�Sr)r>r�r�r
r
rr�FszFrozenImporter.get_codecCsdSrr
r�r
r
rr�LszFrozenImporter.get_sourcecCs
t�|�Sr)r>�is_frozen_packager�r
r
rrzRszFrozenImporter.is_package)NN)N)rrrr�r�rjr�r�r�r�r�r�rar�r�rzr
r
r
rr�s,	



r�c@seZdZdd�Zdd�ZdS)�_ImportLockContextcCst��dSr)r>r?r3r
r
rr:_sz_ImportLockContext.__enter__cCst��dSr)r>r@)r"�exc_type�	exc_value�
exc_tracebackr
r
rr=csz_ImportLockContext.__exit__N)rrrr:r=r
r
r
rr�[sr�cCs@|�d|d�}t|�|kr$td��|d}|r<d�||�S|S)Nr�r*z2attempted relative import beyond top-level packager�{}.{})�rsplit�len�
ValueErrorr1)r�package�level�bits�baser
r
r�
_resolve_namehs
r�cCs"|�||�}|dkrdSt||�Sr)r�rb)�finderrr�rtr
r
r�_find_spec_legacyqsr�c

Cstj}|dkrtd��|s&t�dt�|tjk}|D]�}t��Tz
|j}Wn6t	k
r�t
|||�}|dkr|YW5QR�q4YnX||||�}W5QRX|dk	r4|�s�|tjk�r�tj|}z
|j}	Wnt	k
r�|YSX|	dkr�|S|	Sq4|Sq4dS)Nz5sys.meta_path is None, Python is likely shutting downzsys.meta_path is empty)r�	meta_pathrV�	_warnings�warn�
ImportWarningrcr�r�rqr�rp)
rr�r�r��	is_reloadr�r�rfrgrpr
r
r�
_find_speczs6





r�cCslt|t�std�t|����|dkr,td��|dkrTt|t�sHtd��n|sTtd��|sh|dkrhtd��dS)Nzmodule name must be str, not {}rzlevel must be >= 0z__package__ not set to a stringz6attempted relative import with no known parent packagezEmpty module name)�
isinstance�str�	TypeErrorr1rr�rV�rr�r�r
r
r�
_sanity_check�s


r�zNo module named z{!r}cCs�d}|�d�d}|r�|tjkr*t||�|tjkr>tj|Stj|}z
|j}Wn2tk
r�td�||�}t||d�d�YnXt	||�}|dkr�tt�|�|d��nt
|�}|r�tj|}t||�d�d|�|S)Nr�rz; {!r} is not a packager�)r�rrcrIr�rq�_ERR_MSGr1�ModuleNotFoundErrorr�r�r)r�import_r�r��
parent_moduler�rfrgr
r
r�_find_and_load_unlocked�s*







r�c
Csjt|��2tj�|t�}|tkr6t||�W5QR�SW5QRX|dkr^d�|�}t||d��t|�|S)Nz(import of {} halted; None in sys.modulesr)	r6rrcr&�_NEEDS_LOADINGr�r1r�rF)rr�rgrRr
r
r�_find_and_load�s
 �r�rcCs*t|||�|dkr t|||�}t|t�Sr)r�r�r��_gcd_importr�r
r
rr��s	r���	recursivecCs�|D]�}t|t�sB|r"|jd}nd}td|�dt|�j����q|dkrl|s�t|d�r�t||j|dd�qt||�sd	�|j|�}zt	||�Wqt
k
r�}z*|j|kr�tj
�|t�dk	r�WY�q�W5d}~XYqXq|S)
Nz.__all__z
``from list''zItem in z must be str, not �*�__all__Tr�r�)r�r�rr�rr�_handle_fromlistr�r1rIr�rrrcr&r�)rg�fromlistr�r��x�where�	from_name�excr
r
rr��s,


�

�r�cCs�|�d�}|�d�}|dk	rR|dk	rN||jkrNtjd|�d|j�d�tdd�|S|dk	r`|jStjdtdd�|d	}d
|kr�|�d�d}|S)
Nr�rpz __package__ != __spec__.parent (z != �)�)�
stacklevelzYcan't resolve package from __spec__ or __package__, falling back on __name__ and __path__rr�r�r)r&r�r�r�r�r�)�globalsr�rfr
r
r�_calc___package__s&

��r�r
c	Cs�|dkrt|�}n$|dk	r|ni}t|�}t|||�}|s�|dkrTt|�d�d�S|s\|St|�t|�d�d�}tj|jdt|j�|�Snt|d�r�t||t�S|SdS)Nrr�r�)	r�r��	partitionr�rrcrrr�)	rr��localsr�r�rg�globals_r��cut_offr
r
r�
__import__9s
 
r�cCs&t�|�}|dkrtd|��t|�S)Nzno built-in module named )r�r�rVr�)rrfr
r
r�_builtin_from_name^s
r�c
Cs�|a|att�}tj��D]H\}}t||�r|tjkr<t}nt�|�rt	}nqt
||�}t||�qtjt}dD].}|tjkr�t
|�}	n
tj|}	t|||	�qrdS)N)rr�rE)r>rrrc�itemsr�rUr�r_r�r�r�rr�r)
�
sys_module�_imp_module�module_typerrgrtrf�self_module�builtin_name�builtin_moduler
r
r�_setupes$	







rcCs&t||�tj�t�tj�t�dSr)rrr�rr�r�)r�r�r
r
r�_install�s
rcCs ddl}|a|�tjt�dSr)�_frozen_importlib_externalr�rrrcr)rr
r
r�_install_external_importers�sr)NN)N)Nr)NNr
r)1r�rrrAr%r/rrr5r6r9rFrIrSr]rarhrvrwrbr�r�r�rrrdr�r�rer�r�r�r�r�r�r��_ERR_MSG_PREFIXr�r��objectr�r�r�r�r�r�r�rrrr
r
r
r�<module>s\D%$e
-H%*IO
		
/
%
%#importlib/__pycache__/metadata.cpython-38.pyc000064400000050620151153537630015201 0ustar00U

e5d�D�
@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlmZddlmZddlmZddlmZddlmZddd	d
ddd
dddg
ZGdd	�d	e�ZGdd�de
�dd��ZGdd�dej�ZGdd�d�ZGdd�d�ZGdd�de�Z Gdd�d�Z!Gdd�d�Z"Gd d!�d!e �Z#Gd"d#�d#e�Z$d$d
�Z%d%d�Z&d&d�Z'd'd�Z(d(d�Z)d)d
�Z*d*d�Z+dS)+�N)�ConfigParser)�suppress)�
import_module)�MetaPathFinder)�starmap�Distribution�DistributionFinder�PackageNotFoundError�distribution�
distributions�entry_points�files�metadata�requires�versionc@seZdZdZdS)r	zThe package was not found.N)�__name__�
__module__�__qualname__�__doc__�rr�*/usr/lib64/python3.8/importlib/metadata.pyr	%sc@sVeZdZdZe�d�Zdd�Zedd��Z	e
dd��Ze
d	d
��Zdd�Z
d
d�ZdS)�
EntryPointz�An entry point as defined by Python packaging conventions.

    See `the packaging docs on entry points
    <https://packaging.python.org/specifications/entry-points/>`_
    for more information.
    zH(?P<module>[\w.]+)\s*(:\s*(?P<attr>[\w.]+)\s*)?((?P<extras>\[.*\])\s*)?$cCsD|j�|j�}t|�d��}td|�d�p,d�d��}t�t	||�S)z�Load the entry point from its definition. If only a module
        is indicated by the value, return that module. Otherwise,
        return the named object.
        �moduleN�attr��.)
�pattern�match�valuer�group�filter�split�	functools�reduce�getattr)�selfrr�attrsrrr�loadGszEntryPoint.loadcCs(|j�|j�}tt�d|�d�p"d��S)Nz\w+�extrasr)rrr�list�re�finditerr)r%rrrrr(QszEntryPoint.extrascs��fdd����D�S)Ncs,g|]$}��|�D]\}}�|||��qqSr��items)�.0r�namer��cls�configrr�
<listcomp>Xs�z+EntryPoint._from_config.<locals>.<listcomp>)�sectionsr0rr0r�_from_configVs�zEntryPoint._from_configcCsNtdd�}t|_z|�|�Wn$tk
rB|�t�|��YnXt�	|�S)N�=)Z
delimiters)
r�strZoptionxformZread_string�AttributeErrorZreadfp�io�StringIOrr5)r1�textr2rrr�
_from_text^s
zEntryPoint._from_textcCst|j|f�S)zO
        Supply iter so one may construct dicts of EntryPoints easily.
        )�iterr/�r%rrr�__iter__jszEntryPoint.__iter__cCs|j|j|j|jffS�N)�	__class__r/rrr>rrr�
__reduce__ps�zEntryPoint.__reduce__N)rrrrr*�compilerr'�propertyr(�classmethodr5r<r?rBrrrrr)s�



rZEntryPointBasezname value groupc@s*eZdZdZd
dd�Zdd�Zdd�Zd	S)�PackagePathz"A reference to a path in a package�utf-8c
Cs0|��j|d��}|��W5QR�SQRXdS)N��encoding��locate�open�read)r%rI�streamrrr�	read_textzszPackagePath.read_textc
Cs.|���d��}|��W5QR�SQRXdS)N�rbrJ)r%rNrrr�read_binary~szPackagePath.read_binarycCs|j�|�S)z'Return a path-like object for this path)�dist�locate_filer>rrrrK�szPackagePath.locateN)rG)rrrrrOrQrKrrrrrFws
rFc@seZdZdd�Zdd�ZdS)�FileHashcCs|�d�\|_}|_dS)Nr6)�	partition�moder)r%�spec�_rrr�__init__�szFileHash.__init__cCsd�|j|j�S)Nz<FileHash mode: {} value: {}>)�formatrVrr>rrr�__repr__�szFileHash.__repr__N)rrrrYr[rrrrrT�srTc@s�eZdZdZejdd��Zejdd��Zedd��Z	edd	��Z
ed
d��Zedd
��Z
edd��Zedd��Zedd��Zedd��Zdd�Zdd�Zedd��Zdd�Zdd�Zed d!��Zed"d#��Zed$d%��Zd&S)'rzA Python distribution package.cCsdS)z�Attempt to load metadata file given by the name.

        :param filename: The name of the file in the distribution info.
        :return: The text if found, otherwise None.
        Nr�r%�filenamerrrrO�szDistribution.read_textcCsdS)z[
        Given a path to a file in this distribution, return a path
        to it.
        Nr�r%�pathrrrrS�szDistribution.locate_filecCsD|��D].}|tj|d��}t|d�}|dk	r|Sqt|��dS)afReturn the Distribution for the given package name.

        :param name: The name of the distribution package to search for.
        :return: The Distribution instance (or subclass thereof) for the named
            package, if found.
        :raises PackageNotFoundError: When the named package's distribution
            metadata cannot be found.
        �r/N)�_discover_resolversr�Context�nextr	)r1r/�resolverZdistsrRrrr�	from_name�s


zDistribution.from_namecsJ|�dd���r|rtd���p*tjf|��tj��fdd�|��D��S)aReturn an iterable of Distribution objects for all packages.

        Pass a ``context`` or pass keyword arguments for constructing
        a context.

        :context: A ``DistributionFinder.Context`` object.
        :return: Iterable of Distribution objects for all packages.
        �contextNz cannot accept context and kwargsc3s|]}|��VqdSr@r)r.rd�rfrr�	<genexpr>�s�z(Distribution.discover.<locals>.<genexpr>)�pop�
ValueErrorrrb�	itertools�chain�
from_iterablera)r1�kwargsrrgr�discover�s
�zDistribution.discovercCstt�|��S)z�Return a Distribution for the indicated metadata path

        :param path: a string or path-like object
        :return: a concrete Distribution instance for the path
        )�PathDistribution�pathlib�Path)r_rrr�at�szDistribution.atcCsdd�tjD�}td|�S)z#Search the meta_path for resolvers.css|]}t|dd�VqdS)�find_distributionsN)r$)r.�finderrrrrh�s�z3Distribution._discover_resolvers.<locals>.<genexpr>N)�sys�	meta_pathr )Zdeclaredrrrra�s�z Distribution._discover_resolverscCs(|�d�p|�d�p|�d�}t�|�S)z�Return the parsed metadata for this Distribution.

        The returned object will have keys that name the various bits of
        metadata.  See PEP 566 for details.
        ZMETADATAzPKG-INFOr)rO�emailZmessage_from_string�r%r;rrrr�s
��zDistribution.metadatacCs
|jdS)z;Return the 'Version' metadata for the distribution package.ZVersion)rr>rrrr�szDistribution.versioncCst�|�d��S)Nzentry_points.txt)rr<rOr>rrrr�szDistribution.entry_pointscs6���p���}d�fdd�	}|o4tt|t�|���S)aBFiles in this distribution.

        :return: List of PackagePath for this distribution or None

        Result is `None` if the metadata file that enumerates files
        (i.e. RECORD for dist-info or SOURCES.txt for egg-info) is
        missing.
        Result may be empty if the metadata exists but is empty.
        Ncs6t|�}|rt|�nd|_|r&t|�nd|_�|_|Sr@)rFrT�hash�int�sizerR)r/rzZsize_str�resultr>rr�	make_file�s
z%Distribution.files.<locals>.make_file)NN)�_read_files_distinfo�_read_files_egginfor)r�csv�reader)r%Z
file_linesr~rr>rr
�szDistribution.filescCs|�d�}|o|��S)z*
        Read the lines of RECORD
        ZRECORD)rO�
splitlinesryrrrrs
z!Distribution._read_files_distinfocCs|�d�}|otdj|���S)z`
        SOURCES.txt might contain literal commas, so wrap each line
        in quotes.
        zSOURCES.txtz"{}")rO�maprZr�ryrrrr�s
z Distribution._read_files_egginfocCs|��p|��}|ot|�S)z6Generated requirements specified for this Distribution)�_read_dist_info_reqs�_read_egg_info_reqsr))r%ZreqsrrrrszDistribution.requirescCs|j�d�S)Nz
Requires-Dist)rZget_allr>rrrr�sz!Distribution._read_dist_info_reqscCs|�d�}|o|�|�S)Nzrequires.txt)rO�_deps_from_requires_text)r%�sourcerrrr� s
z Distribution._read_egg_info_reqscCs4|�|���}dd�t�|t�d��D�}|�|�S)NcSs&i|]\}}|ttt�d�|���qS)�line)r)r��operator�
itemgetter)r.�sectionZresultsrrr�
<dictcomp>'s�z9Distribution._deps_from_requires_text.<locals>.<dictcomp>r�)�_read_sectionsr�rk�groupbyr�r��%_convert_egg_info_reqs_to_simple_reqs)r1r�Z
section_pairsr4rrrr�$s
�z%Distribution._deps_from_requires_textccs<d}td|�D](}t�d|�}|r.|�d�}qt�VqdS)Nz	\[(.*)\]$�)r r*rr�locals)�linesr�r�Z
section_matchrrrr�.s
zDistribution._read_sectionsc#sBdd���fdd�}|��D] \}}|D]}|||�Vq(qdS)a�
        Historically, setuptools would solicit and store 'extra'
        requirements, including those with environment markers,
        in separate sections. More modern tools expect each
        dependency to be defined separately, with any relevant
        extras and environment markers attached directly to that
        requirement. This method converts the former to the
        latter. See _test_deps_from_requires_text for an example.
        cSs|odj|d�S)Nzextra == "{name}"r`)rZr`rrr�make_conditionCszJDistribution._convert_egg_info_reqs_to_simple_reqs.<locals>.make_conditioncsX|pd}|�d�\}}}|r,|r,dj|d�}ttd|�|�g��}|rTdd�|�SdS)Nr�:z({markers}))�markersz; z and )rUrZr)r �join)r�Zextra�sepr�Z
conditions�r�rr�parse_conditionFszKDistribution._convert_egg_info_reqs_to_simple_reqs.<locals>.parse_conditionNr,)r4r�r�ZdepsZdeprr�rr�8s
z2Distribution._convert_egg_info_reqs_to_simple_reqsN)rrrr�abc�abstractmethodrOrSrErero�staticmethodrsrarDrrrr
rr�rr�r�r�r�r�rrrrr�sB











	
	c@s2eZdZdZGdd�d�Zeje�fdd��ZdS)rzJ
    A MetaPathFinder capable of discovering installed distributions.
    c@s(eZdZdZdZdd�Zedd��ZdS)zDistributionFinder.Contextaw
        Keyword arguments presented by the caller to
        ``distributions()`` or ``Distribution.discover()``
        to narrow the scope of a search for distributions
        in all DistributionFinders.

        Each DistributionFinder may expect any parameters
        and should attempt to honor the canonical
        parameters defined below when appropriate.
        NcKst|��|�dSr@)�vars�update)r%rnrrrrYjsz#DistributionFinder.Context.__init__cCst|��dtj�S)z�
            The path that a distribution finder should search.

            Typically refers to Python package paths and defaults
            to ``sys.path``.
            r_)r��getrvr_r>rrrr_mszDistributionFinder.Context.path)rrrrr/rYrDr_rrrrrbXs
rbcCsdS)z�
        Find distributions.

        Return an iterable of all Distribution instances capable of
        loading the metadata for packages matching the ``context``,
        a DistributionFinder.Context instance.
        Nr)r%rfrrrrtwsz%DistributionFinder.find_distributionsN)rrrrrbr�r�rtrrrrrSsc@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�FastPathzF
    Micro-optimized class for searching a path for
    children.
    cCs||_tj�|���|_dSr@)�root�osr_�basename�lower�base)r%r�rrrrY�szFastPath.__init__cCst�|j|�Sr@)rqrrr�)r%�childrrr�joinpath�szFastPath.joinpathc
CsTtt��t�|jpd�W5QR�SQRXtt��|��W5QR�SQRXgS)Nr)r�	Exceptionr��listdirr��zip_childrenr>rrr�children�s

"
zFastPath.childrencCs2t�|j�}|j��}|j|_t�dd�|D��S)Ncss |]}|�tjd�dVqdS)r�rN)r!�	posixpathr�)r.r�rrrrh�s�z(FastPath.zip_children.<locals>.<genexpr>)�zipfilerrr�Znamelistr��dict�fromkeys)r%Zzip_path�namesrrrr��s

�zFastPath.zip_childrencCs&|j}||jkp$|�|j�o$|�d�S)N�.egg)r��versionless_egg_name�
startswith�prefix�endswith)r%�searchr�rrr�is_egg�s

�zFastPath.is_eggccsZ|��D]L}|��}||jksH|�|j�r6|�|j�sH|�|�r|dkr|�|�VqdS)Nzegg-info)	r�r��
exact_matchesr�r�r��suffixesr�r�)r%r/r�Zn_lowrrrr��s

�
���zFastPath.searchN)
rrrrrYr�r�r�r�r�rrrrr��s
r�c@s6eZdZdZdZdZdZdgdd�ZdZdd�Z	dS)�PreparedzE
    A prepared search for metadata on a possibly-named package.
    r)z
.dist-infoz	.egg-infoNrcsV|�_|dkrdS|���dd��_�jd�_�fdd��jD��_�jd�_dS)N�-rXcsg|]}�j|�qSr)�
normalized)r.�suffixr>rrr3�sz%Prepared.__init__.<locals>.<listcomp>r�)r/r��replacer�r�r�r�r�)r%r/rr>rrY�s
�zPrepared.__init__)
rrrrr�r�r�r�r�rYrrrrr��sr�c@s,eZdZee��fdd��Zedd��ZdS)�MetadataPathFindercCs|�|j|j�}tt|�S)a 
        Find distributions.

        Return an iterable of all Distribution instances capable of
        loading the metadata for packages matching ``context.name``
        (or all names if ``None`` indicated) along the paths in the list
        of directories ``context.path``.
        )�
_search_pathsr/r_r�rp)r1rf�foundrrrrt�s
z%MetadataPathFinder.find_distributionscs tj��fdd�tt|�D��S)z1Find metadata directories in paths heuristically.c3s|]}|�t���VqdSr@)r�r�)r.r_r`rrrh�s�z3MetadataPathFinder._search_paths.<locals>.<genexpr>)rkrlrmr�r�)r1r/�pathsrr`rr��s�z MetadataPathFinder._search_pathsN)rrrrErrbrtr�rrrrr��sr�c@s.eZdZdd�Zdd�Zejje_dd�ZdS)rpcCs
||_dS)z�Construct a distribution from a path to the metadata directory.

        :param path: A pathlib.Path or similar object supporting
                     .joinpath(), __div__, .parent, and .read_text().
        N)�_pathr^rrrrY�szPathDistribution.__init__c
Cs<tttttt��"|j�|�jdd�W5QR�SQRXdS)NrGrH)	r�FileNotFoundError�IsADirectoryError�KeyError�NotADirectoryError�PermissionErrorr�r�rOr\rrrrO�s
�zPathDistribution.read_textcCs|jj|Sr@)r��parentr^rrrrS�szPathDistribution.locate_fileN)rrrrYrOrrrSrrrrrp�s
rpcCs
t�|�S)z�Get the ``Distribution`` instance for the named package.

    :param distribution_name: The name of the distribution package as a string.
    :return: A ``Distribution`` instance (or subclass thereof).
    )rre�Zdistribution_namerrrr
�scKstjf|�S)z|Get all ``Distribution`` instances in the current environment.

    :return: An iterable of ``Distribution`` instances.
    )rro)rnrrrr�scCst�|�jS)z�Get the metadata for the named package.

    :param distribution_name: The name of the distribution package to query.
    :return: An email.Message containing the parsed metadata.
    )rrerr�rrrrscCs
t|�jS)z�Get the version string for the named package.

    :param distribution_name: The name of the distribution package to query.
    :return: The version string for the package as defined in the package's
        "Version" metadata key.
    )r
rr�rrrrscCsHtj�dd�t�D��}t�d�}t||d�}t�||�}dd�|D�S)zwReturn EntryPoint objects for all installed packages.

    :return: EntryPoint objects for all installed packages.
    css|]}|jVqdSr@)r)r.rRrrrrhszentry_points.<locals>.<genexpr>r)�keycSsi|]\}}|t|��qSr)�tuple)r.r�epsrrrr�s�z entry_points.<locals>.<dictcomp>)rkrlrmrr��
attrgetter�sortedr�)r�Zby_groupZorderedZgroupedrrrrs�
�cCs
t|�jS)z�Return a list of files for the named package.

    :param distribution_name: The name of the distribution package to query.
    :return: List of files composing the distribution.
    )r
r
r�rrrr
%scCs
t|�jS)z�
    Return a list of requirements for the named package.

    :return: An iterator of requirements, suitable for
    packaging.requirement.Requirement.
    )r
rr�rrrr.s),r9r�r*r�r�rvrxrqr�r�r"rkr��collectionsZconfigparserr�
contextlibr�	importlibr�
importlib.abcrr�__all__�ModuleNotFoundErrorr	�
namedtuplerZ
PurePosixPathrFrTrrr�r�r�rpr
rrrrr
rrrrr�<module>sb�

�NE/0		
	importlib/__pycache__/metadata.cpython-38.opt-2.pyc000064400000035411151153537630016142 0ustar00U

e5d�D�
@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlmZddlmZddlmZddlmZddlmZddd	d
ddd
dddg
ZGdd	�d	e�ZGdd�de
�dd��ZGdd�dej�ZGdd�d�ZGdd�d�ZGdd�de�Z Gdd�d�Z!Gdd�d�Z"Gd d!�d!e �Z#Gd"d#�d#e�Z$d$d
�Z%d%d�Z&d&d�Z'd'd�Z(d(d�Z)d)d
�Z*d*d�Z+dS)+�N)�ConfigParser)�suppress)�
import_module)�MetaPathFinder)�starmap�Distribution�DistributionFinder�PackageNotFoundError�distribution�
distributions�entry_points�files�metadata�requires�versionc@seZdZdS)r	N)�__name__�
__module__�__qualname__�rr�*/usr/lib64/python3.8/importlib/metadata.pyr	%sc@sReZdZe�d�Zdd�Zedd��Ze	dd��Z
e	dd	��Zd
d�Zdd
�Z
dS)�
EntryPointzH(?P<module>[\w.]+)\s*(:\s*(?P<attr>[\w.]+)\s*)?((?P<extras>\[.*\])\s*)?$cCsD|j�|j�}t|�d��}td|�d�p,d�d��}t�t	||�S)N�module�attr��.)
�pattern�match�valuer�group�filter�split�	functools�reduce�getattr)�selfrrZattrsrrr�loadGszEntryPoint.loadcCs(|j�|j�}tt�d|�d�p"d��S)Nz\w+�extrasr)rrr�list�re�finditerr)r$rrrrr&QszEntryPoint.extrascs��fdd����D�S)Ncs,g|]$}��|�D]\}}�|||��qqSr��items)�.0r�namer��cls�configrr�
<listcomp>Xs�z+EntryPoint._from_config.<locals>.<listcomp>)�sectionsr.rr.r�_from_configVs�zEntryPoint._from_configcCsNtdd�}t|_z|�|�Wn$tk
rB|�t�|��YnXt�	|�S)N�=)Z
delimiters)
r�strZoptionxformZread_string�AttributeErrorZreadfp�io�StringIOrr3)r/�textr0rrr�
_from_text^s
zEntryPoint._from_textcCst|j|f�S�N)�iterr-�r$rrr�__iter__jszEntryPoint.__iter__cCs|j|j|j|jffSr;)�	__class__r-rrr=rrr�
__reduce__ps�zEntryPoint.__reduce__N)rrrr(�compilerr%�propertyr&�classmethodr3r:r>r@rrrrr)s	�



rZEntryPointBasezname value groupc@s&eZdZd	dd�Zdd�Zdd�ZdS)
�PackagePath�utf-8c
Cs0|��j|d��}|��W5QR�SQRXdS)N��encoding��locate�open�read)r$rG�streamrrr�	read_textzszPackagePath.read_textc
Cs.|���d��}|��W5QR�SQRXdS)N�rbrH)r$rLrrr�read_binary~szPackagePath.read_binarycCs|j�|�Sr;)�dist�locate_filer=rrrrI�szPackagePath.locateN)rE)rrrrMrOrIrrrrrDws
rDc@seZdZdd�Zdd�ZdS)�FileHashcCs|�d�\|_}|_dS)Nr4)�	partition�moder)r$�spec�_rrr�__init__�szFileHash.__init__cCsd�|j|j�S)Nz<FileHash mode: {} value: {}>)�formatrTrr=rrr�__repr__�szFileHash.__repr__N)rrrrWrYrrrrrR�srRc@s�eZdZejdd��Zejdd��Zedd��Zedd��Z	e
d	d
��Ze
dd��Ze
d
d��Ze
dd��Ze
dd��Ze
dd��Zdd�Zdd�Ze
dd��Zdd�Zdd�Zedd ��Ze
d!d"��Ze
d#d$��Zd%S)&rcCsdSr;r�r$�filenamerrrrM�szDistribution.read_textcCsdSr;r�r$�pathrrrrQ�szDistribution.locate_filecCsD|��D].}|tj|d��}t|d�}|dk	r|Sqt|��dS)N�r-)�_discover_resolversr�Context�nextr	)r/r-�resolverZdistsrPrrr�	from_name�s


zDistribution.from_namecsJ|�dd���r|rtd���p*tjf|��tj��fdd�|��D��S)N�contextz cannot accept context and kwargsc3s|]}|��VqdSr;r)r,rb�rdrr�	<genexpr>�s�z(Distribution.discover.<locals>.<genexpr>)�pop�
ValueErrorrr`�	itertools�chain�
from_iterabler_)r/�kwargsrrer�discover�s
�zDistribution.discovercCstt�|��Sr;)�PathDistribution�pathlib�Path)r]rrr�at�szDistribution.atcCsdd�tjD�}td|�S)Ncss|]}t|dd�VqdS)�find_distributionsN)r#)r,�finderrrrrf�s�z3Distribution._discover_resolvers.<locals>.<genexpr>)�sys�	meta_pathr)Zdeclaredrrrr_�s�z Distribution._discover_resolverscCs(|�d�p|�d�p|�d�}t�|�S)NZMETADATAzPKG-INFOr)rM�emailZmessage_from_string�r$r9rrrr�s
��zDistribution.metadatacCs
|jdS)NZVersion)rr=rrrr�szDistribution.versioncCst�|�d��S)Nzentry_points.txt)rr:rMr=rrrr�szDistribution.entry_pointscs6���p���}d�fdd�	}|o4tt|t�|���S)Ncs6t|�}|rt|�nd|_|r&t|�nd|_�|_|Sr;)rDrR�hash�int�sizerP)r-rxZsize_str�resultr=rr�	make_file�s
z%Distribution.files.<locals>.make_file)NN)�_read_files_distinfo�_read_files_egginfor'r�csv�reader)r$Z
file_linesr|rr=rr
�szDistribution.filescCs|�d�}|o|��S)NZRECORD)rM�
splitlinesrwrrrr}s
z!Distribution._read_files_distinfocCs|�d�}|otdj|���S)NzSOURCES.txtz"{}")rM�maprXr�rwrrrr~s
z Distribution._read_files_egginfocCs|��p|��}|ot|�Sr;)�_read_dist_info_reqs�_read_egg_info_reqsr')r$ZreqsrrrrszDistribution.requirescCs|j�d�S)Nz
Requires-Dist)rZget_allr=rrrr�sz!Distribution._read_dist_info_reqscCs|�d�}|o|�|�S)Nzrequires.txt)rM�_deps_from_requires_text)r$�sourcerrrr� s
z Distribution._read_egg_info_reqscCs4|�|���}dd�t�|t�d��D�}|�|�S)NcSs&i|]\}}|ttt�d�|���qS)�line)r'r��operator�
itemgetter)r,�sectionZresultsrrr�
<dictcomp>'s�z9Distribution._deps_from_requires_text.<locals>.<dictcomp>r�)�_read_sectionsr�ri�groupbyr�r��%_convert_egg_info_reqs_to_simple_reqs)r/r�Z
section_pairsr2rrrr�$s
�z%Distribution._deps_from_requires_textccs<d}td|�D](}t�d|�}|r.|�d�}qt�VqdS)Nz	\[(.*)\]$�)rr(rr�locals)�linesr�r�Z
section_matchrrrr�.s
zDistribution._read_sectionsc#sBdd���fdd�}|��D] \}}|D]}|||�Vq(qdS)NcSs|odj|d�S)Nzextra == "{name}"r^)rXr^rrr�make_conditionCszJDistribution._convert_egg_info_reqs_to_simple_reqs.<locals>.make_conditioncsX|pd}|�d�\}}}|r,|r,dj|d�}ttd|�|�g��}|rTdd�|�SdS)Nr�:z({markers}))�markersz; z and )rSrXr'r�join)r�Zextra�sepr�Z
conditions�r�rr�parse_conditionFszKDistribution._convert_egg_info_reqs_to_simple_reqs.<locals>.parse_conditionr*)r2r�r�ZdepsZdeprr�rr�8s
z2Distribution._convert_egg_info_reqs_to_simple_reqsN)rrr�abc�abstractmethodrMrQrCrcrm�staticmethodrqr_rBrrrr
r}r~rr�r�r�r�r�rrrrr�s@











	
	c@s.eZdZGdd�d�Zeje�fdd��ZdS)rc@s$eZdZdZdd�Zedd��ZdS)zDistributionFinder.ContextNcKst|��|�dSr;)�vars�update)r$rlrrrrWjsz#DistributionFinder.Context.__init__cCst|��dtj�S)Nr])r��getrtr]r=rrrr]mszDistributionFinder.Context.path)rrrr-rWrBr]rrrrr`Xsr`cCsdSr;r)r$rdrrrrrwsz%DistributionFinder.find_distributionsN)rrrr`r�r�rrrrrrrSsc@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�FastPathcCs||_tj�|���|_dSr;)�root�osr]�basename�lower�base)r$r�rrrrW�szFastPath.__init__cCst�|j|�Sr;)rorpr�)r$�childrrr�joinpath�szFastPath.joinpathc
CsTtt��t�|jpd�W5QR�SQRXtt��|��W5QR�SQRXgS)Nr)r�	Exceptionr��listdirr��zip_childrenr=rrr�children�s

"
zFastPath.childrencCs2t�|j�}|j��}|j|_t�dd�|D��S)Ncss |]}|�tjd�dVqdS)r�rN)r �	posixpathr�)r,r�rrrrf�s�z(FastPath.zip_children.<locals>.<genexpr>)�zipfilerpr�Znamelistr��dict�fromkeys)r$Zzip_path�namesrrrr��s

�zFastPath.zip_childrencCs&|j}||jkp$|�|j�o$|�d�S)N�.egg)r��versionless_egg_name�
startswith�prefix�endswith)r$�searchr�rrr�is_egg�s

�zFastPath.is_eggccsZ|��D]L}|��}||jksH|�|j�r6|�|j�sH|�|�r|dkr|�|�VqdS)Nzegg-info)	r�r��
exact_matchesr�r�r��suffixesr�r�)r$r-r�Zn_lowrrrr��s

�
���zFastPath.searchN)	rrrrWr�r�r�r�r�rrrrr��s
r�c@s2eZdZdZdZdZdgdd�ZdZdd�ZdS)�Preparedr)z
.dist-infoz	.egg-infoNrcsV|�_|dkrdS|���dd��_�jd�_�fdd��jD��_�jd�_dS)N�-rVcsg|]}�j|�qSr)�
normalized)r,�suffixr=rrr1�sz%Prepared.__init__.<locals>.<listcomp>r�)r-r��replacer�r�r�r�r�)r$r-rr=rrW�s
�zPrepared.__init__)	rrrr�r�r�r�r�rWrrrrr��sr�c@s,eZdZee��fdd��Zedd��ZdS)�MetadataPathFindercCs|�|j|j�}tt|�Sr;)�
_search_pathsr-r]r�rn)r/rd�foundrrrrr�s
z%MetadataPathFinder.find_distributionscs tj��fdd�tt|�D��S)Nc3s|]}|�t���VqdSr;)r�r�)r,r]r^rrrf�s�z3MetadataPathFinder._search_paths.<locals>.<genexpr>)rirjrkr�r�)r/r-�pathsrr^rr��s�z MetadataPathFinder._search_pathsN)rrrrCrr`rrr�rrrrr��sr�c@s.eZdZdd�Zdd�Zejje_dd�ZdS)rncCs
||_dSr;)�_pathr\rrrrW�szPathDistribution.__init__c
Cs<tttttt��"|j�|�jdd�W5QR�SQRXdS)NrErF)	r�FileNotFoundError�IsADirectoryError�KeyError�NotADirectoryError�PermissionErrorr�r�rMrZrrrrM�s
�zPathDistribution.read_textcCs|jj|Sr;)r��parentr\rrrrQ�szPathDistribution.locate_fileN)rrrrWrMr�__doc__rQrrrrrn�s
rncCs
t�|�Sr;)rrc�Zdistribution_namerrrr
�scKstjf|�Sr;)rrm)rlrrrr�scCst�|�jSr;)rrcrr�rrrrscCs
t|�jSr;)r
rr�rrrrscCsHtj�dd�t�D��}t�d�}t||d�}t�||�}dd�|D�S)Ncss|]}|jVqdSr;)r)r,rPrrrrfszentry_points.<locals>.<genexpr>r)�keycSsi|]\}}|t|��qSr)�tuple)r,r�epsrrrr�s�z entry_points.<locals>.<dictcomp>)rirjrkrr��
attrgetter�sortedr�)r�Zby_groupZorderedZgroupedrrrrs�
�cCs
t|�jSr;)r
r
r�rrrr
%scCs
t|�jSr;)r
rr�rrrr.s),r7r�r(r�rrtrvror�r�r!rir��collectionsZconfigparserr�
contextlibr�	importlibr�
importlib.abcrr�__all__�ModuleNotFoundErrorr	�
namedtuplerZ
PurePosixPathrDrRrrr�r�r�rnr
rrrrr
rrrrr�<module>sb�

�NE/0		
	importlib/__pycache__/abc.cpython-38.opt-2.pyc000064400000015154151153537630015111 0ustar00U

e5dI2�
@s�ddlmZddlmZddlmZzddlZWn2ek
rbZzejdkrN�dZW5dZ[XYnXzddlZWn&ek
r�ZzeZW5dZ[XYnXddl	Z	ddl
Z
dd�ZGd	d
�d
e	jd�Z
Gdd
�d
e
�Zeeejejejej�Gdd�de
�Zeeej�Gdd�de	jd�ZGdd�de�ZGdd�de�Zeeejej�Gdd�de�Zeeej�Gdd�dejee�Zeeejej�Gdd�dejee�Zeeej�Gdd�de	jd�Zeeej�dS)�)�
_bootstrap)�_bootstrap_external)�	machinery�N�_frozen_importlibc	Gs\|D]R}|�|�tdk	rztt|j�}Wn tk
rJtt|j�}YnX|�|�qdS�N)�registerr�getattr�__name__�AttributeError�_frozen_importlib_external)�abstract_cls�classes�cls�
frozen_cls�r�%/usr/lib64/python3.8/importlib/abc.py�	_registers
rc@seZdZejddd��ZdS)�FinderNcCsdSrr)�self�fullname�pathrrr�find_module*szFinder.find_module)N)r
�
__module__�__qualname__�abc�abstractmethodrrrrrrsr)�	metaclassc@seZdZdd�Zdd�ZdS)�MetaPathFindercCs<tjdtdd�t|d�sdS|�||�}|dk	r8|jSdS)NzxMetaPathFinder.find_module() is deprecated since Python 3.4 in favor of MetaPathFinder.find_spec() (available since 3.4)���
stacklevel�	find_spec)�warnings�warn�DeprecationWarning�hasattrr"�loader)rrr�foundrrrr9s�
zMetaPathFinder.find_modulecCsdSrr�rrrr�invalidate_cachesNsz MetaPathFinder.invalidate_cachesN)r
rrrr*rrrrr2src@s"eZdZdd�ZejZdd�ZdS)�PathEntryFindercCs\tjdtdd�t|d�s"dgfS|�|�}|dk	rP|js@g}n|j}|j|fSdgfSdS)NzzPathEntryFinder.find_loader() is deprecated since Python 3.4 in favor of PathEntryFinder.find_spec() (available since 3.4)rr r")r#r$r%r&r"�submodule_search_locationsr')rrr(�portionsrrr�find_loader^s�


zPathEntryFinder.find_loadercCsdSrrr)rrrr*�sz!PathEntryFinder.invalidate_cachesN)r
rrr.r�_find_module_shimrr*rrrrr+Ws r+c@s$eZdZdd�Zdd�Zdd�ZdS)�LoadercCsdSrr)r�specrrr�
create_module�szLoader.create_modulecCst|d�st�t�||�S)N�exec_module)r&�ImportErrorr�_load_module_shim�rrrrr�load_module�s
zLoader.load_modulecCst�dSr)�NotImplementedError)r�modulerrr�module_repr�s
zLoader.module_reprN)r
rrr2r7r:rrrrr0�s
r0c@seZdZejdd��ZdS)�ResourceLoadercCst�dSr)�OSError�rrrrr�get_data�szResourceLoader.get_dataN)r
rrrrr>rrrrr;�s	r;c@sHeZdZdd�Zdd�Zejdd��Zeddd	��Z	e
jjZe
jj
Z
d
S)�
InspectLoadercCst�dSr�r4r6rrr�
is_package�szInspectLoader.is_packagecCs |�|�}|dkrdS|�|�Sr)�
get_source�source_to_code)rr�sourcerrr�get_code�s
zInspectLoader.get_codecCst�dSrr@r6rrrrB�szInspectLoader.get_source�<string>cCst||ddd�S)N�execT)�dont_inherit)�compile)�datarrrrrC�szInspectLoader.source_to_codeN)rF)r
rrrArErrrB�staticmethodrCr�
_LoaderBasicsr3r7rrrrr?�s	

r?c@s"eZdZejdd��Zdd�ZdS)�ExecutionLoadercCst�dSrr@r6rrr�get_filenameszExecutionLoader.get_filenamecCsT|�|�}|dkrdSz|�|�}Wntk
rB|�|�YSX|�||�SdSr)rBrNr4rC)rrrDrrrrrEs
zExecutionLoader.get_codeN)r
rrrrrNrErrrrrM�s	
rMc@seZdZdS)�
FileLoaderN)r
rrrrrrrO!srOc@s$eZdZdd�Zdd�Zdd�ZdS)�SourceLoadercCs$|jjtjkrt�t|�|�d�S�N�mtime)�
path_stats�__func__rPr<�intr=rrr�
path_mtime;szSourceLoader.path_mtimecCs |jjtjkrt�d|�|�iSrQ)rVrTrPr<r=rrrrSAszSourceLoader.path_statscCsdSrr)rrrJrrr�set_dataLszSourceLoader.set_dataN)r
rrrVrSrWrrrrrP*srPc@sDeZdZejdd��Zejdd��Zejdd��Zejdd��Zd	S)
�ResourceReadercCst�dSr��FileNotFoundError�r�resourcerrr�
open_resourcebs	zResourceReader.open_resourcecCst�dSrrYr[rrr�
resource_pathms
zResourceReader.resource_pathcCst�dSrrY)r�namerrr�is_resourceyszResourceReader.is_resourcecCsgSrrr)rrr�contents~szResourceReader.contentsN)	r
rrrrr]r^r`rarrrrrXYs	



rX)�rrrrr4�excr_rrr#r�ABCMetarr�BuiltinImporter�FrozenImporter�
PathFinder�WindowsRegistryFinderr+�
FileFinderr0r;r?rM�ExtensionFileLoaderrO�SourceFileLoader�SourcelessFileLoaderrPrXrrrr�<module>sJ
!�./2"�,+importlib/__pycache__/machinery.cpython-38.pyc000064400000001704151153537630015377 0ustar00U

e5dL�@s�dZddlZddlmZddlmZddlmZddlmZmZm	Z	m
Z
mZddlmZdd	lm
Z
dd
lmZddlmZddlmZdd
lmZdd�ZdS)z9The machinery of importlib: finders, loaders, hooks, etc.�N�)�
ModuleSpec)�BuiltinImporter)�FrozenImporter)�SOURCE_SUFFIXES�DEBUG_BYTECODE_SUFFIXES�OPTIMIZED_BYTECODE_SUFFIXES�BYTECODE_SUFFIXES�EXTENSION_SUFFIXES)�WindowsRegistryFinder)�
PathFinder)�
FileFinder)�SourceFileLoader)�SourcelessFileLoader)�ExtensionFileLoadercCstttS)zAReturns a list of all recognized module suffixes for this process)rr	r
�rr�+/usr/lib64/python3.8/importlib/machinery.py�all_suffixessr)�__doc__�_imp�
_bootstraprrr�_bootstrap_externalrrrr	r
rrr
rrrrrrrr�<module>simportlib/__pycache__/util.cpython-38.opt-1.pyc000064400000022116151153537630015334 0ustar00U

e5d7,�@s,dZddlmZddlmZddlmZddlmZddlmZddlm	Z	ddlm
Z
dd	lmZdd
lmZddlm
Z
ddlmZd
dlmZd
dlZd
dlZd
dlZd
dlZd
dlZdd�Zdd�Zd$dd�Zd%dd�Zedd��Zdd�Zdd�Zdd�ZGd d!�d!ej�ZGd"d#�d#ej �Z!dS)&z-Utility code for constructing importers, etc.�)�abc)�module_from_spec)�
_resolve_name)�spec_from_loader)�
_find_spec)�MAGIC_NUMBER)�_RAW_MAGIC_NUMBER)�cache_from_source)�
decode_source)�source_from_cache)�spec_from_file_location�)�contextmanagerNcCst�t|�S)zBReturn the hash of *source_bytes* as used in hash-based pyc files.)�_imp�source_hashr)�source_bytes�r�&/usr/lib64/python3.8/importlib/util.pyrsrcCs\|�d�s|S|s&tdt|��d���d}|D]}|dkr>qH|d7}q.t||d�||�S)z2Resolve a relative module name to an absolute one.�.zno package specified for z% (required for relative module names)r
rN)�
startswith�
ValueError�reprr)�name�package�level�	characterrrr�resolve_names

rcCsx|tjkrt||�Stj|}|dkr*dSz
|j}Wn$tk
rXtd�|��d�YnX|dkrptd�|���|SdS)a�Return the spec for the specified module.

    First, sys.modules is checked to see if the module was already imported. If
    so, then sys.modules[name].__spec__ is returned. If that happens to be
    set to None, then ValueError is raised. If the module is not in
    sys.modules, then sys.meta_path is searched for a suitable spec with the
    value of 'path' given to the finders. None is returned if no spec could
    be found.

    Dotted names do not have their parent packages implicitly imported. You will
    most likely need to explicitly import all parent packages in the proper
    order for a submodule to get the correct spec.

    N�{}.__spec__ is not set�{}.__spec__ is None)�sys�modulesr�__spec__�AttributeErrorr�format)r�path�module�specrrr�_find_spec_from_path*s



r'c	
Cs�|�d�rt||�n|}|tjkr�|�d�d}|r�t|dgd�}z
|j}Wq�tk
r�}ztd|�d|��|d�|�W5d}~XYq�Xnd}t	||�Stj|}|dkr�dSz
|j
}Wn$tk
r�td	�|��d�YnX|dkr�td
�|���|SdS)a�Return the spec for the specified module.

    First, sys.modules is checked to see if the module was already imported. If
    so, then sys.modules[name].__spec__ is returned. If that happens to be
    set to None, then ValueError is raised. If the module is not in
    sys.modules, then sys.meta_path is searched for a suitable spec with the
    value of 'path' given to the finders. None is returned if no spec could
    be found.

    If the name is for submodule (contains a dot), the parent module is
    automatically imported.

    The name and package arguments work the same as importlib.import_module().
    In other words, relative module names (with leading dots) work.

    rr
�__path__)�fromlistz __path__ attribute not found on z while trying to find )rNrr)
rrrr �
rpartition�
__import__r(r"�ModuleNotFoundErrorrr!rr#)	rr�fullname�parent_name�parent�parent_path�er%r&rrr�	find_specIs4

��


r2ccs�|tjk}tj�|�}|s6tt�|�}d|_|tj|<zJz
|VWn:tk
r||sxztj|=Wntk
rvYnXYnXW5d|_XdS)NTF)rr �get�type�__initializing__�	Exception�KeyError)r�	is_reloadr%rrr�_module_to_loadvs


r9cst����fdd��}|S)zOSet __package__ on the returned module.

    This function is deprecated.

    csRtjdtdd��||�}t|dd�dkrN|j|_t|d�sN|j�d�d|_|S)N�7The import system now takes care of this automatically.���
stacklevel�__package__r(rr
)�warnings�warn�DeprecationWarning�getattr�__name__r>�hasattrr*)�args�kwargsr%��fxnrr�set_package_wrapper�s�

z(set_package.<locals>.set_package_wrapper��	functools�wraps)rHrIrrGr�set_package�s	rMcst����fdd��}|S)zNSet __loader__ on the returned module.

    This function is deprecated.

    cs:tjdtdd��|f|�|�}t|dd�dkr6||_|S)Nr:r;r<�
__loader__)r?r@rArBrN)�selfrErFr%rGrr�set_loader_wrapper�s�z&set_loader.<locals>.set_loader_wrapperrJ)rHrPrrGr�
set_loader�srQcs*tjdtdd�t����fdd��}|S)a*Decorator to handle selecting the proper module for loaders.

    The decorated function is passed the module to use instead of the module
    name. The module passed in to the function is either from sys.modules if
    it already exists or is a new module. If the module is new, then __name__
    is set the first argument to the method, __loader__ is set to self, and
    __package__ is set accordingly (if self.is_package() is defined) will be set
    before it is passed to the decorated function (if self.is_package() does
    not work for the module it will be set post-load).

    If an exception is raised and the decorator created the module it is
    subsequently removed from sys.modules.

    The decorator assumes that the decorated function takes the module name as
    the second argument.

    r:r;r<c
s|t|��j}||_z|�|�}Wnttfk
r6YnX|rD||_n|�d�d|_�||f|�|�W5QR�SQRXdS)Nrr
)r9rN�
is_package�ImportErrorr"r>r*)rOr-rErFr%rRrGrr�module_for_loader_wrapper�s
z4module_for_loader.<locals>.module_for_loader_wrapper)r?r@rArKrL)rHrTrrGr�module_for_loader�s�rUc@s eZdZdZdd�Zdd�ZdS)�_LazyModulezKA subclass of the module type which triggers loading upon attribute access.c	Cs�tj|_|jj}|jjd}|jjd}|j}i}|��D]:\}}||krT|||<q:t||�t||�kr:|||<q:|jj	�
|�|tjkr�t|�ttj|�kr�t
d|�d���|j�|�t||�S)z8Trigger the load of the module and return the attribute.�__dict__�	__class__zmodule object for z. substituted in sys.modules during a lazy load)�types�
ModuleTyperXr!r�loader_staterW�items�id�loader�exec_modulerr r�updaterB)	rO�attr�
original_name�
attrs_then�
original_type�	attrs_now�
attrs_updated�key�valuerrr�__getattribute__�s"


z_LazyModule.__getattribute__cCs|�|�t||�dS)z/Trigger the load and then perform the deletion.N)ri�delattr)rOrarrr�__delattr__s
z_LazyModule.__delattr__N)rC�
__module__�__qualname__�__doc__rirkrrrrrV�s#rVc@s@eZdZdZedd��Zedd��Zdd�Zdd	�Z	d
d�Z
dS)
�
LazyLoaderzKA loader that creates a module which defers loading until attribute access.cCst|d�std��dS)Nr_z loader must define exec_module())rD�	TypeError)r^rrr�__check_eager_loaders
zLazyLoader.__check_eager_loadercs������fdd�S)z>Construct a callable which returns the eager loader made lazy.cs��||��S�Nr)rErF��clsr^rr�<lambda>�z$LazyLoader.factory.<locals>.<lambda>)�_LazyLoader__check_eager_loaderrsrrsr�factorys
zLazyLoader.factorycCs|�|�||_dSrr)rwr^)rOr^rrr�__init__s
zLazyLoader.__init__cCs|j�|�Srr)r^�
create_module)rOr&rrrrzszLazyLoader.create_modulecCs@|j|j_|j|_i}|j��|d<|j|d<||j_t|_dS)zMake the module load lazily.rWrXN)r^r!rNrW�copyrXr[rV)rOr%r[rrrr_ s

zLazyLoader.exec_moduleN)rCrlrmrn�staticmethodrw�classmethodrxryrzr_rrrrro
s

ro)N)N)"rn�r�
_bootstraprrrr�_bootstrap_externalrrr	r
rr�
contextlibrrrKrrYr?rrr'r2r9rMrQrUrZrV�Loaderrorrrr�<module>s8

-
'/importlib/__pycache__/resources.cpython-38.opt-2.pyc000064400000012057151153537630016375 0ustar00U

e5d@%�	@s�ddlZddlZddlmZddlmZmZddlm	Z	ddl
mZddlm
Z
mZddlmZdd	lmZdd
lmZmZmZmZmZddlmZddlmZmZdd
lmZdddddddddg	Zee efZ!ee ej"fZ#ed�dd�Z$e d�dd�Z%eeej&d�dd�Z'dd �Z(e!e#ed!�d"d�Z)d-e!e#e e ed%�d&d�Z*e!e#e+d!�d'd�Z,d.e!e#e e e d%�d(d�Z-ee!e#eed!�d)d��Z.e!e e/d*�d+d�Z0e!ee d�d,d�Z1dS)/�N�)�abc)�contextmanager�suppress)�
import_module)�ResourceLoader)�BytesIO�
TextIOWrapper)�Path)�
ModuleType)�Iterable�Iterator�Optional�Set�Union)�cast)�BinaryIO�TextIO)�ZipImportError�Package�Resource�contents�is_resource�open_binary�	open_text�path�read_binary�	read_text)�returncCs\t|d�r0|jjdkr*td�|jj���qX|Sn(t|�}|jjdkrTtd�|���n|SdS)N�__spec__z{!r} is not a package)�hasattrr�submodule_search_locations�	TypeError�format�namer)�package�module�r'�+/usr/lib64/python3.8/importlib/resources.py�_get_package"s
�r)cCs,tj�|�\}}|r$td�|���n|SdS)Nz{!r} must be only a file name)�osr�split�
ValueErrorr#)r�parent�	file_namer'r'r(�_normalize_path6sr/)r%rcCs,|j}t|jd�r(ttj|j�|j��SdS)N�get_resource_reader)rr �loaderr�
resources_abc�ResourceReaderr0r$)r%�specr'r'r(�_get_resource_readerBs�r5cCs&|jjdks|jjs"td|����dS)NzPackage has no location )r�origin�has_location�FileNotFoundError)r%r'r'r(�_check_locationPsr9)r%�resourcerc
Cs�t|�}t|�}t|�}|dk	r*|�|�St|�tj�|jj	�}tj�
|�}tj�||�}zt|dd�WSt
k
r�tt|jj�}d}t|jjd�r�tt
��|�|�}W5QRX|dkr�|jj}d�||�}	t|	��nt|�YSYnXdS)N�rb)�mode�get_data�{!r} resource not found in {!r})r/r)r5�
open_resourcer9r*r�abspathrr6�dirname�join�open�OSErrorrrr1r rr=r$r#r8r)
r%r:�reader�absolute_package_path�package_path�	full_pathr1�data�package_name�messager'r'r(rUs2

�
�utf-8�strict)r%r:�encoding�errorsrcCs
t|�}t|�}t|�}|dk	r2t|�|�||�St|�tj�|j	j
�}tj�|�}tj�||�}zt
|d||d�WStk
�rtt|j	j�}d}	t|j	jd�r�tt��|�|�}	W5QRX|	dkr�|j	j}
d�||
�}t|��ntt|	�||�YSYnXdS)N�r)r<rNrOr=r>)r/r)r5r	r?r9r*rr@rr6rArBrCrDrrr1r rr=r$r#r8r)r%r:rNrOrErFrGrHr1rIrJrKr'r'r(rts2
�
c
Cs:t|�}t|�}t||��}|��W5QR�SQRXdS�N)r/r)r�read)r%r:�fpr'r'r(r�sc
Cs>t|�}t|�}t||||��}|��W5QR�SQRXdSrQ)r/r)rrR)r%r:rNrOrSr'r'r(r�s	c	cst|�}t|�}t|�}|dk	rNzt|�|��VWdStk
rJYqVXnt|�d}|jjdk	r|t|jj�j	}||}|dk	r�|�
�r�|Vnxt||��}|��}W5QRXt
��\}}z$t�||�t�|�t|�VW5zt�|�Wntk
�rYnXXdSrQ)r/r)r5r
�
resource_pathr8r9rr6r-�existsrrR�tempfileZmkstempr*�remove�write�close)	r%r:rEZ	file_path�package_directoryrSrI�fdZraw_pathr'r'r(r�s6

)r%r$rc	Cs|t|�}t|�t|�}|dk	r*|�|�Sztt|��}Wnttfk
rTYdSX||krbdSt|j	j
�j|}|��S)NF)
r)r/r5r�setr�NotADirectoryErrorr8r
rr6r-�is_file)r%r$rEZpackage_contentsrr'r'r(r�s
cCsTt|�}t|�}|dk	r |��S|jjdks4|jjs8dSt|jj�j}t�	|�SdS)Nr')
r)r5rrr6r7r
r-r*�listdir)r%rErZr'r'r(r�s)rLrM)rLrM)2r*rV�rr2�
contextlibrr�	importlibr�
importlib.abcr�iorr	�pathlibr
�typesr�typingrr
rrrrZ	typing.iorrZ	zipimportr�__all__�strr�PathLikerr)r/r3r5r9rr�bytesrrr�boolrrr'r'r'r(�<module>sh�

�!��"
��.importlib/__pycache__/__init__.cpython-38.opt-2.pyc000064400000006011151153537630016113 0ustar00U

e5d��@sfddddgZddlZddlZzddlZWn,ek
rTddlmZe�ee�Yn@Xde_d	e_	ze
�d
d�e_
Wnek
r�YnXeej
d<zddlZWn0ek
r�ddlmZe�e�ee_YnBXd
e_d	e_	ze
�d
d�e_
Wnek
�rYnXeej
d
<ejZejZddlZddlZddlmZdd�Zddd�Zddd�ZiZdd�ZdS)�
__import__�
import_module�invalidate_caches�reload�N�)�
_bootstrapzimportlib._bootstrap�	importlibz__init__.pyz
_bootstrap.py)�_bootstrap_externalzimportlib._bootstrap_externalz_bootstrap_external.py)rcCs"tjD]}t|d�r|��qdS)Nr)�sys�	meta_path�hasattrr)�finder�r�*/usr/lib64/python3.8/importlib/__init__.pyrBs

cCs�tjdtdd�z.tj|j}|dkr6td�|���n|WSWn6tk
rRYn$t	k
rttd�|��d�YnXt
�||�}|dkr�dS|jdkr�|j
dkr�td�|�|d��td|d��|jS)	NzDDeprecated since Python 3.4. Use importlib.util.find_spec() instead.�)�
stacklevelz{}.__loader__ is Nonez{}.__loader__ is not setzspec for {} missing loader��namez&namespace packages do not have loaders)�warnings�warn�DeprecationWarningr
�modules�
__loader__�
ValueError�format�KeyError�AttributeErrorr�
_find_spec�loader�submodule_search_locations�ImportError)r�pathr�specrrr�find_loaderJs2�



��r#cCsXd}|�d�rB|s$d}t|�|���|D]}|dkr8qB|d7}q(t�||d�||�S)Nr�.zHthe 'package' argument is required to perform a relative import for {!r}r)�
startswith�	TypeErrorrr�_gcd_import)r�package�level�msg�	characterrrrrms

cCsP|rt|tj�std��z|jj}Wntk
r>|j}YnXtj	�
|�|k	rfd}t|�|�|d��|t
krvt
|S|t
|<z�|�d�d}|r�ztj	|}Wn,tk
r�d}t|�|�|d�d�Yq�X|j}nd}|}t�|||�}|_|dk�rtd|��|d��t�||�tj	|W�Sz
t
|=Wntk
�rHYnXXdS)Nz"reload() argument must be a modulezmodule {} not in sys.modulesrr$rzparent {!r} not in sys.moduleszspec not found for the module )�
isinstance�types�
ModuleTyper&�__spec__rr�__name__r
r�getr r�
_RELOADINGr�
rpartition�__path__rr�ModuleNotFoundError�_exec)�modulerr*�parent_name�parent�pkgpath�targetr"rrrr�sH
��

)N)N)�__all__�_impr
�_frozen_importlibrr ��_setupr0�__package__�__file__�replace�	NameErrorr�_frozen_importlib_externalr	�_pack_uint32�_unpack_uint32r-rrrr#rr2rrrrr�<module>sJ




#
importlib/__pycache__/util.cpython-38.pyc000064400000022116151153537630014375 0ustar00U

e5d7,�@s,dZddlmZddlmZddlmZddlmZddlmZddlm	Z	ddlm
Z
dd	lmZdd
lmZddlm
Z
ddlmZd
dlmZd
dlZd
dlZd
dlZd
dlZd
dlZdd�Zdd�Zd$dd�Zd%dd�Zedd��Zdd�Zdd�Zdd�ZGd d!�d!ej�ZGd"d#�d#ej �Z!dS)&z-Utility code for constructing importers, etc.�)�abc)�module_from_spec)�
_resolve_name)�spec_from_loader)�
_find_spec)�MAGIC_NUMBER)�_RAW_MAGIC_NUMBER)�cache_from_source)�
decode_source)�source_from_cache)�spec_from_file_location�)�contextmanagerNcCst�t|�S)zBReturn the hash of *source_bytes* as used in hash-based pyc files.)�_imp�source_hashr)�source_bytes�r�&/usr/lib64/python3.8/importlib/util.pyrsrcCs\|�d�s|S|s&tdt|��d���d}|D]}|dkr>qH|d7}q.t||d�||�S)z2Resolve a relative module name to an absolute one.�.zno package specified for z% (required for relative module names)r
rN)�
startswith�
ValueError�reprr)�name�package�level�	characterrrr�resolve_names

rcCsx|tjkrt||�Stj|}|dkr*dSz
|j}Wn$tk
rXtd�|��d�YnX|dkrptd�|���|SdS)a�Return the spec for the specified module.

    First, sys.modules is checked to see if the module was already imported. If
    so, then sys.modules[name].__spec__ is returned. If that happens to be
    set to None, then ValueError is raised. If the module is not in
    sys.modules, then sys.meta_path is searched for a suitable spec with the
    value of 'path' given to the finders. None is returned if no spec could
    be found.

    Dotted names do not have their parent packages implicitly imported. You will
    most likely need to explicitly import all parent packages in the proper
    order for a submodule to get the correct spec.

    N�{}.__spec__ is not set�{}.__spec__ is None)�sys�modulesr�__spec__�AttributeErrorr�format)r�path�module�specrrr�_find_spec_from_path*s



r'c	
Cs�|�d�rt||�n|}|tjkr�|�d�d}|r�t|dgd�}z
|j}Wq�tk
r�}ztd|�d|��|d�|�W5d}~XYq�Xnd}t	||�Stj|}|dkr�dSz
|j
}Wn$tk
r�td	�|��d�YnX|dkr�td
�|���|SdS)a�Return the spec for the specified module.

    First, sys.modules is checked to see if the module was already imported. If
    so, then sys.modules[name].__spec__ is returned. If that happens to be
    set to None, then ValueError is raised. If the module is not in
    sys.modules, then sys.meta_path is searched for a suitable spec with the
    value of 'path' given to the finders. None is returned if no spec could
    be found.

    If the name is for submodule (contains a dot), the parent module is
    automatically imported.

    The name and package arguments work the same as importlib.import_module().
    In other words, relative module names (with leading dots) work.

    rr
�__path__)�fromlistz __path__ attribute not found on z while trying to find )rNrr)
rrrr �
rpartition�
__import__r(r"�ModuleNotFoundErrorrr!rr#)	rr�fullname�parent_name�parent�parent_path�er%r&rrr�	find_specIs4

��


r2ccs�|tjk}tj�|�}|s6tt�|�}d|_|tj|<zJz
|VWn:tk
r||sxztj|=Wntk
rvYnXYnXW5d|_XdS)NTF)rr �get�type�__initializing__�	Exception�KeyError)r�	is_reloadr%rrr�_module_to_loadvs


r9cst����fdd��}|S)zOSet __package__ on the returned module.

    This function is deprecated.

    csRtjdtdd��||�}t|dd�dkrN|j|_t|d�sN|j�d�d|_|S)N�7The import system now takes care of this automatically.���
stacklevel�__package__r(rr
)�warnings�warn�DeprecationWarning�getattr�__name__r>�hasattrr*)�args�kwargsr%��fxnrr�set_package_wrapper�s�

z(set_package.<locals>.set_package_wrapper��	functools�wraps)rHrIrrGr�set_package�s	rMcst����fdd��}|S)zNSet __loader__ on the returned module.

    This function is deprecated.

    cs:tjdtdd��|f|�|�}t|dd�dkr6||_|S)Nr:r;r<�
__loader__)r?r@rArBrN)�selfrErFr%rGrr�set_loader_wrapper�s�z&set_loader.<locals>.set_loader_wrapperrJ)rHrPrrGr�
set_loader�srQcs*tjdtdd�t����fdd��}|S)a*Decorator to handle selecting the proper module for loaders.

    The decorated function is passed the module to use instead of the module
    name. The module passed in to the function is either from sys.modules if
    it already exists or is a new module. If the module is new, then __name__
    is set the first argument to the method, __loader__ is set to self, and
    __package__ is set accordingly (if self.is_package() is defined) will be set
    before it is passed to the decorated function (if self.is_package() does
    not work for the module it will be set post-load).

    If an exception is raised and the decorator created the module it is
    subsequently removed from sys.modules.

    The decorator assumes that the decorated function takes the module name as
    the second argument.

    r:r;r<c
s|t|��j}||_z|�|�}Wnttfk
r6YnX|rD||_n|�d�d|_�||f|�|�W5QR�SQRXdS)Nrr
)r9rN�
is_package�ImportErrorr"r>r*)rOr-rErFr%rRrGrr�module_for_loader_wrapper�s
z4module_for_loader.<locals>.module_for_loader_wrapper)r?r@rArKrL)rHrTrrGr�module_for_loader�s�rUc@s eZdZdZdd�Zdd�ZdS)�_LazyModulezKA subclass of the module type which triggers loading upon attribute access.c	Cs�tj|_|jj}|jjd}|jjd}|j}i}|��D]:\}}||krT|||<q:t||�t||�kr:|||<q:|jj	�
|�|tjkr�t|�ttj|�kr�t
d|�d���|j�|�t||�S)z8Trigger the load of the module and return the attribute.�__dict__�	__class__zmodule object for z. substituted in sys.modules during a lazy load)�types�
ModuleTyperXr!r�loader_staterW�items�id�loader�exec_modulerr r�updaterB)	rO�attr�
original_name�
attrs_then�
original_type�	attrs_now�
attrs_updated�key�valuerrr�__getattribute__�s"


z_LazyModule.__getattribute__cCs|�|�t||�dS)z/Trigger the load and then perform the deletion.N)ri�delattr)rOrarrr�__delattr__s
z_LazyModule.__delattr__N)rC�
__module__�__qualname__�__doc__rirkrrrrrV�s#rVc@s@eZdZdZedd��Zedd��Zdd�Zdd	�Z	d
d�Z
dS)
�
LazyLoaderzKA loader that creates a module which defers loading until attribute access.cCst|d�std��dS)Nr_z loader must define exec_module())rD�	TypeError)r^rrr�__check_eager_loaders
zLazyLoader.__check_eager_loadercs������fdd�S)z>Construct a callable which returns the eager loader made lazy.cs��||��S�Nr)rErF��clsr^rr�<lambda>�z$LazyLoader.factory.<locals>.<lambda>)�_LazyLoader__check_eager_loaderrsrrsr�factorys
zLazyLoader.factorycCs|�|�||_dSrr)rwr^)rOr^rrr�__init__s
zLazyLoader.__init__cCs|j�|�Srr)r^�
create_module)rOr&rrrrzszLazyLoader.create_modulecCs@|j|j_|j|_i}|j��|d<|j|d<||j_t|_dS)zMake the module load lazily.rWrXN)r^r!rNrW�copyrXr[rV)rOr%r[rrrr_ s

zLazyLoader.exec_moduleN)rCrlrmrn�staticmethodrw�classmethodrxryrzr_rrrrro
s

ro)N)N)"rn�r�
_bootstraprrrr�_bootstrap_externalrrr	r
rr�
contextlibrrrKrrYr?rrr'r2r9rMrQrUrZrV�Loaderrorrrr�<module>s8

-
'/importlib/__pycache__/machinery.cpython-38.opt-2.pyc000064400000001470151153537630016337 0ustar00U

e5dL�@s�ddlZddlmZddlmZddlmZddlmZmZmZm	Z	m
Z
ddlmZddlmZdd	lm
Z
dd
lmZddlmZddlmZd
d�ZdS)�N�)�
ModuleSpec)�BuiltinImporter)�FrozenImporter)�SOURCE_SUFFIXES�DEBUG_BYTECODE_SUFFIXES�OPTIMIZED_BYTECODE_SUFFIXES�BYTECODE_SUFFIXES�EXTENSION_SUFFIXES)�WindowsRegistryFinder)�
PathFinder)�
FileFinder)�SourceFileLoader)�SourcelessFileLoader)�ExtensionFileLoadercCstttS)N)rr	r
�rr�+/usr/lib64/python3.8/importlib/machinery.py�all_suffixessr)�_imp�
_bootstraprrr�_bootstrap_externalrrrr	r
rrr
rrrrrrrr�<module>simportlib/__pycache__/__init__.cpython-38.pyc000064400000007260151153537630015162 0ustar00U

e5d��@sjdZddddgZddlZddlZzddlZWn,ek
rXddlmZe�ee�Yn@Xd	e_	d
e_
ze�dd�e_Wne
k
r�YnXeejd	<zddlZWn0ek
r�dd
lmZe�e�ee_YnBXde_	d
e_
ze�dd�e_Wne
k
�r
YnXeejd<ejZejZddlZddlZddlmZdd�Zddd�Zddd�ZiZdd�ZdS)z'A pure Python implementation of import.�
__import__�
import_module�invalidate_caches�reload�N�)�
_bootstrapzimportlib._bootstrap�	importlibz__init__.pyz
_bootstrap.py)�_bootstrap_externalzimportlib._bootstrap_externalz_bootstrap_external.py)rcCs"tjD]}t|d�r|��qdS)zmCall the invalidate_caches() method on all meta path finders stored in
    sys.meta_path (where implemented).rN)�sys�	meta_path�hasattrr)�finder�r�*/usr/lib64/python3.8/importlib/__init__.pyrBs

cCs�tjdtdd�z.tj|j}|dkr6td�|���n|WSWn6tk
rRYn$t	k
rttd�|��d�YnXt
�||�}|dkr�dS|jdkr�|j
dkr�td�|�|d��td	|d��|jS)
z�Return the loader for the specified module.

    This is a backward-compatible wrapper around find_spec().

    This function is deprecated in favor of importlib.util.find_spec().

    zDDeprecated since Python 3.4. Use importlib.util.find_spec() instead.�)�
stacklevelNz{}.__loader__ is Nonez{}.__loader__ is not setzspec for {} missing loader��namez&namespace packages do not have loaders)�warnings�warn�DeprecationWarningr
�modules�
__loader__�
ValueError�format�KeyError�AttributeErrorr�
_find_spec�loader�submodule_search_locations�ImportError)r�pathr�specrrr�find_loaderJs2�



��r#cCsXd}|�d�rB|s$d}t|�|���|D]}|dkr8qB|d7}q(t�||d�||�S)z�Import a module.

    The 'package' argument is required when performing a relative import. It
    specifies the package to use as the anchor point from which to resolve the
    relative import to an absolute import.

    r�.zHthe 'package' argument is required to perform a relative import for {!r}rN)�
startswith�	TypeErrorrr�_gcd_import)r�package�level�msg�	characterrrrrms

cCsP|rt|tj�std��z|jj}Wntk
r>|j}YnXtj	�
|�|k	rfd}t|�|�|d��|t
krvt
|S|t
|<z�|�d�d}|r�ztj	|}Wn,tk
r�d}t|�|�|d�d�Yq�X|j}nd}|}t�|||�}|_|dk�rtd|��|d��t�||�tj	|W�Sz
t
|=Wntk
�rHYnXXdS)	zcReload the module and return it.

    The module must have been successfully imported before.

    z"reload() argument must be a modulezmodule {} not in sys.modulesrr$rzparent {!r} not in sys.modulesNzspec not found for the module )�
isinstance�types�
ModuleTyper&�__spec__rr�__name__r
r�getr r�
_RELOADINGr�
rpartition�__path__rr�ModuleNotFoundError�_exec)�modulerr*�parent_name�parent�pkgpath�targetr"rrrr�sH
��

)N)N)�__doc__�__all__�_impr
�_frozen_importlibrr ��_setupr0�__package__�__file__�replace�	NameErrorr�_frozen_importlib_externalr	�_pack_uint32�_unpack_uint32r-rrrr#rr2rrrrr�<module>sL




#
importlib/__pycache__/machinery.cpython-38.opt-1.pyc000064400000001704151153537630016336 0ustar00U

e5dL�@s�dZddlZddlmZddlmZddlmZddlmZmZm	Z	m
Z
mZddlmZdd	lm
Z
dd
lmZddlmZddlmZdd
lmZdd�ZdS)z9The machinery of importlib: finders, loaders, hooks, etc.�N�)�
ModuleSpec)�BuiltinImporter)�FrozenImporter)�SOURCE_SUFFIXES�DEBUG_BYTECODE_SUFFIXES�OPTIMIZED_BYTECODE_SUFFIXES�BYTECODE_SUFFIXES�EXTENSION_SUFFIXES)�WindowsRegistryFinder)�
PathFinder)�
FileFinder)�SourceFileLoader)�SourcelessFileLoader)�ExtensionFileLoadercCstttS)zAReturns a list of all recognized module suffixes for this process)rr	r
�rr�+/usr/lib64/python3.8/importlib/machinery.py�all_suffixessr)�__doc__�_imp�
_bootstraprrr�_bootstrap_externalrrrr	r
rrr
rrrrrrrr�<module>simportlib/__pycache__/abc.cpython-38.opt-1.pyc000064400000032407151153537630015110 0ustar00U

e5dI2�
@s�dZddlmZddlmZddlmZzddlZWn2ek
rfZzejdkrR�dZW5dZ[XYnXzddl	Z	Wn&ek
r�ZzeZ	W5dZ[XYnXddl
Z
ddlZdd	�ZGd
d�de
j
d�ZGd
d�de�Zeeejejejej�Gdd�de�Zeeej�Gdd�de
j
d�ZGdd�de�ZGdd�de�Zeeejej�Gdd�de�Zeeej�Gdd�dejee�Zeeejej�Gdd�dejee�Zeeej�Gdd�de
j
d�Zeeej�dS)z(Abstract base classes related to import.�)�
_bootstrap)�_bootstrap_external)�	machinery�N�_frozen_importlibc	Gs\|D]R}|�|�tdk	rztt|j�}Wn tk
rJtt|j�}YnX|�|�qdS)N)�registerr�getattr�__name__�AttributeError�_frozen_importlib_external)�abstract_cls�classes�cls�
frozen_cls�r�%/usr/lib64/python3.8/importlib/abc.py�	_registers
rc@s eZdZdZejddd��ZdS)�Findera<Legacy abstract base class for import finders.

    It may be subclassed for compatibility with legacy third party
    reimplementations of the import system.  Otherwise, finder
    implementations should derive from the more specific MetaPathFinder
    or PathEntryFinder ABCs.

    Deprecated since Python 3.3
    NcCsdS)z�An abstract method that should find a module.
        The fullname is a str and the optional path is a str or None.
        Returns a Loader object or None.
        Nr)�self�fullname�pathrrr�find_module*szFinder.find_module)N)r	�
__module__�__qualname__�__doc__�abc�abstractmethodrrrrrrs
r)�	metaclassc@s eZdZdZdd�Zdd�ZdS)�MetaPathFinderz8Abstract base class for import finders on sys.meta_path.cCs<tjdtdd�t|d�sdS|�||�}|dk	r8|jSdS)a_Return a loader for the module.

        If no module is found, return None.  The fullname is a str and
        the path is a list of strings or None.

        This method is deprecated since Python 3.4 in favor of
        finder.find_spec(). If find_spec() exists then backwards-compatible
        functionality is provided for this method.

        zxMetaPathFinder.find_module() is deprecated since Python 3.4 in favor of MetaPathFinder.find_spec() (available since 3.4)���
stacklevel�	find_specN)�warnings�warn�DeprecationWarning�hasattrr"�loader)rrr�foundrrrr9s�
zMetaPathFinder.find_modulecCsdS)z�An optional method for clearing the finder's cache, if any.
        This method is used by importlib.invalidate_caches().
        Nr�rrrr�invalidate_cachesNsz MetaPathFinder.invalidate_cachesN)r	rrrrr*rrrrr2src@s&eZdZdZdd�ZejZdd�ZdS)�PathEntryFinderz>Abstract base class for path entry finders used by PathFinder.cCs\tjdtdd�t|d�s"dgfS|�|�}|dk	rP|js@g}n|j}|j|fSdgfSdS)a[Return (loader, namespace portion) for the path entry.

        The fullname is a str.  The namespace portion is a sequence of
        path entries contributing to part of a namespace package. The
        sequence may be empty.  If loader is not None, the portion will
        be ignored.

        The portion will be discarded if another path entry finder
        locates the module as a normal module or package.

        This method is deprecated since Python 3.4 in favor of
        finder.find_spec(). If find_spec() is provided than backwards-compatible
        functionality is provided.
        zzPathEntryFinder.find_loader() is deprecated since Python 3.4 in favor of PathEntryFinder.find_spec() (available since 3.4)rr r"N)r#r$r%r&r"�submodule_search_locationsr')rrr(�portionsrrr�find_loader^s�


zPathEntryFinder.find_loadercCsdS)z�An optional method for clearing the finder's cache, if any.
        This method is used by PathFinder.invalidate_caches().
        Nrr)rrrr*�sz!PathEntryFinder.invalidate_cachesN)	r	rrrr.r�_find_module_shimrr*rrrrr+Ws r+c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�Loaderz'Abstract base class for import loaders.cCsdS)z�Return a module to initialize and into which to load.

        This method should raise ImportError if anything prevents it
        from creating a new module.  It may return None to indicate
        that the spec should create the new module.
        Nr)r�specrrr�
create_module�szLoader.create_modulecCst|d�st�t�||�S)a�Return the loaded module.

        The module must be added to sys.modules and have import-related
        attributes set properly.  The fullname is a str.

        ImportError is raised on failure.

        This method is deprecated in favor of loader.exec_module(). If
        exec_module() exists then it is used to provide a backwards-compatible
        functionality for this method.

        �exec_module)r&�ImportErrorr�_load_module_shim�rrrrr�load_module�s
zLoader.load_modulecCst�dS)z�Return a module's repr.

        Used by the module type when the method does not raise
        NotImplementedError.

        This method is deprecated.

        N)�NotImplementedError)r�modulerrr�module_repr�s
zLoader.module_reprN)r	rrrr2r7r:rrrrr0�s
r0c@seZdZdZejdd��ZdS)�ResourceLoaderz�Abstract base class for loaders which can return data from their
    back-end storage.

    This ABC represents one of the optional protocols specified by PEP 302.

    cCst�dS)zwAbstract method which when implemented should return the bytes for
        the specified path.  The path must be a str.N)�OSError�rrrrr�get_data�szResourceLoader.get_dataN)r	rrrrrr>rrrrr;�sr;c@sLeZdZdZdd�Zdd�Zejdd��Ze	dd	d
��Z
ejj
Z
ejjZdS)
�
InspectLoaderz�Abstract base class for loaders which support inspection about the
    modules they can load.

    This ABC represents one of the optional protocols specified by PEP 302.

    cCst�dS)z�Optional method which when implemented should return whether the
        module is a package.  The fullname is a str.  Returns a bool.

        Raises ImportError if the module cannot be found.
        N�r4r6rrr�
is_package�szInspectLoader.is_packagecCs |�|�}|dkrdS|�|�S)aMethod which returns the code object for the module.

        The fullname is a str.  Returns a types.CodeType if possible, else
        returns None if a code object does not make sense
        (e.g. built-in module). Raises ImportError if the module cannot be
        found.
        N)�
get_source�source_to_code)rr�sourcerrr�get_code�s
zInspectLoader.get_codecCst�dS)z�Abstract method which should return the source code for the
        module.  The fullname is a str.  Returns a str.

        Raises ImportError if the module cannot be found.
        Nr@r6rrrrB�szInspectLoader.get_source�<string>cCst||ddd�S)z�Compile 'data' into a code object.

        The 'data' argument can be anything that compile() can handle. The'path'
        argument should be where the data was retrieved (when applicable).�execT)�dont_inherit)�compile)�datarrrrrC�szInspectLoader.source_to_codeN)rF)r	rrrrArErrrB�staticmethodrCr�
_LoaderBasicsr3r7rrrrr?�s

r?c@s&eZdZdZejdd��Zdd�ZdS)�ExecutionLoaderz�Abstract base class for loaders that wish to support the execution of
    modules as scripts.

    This ABC represents one of the optional protocols specified in PEP 302.

    cCst�dS)z�Abstract method which should return the value that __file__ is to be
        set to.

        Raises ImportError if the module cannot be found.
        Nr@r6rrr�get_filenameszExecutionLoader.get_filenamecCsT|�|�}|dkrdSz|�|�}Wntk
rB|�|�YSX|�||�SdS)z�Method to return the code object for fullname.

        Should return None if not applicable (e.g. built-in module).
        Raise ImportError if the module cannot be found.
        N)rBrNr4rC)rrrDrrrrrEs
zExecutionLoader.get_codeN)r	rrrrrrNrErrrrrM�s
rMc@seZdZdZdS)�
FileLoaderz[Abstract base class partially implementing the ResourceLoader and
    ExecutionLoader ABCs.N)r	rrrrrrrrO!srOc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�SourceLoadera�Abstract base class for loading source code (and optionally any
    corresponding bytecode).

    To support loading from source code, the abstractmethods inherited from
    ResourceLoader and ExecutionLoader need to be implemented. To also support
    loading from bytecode, the optional methods specified directly by this ABC
    is required.

    Inherited abstractmethods not implemented in this ABC:

        * ResourceLoader.get_data
        * ExecutionLoader.get_filename

    cCs$|jjtjkrt�t|�|�d�S)z6Return the (int) modification time for the path (str).�mtime)�
path_stats�__func__rPr<�intr=rrr�
path_mtime;szSourceLoader.path_mtimecCs |jjtjkrt�d|�|�iS)aReturn a metadata dict for the source pointed to by the path (str).
        Possible keys:
        - 'mtime' (mandatory) is the numeric timestamp of last source
          code modification;
        - 'size' (optional) is the size in bytes of the source code.
        rQ)rUrSrPr<r=rrrrRAszSourceLoader.path_statscCsdS)aWrite the bytes to the path (if possible).

        Accepts a str path and data as bytes.

        Any needed intermediary directories are to be created. If for some
        reason the file cannot be written because of permissions, fail
        silently.
        Nr)rrrJrrr�set_dataLszSourceLoader.set_dataN)r	rrrrUrRrVrrrrrP*srPc@sHeZdZdZejdd��Zejdd��Zejdd��Zejdd	��Z	d
S)�ResourceReaderz�Abstract base class to provide resource-reading support.

    Loaders that support resource reading are expected to implement
    the ``get_resource_reader(fullname)`` method and have it either return None
    or an object compatible with this ABC.
    cCst�dS)aReturn an opened, file-like object for binary reading.

        The 'resource' argument is expected to represent only a file name
        and thus not contain any subdirectory components.

        If the resource cannot be found, FileNotFoundError is raised.
        N��FileNotFoundError�r�resourcerrr�
open_resourcebs	zResourceReader.open_resourcecCst�dS)a!Return the file system path to the specified resource.

        The 'resource' argument is expected to represent only a file name
        and thus not contain any subdirectory components.

        If the resource does not exist on the file system, raise
        FileNotFoundError.
        NrXrZrrr�
resource_pathms
zResourceReader.resource_pathcCst�dS)z7Return True if the named 'name' is consider a resource.NrX)r�namerrr�is_resourceyszResourceReader.is_resourcecCsgS)z?Return an iterable of strings over the contents of the package.rr)rrr�contents~szResourceReader.contentsN)
r	rrrrrr\r]r_r`rrrrrWYs



rW) r�rrrrr4�excr^rrr#r�ABCMetarr�BuiltinImporter�FrozenImporter�
PathFinder�WindowsRegistryFinderr+�
FileFinderr0r;r?rM�ExtensionFileLoaderrO�SourceFileLoader�SourcelessFileLoaderrPrWrrrr�<module>sL
!�./2"�,+importlib/__pycache__/resources.cpython-38.opt-1.pyc000064400000014560151153537630016375 0ustar00U

e5d@%�	@s�ddlZddlZddlmZddlmZmZddlm	Z	ddl
mZddlm
Z
mZddlmZdd	lmZdd
lmZmZmZmZmZddlmZddlmZmZdd
lmZdddddddddg	Zee efZ!ee ej"fZ#ed�dd�Z$e d�dd�Z%eeej&d�dd�Z'dd �Z(e!e#ed!�d"d�Z)d-e!e#e e ed%�d&d�Z*e!e#e+d!�d'd�Z,d.e!e#e e e d%�d(d�Z-ee!e#eed!�d)d��Z.e!e e/d*�d+d�Z0e!ee d�d,d�Z1dS)/�N�)�abc)�contextmanager�suppress)�
import_module)�ResourceLoader)�BytesIO�
TextIOWrapper)�Path)�
ModuleType)�Iterable�Iterator�Optional�Set�Union)�cast)�BinaryIO�TextIO)�ZipImportError�Package�Resource�contents�is_resource�open_binary�	open_text�path�read_binary�	read_text)�returncCs\t|d�r0|jjdkr*td�|jj���qX|Sn(t|�}|jjdkrTtd�|���n|SdS)z�Take a package name or module object and return the module.

    If a name, the module is imported.  If the passed or imported module
    object is not a package, raise an exception.
    �__spec__Nz{!r} is not a package)�hasattrr�submodule_search_locations�	TypeError�format�namer)�package�module�r'�+/usr/lib64/python3.8/importlib/resources.py�_get_package"s
�r)cCs,tj�|�\}}|r$td�|���n|SdS)z�Normalize a path by ensuring it is a string.

    If the resulting string contains path separators, an exception is raised.
    z{!r} must be only a file nameN)�osr�split�
ValueErrorr#)r�parent�	file_namer'r'r(�_normalize_path6sr/)r%rcCs,|j}t|jd�r(ttj|j�|j��SdS)N�get_resource_reader)rr �loaderr�
resources_abc�ResourceReaderr0r$)r%�specr'r'r(�_get_resource_readerBs�r5cCs&|jjdks|jjs"td|����dS)NzPackage has no location )r�origin�has_location�FileNotFoundError)r%r'r'r(�_check_locationPsr9)r%�resourcerc
Cs�t|�}t|�}t|�}|dk	r*|�|�St|�tj�|jj	�}tj�
|�}tj�||�}zt|dd�WSt
k
r�tt|jj�}d}t|jjd�r�tt
��|�|�}W5QRX|dkr�|jj}d�||�}	t|	��nt|�YSYnXdS)zDReturn a file-like object opened for binary reading of the resource.N�rb)�mode�get_data�{!r} resource not found in {!r})r/r)r5�
open_resourcer9r*r�abspathrr6�dirname�join�open�OSErrorrrr1r rr=r$r#r8r)
r%r:�reader�absolute_package_path�package_path�	full_pathr1�data�package_name�messager'r'r(rUs2

�
�utf-8�strict)r%r:�encoding�errorsrcCs
t|�}t|�}t|�}|dk	r2t|�|�||�St|�tj�|j	j
�}tj�|�}tj�||�}zt
|d||d�WStk
�rtt|j	j�}d}	t|j	jd�r�tt��|�|�}	W5QRX|	dkr�|j	j}
d�||
�}t|��ntt|	�||�YSYnXdS)zBReturn a file-like object opened for text reading of the resource.N�r)r<rNrOr=r>)r/r)r5r	r?r9r*rr@rr6rArBrCrDrrr1r rr=r$r#r8r)r%r:rNrOrErFrGrHr1rIrJrKr'r'r(rts2
�
c
Cs:t|�}t|�}t||��}|��W5QR�SQRXdS)z+Return the binary contents of the resource.N)r/r)r�read)r%r:�fpr'r'r(r�sc
Cs>t|�}t|�}t||||��}|��W5QR�SQRXdS)z�Return the decoded string of the resource.

    The decoding-related arguments have the same semantics as those of
    bytes.decode().
    N)r/r)rrQ)r%r:rNrOrRr'r'r(r�s	c	cst|�}t|�}t|�}|dk	rNzt|�|��VWdStk
rJYqVXnt|�d}|jjdk	r|t|jj�j	}||}|dk	r�|�
�r�|Vnxt||��}|��}W5QRXt
��\}}z$t�||�t�|�t|�VW5zt�|�Wntk
�rYnXXdS)akA context manager providing a file path object to the resource.

    If the resource does not already exist on its own on the file system,
    a temporary file will be created. If the file was created, the file
    will be deleted upon exiting the context manager (no exception is
    raised if the file was deleted prior to the context manager
    exiting).
    N)r/r)r5r
�
resource_pathr8r9rr6r-�existsrrQ�tempfileZmkstempr*�remove�write�close)	r%r:rEZ	file_path�package_directoryrRrI�fdZraw_pathr'r'r(r�s6

)r%r$rc	Cs|t|�}t|�t|�}|dk	r*|�|�Sztt|��}Wnttfk
rTYdSX||krbdSt|j	j
�j|}|��S)zYTrue if 'name' is a resource inside 'package'.

    Directories are *not* resources.
    NF)
r)r/r5r�setr�NotADirectoryErrorr8r
rr6r-�is_file)r%r$rEZpackage_contentsrr'r'r(r�s
cCsTt|�}t|�}|dk	r |��S|jjdks4|jjs8dSt|jj�j}t�	|�SdS)z�Return an iterable of entries in 'package'.

    Note that not all entries are resources.  Specifically, directories are
    not considered resources.  Use `is_resource()` on each entry returned here
    to check if it is a resource or not.
    Nr')
r)r5rrr6r7r
r-r*�listdir)r%rErYr'r'r(r�s)rLrM)rLrM)2r*rU�rr2�
contextlibrr�	importlibr�
importlib.abcr�iorr	�pathlibr
�typesr�typingrr
rrrrZ	typing.iorrZ	zipimportr�__all__�strr�PathLikerr)r/r3r5r9rr�bytesrrr�boolrrr'r'r'r(�<module>sh�

�!��"
��.importlib/__pycache__/metadata.cpython-38.opt-1.pyc000064400000050620151153537630016140 0ustar00U

e5d�D�
@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlmZddlmZddlmZddlmZddlmZddd	d
ddd
dddg
ZGdd	�d	e�ZGdd�de
�dd��ZGdd�dej�ZGdd�d�ZGdd�d�ZGdd�de�Z Gdd�d�Z!Gdd�d�Z"Gd d!�d!e �Z#Gd"d#�d#e�Z$d$d
�Z%d%d�Z&d&d�Z'd'd�Z(d(d�Z)d)d
�Z*d*d�Z+dS)+�N)�ConfigParser)�suppress)�
import_module)�MetaPathFinder)�starmap�Distribution�DistributionFinder�PackageNotFoundError�distribution�
distributions�entry_points�files�metadata�requires�versionc@seZdZdZdS)r	zThe package was not found.N)�__name__�
__module__�__qualname__�__doc__�rr�*/usr/lib64/python3.8/importlib/metadata.pyr	%sc@sVeZdZdZe�d�Zdd�Zedd��Z	e
dd��Ze
d	d
��Zdd�Z
d
d�ZdS)�
EntryPointz�An entry point as defined by Python packaging conventions.

    See `the packaging docs on entry points
    <https://packaging.python.org/specifications/entry-points/>`_
    for more information.
    zH(?P<module>[\w.]+)\s*(:\s*(?P<attr>[\w.]+)\s*)?((?P<extras>\[.*\])\s*)?$cCsD|j�|j�}t|�d��}td|�d�p,d�d��}t�t	||�S)z�Load the entry point from its definition. If only a module
        is indicated by the value, return that module. Otherwise,
        return the named object.
        �moduleN�attr��.)
�pattern�match�valuer�group�filter�split�	functools�reduce�getattr)�selfrrZattrsrrr�loadGszEntryPoint.loadcCs(|j�|j�}tt�d|�d�p"d��S)Nz\w+�extrasr)rrr�list�re�finditerr)r%rrrrr'QszEntryPoint.extrascs��fdd����D�S)Ncs,g|]$}��|�D]\}}�|||��qqSr��items)�.0r�namer��cls�configrr�
<listcomp>Xs�z+EntryPoint._from_config.<locals>.<listcomp>)�sectionsr/rr/r�_from_configVs�zEntryPoint._from_configcCsNtdd�}t|_z|�|�Wn$tk
rB|�t�|��YnXt�	|�S)N�=)Z
delimiters)
r�strZoptionxformZread_string�AttributeErrorZreadfp�io�StringIOrr4)r0�textr1rrr�
_from_text^s
zEntryPoint._from_textcCst|j|f�S)zO
        Supply iter so one may construct dicts of EntryPoints easily.
        )�iterr.�r%rrr�__iter__jszEntryPoint.__iter__cCs|j|j|j|jffS�N)�	__class__r.rrr=rrr�
__reduce__ps�zEntryPoint.__reduce__N)rrrrr)�compilerr&�propertyr'�classmethodr4r;r>rArrrrr)s�



rZEntryPointBasezname value groupc@s*eZdZdZd
dd�Zdd�Zdd�Zd	S)�PackagePathz"A reference to a path in a package�utf-8c
Cs0|��j|d��}|��W5QR�SQRXdS)N��encoding��locate�open�read)r%rH�streamrrr�	read_textzszPackagePath.read_textc
Cs.|���d��}|��W5QR�SQRXdS)N�rbrI)r%rMrrr�read_binary~szPackagePath.read_binarycCs|j�|�S)z'Return a path-like object for this path)�dist�locate_filer=rrrrJ�szPackagePath.locateN)rF)rrrrrNrPrJrrrrrEws
rEc@seZdZdd�Zdd�ZdS)�FileHashcCs|�d�\|_}|_dS)Nr5)�	partition�moder)r%�spec�_rrr�__init__�szFileHash.__init__cCsd�|j|j�S)Nz<FileHash mode: {} value: {}>)�formatrUrr=rrr�__repr__�szFileHash.__repr__N)rrrrXrZrrrrrS�srSc@s�eZdZdZejdd��Zejdd��Zedd��Z	edd	��Z
ed
d��Zedd
��Z
edd��Zedd��Zedd��Zedd��Zdd�Zdd�Zedd��Zdd�Zdd�Zed d!��Zed"d#��Zed$d%��Zd&S)'rzA Python distribution package.cCsdS)z�Attempt to load metadata file given by the name.

        :param filename: The name of the file in the distribution info.
        :return: The text if found, otherwise None.
        Nr�r%�filenamerrrrN�szDistribution.read_textcCsdS)z[
        Given a path to a file in this distribution, return a path
        to it.
        Nr�r%�pathrrrrR�szDistribution.locate_filecCsD|��D].}|tj|d��}t|d�}|dk	r|Sqt|��dS)afReturn the Distribution for the given package name.

        :param name: The name of the distribution package to search for.
        :return: The Distribution instance (or subclass thereof) for the named
            package, if found.
        :raises PackageNotFoundError: When the named package's distribution
            metadata cannot be found.
        �r.N)�_discover_resolversr�Context�nextr	)r0r.�resolverZdistsrQrrr�	from_name�s


zDistribution.from_namecsJ|�dd���r|rtd���p*tjf|��tj��fdd�|��D��S)aReturn an iterable of Distribution objects for all packages.

        Pass a ``context`` or pass keyword arguments for constructing
        a context.

        :context: A ``DistributionFinder.Context`` object.
        :return: Iterable of Distribution objects for all packages.
        �contextNz cannot accept context and kwargsc3s|]}|��VqdSr?r)r-rc�rerr�	<genexpr>�s�z(Distribution.discover.<locals>.<genexpr>)�pop�
ValueErrorrra�	itertools�chain�
from_iterabler`)r0�kwargsrrfr�discover�s
�zDistribution.discovercCstt�|��S)z�Return a Distribution for the indicated metadata path

        :param path: a string or path-like object
        :return: a concrete Distribution instance for the path
        )�PathDistribution�pathlib�Path)r^rrr�at�szDistribution.atcCsdd�tjD�}td|�S)z#Search the meta_path for resolvers.css|]}t|dd�VqdS)�find_distributionsN)r$)r-�finderrrrrg�s�z3Distribution._discover_resolvers.<locals>.<genexpr>N)�sys�	meta_pathr )Zdeclaredrrrr`�s�z Distribution._discover_resolverscCs(|�d�p|�d�p|�d�}t�|�S)z�Return the parsed metadata for this Distribution.

        The returned object will have keys that name the various bits of
        metadata.  See PEP 566 for details.
        ZMETADATAzPKG-INFOr)rN�emailZmessage_from_string�r%r:rrrr�s
��zDistribution.metadatacCs
|jdS)z;Return the 'Version' metadata for the distribution package.ZVersion)rr=rrrr�szDistribution.versioncCst�|�d��S)Nzentry_points.txt)rr;rNr=rrrr�szDistribution.entry_pointscs6���p���}d�fdd�	}|o4tt|t�|���S)aBFiles in this distribution.

        :return: List of PackagePath for this distribution or None

        Result is `None` if the metadata file that enumerates files
        (i.e. RECORD for dist-info or SOURCES.txt for egg-info) is
        missing.
        Result may be empty if the metadata exists but is empty.
        Ncs6t|�}|rt|�nd|_|r&t|�nd|_�|_|Sr?)rErS�hash�int�sizerQ)r.ryZsize_str�resultr=rr�	make_file�s
z%Distribution.files.<locals>.make_file)NN)�_read_files_distinfo�_read_files_egginfor(r�csv�reader)r%Z
file_linesr}rr=rr
�szDistribution.filescCs|�d�}|o|��S)z*
        Read the lines of RECORD
        ZRECORD)rN�
splitlinesrxrrrr~s
z!Distribution._read_files_distinfocCs|�d�}|otdj|���S)z`
        SOURCES.txt might contain literal commas, so wrap each line
        in quotes.
        zSOURCES.txtz"{}")rN�maprYr�rxrrrrs
z Distribution._read_files_egginfocCs|��p|��}|ot|�S)z6Generated requirements specified for this Distribution)�_read_dist_info_reqs�_read_egg_info_reqsr()r%ZreqsrrrrszDistribution.requirescCs|j�d�S)Nz
Requires-Dist)rZget_allr=rrrr�sz!Distribution._read_dist_info_reqscCs|�d�}|o|�|�S)Nzrequires.txt)rN�_deps_from_requires_text)r%�sourcerrrr� s
z Distribution._read_egg_info_reqscCs4|�|���}dd�t�|t�d��D�}|�|�S)NcSs&i|]\}}|ttt�d�|���qS)�line)r(r��operator�
itemgetter)r-�sectionZresultsrrr�
<dictcomp>'s�z9Distribution._deps_from_requires_text.<locals>.<dictcomp>r�)�_read_sectionsr�rj�groupbyr�r��%_convert_egg_info_reqs_to_simple_reqs)r0r�Z
section_pairsr3rrrr�$s
�z%Distribution._deps_from_requires_textccs<d}td|�D](}t�d|�}|r.|�d�}qt�VqdS)Nz	\[(.*)\]$�)r r)rr�locals)�linesr�r�Z
section_matchrrrr�.s
zDistribution._read_sectionsc#sBdd���fdd�}|��D] \}}|D]}|||�Vq(qdS)a�
        Historically, setuptools would solicit and store 'extra'
        requirements, including those with environment markers,
        in separate sections. More modern tools expect each
        dependency to be defined separately, with any relevant
        extras and environment markers attached directly to that
        requirement. This method converts the former to the
        latter. See _test_deps_from_requires_text for an example.
        cSs|odj|d�S)Nzextra == "{name}"r_)rYr_rrr�make_conditionCszJDistribution._convert_egg_info_reqs_to_simple_reqs.<locals>.make_conditioncsX|pd}|�d�\}}}|r,|r,dj|d�}ttd|�|�g��}|rTdd�|�SdS)Nr�:z({markers}))�markersz; z and )rTrYr(r �join)r�Zextra�sepr�Z
conditions�r�rr�parse_conditionFszKDistribution._convert_egg_info_reqs_to_simple_reqs.<locals>.parse_conditionNr+)r3r�r�ZdepsZdeprr�rr�8s
z2Distribution._convert_egg_info_reqs_to_simple_reqsN)rrrr�abc�abstractmethodrNrRrDrdrn�staticmethodrrr`rCrrrr
r~rrr�r�r�r�r�rrrrr�sB











	
	c@s2eZdZdZGdd�d�Zeje�fdd��ZdS)rzJ
    A MetaPathFinder capable of discovering installed distributions.
    c@s(eZdZdZdZdd�Zedd��ZdS)zDistributionFinder.Contextaw
        Keyword arguments presented by the caller to
        ``distributions()`` or ``Distribution.discover()``
        to narrow the scope of a search for distributions
        in all DistributionFinders.

        Each DistributionFinder may expect any parameters
        and should attempt to honor the canonical
        parameters defined below when appropriate.
        NcKst|��|�dSr?)�vars�update)r%rmrrrrXjsz#DistributionFinder.Context.__init__cCst|��dtj�S)z�
            The path that a distribution finder should search.

            Typically refers to Python package paths and defaults
            to ``sys.path``.
            r^)r��getrur^r=rrrr^mszDistributionFinder.Context.path)rrrrr.rXrCr^rrrrraXs
racCsdS)z�
        Find distributions.

        Return an iterable of all Distribution instances capable of
        loading the metadata for packages matching the ``context``,
        a DistributionFinder.Context instance.
        Nr)r%rerrrrswsz%DistributionFinder.find_distributionsN)rrrrrar�r�rsrrrrrSsc@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�FastPathzF
    Micro-optimized class for searching a path for
    children.
    cCs||_tj�|���|_dSr?)�root�osr^�basename�lower�base)r%r�rrrrX�szFastPath.__init__cCst�|j|�Sr?)rprqr�)r%�childrrr�joinpath�szFastPath.joinpathc
CsTtt��t�|jpd�W5QR�SQRXtt��|��W5QR�SQRXgS)Nr)r�	Exceptionr��listdirr��zip_childrenr=rrr�children�s

"
zFastPath.childrencCs2t�|j�}|j��}|j|_t�dd�|D��S)Ncss |]}|�tjd�dVqdS)r�rN)r!�	posixpathr�)r-r�rrrrg�s�z(FastPath.zip_children.<locals>.<genexpr>)�zipfilerqr�Znamelistr��dict�fromkeys)r%Zzip_path�namesrrrr��s

�zFastPath.zip_childrencCs&|j}||jkp$|�|j�o$|�d�S)N�.egg)r��versionless_egg_name�
startswith�prefix�endswith)r%�searchr�rrr�is_egg�s

�zFastPath.is_eggccsZ|��D]L}|��}||jksH|�|j�r6|�|j�sH|�|�r|dkr|�|�VqdS)Nzegg-info)	r�r��
exact_matchesr�r�r��suffixesr�r�)r%r.r�Zn_lowrrrr��s

�
���zFastPath.searchN)
rrrrrXr�r�r�r�r�rrrrr��s
r�c@s6eZdZdZdZdZdZdgdd�ZdZdd�Z	dS)�PreparedzE
    A prepared search for metadata on a possibly-named package.
    r)z
.dist-infoz	.egg-infoNrcsV|�_|dkrdS|���dd��_�jd�_�fdd��jD��_�jd�_dS)N�-rWcsg|]}�j|�qSr)�
normalized)r-�suffixr=rrr2�sz%Prepared.__init__.<locals>.<listcomp>r�)r.r��replacer�r�r�r�r�)r%r.rr=rrX�s
�zPrepared.__init__)
rrrrr�r�r�r�r�rXrrrrr��sr�c@s,eZdZee��fdd��Zedd��ZdS)�MetadataPathFindercCs|�|j|j�}tt|�S)a 
        Find distributions.

        Return an iterable of all Distribution instances capable of
        loading the metadata for packages matching ``context.name``
        (or all names if ``None`` indicated) along the paths in the list
        of directories ``context.path``.
        )�
_search_pathsr.r^r�ro)r0re�foundrrrrs�s
z%MetadataPathFinder.find_distributionscs tj��fdd�tt|�D��S)z1Find metadata directories in paths heuristically.c3s|]}|�t���VqdSr?)r�r�)r-r^r_rrrg�s�z3MetadataPathFinder._search_paths.<locals>.<genexpr>)rjrkrlr�r�)r0r.�pathsrr_rr��s�z MetadataPathFinder._search_pathsN)rrrrDrrarsr�rrrrr��sr�c@s.eZdZdd�Zdd�Zejje_dd�ZdS)rocCs
||_dS)z�Construct a distribution from a path to the metadata directory.

        :param path: A pathlib.Path or similar object supporting
                     .joinpath(), __div__, .parent, and .read_text().
        N)�_pathr]rrrrX�szPathDistribution.__init__c
Cs<tttttt��"|j�|�jdd�W5QR�SQRXdS)NrFrG)	r�FileNotFoundError�IsADirectoryError�KeyError�NotADirectoryError�PermissionErrorr�r�rNr[rrrrN�s
�zPathDistribution.read_textcCs|jj|Sr?)r��parentr]rrrrR�szPathDistribution.locate_fileN)rrrrXrNrrrRrrrrro�s
rocCs
t�|�S)z�Get the ``Distribution`` instance for the named package.

    :param distribution_name: The name of the distribution package as a string.
    :return: A ``Distribution`` instance (or subclass thereof).
    )rrd�Zdistribution_namerrrr
�scKstjf|�S)z|Get all ``Distribution`` instances in the current environment.

    :return: An iterable of ``Distribution`` instances.
    )rrn)rmrrrr�scCst�|�jS)z�Get the metadata for the named package.

    :param distribution_name: The name of the distribution package to query.
    :return: An email.Message containing the parsed metadata.
    )rrdrr�rrrrscCs
t|�jS)z�Get the version string for the named package.

    :param distribution_name: The name of the distribution package to query.
    :return: The version string for the package as defined in the package's
        "Version" metadata key.
    )r
rr�rrrrscCsHtj�dd�t�D��}t�d�}t||d�}t�||�}dd�|D�S)zwReturn EntryPoint objects for all installed packages.

    :return: EntryPoint objects for all installed packages.
    css|]}|jVqdSr?)r)r-rQrrrrgszentry_points.<locals>.<genexpr>r)�keycSsi|]\}}|t|��qSr)�tuple)r-r�epsrrrr�s�z entry_points.<locals>.<dictcomp>)rjrkrlrr��
attrgetter�sortedr�)r�Zby_groupZorderedZgroupedrrrrs�
�cCs
t|�jS)z�Return a list of files for the named package.

    :param distribution_name: The name of the distribution package to query.
    :return: List of files composing the distribution.
    )r
r
r�rrrr
%scCs
t|�jS)z�
    Return a list of requirements for the named package.

    :return: An iterator of requirements, suitable for
    packaging.requirement.Requirement.
    )r
rr�rrrr.s),r8r�r)r�r�rurwrpr�r�r"rjr��collectionsZconfigparserr�
contextlibr�	importlibr�
importlib.abcrr�__all__�ModuleNotFoundErrorr	�
namedtuplerZ
PurePosixPathrErSrrr�r�r�ror
rrrrr
rrrrr�<module>sb�

�NE/0		
	importlib/_bootstrap_external.py000064400000200634151153537630013213 0ustar00"""Core implementation of path-based import.

This module is NOT meant to be directly imported! It has been designed such
that it can be bootstrapped into Python as the implementation of import. As
such it requires the injection of specific modules and attributes in order to
work. One should use importlib as the public-facing version of this module.

"""
# IMPORTANT: Whenever making changes to this module, be sure to run a top-level
# `make regen-importlib` followed by `make` in order to get the frozen version
# of the module updated. Not doing so will result in the Makefile to fail for
# all others who don't have a ./python around to freeze the module in the early
# stages of compilation.
#

# See importlib._setup() for what is injected into the global namespace.

# When editing this code be aware that code executed at import time CANNOT
# reference any injected objects! This includes not only global code but also
# anything specified at the class level.

# Import builtin modules
import _imp
import _io
import sys
import _warnings
import marshal


_MS_WINDOWS = (sys.platform == 'win32')
if _MS_WINDOWS:
    import nt as _os
    import winreg
else:
    import posix as _os


if _MS_WINDOWS:
    path_separators = ['\\', '/']
else:
    path_separators = ['/']
# Assumption made in _path_join()
assert all(len(sep) == 1 for sep in path_separators)
path_sep = path_separators[0]
path_sep_tuple = tuple(path_separators)
path_separators = ''.join(path_separators)
_pathseps_with_colon = {f':{s}' for s in path_separators}


# Bootstrap-related code ######################################################
_CASE_INSENSITIVE_PLATFORMS_STR_KEY = 'win',
_CASE_INSENSITIVE_PLATFORMS_BYTES_KEY = 'cygwin', 'darwin'
_CASE_INSENSITIVE_PLATFORMS =  (_CASE_INSENSITIVE_PLATFORMS_BYTES_KEY
                                + _CASE_INSENSITIVE_PLATFORMS_STR_KEY)


def _make_relax_case():
    if sys.platform.startswith(_CASE_INSENSITIVE_PLATFORMS):
        if sys.platform.startswith(_CASE_INSENSITIVE_PLATFORMS_STR_KEY):
            key = 'PYTHONCASEOK'
        else:
            key = b'PYTHONCASEOK'

        def _relax_case():
            """True if filenames must be checked case-insensitively."""
            return key in _os.environ
    else:
        def _relax_case():
            """True if filenames must be checked case-insensitively."""
            return False
    return _relax_case


def _pack_uint32(x):
    """Convert a 32-bit integer to little-endian."""
    return (int(x) & 0xFFFFFFFF).to_bytes(4, 'little')


def _unpack_uint32(data):
    """Convert 4 bytes in little-endian to an integer."""
    assert len(data) == 4
    return int.from_bytes(data, 'little')

def _unpack_uint16(data):
    """Convert 2 bytes in little-endian to an integer."""
    assert len(data) == 2
    return int.from_bytes(data, 'little')


if _MS_WINDOWS:
    def _path_join(*path_parts):
        """Replacement for os.path.join()."""
        if not path_parts:
            return ""
        if len(path_parts) == 1:
            return path_parts[0]
        root = ""
        path = []
        for new_root, tail in map(_os._path_splitroot, path_parts):
            if new_root.startswith(path_sep_tuple) or new_root.endswith(path_sep_tuple):
                root = new_root.rstrip(path_separators) or root
                path = [path_sep + tail]
            elif new_root.endswith(':'):
                if root.casefold() != new_root.casefold():
                    # Drive relative paths have to be resolved by the OS, so we reset the
                    # tail but do not add a path_sep prefix.
                    root = new_root
                    path = [tail]
                else:
                    path.append(tail)
            else:
                root = new_root or root
                path.append(tail)
        path = [p.rstrip(path_separators) for p in path if p]
        if len(path) == 1 and not path[0]:
            # Avoid losing the root's trailing separator when joining with nothing
            return root + path_sep
        return root + path_sep.join(path)

else:
    def _path_join(*path_parts):
        """Replacement for os.path.join()."""
        return path_sep.join([part.rstrip(path_separators)
                              for part in path_parts if part])


def _path_split(path):
    """Replacement for os.path.split()."""
    i = max(path.rfind(p) for p in path_separators)
    if i < 0:
        return '', path
    return path[:i], path[i + 1:]


def _path_stat(path):
    """Stat the path.

    Made a separate function to make it easier to override in experiments
    (e.g. cache stat results).

    """
    return _os.stat(path)


def _path_is_mode_type(path, mode):
    """Test whether the path is the specified mode type."""
    try:
        stat_info = _path_stat(path)
    except OSError:
        return False
    return (stat_info.st_mode & 0o170000) == mode


def _path_isfile(path):
    """Replacement for os.path.isfile."""
    return _path_is_mode_type(path, 0o100000)


def _path_isdir(path):
    """Replacement for os.path.isdir."""
    if not path:
        path = _os.getcwd()
    return _path_is_mode_type(path, 0o040000)


if _MS_WINDOWS:
    def _path_isabs(path):
        """Replacement for os.path.isabs."""
        if not path:
            return False
        root = _os._path_splitroot(path)[0].replace('/', '\\')
        return len(root) > 1 and (root.startswith('\\\\') or root.endswith('\\'))

else:
    def _path_isabs(path):
        """Replacement for os.path.isabs."""
        return path.startswith(path_separators)


def _write_atomic(path, data, mode=0o666):
    """Best-effort function to write data to a path atomically.
    Be prepared to handle a FileExistsError if concurrent writing of the
    temporary file is attempted."""
    # id() is used to generate a pseudo-random filename.
    path_tmp = '{}.{}'.format(path, id(path))
    fd = _os.open(path_tmp,
                  _os.O_EXCL | _os.O_CREAT | _os.O_WRONLY, mode & 0o666)
    try:
        # We first write data to a temporary file, and then use os.replace() to
        # perform an atomic rename.
        with _io.FileIO(fd, 'wb') as file:
            file.write(data)
        _os.replace(path_tmp, path)
    except OSError:
        try:
            _os.unlink(path_tmp)
        except OSError:
            pass
        raise


_code_type = type(_write_atomic.__code__)


# Finder/loader utility code ###############################################

# Magic word to reject .pyc files generated by other Python versions.
# It should change for each incompatible change to the bytecode.
#
# The value of CR and LF is incorporated so if you ever read or write
# a .pyc file in text mode the magic number will be wrong; also, the
# Apple MPW compiler swaps their values, botching string constants.
#
# There were a variety of old schemes for setting the magic number.
# The current working scheme is to increment the previous value by
# 10.
#
# Starting with the adoption of PEP 3147 in Python 3.2, every bump in magic
# number also includes a new "magic tag", i.e. a human readable string used
# to represent the magic number in __pycache__ directories.  When you change
# the magic number, you must also set a new unique magic tag.  Generally this
# can be named after the Python major version of the magic number bump, but
# it can really be anything, as long as it's different than anything else
# that's come before.  The tags are included in the following table, starting
# with Python 3.2a0.
#
# Known values:
#  Python 1.5:   20121
#  Python 1.5.1: 20121
#     Python 1.5.2: 20121
#     Python 1.6:   50428
#     Python 2.0:   50823
#     Python 2.0.1: 50823
#     Python 2.1:   60202
#     Python 2.1.1: 60202
#     Python 2.1.2: 60202
#     Python 2.2:   60717
#     Python 2.3a0: 62011
#     Python 2.3a0: 62021
#     Python 2.3a0: 62011 (!)
#     Python 2.4a0: 62041
#     Python 2.4a3: 62051
#     Python 2.4b1: 62061
#     Python 2.5a0: 62071
#     Python 2.5a0: 62081 (ast-branch)
#     Python 2.5a0: 62091 (with)
#     Python 2.5a0: 62092 (changed WITH_CLEANUP opcode)
#     Python 2.5b3: 62101 (fix wrong code: for x, in ...)
#     Python 2.5b3: 62111 (fix wrong code: x += yield)
#     Python 2.5c1: 62121 (fix wrong lnotab with for loops and
#                          storing constants that should have been removed)
#     Python 2.5c2: 62131 (fix wrong code: for x, in ... in listcomp/genexp)
#     Python 2.6a0: 62151 (peephole optimizations and STORE_MAP opcode)
#     Python 2.6a1: 62161 (WITH_CLEANUP optimization)
#     Python 2.7a0: 62171 (optimize list comprehensions/change LIST_APPEND)
#     Python 2.7a0: 62181 (optimize conditional branches:
#                          introduce POP_JUMP_IF_FALSE and POP_JUMP_IF_TRUE)
#     Python 2.7a0  62191 (introduce SETUP_WITH)
#     Python 2.7a0  62201 (introduce BUILD_SET)
#     Python 2.7a0  62211 (introduce MAP_ADD and SET_ADD)
#     Python 3000:   3000
#                    3010 (removed UNARY_CONVERT)
#                    3020 (added BUILD_SET)
#                    3030 (added keyword-only parameters)
#                    3040 (added signature annotations)
#                    3050 (print becomes a function)
#                    3060 (PEP 3115 metaclass syntax)
#                    3061 (string literals become unicode)
#                    3071 (PEP 3109 raise changes)
#                    3081 (PEP 3137 make __file__ and __name__ unicode)
#                    3091 (kill str8 interning)
#                    3101 (merge from 2.6a0, see 62151)
#                    3103 (__file__ points to source file)
#     Python 3.0a4: 3111 (WITH_CLEANUP optimization).
#     Python 3.0b1: 3131 (lexical exception stacking, including POP_EXCEPT
                          #3021)
#     Python 3.1a1: 3141 (optimize list, set and dict comprehensions:
#                         change LIST_APPEND and SET_ADD, add MAP_ADD #2183)
#     Python 3.1a1: 3151 (optimize conditional branches:
#                         introduce POP_JUMP_IF_FALSE and POP_JUMP_IF_TRUE
                          #4715)
#     Python 3.2a1: 3160 (add SETUP_WITH #6101)
#                   tag: cpython-32
#     Python 3.2a2: 3170 (add DUP_TOP_TWO, remove DUP_TOPX and ROT_FOUR #9225)
#                   tag: cpython-32
#     Python 3.2a3  3180 (add DELETE_DEREF #4617)
#     Python 3.3a1  3190 (__class__ super closure changed)
#     Python 3.3a1  3200 (PEP 3155 __qualname__ added #13448)
#     Python 3.3a1  3210 (added size modulo 2**32 to the pyc header #13645)
#     Python 3.3a2  3220 (changed PEP 380 implementation #14230)
#     Python 3.3a4  3230 (revert changes to implicit __class__ closure #14857)
#     Python 3.4a1  3250 (evaluate positional default arguments before
#                        keyword-only defaults #16967)
#     Python 3.4a1  3260 (add LOAD_CLASSDEREF; allow locals of class to override
#                        free vars #17853)
#     Python 3.4a1  3270 (various tweaks to the __class__ closure #12370)
#     Python 3.4a1  3280 (remove implicit class argument)
#     Python 3.4a4  3290 (changes to __qualname__ computation #19301)
#     Python 3.4a4  3300 (more changes to __qualname__ computation #19301)
#     Python 3.4rc2 3310 (alter __qualname__ computation #20625)
#     Python 3.5a1  3320 (PEP 465: Matrix multiplication operator #21176)
#     Python 3.5b1  3330 (PEP 448: Additional Unpacking Generalizations #2292)
#     Python 3.5b2  3340 (fix dictionary display evaluation order #11205)
#     Python 3.5b3  3350 (add GET_YIELD_FROM_ITER opcode #24400)
#     Python 3.5.2  3351 (fix BUILD_MAP_UNPACK_WITH_CALL opcode #27286)
#     Python 3.6a0  3360 (add FORMAT_VALUE opcode #25483)
#     Python 3.6a1  3361 (lineno delta of code.co_lnotab becomes signed #26107)
#     Python 3.6a2  3370 (16 bit wordcode #26647)
#     Python 3.6a2  3371 (add BUILD_CONST_KEY_MAP opcode #27140)
#     Python 3.6a2  3372 (MAKE_FUNCTION simplification, remove MAKE_CLOSURE
#                         #27095)
#     Python 3.6b1  3373 (add BUILD_STRING opcode #27078)
#     Python 3.6b1  3375 (add SETUP_ANNOTATIONS and STORE_ANNOTATION opcodes
#                         #27985)
#     Python 3.6b1  3376 (simplify CALL_FUNCTIONs & BUILD_MAP_UNPACK_WITH_CALL
                          #27213)
#     Python 3.6b1  3377 (set __class__ cell from type.__new__ #23722)
#     Python 3.6b2  3378 (add BUILD_TUPLE_UNPACK_WITH_CALL #28257)
#     Python 3.6rc1 3379 (more thorough __class__ validation #23722)
#     Python 3.7a1  3390 (add LOAD_METHOD and CALL_METHOD opcodes #26110)
#     Python 3.7a2  3391 (update GET_AITER #31709)
#     Python 3.7a4  3392 (PEP 552: Deterministic pycs #31650)
#     Python 3.7b1  3393 (remove STORE_ANNOTATION opcode #32550)
#     Python 3.7b5  3394 (restored docstring as the first stmt in the body;
#                         this might affected the first line number #32911)
#     Python 3.8a1  3400 (move frame block handling to compiler #17611)
#     Python 3.8a1  3401 (add END_ASYNC_FOR #33041)
#     Python 3.8a1  3410 (PEP570 Python Positional-Only Parameters #36540)
#     Python 3.8b2  3411 (Reverse evaluation order of key: value in dict
#                         comprehensions #35224)
#     Python 3.8b2  3412 (Swap the position of positional args and positional
#                         only args in ast.arguments #37593)
#     Python 3.8b4  3413 (Fix "break" and "continue" in "finally" #37830)
#
# MAGIC must change whenever the bytecode emitted by the compiler may no
# longer be understood by older implementations of the eval loop (usually
# due to the addition of new opcodes).
#
# Whenever MAGIC_NUMBER is changed, the ranges in the magic_values array
# in PC/launcher.c must also be updated.

MAGIC_NUMBER = (3413).to_bytes(2, 'little') + b'\r\n'
_RAW_MAGIC_NUMBER = int.from_bytes(MAGIC_NUMBER, 'little')  # For import.c

_PYCACHE = '__pycache__'
_OPT = 'opt-'

SOURCE_SUFFIXES = ['.py']  # _setup() adds .pyw as needed.

BYTECODE_SUFFIXES = ['.pyc']
# Deprecated.
DEBUG_BYTECODE_SUFFIXES = OPTIMIZED_BYTECODE_SUFFIXES = BYTECODE_SUFFIXES

def cache_from_source(path, debug_override=None, *, optimization=None):
    """Given the path to a .py file, return the path to its .pyc file.

    The .py file does not need to exist; this simply returns the path to the
    .pyc file calculated as if the .py file were imported.

    The 'optimization' parameter controls the presumed optimization level of
    the bytecode file. If 'optimization' is not None, the string representation
    of the argument is taken and verified to be alphanumeric (else ValueError
    is raised).

    The debug_override parameter is deprecated. If debug_override is not None,
    a True value is the same as setting 'optimization' to the empty string
    while a False value is equivalent to setting 'optimization' to '1'.

    If sys.implementation.cache_tag is None then NotImplementedError is raised.

    """
    if debug_override is not None:
        _warnings.warn('the debug_override parameter is deprecated; use '
                       "'optimization' instead", DeprecationWarning)
        if optimization is not None:
            message = 'debug_override or optimization must be set to None'
            raise TypeError(message)
        optimization = '' if debug_override else 1
    path = _os.fspath(path)
    head, tail = _path_split(path)
    base, sep, rest = tail.rpartition('.')
    tag = sys.implementation.cache_tag
    if tag is None:
        raise NotImplementedError('sys.implementation.cache_tag is None')
    almost_filename = ''.join([(base if base else rest), sep, tag])
    if optimization is None:
        if sys.flags.optimize == 0:
            optimization = ''
        else:
            optimization = sys.flags.optimize
    optimization = str(optimization)
    if optimization != '':
        if not optimization.isalnum():
            raise ValueError('{!r} is not alphanumeric'.format(optimization))
        almost_filename = '{}.{}{}'.format(almost_filename, _OPT, optimization)
    filename = almost_filename + BYTECODE_SUFFIXES[0]
    if sys.pycache_prefix is not None:
        # We need an absolute path to the py file to avoid the possibility of
        # collisions within sys.pycache_prefix, if someone has two different
        # `foo/bar.py` on their system and they import both of them using the
        # same sys.pycache_prefix. Let's say sys.pycache_prefix is
        # `C:\Bytecode`; the idea here is that if we get `Foo\Bar`, we first
        # make it absolute (`C:\Somewhere\Foo\Bar`), then make it root-relative
        # (`Somewhere\Foo\Bar`), so we end up placing the bytecode file in an
        # unambiguous `C:\Bytecode\Somewhere\Foo\Bar\`.
        if not _path_isabs(head):
            head = _path_join(_os.getcwd(), head)

        # Strip initial drive from a Windows path. We know we have an absolute
        # path here, so the second part of the check rules out a POSIX path that
        # happens to contain a colon at the second character.
        if head[1] == ':' and head[0] not in path_separators:
            head = head[2:]

        # Strip initial path separator from `head` to complete the conversion
        # back to a root-relative path before joining.
        return _path_join(
            sys.pycache_prefix,
            head.lstrip(path_separators),
            filename,
        )
    return _path_join(head, _PYCACHE, filename)


def source_from_cache(path):
    """Given the path to a .pyc. file, return the path to its .py file.

    The .pyc file does not need to exist; this simply returns the path to
    the .py file calculated to correspond to the .pyc file.  If path does
    not conform to PEP 3147/488 format, ValueError will be raised. If
    sys.implementation.cache_tag is None then NotImplementedError is raised.

    """
    if sys.implementation.cache_tag is None:
        raise NotImplementedError('sys.implementation.cache_tag is None')
    path = _os.fspath(path)
    head, pycache_filename = _path_split(path)
    found_in_pycache_prefix = False
    if sys.pycache_prefix is not None:
        stripped_path = sys.pycache_prefix.rstrip(path_separators)
        if head.startswith(stripped_path + path_sep):
            head = head[len(stripped_path):]
            found_in_pycache_prefix = True
    if not found_in_pycache_prefix:
        head, pycache = _path_split(head)
        if pycache != _PYCACHE:
            raise ValueError(f'{_PYCACHE} not bottom-level directory in '
                             f'{path!r}')
    dot_count = pycache_filename.count('.')
    if dot_count not in {2, 3}:
        raise ValueError(f'expected only 2 or 3 dots in {pycache_filename!r}')
    elif dot_count == 3:
        optimization = pycache_filename.rsplit('.', 2)[-2]
        if not optimization.startswith(_OPT):
            raise ValueError("optimization portion of filename does not start "
                             f"with {_OPT!r}")
        opt_level = optimization[len(_OPT):]
        if not opt_level.isalnum():
            raise ValueError(f"optimization level {optimization!r} is not an "
                             "alphanumeric value")
    base_filename = pycache_filename.partition('.')[0]
    return _path_join(head, base_filename + SOURCE_SUFFIXES[0])


def _get_sourcefile(bytecode_path):
    """Convert a bytecode file path to a source path (if possible).

    This function exists purely for backwards-compatibility for
    PyImport_ExecCodeModuleWithFilenames() in the C API.

    """
    if len(bytecode_path) == 0:
        return None
    rest, _, extension = bytecode_path.rpartition('.')
    if not rest or extension.lower()[-3:-1] != 'py':
        return bytecode_path
    try:
        source_path = source_from_cache(bytecode_path)
    except (NotImplementedError, ValueError):
        source_path = bytecode_path[:-1]
    return source_path if _path_isfile(source_path) else bytecode_path


def _get_cached(filename):
    if filename.endswith(tuple(SOURCE_SUFFIXES)):
        try:
            return cache_from_source(filename)
        except NotImplementedError:
            pass
    elif filename.endswith(tuple(BYTECODE_SUFFIXES)):
        return filename
    else:
        return None


def _calc_mode(path):
    """Calculate the mode permissions for a bytecode file."""
    try:
        mode = _path_stat(path).st_mode
    except OSError:
        mode = 0o666
    # We always ensure write access so we can update cached files
    # later even when the source files are read-only on Windows (#6074)
    mode |= 0o200
    return mode


def _check_name(method):
    """Decorator to verify that the module being requested matches the one the
    loader can handle.

    The first argument (self) must define _name which the second argument is
    compared against. If the comparison fails then ImportError is raised.

    """
    def _check_name_wrapper(self, name=None, *args, **kwargs):
        if name is None:
            name = self.name
        elif self.name != name:
            raise ImportError('loader for %s cannot handle %s' %
                                (self.name, name), name=name)
        return method(self, name, *args, **kwargs)
    try:
        _wrap = _bootstrap._wrap
    except NameError:
        # XXX yuck
        def _wrap(new, old):
            for replace in ['__module__', '__name__', '__qualname__', '__doc__']:
                if hasattr(old, replace):
                    setattr(new, replace, getattr(old, replace))
            new.__dict__.update(old.__dict__)
    _wrap(_check_name_wrapper, method)
    return _check_name_wrapper


def _find_module_shim(self, fullname):
    """Try to find a loader for the specified module by delegating to
    self.find_loader().

    This method is deprecated in favor of finder.find_spec().

    """
    # Call find_loader(). If it returns a string (indicating this
    # is a namespace package portion), generate a warning and
    # return None.
    loader, portions = self.find_loader(fullname)
    if loader is None and len(portions):
        msg = 'Not importing directory {}: missing __init__'
        _warnings.warn(msg.format(portions[0]), ImportWarning)
    return loader


def _classify_pyc(data, name, exc_details):
    """Perform basic validity checking of a pyc header and return the flags field,
    which determines how the pyc should be further validated against the source.

    *data* is the contents of the pyc file. (Only the first 16 bytes are
    required, though.)

    *name* is the name of the module being imported. It is used for logging.

    *exc_details* is a dictionary passed to ImportError if it raised for
    improved debugging.

    ImportError is raised when the magic number is incorrect or when the flags
    field is invalid. EOFError is raised when the data is found to be truncated.

    """
    magic = data[:4]
    if magic != MAGIC_NUMBER:
        message = f'bad magic number in {name!r}: {magic!r}'
        _bootstrap._verbose_message('{}', message)
        raise ImportError(message, **exc_details)
    if len(data) < 16:
        message = f'reached EOF while reading pyc header of {name!r}'
        _bootstrap._verbose_message('{}', message)
        raise EOFError(message)
    flags = _unpack_uint32(data[4:8])
    # Only the first two flags are defined.
    if flags & ~0b11:
        message = f'invalid flags {flags!r} in {name!r}'
        raise ImportError(message, **exc_details)
    return flags


def _validate_timestamp_pyc(data, source_mtime, source_size, name,
                            exc_details):
    """Validate a pyc against the source last-modified time.

    *data* is the contents of the pyc file. (Only the first 16 bytes are
    required.)

    *source_mtime* is the last modified timestamp of the source file.

    *source_size* is None or the size of the source file in bytes.

    *name* is the name of the module being imported. It is used for logging.

    *exc_details* is a dictionary passed to ImportError if it raised for
    improved debugging.

    An ImportError is raised if the bytecode is stale.

    """
    if _unpack_uint32(data[8:12]) != (source_mtime & 0xFFFFFFFF):
        message = f'bytecode is stale for {name!r}'
        _bootstrap._verbose_message('{}', message)
        raise ImportError(message, **exc_details)
    if (source_size is not None and
        _unpack_uint32(data[12:16]) != (source_size & 0xFFFFFFFF)):
        raise ImportError(f'bytecode is stale for {name!r}', **exc_details)


def _validate_hash_pyc(data, source_hash, name, exc_details):
    """Validate a hash-based pyc by checking the real source hash against the one in
    the pyc header.

    *data* is the contents of the pyc file. (Only the first 16 bytes are
    required.)

    *source_hash* is the importlib.util.source_hash() of the source file.

    *name* is the name of the module being imported. It is used for logging.

    *exc_details* is a dictionary passed to ImportError if it raised for
    improved debugging.

    An ImportError is raised if the bytecode is stale.

    """
    if data[8:16] != source_hash:
        raise ImportError(
            f'hash in bytecode doesn\'t match hash of source {name!r}',
            **exc_details,
        )


def _compile_bytecode(data, name=None, bytecode_path=None, source_path=None):
    """Compile bytecode as found in a pyc."""
    code = marshal.loads(data)
    if isinstance(code, _code_type):
        _bootstrap._verbose_message('code object from {!r}', bytecode_path)
        if source_path is not None:
            _imp._fix_co_filename(code, source_path)
        return code
    else:
        raise ImportError('Non-code object in {!r}'.format(bytecode_path),
                          name=name, path=bytecode_path)


def _code_to_timestamp_pyc(code, mtime=0, source_size=0):
    "Produce the data for a timestamp-based pyc."
    data = bytearray(MAGIC_NUMBER)
    data.extend(_pack_uint32(0))
    data.extend(_pack_uint32(mtime))
    data.extend(_pack_uint32(source_size))
    data.extend(marshal.dumps(code))
    return data


def _code_to_hash_pyc(code, source_hash, checked=True):
    "Produce the data for a hash-based pyc."
    data = bytearray(MAGIC_NUMBER)
    flags = 0b1 | checked << 1
    data.extend(_pack_uint32(flags))
    assert len(source_hash) == 8
    data.extend(source_hash)
    data.extend(marshal.dumps(code))
    return data


def decode_source(source_bytes):
    """Decode bytes representing source code and return the string.

    Universal newline support is used in the decoding.
    """
    import tokenize  # To avoid bootstrap issues.
    source_bytes_readline = _io.BytesIO(source_bytes).readline
    encoding = tokenize.detect_encoding(source_bytes_readline)
    newline_decoder = _io.IncrementalNewlineDecoder(None, True)
    return newline_decoder.decode(source_bytes.decode(encoding[0]))


# Module specifications #######################################################

_POPULATE = object()


def spec_from_file_location(name, location=None, *, loader=None,
                            submodule_search_locations=_POPULATE):
    """Return a module spec based on a file location.

    To indicate that the module is a package, set
    submodule_search_locations to a list of directory paths.  An
    empty list is sufficient, though its not otherwise useful to the
    import system.

    The loader must take a spec as its only __init__() arg.

    """
    if location is None:
        # The caller may simply want a partially populated location-
        # oriented spec.  So we set the location to a bogus value and
        # fill in as much as we can.
        location = '<unknown>'
        if hasattr(loader, 'get_filename'):
            # ExecutionLoader
            try:
                location = loader.get_filename(name)
            except ImportError:
                pass
    else:
        location = _os.fspath(location)

    # If the location is on the filesystem, but doesn't actually exist,
    # we could return None here, indicating that the location is not
    # valid.  However, we don't have a good way of testing since an
    # indirect location (e.g. a zip file or URL) will look like a
    # non-existent file relative to the filesystem.

    spec = _bootstrap.ModuleSpec(name, loader, origin=location)
    spec._set_fileattr = True

    # Pick a loader if one wasn't provided.
    if loader is None:
        for loader_class, suffixes in _get_supported_file_loaders():
            if location.endswith(tuple(suffixes)):
                loader = loader_class(name, location)
                spec.loader = loader
                break
        else:
            return None

    # Set submodule_search_paths appropriately.
    if submodule_search_locations is _POPULATE:
        # Check the loader.
        if hasattr(loader, 'is_package'):
            try:
                is_package = loader.is_package(name)
            except ImportError:
                pass
            else:
                if is_package:
                    spec.submodule_search_locations = []
    else:
        spec.submodule_search_locations = submodule_search_locations
    if spec.submodule_search_locations == []:
        if location:
            dirname = _path_split(location)[0]
            spec.submodule_search_locations.append(dirname)

    return spec


# Loaders #####################################################################

class WindowsRegistryFinder:

    """Meta path finder for modules declared in the Windows registry."""

    REGISTRY_KEY = (
        'Software\\Python\\PythonCore\\{sys_version}'
        '\\Modules\\{fullname}')
    REGISTRY_KEY_DEBUG = (
        'Software\\Python\\PythonCore\\{sys_version}'
        '\\Modules\\{fullname}\\Debug')
    DEBUG_BUILD = False  # Changed in _setup()

    @classmethod
    def _open_registry(cls, key):
        try:
            return _winreg.OpenKey(_winreg.HKEY_CURRENT_USER, key)
        except OSError:
            return _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, key)

    @classmethod
    def _search_registry(cls, fullname):
        if cls.DEBUG_BUILD:
            registry_key = cls.REGISTRY_KEY_DEBUG
        else:
            registry_key = cls.REGISTRY_KEY
        key = registry_key.format(fullname=fullname,
                                  sys_version='%d.%d' % sys.version_info[:2])
        try:
            with cls._open_registry(key) as hkey:
                filepath = _winreg.QueryValue(hkey, '')
        except OSError:
            return None
        return filepath

    @classmethod
    def find_spec(cls, fullname, path=None, target=None):
        filepath = cls._search_registry(fullname)
        if filepath is None:
            return None
        try:
            _path_stat(filepath)
        except OSError:
            return None
        for loader, suffixes in _get_supported_file_loaders():
            if filepath.endswith(tuple(suffixes)):
                spec = _bootstrap.spec_from_loader(fullname,
                                                   loader(fullname, filepath),
                                                   origin=filepath)
                return spec

    @classmethod
    def find_module(cls, fullname, path=None):
        """Find module named in the registry.

        This method is deprecated.  Use exec_module() instead.

        """
        spec = cls.find_spec(fullname, path)
        if spec is not None:
            return spec.loader
        else:
            return None


class _LoaderBasics:

    """Base class of common code needed by both SourceLoader and
    SourcelessFileLoader."""

    def is_package(self, fullname):
        """Concrete implementation of InspectLoader.is_package by checking if
        the path returned by get_filename has a filename of '__init__.py'."""
        filename = _path_split(self.get_filename(fullname))[1]
        filename_base = filename.rsplit('.', 1)[0]
        tail_name = fullname.rpartition('.')[2]
        return filename_base == '__init__' and tail_name != '__init__'

    def create_module(self, spec):
        """Use default semantics for module creation."""

    def exec_module(self, module):
        """Execute the module."""
        code = self.get_code(module.__name__)
        if code is None:
            raise ImportError('cannot load module {!r} when get_code() '
                              'returns None'.format(module.__name__))
        _bootstrap._call_with_frames_removed(exec, code, module.__dict__)

    def load_module(self, fullname):
        """This module is deprecated."""
        return _bootstrap._load_module_shim(self, fullname)


class SourceLoader(_LoaderBasics):

    def path_mtime(self, path):
        """Optional method that returns the modification time (an int) for the
        specified path (a str).

        Raises OSError when the path cannot be handled.
        """
        raise OSError

    def path_stats(self, path):
        """Optional method returning a metadata dict for the specified
        path (a str).

        Possible keys:
        - 'mtime' (mandatory) is the numeric timestamp of last source
          code modification;
        - 'size' (optional) is the size in bytes of the source code.

        Implementing this method allows the loader to read bytecode files.
        Raises OSError when the path cannot be handled.
        """
        return {'mtime': self.path_mtime(path)}

    def _cache_bytecode(self, source_path, cache_path, data):
        """Optional method which writes data (bytes) to a file path (a str).

        Implementing this method allows for the writing of bytecode files.

        The source path is needed in order to correctly transfer permissions
        """
        # For backwards compatibility, we delegate to set_data()
        return self.set_data(cache_path, data)

    def set_data(self, path, data):
        """Optional method which writes data (bytes) to a file path (a str).

        Implementing this method allows for the writing of bytecode files.
        """


    def get_source(self, fullname):
        """Concrete implementation of InspectLoader.get_source."""
        path = self.get_filename(fullname)
        try:
            source_bytes = self.get_data(path)
        except OSError as exc:
            raise ImportError('source not available through get_data()',
                              name=fullname) from exc
        return decode_source(source_bytes)

    def source_to_code(self, data, path, *, _optimize=-1):
        """Return the code object compiled from source.

        The 'data' argument can be any object type that compile() supports.
        """
        return _bootstrap._call_with_frames_removed(compile, data, path, 'exec',
                                        dont_inherit=True, optimize=_optimize)

    def get_code(self, fullname):
        """Concrete implementation of InspectLoader.get_code.

        Reading of bytecode requires path_stats to be implemented. To write
        bytecode, set_data must also be implemented.

        """
        source_path = self.get_filename(fullname)
        source_mtime = None
        source_bytes = None
        source_hash = None
        hash_based = False
        check_source = True
        try:
            bytecode_path = cache_from_source(source_path)
        except NotImplementedError:
            bytecode_path = None
        else:
            try:
                st = self.path_stats(source_path)
            except OSError:
                pass
            else:
                source_mtime = int(st['mtime'])
                try:
                    data = self.get_data(bytecode_path)
                except OSError:
                    pass
                else:
                    exc_details = {
                        'name': fullname,
                        'path': bytecode_path,
                    }
                    try:
                        flags = _classify_pyc(data, fullname, exc_details)
                        bytes_data = memoryview(data)[16:]
                        hash_based = flags & 0b1 != 0
                        if hash_based:
                            check_source = flags & 0b10 != 0
                            if (_imp.check_hash_based_pycs != 'never' and
                                (check_source or
                                 _imp.check_hash_based_pycs == 'always')):
                                source_bytes = self.get_data(source_path)
                                source_hash = _imp.source_hash(
                                    _RAW_MAGIC_NUMBER,
                                    source_bytes,
                                )
                                _validate_hash_pyc(data, source_hash, fullname,
                                                   exc_details)
                        else:
                            _validate_timestamp_pyc(
                                data,
                                source_mtime,
                                st['size'],
                                fullname,
                                exc_details,
                            )
                    except (ImportError, EOFError):
                        pass
                    else:
                        _bootstrap._verbose_message('{} matches {}', bytecode_path,
                                                    source_path)
                        return _compile_bytecode(bytes_data, name=fullname,
                                                 bytecode_path=bytecode_path,
                                                 source_path=source_path)
        if source_bytes is None:
            source_bytes = self.get_data(source_path)
        code_object = self.source_to_code(source_bytes, source_path)
        _bootstrap._verbose_message('code object from {}', source_path)
        if (not sys.dont_write_bytecode and bytecode_path is not None and
                source_mtime is not None):
            if hash_based:
                if source_hash is None:
                    source_hash = _imp.source_hash(source_bytes)
                data = _code_to_hash_pyc(code_object, source_hash, check_source)
            else:
                data = _code_to_timestamp_pyc(code_object, source_mtime,
                                              len(source_bytes))
            try:
                self._cache_bytecode(source_path, bytecode_path, data)
            except NotImplementedError:
                pass
        return code_object


class FileLoader:

    """Base file loader class which implements the loader protocol methods that
    require file system usage."""

    def __init__(self, fullname, path):
        """Cache the module name and the path to the file found by the
        finder."""
        self.name = fullname
        self.path = path

    def __eq__(self, other):
        return (self.__class__ == other.__class__ and
                self.__dict__ == other.__dict__)

    def __hash__(self):
        return hash(self.name) ^ hash(self.path)

    @_check_name
    def load_module(self, fullname):
        """Load a module from a file.

        This method is deprecated.  Use exec_module() instead.

        """
        # The only reason for this method is for the name check.
        # Issue #14857: Avoid the zero-argument form of super so the implementation
        # of that form can be updated without breaking the frozen module
        return super(FileLoader, self).load_module(fullname)

    @_check_name
    def get_filename(self, fullname):
        """Return the path to the source file as found by the finder."""
        return self.path

    def get_data(self, path):
        """Return the data from path as raw bytes."""
        if isinstance(self, (SourceLoader, ExtensionFileLoader)):
            with _io.open_code(str(path)) as file:
                return file.read()
        else:
            with _io.FileIO(path, 'r') as file:
                return file.read()

    # ResourceReader ABC API.

    @_check_name
    def get_resource_reader(self, module):
        if self.is_package(module):
            return self
        return None

    def open_resource(self, resource):
        path = _path_join(_path_split(self.path)[0], resource)
        return _io.FileIO(path, 'r')

    def resource_path(self, resource):
        if not self.is_resource(resource):
            raise FileNotFoundError
        path = _path_join(_path_split(self.path)[0], resource)
        return path

    def is_resource(self, name):
        if path_sep in name:
            return False
        path = _path_join(_path_split(self.path)[0], name)
        return _path_isfile(path)

    def contents(self):
        return iter(_os.listdir(_path_split(self.path)[0]))


class SourceFileLoader(FileLoader, SourceLoader):

    """Concrete implementation of SourceLoader using the file system."""

    def path_stats(self, path):
        """Return the metadata for the path."""
        st = _path_stat(path)
        return {'mtime': st.st_mtime, 'size': st.st_size}

    def _cache_bytecode(self, source_path, bytecode_path, data):
        # Adapt between the two APIs
        mode = _calc_mode(source_path)
        return self.set_data(bytecode_path, data, _mode=mode)

    def set_data(self, path, data, *, _mode=0o666):
        """Write bytes data to a file."""
        parent, filename = _path_split(path)
        path_parts = []
        # Figure out what directories are missing.
        while parent and not _path_isdir(parent):
            parent, part = _path_split(parent)
            path_parts.append(part)
        # Create needed directories.
        for part in reversed(path_parts):
            parent = _path_join(parent, part)
            try:
                _os.mkdir(parent)
            except FileExistsError:
                # Probably another Python process already created the dir.
                continue
            except OSError as exc:
                # Could be a permission error, read-only filesystem: just forget
                # about writing the data.
                _bootstrap._verbose_message('could not create {!r}: {!r}',
                                            parent, exc)
                return
        try:
            _write_atomic(path, data, _mode)
            _bootstrap._verbose_message('created {!r}', path)
        except OSError as exc:
            # Same as above: just don't write the bytecode.
            _bootstrap._verbose_message('could not create {!r}: {!r}', path,
                                        exc)


class SourcelessFileLoader(FileLoader, _LoaderBasics):

    """Loader which handles sourceless file imports."""

    def get_code(self, fullname):
        path = self.get_filename(fullname)
        data = self.get_data(path)
        # Call _classify_pyc to do basic validation of the pyc but ignore the
        # result. There's no source to check against.
        exc_details = {
            'name': fullname,
            'path': path,
        }
        _classify_pyc(data, fullname, exc_details)
        return _compile_bytecode(
            memoryview(data)[16:],
            name=fullname,
            bytecode_path=path,
        )

    def get_source(self, fullname):
        """Return None as there is no source code."""
        return None


# Filled in by _setup().
EXTENSION_SUFFIXES = []


class ExtensionFileLoader(FileLoader, _LoaderBasics):

    """Loader for extension modules.

    The constructor is designed to work with FileFinder.

    """

    def __init__(self, name, path):
        self.name = name
        if not _path_isabs(path):
            try:
                path = _path_join(_os.getcwd(), path)
            except OSError:
                pass
        self.path = path

    def __eq__(self, other):
        return (self.__class__ == other.__class__ and
                self.__dict__ == other.__dict__)

    def __hash__(self):
        return hash(self.name) ^ hash(self.path)

    def create_module(self, spec):
        """Create an unitialized extension module"""
        module = _bootstrap._call_with_frames_removed(
            _imp.create_dynamic, spec)
        _bootstrap._verbose_message('extension module {!r} loaded from {!r}',
                         spec.name, self.path)
        return module

    def exec_module(self, module):
        """Initialize an extension module"""
        _bootstrap._call_with_frames_removed(_imp.exec_dynamic, module)
        _bootstrap._verbose_message('extension module {!r} executed from {!r}',
                         self.name, self.path)

    def is_package(self, fullname):
        """Return True if the extension module is a package."""
        file_name = _path_split(self.path)[1]
        return any(file_name == '__init__' + suffix
                   for suffix in EXTENSION_SUFFIXES)

    def get_code(self, fullname):
        """Return None as an extension module cannot create a code object."""
        return None

    def get_source(self, fullname):
        """Return None as extension modules have no source code."""
        return None

    @_check_name
    def get_filename(self, fullname):
        """Return the path to the source file as found by the finder."""
        return self.path


class _NamespacePath:
    """Represents a namespace package's path.  It uses the module name
    to find its parent module, and from there it looks up the parent's
    __path__.  When this changes, the module's own path is recomputed,
    using path_finder.  For top-level modules, the parent module's path
    is sys.path."""

    def __init__(self, name, path, path_finder):
        self._name = name
        self._path = path
        self._last_parent_path = tuple(self._get_parent_path())
        self._path_finder = path_finder

    def _find_parent_path_names(self):
        """Returns a tuple of (parent-module-name, parent-path-attr-name)"""
        parent, dot, me = self._name.rpartition('.')
        if dot == '':
            # This is a top-level module. sys.path contains the parent path.
            return 'sys', 'path'
        # Not a top-level module. parent-module.__path__ contains the
        #  parent path.
        return parent, '__path__'

    def _get_parent_path(self):
        parent_module_name, path_attr_name = self._find_parent_path_names()
        return getattr(sys.modules[parent_module_name], path_attr_name)

    def _recalculate(self):
        # If the parent's path has changed, recalculate _path
        parent_path = tuple(self._get_parent_path()) # Make a copy
        if parent_path != self._last_parent_path:
            spec = self._path_finder(self._name, parent_path)
            # Note that no changes are made if a loader is returned, but we
            #  do remember the new parent path
            if spec is not None and spec.loader is None:
                if spec.submodule_search_locations:
                    self._path = spec.submodule_search_locations
            self._last_parent_path = parent_path     # Save the copy
        return self._path

    def __iter__(self):
        return iter(self._recalculate())

    def __getitem__(self, index):
        return self._recalculate()[index]

    def __setitem__(self, index, path):
        self._path[index] = path

    def __len__(self):
        return len(self._recalculate())

    def __repr__(self):
        return '_NamespacePath({!r})'.format(self._path)

    def __contains__(self, item):
        return item in self._recalculate()

    def append(self, item):
        self._path.append(item)


# We use this exclusively in module_from_spec() for backward-compatibility.
class _NamespaceLoader:
    def __init__(self, name, path, path_finder):
        self._path = _NamespacePath(name, path, path_finder)

    @classmethod
    def module_repr(cls, module):
        """Return repr for the module.

        The method is deprecated.  The import machinery does the job itself.

        """
        return '<module {!r} (namespace)>'.format(module.__name__)

    def is_package(self, fullname):
        return True

    def get_source(self, fullname):
        return ''

    def get_code(self, fullname):
        return compile('', '<string>', 'exec', dont_inherit=True)

    def create_module(self, spec):
        """Use default semantics for module creation."""

    def exec_module(self, module):
        pass

    def load_module(self, fullname):
        """Load a namespace module.

        This method is deprecated.  Use exec_module() instead.

        """
        # The import system never calls this method.
        _bootstrap._verbose_message('namespace module loaded with path {!r}',
                                    self._path)
        return _bootstrap._load_module_shim(self, fullname)


# Finders #####################################################################

class PathFinder:

    """Meta path finder for sys.path and package __path__ attributes."""

    @classmethod
    def invalidate_caches(cls):
        """Call the invalidate_caches() method on all path entry finders
        stored in sys.path_importer_caches (where implemented)."""
        for name, finder in list(sys.path_importer_cache.items()):
            if finder is None:
                del sys.path_importer_cache[name]
            elif hasattr(finder, 'invalidate_caches'):
                finder.invalidate_caches()

    @classmethod
    def _path_hooks(cls, path):
        """Search sys.path_hooks for a finder for 'path'."""
        if sys.path_hooks is not None and not sys.path_hooks:
            _warnings.warn('sys.path_hooks is empty', ImportWarning)
        for hook in sys.path_hooks:
            try:
                return hook(path)
            except ImportError:
                continue
        else:
            return None

    @classmethod
    def _path_importer_cache(cls, path):
        """Get the finder for the path entry from sys.path_importer_cache.

        If the path entry is not in the cache, find the appropriate finder
        and cache it. If no finder is available, store None.

        """
        if path == '':
            try:
                path = _os.getcwd()
            except FileNotFoundError:
                # Don't cache the failure as the cwd can easily change to
                # a valid directory later on.
                return None
        try:
            finder = sys.path_importer_cache[path]
        except KeyError:
            finder = cls._path_hooks(path)
            sys.path_importer_cache[path] = finder
        return finder

    @classmethod
    def _legacy_get_spec(cls, fullname, finder):
        # This would be a good place for a DeprecationWarning if
        # we ended up going that route.
        if hasattr(finder, 'find_loader'):
            loader, portions = finder.find_loader(fullname)
        else:
            loader = finder.find_module(fullname)
            portions = []
        if loader is not None:
            return _bootstrap.spec_from_loader(fullname, loader)
        spec = _bootstrap.ModuleSpec(fullname, None)
        spec.submodule_search_locations = portions
        return spec

    @classmethod
    def _get_spec(cls, fullname, path, target=None):
        """Find the loader or namespace_path for this module/package name."""
        # If this ends up being a namespace package, namespace_path is
        #  the list of paths that will become its __path__
        namespace_path = []
        for entry in path:
            if not isinstance(entry, (str, bytes)):
                continue
            finder = cls._path_importer_cache(entry)
            if finder is not None:
                if hasattr(finder, 'find_spec'):
                    spec = finder.find_spec(fullname, target)
                else:
                    spec = cls._legacy_get_spec(fullname, finder)
                if spec is None:
                    continue
                if spec.loader is not None:
                    return spec
                portions = spec.submodule_search_locations
                if portions is None:
                    raise ImportError('spec missing loader')
                # This is possibly part of a namespace package.
                #  Remember these path entries (if any) for when we
                #  create a namespace package, and continue iterating
                #  on path.
                namespace_path.extend(portions)
        else:
            spec = _bootstrap.ModuleSpec(fullname, None)
            spec.submodule_search_locations = namespace_path
            return spec

    @classmethod
    def find_spec(cls, fullname, path=None, target=None):
        """Try to find a spec for 'fullname' on sys.path or 'path'.

        The search is based on sys.path_hooks and sys.path_importer_cache.
        """
        if path is None:
            path = sys.path
        spec = cls._get_spec(fullname, path, target)
        if spec is None:
            return None
        elif spec.loader is None:
            namespace_path = spec.submodule_search_locations
            if namespace_path:
                # We found at least one namespace path.  Return a spec which
                # can create the namespace package.
                spec.origin = None
                spec.submodule_search_locations = _NamespacePath(fullname, namespace_path, cls._get_spec)
                return spec
            else:
                return None
        else:
            return spec

    @classmethod
    def find_module(cls, fullname, path=None):
        """find the module on sys.path or 'path' based on sys.path_hooks and
        sys.path_importer_cache.

        This method is deprecated.  Use find_spec() instead.

        """
        spec = cls.find_spec(fullname, path)
        if spec is None:
            return None
        return spec.loader

    @classmethod
    def find_distributions(cls, *args, **kwargs):
        """
        Find distributions.

        Return an iterable of all Distribution instances capable of
        loading the metadata for packages matching ``context.name``
        (or all names if ``None`` indicated) along the paths in the list
        of directories ``context.path``.
        """
        from importlib.metadata import MetadataPathFinder
        return MetadataPathFinder.find_distributions(*args, **kwargs)


class FileFinder:

    """File-based finder.

    Interactions with the file system are cached for performance, being
    refreshed when the directory the finder is handling has been modified.

    """

    def __init__(self, path, *loader_details):
        """Initialize with the path to search on and a variable number of
        2-tuples containing the loader and the file suffixes the loader
        recognizes."""
        loaders = []
        for loader, suffixes in loader_details:
            loaders.extend((suffix, loader) for suffix in suffixes)
        self._loaders = loaders
        # Base (directory) path
        self.path = path or '.'
        if not _path_isabs(self.path):
            self.path = _path_join(_os.getcwd(), self.path)
        self._path_mtime = -1
        self._path_cache = set()
        self._relaxed_path_cache = set()

    def invalidate_caches(self):
        """Invalidate the directory mtime."""
        self._path_mtime = -1

    find_module = _find_module_shim

    def find_loader(self, fullname):
        """Try to find a loader for the specified module, or the namespace
        package portions. Returns (loader, list-of-portions).

        This method is deprecated.  Use find_spec() instead.

        """
        spec = self.find_spec(fullname)
        if spec is None:
            return None, []
        return spec.loader, spec.submodule_search_locations or []

    def _get_spec(self, loader_class, fullname, path, smsl, target):
        loader = loader_class(fullname, path)
        return spec_from_file_location(fullname, path, loader=loader,
                                       submodule_search_locations=smsl)

    def find_spec(self, fullname, target=None):
        """Try to find a spec for the specified module.

        Returns the matching spec, or None if not found.
        """
        is_namespace = False
        tail_module = fullname.rpartition('.')[2]
        try:
            mtime = _path_stat(self.path or _os.getcwd()).st_mtime
        except OSError:
            mtime = -1
        if mtime != self._path_mtime:
            self._fill_cache()
            self._path_mtime = mtime
        # tail_module keeps the original casing, for __file__ and friends
        if _relax_case():
            cache = self._relaxed_path_cache
            cache_module = tail_module.lower()
        else:
            cache = self._path_cache
            cache_module = tail_module
        # Check if the module is the name of a directory (and thus a package).
        if cache_module in cache:
            base_path = _path_join(self.path, tail_module)
            for suffix, loader_class in self._loaders:
                init_filename = '__init__' + suffix
                full_path = _path_join(base_path, init_filename)
                if _path_isfile(full_path):
                    return self._get_spec(loader_class, fullname, full_path, [base_path], target)
            else:
                # If a namespace package, return the path if we don't
                #  find a module in the next section.
                is_namespace = _path_isdir(base_path)
        # Check for a file w/ a proper suffix exists.
        for suffix, loader_class in self._loaders:
            try:
                full_path = _path_join(self.path, tail_module + suffix)
            except ValueError:
                return None
            _bootstrap._verbose_message('trying {}', full_path, verbosity=2)
            if cache_module + suffix in cache:
                if _path_isfile(full_path):
                    return self._get_spec(loader_class, fullname, full_path,
                                          None, target)
        if is_namespace:
            _bootstrap._verbose_message('possible namespace for {}', base_path)
            spec = _bootstrap.ModuleSpec(fullname, None)
            spec.submodule_search_locations = [base_path]
            return spec
        return None

    def _fill_cache(self):
        """Fill the cache of potential modules and packages for this directory."""
        path = self.path
        try:
            contents = _os.listdir(path or _os.getcwd())
        except (FileNotFoundError, PermissionError, NotADirectoryError):
            # Directory has either been removed, turned into a file, or made
            # unreadable.
            contents = []
        # We store two cached versions, to handle runtime changes of the
        # PYTHONCASEOK environment variable.
        if not sys.platform.startswith('win'):
            self._path_cache = set(contents)
        else:
            # Windows users can import modules with case-insensitive file
            # suffixes (for legacy reasons). Make the suffix lowercase here
            # so it's done once instead of for every import. This is safe as
            # the specified suffixes to check against are always specified in a
            # case-sensitive manner.
            lower_suffix_contents = set()
            for item in contents:
                name, dot, suffix = item.partition('.')
                if dot:
                    new_name = '{}.{}'.format(name, suffix.lower())
                else:
                    new_name = name
                lower_suffix_contents.add(new_name)
            self._path_cache = lower_suffix_contents
        if sys.platform.startswith(_CASE_INSENSITIVE_PLATFORMS):
            self._relaxed_path_cache = {fn.lower() for fn in contents}

    @classmethod
    def path_hook(cls, *loader_details):
        """A class method which returns a closure to use on sys.path_hook
        which will return an instance using the specified loaders and the path
        called on the closure.

        If the path called on the closure is not a directory, ImportError is
        raised.

        """
        def path_hook_for_FileFinder(path):
            """Path hook for importlib.machinery.FileFinder."""
            if not _path_isdir(path):
                raise ImportError('only directories are supported', path=path)
            return cls(path, *loader_details)

        return path_hook_for_FileFinder

    def __repr__(self):
        return 'FileFinder({!r})'.format(self.path)


# Import setup ###############################################################

def _fix_up_module(ns, name, pathname, cpathname=None):
    # This function is used by PyImport_ExecCodeModuleObject().
    loader = ns.get('__loader__')
    spec = ns.get('__spec__')
    if not loader:
        if spec:
            loader = spec.loader
        elif pathname == cpathname:
            loader = SourcelessFileLoader(name, pathname)
        else:
            loader = SourceFileLoader(name, pathname)
    if not spec:
        spec = spec_from_file_location(name, pathname, loader=loader)
    try:
        ns['__spec__'] = spec
        ns['__loader__'] = loader
        ns['__file__'] = pathname
        ns['__cached__'] = cpathname
    except Exception:
        # Not important enough to report.
        pass


def _get_supported_file_loaders():
    """Returns a list of file-based module loaders.

    Each item is a tuple (loader, suffixes).
    """
    extensions = ExtensionFileLoader, _alternative_architectures(_imp.extension_suffixes())
    source = SourceFileLoader, SOURCE_SUFFIXES
    bytecode = SourcelessFileLoader, BYTECODE_SUFFIXES
    return [extensions, source, bytecode]


def _setup(_bootstrap_module):
    """Setup the path-based importers for importlib by importing needed
    built-in modules and injecting them into the global namespace.

    Other components are extracted from the core bootstrap module.

    """
    global sys, _imp, _bootstrap
    _bootstrap = _bootstrap_module
    sys = _bootstrap.sys
    _imp = _bootstrap._imp

    # Directly load built-in modules needed during bootstrap.
    self_module = sys.modules[__name__]
    for builtin_name in ('_io', '_warnings', 'builtins', 'marshal'):
        if builtin_name not in sys.modules:
            builtin_module = _bootstrap._builtin_from_name(builtin_name)
        else:
            builtin_module = sys.modules[builtin_name]
        setattr(self_module, builtin_name, builtin_module)

    # Directly load the os module (needed during bootstrap).
    os_details = ('posix', ['/']), ('nt', ['\\', '/'])
    for builtin_os, path_separators in os_details:
        # Assumption made in _path_join()
        assert all(len(sep) == 1 for sep in path_separators)
        path_sep = path_separators[0]
        if builtin_os in sys.modules:
            os_module = sys.modules[builtin_os]
            break
        else:
            try:
                os_module = _bootstrap._builtin_from_name(builtin_os)
                break
            except ImportError:
                continue
    else:
        raise ImportError('importlib requires posix or nt')
    setattr(self_module, '_os', os_module)
    setattr(self_module, 'path_sep', path_sep)
    setattr(self_module, 'path_separators', ''.join(path_separators))
    setattr(self_module, '_pathseps_with_colon', {f':{s}' for s in path_separators})

    # Directly load the _thread module (needed during bootstrap).
    thread_module = _bootstrap._builtin_from_name('_thread')
    setattr(self_module, '_thread', thread_module)

    # Directly load the _weakref module (needed during bootstrap).
    weakref_module = _bootstrap._builtin_from_name('_weakref')
    setattr(self_module, '_weakref', weakref_module)

    # Directly load the winreg module (needed during bootstrap).
    if builtin_os == 'nt':
        winreg_module = _bootstrap._builtin_from_name('winreg')
        setattr(self_module, '_winreg', winreg_module)

    # Constants
    setattr(self_module, '_relax_case', _make_relax_case())
    EXTENSION_SUFFIXES.extend(_alternative_architectures(_imp.extension_suffixes()))
    if builtin_os == 'nt':
        SOURCE_SUFFIXES.append('.pyw')
        if '_d.pyd' in EXTENSION_SUFFIXES:
            WindowsRegistryFinder.DEBUG_BUILD = True


def _install(_bootstrap_module):
    """Install the path-based import components."""
    _setup(_bootstrap_module)
    supported_loaders = _get_supported_file_loaders()
    sys.path_hooks.extend([FileFinder.path_hook(*supported_loaders)])
    sys.meta_path.append(PathFinder)


_ARCH_MAP = {
    "-arm-linux-gnueabi.": "-arm-linux-gnueabihf.",
    "-armeb-linux-gnueabi.": "-armeb-linux-gnueabihf.",
    "-mips64-linux-gnu.": "-mips64-linux-gnuabi64.",
    "-mips64el-linux-gnu.": "-mips64el-linux-gnuabi64.",
    "-ppc-linux-gnu.": "-powerpc-linux-gnu.",
    "-ppc-linux-gnuspe.": "-powerpc-linux-gnuspe.",
    "-ppc64-linux-gnu.": "-powerpc64-linux-gnu.",
    "-ppc64le-linux-gnu.": "-powerpc64le-linux-gnu.",
    # The above, but the other way around:
    "-arm-linux-gnueabihf.": "-arm-linux-gnueabi.",
    "-armeb-linux-gnueabihf.": "-armeb-linux-gnueabi.",
    "-mips64-linux-gnuabi64.": "-mips64-linux-gnu.",
    "-mips64el-linux-gnuabi64.": "-mips64el-linux-gnu.",
    "-powerpc-linux-gnu.": "-ppc-linux-gnu.",
    "-powerpc-linux-gnuspe.": "-ppc-linux-gnuspe.",
    "-powerpc64-linux-gnu.": "-ppc64-linux-gnu.",
    "-powerpc64le-linux-gnu.": "-ppc64le-linux-gnu.",
}


def _alternative_architectures(suffixes):
    """Add a suffix with an alternative architecture name
    to the list of suffixes so an extension built with
    the default (upstream) setting is loadable with our Pythons
    """

    for suffix in suffixes:
        for original, alternative in _ARCH_MAP.items():
            if original in suffix:
                suffixes.append(suffix.replace(original, alternative))
                return suffixes

    return suffixes
importlib/abc.py000064400000031111151153537630007652 0ustar00"""Abstract base classes related to import."""
from . import _bootstrap
from . import _bootstrap_external
from . import machinery
try:
    import _frozen_importlib
except ImportError as exc:
    if exc.name != '_frozen_importlib':
        raise
    _frozen_importlib = None
try:
    import _frozen_importlib_external
except ImportError as exc:
    _frozen_importlib_external = _bootstrap_external
import abc
import warnings


def _register(abstract_cls, *classes):
    for cls in classes:
        abstract_cls.register(cls)
        if _frozen_importlib is not None:
            try:
                frozen_cls = getattr(_frozen_importlib, cls.__name__)
            except AttributeError:
                frozen_cls = getattr(_frozen_importlib_external, cls.__name__)
            abstract_cls.register(frozen_cls)


class Finder(metaclass=abc.ABCMeta):

    """Legacy abstract base class for import finders.

    It may be subclassed for compatibility with legacy third party
    reimplementations of the import system.  Otherwise, finder
    implementations should derive from the more specific MetaPathFinder
    or PathEntryFinder ABCs.

    Deprecated since Python 3.3
    """

    @abc.abstractmethod
    def find_module(self, fullname, path=None):
        """An abstract method that should find a module.
        The fullname is a str and the optional path is a str or None.
        Returns a Loader object or None.
        """


class MetaPathFinder(Finder):

    """Abstract base class for import finders on sys.meta_path."""

    # We don't define find_spec() here since that would break
    # hasattr checks we do to support backward compatibility.

    def find_module(self, fullname, path):
        """Return a loader for the module.

        If no module is found, return None.  The fullname is a str and
        the path is a list of strings or None.

        This method is deprecated since Python 3.4 in favor of
        finder.find_spec(). If find_spec() exists then backwards-compatible
        functionality is provided for this method.

        """
        warnings.warn("MetaPathFinder.find_module() is deprecated since Python "
                      "3.4 in favor of MetaPathFinder.find_spec() "
                      "(available since 3.4)",
                      DeprecationWarning,
                      stacklevel=2)
        if not hasattr(self, 'find_spec'):
            return None
        found = self.find_spec(fullname, path)
        return found.loader if found is not None else None

    def invalidate_caches(self):
        """An optional method for clearing the finder's cache, if any.
        This method is used by importlib.invalidate_caches().
        """

_register(MetaPathFinder, machinery.BuiltinImporter, machinery.FrozenImporter,
          machinery.PathFinder, machinery.WindowsRegistryFinder)


class PathEntryFinder(Finder):

    """Abstract base class for path entry finders used by PathFinder."""

    # We don't define find_spec() here since that would break
    # hasattr checks we do to support backward compatibility.

    def find_loader(self, fullname):
        """Return (loader, namespace portion) for the path entry.

        The fullname is a str.  The namespace portion is a sequence of
        path entries contributing to part of a namespace package. The
        sequence may be empty.  If loader is not None, the portion will
        be ignored.

        The portion will be discarded if another path entry finder
        locates the module as a normal module or package.

        This method is deprecated since Python 3.4 in favor of
        finder.find_spec(). If find_spec() is provided than backwards-compatible
        functionality is provided.
        """
        warnings.warn("PathEntryFinder.find_loader() is deprecated since Python "
                      "3.4 in favor of PathEntryFinder.find_spec() "
                      "(available since 3.4)",
                      DeprecationWarning,
                      stacklevel=2)
        if not hasattr(self, 'find_spec'):
            return None, []
        found = self.find_spec(fullname)
        if found is not None:
            if not found.submodule_search_locations:
                portions = []
            else:
                portions = found.submodule_search_locations
            return found.loader, portions
        else:
            return None, []

    find_module = _bootstrap_external._find_module_shim

    def invalidate_caches(self):
        """An optional method for clearing the finder's cache, if any.
        This method is used by PathFinder.invalidate_caches().
        """

_register(PathEntryFinder, machinery.FileFinder)


class Loader(metaclass=abc.ABCMeta):

    """Abstract base class for import loaders."""

    def create_module(self, spec):
        """Return a module to initialize and into which to load.

        This method should raise ImportError if anything prevents it
        from creating a new module.  It may return None to indicate
        that the spec should create the new module.
        """
        # By default, defer to default semantics for the new module.
        return None

    # We don't define exec_module() here since that would break
    # hasattr checks we do to support backward compatibility.

    def load_module(self, fullname):
        """Return the loaded module.

        The module must be added to sys.modules and have import-related
        attributes set properly.  The fullname is a str.

        ImportError is raised on failure.

        This method is deprecated in favor of loader.exec_module(). If
        exec_module() exists then it is used to provide a backwards-compatible
        functionality for this method.

        """
        if not hasattr(self, 'exec_module'):
            raise ImportError
        return _bootstrap._load_module_shim(self, fullname)

    def module_repr(self, module):
        """Return a module's repr.

        Used by the module type when the method does not raise
        NotImplementedError.

        This method is deprecated.

        """
        # The exception will cause ModuleType.__repr__ to ignore this method.
        raise NotImplementedError


class ResourceLoader(Loader):

    """Abstract base class for loaders which can return data from their
    back-end storage.

    This ABC represents one of the optional protocols specified by PEP 302.

    """

    @abc.abstractmethod
    def get_data(self, path):
        """Abstract method which when implemented should return the bytes for
        the specified path.  The path must be a str."""
        raise OSError


class InspectLoader(Loader):

    """Abstract base class for loaders which support inspection about the
    modules they can load.

    This ABC represents one of the optional protocols specified by PEP 302.

    """

    def is_package(self, fullname):
        """Optional method which when implemented should return whether the
        module is a package.  The fullname is a str.  Returns a bool.

        Raises ImportError if the module cannot be found.
        """
        raise ImportError

    def get_code(self, fullname):
        """Method which returns the code object for the module.

        The fullname is a str.  Returns a types.CodeType if possible, else
        returns None if a code object does not make sense
        (e.g. built-in module). Raises ImportError if the module cannot be
        found.
        """
        source = self.get_source(fullname)
        if source is None:
            return None
        return self.source_to_code(source)

    @abc.abstractmethod
    def get_source(self, fullname):
        """Abstract method which should return the source code for the
        module.  The fullname is a str.  Returns a str.

        Raises ImportError if the module cannot be found.
        """
        raise ImportError

    @staticmethod
    def source_to_code(data, path='<string>'):
        """Compile 'data' into a code object.

        The 'data' argument can be anything that compile() can handle. The'path'
        argument should be where the data was retrieved (when applicable)."""
        return compile(data, path, 'exec', dont_inherit=True)

    exec_module = _bootstrap_external._LoaderBasics.exec_module
    load_module = _bootstrap_external._LoaderBasics.load_module

_register(InspectLoader, machinery.BuiltinImporter, machinery.FrozenImporter)


class ExecutionLoader(InspectLoader):

    """Abstract base class for loaders that wish to support the execution of
    modules as scripts.

    This ABC represents one of the optional protocols specified in PEP 302.

    """

    @abc.abstractmethod
    def get_filename(self, fullname):
        """Abstract method which should return the value that __file__ is to be
        set to.

        Raises ImportError if the module cannot be found.
        """
        raise ImportError

    def get_code(self, fullname):
        """Method to return the code object for fullname.

        Should return None if not applicable (e.g. built-in module).
        Raise ImportError if the module cannot be found.
        """
        source = self.get_source(fullname)
        if source is None:
            return None
        try:
            path = self.get_filename(fullname)
        except ImportError:
            return self.source_to_code(source)
        else:
            return self.source_to_code(source, path)

_register(ExecutionLoader, machinery.ExtensionFileLoader)


class FileLoader(_bootstrap_external.FileLoader, ResourceLoader, ExecutionLoader):

    """Abstract base class partially implementing the ResourceLoader and
    ExecutionLoader ABCs."""

_register(FileLoader, machinery.SourceFileLoader,
            machinery.SourcelessFileLoader)


class SourceLoader(_bootstrap_external.SourceLoader, ResourceLoader, ExecutionLoader):

    """Abstract base class for loading source code (and optionally any
    corresponding bytecode).

    To support loading from source code, the abstractmethods inherited from
    ResourceLoader and ExecutionLoader need to be implemented. To also support
    loading from bytecode, the optional methods specified directly by this ABC
    is required.

    Inherited abstractmethods not implemented in this ABC:

        * ResourceLoader.get_data
        * ExecutionLoader.get_filename

    """

    def path_mtime(self, path):
        """Return the (int) modification time for the path (str)."""
        if self.path_stats.__func__ is SourceLoader.path_stats:
            raise OSError
        return int(self.path_stats(path)['mtime'])

    def path_stats(self, path):
        """Return a metadata dict for the source pointed to by the path (str).
        Possible keys:
        - 'mtime' (mandatory) is the numeric timestamp of last source
          code modification;
        - 'size' (optional) is the size in bytes of the source code.
        """
        if self.path_mtime.__func__ is SourceLoader.path_mtime:
            raise OSError
        return {'mtime': self.path_mtime(path)}

    def set_data(self, path, data):
        """Write the bytes to the path (if possible).

        Accepts a str path and data as bytes.

        Any needed intermediary directories are to be created. If for some
        reason the file cannot be written because of permissions, fail
        silently.
        """

_register(SourceLoader, machinery.SourceFileLoader)


class ResourceReader(metaclass=abc.ABCMeta):

    """Abstract base class to provide resource-reading support.

    Loaders that support resource reading are expected to implement
    the ``get_resource_reader(fullname)`` method and have it either return None
    or an object compatible with this ABC.
    """

    @abc.abstractmethod
    def open_resource(self, resource):
        """Return an opened, file-like object for binary reading.

        The 'resource' argument is expected to represent only a file name
        and thus not contain any subdirectory components.

        If the resource cannot be found, FileNotFoundError is raised.
        """
        raise FileNotFoundError

    @abc.abstractmethod
    def resource_path(self, resource):
        """Return the file system path to the specified resource.

        The 'resource' argument is expected to represent only a file name
        and thus not contain any subdirectory components.

        If the resource does not exist on the file system, raise
        FileNotFoundError.
        """
        raise FileNotFoundError

    @abc.abstractmethod
    def is_resource(self, name):
        """Return True if the named 'name' is consider a resource."""
        raise FileNotFoundError

    @abc.abstractmethod
    def contents(self):
        """Return an iterable of strings over the contents of the package."""
        return []


_register(ResourceReader, machinery.SourceFileLoader)
importlib/metadata.py000064400000042334151153537630010716 0ustar00import io
import os
import re
import abc
import csv
import sys
import email
import pathlib
import zipfile
import operator
import functools
import itertools
import posixpath
import collections

from configparser import ConfigParser
from contextlib import suppress
from importlib import import_module
from importlib.abc import MetaPathFinder
from itertools import starmap


__all__ = [
    'Distribution',
    'DistributionFinder',
    'PackageNotFoundError',
    'distribution',
    'distributions',
    'entry_points',
    'files',
    'metadata',
    'requires',
    'version',
    ]


class PackageNotFoundError(ModuleNotFoundError):
    """The package was not found."""


class EntryPoint(
        collections.namedtuple('EntryPointBase', 'name value group')):
    """An entry point as defined by Python packaging conventions.

    See `the packaging docs on entry points
    <https://packaging.python.org/specifications/entry-points/>`_
    for more information.
    """

    pattern = re.compile(
        r'(?P<module>[\w.]+)\s*'
        r'(:\s*(?P<attr>[\w.]+)\s*)?'
        r'((?P<extras>\[.*\])\s*)?$'
        )
    """
    A regular expression describing the syntax for an entry point,
    which might look like:

        - module
        - package.module
        - package.module:attribute
        - package.module:object.attribute
        - package.module:attr [extra1, extra2]

    Other combinations are possible as well.

    The expression is lenient about whitespace around the ':',
    following the attr, and following any extras.
    """

    def load(self):
        """Load the entry point from its definition. If only a module
        is indicated by the value, return that module. Otherwise,
        return the named object.
        """
        match = self.pattern.match(self.value)
        module = import_module(match.group('module'))
        attrs = filter(None, (match.group('attr') or '').split('.'))
        return functools.reduce(getattr, attrs, module)

    @property
    def extras(self):
        match = self.pattern.match(self.value)
        return list(re.finditer(r'\w+', match.group('extras') or ''))

    @classmethod
    def _from_config(cls, config):
        return [
            cls(name, value, group)
            for group in config.sections()
            for name, value in config.items(group)
            ]

    @classmethod
    def _from_text(cls, text):
        config = ConfigParser(delimiters='=')
        # case sensitive: https://stackoverflow.com/q/1611799/812183
        config.optionxform = str
        try:
            config.read_string(text)
        except AttributeError:  # pragma: nocover
            # Python 2 has no read_string
            config.readfp(io.StringIO(text))
        return EntryPoint._from_config(config)

    def __iter__(self):
        """
        Supply iter so one may construct dicts of EntryPoints easily.
        """
        return iter((self.name, self))

    def __reduce__(self):
        return (
            self.__class__,
            (self.name, self.value, self.group),
            )


class PackagePath(pathlib.PurePosixPath):
    """A reference to a path in a package"""

    def read_text(self, encoding='utf-8'):
        with self.locate().open(encoding=encoding) as stream:
            return stream.read()

    def read_binary(self):
        with self.locate().open('rb') as stream:
            return stream.read()

    def locate(self):
        """Return a path-like object for this path"""
        return self.dist.locate_file(self)


class FileHash:
    def __init__(self, spec):
        self.mode, _, self.value = spec.partition('=')

    def __repr__(self):
        return '<FileHash mode: {} value: {}>'.format(self.mode, self.value)


class Distribution:
    """A Python distribution package."""

    @abc.abstractmethod
    def read_text(self, filename):
        """Attempt to load metadata file given by the name.

        :param filename: The name of the file in the distribution info.
        :return: The text if found, otherwise None.
        """

    @abc.abstractmethod
    def locate_file(self, path):
        """
        Given a path to a file in this distribution, return a path
        to it.
        """

    @classmethod
    def from_name(cls, name):
        """Return the Distribution for the given package name.

        :param name: The name of the distribution package to search for.
        :return: The Distribution instance (or subclass thereof) for the named
            package, if found.
        :raises PackageNotFoundError: When the named package's distribution
            metadata cannot be found.
        """
        for resolver in cls._discover_resolvers():
            dists = resolver(DistributionFinder.Context(name=name))
            dist = next(dists, None)
            if dist is not None:
                return dist
        else:
            raise PackageNotFoundError(name)

    @classmethod
    def discover(cls, **kwargs):
        """Return an iterable of Distribution objects for all packages.

        Pass a ``context`` or pass keyword arguments for constructing
        a context.

        :context: A ``DistributionFinder.Context`` object.
        :return: Iterable of Distribution objects for all packages.
        """
        context = kwargs.pop('context', None)
        if context and kwargs:
            raise ValueError("cannot accept context and kwargs")
        context = context or DistributionFinder.Context(**kwargs)
        return itertools.chain.from_iterable(
            resolver(context)
            for resolver in cls._discover_resolvers()
            )

    @staticmethod
    def at(path):
        """Return a Distribution for the indicated metadata path

        :param path: a string or path-like object
        :return: a concrete Distribution instance for the path
        """
        return PathDistribution(pathlib.Path(path))

    @staticmethod
    def _discover_resolvers():
        """Search the meta_path for resolvers."""
        declared = (
            getattr(finder, 'find_distributions', None)
            for finder in sys.meta_path
            )
        return filter(None, declared)

    @property
    def metadata(self):
        """Return the parsed metadata for this Distribution.

        The returned object will have keys that name the various bits of
        metadata.  See PEP 566 for details.
        """
        text = (
            self.read_text('METADATA')
            or self.read_text('PKG-INFO')
            # This last clause is here to support old egg-info files.  Its
            # effect is to just end up using the PathDistribution's self._path
            # (which points to the egg-info file) attribute unchanged.
            or self.read_text('')
            )
        return email.message_from_string(text)

    @property
    def version(self):
        """Return the 'Version' metadata for the distribution package."""
        return self.metadata['Version']

    @property
    def entry_points(self):
        return EntryPoint._from_text(self.read_text('entry_points.txt'))

    @property
    def files(self):
        """Files in this distribution.

        :return: List of PackagePath for this distribution or None

        Result is `None` if the metadata file that enumerates files
        (i.e. RECORD for dist-info or SOURCES.txt for egg-info) is
        missing.
        Result may be empty if the metadata exists but is empty.
        """
        file_lines = self._read_files_distinfo() or self._read_files_egginfo()

        def make_file(name, hash=None, size_str=None):
            result = PackagePath(name)
            result.hash = FileHash(hash) if hash else None
            result.size = int(size_str) if size_str else None
            result.dist = self
            return result

        return file_lines and list(starmap(make_file, csv.reader(file_lines)))

    def _read_files_distinfo(self):
        """
        Read the lines of RECORD
        """
        text = self.read_text('RECORD')
        return text and text.splitlines()

    def _read_files_egginfo(self):
        """
        SOURCES.txt might contain literal commas, so wrap each line
        in quotes.
        """
        text = self.read_text('SOURCES.txt')
        return text and map('"{}"'.format, text.splitlines())

    @property
    def requires(self):
        """Generated requirements specified for this Distribution"""
        reqs = self._read_dist_info_reqs() or self._read_egg_info_reqs()
        return reqs and list(reqs)

    def _read_dist_info_reqs(self):
        return self.metadata.get_all('Requires-Dist')

    def _read_egg_info_reqs(self):
        source = self.read_text('requires.txt')
        return source and self._deps_from_requires_text(source)

    @classmethod
    def _deps_from_requires_text(cls, source):
        section_pairs = cls._read_sections(source.splitlines())
        sections = {
            section: list(map(operator.itemgetter('line'), results))
            for section, results in
            itertools.groupby(section_pairs, operator.itemgetter('section'))
            }
        return cls._convert_egg_info_reqs_to_simple_reqs(sections)

    @staticmethod
    def _read_sections(lines):
        section = None
        for line in filter(None, lines):
            section_match = re.match(r'\[(.*)\]$', line)
            if section_match:
                section = section_match.group(1)
                continue
            yield locals()

    @staticmethod
    def _convert_egg_info_reqs_to_simple_reqs(sections):
        """
        Historically, setuptools would solicit and store 'extra'
        requirements, including those with environment markers,
        in separate sections. More modern tools expect each
        dependency to be defined separately, with any relevant
        extras and environment markers attached directly to that
        requirement. This method converts the former to the
        latter. See _test_deps_from_requires_text for an example.
        """
        def make_condition(name):
            return name and 'extra == "{name}"'.format(name=name)

        def parse_condition(section):
            section = section or ''
            extra, sep, markers = section.partition(':')
            if extra and markers:
                markers = '({markers})'.format(markers=markers)
            conditions = list(filter(None, [markers, make_condition(extra)]))
            return '; ' + ' and '.join(conditions) if conditions else ''

        for section, deps in sections.items():
            for dep in deps:
                yield dep + parse_condition(section)


class DistributionFinder(MetaPathFinder):
    """
    A MetaPathFinder capable of discovering installed distributions.
    """

    class Context:
        """
        Keyword arguments presented by the caller to
        ``distributions()`` or ``Distribution.discover()``
        to narrow the scope of a search for distributions
        in all DistributionFinders.

        Each DistributionFinder may expect any parameters
        and should attempt to honor the canonical
        parameters defined below when appropriate.
        """

        name = None
        """
        Specific name for which a distribution finder should match.
        A name of ``None`` matches all distributions.
        """

        def __init__(self, **kwargs):
            vars(self).update(kwargs)

        @property
        def path(self):
            """
            The path that a distribution finder should search.

            Typically refers to Python package paths and defaults
            to ``sys.path``.
            """
            return vars(self).get('path', sys.path)

    @abc.abstractmethod
    def find_distributions(self, context=Context()):
        """
        Find distributions.

        Return an iterable of all Distribution instances capable of
        loading the metadata for packages matching the ``context``,
        a DistributionFinder.Context instance.
        """


class FastPath:
    """
    Micro-optimized class for searching a path for
    children.
    """

    def __init__(self, root):
        self.root = root
        self.base = os.path.basename(root).lower()

    def joinpath(self, child):
        return pathlib.Path(self.root, child)

    def children(self):
        with suppress(Exception):
            return os.listdir(self.root or '')
        with suppress(Exception):
            return self.zip_children()
        return []

    def zip_children(self):
        zip_path = zipfile.Path(self.root)
        names = zip_path.root.namelist()
        self.joinpath = zip_path.joinpath

        return dict.fromkeys(
            child.split(posixpath.sep, 1)[0]
            for child in names
            )

    def is_egg(self, search):
        base = self.base
        return (
            base == search.versionless_egg_name
            or base.startswith(search.prefix)
            and base.endswith('.egg'))

    def search(self, name):
        for child in self.children():
            n_low = child.lower()
            if (n_low in name.exact_matches
                    or n_low.startswith(name.prefix)
                    and n_low.endswith(name.suffixes)
                    # legacy case:
                    or self.is_egg(name) and n_low == 'egg-info'):
                yield self.joinpath(child)


class Prepared:
    """
    A prepared search for metadata on a possibly-named package.
    """
    normalized = ''
    prefix = ''
    suffixes = '.dist-info', '.egg-info'
    exact_matches = [''][:0]
    versionless_egg_name = ''

    def __init__(self, name):
        self.name = name
        if name is None:
            return
        self.normalized = name.lower().replace('-', '_')
        self.prefix = self.normalized + '-'
        self.exact_matches = [
            self.normalized + suffix for suffix in self.suffixes]
        self.versionless_egg_name = self.normalized + '.egg'


class MetadataPathFinder(DistributionFinder):
    @classmethod
    def find_distributions(cls, context=DistributionFinder.Context()):
        """
        Find distributions.

        Return an iterable of all Distribution instances capable of
        loading the metadata for packages matching ``context.name``
        (or all names if ``None`` indicated) along the paths in the list
        of directories ``context.path``.
        """
        found = cls._search_paths(context.name, context.path)
        return map(PathDistribution, found)

    @classmethod
    def _search_paths(cls, name, paths):
        """Find metadata directories in paths heuristically."""
        return itertools.chain.from_iterable(
            path.search(Prepared(name))
            for path in map(FastPath, paths)
            )


class PathDistribution(Distribution):
    def __init__(self, path):
        """Construct a distribution from a path to the metadata directory.

        :param path: A pathlib.Path or similar object supporting
                     .joinpath(), __div__, .parent, and .read_text().
        """
        self._path = path

    def read_text(self, filename):
        with suppress(FileNotFoundError, IsADirectoryError, KeyError,
                      NotADirectoryError, PermissionError):
            return self._path.joinpath(filename).read_text(encoding='utf-8')
    read_text.__doc__ = Distribution.read_text.__doc__

    def locate_file(self, path):
        return self._path.parent / path


def distribution(distribution_name):
    """Get the ``Distribution`` instance for the named package.

    :param distribution_name: The name of the distribution package as a string.
    :return: A ``Distribution`` instance (or subclass thereof).
    """
    return Distribution.from_name(distribution_name)


def distributions(**kwargs):
    """Get all ``Distribution`` instances in the current environment.

    :return: An iterable of ``Distribution`` instances.
    """
    return Distribution.discover(**kwargs)


def metadata(distribution_name):
    """Get the metadata for the named package.

    :param distribution_name: The name of the distribution package to query.
    :return: An email.Message containing the parsed metadata.
    """
    return Distribution.from_name(distribution_name).metadata


def version(distribution_name):
    """Get the version string for the named package.

    :param distribution_name: The name of the distribution package to query.
    :return: The version string for the package as defined in the package's
        "Version" metadata key.
    """
    return distribution(distribution_name).version


def entry_points():
    """Return EntryPoint objects for all installed packages.

    :return: EntryPoint objects for all installed packages.
    """
    eps = itertools.chain.from_iterable(
        dist.entry_points for dist in distributions())
    by_group = operator.attrgetter('group')
    ordered = sorted(eps, key=by_group)
    grouped = itertools.groupby(ordered, by_group)
    return {
        group: tuple(eps)
        for group, eps in grouped
        }


def files(distribution_name):
    """Return a list of files for the named package.

    :param distribution_name: The name of the distribution package to query.
    :return: List of files composing the distribution.
    """
    return distribution(distribution_name).files


def requires(distribution_name):
    """
    Return a list of requirements for the named package.

    :return: An iterator of requirements, suitable for
    packaging.requirement.Requirement.
    """
    return distribution(distribution_name).requires
telnetlib.py000064400000055326151153537630007124 0ustar00r"""TELNET client class.

Based on RFC 854: TELNET Protocol Specification, by J. Postel and
J. Reynolds

Example:

>>> from telnetlib import Telnet
>>> tn = Telnet('www.python.org', 79)   # connect to finger port
>>> tn.write(b'guido\r\n')
>>> print(tn.read_all())
Login       Name               TTY         Idle    When    Where
guido    Guido van Rossum      pts/2        <Dec  2 11:10> snag.cnri.reston..

>>>

Note that read_all() won't read until eof -- it just reads some data
-- but it guarantees to read at least one byte unless EOF is hit.

It is possible to pass a Telnet object to a selector in order to wait until
more data is available.  Note that in this case, read_eager() may return b''
even if there was data on the socket, because the protocol negotiation may have
eaten the data.  This is why EOFError is needed in some cases to distinguish
between "no data" and "connection closed" (since the socket also appears ready
for reading when it is closed).

To do:
- option negotiation
- timeout should be intrinsic to the connection object instead of an
  option on one of the read calls only

"""


# Imported modules
import sys
import socket
import selectors
from time import monotonic as _time

__all__ = ["Telnet"]

# Tunable parameters
DEBUGLEVEL = 0

# Telnet protocol defaults
TELNET_PORT = 23

# Telnet protocol characters (don't change)
IAC  = bytes([255]) # "Interpret As Command"
DONT = bytes([254])
DO   = bytes([253])
WONT = bytes([252])
WILL = bytes([251])
theNULL = bytes([0])

SE  = bytes([240])  # Subnegotiation End
NOP = bytes([241])  # No Operation
DM  = bytes([242])  # Data Mark
BRK = bytes([243])  # Break
IP  = bytes([244])  # Interrupt process
AO  = bytes([245])  # Abort output
AYT = bytes([246])  # Are You There
EC  = bytes([247])  # Erase Character
EL  = bytes([248])  # Erase Line
GA  = bytes([249])  # Go Ahead
SB =  bytes([250])  # Subnegotiation Begin


# Telnet protocol options code (don't change)
# These ones all come from arpa/telnet.h
BINARY = bytes([0]) # 8-bit data path
ECHO = bytes([1]) # echo
RCP = bytes([2]) # prepare to reconnect
SGA = bytes([3]) # suppress go ahead
NAMS = bytes([4]) # approximate message size
STATUS = bytes([5]) # give status
TM = bytes([6]) # timing mark
RCTE = bytes([7]) # remote controlled transmission and echo
NAOL = bytes([8]) # negotiate about output line width
NAOP = bytes([9]) # negotiate about output page size
NAOCRD = bytes([10]) # negotiate about CR disposition
NAOHTS = bytes([11]) # negotiate about horizontal tabstops
NAOHTD = bytes([12]) # negotiate about horizontal tab disposition
NAOFFD = bytes([13]) # negotiate about formfeed disposition
NAOVTS = bytes([14]) # negotiate about vertical tab stops
NAOVTD = bytes([15]) # negotiate about vertical tab disposition
NAOLFD = bytes([16]) # negotiate about output LF disposition
XASCII = bytes([17]) # extended ascii character set
LOGOUT = bytes([18]) # force logout
BM = bytes([19]) # byte macro
DET = bytes([20]) # data entry terminal
SUPDUP = bytes([21]) # supdup protocol
SUPDUPOUTPUT = bytes([22]) # supdup output
SNDLOC = bytes([23]) # send location
TTYPE = bytes([24]) # terminal type
EOR = bytes([25]) # end or record
TUID = bytes([26]) # TACACS user identification
OUTMRK = bytes([27]) # output marking
TTYLOC = bytes([28]) # terminal location number
VT3270REGIME = bytes([29]) # 3270 regime
X3PAD = bytes([30]) # X.3 PAD
NAWS = bytes([31]) # window size
TSPEED = bytes([32]) # terminal speed
LFLOW = bytes([33]) # remote flow control
LINEMODE = bytes([34]) # Linemode option
XDISPLOC = bytes([35]) # X Display Location
OLD_ENVIRON = bytes([36]) # Old - Environment variables
AUTHENTICATION = bytes([37]) # Authenticate
ENCRYPT = bytes([38]) # Encryption option
NEW_ENVIRON = bytes([39]) # New - Environment variables
# the following ones come from
# http://www.iana.org/assignments/telnet-options
# Unfortunately, that document does not assign identifiers
# to all of them, so we are making them up
TN3270E = bytes([40]) # TN3270E
XAUTH = bytes([41]) # XAUTH
CHARSET = bytes([42]) # CHARSET
RSP = bytes([43]) # Telnet Remote Serial Port
COM_PORT_OPTION = bytes([44]) # Com Port Control Option
SUPPRESS_LOCAL_ECHO = bytes([45]) # Telnet Suppress Local Echo
TLS = bytes([46]) # Telnet Start TLS
KERMIT = bytes([47]) # KERMIT
SEND_URL = bytes([48]) # SEND-URL
FORWARD_X = bytes([49]) # FORWARD_X
PRAGMA_LOGON = bytes([138]) # TELOPT PRAGMA LOGON
SSPI_LOGON = bytes([139]) # TELOPT SSPI LOGON
PRAGMA_HEARTBEAT = bytes([140]) # TELOPT PRAGMA HEARTBEAT
EXOPL = bytes([255]) # Extended-Options-List
NOOPT = bytes([0])


# poll/select have the advantage of not requiring any extra file descriptor,
# contrarily to epoll/kqueue (also, they require a single syscall).
if hasattr(selectors, 'PollSelector'):
    _TelnetSelector = selectors.PollSelector
else:
    _TelnetSelector = selectors.SelectSelector


class Telnet:

    """Telnet interface class.

    An instance of this class represents a connection to a telnet
    server.  The instance is initially not connected; the open()
    method must be used to establish a connection.  Alternatively, the
    host name and optional port number can be passed to the
    constructor, too.

    Don't try to reopen an already connected instance.

    This class has many read_*() methods.  Note that some of them
    raise EOFError when the end of the connection is read, because
    they can return an empty string for other reasons.  See the
    individual doc strings.

    read_until(expected, [timeout])
        Read until the expected string has been seen, or a timeout is
        hit (default is no timeout); may block.

    read_all()
        Read all data until EOF; may block.

    read_some()
        Read at least one byte or EOF; may block.

    read_very_eager()
        Read all data available already queued or on the socket,
        without blocking.

    read_eager()
        Read either data already queued or some data available on the
        socket, without blocking.

    read_lazy()
        Read all data in the raw queue (processing it first), without
        doing any socket I/O.

    read_very_lazy()
        Reads all data in the cooked queue, without doing any socket
        I/O.

    read_sb_data()
        Reads available data between SB ... SE sequence. Don't block.

    set_option_negotiation_callback(callback)
        Each time a telnet option is read on the input flow, this callback
        (if set) is called with the following parameters :
        callback(telnet socket, command, option)
            option will be chr(0) when there is no option.
        No other action is done afterwards by telnetlib.

    """

    def __init__(self, host=None, port=0,
                 timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
        """Constructor.

        When called without arguments, create an unconnected instance.
        With a hostname argument, it connects the instance; port number
        and timeout are optional.
        """
        self.debuglevel = DEBUGLEVEL
        self.host = host
        self.port = port
        self.timeout = timeout
        self.sock = None
        self.rawq = b''
        self.irawq = 0
        self.cookedq = b''
        self.eof = 0
        self.iacseq = b'' # Buffer for IAC sequence.
        self.sb = 0 # flag for SB and SE sequence.
        self.sbdataq = b''
        self.option_callback = None
        if host is not None:
            self.open(host, port, timeout)

    def open(self, host, port=0, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
        """Connect to a host.

        The optional second argument is the port number, which
        defaults to the standard telnet port (23).

        Don't try to reopen an already connected instance.
        """
        self.eof = 0
        if not port:
            port = TELNET_PORT
        self.host = host
        self.port = port
        self.timeout = timeout
        sys.audit("telnetlib.Telnet.open", self, host, port)
        self.sock = socket.create_connection((host, port), timeout)

    def __del__(self):
        """Destructor -- close the connection."""
        self.close()

    def msg(self, msg, *args):
        """Print a debug message, when the debug level is > 0.

        If extra arguments are present, they are substituted in the
        message using the standard string formatting operator.

        """
        if self.debuglevel > 0:
            print('Telnet(%s,%s):' % (self.host, self.port), end=' ')
            if args:
                print(msg % args)
            else:
                print(msg)

    def set_debuglevel(self, debuglevel):
        """Set the debug level.

        The higher it is, the more debug output you get (on sys.stdout).

        """
        self.debuglevel = debuglevel

    def close(self):
        """Close the connection."""
        sock = self.sock
        self.sock = None
        self.eof = True
        self.iacseq = b''
        self.sb = 0
        if sock:
            sock.close()

    def get_socket(self):
        """Return the socket object used internally."""
        return self.sock

    def fileno(self):
        """Return the fileno() of the socket object used internally."""
        return self.sock.fileno()

    def write(self, buffer):
        """Write a string to the socket, doubling any IAC characters.

        Can block if the connection is blocked.  May raise
        OSError if the connection is closed.

        """
        if IAC in buffer:
            buffer = buffer.replace(IAC, IAC+IAC)
        sys.audit("telnetlib.Telnet.write", self, buffer)
        self.msg("send %r", buffer)
        self.sock.sendall(buffer)

    def read_until(self, match, timeout=None):
        """Read until a given string is encountered or until timeout.

        When no match is found, return whatever is available instead,
        possibly the empty string.  Raise EOFError if the connection
        is closed and no cooked data is available.

        """
        n = len(match)
        self.process_rawq()
        i = self.cookedq.find(match)
        if i >= 0:
            i = i+n
            buf = self.cookedq[:i]
            self.cookedq = self.cookedq[i:]
            return buf
        if timeout is not None:
            deadline = _time() + timeout
        with _TelnetSelector() as selector:
            selector.register(self, selectors.EVENT_READ)
            while not self.eof:
                if selector.select(timeout):
                    i = max(0, len(self.cookedq)-n)
                    self.fill_rawq()
                    self.process_rawq()
                    i = self.cookedq.find(match, i)
                    if i >= 0:
                        i = i+n
                        buf = self.cookedq[:i]
                        self.cookedq = self.cookedq[i:]
                        return buf
                if timeout is not None:
                    timeout = deadline - _time()
                    if timeout < 0:
                        break
        return self.read_very_lazy()

    def read_all(self):
        """Read all data until EOF; block until connection closed."""
        self.process_rawq()
        while not self.eof:
            self.fill_rawq()
            self.process_rawq()
        buf = self.cookedq
        self.cookedq = b''
        return buf

    def read_some(self):
        """Read at least one byte of cooked data unless EOF is hit.

        Return b'' if EOF is hit.  Block if no data is immediately
        available.

        """
        self.process_rawq()
        while not self.cookedq and not self.eof:
            self.fill_rawq()
            self.process_rawq()
        buf = self.cookedq
        self.cookedq = b''
        return buf

    def read_very_eager(self):
        """Read everything that's possible without blocking in I/O (eager).

        Raise EOFError if connection closed and no cooked data
        available.  Return b'' if no cooked data available otherwise.
        Don't block unless in the midst of an IAC sequence.

        """
        self.process_rawq()
        while not self.eof and self.sock_avail():
            self.fill_rawq()
            self.process_rawq()
        return self.read_very_lazy()

    def read_eager(self):
        """Read readily available data.

        Raise EOFError if connection closed and no cooked data
        available.  Return b'' if no cooked data available otherwise.
        Don't block unless in the midst of an IAC sequence.

        """
        self.process_rawq()
        while not self.cookedq and not self.eof and self.sock_avail():
            self.fill_rawq()
            self.process_rawq()
        return self.read_very_lazy()

    def read_lazy(self):
        """Process and return data that's already in the queues (lazy).

        Raise EOFError if connection closed and no data available.
        Return b'' if no cooked data available otherwise.  Don't block
        unless in the midst of an IAC sequence.

        """
        self.process_rawq()
        return self.read_very_lazy()

    def read_very_lazy(self):
        """Return any data available in the cooked queue (very lazy).

        Raise EOFError if connection closed and no data available.
        Return b'' if no cooked data available otherwise.  Don't block.

        """
        buf = self.cookedq
        self.cookedq = b''
        if not buf and self.eof and not self.rawq:
            raise EOFError('telnet connection closed')
        return buf

    def read_sb_data(self):
        """Return any data available in the SB ... SE queue.

        Return b'' if no SB ... SE available. Should only be called
        after seeing a SB or SE command. When a new SB command is
        found, old unread SB data will be discarded. Don't block.

        """
        buf = self.sbdataq
        self.sbdataq = b''
        return buf

    def set_option_negotiation_callback(self, callback):
        """Provide a callback function called after each receipt of a telnet option."""
        self.option_callback = callback

    def process_rawq(self):
        """Transfer from raw queue to cooked queue.

        Set self.eof when connection is closed.  Don't block unless in
        the midst of an IAC sequence.

        """
        buf = [b'', b'']
        try:
            while self.rawq:
                c = self.rawq_getchar()
                if not self.iacseq:
                    if c == theNULL:
                        continue
                    if c == b"\021":
                        continue
                    if c != IAC:
                        buf[self.sb] = buf[self.sb] + c
                        continue
                    else:
                        self.iacseq += c
                elif len(self.iacseq) == 1:
                    # 'IAC: IAC CMD [OPTION only for WILL/WONT/DO/DONT]'
                    if c in (DO, DONT, WILL, WONT):
                        self.iacseq += c
                        continue

                    self.iacseq = b''
                    if c == IAC:
                        buf[self.sb] = buf[self.sb] + c
                    else:
                        if c == SB: # SB ... SE start.
                            self.sb = 1
                            self.sbdataq = b''
                        elif c == SE:
                            self.sb = 0
                            self.sbdataq = self.sbdataq + buf[1]
                            buf[1] = b''
                        if self.option_callback:
                            # Callback is supposed to look into
                            # the sbdataq
                            self.option_callback(self.sock, c, NOOPT)
                        else:
                            # We can't offer automatic processing of
                            # suboptions. Alas, we should not get any
                            # unless we did a WILL/DO before.
                            self.msg('IAC %d not recognized' % ord(c))
                elif len(self.iacseq) == 2:
                    cmd = self.iacseq[1:2]
                    self.iacseq = b''
                    opt = c
                    if cmd in (DO, DONT):
                        self.msg('IAC %s %d',
                            cmd == DO and 'DO' or 'DONT', ord(opt))
                        if self.option_callback:
                            self.option_callback(self.sock, cmd, opt)
                        else:
                            self.sock.sendall(IAC + WONT + opt)
                    elif cmd in (WILL, WONT):
                        self.msg('IAC %s %d',
                            cmd == WILL and 'WILL' or 'WONT', ord(opt))
                        if self.option_callback:
                            self.option_callback(self.sock, cmd, opt)
                        else:
                            self.sock.sendall(IAC + DONT + opt)
        except EOFError: # raised by self.rawq_getchar()
            self.iacseq = b'' # Reset on EOF
            self.sb = 0
            pass
        self.cookedq = self.cookedq + buf[0]
        self.sbdataq = self.sbdataq + buf[1]

    def rawq_getchar(self):
        """Get next char from raw queue.

        Block if no data is immediately available.  Raise EOFError
        when connection is closed.

        """
        if not self.rawq:
            self.fill_rawq()
            if self.eof:
                raise EOFError
        c = self.rawq[self.irawq:self.irawq+1]
        self.irawq = self.irawq + 1
        if self.irawq >= len(self.rawq):
            self.rawq = b''
            self.irawq = 0
        return c

    def fill_rawq(self):
        """Fill raw queue from exactly one recv() system call.

        Block if no data is immediately available.  Set self.eof when
        connection is closed.

        """
        if self.irawq >= len(self.rawq):
            self.rawq = b''
            self.irawq = 0
        # The buffer size should be fairly small so as to avoid quadratic
        # behavior in process_rawq() above
        buf = self.sock.recv(50)
        self.msg("recv %r", buf)
        self.eof = (not buf)
        self.rawq = self.rawq + buf

    def sock_avail(self):
        """Test whether data is available on the socket."""
        with _TelnetSelector() as selector:
            selector.register(self, selectors.EVENT_READ)
            return bool(selector.select(0))

    def interact(self):
        """Interaction function, emulates a very dumb telnet client."""
        if sys.platform == "win32":
            self.mt_interact()
            return
        with _TelnetSelector() as selector:
            selector.register(self, selectors.EVENT_READ)
            selector.register(sys.stdin, selectors.EVENT_READ)

            while True:
                for key, events in selector.select():
                    if key.fileobj is self:
                        try:
                            text = self.read_eager()
                        except EOFError:
                            print('*** Connection closed by remote host ***')
                            return
                        if text:
                            sys.stdout.write(text.decode('ascii'))
                            sys.stdout.flush()
                    elif key.fileobj is sys.stdin:
                        line = sys.stdin.readline().encode('ascii')
                        if not line:
                            return
                        self.write(line)

    def mt_interact(self):
        """Multithreaded version of interact()."""
        import _thread
        _thread.start_new_thread(self.listener, ())
        while 1:
            line = sys.stdin.readline()
            if not line:
                break
            self.write(line.encode('ascii'))

    def listener(self):
        """Helper for mt_interact() -- this executes in the other thread."""
        while 1:
            try:
                data = self.read_eager()
            except EOFError:
                print('*** Connection closed by remote host ***')
                return
            if data:
                sys.stdout.write(data.decode('ascii'))
            else:
                sys.stdout.flush()

    def expect(self, list, timeout=None):
        """Read until one from a list of a regular expressions matches.

        The first argument is a list of regular expressions, either
        compiled (re.Pattern instances) or uncompiled (strings).
        The optional second argument is a timeout, in seconds; default
        is no timeout.

        Return a tuple of three items: the index in the list of the
        first regular expression that matches; the re.Match object
        returned; and the text read up till and including the match.

        If EOF is read and no text was read, raise EOFError.
        Otherwise, when nothing matches, return (-1, None, text) where
        text is the text received so far (may be the empty string if a
        timeout happened).

        If a regular expression ends with a greedy match (e.g. '.*')
        or if more than one expression can match the same input, the
        results are undeterministic, and may depend on the I/O timing.

        """
        re = None
        list = list[:]
        indices = range(len(list))
        for i in indices:
            if not hasattr(list[i], "search"):
                if not re: import re
                list[i] = re.compile(list[i])
        if timeout is not None:
            deadline = _time() + timeout
        with _TelnetSelector() as selector:
            selector.register(self, selectors.EVENT_READ)
            while not self.eof:
                self.process_rawq()
                for i in indices:
                    m = list[i].search(self.cookedq)
                    if m:
                        e = m.end()
                        text = self.cookedq[:e]
                        self.cookedq = self.cookedq[e:]
                        return (i, m, text)
                if timeout is not None:
                    ready = selector.select(timeout)
                    timeout = deadline - _time()
                    if not ready:
                        if timeout < 0:
                            break
                        else:
                            continue
                self.fill_rawq()
        text = self.read_very_lazy()
        if not text and self.eof:
            raise EOFError
        return (-1, None, text)

    def __enter__(self):
        return self

    def __exit__(self, type, value, traceback):
        self.close()


def test():
    """Test program for telnetlib.

    Usage: python telnetlib.py [-d] ... [host [port]]

    Default host is localhost; default port is 23.

    """
    debuglevel = 0
    while sys.argv[1:] and sys.argv[1] == '-d':
        debuglevel = debuglevel+1
        del sys.argv[1]
    host = 'localhost'
    if sys.argv[1:]:
        host = sys.argv[1]
    port = 0
    if sys.argv[2:]:
        portstr = sys.argv[2]
        try:
            port = int(portstr)
        except ValueError:
            port = socket.getservbyname(portstr, 'tcp')
    with Telnet() as tn:
        tn.set_debuglevel(debuglevel)
        tn.open(host, port, timeout=0.5)
        tn.interact()

if __name__ == '__main__':
    test()
dis.py000064400000050132151153537630005707 0ustar00"""Disassembler of Python byte code into mnemonics."""

import sys
import types
import collections
import io

from opcode import *
from opcode import __all__ as _opcodes_all

__all__ = ["code_info", "dis", "disassemble", "distb", "disco",
           "findlinestarts", "findlabels", "show_code",
           "get_instructions", "Instruction", "Bytecode"] + _opcodes_all
del _opcodes_all

_have_code = (types.MethodType, types.FunctionType, types.CodeType,
              classmethod, staticmethod, type)

FORMAT_VALUE = opmap['FORMAT_VALUE']
FORMAT_VALUE_CONVERTERS = (
    (None, ''),
    (str, 'str'),
    (repr, 'repr'),
    (ascii, 'ascii'),
)
MAKE_FUNCTION = opmap['MAKE_FUNCTION']
MAKE_FUNCTION_FLAGS = ('defaults', 'kwdefaults', 'annotations', 'closure')


def _try_compile(source, name):
    """Attempts to compile the given source, first as an expression and
       then as a statement if the first approach fails.

       Utility function to accept strings in functions that otherwise
       expect code objects
    """
    try:
        c = compile(source, name, 'eval')
    except SyntaxError:
        c = compile(source, name, 'exec')
    return c

def dis(x=None, *, file=None, depth=None):
    """Disassemble classes, methods, functions, and other compiled objects.

    With no argument, disassemble the last traceback.

    Compiled objects currently include generator objects, async generator
    objects, and coroutine objects, all of which store their code object
    in a special attribute.
    """
    if x is None:
        distb(file=file)
        return
    # Extract functions from methods.
    if hasattr(x, '__func__'):
        x = x.__func__
    # Extract compiled code objects from...
    if hasattr(x, '__code__'):  # ...a function, or
        x = x.__code__
    elif hasattr(x, 'gi_code'):  #...a generator object, or
        x = x.gi_code
    elif hasattr(x, 'ag_code'):  #...an asynchronous generator object, or
        x = x.ag_code
    elif hasattr(x, 'cr_code'):  #...a coroutine.
        x = x.cr_code
    # Perform the disassembly.
    if hasattr(x, '__dict__'):  # Class or module
        items = sorted(x.__dict__.items())
        for name, x1 in items:
            if isinstance(x1, _have_code):
                print("Disassembly of %s:" % name, file=file)
                try:
                    dis(x1, file=file, depth=depth)
                except TypeError as msg:
                    print("Sorry:", msg, file=file)
                print(file=file)
    elif hasattr(x, 'co_code'): # Code object
        _disassemble_recursive(x, file=file, depth=depth)
    elif isinstance(x, (bytes, bytearray)): # Raw bytecode
        _disassemble_bytes(x, file=file)
    elif isinstance(x, str):    # Source code
        _disassemble_str(x, file=file, depth=depth)
    else:
        raise TypeError("don't know how to disassemble %s objects" %
                        type(x).__name__)

def distb(tb=None, *, file=None):
    """Disassemble a traceback (default: last traceback)."""
    if tb is None:
        try:
            tb = sys.last_traceback
        except AttributeError:
            raise RuntimeError("no last traceback to disassemble") from None
        while tb.tb_next: tb = tb.tb_next
    disassemble(tb.tb_frame.f_code, tb.tb_lasti, file=file)

# The inspect module interrogates this dictionary to build its
# list of CO_* constants. It is also used by pretty_flags to
# turn the co_flags field into a human readable list.
COMPILER_FLAG_NAMES = {
     1: "OPTIMIZED",
     2: "NEWLOCALS",
     4: "VARARGS",
     8: "VARKEYWORDS",
    16: "NESTED",
    32: "GENERATOR",
    64: "NOFREE",
   128: "COROUTINE",
   256: "ITERABLE_COROUTINE",
   512: "ASYNC_GENERATOR",
}

def pretty_flags(flags):
    """Return pretty representation of code flags."""
    names = []
    for i in range(32):
        flag = 1<<i
        if flags & flag:
            names.append(COMPILER_FLAG_NAMES.get(flag, hex(flag)))
            flags ^= flag
            if not flags:
                break
    else:
        names.append(hex(flags))
    return ", ".join(names)

def _get_code_object(x):
    """Helper to handle methods, compiled or raw code objects, and strings."""
    # Extract functions from methods.
    if hasattr(x, '__func__'):
        x = x.__func__
    # Extract compiled code objects from...
    if hasattr(x, '__code__'):  # ...a function, or
        x = x.__code__
    elif hasattr(x, 'gi_code'):  #...a generator object, or
        x = x.gi_code
    elif hasattr(x, 'ag_code'):  #...an asynchronous generator object, or
        x = x.ag_code
    elif hasattr(x, 'cr_code'):  #...a coroutine.
        x = x.cr_code
    # Handle source code.
    if isinstance(x, str):
        x = _try_compile(x, "<disassembly>")
    # By now, if we don't have a code object, we can't disassemble x.
    if hasattr(x, 'co_code'):
        return x
    raise TypeError("don't know how to disassemble %s objects" %
                    type(x).__name__)

def code_info(x):
    """Formatted details of methods, functions, or code."""
    return _format_code_info(_get_code_object(x))

def _format_code_info(co):
    lines = []
    lines.append("Name:              %s" % co.co_name)
    lines.append("Filename:          %s" % co.co_filename)
    lines.append("Argument count:    %s" % co.co_argcount)
    lines.append("Positional-only arguments: %s" % co.co_posonlyargcount)
    lines.append("Kw-only arguments: %s" % co.co_kwonlyargcount)
    lines.append("Number of locals:  %s" % co.co_nlocals)
    lines.append("Stack size:        %s" % co.co_stacksize)
    lines.append("Flags:             %s" % pretty_flags(co.co_flags))
    if co.co_consts:
        lines.append("Constants:")
        for i_c in enumerate(co.co_consts):
            lines.append("%4d: %r" % i_c)
    if co.co_names:
        lines.append("Names:")
        for i_n in enumerate(co.co_names):
            lines.append("%4d: %s" % i_n)
    if co.co_varnames:
        lines.append("Variable names:")
        for i_n in enumerate(co.co_varnames):
            lines.append("%4d: %s" % i_n)
    if co.co_freevars:
        lines.append("Free variables:")
        for i_n in enumerate(co.co_freevars):
            lines.append("%4d: %s" % i_n)
    if co.co_cellvars:
        lines.append("Cell variables:")
        for i_n in enumerate(co.co_cellvars):
            lines.append("%4d: %s" % i_n)
    return "\n".join(lines)

def show_code(co, *, file=None):
    """Print details of methods, functions, or code to *file*.

    If *file* is not provided, the output is printed on stdout.
    """
    print(code_info(co), file=file)

_Instruction = collections.namedtuple("_Instruction",
     "opname opcode arg argval argrepr offset starts_line is_jump_target")

_Instruction.opname.__doc__ = "Human readable name for operation"
_Instruction.opcode.__doc__ = "Numeric code for operation"
_Instruction.arg.__doc__ = "Numeric argument to operation (if any), otherwise None"
_Instruction.argval.__doc__ = "Resolved arg value (if known), otherwise same as arg"
_Instruction.argrepr.__doc__ = "Human readable description of operation argument"
_Instruction.offset.__doc__ = "Start index of operation within bytecode sequence"
_Instruction.starts_line.__doc__ = "Line started by this opcode (if any), otherwise None"
_Instruction.is_jump_target.__doc__ = "True if other code jumps to here, otherwise False"

_OPNAME_WIDTH = 20
_OPARG_WIDTH = 5

class Instruction(_Instruction):
    """Details for a bytecode operation

       Defined fields:
         opname - human readable name for operation
         opcode - numeric code for operation
         arg - numeric argument to operation (if any), otherwise None
         argval - resolved arg value (if known), otherwise same as arg
         argrepr - human readable description of operation argument
         offset - start index of operation within bytecode sequence
         starts_line - line started by this opcode (if any), otherwise None
         is_jump_target - True if other code jumps to here, otherwise False
    """

    def _disassemble(self, lineno_width=3, mark_as_current=False, offset_width=4):
        """Format instruction details for inclusion in disassembly output

        *lineno_width* sets the width of the line number field (0 omits it)
        *mark_as_current* inserts a '-->' marker arrow as part of the line
        *offset_width* sets the width of the instruction offset field
        """
        fields = []
        # Column: Source code line number
        if lineno_width:
            if self.starts_line is not None:
                lineno_fmt = "%%%dd" % lineno_width
                fields.append(lineno_fmt % self.starts_line)
            else:
                fields.append(' ' * lineno_width)
        # Column: Current instruction indicator
        if mark_as_current:
            fields.append('-->')
        else:
            fields.append('   ')
        # Column: Jump target marker
        if self.is_jump_target:
            fields.append('>>')
        else:
            fields.append('  ')
        # Column: Instruction offset from start of code sequence
        fields.append(repr(self.offset).rjust(offset_width))
        # Column: Opcode name
        fields.append(self.opname.ljust(_OPNAME_WIDTH))
        # Column: Opcode argument
        if self.arg is not None:
            fields.append(repr(self.arg).rjust(_OPARG_WIDTH))
            # Column: Opcode argument details
            if self.argrepr:
                fields.append('(' + self.argrepr + ')')
        return ' '.join(fields).rstrip()


def get_instructions(x, *, first_line=None):
    """Iterator for the opcodes in methods, functions or code

    Generates a series of Instruction named tuples giving the details of
    each operations in the supplied code.

    If *first_line* is not None, it indicates the line number that should
    be reported for the first source line in the disassembled code.
    Otherwise, the source line information (if any) is taken directly from
    the disassembled code object.
    """
    co = _get_code_object(x)
    cell_names = co.co_cellvars + co.co_freevars
    linestarts = dict(findlinestarts(co))
    if first_line is not None:
        line_offset = first_line - co.co_firstlineno
    else:
        line_offset = 0
    return _get_instructions_bytes(co.co_code, co.co_varnames, co.co_names,
                                   co.co_consts, cell_names, linestarts,
                                   line_offset)

def _get_const_info(const_index, const_list):
    """Helper to get optional details about const references

       Returns the dereferenced constant and its repr if the constant
       list is defined.
       Otherwise returns the constant index and its repr().
    """
    argval = const_index
    if const_list is not None:
        argval = const_list[const_index]
    return argval, repr(argval)

def _get_name_info(name_index, name_list):
    """Helper to get optional details about named references

       Returns the dereferenced name as both value and repr if the name
       list is defined.
       Otherwise returns the name index and its repr().
    """
    argval = name_index
    if name_list is not None:
        argval = name_list[name_index]
        argrepr = argval
    else:
        argrepr = repr(argval)
    return argval, argrepr


def _get_instructions_bytes(code, varnames=None, names=None, constants=None,
                      cells=None, linestarts=None, line_offset=0):
    """Iterate over the instructions in a bytecode string.

    Generates a sequence of Instruction namedtuples giving the details of each
    opcode.  Additional information about the code's runtime environment
    (e.g. variable names, constants) can be specified using optional
    arguments.

    """
    labels = findlabels(code)
    starts_line = None
    for offset, op, arg in _unpack_opargs(code):
        if linestarts is not None:
            starts_line = linestarts.get(offset, None)
            if starts_line is not None:
                starts_line += line_offset
        is_jump_target = offset in labels
        argval = None
        argrepr = ''
        if arg is not None:
            #  Set argval to the dereferenced value of the argument when
            #  available, and argrepr to the string representation of argval.
            #    _disassemble_bytes needs the string repr of the
            #    raw name index for LOAD_GLOBAL, LOAD_CONST, etc.
            argval = arg
            if op in hasconst:
                argval, argrepr = _get_const_info(arg, constants)
            elif op in hasname:
                argval, argrepr = _get_name_info(arg, names)
            elif op in hasjrel:
                argval = offset + 2 + arg
                argrepr = "to " + repr(argval)
            elif op in haslocal:
                argval, argrepr = _get_name_info(arg, varnames)
            elif op in hascompare:
                argval = cmp_op[arg]
                argrepr = argval
            elif op in hasfree:
                argval, argrepr = _get_name_info(arg, cells)
            elif op == FORMAT_VALUE:
                argval, argrepr = FORMAT_VALUE_CONVERTERS[arg & 0x3]
                argval = (argval, bool(arg & 0x4))
                if argval[1]:
                    if argrepr:
                        argrepr += ', '
                    argrepr += 'with format'
            elif op == MAKE_FUNCTION:
                argrepr = ', '.join(s for i, s in enumerate(MAKE_FUNCTION_FLAGS)
                                    if arg & (1<<i))
        yield Instruction(opname[op], op,
                          arg, argval, argrepr,
                          offset, starts_line, is_jump_target)

def disassemble(co, lasti=-1, *, file=None):
    """Disassemble a code object."""
    cell_names = co.co_cellvars + co.co_freevars
    linestarts = dict(findlinestarts(co))
    _disassemble_bytes(co.co_code, lasti, co.co_varnames, co.co_names,
                       co.co_consts, cell_names, linestarts, file=file)

def _disassemble_recursive(co, *, file=None, depth=None):
    disassemble(co, file=file)
    if depth is None or depth > 0:
        if depth is not None:
            depth = depth - 1
        for x in co.co_consts:
            if hasattr(x, 'co_code'):
                print(file=file)
                print("Disassembly of %r:" % (x,), file=file)
                _disassemble_recursive(x, file=file, depth=depth)

def _disassemble_bytes(code, lasti=-1, varnames=None, names=None,
                       constants=None, cells=None, linestarts=None,
                       *, file=None, line_offset=0):
    # Omit the line number column entirely if we have no line number info
    show_lineno = linestarts is not None
    if show_lineno:
        maxlineno = max(linestarts.values()) + line_offset
        if maxlineno >= 1000:
            lineno_width = len(str(maxlineno))
        else:
            lineno_width = 3
    else:
        lineno_width = 0
    maxoffset = len(code) - 2
    if maxoffset >= 10000:
        offset_width = len(str(maxoffset))
    else:
        offset_width = 4
    for instr in _get_instructions_bytes(code, varnames, names,
                                         constants, cells, linestarts,
                                         line_offset=line_offset):
        new_source_line = (show_lineno and
                           instr.starts_line is not None and
                           instr.offset > 0)
        if new_source_line:
            print(file=file)
        is_current_instr = instr.offset == lasti
        print(instr._disassemble(lineno_width, is_current_instr, offset_width),
              file=file)

def _disassemble_str(source, **kwargs):
    """Compile the source string, then disassemble the code object."""
    _disassemble_recursive(_try_compile(source, '<dis>'), **kwargs)

disco = disassemble                     # XXX For backwards compatibility

def _unpack_opargs(code):
    extended_arg = 0
    for i in range(0, len(code), 2):
        op = code[i]
        if op >= HAVE_ARGUMENT:
            arg = code[i+1] | extended_arg
            extended_arg = (arg << 8) if op == EXTENDED_ARG else 0
        else:
            arg = None
        yield (i, op, arg)

def findlabels(code):
    """Detect all offsets in a byte code which are jump targets.

    Return the list of offsets.

    """
    labels = []
    for offset, op, arg in _unpack_opargs(code):
        if arg is not None:
            if op in hasjrel:
                label = offset + 2 + arg
            elif op in hasjabs:
                label = arg
            else:
                continue
            if label not in labels:
                labels.append(label)
    return labels

def findlinestarts(code):
    """Find the offsets in a byte code which are start of lines in the source.

    Generate pairs (offset, lineno) as described in Python/compile.c.

    """
    byte_increments = code.co_lnotab[0::2]
    line_increments = code.co_lnotab[1::2]
    bytecode_len = len(code.co_code)

    lastlineno = None
    lineno = code.co_firstlineno
    addr = 0
    for byte_incr, line_incr in zip(byte_increments, line_increments):
        if byte_incr:
            if lineno != lastlineno:
                yield (addr, lineno)
                lastlineno = lineno
            addr += byte_incr
            if addr >= bytecode_len:
                # The rest of the lnotab byte offsets are past the end of
                # the bytecode, so the lines were optimized away.
                return
        if line_incr >= 0x80:
            # line_increments is an array of 8-bit signed integers
            line_incr -= 0x100
        lineno += line_incr
    if lineno != lastlineno:
        yield (addr, lineno)

class Bytecode:
    """The bytecode operations of a piece of code

    Instantiate this with a function, method, other compiled object, string of
    code, or a code object (as returned by compile()).

    Iterating over this yields the bytecode operations as Instruction instances.
    """
    def __init__(self, x, *, first_line=None, current_offset=None):
        self.codeobj = co = _get_code_object(x)
        if first_line is None:
            self.first_line = co.co_firstlineno
            self._line_offset = 0
        else:
            self.first_line = first_line
            self._line_offset = first_line - co.co_firstlineno
        self._cell_names = co.co_cellvars + co.co_freevars
        self._linestarts = dict(findlinestarts(co))
        self._original_object = x
        self.current_offset = current_offset

    def __iter__(self):
        co = self.codeobj
        return _get_instructions_bytes(co.co_code, co.co_varnames, co.co_names,
                                       co.co_consts, self._cell_names,
                                       self._linestarts,
                                       line_offset=self._line_offset)

    def __repr__(self):
        return "{}({!r})".format(self.__class__.__name__,
                                 self._original_object)

    @classmethod
    def from_traceback(cls, tb):
        """ Construct a Bytecode from the given traceback """
        while tb.tb_next:
            tb = tb.tb_next
        return cls(tb.tb_frame.f_code, current_offset=tb.tb_lasti)

    def info(self):
        """Return formatted information about the code object."""
        return _format_code_info(self.codeobj)

    def dis(self):
        """Return a formatted view of the bytecode operations."""
        co = self.codeobj
        if self.current_offset is not None:
            offset = self.current_offset
        else:
            offset = -1
        with io.StringIO() as output:
            _disassemble_bytes(co.co_code, varnames=co.co_varnames,
                               names=co.co_names, constants=co.co_consts,
                               cells=self._cell_names,
                               linestarts=self._linestarts,
                               line_offset=self._line_offset,
                               file=output,
                               lasti=offset)
            return output.getvalue()


def _test():
    """Simple test program to disassemble a file."""
    import argparse

    parser = argparse.ArgumentParser()
    parser.add_argument('infile', type=argparse.FileType('rb'), nargs='?', default='-')
    args = parser.parse_args()
    with args.infile as infile:
        source = infile.read()
    code = compile(source, args.infile.name, "exec")
    dis(code)

if __name__ == "__main__":
    _test()
sysconfig.py000064400000060500151153537630007134 0ustar00"""Access to Python's configuration information."""

import os
import sys
from os.path import pardir, realpath

__all__ = [
    'get_config_h_filename',
    'get_config_var',
    'get_config_vars',
    'get_makefile_filename',
    'get_path',
    'get_path_names',
    'get_paths',
    'get_platform',
    'get_python_version',
    'get_scheme_names',
    'parse_config_h',
]

# Keys for get_config_var() that are never converted to Python integers.
_ALWAYS_STR = {
    'MACOSX_DEPLOYMENT_TARGET',
}

_INSTALL_SCHEMES = {
    'posix_prefix': {
        'stdlib': '{installed_base}/lib64/python{py_version_short}',
        'platstdlib': '{platbase}/lib64/python{py_version_short}',
        'purelib': '{base}/lib/python{py_version_short}/site-packages',
        'platlib': '{platbase}/lib64/python{py_version_short}/site-packages',
        'include':
            '{installed_base}/include/python{py_version_short}{abiflags}',
        'platinclude':
            '{installed_platbase}/include/python{py_version_short}{abiflags}',
        'scripts': '{base}/bin',
        'data': '{base}',
        },
    'posix_home': {
        'stdlib': '{installed_base}/lib/python',
        'platstdlib': '{base}/lib/python',
        'purelib': '{base}/lib/python',
        'platlib': '{base}/lib/python',
        'include': '{installed_base}/include/python',
        'platinclude': '{installed_base}/include/python',
        'scripts': '{base}/bin',
        'data': '{base}',
        },
    'nt': {
        'stdlib': '{installed_base}/Lib',
        'platstdlib': '{base}/Lib',
        'purelib': '{base}/Lib/site-packages',
        'platlib': '{base}/Lib/site-packages',
        'include': '{installed_base}/Include',
        'platinclude': '{installed_base}/Include',
        'scripts': '{base}/Scripts',
        'data': '{base}',
        },
    # NOTE: When modifying "purelib" scheme, update site._get_path() too.
    'nt_user': {
        'stdlib': '{userbase}/Python{py_version_nodot}',
        'platstdlib': '{userbase}/Python{py_version_nodot}',
        'purelib': '{userbase}/Python{py_version_nodot}/site-packages',
        'platlib': '{userbase}/Python{py_version_nodot}/site-packages',
        'include': '{userbase}/Python{py_version_nodot}/Include',
        'scripts': '{userbase}/Python{py_version_nodot}/Scripts',
        'data': '{userbase}',
        },
    'posix_user': {
        'stdlib': '{userbase}/lib64/python{py_version_short}',
        'platstdlib': '{userbase}/lib64/python{py_version_short}',
        'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
        'platlib': '{userbase}/lib64/python{py_version_short}/site-packages',
        'include': '{userbase}/include/python{py_version_short}',
        'scripts': '{userbase}/bin',
        'data': '{userbase}',
        },
    'osx_framework_user': {
        'stdlib': '{userbase}/lib/python',
        'platstdlib': '{userbase}/lib/python',
        'purelib': '{userbase}/lib/python/site-packages',
        'platlib': '{userbase}/lib/python/site-packages',
        'include': '{userbase}/include',
        'scripts': '{userbase}/bin',
        'data': '{userbase}',
        },
    }

_SCHEME_KEYS = ('stdlib', 'platstdlib', 'purelib', 'platlib', 'include',
                'scripts', 'data')

 # FIXME don't rely on sys.version here, its format is an implementation detail
 # of CPython, use sys.version_info or sys.hexversion
_PY_VERSION = sys.version.split()[0]
_PY_VERSION_SHORT = '%d.%d' % sys.version_info[:2]
_PY_VERSION_SHORT_NO_DOT = '%d%d' % sys.version_info[:2]
_PREFIX = os.path.normpath(sys.prefix)
_BASE_PREFIX = os.path.normpath(sys.base_prefix)
_EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
_BASE_EXEC_PREFIX = os.path.normpath(sys.base_exec_prefix)
_CONFIG_VARS = None
_USER_BASE = None


def _safe_realpath(path):
    try:
        return realpath(path)
    except OSError:
        return path

if sys.executable:
    _PROJECT_BASE = os.path.dirname(_safe_realpath(sys.executable))
else:
    # sys.executable can be empty if argv[0] has been changed and Python is
    # unable to retrieve the real program name
    _PROJECT_BASE = _safe_realpath(os.getcwd())

if (os.name == 'nt' and
    _PROJECT_BASE.lower().endswith(('\\pcbuild\\win32', '\\pcbuild\\amd64'))):
    _PROJECT_BASE = _safe_realpath(os.path.join(_PROJECT_BASE, pardir, pardir))

# set for cross builds
if "_PYTHON_PROJECT_BASE" in os.environ:
    _PROJECT_BASE = _safe_realpath(os.environ["_PYTHON_PROJECT_BASE"])

def _is_python_source_dir(d):
    for fn in ("Setup", "Setup.local"):
        if os.path.isfile(os.path.join(d, "Modules", fn)):
            return True
    return False

_sys_home = getattr(sys, '_home', None)

if os.name == 'nt':
    def _fix_pcbuild(d):
        if d and os.path.normcase(d).startswith(
                os.path.normcase(os.path.join(_PREFIX, "PCbuild"))):
            return _PREFIX
        return d
    _PROJECT_BASE = _fix_pcbuild(_PROJECT_BASE)
    _sys_home = _fix_pcbuild(_sys_home)

def is_python_build(check_home=False):
    if check_home and _sys_home:
        return _is_python_source_dir(_sys_home)
    return _is_python_source_dir(_PROJECT_BASE)

_PYTHON_BUILD = is_python_build(True)

if _PYTHON_BUILD:
    for scheme in ('posix_prefix', 'posix_home'):
        _INSTALL_SCHEMES[scheme]['include'] = '{srcdir}/Include'
        _INSTALL_SCHEMES[scheme]['platinclude'] = '{projectbase}/.'


def _subst_vars(s, local_vars):
    try:
        return s.format(**local_vars)
    except KeyError:
        try:
            return s.format(**os.environ)
        except KeyError as var:
            raise AttributeError('{%s}' % var) from None

def _extend_dict(target_dict, other_dict):
    target_keys = target_dict.keys()
    for key, value in other_dict.items():
        if key in target_keys:
            continue
        target_dict[key] = value


def _expand_vars(scheme, vars):
    res = {}
    if vars is None:
        vars = {}
    _extend_dict(vars, get_config_vars())

    for key, value in _INSTALL_SCHEMES[scheme].items():
        if os.name in ('posix', 'nt'):
            value = os.path.expanduser(value)
        res[key] = os.path.normpath(_subst_vars(value, vars))
    return res


def _get_default_scheme():
    if os.name == 'posix':
        # the default scheme for posix is posix_prefix
        return 'posix_prefix'
    return os.name


# NOTE: site.py has copy of this function.
# Sync it when modify this function.
def _getuserbase():
    env_base = os.environ.get("PYTHONUSERBASE", None)
    if env_base:
        return env_base

    def joinuser(*args):
        return os.path.expanduser(os.path.join(*args))

    if os.name == "nt":
        base = os.environ.get("APPDATA") or "~"
        return joinuser(base, "Python")

    if sys.platform == "darwin" and sys._framework:
        return joinuser("~", "Library", sys._framework,
                        "%d.%d" % sys.version_info[:2])

    return joinuser("~", ".local")


def _parse_makefile(filename, vars=None):
    """Parse a Makefile-style file.

    A dictionary containing name/value pairs is returned.  If an
    optional dictionary is passed in as the second argument, it is
    used instead of a new dictionary.
    """
    # Regexes needed for parsing Makefile (and similar syntaxes,
    # like old-style Setup files).
    import re
    _variable_rx = re.compile(r"([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*(.*)")
    _findvar1_rx = re.compile(r"\$\(([A-Za-z][A-Za-z0-9_]*)\)")
    _findvar2_rx = re.compile(r"\${([A-Za-z][A-Za-z0-9_]*)}")

    if vars is None:
        vars = {}
    done = {}
    notdone = {}

    with open(filename, errors="surrogateescape") as f:
        lines = f.readlines()

    for line in lines:
        if line.startswith('#') or line.strip() == '':
            continue
        m = _variable_rx.match(line)
        if m:
            n, v = m.group(1, 2)
            v = v.strip()
            # `$$' is a literal `$' in make
            tmpv = v.replace('$$', '')

            if "$" in tmpv:
                notdone[n] = v
            else:
                try:
                    if n in _ALWAYS_STR:
                        raise ValueError

                    v = int(v)
                except ValueError:
                    # insert literal `$'
                    done[n] = v.replace('$$', '$')
                else:
                    done[n] = v

    # do variable interpolation here
    variables = list(notdone.keys())

    # Variables with a 'PY_' prefix in the makefile. These need to
    # be made available without that prefix through sysconfig.
    # Special care is needed to ensure that variable expansion works, even
    # if the expansion uses the name without a prefix.
    renamed_variables = ('CFLAGS', 'LDFLAGS', 'CPPFLAGS')

    while len(variables) > 0:
        for name in tuple(variables):
            value = notdone[name]
            m1 = _findvar1_rx.search(value)
            m2 = _findvar2_rx.search(value)
            if m1 and m2:
                m = m1 if m1.start() < m2.start() else m2
            else:
                m = m1 if m1 else m2
            if m is not None:
                n = m.group(1)
                found = True
                if n in done:
                    item = str(done[n])
                elif n in notdone:
                    # get it on a subsequent round
                    found = False
                elif n in os.environ:
                    # do it like make: fall back to environment
                    item = os.environ[n]

                elif n in renamed_variables:
                    if (name.startswith('PY_') and
                        name[3:] in renamed_variables):
                        item = ""

                    elif 'PY_' + n in notdone:
                        found = False

                    else:
                        item = str(done['PY_' + n])

                else:
                    done[n] = item = ""

                if found:
                    after = value[m.end():]
                    value = value[:m.start()] + item + after
                    if "$" in after:
                        notdone[name] = value
                    else:
                        try:
                            if name in _ALWAYS_STR:
                                raise ValueError
                            value = int(value)
                        except ValueError:
                            done[name] = value.strip()
                        else:
                            done[name] = value
                        variables.remove(name)

                        if name.startswith('PY_') \
                        and name[3:] in renamed_variables:

                            name = name[3:]
                            if name not in done:
                                done[name] = value

            else:
                # bogus variable reference (e.g. "prefix=$/opt/python");
                # just drop it since we can't deal
                done[name] = value
                variables.remove(name)

    # strip spurious spaces
    for k, v in done.items():
        if isinstance(v, str):
            done[k] = v.strip()

    # save the results in the global dictionary
    vars.update(done)
    return vars


def get_makefile_filename():
    """Return the path of the Makefile."""
    if _PYTHON_BUILD:
        return os.path.join(_sys_home or _PROJECT_BASE, "Makefile")
    if hasattr(sys, 'abiflags'):
        config_dir_name = 'config-%s%s' % (_PY_VERSION_SHORT, sys.abiflags)
    else:
        config_dir_name = 'config'
    if hasattr(sys.implementation, '_multiarch'):
        config_dir_name += '-%s' % sys.implementation._multiarch
    return os.path.join(get_path('stdlib'), config_dir_name, 'Makefile')


def _get_sysconfigdata_name():
    return os.environ.get('_PYTHON_SYSCONFIGDATA_NAME',
        '_sysconfigdata_{abi}_{platform}_{multiarch}'.format(
        abi=sys.abiflags,
        platform=sys.platform,
        multiarch=getattr(sys.implementation, '_multiarch', ''),
    ))


def _generate_posix_vars():
    """Generate the Python module containing build-time variables."""
    import pprint
    vars = {}
    # load the installed Makefile:
    makefile = get_makefile_filename()
    try:
        _parse_makefile(makefile, vars)
    except OSError as e:
        msg = "invalid Python installation: unable to open %s" % makefile
        if hasattr(e, "strerror"):
            msg = msg + " (%s)" % e.strerror
        raise OSError(msg)
    # load the installed pyconfig.h:
    config_h = get_config_h_filename()
    try:
        with open(config_h) as f:
            parse_config_h(f, vars)
    except OSError as e:
        msg = "invalid Python installation: unable to open %s" % config_h
        if hasattr(e, "strerror"):
            msg = msg + " (%s)" % e.strerror
        raise OSError(msg)
    # On AIX, there are wrong paths to the linker scripts in the Makefile
    # -- these paths are relative to the Python source, but when installed
    # the scripts are in another directory.
    if _PYTHON_BUILD:
        vars['BLDSHARED'] = vars['LDSHARED']

    # There's a chicken-and-egg situation on OS X with regards to the
    # _sysconfigdata module after the changes introduced by #15298:
    # get_config_vars() is called by get_platform() as part of the
    # `make pybuilddir.txt` target -- which is a precursor to the
    # _sysconfigdata.py module being constructed.  Unfortunately,
    # get_config_vars() eventually calls _init_posix(), which attempts
    # to import _sysconfigdata, which we won't have built yet.  In order
    # for _init_posix() to work, if we're on Darwin, just mock up the
    # _sysconfigdata module manually and populate it with the build vars.
    # This is more than sufficient for ensuring the subsequent call to
    # get_platform() succeeds.
    name = _get_sysconfigdata_name()
    if 'darwin' in sys.platform:
        import types
        module = types.ModuleType(name)
        module.build_time_vars = vars
        sys.modules[name] = module

    pybuilddir = 'build/lib.%s-%s' % (get_platform(), _PY_VERSION_SHORT)
    if hasattr(sys, "gettotalrefcount"):
        pybuilddir += '-pydebug'
    os.makedirs(pybuilddir, exist_ok=True)
    destfile = os.path.join(pybuilddir, name + '.py')

    with open(destfile, 'w', encoding='utf8') as f:
        f.write('# system configuration generated and used by'
                ' the sysconfig module\n')
        f.write('build_time_vars = ')
        pprint.pprint(vars, stream=f)

    # Create file used for sys.path fixup -- see Modules/getpath.c
    with open('pybuilddir.txt', 'w', encoding='utf8') as f:
        f.write(pybuilddir)

def _init_posix(vars):
    """Initialize the module as appropriate for POSIX systems."""
    # _sysconfigdata is generated at build time, see _generate_posix_vars()
    name = _get_sysconfigdata_name()
    _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
    build_time_vars = _temp.build_time_vars
    vars.update(build_time_vars)

def _init_non_posix(vars):
    """Initialize the module as appropriate for NT"""
    # set basic install directories
    import _imp
    vars['LIBDEST'] = get_path('stdlib')
    vars['BINLIBDEST'] = get_path('platstdlib')
    vars['INCLUDEPY'] = get_path('include')
    vars['EXT_SUFFIX'] = _imp.extension_suffixes()[0]
    vars['EXE'] = '.exe'
    vars['VERSION'] = _PY_VERSION_SHORT_NO_DOT
    vars['BINDIR'] = os.path.dirname(_safe_realpath(sys.executable))

#
# public APIs
#


def parse_config_h(fp, vars=None):
    """Parse a config.h-style file.

    A dictionary containing name/value pairs is returned.  If an
    optional dictionary is passed in as the second argument, it is
    used instead of a new dictionary.
    """
    if vars is None:
        vars = {}
    import re
    define_rx = re.compile("#define ([A-Z][A-Za-z0-9_]+) (.*)\n")
    undef_rx = re.compile("/[*] #undef ([A-Z][A-Za-z0-9_]+) [*]/\n")

    while True:
        line = fp.readline()
        if not line:
            break
        m = define_rx.match(line)
        if m:
            n, v = m.group(1, 2)
            try:
                if n in _ALWAYS_STR:
                    raise ValueError
                v = int(v)
            except ValueError:
                pass
            vars[n] = v
        else:
            m = undef_rx.match(line)
            if m:
                vars[m.group(1)] = 0
    return vars


def get_config_h_filename():
    """Return the path of pyconfig.h."""
    if _PYTHON_BUILD:
        if os.name == "nt":
            inc_dir = os.path.join(_sys_home or _PROJECT_BASE, "PC")
        else:
            inc_dir = _sys_home or _PROJECT_BASE
    else:
        inc_dir = get_path('platinclude')
    return os.path.join(inc_dir, 'pyconfig-64.h')


def get_scheme_names():
    """Return a tuple containing the schemes names."""
    return tuple(sorted(_INSTALL_SCHEMES))


def get_path_names():
    """Return a tuple containing the paths names."""
    return _SCHEME_KEYS


def get_paths(scheme=_get_default_scheme(), vars=None, expand=True):
    """Return a mapping containing an install scheme.

    ``scheme`` is the install scheme name. If not provided, it will
    return the default scheme for the current platform.
    """
    if expand:
        return _expand_vars(scheme, vars)
    else:
        return _INSTALL_SCHEMES[scheme]


def get_path(name, scheme=_get_default_scheme(), vars=None, expand=True):
    """Return a path corresponding to the scheme.

    ``scheme`` is the install scheme name.
    """
    return get_paths(scheme, vars, expand)[name]


def get_config_vars(*args):
    """With no arguments, return a dictionary of all configuration
    variables relevant for the current platform.

    On Unix, this means every variable defined in Python's installed Makefile;
    On Windows it's a much smaller set.

    With arguments, return a list of values that result from looking up
    each argument in the configuration variable dictionary.
    """
    global _CONFIG_VARS
    if _CONFIG_VARS is None:
        _CONFIG_VARS = {}
        # Normalized versions of prefix and exec_prefix are handy to have;
        # in fact, these are the standard versions used most places in the
        # Distutils.
        _CONFIG_VARS['prefix'] = _PREFIX
        _CONFIG_VARS['exec_prefix'] = _EXEC_PREFIX
        _CONFIG_VARS['py_version'] = _PY_VERSION
        _CONFIG_VARS['py_version_short'] = _PY_VERSION_SHORT
        _CONFIG_VARS['py_version_nodot'] = _PY_VERSION_SHORT_NO_DOT
        _CONFIG_VARS['installed_base'] = _BASE_PREFIX
        _CONFIG_VARS['base'] = _PREFIX
        _CONFIG_VARS['installed_platbase'] = _BASE_EXEC_PREFIX
        _CONFIG_VARS['platbase'] = _EXEC_PREFIX
        _CONFIG_VARS['projectbase'] = _PROJECT_BASE
        try:
            _CONFIG_VARS['abiflags'] = sys.abiflags
        except AttributeError:
            # sys.abiflags may not be defined on all platforms.
            _CONFIG_VARS['abiflags'] = ''

        if os.name == 'nt':
            _init_non_posix(_CONFIG_VARS)
        if os.name == 'posix':
            _init_posix(_CONFIG_VARS)
        # For backward compatibility, see issue19555
        SO = _CONFIG_VARS.get('EXT_SUFFIX')
        if SO is not None:
            _CONFIG_VARS['SO'] = SO
        # Setting 'userbase' is done below the call to the
        # init function to enable using 'get_config_var' in
        # the init-function.
        _CONFIG_VARS['userbase'] = _getuserbase()

        # Always convert srcdir to an absolute path
        srcdir = _CONFIG_VARS.get('srcdir', _PROJECT_BASE)
        if os.name == 'posix':
            if _PYTHON_BUILD:
                # If srcdir is a relative path (typically '.' or '..')
                # then it should be interpreted relative to the directory
                # containing Makefile.
                base = os.path.dirname(get_makefile_filename())
                srcdir = os.path.join(base, srcdir)
            else:
                # srcdir is not meaningful since the installation is
                # spread about the filesystem.  We choose the
                # directory containing the Makefile since we know it
                # exists.
                srcdir = os.path.dirname(get_makefile_filename())
        _CONFIG_VARS['srcdir'] = _safe_realpath(srcdir)

        # OS X platforms require special customization to handle
        # multi-architecture, multi-os-version installers
        if sys.platform == 'darwin':
            import _osx_support
            _osx_support.customize_config_vars(_CONFIG_VARS)

    if args:
        vals = []
        for name in args:
            vals.append(_CONFIG_VARS.get(name))
        return vals
    else:
        return _CONFIG_VARS


def get_config_var(name):
    """Return the value of a single variable using the dictionary returned by
    'get_config_vars()'.

    Equivalent to get_config_vars().get(name)
    """
    if name == 'SO':
        import warnings
        warnings.warn('SO is deprecated, use EXT_SUFFIX', DeprecationWarning, 2)
    return get_config_vars().get(name)


def get_platform():
    """Return a string that identifies the current platform.

    This is used mainly to distinguish platform-specific build directories and
    platform-specific built distributions.  Typically includes the OS name and
    version and the architecture (as supplied by 'os.uname()'), although the
    exact information included depends on the OS; on Linux, the kernel version
    isn't particularly important.

    Examples of returned values:
       linux-i586
       linux-alpha (?)
       solaris-2.6-sun4u

    Windows will return one of:
       win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc)
       win32 (all others - specifically, sys.platform is returned)

    For other non-POSIX platforms, currently just returns 'sys.platform'.

    """
    if os.name == 'nt':
        if 'amd64' in sys.version.lower():
            return 'win-amd64'
        if '(arm)' in sys.version.lower():
            return 'win-arm32'
        if '(arm64)' in sys.version.lower():
            return 'win-arm64'
        return sys.platform

    if os.name != "posix" or not hasattr(os, 'uname'):
        # XXX what about the architecture? NT is Intel or Alpha
        return sys.platform

    # Set for cross builds explicitly
    if "_PYTHON_HOST_PLATFORM" in os.environ:
        return os.environ["_PYTHON_HOST_PLATFORM"]

    # Try to distinguish various flavours of Unix
    osname, host, release, version, machine = os.uname()

    # Convert the OS name to lowercase, remove '/' characters, and translate
    # spaces (for "Power Macintosh")
    osname = osname.lower().replace('/', '')
    machine = machine.replace(' ', '_')
    machine = machine.replace('/', '-')

    if osname[:5] == "linux":
        # At least on Linux/Intel, 'machine' is the processor --
        # i386, etc.
        # XXX what about Alpha, SPARC, etc?
        return  "%s-%s" % (osname, machine)
    elif osname[:5] == "sunos":
        if release[0] >= "5":           # SunOS 5 == Solaris 2
            osname = "solaris"
            release = "%d.%s" % (int(release[0]) - 3, release[2:])
            # We can't use "platform.architecture()[0]" because a
            # bootstrap problem. We use a dict to get an error
            # if some suspicious happens.
            bitness = {2147483647:"32bit", 9223372036854775807:"64bit"}
            machine += ".%s" % bitness[sys.maxsize]
        # fall through to standard osname-release-machine representation
    elif osname[:3] == "aix":
        return "%s-%s.%s" % (osname, version, release)
    elif osname[:6] == "cygwin":
        osname = "cygwin"
        import re
        rel_re = re.compile(r'[\d.]+')
        m = rel_re.match(release)
        if m:
            release = m.group()
    elif osname[:6] == "darwin":
        import _osx_support
        osname, release, machine = _osx_support.get_platform_osx(
                                            get_config_vars(),
                                            osname, release, machine)

    return "%s-%s-%s" % (osname, release, machine)


def get_python_version():
    return _PY_VERSION_SHORT


def _print_dict(title, data):
    for index, (key, value) in enumerate(sorted(data.items())):
        if index == 0:
            print('%s: ' % (title))
        print('\t%s = "%s"' % (key, value))


def _main():
    """Display all information sysconfig detains."""
    if '--generate-posix-vars' in sys.argv:
        _generate_posix_vars()
        return
    print('Platform: "%s"' % get_platform())
    print('Python version: "%s"' % get_python_version())
    print('Current installation scheme: "%s"' % _get_default_scheme())
    print()
    _print_dict('Paths', get_paths())
    print()
    _print_dict('Variables', get_config_vars())


if __name__ == '__main__':
    _main()
pkgutil.py000064400000051774151153537630006624 0ustar00"""Utilities to support packages."""

from collections import namedtuple
from functools import singledispatch as simplegeneric
import importlib
import importlib.util
import importlib.machinery
import os
import os.path
import sys
from types import ModuleType
import warnings

__all__ = [
    'get_importer', 'iter_importers', 'get_loader', 'find_loader',
    'walk_packages', 'iter_modules', 'get_data',
    'ImpImporter', 'ImpLoader', 'read_code', 'extend_path',
    'ModuleInfo',
]


ModuleInfo = namedtuple('ModuleInfo', 'module_finder name ispkg')
ModuleInfo.__doc__ = 'A namedtuple with minimal info about a module.'


def _get_spec(finder, name):
    """Return the finder-specific module spec."""
    # Works with legacy finders.
    try:
        find_spec = finder.find_spec
    except AttributeError:
        loader = finder.find_module(name)
        if loader is None:
            return None
        return importlib.util.spec_from_loader(name, loader)
    else:
        return find_spec(name)


def read_code(stream):
    # This helper is needed in order for the PEP 302 emulation to
    # correctly handle compiled files
    import marshal

    magic = stream.read(4)
    if magic != importlib.util.MAGIC_NUMBER:
        return None

    stream.read(12) # Skip rest of the header
    return marshal.load(stream)


def walk_packages(path=None, prefix='', onerror=None):
    """Yields ModuleInfo for all modules recursively
    on path, or, if path is None, all accessible modules.

    'path' should be either None or a list of paths to look for
    modules in.

    'prefix' is a string to output on the front of every module name
    on output.

    Note that this function must import all *packages* (NOT all
    modules!) on the given path, in order to access the __path__
    attribute to find submodules.

    'onerror' is a function which gets called with one argument (the
    name of the package which was being imported) if any exception
    occurs while trying to import a package.  If no onerror function is
    supplied, ImportErrors are caught and ignored, while all other
    exceptions are propagated, terminating the search.

    Examples:

    # list all modules python can access
    walk_packages()

    # list all submodules of ctypes
    walk_packages(ctypes.__path__, ctypes.__name__+'.')
    """

    def seen(p, m={}):
        if p in m:
            return True
        m[p] = True

    for info in iter_modules(path, prefix):
        yield info

        if info.ispkg:
            try:
                __import__(info.name)
            except ImportError:
                if onerror is not None:
                    onerror(info.name)
            except Exception:
                if onerror is not None:
                    onerror(info.name)
                else:
                    raise
            else:
                path = getattr(sys.modules[info.name], '__path__', None) or []

                # don't traverse path items we've seen before
                path = [p for p in path if not seen(p)]

                yield from walk_packages(path, info.name+'.', onerror)


def iter_modules(path=None, prefix=''):
    """Yields ModuleInfo for all submodules on path,
    or, if path is None, all top-level modules on sys.path.

    'path' should be either None or a list of paths to look for
    modules in.

    'prefix' is a string to output on the front of every module name
    on output.
    """
    if path is None:
        importers = iter_importers()
    elif isinstance(path, str):
        raise ValueError("path must be None or list of paths to look for "
                        "modules in")
    else:
        importers = map(get_importer, path)

    yielded = {}
    for i in importers:
        for name, ispkg in iter_importer_modules(i, prefix):
            if name not in yielded:
                yielded[name] = 1
                yield ModuleInfo(i, name, ispkg)


@simplegeneric
def iter_importer_modules(importer, prefix=''):
    if not hasattr(importer, 'iter_modules'):
        return []
    return importer.iter_modules(prefix)


# Implement a file walker for the normal importlib path hook
def _iter_file_finder_modules(importer, prefix=''):
    if importer.path is None or not os.path.isdir(importer.path):
        return

    yielded = {}
    import inspect
    try:
        filenames = os.listdir(importer.path)
    except OSError:
        # ignore unreadable directories like import does
        filenames = []
    filenames.sort()  # handle packages before same-named modules

    for fn in filenames:
        modname = inspect.getmodulename(fn)
        if modname=='__init__' or modname in yielded:
            continue

        path = os.path.join(importer.path, fn)
        ispkg = False

        if not modname and os.path.isdir(path) and '.' not in fn:
            modname = fn
            try:
                dircontents = os.listdir(path)
            except OSError:
                # ignore unreadable directories like import does
                dircontents = []
            for fn in dircontents:
                subname = inspect.getmodulename(fn)
                if subname=='__init__':
                    ispkg = True
                    break
            else:
                continue    # not a package

        if modname and '.' not in modname:
            yielded[modname] = 1
            yield prefix + modname, ispkg

iter_importer_modules.register(
    importlib.machinery.FileFinder, _iter_file_finder_modules)


def _import_imp():
    global imp
    with warnings.catch_warnings():
        warnings.simplefilter('ignore', DeprecationWarning)
        imp = importlib.import_module('imp')

class ImpImporter:
    """PEP 302 Finder that wraps Python's "classic" import algorithm

    ImpImporter(dirname) produces a PEP 302 finder that searches that
    directory.  ImpImporter(None) produces a PEP 302 finder that searches
    the current sys.path, plus any modules that are frozen or built-in.

    Note that ImpImporter does not currently support being used by placement
    on sys.meta_path.
    """

    def __init__(self, path=None):
        global imp
        warnings.warn("This emulation is deprecated, use 'importlib' instead",
             DeprecationWarning)
        _import_imp()
        self.path = path

    def find_module(self, fullname, path=None):
        # Note: we ignore 'path' argument since it is only used via meta_path
        subname = fullname.split(".")[-1]
        if subname != fullname and self.path is None:
            return None
        if self.path is None:
            path = None
        else:
            path = [os.path.realpath(self.path)]
        try:
            file, filename, etc = imp.find_module(subname, path)
        except ImportError:
            return None
        return ImpLoader(fullname, file, filename, etc)

    def iter_modules(self, prefix=''):
        if self.path is None or not os.path.isdir(self.path):
            return

        yielded = {}
        import inspect
        try:
            filenames = os.listdir(self.path)
        except OSError:
            # ignore unreadable directories like import does
            filenames = []
        filenames.sort()  # handle packages before same-named modules

        for fn in filenames:
            modname = inspect.getmodulename(fn)
            if modname=='__init__' or modname in yielded:
                continue

            path = os.path.join(self.path, fn)
            ispkg = False

            if not modname and os.path.isdir(path) and '.' not in fn:
                modname = fn
                try:
                    dircontents = os.listdir(path)
                except OSError:
                    # ignore unreadable directories like import does
                    dircontents = []
                for fn in dircontents:
                    subname = inspect.getmodulename(fn)
                    if subname=='__init__':
                        ispkg = True
                        break
                else:
                    continue    # not a package

            if modname and '.' not in modname:
                yielded[modname] = 1
                yield prefix + modname, ispkg


class ImpLoader:
    """PEP 302 Loader that wraps Python's "classic" import algorithm
    """
    code = source = None

    def __init__(self, fullname, file, filename, etc):
        warnings.warn("This emulation is deprecated, use 'importlib' instead",
                      DeprecationWarning)
        _import_imp()
        self.file = file
        self.filename = filename
        self.fullname = fullname
        self.etc = etc

    def load_module(self, fullname):
        self._reopen()
        try:
            mod = imp.load_module(fullname, self.file, self.filename, self.etc)
        finally:
            if self.file:
                self.file.close()
        # Note: we don't set __loader__ because we want the module to look
        # normal; i.e. this is just a wrapper for standard import machinery
        return mod

    def get_data(self, pathname):
        with open(pathname, "rb") as file:
            return file.read()

    def _reopen(self):
        if self.file and self.file.closed:
            mod_type = self.etc[2]
            if mod_type==imp.PY_SOURCE:
                self.file = open(self.filename, 'r')
            elif mod_type in (imp.PY_COMPILED, imp.C_EXTENSION):
                self.file = open(self.filename, 'rb')

    def _fix_name(self, fullname):
        if fullname is None:
            fullname = self.fullname
        elif fullname != self.fullname:
            raise ImportError("Loader for module %s cannot handle "
                              "module %s" % (self.fullname, fullname))
        return fullname

    def is_package(self, fullname):
        fullname = self._fix_name(fullname)
        return self.etc[2]==imp.PKG_DIRECTORY

    def get_code(self, fullname=None):
        fullname = self._fix_name(fullname)
        if self.code is None:
            mod_type = self.etc[2]
            if mod_type==imp.PY_SOURCE:
                source = self.get_source(fullname)
                self.code = compile(source, self.filename, 'exec')
            elif mod_type==imp.PY_COMPILED:
                self._reopen()
                try:
                    self.code = read_code(self.file)
                finally:
                    self.file.close()
            elif mod_type==imp.PKG_DIRECTORY:
                self.code = self._get_delegate().get_code()
        return self.code

    def get_source(self, fullname=None):
        fullname = self._fix_name(fullname)
        if self.source is None:
            mod_type = self.etc[2]
            if mod_type==imp.PY_SOURCE:
                self._reopen()
                try:
                    self.source = self.file.read()
                finally:
                    self.file.close()
            elif mod_type==imp.PY_COMPILED:
                if os.path.exists(self.filename[:-1]):
                    with open(self.filename[:-1], 'r') as f:
                        self.source = f.read()
            elif mod_type==imp.PKG_DIRECTORY:
                self.source = self._get_delegate().get_source()
        return self.source

    def _get_delegate(self):
        finder = ImpImporter(self.filename)
        spec = _get_spec(finder, '__init__')
        return spec.loader

    def get_filename(self, fullname=None):
        fullname = self._fix_name(fullname)
        mod_type = self.etc[2]
        if mod_type==imp.PKG_DIRECTORY:
            return self._get_delegate().get_filename()
        elif mod_type in (imp.PY_SOURCE, imp.PY_COMPILED, imp.C_EXTENSION):
            return self.filename
        return None


try:
    import zipimport
    from zipimport import zipimporter

    def iter_zipimport_modules(importer, prefix=''):
        dirlist = sorted(zipimport._zip_directory_cache[importer.archive])
        _prefix = importer.prefix
        plen = len(_prefix)
        yielded = {}
        import inspect
        for fn in dirlist:
            if not fn.startswith(_prefix):
                continue

            fn = fn[plen:].split(os.sep)

            if len(fn)==2 and fn[1].startswith('__init__.py'):
                if fn[0] not in yielded:
                    yielded[fn[0]] = 1
                    yield prefix + fn[0], True

            if len(fn)!=1:
                continue

            modname = inspect.getmodulename(fn[0])
            if modname=='__init__':
                continue

            if modname and '.' not in modname and modname not in yielded:
                yielded[modname] = 1
                yield prefix + modname, False

    iter_importer_modules.register(zipimporter, iter_zipimport_modules)

except ImportError:
    pass


def get_importer(path_item):
    """Retrieve a finder for the given path item

    The returned finder is cached in sys.path_importer_cache
    if it was newly created by a path hook.

    The cache (or part of it) can be cleared manually if a
    rescan of sys.path_hooks is necessary.
    """
    path_item = os.fsdecode(path_item)
    try:
        importer = sys.path_importer_cache[path_item]
    except KeyError:
        for path_hook in sys.path_hooks:
            try:
                importer = path_hook(path_item)
                sys.path_importer_cache.setdefault(path_item, importer)
                break
            except ImportError:
                pass
        else:
            importer = None
    return importer


def iter_importers(fullname=""):
    """Yield finders for the given module name

    If fullname contains a '.', the finders will be for the package
    containing fullname, otherwise they will be all registered top level
    finders (i.e. those on both sys.meta_path and sys.path_hooks).

    If the named module is in a package, that package is imported as a side
    effect of invoking this function.

    If no module name is specified, all top level finders are produced.
    """
    if fullname.startswith('.'):
        msg = "Relative module name {!r} not supported".format(fullname)
        raise ImportError(msg)
    if '.' in fullname:
        # Get the containing package's __path__
        pkg_name = fullname.rpartition(".")[0]
        pkg = importlib.import_module(pkg_name)
        path = getattr(pkg, '__path__', None)
        if path is None:
            return
    else:
        yield from sys.meta_path
        path = sys.path
    for item in path:
        yield get_importer(item)


def get_loader(module_or_name):
    """Get a "loader" object for module_or_name

    Returns None if the module cannot be found or imported.
    If the named module is not already imported, its containing package
    (if any) is imported, in order to establish the package __path__.
    """
    if module_or_name in sys.modules:
        module_or_name = sys.modules[module_or_name]
        if module_or_name is None:
            return None
    if isinstance(module_or_name, ModuleType):
        module = module_or_name
        loader = getattr(module, '__loader__', None)
        if loader is not None:
            return loader
        if getattr(module, '__spec__', None) is None:
            return None
        fullname = module.__name__
    else:
        fullname = module_or_name
    return find_loader(fullname)


def find_loader(fullname):
    """Find a "loader" object for fullname

    This is a backwards compatibility wrapper around
    importlib.util.find_spec that converts most failures to ImportError
    and only returns the loader rather than the full spec
    """
    if fullname.startswith('.'):
        msg = "Relative module name {!r} not supported".format(fullname)
        raise ImportError(msg)
    try:
        spec = importlib.util.find_spec(fullname)
    except (ImportError, AttributeError, TypeError, ValueError) as ex:
        # This hack fixes an impedance mismatch between pkgutil and
        # importlib, where the latter raises other errors for cases where
        # pkgutil previously raised ImportError
        msg = "Error while finding loader for {!r} ({}: {})"
        raise ImportError(msg.format(fullname, type(ex), ex)) from ex
    return spec.loader if spec is not None else None


def extend_path(path, name):
    """Extend a package's path.

    Intended use is to place the following code in a package's __init__.py:

        from pkgutil import extend_path
        __path__ = extend_path(__path__, __name__)

    This will add to the package's __path__ all subdirectories of
    directories on sys.path named after the package.  This is useful
    if one wants to distribute different parts of a single logical
    package as multiple directories.

    It also looks for *.pkg files beginning where * matches the name
    argument.  This feature is similar to *.pth files (see site.py),
    except that it doesn't special-case lines starting with 'import'.
    A *.pkg file is trusted at face value: apart from checking for
    duplicates, all entries found in a *.pkg file are added to the
    path, regardless of whether they are exist the filesystem.  (This
    is a feature.)

    If the input path is not a list (as is the case for frozen
    packages) it is returned unchanged.  The input path is not
    modified; an extended copy is returned.  Items are only appended
    to the copy at the end.

    It is assumed that sys.path is a sequence.  Items of sys.path that
    are not (unicode or 8-bit) strings referring to existing
    directories are ignored.  Unicode items of sys.path that cause
    errors when used as filenames may cause this function to raise an
    exception (in line with os.path.isdir() behavior).
    """

    if not isinstance(path, list):
        # This could happen e.g. when this is called from inside a
        # frozen package.  Return the path unchanged in that case.
        return path

    sname_pkg = name + ".pkg"

    path = path[:] # Start with a copy of the existing path

    parent_package, _, final_name = name.rpartition('.')
    if parent_package:
        try:
            search_path = sys.modules[parent_package].__path__
        except (KeyError, AttributeError):
            # We can't do anything: find_loader() returns None when
            # passed a dotted name.
            return path
    else:
        search_path = sys.path

    for dir in search_path:
        if not isinstance(dir, str):
            continue

        finder = get_importer(dir)
        if finder is not None:
            portions = []
            if hasattr(finder, 'find_spec'):
                spec = finder.find_spec(final_name)
                if spec is not None:
                    portions = spec.submodule_search_locations or []
            # Is this finder PEP 420 compliant?
            elif hasattr(finder, 'find_loader'):
                _, portions = finder.find_loader(final_name)

            for portion in portions:
                # XXX This may still add duplicate entries to path on
                # case-insensitive filesystems
                if portion not in path:
                    path.append(portion)

        # XXX Is this the right thing for subpackages like zope.app?
        # It looks for a file named "zope.app.pkg"
        pkgfile = os.path.join(dir, sname_pkg)
        if os.path.isfile(pkgfile):
            try:
                f = open(pkgfile)
            except OSError as msg:
                sys.stderr.write("Can't open %s: %s\n" %
                                 (pkgfile, msg))
            else:
                with f:
                    for line in f:
                        line = line.rstrip('\n')
                        if not line or line.startswith('#'):
                            continue
                        path.append(line) # Don't check for existence!

    return path


def get_data(package, resource):
    """Get a resource from a package.

    This is a wrapper round the PEP 302 loader get_data API. The package
    argument should be the name of a package, in standard module format
    (foo.bar). The resource argument should be in the form of a relative
    filename, using '/' as the path separator. The parent directory name '..'
    is not allowed, and nor is a rooted name (starting with a '/').

    The function returns a binary string, which is the contents of the
    specified resource.

    For packages located in the filesystem, which have already been imported,
    this is the rough equivalent of

        d = os.path.dirname(sys.modules[package].__file__)
        data = open(os.path.join(d, resource), 'rb').read()

    If the package cannot be located or loaded, or it uses a PEP 302 loader
    which does not support get_data(), then None is returned.
    """

    spec = importlib.util.find_spec(package)
    if spec is None:
        return None
    loader = spec.loader
    if loader is None or not hasattr(loader, 'get_data'):
        return None
    # XXX needs test
    mod = (sys.modules.get(package) or
           importlib._bootstrap._load(spec))
    if mod is None or not hasattr(mod, '__file__'):
        return None

    # Modify the resource name to be compatible with the loader.get_data
    # signature - an os.path format "filename" starting with the dirname of
    # the package's __file__
    parts = resource.split('/')
    parts.insert(0, os.path.dirname(mod.__file__))
    resource_name = os.path.join(*parts)
    return loader.get_data(resource_name)
mailbox.py000064400000231505151153537630006570 0ustar00"""Read/write support for Maildir, mbox, MH, Babyl, and MMDF mailboxes."""

# Notes for authors of new mailbox subclasses:
#
# Remember to fsync() changes to disk before closing a modified file
# or returning from a flush() method.  See functions _sync_flush() and
# _sync_close().

import os
import time
import calendar
import socket
import errno
import copy
import warnings
import email
import email.message
import email.generator
import io
import contextlib
try:
    import fcntl
except ImportError:
    fcntl = None

__all__ = ['Mailbox', 'Maildir', 'mbox', 'MH', 'Babyl', 'MMDF',
           'Message', 'MaildirMessage', 'mboxMessage', 'MHMessage',
           'BabylMessage', 'MMDFMessage', 'Error', 'NoSuchMailboxError',
           'NotEmptyError', 'ExternalClashError', 'FormatError']

linesep = os.linesep.encode('ascii')

class Mailbox:
    """A group of messages in a particular place."""

    def __init__(self, path, factory=None, create=True):
        """Initialize a Mailbox instance."""
        self._path = os.path.abspath(os.path.expanduser(path))
        self._factory = factory

    def add(self, message):
        """Add message and return assigned key."""
        raise NotImplementedError('Method must be implemented by subclass')

    def remove(self, key):
        """Remove the keyed message; raise KeyError if it doesn't exist."""
        raise NotImplementedError('Method must be implemented by subclass')

    def __delitem__(self, key):
        self.remove(key)

    def discard(self, key):
        """If the keyed message exists, remove it."""
        try:
            self.remove(key)
        except KeyError:
            pass

    def __setitem__(self, key, message):
        """Replace the keyed message; raise KeyError if it doesn't exist."""
        raise NotImplementedError('Method must be implemented by subclass')

    def get(self, key, default=None):
        """Return the keyed message, or default if it doesn't exist."""
        try:
            return self.__getitem__(key)
        except KeyError:
            return default

    def __getitem__(self, key):
        """Return the keyed message; raise KeyError if it doesn't exist."""
        if not self._factory:
            return self.get_message(key)
        else:
            with contextlib.closing(self.get_file(key)) as file:
                return self._factory(file)

    def get_message(self, key):
        """Return a Message representation or raise a KeyError."""
        raise NotImplementedError('Method must be implemented by subclass')

    def get_string(self, key):
        """Return a string representation or raise a KeyError.

        Uses email.message.Message to create a 7bit clean string
        representation of the message."""
        return email.message_from_bytes(self.get_bytes(key)).as_string()

    def get_bytes(self, key):
        """Return a byte string representation or raise a KeyError."""
        raise NotImplementedError('Method must be implemented by subclass')

    def get_file(self, key):
        """Return a file-like representation or raise a KeyError."""
        raise NotImplementedError('Method must be implemented by subclass')

    def iterkeys(self):
        """Return an iterator over keys."""
        raise NotImplementedError('Method must be implemented by subclass')

    def keys(self):
        """Return a list of keys."""
        return list(self.iterkeys())

    def itervalues(self):
        """Return an iterator over all messages."""
        for key in self.iterkeys():
            try:
                value = self[key]
            except KeyError:
                continue
            yield value

    def __iter__(self):
        return self.itervalues()

    def values(self):
        """Return a list of messages. Memory intensive."""
        return list(self.itervalues())

    def iteritems(self):
        """Return an iterator over (key, message) tuples."""
        for key in self.iterkeys():
            try:
                value = self[key]
            except KeyError:
                continue
            yield (key, value)

    def items(self):
        """Return a list of (key, message) tuples. Memory intensive."""
        return list(self.iteritems())

    def __contains__(self, key):
        """Return True if the keyed message exists, False otherwise."""
        raise NotImplementedError('Method must be implemented by subclass')

    def __len__(self):
        """Return a count of messages in the mailbox."""
        raise NotImplementedError('Method must be implemented by subclass')

    def clear(self):
        """Delete all messages."""
        for key in self.keys():
            self.discard(key)

    def pop(self, key, default=None):
        """Delete the keyed message and return it, or default."""
        try:
            result = self[key]
        except KeyError:
            return default
        self.discard(key)
        return result

    def popitem(self):
        """Delete an arbitrary (key, message) pair and return it."""
        for key in self.iterkeys():
            return (key, self.pop(key))     # This is only run once.
        else:
            raise KeyError('No messages in mailbox')

    def update(self, arg=None):
        """Change the messages that correspond to certain keys."""
        if hasattr(arg, 'iteritems'):
            source = arg.iteritems()
        elif hasattr(arg, 'items'):
            source = arg.items()
        else:
            source = arg
        bad_key = False
        for key, message in source:
            try:
                self[key] = message
            except KeyError:
                bad_key = True
        if bad_key:
            raise KeyError('No message with key(s)')

    def flush(self):
        """Write any pending changes to the disk."""
        raise NotImplementedError('Method must be implemented by subclass')

    def lock(self):
        """Lock the mailbox."""
        raise NotImplementedError('Method must be implemented by subclass')

    def unlock(self):
        """Unlock the mailbox if it is locked."""
        raise NotImplementedError('Method must be implemented by subclass')

    def close(self):
        """Flush and close the mailbox."""
        raise NotImplementedError('Method must be implemented by subclass')

    def _string_to_bytes(self, message):
        # If a message is not 7bit clean, we refuse to handle it since it
        # likely came from reading invalid messages in text mode, and that way
        # lies mojibake.
        try:
            return message.encode('ascii')
        except UnicodeError:
            raise ValueError("String input must be ASCII-only; "
                "use bytes or a Message instead")

    # Whether each message must end in a newline
    _append_newline = False

    def _dump_message(self, message, target, mangle_from_=False):
        # This assumes the target file is open in binary mode.
        """Dump message contents to target file."""
        if isinstance(message, email.message.Message):
            buffer = io.BytesIO()
            gen = email.generator.BytesGenerator(buffer, mangle_from_, 0)
            gen.flatten(message)
            buffer.seek(0)
            data = buffer.read()
            data = data.replace(b'\n', linesep)
            target.write(data)
            if self._append_newline and not data.endswith(linesep):
                # Make sure the message ends with a newline
                target.write(linesep)
        elif isinstance(message, (str, bytes, io.StringIO)):
            if isinstance(message, io.StringIO):
                warnings.warn("Use of StringIO input is deprecated, "
                    "use BytesIO instead", DeprecationWarning, 3)
                message = message.getvalue()
            if isinstance(message, str):
                message = self._string_to_bytes(message)
            if mangle_from_:
                message = message.replace(b'\nFrom ', b'\n>From ')
            message = message.replace(b'\n', linesep)
            target.write(message)
            if self._append_newline and not message.endswith(linesep):
                # Make sure the message ends with a newline
                target.write(linesep)
        elif hasattr(message, 'read'):
            if hasattr(message, 'buffer'):
                warnings.warn("Use of text mode files is deprecated, "
                    "use a binary mode file instead", DeprecationWarning, 3)
                message = message.buffer
            lastline = None
            while True:
                line = message.readline()
                # Universal newline support.
                if line.endswith(b'\r\n'):
                    line = line[:-2] + b'\n'
                elif line.endswith(b'\r'):
                    line = line[:-1] + b'\n'
                if not line:
                    break
                if mangle_from_ and line.startswith(b'From '):
                    line = b'>From ' + line[5:]
                line = line.replace(b'\n', linesep)
                target.write(line)
                lastline = line
            if self._append_newline and lastline and not lastline.endswith(linesep):
                # Make sure the message ends with a newline
                target.write(linesep)
        else:
            raise TypeError('Invalid message type: %s' % type(message))


class Maildir(Mailbox):
    """A qmail-style Maildir mailbox."""

    colon = ':'

    def __init__(self, dirname, factory=None, create=True):
        """Initialize a Maildir instance."""
        Mailbox.__init__(self, dirname, factory, create)
        self._paths = {
            'tmp': os.path.join(self._path, 'tmp'),
            'new': os.path.join(self._path, 'new'),
            'cur': os.path.join(self._path, 'cur'),
            }
        if not os.path.exists(self._path):
            if create:
                os.mkdir(self._path, 0o700)
                for path in self._paths.values():
                    os.mkdir(path, 0o700)
            else:
                raise NoSuchMailboxError(self._path)
        self._toc = {}
        self._toc_mtimes = {'cur': 0, 'new': 0}
        self._last_read = 0         # Records last time we read cur/new
        self._skewfactor = 0.1      # Adjust if os/fs clocks are skewing

    def add(self, message):
        """Add message and return assigned key."""
        tmp_file = self._create_tmp()
        try:
            self._dump_message(message, tmp_file)
        except BaseException:
            tmp_file.close()
            os.remove(tmp_file.name)
            raise
        _sync_close(tmp_file)
        if isinstance(message, MaildirMessage):
            subdir = message.get_subdir()
            suffix = self.colon + message.get_info()
            if suffix == self.colon:
                suffix = ''
        else:
            subdir = 'new'
            suffix = ''
        uniq = os.path.basename(tmp_file.name).split(self.colon)[0]
        dest = os.path.join(self._path, subdir, uniq + suffix)
        if isinstance(message, MaildirMessage):
            os.utime(tmp_file.name,
                     (os.path.getatime(tmp_file.name), message.get_date()))
        # No file modification should be done after the file is moved to its
        # final position in order to prevent race conditions with changes
        # from other programs
        try:
            try:
                os.link(tmp_file.name, dest)
            except (AttributeError, PermissionError):
                os.rename(tmp_file.name, dest)
            else:
                os.remove(tmp_file.name)
        except OSError as e:
            os.remove(tmp_file.name)
            if e.errno == errno.EEXIST:
                raise ExternalClashError('Name clash with existing message: %s'
                                         % dest)
            else:
                raise
        return uniq

    def remove(self, key):
        """Remove the keyed message; raise KeyError if it doesn't exist."""
        os.remove(os.path.join(self._path, self._lookup(key)))

    def discard(self, key):
        """If the keyed message exists, remove it."""
        # This overrides an inapplicable implementation in the superclass.
        try:
            self.remove(key)
        except (KeyError, FileNotFoundError):
            pass

    def __setitem__(self, key, message):
        """Replace the keyed message; raise KeyError if it doesn't exist."""
        old_subpath = self._lookup(key)
        temp_key = self.add(message)
        temp_subpath = self._lookup(temp_key)
        if isinstance(message, MaildirMessage):
            # temp's subdir and suffix were specified by message.
            dominant_subpath = temp_subpath
        else:
            # temp's subdir and suffix were defaults from add().
            dominant_subpath = old_subpath
        subdir = os.path.dirname(dominant_subpath)
        if self.colon in dominant_subpath:
            suffix = self.colon + dominant_subpath.split(self.colon)[-1]
        else:
            suffix = ''
        self.discard(key)
        tmp_path = os.path.join(self._path, temp_subpath)
        new_path = os.path.join(self._path, subdir, key + suffix)
        if isinstance(message, MaildirMessage):
            os.utime(tmp_path,
                     (os.path.getatime(tmp_path), message.get_date()))
        # No file modification should be done after the file is moved to its
        # final position in order to prevent race conditions with changes
        # from other programs
        os.rename(tmp_path, new_path)

    def get_message(self, key):
        """Return a Message representation or raise a KeyError."""
        subpath = self._lookup(key)
        with open(os.path.join(self._path, subpath), 'rb') as f:
            if self._factory:
                msg = self._factory(f)
            else:
                msg = MaildirMessage(f)
        subdir, name = os.path.split(subpath)
        msg.set_subdir(subdir)
        if self.colon in name:
            msg.set_info(name.split(self.colon)[-1])
        msg.set_date(os.path.getmtime(os.path.join(self._path, subpath)))
        return msg

    def get_bytes(self, key):
        """Return a bytes representation or raise a KeyError."""
        with open(os.path.join(self._path, self._lookup(key)), 'rb') as f:
            return f.read().replace(linesep, b'\n')

    def get_file(self, key):
        """Return a file-like representation or raise a KeyError."""
        f = open(os.path.join(self._path, self._lookup(key)), 'rb')
        return _ProxyFile(f)

    def iterkeys(self):
        """Return an iterator over keys."""
        self._refresh()
        for key in self._toc:
            try:
                self._lookup(key)
            except KeyError:
                continue
            yield key

    def __contains__(self, key):
        """Return True if the keyed message exists, False otherwise."""
        self._refresh()
        return key in self._toc

    def __len__(self):
        """Return a count of messages in the mailbox."""
        self._refresh()
        return len(self._toc)

    def flush(self):
        """Write any pending changes to disk."""
        # Maildir changes are always written immediately, so there's nothing
        # to do.
        pass

    def lock(self):
        """Lock the mailbox."""
        return

    def unlock(self):
        """Unlock the mailbox if it is locked."""
        return

    def close(self):
        """Flush and close the mailbox."""
        return

    def list_folders(self):
        """Return a list of folder names."""
        result = []
        for entry in os.listdir(self._path):
            if len(entry) > 1 and entry[0] == '.' and \
               os.path.isdir(os.path.join(self._path, entry)):
                result.append(entry[1:])
        return result

    def get_folder(self, folder):
        """Return a Maildir instance for the named folder."""
        return Maildir(os.path.join(self._path, '.' + folder),
                       factory=self._factory,
                       create=False)

    def add_folder(self, folder):
        """Create a folder and return a Maildir instance representing it."""
        path = os.path.join(self._path, '.' + folder)
        result = Maildir(path, factory=self._factory)
        maildirfolder_path = os.path.join(path, 'maildirfolder')
        if not os.path.exists(maildirfolder_path):
            os.close(os.open(maildirfolder_path, os.O_CREAT | os.O_WRONLY,
                0o666))
        return result

    def remove_folder(self, folder):
        """Delete the named folder, which must be empty."""
        path = os.path.join(self._path, '.' + folder)
        for entry in os.listdir(os.path.join(path, 'new')) + \
                     os.listdir(os.path.join(path, 'cur')):
            if len(entry) < 1 or entry[0] != '.':
                raise NotEmptyError('Folder contains message(s): %s' % folder)
        for entry in os.listdir(path):
            if entry != 'new' and entry != 'cur' and entry != 'tmp' and \
               os.path.isdir(os.path.join(path, entry)):
                raise NotEmptyError("Folder contains subdirectory '%s': %s" %
                                    (folder, entry))
        for root, dirs, files in os.walk(path, topdown=False):
            for entry in files:
                os.remove(os.path.join(root, entry))
            for entry in dirs:
                os.rmdir(os.path.join(root, entry))
        os.rmdir(path)

    def clean(self):
        """Delete old files in "tmp"."""
        now = time.time()
        for entry in os.listdir(os.path.join(self._path, 'tmp')):
            path = os.path.join(self._path, 'tmp', entry)
            if now - os.path.getatime(path) > 129600:   # 60 * 60 * 36
                os.remove(path)

    _count = 1  # This is used to generate unique file names.

    def _create_tmp(self):
        """Create a file in the tmp subdirectory and open and return it."""
        now = time.time()
        hostname = socket.gethostname()
        if '/' in hostname:
            hostname = hostname.replace('/', r'\057')
        if ':' in hostname:
            hostname = hostname.replace(':', r'\072')
        uniq = "%s.M%sP%sQ%s.%s" % (int(now), int(now % 1 * 1e6), os.getpid(),
                                    Maildir._count, hostname)
        path = os.path.join(self._path, 'tmp', uniq)
        try:
            os.stat(path)
        except FileNotFoundError:
            Maildir._count += 1
            try:
                return _create_carefully(path)
            except FileExistsError:
                pass

        # Fall through to here if stat succeeded or open raised EEXIST.
        raise ExternalClashError('Name clash prevented file creation: %s' %
                                 path)

    def _refresh(self):
        """Update table of contents mapping."""
        # If it has been less than two seconds since the last _refresh() call,
        # we have to unconditionally re-read the mailbox just in case it has
        # been modified, because os.path.mtime() has a 2 sec resolution in the
        # most common worst case (FAT) and a 1 sec resolution typically.  This
        # results in a few unnecessary re-reads when _refresh() is called
        # multiple times in that interval, but once the clock ticks over, we
        # will only re-read as needed.  Because the filesystem might be being
        # served by an independent system with its own clock, we record and
        # compare with the mtimes from the filesystem.  Because the other
        # system's clock might be skewing relative to our clock, we add an
        # extra delta to our wait.  The default is one tenth second, but is an
        # instance variable and so can be adjusted if dealing with a
        # particularly skewed or irregular system.
        if time.time() - self._last_read > 2 + self._skewfactor:
            refresh = False
            for subdir in self._toc_mtimes:
                mtime = os.path.getmtime(self._paths[subdir])
                if mtime > self._toc_mtimes[subdir]:
                    refresh = True
                self._toc_mtimes[subdir] = mtime
            if not refresh:
                return
        # Refresh toc
        self._toc = {}
        for subdir in self._toc_mtimes:
            path = self._paths[subdir]
            for entry in os.listdir(path):
                p = os.path.join(path, entry)
                if os.path.isdir(p):
                    continue
                uniq = entry.split(self.colon)[0]
                self._toc[uniq] = os.path.join(subdir, entry)
        self._last_read = time.time()

    def _lookup(self, key):
        """Use TOC to return subpath for given key, or raise a KeyError."""
        try:
            if os.path.exists(os.path.join(self._path, self._toc[key])):
                return self._toc[key]
        except KeyError:
            pass
        self._refresh()
        try:
            return self._toc[key]
        except KeyError:
            raise KeyError('No message with key: %s' % key) from None

    # This method is for backward compatibility only.
    def next(self):
        """Return the next message in a one-time iteration."""
        if not hasattr(self, '_onetime_keys'):
            self._onetime_keys = self.iterkeys()
        while True:
            try:
                return self[next(self._onetime_keys)]
            except StopIteration:
                return None
            except KeyError:
                continue


class _singlefileMailbox(Mailbox):
    """A single-file mailbox."""

    def __init__(self, path, factory=None, create=True):
        """Initialize a single-file mailbox."""
        Mailbox.__init__(self, path, factory, create)
        try:
            f = open(self._path, 'rb+')
        except OSError as e:
            if e.errno == errno.ENOENT:
                if create:
                    f = open(self._path, 'wb+')
                else:
                    raise NoSuchMailboxError(self._path)
            elif e.errno in (errno.EACCES, errno.EROFS):
                f = open(self._path, 'rb')
            else:
                raise
        self._file = f
        self._toc = None
        self._next_key = 0
        self._pending = False       # No changes require rewriting the file.
        self._pending_sync = False  # No need to sync the file
        self._locked = False
        self._file_length = None    # Used to record mailbox size

    def add(self, message):
        """Add message and return assigned key."""
        self._lookup()
        self._toc[self._next_key] = self._append_message(message)
        self._next_key += 1
        # _append_message appends the message to the mailbox file. We
        # don't need a full rewrite + rename, sync is enough.
        self._pending_sync = True
        return self._next_key - 1

    def remove(self, key):
        """Remove the keyed message; raise KeyError if it doesn't exist."""
        self._lookup(key)
        del self._toc[key]
        self._pending = True

    def __setitem__(self, key, message):
        """Replace the keyed message; raise KeyError if it doesn't exist."""
        self._lookup(key)
        self._toc[key] = self._append_message(message)
        self._pending = True

    def iterkeys(self):
        """Return an iterator over keys."""
        self._lookup()
        yield from self._toc.keys()

    def __contains__(self, key):
        """Return True if the keyed message exists, False otherwise."""
        self._lookup()
        return key in self._toc

    def __len__(self):
        """Return a count of messages in the mailbox."""
        self._lookup()
        return len(self._toc)

    def lock(self):
        """Lock the mailbox."""
        if not self._locked:
            _lock_file(self._file)
            self._locked = True

    def unlock(self):
        """Unlock the mailbox if it is locked."""
        if self._locked:
            _unlock_file(self._file)
            self._locked = False

    def flush(self):
        """Write any pending changes to disk."""
        if not self._pending:
            if self._pending_sync:
                # Messages have only been added, so syncing the file
                # is enough.
                _sync_flush(self._file)
                self._pending_sync = False
            return

        # In order to be writing anything out at all, self._toc must
        # already have been generated (and presumably has been modified
        # by adding or deleting an item).
        assert self._toc is not None

        # Check length of self._file; if it's changed, some other process
        # has modified the mailbox since we scanned it.
        self._file.seek(0, 2)
        cur_len = self._file.tell()
        if cur_len != self._file_length:
            raise ExternalClashError('Size of mailbox file changed '
                                     '(expected %i, found %i)' %
                                     (self._file_length, cur_len))

        new_file = _create_temporary(self._path)
        try:
            new_toc = {}
            self._pre_mailbox_hook(new_file)
            for key in sorted(self._toc.keys()):
                start, stop = self._toc[key]
                self._file.seek(start)
                self._pre_message_hook(new_file)
                new_start = new_file.tell()
                while True:
                    buffer = self._file.read(min(4096,
                                                 stop - self._file.tell()))
                    if not buffer:
                        break
                    new_file.write(buffer)
                new_toc[key] = (new_start, new_file.tell())
                self._post_message_hook(new_file)
            self._file_length = new_file.tell()
        except:
            new_file.close()
            os.remove(new_file.name)
            raise
        _sync_close(new_file)
        # self._file is about to get replaced, so no need to sync.
        self._file.close()
        # Make sure the new file's mode is the same as the old file's
        mode = os.stat(self._path).st_mode
        os.chmod(new_file.name, mode)
        try:
            os.rename(new_file.name, self._path)
        except FileExistsError:
            os.remove(self._path)
            os.rename(new_file.name, self._path)
        self._file = open(self._path, 'rb+')
        self._toc = new_toc
        self._pending = False
        self._pending_sync = False
        if self._locked:
            _lock_file(self._file, dotlock=False)

    def _pre_mailbox_hook(self, f):
        """Called before writing the mailbox to file f."""
        return

    def _pre_message_hook(self, f):
        """Called before writing each message to file f."""
        return

    def _post_message_hook(self, f):
        """Called after writing each message to file f."""
        return

    def close(self):
        """Flush and close the mailbox."""
        try:
            self.flush()
        finally:
            try:
                if self._locked:
                    self.unlock()
            finally:
                self._file.close()  # Sync has been done by self.flush() above.

    def _lookup(self, key=None):
        """Return (start, stop) or raise KeyError."""
        if self._toc is None:
            self._generate_toc()
        if key is not None:
            try:
                return self._toc[key]
            except KeyError:
                raise KeyError('No message with key: %s' % key) from None

    def _append_message(self, message):
        """Append message to mailbox and return (start, stop) offsets."""
        self._file.seek(0, 2)
        before = self._file.tell()
        if len(self._toc) == 0 and not self._pending:
            # This is the first message, and the _pre_mailbox_hook
            # hasn't yet been called. If self._pending is True,
            # messages have been removed, so _pre_mailbox_hook must
            # have been called already.
            self._pre_mailbox_hook(self._file)
        try:
            self._pre_message_hook(self._file)
            offsets = self._install_message(message)
            self._post_message_hook(self._file)
        except BaseException:
            self._file.truncate(before)
            raise
        self._file.flush()
        self._file_length = self._file.tell()  # Record current length of mailbox
        return offsets



class _mboxMMDF(_singlefileMailbox):
    """An mbox or MMDF mailbox."""

    _mangle_from_ = True

    def get_message(self, key):
        """Return a Message representation or raise a KeyError."""
        start, stop = self._lookup(key)
        self._file.seek(start)
        from_line = self._file.readline().replace(linesep, b'')
        string = self._file.read(stop - self._file.tell())
        msg = self._message_factory(string.replace(linesep, b'\n'))
        msg.set_from(from_line[5:].decode('ascii'))
        return msg

    def get_string(self, key, from_=False):
        """Return a string representation or raise a KeyError."""
        return email.message_from_bytes(
            self.get_bytes(key, from_)).as_string(unixfrom=from_)

    def get_bytes(self, key, from_=False):
        """Return a string representation or raise a KeyError."""
        start, stop = self._lookup(key)
        self._file.seek(start)
        if not from_:
            self._file.readline()
        string = self._file.read(stop - self._file.tell())
        return string.replace(linesep, b'\n')

    def get_file(self, key, from_=False):
        """Return a file-like representation or raise a KeyError."""
        start, stop = self._lookup(key)
        self._file.seek(start)
        if not from_:
            self._file.readline()
        return _PartialFile(self._file, self._file.tell(), stop)

    def _install_message(self, message):
        """Format a message and blindly write to self._file."""
        from_line = None
        if isinstance(message, str):
            message = self._string_to_bytes(message)
        if isinstance(message, bytes) and message.startswith(b'From '):
            newline = message.find(b'\n')
            if newline != -1:
                from_line = message[:newline]
                message = message[newline + 1:]
            else:
                from_line = message
                message = b''
        elif isinstance(message, _mboxMMDFMessage):
            author = message.get_from().encode('ascii')
            from_line = b'From ' + author
        elif isinstance(message, email.message.Message):
            from_line = message.get_unixfrom()  # May be None.
            if from_line is not None:
                from_line = from_line.encode('ascii')
        if from_line is None:
            from_line = b'From MAILER-DAEMON ' + time.asctime(time.gmtime()).encode()
        start = self._file.tell()
        self._file.write(from_line + linesep)
        self._dump_message(message, self._file, self._mangle_from_)
        stop = self._file.tell()
        return (start, stop)


class mbox(_mboxMMDF):
    """A classic mbox mailbox."""

    _mangle_from_ = True

    # All messages must end in a newline character, and
    # _post_message_hooks outputs an empty line between messages.
    _append_newline = True

    def __init__(self, path, factory=None, create=True):
        """Initialize an mbox mailbox."""
        self._message_factory = mboxMessage
        _mboxMMDF.__init__(self, path, factory, create)

    def _post_message_hook(self, f):
        """Called after writing each message to file f."""
        f.write(linesep)

    def _generate_toc(self):
        """Generate key-to-(start, stop) table of contents."""
        starts, stops = [], []
        last_was_empty = False
        self._file.seek(0)
        while True:
            line_pos = self._file.tell()
            line = self._file.readline()
            if line.startswith(b'From '):
                if len(stops) < len(starts):
                    if last_was_empty:
                        stops.append(line_pos - len(linesep))
                    else:
                        # The last line before the "From " line wasn't
                        # blank, but we consider it a start of a
                        # message anyway.
                        stops.append(line_pos)
                starts.append(line_pos)
                last_was_empty = False
            elif not line:
                if last_was_empty:
                    stops.append(line_pos - len(linesep))
                else:
                    stops.append(line_pos)
                break
            elif line == linesep:
                last_was_empty = True
            else:
                last_was_empty = False
        self._toc = dict(enumerate(zip(starts, stops)))
        self._next_key = len(self._toc)
        self._file_length = self._file.tell()


class MMDF(_mboxMMDF):
    """An MMDF mailbox."""

    def __init__(self, path, factory=None, create=True):
        """Initialize an MMDF mailbox."""
        self._message_factory = MMDFMessage
        _mboxMMDF.__init__(self, path, factory, create)

    def _pre_message_hook(self, f):
        """Called before writing each message to file f."""
        f.write(b'\001\001\001\001' + linesep)

    def _post_message_hook(self, f):
        """Called after writing each message to file f."""
        f.write(linesep + b'\001\001\001\001' + linesep)

    def _generate_toc(self):
        """Generate key-to-(start, stop) table of contents."""
        starts, stops = [], []
        self._file.seek(0)
        next_pos = 0
        while True:
            line_pos = next_pos
            line = self._file.readline()
            next_pos = self._file.tell()
            if line.startswith(b'\001\001\001\001' + linesep):
                starts.append(next_pos)
                while True:
                    line_pos = next_pos
                    line = self._file.readline()
                    next_pos = self._file.tell()
                    if line == b'\001\001\001\001' + linesep:
                        stops.append(line_pos - len(linesep))
                        break
                    elif not line:
                        stops.append(line_pos)
                        break
            elif not line:
                break
        self._toc = dict(enumerate(zip(starts, stops)))
        self._next_key = len(self._toc)
        self._file.seek(0, 2)
        self._file_length = self._file.tell()


class MH(Mailbox):
    """An MH mailbox."""

    def __init__(self, path, factory=None, create=True):
        """Initialize an MH instance."""
        Mailbox.__init__(self, path, factory, create)
        if not os.path.exists(self._path):
            if create:
                os.mkdir(self._path, 0o700)
                os.close(os.open(os.path.join(self._path, '.mh_sequences'),
                                 os.O_CREAT | os.O_EXCL | os.O_WRONLY, 0o600))
            else:
                raise NoSuchMailboxError(self._path)
        self._locked = False

    def add(self, message):
        """Add message and return assigned key."""
        keys = self.keys()
        if len(keys) == 0:
            new_key = 1
        else:
            new_key = max(keys) + 1
        new_path = os.path.join(self._path, str(new_key))
        f = _create_carefully(new_path)
        closed = False
        try:
            if self._locked:
                _lock_file(f)
            try:
                try:
                    self._dump_message(message, f)
                except BaseException:
                    # Unlock and close so it can be deleted on Windows
                    if self._locked:
                        _unlock_file(f)
                    _sync_close(f)
                    closed = True
                    os.remove(new_path)
                    raise
                if isinstance(message, MHMessage):
                    self._dump_sequences(message, new_key)
            finally:
                if self._locked:
                    _unlock_file(f)
        finally:
            if not closed:
                _sync_close(f)
        return new_key

    def remove(self, key):
        """Remove the keyed message; raise KeyError if it doesn't exist."""
        path = os.path.join(self._path, str(key))
        try:
            f = open(path, 'rb+')
        except OSError as e:
            if e.errno == errno.ENOENT:
                raise KeyError('No message with key: %s' % key)
            else:
                raise
        else:
            f.close()
            os.remove(path)

    def __setitem__(self, key, message):
        """Replace the keyed message; raise KeyError if it doesn't exist."""
        path = os.path.join(self._path, str(key))
        try:
            f = open(path, 'rb+')
        except OSError as e:
            if e.errno == errno.ENOENT:
                raise KeyError('No message with key: %s' % key)
            else:
                raise
        try:
            if self._locked:
                _lock_file(f)
            try:
                os.close(os.open(path, os.O_WRONLY | os.O_TRUNC))
                self._dump_message(message, f)
                if isinstance(message, MHMessage):
                    self._dump_sequences(message, key)
            finally:
                if self._locked:
                    _unlock_file(f)
        finally:
            _sync_close(f)

    def get_message(self, key):
        """Return a Message representation or raise a KeyError."""
        try:
            if self._locked:
                f = open(os.path.join(self._path, str(key)), 'rb+')
            else:
                f = open(os.path.join(self._path, str(key)), 'rb')
        except OSError as e:
            if e.errno == errno.ENOENT:
                raise KeyError('No message with key: %s' % key)
            else:
                raise
        with f:
            if self._locked:
                _lock_file(f)
            try:
                msg = MHMessage(f)
            finally:
                if self._locked:
                    _unlock_file(f)
        for name, key_list in self.get_sequences().items():
            if key in key_list:
                msg.add_sequence(name)
        return msg

    def get_bytes(self, key):
        """Return a bytes representation or raise a KeyError."""
        try:
            if self._locked:
                f = open(os.path.join(self._path, str(key)), 'rb+')
            else:
                f = open(os.path.join(self._path, str(key)), 'rb')
        except OSError as e:
            if e.errno == errno.ENOENT:
                raise KeyError('No message with key: %s' % key)
            else:
                raise
        with f:
            if self._locked:
                _lock_file(f)
            try:
                return f.read().replace(linesep, b'\n')
            finally:
                if self._locked:
                    _unlock_file(f)

    def get_file(self, key):
        """Return a file-like representation or raise a KeyError."""
        try:
            f = open(os.path.join(self._path, str(key)), 'rb')
        except OSError as e:
            if e.errno == errno.ENOENT:
                raise KeyError('No message with key: %s' % key)
            else:
                raise
        return _ProxyFile(f)

    def iterkeys(self):
        """Return an iterator over keys."""
        return iter(sorted(int(entry) for entry in os.listdir(self._path)
                                      if entry.isdigit()))

    def __contains__(self, key):
        """Return True if the keyed message exists, False otherwise."""
        return os.path.exists(os.path.join(self._path, str(key)))

    def __len__(self):
        """Return a count of messages in the mailbox."""
        return len(list(self.iterkeys()))

    def lock(self):
        """Lock the mailbox."""
        if not self._locked:
            self._file = open(os.path.join(self._path, '.mh_sequences'), 'rb+')
            _lock_file(self._file)
            self._locked = True

    def unlock(self):
        """Unlock the mailbox if it is locked."""
        if self._locked:
            _unlock_file(self._file)
            _sync_close(self._file)
            del self._file
            self._locked = False

    def flush(self):
        """Write any pending changes to the disk."""
        return

    def close(self):
        """Flush and close the mailbox."""
        if self._locked:
            self.unlock()

    def list_folders(self):
        """Return a list of folder names."""
        result = []
        for entry in os.listdir(self._path):
            if os.path.isdir(os.path.join(self._path, entry)):
                result.append(entry)
        return result

    def get_folder(self, folder):
        """Return an MH instance for the named folder."""
        return MH(os.path.join(self._path, folder),
                  factory=self._factory, create=False)

    def add_folder(self, folder):
        """Create a folder and return an MH instance representing it."""
        return MH(os.path.join(self._path, folder),
                  factory=self._factory)

    def remove_folder(self, folder):
        """Delete the named folder, which must be empty."""
        path = os.path.join(self._path, folder)
        entries = os.listdir(path)
        if entries == ['.mh_sequences']:
            os.remove(os.path.join(path, '.mh_sequences'))
        elif entries == []:
            pass
        else:
            raise NotEmptyError('Folder not empty: %s' % self._path)
        os.rmdir(path)

    def get_sequences(self):
        """Return a name-to-key-list dictionary to define each sequence."""
        results = {}
        with open(os.path.join(self._path, '.mh_sequences'), 'r', encoding='ASCII') as f:
            all_keys = set(self.keys())
            for line in f:
                try:
                    name, contents = line.split(':')
                    keys = set()
                    for spec in contents.split():
                        if spec.isdigit():
                            keys.add(int(spec))
                        else:
                            start, stop = (int(x) for x in spec.split('-'))
                            keys.update(range(start, stop + 1))
                    results[name] = [key for key in sorted(keys) \
                                         if key in all_keys]
                    if len(results[name]) == 0:
                        del results[name]
                except ValueError:
                    raise FormatError('Invalid sequence specification: %s' %
                                      line.rstrip())
        return results

    def set_sequences(self, sequences):
        """Set sequences using the given name-to-key-list dictionary."""
        f = open(os.path.join(self._path, '.mh_sequences'), 'r+', encoding='ASCII')
        try:
            os.close(os.open(f.name, os.O_WRONLY | os.O_TRUNC))
            for name, keys in sequences.items():
                if len(keys) == 0:
                    continue
                f.write(name + ':')
                prev = None
                completing = False
                for key in sorted(set(keys)):
                    if key - 1 == prev:
                        if not completing:
                            completing = True
                            f.write('-')
                    elif completing:
                        completing = False
                        f.write('%s %s' % (prev, key))
                    else:
                        f.write(' %s' % key)
                    prev = key
                if completing:
                    f.write(str(prev) + '\n')
                else:
                    f.write('\n')
        finally:
            _sync_close(f)

    def pack(self):
        """Re-name messages to eliminate numbering gaps. Invalidates keys."""
        sequences = self.get_sequences()
        prev = 0
        changes = []
        for key in self.iterkeys():
            if key - 1 != prev:
                changes.append((key, prev + 1))
                try:
                    os.link(os.path.join(self._path, str(key)),
                            os.path.join(self._path, str(prev + 1)))
                except (AttributeError, PermissionError):
                    os.rename(os.path.join(self._path, str(key)),
                              os.path.join(self._path, str(prev + 1)))
                else:
                    os.unlink(os.path.join(self._path, str(key)))
            prev += 1
        self._next_key = prev + 1
        if len(changes) == 0:
            return
        for name, key_list in sequences.items():
            for old, new in changes:
                if old in key_list:
                    key_list[key_list.index(old)] = new
        self.set_sequences(sequences)

    def _dump_sequences(self, message, key):
        """Inspect a new MHMessage and update sequences appropriately."""
        pending_sequences = message.get_sequences()
        all_sequences = self.get_sequences()
        for name, key_list in all_sequences.items():
            if name in pending_sequences:
                key_list.append(key)
            elif key in key_list:
                del key_list[key_list.index(key)]
        for sequence in pending_sequences:
            if sequence not in all_sequences:
                all_sequences[sequence] = [key]
        self.set_sequences(all_sequences)


class Babyl(_singlefileMailbox):
    """An Rmail-style Babyl mailbox."""

    _special_labels = frozenset({'unseen', 'deleted', 'filed', 'answered',
                                 'forwarded', 'edited', 'resent'})

    def __init__(self, path, factory=None, create=True):
        """Initialize a Babyl mailbox."""
        _singlefileMailbox.__init__(self, path, factory, create)
        self._labels = {}

    def add(self, message):
        """Add message and return assigned key."""
        key = _singlefileMailbox.add(self, message)
        if isinstance(message, BabylMessage):
            self._labels[key] = message.get_labels()
        return key

    def remove(self, key):
        """Remove the keyed message; raise KeyError if it doesn't exist."""
        _singlefileMailbox.remove(self, key)
        if key in self._labels:
            del self._labels[key]

    def __setitem__(self, key, message):
        """Replace the keyed message; raise KeyError if it doesn't exist."""
        _singlefileMailbox.__setitem__(self, key, message)
        if isinstance(message, BabylMessage):
            self._labels[key] = message.get_labels()

    def get_message(self, key):
        """Return a Message representation or raise a KeyError."""
        start, stop = self._lookup(key)
        self._file.seek(start)
        self._file.readline()   # Skip b'1,' line specifying labels.
        original_headers = io.BytesIO()
        while True:
            line = self._file.readline()
            if line == b'*** EOOH ***' + linesep or not line:
                break
            original_headers.write(line.replace(linesep, b'\n'))
        visible_headers = io.BytesIO()
        while True:
            line = self._file.readline()
            if line == linesep or not line:
                break
            visible_headers.write(line.replace(linesep, b'\n'))
        # Read up to the stop, or to the end
        n = stop - self._file.tell()
        assert n >= 0
        body = self._file.read(n)
        body = body.replace(linesep, b'\n')
        msg = BabylMessage(original_headers.getvalue() + body)
        msg.set_visible(visible_headers.getvalue())
        if key in self._labels:
            msg.set_labels(self._labels[key])
        return msg

    def get_bytes(self, key):
        """Return a string representation or raise a KeyError."""
        start, stop = self._lookup(key)
        self._file.seek(start)
        self._file.readline()   # Skip b'1,' line specifying labels.
        original_headers = io.BytesIO()
        while True:
            line = self._file.readline()
            if line == b'*** EOOH ***' + linesep or not line:
                break
            original_headers.write(line.replace(linesep, b'\n'))
        while True:
            line = self._file.readline()
            if line == linesep or not line:
                break
        headers = original_headers.getvalue()
        n = stop - self._file.tell()
        assert n >= 0
        data = self._file.read(n)
        data = data.replace(linesep, b'\n')
        return headers + data

    def get_file(self, key):
        """Return a file-like representation or raise a KeyError."""
        return io.BytesIO(self.get_bytes(key).replace(b'\n', linesep))

    def get_labels(self):
        """Return a list of user-defined labels in the mailbox."""
        self._lookup()
        labels = set()
        for label_list in self._labels.values():
            labels.update(label_list)
        labels.difference_update(self._special_labels)
        return list(labels)

    def _generate_toc(self):
        """Generate key-to-(start, stop) table of contents."""
        starts, stops = [], []
        self._file.seek(0)
        next_pos = 0
        label_lists = []
        while True:
            line_pos = next_pos
            line = self._file.readline()
            next_pos = self._file.tell()
            if line == b'\037\014' + linesep:
                if len(stops) < len(starts):
                    stops.append(line_pos - len(linesep))
                starts.append(next_pos)
                labels = [label.strip() for label
                                        in self._file.readline()[1:].split(b',')
                                        if label.strip()]
                label_lists.append(labels)
            elif line == b'\037' or line == b'\037' + linesep:
                if len(stops) < len(starts):
                    stops.append(line_pos - len(linesep))
            elif not line:
                stops.append(line_pos - len(linesep))
                break
        self._toc = dict(enumerate(zip(starts, stops)))
        self._labels = dict(enumerate(label_lists))
        self._next_key = len(self._toc)
        self._file.seek(0, 2)
        self._file_length = self._file.tell()

    def _pre_mailbox_hook(self, f):
        """Called before writing the mailbox to file f."""
        babyl = b'BABYL OPTIONS:' + linesep
        babyl += b'Version: 5' + linesep
        labels = self.get_labels()
        labels = (label.encode() for label in labels)
        babyl += b'Labels:' + b','.join(labels) + linesep
        babyl += b'\037'
        f.write(babyl)

    def _pre_message_hook(self, f):
        """Called before writing each message to file f."""
        f.write(b'\014' + linesep)

    def _post_message_hook(self, f):
        """Called after writing each message to file f."""
        f.write(linesep + b'\037')

    def _install_message(self, message):
        """Write message contents and return (start, stop)."""
        start = self._file.tell()
        if isinstance(message, BabylMessage):
            special_labels = []
            labels = []
            for label in message.get_labels():
                if label in self._special_labels:
                    special_labels.append(label)
                else:
                    labels.append(label)
            self._file.write(b'1')
            for label in special_labels:
                self._file.write(b', ' + label.encode())
            self._file.write(b',,')
            for label in labels:
                self._file.write(b' ' + label.encode() + b',')
            self._file.write(linesep)
        else:
            self._file.write(b'1,,' + linesep)
        if isinstance(message, email.message.Message):
            orig_buffer = io.BytesIO()
            orig_generator = email.generator.BytesGenerator(orig_buffer, False, 0)
            orig_generator.flatten(message)
            orig_buffer.seek(0)
            while True:
                line = orig_buffer.readline()
                self._file.write(line.replace(b'\n', linesep))
                if line == b'\n' or not line:
                    break
            self._file.write(b'*** EOOH ***' + linesep)
            if isinstance(message, BabylMessage):
                vis_buffer = io.BytesIO()
                vis_generator = email.generator.BytesGenerator(vis_buffer, False, 0)
                vis_generator.flatten(message.get_visible())
                while True:
                    line = vis_buffer.readline()
                    self._file.write(line.replace(b'\n', linesep))
                    if line == b'\n' or not line:
                        break
            else:
                orig_buffer.seek(0)
                while True:
                    line = orig_buffer.readline()
                    self._file.write(line.replace(b'\n', linesep))
                    if line == b'\n' or not line:
                        break
            while True:
                buffer = orig_buffer.read(4096) # Buffer size is arbitrary.
                if not buffer:
                    break
                self._file.write(buffer.replace(b'\n', linesep))
        elif isinstance(message, (bytes, str, io.StringIO)):
            if isinstance(message, io.StringIO):
                warnings.warn("Use of StringIO input is deprecated, "
                    "use BytesIO instead", DeprecationWarning, 3)
                message = message.getvalue()
            if isinstance(message, str):
                message = self._string_to_bytes(message)
            body_start = message.find(b'\n\n') + 2
            if body_start - 2 != -1:
                self._file.write(message[:body_start].replace(b'\n', linesep))
                self._file.write(b'*** EOOH ***' + linesep)
                self._file.write(message[:body_start].replace(b'\n', linesep))
                self._file.write(message[body_start:].replace(b'\n', linesep))
            else:
                self._file.write(b'*** EOOH ***' + linesep + linesep)
                self._file.write(message.replace(b'\n', linesep))
        elif hasattr(message, 'readline'):
            if hasattr(message, 'buffer'):
                warnings.warn("Use of text mode files is deprecated, "
                    "use a binary mode file instead", DeprecationWarning, 3)
                message = message.buffer
            original_pos = message.tell()
            first_pass = True
            while True:
                line = message.readline()
                # Universal newline support.
                if line.endswith(b'\r\n'):
                    line = line[:-2] + b'\n'
                elif line.endswith(b'\r'):
                    line = line[:-1] + b'\n'
                self._file.write(line.replace(b'\n', linesep))
                if line == b'\n' or not line:
                    if first_pass:
                        first_pass = False
                        self._file.write(b'*** EOOH ***' + linesep)
                        message.seek(original_pos)
                    else:
                        break
            while True:
                line = message.readline()
                if not line:
                    break
                # Universal newline support.
                if line.endswith(b'\r\n'):
                    line = line[:-2] + linesep
                elif line.endswith(b'\r'):
                    line = line[:-1] + linesep
                elif line.endswith(b'\n'):
                    line = line[:-1] + linesep
                self._file.write(line)
        else:
            raise TypeError('Invalid message type: %s' % type(message))
        stop = self._file.tell()
        return (start, stop)


class Message(email.message.Message):
    """Message with mailbox-format-specific properties."""

    def __init__(self, message=None):
        """Initialize a Message instance."""
        if isinstance(message, email.message.Message):
            self._become_message(copy.deepcopy(message))
            if isinstance(message, Message):
                message._explain_to(self)
        elif isinstance(message, bytes):
            self._become_message(email.message_from_bytes(message))
        elif isinstance(message, str):
            self._become_message(email.message_from_string(message))
        elif isinstance(message, io.TextIOWrapper):
            self._become_message(email.message_from_file(message))
        elif hasattr(message, "read"):
            self._become_message(email.message_from_binary_file(message))
        elif message is None:
            email.message.Message.__init__(self)
        else:
            raise TypeError('Invalid message type: %s' % type(message))

    def _become_message(self, message):
        """Assume the non-format-specific state of message."""
        type_specific = getattr(message, '_type_specific_attributes', [])
        for name in message.__dict__:
            if name not in type_specific:
                self.__dict__[name] = message.__dict__[name]

    def _explain_to(self, message):
        """Copy format-specific state to message insofar as possible."""
        if isinstance(message, Message):
            return  # There's nothing format-specific to explain.
        else:
            raise TypeError('Cannot convert to specified type')


class MaildirMessage(Message):
    """Message with Maildir-specific properties."""

    _type_specific_attributes = ['_subdir', '_info', '_date']

    def __init__(self, message=None):
        """Initialize a MaildirMessage instance."""
        self._subdir = 'new'
        self._info = ''
        self._date = time.time()
        Message.__init__(self, message)

    def get_subdir(self):
        """Return 'new' or 'cur'."""
        return self._subdir

    def set_subdir(self, subdir):
        """Set subdir to 'new' or 'cur'."""
        if subdir == 'new' or subdir == 'cur':
            self._subdir = subdir
        else:
            raise ValueError("subdir must be 'new' or 'cur': %s" % subdir)

    def get_flags(self):
        """Return as a string the flags that are set."""
        if self._info.startswith('2,'):
            return self._info[2:]
        else:
            return ''

    def set_flags(self, flags):
        """Set the given flags and unset all others."""
        self._info = '2,' + ''.join(sorted(flags))

    def add_flag(self, flag):
        """Set the given flag(s) without changing others."""
        self.set_flags(''.join(set(self.get_flags()) | set(flag)))

    def remove_flag(self, flag):
        """Unset the given string flag(s) without changing others."""
        if self.get_flags():
            self.set_flags(''.join(set(self.get_flags()) - set(flag)))

    def get_date(self):
        """Return delivery date of message, in seconds since the epoch."""
        return self._date

    def set_date(self, date):
        """Set delivery date of message, in seconds since the epoch."""
        try:
            self._date = float(date)
        except ValueError:
            raise TypeError("can't convert to float: %s" % date) from None

    def get_info(self):
        """Get the message's "info" as a string."""
        return self._info

    def set_info(self, info):
        """Set the message's "info" string."""
        if isinstance(info, str):
            self._info = info
        else:
            raise TypeError('info must be a string: %s' % type(info))

    def _explain_to(self, message):
        """Copy Maildir-specific state to message insofar as possible."""
        if isinstance(message, MaildirMessage):
            message.set_flags(self.get_flags())
            message.set_subdir(self.get_subdir())
            message.set_date(self.get_date())
        elif isinstance(message, _mboxMMDFMessage):
            flags = set(self.get_flags())
            if 'S' in flags:
                message.add_flag('R')
            if self.get_subdir() == 'cur':
                message.add_flag('O')
            if 'T' in flags:
                message.add_flag('D')
            if 'F' in flags:
                message.add_flag('F')
            if 'R' in flags:
                message.add_flag('A')
            message.set_from('MAILER-DAEMON', time.gmtime(self.get_date()))
        elif isinstance(message, MHMessage):
            flags = set(self.get_flags())
            if 'S' not in flags:
                message.add_sequence('unseen')
            if 'R' in flags:
                message.add_sequence('replied')
            if 'F' in flags:
                message.add_sequence('flagged')
        elif isinstance(message, BabylMessage):
            flags = set(self.get_flags())
            if 'S' not in flags:
                message.add_label('unseen')
            if 'T' in flags:
                message.add_label('deleted')
            if 'R' in flags:
                message.add_label('answered')
            if 'P' in flags:
                message.add_label('forwarded')
        elif isinstance(message, Message):
            pass
        else:
            raise TypeError('Cannot convert to specified type: %s' %
                            type(message))


class _mboxMMDFMessage(Message):
    """Message with mbox- or MMDF-specific properties."""

    _type_specific_attributes = ['_from']

    def __init__(self, message=None):
        """Initialize an mboxMMDFMessage instance."""
        self.set_from('MAILER-DAEMON', True)
        if isinstance(message, email.message.Message):
            unixfrom = message.get_unixfrom()
            if unixfrom is not None and unixfrom.startswith('From '):
                self.set_from(unixfrom[5:])
        Message.__init__(self, message)

    def get_from(self):
        """Return contents of "From " line."""
        return self._from

    def set_from(self, from_, time_=None):
        """Set "From " line, formatting and appending time_ if specified."""
        if time_ is not None:
            if time_ is True:
                time_ = time.gmtime()
            from_ += ' ' + time.asctime(time_)
        self._from = from_

    def get_flags(self):
        """Return as a string the flags that are set."""
        return self.get('Status', '') + self.get('X-Status', '')

    def set_flags(self, flags):
        """Set the given flags and unset all others."""
        flags = set(flags)
        status_flags, xstatus_flags = '', ''
        for flag in ('R', 'O'):
            if flag in flags:
                status_flags += flag
                flags.remove(flag)
        for flag in ('D', 'F', 'A'):
            if flag in flags:
                xstatus_flags += flag
                flags.remove(flag)
        xstatus_flags += ''.join(sorted(flags))
        try:
            self.replace_header('Status', status_flags)
        except KeyError:
            self.add_header('Status', status_flags)
        try:
            self.replace_header('X-Status', xstatus_flags)
        except KeyError:
            self.add_header('X-Status', xstatus_flags)

    def add_flag(self, flag):
        """Set the given flag(s) without changing others."""
        self.set_flags(''.join(set(self.get_flags()) | set(flag)))

    def remove_flag(self, flag):
        """Unset the given string flag(s) without changing others."""
        if 'Status' in self or 'X-Status' in self:
            self.set_flags(''.join(set(self.get_flags()) - set(flag)))

    def _explain_to(self, message):
        """Copy mbox- or MMDF-specific state to message insofar as possible."""
        if isinstance(message, MaildirMessage):
            flags = set(self.get_flags())
            if 'O' in flags:
                message.set_subdir('cur')
            if 'F' in flags:
                message.add_flag('F')
            if 'A' in flags:
                message.add_flag('R')
            if 'R' in flags:
                message.add_flag('S')
            if 'D' in flags:
                message.add_flag('T')
            del message['status']
            del message['x-status']
            maybe_date = ' '.join(self.get_from().split()[-5:])
            try:
                message.set_date(calendar.timegm(time.strptime(maybe_date,
                                                      '%a %b %d %H:%M:%S %Y')))
            except (ValueError, OverflowError):
                pass
        elif isinstance(message, _mboxMMDFMessage):
            message.set_flags(self.get_flags())
            message.set_from(self.get_from())
        elif isinstance(message, MHMessage):
            flags = set(self.get_flags())
            if 'R' not in flags:
                message.add_sequence('unseen')
            if 'A' in flags:
                message.add_sequence('replied')
            if 'F' in flags:
                message.add_sequence('flagged')
            del message['status']
            del message['x-status']
        elif isinstance(message, BabylMessage):
            flags = set(self.get_flags())
            if 'R' not in flags:
                message.add_label('unseen')
            if 'D' in flags:
                message.add_label('deleted')
            if 'A' in flags:
                message.add_label('answered')
            del message['status']
            del message['x-status']
        elif isinstance(message, Message):
            pass
        else:
            raise TypeError('Cannot convert to specified type: %s' %
                            type(message))


class mboxMessage(_mboxMMDFMessage):
    """Message with mbox-specific properties."""


class MHMessage(Message):
    """Message with MH-specific properties."""

    _type_specific_attributes = ['_sequences']

    def __init__(self, message=None):
        """Initialize an MHMessage instance."""
        self._sequences = []
        Message.__init__(self, message)

    def get_sequences(self):
        """Return a list of sequences that include the message."""
        return self._sequences[:]

    def set_sequences(self, sequences):
        """Set the list of sequences that include the message."""
        self._sequences = list(sequences)

    def add_sequence(self, sequence):
        """Add sequence to list of sequences including the message."""
        if isinstance(sequence, str):
            if not sequence in self._sequences:
                self._sequences.append(sequence)
        else:
            raise TypeError('sequence type must be str: %s' % type(sequence))

    def remove_sequence(self, sequence):
        """Remove sequence from the list of sequences including the message."""
        try:
            self._sequences.remove(sequence)
        except ValueError:
            pass

    def _explain_to(self, message):
        """Copy MH-specific state to message insofar as possible."""
        if isinstance(message, MaildirMessage):
            sequences = set(self.get_sequences())
            if 'unseen' in sequences:
                message.set_subdir('cur')
            else:
                message.set_subdir('cur')
                message.add_flag('S')
            if 'flagged' in sequences:
                message.add_flag('F')
            if 'replied' in sequences:
                message.add_flag('R')
        elif isinstance(message, _mboxMMDFMessage):
            sequences = set(self.get_sequences())
            if 'unseen' not in sequences:
                message.add_flag('RO')
            else:
                message.add_flag('O')
            if 'flagged' in sequences:
                message.add_flag('F')
            if 'replied' in sequences:
                message.add_flag('A')
        elif isinstance(message, MHMessage):
            for sequence in self.get_sequences():
                message.add_sequence(sequence)
        elif isinstance(message, BabylMessage):
            sequences = set(self.get_sequences())
            if 'unseen' in sequences:
                message.add_label('unseen')
            if 'replied' in sequences:
                message.add_label('answered')
        elif isinstance(message, Message):
            pass
        else:
            raise TypeError('Cannot convert to specified type: %s' %
                            type(message))


class BabylMessage(Message):
    """Message with Babyl-specific properties."""

    _type_specific_attributes = ['_labels', '_visible']

    def __init__(self, message=None):
        """Initialize a BabylMessage instance."""
        self._labels = []
        self._visible = Message()
        Message.__init__(self, message)

    def get_labels(self):
        """Return a list of labels on the message."""
        return self._labels[:]

    def set_labels(self, labels):
        """Set the list of labels on the message."""
        self._labels = list(labels)

    def add_label(self, label):
        """Add label to list of labels on the message."""
        if isinstance(label, str):
            if label not in self._labels:
                self._labels.append(label)
        else:
            raise TypeError('label must be a string: %s' % type(label))

    def remove_label(self, label):
        """Remove label from the list of labels on the message."""
        try:
            self._labels.remove(label)
        except ValueError:
            pass

    def get_visible(self):
        """Return a Message representation of visible headers."""
        return Message(self._visible)

    def set_visible(self, visible):
        """Set the Message representation of visible headers."""
        self._visible = Message(visible)

    def update_visible(self):
        """Update and/or sensibly generate a set of visible headers."""
        for header in self._visible.keys():
            if header in self:
                self._visible.replace_header(header, self[header])
            else:
                del self._visible[header]
        for header in ('Date', 'From', 'Reply-To', 'To', 'CC', 'Subject'):
            if header in self and header not in self._visible:
                self._visible[header] = self[header]

    def _explain_to(self, message):
        """Copy Babyl-specific state to message insofar as possible."""
        if isinstance(message, MaildirMessage):
            labels = set(self.get_labels())
            if 'unseen' in labels:
                message.set_subdir('cur')
            else:
                message.set_subdir('cur')
                message.add_flag('S')
            if 'forwarded' in labels or 'resent' in labels:
                message.add_flag('P')
            if 'answered' in labels:
                message.add_flag('R')
            if 'deleted' in labels:
                message.add_flag('T')
        elif isinstance(message, _mboxMMDFMessage):
            labels = set(self.get_labels())
            if 'unseen' not in labels:
                message.add_flag('RO')
            else:
                message.add_flag('O')
            if 'deleted' in labels:
                message.add_flag('D')
            if 'answered' in labels:
                message.add_flag('A')
        elif isinstance(message, MHMessage):
            labels = set(self.get_labels())
            if 'unseen' in labels:
                message.add_sequence('unseen')
            if 'answered' in labels:
                message.add_sequence('replied')
        elif isinstance(message, BabylMessage):
            message.set_visible(self.get_visible())
            for label in self.get_labels():
                message.add_label(label)
        elif isinstance(message, Message):
            pass
        else:
            raise TypeError('Cannot convert to specified type: %s' %
                            type(message))


class MMDFMessage(_mboxMMDFMessage):
    """Message with MMDF-specific properties."""


class _ProxyFile:
    """A read-only wrapper of a file."""

    def __init__(self, f, pos=None):
        """Initialize a _ProxyFile."""
        self._file = f
        if pos is None:
            self._pos = f.tell()
        else:
            self._pos = pos

    def read(self, size=None):
        """Read bytes."""
        return self._read(size, self._file.read)

    def read1(self, size=None):
        """Read bytes."""
        return self._read(size, self._file.read1)

    def readline(self, size=None):
        """Read a line."""
        return self._read(size, self._file.readline)

    def readlines(self, sizehint=None):
        """Read multiple lines."""
        result = []
        for line in self:
            result.append(line)
            if sizehint is not None:
                sizehint -= len(line)
                if sizehint <= 0:
                    break
        return result

    def __iter__(self):
        """Iterate over lines."""
        while True:
            line = self.readline()
            if not line:
                return
            yield line

    def tell(self):
        """Return the position."""
        return self._pos

    def seek(self, offset, whence=0):
        """Change position."""
        if whence == 1:
            self._file.seek(self._pos)
        self._file.seek(offset, whence)
        self._pos = self._file.tell()

    def close(self):
        """Close the file."""
        if hasattr(self, '_file'):
            try:
                if hasattr(self._file, 'close'):
                    self._file.close()
            finally:
                del self._file

    def _read(self, size, read_method):
        """Read size bytes using read_method."""
        if size is None:
            size = -1
        self._file.seek(self._pos)
        result = read_method(size)
        self._pos = self._file.tell()
        return result

    def __enter__(self):
        """Context management protocol support."""
        return self

    def __exit__(self, *exc):
        self.close()

    def readable(self):
        return self._file.readable()

    def writable(self):
        return self._file.writable()

    def seekable(self):
        return self._file.seekable()

    def flush(self):
        return self._file.flush()

    @property
    def closed(self):
        if not hasattr(self, '_file'):
            return True
        if not hasattr(self._file, 'closed'):
            return False
        return self._file.closed


class _PartialFile(_ProxyFile):
    """A read-only wrapper of part of a file."""

    def __init__(self, f, start=None, stop=None):
        """Initialize a _PartialFile."""
        _ProxyFile.__init__(self, f, start)
        self._start = start
        self._stop = stop

    def tell(self):
        """Return the position with respect to start."""
        return _ProxyFile.tell(self) - self._start

    def seek(self, offset, whence=0):
        """Change position, possibly with respect to start or stop."""
        if whence == 0:
            self._pos = self._start
            whence = 1
        elif whence == 2:
            self._pos = self._stop
            whence = 1
        _ProxyFile.seek(self, offset, whence)

    def _read(self, size, read_method):
        """Read size bytes using read_method, honoring start and stop."""
        remaining = self._stop - self._pos
        if remaining <= 0:
            return b''
        if size is None or size < 0 or size > remaining:
            size = remaining
        return _ProxyFile._read(self, size, read_method)

    def close(self):
        # do *not* close the underlying file object for partial files,
        # since it's global to the mailbox object
        if hasattr(self, '_file'):
            del self._file


def _lock_file(f, dotlock=True):
    """Lock file f using lockf and dot locking."""
    dotlock_done = False
    try:
        if fcntl:
            try:
                fcntl.lockf(f, fcntl.LOCK_EX | fcntl.LOCK_NB)
            except OSError as e:
                if e.errno in (errno.EAGAIN, errno.EACCES, errno.EROFS):
                    raise ExternalClashError('lockf: lock unavailable: %s' %
                                             f.name)
                else:
                    raise
        if dotlock:
            try:
                pre_lock = _create_temporary(f.name + '.lock')
                pre_lock.close()
            except OSError as e:
                if e.errno in (errno.EACCES, errno.EROFS):
                    return  # Without write access, just skip dotlocking.
                else:
                    raise
            try:
                try:
                    os.link(pre_lock.name, f.name + '.lock')
                    dotlock_done = True
                except (AttributeError, PermissionError):
                    os.rename(pre_lock.name, f.name + '.lock')
                    dotlock_done = True
                else:
                    os.unlink(pre_lock.name)
            except FileExistsError:
                os.remove(pre_lock.name)
                raise ExternalClashError('dot lock unavailable: %s' %
                                         f.name)
    except:
        if fcntl:
            fcntl.lockf(f, fcntl.LOCK_UN)
        if dotlock_done:
            os.remove(f.name + '.lock')
        raise

def _unlock_file(f):
    """Unlock file f using lockf and dot locking."""
    if fcntl:
        fcntl.lockf(f, fcntl.LOCK_UN)
    if os.path.exists(f.name + '.lock'):
        os.remove(f.name + '.lock')

def _create_carefully(path):
    """Create a file if it doesn't exist and open for reading and writing."""
    fd = os.open(path, os.O_CREAT | os.O_EXCL | os.O_RDWR, 0o666)
    try:
        return open(path, 'rb+')
    finally:
        os.close(fd)

def _create_temporary(path):
    """Create a temp file based on path and open for reading and writing."""
    return _create_carefully('%s.%s.%s.%s' % (path, int(time.time()),
                                              socket.gethostname(),
                                              os.getpid()))

def _sync_flush(f):
    """Ensure changes to file f are physically on disk."""
    f.flush()
    if hasattr(os, 'fsync'):
        os.fsync(f.fileno())

def _sync_close(f):
    """Close file f, ensuring all changes are physically on disk."""
    _sync_flush(f)
    f.close()


class Error(Exception):
    """Raised for module-specific errors."""

class NoSuchMailboxError(Error):
    """The specified mailbox does not exist and won't be created."""

class NotEmptyError(Error):
    """The specified mailbox is not empty and deletion was requested."""

class ExternalClashError(Error):
    """Another process caused an action to fail."""

class FormatError(Error):
    """A file appears to have an invalid format."""
_sysconfigdata_d_linux_x86_64-linux-gnu.py000064400000112535151153537630014617 0ustar00# system configuration generated and used by the sysconfig module
build_time_vars = {'ABIFLAGS': 'd',
 'AC_APPLE_UNIVERSAL_BUILD': 0,
 'AIX_GENUINE_CPLUSPLUS': 0,
 'ALT_SOABI': '"cpython-38-x86_64-linux-gnu"',
 'ANDROID_API_LEVEL': 0,
 'AR': 'ar',
 'ARFLAGS': 'rcs',
 'BASECFLAGS': '-Wno-unused-result -Wsign-compare',
 'BASECPPFLAGS': '-IObjects -IInclude -IPython',
 'BASEMODLIBS': '',
 'BINDIR': '/usr/bin',
 'BINLIBDEST': '/usr/lib64/python3.8',
 'BLDLIBRARY': '-L. -lpython3.8d',
 'BLDSHARED': 'gcc -pthread -shared -Wl,-z,relro  -Wl,-z,now  -g  '
              '-Wl,-z,relro  -Wl,-z,now  -g',
 'BUILDEXE': '',
 'BUILDPYTHON': 'python',
 'BUILD_GNU_TYPE': 'x86_64-redhat-linux-gnu',
 'BYTESTR_DEPS': '\\',
 'CC': 'gcc -pthread',
 'CCSHARED': '-fPIC',
 'CFLAGS': '-Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1  '
           '-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 '
           '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong '
           '-grecord-gcc-switches   -m64 -mtune=generic '
           '-fasynchronous-unwind-tables -fstack-clash-protection '
           '-fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall '
           '-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 '
           '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong '
           '-grecord-gcc-switches   -m64 -mtune=generic '
           '-fasynchronous-unwind-tables -fstack-clash-protection '
           '-fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall '
           '-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 '
           '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong '
           '-grecord-gcc-switches   -m64 -mtune=generic '
           '-fasynchronous-unwind-tables -fstack-clash-protection '
           '-fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -Og',
 'CFLAGSFORSHARED': '-fPIC',
 'CFLAGS_ALIASING': '',
 'CONFIGFILES': 'configure configure.ac acconfig.h pyconfig.h.in '
                'Makefile.pre.in',
 'CONFIGURE_CFLAGS': '-O2 -g -pipe -Wall -Werror=format-security '
                     '-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS '
                     '-fexceptions -fstack-protector-strong '
                     '-grecord-gcc-switches   -m64 -mtune=generic '
                     '-fasynchronous-unwind-tables -fstack-clash-protection '
                     '-fcf-protection -D_GNU_SOURCE -fPIC -fwrapv',
 'CONFIGURE_CFLAGS_NODIST': '-O2 -g -pipe -Wall -Werror=format-security '
                            '-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS '
                            '-fexceptions -fstack-protector-strong '
                            '-grecord-gcc-switches '
                            '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 '
                            '-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 '
                            '-m64 -mtune=generic -fasynchronous-unwind-tables '
                            '-fstack-clash-protection -fcf-protection '
                            '-D_GNU_SOURCE -fPIC -fwrapv '
                            '-fno-semantic-interposition -flto '
                            '-fuse-linker-plugin -ffat-lto-objects '
                            '-flto-partition=none -g -std=c99 -Wextra '
                            '-Wno-unused-result -Wno-unused-parameter '
                            '-Wno-missing-field-initializers '
                            '-Werror=implicit-function-declaration',
 'CONFIGURE_CPPFLAGS': '',
 'CONFIGURE_LDFLAGS': '-Wl,-z,relro  -Wl,-z,now  -g',
 'CONFIGURE_LDFLAGS_NODIST': '-Wl,-z,relro  -Wl,-z,now '
                             '-specs=/usr/lib/rpm/redhat/redhat-hardened-ld '
                             '-fno-semantic-interposition -g  -flto '
                             '-fuse-linker-plugin -ffat-lto-objects '
                             '-flto-partition=none -g',
 'CONFIG_ARGS': "'--build=x86_64-redhat-linux-gnu' "
                "'--host=x86_64-redhat-linux-gnu' '--program-prefix=' "
                "'--disable-dependency-tracking' '--prefix=/usr' "
                "'--exec-prefix=/usr' '--bindir=/usr/bin' "
                "'--sbindir=/usr/sbin' '--sysconfdir=/etc' "
                "'--datadir=/usr/share' '--includedir=/usr/include' "
                "'--libdir=/usr/lib64' '--libexecdir=/usr/libexec' "
                "'--localstatedir=/var' '--sharedstatedir=/var/lib' "
                "'--mandir=/usr/share/man' '--infodir=/usr/share/info' "
                "'--enable-ipv6' '--enable-shared' '--with-computed-gotos=yes' "
                "'--with-dbmliborder=gdbm:ndbm:bdb' '--with-system-expat' "
                "'--with-system-ffi' '--enable-loadable-sqlite-extensions' "
                "'--with-dtrace' '--with-lto' "
                "'--with-ssl-default-suites=openssl' '--with-valgrind' "
                "'--without-ensurepip' '--with-pydebug' "
                "'build_alias=x86_64-redhat-linux-gnu' "
                "'host_alias=x86_64-redhat-linux-gnu' 'CFLAGS= -O2 -g -pipe "
                '-Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 '
                '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions '
                '-fstack-protector-strong -grecord-gcc-switches   -m64 '
                '-mtune=generic -fasynchronous-unwind-tables '
                '-fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC '
                "-fwrapv ' 'LDFLAGS= -Wl,-z,relro  -Wl,-z,now  -g ' "
                "'CPPFLAGS=' "
                "'PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig'",
 'CONFINCLUDEDIR': '/usr/include',
 'CONFINCLUDEPY': '/usr/include/python3.8d',
 'COREPYTHONPATH': '',
 'COVERAGE_INFO': '/builddir/build/BUILD/Python-3.8.17/build/debug/coverage.info',
 'COVERAGE_REPORT': '/builddir/build/BUILD/Python-3.8.17/build/debug/lcov-report',
 'COVERAGE_REPORT_OPTIONS': '--no-branch-coverage --title "CPython lcov '
                            'report"',
 'CPPFLAGS': '-IObjects -IInclude -IPython -I. '
             '-I/builddir/build/BUILD/Python-3.8.17/Include',
 'CXX': 'g++ -pthread',
 'DESTDIRS': '/usr /usr/lib64 /usr/lib64/python3.8 '
             '/usr/lib64/python3.8/lib-dynload',
 'DESTLIB': '/usr/lib64/python3.8',
 'DESTPATH': '',
 'DESTSHARED': '/usr/lib64/python3.8/lib-dynload',
 'DFLAGS': '',
 'DIRMODE': 755,
 'DIST': 'README.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in '
         'Makefile.pre.in Include Lib Misc Ext-dummy',
 'DISTDIRS': 'Include Lib Misc Ext-dummy',
 'DISTFILES': 'README.rst ChangeLog configure configure.ac acconfig.h '
              'pyconfig.h.in Makefile.pre.in',
 'DLINCLDIR': '.',
 'DLLLIBRARY': '',
 'DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754': 0,
 'DOUBLE_IS_BIG_ENDIAN_IEEE754': 0,
 'DOUBLE_IS_LITTLE_ENDIAN_IEEE754': 1,
 'DTRACE': '/usr/bin/dtrace',
 'DTRACE_DEPS': '\\',
 'DTRACE_HEADERS': 'Include/pydtrace_probes.h',
 'DTRACE_OBJS': 'Python/pydtrace.o',
 'DYNLOADFILE': 'dynload_shlib.o',
 'ENABLE_IPV6': 1,
 'ENSUREPIP': 'no',
 'EXE': '',
 'EXEMODE': 755,
 'EXTRATESTOPTS': '',
 'EXT_SUFFIX': '.cpython-38d-x86_64-linux-gnu.so',
 'FILEMODE': 644,
 'FLOAT_WORDS_BIGENDIAN': 0,
 'FLOCK_NEEDS_LIBBSD': 0,
 'GETPGRP_HAVE_ARG': 0,
 'GETTIMEOFDAY_NO_TZ': 0,
 'GITBRANCH': '',
 'GITTAG': '',
 'GITVERSION': '',
 'GNULD': 'yes',
 'HAVE_ACCEPT4': 1,
 'HAVE_ACOSH': 1,
 'HAVE_ADDRINFO': 1,
 'HAVE_ALARM': 1,
 'HAVE_ALIGNED_REQUIRED': 0,
 'HAVE_ALLOCA_H': 1,
 'HAVE_ALTZONE': 0,
 'HAVE_ASINH': 1,
 'HAVE_ASM_TYPES_H': 1,
 'HAVE_ATANH': 1,
 'HAVE_BIND_TEXTDOMAIN_CODESET': 1,
 'HAVE_BLUETOOTH_BLUETOOTH_H': 1,
 'HAVE_BLUETOOTH_H': 0,
 'HAVE_BROKEN_MBSTOWCS': 0,
 'HAVE_BROKEN_NICE': 0,
 'HAVE_BROKEN_PIPE_BUF': 0,
 'HAVE_BROKEN_POLL': 0,
 'HAVE_BROKEN_POSIX_SEMAPHORES': 0,
 'HAVE_BROKEN_PTHREAD_SIGMASK': 0,
 'HAVE_BROKEN_SEM_GETVALUE': 0,
 'HAVE_BROKEN_UNSETENV': 0,
 'HAVE_BUILTIN_ATOMIC': 1,
 'HAVE_CHFLAGS': 0,
 'HAVE_CHOWN': 1,
 'HAVE_CHROOT': 1,
 'HAVE_CLOCK': 1,
 'HAVE_CLOCK_GETRES': 1,
 'HAVE_CLOCK_GETTIME': 1,
 'HAVE_CLOCK_SETTIME': 1,
 'HAVE_COMPUTED_GOTOS': 1,
 'HAVE_CONFSTR': 1,
 'HAVE_CONIO_H': 0,
 'HAVE_COPYSIGN': 1,
 'HAVE_COPY_FILE_RANGE': 1,
 'HAVE_CRYPT_H': 1,
 'HAVE_CRYPT_R': 1,
 'HAVE_CTERMID': 1,
 'HAVE_CTERMID_R': 0,
 'HAVE_CURSES_FILTER': 1,
 'HAVE_CURSES_H': 1,
 'HAVE_CURSES_HAS_KEY': 1,
 'HAVE_CURSES_IMMEDOK': 1,
 'HAVE_CURSES_IS_PAD': 1,
 'HAVE_CURSES_IS_TERM_RESIZED': 1,
 'HAVE_CURSES_RESIZETERM': 1,
 'HAVE_CURSES_RESIZE_TERM': 1,
 'HAVE_CURSES_SYNCOK': 1,
 'HAVE_CURSES_TYPEAHEAD': 1,
 'HAVE_CURSES_USE_ENV': 1,
 'HAVE_CURSES_WCHGAT': 1,
 'HAVE_DECL_ISFINITE': 1,
 'HAVE_DECL_ISINF': 1,
 'HAVE_DECL_ISNAN': 1,
 'HAVE_DECL_RTLD_DEEPBIND': 1,
 'HAVE_DECL_RTLD_GLOBAL': 1,
 'HAVE_DECL_RTLD_LAZY': 1,
 'HAVE_DECL_RTLD_LOCAL': 1,
 'HAVE_DECL_RTLD_MEMBER': 0,
 'HAVE_DECL_RTLD_NODELETE': 1,
 'HAVE_DECL_RTLD_NOLOAD': 1,
 'HAVE_DECL_RTLD_NOW': 1,
 'HAVE_DECL_TZNAME': 0,
 'HAVE_DEVICE_MACROS': 1,
 'HAVE_DEV_PTC': 0,
 'HAVE_DEV_PTMX': 1,
 'HAVE_DIRECT_H': 0,
 'HAVE_DIRENT_D_TYPE': 1,
 'HAVE_DIRENT_H': 1,
 'HAVE_DIRFD': 1,
 'HAVE_DLFCN_H': 1,
 'HAVE_DLOPEN': 1,
 'HAVE_DUP2': 1,
 'HAVE_DUP3': 1,
 'HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH': 0,
 'HAVE_DYNAMIC_LOADING': 1,
 'HAVE_ENDIAN_H': 1,
 'HAVE_EPOLL': 1,
 'HAVE_EPOLL_CREATE1': 1,
 'HAVE_ERF': 1,
 'HAVE_ERFC': 1,
 'HAVE_ERRNO_H': 1,
 'HAVE_EXECV': 1,
 'HAVE_EXPLICIT_BZERO': 1,
 'HAVE_EXPLICIT_MEMSET': 0,
 'HAVE_EXPM1': 1,
 'HAVE_FACCESSAT': 1,
 'HAVE_FCHDIR': 1,
 'HAVE_FCHMOD': 1,
 'HAVE_FCHMODAT': 1,
 'HAVE_FCHOWN': 1,
 'HAVE_FCHOWNAT': 1,
 'HAVE_FCNTL_H': 1,
 'HAVE_FDATASYNC': 1,
 'HAVE_FDOPENDIR': 1,
 'HAVE_FDWALK': 0,
 'HAVE_FEXECVE': 1,
 'HAVE_FINITE': 1,
 'HAVE_FLOCK': 1,
 'HAVE_FORK': 1,
 'HAVE_FORKPTY': 1,
 'HAVE_FPATHCONF': 1,
 'HAVE_FSEEK64': 0,
 'HAVE_FSEEKO': 1,
 'HAVE_FSTATAT': 1,
 'HAVE_FSTATVFS': 1,
 'HAVE_FSYNC': 1,
 'HAVE_FTELL64': 0,
 'HAVE_FTELLO': 1,
 'HAVE_FTIME': 1,
 'HAVE_FTRUNCATE': 1,
 'HAVE_FUTIMENS': 1,
 'HAVE_FUTIMES': 1,
 'HAVE_FUTIMESAT': 1,
 'HAVE_GAI_STRERROR': 1,
 'HAVE_GAMMA': 1,
 'HAVE_GCC_ASM_FOR_MC68881': 0,
 'HAVE_GCC_ASM_FOR_X64': 1,
 'HAVE_GCC_ASM_FOR_X87': 1,
 'HAVE_GCC_UINT128_T': 1,
 'HAVE_GETADDRINFO': 1,
 'HAVE_GETC_UNLOCKED': 1,
 'HAVE_GETENTROPY': 1,
 'HAVE_GETGRGID_R': 1,
 'HAVE_GETGRNAM_R': 1,
 'HAVE_GETGROUPLIST': 1,
 'HAVE_GETGROUPS': 1,
 'HAVE_GETHOSTBYNAME': 0,
 'HAVE_GETHOSTBYNAME_R': 1,
 'HAVE_GETHOSTBYNAME_R_3_ARG': 0,
 'HAVE_GETHOSTBYNAME_R_5_ARG': 0,
 'HAVE_GETHOSTBYNAME_R_6_ARG': 1,
 'HAVE_GETITIMER': 1,
 'HAVE_GETLOADAVG': 1,
 'HAVE_GETLOGIN': 1,
 'HAVE_GETNAMEINFO': 1,
 'HAVE_GETPAGESIZE': 1,
 'HAVE_GETPEERNAME': 1,
 'HAVE_GETPGID': 1,
 'HAVE_GETPGRP': 1,
 'HAVE_GETPID': 1,
 'HAVE_GETPRIORITY': 1,
 'HAVE_GETPWENT': 1,
 'HAVE_GETPWNAM_R': 1,
 'HAVE_GETPWUID_R': 1,
 'HAVE_GETRANDOM': 1,
 'HAVE_GETRANDOM_SYSCALL': 1,
 'HAVE_GETRESGID': 1,
 'HAVE_GETRESUID': 1,
 'HAVE_GETSID': 1,
 'HAVE_GETSPENT': 1,
 'HAVE_GETSPNAM': 1,
 'HAVE_GETTIMEOFDAY': 1,
 'HAVE_GETWD': 1,
 'HAVE_GLIBC_MEMMOVE_BUG': 0,
 'HAVE_GRP_H': 1,
 'HAVE_HSTRERROR': 1,
 'HAVE_HTOLE64': 1,
 'HAVE_HYPOT': 1,
 'HAVE_IEEEFP_H': 0,
 'HAVE_IF_NAMEINDEX': 1,
 'HAVE_INET_ATON': 1,
 'HAVE_INET_PTON': 1,
 'HAVE_INITGROUPS': 1,
 'HAVE_INTTYPES_H': 1,
 'HAVE_IO_H': 0,
 'HAVE_IPA_PURE_CONST_BUG': 0,
 'HAVE_KILL': 1,
 'HAVE_KILLPG': 1,
 'HAVE_KQUEUE': 0,
 'HAVE_LANGINFO_H': 1,
 'HAVE_LARGEFILE_SUPPORT': 0,
 'HAVE_LCHFLAGS': 0,
 'HAVE_LCHMOD': 0,
 'HAVE_LCHOWN': 1,
 'HAVE_LGAMMA': 1,
 'HAVE_LIBDL': 1,
 'HAVE_LIBDLD': 0,
 'HAVE_LIBIEEE': 0,
 'HAVE_LIBINTL_H': 1,
 'HAVE_LIBREADLINE': 1,
 'HAVE_LIBRESOLV': 0,
 'HAVE_LIBSENDFILE': 0,
 'HAVE_LIBUTIL_H': 0,
 'HAVE_LINK': 1,
 'HAVE_LINKAT': 1,
 'HAVE_LINUX_CAN_BCM_H': 1,
 'HAVE_LINUX_CAN_H': 1,
 'HAVE_LINUX_CAN_RAW_FD_FRAMES': 1,
 'HAVE_LINUX_CAN_RAW_H': 1,
 'HAVE_LINUX_MEMFD_H': 1,
 'HAVE_LINUX_NETLINK_H': 1,
 'HAVE_LINUX_QRTR_H': 1,
 'HAVE_LINUX_RANDOM_H': 1,
 'HAVE_LINUX_TIPC_H': 1,
 'HAVE_LINUX_VM_SOCKETS_H': 1,
 'HAVE_LOCKF': 1,
 'HAVE_LOG1P': 1,
 'HAVE_LOG2': 1,
 'HAVE_LONG_DOUBLE': 1,
 'HAVE_LSTAT': 1,
 'HAVE_LUTIMES': 1,
 'HAVE_MADVISE': 1,
 'HAVE_MAKEDEV': 1,
 'HAVE_MBRTOWC': 1,
 'HAVE_MEMFD_CREATE': 1,
 'HAVE_MEMORY_H': 1,
 'HAVE_MEMRCHR': 1,
 'HAVE_MKDIRAT': 1,
 'HAVE_MKFIFO': 1,
 'HAVE_MKFIFOAT': 1,
 'HAVE_MKNOD': 1,
 'HAVE_MKNODAT': 1,
 'HAVE_MKTIME': 1,
 'HAVE_MMAP': 1,
 'HAVE_MREMAP': 1,
 'HAVE_NCURSES_H': 1,
 'HAVE_NDIR_H': 0,
 'HAVE_NETPACKET_PACKET_H': 1,
 'HAVE_NET_IF_H': 1,
 'HAVE_NICE': 1,
 'HAVE_OPENAT': 1,
 'HAVE_OPENPTY': 1,
 'HAVE_PATHCONF': 1,
 'HAVE_PAUSE': 1,
 'HAVE_PIPE2': 1,
 'HAVE_PLOCK': 0,
 'HAVE_POLL': 1,
 'HAVE_POLL_H': 1,
 'HAVE_POSIX_FADVISE': 1,
 'HAVE_POSIX_FALLOCATE': 1,
 'HAVE_POSIX_SPAWN': 1,
 'HAVE_POSIX_SPAWNP': 1,
 'HAVE_PREAD': 1,
 'HAVE_PREADV': 1,
 'HAVE_PREADV2': 1,
 'HAVE_PRLIMIT': 1,
 'HAVE_PROCESS_H': 0,
 'HAVE_PROTOTYPES': 1,
 'HAVE_PTHREAD_CONDATTR_SETCLOCK': 1,
 'HAVE_PTHREAD_DESTRUCTOR': 0,
 'HAVE_PTHREAD_GETCPUCLOCKID': 1,
 'HAVE_PTHREAD_H': 1,
 'HAVE_PTHREAD_INIT': 0,
 'HAVE_PTHREAD_KILL': 1,
 'HAVE_PTHREAD_SIGMASK': 1,
 'HAVE_PTY_H': 1,
 'HAVE_PUTENV': 1,
 'HAVE_PWRITE': 1,
 'HAVE_PWRITEV': 1,
 'HAVE_PWRITEV2': 1,
 'HAVE_READLINK': 1,
 'HAVE_READLINKAT': 1,
 'HAVE_READV': 1,
 'HAVE_REALPATH': 1,
 'HAVE_RENAMEAT': 1,
 'HAVE_RL_APPEND_HISTORY': 1,
 'HAVE_RL_CATCH_SIGNAL': 1,
 'HAVE_RL_COMPLETION_APPEND_CHARACTER': 1,
 'HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK': 1,
 'HAVE_RL_COMPLETION_MATCHES': 1,
 'HAVE_RL_COMPLETION_SUPPRESS_APPEND': 1,
 'HAVE_RL_PRE_INPUT_HOOK': 1,
 'HAVE_RL_RESIZE_TERMINAL': 1,
 'HAVE_ROUND': 1,
 'HAVE_RTPSPAWN': 0,
 'HAVE_SCHED_GET_PRIORITY_MAX': 1,
 'HAVE_SCHED_H': 1,
 'HAVE_SCHED_RR_GET_INTERVAL': 1,
 'HAVE_SCHED_SETAFFINITY': 1,
 'HAVE_SCHED_SETPARAM': 1,
 'HAVE_SCHED_SETSCHEDULER': 1,
 'HAVE_SEM_GETVALUE': 1,
 'HAVE_SEM_OPEN': 1,
 'HAVE_SEM_TIMEDWAIT': 1,
 'HAVE_SEM_UNLINK': 1,
 'HAVE_SENDFILE': 1,
 'HAVE_SETEGID': 1,
 'HAVE_SETEUID': 1,
 'HAVE_SETGID': 1,
 'HAVE_SETGROUPS': 1,
 'HAVE_SETHOSTNAME': 1,
 'HAVE_SETITIMER': 1,
 'HAVE_SETLOCALE': 1,
 'HAVE_SETPGID': 1,
 'HAVE_SETPGRP': 1,
 'HAVE_SETPRIORITY': 1,
 'HAVE_SETREGID': 1,
 'HAVE_SETRESGID': 1,
 'HAVE_SETRESUID': 1,
 'HAVE_SETREUID': 1,
 'HAVE_SETSID': 1,
 'HAVE_SETUID': 1,
 'HAVE_SETVBUF': 1,
 'HAVE_SHADOW_H': 1,
 'HAVE_SHM_OPEN': 1,
 'HAVE_SHM_UNLINK': 1,
 'HAVE_SIGACTION': 1,
 'HAVE_SIGALTSTACK': 1,
 'HAVE_SIGFILLSET': 1,
 'HAVE_SIGINFO_T_SI_BAND': 1,
 'HAVE_SIGINTERRUPT': 1,
 'HAVE_SIGNAL_H': 1,
 'HAVE_SIGPENDING': 1,
 'HAVE_SIGRELSE': 1,
 'HAVE_SIGTIMEDWAIT': 1,
 'HAVE_SIGWAIT': 1,
 'HAVE_SIGWAITINFO': 1,
 'HAVE_SNPRINTF': 1,
 'HAVE_SOCKADDR_ALG': 1,
 'HAVE_SOCKADDR_SA_LEN': 0,
 'HAVE_SOCKADDR_STORAGE': 1,
 'HAVE_SOCKETPAIR': 1,
 'HAVE_SPAWN_H': 1,
 'HAVE_SSIZE_T': 1,
 'HAVE_STATVFS': 1,
 'HAVE_STAT_TV_NSEC': 1,
 'HAVE_STAT_TV_NSEC2': 0,
 'HAVE_STDARG_PROTOTYPES': 1,
 'HAVE_STDINT_H': 1,
 'HAVE_STDLIB_H': 1,
 'HAVE_STD_ATOMIC': 1,
 'HAVE_STRDUP': 1,
 'HAVE_STRFTIME': 1,
 'HAVE_STRINGS_H': 1,
 'HAVE_STRING_H': 1,
 'HAVE_STRLCPY': 0,
 'HAVE_STROPTS_H': 0,
 'HAVE_STRSIGNAL': 1,
 'HAVE_STRUCT_PASSWD_PW_GECOS': 1,
 'HAVE_STRUCT_PASSWD_PW_PASSWD': 1,
 'HAVE_STRUCT_STAT_ST_BIRTHTIME': 0,
 'HAVE_STRUCT_STAT_ST_BLKSIZE': 1,
 'HAVE_STRUCT_STAT_ST_BLOCKS': 1,
 'HAVE_STRUCT_STAT_ST_FLAGS': 0,
 'HAVE_STRUCT_STAT_ST_GEN': 0,
 'HAVE_STRUCT_STAT_ST_RDEV': 1,
 'HAVE_STRUCT_TM_TM_ZONE': 1,
 'HAVE_SYMLINK': 1,
 'HAVE_SYMLINKAT': 1,
 'HAVE_SYNC': 1,
 'HAVE_SYSCONF': 1,
 'HAVE_SYSEXITS_H': 1,
 'HAVE_SYS_AUDIOIO_H': 0,
 'HAVE_SYS_BSDTTY_H': 0,
 'HAVE_SYS_DEVPOLL_H': 0,
 'HAVE_SYS_DIR_H': 0,
 'HAVE_SYS_ENDIAN_H': 0,
 'HAVE_SYS_EPOLL_H': 1,
 'HAVE_SYS_EVENT_H': 0,
 'HAVE_SYS_FILE_H': 1,
 'HAVE_SYS_IOCTL_H': 1,
 'HAVE_SYS_KERN_CONTROL_H': 0,
 'HAVE_SYS_LOADAVG_H': 0,
 'HAVE_SYS_LOCK_H': 0,
 'HAVE_SYS_MEMFD_H': 0,
 'HAVE_SYS_MKDEV_H': 0,
 'HAVE_SYS_MMAN_H': 1,
 'HAVE_SYS_MODEM_H': 0,
 'HAVE_SYS_NDIR_H': 0,
 'HAVE_SYS_PARAM_H': 1,
 'HAVE_SYS_POLL_H': 1,
 'HAVE_SYS_RANDOM_H': 1,
 'HAVE_SYS_RESOURCE_H': 1,
 'HAVE_SYS_SELECT_H': 1,
 'HAVE_SYS_SENDFILE_H': 1,
 'HAVE_SYS_SOCKET_H': 1,
 'HAVE_SYS_STATVFS_H': 1,
 'HAVE_SYS_STAT_H': 1,
 'HAVE_SYS_SYSCALL_H': 1,
 'HAVE_SYS_SYSMACROS_H': 1,
 'HAVE_SYS_SYS_DOMAIN_H': 0,
 'HAVE_SYS_TERMIO_H': 0,
 'HAVE_SYS_TIMES_H': 1,
 'HAVE_SYS_TIME_H': 1,
 'HAVE_SYS_TYPES_H': 1,
 'HAVE_SYS_UIO_H': 1,
 'HAVE_SYS_UN_H': 1,
 'HAVE_SYS_UTSNAME_H': 1,
 'HAVE_SYS_WAIT_H': 1,
 'HAVE_SYS_XATTR_H': 1,
 'HAVE_TCGETPGRP': 1,
 'HAVE_TCSETPGRP': 1,
 'HAVE_TEMPNAM': 1,
 'HAVE_TERMIOS_H': 1,
 'HAVE_TERM_H': 1,
 'HAVE_TGAMMA': 1,
 'HAVE_TIMEGM': 1,
 'HAVE_TIMES': 1,
 'HAVE_TMPFILE': 1,
 'HAVE_TMPNAM': 1,
 'HAVE_TMPNAM_R': 1,
 'HAVE_TM_ZONE': 1,
 'HAVE_TRUNCATE': 1,
 'HAVE_TZNAME': 0,
 'HAVE_UCS4_TCL': 0,
 'HAVE_UNAME': 1,
 'HAVE_UNISTD_H': 1,
 'HAVE_UNLINKAT': 1,
 'HAVE_UNSETENV': 1,
 'HAVE_USABLE_WCHAR_T': 0,
 'HAVE_UTIL_H': 0,
 'HAVE_UTIMENSAT': 1,
 'HAVE_UTIMES': 1,
 'HAVE_UTIME_H': 1,
 'HAVE_UUID_CREATE': 0,
 'HAVE_UUID_ENC_BE': 0,
 'HAVE_UUID_GENERATE_TIME_SAFE': 1,
 'HAVE_UUID_H': 0,
 'HAVE_UUID_UUID_H': 1,
 'HAVE_WAIT3': 1,
 'HAVE_WAIT4': 1,
 'HAVE_WAITID': 1,
 'HAVE_WAITPID': 1,
 'HAVE_WCHAR_H': 1,
 'HAVE_WCSCOLL': 1,
 'HAVE_WCSFTIME': 1,
 'HAVE_WCSXFRM': 1,
 'HAVE_WMEMCMP': 1,
 'HAVE_WORKING_TZSET': 1,
 'HAVE_WRITEV': 1,
 'HAVE_X509_VERIFY_PARAM_SET1_HOST': 1,
 'HAVE_ZLIB_COPY': 1,
 'HAVE__GETPTY': 0,
 'HOST_GNU_TYPE': 'x86_64-redhat-linux-gnu',
 'INCLDIRSTOMAKE': '/usr/include /usr/include /usr/include/python3.8d '
                   '/usr/include/python3.8d',
 'INCLUDEDIR': '/usr/include',
 'INCLUDEPY': '/usr/include/python3.8d',
 'INSTALL': '/usr/bin/install -c',
 'INSTALL_DATA': '/usr/bin/install -c -m 644',
 'INSTALL_PROGRAM': '/usr/bin/install -c',
 'INSTALL_SCRIPT': '/usr/bin/install -c',
 'INSTALL_SHARED': '/usr/bin/install -c -m 755',
 'INSTSONAME': 'libpython3.8d.so.1.0',
 'IO_H': 'Modules/_io/_iomodule.h',
 'IO_OBJS': '\\',
 'LDCXXSHARED': 'g++ -pthread -shared',
 'LDFLAGS': '-Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -g',
 'LDLIBRARY': 'libpython3.8d.so',
 'LDLIBRARYDIR': '',
 'LDSHARED': 'gcc -pthread -shared -Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  '
             '-Wl,-z,now  -g',
 'LDVERSION': '3.8d',
 'LIBC': '',
 'LIBDEST': '/usr/lib64/python3.8',
 'LIBDIR': '/usr/lib64',
 'LIBFFI_INCLUDEDIR': '',
 'LIBM': '-lm',
 'LIBOBJDIR': 'Python/',
 'LIBOBJS': '',
 'LIBPC': '/usr/lib64/pkgconfig',
 'LIBPL': '/usr/lib64/python3.8/config-3.8d-x86_64-linux-gnu',
 'LIBPYTHON': '',
 'LIBRARY': 'libpython3.8d.a',
 'LIBRARY_OBJS': '\\',
 'LIBRARY_OBJS_OMIT_FROZEN': '\\',
 'LIBS': '-lcrypt -lpthread -ldl  -lutil -lm',
 'LIBSUBDIRS': 'tkinter tkinter/test tkinter/test/test_tkinter \\',
 'LINKCC': 'gcc',
 'LINKFORSHARED': '-Xlinker -export-dynamic',
 'LIPO_32BIT_FLAGS': '',
 'LIPO_INTEL64_FLAGS': '',
 'LLVM_PROF_ERR': 'no',
 'LLVM_PROF_FILE': '',
 'LLVM_PROF_MERGER': 'true',
 'LN': 'ln',
 'LOCALMODLIBS': '',
 'MACHDEP': 'linux',
 'MACHDEP_OBJS': '',
 'MACHDESTLIB': '/usr/lib64/python3.8',
 'MACOSX_DEPLOYMENT_TARGET': '',
 'MAINCC': 'gcc -pthread',
 'MAJOR_IN_MKDEV': 0,
 'MAJOR_IN_SYSMACROS': 1,
 'MAKESETUP': '/builddir/build/BUILD/Python-3.8.17/Modules/makesetup',
 'MANDIR': '/usr/share/man',
 'MKDIR_P': '/usr/bin/mkdir -p',
 'MODBUILT_NAMES': 'posix  errno  pwd  _sre  _codecs  _weakref  _functools  '
                   '_operator  _collections  _abc  itertools  atexit  _signal  '
                   '_stat  time  _thread  _locale  _io  faulthandler  '
                   '_tracemalloc  _symtable  xxsubtype',
 'MODDISABLED_NAMES': '',
 'MODLIBS': '',
 'MODOBJS': 'Modules/posixmodule.o  Modules/errnomodule.o  '
            'Modules/pwdmodule.o  Modules/_sre.o  Modules/_codecsmodule.o  '
            'Modules/_weakref.o  Modules/_functoolsmodule.o  '
            'Modules/_operator.o  Modules/_collectionsmodule.o  '
            'Modules/_abc.o  Modules/itertoolsmodule.o  '
            'Modules/atexitmodule.o  Modules/signalmodule.o  Modules/_stat.o  '
            'Modules/timemodule.o  Modules/_threadmodule.o  '
            'Modules/_localemodule.o  Modules/_iomodule.o Modules/iobase.o '
            'Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o '
            'Modules/textio.o Modules/stringio.o  Modules/faulthandler.o  '
            'Modules/_tracemalloc.o Modules/hashtable.o  '
            'Modules/symtablemodule.o  Modules/xxsubtype.o',
 'MODULE_OBJS': '\\',
 'MULTIARCH': 'x86_64-linux-gnu',
 'MULTIARCH_CPPFLAGS': '-DMULTIARCH=\\"x86_64-linux-gnu\\"',
 'MVWDELCH_IS_EXPRESSION': 1,
 'NO_AS_NEEDED': '-Wl,--no-as-needed',
 'OBJECT_OBJS': '\\',
 'OPENSSL_INCLUDES': '',
 'OPENSSL_LDFLAGS': '',
 'OPENSSL_LIBS': '-lssl -lcrypto',
 'OPT': '-DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall '
        '-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 '
        '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong '
        '-grecord-gcc-switches   -m64 -mtune=generic '
        '-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection '
        '-D_GNU_SOURCE -fPIC -fwrapv',
 'OTHER_LIBTOOL_OPT': '',
 'PACKAGE_BUGREPORT': 0,
 'PACKAGE_NAME': 0,
 'PACKAGE_STRING': 0,
 'PACKAGE_TARNAME': 0,
 'PACKAGE_URL': 0,
 'PACKAGE_VERSION': 0,
 'PARSER_HEADERS': '\\',
 'PARSER_OBJS': '\\ Parser/myreadline.o Parser/parsetok.o Parser/tokenizer.o',
 'PGO_PROF_GEN_FLAG': '-fprofile-generate',
 'PGO_PROF_USE_FLAG': '-fprofile-use -fprofile-correction',
 'POBJS': '\\',
 'POSIX_SEMAPHORES_NOT_ENABLED': 0,
 'PROFILE_TASK': '-m test --pgo',
 'PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT': 1,
 'PTHREAD_SYSTEM_SCHED_SUPPORTED': 1,
 'PY3LIBRARY': '',
 'PYLONG_BITS_IN_DIGIT': 0,
 'PYTHON': 'python',
 'PYTHONFRAMEWORK': '',
 'PYTHONFRAMEWORKDIR': 'no-framework',
 'PYTHONFRAMEWORKINSTALLDIR': '',
 'PYTHONFRAMEWORKPREFIX': '',
 'PYTHONPATH': '',
 'PYTHON_FOR_BUILD': './python -E',
 'PYTHON_FOR_REGEN': 'python3.8',
 'PYTHON_HEADERS': '\\',
 'PYTHON_OBJS': '\\',
 'PY_BUILTIN_MODULE_CFLAGS': '-Wno-unused-result -Wsign-compare '
                             '-DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe '
                             '-Wall -Werror=format-security '
                             '-Wp,-D_FORTIFY_SOURCE=2 '
                             '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions '
                             '-fstack-protector-strong -grecord-gcc-switches   '
                             '-m64 -mtune=generic -fasynchronous-unwind-tables '
                             '-fstack-clash-protection -fcf-protection '
                             '-D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall '
                             '-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 '
                             '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions '
                             '-fstack-protector-strong -grecord-gcc-switches   '
                             '-m64 -mtune=generic -fasynchronous-unwind-tables '
                             '-fstack-clash-protection -fcf-protection '
                             '-D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall '
                             '-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 '
                             '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions '
                             '-fstack-protector-strong -grecord-gcc-switches   '
                             '-m64 -mtune=generic -fasynchronous-unwind-tables '
                             '-fstack-clash-protection -fcf-protection '
                             '-D_GNU_SOURCE -fPIC -fwrapv  -Og -O2 -g -pipe '
                             '-Wall -Werror=format-security '
                             '-Wp,-D_FORTIFY_SOURCE=2 '
                             '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions '
                             '-fstack-protector-strong -grecord-gcc-switches '
                             '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 '
                             '-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 '
                             '-m64 -mtune=generic -fasynchronous-unwind-tables '
                             '-fstack-clash-protection -fcf-protection '
                             '-D_GNU_SOURCE -fPIC -fwrapv '
                             '-fno-semantic-interposition -flto '
                             '-fuse-linker-plugin -ffat-lto-objects '
                             '-flto-partition=none -g -std=c99 -Wextra '
                             '-Wno-unused-result -Wno-unused-parameter '
                             '-Wno-missing-field-initializers '
                             '-Werror=implicit-function-declaration -O2 -g '
                             '-pipe -Wall -Werror=format-security '
                             '-Wp,-D_FORTIFY_SOURCE=2 '
                             '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions '
                             '-fstack-protector-strong -grecord-gcc-switches '
                             '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 '
                             '-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 '
                             '-m64 -mtune=generic -fasynchronous-unwind-tables '
                             '-fstack-clash-protection -fcf-protection '
                             '-D_GNU_SOURCE -fPIC -fwrapv '
                             '-fno-semantic-interposition -Og '
                             '-I/builddir/build/BUILD/Python-3.8.17/Include/internal '
                             '-IObjects -IInclude -IPython -I. '
                             '-I/builddir/build/BUILD/Python-3.8.17/Include '
                             '-fPIC -DPy_BUILD_CORE_BUILTIN',
 'PY_CFLAGS': '-Wno-unused-result -Wsign-compare '
              '-DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall '
              '-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 '
              '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong '
              '-grecord-gcc-switches   -m64 -mtune=generic '
              '-fasynchronous-unwind-tables -fstack-clash-protection '
              '-fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall '
              '-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 '
              '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong '
              '-grecord-gcc-switches   -m64 -mtune=generic '
              '-fasynchronous-unwind-tables -fstack-clash-protection '
              '-fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall '
              '-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 '
              '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong '
              '-grecord-gcc-switches   -m64 -mtune=generic '
              '-fasynchronous-unwind-tables -fstack-clash-protection '
              '-fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -Og',
 'PY_CFLAGS_NODIST': '-O2 -g -pipe -Wall -Werror=format-security '
                     '-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS '
                     '-fexceptions -fstack-protector-strong '
                     '-grecord-gcc-switches '
                     '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 '
                     '-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 '
                     '-mtune=generic -fasynchronous-unwind-tables '
                     '-fstack-clash-protection -fcf-protection -D_GNU_SOURCE '
                     '-fPIC -fwrapv -fno-semantic-interposition -flto '
                     '-fuse-linker-plugin -ffat-lto-objects '
                     '-flto-partition=none -g -std=c99 -Wextra '
                     '-Wno-unused-result -Wno-unused-parameter '
                     '-Wno-missing-field-initializers '
                     '-Werror=implicit-function-declaration -O2 -g -pipe -Wall '
                     '-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 '
                     '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions '
                     '-fstack-protector-strong -grecord-gcc-switches '
                     '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 '
                     '-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 '
                     '-mtune=generic -fasynchronous-unwind-tables '
                     '-fstack-clash-protection -fcf-protection -D_GNU_SOURCE '
                     '-fPIC -fwrapv -fno-semantic-interposition -Og '
                     '-I/builddir/build/BUILD/Python-3.8.17/Include/internal',
 'PY_COERCE_C_LOCALE': 1,
 'PY_CORE_CFLAGS': '-Wno-unused-result -Wsign-compare '
                   '-DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall '
                   '-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 '
                   '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions '
                   '-fstack-protector-strong -grecord-gcc-switches   -m64 '
                   '-mtune=generic -fasynchronous-unwind-tables '
                   '-fstack-clash-protection -fcf-protection -D_GNU_SOURCE '
                   '-fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security '
                   '-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS '
                   '-fexceptions -fstack-protector-strong '
                   '-grecord-gcc-switches   -m64 -mtune=generic '
                   '-fasynchronous-unwind-tables -fstack-clash-protection '
                   '-fcf-protection -D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe '
                   '-Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 '
                   '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions '
                   '-fstack-protector-strong -grecord-gcc-switches   -m64 '
                   '-mtune=generic -fasynchronous-unwind-tables '
                   '-fstack-clash-protection -fcf-protection -D_GNU_SOURCE '
                   '-fPIC -fwrapv  -Og -O2 -g -pipe -Wall '
                   '-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 '
                   '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions '
                   '-fstack-protector-strong -grecord-gcc-switches '
                   '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 '
                   '-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 '
                   '-mtune=generic -fasynchronous-unwind-tables '
                   '-fstack-clash-protection -fcf-protection -D_GNU_SOURCE '
                   '-fPIC -fwrapv -fno-semantic-interposition -flto '
                   '-fuse-linker-plugin -ffat-lto-objects -flto-partition=none '
                   '-g -std=c99 -Wextra -Wno-unused-result '
                   '-Wno-unused-parameter -Wno-missing-field-initializers '
                   '-Werror=implicit-function-declaration -O2 -g -pipe -Wall '
                   '-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 '
                   '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions '
                   '-fstack-protector-strong -grecord-gcc-switches '
                   '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 '
                   '-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 '
                   '-mtune=generic -fasynchronous-unwind-tables '
                   '-fstack-clash-protection -fcf-protection -D_GNU_SOURCE '
                   '-fPIC -fwrapv -fno-semantic-interposition -Og '
                   '-I/builddir/build/BUILD/Python-3.8.17/Include/internal '
                   '-IObjects -IInclude -IPython -I. '
                   '-I/builddir/build/BUILD/Python-3.8.17/Include -fPIC '
                   '-DPy_BUILD_CORE',
 'PY_CORE_LDFLAGS': '-Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  '
                    '-g -Wl,-z,relro  -Wl,-z,now '
                    '-specs=/usr/lib/rpm/redhat/redhat-hardened-ld '
                    '-fno-semantic-interposition -g  -flto -fuse-linker-plugin '
                    '-ffat-lto-objects -flto-partition=none -g -Wl,-z,relro  '
                    '-Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '
                    '-fno-semantic-interposition -g -lcrypto',
 'PY_CPPFLAGS': '-IObjects -IInclude -IPython -I. '
                '-I/builddir/build/BUILD/Python-3.8.17/Include',
 'PY_FORMAT_SIZE_T': '"z"',
 'PY_LDFLAGS': '-Wl,-z,relro  -Wl,-z,now  -g  -Wl,-z,relro  -Wl,-z,now  -g',
 'PY_LDFLAGS_NODIST': '-Wl,-z,relro  -Wl,-z,now '
                      '-specs=/usr/lib/rpm/redhat/redhat-hardened-ld '
                      '-fno-semantic-interposition -g  -flto '
                      '-fuse-linker-plugin -ffat-lto-objects '
                      '-flto-partition=none -g -Wl,-z,relro  -Wl,-z,now '
                      '-specs=/usr/lib/rpm/redhat/redhat-hardened-ld '
                      '-fno-semantic-interposition -g',
 'PY_SSL_DEFAULT_CIPHERS': 2,
 'PY_SSL_DEFAULT_CIPHER_STRING': 0,
 'PY_STDMODULE_CFLAGS': '-Wno-unused-result -Wsign-compare '
                        '-DDYNAMIC_ANNOTATIONS_ENABLED=1  -O2 -g -pipe -Wall '
                        '-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 '
                        '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions '
                        '-fstack-protector-strong -grecord-gcc-switches   -m64 '
                        '-mtune=generic -fasynchronous-unwind-tables '
                        '-fstack-clash-protection -fcf-protection '
                        '-D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall '
                        '-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 '
                        '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions '
                        '-fstack-protector-strong -grecord-gcc-switches   -m64 '
                        '-mtune=generic -fasynchronous-unwind-tables '
                        '-fstack-clash-protection -fcf-protection '
                        '-D_GNU_SOURCE -fPIC -fwrapv  -O2 -g -pipe -Wall '
                        '-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 '
                        '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions '
                        '-fstack-protector-strong -grecord-gcc-switches   -m64 '
                        '-mtune=generic -fasynchronous-unwind-tables '
                        '-fstack-clash-protection -fcf-protection '
                        '-D_GNU_SOURCE -fPIC -fwrapv  -Og -O2 -g -pipe -Wall '
                        '-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 '
                        '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions '
                        '-fstack-protector-strong -grecord-gcc-switches '
                        '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 '
                        '-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 '
                        '-mtune=generic -fasynchronous-unwind-tables '
                        '-fstack-clash-protection -fcf-protection '
                        '-D_GNU_SOURCE -fPIC -fwrapv '
                        '-fno-semantic-interposition -flto -fuse-linker-plugin '
                        '-ffat-lto-objects -flto-partition=none -g -std=c99 '
                        '-Wextra -Wno-unused-result -Wno-unused-parameter '
                        '-Wno-missing-field-initializers '
                        '-Werror=implicit-function-declaration -O2 -g -pipe '
                        '-Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 '
                        '-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions '
                        '-fstack-protector-strong -grecord-gcc-switches '
                        '-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 '
                        '-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 '
                        '-mtune=generic -fasynchronous-unwind-tables '
                        '-fstack-clash-protection -fcf-protection '
                        '-D_GNU_SOURCE -fPIC -fwrapv '
                        '-fno-semantic-interposition -Og '
                        '-I/builddir/build/BUILD/Python-3.8.17/Include/internal '
                        '-IObjects -IInclude -IPython -I. '
                        '-I/builddir/build/BUILD/Python-3.8.17/Include -fPIC',
 'Py_DEBUG': 1,
 'Py_ENABLE_SHARED': 1,
 'Py_HASH_ALGORITHM': 0,
 'Py_TRACE_REFS': 0,
 'QUICKTESTOPTS': '-x test_subprocess test_io test_lib2to3 \\',
 'READELF': 'readelf',
 'RESSRCDIR': 'Mac/Resources/framework',
 'RETSIGTYPE': 'void',
 'RUNSHARED': 'LD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/debug',
 'SCRIPTDIR': '/usr/lib64',
 'SETPGRP_HAVE_ARG': 0,
 'SGI_ABI': '@SGI_ABI@',
 'SHELL': '/bin/sh',
 'SHLIBS': '-lcrypt -lpthread -ldl  -lutil -lm',
 'SHLIB_SUFFIX': '.so',
 'SHM_NEEDS_LIBRT': 1,
 'SIGNED_RIGHT_SHIFT_ZERO_FILLS': 0,
 'SITEPATH': '',
 'SIZEOF_DOUBLE': 8,
 'SIZEOF_FLOAT': 4,
 'SIZEOF_FPOS_T': 16,
 'SIZEOF_INT': 4,
 'SIZEOF_LONG': 8,
 'SIZEOF_LONG_DOUBLE': 16,
 'SIZEOF_LONG_LONG': 8,
 'SIZEOF_OFF_T': 8,
 'SIZEOF_PID_T': 4,
 'SIZEOF_PTHREAD_KEY_T': 4,
 'SIZEOF_PTHREAD_T': 8,
 'SIZEOF_SHORT': 2,
 'SIZEOF_SIZE_T': 8,
 'SIZEOF_TIME_T': 8,
 'SIZEOF_UINTPTR_T': 8,
 'SIZEOF_VOID_P': 8,
 'SIZEOF_WCHAR_T': 4,
 'SIZEOF__BOOL': 1,
 'SOABI': 'cpython-38d-x86_64-linux-gnu',
 'SRCDIRS': 'Parser Objects Python Modules Modules/_io Programs',
 'SRC_GDB_HOOKS': '/builddir/build/BUILD/Python-3.8.17/Tools/gdb/libpython.py',
 'STDC_HEADERS': 1,
 'STRICT_SYSV_CURSES': "/* Don't use ncurses extensions */",
 'STRIPFLAG': '-s',
 'SUBDIRS': '',
 'SUBDIRSTOO': 'Include Lib Misc',
 'SYSLIBS': '-lm',
 'SYS_SELECT_WITH_SYS_TIME': 1,
 'TCLTK_INCLUDES': '',
 'TCLTK_LIBS': '',
 'TESTOPTS': '',
 'TESTPATH': '',
 'TESTPYTHON': 'LD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/debug '
               './python',
 'TESTPYTHONOPTS': '',
 'TESTRUNNER': 'LD_LIBRARY_PATH=/builddir/build/BUILD/Python-3.8.17/build/debug '
               './python '
               '/builddir/build/BUILD/Python-3.8.17/Tools/scripts/run_tests.py',
 'TESTTIMEOUT': 1200,
 'TIMEMODULE_LIB': 0,
 'TIME_WITH_SYS_TIME': 1,
 'TM_IN_SYS_TIME': 0,
 'UNICODE_DEPS': '\\',
 'UNIVERSALSDK': '',
 'UPDATE_FILE': 'python3.8 '
                '/builddir/build/BUILD/Python-3.8.17/Tools/scripts/update_file.py',
 'USE_COMPUTED_GOTOS': 1,
 'VERSION': '3.8',
 'VPATH': '/builddir/build/BUILD/Python-3.8.17',
 'WINDOW_HAS_FLAGS': 1,
 'WITH_DECIMAL_CONTEXTVAR': 1,
 'WITH_DOC_STRINGS': 1,
 'WITH_DTRACE': 1,
 'WITH_DYLD': 0,
 'WITH_LIBINTL': 0,
 'WITH_NEXT_FRAMEWORK': 0,
 'WITH_PYMALLOC': 1,
 'WITH_VALGRIND': 1,
 'X87_DOUBLE_ROUNDING': 0,
 'XMLLIBSUBDIRS': 'xml xml/dom xml/etree xml/parsers xml/sax',
 'abs_builddir': '/builddir/build/BUILD/Python-3.8.17/build/debug',
 'abs_srcdir': '/builddir/build/BUILD/Python-3.8.17',
 'datarootdir': '/usr/share',
 'exec_prefix': '/usr',
 'prefix': '/usr',
 'srcdir': '/builddir/build/BUILD/Python-3.8.17'}
abc.py000064400000010611151153537630005653 0ustar00# Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.

"""Abstract Base Classes (ABCs) according to PEP 3119."""


def abstractmethod(funcobj):
    """A decorator indicating abstract methods.

    Requires that the metaclass is ABCMeta or derived from it.  A
    class that has a metaclass derived from ABCMeta cannot be
    instantiated unless all of its abstract methods are overridden.
    The abstract methods can be called using any of the normal
    'super' call mechanisms.  abstractmethod() may be used to declare
    abstract methods for properties and descriptors.

    Usage:

        class C(metaclass=ABCMeta):
            @abstractmethod
            def my_abstract_method(self, ...):
                ...
    """
    funcobj.__isabstractmethod__ = True
    return funcobj


class abstractclassmethod(classmethod):
    """A decorator indicating abstract classmethods.

    Deprecated, use 'classmethod' with 'abstractmethod' instead.
    """

    __isabstractmethod__ = True

    def __init__(self, callable):
        callable.__isabstractmethod__ = True
        super().__init__(callable)


class abstractstaticmethod(staticmethod):
    """A decorator indicating abstract staticmethods.

    Deprecated, use 'staticmethod' with 'abstractmethod' instead.
    """

    __isabstractmethod__ = True

    def __init__(self, callable):
        callable.__isabstractmethod__ = True
        super().__init__(callable)


class abstractproperty(property):
    """A decorator indicating abstract properties.

    Deprecated, use 'property' with 'abstractmethod' instead.
    """

    __isabstractmethod__ = True


try:
    from _abc import (get_cache_token, _abc_init, _abc_register,
                      _abc_instancecheck, _abc_subclasscheck, _get_dump,
                      _reset_registry, _reset_caches)
except ImportError:
    from _py_abc import ABCMeta, get_cache_token
    ABCMeta.__module__ = 'abc'
else:
    class ABCMeta(type):
        """Metaclass for defining Abstract Base Classes (ABCs).

        Use this metaclass to create an ABC.  An ABC can be subclassed
        directly, and then acts as a mix-in class.  You can also register
        unrelated concrete classes (even built-in classes) and unrelated
        ABCs as 'virtual subclasses' -- these and their descendants will
        be considered subclasses of the registering ABC by the built-in
        issubclass() function, but the registering ABC won't show up in
        their MRO (Method Resolution Order) nor will method
        implementations defined by the registering ABC be callable (not
        even via super()).
        """
        def __new__(mcls, name, bases, namespace, **kwargs):
            cls = super().__new__(mcls, name, bases, namespace, **kwargs)
            _abc_init(cls)
            return cls

        def register(cls, subclass):
            """Register a virtual subclass of an ABC.

            Returns the subclass, to allow usage as a class decorator.
            """
            return _abc_register(cls, subclass)

        def __instancecheck__(cls, instance):
            """Override for isinstance(instance, cls)."""
            return _abc_instancecheck(cls, instance)

        def __subclasscheck__(cls, subclass):
            """Override for issubclass(subclass, cls)."""
            return _abc_subclasscheck(cls, subclass)

        def _dump_registry(cls, file=None):
            """Debug helper to print the ABC registry."""
            print(f"Class: {cls.__module__}.{cls.__qualname__}", file=file)
            print(f"Inv. counter: {get_cache_token()}", file=file)
            (_abc_registry, _abc_cache, _abc_negative_cache,
             _abc_negative_cache_version) = _get_dump(cls)
            print(f"_abc_registry: {_abc_registry!r}", file=file)
            print(f"_abc_cache: {_abc_cache!r}", file=file)
            print(f"_abc_negative_cache: {_abc_negative_cache!r}", file=file)
            print(f"_abc_negative_cache_version: {_abc_negative_cache_version!r}",
                  file=file)

        def _abc_registry_clear(cls):
            """Clear the registry (for debugging or testing)."""
            _reset_registry(cls)

        def _abc_caches_clear(cls):
            """Clear the caches (for debugging or testing)."""
            _reset_caches(cls)


class ABC(metaclass=ABCMeta):
    """Helper class that provides a standard way to create an ABC using
    inheritance.
    """
    __slots__ = ()
decimal.py000064400000000500151153537630006520 0ustar00
try:
    from _decimal import *
    from _decimal import __doc__
    from _decimal import __version__
    from _decimal import __libmpdec_version__
except ImportError:
    from _pydecimal import *
    from _pydecimal import __doc__
    from _pydecimal import __version__
    from _pydecimal import __libmpdec_version__
turtledemo/lindenmayer.py000075500000004601151153537630011626 0ustar00#! /usr/bin/python3.8
"""       turtle-example-suite:

        xtx_lindenmayer_indian.py

Each morning women in Tamil Nadu, in southern
India, place designs, created by using rice
flour and known as kolam on the thresholds of
their homes.

These can be described by Lindenmayer systems,
which can easily be implemented with turtle
graphics and Python.

Two examples are shown here:
(1) the snake kolam
(2) anklets of Krishna

Taken from Marcia Ascher: Mathematics
Elsewhere, An Exploration of Ideas Across
Cultures

"""
################################
# Mini Lindenmayer tool
###############################

from turtle import *

def replace( seq, replacementRules, n ):
    for i in range(n):
        newseq = ""
        for element in seq:
            newseq = newseq + replacementRules.get(element,element)
        seq = newseq
    return seq

def draw( commands, rules ):
    for b in commands:
        try:
            rules[b]()
        except TypeError:
            try:
                draw(rules[b], rules)
            except:
                pass


def main():
    ################################
    # Example 1: Snake kolam
    ################################


    def r():
        right(45)

    def l():
        left(45)

    def f():
        forward(7.5)

    snake_rules = {"-":r, "+":l, "f":f, "b":"f+f+f--f--f+f+f"}
    snake_replacementRules = {"b": "b+f+b--f--b+f+b"}
    snake_start = "b--f--b--f"

    drawing = replace(snake_start, snake_replacementRules, 3)

    reset()
    speed(3)
    tracer(1,0)
    ht()
    up()
    backward(195)
    down()
    draw(drawing, snake_rules)

    from time import sleep
    sleep(3)

    ################################
    # Example 2: Anklets of Krishna
    ################################

    def A():
        color("red")
        circle(10,90)

    def B():
        from math import sqrt
        color("black")
        l = 5/sqrt(2)
        forward(l)
        circle(l, 270)
        forward(l)

    def F():
        color("green")
        forward(10)

    krishna_rules = {"a":A, "b":B, "f":F}
    krishna_replacementRules = {"a" : "afbfa", "b" : "afbfbfbfa" }
    krishna_start = "fbfbfbfb"

    reset()
    speed(0)
    tracer(3,0)
    ht()
    left(45)
    drawing = replace(krishna_start, krishna_replacementRules, 3)
    draw(drawing, krishna_rules)
    tracer(1)
    return "Done!"

if __name__=='__main__':
    msg = main()
    print(msg)
    mainloop()
turtledemo/__main__.py000064400000033641151153537630011042 0ustar00
"""
  ----------------------------------------------
      turtleDemo - Help
  ----------------------------------------------

  This document has two sections:

  (1) How to use the demo viewer
  (2) How to add your own demos to the demo repository


  (1) How to use the demo viewer.

  Select a demoscript from the example menu.
  The (syntax colored) source code appears in the left
  source code window. IT CANNOT BE EDITED, but ONLY VIEWED!

  The demo viewer windows can be resized. The divider between text
  and canvas can be moved by grabbing it with the mouse. The text font
  size can be changed from the menu and with Control/Command '-'/'+'.
  It can also be changed on most systems with Control-mousewheel
  when the mouse is over the text.

  Press START button to start the demo.
  Stop execution by pressing the STOP button.
  Clear screen by pressing the CLEAR button.
  Restart by pressing the START button again.

  SPECIAL demos, such as clock.py are those which run EVENTDRIVEN.

      Press START button to start the demo.

      - Until the EVENTLOOP is entered everything works
      as in an ordinary demo script.

      - When the EVENTLOOP is entered, you control the
      application by using the mouse and/or keys (or it's
      controlled by some timer events)
      To stop it you can and must press the STOP button.

      While the EVENTLOOP is running, the examples menu is disabled.

      - Only after having pressed the STOP button, you may
      restart it or choose another example script.

   * * * * * * * *
   In some rare situations there may occur interferences/conflicts
   between events concerning the demo script and those concerning the
   demo-viewer. (They run in the same process.) Strange behaviour may be
   the consequence and in the worst case you must close and restart the
   viewer.
   * * * * * * * *


   (2) How to add your own demos to the demo repository

   - Place the file in the same directory as turtledemo/__main__.py
     IMPORTANT! When imported, the demo should not modify the system
     by calling functions in other modules, such as sys, tkinter, or
     turtle. Global variables should be initialized in main().

   - The code must contain a main() function which will
     be executed by the viewer (see provided example scripts).
     It may return a string which will be displayed in the Label below
     the source code window (when execution has finished.)

   - In order to run mydemo.py by itself, such as during development,
     add the following at the end of the file:

    if __name__ == '__main__':
        main()
        mainloop()  # keep window open

    python -m turtledemo.mydemo  # will then run it

   - If the demo is EVENT DRIVEN, main must return the string
     "EVENTLOOP". This informs the demo viewer that the script is
     still running and must be stopped by the user!

     If an "EVENTLOOP" demo runs by itself, as with clock, which uses
     ontimer, or minimal_hanoi, which loops by recursion, then the
     code should catch the turtle.Terminator exception that will be
     raised when the user presses the STOP button.  (Paint is not such
     a demo; it only acts in response to mouse clicks and movements.)
"""
import sys
import os

from tkinter import *
from idlelib.colorizer import ColorDelegator, color_config
from idlelib.percolator import Percolator
from idlelib.textview import view_text
from turtledemo import __doc__ as about_turtledemo

import turtle

demo_dir = os.path.dirname(os.path.abspath(__file__))
darwin = sys.platform == 'darwin'

STARTUP = 1
READY = 2
RUNNING = 3
DONE = 4
EVENTDRIVEN = 5

menufont = ("Arial", 12, NORMAL)
btnfont = ("Arial", 12, 'bold')
txtfont = ['Lucida Console', 10, 'normal']

MINIMUM_FONT_SIZE = 6
MAXIMUM_FONT_SIZE = 100
font_sizes = [8, 9, 10, 11, 12, 14, 18, 20, 22, 24, 30]

def getExampleEntries():
    return [entry[:-3] for entry in os.listdir(demo_dir) if
            entry.endswith(".py") and entry[0] != '_']

help_entries = (  # (help_label,  help_doc)
    ('Turtledemo help', __doc__),
    ('About turtledemo', about_turtledemo),
    ('About turtle module', turtle.__doc__),
    )



class DemoWindow(object):

    def __init__(self, filename=None):
        self.root = root = turtle._root = Tk()
        root.title('Python turtle-graphics examples')
        root.wm_protocol("WM_DELETE_WINDOW", self._destroy)

        if darwin:
            import subprocess
            # Make sure we are the currently activated OS X application
            # so that our menu bar appears.
            subprocess.run(
                    [
                        'osascript',
                        '-e', 'tell application "System Events"',
                        '-e', 'set frontmost of the first process whose '
                              'unix id is {} to true'.format(os.getpid()),
                        '-e', 'end tell',
                    ],
                    stderr=subprocess.DEVNULL,
                    stdout=subprocess.DEVNULL,)

        root.grid_rowconfigure(0, weight=1)
        root.grid_columnconfigure(0, weight=1)
        root.grid_columnconfigure(1, minsize=90, weight=1)
        root.grid_columnconfigure(2, minsize=90, weight=1)
        root.grid_columnconfigure(3, minsize=90, weight=1)

        self.mBar = Menu(root, relief=RAISED, borderwidth=2)
        self.mBar.add_cascade(menu=self.makeLoadDemoMenu(self.mBar),
                              label='Examples', underline=0)
        self.mBar.add_cascade(menu=self.makeFontMenu(self.mBar),
                              label='Fontsize', underline=0)
        self.mBar.add_cascade(menu=self.makeHelpMenu(self.mBar),
                              label='Help', underline=0)
        root['menu'] = self.mBar

        pane = PanedWindow(orient=HORIZONTAL, sashwidth=5,
                           sashrelief=SOLID, bg='#ddd')
        pane.add(self.makeTextFrame(pane))
        pane.add(self.makeGraphFrame(pane))
        pane.grid(row=0, columnspan=4, sticky='news')

        self.output_lbl = Label(root, height= 1, text=" --- ", bg="#ddf",
                                font=("Arial", 16, 'normal'), borderwidth=2,
                                relief=RIDGE)
        self.start_btn = Button(root, text=" START ", font=btnfont,
                                fg="white", disabledforeground = "#fed",
                                command=self.startDemo)
        self.stop_btn = Button(root, text=" STOP ", font=btnfont,
                               fg="white", disabledforeground = "#fed",
                               command=self.stopIt)
        self.clear_btn = Button(root, text=" CLEAR ", font=btnfont,
                                fg="white", disabledforeground="#fed",
                                command = self.clearCanvas)
        self.output_lbl.grid(row=1, column=0, sticky='news', padx=(0,5))
        self.start_btn.grid(row=1, column=1, sticky='ew')
        self.stop_btn.grid(row=1, column=2, sticky='ew')
        self.clear_btn.grid(row=1, column=3, sticky='ew')

        Percolator(self.text).insertfilter(ColorDelegator())
        self.dirty = False
        self.exitflag = False
        if filename:
            self.loadfile(filename)
        self.configGUI(DISABLED, DISABLED, DISABLED,
                       "Choose example from menu", "black")
        self.state = STARTUP


    def onResize(self, event):
        cwidth = self._canvas.winfo_width()
        cheight = self._canvas.winfo_height()
        self._canvas.xview_moveto(0.5*(self.canvwidth-cwidth)/self.canvwidth)
        self._canvas.yview_moveto(0.5*(self.canvheight-cheight)/self.canvheight)

    def makeTextFrame(self, root):
        self.text_frame = text_frame = Frame(root)
        self.text = text = Text(text_frame, name='text', padx=5,
                                wrap='none', width=45)
        color_config(text)

        self.vbar = vbar = Scrollbar(text_frame, name='vbar')
        vbar['command'] = text.yview
        vbar.pack(side=LEFT, fill=Y)
        self.hbar = hbar = Scrollbar(text_frame, name='hbar', orient=HORIZONTAL)
        hbar['command'] = text.xview
        hbar.pack(side=BOTTOM, fill=X)
        text['yscrollcommand'] = vbar.set
        text['xscrollcommand'] = hbar.set

        text['font'] = tuple(txtfont)
        shortcut = 'Command' if darwin else 'Control'
        text.bind_all('<%s-minus>' % shortcut, self.decrease_size)
        text.bind_all('<%s-underscore>' % shortcut, self.decrease_size)
        text.bind_all('<%s-equal>' % shortcut, self.increase_size)
        text.bind_all('<%s-plus>' % shortcut, self.increase_size)
        text.bind('<Control-MouseWheel>', self.update_mousewheel)
        text.bind('<Control-Button-4>', self.increase_size)
        text.bind('<Control-Button-5>', self.decrease_size)

        text.pack(side=LEFT, fill=BOTH, expand=1)
        return text_frame

    def makeGraphFrame(self, root):
        turtle._Screen._root = root
        self.canvwidth = 1000
        self.canvheight = 800
        turtle._Screen._canvas = self._canvas = canvas = turtle.ScrolledCanvas(
                root, 800, 600, self.canvwidth, self.canvheight)
        canvas.adjustScrolls()
        canvas._rootwindow.bind('<Configure>', self.onResize)
        canvas._canvas['borderwidth'] = 0

        self.screen = _s_ = turtle.Screen()
        turtle.TurtleScreen.__init__(_s_, _s_._canvas)
        self.scanvas = _s_._canvas
        turtle.RawTurtle.screens = [_s_]
        return canvas

    def set_txtsize(self, size):
        txtfont[1] = size
        self.text['font'] = tuple(txtfont)
        self.output_lbl['text'] = 'Font size %d' % size

    def decrease_size(self, dummy=None):
        self.set_txtsize(max(txtfont[1] - 1, MINIMUM_FONT_SIZE))
        return 'break'

    def increase_size(self, dummy=None):
        self.set_txtsize(min(txtfont[1] + 1, MAXIMUM_FONT_SIZE))
        return 'break'

    def update_mousewheel(self, event):
        # For wheel up, event.delta = 120 on Windows, -1 on darwin.
        # X-11 sends Control-Button-4 event instead.
        if (event.delta < 0) == (not darwin):
            return self.decrease_size()
        else:
            return self.increase_size()

    def configGUI(self, start, stop, clear, txt="", color="blue"):
        self.start_btn.config(state=start,
                              bg="#d00" if start == NORMAL else "#fca")
        self.stop_btn.config(state=stop,
                             bg="#d00" if stop == NORMAL else "#fca")
        self.clear_btn.config(state=clear,
                              bg="#d00" if clear == NORMAL else "#fca")
        self.output_lbl.config(text=txt, fg=color)

    def makeLoadDemoMenu(self, master):
        menu = Menu(master)

        for entry in getExampleEntries():
            def load(entry=entry):
                self.loadfile(entry)
            menu.add_command(label=entry, underline=0,
                             font=menufont, command=load)
        return menu

    def makeFontMenu(self, master):
        menu = Menu(master)
        menu.add_command(label="Decrease (C-'-')", command=self.decrease_size,
                         font=menufont)
        menu.add_command(label="Increase (C-'+')", command=self.increase_size,
                         font=menufont)
        menu.add_separator()

        for size in font_sizes:
            def resize(size=size):
                self.set_txtsize(size)
            menu.add_command(label=str(size), underline=0,
                             font=menufont, command=resize)
        return menu

    def makeHelpMenu(self, master):
        menu = Menu(master)

        for help_label, help_file in help_entries:
            def show(help_label=help_label, help_file=help_file):
                view_text(self.root, help_label, help_file)
            menu.add_command(label=help_label, font=menufont, command=show)
        return menu

    def refreshCanvas(self):
        if self.dirty:
            self.screen.clear()
            self.dirty=False

    def loadfile(self, filename):
        self.clearCanvas()
        turtle.TurtleScreen._RUNNING = False
        modname = 'turtledemo.' + filename
        __import__(modname)
        self.module = sys.modules[modname]
        with open(self.module.__file__, 'r') as f:
            chars = f.read()
        self.text.delete("1.0", "end")
        self.text.insert("1.0", chars)
        self.root.title(filename + " - a Python turtle graphics example")
        self.configGUI(NORMAL, DISABLED, DISABLED,
                       "Press start button", "red")
        self.state = READY

    def startDemo(self):
        self.refreshCanvas()
        self.dirty = True
        turtle.TurtleScreen._RUNNING = True
        self.configGUI(DISABLED, NORMAL, DISABLED,
                       "demo running...", "black")
        self.screen.clear()
        self.screen.mode("standard")
        self.state = RUNNING

        try:
            result = self.module.main()
            if result == "EVENTLOOP":
                self.state = EVENTDRIVEN
            else:
                self.state = DONE
        except turtle.Terminator:
            if self.root is None:
                return
            self.state = DONE
            result = "stopped!"
        if self.state == DONE:
            self.configGUI(NORMAL, DISABLED, NORMAL,
                           result)
        elif self.state == EVENTDRIVEN:
            self.exitflag = True
            self.configGUI(DISABLED, NORMAL, DISABLED,
                           "use mouse/keys or STOP", "red")

    def clearCanvas(self):
        self.refreshCanvas()
        self.screen._delete("all")
        self.scanvas.config(cursor="")
        self.configGUI(NORMAL, DISABLED, DISABLED)

    def stopIt(self):
        if self.exitflag:
            self.clearCanvas()
            self.exitflag = False
            self.configGUI(NORMAL, DISABLED, DISABLED,
                           "STOPPED!", "red")
        turtle.TurtleScreen._RUNNING = False

    def _destroy(self):
        turtle.TurtleScreen._RUNNING = False
        self.root.destroy()
        self.root = None


def main():
    demo = DemoWindow()
    demo.root.mainloop()

if __name__ == '__main__':
    main()
turtledemo/__init__.py000064400000000472151153537630011055 0ustar00"""
    --------------------------------------
        About this viewer
    --------------------------------------

    Tiny demo viewer to view turtle graphics example scripts.

    Quickly and dirtyly assembled by Gregor Lingl.
    June, 2006

    For more information see: turtledemo - Help

    Have fun!
"""
turtledemo/nim.py000064400000014561151153537630010105 0ustar00"""      turtle-example-suite:

            tdemo_nim.py

Play nim against the computer. The player
who takes the last stick is the winner.

Implements the model-view-controller
design pattern.
"""


import turtle
import random
import time

SCREENWIDTH = 640
SCREENHEIGHT = 480

MINSTICKS = 7
MAXSTICKS = 31

HUNIT = SCREENHEIGHT // 12
WUNIT = SCREENWIDTH // ((MAXSTICKS // 5) * 11 + (MAXSTICKS % 5) * 2)

SCOLOR = (63, 63, 31)
HCOLOR = (255, 204, 204)
COLOR = (204, 204, 255)

def randomrow():
    return random.randint(MINSTICKS, MAXSTICKS)

def computerzug(state):
    xored = state[0] ^ state[1] ^ state[2]
    if xored == 0:
        return randommove(state)
    for z in range(3):
        s = state[z] ^ xored
        if s <= state[z]:
            move = (z, s)
            return move

def randommove(state):
    m = max(state)
    while True:
        z = random.randint(0,2)
        if state[z] > (m > 1):
            break
    rand = random.randint(m > 1, state[z]-1)
    return z, rand


class NimModel(object):
    def __init__(self, game):
        self.game = game

    def setup(self):
        if self.game.state not in [Nim.CREATED, Nim.OVER]:
            return
        self.sticks = [randomrow(), randomrow(), randomrow()]
        self.player = 0
        self.winner = None
        self.game.view.setup()
        self.game.state = Nim.RUNNING

    def move(self, row, col):
        maxspalte = self.sticks[row]
        self.sticks[row] = col
        self.game.view.notify_move(row, col, maxspalte, self.player)
        if self.game_over():
            self.game.state = Nim.OVER
            self.winner = self.player
            self.game.view.notify_over()
        elif self.player == 0:
            self.player = 1
            row, col = computerzug(self.sticks)
            self.move(row, col)
            self.player = 0

    def game_over(self):
        return self.sticks == [0, 0, 0]

    def notify_move(self, row, col):
        if self.sticks[row] <= col:
            return
        self.move(row, col)


class Stick(turtle.Turtle):
    def __init__(self, row, col, game):
        turtle.Turtle.__init__(self, visible=False)
        self.row = row
        self.col = col
        self.game = game
        x, y = self.coords(row, col)
        self.shape("square")
        self.shapesize(HUNIT/10.0, WUNIT/20.0)
        self.speed(0)
        self.pu()
        self.goto(x,y)
        self.color("white")
        self.showturtle()

    def coords(self, row, col):
        packet, remainder = divmod(col, 5)
        x = (3 + 11 * packet + 2 * remainder) * WUNIT
        y = (2 + 3 * row) * HUNIT
        return x - SCREENWIDTH // 2 + WUNIT // 2, SCREENHEIGHT // 2 - y - HUNIT // 2

    def makemove(self, x, y):
        if self.game.state != Nim.RUNNING:
            return
        self.game.controller.notify_move(self.row, self.col)


class NimView(object):
    def __init__(self, game):
        self.game = game
        self.screen = game.screen
        self.model = game.model
        self.screen.colormode(255)
        self.screen.tracer(False)
        self.screen.bgcolor((240, 240, 255))
        self.writer = turtle.Turtle(visible=False)
        self.writer.pu()
        self.writer.speed(0)
        self.sticks = {}
        for row in range(3):
            for col in range(MAXSTICKS):
                self.sticks[(row, col)] = Stick(row, col, game)
        self.display("... a moment please ...")
        self.screen.tracer(True)

    def display(self, msg1, msg2=None):
        self.screen.tracer(False)
        self.writer.clear()
        if msg2 is not None:
            self.writer.goto(0, - SCREENHEIGHT // 2 + 48)
            self.writer.pencolor("red")
            self.writer.write(msg2, align="center", font=("Courier",18,"bold"))
        self.writer.goto(0, - SCREENHEIGHT // 2 + 20)
        self.writer.pencolor("black")
        self.writer.write(msg1, align="center", font=("Courier",14,"bold"))
        self.screen.tracer(True)

    def setup(self):
        self.screen.tracer(False)
        for row in range(3):
            for col in range(self.model.sticks[row]):
                self.sticks[(row, col)].color(SCOLOR)
        for row in range(3):
            for col in range(self.model.sticks[row], MAXSTICKS):
                self.sticks[(row, col)].color("white")
        self.display("Your turn! Click leftmost stick to remove.")
        self.screen.tracer(True)

    def notify_move(self, row, col, maxspalte, player):
        if player == 0:
            farbe = HCOLOR
            for s in range(col, maxspalte):
                self.sticks[(row, s)].color(farbe)
        else:
            self.display(" ... thinking ...         ")
            time.sleep(0.5)
            self.display(" ... thinking ... aaah ...")
            farbe = COLOR
            for s in range(maxspalte-1, col-1, -1):
                time.sleep(0.2)
                self.sticks[(row, s)].color(farbe)
            self.display("Your turn! Click leftmost stick to remove.")

    def notify_over(self):
        if self.game.model.winner == 0:
            msg2 = "Congrats. You're the winner!!!"
        else:
            msg2 = "Sorry, the computer is the winner."
        self.display("To play again press space bar. To leave press ESC.", msg2)

    def clear(self):
        if self.game.state == Nim.OVER:
            self.screen.clear()


class NimController(object):

    def __init__(self, game):
        self.game = game
        self.sticks = game.view.sticks
        self.BUSY = False
        for stick in self.sticks.values():
            stick.onclick(stick.makemove)
        self.game.screen.onkey(self.game.model.setup, "space")
        self.game.screen.onkey(self.game.view.clear, "Escape")
        self.game.view.display("Press space bar to start game")
        self.game.screen.listen()

    def notify_move(self, row, col):
        if self.BUSY:
            return
        self.BUSY = True
        self.game.model.notify_move(row, col)
        self.BUSY = False


class Nim(object):
    CREATED = 0
    RUNNING = 1
    OVER = 2
    def __init__(self, screen):
        self.state = Nim.CREATED
        self.screen = screen
        self.model = NimModel(self)
        self.view = NimView(self)
        self.controller = NimController(self)


def main():
    mainscreen = turtle.Screen()
    mainscreen.mode("standard")
    mainscreen.setup(SCREENWIDTH, SCREENHEIGHT)
    nim = Nim(mainscreen)
    return "EVENTLOOP"

if __name__ == "__main__":
    main()
    turtle.mainloop()
turtledemo/penrose.py000075500000006463151153537630011002 0ustar00#! /usr/bin/python3.8
"""       xturtle-example-suite:

          xtx_kites_and_darts.py

Constructs two aperiodic penrose-tilings,
consisting of kites and darts, by the method
of inflation in six steps.

Starting points are the patterns "sun"
consisting of five kites and "star"
consisting of five darts.

For more information see:
 http://en.wikipedia.org/wiki/Penrose_tiling
 -------------------------------------------
"""
from turtle import *
from math import cos, pi
from time import perf_counter as clock, sleep

f = (5**0.5-1)/2.0   # (sqrt(5)-1)/2 -- golden ratio
d = 2 * cos(3*pi/10)

def kite(l):
    fl = f * l
    lt(36)
    fd(l)
    rt(108)
    fd(fl)
    rt(36)
    fd(fl)
    rt(108)
    fd(l)
    rt(144)

def dart(l):
    fl = f * l
    lt(36)
    fd(l)
    rt(144)
    fd(fl)
    lt(36)
    fd(fl)
    rt(144)
    fd(l)
    rt(144)

def inflatekite(l, n):
    if n == 0:
        px, py = pos()
        h, x, y = int(heading()), round(px,3), round(py,3)
        tiledict[(h,x,y)] = True
        return
    fl = f * l
    lt(36)
    inflatedart(fl, n-1)
    fd(l)
    rt(144)
    inflatekite(fl, n-1)
    lt(18)
    fd(l*d)
    rt(162)
    inflatekite(fl, n-1)
    lt(36)
    fd(l)
    rt(180)
    inflatedart(fl, n-1)
    lt(36)

def inflatedart(l, n):
    if n == 0:
        px, py = pos()
        h, x, y = int(heading()), round(px,3), round(py,3)
        tiledict[(h,x,y)] = False
        return
    fl = f * l
    inflatekite(fl, n-1)
    lt(36)
    fd(l)
    rt(180)
    inflatedart(fl, n-1)
    lt(54)
    fd(l*d)
    rt(126)
    inflatedart(fl, n-1)
    fd(l)
    rt(144)

def draw(l, n, th=2):
    clear()
    l = l * f**n
    shapesize(l/100.0, l/100.0, th)
    for k in tiledict:
        h, x, y = k
        setpos(x, y)
        setheading(h)
        if tiledict[k]:
            shape("kite")
            color("black", (0, 0.75, 0))
        else:
            shape("dart")
            color("black", (0.75, 0, 0))
        stamp()

def sun(l, n):
    for i in range(5):
        inflatekite(l, n)
        lt(72)

def star(l,n):
    for i in range(5):
        inflatedart(l, n)
        lt(72)

def makeshapes():
    tracer(0)
    begin_poly()
    kite(100)
    end_poly()
    register_shape("kite", get_poly())
    begin_poly()
    dart(100)
    end_poly()
    register_shape("dart", get_poly())
    tracer(1)

def start():
    reset()
    ht()
    pu()
    makeshapes()
    resizemode("user")

def test(l=200, n=4, fun=sun, startpos=(0,0), th=2):
    global tiledict
    goto(startpos)
    setheading(0)
    tiledict = {}
    tracer(0)
    fun(l, n)
    draw(l, n, th)
    tracer(1)
    nk = len([x for x in tiledict if tiledict[x]])
    nd = len([x for x in tiledict if not tiledict[x]])
    print("%d kites and %d darts = %d pieces." % (nk, nd, nk+nd))

def demo(fun=sun):
    start()
    for i in range(8):
        a = clock()
        test(300, i, fun)
        b = clock()
        t = b - a
        if t < 2:
            sleep(2 - t)

def main():
    #title("Penrose-tiling with kites and darts.")
    mode("logo")
    bgcolor(0.3, 0.3, 0)
    demo(sun)
    sleep(2)
    demo(star)
    pencolor("black")
    goto(0,-200)
    pencolor(0.7,0.7,1)
    write("Please wait...",
          align="center", font=('Arial Black', 36, 'bold'))
    test(600, 8, startpos=(70, 117))
    return "Done"

if __name__ == "__main__":
    msg = main()
    mainloop()
turtledemo/turtle.cfg000064400000000240151153537630010735 0ustar00width = 800
height = 600
canvwidth = 1200
canvheight = 900
shape = arrow
mode = standard
resizemode = auto
fillcolor = ""
title = Python turtle graphics demo.

turtledemo/chaos.py000064400000001667151153537630010422 0ustar00# File: tdemo_chaos.py
# Author: Gregor Lingl
# Date: 2009-06-24

# A demonstration of chaos

from turtle import *

N = 80

def f(x):
    return 3.9*x*(1-x)

def g(x):
    return 3.9*(x-x**2)

def h(x):
    return 3.9*x-3.9*x*x

def jumpto(x, y):
    penup(); goto(x,y)

def line(x1, y1, x2, y2):
    jumpto(x1, y1)
    pendown()
    goto(x2, y2)

def coosys():
    line(-1, 0, N+1, 0)
    line(0, -0.1, 0, 1.1)

def plot(fun, start, color):
    pencolor(color)
    x = start
    jumpto(0, x)
    pendown()
    dot(5)
    for i in range(N):
        x=fun(x)
        goto(i+1,x)
        dot(5)

def main():
    reset()
    setworldcoordinates(-1.0,-0.1, N+1, 1.1)
    speed(0)
    hideturtle()
    coosys()
    plot(f, 0.35, "blue")
    plot(g, 0.35, "green")
    plot(h, 0.35, "red")
    # Now zoom in:
    for s in range(100):
        setworldcoordinates(0.5*s,-0.1, N+1, 1.1)
    return "Done!"

if __name__ == "__main__":
    main()
    mainloop()
turtledemo/round_dance.py000064400000003414151153537630011576 0ustar00"""      turtle-example-suite:

         tdemo_round_dance.py

(Needs version 1.1 of the turtle module that
comes with Python 3.1)

Dancing turtles have a compound shape
consisting of a series of triangles of
decreasing size.

Turtles march along a circle while rotating
pairwise in opposite direction, with one
exception. Does that breaking of symmetry
enhance the attractiveness of the example?

Press any key to stop the animation.

Technically: demonstrates use of compound
shapes, transformation of shapes as well as
cloning turtles. The animation is
controlled through update().
"""

from turtle import *

def stop():
    global running
    running = False

def main():
    global running
    clearscreen()
    bgcolor("gray10")
    tracer(False)
    shape("triangle")
    f =   0.793402
    phi = 9.064678
    s = 5
    c = 1
    # create compound shape
    sh = Shape("compound")
    for i in range(10):
        shapesize(s)
        p =get_shapepoly()
        s *= f
        c *= f
        tilt(-phi)
        sh.addcomponent(p, (c, 0.25, 1-c), "black")
    register_shape("multitri", sh)
    # create dancers
    shapesize(1)
    shape("multitri")
    pu()
    setpos(0, -200)
    dancers = []
    for i in range(180):
        fd(7)
        tilt(-4)
        lt(2)
        update()
        if i % 12 == 0:
            dancers.append(clone())
    home()
    # dance
    running = True
    onkeypress(stop)
    listen()
    cs = 1
    while running:
        ta = -4
        for dancer in dancers:
            dancer.fd(7)
            dancer.lt(2)
            dancer.tilt(ta)
            ta = -4 if ta > 0 else 2
        if cs < 180:
            right(4)
            shapesize(cs)
            cs *= 1.005
        update()
    return "DONE!"

if __name__=='__main__':
    print(main())
    mainloop()
turtledemo/colormixer.py000064400000002473151153537630011504 0ustar00# colormixer

from turtle import Screen, Turtle, mainloop

class ColorTurtle(Turtle):

    def __init__(self, x, y):
        Turtle.__init__(self)
        self.shape("turtle")
        self.resizemode("user")
        self.shapesize(3,3,5)
        self.pensize(10)
        self._color = [0,0,0]
        self.x = x
        self._color[x] = y
        self.color(self._color)
        self.speed(0)
        self.left(90)
        self.pu()
        self.goto(x,0)
        self.pd()
        self.sety(1)
        self.pu()
        self.sety(y)
        self.pencolor("gray25")
        self.ondrag(self.shift)

    def shift(self, x, y):
        self.sety(max(0,min(y,1)))
        self._color[self.x] = self.ycor()
        self.fillcolor(self._color)
        setbgcolor()

def setbgcolor():
    screen.bgcolor(red.ycor(), green.ycor(), blue.ycor())

def main():
    global screen, red, green, blue
    screen = Screen()
    screen.delay(0)
    screen.setworldcoordinates(-1, -0.3, 3, 1.3)

    red = ColorTurtle(0, .5)
    green = ColorTurtle(1, .5)
    blue = ColorTurtle(2, .5)
    setbgcolor()

    writer = Turtle()
    writer.ht()
    writer.pu()
    writer.goto(1,1.15)
    writer.write("DRAG!",align="center",font=("Arial",30,("bold","italic")))
    return "EVENTLOOP"

if __name__ == "__main__":
    msg = main()
    print(msg)
    mainloop()
turtledemo/tree.py000075500000002570151153537630010261 0ustar00#! /usr/bin/python3.8
"""      turtle-example-suite:

             tdemo_tree.py

Displays a 'breadth-first-tree' - in contrast
to the classical Logo tree drawing programs,
which use a depth-first-algorithm.

Uses:
(1) a tree-generator, where the drawing is
quasi the side-effect, whereas the generator
always yields None.
(2) Turtle-cloning: At each branching point
the current pen is cloned. So in the end
there are 1024 turtles.
"""
from turtle import Turtle, mainloop
from time import perf_counter as clock

def tree(plist, l, a, f):
    """ plist is list of pens
    l is length of branch
    a is half of the angle between 2 branches
    f is factor by which branch is shortened
    from level to level."""
    if l > 3:
        lst = []
        for p in plist:
            p.forward(l)
            q = p.clone()
            p.left(a)
            q.right(a)
            lst.append(p)
            lst.append(q)
        for x in tree(lst, l*f, a, f):
            yield None

def maketree():
    p = Turtle()
    p.setundobuffer(None)
    p.hideturtle()
    p.speed(0)
    p.getscreen().tracer(30,0)
    p.left(90)
    p.penup()
    p.forward(-210)
    p.pendown()
    t = tree([p], 200, 65, 0.6375)
    for x in t:
        pass

def main():
    a=clock()
    maketree()
    b=clock()
    return "done: %.2f sec." % (b-a)

if __name__ == "__main__":
    msg = main()
    print(msg)
    mainloop()
turtledemo/clock.py000075500000006200151153537630010407 0ustar00#! /usr/bin/python3.8
# -*- coding: cp1252 -*-
"""       turtle-example-suite:

             tdemo_clock.py

Enhanced clock-program, showing date
and time
  ------------------------------------
   Press STOP to exit the program!
  ------------------------------------
"""
from turtle import *
from datetime import datetime

def jump(distanz, winkel=0):
    penup()
    right(winkel)
    forward(distanz)
    left(winkel)
    pendown()

def hand(laenge, spitze):
    fd(laenge*1.15)
    rt(90)
    fd(spitze/2.0)
    lt(120)
    fd(spitze)
    lt(120)
    fd(spitze)
    lt(120)
    fd(spitze/2.0)

def make_hand_shape(name, laenge, spitze):
    reset()
    jump(-laenge*0.15)
    begin_poly()
    hand(laenge, spitze)
    end_poly()
    hand_form = get_poly()
    register_shape(name, hand_form)

def clockface(radius):
    reset()
    pensize(7)
    for i in range(60):
        jump(radius)
        if i % 5 == 0:
            fd(25)
            jump(-radius-25)
        else:
            dot(3)
            jump(-radius)
        rt(6)

def setup():
    global second_hand, minute_hand, hour_hand, writer
    mode("logo")
    make_hand_shape("second_hand", 125, 25)
    make_hand_shape("minute_hand",  130, 25)
    make_hand_shape("hour_hand", 90, 25)
    clockface(160)
    second_hand = Turtle()
    second_hand.shape("second_hand")
    second_hand.color("gray20", "gray80")
    minute_hand = Turtle()
    minute_hand.shape("minute_hand")
    minute_hand.color("blue1", "red1")
    hour_hand = Turtle()
    hour_hand.shape("hour_hand")
    hour_hand.color("blue3", "red3")
    for hand in second_hand, minute_hand, hour_hand:
        hand.resizemode("user")
        hand.shapesize(1, 1, 3)
        hand.speed(0)
    ht()
    writer = Turtle()
    #writer.mode("logo")
    writer.ht()
    writer.pu()
    writer.bk(85)

def wochentag(t):
    wochentag = ["Monday", "Tuesday", "Wednesday",
        "Thursday", "Friday", "Saturday", "Sunday"]
    return wochentag[t.weekday()]

def datum(z):
    monat = ["Jan.", "Feb.", "Mar.", "Apr.", "May", "June",
             "July", "Aug.", "Sep.", "Oct.", "Nov.", "Dec."]
    j = z.year
    m = monat[z.month - 1]
    t = z.day
    return "%s %d %d" % (m, t, j)

def tick():
    t = datetime.today()
    sekunde = t.second + t.microsecond*0.000001
    minute = t.minute + sekunde/60.0
    stunde = t.hour + minute/60.0
    try:
        tracer(False)  # Terminator can occur here
        writer.clear()
        writer.home()
        writer.forward(65)
        writer.write(wochentag(t),
                     align="center", font=("Courier", 14, "bold"))
        writer.back(150)
        writer.write(datum(t),
                     align="center", font=("Courier", 14, "bold"))
        writer.forward(85)
        tracer(True)
        second_hand.setheading(6*sekunde)  # or here
        minute_hand.setheading(6*minute)
        hour_hand.setheading(30*stunde)
        tracer(True)
        ontimer(tick, 100)
    except Terminator:
        pass  # turtledemo user pressed STOP

def main():
    tracer(False)
    setup()
    tracer(True)
    tick()
    return "EVENTLOOP"

if __name__ == "__main__":
    mode("logo")
    msg = main()
    print(msg)
    mainloop()
turtledemo/forest.py000075500000005625151153537630010630 0ustar00#! /usr/bin/python3.8
"""     turtlegraphics-example-suite:

             tdemo_forest.py

Displays a 'forest' of 3 breadth-first-trees
similar to the one in tree.
For further remarks see tree.py

This example is a 'breadth-first'-rewrite of
a Logo program written by Erich Neuwirth. See
http://homepage.univie.ac.at/erich.neuwirth/
"""
from turtle import Turtle, colormode, tracer, mainloop
from random import randrange
from time import perf_counter as clock

def symRandom(n):
    return randrange(-n,n+1)

def randomize( branchlist, angledist, sizedist ):
    return [ (angle+symRandom(angledist),
              sizefactor*1.01**symRandom(sizedist))
                     for angle, sizefactor in branchlist ]

def randomfd( t, distance, parts, angledist ):
    for i in range(parts):
        t.left(symRandom(angledist))
        t.forward( (1.0 * distance)/parts )

def tree(tlist, size, level, widthfactor, branchlists, angledist=10, sizedist=5):
    # benutzt Liste von turtles und Liste von Zweiglisten,
    # fuer jede turtle eine!
    if level > 0:
        lst = []
        brs = []
        for t, branchlist in list(zip(tlist,branchlists)):
            t.pensize( size * widthfactor )
            t.pencolor( 255 - (180 - 11 * level + symRandom(15)),
                        180 - 11 * level + symRandom(15),
                        0 )
            t.pendown()
            randomfd(t, size, level, angledist )
            yield 1
            for angle, sizefactor in branchlist:
                t.left(angle)
                lst.append(t.clone())
                brs.append(randomize(branchlist, angledist, sizedist))
                t.right(angle)
        for x in tree(lst, size*sizefactor, level-1, widthfactor, brs,
                      angledist, sizedist):
            yield None


def start(t,x,y):
    colormode(255)
    t.reset()
    t.speed(0)
    t.hideturtle()
    t.left(90)
    t.penup()
    t.setpos(x,y)
    t.pendown()

def doit1(level, pen):
    pen.hideturtle()
    start(pen, 20, -208)
    t = tree( [pen], 80, level, 0.1, [[ (45,0.69), (0,0.65), (-45,0.71) ]] )
    return t

def doit2(level, pen):
    pen.hideturtle()
    start(pen, -135, -130)
    t = tree( [pen], 120, level, 0.1, [[ (45,0.69), (-45,0.71) ]] )
    return t

def doit3(level, pen):
    pen.hideturtle()
    start(pen, 190, -90)
    t = tree( [pen], 100, level, 0.1, [[ (45,0.7), (0,0.72), (-45,0.65) ]] )
    return t

# Hier 3 Baumgeneratoren:
def main():
    p = Turtle()
    p.ht()
    tracer(75,0)
    u = doit1(6, Turtle(undobuffersize=1))
    s = doit2(7, Turtle(undobuffersize=1))
    t = doit3(5, Turtle(undobuffersize=1))
    a = clock()
    while True:
        done = 0
        for b in u,s,t:
            try:
                b.__next__()
            except:
                done += 1
        if done == 3:
            break

    tracer(1,10)
    b = clock()
    return "runtime: %.2f sec." % (b-a)

if __name__ == '__main__':
    main()
    mainloop()
turtledemo/__pycache__/chaos.cpython-38.pyc000064400000003262151153537630014701 0ustar00U

e5d��@sdddlTdZdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�Z	e
dkr`e	�e�dS)�)�*�PcCsd|d|S)N�333333@����xrr�(/usr/lib64/python3.8/turtledemo/chaos.py�fsr
cCsd||dS)Nr�rrrrr	�gsrcCsd|d||S)Nrrrrrr	�hsr
cCst�t||�dS�N)Zpenup�goto)r�yrrr	�jumptosrcCst||�t�t||�dSr)r�pendownr)Zx1Zy1Zx2Zy2rrr	�lines
rcCs$tddtdd�tdddd�dS)N���rr皙������皙�����?)r�Nrrrr	�coosyssrcCsTt|�|}td|�t�td�tt�D]"}||�}t|d|�td�q,dS)Nr�r)Zpencolorrr�dot�rangerr)Zfun�startZcolorr�irrr	�plot s
rcCsxt�tddtdd�td�t�t�ttdd�ttdd�tt	dd	�t
d
�D]}td|dtdd�qXdS)
Ng�rrrrgffffff�?ZblueZgreenZred�dg�?zDone!)�resetZsetworldcoordinatesrZspeedZ
hideturtlerrr
rr
r)�srrr	�main+sr"�__main__N)Zturtlerr
rr
rrrrr"�__name__Zmainlooprrrr	�<module>sturtledemo/__pycache__/tree.cpython-38.opt-2.pyc000064400000002156151153537630015504 0ustar00U

e5dx�@sTddlmZmZddlmZdd�Zdd�Zdd�Ze	d	krPe�Z
ee
�e�d
S)�)�Turtle�mainloop)�perf_counterccsr|dkrng}|D]>}|�|�|��}|�|�|�|�|�|�|�|�qt|||||�D]
}dVqbdS)N�)�forwardZclone�left�right�append�tree)Zplist�l�a�fZlst�p�q�x�r�'/usr/lib64/python3.8/turtledemo/tree.pyr
s



r
cCstt�}|�d�|��|�d�|���dd�|�d�|��|�d�|�	�t
|gddd�}|D]}qjdS)Nr��Zi.������Agffffff�?)rZ
setundobufferZ
hideturtleZspeedZ	getscreenZtracerrZpenuprZpendownr
)r�trrrr�maketree's



rcCst�}t�t�}d||S)Nzdone: %.2f sec.)�clockr)r�brrr�main5sr�__main__N)Zturtlerr�timerrr
rr�__name__�msg�printrrrr�<module>sturtledemo/__pycache__/clock.cpython-38.opt-1.pyc000064400000006645151153537630015646 0ustar00U

e5d��@s�dZddlTddlmZddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�Zedkr�e
d�e�Zee�e�dS)z�       turtle-example-suite:

             tdemo_clock.py

Enhanced clock-program, showing date
and time
  ------------------------------------
   Press STOP to exit the program!
  ------------------------------------
�)�*)�datetimecCs(t�t|�t|�t|�t�dS)N)Zpenup�right�forward�leftZpendown)ZdistanzZwinkel�r�(/usr/lib64/python3.8/turtledemo/clock.py�jumps
r	cCsXt|d�td�t|d�td�t|�td�t|�td�t|d�dS)Ngffffff�?�Zg@�x)�fd�rt�lt)�laenge�spitzerrr�handsrcCs>t�t|d�t�t||�t�t�}t||�dS)Ng333333�?)�resetr	Z
begin_polyrZend_polyZget_polyZregister_shape)�namerrZ	hand_formrrr�make_hand_shape"s
rcCsft�td�td�D]J}t|�|ddkrFtd�t|d�ntd�t|�td�qdS)N��<�r���)rZpensize�ranger	r�dotr
)Zradius�irrr�	clockface+s
rcCs�td�tddd�tddd�tddd�td	�t�at�d�t�d
d�t�at�d�t�dd
�t�at�d�t�dd�tttfD]&}|�	d�|�
ddd�|�d�q�t�t�a
t
��t
��t
�d�dS)N�logo�second_hand�}r�minute_hand��	hour_handr
�Zgray20Zgray80Zblue1Zred1Zblue3Zred3�user�rr�U)�moderrZTurtler �shapeZcolorr"r$Z
resizemodeZ	shapesizeZspeedZht�writerZpuZbk)rrrr�setup8s.



r,cCsdddddddg}||��S)NZMondayZTuesdayZ	WednesdayZThursdayZFridayZSaturdayZSunday)Zweekday)�t�	wochentagrrrr.Ss�r.cCsDddddddddd	d
ddg}|j}||jd
}|j}d|||fS)NzJan.zFeb.zMar.zApr.ZMayZJuneZJulyzAug.zSep.zOct.zNov.zDec.r'z%s %d %d)ZyearZmonthZday)�zZmonat�j�mr-rrr�datumXs�r2cCs�t��}|j|jd}|j|d}|j|d}z�td�t��t�	�t�
d�tjt|�ddd�t�
d�tjt|�ddd�t�
d	�td
�t�d|�t�d|�t�d|�td
�ttd
�Wntk
r�YnXdS)Ng���ư>gN@F�A�center)ZCourier�Zbold)ZalignZfont�r(Tr��d)rZtoday�secondZmicrosecond�minuteZhour�tracerr+�clear�homer�writer.Zbackr2r Z
setheadingr"r$Zontimer�tickZ
Terminator)r-Zsekunder:Zstunderrrr?`s6

�

�
r?cCs td�t�td�t�dS)NFTZ	EVENTLOOP)r;r,r?rrrr�mainys
r@�__main__rN)r)�__doc__Zturtlerr	rrrr,r.r2r?r@�__name__r)�msg�printZmainlooprrrr�<module>s 

	
turtledemo/__pycache__/lindenmayer.cpython-38.pyc000064400000005376151153537630016123 0ustar00U

e5d�	�@sDdZddlTdd�Zdd�Zdd�Zed	kr@e�Zee�e�d
S)a�       turtle-example-suite:

        xtx_lindenmayer_indian.py

Each morning women in Tamil Nadu, in southern
India, place designs, created by using rice
flour and known as kolam on the thresholds of
their homes.

These can be described by Lindenmayer systems,
which can easily be implemented with turtle
graphics and Python.

Two examples are shown here:
(1) the snake kolam
(2) anklets of Krishna

Taken from Marcia Ascher: Mathematics
Elsewhere, An Exploration of Ideas Across
Cultures

�)�*cCs4t|�D]&}d}|D]}||�||�}q|}q|S)N�)�range�get)�seqZreplacementRules�n�iZnewseqZelement�r	�./usr/lib64/python3.8/turtledemo/lindenmayer.py�replacesrc
CsR|D]H}z||�Wqtk
rJzt|||�WnYnXYqXqdS)N)�	TypeError�draw)ZcommandsZrules�br	r	r
r
&sr
cCsdd�}dd�}dd�}|||dd�}d	d
i}d}t||d�}t�td�td
d�t�t�td�t�t||�ddl	m
}|d�dd�}dd�}	dd�}
||	|
d�}ddd�}d}
t�td�tdd�t�td�t|
|d�}t||�td
�dS)NcSstd�dS�N�-)�rightr	r	r	r
�r7szmain.<locals>.rcSstd�dSr)�leftr	r	r	r
�l:szmain.<locals>.lcSstd�dS)Ng@)�forwardr	r	r	r
�f=szmain.<locals>.fzf+f+f--f--f+f+f)�-�+rrrzb+f+b--f--b+f+bz
b--f--b--f��r��)�sleepcSstd�tdd�dS)NZred�
�Z)�color�circler	r	r	r
�AVszmain.<locals>.AcSs>ddlm}td�d|d�}t|�t|d�t|�dS)Nr)�sqrtZblack��i)Zmathr"rrr )r"rr	r	r
�BZs
zmain.<locals>.BcSstd�td�dS)NZgreenr)rrr	r	r	r
�Fbszmain.<locals>.F)�arrZafbfaZ	afbfbfbfa)r'rZfbfbfbfbrzDone!)r�resetZspeedZtracerZhtZupZbackwardZdownr
�timerr)rrrZsnake_rulesZsnake_replacementRulesZsnake_startZdrawingrr!r%r&Z
krishna_rulesZkrishna_replacementRulesZ
krishna_startr	r	r
�main1s@




r*�__main__N)	�__doc__Zturtlerr
r*�__name__�msg�printZmainloopr	r	r	r
�<module>sCturtledemo/__pycache__/paint.cpython-38.pyc000064400000003141151153537630014713 0ustar00U

e5d
�@sHdZddlTddd�Zddd�Zdd�Zed	krDe�Zee�e�d
S)
ap       turtle-example-suite:

            tdemo_paint.py

A simple  event-driven paint program

- left mouse button moves turtle
- middle mouse button changes color
- right mouse button toggles between pen up
(no line drawn when the turtle moves) and
pen down (line is drawn). If pen up follows
at least two pen-down moves, the polygon that
includes the starting point is filled.
 -------------------------------------------
 Play around by clicking into the canvas
 using all three mouse buttons.
 -------------------------------------------
          To exit press STOP button
 -------------------------------------------
�)�*cCs(t�drt�t�nt�t�dS)NZpendown)ZpenZend_fillZupZdownZ
begin_fill��x�y�r�(/usr/lib64/python3.8/turtledemo/paint.py�switchupdowns

rcCs(tdd�tdd�attd�dS)N�r)�colors�colorrrrr�changecolor srcCs`td�td�td�td�ddddgattd	�t�ttd
�tt	d�ttd�dS)
NZcircle�userg�?�ZredZgreenZblueZyellowrr	�Z	EVENTLOOP)
�shapeZ
resizemodeZ	shapesize�widthr
rrZ
onscreenclickZgotorrrrr�main%s


r�__main__N)rr)rr)	�__doc__Zturtlerrr�__name__�msg�printZmainlooprrrr�<module>s

turtledemo/__pycache__/two_canvases.cpython-38.opt-1.pyc000064400000002362151153537630017237 0ustar00U

e5d_�@s:dZddlmZmZmZdd�Zedkr6e�e��dS)z�turtledemo.two_canvases

Use TurtleScreen and RawTurtle to draw on two
distinct canvases in a separate window. The
new window must be separately closed in
addition to pressing the STOP button.
�)�TurtleScreen�	RawTurtle�TKc	CsNt��}tj|dddd�}tj|dddd�}|��|��t|�}|�ddd�t|�}|�ddd�t|�}t|�}|�dd	�|�d
�|�dd�|�d
�||fD]}|�	d
�|�
d�q�|�
d�||fD]}|��q�td�D]&}||fD]}|�
d�|�
d�q�q�||fD]*}|��|�
d�|��|�d��qdS)Ni,��z#ddffff)�widthZheightZbgz#ffeeee�333333�?�Zred)rrr�Zblue)rrr�turtle�$���2�H�6Z	EVENTLOOP)rZTkZCanvasZpackrZbgcolorrZcolorr�shape�ltZ
begin_fill�range�fdZend_fillZpuZbk)	�rootZcv1Zcv2�s1�s2�p�q�t�i�r�//usr/lib64/python3.8/turtledemo/two_canvases.py�mains>






r�__main__N)�__doc__r
rrrr�__name__Zmainlooprrrr�<module>s
)turtledemo/__pycache__/penrose.cpython-38.pyc000064400000011100151153537630015245 0ustar00U

e5d3
�@s�dZddlTddlmZmZddlmZmZdZ	deded�Z
d	d
�Zdd�Zd
d�Z
dd�Zd&dd�Zdd�Zdd�Zdd�Zdd�Zddeddfdd�Zefd d!�Zd"d#�Zed$kr�e�Ze�d%S)'a�       xturtle-example-suite:

          xtx_kites_and_darts.py

Constructs two aperiodic penrose-tilings,
consisting of kites and darts, by the method
of inflation in six steps.

Starting points are the patterns "sun"
consisting of five kites and "star"
consisting of five darts.

For more information see:
 http://en.wikipedia.org/wiki/Penrose_tiling
 -------------------------------------------
�)�*)�cos�pi)�perf_counter�sleepgP�/7���?���
cCsTt|}td�t|�td�t|�td�t|�td�t|�td�dS)N�$�l���f�lt�fd�rt��l�fl�r�*/usr/lib64/python3.8/turtledemo/penrose.py�kitesrcCsTt|}td�t|�td�t|�td�t|�td�t|�td�dS)Nr
rr
rrrr�dart%srcCs�|dkrFt�\}}tt��t|d�t|d�}}}dt|||f<dSt|}td�t||d�t|�t	d�t
||d�td�t|t�t	d�t
||d�td�t|�t	d	�t||d�td�dS)
NrrTr
�r���)�pos�int�heading�round�tiledictrr�inflatedartrr�inflatekite�d�r�nZpx�py�h�x�yrrrrr#1s(
"r#cCs�|dkrFt�\}}tt��t|d�t|d�}}}dt|||f<dSt|}t||d�td�t|�t	d�t
||d�td�t|t�t	d�t
||d�t|�t	d	�dS)
NrrFrr
r�6�~r)rrrr r!rr#rrrr"r$r%rrrr"Gs"
"r"cCs�t�|t|}t|d|d|�tD]T}|\}}}t||�t|�t|rftd�tdd�ntd�tdd�t�q*dS)NgY@r�black)r��?rr)r.rr)	�clearrZ	shapesizer!Zsetpos�
setheading�shapeZcolorZstamp)rr&�th�kr(r)r*rrr�drawZs


r4cCs$td�D]}t||�td�qdS�N��H)�ranger#r�rr&�irrr�sunjs
r;cCs$td�D]}t||�td�qdSr5)r8r"rr9rrr�staros
r<cCsTtd�t�td�t�tdt��t�td�t�tdt��td�dS)Nr�drrr)�tracerZ
begin_polyrZend_polyZregister_shapeZget_polyrrrrr�
makeshapestsr?cCs$t�t�t�t�td�dS)N�user)�resetZhtZpur?Z
resizemoderrrr�start�s
rB���)rrcCsxt|�td�iatd�|||�t|||�td�tdd�tD��}tdd�tD��}td||||f�dS)NrrcSsg|]}t|r|�qSr�r!��.0r)rrr�
<listcomp>�sztest.<locals>.<listcomp>cSsg|]}t|s|�qSrrErFrrrrH�sz"%d kites and %d darts = %d pieces.)�gotor0r!r>r4�len�print)rr&�fun�startposr2ZnkZndrrr�test�s
rNcCsLt�td�D]8}t�}td||�t�}||}|dkrtd|�qdS)N�i,r)rBr8�clockrNr)rLr:�a�b�trrr�demo�srTcCsjtd�tddd�tt�td�tt�td�tdd�tddd�td	d
dd�t	d
ddd�dS)NZlogog333333�?rrr-i8���gffffff�?rzPlease wait...�center)zArial Blackr
Zbold)ZalignZfontiXrO)�F�u)rMZDone)
�modeZbgcolorrTr;rr<ZpencolorrI�writerNrrrr�main�s
�rZ�__main__N)r)�__doc__ZturtleZmathrr�timerrPrrr$rrr#r"r4r;r<r?rBrNrTrZ�__name__�msgZmainlooprrrr�<module>s(


turtledemo/__pycache__/rosette.cpython-38.pyc000064400000003250151153537630015266 0ustar00U

e5dQ�@sXdZddlmZmZmZddlmZmZdd�Z	dd�Z
edkrTe
�Ze
e�e�d	S)
aF      turtle-example-suite:

          tdemo_wikipedia3.py

This example is
inspired by the Wikipedia article on turtle
graphics. (See example wikipedia1 for URLs)

First we create (ne-1) (i.e. 35 in this
example) copies of our first turtle p.
Then we let them perform their steps in
parallel.

Followed by a complete undo().
�)�Screen�Turtle�mainloop)�perf_counter�sleepcCs�|g}td|�D](}|��}|�d|�|�|�|}qt|�D]P}t|d|�|d}|D].}|�d|�|�d|d|�|�|�qbqBdS)N�g�v@g@gffffff�?r)�rangeZcloneZrt�append�abs�pencolor�fd)�p�neZszZ
turtlelist�i�q�c�t�r�*/usr/lib64/python3.8/turtledemo/rosette.py�mn_ecks
rcCs�t�}|�d�t�}|�d�|��|�d�|�d�|�dd�t�}t	|dd�t�}||}t
d�t�}tdd	�|��D��r�|��D]}|�
�q�qvt�}d
|||S)NZblackrZred��$�rcss|]}|��VqdS)N)Zundobufferentries)�.0rrrr�	<genexpr>7szmain.<locals>.<genexpr>zruntime: %.3f sec)rZbgcolorrZspeedZ
hideturtlerZpensizeZtracer�clockrr�anyZturtlesZundo)�sr
ZatZetZz1rrrr�main$s&



r�__main__N)�__doc__Zturtlerrr�timerrrrr�__name__�msg�printrrrr�<module>sturtledemo/__pycache__/sorting_animate.cpython-38.opt-2.pyc000064400000013422151153537630017726 0ustar00U

��.e��@s�ddlTddlZGdd�de�ZGdd�de�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
d$dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!Zd"Zed#kr�e�Ze�dS)%�)�*Nc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�BlockcCsF||_tj|ddd�|��|�|ddd�|�d�|��dS)NZsquareF)�shapeZvisibleg�?��black)�size�Turtle�__init__Zpu�	shapesize�	fillcolor�st)�selfr�r�2/usr/lib64/python3.8/turtledemo/sorting_animate.pyr	s
zBlock.__init__cCs|�d�dS)NZred�r�r
rrr�glowsz
Block.glowcCs|�d�dS)Nrrrrrr�unglow"szBlock.unglowcCsd�|j�S)NzBlock size: {0})�formatrrrrr�__repr__%szBlock.__repr__N)�__name__�
__module__�__qualname__r	rrrrrrrrsrc@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�ShelfcCs||_d|_dS)Nij���)�y�x)r
rrrrr	+szShelf.__init__cCsP|��\}}}|dd}|�|j|�|�|jdt|��|�|�dS)Nr��")r
�setyr�setxr�len�append)r
�d�width�_�y_offsetrrr�push0s
z
Shelf.pushcCs0||d�D]}|��\}}|�|d�qdS�Nr��posr�r
�i�bZxposr$rrr�_close_gap_from_i8szShelf._close_gap_from_icCs0||d�D]}|��\}}|�|d�qdSr'r(r*rrr�_open_gap_from_i=szShelf._open_gap_from_icCs,t�||�}|��|�d�|�|�|S)N��)�list�poprrr-)r
�keyr,rrrr1Bs


z	Shelf.popcCsb|�|�t�|||�|�|jd|�|��\}}}|dd}|�|j|�|��dS)Nrrr)	r.r0�insertrrr
rrr)r
r2r,r#r$r%rrrr3Is
zShelf.insertN)	rrrr	r&r-r.r1r3rrrrr)srcCs\t|�}td|�D]D}|}|dkrD||j||djkrD|d}q|�||�|��qdS)N�r�r �rangerr3r1)�shelf�lengthr+Zholerrr�isortSs 
r9cCsjt|�}td|d�D]N}|}t|d|�D]}||j||jkr,|}q,||kr|�||�|��qdS)Nrr4r5)r7r8�jZiminr+rrr�ssort\sr;cCsn||}|�||�|��|}t||�D].}||j|jkr(|�||�|��|d}q(|�||�|��|S�Nr4)r3r1r6r)r7�left�right�pivot_indexZpivotZstore_indexr+rrr�	partitionfs
r@cCs>||kr:|}t||||�}t|||d�t||d|�dSr<)r@�qsort)r7r=r>r?Zpivot_new_indexrrrrAqs
rAcCs�t�t�ttd��}t�|�t|�D]@\}}t|tt��D](}t|j	|dkr@t�
|t�|��q@q*tt
�ttdd�t�dS)N�
r4��line)�disable_keys�clearr0r6�randomZshuffle�	enumerater �srr3r1�	show_text�
instructions1�
instructions2�enable_keys)�targetr+�tr:rrr�	randomizexs
rPcCs(d|}tdd|�t|ddd�dS)Nrri����center)ZCourier�Zbold)ZalignZfont)Zgoto�write)�textrDrrrrJ�srJcCs@t�t�td�tt�t�tt�ttdd�t�dS)NzSelection Sortr4rC)rErFrJr;rIrKrLrMrrrr�start_ssort�srUcCs@t�t�td�tt�t�tt�ttdd�t�dS)NzInsertion Sortr4rC)rErFrJr9rIrKrLrMrrrr�start_isort�srVcCsLt�t�td�ttdtt�d�t�tt�ttdd�t�dS)NZ	Quicksortrr4rC)	rErFrJrArIr rKrLrMrrrr�start_qsort�srWcCs(td�ad}|D]}t�t|��qdS)Ni8���)
�r��	r4�rB���)rrIr&r)Zvalsr+rrr�
init_shelf�sr_cCs,tdd�tdd�tdd�tdd�dS)NrIr+�q�r)�onkeyrrrrrE�s


rEcCs6ttd�ttd�ttd�ttd�ttd�dS)Nr+rIr`raZspace)rbrVrUrWrPZbyerrrrrM�s




rMcCs@t���t�t�t�tt�ttdd�t�t	�dS)Nr4rCZ	EVENTLOOP)
Z	getscreenZclearscreenZhtZpenupr_rJrKrLrMZlistenrrrr�main�s
rczApress i for insertion sort, s for selection sort, q for quicksortz spacebar to quit, r to randomize�__main__)r)ZturtlerGrrr0rr9r;r@rArPrJrUrVrWr_rErMrcrKrLr�msgZmainlooprrrr�<module>s**	





turtledemo/__pycache__/tree.cpython-38.pyc000064400000003277151153537630014551 0ustar00U

e5dx�@sXdZddlmZmZddlmZdd�Zdd�Zdd	�Z	e
d
krTe	�Zee�e�dS)a�      turtle-example-suite:

             tdemo_tree.py

Displays a 'breadth-first-tree' - in contrast
to the classical Logo tree drawing programs,
which use a depth-first-algorithm.

Uses:
(1) a tree-generator, where the drawing is
quasi the side-effect, whereas the generator
always yields None.
(2) Turtle-cloning: At each branching point
the current pen is cloned. So in the end
there are 1024 turtles.
�)�Turtle�mainloop)�perf_counterccsr|dkrng}|D]>}|�|�|��}|�|�|�|�|�|�|�|�qt|||||�D]
}dVqbdS)z� plist is list of pens
    l is length of branch
    a is half of the angle between 2 branches
    f is factor by which branch is shortened
    from level to level.�N)�forwardZclone�left�right�append�tree)Zplist�l�a�fZlst�p�q�x�r�'/usr/lib64/python3.8/turtledemo/tree.pyr
s



r
cCstt�}|�d�|��|�d�|���dd�|�d�|��|�d�|�	�t
|gddd�}|D]}qjdS)Nr��Zi.������Agffffff�?)rZ
setundobufferZ
hideturtleZspeedZ	getscreenZtracerrZpenuprZpendownr
)r�trrrr�maketree's



rcCst�}t�t�}d||S)Nzdone: %.2f sec.)�clockr)r�brrr�main5sr�__main__N)
�__doc__Zturtlerr�timerrr
rr�__name__�msg�printrrrr�<module>sturtledemo/__pycache__/__init__.cpython-38.opt-1.pyc000064400000000710151153537630016275 0ustar00U

e5d:�@sdZdS)a3
    --------------------------------------
        About this viewer
    --------------------------------------

    Tiny demo viewer to view turtle graphics example scripts.

    Quickly and dirtyly assembled by Gregor Lingl.
    June, 2006

    For more information see: turtledemo - Help

    Have fun!
N)�__doc__�rr�+/usr/lib64/python3.8/turtledemo/__init__.py�<module>�turtledemo/__pycache__/bytedesign.cpython-38.opt-2.pyc000064400000007314151153537630016703 0ustar00U

e5d��@sTddlmZmZddlmZGdd�de�Zdd�ZedkrPe�Z	e
e	�e�dS)	�)�Turtle�mainloop)�perf_counterc@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�DesignercCs�|��td�D]J}|�d|�|��|�|��|�|��|�d|�|�d�q|��|�|�|�d�|�d|�|�d�|��|�	d|d|�|�
��d	�dS)
N�g�����)P@�H�$g�8@���.g������a@T)�up�range�forward�down�wheel�position�backward�right�goto�centerpiece�	getscreen�tracer)�selfZhomePos�scale�i�r�-/usr/lib64/python3.8/turtledemo/bytedesign.py�design s 


zDesigner.designcCs�|�d�td�D]}|�||�q|��|�d�td�D]}|�||�q>|�d�td�D]:}|��|�d�|�d|�|��|�d|�qb|�d�|�	��
�dS)N�6�rrr�)rr�	pentpiecer�left�tripiecer
rrr�update)r�initposrrrrrr2s 




zDesigner.wheelcCs�|��}|��|�d|�|�d||�|��|�|�|�|�|��|�d|�|�d||�|��|�|�|�|�|�d�|�	��
�dS)Ng@g�?@r)�headingrr�tripolyrrr�
setheading�tripolylr!rr#)rr$r�oldhrrrr"Ds




zDesigner.tripiececCs�|��}|��|�d|�|��td�D]}|�d|�|�d�q.|�d|d|�|��|�|�|�|�|�d|�|��td�D]}|�d|�|�d�q�|�	d|d|�|��|�|�|�|�|�
d�|����dS)N�r�r�K)
r%rr
rrr�pentrrr'�pentlr!rr#)rr$rr)rrrrr Us,




zDesigner.pentpiececCs>|d|krdS|�|�|�|�|�|d|||�dS�N�gR���Q�?)r
r!r.�r�sideZangrrrrr.ms


zDesigner.pentlcCs>|d|krdS|�|�|�|�|�|d|||�dSr/)r
rr-r1rrrr-ss


zDesigner.pentrcCsh|d|krdS|�|�|�d�|�|d�|�d�|�|d�|�d�|�|d|�dS�Nr�og{�G�z�?g�������?�g�?)r
rr&�rr2rrrrr&ys



zDesigner.tripolyrcCsh|d|krdS|�|�|�d�|�|d�|�d�|�|d�|�d�|�|d|�dSr3)r
r!r(r6rrrr(�s



zDesigner.tripolylcCs>|�|�|�|�|d|kr$dS|�|d|||�dS)Ng@g333333�?)r
r!r)r�s�arrrrr�s


zDesigner.centerpieceN)�__name__�
__module__�__qualname__rrr"r r.r-r&r(rrrrrrs

rcCs\t�}|�d�|��|���d�|���d�t�}|�|��d�t�}d||S)Nrr0zruntime: %.2f sec.)	rZspeedZ
hideturtlerZdelayr�clockrr)�tZatZetrrr�main�s
r>�__main__N)Zturtlerr�timerr<rr>r9�msg�printrrrr�<module>suturtledemo/__pycache__/paint.cpython-38.opt-1.pyc000064400000003141151153537630015652 0ustar00U

e5d
�@sHdZddlTddd�Zddd�Zdd�Zed	krDe�Zee�e�d
S)
ap       turtle-example-suite:

            tdemo_paint.py

A simple  event-driven paint program

- left mouse button moves turtle
- middle mouse button changes color
- right mouse button toggles between pen up
(no line drawn when the turtle moves) and
pen down (line is drawn). If pen up follows
at least two pen-down moves, the polygon that
includes the starting point is filled.
 -------------------------------------------
 Play around by clicking into the canvas
 using all three mouse buttons.
 -------------------------------------------
          To exit press STOP button
 -------------------------------------------
�)�*cCs(t�drt�t�nt�t�dS)NZpendown)ZpenZend_fillZupZdownZ
begin_fill��x�y�r�(/usr/lib64/python3.8/turtledemo/paint.py�switchupdowns

rcCs(tdd�tdd�attd�dS)N�r)�colors�colorrrrr�changecolor srcCs`td�td�td�td�ddddgattd	�t�ttd
�tt	d�ttd�dS)
NZcircle�userg�?�ZredZgreenZblueZyellowrr	�Z	EVENTLOOP)
�shapeZ
resizemodeZ	shapesize�widthr
rrZ
onscreenclickZgotorrrrr�main%s


r�__main__N)rr)rr)	�__doc__Zturtlerrr�__name__�msg�printZmainlooprrrr�<module>s

turtledemo/__pycache__/tree.cpython-38.opt-1.pyc000064400000003277151153537630015510 0ustar00U

e5dx�@sXdZddlmZmZddlmZdd�Zdd�Zdd	�Z	e
d
krTe	�Zee�e�dS)a�      turtle-example-suite:

             tdemo_tree.py

Displays a 'breadth-first-tree' - in contrast
to the classical Logo tree drawing programs,
which use a depth-first-algorithm.

Uses:
(1) a tree-generator, where the drawing is
quasi the side-effect, whereas the generator
always yields None.
(2) Turtle-cloning: At each branching point
the current pen is cloned. So in the end
there are 1024 turtles.
�)�Turtle�mainloop)�perf_counterccsr|dkrng}|D]>}|�|�|��}|�|�|�|�|�|�|�|�qt|||||�D]
}dVqbdS)z� plist is list of pens
    l is length of branch
    a is half of the angle between 2 branches
    f is factor by which branch is shortened
    from level to level.�N)�forwardZclone�left�right�append�tree)Zplist�l�a�fZlst�p�q�x�r�'/usr/lib64/python3.8/turtledemo/tree.pyr
s



r
cCstt�}|�d�|��|�d�|���dd�|�d�|��|�d�|�	�t
|gddd�}|D]}qjdS)Nr��Zi.������Agffffff�?)rZ
setundobufferZ
hideturtleZspeedZ	getscreenZtracerrZpenuprZpendownr
)r�trrrr�maketree's



rcCst�}t�t�}d||S)Nzdone: %.2f sec.)�clockr)r�brrr�main5sr�__main__N)
�__doc__Zturtlerr�timerrr
rr�__name__�msg�printrrrr�<module>sturtledemo/__pycache__/round_dance.cpython-38.pyc000064400000003561151153537630016067 0ustar00U

e5d�@s8dZddlTdd�Zdd�Zedkr4ee��e�dS)	aF      turtle-example-suite:

         tdemo_round_dance.py

(Needs version 1.1 of the turtle module that
comes with Python 3.1)

Dancing turtles have a compound shape
consisting of a series of triangles of
decreasing size.

Turtles march along a circle while rotating
pairwise in opposite direction, with one
exception. Does that breaking of symmetry
enhance the attractiveness of the example?

Press any key to stop the animation.

Technically: demonstrates use of compound
shapes, transformation of shapes as well as
cloning turtles. The animation is
controlled through update().
�)�*cCsdadS)NF)�running�rr�./usr/lib64/python3.8/turtledemo/round_dance.py�stopsrcCs�t�td�td�td�d}d}d}d}td�}td	�D]D}t|�t�}||9}||9}t|�|�	||d
d|fd�q>t
d|�td�td�t�td
d�g}td�D]:}t
d�td�td�t�|dd
kr�|�t��q�t�datt�t�d}t�r�d}	|D]6}
|
�
d�|
�d�|
�|	�|	d
k�rPdnd}	�q |dk�rztd�t|�|d9}t��qdS)NZgray10FZtriangleg}�R��c�?g���y!"@��Zcompound�
g�?ZblackZmultitriri8����������T�g�G�z�?zDONE!)ZclearscreenZbgcolorZtracer�shapeZShape�rangeZ	shapesizeZ
get_shapepolyZtiltZaddcomponentZregister_shapeZpuZsetpos�fd�lt�update�appendZclone�homerZ
onkeypressrZlisten�right)�fZphi�s�cZsh�i�pZdancersZcsZtaZdancerrrr�mains^







r�__main__N)�__doc__Zturtlerr�__name__�printZmainlooprrrr�<module>s5
turtledemo/__pycache__/rosette.cpython-38.opt-1.pyc000064400000003250151153537630016225 0ustar00U

e5dQ�@sXdZddlmZmZmZddlmZmZdd�Z	dd�Z
edkrTe
�Ze
e�e�d	S)
aF      turtle-example-suite:

          tdemo_wikipedia3.py

This example is
inspired by the Wikipedia article on turtle
graphics. (See example wikipedia1 for URLs)

First we create (ne-1) (i.e. 35 in this
example) copies of our first turtle p.
Then we let them perform their steps in
parallel.

Followed by a complete undo().
�)�Screen�Turtle�mainloop)�perf_counter�sleepcCs�|g}td|�D](}|��}|�d|�|�|�|}qt|�D]P}t|d|�|d}|D].}|�d|�|�d|d|�|�|�qbqBdS)N�g�v@g@gffffff�?r)�rangeZcloneZrt�append�abs�pencolor�fd)�p�neZszZ
turtlelist�i�q�c�t�r�*/usr/lib64/python3.8/turtledemo/rosette.py�mn_ecks
rcCs�t�}|�d�t�}|�d�|��|�d�|�d�|�dd�t�}t	|dd�t�}||}t
d�t�}tdd	�|��D��r�|��D]}|�
�q�qvt�}d
|||S)NZblackrZred��$�rcss|]}|��VqdS)N)Zundobufferentries)�.0rrrr�	<genexpr>7szmain.<locals>.<genexpr>zruntime: %.3f sec)rZbgcolorrZspeedZ
hideturtlerZpensizeZtracer�clockrr�anyZturtlesZundo)�sr
ZatZetZz1rrrr�main$s&



r�__main__N)�__doc__Zturtlerrr�timerrrrr�__name__�msg�printrrrr�<module>sturtledemo/__pycache__/penrose.cpython-38.opt-2.pyc000064400000010236151153537630016216 0ustar00U

e5d3
�@s�ddlTddlmZmZddlmZmZdZdeded�Z	dd	�Z
d
d�Zdd
�Zdd�Z
d%dd�Zdd�Zdd�Zdd�Zdd�Zddeddfdd�Zefdd �Zd!d"�Zed#kr�e�Ze�d$S)&�)�*)�cos�pi)�perf_counter�sleepgP�/7���?���
cCsTt|}td�t|�td�t|�td�t|�td�t|�td�dS)N�$�l���f�lt�fd�rt��l�fl�r�*/usr/lib64/python3.8/turtledemo/penrose.py�kitesrcCsTt|}td�t|�td�t|�td�t|�td�t|�td�dS)Nr
rr
rrrr�dart%srcCs�|dkrFt�\}}tt��t|d�t|d�}}}dt|||f<dSt|}td�t||d�t|�t	d�t
||d�td�t|t�t	d�t
||d�td�t|�t	d	�t||d�td�dS)
NrrTr
�r���)�pos�int�heading�round�tiledictrr�inflatedartrr�inflatekite�d�r�nZpx�py�h�x�yrrrrr#1s(
"r#cCs�|dkrFt�\}}tt��t|d�t|d�}}}dt|||f<dSt|}t||d�td�t|�t	d�t
||d�td�t|t�t	d�t
||d�t|�t	d	�dS)
NrrFrr
r�6�~r)rrrr r!rr#rrrr"r$r%rrrr"Gs"
"r"cCs�t�|t|}t|d|d|�tD]T}|\}}}t||�t|�t|rftd�tdd�ntd�tdd�t�q*dS)NgY@r�black)r��?rr)r.rr)	�clearrZ	shapesizer!Zsetpos�
setheading�shapeZcolorZstamp)rr&�th�kr(r)r*rrr�drawZs


r4cCs$td�D]}t||�td�qdS�N��H)�ranger#r�rr&�irrr�sunjs
r;cCs$td�D]}t||�td�qdSr5)r8r"rr9rrr�staros
r<cCsTtd�t�td�t�tdt��t�td�t�tdt��td�dS)Nr�drrr)�tracerZ
begin_polyrZend_polyZregister_shapeZget_polyrrrrr�
makeshapestsr?cCs$t�t�t�t�td�dS)N�user)�resetZhtZpur?Z
resizemoderrrr�start�s
rB���)rrcCsxt|�td�iatd�|||�t|||�td�tdd�tD��}tdd�tD��}td||||f�dS)NrrcSsg|]}t|r|�qSr�r!��.0r)rrr�
<listcomp>�sztest.<locals>.<listcomp>cSsg|]}t|s|�qSrrErFrrrrH�sz"%d kites and %d darts = %d pieces.)�gotor0r!r>r4�len�print)rr&�fun�startposr2ZnkZndrrr�test�s
rNcCsLt�td�D]8}t�}td||�t�}||}|dkrtd|�qdS)N�i,r)rBr8�clockrNr)rLr:�a�b�trrr�demo�srTcCsjtd�tddd�tt�td�tt�td�tdd�tddd�td	d
dd�t	d
ddd�dS)NZlogog333333�?rrr-i8���gffffff�?rzPlease wait...�center)zArial Blackr
Zbold)ZalignZfontiXrO)�F�u)rMZDone)
�modeZbgcolorrTr;rr<ZpencolorrI�writerNrrrr�main�s
�rZ�__main__N)r)ZturtleZmathrr�timerrPrrr$rrr#r"r4r;r<r?rBrNrTrZ�__name__�msgZmainlooprrrr�<module>s&


turtledemo/__pycache__/yinyang.cpython-38.pyc000064400000002055151153537630015261 0ustar00U

e5d4�@s4dZddlTdd�Zdd�Zedkr0e�e�dS)	z�       turtle-example-suite:

            tdemo_yinyang.py

Another drawing suitable as a beginner's
programming example.

The small circles are drawn by the circle
command.

�)�*cCs�td�td|�t�t|dd�t|d�td�t|dd�t�td�t�t|d�td�t	�t||�t�t|d�t�td�t�t
|d�t	�td�dS)N��blackg@��Zgffffff�?g333333�?)�widthZcolorZ
begin_fillZcircle�leftZend_fillZupZforward�rightZdownZbackward)ZradiusZcolor1Zcolor2�r
�*/usr/lib64/python3.8/turtledemo/yinyang.py�yins,


rcCs(t�tddd�tddd�t�dS)N��rZwhitezDone!)�resetrZhtr
r
r
r�main(s
r�__main__N)�__doc__Zturtlerr�__name__Zmainloopr
r
r
r�<module>sturtledemo/__pycache__/__main__.cpython-38.opt-2.pyc000064400000023267151153537630016273 0ustar00U

��.e�7�@sddlZddlZddlTddlmZmZddlmZddlm	Z	ddl
mZddl
Z
ej�ej�e��ZejdkZdZd	Zd
ZdZdZd
defZdZdddgZdZdZdddddddddddgZ dd�Z!d efd!efd"e
jffZ"Gd#d$�d$e#�Z$d%d&�Z%e&d'k�re%�dS)(�N)�*)�ColorDelegator�color_config)�
Percolator)�	view_text)�__doc__�darwin������Arial�)rrZboldzLucida Console�
�normal��d��	�������cCsdd�t�t�D�S)NcSs.g|]&}|�d�r|ddkr|dd��qS)z.pyr�_N���)�endswith)�.0�entry�r"�+/usr/lib64/python3.8/turtledemo/__main__.py�
<listcomp>ts
�z%getExampleEntries.<locals>.<listcomp>)�os�listdir�demo_dirr"r"r"r#�getExampleEntriesssr(zTurtledemo helpzAbout turtledemozAbout turtle modulec@s�eZdZd(dd�Zdd�Zdd�Zdd	�Zd
d�Zd)dd
�Zd*dd�Z	dd�Z
d+dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�ZdS),�
DemoWindowNc	CsJt�|_}t_|�d�|�d|j�trbddl}|j	ddddd�
t���ddg|j
|j
d	�|jdd
d�|jdd
d�|jd
dd
d
�|jddd
d
�|jddd
d
�t|tdd�|_|jj|�|j�ddd�|jj|�|j�ddd�|jj|�|j�ddd�|j|d<ttdtdd�}|�|�|��|�|�|��|jdddd�t|d
ddddtd�|_ t!|d t"d!d"|j#d#�|_$t!|d$t"d!d"|j%d#�|_&t!|d%t"d!d"|j'd#�|_(|j jd
ddd&d'�|j$jd
d
d(d)�|j&jd
dd(d)�|j(jd
dd(d)�t)|j*��+t,��d*|_-d*|_.|�r.|�/|�|�0t1t1t1d+d,�t2|_3dS)-NzPython turtle-graphics examplesZWM_DELETE_WINDOWrZ	osascriptz-ez tell application "System Events"z>set frontmost of the first process whose unix id is {} to truezend tell)�stderr�stdoutr	)�weight�Z)Zminsizer,r
r)�relief�borderwidthZExamples)�menu�label�	underlineZFontsizeZHelpr0r
z#ddd)�orientZ	sashwidthZ
sashrelief�bgrZnews)�rowZ
columnspan�stickyz --- z#ddf)r�r)Zheight�textr4�fontr/r.z START Zwhitez#fed)r8r9�fgZdisabledforeground�commandz STOP z CLEAR )rr
)r5�columnr6�padxZew)r5r<r6FzChoose example from menu�black)4ZTk�root�turtle�_root�titleZwm_protocol�_destroyr�
subprocess�run�formatr%�getpidZDEVNULLZgrid_rowconfigureZgrid_columnconfigure�MenuZRAISEDZmBarZadd_cascade�makeLoadDemoMenu�makeFontMenu�makeHelpMenuZPanedWindow�
HORIZONTALZSOLID�add�
makeTextFrame�makeGraphFrameZgridZLabelZRIDGE�
output_lblZButton�btnfont�	startDemo�	start_btn�stopIt�stop_btn�clearCanvas�	clear_btnrr8Zinsertfilterr�dirty�exitflag�loadfile�	configGUI�DISABLED�STARTUP�state)�self�filenamer?rDZpaner"r"r#�__init__�s�
������
�
����

�zDemoWindow.__init__cCsP|j��}|j��}|j�d|j||j�|j�d|j||j�dS)Ng�?)�_canvasZwinfo_widthZwinfo_heightZxview_moveto�	canvwidthZyview_moveto�
canvheight)r_�eventZcwidthZcheightr"r"r#�onResize�s

zDemoWindow.onResizecCs6t|�|_}t|ddddd�|_}t|�t|dd�|_}|j|d<|jt	t
d	�t|d
td�|_}|j
|d<|jttd	�|j|d<|j|d
<tt�|d<tr�dnd}|�d||j�|�d||j�|�d||j�|�d||j�|�d|j�|�d|j�|�d|j�|jt	tdd�|S)Nr8r
Znone�-)�namer=Zwrap�width�vbar)rhr;)�side�fill�hbar)rhr3ZyscrollcommandZxscrollcommandr9ZCommandZControlz
<%s-minus>z<%s-underscore>z
<%s-equal>z	<%s-plus>z<Control-MouseWheel>z<Control-Button-4>z<Control-Button-5>r	)rkrl�expand)ZFrame�
text_frameZTextr8rZ	ScrollbarrjZyviewZpackZLEFT�YrLrmZxviewZBOTTOM�X�set�tuple�txtfontrZbind_all�
decrease_size�
increase_size�bind�update_mousewheelZBOTH)r_r?ror8rjrmZshortcutr"r"r#rN�s2�



zDemoWindow.makeTextFramecCs�|tj_d|_d|_t�|dd|j|j�tj_|_}|��|j�	d|j
�d|jd<t��|_}tj
�||j�|j|_|gtj_|S)Ni�i iXz<Configure>rr/)r@Z_ScreenrArcrdZScrolledCanvasrbZ
adjustScrollsZ_rootwindowrwrfZScreen�screen�TurtleScreenra�scanvasZ	RawTurtleZscreens)r_r?ZcanvasZ_s_r"r"r#rO�s$�

zDemoWindow.makeGraphFramecCs(|td<tt�|jd<d||jd<dS)Nr	r9zFont size %dr8)rtrsr8rP)r_�sizer"r"r#�set_txtsize�szDemoWindow.set_txtsizecCs|�ttddt��dS�Nr	�break)r}�maxrt�MINIMUM_FONT_SIZE�r_Zdummyr"r"r#ru�szDemoWindow.decrease_sizecCs|�ttddt��dSr~)r}�minrt�MAXIMUM_FONT_SIZEr�r"r"r#rvszDemoWindow.increase_sizecCs$|jdktkr|��S|��SdS)Nr)Zdeltarrurv)r_rer"r"r#rxszDemoWindow.update_mousewheel��bluecCsh|jj||tkrdndd�|jj||tkr0dndd�|jj||tkrLdndd�|jj||d�dS)Nz#d00z#fca)r^r4)r8r:)rS�config�NORMALrUrWrP)r_�start�stop�clearZtxtZcolorr"r"r#r[s���zDemoWindow.configGUIcs:t|�}t�D]&}|f�fdd�	}|j|dt|d�q|S)Ncs��|�dS�N)rZ)r!�r_r"r#�loadsz)DemoWindow.makeLoadDemoMenu.<locals>.loadr�r1r2r9r;)rHr(�add_command�menufont)r_�masterr0r!r�r"r�r#rIs
�zDemoWindow.makeLoadDemoMenucsht|�}|jd�jtd�|jd�jtd�|��tD]*}|f�fdd�	}|jt|�dt|d�q8|S)NzDecrease (C-'-'))r1r;r9zIncrease (C-'+')cs��|�dSr�)r})r|r�r"r#�resize(sz'DemoWindow.makeFontMenu.<locals>.resizerr�)rHr�rur�rvZ
add_separator�
font_sizes�str)r_r�r0r|r�r"r�r#rJs
�
��zDemoWindow.makeFontMenucs<t|�}tD]*\}}||f�fdd�	}|j|t|d�q|S)Ncst�j||�dSr�)rr?)�
help_label�	help_filer�r"r#�show2sz%DemoWindow.makeHelpMenu.<locals>.show)r1r9r;)rH�help_entriesr�r�)r_r�r0r�r�r�r"r�r#rK.s
zDemoWindow.makeHelpMenucCs|jr|j��d|_dS�NF)rXryr�r�r"r"r#�
refreshCanvas7s
zDemoWindow.refreshCanvasc	Cs�|��dtj_d|}t|�tj||_t|jj	d��}|�
�}W5QRX|j�dd�|j�
d|�|j�|d�|�tttdd�t|_dS)	NFzturtledemo.�rz1.0�endz# - a Python turtle graphics examplezPress start button�red)rVr@rz�_RUNNING�
__import__�sys�modules�module�open�__file__�readr8�delete�insertr?rBr[r�r\�READYr^)r_r`�modname�f�charsr"r"r#rZ<s
�zDemoWindow.loadfilecCs�|��d|_dtj_|�tttdd�|j�	�|j�
d�t|_z$|j
��}|dkr`t|_nt|_Wn0tjk
r�|jdkr�YdSt|_d}YnX|jtkr�|�ttt|�n"|jtkr�d|_|�tttdd�dS)	NTzdemo running...r>ZstandardZ	EVENTLOOPzstopped!zuse mouse/keys or STOPr�)r�rXr@rzr�r[r\r�ryr��mode�RUNNINGr^r��main�EVENTDRIVEN�DONEZ
Terminatorr?rY)r_�resultr"r"r#rRKs<
�






�

�zDemoWindow.startDemocCs4|��|j�d�|jjdd�|�ttt�dS)N�allr�)Zcursor)r�ryZ_deleter{r�r[r�r\r�r"r"r#rVhszDemoWindow.clearCanvascCs2|jr&|��d|_|�tttdd�dtj_dS)NFzSTOPPED!r�)rYrVr[r�r\r@rzr�r�r"r"r#rTns
�zDemoWindow.stopItcCsdtj_|j��d|_dSr�)r@rzr�r?Zdestroyr�r"r"r#rCvs
zDemoWindow._destroy)N)N)N)r�r�)�__name__�
__module__�__qualname__rarfrNrOr}rurvrxr[rIrJrKr�rZrRrVrTrCr"r"r"r#r)s$
D


	
	r)cCst�}|j��dSr�)r)r?Zmainloop)Zdemor"r"r#r�|sr��__main__)'r�r%ZtkinterZidlelib.colorizerrrZidlelib.percolatorrZidlelib.textviewrZ
turtledemorZabout_turtledemor@�path�dirname�abspathr�r'�platformrr]r�r�r�r�r�r�rQrtr�r�r�r(r��objectr)r�r�r"r"r"r#�<module>Ws<


�~
turtledemo/__pycache__/yinyang.cpython-38.opt-2.pyc000064400000001555151153537630016225 0ustar00U

e5d4�@s0ddlTdd�Zdd�Zedkr,e�e�dS)�)�*cCs�td�td|�t�t|dd�t|d�td�t|dd�t�td�t�t|d�td�t	�t||�t�t|d�t�td�t�t
|d�t	�td�dS)N��blackg@��Zgffffff�?g333333�?)�widthZcolorZ
begin_fillZcircle�leftZend_fillZupZforward�rightZdownZbackward)ZradiusZcolor1Zcolor2�r
�*/usr/lib64/python3.8/turtledemo/yinyang.py�yins,


rcCs(t�tddd�tddd�t�dS)N��rZwhitezDone!)�resetrZhtr
r
r
r�main(s
r�__main__N)Zturtlerr�__name__Zmainloopr
r
r
r�<module>s
turtledemo/__pycache__/peace.cpython-38.opt-1.pyc000064400000002140151153537630015612 0ustar00U

e5d)�@s,dZddlTdd�Zedkr(e�e�dS)z�       turtle-example-suite:

              tdemo_peace.py

A simple drawing suitable as a beginner's
programming example. Aside from the
peacecolors assignment and the for loop,
it only uses turtle commands.
�)�*cCs
d}t�t�t�tdd�td�|D]@}t|�t�td�t�td�t	d�td�t
d�q,td�td	�td
d�t�td�t	d�td
�t�t	d�td�t
d�t�td�t�td�t	d�t�td�t�td
d�dS)N)Zred3ZorangeZyellowZ	seagreen4Zorchid4Z
royalblue1Zdodgerblue4i����i=����Fi��Z�B�ZwhiteriV����iT��-i,zDone!)�resetZScreenZupZgoto�widthZcolorZdownZforwardZbackward�left�rightZcircle)ZpeacecolorsZpcolor�r�(/usr/lib64/python3.8/turtledemo/peace.py�mainsH



r�__main__N)�__doc__Zturtler�__name__Zmainlooprrrr�<module>s

-turtledemo/__pycache__/fractalcurves.cpython-38.opt-1.pyc000064400000005511151153537630017406 0ustar00U

e5d�
�@sTdZddlTddlmZmZGdd�de�Zdd�Ze	dkrPe�Z
ee
�e�d	S)
a&      turtle-example-suite:

        tdemo_fractalCurves.py

This program draws two fractal-curve-designs:
(1) A hilbert curve (in a box)
(2) A combination of Koch-curves.

The CurvesTurtle class and the fractal-curve-
methods are taken from the PythonCard example
scripts for turtle-graphics.
�)�*)�sleep�perf_counterc@s$eZdZdd�Zdd�Zdd�ZdS)�CurvesTurtlecCs�|dkrdS|�|d�|�||d|�|�|�|�|d�|�||d|�|�|�|�||d|�|�|d�|�|�|�||d|�|�|d�dS)Nr�Z�)�left�hilbertZforward�right)�self�size�levelZparity�r�0/usr/lib64/python3.8/turtledemo/fractalcurves.pyr	s


zCurvesTurtle.hilbertcCs�ddl}d||�|j|�}|��|�|�|��|�dd|d|�t|�D] }|�|||�|�d|�q\|�	dd|d|�|��|�
|�|��dS)Nr��rih)�mathZsinZpi�pu�fd�pd�rt�range�fractal�ltZbk)r�nZradZlev�dirrZedge�irrr�
fractalgon/s

zCurvesTurtle.fractalgoncCs�|dkr|�|�dS|�|d|d|�|�d|�|�|d|d|�|�d|�|�|d|d|�|�d|�|�|d|d|�dS)Nr��<�x)rrrr)rZdistZdepthrrrrrBs
zCurvesTurtle.fractalN)�__name__�
__module__�__qualname__r	rrrrrrrsrcCs�t�}|��|�d�|��|���dd�|��d}|�d|d|�|��t	�}|�
d�|��|�|�|�
|dd�|�|�td�D]$}|�d�|�|d	|d
�q�|��td
�D]}|�|�|�d�q�|��td�D]$}|�|d|d
�|�d�q�|��t	�}d
||}td�|��|�d�|��|���dd�t	�}|�dd�|��|�dddd�|��|��|�d�|�dddd�|��t	�}|d||7}|S)Nrr�i���i��Zredrr�@r��BzHilbert: %.2fsec. ZblackZblue������zKoch: %.2fsec.)r�resetZspeedZhtZ	getscreenZtracerrZsetposr�clockZ	fillcolorZ
begin_fillrr	rrrZend_fillrZcolorr)ZftrZtar�tb�resrrr�mainNs\







r/�__main__N)
�__doc__Zturtle�timerrr,ZPenrr/r!�msg�printZmainlooprrrr�<module>s=9turtledemo/__pycache__/penrose.cpython-38.opt-1.pyc000064400000011100151153537630016204 0ustar00U

e5d3
�@s�dZddlTddlmZmZddlmZmZdZ	deded�Z
d	d
�Zdd�Zd
d�Z
dd�Zd&dd�Zdd�Zdd�Zdd�Zdd�Zddeddfdd�Zefd d!�Zd"d#�Zed$kr�e�Ze�d%S)'a�       xturtle-example-suite:

          xtx_kites_and_darts.py

Constructs two aperiodic penrose-tilings,
consisting of kites and darts, by the method
of inflation in six steps.

Starting points are the patterns "sun"
consisting of five kites and "star"
consisting of five darts.

For more information see:
 http://en.wikipedia.org/wiki/Penrose_tiling
 -------------------------------------------
�)�*)�cos�pi)�perf_counter�sleepgP�/7���?���
cCsTt|}td�t|�td�t|�td�t|�td�t|�td�dS)N�$�l���f�lt�fd�rt��l�fl�r�*/usr/lib64/python3.8/turtledemo/penrose.py�kitesrcCsTt|}td�t|�td�t|�td�t|�td�t|�td�dS)Nr
rr
rrrr�dart%srcCs�|dkrFt�\}}tt��t|d�t|d�}}}dt|||f<dSt|}td�t||d�t|�t	d�t
||d�td�t|t�t	d�t
||d�td�t|�t	d	�t||d�td�dS)
NrrTr
�r���)�pos�int�heading�round�tiledictrr�inflatedartrr�inflatekite�d�r�nZpx�py�h�x�yrrrrr#1s(
"r#cCs�|dkrFt�\}}tt��t|d�t|d�}}}dt|||f<dSt|}t||d�td�t|�t	d�t
||d�td�t|t�t	d�t
||d�t|�t	d	�dS)
NrrFrr
r�6�~r)rrrr r!rr#rrrr"r$r%rrrr"Gs"
"r"cCs�t�|t|}t|d|d|�tD]T}|\}}}t||�t|�t|rftd�tdd�ntd�tdd�t�q*dS)NgY@r�black)r��?rr)r.rr)	�clearrZ	shapesizer!Zsetpos�
setheading�shapeZcolorZstamp)rr&�th�kr(r)r*rrr�drawZs


r4cCs$td�D]}t||�td�qdS�N��H)�ranger#r�rr&�irrr�sunjs
r;cCs$td�D]}t||�td�qdSr5)r8r"rr9rrr�staros
r<cCsTtd�t�td�t�tdt��t�td�t�tdt��td�dS)Nr�drrr)�tracerZ
begin_polyrZend_polyZregister_shapeZget_polyrrrrr�
makeshapestsr?cCs$t�t�t�t�td�dS)N�user)�resetZhtZpur?Z
resizemoderrrr�start�s
rB���)rrcCsxt|�td�iatd�|||�t|||�td�tdd�tD��}tdd�tD��}td||||f�dS)NrrcSsg|]}t|r|�qSr�r!��.0r)rrr�
<listcomp>�sztest.<locals>.<listcomp>cSsg|]}t|s|�qSrrErFrrrrH�sz"%d kites and %d darts = %d pieces.)�gotor0r!r>r4�len�print)rr&�fun�startposr2ZnkZndrrr�test�s
rNcCsLt�td�D]8}t�}td||�t�}||}|dkrtd|�qdS)N�i,r)rBr8�clockrNr)rLr:�a�b�trrr�demo�srTcCsjtd�tddd�tt�td�tt�td�tdd�tddd�td	d
dd�t	d
ddd�dS)NZlogog333333�?rrr-i8���gffffff�?rzPlease wait...�center)zArial Blackr
Zbold)ZalignZfontiXrO)�F�u)rMZDone)
�modeZbgcolorrTr;rr<ZpencolorrI�writerNrrrr�main�s
�rZ�__main__N)r)�__doc__ZturtleZmathrr�timerrPrrr$rrr#r"r4r;r<r?rBrNrTrZ�__name__�msgZmainlooprrrr�<module>s(


turtledemo/__pycache__/bytedesign.cpython-38.pyc000064400000010263151153537630015740 0ustar00U

e5d��@sXdZddlmZmZddlmZGdd�de�Zdd�Ze	dkrTe�Z
ee
�e�d	S)
a�      turtle-example-suite:

        tdemo_bytedesign.py

An example adapted from the example-suite
of PythonCard's turtle graphics.

It's based on an article in BYTE magazine
Problem Solving with Logo: Using Turtle
Graphics to Redraw a Design
November 1982, p. 118 - 134

-------------------------------------------

Due to the statement

t.delay(0)

in line 152, which sets the animation delay
to 0, this animation runs in "line per line"
mode as fast as possible.
�)�Turtle�mainloop)�perf_counterc@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�DesignercCs�|��td�D]J}|�d|�|��|�|��|�|��|�d|�|�d�q|��|�|�|�d�|�d|�|�d�|��|�	d|d|�|�
��d	�dS)
N�g�����)P@�H�$g�8@���.g������a@T)�up�range�forward�down�wheel�position�backward�right�goto�centerpiece�	getscreen�tracer)�selfZhomePos�scale�i�r�-/usr/lib64/python3.8/turtledemo/bytedesign.py�design s 


zDesigner.designcCs�|�d�td�D]}|�||�q|��|�d�td�D]}|�||�q>|�d�td�D]:}|��|�d�|�d|�|��|�d|�qb|�d�|�	��
�dS)N�6�rrr�)rr�	pentpiecer�left�tripiecer
rrr�update)r�initposrrrrrr2s 




zDesigner.wheelcCs�|��}|��|�d|�|�d||�|��|�|�|�|�|��|�d|�|�d||�|��|�|�|�|�|�d�|�	��
�dS)Ng@g�?@r)�headingrr�tripolyrrr�
setheading�tripolylr!rr#)rr$r�oldhrrrr"Ds




zDesigner.tripiececCs�|��}|��|�d|�|��td�D]}|�d|�|�d�q.|�d|d|�|��|�|�|�|�|�d|�|��td�D]}|�d|�|�d�q�|�	d|d|�|��|�|�|�|�|�
d�|����dS)N�r�r�K)
r%rr
rrr�pentrrr'�pentlr!rr#)rr$rr)rrrrr Us,




zDesigner.pentpiececCs>|d|krdS|�|�|�|�|�|d|||�dS�N�gR���Q�?)r
r!r.�r�sideZangrrrrr.ms


zDesigner.pentlcCs>|d|krdS|�|�|�|�|�|d|||�dSr/)r
rr-r1rrrr-ss


zDesigner.pentrcCsh|d|krdS|�|�|�d�|�|d�|�d�|�|d�|�d�|�|d|�dS�Nr�og{�G�z�?g�������?�g�?)r
rr&�rr2rrrrr&ys



zDesigner.tripolyrcCsh|d|krdS|�|�|�d�|�|d�|�d�|�|d�|�d�|�|d|�dSr3)r
r!r(r6rrrr(�s



zDesigner.tripolylcCs>|�|�|�|�|d|kr$dS|�|d|||�dS)Ng@g333333�?)r
r!r)r�s�arrrrr�s


zDesigner.centerpieceN)�__name__�
__module__�__qualname__rrr"r r.r-r&r(rrrrrrs

rcCs\t�}|�d�|��|���d�|���d�t�}|�|��d�t�}d||S)Nrr0zruntime: %.2f sec.)	rZspeedZ
hideturtlerZdelayr�clockrr)�tZatZetrrr�main�s
r>�__main__N)�__doc__Zturtlerr�timerr<rr>r9�msg�printrrrr�<module>suturtledemo/__pycache__/forest.cpython-38.opt-1.pyc000064400000006375151153537630016055 0ustar00U

e5d��@s�dZddlmZmZmZmZddlmZddlm	Z
dd�Zdd�Zd	d
�Z
dd
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zedkr�e�e�dS)a4     turtlegraphics-example-suite:

             tdemo_forest.py

Displays a 'forest' of 3 breadth-first-trees
similar to the one in tree.
For further remarks see tree.py

This example is a 'breadth-first'-rewrite of
a Logo program written by Erich Neuwirth. See
http://homepage.univie.ac.at/erich.neuwirth/
�)�Turtle�	colormode�tracer�mainloop��	randrange)�perf_countercCst||d�S)N�r)�n�r�)/usr/lib64/python3.8/turtledemo/forest.py�	symRandomsr
cs��fdd�|D�S)Ncs,g|]$\}}|t��|dt��f�qS)g)\��(�?)r
)�.0�angle�
sizefactor��	angledist�sizedistrr�
<listcomp>s�
�zrandomize.<locals>.<listcomp>r)�
branchlistrrrrr�	randomizes�rcCs2t|�D]$}|�t|��|�d||�qdS)Ng�?)�range�leftr
Zforward)�tZdistance�partsr�irrr�randomfdsr�
�ccs�|dkr�g}g}tt||��D]�\}	}
|	�||�|	�ddd|td�dd|td�d�|	��t|	|||�dV|
D]<\}}|	�|�|�|	�	��|�t
|
||��|	�|�q�qt||||d||||�D]
}
dVq�dS)Nr����r	)
�list�zipZpensizeZpencolorr
�pendownrr�appendZcloner�right�tree)Ztlist�size�levelZwidthfactorZbranchlistsrrZlstZbrsrrrr�xrrrr(s,�
�r(cCsLtd�|��|�d�|��|�d�|��|�||�|��dS)Nrr�Z)r�resetZspeed�
hideturtlerZpenupZsetposr%)rr+�yrrr�start7s

r0cCs2|��t|dd�t|gd|ddddgg�}|S)N�i0����P皙�����?��-g�G�z�?)r��������?�����g���Q��?�r.r0r(�r*Zpenrrrr�doit1Asr;cCs0|��t|dd�t|gd|dddgg�}|S)Niy���i~����xr3r4r7r9r:rrr�doit2Gsr=cCs2|��t|dd�t|gd|ddddgg�}|S)N�i�����dr3)r5gffffff�?)rg
ףp=
�?)r8r6r9r:rrr�doit3Msr@cCs�t�}|��tdd�tdtdd��}tdtdd��}tdtdd��}t�}d}|||fD]&}z|��Wq\|d7}Yq\Xq\|dkrNq�qNtdd	�t�}d
||S)N�Kr�r	)Zundobuffersize�r�rzruntime: %.2f sec.)rZhtrr;r=r@�clock�__next__)�p�u�sr�aZdone�brrr�mainTs$

rL�__main__N)rr)�__doc__ZturtlerrrrZrandomr�timerrEr
rrr(r0r;r=r@rL�__name__rrrr�<module>s

turtledemo/__pycache__/planet_and_moon.cpython-38.pyc000064400000006636151153537630016751 0ustar00U

e5d�@s`dZddlmZmZmZmZdZGdd�de�Z	Gdd�de�Z
dd	�Zed
kr\e�e�dS)a�       turtle-example-suite:

        tdemo_planets_and_moon.py

Gravitational system simulation using the
approximation method from Feynman-lectures,
p.9-8, using turtlegraphics.

Example: heavy central body, light planet,
very light moon!
Planet has a circular orbit, moon a stable
orbit around the planet.

You can hold the movement temporarily by
pressing the left mouse button with the
mouse over the scrollbar of the canvas.

�)�Shape�Turtle�mainloop�Vec2D�c@s$eZdZdd�Zdd�Zdd�ZdS)�GravSyscCsg|_d|_d|_dS)Nrg{�G�z�?)�planets�t�dt)�self�r�2/usr/lib64/python3.8/turtledemo/planet_and_moon.py�__init__szGravSys.__init__cCs|jD]}|��qdS)N)r�init)r�prrr
rs
zGravSys.initcCs6td�D](}|j|j7_|jD]}|��q"qdS)Ni')�ranger	r
r�step)r�irrrr
�start s
z
GravSys.startN)�__name__�
__module__�__qualname__rrrrrrr
rsrc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�StarcCsTtj||d�|��||_|�|�||_|j�|�||_|�	d�|�
�dS)N)�shape�user)rrZpenup�m�setpos�vr�append�gravSysZ
resizemodeZpendown)rr�xrrrrrr
r's

z
Star.__init__cCs,|jj}|��|_|jd||j|_dS)N��?)rr
�acc�ar�rr
rrr
r1s
z	Star.initcCsRtdd�}|jjD]:}||kr|��|��}|t|jt|�d|7}q|S)Nr�)�Vecrr�pos�Gr�abs)rr#�planetrrrr
r"5s
 zStar.acccCsj|jj}|�|��||j�|jj�|�dkrJ|�|�|jjd��|�	�|_
|j||j
|_dS)Nr)rr
rr'rr�indexZ
setheadingZtowardsr"r#r$rrr
r<s
z	Star.stepN)rrrrrr"rrrrr
r&s
rcCs|t�}|��|���dd�|��|��|�d�|�d�|��|�	dd�|�
�|��}|��|�	dd�|�
�|��}td�}|�
|d�|�
|d�|���d|�|���d	d�t�}td
tdd�tdd�|d�}|�d
�|�d�|��tdtdd�tdd�|d�}|�d�|�d�td	tdd�tdd�|d�}|�d�|�d�|��|��dS)Nr��Z�ZcompoundZorangeZbluer*�i@Bg��circleZyellowg������?i�0����Zgreeng�������?��i'r!zDone!)r�resetZ	getscreenZtracerZhtZpu�fd�ltZ
begin_polyr0Zend_polyZget_polyrZaddcomponentZregister_shaperrr&ZcolorZ	shapesizeZpencolorrr)�sZm1Zm2ZplanetshapeZgsZsunZearthZmoonrrr
�mainFsD







r8�__main__N)
�__doc__Zturtlerrrrr&r(�objectrrr8rrrrr
�<module>s 'turtledemo/__pycache__/clock.cpython-38.opt-2.pyc000064400000006272151153537630015643 0ustar00U

e5d��@s�ddlTddlmZddd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�Z	dd�Z
edkr�ed�e
�Z
ee
�e�dS)�)�*)�datetimecCs(t�t|�t|�t|�t�dS)N)Zpenup�right�forward�leftZpendown)ZdistanzZwinkel�r�(/usr/lib64/python3.8/turtledemo/clock.py�jumps
r	cCsXt|d�td�t|d�td�t|�td�t|�td�t|d�dS)Ngffffff�?�Zg@�x)�fd�rt�lt)�laenge�spitzerrr�handsrcCs>t�t|d�t�t||�t�t�}t||�dS)Ng333333�?)�resetr	Z
begin_polyrZend_polyZget_polyZregister_shape)�namerrZ	hand_formrrr�make_hand_shape"s
rcCsft�td�td�D]J}t|�|ddkrFtd�t|d�ntd�t|�td�qdS)N��<�r���)rZpensize�ranger	r�dotr
)Zradius�irrr�	clockface+s
rcCs�td�tddd�tddd�tddd�td	�t�at�d�t�d
d�t�at�d�t�dd
�t�at�d�t�dd�tttfD]&}|�	d�|�
ddd�|�d�q�t�t�a
t
��t
��t
�d�dS)N�logo�second_hand�}r�minute_hand��	hour_handr
�Zgray20Zgray80Zblue1Zred1Zblue3Zred3�user�rr�U)�moderrZTurtler �shapeZcolorr"r$Z
resizemodeZ	shapesizeZspeedZht�writerZpuZbk)rrrr�setup8s.



r,cCsdddddddg}||��S)NZMondayZTuesdayZ	WednesdayZThursdayZFridayZSaturdayZSunday)Zweekday)�t�	wochentagrrrr.Ss�r.cCsDddddddddd	d
ddg}|j}||jd
}|j}d|||fS)NzJan.zFeb.zMar.zApr.ZMayZJuneZJulyzAug.zSep.zOct.zNov.zDec.r'z%s %d %d)ZyearZmonthZday)�zZmonat�j�mr-rrr�datumXs�r2cCs�t��}|j|jd}|j|d}|j|d}z�td�t��t�	�t�
d�tjt|�ddd�t�
d�tjt|�ddd�t�
d	�td
�t�d|�t�d|�t�d|�td
�ttd
�Wntk
r�YnXdS)Ng���ư>gN@F�A�center)ZCourier�Zbold)ZalignZfont�r(Tr��d)rZtoday�secondZmicrosecond�minuteZhour�tracerr+�clear�homer�writer.Zbackr2r Z
setheadingr"r$Zontimer�tickZ
Terminator)r-Zsekunder:Zstunderrrr?`s6

�

�
r?cCs td�t�td�t�dS)NFTZ	EVENTLOOP)r;r,r?rrrr�mainys
r@�__main__rN)r)Zturtlerr	rrrr,r.r2r?r@�__name__r)�msg�printZmainlooprrrr�<module>
s
	
turtledemo/__pycache__/round_dance.cpython-38.opt-2.pyc000064400000002427151153537630017027 0ustar00U

e5d�@s4ddlTdd�Zdd�Zedkr0ee��e�dS)�)�*cCsdadS)NF)�running�rr�./usr/lib64/python3.8/turtledemo/round_dance.py�stopsrcCs�t�td�td�td�d}d}d}d}td�}td	�D]D}t|�t�}||9}||9}t|�|�	||d
d|fd�q>t
d|�td�td�t�td
d�g}td�D]:}t
d�td�td�t�|dd
kr�|�t��q�t�datt�t�d}t�r�d}	|D]6}
|
�
d�|
�d�|
�|	�|	d
k�rPdnd}	�q |dk�rztd�t|�|d9}t��qdS)NZgray10FZtriangleg}�R��c�?g���y!"@��Zcompound�
g�?ZblackZmultitriri8����������T�g�G�z�?zDONE!)ZclearscreenZbgcolorZtracer�shapeZShape�rangeZ	shapesizeZ
get_shapepolyZtiltZaddcomponentZregister_shapeZpuZsetpos�fd�lt�update�appendZclone�homerZ
onkeypressrZlisten�right)�fZphi�s�cZsh�i�pZdancersZcsZtaZdancerrrr�mains^







r�__main__N)Zturtlerr�__name__�printZmainlooprrrr�<module>s
5
turtledemo/__pycache__/two_canvases.cpython-38.pyc000064400000002362151153537630016300 0ustar00U

e5d_�@s:dZddlmZmZmZdd�Zedkr6e�e��dS)z�turtledemo.two_canvases

Use TurtleScreen and RawTurtle to draw on two
distinct canvases in a separate window. The
new window must be separately closed in
addition to pressing the STOP button.
�)�TurtleScreen�	RawTurtle�TKc	CsNt��}tj|dddd�}tj|dddd�}|��|��t|�}|�ddd�t|�}|�ddd�t|�}t|�}|�dd	�|�d
�|�dd�|�d
�||fD]}|�	d
�|�
d�q�|�
d�||fD]}|��q�td�D]&}||fD]}|�
d�|�
d�q�q�||fD]*}|��|�
d�|��|�d��qdS)Ni,��z#ddffff)�widthZheightZbgz#ffeeee�333333�?�Zred)rrr�Zblue)rrr�turtle�$���2�H�6Z	EVENTLOOP)rZTkZCanvasZpackrZbgcolorrZcolorr�shape�ltZ
begin_fill�range�fdZend_fillZpuZbk)	�rootZcv1Zcv2�s1�s2�p�q�t�i�r�//usr/lib64/python3.8/turtledemo/two_canvases.py�mains>






r�__main__N)�__doc__r
rrrr�__name__Zmainlooprrrr�<module>s
)turtledemo/__pycache__/paint.cpython-38.opt-2.pyc000064400000001735151153537630015662 0ustar00U

e5d
�@sDddlTd
dd�Zddd�Zdd�Zedkr@e�Zee�e�d	S)�)�*cCs(t�drt�t�nt�t�dS)NZpendown)ZpenZend_fillZupZdownZ
begin_fill��x�y�r�(/usr/lib64/python3.8/turtledemo/paint.py�switchupdowns

rcCs(tdd�tdd�attd�dS)N�r)�colors�colorrrrr�changecolor srcCs`td�td�td�td�ddddgattd	�t�ttd
�tt	d�ttd�dS)
NZcircle�userg�?�ZredZgreenZblueZyellowrr	�Z	EVENTLOOP)
�shapeZ
resizemodeZ	shapesize�widthr
rrZ
onscreenclickZgotorrrrr�main%s


r�__main__N)rr)rr)Zturtlerrr�__name__�msg�printZmainlooprrrr�<module>s

turtledemo/__pycache__/colormixer.cpython-38.pyc000064400000003434151153537630015770 0ustar00U

e5d;�@sTddlmZmZmZGdd�de�Zdd�Zdd�ZedkrPe�Ze	e�e�d	S)
�)�Screen�Turtle�mainloopc@seZdZdd�Zdd�ZdS)�ColorTurtlecCs�t�|�|�d�|�d�|�ddd�|�d�dddg|_||_||j|<|�|j�|�	d�|�
d�|��|�|d�|�
�|�d�|��|�|�|�d	�|�|j�dS)
N�turtle�user���
r�Z�Zgray25)r�__init__�shapeZ
resizemodeZ	shapesizeZpensize�_color�xZcolorZspeed�left�pu�gotoZpd�setyZpencolorZondrag�shift��selfr�y�r�-/usr/lib64/python3.8/turtledemo/colormixer.pyr
s&









zColorTurtle.__init__cCs<|�tdt|d���|��|j|j<|�|j�t�dS)Nrr)r�max�min�ycorrrZ	fillcolor�
setbgcolorrrrrrszColorTurtle.shiftN)�__name__�
__module__�__qualname__r
rrrrrrsrcCst�t��t��t���dS)N)�screenZbgcolor�redr�green�bluerrrrr"srcCszt�at�d�t�dddd�tdd�atdd�atdd�at�t	�}|�
�|��|�dd	�|j
d
ddd
�dS)Nr���g333333ӿrg�������?g�?r�gffffff�?zDRAG!�center)ZArial�)ZboldZitalic)ZalignZfontZ	EVENTLOOP)rr"ZdelayZsetworldcoordinatesrr#r$r%rrZhtrr�write)�writerrrr�main%s



r,�__main__N)
rrrrrrr,r�msg�printrrrr�<module>sturtledemo/__pycache__/sorting_animate.cpython-38.pyc000064400000014342151153537630016770 0ustar00U

��.e��@s�dZddlTddlZGdd�de�ZGdd�de�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zd%dd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"Zd#Zed$kr�e�Ze�dS)&a�

         sorting_animation.py

A minimal sorting algorithm animation:
Sorts a shelf of 10 blocks using insertion
sort, selection sort and quicksort.

Shelfs are implemented using builtin lists.

Blocks are turtles with shape "square", but
stretched to rectangles by shapesize()
 ---------------------------------------
       To exit press space button
 ---------------------------------------
�)�*Nc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�BlockcCsF||_tj|ddd�|��|�|ddd�|�d�|��dS)NZsquareF)�shapeZvisibleg�?��black)�size�Turtle�__init__Zpu�	shapesize�	fillcolor�st)�selfr�r�2/usr/lib64/python3.8/turtledemo/sorting_animate.pyr	s
zBlock.__init__cCs|�d�dS)NZred�r�r
rrr�glowsz
Block.glowcCs|�d�dS)Nrrrrrr�unglow"szBlock.unglowcCsd�|j�S)NzBlock size: {0})�formatrrrrr�__repr__%szBlock.__repr__N)�__name__�
__module__�__qualname__r	rrrrrrrrsrc@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�ShelfcCs||_d|_dS)z.create a shelf. y is y-position of first blockij���N)�y�x)r
rrrrr	+szShelf.__init__cCsP|��\}}}|dd}|�|j|�|�|jdt|��|�|�dS)Nr��")r
�setyr�setxr�len�append)r
�d�width�_�y_offsetrrr�push0s
z
Shelf.pushcCs0||d�D]}|��\}}|�|d�qdS�Nr��posr�r
�i�bZxposr$rrr�_close_gap_from_i8szShelf._close_gap_from_icCs0||d�D]}|��\}}|�|d�qdSr'r(r*rrr�_open_gap_from_i=szShelf._open_gap_from_icCs,t�||�}|��|�d�|�|�|S)N��)�list�poprrr-)r
�keyr,rrrr1Bs


z	Shelf.popcCsb|�|�t�|||�|�|jd|�|��\}}}|dd}|�|j|�|��dS)Nrrr)	r.r0�insertrrr
rrr)r
r2r,r#r$r%rrrr3Is
zShelf.insertN)	rrrr	r&r-r.r1r3rrrrr)srcCs\t|�}td|�D]D}|}|dkrD||j||djkrD|d}q|�||�|��qdS)N�r�r �rangerr3r1)�shelf�lengthr+Zholerrr�isortSs 
r9cCsjt|�}td|d�D]N}|}t|d|�D]}||j||jkr,|}q,||kr|�||�|��qdS)Nrr4r5)r7r8�jZiminr+rrr�ssort\sr;cCsn||}|�||�|��|}t||�D].}||j|jkr(|�||�|��|d}q(|�||�|��|S�Nr4)r3r1r6r)r7�left�right�pivot_indexZpivotZstore_indexr+rrr�	partitionfs
r@cCs>||kr:|}t||||�}t|||d�t||d|�dSr<)r@�qsort)r7r=r>r?Zpivot_new_indexrrrrAqs
rAcCs�t�t�ttd��}t�|�t|�D]@\}}t|tt��D](}t|j	|dkr@t�
|t�|��q@q*tt
�ttdd�t�dS)N�
r4��line)�disable_keys�clearr0r6�randomZshuffle�	enumerater �srr3r1�	show_text�
instructions1�
instructions2�enable_keys)�targetr+�tr:rrr�	randomizexs
rPcCs(d|}tdd|�t|ddd�dS)Nrri����center)ZCourier�Zbold)ZalignZfont)Zgoto�write)�textrDrrrrJ�srJcCs@t�t�td�tt�t�tt�ttdd�t�dS)NzSelection Sortr4rC)rErFrJr;rIrKrLrMrrrr�start_ssort�srUcCs@t�t�td�tt�t�tt�ttdd�t�dS)NzInsertion Sortr4rC)rErFrJr9rIrKrLrMrrrr�start_isort�srVcCsLt�t�td�ttdtt�d�t�tt�ttdd�t�dS)NZ	Quicksortrr4rC)	rErFrJrArIr rKrLrMrrrr�start_qsort�srWcCs(td�ad}|D]}t�t|��qdS)Ni8���)
�r��	r4�rB���)rrIr&r)Zvalsr+rrr�
init_shelf�sr_cCs,tdd�tdd�tdd�tdd�dS)NrIr+�q�r)�onkeyrrrrrE�s


rEcCs6ttd�ttd�ttd�ttd�ttd�dS)Nr+rIr`raZspace)rbrVrUrWrPZbyerrrrrM�s




rMcCs@t���t�t�t�tt�ttdd�t�t	�dS)Nr4rCZ	EVENTLOOP)
Z	getscreenZclearscreenZhtZpenupr_rJrKrLrMZlistenrrrr�main�s
rczApress i for insertion sort, s for selection sort, q for quicksortz spacebar to quit, r to randomize�__main__)r)�__doc__ZturtlerGrrr0rr9r;r@rArPrJrUrVrWr_rErMrcrKrLr�msgZmainlooprrrr�<module>s,*	





turtledemo/__pycache__/yinyang.cpython-38.opt-1.pyc000064400000002055151153537630016220 0ustar00U

e5d4�@s4dZddlTdd�Zdd�Zedkr0e�e�dS)	z�       turtle-example-suite:

            tdemo_yinyang.py

Another drawing suitable as a beginner's
programming example.

The small circles are drawn by the circle
command.

�)�*cCs�td�td|�t�t|dd�t|d�td�t|dd�t�td�t�t|d�td�t	�t||�t�t|d�t�td�t�t
|d�t	�td�dS)N��blackg@��Zgffffff�?g333333�?)�widthZcolorZ
begin_fillZcircle�leftZend_fillZupZforward�rightZdownZbackward)ZradiusZcolor1Zcolor2�r
�*/usr/lib64/python3.8/turtledemo/yinyang.py�yins,


rcCs(t�tddd�tddd�t�dS)N��rZwhitezDone!)�resetrZhtr
r
r
r�main(s
r�__main__N)�__doc__Zturtlerr�__name__Zmainloopr
r
r
r�<module>sturtledemo/__pycache__/clock.cpython-38.pyc000064400000006645151153537630014707 0ustar00U

e5d��@s�dZddlTddlmZddd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�Zedkr�e
d�e�Zee�e�dS)z�       turtle-example-suite:

             tdemo_clock.py

Enhanced clock-program, showing date
and time
  ------------------------------------
   Press STOP to exit the program!
  ------------------------------------
�)�*)�datetimecCs(t�t|�t|�t|�t�dS)N)Zpenup�right�forward�leftZpendown)ZdistanzZwinkel�r�(/usr/lib64/python3.8/turtledemo/clock.py�jumps
r	cCsXt|d�td�t|d�td�t|�td�t|�td�t|d�dS)Ngffffff�?�Zg@�x)�fd�rt�lt)�laenge�spitzerrr�handsrcCs>t�t|d�t�t||�t�t�}t||�dS)Ng333333�?)�resetr	Z
begin_polyrZend_polyZget_polyZregister_shape)�namerrZ	hand_formrrr�make_hand_shape"s
rcCsft�td�td�D]J}t|�|ddkrFtd�t|d�ntd�t|�td�qdS)N��<�r���)rZpensize�ranger	r�dotr
)Zradius�irrr�	clockface+s
rcCs�td�tddd�tddd�tddd�td	�t�at�d�t�d
d�t�at�d�t�dd
�t�at�d�t�dd�tttfD]&}|�	d�|�
ddd�|�d�q�t�t�a
t
��t
��t
�d�dS)N�logo�second_hand�}r�minute_hand��	hour_handr
�Zgray20Zgray80Zblue1Zred1Zblue3Zred3�user�rr�U)�moderrZTurtler �shapeZcolorr"r$Z
resizemodeZ	shapesizeZspeedZht�writerZpuZbk)rrrr�setup8s.



r,cCsdddddddg}||��S)NZMondayZTuesdayZ	WednesdayZThursdayZFridayZSaturdayZSunday)Zweekday)�t�	wochentagrrrr.Ss�r.cCsDddddddddd	d
ddg}|j}||jd
}|j}d|||fS)NzJan.zFeb.zMar.zApr.ZMayZJuneZJulyzAug.zSep.zOct.zNov.zDec.r'z%s %d %d)ZyearZmonthZday)�zZmonat�j�mr-rrr�datumXs�r2cCs�t��}|j|jd}|j|d}|j|d}z�td�t��t�	�t�
d�tjt|�ddd�t�
d�tjt|�ddd�t�
d	�td
�t�d|�t�d|�t�d|�td
�ttd
�Wntk
r�YnXdS)Ng���ư>gN@F�A�center)ZCourier�Zbold)ZalignZfont�r(Tr��d)rZtoday�secondZmicrosecond�minuteZhour�tracerr+�clear�homer�writer.Zbackr2r Z
setheadingr"r$Zontimer�tickZ
Terminator)r-Zsekunder:Zstunderrrr?`s6

�

�
r?cCs td�t�td�t�dS)NFTZ	EVENTLOOP)r;r,r?rrrr�mainys
r@�__main__rN)r)�__doc__Zturtlerr	rrrr,r.r2r?r@�__name__r)�msg�printZmainlooprrrr�<module>s 

	
turtledemo/__pycache__/colormixer.cpython-38.opt-2.pyc000064400000003434151153537630016730 0ustar00U

e5d;�@sTddlmZmZmZGdd�de�Zdd�Zdd�ZedkrPe�Ze	e�e�d	S)
�)�Screen�Turtle�mainloopc@seZdZdd�Zdd�ZdS)�ColorTurtlecCs�t�|�|�d�|�d�|�ddd�|�d�dddg|_||_||j|<|�|j�|�	d�|�
d�|��|�|d�|�
�|�d�|��|�|�|�d	�|�|j�dS)
N�turtle�user���
r�Z�Zgray25)r�__init__�shapeZ
resizemodeZ	shapesizeZpensize�_color�xZcolorZspeed�left�pu�gotoZpd�setyZpencolorZondrag�shift��selfr�y�r�-/usr/lib64/python3.8/turtledemo/colormixer.pyr
s&









zColorTurtle.__init__cCs<|�tdt|d���|��|j|j<|�|j�t�dS)Nrr)r�max�min�ycorrrZ	fillcolor�
setbgcolorrrrrrszColorTurtle.shiftN)�__name__�
__module__�__qualname__r
rrrrrrsrcCst�t��t��t���dS)N)�screenZbgcolor�redr�green�bluerrrrr"srcCszt�at�d�t�dddd�tdd�atdd�atdd�at�t	�}|�
�|��|�dd	�|j
d
ddd
�dS)Nr���g333333ӿrg�������?g�?r�gffffff�?zDRAG!�center)ZArial�)ZboldZitalic)ZalignZfontZ	EVENTLOOP)rr"ZdelayZsetworldcoordinatesrr#r$r%rrZhtrr�write)�writerrrr�main%s



r,�__main__N)
rrrrrrr,r�msg�printrrrr�<module>sturtledemo/__pycache__/peace.cpython-38.opt-2.pyc000064400000001576151153537630015627 0ustar00U

e5d)�@s(ddlTdd�Zedkr$e�e�dS)�)�*cCs
d}t�t�t�tdd�td�|D]@}t|�t�td�t�td�t	d�td�t
d�q,td�td	�td
d�t�td�t	d�td
�t�t	d�td�t
d�t�td�t�td�t	d�t�td�t�td
d�dS)N)Zred3ZorangeZyellowZ	seagreen4Zorchid4Z
royalblue1Zdodgerblue4i����i=����Fi��Z�B�ZwhiteriV����iT��-i,zDone!)�resetZScreenZupZgoto�widthZcolorZdownZforwardZbackward�left�rightZcircle)ZpeacecolorsZpcolor�r�(/usr/lib64/python3.8/turtledemo/peace.py�mainsH



r�__main__N)Zturtler�__name__Zmainlooprrrr�<module>s-turtledemo/__pycache__/fractalcurves.cpython-38.opt-2.pyc000064400000005017151153537630017410 0ustar00U

e5d�
�@sPddlTddlmZmZGdd�de�Zdd�ZedkrLe�Z	e
e	�e�dS)	�)�*)�sleep�perf_counterc@s$eZdZdd�Zdd�Zdd�ZdS)�CurvesTurtlecCs�|dkrdS|�|d�|�||d|�|�|�|�|d�|�||d|�|�|�|�||d|�|�|d�|�|�|�||d|�|�|d�dS)Nr�Z�)�left�hilbertZforward�right)�self�size�levelZparity�r�0/usr/lib64/python3.8/turtledemo/fractalcurves.pyr	s


zCurvesTurtle.hilbertcCs�ddl}d||�|j|�}|��|�|�|��|�dd|d|�t|�D] }|�|||�|�d|�q\|�	dd|d|�|��|�
|�|��dS)Nr��rih)�mathZsinZpi�pu�fd�pd�rt�range�fractal�ltZbk)r�nZradZlev�dirrZedge�irrr�
fractalgon/s

zCurvesTurtle.fractalgoncCs�|dkr|�|�dS|�|d|d|�|�d|�|�|d|d|�|�d|�|�|d|d|�|�d|�|�|d|d|�dS)Nr��<�x)rrrr)rZdistZdepthrrrrrBs
zCurvesTurtle.fractalN)�__name__�
__module__�__qualname__r	rrrrrrrsrcCs�t�}|��|�d�|��|���dd�|��d}|�d|d|�|��t	�}|�
d�|��|�|�|�
|dd�|�|�td�D]$}|�d�|�|d	|d
�q�|��td
�D]}|�|�|�d�q�|��td�D]$}|�|d|d
�|�d�q�|��t	�}d
||}td�|��|�d�|��|���dd�t	�}|�dd�|��|�dddd�|��|��|�d�|�dddd�|��t	�}|d||7}|S)Nrr�i���i��Zredrr�@r��BzHilbert: %.2fsec. ZblackZblue������zKoch: %.2fsec.)r�resetZspeedZhtZ	getscreenZtracerrZsetposr�clockZ	fillcolorZ
begin_fillrr	rrrZend_fillrZcolorr)ZftrZtar�tb�resrrr�mainNs\







r/�__main__N)Zturtle�timerrr,ZPenrr/r!�msg�printZmainlooprrrr�<module>s=9turtledemo/__pycache__/__main__.cpython-38.opt-1.pyc000064400000031532151153537630016264 0ustar00U

��.e�7�@sdZddlZddlZddlTddlmZmZddlmZddl	m
Z
ddlmZddl
Z
ej�ej�e��ZejdkZd	Zd
ZdZdZd
ZddefZdZdddgZdZdZdddddddddddgZ dd �Z!d!efd"efd#e
jffZ"Gd$d%�d%e#�Z$d&d'�Z%e&d(k�re%�dS))a�
  ----------------------------------------------
      turtleDemo - Help
  ----------------------------------------------

  This document has two sections:

  (1) How to use the demo viewer
  (2) How to add your own demos to the demo repository


  (1) How to use the demo viewer.

  Select a demoscript from the example menu.
  The (syntax colored) source code appears in the left
  source code window. IT CANNOT BE EDITED, but ONLY VIEWED!

  The demo viewer windows can be resized. The divider between text
  and canvas can be moved by grabbing it with the mouse. The text font
  size can be changed from the menu and with Control/Command '-'/'+'.
  It can also be changed on most systems with Control-mousewheel
  when the mouse is over the text.

  Press START button to start the demo.
  Stop execution by pressing the STOP button.
  Clear screen by pressing the CLEAR button.
  Restart by pressing the START button again.

  SPECIAL demos, such as clock.py are those which run EVENTDRIVEN.

      Press START button to start the demo.

      - Until the EVENTLOOP is entered everything works
      as in an ordinary demo script.

      - When the EVENTLOOP is entered, you control the
      application by using the mouse and/or keys (or it's
      controlled by some timer events)
      To stop it you can and must press the STOP button.

      While the EVENTLOOP is running, the examples menu is disabled.

      - Only after having pressed the STOP button, you may
      restart it or choose another example script.

   * * * * * * * *
   In some rare situations there may occur interferences/conflicts
   between events concerning the demo script and those concerning the
   demo-viewer. (They run in the same process.) Strange behaviour may be
   the consequence and in the worst case you must close and restart the
   viewer.
   * * * * * * * *


   (2) How to add your own demos to the demo repository

   - Place the file in the same directory as turtledemo/__main__.py
     IMPORTANT! When imported, the demo should not modify the system
     by calling functions in other modules, such as sys, tkinter, or
     turtle. Global variables should be initialized in main().

   - The code must contain a main() function which will
     be executed by the viewer (see provided example scripts).
     It may return a string which will be displayed in the Label below
     the source code window (when execution has finished.)

   - In order to run mydemo.py by itself, such as during development,
     add the following at the end of the file:

    if __name__ == '__main__':
        main()
        mainloop()  # keep window open

    python -m turtledemo.mydemo  # will then run it

   - If the demo is EVENT DRIVEN, main must return the string
     "EVENTLOOP". This informs the demo viewer that the script is
     still running and must be stopped by the user!

     If an "EVENTLOOP" demo runs by itself, as with clock, which uses
     ontimer, or minimal_hanoi, which loops by recursion, then the
     code should catch the turtle.Terminator exception that will be
     raised when the user presses the STOP button.  (Paint is not such
     a demo; it only acts in response to mouse clicks and movements.)
�N)�*)�ColorDelegator�color_config)�
Percolator)�	view_text)�__doc__�darwin������Arial�)rrZboldzLucida Console�
�normal��d��	�������cCsdd�t�t�D�S)NcSs.g|]&}|�d�r|ddkr|dd��qS)z.pyr�_N���)�endswith)�.0�entry�r"�+/usr/lib64/python3.8/turtledemo/__main__.py�
<listcomp>ts
�z%getExampleEntries.<locals>.<listcomp>)�os�listdir�demo_dirr"r"r"r#�getExampleEntriesssr(zTurtledemo helpzAbout turtledemozAbout turtle modulec@s�eZdZd(dd�Zdd�Zdd�Zdd	�Zd
d�Zd)dd
�Zd*dd�Z	dd�Z
d+dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�ZdS),�
DemoWindowNc	CsJt�|_}t_|�d�|�d|j�trbddl}|j	ddddd�
t���ddg|j
|j
d	�|jdd
d�|jdd
d�|jd
dd
d
�|jddd
d
�|jddd
d
�t|tdd�|_|jj|�|j�ddd�|jj|�|j�ddd�|jj|�|j�ddd�|j|d<ttdtdd�}|�|�|��|�|�|��|jdddd�t|d
ddddtd�|_ t!|d t"d!d"|j#d#�|_$t!|d$t"d!d"|j%d#�|_&t!|d%t"d!d"|j'd#�|_(|j jd
ddd&d'�|j$jd
d
d(d)�|j&jd
dd(d)�|j(jd
dd(d)�t)|j*��+t,��d*|_-d*|_.|�r.|�/|�|�0t1t1t1d+d,�t2|_3dS)-NzPython turtle-graphics examplesZWM_DELETE_WINDOWrZ	osascriptz-ez tell application "System Events"z>set frontmost of the first process whose unix id is {} to truezend tell)�stderr�stdoutr	)�weight�Z)Zminsizer,r
r)�relief�borderwidthZExamples)�menu�label�	underlineZFontsizeZHelpr0r
z#ddd)�orientZ	sashwidthZ
sashrelief�bgrZnews)�rowZ
columnspan�stickyz --- z#ddf)r�r)Zheight�textr4�fontr/r.z START Zwhitez#fed)r8r9�fgZdisabledforeground�commandz STOP z CLEAR )rr
)r5�columnr6�padxZew)r5r<r6FzChoose example from menu�black)4ZTk�root�turtle�_root�titleZwm_protocol�_destroyr�
subprocess�run�formatr%�getpidZDEVNULLZgrid_rowconfigureZgrid_columnconfigure�MenuZRAISEDZmBarZadd_cascade�makeLoadDemoMenu�makeFontMenu�makeHelpMenuZPanedWindow�
HORIZONTALZSOLID�add�
makeTextFrame�makeGraphFrameZgridZLabelZRIDGE�
output_lblZButton�btnfont�	startDemo�	start_btn�stopIt�stop_btn�clearCanvas�	clear_btnrr8Zinsertfilterr�dirty�exitflag�loadfile�	configGUI�DISABLED�STARTUP�state)�self�filenamer?rDZpaner"r"r#�__init__�s�
������
�
����

�zDemoWindow.__init__cCsP|j��}|j��}|j�d|j||j�|j�d|j||j�dS)Ng�?)�_canvasZwinfo_widthZwinfo_heightZxview_moveto�	canvwidthZyview_moveto�
canvheight)r_�eventZcwidthZcheightr"r"r#�onResize�s

zDemoWindow.onResizecCs6t|�|_}t|ddddd�|_}t|�t|dd�|_}|j|d<|jt	t
d	�t|d
td�|_}|j
|d<|jttd	�|j|d<|j|d
<tt�|d<tr�dnd}|�d||j�|�d||j�|�d||j�|�d||j�|�d|j�|�d|j�|�d|j�|jt	tdd�|S)Nr8r
Znone�-)�namer=Zwrap�width�vbar)rhr;)�side�fill�hbar)rhr3ZyscrollcommandZxscrollcommandr9ZCommandZControlz
<%s-minus>z<%s-underscore>z
<%s-equal>z	<%s-plus>z<Control-MouseWheel>z<Control-Button-4>z<Control-Button-5>r	)rkrl�expand)ZFrame�
text_frameZTextr8rZ	ScrollbarrjZyviewZpackZLEFT�YrLrmZxviewZBOTTOM�X�set�tuple�txtfontrZbind_all�
decrease_size�
increase_size�bind�update_mousewheelZBOTH)r_r?ror8rjrmZshortcutr"r"r#rN�s2�



zDemoWindow.makeTextFramecCs�|tj_d|_d|_t�|dd|j|j�tj_|_}|��|j�	d|j
�d|jd<t��|_}tj
�||j�|j|_|gtj_|S)Ni�i iXz<Configure>rr/)r@Z_ScreenrArcrdZScrolledCanvasrbZ
adjustScrollsZ_rootwindowrwrfZScreen�screen�TurtleScreenra�scanvasZ	RawTurtleZscreens)r_r?ZcanvasZ_s_r"r"r#rO�s$�

zDemoWindow.makeGraphFramecCs(|td<tt�|jd<d||jd<dS)Nr	r9zFont size %dr8)rtrsr8rP)r_�sizer"r"r#�set_txtsize�szDemoWindow.set_txtsizecCs|�ttddt��dS�Nr	�break)r}�maxrt�MINIMUM_FONT_SIZE�r_Zdummyr"r"r#ru�szDemoWindow.decrease_sizecCs|�ttddt��dSr~)r}�minrt�MAXIMUM_FONT_SIZEr�r"r"r#rvszDemoWindow.increase_sizecCs$|jdktkr|��S|��SdS)Nr)Zdeltarrurv)r_rer"r"r#rxszDemoWindow.update_mousewheel��bluecCsh|jj||tkrdndd�|jj||tkr0dndd�|jj||tkrLdndd�|jj||d�dS)Nz#d00z#fca)r^r4)r8r:)rS�config�NORMALrUrWrP)r_�start�stop�clearZtxtZcolorr"r"r#r[s���zDemoWindow.configGUIcs:t|�}t�D]&}|f�fdd�	}|j|dt|d�q|S)Ncs��|�dS�N)rZ)r!�r_r"r#�loadsz)DemoWindow.makeLoadDemoMenu.<locals>.loadr�r1r2r9r;)rHr(�add_command�menufont)r_�masterr0r!r�r"r�r#rIs
�zDemoWindow.makeLoadDemoMenucsht|�}|jd�jtd�|jd�jtd�|��tD]*}|f�fdd�	}|jt|�dt|d�q8|S)NzDecrease (C-'-'))r1r;r9zIncrease (C-'+')cs��|�dSr�)r})r|r�r"r#�resize(sz'DemoWindow.makeFontMenu.<locals>.resizerr�)rHr�rur�rvZ
add_separator�
font_sizes�str)r_r�r0r|r�r"r�r#rJs
�
��zDemoWindow.makeFontMenucs<t|�}tD]*\}}||f�fdd�	}|j|t|d�q|S)Ncst�j||�dSr�)rr?)�
help_label�	help_filer�r"r#�show2sz%DemoWindow.makeHelpMenu.<locals>.show)r1r9r;)rH�help_entriesr�r�)r_r�r0r�r�r�r"r�r#rK.s
zDemoWindow.makeHelpMenucCs|jr|j��d|_dS�NF)rXryr�r�r"r"r#�
refreshCanvas7s
zDemoWindow.refreshCanvasc	Cs�|��dtj_d|}t|�tj||_t|jj	d��}|�
�}W5QRX|j�dd�|j�
d|�|j�|d�|�tttdd�t|_dS)	NFzturtledemo.�rz1.0�endz# - a Python turtle graphics examplezPress start button�red)rVr@rz�_RUNNING�
__import__�sys�modules�module�open�__file__�readr8�delete�insertr?rBr[r�r\�READYr^)r_r`�modname�f�charsr"r"r#rZ<s
�zDemoWindow.loadfilecCs�|��d|_dtj_|�tttdd�|j�	�|j�
d�t|_z$|j
��}|dkr`t|_nt|_Wn0tjk
r�|jdkr�YdSt|_d}YnX|jtkr�|�ttt|�n"|jtkr�d|_|�tttdd�dS)	NTzdemo running...r>ZstandardZ	EVENTLOOPzstopped!zuse mouse/keys or STOPr�)r�rXr@rzr�r[r\r�ryr��mode�RUNNINGr^r��main�EVENTDRIVEN�DONEZ
Terminatorr?rY)r_�resultr"r"r#rRKs<
�






�

�zDemoWindow.startDemocCs4|��|j�d�|jjdd�|�ttt�dS)N�allr�)Zcursor)r�ryZ_deleter{r�r[r�r\r�r"r"r#rVhszDemoWindow.clearCanvascCs2|jr&|��d|_|�tttdd�dtj_dS)NFzSTOPPED!r�)rYrVr[r�r\r@rzr�r�r"r"r#rTns
�zDemoWindow.stopItcCsdtj_|j��d|_dSr�)r@rzr�r?Zdestroyr�r"r"r#rCvs
zDemoWindow._destroy)N)N)N)r�r�)�__name__�
__module__�__qualname__rarfrNrOr}rurvrxr[rIrJrKr�rZrRrVrTrCr"r"r"r#r)s$
D


	
	r)cCst�}|j��dSr�)r)r?Zmainloop)Zdemor"r"r#r�|sr��__main__)'rr�r%ZtkinterZidlelib.colorizerrrZidlelib.percolatorrZidlelib.textviewrZ
turtledemoZabout_turtledemor@�path�dirname�abspathr�r'�platformrr]r�r�r�r�r�r�rQrtr�r�r�r(r��objectr)r�r�r"r"r"r#�<module>s>U


�~
turtledemo/__pycache__/sorting_animate.cpython-38.opt-1.pyc000064400000014342151153537630017727 0ustar00U

��.e��@s�dZddlTddlZGdd�de�ZGdd�de�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zd%dd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"Zd#Zed$kr�e�Ze�dS)&a�

         sorting_animation.py

A minimal sorting algorithm animation:
Sorts a shelf of 10 blocks using insertion
sort, selection sort and quicksort.

Shelfs are implemented using builtin lists.

Blocks are turtles with shape "square", but
stretched to rectangles by shapesize()
 ---------------------------------------
       To exit press space button
 ---------------------------------------
�)�*Nc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�BlockcCsF||_tj|ddd�|��|�|ddd�|�d�|��dS)NZsquareF)�shapeZvisibleg�?��black)�size�Turtle�__init__Zpu�	shapesize�	fillcolor�st)�selfr�r�2/usr/lib64/python3.8/turtledemo/sorting_animate.pyr	s
zBlock.__init__cCs|�d�dS)NZred�r�r
rrr�glowsz
Block.glowcCs|�d�dS)Nrrrrrr�unglow"szBlock.unglowcCsd�|j�S)NzBlock size: {0})�formatrrrrr�__repr__%szBlock.__repr__N)�__name__�
__module__�__qualname__r	rrrrrrrrsrc@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�ShelfcCs||_d|_dS)z.create a shelf. y is y-position of first blockij���N)�y�x)r
rrrrr	+szShelf.__init__cCsP|��\}}}|dd}|�|j|�|�|jdt|��|�|�dS)Nr��")r
�setyr�setxr�len�append)r
�d�width�_�y_offsetrrr�push0s
z
Shelf.pushcCs0||d�D]}|��\}}|�|d�qdS�Nr��posr�r
�i�bZxposr$rrr�_close_gap_from_i8szShelf._close_gap_from_icCs0||d�D]}|��\}}|�|d�qdSr'r(r*rrr�_open_gap_from_i=szShelf._open_gap_from_icCs,t�||�}|��|�d�|�|�|S)N��)�list�poprrr-)r
�keyr,rrrr1Bs


z	Shelf.popcCsb|�|�t�|||�|�|jd|�|��\}}}|dd}|�|j|�|��dS)Nrrr)	r.r0�insertrrr
rrr)r
r2r,r#r$r%rrrr3Is
zShelf.insertN)	rrrr	r&r-r.r1r3rrrrr)srcCs\t|�}td|�D]D}|}|dkrD||j||djkrD|d}q|�||�|��qdS)N�r�r �rangerr3r1)�shelf�lengthr+Zholerrr�isortSs 
r9cCsjt|�}td|d�D]N}|}t|d|�D]}||j||jkr,|}q,||kr|�||�|��qdS)Nrr4r5)r7r8�jZiminr+rrr�ssort\sr;cCsn||}|�||�|��|}t||�D].}||j|jkr(|�||�|��|d}q(|�||�|��|S�Nr4)r3r1r6r)r7�left�right�pivot_indexZpivotZstore_indexr+rrr�	partitionfs
r@cCs>||kr:|}t||||�}t|||d�t||d|�dSr<)r@�qsort)r7r=r>r?Zpivot_new_indexrrrrAqs
rAcCs�t�t�ttd��}t�|�t|�D]@\}}t|tt��D](}t|j	|dkr@t�
|t�|��q@q*tt
�ttdd�t�dS)N�
r4��line)�disable_keys�clearr0r6�randomZshuffle�	enumerater �srr3r1�	show_text�
instructions1�
instructions2�enable_keys)�targetr+�tr:rrr�	randomizexs
rPcCs(d|}tdd|�t|ddd�dS)Nrri����center)ZCourier�Zbold)ZalignZfont)Zgoto�write)�textrDrrrrJ�srJcCs@t�t�td�tt�t�tt�ttdd�t�dS)NzSelection Sortr4rC)rErFrJr;rIrKrLrMrrrr�start_ssort�srUcCs@t�t�td�tt�t�tt�ttdd�t�dS)NzInsertion Sortr4rC)rErFrJr9rIrKrLrMrrrr�start_isort�srVcCsLt�t�td�ttdtt�d�t�tt�ttdd�t�dS)NZ	Quicksortrr4rC)	rErFrJrArIr rKrLrMrrrr�start_qsort�srWcCs(td�ad}|D]}t�t|��qdS)Ni8���)
�r��	r4�rB���)rrIr&r)Zvalsr+rrr�
init_shelf�sr_cCs,tdd�tdd�tdd�tdd�dS)NrIr+�q�r)�onkeyrrrrrE�s


rEcCs6ttd�ttd�ttd�ttd�ttd�dS)Nr+rIr`raZspace)rbrVrUrWrPZbyerrrrrM�s




rMcCs@t���t�t�t�tt�ttdd�t�t	�dS)Nr4rCZ	EVENTLOOP)
Z	getscreenZclearscreenZhtZpenupr_rJrKrLrMZlistenrrrr�main�s
rczApress i for insertion sort, s for selection sort, q for quicksortz spacebar to quit, r to randomize�__main__)r)�__doc__ZturtlerGrrr0rr9r;r@rArPrJrUrVrWr_rErMrcrKrLr�msgZmainlooprrrr�<module>s,*	





turtledemo/__pycache__/two_canvases.cpython-38.opt-2.pyc000064400000002040151153537630017231 0ustar00U

e5d_�@s6ddlmZmZmZdd�Zedkr2e�e��dS)�)�TurtleScreen�	RawTurtle�TKc	CsNt��}tj|dddd�}tj|dddd�}|��|��t|�}|�ddd�t|�}|�ddd�t|�}t|�}|�dd	�|�d
�|�dd�|�d
�||fD]}|�	d
�|�
d�q�|�
d�||fD]}|��q�td�D]&}||fD]}|�
d�|�
d�q�q�||fD]*}|��|�
d�|��|�d��qdS)Ni,��z#ddffff)�widthZheightZbgz#ffeeee�333333�?�Zred)rrr�Zblue)rrr�turtle�$���2�H�6Z	EVENTLOOP)rZTkZCanvasZpackrZbgcolorrZcolorr�shape�ltZ
begin_fill�range�fdZend_fillZpuZbk)	�rootZcv1Zcv2�s1�s2�p�q�t�i�r�//usr/lib64/python3.8/turtledemo/two_canvases.py�mains>






r�__main__N)r
rrrr�__name__Zmainlooprrrr�<module>	s)turtledemo/__pycache__/minimal_hanoi.cpython-38.opt-1.pyc000064400000005413151153537630017347 0ustar00U

e5d�@sddZddlTGdd�de�ZGdd�de�Zdd�Zd	d
�Zdd�Ze	d
kr`e�Z
ee
�e�dS)a�       turtle-example-suite:

         tdemo_minimal_hanoi.py

A minimal 'Towers of Hanoi' animation:
A tower of 6 discs is transferred from the
left to the right peg.

An imho quite elegant and concise
implementation using a tower class, which
is derived from the built-in type list.

Discs are turtles with shape "square", but
stretched to rectangles by shapesize()
 ---------------------------------------
       To exit press STOP button
 ---------------------------------------
�)�*c@seZdZdd�ZdS)�DisccCsPtj|ddd�|��|�d|dd�|�|ddd|d�|��dS)	NZsquareF)�shapeZvisibleg�?�g@r�)�Turtle�__init__ZpuZ	shapesizeZ	fillcolor�st)�self�n�r�0/usr/lib64/python3.8/turtledemo/minimal_hanoi.pyrs
z
Disc.__init__N)�__name__�
__module__�__qualname__rrrrr
rsrc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�Towerz-Hanoi tower, a subclass of built-in type listcCs
||_dS)z-create an empty tower. x is x-position of pegN)�x)r
rrrr
r szTower.__init__cCs0|�|j�|�ddt|��|�|�dS)Nij����")Zsetxr�sety�len�append�r
�drrr
�push#sz
Tower.pushcCst�|�}|�d�|S)N�)�list�poprrrrr
r's

z	Tower.popN)rrr�__doc__rrrrrrr
rsrcCs>|dkr:t|d|||�|�|���t|d|||�dS)Nrr)�hanoirr)rZfrom_Zwith_Zto_rrr
r,srcCsJtdd�t�z tdttt�tdddd�Wntk
rDYnXdS)N�space�zpress STOP button to exit�center�ZCourier�Zbold�ZalignZfont)�onkey�clearr�t1�t2�t3�writeZ
Terminatorrrrr
�play2s
�
r+cCspt�t�tdd�td�atd�atd�atddd�D]}t�t	|��q:t
ddd	d
�ttd�t
�dS)
Nri���i����r ���zpress spacebar to start gamer!r"r$rZ	EVENTLOOP)ZhtZpenupZgotorr'r(r)�rangerrr*r%r+Zlisten)�irrr
�main<s
�
r0�__main__N)
rZturtlerrrrrr+r0r�msg�printZmainlooprrrr
�<module>s
turtledemo/__pycache__/forest.cpython-38.opt-2.pyc000064400000005665151153537630016057 0ustar00U

e5d��@s�ddlmZmZmZmZddlmZddlmZ	dd�Z
dd�Zdd	�Zddd
�Z
dd�Zdd�Zdd�Zdd�Zdd�Zedkr�e�e�dS)�)�Turtle�	colormode�tracer�mainloop��	randrange)�perf_countercCst||d�S)N�r)�n�r�)/usr/lib64/python3.8/turtledemo/forest.py�	symRandomsr
cs��fdd�|D�S)Ncs,g|]$\}}|t��|dt��f�qS)g)\��(�?)r
)�.0�angle�
sizefactor��	angledist�sizedistrr�
<listcomp>s�
�zrandomize.<locals>.<listcomp>r)�
branchlistrrrrr�	randomizes�rcCs2t|�D]$}|�t|��|�d||�qdS)Ng�?)�range�leftr
Zforward)�tZdistance�partsr�irrr�randomfdsr�
�ccs�|dkr�g}g}tt||��D]�\}	}
|	�||�|	�ddd|td�dd|td�d�|	��t|	|||�dV|
D]<\}}|	�|�|�|	�	��|�t
|
||��|	�|�q�qt||||d||||�D]
}
dVq�dS)Nr����r	)
�list�zipZpensizeZpencolorr
�pendownrr�appendZcloner�right�tree)Ztlist�size�levelZwidthfactorZbranchlistsrrZlstZbrsrrrr�xrrrr(s,�
�r(cCsLtd�|��|�d�|��|�d�|��|�||�|��dS)Nrr�Z)r�resetZspeed�
hideturtlerZpenupZsetposr%)rr+�yrrr�start7s

r0cCs2|��t|dd�t|gd|ddddgg�}|S)N�i0����P皙�����?��-g�G�z�?)r��������?�����g���Q��?�r.r0r(�r*Zpenrrrr�doit1Asr;cCs0|��t|dd�t|gd|dddgg�}|S)Niy���i~����xr3r4r7r9r:rrr�doit2Gsr=cCs2|��t|dd�t|gd|ddddgg�}|S)N�i�����dr3)r5gffffff�?)rg
ףp=
�?)r8r6r9r:rrr�doit3Msr@cCs�t�}|��tdd�tdtdd��}tdtdd��}tdtdd��}t�}d}|||fD]&}z|��Wq\|d7}Yq\Xq\|dkrNq�qNtdd	�t�}d
||S)N�Kr�r	)Zundobuffersize�r�rzruntime: %.2f sec.)rZhtrr;r=r@�clock�__next__)�p�u�sr�aZdone�brrr�mainTs$

rL�__main__N)rr)ZturtlerrrrZrandomr�timerrEr
rrr(r0r;r=r@rL�__name__rrrr�<module>s

turtledemo/__pycache__/rosette.cpython-38.opt-2.pyc000064400000002516151153537630016232 0ustar00U

e5dQ�@sTddlmZmZmZddlmZmZdd�Zdd�Z	e
dkrPe	�Zee�e�dS)	�)�Screen�Turtle�mainloop)�perf_counter�sleepcCs�|g}td|�D](}|��}|�d|�|�|�|}qt|�D]P}t|d|�|d}|D].}|�d|�|�d|d|�|�|�qbqBdS)N�g�v@g@gffffff�?r)�rangeZcloneZrt�append�abs�pencolor�fd)�p�neZszZ
turtlelist�i�q�c�t�r�*/usr/lib64/python3.8/turtledemo/rosette.py�mn_ecks
rcCs�t�}|�d�t�}|�d�|��|�d�|�d�|�dd�t�}t	|dd�t�}||}t
d�t�}tdd	�|��D��r�|��D]}|�
�q�qvt�}d
|||S)NZblackrZred��$�rcss|]}|��VqdS)N)Zundobufferentries)�.0rrrr�	<genexpr>7szmain.<locals>.<genexpr>zruntime: %.3f sec)rZbgcolorrZspeedZ
hideturtlerZpensizeZtracer�clockrr�anyZturtlesZundo)�sr
ZatZetZz1rrrr�main$s&



r�__main__N)
Zturtlerrr�timerrrrr�__name__�msg�printrrrr�<module>sturtledemo/__pycache__/nim.cpython-38.opt-2.pyc000064400000015735151153537630015337 0ustar00U

e5dq�@s�ddlZddlZddlZdZdZdZdZedZeeddedd	Zd
Z	dZ
dZd
d�Zdd�Z
dd�ZGdd�de�ZGdd�dej�ZGdd�de�ZGdd�de�ZGdd�de�Zdd�Zedkr�e�e��dS) �Ni�i�������)�?rr)���r
)r
r
r	cCst�tt�S�N)�random�randint�	MINSTICKS�	MAXSTICKS�rr�&/usr/lib64/python3.8/turtledemo/nim.py�	randomrowsrcCsb|d|dA|dA}|dkr(t|�Std�D],}|||A}|||kr0||f}|Sq0dS)Nr�r�)�
randommove�range)�stateZxored�z�s�moverrr�computerzug!srcCsHt|�}t�dd�}|||dkkrq(qt�|dk||d�}||fS)Nrrr)�maxrr
)r�mrZrandrrrr+src@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�NimModelcCs
||_dSr)�game)�selfrrrr�__init__6szNimModel.__init__cCsP|jjtjtjfkrdSt�t�t�g|_d|_d|_|jj	�
�tj|j_dS�Nr)rr�Nim�CREATED�OVERr�sticks�player�winner�view�setup�RUNNING�r rrrr*9szNimModel.setupcCs�|j|}||j|<|jj�||||j�|��rRtj|j_|j|_	|jj�
�n0|jdkr�d|_t|j�\}}|�||�d|_dS)Nrr)
r&rr)�notify_mover'�	game_overr#r%rr(�notify_overrr)r �row�col�	maxspalterrrrBs



z
NimModel.movecCs|jdddgkSr")r&r,rrrr.PszNimModel.game_overcCs"|j||krdS|�||�dSr)r&r�r r0r1rrrr-SszNimModel.notify_moveN)�__name__�
__module__�__qualname__r!r*rr.r-rrrrr5s
	rc@s$eZdZdd�Zdd�Zdd�ZdS)�StickcCs�tjj|dd�||_||_||_|�||�\}}|�d�|�t	dt
d�|�d�|��|�
||�|�d�|��dS)NF�ZvisibleZsquareg$@g4@r�white)�turtle�Turtler!r0r1r�coords�shapeZ	shapesize�HUNIT�WUNIT�speed�pu�goto�colorZ
showturtle)r r0r1r�x�yrrrr!Zs


zStick.__init__cCs^t|d�\}}dd|d|t}dd|t}|tdtdtd|tdfS)Nrrrr)�divmodr?r>�SCREENWIDTH�SCREENHEIGHT)r r0r1ZpacketZ	remainderrDrErrrr<hszStick.coordscCs*|jjtjkrdS|jj�|j|j�dSr)rrr#r+�
controllerr-r0r1)r rDrErrr�makemovenszStick.makemoveN)r4r5r6r!r<rJrrrrr7Ysr7c@s>eZdZdd�Zddd�Zdd�Zdd	�Zd
d�Zdd
�ZdS)�NimViewcCs�||_|j|_|j|_|j�d�|j�d�|j�d�tjdd�|_|j�	�|j�
d�i|_td�D](}tt
�D]}t|||�|j||f<qxql|�d�|j�d�dS)	Nr	F)��rLr	r8rrz... a moment please ...T)r�screen�modelZ	colormode�tracerZbgcolorr:r;�writerrAr@r&rrr7�display)r rr0r1rrrr!us

zNimView.__init__NcCs�|j�d�|j��|dk	rT|j�dtdd�|j�d�|jj|ddd�|j�dtdd	�|j�d
�|jj|ddd�|j�d�dS)
NFrr�0Zred�center)�Courier��bold)ZalignZfont�Zblack)rT�rVT)rMrOrP�clearrBrHZpencolor�write)r Zmsg1�msg2rrrrQ�s
zNimView.displaycCs�|j�d�td�D].}t|jj|�D]}|j||f�t�q(qtd�D]0}t|jj|t�D]}|j||f�d�qbqL|�d�|j�d�dS)NFrr9�*Your turn! Click leftmost stick to remove.T)	rMrOrrNr&rC�SCOLORrrQr3rrrr*�s
z
NimView.setupcCs�|dkr2t}t||�D]}|j||f�|�qnd|�d�t�d�|�d�t}t|d|dd�D]"}t�d�|j||f�|�qh|�d�dS)	Nrz ... thinking ...         g�?z ... thinking ... aaah ...r���g�������?r\)�HCOLORrr&rCrQ�time�sleep�COLOR)r r0r1r2r'Zfarberrrrr-�s



zNimView.notify_movecCs(|jjjdkrd}nd}|�d|�dS)NrzCongrats. You're the winner!!!z"Sorry, the computer is the winner.z2To play again press space bar. To leave press ESC.)rrNr(rQ)r r[rrrr/�szNimView.notify_overcCs|jjtjkr|j��dSr)rrr#r%rMrYr,rrrrY�sz
NimView.clear)N)	r4r5r6r!rQr*r-r/rYrrrrrKts
rKc@seZdZdd�Zdd�ZdS)�
NimControllercCs|||_|jj|_d|_|j��D]}|�|j�q |jj�|jj	j
d�|jj�|jjjd�|jj�d�|jj�
�dS)NFZspaceZEscapezPress space bar to start game)rr)r&�BUSY�valuesZonclickrJrMZonkeyrNr*rYrQZlisten)r rZstickrrrr!�s
zNimController.__init__cCs*|jr
dSd|_|jj�||�d|_dS)NTF)rdrrNr-r3rrrr-�s
zNimController.notify_moveN)r4r5r6r!r-rrrrrc�srcc@s eZdZdZdZdZdd�ZdS)r#rrrcCs0tj|_||_t|�|_t|�|_t|�|_	dSr)
r#r$rrMrrNrKr)rcrI)r rMrrrr!�s


zNim.__init__N)r4r5r6r$r+r%r!rrrrr#�sr#cCs*t��}|�d�|�tt�t|�}dS)NZstandardZ	EVENTLOOP)r:ZScreen�moder*rGrHr#)Z
mainscreenZnimrrr�main�s

rg�__main__)r:rr`rGrHrrr>r?r]r_rbrrr�objectrr;r7rKrcr#rgr4Zmainlooprrrr�<module>
s.

$Dturtledemo/__pycache__/planet_and_moon.cpython-38.opt-2.pyc000064400000005732151153537630017705 0ustar00U

e5d�@s\ddlmZmZmZmZdZGdd�de�ZGdd�de�Z	dd�Z
ed	krXe
�e�d
S)�)�Shape�Turtle�mainloop�Vec2D�c@s$eZdZdd�Zdd�Zdd�ZdS)�GravSyscCsg|_d|_d|_dS)Nrg{�G�z�?)�planets�t�dt)�self�r�2/usr/lib64/python3.8/turtledemo/planet_and_moon.py�__init__szGravSys.__init__cCs|jD]}|��qdS)N)r�init)r�prrr
rs
zGravSys.initcCs6td�D](}|j|j7_|jD]}|��q"qdS)Ni')�ranger	r
r�step)r�irrrr
�start s
z
GravSys.startN)�__name__�
__module__�__qualname__rrrrrrr
rsrc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�StarcCsTtj||d�|��||_|�|�||_|j�|�||_|�	d�|�
�dS)N)�shape�user)rrZpenup�m�setpos�vr�append�gravSysZ
resizemodeZpendown)rr�xrrrrrr
r's

z
Star.__init__cCs,|jj}|��|_|jd||j|_dS)N��?)rr
�acc�ar�rr
rrr
r1s
z	Star.initcCsRtdd�}|jjD]:}||kr|��|��}|t|jt|�d|7}q|S)Nr�)�Vecrr�pos�Gr�abs)rr#�planetrrrr
r"5s
 zStar.acccCsj|jj}|�|��||j�|jj�|�dkrJ|�|�|jjd��|�	�|_
|j||j
|_dS)Nr)rr
rr'rr�indexZ
setheadingZtowardsr"r#r$rrr
r<s
z	Star.stepN)rrrrrr"rrrrr
r&s
rcCs|t�}|��|���dd�|��|��|�d�|�d�|��|�	dd�|�
�|��}|��|�	dd�|�
�|��}td�}|�
|d�|�
|d�|���d|�|���d	d�t�}td
tdd�tdd�|d�}|�d
�|�d�|��tdtdd�tdd�|d�}|�d�|�d�td	tdd�tdd�|d�}|�d�|�d�|��|��dS)Nr��Z�ZcompoundZorangeZbluer*�i@Bg��circleZyellowg������?i�0����Zgreeng�������?��i'r!zDone!)r�resetZ	getscreenZtracerZhtZpu�fd�ltZ
begin_polyr0Zend_polyZget_polyrZaddcomponentZregister_shaperrr&ZcolorZ	shapesizeZpencolorrr)�sZm1Zm2ZplanetshapeZgsZsunZearthZmoonrrr
�mainFsD







r8�__main__N)Zturtlerrrrr&r(�objectrrr8rrrrr
�<module>s 'turtledemo/__pycache__/chaos.cpython-38.opt-2.pyc000064400000003262151153537630015641 0ustar00U

e5d��@sdddlTdZdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�Z	e
dkr`e	�e�dS)�)�*�PcCsd|d|S)N�333333@����xrr�(/usr/lib64/python3.8/turtledemo/chaos.py�fsr
cCsd||dS)Nr�rrrrr	�gsrcCsd|d||S)Nrrrrrr	�hsr
cCst�t||�dS�N)Zpenup�goto)r�yrrr	�jumptosrcCst||�t�t||�dSr)r�pendownr)Zx1Zy1Zx2Zy2rrr	�lines
rcCs$tddtdd�tdddd�dS)N���rr皙������皙�����?)r�Nrrrr	�coosyssrcCsTt|�|}td|�t�td�tt�D]"}||�}t|d|�td�q,dS)Nr�r)Zpencolorrr�dot�rangerr)Zfun�startZcolorr�irrr	�plot s
rcCsxt�tddtdd�td�t�t�ttdd�ttdd�tt	dd	�t
d
�D]}td|dtdd�qXdS)
Ng�rrrrgffffff�?ZblueZgreenZred�dg�?zDone!)�resetZsetworldcoordinatesrZspeedZ
hideturtlerrr
rr
r)�srrr	�main+sr"�__main__N)Zturtlerr
rr
rrrrr"�__name__Zmainlooprrrr	�<module>sturtledemo/__pycache__/colormixer.cpython-38.opt-1.pyc000064400000003434151153537630016727 0ustar00U

e5d;�@sTddlmZmZmZGdd�de�Zdd�Zdd�ZedkrPe�Ze	e�e�d	S)
�)�Screen�Turtle�mainloopc@seZdZdd�Zdd�ZdS)�ColorTurtlecCs�t�|�|�d�|�d�|�ddd�|�d�dddg|_||_||j|<|�|j�|�	d�|�
d�|��|�|d�|�
�|�d�|��|�|�|�d	�|�|j�dS)
N�turtle�user���
r�Z�Zgray25)r�__init__�shapeZ
resizemodeZ	shapesizeZpensize�_color�xZcolorZspeed�left�pu�gotoZpd�setyZpencolorZondrag�shift��selfr�y�r�-/usr/lib64/python3.8/turtledemo/colormixer.pyr
s&









zColorTurtle.__init__cCs<|�tdt|d���|��|j|j<|�|j�t�dS)Nrr)r�max�min�ycorrrZ	fillcolor�
setbgcolorrrrrrszColorTurtle.shiftN)�__name__�
__module__�__qualname__r
rrrrrrsrcCst�t��t��t���dS)N)�screenZbgcolor�redr�green�bluerrrrr"srcCszt�at�d�t�dddd�tdd�atdd�atdd�at�t	�}|�
�|��|�dd	�|j
d
ddd
�dS)Nr���g333333ӿrg�������?g�?r�gffffff�?zDRAG!�center)ZArial�)ZboldZitalic)ZalignZfontZ	EVENTLOOP)rr"ZdelayZsetworldcoordinatesrr#r$r%rrZhtrr�write)�writerrrr�main%s



r,�__main__N)
rrrrrrr,r�msg�printrrrr�<module>sturtledemo/__pycache__/__init__.cpython-38.opt-2.pyc000064400000000206151153537630016276 0ustar00U

e5d:�@sdS)N�rrr�+/usr/lib64/python3.8/turtledemo/__init__.py�<module>�turtledemo/__pycache__/nim.cpython-38.pyc000064400000016255151153537630014375 0ustar00U

e5dq�@s�dZddlZddlZddlZdZdZdZdZedZeedd	edd
Z	dZ
dZd
Zdd�Z
dd�Zdd�ZGdd�de�ZGdd�dej�ZGdd�de�ZGdd�de�ZGdd�de�Zdd�Zed kr�e�e��dS)!z�      turtle-example-suite:

            tdemo_nim.py

Play nim against the computer. The player
who takes the last stick is the winner.

Implements the model-view-controller
design pattern.
�Ni�i�������)�?rr)���r
)r
r
r	cCst�tt�S�N)�random�randint�	MINSTICKS�	MAXSTICKS�rr�&/usr/lib64/python3.8/turtledemo/nim.py�	randomrowsrcCsb|d|dA|dA}|dkr(t|�Std�D],}|||A}|||kr0||f}|Sq0dS)Nr�r�)�
randommove�range)�stateZxored�z�s�moverrr�computerzug!srcCsHt|�}t�dd�}|||dkkrq(qt�|dk||d�}||fS)Nrrr)�maxrr
)r�mrZrandrrrr+src@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�NimModelcCs
||_dSr)�game)�selfrrrr�__init__6szNimModel.__init__cCsP|jjtjtjfkrdSt�t�t�g|_d|_d|_|jj	�
�tj|j_dS�Nr)rr�Nim�CREATED�OVERr�sticks�player�winner�view�setup�RUNNING�r rrrr*9szNimModel.setupcCs�|j|}||j|<|jj�||||j�|��rRtj|j_|j|_	|jj�
�n0|jdkr�d|_t|j�\}}|�||�d|_dS)Nrr)
r&rr)�notify_mover'�	game_overr#r%rr(�notify_overrr)r �row�col�	maxspalterrrrBs



z
NimModel.movecCs|jdddgkSr")r&r,rrrr.PszNimModel.game_overcCs"|j||krdS|�||�dSr)r&r�r r0r1rrrr-SszNimModel.notify_moveN)�__name__�
__module__�__qualname__r!r*rr.r-rrrrr5s
	rc@s$eZdZdd�Zdd�Zdd�ZdS)�StickcCs�tjj|dd�||_||_||_|�||�\}}|�d�|�t	dt
d�|�d�|��|�
||�|�d�|��dS)NF�ZvisibleZsquareg$@g4@r�white)�turtle�Turtler!r0r1r�coords�shapeZ	shapesize�HUNIT�WUNIT�speed�pu�goto�colorZ
showturtle)r r0r1r�x�yrrrr!Zs


zStick.__init__cCs^t|d�\}}dd|d|t}dd|t}|tdtdtd|tdfS)Nrrrr)�divmodr?r>�SCREENWIDTH�SCREENHEIGHT)r r0r1ZpacketZ	remainderrDrErrrr<hszStick.coordscCs*|jjtjkrdS|jj�|j|j�dSr)rrr#r+�
controllerr-r0r1)r rDrErrr�makemovenszStick.makemoveN)r4r5r6r!r<rJrrrrr7Ysr7c@s>eZdZdd�Zddd�Zdd�Zdd	�Zd
d�Zdd
�ZdS)�NimViewcCs�||_|j|_|j|_|j�d�|j�d�|j�d�tjdd�|_|j�	�|j�
d�i|_td�D](}tt
�D]}t|||�|j||f<qxql|�d�|j�d�dS)	Nr	F)��rLr	r8rrz... a moment please ...T)r�screen�modelZ	colormode�tracerZbgcolorr:r;�writerrAr@r&rrr7�display)r rr0r1rrrr!us

zNimView.__init__NcCs�|j�d�|j��|dk	rT|j�dtdd�|j�d�|jj|ddd�|j�dtdd	�|j�d
�|jj|ddd�|j�d�dS)
NFrr�0Zred�center)�Courier��bold)ZalignZfont�Zblack)rT�rVT)rMrOrP�clearrBrHZpencolor�write)r Zmsg1�msg2rrrrQ�s
zNimView.displaycCs�|j�d�td�D].}t|jj|�D]}|j||f�t�q(qtd�D]0}t|jj|t�D]}|j||f�d�qbqL|�d�|j�d�dS)NFrr9�*Your turn! Click leftmost stick to remove.T)	rMrOrrNr&rC�SCOLORrrQr3rrrr*�s
z
NimView.setupcCs�|dkr2t}t||�D]}|j||f�|�qnd|�d�t�d�|�d�t}t|d|dd�D]"}t�d�|j||f�|�qh|�d�dS)	Nrz ... thinking ...         g�?z ... thinking ... aaah ...r���g�������?r\)�HCOLORrr&rCrQ�time�sleep�COLOR)r r0r1r2r'Zfarberrrrr-�s



zNimView.notify_movecCs(|jjjdkrd}nd}|�d|�dS)NrzCongrats. You're the winner!!!z"Sorry, the computer is the winner.z2To play again press space bar. To leave press ESC.)rrNr(rQ)r r[rrrr/�szNimView.notify_overcCs|jjtjkr|j��dSr)rrr#r%rMrYr,rrrrY�sz
NimView.clear)N)	r4r5r6r!rQr*r-r/rYrrrrrKts
rKc@seZdZdd�Zdd�ZdS)�
NimControllercCs|||_|jj|_d|_|j��D]}|�|j�q |jj�|jj	j
d�|jj�|jjjd�|jj�d�|jj�
�dS)NFZspaceZEscapezPress space bar to start game)rr)r&�BUSY�valuesZonclickrJrMZonkeyrNr*rYrQZlisten)r rZstickrrrr!�s
zNimController.__init__cCs*|jr
dSd|_|jj�||�d|_dS)NTF)rdrrNr-r3rrrr-�s
zNimController.notify_moveN)r4r5r6r!r-rrrrrc�srcc@s eZdZdZdZdZdd�ZdS)r#rrrcCs0tj|_||_t|�|_t|�|_t|�|_	dSr)
r#r$rrMrrNrKr)rcrI)r rMrrrr!�s


zNim.__init__N)r4r5r6r$r+r%r!rrrrr#�sr#cCs*t��}|�d�|�tt�t|�}dS)NZstandardZ	EVENTLOOP)r:ZScreen�moder*rGrHr#)Z
mainscreenZnimrrr�main�s

rg�__main__)�__doc__r:rr`rGrHrrr>r?r]r_rbrrr�objectrr;r7rKrcr#rgr4Zmainlooprrrr�<module>s0

$Dturtledemo/__pycache__/peace.cpython-38.pyc000064400000002140151153537630014653 0ustar00U

e5d)�@s,dZddlTdd�Zedkr(e�e�dS)z�       turtle-example-suite:

              tdemo_peace.py

A simple drawing suitable as a beginner's
programming example. Aside from the
peacecolors assignment and the for loop,
it only uses turtle commands.
�)�*cCs
d}t�t�t�tdd�td�|D]@}t|�t�td�t�td�t	d�td�t
d�q,td�td	�td
d�t�td�t	d�td
�t�t	d�td�t
d�t�td�t�td�t	d�t�td�t�td
d�dS)N)Zred3ZorangeZyellowZ	seagreen4Zorchid4Z
royalblue1Zdodgerblue4i����i=����Fi��Z�B�ZwhiteriV����iT��-i,zDone!)�resetZScreenZupZgoto�widthZcolorZdownZforwardZbackward�left�rightZcircle)ZpeacecolorsZpcolor�r�(/usr/lib64/python3.8/turtledemo/peace.py�mainsH



r�__main__N)�__doc__Zturtler�__name__Zmainlooprrrr�<module>s

-turtledemo/__pycache__/nim.cpython-38.opt-1.pyc000064400000016255151153537630015334 0ustar00U

e5dq�@s�dZddlZddlZddlZdZdZdZdZedZeedd	edd
Z	dZ
dZd
Zdd�Z
dd�Zdd�ZGdd�de�ZGdd�dej�ZGdd�de�ZGdd�de�ZGdd�de�Zdd�Zed kr�e�e��dS)!z�      turtle-example-suite:

            tdemo_nim.py

Play nim against the computer. The player
who takes the last stick is the winner.

Implements the model-view-controller
design pattern.
�Ni�i�������)�?rr)���r
)r
r
r	cCst�tt�S�N)�random�randint�	MINSTICKS�	MAXSTICKS�rr�&/usr/lib64/python3.8/turtledemo/nim.py�	randomrowsrcCsb|d|dA|dA}|dkr(t|�Std�D],}|||A}|||kr0||f}|Sq0dS)Nr�r�)�
randommove�range)�stateZxored�z�s�moverrr�computerzug!srcCsHt|�}t�dd�}|||dkkrq(qt�|dk||d�}||fS)Nrrr)�maxrr
)r�mrZrandrrrr+src@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d
�ZdS)�NimModelcCs
||_dSr)�game)�selfrrrr�__init__6szNimModel.__init__cCsP|jjtjtjfkrdSt�t�t�g|_d|_d|_|jj	�
�tj|j_dS�Nr)rr�Nim�CREATED�OVERr�sticks�player�winner�view�setup�RUNNING�r rrrr*9szNimModel.setupcCs�|j|}||j|<|jj�||||j�|��rRtj|j_|j|_	|jj�
�n0|jdkr�d|_t|j�\}}|�||�d|_dS)Nrr)
r&rr)�notify_mover'�	game_overr#r%rr(�notify_overrr)r �row�col�	maxspalterrrrBs



z
NimModel.movecCs|jdddgkSr")r&r,rrrr.PszNimModel.game_overcCs"|j||krdS|�||�dSr)r&r�r r0r1rrrr-SszNimModel.notify_moveN)�__name__�
__module__�__qualname__r!r*rr.r-rrrrr5s
	rc@s$eZdZdd�Zdd�Zdd�ZdS)�StickcCs�tjj|dd�||_||_||_|�||�\}}|�d�|�t	dt
d�|�d�|��|�
||�|�d�|��dS)NF�ZvisibleZsquareg$@g4@r�white)�turtle�Turtler!r0r1r�coords�shapeZ	shapesize�HUNIT�WUNIT�speed�pu�goto�colorZ
showturtle)r r0r1r�x�yrrrr!Zs


zStick.__init__cCs^t|d�\}}dd|d|t}dd|t}|tdtdtd|tdfS)Nrrrr)�divmodr?r>�SCREENWIDTH�SCREENHEIGHT)r r0r1ZpacketZ	remainderrDrErrrr<hszStick.coordscCs*|jjtjkrdS|jj�|j|j�dSr)rrr#r+�
controllerr-r0r1)r rDrErrr�makemovenszStick.makemoveN)r4r5r6r!r<rJrrrrr7Ysr7c@s>eZdZdd�Zddd�Zdd�Zdd	�Zd
d�Zdd
�ZdS)�NimViewcCs�||_|j|_|j|_|j�d�|j�d�|j�d�tjdd�|_|j�	�|j�
d�i|_td�D](}tt
�D]}t|||�|j||f<qxql|�d�|j�d�dS)	Nr	F)��rLr	r8rrz... a moment please ...T)r�screen�modelZ	colormode�tracerZbgcolorr:r;�writerrAr@r&rrr7�display)r rr0r1rrrr!us

zNimView.__init__NcCs�|j�d�|j��|dk	rT|j�dtdd�|j�d�|jj|ddd�|j�dtdd	�|j�d
�|jj|ddd�|j�d�dS)
NFrr�0Zred�center)�Courier��bold)ZalignZfont�Zblack)rT�rVT)rMrOrP�clearrBrHZpencolor�write)r Zmsg1�msg2rrrrQ�s
zNimView.displaycCs�|j�d�td�D].}t|jj|�D]}|j||f�t�q(qtd�D]0}t|jj|t�D]}|j||f�d�qbqL|�d�|j�d�dS)NFrr9�*Your turn! Click leftmost stick to remove.T)	rMrOrrNr&rC�SCOLORrrQr3rrrr*�s
z
NimView.setupcCs�|dkr2t}t||�D]}|j||f�|�qnd|�d�t�d�|�d�t}t|d|dd�D]"}t�d�|j||f�|�qh|�d�dS)	Nrz ... thinking ...         g�?z ... thinking ... aaah ...r���g�������?r\)�HCOLORrr&rCrQ�time�sleep�COLOR)r r0r1r2r'Zfarberrrrr-�s



zNimView.notify_movecCs(|jjjdkrd}nd}|�d|�dS)NrzCongrats. You're the winner!!!z"Sorry, the computer is the winner.z2To play again press space bar. To leave press ESC.)rrNr(rQ)r r[rrrr/�szNimView.notify_overcCs|jjtjkr|j��dSr)rrr#r%rMrYr,rrrrY�sz
NimView.clear)N)	r4r5r6r!rQr*r-r/rYrrrrrKts
rKc@seZdZdd�Zdd�ZdS)�
NimControllercCs|||_|jj|_d|_|j��D]}|�|j�q |jj�|jj	j
d�|jj�|jjjd�|jj�d�|jj�
�dS)NFZspaceZEscapezPress space bar to start game)rr)r&�BUSY�valuesZonclickrJrMZonkeyrNr*rYrQZlisten)r rZstickrrrr!�s
zNimController.__init__cCs*|jr
dSd|_|jj�||�d|_dS)NTF)rdrrNr-r3rrrr-�s
zNimController.notify_moveN)r4r5r6r!r-rrrrrc�srcc@s eZdZdZdZdZdd�ZdS)r#rrrcCs0tj|_||_t|�|_t|�|_t|�|_	dSr)
r#r$rrMrrNrKr)rcrI)r rMrrrr!�s


zNim.__init__N)r4r5r6r$r+r%r!rrrrr#�sr#cCs*t��}|�d�|�tt�t|�}dS)NZstandardZ	EVENTLOOP)r:ZScreen�moder*rGrHr#)Z
mainscreenZnimrrr�main�s

rg�__main__)�__doc__r:rr`rGrHrrr>r?r]r_rbrrr�objectrr;r7rKrcr#rgr4Zmainlooprrrr�<module>s0

$Dturtledemo/__pycache__/lindenmayer.cpython-38.opt-2.pyc000064400000004377151153537630017063 0ustar00U

e5d�	�@s@ddlTdd�Zdd�Zdd�Zedkr<e�Zee�e�d	S)
�)�*cCs4t|�D]&}d}|D]}||�||�}q|}q|S)N�)�range�get)�seqZreplacementRules�n�iZnewseqZelement�r	�./usr/lib64/python3.8/turtledemo/lindenmayer.py�replacesrc
CsR|D]H}z||�Wqtk
rJzt|||�WnYnXYqXqdS)N)�	TypeError�draw)ZcommandsZrules�br	r	r
r
&sr
cCsdd�}dd�}dd�}|||dd�}d	d
i}d}t||d�}t�td�td
d�t�t�td�t�t||�ddl	m
}|d�dd�}dd�}	dd�}
||	|
d�}ddd�}d}
t�td�tdd�t�td�t|
|d�}t||�td
�dS)NcSstd�dS�N�-)�rightr	r	r	r
�r7szmain.<locals>.rcSstd�dSr)�leftr	r	r	r
�l:szmain.<locals>.lcSstd�dS)Ng@)�forwardr	r	r	r
�f=szmain.<locals>.fzf+f+f--f--f+f+f)�-�+rrrzb+f+b--f--b+f+bz
b--f--b--f��r��)�sleepcSstd�tdd�dS)NZred�
�Z)�color�circler	r	r	r
�AVszmain.<locals>.AcSs>ddlm}td�d|d�}t|�t|d�t|�dS)Nr)�sqrtZblack��i)Zmathr"rrr )r"rr	r	r
�BZs
zmain.<locals>.BcSstd�td�dS)NZgreenr)rrr	r	r	r
�Fbszmain.<locals>.F)�arrZafbfaZ	afbfbfbfa)r'rZfbfbfbfbrzDone!)r�resetZspeedZtracerZhtZupZbackwardZdownr
�timerr)rrrZsnake_rulesZsnake_replacementRulesZsnake_startZdrawingrr!r%r&Z
krishna_rulesZkrishna_replacementRulesZ
krishna_startr	r	r
�main1s@




r*�__main__N)Zturtlerr
r*�__name__�msg�printZmainloopr	r	r	r
�<module>sCturtledemo/__pycache__/lindenmayer.cpython-38.opt-1.pyc000064400000005376151153537630017062 0ustar00U

e5d�	�@sDdZddlTdd�Zdd�Zdd�Zed	kr@e�Zee�e�d
S)a�       turtle-example-suite:

        xtx_lindenmayer_indian.py

Each morning women in Tamil Nadu, in southern
India, place designs, created by using rice
flour and known as kolam on the thresholds of
their homes.

These can be described by Lindenmayer systems,
which can easily be implemented with turtle
graphics and Python.

Two examples are shown here:
(1) the snake kolam
(2) anklets of Krishna

Taken from Marcia Ascher: Mathematics
Elsewhere, An Exploration of Ideas Across
Cultures

�)�*cCs4t|�D]&}d}|D]}||�||�}q|}q|S)N�)�range�get)�seqZreplacementRules�n�iZnewseqZelement�r	�./usr/lib64/python3.8/turtledemo/lindenmayer.py�replacesrc
CsR|D]H}z||�Wqtk
rJzt|||�WnYnXYqXqdS)N)�	TypeError�draw)ZcommandsZrules�br	r	r
r
&sr
cCsdd�}dd�}dd�}|||dd�}d	d
i}d}t||d�}t�td�td
d�t�t�td�t�t||�ddl	m
}|d�dd�}dd�}	dd�}
||	|
d�}ddd�}d}
t�td�tdd�t�td�t|
|d�}t||�td
�dS)NcSstd�dS�N�-)�rightr	r	r	r
�r7szmain.<locals>.rcSstd�dSr)�leftr	r	r	r
�l:szmain.<locals>.lcSstd�dS)Ng@)�forwardr	r	r	r
�f=szmain.<locals>.fzf+f+f--f--f+f+f)�-�+rrrzb+f+b--f--b+f+bz
b--f--b--f��r��)�sleepcSstd�tdd�dS)NZred�
�Z)�color�circler	r	r	r
�AVszmain.<locals>.AcSs>ddlm}td�d|d�}t|�t|d�t|�dS)Nr)�sqrtZblack��i)Zmathr"rrr )r"rr	r	r
�BZs
zmain.<locals>.BcSstd�td�dS)NZgreenr)rrr	r	r	r
�Fbszmain.<locals>.F)�arrZafbfaZ	afbfbfbfa)r'rZfbfbfbfbrzDone!)r�resetZspeedZtracerZhtZupZbackwardZdownr
�timerr)rrrZsnake_rulesZsnake_replacementRulesZsnake_startZdrawingrr!r%r&Z
krishna_rulesZkrishna_replacementRulesZ
krishna_startr	r	r
�main1s@




r*�__main__N)	�__doc__Zturtlerr
r*�__name__�msg�printZmainloopr	r	r	r
�<module>sCturtledemo/__pycache__/round_dance.cpython-38.opt-1.pyc000064400000003561151153537630017026 0ustar00U

e5d�@s8dZddlTdd�Zdd�Zedkr4ee��e�dS)	aF      turtle-example-suite:

         tdemo_round_dance.py

(Needs version 1.1 of the turtle module that
comes with Python 3.1)

Dancing turtles have a compound shape
consisting of a series of triangles of
decreasing size.

Turtles march along a circle while rotating
pairwise in opposite direction, with one
exception. Does that breaking of symmetry
enhance the attractiveness of the example?

Press any key to stop the animation.

Technically: demonstrates use of compound
shapes, transformation of shapes as well as
cloning turtles. The animation is
controlled through update().
�)�*cCsdadS)NF)�running�rr�./usr/lib64/python3.8/turtledemo/round_dance.py�stopsrcCs�t�td�td�td�d}d}d}d}td�}td	�D]D}t|�t�}||9}||9}t|�|�	||d
d|fd�q>t
d|�td�td�t�td
d�g}td�D]:}t
d�td�td�t�|dd
kr�|�t��q�t�datt�t�d}t�r�d}	|D]6}
|
�
d�|
�d�|
�|	�|	d
k�rPdnd}	�q |dk�rztd�t|�|d9}t��qdS)NZgray10FZtriangleg}�R��c�?g���y!"@��Zcompound�
g�?ZblackZmultitriri8����������T�g�G�z�?zDONE!)ZclearscreenZbgcolorZtracer�shapeZShape�rangeZ	shapesizeZ
get_shapepolyZtiltZaddcomponentZregister_shapeZpuZsetpos�fd�lt�update�appendZclone�homerZ
onkeypressrZlisten�right)�fZphi�s�cZsh�i�pZdancersZcsZtaZdancerrrr�mains^







r�__main__N)�__doc__Zturtlerr�__name__�printZmainlooprrrr�<module>s5
turtledemo/__pycache__/fractalcurves.cpython-38.pyc000064400000005511151153537630016447 0ustar00U

e5d�
�@sTdZddlTddlmZmZGdd�de�Zdd�Ze	dkrPe�Z
ee
�e�d	S)
a&      turtle-example-suite:

        tdemo_fractalCurves.py

This program draws two fractal-curve-designs:
(1) A hilbert curve (in a box)
(2) A combination of Koch-curves.

The CurvesTurtle class and the fractal-curve-
methods are taken from the PythonCard example
scripts for turtle-graphics.
�)�*)�sleep�perf_counterc@s$eZdZdd�Zdd�Zdd�ZdS)�CurvesTurtlecCs�|dkrdS|�|d�|�||d|�|�|�|�|d�|�||d|�|�|�|�||d|�|�|d�|�|�|�||d|�|�|d�dS)Nr�Z�)�left�hilbertZforward�right)�self�size�levelZparity�r�0/usr/lib64/python3.8/turtledemo/fractalcurves.pyr	s


zCurvesTurtle.hilbertcCs�ddl}d||�|j|�}|��|�|�|��|�dd|d|�t|�D] }|�|||�|�d|�q\|�	dd|d|�|��|�
|�|��dS)Nr��rih)�mathZsinZpi�pu�fd�pd�rt�range�fractal�ltZbk)r�nZradZlev�dirrZedge�irrr�
fractalgon/s

zCurvesTurtle.fractalgoncCs�|dkr|�|�dS|�|d|d|�|�d|�|�|d|d|�|�d|�|�|d|d|�|�d|�|�|d|d|�dS)Nr��<�x)rrrr)rZdistZdepthrrrrrBs
zCurvesTurtle.fractalN)�__name__�
__module__�__qualname__r	rrrrrrrsrcCs�t�}|��|�d�|��|���dd�|��d}|�d|d|�|��t	�}|�
d�|��|�|�|�
|dd�|�|�td�D]$}|�d�|�|d	|d
�q�|��td
�D]}|�|�|�d�q�|��td�D]$}|�|d|d
�|�d�q�|��t	�}d
||}td�|��|�d�|��|���dd�t	�}|�dd�|��|�dddd�|��|��|�d�|�dddd�|��t	�}|d||7}|S)Nrr�i���i��Zredrr�@r��BzHilbert: %.2fsec. ZblackZblue������zKoch: %.2fsec.)r�resetZspeedZhtZ	getscreenZtracerrZsetposr�clockZ	fillcolorZ
begin_fillrr	rrrZend_fillrZcolorr)ZftrZtar�tb�resrrr�mainNs\







r/�__main__N)
�__doc__Zturtle�timerrr,ZPenrr/r!�msg�printZmainlooprrrr�<module>s=9turtledemo/__pycache__/__init__.cpython-38.pyc000064400000000710151153537630015336 0ustar00U

e5d:�@sdZdS)a3
    --------------------------------------
        About this viewer
    --------------------------------------

    Tiny demo viewer to view turtle graphics example scripts.

    Quickly and dirtyly assembled by Gregor Lingl.
    June, 2006

    For more information see: turtledemo - Help

    Have fun!
N)�__doc__�rr�+/usr/lib64/python3.8/turtledemo/__init__.py�<module>�turtledemo/__pycache__/__main__.cpython-38.pyc000064400000031532151153537630015325 0ustar00U

��.e�7�@sdZddlZddlZddlTddlmZmZddlmZddl	m
Z
ddlmZddl
Z
ej�ej�e��ZejdkZd	Zd
ZdZdZd
ZddefZdZdddgZdZdZdddddddddddgZ dd �Z!d!efd"efd#e
jffZ"Gd$d%�d%e#�Z$d&d'�Z%e&d(k�re%�dS))a�
  ----------------------------------------------
      turtleDemo - Help
  ----------------------------------------------

  This document has two sections:

  (1) How to use the demo viewer
  (2) How to add your own demos to the demo repository


  (1) How to use the demo viewer.

  Select a demoscript from the example menu.
  The (syntax colored) source code appears in the left
  source code window. IT CANNOT BE EDITED, but ONLY VIEWED!

  The demo viewer windows can be resized. The divider between text
  and canvas can be moved by grabbing it with the mouse. The text font
  size can be changed from the menu and with Control/Command '-'/'+'.
  It can also be changed on most systems with Control-mousewheel
  when the mouse is over the text.

  Press START button to start the demo.
  Stop execution by pressing the STOP button.
  Clear screen by pressing the CLEAR button.
  Restart by pressing the START button again.

  SPECIAL demos, such as clock.py are those which run EVENTDRIVEN.

      Press START button to start the demo.

      - Until the EVENTLOOP is entered everything works
      as in an ordinary demo script.

      - When the EVENTLOOP is entered, you control the
      application by using the mouse and/or keys (or it's
      controlled by some timer events)
      To stop it you can and must press the STOP button.

      While the EVENTLOOP is running, the examples menu is disabled.

      - Only after having pressed the STOP button, you may
      restart it or choose another example script.

   * * * * * * * *
   In some rare situations there may occur interferences/conflicts
   between events concerning the demo script and those concerning the
   demo-viewer. (They run in the same process.) Strange behaviour may be
   the consequence and in the worst case you must close and restart the
   viewer.
   * * * * * * * *


   (2) How to add your own demos to the demo repository

   - Place the file in the same directory as turtledemo/__main__.py
     IMPORTANT! When imported, the demo should not modify the system
     by calling functions in other modules, such as sys, tkinter, or
     turtle. Global variables should be initialized in main().

   - The code must contain a main() function which will
     be executed by the viewer (see provided example scripts).
     It may return a string which will be displayed in the Label below
     the source code window (when execution has finished.)

   - In order to run mydemo.py by itself, such as during development,
     add the following at the end of the file:

    if __name__ == '__main__':
        main()
        mainloop()  # keep window open

    python -m turtledemo.mydemo  # will then run it

   - If the demo is EVENT DRIVEN, main must return the string
     "EVENTLOOP". This informs the demo viewer that the script is
     still running and must be stopped by the user!

     If an "EVENTLOOP" demo runs by itself, as with clock, which uses
     ontimer, or minimal_hanoi, which loops by recursion, then the
     code should catch the turtle.Terminator exception that will be
     raised when the user presses the STOP button.  (Paint is not such
     a demo; it only acts in response to mouse clicks and movements.)
�N)�*)�ColorDelegator�color_config)�
Percolator)�	view_text)�__doc__�darwin������Arial�)rrZboldzLucida Console�
�normal��d��	�������cCsdd�t�t�D�S)NcSs.g|]&}|�d�r|ddkr|dd��qS)z.pyr�_N���)�endswith)�.0�entry�r"�+/usr/lib64/python3.8/turtledemo/__main__.py�
<listcomp>ts
�z%getExampleEntries.<locals>.<listcomp>)�os�listdir�demo_dirr"r"r"r#�getExampleEntriesssr(zTurtledemo helpzAbout turtledemozAbout turtle modulec@s�eZdZd(dd�Zdd�Zdd�Zdd	�Zd
d�Zd)dd
�Zd*dd�Z	dd�Z
d+dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�ZdS),�
DemoWindowNc	CsJt�|_}t_|�d�|�d|j�trbddl}|j	ddddd�
t���ddg|j
|j
d	�|jdd
d�|jdd
d�|jd
dd
d
�|jddd
d
�|jddd
d
�t|tdd�|_|jj|�|j�ddd�|jj|�|j�ddd�|jj|�|j�ddd�|j|d<ttdtdd�}|�|�|��|�|�|��|jdddd�t|d
ddddtd�|_ t!|d t"d!d"|j#d#�|_$t!|d$t"d!d"|j%d#�|_&t!|d%t"d!d"|j'd#�|_(|j jd
ddd&d'�|j$jd
d
d(d)�|j&jd
dd(d)�|j(jd
dd(d)�t)|j*��+t,��d*|_-d*|_.|�r.|�/|�|�0t1t1t1d+d,�t2|_3dS)-NzPython turtle-graphics examplesZWM_DELETE_WINDOWrZ	osascriptz-ez tell application "System Events"z>set frontmost of the first process whose unix id is {} to truezend tell)�stderr�stdoutr	)�weight�Z)Zminsizer,r
r)�relief�borderwidthZExamples)�menu�label�	underlineZFontsizeZHelpr0r
z#ddd)�orientZ	sashwidthZ
sashrelief�bgrZnews)�rowZ
columnspan�stickyz --- z#ddf)r�r)Zheight�textr4�fontr/r.z START Zwhitez#fed)r8r9�fgZdisabledforeground�commandz STOP z CLEAR )rr
)r5�columnr6�padxZew)r5r<r6FzChoose example from menu�black)4ZTk�root�turtle�_root�titleZwm_protocol�_destroyr�
subprocess�run�formatr%�getpidZDEVNULLZgrid_rowconfigureZgrid_columnconfigure�MenuZRAISEDZmBarZadd_cascade�makeLoadDemoMenu�makeFontMenu�makeHelpMenuZPanedWindow�
HORIZONTALZSOLID�add�
makeTextFrame�makeGraphFrameZgridZLabelZRIDGE�
output_lblZButton�btnfont�	startDemo�	start_btn�stopIt�stop_btn�clearCanvas�	clear_btnrr8Zinsertfilterr�dirty�exitflag�loadfile�	configGUI�DISABLED�STARTUP�state)�self�filenamer?rDZpaner"r"r#�__init__�s�
������
�
����

�zDemoWindow.__init__cCsP|j��}|j��}|j�d|j||j�|j�d|j||j�dS)Ng�?)�_canvasZwinfo_widthZwinfo_heightZxview_moveto�	canvwidthZyview_moveto�
canvheight)r_�eventZcwidthZcheightr"r"r#�onResize�s

zDemoWindow.onResizecCs6t|�|_}t|ddddd�|_}t|�t|dd�|_}|j|d<|jt	t
d	�t|d
td�|_}|j
|d<|jttd	�|j|d<|j|d
<tt�|d<tr�dnd}|�d||j�|�d||j�|�d||j�|�d||j�|�d|j�|�d|j�|�d|j�|jt	tdd�|S)Nr8r
Znone�-)�namer=Zwrap�width�vbar)rhr;)�side�fill�hbar)rhr3ZyscrollcommandZxscrollcommandr9ZCommandZControlz
<%s-minus>z<%s-underscore>z
<%s-equal>z	<%s-plus>z<Control-MouseWheel>z<Control-Button-4>z<Control-Button-5>r	)rkrl�expand)ZFrame�
text_frameZTextr8rZ	ScrollbarrjZyviewZpackZLEFT�YrLrmZxviewZBOTTOM�X�set�tuple�txtfontrZbind_all�
decrease_size�
increase_size�bind�update_mousewheelZBOTH)r_r?ror8rjrmZshortcutr"r"r#rN�s2�



zDemoWindow.makeTextFramecCs�|tj_d|_d|_t�|dd|j|j�tj_|_}|��|j�	d|j
�d|jd<t��|_}tj
�||j�|j|_|gtj_|S)Ni�i iXz<Configure>rr/)r@Z_ScreenrArcrdZScrolledCanvasrbZ
adjustScrollsZ_rootwindowrwrfZScreen�screen�TurtleScreenra�scanvasZ	RawTurtleZscreens)r_r?ZcanvasZ_s_r"r"r#rO�s$�

zDemoWindow.makeGraphFramecCs(|td<tt�|jd<d||jd<dS)Nr	r9zFont size %dr8)rtrsr8rP)r_�sizer"r"r#�set_txtsize�szDemoWindow.set_txtsizecCs|�ttddt��dS�Nr	�break)r}�maxrt�MINIMUM_FONT_SIZE�r_Zdummyr"r"r#ru�szDemoWindow.decrease_sizecCs|�ttddt��dSr~)r}�minrt�MAXIMUM_FONT_SIZEr�r"r"r#rvszDemoWindow.increase_sizecCs$|jdktkr|��S|��SdS)Nr)Zdeltarrurv)r_rer"r"r#rxszDemoWindow.update_mousewheel��bluecCsh|jj||tkrdndd�|jj||tkr0dndd�|jj||tkrLdndd�|jj||d�dS)Nz#d00z#fca)r^r4)r8r:)rS�config�NORMALrUrWrP)r_�start�stop�clearZtxtZcolorr"r"r#r[s���zDemoWindow.configGUIcs:t|�}t�D]&}|f�fdd�	}|j|dt|d�q|S)Ncs��|�dS�N)rZ)r!�r_r"r#�loadsz)DemoWindow.makeLoadDemoMenu.<locals>.loadr�r1r2r9r;)rHr(�add_command�menufont)r_�masterr0r!r�r"r�r#rIs
�zDemoWindow.makeLoadDemoMenucsht|�}|jd�jtd�|jd�jtd�|��tD]*}|f�fdd�	}|jt|�dt|d�q8|S)NzDecrease (C-'-'))r1r;r9zIncrease (C-'+')cs��|�dSr�)r})r|r�r"r#�resize(sz'DemoWindow.makeFontMenu.<locals>.resizerr�)rHr�rur�rvZ
add_separator�
font_sizes�str)r_r�r0r|r�r"r�r#rJs
�
��zDemoWindow.makeFontMenucs<t|�}tD]*\}}||f�fdd�	}|j|t|d�q|S)Ncst�j||�dSr�)rr?)�
help_label�	help_filer�r"r#�show2sz%DemoWindow.makeHelpMenu.<locals>.show)r1r9r;)rH�help_entriesr�r�)r_r�r0r�r�r�r"r�r#rK.s
zDemoWindow.makeHelpMenucCs|jr|j��d|_dS�NF)rXryr�r�r"r"r#�
refreshCanvas7s
zDemoWindow.refreshCanvasc	Cs�|��dtj_d|}t|�tj||_t|jj	d��}|�
�}W5QRX|j�dd�|j�
d|�|j�|d�|�tttdd�t|_dS)	NFzturtledemo.�rz1.0�endz# - a Python turtle graphics examplezPress start button�red)rVr@rz�_RUNNING�
__import__�sys�modules�module�open�__file__�readr8�delete�insertr?rBr[r�r\�READYr^)r_r`�modname�f�charsr"r"r#rZ<s
�zDemoWindow.loadfilecCs�|��d|_dtj_|�tttdd�|j�	�|j�
d�t|_z$|j
��}|dkr`t|_nt|_Wn0tjk
r�|jdkr�YdSt|_d}YnX|jtkr�|�ttt|�n"|jtkr�d|_|�tttdd�dS)	NTzdemo running...r>ZstandardZ	EVENTLOOPzstopped!zuse mouse/keys or STOPr�)r�rXr@rzr�r[r\r�ryr��mode�RUNNINGr^r��main�EVENTDRIVEN�DONEZ
Terminatorr?rY)r_�resultr"r"r#rRKs<
�






�

�zDemoWindow.startDemocCs4|��|j�d�|jjdd�|�ttt�dS)N�allr�)Zcursor)r�ryZ_deleter{r�r[r�r\r�r"r"r#rVhszDemoWindow.clearCanvascCs2|jr&|��d|_|�tttdd�dtj_dS)NFzSTOPPED!r�)rYrVr[r�r\r@rzr�r�r"r"r#rTns
�zDemoWindow.stopItcCsdtj_|j��d|_dSr�)r@rzr�r?Zdestroyr�r"r"r#rCvs
zDemoWindow._destroy)N)N)N)r�r�)�__name__�
__module__�__qualname__rarfrNrOr}rurvrxr[rIrJrKr�rZrRrVrTrCr"r"r"r#r)s$
D


	
	r)cCst�}|j��dSr�)r)r?Zmainloop)Zdemor"r"r#r�|sr��__main__)'rr�r%ZtkinterZidlelib.colorizerrrZidlelib.percolatorrZidlelib.textviewrZ
turtledemoZabout_turtledemor@�path�dirname�abspathr�r'�platformrr]r�r�r�r�r�r�rQrtr�r�r�r(r��objectr)r�r�r"r"r"r#�<module>s>U


�~
turtledemo/__pycache__/forest.cpython-38.pyc000064400000006375151153537630015116 0ustar00U

e5d��@s�dZddlmZmZmZmZddlmZddlm	Z
dd�Zdd�Zd	d
�Z
dd
d�Zdd�Zdd�Zdd�Zdd�Zdd�Zedkr�e�e�dS)a4     turtlegraphics-example-suite:

             tdemo_forest.py

Displays a 'forest' of 3 breadth-first-trees
similar to the one in tree.
For further remarks see tree.py

This example is a 'breadth-first'-rewrite of
a Logo program written by Erich Neuwirth. See
http://homepage.univie.ac.at/erich.neuwirth/
�)�Turtle�	colormode�tracer�mainloop��	randrange)�perf_countercCst||d�S)N�r)�n�r�)/usr/lib64/python3.8/turtledemo/forest.py�	symRandomsr
cs��fdd�|D�S)Ncs,g|]$\}}|t��|dt��f�qS)g)\��(�?)r
)�.0�angle�
sizefactor��	angledist�sizedistrr�
<listcomp>s�
�zrandomize.<locals>.<listcomp>r)�
branchlistrrrrr�	randomizes�rcCs2t|�D]$}|�t|��|�d||�qdS)Ng�?)�range�leftr
Zforward)�tZdistance�partsr�irrr�randomfdsr�
�ccs�|dkr�g}g}tt||��D]�\}	}
|	�||�|	�ddd|td�dd|td�d�|	��t|	|||�dV|
D]<\}}|	�|�|�|	�	��|�t
|
||��|	�|�q�qt||||d||||�D]
}
dVq�dS)Nr����r	)
�list�zipZpensizeZpencolorr
�pendownrr�appendZcloner�right�tree)Ztlist�size�levelZwidthfactorZbranchlistsrrZlstZbrsrrrr�xrrrr(s,�
�r(cCsLtd�|��|�d�|��|�d�|��|�||�|��dS)Nrr�Z)r�resetZspeed�
hideturtlerZpenupZsetposr%)rr+�yrrr�start7s

r0cCs2|��t|dd�t|gd|ddddgg�}|S)N�i0����P皙�����?��-g�G�z�?)r��������?�����g���Q��?�r.r0r(�r*Zpenrrrr�doit1Asr;cCs0|��t|dd�t|gd|dddgg�}|S)Niy���i~����xr3r4r7r9r:rrr�doit2Gsr=cCs2|��t|dd�t|gd|ddddgg�}|S)N�i�����dr3)r5gffffff�?)rg
ףp=
�?)r8r6r9r:rrr�doit3Msr@cCs�t�}|��tdd�tdtdd��}tdtdd��}tdtdd��}t�}d}|||fD]&}z|��Wq\|d7}Yq\Xq\|dkrNq�qNtdd	�t�}d
||S)N�Kr�r	)Zundobuffersize�r�rzruntime: %.2f sec.)rZhtrr;r=r@�clock�__next__)�p�u�sr�aZdone�brrr�mainTs$

rL�__main__N)rr)�__doc__ZturtlerrrrZrandomr�timerrEr
rrr(r0r;r=r@rL�__name__rrrr�<module>s

turtledemo/__pycache__/planet_and_moon.cpython-38.opt-1.pyc000064400000006636151153537630017710 0ustar00U

e5d�@s`dZddlmZmZmZmZdZGdd�de�Z	Gdd�de�Z
dd	�Zed
kr\e�e�dS)a�       turtle-example-suite:

        tdemo_planets_and_moon.py

Gravitational system simulation using the
approximation method from Feynman-lectures,
p.9-8, using turtlegraphics.

Example: heavy central body, light planet,
very light moon!
Planet has a circular orbit, moon a stable
orbit around the planet.

You can hold the movement temporarily by
pressing the left mouse button with the
mouse over the scrollbar of the canvas.

�)�Shape�Turtle�mainloop�Vec2D�c@s$eZdZdd�Zdd�Zdd�ZdS)�GravSyscCsg|_d|_d|_dS)Nrg{�G�z�?)�planets�t�dt)�self�r�2/usr/lib64/python3.8/turtledemo/planet_and_moon.py�__init__szGravSys.__init__cCs|jD]}|��qdS)N)r�init)r�prrr
rs
zGravSys.initcCs6td�D](}|j|j7_|jD]}|��q"qdS)Ni')�ranger	r
r�step)r�irrrr
�start s
z
GravSys.startN)�__name__�
__module__�__qualname__rrrrrrr
rsrc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�StarcCsTtj||d�|��||_|�|�||_|j�|�||_|�	d�|�
�dS)N)�shape�user)rrZpenup�m�setpos�vr�append�gravSysZ
resizemodeZpendown)rr�xrrrrrr
r's

z
Star.__init__cCs,|jj}|��|_|jd||j|_dS)N��?)rr
�acc�ar�rr
rrr
r1s
z	Star.initcCsRtdd�}|jjD]:}||kr|��|��}|t|jt|�d|7}q|S)Nr�)�Vecrr�pos�Gr�abs)rr#�planetrrrr
r"5s
 zStar.acccCsj|jj}|�|��||j�|jj�|�dkrJ|�|�|jjd��|�	�|_
|j||j
|_dS)Nr)rr
rr'rr�indexZ
setheadingZtowardsr"r#r$rrr
r<s
z	Star.stepN)rrrrrr"rrrrr
r&s
rcCs|t�}|��|���dd�|��|��|�d�|�d�|��|�	dd�|�
�|��}|��|�	dd�|�
�|��}td�}|�
|d�|�
|d�|���d|�|���d	d�t�}td
tdd�tdd�|d�}|�d
�|�d�|��tdtdd�tdd�|d�}|�d�|�d�td	tdd�tdd�|d�}|�d�|�d�|��|��dS)Nr��Z�ZcompoundZorangeZbluer*�i@Bg��circleZyellowg������?i�0����Zgreeng�������?��i'r!zDone!)r�resetZ	getscreenZtracerZhtZpu�fd�ltZ
begin_polyr0Zend_polyZget_polyrZaddcomponentZregister_shaperrr&ZcolorZ	shapesizeZpencolorrr)�sZm1Zm2ZplanetshapeZgsZsunZearthZmoonrrr
�mainFsD







r8�__main__N)
�__doc__Zturtlerrrrr&r(�objectrrr8rrrrr
�<module>s 'turtledemo/__pycache__/chaos.cpython-38.opt-1.pyc000064400000003262151153537630015640 0ustar00U

e5d��@sdddlTdZdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�Z	e
dkr`e	�e�dS)�)�*�PcCsd|d|S)N�333333@����xrr�(/usr/lib64/python3.8/turtledemo/chaos.py�fsr
cCsd||dS)Nr�rrrrr	�gsrcCsd|d||S)Nrrrrrr	�hsr
cCst�t||�dS�N)Zpenup�goto)r�yrrr	�jumptosrcCst||�t�t||�dSr)r�pendownr)Zx1Zy1Zx2Zy2rrr	�lines
rcCs$tddtdd�tdddd�dS)N���rr皙������皙�����?)r�Nrrrr	�coosyssrcCsTt|�|}td|�t�td�tt�D]"}||�}t|d|�td�q,dS)Nr�r)Zpencolorrr�dot�rangerr)Zfun�startZcolorr�irrr	�plot s
rcCsxt�tddtdd�td�t�t�ttdd�ttdd�tt	dd	�t
d
�D]}td|dtdd�qXdS)
Ng�rrrrgffffff�?ZblueZgreenZred�dg�?zDone!)�resetZsetworldcoordinatesrZspeedZ
hideturtlerrr
rr
r)�srrr	�main+sr"�__main__N)Zturtlerr
rr
rrrrr"�__name__Zmainlooprrrr	�<module>sturtledemo/__pycache__/bytedesign.cpython-38.opt-1.pyc000064400000010263151153537630016677 0ustar00U

e5d��@sXdZddlmZmZddlmZGdd�de�Zdd�Ze	dkrTe�Z
ee
�e�d	S)
a�      turtle-example-suite:

        tdemo_bytedesign.py

An example adapted from the example-suite
of PythonCard's turtle graphics.

It's based on an article in BYTE magazine
Problem Solving with Logo: Using Turtle
Graphics to Redraw a Design
November 1982, p. 118 - 134

-------------------------------------------

Due to the statement

t.delay(0)

in line 152, which sets the animation delay
to 0, this animation runs in "line per line"
mode as fast as possible.
�)�Turtle�mainloop)�perf_counterc@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)�DesignercCs�|��td�D]J}|�d|�|��|�|��|�|��|�d|�|�d�q|��|�|�|�d�|�d|�|�d�|��|�	d|d|�|�
��d	�dS)
N�g�����)P@�H�$g�8@���.g������a@T)�up�range�forward�down�wheel�position�backward�right�goto�centerpiece�	getscreen�tracer)�selfZhomePos�scale�i�r�-/usr/lib64/python3.8/turtledemo/bytedesign.py�design s 


zDesigner.designcCs�|�d�td�D]}|�||�q|��|�d�td�D]}|�||�q>|�d�td�D]:}|��|�d�|�d|�|��|�d|�qb|�d�|�	��
�dS)N�6�rrr�)rr�	pentpiecer�left�tripiecer
rrr�update)r�initposrrrrrr2s 




zDesigner.wheelcCs�|��}|��|�d|�|�d||�|��|�|�|�|�|��|�d|�|�d||�|��|�|�|�|�|�d�|�	��
�dS)Ng@g�?@r)�headingrr�tripolyrrr�
setheading�tripolylr!rr#)rr$r�oldhrrrr"Ds




zDesigner.tripiececCs�|��}|��|�d|�|��td�D]}|�d|�|�d�q.|�d|d|�|��|�|�|�|�|�d|�|��td�D]}|�d|�|�d�q�|�	d|d|�|��|�|�|�|�|�
d�|����dS)N�r�r�K)
r%rr
rrr�pentrrr'�pentlr!rr#)rr$rr)rrrrr Us,




zDesigner.pentpiececCs>|d|krdS|�|�|�|�|�|d|||�dS�N�gR���Q�?)r
r!r.�r�sideZangrrrrr.ms


zDesigner.pentlcCs>|d|krdS|�|�|�|�|�|d|||�dSr/)r
rr-r1rrrr-ss


zDesigner.pentrcCsh|d|krdS|�|�|�d�|�|d�|�d�|�|d�|�d�|�|d|�dS�Nr�og{�G�z�?g�������?�g�?)r
rr&�rr2rrrrr&ys



zDesigner.tripolyrcCsh|d|krdS|�|�|�d�|�|d�|�d�|�|d�|�d�|�|d|�dSr3)r
r!r(r6rrrr(�s



zDesigner.tripolylcCs>|�|�|�|�|d|kr$dS|�|d|||�dS)Ng@g333333�?)r
r!r)r�s�arrrrr�s


zDesigner.centerpieceN)�__name__�
__module__�__qualname__rrr"r r.r-r&r(rrrrrrs

rcCs\t�}|�d�|��|���d�|���d�t�}|�|��d�t�}d||S)Nrr0zruntime: %.2f sec.)	rZspeedZ
hideturtlerZdelayr�clockrr)�tZatZetrrr�main�s
r>�__main__N)�__doc__Zturtlerr�timerr<rr>r9�msg�printrrrr�<module>suturtledemo/__pycache__/minimal_hanoi.cpython-38.pyc000064400000005413151153537630016410 0ustar00U

e5d�@sddZddlTGdd�de�ZGdd�de�Zdd�Zd	d
�Zdd�Ze	d
kr`e�Z
ee
�e�dS)a�       turtle-example-suite:

         tdemo_minimal_hanoi.py

A minimal 'Towers of Hanoi' animation:
A tower of 6 discs is transferred from the
left to the right peg.

An imho quite elegant and concise
implementation using a tower class, which
is derived from the built-in type list.

Discs are turtles with shape "square", but
stretched to rectangles by shapesize()
 ---------------------------------------
       To exit press STOP button
 ---------------------------------------
�)�*c@seZdZdd�ZdS)�DisccCsPtj|ddd�|��|�d|dd�|�|ddd|d�|��dS)	NZsquareF)�shapeZvisibleg�?�g@r�)�Turtle�__init__ZpuZ	shapesizeZ	fillcolor�st)�self�n�r�0/usr/lib64/python3.8/turtledemo/minimal_hanoi.pyrs
z
Disc.__init__N)�__name__�
__module__�__qualname__rrrrr
rsrc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�Towerz-Hanoi tower, a subclass of built-in type listcCs
||_dS)z-create an empty tower. x is x-position of pegN)�x)r
rrrr
r szTower.__init__cCs0|�|j�|�ddt|��|�|�dS)Nij����")Zsetxr�sety�len�append�r
�drrr
�push#sz
Tower.pushcCst�|�}|�d�|S)N�)�list�poprrrrr
r's

z	Tower.popN)rrr�__doc__rrrrrrr
rsrcCs>|dkr:t|d|||�|�|���t|d|||�dS)Nrr)�hanoirr)rZfrom_Zwith_Zto_rrr
r,srcCsJtdd�t�z tdttt�tdddd�Wntk
rDYnXdS)N�space�zpress STOP button to exit�center�ZCourier�Zbold�ZalignZfont)�onkey�clearr�t1�t2�t3�writeZ
Terminatorrrrr
�play2s
�
r+cCspt�t�tdd�td�atd�atd�atddd�D]}t�t	|��q:t
ddd	d
�ttd�t
�dS)
Nri���i����r ���zpress spacebar to start gamer!r"r$rZ	EVENTLOOP)ZhtZpenupZgotorr'r(r)�rangerrr*r%r+Zlisten)�irrr
�main<s
�
r0�__main__N)
rZturtlerrrrrr+r0r�msg�printZmainlooprrrr
�<module>s
turtledemo/__pycache__/minimal_hanoi.cpython-38.opt-2.pyc000064400000004253151153537630017351 0ustar00U

e5d�@s`ddlTGdd�de�ZGdd�de�Zdd�Zdd	�Zd
d�Zedkr\e�Z	e
e	�e�d
S)�)�*c@seZdZdd�ZdS)�DisccCsPtj|ddd�|��|�d|dd�|�|ddd|d�|��dS)	NZsquareF)�shapeZvisibleg�?�g@r�)�Turtle�__init__ZpuZ	shapesizeZ	fillcolor�st)�self�n�r�0/usr/lib64/python3.8/turtledemo/minimal_hanoi.pyrs
z
Disc.__init__N)�__name__�
__module__�__qualname__rrrrr
rsrc@s$eZdZdd�Zdd�Zdd�ZdS)�TowercCs
||_dS)N)�x)r
rrrr
r szTower.__init__cCs0|�|j�|�ddt|��|�|�dS)Nij����")Zsetxr�sety�len�append�r
�drrr
�push#sz
Tower.pushcCst�|�}|�d�|S)N�)�list�poprrrrr
r's

z	Tower.popN)rrrrrrrrrr
rsrcCs>|dkr:t|d|||�|�|���t|d|||�dS)Nrr)�hanoirr)rZfrom_Zwith_Zto_rrr
r,srcCsJtdd�t�z tdttt�tdddd�Wntk
rDYnXdS)N�space�zpress STOP button to exit�center�ZCourier�Zbold�ZalignZfont)�onkey�clearr�t1�t2�t3�writeZ
Terminatorrrrr
�play2s
�
r*cCspt�t�tdd�td�atd�atd�atddd�D]}t�t	|��q:t
ddd	d
�ttd�t
�dS)
Nri���i����r���zpress spacebar to start gamer r!r#rZ	EVENTLOOP)ZhtZpenupZgotorr&r'r(�rangerrr)r$r*Zlisten)�irrr
�main<s
�
r/�__main__N)Zturtlerrrrrr*r/r�msg�printZmainlooprrrr
�<module>s
turtledemo/planet_and_moon.py000075500000005410151153537630012453 0ustar00#! /usr/bin/python3.8
"""       turtle-example-suite:

        tdemo_planets_and_moon.py

Gravitational system simulation using the
approximation method from Feynman-lectures,
p.9-8, using turtlegraphics.

Example: heavy central body, light planet,
very light moon!
Planet has a circular orbit, moon a stable
orbit around the planet.

You can hold the movement temporarily by
pressing the left mouse button with the
mouse over the scrollbar of the canvas.

"""
from turtle import Shape, Turtle, mainloop, Vec2D as Vec

G = 8

class GravSys(object):
    def __init__(self):
        self.planets = []
        self.t = 0
        self.dt = 0.01
    def init(self):
        for p in self.planets:
            p.init()
    def start(self):
        for i in range(10000):
            self.t += self.dt
            for p in self.planets:
                p.step()

class Star(Turtle):
    def __init__(self, m, x, v, gravSys, shape):
        Turtle.__init__(self, shape=shape)
        self.penup()
        self.m = m
        self.setpos(x)
        self.v = v
        gravSys.planets.append(self)
        self.gravSys = gravSys
        self.resizemode("user")
        self.pendown()
    def init(self):
        dt = self.gravSys.dt
        self.a = self.acc()
        self.v = self.v + 0.5*dt*self.a
    def acc(self):
        a = Vec(0,0)
        for planet in self.gravSys.planets:
            if planet != self:
                v = planet.pos()-self.pos()
                a += (G*planet.m/abs(v)**3)*v
        return a
    def step(self):
        dt = self.gravSys.dt
        self.setpos(self.pos() + dt*self.v)
        if self.gravSys.planets.index(self) != 0:
            self.setheading(self.towards(self.gravSys.planets[0]))
        self.a = self.acc()
        self.v = self.v + dt*self.a

## create compound yellow/blue turtleshape for planets

def main():
    s = Turtle()
    s.reset()
    s.getscreen().tracer(0,0)
    s.ht()
    s.pu()
    s.fd(6)
    s.lt(90)
    s.begin_poly()
    s.circle(6, 180)
    s.end_poly()
    m1 = s.get_poly()
    s.begin_poly()
    s.circle(6,180)
    s.end_poly()
    m2 = s.get_poly()

    planetshape = Shape("compound")
    planetshape.addcomponent(m1,"orange")
    planetshape.addcomponent(m2,"blue")
    s.getscreen().register_shape("planet", planetshape)
    s.getscreen().tracer(1,0)

    ## setup gravitational system
    gs = GravSys()
    sun = Star(1000000, Vec(0,0), Vec(0,-2.5), gs, "circle")
    sun.color("yellow")
    sun.shapesize(1.8)
    sun.pu()
    earth = Star(12500, Vec(210,0), Vec(0,195), gs, "planet")
    earth.pencolor("green")
    earth.shapesize(0.8)
    moon = Star(1, Vec(220,0), Vec(0,295), gs, "planet")
    moon.pencolor("blue")
    moon.shapesize(0.5)
    gs.init()
    gs.start()
    return "Done!"

if __name__ == '__main__':
    main()
    mainloop()
turtledemo/minimal_hanoi.py000075500000004002151153537630012116 0ustar00#! /usr/bin/python3.8
"""       turtle-example-suite:

         tdemo_minimal_hanoi.py

A minimal 'Towers of Hanoi' animation:
A tower of 6 discs is transferred from the
left to the right peg.

An imho quite elegant and concise
implementation using a tower class, which
is derived from the built-in type list.

Discs are turtles with shape "square", but
stretched to rectangles by shapesize()
 ---------------------------------------
       To exit press STOP button
 ---------------------------------------
"""
from turtle import *

class Disc(Turtle):
    def __init__(self, n):
        Turtle.__init__(self, shape="square", visible=False)
        self.pu()
        self.shapesize(1.5, n*1.5, 2) # square-->rectangle
        self.fillcolor(n/6., 0, 1-n/6.)
        self.st()

class Tower(list):
    "Hanoi tower, a subclass of built-in type list"
    def __init__(self, x):
        "create an empty tower. x is x-position of peg"
        self.x = x
    def push(self, d):
        d.setx(self.x)
        d.sety(-150+34*len(self))
        self.append(d)
    def pop(self):
        d = list.pop(self)
        d.sety(150)
        return d

def hanoi(n, from_, with_, to_):
    if n > 0:
        hanoi(n-1, from_, to_, with_)
        to_.push(from_.pop())
        hanoi(n-1, with_, from_, to_)

def play():
    onkey(None,"space")
    clear()
    try:
        hanoi(6, t1, t2, t3)
        write("press STOP button to exit",
              align="center", font=("Courier", 16, "bold"))
    except Terminator:
        pass  # turtledemo user pressed STOP

def main():
    global t1, t2, t3
    ht(); penup(); goto(0, -225)   # writer turtle
    t1 = Tower(-250)
    t2 = Tower(0)
    t3 = Tower(250)
    # make tower of 6 discs
    for i in range(6,0,-1):
        t1.push(Disc(i))
    # prepare spartanic user interface ;-)
    write("press spacebar to start game",
          align="center", font=("Courier", 16, "bold"))
    onkey(play, "space")
    listen()
    return "EVENTLOOP"

if __name__=="__main__":
    msg = main()
    print(msg)
    mainloop()
turtledemo/fractalcurves.py000075500000006620151153537630012166 0ustar00#! /usr/bin/python3.8
"""      turtle-example-suite:

        tdemo_fractalCurves.py

This program draws two fractal-curve-designs:
(1) A hilbert curve (in a box)
(2) A combination of Koch-curves.

The CurvesTurtle class and the fractal-curve-
methods are taken from the PythonCard example
scripts for turtle-graphics.
"""
from turtle import *
from time import sleep, perf_counter as clock

class CurvesTurtle(Pen):
    # example derived from
    # Turtle Geometry: The Computer as a Medium for Exploring Mathematics
    # by Harold Abelson and Andrea diSessa
    # p. 96-98
    def hilbert(self, size, level, parity):
        if level == 0:
            return
        # rotate and draw first subcurve with opposite parity to big curve
        self.left(parity * 90)
        self.hilbert(size, level - 1, -parity)
        # interface to and draw second subcurve with same parity as big curve
        self.forward(size)
        self.right(parity * 90)
        self.hilbert(size, level - 1, parity)
        # third subcurve
        self.forward(size)
        self.hilbert(size, level - 1, parity)
        # fourth subcurve
        self.right(parity * 90)
        self.forward(size)
        self.hilbert(size, level - 1, -parity)
        # a final turn is needed to make the turtle
        # end up facing outward from the large square
        self.left(parity * 90)

    # Visual Modeling with Logo: A Structural Approach to Seeing
    # by James Clayson
    # Koch curve, after Helge von Koch who introduced this geometric figure in 1904
    # p. 146
    def fractalgon(self, n, rad, lev, dir):
        import math

        # if dir = 1 turn outward
        # if dir = -1 turn inward
        edge = 2 * rad * math.sin(math.pi / n)
        self.pu()
        self.fd(rad)
        self.pd()
        self.rt(180 - (90 * (n - 2) / n))
        for i in range(n):
            self.fractal(edge, lev, dir)
            self.rt(360 / n)
        self.lt(180 - (90 * (n - 2) / n))
        self.pu()
        self.bk(rad)
        self.pd()

    # p. 146
    def fractal(self, dist, depth, dir):
        if depth < 1:
            self.fd(dist)
            return
        self.fractal(dist / 3, depth - 1, dir)
        self.lt(60 * dir)
        self.fractal(dist / 3, depth - 1, dir)
        self.rt(120 * dir)
        self.fractal(dist / 3, depth - 1, dir)
        self.lt(60 * dir)
        self.fractal(dist / 3, depth - 1, dir)

def main():
    ft = CurvesTurtle()

    ft.reset()
    ft.speed(0)
    ft.ht()
    ft.getscreen().tracer(1,0)
    ft.pu()

    size = 6
    ft.setpos(-33*size, -32*size)
    ft.pd()

    ta=clock()
    ft.fillcolor("red")
    ft.begin_fill()
    ft.fd(size)

    ft.hilbert(size, 6, 1)

    # frame
    ft.fd(size)
    for i in range(3):
        ft.lt(90)
        ft.fd(size*(64+i%2))
    ft.pu()
    for i in range(2):
        ft.fd(size)
        ft.rt(90)
    ft.pd()
    for i in range(4):
        ft.fd(size*(66+i%2))
        ft.rt(90)
    ft.end_fill()
    tb=clock()
    res =  "Hilbert: %.2fsec. " % (tb-ta)

    sleep(3)

    ft.reset()
    ft.speed(0)
    ft.ht()
    ft.getscreen().tracer(1,0)

    ta=clock()
    ft.color("black", "blue")
    ft.begin_fill()
    ft.fractalgon(3, 250, 4, 1)
    ft.end_fill()
    ft.begin_fill()
    ft.color("red")
    ft.fractalgon(3, 200, 4, -1)
    ft.end_fill()
    tb=clock()
    res +=  "Koch: %.2fsec." % (tb-ta)
    return res

if __name__  == '__main__':
    msg = main()
    print(msg)
    mainloop()
turtledemo/two_canvases.py000064400000002137151153537630012012 0ustar00"""turtledemo.two_canvases

Use TurtleScreen and RawTurtle to draw on two
distinct canvases in a separate window. The
new window must be separately closed in
addition to pressing the STOP button.
"""

from turtle import TurtleScreen, RawTurtle, TK

def main():
    root = TK.Tk()
    cv1 = TK.Canvas(root, width=300, height=200, bg="#ddffff")
    cv2 = TK.Canvas(root, width=300, height=200, bg="#ffeeee")
    cv1.pack()
    cv2.pack()

    s1 = TurtleScreen(cv1)
    s1.bgcolor(0.85, 0.85, 1)
    s2 = TurtleScreen(cv2)
    s2.bgcolor(1, 0.85, 0.85)

    p = RawTurtle(s1)
    q = RawTurtle(s2)

    p.color("red", (1, 0.85, 0.85))
    p.width(3)
    q.color("blue", (0.85, 0.85, 1))
    q.width(3)

    for t in p,q:
        t.shape("turtle")
        t.lt(36)

    q.lt(180)

    for t in p, q:
        t.begin_fill()
    for i in range(5):
        for t in p, q:
            t.fd(50)
            t.lt(72)
    for t in p,q:
        t.end_fill()
        t.lt(54)
        t.pu()
        t.bk(50)

    return "EVENTLOOP"


if __name__ == '__main__':
    main()
    TK.mainloop()  # keep window open until user closes it
turtledemo/peace.py000075500000002051151153537630010371 0ustar00#! /usr/bin/python3.8
"""       turtle-example-suite:

              tdemo_peace.py

A simple drawing suitable as a beginner's
programming example. Aside from the
peacecolors assignment and the for loop,
it only uses turtle commands.
"""

from turtle import *

def main():
    peacecolors = ("red3",  "orange", "yellow",
                   "seagreen4", "orchid4",
                   "royalblue1", "dodgerblue4")

    reset()
    Screen()
    up()
    goto(-320,-195)
    width(70)

    for pcolor in peacecolors:
        color(pcolor)
        down()
        forward(640)
        up()
        backward(640)
        left(90)
        forward(66)
        right(90)

    width(25)
    color("white")
    goto(0,-170)
    down()

    circle(170)
    left(90)
    forward(340)
    up()
    left(180)
    forward(170)
    right(45)
    down()
    forward(170)
    up()
    backward(170)
    left(90)
    down()
    forward(170)
    up()

    goto(0,300) # vanish if hideturtle() is not available ;-)
    return "Done!"

if __name__ == "__main__":
    main()
    mainloop()
turtledemo/yinyang.py000075500000001464151153537630011001 0ustar00#! /usr/bin/python3.8
"""       turtle-example-suite:

            tdemo_yinyang.py

Another drawing suitable as a beginner's
programming example.

The small circles are drawn by the circle
command.

"""

from turtle import *

def yin(radius, color1, color2):
    width(3)
    color("black", color1)
    begin_fill()
    circle(radius/2., 180)
    circle(radius, 180)
    left(180)
    circle(-radius/2., 180)
    end_fill()
    left(90)
    up()
    forward(radius*0.35)
    right(90)
    down()
    color(color1, color2)
    begin_fill()
    circle(radius*0.15)
    end_fill()
    left(90)
    up()
    backward(radius*0.35)
    down()
    left(90)

def main():
    reset()
    yin(200, "black", "white")
    yin(200, "white", "black")
    ht()
    return "Done!"

if __name__ == '__main__':
    main()
    mainloop()
turtledemo/sorting_animate.py000064400000011645151153537630012505 0ustar00"""

         sorting_animation.py

A minimal sorting algorithm animation:
Sorts a shelf of 10 blocks using insertion
sort, selection sort and quicksort.

Shelfs are implemented using builtin lists.

Blocks are turtles with shape "square", but
stretched to rectangles by shapesize()
 ---------------------------------------
       To exit press space button
 ---------------------------------------
"""
from turtle import *
import random


class Block(Turtle):

    def __init__(self, size):
        self.size = size
        Turtle.__init__(self, shape="square", visible=False)
        self.pu()
        self.shapesize(size * 1.5, 1.5, 2) # square-->rectangle
        self.fillcolor("black")
        self.st()

    def glow(self):
        self.fillcolor("red")

    def unglow(self):
        self.fillcolor("black")

    def __repr__(self):
        return "Block size: {0}".format(self.size)


class Shelf(list):

    def __init__(self, y):
        "create a shelf. y is y-position of first block"
        self.y = y
        self.x = -150

    def push(self, d):
        width, _, _ = d.shapesize()
        # align blocks by the bottom edge
        y_offset = width / 2 * 20
        d.sety(self.y + y_offset)
        d.setx(self.x + 34 * len(self))
        self.append(d)

    def _close_gap_from_i(self, i):
        for b in self[i:]:
            xpos, _ = b.pos()
            b.setx(xpos - 34)

    def _open_gap_from_i(self, i):
        for b in self[i:]:
            xpos, _ = b.pos()
            b.setx(xpos + 34)

    def pop(self, key):
        b = list.pop(self, key)
        b.glow()
        b.sety(200)
        self._close_gap_from_i(key)
        return b

    def insert(self, key, b):
        self._open_gap_from_i(key)
        list.insert(self, key, b)
        b.setx(self.x + 34 * key)
        width, _, _ = b.shapesize()
        # align blocks by the bottom edge
        y_offset = width / 2 * 20
        b.sety(self.y + y_offset)
        b.unglow()

def isort(shelf):
    length = len(shelf)
    for i in range(1, length):
        hole = i
        while hole > 0 and shelf[i].size < shelf[hole - 1].size:
            hole = hole - 1
        shelf.insert(hole, shelf.pop(i))
    return

def ssort(shelf):
    length = len(shelf)
    for j in range(0, length - 1):
        imin = j
        for i in range(j + 1, length):
            if shelf[i].size < shelf[imin].size:
                imin = i
        if imin != j:
            shelf.insert(j, shelf.pop(imin))

def partition(shelf, left, right, pivot_index):
    pivot = shelf[pivot_index]
    shelf.insert(right, shelf.pop(pivot_index))
    store_index = left
    for i in range(left, right): # range is non-inclusive of ending value
        if shelf[i].size < pivot.size:
            shelf.insert(store_index, shelf.pop(i))
            store_index = store_index + 1
    shelf.insert(store_index, shelf.pop(right)) # move pivot to correct position
    return store_index

def qsort(shelf, left, right):
    if left < right:
        pivot_index = left
        pivot_new_index = partition(shelf, left, right, pivot_index)
        qsort(shelf, left, pivot_new_index - 1)
        qsort(shelf, pivot_new_index + 1, right)

def randomize():
    disable_keys()
    clear()
    target = list(range(10))
    random.shuffle(target)
    for i, t in enumerate(target):
        for j in range(i, len(s)):
            if s[j].size == t + 1:
                s.insert(i, s.pop(j))
    show_text(instructions1)
    show_text(instructions2, line=1)
    enable_keys()

def show_text(text, line=0):
    line = 20 * line
    goto(0,-250 - line)
    write(text, align="center", font=("Courier", 16, "bold"))

def start_ssort():
    disable_keys()
    clear()
    show_text("Selection Sort")
    ssort(s)
    clear()
    show_text(instructions1)
    show_text(instructions2, line=1)
    enable_keys()

def start_isort():
    disable_keys()
    clear()
    show_text("Insertion Sort")
    isort(s)
    clear()
    show_text(instructions1)
    show_text(instructions2, line=1)
    enable_keys()

def start_qsort():
    disable_keys()
    clear()
    show_text("Quicksort")
    qsort(s, 0, len(s) - 1)
    clear()
    show_text(instructions1)
    show_text(instructions2, line=1)
    enable_keys()

def init_shelf():
    global s
    s = Shelf(-200)
    vals = (4, 2, 8, 9, 1, 5, 10, 3, 7, 6)
    for i in vals:
        s.push(Block(i))

def disable_keys():
    onkey(None, "s")
    onkey(None, "i")
    onkey(None, "q")
    onkey(None, "r")

def enable_keys():
    onkey(start_isort, "i")
    onkey(start_ssort, "s")
    onkey(start_qsort, "q")
    onkey(randomize, "r")
    onkey(bye, "space")

def main():
    getscreen().clearscreen()
    ht(); penup()
    init_shelf()
    show_text(instructions1)
    show_text(instructions2, line=1)
    enable_keys()
    listen()
    return "EVENTLOOP"

instructions1 = "press i for insertion sort, s for selection sort, q for quicksort"
instructions2 = "spacebar to quit, r to randomize"

if __name__=="__main__":
    msg = main()
    mainloop()
turtledemo/paint.py000075500000002412151153537630010430 0ustar00#! /usr/bin/python3.8
"""       turtle-example-suite:

            tdemo_paint.py

A simple  event-driven paint program

- left mouse button moves turtle
- middle mouse button changes color
- right mouse button toggles between pen up
(no line drawn when the turtle moves) and
pen down (line is drawn). If pen up follows
at least two pen-down moves, the polygon that
includes the starting point is filled.
 -------------------------------------------
 Play around by clicking into the canvas
 using all three mouse buttons.
 -------------------------------------------
          To exit press STOP button
 -------------------------------------------
"""
from turtle import *

def switchupdown(x=0, y=0):
    if pen()["pendown"]:
        end_fill()
        up()
    else:
        down()
        begin_fill()

def changecolor(x=0, y=0):
    global colors
    colors = colors[1:]+colors[:1]
    color(colors[0])

def main():
    global colors
    shape("circle")
    resizemode("user")
    shapesize(.5)
    width(3)
    colors=["red", "green", "blue", "yellow"]
    color(colors[0])
    switchupdown()
    onscreenclick(goto,1)
    onscreenclick(changecolor,2)
    onscreenclick(switchupdown,3)
    return "EVENTLOOP"

if __name__ == "__main__":
    msg = main()
    print(msg)
    mainloop()
turtledemo/rosette.py000064400000002521151153537630011000 0ustar00"""      turtle-example-suite:

          tdemo_wikipedia3.py

This example is
inspired by the Wikipedia article on turtle
graphics. (See example wikipedia1 for URLs)

First we create (ne-1) (i.e. 35 in this
example) copies of our first turtle p.
Then we let them perform their steps in
parallel.

Followed by a complete undo().
"""
from turtle import Screen, Turtle, mainloop
from time import perf_counter as clock, sleep

def mn_eck(p, ne,sz):
    turtlelist = [p]
    #create ne-1 additional turtles
    for i in range(1,ne):
        q = p.clone()
        q.rt(360.0/ne)
        turtlelist.append(q)
        p = q
    for i in range(ne):
        c = abs(ne/2.0-i)/(ne*.7)
        # let those ne turtles make a step
        # in parallel:
        for t in turtlelist:
            t.rt(360./ne)
            t.pencolor(1-c,0,c)
            t.fd(sz)

def main():
    s = Screen()
    s.bgcolor("black")
    p=Turtle()
    p.speed(0)
    p.hideturtle()
    p.pencolor("red")
    p.pensize(3)

    s.tracer(36,0)

    at = clock()
    mn_eck(p, 36, 19)
    et = clock()
    z1 = et-at

    sleep(1)

    at = clock()
    while any(t.undobufferentries() for t in s.turtles()):
        for t in s.turtles():
            t.undo()
    et = clock()
    return "runtime: %.3f sec" % (z1+et-at)


if __name__ == '__main__':
    msg = main()
    print(msg)
    mainloop()
turtledemo/bytedesign.py000075500000010227151153537630011455 0ustar00#! /usr/bin/python3.8
"""      turtle-example-suite:

        tdemo_bytedesign.py

An example adapted from the example-suite
of PythonCard's turtle graphics.

It's based on an article in BYTE magazine
Problem Solving with Logo: Using Turtle
Graphics to Redraw a Design
November 1982, p. 118 - 134

-------------------------------------------

Due to the statement

t.delay(0)

in line 152, which sets the animation delay
to 0, this animation runs in "line per line"
mode as fast as possible.
"""

from turtle import Turtle, mainloop
from time import perf_counter as clock

# wrapper for any additional drawing routines
# that need to know about each other
class Designer(Turtle):

    def design(self, homePos, scale):
        self.up()
        for i in range(5):
            self.forward(64.65 * scale)
            self.down()
            self.wheel(self.position(), scale)
            self.up()
            self.backward(64.65 * scale)
            self.right(72)
        self.up()
        self.goto(homePos)
        self.right(36)
        self.forward(24.5 * scale)
        self.right(198)
        self.down()
        self.centerpiece(46 * scale, 143.4, scale)
        self.getscreen().tracer(True)

    def wheel(self, initpos, scale):
        self.right(54)
        for i in range(4):
            self.pentpiece(initpos, scale)
        self.down()
        self.left(36)
        for i in range(5):
            self.tripiece(initpos, scale)
        self.left(36)
        for i in range(5):
            self.down()
            self.right(72)
            self.forward(28 * scale)
            self.up()
            self.backward(28 * scale)
        self.left(54)
        self.getscreen().update()

    def tripiece(self, initpos, scale):
        oldh = self.heading()
        self.down()
        self.backward(2.5 * scale)
        self.tripolyr(31.5 * scale, scale)
        self.up()
        self.goto(initpos)
        self.setheading(oldh)
        self.down()
        self.backward(2.5 * scale)
        self.tripolyl(31.5 * scale, scale)
        self.up()
        self.goto(initpos)
        self.setheading(oldh)
        self.left(72)
        self.getscreen().update()

    def pentpiece(self, initpos, scale):
        oldh = self.heading()
        self.up()
        self.forward(29 * scale)
        self.down()
        for i in range(5):
            self.forward(18 * scale)
            self.right(72)
        self.pentr(18 * scale, 75, scale)
        self.up()
        self.goto(initpos)
        self.setheading(oldh)
        self.forward(29 * scale)
        self.down()
        for i in range(5):
            self.forward(18 * scale)
            self.right(72)
        self.pentl(18 * scale, 75, scale)
        self.up()
        self.goto(initpos)
        self.setheading(oldh)
        self.left(72)
        self.getscreen().update()

    def pentl(self, side, ang, scale):
        if side < (2 * scale): return
        self.forward(side)
        self.left(ang)
        self.pentl(side - (.38 * scale), ang, scale)

    def pentr(self, side, ang, scale):
        if side < (2 * scale): return
        self.forward(side)
        self.right(ang)
        self.pentr(side - (.38 * scale), ang, scale)

    def tripolyr(self, side, scale):
        if side < (4 * scale): return
        self.forward(side)
        self.right(111)
        self.forward(side / 1.78)
        self.right(111)
        self.forward(side / 1.3)
        self.right(146)
        self.tripolyr(side * .75, scale)

    def tripolyl(self, side, scale):
        if side < (4 * scale): return
        self.forward(side)
        self.left(111)
        self.forward(side / 1.78)
        self.left(111)
        self.forward(side / 1.3)
        self.left(146)
        self.tripolyl(side * .75, scale)

    def centerpiece(self, s, a, scale):
        self.forward(s); self.left(a)
        if s < (7.5 * scale):
            return
        self.centerpiece(s - (1.2 * scale), a, scale)

def main():
    t = Designer()
    t.speed(0)
    t.hideturtle()
    t.getscreen().delay(0)
    t.getscreen().tracer(0)
    at = clock()
    t.design(t.position(), 2)
    et = clock()
    return "runtime: %.2f sec." % (et-at)

if __name__ == '__main__':
    msg = main()
    print(msg)
    mainloop()
crypt.py000064400000007032151153537630006272 0ustar00"""Wrapper to the POSIX crypt library call and associated functionality."""

import sys as _sys

try:
    import _crypt
except ModuleNotFoundError:
    if _sys.platform == 'win32':
        raise ImportError("The crypt module is not supported on Windows")
    else:
        raise ImportError("The required _crypt module was not built as part of CPython")

import string as _string
from random import SystemRandom as _SystemRandom
from collections import namedtuple as _namedtuple


_saltchars = _string.ascii_letters + _string.digits + './'
_sr = _SystemRandom()


class _Method(_namedtuple('_Method', 'name ident salt_chars total_size')):

    """Class representing a salt method per the Modular Crypt Format or the
    legacy 2-character crypt method."""

    def __repr__(self):
        return '<crypt.METHOD_{}>'.format(self.name)


def mksalt(method=None, *, rounds=None):
    """Generate a salt for the specified method.

    If not specified, the strongest available method will be used.

    """
    if method is None:
        method = methods[0]
    if rounds is not None and not isinstance(rounds, int):
        raise TypeError(f'{rounds.__class__.__name__} object cannot be '
                        f'interpreted as an integer')
    if not method.ident:  # traditional
        s = ''
    else:  # modular
        s = f'${method.ident}$'

    if method.ident and method.ident[0] == '2':  # Blowfish variants
        if rounds is None:
            log_rounds = 12
        else:
            log_rounds = int.bit_length(rounds-1)
            if rounds != 1 << log_rounds:
                raise ValueError('rounds must be a power of 2')
            if not 4 <= log_rounds <= 31:
                raise ValueError('rounds out of the range 2**4 to 2**31')
        s += f'{log_rounds:02d}$'
    elif method.ident in ('5', '6'):  # SHA-2
        if rounds is not None:
            if not 1000 <= rounds <= 999_999_999:
                raise ValueError('rounds out of the range 1000 to 999_999_999')
            s += f'rounds={rounds}$'
    elif rounds is not None:
        raise ValueError(f"{method} doesn't support the rounds argument")

    s += ''.join(_sr.choice(_saltchars) for char in range(method.salt_chars))
    return s


def crypt(word, salt=None):
    """Return a string representing the one-way hash of a password, with a salt
    prepended.

    If ``salt`` is not specified or is ``None``, the strongest
    available method will be selected and a salt generated.  Otherwise,
    ``salt`` may be one of the ``crypt.METHOD_*`` values, or a string as
    returned by ``crypt.mksalt()``.

    """
    if salt is None or isinstance(salt, _Method):
        salt = mksalt(salt)
    return _crypt.crypt(word, salt)


#  available salting/crypto methods
methods = []

def _add_method(name, *args, rounds=None):
    method = _Method(name, *args)
    globals()['METHOD_' + name] = method
    salt = mksalt(method, rounds=rounds)
    result = crypt('', salt)
    if result and len(result) == method.total_size:
        methods.append(method)
        return True
    return False

_add_method('SHA512', '6', 16, 106)
_add_method('SHA256', '5', 16, 63)

# Choose the strongest supported version of Blowfish hashing.
# Early versions have flaws.  Version 'a' fixes flaws of
# the initial implementation, 'b' fixes flaws of 'a'.
# 'y' is the same as 'b', for compatibility
# with openwall crypt_blowfish.
for _v in 'b', 'y', 'a', '':
    if _add_method('BLOWFISH', '2' + _v, 22, 59 + len(_v), rounds=1<<4):
        break

_add_method('MD5', '1', 8, 34)
_add_method('CRYPT', None, 2, 13)

del _v, _add_method
pydoc_data/topics.py000064400002471657151153537630010565 0ustar00# -*- coding: utf-8 -*-
# Autogenerated by Sphinx on Tue Oct 11 17:41:15 2022
topics = {'assert': 'The "assert" statement\n'
           '**********************\n'
           '\n'
           'Assert statements are a convenient way to insert debugging '
           'assertions\n'
           'into a program:\n'
           '\n'
           '   assert_stmt ::= "assert" expression ["," expression]\n'
           '\n'
           'The simple form, "assert expression", is equivalent to\n'
           '\n'
           '   if __debug__:\n'
           '       if not expression: raise AssertionError\n'
           '\n'
           'The extended form, "assert expression1, expression2", is '
           'equivalent to\n'
           '\n'
           '   if __debug__:\n'
           '       if not expression1: raise AssertionError(expression2)\n'
           '\n'
           'These equivalences assume that "__debug__" and "AssertionError" '
           'refer\n'
           'to the built-in variables with those names.  In the current\n'
           'implementation, the built-in variable "__debug__" is "True" under\n'
           'normal circumstances, "False" when optimization is requested '
           '(command\n'
           'line option "-O").  The current code generator emits no code for '
           'an\n'
           'assert statement when optimization is requested at compile time.  '
           'Note\n'
           'that it is unnecessary to include the source code for the '
           'expression\n'
           'that failed in the error message; it will be displayed as part of '
           'the\n'
           'stack trace.\n'
           '\n'
           'Assignments to "__debug__" are illegal.  The value for the '
           'built-in\n'
           'variable is determined when the interpreter starts.\n',
 'assignment': 'Assignment statements\n'
               '*********************\n'
               '\n'
               'Assignment statements are used to (re)bind names to values and '
               'to\n'
               'modify attributes or items of mutable objects:\n'
               '\n'
               '   assignment_stmt ::= (target_list "=")+ (starred_expression '
               '| yield_expression)\n'
               '   target_list     ::= target ("," target)* [","]\n'
               '   target          ::= identifier\n'
               '              | "(" [target_list] ")"\n'
               '              | "[" [target_list] "]"\n'
               '              | attributeref\n'
               '              | subscription\n'
               '              | slicing\n'
               '              | "*" target\n'
               '\n'
               '(See section Primaries for the syntax definitions for '
               '*attributeref*,\n'
               '*subscription*, and *slicing*.)\n'
               '\n'
               'An assignment statement evaluates the expression list '
               '(remember that\n'
               'this can be a single expression or a comma-separated list, the '
               'latter\n'
               'yielding a tuple) and assigns the single resulting object to '
               'each of\n'
               'the target lists, from left to right.\n'
               '\n'
               'Assignment is defined recursively depending on the form of the '
               'target\n'
               '(list). When a target is part of a mutable object (an '
               'attribute\n'
               'reference, subscription or slicing), the mutable object must\n'
               'ultimately perform the assignment and decide about its '
               'validity, and\n'
               'may raise an exception if the assignment is unacceptable.  The '
               'rules\n'
               'observed by various types and the exceptions raised are given '
               'with the\n'
               'definition of the object types (see section The standard type\n'
               'hierarchy).\n'
               '\n'
               'Assignment of an object to a target list, optionally enclosed '
               'in\n'
               'parentheses or square brackets, is recursively defined as '
               'follows.\n'
               '\n'
               '* If the target list is a single target with no trailing '
               'comma,\n'
               '  optionally in parentheses, the object is assigned to that '
               'target.\n'
               '\n'
               '* Else: The object must be an iterable with the same number of '
               'items\n'
               '  as there are targets in the target list, and the items are '
               'assigned,\n'
               '  from left to right, to the corresponding targets.\n'
               '\n'
               '  * If the target list contains one target prefixed with an '
               'asterisk,\n'
               '    called a “starred” target: The object must be an iterable '
               'with at\n'
               '    least as many items as there are targets in the target '
               'list, minus\n'
               '    one.  The first items of the iterable are assigned, from '
               'left to\n'
               '    right, to the targets before the starred target.  The '
               'final items\n'
               '    of the iterable are assigned to the targets after the '
               'starred\n'
               '    target.  A list of the remaining items in the iterable is '
               'then\n'
               '    assigned to the starred target (the list can be empty).\n'
               '\n'
               '  * Else: The object must be an iterable with the same number '
               'of items\n'
               '    as there are targets in the target list, and the items '
               'are\n'
               '    assigned, from left to right, to the corresponding '
               'targets.\n'
               '\n'
               'Assignment of an object to a single target is recursively '
               'defined as\n'
               'follows.\n'
               '\n'
               '* If the target is an identifier (name):\n'
               '\n'
               '  * If the name does not occur in a "global" or "nonlocal" '
               'statement\n'
               '    in the current code block: the name is bound to the object '
               'in the\n'
               '    current local namespace.\n'
               '\n'
               '  * Otherwise: the name is bound to the object in the global '
               'namespace\n'
               '    or the outer namespace determined by "nonlocal", '
               'respectively.\n'
               '\n'
               '  The name is rebound if it was already bound.  This may cause '
               'the\n'
               '  reference count for the object previously bound to the name '
               'to reach\n'
               '  zero, causing the object to be deallocated and its '
               'destructor (if it\n'
               '  has one) to be called.\n'
               '\n'
               '* If the target is an attribute reference: The primary '
               'expression in\n'
               '  the reference is evaluated.  It should yield an object with\n'
               '  assignable attributes; if this is not the case, "TypeError" '
               'is\n'
               '  raised.  That object is then asked to assign the assigned '
               'object to\n'
               '  the given attribute; if it cannot perform the assignment, it '
               'raises\n'
               '  an exception (usually but not necessarily '
               '"AttributeError").\n'
               '\n'
               '  Note: If the object is a class instance and the attribute '
               'reference\n'
               '  occurs on both sides of the assignment operator, the '
               'right-hand side\n'
               '  expression, "a.x" can access either an instance attribute or '
               '(if no\n'
               '  instance attribute exists) a class attribute.  The left-hand '
               'side\n'
               '  target "a.x" is always set as an instance attribute, '
               'creating it if\n'
               '  necessary.  Thus, the two occurrences of "a.x" do not '
               'necessarily\n'
               '  refer to the same attribute: if the right-hand side '
               'expression\n'
               '  refers to a class attribute, the left-hand side creates a '
               'new\n'
               '  instance attribute as the target of the assignment:\n'
               '\n'
               '     class Cls:\n'
               '         x = 3             # class variable\n'
               '     inst = Cls()\n'
               '     inst.x = inst.x + 1   # writes inst.x as 4 leaving Cls.x '
               'as 3\n'
               '\n'
               '  This description does not necessarily apply to descriptor\n'
               '  attributes, such as properties created with "property()".\n'
               '\n'
               '* If the target is a subscription: The primary expression in '
               'the\n'
               '  reference is evaluated.  It should yield either a mutable '
               'sequence\n'
               '  object (such as a list) or a mapping object (such as a '
               'dictionary).\n'
               '  Next, the subscript expression is evaluated.\n'
               '\n'
               '  If the primary is a mutable sequence object (such as a '
               'list), the\n'
               '  subscript must yield an integer.  If it is negative, the '
               'sequence’s\n'
               '  length is added to it.  The resulting value must be a '
               'nonnegative\n'
               '  integer less than the sequence’s length, and the sequence is '
               'asked\n'
               '  to assign the assigned object to its item with that index.  '
               'If the\n'
               '  index is out of range, "IndexError" is raised (assignment to '
               'a\n'
               '  subscripted sequence cannot add new items to a list).\n'
               '\n'
               '  If the primary is a mapping object (such as a dictionary), '
               'the\n'
               '  subscript must have a type compatible with the mapping’s key '
               'type,\n'
               '  and the mapping is then asked to create a key/datum pair '
               'which maps\n'
               '  the subscript to the assigned object.  This can either '
               'replace an\n'
               '  existing key/value pair with the same key value, or insert a '
               'new\n'
               '  key/value pair (if no key with the same value existed).\n'
               '\n'
               '  For user-defined objects, the "__setitem__()" method is '
               'called with\n'
               '  appropriate arguments.\n'
               '\n'
               '* If the target is a slicing: The primary expression in the '
               'reference\n'
               '  is evaluated.  It should yield a mutable sequence object '
               '(such as a\n'
               '  list).  The assigned object should be a sequence object of '
               'the same\n'
               '  type.  Next, the lower and upper bound expressions are '
               'evaluated,\n'
               '  insofar they are present; defaults are zero and the '
               'sequence’s\n'
               '  length.  The bounds should evaluate to integers. If either '
               'bound is\n'
               '  negative, the sequence’s length is added to it.  The '
               'resulting\n'
               '  bounds are clipped to lie between zero and the sequence’s '
               'length,\n'
               '  inclusive.  Finally, the sequence object is asked to replace '
               'the\n'
               '  slice with the items of the assigned sequence.  The length '
               'of the\n'
               '  slice may be different from the length of the assigned '
               'sequence,\n'
               '  thus changing the length of the target sequence, if the '
               'target\n'
               '  sequence allows it.\n'
               '\n'
               '**CPython implementation detail:** In the current '
               'implementation, the\n'
               'syntax for targets is taken to be the same as for expressions, '
               'and\n'
               'invalid syntax is rejected during the code generation phase, '
               'causing\n'
               'less detailed error messages.\n'
               '\n'
               'Although the definition of assignment implies that overlaps '
               'between\n'
               'the left-hand side and the right-hand side are ‘simultaneous’ '
               '(for\n'
               'example "a, b = b, a" swaps two variables), overlaps *within* '
               'the\n'
               'collection of assigned-to variables occur left-to-right, '
               'sometimes\n'
               'resulting in confusion.  For instance, the following program '
               'prints\n'
               '"[0, 2]":\n'
               '\n'
               '   x = [0, 1]\n'
               '   i = 0\n'
               '   i, x[i] = 1, 2         # i is updated, then x[i] is '
               'updated\n'
               '   print(x)\n'
               '\n'
               'See also:\n'
               '\n'
               '  **PEP 3132** - Extended Iterable Unpacking\n'
               '     The specification for the "*target" feature.\n'
               '\n'
               '\n'
               'Augmented assignment statements\n'
               '===============================\n'
               '\n'
               'Augmented assignment is the combination, in a single '
               'statement, of a\n'
               'binary operation and an assignment statement:\n'
               '\n'
               '   augmented_assignment_stmt ::= augtarget augop '
               '(expression_list | yield_expression)\n'
               '   augtarget                 ::= identifier | attributeref | '
               'subscription | slicing\n'
               '   augop                     ::= "+=" | "-=" | "*=" | "@=" | '
               '"/=" | "//=" | "%=" | "**="\n'
               '             | ">>=" | "<<=" | "&=" | "^=" | "|="\n'
               '\n'
               '(See section Primaries for the syntax definitions of the last '
               'three\n'
               'symbols.)\n'
               '\n'
               'An augmented assignment evaluates the target (which, unlike '
               'normal\n'
               'assignment statements, cannot be an unpacking) and the '
               'expression\n'
               'list, performs the binary operation specific to the type of '
               'assignment\n'
               'on the two operands, and assigns the result to the original '
               'target.\n'
               'The target is only evaluated once.\n'
               '\n'
               'An augmented assignment expression like "x += 1" can be '
               'rewritten as\n'
               '"x = x + 1" to achieve a similar, but not exactly equal '
               'effect. In the\n'
               'augmented version, "x" is only evaluated once. Also, when '
               'possible,\n'
               'the actual operation is performed *in-place*, meaning that '
               'rather than\n'
               'creating a new object and assigning that to the target, the '
               'old object\n'
               'is modified instead.\n'
               '\n'
               'Unlike normal assignments, augmented assignments evaluate the '
               'left-\n'
               'hand side *before* evaluating the right-hand side.  For '
               'example, "a[i]\n'
               '+= f(x)" first looks-up "a[i]", then it evaluates "f(x)" and '
               'performs\n'
               'the addition, and lastly, it writes the result back to '
               '"a[i]".\n'
               '\n'
               'With the exception of assigning to tuples and multiple targets '
               'in a\n'
               'single statement, the assignment done by augmented assignment\n'
               'statements is handled the same way as normal assignments. '
               'Similarly,\n'
               'with the exception of the possible *in-place* behavior, the '
               'binary\n'
               'operation performed by augmented assignment is the same as the '
               'normal\n'
               'binary operations.\n'
               '\n'
               'For targets which are attribute references, the same caveat '
               'about\n'
               'class and instance attributes applies as for regular '
               'assignments.\n'
               '\n'
               '\n'
               'Annotated assignment statements\n'
               '===============================\n'
               '\n'
               '*Annotation* assignment is the combination, in a single '
               'statement, of\n'
               'a variable or attribute annotation and an optional assignment\n'
               'statement:\n'
               '\n'
               '   annotated_assignment_stmt ::= augtarget ":" expression\n'
               '                                 ["=" (starred_expression | '
               'yield_expression)]\n'
               '\n'
               'The difference from normal Assignment statements is that only '
               'single\n'
               'target is allowed.\n'
               '\n'
               'For simple names as assignment targets, if in class or module '
               'scope,\n'
               'the annotations are evaluated and stored in a special class or '
               'module\n'
               'attribute "__annotations__" that is a dictionary mapping from '
               'variable\n'
               'names (mangled if private) to evaluated annotations. This '
               'attribute is\n'
               'writable and is automatically created at the start of class or '
               'module\n'
               'body execution, if annotations are found statically.\n'
               '\n'
               'For expressions as assignment targets, the annotations are '
               'evaluated\n'
               'if in class or module scope, but not stored.\n'
               '\n'
               'If a name is annotated in a function scope, then this name is '
               'local\n'
               'for that scope. Annotations are never evaluated and stored in '
               'function\n'
               'scopes.\n'
               '\n'
               'If the right hand side is present, an annotated assignment '
               'performs\n'
               'the actual assignment before evaluating annotations (where\n'
               'applicable). If the right hand side is not present for an '
               'expression\n'
               'target, then the interpreter evaluates the target except for '
               'the last\n'
               '"__setitem__()" or "__setattr__()" call.\n'
               '\n'
               'See also:\n'
               '\n'
               '  **PEP 526** - Syntax for Variable Annotations\n'
               '     The proposal that added syntax for annotating the types '
               'of\n'
               '     variables (including class variables and instance '
               'variables),\n'
               '     instead of expressing them through comments.\n'
               '\n'
               '  **PEP 484** - Type hints\n'
               '     The proposal that added the "typing" module to provide a '
               'standard\n'
               '     syntax for type annotations that can be used in static '
               'analysis\n'
               '     tools and IDEs.\n'
               '\n'
               'Changed in version 3.8: Now annotated assignments allow same\n'
               'expressions in the right hand side as the regular '
               'assignments.\n'
               'Previously, some expressions (like un-parenthesized tuple '
               'expressions)\n'
               'caused a syntax error.\n',
 'async': 'Coroutines\n'
          '**********\n'
          '\n'
          'New in version 3.5.\n'
          '\n'
          '\n'
          'Coroutine function definition\n'
          '=============================\n'
          '\n'
          '   async_funcdef ::= [decorators] "async" "def" funcname "(" '
          '[parameter_list] ")"\n'
          '                     ["->" expression] ":" suite\n'
          '\n'
          'Execution of Python coroutines can be suspended and resumed at '
          'many\n'
          'points (see *coroutine*).  Inside the body of a coroutine '
          'function,\n'
          '"await" and "async" identifiers become reserved keywords; "await"\n'
          'expressions, "async for" and "async with" can only be used in\n'
          'coroutine function bodies.\n'
          '\n'
          'Functions defined with "async def" syntax are always coroutine\n'
          'functions, even if they do not contain "await" or "async" '
          'keywords.\n'
          '\n'
          'It is a "SyntaxError" to use a "yield from" expression inside the '
          'body\n'
          'of a coroutine function.\n'
          '\n'
          'An example of a coroutine function:\n'
          '\n'
          '   async def func(param1, param2):\n'
          '       do_stuff()\n'
          '       await some_coroutine()\n'
          '\n'
          '\n'
          'The "async for" statement\n'
          '=========================\n'
          '\n'
          '   async_for_stmt ::= "async" for_stmt\n'
          '\n'
          'An *asynchronous iterable* is able to call asynchronous code in '
          'its\n'
          '*iter* implementation, and *asynchronous iterator* can call\n'
          'asynchronous code in its *next* method.\n'
          '\n'
          'The "async for" statement allows convenient iteration over\n'
          'asynchronous iterators.\n'
          '\n'
          'The following code:\n'
          '\n'
          '   async for TARGET in ITER:\n'
          '       SUITE\n'
          '   else:\n'
          '       SUITE2\n'
          '\n'
          'Is semantically equivalent to:\n'
          '\n'
          '   iter = (ITER)\n'
          '   iter = type(iter).__aiter__(iter)\n'
          '   running = True\n'
          '\n'
          '   while running:\n'
          '       try:\n'
          '           TARGET = await type(iter).__anext__(iter)\n'
          '       except StopAsyncIteration:\n'
          '           running = False\n'
          '       else:\n'
          '           SUITE\n'
          '   else:\n'
          '       SUITE2\n'
          '\n'
          'See also "__aiter__()" and "__anext__()" for details.\n'
          '\n'
          'It is a "SyntaxError" to use an "async for" statement outside the '
          'body\n'
          'of a coroutine function.\n'
          '\n'
          '\n'
          'The "async with" statement\n'
          '==========================\n'
          '\n'
          '   async_with_stmt ::= "async" with_stmt\n'
          '\n'
          'An *asynchronous context manager* is a *context manager* that is '
          'able\n'
          'to suspend execution in its *enter* and *exit* methods.\n'
          '\n'
          'The following code:\n'
          '\n'
          '   async with EXPRESSION as TARGET:\n'
          '       SUITE\n'
          '\n'
          'is semantically equivalent to:\n'
          '\n'
          '   manager = (EXPRESSION)\n'
          '   aexit = type(manager).__aexit__\n'
          '   aenter = type(manager).__aenter__\n'
          '   value = await aenter(manager)\n'
          '   hit_except = False\n'
          '\n'
          '   try:\n'
          '       TARGET = value\n'
          '       SUITE\n'
          '   except:\n'
          '       hit_except = True\n'
          '       if not await aexit(manager, *sys.exc_info()):\n'
          '           raise\n'
          '   finally:\n'
          '       if not hit_except:\n'
          '           await aexit(manager, None, None, None)\n'
          '\n'
          'See also "__aenter__()" and "__aexit__()" for details.\n'
          '\n'
          'It is a "SyntaxError" to use an "async with" statement outside the\n'
          'body of a coroutine function.\n'
          '\n'
          'See also:\n'
          '\n'
          '  **PEP 492** - Coroutines with async and await syntax\n'
          '     The proposal that made coroutines a proper standalone concept '
          'in\n'
          '     Python, and added supporting syntax.\n'
          '\n'
          '-[ Footnotes ]-\n'
          '\n'
          '[1] The exception is propagated to the invocation stack unless '
          'there\n'
          '    is a "finally" clause which happens to raise another '
          'exception.\n'
          '    That new exception causes the old one to be lost.\n'
          '\n'
          '[2] A string literal appearing as the first statement in the '
          'function\n'
          '    body is transformed into the function’s "__doc__" attribute '
          'and\n'
          '    therefore the function’s *docstring*.\n'
          '\n'
          '[3] A string literal appearing as the first statement in the class\n'
          '    body is transformed into the namespace’s "__doc__" item and\n'
          '    therefore the class’s *docstring*.\n',
 'atom-identifiers': 'Identifiers (Names)\n'
                     '*******************\n'
                     '\n'
                     'An identifier occurring as an atom is a name.  See '
                     'section Identifiers\n'
                     'and keywords for lexical definition and section Naming '
                     'and binding for\n'
                     'documentation of naming and binding.\n'
                     '\n'
                     'When the name is bound to an object, evaluation of the '
                     'atom yields\n'
                     'that object. When a name is not bound, an attempt to '
                     'evaluate it\n'
                     'raises a "NameError" exception.\n'
                     '\n'
                     '**Private name mangling:** When an identifier that '
                     'textually occurs in\n'
                     'a class definition begins with two or more underscore '
                     'characters and\n'
                     'does not end in two or more underscores, it is '
                     'considered a *private\n'
                     'name* of that class. Private names are transformed to a '
                     'longer form\n'
                     'before code is generated for them.  The transformation '
                     'inserts the\n'
                     'class name, with leading underscores removed and a '
                     'single underscore\n'
                     'inserted, in front of the name.  For example, the '
                     'identifier "__spam"\n'
                     'occurring in a class named "Ham" will be transformed to '
                     '"_Ham__spam".\n'
                     'This transformation is independent of the syntactical '
                     'context in which\n'
                     'the identifier is used.  If the transformed name is '
                     'extremely long\n'
                     '(longer than 255 characters), implementation defined '
                     'truncation may\n'
                     'happen. If the class name consists only of underscores, '
                     'no\n'
                     'transformation is done.\n',
 'atom-literals': 'Literals\n'
                  '********\n'
                  '\n'
                  'Python supports string and bytes literals and various '
                  'numeric\n'
                  'literals:\n'
                  '\n'
                  '   literal ::= stringliteral | bytesliteral\n'
                  '               | integer | floatnumber | imagnumber\n'
                  '\n'
                  'Evaluation of a literal yields an object of the given type '
                  '(string,\n'
                  'bytes, integer, floating point number, complex number) with '
                  'the given\n'
                  'value.  The value may be approximated in the case of '
                  'floating point\n'
                  'and imaginary (complex) literals.  See section Literals for '
                  'details.\n'
                  '\n'
                  'All literals correspond to immutable data types, and hence '
                  'the\n'
                  'object’s identity is less important than its value.  '
                  'Multiple\n'
                  'evaluations of literals with the same value (either the '
                  'same\n'
                  'occurrence in the program text or a different occurrence) '
                  'may obtain\n'
                  'the same object or a different object with the same '
                  'value.\n',
 'attribute-access': 'Customizing attribute access\n'
                     '****************************\n'
                     '\n'
                     'The following methods can be defined to customize the '
                     'meaning of\n'
                     'attribute access (use of, assignment to, or deletion of '
                     '"x.name") for\n'
                     'class instances.\n'
                     '\n'
                     'object.__getattr__(self, name)\n'
                     '\n'
                     '   Called when the default attribute access fails with '
                     'an\n'
                     '   "AttributeError" (either "__getattribute__()" raises '
                     'an\n'
                     '   "AttributeError" because *name* is not an instance '
                     'attribute or an\n'
                     '   attribute in the class tree for "self"; or '
                     '"__get__()" of a *name*\n'
                     '   property raises "AttributeError").  This method '
                     'should either\n'
                     '   return the (computed) attribute value or raise an '
                     '"AttributeError"\n'
                     '   exception.\n'
                     '\n'
                     '   Note that if the attribute is found through the '
                     'normal mechanism,\n'
                     '   "__getattr__()" is not called.  (This is an '
                     'intentional asymmetry\n'
                     '   between "__getattr__()" and "__setattr__()".) This is '
                     'done both for\n'
                     '   efficiency reasons and because otherwise '
                     '"__getattr__()" would have\n'
                     '   no way to access other attributes of the instance.  '
                     'Note that at\n'
                     '   least for instance variables, you can fake total '
                     'control by not\n'
                     '   inserting any values in the instance attribute '
                     'dictionary (but\n'
                     '   instead inserting them in another object).  See the\n'
                     '   "__getattribute__()" method below for a way to '
                     'actually get total\n'
                     '   control over attribute access.\n'
                     '\n'
                     'object.__getattribute__(self, name)\n'
                     '\n'
                     '   Called unconditionally to implement attribute '
                     'accesses for\n'
                     '   instances of the class. If the class also defines '
                     '"__getattr__()",\n'
                     '   the latter will not be called unless '
                     '"__getattribute__()" either\n'
                     '   calls it explicitly or raises an "AttributeError". '
                     'This method\n'
                     '   should return the (computed) attribute value or raise '
                     'an\n'
                     '   "AttributeError" exception. In order to avoid '
                     'infinite recursion in\n'
                     '   this method, its implementation should always call '
                     'the base class\n'
                     '   method with the same name to access any attributes it '
                     'needs, for\n'
                     '   example, "object.__getattribute__(self, name)".\n'
                     '\n'
                     '   Note:\n'
                     '\n'
                     '     This method may still be bypassed when looking up '
                     'special methods\n'
                     '     as the result of implicit invocation via language '
                     'syntax or\n'
                     '     built-in functions. See Special method lookup.\n'
                     '\n'
                     '   For certain sensitive attribute accesses, raises an '
                     'auditing event\n'
                     '   "object.__getattr__" with arguments "obj" and '
                     '"name".\n'
                     '\n'
                     'object.__setattr__(self, name, value)\n'
                     '\n'
                     '   Called when an attribute assignment is attempted.  '
                     'This is called\n'
                     '   instead of the normal mechanism (i.e. store the value '
                     'in the\n'
                     '   instance dictionary). *name* is the attribute name, '
                     '*value* is the\n'
                     '   value to be assigned to it.\n'
                     '\n'
                     '   If "__setattr__()" wants to assign to an instance '
                     'attribute, it\n'
                     '   should call the base class method with the same name, '
                     'for example,\n'
                     '   "object.__setattr__(self, name, value)".\n'
                     '\n'
                     '   For certain sensitive attribute assignments, raises '
                     'an auditing\n'
                     '   event "object.__setattr__" with arguments "obj", '
                     '"name", "value".\n'
                     '\n'
                     'object.__delattr__(self, name)\n'
                     '\n'
                     '   Like "__setattr__()" but for attribute deletion '
                     'instead of\n'
                     '   assignment.  This should only be implemented if "del '
                     'obj.name" is\n'
                     '   meaningful for the object.\n'
                     '\n'
                     '   For certain sensitive attribute deletions, raises an '
                     'auditing event\n'
                     '   "object.__delattr__" with arguments "obj" and '
                     '"name".\n'
                     '\n'
                     'object.__dir__(self)\n'
                     '\n'
                     '   Called when "dir()" is called on the object. A '
                     'sequence must be\n'
                     '   returned. "dir()" converts the returned sequence to a '
                     'list and\n'
                     '   sorts it.\n'
                     '\n'
                     '\n'
                     'Customizing module attribute access\n'
                     '===================================\n'
                     '\n'
                     'Special names "__getattr__" and "__dir__" can be also '
                     'used to\n'
                     'customize access to module attributes. The "__getattr__" '
                     'function at\n'
                     'the module level should accept one argument which is the '
                     'name of an\n'
                     'attribute and return the computed value or raise an '
                     '"AttributeError".\n'
                     'If an attribute is not found on a module object through '
                     'the normal\n'
                     'lookup, i.e. "object.__getattribute__()", then '
                     '"__getattr__" is\n'
                     'searched in the module "__dict__" before raising an '
                     '"AttributeError".\n'
                     'If found, it is called with the attribute name and the '
                     'result is\n'
                     'returned.\n'
                     '\n'
                     'The "__dir__" function should accept no arguments, and '
                     'return a\n'
                     'sequence of strings that represents the names accessible '
                     'on module. If\n'
                     'present, this function overrides the standard "dir()" '
                     'search on a\n'
                     'module.\n'
                     '\n'
                     'For a more fine grained customization of the module '
                     'behavior (setting\n'
                     'attributes, properties, etc.), one can set the '
                     '"__class__" attribute\n'
                     'of a module object to a subclass of "types.ModuleType". '
                     'For example:\n'
                     '\n'
                     '   import sys\n'
                     '   from types import ModuleType\n'
                     '\n'
                     '   class VerboseModule(ModuleType):\n'
                     '       def __repr__(self):\n'
                     "           return f'Verbose {self.__name__}'\n"
                     '\n'
                     '       def __setattr__(self, attr, value):\n'
                     "           print(f'Setting {attr}...')\n"
                     '           super().__setattr__(attr, value)\n'
                     '\n'
                     '   sys.modules[__name__].__class__ = VerboseModule\n'
                     '\n'
                     'Note:\n'
                     '\n'
                     '  Defining module "__getattr__" and setting module '
                     '"__class__" only\n'
                     '  affect lookups made using the attribute access syntax '
                     '– directly\n'
                     '  accessing the module globals (whether by code within '
                     'the module, or\n'
                     '  via a reference to the module’s globals dictionary) is '
                     'unaffected.\n'
                     '\n'
                     'Changed in version 3.5: "__class__" module attribute is '
                     'now writable.\n'
                     '\n'
                     'New in version 3.7: "__getattr__" and "__dir__" module '
                     'attributes.\n'
                     '\n'
                     'See also:\n'
                     '\n'
                     '  **PEP 562** - Module __getattr__ and __dir__\n'
                     '     Describes the "__getattr__" and "__dir__" functions '
                     'on modules.\n'
                     '\n'
                     '\n'
                     'Implementing Descriptors\n'
                     '========================\n'
                     '\n'
                     'The following methods only apply when an instance of the '
                     'class\n'
                     'containing the method (a so-called *descriptor* class) '
                     'appears in an\n'
                     '*owner* class (the descriptor must be in either the '
                     'owner’s class\n'
                     'dictionary or in the class dictionary for one of its '
                     'parents).  In the\n'
                     'examples below, “the attribute” refers to the attribute '
                     'whose name is\n'
                     'the key of the property in the owner class’ "__dict__".\n'
                     '\n'
                     'object.__get__(self, instance, owner=None)\n'
                     '\n'
                     '   Called to get the attribute of the owner class (class '
                     'attribute\n'
                     '   access) or of an instance of that class (instance '
                     'attribute\n'
                     '   access). The optional *owner* argument is the owner '
                     'class, while\n'
                     '   *instance* is the instance that the attribute was '
                     'accessed through,\n'
                     '   or "None" when the attribute is accessed through the '
                     '*owner*.\n'
                     '\n'
                     '   This method should return the computed attribute '
                     'value or raise an\n'
                     '   "AttributeError" exception.\n'
                     '\n'
                     '   **PEP 252** specifies that "__get__()" is callable '
                     'with one or two\n'
                     '   arguments.  Python’s own built-in descriptors support '
                     'this\n'
                     '   specification; however, it is likely that some '
                     'third-party tools\n'
                     '   have descriptors that require both arguments.  '
                     'Python’s own\n'
                     '   "__getattribute__()" implementation always passes in '
                     'both arguments\n'
                     '   whether they are required or not.\n'
                     '\n'
                     'object.__set__(self, instance, value)\n'
                     '\n'
                     '   Called to set the attribute on an instance *instance* '
                     'of the owner\n'
                     '   class to a new value, *value*.\n'
                     '\n'
                     '   Note, adding "__set__()" or "__delete__()" changes '
                     'the kind of\n'
                     '   descriptor to a “data descriptor”.  See Invoking '
                     'Descriptors for\n'
                     '   more details.\n'
                     '\n'
                     'object.__delete__(self, instance)\n'
                     '\n'
                     '   Called to delete the attribute on an instance '
                     '*instance* of the\n'
                     '   owner class.\n'
                     '\n'
                     'object.__set_name__(self, owner, name)\n'
                     '\n'
                     '   Called at the time the owning class *owner* is '
                     'created. The\n'
                     '   descriptor has been assigned to *name*.\n'
                     '\n'
                     '   Note:\n'
                     '\n'
                     '     "__set_name__()" is only called implicitly as part '
                     'of the "type"\n'
                     '     constructor, so it will need to be called '
                     'explicitly with the\n'
                     '     appropriate parameters when a descriptor is added '
                     'to a class\n'
                     '     after initial creation:\n'
                     '\n'
                     '        class A:\n'
                     '           pass\n'
                     '        descr = custom_descriptor()\n'
                     '        A.attr = descr\n'
                     "        descr.__set_name__(A, 'attr')\n"
                     '\n'
                     '     See Creating the class object for more details.\n'
                     '\n'
                     '   New in version 3.6.\n'
                     '\n'
                     'The attribute "__objclass__" is interpreted by the '
                     '"inspect" module as\n'
                     'specifying the class where this object was defined '
                     '(setting this\n'
                     'appropriately can assist in runtime introspection of '
                     'dynamic class\n'
                     'attributes). For callables, it may indicate that an '
                     'instance of the\n'
                     'given type (or a subclass) is expected or required as '
                     'the first\n'
                     'positional argument (for example, CPython sets this '
                     'attribute for\n'
                     'unbound methods that are implemented in C).\n'
                     '\n'
                     '\n'
                     'Invoking Descriptors\n'
                     '====================\n'
                     '\n'
                     'In general, a descriptor is an object attribute with '
                     '“binding\n'
                     'behavior”, one whose attribute access has been '
                     'overridden by methods\n'
                     'in the descriptor protocol:  "__get__()", "__set__()", '
                     'and\n'
                     '"__delete__()". If any of those methods are defined for '
                     'an object, it\n'
                     'is said to be a descriptor.\n'
                     '\n'
                     'The default behavior for attribute access is to get, '
                     'set, or delete\n'
                     'the attribute from an object’s dictionary. For instance, '
                     '"a.x" has a\n'
                     'lookup chain starting with "a.__dict__[\'x\']", then\n'
                     '"type(a).__dict__[\'x\']", and continuing through the '
                     'base classes of\n'
                     '"type(a)" excluding metaclasses.\n'
                     '\n'
                     'However, if the looked-up value is an object defining '
                     'one of the\n'
                     'descriptor methods, then Python may override the default '
                     'behavior and\n'
                     'invoke the descriptor method instead.  Where this occurs '
                     'in the\n'
                     'precedence chain depends on which descriptor methods '
                     'were defined and\n'
                     'how they were called.\n'
                     '\n'
                     'The starting point for descriptor invocation is a '
                     'binding, "a.x". How\n'
                     'the arguments are assembled depends on "a":\n'
                     '\n'
                     'Direct Call\n'
                     '   The simplest and least common call is when user code '
                     'directly\n'
                     '   invokes a descriptor method:    "x.__get__(a)".\n'
                     '\n'
                     'Instance Binding\n'
                     '   If binding to an object instance, "a.x" is '
                     'transformed into the\n'
                     '   call: "type(a).__dict__[\'x\'].__get__(a, type(a))".\n'
                     '\n'
                     'Class Binding\n'
                     '   If binding to a class, "A.x" is transformed into the '
                     'call:\n'
                     '   "A.__dict__[\'x\'].__get__(None, A)".\n'
                     '\n'
                     'Super Binding\n'
                     '   If "a" is an instance of "super", then the binding '
                     '"super(B,\n'
                     '   obj).m()" searches "obj.__class__.__mro__" for the '
                     'base class "A"\n'
                     '   immediately preceding "B" and then invokes the '
                     'descriptor with the\n'
                     '   call: "A.__dict__[\'m\'].__get__(obj, '
                     'obj.__class__)".\n'
                     '\n'
                     'For instance bindings, the precedence of descriptor '
                     'invocation depends\n'
                     'on which descriptor methods are defined.  A descriptor '
                     'can define any\n'
                     'combination of "__get__()", "__set__()" and '
                     '"__delete__()".  If it\n'
                     'does not define "__get__()", then accessing the '
                     'attribute will return\n'
                     'the descriptor object itself unless there is a value in '
                     'the object’s\n'
                     'instance dictionary.  If the descriptor defines '
                     '"__set__()" and/or\n'
                     '"__delete__()", it is a data descriptor; if it defines '
                     'neither, it is\n'
                     'a non-data descriptor.  Normally, data descriptors '
                     'define both\n'
                     '"__get__()" and "__set__()", while non-data descriptors '
                     'have just the\n'
                     '"__get__()" method.  Data descriptors with "__set__()" '
                     'and "__get__()"\n'
                     'defined always override a redefinition in an instance '
                     'dictionary.  In\n'
                     'contrast, non-data descriptors can be overridden by '
                     'instances.\n'
                     '\n'
                     'Python methods (including "staticmethod()" and '
                     '"classmethod()") are\n'
                     'implemented as non-data descriptors.  Accordingly, '
                     'instances can\n'
                     'redefine and override methods.  This allows individual '
                     'instances to\n'
                     'acquire behaviors that differ from other instances of '
                     'the same class.\n'
                     '\n'
                     'The "property()" function is implemented as a data '
                     'descriptor.\n'
                     'Accordingly, instances cannot override the behavior of a '
                     'property.\n'
                     '\n'
                     '\n'
                     '__slots__\n'
                     '=========\n'
                     '\n'
                     '*__slots__* allow us to explicitly declare data members '
                     '(like\n'
                     'properties) and deny the creation of *__dict__* and '
                     '*__weakref__*\n'
                     '(unless explicitly declared in *__slots__* or available '
                     'in a parent.)\n'
                     '\n'
                     'The space saved over using *__dict__* can be '
                     'significant. Attribute\n'
                     'lookup speed can be significantly improved as well.\n'
                     '\n'
                     'object.__slots__\n'
                     '\n'
                     '   This class variable can be assigned a string, '
                     'iterable, or sequence\n'
                     '   of strings with variable names used by instances.  '
                     '*__slots__*\n'
                     '   reserves space for the declared variables and '
                     'prevents the\n'
                     '   automatic creation of *__dict__* and *__weakref__* '
                     'for each\n'
                     '   instance.\n'
                     '\n'
                     '\n'
                     'Notes on using *__slots__*\n'
                     '--------------------------\n'
                     '\n'
                     '* When inheriting from a class without *__slots__*, the '
                     '*__dict__* and\n'
                     '  *__weakref__* attribute of the instances will always '
                     'be accessible.\n'
                     '\n'
                     '* Without a *__dict__* variable, instances cannot be '
                     'assigned new\n'
                     '  variables not listed in the *__slots__* definition.  '
                     'Attempts to\n'
                     '  assign to an unlisted variable name raises '
                     '"AttributeError". If\n'
                     '  dynamic assignment of new variables is desired, then '
                     'add\n'
                     '  "\'__dict__\'" to the sequence of strings in the '
                     '*__slots__*\n'
                     '  declaration.\n'
                     '\n'
                     '* Without a *__weakref__* variable for each instance, '
                     'classes defining\n'
                     '  *__slots__* do not support weak references to its '
                     'instances. If weak\n'
                     '  reference support is needed, then add '
                     '"\'__weakref__\'" to the\n'
                     '  sequence of strings in the *__slots__* declaration.\n'
                     '\n'
                     '* *__slots__* are implemented at the class level by '
                     'creating\n'
                     '  descriptors (Implementing Descriptors) for each '
                     'variable name.  As a\n'
                     '  result, class attributes cannot be used to set default '
                     'values for\n'
                     '  instance variables defined by *__slots__*; otherwise, '
                     'the class\n'
                     '  attribute would overwrite the descriptor assignment.\n'
                     '\n'
                     '* The action of a *__slots__* declaration is not limited '
                     'to the class\n'
                     '  where it is defined.  *__slots__* declared in parents '
                     'are available\n'
                     '  in child classes. However, child subclasses will get a '
                     '*__dict__*\n'
                     '  and *__weakref__* unless they also define *__slots__* '
                     '(which should\n'
                     '  only contain names of any *additional* slots).\n'
                     '\n'
                     '* If a class defines a slot also defined in a base '
                     'class, the instance\n'
                     '  variable defined by the base class slot is '
                     'inaccessible (except by\n'
                     '  retrieving its descriptor directly from the base '
                     'class). This\n'
                     '  renders the meaning of the program undefined.  In the '
                     'future, a\n'
                     '  check may be added to prevent this.\n'
                     '\n'
                     '* Nonempty *__slots__* does not work for classes derived '
                     'from\n'
                     '  “variable-length” built-in types such as "int", '
                     '"bytes" and "tuple".\n'
                     '\n'
                     '* Any non-string iterable may be assigned to '
                     '*__slots__*. Mappings may\n'
                     '  also be used; however, in the future, special meaning '
                     'may be\n'
                     '  assigned to the values corresponding to each key.\n'
                     '\n'
                     '* *__class__* assignment works only if both classes have '
                     'the same\n'
                     '  *__slots__*.\n'
                     '\n'
                     '* Multiple inheritance with multiple slotted parent '
                     'classes can be\n'
                     '  used, but only one parent is allowed to have '
                     'attributes created by\n'
                     '  slots (the other bases must have empty slot layouts) - '
                     'violations\n'
                     '  raise "TypeError".\n'
                     '\n'
                     '* If an iterator is used for *__slots__* then a '
                     'descriptor is created\n'
                     '  for each of the iterator’s values. However, the '
                     '*__slots__*\n'
                     '  attribute will be an empty iterator.\n',
 'attribute-references': 'Attribute references\n'
                         '********************\n'
                         '\n'
                         'An attribute reference is a primary followed by a '
                         'period and a name:\n'
                         '\n'
                         '   attributeref ::= primary "." identifier\n'
                         '\n'
                         'The primary must evaluate to an object of a type '
                         'that supports\n'
                         'attribute references, which most objects do.  This '
                         'object is then\n'
                         'asked to produce the attribute whose name is the '
                         'identifier.  This\n'
                         'production can be customized by overriding the '
                         '"__getattr__()" method.\n'
                         'If this attribute is not available, the exception '
                         '"AttributeError" is\n'
                         'raised.  Otherwise, the type and value of the object '
                         'produced is\n'
                         'determined by the object.  Multiple evaluations of '
                         'the same attribute\n'
                         'reference may yield different objects.\n',
 'augassign': 'Augmented assignment statements\n'
              '*******************************\n'
              '\n'
              'Augmented assignment is the combination, in a single statement, '
              'of a\n'
              'binary operation and an assignment statement:\n'
              '\n'
              '   augmented_assignment_stmt ::= augtarget augop '
              '(expression_list | yield_expression)\n'
              '   augtarget                 ::= identifier | attributeref | '
              'subscription | slicing\n'
              '   augop                     ::= "+=" | "-=" | "*=" | "@=" | '
              '"/=" | "//=" | "%=" | "**="\n'
              '             | ">>=" | "<<=" | "&=" | "^=" | "|="\n'
              '\n'
              '(See section Primaries for the syntax definitions of the last '
              'three\n'
              'symbols.)\n'
              '\n'
              'An augmented assignment evaluates the target (which, unlike '
              'normal\n'
              'assignment statements, cannot be an unpacking) and the '
              'expression\n'
              'list, performs the binary operation specific to the type of '
              'assignment\n'
              'on the two operands, and assigns the result to the original '
              'target.\n'
              'The target is only evaluated once.\n'
              '\n'
              'An augmented assignment expression like "x += 1" can be '
              'rewritten as\n'
              '"x = x + 1" to achieve a similar, but not exactly equal effect. '
              'In the\n'
              'augmented version, "x" is only evaluated once. Also, when '
              'possible,\n'
              'the actual operation is performed *in-place*, meaning that '
              'rather than\n'
              'creating a new object and assigning that to the target, the old '
              'object\n'
              'is modified instead.\n'
              '\n'
              'Unlike normal assignments, augmented assignments evaluate the '
              'left-\n'
              'hand side *before* evaluating the right-hand side.  For '
              'example, "a[i]\n'
              '+= f(x)" first looks-up "a[i]", then it evaluates "f(x)" and '
              'performs\n'
              'the addition, and lastly, it writes the result back to "a[i]".\n'
              '\n'
              'With the exception of assigning to tuples and multiple targets '
              'in a\n'
              'single statement, the assignment done by augmented assignment\n'
              'statements is handled the same way as normal assignments. '
              'Similarly,\n'
              'with the exception of the possible *in-place* behavior, the '
              'binary\n'
              'operation performed by augmented assignment is the same as the '
              'normal\n'
              'binary operations.\n'
              '\n'
              'For targets which are attribute references, the same caveat '
              'about\n'
              'class and instance attributes applies as for regular '
              'assignments.\n',
 'await': 'Await expression\n'
          '****************\n'
          '\n'
          'Suspend the execution of *coroutine* on an *awaitable* object. Can\n'
          'only be used inside a *coroutine function*.\n'
          '\n'
          '   await_expr ::= "await" primary\n'
          '\n'
          'New in version 3.5.\n',
 'binary': 'Binary arithmetic operations\n'
           '****************************\n'
           '\n'
           'The binary arithmetic operations have the conventional priority\n'
           'levels.  Note that some of these operations also apply to certain '
           'non-\n'
           'numeric types.  Apart from the power operator, there are only two\n'
           'levels, one for multiplicative operators and one for additive\n'
           'operators:\n'
           '\n'
           '   m_expr ::= u_expr | m_expr "*" u_expr | m_expr "@" m_expr |\n'
           '              m_expr "//" u_expr | m_expr "/" u_expr |\n'
           '              m_expr "%" u_expr\n'
           '   a_expr ::= m_expr | a_expr "+" m_expr | a_expr "-" m_expr\n'
           '\n'
           'The "*" (multiplication) operator yields the product of its '
           'arguments.\n'
           'The arguments must either both be numbers, or one argument must be '
           'an\n'
           'integer and the other must be a sequence. In the former case, the\n'
           'numbers are converted to a common type and then multiplied '
           'together.\n'
           'In the latter case, sequence repetition is performed; a negative\n'
           'repetition factor yields an empty sequence.\n'
           '\n'
           'The "@" (at) operator is intended to be used for matrix\n'
           'multiplication.  No builtin Python types implement this operator.\n'
           '\n'
           'New in version 3.5.\n'
           '\n'
           'The "/" (division) and "//" (floor division) operators yield the\n'
           'quotient of their arguments.  The numeric arguments are first\n'
           'converted to a common type. Division of integers yields a float, '
           'while\n'
           'floor division of integers results in an integer; the result is '
           'that\n'
           'of mathematical division with the ‘floor’ function applied to the\n'
           'result.  Division by zero raises the "ZeroDivisionError" '
           'exception.\n'
           '\n'
           'The "%" (modulo) operator yields the remainder from the division '
           'of\n'
           'the first argument by the second.  The numeric arguments are '
           'first\n'
           'converted to a common type.  A zero right argument raises the\n'
           '"ZeroDivisionError" exception.  The arguments may be floating '
           'point\n'
           'numbers, e.g., "3.14%0.7" equals "0.34" (since "3.14" equals '
           '"4*0.7 +\n'
           '0.34".)  The modulo operator always yields a result with the same '
           'sign\n'
           'as its second operand (or zero); the absolute value of the result '
           'is\n'
           'strictly smaller than the absolute value of the second operand '
           '[1].\n'
           '\n'
           'The floor division and modulo operators are connected by the '
           'following\n'
           'identity: "x == (x//y)*y + (x%y)".  Floor division and modulo are '
           'also\n'
           'connected with the built-in function "divmod()": "divmod(x, y) ==\n'
           '(x//y, x%y)". [2].\n'
           '\n'
           'In addition to performing the modulo operation on numbers, the '
           '"%"\n'
           'operator is also overloaded by string objects to perform '
           'old-style\n'
           'string formatting (also known as interpolation).  The syntax for\n'
           'string formatting is described in the Python Library Reference,\n'
           'section printf-style String Formatting.\n'
           '\n'
           'The floor division operator, the modulo operator, and the '
           '"divmod()"\n'
           'function are not defined for complex numbers.  Instead, convert to '
           'a\n'
           'floating point number using the "abs()" function if appropriate.\n'
           '\n'
           'The "+" (addition) operator yields the sum of its arguments.  The\n'
           'arguments must either both be numbers or both be sequences of the '
           'same\n'
           'type.  In the former case, the numbers are converted to a common '
           'type\n'
           'and then added together. In the latter case, the sequences are\n'
           'concatenated.\n'
           '\n'
           'The "-" (subtraction) operator yields the difference of its '
           'arguments.\n'
           'The numeric arguments are first converted to a common type.\n',
 'bitwise': 'Binary bitwise operations\n'
            '*************************\n'
            '\n'
            'Each of the three bitwise operations has a different priority '
            'level:\n'
            '\n'
            '   and_expr ::= shift_expr | and_expr "&" shift_expr\n'
            '   xor_expr ::= and_expr | xor_expr "^" and_expr\n'
            '   or_expr  ::= xor_expr | or_expr "|" xor_expr\n'
            '\n'
            'The "&" operator yields the bitwise AND of its arguments, which '
            'must\n'
            'be integers.\n'
            '\n'
            'The "^" operator yields the bitwise XOR (exclusive OR) of its\n'
            'arguments, which must be integers.\n'
            '\n'
            'The "|" operator yields the bitwise (inclusive) OR of its '
            'arguments,\n'
            'which must be integers.\n',
 'bltin-code-objects': 'Code Objects\n'
                       '************\n'
                       '\n'
                       'Code objects are used by the implementation to '
                       'represent “pseudo-\n'
                       'compiled” executable Python code such as a function '
                       'body. They differ\n'
                       'from function objects because they don’t contain a '
                       'reference to their\n'
                       'global execution environment.  Code objects are '
                       'returned by the built-\n'
                       'in "compile()" function and can be extracted from '
                       'function objects\n'
                       'through their "__code__" attribute. See also the '
                       '"code" module.\n'
                       '\n'
                       'Accessing "__code__" raises an auditing event '
                       '"object.__getattr__"\n'
                       'with arguments "obj" and ""__code__"".\n'
                       '\n'
                       'A code object can be executed or evaluated by passing '
                       'it (instead of a\n'
                       'source string) to the "exec()" or "eval()"  built-in '
                       'functions.\n'
                       '\n'
                       'See The standard type hierarchy for more '
                       'information.\n',
 'bltin-ellipsis-object': 'The Ellipsis Object\n'
                          '*******************\n'
                          '\n'
                          'This object is commonly used by slicing (see '
                          'Slicings).  It supports\n'
                          'no special operations.  There is exactly one '
                          'ellipsis object, named\n'
                          '"Ellipsis" (a built-in name).  "type(Ellipsis)()" '
                          'produces the\n'
                          '"Ellipsis" singleton.\n'
                          '\n'
                          'It is written as "Ellipsis" or "...".\n',
 'bltin-null-object': 'The Null Object\n'
                      '***************\n'
                      '\n'
                      'This object is returned by functions that don’t '
                      'explicitly return a\n'
                      'value.  It supports no special operations.  There is '
                      'exactly one null\n'
                      'object, named "None" (a built-in name).  "type(None)()" '
                      'produces the\n'
                      'same singleton.\n'
                      '\n'
                      'It is written as "None".\n',
 'bltin-type-objects': 'Type Objects\n'
                       '************\n'
                       '\n'
                       'Type objects represent the various object types.  An '
                       'object’s type is\n'
                       'accessed by the built-in function "type()".  There are '
                       'no special\n'
                       'operations on types.  The standard module "types" '
                       'defines names for\n'
                       'all standard built-in types.\n'
                       '\n'
                       'Types are written like this: "<class \'int\'>".\n',
 'booleans': 'Boolean operations\n'
             '******************\n'
             '\n'
             '   or_test  ::= and_test | or_test "or" and_test\n'
             '   and_test ::= not_test | and_test "and" not_test\n'
             '   not_test ::= comparison | "not" not_test\n'
             '\n'
             'In the context of Boolean operations, and also when expressions '
             'are\n'
             'used by control flow statements, the following values are '
             'interpreted\n'
             'as false: "False", "None", numeric zero of all types, and empty\n'
             'strings and containers (including strings, tuples, lists,\n'
             'dictionaries, sets and frozensets).  All other values are '
             'interpreted\n'
             'as true.  User-defined objects can customize their truth value '
             'by\n'
             'providing a "__bool__()" method.\n'
             '\n'
             'The operator "not" yields "True" if its argument is false, '
             '"False"\n'
             'otherwise.\n'
             '\n'
             'The expression "x and y" first evaluates *x*; if *x* is false, '
             'its\n'
             'value is returned; otherwise, *y* is evaluated and the resulting '
             'value\n'
             'is returned.\n'
             '\n'
             'The expression "x or y" first evaluates *x*; if *x* is true, its '
             'value\n'
             'is returned; otherwise, *y* is evaluated and the resulting value '
             'is\n'
             'returned.\n'
             '\n'
             'Note that neither "and" nor "or" restrict the value and type '
             'they\n'
             'return to "False" and "True", but rather return the last '
             'evaluated\n'
             'argument.  This is sometimes useful, e.g., if "s" is a string '
             'that\n'
             'should be replaced by a default value if it is empty, the '
             'expression\n'
             '"s or \'foo\'" yields the desired value.  Because "not" has to '
             'create a\n'
             'new value, it returns a boolean value regardless of the type of '
             'its\n'
             'argument (for example, "not \'foo\'" produces "False" rather '
             'than "\'\'".)\n',
 'break': 'The "break" statement\n'
          '*********************\n'
          '\n'
          '   break_stmt ::= "break"\n'
          '\n'
          '"break" may only occur syntactically nested in a "for" or "while"\n'
          'loop, but not nested in a function or class definition within that\n'
          'loop.\n'
          '\n'
          'It terminates the nearest enclosing loop, skipping the optional '
          '"else"\n'
          'clause if the loop has one.\n'
          '\n'
          'If a "for" loop is terminated by "break", the loop control target\n'
          'keeps its current value.\n'
          '\n'
          'When "break" passes control out of a "try" statement with a '
          '"finally"\n'
          'clause, that "finally" clause is executed before really leaving '
          'the\n'
          'loop.\n',
 'callable-types': 'Emulating callable objects\n'
                   '**************************\n'
                   '\n'
                   'object.__call__(self[, args...])\n'
                   '\n'
                   '   Called when the instance is “called” as a function; if '
                   'this method\n'
                   '   is defined, "x(arg1, arg2, ...)" roughly translates to\n'
                   '   "type(x).__call__(x, arg1, ...)".\n',
 'calls': 'Calls\n'
          '*****\n'
          '\n'
          'A call calls a callable object (e.g., a *function*) with a '
          'possibly\n'
          'empty series of *arguments*:\n'
          '\n'
          '   call                 ::= primary "(" [argument_list [","] | '
          'comprehension] ")"\n'
          '   argument_list        ::= positional_arguments ["," '
          'starred_and_keywords]\n'
          '                       ["," keywords_arguments]\n'
          '                     | starred_and_keywords ["," '
          'keywords_arguments]\n'
          '                     | keywords_arguments\n'
          '   positional_arguments ::= positional_item ("," positional_item)*\n'
          '   positional_item      ::= assignment_expression | "*" expression\n'
          '   starred_and_keywords ::= ("*" expression | keyword_item)\n'
          '                            ("," "*" expression | "," '
          'keyword_item)*\n'
          '   keywords_arguments   ::= (keyword_item | "**" expression)\n'
          '                          ("," keyword_item | "," "**" '
          'expression)*\n'
          '   keyword_item         ::= identifier "=" expression\n'
          '\n'
          'An optional trailing comma may be present after the positional and\n'
          'keyword arguments but does not affect the semantics.\n'
          '\n'
          'The primary must evaluate to a callable object (user-defined\n'
          'functions, built-in functions, methods of built-in objects, class\n'
          'objects, methods of class instances, and all objects having a\n'
          '"__call__()" method are callable).  All argument expressions are\n'
          'evaluated before the call is attempted.  Please refer to section\n'
          'Function definitions for the syntax of formal *parameter* lists.\n'
          '\n'
          'If keyword arguments are present, they are first converted to\n'
          'positional arguments, as follows.  First, a list of unfilled slots '
          'is\n'
          'created for the formal parameters.  If there are N positional\n'
          'arguments, they are placed in the first N slots.  Next, for each\n'
          'keyword argument, the identifier is used to determine the\n'
          'corresponding slot (if the identifier is the same as the first '
          'formal\n'
          'parameter name, the first slot is used, and so on).  If the slot '
          'is\n'
          'already filled, a "TypeError" exception is raised. Otherwise, the\n'
          'value of the argument is placed in the slot, filling it (even if '
          'the\n'
          'expression is "None", it fills the slot).  When all arguments have\n'
          'been processed, the slots that are still unfilled are filled with '
          'the\n'
          'corresponding default value from the function definition.  '
          '(Default\n'
          'values are calculated, once, when the function is defined; thus, a\n'
          'mutable object such as a list or dictionary used as default value '
          'will\n'
          'be shared by all calls that don’t specify an argument value for '
          'the\n'
          'corresponding slot; this should usually be avoided.)  If there are '
          'any\n'
          'unfilled slots for which no default value is specified, a '
          '"TypeError"\n'
          'exception is raised.  Otherwise, the list of filled slots is used '
          'as\n'
          'the argument list for the call.\n'
          '\n'
          '**CPython implementation detail:** An implementation may provide\n'
          'built-in functions whose positional parameters do not have names, '
          'even\n'
          'if they are ‘named’ for the purpose of documentation, and which\n'
          'therefore cannot be supplied by keyword.  In CPython, this is the '
          'case\n'
          'for functions implemented in C that use "PyArg_ParseTuple()" to '
          'parse\n'
          'their arguments.\n'
          '\n'
          'If there are more positional arguments than there are formal '
          'parameter\n'
          'slots, a "TypeError" exception is raised, unless a formal '
          'parameter\n'
          'using the syntax "*identifier" is present; in this case, that '
          'formal\n'
          'parameter receives a tuple containing the excess positional '
          'arguments\n'
          '(or an empty tuple if there were no excess positional arguments).\n'
          '\n'
          'If any keyword argument does not correspond to a formal parameter\n'
          'name, a "TypeError" exception is raised, unless a formal parameter\n'
          'using the syntax "**identifier" is present; in this case, that '
          'formal\n'
          'parameter receives a dictionary containing the excess keyword\n'
          'arguments (using the keywords as keys and the argument values as\n'
          'corresponding values), or a (new) empty dictionary if there were '
          'no\n'
          'excess keyword arguments.\n'
          '\n'
          'If the syntax "*expression" appears in the function call, '
          '"expression"\n'
          'must evaluate to an *iterable*.  Elements from these iterables are\n'
          'treated as if they were additional positional arguments.  For the '
          'call\n'
          '"f(x1, x2, *y, x3, x4)", if *y* evaluates to a sequence *y1*, …, '
          '*yM*,\n'
          'this is equivalent to a call with M+4 positional arguments *x1*, '
          '*x2*,\n'
          '*y1*, …, *yM*, *x3*, *x4*.\n'
          '\n'
          'A consequence of this is that although the "*expression" syntax '
          'may\n'
          'appear *after* explicit keyword arguments, it is processed '
          '*before*\n'
          'the keyword arguments (and any "**expression" arguments – see '
          'below).\n'
          'So:\n'
          '\n'
          '   >>> def f(a, b):\n'
          '   ...     print(a, b)\n'
          '   ...\n'
          '   >>> f(b=1, *(2,))\n'
          '   2 1\n'
          '   >>> f(a=1, *(2,))\n'
          '   Traceback (most recent call last):\n'
          '     File "<stdin>", line 1, in <module>\n'
          "   TypeError: f() got multiple values for keyword argument 'a'\n"
          '   >>> f(1, *(2,))\n'
          '   1 2\n'
          '\n'
          'It is unusual for both keyword arguments and the "*expression" '
          'syntax\n'
          'to be used in the same call, so in practice this confusion does '
          'not\n'
          'arise.\n'
          '\n'
          'If the syntax "**expression" appears in the function call,\n'
          '"expression" must evaluate to a *mapping*, the contents of which '
          'are\n'
          'treated as additional keyword arguments.  If a keyword is already\n'
          'present (as an explicit keyword argument, or from another '
          'unpacking),\n'
          'a "TypeError" exception is raised.\n'
          '\n'
          'Formal parameters using the syntax "*identifier" or "**identifier"\n'
          'cannot be used as positional argument slots or as keyword argument\n'
          'names.\n'
          '\n'
          'Changed in version 3.5: Function calls accept any number of "*" '
          'and\n'
          '"**" unpackings, positional arguments may follow iterable '
          'unpackings\n'
          '("*"), and keyword arguments may follow dictionary unpackings '
          '("**").\n'
          'Originally proposed by **PEP 448**.\n'
          '\n'
          'A call always returns some value, possibly "None", unless it raises '
          'an\n'
          'exception.  How this value is computed depends on the type of the\n'
          'callable object.\n'
          '\n'
          'If it is—\n'
          '\n'
          'a user-defined function:\n'
          '   The code block for the function is executed, passing it the\n'
          '   argument list.  The first thing the code block will do is bind '
          'the\n'
          '   formal parameters to the arguments; this is described in '
          'section\n'
          '   Function definitions.  When the code block executes a "return"\n'
          '   statement, this specifies the return value of the function '
          'call.\n'
          '\n'
          'a built-in function or method:\n'
          '   The result is up to the interpreter; see Built-in Functions for '
          'the\n'
          '   descriptions of built-in functions and methods.\n'
          '\n'
          'a class object:\n'
          '   A new instance of that class is returned.\n'
          '\n'
          'a class instance method:\n'
          '   The corresponding user-defined function is called, with an '
          'argument\n'
          '   list that is one longer than the argument list of the call: the\n'
          '   instance becomes the first argument.\n'
          '\n'
          'a class instance:\n'
          '   The class must define a "__call__()" method; the effect is then '
          'the\n'
          '   same as if that method was called.\n',
 'class': 'Class definitions\n'
          '*****************\n'
          '\n'
          'A class definition defines a class object (see section The '
          'standard\n'
          'type hierarchy):\n'
          '\n'
          '   classdef    ::= [decorators] "class" classname [inheritance] ":" '
          'suite\n'
          '   inheritance ::= "(" [argument_list] ")"\n'
          '   classname   ::= identifier\n'
          '\n'
          'A class definition is an executable statement.  The inheritance '
          'list\n'
          'usually gives a list of base classes (see Metaclasses for more\n'
          'advanced uses), so each item in the list should evaluate to a '
          'class\n'
          'object which allows subclassing.  Classes without an inheritance '
          'list\n'
          'inherit, by default, from the base class "object"; hence,\n'
          '\n'
          '   class Foo:\n'
          '       pass\n'
          '\n'
          'is equivalent to\n'
          '\n'
          '   class Foo(object):\n'
          '       pass\n'
          '\n'
          'The class’s suite is then executed in a new execution frame (see\n'
          'Naming and binding), using a newly created local namespace and the\n'
          'original global namespace. (Usually, the suite contains mostly\n'
          'function definitions.)  When the class’s suite finishes execution, '
          'its\n'
          'execution frame is discarded but its local namespace is saved. [3] '
          'A\n'
          'class object is then created using the inheritance list for the '
          'base\n'
          'classes and the saved local namespace for the attribute '
          'dictionary.\n'
          'The class name is bound to this class object in the original local\n'
          'namespace.\n'
          '\n'
          'The order in which attributes are defined in the class body is\n'
          'preserved in the new class’s "__dict__".  Note that this is '
          'reliable\n'
          'only right after the class is created and only for classes that '
          'were\n'
          'defined using the definition syntax.\n'
          '\n'
          'Class creation can be customized heavily using metaclasses.\n'
          '\n'
          'Classes can also be decorated: just like when decorating '
          'functions,\n'
          '\n'
          '   @f1(arg)\n'
          '   @f2\n'
          '   class Foo: pass\n'
          '\n'
          'is roughly equivalent to\n'
          '\n'
          '   class Foo: pass\n'
          '   Foo = f1(arg)(f2(Foo))\n'
          '\n'
          'The evaluation rules for the decorator expressions are the same as '
          'for\n'
          'function decorators.  The result is then bound to the class name.\n'
          '\n'
          '**Programmer’s note:** Variables defined in the class definition '
          'are\n'
          'class attributes; they are shared by instances.  Instance '
          'attributes\n'
          'can be set in a method with "self.name = value".  Both class and\n'
          'instance attributes are accessible through the notation '
          '“"self.name"”,\n'
          'and an instance attribute hides a class attribute with the same '
          'name\n'
          'when accessed in this way.  Class attributes can be used as '
          'defaults\n'
          'for instance attributes, but using mutable values there can lead '
          'to\n'
          'unexpected results.  Descriptors can be used to create instance\n'
          'variables with different implementation details.\n'
          '\n'
          'See also:\n'
          '\n'
          '  **PEP 3115** - Metaclasses in Python 3000\n'
          '     The proposal that changed the declaration of metaclasses to '
          'the\n'
          '     current syntax, and the semantics for how classes with\n'
          '     metaclasses are constructed.\n'
          '\n'
          '  **PEP 3129** - Class Decorators\n'
          '     The proposal that added class decorators.  Function and '
          'method\n'
          '     decorators were introduced in **PEP 318**.\n',
 'comparisons': 'Comparisons\n'
                '***********\n'
                '\n'
                'Unlike C, all comparison operations in Python have the same '
                'priority,\n'
                'which is lower than that of any arithmetic, shifting or '
                'bitwise\n'
                'operation.  Also unlike C, expressions like "a < b < c" have '
                'the\n'
                'interpretation that is conventional in mathematics:\n'
                '\n'
                '   comparison    ::= or_expr (comp_operator or_expr)*\n'
                '   comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "!="\n'
                '                     | "is" ["not"] | ["not"] "in"\n'
                '\n'
                'Comparisons yield boolean values: "True" or "False".\n'
                '\n'
                'Comparisons can be chained arbitrarily, e.g., "x < y <= z" '
                'is\n'
                'equivalent to "x < y and y <= z", except that "y" is '
                'evaluated only\n'
                'once (but in both cases "z" is not evaluated at all when "x < '
                'y" is\n'
                'found to be false).\n'
                '\n'
                'Formally, if *a*, *b*, *c*, …, *y*, *z* are expressions and '
                '*op1*,\n'
                '*op2*, …, *opN* are comparison operators, then "a op1 b op2 c '
                '... y\n'
                'opN z" is equivalent to "a op1 b and b op2 c and ... y opN '
                'z", except\n'
                'that each expression is evaluated at most once.\n'
                '\n'
                'Note that "a op1 b op2 c" doesn’t imply any kind of '
                'comparison between\n'
                '*a* and *c*, so that, e.g., "x < y > z" is perfectly legal '
                '(though\n'
                'perhaps not pretty).\n'
                '\n'
                '\n'
                'Value comparisons\n'
                '=================\n'
                '\n'
                'The operators "<", ">", "==", ">=", "<=", and "!=" compare '
                'the values\n'
                'of two objects.  The objects do not need to have the same '
                'type.\n'
                '\n'
                'Chapter Objects, values and types states that objects have a '
                'value (in\n'
                'addition to type and identity).  The value of an object is a '
                'rather\n'
                'abstract notion in Python: For example, there is no canonical '
                'access\n'
                'method for an object’s value.  Also, there is no requirement '
                'that the\n'
                'value of an object should be constructed in a particular way, '
                'e.g.\n'
                'comprised of all its data attributes. Comparison operators '
                'implement a\n'
                'particular notion of what the value of an object is.  One can '
                'think of\n'
                'them as defining the value of an object indirectly, by means '
                'of their\n'
                'comparison implementation.\n'
                '\n'
                'Because all types are (direct or indirect) subtypes of '
                '"object", they\n'
                'inherit the default comparison behavior from "object".  Types '
                'can\n'
                'customize their comparison behavior by implementing *rich '
                'comparison\n'
                'methods* like "__lt__()", described in Basic customization.\n'
                '\n'
                'The default behavior for equality comparison ("==" and "!=") '
                'is based\n'
                'on the identity of the objects.  Hence, equality comparison '
                'of\n'
                'instances with the same identity results in equality, and '
                'equality\n'
                'comparison of instances with different identities results in\n'
                'inequality.  A motivation for this default behavior is the '
                'desire that\n'
                'all objects should be reflexive (i.e. "x is y" implies "x == '
                'y").\n'
                '\n'
                'A default order comparison ("<", ">", "<=", and ">=") is not '
                'provided;\n'
                'an attempt raises "TypeError".  A motivation for this default '
                'behavior\n'
                'is the lack of a similar invariant as for equality.\n'
                '\n'
                'The behavior of the default equality comparison, that '
                'instances with\n'
                'different identities are always unequal, may be in contrast '
                'to what\n'
                'types will need that have a sensible definition of object '
                'value and\n'
                'value-based equality.  Such types will need to customize '
                'their\n'
                'comparison behavior, and in fact, a number of built-in types '
                'have done\n'
                'that.\n'
                '\n'
                'The following list describes the comparison behavior of the '
                'most\n'
                'important built-in types.\n'
                '\n'
                '* Numbers of built-in numeric types (Numeric Types — int, '
                'float,\n'
                '  complex) and of the standard library types '
                '"fractions.Fraction" and\n'
                '  "decimal.Decimal" can be compared within and across their '
                'types,\n'
                '  with the restriction that complex numbers do not support '
                'order\n'
                '  comparison.  Within the limits of the types involved, they '
                'compare\n'
                '  mathematically (algorithmically) correct without loss of '
                'precision.\n'
                '\n'
                '  The not-a-number values "float(\'NaN\')" and '
                '"decimal.Decimal(\'NaN\')"\n'
                '  are special.  Any ordered comparison of a number to a '
                'not-a-number\n'
                '  value is false. A counter-intuitive implication is that '
                'not-a-number\n'
                '  values are not equal to themselves.  For example, if "x =\n'
                '  float(\'NaN\')", "3 < x", "x < 3" and "x == x" are all '
                'false, while "x\n'
                '  != x" is true.  This behavior is compliant with IEEE 754.\n'
                '\n'
                '* "None" and "NotImplemented" are singletons.  **PEP 8** '
                'advises that\n'
                '  comparisons for singletons should always be done with "is" '
                'or "is\n'
                '  not", never the equality operators.\n'
                '\n'
                '* Binary sequences (instances of "bytes" or "bytearray") can '
                'be\n'
                '  compared within and across their types.  They compare\n'
                '  lexicographically using the numeric values of their '
                'elements.\n'
                '\n'
                '* Strings (instances of "str") compare lexicographically '
                'using the\n'
                '  numerical Unicode code points (the result of the built-in '
                'function\n'
                '  "ord()") of their characters. [3]\n'
                '\n'
                '  Strings and binary sequences cannot be directly compared.\n'
                '\n'
                '* Sequences (instances of "tuple", "list", or "range") can be '
                'compared\n'
                '  only within each of their types, with the restriction that '
                'ranges do\n'
                '  not support order comparison.  Equality comparison across '
                'these\n'
                '  types results in inequality, and ordering comparison across '
                'these\n'
                '  types raises "TypeError".\n'
                '\n'
                '  Sequences compare lexicographically using comparison of\n'
                '  corresponding elements.  The built-in containers typically '
                'assume\n'
                '  identical objects are equal to themselves.  That lets them '
                'bypass\n'
                '  equality tests for identical objects to improve performance '
                'and to\n'
                '  maintain their internal invariants.\n'
                '\n'
                '  Lexicographical comparison between built-in collections '
                'works as\n'
                '  follows:\n'
                '\n'
                '  * For two collections to compare equal, they must be of the '
                'same\n'
                '    type, have the same length, and each pair of '
                'corresponding\n'
                '    elements must compare equal (for example, "[1,2] == '
                '(1,2)" is\n'
                '    false because the type is not the same).\n'
                '\n'
                '  * Collections that support order comparison are ordered the '
                'same as\n'
                '    their first unequal elements (for example, "[1,2,x] <= '
                '[1,2,y]"\n'
                '    has the same value as "x <= y").  If a corresponding '
                'element does\n'
                '    not exist, the shorter collection is ordered first (for '
                'example,\n'
                '    "[1,2] < [1,2,3]" is true).\n'
                '\n'
                '* Mappings (instances of "dict") compare equal if and only if '
                'they\n'
                '  have equal *(key, value)* pairs. Equality comparison of the '
                'keys and\n'
                '  values enforces reflexivity.\n'
                '\n'
                '  Order comparisons ("<", ">", "<=", and ">=") raise '
                '"TypeError".\n'
                '\n'
                '* Sets (instances of "set" or "frozenset") can be compared '
                'within and\n'
                '  across their types.\n'
                '\n'
                '  They define order comparison operators to mean subset and '
                'superset\n'
                '  tests.  Those relations do not define total orderings (for '
                'example,\n'
                '  the two sets "{1,2}" and "{2,3}" are not equal, nor subsets '
                'of one\n'
                '  another, nor supersets of one another).  Accordingly, sets '
                'are not\n'
                '  appropriate arguments for functions which depend on total '
                'ordering\n'
                '  (for example, "min()", "max()", and "sorted()" produce '
                'undefined\n'
                '  results given a list of sets as inputs).\n'
                '\n'
                '  Comparison of sets enforces reflexivity of its elements.\n'
                '\n'
                '* Most other built-in types have no comparison methods '
                'implemented, so\n'
                '  they inherit the default comparison behavior.\n'
                '\n'
                'User-defined classes that customize their comparison behavior '
                'should\n'
                'follow some consistency rules, if possible:\n'
                '\n'
                '* Equality comparison should be reflexive. In other words, '
                'identical\n'
                '  objects should compare equal:\n'
                '\n'
                '     "x is y" implies "x == y"\n'
                '\n'
                '* Comparison should be symmetric. In other words, the '
                'following\n'
                '  expressions should have the same result:\n'
                '\n'
                '     "x == y" and "y == x"\n'
                '\n'
                '     "x != y" and "y != x"\n'
                '\n'
                '     "x < y" and "y > x"\n'
                '\n'
                '     "x <= y" and "y >= x"\n'
                '\n'
                '* Comparison should be transitive. The following '
                '(non-exhaustive)\n'
                '  examples illustrate that:\n'
                '\n'
                '     "x > y and y > z" implies "x > z"\n'
                '\n'
                '     "x < y and y <= z" implies "x < z"\n'
                '\n'
                '* Inverse comparison should result in the boolean negation. '
                'In other\n'
                '  words, the following expressions should have the same '
                'result:\n'
                '\n'
                '     "x == y" and "not x != y"\n'
                '\n'
                '     "x < y" and "not x >= y" (for total ordering)\n'
                '\n'
                '     "x > y" and "not x <= y" (for total ordering)\n'
                '\n'
                '  The last two expressions apply to totally ordered '
                'collections (e.g.\n'
                '  to sequences, but not to sets or mappings). See also the\n'
                '  "total_ordering()" decorator.\n'
                '\n'
                '* The "hash()" result should be consistent with equality. '
                'Objects that\n'
                '  are equal should either have the same hash value, or be '
                'marked as\n'
                '  unhashable.\n'
                '\n'
                'Python does not enforce these consistency rules. In fact, '
                'the\n'
                'not-a-number values are an example for not following these '
                'rules.\n'
                '\n'
                '\n'
                'Membership test operations\n'
                '==========================\n'
                '\n'
                'The operators "in" and "not in" test for membership.  "x in '
                's"\n'
                'evaluates to "True" if *x* is a member of *s*, and "False" '
                'otherwise.\n'
                '"x not in s" returns the negation of "x in s".  All built-in '
                'sequences\n'
                'and set types support this as well as dictionary, for which '
                '"in" tests\n'
                'whether the dictionary has a given key. For container types '
                'such as\n'
                'list, tuple, set, frozenset, dict, or collections.deque, the\n'
                'expression "x in y" is equivalent to "any(x is e or x == e '
                'for e in\n'
                'y)".\n'
                '\n'
                'For the string and bytes types, "x in y" is "True" if and '
                'only if *x*\n'
                'is a substring of *y*.  An equivalent test is "y.find(x) != '
                '-1".\n'
                'Empty strings are always considered to be a substring of any '
                'other\n'
                'string, so """ in "abc"" will return "True".\n'
                '\n'
                'For user-defined classes which define the "__contains__()" '
                'method, "x\n'
                'in y" returns "True" if "y.__contains__(x)" returns a true '
                'value, and\n'
                '"False" otherwise.\n'
                '\n'
                'For user-defined classes which do not define "__contains__()" '
                'but do\n'
                'define "__iter__()", "x in y" is "True" if some value "z", '
                'for which\n'
                'the expression "x is z or x == z" is true, is produced while '
                'iterating\n'
                'over "y". If an exception is raised during the iteration, it '
                'is as if\n'
                '"in" raised that exception.\n'
                '\n'
                'Lastly, the old-style iteration protocol is tried: if a class '
                'defines\n'
                '"__getitem__()", "x in y" is "True" if and only if there is a '
                'non-\n'
                'negative integer index *i* such that "x is y[i] or x == '
                'y[i]", and no\n'
                'lower integer index raises the "IndexError" exception.  (If '
                'any other\n'
                'exception is raised, it is as if "in" raised that '
                'exception).\n'
                '\n'
                'The operator "not in" is defined to have the inverse truth '
                'value of\n'
                '"in".\n'
                '\n'
                '\n'
                'Identity comparisons\n'
                '====================\n'
                '\n'
                'The operators "is" and "is not" test for an object’s '
                'identity: "x is\n'
                'y" is true if and only if *x* and *y* are the same object.  '
                'An\n'
                'Object’s identity is determined using the "id()" function.  '
                '"x is not\n'
                'y" yields the inverse truth value. [4]\n',
 'compound': 'Compound statements\n'
             '*******************\n'
             '\n'
             'Compound statements contain (groups of) other statements; they '
             'affect\n'
             'or control the execution of those other statements in some way.  '
             'In\n'
             'general, compound statements span multiple lines, although in '
             'simple\n'
             'incarnations a whole compound statement may be contained in one '
             'line.\n'
             '\n'
             'The "if", "while" and "for" statements implement traditional '
             'control\n'
             'flow constructs.  "try" specifies exception handlers and/or '
             'cleanup\n'
             'code for a group of statements, while the "with" statement '
             'allows the\n'
             'execution of initialization and finalization code around a block '
             'of\n'
             'code.  Function and class definitions are also syntactically '
             'compound\n'
             'statements.\n'
             '\n'
             'A compound statement consists of one or more ‘clauses.’  A '
             'clause\n'
             'consists of a header and a ‘suite.’  The clause headers of a\n'
             'particular compound statement are all at the same indentation '
             'level.\n'
             'Each clause header begins with a uniquely identifying keyword '
             'and ends\n'
             'with a colon.  A suite is a group of statements controlled by a\n'
             'clause.  A suite can be one or more semicolon-separated simple\n'
             'statements on the same line as the header, following the '
             'header’s\n'
             'colon, or it can be one or more indented statements on '
             'subsequent\n'
             'lines.  Only the latter form of a suite can contain nested '
             'compound\n'
             'statements; the following is illegal, mostly because it wouldn’t '
             'be\n'
             'clear to which "if" clause a following "else" clause would '
             'belong:\n'
             '\n'
             '   if test1: if test2: print(x)\n'
             '\n'
             'Also note that the semicolon binds tighter than the colon in '
             'this\n'
             'context, so that in the following example, either all or none of '
             'the\n'
             '"print()" calls are executed:\n'
             '\n'
             '   if x < y < z: print(x); print(y); print(z)\n'
             '\n'
             'Summarizing:\n'
             '\n'
             '   compound_stmt ::= if_stmt\n'
             '                     | while_stmt\n'
             '                     | for_stmt\n'
             '                     | try_stmt\n'
             '                     | with_stmt\n'
             '                     | funcdef\n'
             '                     | classdef\n'
             '                     | async_with_stmt\n'
             '                     | async_for_stmt\n'
             '                     | async_funcdef\n'
             '   suite         ::= stmt_list NEWLINE | NEWLINE INDENT '
             'statement+ DEDENT\n'
             '   statement     ::= stmt_list NEWLINE | compound_stmt\n'
             '   stmt_list     ::= simple_stmt (";" simple_stmt)* [";"]\n'
             '\n'
             'Note that statements always end in a "NEWLINE" possibly followed '
             'by a\n'
             '"DEDENT".  Also note that optional continuation clauses always '
             'begin\n'
             'with a keyword that cannot start a statement, thus there are no\n'
             'ambiguities (the ‘dangling "else"’ problem is solved in Python '
             'by\n'
             'requiring nested "if" statements to be indented).\n'
             '\n'
             'The formatting of the grammar rules in the following sections '
             'places\n'
             'each clause on a separate line for clarity.\n'
             '\n'
             '\n'
             'The "if" statement\n'
             '==================\n'
             '\n'
             'The "if" statement is used for conditional execution:\n'
             '\n'
             '   if_stmt ::= "if" assignment_expression ":" suite\n'
             '               ("elif" assignment_expression ":" suite)*\n'
             '               ["else" ":" suite]\n'
             '\n'
             'It selects exactly one of the suites by evaluating the '
             'expressions one\n'
             'by one until one is found to be true (see section Boolean '
             'operations\n'
             'for the definition of true and false); then that suite is '
             'executed\n'
             '(and no other part of the "if" statement is executed or '
             'evaluated).\n'
             'If all expressions are false, the suite of the "else" clause, '
             'if\n'
             'present, is executed.\n'
             '\n'
             '\n'
             'The "while" statement\n'
             '=====================\n'
             '\n'
             'The "while" statement is used for repeated execution as long as '
             'an\n'
             'expression is true:\n'
             '\n'
             '   while_stmt ::= "while" assignment_expression ":" suite\n'
             '                  ["else" ":" suite]\n'
             '\n'
             'This repeatedly tests the expression and, if it is true, '
             'executes the\n'
             'first suite; if the expression is false (which may be the first '
             'time\n'
             'it is tested) the suite of the "else" clause, if present, is '
             'executed\n'
             'and the loop terminates.\n'
             '\n'
             'A "break" statement executed in the first suite terminates the '
             'loop\n'
             'without executing the "else" clause’s suite.  A "continue" '
             'statement\n'
             'executed in the first suite skips the rest of the suite and goes '
             'back\n'
             'to testing the expression.\n'
             '\n'
             '\n'
             'The "for" statement\n'
             '===================\n'
             '\n'
             'The "for" statement is used to iterate over the elements of a '
             'sequence\n'
             '(such as a string, tuple or list) or other iterable object:\n'
             '\n'
             '   for_stmt ::= "for" target_list "in" expression_list ":" '
             'suite\n'
             '                ["else" ":" suite]\n'
             '\n'
             'The expression list is evaluated once; it should yield an '
             'iterable\n'
             'object.  An iterator is created for the result of the\n'
             '"expression_list".  The suite is then executed once for each '
             'item\n'
             'provided by the iterator, in the order returned by the '
             'iterator.  Each\n'
             'item in turn is assigned to the target list using the standard '
             'rules\n'
             'for assignments (see Assignment statements), and then the suite '
             'is\n'
             'executed.  When the items are exhausted (which is immediately '
             'when the\n'
             'sequence is empty or an iterator raises a "StopIteration" '
             'exception),\n'
             'the suite in the "else" clause, if present, is executed, and the '
             'loop\n'
             'terminates.\n'
             '\n'
             'A "break" statement executed in the first suite terminates the '
             'loop\n'
             'without executing the "else" clause’s suite.  A "continue" '
             'statement\n'
             'executed in the first suite skips the rest of the suite and '
             'continues\n'
             'with the next item, or with the "else" clause if there is no '
             'next\n'
             'item.\n'
             '\n'
             'The for-loop makes assignments to the variables in the target '
             'list.\n'
             'This overwrites all previous assignments to those variables '
             'including\n'
             'those made in the suite of the for-loop:\n'
             '\n'
             '   for i in range(10):\n'
             '       print(i)\n'
             '       i = 5             # this will not affect the for-loop\n'
             '                         # because i will be overwritten with '
             'the next\n'
             '                         # index in the range\n'
             '\n'
             'Names in the target list are not deleted when the loop is '
             'finished,\n'
             'but if the sequence is empty, they will not have been assigned '
             'to at\n'
             'all by the loop.  Hint: the built-in function "range()" returns '
             'an\n'
             'iterator of integers suitable to emulate the effect of Pascal’s '
             '"for i\n'
             ':= a to b do"; e.g., "list(range(3))" returns the list "[0, 1, '
             '2]".\n'
             '\n'
             'Note:\n'
             '\n'
             '  There is a subtlety when the sequence is being modified by the '
             'loop\n'
             '  (this can only occur for mutable sequences, e.g. lists).  An\n'
             '  internal counter is used to keep track of which item is used '
             'next,\n'
             '  and this is incremented on each iteration.  When this counter '
             'has\n'
             '  reached the length of the sequence the loop terminates.  This '
             'means\n'
             '  that if the suite deletes the current (or a previous) item '
             'from the\n'
             '  sequence, the next item will be skipped (since it gets the '
             'index of\n'
             '  the current item which has already been treated).  Likewise, '
             'if the\n'
             '  suite inserts an item in the sequence before the current item, '
             'the\n'
             '  current item will be treated again the next time through the '
             'loop.\n'
             '  This can lead to nasty bugs that can be avoided by making a\n'
             '  temporary copy using a slice of the whole sequence, e.g.,\n'
             '\n'
             '     for x in a[:]:\n'
             '         if x < 0: a.remove(x)\n'
             '\n'
             '\n'
             'The "try" statement\n'
             '===================\n'
             '\n'
             'The "try" statement specifies exception handlers and/or cleanup '
             'code\n'
             'for a group of statements:\n'
             '\n'
             '   try_stmt  ::= try1_stmt | try2_stmt\n'
             '   try1_stmt ::= "try" ":" suite\n'
             '                 ("except" [expression ["as" identifier]] ":" '
             'suite)+\n'
             '                 ["else" ":" suite]\n'
             '                 ["finally" ":" suite]\n'
             '   try2_stmt ::= "try" ":" suite\n'
             '                 "finally" ":" suite\n'
             '\n'
             'The "except" clause(s) specify one or more exception handlers. '
             'When no\n'
             'exception occurs in the "try" clause, no exception handler is\n'
             'executed. When an exception occurs in the "try" suite, a search '
             'for an\n'
             'exception handler is started.  This search inspects the except '
             'clauses\n'
             'in turn until one is found that matches the exception.  An '
             'expression-\n'
             'less except clause, if present, must be last; it matches any\n'
             'exception.  For an except clause with an expression, that '
             'expression\n'
             'is evaluated, and the clause matches the exception if the '
             'resulting\n'
             'object is “compatible” with the exception.  An object is '
             'compatible\n'
             'with an exception if it is the class or a base class of the '
             'exception\n'
             'object, or a tuple containing an item that is the class or a '
             'base\n'
             'class of the exception object.\n'
             '\n'
             'If no except clause matches the exception, the search for an '
             'exception\n'
             'handler continues in the surrounding code and on the invocation '
             'stack.\n'
             '[1]\n'
             '\n'
             'If the evaluation of an expression in the header of an except '
             'clause\n'
             'raises an exception, the original search for a handler is '
             'canceled and\n'
             'a search starts for the new exception in the surrounding code '
             'and on\n'
             'the call stack (it is treated as if the entire "try" statement '
             'raised\n'
             'the exception).\n'
             '\n'
             'When a matching except clause is found, the exception is '
             'assigned to\n'
             'the target specified after the "as" keyword in that except '
             'clause, if\n'
             'present, and the except clause’s suite is executed.  All except\n'
             'clauses must have an executable block.  When the end of this '
             'block is\n'
             'reached, execution continues normally after the entire try '
             'statement.\n'
             '(This means that if two nested handlers exist for the same '
             'exception,\n'
             'and the exception occurs in the try clause of the inner handler, '
             'the\n'
             'outer handler will not handle the exception.)\n'
             '\n'
             'When an exception has been assigned using "as target", it is '
             'cleared\n'
             'at the end of the except clause.  This is as if\n'
             '\n'
             '   except E as N:\n'
             '       foo\n'
             '\n'
             'was translated to\n'
             '\n'
             '   except E as N:\n'
             '       try:\n'
             '           foo\n'
             '       finally:\n'
             '           del N\n'
             '\n'
             'This means the exception must be assigned to a different name to '
             'be\n'
             'able to refer to it after the except clause.  Exceptions are '
             'cleared\n'
             'because with the traceback attached to them, they form a '
             'reference\n'
             'cycle with the stack frame, keeping all locals in that frame '
             'alive\n'
             'until the next garbage collection occurs.\n'
             '\n'
             'Before an except clause’s suite is executed, details about the\n'
             'exception are stored in the "sys" module and can be accessed '
             'via\n'
             '"sys.exc_info()". "sys.exc_info()" returns a 3-tuple consisting '
             'of the\n'
             'exception class, the exception instance and a traceback object '
             '(see\n'
             'section The standard type hierarchy) identifying the point in '
             'the\n'
             'program where the exception occurred.  "sys.exc_info()" values '
             'are\n'
             'restored to their previous values (before the call) when '
             'returning\n'
             'from a function that handled an exception.\n'
             '\n'
             'The optional "else" clause is executed if the control flow '
             'leaves the\n'
             '"try" suite, no exception was raised, and no "return", '
             '"continue", or\n'
             '"break" statement was executed.  Exceptions in the "else" clause '
             'are\n'
             'not handled by the preceding "except" clauses.\n'
             '\n'
             'If "finally" is present, it specifies a ‘cleanup’ handler.  The '
             '"try"\n'
             'clause is executed, including any "except" and "else" clauses.  '
             'If an\n'
             'exception occurs in any of the clauses and is not handled, the\n'
             'exception is temporarily saved. The "finally" clause is '
             'executed.  If\n'
             'there is a saved exception it is re-raised at the end of the '
             '"finally"\n'
             'clause.  If the "finally" clause raises another exception, the '
             'saved\n'
             'exception is set as the context of the new exception. If the '
             '"finally"\n'
             'clause executes a "return", "break" or "continue" statement, the '
             'saved\n'
             'exception is discarded:\n'
             '\n'
             '   >>> def f():\n'
             '   ...     try:\n'
             '   ...         1/0\n'
             '   ...     finally:\n'
             '   ...         return 42\n'
             '   ...\n'
             '   >>> f()\n'
             '   42\n'
             '\n'
             'The exception information is not available to the program '
             'during\n'
             'execution of the "finally" clause.\n'
             '\n'
             'When a "return", "break" or "continue" statement is executed in '
             'the\n'
             '"try" suite of a "try"…"finally" statement, the "finally" clause '
             'is\n'
             'also executed ‘on the way out.’\n'
             '\n'
             'The return value of a function is determined by the last '
             '"return"\n'
             'statement executed.  Since the "finally" clause always executes, '
             'a\n'
             '"return" statement executed in the "finally" clause will always '
             'be the\n'
             'last one executed:\n'
             '\n'
             '   >>> def foo():\n'
             '   ...     try:\n'
             "   ...         return 'try'\n"
             '   ...     finally:\n'
             "   ...         return 'finally'\n"
             '   ...\n'
             '   >>> foo()\n'
             "   'finally'\n"
             '\n'
             'Additional information on exceptions can be found in section\n'
             'Exceptions, and information on using the "raise" statement to '
             'generate\n'
             'exceptions may be found in section The raise statement.\n'
             '\n'
             'Changed in version 3.8: Prior to Python 3.8, a "continue" '
             'statement\n'
             'was illegal in the "finally" clause due to a problem with the\n'
             'implementation.\n'
             '\n'
             '\n'
             'The "with" statement\n'
             '====================\n'
             '\n'
             'The "with" statement is used to wrap the execution of a block '
             'with\n'
             'methods defined by a context manager (see section With '
             'Statement\n'
             'Context Managers). This allows common "try"…"except"…"finally" '
             'usage\n'
             'patterns to be encapsulated for convenient reuse.\n'
             '\n'
             '   with_stmt ::= "with" with_item ("," with_item)* ":" suite\n'
             '   with_item ::= expression ["as" target]\n'
             '\n'
             'The execution of the "with" statement with one “item” proceeds '
             'as\n'
             'follows:\n'
             '\n'
             '1. The context expression (the expression given in the '
             '"with_item") is\n'
             '   evaluated to obtain a context manager.\n'
             '\n'
             '2. The context manager’s "__enter__()" is loaded for later use.\n'
             '\n'
             '3. The context manager’s "__exit__()" is loaded for later use.\n'
             '\n'
             '4. The context manager’s "__enter__()" method is invoked.\n'
             '\n'
             '5. If a target was included in the "with" statement, the return '
             'value\n'
             '   from "__enter__()" is assigned to it.\n'
             '\n'
             '   Note:\n'
             '\n'
             '     The "with" statement guarantees that if the "__enter__()" '
             'method\n'
             '     returns without an error, then "__exit__()" will always be\n'
             '     called. Thus, if an error occurs during the assignment to '
             'the\n'
             '     target list, it will be treated the same as an error '
             'occurring\n'
             '     within the suite would be. See step 6 below.\n'
             '\n'
             '6. The suite is executed.\n'
             '\n'
             '7. The context manager’s "__exit__()" method is invoked.  If an\n'
             '   exception caused the suite to be exited, its type, value, '
             'and\n'
             '   traceback are passed as arguments to "__exit__()". Otherwise, '
             'three\n'
             '   "None" arguments are supplied.\n'
             '\n'
             '   If the suite was exited due to an exception, and the return '
             'value\n'
             '   from the "__exit__()" method was false, the exception is '
             'reraised.\n'
             '   If the return value was true, the exception is suppressed, '
             'and\n'
             '   execution continues with the statement following the "with"\n'
             '   statement.\n'
             '\n'
             '   If the suite was exited for any reason other than an '
             'exception, the\n'
             '   return value from "__exit__()" is ignored, and execution '
             'proceeds\n'
             '   at the normal location for the kind of exit that was taken.\n'
             '\n'
             'The following code:\n'
             '\n'
             '   with EXPRESSION as TARGET:\n'
             '       SUITE\n'
             '\n'
             'is semantically equivalent to:\n'
             '\n'
             '   manager = (EXPRESSION)\n'
             '   enter = type(manager).__enter__\n'
             '   exit = type(manager).__exit__\n'
             '   value = enter(manager)\n'
             '   hit_except = False\n'
             '\n'
             '   try:\n'
             '       TARGET = value\n'
             '       SUITE\n'
             '   except:\n'
             '       hit_except = True\n'
             '       if not exit(manager, *sys.exc_info()):\n'
             '           raise\n'
             '   finally:\n'
             '       if not hit_except:\n'
             '           exit(manager, None, None, None)\n'
             '\n'
             'With more than one item, the context managers are processed as '
             'if\n'
             'multiple "with" statements were nested:\n'
             '\n'
             '   with A() as a, B() as b:\n'
             '       SUITE\n'
             '\n'
             'is semantically equivalent to:\n'
             '\n'
             '   with A() as a:\n'
             '       with B() as b:\n'
             '           SUITE\n'
             '\n'
             'Changed in version 3.1: Support for multiple context '
             'expressions.\n'
             '\n'
             'See also:\n'
             '\n'
             '  **PEP 343** - The “with” statement\n'
             '     The specification, background, and examples for the Python '
             '"with"\n'
             '     statement.\n'
             '\n'
             '\n'
             'Function definitions\n'
             '====================\n'
             '\n'
             'A function definition defines a user-defined function object '
             '(see\n'
             'section The standard type hierarchy):\n'
             '\n'
             '   funcdef                   ::= [decorators] "def" funcname "(" '
             '[parameter_list] ")"\n'
             '               ["->" expression] ":" suite\n'
             '   decorators                ::= decorator+\n'
             '   decorator                 ::= "@" dotted_name ["(" '
             '[argument_list [","]] ")"] NEWLINE\n'
             '   dotted_name               ::= identifier ("." identifier)*\n'
             '   parameter_list            ::= defparameter ("," '
             'defparameter)* "," "/" ["," [parameter_list_no_posonly]]\n'
             '                        | parameter_list_no_posonly\n'
             '   parameter_list_no_posonly ::= defparameter ("," '
             'defparameter)* ["," [parameter_list_starargs]]\n'
             '                                 | parameter_list_starargs\n'
             '   parameter_list_starargs   ::= "*" [parameter] ("," '
             'defparameter)* ["," ["**" parameter [","]]]\n'
             '                               | "**" parameter [","]\n'
             '   parameter                 ::= identifier [":" expression]\n'
             '   defparameter              ::= parameter ["=" expression]\n'
             '   funcname                  ::= identifier\n'
             '\n'
             'A function definition is an executable statement.  Its execution '
             'binds\n'
             'the function name in the current local namespace to a function '
             'object\n'
             '(a wrapper around the executable code for the function).  This\n'
             'function object contains a reference to the current global '
             'namespace\n'
             'as the global namespace to be used when the function is called.\n'
             '\n'
             'The function definition does not execute the function body; this '
             'gets\n'
             'executed only when the function is called. [2]\n'
             '\n'
             'A function definition may be wrapped by one or more *decorator*\n'
             'expressions. Decorator expressions are evaluated when the '
             'function is\n'
             'defined, in the scope that contains the function definition.  '
             'The\n'
             'result must be a callable, which is invoked with the function '
             'object\n'
             'as the only argument. The returned value is bound to the '
             'function name\n'
             'instead of the function object.  Multiple decorators are applied '
             'in\n'
             'nested fashion. For example, the following code\n'
             '\n'
             '   @f1(arg)\n'
             '   @f2\n'
             '   def func(): pass\n'
             '\n'
             'is roughly equivalent to\n'
             '\n'
             '   def func(): pass\n'
             '   func = f1(arg)(f2(func))\n'
             '\n'
             'except that the original function is not temporarily bound to '
             'the name\n'
             '"func".\n'
             '\n'
             'When one or more *parameters* have the form *parameter* "="\n'
             '*expression*, the function is said to have “default parameter '
             'values.”\n'
             'For a parameter with a default value, the corresponding '
             '*argument* may\n'
             'be omitted from a call, in which case the parameter’s default '
             'value is\n'
             'substituted.  If a parameter has a default value, all following\n'
             'parameters up until the “"*"” must also have a default value — '
             'this is\n'
             'a syntactic restriction that is not expressed by the grammar.\n'
             '\n'
             '**Default parameter values are evaluated from left to right when '
             'the\n'
             'function definition is executed.** This means that the '
             'expression is\n'
             'evaluated once, when the function is defined, and that the same '
             '“pre-\n'
             'computed” value is used for each call.  This is especially '
             'important\n'
             'to understand when a default parameter is a mutable object, such '
             'as a\n'
             'list or a dictionary: if the function modifies the object (e.g. '
             'by\n'
             'appending an item to a list), the default value is in effect '
             'modified.\n'
             'This is generally not what was intended.  A way around this is '
             'to use\n'
             '"None" as the default, and explicitly test for it in the body of '
             'the\n'
             'function, e.g.:\n'
             '\n'
             '   def whats_on_the_telly(penguin=None):\n'
             '       if penguin is None:\n'
             '           penguin = []\n'
             '       penguin.append("property of the zoo")\n'
             '       return penguin\n'
             '\n'
             'Function call semantics are described in more detail in section '
             'Calls.\n'
             'A function call always assigns values to all parameters '
             'mentioned in\n'
             'the parameter list, either from positional arguments, from '
             'keyword\n'
             'arguments, or from default values.  If the form “"*identifier"” '
             'is\n'
             'present, it is initialized to a tuple receiving any excess '
             'positional\n'
             'parameters, defaulting to the empty tuple. If the form\n'
             '“"**identifier"” is present, it is initialized to a new ordered\n'
             'mapping receiving any excess keyword arguments, defaulting to a '
             'new\n'
             'empty mapping of the same type.  Parameters after “"*"” or\n'
             '“"*identifier"” are keyword-only parameters and may only be '
             'passed by\n'
             'keyword arguments.  Parameters before “"/"” are positional-only\n'
             'parameters and may only be passed by positional arguments.\n'
             '\n'
             'Changed in version 3.8: The "/" function parameter syntax may be '
             'used\n'
             'to indicate positional-only parameters. See **PEP 570** for '
             'details.\n'
             '\n'
             'Parameters may have an *annotation* of the form “": '
             'expression"”\n'
             'following the parameter name.  Any parameter may have an '
             'annotation,\n'
             'even those of the form "*identifier" or "**identifier".  '
             'Functions may\n'
             'have “return” annotation of the form “"-> expression"” after '
             'the\n'
             'parameter list.  These annotations can be any valid Python '
             'expression.\n'
             'The presence of annotations does not change the semantics of a\n'
             'function.  The annotation values are available as values of a\n'
             'dictionary keyed by the parameters’ names in the '
             '"__annotations__"\n'
             'attribute of the function object.  If the "annotations" import '
             'from\n'
             '"__future__" is used, annotations are preserved as strings at '
             'runtime\n'
             'which enables postponed evaluation.  Otherwise, they are '
             'evaluated\n'
             'when the function definition is executed.  In this case '
             'annotations\n'
             'may be evaluated in a different order than they appear in the '
             'source\n'
             'code.\n'
             '\n'
             'It is also possible to create anonymous functions (functions not '
             'bound\n'
             'to a name), for immediate use in expressions.  This uses lambda\n'
             'expressions, described in section Lambdas.  Note that the '
             'lambda\n'
             'expression is merely a shorthand for a simplified function '
             'definition;\n'
             'a function defined in a “"def"” statement can be passed around '
             'or\n'
             'assigned to another name just like a function defined by a '
             'lambda\n'
             'expression.  The “"def"” form is actually more powerful since '
             'it\n'
             'allows the execution of multiple statements and annotations.\n'
             '\n'
             '**Programmer’s note:** Functions are first-class objects.  A '
             '“"def"”\n'
             'statement executed inside a function definition defines a local\n'
             'function that can be returned or passed around.  Free variables '
             'used\n'
             'in the nested function can access the local variables of the '
             'function\n'
             'containing the def.  See section Naming and binding for '
             'details.\n'
             '\n'
             'See also:\n'
             '\n'
             '  **PEP 3107** - Function Annotations\n'
             '     The original specification for function annotations.\n'
             '\n'
             '  **PEP 484** - Type Hints\n'
             '     Definition of a standard meaning for annotations: type '
             'hints.\n'
             '\n'
             '  **PEP 526** - Syntax for Variable Annotations\n'
             '     Ability to type hint variable declarations, including '
             'class\n'
             '     variables and instance variables\n'
             '\n'
             '  **PEP 563** - Postponed Evaluation of Annotations\n'
             '     Support for forward references within annotations by '
             'preserving\n'
             '     annotations in a string form at runtime instead of eager\n'
             '     evaluation.\n'
             '\n'
             '\n'
             'Class definitions\n'
             '=================\n'
             '\n'
             'A class definition defines a class object (see section The '
             'standard\n'
             'type hierarchy):\n'
             '\n'
             '   classdef    ::= [decorators] "class" classname [inheritance] '
             '":" suite\n'
             '   inheritance ::= "(" [argument_list] ")"\n'
             '   classname   ::= identifier\n'
             '\n'
             'A class definition is an executable statement.  The inheritance '
             'list\n'
             'usually gives a list of base classes (see Metaclasses for more\n'
             'advanced uses), so each item in the list should evaluate to a '
             'class\n'
             'object which allows subclassing.  Classes without an inheritance '
             'list\n'
             'inherit, by default, from the base class "object"; hence,\n'
             '\n'
             '   class Foo:\n'
             '       pass\n'
             '\n'
             'is equivalent to\n'
             '\n'
             '   class Foo(object):\n'
             '       pass\n'
             '\n'
             'The class’s suite is then executed in a new execution frame '
             '(see\n'
             'Naming and binding), using a newly created local namespace and '
             'the\n'
             'original global namespace. (Usually, the suite contains mostly\n'
             'function definitions.)  When the class’s suite finishes '
             'execution, its\n'
             'execution frame is discarded but its local namespace is saved. '
             '[3] A\n'
             'class object is then created using the inheritance list for the '
             'base\n'
             'classes and the saved local namespace for the attribute '
             'dictionary.\n'
             'The class name is bound to this class object in the original '
             'local\n'
             'namespace.\n'
             '\n'
             'The order in which attributes are defined in the class body is\n'
             'preserved in the new class’s "__dict__".  Note that this is '
             'reliable\n'
             'only right after the class is created and only for classes that '
             'were\n'
             'defined using the definition syntax.\n'
             '\n'
             'Class creation can be customized heavily using metaclasses.\n'
             '\n'
             'Classes can also be decorated: just like when decorating '
             'functions,\n'
             '\n'
             '   @f1(arg)\n'
             '   @f2\n'
             '   class Foo: pass\n'
             '\n'
             'is roughly equivalent to\n'
             '\n'
             '   class Foo: pass\n'
             '   Foo = f1(arg)(f2(Foo))\n'
             '\n'
             'The evaluation rules for the decorator expressions are the same '
             'as for\n'
             'function decorators.  The result is then bound to the class '
             'name.\n'
             '\n'
             '**Programmer’s note:** Variables defined in the class definition '
             'are\n'
             'class attributes; they are shared by instances.  Instance '
             'attributes\n'
             'can be set in a method with "self.name = value".  Both class '
             'and\n'
             'instance attributes are accessible through the notation '
             '“"self.name"”,\n'
             'and an instance attribute hides a class attribute with the same '
             'name\n'
             'when accessed in this way.  Class attributes can be used as '
             'defaults\n'
             'for instance attributes, but using mutable values there can lead '
             'to\n'
             'unexpected results.  Descriptors can be used to create instance\n'
             'variables with different implementation details.\n'
             '\n'
             'See also:\n'
             '\n'
             '  **PEP 3115** - Metaclasses in Python 3000\n'
             '     The proposal that changed the declaration of metaclasses to '
             'the\n'
             '     current syntax, and the semantics for how classes with\n'
             '     metaclasses are constructed.\n'
             '\n'
             '  **PEP 3129** - Class Decorators\n'
             '     The proposal that added class decorators.  Function and '
             'method\n'
             '     decorators were introduced in **PEP 318**.\n'
             '\n'
             '\n'
             'Coroutines\n'
             '==========\n'
             '\n'
             'New in version 3.5.\n'
             '\n'
             '\n'
             'Coroutine function definition\n'
             '-----------------------------\n'
             '\n'
             '   async_funcdef ::= [decorators] "async" "def" funcname "(" '
             '[parameter_list] ")"\n'
             '                     ["->" expression] ":" suite\n'
             '\n'
             'Execution of Python coroutines can be suspended and resumed at '
             'many\n'
             'points (see *coroutine*).  Inside the body of a coroutine '
             'function,\n'
             '"await" and "async" identifiers become reserved keywords; '
             '"await"\n'
             'expressions, "async for" and "async with" can only be used in\n'
             'coroutine function bodies.\n'
             '\n'
             'Functions defined with "async def" syntax are always coroutine\n'
             'functions, even if they do not contain "await" or "async" '
             'keywords.\n'
             '\n'
             'It is a "SyntaxError" to use a "yield from" expression inside '
             'the body\n'
             'of a coroutine function.\n'
             '\n'
             'An example of a coroutine function:\n'
             '\n'
             '   async def func(param1, param2):\n'
             '       do_stuff()\n'
             '       await some_coroutine()\n'
             '\n'
             '\n'
             'The "async for" statement\n'
             '-------------------------\n'
             '\n'
             '   async_for_stmt ::= "async" for_stmt\n'
             '\n'
             'An *asynchronous iterable* is able to call asynchronous code in '
             'its\n'
             '*iter* implementation, and *asynchronous iterator* can call\n'
             'asynchronous code in its *next* method.\n'
             '\n'
             'The "async for" statement allows convenient iteration over\n'
             'asynchronous iterators.\n'
             '\n'
             'The following code:\n'
             '\n'
             '   async for TARGET in ITER:\n'
             '       SUITE\n'
             '   else:\n'
             '       SUITE2\n'
             '\n'
             'Is semantically equivalent to:\n'
             '\n'
             '   iter = (ITER)\n'
             '   iter = type(iter).__aiter__(iter)\n'
             '   running = True\n'
             '\n'
             '   while running:\n'
             '       try:\n'
             '           TARGET = await type(iter).__anext__(iter)\n'
             '       except StopAsyncIteration:\n'
             '           running = False\n'
             '       else:\n'
             '           SUITE\n'
             '   else:\n'
             '       SUITE2\n'
             '\n'
             'See also "__aiter__()" and "__anext__()" for details.\n'
             '\n'
             'It is a "SyntaxError" to use an "async for" statement outside '
             'the body\n'
             'of a coroutine function.\n'
             '\n'
             '\n'
             'The "async with" statement\n'
             '--------------------------\n'
             '\n'
             '   async_with_stmt ::= "async" with_stmt\n'
             '\n'
             'An *asynchronous context manager* is a *context manager* that is '
             'able\n'
             'to suspend execution in its *enter* and *exit* methods.\n'
             '\n'
             'The following code:\n'
             '\n'
             '   async with EXPRESSION as TARGET:\n'
             '       SUITE\n'
             '\n'
             'is semantically equivalent to:\n'
             '\n'
             '   manager = (EXPRESSION)\n'
             '   aexit = type(manager).__aexit__\n'
             '   aenter = type(manager).__aenter__\n'
             '   value = await aenter(manager)\n'
             '   hit_except = False\n'
             '\n'
             '   try:\n'
             '       TARGET = value\n'
             '       SUITE\n'
             '   except:\n'
             '       hit_except = True\n'
             '       if not await aexit(manager, *sys.exc_info()):\n'
             '           raise\n'
             '   finally:\n'
             '       if not hit_except:\n'
             '           await aexit(manager, None, None, None)\n'
             '\n'
             'See also "__aenter__()" and "__aexit__()" for details.\n'
             '\n'
             'It is a "SyntaxError" to use an "async with" statement outside '
             'the\n'
             'body of a coroutine function.\n'
             '\n'
             'See also:\n'
             '\n'
             '  **PEP 492** - Coroutines with async and await syntax\n'
             '     The proposal that made coroutines a proper standalone '
             'concept in\n'
             '     Python, and added supporting syntax.\n'
             '\n'
             '-[ Footnotes ]-\n'
             '\n'
             '[1] The exception is propagated to the invocation stack unless '
             'there\n'
             '    is a "finally" clause which happens to raise another '
             'exception.\n'
             '    That new exception causes the old one to be lost.\n'
             '\n'
             '[2] A string literal appearing as the first statement in the '
             'function\n'
             '    body is transformed into the function’s "__doc__" attribute '
             'and\n'
             '    therefore the function’s *docstring*.\n'
             '\n'
             '[3] A string literal appearing as the first statement in the '
             'class\n'
             '    body is transformed into the namespace’s "__doc__" item and\n'
             '    therefore the class’s *docstring*.\n',
 'context-managers': 'With Statement Context Managers\n'
                     '*******************************\n'
                     '\n'
                     'A *context manager* is an object that defines the '
                     'runtime context to\n'
                     'be established when executing a "with" statement. The '
                     'context manager\n'
                     'handles the entry into, and the exit from, the desired '
                     'runtime context\n'
                     'for the execution of the block of code.  Context '
                     'managers are normally\n'
                     'invoked using the "with" statement (described in section '
                     'The with\n'
                     'statement), but can also be used by directly invoking '
                     'their methods.\n'
                     '\n'
                     'Typical uses of context managers include saving and '
                     'restoring various\n'
                     'kinds of global state, locking and unlocking resources, '
                     'closing opened\n'
                     'files, etc.\n'
                     '\n'
                     'For more information on context managers, see Context '
                     'Manager Types.\n'
                     '\n'
                     'object.__enter__(self)\n'
                     '\n'
                     '   Enter the runtime context related to this object. The '
                     '"with"\n'
                     '   statement will bind this method’s return value to the '
                     'target(s)\n'
                     '   specified in the "as" clause of the statement, if '
                     'any.\n'
                     '\n'
                     'object.__exit__(self, exc_type, exc_value, traceback)\n'
                     '\n'
                     '   Exit the runtime context related to this object. The '
                     'parameters\n'
                     '   describe the exception that caused the context to be '
                     'exited. If the\n'
                     '   context was exited without an exception, all three '
                     'arguments will\n'
                     '   be "None".\n'
                     '\n'
                     '   If an exception is supplied, and the method wishes to '
                     'suppress the\n'
                     '   exception (i.e., prevent it from being propagated), '
                     'it should\n'
                     '   return a true value. Otherwise, the exception will be '
                     'processed\n'
                     '   normally upon exit from this method.\n'
                     '\n'
                     '   Note that "__exit__()" methods should not reraise the '
                     'passed-in\n'
                     '   exception; this is the caller’s responsibility.\n'
                     '\n'
                     'See also:\n'
                     '\n'
                     '  **PEP 343** - The “with” statement\n'
                     '     The specification, background, and examples for the '
                     'Python "with"\n'
                     '     statement.\n',
 'continue': 'The "continue" statement\n'
             '************************\n'
             '\n'
             '   continue_stmt ::= "continue"\n'
             '\n'
             '"continue" may only occur syntactically nested in a "for" or '
             '"while"\n'
             'loop, but not nested in a function or class definition within '
             'that\n'
             'loop.  It continues with the next cycle of the nearest enclosing '
             'loop.\n'
             '\n'
             'When "continue" passes control out of a "try" statement with a\n'
             '"finally" clause, that "finally" clause is executed before '
             'really\n'
             'starting the next loop cycle.\n',
 'conversions': 'Arithmetic conversions\n'
                '**********************\n'
                '\n'
                'When a description of an arithmetic operator below uses the '
                'phrase\n'
                '“the numeric arguments are converted to a common type”, this '
                'means\n'
                'that the operator implementation for built-in types works as '
                'follows:\n'
                '\n'
                '* If either argument is a complex number, the other is '
                'converted to\n'
                '  complex;\n'
                '\n'
                '* otherwise, if either argument is a floating point number, '
                'the other\n'
                '  is converted to floating point;\n'
                '\n'
                '* otherwise, both must be integers and no conversion is '
                'necessary.\n'
                '\n'
                'Some additional rules apply for certain operators (e.g., a '
                'string as a\n'
                'left argument to the ‘%’ operator).  Extensions must define '
                'their own\n'
                'conversion behavior.\n',
 'customization': 'Basic customization\n'
                  '*******************\n'
                  '\n'
                  'object.__new__(cls[, ...])\n'
                  '\n'
                  '   Called to create a new instance of class *cls*.  '
                  '"__new__()" is a\n'
                  '   static method (special-cased so you need not declare it '
                  'as such)\n'
                  '   that takes the class of which an instance was requested '
                  'as its\n'
                  '   first argument.  The remaining arguments are those '
                  'passed to the\n'
                  '   object constructor expression (the call to the class).  '
                  'The return\n'
                  '   value of "__new__()" should be the new object instance '
                  '(usually an\n'
                  '   instance of *cls*).\n'
                  '\n'
                  '   Typical implementations create a new instance of the '
                  'class by\n'
                  '   invoking the superclass’s "__new__()" method using\n'
                  '   "super().__new__(cls[, ...])" with appropriate arguments '
                  'and then\n'
                  '   modifying the newly-created instance as necessary before '
                  'returning\n'
                  '   it.\n'
                  '\n'
                  '   If "__new__()" is invoked during object construction and '
                  'it returns\n'
                  '   an instance of *cls*, then the new instance’s '
                  '"__init__()" method\n'
                  '   will be invoked like "__init__(self[, ...])", where '
                  '*self* is the\n'
                  '   new instance and the remaining arguments are the same as '
                  'were\n'
                  '   passed to the object constructor.\n'
                  '\n'
                  '   If "__new__()" does not return an instance of *cls*, '
                  'then the new\n'
                  '   instance’s "__init__()" method will not be invoked.\n'
                  '\n'
                  '   "__new__()" is intended mainly to allow subclasses of '
                  'immutable\n'
                  '   types (like int, str, or tuple) to customize instance '
                  'creation.  It\n'
                  '   is also commonly overridden in custom metaclasses in '
                  'order to\n'
                  '   customize class creation.\n'
                  '\n'
                  'object.__init__(self[, ...])\n'
                  '\n'
                  '   Called after the instance has been created (by '
                  '"__new__()"), but\n'
                  '   before it is returned to the caller.  The arguments are '
                  'those\n'
                  '   passed to the class constructor expression.  If a base '
                  'class has an\n'
                  '   "__init__()" method, the derived class’s "__init__()" '
                  'method, if\n'
                  '   any, must explicitly call it to ensure proper '
                  'initialization of the\n'
                  '   base class part of the instance; for example:\n'
                  '   "super().__init__([args...])".\n'
                  '\n'
                  '   Because "__new__()" and "__init__()" work together in '
                  'constructing\n'
                  '   objects ("__new__()" to create it, and "__init__()" to '
                  'customize\n'
                  '   it), no non-"None" value may be returned by '
                  '"__init__()"; doing so\n'
                  '   will cause a "TypeError" to be raised at runtime.\n'
                  '\n'
                  'object.__del__(self)\n'
                  '\n'
                  '   Called when the instance is about to be destroyed.  This '
                  'is also\n'
                  '   called a finalizer or (improperly) a destructor.  If a '
                  'base class\n'
                  '   has a "__del__()" method, the derived class’s '
                  '"__del__()" method,\n'
                  '   if any, must explicitly call it to ensure proper '
                  'deletion of the\n'
                  '   base class part of the instance.\n'
                  '\n'
                  '   It is possible (though not recommended!) for the '
                  '"__del__()" method\n'
                  '   to postpone destruction of the instance by creating a '
                  'new reference\n'
                  '   to it.  This is called object *resurrection*.  It is\n'
                  '   implementation-dependent whether "__del__()" is called a '
                  'second\n'
                  '   time when a resurrected object is about to be destroyed; '
                  'the\n'
                  '   current *CPython* implementation only calls it once.\n'
                  '\n'
                  '   It is not guaranteed that "__del__()" methods are called '
                  'for\n'
                  '   objects that still exist when the interpreter exits.\n'
                  '\n'
                  '   Note:\n'
                  '\n'
                  '     "del x" doesn’t directly call "x.__del__()" — the '
                  'former\n'
                  '     decrements the reference count for "x" by one, and the '
                  'latter is\n'
                  '     only called when "x"’s reference count reaches zero.\n'
                  '\n'
                  '   **CPython implementation detail:** It is possible for a '
                  'reference\n'
                  '   cycle to prevent the reference count of an object from '
                  'going to\n'
                  '   zero.  In this case, the cycle will be later detected '
                  'and deleted\n'
                  '   by the *cyclic garbage collector*.  A common cause of '
                  'reference\n'
                  '   cycles is when an exception has been caught in a local '
                  'variable.\n'
                  '   The frame’s locals then reference the exception, which '
                  'references\n'
                  '   its own traceback, which references the locals of all '
                  'frames caught\n'
                  '   in the traceback.\n'
                  '\n'
                  '   See also: Documentation for the "gc" module.\n'
                  '\n'
                  '   Warning:\n'
                  '\n'
                  '     Due to the precarious circumstances under which '
                  '"__del__()"\n'
                  '     methods are invoked, exceptions that occur during '
                  'their execution\n'
                  '     are ignored, and a warning is printed to "sys.stderr" '
                  'instead.\n'
                  '     In particular:\n'
                  '\n'
                  '     * "__del__()" can be invoked when arbitrary code is '
                  'being\n'
                  '       executed, including from any arbitrary thread.  If '
                  '"__del__()"\n'
                  '       needs to take a lock or invoke any other blocking '
                  'resource, it\n'
                  '       may deadlock as the resource may already be taken by '
                  'the code\n'
                  '       that gets interrupted to execute "__del__()".\n'
                  '\n'
                  '     * "__del__()" can be executed during interpreter '
                  'shutdown.  As a\n'
                  '       consequence, the global variables it needs to access '
                  '(including\n'
                  '       other modules) may already have been deleted or set '
                  'to "None".\n'
                  '       Python guarantees that globals whose name begins '
                  'with a single\n'
                  '       underscore are deleted from their module before '
                  'other globals\n'
                  '       are deleted; if no other references to such globals '
                  'exist, this\n'
                  '       may help in assuring that imported modules are still '
                  'available\n'
                  '       at the time when the "__del__()" method is called.\n'
                  '\n'
                  'object.__repr__(self)\n'
                  '\n'
                  '   Called by the "repr()" built-in function to compute the '
                  '“official”\n'
                  '   string representation of an object.  If at all possible, '
                  'this\n'
                  '   should look like a valid Python expression that could be '
                  'used to\n'
                  '   recreate an object with the same value (given an '
                  'appropriate\n'
                  '   environment).  If this is not possible, a string of the '
                  'form\n'
                  '   "<...some useful description...>" should be returned. '
                  'The return\n'
                  '   value must be a string object. If a class defines '
                  '"__repr__()" but\n'
                  '   not "__str__()", then "__repr__()" is also used when an '
                  '“informal”\n'
                  '   string representation of instances of that class is '
                  'required.\n'
                  '\n'
                  '   This is typically used for debugging, so it is important '
                  'that the\n'
                  '   representation is information-rich and unambiguous.\n'
                  '\n'
                  'object.__str__(self)\n'
                  '\n'
                  '   Called by "str(object)" and the built-in functions '
                  '"format()" and\n'
                  '   "print()" to compute the “informal” or nicely printable '
                  'string\n'
                  '   representation of an object.  The return value must be a '
                  'string\n'
                  '   object.\n'
                  '\n'
                  '   This method differs from "object.__repr__()" in that '
                  'there is no\n'
                  '   expectation that "__str__()" return a valid Python '
                  'expression: a\n'
                  '   more convenient or concise representation can be used.\n'
                  '\n'
                  '   The default implementation defined by the built-in type '
                  '"object"\n'
                  '   calls "object.__repr__()".\n'
                  '\n'
                  'object.__bytes__(self)\n'
                  '\n'
                  '   Called by bytes to compute a byte-string representation '
                  'of an\n'
                  '   object. This should return a "bytes" object.\n'
                  '\n'
                  'object.__format__(self, format_spec)\n'
                  '\n'
                  '   Called by the "format()" built-in function, and by '
                  'extension,\n'
                  '   evaluation of formatted string literals and the '
                  '"str.format()"\n'
                  '   method, to produce a “formatted” string representation '
                  'of an\n'
                  '   object. The *format_spec* argument is a string that '
                  'contains a\n'
                  '   description of the formatting options desired. The '
                  'interpretation\n'
                  '   of the *format_spec* argument is up to the type '
                  'implementing\n'
                  '   "__format__()", however most classes will either '
                  'delegate\n'
                  '   formatting to one of the built-in types, or use a '
                  'similar\n'
                  '   formatting option syntax.\n'
                  '\n'
                  '   See Format Specification Mini-Language for a description '
                  'of the\n'
                  '   standard formatting syntax.\n'
                  '\n'
                  '   The return value must be a string object.\n'
                  '\n'
                  '   Changed in version 3.4: The __format__ method of '
                  '"object" itself\n'
                  '   raises a "TypeError" if passed any non-empty string.\n'
                  '\n'
                  '   Changed in version 3.7: "object.__format__(x, \'\')" is '
                  'now\n'
                  '   equivalent to "str(x)" rather than "format(str(self), '
                  '\'\')".\n'
                  '\n'
                  'object.__lt__(self, other)\n'
                  'object.__le__(self, other)\n'
                  'object.__eq__(self, other)\n'
                  'object.__ne__(self, other)\n'
                  'object.__gt__(self, other)\n'
                  'object.__ge__(self, other)\n'
                  '\n'
                  '   These are the so-called “rich comparison” methods. The\n'
                  '   correspondence between operator symbols and method names '
                  'is as\n'
                  '   follows: "x<y" calls "x.__lt__(y)", "x<=y" calls '
                  '"x.__le__(y)",\n'
                  '   "x==y" calls "x.__eq__(y)", "x!=y" calls "x.__ne__(y)", '
                  '"x>y" calls\n'
                  '   "x.__gt__(y)", and "x>=y" calls "x.__ge__(y)".\n'
                  '\n'
                  '   A rich comparison method may return the singleton '
                  '"NotImplemented"\n'
                  '   if it does not implement the operation for a given pair '
                  'of\n'
                  '   arguments. By convention, "False" and "True" are '
                  'returned for a\n'
                  '   successful comparison. However, these methods can return '
                  'any value,\n'
                  '   so if the comparison operator is used in a Boolean '
                  'context (e.g.,\n'
                  '   in the condition of an "if" statement), Python will call '
                  '"bool()"\n'
                  '   on the value to determine if the result is true or '
                  'false.\n'
                  '\n'
                  '   By default, "object" implements "__eq__()" by using '
                  '"is", returning\n'
                  '   "NotImplemented" in the case of a false comparison: '
                  '"True if x is y\n'
                  '   else NotImplemented". For "__ne__()", by default it '
                  'delegates to\n'
                  '   "__eq__()" and inverts the result unless it is '
                  '"NotImplemented".\n'
                  '   There are no other implied relationships among the '
                  'comparison\n'
                  '   operators or default implementations; for example, the '
                  'truth of\n'
                  '   "(x<y or x==y)" does not imply "x<=y". To automatically '
                  'generate\n'
                  '   ordering operations from a single root operation, see\n'
                  '   "functools.total_ordering()".\n'
                  '\n'
                  '   See the paragraph on "__hash__()" for some important '
                  'notes on\n'
                  '   creating *hashable* objects which support custom '
                  'comparison\n'
                  '   operations and are usable as dictionary keys.\n'
                  '\n'
                  '   There are no swapped-argument versions of these methods '
                  '(to be used\n'
                  '   when the left argument does not support the operation '
                  'but the right\n'
                  '   argument does); rather, "__lt__()" and "__gt__()" are '
                  'each other’s\n'
                  '   reflection, "__le__()" and "__ge__()" are each other’s '
                  'reflection,\n'
                  '   and "__eq__()" and "__ne__()" are their own reflection. '
                  'If the\n'
                  '   operands are of different types, and right operand’s '
                  'type is a\n'
                  '   direct or indirect subclass of the left operand’s type, '
                  'the\n'
                  '   reflected method of the right operand has priority, '
                  'otherwise the\n'
                  '   left operand’s method has priority.  Virtual subclassing '
                  'is not\n'
                  '   considered.\n'
                  '\n'
                  'object.__hash__(self)\n'
                  '\n'
                  '   Called by built-in function "hash()" and for operations '
                  'on members\n'
                  '   of hashed collections including "set", "frozenset", and '
                  '"dict".\n'
                  '   "__hash__()" should return an integer. The only required '
                  'property\n'
                  '   is that objects which compare equal have the same hash '
                  'value; it is\n'
                  '   advised to mix together the hash values of the '
                  'components of the\n'
                  '   object that also play a part in comparison of objects by '
                  'packing\n'
                  '   them into a tuple and hashing the tuple. Example:\n'
                  '\n'
                  '      def __hash__(self):\n'
                  '          return hash((self.name, self.nick, self.color))\n'
                  '\n'
                  '   Note:\n'
                  '\n'
                  '     "hash()" truncates the value returned from an object’s '
                  'custom\n'
                  '     "__hash__()" method to the size of a "Py_ssize_t".  '
                  'This is\n'
                  '     typically 8 bytes on 64-bit builds and 4 bytes on '
                  '32-bit builds.\n'
                  '     If an object’s   "__hash__()" must interoperate on '
                  'builds of\n'
                  '     different bit sizes, be sure to check the width on all '
                  'supported\n'
                  '     builds.  An easy way to do this is with "python -c '
                  '"import sys;\n'
                  '     print(sys.hash_info.width)"".\n'
                  '\n'
                  '   If a class does not define an "__eq__()" method it '
                  'should not\n'
                  '   define a "__hash__()" operation either; if it defines '
                  '"__eq__()"\n'
                  '   but not "__hash__()", its instances will not be usable '
                  'as items in\n'
                  '   hashable collections.  If a class defines mutable '
                  'objects and\n'
                  '   implements an "__eq__()" method, it should not '
                  'implement\n'
                  '   "__hash__()", since the implementation of hashable '
                  'collections\n'
                  '   requires that a key’s hash value is immutable (if the '
                  'object’s hash\n'
                  '   value changes, it will be in the wrong hash bucket).\n'
                  '\n'
                  '   User-defined classes have "__eq__()" and "__hash__()" '
                  'methods by\n'
                  '   default; with them, all objects compare unequal (except '
                  'with\n'
                  '   themselves) and "x.__hash__()" returns an appropriate '
                  'value such\n'
                  '   that "x == y" implies both that "x is y" and "hash(x) == '
                  'hash(y)".\n'
                  '\n'
                  '   A class that overrides "__eq__()" and does not define '
                  '"__hash__()"\n'
                  '   will have its "__hash__()" implicitly set to "None".  '
                  'When the\n'
                  '   "__hash__()" method of a class is "None", instances of '
                  'the class\n'
                  '   will raise an appropriate "TypeError" when a program '
                  'attempts to\n'
                  '   retrieve their hash value, and will also be correctly '
                  'identified as\n'
                  '   unhashable when checking "isinstance(obj,\n'
                  '   collections.abc.Hashable)".\n'
                  '\n'
                  '   If a class that overrides "__eq__()" needs to retain '
                  'the\n'
                  '   implementation of "__hash__()" from a parent class, the '
                  'interpreter\n'
                  '   must be told this explicitly by setting "__hash__ =\n'
                  '   <ParentClass>.__hash__".\n'
                  '\n'
                  '   If a class that does not override "__eq__()" wishes to '
                  'suppress\n'
                  '   hash support, it should include "__hash__ = None" in the '
                  'class\n'
                  '   definition. A class which defines its own "__hash__()" '
                  'that\n'
                  '   explicitly raises a "TypeError" would be incorrectly '
                  'identified as\n'
                  '   hashable by an "isinstance(obj, '
                  'collections.abc.Hashable)" call.\n'
                  '\n'
                  '   Note:\n'
                  '\n'
                  '     By default, the "__hash__()" values of str and bytes '
                  'objects are\n'
                  '     “salted” with an unpredictable random value.  Although '
                  'they\n'
                  '     remain constant within an individual Python process, '
                  'they are not\n'
                  '     predictable between repeated invocations of '
                  'Python.This is\n'
                  '     intended to provide protection against a '
                  'denial-of-service caused\n'
                  '     by carefully-chosen inputs that exploit the worst '
                  'case\n'
                  '     performance of a dict insertion, O(n^2) complexity.  '
                  'See\n'
                  '     http://www.ocert.org/advisories/ocert-2011-003.html '
                  'for\n'
                  '     details.Changing hash values affects the iteration '
                  'order of sets.\n'
                  '     Python has never made guarantees about this ordering '
                  '(and it\n'
                  '     typically varies between 32-bit and 64-bit builds).See '
                  'also\n'
                  '     "PYTHONHASHSEED".\n'
                  '\n'
                  '   Changed in version 3.3: Hash randomization is enabled by '
                  'default.\n'
                  '\n'
                  'object.__bool__(self)\n'
                  '\n'
                  '   Called to implement truth value testing and the built-in '
                  'operation\n'
                  '   "bool()"; should return "False" or "True".  When this '
                  'method is not\n'
                  '   defined, "__len__()" is called, if it is defined, and '
                  'the object is\n'
                  '   considered true if its result is nonzero.  If a class '
                  'defines\n'
                  '   neither "__len__()" nor "__bool__()", all its instances '
                  'are\n'
                  '   considered true.\n',
 'debugger': '"pdb" — The Python Debugger\n'
             '***************************\n'
             '\n'
             '**Source code:** Lib/pdb.py\n'
             '\n'
             '======================================================================\n'
             '\n'
             'The module "pdb" defines an interactive source code debugger '
             'for\n'
             'Python programs.  It supports setting (conditional) breakpoints '
             'and\n'
             'single stepping at the source line level, inspection of stack '
             'frames,\n'
             'source code listing, and evaluation of arbitrary Python code in '
             'the\n'
             'context of any stack frame.  It also supports post-mortem '
             'debugging\n'
             'and can be called under program control.\n'
             '\n'
             'The debugger is extensible – it is actually defined as the '
             'class\n'
             '"Pdb". This is currently undocumented but easily understood by '
             'reading\n'
             'the source.  The extension interface uses the modules "bdb" and '
             '"cmd".\n'
             '\n'
             'The debugger’s prompt is "(Pdb)". Typical usage to run a program '
             'under\n'
             'control of the debugger is:\n'
             '\n'
             '   >>> import pdb\n'
             '   >>> import mymodule\n'
             "   >>> pdb.run('mymodule.test()')\n"
             '   > <string>(0)?()\n'
             '   (Pdb) continue\n'
             '   > <string>(1)?()\n'
             '   (Pdb) continue\n'
             "   NameError: 'spam'\n"
             '   > <string>(1)?()\n'
             '   (Pdb)\n'
             '\n'
             'Changed in version 3.3: Tab-completion via the "readline" module '
             'is\n'
             'available for commands and command arguments, e.g. the current '
             'global\n'
             'and local names are offered as arguments of the "p" command.\n'
             '\n'
             '"pdb.py" can also be invoked as a script to debug other '
             'scripts.  For\n'
             'example:\n'
             '\n'
             '   python3 -m pdb myscript.py\n'
             '\n'
             'When invoked as a script, pdb will automatically enter '
             'post-mortem\n'
             'debugging if the program being debugged exits abnormally.  After '
             'post-\n'
             'mortem debugging (or after normal exit of the program), pdb '
             'will\n'
             'restart the program.  Automatic restarting preserves pdb’s state '
             '(such\n'
             'as breakpoints) and in most cases is more useful than quitting '
             'the\n'
             'debugger upon program’s exit.\n'
             '\n'
             'New in version 3.2: "pdb.py" now accepts a "-c" option that '
             'executes\n'
             'commands as if given in a ".pdbrc" file, see Debugger Commands.\n'
             '\n'
             'New in version 3.7: "pdb.py" now accepts a "-m" option that '
             'execute\n'
             'modules similar to the way "python3 -m" does. As with a script, '
             'the\n'
             'debugger will pause execution just before the first line of the\n'
             'module.\n'
             '\n'
             'The typical usage to break into the debugger from a running '
             'program is\n'
             'to insert\n'
             '\n'
             '   import pdb; pdb.set_trace()\n'
             '\n'
             'at the location you want to break into the debugger.  You can '
             'then\n'
             'step through the code following this statement, and continue '
             'running\n'
             'without the debugger using the "continue" command.\n'
             '\n'
             'New in version 3.7: The built-in "breakpoint()", when called '
             'with\n'
             'defaults, can be used instead of "import pdb; pdb.set_trace()".\n'
             '\n'
             'The typical usage to inspect a crashed program is:\n'
             '\n'
             '   >>> import pdb\n'
             '   >>> import mymodule\n'
             '   >>> mymodule.test()\n'
             '   Traceback (most recent call last):\n'
             '     File "<stdin>", line 1, in <module>\n'
             '     File "./mymodule.py", line 4, in test\n'
             '       test2()\n'
             '     File "./mymodule.py", line 3, in test2\n'
             '       print(spam)\n'
             '   NameError: spam\n'
             '   >>> pdb.pm()\n'
             '   > ./mymodule.py(3)test2()\n'
             '   -> print(spam)\n'
             '   (Pdb)\n'
             '\n'
             'The module defines the following functions; each enters the '
             'debugger\n'
             'in a slightly different way:\n'
             '\n'
             'pdb.run(statement, globals=None, locals=None)\n'
             '\n'
             '   Execute the *statement* (given as a string or a code object) '
             'under\n'
             '   debugger control.  The debugger prompt appears before any '
             'code is\n'
             '   executed; you can set breakpoints and type "continue", or you '
             'can\n'
             '   step through the statement using "step" or "next" (all these\n'
             '   commands are explained below).  The optional *globals* and '
             '*locals*\n'
             '   arguments specify the environment in which the code is '
             'executed; by\n'
             '   default the dictionary of the module "__main__" is used.  '
             '(See the\n'
             '   explanation of the built-in "exec()" or "eval()" functions.)\n'
             '\n'
             'pdb.runeval(expression, globals=None, locals=None)\n'
             '\n'
             '   Evaluate the *expression* (given as a string or a code '
             'object)\n'
             '   under debugger control.  When "runeval()" returns, it returns '
             'the\n'
             '   value of the expression.  Otherwise this function is similar '
             'to\n'
             '   "run()".\n'
             '\n'
             'pdb.runcall(function, *args, **kwds)\n'
             '\n'
             '   Call the *function* (a function or method object, not a '
             'string)\n'
             '   with the given arguments.  When "runcall()" returns, it '
             'returns\n'
             '   whatever the function call returned.  The debugger prompt '
             'appears\n'
             '   as soon as the function is entered.\n'
             '\n'
             'pdb.set_trace(*, header=None)\n'
             '\n'
             '   Enter the debugger at the calling stack frame.  This is '
             'useful to\n'
             '   hard-code a breakpoint at a given point in a program, even if '
             'the\n'
             '   code is not otherwise being debugged (e.g. when an assertion\n'
             '   fails).  If given, *header* is printed to the console just '
             'before\n'
             '   debugging begins.\n'
             '\n'
             '   Changed in version 3.7: The keyword-only argument *header*.\n'
             '\n'
             'pdb.post_mortem(traceback=None)\n'
             '\n'
             '   Enter post-mortem debugging of the given *traceback* object.  '
             'If no\n'
             '   *traceback* is given, it uses the one of the exception that '
             'is\n'
             '   currently being handled (an exception must be being handled '
             'if the\n'
             '   default is to be used).\n'
             '\n'
             'pdb.pm()\n'
             '\n'
             '   Enter post-mortem debugging of the traceback found in\n'
             '   "sys.last_traceback".\n'
             '\n'
             'The "run*" functions and "set_trace()" are aliases for '
             'instantiating\n'
             'the "Pdb" class and calling the method of the same name.  If you '
             'want\n'
             'to access further features, you have to do this yourself:\n'
             '\n'
             "class pdb.Pdb(completekey='tab', stdin=None, stdout=None, "
             'skip=None, nosigint=False, readrc=True)\n'
             '\n'
             '   "Pdb" is the debugger class.\n'
             '\n'
             '   The *completekey*, *stdin* and *stdout* arguments are passed '
             'to the\n'
             '   underlying "cmd.Cmd" class; see the description there.\n'
             '\n'
             '   The *skip* argument, if given, must be an iterable of '
             'glob-style\n'
             '   module name patterns.  The debugger will not step into frames '
             'that\n'
             '   originate in a module that matches one of these patterns. '
             '[1]\n'
             '\n'
             '   By default, Pdb sets a handler for the SIGINT signal (which '
             'is sent\n'
             '   when the user presses "Ctrl-C" on the console) when you give '
             'a\n'
             '   "continue" command. This allows you to break into the '
             'debugger\n'
             '   again by pressing "Ctrl-C".  If you want Pdb not to touch '
             'the\n'
             '   SIGINT handler, set *nosigint* to true.\n'
             '\n'
             '   The *readrc* argument defaults to true and controls whether '
             'Pdb\n'
             '   will load .pdbrc files from the filesystem.\n'
             '\n'
             '   Example call to enable tracing with *skip*:\n'
             '\n'
             "      import pdb; pdb.Pdb(skip=['django.*']).set_trace()\n"
             '\n'
             '   Raises an auditing event "pdb.Pdb" with no arguments.\n'
             '\n'
             '   New in version 3.1: The *skip* argument.\n'
             '\n'
             '   New in version 3.2: The *nosigint* argument.  Previously, a '
             'SIGINT\n'
             '   handler was never set by Pdb.\n'
             '\n'
             '   Changed in version 3.6: The *readrc* argument.\n'
             '\n'
             '   run(statement, globals=None, locals=None)\n'
             '   runeval(expression, globals=None, locals=None)\n'
             '   runcall(function, *args, **kwds)\n'
             '   set_trace()\n'
             '\n'
             '      See the documentation for the functions explained above.\n'
             '\n'
             '\n'
             'Debugger Commands\n'
             '=================\n'
             '\n'
             'The commands recognized by the debugger are listed below.  Most\n'
             'commands can be abbreviated to one or two letters as indicated; '
             'e.g.\n'
             '"h(elp)" means that either "h" or "help" can be used to enter '
             'the help\n'
             'command (but not "he" or "hel", nor "H" or "Help" or "HELP").\n'
             'Arguments to commands must be separated by whitespace (spaces '
             'or\n'
             'tabs).  Optional arguments are enclosed in square brackets '
             '("[]") in\n'
             'the command syntax; the square brackets must not be typed.\n'
             'Alternatives in the command syntax are separated by a vertical '
             'bar\n'
             '("|").\n'
             '\n'
             'Entering a blank line repeats the last command entered.  '
             'Exception: if\n'
             'the last command was a "list" command, the next 11 lines are '
             'listed.\n'
             '\n'
             'Commands that the debugger doesn’t recognize are assumed to be '
             'Python\n'
             'statements and are executed in the context of the program being\n'
             'debugged.  Python statements can also be prefixed with an '
             'exclamation\n'
             'point ("!").  This is a powerful way to inspect the program '
             'being\n'
             'debugged; it is even possible to change a variable or call a '
             'function.\n'
             'When an exception occurs in such a statement, the exception name '
             'is\n'
             'printed but the debugger’s state is not changed.\n'
             '\n'
             'The debugger supports aliases.  Aliases can have parameters '
             'which\n'
             'allows one a certain level of adaptability to the context under\n'
             'examination.\n'
             '\n'
             'Multiple commands may be entered on a single line, separated by '
             '";;".\n'
             '(A single ";" is not used as it is the separator for multiple '
             'commands\n'
             'in a line that is passed to the Python parser.)  No intelligence '
             'is\n'
             'applied to separating the commands; the input is split at the '
             'first\n'
             '";;" pair, even if it is in the middle of a quoted string.\n'
             '\n'
             'If a file ".pdbrc" exists in the user’s home directory or in '
             'the\n'
             'current directory, it is read in and executed as if it had been '
             'typed\n'
             'at the debugger prompt.  This is particularly useful for '
             'aliases.  If\n'
             'both files exist, the one in the home directory is read first '
             'and\n'
             'aliases defined there can be overridden by the local file.\n'
             '\n'
             'Changed in version 3.2: ".pdbrc" can now contain commands that\n'
             'continue debugging, such as "continue" or "next".  Previously, '
             'these\n'
             'commands had no effect.\n'
             '\n'
             'h(elp) [command]\n'
             '\n'
             '   Without argument, print the list of available commands.  With '
             'a\n'
             '   *command* as argument, print help about that command.  "help '
             'pdb"\n'
             '   displays the full documentation (the docstring of the "pdb"\n'
             '   module).  Since the *command* argument must be an identifier, '
             '"help\n'
             '   exec" must be entered to get help on the "!" command.\n'
             '\n'
             'w(here)\n'
             '\n'
             '   Print a stack trace, with the most recent frame at the '
             'bottom.  An\n'
             '   arrow indicates the current frame, which determines the '
             'context of\n'
             '   most commands.\n'
             '\n'
             'd(own) [count]\n'
             '\n'
             '   Move the current frame *count* (default one) levels down in '
             'the\n'
             '   stack trace (to a newer frame).\n'
             '\n'
             'u(p) [count]\n'
             '\n'
             '   Move the current frame *count* (default one) levels up in the '
             'stack\n'
             '   trace (to an older frame).\n'
             '\n'
             'b(reak) [([filename:]lineno | function) [, condition]]\n'
             '\n'
             '   With a *lineno* argument, set a break there in the current '
             'file.\n'
             '   With a *function* argument, set a break at the first '
             'executable\n'
             '   statement within that function.  The line number may be '
             'prefixed\n'
             '   with a filename and a colon, to specify a breakpoint in '
             'another\n'
             '   file (probably one that hasn’t been loaded yet).  The file '
             'is\n'
             '   searched on "sys.path".  Note that each breakpoint is '
             'assigned a\n'
             '   number to which all the other breakpoint commands refer.\n'
             '\n'
             '   If a second argument is present, it is an expression which '
             'must\n'
             '   evaluate to true before the breakpoint is honored.\n'
             '\n'
             '   Without argument, list all breaks, including for each '
             'breakpoint,\n'
             '   the number of times that breakpoint has been hit, the '
             'current\n'
             '   ignore count, and the associated condition if any.\n'
             '\n'
             'tbreak [([filename:]lineno | function) [, condition]]\n'
             '\n'
             '   Temporary breakpoint, which is removed automatically when it '
             'is\n'
             '   first hit. The arguments are the same as for "break".\n'
             '\n'
             'cl(ear) [filename:lineno | bpnumber [bpnumber ...]]\n'
             '\n'
             '   With a *filename:lineno* argument, clear all the breakpoints '
             'at\n'
             '   this line. With a space separated list of breakpoint numbers, '
             'clear\n'
             '   those breakpoints. Without argument, clear all breaks (but '
             'first\n'
             '   ask confirmation).\n'
             '\n'
             'disable [bpnumber [bpnumber ...]]\n'
             '\n'
             '   Disable the breakpoints given as a space separated list of\n'
             '   breakpoint numbers.  Disabling a breakpoint means it cannot '
             'cause\n'
             '   the program to stop execution, but unlike clearing a '
             'breakpoint, it\n'
             '   remains in the list of breakpoints and can be (re-)enabled.\n'
             '\n'
             'enable [bpnumber [bpnumber ...]]\n'
             '\n'
             '   Enable the breakpoints specified.\n'
             '\n'
             'ignore bpnumber [count]\n'
             '\n'
             '   Set the ignore count for the given breakpoint number.  If '
             'count is\n'
             '   omitted, the ignore count is set to 0.  A breakpoint becomes '
             'active\n'
             '   when the ignore count is zero.  When non-zero, the count is\n'
             '   decremented each time the breakpoint is reached and the '
             'breakpoint\n'
             '   is not disabled and any associated condition evaluates to '
             'true.\n'
             '\n'
             'condition bpnumber [condition]\n'
             '\n'
             '   Set a new *condition* for the breakpoint, an expression which '
             'must\n'
             '   evaluate to true before the breakpoint is honored.  If '
             '*condition*\n'
             '   is absent, any existing condition is removed; i.e., the '
             'breakpoint\n'
             '   is made unconditional.\n'
             '\n'
             'commands [bpnumber]\n'
             '\n'
             '   Specify a list of commands for breakpoint number *bpnumber*.  '
             'The\n'
             '   commands themselves appear on the following lines.  Type a '
             'line\n'
             '   containing just "end" to terminate the commands. An example:\n'
             '\n'
             '      (Pdb) commands 1\n'
             '      (com) p some_variable\n'
             '      (com) end\n'
             '      (Pdb)\n'
             '\n'
             '   To remove all commands from a breakpoint, type "commands" '
             'and\n'
             '   follow it immediately with "end"; that is, give no commands.\n'
             '\n'
             '   With no *bpnumber* argument, "commands" refers to the last\n'
             '   breakpoint set.\n'
             '\n'
             '   You can use breakpoint commands to start your program up '
             'again.\n'
             '   Simply use the "continue" command, or "step", or any other '
             'command\n'
             '   that resumes execution.\n'
             '\n'
             '   Specifying any command resuming execution (currently '
             '"continue",\n'
             '   "step", "next", "return", "jump", "quit" and their '
             'abbreviations)\n'
             '   terminates the command list (as if that command was '
             'immediately\n'
             '   followed by end). This is because any time you resume '
             'execution\n'
             '   (even with a simple next or step), you may encounter another\n'
             '   breakpoint—which could have its own command list, leading to\n'
             '   ambiguities about which list to execute.\n'
             '\n'
             '   If you use the ‘silent’ command in the command list, the '
             'usual\n'
             '   message about stopping at a breakpoint is not printed.  This '
             'may be\n'
             '   desirable for breakpoints that are to print a specific '
             'message and\n'
             '   then continue.  If none of the other commands print anything, '
             'you\n'
             '   see no sign that the breakpoint was reached.\n'
             '\n'
             's(tep)\n'
             '\n'
             '   Execute the current line, stop at the first possible '
             'occasion\n'
             '   (either in a function that is called or on the next line in '
             'the\n'
             '   current function).\n'
             '\n'
             'n(ext)\n'
             '\n'
             '   Continue execution until the next line in the current '
             'function is\n'
             '   reached or it returns.  (The difference between "next" and '
             '"step"\n'
             '   is that "step" stops inside a called function, while "next"\n'
             '   executes called functions at (nearly) full speed, only '
             'stopping at\n'
             '   the next line in the current function.)\n'
             '\n'
             'unt(il) [lineno]\n'
             '\n'
             '   Without argument, continue execution until the line with a '
             'number\n'
             '   greater than the current one is reached.\n'
             '\n'
             '   With a line number, continue execution until a line with a '
             'number\n'
             '   greater or equal to that is reached.  In both cases, also '
             'stop when\n'
             '   the current frame returns.\n'
             '\n'
             '   Changed in version 3.2: Allow giving an explicit line '
             'number.\n'
             '\n'
             'r(eturn)\n'
             '\n'
             '   Continue execution until the current function returns.\n'
             '\n'
             'c(ont(inue))\n'
             '\n'
             '   Continue execution, only stop when a breakpoint is '
             'encountered.\n'
             '\n'
             'j(ump) lineno\n'
             '\n'
             '   Set the next line that will be executed.  Only available in '
             'the\n'
             '   bottom-most frame.  This lets you jump back and execute code '
             'again,\n'
             '   or jump forward to skip code that you don’t want to run.\n'
             '\n'
             '   It should be noted that not all jumps are allowed – for '
             'instance it\n'
             '   is not possible to jump into the middle of a "for" loop or '
             'out of a\n'
             '   "finally" clause.\n'
             '\n'
             'l(ist) [first[, last]]\n'
             '\n'
             '   List source code for the current file.  Without arguments, '
             'list 11\n'
             '   lines around the current line or continue the previous '
             'listing.\n'
             '   With "." as argument, list 11 lines around the current line.  '
             'With\n'
             '   one argument, list 11 lines around at that line.  With two\n'
             '   arguments, list the given range; if the second argument is '
             'less\n'
             '   than the first, it is interpreted as a count.\n'
             '\n'
             '   The current line in the current frame is indicated by "->".  '
             'If an\n'
             '   exception is being debugged, the line where the exception '
             'was\n'
             '   originally raised or propagated is indicated by ">>", if it '
             'differs\n'
             '   from the current line.\n'
             '\n'
             '   New in version 3.2: The ">>" marker.\n'
             '\n'
             'll | longlist\n'
             '\n'
             '   List all source code for the current function or frame.\n'
             '   Interesting lines are marked as for "list".\n'
             '\n'
             '   New in version 3.2.\n'
             '\n'
             'a(rgs)\n'
             '\n'
             '   Print the argument list of the current function.\n'
             '\n'
             'p expression\n'
             '\n'
             '   Evaluate the *expression* in the current context and print '
             'its\n'
             '   value.\n'
             '\n'
             '   Note:\n'
             '\n'
             '     "print()" can also be used, but is not a debugger command — '
             'this\n'
             '     executes the Python "print()" function.\n'
             '\n'
             'pp expression\n'
             '\n'
             '   Like the "p" command, except the value of the expression is '
             'pretty-\n'
             '   printed using the "pprint" module.\n'
             '\n'
             'whatis expression\n'
             '\n'
             '   Print the type of the *expression*.\n'
             '\n'
             'source expression\n'
             '\n'
             '   Try to get source code for the given object and display it.\n'
             '\n'
             '   New in version 3.2.\n'
             '\n'
             'display [expression]\n'
             '\n'
             '   Display the value of the expression if it changed, each time\n'
             '   execution stops in the current frame.\n'
             '\n'
             '   Without expression, list all display expressions for the '
             'current\n'
             '   frame.\n'
             '\n'
             '   New in version 3.2.\n'
             '\n'
             'undisplay [expression]\n'
             '\n'
             '   Do not display the expression any more in the current frame.\n'
             '   Without expression, clear all display expressions for the '
             'current\n'
             '   frame.\n'
             '\n'
             '   New in version 3.2.\n'
             '\n'
             'interact\n'
             '\n'
             '   Start an interactive interpreter (using the "code" module) '
             'whose\n'
             '   global namespace contains all the (global and local) names '
             'found in\n'
             '   the current scope.\n'
             '\n'
             '   New in version 3.2.\n'
             '\n'
             'alias [name [command]]\n'
             '\n'
             '   Create an alias called *name* that executes *command*.  The '
             'command\n'
             '   must *not* be enclosed in quotes.  Replaceable parameters can '
             'be\n'
             '   indicated by "%1", "%2", and so on, while "%*" is replaced by '
             'all\n'
             '   the parameters. If no command is given, the current alias '
             'for\n'
             '   *name* is shown. If no arguments are given, all aliases are '
             'listed.\n'
             '\n'
             '   Aliases may be nested and can contain anything that can be '
             'legally\n'
             '   typed at the pdb prompt.  Note that internal pdb commands '
             '*can* be\n'
             '   overridden by aliases.  Such a command is then hidden until '
             'the\n'
             '   alias is removed.  Aliasing is recursively applied to the '
             'first\n'
             '   word of the command line; all other words in the line are '
             'left\n'
             '   alone.\n'
             '\n'
             '   As an example, here are two useful aliases (especially when '
             'placed\n'
             '   in the ".pdbrc" file):\n'
             '\n'
             '      # Print instance variables (usage "pi classInst")\n'
             '      alias pi for k in %1.__dict__.keys(): '
             'print("%1.",k,"=",%1.__dict__[k])\n'
             '      # Print instance variables in self\n'
             '      alias ps pi self\n'
             '\n'
             'unalias name\n'
             '\n'
             '   Delete the specified alias.\n'
             '\n'
             '! statement\n'
             '\n'
             '   Execute the (one-line) *statement* in the context of the '
             'current\n'
             '   stack frame. The exclamation point can be omitted unless the '
             'first\n'
             '   word of the statement resembles a debugger command.  To set '
             'a\n'
             '   global variable, you can prefix the assignment command with '
             'a\n'
             '   "global" statement on the same line, e.g.:\n'
             '\n'
             "      (Pdb) global list_options; list_options = ['-l']\n"
             '      (Pdb)\n'
             '\n'
             'run [args ...]\n'
             'restart [args ...]\n'
             '\n'
             '   Restart the debugged Python program.  If an argument is '
             'supplied,\n'
             '   it is split with "shlex" and the result is used as the new\n'
             '   "sys.argv". History, breakpoints, actions and debugger '
             'options are\n'
             '   preserved. "restart" is an alias for "run".\n'
             '\n'
             'q(uit)\n'
             '\n'
             '   Quit from the debugger.  The program being executed is '
             'aborted.\n'
             '\n'
             'debug code\n'
             '\n'
             '   Enter a recursive debugger that steps through the code '
             'argument\n'
             '   (which is an arbitrary expression or statement to be executed '
             'in\n'
             '   the current environment).\n'
             '\n'
             'retval\n'
             '\n'
             '   Print the return value for the last return of a function.\n'
             '\n'
             '-[ Footnotes ]-\n'
             '\n'
             '[1] Whether a frame is considered to originate in a certain '
             'module is\n'
             '    determined by the "__name__" in the frame globals.\n',
 'del': 'The "del" statement\n'
        '*******************\n'
        '\n'
        '   del_stmt ::= "del" target_list\n'
        '\n'
        'Deletion is recursively defined very similar to the way assignment '
        'is\n'
        'defined. Rather than spelling it out in full details, here are some\n'
        'hints.\n'
        '\n'
        'Deletion of a target list recursively deletes each target, from left\n'
        'to right.\n'
        '\n'
        'Deletion of a name removes the binding of that name from the local '
        'or\n'
        'global namespace, depending on whether the name occurs in a "global"\n'
        'statement in the same code block.  If the name is unbound, a\n'
        '"NameError" exception will be raised.\n'
        '\n'
        'Deletion of attribute references, subscriptions and slicings is '
        'passed\n'
        'to the primary object involved; deletion of a slicing is in general\n'
        'equivalent to assignment of an empty slice of the right type (but '
        'even\n'
        'this is determined by the sliced object).\n'
        '\n'
        'Changed in version 3.2: Previously it was illegal to delete a name\n'
        'from the local namespace if it occurs as a free variable in a nested\n'
        'block.\n',
 'dict': 'Dictionary displays\n'
         '*******************\n'
         '\n'
         'A dictionary display is a possibly empty series of key/datum pairs\n'
         'enclosed in curly braces:\n'
         '\n'
         '   dict_display       ::= "{" [key_datum_list | dict_comprehension] '
         '"}"\n'
         '   key_datum_list     ::= key_datum ("," key_datum)* [","]\n'
         '   key_datum          ::= expression ":" expression | "**" or_expr\n'
         '   dict_comprehension ::= expression ":" expression comp_for\n'
         '\n'
         'A dictionary display yields a new dictionary object.\n'
         '\n'
         'If a comma-separated sequence of key/datum pairs is given, they are\n'
         'evaluated from left to right to define the entries of the '
         'dictionary:\n'
         'each key object is used as a key into the dictionary to store the\n'
         'corresponding datum.  This means that you can specify the same key\n'
         'multiple times in the key/datum list, and the final dictionary’s '
         'value\n'
         'for that key will be the last one given.\n'
         '\n'
         'A double asterisk "**" denotes *dictionary unpacking*. Its operand\n'
         'must be a *mapping*.  Each mapping item is added to the new\n'
         'dictionary.  Later values replace values already set by earlier\n'
         'key/datum pairs and earlier dictionary unpackings.\n'
         '\n'
         'New in version 3.5: Unpacking into dictionary displays, originally\n'
         'proposed by **PEP 448**.\n'
         '\n'
         'A dict comprehension, in contrast to list and set comprehensions,\n'
         'needs two expressions separated with a colon followed by the usual\n'
         '“for” and “if” clauses. When the comprehension is run, the '
         'resulting\n'
         'key and value elements are inserted in the new dictionary in the '
         'order\n'
         'they are produced.\n'
         '\n'
         'Restrictions on the types of the key values are listed earlier in\n'
         'section The standard type hierarchy.  (To summarize, the key type\n'
         'should be *hashable*, which excludes all mutable objects.)  Clashes\n'
         'between duplicate keys are not detected; the last datum (textually\n'
         'rightmost in the display) stored for a given key value prevails.\n'
         '\n'
         'Changed in version 3.8: Prior to Python 3.8, in dict '
         'comprehensions,\n'
         'the evaluation order of key and value was not well-defined.  In\n'
         'CPython, the value was evaluated before the key.  Starting with '
         '3.8,\n'
         'the key is evaluated before the value, as proposed by **PEP 572**.\n',
 'dynamic-features': 'Interaction with dynamic features\n'
                     '*********************************\n'
                     '\n'
                     'Name resolution of free variables occurs at runtime, not '
                     'at compile\n'
                     'time. This means that the following code will print 42:\n'
                     '\n'
                     '   i = 10\n'
                     '   def f():\n'
                     '       print(i)\n'
                     '   i = 42\n'
                     '   f()\n'
                     '\n'
                     'The "eval()" and "exec()" functions do not have access '
                     'to the full\n'
                     'environment for resolving names.  Names may be resolved '
                     'in the local\n'
                     'and global namespaces of the caller.  Free variables are '
                     'not resolved\n'
                     'in the nearest enclosing namespace, but in the global '
                     'namespace.  [1]\n'
                     'The "exec()" and "eval()" functions have optional '
                     'arguments to\n'
                     'override the global and local namespace.  If only one '
                     'namespace is\n'
                     'specified, it is used for both.\n',
 'else': 'The "if" statement\n'
         '******************\n'
         '\n'
         'The "if" statement is used for conditional execution:\n'
         '\n'
         '   if_stmt ::= "if" assignment_expression ":" suite\n'
         '               ("elif" assignment_expression ":" suite)*\n'
         '               ["else" ":" suite]\n'
         '\n'
         'It selects exactly one of the suites by evaluating the expressions '
         'one\n'
         'by one until one is found to be true (see section Boolean '
         'operations\n'
         'for the definition of true and false); then that suite is executed\n'
         '(and no other part of the "if" statement is executed or evaluated).\n'
         'If all expressions are false, the suite of the "else" clause, if\n'
         'present, is executed.\n',
 'exceptions': 'Exceptions\n'
               '**********\n'
               '\n'
               'Exceptions are a means of breaking out of the normal flow of '
               'control\n'
               'of a code block in order to handle errors or other '
               'exceptional\n'
               'conditions.  An exception is *raised* at the point where the '
               'error is\n'
               'detected; it may be *handled* by the surrounding code block or '
               'by any\n'
               'code block that directly or indirectly invoked the code block '
               'where\n'
               'the error occurred.\n'
               '\n'
               'The Python interpreter raises an exception when it detects a '
               'run-time\n'
               'error (such as division by zero).  A Python program can also\n'
               'explicitly raise an exception with the "raise" statement. '
               'Exception\n'
               'handlers are specified with the "try" … "except" statement.  '
               'The\n'
               '"finally" clause of such a statement can be used to specify '
               'cleanup\n'
               'code which does not handle the exception, but is executed '
               'whether an\n'
               'exception occurred or not in the preceding code.\n'
               '\n'
               'Python uses the “termination” model of error handling: an '
               'exception\n'
               'handler can find out what happened and continue execution at '
               'an outer\n'
               'level, but it cannot repair the cause of the error and retry '
               'the\n'
               'failing operation (except by re-entering the offending piece '
               'of code\n'
               'from the top).\n'
               '\n'
               'When an exception is not handled at all, the interpreter '
               'terminates\n'
               'execution of the program, or returns to its interactive main '
               'loop.  In\n'
               'either case, it prints a stack traceback, except when the '
               'exception is\n'
               '"SystemExit".\n'
               '\n'
               'Exceptions are identified by class instances.  The "except" '
               'clause is\n'
               'selected depending on the class of the instance: it must '
               'reference the\n'
               'class of the instance or a base class thereof.  The instance '
               'can be\n'
               'received by the handler and can carry additional information '
               'about the\n'
               'exceptional condition.\n'
               '\n'
               'Note:\n'
               '\n'
               '  Exception messages are not part of the Python API.  Their '
               'contents\n'
               '  may change from one version of Python to the next without '
               'warning\n'
               '  and should not be relied on by code which will run under '
               'multiple\n'
               '  versions of the interpreter.\n'
               '\n'
               'See also the description of the "try" statement in section The '
               'try\n'
               'statement and "raise" statement in section The raise '
               'statement.\n'
               '\n'
               '-[ Footnotes ]-\n'
               '\n'
               '[1] This limitation occurs because the code that is executed '
               'by these\n'
               '    operations is not available at the time the module is '
               'compiled.\n',
 'execmodel': 'Execution model\n'
              '***************\n'
              '\n'
              '\n'
              'Structure of a program\n'
              '======================\n'
              '\n'
              'A Python program is constructed from code blocks. A *block* is '
              'a piece\n'
              'of Python program text that is executed as a unit. The '
              'following are\n'
              'blocks: a module, a function body, and a class definition. '
              'Each\n'
              'command typed interactively is a block.  A script file (a file '
              'given\n'
              'as standard input to the interpreter or specified as a command '
              'line\n'
              'argument to the interpreter) is a code block.  A script command '
              '(a\n'
              'command specified on the interpreter command line with the '
              '"-c"\n'
              'option) is a code block.  The string argument passed to the '
              'built-in\n'
              'functions "eval()" and "exec()" is a code block.\n'
              '\n'
              'A code block is executed in an *execution frame*.  A frame '
              'contains\n'
              'some administrative information (used for debugging) and '
              'determines\n'
              'where and how execution continues after the code block’s '
              'execution has\n'
              'completed.\n'
              '\n'
              '\n'
              'Naming and binding\n'
              '==================\n'
              '\n'
              '\n'
              'Binding of names\n'
              '----------------\n'
              '\n'
              '*Names* refer to objects.  Names are introduced by name '
              'binding\n'
              'operations.\n'
              '\n'
              'The following constructs bind names: formal parameters to '
              'functions,\n'
              '"import" statements, class and function definitions (these bind '
              'the\n'
              'class or function name in the defining block), and targets that '
              'are\n'
              'identifiers if occurring in an assignment, "for" loop header, '
              'or after\n'
              '"as" in a "with" statement or "except" clause. The "import" '
              'statement\n'
              'of the form "from ... import *" binds all names defined in the\n'
              'imported module, except those beginning with an underscore.  '
              'This form\n'
              'may only be used at the module level.\n'
              '\n'
              'A target occurring in a "del" statement is also considered '
              'bound for\n'
              'this purpose (though the actual semantics are to unbind the '
              'name).\n'
              '\n'
              'Each assignment or import statement occurs within a block '
              'defined by a\n'
              'class or function definition or at the module level (the '
              'top-level\n'
              'code block).\n'
              '\n'
              'If a name is bound in a block, it is a local variable of that '
              'block,\n'
              'unless declared as "nonlocal" or "global".  If a name is bound '
              'at the\n'
              'module level, it is a global variable.  (The variables of the '
              'module\n'
              'code block are local and global.)  If a variable is used in a '
              'code\n'
              'block but not defined there, it is a *free variable*.\n'
              '\n'
              'Each occurrence of a name in the program text refers to the '
              '*binding*\n'
              'of that name established by the following name resolution '
              'rules.\n'
              '\n'
              '\n'
              'Resolution of names\n'
              '-------------------\n'
              '\n'
              'A *scope* defines the visibility of a name within a block.  If '
              'a local\n'
              'variable is defined in a block, its scope includes that block.  '
              'If the\n'
              'definition occurs in a function block, the scope extends to any '
              'blocks\n'
              'contained within the defining one, unless a contained block '
              'introduces\n'
              'a different binding for the name.\n'
              '\n'
              'When a name is used in a code block, it is resolved using the '
              'nearest\n'
              'enclosing scope.  The set of all such scopes visible to a code '
              'block\n'
              'is called the block’s *environment*.\n'
              '\n'
              'When a name is not found at all, a "NameError" exception is '
              'raised. If\n'
              'the current scope is a function scope, and the name refers to a '
              'local\n'
              'variable that has not yet been bound to a value at the point '
              'where the\n'
              'name is used, an "UnboundLocalError" exception is raised.\n'
              '"UnboundLocalError" is a subclass of "NameError".\n'
              '\n'
              'If a name binding operation occurs anywhere within a code '
              'block, all\n'
              'uses of the name within the block are treated as references to '
              'the\n'
              'current block.  This can lead to errors when a name is used '
              'within a\n'
              'block before it is bound.  This rule is subtle.  Python lacks\n'
              'declarations and allows name binding operations to occur '
              'anywhere\n'
              'within a code block.  The local variables of a code block can '
              'be\n'
              'determined by scanning the entire text of the block for name '
              'binding\n'
              'operations.\n'
              '\n'
              'If the "global" statement occurs within a block, all uses of '
              'the name\n'
              'specified in the statement refer to the binding of that name in '
              'the\n'
              'top-level namespace.  Names are resolved in the top-level '
              'namespace by\n'
              'searching the global namespace, i.e. the namespace of the '
              'module\n'
              'containing the code block, and the builtins namespace, the '
              'namespace\n'
              'of the module "builtins".  The global namespace is searched '
              'first.  If\n'
              'the name is not found there, the builtins namespace is '
              'searched.  The\n'
              '"global" statement must precede all uses of the name.\n'
              '\n'
              'The "global" statement has the same scope as a name binding '
              'operation\n'
              'in the same block.  If the nearest enclosing scope for a free '
              'variable\n'
              'contains a global statement, the free variable is treated as a '
              'global.\n'
              '\n'
              'The "nonlocal" statement causes corresponding names to refer '
              'to\n'
              'previously bound variables in the nearest enclosing function '
              'scope.\n'
              '"SyntaxError" is raised at compile time if the given name does '
              'not\n'
              'exist in any enclosing function scope.\n'
              '\n'
              'The namespace for a module is automatically created the first '
              'time a\n'
              'module is imported.  The main module for a script is always '
              'called\n'
              '"__main__".\n'
              '\n'
              'Class definition blocks and arguments to "exec()" and "eval()" '
              'are\n'
              'special in the context of name resolution. A class definition '
              'is an\n'
              'executable statement that may use and define names. These '
              'references\n'
              'follow the normal rules for name resolution with an exception '
              'that\n'
              'unbound local variables are looked up in the global namespace. '
              'The\n'
              'namespace of the class definition becomes the attribute '
              'dictionary of\n'
              'the class. The scope of names defined in a class block is '
              'limited to\n'
              'the class block; it does not extend to the code blocks of '
              'methods –\n'
              'this includes comprehensions and generator expressions since '
              'they are\n'
              'implemented using a function scope.  This means that the '
              'following\n'
              'will fail:\n'
              '\n'
              '   class A:\n'
              '       a = 42\n'
              '       b = list(a + i for i in range(10))\n'
              '\n'
              '\n'
              'Builtins and restricted execution\n'
              '---------------------------------\n'
              '\n'
              '**CPython implementation detail:** Users should not touch\n'
              '"__builtins__"; it is strictly an implementation detail.  '
              'Users\n'
              'wanting to override values in the builtins namespace should '
              '"import"\n'
              'the "builtins" module and modify its attributes appropriately.\n'
              '\n'
              'The builtins namespace associated with the execution of a code '
              'block\n'
              'is actually found by looking up the name "__builtins__" in its '
              'global\n'
              'namespace; this should be a dictionary or a module (in the '
              'latter case\n'
              'the module’s dictionary is used).  By default, when in the '
              '"__main__"\n'
              'module, "__builtins__" is the built-in module "builtins"; when '
              'in any\n'
              'other module, "__builtins__" is an alias for the dictionary of '
              'the\n'
              '"builtins" module itself.\n'
              '\n'
              '\n'
              'Interaction with dynamic features\n'
              '---------------------------------\n'
              '\n'
              'Name resolution of free variables occurs at runtime, not at '
              'compile\n'
              'time. This means that the following code will print 42:\n'
              '\n'
              '   i = 10\n'
              '   def f():\n'
              '       print(i)\n'
              '   i = 42\n'
              '   f()\n'
              '\n'
              'The "eval()" and "exec()" functions do not have access to the '
              'full\n'
              'environment for resolving names.  Names may be resolved in the '
              'local\n'
              'and global namespaces of the caller.  Free variables are not '
              'resolved\n'
              'in the nearest enclosing namespace, but in the global '
              'namespace.  [1]\n'
              'The "exec()" and "eval()" functions have optional arguments to\n'
              'override the global and local namespace.  If only one namespace '
              'is\n'
              'specified, it is used for both.\n'
              '\n'
              '\n'
              'Exceptions\n'
              '==========\n'
              '\n'
              'Exceptions are a means of breaking out of the normal flow of '
              'control\n'
              'of a code block in order to handle errors or other exceptional\n'
              'conditions.  An exception is *raised* at the point where the '
              'error is\n'
              'detected; it may be *handled* by the surrounding code block or '
              'by any\n'
              'code block that directly or indirectly invoked the code block '
              'where\n'
              'the error occurred.\n'
              '\n'
              'The Python interpreter raises an exception when it detects a '
              'run-time\n'
              'error (such as division by zero).  A Python program can also\n'
              'explicitly raise an exception with the "raise" statement. '
              'Exception\n'
              'handlers are specified with the "try" … "except" statement.  '
              'The\n'
              '"finally" clause of such a statement can be used to specify '
              'cleanup\n'
              'code which does not handle the exception, but is executed '
              'whether an\n'
              'exception occurred or not in the preceding code.\n'
              '\n'
              'Python uses the “termination” model of error handling: an '
              'exception\n'
              'handler can find out what happened and continue execution at an '
              'outer\n'
              'level, but it cannot repair the cause of the error and retry '
              'the\n'
              'failing operation (except by re-entering the offending piece of '
              'code\n'
              'from the top).\n'
              '\n'
              'When an exception is not handled at all, the interpreter '
              'terminates\n'
              'execution of the program, or returns to its interactive main '
              'loop.  In\n'
              'either case, it prints a stack traceback, except when the '
              'exception is\n'
              '"SystemExit".\n'
              '\n'
              'Exceptions are identified by class instances.  The "except" '
              'clause is\n'
              'selected depending on the class of the instance: it must '
              'reference the\n'
              'class of the instance or a base class thereof.  The instance '
              'can be\n'
              'received by the handler and can carry additional information '
              'about the\n'
              'exceptional condition.\n'
              '\n'
              'Note:\n'
              '\n'
              '  Exception messages are not part of the Python API.  Their '
              'contents\n'
              '  may change from one version of Python to the next without '
              'warning\n'
              '  and should not be relied on by code which will run under '
              'multiple\n'
              '  versions of the interpreter.\n'
              '\n'
              'See also the description of the "try" statement in section The '
              'try\n'
              'statement and "raise" statement in section The raise '
              'statement.\n'
              '\n'
              '-[ Footnotes ]-\n'
              '\n'
              '[1] This limitation occurs because the code that is executed by '
              'these\n'
              '    operations is not available at the time the module is '
              'compiled.\n',
 'exprlists': 'Expression lists\n'
              '****************\n'
              '\n'
              '   expression_list    ::= expression ("," expression)* [","]\n'
              '   starred_list       ::= starred_item ("," starred_item)* '
              '[","]\n'
              '   starred_expression ::= expression | (starred_item ",")* '
              '[starred_item]\n'
              '   starred_item       ::= assignment_expression | "*" or_expr\n'
              '\n'
              'Except when part of a list or set display, an expression list\n'
              'containing at least one comma yields a tuple.  The length of '
              'the tuple\n'
              'is the number of expressions in the list.  The expressions are\n'
              'evaluated from left to right.\n'
              '\n'
              'An asterisk "*" denotes *iterable unpacking*.  Its operand must '
              'be an\n'
              '*iterable*.  The iterable is expanded into a sequence of items, '
              'which\n'
              'are included in the new tuple, list, or set, at the site of '
              'the\n'
              'unpacking.\n'
              '\n'
              'New in version 3.5: Iterable unpacking in expression lists, '
              'originally\n'
              'proposed by **PEP 448**.\n'
              '\n'
              'The trailing comma is required only to create a single tuple '
              '(a.k.a. a\n'
              '*singleton*); it is optional in all other cases.  A single '
              'expression\n'
              'without a trailing comma doesn’t create a tuple, but rather '
              'yields the\n'
              'value of that expression. (To create an empty tuple, use an '
              'empty pair\n'
              'of parentheses: "()".)\n',
 'floating': 'Floating point literals\n'
             '***********************\n'
             '\n'
             'Floating point literals are described by the following lexical\n'
             'definitions:\n'
             '\n'
             '   floatnumber   ::= pointfloat | exponentfloat\n'
             '   pointfloat    ::= [digitpart] fraction | digitpart "."\n'
             '   exponentfloat ::= (digitpart | pointfloat) exponent\n'
             '   digitpart     ::= digit (["_"] digit)*\n'
             '   fraction      ::= "." digitpart\n'
             '   exponent      ::= ("e" | "E") ["+" | "-"] digitpart\n'
             '\n'
             'Note that the integer and exponent parts are always interpreted '
             'using\n'
             'radix 10. For example, "077e010" is legal, and denotes the same '
             'number\n'
             'as "77e10". The allowed range of floating point literals is\n'
             'implementation-dependent.  As in integer literals, underscores '
             'are\n'
             'supported for digit grouping.\n'
             '\n'
             'Some examples of floating point literals:\n'
             '\n'
             '   3.14    10.    .001    1e100    3.14e-10    0e0    '
             '3.14_15_93\n'
             '\n'
             'Changed in version 3.6: Underscores are now allowed for '
             'grouping\n'
             'purposes in literals.\n',
 'for': 'The "for" statement\n'
        '*******************\n'
        '\n'
        'The "for" statement is used to iterate over the elements of a '
        'sequence\n'
        '(such as a string, tuple or list) or other iterable object:\n'
        '\n'
        '   for_stmt ::= "for" target_list "in" expression_list ":" suite\n'
        '                ["else" ":" suite]\n'
        '\n'
        'The expression list is evaluated once; it should yield an iterable\n'
        'object.  An iterator is created for the result of the\n'
        '"expression_list".  The suite is then executed once for each item\n'
        'provided by the iterator, in the order returned by the iterator.  '
        'Each\n'
        'item in turn is assigned to the target list using the standard rules\n'
        'for assignments (see Assignment statements), and then the suite is\n'
        'executed.  When the items are exhausted (which is immediately when '
        'the\n'
        'sequence is empty or an iterator raises a "StopIteration" '
        'exception),\n'
        'the suite in the "else" clause, if present, is executed, and the '
        'loop\n'
        'terminates.\n'
        '\n'
        'A "break" statement executed in the first suite terminates the loop\n'
        'without executing the "else" clause’s suite.  A "continue" statement\n'
        'executed in the first suite skips the rest of the suite and '
        'continues\n'
        'with the next item, or with the "else" clause if there is no next\n'
        'item.\n'
        '\n'
        'The for-loop makes assignments to the variables in the target list.\n'
        'This overwrites all previous assignments to those variables '
        'including\n'
        'those made in the suite of the for-loop:\n'
        '\n'
        '   for i in range(10):\n'
        '       print(i)\n'
        '       i = 5             # this will not affect the for-loop\n'
        '                         # because i will be overwritten with the '
        'next\n'
        '                         # index in the range\n'
        '\n'
        'Names in the target list are not deleted when the loop is finished,\n'
        'but if the sequence is empty, they will not have been assigned to at\n'
        'all by the loop.  Hint: the built-in function "range()" returns an\n'
        'iterator of integers suitable to emulate the effect of Pascal’s "for '
        'i\n'
        ':= a to b do"; e.g., "list(range(3))" returns the list "[0, 1, 2]".\n'
        '\n'
        'Note:\n'
        '\n'
        '  There is a subtlety when the sequence is being modified by the '
        'loop\n'
        '  (this can only occur for mutable sequences, e.g. lists).  An\n'
        '  internal counter is used to keep track of which item is used next,\n'
        '  and this is incremented on each iteration.  When this counter has\n'
        '  reached the length of the sequence the loop terminates.  This '
        'means\n'
        '  that if the suite deletes the current (or a previous) item from '
        'the\n'
        '  sequence, the next item will be skipped (since it gets the index '
        'of\n'
        '  the current item which has already been treated).  Likewise, if '
        'the\n'
        '  suite inserts an item in the sequence before the current item, the\n'
        '  current item will be treated again the next time through the loop.\n'
        '  This can lead to nasty bugs that can be avoided by making a\n'
        '  temporary copy using a slice of the whole sequence, e.g.,\n'
        '\n'
        '     for x in a[:]:\n'
        '         if x < 0: a.remove(x)\n',
 'formatstrings': 'Format String Syntax\n'
                  '********************\n'
                  '\n'
                  'The "str.format()" method and the "Formatter" class share '
                  'the same\n'
                  'syntax for format strings (although in the case of '
                  '"Formatter",\n'
                  'subclasses can define their own format string syntax).  The '
                  'syntax is\n'
                  'related to that of formatted string literals, but it is '
                  'less\n'
                  'sophisticated and, in particular, does not support '
                  'arbitrary\n'
                  'expressions.\n'
                  '\n'
                  'Format strings contain “replacement fields” surrounded by '
                  'curly braces\n'
                  '"{}". Anything that is not contained in braces is '
                  'considered literal\n'
                  'text, which is copied unchanged to the output.  If you need '
                  'to include\n'
                  'a brace character in the literal text, it can be escaped by '
                  'doubling:\n'
                  '"{{" and "}}".\n'
                  '\n'
                  'The grammar for a replacement field is as follows:\n'
                  '\n'
                  '      replacement_field ::= "{" [field_name] ["!" '
                  'conversion] [":" format_spec] "}"\n'
                  '      field_name        ::= arg_name ("." attribute_name | '
                  '"[" element_index "]")*\n'
                  '      arg_name          ::= [identifier | digit+]\n'
                  '      attribute_name    ::= identifier\n'
                  '      element_index     ::= digit+ | index_string\n'
                  '      index_string      ::= <any source character except '
                  '"]"> +\n'
                  '      conversion        ::= "r" | "s" | "a"\n'
                  '      format_spec       ::= <described in the next '
                  'section>\n'
                  '\n'
                  'In less formal terms, the replacement field can start with '
                  'a\n'
                  '*field_name* that specifies the object whose value is to be '
                  'formatted\n'
                  'and inserted into the output instead of the replacement '
                  'field. The\n'
                  '*field_name* is optionally followed by a  *conversion* '
                  'field, which is\n'
                  'preceded by an exclamation point "\'!\'", and a '
                  '*format_spec*, which is\n'
                  'preceded by a colon "\':\'".  These specify a non-default '
                  'format for the\n'
                  'replacement value.\n'
                  '\n'
                  'See also the Format Specification Mini-Language section.\n'
                  '\n'
                  'The *field_name* itself begins with an *arg_name* that is '
                  'either a\n'
                  'number or a keyword.  If it’s a number, it refers to a '
                  'positional\n'
                  'argument, and if it’s a keyword, it refers to a named '
                  'keyword\n'
                  'argument.  If the numerical arg_names in a format string '
                  'are 0, 1, 2,\n'
                  '… in sequence, they can all be omitted (not just some) and '
                  'the numbers\n'
                  '0, 1, 2, … will be automatically inserted in that order. '
                  'Because\n'
                  '*arg_name* is not quote-delimited, it is not possible to '
                  'specify\n'
                  'arbitrary dictionary keys (e.g., the strings "\'10\'" or '
                  '"\':-]\'") within\n'
                  'a format string. The *arg_name* can be followed by any '
                  'number of index\n'
                  'or attribute expressions. An expression of the form '
                  '"\'.name\'" selects\n'
                  'the named attribute using "getattr()", while an expression '
                  'of the form\n'
                  '"\'[index]\'" does an index lookup using "__getitem__()".\n'
                  '\n'
                  'Changed in version 3.1: The positional argument specifiers '
                  'can be\n'
                  'omitted for "str.format()", so "\'{} {}\'.format(a, b)" is '
                  'equivalent to\n'
                  '"\'{0} {1}\'.format(a, b)".\n'
                  '\n'
                  'Changed in version 3.4: The positional argument specifiers '
                  'can be\n'
                  'omitted for "Formatter".\n'
                  '\n'
                  'Some simple format string examples:\n'
                  '\n'
                  '   "First, thou shalt count to {0}"  # References first '
                  'positional argument\n'
                  '   "Bring me a {}"                   # Implicitly '
                  'references the first positional argument\n'
                  '   "From {} to {}"                   # Same as "From {0} to '
                  '{1}"\n'
                  '   "My quest is {name}"              # References keyword '
                  "argument 'name'\n"
                  '   "Weight in tons {0.weight}"       # \'weight\' attribute '
                  'of first positional arg\n'
                  '   "Units destroyed: {players[0]}"   # First element of '
                  "keyword argument 'players'.\n"
                  '\n'
                  'The *conversion* field causes a type coercion before '
                  'formatting.\n'
                  'Normally, the job of formatting a value is done by the '
                  '"__format__()"\n'
                  'method of the value itself.  However, in some cases it is '
                  'desirable to\n'
                  'force a type to be formatted as a string, overriding its '
                  'own\n'
                  'definition of formatting.  By converting the value to a '
                  'string before\n'
                  'calling "__format__()", the normal formatting logic is '
                  'bypassed.\n'
                  '\n'
                  'Three conversion flags are currently supported: "\'!s\'" '
                  'which calls\n'
                  '"str()" on the value, "\'!r\'" which calls "repr()" and '
                  '"\'!a\'" which\n'
                  'calls "ascii()".\n'
                  '\n'
                  'Some examples:\n'
                  '\n'
                  '   "Harold\'s a clever {0!s}"        # Calls str() on the '
                  'argument first\n'
                  '   "Bring out the holy {name!r}"    # Calls repr() on the '
                  'argument first\n'
                  '   "More {!a}"                      # Calls ascii() on the '
                  'argument first\n'
                  '\n'
                  'The *format_spec* field contains a specification of how the '
                  'value\n'
                  'should be presented, including such details as field width, '
                  'alignment,\n'
                  'padding, decimal precision and so on.  Each value type can '
                  'define its\n'
                  'own “formatting mini-language” or interpretation of the '
                  '*format_spec*.\n'
                  '\n'
                  'Most built-in types support a common formatting '
                  'mini-language, which\n'
                  'is described in the next section.\n'
                  '\n'
                  'A *format_spec* field can also include nested replacement '
                  'fields\n'
                  'within it. These nested replacement fields may contain a '
                  'field name,\n'
                  'conversion flag and format specification, but deeper '
                  'nesting is not\n'
                  'allowed.  The replacement fields within the format_spec '
                  'are\n'
                  'substituted before the *format_spec* string is interpreted. '
                  'This\n'
                  'allows the formatting of a value to be dynamically '
                  'specified.\n'
                  '\n'
                  'See the Format examples section for some examples.\n'
                  '\n'
                  '\n'
                  'Format Specification Mini-Language\n'
                  '==================================\n'
                  '\n'
                  '“Format specifications” are used within replacement fields '
                  'contained\n'
                  'within a format string to define how individual values are '
                  'presented\n'
                  '(see Format String Syntax and Formatted string literals). '
                  'They can\n'
                  'also be passed directly to the built-in "format()" '
                  'function.  Each\n'
                  'formattable type may define how the format specification is '
                  'to be\n'
                  'interpreted.\n'
                  '\n'
                  'Most built-in types implement the following options for '
                  'format\n'
                  'specifications, although some of the formatting options are '
                  'only\n'
                  'supported by the numeric types.\n'
                  '\n'
                  'A general convention is that an empty format specification '
                  'produces\n'
                  'the same result as if you had called "str()" on the value. '
                  'A non-empty\n'
                  'format specification typically modifies the result.\n'
                  '\n'
                  'The general form of a *standard format specifier* is:\n'
                  '\n'
                  '   format_spec     ::= '
                  '[[fill]align][sign][#][0][width][grouping_option][.precision][type]\n'
                  '   fill            ::= <any character>\n'
                  '   align           ::= "<" | ">" | "=" | "^"\n'
                  '   sign            ::= "+" | "-" | " "\n'
                  '   width           ::= digit+\n'
                  '   grouping_option ::= "_" | ","\n'
                  '   precision       ::= digit+\n'
                  '   type            ::= "b" | "c" | "d" | "e" | "E" | "f" | '
                  '"F" | "g" | "G" | "n" | "o" | "s" | "x" | "X" | "%"\n'
                  '\n'
                  'If a valid *align* value is specified, it can be preceded '
                  'by a *fill*\n'
                  'character that can be any character and defaults to a space '
                  'if\n'
                  'omitted. It is not possible to use a literal curly brace '
                  '(”"{"” or\n'
                  '“"}"”) as the *fill* character in a formatted string '
                  'literal or when\n'
                  'using the "str.format()" method.  However, it is possible '
                  'to insert a\n'
                  'curly brace with a nested replacement field.  This '
                  'limitation doesn’t\n'
                  'affect the "format()" function.\n'
                  '\n'
                  'The meaning of the various alignment options is as '
                  'follows:\n'
                  '\n'
                  '   '
                  '+-----------+------------------------------------------------------------+\n'
                  '   | Option    | '
                  'Meaning                                                    '
                  '|\n'
                  '   '
                  '|===========|============================================================|\n'
                  '   | "\'<\'"     | Forces the field to be left-aligned '
                  'within the available   |\n'
                  '   |           | space (this is the default for most '
                  'objects).              |\n'
                  '   '
                  '+-----------+------------------------------------------------------------+\n'
                  '   | "\'>\'"     | Forces the field to be right-aligned '
                  'within the available  |\n'
                  '   |           | space (this is the default for '
                  'numbers).                   |\n'
                  '   '
                  '+-----------+------------------------------------------------------------+\n'
                  '   | "\'=\'"     | Forces the padding to be placed after '
                  'the sign (if any)    |\n'
                  '   |           | but before the digits.  This is used for '
                  'printing fields   |\n'
                  '   |           | in the form ‘+000000120’. This alignment '
                  'option is only    |\n'
                  '   |           | valid for numeric types.  It becomes the '
                  'default when ‘0’  |\n'
                  '   |           | immediately precedes the field '
                  'width.                      |\n'
                  '   '
                  '+-----------+------------------------------------------------------------+\n'
                  '   | "\'^\'"     | Forces the field to be centered within '
                  'the available       |\n'
                  '   |           | '
                  'space.                                                     '
                  '|\n'
                  '   '
                  '+-----------+------------------------------------------------------------+\n'
                  '\n'
                  'Note that unless a minimum field width is defined, the '
                  'field width\n'
                  'will always be the same size as the data to fill it, so '
                  'that the\n'
                  'alignment option has no meaning in this case.\n'
                  '\n'
                  'The *sign* option is only valid for number types, and can '
                  'be one of\n'
                  'the following:\n'
                  '\n'
                  '   '
                  '+-----------+------------------------------------------------------------+\n'
                  '   | Option    | '
                  'Meaning                                                    '
                  '|\n'
                  '   '
                  '|===========|============================================================|\n'
                  '   | "\'+\'"     | indicates that a sign should be used for '
                  'both positive as  |\n'
                  '   |           | well as negative '
                  'numbers.                                  |\n'
                  '   '
                  '+-----------+------------------------------------------------------------+\n'
                  '   | "\'-\'"     | indicates that a sign should be used '
                  'only for negative     |\n'
                  '   |           | numbers (this is the default '
                  'behavior).                    |\n'
                  '   '
                  '+-----------+------------------------------------------------------------+\n'
                  '   | space     | indicates that a leading space should be '
                  'used on positive  |\n'
                  '   |           | numbers, and a minus sign on negative '
                  'numbers.             |\n'
                  '   '
                  '+-----------+------------------------------------------------------------+\n'
                  '\n'
                  'The "\'#\'" option causes the “alternate form” to be used '
                  'for the\n'
                  'conversion.  The alternate form is defined differently for '
                  'different\n'
                  'types.  This option is only valid for integer, float and '
                  'complex\n'
                  'types. For integers, when binary, octal, or hexadecimal '
                  'output is\n'
                  'used, this option adds the prefix respective "\'0b\'", '
                  '"\'0o\'", or "\'0x\'"\n'
                  'to the output value. For float and complex the alternate '
                  'form causes\n'
                  'the result of the conversion to always contain a '
                  'decimal-point\n'
                  'character, even if no digits follow it. Normally, a '
                  'decimal-point\n'
                  'character appears in the result of these conversions only '
                  'if a digit\n'
                  'follows it. In addition, for "\'g\'" and "\'G\'" '
                  'conversions, trailing\n'
                  'zeros are not removed from the result.\n'
                  '\n'
                  'The "\',\'" option signals the use of a comma for a '
                  'thousands separator.\n'
                  'For a locale aware separator, use the "\'n\'" integer '
                  'presentation type\n'
                  'instead.\n'
                  '\n'
                  'Changed in version 3.1: Added the "\',\'" option (see also '
                  '**PEP 378**).\n'
                  '\n'
                  'The "\'_\'" option signals the use of an underscore for a '
                  'thousands\n'
                  'separator for floating point presentation types and for '
                  'integer\n'
                  'presentation type "\'d\'".  For integer presentation types '
                  '"\'b\'", "\'o\'",\n'
                  '"\'x\'", and "\'X\'", underscores will be inserted every 4 '
                  'digits.  For\n'
                  'other presentation types, specifying this option is an '
                  'error.\n'
                  '\n'
                  'Changed in version 3.6: Added the "\'_\'" option (see also '
                  '**PEP 515**).\n'
                  '\n'
                  '*width* is a decimal integer defining the minimum total '
                  'field width,\n'
                  'including any prefixes, separators, and other formatting '
                  'characters.\n'
                  'If not specified, then the field width will be determined '
                  'by the\n'
                  'content.\n'
                  '\n'
                  'When no explicit alignment is given, preceding the *width* '
                  'field by a\n'
                  'zero ("\'0\'") character enables sign-aware zero-padding '
                  'for numeric\n'
                  'types.  This is equivalent to a *fill* character of "\'0\'" '
                  'with an\n'
                  '*alignment* type of "\'=\'".\n'
                  '\n'
                  'The *precision* is a decimal number indicating how many '
                  'digits should\n'
                  'be displayed after the decimal point for a floating point '
                  'value\n'
                  'formatted with "\'f\'" and "\'F\'", or before and after the '
                  'decimal point\n'
                  'for a floating point value formatted with "\'g\'" or '
                  '"\'G\'".  For non-\n'
                  'number types the field indicates the maximum field size - '
                  'in other\n'
                  'words, how many characters will be used from the field '
                  'content. The\n'
                  '*precision* is not allowed for integer values.\n'
                  '\n'
                  'Finally, the *type* determines how the data should be '
                  'presented.\n'
                  '\n'
                  'The available string presentation types are:\n'
                  '\n'
                  '   '
                  '+-----------+------------------------------------------------------------+\n'
                  '   | Type      | '
                  'Meaning                                                    '
                  '|\n'
                  '   '
                  '|===========|============================================================|\n'
                  '   | "\'s\'"     | String format. This is the default type '
                  'for strings and    |\n'
                  '   |           | may be '
                  'omitted.                                            |\n'
                  '   '
                  '+-----------+------------------------------------------------------------+\n'
                  '   | None      | The same as '
                  '"\'s\'".                                         |\n'
                  '   '
                  '+-----------+------------------------------------------------------------+\n'
                  '\n'
                  'The available integer presentation types are:\n'
                  '\n'
                  '   '
                  '+-----------+------------------------------------------------------------+\n'
                  '   | Type      | '
                  'Meaning                                                    '
                  '|\n'
                  '   '
                  '|===========|============================================================|\n'
                  '   | "\'b\'"     | Binary format. Outputs the number in '
                  'base 2.               |\n'
                  '   '
                  '+-----------+------------------------------------------------------------+\n'
                  '   | "\'c\'"     | Character. Converts the integer to the '
                  'corresponding       |\n'
                  '   |           | unicode character before '
                  'printing.                         |\n'
                  '   '
                  '+-----------+------------------------------------------------------------+\n'
                  '   | "\'d\'"     | Decimal Integer. Outputs the number in '
                  'base 10.            |\n'
                  '   '
                  '+-----------+------------------------------------------------------------+\n'
                  '   | "\'o\'"     | Octal format. Outputs the number in base '
                  '8.                |\n'
                  '   '
                  '+-----------+------------------------------------------------------------+\n'
                  '   | "\'x\'"     | Hex format. Outputs the number in base '
                  '16, using lower-    |\n'
                  '   |           | case letters for the digits above '
                  '9.                       |\n'
                  '   '
                  '+-----------+------------------------------------------------------------+\n'
                  '   | "\'X\'"     | Hex format. Outputs the number in base '
                  '16, using upper-    |\n'
                  '   |           | case letters for the digits above '
                  '9.                       |\n'
                  '   '
                  '+-----------+------------------------------------------------------------+\n'
                  '   | "\'n\'"     | Number. This is the same as "\'d\'", '
                  'except that it uses the |\n'
                  '   |           | current locale setting to insert the '
                  'appropriate number    |\n'
                  '   |           | separator '
                  'characters.                                      |\n'
                  '   '
                  '+-----------+------------------------------------------------------------+\n'
                  '   | None      | The same as '
                  '"\'d\'".                                         |\n'
                  '   '
                  '+-----------+------------------------------------------------------------+\n'
                  '\n'
                  'In addition to the above presentation types, integers can '
                  'be formatted\n'
                  'with the floating point presentation types listed below '
                  '(except "\'n\'"\n'
                  'and "None"). When doing so, "float()" is used to convert '
                  'the integer\n'
                  'to a floating point number before formatting.\n'
                  '\n'
                  'The available presentation types for "float" and "Decimal" '
                  'values are:\n'
                  '\n'
                  '   '
                  '+-----------+------------------------------------------------------------+\n'
                  '   | Type      | '
                  'Meaning                                                    '
                  '|\n'
                  '   '
                  '|===========|============================================================|\n'
                  '   | "\'e\'"     | Scientific notation. For a given '
                  'precision "p", formats    |\n'
                  '   |           | the number in scientific notation with the '
                  'letter ‘e’      |\n'
                  '   |           | separating the coefficient from the '
                  'exponent. The          |\n'
                  '   |           | coefficient has one digit before and "p" '
                  'digits after the  |\n'
                  '   |           | decimal point, for a total of "p + 1" '
                  'significant digits.  |\n'
                  '   |           | With no precision given, uses a precision '
                  'of "6" digits    |\n'
                  '   |           | after the decimal point for "float", and '
                  'shows all         |\n'
                  '   |           | coefficient digits for "Decimal". If no '
                  'digits follow the  |\n'
                  '   |           | decimal point, the decimal point is also '
                  'removed unless    |\n'
                  '   |           | the "#" option is '
                  'used.                                    |\n'
                  '   '
                  '+-----------+------------------------------------------------------------+\n'
                  '   | "\'E\'"     | Scientific notation. Same as "\'e\'" '
                  'except it uses an upper |\n'
                  '   |           | case ‘E’ as the separator '
                  'character.                       |\n'
                  '   '
                  '+-----------+------------------------------------------------------------+\n'
                  '   | "\'f\'"     | Fixed-point notation. For a given '
                  'precision "p", formats   |\n'
                  '   |           | the number as a decimal number with '
                  'exactly "p" digits     |\n'
                  '   |           | following the decimal point. With no '
                  'precision given, uses |\n'
                  '   |           | a precision of "6" digits after the '
                  'decimal point for      |\n'
                  '   |           | "float", and uses a precision large enough '
                  'to show all     |\n'
                  '   |           | coefficient digits for "Decimal". If no '
                  'digits follow the  |\n'
                  '   |           | decimal point, the decimal point is also '
                  'removed unless    |\n'
                  '   |           | the "#" option is '
                  'used.                                    |\n'
                  '   '
                  '+-----------+------------------------------------------------------------+\n'
                  '   | "\'F\'"     | Fixed-point notation. Same as "\'f\'", '
                  'but converts "nan" to |\n'
                  '   |           | "NAN" and "inf" to '
                  '"INF".                                  |\n'
                  '   '
                  '+-----------+------------------------------------------------------------+\n'
                  '   | "\'g\'"     | General format.  For a given precision '
                  '"p >= 1", this      |\n'
                  '   |           | rounds the number to "p" significant '
                  'digits and then       |\n'
                  '   |           | formats the result in either fixed-point '
                  'format or in      |\n'
                  '   |           | scientific notation, depending on its '
                  'magnitude. A         |\n'
                  '   |           | precision of "0" is treated as equivalent '
                  'to a precision   |\n'
                  '   |           | of "1".  The precise rules are as follows: '
                  'suppose that    |\n'
                  '   |           | the result formatted with presentation '
                  'type "\'e\'" and      |\n'
                  '   |           | precision "p-1" would have exponent '
                  '"exp".  Then, if "m <= |\n'
                  '   |           | exp < p", where "m" is -4 for floats and '
                  '-6 for            |\n'
                  '   |           | "Decimals", the number is formatted with '
                  'presentation type |\n'
                  '   |           | "\'f\'" and precision "p-1-exp".  '
                  'Otherwise, the number is   |\n'
                  '   |           | formatted with presentation type "\'e\'" '
                  'and precision       |\n'
                  '   |           | "p-1". In both cases insignificant '
                  'trailing zeros are      |\n'
                  '   |           | removed from the significand, and the '
                  'decimal point is     |\n'
                  '   |           | also removed if there are no remaining '
                  'digits following    |\n'
                  '   |           | it, unless the "\'#\'" option is used.  '
                  'With no precision    |\n'
                  '   |           | given, uses a precision of "6" significant '
                  'digits for      |\n'
                  '   |           | "float". For "Decimal", the coefficient of '
                  'the result is   |\n'
                  '   |           | formed from the coefficient digits of the '
                  'value;           |\n'
                  '   |           | scientific notation is used for values '
                  'smaller than "1e-6" |\n'
                  '   |           | in absolute value and values where the '
                  'place value of the  |\n'
                  '   |           | least significant digit is larger than 1, '
                  'and fixed-point  |\n'
                  '   |           | notation is used otherwise.  Positive and '
                  'negative         |\n'
                  '   |           | infinity, positive and negative zero, and '
                  'nans, are        |\n'
                  '   |           | formatted as "inf", "-inf", "0", "-0" and '
                  '"nan"            |\n'
                  '   |           | respectively, regardless of the '
                  'precision.                 |\n'
                  '   '
                  '+-----------+------------------------------------------------------------+\n'
                  '   | "\'G\'"     | General format. Same as "\'g\'" except '
                  'switches to "\'E\'" if  |\n'
                  '   |           | the number gets too large. The '
                  'representations of infinity |\n'
                  '   |           | and NaN are uppercased, '
                  'too.                               |\n'
                  '   '
                  '+-----------+------------------------------------------------------------+\n'
                  '   | "\'n\'"     | Number. This is the same as "\'g\'", '
                  'except that it uses the |\n'
                  '   |           | current locale setting to insert the '
                  'appropriate number    |\n'
                  '   |           | separator '
                  'characters.                                      |\n'
                  '   '
                  '+-----------+------------------------------------------------------------+\n'
                  '   | "\'%\'"     | Percentage. Multiplies the number by 100 '
                  'and displays in   |\n'
                  '   |           | fixed ("\'f\'") format, followed by a '
                  'percent sign.          |\n'
                  '   '
                  '+-----------+------------------------------------------------------------+\n'
                  '   | None      | For "float" this is the same as "\'g\'", '
                  'except that when    |\n'
                  '   |           | fixed-point notation is used to format the '
                  'result, it      |\n'
                  '   |           | always includes at least one digit past '
                  'the decimal point. |\n'
                  '   |           | The precision used is as large as needed '
                  'to represent the  |\n'
                  '   |           | given value faithfully.  For "Decimal", '
                  'this is the same   |\n'
                  '   |           | as either "\'g\'" or "\'G\'" depending on '
                  'the value of         |\n'
                  '   |           | "context.capitals" for the current decimal '
                  'context.  The   |\n'
                  '   |           | overall effect is to match the output of '
                  '"str()" as        |\n'
                  '   |           | altered by the other format '
                  'modifiers.                     |\n'
                  '   '
                  '+-----------+------------------------------------------------------------+\n'
                  '\n'
                  '\n'
                  'Format examples\n'
                  '===============\n'
                  '\n'
                  'This section contains examples of the "str.format()" syntax '
                  'and\n'
                  'comparison with the old "%"-formatting.\n'
                  '\n'
                  'In most of the cases the syntax is similar to the old '
                  '"%"-formatting,\n'
                  'with the addition of the "{}" and with ":" used instead of '
                  '"%". For\n'
                  'example, "\'%03.2f\'" can be translated to "\'{:03.2f}\'".\n'
                  '\n'
                  'The new format syntax also supports new and different '
                  'options, shown\n'
                  'in the following examples.\n'
                  '\n'
                  'Accessing arguments by position:\n'
                  '\n'
                  "   >>> '{0}, {1}, {2}'.format('a', 'b', 'c')\n"
                  "   'a, b, c'\n"
                  "   >>> '{}, {}, {}'.format('a', 'b', 'c')  # 3.1+ only\n"
                  "   'a, b, c'\n"
                  "   >>> '{2}, {1}, {0}'.format('a', 'b', 'c')\n"
                  "   'c, b, a'\n"
                  "   >>> '{2}, {1}, {0}'.format(*'abc')      # unpacking "
                  'argument sequence\n'
                  "   'c, b, a'\n"
                  "   >>> '{0}{1}{0}'.format('abra', 'cad')   # arguments' "
                  'indices can be repeated\n'
                  "   'abracadabra'\n"
                  '\n'
                  'Accessing arguments by name:\n'
                  '\n'
                  "   >>> 'Coordinates: {latitude}, "
                  "{longitude}'.format(latitude='37.24N', "
                  "longitude='-115.81W')\n"
                  "   'Coordinates: 37.24N, -115.81W'\n"
                  "   >>> coord = {'latitude': '37.24N', 'longitude': "
                  "'-115.81W'}\n"
                  "   >>> 'Coordinates: {latitude}, "
                  "{longitude}'.format(**coord)\n"
                  "   'Coordinates: 37.24N, -115.81W'\n"
                  '\n'
                  'Accessing arguments’ attributes:\n'
                  '\n'
                  '   >>> c = 3-5j\n'
                  "   >>> ('The complex number {0} is formed from the real "
                  "part {0.real} '\n"
                  "   ...  'and the imaginary part {0.imag}.').format(c)\n"
                  "   'The complex number (3-5j) is formed from the real part "
                  "3.0 and the imaginary part -5.0.'\n"
                  '   >>> class Point:\n'
                  '   ...     def __init__(self, x, y):\n'
                  '   ...         self.x, self.y = x, y\n'
                  '   ...     def __str__(self):\n'
                  "   ...         return 'Point({self.x}, "
                  "{self.y})'.format(self=self)\n"
                  '   ...\n'
                  '   >>> str(Point(4, 2))\n'
                  "   'Point(4, 2)'\n"
                  '\n'
                  'Accessing arguments’ items:\n'
                  '\n'
                  '   >>> coord = (3, 5)\n'
                  "   >>> 'X: {0[0]};  Y: {0[1]}'.format(coord)\n"
                  "   'X: 3;  Y: 5'\n"
                  '\n'
                  'Replacing "%s" and "%r":\n'
                  '\n'
                  '   >>> "repr() shows quotes: {!r}; str() doesn\'t: '
                  '{!s}".format(\'test1\', \'test2\')\n'
                  '   "repr() shows quotes: \'test1\'; str() doesn\'t: test2"\n'
                  '\n'
                  'Aligning the text and specifying a width:\n'
                  '\n'
                  "   >>> '{:<30}'.format('left aligned')\n"
                  "   'left aligned                  '\n"
                  "   >>> '{:>30}'.format('right aligned')\n"
                  "   '                 right aligned'\n"
                  "   >>> '{:^30}'.format('centered')\n"
                  "   '           centered           '\n"
                  "   >>> '{:*^30}'.format('centered')  # use '*' as a fill "
                  'char\n'
                  "   '***********centered***********'\n"
                  '\n'
                  'Replacing "%+f", "%-f", and "% f" and specifying a sign:\n'
                  '\n'
                  "   >>> '{:+f}; {:+f}'.format(3.14, -3.14)  # show it "
                  'always\n'
                  "   '+3.140000; -3.140000'\n"
                  "   >>> '{: f}; {: f}'.format(3.14, -3.14)  # show a space "
                  'for positive numbers\n'
                  "   ' 3.140000; -3.140000'\n"
                  "   >>> '{:-f}; {:-f}'.format(3.14, -3.14)  # show only the "
                  "minus -- same as '{:f}; {:f}'\n"
                  "   '3.140000; -3.140000'\n"
                  '\n'
                  'Replacing "%x" and "%o" and converting the value to '
                  'different bases:\n'
                  '\n'
                  '   >>> # format also supports binary numbers\n'
                  '   >>> "int: {0:d};  hex: {0:x};  oct: {0:o};  bin: '
                  '{0:b}".format(42)\n'
                  "   'int: 42;  hex: 2a;  oct: 52;  bin: 101010'\n"
                  '   >>> # with 0x, 0o, or 0b as prefix:\n'
                  '   >>> "int: {0:d};  hex: {0:#x};  oct: {0:#o};  bin: '
                  '{0:#b}".format(42)\n'
                  "   'int: 42;  hex: 0x2a;  oct: 0o52;  bin: 0b101010'\n"
                  '\n'
                  'Using the comma as a thousands separator:\n'
                  '\n'
                  "   >>> '{:,}'.format(1234567890)\n"
                  "   '1,234,567,890'\n"
                  '\n'
                  'Expressing a percentage:\n'
                  '\n'
                  '   >>> points = 19\n'
                  '   >>> total = 22\n'
                  "   >>> 'Correct answers: {:.2%}'.format(points/total)\n"
                  "   'Correct answers: 86.36%'\n"
                  '\n'
                  'Using type-specific formatting:\n'
                  '\n'
                  '   >>> import datetime\n'
                  '   >>> d = datetime.datetime(2010, 7, 4, 12, 15, 58)\n'
                  "   >>> '{:%Y-%m-%d %H:%M:%S}'.format(d)\n"
                  "   '2010-07-04 12:15:58'\n"
                  '\n'
                  'Nesting arguments and more complex examples:\n'
                  '\n'
                  "   >>> for align, text in zip('<^>', ['left', 'center', "
                  "'right']):\n"
                  "   ...     '{0:{fill}{align}16}'.format(text, fill=align, "
                  'align=align)\n'
                  '   ...\n'
                  "   'left<<<<<<<<<<<<'\n"
                  "   '^^^^^center^^^^^'\n"
                  "   '>>>>>>>>>>>right'\n"
                  '   >>>\n'
                  '   >>> octets = [192, 168, 0, 1]\n'
                  "   >>> '{:02X}{:02X}{:02X}{:02X}'.format(*octets)\n"
                  "   'C0A80001'\n"
                  '   >>> int(_, 16)\n'
                  '   3232235521\n'
                  '   >>>\n'
                  '   >>> width = 5\n'
                  '   >>> for num in range(5,12): \n'
                  "   ...     for base in 'dXob':\n"
                  "   ...         print('{0:{width}{base}}'.format(num, "
                  "base=base, width=width), end=' ')\n"
                  '   ...     print()\n'
                  '   ...\n'
                  '       5     5     5   101\n'
                  '       6     6     6   110\n'
                  '       7     7     7   111\n'
                  '       8     8    10  1000\n'
                  '       9     9    11  1001\n'
                  '      10     A    12  1010\n'
                  '      11     B    13  1011\n',
 'function': 'Function definitions\n'
             '********************\n'
             '\n'
             'A function definition defines a user-defined function object '
             '(see\n'
             'section The standard type hierarchy):\n'
             '\n'
             '   funcdef                   ::= [decorators] "def" funcname "(" '
             '[parameter_list] ")"\n'
             '               ["->" expression] ":" suite\n'
             '   decorators                ::= decorator+\n'
             '   decorator                 ::= "@" dotted_name ["(" '
             '[argument_list [","]] ")"] NEWLINE\n'
             '   dotted_name               ::= identifier ("." identifier)*\n'
             '   parameter_list            ::= defparameter ("," '
             'defparameter)* "," "/" ["," [parameter_list_no_posonly]]\n'
             '                        | parameter_list_no_posonly\n'
             '   parameter_list_no_posonly ::= defparameter ("," '
             'defparameter)* ["," [parameter_list_starargs]]\n'
             '                                 | parameter_list_starargs\n'
             '   parameter_list_starargs   ::= "*" [parameter] ("," '
             'defparameter)* ["," ["**" parameter [","]]]\n'
             '                               | "**" parameter [","]\n'
             '   parameter                 ::= identifier [":" expression]\n'
             '   defparameter              ::= parameter ["=" expression]\n'
             '   funcname                  ::= identifier\n'
             '\n'
             'A function definition is an executable statement.  Its execution '
             'binds\n'
             'the function name in the current local namespace to a function '
             'object\n'
             '(a wrapper around the executable code for the function).  This\n'
             'function object contains a reference to the current global '
             'namespace\n'
             'as the global namespace to be used when the function is called.\n'
             '\n'
             'The function definition does not execute the function body; this '
             'gets\n'
             'executed only when the function is called. [2]\n'
             '\n'
             'A function definition may be wrapped by one or more *decorator*\n'
             'expressions. Decorator expressions are evaluated when the '
             'function is\n'
             'defined, in the scope that contains the function definition.  '
             'The\n'
             'result must be a callable, which is invoked with the function '
             'object\n'
             'as the only argument. The returned value is bound to the '
             'function name\n'
             'instead of the function object.  Multiple decorators are applied '
             'in\n'
             'nested fashion. For example, the following code\n'
             '\n'
             '   @f1(arg)\n'
             '   @f2\n'
             '   def func(): pass\n'
             '\n'
             'is roughly equivalent to\n'
             '\n'
             '   def func(): pass\n'
             '   func = f1(arg)(f2(func))\n'
             '\n'
             'except that the original function is not temporarily bound to '
             'the name\n'
             '"func".\n'
             '\n'
             'When one or more *parameters* have the form *parameter* "="\n'
             '*expression*, the function is said to have “default parameter '
             'values.”\n'
             'For a parameter with a default value, the corresponding '
             '*argument* may\n'
             'be omitted from a call, in which case the parameter’s default '
             'value is\n'
             'substituted.  If a parameter has a default value, all following\n'
             'parameters up until the “"*"” must also have a default value — '
             'this is\n'
             'a syntactic restriction that is not expressed by the grammar.\n'
             '\n'
             '**Default parameter values are evaluated from left to right when '
             'the\n'
             'function definition is executed.** This means that the '
             'expression is\n'
             'evaluated once, when the function is defined, and that the same '
             '“pre-\n'
             'computed” value is used for each call.  This is especially '
             'important\n'
             'to understand when a default parameter is a mutable object, such '
             'as a\n'
             'list or a dictionary: if the function modifies the object (e.g. '
             'by\n'
             'appending an item to a list), the default value is in effect '
             'modified.\n'
             'This is generally not what was intended.  A way around this is '
             'to use\n'
             '"None" as the default, and explicitly test for it in the body of '
             'the\n'
             'function, e.g.:\n'
             '\n'
             '   def whats_on_the_telly(penguin=None):\n'
             '       if penguin is None:\n'
             '           penguin = []\n'
             '       penguin.append("property of the zoo")\n'
             '       return penguin\n'
             '\n'
             'Function call semantics are described in more detail in section '
             'Calls.\n'
             'A function call always assigns values to all parameters '
             'mentioned in\n'
             'the parameter list, either from positional arguments, from '
             'keyword\n'
             'arguments, or from default values.  If the form “"*identifier"” '
             'is\n'
             'present, it is initialized to a tuple receiving any excess '
             'positional\n'
             'parameters, defaulting to the empty tuple. If the form\n'
             '“"**identifier"” is present, it is initialized to a new ordered\n'
             'mapping receiving any excess keyword arguments, defaulting to a '
             'new\n'
             'empty mapping of the same type.  Parameters after “"*"” or\n'
             '“"*identifier"” are keyword-only parameters and may only be '
             'passed by\n'
             'keyword arguments.  Parameters before “"/"” are positional-only\n'
             'parameters and may only be passed by positional arguments.\n'
             '\n'
             'Changed in version 3.8: The "/" function parameter syntax may be '
             'used\n'
             'to indicate positional-only parameters. See **PEP 570** for '
             'details.\n'
             '\n'
             'Parameters may have an *annotation* of the form “": '
             'expression"”\n'
             'following the parameter name.  Any parameter may have an '
             'annotation,\n'
             'even those of the form "*identifier" or "**identifier".  '
             'Functions may\n'
             'have “return” annotation of the form “"-> expression"” after '
             'the\n'
             'parameter list.  These annotations can be any valid Python '
             'expression.\n'
             'The presence of annotations does not change the semantics of a\n'
             'function.  The annotation values are available as values of a\n'
             'dictionary keyed by the parameters’ names in the '
             '"__annotations__"\n'
             'attribute of the function object.  If the "annotations" import '
             'from\n'
             '"__future__" is used, annotations are preserved as strings at '
             'runtime\n'
             'which enables postponed evaluation.  Otherwise, they are '
             'evaluated\n'
             'when the function definition is executed.  In this case '
             'annotations\n'
             'may be evaluated in a different order than they appear in the '
             'source\n'
             'code.\n'
             '\n'
             'It is also possible to create anonymous functions (functions not '
             'bound\n'
             'to a name), for immediate use in expressions.  This uses lambda\n'
             'expressions, described in section Lambdas.  Note that the '
             'lambda\n'
             'expression is merely a shorthand for a simplified function '
             'definition;\n'
             'a function defined in a “"def"” statement can be passed around '
             'or\n'
             'assigned to another name just like a function defined by a '
             'lambda\n'
             'expression.  The “"def"” form is actually more powerful since '
             'it\n'
             'allows the execution of multiple statements and annotations.\n'
             '\n'
             '**Programmer’s note:** Functions are first-class objects.  A '
             '“"def"”\n'
             'statement executed inside a function definition defines a local\n'
             'function that can be returned or passed around.  Free variables '
             'used\n'
             'in the nested function can access the local variables of the '
             'function\n'
             'containing the def.  See section Naming and binding for '
             'details.\n'
             '\n'
             'See also:\n'
             '\n'
             '  **PEP 3107** - Function Annotations\n'
             '     The original specification for function annotations.\n'
             '\n'
             '  **PEP 484** - Type Hints\n'
             '     Definition of a standard meaning for annotations: type '
             'hints.\n'
             '\n'
             '  **PEP 526** - Syntax for Variable Annotations\n'
             '     Ability to type hint variable declarations, including '
             'class\n'
             '     variables and instance variables\n'
             '\n'
             '  **PEP 563** - Postponed Evaluation of Annotations\n'
             '     Support for forward references within annotations by '
             'preserving\n'
             '     annotations in a string form at runtime instead of eager\n'
             '     evaluation.\n',
 'global': 'The "global" statement\n'
           '**********************\n'
           '\n'
           '   global_stmt ::= "global" identifier ("," identifier)*\n'
           '\n'
           'The "global" statement is a declaration which holds for the '
           'entire\n'
           'current code block.  It means that the listed identifiers are to '
           'be\n'
           'interpreted as globals.  It would be impossible to assign to a '
           'global\n'
           'variable without "global", although free variables may refer to\n'
           'globals without being declared global.\n'
           '\n'
           'Names listed in a "global" statement must not be used in the same '
           'code\n'
           'block textually preceding that "global" statement.\n'
           '\n'
           'Names listed in a "global" statement must not be defined as '
           'formal\n'
           'parameters or in a "for" loop control target, "class" definition,\n'
           'function definition, "import" statement, or variable annotation.\n'
           '\n'
           '**CPython implementation detail:** The current implementation does '
           'not\n'
           'enforce some of these restrictions, but programs should not abuse '
           'this\n'
           'freedom, as future implementations may enforce them or silently '
           'change\n'
           'the meaning of the program.\n'
           '\n'
           '**Programmer’s note:** "global" is a directive to the parser.  It\n'
           'applies only to code parsed at the same time as the "global"\n'
           'statement. In particular, a "global" statement contained in a '
           'string\n'
           'or code object supplied to the built-in "exec()" function does '
           'not\n'
           'affect the code block *containing* the function call, and code\n'
           'contained in such a string is unaffected by "global" statements in '
           'the\n'
           'code containing the function call.  The same applies to the '
           '"eval()"\n'
           'and "compile()" functions.\n',
 'id-classes': 'Reserved classes of identifiers\n'
               '*******************************\n'
               '\n'
               'Certain classes of identifiers (besides keywords) have '
               'special\n'
               'meanings.  These classes are identified by the patterns of '
               'leading and\n'
               'trailing underscore characters:\n'
               '\n'
               '"_*"\n'
               '   Not imported by "from module import *".  The special '
               'identifier "_"\n'
               '   is used in the interactive interpreter to store the result '
               'of the\n'
               '   last evaluation; it is stored in the "builtins" module.  '
               'When not\n'
               '   in interactive mode, "_" has no special meaning and is not '
               'defined.\n'
               '   See section The import statement.\n'
               '\n'
               '   Note:\n'
               '\n'
               '     The name "_" is often used in conjunction with\n'
               '     internationalization; refer to the documentation for the\n'
               '     "gettext" module for more information on this '
               'convention.\n'
               '\n'
               '"__*__"\n'
               '   System-defined names, informally known as “dunder” names. '
               'These\n'
               '   names are defined by the interpreter and its '
               'implementation\n'
               '   (including the standard library). Current system names are\n'
               '   discussed in the Special method names section and '
               'elsewhere. More\n'
               '   will likely be defined in future versions of Python.  *Any* '
               'use of\n'
               '   "__*__" names, in any context, that does not follow '
               'explicitly\n'
               '   documented use, is subject to breakage without warning.\n'
               '\n'
               '"__*"\n'
               '   Class-private names.  Names in this category, when used '
               'within the\n'
               '   context of a class definition, are re-written to use a '
               'mangled form\n'
               '   to help avoid name clashes between “private” attributes of '
               'base and\n'
               '   derived classes. See section Identifiers (Names).\n',
 'identifiers': 'Identifiers and keywords\n'
                '************************\n'
                '\n'
                'Identifiers (also referred to as *names*) are described by '
                'the\n'
                'following lexical definitions.\n'
                '\n'
                'The syntax of identifiers in Python is based on the Unicode '
                'standard\n'
                'annex UAX-31, with elaboration and changes as defined below; '
                'see also\n'
                '**PEP 3131** for further details.\n'
                '\n'
                'Within the ASCII range (U+0001..U+007F), the valid characters '
                'for\n'
                'identifiers are the same as in Python 2.x: the uppercase and '
                'lowercase\n'
                'letters "A" through "Z", the underscore "_" and, except for '
                'the first\n'
                'character, the digits "0" through "9".\n'
                '\n'
                'Python 3.0 introduces additional characters from outside the '
                'ASCII\n'
                'range (see **PEP 3131**).  For these characters, the '
                'classification\n'
                'uses the version of the Unicode Character Database as '
                'included in the\n'
                '"unicodedata" module.\n'
                '\n'
                'Identifiers are unlimited in length.  Case is significant.\n'
                '\n'
                '   identifier   ::= xid_start xid_continue*\n'
                '   id_start     ::= <all characters in general categories Lu, '
                'Ll, Lt, Lm, Lo, Nl, the underscore, and characters with the '
                'Other_ID_Start property>\n'
                '   id_continue  ::= <all characters in id_start, plus '
                'characters in the categories Mn, Mc, Nd, Pc and others with '
                'the Other_ID_Continue property>\n'
                '   xid_start    ::= <all characters in id_start whose NFKC '
                'normalization is in "id_start xid_continue*">\n'
                '   xid_continue ::= <all characters in id_continue whose NFKC '
                'normalization is in "id_continue*">\n'
                '\n'
                'The Unicode category codes mentioned above stand for:\n'
                '\n'
                '* *Lu* - uppercase letters\n'
                '\n'
                '* *Ll* - lowercase letters\n'
                '\n'
                '* *Lt* - titlecase letters\n'
                '\n'
                '* *Lm* - modifier letters\n'
                '\n'
                '* *Lo* - other letters\n'
                '\n'
                '* *Nl* - letter numbers\n'
                '\n'
                '* *Mn* - nonspacing marks\n'
                '\n'
                '* *Mc* - spacing combining marks\n'
                '\n'
                '* *Nd* - decimal numbers\n'
                '\n'
                '* *Pc* - connector punctuations\n'
                '\n'
                '* *Other_ID_Start* - explicit list of characters in '
                'PropList.txt to\n'
                '  support backwards compatibility\n'
                '\n'
                '* *Other_ID_Continue* - likewise\n'
                '\n'
                'All identifiers are converted into the normal form NFKC while '
                'parsing;\n'
                'comparison of identifiers is based on NFKC.\n'
                '\n'
                'A non-normative HTML file listing all valid identifier '
                'characters for\n'
                'Unicode 4.1 can be found at\n'
                'https://www.unicode.org/Public/13.0.0/ucd/DerivedCoreProperties.txt\n'
                '\n'
                '\n'
                'Keywords\n'
                '========\n'
                '\n'
                'The following identifiers are used as reserved words, or '
                '*keywords* of\n'
                'the language, and cannot be used as ordinary identifiers.  '
                'They must\n'
                'be spelled exactly as written here:\n'
                '\n'
                '   False      await      else       import     pass\n'
                '   None       break      except     in         raise\n'
                '   True       class      finally    is         return\n'
                '   and        continue   for        lambda     try\n'
                '   as         def        from       nonlocal   while\n'
                '   assert     del        global     not        with\n'
                '   async      elif       if         or         yield\n'
                '\n'
                '\n'
                'Reserved classes of identifiers\n'
                '===============================\n'
                '\n'
                'Certain classes of identifiers (besides keywords) have '
                'special\n'
                'meanings.  These classes are identified by the patterns of '
                'leading and\n'
                'trailing underscore characters:\n'
                '\n'
                '"_*"\n'
                '   Not imported by "from module import *".  The special '
                'identifier "_"\n'
                '   is used in the interactive interpreter to store the result '
                'of the\n'
                '   last evaluation; it is stored in the "builtins" module.  '
                'When not\n'
                '   in interactive mode, "_" has no special meaning and is not '
                'defined.\n'
                '   See section The import statement.\n'
                '\n'
                '   Note:\n'
                '\n'
                '     The name "_" is often used in conjunction with\n'
                '     internationalization; refer to the documentation for '
                'the\n'
                '     "gettext" module for more information on this '
                'convention.\n'
                '\n'
                '"__*__"\n'
                '   System-defined names, informally known as “dunder” names. '
                'These\n'
                '   names are defined by the interpreter and its '
                'implementation\n'
                '   (including the standard library). Current system names '
                'are\n'
                '   discussed in the Special method names section and '
                'elsewhere. More\n'
                '   will likely be defined in future versions of Python.  '
                '*Any* use of\n'
                '   "__*__" names, in any context, that does not follow '
                'explicitly\n'
                '   documented use, is subject to breakage without warning.\n'
                '\n'
                '"__*"\n'
                '   Class-private names.  Names in this category, when used '
                'within the\n'
                '   context of a class definition, are re-written to use a '
                'mangled form\n'
                '   to help avoid name clashes between “private” attributes of '
                'base and\n'
                '   derived classes. See section Identifiers (Names).\n',
 'if': 'The "if" statement\n'
       '******************\n'
       '\n'
       'The "if" statement is used for conditional execution:\n'
       '\n'
       '   if_stmt ::= "if" assignment_expression ":" suite\n'
       '               ("elif" assignment_expression ":" suite)*\n'
       '               ["else" ":" suite]\n'
       '\n'
       'It selects exactly one of the suites by evaluating the expressions '
       'one\n'
       'by one until one is found to be true (see section Boolean operations\n'
       'for the definition of true and false); then that suite is executed\n'
       '(and no other part of the "if" statement is executed or evaluated).\n'
       'If all expressions are false, the suite of the "else" clause, if\n'
       'present, is executed.\n',
 'imaginary': 'Imaginary literals\n'
              '******************\n'
              '\n'
              'Imaginary literals are described by the following lexical '
              'definitions:\n'
              '\n'
              '   imagnumber ::= (floatnumber | digitpart) ("j" | "J")\n'
              '\n'
              'An imaginary literal yields a complex number with a real part '
              'of 0.0.\n'
              'Complex numbers are represented as a pair of floating point '
              'numbers\n'
              'and have the same restrictions on their range.  To create a '
              'complex\n'
              'number with a nonzero real part, add a floating point number to '
              'it,\n'
              'e.g., "(3+4j)".  Some examples of imaginary literals:\n'
              '\n'
              '   3.14j   10.j    10j     .001j   1e100j   3.14e-10j   '
              '3.14_15_93j\n',
 'import': 'The "import" statement\n'
           '**********************\n'
           '\n'
           '   import_stmt     ::= "import" module ["as" identifier] ("," '
           'module ["as" identifier])*\n'
           '                   | "from" relative_module "import" identifier '
           '["as" identifier]\n'
           '                   ("," identifier ["as" identifier])*\n'
           '                   | "from" relative_module "import" "(" '
           'identifier ["as" identifier]\n'
           '                   ("," identifier ["as" identifier])* [","] ")"\n'
           '                   | "from" module "import" "*"\n'
           '   module          ::= (identifier ".")* identifier\n'
           '   relative_module ::= "."* module | "."+\n'
           '\n'
           'The basic import statement (no "from" clause) is executed in two\n'
           'steps:\n'
           '\n'
           '1. find a module, loading and initializing it if necessary\n'
           '\n'
           '2. define a name or names in the local namespace for the scope '
           'where\n'
           '   the "import" statement occurs.\n'
           '\n'
           'When the statement contains multiple clauses (separated by commas) '
           'the\n'
           'two steps are carried out separately for each clause, just as '
           'though\n'
           'the clauses had been separated out into individual import '
           'statements.\n'
           '\n'
           'The details of the first step, finding and loading modules are\n'
           'described in greater detail in the section on the import system, '
           'which\n'
           'also describes the various types of packages and modules that can '
           'be\n'
           'imported, as well as all the hooks that can be used to customize '
           'the\n'
           'import system. Note that failures in this step may indicate '
           'either\n'
           'that the module could not be located, *or* that an error occurred\n'
           'while initializing the module, which includes execution of the\n'
           'module’s code.\n'
           '\n'
           'If the requested module is retrieved successfully, it will be '
           'made\n'
           'available in the local namespace in one of three ways:\n'
           '\n'
           '* If the module name is followed by "as", then the name following '
           '"as"\n'
           '  is bound directly to the imported module.\n'
           '\n'
           '* If no other name is specified, and the module being imported is '
           'a\n'
           '  top level module, the module’s name is bound in the local '
           'namespace\n'
           '  as a reference to the imported module\n'
           '\n'
           '* If the module being imported is *not* a top level module, then '
           'the\n'
           '  name of the top level package that contains the module is bound '
           'in\n'
           '  the local namespace as a reference to the top level package. '
           'The\n'
           '  imported module must be accessed using its full qualified name\n'
           '  rather than directly\n'
           '\n'
           'The "from" form uses a slightly more complex process:\n'
           '\n'
           '1. find the module specified in the "from" clause, loading and\n'
           '   initializing it if necessary;\n'
           '\n'
           '2. for each of the identifiers specified in the "import" clauses:\n'
           '\n'
           '   1. check if the imported module has an attribute by that name\n'
           '\n'
           '   2. if not, attempt to import a submodule with that name and '
           'then\n'
           '      check the imported module again for that attribute\n'
           '\n'
           '   3. if the attribute is not found, "ImportError" is raised.\n'
           '\n'
           '   4. otherwise, a reference to that value is stored in the local\n'
           '      namespace, using the name in the "as" clause if it is '
           'present,\n'
           '      otherwise using the attribute name\n'
           '\n'
           'Examples:\n'
           '\n'
           '   import foo                 # foo imported and bound locally\n'
           '   import foo.bar.baz         # foo.bar.baz imported, foo bound '
           'locally\n'
           '   import foo.bar.baz as fbb  # foo.bar.baz imported and bound as '
           'fbb\n'
           '   from foo.bar import baz    # foo.bar.baz imported and bound as '
           'baz\n'
           '   from foo import attr       # foo imported and foo.attr bound as '
           'attr\n'
           '\n'
           'If the list of identifiers is replaced by a star ("\'*\'"), all '
           'public\n'
           'names defined in the module are bound in the local namespace for '
           'the\n'
           'scope where the "import" statement occurs.\n'
           '\n'
           'The *public names* defined by a module are determined by checking '
           'the\n'
           'module’s namespace for a variable named "__all__"; if defined, it '
           'must\n'
           'be a sequence of strings which are names defined or imported by '
           'that\n'
           'module.  The names given in "__all__" are all considered public '
           'and\n'
           'are required to exist.  If "__all__" is not defined, the set of '
           'public\n'
           'names includes all names found in the module’s namespace which do '
           'not\n'
           'begin with an underscore character ("\'_\'").  "__all__" should '
           'contain\n'
           'the entire public API. It is intended to avoid accidentally '
           'exporting\n'
           'items that are not part of the API (such as library modules which '
           'were\n'
           'imported and used within the module).\n'
           '\n'
           'The wild card form of import — "from module import *" — is only\n'
           'allowed at the module level.  Attempting to use it in class or\n'
           'function definitions will raise a "SyntaxError".\n'
           '\n'
           'When specifying what module to import you do not have to specify '
           'the\n'
           'absolute name of the module. When a module or package is '
           'contained\n'
           'within another package it is possible to make a relative import '
           'within\n'
           'the same top package without having to mention the package name. '
           'By\n'
           'using leading dots in the specified module or package after "from" '
           'you\n'
           'can specify how high to traverse up the current package hierarchy\n'
           'without specifying exact names. One leading dot means the current\n'
           'package where the module making the import exists. Two dots means '
           'up\n'
           'one package level. Three dots is up two levels, etc. So if you '
           'execute\n'
           '"from . import mod" from a module in the "pkg" package then you '
           'will\n'
           'end up importing "pkg.mod". If you execute "from ..subpkg2 import '
           'mod"\n'
           'from within "pkg.subpkg1" you will import "pkg.subpkg2.mod". The\n'
           'specification for relative imports is contained in the Package\n'
           'Relative Imports section.\n'
           '\n'
           '"importlib.import_module()" is provided to support applications '
           'that\n'
           'determine dynamically the modules to be loaded.\n'
           '\n'
           'Raises an auditing event "import" with arguments "module", '
           '"filename",\n'
           '"sys.path", "sys.meta_path", "sys.path_hooks".\n'
           '\n'
           '\n'
           'Future statements\n'
           '=================\n'
           '\n'
           'A *future statement* is a directive to the compiler that a '
           'particular\n'
           'module should be compiled using syntax or semantics that will be\n'
           'available in a specified future release of Python where the '
           'feature\n'
           'becomes standard.\n'
           '\n'
           'The future statement is intended to ease migration to future '
           'versions\n'
           'of Python that introduce incompatible changes to the language.  '
           'It\n'
           'allows use of the new features on a per-module basis before the\n'
           'release in which the feature becomes standard.\n'
           '\n'
           '   future_stmt ::= "from" "__future__" "import" feature ["as" '
           'identifier]\n'
           '                   ("," feature ["as" identifier])*\n'
           '                   | "from" "__future__" "import" "(" feature '
           '["as" identifier]\n'
           '                   ("," feature ["as" identifier])* [","] ")"\n'
           '   feature     ::= identifier\n'
           '\n'
           'A future statement must appear near the top of the module.  The '
           'only\n'
           'lines that can appear before a future statement are:\n'
           '\n'
           '* the module docstring (if any),\n'
           '\n'
           '* comments,\n'
           '\n'
           '* blank lines, and\n'
           '\n'
           '* other future statements.\n'
           '\n'
           'The only feature that requires using the future statement is\n'
           '"annotations" (see **PEP 563**).\n'
           '\n'
           'All historical features enabled by the future statement are still\n'
           'recognized by Python 3.  The list includes "absolute_import",\n'
           '"division", "generators", "generator_stop", "unicode_literals",\n'
           '"print_function", "nested_scopes" and "with_statement".  They are '
           'all\n'
           'redundant because they are always enabled, and only kept for '
           'backwards\n'
           'compatibility.\n'
           '\n'
           'A future statement is recognized and treated specially at compile\n'
           'time: Changes to the semantics of core constructs are often\n'
           'implemented by generating different code.  It may even be the '
           'case\n'
           'that a new feature introduces new incompatible syntax (such as a '
           'new\n'
           'reserved word), in which case the compiler may need to parse the\n'
           'module differently.  Such decisions cannot be pushed off until\n'
           'runtime.\n'
           '\n'
           'For any given release, the compiler knows which feature names '
           'have\n'
           'been defined, and raises a compile-time error if a future '
           'statement\n'
           'contains a feature not known to it.\n'
           '\n'
           'The direct runtime semantics are the same as for any import '
           'statement:\n'
           'there is a standard module "__future__", described later, and it '
           'will\n'
           'be imported in the usual way at the time the future statement is\n'
           'executed.\n'
           '\n'
           'The interesting runtime semantics depend on the specific feature\n'
           'enabled by the future statement.\n'
           '\n'
           'Note that there is nothing special about the statement:\n'
           '\n'
           '   import __future__ [as name]\n'
           '\n'
           'That is not a future statement; it’s an ordinary import statement '
           'with\n'
           'no special semantics or syntax restrictions.\n'
           '\n'
           'Code compiled by calls to the built-in functions "exec()" and\n'
           '"compile()" that occur in a module "M" containing a future '
           'statement\n'
           'will, by default, use the new syntax or semantics associated with '
           'the\n'
           'future statement.  This can be controlled by optional arguments '
           'to\n'
           '"compile()" — see the documentation of that function for details.\n'
           '\n'
           'A future statement typed at an interactive interpreter prompt '
           'will\n'
           'take effect for the rest of the interpreter session.  If an\n'
           'interpreter is started with the "-i" option, is passed a script '
           'name\n'
           'to execute, and the script includes a future statement, it will be '
           'in\n'
           'effect in the interactive session started after the script is\n'
           'executed.\n'
           '\n'
           'See also:\n'
           '\n'
           '  **PEP 236** - Back to the __future__\n'
           '     The original proposal for the __future__ mechanism.\n',
 'in': 'Membership test operations\n'
       '**************************\n'
       '\n'
       'The operators "in" and "not in" test for membership.  "x in s"\n'
       'evaluates to "True" if *x* is a member of *s*, and "False" otherwise.\n'
       '"x not in s" returns the negation of "x in s".  All built-in '
       'sequences\n'
       'and set types support this as well as dictionary, for which "in" '
       'tests\n'
       'whether the dictionary has a given key. For container types such as\n'
       'list, tuple, set, frozenset, dict, or collections.deque, the\n'
       'expression "x in y" is equivalent to "any(x is e or x == e for e in\n'
       'y)".\n'
       '\n'
       'For the string and bytes types, "x in y" is "True" if and only if *x*\n'
       'is a substring of *y*.  An equivalent test is "y.find(x) != -1".\n'
       'Empty strings are always considered to be a substring of any other\n'
       'string, so """ in "abc"" will return "True".\n'
       '\n'
       'For user-defined classes which define the "__contains__()" method, "x\n'
       'in y" returns "True" if "y.__contains__(x)" returns a true value, and\n'
       '"False" otherwise.\n'
       '\n'
       'For user-defined classes which do not define "__contains__()" but do\n'
       'define "__iter__()", "x in y" is "True" if some value "z", for which\n'
       'the expression "x is z or x == z" is true, is produced while '
       'iterating\n'
       'over "y". If an exception is raised during the iteration, it is as if\n'
       '"in" raised that exception.\n'
       '\n'
       'Lastly, the old-style iteration protocol is tried: if a class defines\n'
       '"__getitem__()", "x in y" is "True" if and only if there is a non-\n'
       'negative integer index *i* such that "x is y[i] or x == y[i]", and no\n'
       'lower integer index raises the "IndexError" exception.  (If any other\n'
       'exception is raised, it is as if "in" raised that exception).\n'
       '\n'
       'The operator "not in" is defined to have the inverse truth value of\n'
       '"in".\n',
 'integers': 'Integer literals\n'
             '****************\n'
             '\n'
             'Integer literals are described by the following lexical '
             'definitions:\n'
             '\n'
             '   integer      ::= decinteger | bininteger | octinteger | '
             'hexinteger\n'
             '   decinteger   ::= nonzerodigit (["_"] digit)* | "0"+ (["_"] '
             '"0")*\n'
             '   bininteger   ::= "0" ("b" | "B") (["_"] bindigit)+\n'
             '   octinteger   ::= "0" ("o" | "O") (["_"] octdigit)+\n'
             '   hexinteger   ::= "0" ("x" | "X") (["_"] hexdigit)+\n'
             '   nonzerodigit ::= "1"..."9"\n'
             '   digit        ::= "0"..."9"\n'
             '   bindigit     ::= "0" | "1"\n'
             '   octdigit     ::= "0"..."7"\n'
             '   hexdigit     ::= digit | "a"..."f" | "A"..."F"\n'
             '\n'
             'There is no limit for the length of integer literals apart from '
             'what\n'
             'can be stored in available memory.\n'
             '\n'
             'Underscores are ignored for determining the numeric value of '
             'the\n'
             'literal.  They can be used to group digits for enhanced '
             'readability.\n'
             'One underscore can occur between digits, and after base '
             'specifiers\n'
             'like "0x".\n'
             '\n'
             'Note that leading zeros in a non-zero decimal number are not '
             'allowed.\n'
             'This is for disambiguation with C-style octal literals, which '
             'Python\n'
             'used before version 3.0.\n'
             '\n'
             'Some examples of integer literals:\n'
             '\n'
             '   7     2147483647                        0o177    0b100110111\n'
             '   3     79228162514264337593543950336     0o377    0xdeadbeef\n'
             '         100_000_000_000                   0b_1110_0101\n'
             '\n'
             'Changed in version 3.6: Underscores are now allowed for '
             'grouping\n'
             'purposes in literals.\n',
 'lambda': 'Lambdas\n'
           '*******\n'
           '\n'
           '   lambda_expr        ::= "lambda" [parameter_list] ":" '
           'expression\n'
           '   lambda_expr_nocond ::= "lambda" [parameter_list] ":" '
           'expression_nocond\n'
           '\n'
           'Lambda expressions (sometimes called lambda forms) are used to '
           'create\n'
           'anonymous functions. The expression "lambda parameters: '
           'expression"\n'
           'yields a function object.  The unnamed object behaves like a '
           'function\n'
           'object defined with:\n'
           '\n'
           '   def <lambda>(parameters):\n'
           '       return expression\n'
           '\n'
           'See section Function definitions for the syntax of parameter '
           'lists.\n'
           'Note that functions created with lambda expressions cannot '
           'contain\n'
           'statements or annotations.\n',
 'lists': 'List displays\n'
          '*************\n'
          '\n'
          'A list display is a possibly empty series of expressions enclosed '
          'in\n'
          'square brackets:\n'
          '\n'
          '   list_display ::= "[" [starred_list | comprehension] "]"\n'
          '\n'
          'A list display yields a new list object, the contents being '
          'specified\n'
          'by either a list of expressions or a comprehension.  When a comma-\n'
          'separated list of expressions is supplied, its elements are '
          'evaluated\n'
          'from left to right and placed into the list object in that order.\n'
          'When a comprehension is supplied, the list is constructed from the\n'
          'elements resulting from the comprehension.\n',
 'naming': 'Naming and binding\n'
           '******************\n'
           '\n'
           '\n'
           'Binding of names\n'
           '================\n'
           '\n'
           '*Names* refer to objects.  Names are introduced by name binding\n'
           'operations.\n'
           '\n'
           'The following constructs bind names: formal parameters to '
           'functions,\n'
           '"import" statements, class and function definitions (these bind '
           'the\n'
           'class or function name in the defining block), and targets that '
           'are\n'
           'identifiers if occurring in an assignment, "for" loop header, or '
           'after\n'
           '"as" in a "with" statement or "except" clause. The "import" '
           'statement\n'
           'of the form "from ... import *" binds all names defined in the\n'
           'imported module, except those beginning with an underscore.  This '
           'form\n'
           'may only be used at the module level.\n'
           '\n'
           'A target occurring in a "del" statement is also considered bound '
           'for\n'
           'this purpose (though the actual semantics are to unbind the '
           'name).\n'
           '\n'
           'Each assignment or import statement occurs within a block defined '
           'by a\n'
           'class or function definition or at the module level (the '
           'top-level\n'
           'code block).\n'
           '\n'
           'If a name is bound in a block, it is a local variable of that '
           'block,\n'
           'unless declared as "nonlocal" or "global".  If a name is bound at '
           'the\n'
           'module level, it is a global variable.  (The variables of the '
           'module\n'
           'code block are local and global.)  If a variable is used in a '
           'code\n'
           'block but not defined there, it is a *free variable*.\n'
           '\n'
           'Each occurrence of a name in the program text refers to the '
           '*binding*\n'
           'of that name established by the following name resolution rules.\n'
           '\n'
           '\n'
           'Resolution of names\n'
           '===================\n'
           '\n'
           'A *scope* defines the visibility of a name within a block.  If a '
           'local\n'
           'variable is defined in a block, its scope includes that block.  If '
           'the\n'
           'definition occurs in a function block, the scope extends to any '
           'blocks\n'
           'contained within the defining one, unless a contained block '
           'introduces\n'
           'a different binding for the name.\n'
           '\n'
           'When a name is used in a code block, it is resolved using the '
           'nearest\n'
           'enclosing scope.  The set of all such scopes visible to a code '
           'block\n'
           'is called the block’s *environment*.\n'
           '\n'
           'When a name is not found at all, a "NameError" exception is '
           'raised. If\n'
           'the current scope is a function scope, and the name refers to a '
           'local\n'
           'variable that has not yet been bound to a value at the point where '
           'the\n'
           'name is used, an "UnboundLocalError" exception is raised.\n'
           '"UnboundLocalError" is a subclass of "NameError".\n'
           '\n'
           'If a name binding operation occurs anywhere within a code block, '
           'all\n'
           'uses of the name within the block are treated as references to '
           'the\n'
           'current block.  This can lead to errors when a name is used within '
           'a\n'
           'block before it is bound.  This rule is subtle.  Python lacks\n'
           'declarations and allows name binding operations to occur anywhere\n'
           'within a code block.  The local variables of a code block can be\n'
           'determined by scanning the entire text of the block for name '
           'binding\n'
           'operations.\n'
           '\n'
           'If the "global" statement occurs within a block, all uses of the '
           'name\n'
           'specified in the statement refer to the binding of that name in '
           'the\n'
           'top-level namespace.  Names are resolved in the top-level '
           'namespace by\n'
           'searching the global namespace, i.e. the namespace of the module\n'
           'containing the code block, and the builtins namespace, the '
           'namespace\n'
           'of the module "builtins".  The global namespace is searched '
           'first.  If\n'
           'the name is not found there, the builtins namespace is searched.  '
           'The\n'
           '"global" statement must precede all uses of the name.\n'
           '\n'
           'The "global" statement has the same scope as a name binding '
           'operation\n'
           'in the same block.  If the nearest enclosing scope for a free '
           'variable\n'
           'contains a global statement, the free variable is treated as a '
           'global.\n'
           '\n'
           'The "nonlocal" statement causes corresponding names to refer to\n'
           'previously bound variables in the nearest enclosing function '
           'scope.\n'
           '"SyntaxError" is raised at compile time if the given name does '
           'not\n'
           'exist in any enclosing function scope.\n'
           '\n'
           'The namespace for a module is automatically created the first time '
           'a\n'
           'module is imported.  The main module for a script is always '
           'called\n'
           '"__main__".\n'
           '\n'
           'Class definition blocks and arguments to "exec()" and "eval()" '
           'are\n'
           'special in the context of name resolution. A class definition is '
           'an\n'
           'executable statement that may use and define names. These '
           'references\n'
           'follow the normal rules for name resolution with an exception '
           'that\n'
           'unbound local variables are looked up in the global namespace. '
           'The\n'
           'namespace of the class definition becomes the attribute dictionary '
           'of\n'
           'the class. The scope of names defined in a class block is limited '
           'to\n'
           'the class block; it does not extend to the code blocks of methods '
           '–\n'
           'this includes comprehensions and generator expressions since they '
           'are\n'
           'implemented using a function scope.  This means that the '
           'following\n'
           'will fail:\n'
           '\n'
           '   class A:\n'
           '       a = 42\n'
           '       b = list(a + i for i in range(10))\n'
           '\n'
           '\n'
           'Builtins and restricted execution\n'
           '=================================\n'
           '\n'
           '**CPython implementation detail:** Users should not touch\n'
           '"__builtins__"; it is strictly an implementation detail.  Users\n'
           'wanting to override values in the builtins namespace should '
           '"import"\n'
           'the "builtins" module and modify its attributes appropriately.\n'
           '\n'
           'The builtins namespace associated with the execution of a code '
           'block\n'
           'is actually found by looking up the name "__builtins__" in its '
           'global\n'
           'namespace; this should be a dictionary or a module (in the latter '
           'case\n'
           'the module’s dictionary is used).  By default, when in the '
           '"__main__"\n'
           'module, "__builtins__" is the built-in module "builtins"; when in '
           'any\n'
           'other module, "__builtins__" is an alias for the dictionary of '
           'the\n'
           '"builtins" module itself.\n'
           '\n'
           '\n'
           'Interaction with dynamic features\n'
           '=================================\n'
           '\n'
           'Name resolution of free variables occurs at runtime, not at '
           'compile\n'
           'time. This means that the following code will print 42:\n'
           '\n'
           '   i = 10\n'
           '   def f():\n'
           '       print(i)\n'
           '   i = 42\n'
           '   f()\n'
           '\n'
           'The "eval()" and "exec()" functions do not have access to the '
           'full\n'
           'environment for resolving names.  Names may be resolved in the '
           'local\n'
           'and global namespaces of the caller.  Free variables are not '
           'resolved\n'
           'in the nearest enclosing namespace, but in the global namespace.  '
           '[1]\n'
           'The "exec()" and "eval()" functions have optional arguments to\n'
           'override the global and local namespace.  If only one namespace '
           'is\n'
           'specified, it is used for both.\n',
 'nonlocal': 'The "nonlocal" statement\n'
             '************************\n'
             '\n'
             '   nonlocal_stmt ::= "nonlocal" identifier ("," identifier)*\n'
             '\n'
             'The "nonlocal" statement causes the listed identifiers to refer '
             'to\n'
             'previously bound variables in the nearest enclosing scope '
             'excluding\n'
             'globals. This is important because the default behavior for '
             'binding is\n'
             'to search the local namespace first.  The statement allows\n'
             'encapsulated code to rebind variables outside of the local '
             'scope\n'
             'besides the global (module) scope.\n'
             '\n'
             'Names listed in a "nonlocal" statement, unlike those listed in '
             'a\n'
             '"global" statement, must refer to pre-existing bindings in an\n'
             'enclosing scope (the scope in which a new binding should be '
             'created\n'
             'cannot be determined unambiguously).\n'
             '\n'
             'Names listed in a "nonlocal" statement must not collide with '
             'pre-\n'
             'existing bindings in the local scope.\n'
             '\n'
             'See also:\n'
             '\n'
             '  **PEP 3104** - Access to Names in Outer Scopes\n'
             '     The specification for the "nonlocal" statement.\n',
 'numbers': 'Numeric literals\n'
            '****************\n'
            '\n'
            'There are three types of numeric literals: integers, floating '
            'point\n'
            'numbers, and imaginary numbers.  There are no complex literals\n'
            '(complex numbers can be formed by adding a real number and an\n'
            'imaginary number).\n'
            '\n'
            'Note that numeric literals do not include a sign; a phrase like '
            '"-1"\n'
            'is actually an expression composed of the unary operator ‘"-"’ '
            'and the\n'
            'literal "1".\n',
 'numeric-types': 'Emulating numeric types\n'
                  '***********************\n'
                  '\n'
                  'The following methods can be defined to emulate numeric '
                  'objects.\n'
                  'Methods corresponding to operations that are not supported '
                  'by the\n'
                  'particular kind of number implemented (e.g., bitwise '
                  'operations for\n'
                  'non-integral numbers) should be left undefined.\n'
                  '\n'
                  'object.__add__(self, other)\n'
                  'object.__sub__(self, other)\n'
                  'object.__mul__(self, other)\n'
                  'object.__matmul__(self, other)\n'
                  'object.__truediv__(self, other)\n'
                  'object.__floordiv__(self, other)\n'
                  'object.__mod__(self, other)\n'
                  'object.__divmod__(self, other)\n'
                  'object.__pow__(self, other[, modulo])\n'
                  'object.__lshift__(self, other)\n'
                  'object.__rshift__(self, other)\n'
                  'object.__and__(self, other)\n'
                  'object.__xor__(self, other)\n'
                  'object.__or__(self, other)\n'
                  '\n'
                  '   These methods are called to implement the binary '
                  'arithmetic\n'
                  '   operations ("+", "-", "*", "@", "/", "//", "%", '
                  '"divmod()",\n'
                  '   "pow()", "**", "<<", ">>", "&", "^", "|").  For '
                  'instance, to\n'
                  '   evaluate the expression "x + y", where *x* is an '
                  'instance of a\n'
                  '   class that has an "__add__()" method, "x.__add__(y)" is '
                  'called.\n'
                  '   The "__divmod__()" method should be the equivalent to '
                  'using\n'
                  '   "__floordiv__()" and "__mod__()"; it should not be '
                  'related to\n'
                  '   "__truediv__()".  Note that "__pow__()" should be '
                  'defined to accept\n'
                  '   an optional third argument if the ternary version of the '
                  'built-in\n'
                  '   "pow()" function is to be supported.\n'
                  '\n'
                  '   If one of those methods does not support the operation '
                  'with the\n'
                  '   supplied arguments, it should return "NotImplemented".\n'
                  '\n'
                  'object.__radd__(self, other)\n'
                  'object.__rsub__(self, other)\n'
                  'object.__rmul__(self, other)\n'
                  'object.__rmatmul__(self, other)\n'
                  'object.__rtruediv__(self, other)\n'
                  'object.__rfloordiv__(self, other)\n'
                  'object.__rmod__(self, other)\n'
                  'object.__rdivmod__(self, other)\n'
                  'object.__rpow__(self, other[, modulo])\n'
                  'object.__rlshift__(self, other)\n'
                  'object.__rrshift__(self, other)\n'
                  'object.__rand__(self, other)\n'
                  'object.__rxor__(self, other)\n'
                  'object.__ror__(self, other)\n'
                  '\n'
                  '   These methods are called to implement the binary '
                  'arithmetic\n'
                  '   operations ("+", "-", "*", "@", "/", "//", "%", '
                  '"divmod()",\n'
                  '   "pow()", "**", "<<", ">>", "&", "^", "|") with reflected '
                  '(swapped)\n'
                  '   operands.  These functions are only called if the left '
                  'operand does\n'
                  '   not support the corresponding operation [3] and the '
                  'operands are of\n'
                  '   different types. [4] For instance, to evaluate the '
                  'expression "x -\n'
                  '   y", where *y* is an instance of a class that has an '
                  '"__rsub__()"\n'
                  '   method, "y.__rsub__(x)" is called if "x.__sub__(y)" '
                  'returns\n'
                  '   *NotImplemented*.\n'
                  '\n'
                  '   Note that ternary "pow()" will not try calling '
                  '"__rpow__()" (the\n'
                  '   coercion rules would become too complicated).\n'
                  '\n'
                  '   Note:\n'
                  '\n'
                  '     If the right operand’s type is a subclass of the left '
                  'operand’s\n'
                  '     type and that subclass provides a different '
                  'implementation of the\n'
                  '     reflected method for the operation, this method will '
                  'be called\n'
                  '     before the left operand’s non-reflected method. This '
                  'behavior\n'
                  '     allows subclasses to override their ancestors’ '
                  'operations.\n'
                  '\n'
                  'object.__iadd__(self, other)\n'
                  'object.__isub__(self, other)\n'
                  'object.__imul__(self, other)\n'
                  'object.__imatmul__(self, other)\n'
                  'object.__itruediv__(self, other)\n'
                  'object.__ifloordiv__(self, other)\n'
                  'object.__imod__(self, other)\n'
                  'object.__ipow__(self, other[, modulo])\n'
                  'object.__ilshift__(self, other)\n'
                  'object.__irshift__(self, other)\n'
                  'object.__iand__(self, other)\n'
                  'object.__ixor__(self, other)\n'
                  'object.__ior__(self, other)\n'
                  '\n'
                  '   These methods are called to implement the augmented '
                  'arithmetic\n'
                  '   assignments ("+=", "-=", "*=", "@=", "/=", "//=", "%=", '
                  '"**=",\n'
                  '   "<<=", ">>=", "&=", "^=", "|=").  These methods should '
                  'attempt to\n'
                  '   do the operation in-place (modifying *self*) and return '
                  'the result\n'
                  '   (which could be, but does not have to be, *self*).  If a '
                  'specific\n'
                  '   method is not defined, the augmented assignment falls '
                  'back to the\n'
                  '   normal methods.  For instance, if *x* is an instance of '
                  'a class\n'
                  '   with an "__iadd__()" method, "x += y" is equivalent to '
                  '"x =\n'
                  '   x.__iadd__(y)" . Otherwise, "x.__add__(y)" and '
                  '"y.__radd__(x)" are\n'
                  '   considered, as with the evaluation of "x + y". In '
                  'certain\n'
                  '   situations, augmented assignment can result in '
                  'unexpected errors\n'
                  '   (see Why does a_tuple[i] += [‘item’] raise an exception '
                  'when the\n'
                  '   addition works?), but this behavior is in fact part of '
                  'the data\n'
                  '   model.\n'
                  '\n'
                  '   Note:\n'
                  '\n'
                  '     Due to a bug in the dispatching mechanism for "**=", a '
                  'class that\n'
                  '     defines "__ipow__()" but returns "NotImplemented" '
                  'would fail to\n'
                  '     fall back to "x.__pow__(y)" and "y.__rpow__(x)". This '
                  'bug is\n'
                  '     fixed in Python 3.10.\n'
                  '\n'
                  'object.__neg__(self)\n'
                  'object.__pos__(self)\n'
                  'object.__abs__(self)\n'
                  'object.__invert__(self)\n'
                  '\n'
                  '   Called to implement the unary arithmetic operations '
                  '("-", "+",\n'
                  '   "abs()" and "~").\n'
                  '\n'
                  'object.__complex__(self)\n'
                  'object.__int__(self)\n'
                  'object.__float__(self)\n'
                  '\n'
                  '   Called to implement the built-in functions "complex()", '
                  '"int()" and\n'
                  '   "float()".  Should return a value of the appropriate '
                  'type.\n'
                  '\n'
                  'object.__index__(self)\n'
                  '\n'
                  '   Called to implement "operator.index()", and whenever '
                  'Python needs\n'
                  '   to losslessly convert the numeric object to an integer '
                  'object (such\n'
                  '   as in slicing, or in the built-in "bin()", "hex()" and '
                  '"oct()"\n'
                  '   functions). Presence of this method indicates that the '
                  'numeric\n'
                  '   object is an integer type.  Must return an integer.\n'
                  '\n'
                  '   If "__int__()", "__float__()" and "__complex__()" are '
                  'not defined\n'
                  '   then corresponding built-in functions "int()", "float()" '
                  'and\n'
                  '   "complex()" fall back to "__index__()".\n'
                  '\n'
                  'object.__round__(self[, ndigits])\n'
                  'object.__trunc__(self)\n'
                  'object.__floor__(self)\n'
                  'object.__ceil__(self)\n'
                  '\n'
                  '   Called to implement the built-in function "round()" and '
                  '"math"\n'
                  '   functions "trunc()", "floor()" and "ceil()". Unless '
                  '*ndigits* is\n'
                  '   passed to "__round__()" all these methods should return '
                  'the value\n'
                  '   of the object truncated to an "Integral" (typically an '
                  '"int").\n'
                  '\n'
                  '   The built-in function "int()" falls back to '
                  '"__trunc__()" if\n'
                  '   neither "__int__()" nor "__index__()" is defined.\n',
 'objects': 'Objects, values and types\n'
            '*************************\n'
            '\n'
            '*Objects* are Python’s abstraction for data.  All data in a '
            'Python\n'
            'program is represented by objects or by relations between '
            'objects. (In\n'
            'a sense, and in conformance to Von Neumann’s model of a “stored\n'
            'program computer”, code is also represented by objects.)\n'
            '\n'
            'Every object has an identity, a type and a value.  An object’s\n'
            '*identity* never changes once it has been created; you may think '
            'of it\n'
            'as the object’s address in memory.  The ‘"is"’ operator compares '
            'the\n'
            'identity of two objects; the "id()" function returns an integer\n'
            'representing its identity.\n'
            '\n'
            '**CPython implementation detail:** For CPython, "id(x)" is the '
            'memory\n'
            'address where "x" is stored.\n'
            '\n'
            'An object’s type determines the operations that the object '
            'supports\n'
            '(e.g., “does it have a length?”) and also defines the possible '
            'values\n'
            'for objects of that type.  The "type()" function returns an '
            'object’s\n'
            'type (which is an object itself).  Like its identity, an '
            'object’s\n'
            '*type* is also unchangeable. [1]\n'
            '\n'
            'The *value* of some objects can change.  Objects whose value can\n'
            'change are said to be *mutable*; objects whose value is '
            'unchangeable\n'
            'once they are created are called *immutable*. (The value of an\n'
            'immutable container object that contains a reference to a '
            'mutable\n'
            'object can change when the latter’s value is changed; however '
            'the\n'
            'container is still considered immutable, because the collection '
            'of\n'
            'objects it contains cannot be changed.  So, immutability is not\n'
            'strictly the same as having an unchangeable value, it is more '
            'subtle.)\n'
            'An object’s mutability is determined by its type; for instance,\n'
            'numbers, strings and tuples are immutable, while dictionaries '
            'and\n'
            'lists are mutable.\n'
            '\n'
            'Objects are never explicitly destroyed; however, when they '
            'become\n'
            'unreachable they may be garbage-collected.  An implementation is\n'
            'allowed to postpone garbage collection or omit it altogether — it '
            'is a\n'
            'matter of implementation quality how garbage collection is\n'
            'implemented, as long as no objects are collected that are still\n'
            'reachable.\n'
            '\n'
            '**CPython implementation detail:** CPython currently uses a '
            'reference-\n'
            'counting scheme with (optional) delayed detection of cyclically '
            'linked\n'
            'garbage, which collects most objects as soon as they become\n'
            'unreachable, but is not guaranteed to collect garbage containing\n'
            'circular references.  See the documentation of the "gc" module '
            'for\n'
            'information on controlling the collection of cyclic garbage. '
            'Other\n'
            'implementations act differently and CPython may change. Do not '
            'depend\n'
            'on immediate finalization of objects when they become unreachable '
            '(so\n'
            'you should always close files explicitly).\n'
            '\n'
            'Note that the use of the implementation’s tracing or debugging\n'
            'facilities may keep objects alive that would normally be '
            'collectable.\n'
            'Also note that catching an exception with a ‘"try"…"except"’ '
            'statement\n'
            'may keep objects alive.\n'
            '\n'
            'Some objects contain references to “external” resources such as '
            'open\n'
            'files or windows.  It is understood that these resources are '
            'freed\n'
            'when the object is garbage-collected, but since garbage '
            'collection is\n'
            'not guaranteed to happen, such objects also provide an explicit '
            'way to\n'
            'release the external resource, usually a "close()" method. '
            'Programs\n'
            'are strongly recommended to explicitly close such objects.  The\n'
            '‘"try"…"finally"’ statement and the ‘"with"’ statement provide\n'
            'convenient ways to do this.\n'
            '\n'
            'Some objects contain references to other objects; these are '
            'called\n'
            '*containers*. Examples of containers are tuples, lists and\n'
            'dictionaries.  The references are part of a container’s value.  '
            'In\n'
            'most cases, when we talk about the value of a container, we imply '
            'the\n'
            'values, not the identities of the contained objects; however, '
            'when we\n'
            'talk about the mutability of a container, only the identities of '
            'the\n'
            'immediately contained objects are implied.  So, if an immutable\n'
            'container (like a tuple) contains a reference to a mutable '
            'object, its\n'
            'value changes if that mutable object is changed.\n'
            '\n'
            'Types affect almost all aspects of object behavior.  Even the\n'
            'importance of object identity is affected in some sense: for '
            'immutable\n'
            'types, operations that compute new values may actually return a\n'
            'reference to any existing object with the same type and value, '
            'while\n'
            'for mutable objects this is not allowed.  E.g., after "a = 1; b = '
            '1",\n'
            '"a" and "b" may or may not refer to the same object with the '
            'value\n'
            'one, depending on the implementation, but after "c = []; d = []", '
            '"c"\n'
            'and "d" are guaranteed to refer to two different, unique, newly\n'
            'created empty lists. (Note that "c = d = []" assigns the same '
            'object\n'
            'to both "c" and "d".)\n',
 'operator-summary': 'Operator precedence\n'
                     '*******************\n'
                     '\n'
                     'The following table summarizes the operator precedence '
                     'in Python, from\n'
                     'lowest precedence (least binding) to highest precedence '
                     '(most\n'
                     'binding).  Operators in the same box have the same '
                     'precedence.  Unless\n'
                     'the syntax is explicitly given, operators are binary.  '
                     'Operators in\n'
                     'the same box group left to right (except for '
                     'exponentiation, which\n'
                     'groups from right to left).\n'
                     '\n'
                     'Note that comparisons, membership tests, and identity '
                     'tests, all have\n'
                     'the same precedence and have a left-to-right chaining '
                     'feature as\n'
                     'described in the Comparisons section.\n'
                     '\n'
                     '+-------------------------------------------------+---------------------------------------+\n'
                     '| Operator                                        | '
                     'Description                           |\n'
                     '|=================================================|=======================================|\n'
                     '| ":="                                            | '
                     'Assignment expression                 |\n'
                     '+-------------------------------------------------+---------------------------------------+\n'
                     '| "lambda"                                        | '
                     'Lambda expression                     |\n'
                     '+-------------------------------------------------+---------------------------------------+\n'
                     '| "if" – "else"                                   | '
                     'Conditional expression                |\n'
                     '+-------------------------------------------------+---------------------------------------+\n'
                     '| "or"                                            | '
                     'Boolean OR                            |\n'
                     '+-------------------------------------------------+---------------------------------------+\n'
                     '| "and"                                           | '
                     'Boolean AND                           |\n'
                     '+-------------------------------------------------+---------------------------------------+\n'
                     '| "not" "x"                                       | '
                     'Boolean NOT                           |\n'
                     '+-------------------------------------------------+---------------------------------------+\n'
                     '| "in", "not in", "is", "is not", "<", "<=", ">", | '
                     'Comparisons, including membership     |\n'
                     '| ">=", "!=", "=="                                | '
                     'tests and identity tests              |\n'
                     '+-------------------------------------------------+---------------------------------------+\n'
                     '| "|"                                             | '
                     'Bitwise OR                            |\n'
                     '+-------------------------------------------------+---------------------------------------+\n'
                     '| "^"                                             | '
                     'Bitwise XOR                           |\n'
                     '+-------------------------------------------------+---------------------------------------+\n'
                     '| "&"                                             | '
                     'Bitwise AND                           |\n'
                     '+-------------------------------------------------+---------------------------------------+\n'
                     '| "<<", ">>"                                      | '
                     'Shifts                                |\n'
                     '+-------------------------------------------------+---------------------------------------+\n'
                     '| "+", "-"                                        | '
                     'Addition and subtraction              |\n'
                     '+-------------------------------------------------+---------------------------------------+\n'
                     '| "*", "@", "/", "//", "%"                        | '
                     'Multiplication, matrix                |\n'
                     '|                                                 | '
                     'multiplication, division, floor       |\n'
                     '|                                                 | '
                     'division, remainder [5]               |\n'
                     '+-------------------------------------------------+---------------------------------------+\n'
                     '| "+x", "-x", "~x"                                | '
                     'Positive, negative, bitwise NOT       |\n'
                     '+-------------------------------------------------+---------------------------------------+\n'
                     '| "**"                                            | '
                     'Exponentiation [6]                    |\n'
                     '+-------------------------------------------------+---------------------------------------+\n'
                     '| "await" "x"                                     | '
                     'Await expression                      |\n'
                     '+-------------------------------------------------+---------------------------------------+\n'
                     '| "x[index]", "x[index:index]",                   | '
                     'Subscription, slicing, call,          |\n'
                     '| "x(arguments...)", "x.attribute"                | '
                     'attribute reference                   |\n'
                     '+-------------------------------------------------+---------------------------------------+\n'
                     '| "(expressions...)",  "[expressions...]", "{key: | '
                     'Binding or parenthesized expression,  |\n'
                     '| value...}", "{expressions...}"                  | list '
                     'display, dictionary display, set |\n'
                     '|                                                 | '
                     'display                               |\n'
                     '+-------------------------------------------------+---------------------------------------+\n'
                     '\n'
                     '-[ Footnotes ]-\n'
                     '\n'
                     '[1] While "abs(x%y) < abs(y)" is true mathematically, '
                     'for floats it\n'
                     '    may not be true numerically due to roundoff.  For '
                     'example, and\n'
                     '    assuming a platform on which a Python float is an '
                     'IEEE 754 double-\n'
                     '    precision number, in order that "-1e-100 % 1e100" '
                     'have the same\n'
                     '    sign as "1e100", the computed result is "-1e-100 + '
                     '1e100", which\n'
                     '    is numerically exactly equal to "1e100".  The '
                     'function\n'
                     '    "math.fmod()" returns a result whose sign matches '
                     'the sign of the\n'
                     '    first argument instead, and so returns "-1e-100" in '
                     'this case.\n'
                     '    Which approach is more appropriate depends on the '
                     'application.\n'
                     '\n'
                     '[2] If x is very close to an exact integer multiple of '
                     'y, it’s\n'
                     '    possible for "x//y" to be one larger than '
                     '"(x-x%y)//y" due to\n'
                     '    rounding.  In such cases, Python returns the latter '
                     'result, in\n'
                     '    order to preserve that "divmod(x,y)[0] * y + x % y" '
                     'be very close\n'
                     '    to "x".\n'
                     '\n'
                     '[3] The Unicode standard distinguishes between *code '
                     'points* (e.g.\n'
                     '    U+0041) and *abstract characters* (e.g. “LATIN '
                     'CAPITAL LETTER A”).\n'
                     '    While most abstract characters in Unicode are only '
                     'represented\n'
                     '    using one code point, there is a number of abstract '
                     'characters\n'
                     '    that can in addition be represented using a sequence '
                     'of more than\n'
                     '    one code point.  For example, the abstract character '
                     '“LATIN\n'
                     '    CAPITAL LETTER C WITH CEDILLA” can be represented as '
                     'a single\n'
                     '    *precomposed character* at code position U+00C7, or '
                     'as a sequence\n'
                     '    of a *base character* at code position U+0043 (LATIN '
                     'CAPITAL\n'
                     '    LETTER C), followed by a *combining character* at '
                     'code position\n'
                     '    U+0327 (COMBINING CEDILLA).\n'
                     '\n'
                     '    The comparison operators on strings compare at the '
                     'level of\n'
                     '    Unicode code points. This may be counter-intuitive '
                     'to humans.  For\n'
                     '    example, ""\\u00C7" == "\\u0043\\u0327"" is "False", '
                     'even though both\n'
                     '    strings represent the same abstract character “LATIN '
                     'CAPITAL\n'
                     '    LETTER C WITH CEDILLA”.\n'
                     '\n'
                     '    To compare strings at the level of abstract '
                     'characters (that is,\n'
                     '    in a way intuitive to humans), use '
                     '"unicodedata.normalize()".\n'
                     '\n'
                     '[4] Due to automatic garbage-collection, free lists, and '
                     'the dynamic\n'
                     '    nature of descriptors, you may notice seemingly '
                     'unusual behaviour\n'
                     '    in certain uses of the "is" operator, like those '
                     'involving\n'
                     '    comparisons between instance methods, or constants.  '
                     'Check their\n'
                     '    documentation for more info.\n'
                     '\n'
                     '[5] The "%" operator is also used for string formatting; '
                     'the same\n'
                     '    precedence applies.\n'
                     '\n'
                     '[6] The power operator "**" binds less tightly than an '
                     'arithmetic or\n'
                     '    bitwise unary operator on its right, that is, '
                     '"2**-1" is "0.5".\n',
 'pass': 'The "pass" statement\n'
         '********************\n'
         '\n'
         '   pass_stmt ::= "pass"\n'
         '\n'
         '"pass" is a null operation — when it is executed, nothing happens. '
         'It\n'
         'is useful as a placeholder when a statement is required '
         'syntactically,\n'
         'but no code needs to be executed, for example:\n'
         '\n'
         '   def f(arg): pass    # a function that does nothing (yet)\n'
         '\n'
         '   class C: pass       # a class with no methods (yet)\n',
 'power': 'The power operator\n'
          '******************\n'
          '\n'
          'The power operator binds more tightly than unary operators on its\n'
          'left; it binds less tightly than unary operators on its right.  '
          'The\n'
          'syntax is:\n'
          '\n'
          '   power ::= (await_expr | primary) ["**" u_expr]\n'
          '\n'
          'Thus, in an unparenthesized sequence of power and unary operators, '
          'the\n'
          'operators are evaluated from right to left (this does not '
          'constrain\n'
          'the evaluation order for the operands): "-1**2" results in "-1".\n'
          '\n'
          'The power operator has the same semantics as the built-in "pow()"\n'
          'function, when called with two arguments: it yields its left '
          'argument\n'
          'raised to the power of its right argument.  The numeric arguments '
          'are\n'
          'first converted to a common type, and the result is of that type.\n'
          '\n'
          'For int operands, the result has the same type as the operands '
          'unless\n'
          'the second argument is negative; in that case, all arguments are\n'
          'converted to float and a float result is delivered. For example,\n'
          '"10**2" returns "100", but "10**-2" returns "0.01".\n'
          '\n'
          'Raising "0.0" to a negative power results in a '
          '"ZeroDivisionError".\n'
          'Raising a negative number to a fractional power results in a '
          '"complex"\n'
          'number. (In earlier versions it raised a "ValueError".)\n',
 'raise': 'The "raise" statement\n'
          '*********************\n'
          '\n'
          '   raise_stmt ::= "raise" [expression ["from" expression]]\n'
          '\n'
          'If no expressions are present, "raise" re-raises the last '
          'exception\n'
          'that was active in the current scope.  If no exception is active '
          'in\n'
          'the current scope, a "RuntimeError" exception is raised indicating\n'
          'that this is an error.\n'
          '\n'
          'Otherwise, "raise" evaluates the first expression as the exception\n'
          'object.  It must be either a subclass or an instance of\n'
          '"BaseException". If it is a class, the exception instance will be\n'
          'obtained when needed by instantiating the class with no arguments.\n'
          '\n'
          'The *type* of the exception is the exception instance’s class, the\n'
          '*value* is the instance itself.\n'
          '\n'
          'A traceback object is normally created automatically when an '
          'exception\n'
          'is raised and attached to it as the "__traceback__" attribute, '
          'which\n'
          'is writable. You can create an exception and set your own traceback '
          'in\n'
          'one step using the "with_traceback()" exception method (which '
          'returns\n'
          'the same exception instance, with its traceback set to its '
          'argument),\n'
          'like so:\n'
          '\n'
          '   raise Exception("foo occurred").with_traceback(tracebackobj)\n'
          '\n'
          'The "from" clause is used for exception chaining: if given, the '
          'second\n'
          '*expression* must be another exception class or instance. If the\n'
          'second expression is an exception instance, it will be attached to '
          'the\n'
          'raised exception as the "__cause__" attribute (which is writable). '
          'If\n'
          'the expression is an exception class, the class will be '
          'instantiated\n'
          'and the resulting exception instance will be attached to the '
          'raised\n'
          'exception as the "__cause__" attribute. If the raised exception is '
          'not\n'
          'handled, both exceptions will be printed:\n'
          '\n'
          '   >>> try:\n'
          '   ...     print(1 / 0)\n'
          '   ... except Exception as exc:\n'
          '   ...     raise RuntimeError("Something bad happened") from exc\n'
          '   ...\n'
          '   Traceback (most recent call last):\n'
          '     File "<stdin>", line 2, in <module>\n'
          '   ZeroDivisionError: division by zero\n'
          '\n'
          '   The above exception was the direct cause of the following '
          'exception:\n'
          '\n'
          '   Traceback (most recent call last):\n'
          '     File "<stdin>", line 4, in <module>\n'
          '   RuntimeError: Something bad happened\n'
          '\n'
          'A similar mechanism works implicitly if an exception is raised '
          'inside\n'
          'an exception handler or a "finally" clause: the previous exception '
          'is\n'
          'then attached as the new exception’s "__context__" attribute:\n'
          '\n'
          '   >>> try:\n'
          '   ...     print(1 / 0)\n'
          '   ... except:\n'
          '   ...     raise RuntimeError("Something bad happened")\n'
          '   ...\n'
          '   Traceback (most recent call last):\n'
          '     File "<stdin>", line 2, in <module>\n'
          '   ZeroDivisionError: division by zero\n'
          '\n'
          '   During handling of the above exception, another exception '
          'occurred:\n'
          '\n'
          '   Traceback (most recent call last):\n'
          '     File "<stdin>", line 4, in <module>\n'
          '   RuntimeError: Something bad happened\n'
          '\n'
          'Exception chaining can be explicitly suppressed by specifying '
          '"None"\n'
          'in the "from" clause:\n'
          '\n'
          '   >>> try:\n'
          '   ...     print(1 / 0)\n'
          '   ... except:\n'
          '   ...     raise RuntimeError("Something bad happened") from None\n'
          '   ...\n'
          '   Traceback (most recent call last):\n'
          '     File "<stdin>", line 4, in <module>\n'
          '   RuntimeError: Something bad happened\n'
          '\n'
          'Additional information on exceptions can be found in section\n'
          'Exceptions, and information about handling exceptions is in '
          'section\n'
          'The try statement.\n'
          '\n'
          'Changed in version 3.3: "None" is now permitted as "Y" in "raise X\n'
          'from Y".\n'
          '\n'
          'New in version 3.3: The "__suppress_context__" attribute to '
          'suppress\n'
          'automatic display of the exception context.\n',
 'return': 'The "return" statement\n'
           '**********************\n'
           '\n'
           '   return_stmt ::= "return" [expression_list]\n'
           '\n'
           '"return" may only occur syntactically nested in a function '
           'definition,\n'
           'not within a nested class definition.\n'
           '\n'
           'If an expression list is present, it is evaluated, else "None" is\n'
           'substituted.\n'
           '\n'
           '"return" leaves the current function call with the expression list '
           '(or\n'
           '"None") as return value.\n'
           '\n'
           'When "return" passes control out of a "try" statement with a '
           '"finally"\n'
           'clause, that "finally" clause is executed before really leaving '
           'the\n'
           'function.\n'
           '\n'
           'In a generator function, the "return" statement indicates that '
           'the\n'
           'generator is done and will cause "StopIteration" to be raised. '
           'The\n'
           'returned value (if any) is used as an argument to construct\n'
           '"StopIteration" and becomes the "StopIteration.value" attribute.\n'
           '\n'
           'In an asynchronous generator function, an empty "return" '
           'statement\n'
           'indicates that the asynchronous generator is done and will cause\n'
           '"StopAsyncIteration" to be raised.  A non-empty "return" statement '
           'is\n'
           'a syntax error in an asynchronous generator function.\n',
 'sequence-types': 'Emulating container types\n'
                   '*************************\n'
                   '\n'
                   'The following methods can be defined to implement '
                   'container objects.\n'
                   'Containers usually are sequences (such as lists or tuples) '
                   'or mappings\n'
                   '(like dictionaries), but can represent other containers as '
                   'well.  The\n'
                   'first set of methods is used either to emulate a sequence '
                   'or to\n'
                   'emulate a mapping; the difference is that for a sequence, '
                   'the\n'
                   'allowable keys should be the integers *k* for which "0 <= '
                   'k < N" where\n'
                   '*N* is the length of the sequence, or slice objects, which '
                   'define a\n'
                   'range of items.  It is also recommended that mappings '
                   'provide the\n'
                   'methods "keys()", "values()", "items()", "get()", '
                   '"clear()",\n'
                   '"setdefault()", "pop()", "popitem()", "copy()", and '
                   '"update()"\n'
                   'behaving similar to those for Python’s standard dictionary '
                   'objects.\n'
                   'The "collections.abc" module provides a "MutableMapping" '
                   'abstract base\n'
                   'class to help create those methods from a base set of '
                   '"__getitem__()",\n'
                   '"__setitem__()", "__delitem__()", and "keys()". Mutable '
                   'sequences\n'
                   'should provide methods "append()", "count()", "index()", '
                   '"extend()",\n'
                   '"insert()", "pop()", "remove()", "reverse()" and "sort()", '
                   'like Python\n'
                   'standard list objects.  Finally, sequence types should '
                   'implement\n'
                   'addition (meaning concatenation) and multiplication '
                   '(meaning\n'
                   'repetition) by defining the methods "__add__()", '
                   '"__radd__()",\n'
                   '"__iadd__()", "__mul__()", "__rmul__()" and "__imul__()" '
                   'described\n'
                   'below; they should not define other numerical operators.  '
                   'It is\n'
                   'recommended that both mappings and sequences implement '
                   'the\n'
                   '"__contains__()" method to allow efficient use of the "in" '
                   'operator;\n'
                   'for mappings, "in" should search the mapping’s keys; for '
                   'sequences, it\n'
                   'should search through the values.  It is further '
                   'recommended that both\n'
                   'mappings and sequences implement the "__iter__()" method '
                   'to allow\n'
                   'efficient iteration through the container; for mappings, '
                   '"__iter__()"\n'
                   'should iterate through the object’s keys; for sequences, '
                   'it should\n'
                   'iterate through the values.\n'
                   '\n'
                   'object.__len__(self)\n'
                   '\n'
                   '   Called to implement the built-in function "len()".  '
                   'Should return\n'
                   '   the length of the object, an integer ">=" 0.  Also, an '
                   'object that\n'
                   '   doesn’t define a "__bool__()" method and whose '
                   '"__len__()" method\n'
                   '   returns zero is considered to be false in a Boolean '
                   'context.\n'
                   '\n'
                   '   **CPython implementation detail:** In CPython, the '
                   'length is\n'
                   '   required to be at most "sys.maxsize". If the length is '
                   'larger than\n'
                   '   "sys.maxsize" some features (such as "len()") may '
                   'raise\n'
                   '   "OverflowError".  To prevent raising "OverflowError" by '
                   'truth value\n'
                   '   testing, an object must define a "__bool__()" method.\n'
                   '\n'
                   'object.__length_hint__(self)\n'
                   '\n'
                   '   Called to implement "operator.length_hint()". Should '
                   'return an\n'
                   '   estimated length for the object (which may be greater '
                   'or less than\n'
                   '   the actual length). The length must be an integer ">=" '
                   '0. The\n'
                   '   return value may also be "NotImplemented", which is '
                   'treated the\n'
                   '   same as if the "__length_hint__" method didn’t exist at '
                   'all. This\n'
                   '   method is purely an optimization and is never required '
                   'for\n'
                   '   correctness.\n'
                   '\n'
                   '   New in version 3.4.\n'
                   '\n'
                   'Note:\n'
                   '\n'
                   '  Slicing is done exclusively with the following three '
                   'methods.  A\n'
                   '  call like\n'
                   '\n'
                   '     a[1:2] = b\n'
                   '\n'
                   '  is translated to\n'
                   '\n'
                   '     a[slice(1, 2, None)] = b\n'
                   '\n'
                   '  and so forth.  Missing slice items are always filled in '
                   'with "None".\n'
                   '\n'
                   'object.__getitem__(self, key)\n'
                   '\n'
                   '   Called to implement evaluation of "self[key]". For '
                   'sequence types,\n'
                   '   the accepted keys should be integers and slice '
                   'objects.  Note that\n'
                   '   the special interpretation of negative indexes (if the '
                   'class wishes\n'
                   '   to emulate a sequence type) is up to the '
                   '"__getitem__()" method. If\n'
                   '   *key* is of an inappropriate type, "TypeError" may be '
                   'raised; if of\n'
                   '   a value outside the set of indexes for the sequence '
                   '(after any\n'
                   '   special interpretation of negative values), '
                   '"IndexError" should be\n'
                   '   raised. For mapping types, if *key* is missing (not in '
                   'the\n'
                   '   container), "KeyError" should be raised.\n'
                   '\n'
                   '   Note:\n'
                   '\n'
                   '     "for" loops expect that an "IndexError" will be '
                   'raised for\n'
                   '     illegal indexes to allow proper detection of the end '
                   'of the\n'
                   '     sequence.\n'
                   '\n'
                   'object.__setitem__(self, key, value)\n'
                   '\n'
                   '   Called to implement assignment to "self[key]".  Same '
                   'note as for\n'
                   '   "__getitem__()".  This should only be implemented for '
                   'mappings if\n'
                   '   the objects support changes to the values for keys, or '
                   'if new keys\n'
                   '   can be added, or for sequences if elements can be '
                   'replaced.  The\n'
                   '   same exceptions should be raised for improper *key* '
                   'values as for\n'
                   '   the "__getitem__()" method.\n'
                   '\n'
                   'object.__delitem__(self, key)\n'
                   '\n'
                   '   Called to implement deletion of "self[key]".  Same note '
                   'as for\n'
                   '   "__getitem__()".  This should only be implemented for '
                   'mappings if\n'
                   '   the objects support removal of keys, or for sequences '
                   'if elements\n'
                   '   can be removed from the sequence.  The same exceptions '
                   'should be\n'
                   '   raised for improper *key* values as for the '
                   '"__getitem__()" method.\n'
                   '\n'
                   'object.__missing__(self, key)\n'
                   '\n'
                   '   Called by "dict"."__getitem__()" to implement '
                   '"self[key]" for dict\n'
                   '   subclasses when key is not in the dictionary.\n'
                   '\n'
                   'object.__iter__(self)\n'
                   '\n'
                   '   This method is called when an iterator is required for '
                   'a container.\n'
                   '   This method should return a new iterator object that '
                   'can iterate\n'
                   '   over all the objects in the container.  For mappings, '
                   'it should\n'
                   '   iterate over the keys of the container.\n'
                   '\n'
                   '   Iterator objects also need to implement this method; '
                   'they are\n'
                   '   required to return themselves.  For more information on '
                   'iterator\n'
                   '   objects, see Iterator Types.\n'
                   '\n'
                   'object.__reversed__(self)\n'
                   '\n'
                   '   Called (if present) by the "reversed()" built-in to '
                   'implement\n'
                   '   reverse iteration.  It should return a new iterator '
                   'object that\n'
                   '   iterates over all the objects in the container in '
                   'reverse order.\n'
                   '\n'
                   '   If the "__reversed__()" method is not provided, the '
                   '"reversed()"\n'
                   '   built-in will fall back to using the sequence protocol '
                   '("__len__()"\n'
                   '   and "__getitem__()").  Objects that support the '
                   'sequence protocol\n'
                   '   should only provide "__reversed__()" if they can '
                   'provide an\n'
                   '   implementation that is more efficient than the one '
                   'provided by\n'
                   '   "reversed()".\n'
                   '\n'
                   'The membership test operators ("in" and "not in") are '
                   'normally\n'
                   'implemented as an iteration through a container. However, '
                   'container\n'
                   'objects can supply the following special method with a '
                   'more efficient\n'
                   'implementation, which also does not require the object be '
                   'iterable.\n'
                   '\n'
                   'object.__contains__(self, item)\n'
                   '\n'
                   '   Called to implement membership test operators.  Should '
                   'return true\n'
                   '   if *item* is in *self*, false otherwise.  For mapping '
                   'objects, this\n'
                   '   should consider the keys of the mapping rather than the '
                   'values or\n'
                   '   the key-item pairs.\n'
                   '\n'
                   '   For objects that don’t define "__contains__()", the '
                   'membership test\n'
                   '   first tries iteration via "__iter__()", then the old '
                   'sequence\n'
                   '   iteration protocol via "__getitem__()", see this '
                   'section in the\n'
                   '   language reference.\n',
 'shifting': 'Shifting operations\n'
             '*******************\n'
             '\n'
             'The shifting operations have lower priority than the arithmetic\n'
             'operations:\n'
             '\n'
             '   shift_expr ::= a_expr | shift_expr ("<<" | ">>") a_expr\n'
             '\n'
             'These operators accept integers as arguments.  They shift the '
             'first\n'
             'argument to the left or right by the number of bits given by '
             'the\n'
             'second argument.\n'
             '\n'
             'A right shift by *n* bits is defined as floor division by '
             '"pow(2,n)".\n'
             'A left shift by *n* bits is defined as multiplication with '
             '"pow(2,n)".\n',
 'slicings': 'Slicings\n'
             '********\n'
             '\n'
             'A slicing selects a range of items in a sequence object (e.g., '
             'a\n'
             'string, tuple or list).  Slicings may be used as expressions or '
             'as\n'
             'targets in assignment or "del" statements.  The syntax for a '
             'slicing:\n'
             '\n'
             '   slicing      ::= primary "[" slice_list "]"\n'
             '   slice_list   ::= slice_item ("," slice_item)* [","]\n'
             '   slice_item   ::= expression | proper_slice\n'
             '   proper_slice ::= [lower_bound] ":" [upper_bound] [ ":" '
             '[stride] ]\n'
             '   lower_bound  ::= expression\n'
             '   upper_bound  ::= expression\n'
             '   stride       ::= expression\n'
             '\n'
             'There is ambiguity in the formal syntax here: anything that '
             'looks like\n'
             'an expression list also looks like a slice list, so any '
             'subscription\n'
             'can be interpreted as a slicing.  Rather than further '
             'complicating the\n'
             'syntax, this is disambiguated by defining that in this case the\n'
             'interpretation as a subscription takes priority over the\n'
             'interpretation as a slicing (this is the case if the slice list\n'
             'contains no proper slice).\n'
             '\n'
             'The semantics for a slicing are as follows.  The primary is '
             'indexed\n'
             '(using the same "__getitem__()" method as normal subscription) '
             'with a\n'
             'key that is constructed from the slice list, as follows.  If the '
             'slice\n'
             'list contains at least one comma, the key is a tuple containing '
             'the\n'
             'conversion of the slice items; otherwise, the conversion of the '
             'lone\n'
             'slice item is the key.  The conversion of a slice item that is '
             'an\n'
             'expression is that expression.  The conversion of a proper slice '
             'is a\n'
             'slice object (see section The standard type hierarchy) whose '
             '"start",\n'
             '"stop" and "step" attributes are the values of the expressions '
             'given\n'
             'as lower bound, upper bound and stride, respectively, '
             'substituting\n'
             '"None" for missing expressions.\n',
 'specialattrs': 'Special Attributes\n'
                 '******************\n'
                 '\n'
                 'The implementation adds a few special read-only attributes '
                 'to several\n'
                 'object types, where they are relevant.  Some of these are '
                 'not reported\n'
                 'by the "dir()" built-in function.\n'
                 '\n'
                 'object.__dict__\n'
                 '\n'
                 '   A dictionary or other mapping object used to store an '
                 'object’s\n'
                 '   (writable) attributes.\n'
                 '\n'
                 'instance.__class__\n'
                 '\n'
                 '   The class to which a class instance belongs.\n'
                 '\n'
                 'class.__bases__\n'
                 '\n'
                 '   The tuple of base classes of a class object.\n'
                 '\n'
                 'definition.__name__\n'
                 '\n'
                 '   The name of the class, function, method, descriptor, or '
                 'generator\n'
                 '   instance.\n'
                 '\n'
                 'definition.__qualname__\n'
                 '\n'
                 '   The *qualified name* of the class, function, method, '
                 'descriptor, or\n'
                 '   generator instance.\n'
                 '\n'
                 '   New in version 3.3.\n'
                 '\n'
                 'class.__mro__\n'
                 '\n'
                 '   This attribute is a tuple of classes that are considered '
                 'when\n'
                 '   looking for base classes during method resolution.\n'
                 '\n'
                 'class.mro()\n'
                 '\n'
                 '   This method can be overridden by a metaclass to customize '
                 'the\n'
                 '   method resolution order for its instances.  It is called '
                 'at class\n'
                 '   instantiation, and its result is stored in "__mro__".\n'
                 '\n'
                 'class.__subclasses__()\n'
                 '\n'
                 '   Each class keeps a list of weak references to its '
                 'immediate\n'
                 '   subclasses.  This method returns a list of all those '
                 'references\n'
                 '   still alive. Example:\n'
                 '\n'
                 '      >>> int.__subclasses__()\n'
                 "      [<class 'bool'>]\n",
 'specialnames': 'Special method names\n'
                 '********************\n'
                 '\n'
                 'A class can implement certain operations that are invoked by '
                 'special\n'
                 'syntax (such as arithmetic operations or subscripting and '
                 'slicing) by\n'
                 'defining methods with special names. This is Python’s '
                 'approach to\n'
                 '*operator overloading*, allowing classes to define their own '
                 'behavior\n'
                 'with respect to language operators.  For instance, if a '
                 'class defines\n'
                 'a method named "__getitem__()", and "x" is an instance of '
                 'this class,\n'
                 'then "x[i]" is roughly equivalent to "type(x).__getitem__(x, '
                 'i)".\n'
                 'Except where mentioned, attempts to execute an operation '
                 'raise an\n'
                 'exception when no appropriate method is defined (typically\n'
                 '"AttributeError" or "TypeError").\n'
                 '\n'
                 'Setting a special method to "None" indicates that the '
                 'corresponding\n'
                 'operation is not available.  For example, if a class sets '
                 '"__iter__()"\n'
                 'to "None", the class is not iterable, so calling "iter()" on '
                 'its\n'
                 'instances will raise a "TypeError" (without falling back to\n'
                 '"__getitem__()"). [2]\n'
                 '\n'
                 'When implementing a class that emulates any built-in type, '
                 'it is\n'
                 'important that the emulation only be implemented to the '
                 'degree that it\n'
                 'makes sense for the object being modelled.  For example, '
                 'some\n'
                 'sequences may work well with retrieval of individual '
                 'elements, but\n'
                 'extracting a slice may not make sense.  (One example of this '
                 'is the\n'
                 '"NodeList" interface in the W3C’s Document Object Model.)\n'
                 '\n'
                 '\n'
                 'Basic customization\n'
                 '===================\n'
                 '\n'
                 'object.__new__(cls[, ...])\n'
                 '\n'
                 '   Called to create a new instance of class *cls*.  '
                 '"__new__()" is a\n'
                 '   static method (special-cased so you need not declare it '
                 'as such)\n'
                 '   that takes the class of which an instance was requested '
                 'as its\n'
                 '   first argument.  The remaining arguments are those passed '
                 'to the\n'
                 '   object constructor expression (the call to the class).  '
                 'The return\n'
                 '   value of "__new__()" should be the new object instance '
                 '(usually an\n'
                 '   instance of *cls*).\n'
                 '\n'
                 '   Typical implementations create a new instance of the '
                 'class by\n'
                 '   invoking the superclass’s "__new__()" method using\n'
                 '   "super().__new__(cls[, ...])" with appropriate arguments '
                 'and then\n'
                 '   modifying the newly-created instance as necessary before '
                 'returning\n'
                 '   it.\n'
                 '\n'
                 '   If "__new__()" is invoked during object construction and '
                 'it returns\n'
                 '   an instance of *cls*, then the new instance’s '
                 '"__init__()" method\n'
                 '   will be invoked like "__init__(self[, ...])", where '
                 '*self* is the\n'
                 '   new instance and the remaining arguments are the same as '
                 'were\n'
                 '   passed to the object constructor.\n'
                 '\n'
                 '   If "__new__()" does not return an instance of *cls*, then '
                 'the new\n'
                 '   instance’s "__init__()" method will not be invoked.\n'
                 '\n'
                 '   "__new__()" is intended mainly to allow subclasses of '
                 'immutable\n'
                 '   types (like int, str, or tuple) to customize instance '
                 'creation.  It\n'
                 '   is also commonly overridden in custom metaclasses in '
                 'order to\n'
                 '   customize class creation.\n'
                 '\n'
                 'object.__init__(self[, ...])\n'
                 '\n'
                 '   Called after the instance has been created (by '
                 '"__new__()"), but\n'
                 '   before it is returned to the caller.  The arguments are '
                 'those\n'
                 '   passed to the class constructor expression.  If a base '
                 'class has an\n'
                 '   "__init__()" method, the derived class’s "__init__()" '
                 'method, if\n'
                 '   any, must explicitly call it to ensure proper '
                 'initialization of the\n'
                 '   base class part of the instance; for example:\n'
                 '   "super().__init__([args...])".\n'
                 '\n'
                 '   Because "__new__()" and "__init__()" work together in '
                 'constructing\n'
                 '   objects ("__new__()" to create it, and "__init__()" to '
                 'customize\n'
                 '   it), no non-"None" value may be returned by "__init__()"; '
                 'doing so\n'
                 '   will cause a "TypeError" to be raised at runtime.\n'
                 '\n'
                 'object.__del__(self)\n'
                 '\n'
                 '   Called when the instance is about to be destroyed.  This '
                 'is also\n'
                 '   called a finalizer or (improperly) a destructor.  If a '
                 'base class\n'
                 '   has a "__del__()" method, the derived class’s "__del__()" '
                 'method,\n'
                 '   if any, must explicitly call it to ensure proper deletion '
                 'of the\n'
                 '   base class part of the instance.\n'
                 '\n'
                 '   It is possible (though not recommended!) for the '
                 '"__del__()" method\n'
                 '   to postpone destruction of the instance by creating a new '
                 'reference\n'
                 '   to it.  This is called object *resurrection*.  It is\n'
                 '   implementation-dependent whether "__del__()" is called a '
                 'second\n'
                 '   time when a resurrected object is about to be destroyed; '
                 'the\n'
                 '   current *CPython* implementation only calls it once.\n'
                 '\n'
                 '   It is not guaranteed that "__del__()" methods are called '
                 'for\n'
                 '   objects that still exist when the interpreter exits.\n'
                 '\n'
                 '   Note:\n'
                 '\n'
                 '     "del x" doesn’t directly call "x.__del__()" — the '
                 'former\n'
                 '     decrements the reference count for "x" by one, and the '
                 'latter is\n'
                 '     only called when "x"’s reference count reaches zero.\n'
                 '\n'
                 '   **CPython implementation detail:** It is possible for a '
                 'reference\n'
                 '   cycle to prevent the reference count of an object from '
                 'going to\n'
                 '   zero.  In this case, the cycle will be later detected and '
                 'deleted\n'
                 '   by the *cyclic garbage collector*.  A common cause of '
                 'reference\n'
                 '   cycles is when an exception has been caught in a local '
                 'variable.\n'
                 '   The frame’s locals then reference the exception, which '
                 'references\n'
                 '   its own traceback, which references the locals of all '
                 'frames caught\n'
                 '   in the traceback.\n'
                 '\n'
                 '   See also: Documentation for the "gc" module.\n'
                 '\n'
                 '   Warning:\n'
                 '\n'
                 '     Due to the precarious circumstances under which '
                 '"__del__()"\n'
                 '     methods are invoked, exceptions that occur during their '
                 'execution\n'
                 '     are ignored, and a warning is printed to "sys.stderr" '
                 'instead.\n'
                 '     In particular:\n'
                 '\n'
                 '     * "__del__()" can be invoked when arbitrary code is '
                 'being\n'
                 '       executed, including from any arbitrary thread.  If '
                 '"__del__()"\n'
                 '       needs to take a lock or invoke any other blocking '
                 'resource, it\n'
                 '       may deadlock as the resource may already be taken by '
                 'the code\n'
                 '       that gets interrupted to execute "__del__()".\n'
                 '\n'
                 '     * "__del__()" can be executed during interpreter '
                 'shutdown.  As a\n'
                 '       consequence, the global variables it needs to access '
                 '(including\n'
                 '       other modules) may already have been deleted or set '
                 'to "None".\n'
                 '       Python guarantees that globals whose name begins with '
                 'a single\n'
                 '       underscore are deleted from their module before other '
                 'globals\n'
                 '       are deleted; if no other references to such globals '
                 'exist, this\n'
                 '       may help in assuring that imported modules are still '
                 'available\n'
                 '       at the time when the "__del__()" method is called.\n'
                 '\n'
                 'object.__repr__(self)\n'
                 '\n'
                 '   Called by the "repr()" built-in function to compute the '
                 '“official”\n'
                 '   string representation of an object.  If at all possible, '
                 'this\n'
                 '   should look like a valid Python expression that could be '
                 'used to\n'
                 '   recreate an object with the same value (given an '
                 'appropriate\n'
                 '   environment).  If this is not possible, a string of the '
                 'form\n'
                 '   "<...some useful description...>" should be returned. The '
                 'return\n'
                 '   value must be a string object. If a class defines '
                 '"__repr__()" but\n'
                 '   not "__str__()", then "__repr__()" is also used when an '
                 '“informal”\n'
                 '   string representation of instances of that class is '
                 'required.\n'
                 '\n'
                 '   This is typically used for debugging, so it is important '
                 'that the\n'
                 '   representation is information-rich and unambiguous.\n'
                 '\n'
                 'object.__str__(self)\n'
                 '\n'
                 '   Called by "str(object)" and the built-in functions '
                 '"format()" and\n'
                 '   "print()" to compute the “informal” or nicely printable '
                 'string\n'
                 '   representation of an object.  The return value must be a '
                 'string\n'
                 '   object.\n'
                 '\n'
                 '   This method differs from "object.__repr__()" in that '
                 'there is no\n'
                 '   expectation that "__str__()" return a valid Python '
                 'expression: a\n'
                 '   more convenient or concise representation can be used.\n'
                 '\n'
                 '   The default implementation defined by the built-in type '
                 '"object"\n'
                 '   calls "object.__repr__()".\n'
                 '\n'
                 'object.__bytes__(self)\n'
                 '\n'
                 '   Called by bytes to compute a byte-string representation '
                 'of an\n'
                 '   object. This should return a "bytes" object.\n'
                 '\n'
                 'object.__format__(self, format_spec)\n'
                 '\n'
                 '   Called by the "format()" built-in function, and by '
                 'extension,\n'
                 '   evaluation of formatted string literals and the '
                 '"str.format()"\n'
                 '   method, to produce a “formatted” string representation of '
                 'an\n'
                 '   object. The *format_spec* argument is a string that '
                 'contains a\n'
                 '   description of the formatting options desired. The '
                 'interpretation\n'
                 '   of the *format_spec* argument is up to the type '
                 'implementing\n'
                 '   "__format__()", however most classes will either '
                 'delegate\n'
                 '   formatting to one of the built-in types, or use a '
                 'similar\n'
                 '   formatting option syntax.\n'
                 '\n'
                 '   See Format Specification Mini-Language for a description '
                 'of the\n'
                 '   standard formatting syntax.\n'
                 '\n'
                 '   The return value must be a string object.\n'
                 '\n'
                 '   Changed in version 3.4: The __format__ method of "object" '
                 'itself\n'
                 '   raises a "TypeError" if passed any non-empty string.\n'
                 '\n'
                 '   Changed in version 3.7: "object.__format__(x, \'\')" is '
                 'now\n'
                 '   equivalent to "str(x)" rather than "format(str(self), '
                 '\'\')".\n'
                 '\n'
                 'object.__lt__(self, other)\n'
                 'object.__le__(self, other)\n'
                 'object.__eq__(self, other)\n'
                 'object.__ne__(self, other)\n'
                 'object.__gt__(self, other)\n'
                 'object.__ge__(self, other)\n'
                 '\n'
                 '   These are the so-called “rich comparison” methods. The\n'
                 '   correspondence between operator symbols and method names '
                 'is as\n'
                 '   follows: "x<y" calls "x.__lt__(y)", "x<=y" calls '
                 '"x.__le__(y)",\n'
                 '   "x==y" calls "x.__eq__(y)", "x!=y" calls "x.__ne__(y)", '
                 '"x>y" calls\n'
                 '   "x.__gt__(y)", and "x>=y" calls "x.__ge__(y)".\n'
                 '\n'
                 '   A rich comparison method may return the singleton '
                 '"NotImplemented"\n'
                 '   if it does not implement the operation for a given pair '
                 'of\n'
                 '   arguments. By convention, "False" and "True" are returned '
                 'for a\n'
                 '   successful comparison. However, these methods can return '
                 'any value,\n'
                 '   so if the comparison operator is used in a Boolean '
                 'context (e.g.,\n'
                 '   in the condition of an "if" statement), Python will call '
                 '"bool()"\n'
                 '   on the value to determine if the result is true or '
                 'false.\n'
                 '\n'
                 '   By default, "object" implements "__eq__()" by using "is", '
                 'returning\n'
                 '   "NotImplemented" in the case of a false comparison: "True '
                 'if x is y\n'
                 '   else NotImplemented". For "__ne__()", by default it '
                 'delegates to\n'
                 '   "__eq__()" and inverts the result unless it is '
                 '"NotImplemented".\n'
                 '   There are no other implied relationships among the '
                 'comparison\n'
                 '   operators or default implementations; for example, the '
                 'truth of\n'
                 '   "(x<y or x==y)" does not imply "x<=y". To automatically '
                 'generate\n'
                 '   ordering operations from a single root operation, see\n'
                 '   "functools.total_ordering()".\n'
                 '\n'
                 '   See the paragraph on "__hash__()" for some important '
                 'notes on\n'
                 '   creating *hashable* objects which support custom '
                 'comparison\n'
                 '   operations and are usable as dictionary keys.\n'
                 '\n'
                 '   There are no swapped-argument versions of these methods '
                 '(to be used\n'
                 '   when the left argument does not support the operation but '
                 'the right\n'
                 '   argument does); rather, "__lt__()" and "__gt__()" are '
                 'each other’s\n'
                 '   reflection, "__le__()" and "__ge__()" are each other’s '
                 'reflection,\n'
                 '   and "__eq__()" and "__ne__()" are their own reflection. '
                 'If the\n'
                 '   operands are of different types, and right operand’s type '
                 'is a\n'
                 '   direct or indirect subclass of the left operand’s type, '
                 'the\n'
                 '   reflected method of the right operand has priority, '
                 'otherwise the\n'
                 '   left operand’s method has priority.  Virtual subclassing '
                 'is not\n'
                 '   considered.\n'
                 '\n'
                 'object.__hash__(self)\n'
                 '\n'
                 '   Called by built-in function "hash()" and for operations '
                 'on members\n'
                 '   of hashed collections including "set", "frozenset", and '
                 '"dict".\n'
                 '   "__hash__()" should return an integer. The only required '
                 'property\n'
                 '   is that objects which compare equal have the same hash '
                 'value; it is\n'
                 '   advised to mix together the hash values of the components '
                 'of the\n'
                 '   object that also play a part in comparison of objects by '
                 'packing\n'
                 '   them into a tuple and hashing the tuple. Example:\n'
                 '\n'
                 '      def __hash__(self):\n'
                 '          return hash((self.name, self.nick, self.color))\n'
                 '\n'
                 '   Note:\n'
                 '\n'
                 '     "hash()" truncates the value returned from an object’s '
                 'custom\n'
                 '     "__hash__()" method to the size of a "Py_ssize_t".  '
                 'This is\n'
                 '     typically 8 bytes on 64-bit builds and 4 bytes on '
                 '32-bit builds.\n'
                 '     If an object’s   "__hash__()" must interoperate on '
                 'builds of\n'
                 '     different bit sizes, be sure to check the width on all '
                 'supported\n'
                 '     builds.  An easy way to do this is with "python -c '
                 '"import sys;\n'
                 '     print(sys.hash_info.width)"".\n'
                 '\n'
                 '   If a class does not define an "__eq__()" method it should '
                 'not\n'
                 '   define a "__hash__()" operation either; if it defines '
                 '"__eq__()"\n'
                 '   but not "__hash__()", its instances will not be usable as '
                 'items in\n'
                 '   hashable collections.  If a class defines mutable objects '
                 'and\n'
                 '   implements an "__eq__()" method, it should not implement\n'
                 '   "__hash__()", since the implementation of hashable '
                 'collections\n'
                 '   requires that a key’s hash value is immutable (if the '
                 'object’s hash\n'
                 '   value changes, it will be in the wrong hash bucket).\n'
                 '\n'
                 '   User-defined classes have "__eq__()" and "__hash__()" '
                 'methods by\n'
                 '   default; with them, all objects compare unequal (except '
                 'with\n'
                 '   themselves) and "x.__hash__()" returns an appropriate '
                 'value such\n'
                 '   that "x == y" implies both that "x is y" and "hash(x) == '
                 'hash(y)".\n'
                 '\n'
                 '   A class that overrides "__eq__()" and does not define '
                 '"__hash__()"\n'
                 '   will have its "__hash__()" implicitly set to "None".  '
                 'When the\n'
                 '   "__hash__()" method of a class is "None", instances of '
                 'the class\n'
                 '   will raise an appropriate "TypeError" when a program '
                 'attempts to\n'
                 '   retrieve their hash value, and will also be correctly '
                 'identified as\n'
                 '   unhashable when checking "isinstance(obj,\n'
                 '   collections.abc.Hashable)".\n'
                 '\n'
                 '   If a class that overrides "__eq__()" needs to retain the\n'
                 '   implementation of "__hash__()" from a parent class, the '
                 'interpreter\n'
                 '   must be told this explicitly by setting "__hash__ =\n'
                 '   <ParentClass>.__hash__".\n'
                 '\n'
                 '   If a class that does not override "__eq__()" wishes to '
                 'suppress\n'
                 '   hash support, it should include "__hash__ = None" in the '
                 'class\n'
                 '   definition. A class which defines its own "__hash__()" '
                 'that\n'
                 '   explicitly raises a "TypeError" would be incorrectly '
                 'identified as\n'
                 '   hashable by an "isinstance(obj, '
                 'collections.abc.Hashable)" call.\n'
                 '\n'
                 '   Note:\n'
                 '\n'
                 '     By default, the "__hash__()" values of str and bytes '
                 'objects are\n'
                 '     “salted” with an unpredictable random value.  Although '
                 'they\n'
                 '     remain constant within an individual Python process, '
                 'they are not\n'
                 '     predictable between repeated invocations of Python.This '
                 'is\n'
                 '     intended to provide protection against a '
                 'denial-of-service caused\n'
                 '     by carefully-chosen inputs that exploit the worst case\n'
                 '     performance of a dict insertion, O(n^2) complexity.  '
                 'See\n'
                 '     http://www.ocert.org/advisories/ocert-2011-003.html '
                 'for\n'
                 '     details.Changing hash values affects the iteration '
                 'order of sets.\n'
                 '     Python has never made guarantees about this ordering '
                 '(and it\n'
                 '     typically varies between 32-bit and 64-bit builds).See '
                 'also\n'
                 '     "PYTHONHASHSEED".\n'
                 '\n'
                 '   Changed in version 3.3: Hash randomization is enabled by '
                 'default.\n'
                 '\n'
                 'object.__bool__(self)\n'
                 '\n'
                 '   Called to implement truth value testing and the built-in '
                 'operation\n'
                 '   "bool()"; should return "False" or "True".  When this '
                 'method is not\n'
                 '   defined, "__len__()" is called, if it is defined, and the '
                 'object is\n'
                 '   considered true if its result is nonzero.  If a class '
                 'defines\n'
                 '   neither "__len__()" nor "__bool__()", all its instances '
                 'are\n'
                 '   considered true.\n'
                 '\n'
                 '\n'
                 'Customizing attribute access\n'
                 '============================\n'
                 '\n'
                 'The following methods can be defined to customize the '
                 'meaning of\n'
                 'attribute access (use of, assignment to, or deletion of '
                 '"x.name") for\n'
                 'class instances.\n'
                 '\n'
                 'object.__getattr__(self, name)\n'
                 '\n'
                 '   Called when the default attribute access fails with an\n'
                 '   "AttributeError" (either "__getattribute__()" raises an\n'
                 '   "AttributeError" because *name* is not an instance '
                 'attribute or an\n'
                 '   attribute in the class tree for "self"; or "__get__()" of '
                 'a *name*\n'
                 '   property raises "AttributeError").  This method should '
                 'either\n'
                 '   return the (computed) attribute value or raise an '
                 '"AttributeError"\n'
                 '   exception.\n'
                 '\n'
                 '   Note that if the attribute is found through the normal '
                 'mechanism,\n'
                 '   "__getattr__()" is not called.  (This is an intentional '
                 'asymmetry\n'
                 '   between "__getattr__()" and "__setattr__()".) This is '
                 'done both for\n'
                 '   efficiency reasons and because otherwise "__getattr__()" '
                 'would have\n'
                 '   no way to access other attributes of the instance.  Note '
                 'that at\n'
                 '   least for instance variables, you can fake total control '
                 'by not\n'
                 '   inserting any values in the instance attribute dictionary '
                 '(but\n'
                 '   instead inserting them in another object).  See the\n'
                 '   "__getattribute__()" method below for a way to actually '
                 'get total\n'
                 '   control over attribute access.\n'
                 '\n'
                 'object.__getattribute__(self, name)\n'
                 '\n'
                 '   Called unconditionally to implement attribute accesses '
                 'for\n'
                 '   instances of the class. If the class also defines '
                 '"__getattr__()",\n'
                 '   the latter will not be called unless "__getattribute__()" '
                 'either\n'
                 '   calls it explicitly or raises an "AttributeError". This '
                 'method\n'
                 '   should return the (computed) attribute value or raise an\n'
                 '   "AttributeError" exception. In order to avoid infinite '
                 'recursion in\n'
                 '   this method, its implementation should always call the '
                 'base class\n'
                 '   method with the same name to access any attributes it '
                 'needs, for\n'
                 '   example, "object.__getattribute__(self, name)".\n'
                 '\n'
                 '   Note:\n'
                 '\n'
                 '     This method may still be bypassed when looking up '
                 'special methods\n'
                 '     as the result of implicit invocation via language '
                 'syntax or\n'
                 '     built-in functions. See Special method lookup.\n'
                 '\n'
                 '   For certain sensitive attribute accesses, raises an '
                 'auditing event\n'
                 '   "object.__getattr__" with arguments "obj" and "name".\n'
                 '\n'
                 'object.__setattr__(self, name, value)\n'
                 '\n'
                 '   Called when an attribute assignment is attempted.  This '
                 'is called\n'
                 '   instead of the normal mechanism (i.e. store the value in '
                 'the\n'
                 '   instance dictionary). *name* is the attribute name, '
                 '*value* is the\n'
                 '   value to be assigned to it.\n'
                 '\n'
                 '   If "__setattr__()" wants to assign to an instance '
                 'attribute, it\n'
                 '   should call the base class method with the same name, for '
                 'example,\n'
                 '   "object.__setattr__(self, name, value)".\n'
                 '\n'
                 '   For certain sensitive attribute assignments, raises an '
                 'auditing\n'
                 '   event "object.__setattr__" with arguments "obj", "name", '
                 '"value".\n'
                 '\n'
                 'object.__delattr__(self, name)\n'
                 '\n'
                 '   Like "__setattr__()" but for attribute deletion instead '
                 'of\n'
                 '   assignment.  This should only be implemented if "del '
                 'obj.name" is\n'
                 '   meaningful for the object.\n'
                 '\n'
                 '   For certain sensitive attribute deletions, raises an '
                 'auditing event\n'
                 '   "object.__delattr__" with arguments "obj" and "name".\n'
                 '\n'
                 'object.__dir__(self)\n'
                 '\n'
                 '   Called when "dir()" is called on the object. A sequence '
                 'must be\n'
                 '   returned. "dir()" converts the returned sequence to a '
                 'list and\n'
                 '   sorts it.\n'
                 '\n'
                 '\n'
                 'Customizing module attribute access\n'
                 '-----------------------------------\n'
                 '\n'
                 'Special names "__getattr__" and "__dir__" can be also used '
                 'to\n'
                 'customize access to module attributes. The "__getattr__" '
                 'function at\n'
                 'the module level should accept one argument which is the '
                 'name of an\n'
                 'attribute and return the computed value or raise an '
                 '"AttributeError".\n'
                 'If an attribute is not found on a module object through the '
                 'normal\n'
                 'lookup, i.e. "object.__getattribute__()", then "__getattr__" '
                 'is\n'
                 'searched in the module "__dict__" before raising an '
                 '"AttributeError".\n'
                 'If found, it is called with the attribute name and the '
                 'result is\n'
                 'returned.\n'
                 '\n'
                 'The "__dir__" function should accept no arguments, and '
                 'return a\n'
                 'sequence of strings that represents the names accessible on '
                 'module. If\n'
                 'present, this function overrides the standard "dir()" search '
                 'on a\n'
                 'module.\n'
                 '\n'
                 'For a more fine grained customization of the module behavior '
                 '(setting\n'
                 'attributes, properties, etc.), one can set the "__class__" '
                 'attribute\n'
                 'of a module object to a subclass of "types.ModuleType". For '
                 'example:\n'
                 '\n'
                 '   import sys\n'
                 '   from types import ModuleType\n'
                 '\n'
                 '   class VerboseModule(ModuleType):\n'
                 '       def __repr__(self):\n'
                 "           return f'Verbose {self.__name__}'\n"
                 '\n'
                 '       def __setattr__(self, attr, value):\n'
                 "           print(f'Setting {attr}...')\n"
                 '           super().__setattr__(attr, value)\n'
                 '\n'
                 '   sys.modules[__name__].__class__ = VerboseModule\n'
                 '\n'
                 'Note:\n'
                 '\n'
                 '  Defining module "__getattr__" and setting module '
                 '"__class__" only\n'
                 '  affect lookups made using the attribute access syntax – '
                 'directly\n'
                 '  accessing the module globals (whether by code within the '
                 'module, or\n'
                 '  via a reference to the module’s globals dictionary) is '
                 'unaffected.\n'
                 '\n'
                 'Changed in version 3.5: "__class__" module attribute is now '
                 'writable.\n'
                 '\n'
                 'New in version 3.7: "__getattr__" and "__dir__" module '
                 'attributes.\n'
                 '\n'
                 'See also:\n'
                 '\n'
                 '  **PEP 562** - Module __getattr__ and __dir__\n'
                 '     Describes the "__getattr__" and "__dir__" functions on '
                 'modules.\n'
                 '\n'
                 '\n'
                 'Implementing Descriptors\n'
                 '------------------------\n'
                 '\n'
                 'The following methods only apply when an instance of the '
                 'class\n'
                 'containing the method (a so-called *descriptor* class) '
                 'appears in an\n'
                 '*owner* class (the descriptor must be in either the owner’s '
                 'class\n'
                 'dictionary or in the class dictionary for one of its '
                 'parents).  In the\n'
                 'examples below, “the attribute” refers to the attribute '
                 'whose name is\n'
                 'the key of the property in the owner class’ "__dict__".\n'
                 '\n'
                 'object.__get__(self, instance, owner=None)\n'
                 '\n'
                 '   Called to get the attribute of the owner class (class '
                 'attribute\n'
                 '   access) or of an instance of that class (instance '
                 'attribute\n'
                 '   access). The optional *owner* argument is the owner '
                 'class, while\n'
                 '   *instance* is the instance that the attribute was '
                 'accessed through,\n'
                 '   or "None" when the attribute is accessed through the '
                 '*owner*.\n'
                 '\n'
                 '   This method should return the computed attribute value or '
                 'raise an\n'
                 '   "AttributeError" exception.\n'
                 '\n'
                 '   **PEP 252** specifies that "__get__()" is callable with '
                 'one or two\n'
                 '   arguments.  Python’s own built-in descriptors support '
                 'this\n'
                 '   specification; however, it is likely that some '
                 'third-party tools\n'
                 '   have descriptors that require both arguments.  Python’s '
                 'own\n'
                 '   "__getattribute__()" implementation always passes in both '
                 'arguments\n'
                 '   whether they are required or not.\n'
                 '\n'
                 'object.__set__(self, instance, value)\n'
                 '\n'
                 '   Called to set the attribute on an instance *instance* of '
                 'the owner\n'
                 '   class to a new value, *value*.\n'
                 '\n'
                 '   Note, adding "__set__()" or "__delete__()" changes the '
                 'kind of\n'
                 '   descriptor to a “data descriptor”.  See Invoking '
                 'Descriptors for\n'
                 '   more details.\n'
                 '\n'
                 'object.__delete__(self, instance)\n'
                 '\n'
                 '   Called to delete the attribute on an instance *instance* '
                 'of the\n'
                 '   owner class.\n'
                 '\n'
                 'object.__set_name__(self, owner, name)\n'
                 '\n'
                 '   Called at the time the owning class *owner* is created. '
                 'The\n'
                 '   descriptor has been assigned to *name*.\n'
                 '\n'
                 '   Note:\n'
                 '\n'
                 '     "__set_name__()" is only called implicitly as part of '
                 'the "type"\n'
                 '     constructor, so it will need to be called explicitly '
                 'with the\n'
                 '     appropriate parameters when a descriptor is added to a '
                 'class\n'
                 '     after initial creation:\n'
                 '\n'
                 '        class A:\n'
                 '           pass\n'
                 '        descr = custom_descriptor()\n'
                 '        A.attr = descr\n'
                 "        descr.__set_name__(A, 'attr')\n"
                 '\n'
                 '     See Creating the class object for more details.\n'
                 '\n'
                 '   New in version 3.6.\n'
                 '\n'
                 'The attribute "__objclass__" is interpreted by the "inspect" '
                 'module as\n'
                 'specifying the class where this object was defined (setting '
                 'this\n'
                 'appropriately can assist in runtime introspection of dynamic '
                 'class\n'
                 'attributes). For callables, it may indicate that an instance '
                 'of the\n'
                 'given type (or a subclass) is expected or required as the '
                 'first\n'
                 'positional argument (for example, CPython sets this '
                 'attribute for\n'
                 'unbound methods that are implemented in C).\n'
                 '\n'
                 '\n'
                 'Invoking Descriptors\n'
                 '--------------------\n'
                 '\n'
                 'In general, a descriptor is an object attribute with '
                 '“binding\n'
                 'behavior”, one whose attribute access has been overridden by '
                 'methods\n'
                 'in the descriptor protocol:  "__get__()", "__set__()", and\n'
                 '"__delete__()". If any of those methods are defined for an '
                 'object, it\n'
                 'is said to be a descriptor.\n'
                 '\n'
                 'The default behavior for attribute access is to get, set, or '
                 'delete\n'
                 'the attribute from an object’s dictionary. For instance, '
                 '"a.x" has a\n'
                 'lookup chain starting with "a.__dict__[\'x\']", then\n'
                 '"type(a).__dict__[\'x\']", and continuing through the base '
                 'classes of\n'
                 '"type(a)" excluding metaclasses.\n'
                 '\n'
                 'However, if the looked-up value is an object defining one of '
                 'the\n'
                 'descriptor methods, then Python may override the default '
                 'behavior and\n'
                 'invoke the descriptor method instead.  Where this occurs in '
                 'the\n'
                 'precedence chain depends on which descriptor methods were '
                 'defined and\n'
                 'how they were called.\n'
                 '\n'
                 'The starting point for descriptor invocation is a binding, '
                 '"a.x". How\n'
                 'the arguments are assembled depends on "a":\n'
                 '\n'
                 'Direct Call\n'
                 '   The simplest and least common call is when user code '
                 'directly\n'
                 '   invokes a descriptor method:    "x.__get__(a)".\n'
                 '\n'
                 'Instance Binding\n'
                 '   If binding to an object instance, "a.x" is transformed '
                 'into the\n'
                 '   call: "type(a).__dict__[\'x\'].__get__(a, type(a))".\n'
                 '\n'
                 'Class Binding\n'
                 '   If binding to a class, "A.x" is transformed into the '
                 'call:\n'
                 '   "A.__dict__[\'x\'].__get__(None, A)".\n'
                 '\n'
                 'Super Binding\n'
                 '   If "a" is an instance of "super", then the binding '
                 '"super(B,\n'
                 '   obj).m()" searches "obj.__class__.__mro__" for the base '
                 'class "A"\n'
                 '   immediately preceding "B" and then invokes the descriptor '
                 'with the\n'
                 '   call: "A.__dict__[\'m\'].__get__(obj, obj.__class__)".\n'
                 '\n'
                 'For instance bindings, the precedence of descriptor '
                 'invocation depends\n'
                 'on which descriptor methods are defined.  A descriptor can '
                 'define any\n'
                 'combination of "__get__()", "__set__()" and "__delete__()".  '
                 'If it\n'
                 'does not define "__get__()", then accessing the attribute '
                 'will return\n'
                 'the descriptor object itself unless there is a value in the '
                 'object’s\n'
                 'instance dictionary.  If the descriptor defines "__set__()" '
                 'and/or\n'
                 '"__delete__()", it is a data descriptor; if it defines '
                 'neither, it is\n'
                 'a non-data descriptor.  Normally, data descriptors define '
                 'both\n'
                 '"__get__()" and "__set__()", while non-data descriptors have '
                 'just the\n'
                 '"__get__()" method.  Data descriptors with "__set__()" and '
                 '"__get__()"\n'
                 'defined always override a redefinition in an instance '
                 'dictionary.  In\n'
                 'contrast, non-data descriptors can be overridden by '
                 'instances.\n'
                 '\n'
                 'Python methods (including "staticmethod()" and '
                 '"classmethod()") are\n'
                 'implemented as non-data descriptors.  Accordingly, instances '
                 'can\n'
                 'redefine and override methods.  This allows individual '
                 'instances to\n'
                 'acquire behaviors that differ from other instances of the '
                 'same class.\n'
                 '\n'
                 'The "property()" function is implemented as a data '
                 'descriptor.\n'
                 'Accordingly, instances cannot override the behavior of a '
                 'property.\n'
                 '\n'
                 '\n'
                 '__slots__\n'
                 '---------\n'
                 '\n'
                 '*__slots__* allow us to explicitly declare data members '
                 '(like\n'
                 'properties) and deny the creation of *__dict__* and '
                 '*__weakref__*\n'
                 '(unless explicitly declared in *__slots__* or available in a '
                 'parent.)\n'
                 '\n'
                 'The space saved over using *__dict__* can be significant. '
                 'Attribute\n'
                 'lookup speed can be significantly improved as well.\n'
                 '\n'
                 'object.__slots__\n'
                 '\n'
                 '   This class variable can be assigned a string, iterable, '
                 'or sequence\n'
                 '   of strings with variable names used by instances.  '
                 '*__slots__*\n'
                 '   reserves space for the declared variables and prevents '
                 'the\n'
                 '   automatic creation of *__dict__* and *__weakref__* for '
                 'each\n'
                 '   instance.\n'
                 '\n'
                 '\n'
                 'Notes on using *__slots__*\n'
                 '~~~~~~~~~~~~~~~~~~~~~~~~~~\n'
                 '\n'
                 '* When inheriting from a class without *__slots__*, the '
                 '*__dict__* and\n'
                 '  *__weakref__* attribute of the instances will always be '
                 'accessible.\n'
                 '\n'
                 '* Without a *__dict__* variable, instances cannot be '
                 'assigned new\n'
                 '  variables not listed in the *__slots__* definition.  '
                 'Attempts to\n'
                 '  assign to an unlisted variable name raises '
                 '"AttributeError". If\n'
                 '  dynamic assignment of new variables is desired, then add\n'
                 '  "\'__dict__\'" to the sequence of strings in the '
                 '*__slots__*\n'
                 '  declaration.\n'
                 '\n'
                 '* Without a *__weakref__* variable for each instance, '
                 'classes defining\n'
                 '  *__slots__* do not support weak references to its '
                 'instances. If weak\n'
                 '  reference support is needed, then add "\'__weakref__\'" to '
                 'the\n'
                 '  sequence of strings in the *__slots__* declaration.\n'
                 '\n'
                 '* *__slots__* are implemented at the class level by '
                 'creating\n'
                 '  descriptors (Implementing Descriptors) for each variable '
                 'name.  As a\n'
                 '  result, class attributes cannot be used to set default '
                 'values for\n'
                 '  instance variables defined by *__slots__*; otherwise, the '
                 'class\n'
                 '  attribute would overwrite the descriptor assignment.\n'
                 '\n'
                 '* The action of a *__slots__* declaration is not limited to '
                 'the class\n'
                 '  where it is defined.  *__slots__* declared in parents are '
                 'available\n'
                 '  in child classes. However, child subclasses will get a '
                 '*__dict__*\n'
                 '  and *__weakref__* unless they also define *__slots__* '
                 '(which should\n'
                 '  only contain names of any *additional* slots).\n'
                 '\n'
                 '* If a class defines a slot also defined in a base class, '
                 'the instance\n'
                 '  variable defined by the base class slot is inaccessible '
                 '(except by\n'
                 '  retrieving its descriptor directly from the base class). '
                 'This\n'
                 '  renders the meaning of the program undefined.  In the '
                 'future, a\n'
                 '  check may be added to prevent this.\n'
                 '\n'
                 '* Nonempty *__slots__* does not work for classes derived '
                 'from\n'
                 '  “variable-length” built-in types such as "int", "bytes" '
                 'and "tuple".\n'
                 '\n'
                 '* Any non-string iterable may be assigned to *__slots__*. '
                 'Mappings may\n'
                 '  also be used; however, in the future, special meaning may '
                 'be\n'
                 '  assigned to the values corresponding to each key.\n'
                 '\n'
                 '* *__class__* assignment works only if both classes have the '
                 'same\n'
                 '  *__slots__*.\n'
                 '\n'
                 '* Multiple inheritance with multiple slotted parent classes '
                 'can be\n'
                 '  used, but only one parent is allowed to have attributes '
                 'created by\n'
                 '  slots (the other bases must have empty slot layouts) - '
                 'violations\n'
                 '  raise "TypeError".\n'
                 '\n'
                 '* If an iterator is used for *__slots__* then a descriptor '
                 'is created\n'
                 '  for each of the iterator’s values. However, the '
                 '*__slots__*\n'
                 '  attribute will be an empty iterator.\n'
                 '\n'
                 '\n'
                 'Customizing class creation\n'
                 '==========================\n'
                 '\n'
                 'Whenever a class inherits from another class, '
                 '*__init_subclass__* is\n'
                 'called on that class. This way, it is possible to write '
                 'classes which\n'
                 'change the behavior of subclasses. This is closely related '
                 'to class\n'
                 'decorators, but where class decorators only affect the '
                 'specific class\n'
                 'they’re applied to, "__init_subclass__" solely applies to '
                 'future\n'
                 'subclasses of the class defining the method.\n'
                 '\n'
                 'classmethod object.__init_subclass__(cls)\n'
                 '\n'
                 '   This method is called whenever the containing class is '
                 'subclassed.\n'
                 '   *cls* is then the new subclass. If defined as a normal '
                 'instance\n'
                 '   method, this method is implicitly converted to a class '
                 'method.\n'
                 '\n'
                 '   Keyword arguments which are given to a new class are '
                 'passed to the\n'
                 '   parent’s class "__init_subclass__". For compatibility '
                 'with other\n'
                 '   classes using "__init_subclass__", one should take out '
                 'the needed\n'
                 '   keyword arguments and pass the others over to the base '
                 'class, as\n'
                 '   in:\n'
                 '\n'
                 '      class Philosopher:\n'
                 '          def __init_subclass__(cls, /, default_name, '
                 '**kwargs):\n'
                 '              super().__init_subclass__(**kwargs)\n'
                 '              cls.default_name = default_name\n'
                 '\n'
                 '      class AustralianPhilosopher(Philosopher, '
                 'default_name="Bruce"):\n'
                 '          pass\n'
                 '\n'
                 '   The default implementation "object.__init_subclass__" '
                 'does nothing,\n'
                 '   but raises an error if it is called with any arguments.\n'
                 '\n'
                 '   Note:\n'
                 '\n'
                 '     The metaclass hint "metaclass" is consumed by the rest '
                 'of the\n'
                 '     type machinery, and is never passed to '
                 '"__init_subclass__"\n'
                 '     implementations. The actual metaclass (rather than the '
                 'explicit\n'
                 '     hint) can be accessed as "type(cls)".\n'
                 '\n'
                 '   New in version 3.6.\n'
                 '\n'
                 '\n'
                 'Metaclasses\n'
                 '-----------\n'
                 '\n'
                 'By default, classes are constructed using "type()". The '
                 'class body is\n'
                 'executed in a new namespace and the class name is bound '
                 'locally to the\n'
                 'result of "type(name, bases, namespace)".\n'
                 '\n'
                 'The class creation process can be customized by passing the\n'
                 '"metaclass" keyword argument in the class definition line, '
                 'or by\n'
                 'inheriting from an existing class that included such an '
                 'argument. In\n'
                 'the following example, both "MyClass" and "MySubclass" are '
                 'instances\n'
                 'of "Meta":\n'
                 '\n'
                 '   class Meta(type):\n'
                 '       pass\n'
                 '\n'
                 '   class MyClass(metaclass=Meta):\n'
                 '       pass\n'
                 '\n'
                 '   class MySubclass(MyClass):\n'
                 '       pass\n'
                 '\n'
                 'Any other keyword arguments that are specified in the class '
                 'definition\n'
                 'are passed through to all metaclass operations described '
                 'below.\n'
                 '\n'
                 'When a class definition is executed, the following steps '
                 'occur:\n'
                 '\n'
                 '* MRO entries are resolved;\n'
                 '\n'
                 '* the appropriate metaclass is determined;\n'
                 '\n'
                 '* the class namespace is prepared;\n'
                 '\n'
                 '* the class body is executed;\n'
                 '\n'
                 '* the class object is created.\n'
                 '\n'
                 '\n'
                 'Resolving MRO entries\n'
                 '---------------------\n'
                 '\n'
                 'If a base that appears in class definition is not an '
                 'instance of\n'
                 '"type", then an "__mro_entries__" method is searched on it. '
                 'If found,\n'
                 'it is called with the original bases tuple. This method must '
                 'return a\n'
                 'tuple of classes that will be used instead of this base. The '
                 'tuple may\n'
                 'be empty, in such case the original base is ignored.\n'
                 '\n'
                 'See also:\n'
                 '\n'
                 '  **PEP 560** - Core support for typing module and generic '
                 'types\n'
                 '\n'
                 '\n'
                 'Determining the appropriate metaclass\n'
                 '-------------------------------------\n'
                 '\n'
                 'The appropriate metaclass for a class definition is '
                 'determined as\n'
                 'follows:\n'
                 '\n'
                 '* if no bases and no explicit metaclass are given, then '
                 '"type()" is\n'
                 '  used;\n'
                 '\n'
                 '* if an explicit metaclass is given and it is *not* an '
                 'instance of\n'
                 '  "type()", then it is used directly as the metaclass;\n'
                 '\n'
                 '* if an instance of "type()" is given as the explicit '
                 'metaclass, or\n'
                 '  bases are defined, then the most derived metaclass is '
                 'used.\n'
                 '\n'
                 'The most derived metaclass is selected from the explicitly '
                 'specified\n'
                 'metaclass (if any) and the metaclasses (i.e. "type(cls)") of '
                 'all\n'
                 'specified base classes. The most derived metaclass is one '
                 'which is a\n'
                 'subtype of *all* of these candidate metaclasses. If none of '
                 'the\n'
                 'candidate metaclasses meets that criterion, then the class '
                 'definition\n'
                 'will fail with "TypeError".\n'
                 '\n'
                 '\n'
                 'Preparing the class namespace\n'
                 '-----------------------------\n'
                 '\n'
                 'Once the appropriate metaclass has been identified, then the '
                 'class\n'
                 'namespace is prepared. If the metaclass has a "__prepare__" '
                 'attribute,\n'
                 'it is called as "namespace = metaclass.__prepare__(name, '
                 'bases,\n'
                 '**kwds)" (where the additional keyword arguments, if any, '
                 'come from\n'
                 'the class definition). The "__prepare__" method should be '
                 'implemented\n'
                 'as a "classmethod()". The namespace returned by '
                 '"__prepare__" is\n'
                 'passed in to "__new__", but when the final class object is '
                 'created the\n'
                 'namespace is copied into a new "dict".\n'
                 '\n'
                 'If the metaclass has no "__prepare__" attribute, then the '
                 'class\n'
                 'namespace is initialised as an empty ordered mapping.\n'
                 '\n'
                 'See also:\n'
                 '\n'
                 '  **PEP 3115** - Metaclasses in Python 3000\n'
                 '     Introduced the "__prepare__" namespace hook\n'
                 '\n'
                 '\n'
                 'Executing the class body\n'
                 '------------------------\n'
                 '\n'
                 'The class body is executed (approximately) as "exec(body, '
                 'globals(),\n'
                 'namespace)". The key difference from a normal call to '
                 '"exec()" is that\n'
                 'lexical scoping allows the class body (including any '
                 'methods) to\n'
                 'reference names from the current and outer scopes when the '
                 'class\n'
                 'definition occurs inside a function.\n'
                 '\n'
                 'However, even when the class definition occurs inside the '
                 'function,\n'
                 'methods defined inside the class still cannot see names '
                 'defined at the\n'
                 'class scope. Class variables must be accessed through the '
                 'first\n'
                 'parameter of instance or class methods, or through the '
                 'implicit\n'
                 'lexically scoped "__class__" reference described in the next '
                 'section.\n'
                 '\n'
                 '\n'
                 'Creating the class object\n'
                 '-------------------------\n'
                 '\n'
                 'Once the class namespace has been populated by executing the '
                 'class\n'
                 'body, the class object is created by calling '
                 '"metaclass(name, bases,\n'
                 'namespace, **kwds)" (the additional keywords passed here are '
                 'the same\n'
                 'as those passed to "__prepare__").\n'
                 '\n'
                 'This class object is the one that will be referenced by the '
                 'zero-\n'
                 'argument form of "super()". "__class__" is an implicit '
                 'closure\n'
                 'reference created by the compiler if any methods in a class '
                 'body refer\n'
                 'to either "__class__" or "super". This allows the zero '
                 'argument form\n'
                 'of "super()" to correctly identify the class being defined '
                 'based on\n'
                 'lexical scoping, while the class or instance that was used '
                 'to make the\n'
                 'current call is identified based on the first argument '
                 'passed to the\n'
                 'method.\n'
                 '\n'
                 '**CPython implementation detail:** In CPython 3.6 and later, '
                 'the\n'
                 '"__class__" cell is passed to the metaclass as a '
                 '"__classcell__" entry\n'
                 'in the class namespace. If present, this must be propagated '
                 'up to the\n'
                 '"type.__new__" call in order for the class to be '
                 'initialised\n'
                 'correctly. Failing to do so will result in a "RuntimeError" '
                 'in Python\n'
                 '3.8.\n'
                 '\n'
                 'When using the default metaclass "type", or any metaclass '
                 'that\n'
                 'ultimately calls "type.__new__", the following additional\n'
                 'customisation steps are invoked after creating the class '
                 'object:\n'
                 '\n'
                 '* first, "type.__new__" collects all of the descriptors in '
                 'the class\n'
                 '  namespace that define a "__set_name__()" method;\n'
                 '\n'
                 '* second, all of these "__set_name__" methods are called '
                 'with the\n'
                 '  class being defined and the assigned name of that '
                 'particular\n'
                 '  descriptor;\n'
                 '\n'
                 '* finally, the "__init_subclass__()" hook is called on the '
                 'immediate\n'
                 '  parent of the new class in its method resolution order.\n'
                 '\n'
                 'After the class object is created, it is passed to the '
                 'class\n'
                 'decorators included in the class definition (if any) and the '
                 'resulting\n'
                 'object is bound in the local namespace as the defined '
                 'class.\n'
                 '\n'
                 'When a new class is created by "type.__new__", the object '
                 'provided as\n'
                 'the namespace parameter is copied to a new ordered mapping '
                 'and the\n'
                 'original object is discarded. The new copy is wrapped in a '
                 'read-only\n'
                 'proxy, which becomes the "__dict__" attribute of the class '
                 'object.\n'
                 '\n'
                 'See also:\n'
                 '\n'
                 '  **PEP 3135** - New super\n'
                 '     Describes the implicit "__class__" closure reference\n'
                 '\n'
                 '\n'
                 'Uses for metaclasses\n'
                 '--------------------\n'
                 '\n'
                 'The potential uses for metaclasses are boundless. Some ideas '
                 'that have\n'
                 'been explored include enum, logging, interface checking, '
                 'automatic\n'
                 'delegation, automatic property creation, proxies, '
                 'frameworks, and\n'
                 'automatic resource locking/synchronization.\n'
                 '\n'
                 '\n'
                 'Customizing instance and subclass checks\n'
                 '========================================\n'
                 '\n'
                 'The following methods are used to override the default '
                 'behavior of the\n'
                 '"isinstance()" and "issubclass()" built-in functions.\n'
                 '\n'
                 'In particular, the metaclass "abc.ABCMeta" implements these '
                 'methods in\n'
                 'order to allow the addition of Abstract Base Classes (ABCs) '
                 'as\n'
                 '“virtual base classes” to any class or type (including '
                 'built-in\n'
                 'types), including other ABCs.\n'
                 '\n'
                 'class.__instancecheck__(self, instance)\n'
                 '\n'
                 '   Return true if *instance* should be considered a (direct '
                 'or\n'
                 '   indirect) instance of *class*. If defined, called to '
                 'implement\n'
                 '   "isinstance(instance, class)".\n'
                 '\n'
                 'class.__subclasscheck__(self, subclass)\n'
                 '\n'
                 '   Return true if *subclass* should be considered a (direct '
                 'or\n'
                 '   indirect) subclass of *class*.  If defined, called to '
                 'implement\n'
                 '   "issubclass(subclass, class)".\n'
                 '\n'
                 'Note that these methods are looked up on the type '
                 '(metaclass) of a\n'
                 'class.  They cannot be defined as class methods in the '
                 'actual class.\n'
                 'This is consistent with the lookup of special methods that '
                 'are called\n'
                 'on instances, only in this case the instance is itself a '
                 'class.\n'
                 '\n'
                 'See also:\n'
                 '\n'
                 '  **PEP 3119** - Introducing Abstract Base Classes\n'
                 '     Includes the specification for customizing '
                 '"isinstance()" and\n'
                 '     "issubclass()" behavior through "__instancecheck__()" '
                 'and\n'
                 '     "__subclasscheck__()", with motivation for this '
                 'functionality in\n'
                 '     the context of adding Abstract Base Classes (see the '
                 '"abc"\n'
                 '     module) to the language.\n'
                 '\n'
                 '\n'
                 'Emulating generic types\n'
                 '=======================\n'
                 '\n'
                 'One can implement the generic class syntax as specified by '
                 '**PEP 484**\n'
                 '(for example "List[int]") by defining a special method:\n'
                 '\n'
                 'classmethod object.__class_getitem__(cls, key)\n'
                 '\n'
                 '   Return an object representing the specialization of a '
                 'generic class\n'
                 '   by type arguments found in *key*.\n'
                 '\n'
                 'This method is looked up on the class object itself, and '
                 'when defined\n'
                 'in the class body, this method is implicitly a class '
                 'method.  Note,\n'
                 'this mechanism is primarily reserved for use with static '
                 'type hints,\n'
                 'other usage is discouraged.\n'
                 '\n'
                 'See also:\n'
                 '\n'
                 '  **PEP 560** - Core support for typing module and generic '
                 'types\n'
                 '\n'
                 '\n'
                 'Emulating callable objects\n'
                 '==========================\n'
                 '\n'
                 'object.__call__(self[, args...])\n'
                 '\n'
                 '   Called when the instance is “called” as a function; if '
                 'this method\n'
                 '   is defined, "x(arg1, arg2, ...)" roughly translates to\n'
                 '   "type(x).__call__(x, arg1, ...)".\n'
                 '\n'
                 '\n'
                 'Emulating container types\n'
                 '=========================\n'
                 '\n'
                 'The following methods can be defined to implement container '
                 'objects.\n'
                 'Containers usually are sequences (such as lists or tuples) '
                 'or mappings\n'
                 '(like dictionaries), but can represent other containers as '
                 'well.  The\n'
                 'first set of methods is used either to emulate a sequence or '
                 'to\n'
                 'emulate a mapping; the difference is that for a sequence, '
                 'the\n'
                 'allowable keys should be the integers *k* for which "0 <= k '
                 '< N" where\n'
                 '*N* is the length of the sequence, or slice objects, which '
                 'define a\n'
                 'range of items.  It is also recommended that mappings '
                 'provide the\n'
                 'methods "keys()", "values()", "items()", "get()", '
                 '"clear()",\n'
                 '"setdefault()", "pop()", "popitem()", "copy()", and '
                 '"update()"\n'
                 'behaving similar to those for Python’s standard dictionary '
                 'objects.\n'
                 'The "collections.abc" module provides a "MutableMapping" '
                 'abstract base\n'
                 'class to help create those methods from a base set of '
                 '"__getitem__()",\n'
                 '"__setitem__()", "__delitem__()", and "keys()". Mutable '
                 'sequences\n'
                 'should provide methods "append()", "count()", "index()", '
                 '"extend()",\n'
                 '"insert()", "pop()", "remove()", "reverse()" and "sort()", '
                 'like Python\n'
                 'standard list objects.  Finally, sequence types should '
                 'implement\n'
                 'addition (meaning concatenation) and multiplication '
                 '(meaning\n'
                 'repetition) by defining the methods "__add__()", '
                 '"__radd__()",\n'
                 '"__iadd__()", "__mul__()", "__rmul__()" and "__imul__()" '
                 'described\n'
                 'below; they should not define other numerical operators.  It '
                 'is\n'
                 'recommended that both mappings and sequences implement the\n'
                 '"__contains__()" method to allow efficient use of the "in" '
                 'operator;\n'
                 'for mappings, "in" should search the mapping’s keys; for '
                 'sequences, it\n'
                 'should search through the values.  It is further recommended '
                 'that both\n'
                 'mappings and sequences implement the "__iter__()" method to '
                 'allow\n'
                 'efficient iteration through the container; for mappings, '
                 '"__iter__()"\n'
                 'should iterate through the object’s keys; for sequences, it '
                 'should\n'
                 'iterate through the values.\n'
                 '\n'
                 'object.__len__(self)\n'
                 '\n'
                 '   Called to implement the built-in function "len()".  '
                 'Should return\n'
                 '   the length of the object, an integer ">=" 0.  Also, an '
                 'object that\n'
                 '   doesn’t define a "__bool__()" method and whose '
                 '"__len__()" method\n'
                 '   returns zero is considered to be false in a Boolean '
                 'context.\n'
                 '\n'
                 '   **CPython implementation detail:** In CPython, the length '
                 'is\n'
                 '   required to be at most "sys.maxsize". If the length is '
                 'larger than\n'
                 '   "sys.maxsize" some features (such as "len()") may raise\n'
                 '   "OverflowError".  To prevent raising "OverflowError" by '
                 'truth value\n'
                 '   testing, an object must define a "__bool__()" method.\n'
                 '\n'
                 'object.__length_hint__(self)\n'
                 '\n'
                 '   Called to implement "operator.length_hint()". Should '
                 'return an\n'
                 '   estimated length for the object (which may be greater or '
                 'less than\n'
                 '   the actual length). The length must be an integer ">=" 0. '
                 'The\n'
                 '   return value may also be "NotImplemented", which is '
                 'treated the\n'
                 '   same as if the "__length_hint__" method didn’t exist at '
                 'all. This\n'
                 '   method is purely an optimization and is never required '
                 'for\n'
                 '   correctness.\n'
                 '\n'
                 '   New in version 3.4.\n'
                 '\n'
                 'Note:\n'
                 '\n'
                 '  Slicing is done exclusively with the following three '
                 'methods.  A\n'
                 '  call like\n'
                 '\n'
                 '     a[1:2] = b\n'
                 '\n'
                 '  is translated to\n'
                 '\n'
                 '     a[slice(1, 2, None)] = b\n'
                 '\n'
                 '  and so forth.  Missing slice items are always filled in '
                 'with "None".\n'
                 '\n'
                 'object.__getitem__(self, key)\n'
                 '\n'
                 '   Called to implement evaluation of "self[key]". For '
                 'sequence types,\n'
                 '   the accepted keys should be integers and slice objects.  '
                 'Note that\n'
                 '   the special interpretation of negative indexes (if the '
                 'class wishes\n'
                 '   to emulate a sequence type) is up to the "__getitem__()" '
                 'method. If\n'
                 '   *key* is of an inappropriate type, "TypeError" may be '
                 'raised; if of\n'
                 '   a value outside the set of indexes for the sequence '
                 '(after any\n'
                 '   special interpretation of negative values), "IndexError" '
                 'should be\n'
                 '   raised. For mapping types, if *key* is missing (not in '
                 'the\n'
                 '   container), "KeyError" should be raised.\n'
                 '\n'
                 '   Note:\n'
                 '\n'
                 '     "for" loops expect that an "IndexError" will be raised '
                 'for\n'
                 '     illegal indexes to allow proper detection of the end of '
                 'the\n'
                 '     sequence.\n'
                 '\n'
                 'object.__setitem__(self, key, value)\n'
                 '\n'
                 '   Called to implement assignment to "self[key]".  Same note '
                 'as for\n'
                 '   "__getitem__()".  This should only be implemented for '
                 'mappings if\n'
                 '   the objects support changes to the values for keys, or if '
                 'new keys\n'
                 '   can be added, or for sequences if elements can be '
                 'replaced.  The\n'
                 '   same exceptions should be raised for improper *key* '
                 'values as for\n'
                 '   the "__getitem__()" method.\n'
                 '\n'
                 'object.__delitem__(self, key)\n'
                 '\n'
                 '   Called to implement deletion of "self[key]".  Same note '
                 'as for\n'
                 '   "__getitem__()".  This should only be implemented for '
                 'mappings if\n'
                 '   the objects support removal of keys, or for sequences if '
                 'elements\n'
                 '   can be removed from the sequence.  The same exceptions '
                 'should be\n'
                 '   raised for improper *key* values as for the '
                 '"__getitem__()" method.\n'
                 '\n'
                 'object.__missing__(self, key)\n'
                 '\n'
                 '   Called by "dict"."__getitem__()" to implement "self[key]" '
                 'for dict\n'
                 '   subclasses when key is not in the dictionary.\n'
                 '\n'
                 'object.__iter__(self)\n'
                 '\n'
                 '   This method is called when an iterator is required for a '
                 'container.\n'
                 '   This method should return a new iterator object that can '
                 'iterate\n'
                 '   over all the objects in the container.  For mappings, it '
                 'should\n'
                 '   iterate over the keys of the container.\n'
                 '\n'
                 '   Iterator objects also need to implement this method; they '
                 'are\n'
                 '   required to return themselves.  For more information on '
                 'iterator\n'
                 '   objects, see Iterator Types.\n'
                 '\n'
                 'object.__reversed__(self)\n'
                 '\n'
                 '   Called (if present) by the "reversed()" built-in to '
                 'implement\n'
                 '   reverse iteration.  It should return a new iterator '
                 'object that\n'
                 '   iterates over all the objects in the container in reverse '
                 'order.\n'
                 '\n'
                 '   If the "__reversed__()" method is not provided, the '
                 '"reversed()"\n'
                 '   built-in will fall back to using the sequence protocol '
                 '("__len__()"\n'
                 '   and "__getitem__()").  Objects that support the sequence '
                 'protocol\n'
                 '   should only provide "__reversed__()" if they can provide '
                 'an\n'
                 '   implementation that is more efficient than the one '
                 'provided by\n'
                 '   "reversed()".\n'
                 '\n'
                 'The membership test operators ("in" and "not in") are '
                 'normally\n'
                 'implemented as an iteration through a container. However, '
                 'container\n'
                 'objects can supply the following special method with a more '
                 'efficient\n'
                 'implementation, which also does not require the object be '
                 'iterable.\n'
                 '\n'
                 'object.__contains__(self, item)\n'
                 '\n'
                 '   Called to implement membership test operators.  Should '
                 'return true\n'
                 '   if *item* is in *self*, false otherwise.  For mapping '
                 'objects, this\n'
                 '   should consider the keys of the mapping rather than the '
                 'values or\n'
                 '   the key-item pairs.\n'
                 '\n'
                 '   For objects that don’t define "__contains__()", the '
                 'membership test\n'
                 '   first tries iteration via "__iter__()", then the old '
                 'sequence\n'
                 '   iteration protocol via "__getitem__()", see this section '
                 'in the\n'
                 '   language reference.\n'
                 '\n'
                 '\n'
                 'Emulating numeric types\n'
                 '=======================\n'
                 '\n'
                 'The following methods can be defined to emulate numeric '
                 'objects.\n'
                 'Methods corresponding to operations that are not supported '
                 'by the\n'
                 'particular kind of number implemented (e.g., bitwise '
                 'operations for\n'
                 'non-integral numbers) should be left undefined.\n'
                 '\n'
                 'object.__add__(self, other)\n'
                 'object.__sub__(self, other)\n'
                 'object.__mul__(self, other)\n'
                 'object.__matmul__(self, other)\n'
                 'object.__truediv__(self, other)\n'
                 'object.__floordiv__(self, other)\n'
                 'object.__mod__(self, other)\n'
                 'object.__divmod__(self, other)\n'
                 'object.__pow__(self, other[, modulo])\n'
                 'object.__lshift__(self, other)\n'
                 'object.__rshift__(self, other)\n'
                 'object.__and__(self, other)\n'
                 'object.__xor__(self, other)\n'
                 'object.__or__(self, other)\n'
                 '\n'
                 '   These methods are called to implement the binary '
                 'arithmetic\n'
                 '   operations ("+", "-", "*", "@", "/", "//", "%", '
                 '"divmod()",\n'
                 '   "pow()", "**", "<<", ">>", "&", "^", "|").  For instance, '
                 'to\n'
                 '   evaluate the expression "x + y", where *x* is an instance '
                 'of a\n'
                 '   class that has an "__add__()" method, "x.__add__(y)" is '
                 'called.\n'
                 '   The "__divmod__()" method should be the equivalent to '
                 'using\n'
                 '   "__floordiv__()" and "__mod__()"; it should not be '
                 'related to\n'
                 '   "__truediv__()".  Note that "__pow__()" should be defined '
                 'to accept\n'
                 '   an optional third argument if the ternary version of the '
                 'built-in\n'
                 '   "pow()" function is to be supported.\n'
                 '\n'
                 '   If one of those methods does not support the operation '
                 'with the\n'
                 '   supplied arguments, it should return "NotImplemented".\n'
                 '\n'
                 'object.__radd__(self, other)\n'
                 'object.__rsub__(self, other)\n'
                 'object.__rmul__(self, other)\n'
                 'object.__rmatmul__(self, other)\n'
                 'object.__rtruediv__(self, other)\n'
                 'object.__rfloordiv__(self, other)\n'
                 'object.__rmod__(self, other)\n'
                 'object.__rdivmod__(self, other)\n'
                 'object.__rpow__(self, other[, modulo])\n'
                 'object.__rlshift__(self, other)\n'
                 'object.__rrshift__(self, other)\n'
                 'object.__rand__(self, other)\n'
                 'object.__rxor__(self, other)\n'
                 'object.__ror__(self, other)\n'
                 '\n'
                 '   These methods are called to implement the binary '
                 'arithmetic\n'
                 '   operations ("+", "-", "*", "@", "/", "//", "%", '
                 '"divmod()",\n'
                 '   "pow()", "**", "<<", ">>", "&", "^", "|") with reflected '
                 '(swapped)\n'
                 '   operands.  These functions are only called if the left '
                 'operand does\n'
                 '   not support the corresponding operation [3] and the '
                 'operands are of\n'
                 '   different types. [4] For instance, to evaluate the '
                 'expression "x -\n'
                 '   y", where *y* is an instance of a class that has an '
                 '"__rsub__()"\n'
                 '   method, "y.__rsub__(x)" is called if "x.__sub__(y)" '
                 'returns\n'
                 '   *NotImplemented*.\n'
                 '\n'
                 '   Note that ternary "pow()" will not try calling '
                 '"__rpow__()" (the\n'
                 '   coercion rules would become too complicated).\n'
                 '\n'
                 '   Note:\n'
                 '\n'
                 '     If the right operand’s type is a subclass of the left '
                 'operand’s\n'
                 '     type and that subclass provides a different '
                 'implementation of the\n'
                 '     reflected method for the operation, this method will be '
                 'called\n'
                 '     before the left operand’s non-reflected method. This '
                 'behavior\n'
                 '     allows subclasses to override their ancestors’ '
                 'operations.\n'
                 '\n'
                 'object.__iadd__(self, other)\n'
                 'object.__isub__(self, other)\n'
                 'object.__imul__(self, other)\n'
                 'object.__imatmul__(self, other)\n'
                 'object.__itruediv__(self, other)\n'
                 'object.__ifloordiv__(self, other)\n'
                 'object.__imod__(self, other)\n'
                 'object.__ipow__(self, other[, modulo])\n'
                 'object.__ilshift__(self, other)\n'
                 'object.__irshift__(self, other)\n'
                 'object.__iand__(self, other)\n'
                 'object.__ixor__(self, other)\n'
                 'object.__ior__(self, other)\n'
                 '\n'
                 '   These methods are called to implement the augmented '
                 'arithmetic\n'
                 '   assignments ("+=", "-=", "*=", "@=", "/=", "//=", "%=", '
                 '"**=",\n'
                 '   "<<=", ">>=", "&=", "^=", "|=").  These methods should '
                 'attempt to\n'
                 '   do the operation in-place (modifying *self*) and return '
                 'the result\n'
                 '   (which could be, but does not have to be, *self*).  If a '
                 'specific\n'
                 '   method is not defined, the augmented assignment falls '
                 'back to the\n'
                 '   normal methods.  For instance, if *x* is an instance of a '
                 'class\n'
                 '   with an "__iadd__()" method, "x += y" is equivalent to "x '
                 '=\n'
                 '   x.__iadd__(y)" . Otherwise, "x.__add__(y)" and '
                 '"y.__radd__(x)" are\n'
                 '   considered, as with the evaluation of "x + y". In '
                 'certain\n'
                 '   situations, augmented assignment can result in unexpected '
                 'errors\n'
                 '   (see Why does a_tuple[i] += [‘item’] raise an exception '
                 'when the\n'
                 '   addition works?), but this behavior is in fact part of '
                 'the data\n'
                 '   model.\n'
                 '\n'
                 '   Note:\n'
                 '\n'
                 '     Due to a bug in the dispatching mechanism for "**=", a '
                 'class that\n'
                 '     defines "__ipow__()" but returns "NotImplemented" would '
                 'fail to\n'
                 '     fall back to "x.__pow__(y)" and "y.__rpow__(x)". This '
                 'bug is\n'
                 '     fixed in Python 3.10.\n'
                 '\n'
                 'object.__neg__(self)\n'
                 'object.__pos__(self)\n'
                 'object.__abs__(self)\n'
                 'object.__invert__(self)\n'
                 '\n'
                 '   Called to implement the unary arithmetic operations ("-", '
                 '"+",\n'
                 '   "abs()" and "~").\n'
                 '\n'
                 'object.__complex__(self)\n'
                 'object.__int__(self)\n'
                 'object.__float__(self)\n'
                 '\n'
                 '   Called to implement the built-in functions "complex()", '
                 '"int()" and\n'
                 '   "float()".  Should return a value of the appropriate '
                 'type.\n'
                 '\n'
                 'object.__index__(self)\n'
                 '\n'
                 '   Called to implement "operator.index()", and whenever '
                 'Python needs\n'
                 '   to losslessly convert the numeric object to an integer '
                 'object (such\n'
                 '   as in slicing, or in the built-in "bin()", "hex()" and '
                 '"oct()"\n'
                 '   functions). Presence of this method indicates that the '
                 'numeric\n'
                 '   object is an integer type.  Must return an integer.\n'
                 '\n'
                 '   If "__int__()", "__float__()" and "__complex__()" are not '
                 'defined\n'
                 '   then corresponding built-in functions "int()", "float()" '
                 'and\n'
                 '   "complex()" fall back to "__index__()".\n'
                 '\n'
                 'object.__round__(self[, ndigits])\n'
                 'object.__trunc__(self)\n'
                 'object.__floor__(self)\n'
                 'object.__ceil__(self)\n'
                 '\n'
                 '   Called to implement the built-in function "round()" and '
                 '"math"\n'
                 '   functions "trunc()", "floor()" and "ceil()". Unless '
                 '*ndigits* is\n'
                 '   passed to "__round__()" all these methods should return '
                 'the value\n'
                 '   of the object truncated to an "Integral" (typically an '
                 '"int").\n'
                 '\n'
                 '   The built-in function "int()" falls back to "__trunc__()" '
                 'if\n'
                 '   neither "__int__()" nor "__index__()" is defined.\n'
                 '\n'
                 '\n'
                 'With Statement Context Managers\n'
                 '===============================\n'
                 '\n'
                 'A *context manager* is an object that defines the runtime '
                 'context to\n'
                 'be established when executing a "with" statement. The '
                 'context manager\n'
                 'handles the entry into, and the exit from, the desired '
                 'runtime context\n'
                 'for the execution of the block of code.  Context managers '
                 'are normally\n'
                 'invoked using the "with" statement (described in section The '
                 'with\n'
                 'statement), but can also be used by directly invoking their '
                 'methods.\n'
                 '\n'
                 'Typical uses of context managers include saving and '
                 'restoring various\n'
                 'kinds of global state, locking and unlocking resources, '
                 'closing opened\n'
                 'files, etc.\n'
                 '\n'
                 'For more information on context managers, see Context '
                 'Manager Types.\n'
                 '\n'
                 'object.__enter__(self)\n'
                 '\n'
                 '   Enter the runtime context related to this object. The '
                 '"with"\n'
                 '   statement will bind this method’s return value to the '
                 'target(s)\n'
                 '   specified in the "as" clause of the statement, if any.\n'
                 '\n'
                 'object.__exit__(self, exc_type, exc_value, traceback)\n'
                 '\n'
                 '   Exit the runtime context related to this object. The '
                 'parameters\n'
                 '   describe the exception that caused the context to be '
                 'exited. If the\n'
                 '   context was exited without an exception, all three '
                 'arguments will\n'
                 '   be "None".\n'
                 '\n'
                 '   If an exception is supplied, and the method wishes to '
                 'suppress the\n'
                 '   exception (i.e., prevent it from being propagated), it '
                 'should\n'
                 '   return a true value. Otherwise, the exception will be '
                 'processed\n'
                 '   normally upon exit from this method.\n'
                 '\n'
                 '   Note that "__exit__()" methods should not reraise the '
                 'passed-in\n'
                 '   exception; this is the caller’s responsibility.\n'
                 '\n'
                 'See also:\n'
                 '\n'
                 '  **PEP 343** - The “with” statement\n'
                 '     The specification, background, and examples for the '
                 'Python "with"\n'
                 '     statement.\n'
                 '\n'
                 '\n'
                 'Special method lookup\n'
                 '=====================\n'
                 '\n'
                 'For custom classes, implicit invocations of special methods '
                 'are only\n'
                 'guaranteed to work correctly if defined on an object’s type, '
                 'not in\n'
                 'the object’s instance dictionary.  That behaviour is the '
                 'reason why\n'
                 'the following code raises an exception:\n'
                 '\n'
                 '   >>> class C:\n'
                 '   ...     pass\n'
                 '   ...\n'
                 '   >>> c = C()\n'
                 '   >>> c.__len__ = lambda: 5\n'
                 '   >>> len(c)\n'
                 '   Traceback (most recent call last):\n'
                 '     File "<stdin>", line 1, in <module>\n'
                 "   TypeError: object of type 'C' has no len()\n"
                 '\n'
                 'The rationale behind this behaviour lies with a number of '
                 'special\n'
                 'methods such as "__hash__()" and "__repr__()" that are '
                 'implemented by\n'
                 'all objects, including type objects. If the implicit lookup '
                 'of these\n'
                 'methods used the conventional lookup process, they would '
                 'fail when\n'
                 'invoked on the type object itself:\n'
                 '\n'
                 '   >>> 1 .__hash__() == hash(1)\n'
                 '   True\n'
                 '   >>> int.__hash__() == hash(int)\n'
                 '   Traceback (most recent call last):\n'
                 '     File "<stdin>", line 1, in <module>\n'
                 "   TypeError: descriptor '__hash__' of 'int' object needs an "
                 'argument\n'
                 '\n'
                 'Incorrectly attempting to invoke an unbound method of a '
                 'class in this\n'
                 'way is sometimes referred to as ‘metaclass confusion’, and '
                 'is avoided\n'
                 'by bypassing the instance when looking up special methods:\n'
                 '\n'
                 '   >>> type(1).__hash__(1) == hash(1)\n'
                 '   True\n'
                 '   >>> type(int).__hash__(int) == hash(int)\n'
                 '   True\n'
                 '\n'
                 'In addition to bypassing any instance attributes in the '
                 'interest of\n'
                 'correctness, implicit special method lookup generally also '
                 'bypasses\n'
                 'the "__getattribute__()" method even of the object’s '
                 'metaclass:\n'
                 '\n'
                 '   >>> class Meta(type):\n'
                 '   ...     def __getattribute__(*args):\n'
                 '   ...         print("Metaclass getattribute invoked")\n'
                 '   ...         return type.__getattribute__(*args)\n'
                 '   ...\n'
                 '   >>> class C(object, metaclass=Meta):\n'
                 '   ...     def __len__(self):\n'
                 '   ...         return 10\n'
                 '   ...     def __getattribute__(*args):\n'
                 '   ...         print("Class getattribute invoked")\n'
                 '   ...         return object.__getattribute__(*args)\n'
                 '   ...\n'
                 '   >>> c = C()\n'
                 '   >>> c.__len__()                 # Explicit lookup via '
                 'instance\n'
                 '   Class getattribute invoked\n'
                 '   10\n'
                 '   >>> type(c).__len__(c)          # Explicit lookup via '
                 'type\n'
                 '   Metaclass getattribute invoked\n'
                 '   10\n'
                 '   >>> len(c)                      # Implicit lookup\n'
                 '   10\n'
                 '\n'
                 'Bypassing the "__getattribute__()" machinery in this fashion '
                 'provides\n'
                 'significant scope for speed optimisations within the '
                 'interpreter, at\n'
                 'the cost of some flexibility in the handling of special '
                 'methods (the\n'
                 'special method *must* be set on the class object itself in '
                 'order to be\n'
                 'consistently invoked by the interpreter).\n',
 'string-methods': 'String Methods\n'
                   '**************\n'
                   '\n'
                   'Strings implement all of the common sequence operations, '
                   'along with\n'
                   'the additional methods described below.\n'
                   '\n'
                   'Strings also support two styles of string formatting, one '
                   'providing a\n'
                   'large degree of flexibility and customization (see '
                   '"str.format()",\n'
                   'Format String Syntax and Custom String Formatting) and the '
                   'other based\n'
                   'on C "printf" style formatting that handles a narrower '
                   'range of types\n'
                   'and is slightly harder to use correctly, but is often '
                   'faster for the\n'
                   'cases it can handle (printf-style String Formatting).\n'
                   '\n'
                   'The Text Processing Services section of the standard '
                   'library covers a\n'
                   'number of other modules that provide various text related '
                   'utilities\n'
                   '(including regular expression support in the "re" '
                   'module).\n'
                   '\n'
                   'str.capitalize()\n'
                   '\n'
                   '   Return a copy of the string with its first character '
                   'capitalized\n'
                   '   and the rest lowercased.\n'
                   '\n'
                   '   Changed in version 3.8: The first character is now put '
                   'into\n'
                   '   titlecase rather than uppercase. This means that '
                   'characters like\n'
                   '   digraphs will only have their first letter capitalized, '
                   'instead of\n'
                   '   the full character.\n'
                   '\n'
                   'str.casefold()\n'
                   '\n'
                   '   Return a casefolded copy of the string. Casefolded '
                   'strings may be\n'
                   '   used for caseless matching.\n'
                   '\n'
                   '   Casefolding is similar to lowercasing but more '
                   'aggressive because\n'
                   '   it is intended to remove all case distinctions in a '
                   'string. For\n'
                   '   example, the German lowercase letter "\'ß\'" is '
                   'equivalent to ""ss"".\n'
                   '   Since it is already lowercase, "lower()" would do '
                   'nothing to "\'ß\'";\n'
                   '   "casefold()" converts it to ""ss"".\n'
                   '\n'
                   '   The casefolding algorithm is described in section 3.13 '
                   'of the\n'
                   '   Unicode Standard.\n'
                   '\n'
                   '   New in version 3.3.\n'
                   '\n'
                   'str.center(width[, fillchar])\n'
                   '\n'
                   '   Return centered in a string of length *width*. Padding '
                   'is done\n'
                   '   using the specified *fillchar* (default is an ASCII '
                   'space). The\n'
                   '   original string is returned if *width* is less than or '
                   'equal to\n'
                   '   "len(s)".\n'
                   '\n'
                   'str.count(sub[, start[, end]])\n'
                   '\n'
                   '   Return the number of non-overlapping occurrences of '
                   'substring *sub*\n'
                   '   in the range [*start*, *end*].  Optional arguments '
                   '*start* and\n'
                   '   *end* are interpreted as in slice notation.\n'
                   '\n'
                   'str.encode(encoding="utf-8", errors="strict")\n'
                   '\n'
                   '   Return an encoded version of the string as a bytes '
                   'object. Default\n'
                   '   encoding is "\'utf-8\'". *errors* may be given to set a '
                   'different\n'
                   '   error handling scheme. The default for *errors* is '
                   '"\'strict\'",\n'
                   '   meaning that encoding errors raise a "UnicodeError". '
                   'Other possible\n'
                   '   values are "\'ignore\'", "\'replace\'", '
                   '"\'xmlcharrefreplace\'",\n'
                   '   "\'backslashreplace\'" and any other name registered '
                   'via\n'
                   '   "codecs.register_error()", see section Error Handlers. '
                   'For a list\n'
                   '   of possible encodings, see section Standard Encodings.\n'
                   '\n'
                   '   Changed in version 3.1: Support for keyword arguments '
                   'added.\n'
                   '\n'
                   'str.endswith(suffix[, start[, end]])\n'
                   '\n'
                   '   Return "True" if the string ends with the specified '
                   '*suffix*,\n'
                   '   otherwise return "False".  *suffix* can also be a tuple '
                   'of suffixes\n'
                   '   to look for.  With optional *start*, test beginning at '
                   'that\n'
                   '   position.  With optional *end*, stop comparing at that '
                   'position.\n'
                   '\n'
                   'str.expandtabs(tabsize=8)\n'
                   '\n'
                   '   Return a copy of the string where all tab characters '
                   'are replaced\n'
                   '   by one or more spaces, depending on the current column '
                   'and the\n'
                   '   given tab size.  Tab positions occur every *tabsize* '
                   'characters\n'
                   '   (default is 8, giving tab positions at columns 0, 8, 16 '
                   'and so on).\n'
                   '   To expand the string, the current column is set to zero '
                   'and the\n'
                   '   string is examined character by character.  If the '
                   'character is a\n'
                   '   tab ("\\t"), one or more space characters are inserted '
                   'in the result\n'
                   '   until the current column is equal to the next tab '
                   'position. (The\n'
                   '   tab character itself is not copied.)  If the character '
                   'is a newline\n'
                   '   ("\\n") or return ("\\r"), it is copied and the current '
                   'column is\n'
                   '   reset to zero.  Any other character is copied unchanged '
                   'and the\n'
                   '   current column is incremented by one regardless of how '
                   'the\n'
                   '   character is represented when printed.\n'
                   '\n'
                   "   >>> '01\\t012\\t0123\\t01234'.expandtabs()\n"
                   "   '01      012     0123    01234'\n"
                   "   >>> '01\\t012\\t0123\\t01234'.expandtabs(4)\n"
                   "   '01  012 0123    01234'\n"
                   '\n'
                   'str.find(sub[, start[, end]])\n'
                   '\n'
                   '   Return the lowest index in the string where substring '
                   '*sub* is\n'
                   '   found within the slice "s[start:end]".  Optional '
                   'arguments *start*\n'
                   '   and *end* are interpreted as in slice notation.  Return '
                   '"-1" if\n'
                   '   *sub* is not found.\n'
                   '\n'
                   '   Note:\n'
                   '\n'
                   '     The "find()" method should be used only if you need '
                   'to know the\n'
                   '     position of *sub*.  To check if *sub* is a substring '
                   'or not, use\n'
                   '     the "in" operator:\n'
                   '\n'
                   "        >>> 'Py' in 'Python'\n"
                   '        True\n'
                   '\n'
                   'str.format(*args, **kwargs)\n'
                   '\n'
                   '   Perform a string formatting operation.  The string on '
                   'which this\n'
                   '   method is called can contain literal text or '
                   'replacement fields\n'
                   '   delimited by braces "{}".  Each replacement field '
                   'contains either\n'
                   '   the numeric index of a positional argument, or the name '
                   'of a\n'
                   '   keyword argument.  Returns a copy of the string where '
                   'each\n'
                   '   replacement field is replaced with the string value of '
                   'the\n'
                   '   corresponding argument.\n'
                   '\n'
                   '   >>> "The sum of 1 + 2 is {0}".format(1+2)\n'
                   "   'The sum of 1 + 2 is 3'\n"
                   '\n'
                   '   See Format String Syntax for a description of the '
                   'various\n'
                   '   formatting options that can be specified in format '
                   'strings.\n'
                   '\n'
                   '   Note:\n'
                   '\n'
                   '     When formatting a number ("int", "float", "complex",\n'
                   '     "decimal.Decimal" and subclasses) with the "n" type '
                   '(ex:\n'
                   '     "\'{:n}\'.format(1234)"), the function temporarily '
                   'sets the\n'
                   '     "LC_CTYPE" locale to the "LC_NUMERIC" locale to '
                   'decode\n'
                   '     "decimal_point" and "thousands_sep" fields of '
                   '"localeconv()" if\n'
                   '     they are non-ASCII or longer than 1 byte, and the '
                   '"LC_NUMERIC"\n'
                   '     locale is different than the "LC_CTYPE" locale.  This '
                   'temporary\n'
                   '     change affects other threads.\n'
                   '\n'
                   '   Changed in version 3.7: When formatting a number with '
                   'the "n" type,\n'
                   '   the function sets temporarily the "LC_CTYPE" locale to '
                   'the\n'
                   '   "LC_NUMERIC" locale in some cases.\n'
                   '\n'
                   'str.format_map(mapping)\n'
                   '\n'
                   '   Similar to "str.format(**mapping)", except that '
                   '"mapping" is used\n'
                   '   directly and not copied to a "dict".  This is useful if '
                   'for example\n'
                   '   "mapping" is a dict subclass:\n'
                   '\n'
                   '   >>> class Default(dict):\n'
                   '   ...     def __missing__(self, key):\n'
                   '   ...         return key\n'
                   '   ...\n'
                   "   >>> '{name} was born in "
                   "{country}'.format_map(Default(name='Guido'))\n"
                   "   'Guido was born in country'\n"
                   '\n'
                   '   New in version 3.2.\n'
                   '\n'
                   'str.index(sub[, start[, end]])\n'
                   '\n'
                   '   Like "find()", but raise "ValueError" when the '
                   'substring is not\n'
                   '   found.\n'
                   '\n'
                   'str.isalnum()\n'
                   '\n'
                   '   Return "True" if all characters in the string are '
                   'alphanumeric and\n'
                   '   there is at least one character, "False" otherwise.  A '
                   'character\n'
                   '   "c" is alphanumeric if one of the following returns '
                   '"True":\n'
                   '   "c.isalpha()", "c.isdecimal()", "c.isdigit()", or '
                   '"c.isnumeric()".\n'
                   '\n'
                   'str.isalpha()\n'
                   '\n'
                   '   Return "True" if all characters in the string are '
                   'alphabetic and\n'
                   '   there is at least one character, "False" otherwise.  '
                   'Alphabetic\n'
                   '   characters are those characters defined in the Unicode '
                   'character\n'
                   '   database as “Letter”, i.e., those with general category '
                   'property\n'
                   '   being one of “Lm”, “Lt”, “Lu”, “Ll”, or “Lo”.  Note '
                   'that this is\n'
                   '   different from the “Alphabetic” property defined in the '
                   'Unicode\n'
                   '   Standard.\n'
                   '\n'
                   'str.isascii()\n'
                   '\n'
                   '   Return "True" if the string is empty or all characters '
                   'in the\n'
                   '   string are ASCII, "False" otherwise. ASCII characters '
                   'have code\n'
                   '   points in the range U+0000-U+007F.\n'
                   '\n'
                   '   New in version 3.7.\n'
                   '\n'
                   'str.isdecimal()\n'
                   '\n'
                   '   Return "True" if all characters in the string are '
                   'decimal\n'
                   '   characters and there is at least one character, "False" '
                   'otherwise.\n'
                   '   Decimal characters are those that can be used to form '
                   'numbers in\n'
                   '   base 10, e.g. U+0660, ARABIC-INDIC DIGIT ZERO.  '
                   'Formally a decimal\n'
                   '   character is a character in the Unicode General '
                   'Category “Nd”.\n'
                   '\n'
                   'str.isdigit()\n'
                   '\n'
                   '   Return "True" if all characters in the string are '
                   'digits and there\n'
                   '   is at least one character, "False" otherwise.  Digits '
                   'include\n'
                   '   decimal characters and digits that need special '
                   'handling, such as\n'
                   '   the compatibility superscript digits. This covers '
                   'digits which\n'
                   '   cannot be used to form numbers in base 10, like the '
                   'Kharosthi\n'
                   '   numbers.  Formally, a digit is a character that has the '
                   'property\n'
                   '   value Numeric_Type=Digit or Numeric_Type=Decimal.\n'
                   '\n'
                   'str.isidentifier()\n'
                   '\n'
                   '   Return "True" if the string is a valid identifier '
                   'according to the\n'
                   '   language definition, section Identifiers and keywords.\n'
                   '\n'
                   '   Call "keyword.iskeyword()" to test whether string "s" '
                   'is a reserved\n'
                   '   identifier, such as "def" and "class".\n'
                   '\n'
                   '   Example:\n'
                   '\n'
                   '      >>> from keyword import iskeyword\n'
                   '\n'
                   "      >>> 'hello'.isidentifier(), iskeyword('hello')\n"
                   '      True, False\n'
                   "      >>> 'def'.isidentifier(), iskeyword('def')\n"
                   '      True, True\n'
                   '\n'
                   'str.islower()\n'
                   '\n'
                   '   Return "True" if all cased characters [4] in the string '
                   'are\n'
                   '   lowercase and there is at least one cased character, '
                   '"False"\n'
                   '   otherwise.\n'
                   '\n'
                   'str.isnumeric()\n'
                   '\n'
                   '   Return "True" if all characters in the string are '
                   'numeric\n'
                   '   characters, and there is at least one character, '
                   '"False" otherwise.\n'
                   '   Numeric characters include digit characters, and all '
                   'characters\n'
                   '   that have the Unicode numeric value property, e.g. '
                   'U+2155, VULGAR\n'
                   '   FRACTION ONE FIFTH.  Formally, numeric characters are '
                   'those with\n'
                   '   the property value Numeric_Type=Digit, '
                   'Numeric_Type=Decimal or\n'
                   '   Numeric_Type=Numeric.\n'
                   '\n'
                   'str.isprintable()\n'
                   '\n'
                   '   Return "True" if all characters in the string are '
                   'printable or the\n'
                   '   string is empty, "False" otherwise.  Nonprintable '
                   'characters are\n'
                   '   those characters defined in the Unicode character '
                   'database as\n'
                   '   “Other” or “Separator”, excepting the ASCII space '
                   '(0x20) which is\n'
                   '   considered printable.  (Note that printable characters '
                   'in this\n'
                   '   context are those which should not be escaped when '
                   '"repr()" is\n'
                   '   invoked on a string.  It has no bearing on the handling '
                   'of strings\n'
                   '   written to "sys.stdout" or "sys.stderr".)\n'
                   '\n'
                   'str.isspace()\n'
                   '\n'
                   '   Return "True" if there are only whitespace characters '
                   'in the string\n'
                   '   and there is at least one character, "False" '
                   'otherwise.\n'
                   '\n'
                   '   A character is *whitespace* if in the Unicode character '
                   'database\n'
                   '   (see "unicodedata"), either its general category is '
                   '"Zs"\n'
                   '   (“Separator, space”), or its bidirectional class is one '
                   'of "WS",\n'
                   '   "B", or "S".\n'
                   '\n'
                   'str.istitle()\n'
                   '\n'
                   '   Return "True" if the string is a titlecased string and '
                   'there is at\n'
                   '   least one character, for example uppercase characters '
                   'may only\n'
                   '   follow uncased characters and lowercase characters only '
                   'cased ones.\n'
                   '   Return "False" otherwise.\n'
                   '\n'
                   'str.isupper()\n'
                   '\n'
                   '   Return "True" if all cased characters [4] in the string '
                   'are\n'
                   '   uppercase and there is at least one cased character, '
                   '"False"\n'
                   '   otherwise.\n'
                   '\n'
                   'str.join(iterable)\n'
                   '\n'
                   '   Return a string which is the concatenation of the '
                   'strings in\n'
                   '   *iterable*. A "TypeError" will be raised if there are '
                   'any non-\n'
                   '   string values in *iterable*, including "bytes" '
                   'objects.  The\n'
                   '   separator between elements is the string providing this '
                   'method.\n'
                   '\n'
                   'str.ljust(width[, fillchar])\n'
                   '\n'
                   '   Return the string left justified in a string of length '
                   '*width*.\n'
                   '   Padding is done using the specified *fillchar* (default '
                   'is an ASCII\n'
                   '   space). The original string is returned if *width* is '
                   'less than or\n'
                   '   equal to "len(s)".\n'
                   '\n'
                   'str.lower()\n'
                   '\n'
                   '   Return a copy of the string with all the cased '
                   'characters [4]\n'
                   '   converted to lowercase.\n'
                   '\n'
                   '   The lowercasing algorithm used is described in section '
                   '3.13 of the\n'
                   '   Unicode Standard.\n'
                   '\n'
                   'str.lstrip([chars])\n'
                   '\n'
                   '   Return a copy of the string with leading characters '
                   'removed.  The\n'
                   '   *chars* argument is a string specifying the set of '
                   'characters to be\n'
                   '   removed.  If omitted or "None", the *chars* argument '
                   'defaults to\n'
                   '   removing whitespace.  The *chars* argument is not a '
                   'prefix; rather,\n'
                   '   all combinations of its values are stripped:\n'
                   '\n'
                   "      >>> '   spacious   '.lstrip()\n"
                   "      'spacious   '\n"
                   "      >>> 'www.example.com'.lstrip('cmowz.')\n"
                   "      'example.com'\n"
                   '\n'
                   'static str.maketrans(x[, y[, z]])\n'
                   '\n'
                   '   This static method returns a translation table usable '
                   'for\n'
                   '   "str.translate()".\n'
                   '\n'
                   '   If there is only one argument, it must be a dictionary '
                   'mapping\n'
                   '   Unicode ordinals (integers) or characters (strings of '
                   'length 1) to\n'
                   '   Unicode ordinals, strings (of arbitrary lengths) or '
                   '"None".\n'
                   '   Character keys will then be converted to ordinals.\n'
                   '\n'
                   '   If there are two arguments, they must be strings of '
                   'equal length,\n'
                   '   and in the resulting dictionary, each character in x '
                   'will be mapped\n'
                   '   to the character at the same position in y.  If there '
                   'is a third\n'
                   '   argument, it must be a string, whose characters will be '
                   'mapped to\n'
                   '   "None" in the result.\n'
                   '\n'
                   'str.partition(sep)\n'
                   '\n'
                   '   Split the string at the first occurrence of *sep*, and '
                   'return a\n'
                   '   3-tuple containing the part before the separator, the '
                   'separator\n'
                   '   itself, and the part after the separator.  If the '
                   'separator is not\n'
                   '   found, return a 3-tuple containing the string itself, '
                   'followed by\n'
                   '   two empty strings.\n'
                   '\n'
                   'str.replace(old, new[, count])\n'
                   '\n'
                   '   Return a copy of the string with all occurrences of '
                   'substring *old*\n'
                   '   replaced by *new*.  If the optional argument *count* is '
                   'given, only\n'
                   '   the first *count* occurrences are replaced.\n'
                   '\n'
                   'str.rfind(sub[, start[, end]])\n'
                   '\n'
                   '   Return the highest index in the string where substring '
                   '*sub* is\n'
                   '   found, such that *sub* is contained within '
                   '"s[start:end]".\n'
                   '   Optional arguments *start* and *end* are interpreted as '
                   'in slice\n'
                   '   notation.  Return "-1" on failure.\n'
                   '\n'
                   'str.rindex(sub[, start[, end]])\n'
                   '\n'
                   '   Like "rfind()" but raises "ValueError" when the '
                   'substring *sub* is\n'
                   '   not found.\n'
                   '\n'
                   'str.rjust(width[, fillchar])\n'
                   '\n'
                   '   Return the string right justified in a string of length '
                   '*width*.\n'
                   '   Padding is done using the specified *fillchar* (default '
                   'is an ASCII\n'
                   '   space). The original string is returned if *width* is '
                   'less than or\n'
                   '   equal to "len(s)".\n'
                   '\n'
                   'str.rpartition(sep)\n'
                   '\n'
                   '   Split the string at the last occurrence of *sep*, and '
                   'return a\n'
                   '   3-tuple containing the part before the separator, the '
                   'separator\n'
                   '   itself, and the part after the separator.  If the '
                   'separator is not\n'
                   '   found, return a 3-tuple containing two empty strings, '
                   'followed by\n'
                   '   the string itself.\n'
                   '\n'
                   'str.rsplit(sep=None, maxsplit=-1)\n'
                   '\n'
                   '   Return a list of the words in the string, using *sep* '
                   'as the\n'
                   '   delimiter string. If *maxsplit* is given, at most '
                   '*maxsplit* splits\n'
                   '   are done, the *rightmost* ones.  If *sep* is not '
                   'specified or\n'
                   '   "None", any whitespace string is a separator.  Except '
                   'for splitting\n'
                   '   from the right, "rsplit()" behaves like "split()" which '
                   'is\n'
                   '   described in detail below.\n'
                   '\n'
                   'str.rstrip([chars])\n'
                   '\n'
                   '   Return a copy of the string with trailing characters '
                   'removed.  The\n'
                   '   *chars* argument is a string specifying the set of '
                   'characters to be\n'
                   '   removed.  If omitted or "None", the *chars* argument '
                   'defaults to\n'
                   '   removing whitespace.  The *chars* argument is not a '
                   'suffix; rather,\n'
                   '   all combinations of its values are stripped:\n'
                   '\n'
                   "      >>> '   spacious   '.rstrip()\n"
                   "      '   spacious'\n"
                   "      >>> 'mississippi'.rstrip('ipz')\n"
                   "      'mississ'\n"
                   '\n'
                   'str.split(sep=None, maxsplit=-1)\n'
                   '\n'
                   '   Return a list of the words in the string, using *sep* '
                   'as the\n'
                   '   delimiter string.  If *maxsplit* is given, at most '
                   '*maxsplit*\n'
                   '   splits are done (thus, the list will have at most '
                   '"maxsplit+1"\n'
                   '   elements).  If *maxsplit* is not specified or "-1", '
                   'then there is\n'
                   '   no limit on the number of splits (all possible splits '
                   'are made).\n'
                   '\n'
                   '   If *sep* is given, consecutive delimiters are not '
                   'grouped together\n'
                   '   and are deemed to delimit empty strings (for example,\n'
                   '   "\'1,,2\'.split(\',\')" returns "[\'1\', \'\', '
                   '\'2\']").  The *sep* argument\n'
                   '   may consist of multiple characters (for example,\n'
                   '   "\'1<>2<>3\'.split(\'<>\')" returns "[\'1\', \'2\', '
                   '\'3\']"). Splitting an\n'
                   '   empty string with a specified separator returns '
                   '"[\'\']".\n'
                   '\n'
                   '   For example:\n'
                   '\n'
                   "      >>> '1,2,3'.split(',')\n"
                   "      ['1', '2', '3']\n"
                   "      >>> '1,2,3'.split(',', maxsplit=1)\n"
                   "      ['1', '2,3']\n"
                   "      >>> '1,2,,3,'.split(',')\n"
                   "      ['1', '2', '', '3', '']\n"
                   '\n'
                   '   If *sep* is not specified or is "None", a different '
                   'splitting\n'
                   '   algorithm is applied: runs of consecutive whitespace '
                   'are regarded\n'
                   '   as a single separator, and the result will contain no '
                   'empty strings\n'
                   '   at the start or end if the string has leading or '
                   'trailing\n'
                   '   whitespace.  Consequently, splitting an empty string or '
                   'a string\n'
                   '   consisting of just whitespace with a "None" separator '
                   'returns "[]".\n'
                   '\n'
                   '   For example:\n'
                   '\n'
                   "      >>> '1 2 3'.split()\n"
                   "      ['1', '2', '3']\n"
                   "      >>> '1 2 3'.split(maxsplit=1)\n"
                   "      ['1', '2 3']\n"
                   "      >>> '   1   2   3   '.split()\n"
                   "      ['1', '2', '3']\n"
                   '\n'
                   'str.splitlines([keepends])\n'
                   '\n'
                   '   Return a list of the lines in the string, breaking at '
                   'line\n'
                   '   boundaries.  Line breaks are not included in the '
                   'resulting list\n'
                   '   unless *keepends* is given and true.\n'
                   '\n'
                   '   This method splits on the following line boundaries.  '
                   'In\n'
                   '   particular, the boundaries are a superset of *universal '
                   'newlines*.\n'
                   '\n'
                   '   '
                   '+-------------------------+-------------------------------+\n'
                   '   | Representation          | '
                   'Description                   |\n'
                   '   '
                   '|=========================|===============================|\n'
                   '   | "\\n"                    | Line '
                   'Feed                     |\n'
                   '   '
                   '+-------------------------+-------------------------------+\n'
                   '   | "\\r"                    | Carriage '
                   'Return               |\n'
                   '   '
                   '+-------------------------+-------------------------------+\n'
                   '   | "\\r\\n"                  | Carriage Return + Line '
                   'Feed   |\n'
                   '   '
                   '+-------------------------+-------------------------------+\n'
                   '   | "\\v" or "\\x0b"          | Line '
                   'Tabulation               |\n'
                   '   '
                   '+-------------------------+-------------------------------+\n'
                   '   | "\\f" or "\\x0c"          | Form '
                   'Feed                     |\n'
                   '   '
                   '+-------------------------+-------------------------------+\n'
                   '   | "\\x1c"                  | File '
                   'Separator                |\n'
                   '   '
                   '+-------------------------+-------------------------------+\n'
                   '   | "\\x1d"                  | Group '
                   'Separator               |\n'
                   '   '
                   '+-------------------------+-------------------------------+\n'
                   '   | "\\x1e"                  | Record '
                   'Separator              |\n'
                   '   '
                   '+-------------------------+-------------------------------+\n'
                   '   | "\\x85"                  | Next Line (C1 Control '
                   'Code)   |\n'
                   '   '
                   '+-------------------------+-------------------------------+\n'
                   '   | "\\u2028"                | Line '
                   'Separator                |\n'
                   '   '
                   '+-------------------------+-------------------------------+\n'
                   '   | "\\u2029"                | Paragraph '
                   'Separator           |\n'
                   '   '
                   '+-------------------------+-------------------------------+\n'
                   '\n'
                   '   Changed in version 3.2: "\\v" and "\\f" added to list '
                   'of line\n'
                   '   boundaries.\n'
                   '\n'
                   '   For example:\n'
                   '\n'
                   "      >>> 'ab c\\n\\nde fg\\rkl\\r\\n'.splitlines()\n"
                   "      ['ab c', '', 'de fg', 'kl']\n"
                   "      >>> 'ab c\\n\\nde "
                   "fg\\rkl\\r\\n'.splitlines(keepends=True)\n"
                   "      ['ab c\\n', '\\n', 'de fg\\r', 'kl\\r\\n']\n"
                   '\n'
                   '   Unlike "split()" when a delimiter string *sep* is '
                   'given, this\n'
                   '   method returns an empty list for the empty string, and '
                   'a terminal\n'
                   '   line break does not result in an extra line:\n'
                   '\n'
                   '      >>> "".splitlines()\n'
                   '      []\n'
                   '      >>> "One line\\n".splitlines()\n'
                   "      ['One line']\n"
                   '\n'
                   '   For comparison, "split(\'\\n\')" gives:\n'
                   '\n'
                   "      >>> ''.split('\\n')\n"
                   "      ['']\n"
                   "      >>> 'Two lines\\n'.split('\\n')\n"
                   "      ['Two lines', '']\n"
                   '\n'
                   'str.startswith(prefix[, start[, end]])\n'
                   '\n'
                   '   Return "True" if string starts with the *prefix*, '
                   'otherwise return\n'
                   '   "False". *prefix* can also be a tuple of prefixes to '
                   'look for.\n'
                   '   With optional *start*, test string beginning at that '
                   'position.\n'
                   '   With optional *end*, stop comparing string at that '
                   'position.\n'
                   '\n'
                   'str.strip([chars])\n'
                   '\n'
                   '   Return a copy of the string with the leading and '
                   'trailing\n'
                   '   characters removed. The *chars* argument is a string '
                   'specifying the\n'
                   '   set of characters to be removed. If omitted or "None", '
                   'the *chars*\n'
                   '   argument defaults to removing whitespace. The *chars* '
                   'argument is\n'
                   '   not a prefix or suffix; rather, all combinations of its '
                   'values are\n'
                   '   stripped:\n'
                   '\n'
                   "      >>> '   spacious   '.strip()\n"
                   "      'spacious'\n"
                   "      >>> 'www.example.com'.strip('cmowz.')\n"
                   "      'example'\n"
                   '\n'
                   '   The outermost leading and trailing *chars* argument '
                   'values are\n'
                   '   stripped from the string. Characters are removed from '
                   'the leading\n'
                   '   end until reaching a string character that is not '
                   'contained in the\n'
                   '   set of characters in *chars*. A similar action takes '
                   'place on the\n'
                   '   trailing end. For example:\n'
                   '\n'
                   "      >>> comment_string = '#....... Section 3.2.1 Issue "
                   "#32 .......'\n"
                   "      >>> comment_string.strip('.#! ')\n"
                   "      'Section 3.2.1 Issue #32'\n"
                   '\n'
                   'str.swapcase()\n'
                   '\n'
                   '   Return a copy of the string with uppercase characters '
                   'converted to\n'
                   '   lowercase and vice versa. Note that it is not '
                   'necessarily true that\n'
                   '   "s.swapcase().swapcase() == s".\n'
                   '\n'
                   'str.title()\n'
                   '\n'
                   '   Return a titlecased version of the string where words '
                   'start with an\n'
                   '   uppercase character and the remaining characters are '
                   'lowercase.\n'
                   '\n'
                   '   For example:\n'
                   '\n'
                   "      >>> 'Hello world'.title()\n"
                   "      'Hello World'\n"
                   '\n'
                   '   The algorithm uses a simple language-independent '
                   'definition of a\n'
                   '   word as groups of consecutive letters.  The definition '
                   'works in\n'
                   '   many contexts but it means that apostrophes in '
                   'contractions and\n'
                   '   possessives form word boundaries, which may not be the '
                   'desired\n'
                   '   result:\n'
                   '\n'
                   '      >>> "they\'re bill\'s friends from the UK".title()\n'
                   '      "They\'Re Bill\'S Friends From The Uk"\n'
                   '\n'
                   '   A workaround for apostrophes can be constructed using '
                   'regular\n'
                   '   expressions:\n'
                   '\n'
                   '      >>> import re\n'
                   '      >>> def titlecase(s):\n'
                   '      ...     return re.sub(r"[A-Za-z]+(\'[A-Za-z]+)?",\n'
                   '      ...                   lambda mo: '
                   'mo.group(0).capitalize(),\n'
                   '      ...                   s)\n'
                   '      ...\n'
                   '      >>> titlecase("they\'re bill\'s friends.")\n'
                   '      "They\'re Bill\'s Friends."\n'
                   '\n'
                   'str.translate(table)\n'
                   '\n'
                   '   Return a copy of the string in which each character has '
                   'been mapped\n'
                   '   through the given translation table.  The table must be '
                   'an object\n'
                   '   that implements indexing via "__getitem__()", typically '
                   'a *mapping*\n'
                   '   or *sequence*.  When indexed by a Unicode ordinal (an '
                   'integer), the\n'
                   '   table object can do any of the following: return a '
                   'Unicode ordinal\n'
                   '   or a string, to map the character to one or more other '
                   'characters;\n'
                   '   return "None", to delete the character from the return '
                   'string; or\n'
                   '   raise a "LookupError" exception, to map the character '
                   'to itself.\n'
                   '\n'
                   '   You can use "str.maketrans()" to create a translation '
                   'map from\n'
                   '   character-to-character mappings in different formats.\n'
                   '\n'
                   '   See also the "codecs" module for a more flexible '
                   'approach to custom\n'
                   '   character mappings.\n'
                   '\n'
                   'str.upper()\n'
                   '\n'
                   '   Return a copy of the string with all the cased '
                   'characters [4]\n'
                   '   converted to uppercase.  Note that '
                   '"s.upper().isupper()" might be\n'
                   '   "False" if "s" contains uncased characters or if the '
                   'Unicode\n'
                   '   category of the resulting character(s) is not “Lu” '
                   '(Letter,\n'
                   '   uppercase), but e.g. “Lt” (Letter, titlecase).\n'
                   '\n'
                   '   The uppercasing algorithm used is described in section '
                   '3.13 of the\n'
                   '   Unicode Standard.\n'
                   '\n'
                   'str.zfill(width)\n'
                   '\n'
                   '   Return a copy of the string left filled with ASCII '
                   '"\'0\'" digits to\n'
                   '   make a string of length *width*. A leading sign prefix\n'
                   '   ("\'+\'"/"\'-\'") is handled by inserting the padding '
                   '*after* the sign\n'
                   '   character rather than before. The original string is '
                   'returned if\n'
                   '   *width* is less than or equal to "len(s)".\n'
                   '\n'
                   '   For example:\n'
                   '\n'
                   '      >>> "42".zfill(5)\n'
                   "      '00042'\n"
                   '      >>> "-42".zfill(5)\n'
                   "      '-0042'\n",
 'strings': 'String and Bytes literals\n'
            '*************************\n'
            '\n'
            'String literals are described by the following lexical '
            'definitions:\n'
            '\n'
            '   stringliteral   ::= [stringprefix](shortstring | longstring)\n'
            '   stringprefix    ::= "r" | "u" | "R" | "U" | "f" | "F"\n'
            '                    | "fr" | "Fr" | "fR" | "FR" | "rf" | "rF" | '
            '"Rf" | "RF"\n'
            '   shortstring     ::= "\'" shortstringitem* "\'" | \'"\' '
            'shortstringitem* \'"\'\n'
            '   longstring      ::= "\'\'\'" longstringitem* "\'\'\'" | '
            '\'"""\' longstringitem* \'"""\'\n'
            '   shortstringitem ::= shortstringchar | stringescapeseq\n'
            '   longstringitem  ::= longstringchar | stringescapeseq\n'
            '   shortstringchar ::= <any source character except "\\" or '
            'newline or the quote>\n'
            '   longstringchar  ::= <any source character except "\\">\n'
            '   stringescapeseq ::= "\\" <any source character>\n'
            '\n'
            '   bytesliteral   ::= bytesprefix(shortbytes | longbytes)\n'
            '   bytesprefix    ::= "b" | "B" | "br" | "Br" | "bR" | "BR" | '
            '"rb" | "rB" | "Rb" | "RB"\n'
            '   shortbytes     ::= "\'" shortbytesitem* "\'" | \'"\' '
            'shortbytesitem* \'"\'\n'
            '   longbytes      ::= "\'\'\'" longbytesitem* "\'\'\'" | \'"""\' '
            'longbytesitem* \'"""\'\n'
            '   shortbytesitem ::= shortbyteschar | bytesescapeseq\n'
            '   longbytesitem  ::= longbyteschar | bytesescapeseq\n'
            '   shortbyteschar ::= <any ASCII character except "\\" or newline '
            'or the quote>\n'
            '   longbyteschar  ::= <any ASCII character except "\\">\n'
            '   bytesescapeseq ::= "\\" <any ASCII character>\n'
            '\n'
            'One syntactic restriction not indicated by these productions is '
            'that\n'
            'whitespace is not allowed between the "stringprefix" or '
            '"bytesprefix"\n'
            'and the rest of the literal. The source character set is defined '
            'by\n'
            'the encoding declaration; it is UTF-8 if no encoding declaration '
            'is\n'
            'given in the source file; see section Encoding declarations.\n'
            '\n'
            'In plain English: Both types of literals can be enclosed in '
            'matching\n'
            'single quotes ("\'") or double quotes (""").  They can also be '
            'enclosed\n'
            'in matching groups of three single or double quotes (these are\n'
            'generally referred to as *triple-quoted strings*).  The '
            'backslash\n'
            '("\\") character is used to escape characters that otherwise have '
            'a\n'
            'special meaning, such as newline, backslash itself, or the quote\n'
            'character.\n'
            '\n'
            'Bytes literals are always prefixed with "\'b\'" or "\'B\'"; they '
            'produce\n'
            'an instance of the "bytes" type instead of the "str" type.  They '
            'may\n'
            'only contain ASCII characters; bytes with a numeric value of 128 '
            'or\n'
            'greater must be expressed with escapes.\n'
            '\n'
            'Both string and bytes literals may optionally be prefixed with a\n'
            'letter "\'r\'" or "\'R\'"; such strings are called *raw strings* '
            'and treat\n'
            'backslashes as literal characters.  As a result, in string '
            'literals,\n'
            '"\'\\U\'" and "\'\\u\'" escapes in raw strings are not treated '
            'specially.\n'
            'Given that Python 2.x’s raw unicode literals behave differently '
            'than\n'
            'Python 3.x’s the "\'ur\'" syntax is not supported.\n'
            '\n'
            'New in version 3.3: The "\'rb\'" prefix of raw bytes literals has '
            'been\n'
            'added as a synonym of "\'br\'".\n'
            '\n'
            'New in version 3.3: Support for the unicode legacy literal\n'
            '("u\'value\'") was reintroduced to simplify the maintenance of '
            'dual\n'
            'Python 2.x and 3.x codebases. See **PEP 414** for more '
            'information.\n'
            '\n'
            'A string literal with "\'f\'" or "\'F\'" in its prefix is a '
            '*formatted\n'
            'string literal*; see Formatted string literals.  The "\'f\'" may '
            'be\n'
            'combined with "\'r\'", but not with "\'b\'" or "\'u\'", therefore '
            'raw\n'
            'formatted strings are possible, but formatted bytes literals are '
            'not.\n'
            '\n'
            'In triple-quoted literals, unescaped newlines and quotes are '
            'allowed\n'
            '(and are retained), except that three unescaped quotes in a row\n'
            'terminate the literal.  (A “quote” is the character used to open '
            'the\n'
            'literal, i.e. either "\'" or """.)\n'
            '\n'
            'Unless an "\'r\'" or "\'R\'" prefix is present, escape sequences '
            'in string\n'
            'and bytes literals are interpreted according to rules similar to '
            'those\n'
            'used by Standard C.  The recognized escape sequences are:\n'
            '\n'
            '+-------------------+-----------------------------------+---------+\n'
            '| Escape Sequence   | Meaning                           | Notes   '
            '|\n'
            '|===================|===================================|=========|\n'
            '| "\\newline"        | Backslash and newline ignored     '
            '|         |\n'
            '+-------------------+-----------------------------------+---------+\n'
            '| "\\\\"              | Backslash ("\\")                   '
            '|         |\n'
            '+-------------------+-----------------------------------+---------+\n'
            '| "\\\'"              | Single quote ("\'")                '
            '|         |\n'
            '+-------------------+-----------------------------------+---------+\n'
            '| "\\""              | Double quote (""")                '
            '|         |\n'
            '+-------------------+-----------------------------------+---------+\n'
            '| "\\a"              | ASCII Bell (BEL)                  '
            '|         |\n'
            '+-------------------+-----------------------------------+---------+\n'
            '| "\\b"              | ASCII Backspace (BS)              '
            '|         |\n'
            '+-------------------+-----------------------------------+---------+\n'
            '| "\\f"              | ASCII Formfeed (FF)               '
            '|         |\n'
            '+-------------------+-----------------------------------+---------+\n'
            '| "\\n"              | ASCII Linefeed (LF)               '
            '|         |\n'
            '+-------------------+-----------------------------------+---------+\n'
            '| "\\r"              | ASCII Carriage Return (CR)        '
            '|         |\n'
            '+-------------------+-----------------------------------+---------+\n'
            '| "\\t"              | ASCII Horizontal Tab (TAB)        '
            '|         |\n'
            '+-------------------+-----------------------------------+---------+\n'
            '| "\\v"              | ASCII Vertical Tab (VT)           '
            '|         |\n'
            '+-------------------+-----------------------------------+---------+\n'
            '| "\\ooo"            | Character with octal value *ooo*  | '
            '(1,3)   |\n'
            '+-------------------+-----------------------------------+---------+\n'
            '| "\\xhh"            | Character with hex value *hh*     | '
            '(2,3)   |\n'
            '+-------------------+-----------------------------------+---------+\n'
            '\n'
            'Escape sequences only recognized in string literals are:\n'
            '\n'
            '+-------------------+-----------------------------------+---------+\n'
            '| Escape Sequence   | Meaning                           | Notes   '
            '|\n'
            '|===================|===================================|=========|\n'
            '| "\\N{name}"        | Character named *name* in the     | '
            '(4)     |\n'
            '|                   | Unicode database                  |         '
            '|\n'
            '+-------------------+-----------------------------------+---------+\n'
            '| "\\uxxxx"          | Character with 16-bit hex value   | '
            '(5)     |\n'
            '|                   | *xxxx*                            |         '
            '|\n'
            '+-------------------+-----------------------------------+---------+\n'
            '| "\\Uxxxxxxxx"      | Character with 32-bit hex value   | '
            '(6)     |\n'
            '|                   | *xxxxxxxx*                        |         '
            '|\n'
            '+-------------------+-----------------------------------+---------+\n'
            '\n'
            'Notes:\n'
            '\n'
            '1. As in Standard C, up to three octal digits are accepted.\n'
            '\n'
            '2. Unlike in Standard C, exactly two hex digits are required.\n'
            '\n'
            '3. In a bytes literal, hexadecimal and octal escapes denote the '
            'byte\n'
            '   with the given value. In a string literal, these escapes '
            'denote a\n'
            '   Unicode character with the given value.\n'
            '\n'
            '4. Changed in version 3.3: Support for name aliases [1] has been\n'
            '   added.\n'
            '\n'
            '5. Exactly four hex digits are required.\n'
            '\n'
            '6. Any Unicode character can be encoded this way.  Exactly eight '
            'hex\n'
            '   digits are required.\n'
            '\n'
            'Unlike Standard C, all unrecognized escape sequences are left in '
            'the\n'
            'string unchanged, i.e., *the backslash is left in the result*.  '
            '(This\n'
            'behavior is useful when debugging: if an escape sequence is '
            'mistyped,\n'
            'the resulting output is more easily recognized as broken.)  It is '
            'also\n'
            'important to note that the escape sequences only recognized in '
            'string\n'
            'literals fall into the category of unrecognized escapes for '
            'bytes\n'
            'literals.\n'
            '\n'
            '   Changed in version 3.6: Unrecognized escape sequences produce '
            'a\n'
            '   "DeprecationWarning".  In a future Python version they will be '
            'a\n'
            '   "SyntaxWarning" and eventually a "SyntaxError".\n'
            '\n'
            'Even in a raw literal, quotes can be escaped with a backslash, '
            'but the\n'
            'backslash remains in the result; for example, "r"\\""" is a '
            'valid\n'
            'string literal consisting of two characters: a backslash and a '
            'double\n'
            'quote; "r"\\"" is not a valid string literal (even a raw string '
            'cannot\n'
            'end in an odd number of backslashes).  Specifically, *a raw '
            'literal\n'
            'cannot end in a single backslash* (since the backslash would '
            'escape\n'
            'the following quote character).  Note also that a single '
            'backslash\n'
            'followed by a newline is interpreted as those two characters as '
            'part\n'
            'of the literal, *not* as a line continuation.\n',
 'subscriptions': 'Subscriptions\n'
                  '*************\n'
                  '\n'
                  'A subscription selects an item of a sequence (string, tuple '
                  'or list)\n'
                  'or mapping (dictionary) object:\n'
                  '\n'
                  '   subscription ::= primary "[" expression_list "]"\n'
                  '\n'
                  'The primary must evaluate to an object that supports '
                  'subscription\n'
                  '(lists or dictionaries for example).  User-defined objects '
                  'can support\n'
                  'subscription by defining a "__getitem__()" method.\n'
                  '\n'
                  'For built-in objects, there are two types of objects that '
                  'support\n'
                  'subscription:\n'
                  '\n'
                  'If the primary is a mapping, the expression list must '
                  'evaluate to an\n'
                  'object whose value is one of the keys of the mapping, and '
                  'the\n'
                  'subscription selects the value in the mapping that '
                  'corresponds to that\n'
                  'key.  (The expression list is a tuple except if it has '
                  'exactly one\n'
                  'item.)\n'
                  '\n'
                  'If the primary is a sequence, the expression list must '
                  'evaluate to an\n'
                  'integer or a slice (as discussed in the following '
                  'section).\n'
                  '\n'
                  'The formal syntax makes no special provision for negative '
                  'indices in\n'
                  'sequences; however, built-in sequences all provide a '
                  '"__getitem__()"\n'
                  'method that interprets negative indices by adding the '
                  'length of the\n'
                  'sequence to the index (so that "x[-1]" selects the last '
                  'item of "x").\n'
                  'The resulting value must be a nonnegative integer less than '
                  'the number\n'
                  'of items in the sequence, and the subscription selects the '
                  'item whose\n'
                  'index is that value (counting from zero). Since the support '
                  'for\n'
                  'negative indices and slicing occurs in the object’s '
                  '"__getitem__()"\n'
                  'method, subclasses overriding this method will need to '
                  'explicitly add\n'
                  'that support.\n'
                  '\n'
                  'A string’s items are characters.  A character is not a '
                  'separate data\n'
                  'type but a string of exactly one character.\n',
 'truth': 'Truth Value Testing\n'
          '*******************\n'
          '\n'
          'Any object can be tested for truth value, for use in an "if" or\n'
          '"while" condition or as operand of the Boolean operations below.\n'
          '\n'
          'By default, an object is considered true unless its class defines\n'
          'either a "__bool__()" method that returns "False" or a "__len__()"\n'
          'method that returns zero, when called with the object. [1]  Here '
          'are\n'
          'most of the built-in objects considered false:\n'
          '\n'
          '* constants defined to be false: "None" and "False".\n'
          '\n'
          '* zero of any numeric type: "0", "0.0", "0j", "Decimal(0)",\n'
          '  "Fraction(0, 1)"\n'
          '\n'
          '* empty sequences and collections: "\'\'", "()", "[]", "{}", '
          '"set()",\n'
          '  "range(0)"\n'
          '\n'
          'Operations and built-in functions that have a Boolean result '
          'always\n'
          'return "0" or "False" for false and "1" or "True" for true, unless\n'
          'otherwise stated. (Important exception: the Boolean operations '
          '"or"\n'
          'and "and" always return one of their operands.)\n',
 'try': 'The "try" statement\n'
        '*******************\n'
        '\n'
        'The "try" statement specifies exception handlers and/or cleanup code\n'
        'for a group of statements:\n'
        '\n'
        '   try_stmt  ::= try1_stmt | try2_stmt\n'
        '   try1_stmt ::= "try" ":" suite\n'
        '                 ("except" [expression ["as" identifier]] ":" '
        'suite)+\n'
        '                 ["else" ":" suite]\n'
        '                 ["finally" ":" suite]\n'
        '   try2_stmt ::= "try" ":" suite\n'
        '                 "finally" ":" suite\n'
        '\n'
        'The "except" clause(s) specify one or more exception handlers. When '
        'no\n'
        'exception occurs in the "try" clause, no exception handler is\n'
        'executed. When an exception occurs in the "try" suite, a search for '
        'an\n'
        'exception handler is started.  This search inspects the except '
        'clauses\n'
        'in turn until one is found that matches the exception.  An '
        'expression-\n'
        'less except clause, if present, must be last; it matches any\n'
        'exception.  For an except clause with an expression, that expression\n'
        'is evaluated, and the clause matches the exception if the resulting\n'
        'object is “compatible” with the exception.  An object is compatible\n'
        'with an exception if it is the class or a base class of the '
        'exception\n'
        'object, or a tuple containing an item that is the class or a base\n'
        'class of the exception object.\n'
        '\n'
        'If no except clause matches the exception, the search for an '
        'exception\n'
        'handler continues in the surrounding code and on the invocation '
        'stack.\n'
        '[1]\n'
        '\n'
        'If the evaluation of an expression in the header of an except clause\n'
        'raises an exception, the original search for a handler is canceled '
        'and\n'
        'a search starts for the new exception in the surrounding code and on\n'
        'the call stack (it is treated as if the entire "try" statement '
        'raised\n'
        'the exception).\n'
        '\n'
        'When a matching except clause is found, the exception is assigned to\n'
        'the target specified after the "as" keyword in that except clause, '
        'if\n'
        'present, and the except clause’s suite is executed.  All except\n'
        'clauses must have an executable block.  When the end of this block '
        'is\n'
        'reached, execution continues normally after the entire try '
        'statement.\n'
        '(This means that if two nested handlers exist for the same '
        'exception,\n'
        'and the exception occurs in the try clause of the inner handler, the\n'
        'outer handler will not handle the exception.)\n'
        '\n'
        'When an exception has been assigned using "as target", it is cleared\n'
        'at the end of the except clause.  This is as if\n'
        '\n'
        '   except E as N:\n'
        '       foo\n'
        '\n'
        'was translated to\n'
        '\n'
        '   except E as N:\n'
        '       try:\n'
        '           foo\n'
        '       finally:\n'
        '           del N\n'
        '\n'
        'This means the exception must be assigned to a different name to be\n'
        'able to refer to it after the except clause.  Exceptions are cleared\n'
        'because with the traceback attached to them, they form a reference\n'
        'cycle with the stack frame, keeping all locals in that frame alive\n'
        'until the next garbage collection occurs.\n'
        '\n'
        'Before an except clause’s suite is executed, details about the\n'
        'exception are stored in the "sys" module and can be accessed via\n'
        '"sys.exc_info()". "sys.exc_info()" returns a 3-tuple consisting of '
        'the\n'
        'exception class, the exception instance and a traceback object (see\n'
        'section The standard type hierarchy) identifying the point in the\n'
        'program where the exception occurred.  "sys.exc_info()" values are\n'
        'restored to their previous values (before the call) when returning\n'
        'from a function that handled an exception.\n'
        '\n'
        'The optional "else" clause is executed if the control flow leaves '
        'the\n'
        '"try" suite, no exception was raised, and no "return", "continue", '
        'or\n'
        '"break" statement was executed.  Exceptions in the "else" clause are\n'
        'not handled by the preceding "except" clauses.\n'
        '\n'
        'If "finally" is present, it specifies a ‘cleanup’ handler.  The '
        '"try"\n'
        'clause is executed, including any "except" and "else" clauses.  If '
        'an\n'
        'exception occurs in any of the clauses and is not handled, the\n'
        'exception is temporarily saved. The "finally" clause is executed.  '
        'If\n'
        'there is a saved exception it is re-raised at the end of the '
        '"finally"\n'
        'clause.  If the "finally" clause raises another exception, the saved\n'
        'exception is set as the context of the new exception. If the '
        '"finally"\n'
        'clause executes a "return", "break" or "continue" statement, the '
        'saved\n'
        'exception is discarded:\n'
        '\n'
        '   >>> def f():\n'
        '   ...     try:\n'
        '   ...         1/0\n'
        '   ...     finally:\n'
        '   ...         return 42\n'
        '   ...\n'
        '   >>> f()\n'
        '   42\n'
        '\n'
        'The exception information is not available to the program during\n'
        'execution of the "finally" clause.\n'
        '\n'
        'When a "return", "break" or "continue" statement is executed in the\n'
        '"try" suite of a "try"…"finally" statement, the "finally" clause is\n'
        'also executed ‘on the way out.’\n'
        '\n'
        'The return value of a function is determined by the last "return"\n'
        'statement executed.  Since the "finally" clause always executes, a\n'
        '"return" statement executed in the "finally" clause will always be '
        'the\n'
        'last one executed:\n'
        '\n'
        '   >>> def foo():\n'
        '   ...     try:\n'
        "   ...         return 'try'\n"
        '   ...     finally:\n'
        "   ...         return 'finally'\n"
        '   ...\n'
        '   >>> foo()\n'
        "   'finally'\n"
        '\n'
        'Additional information on exceptions can be found in section\n'
        'Exceptions, and information on using the "raise" statement to '
        'generate\n'
        'exceptions may be found in section The raise statement.\n'
        '\n'
        'Changed in version 3.8: Prior to Python 3.8, a "continue" statement\n'
        'was illegal in the "finally" clause due to a problem with the\n'
        'implementation.\n',
 'types': 'The standard type hierarchy\n'
          '***************************\n'
          '\n'
          'Below is a list of the types that are built into Python.  '
          'Extension\n'
          'modules (written in C, Java, or other languages, depending on the\n'
          'implementation) can define additional types.  Future versions of\n'
          'Python may add types to the type hierarchy (e.g., rational '
          'numbers,\n'
          'efficiently stored arrays of integers, etc.), although such '
          'additions\n'
          'will often be provided via the standard library instead.\n'
          '\n'
          'Some of the type descriptions below contain a paragraph listing\n'
          '‘special attributes.’  These are attributes that provide access to '
          'the\n'
          'implementation and are not intended for general use.  Their '
          'definition\n'
          'may change in the future.\n'
          '\n'
          'None\n'
          '   This type has a single value.  There is a single object with '
          'this\n'
          '   value. This object is accessed through the built-in name "None". '
          'It\n'
          '   is used to signify the absence of a value in many situations, '
          'e.g.,\n'
          '   it is returned from functions that don’t explicitly return\n'
          '   anything. Its truth value is false.\n'
          '\n'
          'NotImplemented\n'
          '   This type has a single value.  There is a single object with '
          'this\n'
          '   value. This object is accessed through the built-in name\n'
          '   "NotImplemented". Numeric methods and rich comparison methods\n'
          '   should return this value if they do not implement the operation '
          'for\n'
          '   the operands provided.  (The interpreter will then try the\n'
          '   reflected operation, or some other fallback, depending on the\n'
          '   operator.)  Its truth value is true.\n'
          '\n'
          '   See Implementing the arithmetic operations for more details.\n'
          '\n'
          'Ellipsis\n'
          '   This type has a single value.  There is a single object with '
          'this\n'
          '   value. This object is accessed through the literal "..." or the\n'
          '   built-in name "Ellipsis".  Its truth value is true.\n'
          '\n'
          '"numbers.Number"\n'
          '   These are created by numeric literals and returned as results '
          'by\n'
          '   arithmetic operators and arithmetic built-in functions.  '
          'Numeric\n'
          '   objects are immutable; once created their value never changes.\n'
          '   Python numbers are of course strongly related to mathematical\n'
          '   numbers, but subject to the limitations of numerical '
          'representation\n'
          '   in computers.\n'
          '\n'
          '   The string representations of the numeric classes, computed by\n'
          '   "__repr__()" and "__str__()", have the following properties:\n'
          '\n'
          '   * They are valid numeric literals which, when passed to their '
          'class\n'
          '     constructor, produce an object having the value of the '
          'original\n'
          '     numeric.\n'
          '\n'
          '   * The representation is in base 10, when possible.\n'
          '\n'
          '   * Leading zeros, possibly excepting a single zero before a '
          'decimal\n'
          '     point, are not shown.\n'
          '\n'
          '   * Trailing zeros, possibly excepting a single zero after a '
          'decimal\n'
          '     point, are not shown.\n'
          '\n'
          '   * A sign is shown only when the number is negative.\n'
          '\n'
          '   Python distinguishes between integers, floating point numbers, '
          'and\n'
          '   complex numbers:\n'
          '\n'
          '   "numbers.Integral"\n'
          '      These represent elements from the mathematical set of '
          'integers\n'
          '      (positive and negative).\n'
          '\n'
          '      There are two types of integers:\n'
          '\n'
          '      Integers ("int")\n'
          '         These represent numbers in an unlimited range, subject to\n'
          '         available (virtual) memory only.  For the purpose of '
          'shift\n'
          '         and mask operations, a binary representation is assumed, '
          'and\n'
          '         negative numbers are represented in a variant of 2’s\n'
          '         complement which gives the illusion of an infinite string '
          'of\n'
          '         sign bits extending to the left.\n'
          '\n'
          '      Booleans ("bool")\n'
          '         These represent the truth values False and True.  The two\n'
          '         objects representing the values "False" and "True" are '
          'the\n'
          '         only Boolean objects. The Boolean type is a subtype of '
          'the\n'
          '         integer type, and Boolean values behave like the values 0 '
          'and\n'
          '         1, respectively, in almost all contexts, the exception '
          'being\n'
          '         that when converted to a string, the strings ""False"" or\n'
          '         ""True"" are returned, respectively.\n'
          '\n'
          '      The rules for integer representation are intended to give '
          'the\n'
          '      most meaningful interpretation of shift and mask operations\n'
          '      involving negative integers.\n'
          '\n'
          '   "numbers.Real" ("float")\n'
          '      These represent machine-level double precision floating '
          'point\n'
          '      numbers. You are at the mercy of the underlying machine\n'
          '      architecture (and C or Java implementation) for the accepted\n'
          '      range and handling of overflow. Python does not support '
          'single-\n'
          '      precision floating point numbers; the savings in processor '
          'and\n'
          '      memory usage that are usually the reason for using these are\n'
          '      dwarfed by the overhead of using objects in Python, so there '
          'is\n'
          '      no reason to complicate the language with two kinds of '
          'floating\n'
          '      point numbers.\n'
          '\n'
          '   "numbers.Complex" ("complex")\n'
          '      These represent complex numbers as a pair of machine-level\n'
          '      double precision floating point numbers.  The same caveats '
          'apply\n'
          '      as for floating point numbers. The real and imaginary parts '
          'of a\n'
          '      complex number "z" can be retrieved through the read-only\n'
          '      attributes "z.real" and "z.imag".\n'
          '\n'
          'Sequences\n'
          '   These represent finite ordered sets indexed by non-negative\n'
          '   numbers. The built-in function "len()" returns the number of '
          'items\n'
          '   of a sequence. When the length of a sequence is *n*, the index '
          'set\n'
          '   contains the numbers 0, 1, …, *n*-1.  Item *i* of sequence *a* '
          'is\n'
          '   selected by "a[i]".\n'
          '\n'
          '   Sequences also support slicing: "a[i:j]" selects all items with\n'
          '   index *k* such that *i* "<=" *k* "<" *j*.  When used as an\n'
          '   expression, a slice is a sequence of the same type.  This '
          'implies\n'
          '   that the index set is renumbered so that it starts at 0.\n'
          '\n'
          '   Some sequences also support “extended slicing” with a third '
          '“step”\n'
          '   parameter: "a[i:j:k]" selects all items of *a* with index *x* '
          'where\n'
          '   "x = i + n*k", *n* ">=" "0" and *i* "<=" *x* "<" *j*.\n'
          '\n'
          '   Sequences are distinguished according to their mutability:\n'
          '\n'
          '   Immutable sequences\n'
          '      An object of an immutable sequence type cannot change once it '
          'is\n'
          '      created.  (If the object contains references to other '
          'objects,\n'
          '      these other objects may be mutable and may be changed; '
          'however,\n'
          '      the collection of objects directly referenced by an '
          'immutable\n'
          '      object cannot change.)\n'
          '\n'
          '      The following types are immutable sequences:\n'
          '\n'
          '      Strings\n'
          '         A string is a sequence of values that represent Unicode '
          'code\n'
          '         points. All the code points in the range "U+0000 - '
          'U+10FFFF"\n'
          '         can be represented in a string.  Python doesn’t have a '
          '"char"\n'
          '         type; instead, every code point in the string is '
          'represented\n'
          '         as a string object with length "1".  The built-in '
          'function\n'
          '         "ord()" converts a code point from its string form to an\n'
          '         integer in the range "0 - 10FFFF"; "chr()" converts an\n'
          '         integer in the range "0 - 10FFFF" to the corresponding '
          'length\n'
          '         "1" string object. "str.encode()" can be used to convert '
          'a\n'
          '         "str" to "bytes" using the given text encoding, and\n'
          '         "bytes.decode()" can be used to achieve the opposite.\n'
          '\n'
          '      Tuples\n'
          '         The items of a tuple are arbitrary Python objects. Tuples '
          'of\n'
          '         two or more items are formed by comma-separated lists of\n'
          '         expressions.  A tuple of one item (a ‘singleton’) can be\n'
          '         formed by affixing a comma to an expression (an expression '
          'by\n'
          '         itself does not create a tuple, since parentheses must be\n'
          '         usable for grouping of expressions).  An empty tuple can '
          'be\n'
          '         formed by an empty pair of parentheses.\n'
          '\n'
          '      Bytes\n'
          '         A bytes object is an immutable array.  The items are '
          '8-bit\n'
          '         bytes, represented by integers in the range 0 <= x < 256.\n'
          '         Bytes literals (like "b\'abc\'") and the built-in '
          '"bytes()"\n'
          '         constructor can be used to create bytes objects.  Also, '
          'bytes\n'
          '         objects can be decoded to strings via the "decode()" '
          'method.\n'
          '\n'
          '   Mutable sequences\n'
          '      Mutable sequences can be changed after they are created.  '
          'The\n'
          '      subscription and slicing notations can be used as the target '
          'of\n'
          '      assignment and "del" (delete) statements.\n'
          '\n'
          '      There are currently two intrinsic mutable sequence types:\n'
          '\n'
          '      Lists\n'
          '         The items of a list are arbitrary Python objects.  Lists '
          'are\n'
          '         formed by placing a comma-separated list of expressions '
          'in\n'
          '         square brackets. (Note that there are no special cases '
          'needed\n'
          '         to form lists of length 0 or 1.)\n'
          '\n'
          '      Byte Arrays\n'
          '         A bytearray object is a mutable array. They are created '
          'by\n'
          '         the built-in "bytearray()" constructor.  Aside from being\n'
          '         mutable (and hence unhashable), byte arrays otherwise '
          'provide\n'
          '         the same interface and functionality as immutable "bytes"\n'
          '         objects.\n'
          '\n'
          '      The extension module "array" provides an additional example '
          'of a\n'
          '      mutable sequence type, as does the "collections" module.\n'
          '\n'
          'Set types\n'
          '   These represent unordered, finite sets of unique, immutable\n'
          '   objects. As such, they cannot be indexed by any subscript. '
          'However,\n'
          '   they can be iterated over, and the built-in function "len()"\n'
          '   returns the number of items in a set. Common uses for sets are '
          'fast\n'
          '   membership testing, removing duplicates from a sequence, and\n'
          '   computing mathematical operations such as intersection, union,\n'
          '   difference, and symmetric difference.\n'
          '\n'
          '   For set elements, the same immutability rules apply as for\n'
          '   dictionary keys. Note that numeric types obey the normal rules '
          'for\n'
          '   numeric comparison: if two numbers compare equal (e.g., "1" and\n'
          '   "1.0"), only one of them can be contained in a set.\n'
          '\n'
          '   There are currently two intrinsic set types:\n'
          '\n'
          '   Sets\n'
          '      These represent a mutable set. They are created by the '
          'built-in\n'
          '      "set()" constructor and can be modified afterwards by '
          'several\n'
          '      methods, such as "add()".\n'
          '\n'
          '   Frozen sets\n'
          '      These represent an immutable set.  They are created by the\n'
          '      built-in "frozenset()" constructor.  As a frozenset is '
          'immutable\n'
          '      and *hashable*, it can be used again as an element of '
          'another\n'
          '      set, or as a dictionary key.\n'
          '\n'
          'Mappings\n'
          '   These represent finite sets of objects indexed by arbitrary '
          'index\n'
          '   sets. The subscript notation "a[k]" selects the item indexed by '
          '"k"\n'
          '   from the mapping "a"; this can be used in expressions and as '
          'the\n'
          '   target of assignments or "del" statements. The built-in '
          'function\n'
          '   "len()" returns the number of items in a mapping.\n'
          '\n'
          '   There is currently a single intrinsic mapping type:\n'
          '\n'
          '   Dictionaries\n'
          '      These represent finite sets of objects indexed by nearly\n'
          '      arbitrary values.  The only types of values not acceptable '
          'as\n'
          '      keys are values containing lists or dictionaries or other\n'
          '      mutable types that are compared by value rather than by '
          'object\n'
          '      identity, the reason being that the efficient implementation '
          'of\n'
          '      dictionaries requires a key’s hash value to remain constant.\n'
          '      Numeric types used for keys obey the normal rules for '
          'numeric\n'
          '      comparison: if two numbers compare equal (e.g., "1" and '
          '"1.0")\n'
          '      then they can be used interchangeably to index the same\n'
          '      dictionary entry.\n'
          '\n'
          '      Dictionaries preserve insertion order, meaning that keys will '
          'be\n'
          '      produced in the same order they were added sequentially over '
          'the\n'
          '      dictionary. Replacing an existing key does not change the '
          'order,\n'
          '      however removing a key and re-inserting it will add it to '
          'the\n'
          '      end instead of keeping its old place.\n'
          '\n'
          '      Dictionaries are mutable; they can be created by the "{...}"\n'
          '      notation (see section Dictionary displays).\n'
          '\n'
          '      The extension modules "dbm.ndbm" and "dbm.gnu" provide\n'
          '      additional examples of mapping types, as does the '
          '"collections"\n'
          '      module.\n'
          '\n'
          '      Changed in version 3.7: Dictionaries did not preserve '
          'insertion\n'
          '      order in versions of Python before 3.6. In CPython 3.6,\n'
          '      insertion order was preserved, but it was considered an\n'
          '      implementation detail at that time rather than a language\n'
          '      guarantee.\n'
          '\n'
          'Callable types\n'
          '   These are the types to which the function call operation (see\n'
          '   section Calls) can be applied:\n'
          '\n'
          '   User-defined functions\n'
          '      A user-defined function object is created by a function\n'
          '      definition (see section Function definitions).  It should be\n'
          '      called with an argument list containing the same number of '
          'items\n'
          '      as the function’s formal parameter list.\n'
          '\n'
          '      Special attributes:\n'
          '\n'
          '      '
          '+---------------------------+---------------------------------+-------------+\n'
          '      | Attribute                 | Meaning                         '
          '|             |\n'
          '      '
          '|===========================|=================================|=============|\n'
          '      | "__doc__"                 | The function’s documentation    '
          '| Writable    |\n'
          '      |                           | string, or "None" if            '
          '|             |\n'
          '      |                           | unavailable; not inherited by   '
          '|             |\n'
          '      |                           | subclasses.                     '
          '|             |\n'
          '      '
          '+---------------------------+---------------------------------+-------------+\n'
          '      | "__name__"                | The function’s name.            '
          '| Writable    |\n'
          '      '
          '+---------------------------+---------------------------------+-------------+\n'
          '      | "__qualname__"            | The function’s *qualified       '
          '| Writable    |\n'
          '      |                           | name*.  New in version 3.3.     '
          '|             |\n'
          '      '
          '+---------------------------+---------------------------------+-------------+\n'
          '      | "__module__"              | The name of the module the      '
          '| Writable    |\n'
          '      |                           | function was defined in, or     '
          '|             |\n'
          '      |                           | "None" if unavailable.          '
          '|             |\n'
          '      '
          '+---------------------------+---------------------------------+-------------+\n'
          '      | "__defaults__"            | A tuple containing default      '
          '| Writable    |\n'
          '      |                           | argument values for those       '
          '|             |\n'
          '      |                           | arguments that have defaults,   '
          '|             |\n'
          '      |                           | or "None" if no arguments have  '
          '|             |\n'
          '      |                           | a default value.                '
          '|             |\n'
          '      '
          '+---------------------------+---------------------------------+-------------+\n'
          '      | "__code__"                | The code object representing    '
          '| Writable    |\n'
          '      |                           | the compiled function body.     '
          '|             |\n'
          '      '
          '+---------------------------+---------------------------------+-------------+\n'
          '      | "__globals__"             | A reference to the dictionary   '
          '| Read-only   |\n'
          '      |                           | that holds the function’s       '
          '|             |\n'
          '      |                           | global variables — the global   '
          '|             |\n'
          '      |                           | namespace of the module in      '
          '|             |\n'
          '      |                           | which the function was defined. '
          '|             |\n'
          '      '
          '+---------------------------+---------------------------------+-------------+\n'
          '      | "__dict__"                | The namespace supporting        '
          '| Writable    |\n'
          '      |                           | arbitrary function attributes.  '
          '|             |\n'
          '      '
          '+---------------------------+---------------------------------+-------------+\n'
          '      | "__closure__"             | "None" or a tuple of cells that '
          '| Read-only   |\n'
          '      |                           | contain bindings for the        '
          '|             |\n'
          '      |                           | function’s free variables. See  '
          '|             |\n'
          '      |                           | below for information on the    '
          '|             |\n'
          '      |                           | "cell_contents" attribute.      '
          '|             |\n'
          '      '
          '+---------------------------+---------------------------------+-------------+\n'
          '      | "__annotations__"         | A dict containing annotations   '
          '| Writable    |\n'
          '      |                           | of parameters.  The keys of the '
          '|             |\n'
          '      |                           | dict are the parameter names,   '
          '|             |\n'
          '      |                           | and "\'return\'" for the '
          'return   |             |\n'
          '      |                           | annotation, if provided.        '
          '|             |\n'
          '      '
          '+---------------------------+---------------------------------+-------------+\n'
          '      | "__kwdefaults__"          | A dict containing defaults for  '
          '| Writable    |\n'
          '      |                           | keyword-only parameters.        '
          '|             |\n'
          '      '
          '+---------------------------+---------------------------------+-------------+\n'
          '\n'
          '      Most of the attributes labelled “Writable” check the type of '
          'the\n'
          '      assigned value.\n'
          '\n'
          '      Function objects also support getting and setting arbitrary\n'
          '      attributes, which can be used, for example, to attach '
          'metadata\n'
          '      to functions.  Regular attribute dot-notation is used to get '
          'and\n'
          '      set such attributes. *Note that the current implementation '
          'only\n'
          '      supports function attributes on user-defined functions. '
          'Function\n'
          '      attributes on built-in functions may be supported in the\n'
          '      future.*\n'
          '\n'
          '      A cell object has the attribute "cell_contents". This can be\n'
          '      used to get the value of the cell, as well as set the value.\n'
          '\n'
          '      Additional information about a function’s definition can be\n'
          '      retrieved from its code object; see the description of '
          'internal\n'
          '      types below. The "cell" type can be accessed in the "types"\n'
          '      module.\n'
          '\n'
          '   Instance methods\n'
          '      An instance method object combines a class, a class instance '
          'and\n'
          '      any callable object (normally a user-defined function).\n'
          '\n'
          '      Special read-only attributes: "__self__" is the class '
          'instance\n'
          '      object, "__func__" is the function object; "__doc__" is the\n'
          '      method’s documentation (same as "__func__.__doc__"); '
          '"__name__"\n'
          '      is the method name (same as "__func__.__name__"); '
          '"__module__"\n'
          '      is the name of the module the method was defined in, or '
          '"None"\n'
          '      if unavailable.\n'
          '\n'
          '      Methods also support accessing (but not setting) the '
          'arbitrary\n'
          '      function attributes on the underlying function object.\n'
          '\n'
          '      User-defined method objects may be created when getting an\n'
          '      attribute of a class (perhaps via an instance of that class), '
          'if\n'
          '      that attribute is a user-defined function object or a class\n'
          '      method object.\n'
          '\n'
          '      When an instance method object is created by retrieving a '
          'user-\n'
          '      defined function object from a class via one of its '
          'instances,\n'
          '      its "__self__" attribute is the instance, and the method '
          'object\n'
          '      is said to be bound.  The new method’s "__func__" attribute '
          'is\n'
          '      the original function object.\n'
          '\n'
          '      When an instance method object is created by retrieving a '
          'class\n'
          '      method object from a class or instance, its "__self__" '
          'attribute\n'
          '      is the class itself, and its "__func__" attribute is the\n'
          '      function object underlying the class method.\n'
          '\n'
          '      When an instance method object is called, the underlying\n'
          '      function ("__func__") is called, inserting the class '
          'instance\n'
          '      ("__self__") in front of the argument list.  For instance, '
          'when\n'
          '      "C" is a class which contains a definition for a function '
          '"f()",\n'
          '      and "x" is an instance of "C", calling "x.f(1)" is equivalent '
          'to\n'
          '      calling "C.f(x, 1)".\n'
          '\n'
          '      When an instance method object is derived from a class '
          'method\n'
          '      object, the “class instance” stored in "__self__" will '
          'actually\n'
          '      be the class itself, so that calling either "x.f(1)" or '
          '"C.f(1)"\n'
          '      is equivalent to calling "f(C,1)" where "f" is the '
          'underlying\n'
          '      function.\n'
          '\n'
          '      Note that the transformation from function object to '
          'instance\n'
          '      method object happens each time the attribute is retrieved '
          'from\n'
          '      the instance.  In some cases, a fruitful optimization is to\n'
          '      assign the attribute to a local variable and call that local\n'
          '      variable. Also notice that this transformation only happens '
          'for\n'
          '      user-defined functions; other callable objects (and all non-\n'
          '      callable objects) are retrieved without transformation.  It '
          'is\n'
          '      also important to note that user-defined functions which are\n'
          '      attributes of a class instance are not converted to bound\n'
          '      methods; this *only* happens when the function is an '
          'attribute\n'
          '      of the class.\n'
          '\n'
          '   Generator functions\n'
          '      A function or method which uses the "yield" statement (see\n'
          '      section The yield statement) is called a *generator '
          'function*.\n'
          '      Such a function, when called, always returns an iterator '
          'object\n'
          '      which can be used to execute the body of the function:  '
          'calling\n'
          '      the iterator’s "iterator.__next__()" method will cause the\n'
          '      function to execute until it provides a value using the '
          '"yield"\n'
          '      statement.  When the function executes a "return" statement '
          'or\n'
          '      falls off the end, a "StopIteration" exception is raised and '
          'the\n'
          '      iterator will have reached the end of the set of values to '
          'be\n'
          '      returned.\n'
          '\n'
          '   Coroutine functions\n'
          '      A function or method which is defined using "async def" is\n'
          '      called a *coroutine function*.  Such a function, when '
          'called,\n'
          '      returns a *coroutine* object.  It may contain "await"\n'
          '      expressions, as well as "async with" and "async for" '
          'statements.\n'
          '      See also the Coroutine Objects section.\n'
          '\n'
          '   Asynchronous generator functions\n'
          '      A function or method which is defined using "async def" and\n'
          '      which uses the "yield" statement is called a *asynchronous\n'
          '      generator function*.  Such a function, when called, returns '
          'an\n'
          '      asynchronous iterator object which can be used in an "async '
          'for"\n'
          '      statement to execute the body of the function.\n'
          '\n'
          '      Calling the asynchronous iterator’s "aiterator.__anext__()"\n'
          '      method will return an *awaitable* which when awaited will\n'
          '      execute until it provides a value using the "yield" '
          'expression.\n'
          '      When the function executes an empty "return" statement or '
          'falls\n'
          '      off the end, a "StopAsyncIteration" exception is raised and '
          'the\n'
          '      asynchronous iterator will have reached the end of the set '
          'of\n'
          '      values to be yielded.\n'
          '\n'
          '   Built-in functions\n'
          '      A built-in function object is a wrapper around a C function.\n'
          '      Examples of built-in functions are "len()" and "math.sin()"\n'
          '      ("math" is a standard built-in module). The number and type '
          'of\n'
          '      the arguments are determined by the C function. Special '
          'read-\n'
          '      only attributes: "__doc__" is the function’s documentation\n'
          '      string, or "None" if unavailable; "__name__" is the '
          'function’s\n'
          '      name; "__self__" is set to "None" (but see the next item);\n'
          '      "__module__" is the name of the module the function was '
          'defined\n'
          '      in or "None" if unavailable.\n'
          '\n'
          '   Built-in methods\n'
          '      This is really a different disguise of a built-in function, '
          'this\n'
          '      time containing an object passed to the C function as an\n'
          '      implicit extra argument.  An example of a built-in method is\n'
          '      "alist.append()", assuming *alist* is a list object. In this\n'
          '      case, the special read-only attribute "__self__" is set to '
          'the\n'
          '      object denoted by *alist*.\n'
          '\n'
          '   Classes\n'
          '      Classes are callable.  These objects normally act as '
          'factories\n'
          '      for new instances of themselves, but variations are possible '
          'for\n'
          '      class types that override "__new__()".  The arguments of the\n'
          '      call are passed to "__new__()" and, in the typical case, to\n'
          '      "__init__()" to initialize the new instance.\n'
          '\n'
          '   Class Instances\n'
          '      Instances of arbitrary classes can be made callable by '
          'defining\n'
          '      a "__call__()" method in their class.\n'
          '\n'
          'Modules\n'
          '   Modules are a basic organizational unit of Python code, and are\n'
          '   created by the import system as invoked either by the "import"\n'
          '   statement, or by calling functions such as\n'
          '   "importlib.import_module()" and built-in "__import__()".  A '
          'module\n'
          '   object has a namespace implemented by a dictionary object (this '
          'is\n'
          '   the dictionary referenced by the "__globals__" attribute of\n'
          '   functions defined in the module).  Attribute references are\n'
          '   translated to lookups in this dictionary, e.g., "m.x" is '
          'equivalent\n'
          '   to "m.__dict__["x"]". A module object does not contain the code\n'
          '   object used to initialize the module (since it isn’t needed '
          'once\n'
          '   the initialization is done).\n'
          '\n'
          '   Attribute assignment updates the module’s namespace dictionary,\n'
          '   e.g., "m.x = 1" is equivalent to "m.__dict__["x"] = 1".\n'
          '\n'
          '   Predefined (writable) attributes: "__name__" is the module’s '
          'name;\n'
          '   "__doc__" is the module’s documentation string, or "None" if\n'
          '   unavailable; "__annotations__" (optional) is a dictionary\n'
          '   containing *variable annotations* collected during module body\n'
          '   execution; "__file__" is the pathname of the file from which '
          'the\n'
          '   module was loaded, if it was loaded from a file. The "__file__"\n'
          '   attribute may be missing for certain types of modules, such as '
          'C\n'
          '   modules that are statically linked into the interpreter; for\n'
          '   extension modules loaded dynamically from a shared library, it '
          'is\n'
          '   the pathname of the shared library file.\n'
          '\n'
          '   Special read-only attribute: "__dict__" is the module’s '
          'namespace\n'
          '   as a dictionary object.\n'
          '\n'
          '   **CPython implementation detail:** Because of the way CPython\n'
          '   clears module dictionaries, the module dictionary will be '
          'cleared\n'
          '   when the module falls out of scope even if the dictionary still '
          'has\n'
          '   live references.  To avoid this, copy the dictionary or keep '
          'the\n'
          '   module around while using its dictionary directly.\n'
          '\n'
          'Custom classes\n'
          '   Custom class types are typically created by class definitions '
          '(see\n'
          '   section Class definitions).  A class has a namespace implemented '
          'by\n'
          '   a dictionary object. Class attribute references are translated '
          'to\n'
          '   lookups in this dictionary, e.g., "C.x" is translated to\n'
          '   "C.__dict__["x"]" (although there are a number of hooks which '
          'allow\n'
          '   for other means of locating attributes). When the attribute name '
          'is\n'
          '   not found there, the attribute search continues in the base\n'
          '   classes. This search of the base classes uses the C3 method\n'
          '   resolution order which behaves correctly even in the presence '
          'of\n'
          '   ‘diamond’ inheritance structures where there are multiple\n'
          '   inheritance paths leading back to a common ancestor. Additional\n'
          '   details on the C3 MRO used by Python can be found in the\n'
          '   documentation accompanying the 2.3 release at\n'
          '   https://www.python.org/download/releases/2.3/mro/.\n'
          '\n'
          '   When a class attribute reference (for class "C", say) would '
          'yield a\n'
          '   class method object, it is transformed into an instance method\n'
          '   object whose "__self__" attribute is "C".  When it would yield '
          'a\n'
          '   static method object, it is transformed into the object wrapped '
          'by\n'
          '   the static method object. See section Implementing Descriptors '
          'for\n'
          '   another way in which attributes retrieved from a class may '
          'differ\n'
          '   from those actually contained in its "__dict__".\n'
          '\n'
          '   Class attribute assignments update the class’s dictionary, '
          'never\n'
          '   the dictionary of a base class.\n'
          '\n'
          '   A class object can be called (see above) to yield a class '
          'instance\n'
          '   (see below).\n'
          '\n'
          '   Special attributes: "__name__" is the class name; "__module__" '
          'is\n'
          '   the module name in which the class was defined; "__dict__" is '
          'the\n'
          '   dictionary containing the class’s namespace; "__bases__" is a '
          'tuple\n'
          '   containing the base classes, in the order of their occurrence '
          'in\n'
          '   the base class list; "__doc__" is the class’s documentation '
          'string,\n'
          '   or "None" if undefined; "__annotations__" (optional) is a\n'
          '   dictionary containing *variable annotations* collected during '
          'class\n'
          '   body execution.\n'
          '\n'
          'Class instances\n'
          '   A class instance is created by calling a class object (see '
          'above).\n'
          '   A class instance has a namespace implemented as a dictionary '
          'which\n'
          '   is the first place in which attribute references are searched.\n'
          '   When an attribute is not found there, and the instance’s class '
          'has\n'
          '   an attribute by that name, the search continues with the class\n'
          '   attributes.  If a class attribute is found that is a '
          'user-defined\n'
          '   function object, it is transformed into an instance method '
          'object\n'
          '   whose "__self__" attribute is the instance.  Static method and\n'
          '   class method objects are also transformed; see above under\n'
          '   “Classes”.  See section Implementing Descriptors for another way '
          'in\n'
          '   which attributes of a class retrieved via its instances may '
          'differ\n'
          '   from the objects actually stored in the class’s "__dict__".  If '
          'no\n'
          '   class attribute is found, and the object’s class has a\n'
          '   "__getattr__()" method, that is called to satisfy the lookup.\n'
          '\n'
          '   Attribute assignments and deletions update the instance’s\n'
          '   dictionary, never a class’s dictionary.  If the class has a\n'
          '   "__setattr__()" or "__delattr__()" method, this is called '
          'instead\n'
          '   of updating the instance dictionary directly.\n'
          '\n'
          '   Class instances can pretend to be numbers, sequences, or '
          'mappings\n'
          '   if they have methods with certain special names.  See section\n'
          '   Special method names.\n'
          '\n'
          '   Special attributes: "__dict__" is the attribute dictionary;\n'
          '   "__class__" is the instance’s class.\n'
          '\n'
          'I/O objects (also known as file objects)\n'
          '   A *file object* represents an open file.  Various shortcuts are\n'
          '   available to create file objects: the "open()" built-in '
          'function,\n'
          '   and also "os.popen()", "os.fdopen()", and the "makefile()" '
          'method\n'
          '   of socket objects (and perhaps by other functions or methods\n'
          '   provided by extension modules).\n'
          '\n'
          '   The objects "sys.stdin", "sys.stdout" and "sys.stderr" are\n'
          '   initialized to file objects corresponding to the interpreter’s\n'
          '   standard input, output and error streams; they are all open in '
          'text\n'
          '   mode and therefore follow the interface defined by the\n'
          '   "io.TextIOBase" abstract class.\n'
          '\n'
          'Internal types\n'
          '   A few types used internally by the interpreter are exposed to '
          'the\n'
          '   user. Their definitions may change with future versions of the\n'
          '   interpreter, but they are mentioned here for completeness.\n'
          '\n'
          '   Code objects\n'
          '      Code objects represent *byte-compiled* executable Python '
          'code,\n'
          '      or *bytecode*. The difference between a code object and a\n'
          '      function object is that the function object contains an '
          'explicit\n'
          '      reference to the function’s globals (the module in which it '
          'was\n'
          '      defined), while a code object contains no context; also the\n'
          '      default argument values are stored in the function object, '
          'not\n'
          '      in the code object (because they represent values calculated '
          'at\n'
          '      run-time).  Unlike function objects, code objects are '
          'immutable\n'
          '      and contain no references (directly or indirectly) to '
          'mutable\n'
          '      objects.\n'
          '\n'
          '      Special read-only attributes: "co_name" gives the function '
          'name;\n'
          '      "co_argcount" is the total number of positional arguments\n'
          '      (including positional-only arguments and arguments with '
          'default\n'
          '      values); "co_posonlyargcount" is the number of '
          'positional-only\n'
          '      arguments (including arguments with default values);\n'
          '      "co_kwonlyargcount" is the number of keyword-only arguments\n'
          '      (including arguments with default values); "co_nlocals" is '
          'the\n'
          '      number of local variables used by the function (including\n'
          '      arguments); "co_varnames" is a tuple containing the names of '
          'the\n'
          '      local variables (starting with the argument names);\n'
          '      "co_cellvars" is a tuple containing the names of local '
          'variables\n'
          '      that are referenced by nested functions; "co_freevars" is a\n'
          '      tuple containing the names of free variables; "co_code" is a\n'
          '      string representing the sequence of bytecode instructions;\n'
          '      "co_consts" is a tuple containing the literals used by the\n'
          '      bytecode; "co_names" is a tuple containing the names used by '
          'the\n'
          '      bytecode; "co_filename" is the filename from which the code '
          'was\n'
          '      compiled; "co_firstlineno" is the first line number of the\n'
          '      function; "co_lnotab" is a string encoding the mapping from\n'
          '      bytecode offsets to line numbers (for details see the source\n'
          '      code of the interpreter); "co_stacksize" is the required '
          'stack\n'
          '      size; "co_flags" is an integer encoding a number of flags '
          'for\n'
          '      the interpreter.\n'
          '\n'
          '      The following flag bits are defined for "co_flags": bit '
          '"0x04"\n'
          '      is set if the function uses the "*arguments" syntax to accept '
          'an\n'
          '      arbitrary number of positional arguments; bit "0x08" is set '
          'if\n'
          '      the function uses the "**keywords" syntax to accept '
          'arbitrary\n'
          '      keyword arguments; bit "0x20" is set if the function is a\n'
          '      generator.\n'
          '\n'
          '      Future feature declarations ("from __future__ import '
          'division")\n'
          '      also use bits in "co_flags" to indicate whether a code '
          'object\n'
          '      was compiled with a particular feature enabled: bit "0x2000" '
          'is\n'
          '      set if the function was compiled with future division '
          'enabled;\n'
          '      bits "0x10" and "0x1000" were used in earlier versions of\n'
          '      Python.\n'
          '\n'
          '      Other bits in "co_flags" are reserved for internal use.\n'
          '\n'
          '      If a code object represents a function, the first item in\n'
          '      "co_consts" is the documentation string of the function, or\n'
          '      "None" if undefined.\n'
          '\n'
          '   Frame objects\n'
          '      Frame objects represent execution frames.  They may occur in\n'
          '      traceback objects (see below), and are also passed to '
          'registered\n'
          '      trace functions.\n'
          '\n'
          '      Special read-only attributes: "f_back" is to the previous '
          'stack\n'
          '      frame (towards the caller), or "None" if this is the bottom\n'
          '      stack frame; "f_code" is the code object being executed in '
          'this\n'
          '      frame; "f_locals" is the dictionary used to look up local\n'
          '      variables; "f_globals" is used for global variables;\n'
          '      "f_builtins" is used for built-in (intrinsic) names; '
          '"f_lasti"\n'
          '      gives the precise instruction (this is an index into the\n'
          '      bytecode string of the code object).\n'
          '\n'
          '      Accessing "f_code" raises an auditing event '
          '"object.__getattr__"\n'
          '      with arguments "obj" and ""f_code"".\n'
          '\n'
          '      Special writable attributes: "f_trace", if not "None", is a\n'
          '      function called for various events during code execution '
          '(this\n'
          '      is used by the debugger). Normally an event is triggered for\n'
          '      each new source line - this can be disabled by setting\n'
          '      "f_trace_lines" to "False".\n'
          '\n'
          '      Implementations *may* allow per-opcode events to be requested '
          'by\n'
          '      setting "f_trace_opcodes" to "True". Note that this may lead '
          'to\n'
          '      undefined interpreter behaviour if exceptions raised by the\n'
          '      trace function escape to the function being traced.\n'
          '\n'
          '      "f_lineno" is the current line number of the frame — writing '
          'to\n'
          '      this from within a trace function jumps to the given line '
          '(only\n'
          '      for the bottom-most frame).  A debugger can implement a Jump\n'
          '      command (aka Set Next Statement) by writing to f_lineno.\n'
          '\n'
          '      Frame objects support one method:\n'
          '\n'
          '      frame.clear()\n'
          '\n'
          '         This method clears all references to local variables held '
          'by\n'
          '         the frame.  Also, if the frame belonged to a generator, '
          'the\n'
          '         generator is finalized.  This helps break reference '
          'cycles\n'
          '         involving frame objects (for example when catching an\n'
          '         exception and storing its traceback for later use).\n'
          '\n'
          '         "RuntimeError" is raised if the frame is currently '
          'executing.\n'
          '\n'
          '         New in version 3.4.\n'
          '\n'
          '   Traceback objects\n'
          '      Traceback objects represent a stack trace of an exception.  '
          'A\n'
          '      traceback object is implicitly created when an exception '
          'occurs,\n'
          '      and may also be explicitly created by calling\n'
          '      "types.TracebackType".\n'
          '\n'
          '      For implicitly created tracebacks, when the search for an\n'
          '      exception handler unwinds the execution stack, at each '
          'unwound\n'
          '      level a traceback object is inserted in front of the current\n'
          '      traceback.  When an exception handler is entered, the stack\n'
          '      trace is made available to the program. (See section The try\n'
          '      statement.) It is accessible as the third item of the tuple\n'
          '      returned by "sys.exc_info()", and as the "__traceback__"\n'
          '      attribute of the caught exception.\n'
          '\n'
          '      When the program contains no suitable handler, the stack '
          'trace\n'
          '      is written (nicely formatted) to the standard error stream; '
          'if\n'
          '      the interpreter is interactive, it is also made available to '
          'the\n'
          '      user as "sys.last_traceback".\n'
          '\n'
          '      For explicitly created tracebacks, it is up to the creator '
          'of\n'
          '      the traceback to determine how the "tb_next" attributes '
          'should\n'
          '      be linked to form a full stack trace.\n'
          '\n'
          '      Special read-only attributes: "tb_frame" points to the '
          'execution\n'
          '      frame of the current level; "tb_lineno" gives the line '
          'number\n'
          '      where the exception occurred; "tb_lasti" indicates the '
          'precise\n'
          '      instruction. The line number and last instruction in the\n'
          '      traceback may differ from the line number of its frame object '
          'if\n'
          '      the exception occurred in a "try" statement with no matching\n'
          '      except clause or with a finally clause.\n'
          '\n'
          '      Accessing "tb_frame" raises an auditing event\n'
          '      "object.__getattr__" with arguments "obj" and ""tb_frame"".\n'
          '\n'
          '      Special writable attribute: "tb_next" is the next level in '
          'the\n'
          '      stack trace (towards the frame where the exception occurred), '
          'or\n'
          '      "None" if there is no next level.\n'
          '\n'
          '      Changed in version 3.7: Traceback objects can now be '
          'explicitly\n'
          '      instantiated from Python code, and the "tb_next" attribute '
          'of\n'
          '      existing instances can be updated.\n'
          '\n'
          '   Slice objects\n'
          '      Slice objects are used to represent slices for '
          '"__getitem__()"\n'
          '      methods.  They are also created by the built-in "slice()"\n'
          '      function.\n'
          '\n'
          '      Special read-only attributes: "start" is the lower bound; '
          '"stop"\n'
          '      is the upper bound; "step" is the step value; each is "None" '
          'if\n'
          '      omitted.  These attributes can have any type.\n'
          '\n'
          '      Slice objects support one method:\n'
          '\n'
          '      slice.indices(self, length)\n'
          '\n'
          '         This method takes a single integer argument *length* and\n'
          '         computes information about the slice that the slice '
          'object\n'
          '         would describe if applied to a sequence of *length* '
          'items.\n'
          '         It returns a tuple of three integers; respectively these '
          'are\n'
          '         the *start* and *stop* indices and the *step* or stride\n'
          '         length of the slice. Missing or out-of-bounds indices are\n'
          '         handled in a manner consistent with regular slices.\n'
          '\n'
          '   Static method objects\n'
          '      Static method objects provide a way of defeating the\n'
          '      transformation of function objects to method objects '
          'described\n'
          '      above. A static method object is a wrapper around any other\n'
          '      object, usually a user-defined method object. When a static\n'
          '      method object is retrieved from a class or a class instance, '
          'the\n'
          '      object actually returned is the wrapped object, which is not\n'
          '      subject to any further transformation. Static method objects '
          'are\n'
          '      not themselves callable, although the objects they wrap '
          'usually\n'
          '      are. Static method objects are created by the built-in\n'
          '      "staticmethod()" constructor.\n'
          '\n'
          '   Class method objects\n'
          '      A class method object, like a static method object, is a '
          'wrapper\n'
          '      around another object that alters the way in which that '
          'object\n'
          '      is retrieved from classes and class instances. The behaviour '
          'of\n'
          '      class method objects upon such retrieval is described above,\n'
          '      under “User-defined methods”. Class method objects are '
          'created\n'
          '      by the built-in "classmethod()" constructor.\n',
 'typesfunctions': 'Functions\n'
                   '*********\n'
                   '\n'
                   'Function objects are created by function definitions.  The '
                   'only\n'
                   'operation on a function object is to call it: '
                   '"func(argument-list)".\n'
                   '\n'
                   'There are really two flavors of function objects: built-in '
                   'functions\n'
                   'and user-defined functions.  Both support the same '
                   'operation (to call\n'
                   'the function), but the implementation is different, hence '
                   'the\n'
                   'different object types.\n'
                   '\n'
                   'See Function definitions for more information.\n',
 'typesmapping': 'Mapping Types — "dict"\n'
                 '**********************\n'
                 '\n'
                 'A *mapping* object maps *hashable* values to arbitrary '
                 'objects.\n'
                 'Mappings are mutable objects.  There is currently only one '
                 'standard\n'
                 'mapping type, the *dictionary*.  (For other containers see '
                 'the built-\n'
                 'in "list", "set", and "tuple" classes, and the "collections" '
                 'module.)\n'
                 '\n'
                 'A dictionary’s keys are *almost* arbitrary values.  Values '
                 'that are\n'
                 'not *hashable*, that is, values containing lists, '
                 'dictionaries or\n'
                 'other mutable types (that are compared by value rather than '
                 'by object\n'
                 'identity) may not be used as keys.  Numeric types used for '
                 'keys obey\n'
                 'the normal rules for numeric comparison: if two numbers '
                 'compare equal\n'
                 '(such as "1" and "1.0") then they can be used '
                 'interchangeably to index\n'
                 'the same dictionary entry.  (Note however, that since '
                 'computers store\n'
                 'floating-point numbers as approximations it is usually '
                 'unwise to use\n'
                 'them as dictionary keys.)\n'
                 '\n'
                 'Dictionaries can be created by placing a comma-separated '
                 'list of "key:\n'
                 'value" pairs within braces, for example: "{\'jack\': 4098, '
                 "'sjoerd':\n"
                 '4127}" or "{4098: \'jack\', 4127: \'sjoerd\'}", or by the '
                 '"dict"\n'
                 'constructor.\n'
                 '\n'
                 'class dict(**kwarg)\n'
                 'class dict(mapping, **kwarg)\n'
                 'class dict(iterable, **kwarg)\n'
                 '\n'
                 '   Return a new dictionary initialized from an optional '
                 'positional\n'
                 '   argument and a possibly empty set of keyword arguments.\n'
                 '\n'
                 '   Dictionaries can be created by several means:\n'
                 '\n'
                 '   * Use a comma-separated list of "key: value" pairs within '
                 'braces:\n'
                 '     "{\'jack\': 4098, \'sjoerd\': 4127}" or "{4098: '
                 "'jack', 4127:\n"
                 '     \'sjoerd\'}"\n'
                 '\n'
                 '   * Use a dict comprehension: "{}", "{x: x ** 2 for x in '
                 'range(10)}"\n'
                 '\n'
                 '   * Use the type constructor: "dict()", "dict([(\'foo\', '
                 "100), ('bar',\n"
                 '     200)])", "dict(foo=100, bar=200)"\n'
                 '\n'
                 '   If no positional argument is given, an empty dictionary '
                 'is created.\n'
                 '   If a positional argument is given and it is a mapping '
                 'object, a\n'
                 '   dictionary is created with the same key-value pairs as '
                 'the mapping\n'
                 '   object.  Otherwise, the positional argument must be an '
                 '*iterable*\n'
                 '   object.  Each item in the iterable must itself be an '
                 'iterable with\n'
                 '   exactly two objects.  The first object of each item '
                 'becomes a key\n'
                 '   in the new dictionary, and the second object the '
                 'corresponding\n'
                 '   value.  If a key occurs more than once, the last value '
                 'for that key\n'
                 '   becomes the corresponding value in the new dictionary.\n'
                 '\n'
                 '   If keyword arguments are given, the keyword arguments and '
                 'their\n'
                 '   values are added to the dictionary created from the '
                 'positional\n'
                 '   argument.  If a key being added is already present, the '
                 'value from\n'
                 '   the keyword argument replaces the value from the '
                 'positional\n'
                 '   argument.\n'
                 '\n'
                 '   To illustrate, the following examples all return a '
                 'dictionary equal\n'
                 '   to "{"one": 1, "two": 2, "three": 3}":\n'
                 '\n'
                 '      >>> a = dict(one=1, two=2, three=3)\n'
                 "      >>> b = {'one': 1, 'two': 2, 'three': 3}\n"
                 "      >>> c = dict(zip(['one', 'two', 'three'], [1, 2, 3]))\n"
                 "      >>> d = dict([('two', 2), ('one', 1), ('three', 3)])\n"
                 "      >>> e = dict({'three': 3, 'one': 1, 'two': 2})\n"
                 '      >>> a == b == c == d == e\n'
                 '      True\n'
                 '\n'
                 '   Providing keyword arguments as in the first example only '
                 'works for\n'
                 '   keys that are valid Python identifiers.  Otherwise, any '
                 'valid keys\n'
                 '   can be used.\n'
                 '\n'
                 '   These are the operations that dictionaries support (and '
                 'therefore,\n'
                 '   custom mapping types should support too):\n'
                 '\n'
                 '   list(d)\n'
                 '\n'
                 '      Return a list of all the keys used in the dictionary '
                 '*d*.\n'
                 '\n'
                 '   len(d)\n'
                 '\n'
                 '      Return the number of items in the dictionary *d*.\n'
                 '\n'
                 '   d[key]\n'
                 '\n'
                 '      Return the item of *d* with key *key*.  Raises a '
                 '"KeyError" if\n'
                 '      *key* is not in the map.\n'
                 '\n'
                 '      If a subclass of dict defines a method "__missing__()" '
                 'and *key*\n'
                 '      is not present, the "d[key]" operation calls that '
                 'method with\n'
                 '      the key *key* as argument.  The "d[key]" operation '
                 'then returns\n'
                 '      or raises whatever is returned or raised by the\n'
                 '      "__missing__(key)" call. No other operations or '
                 'methods invoke\n'
                 '      "__missing__()". If "__missing__()" is not defined, '
                 '"KeyError"\n'
                 '      is raised. "__missing__()" must be a method; it cannot '
                 'be an\n'
                 '      instance variable:\n'
                 '\n'
                 '         >>> class Counter(dict):\n'
                 '         ...     def __missing__(self, key):\n'
                 '         ...         return 0\n'
                 '         >>> c = Counter()\n'
                 "         >>> c['red']\n"
                 '         0\n'
                 "         >>> c['red'] += 1\n"
                 "         >>> c['red']\n"
                 '         1\n'
                 '\n'
                 '      The example above shows part of the implementation of\n'
                 '      "collections.Counter".  A different "__missing__" '
                 'method is used\n'
                 '      by "collections.defaultdict".\n'
                 '\n'
                 '   d[key] = value\n'
                 '\n'
                 '      Set "d[key]" to *value*.\n'
                 '\n'
                 '   del d[key]\n'
                 '\n'
                 '      Remove "d[key]" from *d*.  Raises a "KeyError" if '
                 '*key* is not\n'
                 '      in the map.\n'
                 '\n'
                 '   key in d\n'
                 '\n'
                 '      Return "True" if *d* has a key *key*, else "False".\n'
                 '\n'
                 '   key not in d\n'
                 '\n'
                 '      Equivalent to "not key in d".\n'
                 '\n'
                 '   iter(d)\n'
                 '\n'
                 '      Return an iterator over the keys of the dictionary.  '
                 'This is a\n'
                 '      shortcut for "iter(d.keys())".\n'
                 '\n'
                 '   clear()\n'
                 '\n'
                 '      Remove all items from the dictionary.\n'
                 '\n'
                 '   copy()\n'
                 '\n'
                 '      Return a shallow copy of the dictionary.\n'
                 '\n'
                 '   classmethod fromkeys(iterable[, value])\n'
                 '\n'
                 '      Create a new dictionary with keys from *iterable* and '
                 'values set\n'
                 '      to *value*.\n'
                 '\n'
                 '      "fromkeys()" is a class method that returns a new '
                 'dictionary.\n'
                 '      *value* defaults to "None".  All of the values refer '
                 'to just a\n'
                 '      single instance, so it generally doesn’t make sense '
                 'for *value*\n'
                 '      to be a mutable object such as an empty list.  To get '
                 'distinct\n'
                 '      values, use a dict comprehension instead.\n'
                 '\n'
                 '   get(key[, default])\n'
                 '\n'
                 '      Return the value for *key* if *key* is in the '
                 'dictionary, else\n'
                 '      *default*. If *default* is not given, it defaults to '
                 '"None", so\n'
                 '      that this method never raises a "KeyError".\n'
                 '\n'
                 '   items()\n'
                 '\n'
                 '      Return a new view of the dictionary’s items ("(key, '
                 'value)"\n'
                 '      pairs). See the documentation of view objects.\n'
                 '\n'
                 '   keys()\n'
                 '\n'
                 '      Return a new view of the dictionary’s keys.  See the\n'
                 '      documentation of view objects.\n'
                 '\n'
                 '   pop(key[, default])\n'
                 '\n'
                 '      If *key* is in the dictionary, remove it and return '
                 'its value,\n'
                 '      else return *default*.  If *default* is not given and '
                 '*key* is\n'
                 '      not in the dictionary, a "KeyError" is raised.\n'
                 '\n'
                 '   popitem()\n'
                 '\n'
                 '      Remove and return a "(key, value)" pair from the '
                 'dictionary.\n'
                 '      Pairs are returned in LIFO (last-in, first-out) '
                 'order.\n'
                 '\n'
                 '      "popitem()" is useful to destructively iterate over a\n'
                 '      dictionary, as often used in set algorithms.  If the '
                 'dictionary\n'
                 '      is empty, calling "popitem()" raises a "KeyError".\n'
                 '\n'
                 '      Changed in version 3.7: LIFO order is now guaranteed. '
                 'In prior\n'
                 '      versions, "popitem()" would return an arbitrary '
                 'key/value pair.\n'
                 '\n'
                 '   reversed(d)\n'
                 '\n'
                 '      Return a reverse iterator over the keys of the '
                 'dictionary. This\n'
                 '      is a shortcut for "reversed(d.keys())".\n'
                 '\n'
                 '      New in version 3.8.\n'
                 '\n'
                 '   setdefault(key[, default])\n'
                 '\n'
                 '      If *key* is in the dictionary, return its value.  If '
                 'not, insert\n'
                 '      *key* with a value of *default* and return *default*.  '
                 '*default*\n'
                 '      defaults to "None".\n'
                 '\n'
                 '   update([other])\n'
                 '\n'
                 '      Update the dictionary with the key/value pairs from '
                 '*other*,\n'
                 '      overwriting existing keys.  Return "None".\n'
                 '\n'
                 '      "update()" accepts either another dictionary object or '
                 'an\n'
                 '      iterable of key/value pairs (as tuples or other '
                 'iterables of\n'
                 '      length two).  If keyword arguments are specified, the '
                 'dictionary\n'
                 '      is then updated with those key/value pairs: '
                 '"d.update(red=1,\n'
                 '      blue=2)".\n'
                 '\n'
                 '   values()\n'
                 '\n'
                 '      Return a new view of the dictionary’s values.  See '
                 'the\n'
                 '      documentation of view objects.\n'
                 '\n'
                 '      An equality comparison between one "dict.values()" '
                 'view and\n'
                 '      another will always return "False". This also applies '
                 'when\n'
                 '      comparing "dict.values()" to itself:\n'
                 '\n'
                 "         >>> d = {'a': 1}\n"
                 '         >>> d.values() == d.values()\n'
                 '         False\n'
                 '\n'
                 '   Dictionaries compare equal if and only if they have the '
                 'same "(key,\n'
                 '   value)" pairs (regardless of ordering). Order comparisons '
                 '(‘<’,\n'
                 '   ‘<=’, ‘>=’, ‘>’) raise "TypeError".\n'
                 '\n'
                 '   Dictionaries preserve insertion order.  Note that '
                 'updating a key\n'
                 '   does not affect the order.  Keys added after deletion are '
                 'inserted\n'
                 '   at the end.\n'
                 '\n'
                 '      >>> d = {"one": 1, "two": 2, "three": 3, "four": 4}\n'
                 '      >>> d\n'
                 "      {'one': 1, 'two': 2, 'three': 3, 'four': 4}\n"
                 '      >>> list(d)\n'
                 "      ['one', 'two', 'three', 'four']\n"
                 '      >>> list(d.values())\n'
                 '      [1, 2, 3, 4]\n'
                 '      >>> d["one"] = 42\n'
                 '      >>> d\n'
                 "      {'one': 42, 'two': 2, 'three': 3, 'four': 4}\n"
                 '      >>> del d["two"]\n'
                 '      >>> d["two"] = None\n'
                 '      >>> d\n'
                 "      {'one': 42, 'three': 3, 'four': 4, 'two': None}\n"
                 '\n'
                 '   Changed in version 3.7: Dictionary order is guaranteed to '
                 'be\n'
                 '   insertion order.  This behavior was an implementation '
                 'detail of\n'
                 '   CPython from 3.6.\n'
                 '\n'
                 '   Dictionaries and dictionary views are reversible.\n'
                 '\n'
                 '      >>> d = {"one": 1, "two": 2, "three": 3, "four": 4}\n'
                 '      >>> d\n'
                 "      {'one': 1, 'two': 2, 'three': 3, 'four': 4}\n"
                 '      >>> list(reversed(d))\n'
                 "      ['four', 'three', 'two', 'one']\n"
                 '      >>> list(reversed(d.values()))\n'
                 '      [4, 3, 2, 1]\n'
                 '      >>> list(reversed(d.items()))\n'
                 "      [('four', 4), ('three', 3), ('two', 2), ('one', 1)]\n"
                 '\n'
                 '   Changed in version 3.8: Dictionaries are now reversible.\n'
                 '\n'
                 'See also:\n'
                 '\n'
                 '  "types.MappingProxyType" can be used to create a read-only '
                 'view of a\n'
                 '  "dict".\n'
                 '\n'
                 '\n'
                 'Dictionary view objects\n'
                 '=======================\n'
                 '\n'
                 'The objects returned by "dict.keys()", "dict.values()" and\n'
                 '"dict.items()" are *view objects*.  They provide a dynamic '
                 'view on the\n'
                 'dictionary’s entries, which means that when the dictionary '
                 'changes,\n'
                 'the view reflects these changes.\n'
                 '\n'
                 'Dictionary views can be iterated over to yield their '
                 'respective data,\n'
                 'and support membership tests:\n'
                 '\n'
                 'len(dictview)\n'
                 '\n'
                 '   Return the number of entries in the dictionary.\n'
                 '\n'
                 'iter(dictview)\n'
                 '\n'
                 '   Return an iterator over the keys, values or items '
                 '(represented as\n'
                 '   tuples of "(key, value)") in the dictionary.\n'
                 '\n'
                 '   Keys and values are iterated over in insertion order. '
                 'This allows\n'
                 '   the creation of "(value, key)" pairs using "zip()": '
                 '"pairs =\n'
                 '   zip(d.values(), d.keys())".  Another way to create the '
                 'same list is\n'
                 '   "pairs = [(v, k) for (k, v) in d.items()]".\n'
                 '\n'
                 '   Iterating views while adding or deleting entries in the '
                 'dictionary\n'
                 '   may raise a "RuntimeError" or fail to iterate over all '
                 'entries.\n'
                 '\n'
                 '   Changed in version 3.7: Dictionary order is guaranteed to '
                 'be\n'
                 '   insertion order.\n'
                 '\n'
                 'x in dictview\n'
                 '\n'
                 '   Return "True" if *x* is in the underlying dictionary’s '
                 'keys, values\n'
                 '   or items (in the latter case, *x* should be a "(key, '
                 'value)"\n'
                 '   tuple).\n'
                 '\n'
                 'reversed(dictview)\n'
                 '\n'
                 '   Return a reverse iterator over the keys, values or items '
                 'of the\n'
                 '   dictionary. The view will be iterated in reverse order of '
                 'the\n'
                 '   insertion.\n'
                 '\n'
                 '   Changed in version 3.8: Dictionary views are now '
                 'reversible.\n'
                 '\n'
                 'Keys views are set-like since their entries are unique and '
                 'hashable.\n'
                 'If all values are hashable, so that "(key, value)" pairs are '
                 'unique\n'
                 'and hashable, then the items view is also set-like.  (Values '
                 'views are\n'
                 'not treated as set-like since the entries are generally not '
                 'unique.)\n'
                 'For set-like views, all of the operations defined for the '
                 'abstract\n'
                 'base class "collections.abc.Set" are available (for example, '
                 '"==",\n'
                 '"<", or "^").\n'
                 '\n'
                 'An example of dictionary view usage:\n'
                 '\n'
                 "   >>> dishes = {'eggs': 2, 'sausage': 1, 'bacon': 1, "
                 "'spam': 500}\n"
                 '   >>> keys = dishes.keys()\n'
                 '   >>> values = dishes.values()\n'
                 '\n'
                 '   >>> # iteration\n'
                 '   >>> n = 0\n'
                 '   >>> for val in values:\n'
                 '   ...     n += val\n'
                 '   >>> print(n)\n'
                 '   504\n'
                 '\n'
                 '   >>> # keys and values are iterated over in the same order '
                 '(insertion order)\n'
                 '   >>> list(keys)\n'
                 "   ['eggs', 'sausage', 'bacon', 'spam']\n"
                 '   >>> list(values)\n'
                 '   [2, 1, 1, 500]\n'
                 '\n'
                 '   >>> # view objects are dynamic and reflect dict changes\n'
                 "   >>> del dishes['eggs']\n"
                 "   >>> del dishes['sausage']\n"
                 '   >>> list(keys)\n'
                 "   ['bacon', 'spam']\n"
                 '\n'
                 '   >>> # set operations\n'
                 "   >>> keys & {'eggs', 'bacon', 'salad'}\n"
                 "   {'bacon'}\n"
                 "   >>> keys ^ {'sausage', 'juice'}\n"
                 "   {'juice', 'sausage', 'bacon', 'spam'}\n",
 'typesmethods': 'Methods\n'
                 '*******\n'
                 '\n'
                 'Methods are functions that are called using the attribute '
                 'notation.\n'
                 'There are two flavors: built-in methods (such as "append()" '
                 'on lists)\n'
                 'and class instance methods.  Built-in methods are described '
                 'with the\n'
                 'types that support them.\n'
                 '\n'
                 'If you access a method (a function defined in a class '
                 'namespace)\n'
                 'through an instance, you get a special object: a *bound '
                 'method* (also\n'
                 'called *instance method*) object. When called, it will add '
                 'the "self"\n'
                 'argument to the argument list.  Bound methods have two '
                 'special read-\n'
                 'only attributes: "m.__self__" is the object on which the '
                 'method\n'
                 'operates, and "m.__func__" is the function implementing the '
                 'method.\n'
                 'Calling "m(arg-1, arg-2, ..., arg-n)" is completely '
                 'equivalent to\n'
                 'calling "m.__func__(m.__self__, arg-1, arg-2, ..., arg-n)".\n'
                 '\n'
                 'Like function objects, bound method objects support getting '
                 'arbitrary\n'
                 'attributes.  However, since method attributes are actually '
                 'stored on\n'
                 'the underlying function object ("meth.__func__"), setting '
                 'method\n'
                 'attributes on bound methods is disallowed.  Attempting to '
                 'set an\n'
                 'attribute on a method results in an "AttributeError" being '
                 'raised.  In\n'
                 'order to set a method attribute, you need to explicitly set '
                 'it on the\n'
                 'underlying function object:\n'
                 '\n'
                 '   >>> class C:\n'
                 '   ...     def method(self):\n'
                 '   ...         pass\n'
                 '   ...\n'
                 '   >>> c = C()\n'
                 "   >>> c.method.whoami = 'my name is method'  # can't set on "
                 'the method\n'
                 '   Traceback (most recent call last):\n'
                 '     File "<stdin>", line 1, in <module>\n'
                 "   AttributeError: 'method' object has no attribute "
                 "'whoami'\n"
                 "   >>> c.method.__func__.whoami = 'my name is method'\n"
                 '   >>> c.method.whoami\n'
                 "   'my name is method'\n"
                 '\n'
                 'See The standard type hierarchy for more information.\n',
 'typesmodules': 'Modules\n'
                 '*******\n'
                 '\n'
                 'The only special operation on a module is attribute access: '
                 '"m.name",\n'
                 'where *m* is a module and *name* accesses a name defined in '
                 '*m*’s\n'
                 'symbol table. Module attributes can be assigned to.  (Note '
                 'that the\n'
                 '"import" statement is not, strictly speaking, an operation '
                 'on a module\n'
                 'object; "import foo" does not require a module object named '
                 '*foo* to\n'
                 'exist, rather it requires an (external) *definition* for a '
                 'module\n'
                 'named *foo* somewhere.)\n'
                 '\n'
                 'A special attribute of every module is "__dict__". This is '
                 'the\n'
                 'dictionary containing the module’s symbol table. Modifying '
                 'this\n'
                 'dictionary will actually change the module’s symbol table, '
                 'but direct\n'
                 'assignment to the "__dict__" attribute is not possible (you '
                 'can write\n'
                 '"m.__dict__[\'a\'] = 1", which defines "m.a" to be "1", but '
                 'you can’t\n'
                 'write "m.__dict__ = {}").  Modifying "__dict__" directly is '
                 'not\n'
                 'recommended.\n'
                 '\n'
                 'Modules built into the interpreter are written like this: '
                 '"<module\n'
                 '\'sys\' (built-in)>".  If loaded from a file, they are '
                 'written as\n'
                 '"<module \'os\' from '
                 '\'/usr/local/lib/pythonX.Y/os.pyc\'>".\n',
 'typesseq': 'Sequence Types — "list", "tuple", "range"\n'
             '*****************************************\n'
             '\n'
             'There are three basic sequence types: lists, tuples, and range\n'
             'objects. Additional sequence types tailored for processing of '
             'binary\n'
             'data and text strings are described in dedicated sections.\n'
             '\n'
             '\n'
             'Common Sequence Operations\n'
             '==========================\n'
             '\n'
             'The operations in the following table are supported by most '
             'sequence\n'
             'types, both mutable and immutable. The '
             '"collections.abc.Sequence" ABC\n'
             'is provided to make it easier to correctly implement these '
             'operations\n'
             'on custom sequence types.\n'
             '\n'
             'This table lists the sequence operations sorted in ascending '
             'priority.\n'
             'In the table, *s* and *t* are sequences of the same type, *n*, '
             '*i*,\n'
             '*j* and *k* are integers and *x* is an arbitrary object that '
             'meets any\n'
             'type and value restrictions imposed by *s*.\n'
             '\n'
             'The "in" and "not in" operations have the same priorities as '
             'the\n'
             'comparison operations. The "+" (concatenation) and "*" '
             '(repetition)\n'
             'operations have the same priority as the corresponding numeric\n'
             'operations. [3]\n'
             '\n'
             '+----------------------------+----------------------------------+------------+\n'
             '| Operation                  | Result                           '
             '| Notes      |\n'
             '|============================|==================================|============|\n'
             '| "x in s"                   | "True" if an item of *s* is      '
             '| (1)        |\n'
             '|                            | equal to *x*, else "False"       '
             '|            |\n'
             '+----------------------------+----------------------------------+------------+\n'
             '| "x not in s"               | "False" if an item of *s* is     '
             '| (1)        |\n'
             '|                            | equal to *x*, else "True"        '
             '|            |\n'
             '+----------------------------+----------------------------------+------------+\n'
             '| "s + t"                    | the concatenation of *s* and *t* '
             '| (6)(7)     |\n'
             '+----------------------------+----------------------------------+------------+\n'
             '| "s * n" or "n * s"         | equivalent to adding *s* to      '
             '| (2)(7)     |\n'
             '|                            | itself *n* times                 '
             '|            |\n'
             '+----------------------------+----------------------------------+------------+\n'
             '| "s[i]"                     | *i*th item of *s*, origin 0      '
             '| (3)        |\n'
             '+----------------------------+----------------------------------+------------+\n'
             '| "s[i:j]"                   | slice of *s* from *i* to *j*     '
             '| (3)(4)     |\n'
             '+----------------------------+----------------------------------+------------+\n'
             '| "s[i:j:k]"                 | slice of *s* from *i* to *j*     '
             '| (3)(5)     |\n'
             '|                            | with step *k*                    '
             '|            |\n'
             '+----------------------------+----------------------------------+------------+\n'
             '| "len(s)"                   | length of *s*                    '
             '|            |\n'
             '+----------------------------+----------------------------------+------------+\n'
             '| "min(s)"                   | smallest item of *s*             '
             '|            |\n'
             '+----------------------------+----------------------------------+------------+\n'
             '| "max(s)"                   | largest item of *s*              '
             '|            |\n'
             '+----------------------------+----------------------------------+------------+\n'
             '| "s.index(x[, i[, j]])"     | index of the first occurrence of '
             '| (8)        |\n'
             '|                            | *x* in *s* (at or after index    '
             '|            |\n'
             '|                            | *i* and before index *j*)        '
             '|            |\n'
             '+----------------------------+----------------------------------+------------+\n'
             '| "s.count(x)"               | total number of occurrences of   '
             '|            |\n'
             '|                            | *x* in *s*                       '
             '|            |\n'
             '+----------------------------+----------------------------------+------------+\n'
             '\n'
             'Sequences of the same type also support comparisons.  In '
             'particular,\n'
             'tuples and lists are compared lexicographically by comparing\n'
             'corresponding elements. This means that to compare equal, every\n'
             'element must compare equal and the two sequences must be of the '
             'same\n'
             'type and have the same length.  (For full details see '
             'Comparisons in\n'
             'the language reference.)\n'
             '\n'
             'Notes:\n'
             '\n'
             '1. While the "in" and "not in" operations are used only for '
             'simple\n'
             '   containment testing in the general case, some specialised '
             'sequences\n'
             '   (such as "str", "bytes" and "bytearray") also use them for\n'
             '   subsequence testing:\n'
             '\n'
             '      >>> "gg" in "eggs"\n'
             '      True\n'
             '\n'
             '2. Values of *n* less than "0" are treated as "0" (which yields '
             'an\n'
             '   empty sequence of the same type as *s*).  Note that items in '
             'the\n'
             '   sequence *s* are not copied; they are referenced multiple '
             'times.\n'
             '   This often haunts new Python programmers; consider:\n'
             '\n'
             '      >>> lists = [[]] * 3\n'
             '      >>> lists\n'
             '      [[], [], []]\n'
             '      >>> lists[0].append(3)\n'
             '      >>> lists\n'
             '      [[3], [3], [3]]\n'
             '\n'
             '   What has happened is that "[[]]" is a one-element list '
             'containing\n'
             '   an empty list, so all three elements of "[[]] * 3" are '
             'references\n'
             '   to this single empty list.  Modifying any of the elements of\n'
             '   "lists" modifies this single list. You can create a list of\n'
             '   different lists this way:\n'
             '\n'
             '      >>> lists = [[] for i in range(3)]\n'
             '      >>> lists[0].append(3)\n'
             '      >>> lists[1].append(5)\n'
             '      >>> lists[2].append(7)\n'
             '      >>> lists\n'
             '      [[3], [5], [7]]\n'
             '\n'
             '   Further explanation is available in the FAQ entry How do I '
             'create a\n'
             '   multidimensional list?.\n'
             '\n'
             '3. If *i* or *j* is negative, the index is relative to the end '
             'of\n'
             '   sequence *s*: "len(s) + i" or "len(s) + j" is substituted.  '
             'But\n'
             '   note that "-0" is still "0".\n'
             '\n'
             '4. The slice of *s* from *i* to *j* is defined as the sequence '
             'of\n'
             '   items with index *k* such that "i <= k < j".  If *i* or *j* '
             'is\n'
             '   greater than "len(s)", use "len(s)".  If *i* is omitted or '
             '"None",\n'
             '   use "0".  If *j* is omitted or "None", use "len(s)".  If *i* '
             'is\n'
             '   greater than or equal to *j*, the slice is empty.\n'
             '\n'
             '5. The slice of *s* from *i* to *j* with step *k* is defined as '
             'the\n'
             '   sequence of items with index  "x = i + n*k" such that "0 <= n '
             '<\n'
             '   (j-i)/k".  In other words, the indices are "i", "i+k", '
             '"i+2*k",\n'
             '   "i+3*k" and so on, stopping when *j* is reached (but never\n'
             '   including *j*).  When *k* is positive, *i* and *j* are '
             'reduced to\n'
             '   "len(s)" if they are greater. When *k* is negative, *i* and '
             '*j* are\n'
             '   reduced to "len(s) - 1" if they are greater.  If *i* or *j* '
             'are\n'
             '   omitted or "None", they become “end” values (which end '
             'depends on\n'
             '   the sign of *k*).  Note, *k* cannot be zero. If *k* is '
             '"None", it\n'
             '   is treated like "1".\n'
             '\n'
             '6. Concatenating immutable sequences always results in a new '
             'object.\n'
             '   This means that building up a sequence by repeated '
             'concatenation\n'
             '   will have a quadratic runtime cost in the total sequence '
             'length.\n'
             '   To get a linear runtime cost, you must switch to one of the\n'
             '   alternatives below:\n'
             '\n'
             '   * if concatenating "str" objects, you can build a list and '
             'use\n'
             '     "str.join()" at the end or else write to an "io.StringIO"\n'
             '     instance and retrieve its value when complete\n'
             '\n'
             '   * if concatenating "bytes" objects, you can similarly use\n'
             '     "bytes.join()" or "io.BytesIO", or you can do in-place\n'
             '     concatenation with a "bytearray" object.  "bytearray" '
             'objects are\n'
             '     mutable and have an efficient overallocation mechanism\n'
             '\n'
             '   * if concatenating "tuple" objects, extend a "list" instead\n'
             '\n'
             '   * for other types, investigate the relevant class '
             'documentation\n'
             '\n'
             '7. Some sequence types (such as "range") only support item '
             'sequences\n'
             '   that follow specific patterns, and hence don’t support '
             'sequence\n'
             '   concatenation or repetition.\n'
             '\n'
             '8. "index" raises "ValueError" when *x* is not found in *s*. Not '
             'all\n'
             '   implementations support passing the additional arguments *i* '
             'and\n'
             '   *j*. These arguments allow efficient searching of subsections '
             'of\n'
             '   the sequence. Passing the extra arguments is roughly '
             'equivalent to\n'
             '   using "s[i:j].index(x)", only without copying any data and '
             'with the\n'
             '   returned index being relative to the start of the sequence '
             'rather\n'
             '   than the start of the slice.\n'
             '\n'
             '\n'
             'Immutable Sequence Types\n'
             '========================\n'
             '\n'
             'The only operation that immutable sequence types generally '
             'implement\n'
             'that is not also implemented by mutable sequence types is '
             'support for\n'
             'the "hash()" built-in.\n'
             '\n'
             'This support allows immutable sequences, such as "tuple" '
             'instances, to\n'
             'be used as "dict" keys and stored in "set" and "frozenset" '
             'instances.\n'
             '\n'
             'Attempting to hash an immutable sequence that contains '
             'unhashable\n'
             'values will result in "TypeError".\n'
             '\n'
             '\n'
             'Mutable Sequence Types\n'
             '======================\n'
             '\n'
             'The operations in the following table are defined on mutable '
             'sequence\n'
             'types. The "collections.abc.MutableSequence" ABC is provided to '
             'make\n'
             'it easier to correctly implement these operations on custom '
             'sequence\n'
             'types.\n'
             '\n'
             'In the table *s* is an instance of a mutable sequence type, *t* '
             'is any\n'
             'iterable object and *x* is an arbitrary object that meets any '
             'type and\n'
             'value restrictions imposed by *s* (for example, "bytearray" '
             'only\n'
             'accepts integers that meet the value restriction "0 <= x <= '
             '255").\n'
             '\n'
             '+--------------------------------+----------------------------------+-----------------------+\n'
             '| Operation                      | '
             'Result                           | Notes                 |\n'
             '|================================|==================================|=======================|\n'
             '| "s[i] = x"                     | item *i* of *s* is replaced '
             'by   |                       |\n'
             '|                                | '
             '*x*                              |                       |\n'
             '+--------------------------------+----------------------------------+-----------------------+\n'
             '| "s[i:j] = t"                   | slice of *s* from *i* to *j* '
             'is  |                       |\n'
             '|                                | replaced by the contents of '
             'the  |                       |\n'
             '|                                | iterable '
             '*t*                     |                       |\n'
             '+--------------------------------+----------------------------------+-----------------------+\n'
             '| "del s[i:j]"                   | same as "s[i:j] = '
             '[]"            |                       |\n'
             '+--------------------------------+----------------------------------+-----------------------+\n'
             '| "s[i:j:k] = t"                 | the elements of "s[i:j:k]" '
             'are   | (1)                   |\n'
             '|                                | replaced by those of '
             '*t*         |                       |\n'
             '+--------------------------------+----------------------------------+-----------------------+\n'
             '| "del s[i:j:k]"                 | removes the elements '
             'of          |                       |\n'
             '|                                | "s[i:j:k]" from the '
             'list         |                       |\n'
             '+--------------------------------+----------------------------------+-----------------------+\n'
             '| "s.append(x)"                  | appends *x* to the end of '
             'the    |                       |\n'
             '|                                | sequence (same '
             'as                |                       |\n'
             '|                                | "s[len(s):len(s)] = '
             '[x]")        |                       |\n'
             '+--------------------------------+----------------------------------+-----------------------+\n'
             '| "s.clear()"                    | removes all items from *s* '
             '(same | (5)                   |\n'
             '|                                | as "del '
             's[:]")                   |                       |\n'
             '+--------------------------------+----------------------------------+-----------------------+\n'
             '| "s.copy()"                     | creates a shallow copy of '
             '*s*    | (5)                   |\n'
             '|                                | (same as '
             '"s[:]")                 |                       |\n'
             '+--------------------------------+----------------------------------+-----------------------+\n'
             '| "s.extend(t)" or "s += t"      | extends *s* with the contents '
             'of |                       |\n'
             '|                                | *t* (for the most part the '
             'same  |                       |\n'
             '|                                | as "s[len(s):len(s)] = '
             't")       |                       |\n'
             '+--------------------------------+----------------------------------+-----------------------+\n'
             '| "s *= n"                       | updates *s* with its '
             'contents    | (6)                   |\n'
             '|                                | repeated *n* '
             'times               |                       |\n'
             '+--------------------------------+----------------------------------+-----------------------+\n'
             '| "s.insert(i, x)"               | inserts *x* into *s* at '
             'the      |                       |\n'
             '|                                | index given by *i* (same '
             'as      |                       |\n'
             '|                                | "s[i:i] = '
             '[x]")                  |                       |\n'
             '+--------------------------------+----------------------------------+-----------------------+\n'
             '| "s.pop()" or "s.pop(i)"        | retrieves the item at *i* '
             'and    | (2)                   |\n'
             '|                                | also removes it from '
             '*s*         |                       |\n'
             '+--------------------------------+----------------------------------+-----------------------+\n'
             '| "s.remove(x)"                  | remove the first item from '
             '*s*   | (3)                   |\n'
             '|                                | where "s[i]" is equal to '
             '*x*     |                       |\n'
             '+--------------------------------+----------------------------------+-----------------------+\n'
             '| "s.reverse()"                  | reverses the items of *s* '
             'in     | (4)                   |\n'
             '|                                | '
             'place                            |                       |\n'
             '+--------------------------------+----------------------------------+-----------------------+\n'
             '\n'
             'Notes:\n'
             '\n'
             '1. *t* must have the same length as the slice it is replacing.\n'
             '\n'
             '2. The optional argument *i* defaults to "-1", so that by '
             'default the\n'
             '   last item is removed and returned.\n'
             '\n'
             '3. "remove()" raises "ValueError" when *x* is not found in *s*.\n'
             '\n'
             '4. The "reverse()" method modifies the sequence in place for '
             'economy\n'
             '   of space when reversing a large sequence.  To remind users '
             'that it\n'
             '   operates by side effect, it does not return the reversed '
             'sequence.\n'
             '\n'
             '5. "clear()" and "copy()" are included for consistency with the\n'
             '   interfaces of mutable containers that don’t support slicing\n'
             '   operations (such as "dict" and "set"). "copy()" is not part '
             'of the\n'
             '   "collections.abc.MutableSequence" ABC, but most concrete '
             'mutable\n'
             '   sequence classes provide it.\n'
             '\n'
             '   New in version 3.3: "clear()" and "copy()" methods.\n'
             '\n'
             '6. The value *n* is an integer, or an object implementing\n'
             '   "__index__()".  Zero and negative values of *n* clear the '
             'sequence.\n'
             '   Items in the sequence are not copied; they are referenced '
             'multiple\n'
             '   times, as explained for "s * n" under Common Sequence '
             'Operations.\n'
             '\n'
             '\n'
             'Lists\n'
             '=====\n'
             '\n'
             'Lists are mutable sequences, typically used to store collections '
             'of\n'
             'homogeneous items (where the precise degree of similarity will '
             'vary by\n'
             'application).\n'
             '\n'
             'class list([iterable])\n'
             '\n'
             '   Lists may be constructed in several ways:\n'
             '\n'
             '   * Using a pair of square brackets to denote the empty list: '
             '"[]"\n'
             '\n'
             '   * Using square brackets, separating items with commas: "[a]", '
             '"[a,\n'
             '     b, c]"\n'
             '\n'
             '   * Using a list comprehension: "[x for x in iterable]"\n'
             '\n'
             '   * Using the type constructor: "list()" or "list(iterable)"\n'
             '\n'
             '   The constructor builds a list whose items are the same and in '
             'the\n'
             '   same order as *iterable*’s items.  *iterable* may be either '
             'a\n'
             '   sequence, a container that supports iteration, or an '
             'iterator\n'
             '   object.  If *iterable* is already a list, a copy is made and\n'
             '   returned, similar to "iterable[:]". For example, '
             '"list(\'abc\')"\n'
             '   returns "[\'a\', \'b\', \'c\']" and "list( (1, 2, 3) )" '
             'returns "[1, 2,\n'
             '   3]". If no argument is given, the constructor creates a new '
             'empty\n'
             '   list, "[]".\n'
             '\n'
             '   Many other operations also produce lists, including the '
             '"sorted()"\n'
             '   built-in.\n'
             '\n'
             '   Lists implement all of the common and mutable sequence '
             'operations.\n'
             '   Lists also provide the following additional method:\n'
             '\n'
             '   sort(*, key=None, reverse=False)\n'
             '\n'
             '      This method sorts the list in place, using only "<" '
             'comparisons\n'
             '      between items. Exceptions are not suppressed - if any '
             'comparison\n'
             '      operations fail, the entire sort operation will fail (and '
             'the\n'
             '      list will likely be left in a partially modified state).\n'
             '\n'
             '      "sort()" accepts two arguments that can only be passed by\n'
             '      keyword (keyword-only arguments):\n'
             '\n'
             '      *key* specifies a function of one argument that is used '
             'to\n'
             '      extract a comparison key from each list element (for '
             'example,\n'
             '      "key=str.lower"). The key corresponding to each item in '
             'the list\n'
             '      is calculated once and then used for the entire sorting '
             'process.\n'
             '      The default value of "None" means that list items are '
             'sorted\n'
             '      directly without calculating a separate key value.\n'
             '\n'
             '      The "functools.cmp_to_key()" utility is available to '
             'convert a\n'
             '      2.x style *cmp* function to a *key* function.\n'
             '\n'
             '      *reverse* is a boolean value.  If set to "True", then the '
             'list\n'
             '      elements are sorted as if each comparison were reversed.\n'
             '\n'
             '      This method modifies the sequence in place for economy of '
             'space\n'
             '      when sorting a large sequence.  To remind users that it '
             'operates\n'
             '      by side effect, it does not return the sorted sequence '
             '(use\n'
             '      "sorted()" to explicitly request a new sorted list '
             'instance).\n'
             '\n'
             '      The "sort()" method is guaranteed to be stable.  A sort '
             'is\n'
             '      stable if it guarantees not to change the relative order '
             'of\n'
             '      elements that compare equal — this is helpful for sorting '
             'in\n'
             '      multiple passes (for example, sort by department, then by '
             'salary\n'
             '      grade).\n'
             '\n'
             '      For sorting examples and a brief sorting tutorial, see '
             'Sorting\n'
             '      HOW TO.\n'
             '\n'
             '      **CPython implementation detail:** While a list is being '
             'sorted,\n'
             '      the effect of attempting to mutate, or even inspect, the '
             'list is\n'
             '      undefined.  The C implementation of Python makes the list '
             'appear\n'
             '      empty for the duration, and raises "ValueError" if it can '
             'detect\n'
             '      that the list has been mutated during a sort.\n'
             '\n'
             '\n'
             'Tuples\n'
             '======\n'
             '\n'
             'Tuples are immutable sequences, typically used to store '
             'collections of\n'
             'heterogeneous data (such as the 2-tuples produced by the '
             '"enumerate()"\n'
             'built-in). Tuples are also used for cases where an immutable '
             'sequence\n'
             'of homogeneous data is needed (such as allowing storage in a '
             '"set" or\n'
             '"dict" instance).\n'
             '\n'
             'class tuple([iterable])\n'
             '\n'
             '   Tuples may be constructed in a number of ways:\n'
             '\n'
             '   * Using a pair of parentheses to denote the empty tuple: '
             '"()"\n'
             '\n'
             '   * Using a trailing comma for a singleton tuple: "a," or '
             '"(a,)"\n'
             '\n'
             '   * Separating items with commas: "a, b, c" or "(a, b, c)"\n'
             '\n'
             '   * Using the "tuple()" built-in: "tuple()" or '
             '"tuple(iterable)"\n'
             '\n'
             '   The constructor builds a tuple whose items are the same and '
             'in the\n'
             '   same order as *iterable*’s items.  *iterable* may be either '
             'a\n'
             '   sequence, a container that supports iteration, or an '
             'iterator\n'
             '   object.  If *iterable* is already a tuple, it is returned\n'
             '   unchanged. For example, "tuple(\'abc\')" returns "(\'a\', '
             '\'b\', \'c\')"\n'
             '   and "tuple( [1, 2, 3] )" returns "(1, 2, 3)". If no argument '
             'is\n'
             '   given, the constructor creates a new empty tuple, "()".\n'
             '\n'
             '   Note that it is actually the comma which makes a tuple, not '
             'the\n'
             '   parentheses. The parentheses are optional, except in the '
             'empty\n'
             '   tuple case, or when they are needed to avoid syntactic '
             'ambiguity.\n'
             '   For example, "f(a, b, c)" is a function call with three '
             'arguments,\n'
             '   while "f((a, b, c))" is a function call with a 3-tuple as the '
             'sole\n'
             '   argument.\n'
             '\n'
             '   Tuples implement all of the common sequence operations.\n'
             '\n'
             'For heterogeneous collections of data where access by name is '
             'clearer\n'
             'than access by index, "collections.namedtuple()" may be a more\n'
             'appropriate choice than a simple tuple object.\n'
             '\n'
             '\n'
             'Ranges\n'
             '======\n'
             '\n'
             'The "range" type represents an immutable sequence of numbers and '
             'is\n'
             'commonly used for looping a specific number of times in "for" '
             'loops.\n'
             '\n'
             'class range(stop)\n'
             'class range(start, stop[, step])\n'
             '\n'
             '   The arguments to the range constructor must be integers '
             '(either\n'
             '   built-in "int" or any object that implements the "__index__"\n'
             '   special method).  If the *step* argument is omitted, it '
             'defaults to\n'
             '   "1". If the *start* argument is omitted, it defaults to "0". '
             'If\n'
             '   *step* is zero, "ValueError" is raised.\n'
             '\n'
             '   For a positive *step*, the contents of a range "r" are '
             'determined\n'
             '   by the formula "r[i] = start + step*i" where "i >= 0" and '
             '"r[i] <\n'
             '   stop".\n'
             '\n'
             '   For a negative *step*, the contents of the range are still\n'
             '   determined by the formula "r[i] = start + step*i", but the\n'
             '   constraints are "i >= 0" and "r[i] > stop".\n'
             '\n'
             '   A range object will be empty if "r[0]" does not meet the '
             'value\n'
             '   constraint. Ranges do support negative indices, but these '
             'are\n'
             '   interpreted as indexing from the end of the sequence '
             'determined by\n'
             '   the positive indices.\n'
             '\n'
             '   Ranges containing absolute values larger than "sys.maxsize" '
             'are\n'
             '   permitted but some features (such as "len()") may raise\n'
             '   "OverflowError".\n'
             '\n'
             '   Range examples:\n'
             '\n'
             '      >>> list(range(10))\n'
             '      [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]\n'
             '      >>> list(range(1, 11))\n'
             '      [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\n'
             '      >>> list(range(0, 30, 5))\n'
             '      [0, 5, 10, 15, 20, 25]\n'
             '      >>> list(range(0, 10, 3))\n'
             '      [0, 3, 6, 9]\n'
             '      >>> list(range(0, -10, -1))\n'
             '      [0, -1, -2, -3, -4, -5, -6, -7, -8, -9]\n'
             '      >>> list(range(0))\n'
             '      []\n'
             '      >>> list(range(1, 0))\n'
             '      []\n'
             '\n'
             '   Ranges implement all of the common sequence operations '
             'except\n'
             '   concatenation and repetition (due to the fact that range '
             'objects\n'
             '   can only represent sequences that follow a strict pattern '
             'and\n'
             '   repetition and concatenation will usually violate that '
             'pattern).\n'
             '\n'
             '   start\n'
             '\n'
             '      The value of the *start* parameter (or "0" if the '
             'parameter was\n'
             '      not supplied)\n'
             '\n'
             '   stop\n'
             '\n'
             '      The value of the *stop* parameter\n'
             '\n'
             '   step\n'
             '\n'
             '      The value of the *step* parameter (or "1" if the parameter '
             'was\n'
             '      not supplied)\n'
             '\n'
             'The advantage of the "range" type over a regular "list" or '
             '"tuple" is\n'
             'that a "range" object will always take the same (small) amount '
             'of\n'
             'memory, no matter the size of the range it represents (as it '
             'only\n'
             'stores the "start", "stop" and "step" values, calculating '
             'individual\n'
             'items and subranges as needed).\n'
             '\n'
             'Range objects implement the "collections.abc.Sequence" ABC, and\n'
             'provide features such as containment tests, element index '
             'lookup,\n'
             'slicing and support for negative indices (see Sequence Types — '
             'list,\n'
             'tuple, range):\n'
             '\n'
             '>>> r = range(0, 20, 2)\n'
             '>>> r\n'
             'range(0, 20, 2)\n'
             '>>> 11 in r\n'
             'False\n'
             '>>> 10 in r\n'
             'True\n'
             '>>> r.index(10)\n'
             '5\n'
             '>>> r[5]\n'
             '10\n'
             '>>> r[:5]\n'
             'range(0, 10, 2)\n'
             '>>> r[-1]\n'
             '18\n'
             '\n'
             'Testing range objects for equality with "==" and "!=" compares '
             'them as\n'
             'sequences.  That is, two range objects are considered equal if '
             'they\n'
             'represent the same sequence of values.  (Note that two range '
             'objects\n'
             'that compare equal might have different "start", "stop" and '
             '"step"\n'
             'attributes, for example "range(0) == range(2, 1, 3)" or '
             '"range(0, 3,\n'
             '2) == range(0, 4, 2)".)\n'
             '\n'
             'Changed in version 3.2: Implement the Sequence ABC. Support '
             'slicing\n'
             'and negative indices. Test "int" objects for membership in '
             'constant\n'
             'time instead of iterating through all items.\n'
             '\n'
             'Changed in version 3.3: Define ‘==’ and ‘!=’ to compare range '
             'objects\n'
             'based on the sequence of values they define (instead of '
             'comparing\n'
             'based on object identity).\n'
             '\n'
             'New in version 3.3: The "start", "stop" and "step" attributes.\n'
             '\n'
             'See also:\n'
             '\n'
             '  * The linspace recipe shows how to implement a lazy version of '
             'range\n'
             '    suitable for floating point applications.\n',
 'typesseq-mutable': 'Mutable Sequence Types\n'
                     '**********************\n'
                     '\n'
                     'The operations in the following table are defined on '
                     'mutable sequence\n'
                     'types. The "collections.abc.MutableSequence" ABC is '
                     'provided to make\n'
                     'it easier to correctly implement these operations on '
                     'custom sequence\n'
                     'types.\n'
                     '\n'
                     'In the table *s* is an instance of a mutable sequence '
                     'type, *t* is any\n'
                     'iterable object and *x* is an arbitrary object that '
                     'meets any type and\n'
                     'value restrictions imposed by *s* (for example, '
                     '"bytearray" only\n'
                     'accepts integers that meet the value restriction "0 <= x '
                     '<= 255").\n'
                     '\n'
                     '+--------------------------------+----------------------------------+-----------------------+\n'
                     '| Operation                      | '
                     'Result                           | Notes                 '
                     '|\n'
                     '|================================|==================================|=======================|\n'
                     '| "s[i] = x"                     | item *i* of *s* is '
                     'replaced by   |                       |\n'
                     '|                                | '
                     '*x*                              |                       '
                     '|\n'
                     '+--------------------------------+----------------------------------+-----------------------+\n'
                     '| "s[i:j] = t"                   | slice of *s* from *i* '
                     'to *j* is  |                       |\n'
                     '|                                | replaced by the '
                     'contents of the  |                       |\n'
                     '|                                | iterable '
                     '*t*                     |                       |\n'
                     '+--------------------------------+----------------------------------+-----------------------+\n'
                     '| "del s[i:j]"                   | same as "s[i:j] = '
                     '[]"            |                       |\n'
                     '+--------------------------------+----------------------------------+-----------------------+\n'
                     '| "s[i:j:k] = t"                 | the elements of '
                     '"s[i:j:k]" are   | (1)                   |\n'
                     '|                                | replaced by those of '
                     '*t*         |                       |\n'
                     '+--------------------------------+----------------------------------+-----------------------+\n'
                     '| "del s[i:j:k]"                 | removes the elements '
                     'of          |                       |\n'
                     '|                                | "s[i:j:k]" from the '
                     'list         |                       |\n'
                     '+--------------------------------+----------------------------------+-----------------------+\n'
                     '| "s.append(x)"                  | appends *x* to the '
                     'end of the    |                       |\n'
                     '|                                | sequence (same '
                     'as                |                       |\n'
                     '|                                | "s[len(s):len(s)] = '
                     '[x]")        |                       |\n'
                     '+--------------------------------+----------------------------------+-----------------------+\n'
                     '| "s.clear()"                    | removes all items '
                     'from *s* (same | (5)                   |\n'
                     '|                                | as "del '
                     's[:]")                   |                       |\n'
                     '+--------------------------------+----------------------------------+-----------------------+\n'
                     '| "s.copy()"                     | creates a shallow '
                     'copy of *s*    | (5)                   |\n'
                     '|                                | (same as '
                     '"s[:]")                 |                       |\n'
                     '+--------------------------------+----------------------------------+-----------------------+\n'
                     '| "s.extend(t)" or "s += t"      | extends *s* with the '
                     'contents of |                       |\n'
                     '|                                | *t* (for the most '
                     'part the same  |                       |\n'
                     '|                                | as "s[len(s):len(s)] '
                     '= t")       |                       |\n'
                     '+--------------------------------+----------------------------------+-----------------------+\n'
                     '| "s *= n"                       | updates *s* with its '
                     'contents    | (6)                   |\n'
                     '|                                | repeated *n* '
                     'times               |                       |\n'
                     '+--------------------------------+----------------------------------+-----------------------+\n'
                     '| "s.insert(i, x)"               | inserts *x* into *s* '
                     'at the      |                       |\n'
                     '|                                | index given by *i* '
                     '(same as      |                       |\n'
                     '|                                | "s[i:i] = '
                     '[x]")                  |                       |\n'
                     '+--------------------------------+----------------------------------+-----------------------+\n'
                     '| "s.pop()" or "s.pop(i)"        | retrieves the item at '
                     '*i* and    | (2)                   |\n'
                     '|                                | also removes it from '
                     '*s*         |                       |\n'
                     '+--------------------------------+----------------------------------+-----------------------+\n'
                     '| "s.remove(x)"                  | remove the first item '
                     'from *s*   | (3)                   |\n'
                     '|                                | where "s[i]" is equal '
                     'to *x*     |                       |\n'
                     '+--------------------------------+----------------------------------+-----------------------+\n'
                     '| "s.reverse()"                  | reverses the items of '
                     '*s* in     | (4)                   |\n'
                     '|                                | '
                     'place                            |                       '
                     '|\n'
                     '+--------------------------------+----------------------------------+-----------------------+\n'
                     '\n'
                     'Notes:\n'
                     '\n'
                     '1. *t* must have the same length as the slice it is '
                     'replacing.\n'
                     '\n'
                     '2. The optional argument *i* defaults to "-1", so that '
                     'by default the\n'
                     '   last item is removed and returned.\n'
                     '\n'
                     '3. "remove()" raises "ValueError" when *x* is not found '
                     'in *s*.\n'
                     '\n'
                     '4. The "reverse()" method modifies the sequence in place '
                     'for economy\n'
                     '   of space when reversing a large sequence.  To remind '
                     'users that it\n'
                     '   operates by side effect, it does not return the '
                     'reversed sequence.\n'
                     '\n'
                     '5. "clear()" and "copy()" are included for consistency '
                     'with the\n'
                     '   interfaces of mutable containers that don’t support '
                     'slicing\n'
                     '   operations (such as "dict" and "set"). "copy()" is '
                     'not part of the\n'
                     '   "collections.abc.MutableSequence" ABC, but most '
                     'concrete mutable\n'
                     '   sequence classes provide it.\n'
                     '\n'
                     '   New in version 3.3: "clear()" and "copy()" methods.\n'
                     '\n'
                     '6. The value *n* is an integer, or an object '
                     'implementing\n'
                     '   "__index__()".  Zero and negative values of *n* clear '
                     'the sequence.\n'
                     '   Items in the sequence are not copied; they are '
                     'referenced multiple\n'
                     '   times, as explained for "s * n" under Common Sequence '
                     'Operations.\n',
 'unary': 'Unary arithmetic and bitwise operations\n'
          '***************************************\n'
          '\n'
          'All unary arithmetic and bitwise operations have the same '
          'priority:\n'
          '\n'
          '   u_expr ::= power | "-" u_expr | "+" u_expr | "~" u_expr\n'
          '\n'
          'The unary "-" (minus) operator yields the negation of its numeric\n'
          'argument.\n'
          '\n'
          'The unary "+" (plus) operator yields its numeric argument '
          'unchanged.\n'
          '\n'
          'The unary "~" (invert) operator yields the bitwise inversion of '
          'its\n'
          'integer argument.  The bitwise inversion of "x" is defined as\n'
          '"-(x+1)".  It only applies to integral numbers.\n'
          '\n'
          'In all three cases, if the argument does not have the proper type, '
          'a\n'
          '"TypeError" exception is raised.\n',
 'while': 'The "while" statement\n'
          '*********************\n'
          '\n'
          'The "while" statement is used for repeated execution as long as an\n'
          'expression is true:\n'
          '\n'
          '   while_stmt ::= "while" assignment_expression ":" suite\n'
          '                  ["else" ":" suite]\n'
          '\n'
          'This repeatedly tests the expression and, if it is true, executes '
          'the\n'
          'first suite; if the expression is false (which may be the first '
          'time\n'
          'it is tested) the suite of the "else" clause, if present, is '
          'executed\n'
          'and the loop terminates.\n'
          '\n'
          'A "break" statement executed in the first suite terminates the '
          'loop\n'
          'without executing the "else" clause’s suite.  A "continue" '
          'statement\n'
          'executed in the first suite skips the rest of the suite and goes '
          'back\n'
          'to testing the expression.\n',
 'with': 'The "with" statement\n'
         '********************\n'
         '\n'
         'The "with" statement is used to wrap the execution of a block with\n'
         'methods defined by a context manager (see section With Statement\n'
         'Context Managers). This allows common "try"…"except"…"finally" '
         'usage\n'
         'patterns to be encapsulated for convenient reuse.\n'
         '\n'
         '   with_stmt ::= "with" with_item ("," with_item)* ":" suite\n'
         '   with_item ::= expression ["as" target]\n'
         '\n'
         'The execution of the "with" statement with one “item” proceeds as\n'
         'follows:\n'
         '\n'
         '1. The context expression (the expression given in the "with_item") '
         'is\n'
         '   evaluated to obtain a context manager.\n'
         '\n'
         '2. The context manager’s "__enter__()" is loaded for later use.\n'
         '\n'
         '3. The context manager’s "__exit__()" is loaded for later use.\n'
         '\n'
         '4. The context manager’s "__enter__()" method is invoked.\n'
         '\n'
         '5. If a target was included in the "with" statement, the return '
         'value\n'
         '   from "__enter__()" is assigned to it.\n'
         '\n'
         '   Note:\n'
         '\n'
         '     The "with" statement guarantees that if the "__enter__()" '
         'method\n'
         '     returns without an error, then "__exit__()" will always be\n'
         '     called. Thus, if an error occurs during the assignment to the\n'
         '     target list, it will be treated the same as an error occurring\n'
         '     within the suite would be. See step 6 below.\n'
         '\n'
         '6. The suite is executed.\n'
         '\n'
         '7. The context manager’s "__exit__()" method is invoked.  If an\n'
         '   exception caused the suite to be exited, its type, value, and\n'
         '   traceback are passed as arguments to "__exit__()". Otherwise, '
         'three\n'
         '   "None" arguments are supplied.\n'
         '\n'
         '   If the suite was exited due to an exception, and the return '
         'value\n'
         '   from the "__exit__()" method was false, the exception is '
         'reraised.\n'
         '   If the return value was true, the exception is suppressed, and\n'
         '   execution continues with the statement following the "with"\n'
         '   statement.\n'
         '\n'
         '   If the suite was exited for any reason other than an exception, '
         'the\n'
         '   return value from "__exit__()" is ignored, and execution '
         'proceeds\n'
         '   at the normal location for the kind of exit that was taken.\n'
         '\n'
         'The following code:\n'
         '\n'
         '   with EXPRESSION as TARGET:\n'
         '       SUITE\n'
         '\n'
         'is semantically equivalent to:\n'
         '\n'
         '   manager = (EXPRESSION)\n'
         '   enter = type(manager).__enter__\n'
         '   exit = type(manager).__exit__\n'
         '   value = enter(manager)\n'
         '   hit_except = False\n'
         '\n'
         '   try:\n'
         '       TARGET = value\n'
         '       SUITE\n'
         '   except:\n'
         '       hit_except = True\n'
         '       if not exit(manager, *sys.exc_info()):\n'
         '           raise\n'
         '   finally:\n'
         '       if not hit_except:\n'
         '           exit(manager, None, None, None)\n'
         '\n'
         'With more than one item, the context managers are processed as if\n'
         'multiple "with" statements were nested:\n'
         '\n'
         '   with A() as a, B() as b:\n'
         '       SUITE\n'
         '\n'
         'is semantically equivalent to:\n'
         '\n'
         '   with A() as a:\n'
         '       with B() as b:\n'
         '           SUITE\n'
         '\n'
         'Changed in version 3.1: Support for multiple context expressions.\n'
         '\n'
         'See also:\n'
         '\n'
         '  **PEP 343** - The “with” statement\n'
         '     The specification, background, and examples for the Python '
         '"with"\n'
         '     statement.\n',
 'yield': 'The "yield" statement\n'
          '*********************\n'
          '\n'
          '   yield_stmt ::= yield_expression\n'
          '\n'
          'A "yield" statement is semantically equivalent to a yield '
          'expression.\n'
          'The yield statement can be used to omit the parentheses that would\n'
          'otherwise be required in the equivalent yield expression '
          'statement.\n'
          'For example, the yield statements\n'
          '\n'
          '   yield <expr>\n'
          '   yield from <expr>\n'
          '\n'
          'are equivalent to the yield expression statements\n'
          '\n'
          '   (yield <expr>)\n'
          '   (yield from <expr>)\n'
          '\n'
          'Yield expressions and statements are only used when defining a\n'
          '*generator* function, and are only used in the body of the '
          'generator\n'
          'function.  Using yield in a function definition is sufficient to '
          'cause\n'
          'that definition to create a generator function instead of a normal\n'
          'function.\n'
          '\n'
          'For full details of "yield" semantics, refer to the Yield '
          'expressions\n'
          'section.\n'}
pydoc_data/__init__.py000064400000000000151153537640010764 0ustar00pydoc_data/__pycache__/topics.cpython-38.pyc000064400001477206151153537640015047 0ustar00U

e5d�s
�P@s�dddddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(dd)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdN�OZdOS)PauThe "assert" statement
**********************

Assert statements are a convenient way to insert debugging assertions
into a program:

   assert_stmt ::= "assert" expression ["," expression]

The simple form, "assert expression", is equivalent to

   if __debug__:
       if not expression: raise AssertionError

The extended form, "assert expression1, expression2", is equivalent to

   if __debug__:
       if not expression1: raise AssertionError(expression2)

These equivalences assume that "__debug__" and "AssertionError" refer
to the built-in variables with those names.  In the current
implementation, the built-in variable "__debug__" is "True" under
normal circumstances, "False" when optimization is requested (command
line option "-O").  The current code generator emits no code for an
assert statement when optimization is requested at compile time.  Note
that it is unnecessary to include the source code for the expression
that failed in the error message; it will be displayed as part of the
stack trace.

Assignments to "__debug__" are illegal.  The value for the built-in
variable is determined when the interpreter starts.
u�,Assignment statements
*********************

Assignment statements are used to (re)bind names to values and to
modify attributes or items of mutable objects:

   assignment_stmt ::= (target_list "=")+ (starred_expression | yield_expression)
   target_list     ::= target ("," target)* [","]
   target          ::= identifier
              | "(" [target_list] ")"
              | "[" [target_list] "]"
              | attributeref
              | subscription
              | slicing
              | "*" target

(See section Primaries for the syntax definitions for *attributeref*,
*subscription*, and *slicing*.)

An assignment statement evaluates the expression list (remember that
this can be a single expression or a comma-separated list, the latter
yielding a tuple) and assigns the single resulting object to each of
the target lists, from left to right.

Assignment is defined recursively depending on the form of the target
(list). When a target is part of a mutable object (an attribute
reference, subscription or slicing), the mutable object must
ultimately perform the assignment and decide about its validity, and
may raise an exception if the assignment is unacceptable.  The rules
observed by various types and the exceptions raised are given with the
definition of the object types (see section The standard type
hierarchy).

Assignment of an object to a target list, optionally enclosed in
parentheses or square brackets, is recursively defined as follows.

* If the target list is a single target with no trailing comma,
  optionally in parentheses, the object is assigned to that target.

* Else: The object must be an iterable with the same number of items
  as there are targets in the target list, and the items are assigned,
  from left to right, to the corresponding targets.

  * If the target list contains one target prefixed with an asterisk,
    called a “starred” target: The object must be an iterable with at
    least as many items as there are targets in the target list, minus
    one.  The first items of the iterable are assigned, from left to
    right, to the targets before the starred target.  The final items
    of the iterable are assigned to the targets after the starred
    target.  A list of the remaining items in the iterable is then
    assigned to the starred target (the list can be empty).

  * Else: The object must be an iterable with the same number of items
    as there are targets in the target list, and the items are
    assigned, from left to right, to the corresponding targets.

Assignment of an object to a single target is recursively defined as
follows.

* If the target is an identifier (name):

  * If the name does not occur in a "global" or "nonlocal" statement
    in the current code block: the name is bound to the object in the
    current local namespace.

  * Otherwise: the name is bound to the object in the global namespace
    or the outer namespace determined by "nonlocal", respectively.

  The name is rebound if it was already bound.  This may cause the
  reference count for the object previously bound to the name to reach
  zero, causing the object to be deallocated and its destructor (if it
  has one) to be called.

* If the target is an attribute reference: The primary expression in
  the reference is evaluated.  It should yield an object with
  assignable attributes; if this is not the case, "TypeError" is
  raised.  That object is then asked to assign the assigned object to
  the given attribute; if it cannot perform the assignment, it raises
  an exception (usually but not necessarily "AttributeError").

  Note: If the object is a class instance and the attribute reference
  occurs on both sides of the assignment operator, the right-hand side
  expression, "a.x" can access either an instance attribute or (if no
  instance attribute exists) a class attribute.  The left-hand side
  target "a.x" is always set as an instance attribute, creating it if
  necessary.  Thus, the two occurrences of "a.x" do not necessarily
  refer to the same attribute: if the right-hand side expression
  refers to a class attribute, the left-hand side creates a new
  instance attribute as the target of the assignment:

     class Cls:
         x = 3             # class variable
     inst = Cls()
     inst.x = inst.x + 1   # writes inst.x as 4 leaving Cls.x as 3

  This description does not necessarily apply to descriptor
  attributes, such as properties created with "property()".

* If the target is a subscription: The primary expression in the
  reference is evaluated.  It should yield either a mutable sequence
  object (such as a list) or a mapping object (such as a dictionary).
  Next, the subscript expression is evaluated.

  If the primary is a mutable sequence object (such as a list), the
  subscript must yield an integer.  If it is negative, the sequence’s
  length is added to it.  The resulting value must be a nonnegative
  integer less than the sequence’s length, and the sequence is asked
  to assign the assigned object to its item with that index.  If the
  index is out of range, "IndexError" is raised (assignment to a
  subscripted sequence cannot add new items to a list).

  If the primary is a mapping object (such as a dictionary), the
  subscript must have a type compatible with the mapping’s key type,
  and the mapping is then asked to create a key/datum pair which maps
  the subscript to the assigned object.  This can either replace an
  existing key/value pair with the same key value, or insert a new
  key/value pair (if no key with the same value existed).

  For user-defined objects, the "__setitem__()" method is called with
  appropriate arguments.

* If the target is a slicing: The primary expression in the reference
  is evaluated.  It should yield a mutable sequence object (such as a
  list).  The assigned object should be a sequence object of the same
  type.  Next, the lower and upper bound expressions are evaluated,
  insofar they are present; defaults are zero and the sequence’s
  length.  The bounds should evaluate to integers. If either bound is
  negative, the sequence’s length is added to it.  The resulting
  bounds are clipped to lie between zero and the sequence’s length,
  inclusive.  Finally, the sequence object is asked to replace the
  slice with the items of the assigned sequence.  The length of the
  slice may be different from the length of the assigned sequence,
  thus changing the length of the target sequence, if the target
  sequence allows it.

**CPython implementation detail:** In the current implementation, the
syntax for targets is taken to be the same as for expressions, and
invalid syntax is rejected during the code generation phase, causing
less detailed error messages.

Although the definition of assignment implies that overlaps between
the left-hand side and the right-hand side are ‘simultaneous’ (for
example "a, b = b, a" swaps two variables), overlaps *within* the
collection of assigned-to variables occur left-to-right, sometimes
resulting in confusion.  For instance, the following program prints
"[0, 2]":

   x = [0, 1]
   i = 0
   i, x[i] = 1, 2         # i is updated, then x[i] is updated
   print(x)

See also:

  **PEP 3132** - Extended Iterable Unpacking
     The specification for the "*target" feature.


Augmented assignment statements
===============================

Augmented assignment is the combination, in a single statement, of a
binary operation and an assignment statement:

   augmented_assignment_stmt ::= augtarget augop (expression_list | yield_expression)
   augtarget                 ::= identifier | attributeref | subscription | slicing
   augop                     ::= "+=" | "-=" | "*=" | "@=" | "/=" | "//=" | "%=" | "**="
             | ">>=" | "<<=" | "&=" | "^=" | "|="

(See section Primaries for the syntax definitions of the last three
symbols.)

An augmented assignment evaluates the target (which, unlike normal
assignment statements, cannot be an unpacking) and the expression
list, performs the binary operation specific to the type of assignment
on the two operands, and assigns the result to the original target.
The target is only evaluated once.

An augmented assignment expression like "x += 1" can be rewritten as
"x = x + 1" to achieve a similar, but not exactly equal effect. In the
augmented version, "x" is only evaluated once. Also, when possible,
the actual operation is performed *in-place*, meaning that rather than
creating a new object and assigning that to the target, the old object
is modified instead.

Unlike normal assignments, augmented assignments evaluate the left-
hand side *before* evaluating the right-hand side.  For example, "a[i]
+= f(x)" first looks-up "a[i]", then it evaluates "f(x)" and performs
the addition, and lastly, it writes the result back to "a[i]".

With the exception of assigning to tuples and multiple targets in a
single statement, the assignment done by augmented assignment
statements is handled the same way as normal assignments. Similarly,
with the exception of the possible *in-place* behavior, the binary
operation performed by augmented assignment is the same as the normal
binary operations.

For targets which are attribute references, the same caveat about
class and instance attributes applies as for regular assignments.


Annotated assignment statements
===============================

*Annotation* assignment is the combination, in a single statement, of
a variable or attribute annotation and an optional assignment
statement:

   annotated_assignment_stmt ::= augtarget ":" expression
                                 ["=" (starred_expression | yield_expression)]

The difference from normal Assignment statements is that only single
target is allowed.

For simple names as assignment targets, if in class or module scope,
the annotations are evaluated and stored in a special class or module
attribute "__annotations__" that is a dictionary mapping from variable
names (mangled if private) to evaluated annotations. This attribute is
writable and is automatically created at the start of class or module
body execution, if annotations are found statically.

For expressions as assignment targets, the annotations are evaluated
if in class or module scope, but not stored.

If a name is annotated in a function scope, then this name is local
for that scope. Annotations are never evaluated and stored in function
scopes.

If the right hand side is present, an annotated assignment performs
the actual assignment before evaluating annotations (where
applicable). If the right hand side is not present for an expression
target, then the interpreter evaluates the target except for the last
"__setitem__()" or "__setattr__()" call.

See also:

  **PEP 526** - Syntax for Variable Annotations
     The proposal that added syntax for annotating the types of
     variables (including class variables and instance variables),
     instead of expressing them through comments.

  **PEP 484** - Type hints
     The proposal that added the "typing" module to provide a standard
     syntax for type annotations that can be used in static analysis
     tools and IDEs.

Changed in version 3.8: Now annotated assignments allow same
expressions in the right hand side as the regular assignments.
Previously, some expressions (like un-parenthesized tuple expressions)
caused a syntax error.
u>
Coroutines
**********

New in version 3.5.


Coroutine function definition
=============================

   async_funcdef ::= [decorators] "async" "def" funcname "(" [parameter_list] ")"
                     ["->" expression] ":" suite

Execution of Python coroutines can be suspended and resumed at many
points (see *coroutine*).  Inside the body of a coroutine function,
"await" and "async" identifiers become reserved keywords; "await"
expressions, "async for" and "async with" can only be used in
coroutine function bodies.

Functions defined with "async def" syntax are always coroutine
functions, even if they do not contain "await" or "async" keywords.

It is a "SyntaxError" to use a "yield from" expression inside the body
of a coroutine function.

An example of a coroutine function:

   async def func(param1, param2):
       do_stuff()
       await some_coroutine()


The "async for" statement
=========================

   async_for_stmt ::= "async" for_stmt

An *asynchronous iterable* is able to call asynchronous code in its
*iter* implementation, and *asynchronous iterator* can call
asynchronous code in its *next* method.

The "async for" statement allows convenient iteration over
asynchronous iterators.

The following code:

   async for TARGET in ITER:
       SUITE
   else:
       SUITE2

Is semantically equivalent to:

   iter = (ITER)
   iter = type(iter).__aiter__(iter)
   running = True

   while running:
       try:
           TARGET = await type(iter).__anext__(iter)
       except StopAsyncIteration:
           running = False
       else:
           SUITE
   else:
       SUITE2

See also "__aiter__()" and "__anext__()" for details.

It is a "SyntaxError" to use an "async for" statement outside the body
of a coroutine function.


The "async with" statement
==========================

   async_with_stmt ::= "async" with_stmt

An *asynchronous context manager* is a *context manager* that is able
to suspend execution in its *enter* and *exit* methods.

The following code:

   async with EXPRESSION as TARGET:
       SUITE

is semantically equivalent to:

   manager = (EXPRESSION)
   aexit = type(manager).__aexit__
   aenter = type(manager).__aenter__
   value = await aenter(manager)
   hit_except = False

   try:
       TARGET = value
       SUITE
   except:
       hit_except = True
       if not await aexit(manager, *sys.exc_info()):
           raise
   finally:
       if not hit_except:
           await aexit(manager, None, None, None)

See also "__aenter__()" and "__aexit__()" for details.

It is a "SyntaxError" to use an "async with" statement outside the
body of a coroutine function.

See also:

  **PEP 492** - Coroutines with async and await syntax
     The proposal that made coroutines a proper standalone concept in
     Python, and added supporting syntax.

-[ Footnotes ]-

[1] The exception is propagated to the invocation stack unless there
    is a "finally" clause which happens to raise another exception.
    That new exception causes the old one to be lost.

[2] A string literal appearing as the first statement in the function
    body is transformed into the function’s "__doc__" attribute and
    therefore the function’s *docstring*.

[3] A string literal appearing as the first statement in the class
    body is transformed into the namespace’s "__doc__" item and
    therefore the class’s *docstring*.
a�Identifiers (Names)
*******************

An identifier occurring as an atom is a name.  See section Identifiers
and keywords for lexical definition and section Naming and binding for
documentation of naming and binding.

When the name is bound to an object, evaluation of the atom yields
that object. When a name is not bound, an attempt to evaluate it
raises a "NameError" exception.

**Private name mangling:** When an identifier that textually occurs in
a class definition begins with two or more underscore characters and
does not end in two or more underscores, it is considered a *private
name* of that class. Private names are transformed to a longer form
before code is generated for them.  The transformation inserts the
class name, with leading underscores removed and a single underscore
inserted, in front of the name.  For example, the identifier "__spam"
occurring in a class named "Ham" will be transformed to "_Ham__spam".
This transformation is independent of the syntactical context in which
the identifier is used.  If the transformed name is extremely long
(longer than 255 characters), implementation defined truncation may
happen. If the class name consists only of underscores, no
transformation is done.
u
Literals
********

Python supports string and bytes literals and various numeric
literals:

   literal ::= stringliteral | bytesliteral
               | integer | floatnumber | imagnumber

Evaluation of a literal yields an object of the given type (string,
bytes, integer, floating point number, complex number) with the given
value.  The value may be approximated in the case of floating point
and imaginary (complex) literals.  See section Literals for details.

All literals correspond to immutable data types, and hence the
object’s identity is less important than its value.  Multiple
evaluations of literals with the same value (either the same
occurrence in the program text or a different occurrence) may obtain
the same object or a different object with the same value.
uA7Customizing attribute access
****************************

The following methods can be defined to customize the meaning of
attribute access (use of, assignment to, or deletion of "x.name") for
class instances.

object.__getattr__(self, name)

   Called when the default attribute access fails with an
   "AttributeError" (either "__getattribute__()" raises an
   "AttributeError" because *name* is not an instance attribute or an
   attribute in the class tree for "self"; or "__get__()" of a *name*
   property raises "AttributeError").  This method should either
   return the (computed) attribute value or raise an "AttributeError"
   exception.

   Note that if the attribute is found through the normal mechanism,
   "__getattr__()" is not called.  (This is an intentional asymmetry
   between "__getattr__()" and "__setattr__()".) This is done both for
   efficiency reasons and because otherwise "__getattr__()" would have
   no way to access other attributes of the instance.  Note that at
   least for instance variables, you can fake total control by not
   inserting any values in the instance attribute dictionary (but
   instead inserting them in another object).  See the
   "__getattribute__()" method below for a way to actually get total
   control over attribute access.

object.__getattribute__(self, name)

   Called unconditionally to implement attribute accesses for
   instances of the class. If the class also defines "__getattr__()",
   the latter will not be called unless "__getattribute__()" either
   calls it explicitly or raises an "AttributeError". This method
   should return the (computed) attribute value or raise an
   "AttributeError" exception. In order to avoid infinite recursion in
   this method, its implementation should always call the base class
   method with the same name to access any attributes it needs, for
   example, "object.__getattribute__(self, name)".

   Note:

     This method may still be bypassed when looking up special methods
     as the result of implicit invocation via language syntax or
     built-in functions. See Special method lookup.

   For certain sensitive attribute accesses, raises an auditing event
   "object.__getattr__" with arguments "obj" and "name".

object.__setattr__(self, name, value)

   Called when an attribute assignment is attempted.  This is called
   instead of the normal mechanism (i.e. store the value in the
   instance dictionary). *name* is the attribute name, *value* is the
   value to be assigned to it.

   If "__setattr__()" wants to assign to an instance attribute, it
   should call the base class method with the same name, for example,
   "object.__setattr__(self, name, value)".

   For certain sensitive attribute assignments, raises an auditing
   event "object.__setattr__" with arguments "obj", "name", "value".

object.__delattr__(self, name)

   Like "__setattr__()" but for attribute deletion instead of
   assignment.  This should only be implemented if "del obj.name" is
   meaningful for the object.

   For certain sensitive attribute deletions, raises an auditing event
   "object.__delattr__" with arguments "obj" and "name".

object.__dir__(self)

   Called when "dir()" is called on the object. A sequence must be
   returned. "dir()" converts the returned sequence to a list and
   sorts it.


Customizing module attribute access
===================================

Special names "__getattr__" and "__dir__" can be also used to
customize access to module attributes. The "__getattr__" function at
the module level should accept one argument which is the name of an
attribute and return the computed value or raise an "AttributeError".
If an attribute is not found on a module object through the normal
lookup, i.e. "object.__getattribute__()", then "__getattr__" is
searched in the module "__dict__" before raising an "AttributeError".
If found, it is called with the attribute name and the result is
returned.

The "__dir__" function should accept no arguments, and return a
sequence of strings that represents the names accessible on module. If
present, this function overrides the standard "dir()" search on a
module.

For a more fine grained customization of the module behavior (setting
attributes, properties, etc.), one can set the "__class__" attribute
of a module object to a subclass of "types.ModuleType". For example:

   import sys
   from types import ModuleType

   class VerboseModule(ModuleType):
       def __repr__(self):
           return f'Verbose {self.__name__}'

       def __setattr__(self, attr, value):
           print(f'Setting {attr}...')
           super().__setattr__(attr, value)

   sys.modules[__name__].__class__ = VerboseModule

Note:

  Defining module "__getattr__" and setting module "__class__" only
  affect lookups made using the attribute access syntax – directly
  accessing the module globals (whether by code within the module, or
  via a reference to the module’s globals dictionary) is unaffected.

Changed in version 3.5: "__class__" module attribute is now writable.

New in version 3.7: "__getattr__" and "__dir__" module attributes.

See also:

  **PEP 562** - Module __getattr__ and __dir__
     Describes the "__getattr__" and "__dir__" functions on modules.


Implementing Descriptors
========================

The following methods only apply when an instance of the class
containing the method (a so-called *descriptor* class) appears in an
*owner* class (the descriptor must be in either the owner’s class
dictionary or in the class dictionary for one of its parents).  In the
examples below, “the attribute” refers to the attribute whose name is
the key of the property in the owner class’ "__dict__".

object.__get__(self, instance, owner=None)

   Called to get the attribute of the owner class (class attribute
   access) or of an instance of that class (instance attribute
   access). The optional *owner* argument is the owner class, while
   *instance* is the instance that the attribute was accessed through,
   or "None" when the attribute is accessed through the *owner*.

   This method should return the computed attribute value or raise an
   "AttributeError" exception.

   **PEP 252** specifies that "__get__()" is callable with one or two
   arguments.  Python’s own built-in descriptors support this
   specification; however, it is likely that some third-party tools
   have descriptors that require both arguments.  Python’s own
   "__getattribute__()" implementation always passes in both arguments
   whether they are required or not.

object.__set__(self, instance, value)

   Called to set the attribute on an instance *instance* of the owner
   class to a new value, *value*.

   Note, adding "__set__()" or "__delete__()" changes the kind of
   descriptor to a “data descriptor”.  See Invoking Descriptors for
   more details.

object.__delete__(self, instance)

   Called to delete the attribute on an instance *instance* of the
   owner class.

object.__set_name__(self, owner, name)

   Called at the time the owning class *owner* is created. The
   descriptor has been assigned to *name*.

   Note:

     "__set_name__()" is only called implicitly as part of the "type"
     constructor, so it will need to be called explicitly with the
     appropriate parameters when a descriptor is added to a class
     after initial creation:

        class A:
           pass
        descr = custom_descriptor()
        A.attr = descr
        descr.__set_name__(A, 'attr')

     See Creating the class object for more details.

   New in version 3.6.

The attribute "__objclass__" is interpreted by the "inspect" module as
specifying the class where this object was defined (setting this
appropriately can assist in runtime introspection of dynamic class
attributes). For callables, it may indicate that an instance of the
given type (or a subclass) is expected or required as the first
positional argument (for example, CPython sets this attribute for
unbound methods that are implemented in C).


Invoking Descriptors
====================

In general, a descriptor is an object attribute with “binding
behavior”, one whose attribute access has been overridden by methods
in the descriptor protocol:  "__get__()", "__set__()", and
"__delete__()". If any of those methods are defined for an object, it
is said to be a descriptor.

The default behavior for attribute access is to get, set, or delete
the attribute from an object’s dictionary. For instance, "a.x" has a
lookup chain starting with "a.__dict__['x']", then
"type(a).__dict__['x']", and continuing through the base classes of
"type(a)" excluding metaclasses.

However, if the looked-up value is an object defining one of the
descriptor methods, then Python may override the default behavior and
invoke the descriptor method instead.  Where this occurs in the
precedence chain depends on which descriptor methods were defined and
how they were called.

The starting point for descriptor invocation is a binding, "a.x". How
the arguments are assembled depends on "a":

Direct Call
   The simplest and least common call is when user code directly
   invokes a descriptor method:    "x.__get__(a)".

Instance Binding
   If binding to an object instance, "a.x" is transformed into the
   call: "type(a).__dict__['x'].__get__(a, type(a))".

Class Binding
   If binding to a class, "A.x" is transformed into the call:
   "A.__dict__['x'].__get__(None, A)".

Super Binding
   If "a" is an instance of "super", then the binding "super(B,
   obj).m()" searches "obj.__class__.__mro__" for the base class "A"
   immediately preceding "B" and then invokes the descriptor with the
   call: "A.__dict__['m'].__get__(obj, obj.__class__)".

For instance bindings, the precedence of descriptor invocation depends
on which descriptor methods are defined.  A descriptor can define any
combination of "__get__()", "__set__()" and "__delete__()".  If it
does not define "__get__()", then accessing the attribute will return
the descriptor object itself unless there is a value in the object’s
instance dictionary.  If the descriptor defines "__set__()" and/or
"__delete__()", it is a data descriptor; if it defines neither, it is
a non-data descriptor.  Normally, data descriptors define both
"__get__()" and "__set__()", while non-data descriptors have just the
"__get__()" method.  Data descriptors with "__set__()" and "__get__()"
defined always override a redefinition in an instance dictionary.  In
contrast, non-data descriptors can be overridden by instances.

Python methods (including "staticmethod()" and "classmethod()") are
implemented as non-data descriptors.  Accordingly, instances can
redefine and override methods.  This allows individual instances to
acquire behaviors that differ from other instances of the same class.

The "property()" function is implemented as a data descriptor.
Accordingly, instances cannot override the behavior of a property.


__slots__
=========

*__slots__* allow us to explicitly declare data members (like
properties) and deny the creation of *__dict__* and *__weakref__*
(unless explicitly declared in *__slots__* or available in a parent.)

The space saved over using *__dict__* can be significant. Attribute
lookup speed can be significantly improved as well.

object.__slots__

   This class variable can be assigned a string, iterable, or sequence
   of strings with variable names used by instances.  *__slots__*
   reserves space for the declared variables and prevents the
   automatic creation of *__dict__* and *__weakref__* for each
   instance.


Notes on using *__slots__*
--------------------------

* When inheriting from a class without *__slots__*, the *__dict__* and
  *__weakref__* attribute of the instances will always be accessible.

* Without a *__dict__* variable, instances cannot be assigned new
  variables not listed in the *__slots__* definition.  Attempts to
  assign to an unlisted variable name raises "AttributeError". If
  dynamic assignment of new variables is desired, then add
  "'__dict__'" to the sequence of strings in the *__slots__*
  declaration.

* Without a *__weakref__* variable for each instance, classes defining
  *__slots__* do not support weak references to its instances. If weak
  reference support is needed, then add "'__weakref__'" to the
  sequence of strings in the *__slots__* declaration.

* *__slots__* are implemented at the class level by creating
  descriptors (Implementing Descriptors) for each variable name.  As a
  result, class attributes cannot be used to set default values for
  instance variables defined by *__slots__*; otherwise, the class
  attribute would overwrite the descriptor assignment.

* The action of a *__slots__* declaration is not limited to the class
  where it is defined.  *__slots__* declared in parents are available
  in child classes. However, child subclasses will get a *__dict__*
  and *__weakref__* unless they also define *__slots__* (which should
  only contain names of any *additional* slots).

* If a class defines a slot also defined in a base class, the instance
  variable defined by the base class slot is inaccessible (except by
  retrieving its descriptor directly from the base class). This
  renders the meaning of the program undefined.  In the future, a
  check may be added to prevent this.

* Nonempty *__slots__* does not work for classes derived from
  “variable-length” built-in types such as "int", "bytes" and "tuple".

* Any non-string iterable may be assigned to *__slots__*. Mappings may
  also be used; however, in the future, special meaning may be
  assigned to the values corresponding to each key.

* *__class__* assignment works only if both classes have the same
  *__slots__*.

* Multiple inheritance with multiple slotted parent classes can be
  used, but only one parent is allowed to have attributes created by
  slots (the other bases must have empty slot layouts) - violations
  raise "TypeError".

* If an iterator is used for *__slots__* then a descriptor is created
  for each of the iterator’s values. However, the *__slots__*
  attribute will be an empty iterator.
a�Attribute references
********************

An attribute reference is a primary followed by a period and a name:

   attributeref ::= primary "." identifier

The primary must evaluate to an object of a type that supports
attribute references, which most objects do.  This object is then
asked to produce the attribute whose name is the identifier.  This
production can be customized by overriding the "__getattr__()" method.
If this attribute is not available, the exception "AttributeError" is
raised.  Otherwise, the type and value of the object produced is
determined by the object.  Multiple evaluations of the same attribute
reference may yield different objects.
a�Augmented assignment statements
*******************************

Augmented assignment is the combination, in a single statement, of a
binary operation and an assignment statement:

   augmented_assignment_stmt ::= augtarget augop (expression_list | yield_expression)
   augtarget                 ::= identifier | attributeref | subscription | slicing
   augop                     ::= "+=" | "-=" | "*=" | "@=" | "/=" | "//=" | "%=" | "**="
             | ">>=" | "<<=" | "&=" | "^=" | "|="

(See section Primaries for the syntax definitions of the last three
symbols.)

An augmented assignment evaluates the target (which, unlike normal
assignment statements, cannot be an unpacking) and the expression
list, performs the binary operation specific to the type of assignment
on the two operands, and assigns the result to the original target.
The target is only evaluated once.

An augmented assignment expression like "x += 1" can be rewritten as
"x = x + 1" to achieve a similar, but not exactly equal effect. In the
augmented version, "x" is only evaluated once. Also, when possible,
the actual operation is performed *in-place*, meaning that rather than
creating a new object and assigning that to the target, the old object
is modified instead.

Unlike normal assignments, augmented assignments evaluate the left-
hand side *before* evaluating the right-hand side.  For example, "a[i]
+= f(x)" first looks-up "a[i]", then it evaluates "f(x)" and performs
the addition, and lastly, it writes the result back to "a[i]".

With the exception of assigning to tuples and multiple targets in a
single statement, the assignment done by augmented assignment
statements is handled the same way as normal assignments. Similarly,
with the exception of the possible *in-place* behavior, the binary
operation performed by augmented assignment is the same as the normal
binary operations.

For targets which are attribute references, the same caveat about
class and instance attributes applies as for regular assignments.
z�Await expression
****************

Suspend the execution of *coroutine* on an *awaitable* object. Can
only be used inside a *coroutine function*.

   await_expr ::= "await" primary

New in version 3.5.
ujBinary arithmetic operations
****************************

The binary arithmetic operations have the conventional priority
levels.  Note that some of these operations also apply to certain non-
numeric types.  Apart from the power operator, there are only two
levels, one for multiplicative operators and one for additive
operators:

   m_expr ::= u_expr | m_expr "*" u_expr | m_expr "@" m_expr |
              m_expr "//" u_expr | m_expr "/" u_expr |
              m_expr "%" u_expr
   a_expr ::= m_expr | a_expr "+" m_expr | a_expr "-" m_expr

The "*" (multiplication) operator yields the product of its arguments.
The arguments must either both be numbers, or one argument must be an
integer and the other must be a sequence. In the former case, the
numbers are converted to a common type and then multiplied together.
In the latter case, sequence repetition is performed; a negative
repetition factor yields an empty sequence.

The "@" (at) operator is intended to be used for matrix
multiplication.  No builtin Python types implement this operator.

New in version 3.5.

The "/" (division) and "//" (floor division) operators yield the
quotient of their arguments.  The numeric arguments are first
converted to a common type. Division of integers yields a float, while
floor division of integers results in an integer; the result is that
of mathematical division with the ‘floor’ function applied to the
result.  Division by zero raises the "ZeroDivisionError" exception.

The "%" (modulo) operator yields the remainder from the division of
the first argument by the second.  The numeric arguments are first
converted to a common type.  A zero right argument raises the
"ZeroDivisionError" exception.  The arguments may be floating point
numbers, e.g., "3.14%0.7" equals "0.34" (since "3.14" equals "4*0.7 +
0.34".)  The modulo operator always yields a result with the same sign
as its second operand (or zero); the absolute value of the result is
strictly smaller than the absolute value of the second operand [1].

The floor division and modulo operators are connected by the following
identity: "x == (x//y)*y + (x%y)".  Floor division and modulo are also
connected with the built-in function "divmod()": "divmod(x, y) ==
(x//y, x%y)". [2].

In addition to performing the modulo operation on numbers, the "%"
operator is also overloaded by string objects to perform old-style
string formatting (also known as interpolation).  The syntax for
string formatting is described in the Python Library Reference,
section printf-style String Formatting.

The floor division operator, the modulo operator, and the "divmod()"
function are not defined for complex numbers.  Instead, convert to a
floating point number using the "abs()" function if appropriate.

The "+" (addition) operator yields the sum of its arguments.  The
arguments must either both be numbers or both be sequences of the same
type.  In the former case, the numbers are converted to a common type
and then added together. In the latter case, the sequences are
concatenated.

The "-" (subtraction) operator yields the difference of its arguments.
The numeric arguments are first converted to a common type.
a$Binary bitwise operations
*************************

Each of the three bitwise operations has a different priority level:

   and_expr ::= shift_expr | and_expr "&" shift_expr
   xor_expr ::= and_expr | xor_expr "^" and_expr
   or_expr  ::= xor_expr | or_expr "|" xor_expr

The "&" operator yields the bitwise AND of its arguments, which must
be integers.

The "^" operator yields the bitwise XOR (exclusive OR) of its
arguments, which must be integers.

The "|" operator yields the bitwise (inclusive) OR of its arguments,
which must be integers.
u�Code Objects
************

Code objects are used by the implementation to represent “pseudo-
compiled” executable Python code such as a function body. They differ
from function objects because they don’t contain a reference to their
global execution environment.  Code objects are returned by the built-
in "compile()" function and can be extracted from function objects
through their "__code__" attribute. See also the "code" module.

Accessing "__code__" raises an auditing event "object.__getattr__"
with arguments "obj" and ""__code__"".

A code object can be executed or evaluated by passing it (instead of a
source string) to the "exec()" or "eval()"  built-in functions.

See The standard type hierarchy for more information.
a.The Ellipsis Object
*******************

This object is commonly used by slicing (see Slicings).  It supports
no special operations.  There is exactly one ellipsis object, named
"Ellipsis" (a built-in name).  "type(Ellipsis)()" produces the
"Ellipsis" singleton.

It is written as "Ellipsis" or "...".
uThe Null Object
***************

This object is returned by functions that don’t explicitly return a
value.  It supports no special operations.  There is exactly one null
object, named "None" (a built-in name).  "type(None)()" produces the
same singleton.

It is written as "None".
u5Type Objects
************

Type objects represent the various object types.  An object’s type is
accessed by the built-in function "type()".  There are no special
operations on types.  The standard module "types" defines names for
all standard built-in types.

Types are written like this: "<class 'int'>".
a�Boolean operations
******************

   or_test  ::= and_test | or_test "or" and_test
   and_test ::= not_test | and_test "and" not_test
   not_test ::= comparison | "not" not_test

In the context of Boolean operations, and also when expressions are
used by control flow statements, the following values are interpreted
as false: "False", "None", numeric zero of all types, and empty
strings and containers (including strings, tuples, lists,
dictionaries, sets and frozensets).  All other values are interpreted
as true.  User-defined objects can customize their truth value by
providing a "__bool__()" method.

The operator "not" yields "True" if its argument is false, "False"
otherwise.

The expression "x and y" first evaluates *x*; if *x* is false, its
value is returned; otherwise, *y* is evaluated and the resulting value
is returned.

The expression "x or y" first evaluates *x*; if *x* is true, its value
is returned; otherwise, *y* is evaluated and the resulting value is
returned.

Note that neither "and" nor "or" restrict the value and type they
return to "False" and "True", but rather return the last evaluated
argument.  This is sometimes useful, e.g., if "s" is a string that
should be replaced by a default value if it is empty, the expression
"s or 'foo'" yields the desired value.  Because "not" has to create a
new value, it returns a boolean value regardless of the type of its
argument (for example, "not 'foo'" produces "False" rather than "''".)
a$The "break" statement
*********************

   break_stmt ::= "break"

"break" may only occur syntactically nested in a "for" or "while"
loop, but not nested in a function or class definition within that
loop.

It terminates the nearest enclosing loop, skipping the optional "else"
clause if the loop has one.

If a "for" loop is terminated by "break", the loop control target
keeps its current value.

When "break" passes control out of a "try" statement with a "finally"
clause, that "finally" clause is executed before really leaving the
loop.
uEmulating callable objects
**************************

object.__call__(self[, args...])

   Called when the instance is “called” as a function; if this method
   is defined, "x(arg1, arg2, ...)" roughly translates to
   "type(x).__call__(x, arg1, ...)".
u�Calls
*****

A call calls a callable object (e.g., a *function*) with a possibly
empty series of *arguments*:

   call                 ::= primary "(" [argument_list [","] | comprehension] ")"
   argument_list        ::= positional_arguments ["," starred_and_keywords]
                       ["," keywords_arguments]
                     | starred_and_keywords ["," keywords_arguments]
                     | keywords_arguments
   positional_arguments ::= positional_item ("," positional_item)*
   positional_item      ::= assignment_expression | "*" expression
   starred_and_keywords ::= ("*" expression | keyword_item)
                            ("," "*" expression | "," keyword_item)*
   keywords_arguments   ::= (keyword_item | "**" expression)
                          ("," keyword_item | "," "**" expression)*
   keyword_item         ::= identifier "=" expression

An optional trailing comma may be present after the positional and
keyword arguments but does not affect the semantics.

The primary must evaluate to a callable object (user-defined
functions, built-in functions, methods of built-in objects, class
objects, methods of class instances, and all objects having a
"__call__()" method are callable).  All argument expressions are
evaluated before the call is attempted.  Please refer to section
Function definitions for the syntax of formal *parameter* lists.

If keyword arguments are present, they are first converted to
positional arguments, as follows.  First, a list of unfilled slots is
created for the formal parameters.  If there are N positional
arguments, they are placed in the first N slots.  Next, for each
keyword argument, the identifier is used to determine the
corresponding slot (if the identifier is the same as the first formal
parameter name, the first slot is used, and so on).  If the slot is
already filled, a "TypeError" exception is raised. Otherwise, the
value of the argument is placed in the slot, filling it (even if the
expression is "None", it fills the slot).  When all arguments have
been processed, the slots that are still unfilled are filled with the
corresponding default value from the function definition.  (Default
values are calculated, once, when the function is defined; thus, a
mutable object such as a list or dictionary used as default value will
be shared by all calls that don’t specify an argument value for the
corresponding slot; this should usually be avoided.)  If there are any
unfilled slots for which no default value is specified, a "TypeError"
exception is raised.  Otherwise, the list of filled slots is used as
the argument list for the call.

**CPython implementation detail:** An implementation may provide
built-in functions whose positional parameters do not have names, even
if they are ‘named’ for the purpose of documentation, and which
therefore cannot be supplied by keyword.  In CPython, this is the case
for functions implemented in C that use "PyArg_ParseTuple()" to parse
their arguments.

If there are more positional arguments than there are formal parameter
slots, a "TypeError" exception is raised, unless a formal parameter
using the syntax "*identifier" is present; in this case, that formal
parameter receives a tuple containing the excess positional arguments
(or an empty tuple if there were no excess positional arguments).

If any keyword argument does not correspond to a formal parameter
name, a "TypeError" exception is raised, unless a formal parameter
using the syntax "**identifier" is present; in this case, that formal
parameter receives a dictionary containing the excess keyword
arguments (using the keywords as keys and the argument values as
corresponding values), or a (new) empty dictionary if there were no
excess keyword arguments.

If the syntax "*expression" appears in the function call, "expression"
must evaluate to an *iterable*.  Elements from these iterables are
treated as if they were additional positional arguments.  For the call
"f(x1, x2, *y, x3, x4)", if *y* evaluates to a sequence *y1*, …, *yM*,
this is equivalent to a call with M+4 positional arguments *x1*, *x2*,
*y1*, …, *yM*, *x3*, *x4*.

A consequence of this is that although the "*expression" syntax may
appear *after* explicit keyword arguments, it is processed *before*
the keyword arguments (and any "**expression" arguments – see below).
So:

   >>> def f(a, b):
   ...     print(a, b)
   ...
   >>> f(b=1, *(2,))
   2 1
   >>> f(a=1, *(2,))
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
   TypeError: f() got multiple values for keyword argument 'a'
   >>> f(1, *(2,))
   1 2

It is unusual for both keyword arguments and the "*expression" syntax
to be used in the same call, so in practice this confusion does not
arise.

If the syntax "**expression" appears in the function call,
"expression" must evaluate to a *mapping*, the contents of which are
treated as additional keyword arguments.  If a keyword is already
present (as an explicit keyword argument, or from another unpacking),
a "TypeError" exception is raised.

Formal parameters using the syntax "*identifier" or "**identifier"
cannot be used as positional argument slots or as keyword argument
names.

Changed in version 3.5: Function calls accept any number of "*" and
"**" unpackings, positional arguments may follow iterable unpackings
("*"), and keyword arguments may follow dictionary unpackings ("**").
Originally proposed by **PEP 448**.

A call always returns some value, possibly "None", unless it raises an
exception.  How this value is computed depends on the type of the
callable object.

If it is—

a user-defined function:
   The code block for the function is executed, passing it the
   argument list.  The first thing the code block will do is bind the
   formal parameters to the arguments; this is described in section
   Function definitions.  When the code block executes a "return"
   statement, this specifies the return value of the function call.

a built-in function or method:
   The result is up to the interpreter; see Built-in Functions for the
   descriptions of built-in functions and methods.

a class object:
   A new instance of that class is returned.

a class instance method:
   The corresponding user-defined function is called, with an argument
   list that is one longer than the argument list of the call: the
   instance becomes the first argument.

a class instance:
   The class must define a "__call__()" method; the effect is then the
   same as if that method was called.
uClass definitions
*****************

A class definition defines a class object (see section The standard
type hierarchy):

   classdef    ::= [decorators] "class" classname [inheritance] ":" suite
   inheritance ::= "(" [argument_list] ")"
   classname   ::= identifier

A class definition is an executable statement.  The inheritance list
usually gives a list of base classes (see Metaclasses for more
advanced uses), so each item in the list should evaluate to a class
object which allows subclassing.  Classes without an inheritance list
inherit, by default, from the base class "object"; hence,

   class Foo:
       pass

is equivalent to

   class Foo(object):
       pass

The class’s suite is then executed in a new execution frame (see
Naming and binding), using a newly created local namespace and the
original global namespace. (Usually, the suite contains mostly
function definitions.)  When the class’s suite finishes execution, its
execution frame is discarded but its local namespace is saved. [3] A
class object is then created using the inheritance list for the base
classes and the saved local namespace for the attribute dictionary.
The class name is bound to this class object in the original local
namespace.

The order in which attributes are defined in the class body is
preserved in the new class’s "__dict__".  Note that this is reliable
only right after the class is created and only for classes that were
defined using the definition syntax.

Class creation can be customized heavily using metaclasses.

Classes can also be decorated: just like when decorating functions,

   @f1(arg)
   @f2
   class Foo: pass

is roughly equivalent to

   class Foo: pass
   Foo = f1(arg)(f2(Foo))

The evaluation rules for the decorator expressions are the same as for
function decorators.  The result is then bound to the class name.

**Programmer’s note:** Variables defined in the class definition are
class attributes; they are shared by instances.  Instance attributes
can be set in a method with "self.name = value".  Both class and
instance attributes are accessible through the notation “"self.name"”,
and an instance attribute hides a class attribute with the same name
when accessed in this way.  Class attributes can be used as defaults
for instance attributes, but using mutable values there can lead to
unexpected results.  Descriptors can be used to create instance
variables with different implementation details.

See also:

  **PEP 3115** - Metaclasses in Python 3000
     The proposal that changed the declaration of metaclasses to the
     current syntax, and the semantics for how classes with
     metaclasses are constructed.

  **PEP 3129** - Class Decorators
     The proposal that added class decorators.  Function and method
     decorators were introduced in **PEP 318**.
u�'Comparisons
***********

Unlike C, all comparison operations in Python have the same priority,
which is lower than that of any arithmetic, shifting or bitwise
operation.  Also unlike C, expressions like "a < b < c" have the
interpretation that is conventional in mathematics:

   comparison    ::= or_expr (comp_operator or_expr)*
   comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "!="
                     | "is" ["not"] | ["not"] "in"

Comparisons yield boolean values: "True" or "False".

Comparisons can be chained arbitrarily, e.g., "x < y <= z" is
equivalent to "x < y and y <= z", except that "y" is evaluated only
once (but in both cases "z" is not evaluated at all when "x < y" is
found to be false).

Formally, if *a*, *b*, *c*, …, *y*, *z* are expressions and *op1*,
*op2*, …, *opN* are comparison operators, then "a op1 b op2 c ... y
opN z" is equivalent to "a op1 b and b op2 c and ... y opN z", except
that each expression is evaluated at most once.

Note that "a op1 b op2 c" doesn’t imply any kind of comparison between
*a* and *c*, so that, e.g., "x < y > z" is perfectly legal (though
perhaps not pretty).


Value comparisons
=================

The operators "<", ">", "==", ">=", "<=", and "!=" compare the values
of two objects.  The objects do not need to have the same type.

Chapter Objects, values and types states that objects have a value (in
addition to type and identity).  The value of an object is a rather
abstract notion in Python: For example, there is no canonical access
method for an object’s value.  Also, there is no requirement that the
value of an object should be constructed in a particular way, e.g.
comprised of all its data attributes. Comparison operators implement a
particular notion of what the value of an object is.  One can think of
them as defining the value of an object indirectly, by means of their
comparison implementation.

Because all types are (direct or indirect) subtypes of "object", they
inherit the default comparison behavior from "object".  Types can
customize their comparison behavior by implementing *rich comparison
methods* like "__lt__()", described in Basic customization.

The default behavior for equality comparison ("==" and "!=") is based
on the identity of the objects.  Hence, equality comparison of
instances with the same identity results in equality, and equality
comparison of instances with different identities results in
inequality.  A motivation for this default behavior is the desire that
all objects should be reflexive (i.e. "x is y" implies "x == y").

A default order comparison ("<", ">", "<=", and ">=") is not provided;
an attempt raises "TypeError".  A motivation for this default behavior
is the lack of a similar invariant as for equality.

The behavior of the default equality comparison, that instances with
different identities are always unequal, may be in contrast to what
types will need that have a sensible definition of object value and
value-based equality.  Such types will need to customize their
comparison behavior, and in fact, a number of built-in types have done
that.

The following list describes the comparison behavior of the most
important built-in types.

* Numbers of built-in numeric types (Numeric Types — int, float,
  complex) and of the standard library types "fractions.Fraction" and
  "decimal.Decimal" can be compared within and across their types,
  with the restriction that complex numbers do not support order
  comparison.  Within the limits of the types involved, they compare
  mathematically (algorithmically) correct without loss of precision.

  The not-a-number values "float('NaN')" and "decimal.Decimal('NaN')"
  are special.  Any ordered comparison of a number to a not-a-number
  value is false. A counter-intuitive implication is that not-a-number
  values are not equal to themselves.  For example, if "x =
  float('NaN')", "3 < x", "x < 3" and "x == x" are all false, while "x
  != x" is true.  This behavior is compliant with IEEE 754.

* "None" and "NotImplemented" are singletons.  **PEP 8** advises that
  comparisons for singletons should always be done with "is" or "is
  not", never the equality operators.

* Binary sequences (instances of "bytes" or "bytearray") can be
  compared within and across their types.  They compare
  lexicographically using the numeric values of their elements.

* Strings (instances of "str") compare lexicographically using the
  numerical Unicode code points (the result of the built-in function
  "ord()") of their characters. [3]

  Strings and binary sequences cannot be directly compared.

* Sequences (instances of "tuple", "list", or "range") can be compared
  only within each of their types, with the restriction that ranges do
  not support order comparison.  Equality comparison across these
  types results in inequality, and ordering comparison across these
  types raises "TypeError".

  Sequences compare lexicographically using comparison of
  corresponding elements.  The built-in containers typically assume
  identical objects are equal to themselves.  That lets them bypass
  equality tests for identical objects to improve performance and to
  maintain their internal invariants.

  Lexicographical comparison between built-in collections works as
  follows:

  * For two collections to compare equal, they must be of the same
    type, have the same length, and each pair of corresponding
    elements must compare equal (for example, "[1,2] == (1,2)" is
    false because the type is not the same).

  * Collections that support order comparison are ordered the same as
    their first unequal elements (for example, "[1,2,x] <= [1,2,y]"
    has the same value as "x <= y").  If a corresponding element does
    not exist, the shorter collection is ordered first (for example,
    "[1,2] < [1,2,3]" is true).

* Mappings (instances of "dict") compare equal if and only if they
  have equal *(key, value)* pairs. Equality comparison of the keys and
  values enforces reflexivity.

  Order comparisons ("<", ">", "<=", and ">=") raise "TypeError".

* Sets (instances of "set" or "frozenset") can be compared within and
  across their types.

  They define order comparison operators to mean subset and superset
  tests.  Those relations do not define total orderings (for example,
  the two sets "{1,2}" and "{2,3}" are not equal, nor subsets of one
  another, nor supersets of one another).  Accordingly, sets are not
  appropriate arguments for functions which depend on total ordering
  (for example, "min()", "max()", and "sorted()" produce undefined
  results given a list of sets as inputs).

  Comparison of sets enforces reflexivity of its elements.

* Most other built-in types have no comparison methods implemented, so
  they inherit the default comparison behavior.

User-defined classes that customize their comparison behavior should
follow some consistency rules, if possible:

* Equality comparison should be reflexive. In other words, identical
  objects should compare equal:

     "x is y" implies "x == y"

* Comparison should be symmetric. In other words, the following
  expressions should have the same result:

     "x == y" and "y == x"

     "x != y" and "y != x"

     "x < y" and "y > x"

     "x <= y" and "y >= x"

* Comparison should be transitive. The following (non-exhaustive)
  examples illustrate that:

     "x > y and y > z" implies "x > z"

     "x < y and y <= z" implies "x < z"

* Inverse comparison should result in the boolean negation. In other
  words, the following expressions should have the same result:

     "x == y" and "not x != y"

     "x < y" and "not x >= y" (for total ordering)

     "x > y" and "not x <= y" (for total ordering)

  The last two expressions apply to totally ordered collections (e.g.
  to sequences, but not to sets or mappings). See also the
  "total_ordering()" decorator.

* The "hash()" result should be consistent with equality. Objects that
  are equal should either have the same hash value, or be marked as
  unhashable.

Python does not enforce these consistency rules. In fact, the
not-a-number values are an example for not following these rules.


Membership test operations
==========================

The operators "in" and "not in" test for membership.  "x in s"
evaluates to "True" if *x* is a member of *s*, and "False" otherwise.
"x not in s" returns the negation of "x in s".  All built-in sequences
and set types support this as well as dictionary, for which "in" tests
whether the dictionary has a given key. For container types such as
list, tuple, set, frozenset, dict, or collections.deque, the
expression "x in y" is equivalent to "any(x is e or x == e for e in
y)".

For the string and bytes types, "x in y" is "True" if and only if *x*
is a substring of *y*.  An equivalent test is "y.find(x) != -1".
Empty strings are always considered to be a substring of any other
string, so """ in "abc"" will return "True".

For user-defined classes which define the "__contains__()" method, "x
in y" returns "True" if "y.__contains__(x)" returns a true value, and
"False" otherwise.

For user-defined classes which do not define "__contains__()" but do
define "__iter__()", "x in y" is "True" if some value "z", for which
the expression "x is z or x == z" is true, is produced while iterating
over "y". If an exception is raised during the iteration, it is as if
"in" raised that exception.

Lastly, the old-style iteration protocol is tried: if a class defines
"__getitem__()", "x in y" is "True" if and only if there is a non-
negative integer index *i* such that "x is y[i] or x == y[i]", and no
lower integer index raises the "IndexError" exception.  (If any other
exception is raised, it is as if "in" raised that exception).

The operator "not in" is defined to have the inverse truth value of
"in".


Identity comparisons
====================

The operators "is" and "is not" test for an object’s identity: "x is
y" is true if and only if *x* and *y* are the same object.  An
Object’s identity is determined using the "id()" function.  "x is not
y" yields the inverse truth value. [4]
u�lCompound statements
*******************

Compound statements contain (groups of) other statements; they affect
or control the execution of those other statements in some way.  In
general, compound statements span multiple lines, although in simple
incarnations a whole compound statement may be contained in one line.

The "if", "while" and "for" statements implement traditional control
flow constructs.  "try" specifies exception handlers and/or cleanup
code for a group of statements, while the "with" statement allows the
execution of initialization and finalization code around a block of
code.  Function and class definitions are also syntactically compound
statements.

A compound statement consists of one or more ‘clauses.’  A clause
consists of a header and a ‘suite.’  The clause headers of a
particular compound statement are all at the same indentation level.
Each clause header begins with a uniquely identifying keyword and ends
with a colon.  A suite is a group of statements controlled by a
clause.  A suite can be one or more semicolon-separated simple
statements on the same line as the header, following the header’s
colon, or it can be one or more indented statements on subsequent
lines.  Only the latter form of a suite can contain nested compound
statements; the following is illegal, mostly because it wouldn’t be
clear to which "if" clause a following "else" clause would belong:

   if test1: if test2: print(x)

Also note that the semicolon binds tighter than the colon in this
context, so that in the following example, either all or none of the
"print()" calls are executed:

   if x < y < z: print(x); print(y); print(z)

Summarizing:

   compound_stmt ::= if_stmt
                     | while_stmt
                     | for_stmt
                     | try_stmt
                     | with_stmt
                     | funcdef
                     | classdef
                     | async_with_stmt
                     | async_for_stmt
                     | async_funcdef
   suite         ::= stmt_list NEWLINE | NEWLINE INDENT statement+ DEDENT
   statement     ::= stmt_list NEWLINE | compound_stmt
   stmt_list     ::= simple_stmt (";" simple_stmt)* [";"]

Note that statements always end in a "NEWLINE" possibly followed by a
"DEDENT".  Also note that optional continuation clauses always begin
with a keyword that cannot start a statement, thus there are no
ambiguities (the ‘dangling "else"’ problem is solved in Python by
requiring nested "if" statements to be indented).

The formatting of the grammar rules in the following sections places
each clause on a separate line for clarity.


The "if" statement
==================

The "if" statement is used for conditional execution:

   if_stmt ::= "if" assignment_expression ":" suite
               ("elif" assignment_expression ":" suite)*
               ["else" ":" suite]

It selects exactly one of the suites by evaluating the expressions one
by one until one is found to be true (see section Boolean operations
for the definition of true and false); then that suite is executed
(and no other part of the "if" statement is executed or evaluated).
If all expressions are false, the suite of the "else" clause, if
present, is executed.


The "while" statement
=====================

The "while" statement is used for repeated execution as long as an
expression is true:

   while_stmt ::= "while" assignment_expression ":" suite
                  ["else" ":" suite]

This repeatedly tests the expression and, if it is true, executes the
first suite; if the expression is false (which may be the first time
it is tested) the suite of the "else" clause, if present, is executed
and the loop terminates.

A "break" statement executed in the first suite terminates the loop
without executing the "else" clause’s suite.  A "continue" statement
executed in the first suite skips the rest of the suite and goes back
to testing the expression.


The "for" statement
===================

The "for" statement is used to iterate over the elements of a sequence
(such as a string, tuple or list) or other iterable object:

   for_stmt ::= "for" target_list "in" expression_list ":" suite
                ["else" ":" suite]

The expression list is evaluated once; it should yield an iterable
object.  An iterator is created for the result of the
"expression_list".  The suite is then executed once for each item
provided by the iterator, in the order returned by the iterator.  Each
item in turn is assigned to the target list using the standard rules
for assignments (see Assignment statements), and then the suite is
executed.  When the items are exhausted (which is immediately when the
sequence is empty or an iterator raises a "StopIteration" exception),
the suite in the "else" clause, if present, is executed, and the loop
terminates.

A "break" statement executed in the first suite terminates the loop
without executing the "else" clause’s suite.  A "continue" statement
executed in the first suite skips the rest of the suite and continues
with the next item, or with the "else" clause if there is no next
item.

The for-loop makes assignments to the variables in the target list.
This overwrites all previous assignments to those variables including
those made in the suite of the for-loop:

   for i in range(10):
       print(i)
       i = 5             # this will not affect the for-loop
                         # because i will be overwritten with the next
                         # index in the range

Names in the target list are not deleted when the loop is finished,
but if the sequence is empty, they will not have been assigned to at
all by the loop.  Hint: the built-in function "range()" returns an
iterator of integers suitable to emulate the effect of Pascal’s "for i
:= a to b do"; e.g., "list(range(3))" returns the list "[0, 1, 2]".

Note:

  There is a subtlety when the sequence is being modified by the loop
  (this can only occur for mutable sequences, e.g. lists).  An
  internal counter is used to keep track of which item is used next,
  and this is incremented on each iteration.  When this counter has
  reached the length of the sequence the loop terminates.  This means
  that if the suite deletes the current (or a previous) item from the
  sequence, the next item will be skipped (since it gets the index of
  the current item which has already been treated).  Likewise, if the
  suite inserts an item in the sequence before the current item, the
  current item will be treated again the next time through the loop.
  This can lead to nasty bugs that can be avoided by making a
  temporary copy using a slice of the whole sequence, e.g.,

     for x in a[:]:
         if x < 0: a.remove(x)


The "try" statement
===================

The "try" statement specifies exception handlers and/or cleanup code
for a group of statements:

   try_stmt  ::= try1_stmt | try2_stmt
   try1_stmt ::= "try" ":" suite
                 ("except" [expression ["as" identifier]] ":" suite)+
                 ["else" ":" suite]
                 ["finally" ":" suite]
   try2_stmt ::= "try" ":" suite
                 "finally" ":" suite

The "except" clause(s) specify one or more exception handlers. When no
exception occurs in the "try" clause, no exception handler is
executed. When an exception occurs in the "try" suite, a search for an
exception handler is started.  This search inspects the except clauses
in turn until one is found that matches the exception.  An expression-
less except clause, if present, must be last; it matches any
exception.  For an except clause with an expression, that expression
is evaluated, and the clause matches the exception if the resulting
object is “compatible” with the exception.  An object is compatible
with an exception if it is the class or a base class of the exception
object, or a tuple containing an item that is the class or a base
class of the exception object.

If no except clause matches the exception, the search for an exception
handler continues in the surrounding code and on the invocation stack.
[1]

If the evaluation of an expression in the header of an except clause
raises an exception, the original search for a handler is canceled and
a search starts for the new exception in the surrounding code and on
the call stack (it is treated as if the entire "try" statement raised
the exception).

When a matching except clause is found, the exception is assigned to
the target specified after the "as" keyword in that except clause, if
present, and the except clause’s suite is executed.  All except
clauses must have an executable block.  When the end of this block is
reached, execution continues normally after the entire try statement.
(This means that if two nested handlers exist for the same exception,
and the exception occurs in the try clause of the inner handler, the
outer handler will not handle the exception.)

When an exception has been assigned using "as target", it is cleared
at the end of the except clause.  This is as if

   except E as N:
       foo

was translated to

   except E as N:
       try:
           foo
       finally:
           del N

This means the exception must be assigned to a different name to be
able to refer to it after the except clause.  Exceptions are cleared
because with the traceback attached to them, they form a reference
cycle with the stack frame, keeping all locals in that frame alive
until the next garbage collection occurs.

Before an except clause’s suite is executed, details about the
exception are stored in the "sys" module and can be accessed via
"sys.exc_info()". "sys.exc_info()" returns a 3-tuple consisting of the
exception class, the exception instance and a traceback object (see
section The standard type hierarchy) identifying the point in the
program where the exception occurred.  "sys.exc_info()" values are
restored to their previous values (before the call) when returning
from a function that handled an exception.

The optional "else" clause is executed if the control flow leaves the
"try" suite, no exception was raised, and no "return", "continue", or
"break" statement was executed.  Exceptions in the "else" clause are
not handled by the preceding "except" clauses.

If "finally" is present, it specifies a ‘cleanup’ handler.  The "try"
clause is executed, including any "except" and "else" clauses.  If an
exception occurs in any of the clauses and is not handled, the
exception is temporarily saved. The "finally" clause is executed.  If
there is a saved exception it is re-raised at the end of the "finally"
clause.  If the "finally" clause raises another exception, the saved
exception is set as the context of the new exception. If the "finally"
clause executes a "return", "break" or "continue" statement, the saved
exception is discarded:

   >>> def f():
   ...     try:
   ...         1/0
   ...     finally:
   ...         return 42
   ...
   >>> f()
   42

The exception information is not available to the program during
execution of the "finally" clause.

When a "return", "break" or "continue" statement is executed in the
"try" suite of a "try"…"finally" statement, the "finally" clause is
also executed ‘on the way out.’

The return value of a function is determined by the last "return"
statement executed.  Since the "finally" clause always executes, a
"return" statement executed in the "finally" clause will always be the
last one executed:

   >>> def foo():
   ...     try:
   ...         return 'try'
   ...     finally:
   ...         return 'finally'
   ...
   >>> foo()
   'finally'

Additional information on exceptions can be found in section
Exceptions, and information on using the "raise" statement to generate
exceptions may be found in section The raise statement.

Changed in version 3.8: Prior to Python 3.8, a "continue" statement
was illegal in the "finally" clause due to a problem with the
implementation.


The "with" statement
====================

The "with" statement is used to wrap the execution of a block with
methods defined by a context manager (see section With Statement
Context Managers). This allows common "try"…"except"…"finally" usage
patterns to be encapsulated for convenient reuse.

   with_stmt ::= "with" with_item ("," with_item)* ":" suite
   with_item ::= expression ["as" target]

The execution of the "with" statement with one “item” proceeds as
follows:

1. The context expression (the expression given in the "with_item") is
   evaluated to obtain a context manager.

2. The context manager’s "__enter__()" is loaded for later use.

3. The context manager’s "__exit__()" is loaded for later use.

4. The context manager’s "__enter__()" method is invoked.

5. If a target was included in the "with" statement, the return value
   from "__enter__()" is assigned to it.

   Note:

     The "with" statement guarantees that if the "__enter__()" method
     returns without an error, then "__exit__()" will always be
     called. Thus, if an error occurs during the assignment to the
     target list, it will be treated the same as an error occurring
     within the suite would be. See step 6 below.

6. The suite is executed.

7. The context manager’s "__exit__()" method is invoked.  If an
   exception caused the suite to be exited, its type, value, and
   traceback are passed as arguments to "__exit__()". Otherwise, three
   "None" arguments are supplied.

   If the suite was exited due to an exception, and the return value
   from the "__exit__()" method was false, the exception is reraised.
   If the return value was true, the exception is suppressed, and
   execution continues with the statement following the "with"
   statement.

   If the suite was exited for any reason other than an exception, the
   return value from "__exit__()" is ignored, and execution proceeds
   at the normal location for the kind of exit that was taken.

The following code:

   with EXPRESSION as TARGET:
       SUITE

is semantically equivalent to:

   manager = (EXPRESSION)
   enter = type(manager).__enter__
   exit = type(manager).__exit__
   value = enter(manager)
   hit_except = False

   try:
       TARGET = value
       SUITE
   except:
       hit_except = True
       if not exit(manager, *sys.exc_info()):
           raise
   finally:
       if not hit_except:
           exit(manager, None, None, None)

With more than one item, the context managers are processed as if
multiple "with" statements were nested:

   with A() as a, B() as b:
       SUITE

is semantically equivalent to:

   with A() as a:
       with B() as b:
           SUITE

Changed in version 3.1: Support for multiple context expressions.

See also:

  **PEP 343** - The “with” statement
     The specification, background, and examples for the Python "with"
     statement.


Function definitions
====================

A function definition defines a user-defined function object (see
section The standard type hierarchy):

   funcdef                   ::= [decorators] "def" funcname "(" [parameter_list] ")"
               ["->" expression] ":" suite
   decorators                ::= decorator+
   decorator                 ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE
   dotted_name               ::= identifier ("." identifier)*
   parameter_list            ::= defparameter ("," defparameter)* "," "/" ["," [parameter_list_no_posonly]]
                        | parameter_list_no_posonly
   parameter_list_no_posonly ::= defparameter ("," defparameter)* ["," [parameter_list_starargs]]
                                 | parameter_list_starargs
   parameter_list_starargs   ::= "*" [parameter] ("," defparameter)* ["," ["**" parameter [","]]]
                               | "**" parameter [","]
   parameter                 ::= identifier [":" expression]
   defparameter              ::= parameter ["=" expression]
   funcname                  ::= identifier

A function definition is an executable statement.  Its execution binds
the function name in the current local namespace to a function object
(a wrapper around the executable code for the function).  This
function object contains a reference to the current global namespace
as the global namespace to be used when the function is called.

The function definition does not execute the function body; this gets
executed only when the function is called. [2]

A function definition may be wrapped by one or more *decorator*
expressions. Decorator expressions are evaluated when the function is
defined, in the scope that contains the function definition.  The
result must be a callable, which is invoked with the function object
as the only argument. The returned value is bound to the function name
instead of the function object.  Multiple decorators are applied in
nested fashion. For example, the following code

   @f1(arg)
   @f2
   def func(): pass

is roughly equivalent to

   def func(): pass
   func = f1(arg)(f2(func))

except that the original function is not temporarily bound to the name
"func".

When one or more *parameters* have the form *parameter* "="
*expression*, the function is said to have “default parameter values.”
For a parameter with a default value, the corresponding *argument* may
be omitted from a call, in which case the parameter’s default value is
substituted.  If a parameter has a default value, all following
parameters up until the “"*"” must also have a default value — this is
a syntactic restriction that is not expressed by the grammar.

**Default parameter values are evaluated from left to right when the
function definition is executed.** This means that the expression is
evaluated once, when the function is defined, and that the same “pre-
computed” value is used for each call.  This is especially important
to understand when a default parameter is a mutable object, such as a
list or a dictionary: if the function modifies the object (e.g. by
appending an item to a list), the default value is in effect modified.
This is generally not what was intended.  A way around this is to use
"None" as the default, and explicitly test for it in the body of the
function, e.g.:

   def whats_on_the_telly(penguin=None):
       if penguin is None:
           penguin = []
       penguin.append("property of the zoo")
       return penguin

Function call semantics are described in more detail in section Calls.
A function call always assigns values to all parameters mentioned in
the parameter list, either from positional arguments, from keyword
arguments, or from default values.  If the form “"*identifier"” is
present, it is initialized to a tuple receiving any excess positional
parameters, defaulting to the empty tuple. If the form
“"**identifier"” is present, it is initialized to a new ordered
mapping receiving any excess keyword arguments, defaulting to a new
empty mapping of the same type.  Parameters after “"*"” or
“"*identifier"” are keyword-only parameters and may only be passed by
keyword arguments.  Parameters before “"/"” are positional-only
parameters and may only be passed by positional arguments.

Changed in version 3.8: The "/" function parameter syntax may be used
to indicate positional-only parameters. See **PEP 570** for details.

Parameters may have an *annotation* of the form “": expression"”
following the parameter name.  Any parameter may have an annotation,
even those of the form "*identifier" or "**identifier".  Functions may
have “return” annotation of the form “"-> expression"” after the
parameter list.  These annotations can be any valid Python expression.
The presence of annotations does not change the semantics of a
function.  The annotation values are available as values of a
dictionary keyed by the parameters’ names in the "__annotations__"
attribute of the function object.  If the "annotations" import from
"__future__" is used, annotations are preserved as strings at runtime
which enables postponed evaluation.  Otherwise, they are evaluated
when the function definition is executed.  In this case annotations
may be evaluated in a different order than they appear in the source
code.

It is also possible to create anonymous functions (functions not bound
to a name), for immediate use in expressions.  This uses lambda
expressions, described in section Lambdas.  Note that the lambda
expression is merely a shorthand for a simplified function definition;
a function defined in a “"def"” statement can be passed around or
assigned to another name just like a function defined by a lambda
expression.  The “"def"” form is actually more powerful since it
allows the execution of multiple statements and annotations.

**Programmer’s note:** Functions are first-class objects.  A “"def"”
statement executed inside a function definition defines a local
function that can be returned or passed around.  Free variables used
in the nested function can access the local variables of the function
containing the def.  See section Naming and binding for details.

See also:

  **PEP 3107** - Function Annotations
     The original specification for function annotations.

  **PEP 484** - Type Hints
     Definition of a standard meaning for annotations: type hints.

  **PEP 526** - Syntax for Variable Annotations
     Ability to type hint variable declarations, including class
     variables and instance variables

  **PEP 563** - Postponed Evaluation of Annotations
     Support for forward references within annotations by preserving
     annotations in a string form at runtime instead of eager
     evaluation.


Class definitions
=================

A class definition defines a class object (see section The standard
type hierarchy):

   classdef    ::= [decorators] "class" classname [inheritance] ":" suite
   inheritance ::= "(" [argument_list] ")"
   classname   ::= identifier

A class definition is an executable statement.  The inheritance list
usually gives a list of base classes (see Metaclasses for more
advanced uses), so each item in the list should evaluate to a class
object which allows subclassing.  Classes without an inheritance list
inherit, by default, from the base class "object"; hence,

   class Foo:
       pass

is equivalent to

   class Foo(object):
       pass

The class’s suite is then executed in a new execution frame (see
Naming and binding), using a newly created local namespace and the
original global namespace. (Usually, the suite contains mostly
function definitions.)  When the class’s suite finishes execution, its
execution frame is discarded but its local namespace is saved. [3] A
class object is then created using the inheritance list for the base
classes and the saved local namespace for the attribute dictionary.
The class name is bound to this class object in the original local
namespace.

The order in which attributes are defined in the class body is
preserved in the new class’s "__dict__".  Note that this is reliable
only right after the class is created and only for classes that were
defined using the definition syntax.

Class creation can be customized heavily using metaclasses.

Classes can also be decorated: just like when decorating functions,

   @f1(arg)
   @f2
   class Foo: pass

is roughly equivalent to

   class Foo: pass
   Foo = f1(arg)(f2(Foo))

The evaluation rules for the decorator expressions are the same as for
function decorators.  The result is then bound to the class name.

**Programmer’s note:** Variables defined in the class definition are
class attributes; they are shared by instances.  Instance attributes
can be set in a method with "self.name = value".  Both class and
instance attributes are accessible through the notation “"self.name"”,
and an instance attribute hides a class attribute with the same name
when accessed in this way.  Class attributes can be used as defaults
for instance attributes, but using mutable values there can lead to
unexpected results.  Descriptors can be used to create instance
variables with different implementation details.

See also:

  **PEP 3115** - Metaclasses in Python 3000
     The proposal that changed the declaration of metaclasses to the
     current syntax, and the semantics for how classes with
     metaclasses are constructed.

  **PEP 3129** - Class Decorators
     The proposal that added class decorators.  Function and method
     decorators were introduced in **PEP 318**.


Coroutines
==========

New in version 3.5.


Coroutine function definition
-----------------------------

   async_funcdef ::= [decorators] "async" "def" funcname "(" [parameter_list] ")"
                     ["->" expression] ":" suite

Execution of Python coroutines can be suspended and resumed at many
points (see *coroutine*).  Inside the body of a coroutine function,
"await" and "async" identifiers become reserved keywords; "await"
expressions, "async for" and "async with" can only be used in
coroutine function bodies.

Functions defined with "async def" syntax are always coroutine
functions, even if they do not contain "await" or "async" keywords.

It is a "SyntaxError" to use a "yield from" expression inside the body
of a coroutine function.

An example of a coroutine function:

   async def func(param1, param2):
       do_stuff()
       await some_coroutine()


The "async for" statement
-------------------------

   async_for_stmt ::= "async" for_stmt

An *asynchronous iterable* is able to call asynchronous code in its
*iter* implementation, and *asynchronous iterator* can call
asynchronous code in its *next* method.

The "async for" statement allows convenient iteration over
asynchronous iterators.

The following code:

   async for TARGET in ITER:
       SUITE
   else:
       SUITE2

Is semantically equivalent to:

   iter = (ITER)
   iter = type(iter).__aiter__(iter)
   running = True

   while running:
       try:
           TARGET = await type(iter).__anext__(iter)
       except StopAsyncIteration:
           running = False
       else:
           SUITE
   else:
       SUITE2

See also "__aiter__()" and "__anext__()" for details.

It is a "SyntaxError" to use an "async for" statement outside the body
of a coroutine function.


The "async with" statement
--------------------------

   async_with_stmt ::= "async" with_stmt

An *asynchronous context manager* is a *context manager* that is able
to suspend execution in its *enter* and *exit* methods.

The following code:

   async with EXPRESSION as TARGET:
       SUITE

is semantically equivalent to:

   manager = (EXPRESSION)
   aexit = type(manager).__aexit__
   aenter = type(manager).__aenter__
   value = await aenter(manager)
   hit_except = False

   try:
       TARGET = value
       SUITE
   except:
       hit_except = True
       if not await aexit(manager, *sys.exc_info()):
           raise
   finally:
       if not hit_except:
           await aexit(manager, None, None, None)

See also "__aenter__()" and "__aexit__()" for details.

It is a "SyntaxError" to use an "async with" statement outside the
body of a coroutine function.

See also:

  **PEP 492** - Coroutines with async and await syntax
     The proposal that made coroutines a proper standalone concept in
     Python, and added supporting syntax.

-[ Footnotes ]-

[1] The exception is propagated to the invocation stack unless there
    is a "finally" clause which happens to raise another exception.
    That new exception causes the old one to be lost.

[2] A string literal appearing as the first statement in the function
    body is transformed into the function’s "__doc__" attribute and
    therefore the function’s *docstring*.

[3] A string literal appearing as the first statement in the class
    body is transformed into the namespace’s "__doc__" item and
    therefore the class’s *docstring*.
u�With Statement Context Managers
*******************************

A *context manager* is an object that defines the runtime context to
be established when executing a "with" statement. The context manager
handles the entry into, and the exit from, the desired runtime context
for the execution of the block of code.  Context managers are normally
invoked using the "with" statement (described in section The with
statement), but can also be used by directly invoking their methods.

Typical uses of context managers include saving and restoring various
kinds of global state, locking and unlocking resources, closing opened
files, etc.

For more information on context managers, see Context Manager Types.

object.__enter__(self)

   Enter the runtime context related to this object. The "with"
   statement will bind this method’s return value to the target(s)
   specified in the "as" clause of the statement, if any.

object.__exit__(self, exc_type, exc_value, traceback)

   Exit the runtime context related to this object. The parameters
   describe the exception that caused the context to be exited. If the
   context was exited without an exception, all three arguments will
   be "None".

   If an exception is supplied, and the method wishes to suppress the
   exception (i.e., prevent it from being propagated), it should
   return a true value. Otherwise, the exception will be processed
   normally upon exit from this method.

   Note that "__exit__()" methods should not reraise the passed-in
   exception; this is the caller’s responsibility.

See also:

  **PEP 343** - The “with” statement
     The specification, background, and examples for the Python "with"
     statement.
a�The "continue" statement
************************

   continue_stmt ::= "continue"

"continue" may only occur syntactically nested in a "for" or "while"
loop, but not nested in a function or class definition within that
loop.  It continues with the next cycle of the nearest enclosing loop.

When "continue" passes control out of a "try" statement with a
"finally" clause, that "finally" clause is executed before really
starting the next loop cycle.
u�Arithmetic conversions
**********************

When a description of an arithmetic operator below uses the phrase
“the numeric arguments are converted to a common type”, this means
that the operator implementation for built-in types works as follows:

* If either argument is a complex number, the other is converted to
  complex;

* otherwise, if either argument is a floating point number, the other
  is converted to floating point;

* otherwise, both must be integers and no conversion is necessary.

Some additional rules apply for certain operators (e.g., a string as a
left argument to the ‘%’ operator).  Extensions must define their own
conversion behavior.
uS5Basic customization
*******************

object.__new__(cls[, ...])

   Called to create a new instance of class *cls*.  "__new__()" is a
   static method (special-cased so you need not declare it as such)
   that takes the class of which an instance was requested as its
   first argument.  The remaining arguments are those passed to the
   object constructor expression (the call to the class).  The return
   value of "__new__()" should be the new object instance (usually an
   instance of *cls*).

   Typical implementations create a new instance of the class by
   invoking the superclass’s "__new__()" method using
   "super().__new__(cls[, ...])" with appropriate arguments and then
   modifying the newly-created instance as necessary before returning
   it.

   If "__new__()" is invoked during object construction and it returns
   an instance of *cls*, then the new instance’s "__init__()" method
   will be invoked like "__init__(self[, ...])", where *self* is the
   new instance and the remaining arguments are the same as were
   passed to the object constructor.

   If "__new__()" does not return an instance of *cls*, then the new
   instance’s "__init__()" method will not be invoked.

   "__new__()" is intended mainly to allow subclasses of immutable
   types (like int, str, or tuple) to customize instance creation.  It
   is also commonly overridden in custom metaclasses in order to
   customize class creation.

object.__init__(self[, ...])

   Called after the instance has been created (by "__new__()"), but
   before it is returned to the caller.  The arguments are those
   passed to the class constructor expression.  If a base class has an
   "__init__()" method, the derived class’s "__init__()" method, if
   any, must explicitly call it to ensure proper initialization of the
   base class part of the instance; for example:
   "super().__init__([args...])".

   Because "__new__()" and "__init__()" work together in constructing
   objects ("__new__()" to create it, and "__init__()" to customize
   it), no non-"None" value may be returned by "__init__()"; doing so
   will cause a "TypeError" to be raised at runtime.

object.__del__(self)

   Called when the instance is about to be destroyed.  This is also
   called a finalizer or (improperly) a destructor.  If a base class
   has a "__del__()" method, the derived class’s "__del__()" method,
   if any, must explicitly call it to ensure proper deletion of the
   base class part of the instance.

   It is possible (though not recommended!) for the "__del__()" method
   to postpone destruction of the instance by creating a new reference
   to it.  This is called object *resurrection*.  It is
   implementation-dependent whether "__del__()" is called a second
   time when a resurrected object is about to be destroyed; the
   current *CPython* implementation only calls it once.

   It is not guaranteed that "__del__()" methods are called for
   objects that still exist when the interpreter exits.

   Note:

     "del x" doesn’t directly call "x.__del__()" — the former
     decrements the reference count for "x" by one, and the latter is
     only called when "x"’s reference count reaches zero.

   **CPython implementation detail:** It is possible for a reference
   cycle to prevent the reference count of an object from going to
   zero.  In this case, the cycle will be later detected and deleted
   by the *cyclic garbage collector*.  A common cause of reference
   cycles is when an exception has been caught in a local variable.
   The frame’s locals then reference the exception, which references
   its own traceback, which references the locals of all frames caught
   in the traceback.

   See also: Documentation for the "gc" module.

   Warning:

     Due to the precarious circumstances under which "__del__()"
     methods are invoked, exceptions that occur during their execution
     are ignored, and a warning is printed to "sys.stderr" instead.
     In particular:

     * "__del__()" can be invoked when arbitrary code is being
       executed, including from any arbitrary thread.  If "__del__()"
       needs to take a lock or invoke any other blocking resource, it
       may deadlock as the resource may already be taken by the code
       that gets interrupted to execute "__del__()".

     * "__del__()" can be executed during interpreter shutdown.  As a
       consequence, the global variables it needs to access (including
       other modules) may already have been deleted or set to "None".
       Python guarantees that globals whose name begins with a single
       underscore are deleted from their module before other globals
       are deleted; if no other references to such globals exist, this
       may help in assuring that imported modules are still available
       at the time when the "__del__()" method is called.

object.__repr__(self)

   Called by the "repr()" built-in function to compute the “official”
   string representation of an object.  If at all possible, this
   should look like a valid Python expression that could be used to
   recreate an object with the same value (given an appropriate
   environment).  If this is not possible, a string of the form
   "<...some useful description...>" should be returned. The return
   value must be a string object. If a class defines "__repr__()" but
   not "__str__()", then "__repr__()" is also used when an “informal”
   string representation of instances of that class is required.

   This is typically used for debugging, so it is important that the
   representation is information-rich and unambiguous.

object.__str__(self)

   Called by "str(object)" and the built-in functions "format()" and
   "print()" to compute the “informal” or nicely printable string
   representation of an object.  The return value must be a string
   object.

   This method differs from "object.__repr__()" in that there is no
   expectation that "__str__()" return a valid Python expression: a
   more convenient or concise representation can be used.

   The default implementation defined by the built-in type "object"
   calls "object.__repr__()".

object.__bytes__(self)

   Called by bytes to compute a byte-string representation of an
   object. This should return a "bytes" object.

object.__format__(self, format_spec)

   Called by the "format()" built-in function, and by extension,
   evaluation of formatted string literals and the "str.format()"
   method, to produce a “formatted” string representation of an
   object. The *format_spec* argument is a string that contains a
   description of the formatting options desired. The interpretation
   of the *format_spec* argument is up to the type implementing
   "__format__()", however most classes will either delegate
   formatting to one of the built-in types, or use a similar
   formatting option syntax.

   See Format Specification Mini-Language for a description of the
   standard formatting syntax.

   The return value must be a string object.

   Changed in version 3.4: The __format__ method of "object" itself
   raises a "TypeError" if passed any non-empty string.

   Changed in version 3.7: "object.__format__(x, '')" is now
   equivalent to "str(x)" rather than "format(str(self), '')".

object.__lt__(self, other)
object.__le__(self, other)
object.__eq__(self, other)
object.__ne__(self, other)
object.__gt__(self, other)
object.__ge__(self, other)

   These are the so-called “rich comparison” methods. The
   correspondence between operator symbols and method names is as
   follows: "x<y" calls "x.__lt__(y)", "x<=y" calls "x.__le__(y)",
   "x==y" calls "x.__eq__(y)", "x!=y" calls "x.__ne__(y)", "x>y" calls
   "x.__gt__(y)", and "x>=y" calls "x.__ge__(y)".

   A rich comparison method may return the singleton "NotImplemented"
   if it does not implement the operation for a given pair of
   arguments. By convention, "False" and "True" are returned for a
   successful comparison. However, these methods can return any value,
   so if the comparison operator is used in a Boolean context (e.g.,
   in the condition of an "if" statement), Python will call "bool()"
   on the value to determine if the result is true or false.

   By default, "object" implements "__eq__()" by using "is", returning
   "NotImplemented" in the case of a false comparison: "True if x is y
   else NotImplemented". For "__ne__()", by default it delegates to
   "__eq__()" and inverts the result unless it is "NotImplemented".
   There are no other implied relationships among the comparison
   operators or default implementations; for example, the truth of
   "(x<y or x==y)" does not imply "x<=y". To automatically generate
   ordering operations from a single root operation, see
   "functools.total_ordering()".

   See the paragraph on "__hash__()" for some important notes on
   creating *hashable* objects which support custom comparison
   operations and are usable as dictionary keys.

   There are no swapped-argument versions of these methods (to be used
   when the left argument does not support the operation but the right
   argument does); rather, "__lt__()" and "__gt__()" are each other’s
   reflection, "__le__()" and "__ge__()" are each other’s reflection,
   and "__eq__()" and "__ne__()" are their own reflection. If the
   operands are of different types, and right operand’s type is a
   direct or indirect subclass of the left operand’s type, the
   reflected method of the right operand has priority, otherwise the
   left operand’s method has priority.  Virtual subclassing is not
   considered.

object.__hash__(self)

   Called by built-in function "hash()" and for operations on members
   of hashed collections including "set", "frozenset", and "dict".
   "__hash__()" should return an integer. The only required property
   is that objects which compare equal have the same hash value; it is
   advised to mix together the hash values of the components of the
   object that also play a part in comparison of objects by packing
   them into a tuple and hashing the tuple. Example:

      def __hash__(self):
          return hash((self.name, self.nick, self.color))

   Note:

     "hash()" truncates the value returned from an object’s custom
     "__hash__()" method to the size of a "Py_ssize_t".  This is
     typically 8 bytes on 64-bit builds and 4 bytes on 32-bit builds.
     If an object’s   "__hash__()" must interoperate on builds of
     different bit sizes, be sure to check the width on all supported
     builds.  An easy way to do this is with "python -c "import sys;
     print(sys.hash_info.width)"".

   If a class does not define an "__eq__()" method it should not
   define a "__hash__()" operation either; if it defines "__eq__()"
   but not "__hash__()", its instances will not be usable as items in
   hashable collections.  If a class defines mutable objects and
   implements an "__eq__()" method, it should not implement
   "__hash__()", since the implementation of hashable collections
   requires that a key’s hash value is immutable (if the object’s hash
   value changes, it will be in the wrong hash bucket).

   User-defined classes have "__eq__()" and "__hash__()" methods by
   default; with them, all objects compare unequal (except with
   themselves) and "x.__hash__()" returns an appropriate value such
   that "x == y" implies both that "x is y" and "hash(x) == hash(y)".

   A class that overrides "__eq__()" and does not define "__hash__()"
   will have its "__hash__()" implicitly set to "None".  When the
   "__hash__()" method of a class is "None", instances of the class
   will raise an appropriate "TypeError" when a program attempts to
   retrieve their hash value, and will also be correctly identified as
   unhashable when checking "isinstance(obj,
   collections.abc.Hashable)".

   If a class that overrides "__eq__()" needs to retain the
   implementation of "__hash__()" from a parent class, the interpreter
   must be told this explicitly by setting "__hash__ =
   <ParentClass>.__hash__".

   If a class that does not override "__eq__()" wishes to suppress
   hash support, it should include "__hash__ = None" in the class
   definition. A class which defines its own "__hash__()" that
   explicitly raises a "TypeError" would be incorrectly identified as
   hashable by an "isinstance(obj, collections.abc.Hashable)" call.

   Note:

     By default, the "__hash__()" values of str and bytes objects are
     “salted” with an unpredictable random value.  Although they
     remain constant within an individual Python process, they are not
     predictable between repeated invocations of Python.This is
     intended to provide protection against a denial-of-service caused
     by carefully-chosen inputs that exploit the worst case
     performance of a dict insertion, O(n^2) complexity.  See
     http://www.ocert.org/advisories/ocert-2011-003.html for
     details.Changing hash values affects the iteration order of sets.
     Python has never made guarantees about this ordering (and it
     typically varies between 32-bit and 64-bit builds).See also
     "PYTHONHASHSEED".

   Changed in version 3.3: Hash randomization is enabled by default.

object.__bool__(self)

   Called to implement truth value testing and the built-in operation
   "bool()"; should return "False" or "True".  When this method is not
   defined, "__len__()" is called, if it is defined, and the object is
   considered true if its result is nonzero.  If a class defines
   neither "__len__()" nor "__bool__()", all its instances are
   considered true.
u�I"pdb" — The Python Debugger
***************************

**Source code:** Lib/pdb.py

======================================================================

The module "pdb" defines an interactive source code debugger for
Python programs.  It supports setting (conditional) breakpoints and
single stepping at the source line level, inspection of stack frames,
source code listing, and evaluation of arbitrary Python code in the
context of any stack frame.  It also supports post-mortem debugging
and can be called under program control.

The debugger is extensible – it is actually defined as the class
"Pdb". This is currently undocumented but easily understood by reading
the source.  The extension interface uses the modules "bdb" and "cmd".

The debugger’s prompt is "(Pdb)". Typical usage to run a program under
control of the debugger is:

   >>> import pdb
   >>> import mymodule
   >>> pdb.run('mymodule.test()')
   > <string>(0)?()
   (Pdb) continue
   > <string>(1)?()
   (Pdb) continue
   NameError: 'spam'
   > <string>(1)?()
   (Pdb)

Changed in version 3.3: Tab-completion via the "readline" module is
available for commands and command arguments, e.g. the current global
and local names are offered as arguments of the "p" command.

"pdb.py" can also be invoked as a script to debug other scripts.  For
example:

   python3 -m pdb myscript.py

When invoked as a script, pdb will automatically enter post-mortem
debugging if the program being debugged exits abnormally.  After post-
mortem debugging (or after normal exit of the program), pdb will
restart the program.  Automatic restarting preserves pdb’s state (such
as breakpoints) and in most cases is more useful than quitting the
debugger upon program’s exit.

New in version 3.2: "pdb.py" now accepts a "-c" option that executes
commands as if given in a ".pdbrc" file, see Debugger Commands.

New in version 3.7: "pdb.py" now accepts a "-m" option that execute
modules similar to the way "python3 -m" does. As with a script, the
debugger will pause execution just before the first line of the
module.

The typical usage to break into the debugger from a running program is
to insert

   import pdb; pdb.set_trace()

at the location you want to break into the debugger.  You can then
step through the code following this statement, and continue running
without the debugger using the "continue" command.

New in version 3.7: The built-in "breakpoint()", when called with
defaults, can be used instead of "import pdb; pdb.set_trace()".

The typical usage to inspect a crashed program is:

   >>> import pdb
   >>> import mymodule
   >>> mymodule.test()
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
     File "./mymodule.py", line 4, in test
       test2()
     File "./mymodule.py", line 3, in test2
       print(spam)
   NameError: spam
   >>> pdb.pm()
   > ./mymodule.py(3)test2()
   -> print(spam)
   (Pdb)

The module defines the following functions; each enters the debugger
in a slightly different way:

pdb.run(statement, globals=None, locals=None)

   Execute the *statement* (given as a string or a code object) under
   debugger control.  The debugger prompt appears before any code is
   executed; you can set breakpoints and type "continue", or you can
   step through the statement using "step" or "next" (all these
   commands are explained below).  The optional *globals* and *locals*
   arguments specify the environment in which the code is executed; by
   default the dictionary of the module "__main__" is used.  (See the
   explanation of the built-in "exec()" or "eval()" functions.)

pdb.runeval(expression, globals=None, locals=None)

   Evaluate the *expression* (given as a string or a code object)
   under debugger control.  When "runeval()" returns, it returns the
   value of the expression.  Otherwise this function is similar to
   "run()".

pdb.runcall(function, *args, **kwds)

   Call the *function* (a function or method object, not a string)
   with the given arguments.  When "runcall()" returns, it returns
   whatever the function call returned.  The debugger prompt appears
   as soon as the function is entered.

pdb.set_trace(*, header=None)

   Enter the debugger at the calling stack frame.  This is useful to
   hard-code a breakpoint at a given point in a program, even if the
   code is not otherwise being debugged (e.g. when an assertion
   fails).  If given, *header* is printed to the console just before
   debugging begins.

   Changed in version 3.7: The keyword-only argument *header*.

pdb.post_mortem(traceback=None)

   Enter post-mortem debugging of the given *traceback* object.  If no
   *traceback* is given, it uses the one of the exception that is
   currently being handled (an exception must be being handled if the
   default is to be used).

pdb.pm()

   Enter post-mortem debugging of the traceback found in
   "sys.last_traceback".

The "run*" functions and "set_trace()" are aliases for instantiating
the "Pdb" class and calling the method of the same name.  If you want
to access further features, you have to do this yourself:

class pdb.Pdb(completekey='tab', stdin=None, stdout=None, skip=None, nosigint=False, readrc=True)

   "Pdb" is the debugger class.

   The *completekey*, *stdin* and *stdout* arguments are passed to the
   underlying "cmd.Cmd" class; see the description there.

   The *skip* argument, if given, must be an iterable of glob-style
   module name patterns.  The debugger will not step into frames that
   originate in a module that matches one of these patterns. [1]

   By default, Pdb sets a handler for the SIGINT signal (which is sent
   when the user presses "Ctrl-C" on the console) when you give a
   "continue" command. This allows you to break into the debugger
   again by pressing "Ctrl-C".  If you want Pdb not to touch the
   SIGINT handler, set *nosigint* to true.

   The *readrc* argument defaults to true and controls whether Pdb
   will load .pdbrc files from the filesystem.

   Example call to enable tracing with *skip*:

      import pdb; pdb.Pdb(skip=['django.*']).set_trace()

   Raises an auditing event "pdb.Pdb" with no arguments.

   New in version 3.1: The *skip* argument.

   New in version 3.2: The *nosigint* argument.  Previously, a SIGINT
   handler was never set by Pdb.

   Changed in version 3.6: The *readrc* argument.

   run(statement, globals=None, locals=None)
   runeval(expression, globals=None, locals=None)
   runcall(function, *args, **kwds)
   set_trace()

      See the documentation for the functions explained above.


Debugger Commands
=================

The commands recognized by the debugger are listed below.  Most
commands can be abbreviated to one or two letters as indicated; e.g.
"h(elp)" means that either "h" or "help" can be used to enter the help
command (but not "he" or "hel", nor "H" or "Help" or "HELP").
Arguments to commands must be separated by whitespace (spaces or
tabs).  Optional arguments are enclosed in square brackets ("[]") in
the command syntax; the square brackets must not be typed.
Alternatives in the command syntax are separated by a vertical bar
("|").

Entering a blank line repeats the last command entered.  Exception: if
the last command was a "list" command, the next 11 lines are listed.

Commands that the debugger doesn’t recognize are assumed to be Python
statements and are executed in the context of the program being
debugged.  Python statements can also be prefixed with an exclamation
point ("!").  This is a powerful way to inspect the program being
debugged; it is even possible to change a variable or call a function.
When an exception occurs in such a statement, the exception name is
printed but the debugger’s state is not changed.

The debugger supports aliases.  Aliases can have parameters which
allows one a certain level of adaptability to the context under
examination.

Multiple commands may be entered on a single line, separated by ";;".
(A single ";" is not used as it is the separator for multiple commands
in a line that is passed to the Python parser.)  No intelligence is
applied to separating the commands; the input is split at the first
";;" pair, even if it is in the middle of a quoted string.

If a file ".pdbrc" exists in the user’s home directory or in the
current directory, it is read in and executed as if it had been typed
at the debugger prompt.  This is particularly useful for aliases.  If
both files exist, the one in the home directory is read first and
aliases defined there can be overridden by the local file.

Changed in version 3.2: ".pdbrc" can now contain commands that
continue debugging, such as "continue" or "next".  Previously, these
commands had no effect.

h(elp) [command]

   Without argument, print the list of available commands.  With a
   *command* as argument, print help about that command.  "help pdb"
   displays the full documentation (the docstring of the "pdb"
   module).  Since the *command* argument must be an identifier, "help
   exec" must be entered to get help on the "!" command.

w(here)

   Print a stack trace, with the most recent frame at the bottom.  An
   arrow indicates the current frame, which determines the context of
   most commands.

d(own) [count]

   Move the current frame *count* (default one) levels down in the
   stack trace (to a newer frame).

u(p) [count]

   Move the current frame *count* (default one) levels up in the stack
   trace (to an older frame).

b(reak) [([filename:]lineno | function) [, condition]]

   With a *lineno* argument, set a break there in the current file.
   With a *function* argument, set a break at the first executable
   statement within that function.  The line number may be prefixed
   with a filename and a colon, to specify a breakpoint in another
   file (probably one that hasn’t been loaded yet).  The file is
   searched on "sys.path".  Note that each breakpoint is assigned a
   number to which all the other breakpoint commands refer.

   If a second argument is present, it is an expression which must
   evaluate to true before the breakpoint is honored.

   Without argument, list all breaks, including for each breakpoint,
   the number of times that breakpoint has been hit, the current
   ignore count, and the associated condition if any.

tbreak [([filename:]lineno | function) [, condition]]

   Temporary breakpoint, which is removed automatically when it is
   first hit. The arguments are the same as for "break".

cl(ear) [filename:lineno | bpnumber [bpnumber ...]]

   With a *filename:lineno* argument, clear all the breakpoints at
   this line. With a space separated list of breakpoint numbers, clear
   those breakpoints. Without argument, clear all breaks (but first
   ask confirmation).

disable [bpnumber [bpnumber ...]]

   Disable the breakpoints given as a space separated list of
   breakpoint numbers.  Disabling a breakpoint means it cannot cause
   the program to stop execution, but unlike clearing a breakpoint, it
   remains in the list of breakpoints and can be (re-)enabled.

enable [bpnumber [bpnumber ...]]

   Enable the breakpoints specified.

ignore bpnumber [count]

   Set the ignore count for the given breakpoint number.  If count is
   omitted, the ignore count is set to 0.  A breakpoint becomes active
   when the ignore count is zero.  When non-zero, the count is
   decremented each time the breakpoint is reached and the breakpoint
   is not disabled and any associated condition evaluates to true.

condition bpnumber [condition]

   Set a new *condition* for the breakpoint, an expression which must
   evaluate to true before the breakpoint is honored.  If *condition*
   is absent, any existing condition is removed; i.e., the breakpoint
   is made unconditional.

commands [bpnumber]

   Specify a list of commands for breakpoint number *bpnumber*.  The
   commands themselves appear on the following lines.  Type a line
   containing just "end" to terminate the commands. An example:

      (Pdb) commands 1
      (com) p some_variable
      (com) end
      (Pdb)

   To remove all commands from a breakpoint, type "commands" and
   follow it immediately with "end"; that is, give no commands.

   With no *bpnumber* argument, "commands" refers to the last
   breakpoint set.

   You can use breakpoint commands to start your program up again.
   Simply use the "continue" command, or "step", or any other command
   that resumes execution.

   Specifying any command resuming execution (currently "continue",
   "step", "next", "return", "jump", "quit" and their abbreviations)
   terminates the command list (as if that command was immediately
   followed by end). This is because any time you resume execution
   (even with a simple next or step), you may encounter another
   breakpoint—which could have its own command list, leading to
   ambiguities about which list to execute.

   If you use the ‘silent’ command in the command list, the usual
   message about stopping at a breakpoint is not printed.  This may be
   desirable for breakpoints that are to print a specific message and
   then continue.  If none of the other commands print anything, you
   see no sign that the breakpoint was reached.

s(tep)

   Execute the current line, stop at the first possible occasion
   (either in a function that is called or on the next line in the
   current function).

n(ext)

   Continue execution until the next line in the current function is
   reached or it returns.  (The difference between "next" and "step"
   is that "step" stops inside a called function, while "next"
   executes called functions at (nearly) full speed, only stopping at
   the next line in the current function.)

unt(il) [lineno]

   Without argument, continue execution until the line with a number
   greater than the current one is reached.

   With a line number, continue execution until a line with a number
   greater or equal to that is reached.  In both cases, also stop when
   the current frame returns.

   Changed in version 3.2: Allow giving an explicit line number.

r(eturn)

   Continue execution until the current function returns.

c(ont(inue))

   Continue execution, only stop when a breakpoint is encountered.

j(ump) lineno

   Set the next line that will be executed.  Only available in the
   bottom-most frame.  This lets you jump back and execute code again,
   or jump forward to skip code that you don’t want to run.

   It should be noted that not all jumps are allowed – for instance it
   is not possible to jump into the middle of a "for" loop or out of a
   "finally" clause.

l(ist) [first[, last]]

   List source code for the current file.  Without arguments, list 11
   lines around the current line or continue the previous listing.
   With "." as argument, list 11 lines around the current line.  With
   one argument, list 11 lines around at that line.  With two
   arguments, list the given range; if the second argument is less
   than the first, it is interpreted as a count.

   The current line in the current frame is indicated by "->".  If an
   exception is being debugged, the line where the exception was
   originally raised or propagated is indicated by ">>", if it differs
   from the current line.

   New in version 3.2: The ">>" marker.

ll | longlist

   List all source code for the current function or frame.
   Interesting lines are marked as for "list".

   New in version 3.2.

a(rgs)

   Print the argument list of the current function.

p expression

   Evaluate the *expression* in the current context and print its
   value.

   Note:

     "print()" can also be used, but is not a debugger command — this
     executes the Python "print()" function.

pp expression

   Like the "p" command, except the value of the expression is pretty-
   printed using the "pprint" module.

whatis expression

   Print the type of the *expression*.

source expression

   Try to get source code for the given object and display it.

   New in version 3.2.

display [expression]

   Display the value of the expression if it changed, each time
   execution stops in the current frame.

   Without expression, list all display expressions for the current
   frame.

   New in version 3.2.

undisplay [expression]

   Do not display the expression any more in the current frame.
   Without expression, clear all display expressions for the current
   frame.

   New in version 3.2.

interact

   Start an interactive interpreter (using the "code" module) whose
   global namespace contains all the (global and local) names found in
   the current scope.

   New in version 3.2.

alias [name [command]]

   Create an alias called *name* that executes *command*.  The command
   must *not* be enclosed in quotes.  Replaceable parameters can be
   indicated by "%1", "%2", and so on, while "%*" is replaced by all
   the parameters. If no command is given, the current alias for
   *name* is shown. If no arguments are given, all aliases are listed.

   Aliases may be nested and can contain anything that can be legally
   typed at the pdb prompt.  Note that internal pdb commands *can* be
   overridden by aliases.  Such a command is then hidden until the
   alias is removed.  Aliasing is recursively applied to the first
   word of the command line; all other words in the line are left
   alone.

   As an example, here are two useful aliases (especially when placed
   in the ".pdbrc" file):

      # Print instance variables (usage "pi classInst")
      alias pi for k in %1.__dict__.keys(): print("%1.",k,"=",%1.__dict__[k])
      # Print instance variables in self
      alias ps pi self

unalias name

   Delete the specified alias.

! statement

   Execute the (one-line) *statement* in the context of the current
   stack frame. The exclamation point can be omitted unless the first
   word of the statement resembles a debugger command.  To set a
   global variable, you can prefix the assignment command with a
   "global" statement on the same line, e.g.:

      (Pdb) global list_options; list_options = ['-l']
      (Pdb)

run [args ...]
restart [args ...]

   Restart the debugged Python program.  If an argument is supplied,
   it is split with "shlex" and the result is used as the new
   "sys.argv". History, breakpoints, actions and debugger options are
   preserved. "restart" is an alias for "run".

q(uit)

   Quit from the debugger.  The program being executed is aborted.

debug code

   Enter a recursive debugger that steps through the code argument
   (which is an arbitrary expression or statement to be executed in
   the current environment).

retval

   Print the return value for the last return of a function.

-[ Footnotes ]-

[1] Whether a frame is considered to originate in a certain module is
    determined by the "__name__" in the frame globals.
a�The "del" statement
*******************

   del_stmt ::= "del" target_list

Deletion is recursively defined very similar to the way assignment is
defined. Rather than spelling it out in full details, here are some
hints.

Deletion of a target list recursively deletes each target, from left
to right.

Deletion of a name removes the binding of that name from the local or
global namespace, depending on whether the name occurs in a "global"
statement in the same code block.  If the name is unbound, a
"NameError" exception will be raised.

Deletion of attribute references, subscriptions and slicings is passed
to the primary object involved; deletion of a slicing is in general
equivalent to assignment of an empty slice of the right type (but even
this is determined by the sliced object).

Changed in version 3.2: Previously it was illegal to delete a name
from the local namespace if it occurs as a free variable in a nested
block.
uDictionary displays
*******************

A dictionary display is a possibly empty series of key/datum pairs
enclosed in curly braces:

   dict_display       ::= "{" [key_datum_list | dict_comprehension] "}"
   key_datum_list     ::= key_datum ("," key_datum)* [","]
   key_datum          ::= expression ":" expression | "**" or_expr
   dict_comprehension ::= expression ":" expression comp_for

A dictionary display yields a new dictionary object.

If a comma-separated sequence of key/datum pairs is given, they are
evaluated from left to right to define the entries of the dictionary:
each key object is used as a key into the dictionary to store the
corresponding datum.  This means that you can specify the same key
multiple times in the key/datum list, and the final dictionary’s value
for that key will be the last one given.

A double asterisk "**" denotes *dictionary unpacking*. Its operand
must be a *mapping*.  Each mapping item is added to the new
dictionary.  Later values replace values already set by earlier
key/datum pairs and earlier dictionary unpackings.

New in version 3.5: Unpacking into dictionary displays, originally
proposed by **PEP 448**.

A dict comprehension, in contrast to list and set comprehensions,
needs two expressions separated with a colon followed by the usual
“for” and “if” clauses. When the comprehension is run, the resulting
key and value elements are inserted in the new dictionary in the order
they are produced.

Restrictions on the types of the key values are listed earlier in
section The standard type hierarchy.  (To summarize, the key type
should be *hashable*, which excludes all mutable objects.)  Clashes
between duplicate keys are not detected; the last datum (textually
rightmost in the display) stored for a given key value prevails.

Changed in version 3.8: Prior to Python 3.8, in dict comprehensions,
the evaluation order of key and value was not well-defined.  In
CPython, the value was evaluated before the key.  Starting with 3.8,
the key is evaluated before the value, as proposed by **PEP 572**.
a�Interaction with dynamic features
*********************************

Name resolution of free variables occurs at runtime, not at compile
time. This means that the following code will print 42:

   i = 10
   def f():
       print(i)
   i = 42
   f()

The "eval()" and "exec()" functions do not have access to the full
environment for resolving names.  Names may be resolved in the local
and global namespaces of the caller.  Free variables are not resolved
in the nearest enclosing namespace, but in the global namespace.  [1]
The "exec()" and "eval()" functions have optional arguments to
override the global and local namespace.  If only one namespace is
specified, it is used for both.
aXThe "if" statement
******************

The "if" statement is used for conditional execution:

   if_stmt ::= "if" assignment_expression ":" suite
               ("elif" assignment_expression ":" suite)*
               ["else" ":" suite]

It selects exactly one of the suites by evaluating the expressions one
by one until one is found to be true (see section Boolean operations
for the definition of true and false); then that suite is executed
(and no other part of the "if" statement is executed or evaluated).
If all expressions are false, the suite of the "else" clause, if
present, is executed.
u�Exceptions
**********

Exceptions are a means of breaking out of the normal flow of control
of a code block in order to handle errors or other exceptional
conditions.  An exception is *raised* at the point where the error is
detected; it may be *handled* by the surrounding code block or by any
code block that directly or indirectly invoked the code block where
the error occurred.

The Python interpreter raises an exception when it detects a run-time
error (such as division by zero).  A Python program can also
explicitly raise an exception with the "raise" statement. Exception
handlers are specified with the "try" … "except" statement.  The
"finally" clause of such a statement can be used to specify cleanup
code which does not handle the exception, but is executed whether an
exception occurred or not in the preceding code.

Python uses the “termination” model of error handling: an exception
handler can find out what happened and continue execution at an outer
level, but it cannot repair the cause of the error and retry the
failing operation (except by re-entering the offending piece of code
from the top).

When an exception is not handled at all, the interpreter terminates
execution of the program, or returns to its interactive main loop.  In
either case, it prints a stack traceback, except when the exception is
"SystemExit".

Exceptions are identified by class instances.  The "except" clause is
selected depending on the class of the instance: it must reference the
class of the instance or a base class thereof.  The instance can be
received by the handler and can carry additional information about the
exceptional condition.

Note:

  Exception messages are not part of the Python API.  Their contents
  may change from one version of Python to the next without warning
  and should not be relied on by code which will run under multiple
  versions of the interpreter.

See also the description of the "try" statement in section The try
statement and "raise" statement in section The raise statement.

-[ Footnotes ]-

[1] This limitation occurs because the code that is executed by these
    operations is not available at the time the module is compiled.
u$Execution model
***************


Structure of a program
======================

A Python program is constructed from code blocks. A *block* is a piece
of Python program text that is executed as a unit. The following are
blocks: a module, a function body, and a class definition. Each
command typed interactively is a block.  A script file (a file given
as standard input to the interpreter or specified as a command line
argument to the interpreter) is a code block.  A script command (a
command specified on the interpreter command line with the "-c"
option) is a code block.  The string argument passed to the built-in
functions "eval()" and "exec()" is a code block.

A code block is executed in an *execution frame*.  A frame contains
some administrative information (used for debugging) and determines
where and how execution continues after the code block’s execution has
completed.


Naming and binding
==================


Binding of names
----------------

*Names* refer to objects.  Names are introduced by name binding
operations.

The following constructs bind names: formal parameters to functions,
"import" statements, class and function definitions (these bind the
class or function name in the defining block), and targets that are
identifiers if occurring in an assignment, "for" loop header, or after
"as" in a "with" statement or "except" clause. The "import" statement
of the form "from ... import *" binds all names defined in the
imported module, except those beginning with an underscore.  This form
may only be used at the module level.

A target occurring in a "del" statement is also considered bound for
this purpose (though the actual semantics are to unbind the name).

Each assignment or import statement occurs within a block defined by a
class or function definition or at the module level (the top-level
code block).

If a name is bound in a block, it is a local variable of that block,
unless declared as "nonlocal" or "global".  If a name is bound at the
module level, it is a global variable.  (The variables of the module
code block are local and global.)  If a variable is used in a code
block but not defined there, it is a *free variable*.

Each occurrence of a name in the program text refers to the *binding*
of that name established by the following name resolution rules.


Resolution of names
-------------------

A *scope* defines the visibility of a name within a block.  If a local
variable is defined in a block, its scope includes that block.  If the
definition occurs in a function block, the scope extends to any blocks
contained within the defining one, unless a contained block introduces
a different binding for the name.

When a name is used in a code block, it is resolved using the nearest
enclosing scope.  The set of all such scopes visible to a code block
is called the block’s *environment*.

When a name is not found at all, a "NameError" exception is raised. If
the current scope is a function scope, and the name refers to a local
variable that has not yet been bound to a value at the point where the
name is used, an "UnboundLocalError" exception is raised.
"UnboundLocalError" is a subclass of "NameError".

If a name binding operation occurs anywhere within a code block, all
uses of the name within the block are treated as references to the
current block.  This can lead to errors when a name is used within a
block before it is bound.  This rule is subtle.  Python lacks
declarations and allows name binding operations to occur anywhere
within a code block.  The local variables of a code block can be
determined by scanning the entire text of the block for name binding
operations.

If the "global" statement occurs within a block, all uses of the name
specified in the statement refer to the binding of that name in the
top-level namespace.  Names are resolved in the top-level namespace by
searching the global namespace, i.e. the namespace of the module
containing the code block, and the builtins namespace, the namespace
of the module "builtins".  The global namespace is searched first.  If
the name is not found there, the builtins namespace is searched.  The
"global" statement must precede all uses of the name.

The "global" statement has the same scope as a name binding operation
in the same block.  If the nearest enclosing scope for a free variable
contains a global statement, the free variable is treated as a global.

The "nonlocal" statement causes corresponding names to refer to
previously bound variables in the nearest enclosing function scope.
"SyntaxError" is raised at compile time if the given name does not
exist in any enclosing function scope.

The namespace for a module is automatically created the first time a
module is imported.  The main module for a script is always called
"__main__".

Class definition blocks and arguments to "exec()" and "eval()" are
special in the context of name resolution. A class definition is an
executable statement that may use and define names. These references
follow the normal rules for name resolution with an exception that
unbound local variables are looked up in the global namespace. The
namespace of the class definition becomes the attribute dictionary of
the class. The scope of names defined in a class block is limited to
the class block; it does not extend to the code blocks of methods –
this includes comprehensions and generator expressions since they are
implemented using a function scope.  This means that the following
will fail:

   class A:
       a = 42
       b = list(a + i for i in range(10))


Builtins and restricted execution
---------------------------------

**CPython implementation detail:** Users should not touch
"__builtins__"; it is strictly an implementation detail.  Users
wanting to override values in the builtins namespace should "import"
the "builtins" module and modify its attributes appropriately.

The builtins namespace associated with the execution of a code block
is actually found by looking up the name "__builtins__" in its global
namespace; this should be a dictionary or a module (in the latter case
the module’s dictionary is used).  By default, when in the "__main__"
module, "__builtins__" is the built-in module "builtins"; when in any
other module, "__builtins__" is an alias for the dictionary of the
"builtins" module itself.


Interaction with dynamic features
---------------------------------

Name resolution of free variables occurs at runtime, not at compile
time. This means that the following code will print 42:

   i = 10
   def f():
       print(i)
   i = 42
   f()

The "eval()" and "exec()" functions do not have access to the full
environment for resolving names.  Names may be resolved in the local
and global namespaces of the caller.  Free variables are not resolved
in the nearest enclosing namespace, but in the global namespace.  [1]
The "exec()" and "eval()" functions have optional arguments to
override the global and local namespace.  If only one namespace is
specified, it is used for both.


Exceptions
==========

Exceptions are a means of breaking out of the normal flow of control
of a code block in order to handle errors or other exceptional
conditions.  An exception is *raised* at the point where the error is
detected; it may be *handled* by the surrounding code block or by any
code block that directly or indirectly invoked the code block where
the error occurred.

The Python interpreter raises an exception when it detects a run-time
error (such as division by zero).  A Python program can also
explicitly raise an exception with the "raise" statement. Exception
handlers are specified with the "try" … "except" statement.  The
"finally" clause of such a statement can be used to specify cleanup
code which does not handle the exception, but is executed whether an
exception occurred or not in the preceding code.

Python uses the “termination” model of error handling: an exception
handler can find out what happened and continue execution at an outer
level, but it cannot repair the cause of the error and retry the
failing operation (except by re-entering the offending piece of code
from the top).

When an exception is not handled at all, the interpreter terminates
execution of the program, or returns to its interactive main loop.  In
either case, it prints a stack traceback, except when the exception is
"SystemExit".

Exceptions are identified by class instances.  The "except" clause is
selected depending on the class of the instance: it must reference the
class of the instance or a base class thereof.  The instance can be
received by the handler and can carry additional information about the
exceptional condition.

Note:

  Exception messages are not part of the Python API.  Their contents
  may change from one version of Python to the next without warning
  and should not be relied on by code which will run under multiple
  versions of the interpreter.

See also the description of the "try" statement in section The try
statement and "raise" statement in section The raise statement.

-[ Footnotes ]-

[1] This limitation occurs because the code that is executed by these
    operations is not available at the time the module is compiled.
uzExpression lists
****************

   expression_list    ::= expression ("," expression)* [","]
   starred_list       ::= starred_item ("," starred_item)* [","]
   starred_expression ::= expression | (starred_item ",")* [starred_item]
   starred_item       ::= assignment_expression | "*" or_expr

Except when part of a list or set display, an expression list
containing at least one comma yields a tuple.  The length of the tuple
is the number of expressions in the list.  The expressions are
evaluated from left to right.

An asterisk "*" denotes *iterable unpacking*.  Its operand must be an
*iterable*.  The iterable is expanded into a sequence of items, which
are included in the new tuple, list, or set, at the site of the
unpacking.

New in version 3.5: Iterable unpacking in expression lists, originally
proposed by **PEP 448**.

The trailing comma is required only to create a single tuple (a.k.a. a
*singleton*); it is optional in all other cases.  A single expression
without a trailing comma doesn’t create a tuple, but rather yields the
value of that expression. (To create an empty tuple, use an empty pair
of parentheses: "()".)
a�Floating point literals
***********************

Floating point literals are described by the following lexical
definitions:

   floatnumber   ::= pointfloat | exponentfloat
   pointfloat    ::= [digitpart] fraction | digitpart "."
   exponentfloat ::= (digitpart | pointfloat) exponent
   digitpart     ::= digit (["_"] digit)*
   fraction      ::= "." digitpart
   exponent      ::= ("e" | "E") ["+" | "-"] digitpart

Note that the integer and exponent parts are always interpreted using
radix 10. For example, "077e010" is legal, and denotes the same number
as "77e10". The allowed range of floating point literals is
implementation-dependent.  As in integer literals, underscores are
supported for digit grouping.

Some examples of floating point literals:

   3.14    10.    .001    1e100    3.14e-10    0e0    3.14_15_93

Changed in version 3.6: Underscores are now allowed for grouping
purposes in literals.
u�
The "for" statement
*******************

The "for" statement is used to iterate over the elements of a sequence
(such as a string, tuple or list) or other iterable object:

   for_stmt ::= "for" target_list "in" expression_list ":" suite
                ["else" ":" suite]

The expression list is evaluated once; it should yield an iterable
object.  An iterator is created for the result of the
"expression_list".  The suite is then executed once for each item
provided by the iterator, in the order returned by the iterator.  Each
item in turn is assigned to the target list using the standard rules
for assignments (see Assignment statements), and then the suite is
executed.  When the items are exhausted (which is immediately when the
sequence is empty or an iterator raises a "StopIteration" exception),
the suite in the "else" clause, if present, is executed, and the loop
terminates.

A "break" statement executed in the first suite terminates the loop
without executing the "else" clause’s suite.  A "continue" statement
executed in the first suite skips the rest of the suite and continues
with the next item, or with the "else" clause if there is no next
item.

The for-loop makes assignments to the variables in the target list.
This overwrites all previous assignments to those variables including
those made in the suite of the for-loop:

   for i in range(10):
       print(i)
       i = 5             # this will not affect the for-loop
                         # because i will be overwritten with the next
                         # index in the range

Names in the target list are not deleted when the loop is finished,
but if the sequence is empty, they will not have been assigned to at
all by the loop.  Hint: the built-in function "range()" returns an
iterator of integers suitable to emulate the effect of Pascal’s "for i
:= a to b do"; e.g., "list(range(3))" returns the list "[0, 1, 2]".

Note:

  There is a subtlety when the sequence is being modified by the loop
  (this can only occur for mutable sequences, e.g. lists).  An
  internal counter is used to keep track of which item is used next,
  and this is incremented on each iteration.  When this counter has
  reached the length of the sequence the loop terminates.  This means
  that if the suite deletes the current (or a previous) item from the
  sequence, the next item will be skipped (since it gets the index of
  the current item which has already been treated).  Likewise, if the
  suite inserts an item in the sequence before the current item, the
  current item will be treated again the next time through the loop.
  This can lead to nasty bugs that can be avoided by making a
  temporary copy using a slice of the whole sequence, e.g.,

     for x in a[:]:
         if x < 0: a.remove(x)
u�`Format String Syntax
********************

The "str.format()" method and the "Formatter" class share the same
syntax for format strings (although in the case of "Formatter",
subclasses can define their own format string syntax).  The syntax is
related to that of formatted string literals, but it is less
sophisticated and, in particular, does not support arbitrary
expressions.

Format strings contain “replacement fields” surrounded by curly braces
"{}". Anything that is not contained in braces is considered literal
text, which is copied unchanged to the output.  If you need to include
a brace character in the literal text, it can be escaped by doubling:
"{{" and "}}".

The grammar for a replacement field is as follows:

      replacement_field ::= "{" [field_name] ["!" conversion] [":" format_spec] "}"
      field_name        ::= arg_name ("." attribute_name | "[" element_index "]")*
      arg_name          ::= [identifier | digit+]
      attribute_name    ::= identifier
      element_index     ::= digit+ | index_string
      index_string      ::= <any source character except "]"> +
      conversion        ::= "r" | "s" | "a"
      format_spec       ::= <described in the next section>

In less formal terms, the replacement field can start with a
*field_name* that specifies the object whose value is to be formatted
and inserted into the output instead of the replacement field. The
*field_name* is optionally followed by a  *conversion* field, which is
preceded by an exclamation point "'!'", and a *format_spec*, which is
preceded by a colon "':'".  These specify a non-default format for the
replacement value.

See also the Format Specification Mini-Language section.

The *field_name* itself begins with an *arg_name* that is either a
number or a keyword.  If it’s a number, it refers to a positional
argument, and if it’s a keyword, it refers to a named keyword
argument.  If the numerical arg_names in a format string are 0, 1, 2,
… in sequence, they can all be omitted (not just some) and the numbers
0, 1, 2, … will be automatically inserted in that order. Because
*arg_name* is not quote-delimited, it is not possible to specify
arbitrary dictionary keys (e.g., the strings "'10'" or "':-]'") within
a format string. The *arg_name* can be followed by any number of index
or attribute expressions. An expression of the form "'.name'" selects
the named attribute using "getattr()", while an expression of the form
"'[index]'" does an index lookup using "__getitem__()".

Changed in version 3.1: The positional argument specifiers can be
omitted for "str.format()", so "'{} {}'.format(a, b)" is equivalent to
"'{0} {1}'.format(a, b)".

Changed in version 3.4: The positional argument specifiers can be
omitted for "Formatter".

Some simple format string examples:

   "First, thou shalt count to {0}"  # References first positional argument
   "Bring me a {}"                   # Implicitly references the first positional argument
   "From {} to {}"                   # Same as "From {0} to {1}"
   "My quest is {name}"              # References keyword argument 'name'
   "Weight in tons {0.weight}"       # 'weight' attribute of first positional arg
   "Units destroyed: {players[0]}"   # First element of keyword argument 'players'.

The *conversion* field causes a type coercion before formatting.
Normally, the job of formatting a value is done by the "__format__()"
method of the value itself.  However, in some cases it is desirable to
force a type to be formatted as a string, overriding its own
definition of formatting.  By converting the value to a string before
calling "__format__()", the normal formatting logic is bypassed.

Three conversion flags are currently supported: "'!s'" which calls
"str()" on the value, "'!r'" which calls "repr()" and "'!a'" which
calls "ascii()".

Some examples:

   "Harold's a clever {0!s}"        # Calls str() on the argument first
   "Bring out the holy {name!r}"    # Calls repr() on the argument first
   "More {!a}"                      # Calls ascii() on the argument first

The *format_spec* field contains a specification of how the value
should be presented, including such details as field width, alignment,
padding, decimal precision and so on.  Each value type can define its
own “formatting mini-language” or interpretation of the *format_spec*.

Most built-in types support a common formatting mini-language, which
is described in the next section.

A *format_spec* field can also include nested replacement fields
within it. These nested replacement fields may contain a field name,
conversion flag and format specification, but deeper nesting is not
allowed.  The replacement fields within the format_spec are
substituted before the *format_spec* string is interpreted. This
allows the formatting of a value to be dynamically specified.

See the Format examples section for some examples.


Format Specification Mini-Language
==================================

“Format specifications” are used within replacement fields contained
within a format string to define how individual values are presented
(see Format String Syntax and Formatted string literals). They can
also be passed directly to the built-in "format()" function.  Each
formattable type may define how the format specification is to be
interpreted.

Most built-in types implement the following options for format
specifications, although some of the formatting options are only
supported by the numeric types.

A general convention is that an empty format specification produces
the same result as if you had called "str()" on the value. A non-empty
format specification typically modifies the result.

The general form of a *standard format specifier* is:

   format_spec     ::= [[fill]align][sign][#][0][width][grouping_option][.precision][type]
   fill            ::= <any character>
   align           ::= "<" | ">" | "=" | "^"
   sign            ::= "+" | "-" | " "
   width           ::= digit+
   grouping_option ::= "_" | ","
   precision       ::= digit+
   type            ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "s" | "x" | "X" | "%"

If a valid *align* value is specified, it can be preceded by a *fill*
character that can be any character and defaults to a space if
omitted. It is not possible to use a literal curly brace (”"{"” or
“"}"”) as the *fill* character in a formatted string literal or when
using the "str.format()" method.  However, it is possible to insert a
curly brace with a nested replacement field.  This limitation doesn’t
affect the "format()" function.

The meaning of the various alignment options is as follows:

   +-----------+------------------------------------------------------------+
   | Option    | Meaning                                                    |
   |===========|============================================================|
   | "'<'"     | Forces the field to be left-aligned within the available   |
   |           | space (this is the default for most objects).              |
   +-----------+------------------------------------------------------------+
   | "'>'"     | Forces the field to be right-aligned within the available  |
   |           | space (this is the default for numbers).                   |
   +-----------+------------------------------------------------------------+
   | "'='"     | Forces the padding to be placed after the sign (if any)    |
   |           | but before the digits.  This is used for printing fields   |
   |           | in the form ‘+000000120’. This alignment option is only    |
   |           | valid for numeric types.  It becomes the default when ‘0’  |
   |           | immediately precedes the field width.                      |
   +-----------+------------------------------------------------------------+
   | "'^'"     | Forces the field to be centered within the available       |
   |           | space.                                                     |
   +-----------+------------------------------------------------------------+

Note that unless a minimum field width is defined, the field width
will always be the same size as the data to fill it, so that the
alignment option has no meaning in this case.

The *sign* option is only valid for number types, and can be one of
the following:

   +-----------+------------------------------------------------------------+
   | Option    | Meaning                                                    |
   |===========|============================================================|
   | "'+'"     | indicates that a sign should be used for both positive as  |
   |           | well as negative numbers.                                  |
   +-----------+------------------------------------------------------------+
   | "'-'"     | indicates that a sign should be used only for negative     |
   |           | numbers (this is the default behavior).                    |
   +-----------+------------------------------------------------------------+
   | space     | indicates that a leading space should be used on positive  |
   |           | numbers, and a minus sign on negative numbers.             |
   +-----------+------------------------------------------------------------+

The "'#'" option causes the “alternate form” to be used for the
conversion.  The alternate form is defined differently for different
types.  This option is only valid for integer, float and complex
types. For integers, when binary, octal, or hexadecimal output is
used, this option adds the prefix respective "'0b'", "'0o'", or "'0x'"
to the output value. For float and complex the alternate form causes
the result of the conversion to always contain a decimal-point
character, even if no digits follow it. Normally, a decimal-point
character appears in the result of these conversions only if a digit
follows it. In addition, for "'g'" and "'G'" conversions, trailing
zeros are not removed from the result.

The "','" option signals the use of a comma for a thousands separator.
For a locale aware separator, use the "'n'" integer presentation type
instead.

Changed in version 3.1: Added the "','" option (see also **PEP 378**).

The "'_'" option signals the use of an underscore for a thousands
separator for floating point presentation types and for integer
presentation type "'d'".  For integer presentation types "'b'", "'o'",
"'x'", and "'X'", underscores will be inserted every 4 digits.  For
other presentation types, specifying this option is an error.

Changed in version 3.6: Added the "'_'" option (see also **PEP 515**).

*width* is a decimal integer defining the minimum total field width,
including any prefixes, separators, and other formatting characters.
If not specified, then the field width will be determined by the
content.

When no explicit alignment is given, preceding the *width* field by a
zero ("'0'") character enables sign-aware zero-padding for numeric
types.  This is equivalent to a *fill* character of "'0'" with an
*alignment* type of "'='".

The *precision* is a decimal number indicating how many digits should
be displayed after the decimal point for a floating point value
formatted with "'f'" and "'F'", or before and after the decimal point
for a floating point value formatted with "'g'" or "'G'".  For non-
number types the field indicates the maximum field size - in other
words, how many characters will be used from the field content. The
*precision* is not allowed for integer values.

Finally, the *type* determines how the data should be presented.

The available string presentation types are:

   +-----------+------------------------------------------------------------+
   | Type      | Meaning                                                    |
   |===========|============================================================|
   | "'s'"     | String format. This is the default type for strings and    |
   |           | may be omitted.                                            |
   +-----------+------------------------------------------------------------+
   | None      | The same as "'s'".                                         |
   +-----------+------------------------------------------------------------+

The available integer presentation types are:

   +-----------+------------------------------------------------------------+
   | Type      | Meaning                                                    |
   |===========|============================================================|
   | "'b'"     | Binary format. Outputs the number in base 2.               |
   +-----------+------------------------------------------------------------+
   | "'c'"     | Character. Converts the integer to the corresponding       |
   |           | unicode character before printing.                         |
   +-----------+------------------------------------------------------------+
   | "'d'"     | Decimal Integer. Outputs the number in base 10.            |
   +-----------+------------------------------------------------------------+
   | "'o'"     | Octal format. Outputs the number in base 8.                |
   +-----------+------------------------------------------------------------+
   | "'x'"     | Hex format. Outputs the number in base 16, using lower-    |
   |           | case letters for the digits above 9.                       |
   +-----------+------------------------------------------------------------+
   | "'X'"     | Hex format. Outputs the number in base 16, using upper-    |
   |           | case letters for the digits above 9.                       |
   +-----------+------------------------------------------------------------+
   | "'n'"     | Number. This is the same as "'d'", except that it uses the |
   |           | current locale setting to insert the appropriate number    |
   |           | separator characters.                                      |
   +-----------+------------------------------------------------------------+
   | None      | The same as "'d'".                                         |
   +-----------+------------------------------------------------------------+

In addition to the above presentation types, integers can be formatted
with the floating point presentation types listed below (except "'n'"
and "None"). When doing so, "float()" is used to convert the integer
to a floating point number before formatting.

The available presentation types for "float" and "Decimal" values are:

   +-----------+------------------------------------------------------------+
   | Type      | Meaning                                                    |
   |===========|============================================================|
   | "'e'"     | Scientific notation. For a given precision "p", formats    |
   |           | the number in scientific notation with the letter ‘e’      |
   |           | separating the coefficient from the exponent. The          |
   |           | coefficient has one digit before and "p" digits after the  |
   |           | decimal point, for a total of "p + 1" significant digits.  |
   |           | With no precision given, uses a precision of "6" digits    |
   |           | after the decimal point for "float", and shows all         |
   |           | coefficient digits for "Decimal". If no digits follow the  |
   |           | decimal point, the decimal point is also removed unless    |
   |           | the "#" option is used.                                    |
   +-----------+------------------------------------------------------------+
   | "'E'"     | Scientific notation. Same as "'e'" except it uses an upper |
   |           | case ‘E’ as the separator character.                       |
   +-----------+------------------------------------------------------------+
   | "'f'"     | Fixed-point notation. For a given precision "p", formats   |
   |           | the number as a decimal number with exactly "p" digits     |
   |           | following the decimal point. With no precision given, uses |
   |           | a precision of "6" digits after the decimal point for      |
   |           | "float", and uses a precision large enough to show all     |
   |           | coefficient digits for "Decimal". If no digits follow the  |
   |           | decimal point, the decimal point is also removed unless    |
   |           | the "#" option is used.                                    |
   +-----------+------------------------------------------------------------+
   | "'F'"     | Fixed-point notation. Same as "'f'", but converts "nan" to |
   |           | "NAN" and "inf" to "INF".                                  |
   +-----------+------------------------------------------------------------+
   | "'g'"     | General format.  For a given precision "p >= 1", this      |
   |           | rounds the number to "p" significant digits and then       |
   |           | formats the result in either fixed-point format or in      |
   |           | scientific notation, depending on its magnitude. A         |
   |           | precision of "0" is treated as equivalent to a precision   |
   |           | of "1".  The precise rules are as follows: suppose that    |
   |           | the result formatted with presentation type "'e'" and      |
   |           | precision "p-1" would have exponent "exp".  Then, if "m <= |
   |           | exp < p", where "m" is -4 for floats and -6 for            |
   |           | "Decimals", the number is formatted with presentation type |
   |           | "'f'" and precision "p-1-exp".  Otherwise, the number is   |
   |           | formatted with presentation type "'e'" and precision       |
   |           | "p-1". In both cases insignificant trailing zeros are      |
   |           | removed from the significand, and the decimal point is     |
   |           | also removed if there are no remaining digits following    |
   |           | it, unless the "'#'" option is used.  With no precision    |
   |           | given, uses a precision of "6" significant digits for      |
   |           | "float". For "Decimal", the coefficient of the result is   |
   |           | formed from the coefficient digits of the value;           |
   |           | scientific notation is used for values smaller than "1e-6" |
   |           | in absolute value and values where the place value of the  |
   |           | least significant digit is larger than 1, and fixed-point  |
   |           | notation is used otherwise.  Positive and negative         |
   |           | infinity, positive and negative zero, and nans, are        |
   |           | formatted as "inf", "-inf", "0", "-0" and "nan"            |
   |           | respectively, regardless of the precision.                 |
   +-----------+------------------------------------------------------------+
   | "'G'"     | General format. Same as "'g'" except switches to "'E'" if  |
   |           | the number gets too large. The representations of infinity |
   |           | and NaN are uppercased, too.                               |
   +-----------+------------------------------------------------------------+
   | "'n'"     | Number. This is the same as "'g'", except that it uses the |
   |           | current locale setting to insert the appropriate number    |
   |           | separator characters.                                      |
   +-----------+------------------------------------------------------------+
   | "'%'"     | Percentage. Multiplies the number by 100 and displays in   |
   |           | fixed ("'f'") format, followed by a percent sign.          |
   +-----------+------------------------------------------------------------+
   | None      | For "float" this is the same as "'g'", except that when    |
   |           | fixed-point notation is used to format the result, it      |
   |           | always includes at least one digit past the decimal point. |
   |           | The precision used is as large as needed to represent the  |
   |           | given value faithfully.  For "Decimal", this is the same   |
   |           | as either "'g'" or "'G'" depending on the value of         |
   |           | "context.capitals" for the current decimal context.  The   |
   |           | overall effect is to match the output of "str()" as        |
   |           | altered by the other format modifiers.                     |
   +-----------+------------------------------------------------------------+


Format examples
===============

This section contains examples of the "str.format()" syntax and
comparison with the old "%"-formatting.

In most of the cases the syntax is similar to the old "%"-formatting,
with the addition of the "{}" and with ":" used instead of "%". For
example, "'%03.2f'" can be translated to "'{:03.2f}'".

The new format syntax also supports new and different options, shown
in the following examples.

Accessing arguments by position:

   >>> '{0}, {1}, {2}'.format('a', 'b', 'c')
   'a, b, c'
   >>> '{}, {}, {}'.format('a', 'b', 'c')  # 3.1+ only
   'a, b, c'
   >>> '{2}, {1}, {0}'.format('a', 'b', 'c')
   'c, b, a'
   >>> '{2}, {1}, {0}'.format(*'abc')      # unpacking argument sequence
   'c, b, a'
   >>> '{0}{1}{0}'.format('abra', 'cad')   # arguments' indices can be repeated
   'abracadabra'

Accessing arguments by name:

   >>> 'Coordinates: {latitude}, {longitude}'.format(latitude='37.24N', longitude='-115.81W')
   'Coordinates: 37.24N, -115.81W'
   >>> coord = {'latitude': '37.24N', 'longitude': '-115.81W'}
   >>> 'Coordinates: {latitude}, {longitude}'.format(**coord)
   'Coordinates: 37.24N, -115.81W'

Accessing arguments’ attributes:

   >>> c = 3-5j
   >>> ('The complex number {0} is formed from the real part {0.real} '
   ...  'and the imaginary part {0.imag}.').format(c)
   'The complex number (3-5j) is formed from the real part 3.0 and the imaginary part -5.0.'
   >>> class Point:
   ...     def __init__(self, x, y):
   ...         self.x, self.y = x, y
   ...     def __str__(self):
   ...         return 'Point({self.x}, {self.y})'.format(self=self)
   ...
   >>> str(Point(4, 2))
   'Point(4, 2)'

Accessing arguments’ items:

   >>> coord = (3, 5)
   >>> 'X: {0[0]};  Y: {0[1]}'.format(coord)
   'X: 3;  Y: 5'

Replacing "%s" and "%r":

   >>> "repr() shows quotes: {!r}; str() doesn't: {!s}".format('test1', 'test2')
   "repr() shows quotes: 'test1'; str() doesn't: test2"

Aligning the text and specifying a width:

   >>> '{:<30}'.format('left aligned')
   'left aligned                  '
   >>> '{:>30}'.format('right aligned')
   '                 right aligned'
   >>> '{:^30}'.format('centered')
   '           centered           '
   >>> '{:*^30}'.format('centered')  # use '*' as a fill char
   '***********centered***********'

Replacing "%+f", "%-f", and "% f" and specifying a sign:

   >>> '{:+f}; {:+f}'.format(3.14, -3.14)  # show it always
   '+3.140000; -3.140000'
   >>> '{: f}; {: f}'.format(3.14, -3.14)  # show a space for positive numbers
   ' 3.140000; -3.140000'
   >>> '{:-f}; {:-f}'.format(3.14, -3.14)  # show only the minus -- same as '{:f}; {:f}'
   '3.140000; -3.140000'

Replacing "%x" and "%o" and converting the value to different bases:

   >>> # format also supports binary numbers
   >>> "int: {0:d};  hex: {0:x};  oct: {0:o};  bin: {0:b}".format(42)
   'int: 42;  hex: 2a;  oct: 52;  bin: 101010'
   >>> # with 0x, 0o, or 0b as prefix:
   >>> "int: {0:d};  hex: {0:#x};  oct: {0:#o};  bin: {0:#b}".format(42)
   'int: 42;  hex: 0x2a;  oct: 0o52;  bin: 0b101010'

Using the comma as a thousands separator:

   >>> '{:,}'.format(1234567890)
   '1,234,567,890'

Expressing a percentage:

   >>> points = 19
   >>> total = 22
   >>> 'Correct answers: {:.2%}'.format(points/total)
   'Correct answers: 86.36%'

Using type-specific formatting:

   >>> import datetime
   >>> d = datetime.datetime(2010, 7, 4, 12, 15, 58)
   >>> '{:%Y-%m-%d %H:%M:%S}'.format(d)
   '2010-07-04 12:15:58'

Nesting arguments and more complex examples:

   >>> for align, text in zip('<^>', ['left', 'center', 'right']):
   ...     '{0:{fill}{align}16}'.format(text, fill=align, align=align)
   ...
   'left<<<<<<<<<<<<'
   '^^^^^center^^^^^'
   '>>>>>>>>>>>right'
   >>>
   >>> octets = [192, 168, 0, 1]
   >>> '{:02X}{:02X}{:02X}{:02X}'.format(*octets)
   'C0A80001'
   >>> int(_, 16)
   3232235521
   >>>
   >>> width = 5
   >>> for num in range(5,12): 
   ...     for base in 'dXob':
   ...         print('{0:{width}{base}}'.format(num, base=base, width=width), end=' ')
   ...     print()
   ...
       5     5     5   101
       6     6     6   110
       7     7     7   111
       8     8    10  1000
       9     9    11  1001
      10     A    12  1010
      11     B    13  1011
u|Function definitions
********************

A function definition defines a user-defined function object (see
section The standard type hierarchy):

   funcdef                   ::= [decorators] "def" funcname "(" [parameter_list] ")"
               ["->" expression] ":" suite
   decorators                ::= decorator+
   decorator                 ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE
   dotted_name               ::= identifier ("." identifier)*
   parameter_list            ::= defparameter ("," defparameter)* "," "/" ["," [parameter_list_no_posonly]]
                        | parameter_list_no_posonly
   parameter_list_no_posonly ::= defparameter ("," defparameter)* ["," [parameter_list_starargs]]
                                 | parameter_list_starargs
   parameter_list_starargs   ::= "*" [parameter] ("," defparameter)* ["," ["**" parameter [","]]]
                               | "**" parameter [","]
   parameter                 ::= identifier [":" expression]
   defparameter              ::= parameter ["=" expression]
   funcname                  ::= identifier

A function definition is an executable statement.  Its execution binds
the function name in the current local namespace to a function object
(a wrapper around the executable code for the function).  This
function object contains a reference to the current global namespace
as the global namespace to be used when the function is called.

The function definition does not execute the function body; this gets
executed only when the function is called. [2]

A function definition may be wrapped by one or more *decorator*
expressions. Decorator expressions are evaluated when the function is
defined, in the scope that contains the function definition.  The
result must be a callable, which is invoked with the function object
as the only argument. The returned value is bound to the function name
instead of the function object.  Multiple decorators are applied in
nested fashion. For example, the following code

   @f1(arg)
   @f2
   def func(): pass

is roughly equivalent to

   def func(): pass
   func = f1(arg)(f2(func))

except that the original function is not temporarily bound to the name
"func".

When one or more *parameters* have the form *parameter* "="
*expression*, the function is said to have “default parameter values.”
For a parameter with a default value, the corresponding *argument* may
be omitted from a call, in which case the parameter’s default value is
substituted.  If a parameter has a default value, all following
parameters up until the “"*"” must also have a default value — this is
a syntactic restriction that is not expressed by the grammar.

**Default parameter values are evaluated from left to right when the
function definition is executed.** This means that the expression is
evaluated once, when the function is defined, and that the same “pre-
computed” value is used for each call.  This is especially important
to understand when a default parameter is a mutable object, such as a
list or a dictionary: if the function modifies the object (e.g. by
appending an item to a list), the default value is in effect modified.
This is generally not what was intended.  A way around this is to use
"None" as the default, and explicitly test for it in the body of the
function, e.g.:

   def whats_on_the_telly(penguin=None):
       if penguin is None:
           penguin = []
       penguin.append("property of the zoo")
       return penguin

Function call semantics are described in more detail in section Calls.
A function call always assigns values to all parameters mentioned in
the parameter list, either from positional arguments, from keyword
arguments, or from default values.  If the form “"*identifier"” is
present, it is initialized to a tuple receiving any excess positional
parameters, defaulting to the empty tuple. If the form
“"**identifier"” is present, it is initialized to a new ordered
mapping receiving any excess keyword arguments, defaulting to a new
empty mapping of the same type.  Parameters after “"*"” or
“"*identifier"” are keyword-only parameters and may only be passed by
keyword arguments.  Parameters before “"/"” are positional-only
parameters and may only be passed by positional arguments.

Changed in version 3.8: The "/" function parameter syntax may be used
to indicate positional-only parameters. See **PEP 570** for details.

Parameters may have an *annotation* of the form “": expression"”
following the parameter name.  Any parameter may have an annotation,
even those of the form "*identifier" or "**identifier".  Functions may
have “return” annotation of the form “"-> expression"” after the
parameter list.  These annotations can be any valid Python expression.
The presence of annotations does not change the semantics of a
function.  The annotation values are available as values of a
dictionary keyed by the parameters’ names in the "__annotations__"
attribute of the function object.  If the "annotations" import from
"__future__" is used, annotations are preserved as strings at runtime
which enables postponed evaluation.  Otherwise, they are evaluated
when the function definition is executed.  In this case annotations
may be evaluated in a different order than they appear in the source
code.

It is also possible to create anonymous functions (functions not bound
to a name), for immediate use in expressions.  This uses lambda
expressions, described in section Lambdas.  Note that the lambda
expression is merely a shorthand for a simplified function definition;
a function defined in a “"def"” statement can be passed around or
assigned to another name just like a function defined by a lambda
expression.  The “"def"” form is actually more powerful since it
allows the execution of multiple statements and annotations.

**Programmer’s note:** Functions are first-class objects.  A “"def"”
statement executed inside a function definition defines a local
function that can be returned or passed around.  Free variables used
in the nested function can access the local variables of the function
containing the def.  See section Naming and binding for details.

See also:

  **PEP 3107** - Function Annotations
     The original specification for function annotations.

  **PEP 484** - Type Hints
     Definition of a standard meaning for annotations: type hints.

  **PEP 526** - Syntax for Variable Annotations
     Ability to type hint variable declarations, including class
     variables and instance variables

  **PEP 563** - Postponed Evaluation of Annotations
     Support for forward references within annotations by preserving
     annotations in a string form at runtime instead of eager
     evaluation.
u�The "global" statement
**********************

   global_stmt ::= "global" identifier ("," identifier)*

The "global" statement is a declaration which holds for the entire
current code block.  It means that the listed identifiers are to be
interpreted as globals.  It would be impossible to assign to a global
variable without "global", although free variables may refer to
globals without being declared global.

Names listed in a "global" statement must not be used in the same code
block textually preceding that "global" statement.

Names listed in a "global" statement must not be defined as formal
parameters or in a "for" loop control target, "class" definition,
function definition, "import" statement, or variable annotation.

**CPython implementation detail:** The current implementation does not
enforce some of these restrictions, but programs should not abuse this
freedom, as future implementations may enforce them or silently change
the meaning of the program.

**Programmer’s note:** "global" is a directive to the parser.  It
applies only to code parsed at the same time as the "global"
statement. In particular, a "global" statement contained in a string
or code object supplied to the built-in "exec()" function does not
affect the code block *containing* the function call, and code
contained in such a string is unaffected by "global" statements in the
code containing the function call.  The same applies to the "eval()"
and "compile()" functions.
u�Reserved classes of identifiers
*******************************

Certain classes of identifiers (besides keywords) have special
meanings.  These classes are identified by the patterns of leading and
trailing underscore characters:

"_*"
   Not imported by "from module import *".  The special identifier "_"
   is used in the interactive interpreter to store the result of the
   last evaluation; it is stored in the "builtins" module.  When not
   in interactive mode, "_" has no special meaning and is not defined.
   See section The import statement.

   Note:

     The name "_" is often used in conjunction with
     internationalization; refer to the documentation for the
     "gettext" module for more information on this convention.

"__*__"
   System-defined names, informally known as “dunder” names. These
   names are defined by the interpreter and its implementation
   (including the standard library). Current system names are
   discussed in the Special method names section and elsewhere. More
   will likely be defined in future versions of Python.  *Any* use of
   "__*__" names, in any context, that does not follow explicitly
   documented use, is subject to breakage without warning.

"__*"
   Class-private names.  Names in this category, when used within the
   context of a class definition, are re-written to use a mangled form
   to help avoid name clashes between “private” attributes of base and
   derived classes. See section Identifiers (Names).
umIdentifiers and keywords
************************

Identifiers (also referred to as *names*) are described by the
following lexical definitions.

The syntax of identifiers in Python is based on the Unicode standard
annex UAX-31, with elaboration and changes as defined below; see also
**PEP 3131** for further details.

Within the ASCII range (U+0001..U+007F), the valid characters for
identifiers are the same as in Python 2.x: the uppercase and lowercase
letters "A" through "Z", the underscore "_" and, except for the first
character, the digits "0" through "9".

Python 3.0 introduces additional characters from outside the ASCII
range (see **PEP 3131**).  For these characters, the classification
uses the version of the Unicode Character Database as included in the
"unicodedata" module.

Identifiers are unlimited in length.  Case is significant.

   identifier   ::= xid_start xid_continue*
   id_start     ::= <all characters in general categories Lu, Ll, Lt, Lm, Lo, Nl, the underscore, and characters with the Other_ID_Start property>
   id_continue  ::= <all characters in id_start, plus characters in the categories Mn, Mc, Nd, Pc and others with the Other_ID_Continue property>
   xid_start    ::= <all characters in id_start whose NFKC normalization is in "id_start xid_continue*">
   xid_continue ::= <all characters in id_continue whose NFKC normalization is in "id_continue*">

The Unicode category codes mentioned above stand for:

* *Lu* - uppercase letters

* *Ll* - lowercase letters

* *Lt* - titlecase letters

* *Lm* - modifier letters

* *Lo* - other letters

* *Nl* - letter numbers

* *Mn* - nonspacing marks

* *Mc* - spacing combining marks

* *Nd* - decimal numbers

* *Pc* - connector punctuations

* *Other_ID_Start* - explicit list of characters in PropList.txt to
  support backwards compatibility

* *Other_ID_Continue* - likewise

All identifiers are converted into the normal form NFKC while parsing;
comparison of identifiers is based on NFKC.

A non-normative HTML file listing all valid identifier characters for
Unicode 4.1 can be found at
https://www.unicode.org/Public/13.0.0/ucd/DerivedCoreProperties.txt


Keywords
========

The following identifiers are used as reserved words, or *keywords* of
the language, and cannot be used as ordinary identifiers.  They must
be spelled exactly as written here:

   False      await      else       import     pass
   None       break      except     in         raise
   True       class      finally    is         return
   and        continue   for        lambda     try
   as         def        from       nonlocal   while
   assert     del        global     not        with
   async      elif       if         or         yield


Reserved classes of identifiers
===============================

Certain classes of identifiers (besides keywords) have special
meanings.  These classes are identified by the patterns of leading and
trailing underscore characters:

"_*"
   Not imported by "from module import *".  The special identifier "_"
   is used in the interactive interpreter to store the result of the
   last evaluation; it is stored in the "builtins" module.  When not
   in interactive mode, "_" has no special meaning and is not defined.
   See section The import statement.

   Note:

     The name "_" is often used in conjunction with
     internationalization; refer to the documentation for the
     "gettext" module for more information on this convention.

"__*__"
   System-defined names, informally known as “dunder” names. These
   names are defined by the interpreter and its implementation
   (including the standard library). Current system names are
   discussed in the Special method names section and elsewhere. More
   will likely be defined in future versions of Python.  *Any* use of
   "__*__" names, in any context, that does not follow explicitly
   documented use, is subject to breakage without warning.

"__*"
   Class-private names.  Names in this category, when used within the
   context of a class definition, are re-written to use a mangled form
   to help avoid name clashes between “private” attributes of base and
   derived classes. See section Identifiers (Names).
a5Imaginary literals
******************

Imaginary literals are described by the following lexical definitions:

   imagnumber ::= (floatnumber | digitpart) ("j" | "J")

An imaginary literal yields a complex number with a real part of 0.0.
Complex numbers are represented as a pair of floating point numbers
and have the same restrictions on their range.  To create a complex
number with a nonzero real part, add a floating point number to it,
e.g., "(3+4j)".  Some examples of imaginary literals:

   3.14j   10.j    10j     .001j   1e100j   3.14e-10j   3.14_15_93j
u8"The "import" statement
**********************

   import_stmt     ::= "import" module ["as" identifier] ("," module ["as" identifier])*
                   | "from" relative_module "import" identifier ["as" identifier]
                   ("," identifier ["as" identifier])*
                   | "from" relative_module "import" "(" identifier ["as" identifier]
                   ("," identifier ["as" identifier])* [","] ")"
                   | "from" module "import" "*"
   module          ::= (identifier ".")* identifier
   relative_module ::= "."* module | "."+

The basic import statement (no "from" clause) is executed in two
steps:

1. find a module, loading and initializing it if necessary

2. define a name or names in the local namespace for the scope where
   the "import" statement occurs.

When the statement contains multiple clauses (separated by commas) the
two steps are carried out separately for each clause, just as though
the clauses had been separated out into individual import statements.

The details of the first step, finding and loading modules are
described in greater detail in the section on the import system, which
also describes the various types of packages and modules that can be
imported, as well as all the hooks that can be used to customize the
import system. Note that failures in this step may indicate either
that the module could not be located, *or* that an error occurred
while initializing the module, which includes execution of the
module’s code.

If the requested module is retrieved successfully, it will be made
available in the local namespace in one of three ways:

* If the module name is followed by "as", then the name following "as"
  is bound directly to the imported module.

* If no other name is specified, and the module being imported is a
  top level module, the module’s name is bound in the local namespace
  as a reference to the imported module

* If the module being imported is *not* a top level module, then the
  name of the top level package that contains the module is bound in
  the local namespace as a reference to the top level package. The
  imported module must be accessed using its full qualified name
  rather than directly

The "from" form uses a slightly more complex process:

1. find the module specified in the "from" clause, loading and
   initializing it if necessary;

2. for each of the identifiers specified in the "import" clauses:

   1. check if the imported module has an attribute by that name

   2. if not, attempt to import a submodule with that name and then
      check the imported module again for that attribute

   3. if the attribute is not found, "ImportError" is raised.

   4. otherwise, a reference to that value is stored in the local
      namespace, using the name in the "as" clause if it is present,
      otherwise using the attribute name

Examples:

   import foo                 # foo imported and bound locally
   import foo.bar.baz         # foo.bar.baz imported, foo bound locally
   import foo.bar.baz as fbb  # foo.bar.baz imported and bound as fbb
   from foo.bar import baz    # foo.bar.baz imported and bound as baz
   from foo import attr       # foo imported and foo.attr bound as attr

If the list of identifiers is replaced by a star ("'*'"), all public
names defined in the module are bound in the local namespace for the
scope where the "import" statement occurs.

The *public names* defined by a module are determined by checking the
module’s namespace for a variable named "__all__"; if defined, it must
be a sequence of strings which are names defined or imported by that
module.  The names given in "__all__" are all considered public and
are required to exist.  If "__all__" is not defined, the set of public
names includes all names found in the module’s namespace which do not
begin with an underscore character ("'_'").  "__all__" should contain
the entire public API. It is intended to avoid accidentally exporting
items that are not part of the API (such as library modules which were
imported and used within the module).

The wild card form of import — "from module import *" — is only
allowed at the module level.  Attempting to use it in class or
function definitions will raise a "SyntaxError".

When specifying what module to import you do not have to specify the
absolute name of the module. When a module or package is contained
within another package it is possible to make a relative import within
the same top package without having to mention the package name. By
using leading dots in the specified module or package after "from" you
can specify how high to traverse up the current package hierarchy
without specifying exact names. One leading dot means the current
package where the module making the import exists. Two dots means up
one package level. Three dots is up two levels, etc. So if you execute
"from . import mod" from a module in the "pkg" package then you will
end up importing "pkg.mod". If you execute "from ..subpkg2 import mod"
from within "pkg.subpkg1" you will import "pkg.subpkg2.mod". The
specification for relative imports is contained in the Package
Relative Imports section.

"importlib.import_module()" is provided to support applications that
determine dynamically the modules to be loaded.

Raises an auditing event "import" with arguments "module", "filename",
"sys.path", "sys.meta_path", "sys.path_hooks".


Future statements
=================

A *future statement* is a directive to the compiler that a particular
module should be compiled using syntax or semantics that will be
available in a specified future release of Python where the feature
becomes standard.

The future statement is intended to ease migration to future versions
of Python that introduce incompatible changes to the language.  It
allows use of the new features on a per-module basis before the
release in which the feature becomes standard.

   future_stmt ::= "from" "__future__" "import" feature ["as" identifier]
                   ("," feature ["as" identifier])*
                   | "from" "__future__" "import" "(" feature ["as" identifier]
                   ("," feature ["as" identifier])* [","] ")"
   feature     ::= identifier

A future statement must appear near the top of the module.  The only
lines that can appear before a future statement are:

* the module docstring (if any),

* comments,

* blank lines, and

* other future statements.

The only feature that requires using the future statement is
"annotations" (see **PEP 563**).

All historical features enabled by the future statement are still
recognized by Python 3.  The list includes "absolute_import",
"division", "generators", "generator_stop", "unicode_literals",
"print_function", "nested_scopes" and "with_statement".  They are all
redundant because they are always enabled, and only kept for backwards
compatibility.

A future statement is recognized and treated specially at compile
time: Changes to the semantics of core constructs are often
implemented by generating different code.  It may even be the case
that a new feature introduces new incompatible syntax (such as a new
reserved word), in which case the compiler may need to parse the
module differently.  Such decisions cannot be pushed off until
runtime.

For any given release, the compiler knows which feature names have
been defined, and raises a compile-time error if a future statement
contains a feature not known to it.

The direct runtime semantics are the same as for any import statement:
there is a standard module "__future__", described later, and it will
be imported in the usual way at the time the future statement is
executed.

The interesting runtime semantics depend on the specific feature
enabled by the future statement.

Note that there is nothing special about the statement:

   import __future__ [as name]

That is not a future statement; it’s an ordinary import statement with
no special semantics or syntax restrictions.

Code compiled by calls to the built-in functions "exec()" and
"compile()" that occur in a module "M" containing a future statement
will, by default, use the new syntax or semantics associated with the
future statement.  This can be controlled by optional arguments to
"compile()" — see the documentation of that function for details.

A future statement typed at an interactive interpreter prompt will
take effect for the rest of the interpreter session.  If an
interpreter is started with the "-i" option, is passed a script name
to execute, and the script includes a future statement, it will be in
effect in the interactive session started after the script is
executed.

See also:

  **PEP 236** - Back to the __future__
     The original proposal for the __future__ mechanism.
aMembership test operations
**************************

The operators "in" and "not in" test for membership.  "x in s"
evaluates to "True" if *x* is a member of *s*, and "False" otherwise.
"x not in s" returns the negation of "x in s".  All built-in sequences
and set types support this as well as dictionary, for which "in" tests
whether the dictionary has a given key. For container types such as
list, tuple, set, frozenset, dict, or collections.deque, the
expression "x in y" is equivalent to "any(x is e or x == e for e in
y)".

For the string and bytes types, "x in y" is "True" if and only if *x*
is a substring of *y*.  An equivalent test is "y.find(x) != -1".
Empty strings are always considered to be a substring of any other
string, so """ in "abc"" will return "True".

For user-defined classes which define the "__contains__()" method, "x
in y" returns "True" if "y.__contains__(x)" returns a true value, and
"False" otherwise.

For user-defined classes which do not define "__contains__()" but do
define "__iter__()", "x in y" is "True" if some value "z", for which
the expression "x is z or x == z" is true, is produced while iterating
over "y". If an exception is raised during the iteration, it is as if
"in" raised that exception.

Lastly, the old-style iteration protocol is tried: if a class defines
"__getitem__()", "x in y" is "True" if and only if there is a non-
negative integer index *i* such that "x is y[i] or x == y[i]", and no
lower integer index raises the "IndexError" exception.  (If any other
exception is raised, it is as if "in" raised that exception).

The operator "not in" is defined to have the inverse truth value of
"in".
aVInteger literals
****************

Integer literals are described by the following lexical definitions:

   integer      ::= decinteger | bininteger | octinteger | hexinteger
   decinteger   ::= nonzerodigit (["_"] digit)* | "0"+ (["_"] "0")*
   bininteger   ::= "0" ("b" | "B") (["_"] bindigit)+
   octinteger   ::= "0" ("o" | "O") (["_"] octdigit)+
   hexinteger   ::= "0" ("x" | "X") (["_"] hexdigit)+
   nonzerodigit ::= "1"..."9"
   digit        ::= "0"..."9"
   bindigit     ::= "0" | "1"
   octdigit     ::= "0"..."7"
   hexdigit     ::= digit | "a"..."f" | "A"..."F"

There is no limit for the length of integer literals apart from what
can be stored in available memory.

Underscores are ignored for determining the numeric value of the
literal.  They can be used to group digits for enhanced readability.
One underscore can occur between digits, and after base specifiers
like "0x".

Note that leading zeros in a non-zero decimal number are not allowed.
This is for disambiguation with C-style octal literals, which Python
used before version 3.0.

Some examples of integer literals:

   7     2147483647                        0o177    0b100110111
   3     79228162514264337593543950336     0o377    0xdeadbeef
         100_000_000_000                   0b_1110_0101

Changed in version 3.6: Underscores are now allowed for grouping
purposes in literals.
a^Lambdas
*******

   lambda_expr        ::= "lambda" [parameter_list] ":" expression
   lambda_expr_nocond ::= "lambda" [parameter_list] ":" expression_nocond

Lambda expressions (sometimes called lambda forms) are used to create
anonymous functions. The expression "lambda parameters: expression"
yields a function object.  The unnamed object behaves like a function
object defined with:

   def <lambda>(parameters):
       return expression

See section Function definitions for the syntax of parameter lists.
Note that functions created with lambda expressions cannot contain
statements or annotations.
a/List displays
*************

A list display is a possibly empty series of expressions enclosed in
square brackets:

   list_display ::= "[" [starred_list | comprehension] "]"

A list display yields a new list object, the contents being specified
by either a list of expressions or a comprehension.  When a comma-
separated list of expressions is supplied, its elements are evaluated
from left to right and placed into the list object in that order.
When a comprehension is supplied, the list is constructed from the
elements resulting from the comprehension.
u�Naming and binding
******************


Binding of names
================

*Names* refer to objects.  Names are introduced by name binding
operations.

The following constructs bind names: formal parameters to functions,
"import" statements, class and function definitions (these bind the
class or function name in the defining block), and targets that are
identifiers if occurring in an assignment, "for" loop header, or after
"as" in a "with" statement or "except" clause. The "import" statement
of the form "from ... import *" binds all names defined in the
imported module, except those beginning with an underscore.  This form
may only be used at the module level.

A target occurring in a "del" statement is also considered bound for
this purpose (though the actual semantics are to unbind the name).

Each assignment or import statement occurs within a block defined by a
class or function definition or at the module level (the top-level
code block).

If a name is bound in a block, it is a local variable of that block,
unless declared as "nonlocal" or "global".  If a name is bound at the
module level, it is a global variable.  (The variables of the module
code block are local and global.)  If a variable is used in a code
block but not defined there, it is a *free variable*.

Each occurrence of a name in the program text refers to the *binding*
of that name established by the following name resolution rules.


Resolution of names
===================

A *scope* defines the visibility of a name within a block.  If a local
variable is defined in a block, its scope includes that block.  If the
definition occurs in a function block, the scope extends to any blocks
contained within the defining one, unless a contained block introduces
a different binding for the name.

When a name is used in a code block, it is resolved using the nearest
enclosing scope.  The set of all such scopes visible to a code block
is called the block’s *environment*.

When a name is not found at all, a "NameError" exception is raised. If
the current scope is a function scope, and the name refers to a local
variable that has not yet been bound to a value at the point where the
name is used, an "UnboundLocalError" exception is raised.
"UnboundLocalError" is a subclass of "NameError".

If a name binding operation occurs anywhere within a code block, all
uses of the name within the block are treated as references to the
current block.  This can lead to errors when a name is used within a
block before it is bound.  This rule is subtle.  Python lacks
declarations and allows name binding operations to occur anywhere
within a code block.  The local variables of a code block can be
determined by scanning the entire text of the block for name binding
operations.

If the "global" statement occurs within a block, all uses of the name
specified in the statement refer to the binding of that name in the
top-level namespace.  Names are resolved in the top-level namespace by
searching the global namespace, i.e. the namespace of the module
containing the code block, and the builtins namespace, the namespace
of the module "builtins".  The global namespace is searched first.  If
the name is not found there, the builtins namespace is searched.  The
"global" statement must precede all uses of the name.

The "global" statement has the same scope as a name binding operation
in the same block.  If the nearest enclosing scope for a free variable
contains a global statement, the free variable is treated as a global.

The "nonlocal" statement causes corresponding names to refer to
previously bound variables in the nearest enclosing function scope.
"SyntaxError" is raised at compile time if the given name does not
exist in any enclosing function scope.

The namespace for a module is automatically created the first time a
module is imported.  The main module for a script is always called
"__main__".

Class definition blocks and arguments to "exec()" and "eval()" are
special in the context of name resolution. A class definition is an
executable statement that may use and define names. These references
follow the normal rules for name resolution with an exception that
unbound local variables are looked up in the global namespace. The
namespace of the class definition becomes the attribute dictionary of
the class. The scope of names defined in a class block is limited to
the class block; it does not extend to the code blocks of methods –
this includes comprehensions and generator expressions since they are
implemented using a function scope.  This means that the following
will fail:

   class A:
       a = 42
       b = list(a + i for i in range(10))


Builtins and restricted execution
=================================

**CPython implementation detail:** Users should not touch
"__builtins__"; it is strictly an implementation detail.  Users
wanting to override values in the builtins namespace should "import"
the "builtins" module and modify its attributes appropriately.

The builtins namespace associated with the execution of a code block
is actually found by looking up the name "__builtins__" in its global
namespace; this should be a dictionary or a module (in the latter case
the module’s dictionary is used).  By default, when in the "__main__"
module, "__builtins__" is the built-in module "builtins"; when in any
other module, "__builtins__" is an alias for the dictionary of the
"builtins" module itself.


Interaction with dynamic features
=================================

Name resolution of free variables occurs at runtime, not at compile
time. This means that the following code will print 42:

   i = 10
   def f():
       print(i)
   i = 42
   f()

The "eval()" and "exec()" functions do not have access to the full
environment for resolving names.  Names may be resolved in the local
and global namespaces of the caller.  Free variables are not resolved
in the nearest enclosing namespace, but in the global namespace.  [1]
The "exec()" and "eval()" functions have optional arguments to
override the global and local namespace.  If only one namespace is
specified, it is used for both.
a�The "nonlocal" statement
************************

   nonlocal_stmt ::= "nonlocal" identifier ("," identifier)*

The "nonlocal" statement causes the listed identifiers to refer to
previously bound variables in the nearest enclosing scope excluding
globals. This is important because the default behavior for binding is
to search the local namespace first.  The statement allows
encapsulated code to rebind variables outside of the local scope
besides the global (module) scope.

Names listed in a "nonlocal" statement, unlike those listed in a
"global" statement, must refer to pre-existing bindings in an
enclosing scope (the scope in which a new binding should be created
cannot be determined unambiguously).

Names listed in a "nonlocal" statement must not collide with pre-
existing bindings in the local scope.

See also:

  **PEP 3104** - Access to Names in Outer Scopes
     The specification for the "nonlocal" statement.
u�Numeric literals
****************

There are three types of numeric literals: integers, floating point
numbers, and imaginary numbers.  There are no complex literals
(complex numbers can be formed by adding a real number and an
imaginary number).

Note that numeric literals do not include a sign; a phrase like "-1"
is actually an expression composed of the unary operator ‘"-"’ and the
literal "1".
uEmulating numeric types
***********************

The following methods can be defined to emulate numeric objects.
Methods corresponding to operations that are not supported by the
particular kind of number implemented (e.g., bitwise operations for
non-integral numbers) should be left undefined.

object.__add__(self, other)
object.__sub__(self, other)
object.__mul__(self, other)
object.__matmul__(self, other)
object.__truediv__(self, other)
object.__floordiv__(self, other)
object.__mod__(self, other)
object.__divmod__(self, other)
object.__pow__(self, other[, modulo])
object.__lshift__(self, other)
object.__rshift__(self, other)
object.__and__(self, other)
object.__xor__(self, other)
object.__or__(self, other)

   These methods are called to implement the binary arithmetic
   operations ("+", "-", "*", "@", "/", "//", "%", "divmod()",
   "pow()", "**", "<<", ">>", "&", "^", "|").  For instance, to
   evaluate the expression "x + y", where *x* is an instance of a
   class that has an "__add__()" method, "x.__add__(y)" is called.
   The "__divmod__()" method should be the equivalent to using
   "__floordiv__()" and "__mod__()"; it should not be related to
   "__truediv__()".  Note that "__pow__()" should be defined to accept
   an optional third argument if the ternary version of the built-in
   "pow()" function is to be supported.

   If one of those methods does not support the operation with the
   supplied arguments, it should return "NotImplemented".

object.__radd__(self, other)
object.__rsub__(self, other)
object.__rmul__(self, other)
object.__rmatmul__(self, other)
object.__rtruediv__(self, other)
object.__rfloordiv__(self, other)
object.__rmod__(self, other)
object.__rdivmod__(self, other)
object.__rpow__(self, other[, modulo])
object.__rlshift__(self, other)
object.__rrshift__(self, other)
object.__rand__(self, other)
object.__rxor__(self, other)
object.__ror__(self, other)

   These methods are called to implement the binary arithmetic
   operations ("+", "-", "*", "@", "/", "//", "%", "divmod()",
   "pow()", "**", "<<", ">>", "&", "^", "|") with reflected (swapped)
   operands.  These functions are only called if the left operand does
   not support the corresponding operation [3] and the operands are of
   different types. [4] For instance, to evaluate the expression "x -
   y", where *y* is an instance of a class that has an "__rsub__()"
   method, "y.__rsub__(x)" is called if "x.__sub__(y)" returns
   *NotImplemented*.

   Note that ternary "pow()" will not try calling "__rpow__()" (the
   coercion rules would become too complicated).

   Note:

     If the right operand’s type is a subclass of the left operand’s
     type and that subclass provides a different implementation of the
     reflected method for the operation, this method will be called
     before the left operand’s non-reflected method. This behavior
     allows subclasses to override their ancestors’ operations.

object.__iadd__(self, other)
object.__isub__(self, other)
object.__imul__(self, other)
object.__imatmul__(self, other)
object.__itruediv__(self, other)
object.__ifloordiv__(self, other)
object.__imod__(self, other)
object.__ipow__(self, other[, modulo])
object.__ilshift__(self, other)
object.__irshift__(self, other)
object.__iand__(self, other)
object.__ixor__(self, other)
object.__ior__(self, other)

   These methods are called to implement the augmented arithmetic
   assignments ("+=", "-=", "*=", "@=", "/=", "//=", "%=", "**=",
   "<<=", ">>=", "&=", "^=", "|=").  These methods should attempt to
   do the operation in-place (modifying *self*) and return the result
   (which could be, but does not have to be, *self*).  If a specific
   method is not defined, the augmented assignment falls back to the
   normal methods.  For instance, if *x* is an instance of a class
   with an "__iadd__()" method, "x += y" is equivalent to "x =
   x.__iadd__(y)" . Otherwise, "x.__add__(y)" and "y.__radd__(x)" are
   considered, as with the evaluation of "x + y". In certain
   situations, augmented assignment can result in unexpected errors
   (see Why does a_tuple[i] += [‘item’] raise an exception when the
   addition works?), but this behavior is in fact part of the data
   model.

   Note:

     Due to a bug in the dispatching mechanism for "**=", a class that
     defines "__ipow__()" but returns "NotImplemented" would fail to
     fall back to "x.__pow__(y)" and "y.__rpow__(x)". This bug is
     fixed in Python 3.10.

object.__neg__(self)
object.__pos__(self)
object.__abs__(self)
object.__invert__(self)

   Called to implement the unary arithmetic operations ("-", "+",
   "abs()" and "~").

object.__complex__(self)
object.__int__(self)
object.__float__(self)

   Called to implement the built-in functions "complex()", "int()" and
   "float()".  Should return a value of the appropriate type.

object.__index__(self)

   Called to implement "operator.index()", and whenever Python needs
   to losslessly convert the numeric object to an integer object (such
   as in slicing, or in the built-in "bin()", "hex()" and "oct()"
   functions). Presence of this method indicates that the numeric
   object is an integer type.  Must return an integer.

   If "__int__()", "__float__()" and "__complex__()" are not defined
   then corresponding built-in functions "int()", "float()" and
   "complex()" fall back to "__index__()".

object.__round__(self[, ndigits])
object.__trunc__(self)
object.__floor__(self)
object.__ceil__(self)

   Called to implement the built-in function "round()" and "math"
   functions "trunc()", "floor()" and "ceil()". Unless *ndigits* is
   passed to "__round__()" all these methods should return the value
   of the object truncated to an "Integral" (typically an "int").

   The built-in function "int()" falls back to "__trunc__()" if
   neither "__int__()" nor "__index__()" is defined.
uObjects, values and types
*************************

*Objects* are Python’s abstraction for data.  All data in a Python
program is represented by objects or by relations between objects. (In
a sense, and in conformance to Von Neumann’s model of a “stored
program computer”, code is also represented by objects.)

Every object has an identity, a type and a value.  An object’s
*identity* never changes once it has been created; you may think of it
as the object’s address in memory.  The ‘"is"’ operator compares the
identity of two objects; the "id()" function returns an integer
representing its identity.

**CPython implementation detail:** For CPython, "id(x)" is the memory
address where "x" is stored.

An object’s type determines the operations that the object supports
(e.g., “does it have a length?”) and also defines the possible values
for objects of that type.  The "type()" function returns an object’s
type (which is an object itself).  Like its identity, an object’s
*type* is also unchangeable. [1]

The *value* of some objects can change.  Objects whose value can
change are said to be *mutable*; objects whose value is unchangeable
once they are created are called *immutable*. (The value of an
immutable container object that contains a reference to a mutable
object can change when the latter’s value is changed; however the
container is still considered immutable, because the collection of
objects it contains cannot be changed.  So, immutability is not
strictly the same as having an unchangeable value, it is more subtle.)
An object’s mutability is determined by its type; for instance,
numbers, strings and tuples are immutable, while dictionaries and
lists are mutable.

Objects are never explicitly destroyed; however, when they become
unreachable they may be garbage-collected.  An implementation is
allowed to postpone garbage collection or omit it altogether — it is a
matter of implementation quality how garbage collection is
implemented, as long as no objects are collected that are still
reachable.

**CPython implementation detail:** CPython currently uses a reference-
counting scheme with (optional) delayed detection of cyclically linked
garbage, which collects most objects as soon as they become
unreachable, but is not guaranteed to collect garbage containing
circular references.  See the documentation of the "gc" module for
information on controlling the collection of cyclic garbage. Other
implementations act differently and CPython may change. Do not depend
on immediate finalization of objects when they become unreachable (so
you should always close files explicitly).

Note that the use of the implementation’s tracing or debugging
facilities may keep objects alive that would normally be collectable.
Also note that catching an exception with a ‘"try"…"except"’ statement
may keep objects alive.

Some objects contain references to “external” resources such as open
files or windows.  It is understood that these resources are freed
when the object is garbage-collected, but since garbage collection is
not guaranteed to happen, such objects also provide an explicit way to
release the external resource, usually a "close()" method. Programs
are strongly recommended to explicitly close such objects.  The
‘"try"…"finally"’ statement and the ‘"with"’ statement provide
convenient ways to do this.

Some objects contain references to other objects; these are called
*containers*. Examples of containers are tuples, lists and
dictionaries.  The references are part of a container’s value.  In
most cases, when we talk about the value of a container, we imply the
values, not the identities of the contained objects; however, when we
talk about the mutability of a container, only the identities of the
immediately contained objects are implied.  So, if an immutable
container (like a tuple) contains a reference to a mutable object, its
value changes if that mutable object is changed.

Types affect almost all aspects of object behavior.  Even the
importance of object identity is affected in some sense: for immutable
types, operations that compute new values may actually return a
reference to any existing object with the same type and value, while
for mutable objects this is not allowed.  E.g., after "a = 1; b = 1",
"a" and "b" may or may not refer to the same object with the value
one, depending on the implementation, but after "c = []; d = []", "c"
and "d" are guaranteed to refer to two different, unique, newly
created empty lists. (Note that "c = d = []" assigns the same object
to both "c" and "d".)
u�Operator precedence
*******************

The following table summarizes the operator precedence in Python, from
lowest precedence (least binding) to highest precedence (most
binding).  Operators in the same box have the same precedence.  Unless
the syntax is explicitly given, operators are binary.  Operators in
the same box group left to right (except for exponentiation, which
groups from right to left).

Note that comparisons, membership tests, and identity tests, all have
the same precedence and have a left-to-right chaining feature as
described in the Comparisons section.

+-------------------------------------------------+---------------------------------------+
| Operator                                        | Description                           |
|=================================================|=======================================|
| ":="                                            | Assignment expression                 |
+-------------------------------------------------+---------------------------------------+
| "lambda"                                        | Lambda expression                     |
+-------------------------------------------------+---------------------------------------+
| "if" – "else"                                   | Conditional expression                |
+-------------------------------------------------+---------------------------------------+
| "or"                                            | Boolean OR                            |
+-------------------------------------------------+---------------------------------------+
| "and"                                           | Boolean AND                           |
+-------------------------------------------------+---------------------------------------+
| "not" "x"                                       | Boolean NOT                           |
+-------------------------------------------------+---------------------------------------+
| "in", "not in", "is", "is not", "<", "<=", ">", | Comparisons, including membership     |
| ">=", "!=", "=="                                | tests and identity tests              |
+-------------------------------------------------+---------------------------------------+
| "|"                                             | Bitwise OR                            |
+-------------------------------------------------+---------------------------------------+
| "^"                                             | Bitwise XOR                           |
+-------------------------------------------------+---------------------------------------+
| "&"                                             | Bitwise AND                           |
+-------------------------------------------------+---------------------------------------+
| "<<", ">>"                                      | Shifts                                |
+-------------------------------------------------+---------------------------------------+
| "+", "-"                                        | Addition and subtraction              |
+-------------------------------------------------+---------------------------------------+
| "*", "@", "/", "//", "%"                        | Multiplication, matrix                |
|                                                 | multiplication, division, floor       |
|                                                 | division, remainder [5]               |
+-------------------------------------------------+---------------------------------------+
| "+x", "-x", "~x"                                | Positive, negative, bitwise NOT       |
+-------------------------------------------------+---------------------------------------+
| "**"                                            | Exponentiation [6]                    |
+-------------------------------------------------+---------------------------------------+
| "await" "x"                                     | Await expression                      |
+-------------------------------------------------+---------------------------------------+
| "x[index]", "x[index:index]",                   | Subscription, slicing, call,          |
| "x(arguments...)", "x.attribute"                | attribute reference                   |
+-------------------------------------------------+---------------------------------------+
| "(expressions...)",  "[expressions...]", "{key: | Binding or parenthesized expression,  |
| value...}", "{expressions...}"                  | list display, dictionary display, set |
|                                                 | display                               |
+-------------------------------------------------+---------------------------------------+

-[ Footnotes ]-

[1] While "abs(x%y) < abs(y)" is true mathematically, for floats it
    may not be true numerically due to roundoff.  For example, and
    assuming a platform on which a Python float is an IEEE 754 double-
    precision number, in order that "-1e-100 % 1e100" have the same
    sign as "1e100", the computed result is "-1e-100 + 1e100", which
    is numerically exactly equal to "1e100".  The function
    "math.fmod()" returns a result whose sign matches the sign of the
    first argument instead, and so returns "-1e-100" in this case.
    Which approach is more appropriate depends on the application.

[2] If x is very close to an exact integer multiple of y, it’s
    possible for "x//y" to be one larger than "(x-x%y)//y" due to
    rounding.  In such cases, Python returns the latter result, in
    order to preserve that "divmod(x,y)[0] * y + x % y" be very close
    to "x".

[3] The Unicode standard distinguishes between *code points* (e.g.
    U+0041) and *abstract characters* (e.g. “LATIN CAPITAL LETTER A”).
    While most abstract characters in Unicode are only represented
    using one code point, there is a number of abstract characters
    that can in addition be represented using a sequence of more than
    one code point.  For example, the abstract character “LATIN
    CAPITAL LETTER C WITH CEDILLA” can be represented as a single
    *precomposed character* at code position U+00C7, or as a sequence
    of a *base character* at code position U+0043 (LATIN CAPITAL
    LETTER C), followed by a *combining character* at code position
    U+0327 (COMBINING CEDILLA).

    The comparison operators on strings compare at the level of
    Unicode code points. This may be counter-intuitive to humans.  For
    example, ""\u00C7" == "\u0043\u0327"" is "False", even though both
    strings represent the same abstract character “LATIN CAPITAL
    LETTER C WITH CEDILLA”.

    To compare strings at the level of abstract characters (that is,
    in a way intuitive to humans), use "unicodedata.normalize()".

[4] Due to automatic garbage-collection, free lists, and the dynamic
    nature of descriptors, you may notice seemingly unusual behaviour
    in certain uses of the "is" operator, like those involving
    comparisons between instance methods, or constants.  Check their
    documentation for more info.

[5] The "%" operator is also used for string formatting; the same
    precedence applies.

[6] The power operator "**" binds less tightly than an arithmetic or
    bitwise unary operator on its right, that is, "2**-1" is "0.5".
uwThe "pass" statement
********************

   pass_stmt ::= "pass"

"pass" is a null operation — when it is executed, nothing happens. It
is useful as a placeholder when a statement is required syntactically,
but no code needs to be executed, for example:

   def f(arg): pass    # a function that does nothing (yet)

   class C: pass       # a class with no methods (yet)
a�The power operator
******************

The power operator binds more tightly than unary operators on its
left; it binds less tightly than unary operators on its right.  The
syntax is:

   power ::= (await_expr | primary) ["**" u_expr]

Thus, in an unparenthesized sequence of power and unary operators, the
operators are evaluated from right to left (this does not constrain
the evaluation order for the operands): "-1**2" results in "-1".

The power operator has the same semantics as the built-in "pow()"
function, when called with two arguments: it yields its left argument
raised to the power of its right argument.  The numeric arguments are
first converted to a common type, and the result is of that type.

For int operands, the result has the same type as the operands unless
the second argument is negative; in that case, all arguments are
converted to float and a float result is delivered. For example,
"10**2" returns "100", but "10**-2" returns "0.01".

Raising "0.0" to a negative power results in a "ZeroDivisionError".
Raising a negative number to a fractional power results in a "complex"
number. (In earlier versions it raised a "ValueError".)
uJ
The "raise" statement
*********************

   raise_stmt ::= "raise" [expression ["from" expression]]

If no expressions are present, "raise" re-raises the last exception
that was active in the current scope.  If no exception is active in
the current scope, a "RuntimeError" exception is raised indicating
that this is an error.

Otherwise, "raise" evaluates the first expression as the exception
object.  It must be either a subclass or an instance of
"BaseException". If it is a class, the exception instance will be
obtained when needed by instantiating the class with no arguments.

The *type* of the exception is the exception instance’s class, the
*value* is the instance itself.

A traceback object is normally created automatically when an exception
is raised and attached to it as the "__traceback__" attribute, which
is writable. You can create an exception and set your own traceback in
one step using the "with_traceback()" exception method (which returns
the same exception instance, with its traceback set to its argument),
like so:

   raise Exception("foo occurred").with_traceback(tracebackobj)

The "from" clause is used for exception chaining: if given, the second
*expression* must be another exception class or instance. If the
second expression is an exception instance, it will be attached to the
raised exception as the "__cause__" attribute (which is writable). If
the expression is an exception class, the class will be instantiated
and the resulting exception instance will be attached to the raised
exception as the "__cause__" attribute. If the raised exception is not
handled, both exceptions will be printed:

   >>> try:
   ...     print(1 / 0)
   ... except Exception as exc:
   ...     raise RuntimeError("Something bad happened") from exc
   ...
   Traceback (most recent call last):
     File "<stdin>", line 2, in <module>
   ZeroDivisionError: division by zero

   The above exception was the direct cause of the following exception:

   Traceback (most recent call last):
     File "<stdin>", line 4, in <module>
   RuntimeError: Something bad happened

A similar mechanism works implicitly if an exception is raised inside
an exception handler or a "finally" clause: the previous exception is
then attached as the new exception’s "__context__" attribute:

   >>> try:
   ...     print(1 / 0)
   ... except:
   ...     raise RuntimeError("Something bad happened")
   ...
   Traceback (most recent call last):
     File "<stdin>", line 2, in <module>
   ZeroDivisionError: division by zero

   During handling of the above exception, another exception occurred:

   Traceback (most recent call last):
     File "<stdin>", line 4, in <module>
   RuntimeError: Something bad happened

Exception chaining can be explicitly suppressed by specifying "None"
in the "from" clause:

   >>> try:
   ...     print(1 / 0)
   ... except:
   ...     raise RuntimeError("Something bad happened") from None
   ...
   Traceback (most recent call last):
     File "<stdin>", line 4, in <module>
   RuntimeError: Something bad happened

Additional information on exceptions can be found in section
Exceptions, and information about handling exceptions is in section
The try statement.

Changed in version 3.3: "None" is now permitted as "Y" in "raise X
from Y".

New in version 3.3: The "__suppress_context__" attribute to suppress
automatic display of the exception context.
aThe "return" statement
**********************

   return_stmt ::= "return" [expression_list]

"return" may only occur syntactically nested in a function definition,
not within a nested class definition.

If an expression list is present, it is evaluated, else "None" is
substituted.

"return" leaves the current function call with the expression list (or
"None") as return value.

When "return" passes control out of a "try" statement with a "finally"
clause, that "finally" clause is executed before really leaving the
function.

In a generator function, the "return" statement indicates that the
generator is done and will cause "StopIteration" to be raised. The
returned value (if any) is used as an argument to construct
"StopIteration" and becomes the "StopIteration.value" attribute.

In an asynchronous generator function, an empty "return" statement
indicates that the asynchronous generator is done and will cause
"StopAsyncIteration" to be raised.  A non-empty "return" statement is
a syntax error in an asynchronous generator function.
u�Emulating container types
*************************

The following methods can be defined to implement container objects.
Containers usually are sequences (such as lists or tuples) or mappings
(like dictionaries), but can represent other containers as well.  The
first set of methods is used either to emulate a sequence or to
emulate a mapping; the difference is that for a sequence, the
allowable keys should be the integers *k* for which "0 <= k < N" where
*N* is the length of the sequence, or slice objects, which define a
range of items.  It is also recommended that mappings provide the
methods "keys()", "values()", "items()", "get()", "clear()",
"setdefault()", "pop()", "popitem()", "copy()", and "update()"
behaving similar to those for Python’s standard dictionary objects.
The "collections.abc" module provides a "MutableMapping" abstract base
class to help create those methods from a base set of "__getitem__()",
"__setitem__()", "__delitem__()", and "keys()". Mutable sequences
should provide methods "append()", "count()", "index()", "extend()",
"insert()", "pop()", "remove()", "reverse()" and "sort()", like Python
standard list objects.  Finally, sequence types should implement
addition (meaning concatenation) and multiplication (meaning
repetition) by defining the methods "__add__()", "__radd__()",
"__iadd__()", "__mul__()", "__rmul__()" and "__imul__()" described
below; they should not define other numerical operators.  It is
recommended that both mappings and sequences implement the
"__contains__()" method to allow efficient use of the "in" operator;
for mappings, "in" should search the mapping’s keys; for sequences, it
should search through the values.  It is further recommended that both
mappings and sequences implement the "__iter__()" method to allow
efficient iteration through the container; for mappings, "__iter__()"
should iterate through the object’s keys; for sequences, it should
iterate through the values.

object.__len__(self)

   Called to implement the built-in function "len()".  Should return
   the length of the object, an integer ">=" 0.  Also, an object that
   doesn’t define a "__bool__()" method and whose "__len__()" method
   returns zero is considered to be false in a Boolean context.

   **CPython implementation detail:** In CPython, the length is
   required to be at most "sys.maxsize". If the length is larger than
   "sys.maxsize" some features (such as "len()") may raise
   "OverflowError".  To prevent raising "OverflowError" by truth value
   testing, an object must define a "__bool__()" method.

object.__length_hint__(self)

   Called to implement "operator.length_hint()". Should return an
   estimated length for the object (which may be greater or less than
   the actual length). The length must be an integer ">=" 0. The
   return value may also be "NotImplemented", which is treated the
   same as if the "__length_hint__" method didn’t exist at all. This
   method is purely an optimization and is never required for
   correctness.

   New in version 3.4.

Note:

  Slicing is done exclusively with the following three methods.  A
  call like

     a[1:2] = b

  is translated to

     a[slice(1, 2, None)] = b

  and so forth.  Missing slice items are always filled in with "None".

object.__getitem__(self, key)

   Called to implement evaluation of "self[key]". For sequence types,
   the accepted keys should be integers and slice objects.  Note that
   the special interpretation of negative indexes (if the class wishes
   to emulate a sequence type) is up to the "__getitem__()" method. If
   *key* is of an inappropriate type, "TypeError" may be raised; if of
   a value outside the set of indexes for the sequence (after any
   special interpretation of negative values), "IndexError" should be
   raised. For mapping types, if *key* is missing (not in the
   container), "KeyError" should be raised.

   Note:

     "for" loops expect that an "IndexError" will be raised for
     illegal indexes to allow proper detection of the end of the
     sequence.

object.__setitem__(self, key, value)

   Called to implement assignment to "self[key]".  Same note as for
   "__getitem__()".  This should only be implemented for mappings if
   the objects support changes to the values for keys, or if new keys
   can be added, or for sequences if elements can be replaced.  The
   same exceptions should be raised for improper *key* values as for
   the "__getitem__()" method.

object.__delitem__(self, key)

   Called to implement deletion of "self[key]".  Same note as for
   "__getitem__()".  This should only be implemented for mappings if
   the objects support removal of keys, or for sequences if elements
   can be removed from the sequence.  The same exceptions should be
   raised for improper *key* values as for the "__getitem__()" method.

object.__missing__(self, key)

   Called by "dict"."__getitem__()" to implement "self[key]" for dict
   subclasses when key is not in the dictionary.

object.__iter__(self)

   This method is called when an iterator is required for a container.
   This method should return a new iterator object that can iterate
   over all the objects in the container.  For mappings, it should
   iterate over the keys of the container.

   Iterator objects also need to implement this method; they are
   required to return themselves.  For more information on iterator
   objects, see Iterator Types.

object.__reversed__(self)

   Called (if present) by the "reversed()" built-in to implement
   reverse iteration.  It should return a new iterator object that
   iterates over all the objects in the container in reverse order.

   If the "__reversed__()" method is not provided, the "reversed()"
   built-in will fall back to using the sequence protocol ("__len__()"
   and "__getitem__()").  Objects that support the sequence protocol
   should only provide "__reversed__()" if they can provide an
   implementation that is more efficient than the one provided by
   "reversed()".

The membership test operators ("in" and "not in") are normally
implemented as an iteration through a container. However, container
objects can supply the following special method with a more efficient
implementation, which also does not require the object be iterable.

object.__contains__(self, item)

   Called to implement membership test operators.  Should return true
   if *item* is in *self*, false otherwise.  For mapping objects, this
   should consider the keys of the mapping rather than the values or
   the key-item pairs.

   For objects that don’t define "__contains__()", the membership test
   first tries iteration via "__iter__()", then the old sequence
   iteration protocol via "__getitem__()", see this section in the
   language reference.
a�Shifting operations
*******************

The shifting operations have lower priority than the arithmetic
operations:

   shift_expr ::= a_expr | shift_expr ("<<" | ">>") a_expr

These operators accept integers as arguments.  They shift the first
argument to the left or right by the number of bits given by the
second argument.

A right shift by *n* bits is defined as floor division by "pow(2,n)".
A left shift by *n* bits is defined as multiplication with "pow(2,n)".
a�Slicings
********

A slicing selects a range of items in a sequence object (e.g., a
string, tuple or list).  Slicings may be used as expressions or as
targets in assignment or "del" statements.  The syntax for a slicing:

   slicing      ::= primary "[" slice_list "]"
   slice_list   ::= slice_item ("," slice_item)* [","]
   slice_item   ::= expression | proper_slice
   proper_slice ::= [lower_bound] ":" [upper_bound] [ ":" [stride] ]
   lower_bound  ::= expression
   upper_bound  ::= expression
   stride       ::= expression

There is ambiguity in the formal syntax here: anything that looks like
an expression list also looks like a slice list, so any subscription
can be interpreted as a slicing.  Rather than further complicating the
syntax, this is disambiguated by defining that in this case the
interpretation as a subscription takes priority over the
interpretation as a slicing (this is the case if the slice list
contains no proper slice).

The semantics for a slicing are as follows.  The primary is indexed
(using the same "__getitem__()" method as normal subscription) with a
key that is constructed from the slice list, as follows.  If the slice
list contains at least one comma, the key is a tuple containing the
conversion of the slice items; otherwise, the conversion of the lone
slice item is the key.  The conversion of a slice item that is an
expression is that expression.  The conversion of a proper slice is a
slice object (see section The standard type hierarchy) whose "start",
"stop" and "step" attributes are the values of the expressions given
as lower bound, upper bound and stride, respectively, substituting
"None" for missing expressions.
uSpecial Attributes
******************

The implementation adds a few special read-only attributes to several
object types, where they are relevant.  Some of these are not reported
by the "dir()" built-in function.

object.__dict__

   A dictionary or other mapping object used to store an object’s
   (writable) attributes.

instance.__class__

   The class to which a class instance belongs.

class.__bases__

   The tuple of base classes of a class object.

definition.__name__

   The name of the class, function, method, descriptor, or generator
   instance.

definition.__qualname__

   The *qualified name* of the class, function, method, descriptor, or
   generator instance.

   New in version 3.3.

class.__mro__

   This attribute is a tuple of classes that are considered when
   looking for base classes during method resolution.

class.mro()

   This method can be overridden by a metaclass to customize the
   method resolution order for its instances.  It is called at class
   instantiation, and its result is stored in "__mro__".

class.__subclasses__()

   Each class keeps a list of weak references to its immediate
   subclasses.  This method returns a list of all those references
   still alive. Example:

      >>> int.__subclasses__()
      [<class 'bool'>]
u��Special method names
********************

A class can implement certain operations that are invoked by special
syntax (such as arithmetic operations or subscripting and slicing) by
defining methods with special names. This is Python’s approach to
*operator overloading*, allowing classes to define their own behavior
with respect to language operators.  For instance, if a class defines
a method named "__getitem__()", and "x" is an instance of this class,
then "x[i]" is roughly equivalent to "type(x).__getitem__(x, i)".
Except where mentioned, attempts to execute an operation raise an
exception when no appropriate method is defined (typically
"AttributeError" or "TypeError").

Setting a special method to "None" indicates that the corresponding
operation is not available.  For example, if a class sets "__iter__()"
to "None", the class is not iterable, so calling "iter()" on its
instances will raise a "TypeError" (without falling back to
"__getitem__()"). [2]

When implementing a class that emulates any built-in type, it is
important that the emulation only be implemented to the degree that it
makes sense for the object being modelled.  For example, some
sequences may work well with retrieval of individual elements, but
extracting a slice may not make sense.  (One example of this is the
"NodeList" interface in the W3C’s Document Object Model.)


Basic customization
===================

object.__new__(cls[, ...])

   Called to create a new instance of class *cls*.  "__new__()" is a
   static method (special-cased so you need not declare it as such)
   that takes the class of which an instance was requested as its
   first argument.  The remaining arguments are those passed to the
   object constructor expression (the call to the class).  The return
   value of "__new__()" should be the new object instance (usually an
   instance of *cls*).

   Typical implementations create a new instance of the class by
   invoking the superclass’s "__new__()" method using
   "super().__new__(cls[, ...])" with appropriate arguments and then
   modifying the newly-created instance as necessary before returning
   it.

   If "__new__()" is invoked during object construction and it returns
   an instance of *cls*, then the new instance’s "__init__()" method
   will be invoked like "__init__(self[, ...])", where *self* is the
   new instance and the remaining arguments are the same as were
   passed to the object constructor.

   If "__new__()" does not return an instance of *cls*, then the new
   instance’s "__init__()" method will not be invoked.

   "__new__()" is intended mainly to allow subclasses of immutable
   types (like int, str, or tuple) to customize instance creation.  It
   is also commonly overridden in custom metaclasses in order to
   customize class creation.

object.__init__(self[, ...])

   Called after the instance has been created (by "__new__()"), but
   before it is returned to the caller.  The arguments are those
   passed to the class constructor expression.  If a base class has an
   "__init__()" method, the derived class’s "__init__()" method, if
   any, must explicitly call it to ensure proper initialization of the
   base class part of the instance; for example:
   "super().__init__([args...])".

   Because "__new__()" and "__init__()" work together in constructing
   objects ("__new__()" to create it, and "__init__()" to customize
   it), no non-"None" value may be returned by "__init__()"; doing so
   will cause a "TypeError" to be raised at runtime.

object.__del__(self)

   Called when the instance is about to be destroyed.  This is also
   called a finalizer or (improperly) a destructor.  If a base class
   has a "__del__()" method, the derived class’s "__del__()" method,
   if any, must explicitly call it to ensure proper deletion of the
   base class part of the instance.

   It is possible (though not recommended!) for the "__del__()" method
   to postpone destruction of the instance by creating a new reference
   to it.  This is called object *resurrection*.  It is
   implementation-dependent whether "__del__()" is called a second
   time when a resurrected object is about to be destroyed; the
   current *CPython* implementation only calls it once.

   It is not guaranteed that "__del__()" methods are called for
   objects that still exist when the interpreter exits.

   Note:

     "del x" doesn’t directly call "x.__del__()" — the former
     decrements the reference count for "x" by one, and the latter is
     only called when "x"’s reference count reaches zero.

   **CPython implementation detail:** It is possible for a reference
   cycle to prevent the reference count of an object from going to
   zero.  In this case, the cycle will be later detected and deleted
   by the *cyclic garbage collector*.  A common cause of reference
   cycles is when an exception has been caught in a local variable.
   The frame’s locals then reference the exception, which references
   its own traceback, which references the locals of all frames caught
   in the traceback.

   See also: Documentation for the "gc" module.

   Warning:

     Due to the precarious circumstances under which "__del__()"
     methods are invoked, exceptions that occur during their execution
     are ignored, and a warning is printed to "sys.stderr" instead.
     In particular:

     * "__del__()" can be invoked when arbitrary code is being
       executed, including from any arbitrary thread.  If "__del__()"
       needs to take a lock or invoke any other blocking resource, it
       may deadlock as the resource may already be taken by the code
       that gets interrupted to execute "__del__()".

     * "__del__()" can be executed during interpreter shutdown.  As a
       consequence, the global variables it needs to access (including
       other modules) may already have been deleted or set to "None".
       Python guarantees that globals whose name begins with a single
       underscore are deleted from their module before other globals
       are deleted; if no other references to such globals exist, this
       may help in assuring that imported modules are still available
       at the time when the "__del__()" method is called.

object.__repr__(self)

   Called by the "repr()" built-in function to compute the “official”
   string representation of an object.  If at all possible, this
   should look like a valid Python expression that could be used to
   recreate an object with the same value (given an appropriate
   environment).  If this is not possible, a string of the form
   "<...some useful description...>" should be returned. The return
   value must be a string object. If a class defines "__repr__()" but
   not "__str__()", then "__repr__()" is also used when an “informal”
   string representation of instances of that class is required.

   This is typically used for debugging, so it is important that the
   representation is information-rich and unambiguous.

object.__str__(self)

   Called by "str(object)" and the built-in functions "format()" and
   "print()" to compute the “informal” or nicely printable string
   representation of an object.  The return value must be a string
   object.

   This method differs from "object.__repr__()" in that there is no
   expectation that "__str__()" return a valid Python expression: a
   more convenient or concise representation can be used.

   The default implementation defined by the built-in type "object"
   calls "object.__repr__()".

object.__bytes__(self)

   Called by bytes to compute a byte-string representation of an
   object. This should return a "bytes" object.

object.__format__(self, format_spec)

   Called by the "format()" built-in function, and by extension,
   evaluation of formatted string literals and the "str.format()"
   method, to produce a “formatted” string representation of an
   object. The *format_spec* argument is a string that contains a
   description of the formatting options desired. The interpretation
   of the *format_spec* argument is up to the type implementing
   "__format__()", however most classes will either delegate
   formatting to one of the built-in types, or use a similar
   formatting option syntax.

   See Format Specification Mini-Language for a description of the
   standard formatting syntax.

   The return value must be a string object.

   Changed in version 3.4: The __format__ method of "object" itself
   raises a "TypeError" if passed any non-empty string.

   Changed in version 3.7: "object.__format__(x, '')" is now
   equivalent to "str(x)" rather than "format(str(self), '')".

object.__lt__(self, other)
object.__le__(self, other)
object.__eq__(self, other)
object.__ne__(self, other)
object.__gt__(self, other)
object.__ge__(self, other)

   These are the so-called “rich comparison” methods. The
   correspondence between operator symbols and method names is as
   follows: "x<y" calls "x.__lt__(y)", "x<=y" calls "x.__le__(y)",
   "x==y" calls "x.__eq__(y)", "x!=y" calls "x.__ne__(y)", "x>y" calls
   "x.__gt__(y)", and "x>=y" calls "x.__ge__(y)".

   A rich comparison method may return the singleton "NotImplemented"
   if it does not implement the operation for a given pair of
   arguments. By convention, "False" and "True" are returned for a
   successful comparison. However, these methods can return any value,
   so if the comparison operator is used in a Boolean context (e.g.,
   in the condition of an "if" statement), Python will call "bool()"
   on the value to determine if the result is true or false.

   By default, "object" implements "__eq__()" by using "is", returning
   "NotImplemented" in the case of a false comparison: "True if x is y
   else NotImplemented". For "__ne__()", by default it delegates to
   "__eq__()" and inverts the result unless it is "NotImplemented".
   There are no other implied relationships among the comparison
   operators or default implementations; for example, the truth of
   "(x<y or x==y)" does not imply "x<=y". To automatically generate
   ordering operations from a single root operation, see
   "functools.total_ordering()".

   See the paragraph on "__hash__()" for some important notes on
   creating *hashable* objects which support custom comparison
   operations and are usable as dictionary keys.

   There are no swapped-argument versions of these methods (to be used
   when the left argument does not support the operation but the right
   argument does); rather, "__lt__()" and "__gt__()" are each other’s
   reflection, "__le__()" and "__ge__()" are each other’s reflection,
   and "__eq__()" and "__ne__()" are their own reflection. If the
   operands are of different types, and right operand’s type is a
   direct or indirect subclass of the left operand’s type, the
   reflected method of the right operand has priority, otherwise the
   left operand’s method has priority.  Virtual subclassing is not
   considered.

object.__hash__(self)

   Called by built-in function "hash()" and for operations on members
   of hashed collections including "set", "frozenset", and "dict".
   "__hash__()" should return an integer. The only required property
   is that objects which compare equal have the same hash value; it is
   advised to mix together the hash values of the components of the
   object that also play a part in comparison of objects by packing
   them into a tuple and hashing the tuple. Example:

      def __hash__(self):
          return hash((self.name, self.nick, self.color))

   Note:

     "hash()" truncates the value returned from an object’s custom
     "__hash__()" method to the size of a "Py_ssize_t".  This is
     typically 8 bytes on 64-bit builds and 4 bytes on 32-bit builds.
     If an object’s   "__hash__()" must interoperate on builds of
     different bit sizes, be sure to check the width on all supported
     builds.  An easy way to do this is with "python -c "import sys;
     print(sys.hash_info.width)"".

   If a class does not define an "__eq__()" method it should not
   define a "__hash__()" operation either; if it defines "__eq__()"
   but not "__hash__()", its instances will not be usable as items in
   hashable collections.  If a class defines mutable objects and
   implements an "__eq__()" method, it should not implement
   "__hash__()", since the implementation of hashable collections
   requires that a key’s hash value is immutable (if the object’s hash
   value changes, it will be in the wrong hash bucket).

   User-defined classes have "__eq__()" and "__hash__()" methods by
   default; with them, all objects compare unequal (except with
   themselves) and "x.__hash__()" returns an appropriate value such
   that "x == y" implies both that "x is y" and "hash(x) == hash(y)".

   A class that overrides "__eq__()" and does not define "__hash__()"
   will have its "__hash__()" implicitly set to "None".  When the
   "__hash__()" method of a class is "None", instances of the class
   will raise an appropriate "TypeError" when a program attempts to
   retrieve their hash value, and will also be correctly identified as
   unhashable when checking "isinstance(obj,
   collections.abc.Hashable)".

   If a class that overrides "__eq__()" needs to retain the
   implementation of "__hash__()" from a parent class, the interpreter
   must be told this explicitly by setting "__hash__ =
   <ParentClass>.__hash__".

   If a class that does not override "__eq__()" wishes to suppress
   hash support, it should include "__hash__ = None" in the class
   definition. A class which defines its own "__hash__()" that
   explicitly raises a "TypeError" would be incorrectly identified as
   hashable by an "isinstance(obj, collections.abc.Hashable)" call.

   Note:

     By default, the "__hash__()" values of str and bytes objects are
     “salted” with an unpredictable random value.  Although they
     remain constant within an individual Python process, they are not
     predictable between repeated invocations of Python.This is
     intended to provide protection against a denial-of-service caused
     by carefully-chosen inputs that exploit the worst case
     performance of a dict insertion, O(n^2) complexity.  See
     http://www.ocert.org/advisories/ocert-2011-003.html for
     details.Changing hash values affects the iteration order of sets.
     Python has never made guarantees about this ordering (and it
     typically varies between 32-bit and 64-bit builds).See also
     "PYTHONHASHSEED".

   Changed in version 3.3: Hash randomization is enabled by default.

object.__bool__(self)

   Called to implement truth value testing and the built-in operation
   "bool()"; should return "False" or "True".  When this method is not
   defined, "__len__()" is called, if it is defined, and the object is
   considered true if its result is nonzero.  If a class defines
   neither "__len__()" nor "__bool__()", all its instances are
   considered true.


Customizing attribute access
============================

The following methods can be defined to customize the meaning of
attribute access (use of, assignment to, or deletion of "x.name") for
class instances.

object.__getattr__(self, name)

   Called when the default attribute access fails with an
   "AttributeError" (either "__getattribute__()" raises an
   "AttributeError" because *name* is not an instance attribute or an
   attribute in the class tree for "self"; or "__get__()" of a *name*
   property raises "AttributeError").  This method should either
   return the (computed) attribute value or raise an "AttributeError"
   exception.

   Note that if the attribute is found through the normal mechanism,
   "__getattr__()" is not called.  (This is an intentional asymmetry
   between "__getattr__()" and "__setattr__()".) This is done both for
   efficiency reasons and because otherwise "__getattr__()" would have
   no way to access other attributes of the instance.  Note that at
   least for instance variables, you can fake total control by not
   inserting any values in the instance attribute dictionary (but
   instead inserting them in another object).  See the
   "__getattribute__()" method below for a way to actually get total
   control over attribute access.

object.__getattribute__(self, name)

   Called unconditionally to implement attribute accesses for
   instances of the class. If the class also defines "__getattr__()",
   the latter will not be called unless "__getattribute__()" either
   calls it explicitly or raises an "AttributeError". This method
   should return the (computed) attribute value or raise an
   "AttributeError" exception. In order to avoid infinite recursion in
   this method, its implementation should always call the base class
   method with the same name to access any attributes it needs, for
   example, "object.__getattribute__(self, name)".

   Note:

     This method may still be bypassed when looking up special methods
     as the result of implicit invocation via language syntax or
     built-in functions. See Special method lookup.

   For certain sensitive attribute accesses, raises an auditing event
   "object.__getattr__" with arguments "obj" and "name".

object.__setattr__(self, name, value)

   Called when an attribute assignment is attempted.  This is called
   instead of the normal mechanism (i.e. store the value in the
   instance dictionary). *name* is the attribute name, *value* is the
   value to be assigned to it.

   If "__setattr__()" wants to assign to an instance attribute, it
   should call the base class method with the same name, for example,
   "object.__setattr__(self, name, value)".

   For certain sensitive attribute assignments, raises an auditing
   event "object.__setattr__" with arguments "obj", "name", "value".

object.__delattr__(self, name)

   Like "__setattr__()" but for attribute deletion instead of
   assignment.  This should only be implemented if "del obj.name" is
   meaningful for the object.

   For certain sensitive attribute deletions, raises an auditing event
   "object.__delattr__" with arguments "obj" and "name".

object.__dir__(self)

   Called when "dir()" is called on the object. A sequence must be
   returned. "dir()" converts the returned sequence to a list and
   sorts it.


Customizing module attribute access
-----------------------------------

Special names "__getattr__" and "__dir__" can be also used to
customize access to module attributes. The "__getattr__" function at
the module level should accept one argument which is the name of an
attribute and return the computed value or raise an "AttributeError".
If an attribute is not found on a module object through the normal
lookup, i.e. "object.__getattribute__()", then "__getattr__" is
searched in the module "__dict__" before raising an "AttributeError".
If found, it is called with the attribute name and the result is
returned.

The "__dir__" function should accept no arguments, and return a
sequence of strings that represents the names accessible on module. If
present, this function overrides the standard "dir()" search on a
module.

For a more fine grained customization of the module behavior (setting
attributes, properties, etc.), one can set the "__class__" attribute
of a module object to a subclass of "types.ModuleType". For example:

   import sys
   from types import ModuleType

   class VerboseModule(ModuleType):
       def __repr__(self):
           return f'Verbose {self.__name__}'

       def __setattr__(self, attr, value):
           print(f'Setting {attr}...')
           super().__setattr__(attr, value)

   sys.modules[__name__].__class__ = VerboseModule

Note:

  Defining module "__getattr__" and setting module "__class__" only
  affect lookups made using the attribute access syntax – directly
  accessing the module globals (whether by code within the module, or
  via a reference to the module’s globals dictionary) is unaffected.

Changed in version 3.5: "__class__" module attribute is now writable.

New in version 3.7: "__getattr__" and "__dir__" module attributes.

See also:

  **PEP 562** - Module __getattr__ and __dir__
     Describes the "__getattr__" and "__dir__" functions on modules.


Implementing Descriptors
------------------------

The following methods only apply when an instance of the class
containing the method (a so-called *descriptor* class) appears in an
*owner* class (the descriptor must be in either the owner’s class
dictionary or in the class dictionary for one of its parents).  In the
examples below, “the attribute” refers to the attribute whose name is
the key of the property in the owner class’ "__dict__".

object.__get__(self, instance, owner=None)

   Called to get the attribute of the owner class (class attribute
   access) or of an instance of that class (instance attribute
   access). The optional *owner* argument is the owner class, while
   *instance* is the instance that the attribute was accessed through,
   or "None" when the attribute is accessed through the *owner*.

   This method should return the computed attribute value or raise an
   "AttributeError" exception.

   **PEP 252** specifies that "__get__()" is callable with one or two
   arguments.  Python’s own built-in descriptors support this
   specification; however, it is likely that some third-party tools
   have descriptors that require both arguments.  Python’s own
   "__getattribute__()" implementation always passes in both arguments
   whether they are required or not.

object.__set__(self, instance, value)

   Called to set the attribute on an instance *instance* of the owner
   class to a new value, *value*.

   Note, adding "__set__()" or "__delete__()" changes the kind of
   descriptor to a “data descriptor”.  See Invoking Descriptors for
   more details.

object.__delete__(self, instance)

   Called to delete the attribute on an instance *instance* of the
   owner class.

object.__set_name__(self, owner, name)

   Called at the time the owning class *owner* is created. The
   descriptor has been assigned to *name*.

   Note:

     "__set_name__()" is only called implicitly as part of the "type"
     constructor, so it will need to be called explicitly with the
     appropriate parameters when a descriptor is added to a class
     after initial creation:

        class A:
           pass
        descr = custom_descriptor()
        A.attr = descr
        descr.__set_name__(A, 'attr')

     See Creating the class object for more details.

   New in version 3.6.

The attribute "__objclass__" is interpreted by the "inspect" module as
specifying the class where this object was defined (setting this
appropriately can assist in runtime introspection of dynamic class
attributes). For callables, it may indicate that an instance of the
given type (or a subclass) is expected or required as the first
positional argument (for example, CPython sets this attribute for
unbound methods that are implemented in C).


Invoking Descriptors
--------------------

In general, a descriptor is an object attribute with “binding
behavior”, one whose attribute access has been overridden by methods
in the descriptor protocol:  "__get__()", "__set__()", and
"__delete__()". If any of those methods are defined for an object, it
is said to be a descriptor.

The default behavior for attribute access is to get, set, or delete
the attribute from an object’s dictionary. For instance, "a.x" has a
lookup chain starting with "a.__dict__['x']", then
"type(a).__dict__['x']", and continuing through the base classes of
"type(a)" excluding metaclasses.

However, if the looked-up value is an object defining one of the
descriptor methods, then Python may override the default behavior and
invoke the descriptor method instead.  Where this occurs in the
precedence chain depends on which descriptor methods were defined and
how they were called.

The starting point for descriptor invocation is a binding, "a.x". How
the arguments are assembled depends on "a":

Direct Call
   The simplest and least common call is when user code directly
   invokes a descriptor method:    "x.__get__(a)".

Instance Binding
   If binding to an object instance, "a.x" is transformed into the
   call: "type(a).__dict__['x'].__get__(a, type(a))".

Class Binding
   If binding to a class, "A.x" is transformed into the call:
   "A.__dict__['x'].__get__(None, A)".

Super Binding
   If "a" is an instance of "super", then the binding "super(B,
   obj).m()" searches "obj.__class__.__mro__" for the base class "A"
   immediately preceding "B" and then invokes the descriptor with the
   call: "A.__dict__['m'].__get__(obj, obj.__class__)".

For instance bindings, the precedence of descriptor invocation depends
on which descriptor methods are defined.  A descriptor can define any
combination of "__get__()", "__set__()" and "__delete__()".  If it
does not define "__get__()", then accessing the attribute will return
the descriptor object itself unless there is a value in the object’s
instance dictionary.  If the descriptor defines "__set__()" and/or
"__delete__()", it is a data descriptor; if it defines neither, it is
a non-data descriptor.  Normally, data descriptors define both
"__get__()" and "__set__()", while non-data descriptors have just the
"__get__()" method.  Data descriptors with "__set__()" and "__get__()"
defined always override a redefinition in an instance dictionary.  In
contrast, non-data descriptors can be overridden by instances.

Python methods (including "staticmethod()" and "classmethod()") are
implemented as non-data descriptors.  Accordingly, instances can
redefine and override methods.  This allows individual instances to
acquire behaviors that differ from other instances of the same class.

The "property()" function is implemented as a data descriptor.
Accordingly, instances cannot override the behavior of a property.


__slots__
---------

*__slots__* allow us to explicitly declare data members (like
properties) and deny the creation of *__dict__* and *__weakref__*
(unless explicitly declared in *__slots__* or available in a parent.)

The space saved over using *__dict__* can be significant. Attribute
lookup speed can be significantly improved as well.

object.__slots__

   This class variable can be assigned a string, iterable, or sequence
   of strings with variable names used by instances.  *__slots__*
   reserves space for the declared variables and prevents the
   automatic creation of *__dict__* and *__weakref__* for each
   instance.


Notes on using *__slots__*
~~~~~~~~~~~~~~~~~~~~~~~~~~

* When inheriting from a class without *__slots__*, the *__dict__* and
  *__weakref__* attribute of the instances will always be accessible.

* Without a *__dict__* variable, instances cannot be assigned new
  variables not listed in the *__slots__* definition.  Attempts to
  assign to an unlisted variable name raises "AttributeError". If
  dynamic assignment of new variables is desired, then add
  "'__dict__'" to the sequence of strings in the *__slots__*
  declaration.

* Without a *__weakref__* variable for each instance, classes defining
  *__slots__* do not support weak references to its instances. If weak
  reference support is needed, then add "'__weakref__'" to the
  sequence of strings in the *__slots__* declaration.

* *__slots__* are implemented at the class level by creating
  descriptors (Implementing Descriptors) for each variable name.  As a
  result, class attributes cannot be used to set default values for
  instance variables defined by *__slots__*; otherwise, the class
  attribute would overwrite the descriptor assignment.

* The action of a *__slots__* declaration is not limited to the class
  where it is defined.  *__slots__* declared in parents are available
  in child classes. However, child subclasses will get a *__dict__*
  and *__weakref__* unless they also define *__slots__* (which should
  only contain names of any *additional* slots).

* If a class defines a slot also defined in a base class, the instance
  variable defined by the base class slot is inaccessible (except by
  retrieving its descriptor directly from the base class). This
  renders the meaning of the program undefined.  In the future, a
  check may be added to prevent this.

* Nonempty *__slots__* does not work for classes derived from
  “variable-length” built-in types such as "int", "bytes" and "tuple".

* Any non-string iterable may be assigned to *__slots__*. Mappings may
  also be used; however, in the future, special meaning may be
  assigned to the values corresponding to each key.

* *__class__* assignment works only if both classes have the same
  *__slots__*.

* Multiple inheritance with multiple slotted parent classes can be
  used, but only one parent is allowed to have attributes created by
  slots (the other bases must have empty slot layouts) - violations
  raise "TypeError".

* If an iterator is used for *__slots__* then a descriptor is created
  for each of the iterator’s values. However, the *__slots__*
  attribute will be an empty iterator.


Customizing class creation
==========================

Whenever a class inherits from another class, *__init_subclass__* is
called on that class. This way, it is possible to write classes which
change the behavior of subclasses. This is closely related to class
decorators, but where class decorators only affect the specific class
they’re applied to, "__init_subclass__" solely applies to future
subclasses of the class defining the method.

classmethod object.__init_subclass__(cls)

   This method is called whenever the containing class is subclassed.
   *cls* is then the new subclass. If defined as a normal instance
   method, this method is implicitly converted to a class method.

   Keyword arguments which are given to a new class are passed to the
   parent’s class "__init_subclass__". For compatibility with other
   classes using "__init_subclass__", one should take out the needed
   keyword arguments and pass the others over to the base class, as
   in:

      class Philosopher:
          def __init_subclass__(cls, /, default_name, **kwargs):
              super().__init_subclass__(**kwargs)
              cls.default_name = default_name

      class AustralianPhilosopher(Philosopher, default_name="Bruce"):
          pass

   The default implementation "object.__init_subclass__" does nothing,
   but raises an error if it is called with any arguments.

   Note:

     The metaclass hint "metaclass" is consumed by the rest of the
     type machinery, and is never passed to "__init_subclass__"
     implementations. The actual metaclass (rather than the explicit
     hint) can be accessed as "type(cls)".

   New in version 3.6.


Metaclasses
-----------

By default, classes are constructed using "type()". The class body is
executed in a new namespace and the class name is bound locally to the
result of "type(name, bases, namespace)".

The class creation process can be customized by passing the
"metaclass" keyword argument in the class definition line, or by
inheriting from an existing class that included such an argument. In
the following example, both "MyClass" and "MySubclass" are instances
of "Meta":

   class Meta(type):
       pass

   class MyClass(metaclass=Meta):
       pass

   class MySubclass(MyClass):
       pass

Any other keyword arguments that are specified in the class definition
are passed through to all metaclass operations described below.

When a class definition is executed, the following steps occur:

* MRO entries are resolved;

* the appropriate metaclass is determined;

* the class namespace is prepared;

* the class body is executed;

* the class object is created.


Resolving MRO entries
---------------------

If a base that appears in class definition is not an instance of
"type", then an "__mro_entries__" method is searched on it. If found,
it is called with the original bases tuple. This method must return a
tuple of classes that will be used instead of this base. The tuple may
be empty, in such case the original base is ignored.

See also:

  **PEP 560** - Core support for typing module and generic types


Determining the appropriate metaclass
-------------------------------------

The appropriate metaclass for a class definition is determined as
follows:

* if no bases and no explicit metaclass are given, then "type()" is
  used;

* if an explicit metaclass is given and it is *not* an instance of
  "type()", then it is used directly as the metaclass;

* if an instance of "type()" is given as the explicit metaclass, or
  bases are defined, then the most derived metaclass is used.

The most derived metaclass is selected from the explicitly specified
metaclass (if any) and the metaclasses (i.e. "type(cls)") of all
specified base classes. The most derived metaclass is one which is a
subtype of *all* of these candidate metaclasses. If none of the
candidate metaclasses meets that criterion, then the class definition
will fail with "TypeError".


Preparing the class namespace
-----------------------------

Once the appropriate metaclass has been identified, then the class
namespace is prepared. If the metaclass has a "__prepare__" attribute,
it is called as "namespace = metaclass.__prepare__(name, bases,
**kwds)" (where the additional keyword arguments, if any, come from
the class definition). The "__prepare__" method should be implemented
as a "classmethod()". The namespace returned by "__prepare__" is
passed in to "__new__", but when the final class object is created the
namespace is copied into a new "dict".

If the metaclass has no "__prepare__" attribute, then the class
namespace is initialised as an empty ordered mapping.

See also:

  **PEP 3115** - Metaclasses in Python 3000
     Introduced the "__prepare__" namespace hook


Executing the class body
------------------------

The class body is executed (approximately) as "exec(body, globals(),
namespace)". The key difference from a normal call to "exec()" is that
lexical scoping allows the class body (including any methods) to
reference names from the current and outer scopes when the class
definition occurs inside a function.

However, even when the class definition occurs inside the function,
methods defined inside the class still cannot see names defined at the
class scope. Class variables must be accessed through the first
parameter of instance or class methods, or through the implicit
lexically scoped "__class__" reference described in the next section.


Creating the class object
-------------------------

Once the class namespace has been populated by executing the class
body, the class object is created by calling "metaclass(name, bases,
namespace, **kwds)" (the additional keywords passed here are the same
as those passed to "__prepare__").

This class object is the one that will be referenced by the zero-
argument form of "super()". "__class__" is an implicit closure
reference created by the compiler if any methods in a class body refer
to either "__class__" or "super". This allows the zero argument form
of "super()" to correctly identify the class being defined based on
lexical scoping, while the class or instance that was used to make the
current call is identified based on the first argument passed to the
method.

**CPython implementation detail:** In CPython 3.6 and later, the
"__class__" cell is passed to the metaclass as a "__classcell__" entry
in the class namespace. If present, this must be propagated up to the
"type.__new__" call in order for the class to be initialised
correctly. Failing to do so will result in a "RuntimeError" in Python
3.8.

When using the default metaclass "type", or any metaclass that
ultimately calls "type.__new__", the following additional
customisation steps are invoked after creating the class object:

* first, "type.__new__" collects all of the descriptors in the class
  namespace that define a "__set_name__()" method;

* second, all of these "__set_name__" methods are called with the
  class being defined and the assigned name of that particular
  descriptor;

* finally, the "__init_subclass__()" hook is called on the immediate
  parent of the new class in its method resolution order.

After the class object is created, it is passed to the class
decorators included in the class definition (if any) and the resulting
object is bound in the local namespace as the defined class.

When a new class is created by "type.__new__", the object provided as
the namespace parameter is copied to a new ordered mapping and the
original object is discarded. The new copy is wrapped in a read-only
proxy, which becomes the "__dict__" attribute of the class object.

See also:

  **PEP 3135** - New super
     Describes the implicit "__class__" closure reference


Uses for metaclasses
--------------------

The potential uses for metaclasses are boundless. Some ideas that have
been explored include enum, logging, interface checking, automatic
delegation, automatic property creation, proxies, frameworks, and
automatic resource locking/synchronization.


Customizing instance and subclass checks
========================================

The following methods are used to override the default behavior of the
"isinstance()" and "issubclass()" built-in functions.

In particular, the metaclass "abc.ABCMeta" implements these methods in
order to allow the addition of Abstract Base Classes (ABCs) as
“virtual base classes” to any class or type (including built-in
types), including other ABCs.

class.__instancecheck__(self, instance)

   Return true if *instance* should be considered a (direct or
   indirect) instance of *class*. If defined, called to implement
   "isinstance(instance, class)".

class.__subclasscheck__(self, subclass)

   Return true if *subclass* should be considered a (direct or
   indirect) subclass of *class*.  If defined, called to implement
   "issubclass(subclass, class)".

Note that these methods are looked up on the type (metaclass) of a
class.  They cannot be defined as class methods in the actual class.
This is consistent with the lookup of special methods that are called
on instances, only in this case the instance is itself a class.

See also:

  **PEP 3119** - Introducing Abstract Base Classes
     Includes the specification for customizing "isinstance()" and
     "issubclass()" behavior through "__instancecheck__()" and
     "__subclasscheck__()", with motivation for this functionality in
     the context of adding Abstract Base Classes (see the "abc"
     module) to the language.


Emulating generic types
=======================

One can implement the generic class syntax as specified by **PEP 484**
(for example "List[int]") by defining a special method:

classmethod object.__class_getitem__(cls, key)

   Return an object representing the specialization of a generic class
   by type arguments found in *key*.

This method is looked up on the class object itself, and when defined
in the class body, this method is implicitly a class method.  Note,
this mechanism is primarily reserved for use with static type hints,
other usage is discouraged.

See also:

  **PEP 560** - Core support for typing module and generic types


Emulating callable objects
==========================

object.__call__(self[, args...])

   Called when the instance is “called” as a function; if this method
   is defined, "x(arg1, arg2, ...)" roughly translates to
   "type(x).__call__(x, arg1, ...)".


Emulating container types
=========================

The following methods can be defined to implement container objects.
Containers usually are sequences (such as lists or tuples) or mappings
(like dictionaries), but can represent other containers as well.  The
first set of methods is used either to emulate a sequence or to
emulate a mapping; the difference is that for a sequence, the
allowable keys should be the integers *k* for which "0 <= k < N" where
*N* is the length of the sequence, or slice objects, which define a
range of items.  It is also recommended that mappings provide the
methods "keys()", "values()", "items()", "get()", "clear()",
"setdefault()", "pop()", "popitem()", "copy()", and "update()"
behaving similar to those for Python’s standard dictionary objects.
The "collections.abc" module provides a "MutableMapping" abstract base
class to help create those methods from a base set of "__getitem__()",
"__setitem__()", "__delitem__()", and "keys()". Mutable sequences
should provide methods "append()", "count()", "index()", "extend()",
"insert()", "pop()", "remove()", "reverse()" and "sort()", like Python
standard list objects.  Finally, sequence types should implement
addition (meaning concatenation) and multiplication (meaning
repetition) by defining the methods "__add__()", "__radd__()",
"__iadd__()", "__mul__()", "__rmul__()" and "__imul__()" described
below; they should not define other numerical operators.  It is
recommended that both mappings and sequences implement the
"__contains__()" method to allow efficient use of the "in" operator;
for mappings, "in" should search the mapping’s keys; for sequences, it
should search through the values.  It is further recommended that both
mappings and sequences implement the "__iter__()" method to allow
efficient iteration through the container; for mappings, "__iter__()"
should iterate through the object’s keys; for sequences, it should
iterate through the values.

object.__len__(self)

   Called to implement the built-in function "len()".  Should return
   the length of the object, an integer ">=" 0.  Also, an object that
   doesn’t define a "__bool__()" method and whose "__len__()" method
   returns zero is considered to be false in a Boolean context.

   **CPython implementation detail:** In CPython, the length is
   required to be at most "sys.maxsize". If the length is larger than
   "sys.maxsize" some features (such as "len()") may raise
   "OverflowError".  To prevent raising "OverflowError" by truth value
   testing, an object must define a "__bool__()" method.

object.__length_hint__(self)

   Called to implement "operator.length_hint()". Should return an
   estimated length for the object (which may be greater or less than
   the actual length). The length must be an integer ">=" 0. The
   return value may also be "NotImplemented", which is treated the
   same as if the "__length_hint__" method didn’t exist at all. This
   method is purely an optimization and is never required for
   correctness.

   New in version 3.4.

Note:

  Slicing is done exclusively with the following three methods.  A
  call like

     a[1:2] = b

  is translated to

     a[slice(1, 2, None)] = b

  and so forth.  Missing slice items are always filled in with "None".

object.__getitem__(self, key)

   Called to implement evaluation of "self[key]". For sequence types,
   the accepted keys should be integers and slice objects.  Note that
   the special interpretation of negative indexes (if the class wishes
   to emulate a sequence type) is up to the "__getitem__()" method. If
   *key* is of an inappropriate type, "TypeError" may be raised; if of
   a value outside the set of indexes for the sequence (after any
   special interpretation of negative values), "IndexError" should be
   raised. For mapping types, if *key* is missing (not in the
   container), "KeyError" should be raised.

   Note:

     "for" loops expect that an "IndexError" will be raised for
     illegal indexes to allow proper detection of the end of the
     sequence.

object.__setitem__(self, key, value)

   Called to implement assignment to "self[key]".  Same note as for
   "__getitem__()".  This should only be implemented for mappings if
   the objects support changes to the values for keys, or if new keys
   can be added, or for sequences if elements can be replaced.  The
   same exceptions should be raised for improper *key* values as for
   the "__getitem__()" method.

object.__delitem__(self, key)

   Called to implement deletion of "self[key]".  Same note as for
   "__getitem__()".  This should only be implemented for mappings if
   the objects support removal of keys, or for sequences if elements
   can be removed from the sequence.  The same exceptions should be
   raised for improper *key* values as for the "__getitem__()" method.

object.__missing__(self, key)

   Called by "dict"."__getitem__()" to implement "self[key]" for dict
   subclasses when key is not in the dictionary.

object.__iter__(self)

   This method is called when an iterator is required for a container.
   This method should return a new iterator object that can iterate
   over all the objects in the container.  For mappings, it should
   iterate over the keys of the container.

   Iterator objects also need to implement this method; they are
   required to return themselves.  For more information on iterator
   objects, see Iterator Types.

object.__reversed__(self)

   Called (if present) by the "reversed()" built-in to implement
   reverse iteration.  It should return a new iterator object that
   iterates over all the objects in the container in reverse order.

   If the "__reversed__()" method is not provided, the "reversed()"
   built-in will fall back to using the sequence protocol ("__len__()"
   and "__getitem__()").  Objects that support the sequence protocol
   should only provide "__reversed__()" if they can provide an
   implementation that is more efficient than the one provided by
   "reversed()".

The membership test operators ("in" and "not in") are normally
implemented as an iteration through a container. However, container
objects can supply the following special method with a more efficient
implementation, which also does not require the object be iterable.

object.__contains__(self, item)

   Called to implement membership test operators.  Should return true
   if *item* is in *self*, false otherwise.  For mapping objects, this
   should consider the keys of the mapping rather than the values or
   the key-item pairs.

   For objects that don’t define "__contains__()", the membership test
   first tries iteration via "__iter__()", then the old sequence
   iteration protocol via "__getitem__()", see this section in the
   language reference.


Emulating numeric types
=======================

The following methods can be defined to emulate numeric objects.
Methods corresponding to operations that are not supported by the
particular kind of number implemented (e.g., bitwise operations for
non-integral numbers) should be left undefined.

object.__add__(self, other)
object.__sub__(self, other)
object.__mul__(self, other)
object.__matmul__(self, other)
object.__truediv__(self, other)
object.__floordiv__(self, other)
object.__mod__(self, other)
object.__divmod__(self, other)
object.__pow__(self, other[, modulo])
object.__lshift__(self, other)
object.__rshift__(self, other)
object.__and__(self, other)
object.__xor__(self, other)
object.__or__(self, other)

   These methods are called to implement the binary arithmetic
   operations ("+", "-", "*", "@", "/", "//", "%", "divmod()",
   "pow()", "**", "<<", ">>", "&", "^", "|").  For instance, to
   evaluate the expression "x + y", where *x* is an instance of a
   class that has an "__add__()" method, "x.__add__(y)" is called.
   The "__divmod__()" method should be the equivalent to using
   "__floordiv__()" and "__mod__()"; it should not be related to
   "__truediv__()".  Note that "__pow__()" should be defined to accept
   an optional third argument if the ternary version of the built-in
   "pow()" function is to be supported.

   If one of those methods does not support the operation with the
   supplied arguments, it should return "NotImplemented".

object.__radd__(self, other)
object.__rsub__(self, other)
object.__rmul__(self, other)
object.__rmatmul__(self, other)
object.__rtruediv__(self, other)
object.__rfloordiv__(self, other)
object.__rmod__(self, other)
object.__rdivmod__(self, other)
object.__rpow__(self, other[, modulo])
object.__rlshift__(self, other)
object.__rrshift__(self, other)
object.__rand__(self, other)
object.__rxor__(self, other)
object.__ror__(self, other)

   These methods are called to implement the binary arithmetic
   operations ("+", "-", "*", "@", "/", "//", "%", "divmod()",
   "pow()", "**", "<<", ">>", "&", "^", "|") with reflected (swapped)
   operands.  These functions are only called if the left operand does
   not support the corresponding operation [3] and the operands are of
   different types. [4] For instance, to evaluate the expression "x -
   y", where *y* is an instance of a class that has an "__rsub__()"
   method, "y.__rsub__(x)" is called if "x.__sub__(y)" returns
   *NotImplemented*.

   Note that ternary "pow()" will not try calling "__rpow__()" (the
   coercion rules would become too complicated).

   Note:

     If the right operand’s type is a subclass of the left operand’s
     type and that subclass provides a different implementation of the
     reflected method for the operation, this method will be called
     before the left operand’s non-reflected method. This behavior
     allows subclasses to override their ancestors’ operations.

object.__iadd__(self, other)
object.__isub__(self, other)
object.__imul__(self, other)
object.__imatmul__(self, other)
object.__itruediv__(self, other)
object.__ifloordiv__(self, other)
object.__imod__(self, other)
object.__ipow__(self, other[, modulo])
object.__ilshift__(self, other)
object.__irshift__(self, other)
object.__iand__(self, other)
object.__ixor__(self, other)
object.__ior__(self, other)

   These methods are called to implement the augmented arithmetic
   assignments ("+=", "-=", "*=", "@=", "/=", "//=", "%=", "**=",
   "<<=", ">>=", "&=", "^=", "|=").  These methods should attempt to
   do the operation in-place (modifying *self*) and return the result
   (which could be, but does not have to be, *self*).  If a specific
   method is not defined, the augmented assignment falls back to the
   normal methods.  For instance, if *x* is an instance of a class
   with an "__iadd__()" method, "x += y" is equivalent to "x =
   x.__iadd__(y)" . Otherwise, "x.__add__(y)" and "y.__radd__(x)" are
   considered, as with the evaluation of "x + y". In certain
   situations, augmented assignment can result in unexpected errors
   (see Why does a_tuple[i] += [‘item’] raise an exception when the
   addition works?), but this behavior is in fact part of the data
   model.

   Note:

     Due to a bug in the dispatching mechanism for "**=", a class that
     defines "__ipow__()" but returns "NotImplemented" would fail to
     fall back to "x.__pow__(y)" and "y.__rpow__(x)". This bug is
     fixed in Python 3.10.

object.__neg__(self)
object.__pos__(self)
object.__abs__(self)
object.__invert__(self)

   Called to implement the unary arithmetic operations ("-", "+",
   "abs()" and "~").

object.__complex__(self)
object.__int__(self)
object.__float__(self)

   Called to implement the built-in functions "complex()", "int()" and
   "float()".  Should return a value of the appropriate type.

object.__index__(self)

   Called to implement "operator.index()", and whenever Python needs
   to losslessly convert the numeric object to an integer object (such
   as in slicing, or in the built-in "bin()", "hex()" and "oct()"
   functions). Presence of this method indicates that the numeric
   object is an integer type.  Must return an integer.

   If "__int__()", "__float__()" and "__complex__()" are not defined
   then corresponding built-in functions "int()", "float()" and
   "complex()" fall back to "__index__()".

object.__round__(self[, ndigits])
object.__trunc__(self)
object.__floor__(self)
object.__ceil__(self)

   Called to implement the built-in function "round()" and "math"
   functions "trunc()", "floor()" and "ceil()". Unless *ndigits* is
   passed to "__round__()" all these methods should return the value
   of the object truncated to an "Integral" (typically an "int").

   The built-in function "int()" falls back to "__trunc__()" if
   neither "__int__()" nor "__index__()" is defined.


With Statement Context Managers
===============================

A *context manager* is an object that defines the runtime context to
be established when executing a "with" statement. The context manager
handles the entry into, and the exit from, the desired runtime context
for the execution of the block of code.  Context managers are normally
invoked using the "with" statement (described in section The with
statement), but can also be used by directly invoking their methods.

Typical uses of context managers include saving and restoring various
kinds of global state, locking and unlocking resources, closing opened
files, etc.

For more information on context managers, see Context Manager Types.

object.__enter__(self)

   Enter the runtime context related to this object. The "with"
   statement will bind this method’s return value to the target(s)
   specified in the "as" clause of the statement, if any.

object.__exit__(self, exc_type, exc_value, traceback)

   Exit the runtime context related to this object. The parameters
   describe the exception that caused the context to be exited. If the
   context was exited without an exception, all three arguments will
   be "None".

   If an exception is supplied, and the method wishes to suppress the
   exception (i.e., prevent it from being propagated), it should
   return a true value. Otherwise, the exception will be processed
   normally upon exit from this method.

   Note that "__exit__()" methods should not reraise the passed-in
   exception; this is the caller’s responsibility.

See also:

  **PEP 343** - The “with” statement
     The specification, background, and examples for the Python "with"
     statement.


Special method lookup
=====================

For custom classes, implicit invocations of special methods are only
guaranteed to work correctly if defined on an object’s type, not in
the object’s instance dictionary.  That behaviour is the reason why
the following code raises an exception:

   >>> class C:
   ...     pass
   ...
   >>> c = C()
   >>> c.__len__ = lambda: 5
   >>> len(c)
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
   TypeError: object of type 'C' has no len()

The rationale behind this behaviour lies with a number of special
methods such as "__hash__()" and "__repr__()" that are implemented by
all objects, including type objects. If the implicit lookup of these
methods used the conventional lookup process, they would fail when
invoked on the type object itself:

   >>> 1 .__hash__() == hash(1)
   True
   >>> int.__hash__() == hash(int)
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
   TypeError: descriptor '__hash__' of 'int' object needs an argument

Incorrectly attempting to invoke an unbound method of a class in this
way is sometimes referred to as ‘metaclass confusion’, and is avoided
by bypassing the instance when looking up special methods:

   >>> type(1).__hash__(1) == hash(1)
   True
   >>> type(int).__hash__(int) == hash(int)
   True

In addition to bypassing any instance attributes in the interest of
correctness, implicit special method lookup generally also bypasses
the "__getattribute__()" method even of the object’s metaclass:

   >>> class Meta(type):
   ...     def __getattribute__(*args):
   ...         print("Metaclass getattribute invoked")
   ...         return type.__getattribute__(*args)
   ...
   >>> class C(object, metaclass=Meta):
   ...     def __len__(self):
   ...         return 10
   ...     def __getattribute__(*args):
   ...         print("Class getattribute invoked")
   ...         return object.__getattribute__(*args)
   ...
   >>> c = C()
   >>> c.__len__()                 # Explicit lookup via instance
   Class getattribute invoked
   10
   >>> type(c).__len__(c)          # Explicit lookup via type
   Metaclass getattribute invoked
   10
   >>> len(c)                      # Implicit lookup
   10

Bypassing the "__getattribute__()" machinery in this fashion provides
significant scope for speed optimisations within the interpreter, at
the cost of some flexibility in the handling of special methods (the
special method *must* be set on the class object itself in order to be
consistently invoked by the interpreter).
u�YString Methods
**************

Strings implement all of the common sequence operations, along with
the additional methods described below.

Strings also support two styles of string formatting, one providing a
large degree of flexibility and customization (see "str.format()",
Format String Syntax and Custom String Formatting) and the other based
on C "printf" style formatting that handles a narrower range of types
and is slightly harder to use correctly, but is often faster for the
cases it can handle (printf-style String Formatting).

The Text Processing Services section of the standard library covers a
number of other modules that provide various text related utilities
(including regular expression support in the "re" module).

str.capitalize()

   Return a copy of the string with its first character capitalized
   and the rest lowercased.

   Changed in version 3.8: The first character is now put into
   titlecase rather than uppercase. This means that characters like
   digraphs will only have their first letter capitalized, instead of
   the full character.

str.casefold()

   Return a casefolded copy of the string. Casefolded strings may be
   used for caseless matching.

   Casefolding is similar to lowercasing but more aggressive because
   it is intended to remove all case distinctions in a string. For
   example, the German lowercase letter "'ß'" is equivalent to ""ss"".
   Since it is already lowercase, "lower()" would do nothing to "'ß'";
   "casefold()" converts it to ""ss"".

   The casefolding algorithm is described in section 3.13 of the
   Unicode Standard.

   New in version 3.3.

str.center(width[, fillchar])

   Return centered in a string of length *width*. Padding is done
   using the specified *fillchar* (default is an ASCII space). The
   original string is returned if *width* is less than or equal to
   "len(s)".

str.count(sub[, start[, end]])

   Return the number of non-overlapping occurrences of substring *sub*
   in the range [*start*, *end*].  Optional arguments *start* and
   *end* are interpreted as in slice notation.

str.encode(encoding="utf-8", errors="strict")

   Return an encoded version of the string as a bytes object. Default
   encoding is "'utf-8'". *errors* may be given to set a different
   error handling scheme. The default for *errors* is "'strict'",
   meaning that encoding errors raise a "UnicodeError". Other possible
   values are "'ignore'", "'replace'", "'xmlcharrefreplace'",
   "'backslashreplace'" and any other name registered via
   "codecs.register_error()", see section Error Handlers. For a list
   of possible encodings, see section Standard Encodings.

   Changed in version 3.1: Support for keyword arguments added.

str.endswith(suffix[, start[, end]])

   Return "True" if the string ends with the specified *suffix*,
   otherwise return "False".  *suffix* can also be a tuple of suffixes
   to look for.  With optional *start*, test beginning at that
   position.  With optional *end*, stop comparing at that position.

str.expandtabs(tabsize=8)

   Return a copy of the string where all tab characters are replaced
   by one or more spaces, depending on the current column and the
   given tab size.  Tab positions occur every *tabsize* characters
   (default is 8, giving tab positions at columns 0, 8, 16 and so on).
   To expand the string, the current column is set to zero and the
   string is examined character by character.  If the character is a
   tab ("\t"), one or more space characters are inserted in the result
   until the current column is equal to the next tab position. (The
   tab character itself is not copied.)  If the character is a newline
   ("\n") or return ("\r"), it is copied and the current column is
   reset to zero.  Any other character is copied unchanged and the
   current column is incremented by one regardless of how the
   character is represented when printed.

   >>> '01\t012\t0123\t01234'.expandtabs()
   '01      012     0123    01234'
   >>> '01\t012\t0123\t01234'.expandtabs(4)
   '01  012 0123    01234'

str.find(sub[, start[, end]])

   Return the lowest index in the string where substring *sub* is
   found within the slice "s[start:end]".  Optional arguments *start*
   and *end* are interpreted as in slice notation.  Return "-1" if
   *sub* is not found.

   Note:

     The "find()" method should be used only if you need to know the
     position of *sub*.  To check if *sub* is a substring or not, use
     the "in" operator:

        >>> 'Py' in 'Python'
        True

str.format(*args, **kwargs)

   Perform a string formatting operation.  The string on which this
   method is called can contain literal text or replacement fields
   delimited by braces "{}".  Each replacement field contains either
   the numeric index of a positional argument, or the name of a
   keyword argument.  Returns a copy of the string where each
   replacement field is replaced with the string value of the
   corresponding argument.

   >>> "The sum of 1 + 2 is {0}".format(1+2)
   'The sum of 1 + 2 is 3'

   See Format String Syntax for a description of the various
   formatting options that can be specified in format strings.

   Note:

     When formatting a number ("int", "float", "complex",
     "decimal.Decimal" and subclasses) with the "n" type (ex:
     "'{:n}'.format(1234)"), the function temporarily sets the
     "LC_CTYPE" locale to the "LC_NUMERIC" locale to decode
     "decimal_point" and "thousands_sep" fields of "localeconv()" if
     they are non-ASCII or longer than 1 byte, and the "LC_NUMERIC"
     locale is different than the "LC_CTYPE" locale.  This temporary
     change affects other threads.

   Changed in version 3.7: When formatting a number with the "n" type,
   the function sets temporarily the "LC_CTYPE" locale to the
   "LC_NUMERIC" locale in some cases.

str.format_map(mapping)

   Similar to "str.format(**mapping)", except that "mapping" is used
   directly and not copied to a "dict".  This is useful if for example
   "mapping" is a dict subclass:

   >>> class Default(dict):
   ...     def __missing__(self, key):
   ...         return key
   ...
   >>> '{name} was born in {country}'.format_map(Default(name='Guido'))
   'Guido was born in country'

   New in version 3.2.

str.index(sub[, start[, end]])

   Like "find()", but raise "ValueError" when the substring is not
   found.

str.isalnum()

   Return "True" if all characters in the string are alphanumeric and
   there is at least one character, "False" otherwise.  A character
   "c" is alphanumeric if one of the following returns "True":
   "c.isalpha()", "c.isdecimal()", "c.isdigit()", or "c.isnumeric()".

str.isalpha()

   Return "True" if all characters in the string are alphabetic and
   there is at least one character, "False" otherwise.  Alphabetic
   characters are those characters defined in the Unicode character
   database as “Letter”, i.e., those with general category property
   being one of “Lm”, “Lt”, “Lu”, “Ll”, or “Lo”.  Note that this is
   different from the “Alphabetic” property defined in the Unicode
   Standard.

str.isascii()

   Return "True" if the string is empty or all characters in the
   string are ASCII, "False" otherwise. ASCII characters have code
   points in the range U+0000-U+007F.

   New in version 3.7.

str.isdecimal()

   Return "True" if all characters in the string are decimal
   characters and there is at least one character, "False" otherwise.
   Decimal characters are those that can be used to form numbers in
   base 10, e.g. U+0660, ARABIC-INDIC DIGIT ZERO.  Formally a decimal
   character is a character in the Unicode General Category “Nd”.

str.isdigit()

   Return "True" if all characters in the string are digits and there
   is at least one character, "False" otherwise.  Digits include
   decimal characters and digits that need special handling, such as
   the compatibility superscript digits. This covers digits which
   cannot be used to form numbers in base 10, like the Kharosthi
   numbers.  Formally, a digit is a character that has the property
   value Numeric_Type=Digit or Numeric_Type=Decimal.

str.isidentifier()

   Return "True" if the string is a valid identifier according to the
   language definition, section Identifiers and keywords.

   Call "keyword.iskeyword()" to test whether string "s" is a reserved
   identifier, such as "def" and "class".

   Example:

      >>> from keyword import iskeyword

      >>> 'hello'.isidentifier(), iskeyword('hello')
      True, False
      >>> 'def'.isidentifier(), iskeyword('def')
      True, True

str.islower()

   Return "True" if all cased characters [4] in the string are
   lowercase and there is at least one cased character, "False"
   otherwise.

str.isnumeric()

   Return "True" if all characters in the string are numeric
   characters, and there is at least one character, "False" otherwise.
   Numeric characters include digit characters, and all characters
   that have the Unicode numeric value property, e.g. U+2155, VULGAR
   FRACTION ONE FIFTH.  Formally, numeric characters are those with
   the property value Numeric_Type=Digit, Numeric_Type=Decimal or
   Numeric_Type=Numeric.

str.isprintable()

   Return "True" if all characters in the string are printable or the
   string is empty, "False" otherwise.  Nonprintable characters are
   those characters defined in the Unicode character database as
   “Other” or “Separator”, excepting the ASCII space (0x20) which is
   considered printable.  (Note that printable characters in this
   context are those which should not be escaped when "repr()" is
   invoked on a string.  It has no bearing on the handling of strings
   written to "sys.stdout" or "sys.stderr".)

str.isspace()

   Return "True" if there are only whitespace characters in the string
   and there is at least one character, "False" otherwise.

   A character is *whitespace* if in the Unicode character database
   (see "unicodedata"), either its general category is "Zs"
   (“Separator, space”), or its bidirectional class is one of "WS",
   "B", or "S".

str.istitle()

   Return "True" if the string is a titlecased string and there is at
   least one character, for example uppercase characters may only
   follow uncased characters and lowercase characters only cased ones.
   Return "False" otherwise.

str.isupper()

   Return "True" if all cased characters [4] in the string are
   uppercase and there is at least one cased character, "False"
   otherwise.

str.join(iterable)

   Return a string which is the concatenation of the strings in
   *iterable*. A "TypeError" will be raised if there are any non-
   string values in *iterable*, including "bytes" objects.  The
   separator between elements is the string providing this method.

str.ljust(width[, fillchar])

   Return the string left justified in a string of length *width*.
   Padding is done using the specified *fillchar* (default is an ASCII
   space). The original string is returned if *width* is less than or
   equal to "len(s)".

str.lower()

   Return a copy of the string with all the cased characters [4]
   converted to lowercase.

   The lowercasing algorithm used is described in section 3.13 of the
   Unicode Standard.

str.lstrip([chars])

   Return a copy of the string with leading characters removed.  The
   *chars* argument is a string specifying the set of characters to be
   removed.  If omitted or "None", the *chars* argument defaults to
   removing whitespace.  The *chars* argument is not a prefix; rather,
   all combinations of its values are stripped:

      >>> '   spacious   '.lstrip()
      'spacious   '
      >>> 'www.example.com'.lstrip('cmowz.')
      'example.com'

static str.maketrans(x[, y[, z]])

   This static method returns a translation table usable for
   "str.translate()".

   If there is only one argument, it must be a dictionary mapping
   Unicode ordinals (integers) or characters (strings of length 1) to
   Unicode ordinals, strings (of arbitrary lengths) or "None".
   Character keys will then be converted to ordinals.

   If there are two arguments, they must be strings of equal length,
   and in the resulting dictionary, each character in x will be mapped
   to the character at the same position in y.  If there is a third
   argument, it must be a string, whose characters will be mapped to
   "None" in the result.

str.partition(sep)

   Split the string at the first occurrence of *sep*, and return a
   3-tuple containing the part before the separator, the separator
   itself, and the part after the separator.  If the separator is not
   found, return a 3-tuple containing the string itself, followed by
   two empty strings.

str.replace(old, new[, count])

   Return a copy of the string with all occurrences of substring *old*
   replaced by *new*.  If the optional argument *count* is given, only
   the first *count* occurrences are replaced.

str.rfind(sub[, start[, end]])

   Return the highest index in the string where substring *sub* is
   found, such that *sub* is contained within "s[start:end]".
   Optional arguments *start* and *end* are interpreted as in slice
   notation.  Return "-1" on failure.

str.rindex(sub[, start[, end]])

   Like "rfind()" but raises "ValueError" when the substring *sub* is
   not found.

str.rjust(width[, fillchar])

   Return the string right justified in a string of length *width*.
   Padding is done using the specified *fillchar* (default is an ASCII
   space). The original string is returned if *width* is less than or
   equal to "len(s)".

str.rpartition(sep)

   Split the string at the last occurrence of *sep*, and return a
   3-tuple containing the part before the separator, the separator
   itself, and the part after the separator.  If the separator is not
   found, return a 3-tuple containing two empty strings, followed by
   the string itself.

str.rsplit(sep=None, maxsplit=-1)

   Return a list of the words in the string, using *sep* as the
   delimiter string. If *maxsplit* is given, at most *maxsplit* splits
   are done, the *rightmost* ones.  If *sep* is not specified or
   "None", any whitespace string is a separator.  Except for splitting
   from the right, "rsplit()" behaves like "split()" which is
   described in detail below.

str.rstrip([chars])

   Return a copy of the string with trailing characters removed.  The
   *chars* argument is a string specifying the set of characters to be
   removed.  If omitted or "None", the *chars* argument defaults to
   removing whitespace.  The *chars* argument is not a suffix; rather,
   all combinations of its values are stripped:

      >>> '   spacious   '.rstrip()
      '   spacious'
      >>> 'mississippi'.rstrip('ipz')
      'mississ'

str.split(sep=None, maxsplit=-1)

   Return a list of the words in the string, using *sep* as the
   delimiter string.  If *maxsplit* is given, at most *maxsplit*
   splits are done (thus, the list will have at most "maxsplit+1"
   elements).  If *maxsplit* is not specified or "-1", then there is
   no limit on the number of splits (all possible splits are made).

   If *sep* is given, consecutive delimiters are not grouped together
   and are deemed to delimit empty strings (for example,
   "'1,,2'.split(',')" returns "['1', '', '2']").  The *sep* argument
   may consist of multiple characters (for example,
   "'1<>2<>3'.split('<>')" returns "['1', '2', '3']"). Splitting an
   empty string with a specified separator returns "['']".

   For example:

      >>> '1,2,3'.split(',')
      ['1', '2', '3']
      >>> '1,2,3'.split(',', maxsplit=1)
      ['1', '2,3']
      >>> '1,2,,3,'.split(',')
      ['1', '2', '', '3', '']

   If *sep* is not specified or is "None", a different splitting
   algorithm is applied: runs of consecutive whitespace are regarded
   as a single separator, and the result will contain no empty strings
   at the start or end if the string has leading or trailing
   whitespace.  Consequently, splitting an empty string or a string
   consisting of just whitespace with a "None" separator returns "[]".

   For example:

      >>> '1 2 3'.split()
      ['1', '2', '3']
      >>> '1 2 3'.split(maxsplit=1)
      ['1', '2 3']
      >>> '   1   2   3   '.split()
      ['1', '2', '3']

str.splitlines([keepends])

   Return a list of the lines in the string, breaking at line
   boundaries.  Line breaks are not included in the resulting list
   unless *keepends* is given and true.

   This method splits on the following line boundaries.  In
   particular, the boundaries are a superset of *universal newlines*.

   +-------------------------+-------------------------------+
   | Representation          | Description                   |
   |=========================|===============================|
   | "\n"                    | Line Feed                     |
   +-------------------------+-------------------------------+
   | "\r"                    | Carriage Return               |
   +-------------------------+-------------------------------+
   | "\r\n"                  | Carriage Return + Line Feed   |
   +-------------------------+-------------------------------+
   | "\v" or "\x0b"          | Line Tabulation               |
   +-------------------------+-------------------------------+
   | "\f" or "\x0c"          | Form Feed                     |
   +-------------------------+-------------------------------+
   | "\x1c"                  | File Separator                |
   +-------------------------+-------------------------------+
   | "\x1d"                  | Group Separator               |
   +-------------------------+-------------------------------+
   | "\x1e"                  | Record Separator              |
   +-------------------------+-------------------------------+
   | "\x85"                  | Next Line (C1 Control Code)   |
   +-------------------------+-------------------------------+
   | "\u2028"                | Line Separator                |
   +-------------------------+-------------------------------+
   | "\u2029"                | Paragraph Separator           |
   +-------------------------+-------------------------------+

   Changed in version 3.2: "\v" and "\f" added to list of line
   boundaries.

   For example:

      >>> 'ab c\n\nde fg\rkl\r\n'.splitlines()
      ['ab c', '', 'de fg', 'kl']
      >>> 'ab c\n\nde fg\rkl\r\n'.splitlines(keepends=True)
      ['ab c\n', '\n', 'de fg\r', 'kl\r\n']

   Unlike "split()" when a delimiter string *sep* is given, this
   method returns an empty list for the empty string, and a terminal
   line break does not result in an extra line:

      >>> "".splitlines()
      []
      >>> "One line\n".splitlines()
      ['One line']

   For comparison, "split('\n')" gives:

      >>> ''.split('\n')
      ['']
      >>> 'Two lines\n'.split('\n')
      ['Two lines', '']

str.startswith(prefix[, start[, end]])

   Return "True" if string starts with the *prefix*, otherwise return
   "False". *prefix* can also be a tuple of prefixes to look for.
   With optional *start*, test string beginning at that position.
   With optional *end*, stop comparing string at that position.

str.strip([chars])

   Return a copy of the string with the leading and trailing
   characters removed. The *chars* argument is a string specifying the
   set of characters to be removed. If omitted or "None", the *chars*
   argument defaults to removing whitespace. The *chars* argument is
   not a prefix or suffix; rather, all combinations of its values are
   stripped:

      >>> '   spacious   '.strip()
      'spacious'
      >>> 'www.example.com'.strip('cmowz.')
      'example'

   The outermost leading and trailing *chars* argument values are
   stripped from the string. Characters are removed from the leading
   end until reaching a string character that is not contained in the
   set of characters in *chars*. A similar action takes place on the
   trailing end. For example:

      >>> comment_string = '#....... Section 3.2.1 Issue #32 .......'
      >>> comment_string.strip('.#! ')
      'Section 3.2.1 Issue #32'

str.swapcase()

   Return a copy of the string with uppercase characters converted to
   lowercase and vice versa. Note that it is not necessarily true that
   "s.swapcase().swapcase() == s".

str.title()

   Return a titlecased version of the string where words start with an
   uppercase character and the remaining characters are lowercase.

   For example:

      >>> 'Hello world'.title()
      'Hello World'

   The algorithm uses a simple language-independent definition of a
   word as groups of consecutive letters.  The definition works in
   many contexts but it means that apostrophes in contractions and
   possessives form word boundaries, which may not be the desired
   result:

      >>> "they're bill's friends from the UK".title()
      "They'Re Bill'S Friends From The Uk"

   A workaround for apostrophes can be constructed using regular
   expressions:

      >>> import re
      >>> def titlecase(s):
      ...     return re.sub(r"[A-Za-z]+('[A-Za-z]+)?",
      ...                   lambda mo: mo.group(0).capitalize(),
      ...                   s)
      ...
      >>> titlecase("they're bill's friends.")
      "They're Bill's Friends."

str.translate(table)

   Return a copy of the string in which each character has been mapped
   through the given translation table.  The table must be an object
   that implements indexing via "__getitem__()", typically a *mapping*
   or *sequence*.  When indexed by a Unicode ordinal (an integer), the
   table object can do any of the following: return a Unicode ordinal
   or a string, to map the character to one or more other characters;
   return "None", to delete the character from the return string; or
   raise a "LookupError" exception, to map the character to itself.

   You can use "str.maketrans()" to create a translation map from
   character-to-character mappings in different formats.

   See also the "codecs" module for a more flexible approach to custom
   character mappings.

str.upper()

   Return a copy of the string with all the cased characters [4]
   converted to uppercase.  Note that "s.upper().isupper()" might be
   "False" if "s" contains uncased characters or if the Unicode
   category of the resulting character(s) is not “Lu” (Letter,
   uppercase), but e.g. “Lt” (Letter, titlecase).

   The uppercasing algorithm used is described in section 3.13 of the
   Unicode Standard.

str.zfill(width)

   Return a copy of the string left filled with ASCII "'0'" digits to
   make a string of length *width*. A leading sign prefix
   ("'+'"/"'-'") is handled by inserting the padding *after* the sign
   character rather than before. The original string is returned if
   *width* is less than or equal to "len(s)".

   For example:

      >>> "42".zfill(5)
      '00042'
      >>> "-42".zfill(5)
      '-0042'
u� String and Bytes literals
*************************

String literals are described by the following lexical definitions:

   stringliteral   ::= [stringprefix](shortstring | longstring)
   stringprefix    ::= "r" | "u" | "R" | "U" | "f" | "F"
                    | "fr" | "Fr" | "fR" | "FR" | "rf" | "rF" | "Rf" | "RF"
   shortstring     ::= "'" shortstringitem* "'" | '"' shortstringitem* '"'
   longstring      ::= "'''" longstringitem* "'''" | '"""' longstringitem* '"""'
   shortstringitem ::= shortstringchar | stringescapeseq
   longstringitem  ::= longstringchar | stringescapeseq
   shortstringchar ::= <any source character except "\" or newline or the quote>
   longstringchar  ::= <any source character except "\">
   stringescapeseq ::= "\" <any source character>

   bytesliteral   ::= bytesprefix(shortbytes | longbytes)
   bytesprefix    ::= "b" | "B" | "br" | "Br" | "bR" | "BR" | "rb" | "rB" | "Rb" | "RB"
   shortbytes     ::= "'" shortbytesitem* "'" | '"' shortbytesitem* '"'
   longbytes      ::= "'''" longbytesitem* "'''" | '"""' longbytesitem* '"""'
   shortbytesitem ::= shortbyteschar | bytesescapeseq
   longbytesitem  ::= longbyteschar | bytesescapeseq
   shortbyteschar ::= <any ASCII character except "\" or newline or the quote>
   longbyteschar  ::= <any ASCII character except "\">
   bytesescapeseq ::= "\" <any ASCII character>

One syntactic restriction not indicated by these productions is that
whitespace is not allowed between the "stringprefix" or "bytesprefix"
and the rest of the literal. The source character set is defined by
the encoding declaration; it is UTF-8 if no encoding declaration is
given in the source file; see section Encoding declarations.

In plain English: Both types of literals can be enclosed in matching
single quotes ("'") or double quotes (""").  They can also be enclosed
in matching groups of three single or double quotes (these are
generally referred to as *triple-quoted strings*).  The backslash
("\") character is used to escape characters that otherwise have a
special meaning, such as newline, backslash itself, or the quote
character.

Bytes literals are always prefixed with "'b'" or "'B'"; they produce
an instance of the "bytes" type instead of the "str" type.  They may
only contain ASCII characters; bytes with a numeric value of 128 or
greater must be expressed with escapes.

Both string and bytes literals may optionally be prefixed with a
letter "'r'" or "'R'"; such strings are called *raw strings* and treat
backslashes as literal characters.  As a result, in string literals,
"'\U'" and "'\u'" escapes in raw strings are not treated specially.
Given that Python 2.x’s raw unicode literals behave differently than
Python 3.x’s the "'ur'" syntax is not supported.

New in version 3.3: The "'rb'" prefix of raw bytes literals has been
added as a synonym of "'br'".

New in version 3.3: Support for the unicode legacy literal
("u'value'") was reintroduced to simplify the maintenance of dual
Python 2.x and 3.x codebases. See **PEP 414** for more information.

A string literal with "'f'" or "'F'" in its prefix is a *formatted
string literal*; see Formatted string literals.  The "'f'" may be
combined with "'r'", but not with "'b'" or "'u'", therefore raw
formatted strings are possible, but formatted bytes literals are not.

In triple-quoted literals, unescaped newlines and quotes are allowed
(and are retained), except that three unescaped quotes in a row
terminate the literal.  (A “quote” is the character used to open the
literal, i.e. either "'" or """.)

Unless an "'r'" or "'R'" prefix is present, escape sequences in string
and bytes literals are interpreted according to rules similar to those
used by Standard C.  The recognized escape sequences are:

+-------------------+-----------------------------------+---------+
| Escape Sequence   | Meaning                           | Notes   |
|===================|===================================|=========|
| "\newline"        | Backslash and newline ignored     |         |
+-------------------+-----------------------------------+---------+
| "\\"              | Backslash ("\")                   |         |
+-------------------+-----------------------------------+---------+
| "\'"              | Single quote ("'")                |         |
+-------------------+-----------------------------------+---------+
| "\""              | Double quote (""")                |         |
+-------------------+-----------------------------------+---------+
| "\a"              | ASCII Bell (BEL)                  |         |
+-------------------+-----------------------------------+---------+
| "\b"              | ASCII Backspace (BS)              |         |
+-------------------+-----------------------------------+---------+
| "\f"              | ASCII Formfeed (FF)               |         |
+-------------------+-----------------------------------+---------+
| "\n"              | ASCII Linefeed (LF)               |         |
+-------------------+-----------------------------------+---------+
| "\r"              | ASCII Carriage Return (CR)        |         |
+-------------------+-----------------------------------+---------+
| "\t"              | ASCII Horizontal Tab (TAB)        |         |
+-------------------+-----------------------------------+---------+
| "\v"              | ASCII Vertical Tab (VT)           |         |
+-------------------+-----------------------------------+---------+
| "\ooo"            | Character with octal value *ooo*  | (1,3)   |
+-------------------+-----------------------------------+---------+
| "\xhh"            | Character with hex value *hh*     | (2,3)   |
+-------------------+-----------------------------------+---------+

Escape sequences only recognized in string literals are:

+-------------------+-----------------------------------+---------+
| Escape Sequence   | Meaning                           | Notes   |
|===================|===================================|=========|
| "\N{name}"        | Character named *name* in the     | (4)     |
|                   | Unicode database                  |         |
+-------------------+-----------------------------------+---------+
| "\uxxxx"          | Character with 16-bit hex value   | (5)     |
|                   | *xxxx*                            |         |
+-------------------+-----------------------------------+---------+
| "\Uxxxxxxxx"      | Character with 32-bit hex value   | (6)     |
|                   | *xxxxxxxx*                        |         |
+-------------------+-----------------------------------+---------+

Notes:

1. As in Standard C, up to three octal digits are accepted.

2. Unlike in Standard C, exactly two hex digits are required.

3. In a bytes literal, hexadecimal and octal escapes denote the byte
   with the given value. In a string literal, these escapes denote a
   Unicode character with the given value.

4. Changed in version 3.3: Support for name aliases [1] has been
   added.

5. Exactly four hex digits are required.

6. Any Unicode character can be encoded this way.  Exactly eight hex
   digits are required.

Unlike Standard C, all unrecognized escape sequences are left in the
string unchanged, i.e., *the backslash is left in the result*.  (This
behavior is useful when debugging: if an escape sequence is mistyped,
the resulting output is more easily recognized as broken.)  It is also
important to note that the escape sequences only recognized in string
literals fall into the category of unrecognized escapes for bytes
literals.

   Changed in version 3.6: Unrecognized escape sequences produce a
   "DeprecationWarning".  In a future Python version they will be a
   "SyntaxWarning" and eventually a "SyntaxError".

Even in a raw literal, quotes can be escaped with a backslash, but the
backslash remains in the result; for example, "r"\""" is a valid
string literal consisting of two characters: a backslash and a double
quote; "r"\"" is not a valid string literal (even a raw string cannot
end in an odd number of backslashes).  Specifically, *a raw literal
cannot end in a single backslash* (since the backslash would escape
the following quote character).  Note also that a single backslash
followed by a newline is interpreted as those two characters as part
of the literal, *not* as a line continuation.
uMSubscriptions
*************

A subscription selects an item of a sequence (string, tuple or list)
or mapping (dictionary) object:

   subscription ::= primary "[" expression_list "]"

The primary must evaluate to an object that supports subscription
(lists or dictionaries for example).  User-defined objects can support
subscription by defining a "__getitem__()" method.

For built-in objects, there are two types of objects that support
subscription:

If the primary is a mapping, the expression list must evaluate to an
object whose value is one of the keys of the mapping, and the
subscription selects the value in the mapping that corresponds to that
key.  (The expression list is a tuple except if it has exactly one
item.)

If the primary is a sequence, the expression list must evaluate to an
integer or a slice (as discussed in the following section).

The formal syntax makes no special provision for negative indices in
sequences; however, built-in sequences all provide a "__getitem__()"
method that interprets negative indices by adding the length of the
sequence to the index (so that "x[-1]" selects the last item of "x").
The resulting value must be a nonnegative integer less than the number
of items in the sequence, and the subscription selects the item whose
index is that value (counting from zero). Since the support for
negative indices and slicing occurs in the object’s "__getitem__()"
method, subclasses overriding this method will need to explicitly add
that support.

A string’s items are characters.  A character is not a separate data
type but a string of exactly one character.
axTruth Value Testing
*******************

Any object can be tested for truth value, for use in an "if" or
"while" condition or as operand of the Boolean operations below.

By default, an object is considered true unless its class defines
either a "__bool__()" method that returns "False" or a "__len__()"
method that returns zero, when called with the object. [1]  Here are
most of the built-in objects considered false:

* constants defined to be false: "None" and "False".

* zero of any numeric type: "0", "0.0", "0j", "Decimal(0)",
  "Fraction(0, 1)"

* empty sequences and collections: "''", "()", "[]", "{}", "set()",
  "range(0)"

Operations and built-in functions that have a Boolean result always
return "0" or "False" for false and "1" or "True" for true, unless
otherwise stated. (Important exception: the Boolean operations "or"
and "and" always return one of their operands.)
uRThe "try" statement
*******************

The "try" statement specifies exception handlers and/or cleanup code
for a group of statements:

   try_stmt  ::= try1_stmt | try2_stmt
   try1_stmt ::= "try" ":" suite
                 ("except" [expression ["as" identifier]] ":" suite)+
                 ["else" ":" suite]
                 ["finally" ":" suite]
   try2_stmt ::= "try" ":" suite
                 "finally" ":" suite

The "except" clause(s) specify one or more exception handlers. When no
exception occurs in the "try" clause, no exception handler is
executed. When an exception occurs in the "try" suite, a search for an
exception handler is started.  This search inspects the except clauses
in turn until one is found that matches the exception.  An expression-
less except clause, if present, must be last; it matches any
exception.  For an except clause with an expression, that expression
is evaluated, and the clause matches the exception if the resulting
object is “compatible” with the exception.  An object is compatible
with an exception if it is the class or a base class of the exception
object, or a tuple containing an item that is the class or a base
class of the exception object.

If no except clause matches the exception, the search for an exception
handler continues in the surrounding code and on the invocation stack.
[1]

If the evaluation of an expression in the header of an except clause
raises an exception, the original search for a handler is canceled and
a search starts for the new exception in the surrounding code and on
the call stack (it is treated as if the entire "try" statement raised
the exception).

When a matching except clause is found, the exception is assigned to
the target specified after the "as" keyword in that except clause, if
present, and the except clause’s suite is executed.  All except
clauses must have an executable block.  When the end of this block is
reached, execution continues normally after the entire try statement.
(This means that if two nested handlers exist for the same exception,
and the exception occurs in the try clause of the inner handler, the
outer handler will not handle the exception.)

When an exception has been assigned using "as target", it is cleared
at the end of the except clause.  This is as if

   except E as N:
       foo

was translated to

   except E as N:
       try:
           foo
       finally:
           del N

This means the exception must be assigned to a different name to be
able to refer to it after the except clause.  Exceptions are cleared
because with the traceback attached to them, they form a reference
cycle with the stack frame, keeping all locals in that frame alive
until the next garbage collection occurs.

Before an except clause’s suite is executed, details about the
exception are stored in the "sys" module and can be accessed via
"sys.exc_info()". "sys.exc_info()" returns a 3-tuple consisting of the
exception class, the exception instance and a traceback object (see
section The standard type hierarchy) identifying the point in the
program where the exception occurred.  "sys.exc_info()" values are
restored to their previous values (before the call) when returning
from a function that handled an exception.

The optional "else" clause is executed if the control flow leaves the
"try" suite, no exception was raised, and no "return", "continue", or
"break" statement was executed.  Exceptions in the "else" clause are
not handled by the preceding "except" clauses.

If "finally" is present, it specifies a ‘cleanup’ handler.  The "try"
clause is executed, including any "except" and "else" clauses.  If an
exception occurs in any of the clauses and is not handled, the
exception is temporarily saved. The "finally" clause is executed.  If
there is a saved exception it is re-raised at the end of the "finally"
clause.  If the "finally" clause raises another exception, the saved
exception is set as the context of the new exception. If the "finally"
clause executes a "return", "break" or "continue" statement, the saved
exception is discarded:

   >>> def f():
   ...     try:
   ...         1/0
   ...     finally:
   ...         return 42
   ...
   >>> f()
   42

The exception information is not available to the program during
execution of the "finally" clause.

When a "return", "break" or "continue" statement is executed in the
"try" suite of a "try"…"finally" statement, the "finally" clause is
also executed ‘on the way out.’

The return value of a function is determined by the last "return"
statement executed.  Since the "finally" clause always executes, a
"return" statement executed in the "finally" clause will always be the
last one executed:

   >>> def foo():
   ...     try:
   ...         return 'try'
   ...     finally:
   ...         return 'finally'
   ...
   >>> foo()
   'finally'

Additional information on exceptions can be found in section
Exceptions, and information on using the "raise" statement to generate
exceptions may be found in section The raise statement.

Changed in version 3.8: Prior to Python 3.8, a "continue" statement
was illegal in the "finally" clause due to a problem with the
implementation.
ux�The standard type hierarchy
***************************

Below is a list of the types that are built into Python.  Extension
modules (written in C, Java, or other languages, depending on the
implementation) can define additional types.  Future versions of
Python may add types to the type hierarchy (e.g., rational numbers,
efficiently stored arrays of integers, etc.), although such additions
will often be provided via the standard library instead.

Some of the type descriptions below contain a paragraph listing
‘special attributes.’  These are attributes that provide access to the
implementation and are not intended for general use.  Their definition
may change in the future.

None
   This type has a single value.  There is a single object with this
   value. This object is accessed through the built-in name "None". It
   is used to signify the absence of a value in many situations, e.g.,
   it is returned from functions that don’t explicitly return
   anything. Its truth value is false.

NotImplemented
   This type has a single value.  There is a single object with this
   value. This object is accessed through the built-in name
   "NotImplemented". Numeric methods and rich comparison methods
   should return this value if they do not implement the operation for
   the operands provided.  (The interpreter will then try the
   reflected operation, or some other fallback, depending on the
   operator.)  Its truth value is true.

   See Implementing the arithmetic operations for more details.

Ellipsis
   This type has a single value.  There is a single object with this
   value. This object is accessed through the literal "..." or the
   built-in name "Ellipsis".  Its truth value is true.

"numbers.Number"
   These are created by numeric literals and returned as results by
   arithmetic operators and arithmetic built-in functions.  Numeric
   objects are immutable; once created their value never changes.
   Python numbers are of course strongly related to mathematical
   numbers, but subject to the limitations of numerical representation
   in computers.

   The string representations of the numeric classes, computed by
   "__repr__()" and "__str__()", have the following properties:

   * They are valid numeric literals which, when passed to their class
     constructor, produce an object having the value of the original
     numeric.

   * The representation is in base 10, when possible.

   * Leading zeros, possibly excepting a single zero before a decimal
     point, are not shown.

   * Trailing zeros, possibly excepting a single zero after a decimal
     point, are not shown.

   * A sign is shown only when the number is negative.

   Python distinguishes between integers, floating point numbers, and
   complex numbers:

   "numbers.Integral"
      These represent elements from the mathematical set of integers
      (positive and negative).

      There are two types of integers:

      Integers ("int")
         These represent numbers in an unlimited range, subject to
         available (virtual) memory only.  For the purpose of shift
         and mask operations, a binary representation is assumed, and
         negative numbers are represented in a variant of 2’s
         complement which gives the illusion of an infinite string of
         sign bits extending to the left.

      Booleans ("bool")
         These represent the truth values False and True.  The two
         objects representing the values "False" and "True" are the
         only Boolean objects. The Boolean type is a subtype of the
         integer type, and Boolean values behave like the values 0 and
         1, respectively, in almost all contexts, the exception being
         that when converted to a string, the strings ""False"" or
         ""True"" are returned, respectively.

      The rules for integer representation are intended to give the
      most meaningful interpretation of shift and mask operations
      involving negative integers.

   "numbers.Real" ("float")
      These represent machine-level double precision floating point
      numbers. You are at the mercy of the underlying machine
      architecture (and C or Java implementation) for the accepted
      range and handling of overflow. Python does not support single-
      precision floating point numbers; the savings in processor and
      memory usage that are usually the reason for using these are
      dwarfed by the overhead of using objects in Python, so there is
      no reason to complicate the language with two kinds of floating
      point numbers.

   "numbers.Complex" ("complex")
      These represent complex numbers as a pair of machine-level
      double precision floating point numbers.  The same caveats apply
      as for floating point numbers. The real and imaginary parts of a
      complex number "z" can be retrieved through the read-only
      attributes "z.real" and "z.imag".

Sequences
   These represent finite ordered sets indexed by non-negative
   numbers. The built-in function "len()" returns the number of items
   of a sequence. When the length of a sequence is *n*, the index set
   contains the numbers 0, 1, …, *n*-1.  Item *i* of sequence *a* is
   selected by "a[i]".

   Sequences also support slicing: "a[i:j]" selects all items with
   index *k* such that *i* "<=" *k* "<" *j*.  When used as an
   expression, a slice is a sequence of the same type.  This implies
   that the index set is renumbered so that it starts at 0.

   Some sequences also support “extended slicing” with a third “step”
   parameter: "a[i:j:k]" selects all items of *a* with index *x* where
   "x = i + n*k", *n* ">=" "0" and *i* "<=" *x* "<" *j*.

   Sequences are distinguished according to their mutability:

   Immutable sequences
      An object of an immutable sequence type cannot change once it is
      created.  (If the object contains references to other objects,
      these other objects may be mutable and may be changed; however,
      the collection of objects directly referenced by an immutable
      object cannot change.)

      The following types are immutable sequences:

      Strings
         A string is a sequence of values that represent Unicode code
         points. All the code points in the range "U+0000 - U+10FFFF"
         can be represented in a string.  Python doesn’t have a "char"
         type; instead, every code point in the string is represented
         as a string object with length "1".  The built-in function
         "ord()" converts a code point from its string form to an
         integer in the range "0 - 10FFFF"; "chr()" converts an
         integer in the range "0 - 10FFFF" to the corresponding length
         "1" string object. "str.encode()" can be used to convert a
         "str" to "bytes" using the given text encoding, and
         "bytes.decode()" can be used to achieve the opposite.

      Tuples
         The items of a tuple are arbitrary Python objects. Tuples of
         two or more items are formed by comma-separated lists of
         expressions.  A tuple of one item (a ‘singleton’) can be
         formed by affixing a comma to an expression (an expression by
         itself does not create a tuple, since parentheses must be
         usable for grouping of expressions).  An empty tuple can be
         formed by an empty pair of parentheses.

      Bytes
         A bytes object is an immutable array.  The items are 8-bit
         bytes, represented by integers in the range 0 <= x < 256.
         Bytes literals (like "b'abc'") and the built-in "bytes()"
         constructor can be used to create bytes objects.  Also, bytes
         objects can be decoded to strings via the "decode()" method.

   Mutable sequences
      Mutable sequences can be changed after they are created.  The
      subscription and slicing notations can be used as the target of
      assignment and "del" (delete) statements.

      There are currently two intrinsic mutable sequence types:

      Lists
         The items of a list are arbitrary Python objects.  Lists are
         formed by placing a comma-separated list of expressions in
         square brackets. (Note that there are no special cases needed
         to form lists of length 0 or 1.)

      Byte Arrays
         A bytearray object is a mutable array. They are created by
         the built-in "bytearray()" constructor.  Aside from being
         mutable (and hence unhashable), byte arrays otherwise provide
         the same interface and functionality as immutable "bytes"
         objects.

      The extension module "array" provides an additional example of a
      mutable sequence type, as does the "collections" module.

Set types
   These represent unordered, finite sets of unique, immutable
   objects. As such, they cannot be indexed by any subscript. However,
   they can be iterated over, and the built-in function "len()"
   returns the number of items in a set. Common uses for sets are fast
   membership testing, removing duplicates from a sequence, and
   computing mathematical operations such as intersection, union,
   difference, and symmetric difference.

   For set elements, the same immutability rules apply as for
   dictionary keys. Note that numeric types obey the normal rules for
   numeric comparison: if two numbers compare equal (e.g., "1" and
   "1.0"), only one of them can be contained in a set.

   There are currently two intrinsic set types:

   Sets
      These represent a mutable set. They are created by the built-in
      "set()" constructor and can be modified afterwards by several
      methods, such as "add()".

   Frozen sets
      These represent an immutable set.  They are created by the
      built-in "frozenset()" constructor.  As a frozenset is immutable
      and *hashable*, it can be used again as an element of another
      set, or as a dictionary key.

Mappings
   These represent finite sets of objects indexed by arbitrary index
   sets. The subscript notation "a[k]" selects the item indexed by "k"
   from the mapping "a"; this can be used in expressions and as the
   target of assignments or "del" statements. The built-in function
   "len()" returns the number of items in a mapping.

   There is currently a single intrinsic mapping type:

   Dictionaries
      These represent finite sets of objects indexed by nearly
      arbitrary values.  The only types of values not acceptable as
      keys are values containing lists or dictionaries or other
      mutable types that are compared by value rather than by object
      identity, the reason being that the efficient implementation of
      dictionaries requires a key’s hash value to remain constant.
      Numeric types used for keys obey the normal rules for numeric
      comparison: if two numbers compare equal (e.g., "1" and "1.0")
      then they can be used interchangeably to index the same
      dictionary entry.

      Dictionaries preserve insertion order, meaning that keys will be
      produced in the same order they were added sequentially over the
      dictionary. Replacing an existing key does not change the order,
      however removing a key and re-inserting it will add it to the
      end instead of keeping its old place.

      Dictionaries are mutable; they can be created by the "{...}"
      notation (see section Dictionary displays).

      The extension modules "dbm.ndbm" and "dbm.gnu" provide
      additional examples of mapping types, as does the "collections"
      module.

      Changed in version 3.7: Dictionaries did not preserve insertion
      order in versions of Python before 3.6. In CPython 3.6,
      insertion order was preserved, but it was considered an
      implementation detail at that time rather than a language
      guarantee.

Callable types
   These are the types to which the function call operation (see
   section Calls) can be applied:

   User-defined functions
      A user-defined function object is created by a function
      definition (see section Function definitions).  It should be
      called with an argument list containing the same number of items
      as the function’s formal parameter list.

      Special attributes:

      +---------------------------+---------------------------------+-------------+
      | Attribute                 | Meaning                         |             |
      |===========================|=================================|=============|
      | "__doc__"                 | The function’s documentation    | Writable    |
      |                           | string, or "None" if            |             |
      |                           | unavailable; not inherited by   |             |
      |                           | subclasses.                     |             |
      +---------------------------+---------------------------------+-------------+
      | "__name__"                | The function’s name.            | Writable    |
      +---------------------------+---------------------------------+-------------+
      | "__qualname__"            | The function’s *qualified       | Writable    |
      |                           | name*.  New in version 3.3.     |             |
      +---------------------------+---------------------------------+-------------+
      | "__module__"              | The name of the module the      | Writable    |
      |                           | function was defined in, or     |             |
      |                           | "None" if unavailable.          |             |
      +---------------------------+---------------------------------+-------------+
      | "__defaults__"            | A tuple containing default      | Writable    |
      |                           | argument values for those       |             |
      |                           | arguments that have defaults,   |             |
      |                           | or "None" if no arguments have  |             |
      |                           | a default value.                |             |
      +---------------------------+---------------------------------+-------------+
      | "__code__"                | The code object representing    | Writable    |
      |                           | the compiled function body.     |             |
      +---------------------------+---------------------------------+-------------+
      | "__globals__"             | A reference to the dictionary   | Read-only   |
      |                           | that holds the function’s       |             |
      |                           | global variables — the global   |             |
      |                           | namespace of the module in      |             |
      |                           | which the function was defined. |             |
      +---------------------------+---------------------------------+-------------+
      | "__dict__"                | The namespace supporting        | Writable    |
      |                           | arbitrary function attributes.  |             |
      +---------------------------+---------------------------------+-------------+
      | "__closure__"             | "None" or a tuple of cells that | Read-only   |
      |                           | contain bindings for the        |             |
      |                           | function’s free variables. See  |             |
      |                           | below for information on the    |             |
      |                           | "cell_contents" attribute.      |             |
      +---------------------------+---------------------------------+-------------+
      | "__annotations__"         | A dict containing annotations   | Writable    |
      |                           | of parameters.  The keys of the |             |
      |                           | dict are the parameter names,   |             |
      |                           | and "'return'" for the return   |             |
      |                           | annotation, if provided.        |             |
      +---------------------------+---------------------------------+-------------+
      | "__kwdefaults__"          | A dict containing defaults for  | Writable    |
      |                           | keyword-only parameters.        |             |
      +---------------------------+---------------------------------+-------------+

      Most of the attributes labelled “Writable” check the type of the
      assigned value.

      Function objects also support getting and setting arbitrary
      attributes, which can be used, for example, to attach metadata
      to functions.  Regular attribute dot-notation is used to get and
      set such attributes. *Note that the current implementation only
      supports function attributes on user-defined functions. Function
      attributes on built-in functions may be supported in the
      future.*

      A cell object has the attribute "cell_contents". This can be
      used to get the value of the cell, as well as set the value.

      Additional information about a function’s definition can be
      retrieved from its code object; see the description of internal
      types below. The "cell" type can be accessed in the "types"
      module.

   Instance methods
      An instance method object combines a class, a class instance and
      any callable object (normally a user-defined function).

      Special read-only attributes: "__self__" is the class instance
      object, "__func__" is the function object; "__doc__" is the
      method’s documentation (same as "__func__.__doc__"); "__name__"
      is the method name (same as "__func__.__name__"); "__module__"
      is the name of the module the method was defined in, or "None"
      if unavailable.

      Methods also support accessing (but not setting) the arbitrary
      function attributes on the underlying function object.

      User-defined method objects may be created when getting an
      attribute of a class (perhaps via an instance of that class), if
      that attribute is a user-defined function object or a class
      method object.

      When an instance method object is created by retrieving a user-
      defined function object from a class via one of its instances,
      its "__self__" attribute is the instance, and the method object
      is said to be bound.  The new method’s "__func__" attribute is
      the original function object.

      When an instance method object is created by retrieving a class
      method object from a class or instance, its "__self__" attribute
      is the class itself, and its "__func__" attribute is the
      function object underlying the class method.

      When an instance method object is called, the underlying
      function ("__func__") is called, inserting the class instance
      ("__self__") in front of the argument list.  For instance, when
      "C" is a class which contains a definition for a function "f()",
      and "x" is an instance of "C", calling "x.f(1)" is equivalent to
      calling "C.f(x, 1)".

      When an instance method object is derived from a class method
      object, the “class instance” stored in "__self__" will actually
      be the class itself, so that calling either "x.f(1)" or "C.f(1)"
      is equivalent to calling "f(C,1)" where "f" is the underlying
      function.

      Note that the transformation from function object to instance
      method object happens each time the attribute is retrieved from
      the instance.  In some cases, a fruitful optimization is to
      assign the attribute to a local variable and call that local
      variable. Also notice that this transformation only happens for
      user-defined functions; other callable objects (and all non-
      callable objects) are retrieved without transformation.  It is
      also important to note that user-defined functions which are
      attributes of a class instance are not converted to bound
      methods; this *only* happens when the function is an attribute
      of the class.

   Generator functions
      A function or method which uses the "yield" statement (see
      section The yield statement) is called a *generator function*.
      Such a function, when called, always returns an iterator object
      which can be used to execute the body of the function:  calling
      the iterator’s "iterator.__next__()" method will cause the
      function to execute until it provides a value using the "yield"
      statement.  When the function executes a "return" statement or
      falls off the end, a "StopIteration" exception is raised and the
      iterator will have reached the end of the set of values to be
      returned.

   Coroutine functions
      A function or method which is defined using "async def" is
      called a *coroutine function*.  Such a function, when called,
      returns a *coroutine* object.  It may contain "await"
      expressions, as well as "async with" and "async for" statements.
      See also the Coroutine Objects section.

   Asynchronous generator functions
      A function or method which is defined using "async def" and
      which uses the "yield" statement is called a *asynchronous
      generator function*.  Such a function, when called, returns an
      asynchronous iterator object which can be used in an "async for"
      statement to execute the body of the function.

      Calling the asynchronous iterator’s "aiterator.__anext__()"
      method will return an *awaitable* which when awaited will
      execute until it provides a value using the "yield" expression.
      When the function executes an empty "return" statement or falls
      off the end, a "StopAsyncIteration" exception is raised and the
      asynchronous iterator will have reached the end of the set of
      values to be yielded.

   Built-in functions
      A built-in function object is a wrapper around a C function.
      Examples of built-in functions are "len()" and "math.sin()"
      ("math" is a standard built-in module). The number and type of
      the arguments are determined by the C function. Special read-
      only attributes: "__doc__" is the function’s documentation
      string, or "None" if unavailable; "__name__" is the function’s
      name; "__self__" is set to "None" (but see the next item);
      "__module__" is the name of the module the function was defined
      in or "None" if unavailable.

   Built-in methods
      This is really a different disguise of a built-in function, this
      time containing an object passed to the C function as an
      implicit extra argument.  An example of a built-in method is
      "alist.append()", assuming *alist* is a list object. In this
      case, the special read-only attribute "__self__" is set to the
      object denoted by *alist*.

   Classes
      Classes are callable.  These objects normally act as factories
      for new instances of themselves, but variations are possible for
      class types that override "__new__()".  The arguments of the
      call are passed to "__new__()" and, in the typical case, to
      "__init__()" to initialize the new instance.

   Class Instances
      Instances of arbitrary classes can be made callable by defining
      a "__call__()" method in their class.

Modules
   Modules are a basic organizational unit of Python code, and are
   created by the import system as invoked either by the "import"
   statement, or by calling functions such as
   "importlib.import_module()" and built-in "__import__()".  A module
   object has a namespace implemented by a dictionary object (this is
   the dictionary referenced by the "__globals__" attribute of
   functions defined in the module).  Attribute references are
   translated to lookups in this dictionary, e.g., "m.x" is equivalent
   to "m.__dict__["x"]". A module object does not contain the code
   object used to initialize the module (since it isn’t needed once
   the initialization is done).

   Attribute assignment updates the module’s namespace dictionary,
   e.g., "m.x = 1" is equivalent to "m.__dict__["x"] = 1".

   Predefined (writable) attributes: "__name__" is the module’s name;
   "__doc__" is the module’s documentation string, or "None" if
   unavailable; "__annotations__" (optional) is a dictionary
   containing *variable annotations* collected during module body
   execution; "__file__" is the pathname of the file from which the
   module was loaded, if it was loaded from a file. The "__file__"
   attribute may be missing for certain types of modules, such as C
   modules that are statically linked into the interpreter; for
   extension modules loaded dynamically from a shared library, it is
   the pathname of the shared library file.

   Special read-only attribute: "__dict__" is the module’s namespace
   as a dictionary object.

   **CPython implementation detail:** Because of the way CPython
   clears module dictionaries, the module dictionary will be cleared
   when the module falls out of scope even if the dictionary still has
   live references.  To avoid this, copy the dictionary or keep the
   module around while using its dictionary directly.

Custom classes
   Custom class types are typically created by class definitions (see
   section Class definitions).  A class has a namespace implemented by
   a dictionary object. Class attribute references are translated to
   lookups in this dictionary, e.g., "C.x" is translated to
   "C.__dict__["x"]" (although there are a number of hooks which allow
   for other means of locating attributes). When the attribute name is
   not found there, the attribute search continues in the base
   classes. This search of the base classes uses the C3 method
   resolution order which behaves correctly even in the presence of
   ‘diamond’ inheritance structures where there are multiple
   inheritance paths leading back to a common ancestor. Additional
   details on the C3 MRO used by Python can be found in the
   documentation accompanying the 2.3 release at
   https://www.python.org/download/releases/2.3/mro/.

   When a class attribute reference (for class "C", say) would yield a
   class method object, it is transformed into an instance method
   object whose "__self__" attribute is "C".  When it would yield a
   static method object, it is transformed into the object wrapped by
   the static method object. See section Implementing Descriptors for
   another way in which attributes retrieved from a class may differ
   from those actually contained in its "__dict__".

   Class attribute assignments update the class’s dictionary, never
   the dictionary of a base class.

   A class object can be called (see above) to yield a class instance
   (see below).

   Special attributes: "__name__" is the class name; "__module__" is
   the module name in which the class was defined; "__dict__" is the
   dictionary containing the class’s namespace; "__bases__" is a tuple
   containing the base classes, in the order of their occurrence in
   the base class list; "__doc__" is the class’s documentation string,
   or "None" if undefined; "__annotations__" (optional) is a
   dictionary containing *variable annotations* collected during class
   body execution.

Class instances
   A class instance is created by calling a class object (see above).
   A class instance has a namespace implemented as a dictionary which
   is the first place in which attribute references are searched.
   When an attribute is not found there, and the instance’s class has
   an attribute by that name, the search continues with the class
   attributes.  If a class attribute is found that is a user-defined
   function object, it is transformed into an instance method object
   whose "__self__" attribute is the instance.  Static method and
   class method objects are also transformed; see above under
   “Classes”.  See section Implementing Descriptors for another way in
   which attributes of a class retrieved via its instances may differ
   from the objects actually stored in the class’s "__dict__".  If no
   class attribute is found, and the object’s class has a
   "__getattr__()" method, that is called to satisfy the lookup.

   Attribute assignments and deletions update the instance’s
   dictionary, never a class’s dictionary.  If the class has a
   "__setattr__()" or "__delattr__()" method, this is called instead
   of updating the instance dictionary directly.

   Class instances can pretend to be numbers, sequences, or mappings
   if they have methods with certain special names.  See section
   Special method names.

   Special attributes: "__dict__" is the attribute dictionary;
   "__class__" is the instance’s class.

I/O objects (also known as file objects)
   A *file object* represents an open file.  Various shortcuts are
   available to create file objects: the "open()" built-in function,
   and also "os.popen()", "os.fdopen()", and the "makefile()" method
   of socket objects (and perhaps by other functions or methods
   provided by extension modules).

   The objects "sys.stdin", "sys.stdout" and "sys.stderr" are
   initialized to file objects corresponding to the interpreter’s
   standard input, output and error streams; they are all open in text
   mode and therefore follow the interface defined by the
   "io.TextIOBase" abstract class.

Internal types
   A few types used internally by the interpreter are exposed to the
   user. Their definitions may change with future versions of the
   interpreter, but they are mentioned here for completeness.

   Code objects
      Code objects represent *byte-compiled* executable Python code,
      or *bytecode*. The difference between a code object and a
      function object is that the function object contains an explicit
      reference to the function’s globals (the module in which it was
      defined), while a code object contains no context; also the
      default argument values are stored in the function object, not
      in the code object (because they represent values calculated at
      run-time).  Unlike function objects, code objects are immutable
      and contain no references (directly or indirectly) to mutable
      objects.

      Special read-only attributes: "co_name" gives the function name;
      "co_argcount" is the total number of positional arguments
      (including positional-only arguments and arguments with default
      values); "co_posonlyargcount" is the number of positional-only
      arguments (including arguments with default values);
      "co_kwonlyargcount" is the number of keyword-only arguments
      (including arguments with default values); "co_nlocals" is the
      number of local variables used by the function (including
      arguments); "co_varnames" is a tuple containing the names of the
      local variables (starting with the argument names);
      "co_cellvars" is a tuple containing the names of local variables
      that are referenced by nested functions; "co_freevars" is a
      tuple containing the names of free variables; "co_code" is a
      string representing the sequence of bytecode instructions;
      "co_consts" is a tuple containing the literals used by the
      bytecode; "co_names" is a tuple containing the names used by the
      bytecode; "co_filename" is the filename from which the code was
      compiled; "co_firstlineno" is the first line number of the
      function; "co_lnotab" is a string encoding the mapping from
      bytecode offsets to line numbers (for details see the source
      code of the interpreter); "co_stacksize" is the required stack
      size; "co_flags" is an integer encoding a number of flags for
      the interpreter.

      The following flag bits are defined for "co_flags": bit "0x04"
      is set if the function uses the "*arguments" syntax to accept an
      arbitrary number of positional arguments; bit "0x08" is set if
      the function uses the "**keywords" syntax to accept arbitrary
      keyword arguments; bit "0x20" is set if the function is a
      generator.

      Future feature declarations ("from __future__ import division")
      also use bits in "co_flags" to indicate whether a code object
      was compiled with a particular feature enabled: bit "0x2000" is
      set if the function was compiled with future division enabled;
      bits "0x10" and "0x1000" were used in earlier versions of
      Python.

      Other bits in "co_flags" are reserved for internal use.

      If a code object represents a function, the first item in
      "co_consts" is the documentation string of the function, or
      "None" if undefined.

   Frame objects
      Frame objects represent execution frames.  They may occur in
      traceback objects (see below), and are also passed to registered
      trace functions.

      Special read-only attributes: "f_back" is to the previous stack
      frame (towards the caller), or "None" if this is the bottom
      stack frame; "f_code" is the code object being executed in this
      frame; "f_locals" is the dictionary used to look up local
      variables; "f_globals" is used for global variables;
      "f_builtins" is used for built-in (intrinsic) names; "f_lasti"
      gives the precise instruction (this is an index into the
      bytecode string of the code object).

      Accessing "f_code" raises an auditing event "object.__getattr__"
      with arguments "obj" and ""f_code"".

      Special writable attributes: "f_trace", if not "None", is a
      function called for various events during code execution (this
      is used by the debugger). Normally an event is triggered for
      each new source line - this can be disabled by setting
      "f_trace_lines" to "False".

      Implementations *may* allow per-opcode events to be requested by
      setting "f_trace_opcodes" to "True". Note that this may lead to
      undefined interpreter behaviour if exceptions raised by the
      trace function escape to the function being traced.

      "f_lineno" is the current line number of the frame — writing to
      this from within a trace function jumps to the given line (only
      for the bottom-most frame).  A debugger can implement a Jump
      command (aka Set Next Statement) by writing to f_lineno.

      Frame objects support one method:

      frame.clear()

         This method clears all references to local variables held by
         the frame.  Also, if the frame belonged to a generator, the
         generator is finalized.  This helps break reference cycles
         involving frame objects (for example when catching an
         exception and storing its traceback for later use).

         "RuntimeError" is raised if the frame is currently executing.

         New in version 3.4.

   Traceback objects
      Traceback objects represent a stack trace of an exception.  A
      traceback object is implicitly created when an exception occurs,
      and may also be explicitly created by calling
      "types.TracebackType".

      For implicitly created tracebacks, when the search for an
      exception handler unwinds the execution stack, at each unwound
      level a traceback object is inserted in front of the current
      traceback.  When an exception handler is entered, the stack
      trace is made available to the program. (See section The try
      statement.) It is accessible as the third item of the tuple
      returned by "sys.exc_info()", and as the "__traceback__"
      attribute of the caught exception.

      When the program contains no suitable handler, the stack trace
      is written (nicely formatted) to the standard error stream; if
      the interpreter is interactive, it is also made available to the
      user as "sys.last_traceback".

      For explicitly created tracebacks, it is up to the creator of
      the traceback to determine how the "tb_next" attributes should
      be linked to form a full stack trace.

      Special read-only attributes: "tb_frame" points to the execution
      frame of the current level; "tb_lineno" gives the line number
      where the exception occurred; "tb_lasti" indicates the precise
      instruction. The line number and last instruction in the
      traceback may differ from the line number of its frame object if
      the exception occurred in a "try" statement with no matching
      except clause or with a finally clause.

      Accessing "tb_frame" raises an auditing event
      "object.__getattr__" with arguments "obj" and ""tb_frame"".

      Special writable attribute: "tb_next" is the next level in the
      stack trace (towards the frame where the exception occurred), or
      "None" if there is no next level.

      Changed in version 3.7: Traceback objects can now be explicitly
      instantiated from Python code, and the "tb_next" attribute of
      existing instances can be updated.

   Slice objects
      Slice objects are used to represent slices for "__getitem__()"
      methods.  They are also created by the built-in "slice()"
      function.

      Special read-only attributes: "start" is the lower bound; "stop"
      is the upper bound; "step" is the step value; each is "None" if
      omitted.  These attributes can have any type.

      Slice objects support one method:

      slice.indices(self, length)

         This method takes a single integer argument *length* and
         computes information about the slice that the slice object
         would describe if applied to a sequence of *length* items.
         It returns a tuple of three integers; respectively these are
         the *start* and *stop* indices and the *step* or stride
         length of the slice. Missing or out-of-bounds indices are
         handled in a manner consistent with regular slices.

   Static method objects
      Static method objects provide a way of defeating the
      transformation of function objects to method objects described
      above. A static method object is a wrapper around any other
      object, usually a user-defined method object. When a static
      method object is retrieved from a class or a class instance, the
      object actually returned is the wrapped object, which is not
      subject to any further transformation. Static method objects are
      not themselves callable, although the objects they wrap usually
      are. Static method objects are created by the built-in
      "staticmethod()" constructor.

   Class method objects
      A class method object, like a static method object, is a wrapper
      around another object that alters the way in which that object
      is retrieved from classes and class instances. The behaviour of
      class method objects upon such retrieval is described above,
      under “User-defined methods”. Class method objects are created
      by the built-in "classmethod()" constructor.
a�Functions
*********

Function objects are created by function definitions.  The only
operation on a function object is to call it: "func(argument-list)".

There are really two flavors of function objects: built-in functions
and user-defined functions.  Both support the same operation (to call
the function), but the implementation is different, hence the
different object types.

See Function definitions for more information.
u(.Mapping Types — "dict"
**********************

A *mapping* object maps *hashable* values to arbitrary objects.
Mappings are mutable objects.  There is currently only one standard
mapping type, the *dictionary*.  (For other containers see the built-
in "list", "set", and "tuple" classes, and the "collections" module.)

A dictionary’s keys are *almost* arbitrary values.  Values that are
not *hashable*, that is, values containing lists, dictionaries or
other mutable types (that are compared by value rather than by object
identity) may not be used as keys.  Numeric types used for keys obey
the normal rules for numeric comparison: if two numbers compare equal
(such as "1" and "1.0") then they can be used interchangeably to index
the same dictionary entry.  (Note however, that since computers store
floating-point numbers as approximations it is usually unwise to use
them as dictionary keys.)

Dictionaries can be created by placing a comma-separated list of "key:
value" pairs within braces, for example: "{'jack': 4098, 'sjoerd':
4127}" or "{4098: 'jack', 4127: 'sjoerd'}", or by the "dict"
constructor.

class dict(**kwarg)
class dict(mapping, **kwarg)
class dict(iterable, **kwarg)

   Return a new dictionary initialized from an optional positional
   argument and a possibly empty set of keyword arguments.

   Dictionaries can be created by several means:

   * Use a comma-separated list of "key: value" pairs within braces:
     "{'jack': 4098, 'sjoerd': 4127}" or "{4098: 'jack', 4127:
     'sjoerd'}"

   * Use a dict comprehension: "{}", "{x: x ** 2 for x in range(10)}"

   * Use the type constructor: "dict()", "dict([('foo', 100), ('bar',
     200)])", "dict(foo=100, bar=200)"

   If no positional argument is given, an empty dictionary is created.
   If a positional argument is given and it is a mapping object, a
   dictionary is created with the same key-value pairs as the mapping
   object.  Otherwise, the positional argument must be an *iterable*
   object.  Each item in the iterable must itself be an iterable with
   exactly two objects.  The first object of each item becomes a key
   in the new dictionary, and the second object the corresponding
   value.  If a key occurs more than once, the last value for that key
   becomes the corresponding value in the new dictionary.

   If keyword arguments are given, the keyword arguments and their
   values are added to the dictionary created from the positional
   argument.  If a key being added is already present, the value from
   the keyword argument replaces the value from the positional
   argument.

   To illustrate, the following examples all return a dictionary equal
   to "{"one": 1, "two": 2, "three": 3}":

      >>> a = dict(one=1, two=2, three=3)
      >>> b = {'one': 1, 'two': 2, 'three': 3}
      >>> c = dict(zip(['one', 'two', 'three'], [1, 2, 3]))
      >>> d = dict([('two', 2), ('one', 1), ('three', 3)])
      >>> e = dict({'three': 3, 'one': 1, 'two': 2})
      >>> a == b == c == d == e
      True

   Providing keyword arguments as in the first example only works for
   keys that are valid Python identifiers.  Otherwise, any valid keys
   can be used.

   These are the operations that dictionaries support (and therefore,
   custom mapping types should support too):

   list(d)

      Return a list of all the keys used in the dictionary *d*.

   len(d)

      Return the number of items in the dictionary *d*.

   d[key]

      Return the item of *d* with key *key*.  Raises a "KeyError" if
      *key* is not in the map.

      If a subclass of dict defines a method "__missing__()" and *key*
      is not present, the "d[key]" operation calls that method with
      the key *key* as argument.  The "d[key]" operation then returns
      or raises whatever is returned or raised by the
      "__missing__(key)" call. No other operations or methods invoke
      "__missing__()". If "__missing__()" is not defined, "KeyError"
      is raised. "__missing__()" must be a method; it cannot be an
      instance variable:

         >>> class Counter(dict):
         ...     def __missing__(self, key):
         ...         return 0
         >>> c = Counter()
         >>> c['red']
         0
         >>> c['red'] += 1
         >>> c['red']
         1

      The example above shows part of the implementation of
      "collections.Counter".  A different "__missing__" method is used
      by "collections.defaultdict".

   d[key] = value

      Set "d[key]" to *value*.

   del d[key]

      Remove "d[key]" from *d*.  Raises a "KeyError" if *key* is not
      in the map.

   key in d

      Return "True" if *d* has a key *key*, else "False".

   key not in d

      Equivalent to "not key in d".

   iter(d)

      Return an iterator over the keys of the dictionary.  This is a
      shortcut for "iter(d.keys())".

   clear()

      Remove all items from the dictionary.

   copy()

      Return a shallow copy of the dictionary.

   classmethod fromkeys(iterable[, value])

      Create a new dictionary with keys from *iterable* and values set
      to *value*.

      "fromkeys()" is a class method that returns a new dictionary.
      *value* defaults to "None".  All of the values refer to just a
      single instance, so it generally doesn’t make sense for *value*
      to be a mutable object such as an empty list.  To get distinct
      values, use a dict comprehension instead.

   get(key[, default])

      Return the value for *key* if *key* is in the dictionary, else
      *default*. If *default* is not given, it defaults to "None", so
      that this method never raises a "KeyError".

   items()

      Return a new view of the dictionary’s items ("(key, value)"
      pairs). See the documentation of view objects.

   keys()

      Return a new view of the dictionary’s keys.  See the
      documentation of view objects.

   pop(key[, default])

      If *key* is in the dictionary, remove it and return its value,
      else return *default*.  If *default* is not given and *key* is
      not in the dictionary, a "KeyError" is raised.

   popitem()

      Remove and return a "(key, value)" pair from the dictionary.
      Pairs are returned in LIFO (last-in, first-out) order.

      "popitem()" is useful to destructively iterate over a
      dictionary, as often used in set algorithms.  If the dictionary
      is empty, calling "popitem()" raises a "KeyError".

      Changed in version 3.7: LIFO order is now guaranteed. In prior
      versions, "popitem()" would return an arbitrary key/value pair.

   reversed(d)

      Return a reverse iterator over the keys of the dictionary. This
      is a shortcut for "reversed(d.keys())".

      New in version 3.8.

   setdefault(key[, default])

      If *key* is in the dictionary, return its value.  If not, insert
      *key* with a value of *default* and return *default*.  *default*
      defaults to "None".

   update([other])

      Update the dictionary with the key/value pairs from *other*,
      overwriting existing keys.  Return "None".

      "update()" accepts either another dictionary object or an
      iterable of key/value pairs (as tuples or other iterables of
      length two).  If keyword arguments are specified, the dictionary
      is then updated with those key/value pairs: "d.update(red=1,
      blue=2)".

   values()

      Return a new view of the dictionary’s values.  See the
      documentation of view objects.

      An equality comparison between one "dict.values()" view and
      another will always return "False". This also applies when
      comparing "dict.values()" to itself:

         >>> d = {'a': 1}
         >>> d.values() == d.values()
         False

   Dictionaries compare equal if and only if they have the same "(key,
   value)" pairs (regardless of ordering). Order comparisons (‘<’,
   ‘<=’, ‘>=’, ‘>’) raise "TypeError".

   Dictionaries preserve insertion order.  Note that updating a key
   does not affect the order.  Keys added after deletion are inserted
   at the end.

      >>> d = {"one": 1, "two": 2, "three": 3, "four": 4}
      >>> d
      {'one': 1, 'two': 2, 'three': 3, 'four': 4}
      >>> list(d)
      ['one', 'two', 'three', 'four']
      >>> list(d.values())
      [1, 2, 3, 4]
      >>> d["one"] = 42
      >>> d
      {'one': 42, 'two': 2, 'three': 3, 'four': 4}
      >>> del d["two"]
      >>> d["two"] = None
      >>> d
      {'one': 42, 'three': 3, 'four': 4, 'two': None}

   Changed in version 3.7: Dictionary order is guaranteed to be
   insertion order.  This behavior was an implementation detail of
   CPython from 3.6.

   Dictionaries and dictionary views are reversible.

      >>> d = {"one": 1, "two": 2, "three": 3, "four": 4}
      >>> d
      {'one': 1, 'two': 2, 'three': 3, 'four': 4}
      >>> list(reversed(d))
      ['four', 'three', 'two', 'one']
      >>> list(reversed(d.values()))
      [4, 3, 2, 1]
      >>> list(reversed(d.items()))
      [('four', 4), ('three', 3), ('two', 2), ('one', 1)]

   Changed in version 3.8: Dictionaries are now reversible.

See also:

  "types.MappingProxyType" can be used to create a read-only view of a
  "dict".


Dictionary view objects
=======================

The objects returned by "dict.keys()", "dict.values()" and
"dict.items()" are *view objects*.  They provide a dynamic view on the
dictionary’s entries, which means that when the dictionary changes,
the view reflects these changes.

Dictionary views can be iterated over to yield their respective data,
and support membership tests:

len(dictview)

   Return the number of entries in the dictionary.

iter(dictview)

   Return an iterator over the keys, values or items (represented as
   tuples of "(key, value)") in the dictionary.

   Keys and values are iterated over in insertion order. This allows
   the creation of "(value, key)" pairs using "zip()": "pairs =
   zip(d.values(), d.keys())".  Another way to create the same list is
   "pairs = [(v, k) for (k, v) in d.items()]".

   Iterating views while adding or deleting entries in the dictionary
   may raise a "RuntimeError" or fail to iterate over all entries.

   Changed in version 3.7: Dictionary order is guaranteed to be
   insertion order.

x in dictview

   Return "True" if *x* is in the underlying dictionary’s keys, values
   or items (in the latter case, *x* should be a "(key, value)"
   tuple).

reversed(dictview)

   Return a reverse iterator over the keys, values or items of the
   dictionary. The view will be iterated in reverse order of the
   insertion.

   Changed in version 3.8: Dictionary views are now reversible.

Keys views are set-like since their entries are unique and hashable.
If all values are hashable, so that "(key, value)" pairs are unique
and hashable, then the items view is also set-like.  (Values views are
not treated as set-like since the entries are generally not unique.)
For set-like views, all of the operations defined for the abstract
base class "collections.abc.Set" are available (for example, "==",
"<", or "^").

An example of dictionary view usage:

   >>> dishes = {'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500}
   >>> keys = dishes.keys()
   >>> values = dishes.values()

   >>> # iteration
   >>> n = 0
   >>> for val in values:
   ...     n += val
   >>> print(n)
   504

   >>> # keys and values are iterated over in the same order (insertion order)
   >>> list(keys)
   ['eggs', 'sausage', 'bacon', 'spam']
   >>> list(values)
   [2, 1, 1, 500]

   >>> # view objects are dynamic and reflect dict changes
   >>> del dishes['eggs']
   >>> del dishes['sausage']
   >>> list(keys)
   ['bacon', 'spam']

   >>> # set operations
   >>> keys & {'eggs', 'bacon', 'salad'}
   {'bacon'}
   >>> keys ^ {'sausage', 'juice'}
   {'juice', 'sausage', 'bacon', 'spam'}
a�Methods
*******

Methods are functions that are called using the attribute notation.
There are two flavors: built-in methods (such as "append()" on lists)
and class instance methods.  Built-in methods are described with the
types that support them.

If you access a method (a function defined in a class namespace)
through an instance, you get a special object: a *bound method* (also
called *instance method*) object. When called, it will add the "self"
argument to the argument list.  Bound methods have two special read-
only attributes: "m.__self__" is the object on which the method
operates, and "m.__func__" is the function implementing the method.
Calling "m(arg-1, arg-2, ..., arg-n)" is completely equivalent to
calling "m.__func__(m.__self__, arg-1, arg-2, ..., arg-n)".

Like function objects, bound method objects support getting arbitrary
attributes.  However, since method attributes are actually stored on
the underlying function object ("meth.__func__"), setting method
attributes on bound methods is disallowed.  Attempting to set an
attribute on a method results in an "AttributeError" being raised.  In
order to set a method attribute, you need to explicitly set it on the
underlying function object:

   >>> class C:
   ...     def method(self):
   ...         pass
   ...
   >>> c = C()
   >>> c.method.whoami = 'my name is method'  # can't set on the method
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
   AttributeError: 'method' object has no attribute 'whoami'
   >>> c.method.__func__.whoami = 'my name is method'
   >>> c.method.whoami
   'my name is method'

See The standard type hierarchy for more information.
u$Modules
*******

The only special operation on a module is attribute access: "m.name",
where *m* is a module and *name* accesses a name defined in *m*’s
symbol table. Module attributes can be assigned to.  (Note that the
"import" statement is not, strictly speaking, an operation on a module
object; "import foo" does not require a module object named *foo* to
exist, rather it requires an (external) *definition* for a module
named *foo* somewhere.)

A special attribute of every module is "__dict__". This is the
dictionary containing the module’s symbol table. Modifying this
dictionary will actually change the module’s symbol table, but direct
assignment to the "__dict__" attribute is not possible (you can write
"m.__dict__['a'] = 1", which defines "m.a" to be "1", but you can’t
write "m.__dict__ = {}").  Modifying "__dict__" directly is not
recommended.

Modules built into the interpreter are written like this: "<module
'sys' (built-in)>".  If loaded from a file, they are written as
"<module 'os' from '/usr/local/lib/pythonX.Y/os.pyc'>".
u�ZSequence Types — "list", "tuple", "range"
*****************************************

There are three basic sequence types: lists, tuples, and range
objects. Additional sequence types tailored for processing of binary
data and text strings are described in dedicated sections.


Common Sequence Operations
==========================

The operations in the following table are supported by most sequence
types, both mutable and immutable. The "collections.abc.Sequence" ABC
is provided to make it easier to correctly implement these operations
on custom sequence types.

This table lists the sequence operations sorted in ascending priority.
In the table, *s* and *t* are sequences of the same type, *n*, *i*,
*j* and *k* are integers and *x* is an arbitrary object that meets any
type and value restrictions imposed by *s*.

The "in" and "not in" operations have the same priorities as the
comparison operations. The "+" (concatenation) and "*" (repetition)
operations have the same priority as the corresponding numeric
operations. [3]

+----------------------------+----------------------------------+------------+
| Operation                  | Result                           | Notes      |
|============================|==================================|============|
| "x in s"                   | "True" if an item of *s* is      | (1)        |
|                            | equal to *x*, else "False"       |            |
+----------------------------+----------------------------------+------------+
| "x not in s"               | "False" if an item of *s* is     | (1)        |
|                            | equal to *x*, else "True"        |            |
+----------------------------+----------------------------------+------------+
| "s + t"                    | the concatenation of *s* and *t* | (6)(7)     |
+----------------------------+----------------------------------+------------+
| "s * n" or "n * s"         | equivalent to adding *s* to      | (2)(7)     |
|                            | itself *n* times                 |            |
+----------------------------+----------------------------------+------------+
| "s[i]"                     | *i*th item of *s*, origin 0      | (3)        |
+----------------------------+----------------------------------+------------+
| "s[i:j]"                   | slice of *s* from *i* to *j*     | (3)(4)     |
+----------------------------+----------------------------------+------------+
| "s[i:j:k]"                 | slice of *s* from *i* to *j*     | (3)(5)     |
|                            | with step *k*                    |            |
+----------------------------+----------------------------------+------------+
| "len(s)"                   | length of *s*                    |            |
+----------------------------+----------------------------------+------------+
| "min(s)"                   | smallest item of *s*             |            |
+----------------------------+----------------------------------+------------+
| "max(s)"                   | largest item of *s*              |            |
+----------------------------+----------------------------------+------------+
| "s.index(x[, i[, j]])"     | index of the first occurrence of | (8)        |
|                            | *x* in *s* (at or after index    |            |
|                            | *i* and before index *j*)        |            |
+----------------------------+----------------------------------+------------+
| "s.count(x)"               | total number of occurrences of   |            |
|                            | *x* in *s*                       |            |
+----------------------------+----------------------------------+------------+

Sequences of the same type also support comparisons.  In particular,
tuples and lists are compared lexicographically by comparing
corresponding elements. This means that to compare equal, every
element must compare equal and the two sequences must be of the same
type and have the same length.  (For full details see Comparisons in
the language reference.)

Notes:

1. While the "in" and "not in" operations are used only for simple
   containment testing in the general case, some specialised sequences
   (such as "str", "bytes" and "bytearray") also use them for
   subsequence testing:

      >>> "gg" in "eggs"
      True

2. Values of *n* less than "0" are treated as "0" (which yields an
   empty sequence of the same type as *s*).  Note that items in the
   sequence *s* are not copied; they are referenced multiple times.
   This often haunts new Python programmers; consider:

      >>> lists = [[]] * 3
      >>> lists
      [[], [], []]
      >>> lists[0].append(3)
      >>> lists
      [[3], [3], [3]]

   What has happened is that "[[]]" is a one-element list containing
   an empty list, so all three elements of "[[]] * 3" are references
   to this single empty list.  Modifying any of the elements of
   "lists" modifies this single list. You can create a list of
   different lists this way:

      >>> lists = [[] for i in range(3)]
      >>> lists[0].append(3)
      >>> lists[1].append(5)
      >>> lists[2].append(7)
      >>> lists
      [[3], [5], [7]]

   Further explanation is available in the FAQ entry How do I create a
   multidimensional list?.

3. If *i* or *j* is negative, the index is relative to the end of
   sequence *s*: "len(s) + i" or "len(s) + j" is substituted.  But
   note that "-0" is still "0".

4. The slice of *s* from *i* to *j* is defined as the sequence of
   items with index *k* such that "i <= k < j".  If *i* or *j* is
   greater than "len(s)", use "len(s)".  If *i* is omitted or "None",
   use "0".  If *j* is omitted or "None", use "len(s)".  If *i* is
   greater than or equal to *j*, the slice is empty.

5. The slice of *s* from *i* to *j* with step *k* is defined as the
   sequence of items with index  "x = i + n*k" such that "0 <= n <
   (j-i)/k".  In other words, the indices are "i", "i+k", "i+2*k",
   "i+3*k" and so on, stopping when *j* is reached (but never
   including *j*).  When *k* is positive, *i* and *j* are reduced to
   "len(s)" if they are greater. When *k* is negative, *i* and *j* are
   reduced to "len(s) - 1" if they are greater.  If *i* or *j* are
   omitted or "None", they become “end” values (which end depends on
   the sign of *k*).  Note, *k* cannot be zero. If *k* is "None", it
   is treated like "1".

6. Concatenating immutable sequences always results in a new object.
   This means that building up a sequence by repeated concatenation
   will have a quadratic runtime cost in the total sequence length.
   To get a linear runtime cost, you must switch to one of the
   alternatives below:

   * if concatenating "str" objects, you can build a list and use
     "str.join()" at the end or else write to an "io.StringIO"
     instance and retrieve its value when complete

   * if concatenating "bytes" objects, you can similarly use
     "bytes.join()" or "io.BytesIO", or you can do in-place
     concatenation with a "bytearray" object.  "bytearray" objects are
     mutable and have an efficient overallocation mechanism

   * if concatenating "tuple" objects, extend a "list" instead

   * for other types, investigate the relevant class documentation

7. Some sequence types (such as "range") only support item sequences
   that follow specific patterns, and hence don’t support sequence
   concatenation or repetition.

8. "index" raises "ValueError" when *x* is not found in *s*. Not all
   implementations support passing the additional arguments *i* and
   *j*. These arguments allow efficient searching of subsections of
   the sequence. Passing the extra arguments is roughly equivalent to
   using "s[i:j].index(x)", only without copying any data and with the
   returned index being relative to the start of the sequence rather
   than the start of the slice.


Immutable Sequence Types
========================

The only operation that immutable sequence types generally implement
that is not also implemented by mutable sequence types is support for
the "hash()" built-in.

This support allows immutable sequences, such as "tuple" instances, to
be used as "dict" keys and stored in "set" and "frozenset" instances.

Attempting to hash an immutable sequence that contains unhashable
values will result in "TypeError".


Mutable Sequence Types
======================

The operations in the following table are defined on mutable sequence
types. The "collections.abc.MutableSequence" ABC is provided to make
it easier to correctly implement these operations on custom sequence
types.

In the table *s* is an instance of a mutable sequence type, *t* is any
iterable object and *x* is an arbitrary object that meets any type and
value restrictions imposed by *s* (for example, "bytearray" only
accepts integers that meet the value restriction "0 <= x <= 255").

+--------------------------------+----------------------------------+-----------------------+
| Operation                      | Result                           | Notes                 |
|================================|==================================|=======================|
| "s[i] = x"                     | item *i* of *s* is replaced by   |                       |
|                                | *x*                              |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s[i:j] = t"                   | slice of *s* from *i* to *j* is  |                       |
|                                | replaced by the contents of the  |                       |
|                                | iterable *t*                     |                       |
+--------------------------------+----------------------------------+-----------------------+
| "del s[i:j]"                   | same as "s[i:j] = []"            |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s[i:j:k] = t"                 | the elements of "s[i:j:k]" are   | (1)                   |
|                                | replaced by those of *t*         |                       |
+--------------------------------+----------------------------------+-----------------------+
| "del s[i:j:k]"                 | removes the elements of          |                       |
|                                | "s[i:j:k]" from the list         |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.append(x)"                  | appends *x* to the end of the    |                       |
|                                | sequence (same as                |                       |
|                                | "s[len(s):len(s)] = [x]")        |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.clear()"                    | removes all items from *s* (same | (5)                   |
|                                | as "del s[:]")                   |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.copy()"                     | creates a shallow copy of *s*    | (5)                   |
|                                | (same as "s[:]")                 |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.extend(t)" or "s += t"      | extends *s* with the contents of |                       |
|                                | *t* (for the most part the same  |                       |
|                                | as "s[len(s):len(s)] = t")       |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s *= n"                       | updates *s* with its contents    | (6)                   |
|                                | repeated *n* times               |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.insert(i, x)"               | inserts *x* into *s* at the      |                       |
|                                | index given by *i* (same as      |                       |
|                                | "s[i:i] = [x]")                  |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.pop()" or "s.pop(i)"        | retrieves the item at *i* and    | (2)                   |
|                                | also removes it from *s*         |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.remove(x)"                  | remove the first item from *s*   | (3)                   |
|                                | where "s[i]" is equal to *x*     |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.reverse()"                  | reverses the items of *s* in     | (4)                   |
|                                | place                            |                       |
+--------------------------------+----------------------------------+-----------------------+

Notes:

1. *t* must have the same length as the slice it is replacing.

2. The optional argument *i* defaults to "-1", so that by default the
   last item is removed and returned.

3. "remove()" raises "ValueError" when *x* is not found in *s*.

4. The "reverse()" method modifies the sequence in place for economy
   of space when reversing a large sequence.  To remind users that it
   operates by side effect, it does not return the reversed sequence.

5. "clear()" and "copy()" are included for consistency with the
   interfaces of mutable containers that don’t support slicing
   operations (such as "dict" and "set"). "copy()" is not part of the
   "collections.abc.MutableSequence" ABC, but most concrete mutable
   sequence classes provide it.

   New in version 3.3: "clear()" and "copy()" methods.

6. The value *n* is an integer, or an object implementing
   "__index__()".  Zero and negative values of *n* clear the sequence.
   Items in the sequence are not copied; they are referenced multiple
   times, as explained for "s * n" under Common Sequence Operations.


Lists
=====

Lists are mutable sequences, typically used to store collections of
homogeneous items (where the precise degree of similarity will vary by
application).

class list([iterable])

   Lists may be constructed in several ways:

   * Using a pair of square brackets to denote the empty list: "[]"

   * Using square brackets, separating items with commas: "[a]", "[a,
     b, c]"

   * Using a list comprehension: "[x for x in iterable]"

   * Using the type constructor: "list()" or "list(iterable)"

   The constructor builds a list whose items are the same and in the
   same order as *iterable*’s items.  *iterable* may be either a
   sequence, a container that supports iteration, or an iterator
   object.  If *iterable* is already a list, a copy is made and
   returned, similar to "iterable[:]". For example, "list('abc')"
   returns "['a', 'b', 'c']" and "list( (1, 2, 3) )" returns "[1, 2,
   3]". If no argument is given, the constructor creates a new empty
   list, "[]".

   Many other operations also produce lists, including the "sorted()"
   built-in.

   Lists implement all of the common and mutable sequence operations.
   Lists also provide the following additional method:

   sort(*, key=None, reverse=False)

      This method sorts the list in place, using only "<" comparisons
      between items. Exceptions are not suppressed - if any comparison
      operations fail, the entire sort operation will fail (and the
      list will likely be left in a partially modified state).

      "sort()" accepts two arguments that can only be passed by
      keyword (keyword-only arguments):

      *key* specifies a function of one argument that is used to
      extract a comparison key from each list element (for example,
      "key=str.lower"). The key corresponding to each item in the list
      is calculated once and then used for the entire sorting process.
      The default value of "None" means that list items are sorted
      directly without calculating a separate key value.

      The "functools.cmp_to_key()" utility is available to convert a
      2.x style *cmp* function to a *key* function.

      *reverse* is a boolean value.  If set to "True", then the list
      elements are sorted as if each comparison were reversed.

      This method modifies the sequence in place for economy of space
      when sorting a large sequence.  To remind users that it operates
      by side effect, it does not return the sorted sequence (use
      "sorted()" to explicitly request a new sorted list instance).

      The "sort()" method is guaranteed to be stable.  A sort is
      stable if it guarantees not to change the relative order of
      elements that compare equal — this is helpful for sorting in
      multiple passes (for example, sort by department, then by salary
      grade).

      For sorting examples and a brief sorting tutorial, see Sorting
      HOW TO.

      **CPython implementation detail:** While a list is being sorted,
      the effect of attempting to mutate, or even inspect, the list is
      undefined.  The C implementation of Python makes the list appear
      empty for the duration, and raises "ValueError" if it can detect
      that the list has been mutated during a sort.


Tuples
======

Tuples are immutable sequences, typically used to store collections of
heterogeneous data (such as the 2-tuples produced by the "enumerate()"
built-in). Tuples are also used for cases where an immutable sequence
of homogeneous data is needed (such as allowing storage in a "set" or
"dict" instance).

class tuple([iterable])

   Tuples may be constructed in a number of ways:

   * Using a pair of parentheses to denote the empty tuple: "()"

   * Using a trailing comma for a singleton tuple: "a," or "(a,)"

   * Separating items with commas: "a, b, c" or "(a, b, c)"

   * Using the "tuple()" built-in: "tuple()" or "tuple(iterable)"

   The constructor builds a tuple whose items are the same and in the
   same order as *iterable*’s items.  *iterable* may be either a
   sequence, a container that supports iteration, or an iterator
   object.  If *iterable* is already a tuple, it is returned
   unchanged. For example, "tuple('abc')" returns "('a', 'b', 'c')"
   and "tuple( [1, 2, 3] )" returns "(1, 2, 3)". If no argument is
   given, the constructor creates a new empty tuple, "()".

   Note that it is actually the comma which makes a tuple, not the
   parentheses. The parentheses are optional, except in the empty
   tuple case, or when they are needed to avoid syntactic ambiguity.
   For example, "f(a, b, c)" is a function call with three arguments,
   while "f((a, b, c))" is a function call with a 3-tuple as the sole
   argument.

   Tuples implement all of the common sequence operations.

For heterogeneous collections of data where access by name is clearer
than access by index, "collections.namedtuple()" may be a more
appropriate choice than a simple tuple object.


Ranges
======

The "range" type represents an immutable sequence of numbers and is
commonly used for looping a specific number of times in "for" loops.

class range(stop)
class range(start, stop[, step])

   The arguments to the range constructor must be integers (either
   built-in "int" or any object that implements the "__index__"
   special method).  If the *step* argument is omitted, it defaults to
   "1". If the *start* argument is omitted, it defaults to "0". If
   *step* is zero, "ValueError" is raised.

   For a positive *step*, the contents of a range "r" are determined
   by the formula "r[i] = start + step*i" where "i >= 0" and "r[i] <
   stop".

   For a negative *step*, the contents of the range are still
   determined by the formula "r[i] = start + step*i", but the
   constraints are "i >= 0" and "r[i] > stop".

   A range object will be empty if "r[0]" does not meet the value
   constraint. Ranges do support negative indices, but these are
   interpreted as indexing from the end of the sequence determined by
   the positive indices.

   Ranges containing absolute values larger than "sys.maxsize" are
   permitted but some features (such as "len()") may raise
   "OverflowError".

   Range examples:

      >>> list(range(10))
      [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
      >>> list(range(1, 11))
      [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
      >>> list(range(0, 30, 5))
      [0, 5, 10, 15, 20, 25]
      >>> list(range(0, 10, 3))
      [0, 3, 6, 9]
      >>> list(range(0, -10, -1))
      [0, -1, -2, -3, -4, -5, -6, -7, -8, -9]
      >>> list(range(0))
      []
      >>> list(range(1, 0))
      []

   Ranges implement all of the common sequence operations except
   concatenation and repetition (due to the fact that range objects
   can only represent sequences that follow a strict pattern and
   repetition and concatenation will usually violate that pattern).

   start

      The value of the *start* parameter (or "0" if the parameter was
      not supplied)

   stop

      The value of the *stop* parameter

   step

      The value of the *step* parameter (or "1" if the parameter was
      not supplied)

The advantage of the "range" type over a regular "list" or "tuple" is
that a "range" object will always take the same (small) amount of
memory, no matter the size of the range it represents (as it only
stores the "start", "stop" and "step" values, calculating individual
items and subranges as needed).

Range objects implement the "collections.abc.Sequence" ABC, and
provide features such as containment tests, element index lookup,
slicing and support for negative indices (see Sequence Types — list,
tuple, range):

>>> r = range(0, 20, 2)
>>> r
range(0, 20, 2)
>>> 11 in r
False
>>> 10 in r
True
>>> r.index(10)
5
>>> r[5]
10
>>> r[:5]
range(0, 10, 2)
>>> r[-1]
18

Testing range objects for equality with "==" and "!=" compares them as
sequences.  That is, two range objects are considered equal if they
represent the same sequence of values.  (Note that two range objects
that compare equal might have different "start", "stop" and "step"
attributes, for example "range(0) == range(2, 1, 3)" or "range(0, 3,
2) == range(0, 4, 2)".)

Changed in version 3.2: Implement the Sequence ABC. Support slicing
and negative indices. Test "int" objects for membership in constant
time instead of iterating through all items.

Changed in version 3.3: Define ‘==’ and ‘!=’ to compare range objects
based on the sequence of values they define (instead of comparing
based on object identity).

New in version 3.3: The "start", "stop" and "step" attributes.

See also:

  * The linspace recipe shows how to implement a lazy version of range
    suitable for floating point applications.
u�Mutable Sequence Types
**********************

The operations in the following table are defined on mutable sequence
types. The "collections.abc.MutableSequence" ABC is provided to make
it easier to correctly implement these operations on custom sequence
types.

In the table *s* is an instance of a mutable sequence type, *t* is any
iterable object and *x* is an arbitrary object that meets any type and
value restrictions imposed by *s* (for example, "bytearray" only
accepts integers that meet the value restriction "0 <= x <= 255").

+--------------------------------+----------------------------------+-----------------------+
| Operation                      | Result                           | Notes                 |
|================================|==================================|=======================|
| "s[i] = x"                     | item *i* of *s* is replaced by   |                       |
|                                | *x*                              |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s[i:j] = t"                   | slice of *s* from *i* to *j* is  |                       |
|                                | replaced by the contents of the  |                       |
|                                | iterable *t*                     |                       |
+--------------------------------+----------------------------------+-----------------------+
| "del s[i:j]"                   | same as "s[i:j] = []"            |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s[i:j:k] = t"                 | the elements of "s[i:j:k]" are   | (1)                   |
|                                | replaced by those of *t*         |                       |
+--------------------------------+----------------------------------+-----------------------+
| "del s[i:j:k]"                 | removes the elements of          |                       |
|                                | "s[i:j:k]" from the list         |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.append(x)"                  | appends *x* to the end of the    |                       |
|                                | sequence (same as                |                       |
|                                | "s[len(s):len(s)] = [x]")        |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.clear()"                    | removes all items from *s* (same | (5)                   |
|                                | as "del s[:]")                   |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.copy()"                     | creates a shallow copy of *s*    | (5)                   |
|                                | (same as "s[:]")                 |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.extend(t)" or "s += t"      | extends *s* with the contents of |                       |
|                                | *t* (for the most part the same  |                       |
|                                | as "s[len(s):len(s)] = t")       |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s *= n"                       | updates *s* with its contents    | (6)                   |
|                                | repeated *n* times               |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.insert(i, x)"               | inserts *x* into *s* at the      |                       |
|                                | index given by *i* (same as      |                       |
|                                | "s[i:i] = [x]")                  |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.pop()" or "s.pop(i)"        | retrieves the item at *i* and    | (2)                   |
|                                | also removes it from *s*         |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.remove(x)"                  | remove the first item from *s*   | (3)                   |
|                                | where "s[i]" is equal to *x*     |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.reverse()"                  | reverses the items of *s* in     | (4)                   |
|                                | place                            |                       |
+--------------------------------+----------------------------------+-----------------------+

Notes:

1. *t* must have the same length as the slice it is replacing.

2. The optional argument *i* defaults to "-1", so that by default the
   last item is removed and returned.

3. "remove()" raises "ValueError" when *x* is not found in *s*.

4. The "reverse()" method modifies the sequence in place for economy
   of space when reversing a large sequence.  To remind users that it
   operates by side effect, it does not return the reversed sequence.

5. "clear()" and "copy()" are included for consistency with the
   interfaces of mutable containers that don’t support slicing
   operations (such as "dict" and "set"). "copy()" is not part of the
   "collections.abc.MutableSequence" ABC, but most concrete mutable
   sequence classes provide it.

   New in version 3.3: "clear()" and "copy()" methods.

6. The value *n* is an integer, or an object implementing
   "__index__()".  Zero and negative values of *n* clear the sequence.
   Items in the sequence are not copied; they are referenced multiple
   times, as explained for "s * n" under Common Sequence Operations.
a~Unary arithmetic and bitwise operations
***************************************

All unary arithmetic and bitwise operations have the same priority:

   u_expr ::= power | "-" u_expr | "+" u_expr | "~" u_expr

The unary "-" (minus) operator yields the negation of its numeric
argument.

The unary "+" (plus) operator yields its numeric argument unchanged.

The unary "~" (invert) operator yields the bitwise inversion of its
integer argument.  The bitwise inversion of "x" is defined as
"-(x+1)".  It only applies to integral numbers.

In all three cases, if the argument does not have the proper type, a
"TypeError" exception is raised.
u�The "while" statement
*********************

The "while" statement is used for repeated execution as long as an
expression is true:

   while_stmt ::= "while" assignment_expression ":" suite
                  ["else" ":" suite]

This repeatedly tests the expression and, if it is true, executes the
first suite; if the expression is false (which may be the first time
it is tested) the suite of the "else" clause, if present, is executed
and the loop terminates.

A "break" statement executed in the first suite terminates the loop
without executing the "else" clause’s suite.  A "continue" statement
executed in the first suite skips the rest of the suite and goes back
to testing the expression.
uMThe "with" statement
********************

The "with" statement is used to wrap the execution of a block with
methods defined by a context manager (see section With Statement
Context Managers). This allows common "try"…"except"…"finally" usage
patterns to be encapsulated for convenient reuse.

   with_stmt ::= "with" with_item ("," with_item)* ":" suite
   with_item ::= expression ["as" target]

The execution of the "with" statement with one “item” proceeds as
follows:

1. The context expression (the expression given in the "with_item") is
   evaluated to obtain a context manager.

2. The context manager’s "__enter__()" is loaded for later use.

3. The context manager’s "__exit__()" is loaded for later use.

4. The context manager’s "__enter__()" method is invoked.

5. If a target was included in the "with" statement, the return value
   from "__enter__()" is assigned to it.

   Note:

     The "with" statement guarantees that if the "__enter__()" method
     returns without an error, then "__exit__()" will always be
     called. Thus, if an error occurs during the assignment to the
     target list, it will be treated the same as an error occurring
     within the suite would be. See step 6 below.

6. The suite is executed.

7. The context manager’s "__exit__()" method is invoked.  If an
   exception caused the suite to be exited, its type, value, and
   traceback are passed as arguments to "__exit__()". Otherwise, three
   "None" arguments are supplied.

   If the suite was exited due to an exception, and the return value
   from the "__exit__()" method was false, the exception is reraised.
   If the return value was true, the exception is suppressed, and
   execution continues with the statement following the "with"
   statement.

   If the suite was exited for any reason other than an exception, the
   return value from "__exit__()" is ignored, and execution proceeds
   at the normal location for the kind of exit that was taken.

The following code:

   with EXPRESSION as TARGET:
       SUITE

is semantically equivalent to:

   manager = (EXPRESSION)
   enter = type(manager).__enter__
   exit = type(manager).__exit__
   value = enter(manager)
   hit_except = False

   try:
       TARGET = value
       SUITE
   except:
       hit_except = True
       if not exit(manager, *sys.exc_info()):
           raise
   finally:
       if not hit_except:
           exit(manager, None, None, None)

With more than one item, the context managers are processed as if
multiple "with" statements were nested:

   with A() as a, B() as b:
       SUITE

is semantically equivalent to:

   with A() as a:
       with B() as b:
           SUITE

Changed in version 3.1: Support for multiple context expressions.

See also:

  **PEP 343** - The “with” statement
     The specification, background, and examples for the Python "with"
     statement.
a,The "yield" statement
*********************

   yield_stmt ::= yield_expression

A "yield" statement is semantically equivalent to a yield expression.
The yield statement can be used to omit the parentheses that would
otherwise be required in the equivalent yield expression statement.
For example, the yield statements

   yield <expr>
   yield from <expr>

are equivalent to the yield expression statements

   (yield <expr>)
   (yield from <expr>)

Yield expressions and statements are only used when defining a
*generator* function, and are only used in the body of the generator
function.  Using yield in a function definition is sufficient to cause
that definition to create a generator function instead of a normal
function.

For full details of "yield" semantics, refer to the Yield expressions
section.
)O�assertZ
assignment�asynczatom-identifiersz
atom-literalszattribute-accesszattribute-referencesZ	augassign�awaitZbinaryZbitwisezbltin-code-objectszbltin-ellipsis-objectzbltin-null-objectzbltin-type-objectsZbooleans�breakzcallable-typesZcalls�classZcomparisonsZcompoundzcontext-managers�continueZconversionsZ
customizationZdebugger�del�dictzdynamic-features�else�
exceptionsZ	execmodelZ	exprlistsZfloating�forZ
formatstringsZfunction�globalz
id-classesZidentifiers�ifZ	imaginary�import�inZintegers�lambdaZlistsZnaming�nonlocalZnumbersz
numeric-typesZobjectszoperator-summary�passZpower�raise�returnzsequence-typesZshiftingZslicingsZspecialattrsZspecialnameszstring-methodsZstringsZ
subscriptions�truth�try�typesZtypesfunctionsZtypesmappingZtypesmethodsZtypesmodulesZtypesseqztypesseq-mutableZunary�while�with�yieldN)Ztopics�rr�)/usr/lib64/python3.8/pydoc_data/topics.py�<module>s'}(@	X1	=`bQ>J:3MD%I
H+1&.LN3"o#p3=^ai9;K9%Hh�������������������������������������������������������������������������������������������������������������pydoc_data/__pycache__/__init__.cpython-38.opt-1.pyc000064400000000206151153537640016221 0ustar00U

��.e�@sdS)N�rrr�+/usr/lib64/python3.8/pydoc_data/__init__.py�<module>�pydoc_data/__pycache__/topics.cpython-38.opt-1.pyc000064400001477206151153537640016006 0ustar00U

e5d�s
�P@s�dddddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(dd)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdN�OZdOS)PauThe "assert" statement
**********************

Assert statements are a convenient way to insert debugging assertions
into a program:

   assert_stmt ::= "assert" expression ["," expression]

The simple form, "assert expression", is equivalent to

   if __debug__:
       if not expression: raise AssertionError

The extended form, "assert expression1, expression2", is equivalent to

   if __debug__:
       if not expression1: raise AssertionError(expression2)

These equivalences assume that "__debug__" and "AssertionError" refer
to the built-in variables with those names.  In the current
implementation, the built-in variable "__debug__" is "True" under
normal circumstances, "False" when optimization is requested (command
line option "-O").  The current code generator emits no code for an
assert statement when optimization is requested at compile time.  Note
that it is unnecessary to include the source code for the expression
that failed in the error message; it will be displayed as part of the
stack trace.

Assignments to "__debug__" are illegal.  The value for the built-in
variable is determined when the interpreter starts.
u�,Assignment statements
*********************

Assignment statements are used to (re)bind names to values and to
modify attributes or items of mutable objects:

   assignment_stmt ::= (target_list "=")+ (starred_expression | yield_expression)
   target_list     ::= target ("," target)* [","]
   target          ::= identifier
              | "(" [target_list] ")"
              | "[" [target_list] "]"
              | attributeref
              | subscription
              | slicing
              | "*" target

(See section Primaries for the syntax definitions for *attributeref*,
*subscription*, and *slicing*.)

An assignment statement evaluates the expression list (remember that
this can be a single expression or a comma-separated list, the latter
yielding a tuple) and assigns the single resulting object to each of
the target lists, from left to right.

Assignment is defined recursively depending on the form of the target
(list). When a target is part of a mutable object (an attribute
reference, subscription or slicing), the mutable object must
ultimately perform the assignment and decide about its validity, and
may raise an exception if the assignment is unacceptable.  The rules
observed by various types and the exceptions raised are given with the
definition of the object types (see section The standard type
hierarchy).

Assignment of an object to a target list, optionally enclosed in
parentheses or square brackets, is recursively defined as follows.

* If the target list is a single target with no trailing comma,
  optionally in parentheses, the object is assigned to that target.

* Else: The object must be an iterable with the same number of items
  as there are targets in the target list, and the items are assigned,
  from left to right, to the corresponding targets.

  * If the target list contains one target prefixed with an asterisk,
    called a “starred” target: The object must be an iterable with at
    least as many items as there are targets in the target list, minus
    one.  The first items of the iterable are assigned, from left to
    right, to the targets before the starred target.  The final items
    of the iterable are assigned to the targets after the starred
    target.  A list of the remaining items in the iterable is then
    assigned to the starred target (the list can be empty).

  * Else: The object must be an iterable with the same number of items
    as there are targets in the target list, and the items are
    assigned, from left to right, to the corresponding targets.

Assignment of an object to a single target is recursively defined as
follows.

* If the target is an identifier (name):

  * If the name does not occur in a "global" or "nonlocal" statement
    in the current code block: the name is bound to the object in the
    current local namespace.

  * Otherwise: the name is bound to the object in the global namespace
    or the outer namespace determined by "nonlocal", respectively.

  The name is rebound if it was already bound.  This may cause the
  reference count for the object previously bound to the name to reach
  zero, causing the object to be deallocated and its destructor (if it
  has one) to be called.

* If the target is an attribute reference: The primary expression in
  the reference is evaluated.  It should yield an object with
  assignable attributes; if this is not the case, "TypeError" is
  raised.  That object is then asked to assign the assigned object to
  the given attribute; if it cannot perform the assignment, it raises
  an exception (usually but not necessarily "AttributeError").

  Note: If the object is a class instance and the attribute reference
  occurs on both sides of the assignment operator, the right-hand side
  expression, "a.x" can access either an instance attribute or (if no
  instance attribute exists) a class attribute.  The left-hand side
  target "a.x" is always set as an instance attribute, creating it if
  necessary.  Thus, the two occurrences of "a.x" do not necessarily
  refer to the same attribute: if the right-hand side expression
  refers to a class attribute, the left-hand side creates a new
  instance attribute as the target of the assignment:

     class Cls:
         x = 3             # class variable
     inst = Cls()
     inst.x = inst.x + 1   # writes inst.x as 4 leaving Cls.x as 3

  This description does not necessarily apply to descriptor
  attributes, such as properties created with "property()".

* If the target is a subscription: The primary expression in the
  reference is evaluated.  It should yield either a mutable sequence
  object (such as a list) or a mapping object (such as a dictionary).
  Next, the subscript expression is evaluated.

  If the primary is a mutable sequence object (such as a list), the
  subscript must yield an integer.  If it is negative, the sequence’s
  length is added to it.  The resulting value must be a nonnegative
  integer less than the sequence’s length, and the sequence is asked
  to assign the assigned object to its item with that index.  If the
  index is out of range, "IndexError" is raised (assignment to a
  subscripted sequence cannot add new items to a list).

  If the primary is a mapping object (such as a dictionary), the
  subscript must have a type compatible with the mapping’s key type,
  and the mapping is then asked to create a key/datum pair which maps
  the subscript to the assigned object.  This can either replace an
  existing key/value pair with the same key value, or insert a new
  key/value pair (if no key with the same value existed).

  For user-defined objects, the "__setitem__()" method is called with
  appropriate arguments.

* If the target is a slicing: The primary expression in the reference
  is evaluated.  It should yield a mutable sequence object (such as a
  list).  The assigned object should be a sequence object of the same
  type.  Next, the lower and upper bound expressions are evaluated,
  insofar they are present; defaults are zero and the sequence’s
  length.  The bounds should evaluate to integers. If either bound is
  negative, the sequence’s length is added to it.  The resulting
  bounds are clipped to lie between zero and the sequence’s length,
  inclusive.  Finally, the sequence object is asked to replace the
  slice with the items of the assigned sequence.  The length of the
  slice may be different from the length of the assigned sequence,
  thus changing the length of the target sequence, if the target
  sequence allows it.

**CPython implementation detail:** In the current implementation, the
syntax for targets is taken to be the same as for expressions, and
invalid syntax is rejected during the code generation phase, causing
less detailed error messages.

Although the definition of assignment implies that overlaps between
the left-hand side and the right-hand side are ‘simultaneous’ (for
example "a, b = b, a" swaps two variables), overlaps *within* the
collection of assigned-to variables occur left-to-right, sometimes
resulting in confusion.  For instance, the following program prints
"[0, 2]":

   x = [0, 1]
   i = 0
   i, x[i] = 1, 2         # i is updated, then x[i] is updated
   print(x)

See also:

  **PEP 3132** - Extended Iterable Unpacking
     The specification for the "*target" feature.


Augmented assignment statements
===============================

Augmented assignment is the combination, in a single statement, of a
binary operation and an assignment statement:

   augmented_assignment_stmt ::= augtarget augop (expression_list | yield_expression)
   augtarget                 ::= identifier | attributeref | subscription | slicing
   augop                     ::= "+=" | "-=" | "*=" | "@=" | "/=" | "//=" | "%=" | "**="
             | ">>=" | "<<=" | "&=" | "^=" | "|="

(See section Primaries for the syntax definitions of the last three
symbols.)

An augmented assignment evaluates the target (which, unlike normal
assignment statements, cannot be an unpacking) and the expression
list, performs the binary operation specific to the type of assignment
on the two operands, and assigns the result to the original target.
The target is only evaluated once.

An augmented assignment expression like "x += 1" can be rewritten as
"x = x + 1" to achieve a similar, but not exactly equal effect. In the
augmented version, "x" is only evaluated once. Also, when possible,
the actual operation is performed *in-place*, meaning that rather than
creating a new object and assigning that to the target, the old object
is modified instead.

Unlike normal assignments, augmented assignments evaluate the left-
hand side *before* evaluating the right-hand side.  For example, "a[i]
+= f(x)" first looks-up "a[i]", then it evaluates "f(x)" and performs
the addition, and lastly, it writes the result back to "a[i]".

With the exception of assigning to tuples and multiple targets in a
single statement, the assignment done by augmented assignment
statements is handled the same way as normal assignments. Similarly,
with the exception of the possible *in-place* behavior, the binary
operation performed by augmented assignment is the same as the normal
binary operations.

For targets which are attribute references, the same caveat about
class and instance attributes applies as for regular assignments.


Annotated assignment statements
===============================

*Annotation* assignment is the combination, in a single statement, of
a variable or attribute annotation and an optional assignment
statement:

   annotated_assignment_stmt ::= augtarget ":" expression
                                 ["=" (starred_expression | yield_expression)]

The difference from normal Assignment statements is that only single
target is allowed.

For simple names as assignment targets, if in class or module scope,
the annotations are evaluated and stored in a special class or module
attribute "__annotations__" that is a dictionary mapping from variable
names (mangled if private) to evaluated annotations. This attribute is
writable and is automatically created at the start of class or module
body execution, if annotations are found statically.

For expressions as assignment targets, the annotations are evaluated
if in class or module scope, but not stored.

If a name is annotated in a function scope, then this name is local
for that scope. Annotations are never evaluated and stored in function
scopes.

If the right hand side is present, an annotated assignment performs
the actual assignment before evaluating annotations (where
applicable). If the right hand side is not present for an expression
target, then the interpreter evaluates the target except for the last
"__setitem__()" or "__setattr__()" call.

See also:

  **PEP 526** - Syntax for Variable Annotations
     The proposal that added syntax for annotating the types of
     variables (including class variables and instance variables),
     instead of expressing them through comments.

  **PEP 484** - Type hints
     The proposal that added the "typing" module to provide a standard
     syntax for type annotations that can be used in static analysis
     tools and IDEs.

Changed in version 3.8: Now annotated assignments allow same
expressions in the right hand side as the regular assignments.
Previously, some expressions (like un-parenthesized tuple expressions)
caused a syntax error.
u>
Coroutines
**********

New in version 3.5.


Coroutine function definition
=============================

   async_funcdef ::= [decorators] "async" "def" funcname "(" [parameter_list] ")"
                     ["->" expression] ":" suite

Execution of Python coroutines can be suspended and resumed at many
points (see *coroutine*).  Inside the body of a coroutine function,
"await" and "async" identifiers become reserved keywords; "await"
expressions, "async for" and "async with" can only be used in
coroutine function bodies.

Functions defined with "async def" syntax are always coroutine
functions, even if they do not contain "await" or "async" keywords.

It is a "SyntaxError" to use a "yield from" expression inside the body
of a coroutine function.

An example of a coroutine function:

   async def func(param1, param2):
       do_stuff()
       await some_coroutine()


The "async for" statement
=========================

   async_for_stmt ::= "async" for_stmt

An *asynchronous iterable* is able to call asynchronous code in its
*iter* implementation, and *asynchronous iterator* can call
asynchronous code in its *next* method.

The "async for" statement allows convenient iteration over
asynchronous iterators.

The following code:

   async for TARGET in ITER:
       SUITE
   else:
       SUITE2

Is semantically equivalent to:

   iter = (ITER)
   iter = type(iter).__aiter__(iter)
   running = True

   while running:
       try:
           TARGET = await type(iter).__anext__(iter)
       except StopAsyncIteration:
           running = False
       else:
           SUITE
   else:
       SUITE2

See also "__aiter__()" and "__anext__()" for details.

It is a "SyntaxError" to use an "async for" statement outside the body
of a coroutine function.


The "async with" statement
==========================

   async_with_stmt ::= "async" with_stmt

An *asynchronous context manager* is a *context manager* that is able
to suspend execution in its *enter* and *exit* methods.

The following code:

   async with EXPRESSION as TARGET:
       SUITE

is semantically equivalent to:

   manager = (EXPRESSION)
   aexit = type(manager).__aexit__
   aenter = type(manager).__aenter__
   value = await aenter(manager)
   hit_except = False

   try:
       TARGET = value
       SUITE
   except:
       hit_except = True
       if not await aexit(manager, *sys.exc_info()):
           raise
   finally:
       if not hit_except:
           await aexit(manager, None, None, None)

See also "__aenter__()" and "__aexit__()" for details.

It is a "SyntaxError" to use an "async with" statement outside the
body of a coroutine function.

See also:

  **PEP 492** - Coroutines with async and await syntax
     The proposal that made coroutines a proper standalone concept in
     Python, and added supporting syntax.

-[ Footnotes ]-

[1] The exception is propagated to the invocation stack unless there
    is a "finally" clause which happens to raise another exception.
    That new exception causes the old one to be lost.

[2] A string literal appearing as the first statement in the function
    body is transformed into the function’s "__doc__" attribute and
    therefore the function’s *docstring*.

[3] A string literal appearing as the first statement in the class
    body is transformed into the namespace’s "__doc__" item and
    therefore the class’s *docstring*.
a�Identifiers (Names)
*******************

An identifier occurring as an atom is a name.  See section Identifiers
and keywords for lexical definition and section Naming and binding for
documentation of naming and binding.

When the name is bound to an object, evaluation of the atom yields
that object. When a name is not bound, an attempt to evaluate it
raises a "NameError" exception.

**Private name mangling:** When an identifier that textually occurs in
a class definition begins with two or more underscore characters and
does not end in two or more underscores, it is considered a *private
name* of that class. Private names are transformed to a longer form
before code is generated for them.  The transformation inserts the
class name, with leading underscores removed and a single underscore
inserted, in front of the name.  For example, the identifier "__spam"
occurring in a class named "Ham" will be transformed to "_Ham__spam".
This transformation is independent of the syntactical context in which
the identifier is used.  If the transformed name is extremely long
(longer than 255 characters), implementation defined truncation may
happen. If the class name consists only of underscores, no
transformation is done.
u
Literals
********

Python supports string and bytes literals and various numeric
literals:

   literal ::= stringliteral | bytesliteral
               | integer | floatnumber | imagnumber

Evaluation of a literal yields an object of the given type (string,
bytes, integer, floating point number, complex number) with the given
value.  The value may be approximated in the case of floating point
and imaginary (complex) literals.  See section Literals for details.

All literals correspond to immutable data types, and hence the
object’s identity is less important than its value.  Multiple
evaluations of literals with the same value (either the same
occurrence in the program text or a different occurrence) may obtain
the same object or a different object with the same value.
uA7Customizing attribute access
****************************

The following methods can be defined to customize the meaning of
attribute access (use of, assignment to, or deletion of "x.name") for
class instances.

object.__getattr__(self, name)

   Called when the default attribute access fails with an
   "AttributeError" (either "__getattribute__()" raises an
   "AttributeError" because *name* is not an instance attribute or an
   attribute in the class tree for "self"; or "__get__()" of a *name*
   property raises "AttributeError").  This method should either
   return the (computed) attribute value or raise an "AttributeError"
   exception.

   Note that if the attribute is found through the normal mechanism,
   "__getattr__()" is not called.  (This is an intentional asymmetry
   between "__getattr__()" and "__setattr__()".) This is done both for
   efficiency reasons and because otherwise "__getattr__()" would have
   no way to access other attributes of the instance.  Note that at
   least for instance variables, you can fake total control by not
   inserting any values in the instance attribute dictionary (but
   instead inserting them in another object).  See the
   "__getattribute__()" method below for a way to actually get total
   control over attribute access.

object.__getattribute__(self, name)

   Called unconditionally to implement attribute accesses for
   instances of the class. If the class also defines "__getattr__()",
   the latter will not be called unless "__getattribute__()" either
   calls it explicitly or raises an "AttributeError". This method
   should return the (computed) attribute value or raise an
   "AttributeError" exception. In order to avoid infinite recursion in
   this method, its implementation should always call the base class
   method with the same name to access any attributes it needs, for
   example, "object.__getattribute__(self, name)".

   Note:

     This method may still be bypassed when looking up special methods
     as the result of implicit invocation via language syntax or
     built-in functions. See Special method lookup.

   For certain sensitive attribute accesses, raises an auditing event
   "object.__getattr__" with arguments "obj" and "name".

object.__setattr__(self, name, value)

   Called when an attribute assignment is attempted.  This is called
   instead of the normal mechanism (i.e. store the value in the
   instance dictionary). *name* is the attribute name, *value* is the
   value to be assigned to it.

   If "__setattr__()" wants to assign to an instance attribute, it
   should call the base class method with the same name, for example,
   "object.__setattr__(self, name, value)".

   For certain sensitive attribute assignments, raises an auditing
   event "object.__setattr__" with arguments "obj", "name", "value".

object.__delattr__(self, name)

   Like "__setattr__()" but for attribute deletion instead of
   assignment.  This should only be implemented if "del obj.name" is
   meaningful for the object.

   For certain sensitive attribute deletions, raises an auditing event
   "object.__delattr__" with arguments "obj" and "name".

object.__dir__(self)

   Called when "dir()" is called on the object. A sequence must be
   returned. "dir()" converts the returned sequence to a list and
   sorts it.


Customizing module attribute access
===================================

Special names "__getattr__" and "__dir__" can be also used to
customize access to module attributes. The "__getattr__" function at
the module level should accept one argument which is the name of an
attribute and return the computed value or raise an "AttributeError".
If an attribute is not found on a module object through the normal
lookup, i.e. "object.__getattribute__()", then "__getattr__" is
searched in the module "__dict__" before raising an "AttributeError".
If found, it is called with the attribute name and the result is
returned.

The "__dir__" function should accept no arguments, and return a
sequence of strings that represents the names accessible on module. If
present, this function overrides the standard "dir()" search on a
module.

For a more fine grained customization of the module behavior (setting
attributes, properties, etc.), one can set the "__class__" attribute
of a module object to a subclass of "types.ModuleType". For example:

   import sys
   from types import ModuleType

   class VerboseModule(ModuleType):
       def __repr__(self):
           return f'Verbose {self.__name__}'

       def __setattr__(self, attr, value):
           print(f'Setting {attr}...')
           super().__setattr__(attr, value)

   sys.modules[__name__].__class__ = VerboseModule

Note:

  Defining module "__getattr__" and setting module "__class__" only
  affect lookups made using the attribute access syntax – directly
  accessing the module globals (whether by code within the module, or
  via a reference to the module’s globals dictionary) is unaffected.

Changed in version 3.5: "__class__" module attribute is now writable.

New in version 3.7: "__getattr__" and "__dir__" module attributes.

See also:

  **PEP 562** - Module __getattr__ and __dir__
     Describes the "__getattr__" and "__dir__" functions on modules.


Implementing Descriptors
========================

The following methods only apply when an instance of the class
containing the method (a so-called *descriptor* class) appears in an
*owner* class (the descriptor must be in either the owner’s class
dictionary or in the class dictionary for one of its parents).  In the
examples below, “the attribute” refers to the attribute whose name is
the key of the property in the owner class’ "__dict__".

object.__get__(self, instance, owner=None)

   Called to get the attribute of the owner class (class attribute
   access) or of an instance of that class (instance attribute
   access). The optional *owner* argument is the owner class, while
   *instance* is the instance that the attribute was accessed through,
   or "None" when the attribute is accessed through the *owner*.

   This method should return the computed attribute value or raise an
   "AttributeError" exception.

   **PEP 252** specifies that "__get__()" is callable with one or two
   arguments.  Python’s own built-in descriptors support this
   specification; however, it is likely that some third-party tools
   have descriptors that require both arguments.  Python’s own
   "__getattribute__()" implementation always passes in both arguments
   whether they are required or not.

object.__set__(self, instance, value)

   Called to set the attribute on an instance *instance* of the owner
   class to a new value, *value*.

   Note, adding "__set__()" or "__delete__()" changes the kind of
   descriptor to a “data descriptor”.  See Invoking Descriptors for
   more details.

object.__delete__(self, instance)

   Called to delete the attribute on an instance *instance* of the
   owner class.

object.__set_name__(self, owner, name)

   Called at the time the owning class *owner* is created. The
   descriptor has been assigned to *name*.

   Note:

     "__set_name__()" is only called implicitly as part of the "type"
     constructor, so it will need to be called explicitly with the
     appropriate parameters when a descriptor is added to a class
     after initial creation:

        class A:
           pass
        descr = custom_descriptor()
        A.attr = descr
        descr.__set_name__(A, 'attr')

     See Creating the class object for more details.

   New in version 3.6.

The attribute "__objclass__" is interpreted by the "inspect" module as
specifying the class where this object was defined (setting this
appropriately can assist in runtime introspection of dynamic class
attributes). For callables, it may indicate that an instance of the
given type (or a subclass) is expected or required as the first
positional argument (for example, CPython sets this attribute for
unbound methods that are implemented in C).


Invoking Descriptors
====================

In general, a descriptor is an object attribute with “binding
behavior”, one whose attribute access has been overridden by methods
in the descriptor protocol:  "__get__()", "__set__()", and
"__delete__()". If any of those methods are defined for an object, it
is said to be a descriptor.

The default behavior for attribute access is to get, set, or delete
the attribute from an object’s dictionary. For instance, "a.x" has a
lookup chain starting with "a.__dict__['x']", then
"type(a).__dict__['x']", and continuing through the base classes of
"type(a)" excluding metaclasses.

However, if the looked-up value is an object defining one of the
descriptor methods, then Python may override the default behavior and
invoke the descriptor method instead.  Where this occurs in the
precedence chain depends on which descriptor methods were defined and
how they were called.

The starting point for descriptor invocation is a binding, "a.x". How
the arguments are assembled depends on "a":

Direct Call
   The simplest and least common call is when user code directly
   invokes a descriptor method:    "x.__get__(a)".

Instance Binding
   If binding to an object instance, "a.x" is transformed into the
   call: "type(a).__dict__['x'].__get__(a, type(a))".

Class Binding
   If binding to a class, "A.x" is transformed into the call:
   "A.__dict__['x'].__get__(None, A)".

Super Binding
   If "a" is an instance of "super", then the binding "super(B,
   obj).m()" searches "obj.__class__.__mro__" for the base class "A"
   immediately preceding "B" and then invokes the descriptor with the
   call: "A.__dict__['m'].__get__(obj, obj.__class__)".

For instance bindings, the precedence of descriptor invocation depends
on which descriptor methods are defined.  A descriptor can define any
combination of "__get__()", "__set__()" and "__delete__()".  If it
does not define "__get__()", then accessing the attribute will return
the descriptor object itself unless there is a value in the object’s
instance dictionary.  If the descriptor defines "__set__()" and/or
"__delete__()", it is a data descriptor; if it defines neither, it is
a non-data descriptor.  Normally, data descriptors define both
"__get__()" and "__set__()", while non-data descriptors have just the
"__get__()" method.  Data descriptors with "__set__()" and "__get__()"
defined always override a redefinition in an instance dictionary.  In
contrast, non-data descriptors can be overridden by instances.

Python methods (including "staticmethod()" and "classmethod()") are
implemented as non-data descriptors.  Accordingly, instances can
redefine and override methods.  This allows individual instances to
acquire behaviors that differ from other instances of the same class.

The "property()" function is implemented as a data descriptor.
Accordingly, instances cannot override the behavior of a property.


__slots__
=========

*__slots__* allow us to explicitly declare data members (like
properties) and deny the creation of *__dict__* and *__weakref__*
(unless explicitly declared in *__slots__* or available in a parent.)

The space saved over using *__dict__* can be significant. Attribute
lookup speed can be significantly improved as well.

object.__slots__

   This class variable can be assigned a string, iterable, or sequence
   of strings with variable names used by instances.  *__slots__*
   reserves space for the declared variables and prevents the
   automatic creation of *__dict__* and *__weakref__* for each
   instance.


Notes on using *__slots__*
--------------------------

* When inheriting from a class without *__slots__*, the *__dict__* and
  *__weakref__* attribute of the instances will always be accessible.

* Without a *__dict__* variable, instances cannot be assigned new
  variables not listed in the *__slots__* definition.  Attempts to
  assign to an unlisted variable name raises "AttributeError". If
  dynamic assignment of new variables is desired, then add
  "'__dict__'" to the sequence of strings in the *__slots__*
  declaration.

* Without a *__weakref__* variable for each instance, classes defining
  *__slots__* do not support weak references to its instances. If weak
  reference support is needed, then add "'__weakref__'" to the
  sequence of strings in the *__slots__* declaration.

* *__slots__* are implemented at the class level by creating
  descriptors (Implementing Descriptors) for each variable name.  As a
  result, class attributes cannot be used to set default values for
  instance variables defined by *__slots__*; otherwise, the class
  attribute would overwrite the descriptor assignment.

* The action of a *__slots__* declaration is not limited to the class
  where it is defined.  *__slots__* declared in parents are available
  in child classes. However, child subclasses will get a *__dict__*
  and *__weakref__* unless they also define *__slots__* (which should
  only contain names of any *additional* slots).

* If a class defines a slot also defined in a base class, the instance
  variable defined by the base class slot is inaccessible (except by
  retrieving its descriptor directly from the base class). This
  renders the meaning of the program undefined.  In the future, a
  check may be added to prevent this.

* Nonempty *__slots__* does not work for classes derived from
  “variable-length” built-in types such as "int", "bytes" and "tuple".

* Any non-string iterable may be assigned to *__slots__*. Mappings may
  also be used; however, in the future, special meaning may be
  assigned to the values corresponding to each key.

* *__class__* assignment works only if both classes have the same
  *__slots__*.

* Multiple inheritance with multiple slotted parent classes can be
  used, but only one parent is allowed to have attributes created by
  slots (the other bases must have empty slot layouts) - violations
  raise "TypeError".

* If an iterator is used for *__slots__* then a descriptor is created
  for each of the iterator’s values. However, the *__slots__*
  attribute will be an empty iterator.
a�Attribute references
********************

An attribute reference is a primary followed by a period and a name:

   attributeref ::= primary "." identifier

The primary must evaluate to an object of a type that supports
attribute references, which most objects do.  This object is then
asked to produce the attribute whose name is the identifier.  This
production can be customized by overriding the "__getattr__()" method.
If this attribute is not available, the exception "AttributeError" is
raised.  Otherwise, the type and value of the object produced is
determined by the object.  Multiple evaluations of the same attribute
reference may yield different objects.
a�Augmented assignment statements
*******************************

Augmented assignment is the combination, in a single statement, of a
binary operation and an assignment statement:

   augmented_assignment_stmt ::= augtarget augop (expression_list | yield_expression)
   augtarget                 ::= identifier | attributeref | subscription | slicing
   augop                     ::= "+=" | "-=" | "*=" | "@=" | "/=" | "//=" | "%=" | "**="
             | ">>=" | "<<=" | "&=" | "^=" | "|="

(See section Primaries for the syntax definitions of the last three
symbols.)

An augmented assignment evaluates the target (which, unlike normal
assignment statements, cannot be an unpacking) and the expression
list, performs the binary operation specific to the type of assignment
on the two operands, and assigns the result to the original target.
The target is only evaluated once.

An augmented assignment expression like "x += 1" can be rewritten as
"x = x + 1" to achieve a similar, but not exactly equal effect. In the
augmented version, "x" is only evaluated once. Also, when possible,
the actual operation is performed *in-place*, meaning that rather than
creating a new object and assigning that to the target, the old object
is modified instead.

Unlike normal assignments, augmented assignments evaluate the left-
hand side *before* evaluating the right-hand side.  For example, "a[i]
+= f(x)" first looks-up "a[i]", then it evaluates "f(x)" and performs
the addition, and lastly, it writes the result back to "a[i]".

With the exception of assigning to tuples and multiple targets in a
single statement, the assignment done by augmented assignment
statements is handled the same way as normal assignments. Similarly,
with the exception of the possible *in-place* behavior, the binary
operation performed by augmented assignment is the same as the normal
binary operations.

For targets which are attribute references, the same caveat about
class and instance attributes applies as for regular assignments.
z�Await expression
****************

Suspend the execution of *coroutine* on an *awaitable* object. Can
only be used inside a *coroutine function*.

   await_expr ::= "await" primary

New in version 3.5.
ujBinary arithmetic operations
****************************

The binary arithmetic operations have the conventional priority
levels.  Note that some of these operations also apply to certain non-
numeric types.  Apart from the power operator, there are only two
levels, one for multiplicative operators and one for additive
operators:

   m_expr ::= u_expr | m_expr "*" u_expr | m_expr "@" m_expr |
              m_expr "//" u_expr | m_expr "/" u_expr |
              m_expr "%" u_expr
   a_expr ::= m_expr | a_expr "+" m_expr | a_expr "-" m_expr

The "*" (multiplication) operator yields the product of its arguments.
The arguments must either both be numbers, or one argument must be an
integer and the other must be a sequence. In the former case, the
numbers are converted to a common type and then multiplied together.
In the latter case, sequence repetition is performed; a negative
repetition factor yields an empty sequence.

The "@" (at) operator is intended to be used for matrix
multiplication.  No builtin Python types implement this operator.

New in version 3.5.

The "/" (division) and "//" (floor division) operators yield the
quotient of their arguments.  The numeric arguments are first
converted to a common type. Division of integers yields a float, while
floor division of integers results in an integer; the result is that
of mathematical division with the ‘floor’ function applied to the
result.  Division by zero raises the "ZeroDivisionError" exception.

The "%" (modulo) operator yields the remainder from the division of
the first argument by the second.  The numeric arguments are first
converted to a common type.  A zero right argument raises the
"ZeroDivisionError" exception.  The arguments may be floating point
numbers, e.g., "3.14%0.7" equals "0.34" (since "3.14" equals "4*0.7 +
0.34".)  The modulo operator always yields a result with the same sign
as its second operand (or zero); the absolute value of the result is
strictly smaller than the absolute value of the second operand [1].

The floor division and modulo operators are connected by the following
identity: "x == (x//y)*y + (x%y)".  Floor division and modulo are also
connected with the built-in function "divmod()": "divmod(x, y) ==
(x//y, x%y)". [2].

In addition to performing the modulo operation on numbers, the "%"
operator is also overloaded by string objects to perform old-style
string formatting (also known as interpolation).  The syntax for
string formatting is described in the Python Library Reference,
section printf-style String Formatting.

The floor division operator, the modulo operator, and the "divmod()"
function are not defined for complex numbers.  Instead, convert to a
floating point number using the "abs()" function if appropriate.

The "+" (addition) operator yields the sum of its arguments.  The
arguments must either both be numbers or both be sequences of the same
type.  In the former case, the numbers are converted to a common type
and then added together. In the latter case, the sequences are
concatenated.

The "-" (subtraction) operator yields the difference of its arguments.
The numeric arguments are first converted to a common type.
a$Binary bitwise operations
*************************

Each of the three bitwise operations has a different priority level:

   and_expr ::= shift_expr | and_expr "&" shift_expr
   xor_expr ::= and_expr | xor_expr "^" and_expr
   or_expr  ::= xor_expr | or_expr "|" xor_expr

The "&" operator yields the bitwise AND of its arguments, which must
be integers.

The "^" operator yields the bitwise XOR (exclusive OR) of its
arguments, which must be integers.

The "|" operator yields the bitwise (inclusive) OR of its arguments,
which must be integers.
u�Code Objects
************

Code objects are used by the implementation to represent “pseudo-
compiled” executable Python code such as a function body. They differ
from function objects because they don’t contain a reference to their
global execution environment.  Code objects are returned by the built-
in "compile()" function and can be extracted from function objects
through their "__code__" attribute. See also the "code" module.

Accessing "__code__" raises an auditing event "object.__getattr__"
with arguments "obj" and ""__code__"".

A code object can be executed or evaluated by passing it (instead of a
source string) to the "exec()" or "eval()"  built-in functions.

See The standard type hierarchy for more information.
a.The Ellipsis Object
*******************

This object is commonly used by slicing (see Slicings).  It supports
no special operations.  There is exactly one ellipsis object, named
"Ellipsis" (a built-in name).  "type(Ellipsis)()" produces the
"Ellipsis" singleton.

It is written as "Ellipsis" or "...".
uThe Null Object
***************

This object is returned by functions that don’t explicitly return a
value.  It supports no special operations.  There is exactly one null
object, named "None" (a built-in name).  "type(None)()" produces the
same singleton.

It is written as "None".
u5Type Objects
************

Type objects represent the various object types.  An object’s type is
accessed by the built-in function "type()".  There are no special
operations on types.  The standard module "types" defines names for
all standard built-in types.

Types are written like this: "<class 'int'>".
a�Boolean operations
******************

   or_test  ::= and_test | or_test "or" and_test
   and_test ::= not_test | and_test "and" not_test
   not_test ::= comparison | "not" not_test

In the context of Boolean operations, and also when expressions are
used by control flow statements, the following values are interpreted
as false: "False", "None", numeric zero of all types, and empty
strings and containers (including strings, tuples, lists,
dictionaries, sets and frozensets).  All other values are interpreted
as true.  User-defined objects can customize their truth value by
providing a "__bool__()" method.

The operator "not" yields "True" if its argument is false, "False"
otherwise.

The expression "x and y" first evaluates *x*; if *x* is false, its
value is returned; otherwise, *y* is evaluated and the resulting value
is returned.

The expression "x or y" first evaluates *x*; if *x* is true, its value
is returned; otherwise, *y* is evaluated and the resulting value is
returned.

Note that neither "and" nor "or" restrict the value and type they
return to "False" and "True", but rather return the last evaluated
argument.  This is sometimes useful, e.g., if "s" is a string that
should be replaced by a default value if it is empty, the expression
"s or 'foo'" yields the desired value.  Because "not" has to create a
new value, it returns a boolean value regardless of the type of its
argument (for example, "not 'foo'" produces "False" rather than "''".)
a$The "break" statement
*********************

   break_stmt ::= "break"

"break" may only occur syntactically nested in a "for" or "while"
loop, but not nested in a function or class definition within that
loop.

It terminates the nearest enclosing loop, skipping the optional "else"
clause if the loop has one.

If a "for" loop is terminated by "break", the loop control target
keeps its current value.

When "break" passes control out of a "try" statement with a "finally"
clause, that "finally" clause is executed before really leaving the
loop.
uEmulating callable objects
**************************

object.__call__(self[, args...])

   Called when the instance is “called” as a function; if this method
   is defined, "x(arg1, arg2, ...)" roughly translates to
   "type(x).__call__(x, arg1, ...)".
u�Calls
*****

A call calls a callable object (e.g., a *function*) with a possibly
empty series of *arguments*:

   call                 ::= primary "(" [argument_list [","] | comprehension] ")"
   argument_list        ::= positional_arguments ["," starred_and_keywords]
                       ["," keywords_arguments]
                     | starred_and_keywords ["," keywords_arguments]
                     | keywords_arguments
   positional_arguments ::= positional_item ("," positional_item)*
   positional_item      ::= assignment_expression | "*" expression
   starred_and_keywords ::= ("*" expression | keyword_item)
                            ("," "*" expression | "," keyword_item)*
   keywords_arguments   ::= (keyword_item | "**" expression)
                          ("," keyword_item | "," "**" expression)*
   keyword_item         ::= identifier "=" expression

An optional trailing comma may be present after the positional and
keyword arguments but does not affect the semantics.

The primary must evaluate to a callable object (user-defined
functions, built-in functions, methods of built-in objects, class
objects, methods of class instances, and all objects having a
"__call__()" method are callable).  All argument expressions are
evaluated before the call is attempted.  Please refer to section
Function definitions for the syntax of formal *parameter* lists.

If keyword arguments are present, they are first converted to
positional arguments, as follows.  First, a list of unfilled slots is
created for the formal parameters.  If there are N positional
arguments, they are placed in the first N slots.  Next, for each
keyword argument, the identifier is used to determine the
corresponding slot (if the identifier is the same as the first formal
parameter name, the first slot is used, and so on).  If the slot is
already filled, a "TypeError" exception is raised. Otherwise, the
value of the argument is placed in the slot, filling it (even if the
expression is "None", it fills the slot).  When all arguments have
been processed, the slots that are still unfilled are filled with the
corresponding default value from the function definition.  (Default
values are calculated, once, when the function is defined; thus, a
mutable object such as a list or dictionary used as default value will
be shared by all calls that don’t specify an argument value for the
corresponding slot; this should usually be avoided.)  If there are any
unfilled slots for which no default value is specified, a "TypeError"
exception is raised.  Otherwise, the list of filled slots is used as
the argument list for the call.

**CPython implementation detail:** An implementation may provide
built-in functions whose positional parameters do not have names, even
if they are ‘named’ for the purpose of documentation, and which
therefore cannot be supplied by keyword.  In CPython, this is the case
for functions implemented in C that use "PyArg_ParseTuple()" to parse
their arguments.

If there are more positional arguments than there are formal parameter
slots, a "TypeError" exception is raised, unless a formal parameter
using the syntax "*identifier" is present; in this case, that formal
parameter receives a tuple containing the excess positional arguments
(or an empty tuple if there were no excess positional arguments).

If any keyword argument does not correspond to a formal parameter
name, a "TypeError" exception is raised, unless a formal parameter
using the syntax "**identifier" is present; in this case, that formal
parameter receives a dictionary containing the excess keyword
arguments (using the keywords as keys and the argument values as
corresponding values), or a (new) empty dictionary if there were no
excess keyword arguments.

If the syntax "*expression" appears in the function call, "expression"
must evaluate to an *iterable*.  Elements from these iterables are
treated as if they were additional positional arguments.  For the call
"f(x1, x2, *y, x3, x4)", if *y* evaluates to a sequence *y1*, …, *yM*,
this is equivalent to a call with M+4 positional arguments *x1*, *x2*,
*y1*, …, *yM*, *x3*, *x4*.

A consequence of this is that although the "*expression" syntax may
appear *after* explicit keyword arguments, it is processed *before*
the keyword arguments (and any "**expression" arguments – see below).
So:

   >>> def f(a, b):
   ...     print(a, b)
   ...
   >>> f(b=1, *(2,))
   2 1
   >>> f(a=1, *(2,))
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
   TypeError: f() got multiple values for keyword argument 'a'
   >>> f(1, *(2,))
   1 2

It is unusual for both keyword arguments and the "*expression" syntax
to be used in the same call, so in practice this confusion does not
arise.

If the syntax "**expression" appears in the function call,
"expression" must evaluate to a *mapping*, the contents of which are
treated as additional keyword arguments.  If a keyword is already
present (as an explicit keyword argument, or from another unpacking),
a "TypeError" exception is raised.

Formal parameters using the syntax "*identifier" or "**identifier"
cannot be used as positional argument slots or as keyword argument
names.

Changed in version 3.5: Function calls accept any number of "*" and
"**" unpackings, positional arguments may follow iterable unpackings
("*"), and keyword arguments may follow dictionary unpackings ("**").
Originally proposed by **PEP 448**.

A call always returns some value, possibly "None", unless it raises an
exception.  How this value is computed depends on the type of the
callable object.

If it is—

a user-defined function:
   The code block for the function is executed, passing it the
   argument list.  The first thing the code block will do is bind the
   formal parameters to the arguments; this is described in section
   Function definitions.  When the code block executes a "return"
   statement, this specifies the return value of the function call.

a built-in function or method:
   The result is up to the interpreter; see Built-in Functions for the
   descriptions of built-in functions and methods.

a class object:
   A new instance of that class is returned.

a class instance method:
   The corresponding user-defined function is called, with an argument
   list that is one longer than the argument list of the call: the
   instance becomes the first argument.

a class instance:
   The class must define a "__call__()" method; the effect is then the
   same as if that method was called.
uClass definitions
*****************

A class definition defines a class object (see section The standard
type hierarchy):

   classdef    ::= [decorators] "class" classname [inheritance] ":" suite
   inheritance ::= "(" [argument_list] ")"
   classname   ::= identifier

A class definition is an executable statement.  The inheritance list
usually gives a list of base classes (see Metaclasses for more
advanced uses), so each item in the list should evaluate to a class
object which allows subclassing.  Classes without an inheritance list
inherit, by default, from the base class "object"; hence,

   class Foo:
       pass

is equivalent to

   class Foo(object):
       pass

The class’s suite is then executed in a new execution frame (see
Naming and binding), using a newly created local namespace and the
original global namespace. (Usually, the suite contains mostly
function definitions.)  When the class’s suite finishes execution, its
execution frame is discarded but its local namespace is saved. [3] A
class object is then created using the inheritance list for the base
classes and the saved local namespace for the attribute dictionary.
The class name is bound to this class object in the original local
namespace.

The order in which attributes are defined in the class body is
preserved in the new class’s "__dict__".  Note that this is reliable
only right after the class is created and only for classes that were
defined using the definition syntax.

Class creation can be customized heavily using metaclasses.

Classes can also be decorated: just like when decorating functions,

   @f1(arg)
   @f2
   class Foo: pass

is roughly equivalent to

   class Foo: pass
   Foo = f1(arg)(f2(Foo))

The evaluation rules for the decorator expressions are the same as for
function decorators.  The result is then bound to the class name.

**Programmer’s note:** Variables defined in the class definition are
class attributes; they are shared by instances.  Instance attributes
can be set in a method with "self.name = value".  Both class and
instance attributes are accessible through the notation “"self.name"”,
and an instance attribute hides a class attribute with the same name
when accessed in this way.  Class attributes can be used as defaults
for instance attributes, but using mutable values there can lead to
unexpected results.  Descriptors can be used to create instance
variables with different implementation details.

See also:

  **PEP 3115** - Metaclasses in Python 3000
     The proposal that changed the declaration of metaclasses to the
     current syntax, and the semantics for how classes with
     metaclasses are constructed.

  **PEP 3129** - Class Decorators
     The proposal that added class decorators.  Function and method
     decorators were introduced in **PEP 318**.
u�'Comparisons
***********

Unlike C, all comparison operations in Python have the same priority,
which is lower than that of any arithmetic, shifting or bitwise
operation.  Also unlike C, expressions like "a < b < c" have the
interpretation that is conventional in mathematics:

   comparison    ::= or_expr (comp_operator or_expr)*
   comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "!="
                     | "is" ["not"] | ["not"] "in"

Comparisons yield boolean values: "True" or "False".

Comparisons can be chained arbitrarily, e.g., "x < y <= z" is
equivalent to "x < y and y <= z", except that "y" is evaluated only
once (but in both cases "z" is not evaluated at all when "x < y" is
found to be false).

Formally, if *a*, *b*, *c*, …, *y*, *z* are expressions and *op1*,
*op2*, …, *opN* are comparison operators, then "a op1 b op2 c ... y
opN z" is equivalent to "a op1 b and b op2 c and ... y opN z", except
that each expression is evaluated at most once.

Note that "a op1 b op2 c" doesn’t imply any kind of comparison between
*a* and *c*, so that, e.g., "x < y > z" is perfectly legal (though
perhaps not pretty).


Value comparisons
=================

The operators "<", ">", "==", ">=", "<=", and "!=" compare the values
of two objects.  The objects do not need to have the same type.

Chapter Objects, values and types states that objects have a value (in
addition to type and identity).  The value of an object is a rather
abstract notion in Python: For example, there is no canonical access
method for an object’s value.  Also, there is no requirement that the
value of an object should be constructed in a particular way, e.g.
comprised of all its data attributes. Comparison operators implement a
particular notion of what the value of an object is.  One can think of
them as defining the value of an object indirectly, by means of their
comparison implementation.

Because all types are (direct or indirect) subtypes of "object", they
inherit the default comparison behavior from "object".  Types can
customize their comparison behavior by implementing *rich comparison
methods* like "__lt__()", described in Basic customization.

The default behavior for equality comparison ("==" and "!=") is based
on the identity of the objects.  Hence, equality comparison of
instances with the same identity results in equality, and equality
comparison of instances with different identities results in
inequality.  A motivation for this default behavior is the desire that
all objects should be reflexive (i.e. "x is y" implies "x == y").

A default order comparison ("<", ">", "<=", and ">=") is not provided;
an attempt raises "TypeError".  A motivation for this default behavior
is the lack of a similar invariant as for equality.

The behavior of the default equality comparison, that instances with
different identities are always unequal, may be in contrast to what
types will need that have a sensible definition of object value and
value-based equality.  Such types will need to customize their
comparison behavior, and in fact, a number of built-in types have done
that.

The following list describes the comparison behavior of the most
important built-in types.

* Numbers of built-in numeric types (Numeric Types — int, float,
  complex) and of the standard library types "fractions.Fraction" and
  "decimal.Decimal" can be compared within and across their types,
  with the restriction that complex numbers do not support order
  comparison.  Within the limits of the types involved, they compare
  mathematically (algorithmically) correct without loss of precision.

  The not-a-number values "float('NaN')" and "decimal.Decimal('NaN')"
  are special.  Any ordered comparison of a number to a not-a-number
  value is false. A counter-intuitive implication is that not-a-number
  values are not equal to themselves.  For example, if "x =
  float('NaN')", "3 < x", "x < 3" and "x == x" are all false, while "x
  != x" is true.  This behavior is compliant with IEEE 754.

* "None" and "NotImplemented" are singletons.  **PEP 8** advises that
  comparisons for singletons should always be done with "is" or "is
  not", never the equality operators.

* Binary sequences (instances of "bytes" or "bytearray") can be
  compared within and across their types.  They compare
  lexicographically using the numeric values of their elements.

* Strings (instances of "str") compare lexicographically using the
  numerical Unicode code points (the result of the built-in function
  "ord()") of their characters. [3]

  Strings and binary sequences cannot be directly compared.

* Sequences (instances of "tuple", "list", or "range") can be compared
  only within each of their types, with the restriction that ranges do
  not support order comparison.  Equality comparison across these
  types results in inequality, and ordering comparison across these
  types raises "TypeError".

  Sequences compare lexicographically using comparison of
  corresponding elements.  The built-in containers typically assume
  identical objects are equal to themselves.  That lets them bypass
  equality tests for identical objects to improve performance and to
  maintain their internal invariants.

  Lexicographical comparison between built-in collections works as
  follows:

  * For two collections to compare equal, they must be of the same
    type, have the same length, and each pair of corresponding
    elements must compare equal (for example, "[1,2] == (1,2)" is
    false because the type is not the same).

  * Collections that support order comparison are ordered the same as
    their first unequal elements (for example, "[1,2,x] <= [1,2,y]"
    has the same value as "x <= y").  If a corresponding element does
    not exist, the shorter collection is ordered first (for example,
    "[1,2] < [1,2,3]" is true).

* Mappings (instances of "dict") compare equal if and only if they
  have equal *(key, value)* pairs. Equality comparison of the keys and
  values enforces reflexivity.

  Order comparisons ("<", ">", "<=", and ">=") raise "TypeError".

* Sets (instances of "set" or "frozenset") can be compared within and
  across their types.

  They define order comparison operators to mean subset and superset
  tests.  Those relations do not define total orderings (for example,
  the two sets "{1,2}" and "{2,3}" are not equal, nor subsets of one
  another, nor supersets of one another).  Accordingly, sets are not
  appropriate arguments for functions which depend on total ordering
  (for example, "min()", "max()", and "sorted()" produce undefined
  results given a list of sets as inputs).

  Comparison of sets enforces reflexivity of its elements.

* Most other built-in types have no comparison methods implemented, so
  they inherit the default comparison behavior.

User-defined classes that customize their comparison behavior should
follow some consistency rules, if possible:

* Equality comparison should be reflexive. In other words, identical
  objects should compare equal:

     "x is y" implies "x == y"

* Comparison should be symmetric. In other words, the following
  expressions should have the same result:

     "x == y" and "y == x"

     "x != y" and "y != x"

     "x < y" and "y > x"

     "x <= y" and "y >= x"

* Comparison should be transitive. The following (non-exhaustive)
  examples illustrate that:

     "x > y and y > z" implies "x > z"

     "x < y and y <= z" implies "x < z"

* Inverse comparison should result in the boolean negation. In other
  words, the following expressions should have the same result:

     "x == y" and "not x != y"

     "x < y" and "not x >= y" (for total ordering)

     "x > y" and "not x <= y" (for total ordering)

  The last two expressions apply to totally ordered collections (e.g.
  to sequences, but not to sets or mappings). See also the
  "total_ordering()" decorator.

* The "hash()" result should be consistent with equality. Objects that
  are equal should either have the same hash value, or be marked as
  unhashable.

Python does not enforce these consistency rules. In fact, the
not-a-number values are an example for not following these rules.


Membership test operations
==========================

The operators "in" and "not in" test for membership.  "x in s"
evaluates to "True" if *x* is a member of *s*, and "False" otherwise.
"x not in s" returns the negation of "x in s".  All built-in sequences
and set types support this as well as dictionary, for which "in" tests
whether the dictionary has a given key. For container types such as
list, tuple, set, frozenset, dict, or collections.deque, the
expression "x in y" is equivalent to "any(x is e or x == e for e in
y)".

For the string and bytes types, "x in y" is "True" if and only if *x*
is a substring of *y*.  An equivalent test is "y.find(x) != -1".
Empty strings are always considered to be a substring of any other
string, so """ in "abc"" will return "True".

For user-defined classes which define the "__contains__()" method, "x
in y" returns "True" if "y.__contains__(x)" returns a true value, and
"False" otherwise.

For user-defined classes which do not define "__contains__()" but do
define "__iter__()", "x in y" is "True" if some value "z", for which
the expression "x is z or x == z" is true, is produced while iterating
over "y". If an exception is raised during the iteration, it is as if
"in" raised that exception.

Lastly, the old-style iteration protocol is tried: if a class defines
"__getitem__()", "x in y" is "True" if and only if there is a non-
negative integer index *i* such that "x is y[i] or x == y[i]", and no
lower integer index raises the "IndexError" exception.  (If any other
exception is raised, it is as if "in" raised that exception).

The operator "not in" is defined to have the inverse truth value of
"in".


Identity comparisons
====================

The operators "is" and "is not" test for an object’s identity: "x is
y" is true if and only if *x* and *y* are the same object.  An
Object’s identity is determined using the "id()" function.  "x is not
y" yields the inverse truth value. [4]
u�lCompound statements
*******************

Compound statements contain (groups of) other statements; they affect
or control the execution of those other statements in some way.  In
general, compound statements span multiple lines, although in simple
incarnations a whole compound statement may be contained in one line.

The "if", "while" and "for" statements implement traditional control
flow constructs.  "try" specifies exception handlers and/or cleanup
code for a group of statements, while the "with" statement allows the
execution of initialization and finalization code around a block of
code.  Function and class definitions are also syntactically compound
statements.

A compound statement consists of one or more ‘clauses.’  A clause
consists of a header and a ‘suite.’  The clause headers of a
particular compound statement are all at the same indentation level.
Each clause header begins with a uniquely identifying keyword and ends
with a colon.  A suite is a group of statements controlled by a
clause.  A suite can be one or more semicolon-separated simple
statements on the same line as the header, following the header’s
colon, or it can be one or more indented statements on subsequent
lines.  Only the latter form of a suite can contain nested compound
statements; the following is illegal, mostly because it wouldn’t be
clear to which "if" clause a following "else" clause would belong:

   if test1: if test2: print(x)

Also note that the semicolon binds tighter than the colon in this
context, so that in the following example, either all or none of the
"print()" calls are executed:

   if x < y < z: print(x); print(y); print(z)

Summarizing:

   compound_stmt ::= if_stmt
                     | while_stmt
                     | for_stmt
                     | try_stmt
                     | with_stmt
                     | funcdef
                     | classdef
                     | async_with_stmt
                     | async_for_stmt
                     | async_funcdef
   suite         ::= stmt_list NEWLINE | NEWLINE INDENT statement+ DEDENT
   statement     ::= stmt_list NEWLINE | compound_stmt
   stmt_list     ::= simple_stmt (";" simple_stmt)* [";"]

Note that statements always end in a "NEWLINE" possibly followed by a
"DEDENT".  Also note that optional continuation clauses always begin
with a keyword that cannot start a statement, thus there are no
ambiguities (the ‘dangling "else"’ problem is solved in Python by
requiring nested "if" statements to be indented).

The formatting of the grammar rules in the following sections places
each clause on a separate line for clarity.


The "if" statement
==================

The "if" statement is used for conditional execution:

   if_stmt ::= "if" assignment_expression ":" suite
               ("elif" assignment_expression ":" suite)*
               ["else" ":" suite]

It selects exactly one of the suites by evaluating the expressions one
by one until one is found to be true (see section Boolean operations
for the definition of true and false); then that suite is executed
(and no other part of the "if" statement is executed or evaluated).
If all expressions are false, the suite of the "else" clause, if
present, is executed.


The "while" statement
=====================

The "while" statement is used for repeated execution as long as an
expression is true:

   while_stmt ::= "while" assignment_expression ":" suite
                  ["else" ":" suite]

This repeatedly tests the expression and, if it is true, executes the
first suite; if the expression is false (which may be the first time
it is tested) the suite of the "else" clause, if present, is executed
and the loop terminates.

A "break" statement executed in the first suite terminates the loop
without executing the "else" clause’s suite.  A "continue" statement
executed in the first suite skips the rest of the suite and goes back
to testing the expression.


The "for" statement
===================

The "for" statement is used to iterate over the elements of a sequence
(such as a string, tuple or list) or other iterable object:

   for_stmt ::= "for" target_list "in" expression_list ":" suite
                ["else" ":" suite]

The expression list is evaluated once; it should yield an iterable
object.  An iterator is created for the result of the
"expression_list".  The suite is then executed once for each item
provided by the iterator, in the order returned by the iterator.  Each
item in turn is assigned to the target list using the standard rules
for assignments (see Assignment statements), and then the suite is
executed.  When the items are exhausted (which is immediately when the
sequence is empty or an iterator raises a "StopIteration" exception),
the suite in the "else" clause, if present, is executed, and the loop
terminates.

A "break" statement executed in the first suite terminates the loop
without executing the "else" clause’s suite.  A "continue" statement
executed in the first suite skips the rest of the suite and continues
with the next item, or with the "else" clause if there is no next
item.

The for-loop makes assignments to the variables in the target list.
This overwrites all previous assignments to those variables including
those made in the suite of the for-loop:

   for i in range(10):
       print(i)
       i = 5             # this will not affect the for-loop
                         # because i will be overwritten with the next
                         # index in the range

Names in the target list are not deleted when the loop is finished,
but if the sequence is empty, they will not have been assigned to at
all by the loop.  Hint: the built-in function "range()" returns an
iterator of integers suitable to emulate the effect of Pascal’s "for i
:= a to b do"; e.g., "list(range(3))" returns the list "[0, 1, 2]".

Note:

  There is a subtlety when the sequence is being modified by the loop
  (this can only occur for mutable sequences, e.g. lists).  An
  internal counter is used to keep track of which item is used next,
  and this is incremented on each iteration.  When this counter has
  reached the length of the sequence the loop terminates.  This means
  that if the suite deletes the current (or a previous) item from the
  sequence, the next item will be skipped (since it gets the index of
  the current item which has already been treated).  Likewise, if the
  suite inserts an item in the sequence before the current item, the
  current item will be treated again the next time through the loop.
  This can lead to nasty bugs that can be avoided by making a
  temporary copy using a slice of the whole sequence, e.g.,

     for x in a[:]:
         if x < 0: a.remove(x)


The "try" statement
===================

The "try" statement specifies exception handlers and/or cleanup code
for a group of statements:

   try_stmt  ::= try1_stmt | try2_stmt
   try1_stmt ::= "try" ":" suite
                 ("except" [expression ["as" identifier]] ":" suite)+
                 ["else" ":" suite]
                 ["finally" ":" suite]
   try2_stmt ::= "try" ":" suite
                 "finally" ":" suite

The "except" clause(s) specify one or more exception handlers. When no
exception occurs in the "try" clause, no exception handler is
executed. When an exception occurs in the "try" suite, a search for an
exception handler is started.  This search inspects the except clauses
in turn until one is found that matches the exception.  An expression-
less except clause, if present, must be last; it matches any
exception.  For an except clause with an expression, that expression
is evaluated, and the clause matches the exception if the resulting
object is “compatible” with the exception.  An object is compatible
with an exception if it is the class or a base class of the exception
object, or a tuple containing an item that is the class or a base
class of the exception object.

If no except clause matches the exception, the search for an exception
handler continues in the surrounding code and on the invocation stack.
[1]

If the evaluation of an expression in the header of an except clause
raises an exception, the original search for a handler is canceled and
a search starts for the new exception in the surrounding code and on
the call stack (it is treated as if the entire "try" statement raised
the exception).

When a matching except clause is found, the exception is assigned to
the target specified after the "as" keyword in that except clause, if
present, and the except clause’s suite is executed.  All except
clauses must have an executable block.  When the end of this block is
reached, execution continues normally after the entire try statement.
(This means that if two nested handlers exist for the same exception,
and the exception occurs in the try clause of the inner handler, the
outer handler will not handle the exception.)

When an exception has been assigned using "as target", it is cleared
at the end of the except clause.  This is as if

   except E as N:
       foo

was translated to

   except E as N:
       try:
           foo
       finally:
           del N

This means the exception must be assigned to a different name to be
able to refer to it after the except clause.  Exceptions are cleared
because with the traceback attached to them, they form a reference
cycle with the stack frame, keeping all locals in that frame alive
until the next garbage collection occurs.

Before an except clause’s suite is executed, details about the
exception are stored in the "sys" module and can be accessed via
"sys.exc_info()". "sys.exc_info()" returns a 3-tuple consisting of the
exception class, the exception instance and a traceback object (see
section The standard type hierarchy) identifying the point in the
program where the exception occurred.  "sys.exc_info()" values are
restored to their previous values (before the call) when returning
from a function that handled an exception.

The optional "else" clause is executed if the control flow leaves the
"try" suite, no exception was raised, and no "return", "continue", or
"break" statement was executed.  Exceptions in the "else" clause are
not handled by the preceding "except" clauses.

If "finally" is present, it specifies a ‘cleanup’ handler.  The "try"
clause is executed, including any "except" and "else" clauses.  If an
exception occurs in any of the clauses and is not handled, the
exception is temporarily saved. The "finally" clause is executed.  If
there is a saved exception it is re-raised at the end of the "finally"
clause.  If the "finally" clause raises another exception, the saved
exception is set as the context of the new exception. If the "finally"
clause executes a "return", "break" or "continue" statement, the saved
exception is discarded:

   >>> def f():
   ...     try:
   ...         1/0
   ...     finally:
   ...         return 42
   ...
   >>> f()
   42

The exception information is not available to the program during
execution of the "finally" clause.

When a "return", "break" or "continue" statement is executed in the
"try" suite of a "try"…"finally" statement, the "finally" clause is
also executed ‘on the way out.’

The return value of a function is determined by the last "return"
statement executed.  Since the "finally" clause always executes, a
"return" statement executed in the "finally" clause will always be the
last one executed:

   >>> def foo():
   ...     try:
   ...         return 'try'
   ...     finally:
   ...         return 'finally'
   ...
   >>> foo()
   'finally'

Additional information on exceptions can be found in section
Exceptions, and information on using the "raise" statement to generate
exceptions may be found in section The raise statement.

Changed in version 3.8: Prior to Python 3.8, a "continue" statement
was illegal in the "finally" clause due to a problem with the
implementation.


The "with" statement
====================

The "with" statement is used to wrap the execution of a block with
methods defined by a context manager (see section With Statement
Context Managers). This allows common "try"…"except"…"finally" usage
patterns to be encapsulated for convenient reuse.

   with_stmt ::= "with" with_item ("," with_item)* ":" suite
   with_item ::= expression ["as" target]

The execution of the "with" statement with one “item” proceeds as
follows:

1. The context expression (the expression given in the "with_item") is
   evaluated to obtain a context manager.

2. The context manager’s "__enter__()" is loaded for later use.

3. The context manager’s "__exit__()" is loaded for later use.

4. The context manager’s "__enter__()" method is invoked.

5. If a target was included in the "with" statement, the return value
   from "__enter__()" is assigned to it.

   Note:

     The "with" statement guarantees that if the "__enter__()" method
     returns without an error, then "__exit__()" will always be
     called. Thus, if an error occurs during the assignment to the
     target list, it will be treated the same as an error occurring
     within the suite would be. See step 6 below.

6. The suite is executed.

7. The context manager’s "__exit__()" method is invoked.  If an
   exception caused the suite to be exited, its type, value, and
   traceback are passed as arguments to "__exit__()". Otherwise, three
   "None" arguments are supplied.

   If the suite was exited due to an exception, and the return value
   from the "__exit__()" method was false, the exception is reraised.
   If the return value was true, the exception is suppressed, and
   execution continues with the statement following the "with"
   statement.

   If the suite was exited for any reason other than an exception, the
   return value from "__exit__()" is ignored, and execution proceeds
   at the normal location for the kind of exit that was taken.

The following code:

   with EXPRESSION as TARGET:
       SUITE

is semantically equivalent to:

   manager = (EXPRESSION)
   enter = type(manager).__enter__
   exit = type(manager).__exit__
   value = enter(manager)
   hit_except = False

   try:
       TARGET = value
       SUITE
   except:
       hit_except = True
       if not exit(manager, *sys.exc_info()):
           raise
   finally:
       if not hit_except:
           exit(manager, None, None, None)

With more than one item, the context managers are processed as if
multiple "with" statements were nested:

   with A() as a, B() as b:
       SUITE

is semantically equivalent to:

   with A() as a:
       with B() as b:
           SUITE

Changed in version 3.1: Support for multiple context expressions.

See also:

  **PEP 343** - The “with” statement
     The specification, background, and examples for the Python "with"
     statement.


Function definitions
====================

A function definition defines a user-defined function object (see
section The standard type hierarchy):

   funcdef                   ::= [decorators] "def" funcname "(" [parameter_list] ")"
               ["->" expression] ":" suite
   decorators                ::= decorator+
   decorator                 ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE
   dotted_name               ::= identifier ("." identifier)*
   parameter_list            ::= defparameter ("," defparameter)* "," "/" ["," [parameter_list_no_posonly]]
                        | parameter_list_no_posonly
   parameter_list_no_posonly ::= defparameter ("," defparameter)* ["," [parameter_list_starargs]]
                                 | parameter_list_starargs
   parameter_list_starargs   ::= "*" [parameter] ("," defparameter)* ["," ["**" parameter [","]]]
                               | "**" parameter [","]
   parameter                 ::= identifier [":" expression]
   defparameter              ::= parameter ["=" expression]
   funcname                  ::= identifier

A function definition is an executable statement.  Its execution binds
the function name in the current local namespace to a function object
(a wrapper around the executable code for the function).  This
function object contains a reference to the current global namespace
as the global namespace to be used when the function is called.

The function definition does not execute the function body; this gets
executed only when the function is called. [2]

A function definition may be wrapped by one or more *decorator*
expressions. Decorator expressions are evaluated when the function is
defined, in the scope that contains the function definition.  The
result must be a callable, which is invoked with the function object
as the only argument. The returned value is bound to the function name
instead of the function object.  Multiple decorators are applied in
nested fashion. For example, the following code

   @f1(arg)
   @f2
   def func(): pass

is roughly equivalent to

   def func(): pass
   func = f1(arg)(f2(func))

except that the original function is not temporarily bound to the name
"func".

When one or more *parameters* have the form *parameter* "="
*expression*, the function is said to have “default parameter values.”
For a parameter with a default value, the corresponding *argument* may
be omitted from a call, in which case the parameter’s default value is
substituted.  If a parameter has a default value, all following
parameters up until the “"*"” must also have a default value — this is
a syntactic restriction that is not expressed by the grammar.

**Default parameter values are evaluated from left to right when the
function definition is executed.** This means that the expression is
evaluated once, when the function is defined, and that the same “pre-
computed” value is used for each call.  This is especially important
to understand when a default parameter is a mutable object, such as a
list or a dictionary: if the function modifies the object (e.g. by
appending an item to a list), the default value is in effect modified.
This is generally not what was intended.  A way around this is to use
"None" as the default, and explicitly test for it in the body of the
function, e.g.:

   def whats_on_the_telly(penguin=None):
       if penguin is None:
           penguin = []
       penguin.append("property of the zoo")
       return penguin

Function call semantics are described in more detail in section Calls.
A function call always assigns values to all parameters mentioned in
the parameter list, either from positional arguments, from keyword
arguments, or from default values.  If the form “"*identifier"” is
present, it is initialized to a tuple receiving any excess positional
parameters, defaulting to the empty tuple. If the form
“"**identifier"” is present, it is initialized to a new ordered
mapping receiving any excess keyword arguments, defaulting to a new
empty mapping of the same type.  Parameters after “"*"” or
“"*identifier"” are keyword-only parameters and may only be passed by
keyword arguments.  Parameters before “"/"” are positional-only
parameters and may only be passed by positional arguments.

Changed in version 3.8: The "/" function parameter syntax may be used
to indicate positional-only parameters. See **PEP 570** for details.

Parameters may have an *annotation* of the form “": expression"”
following the parameter name.  Any parameter may have an annotation,
even those of the form "*identifier" or "**identifier".  Functions may
have “return” annotation of the form “"-> expression"” after the
parameter list.  These annotations can be any valid Python expression.
The presence of annotations does not change the semantics of a
function.  The annotation values are available as values of a
dictionary keyed by the parameters’ names in the "__annotations__"
attribute of the function object.  If the "annotations" import from
"__future__" is used, annotations are preserved as strings at runtime
which enables postponed evaluation.  Otherwise, they are evaluated
when the function definition is executed.  In this case annotations
may be evaluated in a different order than they appear in the source
code.

It is also possible to create anonymous functions (functions not bound
to a name), for immediate use in expressions.  This uses lambda
expressions, described in section Lambdas.  Note that the lambda
expression is merely a shorthand for a simplified function definition;
a function defined in a “"def"” statement can be passed around or
assigned to another name just like a function defined by a lambda
expression.  The “"def"” form is actually more powerful since it
allows the execution of multiple statements and annotations.

**Programmer’s note:** Functions are first-class objects.  A “"def"”
statement executed inside a function definition defines a local
function that can be returned or passed around.  Free variables used
in the nested function can access the local variables of the function
containing the def.  See section Naming and binding for details.

See also:

  **PEP 3107** - Function Annotations
     The original specification for function annotations.

  **PEP 484** - Type Hints
     Definition of a standard meaning for annotations: type hints.

  **PEP 526** - Syntax for Variable Annotations
     Ability to type hint variable declarations, including class
     variables and instance variables

  **PEP 563** - Postponed Evaluation of Annotations
     Support for forward references within annotations by preserving
     annotations in a string form at runtime instead of eager
     evaluation.


Class definitions
=================

A class definition defines a class object (see section The standard
type hierarchy):

   classdef    ::= [decorators] "class" classname [inheritance] ":" suite
   inheritance ::= "(" [argument_list] ")"
   classname   ::= identifier

A class definition is an executable statement.  The inheritance list
usually gives a list of base classes (see Metaclasses for more
advanced uses), so each item in the list should evaluate to a class
object which allows subclassing.  Classes without an inheritance list
inherit, by default, from the base class "object"; hence,

   class Foo:
       pass

is equivalent to

   class Foo(object):
       pass

The class’s suite is then executed in a new execution frame (see
Naming and binding), using a newly created local namespace and the
original global namespace. (Usually, the suite contains mostly
function definitions.)  When the class’s suite finishes execution, its
execution frame is discarded but its local namespace is saved. [3] A
class object is then created using the inheritance list for the base
classes and the saved local namespace for the attribute dictionary.
The class name is bound to this class object in the original local
namespace.

The order in which attributes are defined in the class body is
preserved in the new class’s "__dict__".  Note that this is reliable
only right after the class is created and only for classes that were
defined using the definition syntax.

Class creation can be customized heavily using metaclasses.

Classes can also be decorated: just like when decorating functions,

   @f1(arg)
   @f2
   class Foo: pass

is roughly equivalent to

   class Foo: pass
   Foo = f1(arg)(f2(Foo))

The evaluation rules for the decorator expressions are the same as for
function decorators.  The result is then bound to the class name.

**Programmer’s note:** Variables defined in the class definition are
class attributes; they are shared by instances.  Instance attributes
can be set in a method with "self.name = value".  Both class and
instance attributes are accessible through the notation “"self.name"”,
and an instance attribute hides a class attribute with the same name
when accessed in this way.  Class attributes can be used as defaults
for instance attributes, but using mutable values there can lead to
unexpected results.  Descriptors can be used to create instance
variables with different implementation details.

See also:

  **PEP 3115** - Metaclasses in Python 3000
     The proposal that changed the declaration of metaclasses to the
     current syntax, and the semantics for how classes with
     metaclasses are constructed.

  **PEP 3129** - Class Decorators
     The proposal that added class decorators.  Function and method
     decorators were introduced in **PEP 318**.


Coroutines
==========

New in version 3.5.


Coroutine function definition
-----------------------------

   async_funcdef ::= [decorators] "async" "def" funcname "(" [parameter_list] ")"
                     ["->" expression] ":" suite

Execution of Python coroutines can be suspended and resumed at many
points (see *coroutine*).  Inside the body of a coroutine function,
"await" and "async" identifiers become reserved keywords; "await"
expressions, "async for" and "async with" can only be used in
coroutine function bodies.

Functions defined with "async def" syntax are always coroutine
functions, even if they do not contain "await" or "async" keywords.

It is a "SyntaxError" to use a "yield from" expression inside the body
of a coroutine function.

An example of a coroutine function:

   async def func(param1, param2):
       do_stuff()
       await some_coroutine()


The "async for" statement
-------------------------

   async_for_stmt ::= "async" for_stmt

An *asynchronous iterable* is able to call asynchronous code in its
*iter* implementation, and *asynchronous iterator* can call
asynchronous code in its *next* method.

The "async for" statement allows convenient iteration over
asynchronous iterators.

The following code:

   async for TARGET in ITER:
       SUITE
   else:
       SUITE2

Is semantically equivalent to:

   iter = (ITER)
   iter = type(iter).__aiter__(iter)
   running = True

   while running:
       try:
           TARGET = await type(iter).__anext__(iter)
       except StopAsyncIteration:
           running = False
       else:
           SUITE
   else:
       SUITE2

See also "__aiter__()" and "__anext__()" for details.

It is a "SyntaxError" to use an "async for" statement outside the body
of a coroutine function.


The "async with" statement
--------------------------

   async_with_stmt ::= "async" with_stmt

An *asynchronous context manager* is a *context manager* that is able
to suspend execution in its *enter* and *exit* methods.

The following code:

   async with EXPRESSION as TARGET:
       SUITE

is semantically equivalent to:

   manager = (EXPRESSION)
   aexit = type(manager).__aexit__
   aenter = type(manager).__aenter__
   value = await aenter(manager)
   hit_except = False

   try:
       TARGET = value
       SUITE
   except:
       hit_except = True
       if not await aexit(manager, *sys.exc_info()):
           raise
   finally:
       if not hit_except:
           await aexit(manager, None, None, None)

See also "__aenter__()" and "__aexit__()" for details.

It is a "SyntaxError" to use an "async with" statement outside the
body of a coroutine function.

See also:

  **PEP 492** - Coroutines with async and await syntax
     The proposal that made coroutines a proper standalone concept in
     Python, and added supporting syntax.

-[ Footnotes ]-

[1] The exception is propagated to the invocation stack unless there
    is a "finally" clause which happens to raise another exception.
    That new exception causes the old one to be lost.

[2] A string literal appearing as the first statement in the function
    body is transformed into the function’s "__doc__" attribute and
    therefore the function’s *docstring*.

[3] A string literal appearing as the first statement in the class
    body is transformed into the namespace’s "__doc__" item and
    therefore the class’s *docstring*.
u�With Statement Context Managers
*******************************

A *context manager* is an object that defines the runtime context to
be established when executing a "with" statement. The context manager
handles the entry into, and the exit from, the desired runtime context
for the execution of the block of code.  Context managers are normally
invoked using the "with" statement (described in section The with
statement), but can also be used by directly invoking their methods.

Typical uses of context managers include saving and restoring various
kinds of global state, locking and unlocking resources, closing opened
files, etc.

For more information on context managers, see Context Manager Types.

object.__enter__(self)

   Enter the runtime context related to this object. The "with"
   statement will bind this method’s return value to the target(s)
   specified in the "as" clause of the statement, if any.

object.__exit__(self, exc_type, exc_value, traceback)

   Exit the runtime context related to this object. The parameters
   describe the exception that caused the context to be exited. If the
   context was exited without an exception, all three arguments will
   be "None".

   If an exception is supplied, and the method wishes to suppress the
   exception (i.e., prevent it from being propagated), it should
   return a true value. Otherwise, the exception will be processed
   normally upon exit from this method.

   Note that "__exit__()" methods should not reraise the passed-in
   exception; this is the caller’s responsibility.

See also:

  **PEP 343** - The “with” statement
     The specification, background, and examples for the Python "with"
     statement.
a�The "continue" statement
************************

   continue_stmt ::= "continue"

"continue" may only occur syntactically nested in a "for" or "while"
loop, but not nested in a function or class definition within that
loop.  It continues with the next cycle of the nearest enclosing loop.

When "continue" passes control out of a "try" statement with a
"finally" clause, that "finally" clause is executed before really
starting the next loop cycle.
u�Arithmetic conversions
**********************

When a description of an arithmetic operator below uses the phrase
“the numeric arguments are converted to a common type”, this means
that the operator implementation for built-in types works as follows:

* If either argument is a complex number, the other is converted to
  complex;

* otherwise, if either argument is a floating point number, the other
  is converted to floating point;

* otherwise, both must be integers and no conversion is necessary.

Some additional rules apply for certain operators (e.g., a string as a
left argument to the ‘%’ operator).  Extensions must define their own
conversion behavior.
uS5Basic customization
*******************

object.__new__(cls[, ...])

   Called to create a new instance of class *cls*.  "__new__()" is a
   static method (special-cased so you need not declare it as such)
   that takes the class of which an instance was requested as its
   first argument.  The remaining arguments are those passed to the
   object constructor expression (the call to the class).  The return
   value of "__new__()" should be the new object instance (usually an
   instance of *cls*).

   Typical implementations create a new instance of the class by
   invoking the superclass’s "__new__()" method using
   "super().__new__(cls[, ...])" with appropriate arguments and then
   modifying the newly-created instance as necessary before returning
   it.

   If "__new__()" is invoked during object construction and it returns
   an instance of *cls*, then the new instance’s "__init__()" method
   will be invoked like "__init__(self[, ...])", where *self* is the
   new instance and the remaining arguments are the same as were
   passed to the object constructor.

   If "__new__()" does not return an instance of *cls*, then the new
   instance’s "__init__()" method will not be invoked.

   "__new__()" is intended mainly to allow subclasses of immutable
   types (like int, str, or tuple) to customize instance creation.  It
   is also commonly overridden in custom metaclasses in order to
   customize class creation.

object.__init__(self[, ...])

   Called after the instance has been created (by "__new__()"), but
   before it is returned to the caller.  The arguments are those
   passed to the class constructor expression.  If a base class has an
   "__init__()" method, the derived class’s "__init__()" method, if
   any, must explicitly call it to ensure proper initialization of the
   base class part of the instance; for example:
   "super().__init__([args...])".

   Because "__new__()" and "__init__()" work together in constructing
   objects ("__new__()" to create it, and "__init__()" to customize
   it), no non-"None" value may be returned by "__init__()"; doing so
   will cause a "TypeError" to be raised at runtime.

object.__del__(self)

   Called when the instance is about to be destroyed.  This is also
   called a finalizer or (improperly) a destructor.  If a base class
   has a "__del__()" method, the derived class’s "__del__()" method,
   if any, must explicitly call it to ensure proper deletion of the
   base class part of the instance.

   It is possible (though not recommended!) for the "__del__()" method
   to postpone destruction of the instance by creating a new reference
   to it.  This is called object *resurrection*.  It is
   implementation-dependent whether "__del__()" is called a second
   time when a resurrected object is about to be destroyed; the
   current *CPython* implementation only calls it once.

   It is not guaranteed that "__del__()" methods are called for
   objects that still exist when the interpreter exits.

   Note:

     "del x" doesn’t directly call "x.__del__()" — the former
     decrements the reference count for "x" by one, and the latter is
     only called when "x"’s reference count reaches zero.

   **CPython implementation detail:** It is possible for a reference
   cycle to prevent the reference count of an object from going to
   zero.  In this case, the cycle will be later detected and deleted
   by the *cyclic garbage collector*.  A common cause of reference
   cycles is when an exception has been caught in a local variable.
   The frame’s locals then reference the exception, which references
   its own traceback, which references the locals of all frames caught
   in the traceback.

   See also: Documentation for the "gc" module.

   Warning:

     Due to the precarious circumstances under which "__del__()"
     methods are invoked, exceptions that occur during their execution
     are ignored, and a warning is printed to "sys.stderr" instead.
     In particular:

     * "__del__()" can be invoked when arbitrary code is being
       executed, including from any arbitrary thread.  If "__del__()"
       needs to take a lock or invoke any other blocking resource, it
       may deadlock as the resource may already be taken by the code
       that gets interrupted to execute "__del__()".

     * "__del__()" can be executed during interpreter shutdown.  As a
       consequence, the global variables it needs to access (including
       other modules) may already have been deleted or set to "None".
       Python guarantees that globals whose name begins with a single
       underscore are deleted from their module before other globals
       are deleted; if no other references to such globals exist, this
       may help in assuring that imported modules are still available
       at the time when the "__del__()" method is called.

object.__repr__(self)

   Called by the "repr()" built-in function to compute the “official”
   string representation of an object.  If at all possible, this
   should look like a valid Python expression that could be used to
   recreate an object with the same value (given an appropriate
   environment).  If this is not possible, a string of the form
   "<...some useful description...>" should be returned. The return
   value must be a string object. If a class defines "__repr__()" but
   not "__str__()", then "__repr__()" is also used when an “informal”
   string representation of instances of that class is required.

   This is typically used for debugging, so it is important that the
   representation is information-rich and unambiguous.

object.__str__(self)

   Called by "str(object)" and the built-in functions "format()" and
   "print()" to compute the “informal” or nicely printable string
   representation of an object.  The return value must be a string
   object.

   This method differs from "object.__repr__()" in that there is no
   expectation that "__str__()" return a valid Python expression: a
   more convenient or concise representation can be used.

   The default implementation defined by the built-in type "object"
   calls "object.__repr__()".

object.__bytes__(self)

   Called by bytes to compute a byte-string representation of an
   object. This should return a "bytes" object.

object.__format__(self, format_spec)

   Called by the "format()" built-in function, and by extension,
   evaluation of formatted string literals and the "str.format()"
   method, to produce a “formatted” string representation of an
   object. The *format_spec* argument is a string that contains a
   description of the formatting options desired. The interpretation
   of the *format_spec* argument is up to the type implementing
   "__format__()", however most classes will either delegate
   formatting to one of the built-in types, or use a similar
   formatting option syntax.

   See Format Specification Mini-Language for a description of the
   standard formatting syntax.

   The return value must be a string object.

   Changed in version 3.4: The __format__ method of "object" itself
   raises a "TypeError" if passed any non-empty string.

   Changed in version 3.7: "object.__format__(x, '')" is now
   equivalent to "str(x)" rather than "format(str(self), '')".

object.__lt__(self, other)
object.__le__(self, other)
object.__eq__(self, other)
object.__ne__(self, other)
object.__gt__(self, other)
object.__ge__(self, other)

   These are the so-called “rich comparison” methods. The
   correspondence between operator symbols and method names is as
   follows: "x<y" calls "x.__lt__(y)", "x<=y" calls "x.__le__(y)",
   "x==y" calls "x.__eq__(y)", "x!=y" calls "x.__ne__(y)", "x>y" calls
   "x.__gt__(y)", and "x>=y" calls "x.__ge__(y)".

   A rich comparison method may return the singleton "NotImplemented"
   if it does not implement the operation for a given pair of
   arguments. By convention, "False" and "True" are returned for a
   successful comparison. However, these methods can return any value,
   so if the comparison operator is used in a Boolean context (e.g.,
   in the condition of an "if" statement), Python will call "bool()"
   on the value to determine if the result is true or false.

   By default, "object" implements "__eq__()" by using "is", returning
   "NotImplemented" in the case of a false comparison: "True if x is y
   else NotImplemented". For "__ne__()", by default it delegates to
   "__eq__()" and inverts the result unless it is "NotImplemented".
   There are no other implied relationships among the comparison
   operators or default implementations; for example, the truth of
   "(x<y or x==y)" does not imply "x<=y". To automatically generate
   ordering operations from a single root operation, see
   "functools.total_ordering()".

   See the paragraph on "__hash__()" for some important notes on
   creating *hashable* objects which support custom comparison
   operations and are usable as dictionary keys.

   There are no swapped-argument versions of these methods (to be used
   when the left argument does not support the operation but the right
   argument does); rather, "__lt__()" and "__gt__()" are each other’s
   reflection, "__le__()" and "__ge__()" are each other’s reflection,
   and "__eq__()" and "__ne__()" are their own reflection. If the
   operands are of different types, and right operand’s type is a
   direct or indirect subclass of the left operand’s type, the
   reflected method of the right operand has priority, otherwise the
   left operand’s method has priority.  Virtual subclassing is not
   considered.

object.__hash__(self)

   Called by built-in function "hash()" and for operations on members
   of hashed collections including "set", "frozenset", and "dict".
   "__hash__()" should return an integer. The only required property
   is that objects which compare equal have the same hash value; it is
   advised to mix together the hash values of the components of the
   object that also play a part in comparison of objects by packing
   them into a tuple and hashing the tuple. Example:

      def __hash__(self):
          return hash((self.name, self.nick, self.color))

   Note:

     "hash()" truncates the value returned from an object’s custom
     "__hash__()" method to the size of a "Py_ssize_t".  This is
     typically 8 bytes on 64-bit builds and 4 bytes on 32-bit builds.
     If an object’s   "__hash__()" must interoperate on builds of
     different bit sizes, be sure to check the width on all supported
     builds.  An easy way to do this is with "python -c "import sys;
     print(sys.hash_info.width)"".

   If a class does not define an "__eq__()" method it should not
   define a "__hash__()" operation either; if it defines "__eq__()"
   but not "__hash__()", its instances will not be usable as items in
   hashable collections.  If a class defines mutable objects and
   implements an "__eq__()" method, it should not implement
   "__hash__()", since the implementation of hashable collections
   requires that a key’s hash value is immutable (if the object’s hash
   value changes, it will be in the wrong hash bucket).

   User-defined classes have "__eq__()" and "__hash__()" methods by
   default; with them, all objects compare unequal (except with
   themselves) and "x.__hash__()" returns an appropriate value such
   that "x == y" implies both that "x is y" and "hash(x) == hash(y)".

   A class that overrides "__eq__()" and does not define "__hash__()"
   will have its "__hash__()" implicitly set to "None".  When the
   "__hash__()" method of a class is "None", instances of the class
   will raise an appropriate "TypeError" when a program attempts to
   retrieve their hash value, and will also be correctly identified as
   unhashable when checking "isinstance(obj,
   collections.abc.Hashable)".

   If a class that overrides "__eq__()" needs to retain the
   implementation of "__hash__()" from a parent class, the interpreter
   must be told this explicitly by setting "__hash__ =
   <ParentClass>.__hash__".

   If a class that does not override "__eq__()" wishes to suppress
   hash support, it should include "__hash__ = None" in the class
   definition. A class which defines its own "__hash__()" that
   explicitly raises a "TypeError" would be incorrectly identified as
   hashable by an "isinstance(obj, collections.abc.Hashable)" call.

   Note:

     By default, the "__hash__()" values of str and bytes objects are
     “salted” with an unpredictable random value.  Although they
     remain constant within an individual Python process, they are not
     predictable between repeated invocations of Python.This is
     intended to provide protection against a denial-of-service caused
     by carefully-chosen inputs that exploit the worst case
     performance of a dict insertion, O(n^2) complexity.  See
     http://www.ocert.org/advisories/ocert-2011-003.html for
     details.Changing hash values affects the iteration order of sets.
     Python has never made guarantees about this ordering (and it
     typically varies between 32-bit and 64-bit builds).See also
     "PYTHONHASHSEED".

   Changed in version 3.3: Hash randomization is enabled by default.

object.__bool__(self)

   Called to implement truth value testing and the built-in operation
   "bool()"; should return "False" or "True".  When this method is not
   defined, "__len__()" is called, if it is defined, and the object is
   considered true if its result is nonzero.  If a class defines
   neither "__len__()" nor "__bool__()", all its instances are
   considered true.
u�I"pdb" — The Python Debugger
***************************

**Source code:** Lib/pdb.py

======================================================================

The module "pdb" defines an interactive source code debugger for
Python programs.  It supports setting (conditional) breakpoints and
single stepping at the source line level, inspection of stack frames,
source code listing, and evaluation of arbitrary Python code in the
context of any stack frame.  It also supports post-mortem debugging
and can be called under program control.

The debugger is extensible – it is actually defined as the class
"Pdb". This is currently undocumented but easily understood by reading
the source.  The extension interface uses the modules "bdb" and "cmd".

The debugger’s prompt is "(Pdb)". Typical usage to run a program under
control of the debugger is:

   >>> import pdb
   >>> import mymodule
   >>> pdb.run('mymodule.test()')
   > <string>(0)?()
   (Pdb) continue
   > <string>(1)?()
   (Pdb) continue
   NameError: 'spam'
   > <string>(1)?()
   (Pdb)

Changed in version 3.3: Tab-completion via the "readline" module is
available for commands and command arguments, e.g. the current global
and local names are offered as arguments of the "p" command.

"pdb.py" can also be invoked as a script to debug other scripts.  For
example:

   python3 -m pdb myscript.py

When invoked as a script, pdb will automatically enter post-mortem
debugging if the program being debugged exits abnormally.  After post-
mortem debugging (or after normal exit of the program), pdb will
restart the program.  Automatic restarting preserves pdb’s state (such
as breakpoints) and in most cases is more useful than quitting the
debugger upon program’s exit.

New in version 3.2: "pdb.py" now accepts a "-c" option that executes
commands as if given in a ".pdbrc" file, see Debugger Commands.

New in version 3.7: "pdb.py" now accepts a "-m" option that execute
modules similar to the way "python3 -m" does. As with a script, the
debugger will pause execution just before the first line of the
module.

The typical usage to break into the debugger from a running program is
to insert

   import pdb; pdb.set_trace()

at the location you want to break into the debugger.  You can then
step through the code following this statement, and continue running
without the debugger using the "continue" command.

New in version 3.7: The built-in "breakpoint()", when called with
defaults, can be used instead of "import pdb; pdb.set_trace()".

The typical usage to inspect a crashed program is:

   >>> import pdb
   >>> import mymodule
   >>> mymodule.test()
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
     File "./mymodule.py", line 4, in test
       test2()
     File "./mymodule.py", line 3, in test2
       print(spam)
   NameError: spam
   >>> pdb.pm()
   > ./mymodule.py(3)test2()
   -> print(spam)
   (Pdb)

The module defines the following functions; each enters the debugger
in a slightly different way:

pdb.run(statement, globals=None, locals=None)

   Execute the *statement* (given as a string or a code object) under
   debugger control.  The debugger prompt appears before any code is
   executed; you can set breakpoints and type "continue", or you can
   step through the statement using "step" or "next" (all these
   commands are explained below).  The optional *globals* and *locals*
   arguments specify the environment in which the code is executed; by
   default the dictionary of the module "__main__" is used.  (See the
   explanation of the built-in "exec()" or "eval()" functions.)

pdb.runeval(expression, globals=None, locals=None)

   Evaluate the *expression* (given as a string or a code object)
   under debugger control.  When "runeval()" returns, it returns the
   value of the expression.  Otherwise this function is similar to
   "run()".

pdb.runcall(function, *args, **kwds)

   Call the *function* (a function or method object, not a string)
   with the given arguments.  When "runcall()" returns, it returns
   whatever the function call returned.  The debugger prompt appears
   as soon as the function is entered.

pdb.set_trace(*, header=None)

   Enter the debugger at the calling stack frame.  This is useful to
   hard-code a breakpoint at a given point in a program, even if the
   code is not otherwise being debugged (e.g. when an assertion
   fails).  If given, *header* is printed to the console just before
   debugging begins.

   Changed in version 3.7: The keyword-only argument *header*.

pdb.post_mortem(traceback=None)

   Enter post-mortem debugging of the given *traceback* object.  If no
   *traceback* is given, it uses the one of the exception that is
   currently being handled (an exception must be being handled if the
   default is to be used).

pdb.pm()

   Enter post-mortem debugging of the traceback found in
   "sys.last_traceback".

The "run*" functions and "set_trace()" are aliases for instantiating
the "Pdb" class and calling the method of the same name.  If you want
to access further features, you have to do this yourself:

class pdb.Pdb(completekey='tab', stdin=None, stdout=None, skip=None, nosigint=False, readrc=True)

   "Pdb" is the debugger class.

   The *completekey*, *stdin* and *stdout* arguments are passed to the
   underlying "cmd.Cmd" class; see the description there.

   The *skip* argument, if given, must be an iterable of glob-style
   module name patterns.  The debugger will not step into frames that
   originate in a module that matches one of these patterns. [1]

   By default, Pdb sets a handler for the SIGINT signal (which is sent
   when the user presses "Ctrl-C" on the console) when you give a
   "continue" command. This allows you to break into the debugger
   again by pressing "Ctrl-C".  If you want Pdb not to touch the
   SIGINT handler, set *nosigint* to true.

   The *readrc* argument defaults to true and controls whether Pdb
   will load .pdbrc files from the filesystem.

   Example call to enable tracing with *skip*:

      import pdb; pdb.Pdb(skip=['django.*']).set_trace()

   Raises an auditing event "pdb.Pdb" with no arguments.

   New in version 3.1: The *skip* argument.

   New in version 3.2: The *nosigint* argument.  Previously, a SIGINT
   handler was never set by Pdb.

   Changed in version 3.6: The *readrc* argument.

   run(statement, globals=None, locals=None)
   runeval(expression, globals=None, locals=None)
   runcall(function, *args, **kwds)
   set_trace()

      See the documentation for the functions explained above.


Debugger Commands
=================

The commands recognized by the debugger are listed below.  Most
commands can be abbreviated to one or two letters as indicated; e.g.
"h(elp)" means that either "h" or "help" can be used to enter the help
command (but not "he" or "hel", nor "H" or "Help" or "HELP").
Arguments to commands must be separated by whitespace (spaces or
tabs).  Optional arguments are enclosed in square brackets ("[]") in
the command syntax; the square brackets must not be typed.
Alternatives in the command syntax are separated by a vertical bar
("|").

Entering a blank line repeats the last command entered.  Exception: if
the last command was a "list" command, the next 11 lines are listed.

Commands that the debugger doesn’t recognize are assumed to be Python
statements and are executed in the context of the program being
debugged.  Python statements can also be prefixed with an exclamation
point ("!").  This is a powerful way to inspect the program being
debugged; it is even possible to change a variable or call a function.
When an exception occurs in such a statement, the exception name is
printed but the debugger’s state is not changed.

The debugger supports aliases.  Aliases can have parameters which
allows one a certain level of adaptability to the context under
examination.

Multiple commands may be entered on a single line, separated by ";;".
(A single ";" is not used as it is the separator for multiple commands
in a line that is passed to the Python parser.)  No intelligence is
applied to separating the commands; the input is split at the first
";;" pair, even if it is in the middle of a quoted string.

If a file ".pdbrc" exists in the user’s home directory or in the
current directory, it is read in and executed as if it had been typed
at the debugger prompt.  This is particularly useful for aliases.  If
both files exist, the one in the home directory is read first and
aliases defined there can be overridden by the local file.

Changed in version 3.2: ".pdbrc" can now contain commands that
continue debugging, such as "continue" or "next".  Previously, these
commands had no effect.

h(elp) [command]

   Without argument, print the list of available commands.  With a
   *command* as argument, print help about that command.  "help pdb"
   displays the full documentation (the docstring of the "pdb"
   module).  Since the *command* argument must be an identifier, "help
   exec" must be entered to get help on the "!" command.

w(here)

   Print a stack trace, with the most recent frame at the bottom.  An
   arrow indicates the current frame, which determines the context of
   most commands.

d(own) [count]

   Move the current frame *count* (default one) levels down in the
   stack trace (to a newer frame).

u(p) [count]

   Move the current frame *count* (default one) levels up in the stack
   trace (to an older frame).

b(reak) [([filename:]lineno | function) [, condition]]

   With a *lineno* argument, set a break there in the current file.
   With a *function* argument, set a break at the first executable
   statement within that function.  The line number may be prefixed
   with a filename and a colon, to specify a breakpoint in another
   file (probably one that hasn’t been loaded yet).  The file is
   searched on "sys.path".  Note that each breakpoint is assigned a
   number to which all the other breakpoint commands refer.

   If a second argument is present, it is an expression which must
   evaluate to true before the breakpoint is honored.

   Without argument, list all breaks, including for each breakpoint,
   the number of times that breakpoint has been hit, the current
   ignore count, and the associated condition if any.

tbreak [([filename:]lineno | function) [, condition]]

   Temporary breakpoint, which is removed automatically when it is
   first hit. The arguments are the same as for "break".

cl(ear) [filename:lineno | bpnumber [bpnumber ...]]

   With a *filename:lineno* argument, clear all the breakpoints at
   this line. With a space separated list of breakpoint numbers, clear
   those breakpoints. Without argument, clear all breaks (but first
   ask confirmation).

disable [bpnumber [bpnumber ...]]

   Disable the breakpoints given as a space separated list of
   breakpoint numbers.  Disabling a breakpoint means it cannot cause
   the program to stop execution, but unlike clearing a breakpoint, it
   remains in the list of breakpoints and can be (re-)enabled.

enable [bpnumber [bpnumber ...]]

   Enable the breakpoints specified.

ignore bpnumber [count]

   Set the ignore count for the given breakpoint number.  If count is
   omitted, the ignore count is set to 0.  A breakpoint becomes active
   when the ignore count is zero.  When non-zero, the count is
   decremented each time the breakpoint is reached and the breakpoint
   is not disabled and any associated condition evaluates to true.

condition bpnumber [condition]

   Set a new *condition* for the breakpoint, an expression which must
   evaluate to true before the breakpoint is honored.  If *condition*
   is absent, any existing condition is removed; i.e., the breakpoint
   is made unconditional.

commands [bpnumber]

   Specify a list of commands for breakpoint number *bpnumber*.  The
   commands themselves appear on the following lines.  Type a line
   containing just "end" to terminate the commands. An example:

      (Pdb) commands 1
      (com) p some_variable
      (com) end
      (Pdb)

   To remove all commands from a breakpoint, type "commands" and
   follow it immediately with "end"; that is, give no commands.

   With no *bpnumber* argument, "commands" refers to the last
   breakpoint set.

   You can use breakpoint commands to start your program up again.
   Simply use the "continue" command, or "step", or any other command
   that resumes execution.

   Specifying any command resuming execution (currently "continue",
   "step", "next", "return", "jump", "quit" and their abbreviations)
   terminates the command list (as if that command was immediately
   followed by end). This is because any time you resume execution
   (even with a simple next or step), you may encounter another
   breakpoint—which could have its own command list, leading to
   ambiguities about which list to execute.

   If you use the ‘silent’ command in the command list, the usual
   message about stopping at a breakpoint is not printed.  This may be
   desirable for breakpoints that are to print a specific message and
   then continue.  If none of the other commands print anything, you
   see no sign that the breakpoint was reached.

s(tep)

   Execute the current line, stop at the first possible occasion
   (either in a function that is called or on the next line in the
   current function).

n(ext)

   Continue execution until the next line in the current function is
   reached or it returns.  (The difference between "next" and "step"
   is that "step" stops inside a called function, while "next"
   executes called functions at (nearly) full speed, only stopping at
   the next line in the current function.)

unt(il) [lineno]

   Without argument, continue execution until the line with a number
   greater than the current one is reached.

   With a line number, continue execution until a line with a number
   greater or equal to that is reached.  In both cases, also stop when
   the current frame returns.

   Changed in version 3.2: Allow giving an explicit line number.

r(eturn)

   Continue execution until the current function returns.

c(ont(inue))

   Continue execution, only stop when a breakpoint is encountered.

j(ump) lineno

   Set the next line that will be executed.  Only available in the
   bottom-most frame.  This lets you jump back and execute code again,
   or jump forward to skip code that you don’t want to run.

   It should be noted that not all jumps are allowed – for instance it
   is not possible to jump into the middle of a "for" loop or out of a
   "finally" clause.

l(ist) [first[, last]]

   List source code for the current file.  Without arguments, list 11
   lines around the current line or continue the previous listing.
   With "." as argument, list 11 lines around the current line.  With
   one argument, list 11 lines around at that line.  With two
   arguments, list the given range; if the second argument is less
   than the first, it is interpreted as a count.

   The current line in the current frame is indicated by "->".  If an
   exception is being debugged, the line where the exception was
   originally raised or propagated is indicated by ">>", if it differs
   from the current line.

   New in version 3.2: The ">>" marker.

ll | longlist

   List all source code for the current function or frame.
   Interesting lines are marked as for "list".

   New in version 3.2.

a(rgs)

   Print the argument list of the current function.

p expression

   Evaluate the *expression* in the current context and print its
   value.

   Note:

     "print()" can also be used, but is not a debugger command — this
     executes the Python "print()" function.

pp expression

   Like the "p" command, except the value of the expression is pretty-
   printed using the "pprint" module.

whatis expression

   Print the type of the *expression*.

source expression

   Try to get source code for the given object and display it.

   New in version 3.2.

display [expression]

   Display the value of the expression if it changed, each time
   execution stops in the current frame.

   Without expression, list all display expressions for the current
   frame.

   New in version 3.2.

undisplay [expression]

   Do not display the expression any more in the current frame.
   Without expression, clear all display expressions for the current
   frame.

   New in version 3.2.

interact

   Start an interactive interpreter (using the "code" module) whose
   global namespace contains all the (global and local) names found in
   the current scope.

   New in version 3.2.

alias [name [command]]

   Create an alias called *name* that executes *command*.  The command
   must *not* be enclosed in quotes.  Replaceable parameters can be
   indicated by "%1", "%2", and so on, while "%*" is replaced by all
   the parameters. If no command is given, the current alias for
   *name* is shown. If no arguments are given, all aliases are listed.

   Aliases may be nested and can contain anything that can be legally
   typed at the pdb prompt.  Note that internal pdb commands *can* be
   overridden by aliases.  Such a command is then hidden until the
   alias is removed.  Aliasing is recursively applied to the first
   word of the command line; all other words in the line are left
   alone.

   As an example, here are two useful aliases (especially when placed
   in the ".pdbrc" file):

      # Print instance variables (usage "pi classInst")
      alias pi for k in %1.__dict__.keys(): print("%1.",k,"=",%1.__dict__[k])
      # Print instance variables in self
      alias ps pi self

unalias name

   Delete the specified alias.

! statement

   Execute the (one-line) *statement* in the context of the current
   stack frame. The exclamation point can be omitted unless the first
   word of the statement resembles a debugger command.  To set a
   global variable, you can prefix the assignment command with a
   "global" statement on the same line, e.g.:

      (Pdb) global list_options; list_options = ['-l']
      (Pdb)

run [args ...]
restart [args ...]

   Restart the debugged Python program.  If an argument is supplied,
   it is split with "shlex" and the result is used as the new
   "sys.argv". History, breakpoints, actions and debugger options are
   preserved. "restart" is an alias for "run".

q(uit)

   Quit from the debugger.  The program being executed is aborted.

debug code

   Enter a recursive debugger that steps through the code argument
   (which is an arbitrary expression or statement to be executed in
   the current environment).

retval

   Print the return value for the last return of a function.

-[ Footnotes ]-

[1] Whether a frame is considered to originate in a certain module is
    determined by the "__name__" in the frame globals.
a�The "del" statement
*******************

   del_stmt ::= "del" target_list

Deletion is recursively defined very similar to the way assignment is
defined. Rather than spelling it out in full details, here are some
hints.

Deletion of a target list recursively deletes each target, from left
to right.

Deletion of a name removes the binding of that name from the local or
global namespace, depending on whether the name occurs in a "global"
statement in the same code block.  If the name is unbound, a
"NameError" exception will be raised.

Deletion of attribute references, subscriptions and slicings is passed
to the primary object involved; deletion of a slicing is in general
equivalent to assignment of an empty slice of the right type (but even
this is determined by the sliced object).

Changed in version 3.2: Previously it was illegal to delete a name
from the local namespace if it occurs as a free variable in a nested
block.
uDictionary displays
*******************

A dictionary display is a possibly empty series of key/datum pairs
enclosed in curly braces:

   dict_display       ::= "{" [key_datum_list | dict_comprehension] "}"
   key_datum_list     ::= key_datum ("," key_datum)* [","]
   key_datum          ::= expression ":" expression | "**" or_expr
   dict_comprehension ::= expression ":" expression comp_for

A dictionary display yields a new dictionary object.

If a comma-separated sequence of key/datum pairs is given, they are
evaluated from left to right to define the entries of the dictionary:
each key object is used as a key into the dictionary to store the
corresponding datum.  This means that you can specify the same key
multiple times in the key/datum list, and the final dictionary’s value
for that key will be the last one given.

A double asterisk "**" denotes *dictionary unpacking*. Its operand
must be a *mapping*.  Each mapping item is added to the new
dictionary.  Later values replace values already set by earlier
key/datum pairs and earlier dictionary unpackings.

New in version 3.5: Unpacking into dictionary displays, originally
proposed by **PEP 448**.

A dict comprehension, in contrast to list and set comprehensions,
needs two expressions separated with a colon followed by the usual
“for” and “if” clauses. When the comprehension is run, the resulting
key and value elements are inserted in the new dictionary in the order
they are produced.

Restrictions on the types of the key values are listed earlier in
section The standard type hierarchy.  (To summarize, the key type
should be *hashable*, which excludes all mutable objects.)  Clashes
between duplicate keys are not detected; the last datum (textually
rightmost in the display) stored for a given key value prevails.

Changed in version 3.8: Prior to Python 3.8, in dict comprehensions,
the evaluation order of key and value was not well-defined.  In
CPython, the value was evaluated before the key.  Starting with 3.8,
the key is evaluated before the value, as proposed by **PEP 572**.
a�Interaction with dynamic features
*********************************

Name resolution of free variables occurs at runtime, not at compile
time. This means that the following code will print 42:

   i = 10
   def f():
       print(i)
   i = 42
   f()

The "eval()" and "exec()" functions do not have access to the full
environment for resolving names.  Names may be resolved in the local
and global namespaces of the caller.  Free variables are not resolved
in the nearest enclosing namespace, but in the global namespace.  [1]
The "exec()" and "eval()" functions have optional arguments to
override the global and local namespace.  If only one namespace is
specified, it is used for both.
aXThe "if" statement
******************

The "if" statement is used for conditional execution:

   if_stmt ::= "if" assignment_expression ":" suite
               ("elif" assignment_expression ":" suite)*
               ["else" ":" suite]

It selects exactly one of the suites by evaluating the expressions one
by one until one is found to be true (see section Boolean operations
for the definition of true and false); then that suite is executed
(and no other part of the "if" statement is executed or evaluated).
If all expressions are false, the suite of the "else" clause, if
present, is executed.
u�Exceptions
**********

Exceptions are a means of breaking out of the normal flow of control
of a code block in order to handle errors or other exceptional
conditions.  An exception is *raised* at the point where the error is
detected; it may be *handled* by the surrounding code block or by any
code block that directly or indirectly invoked the code block where
the error occurred.

The Python interpreter raises an exception when it detects a run-time
error (such as division by zero).  A Python program can also
explicitly raise an exception with the "raise" statement. Exception
handlers are specified with the "try" … "except" statement.  The
"finally" clause of such a statement can be used to specify cleanup
code which does not handle the exception, but is executed whether an
exception occurred or not in the preceding code.

Python uses the “termination” model of error handling: an exception
handler can find out what happened and continue execution at an outer
level, but it cannot repair the cause of the error and retry the
failing operation (except by re-entering the offending piece of code
from the top).

When an exception is not handled at all, the interpreter terminates
execution of the program, or returns to its interactive main loop.  In
either case, it prints a stack traceback, except when the exception is
"SystemExit".

Exceptions are identified by class instances.  The "except" clause is
selected depending on the class of the instance: it must reference the
class of the instance or a base class thereof.  The instance can be
received by the handler and can carry additional information about the
exceptional condition.

Note:

  Exception messages are not part of the Python API.  Their contents
  may change from one version of Python to the next without warning
  and should not be relied on by code which will run under multiple
  versions of the interpreter.

See also the description of the "try" statement in section The try
statement and "raise" statement in section The raise statement.

-[ Footnotes ]-

[1] This limitation occurs because the code that is executed by these
    operations is not available at the time the module is compiled.
u$Execution model
***************


Structure of a program
======================

A Python program is constructed from code blocks. A *block* is a piece
of Python program text that is executed as a unit. The following are
blocks: a module, a function body, and a class definition. Each
command typed interactively is a block.  A script file (a file given
as standard input to the interpreter or specified as a command line
argument to the interpreter) is a code block.  A script command (a
command specified on the interpreter command line with the "-c"
option) is a code block.  The string argument passed to the built-in
functions "eval()" and "exec()" is a code block.

A code block is executed in an *execution frame*.  A frame contains
some administrative information (used for debugging) and determines
where and how execution continues after the code block’s execution has
completed.


Naming and binding
==================


Binding of names
----------------

*Names* refer to objects.  Names are introduced by name binding
operations.

The following constructs bind names: formal parameters to functions,
"import" statements, class and function definitions (these bind the
class or function name in the defining block), and targets that are
identifiers if occurring in an assignment, "for" loop header, or after
"as" in a "with" statement or "except" clause. The "import" statement
of the form "from ... import *" binds all names defined in the
imported module, except those beginning with an underscore.  This form
may only be used at the module level.

A target occurring in a "del" statement is also considered bound for
this purpose (though the actual semantics are to unbind the name).

Each assignment or import statement occurs within a block defined by a
class or function definition or at the module level (the top-level
code block).

If a name is bound in a block, it is a local variable of that block,
unless declared as "nonlocal" or "global".  If a name is bound at the
module level, it is a global variable.  (The variables of the module
code block are local and global.)  If a variable is used in a code
block but not defined there, it is a *free variable*.

Each occurrence of a name in the program text refers to the *binding*
of that name established by the following name resolution rules.


Resolution of names
-------------------

A *scope* defines the visibility of a name within a block.  If a local
variable is defined in a block, its scope includes that block.  If the
definition occurs in a function block, the scope extends to any blocks
contained within the defining one, unless a contained block introduces
a different binding for the name.

When a name is used in a code block, it is resolved using the nearest
enclosing scope.  The set of all such scopes visible to a code block
is called the block’s *environment*.

When a name is not found at all, a "NameError" exception is raised. If
the current scope is a function scope, and the name refers to a local
variable that has not yet been bound to a value at the point where the
name is used, an "UnboundLocalError" exception is raised.
"UnboundLocalError" is a subclass of "NameError".

If a name binding operation occurs anywhere within a code block, all
uses of the name within the block are treated as references to the
current block.  This can lead to errors when a name is used within a
block before it is bound.  This rule is subtle.  Python lacks
declarations and allows name binding operations to occur anywhere
within a code block.  The local variables of a code block can be
determined by scanning the entire text of the block for name binding
operations.

If the "global" statement occurs within a block, all uses of the name
specified in the statement refer to the binding of that name in the
top-level namespace.  Names are resolved in the top-level namespace by
searching the global namespace, i.e. the namespace of the module
containing the code block, and the builtins namespace, the namespace
of the module "builtins".  The global namespace is searched first.  If
the name is not found there, the builtins namespace is searched.  The
"global" statement must precede all uses of the name.

The "global" statement has the same scope as a name binding operation
in the same block.  If the nearest enclosing scope for a free variable
contains a global statement, the free variable is treated as a global.

The "nonlocal" statement causes corresponding names to refer to
previously bound variables in the nearest enclosing function scope.
"SyntaxError" is raised at compile time if the given name does not
exist in any enclosing function scope.

The namespace for a module is automatically created the first time a
module is imported.  The main module for a script is always called
"__main__".

Class definition blocks and arguments to "exec()" and "eval()" are
special in the context of name resolution. A class definition is an
executable statement that may use and define names. These references
follow the normal rules for name resolution with an exception that
unbound local variables are looked up in the global namespace. The
namespace of the class definition becomes the attribute dictionary of
the class. The scope of names defined in a class block is limited to
the class block; it does not extend to the code blocks of methods –
this includes comprehensions and generator expressions since they are
implemented using a function scope.  This means that the following
will fail:

   class A:
       a = 42
       b = list(a + i for i in range(10))


Builtins and restricted execution
---------------------------------

**CPython implementation detail:** Users should not touch
"__builtins__"; it is strictly an implementation detail.  Users
wanting to override values in the builtins namespace should "import"
the "builtins" module and modify its attributes appropriately.

The builtins namespace associated with the execution of a code block
is actually found by looking up the name "__builtins__" in its global
namespace; this should be a dictionary or a module (in the latter case
the module’s dictionary is used).  By default, when in the "__main__"
module, "__builtins__" is the built-in module "builtins"; when in any
other module, "__builtins__" is an alias for the dictionary of the
"builtins" module itself.


Interaction with dynamic features
---------------------------------

Name resolution of free variables occurs at runtime, not at compile
time. This means that the following code will print 42:

   i = 10
   def f():
       print(i)
   i = 42
   f()

The "eval()" and "exec()" functions do not have access to the full
environment for resolving names.  Names may be resolved in the local
and global namespaces of the caller.  Free variables are not resolved
in the nearest enclosing namespace, but in the global namespace.  [1]
The "exec()" and "eval()" functions have optional arguments to
override the global and local namespace.  If only one namespace is
specified, it is used for both.


Exceptions
==========

Exceptions are a means of breaking out of the normal flow of control
of a code block in order to handle errors or other exceptional
conditions.  An exception is *raised* at the point where the error is
detected; it may be *handled* by the surrounding code block or by any
code block that directly or indirectly invoked the code block where
the error occurred.

The Python interpreter raises an exception when it detects a run-time
error (such as division by zero).  A Python program can also
explicitly raise an exception with the "raise" statement. Exception
handlers are specified with the "try" … "except" statement.  The
"finally" clause of such a statement can be used to specify cleanup
code which does not handle the exception, but is executed whether an
exception occurred or not in the preceding code.

Python uses the “termination” model of error handling: an exception
handler can find out what happened and continue execution at an outer
level, but it cannot repair the cause of the error and retry the
failing operation (except by re-entering the offending piece of code
from the top).

When an exception is not handled at all, the interpreter terminates
execution of the program, or returns to its interactive main loop.  In
either case, it prints a stack traceback, except when the exception is
"SystemExit".

Exceptions are identified by class instances.  The "except" clause is
selected depending on the class of the instance: it must reference the
class of the instance or a base class thereof.  The instance can be
received by the handler and can carry additional information about the
exceptional condition.

Note:

  Exception messages are not part of the Python API.  Their contents
  may change from one version of Python to the next without warning
  and should not be relied on by code which will run under multiple
  versions of the interpreter.

See also the description of the "try" statement in section The try
statement and "raise" statement in section The raise statement.

-[ Footnotes ]-

[1] This limitation occurs because the code that is executed by these
    operations is not available at the time the module is compiled.
uzExpression lists
****************

   expression_list    ::= expression ("," expression)* [","]
   starred_list       ::= starred_item ("," starred_item)* [","]
   starred_expression ::= expression | (starred_item ",")* [starred_item]
   starred_item       ::= assignment_expression | "*" or_expr

Except when part of a list or set display, an expression list
containing at least one comma yields a tuple.  The length of the tuple
is the number of expressions in the list.  The expressions are
evaluated from left to right.

An asterisk "*" denotes *iterable unpacking*.  Its operand must be an
*iterable*.  The iterable is expanded into a sequence of items, which
are included in the new tuple, list, or set, at the site of the
unpacking.

New in version 3.5: Iterable unpacking in expression lists, originally
proposed by **PEP 448**.

The trailing comma is required only to create a single tuple (a.k.a. a
*singleton*); it is optional in all other cases.  A single expression
without a trailing comma doesn’t create a tuple, but rather yields the
value of that expression. (To create an empty tuple, use an empty pair
of parentheses: "()".)
a�Floating point literals
***********************

Floating point literals are described by the following lexical
definitions:

   floatnumber   ::= pointfloat | exponentfloat
   pointfloat    ::= [digitpart] fraction | digitpart "."
   exponentfloat ::= (digitpart | pointfloat) exponent
   digitpart     ::= digit (["_"] digit)*
   fraction      ::= "." digitpart
   exponent      ::= ("e" | "E") ["+" | "-"] digitpart

Note that the integer and exponent parts are always interpreted using
radix 10. For example, "077e010" is legal, and denotes the same number
as "77e10". The allowed range of floating point literals is
implementation-dependent.  As in integer literals, underscores are
supported for digit grouping.

Some examples of floating point literals:

   3.14    10.    .001    1e100    3.14e-10    0e0    3.14_15_93

Changed in version 3.6: Underscores are now allowed for grouping
purposes in literals.
u�
The "for" statement
*******************

The "for" statement is used to iterate over the elements of a sequence
(such as a string, tuple or list) or other iterable object:

   for_stmt ::= "for" target_list "in" expression_list ":" suite
                ["else" ":" suite]

The expression list is evaluated once; it should yield an iterable
object.  An iterator is created for the result of the
"expression_list".  The suite is then executed once for each item
provided by the iterator, in the order returned by the iterator.  Each
item in turn is assigned to the target list using the standard rules
for assignments (see Assignment statements), and then the suite is
executed.  When the items are exhausted (which is immediately when the
sequence is empty or an iterator raises a "StopIteration" exception),
the suite in the "else" clause, if present, is executed, and the loop
terminates.

A "break" statement executed in the first suite terminates the loop
without executing the "else" clause’s suite.  A "continue" statement
executed in the first suite skips the rest of the suite and continues
with the next item, or with the "else" clause if there is no next
item.

The for-loop makes assignments to the variables in the target list.
This overwrites all previous assignments to those variables including
those made in the suite of the for-loop:

   for i in range(10):
       print(i)
       i = 5             # this will not affect the for-loop
                         # because i will be overwritten with the next
                         # index in the range

Names in the target list are not deleted when the loop is finished,
but if the sequence is empty, they will not have been assigned to at
all by the loop.  Hint: the built-in function "range()" returns an
iterator of integers suitable to emulate the effect of Pascal’s "for i
:= a to b do"; e.g., "list(range(3))" returns the list "[0, 1, 2]".

Note:

  There is a subtlety when the sequence is being modified by the loop
  (this can only occur for mutable sequences, e.g. lists).  An
  internal counter is used to keep track of which item is used next,
  and this is incremented on each iteration.  When this counter has
  reached the length of the sequence the loop terminates.  This means
  that if the suite deletes the current (or a previous) item from the
  sequence, the next item will be skipped (since it gets the index of
  the current item which has already been treated).  Likewise, if the
  suite inserts an item in the sequence before the current item, the
  current item will be treated again the next time through the loop.
  This can lead to nasty bugs that can be avoided by making a
  temporary copy using a slice of the whole sequence, e.g.,

     for x in a[:]:
         if x < 0: a.remove(x)
u�`Format String Syntax
********************

The "str.format()" method and the "Formatter" class share the same
syntax for format strings (although in the case of "Formatter",
subclasses can define their own format string syntax).  The syntax is
related to that of formatted string literals, but it is less
sophisticated and, in particular, does not support arbitrary
expressions.

Format strings contain “replacement fields” surrounded by curly braces
"{}". Anything that is not contained in braces is considered literal
text, which is copied unchanged to the output.  If you need to include
a brace character in the literal text, it can be escaped by doubling:
"{{" and "}}".

The grammar for a replacement field is as follows:

      replacement_field ::= "{" [field_name] ["!" conversion] [":" format_spec] "}"
      field_name        ::= arg_name ("." attribute_name | "[" element_index "]")*
      arg_name          ::= [identifier | digit+]
      attribute_name    ::= identifier
      element_index     ::= digit+ | index_string
      index_string      ::= <any source character except "]"> +
      conversion        ::= "r" | "s" | "a"
      format_spec       ::= <described in the next section>

In less formal terms, the replacement field can start with a
*field_name* that specifies the object whose value is to be formatted
and inserted into the output instead of the replacement field. The
*field_name* is optionally followed by a  *conversion* field, which is
preceded by an exclamation point "'!'", and a *format_spec*, which is
preceded by a colon "':'".  These specify a non-default format for the
replacement value.

See also the Format Specification Mini-Language section.

The *field_name* itself begins with an *arg_name* that is either a
number or a keyword.  If it’s a number, it refers to a positional
argument, and if it’s a keyword, it refers to a named keyword
argument.  If the numerical arg_names in a format string are 0, 1, 2,
… in sequence, they can all be omitted (not just some) and the numbers
0, 1, 2, … will be automatically inserted in that order. Because
*arg_name* is not quote-delimited, it is not possible to specify
arbitrary dictionary keys (e.g., the strings "'10'" or "':-]'") within
a format string. The *arg_name* can be followed by any number of index
or attribute expressions. An expression of the form "'.name'" selects
the named attribute using "getattr()", while an expression of the form
"'[index]'" does an index lookup using "__getitem__()".

Changed in version 3.1: The positional argument specifiers can be
omitted for "str.format()", so "'{} {}'.format(a, b)" is equivalent to
"'{0} {1}'.format(a, b)".

Changed in version 3.4: The positional argument specifiers can be
omitted for "Formatter".

Some simple format string examples:

   "First, thou shalt count to {0}"  # References first positional argument
   "Bring me a {}"                   # Implicitly references the first positional argument
   "From {} to {}"                   # Same as "From {0} to {1}"
   "My quest is {name}"              # References keyword argument 'name'
   "Weight in tons {0.weight}"       # 'weight' attribute of first positional arg
   "Units destroyed: {players[0]}"   # First element of keyword argument 'players'.

The *conversion* field causes a type coercion before formatting.
Normally, the job of formatting a value is done by the "__format__()"
method of the value itself.  However, in some cases it is desirable to
force a type to be formatted as a string, overriding its own
definition of formatting.  By converting the value to a string before
calling "__format__()", the normal formatting logic is bypassed.

Three conversion flags are currently supported: "'!s'" which calls
"str()" on the value, "'!r'" which calls "repr()" and "'!a'" which
calls "ascii()".

Some examples:

   "Harold's a clever {0!s}"        # Calls str() on the argument first
   "Bring out the holy {name!r}"    # Calls repr() on the argument first
   "More {!a}"                      # Calls ascii() on the argument first

The *format_spec* field contains a specification of how the value
should be presented, including such details as field width, alignment,
padding, decimal precision and so on.  Each value type can define its
own “formatting mini-language” or interpretation of the *format_spec*.

Most built-in types support a common formatting mini-language, which
is described in the next section.

A *format_spec* field can also include nested replacement fields
within it. These nested replacement fields may contain a field name,
conversion flag and format specification, but deeper nesting is not
allowed.  The replacement fields within the format_spec are
substituted before the *format_spec* string is interpreted. This
allows the formatting of a value to be dynamically specified.

See the Format examples section for some examples.


Format Specification Mini-Language
==================================

“Format specifications” are used within replacement fields contained
within a format string to define how individual values are presented
(see Format String Syntax and Formatted string literals). They can
also be passed directly to the built-in "format()" function.  Each
formattable type may define how the format specification is to be
interpreted.

Most built-in types implement the following options for format
specifications, although some of the formatting options are only
supported by the numeric types.

A general convention is that an empty format specification produces
the same result as if you had called "str()" on the value. A non-empty
format specification typically modifies the result.

The general form of a *standard format specifier* is:

   format_spec     ::= [[fill]align][sign][#][0][width][grouping_option][.precision][type]
   fill            ::= <any character>
   align           ::= "<" | ">" | "=" | "^"
   sign            ::= "+" | "-" | " "
   width           ::= digit+
   grouping_option ::= "_" | ","
   precision       ::= digit+
   type            ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "s" | "x" | "X" | "%"

If a valid *align* value is specified, it can be preceded by a *fill*
character that can be any character and defaults to a space if
omitted. It is not possible to use a literal curly brace (”"{"” or
“"}"”) as the *fill* character in a formatted string literal or when
using the "str.format()" method.  However, it is possible to insert a
curly brace with a nested replacement field.  This limitation doesn’t
affect the "format()" function.

The meaning of the various alignment options is as follows:

   +-----------+------------------------------------------------------------+
   | Option    | Meaning                                                    |
   |===========|============================================================|
   | "'<'"     | Forces the field to be left-aligned within the available   |
   |           | space (this is the default for most objects).              |
   +-----------+------------------------------------------------------------+
   | "'>'"     | Forces the field to be right-aligned within the available  |
   |           | space (this is the default for numbers).                   |
   +-----------+------------------------------------------------------------+
   | "'='"     | Forces the padding to be placed after the sign (if any)    |
   |           | but before the digits.  This is used for printing fields   |
   |           | in the form ‘+000000120’. This alignment option is only    |
   |           | valid for numeric types.  It becomes the default when ‘0’  |
   |           | immediately precedes the field width.                      |
   +-----------+------------------------------------------------------------+
   | "'^'"     | Forces the field to be centered within the available       |
   |           | space.                                                     |
   +-----------+------------------------------------------------------------+

Note that unless a minimum field width is defined, the field width
will always be the same size as the data to fill it, so that the
alignment option has no meaning in this case.

The *sign* option is only valid for number types, and can be one of
the following:

   +-----------+------------------------------------------------------------+
   | Option    | Meaning                                                    |
   |===========|============================================================|
   | "'+'"     | indicates that a sign should be used for both positive as  |
   |           | well as negative numbers.                                  |
   +-----------+------------------------------------------------------------+
   | "'-'"     | indicates that a sign should be used only for negative     |
   |           | numbers (this is the default behavior).                    |
   +-----------+------------------------------------------------------------+
   | space     | indicates that a leading space should be used on positive  |
   |           | numbers, and a minus sign on negative numbers.             |
   +-----------+------------------------------------------------------------+

The "'#'" option causes the “alternate form” to be used for the
conversion.  The alternate form is defined differently for different
types.  This option is only valid for integer, float and complex
types. For integers, when binary, octal, or hexadecimal output is
used, this option adds the prefix respective "'0b'", "'0o'", or "'0x'"
to the output value. For float and complex the alternate form causes
the result of the conversion to always contain a decimal-point
character, even if no digits follow it. Normally, a decimal-point
character appears in the result of these conversions only if a digit
follows it. In addition, for "'g'" and "'G'" conversions, trailing
zeros are not removed from the result.

The "','" option signals the use of a comma for a thousands separator.
For a locale aware separator, use the "'n'" integer presentation type
instead.

Changed in version 3.1: Added the "','" option (see also **PEP 378**).

The "'_'" option signals the use of an underscore for a thousands
separator for floating point presentation types and for integer
presentation type "'d'".  For integer presentation types "'b'", "'o'",
"'x'", and "'X'", underscores will be inserted every 4 digits.  For
other presentation types, specifying this option is an error.

Changed in version 3.6: Added the "'_'" option (see also **PEP 515**).

*width* is a decimal integer defining the minimum total field width,
including any prefixes, separators, and other formatting characters.
If not specified, then the field width will be determined by the
content.

When no explicit alignment is given, preceding the *width* field by a
zero ("'0'") character enables sign-aware zero-padding for numeric
types.  This is equivalent to a *fill* character of "'0'" with an
*alignment* type of "'='".

The *precision* is a decimal number indicating how many digits should
be displayed after the decimal point for a floating point value
formatted with "'f'" and "'F'", or before and after the decimal point
for a floating point value formatted with "'g'" or "'G'".  For non-
number types the field indicates the maximum field size - in other
words, how many characters will be used from the field content. The
*precision* is not allowed for integer values.

Finally, the *type* determines how the data should be presented.

The available string presentation types are:

   +-----------+------------------------------------------------------------+
   | Type      | Meaning                                                    |
   |===========|============================================================|
   | "'s'"     | String format. This is the default type for strings and    |
   |           | may be omitted.                                            |
   +-----------+------------------------------------------------------------+
   | None      | The same as "'s'".                                         |
   +-----------+------------------------------------------------------------+

The available integer presentation types are:

   +-----------+------------------------------------------------------------+
   | Type      | Meaning                                                    |
   |===========|============================================================|
   | "'b'"     | Binary format. Outputs the number in base 2.               |
   +-----------+------------------------------------------------------------+
   | "'c'"     | Character. Converts the integer to the corresponding       |
   |           | unicode character before printing.                         |
   +-----------+------------------------------------------------------------+
   | "'d'"     | Decimal Integer. Outputs the number in base 10.            |
   +-----------+------------------------------------------------------------+
   | "'o'"     | Octal format. Outputs the number in base 8.                |
   +-----------+------------------------------------------------------------+
   | "'x'"     | Hex format. Outputs the number in base 16, using lower-    |
   |           | case letters for the digits above 9.                       |
   +-----------+------------------------------------------------------------+
   | "'X'"     | Hex format. Outputs the number in base 16, using upper-    |
   |           | case letters for the digits above 9.                       |
   +-----------+------------------------------------------------------------+
   | "'n'"     | Number. This is the same as "'d'", except that it uses the |
   |           | current locale setting to insert the appropriate number    |
   |           | separator characters.                                      |
   +-----------+------------------------------------------------------------+
   | None      | The same as "'d'".                                         |
   +-----------+------------------------------------------------------------+

In addition to the above presentation types, integers can be formatted
with the floating point presentation types listed below (except "'n'"
and "None"). When doing so, "float()" is used to convert the integer
to a floating point number before formatting.

The available presentation types for "float" and "Decimal" values are:

   +-----------+------------------------------------------------------------+
   | Type      | Meaning                                                    |
   |===========|============================================================|
   | "'e'"     | Scientific notation. For a given precision "p", formats    |
   |           | the number in scientific notation with the letter ‘e’      |
   |           | separating the coefficient from the exponent. The          |
   |           | coefficient has one digit before and "p" digits after the  |
   |           | decimal point, for a total of "p + 1" significant digits.  |
   |           | With no precision given, uses a precision of "6" digits    |
   |           | after the decimal point for "float", and shows all         |
   |           | coefficient digits for "Decimal". If no digits follow the  |
   |           | decimal point, the decimal point is also removed unless    |
   |           | the "#" option is used.                                    |
   +-----------+------------------------------------------------------------+
   | "'E'"     | Scientific notation. Same as "'e'" except it uses an upper |
   |           | case ‘E’ as the separator character.                       |
   +-----------+------------------------------------------------------------+
   | "'f'"     | Fixed-point notation. For a given precision "p", formats   |
   |           | the number as a decimal number with exactly "p" digits     |
   |           | following the decimal point. With no precision given, uses |
   |           | a precision of "6" digits after the decimal point for      |
   |           | "float", and uses a precision large enough to show all     |
   |           | coefficient digits for "Decimal". If no digits follow the  |
   |           | decimal point, the decimal point is also removed unless    |
   |           | the "#" option is used.                                    |
   +-----------+------------------------------------------------------------+
   | "'F'"     | Fixed-point notation. Same as "'f'", but converts "nan" to |
   |           | "NAN" and "inf" to "INF".                                  |
   +-----------+------------------------------------------------------------+
   | "'g'"     | General format.  For a given precision "p >= 1", this      |
   |           | rounds the number to "p" significant digits and then       |
   |           | formats the result in either fixed-point format or in      |
   |           | scientific notation, depending on its magnitude. A         |
   |           | precision of "0" is treated as equivalent to a precision   |
   |           | of "1".  The precise rules are as follows: suppose that    |
   |           | the result formatted with presentation type "'e'" and      |
   |           | precision "p-1" would have exponent "exp".  Then, if "m <= |
   |           | exp < p", where "m" is -4 for floats and -6 for            |
   |           | "Decimals", the number is formatted with presentation type |
   |           | "'f'" and precision "p-1-exp".  Otherwise, the number is   |
   |           | formatted with presentation type "'e'" and precision       |
   |           | "p-1". In both cases insignificant trailing zeros are      |
   |           | removed from the significand, and the decimal point is     |
   |           | also removed if there are no remaining digits following    |
   |           | it, unless the "'#'" option is used.  With no precision    |
   |           | given, uses a precision of "6" significant digits for      |
   |           | "float". For "Decimal", the coefficient of the result is   |
   |           | formed from the coefficient digits of the value;           |
   |           | scientific notation is used for values smaller than "1e-6" |
   |           | in absolute value and values where the place value of the  |
   |           | least significant digit is larger than 1, and fixed-point  |
   |           | notation is used otherwise.  Positive and negative         |
   |           | infinity, positive and negative zero, and nans, are        |
   |           | formatted as "inf", "-inf", "0", "-0" and "nan"            |
   |           | respectively, regardless of the precision.                 |
   +-----------+------------------------------------------------------------+
   | "'G'"     | General format. Same as "'g'" except switches to "'E'" if  |
   |           | the number gets too large. The representations of infinity |
   |           | and NaN are uppercased, too.                               |
   +-----------+------------------------------------------------------------+
   | "'n'"     | Number. This is the same as "'g'", except that it uses the |
   |           | current locale setting to insert the appropriate number    |
   |           | separator characters.                                      |
   +-----------+------------------------------------------------------------+
   | "'%'"     | Percentage. Multiplies the number by 100 and displays in   |
   |           | fixed ("'f'") format, followed by a percent sign.          |
   +-----------+------------------------------------------------------------+
   | None      | For "float" this is the same as "'g'", except that when    |
   |           | fixed-point notation is used to format the result, it      |
   |           | always includes at least one digit past the decimal point. |
   |           | The precision used is as large as needed to represent the  |
   |           | given value faithfully.  For "Decimal", this is the same   |
   |           | as either "'g'" or "'G'" depending on the value of         |
   |           | "context.capitals" for the current decimal context.  The   |
   |           | overall effect is to match the output of "str()" as        |
   |           | altered by the other format modifiers.                     |
   +-----------+------------------------------------------------------------+


Format examples
===============

This section contains examples of the "str.format()" syntax and
comparison with the old "%"-formatting.

In most of the cases the syntax is similar to the old "%"-formatting,
with the addition of the "{}" and with ":" used instead of "%". For
example, "'%03.2f'" can be translated to "'{:03.2f}'".

The new format syntax also supports new and different options, shown
in the following examples.

Accessing arguments by position:

   >>> '{0}, {1}, {2}'.format('a', 'b', 'c')
   'a, b, c'
   >>> '{}, {}, {}'.format('a', 'b', 'c')  # 3.1+ only
   'a, b, c'
   >>> '{2}, {1}, {0}'.format('a', 'b', 'c')
   'c, b, a'
   >>> '{2}, {1}, {0}'.format(*'abc')      # unpacking argument sequence
   'c, b, a'
   >>> '{0}{1}{0}'.format('abra', 'cad')   # arguments' indices can be repeated
   'abracadabra'

Accessing arguments by name:

   >>> 'Coordinates: {latitude}, {longitude}'.format(latitude='37.24N', longitude='-115.81W')
   'Coordinates: 37.24N, -115.81W'
   >>> coord = {'latitude': '37.24N', 'longitude': '-115.81W'}
   >>> 'Coordinates: {latitude}, {longitude}'.format(**coord)
   'Coordinates: 37.24N, -115.81W'

Accessing arguments’ attributes:

   >>> c = 3-5j
   >>> ('The complex number {0} is formed from the real part {0.real} '
   ...  'and the imaginary part {0.imag}.').format(c)
   'The complex number (3-5j) is formed from the real part 3.0 and the imaginary part -5.0.'
   >>> class Point:
   ...     def __init__(self, x, y):
   ...         self.x, self.y = x, y
   ...     def __str__(self):
   ...         return 'Point({self.x}, {self.y})'.format(self=self)
   ...
   >>> str(Point(4, 2))
   'Point(4, 2)'

Accessing arguments’ items:

   >>> coord = (3, 5)
   >>> 'X: {0[0]};  Y: {0[1]}'.format(coord)
   'X: 3;  Y: 5'

Replacing "%s" and "%r":

   >>> "repr() shows quotes: {!r}; str() doesn't: {!s}".format('test1', 'test2')
   "repr() shows quotes: 'test1'; str() doesn't: test2"

Aligning the text and specifying a width:

   >>> '{:<30}'.format('left aligned')
   'left aligned                  '
   >>> '{:>30}'.format('right aligned')
   '                 right aligned'
   >>> '{:^30}'.format('centered')
   '           centered           '
   >>> '{:*^30}'.format('centered')  # use '*' as a fill char
   '***********centered***********'

Replacing "%+f", "%-f", and "% f" and specifying a sign:

   >>> '{:+f}; {:+f}'.format(3.14, -3.14)  # show it always
   '+3.140000; -3.140000'
   >>> '{: f}; {: f}'.format(3.14, -3.14)  # show a space for positive numbers
   ' 3.140000; -3.140000'
   >>> '{:-f}; {:-f}'.format(3.14, -3.14)  # show only the minus -- same as '{:f}; {:f}'
   '3.140000; -3.140000'

Replacing "%x" and "%o" and converting the value to different bases:

   >>> # format also supports binary numbers
   >>> "int: {0:d};  hex: {0:x};  oct: {0:o};  bin: {0:b}".format(42)
   'int: 42;  hex: 2a;  oct: 52;  bin: 101010'
   >>> # with 0x, 0o, or 0b as prefix:
   >>> "int: {0:d};  hex: {0:#x};  oct: {0:#o};  bin: {0:#b}".format(42)
   'int: 42;  hex: 0x2a;  oct: 0o52;  bin: 0b101010'

Using the comma as a thousands separator:

   >>> '{:,}'.format(1234567890)
   '1,234,567,890'

Expressing a percentage:

   >>> points = 19
   >>> total = 22
   >>> 'Correct answers: {:.2%}'.format(points/total)
   'Correct answers: 86.36%'

Using type-specific formatting:

   >>> import datetime
   >>> d = datetime.datetime(2010, 7, 4, 12, 15, 58)
   >>> '{:%Y-%m-%d %H:%M:%S}'.format(d)
   '2010-07-04 12:15:58'

Nesting arguments and more complex examples:

   >>> for align, text in zip('<^>', ['left', 'center', 'right']):
   ...     '{0:{fill}{align}16}'.format(text, fill=align, align=align)
   ...
   'left<<<<<<<<<<<<'
   '^^^^^center^^^^^'
   '>>>>>>>>>>>right'
   >>>
   >>> octets = [192, 168, 0, 1]
   >>> '{:02X}{:02X}{:02X}{:02X}'.format(*octets)
   'C0A80001'
   >>> int(_, 16)
   3232235521
   >>>
   >>> width = 5
   >>> for num in range(5,12): 
   ...     for base in 'dXob':
   ...         print('{0:{width}{base}}'.format(num, base=base, width=width), end=' ')
   ...     print()
   ...
       5     5     5   101
       6     6     6   110
       7     7     7   111
       8     8    10  1000
       9     9    11  1001
      10     A    12  1010
      11     B    13  1011
u|Function definitions
********************

A function definition defines a user-defined function object (see
section The standard type hierarchy):

   funcdef                   ::= [decorators] "def" funcname "(" [parameter_list] ")"
               ["->" expression] ":" suite
   decorators                ::= decorator+
   decorator                 ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE
   dotted_name               ::= identifier ("." identifier)*
   parameter_list            ::= defparameter ("," defparameter)* "," "/" ["," [parameter_list_no_posonly]]
                        | parameter_list_no_posonly
   parameter_list_no_posonly ::= defparameter ("," defparameter)* ["," [parameter_list_starargs]]
                                 | parameter_list_starargs
   parameter_list_starargs   ::= "*" [parameter] ("," defparameter)* ["," ["**" parameter [","]]]
                               | "**" parameter [","]
   parameter                 ::= identifier [":" expression]
   defparameter              ::= parameter ["=" expression]
   funcname                  ::= identifier

A function definition is an executable statement.  Its execution binds
the function name in the current local namespace to a function object
(a wrapper around the executable code for the function).  This
function object contains a reference to the current global namespace
as the global namespace to be used when the function is called.

The function definition does not execute the function body; this gets
executed only when the function is called. [2]

A function definition may be wrapped by one or more *decorator*
expressions. Decorator expressions are evaluated when the function is
defined, in the scope that contains the function definition.  The
result must be a callable, which is invoked with the function object
as the only argument. The returned value is bound to the function name
instead of the function object.  Multiple decorators are applied in
nested fashion. For example, the following code

   @f1(arg)
   @f2
   def func(): pass

is roughly equivalent to

   def func(): pass
   func = f1(arg)(f2(func))

except that the original function is not temporarily bound to the name
"func".

When one or more *parameters* have the form *parameter* "="
*expression*, the function is said to have “default parameter values.”
For a parameter with a default value, the corresponding *argument* may
be omitted from a call, in which case the parameter’s default value is
substituted.  If a parameter has a default value, all following
parameters up until the “"*"” must also have a default value — this is
a syntactic restriction that is not expressed by the grammar.

**Default parameter values are evaluated from left to right when the
function definition is executed.** This means that the expression is
evaluated once, when the function is defined, and that the same “pre-
computed” value is used for each call.  This is especially important
to understand when a default parameter is a mutable object, such as a
list or a dictionary: if the function modifies the object (e.g. by
appending an item to a list), the default value is in effect modified.
This is generally not what was intended.  A way around this is to use
"None" as the default, and explicitly test for it in the body of the
function, e.g.:

   def whats_on_the_telly(penguin=None):
       if penguin is None:
           penguin = []
       penguin.append("property of the zoo")
       return penguin

Function call semantics are described in more detail in section Calls.
A function call always assigns values to all parameters mentioned in
the parameter list, either from positional arguments, from keyword
arguments, or from default values.  If the form “"*identifier"” is
present, it is initialized to a tuple receiving any excess positional
parameters, defaulting to the empty tuple. If the form
“"**identifier"” is present, it is initialized to a new ordered
mapping receiving any excess keyword arguments, defaulting to a new
empty mapping of the same type.  Parameters after “"*"” or
“"*identifier"” are keyword-only parameters and may only be passed by
keyword arguments.  Parameters before “"/"” are positional-only
parameters and may only be passed by positional arguments.

Changed in version 3.8: The "/" function parameter syntax may be used
to indicate positional-only parameters. See **PEP 570** for details.

Parameters may have an *annotation* of the form “": expression"”
following the parameter name.  Any parameter may have an annotation,
even those of the form "*identifier" or "**identifier".  Functions may
have “return” annotation of the form “"-> expression"” after the
parameter list.  These annotations can be any valid Python expression.
The presence of annotations does not change the semantics of a
function.  The annotation values are available as values of a
dictionary keyed by the parameters’ names in the "__annotations__"
attribute of the function object.  If the "annotations" import from
"__future__" is used, annotations are preserved as strings at runtime
which enables postponed evaluation.  Otherwise, they are evaluated
when the function definition is executed.  In this case annotations
may be evaluated in a different order than they appear in the source
code.

It is also possible to create anonymous functions (functions not bound
to a name), for immediate use in expressions.  This uses lambda
expressions, described in section Lambdas.  Note that the lambda
expression is merely a shorthand for a simplified function definition;
a function defined in a “"def"” statement can be passed around or
assigned to another name just like a function defined by a lambda
expression.  The “"def"” form is actually more powerful since it
allows the execution of multiple statements and annotations.

**Programmer’s note:** Functions are first-class objects.  A “"def"”
statement executed inside a function definition defines a local
function that can be returned or passed around.  Free variables used
in the nested function can access the local variables of the function
containing the def.  See section Naming and binding for details.

See also:

  **PEP 3107** - Function Annotations
     The original specification for function annotations.

  **PEP 484** - Type Hints
     Definition of a standard meaning for annotations: type hints.

  **PEP 526** - Syntax for Variable Annotations
     Ability to type hint variable declarations, including class
     variables and instance variables

  **PEP 563** - Postponed Evaluation of Annotations
     Support for forward references within annotations by preserving
     annotations in a string form at runtime instead of eager
     evaluation.
u�The "global" statement
**********************

   global_stmt ::= "global" identifier ("," identifier)*

The "global" statement is a declaration which holds for the entire
current code block.  It means that the listed identifiers are to be
interpreted as globals.  It would be impossible to assign to a global
variable without "global", although free variables may refer to
globals without being declared global.

Names listed in a "global" statement must not be used in the same code
block textually preceding that "global" statement.

Names listed in a "global" statement must not be defined as formal
parameters or in a "for" loop control target, "class" definition,
function definition, "import" statement, or variable annotation.

**CPython implementation detail:** The current implementation does not
enforce some of these restrictions, but programs should not abuse this
freedom, as future implementations may enforce them or silently change
the meaning of the program.

**Programmer’s note:** "global" is a directive to the parser.  It
applies only to code parsed at the same time as the "global"
statement. In particular, a "global" statement contained in a string
or code object supplied to the built-in "exec()" function does not
affect the code block *containing* the function call, and code
contained in such a string is unaffected by "global" statements in the
code containing the function call.  The same applies to the "eval()"
and "compile()" functions.
u�Reserved classes of identifiers
*******************************

Certain classes of identifiers (besides keywords) have special
meanings.  These classes are identified by the patterns of leading and
trailing underscore characters:

"_*"
   Not imported by "from module import *".  The special identifier "_"
   is used in the interactive interpreter to store the result of the
   last evaluation; it is stored in the "builtins" module.  When not
   in interactive mode, "_" has no special meaning and is not defined.
   See section The import statement.

   Note:

     The name "_" is often used in conjunction with
     internationalization; refer to the documentation for the
     "gettext" module for more information on this convention.

"__*__"
   System-defined names, informally known as “dunder” names. These
   names are defined by the interpreter and its implementation
   (including the standard library). Current system names are
   discussed in the Special method names section and elsewhere. More
   will likely be defined in future versions of Python.  *Any* use of
   "__*__" names, in any context, that does not follow explicitly
   documented use, is subject to breakage without warning.

"__*"
   Class-private names.  Names in this category, when used within the
   context of a class definition, are re-written to use a mangled form
   to help avoid name clashes between “private” attributes of base and
   derived classes. See section Identifiers (Names).
umIdentifiers and keywords
************************

Identifiers (also referred to as *names*) are described by the
following lexical definitions.

The syntax of identifiers in Python is based on the Unicode standard
annex UAX-31, with elaboration and changes as defined below; see also
**PEP 3131** for further details.

Within the ASCII range (U+0001..U+007F), the valid characters for
identifiers are the same as in Python 2.x: the uppercase and lowercase
letters "A" through "Z", the underscore "_" and, except for the first
character, the digits "0" through "9".

Python 3.0 introduces additional characters from outside the ASCII
range (see **PEP 3131**).  For these characters, the classification
uses the version of the Unicode Character Database as included in the
"unicodedata" module.

Identifiers are unlimited in length.  Case is significant.

   identifier   ::= xid_start xid_continue*
   id_start     ::= <all characters in general categories Lu, Ll, Lt, Lm, Lo, Nl, the underscore, and characters with the Other_ID_Start property>
   id_continue  ::= <all characters in id_start, plus characters in the categories Mn, Mc, Nd, Pc and others with the Other_ID_Continue property>
   xid_start    ::= <all characters in id_start whose NFKC normalization is in "id_start xid_continue*">
   xid_continue ::= <all characters in id_continue whose NFKC normalization is in "id_continue*">

The Unicode category codes mentioned above stand for:

* *Lu* - uppercase letters

* *Ll* - lowercase letters

* *Lt* - titlecase letters

* *Lm* - modifier letters

* *Lo* - other letters

* *Nl* - letter numbers

* *Mn* - nonspacing marks

* *Mc* - spacing combining marks

* *Nd* - decimal numbers

* *Pc* - connector punctuations

* *Other_ID_Start* - explicit list of characters in PropList.txt to
  support backwards compatibility

* *Other_ID_Continue* - likewise

All identifiers are converted into the normal form NFKC while parsing;
comparison of identifiers is based on NFKC.

A non-normative HTML file listing all valid identifier characters for
Unicode 4.1 can be found at
https://www.unicode.org/Public/13.0.0/ucd/DerivedCoreProperties.txt


Keywords
========

The following identifiers are used as reserved words, or *keywords* of
the language, and cannot be used as ordinary identifiers.  They must
be spelled exactly as written here:

   False      await      else       import     pass
   None       break      except     in         raise
   True       class      finally    is         return
   and        continue   for        lambda     try
   as         def        from       nonlocal   while
   assert     del        global     not        with
   async      elif       if         or         yield


Reserved classes of identifiers
===============================

Certain classes of identifiers (besides keywords) have special
meanings.  These classes are identified by the patterns of leading and
trailing underscore characters:

"_*"
   Not imported by "from module import *".  The special identifier "_"
   is used in the interactive interpreter to store the result of the
   last evaluation; it is stored in the "builtins" module.  When not
   in interactive mode, "_" has no special meaning and is not defined.
   See section The import statement.

   Note:

     The name "_" is often used in conjunction with
     internationalization; refer to the documentation for the
     "gettext" module for more information on this convention.

"__*__"
   System-defined names, informally known as “dunder” names. These
   names are defined by the interpreter and its implementation
   (including the standard library). Current system names are
   discussed in the Special method names section and elsewhere. More
   will likely be defined in future versions of Python.  *Any* use of
   "__*__" names, in any context, that does not follow explicitly
   documented use, is subject to breakage without warning.

"__*"
   Class-private names.  Names in this category, when used within the
   context of a class definition, are re-written to use a mangled form
   to help avoid name clashes between “private” attributes of base and
   derived classes. See section Identifiers (Names).
a5Imaginary literals
******************

Imaginary literals are described by the following lexical definitions:

   imagnumber ::= (floatnumber | digitpart) ("j" | "J")

An imaginary literal yields a complex number with a real part of 0.0.
Complex numbers are represented as a pair of floating point numbers
and have the same restrictions on their range.  To create a complex
number with a nonzero real part, add a floating point number to it,
e.g., "(3+4j)".  Some examples of imaginary literals:

   3.14j   10.j    10j     .001j   1e100j   3.14e-10j   3.14_15_93j
u8"The "import" statement
**********************

   import_stmt     ::= "import" module ["as" identifier] ("," module ["as" identifier])*
                   | "from" relative_module "import" identifier ["as" identifier]
                   ("," identifier ["as" identifier])*
                   | "from" relative_module "import" "(" identifier ["as" identifier]
                   ("," identifier ["as" identifier])* [","] ")"
                   | "from" module "import" "*"
   module          ::= (identifier ".")* identifier
   relative_module ::= "."* module | "."+

The basic import statement (no "from" clause) is executed in two
steps:

1. find a module, loading and initializing it if necessary

2. define a name or names in the local namespace for the scope where
   the "import" statement occurs.

When the statement contains multiple clauses (separated by commas) the
two steps are carried out separately for each clause, just as though
the clauses had been separated out into individual import statements.

The details of the first step, finding and loading modules are
described in greater detail in the section on the import system, which
also describes the various types of packages and modules that can be
imported, as well as all the hooks that can be used to customize the
import system. Note that failures in this step may indicate either
that the module could not be located, *or* that an error occurred
while initializing the module, which includes execution of the
module’s code.

If the requested module is retrieved successfully, it will be made
available in the local namespace in one of three ways:

* If the module name is followed by "as", then the name following "as"
  is bound directly to the imported module.

* If no other name is specified, and the module being imported is a
  top level module, the module’s name is bound in the local namespace
  as a reference to the imported module

* If the module being imported is *not* a top level module, then the
  name of the top level package that contains the module is bound in
  the local namespace as a reference to the top level package. The
  imported module must be accessed using its full qualified name
  rather than directly

The "from" form uses a slightly more complex process:

1. find the module specified in the "from" clause, loading and
   initializing it if necessary;

2. for each of the identifiers specified in the "import" clauses:

   1. check if the imported module has an attribute by that name

   2. if not, attempt to import a submodule with that name and then
      check the imported module again for that attribute

   3. if the attribute is not found, "ImportError" is raised.

   4. otherwise, a reference to that value is stored in the local
      namespace, using the name in the "as" clause if it is present,
      otherwise using the attribute name

Examples:

   import foo                 # foo imported and bound locally
   import foo.bar.baz         # foo.bar.baz imported, foo bound locally
   import foo.bar.baz as fbb  # foo.bar.baz imported and bound as fbb
   from foo.bar import baz    # foo.bar.baz imported and bound as baz
   from foo import attr       # foo imported and foo.attr bound as attr

If the list of identifiers is replaced by a star ("'*'"), all public
names defined in the module are bound in the local namespace for the
scope where the "import" statement occurs.

The *public names* defined by a module are determined by checking the
module’s namespace for a variable named "__all__"; if defined, it must
be a sequence of strings which are names defined or imported by that
module.  The names given in "__all__" are all considered public and
are required to exist.  If "__all__" is not defined, the set of public
names includes all names found in the module’s namespace which do not
begin with an underscore character ("'_'").  "__all__" should contain
the entire public API. It is intended to avoid accidentally exporting
items that are not part of the API (such as library modules which were
imported and used within the module).

The wild card form of import — "from module import *" — is only
allowed at the module level.  Attempting to use it in class or
function definitions will raise a "SyntaxError".

When specifying what module to import you do not have to specify the
absolute name of the module. When a module or package is contained
within another package it is possible to make a relative import within
the same top package without having to mention the package name. By
using leading dots in the specified module or package after "from" you
can specify how high to traverse up the current package hierarchy
without specifying exact names. One leading dot means the current
package where the module making the import exists. Two dots means up
one package level. Three dots is up two levels, etc. So if you execute
"from . import mod" from a module in the "pkg" package then you will
end up importing "pkg.mod". If you execute "from ..subpkg2 import mod"
from within "pkg.subpkg1" you will import "pkg.subpkg2.mod". The
specification for relative imports is contained in the Package
Relative Imports section.

"importlib.import_module()" is provided to support applications that
determine dynamically the modules to be loaded.

Raises an auditing event "import" with arguments "module", "filename",
"sys.path", "sys.meta_path", "sys.path_hooks".


Future statements
=================

A *future statement* is a directive to the compiler that a particular
module should be compiled using syntax or semantics that will be
available in a specified future release of Python where the feature
becomes standard.

The future statement is intended to ease migration to future versions
of Python that introduce incompatible changes to the language.  It
allows use of the new features on a per-module basis before the
release in which the feature becomes standard.

   future_stmt ::= "from" "__future__" "import" feature ["as" identifier]
                   ("," feature ["as" identifier])*
                   | "from" "__future__" "import" "(" feature ["as" identifier]
                   ("," feature ["as" identifier])* [","] ")"
   feature     ::= identifier

A future statement must appear near the top of the module.  The only
lines that can appear before a future statement are:

* the module docstring (if any),

* comments,

* blank lines, and

* other future statements.

The only feature that requires using the future statement is
"annotations" (see **PEP 563**).

All historical features enabled by the future statement are still
recognized by Python 3.  The list includes "absolute_import",
"division", "generators", "generator_stop", "unicode_literals",
"print_function", "nested_scopes" and "with_statement".  They are all
redundant because they are always enabled, and only kept for backwards
compatibility.

A future statement is recognized and treated specially at compile
time: Changes to the semantics of core constructs are often
implemented by generating different code.  It may even be the case
that a new feature introduces new incompatible syntax (such as a new
reserved word), in which case the compiler may need to parse the
module differently.  Such decisions cannot be pushed off until
runtime.

For any given release, the compiler knows which feature names have
been defined, and raises a compile-time error if a future statement
contains a feature not known to it.

The direct runtime semantics are the same as for any import statement:
there is a standard module "__future__", described later, and it will
be imported in the usual way at the time the future statement is
executed.

The interesting runtime semantics depend on the specific feature
enabled by the future statement.

Note that there is nothing special about the statement:

   import __future__ [as name]

That is not a future statement; it’s an ordinary import statement with
no special semantics or syntax restrictions.

Code compiled by calls to the built-in functions "exec()" and
"compile()" that occur in a module "M" containing a future statement
will, by default, use the new syntax or semantics associated with the
future statement.  This can be controlled by optional arguments to
"compile()" — see the documentation of that function for details.

A future statement typed at an interactive interpreter prompt will
take effect for the rest of the interpreter session.  If an
interpreter is started with the "-i" option, is passed a script name
to execute, and the script includes a future statement, it will be in
effect in the interactive session started after the script is
executed.

See also:

  **PEP 236** - Back to the __future__
     The original proposal for the __future__ mechanism.
aMembership test operations
**************************

The operators "in" and "not in" test for membership.  "x in s"
evaluates to "True" if *x* is a member of *s*, and "False" otherwise.
"x not in s" returns the negation of "x in s".  All built-in sequences
and set types support this as well as dictionary, for which "in" tests
whether the dictionary has a given key. For container types such as
list, tuple, set, frozenset, dict, or collections.deque, the
expression "x in y" is equivalent to "any(x is e or x == e for e in
y)".

For the string and bytes types, "x in y" is "True" if and only if *x*
is a substring of *y*.  An equivalent test is "y.find(x) != -1".
Empty strings are always considered to be a substring of any other
string, so """ in "abc"" will return "True".

For user-defined classes which define the "__contains__()" method, "x
in y" returns "True" if "y.__contains__(x)" returns a true value, and
"False" otherwise.

For user-defined classes which do not define "__contains__()" but do
define "__iter__()", "x in y" is "True" if some value "z", for which
the expression "x is z or x == z" is true, is produced while iterating
over "y". If an exception is raised during the iteration, it is as if
"in" raised that exception.

Lastly, the old-style iteration protocol is tried: if a class defines
"__getitem__()", "x in y" is "True" if and only if there is a non-
negative integer index *i* such that "x is y[i] or x == y[i]", and no
lower integer index raises the "IndexError" exception.  (If any other
exception is raised, it is as if "in" raised that exception).

The operator "not in" is defined to have the inverse truth value of
"in".
aVInteger literals
****************

Integer literals are described by the following lexical definitions:

   integer      ::= decinteger | bininteger | octinteger | hexinteger
   decinteger   ::= nonzerodigit (["_"] digit)* | "0"+ (["_"] "0")*
   bininteger   ::= "0" ("b" | "B") (["_"] bindigit)+
   octinteger   ::= "0" ("o" | "O") (["_"] octdigit)+
   hexinteger   ::= "0" ("x" | "X") (["_"] hexdigit)+
   nonzerodigit ::= "1"..."9"
   digit        ::= "0"..."9"
   bindigit     ::= "0" | "1"
   octdigit     ::= "0"..."7"
   hexdigit     ::= digit | "a"..."f" | "A"..."F"

There is no limit for the length of integer literals apart from what
can be stored in available memory.

Underscores are ignored for determining the numeric value of the
literal.  They can be used to group digits for enhanced readability.
One underscore can occur between digits, and after base specifiers
like "0x".

Note that leading zeros in a non-zero decimal number are not allowed.
This is for disambiguation with C-style octal literals, which Python
used before version 3.0.

Some examples of integer literals:

   7     2147483647                        0o177    0b100110111
   3     79228162514264337593543950336     0o377    0xdeadbeef
         100_000_000_000                   0b_1110_0101

Changed in version 3.6: Underscores are now allowed for grouping
purposes in literals.
a^Lambdas
*******

   lambda_expr        ::= "lambda" [parameter_list] ":" expression
   lambda_expr_nocond ::= "lambda" [parameter_list] ":" expression_nocond

Lambda expressions (sometimes called lambda forms) are used to create
anonymous functions. The expression "lambda parameters: expression"
yields a function object.  The unnamed object behaves like a function
object defined with:

   def <lambda>(parameters):
       return expression

See section Function definitions for the syntax of parameter lists.
Note that functions created with lambda expressions cannot contain
statements or annotations.
a/List displays
*************

A list display is a possibly empty series of expressions enclosed in
square brackets:

   list_display ::= "[" [starred_list | comprehension] "]"

A list display yields a new list object, the contents being specified
by either a list of expressions or a comprehension.  When a comma-
separated list of expressions is supplied, its elements are evaluated
from left to right and placed into the list object in that order.
When a comprehension is supplied, the list is constructed from the
elements resulting from the comprehension.
u�Naming and binding
******************


Binding of names
================

*Names* refer to objects.  Names are introduced by name binding
operations.

The following constructs bind names: formal parameters to functions,
"import" statements, class and function definitions (these bind the
class or function name in the defining block), and targets that are
identifiers if occurring in an assignment, "for" loop header, or after
"as" in a "with" statement or "except" clause. The "import" statement
of the form "from ... import *" binds all names defined in the
imported module, except those beginning with an underscore.  This form
may only be used at the module level.

A target occurring in a "del" statement is also considered bound for
this purpose (though the actual semantics are to unbind the name).

Each assignment or import statement occurs within a block defined by a
class or function definition or at the module level (the top-level
code block).

If a name is bound in a block, it is a local variable of that block,
unless declared as "nonlocal" or "global".  If a name is bound at the
module level, it is a global variable.  (The variables of the module
code block are local and global.)  If a variable is used in a code
block but not defined there, it is a *free variable*.

Each occurrence of a name in the program text refers to the *binding*
of that name established by the following name resolution rules.


Resolution of names
===================

A *scope* defines the visibility of a name within a block.  If a local
variable is defined in a block, its scope includes that block.  If the
definition occurs in a function block, the scope extends to any blocks
contained within the defining one, unless a contained block introduces
a different binding for the name.

When a name is used in a code block, it is resolved using the nearest
enclosing scope.  The set of all such scopes visible to a code block
is called the block’s *environment*.

When a name is not found at all, a "NameError" exception is raised. If
the current scope is a function scope, and the name refers to a local
variable that has not yet been bound to a value at the point where the
name is used, an "UnboundLocalError" exception is raised.
"UnboundLocalError" is a subclass of "NameError".

If a name binding operation occurs anywhere within a code block, all
uses of the name within the block are treated as references to the
current block.  This can lead to errors when a name is used within a
block before it is bound.  This rule is subtle.  Python lacks
declarations and allows name binding operations to occur anywhere
within a code block.  The local variables of a code block can be
determined by scanning the entire text of the block for name binding
operations.

If the "global" statement occurs within a block, all uses of the name
specified in the statement refer to the binding of that name in the
top-level namespace.  Names are resolved in the top-level namespace by
searching the global namespace, i.e. the namespace of the module
containing the code block, and the builtins namespace, the namespace
of the module "builtins".  The global namespace is searched first.  If
the name is not found there, the builtins namespace is searched.  The
"global" statement must precede all uses of the name.

The "global" statement has the same scope as a name binding operation
in the same block.  If the nearest enclosing scope for a free variable
contains a global statement, the free variable is treated as a global.

The "nonlocal" statement causes corresponding names to refer to
previously bound variables in the nearest enclosing function scope.
"SyntaxError" is raised at compile time if the given name does not
exist in any enclosing function scope.

The namespace for a module is automatically created the first time a
module is imported.  The main module for a script is always called
"__main__".

Class definition blocks and arguments to "exec()" and "eval()" are
special in the context of name resolution. A class definition is an
executable statement that may use and define names. These references
follow the normal rules for name resolution with an exception that
unbound local variables are looked up in the global namespace. The
namespace of the class definition becomes the attribute dictionary of
the class. The scope of names defined in a class block is limited to
the class block; it does not extend to the code blocks of methods –
this includes comprehensions and generator expressions since they are
implemented using a function scope.  This means that the following
will fail:

   class A:
       a = 42
       b = list(a + i for i in range(10))


Builtins and restricted execution
=================================

**CPython implementation detail:** Users should not touch
"__builtins__"; it is strictly an implementation detail.  Users
wanting to override values in the builtins namespace should "import"
the "builtins" module and modify its attributes appropriately.

The builtins namespace associated with the execution of a code block
is actually found by looking up the name "__builtins__" in its global
namespace; this should be a dictionary or a module (in the latter case
the module’s dictionary is used).  By default, when in the "__main__"
module, "__builtins__" is the built-in module "builtins"; when in any
other module, "__builtins__" is an alias for the dictionary of the
"builtins" module itself.


Interaction with dynamic features
=================================

Name resolution of free variables occurs at runtime, not at compile
time. This means that the following code will print 42:

   i = 10
   def f():
       print(i)
   i = 42
   f()

The "eval()" and "exec()" functions do not have access to the full
environment for resolving names.  Names may be resolved in the local
and global namespaces of the caller.  Free variables are not resolved
in the nearest enclosing namespace, but in the global namespace.  [1]
The "exec()" and "eval()" functions have optional arguments to
override the global and local namespace.  If only one namespace is
specified, it is used for both.
a�The "nonlocal" statement
************************

   nonlocal_stmt ::= "nonlocal" identifier ("," identifier)*

The "nonlocal" statement causes the listed identifiers to refer to
previously bound variables in the nearest enclosing scope excluding
globals. This is important because the default behavior for binding is
to search the local namespace first.  The statement allows
encapsulated code to rebind variables outside of the local scope
besides the global (module) scope.

Names listed in a "nonlocal" statement, unlike those listed in a
"global" statement, must refer to pre-existing bindings in an
enclosing scope (the scope in which a new binding should be created
cannot be determined unambiguously).

Names listed in a "nonlocal" statement must not collide with pre-
existing bindings in the local scope.

See also:

  **PEP 3104** - Access to Names in Outer Scopes
     The specification for the "nonlocal" statement.
u�Numeric literals
****************

There are three types of numeric literals: integers, floating point
numbers, and imaginary numbers.  There are no complex literals
(complex numbers can be formed by adding a real number and an
imaginary number).

Note that numeric literals do not include a sign; a phrase like "-1"
is actually an expression composed of the unary operator ‘"-"’ and the
literal "1".
uEmulating numeric types
***********************

The following methods can be defined to emulate numeric objects.
Methods corresponding to operations that are not supported by the
particular kind of number implemented (e.g., bitwise operations for
non-integral numbers) should be left undefined.

object.__add__(self, other)
object.__sub__(self, other)
object.__mul__(self, other)
object.__matmul__(self, other)
object.__truediv__(self, other)
object.__floordiv__(self, other)
object.__mod__(self, other)
object.__divmod__(self, other)
object.__pow__(self, other[, modulo])
object.__lshift__(self, other)
object.__rshift__(self, other)
object.__and__(self, other)
object.__xor__(self, other)
object.__or__(self, other)

   These methods are called to implement the binary arithmetic
   operations ("+", "-", "*", "@", "/", "//", "%", "divmod()",
   "pow()", "**", "<<", ">>", "&", "^", "|").  For instance, to
   evaluate the expression "x + y", where *x* is an instance of a
   class that has an "__add__()" method, "x.__add__(y)" is called.
   The "__divmod__()" method should be the equivalent to using
   "__floordiv__()" and "__mod__()"; it should not be related to
   "__truediv__()".  Note that "__pow__()" should be defined to accept
   an optional third argument if the ternary version of the built-in
   "pow()" function is to be supported.

   If one of those methods does not support the operation with the
   supplied arguments, it should return "NotImplemented".

object.__radd__(self, other)
object.__rsub__(self, other)
object.__rmul__(self, other)
object.__rmatmul__(self, other)
object.__rtruediv__(self, other)
object.__rfloordiv__(self, other)
object.__rmod__(self, other)
object.__rdivmod__(self, other)
object.__rpow__(self, other[, modulo])
object.__rlshift__(self, other)
object.__rrshift__(self, other)
object.__rand__(self, other)
object.__rxor__(self, other)
object.__ror__(self, other)

   These methods are called to implement the binary arithmetic
   operations ("+", "-", "*", "@", "/", "//", "%", "divmod()",
   "pow()", "**", "<<", ">>", "&", "^", "|") with reflected (swapped)
   operands.  These functions are only called if the left operand does
   not support the corresponding operation [3] and the operands are of
   different types. [4] For instance, to evaluate the expression "x -
   y", where *y* is an instance of a class that has an "__rsub__()"
   method, "y.__rsub__(x)" is called if "x.__sub__(y)" returns
   *NotImplemented*.

   Note that ternary "pow()" will not try calling "__rpow__()" (the
   coercion rules would become too complicated).

   Note:

     If the right operand’s type is a subclass of the left operand’s
     type and that subclass provides a different implementation of the
     reflected method for the operation, this method will be called
     before the left operand’s non-reflected method. This behavior
     allows subclasses to override their ancestors’ operations.

object.__iadd__(self, other)
object.__isub__(self, other)
object.__imul__(self, other)
object.__imatmul__(self, other)
object.__itruediv__(self, other)
object.__ifloordiv__(self, other)
object.__imod__(self, other)
object.__ipow__(self, other[, modulo])
object.__ilshift__(self, other)
object.__irshift__(self, other)
object.__iand__(self, other)
object.__ixor__(self, other)
object.__ior__(self, other)

   These methods are called to implement the augmented arithmetic
   assignments ("+=", "-=", "*=", "@=", "/=", "//=", "%=", "**=",
   "<<=", ">>=", "&=", "^=", "|=").  These methods should attempt to
   do the operation in-place (modifying *self*) and return the result
   (which could be, but does not have to be, *self*).  If a specific
   method is not defined, the augmented assignment falls back to the
   normal methods.  For instance, if *x* is an instance of a class
   with an "__iadd__()" method, "x += y" is equivalent to "x =
   x.__iadd__(y)" . Otherwise, "x.__add__(y)" and "y.__radd__(x)" are
   considered, as with the evaluation of "x + y". In certain
   situations, augmented assignment can result in unexpected errors
   (see Why does a_tuple[i] += [‘item’] raise an exception when the
   addition works?), but this behavior is in fact part of the data
   model.

   Note:

     Due to a bug in the dispatching mechanism for "**=", a class that
     defines "__ipow__()" but returns "NotImplemented" would fail to
     fall back to "x.__pow__(y)" and "y.__rpow__(x)". This bug is
     fixed in Python 3.10.

object.__neg__(self)
object.__pos__(self)
object.__abs__(self)
object.__invert__(self)

   Called to implement the unary arithmetic operations ("-", "+",
   "abs()" and "~").

object.__complex__(self)
object.__int__(self)
object.__float__(self)

   Called to implement the built-in functions "complex()", "int()" and
   "float()".  Should return a value of the appropriate type.

object.__index__(self)

   Called to implement "operator.index()", and whenever Python needs
   to losslessly convert the numeric object to an integer object (such
   as in slicing, or in the built-in "bin()", "hex()" and "oct()"
   functions). Presence of this method indicates that the numeric
   object is an integer type.  Must return an integer.

   If "__int__()", "__float__()" and "__complex__()" are not defined
   then corresponding built-in functions "int()", "float()" and
   "complex()" fall back to "__index__()".

object.__round__(self[, ndigits])
object.__trunc__(self)
object.__floor__(self)
object.__ceil__(self)

   Called to implement the built-in function "round()" and "math"
   functions "trunc()", "floor()" and "ceil()". Unless *ndigits* is
   passed to "__round__()" all these methods should return the value
   of the object truncated to an "Integral" (typically an "int").

   The built-in function "int()" falls back to "__trunc__()" if
   neither "__int__()" nor "__index__()" is defined.
uObjects, values and types
*************************

*Objects* are Python’s abstraction for data.  All data in a Python
program is represented by objects or by relations between objects. (In
a sense, and in conformance to Von Neumann’s model of a “stored
program computer”, code is also represented by objects.)

Every object has an identity, a type and a value.  An object’s
*identity* never changes once it has been created; you may think of it
as the object’s address in memory.  The ‘"is"’ operator compares the
identity of two objects; the "id()" function returns an integer
representing its identity.

**CPython implementation detail:** For CPython, "id(x)" is the memory
address where "x" is stored.

An object’s type determines the operations that the object supports
(e.g., “does it have a length?”) and also defines the possible values
for objects of that type.  The "type()" function returns an object’s
type (which is an object itself).  Like its identity, an object’s
*type* is also unchangeable. [1]

The *value* of some objects can change.  Objects whose value can
change are said to be *mutable*; objects whose value is unchangeable
once they are created are called *immutable*. (The value of an
immutable container object that contains a reference to a mutable
object can change when the latter’s value is changed; however the
container is still considered immutable, because the collection of
objects it contains cannot be changed.  So, immutability is not
strictly the same as having an unchangeable value, it is more subtle.)
An object’s mutability is determined by its type; for instance,
numbers, strings and tuples are immutable, while dictionaries and
lists are mutable.

Objects are never explicitly destroyed; however, when they become
unreachable they may be garbage-collected.  An implementation is
allowed to postpone garbage collection or omit it altogether — it is a
matter of implementation quality how garbage collection is
implemented, as long as no objects are collected that are still
reachable.

**CPython implementation detail:** CPython currently uses a reference-
counting scheme with (optional) delayed detection of cyclically linked
garbage, which collects most objects as soon as they become
unreachable, but is not guaranteed to collect garbage containing
circular references.  See the documentation of the "gc" module for
information on controlling the collection of cyclic garbage. Other
implementations act differently and CPython may change. Do not depend
on immediate finalization of objects when they become unreachable (so
you should always close files explicitly).

Note that the use of the implementation’s tracing or debugging
facilities may keep objects alive that would normally be collectable.
Also note that catching an exception with a ‘"try"…"except"’ statement
may keep objects alive.

Some objects contain references to “external” resources such as open
files or windows.  It is understood that these resources are freed
when the object is garbage-collected, but since garbage collection is
not guaranteed to happen, such objects also provide an explicit way to
release the external resource, usually a "close()" method. Programs
are strongly recommended to explicitly close such objects.  The
‘"try"…"finally"’ statement and the ‘"with"’ statement provide
convenient ways to do this.

Some objects contain references to other objects; these are called
*containers*. Examples of containers are tuples, lists and
dictionaries.  The references are part of a container’s value.  In
most cases, when we talk about the value of a container, we imply the
values, not the identities of the contained objects; however, when we
talk about the mutability of a container, only the identities of the
immediately contained objects are implied.  So, if an immutable
container (like a tuple) contains a reference to a mutable object, its
value changes if that mutable object is changed.

Types affect almost all aspects of object behavior.  Even the
importance of object identity is affected in some sense: for immutable
types, operations that compute new values may actually return a
reference to any existing object with the same type and value, while
for mutable objects this is not allowed.  E.g., after "a = 1; b = 1",
"a" and "b" may or may not refer to the same object with the value
one, depending on the implementation, but after "c = []; d = []", "c"
and "d" are guaranteed to refer to two different, unique, newly
created empty lists. (Note that "c = d = []" assigns the same object
to both "c" and "d".)
u�Operator precedence
*******************

The following table summarizes the operator precedence in Python, from
lowest precedence (least binding) to highest precedence (most
binding).  Operators in the same box have the same precedence.  Unless
the syntax is explicitly given, operators are binary.  Operators in
the same box group left to right (except for exponentiation, which
groups from right to left).

Note that comparisons, membership tests, and identity tests, all have
the same precedence and have a left-to-right chaining feature as
described in the Comparisons section.

+-------------------------------------------------+---------------------------------------+
| Operator                                        | Description                           |
|=================================================|=======================================|
| ":="                                            | Assignment expression                 |
+-------------------------------------------------+---------------------------------------+
| "lambda"                                        | Lambda expression                     |
+-------------------------------------------------+---------------------------------------+
| "if" – "else"                                   | Conditional expression                |
+-------------------------------------------------+---------------------------------------+
| "or"                                            | Boolean OR                            |
+-------------------------------------------------+---------------------------------------+
| "and"                                           | Boolean AND                           |
+-------------------------------------------------+---------------------------------------+
| "not" "x"                                       | Boolean NOT                           |
+-------------------------------------------------+---------------------------------------+
| "in", "not in", "is", "is not", "<", "<=", ">", | Comparisons, including membership     |
| ">=", "!=", "=="                                | tests and identity tests              |
+-------------------------------------------------+---------------------------------------+
| "|"                                             | Bitwise OR                            |
+-------------------------------------------------+---------------------------------------+
| "^"                                             | Bitwise XOR                           |
+-------------------------------------------------+---------------------------------------+
| "&"                                             | Bitwise AND                           |
+-------------------------------------------------+---------------------------------------+
| "<<", ">>"                                      | Shifts                                |
+-------------------------------------------------+---------------------------------------+
| "+", "-"                                        | Addition and subtraction              |
+-------------------------------------------------+---------------------------------------+
| "*", "@", "/", "//", "%"                        | Multiplication, matrix                |
|                                                 | multiplication, division, floor       |
|                                                 | division, remainder [5]               |
+-------------------------------------------------+---------------------------------------+
| "+x", "-x", "~x"                                | Positive, negative, bitwise NOT       |
+-------------------------------------------------+---------------------------------------+
| "**"                                            | Exponentiation [6]                    |
+-------------------------------------------------+---------------------------------------+
| "await" "x"                                     | Await expression                      |
+-------------------------------------------------+---------------------------------------+
| "x[index]", "x[index:index]",                   | Subscription, slicing, call,          |
| "x(arguments...)", "x.attribute"                | attribute reference                   |
+-------------------------------------------------+---------------------------------------+
| "(expressions...)",  "[expressions...]", "{key: | Binding or parenthesized expression,  |
| value...}", "{expressions...}"                  | list display, dictionary display, set |
|                                                 | display                               |
+-------------------------------------------------+---------------------------------------+

-[ Footnotes ]-

[1] While "abs(x%y) < abs(y)" is true mathematically, for floats it
    may not be true numerically due to roundoff.  For example, and
    assuming a platform on which a Python float is an IEEE 754 double-
    precision number, in order that "-1e-100 % 1e100" have the same
    sign as "1e100", the computed result is "-1e-100 + 1e100", which
    is numerically exactly equal to "1e100".  The function
    "math.fmod()" returns a result whose sign matches the sign of the
    first argument instead, and so returns "-1e-100" in this case.
    Which approach is more appropriate depends on the application.

[2] If x is very close to an exact integer multiple of y, it’s
    possible for "x//y" to be one larger than "(x-x%y)//y" due to
    rounding.  In such cases, Python returns the latter result, in
    order to preserve that "divmod(x,y)[0] * y + x % y" be very close
    to "x".

[3] The Unicode standard distinguishes between *code points* (e.g.
    U+0041) and *abstract characters* (e.g. “LATIN CAPITAL LETTER A”).
    While most abstract characters in Unicode are only represented
    using one code point, there is a number of abstract characters
    that can in addition be represented using a sequence of more than
    one code point.  For example, the abstract character “LATIN
    CAPITAL LETTER C WITH CEDILLA” can be represented as a single
    *precomposed character* at code position U+00C7, or as a sequence
    of a *base character* at code position U+0043 (LATIN CAPITAL
    LETTER C), followed by a *combining character* at code position
    U+0327 (COMBINING CEDILLA).

    The comparison operators on strings compare at the level of
    Unicode code points. This may be counter-intuitive to humans.  For
    example, ""\u00C7" == "\u0043\u0327"" is "False", even though both
    strings represent the same abstract character “LATIN CAPITAL
    LETTER C WITH CEDILLA”.

    To compare strings at the level of abstract characters (that is,
    in a way intuitive to humans), use "unicodedata.normalize()".

[4] Due to automatic garbage-collection, free lists, and the dynamic
    nature of descriptors, you may notice seemingly unusual behaviour
    in certain uses of the "is" operator, like those involving
    comparisons between instance methods, or constants.  Check their
    documentation for more info.

[5] The "%" operator is also used for string formatting; the same
    precedence applies.

[6] The power operator "**" binds less tightly than an arithmetic or
    bitwise unary operator on its right, that is, "2**-1" is "0.5".
uwThe "pass" statement
********************

   pass_stmt ::= "pass"

"pass" is a null operation — when it is executed, nothing happens. It
is useful as a placeholder when a statement is required syntactically,
but no code needs to be executed, for example:

   def f(arg): pass    # a function that does nothing (yet)

   class C: pass       # a class with no methods (yet)
a�The power operator
******************

The power operator binds more tightly than unary operators on its
left; it binds less tightly than unary operators on its right.  The
syntax is:

   power ::= (await_expr | primary) ["**" u_expr]

Thus, in an unparenthesized sequence of power and unary operators, the
operators are evaluated from right to left (this does not constrain
the evaluation order for the operands): "-1**2" results in "-1".

The power operator has the same semantics as the built-in "pow()"
function, when called with two arguments: it yields its left argument
raised to the power of its right argument.  The numeric arguments are
first converted to a common type, and the result is of that type.

For int operands, the result has the same type as the operands unless
the second argument is negative; in that case, all arguments are
converted to float and a float result is delivered. For example,
"10**2" returns "100", but "10**-2" returns "0.01".

Raising "0.0" to a negative power results in a "ZeroDivisionError".
Raising a negative number to a fractional power results in a "complex"
number. (In earlier versions it raised a "ValueError".)
uJ
The "raise" statement
*********************

   raise_stmt ::= "raise" [expression ["from" expression]]

If no expressions are present, "raise" re-raises the last exception
that was active in the current scope.  If no exception is active in
the current scope, a "RuntimeError" exception is raised indicating
that this is an error.

Otherwise, "raise" evaluates the first expression as the exception
object.  It must be either a subclass or an instance of
"BaseException". If it is a class, the exception instance will be
obtained when needed by instantiating the class with no arguments.

The *type* of the exception is the exception instance’s class, the
*value* is the instance itself.

A traceback object is normally created automatically when an exception
is raised and attached to it as the "__traceback__" attribute, which
is writable. You can create an exception and set your own traceback in
one step using the "with_traceback()" exception method (which returns
the same exception instance, with its traceback set to its argument),
like so:

   raise Exception("foo occurred").with_traceback(tracebackobj)

The "from" clause is used for exception chaining: if given, the second
*expression* must be another exception class or instance. If the
second expression is an exception instance, it will be attached to the
raised exception as the "__cause__" attribute (which is writable). If
the expression is an exception class, the class will be instantiated
and the resulting exception instance will be attached to the raised
exception as the "__cause__" attribute. If the raised exception is not
handled, both exceptions will be printed:

   >>> try:
   ...     print(1 / 0)
   ... except Exception as exc:
   ...     raise RuntimeError("Something bad happened") from exc
   ...
   Traceback (most recent call last):
     File "<stdin>", line 2, in <module>
   ZeroDivisionError: division by zero

   The above exception was the direct cause of the following exception:

   Traceback (most recent call last):
     File "<stdin>", line 4, in <module>
   RuntimeError: Something bad happened

A similar mechanism works implicitly if an exception is raised inside
an exception handler or a "finally" clause: the previous exception is
then attached as the new exception’s "__context__" attribute:

   >>> try:
   ...     print(1 / 0)
   ... except:
   ...     raise RuntimeError("Something bad happened")
   ...
   Traceback (most recent call last):
     File "<stdin>", line 2, in <module>
   ZeroDivisionError: division by zero

   During handling of the above exception, another exception occurred:

   Traceback (most recent call last):
     File "<stdin>", line 4, in <module>
   RuntimeError: Something bad happened

Exception chaining can be explicitly suppressed by specifying "None"
in the "from" clause:

   >>> try:
   ...     print(1 / 0)
   ... except:
   ...     raise RuntimeError("Something bad happened") from None
   ...
   Traceback (most recent call last):
     File "<stdin>", line 4, in <module>
   RuntimeError: Something bad happened

Additional information on exceptions can be found in section
Exceptions, and information about handling exceptions is in section
The try statement.

Changed in version 3.3: "None" is now permitted as "Y" in "raise X
from Y".

New in version 3.3: The "__suppress_context__" attribute to suppress
automatic display of the exception context.
aThe "return" statement
**********************

   return_stmt ::= "return" [expression_list]

"return" may only occur syntactically nested in a function definition,
not within a nested class definition.

If an expression list is present, it is evaluated, else "None" is
substituted.

"return" leaves the current function call with the expression list (or
"None") as return value.

When "return" passes control out of a "try" statement with a "finally"
clause, that "finally" clause is executed before really leaving the
function.

In a generator function, the "return" statement indicates that the
generator is done and will cause "StopIteration" to be raised. The
returned value (if any) is used as an argument to construct
"StopIteration" and becomes the "StopIteration.value" attribute.

In an asynchronous generator function, an empty "return" statement
indicates that the asynchronous generator is done and will cause
"StopAsyncIteration" to be raised.  A non-empty "return" statement is
a syntax error in an asynchronous generator function.
u�Emulating container types
*************************

The following methods can be defined to implement container objects.
Containers usually are sequences (such as lists or tuples) or mappings
(like dictionaries), but can represent other containers as well.  The
first set of methods is used either to emulate a sequence or to
emulate a mapping; the difference is that for a sequence, the
allowable keys should be the integers *k* for which "0 <= k < N" where
*N* is the length of the sequence, or slice objects, which define a
range of items.  It is also recommended that mappings provide the
methods "keys()", "values()", "items()", "get()", "clear()",
"setdefault()", "pop()", "popitem()", "copy()", and "update()"
behaving similar to those for Python’s standard dictionary objects.
The "collections.abc" module provides a "MutableMapping" abstract base
class to help create those methods from a base set of "__getitem__()",
"__setitem__()", "__delitem__()", and "keys()". Mutable sequences
should provide methods "append()", "count()", "index()", "extend()",
"insert()", "pop()", "remove()", "reverse()" and "sort()", like Python
standard list objects.  Finally, sequence types should implement
addition (meaning concatenation) and multiplication (meaning
repetition) by defining the methods "__add__()", "__radd__()",
"__iadd__()", "__mul__()", "__rmul__()" and "__imul__()" described
below; they should not define other numerical operators.  It is
recommended that both mappings and sequences implement the
"__contains__()" method to allow efficient use of the "in" operator;
for mappings, "in" should search the mapping’s keys; for sequences, it
should search through the values.  It is further recommended that both
mappings and sequences implement the "__iter__()" method to allow
efficient iteration through the container; for mappings, "__iter__()"
should iterate through the object’s keys; for sequences, it should
iterate through the values.

object.__len__(self)

   Called to implement the built-in function "len()".  Should return
   the length of the object, an integer ">=" 0.  Also, an object that
   doesn’t define a "__bool__()" method and whose "__len__()" method
   returns zero is considered to be false in a Boolean context.

   **CPython implementation detail:** In CPython, the length is
   required to be at most "sys.maxsize". If the length is larger than
   "sys.maxsize" some features (such as "len()") may raise
   "OverflowError".  To prevent raising "OverflowError" by truth value
   testing, an object must define a "__bool__()" method.

object.__length_hint__(self)

   Called to implement "operator.length_hint()". Should return an
   estimated length for the object (which may be greater or less than
   the actual length). The length must be an integer ">=" 0. The
   return value may also be "NotImplemented", which is treated the
   same as if the "__length_hint__" method didn’t exist at all. This
   method is purely an optimization and is never required for
   correctness.

   New in version 3.4.

Note:

  Slicing is done exclusively with the following three methods.  A
  call like

     a[1:2] = b

  is translated to

     a[slice(1, 2, None)] = b

  and so forth.  Missing slice items are always filled in with "None".

object.__getitem__(self, key)

   Called to implement evaluation of "self[key]". For sequence types,
   the accepted keys should be integers and slice objects.  Note that
   the special interpretation of negative indexes (if the class wishes
   to emulate a sequence type) is up to the "__getitem__()" method. If
   *key* is of an inappropriate type, "TypeError" may be raised; if of
   a value outside the set of indexes for the sequence (after any
   special interpretation of negative values), "IndexError" should be
   raised. For mapping types, if *key* is missing (not in the
   container), "KeyError" should be raised.

   Note:

     "for" loops expect that an "IndexError" will be raised for
     illegal indexes to allow proper detection of the end of the
     sequence.

object.__setitem__(self, key, value)

   Called to implement assignment to "self[key]".  Same note as for
   "__getitem__()".  This should only be implemented for mappings if
   the objects support changes to the values for keys, or if new keys
   can be added, or for sequences if elements can be replaced.  The
   same exceptions should be raised for improper *key* values as for
   the "__getitem__()" method.

object.__delitem__(self, key)

   Called to implement deletion of "self[key]".  Same note as for
   "__getitem__()".  This should only be implemented for mappings if
   the objects support removal of keys, or for sequences if elements
   can be removed from the sequence.  The same exceptions should be
   raised for improper *key* values as for the "__getitem__()" method.

object.__missing__(self, key)

   Called by "dict"."__getitem__()" to implement "self[key]" for dict
   subclasses when key is not in the dictionary.

object.__iter__(self)

   This method is called when an iterator is required for a container.
   This method should return a new iterator object that can iterate
   over all the objects in the container.  For mappings, it should
   iterate over the keys of the container.

   Iterator objects also need to implement this method; they are
   required to return themselves.  For more information on iterator
   objects, see Iterator Types.

object.__reversed__(self)

   Called (if present) by the "reversed()" built-in to implement
   reverse iteration.  It should return a new iterator object that
   iterates over all the objects in the container in reverse order.

   If the "__reversed__()" method is not provided, the "reversed()"
   built-in will fall back to using the sequence protocol ("__len__()"
   and "__getitem__()").  Objects that support the sequence protocol
   should only provide "__reversed__()" if they can provide an
   implementation that is more efficient than the one provided by
   "reversed()".

The membership test operators ("in" and "not in") are normally
implemented as an iteration through a container. However, container
objects can supply the following special method with a more efficient
implementation, which also does not require the object be iterable.

object.__contains__(self, item)

   Called to implement membership test operators.  Should return true
   if *item* is in *self*, false otherwise.  For mapping objects, this
   should consider the keys of the mapping rather than the values or
   the key-item pairs.

   For objects that don’t define "__contains__()", the membership test
   first tries iteration via "__iter__()", then the old sequence
   iteration protocol via "__getitem__()", see this section in the
   language reference.
a�Shifting operations
*******************

The shifting operations have lower priority than the arithmetic
operations:

   shift_expr ::= a_expr | shift_expr ("<<" | ">>") a_expr

These operators accept integers as arguments.  They shift the first
argument to the left or right by the number of bits given by the
second argument.

A right shift by *n* bits is defined as floor division by "pow(2,n)".
A left shift by *n* bits is defined as multiplication with "pow(2,n)".
a�Slicings
********

A slicing selects a range of items in a sequence object (e.g., a
string, tuple or list).  Slicings may be used as expressions or as
targets in assignment or "del" statements.  The syntax for a slicing:

   slicing      ::= primary "[" slice_list "]"
   slice_list   ::= slice_item ("," slice_item)* [","]
   slice_item   ::= expression | proper_slice
   proper_slice ::= [lower_bound] ":" [upper_bound] [ ":" [stride] ]
   lower_bound  ::= expression
   upper_bound  ::= expression
   stride       ::= expression

There is ambiguity in the formal syntax here: anything that looks like
an expression list also looks like a slice list, so any subscription
can be interpreted as a slicing.  Rather than further complicating the
syntax, this is disambiguated by defining that in this case the
interpretation as a subscription takes priority over the
interpretation as a slicing (this is the case if the slice list
contains no proper slice).

The semantics for a slicing are as follows.  The primary is indexed
(using the same "__getitem__()" method as normal subscription) with a
key that is constructed from the slice list, as follows.  If the slice
list contains at least one comma, the key is a tuple containing the
conversion of the slice items; otherwise, the conversion of the lone
slice item is the key.  The conversion of a slice item that is an
expression is that expression.  The conversion of a proper slice is a
slice object (see section The standard type hierarchy) whose "start",
"stop" and "step" attributes are the values of the expressions given
as lower bound, upper bound and stride, respectively, substituting
"None" for missing expressions.
uSpecial Attributes
******************

The implementation adds a few special read-only attributes to several
object types, where they are relevant.  Some of these are not reported
by the "dir()" built-in function.

object.__dict__

   A dictionary or other mapping object used to store an object’s
   (writable) attributes.

instance.__class__

   The class to which a class instance belongs.

class.__bases__

   The tuple of base classes of a class object.

definition.__name__

   The name of the class, function, method, descriptor, or generator
   instance.

definition.__qualname__

   The *qualified name* of the class, function, method, descriptor, or
   generator instance.

   New in version 3.3.

class.__mro__

   This attribute is a tuple of classes that are considered when
   looking for base classes during method resolution.

class.mro()

   This method can be overridden by a metaclass to customize the
   method resolution order for its instances.  It is called at class
   instantiation, and its result is stored in "__mro__".

class.__subclasses__()

   Each class keeps a list of weak references to its immediate
   subclasses.  This method returns a list of all those references
   still alive. Example:

      >>> int.__subclasses__()
      [<class 'bool'>]
u��Special method names
********************

A class can implement certain operations that are invoked by special
syntax (such as arithmetic operations or subscripting and slicing) by
defining methods with special names. This is Python’s approach to
*operator overloading*, allowing classes to define their own behavior
with respect to language operators.  For instance, if a class defines
a method named "__getitem__()", and "x" is an instance of this class,
then "x[i]" is roughly equivalent to "type(x).__getitem__(x, i)".
Except where mentioned, attempts to execute an operation raise an
exception when no appropriate method is defined (typically
"AttributeError" or "TypeError").

Setting a special method to "None" indicates that the corresponding
operation is not available.  For example, if a class sets "__iter__()"
to "None", the class is not iterable, so calling "iter()" on its
instances will raise a "TypeError" (without falling back to
"__getitem__()"). [2]

When implementing a class that emulates any built-in type, it is
important that the emulation only be implemented to the degree that it
makes sense for the object being modelled.  For example, some
sequences may work well with retrieval of individual elements, but
extracting a slice may not make sense.  (One example of this is the
"NodeList" interface in the W3C’s Document Object Model.)


Basic customization
===================

object.__new__(cls[, ...])

   Called to create a new instance of class *cls*.  "__new__()" is a
   static method (special-cased so you need not declare it as such)
   that takes the class of which an instance was requested as its
   first argument.  The remaining arguments are those passed to the
   object constructor expression (the call to the class).  The return
   value of "__new__()" should be the new object instance (usually an
   instance of *cls*).

   Typical implementations create a new instance of the class by
   invoking the superclass’s "__new__()" method using
   "super().__new__(cls[, ...])" with appropriate arguments and then
   modifying the newly-created instance as necessary before returning
   it.

   If "__new__()" is invoked during object construction and it returns
   an instance of *cls*, then the new instance’s "__init__()" method
   will be invoked like "__init__(self[, ...])", where *self* is the
   new instance and the remaining arguments are the same as were
   passed to the object constructor.

   If "__new__()" does not return an instance of *cls*, then the new
   instance’s "__init__()" method will not be invoked.

   "__new__()" is intended mainly to allow subclasses of immutable
   types (like int, str, or tuple) to customize instance creation.  It
   is also commonly overridden in custom metaclasses in order to
   customize class creation.

object.__init__(self[, ...])

   Called after the instance has been created (by "__new__()"), but
   before it is returned to the caller.  The arguments are those
   passed to the class constructor expression.  If a base class has an
   "__init__()" method, the derived class’s "__init__()" method, if
   any, must explicitly call it to ensure proper initialization of the
   base class part of the instance; for example:
   "super().__init__([args...])".

   Because "__new__()" and "__init__()" work together in constructing
   objects ("__new__()" to create it, and "__init__()" to customize
   it), no non-"None" value may be returned by "__init__()"; doing so
   will cause a "TypeError" to be raised at runtime.

object.__del__(self)

   Called when the instance is about to be destroyed.  This is also
   called a finalizer or (improperly) a destructor.  If a base class
   has a "__del__()" method, the derived class’s "__del__()" method,
   if any, must explicitly call it to ensure proper deletion of the
   base class part of the instance.

   It is possible (though not recommended!) for the "__del__()" method
   to postpone destruction of the instance by creating a new reference
   to it.  This is called object *resurrection*.  It is
   implementation-dependent whether "__del__()" is called a second
   time when a resurrected object is about to be destroyed; the
   current *CPython* implementation only calls it once.

   It is not guaranteed that "__del__()" methods are called for
   objects that still exist when the interpreter exits.

   Note:

     "del x" doesn’t directly call "x.__del__()" — the former
     decrements the reference count for "x" by one, and the latter is
     only called when "x"’s reference count reaches zero.

   **CPython implementation detail:** It is possible for a reference
   cycle to prevent the reference count of an object from going to
   zero.  In this case, the cycle will be later detected and deleted
   by the *cyclic garbage collector*.  A common cause of reference
   cycles is when an exception has been caught in a local variable.
   The frame’s locals then reference the exception, which references
   its own traceback, which references the locals of all frames caught
   in the traceback.

   See also: Documentation for the "gc" module.

   Warning:

     Due to the precarious circumstances under which "__del__()"
     methods are invoked, exceptions that occur during their execution
     are ignored, and a warning is printed to "sys.stderr" instead.
     In particular:

     * "__del__()" can be invoked when arbitrary code is being
       executed, including from any arbitrary thread.  If "__del__()"
       needs to take a lock or invoke any other blocking resource, it
       may deadlock as the resource may already be taken by the code
       that gets interrupted to execute "__del__()".

     * "__del__()" can be executed during interpreter shutdown.  As a
       consequence, the global variables it needs to access (including
       other modules) may already have been deleted or set to "None".
       Python guarantees that globals whose name begins with a single
       underscore are deleted from their module before other globals
       are deleted; if no other references to such globals exist, this
       may help in assuring that imported modules are still available
       at the time when the "__del__()" method is called.

object.__repr__(self)

   Called by the "repr()" built-in function to compute the “official”
   string representation of an object.  If at all possible, this
   should look like a valid Python expression that could be used to
   recreate an object with the same value (given an appropriate
   environment).  If this is not possible, a string of the form
   "<...some useful description...>" should be returned. The return
   value must be a string object. If a class defines "__repr__()" but
   not "__str__()", then "__repr__()" is also used when an “informal”
   string representation of instances of that class is required.

   This is typically used for debugging, so it is important that the
   representation is information-rich and unambiguous.

object.__str__(self)

   Called by "str(object)" and the built-in functions "format()" and
   "print()" to compute the “informal” or nicely printable string
   representation of an object.  The return value must be a string
   object.

   This method differs from "object.__repr__()" in that there is no
   expectation that "__str__()" return a valid Python expression: a
   more convenient or concise representation can be used.

   The default implementation defined by the built-in type "object"
   calls "object.__repr__()".

object.__bytes__(self)

   Called by bytes to compute a byte-string representation of an
   object. This should return a "bytes" object.

object.__format__(self, format_spec)

   Called by the "format()" built-in function, and by extension,
   evaluation of formatted string literals and the "str.format()"
   method, to produce a “formatted” string representation of an
   object. The *format_spec* argument is a string that contains a
   description of the formatting options desired. The interpretation
   of the *format_spec* argument is up to the type implementing
   "__format__()", however most classes will either delegate
   formatting to one of the built-in types, or use a similar
   formatting option syntax.

   See Format Specification Mini-Language for a description of the
   standard formatting syntax.

   The return value must be a string object.

   Changed in version 3.4: The __format__ method of "object" itself
   raises a "TypeError" if passed any non-empty string.

   Changed in version 3.7: "object.__format__(x, '')" is now
   equivalent to "str(x)" rather than "format(str(self), '')".

object.__lt__(self, other)
object.__le__(self, other)
object.__eq__(self, other)
object.__ne__(self, other)
object.__gt__(self, other)
object.__ge__(self, other)

   These are the so-called “rich comparison” methods. The
   correspondence between operator symbols and method names is as
   follows: "x<y" calls "x.__lt__(y)", "x<=y" calls "x.__le__(y)",
   "x==y" calls "x.__eq__(y)", "x!=y" calls "x.__ne__(y)", "x>y" calls
   "x.__gt__(y)", and "x>=y" calls "x.__ge__(y)".

   A rich comparison method may return the singleton "NotImplemented"
   if it does not implement the operation for a given pair of
   arguments. By convention, "False" and "True" are returned for a
   successful comparison. However, these methods can return any value,
   so if the comparison operator is used in a Boolean context (e.g.,
   in the condition of an "if" statement), Python will call "bool()"
   on the value to determine if the result is true or false.

   By default, "object" implements "__eq__()" by using "is", returning
   "NotImplemented" in the case of a false comparison: "True if x is y
   else NotImplemented". For "__ne__()", by default it delegates to
   "__eq__()" and inverts the result unless it is "NotImplemented".
   There are no other implied relationships among the comparison
   operators or default implementations; for example, the truth of
   "(x<y or x==y)" does not imply "x<=y". To automatically generate
   ordering operations from a single root operation, see
   "functools.total_ordering()".

   See the paragraph on "__hash__()" for some important notes on
   creating *hashable* objects which support custom comparison
   operations and are usable as dictionary keys.

   There are no swapped-argument versions of these methods (to be used
   when the left argument does not support the operation but the right
   argument does); rather, "__lt__()" and "__gt__()" are each other’s
   reflection, "__le__()" and "__ge__()" are each other’s reflection,
   and "__eq__()" and "__ne__()" are their own reflection. If the
   operands are of different types, and right operand’s type is a
   direct or indirect subclass of the left operand’s type, the
   reflected method of the right operand has priority, otherwise the
   left operand’s method has priority.  Virtual subclassing is not
   considered.

object.__hash__(self)

   Called by built-in function "hash()" and for operations on members
   of hashed collections including "set", "frozenset", and "dict".
   "__hash__()" should return an integer. The only required property
   is that objects which compare equal have the same hash value; it is
   advised to mix together the hash values of the components of the
   object that also play a part in comparison of objects by packing
   them into a tuple and hashing the tuple. Example:

      def __hash__(self):
          return hash((self.name, self.nick, self.color))

   Note:

     "hash()" truncates the value returned from an object’s custom
     "__hash__()" method to the size of a "Py_ssize_t".  This is
     typically 8 bytes on 64-bit builds and 4 bytes on 32-bit builds.
     If an object’s   "__hash__()" must interoperate on builds of
     different bit sizes, be sure to check the width on all supported
     builds.  An easy way to do this is with "python -c "import sys;
     print(sys.hash_info.width)"".

   If a class does not define an "__eq__()" method it should not
   define a "__hash__()" operation either; if it defines "__eq__()"
   but not "__hash__()", its instances will not be usable as items in
   hashable collections.  If a class defines mutable objects and
   implements an "__eq__()" method, it should not implement
   "__hash__()", since the implementation of hashable collections
   requires that a key’s hash value is immutable (if the object’s hash
   value changes, it will be in the wrong hash bucket).

   User-defined classes have "__eq__()" and "__hash__()" methods by
   default; with them, all objects compare unequal (except with
   themselves) and "x.__hash__()" returns an appropriate value such
   that "x == y" implies both that "x is y" and "hash(x) == hash(y)".

   A class that overrides "__eq__()" and does not define "__hash__()"
   will have its "__hash__()" implicitly set to "None".  When the
   "__hash__()" method of a class is "None", instances of the class
   will raise an appropriate "TypeError" when a program attempts to
   retrieve their hash value, and will also be correctly identified as
   unhashable when checking "isinstance(obj,
   collections.abc.Hashable)".

   If a class that overrides "__eq__()" needs to retain the
   implementation of "__hash__()" from a parent class, the interpreter
   must be told this explicitly by setting "__hash__ =
   <ParentClass>.__hash__".

   If a class that does not override "__eq__()" wishes to suppress
   hash support, it should include "__hash__ = None" in the class
   definition. A class which defines its own "__hash__()" that
   explicitly raises a "TypeError" would be incorrectly identified as
   hashable by an "isinstance(obj, collections.abc.Hashable)" call.

   Note:

     By default, the "__hash__()" values of str and bytes objects are
     “salted” with an unpredictable random value.  Although they
     remain constant within an individual Python process, they are not
     predictable between repeated invocations of Python.This is
     intended to provide protection against a denial-of-service caused
     by carefully-chosen inputs that exploit the worst case
     performance of a dict insertion, O(n^2) complexity.  See
     http://www.ocert.org/advisories/ocert-2011-003.html for
     details.Changing hash values affects the iteration order of sets.
     Python has never made guarantees about this ordering (and it
     typically varies between 32-bit and 64-bit builds).See also
     "PYTHONHASHSEED".

   Changed in version 3.3: Hash randomization is enabled by default.

object.__bool__(self)

   Called to implement truth value testing and the built-in operation
   "bool()"; should return "False" or "True".  When this method is not
   defined, "__len__()" is called, if it is defined, and the object is
   considered true if its result is nonzero.  If a class defines
   neither "__len__()" nor "__bool__()", all its instances are
   considered true.


Customizing attribute access
============================

The following methods can be defined to customize the meaning of
attribute access (use of, assignment to, or deletion of "x.name") for
class instances.

object.__getattr__(self, name)

   Called when the default attribute access fails with an
   "AttributeError" (either "__getattribute__()" raises an
   "AttributeError" because *name* is not an instance attribute or an
   attribute in the class tree for "self"; or "__get__()" of a *name*
   property raises "AttributeError").  This method should either
   return the (computed) attribute value or raise an "AttributeError"
   exception.

   Note that if the attribute is found through the normal mechanism,
   "__getattr__()" is not called.  (This is an intentional asymmetry
   between "__getattr__()" and "__setattr__()".) This is done both for
   efficiency reasons and because otherwise "__getattr__()" would have
   no way to access other attributes of the instance.  Note that at
   least for instance variables, you can fake total control by not
   inserting any values in the instance attribute dictionary (but
   instead inserting them in another object).  See the
   "__getattribute__()" method below for a way to actually get total
   control over attribute access.

object.__getattribute__(self, name)

   Called unconditionally to implement attribute accesses for
   instances of the class. If the class also defines "__getattr__()",
   the latter will not be called unless "__getattribute__()" either
   calls it explicitly or raises an "AttributeError". This method
   should return the (computed) attribute value or raise an
   "AttributeError" exception. In order to avoid infinite recursion in
   this method, its implementation should always call the base class
   method with the same name to access any attributes it needs, for
   example, "object.__getattribute__(self, name)".

   Note:

     This method may still be bypassed when looking up special methods
     as the result of implicit invocation via language syntax or
     built-in functions. See Special method lookup.

   For certain sensitive attribute accesses, raises an auditing event
   "object.__getattr__" with arguments "obj" and "name".

object.__setattr__(self, name, value)

   Called when an attribute assignment is attempted.  This is called
   instead of the normal mechanism (i.e. store the value in the
   instance dictionary). *name* is the attribute name, *value* is the
   value to be assigned to it.

   If "__setattr__()" wants to assign to an instance attribute, it
   should call the base class method with the same name, for example,
   "object.__setattr__(self, name, value)".

   For certain sensitive attribute assignments, raises an auditing
   event "object.__setattr__" with arguments "obj", "name", "value".

object.__delattr__(self, name)

   Like "__setattr__()" but for attribute deletion instead of
   assignment.  This should only be implemented if "del obj.name" is
   meaningful for the object.

   For certain sensitive attribute deletions, raises an auditing event
   "object.__delattr__" with arguments "obj" and "name".

object.__dir__(self)

   Called when "dir()" is called on the object. A sequence must be
   returned. "dir()" converts the returned sequence to a list and
   sorts it.


Customizing module attribute access
-----------------------------------

Special names "__getattr__" and "__dir__" can be also used to
customize access to module attributes. The "__getattr__" function at
the module level should accept one argument which is the name of an
attribute and return the computed value or raise an "AttributeError".
If an attribute is not found on a module object through the normal
lookup, i.e. "object.__getattribute__()", then "__getattr__" is
searched in the module "__dict__" before raising an "AttributeError".
If found, it is called with the attribute name and the result is
returned.

The "__dir__" function should accept no arguments, and return a
sequence of strings that represents the names accessible on module. If
present, this function overrides the standard "dir()" search on a
module.

For a more fine grained customization of the module behavior (setting
attributes, properties, etc.), one can set the "__class__" attribute
of a module object to a subclass of "types.ModuleType". For example:

   import sys
   from types import ModuleType

   class VerboseModule(ModuleType):
       def __repr__(self):
           return f'Verbose {self.__name__}'

       def __setattr__(self, attr, value):
           print(f'Setting {attr}...')
           super().__setattr__(attr, value)

   sys.modules[__name__].__class__ = VerboseModule

Note:

  Defining module "__getattr__" and setting module "__class__" only
  affect lookups made using the attribute access syntax – directly
  accessing the module globals (whether by code within the module, or
  via a reference to the module’s globals dictionary) is unaffected.

Changed in version 3.5: "__class__" module attribute is now writable.

New in version 3.7: "__getattr__" and "__dir__" module attributes.

See also:

  **PEP 562** - Module __getattr__ and __dir__
     Describes the "__getattr__" and "__dir__" functions on modules.


Implementing Descriptors
------------------------

The following methods only apply when an instance of the class
containing the method (a so-called *descriptor* class) appears in an
*owner* class (the descriptor must be in either the owner’s class
dictionary or in the class dictionary for one of its parents).  In the
examples below, “the attribute” refers to the attribute whose name is
the key of the property in the owner class’ "__dict__".

object.__get__(self, instance, owner=None)

   Called to get the attribute of the owner class (class attribute
   access) or of an instance of that class (instance attribute
   access). The optional *owner* argument is the owner class, while
   *instance* is the instance that the attribute was accessed through,
   or "None" when the attribute is accessed through the *owner*.

   This method should return the computed attribute value or raise an
   "AttributeError" exception.

   **PEP 252** specifies that "__get__()" is callable with one or two
   arguments.  Python’s own built-in descriptors support this
   specification; however, it is likely that some third-party tools
   have descriptors that require both arguments.  Python’s own
   "__getattribute__()" implementation always passes in both arguments
   whether they are required or not.

object.__set__(self, instance, value)

   Called to set the attribute on an instance *instance* of the owner
   class to a new value, *value*.

   Note, adding "__set__()" or "__delete__()" changes the kind of
   descriptor to a “data descriptor”.  See Invoking Descriptors for
   more details.

object.__delete__(self, instance)

   Called to delete the attribute on an instance *instance* of the
   owner class.

object.__set_name__(self, owner, name)

   Called at the time the owning class *owner* is created. The
   descriptor has been assigned to *name*.

   Note:

     "__set_name__()" is only called implicitly as part of the "type"
     constructor, so it will need to be called explicitly with the
     appropriate parameters when a descriptor is added to a class
     after initial creation:

        class A:
           pass
        descr = custom_descriptor()
        A.attr = descr
        descr.__set_name__(A, 'attr')

     See Creating the class object for more details.

   New in version 3.6.

The attribute "__objclass__" is interpreted by the "inspect" module as
specifying the class where this object was defined (setting this
appropriately can assist in runtime introspection of dynamic class
attributes). For callables, it may indicate that an instance of the
given type (or a subclass) is expected or required as the first
positional argument (for example, CPython sets this attribute for
unbound methods that are implemented in C).


Invoking Descriptors
--------------------

In general, a descriptor is an object attribute with “binding
behavior”, one whose attribute access has been overridden by methods
in the descriptor protocol:  "__get__()", "__set__()", and
"__delete__()". If any of those methods are defined for an object, it
is said to be a descriptor.

The default behavior for attribute access is to get, set, or delete
the attribute from an object’s dictionary. For instance, "a.x" has a
lookup chain starting with "a.__dict__['x']", then
"type(a).__dict__['x']", and continuing through the base classes of
"type(a)" excluding metaclasses.

However, if the looked-up value is an object defining one of the
descriptor methods, then Python may override the default behavior and
invoke the descriptor method instead.  Where this occurs in the
precedence chain depends on which descriptor methods were defined and
how they were called.

The starting point for descriptor invocation is a binding, "a.x". How
the arguments are assembled depends on "a":

Direct Call
   The simplest and least common call is when user code directly
   invokes a descriptor method:    "x.__get__(a)".

Instance Binding
   If binding to an object instance, "a.x" is transformed into the
   call: "type(a).__dict__['x'].__get__(a, type(a))".

Class Binding
   If binding to a class, "A.x" is transformed into the call:
   "A.__dict__['x'].__get__(None, A)".

Super Binding
   If "a" is an instance of "super", then the binding "super(B,
   obj).m()" searches "obj.__class__.__mro__" for the base class "A"
   immediately preceding "B" and then invokes the descriptor with the
   call: "A.__dict__['m'].__get__(obj, obj.__class__)".

For instance bindings, the precedence of descriptor invocation depends
on which descriptor methods are defined.  A descriptor can define any
combination of "__get__()", "__set__()" and "__delete__()".  If it
does not define "__get__()", then accessing the attribute will return
the descriptor object itself unless there is a value in the object’s
instance dictionary.  If the descriptor defines "__set__()" and/or
"__delete__()", it is a data descriptor; if it defines neither, it is
a non-data descriptor.  Normally, data descriptors define both
"__get__()" and "__set__()", while non-data descriptors have just the
"__get__()" method.  Data descriptors with "__set__()" and "__get__()"
defined always override a redefinition in an instance dictionary.  In
contrast, non-data descriptors can be overridden by instances.

Python methods (including "staticmethod()" and "classmethod()") are
implemented as non-data descriptors.  Accordingly, instances can
redefine and override methods.  This allows individual instances to
acquire behaviors that differ from other instances of the same class.

The "property()" function is implemented as a data descriptor.
Accordingly, instances cannot override the behavior of a property.


__slots__
---------

*__slots__* allow us to explicitly declare data members (like
properties) and deny the creation of *__dict__* and *__weakref__*
(unless explicitly declared in *__slots__* or available in a parent.)

The space saved over using *__dict__* can be significant. Attribute
lookup speed can be significantly improved as well.

object.__slots__

   This class variable can be assigned a string, iterable, or sequence
   of strings with variable names used by instances.  *__slots__*
   reserves space for the declared variables and prevents the
   automatic creation of *__dict__* and *__weakref__* for each
   instance.


Notes on using *__slots__*
~~~~~~~~~~~~~~~~~~~~~~~~~~

* When inheriting from a class without *__slots__*, the *__dict__* and
  *__weakref__* attribute of the instances will always be accessible.

* Without a *__dict__* variable, instances cannot be assigned new
  variables not listed in the *__slots__* definition.  Attempts to
  assign to an unlisted variable name raises "AttributeError". If
  dynamic assignment of new variables is desired, then add
  "'__dict__'" to the sequence of strings in the *__slots__*
  declaration.

* Without a *__weakref__* variable for each instance, classes defining
  *__slots__* do not support weak references to its instances. If weak
  reference support is needed, then add "'__weakref__'" to the
  sequence of strings in the *__slots__* declaration.

* *__slots__* are implemented at the class level by creating
  descriptors (Implementing Descriptors) for each variable name.  As a
  result, class attributes cannot be used to set default values for
  instance variables defined by *__slots__*; otherwise, the class
  attribute would overwrite the descriptor assignment.

* The action of a *__slots__* declaration is not limited to the class
  where it is defined.  *__slots__* declared in parents are available
  in child classes. However, child subclasses will get a *__dict__*
  and *__weakref__* unless they also define *__slots__* (which should
  only contain names of any *additional* slots).

* If a class defines a slot also defined in a base class, the instance
  variable defined by the base class slot is inaccessible (except by
  retrieving its descriptor directly from the base class). This
  renders the meaning of the program undefined.  In the future, a
  check may be added to prevent this.

* Nonempty *__slots__* does not work for classes derived from
  “variable-length” built-in types such as "int", "bytes" and "tuple".

* Any non-string iterable may be assigned to *__slots__*. Mappings may
  also be used; however, in the future, special meaning may be
  assigned to the values corresponding to each key.

* *__class__* assignment works only if both classes have the same
  *__slots__*.

* Multiple inheritance with multiple slotted parent classes can be
  used, but only one parent is allowed to have attributes created by
  slots (the other bases must have empty slot layouts) - violations
  raise "TypeError".

* If an iterator is used for *__slots__* then a descriptor is created
  for each of the iterator’s values. However, the *__slots__*
  attribute will be an empty iterator.


Customizing class creation
==========================

Whenever a class inherits from another class, *__init_subclass__* is
called on that class. This way, it is possible to write classes which
change the behavior of subclasses. This is closely related to class
decorators, but where class decorators only affect the specific class
they’re applied to, "__init_subclass__" solely applies to future
subclasses of the class defining the method.

classmethod object.__init_subclass__(cls)

   This method is called whenever the containing class is subclassed.
   *cls* is then the new subclass. If defined as a normal instance
   method, this method is implicitly converted to a class method.

   Keyword arguments which are given to a new class are passed to the
   parent’s class "__init_subclass__". For compatibility with other
   classes using "__init_subclass__", one should take out the needed
   keyword arguments and pass the others over to the base class, as
   in:

      class Philosopher:
          def __init_subclass__(cls, /, default_name, **kwargs):
              super().__init_subclass__(**kwargs)
              cls.default_name = default_name

      class AustralianPhilosopher(Philosopher, default_name="Bruce"):
          pass

   The default implementation "object.__init_subclass__" does nothing,
   but raises an error if it is called with any arguments.

   Note:

     The metaclass hint "metaclass" is consumed by the rest of the
     type machinery, and is never passed to "__init_subclass__"
     implementations. The actual metaclass (rather than the explicit
     hint) can be accessed as "type(cls)".

   New in version 3.6.


Metaclasses
-----------

By default, classes are constructed using "type()". The class body is
executed in a new namespace and the class name is bound locally to the
result of "type(name, bases, namespace)".

The class creation process can be customized by passing the
"metaclass" keyword argument in the class definition line, or by
inheriting from an existing class that included such an argument. In
the following example, both "MyClass" and "MySubclass" are instances
of "Meta":

   class Meta(type):
       pass

   class MyClass(metaclass=Meta):
       pass

   class MySubclass(MyClass):
       pass

Any other keyword arguments that are specified in the class definition
are passed through to all metaclass operations described below.

When a class definition is executed, the following steps occur:

* MRO entries are resolved;

* the appropriate metaclass is determined;

* the class namespace is prepared;

* the class body is executed;

* the class object is created.


Resolving MRO entries
---------------------

If a base that appears in class definition is not an instance of
"type", then an "__mro_entries__" method is searched on it. If found,
it is called with the original bases tuple. This method must return a
tuple of classes that will be used instead of this base. The tuple may
be empty, in such case the original base is ignored.

See also:

  **PEP 560** - Core support for typing module and generic types


Determining the appropriate metaclass
-------------------------------------

The appropriate metaclass for a class definition is determined as
follows:

* if no bases and no explicit metaclass are given, then "type()" is
  used;

* if an explicit metaclass is given and it is *not* an instance of
  "type()", then it is used directly as the metaclass;

* if an instance of "type()" is given as the explicit metaclass, or
  bases are defined, then the most derived metaclass is used.

The most derived metaclass is selected from the explicitly specified
metaclass (if any) and the metaclasses (i.e. "type(cls)") of all
specified base classes. The most derived metaclass is one which is a
subtype of *all* of these candidate metaclasses. If none of the
candidate metaclasses meets that criterion, then the class definition
will fail with "TypeError".


Preparing the class namespace
-----------------------------

Once the appropriate metaclass has been identified, then the class
namespace is prepared. If the metaclass has a "__prepare__" attribute,
it is called as "namespace = metaclass.__prepare__(name, bases,
**kwds)" (where the additional keyword arguments, if any, come from
the class definition). The "__prepare__" method should be implemented
as a "classmethod()". The namespace returned by "__prepare__" is
passed in to "__new__", but when the final class object is created the
namespace is copied into a new "dict".

If the metaclass has no "__prepare__" attribute, then the class
namespace is initialised as an empty ordered mapping.

See also:

  **PEP 3115** - Metaclasses in Python 3000
     Introduced the "__prepare__" namespace hook


Executing the class body
------------------------

The class body is executed (approximately) as "exec(body, globals(),
namespace)". The key difference from a normal call to "exec()" is that
lexical scoping allows the class body (including any methods) to
reference names from the current and outer scopes when the class
definition occurs inside a function.

However, even when the class definition occurs inside the function,
methods defined inside the class still cannot see names defined at the
class scope. Class variables must be accessed through the first
parameter of instance or class methods, or through the implicit
lexically scoped "__class__" reference described in the next section.


Creating the class object
-------------------------

Once the class namespace has been populated by executing the class
body, the class object is created by calling "metaclass(name, bases,
namespace, **kwds)" (the additional keywords passed here are the same
as those passed to "__prepare__").

This class object is the one that will be referenced by the zero-
argument form of "super()". "__class__" is an implicit closure
reference created by the compiler if any methods in a class body refer
to either "__class__" or "super". This allows the zero argument form
of "super()" to correctly identify the class being defined based on
lexical scoping, while the class or instance that was used to make the
current call is identified based on the first argument passed to the
method.

**CPython implementation detail:** In CPython 3.6 and later, the
"__class__" cell is passed to the metaclass as a "__classcell__" entry
in the class namespace. If present, this must be propagated up to the
"type.__new__" call in order for the class to be initialised
correctly. Failing to do so will result in a "RuntimeError" in Python
3.8.

When using the default metaclass "type", or any metaclass that
ultimately calls "type.__new__", the following additional
customisation steps are invoked after creating the class object:

* first, "type.__new__" collects all of the descriptors in the class
  namespace that define a "__set_name__()" method;

* second, all of these "__set_name__" methods are called with the
  class being defined and the assigned name of that particular
  descriptor;

* finally, the "__init_subclass__()" hook is called on the immediate
  parent of the new class in its method resolution order.

After the class object is created, it is passed to the class
decorators included in the class definition (if any) and the resulting
object is bound in the local namespace as the defined class.

When a new class is created by "type.__new__", the object provided as
the namespace parameter is copied to a new ordered mapping and the
original object is discarded. The new copy is wrapped in a read-only
proxy, which becomes the "__dict__" attribute of the class object.

See also:

  **PEP 3135** - New super
     Describes the implicit "__class__" closure reference


Uses for metaclasses
--------------------

The potential uses for metaclasses are boundless. Some ideas that have
been explored include enum, logging, interface checking, automatic
delegation, automatic property creation, proxies, frameworks, and
automatic resource locking/synchronization.


Customizing instance and subclass checks
========================================

The following methods are used to override the default behavior of the
"isinstance()" and "issubclass()" built-in functions.

In particular, the metaclass "abc.ABCMeta" implements these methods in
order to allow the addition of Abstract Base Classes (ABCs) as
“virtual base classes” to any class or type (including built-in
types), including other ABCs.

class.__instancecheck__(self, instance)

   Return true if *instance* should be considered a (direct or
   indirect) instance of *class*. If defined, called to implement
   "isinstance(instance, class)".

class.__subclasscheck__(self, subclass)

   Return true if *subclass* should be considered a (direct or
   indirect) subclass of *class*.  If defined, called to implement
   "issubclass(subclass, class)".

Note that these methods are looked up on the type (metaclass) of a
class.  They cannot be defined as class methods in the actual class.
This is consistent with the lookup of special methods that are called
on instances, only in this case the instance is itself a class.

See also:

  **PEP 3119** - Introducing Abstract Base Classes
     Includes the specification for customizing "isinstance()" and
     "issubclass()" behavior through "__instancecheck__()" and
     "__subclasscheck__()", with motivation for this functionality in
     the context of adding Abstract Base Classes (see the "abc"
     module) to the language.


Emulating generic types
=======================

One can implement the generic class syntax as specified by **PEP 484**
(for example "List[int]") by defining a special method:

classmethod object.__class_getitem__(cls, key)

   Return an object representing the specialization of a generic class
   by type arguments found in *key*.

This method is looked up on the class object itself, and when defined
in the class body, this method is implicitly a class method.  Note,
this mechanism is primarily reserved for use with static type hints,
other usage is discouraged.

See also:

  **PEP 560** - Core support for typing module and generic types


Emulating callable objects
==========================

object.__call__(self[, args...])

   Called when the instance is “called” as a function; if this method
   is defined, "x(arg1, arg2, ...)" roughly translates to
   "type(x).__call__(x, arg1, ...)".


Emulating container types
=========================

The following methods can be defined to implement container objects.
Containers usually are sequences (such as lists or tuples) or mappings
(like dictionaries), but can represent other containers as well.  The
first set of methods is used either to emulate a sequence or to
emulate a mapping; the difference is that for a sequence, the
allowable keys should be the integers *k* for which "0 <= k < N" where
*N* is the length of the sequence, or slice objects, which define a
range of items.  It is also recommended that mappings provide the
methods "keys()", "values()", "items()", "get()", "clear()",
"setdefault()", "pop()", "popitem()", "copy()", and "update()"
behaving similar to those for Python’s standard dictionary objects.
The "collections.abc" module provides a "MutableMapping" abstract base
class to help create those methods from a base set of "__getitem__()",
"__setitem__()", "__delitem__()", and "keys()". Mutable sequences
should provide methods "append()", "count()", "index()", "extend()",
"insert()", "pop()", "remove()", "reverse()" and "sort()", like Python
standard list objects.  Finally, sequence types should implement
addition (meaning concatenation) and multiplication (meaning
repetition) by defining the methods "__add__()", "__radd__()",
"__iadd__()", "__mul__()", "__rmul__()" and "__imul__()" described
below; they should not define other numerical operators.  It is
recommended that both mappings and sequences implement the
"__contains__()" method to allow efficient use of the "in" operator;
for mappings, "in" should search the mapping’s keys; for sequences, it
should search through the values.  It is further recommended that both
mappings and sequences implement the "__iter__()" method to allow
efficient iteration through the container; for mappings, "__iter__()"
should iterate through the object’s keys; for sequences, it should
iterate through the values.

object.__len__(self)

   Called to implement the built-in function "len()".  Should return
   the length of the object, an integer ">=" 0.  Also, an object that
   doesn’t define a "__bool__()" method and whose "__len__()" method
   returns zero is considered to be false in a Boolean context.

   **CPython implementation detail:** In CPython, the length is
   required to be at most "sys.maxsize". If the length is larger than
   "sys.maxsize" some features (such as "len()") may raise
   "OverflowError".  To prevent raising "OverflowError" by truth value
   testing, an object must define a "__bool__()" method.

object.__length_hint__(self)

   Called to implement "operator.length_hint()". Should return an
   estimated length for the object (which may be greater or less than
   the actual length). The length must be an integer ">=" 0. The
   return value may also be "NotImplemented", which is treated the
   same as if the "__length_hint__" method didn’t exist at all. This
   method is purely an optimization and is never required for
   correctness.

   New in version 3.4.

Note:

  Slicing is done exclusively with the following three methods.  A
  call like

     a[1:2] = b

  is translated to

     a[slice(1, 2, None)] = b

  and so forth.  Missing slice items are always filled in with "None".

object.__getitem__(self, key)

   Called to implement evaluation of "self[key]". For sequence types,
   the accepted keys should be integers and slice objects.  Note that
   the special interpretation of negative indexes (if the class wishes
   to emulate a sequence type) is up to the "__getitem__()" method. If
   *key* is of an inappropriate type, "TypeError" may be raised; if of
   a value outside the set of indexes for the sequence (after any
   special interpretation of negative values), "IndexError" should be
   raised. For mapping types, if *key* is missing (not in the
   container), "KeyError" should be raised.

   Note:

     "for" loops expect that an "IndexError" will be raised for
     illegal indexes to allow proper detection of the end of the
     sequence.

object.__setitem__(self, key, value)

   Called to implement assignment to "self[key]".  Same note as for
   "__getitem__()".  This should only be implemented for mappings if
   the objects support changes to the values for keys, or if new keys
   can be added, or for sequences if elements can be replaced.  The
   same exceptions should be raised for improper *key* values as for
   the "__getitem__()" method.

object.__delitem__(self, key)

   Called to implement deletion of "self[key]".  Same note as for
   "__getitem__()".  This should only be implemented for mappings if
   the objects support removal of keys, or for sequences if elements
   can be removed from the sequence.  The same exceptions should be
   raised for improper *key* values as for the "__getitem__()" method.

object.__missing__(self, key)

   Called by "dict"."__getitem__()" to implement "self[key]" for dict
   subclasses when key is not in the dictionary.

object.__iter__(self)

   This method is called when an iterator is required for a container.
   This method should return a new iterator object that can iterate
   over all the objects in the container.  For mappings, it should
   iterate over the keys of the container.

   Iterator objects also need to implement this method; they are
   required to return themselves.  For more information on iterator
   objects, see Iterator Types.

object.__reversed__(self)

   Called (if present) by the "reversed()" built-in to implement
   reverse iteration.  It should return a new iterator object that
   iterates over all the objects in the container in reverse order.

   If the "__reversed__()" method is not provided, the "reversed()"
   built-in will fall back to using the sequence protocol ("__len__()"
   and "__getitem__()").  Objects that support the sequence protocol
   should only provide "__reversed__()" if they can provide an
   implementation that is more efficient than the one provided by
   "reversed()".

The membership test operators ("in" and "not in") are normally
implemented as an iteration through a container. However, container
objects can supply the following special method with a more efficient
implementation, which also does not require the object be iterable.

object.__contains__(self, item)

   Called to implement membership test operators.  Should return true
   if *item* is in *self*, false otherwise.  For mapping objects, this
   should consider the keys of the mapping rather than the values or
   the key-item pairs.

   For objects that don’t define "__contains__()", the membership test
   first tries iteration via "__iter__()", then the old sequence
   iteration protocol via "__getitem__()", see this section in the
   language reference.


Emulating numeric types
=======================

The following methods can be defined to emulate numeric objects.
Methods corresponding to operations that are not supported by the
particular kind of number implemented (e.g., bitwise operations for
non-integral numbers) should be left undefined.

object.__add__(self, other)
object.__sub__(self, other)
object.__mul__(self, other)
object.__matmul__(self, other)
object.__truediv__(self, other)
object.__floordiv__(self, other)
object.__mod__(self, other)
object.__divmod__(self, other)
object.__pow__(self, other[, modulo])
object.__lshift__(self, other)
object.__rshift__(self, other)
object.__and__(self, other)
object.__xor__(self, other)
object.__or__(self, other)

   These methods are called to implement the binary arithmetic
   operations ("+", "-", "*", "@", "/", "//", "%", "divmod()",
   "pow()", "**", "<<", ">>", "&", "^", "|").  For instance, to
   evaluate the expression "x + y", where *x* is an instance of a
   class that has an "__add__()" method, "x.__add__(y)" is called.
   The "__divmod__()" method should be the equivalent to using
   "__floordiv__()" and "__mod__()"; it should not be related to
   "__truediv__()".  Note that "__pow__()" should be defined to accept
   an optional third argument if the ternary version of the built-in
   "pow()" function is to be supported.

   If one of those methods does not support the operation with the
   supplied arguments, it should return "NotImplemented".

object.__radd__(self, other)
object.__rsub__(self, other)
object.__rmul__(self, other)
object.__rmatmul__(self, other)
object.__rtruediv__(self, other)
object.__rfloordiv__(self, other)
object.__rmod__(self, other)
object.__rdivmod__(self, other)
object.__rpow__(self, other[, modulo])
object.__rlshift__(self, other)
object.__rrshift__(self, other)
object.__rand__(self, other)
object.__rxor__(self, other)
object.__ror__(self, other)

   These methods are called to implement the binary arithmetic
   operations ("+", "-", "*", "@", "/", "//", "%", "divmod()",
   "pow()", "**", "<<", ">>", "&", "^", "|") with reflected (swapped)
   operands.  These functions are only called if the left operand does
   not support the corresponding operation [3] and the operands are of
   different types. [4] For instance, to evaluate the expression "x -
   y", where *y* is an instance of a class that has an "__rsub__()"
   method, "y.__rsub__(x)" is called if "x.__sub__(y)" returns
   *NotImplemented*.

   Note that ternary "pow()" will not try calling "__rpow__()" (the
   coercion rules would become too complicated).

   Note:

     If the right operand’s type is a subclass of the left operand’s
     type and that subclass provides a different implementation of the
     reflected method for the operation, this method will be called
     before the left operand’s non-reflected method. This behavior
     allows subclasses to override their ancestors’ operations.

object.__iadd__(self, other)
object.__isub__(self, other)
object.__imul__(self, other)
object.__imatmul__(self, other)
object.__itruediv__(self, other)
object.__ifloordiv__(self, other)
object.__imod__(self, other)
object.__ipow__(self, other[, modulo])
object.__ilshift__(self, other)
object.__irshift__(self, other)
object.__iand__(self, other)
object.__ixor__(self, other)
object.__ior__(self, other)

   These methods are called to implement the augmented arithmetic
   assignments ("+=", "-=", "*=", "@=", "/=", "//=", "%=", "**=",
   "<<=", ">>=", "&=", "^=", "|=").  These methods should attempt to
   do the operation in-place (modifying *self*) and return the result
   (which could be, but does not have to be, *self*).  If a specific
   method is not defined, the augmented assignment falls back to the
   normal methods.  For instance, if *x* is an instance of a class
   with an "__iadd__()" method, "x += y" is equivalent to "x =
   x.__iadd__(y)" . Otherwise, "x.__add__(y)" and "y.__radd__(x)" are
   considered, as with the evaluation of "x + y". In certain
   situations, augmented assignment can result in unexpected errors
   (see Why does a_tuple[i] += [‘item’] raise an exception when the
   addition works?), but this behavior is in fact part of the data
   model.

   Note:

     Due to a bug in the dispatching mechanism for "**=", a class that
     defines "__ipow__()" but returns "NotImplemented" would fail to
     fall back to "x.__pow__(y)" and "y.__rpow__(x)". This bug is
     fixed in Python 3.10.

object.__neg__(self)
object.__pos__(self)
object.__abs__(self)
object.__invert__(self)

   Called to implement the unary arithmetic operations ("-", "+",
   "abs()" and "~").

object.__complex__(self)
object.__int__(self)
object.__float__(self)

   Called to implement the built-in functions "complex()", "int()" and
   "float()".  Should return a value of the appropriate type.

object.__index__(self)

   Called to implement "operator.index()", and whenever Python needs
   to losslessly convert the numeric object to an integer object (such
   as in slicing, or in the built-in "bin()", "hex()" and "oct()"
   functions). Presence of this method indicates that the numeric
   object is an integer type.  Must return an integer.

   If "__int__()", "__float__()" and "__complex__()" are not defined
   then corresponding built-in functions "int()", "float()" and
   "complex()" fall back to "__index__()".

object.__round__(self[, ndigits])
object.__trunc__(self)
object.__floor__(self)
object.__ceil__(self)

   Called to implement the built-in function "round()" and "math"
   functions "trunc()", "floor()" and "ceil()". Unless *ndigits* is
   passed to "__round__()" all these methods should return the value
   of the object truncated to an "Integral" (typically an "int").

   The built-in function "int()" falls back to "__trunc__()" if
   neither "__int__()" nor "__index__()" is defined.


With Statement Context Managers
===============================

A *context manager* is an object that defines the runtime context to
be established when executing a "with" statement. The context manager
handles the entry into, and the exit from, the desired runtime context
for the execution of the block of code.  Context managers are normally
invoked using the "with" statement (described in section The with
statement), but can also be used by directly invoking their methods.

Typical uses of context managers include saving and restoring various
kinds of global state, locking and unlocking resources, closing opened
files, etc.

For more information on context managers, see Context Manager Types.

object.__enter__(self)

   Enter the runtime context related to this object. The "with"
   statement will bind this method’s return value to the target(s)
   specified in the "as" clause of the statement, if any.

object.__exit__(self, exc_type, exc_value, traceback)

   Exit the runtime context related to this object. The parameters
   describe the exception that caused the context to be exited. If the
   context was exited without an exception, all three arguments will
   be "None".

   If an exception is supplied, and the method wishes to suppress the
   exception (i.e., prevent it from being propagated), it should
   return a true value. Otherwise, the exception will be processed
   normally upon exit from this method.

   Note that "__exit__()" methods should not reraise the passed-in
   exception; this is the caller’s responsibility.

See also:

  **PEP 343** - The “with” statement
     The specification, background, and examples for the Python "with"
     statement.


Special method lookup
=====================

For custom classes, implicit invocations of special methods are only
guaranteed to work correctly if defined on an object’s type, not in
the object’s instance dictionary.  That behaviour is the reason why
the following code raises an exception:

   >>> class C:
   ...     pass
   ...
   >>> c = C()
   >>> c.__len__ = lambda: 5
   >>> len(c)
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
   TypeError: object of type 'C' has no len()

The rationale behind this behaviour lies with a number of special
methods such as "__hash__()" and "__repr__()" that are implemented by
all objects, including type objects. If the implicit lookup of these
methods used the conventional lookup process, they would fail when
invoked on the type object itself:

   >>> 1 .__hash__() == hash(1)
   True
   >>> int.__hash__() == hash(int)
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
   TypeError: descriptor '__hash__' of 'int' object needs an argument

Incorrectly attempting to invoke an unbound method of a class in this
way is sometimes referred to as ‘metaclass confusion’, and is avoided
by bypassing the instance when looking up special methods:

   >>> type(1).__hash__(1) == hash(1)
   True
   >>> type(int).__hash__(int) == hash(int)
   True

In addition to bypassing any instance attributes in the interest of
correctness, implicit special method lookup generally also bypasses
the "__getattribute__()" method even of the object’s metaclass:

   >>> class Meta(type):
   ...     def __getattribute__(*args):
   ...         print("Metaclass getattribute invoked")
   ...         return type.__getattribute__(*args)
   ...
   >>> class C(object, metaclass=Meta):
   ...     def __len__(self):
   ...         return 10
   ...     def __getattribute__(*args):
   ...         print("Class getattribute invoked")
   ...         return object.__getattribute__(*args)
   ...
   >>> c = C()
   >>> c.__len__()                 # Explicit lookup via instance
   Class getattribute invoked
   10
   >>> type(c).__len__(c)          # Explicit lookup via type
   Metaclass getattribute invoked
   10
   >>> len(c)                      # Implicit lookup
   10

Bypassing the "__getattribute__()" machinery in this fashion provides
significant scope for speed optimisations within the interpreter, at
the cost of some flexibility in the handling of special methods (the
special method *must* be set on the class object itself in order to be
consistently invoked by the interpreter).
u�YString Methods
**************

Strings implement all of the common sequence operations, along with
the additional methods described below.

Strings also support two styles of string formatting, one providing a
large degree of flexibility and customization (see "str.format()",
Format String Syntax and Custom String Formatting) and the other based
on C "printf" style formatting that handles a narrower range of types
and is slightly harder to use correctly, but is often faster for the
cases it can handle (printf-style String Formatting).

The Text Processing Services section of the standard library covers a
number of other modules that provide various text related utilities
(including regular expression support in the "re" module).

str.capitalize()

   Return a copy of the string with its first character capitalized
   and the rest lowercased.

   Changed in version 3.8: The first character is now put into
   titlecase rather than uppercase. This means that characters like
   digraphs will only have their first letter capitalized, instead of
   the full character.

str.casefold()

   Return a casefolded copy of the string. Casefolded strings may be
   used for caseless matching.

   Casefolding is similar to lowercasing but more aggressive because
   it is intended to remove all case distinctions in a string. For
   example, the German lowercase letter "'ß'" is equivalent to ""ss"".
   Since it is already lowercase, "lower()" would do nothing to "'ß'";
   "casefold()" converts it to ""ss"".

   The casefolding algorithm is described in section 3.13 of the
   Unicode Standard.

   New in version 3.3.

str.center(width[, fillchar])

   Return centered in a string of length *width*. Padding is done
   using the specified *fillchar* (default is an ASCII space). The
   original string is returned if *width* is less than or equal to
   "len(s)".

str.count(sub[, start[, end]])

   Return the number of non-overlapping occurrences of substring *sub*
   in the range [*start*, *end*].  Optional arguments *start* and
   *end* are interpreted as in slice notation.

str.encode(encoding="utf-8", errors="strict")

   Return an encoded version of the string as a bytes object. Default
   encoding is "'utf-8'". *errors* may be given to set a different
   error handling scheme. The default for *errors* is "'strict'",
   meaning that encoding errors raise a "UnicodeError". Other possible
   values are "'ignore'", "'replace'", "'xmlcharrefreplace'",
   "'backslashreplace'" and any other name registered via
   "codecs.register_error()", see section Error Handlers. For a list
   of possible encodings, see section Standard Encodings.

   Changed in version 3.1: Support for keyword arguments added.

str.endswith(suffix[, start[, end]])

   Return "True" if the string ends with the specified *suffix*,
   otherwise return "False".  *suffix* can also be a tuple of suffixes
   to look for.  With optional *start*, test beginning at that
   position.  With optional *end*, stop comparing at that position.

str.expandtabs(tabsize=8)

   Return a copy of the string where all tab characters are replaced
   by one or more spaces, depending on the current column and the
   given tab size.  Tab positions occur every *tabsize* characters
   (default is 8, giving tab positions at columns 0, 8, 16 and so on).
   To expand the string, the current column is set to zero and the
   string is examined character by character.  If the character is a
   tab ("\t"), one or more space characters are inserted in the result
   until the current column is equal to the next tab position. (The
   tab character itself is not copied.)  If the character is a newline
   ("\n") or return ("\r"), it is copied and the current column is
   reset to zero.  Any other character is copied unchanged and the
   current column is incremented by one regardless of how the
   character is represented when printed.

   >>> '01\t012\t0123\t01234'.expandtabs()
   '01      012     0123    01234'
   >>> '01\t012\t0123\t01234'.expandtabs(4)
   '01  012 0123    01234'

str.find(sub[, start[, end]])

   Return the lowest index in the string where substring *sub* is
   found within the slice "s[start:end]".  Optional arguments *start*
   and *end* are interpreted as in slice notation.  Return "-1" if
   *sub* is not found.

   Note:

     The "find()" method should be used only if you need to know the
     position of *sub*.  To check if *sub* is a substring or not, use
     the "in" operator:

        >>> 'Py' in 'Python'
        True

str.format(*args, **kwargs)

   Perform a string formatting operation.  The string on which this
   method is called can contain literal text or replacement fields
   delimited by braces "{}".  Each replacement field contains either
   the numeric index of a positional argument, or the name of a
   keyword argument.  Returns a copy of the string where each
   replacement field is replaced with the string value of the
   corresponding argument.

   >>> "The sum of 1 + 2 is {0}".format(1+2)
   'The sum of 1 + 2 is 3'

   See Format String Syntax for a description of the various
   formatting options that can be specified in format strings.

   Note:

     When formatting a number ("int", "float", "complex",
     "decimal.Decimal" and subclasses) with the "n" type (ex:
     "'{:n}'.format(1234)"), the function temporarily sets the
     "LC_CTYPE" locale to the "LC_NUMERIC" locale to decode
     "decimal_point" and "thousands_sep" fields of "localeconv()" if
     they are non-ASCII or longer than 1 byte, and the "LC_NUMERIC"
     locale is different than the "LC_CTYPE" locale.  This temporary
     change affects other threads.

   Changed in version 3.7: When formatting a number with the "n" type,
   the function sets temporarily the "LC_CTYPE" locale to the
   "LC_NUMERIC" locale in some cases.

str.format_map(mapping)

   Similar to "str.format(**mapping)", except that "mapping" is used
   directly and not copied to a "dict".  This is useful if for example
   "mapping" is a dict subclass:

   >>> class Default(dict):
   ...     def __missing__(self, key):
   ...         return key
   ...
   >>> '{name} was born in {country}'.format_map(Default(name='Guido'))
   'Guido was born in country'

   New in version 3.2.

str.index(sub[, start[, end]])

   Like "find()", but raise "ValueError" when the substring is not
   found.

str.isalnum()

   Return "True" if all characters in the string are alphanumeric and
   there is at least one character, "False" otherwise.  A character
   "c" is alphanumeric if one of the following returns "True":
   "c.isalpha()", "c.isdecimal()", "c.isdigit()", or "c.isnumeric()".

str.isalpha()

   Return "True" if all characters in the string are alphabetic and
   there is at least one character, "False" otherwise.  Alphabetic
   characters are those characters defined in the Unicode character
   database as “Letter”, i.e., those with general category property
   being one of “Lm”, “Lt”, “Lu”, “Ll”, or “Lo”.  Note that this is
   different from the “Alphabetic” property defined in the Unicode
   Standard.

str.isascii()

   Return "True" if the string is empty or all characters in the
   string are ASCII, "False" otherwise. ASCII characters have code
   points in the range U+0000-U+007F.

   New in version 3.7.

str.isdecimal()

   Return "True" if all characters in the string are decimal
   characters and there is at least one character, "False" otherwise.
   Decimal characters are those that can be used to form numbers in
   base 10, e.g. U+0660, ARABIC-INDIC DIGIT ZERO.  Formally a decimal
   character is a character in the Unicode General Category “Nd”.

str.isdigit()

   Return "True" if all characters in the string are digits and there
   is at least one character, "False" otherwise.  Digits include
   decimal characters and digits that need special handling, such as
   the compatibility superscript digits. This covers digits which
   cannot be used to form numbers in base 10, like the Kharosthi
   numbers.  Formally, a digit is a character that has the property
   value Numeric_Type=Digit or Numeric_Type=Decimal.

str.isidentifier()

   Return "True" if the string is a valid identifier according to the
   language definition, section Identifiers and keywords.

   Call "keyword.iskeyword()" to test whether string "s" is a reserved
   identifier, such as "def" and "class".

   Example:

      >>> from keyword import iskeyword

      >>> 'hello'.isidentifier(), iskeyword('hello')
      True, False
      >>> 'def'.isidentifier(), iskeyword('def')
      True, True

str.islower()

   Return "True" if all cased characters [4] in the string are
   lowercase and there is at least one cased character, "False"
   otherwise.

str.isnumeric()

   Return "True" if all characters in the string are numeric
   characters, and there is at least one character, "False" otherwise.
   Numeric characters include digit characters, and all characters
   that have the Unicode numeric value property, e.g. U+2155, VULGAR
   FRACTION ONE FIFTH.  Formally, numeric characters are those with
   the property value Numeric_Type=Digit, Numeric_Type=Decimal or
   Numeric_Type=Numeric.

str.isprintable()

   Return "True" if all characters in the string are printable or the
   string is empty, "False" otherwise.  Nonprintable characters are
   those characters defined in the Unicode character database as
   “Other” or “Separator”, excepting the ASCII space (0x20) which is
   considered printable.  (Note that printable characters in this
   context are those which should not be escaped when "repr()" is
   invoked on a string.  It has no bearing on the handling of strings
   written to "sys.stdout" or "sys.stderr".)

str.isspace()

   Return "True" if there are only whitespace characters in the string
   and there is at least one character, "False" otherwise.

   A character is *whitespace* if in the Unicode character database
   (see "unicodedata"), either its general category is "Zs"
   (“Separator, space”), or its bidirectional class is one of "WS",
   "B", or "S".

str.istitle()

   Return "True" if the string is a titlecased string and there is at
   least one character, for example uppercase characters may only
   follow uncased characters and lowercase characters only cased ones.
   Return "False" otherwise.

str.isupper()

   Return "True" if all cased characters [4] in the string are
   uppercase and there is at least one cased character, "False"
   otherwise.

str.join(iterable)

   Return a string which is the concatenation of the strings in
   *iterable*. A "TypeError" will be raised if there are any non-
   string values in *iterable*, including "bytes" objects.  The
   separator between elements is the string providing this method.

str.ljust(width[, fillchar])

   Return the string left justified in a string of length *width*.
   Padding is done using the specified *fillchar* (default is an ASCII
   space). The original string is returned if *width* is less than or
   equal to "len(s)".

str.lower()

   Return a copy of the string with all the cased characters [4]
   converted to lowercase.

   The lowercasing algorithm used is described in section 3.13 of the
   Unicode Standard.

str.lstrip([chars])

   Return a copy of the string with leading characters removed.  The
   *chars* argument is a string specifying the set of characters to be
   removed.  If omitted or "None", the *chars* argument defaults to
   removing whitespace.  The *chars* argument is not a prefix; rather,
   all combinations of its values are stripped:

      >>> '   spacious   '.lstrip()
      'spacious   '
      >>> 'www.example.com'.lstrip('cmowz.')
      'example.com'

static str.maketrans(x[, y[, z]])

   This static method returns a translation table usable for
   "str.translate()".

   If there is only one argument, it must be a dictionary mapping
   Unicode ordinals (integers) or characters (strings of length 1) to
   Unicode ordinals, strings (of arbitrary lengths) or "None".
   Character keys will then be converted to ordinals.

   If there are two arguments, they must be strings of equal length,
   and in the resulting dictionary, each character in x will be mapped
   to the character at the same position in y.  If there is a third
   argument, it must be a string, whose characters will be mapped to
   "None" in the result.

str.partition(sep)

   Split the string at the first occurrence of *sep*, and return a
   3-tuple containing the part before the separator, the separator
   itself, and the part after the separator.  If the separator is not
   found, return a 3-tuple containing the string itself, followed by
   two empty strings.

str.replace(old, new[, count])

   Return a copy of the string with all occurrences of substring *old*
   replaced by *new*.  If the optional argument *count* is given, only
   the first *count* occurrences are replaced.

str.rfind(sub[, start[, end]])

   Return the highest index in the string where substring *sub* is
   found, such that *sub* is contained within "s[start:end]".
   Optional arguments *start* and *end* are interpreted as in slice
   notation.  Return "-1" on failure.

str.rindex(sub[, start[, end]])

   Like "rfind()" but raises "ValueError" when the substring *sub* is
   not found.

str.rjust(width[, fillchar])

   Return the string right justified in a string of length *width*.
   Padding is done using the specified *fillchar* (default is an ASCII
   space). The original string is returned if *width* is less than or
   equal to "len(s)".

str.rpartition(sep)

   Split the string at the last occurrence of *sep*, and return a
   3-tuple containing the part before the separator, the separator
   itself, and the part after the separator.  If the separator is not
   found, return a 3-tuple containing two empty strings, followed by
   the string itself.

str.rsplit(sep=None, maxsplit=-1)

   Return a list of the words in the string, using *sep* as the
   delimiter string. If *maxsplit* is given, at most *maxsplit* splits
   are done, the *rightmost* ones.  If *sep* is not specified or
   "None", any whitespace string is a separator.  Except for splitting
   from the right, "rsplit()" behaves like "split()" which is
   described in detail below.

str.rstrip([chars])

   Return a copy of the string with trailing characters removed.  The
   *chars* argument is a string specifying the set of characters to be
   removed.  If omitted or "None", the *chars* argument defaults to
   removing whitespace.  The *chars* argument is not a suffix; rather,
   all combinations of its values are stripped:

      >>> '   spacious   '.rstrip()
      '   spacious'
      >>> 'mississippi'.rstrip('ipz')
      'mississ'

str.split(sep=None, maxsplit=-1)

   Return a list of the words in the string, using *sep* as the
   delimiter string.  If *maxsplit* is given, at most *maxsplit*
   splits are done (thus, the list will have at most "maxsplit+1"
   elements).  If *maxsplit* is not specified or "-1", then there is
   no limit on the number of splits (all possible splits are made).

   If *sep* is given, consecutive delimiters are not grouped together
   and are deemed to delimit empty strings (for example,
   "'1,,2'.split(',')" returns "['1', '', '2']").  The *sep* argument
   may consist of multiple characters (for example,
   "'1<>2<>3'.split('<>')" returns "['1', '2', '3']"). Splitting an
   empty string with a specified separator returns "['']".

   For example:

      >>> '1,2,3'.split(',')
      ['1', '2', '3']
      >>> '1,2,3'.split(',', maxsplit=1)
      ['1', '2,3']
      >>> '1,2,,3,'.split(',')
      ['1', '2', '', '3', '']

   If *sep* is not specified or is "None", a different splitting
   algorithm is applied: runs of consecutive whitespace are regarded
   as a single separator, and the result will contain no empty strings
   at the start or end if the string has leading or trailing
   whitespace.  Consequently, splitting an empty string or a string
   consisting of just whitespace with a "None" separator returns "[]".

   For example:

      >>> '1 2 3'.split()
      ['1', '2', '3']
      >>> '1 2 3'.split(maxsplit=1)
      ['1', '2 3']
      >>> '   1   2   3   '.split()
      ['1', '2', '3']

str.splitlines([keepends])

   Return a list of the lines in the string, breaking at line
   boundaries.  Line breaks are not included in the resulting list
   unless *keepends* is given and true.

   This method splits on the following line boundaries.  In
   particular, the boundaries are a superset of *universal newlines*.

   +-------------------------+-------------------------------+
   | Representation          | Description                   |
   |=========================|===============================|
   | "\n"                    | Line Feed                     |
   +-------------------------+-------------------------------+
   | "\r"                    | Carriage Return               |
   +-------------------------+-------------------------------+
   | "\r\n"                  | Carriage Return + Line Feed   |
   +-------------------------+-------------------------------+
   | "\v" or "\x0b"          | Line Tabulation               |
   +-------------------------+-------------------------------+
   | "\f" or "\x0c"          | Form Feed                     |
   +-------------------------+-------------------------------+
   | "\x1c"                  | File Separator                |
   +-------------------------+-------------------------------+
   | "\x1d"                  | Group Separator               |
   +-------------------------+-------------------------------+
   | "\x1e"                  | Record Separator              |
   +-------------------------+-------------------------------+
   | "\x85"                  | Next Line (C1 Control Code)   |
   +-------------------------+-------------------------------+
   | "\u2028"                | Line Separator                |
   +-------------------------+-------------------------------+
   | "\u2029"                | Paragraph Separator           |
   +-------------------------+-------------------------------+

   Changed in version 3.2: "\v" and "\f" added to list of line
   boundaries.

   For example:

      >>> 'ab c\n\nde fg\rkl\r\n'.splitlines()
      ['ab c', '', 'de fg', 'kl']
      >>> 'ab c\n\nde fg\rkl\r\n'.splitlines(keepends=True)
      ['ab c\n', '\n', 'de fg\r', 'kl\r\n']

   Unlike "split()" when a delimiter string *sep* is given, this
   method returns an empty list for the empty string, and a terminal
   line break does not result in an extra line:

      >>> "".splitlines()
      []
      >>> "One line\n".splitlines()
      ['One line']

   For comparison, "split('\n')" gives:

      >>> ''.split('\n')
      ['']
      >>> 'Two lines\n'.split('\n')
      ['Two lines', '']

str.startswith(prefix[, start[, end]])

   Return "True" if string starts with the *prefix*, otherwise return
   "False". *prefix* can also be a tuple of prefixes to look for.
   With optional *start*, test string beginning at that position.
   With optional *end*, stop comparing string at that position.

str.strip([chars])

   Return a copy of the string with the leading and trailing
   characters removed. The *chars* argument is a string specifying the
   set of characters to be removed. If omitted or "None", the *chars*
   argument defaults to removing whitespace. The *chars* argument is
   not a prefix or suffix; rather, all combinations of its values are
   stripped:

      >>> '   spacious   '.strip()
      'spacious'
      >>> 'www.example.com'.strip('cmowz.')
      'example'

   The outermost leading and trailing *chars* argument values are
   stripped from the string. Characters are removed from the leading
   end until reaching a string character that is not contained in the
   set of characters in *chars*. A similar action takes place on the
   trailing end. For example:

      >>> comment_string = '#....... Section 3.2.1 Issue #32 .......'
      >>> comment_string.strip('.#! ')
      'Section 3.2.1 Issue #32'

str.swapcase()

   Return a copy of the string with uppercase characters converted to
   lowercase and vice versa. Note that it is not necessarily true that
   "s.swapcase().swapcase() == s".

str.title()

   Return a titlecased version of the string where words start with an
   uppercase character and the remaining characters are lowercase.

   For example:

      >>> 'Hello world'.title()
      'Hello World'

   The algorithm uses a simple language-independent definition of a
   word as groups of consecutive letters.  The definition works in
   many contexts but it means that apostrophes in contractions and
   possessives form word boundaries, which may not be the desired
   result:

      >>> "they're bill's friends from the UK".title()
      "They'Re Bill'S Friends From The Uk"

   A workaround for apostrophes can be constructed using regular
   expressions:

      >>> import re
      >>> def titlecase(s):
      ...     return re.sub(r"[A-Za-z]+('[A-Za-z]+)?",
      ...                   lambda mo: mo.group(0).capitalize(),
      ...                   s)
      ...
      >>> titlecase("they're bill's friends.")
      "They're Bill's Friends."

str.translate(table)

   Return a copy of the string in which each character has been mapped
   through the given translation table.  The table must be an object
   that implements indexing via "__getitem__()", typically a *mapping*
   or *sequence*.  When indexed by a Unicode ordinal (an integer), the
   table object can do any of the following: return a Unicode ordinal
   or a string, to map the character to one or more other characters;
   return "None", to delete the character from the return string; or
   raise a "LookupError" exception, to map the character to itself.

   You can use "str.maketrans()" to create a translation map from
   character-to-character mappings in different formats.

   See also the "codecs" module for a more flexible approach to custom
   character mappings.

str.upper()

   Return a copy of the string with all the cased characters [4]
   converted to uppercase.  Note that "s.upper().isupper()" might be
   "False" if "s" contains uncased characters or if the Unicode
   category of the resulting character(s) is not “Lu” (Letter,
   uppercase), but e.g. “Lt” (Letter, titlecase).

   The uppercasing algorithm used is described in section 3.13 of the
   Unicode Standard.

str.zfill(width)

   Return a copy of the string left filled with ASCII "'0'" digits to
   make a string of length *width*. A leading sign prefix
   ("'+'"/"'-'") is handled by inserting the padding *after* the sign
   character rather than before. The original string is returned if
   *width* is less than or equal to "len(s)".

   For example:

      >>> "42".zfill(5)
      '00042'
      >>> "-42".zfill(5)
      '-0042'
u� String and Bytes literals
*************************

String literals are described by the following lexical definitions:

   stringliteral   ::= [stringprefix](shortstring | longstring)
   stringprefix    ::= "r" | "u" | "R" | "U" | "f" | "F"
                    | "fr" | "Fr" | "fR" | "FR" | "rf" | "rF" | "Rf" | "RF"
   shortstring     ::= "'" shortstringitem* "'" | '"' shortstringitem* '"'
   longstring      ::= "'''" longstringitem* "'''" | '"""' longstringitem* '"""'
   shortstringitem ::= shortstringchar | stringescapeseq
   longstringitem  ::= longstringchar | stringescapeseq
   shortstringchar ::= <any source character except "\" or newline or the quote>
   longstringchar  ::= <any source character except "\">
   stringescapeseq ::= "\" <any source character>

   bytesliteral   ::= bytesprefix(shortbytes | longbytes)
   bytesprefix    ::= "b" | "B" | "br" | "Br" | "bR" | "BR" | "rb" | "rB" | "Rb" | "RB"
   shortbytes     ::= "'" shortbytesitem* "'" | '"' shortbytesitem* '"'
   longbytes      ::= "'''" longbytesitem* "'''" | '"""' longbytesitem* '"""'
   shortbytesitem ::= shortbyteschar | bytesescapeseq
   longbytesitem  ::= longbyteschar | bytesescapeseq
   shortbyteschar ::= <any ASCII character except "\" or newline or the quote>
   longbyteschar  ::= <any ASCII character except "\">
   bytesescapeseq ::= "\" <any ASCII character>

One syntactic restriction not indicated by these productions is that
whitespace is not allowed between the "stringprefix" or "bytesprefix"
and the rest of the literal. The source character set is defined by
the encoding declaration; it is UTF-8 if no encoding declaration is
given in the source file; see section Encoding declarations.

In plain English: Both types of literals can be enclosed in matching
single quotes ("'") or double quotes (""").  They can also be enclosed
in matching groups of three single or double quotes (these are
generally referred to as *triple-quoted strings*).  The backslash
("\") character is used to escape characters that otherwise have a
special meaning, such as newline, backslash itself, or the quote
character.

Bytes literals are always prefixed with "'b'" or "'B'"; they produce
an instance of the "bytes" type instead of the "str" type.  They may
only contain ASCII characters; bytes with a numeric value of 128 or
greater must be expressed with escapes.

Both string and bytes literals may optionally be prefixed with a
letter "'r'" or "'R'"; such strings are called *raw strings* and treat
backslashes as literal characters.  As a result, in string literals,
"'\U'" and "'\u'" escapes in raw strings are not treated specially.
Given that Python 2.x’s raw unicode literals behave differently than
Python 3.x’s the "'ur'" syntax is not supported.

New in version 3.3: The "'rb'" prefix of raw bytes literals has been
added as a synonym of "'br'".

New in version 3.3: Support for the unicode legacy literal
("u'value'") was reintroduced to simplify the maintenance of dual
Python 2.x and 3.x codebases. See **PEP 414** for more information.

A string literal with "'f'" or "'F'" in its prefix is a *formatted
string literal*; see Formatted string literals.  The "'f'" may be
combined with "'r'", but not with "'b'" or "'u'", therefore raw
formatted strings are possible, but formatted bytes literals are not.

In triple-quoted literals, unescaped newlines and quotes are allowed
(and are retained), except that three unescaped quotes in a row
terminate the literal.  (A “quote” is the character used to open the
literal, i.e. either "'" or """.)

Unless an "'r'" or "'R'" prefix is present, escape sequences in string
and bytes literals are interpreted according to rules similar to those
used by Standard C.  The recognized escape sequences are:

+-------------------+-----------------------------------+---------+
| Escape Sequence   | Meaning                           | Notes   |
|===================|===================================|=========|
| "\newline"        | Backslash and newline ignored     |         |
+-------------------+-----------------------------------+---------+
| "\\"              | Backslash ("\")                   |         |
+-------------------+-----------------------------------+---------+
| "\'"              | Single quote ("'")                |         |
+-------------------+-----------------------------------+---------+
| "\""              | Double quote (""")                |         |
+-------------------+-----------------------------------+---------+
| "\a"              | ASCII Bell (BEL)                  |         |
+-------------------+-----------------------------------+---------+
| "\b"              | ASCII Backspace (BS)              |         |
+-------------------+-----------------------------------+---------+
| "\f"              | ASCII Formfeed (FF)               |         |
+-------------------+-----------------------------------+---------+
| "\n"              | ASCII Linefeed (LF)               |         |
+-------------------+-----------------------------------+---------+
| "\r"              | ASCII Carriage Return (CR)        |         |
+-------------------+-----------------------------------+---------+
| "\t"              | ASCII Horizontal Tab (TAB)        |         |
+-------------------+-----------------------------------+---------+
| "\v"              | ASCII Vertical Tab (VT)           |         |
+-------------------+-----------------------------------+---------+
| "\ooo"            | Character with octal value *ooo*  | (1,3)   |
+-------------------+-----------------------------------+---------+
| "\xhh"            | Character with hex value *hh*     | (2,3)   |
+-------------------+-----------------------------------+---------+

Escape sequences only recognized in string literals are:

+-------------------+-----------------------------------+---------+
| Escape Sequence   | Meaning                           | Notes   |
|===================|===================================|=========|
| "\N{name}"        | Character named *name* in the     | (4)     |
|                   | Unicode database                  |         |
+-------------------+-----------------------------------+---------+
| "\uxxxx"          | Character with 16-bit hex value   | (5)     |
|                   | *xxxx*                            |         |
+-------------------+-----------------------------------+---------+
| "\Uxxxxxxxx"      | Character with 32-bit hex value   | (6)     |
|                   | *xxxxxxxx*                        |         |
+-------------------+-----------------------------------+---------+

Notes:

1. As in Standard C, up to three octal digits are accepted.

2. Unlike in Standard C, exactly two hex digits are required.

3. In a bytes literal, hexadecimal and octal escapes denote the byte
   with the given value. In a string literal, these escapes denote a
   Unicode character with the given value.

4. Changed in version 3.3: Support for name aliases [1] has been
   added.

5. Exactly four hex digits are required.

6. Any Unicode character can be encoded this way.  Exactly eight hex
   digits are required.

Unlike Standard C, all unrecognized escape sequences are left in the
string unchanged, i.e., *the backslash is left in the result*.  (This
behavior is useful when debugging: if an escape sequence is mistyped,
the resulting output is more easily recognized as broken.)  It is also
important to note that the escape sequences only recognized in string
literals fall into the category of unrecognized escapes for bytes
literals.

   Changed in version 3.6: Unrecognized escape sequences produce a
   "DeprecationWarning".  In a future Python version they will be a
   "SyntaxWarning" and eventually a "SyntaxError".

Even in a raw literal, quotes can be escaped with a backslash, but the
backslash remains in the result; for example, "r"\""" is a valid
string literal consisting of two characters: a backslash and a double
quote; "r"\"" is not a valid string literal (even a raw string cannot
end in an odd number of backslashes).  Specifically, *a raw literal
cannot end in a single backslash* (since the backslash would escape
the following quote character).  Note also that a single backslash
followed by a newline is interpreted as those two characters as part
of the literal, *not* as a line continuation.
uMSubscriptions
*************

A subscription selects an item of a sequence (string, tuple or list)
or mapping (dictionary) object:

   subscription ::= primary "[" expression_list "]"

The primary must evaluate to an object that supports subscription
(lists or dictionaries for example).  User-defined objects can support
subscription by defining a "__getitem__()" method.

For built-in objects, there are two types of objects that support
subscription:

If the primary is a mapping, the expression list must evaluate to an
object whose value is one of the keys of the mapping, and the
subscription selects the value in the mapping that corresponds to that
key.  (The expression list is a tuple except if it has exactly one
item.)

If the primary is a sequence, the expression list must evaluate to an
integer or a slice (as discussed in the following section).

The formal syntax makes no special provision for negative indices in
sequences; however, built-in sequences all provide a "__getitem__()"
method that interprets negative indices by adding the length of the
sequence to the index (so that "x[-1]" selects the last item of "x").
The resulting value must be a nonnegative integer less than the number
of items in the sequence, and the subscription selects the item whose
index is that value (counting from zero). Since the support for
negative indices and slicing occurs in the object’s "__getitem__()"
method, subclasses overriding this method will need to explicitly add
that support.

A string’s items are characters.  A character is not a separate data
type but a string of exactly one character.
axTruth Value Testing
*******************

Any object can be tested for truth value, for use in an "if" or
"while" condition or as operand of the Boolean operations below.

By default, an object is considered true unless its class defines
either a "__bool__()" method that returns "False" or a "__len__()"
method that returns zero, when called with the object. [1]  Here are
most of the built-in objects considered false:

* constants defined to be false: "None" and "False".

* zero of any numeric type: "0", "0.0", "0j", "Decimal(0)",
  "Fraction(0, 1)"

* empty sequences and collections: "''", "()", "[]", "{}", "set()",
  "range(0)"

Operations and built-in functions that have a Boolean result always
return "0" or "False" for false and "1" or "True" for true, unless
otherwise stated. (Important exception: the Boolean operations "or"
and "and" always return one of their operands.)
uRThe "try" statement
*******************

The "try" statement specifies exception handlers and/or cleanup code
for a group of statements:

   try_stmt  ::= try1_stmt | try2_stmt
   try1_stmt ::= "try" ":" suite
                 ("except" [expression ["as" identifier]] ":" suite)+
                 ["else" ":" suite]
                 ["finally" ":" suite]
   try2_stmt ::= "try" ":" suite
                 "finally" ":" suite

The "except" clause(s) specify one or more exception handlers. When no
exception occurs in the "try" clause, no exception handler is
executed. When an exception occurs in the "try" suite, a search for an
exception handler is started.  This search inspects the except clauses
in turn until one is found that matches the exception.  An expression-
less except clause, if present, must be last; it matches any
exception.  For an except clause with an expression, that expression
is evaluated, and the clause matches the exception if the resulting
object is “compatible” with the exception.  An object is compatible
with an exception if it is the class or a base class of the exception
object, or a tuple containing an item that is the class or a base
class of the exception object.

If no except clause matches the exception, the search for an exception
handler continues in the surrounding code and on the invocation stack.
[1]

If the evaluation of an expression in the header of an except clause
raises an exception, the original search for a handler is canceled and
a search starts for the new exception in the surrounding code and on
the call stack (it is treated as if the entire "try" statement raised
the exception).

When a matching except clause is found, the exception is assigned to
the target specified after the "as" keyword in that except clause, if
present, and the except clause’s suite is executed.  All except
clauses must have an executable block.  When the end of this block is
reached, execution continues normally after the entire try statement.
(This means that if two nested handlers exist for the same exception,
and the exception occurs in the try clause of the inner handler, the
outer handler will not handle the exception.)

When an exception has been assigned using "as target", it is cleared
at the end of the except clause.  This is as if

   except E as N:
       foo

was translated to

   except E as N:
       try:
           foo
       finally:
           del N

This means the exception must be assigned to a different name to be
able to refer to it after the except clause.  Exceptions are cleared
because with the traceback attached to them, they form a reference
cycle with the stack frame, keeping all locals in that frame alive
until the next garbage collection occurs.

Before an except clause’s suite is executed, details about the
exception are stored in the "sys" module and can be accessed via
"sys.exc_info()". "sys.exc_info()" returns a 3-tuple consisting of the
exception class, the exception instance and a traceback object (see
section The standard type hierarchy) identifying the point in the
program where the exception occurred.  "sys.exc_info()" values are
restored to their previous values (before the call) when returning
from a function that handled an exception.

The optional "else" clause is executed if the control flow leaves the
"try" suite, no exception was raised, and no "return", "continue", or
"break" statement was executed.  Exceptions in the "else" clause are
not handled by the preceding "except" clauses.

If "finally" is present, it specifies a ‘cleanup’ handler.  The "try"
clause is executed, including any "except" and "else" clauses.  If an
exception occurs in any of the clauses and is not handled, the
exception is temporarily saved. The "finally" clause is executed.  If
there is a saved exception it is re-raised at the end of the "finally"
clause.  If the "finally" clause raises another exception, the saved
exception is set as the context of the new exception. If the "finally"
clause executes a "return", "break" or "continue" statement, the saved
exception is discarded:

   >>> def f():
   ...     try:
   ...         1/0
   ...     finally:
   ...         return 42
   ...
   >>> f()
   42

The exception information is not available to the program during
execution of the "finally" clause.

When a "return", "break" or "continue" statement is executed in the
"try" suite of a "try"…"finally" statement, the "finally" clause is
also executed ‘on the way out.’

The return value of a function is determined by the last "return"
statement executed.  Since the "finally" clause always executes, a
"return" statement executed in the "finally" clause will always be the
last one executed:

   >>> def foo():
   ...     try:
   ...         return 'try'
   ...     finally:
   ...         return 'finally'
   ...
   >>> foo()
   'finally'

Additional information on exceptions can be found in section
Exceptions, and information on using the "raise" statement to generate
exceptions may be found in section The raise statement.

Changed in version 3.8: Prior to Python 3.8, a "continue" statement
was illegal in the "finally" clause due to a problem with the
implementation.
ux�The standard type hierarchy
***************************

Below is a list of the types that are built into Python.  Extension
modules (written in C, Java, or other languages, depending on the
implementation) can define additional types.  Future versions of
Python may add types to the type hierarchy (e.g., rational numbers,
efficiently stored arrays of integers, etc.), although such additions
will often be provided via the standard library instead.

Some of the type descriptions below contain a paragraph listing
‘special attributes.’  These are attributes that provide access to the
implementation and are not intended for general use.  Their definition
may change in the future.

None
   This type has a single value.  There is a single object with this
   value. This object is accessed through the built-in name "None". It
   is used to signify the absence of a value in many situations, e.g.,
   it is returned from functions that don’t explicitly return
   anything. Its truth value is false.

NotImplemented
   This type has a single value.  There is a single object with this
   value. This object is accessed through the built-in name
   "NotImplemented". Numeric methods and rich comparison methods
   should return this value if they do not implement the operation for
   the operands provided.  (The interpreter will then try the
   reflected operation, or some other fallback, depending on the
   operator.)  Its truth value is true.

   See Implementing the arithmetic operations for more details.

Ellipsis
   This type has a single value.  There is a single object with this
   value. This object is accessed through the literal "..." or the
   built-in name "Ellipsis".  Its truth value is true.

"numbers.Number"
   These are created by numeric literals and returned as results by
   arithmetic operators and arithmetic built-in functions.  Numeric
   objects are immutable; once created their value never changes.
   Python numbers are of course strongly related to mathematical
   numbers, but subject to the limitations of numerical representation
   in computers.

   The string representations of the numeric classes, computed by
   "__repr__()" and "__str__()", have the following properties:

   * They are valid numeric literals which, when passed to their class
     constructor, produce an object having the value of the original
     numeric.

   * The representation is in base 10, when possible.

   * Leading zeros, possibly excepting a single zero before a decimal
     point, are not shown.

   * Trailing zeros, possibly excepting a single zero after a decimal
     point, are not shown.

   * A sign is shown only when the number is negative.

   Python distinguishes between integers, floating point numbers, and
   complex numbers:

   "numbers.Integral"
      These represent elements from the mathematical set of integers
      (positive and negative).

      There are two types of integers:

      Integers ("int")
         These represent numbers in an unlimited range, subject to
         available (virtual) memory only.  For the purpose of shift
         and mask operations, a binary representation is assumed, and
         negative numbers are represented in a variant of 2’s
         complement which gives the illusion of an infinite string of
         sign bits extending to the left.

      Booleans ("bool")
         These represent the truth values False and True.  The two
         objects representing the values "False" and "True" are the
         only Boolean objects. The Boolean type is a subtype of the
         integer type, and Boolean values behave like the values 0 and
         1, respectively, in almost all contexts, the exception being
         that when converted to a string, the strings ""False"" or
         ""True"" are returned, respectively.

      The rules for integer representation are intended to give the
      most meaningful interpretation of shift and mask operations
      involving negative integers.

   "numbers.Real" ("float")
      These represent machine-level double precision floating point
      numbers. You are at the mercy of the underlying machine
      architecture (and C or Java implementation) for the accepted
      range and handling of overflow. Python does not support single-
      precision floating point numbers; the savings in processor and
      memory usage that are usually the reason for using these are
      dwarfed by the overhead of using objects in Python, so there is
      no reason to complicate the language with two kinds of floating
      point numbers.

   "numbers.Complex" ("complex")
      These represent complex numbers as a pair of machine-level
      double precision floating point numbers.  The same caveats apply
      as for floating point numbers. The real and imaginary parts of a
      complex number "z" can be retrieved through the read-only
      attributes "z.real" and "z.imag".

Sequences
   These represent finite ordered sets indexed by non-negative
   numbers. The built-in function "len()" returns the number of items
   of a sequence. When the length of a sequence is *n*, the index set
   contains the numbers 0, 1, …, *n*-1.  Item *i* of sequence *a* is
   selected by "a[i]".

   Sequences also support slicing: "a[i:j]" selects all items with
   index *k* such that *i* "<=" *k* "<" *j*.  When used as an
   expression, a slice is a sequence of the same type.  This implies
   that the index set is renumbered so that it starts at 0.

   Some sequences also support “extended slicing” with a third “step”
   parameter: "a[i:j:k]" selects all items of *a* with index *x* where
   "x = i + n*k", *n* ">=" "0" and *i* "<=" *x* "<" *j*.

   Sequences are distinguished according to their mutability:

   Immutable sequences
      An object of an immutable sequence type cannot change once it is
      created.  (If the object contains references to other objects,
      these other objects may be mutable and may be changed; however,
      the collection of objects directly referenced by an immutable
      object cannot change.)

      The following types are immutable sequences:

      Strings
         A string is a sequence of values that represent Unicode code
         points. All the code points in the range "U+0000 - U+10FFFF"
         can be represented in a string.  Python doesn’t have a "char"
         type; instead, every code point in the string is represented
         as a string object with length "1".  The built-in function
         "ord()" converts a code point from its string form to an
         integer in the range "0 - 10FFFF"; "chr()" converts an
         integer in the range "0 - 10FFFF" to the corresponding length
         "1" string object. "str.encode()" can be used to convert a
         "str" to "bytes" using the given text encoding, and
         "bytes.decode()" can be used to achieve the opposite.

      Tuples
         The items of a tuple are arbitrary Python objects. Tuples of
         two or more items are formed by comma-separated lists of
         expressions.  A tuple of one item (a ‘singleton’) can be
         formed by affixing a comma to an expression (an expression by
         itself does not create a tuple, since parentheses must be
         usable for grouping of expressions).  An empty tuple can be
         formed by an empty pair of parentheses.

      Bytes
         A bytes object is an immutable array.  The items are 8-bit
         bytes, represented by integers in the range 0 <= x < 256.
         Bytes literals (like "b'abc'") and the built-in "bytes()"
         constructor can be used to create bytes objects.  Also, bytes
         objects can be decoded to strings via the "decode()" method.

   Mutable sequences
      Mutable sequences can be changed after they are created.  The
      subscription and slicing notations can be used as the target of
      assignment and "del" (delete) statements.

      There are currently two intrinsic mutable sequence types:

      Lists
         The items of a list are arbitrary Python objects.  Lists are
         formed by placing a comma-separated list of expressions in
         square brackets. (Note that there are no special cases needed
         to form lists of length 0 or 1.)

      Byte Arrays
         A bytearray object is a mutable array. They are created by
         the built-in "bytearray()" constructor.  Aside from being
         mutable (and hence unhashable), byte arrays otherwise provide
         the same interface and functionality as immutable "bytes"
         objects.

      The extension module "array" provides an additional example of a
      mutable sequence type, as does the "collections" module.

Set types
   These represent unordered, finite sets of unique, immutable
   objects. As such, they cannot be indexed by any subscript. However,
   they can be iterated over, and the built-in function "len()"
   returns the number of items in a set. Common uses for sets are fast
   membership testing, removing duplicates from a sequence, and
   computing mathematical operations such as intersection, union,
   difference, and symmetric difference.

   For set elements, the same immutability rules apply as for
   dictionary keys. Note that numeric types obey the normal rules for
   numeric comparison: if two numbers compare equal (e.g., "1" and
   "1.0"), only one of them can be contained in a set.

   There are currently two intrinsic set types:

   Sets
      These represent a mutable set. They are created by the built-in
      "set()" constructor and can be modified afterwards by several
      methods, such as "add()".

   Frozen sets
      These represent an immutable set.  They are created by the
      built-in "frozenset()" constructor.  As a frozenset is immutable
      and *hashable*, it can be used again as an element of another
      set, or as a dictionary key.

Mappings
   These represent finite sets of objects indexed by arbitrary index
   sets. The subscript notation "a[k]" selects the item indexed by "k"
   from the mapping "a"; this can be used in expressions and as the
   target of assignments or "del" statements. The built-in function
   "len()" returns the number of items in a mapping.

   There is currently a single intrinsic mapping type:

   Dictionaries
      These represent finite sets of objects indexed by nearly
      arbitrary values.  The only types of values not acceptable as
      keys are values containing lists or dictionaries or other
      mutable types that are compared by value rather than by object
      identity, the reason being that the efficient implementation of
      dictionaries requires a key’s hash value to remain constant.
      Numeric types used for keys obey the normal rules for numeric
      comparison: if two numbers compare equal (e.g., "1" and "1.0")
      then they can be used interchangeably to index the same
      dictionary entry.

      Dictionaries preserve insertion order, meaning that keys will be
      produced in the same order they were added sequentially over the
      dictionary. Replacing an existing key does not change the order,
      however removing a key and re-inserting it will add it to the
      end instead of keeping its old place.

      Dictionaries are mutable; they can be created by the "{...}"
      notation (see section Dictionary displays).

      The extension modules "dbm.ndbm" and "dbm.gnu" provide
      additional examples of mapping types, as does the "collections"
      module.

      Changed in version 3.7: Dictionaries did not preserve insertion
      order in versions of Python before 3.6. In CPython 3.6,
      insertion order was preserved, but it was considered an
      implementation detail at that time rather than a language
      guarantee.

Callable types
   These are the types to which the function call operation (see
   section Calls) can be applied:

   User-defined functions
      A user-defined function object is created by a function
      definition (see section Function definitions).  It should be
      called with an argument list containing the same number of items
      as the function’s formal parameter list.

      Special attributes:

      +---------------------------+---------------------------------+-------------+
      | Attribute                 | Meaning                         |             |
      |===========================|=================================|=============|
      | "__doc__"                 | The function’s documentation    | Writable    |
      |                           | string, or "None" if            |             |
      |                           | unavailable; not inherited by   |             |
      |                           | subclasses.                     |             |
      +---------------------------+---------------------------------+-------------+
      | "__name__"                | The function’s name.            | Writable    |
      +---------------------------+---------------------------------+-------------+
      | "__qualname__"            | The function’s *qualified       | Writable    |
      |                           | name*.  New in version 3.3.     |             |
      +---------------------------+---------------------------------+-------------+
      | "__module__"              | The name of the module the      | Writable    |
      |                           | function was defined in, or     |             |
      |                           | "None" if unavailable.          |             |
      +---------------------------+---------------------------------+-------------+
      | "__defaults__"            | A tuple containing default      | Writable    |
      |                           | argument values for those       |             |
      |                           | arguments that have defaults,   |             |
      |                           | or "None" if no arguments have  |             |
      |                           | a default value.                |             |
      +---------------------------+---------------------------------+-------------+
      | "__code__"                | The code object representing    | Writable    |
      |                           | the compiled function body.     |             |
      +---------------------------+---------------------------------+-------------+
      | "__globals__"             | A reference to the dictionary   | Read-only   |
      |                           | that holds the function’s       |             |
      |                           | global variables — the global   |             |
      |                           | namespace of the module in      |             |
      |                           | which the function was defined. |             |
      +---------------------------+---------------------------------+-------------+
      | "__dict__"                | The namespace supporting        | Writable    |
      |                           | arbitrary function attributes.  |             |
      +---------------------------+---------------------------------+-------------+
      | "__closure__"             | "None" or a tuple of cells that | Read-only   |
      |                           | contain bindings for the        |             |
      |                           | function’s free variables. See  |             |
      |                           | below for information on the    |             |
      |                           | "cell_contents" attribute.      |             |
      +---------------------------+---------------------------------+-------------+
      | "__annotations__"         | A dict containing annotations   | Writable    |
      |                           | of parameters.  The keys of the |             |
      |                           | dict are the parameter names,   |             |
      |                           | and "'return'" for the return   |             |
      |                           | annotation, if provided.        |             |
      +---------------------------+---------------------------------+-------------+
      | "__kwdefaults__"          | A dict containing defaults for  | Writable    |
      |                           | keyword-only parameters.        |             |
      +---------------------------+---------------------------------+-------------+

      Most of the attributes labelled “Writable” check the type of the
      assigned value.

      Function objects also support getting and setting arbitrary
      attributes, which can be used, for example, to attach metadata
      to functions.  Regular attribute dot-notation is used to get and
      set such attributes. *Note that the current implementation only
      supports function attributes on user-defined functions. Function
      attributes on built-in functions may be supported in the
      future.*

      A cell object has the attribute "cell_contents". This can be
      used to get the value of the cell, as well as set the value.

      Additional information about a function’s definition can be
      retrieved from its code object; see the description of internal
      types below. The "cell" type can be accessed in the "types"
      module.

   Instance methods
      An instance method object combines a class, a class instance and
      any callable object (normally a user-defined function).

      Special read-only attributes: "__self__" is the class instance
      object, "__func__" is the function object; "__doc__" is the
      method’s documentation (same as "__func__.__doc__"); "__name__"
      is the method name (same as "__func__.__name__"); "__module__"
      is the name of the module the method was defined in, or "None"
      if unavailable.

      Methods also support accessing (but not setting) the arbitrary
      function attributes on the underlying function object.

      User-defined method objects may be created when getting an
      attribute of a class (perhaps via an instance of that class), if
      that attribute is a user-defined function object or a class
      method object.

      When an instance method object is created by retrieving a user-
      defined function object from a class via one of its instances,
      its "__self__" attribute is the instance, and the method object
      is said to be bound.  The new method’s "__func__" attribute is
      the original function object.

      When an instance method object is created by retrieving a class
      method object from a class or instance, its "__self__" attribute
      is the class itself, and its "__func__" attribute is the
      function object underlying the class method.

      When an instance method object is called, the underlying
      function ("__func__") is called, inserting the class instance
      ("__self__") in front of the argument list.  For instance, when
      "C" is a class which contains a definition for a function "f()",
      and "x" is an instance of "C", calling "x.f(1)" is equivalent to
      calling "C.f(x, 1)".

      When an instance method object is derived from a class method
      object, the “class instance” stored in "__self__" will actually
      be the class itself, so that calling either "x.f(1)" or "C.f(1)"
      is equivalent to calling "f(C,1)" where "f" is the underlying
      function.

      Note that the transformation from function object to instance
      method object happens each time the attribute is retrieved from
      the instance.  In some cases, a fruitful optimization is to
      assign the attribute to a local variable and call that local
      variable. Also notice that this transformation only happens for
      user-defined functions; other callable objects (and all non-
      callable objects) are retrieved without transformation.  It is
      also important to note that user-defined functions which are
      attributes of a class instance are not converted to bound
      methods; this *only* happens when the function is an attribute
      of the class.

   Generator functions
      A function or method which uses the "yield" statement (see
      section The yield statement) is called a *generator function*.
      Such a function, when called, always returns an iterator object
      which can be used to execute the body of the function:  calling
      the iterator’s "iterator.__next__()" method will cause the
      function to execute until it provides a value using the "yield"
      statement.  When the function executes a "return" statement or
      falls off the end, a "StopIteration" exception is raised and the
      iterator will have reached the end of the set of values to be
      returned.

   Coroutine functions
      A function or method which is defined using "async def" is
      called a *coroutine function*.  Such a function, when called,
      returns a *coroutine* object.  It may contain "await"
      expressions, as well as "async with" and "async for" statements.
      See also the Coroutine Objects section.

   Asynchronous generator functions
      A function or method which is defined using "async def" and
      which uses the "yield" statement is called a *asynchronous
      generator function*.  Such a function, when called, returns an
      asynchronous iterator object which can be used in an "async for"
      statement to execute the body of the function.

      Calling the asynchronous iterator’s "aiterator.__anext__()"
      method will return an *awaitable* which when awaited will
      execute until it provides a value using the "yield" expression.
      When the function executes an empty "return" statement or falls
      off the end, a "StopAsyncIteration" exception is raised and the
      asynchronous iterator will have reached the end of the set of
      values to be yielded.

   Built-in functions
      A built-in function object is a wrapper around a C function.
      Examples of built-in functions are "len()" and "math.sin()"
      ("math" is a standard built-in module). The number and type of
      the arguments are determined by the C function. Special read-
      only attributes: "__doc__" is the function’s documentation
      string, or "None" if unavailable; "__name__" is the function’s
      name; "__self__" is set to "None" (but see the next item);
      "__module__" is the name of the module the function was defined
      in or "None" if unavailable.

   Built-in methods
      This is really a different disguise of a built-in function, this
      time containing an object passed to the C function as an
      implicit extra argument.  An example of a built-in method is
      "alist.append()", assuming *alist* is a list object. In this
      case, the special read-only attribute "__self__" is set to the
      object denoted by *alist*.

   Classes
      Classes are callable.  These objects normally act as factories
      for new instances of themselves, but variations are possible for
      class types that override "__new__()".  The arguments of the
      call are passed to "__new__()" and, in the typical case, to
      "__init__()" to initialize the new instance.

   Class Instances
      Instances of arbitrary classes can be made callable by defining
      a "__call__()" method in their class.

Modules
   Modules are a basic organizational unit of Python code, and are
   created by the import system as invoked either by the "import"
   statement, or by calling functions such as
   "importlib.import_module()" and built-in "__import__()".  A module
   object has a namespace implemented by a dictionary object (this is
   the dictionary referenced by the "__globals__" attribute of
   functions defined in the module).  Attribute references are
   translated to lookups in this dictionary, e.g., "m.x" is equivalent
   to "m.__dict__["x"]". A module object does not contain the code
   object used to initialize the module (since it isn’t needed once
   the initialization is done).

   Attribute assignment updates the module’s namespace dictionary,
   e.g., "m.x = 1" is equivalent to "m.__dict__["x"] = 1".

   Predefined (writable) attributes: "__name__" is the module’s name;
   "__doc__" is the module’s documentation string, or "None" if
   unavailable; "__annotations__" (optional) is a dictionary
   containing *variable annotations* collected during module body
   execution; "__file__" is the pathname of the file from which the
   module was loaded, if it was loaded from a file. The "__file__"
   attribute may be missing for certain types of modules, such as C
   modules that are statically linked into the interpreter; for
   extension modules loaded dynamically from a shared library, it is
   the pathname of the shared library file.

   Special read-only attribute: "__dict__" is the module’s namespace
   as a dictionary object.

   **CPython implementation detail:** Because of the way CPython
   clears module dictionaries, the module dictionary will be cleared
   when the module falls out of scope even if the dictionary still has
   live references.  To avoid this, copy the dictionary or keep the
   module around while using its dictionary directly.

Custom classes
   Custom class types are typically created by class definitions (see
   section Class definitions).  A class has a namespace implemented by
   a dictionary object. Class attribute references are translated to
   lookups in this dictionary, e.g., "C.x" is translated to
   "C.__dict__["x"]" (although there are a number of hooks which allow
   for other means of locating attributes). When the attribute name is
   not found there, the attribute search continues in the base
   classes. This search of the base classes uses the C3 method
   resolution order which behaves correctly even in the presence of
   ‘diamond’ inheritance structures where there are multiple
   inheritance paths leading back to a common ancestor. Additional
   details on the C3 MRO used by Python can be found in the
   documentation accompanying the 2.3 release at
   https://www.python.org/download/releases/2.3/mro/.

   When a class attribute reference (for class "C", say) would yield a
   class method object, it is transformed into an instance method
   object whose "__self__" attribute is "C".  When it would yield a
   static method object, it is transformed into the object wrapped by
   the static method object. See section Implementing Descriptors for
   another way in which attributes retrieved from a class may differ
   from those actually contained in its "__dict__".

   Class attribute assignments update the class’s dictionary, never
   the dictionary of a base class.

   A class object can be called (see above) to yield a class instance
   (see below).

   Special attributes: "__name__" is the class name; "__module__" is
   the module name in which the class was defined; "__dict__" is the
   dictionary containing the class’s namespace; "__bases__" is a tuple
   containing the base classes, in the order of their occurrence in
   the base class list; "__doc__" is the class’s documentation string,
   or "None" if undefined; "__annotations__" (optional) is a
   dictionary containing *variable annotations* collected during class
   body execution.

Class instances
   A class instance is created by calling a class object (see above).
   A class instance has a namespace implemented as a dictionary which
   is the first place in which attribute references are searched.
   When an attribute is not found there, and the instance’s class has
   an attribute by that name, the search continues with the class
   attributes.  If a class attribute is found that is a user-defined
   function object, it is transformed into an instance method object
   whose "__self__" attribute is the instance.  Static method and
   class method objects are also transformed; see above under
   “Classes”.  See section Implementing Descriptors for another way in
   which attributes of a class retrieved via its instances may differ
   from the objects actually stored in the class’s "__dict__".  If no
   class attribute is found, and the object’s class has a
   "__getattr__()" method, that is called to satisfy the lookup.

   Attribute assignments and deletions update the instance’s
   dictionary, never a class’s dictionary.  If the class has a
   "__setattr__()" or "__delattr__()" method, this is called instead
   of updating the instance dictionary directly.

   Class instances can pretend to be numbers, sequences, or mappings
   if they have methods with certain special names.  See section
   Special method names.

   Special attributes: "__dict__" is the attribute dictionary;
   "__class__" is the instance’s class.

I/O objects (also known as file objects)
   A *file object* represents an open file.  Various shortcuts are
   available to create file objects: the "open()" built-in function,
   and also "os.popen()", "os.fdopen()", and the "makefile()" method
   of socket objects (and perhaps by other functions or methods
   provided by extension modules).

   The objects "sys.stdin", "sys.stdout" and "sys.stderr" are
   initialized to file objects corresponding to the interpreter’s
   standard input, output and error streams; they are all open in text
   mode and therefore follow the interface defined by the
   "io.TextIOBase" abstract class.

Internal types
   A few types used internally by the interpreter are exposed to the
   user. Their definitions may change with future versions of the
   interpreter, but they are mentioned here for completeness.

   Code objects
      Code objects represent *byte-compiled* executable Python code,
      or *bytecode*. The difference between a code object and a
      function object is that the function object contains an explicit
      reference to the function’s globals (the module in which it was
      defined), while a code object contains no context; also the
      default argument values are stored in the function object, not
      in the code object (because they represent values calculated at
      run-time).  Unlike function objects, code objects are immutable
      and contain no references (directly or indirectly) to mutable
      objects.

      Special read-only attributes: "co_name" gives the function name;
      "co_argcount" is the total number of positional arguments
      (including positional-only arguments and arguments with default
      values); "co_posonlyargcount" is the number of positional-only
      arguments (including arguments with default values);
      "co_kwonlyargcount" is the number of keyword-only arguments
      (including arguments with default values); "co_nlocals" is the
      number of local variables used by the function (including
      arguments); "co_varnames" is a tuple containing the names of the
      local variables (starting with the argument names);
      "co_cellvars" is a tuple containing the names of local variables
      that are referenced by nested functions; "co_freevars" is a
      tuple containing the names of free variables; "co_code" is a
      string representing the sequence of bytecode instructions;
      "co_consts" is a tuple containing the literals used by the
      bytecode; "co_names" is a tuple containing the names used by the
      bytecode; "co_filename" is the filename from which the code was
      compiled; "co_firstlineno" is the first line number of the
      function; "co_lnotab" is a string encoding the mapping from
      bytecode offsets to line numbers (for details see the source
      code of the interpreter); "co_stacksize" is the required stack
      size; "co_flags" is an integer encoding a number of flags for
      the interpreter.

      The following flag bits are defined for "co_flags": bit "0x04"
      is set if the function uses the "*arguments" syntax to accept an
      arbitrary number of positional arguments; bit "0x08" is set if
      the function uses the "**keywords" syntax to accept arbitrary
      keyword arguments; bit "0x20" is set if the function is a
      generator.

      Future feature declarations ("from __future__ import division")
      also use bits in "co_flags" to indicate whether a code object
      was compiled with a particular feature enabled: bit "0x2000" is
      set if the function was compiled with future division enabled;
      bits "0x10" and "0x1000" were used in earlier versions of
      Python.

      Other bits in "co_flags" are reserved for internal use.

      If a code object represents a function, the first item in
      "co_consts" is the documentation string of the function, or
      "None" if undefined.

   Frame objects
      Frame objects represent execution frames.  They may occur in
      traceback objects (see below), and are also passed to registered
      trace functions.

      Special read-only attributes: "f_back" is to the previous stack
      frame (towards the caller), or "None" if this is the bottom
      stack frame; "f_code" is the code object being executed in this
      frame; "f_locals" is the dictionary used to look up local
      variables; "f_globals" is used for global variables;
      "f_builtins" is used for built-in (intrinsic) names; "f_lasti"
      gives the precise instruction (this is an index into the
      bytecode string of the code object).

      Accessing "f_code" raises an auditing event "object.__getattr__"
      with arguments "obj" and ""f_code"".

      Special writable attributes: "f_trace", if not "None", is a
      function called for various events during code execution (this
      is used by the debugger). Normally an event is triggered for
      each new source line - this can be disabled by setting
      "f_trace_lines" to "False".

      Implementations *may* allow per-opcode events to be requested by
      setting "f_trace_opcodes" to "True". Note that this may lead to
      undefined interpreter behaviour if exceptions raised by the
      trace function escape to the function being traced.

      "f_lineno" is the current line number of the frame — writing to
      this from within a trace function jumps to the given line (only
      for the bottom-most frame).  A debugger can implement a Jump
      command (aka Set Next Statement) by writing to f_lineno.

      Frame objects support one method:

      frame.clear()

         This method clears all references to local variables held by
         the frame.  Also, if the frame belonged to a generator, the
         generator is finalized.  This helps break reference cycles
         involving frame objects (for example when catching an
         exception and storing its traceback for later use).

         "RuntimeError" is raised if the frame is currently executing.

         New in version 3.4.

   Traceback objects
      Traceback objects represent a stack trace of an exception.  A
      traceback object is implicitly created when an exception occurs,
      and may also be explicitly created by calling
      "types.TracebackType".

      For implicitly created tracebacks, when the search for an
      exception handler unwinds the execution stack, at each unwound
      level a traceback object is inserted in front of the current
      traceback.  When an exception handler is entered, the stack
      trace is made available to the program. (See section The try
      statement.) It is accessible as the third item of the tuple
      returned by "sys.exc_info()", and as the "__traceback__"
      attribute of the caught exception.

      When the program contains no suitable handler, the stack trace
      is written (nicely formatted) to the standard error stream; if
      the interpreter is interactive, it is also made available to the
      user as "sys.last_traceback".

      For explicitly created tracebacks, it is up to the creator of
      the traceback to determine how the "tb_next" attributes should
      be linked to form a full stack trace.

      Special read-only attributes: "tb_frame" points to the execution
      frame of the current level; "tb_lineno" gives the line number
      where the exception occurred; "tb_lasti" indicates the precise
      instruction. The line number and last instruction in the
      traceback may differ from the line number of its frame object if
      the exception occurred in a "try" statement with no matching
      except clause or with a finally clause.

      Accessing "tb_frame" raises an auditing event
      "object.__getattr__" with arguments "obj" and ""tb_frame"".

      Special writable attribute: "tb_next" is the next level in the
      stack trace (towards the frame where the exception occurred), or
      "None" if there is no next level.

      Changed in version 3.7: Traceback objects can now be explicitly
      instantiated from Python code, and the "tb_next" attribute of
      existing instances can be updated.

   Slice objects
      Slice objects are used to represent slices for "__getitem__()"
      methods.  They are also created by the built-in "slice()"
      function.

      Special read-only attributes: "start" is the lower bound; "stop"
      is the upper bound; "step" is the step value; each is "None" if
      omitted.  These attributes can have any type.

      Slice objects support one method:

      slice.indices(self, length)

         This method takes a single integer argument *length* and
         computes information about the slice that the slice object
         would describe if applied to a sequence of *length* items.
         It returns a tuple of three integers; respectively these are
         the *start* and *stop* indices and the *step* or stride
         length of the slice. Missing or out-of-bounds indices are
         handled in a manner consistent with regular slices.

   Static method objects
      Static method objects provide a way of defeating the
      transformation of function objects to method objects described
      above. A static method object is a wrapper around any other
      object, usually a user-defined method object. When a static
      method object is retrieved from a class or a class instance, the
      object actually returned is the wrapped object, which is not
      subject to any further transformation. Static method objects are
      not themselves callable, although the objects they wrap usually
      are. Static method objects are created by the built-in
      "staticmethod()" constructor.

   Class method objects
      A class method object, like a static method object, is a wrapper
      around another object that alters the way in which that object
      is retrieved from classes and class instances. The behaviour of
      class method objects upon such retrieval is described above,
      under “User-defined methods”. Class method objects are created
      by the built-in "classmethod()" constructor.
a�Functions
*********

Function objects are created by function definitions.  The only
operation on a function object is to call it: "func(argument-list)".

There are really two flavors of function objects: built-in functions
and user-defined functions.  Both support the same operation (to call
the function), but the implementation is different, hence the
different object types.

See Function definitions for more information.
u(.Mapping Types — "dict"
**********************

A *mapping* object maps *hashable* values to arbitrary objects.
Mappings are mutable objects.  There is currently only one standard
mapping type, the *dictionary*.  (For other containers see the built-
in "list", "set", and "tuple" classes, and the "collections" module.)

A dictionary’s keys are *almost* arbitrary values.  Values that are
not *hashable*, that is, values containing lists, dictionaries or
other mutable types (that are compared by value rather than by object
identity) may not be used as keys.  Numeric types used for keys obey
the normal rules for numeric comparison: if two numbers compare equal
(such as "1" and "1.0") then they can be used interchangeably to index
the same dictionary entry.  (Note however, that since computers store
floating-point numbers as approximations it is usually unwise to use
them as dictionary keys.)

Dictionaries can be created by placing a comma-separated list of "key:
value" pairs within braces, for example: "{'jack': 4098, 'sjoerd':
4127}" or "{4098: 'jack', 4127: 'sjoerd'}", or by the "dict"
constructor.

class dict(**kwarg)
class dict(mapping, **kwarg)
class dict(iterable, **kwarg)

   Return a new dictionary initialized from an optional positional
   argument and a possibly empty set of keyword arguments.

   Dictionaries can be created by several means:

   * Use a comma-separated list of "key: value" pairs within braces:
     "{'jack': 4098, 'sjoerd': 4127}" or "{4098: 'jack', 4127:
     'sjoerd'}"

   * Use a dict comprehension: "{}", "{x: x ** 2 for x in range(10)}"

   * Use the type constructor: "dict()", "dict([('foo', 100), ('bar',
     200)])", "dict(foo=100, bar=200)"

   If no positional argument is given, an empty dictionary is created.
   If a positional argument is given and it is a mapping object, a
   dictionary is created with the same key-value pairs as the mapping
   object.  Otherwise, the positional argument must be an *iterable*
   object.  Each item in the iterable must itself be an iterable with
   exactly two objects.  The first object of each item becomes a key
   in the new dictionary, and the second object the corresponding
   value.  If a key occurs more than once, the last value for that key
   becomes the corresponding value in the new dictionary.

   If keyword arguments are given, the keyword arguments and their
   values are added to the dictionary created from the positional
   argument.  If a key being added is already present, the value from
   the keyword argument replaces the value from the positional
   argument.

   To illustrate, the following examples all return a dictionary equal
   to "{"one": 1, "two": 2, "three": 3}":

      >>> a = dict(one=1, two=2, three=3)
      >>> b = {'one': 1, 'two': 2, 'three': 3}
      >>> c = dict(zip(['one', 'two', 'three'], [1, 2, 3]))
      >>> d = dict([('two', 2), ('one', 1), ('three', 3)])
      >>> e = dict({'three': 3, 'one': 1, 'two': 2})
      >>> a == b == c == d == e
      True

   Providing keyword arguments as in the first example only works for
   keys that are valid Python identifiers.  Otherwise, any valid keys
   can be used.

   These are the operations that dictionaries support (and therefore,
   custom mapping types should support too):

   list(d)

      Return a list of all the keys used in the dictionary *d*.

   len(d)

      Return the number of items in the dictionary *d*.

   d[key]

      Return the item of *d* with key *key*.  Raises a "KeyError" if
      *key* is not in the map.

      If a subclass of dict defines a method "__missing__()" and *key*
      is not present, the "d[key]" operation calls that method with
      the key *key* as argument.  The "d[key]" operation then returns
      or raises whatever is returned or raised by the
      "__missing__(key)" call. No other operations or methods invoke
      "__missing__()". If "__missing__()" is not defined, "KeyError"
      is raised. "__missing__()" must be a method; it cannot be an
      instance variable:

         >>> class Counter(dict):
         ...     def __missing__(self, key):
         ...         return 0
         >>> c = Counter()
         >>> c['red']
         0
         >>> c['red'] += 1
         >>> c['red']
         1

      The example above shows part of the implementation of
      "collections.Counter".  A different "__missing__" method is used
      by "collections.defaultdict".

   d[key] = value

      Set "d[key]" to *value*.

   del d[key]

      Remove "d[key]" from *d*.  Raises a "KeyError" if *key* is not
      in the map.

   key in d

      Return "True" if *d* has a key *key*, else "False".

   key not in d

      Equivalent to "not key in d".

   iter(d)

      Return an iterator over the keys of the dictionary.  This is a
      shortcut for "iter(d.keys())".

   clear()

      Remove all items from the dictionary.

   copy()

      Return a shallow copy of the dictionary.

   classmethod fromkeys(iterable[, value])

      Create a new dictionary with keys from *iterable* and values set
      to *value*.

      "fromkeys()" is a class method that returns a new dictionary.
      *value* defaults to "None".  All of the values refer to just a
      single instance, so it generally doesn’t make sense for *value*
      to be a mutable object such as an empty list.  To get distinct
      values, use a dict comprehension instead.

   get(key[, default])

      Return the value for *key* if *key* is in the dictionary, else
      *default*. If *default* is not given, it defaults to "None", so
      that this method never raises a "KeyError".

   items()

      Return a new view of the dictionary’s items ("(key, value)"
      pairs). See the documentation of view objects.

   keys()

      Return a new view of the dictionary’s keys.  See the
      documentation of view objects.

   pop(key[, default])

      If *key* is in the dictionary, remove it and return its value,
      else return *default*.  If *default* is not given and *key* is
      not in the dictionary, a "KeyError" is raised.

   popitem()

      Remove and return a "(key, value)" pair from the dictionary.
      Pairs are returned in LIFO (last-in, first-out) order.

      "popitem()" is useful to destructively iterate over a
      dictionary, as often used in set algorithms.  If the dictionary
      is empty, calling "popitem()" raises a "KeyError".

      Changed in version 3.7: LIFO order is now guaranteed. In prior
      versions, "popitem()" would return an arbitrary key/value pair.

   reversed(d)

      Return a reverse iterator over the keys of the dictionary. This
      is a shortcut for "reversed(d.keys())".

      New in version 3.8.

   setdefault(key[, default])

      If *key* is in the dictionary, return its value.  If not, insert
      *key* with a value of *default* and return *default*.  *default*
      defaults to "None".

   update([other])

      Update the dictionary with the key/value pairs from *other*,
      overwriting existing keys.  Return "None".

      "update()" accepts either another dictionary object or an
      iterable of key/value pairs (as tuples or other iterables of
      length two).  If keyword arguments are specified, the dictionary
      is then updated with those key/value pairs: "d.update(red=1,
      blue=2)".

   values()

      Return a new view of the dictionary’s values.  See the
      documentation of view objects.

      An equality comparison between one "dict.values()" view and
      another will always return "False". This also applies when
      comparing "dict.values()" to itself:

         >>> d = {'a': 1}
         >>> d.values() == d.values()
         False

   Dictionaries compare equal if and only if they have the same "(key,
   value)" pairs (regardless of ordering). Order comparisons (‘<’,
   ‘<=’, ‘>=’, ‘>’) raise "TypeError".

   Dictionaries preserve insertion order.  Note that updating a key
   does not affect the order.  Keys added after deletion are inserted
   at the end.

      >>> d = {"one": 1, "two": 2, "three": 3, "four": 4}
      >>> d
      {'one': 1, 'two': 2, 'three': 3, 'four': 4}
      >>> list(d)
      ['one', 'two', 'three', 'four']
      >>> list(d.values())
      [1, 2, 3, 4]
      >>> d["one"] = 42
      >>> d
      {'one': 42, 'two': 2, 'three': 3, 'four': 4}
      >>> del d["two"]
      >>> d["two"] = None
      >>> d
      {'one': 42, 'three': 3, 'four': 4, 'two': None}

   Changed in version 3.7: Dictionary order is guaranteed to be
   insertion order.  This behavior was an implementation detail of
   CPython from 3.6.

   Dictionaries and dictionary views are reversible.

      >>> d = {"one": 1, "two": 2, "three": 3, "four": 4}
      >>> d
      {'one': 1, 'two': 2, 'three': 3, 'four': 4}
      >>> list(reversed(d))
      ['four', 'three', 'two', 'one']
      >>> list(reversed(d.values()))
      [4, 3, 2, 1]
      >>> list(reversed(d.items()))
      [('four', 4), ('three', 3), ('two', 2), ('one', 1)]

   Changed in version 3.8: Dictionaries are now reversible.

See also:

  "types.MappingProxyType" can be used to create a read-only view of a
  "dict".


Dictionary view objects
=======================

The objects returned by "dict.keys()", "dict.values()" and
"dict.items()" are *view objects*.  They provide a dynamic view on the
dictionary’s entries, which means that when the dictionary changes,
the view reflects these changes.

Dictionary views can be iterated over to yield their respective data,
and support membership tests:

len(dictview)

   Return the number of entries in the dictionary.

iter(dictview)

   Return an iterator over the keys, values or items (represented as
   tuples of "(key, value)") in the dictionary.

   Keys and values are iterated over in insertion order. This allows
   the creation of "(value, key)" pairs using "zip()": "pairs =
   zip(d.values(), d.keys())".  Another way to create the same list is
   "pairs = [(v, k) for (k, v) in d.items()]".

   Iterating views while adding or deleting entries in the dictionary
   may raise a "RuntimeError" or fail to iterate over all entries.

   Changed in version 3.7: Dictionary order is guaranteed to be
   insertion order.

x in dictview

   Return "True" if *x* is in the underlying dictionary’s keys, values
   or items (in the latter case, *x* should be a "(key, value)"
   tuple).

reversed(dictview)

   Return a reverse iterator over the keys, values or items of the
   dictionary. The view will be iterated in reverse order of the
   insertion.

   Changed in version 3.8: Dictionary views are now reversible.

Keys views are set-like since their entries are unique and hashable.
If all values are hashable, so that "(key, value)" pairs are unique
and hashable, then the items view is also set-like.  (Values views are
not treated as set-like since the entries are generally not unique.)
For set-like views, all of the operations defined for the abstract
base class "collections.abc.Set" are available (for example, "==",
"<", or "^").

An example of dictionary view usage:

   >>> dishes = {'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500}
   >>> keys = dishes.keys()
   >>> values = dishes.values()

   >>> # iteration
   >>> n = 0
   >>> for val in values:
   ...     n += val
   >>> print(n)
   504

   >>> # keys and values are iterated over in the same order (insertion order)
   >>> list(keys)
   ['eggs', 'sausage', 'bacon', 'spam']
   >>> list(values)
   [2, 1, 1, 500]

   >>> # view objects are dynamic and reflect dict changes
   >>> del dishes['eggs']
   >>> del dishes['sausage']
   >>> list(keys)
   ['bacon', 'spam']

   >>> # set operations
   >>> keys & {'eggs', 'bacon', 'salad'}
   {'bacon'}
   >>> keys ^ {'sausage', 'juice'}
   {'juice', 'sausage', 'bacon', 'spam'}
a�Methods
*******

Methods are functions that are called using the attribute notation.
There are two flavors: built-in methods (such as "append()" on lists)
and class instance methods.  Built-in methods are described with the
types that support them.

If you access a method (a function defined in a class namespace)
through an instance, you get a special object: a *bound method* (also
called *instance method*) object. When called, it will add the "self"
argument to the argument list.  Bound methods have two special read-
only attributes: "m.__self__" is the object on which the method
operates, and "m.__func__" is the function implementing the method.
Calling "m(arg-1, arg-2, ..., arg-n)" is completely equivalent to
calling "m.__func__(m.__self__, arg-1, arg-2, ..., arg-n)".

Like function objects, bound method objects support getting arbitrary
attributes.  However, since method attributes are actually stored on
the underlying function object ("meth.__func__"), setting method
attributes on bound methods is disallowed.  Attempting to set an
attribute on a method results in an "AttributeError" being raised.  In
order to set a method attribute, you need to explicitly set it on the
underlying function object:

   >>> class C:
   ...     def method(self):
   ...         pass
   ...
   >>> c = C()
   >>> c.method.whoami = 'my name is method'  # can't set on the method
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
   AttributeError: 'method' object has no attribute 'whoami'
   >>> c.method.__func__.whoami = 'my name is method'
   >>> c.method.whoami
   'my name is method'

See The standard type hierarchy for more information.
u$Modules
*******

The only special operation on a module is attribute access: "m.name",
where *m* is a module and *name* accesses a name defined in *m*’s
symbol table. Module attributes can be assigned to.  (Note that the
"import" statement is not, strictly speaking, an operation on a module
object; "import foo" does not require a module object named *foo* to
exist, rather it requires an (external) *definition* for a module
named *foo* somewhere.)

A special attribute of every module is "__dict__". This is the
dictionary containing the module’s symbol table. Modifying this
dictionary will actually change the module’s symbol table, but direct
assignment to the "__dict__" attribute is not possible (you can write
"m.__dict__['a'] = 1", which defines "m.a" to be "1", but you can’t
write "m.__dict__ = {}").  Modifying "__dict__" directly is not
recommended.

Modules built into the interpreter are written like this: "<module
'sys' (built-in)>".  If loaded from a file, they are written as
"<module 'os' from '/usr/local/lib/pythonX.Y/os.pyc'>".
u�ZSequence Types — "list", "tuple", "range"
*****************************************

There are three basic sequence types: lists, tuples, and range
objects. Additional sequence types tailored for processing of binary
data and text strings are described in dedicated sections.


Common Sequence Operations
==========================

The operations in the following table are supported by most sequence
types, both mutable and immutable. The "collections.abc.Sequence" ABC
is provided to make it easier to correctly implement these operations
on custom sequence types.

This table lists the sequence operations sorted in ascending priority.
In the table, *s* and *t* are sequences of the same type, *n*, *i*,
*j* and *k* are integers and *x* is an arbitrary object that meets any
type and value restrictions imposed by *s*.

The "in" and "not in" operations have the same priorities as the
comparison operations. The "+" (concatenation) and "*" (repetition)
operations have the same priority as the corresponding numeric
operations. [3]

+----------------------------+----------------------------------+------------+
| Operation                  | Result                           | Notes      |
|============================|==================================|============|
| "x in s"                   | "True" if an item of *s* is      | (1)        |
|                            | equal to *x*, else "False"       |            |
+----------------------------+----------------------------------+------------+
| "x not in s"               | "False" if an item of *s* is     | (1)        |
|                            | equal to *x*, else "True"        |            |
+----------------------------+----------------------------------+------------+
| "s + t"                    | the concatenation of *s* and *t* | (6)(7)     |
+----------------------------+----------------------------------+------------+
| "s * n" or "n * s"         | equivalent to adding *s* to      | (2)(7)     |
|                            | itself *n* times                 |            |
+----------------------------+----------------------------------+------------+
| "s[i]"                     | *i*th item of *s*, origin 0      | (3)        |
+----------------------------+----------------------------------+------------+
| "s[i:j]"                   | slice of *s* from *i* to *j*     | (3)(4)     |
+----------------------------+----------------------------------+------------+
| "s[i:j:k]"                 | slice of *s* from *i* to *j*     | (3)(5)     |
|                            | with step *k*                    |            |
+----------------------------+----------------------------------+------------+
| "len(s)"                   | length of *s*                    |            |
+----------------------------+----------------------------------+------------+
| "min(s)"                   | smallest item of *s*             |            |
+----------------------------+----------------------------------+------------+
| "max(s)"                   | largest item of *s*              |            |
+----------------------------+----------------------------------+------------+
| "s.index(x[, i[, j]])"     | index of the first occurrence of | (8)        |
|                            | *x* in *s* (at or after index    |            |
|                            | *i* and before index *j*)        |            |
+----------------------------+----------------------------------+------------+
| "s.count(x)"               | total number of occurrences of   |            |
|                            | *x* in *s*                       |            |
+----------------------------+----------------------------------+------------+

Sequences of the same type also support comparisons.  In particular,
tuples and lists are compared lexicographically by comparing
corresponding elements. This means that to compare equal, every
element must compare equal and the two sequences must be of the same
type and have the same length.  (For full details see Comparisons in
the language reference.)

Notes:

1. While the "in" and "not in" operations are used only for simple
   containment testing in the general case, some specialised sequences
   (such as "str", "bytes" and "bytearray") also use them for
   subsequence testing:

      >>> "gg" in "eggs"
      True

2. Values of *n* less than "0" are treated as "0" (which yields an
   empty sequence of the same type as *s*).  Note that items in the
   sequence *s* are not copied; they are referenced multiple times.
   This often haunts new Python programmers; consider:

      >>> lists = [[]] * 3
      >>> lists
      [[], [], []]
      >>> lists[0].append(3)
      >>> lists
      [[3], [3], [3]]

   What has happened is that "[[]]" is a one-element list containing
   an empty list, so all three elements of "[[]] * 3" are references
   to this single empty list.  Modifying any of the elements of
   "lists" modifies this single list. You can create a list of
   different lists this way:

      >>> lists = [[] for i in range(3)]
      >>> lists[0].append(3)
      >>> lists[1].append(5)
      >>> lists[2].append(7)
      >>> lists
      [[3], [5], [7]]

   Further explanation is available in the FAQ entry How do I create a
   multidimensional list?.

3. If *i* or *j* is negative, the index is relative to the end of
   sequence *s*: "len(s) + i" or "len(s) + j" is substituted.  But
   note that "-0" is still "0".

4. The slice of *s* from *i* to *j* is defined as the sequence of
   items with index *k* such that "i <= k < j".  If *i* or *j* is
   greater than "len(s)", use "len(s)".  If *i* is omitted or "None",
   use "0".  If *j* is omitted or "None", use "len(s)".  If *i* is
   greater than or equal to *j*, the slice is empty.

5. The slice of *s* from *i* to *j* with step *k* is defined as the
   sequence of items with index  "x = i + n*k" such that "0 <= n <
   (j-i)/k".  In other words, the indices are "i", "i+k", "i+2*k",
   "i+3*k" and so on, stopping when *j* is reached (but never
   including *j*).  When *k* is positive, *i* and *j* are reduced to
   "len(s)" if they are greater. When *k* is negative, *i* and *j* are
   reduced to "len(s) - 1" if they are greater.  If *i* or *j* are
   omitted or "None", they become “end” values (which end depends on
   the sign of *k*).  Note, *k* cannot be zero. If *k* is "None", it
   is treated like "1".

6. Concatenating immutable sequences always results in a new object.
   This means that building up a sequence by repeated concatenation
   will have a quadratic runtime cost in the total sequence length.
   To get a linear runtime cost, you must switch to one of the
   alternatives below:

   * if concatenating "str" objects, you can build a list and use
     "str.join()" at the end or else write to an "io.StringIO"
     instance and retrieve its value when complete

   * if concatenating "bytes" objects, you can similarly use
     "bytes.join()" or "io.BytesIO", or you can do in-place
     concatenation with a "bytearray" object.  "bytearray" objects are
     mutable and have an efficient overallocation mechanism

   * if concatenating "tuple" objects, extend a "list" instead

   * for other types, investigate the relevant class documentation

7. Some sequence types (such as "range") only support item sequences
   that follow specific patterns, and hence don’t support sequence
   concatenation or repetition.

8. "index" raises "ValueError" when *x* is not found in *s*. Not all
   implementations support passing the additional arguments *i* and
   *j*. These arguments allow efficient searching of subsections of
   the sequence. Passing the extra arguments is roughly equivalent to
   using "s[i:j].index(x)", only without copying any data and with the
   returned index being relative to the start of the sequence rather
   than the start of the slice.


Immutable Sequence Types
========================

The only operation that immutable sequence types generally implement
that is not also implemented by mutable sequence types is support for
the "hash()" built-in.

This support allows immutable sequences, such as "tuple" instances, to
be used as "dict" keys and stored in "set" and "frozenset" instances.

Attempting to hash an immutable sequence that contains unhashable
values will result in "TypeError".


Mutable Sequence Types
======================

The operations in the following table are defined on mutable sequence
types. The "collections.abc.MutableSequence" ABC is provided to make
it easier to correctly implement these operations on custom sequence
types.

In the table *s* is an instance of a mutable sequence type, *t* is any
iterable object and *x* is an arbitrary object that meets any type and
value restrictions imposed by *s* (for example, "bytearray" only
accepts integers that meet the value restriction "0 <= x <= 255").

+--------------------------------+----------------------------------+-----------------------+
| Operation                      | Result                           | Notes                 |
|================================|==================================|=======================|
| "s[i] = x"                     | item *i* of *s* is replaced by   |                       |
|                                | *x*                              |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s[i:j] = t"                   | slice of *s* from *i* to *j* is  |                       |
|                                | replaced by the contents of the  |                       |
|                                | iterable *t*                     |                       |
+--------------------------------+----------------------------------+-----------------------+
| "del s[i:j]"                   | same as "s[i:j] = []"            |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s[i:j:k] = t"                 | the elements of "s[i:j:k]" are   | (1)                   |
|                                | replaced by those of *t*         |                       |
+--------------------------------+----------------------------------+-----------------------+
| "del s[i:j:k]"                 | removes the elements of          |                       |
|                                | "s[i:j:k]" from the list         |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.append(x)"                  | appends *x* to the end of the    |                       |
|                                | sequence (same as                |                       |
|                                | "s[len(s):len(s)] = [x]")        |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.clear()"                    | removes all items from *s* (same | (5)                   |
|                                | as "del s[:]")                   |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.copy()"                     | creates a shallow copy of *s*    | (5)                   |
|                                | (same as "s[:]")                 |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.extend(t)" or "s += t"      | extends *s* with the contents of |                       |
|                                | *t* (for the most part the same  |                       |
|                                | as "s[len(s):len(s)] = t")       |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s *= n"                       | updates *s* with its contents    | (6)                   |
|                                | repeated *n* times               |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.insert(i, x)"               | inserts *x* into *s* at the      |                       |
|                                | index given by *i* (same as      |                       |
|                                | "s[i:i] = [x]")                  |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.pop()" or "s.pop(i)"        | retrieves the item at *i* and    | (2)                   |
|                                | also removes it from *s*         |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.remove(x)"                  | remove the first item from *s*   | (3)                   |
|                                | where "s[i]" is equal to *x*     |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.reverse()"                  | reverses the items of *s* in     | (4)                   |
|                                | place                            |                       |
+--------------------------------+----------------------------------+-----------------------+

Notes:

1. *t* must have the same length as the slice it is replacing.

2. The optional argument *i* defaults to "-1", so that by default the
   last item is removed and returned.

3. "remove()" raises "ValueError" when *x* is not found in *s*.

4. The "reverse()" method modifies the sequence in place for economy
   of space when reversing a large sequence.  To remind users that it
   operates by side effect, it does not return the reversed sequence.

5. "clear()" and "copy()" are included for consistency with the
   interfaces of mutable containers that don’t support slicing
   operations (such as "dict" and "set"). "copy()" is not part of the
   "collections.abc.MutableSequence" ABC, but most concrete mutable
   sequence classes provide it.

   New in version 3.3: "clear()" and "copy()" methods.

6. The value *n* is an integer, or an object implementing
   "__index__()".  Zero and negative values of *n* clear the sequence.
   Items in the sequence are not copied; they are referenced multiple
   times, as explained for "s * n" under Common Sequence Operations.


Lists
=====

Lists are mutable sequences, typically used to store collections of
homogeneous items (where the precise degree of similarity will vary by
application).

class list([iterable])

   Lists may be constructed in several ways:

   * Using a pair of square brackets to denote the empty list: "[]"

   * Using square brackets, separating items with commas: "[a]", "[a,
     b, c]"

   * Using a list comprehension: "[x for x in iterable]"

   * Using the type constructor: "list()" or "list(iterable)"

   The constructor builds a list whose items are the same and in the
   same order as *iterable*’s items.  *iterable* may be either a
   sequence, a container that supports iteration, or an iterator
   object.  If *iterable* is already a list, a copy is made and
   returned, similar to "iterable[:]". For example, "list('abc')"
   returns "['a', 'b', 'c']" and "list( (1, 2, 3) )" returns "[1, 2,
   3]". If no argument is given, the constructor creates a new empty
   list, "[]".

   Many other operations also produce lists, including the "sorted()"
   built-in.

   Lists implement all of the common and mutable sequence operations.
   Lists also provide the following additional method:

   sort(*, key=None, reverse=False)

      This method sorts the list in place, using only "<" comparisons
      between items. Exceptions are not suppressed - if any comparison
      operations fail, the entire sort operation will fail (and the
      list will likely be left in a partially modified state).

      "sort()" accepts two arguments that can only be passed by
      keyword (keyword-only arguments):

      *key* specifies a function of one argument that is used to
      extract a comparison key from each list element (for example,
      "key=str.lower"). The key corresponding to each item in the list
      is calculated once and then used for the entire sorting process.
      The default value of "None" means that list items are sorted
      directly without calculating a separate key value.

      The "functools.cmp_to_key()" utility is available to convert a
      2.x style *cmp* function to a *key* function.

      *reverse* is a boolean value.  If set to "True", then the list
      elements are sorted as if each comparison were reversed.

      This method modifies the sequence in place for economy of space
      when sorting a large sequence.  To remind users that it operates
      by side effect, it does not return the sorted sequence (use
      "sorted()" to explicitly request a new sorted list instance).

      The "sort()" method is guaranteed to be stable.  A sort is
      stable if it guarantees not to change the relative order of
      elements that compare equal — this is helpful for sorting in
      multiple passes (for example, sort by department, then by salary
      grade).

      For sorting examples and a brief sorting tutorial, see Sorting
      HOW TO.

      **CPython implementation detail:** While a list is being sorted,
      the effect of attempting to mutate, or even inspect, the list is
      undefined.  The C implementation of Python makes the list appear
      empty for the duration, and raises "ValueError" if it can detect
      that the list has been mutated during a sort.


Tuples
======

Tuples are immutable sequences, typically used to store collections of
heterogeneous data (such as the 2-tuples produced by the "enumerate()"
built-in). Tuples are also used for cases where an immutable sequence
of homogeneous data is needed (such as allowing storage in a "set" or
"dict" instance).

class tuple([iterable])

   Tuples may be constructed in a number of ways:

   * Using a pair of parentheses to denote the empty tuple: "()"

   * Using a trailing comma for a singleton tuple: "a," or "(a,)"

   * Separating items with commas: "a, b, c" or "(a, b, c)"

   * Using the "tuple()" built-in: "tuple()" or "tuple(iterable)"

   The constructor builds a tuple whose items are the same and in the
   same order as *iterable*’s items.  *iterable* may be either a
   sequence, a container that supports iteration, or an iterator
   object.  If *iterable* is already a tuple, it is returned
   unchanged. For example, "tuple('abc')" returns "('a', 'b', 'c')"
   and "tuple( [1, 2, 3] )" returns "(1, 2, 3)". If no argument is
   given, the constructor creates a new empty tuple, "()".

   Note that it is actually the comma which makes a tuple, not the
   parentheses. The parentheses are optional, except in the empty
   tuple case, or when they are needed to avoid syntactic ambiguity.
   For example, "f(a, b, c)" is a function call with three arguments,
   while "f((a, b, c))" is a function call with a 3-tuple as the sole
   argument.

   Tuples implement all of the common sequence operations.

For heterogeneous collections of data where access by name is clearer
than access by index, "collections.namedtuple()" may be a more
appropriate choice than a simple tuple object.


Ranges
======

The "range" type represents an immutable sequence of numbers and is
commonly used for looping a specific number of times in "for" loops.

class range(stop)
class range(start, stop[, step])

   The arguments to the range constructor must be integers (either
   built-in "int" or any object that implements the "__index__"
   special method).  If the *step* argument is omitted, it defaults to
   "1". If the *start* argument is omitted, it defaults to "0". If
   *step* is zero, "ValueError" is raised.

   For a positive *step*, the contents of a range "r" are determined
   by the formula "r[i] = start + step*i" where "i >= 0" and "r[i] <
   stop".

   For a negative *step*, the contents of the range are still
   determined by the formula "r[i] = start + step*i", but the
   constraints are "i >= 0" and "r[i] > stop".

   A range object will be empty if "r[0]" does not meet the value
   constraint. Ranges do support negative indices, but these are
   interpreted as indexing from the end of the sequence determined by
   the positive indices.

   Ranges containing absolute values larger than "sys.maxsize" are
   permitted but some features (such as "len()") may raise
   "OverflowError".

   Range examples:

      >>> list(range(10))
      [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
      >>> list(range(1, 11))
      [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
      >>> list(range(0, 30, 5))
      [0, 5, 10, 15, 20, 25]
      >>> list(range(0, 10, 3))
      [0, 3, 6, 9]
      >>> list(range(0, -10, -1))
      [0, -1, -2, -3, -4, -5, -6, -7, -8, -9]
      >>> list(range(0))
      []
      >>> list(range(1, 0))
      []

   Ranges implement all of the common sequence operations except
   concatenation and repetition (due to the fact that range objects
   can only represent sequences that follow a strict pattern and
   repetition and concatenation will usually violate that pattern).

   start

      The value of the *start* parameter (or "0" if the parameter was
      not supplied)

   stop

      The value of the *stop* parameter

   step

      The value of the *step* parameter (or "1" if the parameter was
      not supplied)

The advantage of the "range" type over a regular "list" or "tuple" is
that a "range" object will always take the same (small) amount of
memory, no matter the size of the range it represents (as it only
stores the "start", "stop" and "step" values, calculating individual
items and subranges as needed).

Range objects implement the "collections.abc.Sequence" ABC, and
provide features such as containment tests, element index lookup,
slicing and support for negative indices (see Sequence Types — list,
tuple, range):

>>> r = range(0, 20, 2)
>>> r
range(0, 20, 2)
>>> 11 in r
False
>>> 10 in r
True
>>> r.index(10)
5
>>> r[5]
10
>>> r[:5]
range(0, 10, 2)
>>> r[-1]
18

Testing range objects for equality with "==" and "!=" compares them as
sequences.  That is, two range objects are considered equal if they
represent the same sequence of values.  (Note that two range objects
that compare equal might have different "start", "stop" and "step"
attributes, for example "range(0) == range(2, 1, 3)" or "range(0, 3,
2) == range(0, 4, 2)".)

Changed in version 3.2: Implement the Sequence ABC. Support slicing
and negative indices. Test "int" objects for membership in constant
time instead of iterating through all items.

Changed in version 3.3: Define ‘==’ and ‘!=’ to compare range objects
based on the sequence of values they define (instead of comparing
based on object identity).

New in version 3.3: The "start", "stop" and "step" attributes.

See also:

  * The linspace recipe shows how to implement a lazy version of range
    suitable for floating point applications.
u�Mutable Sequence Types
**********************

The operations in the following table are defined on mutable sequence
types. The "collections.abc.MutableSequence" ABC is provided to make
it easier to correctly implement these operations on custom sequence
types.

In the table *s* is an instance of a mutable sequence type, *t* is any
iterable object and *x* is an arbitrary object that meets any type and
value restrictions imposed by *s* (for example, "bytearray" only
accepts integers that meet the value restriction "0 <= x <= 255").

+--------------------------------+----------------------------------+-----------------------+
| Operation                      | Result                           | Notes                 |
|================================|==================================|=======================|
| "s[i] = x"                     | item *i* of *s* is replaced by   |                       |
|                                | *x*                              |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s[i:j] = t"                   | slice of *s* from *i* to *j* is  |                       |
|                                | replaced by the contents of the  |                       |
|                                | iterable *t*                     |                       |
+--------------------------------+----------------------------------+-----------------------+
| "del s[i:j]"                   | same as "s[i:j] = []"            |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s[i:j:k] = t"                 | the elements of "s[i:j:k]" are   | (1)                   |
|                                | replaced by those of *t*         |                       |
+--------------------------------+----------------------------------+-----------------------+
| "del s[i:j:k]"                 | removes the elements of          |                       |
|                                | "s[i:j:k]" from the list         |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.append(x)"                  | appends *x* to the end of the    |                       |
|                                | sequence (same as                |                       |
|                                | "s[len(s):len(s)] = [x]")        |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.clear()"                    | removes all items from *s* (same | (5)                   |
|                                | as "del s[:]")                   |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.copy()"                     | creates a shallow copy of *s*    | (5)                   |
|                                | (same as "s[:]")                 |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.extend(t)" or "s += t"      | extends *s* with the contents of |                       |
|                                | *t* (for the most part the same  |                       |
|                                | as "s[len(s):len(s)] = t")       |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s *= n"                       | updates *s* with its contents    | (6)                   |
|                                | repeated *n* times               |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.insert(i, x)"               | inserts *x* into *s* at the      |                       |
|                                | index given by *i* (same as      |                       |
|                                | "s[i:i] = [x]")                  |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.pop()" or "s.pop(i)"        | retrieves the item at *i* and    | (2)                   |
|                                | also removes it from *s*         |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.remove(x)"                  | remove the first item from *s*   | (3)                   |
|                                | where "s[i]" is equal to *x*     |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.reverse()"                  | reverses the items of *s* in     | (4)                   |
|                                | place                            |                       |
+--------------------------------+----------------------------------+-----------------------+

Notes:

1. *t* must have the same length as the slice it is replacing.

2. The optional argument *i* defaults to "-1", so that by default the
   last item is removed and returned.

3. "remove()" raises "ValueError" when *x* is not found in *s*.

4. The "reverse()" method modifies the sequence in place for economy
   of space when reversing a large sequence.  To remind users that it
   operates by side effect, it does not return the reversed sequence.

5. "clear()" and "copy()" are included for consistency with the
   interfaces of mutable containers that don’t support slicing
   operations (such as "dict" and "set"). "copy()" is not part of the
   "collections.abc.MutableSequence" ABC, but most concrete mutable
   sequence classes provide it.

   New in version 3.3: "clear()" and "copy()" methods.

6. The value *n* is an integer, or an object implementing
   "__index__()".  Zero and negative values of *n* clear the sequence.
   Items in the sequence are not copied; they are referenced multiple
   times, as explained for "s * n" under Common Sequence Operations.
a~Unary arithmetic and bitwise operations
***************************************

All unary arithmetic and bitwise operations have the same priority:

   u_expr ::= power | "-" u_expr | "+" u_expr | "~" u_expr

The unary "-" (minus) operator yields the negation of its numeric
argument.

The unary "+" (plus) operator yields its numeric argument unchanged.

The unary "~" (invert) operator yields the bitwise inversion of its
integer argument.  The bitwise inversion of "x" is defined as
"-(x+1)".  It only applies to integral numbers.

In all three cases, if the argument does not have the proper type, a
"TypeError" exception is raised.
u�The "while" statement
*********************

The "while" statement is used for repeated execution as long as an
expression is true:

   while_stmt ::= "while" assignment_expression ":" suite
                  ["else" ":" suite]

This repeatedly tests the expression and, if it is true, executes the
first suite; if the expression is false (which may be the first time
it is tested) the suite of the "else" clause, if present, is executed
and the loop terminates.

A "break" statement executed in the first suite terminates the loop
without executing the "else" clause’s suite.  A "continue" statement
executed in the first suite skips the rest of the suite and goes back
to testing the expression.
uMThe "with" statement
********************

The "with" statement is used to wrap the execution of a block with
methods defined by a context manager (see section With Statement
Context Managers). This allows common "try"…"except"…"finally" usage
patterns to be encapsulated for convenient reuse.

   with_stmt ::= "with" with_item ("," with_item)* ":" suite
   with_item ::= expression ["as" target]

The execution of the "with" statement with one “item” proceeds as
follows:

1. The context expression (the expression given in the "with_item") is
   evaluated to obtain a context manager.

2. The context manager’s "__enter__()" is loaded for later use.

3. The context manager’s "__exit__()" is loaded for later use.

4. The context manager’s "__enter__()" method is invoked.

5. If a target was included in the "with" statement, the return value
   from "__enter__()" is assigned to it.

   Note:

     The "with" statement guarantees that if the "__enter__()" method
     returns without an error, then "__exit__()" will always be
     called. Thus, if an error occurs during the assignment to the
     target list, it will be treated the same as an error occurring
     within the suite would be. See step 6 below.

6. The suite is executed.

7. The context manager’s "__exit__()" method is invoked.  If an
   exception caused the suite to be exited, its type, value, and
   traceback are passed as arguments to "__exit__()". Otherwise, three
   "None" arguments are supplied.

   If the suite was exited due to an exception, and the return value
   from the "__exit__()" method was false, the exception is reraised.
   If the return value was true, the exception is suppressed, and
   execution continues with the statement following the "with"
   statement.

   If the suite was exited for any reason other than an exception, the
   return value from "__exit__()" is ignored, and execution proceeds
   at the normal location for the kind of exit that was taken.

The following code:

   with EXPRESSION as TARGET:
       SUITE

is semantically equivalent to:

   manager = (EXPRESSION)
   enter = type(manager).__enter__
   exit = type(manager).__exit__
   value = enter(manager)
   hit_except = False

   try:
       TARGET = value
       SUITE
   except:
       hit_except = True
       if not exit(manager, *sys.exc_info()):
           raise
   finally:
       if not hit_except:
           exit(manager, None, None, None)

With more than one item, the context managers are processed as if
multiple "with" statements were nested:

   with A() as a, B() as b:
       SUITE

is semantically equivalent to:

   with A() as a:
       with B() as b:
           SUITE

Changed in version 3.1: Support for multiple context expressions.

See also:

  **PEP 343** - The “with” statement
     The specification, background, and examples for the Python "with"
     statement.
a,The "yield" statement
*********************

   yield_stmt ::= yield_expression

A "yield" statement is semantically equivalent to a yield expression.
The yield statement can be used to omit the parentheses that would
otherwise be required in the equivalent yield expression statement.
For example, the yield statements

   yield <expr>
   yield from <expr>

are equivalent to the yield expression statements

   (yield <expr>)
   (yield from <expr>)

Yield expressions and statements are only used when defining a
*generator* function, and are only used in the body of the generator
function.  Using yield in a function definition is sufficient to cause
that definition to create a generator function instead of a normal
function.

For full details of "yield" semantics, refer to the Yield expressions
section.
)O�assertZ
assignment�asynczatom-identifiersz
atom-literalszattribute-accesszattribute-referencesZ	augassign�awaitZbinaryZbitwisezbltin-code-objectszbltin-ellipsis-objectzbltin-null-objectzbltin-type-objectsZbooleans�breakzcallable-typesZcalls�classZcomparisonsZcompoundzcontext-managers�continueZconversionsZ
customizationZdebugger�del�dictzdynamic-features�else�
exceptionsZ	execmodelZ	exprlistsZfloating�forZ
formatstringsZfunction�globalz
id-classesZidentifiers�ifZ	imaginary�import�inZintegers�lambdaZlistsZnaming�nonlocalZnumbersz
numeric-typesZobjectszoperator-summary�passZpower�raise�returnzsequence-typesZshiftingZslicingsZspecialattrsZspecialnameszstring-methodsZstringsZ
subscriptions�truth�try�typesZtypesfunctionsZtypesmappingZtypesmethodsZtypesmodulesZtypesseqztypesseq-mutableZunary�while�with�yieldN)Ztopics�rr�)/usr/lib64/python3.8/pydoc_data/topics.py�<module>s'}(@	X1	=`bQ>J:3MD%I
H+1&.LN3"o#p3=^ai9;K9%Hh�������������������������������������������������������������������������������������������������������������pydoc_data/__pycache__/__init__.cpython-38.opt-2.pyc000064400000000206151153537640016222 0ustar00U

��.e�@sdS)N�rrr�+/usr/lib64/python3.8/pydoc_data/__init__.py�<module>�pydoc_data/__pycache__/__init__.cpython-38.pyc000064400000000206151153537640015262 0ustar00U

��.e�@sdS)N�rrr�+/usr/lib64/python3.8/pydoc_data/__init__.py�<module>�pydoc_data/__pycache__/topics.cpython-38.opt-2.pyc000064400001477206151153537640016007 0ustar00U

e5d�s
�P@s�dddddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(dd)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCdDdEdFdGdHdIdJdKdLdMdN�OZdOS)PauThe "assert" statement
**********************

Assert statements are a convenient way to insert debugging assertions
into a program:

   assert_stmt ::= "assert" expression ["," expression]

The simple form, "assert expression", is equivalent to

   if __debug__:
       if not expression: raise AssertionError

The extended form, "assert expression1, expression2", is equivalent to

   if __debug__:
       if not expression1: raise AssertionError(expression2)

These equivalences assume that "__debug__" and "AssertionError" refer
to the built-in variables with those names.  In the current
implementation, the built-in variable "__debug__" is "True" under
normal circumstances, "False" when optimization is requested (command
line option "-O").  The current code generator emits no code for an
assert statement when optimization is requested at compile time.  Note
that it is unnecessary to include the source code for the expression
that failed in the error message; it will be displayed as part of the
stack trace.

Assignments to "__debug__" are illegal.  The value for the built-in
variable is determined when the interpreter starts.
u�,Assignment statements
*********************

Assignment statements are used to (re)bind names to values and to
modify attributes or items of mutable objects:

   assignment_stmt ::= (target_list "=")+ (starred_expression | yield_expression)
   target_list     ::= target ("," target)* [","]
   target          ::= identifier
              | "(" [target_list] ")"
              | "[" [target_list] "]"
              | attributeref
              | subscription
              | slicing
              | "*" target

(See section Primaries for the syntax definitions for *attributeref*,
*subscription*, and *slicing*.)

An assignment statement evaluates the expression list (remember that
this can be a single expression or a comma-separated list, the latter
yielding a tuple) and assigns the single resulting object to each of
the target lists, from left to right.

Assignment is defined recursively depending on the form of the target
(list). When a target is part of a mutable object (an attribute
reference, subscription or slicing), the mutable object must
ultimately perform the assignment and decide about its validity, and
may raise an exception if the assignment is unacceptable.  The rules
observed by various types and the exceptions raised are given with the
definition of the object types (see section The standard type
hierarchy).

Assignment of an object to a target list, optionally enclosed in
parentheses or square brackets, is recursively defined as follows.

* If the target list is a single target with no trailing comma,
  optionally in parentheses, the object is assigned to that target.

* Else: The object must be an iterable with the same number of items
  as there are targets in the target list, and the items are assigned,
  from left to right, to the corresponding targets.

  * If the target list contains one target prefixed with an asterisk,
    called a “starred” target: The object must be an iterable with at
    least as many items as there are targets in the target list, minus
    one.  The first items of the iterable are assigned, from left to
    right, to the targets before the starred target.  The final items
    of the iterable are assigned to the targets after the starred
    target.  A list of the remaining items in the iterable is then
    assigned to the starred target (the list can be empty).

  * Else: The object must be an iterable with the same number of items
    as there are targets in the target list, and the items are
    assigned, from left to right, to the corresponding targets.

Assignment of an object to a single target is recursively defined as
follows.

* If the target is an identifier (name):

  * If the name does not occur in a "global" or "nonlocal" statement
    in the current code block: the name is bound to the object in the
    current local namespace.

  * Otherwise: the name is bound to the object in the global namespace
    or the outer namespace determined by "nonlocal", respectively.

  The name is rebound if it was already bound.  This may cause the
  reference count for the object previously bound to the name to reach
  zero, causing the object to be deallocated and its destructor (if it
  has one) to be called.

* If the target is an attribute reference: The primary expression in
  the reference is evaluated.  It should yield an object with
  assignable attributes; if this is not the case, "TypeError" is
  raised.  That object is then asked to assign the assigned object to
  the given attribute; if it cannot perform the assignment, it raises
  an exception (usually but not necessarily "AttributeError").

  Note: If the object is a class instance and the attribute reference
  occurs on both sides of the assignment operator, the right-hand side
  expression, "a.x" can access either an instance attribute or (if no
  instance attribute exists) a class attribute.  The left-hand side
  target "a.x" is always set as an instance attribute, creating it if
  necessary.  Thus, the two occurrences of "a.x" do not necessarily
  refer to the same attribute: if the right-hand side expression
  refers to a class attribute, the left-hand side creates a new
  instance attribute as the target of the assignment:

     class Cls:
         x = 3             # class variable
     inst = Cls()
     inst.x = inst.x + 1   # writes inst.x as 4 leaving Cls.x as 3

  This description does not necessarily apply to descriptor
  attributes, such as properties created with "property()".

* If the target is a subscription: The primary expression in the
  reference is evaluated.  It should yield either a mutable sequence
  object (such as a list) or a mapping object (such as a dictionary).
  Next, the subscript expression is evaluated.

  If the primary is a mutable sequence object (such as a list), the
  subscript must yield an integer.  If it is negative, the sequence’s
  length is added to it.  The resulting value must be a nonnegative
  integer less than the sequence’s length, and the sequence is asked
  to assign the assigned object to its item with that index.  If the
  index is out of range, "IndexError" is raised (assignment to a
  subscripted sequence cannot add new items to a list).

  If the primary is a mapping object (such as a dictionary), the
  subscript must have a type compatible with the mapping’s key type,
  and the mapping is then asked to create a key/datum pair which maps
  the subscript to the assigned object.  This can either replace an
  existing key/value pair with the same key value, or insert a new
  key/value pair (if no key with the same value existed).

  For user-defined objects, the "__setitem__()" method is called with
  appropriate arguments.

* If the target is a slicing: The primary expression in the reference
  is evaluated.  It should yield a mutable sequence object (such as a
  list).  The assigned object should be a sequence object of the same
  type.  Next, the lower and upper bound expressions are evaluated,
  insofar they are present; defaults are zero and the sequence’s
  length.  The bounds should evaluate to integers. If either bound is
  negative, the sequence’s length is added to it.  The resulting
  bounds are clipped to lie between zero and the sequence’s length,
  inclusive.  Finally, the sequence object is asked to replace the
  slice with the items of the assigned sequence.  The length of the
  slice may be different from the length of the assigned sequence,
  thus changing the length of the target sequence, if the target
  sequence allows it.

**CPython implementation detail:** In the current implementation, the
syntax for targets is taken to be the same as for expressions, and
invalid syntax is rejected during the code generation phase, causing
less detailed error messages.

Although the definition of assignment implies that overlaps between
the left-hand side and the right-hand side are ‘simultaneous’ (for
example "a, b = b, a" swaps two variables), overlaps *within* the
collection of assigned-to variables occur left-to-right, sometimes
resulting in confusion.  For instance, the following program prints
"[0, 2]":

   x = [0, 1]
   i = 0
   i, x[i] = 1, 2         # i is updated, then x[i] is updated
   print(x)

See also:

  **PEP 3132** - Extended Iterable Unpacking
     The specification for the "*target" feature.


Augmented assignment statements
===============================

Augmented assignment is the combination, in a single statement, of a
binary operation and an assignment statement:

   augmented_assignment_stmt ::= augtarget augop (expression_list | yield_expression)
   augtarget                 ::= identifier | attributeref | subscription | slicing
   augop                     ::= "+=" | "-=" | "*=" | "@=" | "/=" | "//=" | "%=" | "**="
             | ">>=" | "<<=" | "&=" | "^=" | "|="

(See section Primaries for the syntax definitions of the last three
symbols.)

An augmented assignment evaluates the target (which, unlike normal
assignment statements, cannot be an unpacking) and the expression
list, performs the binary operation specific to the type of assignment
on the two operands, and assigns the result to the original target.
The target is only evaluated once.

An augmented assignment expression like "x += 1" can be rewritten as
"x = x + 1" to achieve a similar, but not exactly equal effect. In the
augmented version, "x" is only evaluated once. Also, when possible,
the actual operation is performed *in-place*, meaning that rather than
creating a new object and assigning that to the target, the old object
is modified instead.

Unlike normal assignments, augmented assignments evaluate the left-
hand side *before* evaluating the right-hand side.  For example, "a[i]
+= f(x)" first looks-up "a[i]", then it evaluates "f(x)" and performs
the addition, and lastly, it writes the result back to "a[i]".

With the exception of assigning to tuples and multiple targets in a
single statement, the assignment done by augmented assignment
statements is handled the same way as normal assignments. Similarly,
with the exception of the possible *in-place* behavior, the binary
operation performed by augmented assignment is the same as the normal
binary operations.

For targets which are attribute references, the same caveat about
class and instance attributes applies as for regular assignments.


Annotated assignment statements
===============================

*Annotation* assignment is the combination, in a single statement, of
a variable or attribute annotation and an optional assignment
statement:

   annotated_assignment_stmt ::= augtarget ":" expression
                                 ["=" (starred_expression | yield_expression)]

The difference from normal Assignment statements is that only single
target is allowed.

For simple names as assignment targets, if in class or module scope,
the annotations are evaluated and stored in a special class or module
attribute "__annotations__" that is a dictionary mapping from variable
names (mangled if private) to evaluated annotations. This attribute is
writable and is automatically created at the start of class or module
body execution, if annotations are found statically.

For expressions as assignment targets, the annotations are evaluated
if in class or module scope, but not stored.

If a name is annotated in a function scope, then this name is local
for that scope. Annotations are never evaluated and stored in function
scopes.

If the right hand side is present, an annotated assignment performs
the actual assignment before evaluating annotations (where
applicable). If the right hand side is not present for an expression
target, then the interpreter evaluates the target except for the last
"__setitem__()" or "__setattr__()" call.

See also:

  **PEP 526** - Syntax for Variable Annotations
     The proposal that added syntax for annotating the types of
     variables (including class variables and instance variables),
     instead of expressing them through comments.

  **PEP 484** - Type hints
     The proposal that added the "typing" module to provide a standard
     syntax for type annotations that can be used in static analysis
     tools and IDEs.

Changed in version 3.8: Now annotated assignments allow same
expressions in the right hand side as the regular assignments.
Previously, some expressions (like un-parenthesized tuple expressions)
caused a syntax error.
u>
Coroutines
**********

New in version 3.5.


Coroutine function definition
=============================

   async_funcdef ::= [decorators] "async" "def" funcname "(" [parameter_list] ")"
                     ["->" expression] ":" suite

Execution of Python coroutines can be suspended and resumed at many
points (see *coroutine*).  Inside the body of a coroutine function,
"await" and "async" identifiers become reserved keywords; "await"
expressions, "async for" and "async with" can only be used in
coroutine function bodies.

Functions defined with "async def" syntax are always coroutine
functions, even if they do not contain "await" or "async" keywords.

It is a "SyntaxError" to use a "yield from" expression inside the body
of a coroutine function.

An example of a coroutine function:

   async def func(param1, param2):
       do_stuff()
       await some_coroutine()


The "async for" statement
=========================

   async_for_stmt ::= "async" for_stmt

An *asynchronous iterable* is able to call asynchronous code in its
*iter* implementation, and *asynchronous iterator* can call
asynchronous code in its *next* method.

The "async for" statement allows convenient iteration over
asynchronous iterators.

The following code:

   async for TARGET in ITER:
       SUITE
   else:
       SUITE2

Is semantically equivalent to:

   iter = (ITER)
   iter = type(iter).__aiter__(iter)
   running = True

   while running:
       try:
           TARGET = await type(iter).__anext__(iter)
       except StopAsyncIteration:
           running = False
       else:
           SUITE
   else:
       SUITE2

See also "__aiter__()" and "__anext__()" for details.

It is a "SyntaxError" to use an "async for" statement outside the body
of a coroutine function.


The "async with" statement
==========================

   async_with_stmt ::= "async" with_stmt

An *asynchronous context manager* is a *context manager* that is able
to suspend execution in its *enter* and *exit* methods.

The following code:

   async with EXPRESSION as TARGET:
       SUITE

is semantically equivalent to:

   manager = (EXPRESSION)
   aexit = type(manager).__aexit__
   aenter = type(manager).__aenter__
   value = await aenter(manager)
   hit_except = False

   try:
       TARGET = value
       SUITE
   except:
       hit_except = True
       if not await aexit(manager, *sys.exc_info()):
           raise
   finally:
       if not hit_except:
           await aexit(manager, None, None, None)

See also "__aenter__()" and "__aexit__()" for details.

It is a "SyntaxError" to use an "async with" statement outside the
body of a coroutine function.

See also:

  **PEP 492** - Coroutines with async and await syntax
     The proposal that made coroutines a proper standalone concept in
     Python, and added supporting syntax.

-[ Footnotes ]-

[1] The exception is propagated to the invocation stack unless there
    is a "finally" clause which happens to raise another exception.
    That new exception causes the old one to be lost.

[2] A string literal appearing as the first statement in the function
    body is transformed into the function’s "__doc__" attribute and
    therefore the function’s *docstring*.

[3] A string literal appearing as the first statement in the class
    body is transformed into the namespace’s "__doc__" item and
    therefore the class’s *docstring*.
a�Identifiers (Names)
*******************

An identifier occurring as an atom is a name.  See section Identifiers
and keywords for lexical definition and section Naming and binding for
documentation of naming and binding.

When the name is bound to an object, evaluation of the atom yields
that object. When a name is not bound, an attempt to evaluate it
raises a "NameError" exception.

**Private name mangling:** When an identifier that textually occurs in
a class definition begins with two or more underscore characters and
does not end in two or more underscores, it is considered a *private
name* of that class. Private names are transformed to a longer form
before code is generated for them.  The transformation inserts the
class name, with leading underscores removed and a single underscore
inserted, in front of the name.  For example, the identifier "__spam"
occurring in a class named "Ham" will be transformed to "_Ham__spam".
This transformation is independent of the syntactical context in which
the identifier is used.  If the transformed name is extremely long
(longer than 255 characters), implementation defined truncation may
happen. If the class name consists only of underscores, no
transformation is done.
u
Literals
********

Python supports string and bytes literals and various numeric
literals:

   literal ::= stringliteral | bytesliteral
               | integer | floatnumber | imagnumber

Evaluation of a literal yields an object of the given type (string,
bytes, integer, floating point number, complex number) with the given
value.  The value may be approximated in the case of floating point
and imaginary (complex) literals.  See section Literals for details.

All literals correspond to immutable data types, and hence the
object’s identity is less important than its value.  Multiple
evaluations of literals with the same value (either the same
occurrence in the program text or a different occurrence) may obtain
the same object or a different object with the same value.
uA7Customizing attribute access
****************************

The following methods can be defined to customize the meaning of
attribute access (use of, assignment to, or deletion of "x.name") for
class instances.

object.__getattr__(self, name)

   Called when the default attribute access fails with an
   "AttributeError" (either "__getattribute__()" raises an
   "AttributeError" because *name* is not an instance attribute or an
   attribute in the class tree for "self"; or "__get__()" of a *name*
   property raises "AttributeError").  This method should either
   return the (computed) attribute value or raise an "AttributeError"
   exception.

   Note that if the attribute is found through the normal mechanism,
   "__getattr__()" is not called.  (This is an intentional asymmetry
   between "__getattr__()" and "__setattr__()".) This is done both for
   efficiency reasons and because otherwise "__getattr__()" would have
   no way to access other attributes of the instance.  Note that at
   least for instance variables, you can fake total control by not
   inserting any values in the instance attribute dictionary (but
   instead inserting them in another object).  See the
   "__getattribute__()" method below for a way to actually get total
   control over attribute access.

object.__getattribute__(self, name)

   Called unconditionally to implement attribute accesses for
   instances of the class. If the class also defines "__getattr__()",
   the latter will not be called unless "__getattribute__()" either
   calls it explicitly or raises an "AttributeError". This method
   should return the (computed) attribute value or raise an
   "AttributeError" exception. In order to avoid infinite recursion in
   this method, its implementation should always call the base class
   method with the same name to access any attributes it needs, for
   example, "object.__getattribute__(self, name)".

   Note:

     This method may still be bypassed when looking up special methods
     as the result of implicit invocation via language syntax or
     built-in functions. See Special method lookup.

   For certain sensitive attribute accesses, raises an auditing event
   "object.__getattr__" with arguments "obj" and "name".

object.__setattr__(self, name, value)

   Called when an attribute assignment is attempted.  This is called
   instead of the normal mechanism (i.e. store the value in the
   instance dictionary). *name* is the attribute name, *value* is the
   value to be assigned to it.

   If "__setattr__()" wants to assign to an instance attribute, it
   should call the base class method with the same name, for example,
   "object.__setattr__(self, name, value)".

   For certain sensitive attribute assignments, raises an auditing
   event "object.__setattr__" with arguments "obj", "name", "value".

object.__delattr__(self, name)

   Like "__setattr__()" but for attribute deletion instead of
   assignment.  This should only be implemented if "del obj.name" is
   meaningful for the object.

   For certain sensitive attribute deletions, raises an auditing event
   "object.__delattr__" with arguments "obj" and "name".

object.__dir__(self)

   Called when "dir()" is called on the object. A sequence must be
   returned. "dir()" converts the returned sequence to a list and
   sorts it.


Customizing module attribute access
===================================

Special names "__getattr__" and "__dir__" can be also used to
customize access to module attributes. The "__getattr__" function at
the module level should accept one argument which is the name of an
attribute and return the computed value or raise an "AttributeError".
If an attribute is not found on a module object through the normal
lookup, i.e. "object.__getattribute__()", then "__getattr__" is
searched in the module "__dict__" before raising an "AttributeError".
If found, it is called with the attribute name and the result is
returned.

The "__dir__" function should accept no arguments, and return a
sequence of strings that represents the names accessible on module. If
present, this function overrides the standard "dir()" search on a
module.

For a more fine grained customization of the module behavior (setting
attributes, properties, etc.), one can set the "__class__" attribute
of a module object to a subclass of "types.ModuleType". For example:

   import sys
   from types import ModuleType

   class VerboseModule(ModuleType):
       def __repr__(self):
           return f'Verbose {self.__name__}'

       def __setattr__(self, attr, value):
           print(f'Setting {attr}...')
           super().__setattr__(attr, value)

   sys.modules[__name__].__class__ = VerboseModule

Note:

  Defining module "__getattr__" and setting module "__class__" only
  affect lookups made using the attribute access syntax – directly
  accessing the module globals (whether by code within the module, or
  via a reference to the module’s globals dictionary) is unaffected.

Changed in version 3.5: "__class__" module attribute is now writable.

New in version 3.7: "__getattr__" and "__dir__" module attributes.

See also:

  **PEP 562** - Module __getattr__ and __dir__
     Describes the "__getattr__" and "__dir__" functions on modules.


Implementing Descriptors
========================

The following methods only apply when an instance of the class
containing the method (a so-called *descriptor* class) appears in an
*owner* class (the descriptor must be in either the owner’s class
dictionary or in the class dictionary for one of its parents).  In the
examples below, “the attribute” refers to the attribute whose name is
the key of the property in the owner class’ "__dict__".

object.__get__(self, instance, owner=None)

   Called to get the attribute of the owner class (class attribute
   access) or of an instance of that class (instance attribute
   access). The optional *owner* argument is the owner class, while
   *instance* is the instance that the attribute was accessed through,
   or "None" when the attribute is accessed through the *owner*.

   This method should return the computed attribute value or raise an
   "AttributeError" exception.

   **PEP 252** specifies that "__get__()" is callable with one or two
   arguments.  Python’s own built-in descriptors support this
   specification; however, it is likely that some third-party tools
   have descriptors that require both arguments.  Python’s own
   "__getattribute__()" implementation always passes in both arguments
   whether they are required or not.

object.__set__(self, instance, value)

   Called to set the attribute on an instance *instance* of the owner
   class to a new value, *value*.

   Note, adding "__set__()" or "__delete__()" changes the kind of
   descriptor to a “data descriptor”.  See Invoking Descriptors for
   more details.

object.__delete__(self, instance)

   Called to delete the attribute on an instance *instance* of the
   owner class.

object.__set_name__(self, owner, name)

   Called at the time the owning class *owner* is created. The
   descriptor has been assigned to *name*.

   Note:

     "__set_name__()" is only called implicitly as part of the "type"
     constructor, so it will need to be called explicitly with the
     appropriate parameters when a descriptor is added to a class
     after initial creation:

        class A:
           pass
        descr = custom_descriptor()
        A.attr = descr
        descr.__set_name__(A, 'attr')

     See Creating the class object for more details.

   New in version 3.6.

The attribute "__objclass__" is interpreted by the "inspect" module as
specifying the class where this object was defined (setting this
appropriately can assist in runtime introspection of dynamic class
attributes). For callables, it may indicate that an instance of the
given type (or a subclass) is expected or required as the first
positional argument (for example, CPython sets this attribute for
unbound methods that are implemented in C).


Invoking Descriptors
====================

In general, a descriptor is an object attribute with “binding
behavior”, one whose attribute access has been overridden by methods
in the descriptor protocol:  "__get__()", "__set__()", and
"__delete__()". If any of those methods are defined for an object, it
is said to be a descriptor.

The default behavior for attribute access is to get, set, or delete
the attribute from an object’s dictionary. For instance, "a.x" has a
lookup chain starting with "a.__dict__['x']", then
"type(a).__dict__['x']", and continuing through the base classes of
"type(a)" excluding metaclasses.

However, if the looked-up value is an object defining one of the
descriptor methods, then Python may override the default behavior and
invoke the descriptor method instead.  Where this occurs in the
precedence chain depends on which descriptor methods were defined and
how they were called.

The starting point for descriptor invocation is a binding, "a.x". How
the arguments are assembled depends on "a":

Direct Call
   The simplest and least common call is when user code directly
   invokes a descriptor method:    "x.__get__(a)".

Instance Binding
   If binding to an object instance, "a.x" is transformed into the
   call: "type(a).__dict__['x'].__get__(a, type(a))".

Class Binding
   If binding to a class, "A.x" is transformed into the call:
   "A.__dict__['x'].__get__(None, A)".

Super Binding
   If "a" is an instance of "super", then the binding "super(B,
   obj).m()" searches "obj.__class__.__mro__" for the base class "A"
   immediately preceding "B" and then invokes the descriptor with the
   call: "A.__dict__['m'].__get__(obj, obj.__class__)".

For instance bindings, the precedence of descriptor invocation depends
on which descriptor methods are defined.  A descriptor can define any
combination of "__get__()", "__set__()" and "__delete__()".  If it
does not define "__get__()", then accessing the attribute will return
the descriptor object itself unless there is a value in the object’s
instance dictionary.  If the descriptor defines "__set__()" and/or
"__delete__()", it is a data descriptor; if it defines neither, it is
a non-data descriptor.  Normally, data descriptors define both
"__get__()" and "__set__()", while non-data descriptors have just the
"__get__()" method.  Data descriptors with "__set__()" and "__get__()"
defined always override a redefinition in an instance dictionary.  In
contrast, non-data descriptors can be overridden by instances.

Python methods (including "staticmethod()" and "classmethod()") are
implemented as non-data descriptors.  Accordingly, instances can
redefine and override methods.  This allows individual instances to
acquire behaviors that differ from other instances of the same class.

The "property()" function is implemented as a data descriptor.
Accordingly, instances cannot override the behavior of a property.


__slots__
=========

*__slots__* allow us to explicitly declare data members (like
properties) and deny the creation of *__dict__* and *__weakref__*
(unless explicitly declared in *__slots__* or available in a parent.)

The space saved over using *__dict__* can be significant. Attribute
lookup speed can be significantly improved as well.

object.__slots__

   This class variable can be assigned a string, iterable, or sequence
   of strings with variable names used by instances.  *__slots__*
   reserves space for the declared variables and prevents the
   automatic creation of *__dict__* and *__weakref__* for each
   instance.


Notes on using *__slots__*
--------------------------

* When inheriting from a class without *__slots__*, the *__dict__* and
  *__weakref__* attribute of the instances will always be accessible.

* Without a *__dict__* variable, instances cannot be assigned new
  variables not listed in the *__slots__* definition.  Attempts to
  assign to an unlisted variable name raises "AttributeError". If
  dynamic assignment of new variables is desired, then add
  "'__dict__'" to the sequence of strings in the *__slots__*
  declaration.

* Without a *__weakref__* variable for each instance, classes defining
  *__slots__* do not support weak references to its instances. If weak
  reference support is needed, then add "'__weakref__'" to the
  sequence of strings in the *__slots__* declaration.

* *__slots__* are implemented at the class level by creating
  descriptors (Implementing Descriptors) for each variable name.  As a
  result, class attributes cannot be used to set default values for
  instance variables defined by *__slots__*; otherwise, the class
  attribute would overwrite the descriptor assignment.

* The action of a *__slots__* declaration is not limited to the class
  where it is defined.  *__slots__* declared in parents are available
  in child classes. However, child subclasses will get a *__dict__*
  and *__weakref__* unless they also define *__slots__* (which should
  only contain names of any *additional* slots).

* If a class defines a slot also defined in a base class, the instance
  variable defined by the base class slot is inaccessible (except by
  retrieving its descriptor directly from the base class). This
  renders the meaning of the program undefined.  In the future, a
  check may be added to prevent this.

* Nonempty *__slots__* does not work for classes derived from
  “variable-length” built-in types such as "int", "bytes" and "tuple".

* Any non-string iterable may be assigned to *__slots__*. Mappings may
  also be used; however, in the future, special meaning may be
  assigned to the values corresponding to each key.

* *__class__* assignment works only if both classes have the same
  *__slots__*.

* Multiple inheritance with multiple slotted parent classes can be
  used, but only one parent is allowed to have attributes created by
  slots (the other bases must have empty slot layouts) - violations
  raise "TypeError".

* If an iterator is used for *__slots__* then a descriptor is created
  for each of the iterator’s values. However, the *__slots__*
  attribute will be an empty iterator.
a�Attribute references
********************

An attribute reference is a primary followed by a period and a name:

   attributeref ::= primary "." identifier

The primary must evaluate to an object of a type that supports
attribute references, which most objects do.  This object is then
asked to produce the attribute whose name is the identifier.  This
production can be customized by overriding the "__getattr__()" method.
If this attribute is not available, the exception "AttributeError" is
raised.  Otherwise, the type and value of the object produced is
determined by the object.  Multiple evaluations of the same attribute
reference may yield different objects.
a�Augmented assignment statements
*******************************

Augmented assignment is the combination, in a single statement, of a
binary operation and an assignment statement:

   augmented_assignment_stmt ::= augtarget augop (expression_list | yield_expression)
   augtarget                 ::= identifier | attributeref | subscription | slicing
   augop                     ::= "+=" | "-=" | "*=" | "@=" | "/=" | "//=" | "%=" | "**="
             | ">>=" | "<<=" | "&=" | "^=" | "|="

(See section Primaries for the syntax definitions of the last three
symbols.)

An augmented assignment evaluates the target (which, unlike normal
assignment statements, cannot be an unpacking) and the expression
list, performs the binary operation specific to the type of assignment
on the two operands, and assigns the result to the original target.
The target is only evaluated once.

An augmented assignment expression like "x += 1" can be rewritten as
"x = x + 1" to achieve a similar, but not exactly equal effect. In the
augmented version, "x" is only evaluated once. Also, when possible,
the actual operation is performed *in-place*, meaning that rather than
creating a new object and assigning that to the target, the old object
is modified instead.

Unlike normal assignments, augmented assignments evaluate the left-
hand side *before* evaluating the right-hand side.  For example, "a[i]
+= f(x)" first looks-up "a[i]", then it evaluates "f(x)" and performs
the addition, and lastly, it writes the result back to "a[i]".

With the exception of assigning to tuples and multiple targets in a
single statement, the assignment done by augmented assignment
statements is handled the same way as normal assignments. Similarly,
with the exception of the possible *in-place* behavior, the binary
operation performed by augmented assignment is the same as the normal
binary operations.

For targets which are attribute references, the same caveat about
class and instance attributes applies as for regular assignments.
z�Await expression
****************

Suspend the execution of *coroutine* on an *awaitable* object. Can
only be used inside a *coroutine function*.

   await_expr ::= "await" primary

New in version 3.5.
ujBinary arithmetic operations
****************************

The binary arithmetic operations have the conventional priority
levels.  Note that some of these operations also apply to certain non-
numeric types.  Apart from the power operator, there are only two
levels, one for multiplicative operators and one for additive
operators:

   m_expr ::= u_expr | m_expr "*" u_expr | m_expr "@" m_expr |
              m_expr "//" u_expr | m_expr "/" u_expr |
              m_expr "%" u_expr
   a_expr ::= m_expr | a_expr "+" m_expr | a_expr "-" m_expr

The "*" (multiplication) operator yields the product of its arguments.
The arguments must either both be numbers, or one argument must be an
integer and the other must be a sequence. In the former case, the
numbers are converted to a common type and then multiplied together.
In the latter case, sequence repetition is performed; a negative
repetition factor yields an empty sequence.

The "@" (at) operator is intended to be used for matrix
multiplication.  No builtin Python types implement this operator.

New in version 3.5.

The "/" (division) and "//" (floor division) operators yield the
quotient of their arguments.  The numeric arguments are first
converted to a common type. Division of integers yields a float, while
floor division of integers results in an integer; the result is that
of mathematical division with the ‘floor’ function applied to the
result.  Division by zero raises the "ZeroDivisionError" exception.

The "%" (modulo) operator yields the remainder from the division of
the first argument by the second.  The numeric arguments are first
converted to a common type.  A zero right argument raises the
"ZeroDivisionError" exception.  The arguments may be floating point
numbers, e.g., "3.14%0.7" equals "0.34" (since "3.14" equals "4*0.7 +
0.34".)  The modulo operator always yields a result with the same sign
as its second operand (or zero); the absolute value of the result is
strictly smaller than the absolute value of the second operand [1].

The floor division and modulo operators are connected by the following
identity: "x == (x//y)*y + (x%y)".  Floor division and modulo are also
connected with the built-in function "divmod()": "divmod(x, y) ==
(x//y, x%y)". [2].

In addition to performing the modulo operation on numbers, the "%"
operator is also overloaded by string objects to perform old-style
string formatting (also known as interpolation).  The syntax for
string formatting is described in the Python Library Reference,
section printf-style String Formatting.

The floor division operator, the modulo operator, and the "divmod()"
function are not defined for complex numbers.  Instead, convert to a
floating point number using the "abs()" function if appropriate.

The "+" (addition) operator yields the sum of its arguments.  The
arguments must either both be numbers or both be sequences of the same
type.  In the former case, the numbers are converted to a common type
and then added together. In the latter case, the sequences are
concatenated.

The "-" (subtraction) operator yields the difference of its arguments.
The numeric arguments are first converted to a common type.
a$Binary bitwise operations
*************************

Each of the three bitwise operations has a different priority level:

   and_expr ::= shift_expr | and_expr "&" shift_expr
   xor_expr ::= and_expr | xor_expr "^" and_expr
   or_expr  ::= xor_expr | or_expr "|" xor_expr

The "&" operator yields the bitwise AND of its arguments, which must
be integers.

The "^" operator yields the bitwise XOR (exclusive OR) of its
arguments, which must be integers.

The "|" operator yields the bitwise (inclusive) OR of its arguments,
which must be integers.
u�Code Objects
************

Code objects are used by the implementation to represent “pseudo-
compiled” executable Python code such as a function body. They differ
from function objects because they don’t contain a reference to their
global execution environment.  Code objects are returned by the built-
in "compile()" function and can be extracted from function objects
through their "__code__" attribute. See also the "code" module.

Accessing "__code__" raises an auditing event "object.__getattr__"
with arguments "obj" and ""__code__"".

A code object can be executed or evaluated by passing it (instead of a
source string) to the "exec()" or "eval()"  built-in functions.

See The standard type hierarchy for more information.
a.The Ellipsis Object
*******************

This object is commonly used by slicing (see Slicings).  It supports
no special operations.  There is exactly one ellipsis object, named
"Ellipsis" (a built-in name).  "type(Ellipsis)()" produces the
"Ellipsis" singleton.

It is written as "Ellipsis" or "...".
uThe Null Object
***************

This object is returned by functions that don’t explicitly return a
value.  It supports no special operations.  There is exactly one null
object, named "None" (a built-in name).  "type(None)()" produces the
same singleton.

It is written as "None".
u5Type Objects
************

Type objects represent the various object types.  An object’s type is
accessed by the built-in function "type()".  There are no special
operations on types.  The standard module "types" defines names for
all standard built-in types.

Types are written like this: "<class 'int'>".
a�Boolean operations
******************

   or_test  ::= and_test | or_test "or" and_test
   and_test ::= not_test | and_test "and" not_test
   not_test ::= comparison | "not" not_test

In the context of Boolean operations, and also when expressions are
used by control flow statements, the following values are interpreted
as false: "False", "None", numeric zero of all types, and empty
strings and containers (including strings, tuples, lists,
dictionaries, sets and frozensets).  All other values are interpreted
as true.  User-defined objects can customize their truth value by
providing a "__bool__()" method.

The operator "not" yields "True" if its argument is false, "False"
otherwise.

The expression "x and y" first evaluates *x*; if *x* is false, its
value is returned; otherwise, *y* is evaluated and the resulting value
is returned.

The expression "x or y" first evaluates *x*; if *x* is true, its value
is returned; otherwise, *y* is evaluated and the resulting value is
returned.

Note that neither "and" nor "or" restrict the value and type they
return to "False" and "True", but rather return the last evaluated
argument.  This is sometimes useful, e.g., if "s" is a string that
should be replaced by a default value if it is empty, the expression
"s or 'foo'" yields the desired value.  Because "not" has to create a
new value, it returns a boolean value regardless of the type of its
argument (for example, "not 'foo'" produces "False" rather than "''".)
a$The "break" statement
*********************

   break_stmt ::= "break"

"break" may only occur syntactically nested in a "for" or "while"
loop, but not nested in a function or class definition within that
loop.

It terminates the nearest enclosing loop, skipping the optional "else"
clause if the loop has one.

If a "for" loop is terminated by "break", the loop control target
keeps its current value.

When "break" passes control out of a "try" statement with a "finally"
clause, that "finally" clause is executed before really leaving the
loop.
uEmulating callable objects
**************************

object.__call__(self[, args...])

   Called when the instance is “called” as a function; if this method
   is defined, "x(arg1, arg2, ...)" roughly translates to
   "type(x).__call__(x, arg1, ...)".
u�Calls
*****

A call calls a callable object (e.g., a *function*) with a possibly
empty series of *arguments*:

   call                 ::= primary "(" [argument_list [","] | comprehension] ")"
   argument_list        ::= positional_arguments ["," starred_and_keywords]
                       ["," keywords_arguments]
                     | starred_and_keywords ["," keywords_arguments]
                     | keywords_arguments
   positional_arguments ::= positional_item ("," positional_item)*
   positional_item      ::= assignment_expression | "*" expression
   starred_and_keywords ::= ("*" expression | keyword_item)
                            ("," "*" expression | "," keyword_item)*
   keywords_arguments   ::= (keyword_item | "**" expression)
                          ("," keyword_item | "," "**" expression)*
   keyword_item         ::= identifier "=" expression

An optional trailing comma may be present after the positional and
keyword arguments but does not affect the semantics.

The primary must evaluate to a callable object (user-defined
functions, built-in functions, methods of built-in objects, class
objects, methods of class instances, and all objects having a
"__call__()" method are callable).  All argument expressions are
evaluated before the call is attempted.  Please refer to section
Function definitions for the syntax of formal *parameter* lists.

If keyword arguments are present, they are first converted to
positional arguments, as follows.  First, a list of unfilled slots is
created for the formal parameters.  If there are N positional
arguments, they are placed in the first N slots.  Next, for each
keyword argument, the identifier is used to determine the
corresponding slot (if the identifier is the same as the first formal
parameter name, the first slot is used, and so on).  If the slot is
already filled, a "TypeError" exception is raised. Otherwise, the
value of the argument is placed in the slot, filling it (even if the
expression is "None", it fills the slot).  When all arguments have
been processed, the slots that are still unfilled are filled with the
corresponding default value from the function definition.  (Default
values are calculated, once, when the function is defined; thus, a
mutable object such as a list or dictionary used as default value will
be shared by all calls that don’t specify an argument value for the
corresponding slot; this should usually be avoided.)  If there are any
unfilled slots for which no default value is specified, a "TypeError"
exception is raised.  Otherwise, the list of filled slots is used as
the argument list for the call.

**CPython implementation detail:** An implementation may provide
built-in functions whose positional parameters do not have names, even
if they are ‘named’ for the purpose of documentation, and which
therefore cannot be supplied by keyword.  In CPython, this is the case
for functions implemented in C that use "PyArg_ParseTuple()" to parse
their arguments.

If there are more positional arguments than there are formal parameter
slots, a "TypeError" exception is raised, unless a formal parameter
using the syntax "*identifier" is present; in this case, that formal
parameter receives a tuple containing the excess positional arguments
(or an empty tuple if there were no excess positional arguments).

If any keyword argument does not correspond to a formal parameter
name, a "TypeError" exception is raised, unless a formal parameter
using the syntax "**identifier" is present; in this case, that formal
parameter receives a dictionary containing the excess keyword
arguments (using the keywords as keys and the argument values as
corresponding values), or a (new) empty dictionary if there were no
excess keyword arguments.

If the syntax "*expression" appears in the function call, "expression"
must evaluate to an *iterable*.  Elements from these iterables are
treated as if they were additional positional arguments.  For the call
"f(x1, x2, *y, x3, x4)", if *y* evaluates to a sequence *y1*, …, *yM*,
this is equivalent to a call with M+4 positional arguments *x1*, *x2*,
*y1*, …, *yM*, *x3*, *x4*.

A consequence of this is that although the "*expression" syntax may
appear *after* explicit keyword arguments, it is processed *before*
the keyword arguments (and any "**expression" arguments – see below).
So:

   >>> def f(a, b):
   ...     print(a, b)
   ...
   >>> f(b=1, *(2,))
   2 1
   >>> f(a=1, *(2,))
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
   TypeError: f() got multiple values for keyword argument 'a'
   >>> f(1, *(2,))
   1 2

It is unusual for both keyword arguments and the "*expression" syntax
to be used in the same call, so in practice this confusion does not
arise.

If the syntax "**expression" appears in the function call,
"expression" must evaluate to a *mapping*, the contents of which are
treated as additional keyword arguments.  If a keyword is already
present (as an explicit keyword argument, or from another unpacking),
a "TypeError" exception is raised.

Formal parameters using the syntax "*identifier" or "**identifier"
cannot be used as positional argument slots or as keyword argument
names.

Changed in version 3.5: Function calls accept any number of "*" and
"**" unpackings, positional arguments may follow iterable unpackings
("*"), and keyword arguments may follow dictionary unpackings ("**").
Originally proposed by **PEP 448**.

A call always returns some value, possibly "None", unless it raises an
exception.  How this value is computed depends on the type of the
callable object.

If it is—

a user-defined function:
   The code block for the function is executed, passing it the
   argument list.  The first thing the code block will do is bind the
   formal parameters to the arguments; this is described in section
   Function definitions.  When the code block executes a "return"
   statement, this specifies the return value of the function call.

a built-in function or method:
   The result is up to the interpreter; see Built-in Functions for the
   descriptions of built-in functions and methods.

a class object:
   A new instance of that class is returned.

a class instance method:
   The corresponding user-defined function is called, with an argument
   list that is one longer than the argument list of the call: the
   instance becomes the first argument.

a class instance:
   The class must define a "__call__()" method; the effect is then the
   same as if that method was called.
uClass definitions
*****************

A class definition defines a class object (see section The standard
type hierarchy):

   classdef    ::= [decorators] "class" classname [inheritance] ":" suite
   inheritance ::= "(" [argument_list] ")"
   classname   ::= identifier

A class definition is an executable statement.  The inheritance list
usually gives a list of base classes (see Metaclasses for more
advanced uses), so each item in the list should evaluate to a class
object which allows subclassing.  Classes without an inheritance list
inherit, by default, from the base class "object"; hence,

   class Foo:
       pass

is equivalent to

   class Foo(object):
       pass

The class’s suite is then executed in a new execution frame (see
Naming and binding), using a newly created local namespace and the
original global namespace. (Usually, the suite contains mostly
function definitions.)  When the class’s suite finishes execution, its
execution frame is discarded but its local namespace is saved. [3] A
class object is then created using the inheritance list for the base
classes and the saved local namespace for the attribute dictionary.
The class name is bound to this class object in the original local
namespace.

The order in which attributes are defined in the class body is
preserved in the new class’s "__dict__".  Note that this is reliable
only right after the class is created and only for classes that were
defined using the definition syntax.

Class creation can be customized heavily using metaclasses.

Classes can also be decorated: just like when decorating functions,

   @f1(arg)
   @f2
   class Foo: pass

is roughly equivalent to

   class Foo: pass
   Foo = f1(arg)(f2(Foo))

The evaluation rules for the decorator expressions are the same as for
function decorators.  The result is then bound to the class name.

**Programmer’s note:** Variables defined in the class definition are
class attributes; they are shared by instances.  Instance attributes
can be set in a method with "self.name = value".  Both class and
instance attributes are accessible through the notation “"self.name"”,
and an instance attribute hides a class attribute with the same name
when accessed in this way.  Class attributes can be used as defaults
for instance attributes, but using mutable values there can lead to
unexpected results.  Descriptors can be used to create instance
variables with different implementation details.

See also:

  **PEP 3115** - Metaclasses in Python 3000
     The proposal that changed the declaration of metaclasses to the
     current syntax, and the semantics for how classes with
     metaclasses are constructed.

  **PEP 3129** - Class Decorators
     The proposal that added class decorators.  Function and method
     decorators were introduced in **PEP 318**.
u�'Comparisons
***********

Unlike C, all comparison operations in Python have the same priority,
which is lower than that of any arithmetic, shifting or bitwise
operation.  Also unlike C, expressions like "a < b < c" have the
interpretation that is conventional in mathematics:

   comparison    ::= or_expr (comp_operator or_expr)*
   comp_operator ::= "<" | ">" | "==" | ">=" | "<=" | "!="
                     | "is" ["not"] | ["not"] "in"

Comparisons yield boolean values: "True" or "False".

Comparisons can be chained arbitrarily, e.g., "x < y <= z" is
equivalent to "x < y and y <= z", except that "y" is evaluated only
once (but in both cases "z" is not evaluated at all when "x < y" is
found to be false).

Formally, if *a*, *b*, *c*, …, *y*, *z* are expressions and *op1*,
*op2*, …, *opN* are comparison operators, then "a op1 b op2 c ... y
opN z" is equivalent to "a op1 b and b op2 c and ... y opN z", except
that each expression is evaluated at most once.

Note that "a op1 b op2 c" doesn’t imply any kind of comparison between
*a* and *c*, so that, e.g., "x < y > z" is perfectly legal (though
perhaps not pretty).


Value comparisons
=================

The operators "<", ">", "==", ">=", "<=", and "!=" compare the values
of two objects.  The objects do not need to have the same type.

Chapter Objects, values and types states that objects have a value (in
addition to type and identity).  The value of an object is a rather
abstract notion in Python: For example, there is no canonical access
method for an object’s value.  Also, there is no requirement that the
value of an object should be constructed in a particular way, e.g.
comprised of all its data attributes. Comparison operators implement a
particular notion of what the value of an object is.  One can think of
them as defining the value of an object indirectly, by means of their
comparison implementation.

Because all types are (direct or indirect) subtypes of "object", they
inherit the default comparison behavior from "object".  Types can
customize their comparison behavior by implementing *rich comparison
methods* like "__lt__()", described in Basic customization.

The default behavior for equality comparison ("==" and "!=") is based
on the identity of the objects.  Hence, equality comparison of
instances with the same identity results in equality, and equality
comparison of instances with different identities results in
inequality.  A motivation for this default behavior is the desire that
all objects should be reflexive (i.e. "x is y" implies "x == y").

A default order comparison ("<", ">", "<=", and ">=") is not provided;
an attempt raises "TypeError".  A motivation for this default behavior
is the lack of a similar invariant as for equality.

The behavior of the default equality comparison, that instances with
different identities are always unequal, may be in contrast to what
types will need that have a sensible definition of object value and
value-based equality.  Such types will need to customize their
comparison behavior, and in fact, a number of built-in types have done
that.

The following list describes the comparison behavior of the most
important built-in types.

* Numbers of built-in numeric types (Numeric Types — int, float,
  complex) and of the standard library types "fractions.Fraction" and
  "decimal.Decimal" can be compared within and across their types,
  with the restriction that complex numbers do not support order
  comparison.  Within the limits of the types involved, they compare
  mathematically (algorithmically) correct without loss of precision.

  The not-a-number values "float('NaN')" and "decimal.Decimal('NaN')"
  are special.  Any ordered comparison of a number to a not-a-number
  value is false. A counter-intuitive implication is that not-a-number
  values are not equal to themselves.  For example, if "x =
  float('NaN')", "3 < x", "x < 3" and "x == x" are all false, while "x
  != x" is true.  This behavior is compliant with IEEE 754.

* "None" and "NotImplemented" are singletons.  **PEP 8** advises that
  comparisons for singletons should always be done with "is" or "is
  not", never the equality operators.

* Binary sequences (instances of "bytes" or "bytearray") can be
  compared within and across their types.  They compare
  lexicographically using the numeric values of their elements.

* Strings (instances of "str") compare lexicographically using the
  numerical Unicode code points (the result of the built-in function
  "ord()") of their characters. [3]

  Strings and binary sequences cannot be directly compared.

* Sequences (instances of "tuple", "list", or "range") can be compared
  only within each of their types, with the restriction that ranges do
  not support order comparison.  Equality comparison across these
  types results in inequality, and ordering comparison across these
  types raises "TypeError".

  Sequences compare lexicographically using comparison of
  corresponding elements.  The built-in containers typically assume
  identical objects are equal to themselves.  That lets them bypass
  equality tests for identical objects to improve performance and to
  maintain their internal invariants.

  Lexicographical comparison between built-in collections works as
  follows:

  * For two collections to compare equal, they must be of the same
    type, have the same length, and each pair of corresponding
    elements must compare equal (for example, "[1,2] == (1,2)" is
    false because the type is not the same).

  * Collections that support order comparison are ordered the same as
    their first unequal elements (for example, "[1,2,x] <= [1,2,y]"
    has the same value as "x <= y").  If a corresponding element does
    not exist, the shorter collection is ordered first (for example,
    "[1,2] < [1,2,3]" is true).

* Mappings (instances of "dict") compare equal if and only if they
  have equal *(key, value)* pairs. Equality comparison of the keys and
  values enforces reflexivity.

  Order comparisons ("<", ">", "<=", and ">=") raise "TypeError".

* Sets (instances of "set" or "frozenset") can be compared within and
  across their types.

  They define order comparison operators to mean subset and superset
  tests.  Those relations do not define total orderings (for example,
  the two sets "{1,2}" and "{2,3}" are not equal, nor subsets of one
  another, nor supersets of one another).  Accordingly, sets are not
  appropriate arguments for functions which depend on total ordering
  (for example, "min()", "max()", and "sorted()" produce undefined
  results given a list of sets as inputs).

  Comparison of sets enforces reflexivity of its elements.

* Most other built-in types have no comparison methods implemented, so
  they inherit the default comparison behavior.

User-defined classes that customize their comparison behavior should
follow some consistency rules, if possible:

* Equality comparison should be reflexive. In other words, identical
  objects should compare equal:

     "x is y" implies "x == y"

* Comparison should be symmetric. In other words, the following
  expressions should have the same result:

     "x == y" and "y == x"

     "x != y" and "y != x"

     "x < y" and "y > x"

     "x <= y" and "y >= x"

* Comparison should be transitive. The following (non-exhaustive)
  examples illustrate that:

     "x > y and y > z" implies "x > z"

     "x < y and y <= z" implies "x < z"

* Inverse comparison should result in the boolean negation. In other
  words, the following expressions should have the same result:

     "x == y" and "not x != y"

     "x < y" and "not x >= y" (for total ordering)

     "x > y" and "not x <= y" (for total ordering)

  The last two expressions apply to totally ordered collections (e.g.
  to sequences, but not to sets or mappings). See also the
  "total_ordering()" decorator.

* The "hash()" result should be consistent with equality. Objects that
  are equal should either have the same hash value, or be marked as
  unhashable.

Python does not enforce these consistency rules. In fact, the
not-a-number values are an example for not following these rules.


Membership test operations
==========================

The operators "in" and "not in" test for membership.  "x in s"
evaluates to "True" if *x* is a member of *s*, and "False" otherwise.
"x not in s" returns the negation of "x in s".  All built-in sequences
and set types support this as well as dictionary, for which "in" tests
whether the dictionary has a given key. For container types such as
list, tuple, set, frozenset, dict, or collections.deque, the
expression "x in y" is equivalent to "any(x is e or x == e for e in
y)".

For the string and bytes types, "x in y" is "True" if and only if *x*
is a substring of *y*.  An equivalent test is "y.find(x) != -1".
Empty strings are always considered to be a substring of any other
string, so """ in "abc"" will return "True".

For user-defined classes which define the "__contains__()" method, "x
in y" returns "True" if "y.__contains__(x)" returns a true value, and
"False" otherwise.

For user-defined classes which do not define "__contains__()" but do
define "__iter__()", "x in y" is "True" if some value "z", for which
the expression "x is z or x == z" is true, is produced while iterating
over "y". If an exception is raised during the iteration, it is as if
"in" raised that exception.

Lastly, the old-style iteration protocol is tried: if a class defines
"__getitem__()", "x in y" is "True" if and only if there is a non-
negative integer index *i* such that "x is y[i] or x == y[i]", and no
lower integer index raises the "IndexError" exception.  (If any other
exception is raised, it is as if "in" raised that exception).

The operator "not in" is defined to have the inverse truth value of
"in".


Identity comparisons
====================

The operators "is" and "is not" test for an object’s identity: "x is
y" is true if and only if *x* and *y* are the same object.  An
Object’s identity is determined using the "id()" function.  "x is not
y" yields the inverse truth value. [4]
u�lCompound statements
*******************

Compound statements contain (groups of) other statements; they affect
or control the execution of those other statements in some way.  In
general, compound statements span multiple lines, although in simple
incarnations a whole compound statement may be contained in one line.

The "if", "while" and "for" statements implement traditional control
flow constructs.  "try" specifies exception handlers and/or cleanup
code for a group of statements, while the "with" statement allows the
execution of initialization and finalization code around a block of
code.  Function and class definitions are also syntactically compound
statements.

A compound statement consists of one or more ‘clauses.’  A clause
consists of a header and a ‘suite.’  The clause headers of a
particular compound statement are all at the same indentation level.
Each clause header begins with a uniquely identifying keyword and ends
with a colon.  A suite is a group of statements controlled by a
clause.  A suite can be one or more semicolon-separated simple
statements on the same line as the header, following the header’s
colon, or it can be one or more indented statements on subsequent
lines.  Only the latter form of a suite can contain nested compound
statements; the following is illegal, mostly because it wouldn’t be
clear to which "if" clause a following "else" clause would belong:

   if test1: if test2: print(x)

Also note that the semicolon binds tighter than the colon in this
context, so that in the following example, either all or none of the
"print()" calls are executed:

   if x < y < z: print(x); print(y); print(z)

Summarizing:

   compound_stmt ::= if_stmt
                     | while_stmt
                     | for_stmt
                     | try_stmt
                     | with_stmt
                     | funcdef
                     | classdef
                     | async_with_stmt
                     | async_for_stmt
                     | async_funcdef
   suite         ::= stmt_list NEWLINE | NEWLINE INDENT statement+ DEDENT
   statement     ::= stmt_list NEWLINE | compound_stmt
   stmt_list     ::= simple_stmt (";" simple_stmt)* [";"]

Note that statements always end in a "NEWLINE" possibly followed by a
"DEDENT".  Also note that optional continuation clauses always begin
with a keyword that cannot start a statement, thus there are no
ambiguities (the ‘dangling "else"’ problem is solved in Python by
requiring nested "if" statements to be indented).

The formatting of the grammar rules in the following sections places
each clause on a separate line for clarity.


The "if" statement
==================

The "if" statement is used for conditional execution:

   if_stmt ::= "if" assignment_expression ":" suite
               ("elif" assignment_expression ":" suite)*
               ["else" ":" suite]

It selects exactly one of the suites by evaluating the expressions one
by one until one is found to be true (see section Boolean operations
for the definition of true and false); then that suite is executed
(and no other part of the "if" statement is executed or evaluated).
If all expressions are false, the suite of the "else" clause, if
present, is executed.


The "while" statement
=====================

The "while" statement is used for repeated execution as long as an
expression is true:

   while_stmt ::= "while" assignment_expression ":" suite
                  ["else" ":" suite]

This repeatedly tests the expression and, if it is true, executes the
first suite; if the expression is false (which may be the first time
it is tested) the suite of the "else" clause, if present, is executed
and the loop terminates.

A "break" statement executed in the first suite terminates the loop
without executing the "else" clause’s suite.  A "continue" statement
executed in the first suite skips the rest of the suite and goes back
to testing the expression.


The "for" statement
===================

The "for" statement is used to iterate over the elements of a sequence
(such as a string, tuple or list) or other iterable object:

   for_stmt ::= "for" target_list "in" expression_list ":" suite
                ["else" ":" suite]

The expression list is evaluated once; it should yield an iterable
object.  An iterator is created for the result of the
"expression_list".  The suite is then executed once for each item
provided by the iterator, in the order returned by the iterator.  Each
item in turn is assigned to the target list using the standard rules
for assignments (see Assignment statements), and then the suite is
executed.  When the items are exhausted (which is immediately when the
sequence is empty or an iterator raises a "StopIteration" exception),
the suite in the "else" clause, if present, is executed, and the loop
terminates.

A "break" statement executed in the first suite terminates the loop
without executing the "else" clause’s suite.  A "continue" statement
executed in the first suite skips the rest of the suite and continues
with the next item, or with the "else" clause if there is no next
item.

The for-loop makes assignments to the variables in the target list.
This overwrites all previous assignments to those variables including
those made in the suite of the for-loop:

   for i in range(10):
       print(i)
       i = 5             # this will not affect the for-loop
                         # because i will be overwritten with the next
                         # index in the range

Names in the target list are not deleted when the loop is finished,
but if the sequence is empty, they will not have been assigned to at
all by the loop.  Hint: the built-in function "range()" returns an
iterator of integers suitable to emulate the effect of Pascal’s "for i
:= a to b do"; e.g., "list(range(3))" returns the list "[0, 1, 2]".

Note:

  There is a subtlety when the sequence is being modified by the loop
  (this can only occur for mutable sequences, e.g. lists).  An
  internal counter is used to keep track of which item is used next,
  and this is incremented on each iteration.  When this counter has
  reached the length of the sequence the loop terminates.  This means
  that if the suite deletes the current (or a previous) item from the
  sequence, the next item will be skipped (since it gets the index of
  the current item which has already been treated).  Likewise, if the
  suite inserts an item in the sequence before the current item, the
  current item will be treated again the next time through the loop.
  This can lead to nasty bugs that can be avoided by making a
  temporary copy using a slice of the whole sequence, e.g.,

     for x in a[:]:
         if x < 0: a.remove(x)


The "try" statement
===================

The "try" statement specifies exception handlers and/or cleanup code
for a group of statements:

   try_stmt  ::= try1_stmt | try2_stmt
   try1_stmt ::= "try" ":" suite
                 ("except" [expression ["as" identifier]] ":" suite)+
                 ["else" ":" suite]
                 ["finally" ":" suite]
   try2_stmt ::= "try" ":" suite
                 "finally" ":" suite

The "except" clause(s) specify one or more exception handlers. When no
exception occurs in the "try" clause, no exception handler is
executed. When an exception occurs in the "try" suite, a search for an
exception handler is started.  This search inspects the except clauses
in turn until one is found that matches the exception.  An expression-
less except clause, if present, must be last; it matches any
exception.  For an except clause with an expression, that expression
is evaluated, and the clause matches the exception if the resulting
object is “compatible” with the exception.  An object is compatible
with an exception if it is the class or a base class of the exception
object, or a tuple containing an item that is the class or a base
class of the exception object.

If no except clause matches the exception, the search for an exception
handler continues in the surrounding code and on the invocation stack.
[1]

If the evaluation of an expression in the header of an except clause
raises an exception, the original search for a handler is canceled and
a search starts for the new exception in the surrounding code and on
the call stack (it is treated as if the entire "try" statement raised
the exception).

When a matching except clause is found, the exception is assigned to
the target specified after the "as" keyword in that except clause, if
present, and the except clause’s suite is executed.  All except
clauses must have an executable block.  When the end of this block is
reached, execution continues normally after the entire try statement.
(This means that if two nested handlers exist for the same exception,
and the exception occurs in the try clause of the inner handler, the
outer handler will not handle the exception.)

When an exception has been assigned using "as target", it is cleared
at the end of the except clause.  This is as if

   except E as N:
       foo

was translated to

   except E as N:
       try:
           foo
       finally:
           del N

This means the exception must be assigned to a different name to be
able to refer to it after the except clause.  Exceptions are cleared
because with the traceback attached to them, they form a reference
cycle with the stack frame, keeping all locals in that frame alive
until the next garbage collection occurs.

Before an except clause’s suite is executed, details about the
exception are stored in the "sys" module and can be accessed via
"sys.exc_info()". "sys.exc_info()" returns a 3-tuple consisting of the
exception class, the exception instance and a traceback object (see
section The standard type hierarchy) identifying the point in the
program where the exception occurred.  "sys.exc_info()" values are
restored to their previous values (before the call) when returning
from a function that handled an exception.

The optional "else" clause is executed if the control flow leaves the
"try" suite, no exception was raised, and no "return", "continue", or
"break" statement was executed.  Exceptions in the "else" clause are
not handled by the preceding "except" clauses.

If "finally" is present, it specifies a ‘cleanup’ handler.  The "try"
clause is executed, including any "except" and "else" clauses.  If an
exception occurs in any of the clauses and is not handled, the
exception is temporarily saved. The "finally" clause is executed.  If
there is a saved exception it is re-raised at the end of the "finally"
clause.  If the "finally" clause raises another exception, the saved
exception is set as the context of the new exception. If the "finally"
clause executes a "return", "break" or "continue" statement, the saved
exception is discarded:

   >>> def f():
   ...     try:
   ...         1/0
   ...     finally:
   ...         return 42
   ...
   >>> f()
   42

The exception information is not available to the program during
execution of the "finally" clause.

When a "return", "break" or "continue" statement is executed in the
"try" suite of a "try"…"finally" statement, the "finally" clause is
also executed ‘on the way out.’

The return value of a function is determined by the last "return"
statement executed.  Since the "finally" clause always executes, a
"return" statement executed in the "finally" clause will always be the
last one executed:

   >>> def foo():
   ...     try:
   ...         return 'try'
   ...     finally:
   ...         return 'finally'
   ...
   >>> foo()
   'finally'

Additional information on exceptions can be found in section
Exceptions, and information on using the "raise" statement to generate
exceptions may be found in section The raise statement.

Changed in version 3.8: Prior to Python 3.8, a "continue" statement
was illegal in the "finally" clause due to a problem with the
implementation.


The "with" statement
====================

The "with" statement is used to wrap the execution of a block with
methods defined by a context manager (see section With Statement
Context Managers). This allows common "try"…"except"…"finally" usage
patterns to be encapsulated for convenient reuse.

   with_stmt ::= "with" with_item ("," with_item)* ":" suite
   with_item ::= expression ["as" target]

The execution of the "with" statement with one “item” proceeds as
follows:

1. The context expression (the expression given in the "with_item") is
   evaluated to obtain a context manager.

2. The context manager’s "__enter__()" is loaded for later use.

3. The context manager’s "__exit__()" is loaded for later use.

4. The context manager’s "__enter__()" method is invoked.

5. If a target was included in the "with" statement, the return value
   from "__enter__()" is assigned to it.

   Note:

     The "with" statement guarantees that if the "__enter__()" method
     returns without an error, then "__exit__()" will always be
     called. Thus, if an error occurs during the assignment to the
     target list, it will be treated the same as an error occurring
     within the suite would be. See step 6 below.

6. The suite is executed.

7. The context manager’s "__exit__()" method is invoked.  If an
   exception caused the suite to be exited, its type, value, and
   traceback are passed as arguments to "__exit__()". Otherwise, three
   "None" arguments are supplied.

   If the suite was exited due to an exception, and the return value
   from the "__exit__()" method was false, the exception is reraised.
   If the return value was true, the exception is suppressed, and
   execution continues with the statement following the "with"
   statement.

   If the suite was exited for any reason other than an exception, the
   return value from "__exit__()" is ignored, and execution proceeds
   at the normal location for the kind of exit that was taken.

The following code:

   with EXPRESSION as TARGET:
       SUITE

is semantically equivalent to:

   manager = (EXPRESSION)
   enter = type(manager).__enter__
   exit = type(manager).__exit__
   value = enter(manager)
   hit_except = False

   try:
       TARGET = value
       SUITE
   except:
       hit_except = True
       if not exit(manager, *sys.exc_info()):
           raise
   finally:
       if not hit_except:
           exit(manager, None, None, None)

With more than one item, the context managers are processed as if
multiple "with" statements were nested:

   with A() as a, B() as b:
       SUITE

is semantically equivalent to:

   with A() as a:
       with B() as b:
           SUITE

Changed in version 3.1: Support for multiple context expressions.

See also:

  **PEP 343** - The “with” statement
     The specification, background, and examples for the Python "with"
     statement.


Function definitions
====================

A function definition defines a user-defined function object (see
section The standard type hierarchy):

   funcdef                   ::= [decorators] "def" funcname "(" [parameter_list] ")"
               ["->" expression] ":" suite
   decorators                ::= decorator+
   decorator                 ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE
   dotted_name               ::= identifier ("." identifier)*
   parameter_list            ::= defparameter ("," defparameter)* "," "/" ["," [parameter_list_no_posonly]]
                        | parameter_list_no_posonly
   parameter_list_no_posonly ::= defparameter ("," defparameter)* ["," [parameter_list_starargs]]
                                 | parameter_list_starargs
   parameter_list_starargs   ::= "*" [parameter] ("," defparameter)* ["," ["**" parameter [","]]]
                               | "**" parameter [","]
   parameter                 ::= identifier [":" expression]
   defparameter              ::= parameter ["=" expression]
   funcname                  ::= identifier

A function definition is an executable statement.  Its execution binds
the function name in the current local namespace to a function object
(a wrapper around the executable code for the function).  This
function object contains a reference to the current global namespace
as the global namespace to be used when the function is called.

The function definition does not execute the function body; this gets
executed only when the function is called. [2]

A function definition may be wrapped by one or more *decorator*
expressions. Decorator expressions are evaluated when the function is
defined, in the scope that contains the function definition.  The
result must be a callable, which is invoked with the function object
as the only argument. The returned value is bound to the function name
instead of the function object.  Multiple decorators are applied in
nested fashion. For example, the following code

   @f1(arg)
   @f2
   def func(): pass

is roughly equivalent to

   def func(): pass
   func = f1(arg)(f2(func))

except that the original function is not temporarily bound to the name
"func".

When one or more *parameters* have the form *parameter* "="
*expression*, the function is said to have “default parameter values.”
For a parameter with a default value, the corresponding *argument* may
be omitted from a call, in which case the parameter’s default value is
substituted.  If a parameter has a default value, all following
parameters up until the “"*"” must also have a default value — this is
a syntactic restriction that is not expressed by the grammar.

**Default parameter values are evaluated from left to right when the
function definition is executed.** This means that the expression is
evaluated once, when the function is defined, and that the same “pre-
computed” value is used for each call.  This is especially important
to understand when a default parameter is a mutable object, such as a
list or a dictionary: if the function modifies the object (e.g. by
appending an item to a list), the default value is in effect modified.
This is generally not what was intended.  A way around this is to use
"None" as the default, and explicitly test for it in the body of the
function, e.g.:

   def whats_on_the_telly(penguin=None):
       if penguin is None:
           penguin = []
       penguin.append("property of the zoo")
       return penguin

Function call semantics are described in more detail in section Calls.
A function call always assigns values to all parameters mentioned in
the parameter list, either from positional arguments, from keyword
arguments, or from default values.  If the form “"*identifier"” is
present, it is initialized to a tuple receiving any excess positional
parameters, defaulting to the empty tuple. If the form
“"**identifier"” is present, it is initialized to a new ordered
mapping receiving any excess keyword arguments, defaulting to a new
empty mapping of the same type.  Parameters after “"*"” or
“"*identifier"” are keyword-only parameters and may only be passed by
keyword arguments.  Parameters before “"/"” are positional-only
parameters and may only be passed by positional arguments.

Changed in version 3.8: The "/" function parameter syntax may be used
to indicate positional-only parameters. See **PEP 570** for details.

Parameters may have an *annotation* of the form “": expression"”
following the parameter name.  Any parameter may have an annotation,
even those of the form "*identifier" or "**identifier".  Functions may
have “return” annotation of the form “"-> expression"” after the
parameter list.  These annotations can be any valid Python expression.
The presence of annotations does not change the semantics of a
function.  The annotation values are available as values of a
dictionary keyed by the parameters’ names in the "__annotations__"
attribute of the function object.  If the "annotations" import from
"__future__" is used, annotations are preserved as strings at runtime
which enables postponed evaluation.  Otherwise, they are evaluated
when the function definition is executed.  In this case annotations
may be evaluated in a different order than they appear in the source
code.

It is also possible to create anonymous functions (functions not bound
to a name), for immediate use in expressions.  This uses lambda
expressions, described in section Lambdas.  Note that the lambda
expression is merely a shorthand for a simplified function definition;
a function defined in a “"def"” statement can be passed around or
assigned to another name just like a function defined by a lambda
expression.  The “"def"” form is actually more powerful since it
allows the execution of multiple statements and annotations.

**Programmer’s note:** Functions are first-class objects.  A “"def"”
statement executed inside a function definition defines a local
function that can be returned or passed around.  Free variables used
in the nested function can access the local variables of the function
containing the def.  See section Naming and binding for details.

See also:

  **PEP 3107** - Function Annotations
     The original specification for function annotations.

  **PEP 484** - Type Hints
     Definition of a standard meaning for annotations: type hints.

  **PEP 526** - Syntax for Variable Annotations
     Ability to type hint variable declarations, including class
     variables and instance variables

  **PEP 563** - Postponed Evaluation of Annotations
     Support for forward references within annotations by preserving
     annotations in a string form at runtime instead of eager
     evaluation.


Class definitions
=================

A class definition defines a class object (see section The standard
type hierarchy):

   classdef    ::= [decorators] "class" classname [inheritance] ":" suite
   inheritance ::= "(" [argument_list] ")"
   classname   ::= identifier

A class definition is an executable statement.  The inheritance list
usually gives a list of base classes (see Metaclasses for more
advanced uses), so each item in the list should evaluate to a class
object which allows subclassing.  Classes without an inheritance list
inherit, by default, from the base class "object"; hence,

   class Foo:
       pass

is equivalent to

   class Foo(object):
       pass

The class’s suite is then executed in a new execution frame (see
Naming and binding), using a newly created local namespace and the
original global namespace. (Usually, the suite contains mostly
function definitions.)  When the class’s suite finishes execution, its
execution frame is discarded but its local namespace is saved. [3] A
class object is then created using the inheritance list for the base
classes and the saved local namespace for the attribute dictionary.
The class name is bound to this class object in the original local
namespace.

The order in which attributes are defined in the class body is
preserved in the new class’s "__dict__".  Note that this is reliable
only right after the class is created and only for classes that were
defined using the definition syntax.

Class creation can be customized heavily using metaclasses.

Classes can also be decorated: just like when decorating functions,

   @f1(arg)
   @f2
   class Foo: pass

is roughly equivalent to

   class Foo: pass
   Foo = f1(arg)(f2(Foo))

The evaluation rules for the decorator expressions are the same as for
function decorators.  The result is then bound to the class name.

**Programmer’s note:** Variables defined in the class definition are
class attributes; they are shared by instances.  Instance attributes
can be set in a method with "self.name = value".  Both class and
instance attributes are accessible through the notation “"self.name"”,
and an instance attribute hides a class attribute with the same name
when accessed in this way.  Class attributes can be used as defaults
for instance attributes, but using mutable values there can lead to
unexpected results.  Descriptors can be used to create instance
variables with different implementation details.

See also:

  **PEP 3115** - Metaclasses in Python 3000
     The proposal that changed the declaration of metaclasses to the
     current syntax, and the semantics for how classes with
     metaclasses are constructed.

  **PEP 3129** - Class Decorators
     The proposal that added class decorators.  Function and method
     decorators were introduced in **PEP 318**.


Coroutines
==========

New in version 3.5.


Coroutine function definition
-----------------------------

   async_funcdef ::= [decorators] "async" "def" funcname "(" [parameter_list] ")"
                     ["->" expression] ":" suite

Execution of Python coroutines can be suspended and resumed at many
points (see *coroutine*).  Inside the body of a coroutine function,
"await" and "async" identifiers become reserved keywords; "await"
expressions, "async for" and "async with" can only be used in
coroutine function bodies.

Functions defined with "async def" syntax are always coroutine
functions, even if they do not contain "await" or "async" keywords.

It is a "SyntaxError" to use a "yield from" expression inside the body
of a coroutine function.

An example of a coroutine function:

   async def func(param1, param2):
       do_stuff()
       await some_coroutine()


The "async for" statement
-------------------------

   async_for_stmt ::= "async" for_stmt

An *asynchronous iterable* is able to call asynchronous code in its
*iter* implementation, and *asynchronous iterator* can call
asynchronous code in its *next* method.

The "async for" statement allows convenient iteration over
asynchronous iterators.

The following code:

   async for TARGET in ITER:
       SUITE
   else:
       SUITE2

Is semantically equivalent to:

   iter = (ITER)
   iter = type(iter).__aiter__(iter)
   running = True

   while running:
       try:
           TARGET = await type(iter).__anext__(iter)
       except StopAsyncIteration:
           running = False
       else:
           SUITE
   else:
       SUITE2

See also "__aiter__()" and "__anext__()" for details.

It is a "SyntaxError" to use an "async for" statement outside the body
of a coroutine function.


The "async with" statement
--------------------------

   async_with_stmt ::= "async" with_stmt

An *asynchronous context manager* is a *context manager* that is able
to suspend execution in its *enter* and *exit* methods.

The following code:

   async with EXPRESSION as TARGET:
       SUITE

is semantically equivalent to:

   manager = (EXPRESSION)
   aexit = type(manager).__aexit__
   aenter = type(manager).__aenter__
   value = await aenter(manager)
   hit_except = False

   try:
       TARGET = value
       SUITE
   except:
       hit_except = True
       if not await aexit(manager, *sys.exc_info()):
           raise
   finally:
       if not hit_except:
           await aexit(manager, None, None, None)

See also "__aenter__()" and "__aexit__()" for details.

It is a "SyntaxError" to use an "async with" statement outside the
body of a coroutine function.

See also:

  **PEP 492** - Coroutines with async and await syntax
     The proposal that made coroutines a proper standalone concept in
     Python, and added supporting syntax.

-[ Footnotes ]-

[1] The exception is propagated to the invocation stack unless there
    is a "finally" clause which happens to raise another exception.
    That new exception causes the old one to be lost.

[2] A string literal appearing as the first statement in the function
    body is transformed into the function’s "__doc__" attribute and
    therefore the function’s *docstring*.

[3] A string literal appearing as the first statement in the class
    body is transformed into the namespace’s "__doc__" item and
    therefore the class’s *docstring*.
u�With Statement Context Managers
*******************************

A *context manager* is an object that defines the runtime context to
be established when executing a "with" statement. The context manager
handles the entry into, and the exit from, the desired runtime context
for the execution of the block of code.  Context managers are normally
invoked using the "with" statement (described in section The with
statement), but can also be used by directly invoking their methods.

Typical uses of context managers include saving and restoring various
kinds of global state, locking and unlocking resources, closing opened
files, etc.

For more information on context managers, see Context Manager Types.

object.__enter__(self)

   Enter the runtime context related to this object. The "with"
   statement will bind this method’s return value to the target(s)
   specified in the "as" clause of the statement, if any.

object.__exit__(self, exc_type, exc_value, traceback)

   Exit the runtime context related to this object. The parameters
   describe the exception that caused the context to be exited. If the
   context was exited without an exception, all three arguments will
   be "None".

   If an exception is supplied, and the method wishes to suppress the
   exception (i.e., prevent it from being propagated), it should
   return a true value. Otherwise, the exception will be processed
   normally upon exit from this method.

   Note that "__exit__()" methods should not reraise the passed-in
   exception; this is the caller’s responsibility.

See also:

  **PEP 343** - The “with” statement
     The specification, background, and examples for the Python "with"
     statement.
a�The "continue" statement
************************

   continue_stmt ::= "continue"

"continue" may only occur syntactically nested in a "for" or "while"
loop, but not nested in a function or class definition within that
loop.  It continues with the next cycle of the nearest enclosing loop.

When "continue" passes control out of a "try" statement with a
"finally" clause, that "finally" clause is executed before really
starting the next loop cycle.
u�Arithmetic conversions
**********************

When a description of an arithmetic operator below uses the phrase
“the numeric arguments are converted to a common type”, this means
that the operator implementation for built-in types works as follows:

* If either argument is a complex number, the other is converted to
  complex;

* otherwise, if either argument is a floating point number, the other
  is converted to floating point;

* otherwise, both must be integers and no conversion is necessary.

Some additional rules apply for certain operators (e.g., a string as a
left argument to the ‘%’ operator).  Extensions must define their own
conversion behavior.
uS5Basic customization
*******************

object.__new__(cls[, ...])

   Called to create a new instance of class *cls*.  "__new__()" is a
   static method (special-cased so you need not declare it as such)
   that takes the class of which an instance was requested as its
   first argument.  The remaining arguments are those passed to the
   object constructor expression (the call to the class).  The return
   value of "__new__()" should be the new object instance (usually an
   instance of *cls*).

   Typical implementations create a new instance of the class by
   invoking the superclass’s "__new__()" method using
   "super().__new__(cls[, ...])" with appropriate arguments and then
   modifying the newly-created instance as necessary before returning
   it.

   If "__new__()" is invoked during object construction and it returns
   an instance of *cls*, then the new instance’s "__init__()" method
   will be invoked like "__init__(self[, ...])", where *self* is the
   new instance and the remaining arguments are the same as were
   passed to the object constructor.

   If "__new__()" does not return an instance of *cls*, then the new
   instance’s "__init__()" method will not be invoked.

   "__new__()" is intended mainly to allow subclasses of immutable
   types (like int, str, or tuple) to customize instance creation.  It
   is also commonly overridden in custom metaclasses in order to
   customize class creation.

object.__init__(self[, ...])

   Called after the instance has been created (by "__new__()"), but
   before it is returned to the caller.  The arguments are those
   passed to the class constructor expression.  If a base class has an
   "__init__()" method, the derived class’s "__init__()" method, if
   any, must explicitly call it to ensure proper initialization of the
   base class part of the instance; for example:
   "super().__init__([args...])".

   Because "__new__()" and "__init__()" work together in constructing
   objects ("__new__()" to create it, and "__init__()" to customize
   it), no non-"None" value may be returned by "__init__()"; doing so
   will cause a "TypeError" to be raised at runtime.

object.__del__(self)

   Called when the instance is about to be destroyed.  This is also
   called a finalizer or (improperly) a destructor.  If a base class
   has a "__del__()" method, the derived class’s "__del__()" method,
   if any, must explicitly call it to ensure proper deletion of the
   base class part of the instance.

   It is possible (though not recommended!) for the "__del__()" method
   to postpone destruction of the instance by creating a new reference
   to it.  This is called object *resurrection*.  It is
   implementation-dependent whether "__del__()" is called a second
   time when a resurrected object is about to be destroyed; the
   current *CPython* implementation only calls it once.

   It is not guaranteed that "__del__()" methods are called for
   objects that still exist when the interpreter exits.

   Note:

     "del x" doesn’t directly call "x.__del__()" — the former
     decrements the reference count for "x" by one, and the latter is
     only called when "x"’s reference count reaches zero.

   **CPython implementation detail:** It is possible for a reference
   cycle to prevent the reference count of an object from going to
   zero.  In this case, the cycle will be later detected and deleted
   by the *cyclic garbage collector*.  A common cause of reference
   cycles is when an exception has been caught in a local variable.
   The frame’s locals then reference the exception, which references
   its own traceback, which references the locals of all frames caught
   in the traceback.

   See also: Documentation for the "gc" module.

   Warning:

     Due to the precarious circumstances under which "__del__()"
     methods are invoked, exceptions that occur during their execution
     are ignored, and a warning is printed to "sys.stderr" instead.
     In particular:

     * "__del__()" can be invoked when arbitrary code is being
       executed, including from any arbitrary thread.  If "__del__()"
       needs to take a lock or invoke any other blocking resource, it
       may deadlock as the resource may already be taken by the code
       that gets interrupted to execute "__del__()".

     * "__del__()" can be executed during interpreter shutdown.  As a
       consequence, the global variables it needs to access (including
       other modules) may already have been deleted or set to "None".
       Python guarantees that globals whose name begins with a single
       underscore are deleted from their module before other globals
       are deleted; if no other references to such globals exist, this
       may help in assuring that imported modules are still available
       at the time when the "__del__()" method is called.

object.__repr__(self)

   Called by the "repr()" built-in function to compute the “official”
   string representation of an object.  If at all possible, this
   should look like a valid Python expression that could be used to
   recreate an object with the same value (given an appropriate
   environment).  If this is not possible, a string of the form
   "<...some useful description...>" should be returned. The return
   value must be a string object. If a class defines "__repr__()" but
   not "__str__()", then "__repr__()" is also used when an “informal”
   string representation of instances of that class is required.

   This is typically used for debugging, so it is important that the
   representation is information-rich and unambiguous.

object.__str__(self)

   Called by "str(object)" and the built-in functions "format()" and
   "print()" to compute the “informal” or nicely printable string
   representation of an object.  The return value must be a string
   object.

   This method differs from "object.__repr__()" in that there is no
   expectation that "__str__()" return a valid Python expression: a
   more convenient or concise representation can be used.

   The default implementation defined by the built-in type "object"
   calls "object.__repr__()".

object.__bytes__(self)

   Called by bytes to compute a byte-string representation of an
   object. This should return a "bytes" object.

object.__format__(self, format_spec)

   Called by the "format()" built-in function, and by extension,
   evaluation of formatted string literals and the "str.format()"
   method, to produce a “formatted” string representation of an
   object. The *format_spec* argument is a string that contains a
   description of the formatting options desired. The interpretation
   of the *format_spec* argument is up to the type implementing
   "__format__()", however most classes will either delegate
   formatting to one of the built-in types, or use a similar
   formatting option syntax.

   See Format Specification Mini-Language for a description of the
   standard formatting syntax.

   The return value must be a string object.

   Changed in version 3.4: The __format__ method of "object" itself
   raises a "TypeError" if passed any non-empty string.

   Changed in version 3.7: "object.__format__(x, '')" is now
   equivalent to "str(x)" rather than "format(str(self), '')".

object.__lt__(self, other)
object.__le__(self, other)
object.__eq__(self, other)
object.__ne__(self, other)
object.__gt__(self, other)
object.__ge__(self, other)

   These are the so-called “rich comparison” methods. The
   correspondence between operator symbols and method names is as
   follows: "x<y" calls "x.__lt__(y)", "x<=y" calls "x.__le__(y)",
   "x==y" calls "x.__eq__(y)", "x!=y" calls "x.__ne__(y)", "x>y" calls
   "x.__gt__(y)", and "x>=y" calls "x.__ge__(y)".

   A rich comparison method may return the singleton "NotImplemented"
   if it does not implement the operation for a given pair of
   arguments. By convention, "False" and "True" are returned for a
   successful comparison. However, these methods can return any value,
   so if the comparison operator is used in a Boolean context (e.g.,
   in the condition of an "if" statement), Python will call "bool()"
   on the value to determine if the result is true or false.

   By default, "object" implements "__eq__()" by using "is", returning
   "NotImplemented" in the case of a false comparison: "True if x is y
   else NotImplemented". For "__ne__()", by default it delegates to
   "__eq__()" and inverts the result unless it is "NotImplemented".
   There are no other implied relationships among the comparison
   operators or default implementations; for example, the truth of
   "(x<y or x==y)" does not imply "x<=y". To automatically generate
   ordering operations from a single root operation, see
   "functools.total_ordering()".

   See the paragraph on "__hash__()" for some important notes on
   creating *hashable* objects which support custom comparison
   operations and are usable as dictionary keys.

   There are no swapped-argument versions of these methods (to be used
   when the left argument does not support the operation but the right
   argument does); rather, "__lt__()" and "__gt__()" are each other’s
   reflection, "__le__()" and "__ge__()" are each other’s reflection,
   and "__eq__()" and "__ne__()" are their own reflection. If the
   operands are of different types, and right operand’s type is a
   direct or indirect subclass of the left operand’s type, the
   reflected method of the right operand has priority, otherwise the
   left operand’s method has priority.  Virtual subclassing is not
   considered.

object.__hash__(self)

   Called by built-in function "hash()" and for operations on members
   of hashed collections including "set", "frozenset", and "dict".
   "__hash__()" should return an integer. The only required property
   is that objects which compare equal have the same hash value; it is
   advised to mix together the hash values of the components of the
   object that also play a part in comparison of objects by packing
   them into a tuple and hashing the tuple. Example:

      def __hash__(self):
          return hash((self.name, self.nick, self.color))

   Note:

     "hash()" truncates the value returned from an object’s custom
     "__hash__()" method to the size of a "Py_ssize_t".  This is
     typically 8 bytes on 64-bit builds and 4 bytes on 32-bit builds.
     If an object’s   "__hash__()" must interoperate on builds of
     different bit sizes, be sure to check the width on all supported
     builds.  An easy way to do this is with "python -c "import sys;
     print(sys.hash_info.width)"".

   If a class does not define an "__eq__()" method it should not
   define a "__hash__()" operation either; if it defines "__eq__()"
   but not "__hash__()", its instances will not be usable as items in
   hashable collections.  If a class defines mutable objects and
   implements an "__eq__()" method, it should not implement
   "__hash__()", since the implementation of hashable collections
   requires that a key’s hash value is immutable (if the object’s hash
   value changes, it will be in the wrong hash bucket).

   User-defined classes have "__eq__()" and "__hash__()" methods by
   default; with them, all objects compare unequal (except with
   themselves) and "x.__hash__()" returns an appropriate value such
   that "x == y" implies both that "x is y" and "hash(x) == hash(y)".

   A class that overrides "__eq__()" and does not define "__hash__()"
   will have its "__hash__()" implicitly set to "None".  When the
   "__hash__()" method of a class is "None", instances of the class
   will raise an appropriate "TypeError" when a program attempts to
   retrieve their hash value, and will also be correctly identified as
   unhashable when checking "isinstance(obj,
   collections.abc.Hashable)".

   If a class that overrides "__eq__()" needs to retain the
   implementation of "__hash__()" from a parent class, the interpreter
   must be told this explicitly by setting "__hash__ =
   <ParentClass>.__hash__".

   If a class that does not override "__eq__()" wishes to suppress
   hash support, it should include "__hash__ = None" in the class
   definition. A class which defines its own "__hash__()" that
   explicitly raises a "TypeError" would be incorrectly identified as
   hashable by an "isinstance(obj, collections.abc.Hashable)" call.

   Note:

     By default, the "__hash__()" values of str and bytes objects are
     “salted” with an unpredictable random value.  Although they
     remain constant within an individual Python process, they are not
     predictable between repeated invocations of Python.This is
     intended to provide protection against a denial-of-service caused
     by carefully-chosen inputs that exploit the worst case
     performance of a dict insertion, O(n^2) complexity.  See
     http://www.ocert.org/advisories/ocert-2011-003.html for
     details.Changing hash values affects the iteration order of sets.
     Python has never made guarantees about this ordering (and it
     typically varies between 32-bit and 64-bit builds).See also
     "PYTHONHASHSEED".

   Changed in version 3.3: Hash randomization is enabled by default.

object.__bool__(self)

   Called to implement truth value testing and the built-in operation
   "bool()"; should return "False" or "True".  When this method is not
   defined, "__len__()" is called, if it is defined, and the object is
   considered true if its result is nonzero.  If a class defines
   neither "__len__()" nor "__bool__()", all its instances are
   considered true.
u�I"pdb" — The Python Debugger
***************************

**Source code:** Lib/pdb.py

======================================================================

The module "pdb" defines an interactive source code debugger for
Python programs.  It supports setting (conditional) breakpoints and
single stepping at the source line level, inspection of stack frames,
source code listing, and evaluation of arbitrary Python code in the
context of any stack frame.  It also supports post-mortem debugging
and can be called under program control.

The debugger is extensible – it is actually defined as the class
"Pdb". This is currently undocumented but easily understood by reading
the source.  The extension interface uses the modules "bdb" and "cmd".

The debugger’s prompt is "(Pdb)". Typical usage to run a program under
control of the debugger is:

   >>> import pdb
   >>> import mymodule
   >>> pdb.run('mymodule.test()')
   > <string>(0)?()
   (Pdb) continue
   > <string>(1)?()
   (Pdb) continue
   NameError: 'spam'
   > <string>(1)?()
   (Pdb)

Changed in version 3.3: Tab-completion via the "readline" module is
available for commands and command arguments, e.g. the current global
and local names are offered as arguments of the "p" command.

"pdb.py" can also be invoked as a script to debug other scripts.  For
example:

   python3 -m pdb myscript.py

When invoked as a script, pdb will automatically enter post-mortem
debugging if the program being debugged exits abnormally.  After post-
mortem debugging (or after normal exit of the program), pdb will
restart the program.  Automatic restarting preserves pdb’s state (such
as breakpoints) and in most cases is more useful than quitting the
debugger upon program’s exit.

New in version 3.2: "pdb.py" now accepts a "-c" option that executes
commands as if given in a ".pdbrc" file, see Debugger Commands.

New in version 3.7: "pdb.py" now accepts a "-m" option that execute
modules similar to the way "python3 -m" does. As with a script, the
debugger will pause execution just before the first line of the
module.

The typical usage to break into the debugger from a running program is
to insert

   import pdb; pdb.set_trace()

at the location you want to break into the debugger.  You can then
step through the code following this statement, and continue running
without the debugger using the "continue" command.

New in version 3.7: The built-in "breakpoint()", when called with
defaults, can be used instead of "import pdb; pdb.set_trace()".

The typical usage to inspect a crashed program is:

   >>> import pdb
   >>> import mymodule
   >>> mymodule.test()
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
     File "./mymodule.py", line 4, in test
       test2()
     File "./mymodule.py", line 3, in test2
       print(spam)
   NameError: spam
   >>> pdb.pm()
   > ./mymodule.py(3)test2()
   -> print(spam)
   (Pdb)

The module defines the following functions; each enters the debugger
in a slightly different way:

pdb.run(statement, globals=None, locals=None)

   Execute the *statement* (given as a string or a code object) under
   debugger control.  The debugger prompt appears before any code is
   executed; you can set breakpoints and type "continue", or you can
   step through the statement using "step" or "next" (all these
   commands are explained below).  The optional *globals* and *locals*
   arguments specify the environment in which the code is executed; by
   default the dictionary of the module "__main__" is used.  (See the
   explanation of the built-in "exec()" or "eval()" functions.)

pdb.runeval(expression, globals=None, locals=None)

   Evaluate the *expression* (given as a string or a code object)
   under debugger control.  When "runeval()" returns, it returns the
   value of the expression.  Otherwise this function is similar to
   "run()".

pdb.runcall(function, *args, **kwds)

   Call the *function* (a function or method object, not a string)
   with the given arguments.  When "runcall()" returns, it returns
   whatever the function call returned.  The debugger prompt appears
   as soon as the function is entered.

pdb.set_trace(*, header=None)

   Enter the debugger at the calling stack frame.  This is useful to
   hard-code a breakpoint at a given point in a program, even if the
   code is not otherwise being debugged (e.g. when an assertion
   fails).  If given, *header* is printed to the console just before
   debugging begins.

   Changed in version 3.7: The keyword-only argument *header*.

pdb.post_mortem(traceback=None)

   Enter post-mortem debugging of the given *traceback* object.  If no
   *traceback* is given, it uses the one of the exception that is
   currently being handled (an exception must be being handled if the
   default is to be used).

pdb.pm()

   Enter post-mortem debugging of the traceback found in
   "sys.last_traceback".

The "run*" functions and "set_trace()" are aliases for instantiating
the "Pdb" class and calling the method of the same name.  If you want
to access further features, you have to do this yourself:

class pdb.Pdb(completekey='tab', stdin=None, stdout=None, skip=None, nosigint=False, readrc=True)

   "Pdb" is the debugger class.

   The *completekey*, *stdin* and *stdout* arguments are passed to the
   underlying "cmd.Cmd" class; see the description there.

   The *skip* argument, if given, must be an iterable of glob-style
   module name patterns.  The debugger will not step into frames that
   originate in a module that matches one of these patterns. [1]

   By default, Pdb sets a handler for the SIGINT signal (which is sent
   when the user presses "Ctrl-C" on the console) when you give a
   "continue" command. This allows you to break into the debugger
   again by pressing "Ctrl-C".  If you want Pdb not to touch the
   SIGINT handler, set *nosigint* to true.

   The *readrc* argument defaults to true and controls whether Pdb
   will load .pdbrc files from the filesystem.

   Example call to enable tracing with *skip*:

      import pdb; pdb.Pdb(skip=['django.*']).set_trace()

   Raises an auditing event "pdb.Pdb" with no arguments.

   New in version 3.1: The *skip* argument.

   New in version 3.2: The *nosigint* argument.  Previously, a SIGINT
   handler was never set by Pdb.

   Changed in version 3.6: The *readrc* argument.

   run(statement, globals=None, locals=None)
   runeval(expression, globals=None, locals=None)
   runcall(function, *args, **kwds)
   set_trace()

      See the documentation for the functions explained above.


Debugger Commands
=================

The commands recognized by the debugger are listed below.  Most
commands can be abbreviated to one or two letters as indicated; e.g.
"h(elp)" means that either "h" or "help" can be used to enter the help
command (but not "he" or "hel", nor "H" or "Help" or "HELP").
Arguments to commands must be separated by whitespace (spaces or
tabs).  Optional arguments are enclosed in square brackets ("[]") in
the command syntax; the square brackets must not be typed.
Alternatives in the command syntax are separated by a vertical bar
("|").

Entering a blank line repeats the last command entered.  Exception: if
the last command was a "list" command, the next 11 lines are listed.

Commands that the debugger doesn’t recognize are assumed to be Python
statements and are executed in the context of the program being
debugged.  Python statements can also be prefixed with an exclamation
point ("!").  This is a powerful way to inspect the program being
debugged; it is even possible to change a variable or call a function.
When an exception occurs in such a statement, the exception name is
printed but the debugger’s state is not changed.

The debugger supports aliases.  Aliases can have parameters which
allows one a certain level of adaptability to the context under
examination.

Multiple commands may be entered on a single line, separated by ";;".
(A single ";" is not used as it is the separator for multiple commands
in a line that is passed to the Python parser.)  No intelligence is
applied to separating the commands; the input is split at the first
";;" pair, even if it is in the middle of a quoted string.

If a file ".pdbrc" exists in the user’s home directory or in the
current directory, it is read in and executed as if it had been typed
at the debugger prompt.  This is particularly useful for aliases.  If
both files exist, the one in the home directory is read first and
aliases defined there can be overridden by the local file.

Changed in version 3.2: ".pdbrc" can now contain commands that
continue debugging, such as "continue" or "next".  Previously, these
commands had no effect.

h(elp) [command]

   Without argument, print the list of available commands.  With a
   *command* as argument, print help about that command.  "help pdb"
   displays the full documentation (the docstring of the "pdb"
   module).  Since the *command* argument must be an identifier, "help
   exec" must be entered to get help on the "!" command.

w(here)

   Print a stack trace, with the most recent frame at the bottom.  An
   arrow indicates the current frame, which determines the context of
   most commands.

d(own) [count]

   Move the current frame *count* (default one) levels down in the
   stack trace (to a newer frame).

u(p) [count]

   Move the current frame *count* (default one) levels up in the stack
   trace (to an older frame).

b(reak) [([filename:]lineno | function) [, condition]]

   With a *lineno* argument, set a break there in the current file.
   With a *function* argument, set a break at the first executable
   statement within that function.  The line number may be prefixed
   with a filename and a colon, to specify a breakpoint in another
   file (probably one that hasn’t been loaded yet).  The file is
   searched on "sys.path".  Note that each breakpoint is assigned a
   number to which all the other breakpoint commands refer.

   If a second argument is present, it is an expression which must
   evaluate to true before the breakpoint is honored.

   Without argument, list all breaks, including for each breakpoint,
   the number of times that breakpoint has been hit, the current
   ignore count, and the associated condition if any.

tbreak [([filename:]lineno | function) [, condition]]

   Temporary breakpoint, which is removed automatically when it is
   first hit. The arguments are the same as for "break".

cl(ear) [filename:lineno | bpnumber [bpnumber ...]]

   With a *filename:lineno* argument, clear all the breakpoints at
   this line. With a space separated list of breakpoint numbers, clear
   those breakpoints. Without argument, clear all breaks (but first
   ask confirmation).

disable [bpnumber [bpnumber ...]]

   Disable the breakpoints given as a space separated list of
   breakpoint numbers.  Disabling a breakpoint means it cannot cause
   the program to stop execution, but unlike clearing a breakpoint, it
   remains in the list of breakpoints and can be (re-)enabled.

enable [bpnumber [bpnumber ...]]

   Enable the breakpoints specified.

ignore bpnumber [count]

   Set the ignore count for the given breakpoint number.  If count is
   omitted, the ignore count is set to 0.  A breakpoint becomes active
   when the ignore count is zero.  When non-zero, the count is
   decremented each time the breakpoint is reached and the breakpoint
   is not disabled and any associated condition evaluates to true.

condition bpnumber [condition]

   Set a new *condition* for the breakpoint, an expression which must
   evaluate to true before the breakpoint is honored.  If *condition*
   is absent, any existing condition is removed; i.e., the breakpoint
   is made unconditional.

commands [bpnumber]

   Specify a list of commands for breakpoint number *bpnumber*.  The
   commands themselves appear on the following lines.  Type a line
   containing just "end" to terminate the commands. An example:

      (Pdb) commands 1
      (com) p some_variable
      (com) end
      (Pdb)

   To remove all commands from a breakpoint, type "commands" and
   follow it immediately with "end"; that is, give no commands.

   With no *bpnumber* argument, "commands" refers to the last
   breakpoint set.

   You can use breakpoint commands to start your program up again.
   Simply use the "continue" command, or "step", or any other command
   that resumes execution.

   Specifying any command resuming execution (currently "continue",
   "step", "next", "return", "jump", "quit" and their abbreviations)
   terminates the command list (as if that command was immediately
   followed by end). This is because any time you resume execution
   (even with a simple next or step), you may encounter another
   breakpoint—which could have its own command list, leading to
   ambiguities about which list to execute.

   If you use the ‘silent’ command in the command list, the usual
   message about stopping at a breakpoint is not printed.  This may be
   desirable for breakpoints that are to print a specific message and
   then continue.  If none of the other commands print anything, you
   see no sign that the breakpoint was reached.

s(tep)

   Execute the current line, stop at the first possible occasion
   (either in a function that is called or on the next line in the
   current function).

n(ext)

   Continue execution until the next line in the current function is
   reached or it returns.  (The difference between "next" and "step"
   is that "step" stops inside a called function, while "next"
   executes called functions at (nearly) full speed, only stopping at
   the next line in the current function.)

unt(il) [lineno]

   Without argument, continue execution until the line with a number
   greater than the current one is reached.

   With a line number, continue execution until a line with a number
   greater or equal to that is reached.  In both cases, also stop when
   the current frame returns.

   Changed in version 3.2: Allow giving an explicit line number.

r(eturn)

   Continue execution until the current function returns.

c(ont(inue))

   Continue execution, only stop when a breakpoint is encountered.

j(ump) lineno

   Set the next line that will be executed.  Only available in the
   bottom-most frame.  This lets you jump back and execute code again,
   or jump forward to skip code that you don’t want to run.

   It should be noted that not all jumps are allowed – for instance it
   is not possible to jump into the middle of a "for" loop or out of a
   "finally" clause.

l(ist) [first[, last]]

   List source code for the current file.  Without arguments, list 11
   lines around the current line or continue the previous listing.
   With "." as argument, list 11 lines around the current line.  With
   one argument, list 11 lines around at that line.  With two
   arguments, list the given range; if the second argument is less
   than the first, it is interpreted as a count.

   The current line in the current frame is indicated by "->".  If an
   exception is being debugged, the line where the exception was
   originally raised or propagated is indicated by ">>", if it differs
   from the current line.

   New in version 3.2: The ">>" marker.

ll | longlist

   List all source code for the current function or frame.
   Interesting lines are marked as for "list".

   New in version 3.2.

a(rgs)

   Print the argument list of the current function.

p expression

   Evaluate the *expression* in the current context and print its
   value.

   Note:

     "print()" can also be used, but is not a debugger command — this
     executes the Python "print()" function.

pp expression

   Like the "p" command, except the value of the expression is pretty-
   printed using the "pprint" module.

whatis expression

   Print the type of the *expression*.

source expression

   Try to get source code for the given object and display it.

   New in version 3.2.

display [expression]

   Display the value of the expression if it changed, each time
   execution stops in the current frame.

   Without expression, list all display expressions for the current
   frame.

   New in version 3.2.

undisplay [expression]

   Do not display the expression any more in the current frame.
   Without expression, clear all display expressions for the current
   frame.

   New in version 3.2.

interact

   Start an interactive interpreter (using the "code" module) whose
   global namespace contains all the (global and local) names found in
   the current scope.

   New in version 3.2.

alias [name [command]]

   Create an alias called *name* that executes *command*.  The command
   must *not* be enclosed in quotes.  Replaceable parameters can be
   indicated by "%1", "%2", and so on, while "%*" is replaced by all
   the parameters. If no command is given, the current alias for
   *name* is shown. If no arguments are given, all aliases are listed.

   Aliases may be nested and can contain anything that can be legally
   typed at the pdb prompt.  Note that internal pdb commands *can* be
   overridden by aliases.  Such a command is then hidden until the
   alias is removed.  Aliasing is recursively applied to the first
   word of the command line; all other words in the line are left
   alone.

   As an example, here are two useful aliases (especially when placed
   in the ".pdbrc" file):

      # Print instance variables (usage "pi classInst")
      alias pi for k in %1.__dict__.keys(): print("%1.",k,"=",%1.__dict__[k])
      # Print instance variables in self
      alias ps pi self

unalias name

   Delete the specified alias.

! statement

   Execute the (one-line) *statement* in the context of the current
   stack frame. The exclamation point can be omitted unless the first
   word of the statement resembles a debugger command.  To set a
   global variable, you can prefix the assignment command with a
   "global" statement on the same line, e.g.:

      (Pdb) global list_options; list_options = ['-l']
      (Pdb)

run [args ...]
restart [args ...]

   Restart the debugged Python program.  If an argument is supplied,
   it is split with "shlex" and the result is used as the new
   "sys.argv". History, breakpoints, actions and debugger options are
   preserved. "restart" is an alias for "run".

q(uit)

   Quit from the debugger.  The program being executed is aborted.

debug code

   Enter a recursive debugger that steps through the code argument
   (which is an arbitrary expression or statement to be executed in
   the current environment).

retval

   Print the return value for the last return of a function.

-[ Footnotes ]-

[1] Whether a frame is considered to originate in a certain module is
    determined by the "__name__" in the frame globals.
a�The "del" statement
*******************

   del_stmt ::= "del" target_list

Deletion is recursively defined very similar to the way assignment is
defined. Rather than spelling it out in full details, here are some
hints.

Deletion of a target list recursively deletes each target, from left
to right.

Deletion of a name removes the binding of that name from the local or
global namespace, depending on whether the name occurs in a "global"
statement in the same code block.  If the name is unbound, a
"NameError" exception will be raised.

Deletion of attribute references, subscriptions and slicings is passed
to the primary object involved; deletion of a slicing is in general
equivalent to assignment of an empty slice of the right type (but even
this is determined by the sliced object).

Changed in version 3.2: Previously it was illegal to delete a name
from the local namespace if it occurs as a free variable in a nested
block.
uDictionary displays
*******************

A dictionary display is a possibly empty series of key/datum pairs
enclosed in curly braces:

   dict_display       ::= "{" [key_datum_list | dict_comprehension] "}"
   key_datum_list     ::= key_datum ("," key_datum)* [","]
   key_datum          ::= expression ":" expression | "**" or_expr
   dict_comprehension ::= expression ":" expression comp_for

A dictionary display yields a new dictionary object.

If a comma-separated sequence of key/datum pairs is given, they are
evaluated from left to right to define the entries of the dictionary:
each key object is used as a key into the dictionary to store the
corresponding datum.  This means that you can specify the same key
multiple times in the key/datum list, and the final dictionary’s value
for that key will be the last one given.

A double asterisk "**" denotes *dictionary unpacking*. Its operand
must be a *mapping*.  Each mapping item is added to the new
dictionary.  Later values replace values already set by earlier
key/datum pairs and earlier dictionary unpackings.

New in version 3.5: Unpacking into dictionary displays, originally
proposed by **PEP 448**.

A dict comprehension, in contrast to list and set comprehensions,
needs two expressions separated with a colon followed by the usual
“for” and “if” clauses. When the comprehension is run, the resulting
key and value elements are inserted in the new dictionary in the order
they are produced.

Restrictions on the types of the key values are listed earlier in
section The standard type hierarchy.  (To summarize, the key type
should be *hashable*, which excludes all mutable objects.)  Clashes
between duplicate keys are not detected; the last datum (textually
rightmost in the display) stored for a given key value prevails.

Changed in version 3.8: Prior to Python 3.8, in dict comprehensions,
the evaluation order of key and value was not well-defined.  In
CPython, the value was evaluated before the key.  Starting with 3.8,
the key is evaluated before the value, as proposed by **PEP 572**.
a�Interaction with dynamic features
*********************************

Name resolution of free variables occurs at runtime, not at compile
time. This means that the following code will print 42:

   i = 10
   def f():
       print(i)
   i = 42
   f()

The "eval()" and "exec()" functions do not have access to the full
environment for resolving names.  Names may be resolved in the local
and global namespaces of the caller.  Free variables are not resolved
in the nearest enclosing namespace, but in the global namespace.  [1]
The "exec()" and "eval()" functions have optional arguments to
override the global and local namespace.  If only one namespace is
specified, it is used for both.
aXThe "if" statement
******************

The "if" statement is used for conditional execution:

   if_stmt ::= "if" assignment_expression ":" suite
               ("elif" assignment_expression ":" suite)*
               ["else" ":" suite]

It selects exactly one of the suites by evaluating the expressions one
by one until one is found to be true (see section Boolean operations
for the definition of true and false); then that suite is executed
(and no other part of the "if" statement is executed or evaluated).
If all expressions are false, the suite of the "else" clause, if
present, is executed.
u�Exceptions
**********

Exceptions are a means of breaking out of the normal flow of control
of a code block in order to handle errors or other exceptional
conditions.  An exception is *raised* at the point where the error is
detected; it may be *handled* by the surrounding code block or by any
code block that directly or indirectly invoked the code block where
the error occurred.

The Python interpreter raises an exception when it detects a run-time
error (such as division by zero).  A Python program can also
explicitly raise an exception with the "raise" statement. Exception
handlers are specified with the "try" … "except" statement.  The
"finally" clause of such a statement can be used to specify cleanup
code which does not handle the exception, but is executed whether an
exception occurred or not in the preceding code.

Python uses the “termination” model of error handling: an exception
handler can find out what happened and continue execution at an outer
level, but it cannot repair the cause of the error and retry the
failing operation (except by re-entering the offending piece of code
from the top).

When an exception is not handled at all, the interpreter terminates
execution of the program, or returns to its interactive main loop.  In
either case, it prints a stack traceback, except when the exception is
"SystemExit".

Exceptions are identified by class instances.  The "except" clause is
selected depending on the class of the instance: it must reference the
class of the instance or a base class thereof.  The instance can be
received by the handler and can carry additional information about the
exceptional condition.

Note:

  Exception messages are not part of the Python API.  Their contents
  may change from one version of Python to the next without warning
  and should not be relied on by code which will run under multiple
  versions of the interpreter.

See also the description of the "try" statement in section The try
statement and "raise" statement in section The raise statement.

-[ Footnotes ]-

[1] This limitation occurs because the code that is executed by these
    operations is not available at the time the module is compiled.
u$Execution model
***************


Structure of a program
======================

A Python program is constructed from code blocks. A *block* is a piece
of Python program text that is executed as a unit. The following are
blocks: a module, a function body, and a class definition. Each
command typed interactively is a block.  A script file (a file given
as standard input to the interpreter or specified as a command line
argument to the interpreter) is a code block.  A script command (a
command specified on the interpreter command line with the "-c"
option) is a code block.  The string argument passed to the built-in
functions "eval()" and "exec()" is a code block.

A code block is executed in an *execution frame*.  A frame contains
some administrative information (used for debugging) and determines
where and how execution continues after the code block’s execution has
completed.


Naming and binding
==================


Binding of names
----------------

*Names* refer to objects.  Names are introduced by name binding
operations.

The following constructs bind names: formal parameters to functions,
"import" statements, class and function definitions (these bind the
class or function name in the defining block), and targets that are
identifiers if occurring in an assignment, "for" loop header, or after
"as" in a "with" statement or "except" clause. The "import" statement
of the form "from ... import *" binds all names defined in the
imported module, except those beginning with an underscore.  This form
may only be used at the module level.

A target occurring in a "del" statement is also considered bound for
this purpose (though the actual semantics are to unbind the name).

Each assignment or import statement occurs within a block defined by a
class or function definition or at the module level (the top-level
code block).

If a name is bound in a block, it is a local variable of that block,
unless declared as "nonlocal" or "global".  If a name is bound at the
module level, it is a global variable.  (The variables of the module
code block are local and global.)  If a variable is used in a code
block but not defined there, it is a *free variable*.

Each occurrence of a name in the program text refers to the *binding*
of that name established by the following name resolution rules.


Resolution of names
-------------------

A *scope* defines the visibility of a name within a block.  If a local
variable is defined in a block, its scope includes that block.  If the
definition occurs in a function block, the scope extends to any blocks
contained within the defining one, unless a contained block introduces
a different binding for the name.

When a name is used in a code block, it is resolved using the nearest
enclosing scope.  The set of all such scopes visible to a code block
is called the block’s *environment*.

When a name is not found at all, a "NameError" exception is raised. If
the current scope is a function scope, and the name refers to a local
variable that has not yet been bound to a value at the point where the
name is used, an "UnboundLocalError" exception is raised.
"UnboundLocalError" is a subclass of "NameError".

If a name binding operation occurs anywhere within a code block, all
uses of the name within the block are treated as references to the
current block.  This can lead to errors when a name is used within a
block before it is bound.  This rule is subtle.  Python lacks
declarations and allows name binding operations to occur anywhere
within a code block.  The local variables of a code block can be
determined by scanning the entire text of the block for name binding
operations.

If the "global" statement occurs within a block, all uses of the name
specified in the statement refer to the binding of that name in the
top-level namespace.  Names are resolved in the top-level namespace by
searching the global namespace, i.e. the namespace of the module
containing the code block, and the builtins namespace, the namespace
of the module "builtins".  The global namespace is searched first.  If
the name is not found there, the builtins namespace is searched.  The
"global" statement must precede all uses of the name.

The "global" statement has the same scope as a name binding operation
in the same block.  If the nearest enclosing scope for a free variable
contains a global statement, the free variable is treated as a global.

The "nonlocal" statement causes corresponding names to refer to
previously bound variables in the nearest enclosing function scope.
"SyntaxError" is raised at compile time if the given name does not
exist in any enclosing function scope.

The namespace for a module is automatically created the first time a
module is imported.  The main module for a script is always called
"__main__".

Class definition blocks and arguments to "exec()" and "eval()" are
special in the context of name resolution. A class definition is an
executable statement that may use and define names. These references
follow the normal rules for name resolution with an exception that
unbound local variables are looked up in the global namespace. The
namespace of the class definition becomes the attribute dictionary of
the class. The scope of names defined in a class block is limited to
the class block; it does not extend to the code blocks of methods –
this includes comprehensions and generator expressions since they are
implemented using a function scope.  This means that the following
will fail:

   class A:
       a = 42
       b = list(a + i for i in range(10))


Builtins and restricted execution
---------------------------------

**CPython implementation detail:** Users should not touch
"__builtins__"; it is strictly an implementation detail.  Users
wanting to override values in the builtins namespace should "import"
the "builtins" module and modify its attributes appropriately.

The builtins namespace associated with the execution of a code block
is actually found by looking up the name "__builtins__" in its global
namespace; this should be a dictionary or a module (in the latter case
the module’s dictionary is used).  By default, when in the "__main__"
module, "__builtins__" is the built-in module "builtins"; when in any
other module, "__builtins__" is an alias for the dictionary of the
"builtins" module itself.


Interaction with dynamic features
---------------------------------

Name resolution of free variables occurs at runtime, not at compile
time. This means that the following code will print 42:

   i = 10
   def f():
       print(i)
   i = 42
   f()

The "eval()" and "exec()" functions do not have access to the full
environment for resolving names.  Names may be resolved in the local
and global namespaces of the caller.  Free variables are not resolved
in the nearest enclosing namespace, but in the global namespace.  [1]
The "exec()" and "eval()" functions have optional arguments to
override the global and local namespace.  If only one namespace is
specified, it is used for both.


Exceptions
==========

Exceptions are a means of breaking out of the normal flow of control
of a code block in order to handle errors or other exceptional
conditions.  An exception is *raised* at the point where the error is
detected; it may be *handled* by the surrounding code block or by any
code block that directly or indirectly invoked the code block where
the error occurred.

The Python interpreter raises an exception when it detects a run-time
error (such as division by zero).  A Python program can also
explicitly raise an exception with the "raise" statement. Exception
handlers are specified with the "try" … "except" statement.  The
"finally" clause of such a statement can be used to specify cleanup
code which does not handle the exception, but is executed whether an
exception occurred or not in the preceding code.

Python uses the “termination” model of error handling: an exception
handler can find out what happened and continue execution at an outer
level, but it cannot repair the cause of the error and retry the
failing operation (except by re-entering the offending piece of code
from the top).

When an exception is not handled at all, the interpreter terminates
execution of the program, or returns to its interactive main loop.  In
either case, it prints a stack traceback, except when the exception is
"SystemExit".

Exceptions are identified by class instances.  The "except" clause is
selected depending on the class of the instance: it must reference the
class of the instance or a base class thereof.  The instance can be
received by the handler and can carry additional information about the
exceptional condition.

Note:

  Exception messages are not part of the Python API.  Their contents
  may change from one version of Python to the next without warning
  and should not be relied on by code which will run under multiple
  versions of the interpreter.

See also the description of the "try" statement in section The try
statement and "raise" statement in section The raise statement.

-[ Footnotes ]-

[1] This limitation occurs because the code that is executed by these
    operations is not available at the time the module is compiled.
uzExpression lists
****************

   expression_list    ::= expression ("," expression)* [","]
   starred_list       ::= starred_item ("," starred_item)* [","]
   starred_expression ::= expression | (starred_item ",")* [starred_item]
   starred_item       ::= assignment_expression | "*" or_expr

Except when part of a list or set display, an expression list
containing at least one comma yields a tuple.  The length of the tuple
is the number of expressions in the list.  The expressions are
evaluated from left to right.

An asterisk "*" denotes *iterable unpacking*.  Its operand must be an
*iterable*.  The iterable is expanded into a sequence of items, which
are included in the new tuple, list, or set, at the site of the
unpacking.

New in version 3.5: Iterable unpacking in expression lists, originally
proposed by **PEP 448**.

The trailing comma is required only to create a single tuple (a.k.a. a
*singleton*); it is optional in all other cases.  A single expression
without a trailing comma doesn’t create a tuple, but rather yields the
value of that expression. (To create an empty tuple, use an empty pair
of parentheses: "()".)
a�Floating point literals
***********************

Floating point literals are described by the following lexical
definitions:

   floatnumber   ::= pointfloat | exponentfloat
   pointfloat    ::= [digitpart] fraction | digitpart "."
   exponentfloat ::= (digitpart | pointfloat) exponent
   digitpart     ::= digit (["_"] digit)*
   fraction      ::= "." digitpart
   exponent      ::= ("e" | "E") ["+" | "-"] digitpart

Note that the integer and exponent parts are always interpreted using
radix 10. For example, "077e010" is legal, and denotes the same number
as "77e10". The allowed range of floating point literals is
implementation-dependent.  As in integer literals, underscores are
supported for digit grouping.

Some examples of floating point literals:

   3.14    10.    .001    1e100    3.14e-10    0e0    3.14_15_93

Changed in version 3.6: Underscores are now allowed for grouping
purposes in literals.
u�
The "for" statement
*******************

The "for" statement is used to iterate over the elements of a sequence
(such as a string, tuple or list) or other iterable object:

   for_stmt ::= "for" target_list "in" expression_list ":" suite
                ["else" ":" suite]

The expression list is evaluated once; it should yield an iterable
object.  An iterator is created for the result of the
"expression_list".  The suite is then executed once for each item
provided by the iterator, in the order returned by the iterator.  Each
item in turn is assigned to the target list using the standard rules
for assignments (see Assignment statements), and then the suite is
executed.  When the items are exhausted (which is immediately when the
sequence is empty or an iterator raises a "StopIteration" exception),
the suite in the "else" clause, if present, is executed, and the loop
terminates.

A "break" statement executed in the first suite terminates the loop
without executing the "else" clause’s suite.  A "continue" statement
executed in the first suite skips the rest of the suite and continues
with the next item, or with the "else" clause if there is no next
item.

The for-loop makes assignments to the variables in the target list.
This overwrites all previous assignments to those variables including
those made in the suite of the for-loop:

   for i in range(10):
       print(i)
       i = 5             # this will not affect the for-loop
                         # because i will be overwritten with the next
                         # index in the range

Names in the target list are not deleted when the loop is finished,
but if the sequence is empty, they will not have been assigned to at
all by the loop.  Hint: the built-in function "range()" returns an
iterator of integers suitable to emulate the effect of Pascal’s "for i
:= a to b do"; e.g., "list(range(3))" returns the list "[0, 1, 2]".

Note:

  There is a subtlety when the sequence is being modified by the loop
  (this can only occur for mutable sequences, e.g. lists).  An
  internal counter is used to keep track of which item is used next,
  and this is incremented on each iteration.  When this counter has
  reached the length of the sequence the loop terminates.  This means
  that if the suite deletes the current (or a previous) item from the
  sequence, the next item will be skipped (since it gets the index of
  the current item which has already been treated).  Likewise, if the
  suite inserts an item in the sequence before the current item, the
  current item will be treated again the next time through the loop.
  This can lead to nasty bugs that can be avoided by making a
  temporary copy using a slice of the whole sequence, e.g.,

     for x in a[:]:
         if x < 0: a.remove(x)
u�`Format String Syntax
********************

The "str.format()" method and the "Formatter" class share the same
syntax for format strings (although in the case of "Formatter",
subclasses can define their own format string syntax).  The syntax is
related to that of formatted string literals, but it is less
sophisticated and, in particular, does not support arbitrary
expressions.

Format strings contain “replacement fields” surrounded by curly braces
"{}". Anything that is not contained in braces is considered literal
text, which is copied unchanged to the output.  If you need to include
a brace character in the literal text, it can be escaped by doubling:
"{{" and "}}".

The grammar for a replacement field is as follows:

      replacement_field ::= "{" [field_name] ["!" conversion] [":" format_spec] "}"
      field_name        ::= arg_name ("." attribute_name | "[" element_index "]")*
      arg_name          ::= [identifier | digit+]
      attribute_name    ::= identifier
      element_index     ::= digit+ | index_string
      index_string      ::= <any source character except "]"> +
      conversion        ::= "r" | "s" | "a"
      format_spec       ::= <described in the next section>

In less formal terms, the replacement field can start with a
*field_name* that specifies the object whose value is to be formatted
and inserted into the output instead of the replacement field. The
*field_name* is optionally followed by a  *conversion* field, which is
preceded by an exclamation point "'!'", and a *format_spec*, which is
preceded by a colon "':'".  These specify a non-default format for the
replacement value.

See also the Format Specification Mini-Language section.

The *field_name* itself begins with an *arg_name* that is either a
number or a keyword.  If it’s a number, it refers to a positional
argument, and if it’s a keyword, it refers to a named keyword
argument.  If the numerical arg_names in a format string are 0, 1, 2,
… in sequence, they can all be omitted (not just some) and the numbers
0, 1, 2, … will be automatically inserted in that order. Because
*arg_name* is not quote-delimited, it is not possible to specify
arbitrary dictionary keys (e.g., the strings "'10'" or "':-]'") within
a format string. The *arg_name* can be followed by any number of index
or attribute expressions. An expression of the form "'.name'" selects
the named attribute using "getattr()", while an expression of the form
"'[index]'" does an index lookup using "__getitem__()".

Changed in version 3.1: The positional argument specifiers can be
omitted for "str.format()", so "'{} {}'.format(a, b)" is equivalent to
"'{0} {1}'.format(a, b)".

Changed in version 3.4: The positional argument specifiers can be
omitted for "Formatter".

Some simple format string examples:

   "First, thou shalt count to {0}"  # References first positional argument
   "Bring me a {}"                   # Implicitly references the first positional argument
   "From {} to {}"                   # Same as "From {0} to {1}"
   "My quest is {name}"              # References keyword argument 'name'
   "Weight in tons {0.weight}"       # 'weight' attribute of first positional arg
   "Units destroyed: {players[0]}"   # First element of keyword argument 'players'.

The *conversion* field causes a type coercion before formatting.
Normally, the job of formatting a value is done by the "__format__()"
method of the value itself.  However, in some cases it is desirable to
force a type to be formatted as a string, overriding its own
definition of formatting.  By converting the value to a string before
calling "__format__()", the normal formatting logic is bypassed.

Three conversion flags are currently supported: "'!s'" which calls
"str()" on the value, "'!r'" which calls "repr()" and "'!a'" which
calls "ascii()".

Some examples:

   "Harold's a clever {0!s}"        # Calls str() on the argument first
   "Bring out the holy {name!r}"    # Calls repr() on the argument first
   "More {!a}"                      # Calls ascii() on the argument first

The *format_spec* field contains a specification of how the value
should be presented, including such details as field width, alignment,
padding, decimal precision and so on.  Each value type can define its
own “formatting mini-language” or interpretation of the *format_spec*.

Most built-in types support a common formatting mini-language, which
is described in the next section.

A *format_spec* field can also include nested replacement fields
within it. These nested replacement fields may contain a field name,
conversion flag and format specification, but deeper nesting is not
allowed.  The replacement fields within the format_spec are
substituted before the *format_spec* string is interpreted. This
allows the formatting of a value to be dynamically specified.

See the Format examples section for some examples.


Format Specification Mini-Language
==================================

“Format specifications” are used within replacement fields contained
within a format string to define how individual values are presented
(see Format String Syntax and Formatted string literals). They can
also be passed directly to the built-in "format()" function.  Each
formattable type may define how the format specification is to be
interpreted.

Most built-in types implement the following options for format
specifications, although some of the formatting options are only
supported by the numeric types.

A general convention is that an empty format specification produces
the same result as if you had called "str()" on the value. A non-empty
format specification typically modifies the result.

The general form of a *standard format specifier* is:

   format_spec     ::= [[fill]align][sign][#][0][width][grouping_option][.precision][type]
   fill            ::= <any character>
   align           ::= "<" | ">" | "=" | "^"
   sign            ::= "+" | "-" | " "
   width           ::= digit+
   grouping_option ::= "_" | ","
   precision       ::= digit+
   type            ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "s" | "x" | "X" | "%"

If a valid *align* value is specified, it can be preceded by a *fill*
character that can be any character and defaults to a space if
omitted. It is not possible to use a literal curly brace (”"{"” or
“"}"”) as the *fill* character in a formatted string literal or when
using the "str.format()" method.  However, it is possible to insert a
curly brace with a nested replacement field.  This limitation doesn’t
affect the "format()" function.

The meaning of the various alignment options is as follows:

   +-----------+------------------------------------------------------------+
   | Option    | Meaning                                                    |
   |===========|============================================================|
   | "'<'"     | Forces the field to be left-aligned within the available   |
   |           | space (this is the default for most objects).              |
   +-----------+------------------------------------------------------------+
   | "'>'"     | Forces the field to be right-aligned within the available  |
   |           | space (this is the default for numbers).                   |
   +-----------+------------------------------------------------------------+
   | "'='"     | Forces the padding to be placed after the sign (if any)    |
   |           | but before the digits.  This is used for printing fields   |
   |           | in the form ‘+000000120’. This alignment option is only    |
   |           | valid for numeric types.  It becomes the default when ‘0’  |
   |           | immediately precedes the field width.                      |
   +-----------+------------------------------------------------------------+
   | "'^'"     | Forces the field to be centered within the available       |
   |           | space.                                                     |
   +-----------+------------------------------------------------------------+

Note that unless a minimum field width is defined, the field width
will always be the same size as the data to fill it, so that the
alignment option has no meaning in this case.

The *sign* option is only valid for number types, and can be one of
the following:

   +-----------+------------------------------------------------------------+
   | Option    | Meaning                                                    |
   |===========|============================================================|
   | "'+'"     | indicates that a sign should be used for both positive as  |
   |           | well as negative numbers.                                  |
   +-----------+------------------------------------------------------------+
   | "'-'"     | indicates that a sign should be used only for negative     |
   |           | numbers (this is the default behavior).                    |
   +-----------+------------------------------------------------------------+
   | space     | indicates that a leading space should be used on positive  |
   |           | numbers, and a minus sign on negative numbers.             |
   +-----------+------------------------------------------------------------+

The "'#'" option causes the “alternate form” to be used for the
conversion.  The alternate form is defined differently for different
types.  This option is only valid for integer, float and complex
types. For integers, when binary, octal, or hexadecimal output is
used, this option adds the prefix respective "'0b'", "'0o'", or "'0x'"
to the output value. For float and complex the alternate form causes
the result of the conversion to always contain a decimal-point
character, even if no digits follow it. Normally, a decimal-point
character appears in the result of these conversions only if a digit
follows it. In addition, for "'g'" and "'G'" conversions, trailing
zeros are not removed from the result.

The "','" option signals the use of a comma for a thousands separator.
For a locale aware separator, use the "'n'" integer presentation type
instead.

Changed in version 3.1: Added the "','" option (see also **PEP 378**).

The "'_'" option signals the use of an underscore for a thousands
separator for floating point presentation types and for integer
presentation type "'d'".  For integer presentation types "'b'", "'o'",
"'x'", and "'X'", underscores will be inserted every 4 digits.  For
other presentation types, specifying this option is an error.

Changed in version 3.6: Added the "'_'" option (see also **PEP 515**).

*width* is a decimal integer defining the minimum total field width,
including any prefixes, separators, and other formatting characters.
If not specified, then the field width will be determined by the
content.

When no explicit alignment is given, preceding the *width* field by a
zero ("'0'") character enables sign-aware zero-padding for numeric
types.  This is equivalent to a *fill* character of "'0'" with an
*alignment* type of "'='".

The *precision* is a decimal number indicating how many digits should
be displayed after the decimal point for a floating point value
formatted with "'f'" and "'F'", or before and after the decimal point
for a floating point value formatted with "'g'" or "'G'".  For non-
number types the field indicates the maximum field size - in other
words, how many characters will be used from the field content. The
*precision* is not allowed for integer values.

Finally, the *type* determines how the data should be presented.

The available string presentation types are:

   +-----------+------------------------------------------------------------+
   | Type      | Meaning                                                    |
   |===========|============================================================|
   | "'s'"     | String format. This is the default type for strings and    |
   |           | may be omitted.                                            |
   +-----------+------------------------------------------------------------+
   | None      | The same as "'s'".                                         |
   +-----------+------------------------------------------------------------+

The available integer presentation types are:

   +-----------+------------------------------------------------------------+
   | Type      | Meaning                                                    |
   |===========|============================================================|
   | "'b'"     | Binary format. Outputs the number in base 2.               |
   +-----------+------------------------------------------------------------+
   | "'c'"     | Character. Converts the integer to the corresponding       |
   |           | unicode character before printing.                         |
   +-----------+------------------------------------------------------------+
   | "'d'"     | Decimal Integer. Outputs the number in base 10.            |
   +-----------+------------------------------------------------------------+
   | "'o'"     | Octal format. Outputs the number in base 8.                |
   +-----------+------------------------------------------------------------+
   | "'x'"     | Hex format. Outputs the number in base 16, using lower-    |
   |           | case letters for the digits above 9.                       |
   +-----------+------------------------------------------------------------+
   | "'X'"     | Hex format. Outputs the number in base 16, using upper-    |
   |           | case letters for the digits above 9.                       |
   +-----------+------------------------------------------------------------+
   | "'n'"     | Number. This is the same as "'d'", except that it uses the |
   |           | current locale setting to insert the appropriate number    |
   |           | separator characters.                                      |
   +-----------+------------------------------------------------------------+
   | None      | The same as "'d'".                                         |
   +-----------+------------------------------------------------------------+

In addition to the above presentation types, integers can be formatted
with the floating point presentation types listed below (except "'n'"
and "None"). When doing so, "float()" is used to convert the integer
to a floating point number before formatting.

The available presentation types for "float" and "Decimal" values are:

   +-----------+------------------------------------------------------------+
   | Type      | Meaning                                                    |
   |===========|============================================================|
   | "'e'"     | Scientific notation. For a given precision "p", formats    |
   |           | the number in scientific notation with the letter ‘e’      |
   |           | separating the coefficient from the exponent. The          |
   |           | coefficient has one digit before and "p" digits after the  |
   |           | decimal point, for a total of "p + 1" significant digits.  |
   |           | With no precision given, uses a precision of "6" digits    |
   |           | after the decimal point for "float", and shows all         |
   |           | coefficient digits for "Decimal". If no digits follow the  |
   |           | decimal point, the decimal point is also removed unless    |
   |           | the "#" option is used.                                    |
   +-----------+------------------------------------------------------------+
   | "'E'"     | Scientific notation. Same as "'e'" except it uses an upper |
   |           | case ‘E’ as the separator character.                       |
   +-----------+------------------------------------------------------------+
   | "'f'"     | Fixed-point notation. For a given precision "p", formats   |
   |           | the number as a decimal number with exactly "p" digits     |
   |           | following the decimal point. With no precision given, uses |
   |           | a precision of "6" digits after the decimal point for      |
   |           | "float", and uses a precision large enough to show all     |
   |           | coefficient digits for "Decimal". If no digits follow the  |
   |           | decimal point, the decimal point is also removed unless    |
   |           | the "#" option is used.                                    |
   +-----------+------------------------------------------------------------+
   | "'F'"     | Fixed-point notation. Same as "'f'", but converts "nan" to |
   |           | "NAN" and "inf" to "INF".                                  |
   +-----------+------------------------------------------------------------+
   | "'g'"     | General format.  For a given precision "p >= 1", this      |
   |           | rounds the number to "p" significant digits and then       |
   |           | formats the result in either fixed-point format or in      |
   |           | scientific notation, depending on its magnitude. A         |
   |           | precision of "0" is treated as equivalent to a precision   |
   |           | of "1".  The precise rules are as follows: suppose that    |
   |           | the result formatted with presentation type "'e'" and      |
   |           | precision "p-1" would have exponent "exp".  Then, if "m <= |
   |           | exp < p", where "m" is -4 for floats and -6 for            |
   |           | "Decimals", the number is formatted with presentation type |
   |           | "'f'" and precision "p-1-exp".  Otherwise, the number is   |
   |           | formatted with presentation type "'e'" and precision       |
   |           | "p-1". In both cases insignificant trailing zeros are      |
   |           | removed from the significand, and the decimal point is     |
   |           | also removed if there are no remaining digits following    |
   |           | it, unless the "'#'" option is used.  With no precision    |
   |           | given, uses a precision of "6" significant digits for      |
   |           | "float". For "Decimal", the coefficient of the result is   |
   |           | formed from the coefficient digits of the value;           |
   |           | scientific notation is used for values smaller than "1e-6" |
   |           | in absolute value and values where the place value of the  |
   |           | least significant digit is larger than 1, and fixed-point  |
   |           | notation is used otherwise.  Positive and negative         |
   |           | infinity, positive and negative zero, and nans, are        |
   |           | formatted as "inf", "-inf", "0", "-0" and "nan"            |
   |           | respectively, regardless of the precision.                 |
   +-----------+------------------------------------------------------------+
   | "'G'"     | General format. Same as "'g'" except switches to "'E'" if  |
   |           | the number gets too large. The representations of infinity |
   |           | and NaN are uppercased, too.                               |
   +-----------+------------------------------------------------------------+
   | "'n'"     | Number. This is the same as "'g'", except that it uses the |
   |           | current locale setting to insert the appropriate number    |
   |           | separator characters.                                      |
   +-----------+------------------------------------------------------------+
   | "'%'"     | Percentage. Multiplies the number by 100 and displays in   |
   |           | fixed ("'f'") format, followed by a percent sign.          |
   +-----------+------------------------------------------------------------+
   | None      | For "float" this is the same as "'g'", except that when    |
   |           | fixed-point notation is used to format the result, it      |
   |           | always includes at least one digit past the decimal point. |
   |           | The precision used is as large as needed to represent the  |
   |           | given value faithfully.  For "Decimal", this is the same   |
   |           | as either "'g'" or "'G'" depending on the value of         |
   |           | "context.capitals" for the current decimal context.  The   |
   |           | overall effect is to match the output of "str()" as        |
   |           | altered by the other format modifiers.                     |
   +-----------+------------------------------------------------------------+


Format examples
===============

This section contains examples of the "str.format()" syntax and
comparison with the old "%"-formatting.

In most of the cases the syntax is similar to the old "%"-formatting,
with the addition of the "{}" and with ":" used instead of "%". For
example, "'%03.2f'" can be translated to "'{:03.2f}'".

The new format syntax also supports new and different options, shown
in the following examples.

Accessing arguments by position:

   >>> '{0}, {1}, {2}'.format('a', 'b', 'c')
   'a, b, c'
   >>> '{}, {}, {}'.format('a', 'b', 'c')  # 3.1+ only
   'a, b, c'
   >>> '{2}, {1}, {0}'.format('a', 'b', 'c')
   'c, b, a'
   >>> '{2}, {1}, {0}'.format(*'abc')      # unpacking argument sequence
   'c, b, a'
   >>> '{0}{1}{0}'.format('abra', 'cad')   # arguments' indices can be repeated
   'abracadabra'

Accessing arguments by name:

   >>> 'Coordinates: {latitude}, {longitude}'.format(latitude='37.24N', longitude='-115.81W')
   'Coordinates: 37.24N, -115.81W'
   >>> coord = {'latitude': '37.24N', 'longitude': '-115.81W'}
   >>> 'Coordinates: {latitude}, {longitude}'.format(**coord)
   'Coordinates: 37.24N, -115.81W'

Accessing arguments’ attributes:

   >>> c = 3-5j
   >>> ('The complex number {0} is formed from the real part {0.real} '
   ...  'and the imaginary part {0.imag}.').format(c)
   'The complex number (3-5j) is formed from the real part 3.0 and the imaginary part -5.0.'
   >>> class Point:
   ...     def __init__(self, x, y):
   ...         self.x, self.y = x, y
   ...     def __str__(self):
   ...         return 'Point({self.x}, {self.y})'.format(self=self)
   ...
   >>> str(Point(4, 2))
   'Point(4, 2)'

Accessing arguments’ items:

   >>> coord = (3, 5)
   >>> 'X: {0[0]};  Y: {0[1]}'.format(coord)
   'X: 3;  Y: 5'

Replacing "%s" and "%r":

   >>> "repr() shows quotes: {!r}; str() doesn't: {!s}".format('test1', 'test2')
   "repr() shows quotes: 'test1'; str() doesn't: test2"

Aligning the text and specifying a width:

   >>> '{:<30}'.format('left aligned')
   'left aligned                  '
   >>> '{:>30}'.format('right aligned')
   '                 right aligned'
   >>> '{:^30}'.format('centered')
   '           centered           '
   >>> '{:*^30}'.format('centered')  # use '*' as a fill char
   '***********centered***********'

Replacing "%+f", "%-f", and "% f" and specifying a sign:

   >>> '{:+f}; {:+f}'.format(3.14, -3.14)  # show it always
   '+3.140000; -3.140000'
   >>> '{: f}; {: f}'.format(3.14, -3.14)  # show a space for positive numbers
   ' 3.140000; -3.140000'
   >>> '{:-f}; {:-f}'.format(3.14, -3.14)  # show only the minus -- same as '{:f}; {:f}'
   '3.140000; -3.140000'

Replacing "%x" and "%o" and converting the value to different bases:

   >>> # format also supports binary numbers
   >>> "int: {0:d};  hex: {0:x};  oct: {0:o};  bin: {0:b}".format(42)
   'int: 42;  hex: 2a;  oct: 52;  bin: 101010'
   >>> # with 0x, 0o, or 0b as prefix:
   >>> "int: {0:d};  hex: {0:#x};  oct: {0:#o};  bin: {0:#b}".format(42)
   'int: 42;  hex: 0x2a;  oct: 0o52;  bin: 0b101010'

Using the comma as a thousands separator:

   >>> '{:,}'.format(1234567890)
   '1,234,567,890'

Expressing a percentage:

   >>> points = 19
   >>> total = 22
   >>> 'Correct answers: {:.2%}'.format(points/total)
   'Correct answers: 86.36%'

Using type-specific formatting:

   >>> import datetime
   >>> d = datetime.datetime(2010, 7, 4, 12, 15, 58)
   >>> '{:%Y-%m-%d %H:%M:%S}'.format(d)
   '2010-07-04 12:15:58'

Nesting arguments and more complex examples:

   >>> for align, text in zip('<^>', ['left', 'center', 'right']):
   ...     '{0:{fill}{align}16}'.format(text, fill=align, align=align)
   ...
   'left<<<<<<<<<<<<'
   '^^^^^center^^^^^'
   '>>>>>>>>>>>right'
   >>>
   >>> octets = [192, 168, 0, 1]
   >>> '{:02X}{:02X}{:02X}{:02X}'.format(*octets)
   'C0A80001'
   >>> int(_, 16)
   3232235521
   >>>
   >>> width = 5
   >>> for num in range(5,12): 
   ...     for base in 'dXob':
   ...         print('{0:{width}{base}}'.format(num, base=base, width=width), end=' ')
   ...     print()
   ...
       5     5     5   101
       6     6     6   110
       7     7     7   111
       8     8    10  1000
       9     9    11  1001
      10     A    12  1010
      11     B    13  1011
u|Function definitions
********************

A function definition defines a user-defined function object (see
section The standard type hierarchy):

   funcdef                   ::= [decorators] "def" funcname "(" [parameter_list] ")"
               ["->" expression] ":" suite
   decorators                ::= decorator+
   decorator                 ::= "@" dotted_name ["(" [argument_list [","]] ")"] NEWLINE
   dotted_name               ::= identifier ("." identifier)*
   parameter_list            ::= defparameter ("," defparameter)* "," "/" ["," [parameter_list_no_posonly]]
                        | parameter_list_no_posonly
   parameter_list_no_posonly ::= defparameter ("," defparameter)* ["," [parameter_list_starargs]]
                                 | parameter_list_starargs
   parameter_list_starargs   ::= "*" [parameter] ("," defparameter)* ["," ["**" parameter [","]]]
                               | "**" parameter [","]
   parameter                 ::= identifier [":" expression]
   defparameter              ::= parameter ["=" expression]
   funcname                  ::= identifier

A function definition is an executable statement.  Its execution binds
the function name in the current local namespace to a function object
(a wrapper around the executable code for the function).  This
function object contains a reference to the current global namespace
as the global namespace to be used when the function is called.

The function definition does not execute the function body; this gets
executed only when the function is called. [2]

A function definition may be wrapped by one or more *decorator*
expressions. Decorator expressions are evaluated when the function is
defined, in the scope that contains the function definition.  The
result must be a callable, which is invoked with the function object
as the only argument. The returned value is bound to the function name
instead of the function object.  Multiple decorators are applied in
nested fashion. For example, the following code

   @f1(arg)
   @f2
   def func(): pass

is roughly equivalent to

   def func(): pass
   func = f1(arg)(f2(func))

except that the original function is not temporarily bound to the name
"func".

When one or more *parameters* have the form *parameter* "="
*expression*, the function is said to have “default parameter values.”
For a parameter with a default value, the corresponding *argument* may
be omitted from a call, in which case the parameter’s default value is
substituted.  If a parameter has a default value, all following
parameters up until the “"*"” must also have a default value — this is
a syntactic restriction that is not expressed by the grammar.

**Default parameter values are evaluated from left to right when the
function definition is executed.** This means that the expression is
evaluated once, when the function is defined, and that the same “pre-
computed” value is used for each call.  This is especially important
to understand when a default parameter is a mutable object, such as a
list or a dictionary: if the function modifies the object (e.g. by
appending an item to a list), the default value is in effect modified.
This is generally not what was intended.  A way around this is to use
"None" as the default, and explicitly test for it in the body of the
function, e.g.:

   def whats_on_the_telly(penguin=None):
       if penguin is None:
           penguin = []
       penguin.append("property of the zoo")
       return penguin

Function call semantics are described in more detail in section Calls.
A function call always assigns values to all parameters mentioned in
the parameter list, either from positional arguments, from keyword
arguments, or from default values.  If the form “"*identifier"” is
present, it is initialized to a tuple receiving any excess positional
parameters, defaulting to the empty tuple. If the form
“"**identifier"” is present, it is initialized to a new ordered
mapping receiving any excess keyword arguments, defaulting to a new
empty mapping of the same type.  Parameters after “"*"” or
“"*identifier"” are keyword-only parameters and may only be passed by
keyword arguments.  Parameters before “"/"” are positional-only
parameters and may only be passed by positional arguments.

Changed in version 3.8: The "/" function parameter syntax may be used
to indicate positional-only parameters. See **PEP 570** for details.

Parameters may have an *annotation* of the form “": expression"”
following the parameter name.  Any parameter may have an annotation,
even those of the form "*identifier" or "**identifier".  Functions may
have “return” annotation of the form “"-> expression"” after the
parameter list.  These annotations can be any valid Python expression.
The presence of annotations does not change the semantics of a
function.  The annotation values are available as values of a
dictionary keyed by the parameters’ names in the "__annotations__"
attribute of the function object.  If the "annotations" import from
"__future__" is used, annotations are preserved as strings at runtime
which enables postponed evaluation.  Otherwise, they are evaluated
when the function definition is executed.  In this case annotations
may be evaluated in a different order than they appear in the source
code.

It is also possible to create anonymous functions (functions not bound
to a name), for immediate use in expressions.  This uses lambda
expressions, described in section Lambdas.  Note that the lambda
expression is merely a shorthand for a simplified function definition;
a function defined in a “"def"” statement can be passed around or
assigned to another name just like a function defined by a lambda
expression.  The “"def"” form is actually more powerful since it
allows the execution of multiple statements and annotations.

**Programmer’s note:** Functions are first-class objects.  A “"def"”
statement executed inside a function definition defines a local
function that can be returned or passed around.  Free variables used
in the nested function can access the local variables of the function
containing the def.  See section Naming and binding for details.

See also:

  **PEP 3107** - Function Annotations
     The original specification for function annotations.

  **PEP 484** - Type Hints
     Definition of a standard meaning for annotations: type hints.

  **PEP 526** - Syntax for Variable Annotations
     Ability to type hint variable declarations, including class
     variables and instance variables

  **PEP 563** - Postponed Evaluation of Annotations
     Support for forward references within annotations by preserving
     annotations in a string form at runtime instead of eager
     evaluation.
u�The "global" statement
**********************

   global_stmt ::= "global" identifier ("," identifier)*

The "global" statement is a declaration which holds for the entire
current code block.  It means that the listed identifiers are to be
interpreted as globals.  It would be impossible to assign to a global
variable without "global", although free variables may refer to
globals without being declared global.

Names listed in a "global" statement must not be used in the same code
block textually preceding that "global" statement.

Names listed in a "global" statement must not be defined as formal
parameters or in a "for" loop control target, "class" definition,
function definition, "import" statement, or variable annotation.

**CPython implementation detail:** The current implementation does not
enforce some of these restrictions, but programs should not abuse this
freedom, as future implementations may enforce them or silently change
the meaning of the program.

**Programmer’s note:** "global" is a directive to the parser.  It
applies only to code parsed at the same time as the "global"
statement. In particular, a "global" statement contained in a string
or code object supplied to the built-in "exec()" function does not
affect the code block *containing* the function call, and code
contained in such a string is unaffected by "global" statements in the
code containing the function call.  The same applies to the "eval()"
and "compile()" functions.
u�Reserved classes of identifiers
*******************************

Certain classes of identifiers (besides keywords) have special
meanings.  These classes are identified by the patterns of leading and
trailing underscore characters:

"_*"
   Not imported by "from module import *".  The special identifier "_"
   is used in the interactive interpreter to store the result of the
   last evaluation; it is stored in the "builtins" module.  When not
   in interactive mode, "_" has no special meaning and is not defined.
   See section The import statement.

   Note:

     The name "_" is often used in conjunction with
     internationalization; refer to the documentation for the
     "gettext" module for more information on this convention.

"__*__"
   System-defined names, informally known as “dunder” names. These
   names are defined by the interpreter and its implementation
   (including the standard library). Current system names are
   discussed in the Special method names section and elsewhere. More
   will likely be defined in future versions of Python.  *Any* use of
   "__*__" names, in any context, that does not follow explicitly
   documented use, is subject to breakage without warning.

"__*"
   Class-private names.  Names in this category, when used within the
   context of a class definition, are re-written to use a mangled form
   to help avoid name clashes between “private” attributes of base and
   derived classes. See section Identifiers (Names).
umIdentifiers and keywords
************************

Identifiers (also referred to as *names*) are described by the
following lexical definitions.

The syntax of identifiers in Python is based on the Unicode standard
annex UAX-31, with elaboration and changes as defined below; see also
**PEP 3131** for further details.

Within the ASCII range (U+0001..U+007F), the valid characters for
identifiers are the same as in Python 2.x: the uppercase and lowercase
letters "A" through "Z", the underscore "_" and, except for the first
character, the digits "0" through "9".

Python 3.0 introduces additional characters from outside the ASCII
range (see **PEP 3131**).  For these characters, the classification
uses the version of the Unicode Character Database as included in the
"unicodedata" module.

Identifiers are unlimited in length.  Case is significant.

   identifier   ::= xid_start xid_continue*
   id_start     ::= <all characters in general categories Lu, Ll, Lt, Lm, Lo, Nl, the underscore, and characters with the Other_ID_Start property>
   id_continue  ::= <all characters in id_start, plus characters in the categories Mn, Mc, Nd, Pc and others with the Other_ID_Continue property>
   xid_start    ::= <all characters in id_start whose NFKC normalization is in "id_start xid_continue*">
   xid_continue ::= <all characters in id_continue whose NFKC normalization is in "id_continue*">

The Unicode category codes mentioned above stand for:

* *Lu* - uppercase letters

* *Ll* - lowercase letters

* *Lt* - titlecase letters

* *Lm* - modifier letters

* *Lo* - other letters

* *Nl* - letter numbers

* *Mn* - nonspacing marks

* *Mc* - spacing combining marks

* *Nd* - decimal numbers

* *Pc* - connector punctuations

* *Other_ID_Start* - explicit list of characters in PropList.txt to
  support backwards compatibility

* *Other_ID_Continue* - likewise

All identifiers are converted into the normal form NFKC while parsing;
comparison of identifiers is based on NFKC.

A non-normative HTML file listing all valid identifier characters for
Unicode 4.1 can be found at
https://www.unicode.org/Public/13.0.0/ucd/DerivedCoreProperties.txt


Keywords
========

The following identifiers are used as reserved words, or *keywords* of
the language, and cannot be used as ordinary identifiers.  They must
be spelled exactly as written here:

   False      await      else       import     pass
   None       break      except     in         raise
   True       class      finally    is         return
   and        continue   for        lambda     try
   as         def        from       nonlocal   while
   assert     del        global     not        with
   async      elif       if         or         yield


Reserved classes of identifiers
===============================

Certain classes of identifiers (besides keywords) have special
meanings.  These classes are identified by the patterns of leading and
trailing underscore characters:

"_*"
   Not imported by "from module import *".  The special identifier "_"
   is used in the interactive interpreter to store the result of the
   last evaluation; it is stored in the "builtins" module.  When not
   in interactive mode, "_" has no special meaning and is not defined.
   See section The import statement.

   Note:

     The name "_" is often used in conjunction with
     internationalization; refer to the documentation for the
     "gettext" module for more information on this convention.

"__*__"
   System-defined names, informally known as “dunder” names. These
   names are defined by the interpreter and its implementation
   (including the standard library). Current system names are
   discussed in the Special method names section and elsewhere. More
   will likely be defined in future versions of Python.  *Any* use of
   "__*__" names, in any context, that does not follow explicitly
   documented use, is subject to breakage without warning.

"__*"
   Class-private names.  Names in this category, when used within the
   context of a class definition, are re-written to use a mangled form
   to help avoid name clashes between “private” attributes of base and
   derived classes. See section Identifiers (Names).
a5Imaginary literals
******************

Imaginary literals are described by the following lexical definitions:

   imagnumber ::= (floatnumber | digitpart) ("j" | "J")

An imaginary literal yields a complex number with a real part of 0.0.
Complex numbers are represented as a pair of floating point numbers
and have the same restrictions on their range.  To create a complex
number with a nonzero real part, add a floating point number to it,
e.g., "(3+4j)".  Some examples of imaginary literals:

   3.14j   10.j    10j     .001j   1e100j   3.14e-10j   3.14_15_93j
u8"The "import" statement
**********************

   import_stmt     ::= "import" module ["as" identifier] ("," module ["as" identifier])*
                   | "from" relative_module "import" identifier ["as" identifier]
                   ("," identifier ["as" identifier])*
                   | "from" relative_module "import" "(" identifier ["as" identifier]
                   ("," identifier ["as" identifier])* [","] ")"
                   | "from" module "import" "*"
   module          ::= (identifier ".")* identifier
   relative_module ::= "."* module | "."+

The basic import statement (no "from" clause) is executed in two
steps:

1. find a module, loading and initializing it if necessary

2. define a name or names in the local namespace for the scope where
   the "import" statement occurs.

When the statement contains multiple clauses (separated by commas) the
two steps are carried out separately for each clause, just as though
the clauses had been separated out into individual import statements.

The details of the first step, finding and loading modules are
described in greater detail in the section on the import system, which
also describes the various types of packages and modules that can be
imported, as well as all the hooks that can be used to customize the
import system. Note that failures in this step may indicate either
that the module could not be located, *or* that an error occurred
while initializing the module, which includes execution of the
module’s code.

If the requested module is retrieved successfully, it will be made
available in the local namespace in one of three ways:

* If the module name is followed by "as", then the name following "as"
  is bound directly to the imported module.

* If no other name is specified, and the module being imported is a
  top level module, the module’s name is bound in the local namespace
  as a reference to the imported module

* If the module being imported is *not* a top level module, then the
  name of the top level package that contains the module is bound in
  the local namespace as a reference to the top level package. The
  imported module must be accessed using its full qualified name
  rather than directly

The "from" form uses a slightly more complex process:

1. find the module specified in the "from" clause, loading and
   initializing it if necessary;

2. for each of the identifiers specified in the "import" clauses:

   1. check if the imported module has an attribute by that name

   2. if not, attempt to import a submodule with that name and then
      check the imported module again for that attribute

   3. if the attribute is not found, "ImportError" is raised.

   4. otherwise, a reference to that value is stored in the local
      namespace, using the name in the "as" clause if it is present,
      otherwise using the attribute name

Examples:

   import foo                 # foo imported and bound locally
   import foo.bar.baz         # foo.bar.baz imported, foo bound locally
   import foo.bar.baz as fbb  # foo.bar.baz imported and bound as fbb
   from foo.bar import baz    # foo.bar.baz imported and bound as baz
   from foo import attr       # foo imported and foo.attr bound as attr

If the list of identifiers is replaced by a star ("'*'"), all public
names defined in the module are bound in the local namespace for the
scope where the "import" statement occurs.

The *public names* defined by a module are determined by checking the
module’s namespace for a variable named "__all__"; if defined, it must
be a sequence of strings which are names defined or imported by that
module.  The names given in "__all__" are all considered public and
are required to exist.  If "__all__" is not defined, the set of public
names includes all names found in the module’s namespace which do not
begin with an underscore character ("'_'").  "__all__" should contain
the entire public API. It is intended to avoid accidentally exporting
items that are not part of the API (such as library modules which were
imported and used within the module).

The wild card form of import — "from module import *" — is only
allowed at the module level.  Attempting to use it in class or
function definitions will raise a "SyntaxError".

When specifying what module to import you do not have to specify the
absolute name of the module. When a module or package is contained
within another package it is possible to make a relative import within
the same top package without having to mention the package name. By
using leading dots in the specified module or package after "from" you
can specify how high to traverse up the current package hierarchy
without specifying exact names. One leading dot means the current
package where the module making the import exists. Two dots means up
one package level. Three dots is up two levels, etc. So if you execute
"from . import mod" from a module in the "pkg" package then you will
end up importing "pkg.mod". If you execute "from ..subpkg2 import mod"
from within "pkg.subpkg1" you will import "pkg.subpkg2.mod". The
specification for relative imports is contained in the Package
Relative Imports section.

"importlib.import_module()" is provided to support applications that
determine dynamically the modules to be loaded.

Raises an auditing event "import" with arguments "module", "filename",
"sys.path", "sys.meta_path", "sys.path_hooks".


Future statements
=================

A *future statement* is a directive to the compiler that a particular
module should be compiled using syntax or semantics that will be
available in a specified future release of Python where the feature
becomes standard.

The future statement is intended to ease migration to future versions
of Python that introduce incompatible changes to the language.  It
allows use of the new features on a per-module basis before the
release in which the feature becomes standard.

   future_stmt ::= "from" "__future__" "import" feature ["as" identifier]
                   ("," feature ["as" identifier])*
                   | "from" "__future__" "import" "(" feature ["as" identifier]
                   ("," feature ["as" identifier])* [","] ")"
   feature     ::= identifier

A future statement must appear near the top of the module.  The only
lines that can appear before a future statement are:

* the module docstring (if any),

* comments,

* blank lines, and

* other future statements.

The only feature that requires using the future statement is
"annotations" (see **PEP 563**).

All historical features enabled by the future statement are still
recognized by Python 3.  The list includes "absolute_import",
"division", "generators", "generator_stop", "unicode_literals",
"print_function", "nested_scopes" and "with_statement".  They are all
redundant because they are always enabled, and only kept for backwards
compatibility.

A future statement is recognized and treated specially at compile
time: Changes to the semantics of core constructs are often
implemented by generating different code.  It may even be the case
that a new feature introduces new incompatible syntax (such as a new
reserved word), in which case the compiler may need to parse the
module differently.  Such decisions cannot be pushed off until
runtime.

For any given release, the compiler knows which feature names have
been defined, and raises a compile-time error if a future statement
contains a feature not known to it.

The direct runtime semantics are the same as for any import statement:
there is a standard module "__future__", described later, and it will
be imported in the usual way at the time the future statement is
executed.

The interesting runtime semantics depend on the specific feature
enabled by the future statement.

Note that there is nothing special about the statement:

   import __future__ [as name]

That is not a future statement; it’s an ordinary import statement with
no special semantics or syntax restrictions.

Code compiled by calls to the built-in functions "exec()" and
"compile()" that occur in a module "M" containing a future statement
will, by default, use the new syntax or semantics associated with the
future statement.  This can be controlled by optional arguments to
"compile()" — see the documentation of that function for details.

A future statement typed at an interactive interpreter prompt will
take effect for the rest of the interpreter session.  If an
interpreter is started with the "-i" option, is passed a script name
to execute, and the script includes a future statement, it will be in
effect in the interactive session started after the script is
executed.

See also:

  **PEP 236** - Back to the __future__
     The original proposal for the __future__ mechanism.
aMembership test operations
**************************

The operators "in" and "not in" test for membership.  "x in s"
evaluates to "True" if *x* is a member of *s*, and "False" otherwise.
"x not in s" returns the negation of "x in s".  All built-in sequences
and set types support this as well as dictionary, for which "in" tests
whether the dictionary has a given key. For container types such as
list, tuple, set, frozenset, dict, or collections.deque, the
expression "x in y" is equivalent to "any(x is e or x == e for e in
y)".

For the string and bytes types, "x in y" is "True" if and only if *x*
is a substring of *y*.  An equivalent test is "y.find(x) != -1".
Empty strings are always considered to be a substring of any other
string, so """ in "abc"" will return "True".

For user-defined classes which define the "__contains__()" method, "x
in y" returns "True" if "y.__contains__(x)" returns a true value, and
"False" otherwise.

For user-defined classes which do not define "__contains__()" but do
define "__iter__()", "x in y" is "True" if some value "z", for which
the expression "x is z or x == z" is true, is produced while iterating
over "y". If an exception is raised during the iteration, it is as if
"in" raised that exception.

Lastly, the old-style iteration protocol is tried: if a class defines
"__getitem__()", "x in y" is "True" if and only if there is a non-
negative integer index *i* such that "x is y[i] or x == y[i]", and no
lower integer index raises the "IndexError" exception.  (If any other
exception is raised, it is as if "in" raised that exception).

The operator "not in" is defined to have the inverse truth value of
"in".
aVInteger literals
****************

Integer literals are described by the following lexical definitions:

   integer      ::= decinteger | bininteger | octinteger | hexinteger
   decinteger   ::= nonzerodigit (["_"] digit)* | "0"+ (["_"] "0")*
   bininteger   ::= "0" ("b" | "B") (["_"] bindigit)+
   octinteger   ::= "0" ("o" | "O") (["_"] octdigit)+
   hexinteger   ::= "0" ("x" | "X") (["_"] hexdigit)+
   nonzerodigit ::= "1"..."9"
   digit        ::= "0"..."9"
   bindigit     ::= "0" | "1"
   octdigit     ::= "0"..."7"
   hexdigit     ::= digit | "a"..."f" | "A"..."F"

There is no limit for the length of integer literals apart from what
can be stored in available memory.

Underscores are ignored for determining the numeric value of the
literal.  They can be used to group digits for enhanced readability.
One underscore can occur between digits, and after base specifiers
like "0x".

Note that leading zeros in a non-zero decimal number are not allowed.
This is for disambiguation with C-style octal literals, which Python
used before version 3.0.

Some examples of integer literals:

   7     2147483647                        0o177    0b100110111
   3     79228162514264337593543950336     0o377    0xdeadbeef
         100_000_000_000                   0b_1110_0101

Changed in version 3.6: Underscores are now allowed for grouping
purposes in literals.
a^Lambdas
*******

   lambda_expr        ::= "lambda" [parameter_list] ":" expression
   lambda_expr_nocond ::= "lambda" [parameter_list] ":" expression_nocond

Lambda expressions (sometimes called lambda forms) are used to create
anonymous functions. The expression "lambda parameters: expression"
yields a function object.  The unnamed object behaves like a function
object defined with:

   def <lambda>(parameters):
       return expression

See section Function definitions for the syntax of parameter lists.
Note that functions created with lambda expressions cannot contain
statements or annotations.
a/List displays
*************

A list display is a possibly empty series of expressions enclosed in
square brackets:

   list_display ::= "[" [starred_list | comprehension] "]"

A list display yields a new list object, the contents being specified
by either a list of expressions or a comprehension.  When a comma-
separated list of expressions is supplied, its elements are evaluated
from left to right and placed into the list object in that order.
When a comprehension is supplied, the list is constructed from the
elements resulting from the comprehension.
u�Naming and binding
******************


Binding of names
================

*Names* refer to objects.  Names are introduced by name binding
operations.

The following constructs bind names: formal parameters to functions,
"import" statements, class and function definitions (these bind the
class or function name in the defining block), and targets that are
identifiers if occurring in an assignment, "for" loop header, or after
"as" in a "with" statement or "except" clause. The "import" statement
of the form "from ... import *" binds all names defined in the
imported module, except those beginning with an underscore.  This form
may only be used at the module level.

A target occurring in a "del" statement is also considered bound for
this purpose (though the actual semantics are to unbind the name).

Each assignment or import statement occurs within a block defined by a
class or function definition or at the module level (the top-level
code block).

If a name is bound in a block, it is a local variable of that block,
unless declared as "nonlocal" or "global".  If a name is bound at the
module level, it is a global variable.  (The variables of the module
code block are local and global.)  If a variable is used in a code
block but not defined there, it is a *free variable*.

Each occurrence of a name in the program text refers to the *binding*
of that name established by the following name resolution rules.


Resolution of names
===================

A *scope* defines the visibility of a name within a block.  If a local
variable is defined in a block, its scope includes that block.  If the
definition occurs in a function block, the scope extends to any blocks
contained within the defining one, unless a contained block introduces
a different binding for the name.

When a name is used in a code block, it is resolved using the nearest
enclosing scope.  The set of all such scopes visible to a code block
is called the block’s *environment*.

When a name is not found at all, a "NameError" exception is raised. If
the current scope is a function scope, and the name refers to a local
variable that has not yet been bound to a value at the point where the
name is used, an "UnboundLocalError" exception is raised.
"UnboundLocalError" is a subclass of "NameError".

If a name binding operation occurs anywhere within a code block, all
uses of the name within the block are treated as references to the
current block.  This can lead to errors when a name is used within a
block before it is bound.  This rule is subtle.  Python lacks
declarations and allows name binding operations to occur anywhere
within a code block.  The local variables of a code block can be
determined by scanning the entire text of the block for name binding
operations.

If the "global" statement occurs within a block, all uses of the name
specified in the statement refer to the binding of that name in the
top-level namespace.  Names are resolved in the top-level namespace by
searching the global namespace, i.e. the namespace of the module
containing the code block, and the builtins namespace, the namespace
of the module "builtins".  The global namespace is searched first.  If
the name is not found there, the builtins namespace is searched.  The
"global" statement must precede all uses of the name.

The "global" statement has the same scope as a name binding operation
in the same block.  If the nearest enclosing scope for a free variable
contains a global statement, the free variable is treated as a global.

The "nonlocal" statement causes corresponding names to refer to
previously bound variables in the nearest enclosing function scope.
"SyntaxError" is raised at compile time if the given name does not
exist in any enclosing function scope.

The namespace for a module is automatically created the first time a
module is imported.  The main module for a script is always called
"__main__".

Class definition blocks and arguments to "exec()" and "eval()" are
special in the context of name resolution. A class definition is an
executable statement that may use and define names. These references
follow the normal rules for name resolution with an exception that
unbound local variables are looked up in the global namespace. The
namespace of the class definition becomes the attribute dictionary of
the class. The scope of names defined in a class block is limited to
the class block; it does not extend to the code blocks of methods –
this includes comprehensions and generator expressions since they are
implemented using a function scope.  This means that the following
will fail:

   class A:
       a = 42
       b = list(a + i for i in range(10))


Builtins and restricted execution
=================================

**CPython implementation detail:** Users should not touch
"__builtins__"; it is strictly an implementation detail.  Users
wanting to override values in the builtins namespace should "import"
the "builtins" module and modify its attributes appropriately.

The builtins namespace associated with the execution of a code block
is actually found by looking up the name "__builtins__" in its global
namespace; this should be a dictionary or a module (in the latter case
the module’s dictionary is used).  By default, when in the "__main__"
module, "__builtins__" is the built-in module "builtins"; when in any
other module, "__builtins__" is an alias for the dictionary of the
"builtins" module itself.


Interaction with dynamic features
=================================

Name resolution of free variables occurs at runtime, not at compile
time. This means that the following code will print 42:

   i = 10
   def f():
       print(i)
   i = 42
   f()

The "eval()" and "exec()" functions do not have access to the full
environment for resolving names.  Names may be resolved in the local
and global namespaces of the caller.  Free variables are not resolved
in the nearest enclosing namespace, but in the global namespace.  [1]
The "exec()" and "eval()" functions have optional arguments to
override the global and local namespace.  If only one namespace is
specified, it is used for both.
a�The "nonlocal" statement
************************

   nonlocal_stmt ::= "nonlocal" identifier ("," identifier)*

The "nonlocal" statement causes the listed identifiers to refer to
previously bound variables in the nearest enclosing scope excluding
globals. This is important because the default behavior for binding is
to search the local namespace first.  The statement allows
encapsulated code to rebind variables outside of the local scope
besides the global (module) scope.

Names listed in a "nonlocal" statement, unlike those listed in a
"global" statement, must refer to pre-existing bindings in an
enclosing scope (the scope in which a new binding should be created
cannot be determined unambiguously).

Names listed in a "nonlocal" statement must not collide with pre-
existing bindings in the local scope.

See also:

  **PEP 3104** - Access to Names in Outer Scopes
     The specification for the "nonlocal" statement.
u�Numeric literals
****************

There are three types of numeric literals: integers, floating point
numbers, and imaginary numbers.  There are no complex literals
(complex numbers can be formed by adding a real number and an
imaginary number).

Note that numeric literals do not include a sign; a phrase like "-1"
is actually an expression composed of the unary operator ‘"-"’ and the
literal "1".
uEmulating numeric types
***********************

The following methods can be defined to emulate numeric objects.
Methods corresponding to operations that are not supported by the
particular kind of number implemented (e.g., bitwise operations for
non-integral numbers) should be left undefined.

object.__add__(self, other)
object.__sub__(self, other)
object.__mul__(self, other)
object.__matmul__(self, other)
object.__truediv__(self, other)
object.__floordiv__(self, other)
object.__mod__(self, other)
object.__divmod__(self, other)
object.__pow__(self, other[, modulo])
object.__lshift__(self, other)
object.__rshift__(self, other)
object.__and__(self, other)
object.__xor__(self, other)
object.__or__(self, other)

   These methods are called to implement the binary arithmetic
   operations ("+", "-", "*", "@", "/", "//", "%", "divmod()",
   "pow()", "**", "<<", ">>", "&", "^", "|").  For instance, to
   evaluate the expression "x + y", where *x* is an instance of a
   class that has an "__add__()" method, "x.__add__(y)" is called.
   The "__divmod__()" method should be the equivalent to using
   "__floordiv__()" and "__mod__()"; it should not be related to
   "__truediv__()".  Note that "__pow__()" should be defined to accept
   an optional third argument if the ternary version of the built-in
   "pow()" function is to be supported.

   If one of those methods does not support the operation with the
   supplied arguments, it should return "NotImplemented".

object.__radd__(self, other)
object.__rsub__(self, other)
object.__rmul__(self, other)
object.__rmatmul__(self, other)
object.__rtruediv__(self, other)
object.__rfloordiv__(self, other)
object.__rmod__(self, other)
object.__rdivmod__(self, other)
object.__rpow__(self, other[, modulo])
object.__rlshift__(self, other)
object.__rrshift__(self, other)
object.__rand__(self, other)
object.__rxor__(self, other)
object.__ror__(self, other)

   These methods are called to implement the binary arithmetic
   operations ("+", "-", "*", "@", "/", "//", "%", "divmod()",
   "pow()", "**", "<<", ">>", "&", "^", "|") with reflected (swapped)
   operands.  These functions are only called if the left operand does
   not support the corresponding operation [3] and the operands are of
   different types. [4] For instance, to evaluate the expression "x -
   y", where *y* is an instance of a class that has an "__rsub__()"
   method, "y.__rsub__(x)" is called if "x.__sub__(y)" returns
   *NotImplemented*.

   Note that ternary "pow()" will not try calling "__rpow__()" (the
   coercion rules would become too complicated).

   Note:

     If the right operand’s type is a subclass of the left operand’s
     type and that subclass provides a different implementation of the
     reflected method for the operation, this method will be called
     before the left operand’s non-reflected method. This behavior
     allows subclasses to override their ancestors’ operations.

object.__iadd__(self, other)
object.__isub__(self, other)
object.__imul__(self, other)
object.__imatmul__(self, other)
object.__itruediv__(self, other)
object.__ifloordiv__(self, other)
object.__imod__(self, other)
object.__ipow__(self, other[, modulo])
object.__ilshift__(self, other)
object.__irshift__(self, other)
object.__iand__(self, other)
object.__ixor__(self, other)
object.__ior__(self, other)

   These methods are called to implement the augmented arithmetic
   assignments ("+=", "-=", "*=", "@=", "/=", "//=", "%=", "**=",
   "<<=", ">>=", "&=", "^=", "|=").  These methods should attempt to
   do the operation in-place (modifying *self*) and return the result
   (which could be, but does not have to be, *self*).  If a specific
   method is not defined, the augmented assignment falls back to the
   normal methods.  For instance, if *x* is an instance of a class
   with an "__iadd__()" method, "x += y" is equivalent to "x =
   x.__iadd__(y)" . Otherwise, "x.__add__(y)" and "y.__radd__(x)" are
   considered, as with the evaluation of "x + y". In certain
   situations, augmented assignment can result in unexpected errors
   (see Why does a_tuple[i] += [‘item’] raise an exception when the
   addition works?), but this behavior is in fact part of the data
   model.

   Note:

     Due to a bug in the dispatching mechanism for "**=", a class that
     defines "__ipow__()" but returns "NotImplemented" would fail to
     fall back to "x.__pow__(y)" and "y.__rpow__(x)". This bug is
     fixed in Python 3.10.

object.__neg__(self)
object.__pos__(self)
object.__abs__(self)
object.__invert__(self)

   Called to implement the unary arithmetic operations ("-", "+",
   "abs()" and "~").

object.__complex__(self)
object.__int__(self)
object.__float__(self)

   Called to implement the built-in functions "complex()", "int()" and
   "float()".  Should return a value of the appropriate type.

object.__index__(self)

   Called to implement "operator.index()", and whenever Python needs
   to losslessly convert the numeric object to an integer object (such
   as in slicing, or in the built-in "bin()", "hex()" and "oct()"
   functions). Presence of this method indicates that the numeric
   object is an integer type.  Must return an integer.

   If "__int__()", "__float__()" and "__complex__()" are not defined
   then corresponding built-in functions "int()", "float()" and
   "complex()" fall back to "__index__()".

object.__round__(self[, ndigits])
object.__trunc__(self)
object.__floor__(self)
object.__ceil__(self)

   Called to implement the built-in function "round()" and "math"
   functions "trunc()", "floor()" and "ceil()". Unless *ndigits* is
   passed to "__round__()" all these methods should return the value
   of the object truncated to an "Integral" (typically an "int").

   The built-in function "int()" falls back to "__trunc__()" if
   neither "__int__()" nor "__index__()" is defined.
uObjects, values and types
*************************

*Objects* are Python’s abstraction for data.  All data in a Python
program is represented by objects or by relations between objects. (In
a sense, and in conformance to Von Neumann’s model of a “stored
program computer”, code is also represented by objects.)

Every object has an identity, a type and a value.  An object’s
*identity* never changes once it has been created; you may think of it
as the object’s address in memory.  The ‘"is"’ operator compares the
identity of two objects; the "id()" function returns an integer
representing its identity.

**CPython implementation detail:** For CPython, "id(x)" is the memory
address where "x" is stored.

An object’s type determines the operations that the object supports
(e.g., “does it have a length?”) and also defines the possible values
for objects of that type.  The "type()" function returns an object’s
type (which is an object itself).  Like its identity, an object’s
*type* is also unchangeable. [1]

The *value* of some objects can change.  Objects whose value can
change are said to be *mutable*; objects whose value is unchangeable
once they are created are called *immutable*. (The value of an
immutable container object that contains a reference to a mutable
object can change when the latter’s value is changed; however the
container is still considered immutable, because the collection of
objects it contains cannot be changed.  So, immutability is not
strictly the same as having an unchangeable value, it is more subtle.)
An object’s mutability is determined by its type; for instance,
numbers, strings and tuples are immutable, while dictionaries and
lists are mutable.

Objects are never explicitly destroyed; however, when they become
unreachable they may be garbage-collected.  An implementation is
allowed to postpone garbage collection or omit it altogether — it is a
matter of implementation quality how garbage collection is
implemented, as long as no objects are collected that are still
reachable.

**CPython implementation detail:** CPython currently uses a reference-
counting scheme with (optional) delayed detection of cyclically linked
garbage, which collects most objects as soon as they become
unreachable, but is not guaranteed to collect garbage containing
circular references.  See the documentation of the "gc" module for
information on controlling the collection of cyclic garbage. Other
implementations act differently and CPython may change. Do not depend
on immediate finalization of objects when they become unreachable (so
you should always close files explicitly).

Note that the use of the implementation’s tracing or debugging
facilities may keep objects alive that would normally be collectable.
Also note that catching an exception with a ‘"try"…"except"’ statement
may keep objects alive.

Some objects contain references to “external” resources such as open
files or windows.  It is understood that these resources are freed
when the object is garbage-collected, but since garbage collection is
not guaranteed to happen, such objects also provide an explicit way to
release the external resource, usually a "close()" method. Programs
are strongly recommended to explicitly close such objects.  The
‘"try"…"finally"’ statement and the ‘"with"’ statement provide
convenient ways to do this.

Some objects contain references to other objects; these are called
*containers*. Examples of containers are tuples, lists and
dictionaries.  The references are part of a container’s value.  In
most cases, when we talk about the value of a container, we imply the
values, not the identities of the contained objects; however, when we
talk about the mutability of a container, only the identities of the
immediately contained objects are implied.  So, if an immutable
container (like a tuple) contains a reference to a mutable object, its
value changes if that mutable object is changed.

Types affect almost all aspects of object behavior.  Even the
importance of object identity is affected in some sense: for immutable
types, operations that compute new values may actually return a
reference to any existing object with the same type and value, while
for mutable objects this is not allowed.  E.g., after "a = 1; b = 1",
"a" and "b" may or may not refer to the same object with the value
one, depending on the implementation, but after "c = []; d = []", "c"
and "d" are guaranteed to refer to two different, unique, newly
created empty lists. (Note that "c = d = []" assigns the same object
to both "c" and "d".)
u�Operator precedence
*******************

The following table summarizes the operator precedence in Python, from
lowest precedence (least binding) to highest precedence (most
binding).  Operators in the same box have the same precedence.  Unless
the syntax is explicitly given, operators are binary.  Operators in
the same box group left to right (except for exponentiation, which
groups from right to left).

Note that comparisons, membership tests, and identity tests, all have
the same precedence and have a left-to-right chaining feature as
described in the Comparisons section.

+-------------------------------------------------+---------------------------------------+
| Operator                                        | Description                           |
|=================================================|=======================================|
| ":="                                            | Assignment expression                 |
+-------------------------------------------------+---------------------------------------+
| "lambda"                                        | Lambda expression                     |
+-------------------------------------------------+---------------------------------------+
| "if" – "else"                                   | Conditional expression                |
+-------------------------------------------------+---------------------------------------+
| "or"                                            | Boolean OR                            |
+-------------------------------------------------+---------------------------------------+
| "and"                                           | Boolean AND                           |
+-------------------------------------------------+---------------------------------------+
| "not" "x"                                       | Boolean NOT                           |
+-------------------------------------------------+---------------------------------------+
| "in", "not in", "is", "is not", "<", "<=", ">", | Comparisons, including membership     |
| ">=", "!=", "=="                                | tests and identity tests              |
+-------------------------------------------------+---------------------------------------+
| "|"                                             | Bitwise OR                            |
+-------------------------------------------------+---------------------------------------+
| "^"                                             | Bitwise XOR                           |
+-------------------------------------------------+---------------------------------------+
| "&"                                             | Bitwise AND                           |
+-------------------------------------------------+---------------------------------------+
| "<<", ">>"                                      | Shifts                                |
+-------------------------------------------------+---------------------------------------+
| "+", "-"                                        | Addition and subtraction              |
+-------------------------------------------------+---------------------------------------+
| "*", "@", "/", "//", "%"                        | Multiplication, matrix                |
|                                                 | multiplication, division, floor       |
|                                                 | division, remainder [5]               |
+-------------------------------------------------+---------------------------------------+
| "+x", "-x", "~x"                                | Positive, negative, bitwise NOT       |
+-------------------------------------------------+---------------------------------------+
| "**"                                            | Exponentiation [6]                    |
+-------------------------------------------------+---------------------------------------+
| "await" "x"                                     | Await expression                      |
+-------------------------------------------------+---------------------------------------+
| "x[index]", "x[index:index]",                   | Subscription, slicing, call,          |
| "x(arguments...)", "x.attribute"                | attribute reference                   |
+-------------------------------------------------+---------------------------------------+
| "(expressions...)",  "[expressions...]", "{key: | Binding or parenthesized expression,  |
| value...}", "{expressions...}"                  | list display, dictionary display, set |
|                                                 | display                               |
+-------------------------------------------------+---------------------------------------+

-[ Footnotes ]-

[1] While "abs(x%y) < abs(y)" is true mathematically, for floats it
    may not be true numerically due to roundoff.  For example, and
    assuming a platform on which a Python float is an IEEE 754 double-
    precision number, in order that "-1e-100 % 1e100" have the same
    sign as "1e100", the computed result is "-1e-100 + 1e100", which
    is numerically exactly equal to "1e100".  The function
    "math.fmod()" returns a result whose sign matches the sign of the
    first argument instead, and so returns "-1e-100" in this case.
    Which approach is more appropriate depends on the application.

[2] If x is very close to an exact integer multiple of y, it’s
    possible for "x//y" to be one larger than "(x-x%y)//y" due to
    rounding.  In such cases, Python returns the latter result, in
    order to preserve that "divmod(x,y)[0] * y + x % y" be very close
    to "x".

[3] The Unicode standard distinguishes between *code points* (e.g.
    U+0041) and *abstract characters* (e.g. “LATIN CAPITAL LETTER A”).
    While most abstract characters in Unicode are only represented
    using one code point, there is a number of abstract characters
    that can in addition be represented using a sequence of more than
    one code point.  For example, the abstract character “LATIN
    CAPITAL LETTER C WITH CEDILLA” can be represented as a single
    *precomposed character* at code position U+00C7, or as a sequence
    of a *base character* at code position U+0043 (LATIN CAPITAL
    LETTER C), followed by a *combining character* at code position
    U+0327 (COMBINING CEDILLA).

    The comparison operators on strings compare at the level of
    Unicode code points. This may be counter-intuitive to humans.  For
    example, ""\u00C7" == "\u0043\u0327"" is "False", even though both
    strings represent the same abstract character “LATIN CAPITAL
    LETTER C WITH CEDILLA”.

    To compare strings at the level of abstract characters (that is,
    in a way intuitive to humans), use "unicodedata.normalize()".

[4] Due to automatic garbage-collection, free lists, and the dynamic
    nature of descriptors, you may notice seemingly unusual behaviour
    in certain uses of the "is" operator, like those involving
    comparisons between instance methods, or constants.  Check their
    documentation for more info.

[5] The "%" operator is also used for string formatting; the same
    precedence applies.

[6] The power operator "**" binds less tightly than an arithmetic or
    bitwise unary operator on its right, that is, "2**-1" is "0.5".
uwThe "pass" statement
********************

   pass_stmt ::= "pass"

"pass" is a null operation — when it is executed, nothing happens. It
is useful as a placeholder when a statement is required syntactically,
but no code needs to be executed, for example:

   def f(arg): pass    # a function that does nothing (yet)

   class C: pass       # a class with no methods (yet)
a�The power operator
******************

The power operator binds more tightly than unary operators on its
left; it binds less tightly than unary operators on its right.  The
syntax is:

   power ::= (await_expr | primary) ["**" u_expr]

Thus, in an unparenthesized sequence of power and unary operators, the
operators are evaluated from right to left (this does not constrain
the evaluation order for the operands): "-1**2" results in "-1".

The power operator has the same semantics as the built-in "pow()"
function, when called with two arguments: it yields its left argument
raised to the power of its right argument.  The numeric arguments are
first converted to a common type, and the result is of that type.

For int operands, the result has the same type as the operands unless
the second argument is negative; in that case, all arguments are
converted to float and a float result is delivered. For example,
"10**2" returns "100", but "10**-2" returns "0.01".

Raising "0.0" to a negative power results in a "ZeroDivisionError".
Raising a negative number to a fractional power results in a "complex"
number. (In earlier versions it raised a "ValueError".)
uJ
The "raise" statement
*********************

   raise_stmt ::= "raise" [expression ["from" expression]]

If no expressions are present, "raise" re-raises the last exception
that was active in the current scope.  If no exception is active in
the current scope, a "RuntimeError" exception is raised indicating
that this is an error.

Otherwise, "raise" evaluates the first expression as the exception
object.  It must be either a subclass or an instance of
"BaseException". If it is a class, the exception instance will be
obtained when needed by instantiating the class with no arguments.

The *type* of the exception is the exception instance’s class, the
*value* is the instance itself.

A traceback object is normally created automatically when an exception
is raised and attached to it as the "__traceback__" attribute, which
is writable. You can create an exception and set your own traceback in
one step using the "with_traceback()" exception method (which returns
the same exception instance, with its traceback set to its argument),
like so:

   raise Exception("foo occurred").with_traceback(tracebackobj)

The "from" clause is used for exception chaining: if given, the second
*expression* must be another exception class or instance. If the
second expression is an exception instance, it will be attached to the
raised exception as the "__cause__" attribute (which is writable). If
the expression is an exception class, the class will be instantiated
and the resulting exception instance will be attached to the raised
exception as the "__cause__" attribute. If the raised exception is not
handled, both exceptions will be printed:

   >>> try:
   ...     print(1 / 0)
   ... except Exception as exc:
   ...     raise RuntimeError("Something bad happened") from exc
   ...
   Traceback (most recent call last):
     File "<stdin>", line 2, in <module>
   ZeroDivisionError: division by zero

   The above exception was the direct cause of the following exception:

   Traceback (most recent call last):
     File "<stdin>", line 4, in <module>
   RuntimeError: Something bad happened

A similar mechanism works implicitly if an exception is raised inside
an exception handler or a "finally" clause: the previous exception is
then attached as the new exception’s "__context__" attribute:

   >>> try:
   ...     print(1 / 0)
   ... except:
   ...     raise RuntimeError("Something bad happened")
   ...
   Traceback (most recent call last):
     File "<stdin>", line 2, in <module>
   ZeroDivisionError: division by zero

   During handling of the above exception, another exception occurred:

   Traceback (most recent call last):
     File "<stdin>", line 4, in <module>
   RuntimeError: Something bad happened

Exception chaining can be explicitly suppressed by specifying "None"
in the "from" clause:

   >>> try:
   ...     print(1 / 0)
   ... except:
   ...     raise RuntimeError("Something bad happened") from None
   ...
   Traceback (most recent call last):
     File "<stdin>", line 4, in <module>
   RuntimeError: Something bad happened

Additional information on exceptions can be found in section
Exceptions, and information about handling exceptions is in section
The try statement.

Changed in version 3.3: "None" is now permitted as "Y" in "raise X
from Y".

New in version 3.3: The "__suppress_context__" attribute to suppress
automatic display of the exception context.
aThe "return" statement
**********************

   return_stmt ::= "return" [expression_list]

"return" may only occur syntactically nested in a function definition,
not within a nested class definition.

If an expression list is present, it is evaluated, else "None" is
substituted.

"return" leaves the current function call with the expression list (or
"None") as return value.

When "return" passes control out of a "try" statement with a "finally"
clause, that "finally" clause is executed before really leaving the
function.

In a generator function, the "return" statement indicates that the
generator is done and will cause "StopIteration" to be raised. The
returned value (if any) is used as an argument to construct
"StopIteration" and becomes the "StopIteration.value" attribute.

In an asynchronous generator function, an empty "return" statement
indicates that the asynchronous generator is done and will cause
"StopAsyncIteration" to be raised.  A non-empty "return" statement is
a syntax error in an asynchronous generator function.
u�Emulating container types
*************************

The following methods can be defined to implement container objects.
Containers usually are sequences (such as lists or tuples) or mappings
(like dictionaries), but can represent other containers as well.  The
first set of methods is used either to emulate a sequence or to
emulate a mapping; the difference is that for a sequence, the
allowable keys should be the integers *k* for which "0 <= k < N" where
*N* is the length of the sequence, or slice objects, which define a
range of items.  It is also recommended that mappings provide the
methods "keys()", "values()", "items()", "get()", "clear()",
"setdefault()", "pop()", "popitem()", "copy()", and "update()"
behaving similar to those for Python’s standard dictionary objects.
The "collections.abc" module provides a "MutableMapping" abstract base
class to help create those methods from a base set of "__getitem__()",
"__setitem__()", "__delitem__()", and "keys()". Mutable sequences
should provide methods "append()", "count()", "index()", "extend()",
"insert()", "pop()", "remove()", "reverse()" and "sort()", like Python
standard list objects.  Finally, sequence types should implement
addition (meaning concatenation) and multiplication (meaning
repetition) by defining the methods "__add__()", "__radd__()",
"__iadd__()", "__mul__()", "__rmul__()" and "__imul__()" described
below; they should not define other numerical operators.  It is
recommended that both mappings and sequences implement the
"__contains__()" method to allow efficient use of the "in" operator;
for mappings, "in" should search the mapping’s keys; for sequences, it
should search through the values.  It is further recommended that both
mappings and sequences implement the "__iter__()" method to allow
efficient iteration through the container; for mappings, "__iter__()"
should iterate through the object’s keys; for sequences, it should
iterate through the values.

object.__len__(self)

   Called to implement the built-in function "len()".  Should return
   the length of the object, an integer ">=" 0.  Also, an object that
   doesn’t define a "__bool__()" method and whose "__len__()" method
   returns zero is considered to be false in a Boolean context.

   **CPython implementation detail:** In CPython, the length is
   required to be at most "sys.maxsize". If the length is larger than
   "sys.maxsize" some features (such as "len()") may raise
   "OverflowError".  To prevent raising "OverflowError" by truth value
   testing, an object must define a "__bool__()" method.

object.__length_hint__(self)

   Called to implement "operator.length_hint()". Should return an
   estimated length for the object (which may be greater or less than
   the actual length). The length must be an integer ">=" 0. The
   return value may also be "NotImplemented", which is treated the
   same as if the "__length_hint__" method didn’t exist at all. This
   method is purely an optimization and is never required for
   correctness.

   New in version 3.4.

Note:

  Slicing is done exclusively with the following three methods.  A
  call like

     a[1:2] = b

  is translated to

     a[slice(1, 2, None)] = b

  and so forth.  Missing slice items are always filled in with "None".

object.__getitem__(self, key)

   Called to implement evaluation of "self[key]". For sequence types,
   the accepted keys should be integers and slice objects.  Note that
   the special interpretation of negative indexes (if the class wishes
   to emulate a sequence type) is up to the "__getitem__()" method. If
   *key* is of an inappropriate type, "TypeError" may be raised; if of
   a value outside the set of indexes for the sequence (after any
   special interpretation of negative values), "IndexError" should be
   raised. For mapping types, if *key* is missing (not in the
   container), "KeyError" should be raised.

   Note:

     "for" loops expect that an "IndexError" will be raised for
     illegal indexes to allow proper detection of the end of the
     sequence.

object.__setitem__(self, key, value)

   Called to implement assignment to "self[key]".  Same note as for
   "__getitem__()".  This should only be implemented for mappings if
   the objects support changes to the values for keys, or if new keys
   can be added, or for sequences if elements can be replaced.  The
   same exceptions should be raised for improper *key* values as for
   the "__getitem__()" method.

object.__delitem__(self, key)

   Called to implement deletion of "self[key]".  Same note as for
   "__getitem__()".  This should only be implemented for mappings if
   the objects support removal of keys, or for sequences if elements
   can be removed from the sequence.  The same exceptions should be
   raised for improper *key* values as for the "__getitem__()" method.

object.__missing__(self, key)

   Called by "dict"."__getitem__()" to implement "self[key]" for dict
   subclasses when key is not in the dictionary.

object.__iter__(self)

   This method is called when an iterator is required for a container.
   This method should return a new iterator object that can iterate
   over all the objects in the container.  For mappings, it should
   iterate over the keys of the container.

   Iterator objects also need to implement this method; they are
   required to return themselves.  For more information on iterator
   objects, see Iterator Types.

object.__reversed__(self)

   Called (if present) by the "reversed()" built-in to implement
   reverse iteration.  It should return a new iterator object that
   iterates over all the objects in the container in reverse order.

   If the "__reversed__()" method is not provided, the "reversed()"
   built-in will fall back to using the sequence protocol ("__len__()"
   and "__getitem__()").  Objects that support the sequence protocol
   should only provide "__reversed__()" if they can provide an
   implementation that is more efficient than the one provided by
   "reversed()".

The membership test operators ("in" and "not in") are normally
implemented as an iteration through a container. However, container
objects can supply the following special method with a more efficient
implementation, which also does not require the object be iterable.

object.__contains__(self, item)

   Called to implement membership test operators.  Should return true
   if *item* is in *self*, false otherwise.  For mapping objects, this
   should consider the keys of the mapping rather than the values or
   the key-item pairs.

   For objects that don’t define "__contains__()", the membership test
   first tries iteration via "__iter__()", then the old sequence
   iteration protocol via "__getitem__()", see this section in the
   language reference.
a�Shifting operations
*******************

The shifting operations have lower priority than the arithmetic
operations:

   shift_expr ::= a_expr | shift_expr ("<<" | ">>") a_expr

These operators accept integers as arguments.  They shift the first
argument to the left or right by the number of bits given by the
second argument.

A right shift by *n* bits is defined as floor division by "pow(2,n)".
A left shift by *n* bits is defined as multiplication with "pow(2,n)".
a�Slicings
********

A slicing selects a range of items in a sequence object (e.g., a
string, tuple or list).  Slicings may be used as expressions or as
targets in assignment or "del" statements.  The syntax for a slicing:

   slicing      ::= primary "[" slice_list "]"
   slice_list   ::= slice_item ("," slice_item)* [","]
   slice_item   ::= expression | proper_slice
   proper_slice ::= [lower_bound] ":" [upper_bound] [ ":" [stride] ]
   lower_bound  ::= expression
   upper_bound  ::= expression
   stride       ::= expression

There is ambiguity in the formal syntax here: anything that looks like
an expression list also looks like a slice list, so any subscription
can be interpreted as a slicing.  Rather than further complicating the
syntax, this is disambiguated by defining that in this case the
interpretation as a subscription takes priority over the
interpretation as a slicing (this is the case if the slice list
contains no proper slice).

The semantics for a slicing are as follows.  The primary is indexed
(using the same "__getitem__()" method as normal subscription) with a
key that is constructed from the slice list, as follows.  If the slice
list contains at least one comma, the key is a tuple containing the
conversion of the slice items; otherwise, the conversion of the lone
slice item is the key.  The conversion of a slice item that is an
expression is that expression.  The conversion of a proper slice is a
slice object (see section The standard type hierarchy) whose "start",
"stop" and "step" attributes are the values of the expressions given
as lower bound, upper bound and stride, respectively, substituting
"None" for missing expressions.
uSpecial Attributes
******************

The implementation adds a few special read-only attributes to several
object types, where they are relevant.  Some of these are not reported
by the "dir()" built-in function.

object.__dict__

   A dictionary or other mapping object used to store an object’s
   (writable) attributes.

instance.__class__

   The class to which a class instance belongs.

class.__bases__

   The tuple of base classes of a class object.

definition.__name__

   The name of the class, function, method, descriptor, or generator
   instance.

definition.__qualname__

   The *qualified name* of the class, function, method, descriptor, or
   generator instance.

   New in version 3.3.

class.__mro__

   This attribute is a tuple of classes that are considered when
   looking for base classes during method resolution.

class.mro()

   This method can be overridden by a metaclass to customize the
   method resolution order for its instances.  It is called at class
   instantiation, and its result is stored in "__mro__".

class.__subclasses__()

   Each class keeps a list of weak references to its immediate
   subclasses.  This method returns a list of all those references
   still alive. Example:

      >>> int.__subclasses__()
      [<class 'bool'>]
u��Special method names
********************

A class can implement certain operations that are invoked by special
syntax (such as arithmetic operations or subscripting and slicing) by
defining methods with special names. This is Python’s approach to
*operator overloading*, allowing classes to define their own behavior
with respect to language operators.  For instance, if a class defines
a method named "__getitem__()", and "x" is an instance of this class,
then "x[i]" is roughly equivalent to "type(x).__getitem__(x, i)".
Except where mentioned, attempts to execute an operation raise an
exception when no appropriate method is defined (typically
"AttributeError" or "TypeError").

Setting a special method to "None" indicates that the corresponding
operation is not available.  For example, if a class sets "__iter__()"
to "None", the class is not iterable, so calling "iter()" on its
instances will raise a "TypeError" (without falling back to
"__getitem__()"). [2]

When implementing a class that emulates any built-in type, it is
important that the emulation only be implemented to the degree that it
makes sense for the object being modelled.  For example, some
sequences may work well with retrieval of individual elements, but
extracting a slice may not make sense.  (One example of this is the
"NodeList" interface in the W3C’s Document Object Model.)


Basic customization
===================

object.__new__(cls[, ...])

   Called to create a new instance of class *cls*.  "__new__()" is a
   static method (special-cased so you need not declare it as such)
   that takes the class of which an instance was requested as its
   first argument.  The remaining arguments are those passed to the
   object constructor expression (the call to the class).  The return
   value of "__new__()" should be the new object instance (usually an
   instance of *cls*).

   Typical implementations create a new instance of the class by
   invoking the superclass’s "__new__()" method using
   "super().__new__(cls[, ...])" with appropriate arguments and then
   modifying the newly-created instance as necessary before returning
   it.

   If "__new__()" is invoked during object construction and it returns
   an instance of *cls*, then the new instance’s "__init__()" method
   will be invoked like "__init__(self[, ...])", where *self* is the
   new instance and the remaining arguments are the same as were
   passed to the object constructor.

   If "__new__()" does not return an instance of *cls*, then the new
   instance’s "__init__()" method will not be invoked.

   "__new__()" is intended mainly to allow subclasses of immutable
   types (like int, str, or tuple) to customize instance creation.  It
   is also commonly overridden in custom metaclasses in order to
   customize class creation.

object.__init__(self[, ...])

   Called after the instance has been created (by "__new__()"), but
   before it is returned to the caller.  The arguments are those
   passed to the class constructor expression.  If a base class has an
   "__init__()" method, the derived class’s "__init__()" method, if
   any, must explicitly call it to ensure proper initialization of the
   base class part of the instance; for example:
   "super().__init__([args...])".

   Because "__new__()" and "__init__()" work together in constructing
   objects ("__new__()" to create it, and "__init__()" to customize
   it), no non-"None" value may be returned by "__init__()"; doing so
   will cause a "TypeError" to be raised at runtime.

object.__del__(self)

   Called when the instance is about to be destroyed.  This is also
   called a finalizer or (improperly) a destructor.  If a base class
   has a "__del__()" method, the derived class’s "__del__()" method,
   if any, must explicitly call it to ensure proper deletion of the
   base class part of the instance.

   It is possible (though not recommended!) for the "__del__()" method
   to postpone destruction of the instance by creating a new reference
   to it.  This is called object *resurrection*.  It is
   implementation-dependent whether "__del__()" is called a second
   time when a resurrected object is about to be destroyed; the
   current *CPython* implementation only calls it once.

   It is not guaranteed that "__del__()" methods are called for
   objects that still exist when the interpreter exits.

   Note:

     "del x" doesn’t directly call "x.__del__()" — the former
     decrements the reference count for "x" by one, and the latter is
     only called when "x"’s reference count reaches zero.

   **CPython implementation detail:** It is possible for a reference
   cycle to prevent the reference count of an object from going to
   zero.  In this case, the cycle will be later detected and deleted
   by the *cyclic garbage collector*.  A common cause of reference
   cycles is when an exception has been caught in a local variable.
   The frame’s locals then reference the exception, which references
   its own traceback, which references the locals of all frames caught
   in the traceback.

   See also: Documentation for the "gc" module.

   Warning:

     Due to the precarious circumstances under which "__del__()"
     methods are invoked, exceptions that occur during their execution
     are ignored, and a warning is printed to "sys.stderr" instead.
     In particular:

     * "__del__()" can be invoked when arbitrary code is being
       executed, including from any arbitrary thread.  If "__del__()"
       needs to take a lock or invoke any other blocking resource, it
       may deadlock as the resource may already be taken by the code
       that gets interrupted to execute "__del__()".

     * "__del__()" can be executed during interpreter shutdown.  As a
       consequence, the global variables it needs to access (including
       other modules) may already have been deleted or set to "None".
       Python guarantees that globals whose name begins with a single
       underscore are deleted from their module before other globals
       are deleted; if no other references to such globals exist, this
       may help in assuring that imported modules are still available
       at the time when the "__del__()" method is called.

object.__repr__(self)

   Called by the "repr()" built-in function to compute the “official”
   string representation of an object.  If at all possible, this
   should look like a valid Python expression that could be used to
   recreate an object with the same value (given an appropriate
   environment).  If this is not possible, a string of the form
   "<...some useful description...>" should be returned. The return
   value must be a string object. If a class defines "__repr__()" but
   not "__str__()", then "__repr__()" is also used when an “informal”
   string representation of instances of that class is required.

   This is typically used for debugging, so it is important that the
   representation is information-rich and unambiguous.

object.__str__(self)

   Called by "str(object)" and the built-in functions "format()" and
   "print()" to compute the “informal” or nicely printable string
   representation of an object.  The return value must be a string
   object.

   This method differs from "object.__repr__()" in that there is no
   expectation that "__str__()" return a valid Python expression: a
   more convenient or concise representation can be used.

   The default implementation defined by the built-in type "object"
   calls "object.__repr__()".

object.__bytes__(self)

   Called by bytes to compute a byte-string representation of an
   object. This should return a "bytes" object.

object.__format__(self, format_spec)

   Called by the "format()" built-in function, and by extension,
   evaluation of formatted string literals and the "str.format()"
   method, to produce a “formatted” string representation of an
   object. The *format_spec* argument is a string that contains a
   description of the formatting options desired. The interpretation
   of the *format_spec* argument is up to the type implementing
   "__format__()", however most classes will either delegate
   formatting to one of the built-in types, or use a similar
   formatting option syntax.

   See Format Specification Mini-Language for a description of the
   standard formatting syntax.

   The return value must be a string object.

   Changed in version 3.4: The __format__ method of "object" itself
   raises a "TypeError" if passed any non-empty string.

   Changed in version 3.7: "object.__format__(x, '')" is now
   equivalent to "str(x)" rather than "format(str(self), '')".

object.__lt__(self, other)
object.__le__(self, other)
object.__eq__(self, other)
object.__ne__(self, other)
object.__gt__(self, other)
object.__ge__(self, other)

   These are the so-called “rich comparison” methods. The
   correspondence between operator symbols and method names is as
   follows: "x<y" calls "x.__lt__(y)", "x<=y" calls "x.__le__(y)",
   "x==y" calls "x.__eq__(y)", "x!=y" calls "x.__ne__(y)", "x>y" calls
   "x.__gt__(y)", and "x>=y" calls "x.__ge__(y)".

   A rich comparison method may return the singleton "NotImplemented"
   if it does not implement the operation for a given pair of
   arguments. By convention, "False" and "True" are returned for a
   successful comparison. However, these methods can return any value,
   so if the comparison operator is used in a Boolean context (e.g.,
   in the condition of an "if" statement), Python will call "bool()"
   on the value to determine if the result is true or false.

   By default, "object" implements "__eq__()" by using "is", returning
   "NotImplemented" in the case of a false comparison: "True if x is y
   else NotImplemented". For "__ne__()", by default it delegates to
   "__eq__()" and inverts the result unless it is "NotImplemented".
   There are no other implied relationships among the comparison
   operators or default implementations; for example, the truth of
   "(x<y or x==y)" does not imply "x<=y". To automatically generate
   ordering operations from a single root operation, see
   "functools.total_ordering()".

   See the paragraph on "__hash__()" for some important notes on
   creating *hashable* objects which support custom comparison
   operations and are usable as dictionary keys.

   There are no swapped-argument versions of these methods (to be used
   when the left argument does not support the operation but the right
   argument does); rather, "__lt__()" and "__gt__()" are each other’s
   reflection, "__le__()" and "__ge__()" are each other’s reflection,
   and "__eq__()" and "__ne__()" are their own reflection. If the
   operands are of different types, and right operand’s type is a
   direct or indirect subclass of the left operand’s type, the
   reflected method of the right operand has priority, otherwise the
   left operand’s method has priority.  Virtual subclassing is not
   considered.

object.__hash__(self)

   Called by built-in function "hash()" and for operations on members
   of hashed collections including "set", "frozenset", and "dict".
   "__hash__()" should return an integer. The only required property
   is that objects which compare equal have the same hash value; it is
   advised to mix together the hash values of the components of the
   object that also play a part in comparison of objects by packing
   them into a tuple and hashing the tuple. Example:

      def __hash__(self):
          return hash((self.name, self.nick, self.color))

   Note:

     "hash()" truncates the value returned from an object’s custom
     "__hash__()" method to the size of a "Py_ssize_t".  This is
     typically 8 bytes on 64-bit builds and 4 bytes on 32-bit builds.
     If an object’s   "__hash__()" must interoperate on builds of
     different bit sizes, be sure to check the width on all supported
     builds.  An easy way to do this is with "python -c "import sys;
     print(sys.hash_info.width)"".

   If a class does not define an "__eq__()" method it should not
   define a "__hash__()" operation either; if it defines "__eq__()"
   but not "__hash__()", its instances will not be usable as items in
   hashable collections.  If a class defines mutable objects and
   implements an "__eq__()" method, it should not implement
   "__hash__()", since the implementation of hashable collections
   requires that a key’s hash value is immutable (if the object’s hash
   value changes, it will be in the wrong hash bucket).

   User-defined classes have "__eq__()" and "__hash__()" methods by
   default; with them, all objects compare unequal (except with
   themselves) and "x.__hash__()" returns an appropriate value such
   that "x == y" implies both that "x is y" and "hash(x) == hash(y)".

   A class that overrides "__eq__()" and does not define "__hash__()"
   will have its "__hash__()" implicitly set to "None".  When the
   "__hash__()" method of a class is "None", instances of the class
   will raise an appropriate "TypeError" when a program attempts to
   retrieve their hash value, and will also be correctly identified as
   unhashable when checking "isinstance(obj,
   collections.abc.Hashable)".

   If a class that overrides "__eq__()" needs to retain the
   implementation of "__hash__()" from a parent class, the interpreter
   must be told this explicitly by setting "__hash__ =
   <ParentClass>.__hash__".

   If a class that does not override "__eq__()" wishes to suppress
   hash support, it should include "__hash__ = None" in the class
   definition. A class which defines its own "__hash__()" that
   explicitly raises a "TypeError" would be incorrectly identified as
   hashable by an "isinstance(obj, collections.abc.Hashable)" call.

   Note:

     By default, the "__hash__()" values of str and bytes objects are
     “salted” with an unpredictable random value.  Although they
     remain constant within an individual Python process, they are not
     predictable between repeated invocations of Python.This is
     intended to provide protection against a denial-of-service caused
     by carefully-chosen inputs that exploit the worst case
     performance of a dict insertion, O(n^2) complexity.  See
     http://www.ocert.org/advisories/ocert-2011-003.html for
     details.Changing hash values affects the iteration order of sets.
     Python has never made guarantees about this ordering (and it
     typically varies between 32-bit and 64-bit builds).See also
     "PYTHONHASHSEED".

   Changed in version 3.3: Hash randomization is enabled by default.

object.__bool__(self)

   Called to implement truth value testing and the built-in operation
   "bool()"; should return "False" or "True".  When this method is not
   defined, "__len__()" is called, if it is defined, and the object is
   considered true if its result is nonzero.  If a class defines
   neither "__len__()" nor "__bool__()", all its instances are
   considered true.


Customizing attribute access
============================

The following methods can be defined to customize the meaning of
attribute access (use of, assignment to, or deletion of "x.name") for
class instances.

object.__getattr__(self, name)

   Called when the default attribute access fails with an
   "AttributeError" (either "__getattribute__()" raises an
   "AttributeError" because *name* is not an instance attribute or an
   attribute in the class tree for "self"; or "__get__()" of a *name*
   property raises "AttributeError").  This method should either
   return the (computed) attribute value or raise an "AttributeError"
   exception.

   Note that if the attribute is found through the normal mechanism,
   "__getattr__()" is not called.  (This is an intentional asymmetry
   between "__getattr__()" and "__setattr__()".) This is done both for
   efficiency reasons and because otherwise "__getattr__()" would have
   no way to access other attributes of the instance.  Note that at
   least for instance variables, you can fake total control by not
   inserting any values in the instance attribute dictionary (but
   instead inserting them in another object).  See the
   "__getattribute__()" method below for a way to actually get total
   control over attribute access.

object.__getattribute__(self, name)

   Called unconditionally to implement attribute accesses for
   instances of the class. If the class also defines "__getattr__()",
   the latter will not be called unless "__getattribute__()" either
   calls it explicitly or raises an "AttributeError". This method
   should return the (computed) attribute value or raise an
   "AttributeError" exception. In order to avoid infinite recursion in
   this method, its implementation should always call the base class
   method with the same name to access any attributes it needs, for
   example, "object.__getattribute__(self, name)".

   Note:

     This method may still be bypassed when looking up special methods
     as the result of implicit invocation via language syntax or
     built-in functions. See Special method lookup.

   For certain sensitive attribute accesses, raises an auditing event
   "object.__getattr__" with arguments "obj" and "name".

object.__setattr__(self, name, value)

   Called when an attribute assignment is attempted.  This is called
   instead of the normal mechanism (i.e. store the value in the
   instance dictionary). *name* is the attribute name, *value* is the
   value to be assigned to it.

   If "__setattr__()" wants to assign to an instance attribute, it
   should call the base class method with the same name, for example,
   "object.__setattr__(self, name, value)".

   For certain sensitive attribute assignments, raises an auditing
   event "object.__setattr__" with arguments "obj", "name", "value".

object.__delattr__(self, name)

   Like "__setattr__()" but for attribute deletion instead of
   assignment.  This should only be implemented if "del obj.name" is
   meaningful for the object.

   For certain sensitive attribute deletions, raises an auditing event
   "object.__delattr__" with arguments "obj" and "name".

object.__dir__(self)

   Called when "dir()" is called on the object. A sequence must be
   returned. "dir()" converts the returned sequence to a list and
   sorts it.


Customizing module attribute access
-----------------------------------

Special names "__getattr__" and "__dir__" can be also used to
customize access to module attributes. The "__getattr__" function at
the module level should accept one argument which is the name of an
attribute and return the computed value or raise an "AttributeError".
If an attribute is not found on a module object through the normal
lookup, i.e. "object.__getattribute__()", then "__getattr__" is
searched in the module "__dict__" before raising an "AttributeError".
If found, it is called with the attribute name and the result is
returned.

The "__dir__" function should accept no arguments, and return a
sequence of strings that represents the names accessible on module. If
present, this function overrides the standard "dir()" search on a
module.

For a more fine grained customization of the module behavior (setting
attributes, properties, etc.), one can set the "__class__" attribute
of a module object to a subclass of "types.ModuleType". For example:

   import sys
   from types import ModuleType

   class VerboseModule(ModuleType):
       def __repr__(self):
           return f'Verbose {self.__name__}'

       def __setattr__(self, attr, value):
           print(f'Setting {attr}...')
           super().__setattr__(attr, value)

   sys.modules[__name__].__class__ = VerboseModule

Note:

  Defining module "__getattr__" and setting module "__class__" only
  affect lookups made using the attribute access syntax – directly
  accessing the module globals (whether by code within the module, or
  via a reference to the module’s globals dictionary) is unaffected.

Changed in version 3.5: "__class__" module attribute is now writable.

New in version 3.7: "__getattr__" and "__dir__" module attributes.

See also:

  **PEP 562** - Module __getattr__ and __dir__
     Describes the "__getattr__" and "__dir__" functions on modules.


Implementing Descriptors
------------------------

The following methods only apply when an instance of the class
containing the method (a so-called *descriptor* class) appears in an
*owner* class (the descriptor must be in either the owner’s class
dictionary or in the class dictionary for one of its parents).  In the
examples below, “the attribute” refers to the attribute whose name is
the key of the property in the owner class’ "__dict__".

object.__get__(self, instance, owner=None)

   Called to get the attribute of the owner class (class attribute
   access) or of an instance of that class (instance attribute
   access). The optional *owner* argument is the owner class, while
   *instance* is the instance that the attribute was accessed through,
   or "None" when the attribute is accessed through the *owner*.

   This method should return the computed attribute value or raise an
   "AttributeError" exception.

   **PEP 252** specifies that "__get__()" is callable with one or two
   arguments.  Python’s own built-in descriptors support this
   specification; however, it is likely that some third-party tools
   have descriptors that require both arguments.  Python’s own
   "__getattribute__()" implementation always passes in both arguments
   whether they are required or not.

object.__set__(self, instance, value)

   Called to set the attribute on an instance *instance* of the owner
   class to a new value, *value*.

   Note, adding "__set__()" or "__delete__()" changes the kind of
   descriptor to a “data descriptor”.  See Invoking Descriptors for
   more details.

object.__delete__(self, instance)

   Called to delete the attribute on an instance *instance* of the
   owner class.

object.__set_name__(self, owner, name)

   Called at the time the owning class *owner* is created. The
   descriptor has been assigned to *name*.

   Note:

     "__set_name__()" is only called implicitly as part of the "type"
     constructor, so it will need to be called explicitly with the
     appropriate parameters when a descriptor is added to a class
     after initial creation:

        class A:
           pass
        descr = custom_descriptor()
        A.attr = descr
        descr.__set_name__(A, 'attr')

     See Creating the class object for more details.

   New in version 3.6.

The attribute "__objclass__" is interpreted by the "inspect" module as
specifying the class where this object was defined (setting this
appropriately can assist in runtime introspection of dynamic class
attributes). For callables, it may indicate that an instance of the
given type (or a subclass) is expected or required as the first
positional argument (for example, CPython sets this attribute for
unbound methods that are implemented in C).


Invoking Descriptors
--------------------

In general, a descriptor is an object attribute with “binding
behavior”, one whose attribute access has been overridden by methods
in the descriptor protocol:  "__get__()", "__set__()", and
"__delete__()". If any of those methods are defined for an object, it
is said to be a descriptor.

The default behavior for attribute access is to get, set, or delete
the attribute from an object’s dictionary. For instance, "a.x" has a
lookup chain starting with "a.__dict__['x']", then
"type(a).__dict__['x']", and continuing through the base classes of
"type(a)" excluding metaclasses.

However, if the looked-up value is an object defining one of the
descriptor methods, then Python may override the default behavior and
invoke the descriptor method instead.  Where this occurs in the
precedence chain depends on which descriptor methods were defined and
how they were called.

The starting point for descriptor invocation is a binding, "a.x". How
the arguments are assembled depends on "a":

Direct Call
   The simplest and least common call is when user code directly
   invokes a descriptor method:    "x.__get__(a)".

Instance Binding
   If binding to an object instance, "a.x" is transformed into the
   call: "type(a).__dict__['x'].__get__(a, type(a))".

Class Binding
   If binding to a class, "A.x" is transformed into the call:
   "A.__dict__['x'].__get__(None, A)".

Super Binding
   If "a" is an instance of "super", then the binding "super(B,
   obj).m()" searches "obj.__class__.__mro__" for the base class "A"
   immediately preceding "B" and then invokes the descriptor with the
   call: "A.__dict__['m'].__get__(obj, obj.__class__)".

For instance bindings, the precedence of descriptor invocation depends
on which descriptor methods are defined.  A descriptor can define any
combination of "__get__()", "__set__()" and "__delete__()".  If it
does not define "__get__()", then accessing the attribute will return
the descriptor object itself unless there is a value in the object’s
instance dictionary.  If the descriptor defines "__set__()" and/or
"__delete__()", it is a data descriptor; if it defines neither, it is
a non-data descriptor.  Normally, data descriptors define both
"__get__()" and "__set__()", while non-data descriptors have just the
"__get__()" method.  Data descriptors with "__set__()" and "__get__()"
defined always override a redefinition in an instance dictionary.  In
contrast, non-data descriptors can be overridden by instances.

Python methods (including "staticmethod()" and "classmethod()") are
implemented as non-data descriptors.  Accordingly, instances can
redefine and override methods.  This allows individual instances to
acquire behaviors that differ from other instances of the same class.

The "property()" function is implemented as a data descriptor.
Accordingly, instances cannot override the behavior of a property.


__slots__
---------

*__slots__* allow us to explicitly declare data members (like
properties) and deny the creation of *__dict__* and *__weakref__*
(unless explicitly declared in *__slots__* or available in a parent.)

The space saved over using *__dict__* can be significant. Attribute
lookup speed can be significantly improved as well.

object.__slots__

   This class variable can be assigned a string, iterable, or sequence
   of strings with variable names used by instances.  *__slots__*
   reserves space for the declared variables and prevents the
   automatic creation of *__dict__* and *__weakref__* for each
   instance.


Notes on using *__slots__*
~~~~~~~~~~~~~~~~~~~~~~~~~~

* When inheriting from a class without *__slots__*, the *__dict__* and
  *__weakref__* attribute of the instances will always be accessible.

* Without a *__dict__* variable, instances cannot be assigned new
  variables not listed in the *__slots__* definition.  Attempts to
  assign to an unlisted variable name raises "AttributeError". If
  dynamic assignment of new variables is desired, then add
  "'__dict__'" to the sequence of strings in the *__slots__*
  declaration.

* Without a *__weakref__* variable for each instance, classes defining
  *__slots__* do not support weak references to its instances. If weak
  reference support is needed, then add "'__weakref__'" to the
  sequence of strings in the *__slots__* declaration.

* *__slots__* are implemented at the class level by creating
  descriptors (Implementing Descriptors) for each variable name.  As a
  result, class attributes cannot be used to set default values for
  instance variables defined by *__slots__*; otherwise, the class
  attribute would overwrite the descriptor assignment.

* The action of a *__slots__* declaration is not limited to the class
  where it is defined.  *__slots__* declared in parents are available
  in child classes. However, child subclasses will get a *__dict__*
  and *__weakref__* unless they also define *__slots__* (which should
  only contain names of any *additional* slots).

* If a class defines a slot also defined in a base class, the instance
  variable defined by the base class slot is inaccessible (except by
  retrieving its descriptor directly from the base class). This
  renders the meaning of the program undefined.  In the future, a
  check may be added to prevent this.

* Nonempty *__slots__* does not work for classes derived from
  “variable-length” built-in types such as "int", "bytes" and "tuple".

* Any non-string iterable may be assigned to *__slots__*. Mappings may
  also be used; however, in the future, special meaning may be
  assigned to the values corresponding to each key.

* *__class__* assignment works only if both classes have the same
  *__slots__*.

* Multiple inheritance with multiple slotted parent classes can be
  used, but only one parent is allowed to have attributes created by
  slots (the other bases must have empty slot layouts) - violations
  raise "TypeError".

* If an iterator is used for *__slots__* then a descriptor is created
  for each of the iterator’s values. However, the *__slots__*
  attribute will be an empty iterator.


Customizing class creation
==========================

Whenever a class inherits from another class, *__init_subclass__* is
called on that class. This way, it is possible to write classes which
change the behavior of subclasses. This is closely related to class
decorators, but where class decorators only affect the specific class
they’re applied to, "__init_subclass__" solely applies to future
subclasses of the class defining the method.

classmethod object.__init_subclass__(cls)

   This method is called whenever the containing class is subclassed.
   *cls* is then the new subclass. If defined as a normal instance
   method, this method is implicitly converted to a class method.

   Keyword arguments which are given to a new class are passed to the
   parent’s class "__init_subclass__". For compatibility with other
   classes using "__init_subclass__", one should take out the needed
   keyword arguments and pass the others over to the base class, as
   in:

      class Philosopher:
          def __init_subclass__(cls, /, default_name, **kwargs):
              super().__init_subclass__(**kwargs)
              cls.default_name = default_name

      class AustralianPhilosopher(Philosopher, default_name="Bruce"):
          pass

   The default implementation "object.__init_subclass__" does nothing,
   but raises an error if it is called with any arguments.

   Note:

     The metaclass hint "metaclass" is consumed by the rest of the
     type machinery, and is never passed to "__init_subclass__"
     implementations. The actual metaclass (rather than the explicit
     hint) can be accessed as "type(cls)".

   New in version 3.6.


Metaclasses
-----------

By default, classes are constructed using "type()". The class body is
executed in a new namespace and the class name is bound locally to the
result of "type(name, bases, namespace)".

The class creation process can be customized by passing the
"metaclass" keyword argument in the class definition line, or by
inheriting from an existing class that included such an argument. In
the following example, both "MyClass" and "MySubclass" are instances
of "Meta":

   class Meta(type):
       pass

   class MyClass(metaclass=Meta):
       pass

   class MySubclass(MyClass):
       pass

Any other keyword arguments that are specified in the class definition
are passed through to all metaclass operations described below.

When a class definition is executed, the following steps occur:

* MRO entries are resolved;

* the appropriate metaclass is determined;

* the class namespace is prepared;

* the class body is executed;

* the class object is created.


Resolving MRO entries
---------------------

If a base that appears in class definition is not an instance of
"type", then an "__mro_entries__" method is searched on it. If found,
it is called with the original bases tuple. This method must return a
tuple of classes that will be used instead of this base. The tuple may
be empty, in such case the original base is ignored.

See also:

  **PEP 560** - Core support for typing module and generic types


Determining the appropriate metaclass
-------------------------------------

The appropriate metaclass for a class definition is determined as
follows:

* if no bases and no explicit metaclass are given, then "type()" is
  used;

* if an explicit metaclass is given and it is *not* an instance of
  "type()", then it is used directly as the metaclass;

* if an instance of "type()" is given as the explicit metaclass, or
  bases are defined, then the most derived metaclass is used.

The most derived metaclass is selected from the explicitly specified
metaclass (if any) and the metaclasses (i.e. "type(cls)") of all
specified base classes. The most derived metaclass is one which is a
subtype of *all* of these candidate metaclasses. If none of the
candidate metaclasses meets that criterion, then the class definition
will fail with "TypeError".


Preparing the class namespace
-----------------------------

Once the appropriate metaclass has been identified, then the class
namespace is prepared. If the metaclass has a "__prepare__" attribute,
it is called as "namespace = metaclass.__prepare__(name, bases,
**kwds)" (where the additional keyword arguments, if any, come from
the class definition). The "__prepare__" method should be implemented
as a "classmethod()". The namespace returned by "__prepare__" is
passed in to "__new__", but when the final class object is created the
namespace is copied into a new "dict".

If the metaclass has no "__prepare__" attribute, then the class
namespace is initialised as an empty ordered mapping.

See also:

  **PEP 3115** - Metaclasses in Python 3000
     Introduced the "__prepare__" namespace hook


Executing the class body
------------------------

The class body is executed (approximately) as "exec(body, globals(),
namespace)". The key difference from a normal call to "exec()" is that
lexical scoping allows the class body (including any methods) to
reference names from the current and outer scopes when the class
definition occurs inside a function.

However, even when the class definition occurs inside the function,
methods defined inside the class still cannot see names defined at the
class scope. Class variables must be accessed through the first
parameter of instance or class methods, or through the implicit
lexically scoped "__class__" reference described in the next section.


Creating the class object
-------------------------

Once the class namespace has been populated by executing the class
body, the class object is created by calling "metaclass(name, bases,
namespace, **kwds)" (the additional keywords passed here are the same
as those passed to "__prepare__").

This class object is the one that will be referenced by the zero-
argument form of "super()". "__class__" is an implicit closure
reference created by the compiler if any methods in a class body refer
to either "__class__" or "super". This allows the zero argument form
of "super()" to correctly identify the class being defined based on
lexical scoping, while the class or instance that was used to make the
current call is identified based on the first argument passed to the
method.

**CPython implementation detail:** In CPython 3.6 and later, the
"__class__" cell is passed to the metaclass as a "__classcell__" entry
in the class namespace. If present, this must be propagated up to the
"type.__new__" call in order for the class to be initialised
correctly. Failing to do so will result in a "RuntimeError" in Python
3.8.

When using the default metaclass "type", or any metaclass that
ultimately calls "type.__new__", the following additional
customisation steps are invoked after creating the class object:

* first, "type.__new__" collects all of the descriptors in the class
  namespace that define a "__set_name__()" method;

* second, all of these "__set_name__" methods are called with the
  class being defined and the assigned name of that particular
  descriptor;

* finally, the "__init_subclass__()" hook is called on the immediate
  parent of the new class in its method resolution order.

After the class object is created, it is passed to the class
decorators included in the class definition (if any) and the resulting
object is bound in the local namespace as the defined class.

When a new class is created by "type.__new__", the object provided as
the namespace parameter is copied to a new ordered mapping and the
original object is discarded. The new copy is wrapped in a read-only
proxy, which becomes the "__dict__" attribute of the class object.

See also:

  **PEP 3135** - New super
     Describes the implicit "__class__" closure reference


Uses for metaclasses
--------------------

The potential uses for metaclasses are boundless. Some ideas that have
been explored include enum, logging, interface checking, automatic
delegation, automatic property creation, proxies, frameworks, and
automatic resource locking/synchronization.


Customizing instance and subclass checks
========================================

The following methods are used to override the default behavior of the
"isinstance()" and "issubclass()" built-in functions.

In particular, the metaclass "abc.ABCMeta" implements these methods in
order to allow the addition of Abstract Base Classes (ABCs) as
“virtual base classes” to any class or type (including built-in
types), including other ABCs.

class.__instancecheck__(self, instance)

   Return true if *instance* should be considered a (direct or
   indirect) instance of *class*. If defined, called to implement
   "isinstance(instance, class)".

class.__subclasscheck__(self, subclass)

   Return true if *subclass* should be considered a (direct or
   indirect) subclass of *class*.  If defined, called to implement
   "issubclass(subclass, class)".

Note that these methods are looked up on the type (metaclass) of a
class.  They cannot be defined as class methods in the actual class.
This is consistent with the lookup of special methods that are called
on instances, only in this case the instance is itself a class.

See also:

  **PEP 3119** - Introducing Abstract Base Classes
     Includes the specification for customizing "isinstance()" and
     "issubclass()" behavior through "__instancecheck__()" and
     "__subclasscheck__()", with motivation for this functionality in
     the context of adding Abstract Base Classes (see the "abc"
     module) to the language.


Emulating generic types
=======================

One can implement the generic class syntax as specified by **PEP 484**
(for example "List[int]") by defining a special method:

classmethod object.__class_getitem__(cls, key)

   Return an object representing the specialization of a generic class
   by type arguments found in *key*.

This method is looked up on the class object itself, and when defined
in the class body, this method is implicitly a class method.  Note,
this mechanism is primarily reserved for use with static type hints,
other usage is discouraged.

See also:

  **PEP 560** - Core support for typing module and generic types


Emulating callable objects
==========================

object.__call__(self[, args...])

   Called when the instance is “called” as a function; if this method
   is defined, "x(arg1, arg2, ...)" roughly translates to
   "type(x).__call__(x, arg1, ...)".


Emulating container types
=========================

The following methods can be defined to implement container objects.
Containers usually are sequences (such as lists or tuples) or mappings
(like dictionaries), but can represent other containers as well.  The
first set of methods is used either to emulate a sequence or to
emulate a mapping; the difference is that for a sequence, the
allowable keys should be the integers *k* for which "0 <= k < N" where
*N* is the length of the sequence, or slice objects, which define a
range of items.  It is also recommended that mappings provide the
methods "keys()", "values()", "items()", "get()", "clear()",
"setdefault()", "pop()", "popitem()", "copy()", and "update()"
behaving similar to those for Python’s standard dictionary objects.
The "collections.abc" module provides a "MutableMapping" abstract base
class to help create those methods from a base set of "__getitem__()",
"__setitem__()", "__delitem__()", and "keys()". Mutable sequences
should provide methods "append()", "count()", "index()", "extend()",
"insert()", "pop()", "remove()", "reverse()" and "sort()", like Python
standard list objects.  Finally, sequence types should implement
addition (meaning concatenation) and multiplication (meaning
repetition) by defining the methods "__add__()", "__radd__()",
"__iadd__()", "__mul__()", "__rmul__()" and "__imul__()" described
below; they should not define other numerical operators.  It is
recommended that both mappings and sequences implement the
"__contains__()" method to allow efficient use of the "in" operator;
for mappings, "in" should search the mapping’s keys; for sequences, it
should search through the values.  It is further recommended that both
mappings and sequences implement the "__iter__()" method to allow
efficient iteration through the container; for mappings, "__iter__()"
should iterate through the object’s keys; for sequences, it should
iterate through the values.

object.__len__(self)

   Called to implement the built-in function "len()".  Should return
   the length of the object, an integer ">=" 0.  Also, an object that
   doesn’t define a "__bool__()" method and whose "__len__()" method
   returns zero is considered to be false in a Boolean context.

   **CPython implementation detail:** In CPython, the length is
   required to be at most "sys.maxsize". If the length is larger than
   "sys.maxsize" some features (such as "len()") may raise
   "OverflowError".  To prevent raising "OverflowError" by truth value
   testing, an object must define a "__bool__()" method.

object.__length_hint__(self)

   Called to implement "operator.length_hint()". Should return an
   estimated length for the object (which may be greater or less than
   the actual length). The length must be an integer ">=" 0. The
   return value may also be "NotImplemented", which is treated the
   same as if the "__length_hint__" method didn’t exist at all. This
   method is purely an optimization and is never required for
   correctness.

   New in version 3.4.

Note:

  Slicing is done exclusively with the following three methods.  A
  call like

     a[1:2] = b

  is translated to

     a[slice(1, 2, None)] = b

  and so forth.  Missing slice items are always filled in with "None".

object.__getitem__(self, key)

   Called to implement evaluation of "self[key]". For sequence types,
   the accepted keys should be integers and slice objects.  Note that
   the special interpretation of negative indexes (if the class wishes
   to emulate a sequence type) is up to the "__getitem__()" method. If
   *key* is of an inappropriate type, "TypeError" may be raised; if of
   a value outside the set of indexes for the sequence (after any
   special interpretation of negative values), "IndexError" should be
   raised. For mapping types, if *key* is missing (not in the
   container), "KeyError" should be raised.

   Note:

     "for" loops expect that an "IndexError" will be raised for
     illegal indexes to allow proper detection of the end of the
     sequence.

object.__setitem__(self, key, value)

   Called to implement assignment to "self[key]".  Same note as for
   "__getitem__()".  This should only be implemented for mappings if
   the objects support changes to the values for keys, or if new keys
   can be added, or for sequences if elements can be replaced.  The
   same exceptions should be raised for improper *key* values as for
   the "__getitem__()" method.

object.__delitem__(self, key)

   Called to implement deletion of "self[key]".  Same note as for
   "__getitem__()".  This should only be implemented for mappings if
   the objects support removal of keys, or for sequences if elements
   can be removed from the sequence.  The same exceptions should be
   raised for improper *key* values as for the "__getitem__()" method.

object.__missing__(self, key)

   Called by "dict"."__getitem__()" to implement "self[key]" for dict
   subclasses when key is not in the dictionary.

object.__iter__(self)

   This method is called when an iterator is required for a container.
   This method should return a new iterator object that can iterate
   over all the objects in the container.  For mappings, it should
   iterate over the keys of the container.

   Iterator objects also need to implement this method; they are
   required to return themselves.  For more information on iterator
   objects, see Iterator Types.

object.__reversed__(self)

   Called (if present) by the "reversed()" built-in to implement
   reverse iteration.  It should return a new iterator object that
   iterates over all the objects in the container in reverse order.

   If the "__reversed__()" method is not provided, the "reversed()"
   built-in will fall back to using the sequence protocol ("__len__()"
   and "__getitem__()").  Objects that support the sequence protocol
   should only provide "__reversed__()" if they can provide an
   implementation that is more efficient than the one provided by
   "reversed()".

The membership test operators ("in" and "not in") are normally
implemented as an iteration through a container. However, container
objects can supply the following special method with a more efficient
implementation, which also does not require the object be iterable.

object.__contains__(self, item)

   Called to implement membership test operators.  Should return true
   if *item* is in *self*, false otherwise.  For mapping objects, this
   should consider the keys of the mapping rather than the values or
   the key-item pairs.

   For objects that don’t define "__contains__()", the membership test
   first tries iteration via "__iter__()", then the old sequence
   iteration protocol via "__getitem__()", see this section in the
   language reference.


Emulating numeric types
=======================

The following methods can be defined to emulate numeric objects.
Methods corresponding to operations that are not supported by the
particular kind of number implemented (e.g., bitwise operations for
non-integral numbers) should be left undefined.

object.__add__(self, other)
object.__sub__(self, other)
object.__mul__(self, other)
object.__matmul__(self, other)
object.__truediv__(self, other)
object.__floordiv__(self, other)
object.__mod__(self, other)
object.__divmod__(self, other)
object.__pow__(self, other[, modulo])
object.__lshift__(self, other)
object.__rshift__(self, other)
object.__and__(self, other)
object.__xor__(self, other)
object.__or__(self, other)

   These methods are called to implement the binary arithmetic
   operations ("+", "-", "*", "@", "/", "//", "%", "divmod()",
   "pow()", "**", "<<", ">>", "&", "^", "|").  For instance, to
   evaluate the expression "x + y", where *x* is an instance of a
   class that has an "__add__()" method, "x.__add__(y)" is called.
   The "__divmod__()" method should be the equivalent to using
   "__floordiv__()" and "__mod__()"; it should not be related to
   "__truediv__()".  Note that "__pow__()" should be defined to accept
   an optional third argument if the ternary version of the built-in
   "pow()" function is to be supported.

   If one of those methods does not support the operation with the
   supplied arguments, it should return "NotImplemented".

object.__radd__(self, other)
object.__rsub__(self, other)
object.__rmul__(self, other)
object.__rmatmul__(self, other)
object.__rtruediv__(self, other)
object.__rfloordiv__(self, other)
object.__rmod__(self, other)
object.__rdivmod__(self, other)
object.__rpow__(self, other[, modulo])
object.__rlshift__(self, other)
object.__rrshift__(self, other)
object.__rand__(self, other)
object.__rxor__(self, other)
object.__ror__(self, other)

   These methods are called to implement the binary arithmetic
   operations ("+", "-", "*", "@", "/", "//", "%", "divmod()",
   "pow()", "**", "<<", ">>", "&", "^", "|") with reflected (swapped)
   operands.  These functions are only called if the left operand does
   not support the corresponding operation [3] and the operands are of
   different types. [4] For instance, to evaluate the expression "x -
   y", where *y* is an instance of a class that has an "__rsub__()"
   method, "y.__rsub__(x)" is called if "x.__sub__(y)" returns
   *NotImplemented*.

   Note that ternary "pow()" will not try calling "__rpow__()" (the
   coercion rules would become too complicated).

   Note:

     If the right operand’s type is a subclass of the left operand’s
     type and that subclass provides a different implementation of the
     reflected method for the operation, this method will be called
     before the left operand’s non-reflected method. This behavior
     allows subclasses to override their ancestors’ operations.

object.__iadd__(self, other)
object.__isub__(self, other)
object.__imul__(self, other)
object.__imatmul__(self, other)
object.__itruediv__(self, other)
object.__ifloordiv__(self, other)
object.__imod__(self, other)
object.__ipow__(self, other[, modulo])
object.__ilshift__(self, other)
object.__irshift__(self, other)
object.__iand__(self, other)
object.__ixor__(self, other)
object.__ior__(self, other)

   These methods are called to implement the augmented arithmetic
   assignments ("+=", "-=", "*=", "@=", "/=", "//=", "%=", "**=",
   "<<=", ">>=", "&=", "^=", "|=").  These methods should attempt to
   do the operation in-place (modifying *self*) and return the result
   (which could be, but does not have to be, *self*).  If a specific
   method is not defined, the augmented assignment falls back to the
   normal methods.  For instance, if *x* is an instance of a class
   with an "__iadd__()" method, "x += y" is equivalent to "x =
   x.__iadd__(y)" . Otherwise, "x.__add__(y)" and "y.__radd__(x)" are
   considered, as with the evaluation of "x + y". In certain
   situations, augmented assignment can result in unexpected errors
   (see Why does a_tuple[i] += [‘item’] raise an exception when the
   addition works?), but this behavior is in fact part of the data
   model.

   Note:

     Due to a bug in the dispatching mechanism for "**=", a class that
     defines "__ipow__()" but returns "NotImplemented" would fail to
     fall back to "x.__pow__(y)" and "y.__rpow__(x)". This bug is
     fixed in Python 3.10.

object.__neg__(self)
object.__pos__(self)
object.__abs__(self)
object.__invert__(self)

   Called to implement the unary arithmetic operations ("-", "+",
   "abs()" and "~").

object.__complex__(self)
object.__int__(self)
object.__float__(self)

   Called to implement the built-in functions "complex()", "int()" and
   "float()".  Should return a value of the appropriate type.

object.__index__(self)

   Called to implement "operator.index()", and whenever Python needs
   to losslessly convert the numeric object to an integer object (such
   as in slicing, or in the built-in "bin()", "hex()" and "oct()"
   functions). Presence of this method indicates that the numeric
   object is an integer type.  Must return an integer.

   If "__int__()", "__float__()" and "__complex__()" are not defined
   then corresponding built-in functions "int()", "float()" and
   "complex()" fall back to "__index__()".

object.__round__(self[, ndigits])
object.__trunc__(self)
object.__floor__(self)
object.__ceil__(self)

   Called to implement the built-in function "round()" and "math"
   functions "trunc()", "floor()" and "ceil()". Unless *ndigits* is
   passed to "__round__()" all these methods should return the value
   of the object truncated to an "Integral" (typically an "int").

   The built-in function "int()" falls back to "__trunc__()" if
   neither "__int__()" nor "__index__()" is defined.


With Statement Context Managers
===============================

A *context manager* is an object that defines the runtime context to
be established when executing a "with" statement. The context manager
handles the entry into, and the exit from, the desired runtime context
for the execution of the block of code.  Context managers are normally
invoked using the "with" statement (described in section The with
statement), but can also be used by directly invoking their methods.

Typical uses of context managers include saving and restoring various
kinds of global state, locking and unlocking resources, closing opened
files, etc.

For more information on context managers, see Context Manager Types.

object.__enter__(self)

   Enter the runtime context related to this object. The "with"
   statement will bind this method’s return value to the target(s)
   specified in the "as" clause of the statement, if any.

object.__exit__(self, exc_type, exc_value, traceback)

   Exit the runtime context related to this object. The parameters
   describe the exception that caused the context to be exited. If the
   context was exited without an exception, all three arguments will
   be "None".

   If an exception is supplied, and the method wishes to suppress the
   exception (i.e., prevent it from being propagated), it should
   return a true value. Otherwise, the exception will be processed
   normally upon exit from this method.

   Note that "__exit__()" methods should not reraise the passed-in
   exception; this is the caller’s responsibility.

See also:

  **PEP 343** - The “with” statement
     The specification, background, and examples for the Python "with"
     statement.


Special method lookup
=====================

For custom classes, implicit invocations of special methods are only
guaranteed to work correctly if defined on an object’s type, not in
the object’s instance dictionary.  That behaviour is the reason why
the following code raises an exception:

   >>> class C:
   ...     pass
   ...
   >>> c = C()
   >>> c.__len__ = lambda: 5
   >>> len(c)
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
   TypeError: object of type 'C' has no len()

The rationale behind this behaviour lies with a number of special
methods such as "__hash__()" and "__repr__()" that are implemented by
all objects, including type objects. If the implicit lookup of these
methods used the conventional lookup process, they would fail when
invoked on the type object itself:

   >>> 1 .__hash__() == hash(1)
   True
   >>> int.__hash__() == hash(int)
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
   TypeError: descriptor '__hash__' of 'int' object needs an argument

Incorrectly attempting to invoke an unbound method of a class in this
way is sometimes referred to as ‘metaclass confusion’, and is avoided
by bypassing the instance when looking up special methods:

   >>> type(1).__hash__(1) == hash(1)
   True
   >>> type(int).__hash__(int) == hash(int)
   True

In addition to bypassing any instance attributes in the interest of
correctness, implicit special method lookup generally also bypasses
the "__getattribute__()" method even of the object’s metaclass:

   >>> class Meta(type):
   ...     def __getattribute__(*args):
   ...         print("Metaclass getattribute invoked")
   ...         return type.__getattribute__(*args)
   ...
   >>> class C(object, metaclass=Meta):
   ...     def __len__(self):
   ...         return 10
   ...     def __getattribute__(*args):
   ...         print("Class getattribute invoked")
   ...         return object.__getattribute__(*args)
   ...
   >>> c = C()
   >>> c.__len__()                 # Explicit lookup via instance
   Class getattribute invoked
   10
   >>> type(c).__len__(c)          # Explicit lookup via type
   Metaclass getattribute invoked
   10
   >>> len(c)                      # Implicit lookup
   10

Bypassing the "__getattribute__()" machinery in this fashion provides
significant scope for speed optimisations within the interpreter, at
the cost of some flexibility in the handling of special methods (the
special method *must* be set on the class object itself in order to be
consistently invoked by the interpreter).
u�YString Methods
**************

Strings implement all of the common sequence operations, along with
the additional methods described below.

Strings also support two styles of string formatting, one providing a
large degree of flexibility and customization (see "str.format()",
Format String Syntax and Custom String Formatting) and the other based
on C "printf" style formatting that handles a narrower range of types
and is slightly harder to use correctly, but is often faster for the
cases it can handle (printf-style String Formatting).

The Text Processing Services section of the standard library covers a
number of other modules that provide various text related utilities
(including regular expression support in the "re" module).

str.capitalize()

   Return a copy of the string with its first character capitalized
   and the rest lowercased.

   Changed in version 3.8: The first character is now put into
   titlecase rather than uppercase. This means that characters like
   digraphs will only have their first letter capitalized, instead of
   the full character.

str.casefold()

   Return a casefolded copy of the string. Casefolded strings may be
   used for caseless matching.

   Casefolding is similar to lowercasing but more aggressive because
   it is intended to remove all case distinctions in a string. For
   example, the German lowercase letter "'ß'" is equivalent to ""ss"".
   Since it is already lowercase, "lower()" would do nothing to "'ß'";
   "casefold()" converts it to ""ss"".

   The casefolding algorithm is described in section 3.13 of the
   Unicode Standard.

   New in version 3.3.

str.center(width[, fillchar])

   Return centered in a string of length *width*. Padding is done
   using the specified *fillchar* (default is an ASCII space). The
   original string is returned if *width* is less than or equal to
   "len(s)".

str.count(sub[, start[, end]])

   Return the number of non-overlapping occurrences of substring *sub*
   in the range [*start*, *end*].  Optional arguments *start* and
   *end* are interpreted as in slice notation.

str.encode(encoding="utf-8", errors="strict")

   Return an encoded version of the string as a bytes object. Default
   encoding is "'utf-8'". *errors* may be given to set a different
   error handling scheme. The default for *errors* is "'strict'",
   meaning that encoding errors raise a "UnicodeError". Other possible
   values are "'ignore'", "'replace'", "'xmlcharrefreplace'",
   "'backslashreplace'" and any other name registered via
   "codecs.register_error()", see section Error Handlers. For a list
   of possible encodings, see section Standard Encodings.

   Changed in version 3.1: Support for keyword arguments added.

str.endswith(suffix[, start[, end]])

   Return "True" if the string ends with the specified *suffix*,
   otherwise return "False".  *suffix* can also be a tuple of suffixes
   to look for.  With optional *start*, test beginning at that
   position.  With optional *end*, stop comparing at that position.

str.expandtabs(tabsize=8)

   Return a copy of the string where all tab characters are replaced
   by one or more spaces, depending on the current column and the
   given tab size.  Tab positions occur every *tabsize* characters
   (default is 8, giving tab positions at columns 0, 8, 16 and so on).
   To expand the string, the current column is set to zero and the
   string is examined character by character.  If the character is a
   tab ("\t"), one or more space characters are inserted in the result
   until the current column is equal to the next tab position. (The
   tab character itself is not copied.)  If the character is a newline
   ("\n") or return ("\r"), it is copied and the current column is
   reset to zero.  Any other character is copied unchanged and the
   current column is incremented by one regardless of how the
   character is represented when printed.

   >>> '01\t012\t0123\t01234'.expandtabs()
   '01      012     0123    01234'
   >>> '01\t012\t0123\t01234'.expandtabs(4)
   '01  012 0123    01234'

str.find(sub[, start[, end]])

   Return the lowest index in the string where substring *sub* is
   found within the slice "s[start:end]".  Optional arguments *start*
   and *end* are interpreted as in slice notation.  Return "-1" if
   *sub* is not found.

   Note:

     The "find()" method should be used only if you need to know the
     position of *sub*.  To check if *sub* is a substring or not, use
     the "in" operator:

        >>> 'Py' in 'Python'
        True

str.format(*args, **kwargs)

   Perform a string formatting operation.  The string on which this
   method is called can contain literal text or replacement fields
   delimited by braces "{}".  Each replacement field contains either
   the numeric index of a positional argument, or the name of a
   keyword argument.  Returns a copy of the string where each
   replacement field is replaced with the string value of the
   corresponding argument.

   >>> "The sum of 1 + 2 is {0}".format(1+2)
   'The sum of 1 + 2 is 3'

   See Format String Syntax for a description of the various
   formatting options that can be specified in format strings.

   Note:

     When formatting a number ("int", "float", "complex",
     "decimal.Decimal" and subclasses) with the "n" type (ex:
     "'{:n}'.format(1234)"), the function temporarily sets the
     "LC_CTYPE" locale to the "LC_NUMERIC" locale to decode
     "decimal_point" and "thousands_sep" fields of "localeconv()" if
     they are non-ASCII or longer than 1 byte, and the "LC_NUMERIC"
     locale is different than the "LC_CTYPE" locale.  This temporary
     change affects other threads.

   Changed in version 3.7: When formatting a number with the "n" type,
   the function sets temporarily the "LC_CTYPE" locale to the
   "LC_NUMERIC" locale in some cases.

str.format_map(mapping)

   Similar to "str.format(**mapping)", except that "mapping" is used
   directly and not copied to a "dict".  This is useful if for example
   "mapping" is a dict subclass:

   >>> class Default(dict):
   ...     def __missing__(self, key):
   ...         return key
   ...
   >>> '{name} was born in {country}'.format_map(Default(name='Guido'))
   'Guido was born in country'

   New in version 3.2.

str.index(sub[, start[, end]])

   Like "find()", but raise "ValueError" when the substring is not
   found.

str.isalnum()

   Return "True" if all characters in the string are alphanumeric and
   there is at least one character, "False" otherwise.  A character
   "c" is alphanumeric if one of the following returns "True":
   "c.isalpha()", "c.isdecimal()", "c.isdigit()", or "c.isnumeric()".

str.isalpha()

   Return "True" if all characters in the string are alphabetic and
   there is at least one character, "False" otherwise.  Alphabetic
   characters are those characters defined in the Unicode character
   database as “Letter”, i.e., those with general category property
   being one of “Lm”, “Lt”, “Lu”, “Ll”, or “Lo”.  Note that this is
   different from the “Alphabetic” property defined in the Unicode
   Standard.

str.isascii()

   Return "True" if the string is empty or all characters in the
   string are ASCII, "False" otherwise. ASCII characters have code
   points in the range U+0000-U+007F.

   New in version 3.7.

str.isdecimal()

   Return "True" if all characters in the string are decimal
   characters and there is at least one character, "False" otherwise.
   Decimal characters are those that can be used to form numbers in
   base 10, e.g. U+0660, ARABIC-INDIC DIGIT ZERO.  Formally a decimal
   character is a character in the Unicode General Category “Nd”.

str.isdigit()

   Return "True" if all characters in the string are digits and there
   is at least one character, "False" otherwise.  Digits include
   decimal characters and digits that need special handling, such as
   the compatibility superscript digits. This covers digits which
   cannot be used to form numbers in base 10, like the Kharosthi
   numbers.  Formally, a digit is a character that has the property
   value Numeric_Type=Digit or Numeric_Type=Decimal.

str.isidentifier()

   Return "True" if the string is a valid identifier according to the
   language definition, section Identifiers and keywords.

   Call "keyword.iskeyword()" to test whether string "s" is a reserved
   identifier, such as "def" and "class".

   Example:

      >>> from keyword import iskeyword

      >>> 'hello'.isidentifier(), iskeyword('hello')
      True, False
      >>> 'def'.isidentifier(), iskeyword('def')
      True, True

str.islower()

   Return "True" if all cased characters [4] in the string are
   lowercase and there is at least one cased character, "False"
   otherwise.

str.isnumeric()

   Return "True" if all characters in the string are numeric
   characters, and there is at least one character, "False" otherwise.
   Numeric characters include digit characters, and all characters
   that have the Unicode numeric value property, e.g. U+2155, VULGAR
   FRACTION ONE FIFTH.  Formally, numeric characters are those with
   the property value Numeric_Type=Digit, Numeric_Type=Decimal or
   Numeric_Type=Numeric.

str.isprintable()

   Return "True" if all characters in the string are printable or the
   string is empty, "False" otherwise.  Nonprintable characters are
   those characters defined in the Unicode character database as
   “Other” or “Separator”, excepting the ASCII space (0x20) which is
   considered printable.  (Note that printable characters in this
   context are those which should not be escaped when "repr()" is
   invoked on a string.  It has no bearing on the handling of strings
   written to "sys.stdout" or "sys.stderr".)

str.isspace()

   Return "True" if there are only whitespace characters in the string
   and there is at least one character, "False" otherwise.

   A character is *whitespace* if in the Unicode character database
   (see "unicodedata"), either its general category is "Zs"
   (“Separator, space”), or its bidirectional class is one of "WS",
   "B", or "S".

str.istitle()

   Return "True" if the string is a titlecased string and there is at
   least one character, for example uppercase characters may only
   follow uncased characters and lowercase characters only cased ones.
   Return "False" otherwise.

str.isupper()

   Return "True" if all cased characters [4] in the string are
   uppercase and there is at least one cased character, "False"
   otherwise.

str.join(iterable)

   Return a string which is the concatenation of the strings in
   *iterable*. A "TypeError" will be raised if there are any non-
   string values in *iterable*, including "bytes" objects.  The
   separator between elements is the string providing this method.

str.ljust(width[, fillchar])

   Return the string left justified in a string of length *width*.
   Padding is done using the specified *fillchar* (default is an ASCII
   space). The original string is returned if *width* is less than or
   equal to "len(s)".

str.lower()

   Return a copy of the string with all the cased characters [4]
   converted to lowercase.

   The lowercasing algorithm used is described in section 3.13 of the
   Unicode Standard.

str.lstrip([chars])

   Return a copy of the string with leading characters removed.  The
   *chars* argument is a string specifying the set of characters to be
   removed.  If omitted or "None", the *chars* argument defaults to
   removing whitespace.  The *chars* argument is not a prefix; rather,
   all combinations of its values are stripped:

      >>> '   spacious   '.lstrip()
      'spacious   '
      >>> 'www.example.com'.lstrip('cmowz.')
      'example.com'

static str.maketrans(x[, y[, z]])

   This static method returns a translation table usable for
   "str.translate()".

   If there is only one argument, it must be a dictionary mapping
   Unicode ordinals (integers) or characters (strings of length 1) to
   Unicode ordinals, strings (of arbitrary lengths) or "None".
   Character keys will then be converted to ordinals.

   If there are two arguments, they must be strings of equal length,
   and in the resulting dictionary, each character in x will be mapped
   to the character at the same position in y.  If there is a third
   argument, it must be a string, whose characters will be mapped to
   "None" in the result.

str.partition(sep)

   Split the string at the first occurrence of *sep*, and return a
   3-tuple containing the part before the separator, the separator
   itself, and the part after the separator.  If the separator is not
   found, return a 3-tuple containing the string itself, followed by
   two empty strings.

str.replace(old, new[, count])

   Return a copy of the string with all occurrences of substring *old*
   replaced by *new*.  If the optional argument *count* is given, only
   the first *count* occurrences are replaced.

str.rfind(sub[, start[, end]])

   Return the highest index in the string where substring *sub* is
   found, such that *sub* is contained within "s[start:end]".
   Optional arguments *start* and *end* are interpreted as in slice
   notation.  Return "-1" on failure.

str.rindex(sub[, start[, end]])

   Like "rfind()" but raises "ValueError" when the substring *sub* is
   not found.

str.rjust(width[, fillchar])

   Return the string right justified in a string of length *width*.
   Padding is done using the specified *fillchar* (default is an ASCII
   space). The original string is returned if *width* is less than or
   equal to "len(s)".

str.rpartition(sep)

   Split the string at the last occurrence of *sep*, and return a
   3-tuple containing the part before the separator, the separator
   itself, and the part after the separator.  If the separator is not
   found, return a 3-tuple containing two empty strings, followed by
   the string itself.

str.rsplit(sep=None, maxsplit=-1)

   Return a list of the words in the string, using *sep* as the
   delimiter string. If *maxsplit* is given, at most *maxsplit* splits
   are done, the *rightmost* ones.  If *sep* is not specified or
   "None", any whitespace string is a separator.  Except for splitting
   from the right, "rsplit()" behaves like "split()" which is
   described in detail below.

str.rstrip([chars])

   Return a copy of the string with trailing characters removed.  The
   *chars* argument is a string specifying the set of characters to be
   removed.  If omitted or "None", the *chars* argument defaults to
   removing whitespace.  The *chars* argument is not a suffix; rather,
   all combinations of its values are stripped:

      >>> '   spacious   '.rstrip()
      '   spacious'
      >>> 'mississippi'.rstrip('ipz')
      'mississ'

str.split(sep=None, maxsplit=-1)

   Return a list of the words in the string, using *sep* as the
   delimiter string.  If *maxsplit* is given, at most *maxsplit*
   splits are done (thus, the list will have at most "maxsplit+1"
   elements).  If *maxsplit* is not specified or "-1", then there is
   no limit on the number of splits (all possible splits are made).

   If *sep* is given, consecutive delimiters are not grouped together
   and are deemed to delimit empty strings (for example,
   "'1,,2'.split(',')" returns "['1', '', '2']").  The *sep* argument
   may consist of multiple characters (for example,
   "'1<>2<>3'.split('<>')" returns "['1', '2', '3']"). Splitting an
   empty string with a specified separator returns "['']".

   For example:

      >>> '1,2,3'.split(',')
      ['1', '2', '3']
      >>> '1,2,3'.split(',', maxsplit=1)
      ['1', '2,3']
      >>> '1,2,,3,'.split(',')
      ['1', '2', '', '3', '']

   If *sep* is not specified or is "None", a different splitting
   algorithm is applied: runs of consecutive whitespace are regarded
   as a single separator, and the result will contain no empty strings
   at the start or end if the string has leading or trailing
   whitespace.  Consequently, splitting an empty string or a string
   consisting of just whitespace with a "None" separator returns "[]".

   For example:

      >>> '1 2 3'.split()
      ['1', '2', '3']
      >>> '1 2 3'.split(maxsplit=1)
      ['1', '2 3']
      >>> '   1   2   3   '.split()
      ['1', '2', '3']

str.splitlines([keepends])

   Return a list of the lines in the string, breaking at line
   boundaries.  Line breaks are not included in the resulting list
   unless *keepends* is given and true.

   This method splits on the following line boundaries.  In
   particular, the boundaries are a superset of *universal newlines*.

   +-------------------------+-------------------------------+
   | Representation          | Description                   |
   |=========================|===============================|
   | "\n"                    | Line Feed                     |
   +-------------------------+-------------------------------+
   | "\r"                    | Carriage Return               |
   +-------------------------+-------------------------------+
   | "\r\n"                  | Carriage Return + Line Feed   |
   +-------------------------+-------------------------------+
   | "\v" or "\x0b"          | Line Tabulation               |
   +-------------------------+-------------------------------+
   | "\f" or "\x0c"          | Form Feed                     |
   +-------------------------+-------------------------------+
   | "\x1c"                  | File Separator                |
   +-------------------------+-------------------------------+
   | "\x1d"                  | Group Separator               |
   +-------------------------+-------------------------------+
   | "\x1e"                  | Record Separator              |
   +-------------------------+-------------------------------+
   | "\x85"                  | Next Line (C1 Control Code)   |
   +-------------------------+-------------------------------+
   | "\u2028"                | Line Separator                |
   +-------------------------+-------------------------------+
   | "\u2029"                | Paragraph Separator           |
   +-------------------------+-------------------------------+

   Changed in version 3.2: "\v" and "\f" added to list of line
   boundaries.

   For example:

      >>> 'ab c\n\nde fg\rkl\r\n'.splitlines()
      ['ab c', '', 'de fg', 'kl']
      >>> 'ab c\n\nde fg\rkl\r\n'.splitlines(keepends=True)
      ['ab c\n', '\n', 'de fg\r', 'kl\r\n']

   Unlike "split()" when a delimiter string *sep* is given, this
   method returns an empty list for the empty string, and a terminal
   line break does not result in an extra line:

      >>> "".splitlines()
      []
      >>> "One line\n".splitlines()
      ['One line']

   For comparison, "split('\n')" gives:

      >>> ''.split('\n')
      ['']
      >>> 'Two lines\n'.split('\n')
      ['Two lines', '']

str.startswith(prefix[, start[, end]])

   Return "True" if string starts with the *prefix*, otherwise return
   "False". *prefix* can also be a tuple of prefixes to look for.
   With optional *start*, test string beginning at that position.
   With optional *end*, stop comparing string at that position.

str.strip([chars])

   Return a copy of the string with the leading and trailing
   characters removed. The *chars* argument is a string specifying the
   set of characters to be removed. If omitted or "None", the *chars*
   argument defaults to removing whitespace. The *chars* argument is
   not a prefix or suffix; rather, all combinations of its values are
   stripped:

      >>> '   spacious   '.strip()
      'spacious'
      >>> 'www.example.com'.strip('cmowz.')
      'example'

   The outermost leading and trailing *chars* argument values are
   stripped from the string. Characters are removed from the leading
   end until reaching a string character that is not contained in the
   set of characters in *chars*. A similar action takes place on the
   trailing end. For example:

      >>> comment_string = '#....... Section 3.2.1 Issue #32 .......'
      >>> comment_string.strip('.#! ')
      'Section 3.2.1 Issue #32'

str.swapcase()

   Return a copy of the string with uppercase characters converted to
   lowercase and vice versa. Note that it is not necessarily true that
   "s.swapcase().swapcase() == s".

str.title()

   Return a titlecased version of the string where words start with an
   uppercase character and the remaining characters are lowercase.

   For example:

      >>> 'Hello world'.title()
      'Hello World'

   The algorithm uses a simple language-independent definition of a
   word as groups of consecutive letters.  The definition works in
   many contexts but it means that apostrophes in contractions and
   possessives form word boundaries, which may not be the desired
   result:

      >>> "they're bill's friends from the UK".title()
      "They'Re Bill'S Friends From The Uk"

   A workaround for apostrophes can be constructed using regular
   expressions:

      >>> import re
      >>> def titlecase(s):
      ...     return re.sub(r"[A-Za-z]+('[A-Za-z]+)?",
      ...                   lambda mo: mo.group(0).capitalize(),
      ...                   s)
      ...
      >>> titlecase("they're bill's friends.")
      "They're Bill's Friends."

str.translate(table)

   Return a copy of the string in which each character has been mapped
   through the given translation table.  The table must be an object
   that implements indexing via "__getitem__()", typically a *mapping*
   or *sequence*.  When indexed by a Unicode ordinal (an integer), the
   table object can do any of the following: return a Unicode ordinal
   or a string, to map the character to one or more other characters;
   return "None", to delete the character from the return string; or
   raise a "LookupError" exception, to map the character to itself.

   You can use "str.maketrans()" to create a translation map from
   character-to-character mappings in different formats.

   See also the "codecs" module for a more flexible approach to custom
   character mappings.

str.upper()

   Return a copy of the string with all the cased characters [4]
   converted to uppercase.  Note that "s.upper().isupper()" might be
   "False" if "s" contains uncased characters or if the Unicode
   category of the resulting character(s) is not “Lu” (Letter,
   uppercase), but e.g. “Lt” (Letter, titlecase).

   The uppercasing algorithm used is described in section 3.13 of the
   Unicode Standard.

str.zfill(width)

   Return a copy of the string left filled with ASCII "'0'" digits to
   make a string of length *width*. A leading sign prefix
   ("'+'"/"'-'") is handled by inserting the padding *after* the sign
   character rather than before. The original string is returned if
   *width* is less than or equal to "len(s)".

   For example:

      >>> "42".zfill(5)
      '00042'
      >>> "-42".zfill(5)
      '-0042'
u� String and Bytes literals
*************************

String literals are described by the following lexical definitions:

   stringliteral   ::= [stringprefix](shortstring | longstring)
   stringprefix    ::= "r" | "u" | "R" | "U" | "f" | "F"
                    | "fr" | "Fr" | "fR" | "FR" | "rf" | "rF" | "Rf" | "RF"
   shortstring     ::= "'" shortstringitem* "'" | '"' shortstringitem* '"'
   longstring      ::= "'''" longstringitem* "'''" | '"""' longstringitem* '"""'
   shortstringitem ::= shortstringchar | stringescapeseq
   longstringitem  ::= longstringchar | stringescapeseq
   shortstringchar ::= <any source character except "\" or newline or the quote>
   longstringchar  ::= <any source character except "\">
   stringescapeseq ::= "\" <any source character>

   bytesliteral   ::= bytesprefix(shortbytes | longbytes)
   bytesprefix    ::= "b" | "B" | "br" | "Br" | "bR" | "BR" | "rb" | "rB" | "Rb" | "RB"
   shortbytes     ::= "'" shortbytesitem* "'" | '"' shortbytesitem* '"'
   longbytes      ::= "'''" longbytesitem* "'''" | '"""' longbytesitem* '"""'
   shortbytesitem ::= shortbyteschar | bytesescapeseq
   longbytesitem  ::= longbyteschar | bytesescapeseq
   shortbyteschar ::= <any ASCII character except "\" or newline or the quote>
   longbyteschar  ::= <any ASCII character except "\">
   bytesescapeseq ::= "\" <any ASCII character>

One syntactic restriction not indicated by these productions is that
whitespace is not allowed between the "stringprefix" or "bytesprefix"
and the rest of the literal. The source character set is defined by
the encoding declaration; it is UTF-8 if no encoding declaration is
given in the source file; see section Encoding declarations.

In plain English: Both types of literals can be enclosed in matching
single quotes ("'") or double quotes (""").  They can also be enclosed
in matching groups of three single or double quotes (these are
generally referred to as *triple-quoted strings*).  The backslash
("\") character is used to escape characters that otherwise have a
special meaning, such as newline, backslash itself, or the quote
character.

Bytes literals are always prefixed with "'b'" or "'B'"; they produce
an instance of the "bytes" type instead of the "str" type.  They may
only contain ASCII characters; bytes with a numeric value of 128 or
greater must be expressed with escapes.

Both string and bytes literals may optionally be prefixed with a
letter "'r'" or "'R'"; such strings are called *raw strings* and treat
backslashes as literal characters.  As a result, in string literals,
"'\U'" and "'\u'" escapes in raw strings are not treated specially.
Given that Python 2.x’s raw unicode literals behave differently than
Python 3.x’s the "'ur'" syntax is not supported.

New in version 3.3: The "'rb'" prefix of raw bytes literals has been
added as a synonym of "'br'".

New in version 3.3: Support for the unicode legacy literal
("u'value'") was reintroduced to simplify the maintenance of dual
Python 2.x and 3.x codebases. See **PEP 414** for more information.

A string literal with "'f'" or "'F'" in its prefix is a *formatted
string literal*; see Formatted string literals.  The "'f'" may be
combined with "'r'", but not with "'b'" or "'u'", therefore raw
formatted strings are possible, but formatted bytes literals are not.

In triple-quoted literals, unescaped newlines and quotes are allowed
(and are retained), except that three unescaped quotes in a row
terminate the literal.  (A “quote” is the character used to open the
literal, i.e. either "'" or """.)

Unless an "'r'" or "'R'" prefix is present, escape sequences in string
and bytes literals are interpreted according to rules similar to those
used by Standard C.  The recognized escape sequences are:

+-------------------+-----------------------------------+---------+
| Escape Sequence   | Meaning                           | Notes   |
|===================|===================================|=========|
| "\newline"        | Backslash and newline ignored     |         |
+-------------------+-----------------------------------+---------+
| "\\"              | Backslash ("\")                   |         |
+-------------------+-----------------------------------+---------+
| "\'"              | Single quote ("'")                |         |
+-------------------+-----------------------------------+---------+
| "\""              | Double quote (""")                |         |
+-------------------+-----------------------------------+---------+
| "\a"              | ASCII Bell (BEL)                  |         |
+-------------------+-----------------------------------+---------+
| "\b"              | ASCII Backspace (BS)              |         |
+-------------------+-----------------------------------+---------+
| "\f"              | ASCII Formfeed (FF)               |         |
+-------------------+-----------------------------------+---------+
| "\n"              | ASCII Linefeed (LF)               |         |
+-------------------+-----------------------------------+---------+
| "\r"              | ASCII Carriage Return (CR)        |         |
+-------------------+-----------------------------------+---------+
| "\t"              | ASCII Horizontal Tab (TAB)        |         |
+-------------------+-----------------------------------+---------+
| "\v"              | ASCII Vertical Tab (VT)           |         |
+-------------------+-----------------------------------+---------+
| "\ooo"            | Character with octal value *ooo*  | (1,3)   |
+-------------------+-----------------------------------+---------+
| "\xhh"            | Character with hex value *hh*     | (2,3)   |
+-------------------+-----------------------------------+---------+

Escape sequences only recognized in string literals are:

+-------------------+-----------------------------------+---------+
| Escape Sequence   | Meaning                           | Notes   |
|===================|===================================|=========|
| "\N{name}"        | Character named *name* in the     | (4)     |
|                   | Unicode database                  |         |
+-------------------+-----------------------------------+---------+
| "\uxxxx"          | Character with 16-bit hex value   | (5)     |
|                   | *xxxx*                            |         |
+-------------------+-----------------------------------+---------+
| "\Uxxxxxxxx"      | Character with 32-bit hex value   | (6)     |
|                   | *xxxxxxxx*                        |         |
+-------------------+-----------------------------------+---------+

Notes:

1. As in Standard C, up to three octal digits are accepted.

2. Unlike in Standard C, exactly two hex digits are required.

3. In a bytes literal, hexadecimal and octal escapes denote the byte
   with the given value. In a string literal, these escapes denote a
   Unicode character with the given value.

4. Changed in version 3.3: Support for name aliases [1] has been
   added.

5. Exactly four hex digits are required.

6. Any Unicode character can be encoded this way.  Exactly eight hex
   digits are required.

Unlike Standard C, all unrecognized escape sequences are left in the
string unchanged, i.e., *the backslash is left in the result*.  (This
behavior is useful when debugging: if an escape sequence is mistyped,
the resulting output is more easily recognized as broken.)  It is also
important to note that the escape sequences only recognized in string
literals fall into the category of unrecognized escapes for bytes
literals.

   Changed in version 3.6: Unrecognized escape sequences produce a
   "DeprecationWarning".  In a future Python version they will be a
   "SyntaxWarning" and eventually a "SyntaxError".

Even in a raw literal, quotes can be escaped with a backslash, but the
backslash remains in the result; for example, "r"\""" is a valid
string literal consisting of two characters: a backslash and a double
quote; "r"\"" is not a valid string literal (even a raw string cannot
end in an odd number of backslashes).  Specifically, *a raw literal
cannot end in a single backslash* (since the backslash would escape
the following quote character).  Note also that a single backslash
followed by a newline is interpreted as those two characters as part
of the literal, *not* as a line continuation.
uMSubscriptions
*************

A subscription selects an item of a sequence (string, tuple or list)
or mapping (dictionary) object:

   subscription ::= primary "[" expression_list "]"

The primary must evaluate to an object that supports subscription
(lists or dictionaries for example).  User-defined objects can support
subscription by defining a "__getitem__()" method.

For built-in objects, there are two types of objects that support
subscription:

If the primary is a mapping, the expression list must evaluate to an
object whose value is one of the keys of the mapping, and the
subscription selects the value in the mapping that corresponds to that
key.  (The expression list is a tuple except if it has exactly one
item.)

If the primary is a sequence, the expression list must evaluate to an
integer or a slice (as discussed in the following section).

The formal syntax makes no special provision for negative indices in
sequences; however, built-in sequences all provide a "__getitem__()"
method that interprets negative indices by adding the length of the
sequence to the index (so that "x[-1]" selects the last item of "x").
The resulting value must be a nonnegative integer less than the number
of items in the sequence, and the subscription selects the item whose
index is that value (counting from zero). Since the support for
negative indices and slicing occurs in the object’s "__getitem__()"
method, subclasses overriding this method will need to explicitly add
that support.

A string’s items are characters.  A character is not a separate data
type but a string of exactly one character.
axTruth Value Testing
*******************

Any object can be tested for truth value, for use in an "if" or
"while" condition or as operand of the Boolean operations below.

By default, an object is considered true unless its class defines
either a "__bool__()" method that returns "False" or a "__len__()"
method that returns zero, when called with the object. [1]  Here are
most of the built-in objects considered false:

* constants defined to be false: "None" and "False".

* zero of any numeric type: "0", "0.0", "0j", "Decimal(0)",
  "Fraction(0, 1)"

* empty sequences and collections: "''", "()", "[]", "{}", "set()",
  "range(0)"

Operations and built-in functions that have a Boolean result always
return "0" or "False" for false and "1" or "True" for true, unless
otherwise stated. (Important exception: the Boolean operations "or"
and "and" always return one of their operands.)
uRThe "try" statement
*******************

The "try" statement specifies exception handlers and/or cleanup code
for a group of statements:

   try_stmt  ::= try1_stmt | try2_stmt
   try1_stmt ::= "try" ":" suite
                 ("except" [expression ["as" identifier]] ":" suite)+
                 ["else" ":" suite]
                 ["finally" ":" suite]
   try2_stmt ::= "try" ":" suite
                 "finally" ":" suite

The "except" clause(s) specify one or more exception handlers. When no
exception occurs in the "try" clause, no exception handler is
executed. When an exception occurs in the "try" suite, a search for an
exception handler is started.  This search inspects the except clauses
in turn until one is found that matches the exception.  An expression-
less except clause, if present, must be last; it matches any
exception.  For an except clause with an expression, that expression
is evaluated, and the clause matches the exception if the resulting
object is “compatible” with the exception.  An object is compatible
with an exception if it is the class or a base class of the exception
object, or a tuple containing an item that is the class or a base
class of the exception object.

If no except clause matches the exception, the search for an exception
handler continues in the surrounding code and on the invocation stack.
[1]

If the evaluation of an expression in the header of an except clause
raises an exception, the original search for a handler is canceled and
a search starts for the new exception in the surrounding code and on
the call stack (it is treated as if the entire "try" statement raised
the exception).

When a matching except clause is found, the exception is assigned to
the target specified after the "as" keyword in that except clause, if
present, and the except clause’s suite is executed.  All except
clauses must have an executable block.  When the end of this block is
reached, execution continues normally after the entire try statement.
(This means that if two nested handlers exist for the same exception,
and the exception occurs in the try clause of the inner handler, the
outer handler will not handle the exception.)

When an exception has been assigned using "as target", it is cleared
at the end of the except clause.  This is as if

   except E as N:
       foo

was translated to

   except E as N:
       try:
           foo
       finally:
           del N

This means the exception must be assigned to a different name to be
able to refer to it after the except clause.  Exceptions are cleared
because with the traceback attached to them, they form a reference
cycle with the stack frame, keeping all locals in that frame alive
until the next garbage collection occurs.

Before an except clause’s suite is executed, details about the
exception are stored in the "sys" module and can be accessed via
"sys.exc_info()". "sys.exc_info()" returns a 3-tuple consisting of the
exception class, the exception instance and a traceback object (see
section The standard type hierarchy) identifying the point in the
program where the exception occurred.  "sys.exc_info()" values are
restored to their previous values (before the call) when returning
from a function that handled an exception.

The optional "else" clause is executed if the control flow leaves the
"try" suite, no exception was raised, and no "return", "continue", or
"break" statement was executed.  Exceptions in the "else" clause are
not handled by the preceding "except" clauses.

If "finally" is present, it specifies a ‘cleanup’ handler.  The "try"
clause is executed, including any "except" and "else" clauses.  If an
exception occurs in any of the clauses and is not handled, the
exception is temporarily saved. The "finally" clause is executed.  If
there is a saved exception it is re-raised at the end of the "finally"
clause.  If the "finally" clause raises another exception, the saved
exception is set as the context of the new exception. If the "finally"
clause executes a "return", "break" or "continue" statement, the saved
exception is discarded:

   >>> def f():
   ...     try:
   ...         1/0
   ...     finally:
   ...         return 42
   ...
   >>> f()
   42

The exception information is not available to the program during
execution of the "finally" clause.

When a "return", "break" or "continue" statement is executed in the
"try" suite of a "try"…"finally" statement, the "finally" clause is
also executed ‘on the way out.’

The return value of a function is determined by the last "return"
statement executed.  Since the "finally" clause always executes, a
"return" statement executed in the "finally" clause will always be the
last one executed:

   >>> def foo():
   ...     try:
   ...         return 'try'
   ...     finally:
   ...         return 'finally'
   ...
   >>> foo()
   'finally'

Additional information on exceptions can be found in section
Exceptions, and information on using the "raise" statement to generate
exceptions may be found in section The raise statement.

Changed in version 3.8: Prior to Python 3.8, a "continue" statement
was illegal in the "finally" clause due to a problem with the
implementation.
ux�The standard type hierarchy
***************************

Below is a list of the types that are built into Python.  Extension
modules (written in C, Java, or other languages, depending on the
implementation) can define additional types.  Future versions of
Python may add types to the type hierarchy (e.g., rational numbers,
efficiently stored arrays of integers, etc.), although such additions
will often be provided via the standard library instead.

Some of the type descriptions below contain a paragraph listing
‘special attributes.’  These are attributes that provide access to the
implementation and are not intended for general use.  Their definition
may change in the future.

None
   This type has a single value.  There is a single object with this
   value. This object is accessed through the built-in name "None". It
   is used to signify the absence of a value in many situations, e.g.,
   it is returned from functions that don’t explicitly return
   anything. Its truth value is false.

NotImplemented
   This type has a single value.  There is a single object with this
   value. This object is accessed through the built-in name
   "NotImplemented". Numeric methods and rich comparison methods
   should return this value if they do not implement the operation for
   the operands provided.  (The interpreter will then try the
   reflected operation, or some other fallback, depending on the
   operator.)  Its truth value is true.

   See Implementing the arithmetic operations for more details.

Ellipsis
   This type has a single value.  There is a single object with this
   value. This object is accessed through the literal "..." or the
   built-in name "Ellipsis".  Its truth value is true.

"numbers.Number"
   These are created by numeric literals and returned as results by
   arithmetic operators and arithmetic built-in functions.  Numeric
   objects are immutable; once created their value never changes.
   Python numbers are of course strongly related to mathematical
   numbers, but subject to the limitations of numerical representation
   in computers.

   The string representations of the numeric classes, computed by
   "__repr__()" and "__str__()", have the following properties:

   * They are valid numeric literals which, when passed to their class
     constructor, produce an object having the value of the original
     numeric.

   * The representation is in base 10, when possible.

   * Leading zeros, possibly excepting a single zero before a decimal
     point, are not shown.

   * Trailing zeros, possibly excepting a single zero after a decimal
     point, are not shown.

   * A sign is shown only when the number is negative.

   Python distinguishes between integers, floating point numbers, and
   complex numbers:

   "numbers.Integral"
      These represent elements from the mathematical set of integers
      (positive and negative).

      There are two types of integers:

      Integers ("int")
         These represent numbers in an unlimited range, subject to
         available (virtual) memory only.  For the purpose of shift
         and mask operations, a binary representation is assumed, and
         negative numbers are represented in a variant of 2’s
         complement which gives the illusion of an infinite string of
         sign bits extending to the left.

      Booleans ("bool")
         These represent the truth values False and True.  The two
         objects representing the values "False" and "True" are the
         only Boolean objects. The Boolean type is a subtype of the
         integer type, and Boolean values behave like the values 0 and
         1, respectively, in almost all contexts, the exception being
         that when converted to a string, the strings ""False"" or
         ""True"" are returned, respectively.

      The rules for integer representation are intended to give the
      most meaningful interpretation of shift and mask operations
      involving negative integers.

   "numbers.Real" ("float")
      These represent machine-level double precision floating point
      numbers. You are at the mercy of the underlying machine
      architecture (and C or Java implementation) for the accepted
      range and handling of overflow. Python does not support single-
      precision floating point numbers; the savings in processor and
      memory usage that are usually the reason for using these are
      dwarfed by the overhead of using objects in Python, so there is
      no reason to complicate the language with two kinds of floating
      point numbers.

   "numbers.Complex" ("complex")
      These represent complex numbers as a pair of machine-level
      double precision floating point numbers.  The same caveats apply
      as for floating point numbers. The real and imaginary parts of a
      complex number "z" can be retrieved through the read-only
      attributes "z.real" and "z.imag".

Sequences
   These represent finite ordered sets indexed by non-negative
   numbers. The built-in function "len()" returns the number of items
   of a sequence. When the length of a sequence is *n*, the index set
   contains the numbers 0, 1, …, *n*-1.  Item *i* of sequence *a* is
   selected by "a[i]".

   Sequences also support slicing: "a[i:j]" selects all items with
   index *k* such that *i* "<=" *k* "<" *j*.  When used as an
   expression, a slice is a sequence of the same type.  This implies
   that the index set is renumbered so that it starts at 0.

   Some sequences also support “extended slicing” with a third “step”
   parameter: "a[i:j:k]" selects all items of *a* with index *x* where
   "x = i + n*k", *n* ">=" "0" and *i* "<=" *x* "<" *j*.

   Sequences are distinguished according to their mutability:

   Immutable sequences
      An object of an immutable sequence type cannot change once it is
      created.  (If the object contains references to other objects,
      these other objects may be mutable and may be changed; however,
      the collection of objects directly referenced by an immutable
      object cannot change.)

      The following types are immutable sequences:

      Strings
         A string is a sequence of values that represent Unicode code
         points. All the code points in the range "U+0000 - U+10FFFF"
         can be represented in a string.  Python doesn’t have a "char"
         type; instead, every code point in the string is represented
         as a string object with length "1".  The built-in function
         "ord()" converts a code point from its string form to an
         integer in the range "0 - 10FFFF"; "chr()" converts an
         integer in the range "0 - 10FFFF" to the corresponding length
         "1" string object. "str.encode()" can be used to convert a
         "str" to "bytes" using the given text encoding, and
         "bytes.decode()" can be used to achieve the opposite.

      Tuples
         The items of a tuple are arbitrary Python objects. Tuples of
         two or more items are formed by comma-separated lists of
         expressions.  A tuple of one item (a ‘singleton’) can be
         formed by affixing a comma to an expression (an expression by
         itself does not create a tuple, since parentheses must be
         usable for grouping of expressions).  An empty tuple can be
         formed by an empty pair of parentheses.

      Bytes
         A bytes object is an immutable array.  The items are 8-bit
         bytes, represented by integers in the range 0 <= x < 256.
         Bytes literals (like "b'abc'") and the built-in "bytes()"
         constructor can be used to create bytes objects.  Also, bytes
         objects can be decoded to strings via the "decode()" method.

   Mutable sequences
      Mutable sequences can be changed after they are created.  The
      subscription and slicing notations can be used as the target of
      assignment and "del" (delete) statements.

      There are currently two intrinsic mutable sequence types:

      Lists
         The items of a list are arbitrary Python objects.  Lists are
         formed by placing a comma-separated list of expressions in
         square brackets. (Note that there are no special cases needed
         to form lists of length 0 or 1.)

      Byte Arrays
         A bytearray object is a mutable array. They are created by
         the built-in "bytearray()" constructor.  Aside from being
         mutable (and hence unhashable), byte arrays otherwise provide
         the same interface and functionality as immutable "bytes"
         objects.

      The extension module "array" provides an additional example of a
      mutable sequence type, as does the "collections" module.

Set types
   These represent unordered, finite sets of unique, immutable
   objects. As such, they cannot be indexed by any subscript. However,
   they can be iterated over, and the built-in function "len()"
   returns the number of items in a set. Common uses for sets are fast
   membership testing, removing duplicates from a sequence, and
   computing mathematical operations such as intersection, union,
   difference, and symmetric difference.

   For set elements, the same immutability rules apply as for
   dictionary keys. Note that numeric types obey the normal rules for
   numeric comparison: if two numbers compare equal (e.g., "1" and
   "1.0"), only one of them can be contained in a set.

   There are currently two intrinsic set types:

   Sets
      These represent a mutable set. They are created by the built-in
      "set()" constructor and can be modified afterwards by several
      methods, such as "add()".

   Frozen sets
      These represent an immutable set.  They are created by the
      built-in "frozenset()" constructor.  As a frozenset is immutable
      and *hashable*, it can be used again as an element of another
      set, or as a dictionary key.

Mappings
   These represent finite sets of objects indexed by arbitrary index
   sets. The subscript notation "a[k]" selects the item indexed by "k"
   from the mapping "a"; this can be used in expressions and as the
   target of assignments or "del" statements. The built-in function
   "len()" returns the number of items in a mapping.

   There is currently a single intrinsic mapping type:

   Dictionaries
      These represent finite sets of objects indexed by nearly
      arbitrary values.  The only types of values not acceptable as
      keys are values containing lists or dictionaries or other
      mutable types that are compared by value rather than by object
      identity, the reason being that the efficient implementation of
      dictionaries requires a key’s hash value to remain constant.
      Numeric types used for keys obey the normal rules for numeric
      comparison: if two numbers compare equal (e.g., "1" and "1.0")
      then they can be used interchangeably to index the same
      dictionary entry.

      Dictionaries preserve insertion order, meaning that keys will be
      produced in the same order they were added sequentially over the
      dictionary. Replacing an existing key does not change the order,
      however removing a key and re-inserting it will add it to the
      end instead of keeping its old place.

      Dictionaries are mutable; they can be created by the "{...}"
      notation (see section Dictionary displays).

      The extension modules "dbm.ndbm" and "dbm.gnu" provide
      additional examples of mapping types, as does the "collections"
      module.

      Changed in version 3.7: Dictionaries did not preserve insertion
      order in versions of Python before 3.6. In CPython 3.6,
      insertion order was preserved, but it was considered an
      implementation detail at that time rather than a language
      guarantee.

Callable types
   These are the types to which the function call operation (see
   section Calls) can be applied:

   User-defined functions
      A user-defined function object is created by a function
      definition (see section Function definitions).  It should be
      called with an argument list containing the same number of items
      as the function’s formal parameter list.

      Special attributes:

      +---------------------------+---------------------------------+-------------+
      | Attribute                 | Meaning                         |             |
      |===========================|=================================|=============|
      | "__doc__"                 | The function’s documentation    | Writable    |
      |                           | string, or "None" if            |             |
      |                           | unavailable; not inherited by   |             |
      |                           | subclasses.                     |             |
      +---------------------------+---------------------------------+-------------+
      | "__name__"                | The function’s name.            | Writable    |
      +---------------------------+---------------------------------+-------------+
      | "__qualname__"            | The function’s *qualified       | Writable    |
      |                           | name*.  New in version 3.3.     |             |
      +---------------------------+---------------------------------+-------------+
      | "__module__"              | The name of the module the      | Writable    |
      |                           | function was defined in, or     |             |
      |                           | "None" if unavailable.          |             |
      +---------------------------+---------------------------------+-------------+
      | "__defaults__"            | A tuple containing default      | Writable    |
      |                           | argument values for those       |             |
      |                           | arguments that have defaults,   |             |
      |                           | or "None" if no arguments have  |             |
      |                           | a default value.                |             |
      +---------------------------+---------------------------------+-------------+
      | "__code__"                | The code object representing    | Writable    |
      |                           | the compiled function body.     |             |
      +---------------------------+---------------------------------+-------------+
      | "__globals__"             | A reference to the dictionary   | Read-only   |
      |                           | that holds the function’s       |             |
      |                           | global variables — the global   |             |
      |                           | namespace of the module in      |             |
      |                           | which the function was defined. |             |
      +---------------------------+---------------------------------+-------------+
      | "__dict__"                | The namespace supporting        | Writable    |
      |                           | arbitrary function attributes.  |             |
      +---------------------------+---------------------------------+-------------+
      | "__closure__"             | "None" or a tuple of cells that | Read-only   |
      |                           | contain bindings for the        |             |
      |                           | function’s free variables. See  |             |
      |                           | below for information on the    |             |
      |                           | "cell_contents" attribute.      |             |
      +---------------------------+---------------------------------+-------------+
      | "__annotations__"         | A dict containing annotations   | Writable    |
      |                           | of parameters.  The keys of the |             |
      |                           | dict are the parameter names,   |             |
      |                           | and "'return'" for the return   |             |
      |                           | annotation, if provided.        |             |
      +---------------------------+---------------------------------+-------------+
      | "__kwdefaults__"          | A dict containing defaults for  | Writable    |
      |                           | keyword-only parameters.        |             |
      +---------------------------+---------------------------------+-------------+

      Most of the attributes labelled “Writable” check the type of the
      assigned value.

      Function objects also support getting and setting arbitrary
      attributes, which can be used, for example, to attach metadata
      to functions.  Regular attribute dot-notation is used to get and
      set such attributes. *Note that the current implementation only
      supports function attributes on user-defined functions. Function
      attributes on built-in functions may be supported in the
      future.*

      A cell object has the attribute "cell_contents". This can be
      used to get the value of the cell, as well as set the value.

      Additional information about a function’s definition can be
      retrieved from its code object; see the description of internal
      types below. The "cell" type can be accessed in the "types"
      module.

   Instance methods
      An instance method object combines a class, a class instance and
      any callable object (normally a user-defined function).

      Special read-only attributes: "__self__" is the class instance
      object, "__func__" is the function object; "__doc__" is the
      method’s documentation (same as "__func__.__doc__"); "__name__"
      is the method name (same as "__func__.__name__"); "__module__"
      is the name of the module the method was defined in, or "None"
      if unavailable.

      Methods also support accessing (but not setting) the arbitrary
      function attributes on the underlying function object.

      User-defined method objects may be created when getting an
      attribute of a class (perhaps via an instance of that class), if
      that attribute is a user-defined function object or a class
      method object.

      When an instance method object is created by retrieving a user-
      defined function object from a class via one of its instances,
      its "__self__" attribute is the instance, and the method object
      is said to be bound.  The new method’s "__func__" attribute is
      the original function object.

      When an instance method object is created by retrieving a class
      method object from a class or instance, its "__self__" attribute
      is the class itself, and its "__func__" attribute is the
      function object underlying the class method.

      When an instance method object is called, the underlying
      function ("__func__") is called, inserting the class instance
      ("__self__") in front of the argument list.  For instance, when
      "C" is a class which contains a definition for a function "f()",
      and "x" is an instance of "C", calling "x.f(1)" is equivalent to
      calling "C.f(x, 1)".

      When an instance method object is derived from a class method
      object, the “class instance” stored in "__self__" will actually
      be the class itself, so that calling either "x.f(1)" or "C.f(1)"
      is equivalent to calling "f(C,1)" where "f" is the underlying
      function.

      Note that the transformation from function object to instance
      method object happens each time the attribute is retrieved from
      the instance.  In some cases, a fruitful optimization is to
      assign the attribute to a local variable and call that local
      variable. Also notice that this transformation only happens for
      user-defined functions; other callable objects (and all non-
      callable objects) are retrieved without transformation.  It is
      also important to note that user-defined functions which are
      attributes of a class instance are not converted to bound
      methods; this *only* happens when the function is an attribute
      of the class.

   Generator functions
      A function or method which uses the "yield" statement (see
      section The yield statement) is called a *generator function*.
      Such a function, when called, always returns an iterator object
      which can be used to execute the body of the function:  calling
      the iterator’s "iterator.__next__()" method will cause the
      function to execute until it provides a value using the "yield"
      statement.  When the function executes a "return" statement or
      falls off the end, a "StopIteration" exception is raised and the
      iterator will have reached the end of the set of values to be
      returned.

   Coroutine functions
      A function or method which is defined using "async def" is
      called a *coroutine function*.  Such a function, when called,
      returns a *coroutine* object.  It may contain "await"
      expressions, as well as "async with" and "async for" statements.
      See also the Coroutine Objects section.

   Asynchronous generator functions
      A function or method which is defined using "async def" and
      which uses the "yield" statement is called a *asynchronous
      generator function*.  Such a function, when called, returns an
      asynchronous iterator object which can be used in an "async for"
      statement to execute the body of the function.

      Calling the asynchronous iterator’s "aiterator.__anext__()"
      method will return an *awaitable* which when awaited will
      execute until it provides a value using the "yield" expression.
      When the function executes an empty "return" statement or falls
      off the end, a "StopAsyncIteration" exception is raised and the
      asynchronous iterator will have reached the end of the set of
      values to be yielded.

   Built-in functions
      A built-in function object is a wrapper around a C function.
      Examples of built-in functions are "len()" and "math.sin()"
      ("math" is a standard built-in module). The number and type of
      the arguments are determined by the C function. Special read-
      only attributes: "__doc__" is the function’s documentation
      string, or "None" if unavailable; "__name__" is the function’s
      name; "__self__" is set to "None" (but see the next item);
      "__module__" is the name of the module the function was defined
      in or "None" if unavailable.

   Built-in methods
      This is really a different disguise of a built-in function, this
      time containing an object passed to the C function as an
      implicit extra argument.  An example of a built-in method is
      "alist.append()", assuming *alist* is a list object. In this
      case, the special read-only attribute "__self__" is set to the
      object denoted by *alist*.

   Classes
      Classes are callable.  These objects normally act as factories
      for new instances of themselves, but variations are possible for
      class types that override "__new__()".  The arguments of the
      call are passed to "__new__()" and, in the typical case, to
      "__init__()" to initialize the new instance.

   Class Instances
      Instances of arbitrary classes can be made callable by defining
      a "__call__()" method in their class.

Modules
   Modules are a basic organizational unit of Python code, and are
   created by the import system as invoked either by the "import"
   statement, or by calling functions such as
   "importlib.import_module()" and built-in "__import__()".  A module
   object has a namespace implemented by a dictionary object (this is
   the dictionary referenced by the "__globals__" attribute of
   functions defined in the module).  Attribute references are
   translated to lookups in this dictionary, e.g., "m.x" is equivalent
   to "m.__dict__["x"]". A module object does not contain the code
   object used to initialize the module (since it isn’t needed once
   the initialization is done).

   Attribute assignment updates the module’s namespace dictionary,
   e.g., "m.x = 1" is equivalent to "m.__dict__["x"] = 1".

   Predefined (writable) attributes: "__name__" is the module’s name;
   "__doc__" is the module’s documentation string, or "None" if
   unavailable; "__annotations__" (optional) is a dictionary
   containing *variable annotations* collected during module body
   execution; "__file__" is the pathname of the file from which the
   module was loaded, if it was loaded from a file. The "__file__"
   attribute may be missing for certain types of modules, such as C
   modules that are statically linked into the interpreter; for
   extension modules loaded dynamically from a shared library, it is
   the pathname of the shared library file.

   Special read-only attribute: "__dict__" is the module’s namespace
   as a dictionary object.

   **CPython implementation detail:** Because of the way CPython
   clears module dictionaries, the module dictionary will be cleared
   when the module falls out of scope even if the dictionary still has
   live references.  To avoid this, copy the dictionary or keep the
   module around while using its dictionary directly.

Custom classes
   Custom class types are typically created by class definitions (see
   section Class definitions).  A class has a namespace implemented by
   a dictionary object. Class attribute references are translated to
   lookups in this dictionary, e.g., "C.x" is translated to
   "C.__dict__["x"]" (although there are a number of hooks which allow
   for other means of locating attributes). When the attribute name is
   not found there, the attribute search continues in the base
   classes. This search of the base classes uses the C3 method
   resolution order which behaves correctly even in the presence of
   ‘diamond’ inheritance structures where there are multiple
   inheritance paths leading back to a common ancestor. Additional
   details on the C3 MRO used by Python can be found in the
   documentation accompanying the 2.3 release at
   https://www.python.org/download/releases/2.3/mro/.

   When a class attribute reference (for class "C", say) would yield a
   class method object, it is transformed into an instance method
   object whose "__self__" attribute is "C".  When it would yield a
   static method object, it is transformed into the object wrapped by
   the static method object. See section Implementing Descriptors for
   another way in which attributes retrieved from a class may differ
   from those actually contained in its "__dict__".

   Class attribute assignments update the class’s dictionary, never
   the dictionary of a base class.

   A class object can be called (see above) to yield a class instance
   (see below).

   Special attributes: "__name__" is the class name; "__module__" is
   the module name in which the class was defined; "__dict__" is the
   dictionary containing the class’s namespace; "__bases__" is a tuple
   containing the base classes, in the order of their occurrence in
   the base class list; "__doc__" is the class’s documentation string,
   or "None" if undefined; "__annotations__" (optional) is a
   dictionary containing *variable annotations* collected during class
   body execution.

Class instances
   A class instance is created by calling a class object (see above).
   A class instance has a namespace implemented as a dictionary which
   is the first place in which attribute references are searched.
   When an attribute is not found there, and the instance’s class has
   an attribute by that name, the search continues with the class
   attributes.  If a class attribute is found that is a user-defined
   function object, it is transformed into an instance method object
   whose "__self__" attribute is the instance.  Static method and
   class method objects are also transformed; see above under
   “Classes”.  See section Implementing Descriptors for another way in
   which attributes of a class retrieved via its instances may differ
   from the objects actually stored in the class’s "__dict__".  If no
   class attribute is found, and the object’s class has a
   "__getattr__()" method, that is called to satisfy the lookup.

   Attribute assignments and deletions update the instance’s
   dictionary, never a class’s dictionary.  If the class has a
   "__setattr__()" or "__delattr__()" method, this is called instead
   of updating the instance dictionary directly.

   Class instances can pretend to be numbers, sequences, or mappings
   if they have methods with certain special names.  See section
   Special method names.

   Special attributes: "__dict__" is the attribute dictionary;
   "__class__" is the instance’s class.

I/O objects (also known as file objects)
   A *file object* represents an open file.  Various shortcuts are
   available to create file objects: the "open()" built-in function,
   and also "os.popen()", "os.fdopen()", and the "makefile()" method
   of socket objects (and perhaps by other functions or methods
   provided by extension modules).

   The objects "sys.stdin", "sys.stdout" and "sys.stderr" are
   initialized to file objects corresponding to the interpreter’s
   standard input, output and error streams; they are all open in text
   mode and therefore follow the interface defined by the
   "io.TextIOBase" abstract class.

Internal types
   A few types used internally by the interpreter are exposed to the
   user. Their definitions may change with future versions of the
   interpreter, but they are mentioned here for completeness.

   Code objects
      Code objects represent *byte-compiled* executable Python code,
      or *bytecode*. The difference between a code object and a
      function object is that the function object contains an explicit
      reference to the function’s globals (the module in which it was
      defined), while a code object contains no context; also the
      default argument values are stored in the function object, not
      in the code object (because they represent values calculated at
      run-time).  Unlike function objects, code objects are immutable
      and contain no references (directly or indirectly) to mutable
      objects.

      Special read-only attributes: "co_name" gives the function name;
      "co_argcount" is the total number of positional arguments
      (including positional-only arguments and arguments with default
      values); "co_posonlyargcount" is the number of positional-only
      arguments (including arguments with default values);
      "co_kwonlyargcount" is the number of keyword-only arguments
      (including arguments with default values); "co_nlocals" is the
      number of local variables used by the function (including
      arguments); "co_varnames" is a tuple containing the names of the
      local variables (starting with the argument names);
      "co_cellvars" is a tuple containing the names of local variables
      that are referenced by nested functions; "co_freevars" is a
      tuple containing the names of free variables; "co_code" is a
      string representing the sequence of bytecode instructions;
      "co_consts" is a tuple containing the literals used by the
      bytecode; "co_names" is a tuple containing the names used by the
      bytecode; "co_filename" is the filename from which the code was
      compiled; "co_firstlineno" is the first line number of the
      function; "co_lnotab" is a string encoding the mapping from
      bytecode offsets to line numbers (for details see the source
      code of the interpreter); "co_stacksize" is the required stack
      size; "co_flags" is an integer encoding a number of flags for
      the interpreter.

      The following flag bits are defined for "co_flags": bit "0x04"
      is set if the function uses the "*arguments" syntax to accept an
      arbitrary number of positional arguments; bit "0x08" is set if
      the function uses the "**keywords" syntax to accept arbitrary
      keyword arguments; bit "0x20" is set if the function is a
      generator.

      Future feature declarations ("from __future__ import division")
      also use bits in "co_flags" to indicate whether a code object
      was compiled with a particular feature enabled: bit "0x2000" is
      set if the function was compiled with future division enabled;
      bits "0x10" and "0x1000" were used in earlier versions of
      Python.

      Other bits in "co_flags" are reserved for internal use.

      If a code object represents a function, the first item in
      "co_consts" is the documentation string of the function, or
      "None" if undefined.

   Frame objects
      Frame objects represent execution frames.  They may occur in
      traceback objects (see below), and are also passed to registered
      trace functions.

      Special read-only attributes: "f_back" is to the previous stack
      frame (towards the caller), or "None" if this is the bottom
      stack frame; "f_code" is the code object being executed in this
      frame; "f_locals" is the dictionary used to look up local
      variables; "f_globals" is used for global variables;
      "f_builtins" is used for built-in (intrinsic) names; "f_lasti"
      gives the precise instruction (this is an index into the
      bytecode string of the code object).

      Accessing "f_code" raises an auditing event "object.__getattr__"
      with arguments "obj" and ""f_code"".

      Special writable attributes: "f_trace", if not "None", is a
      function called for various events during code execution (this
      is used by the debugger). Normally an event is triggered for
      each new source line - this can be disabled by setting
      "f_trace_lines" to "False".

      Implementations *may* allow per-opcode events to be requested by
      setting "f_trace_opcodes" to "True". Note that this may lead to
      undefined interpreter behaviour if exceptions raised by the
      trace function escape to the function being traced.

      "f_lineno" is the current line number of the frame — writing to
      this from within a trace function jumps to the given line (only
      for the bottom-most frame).  A debugger can implement a Jump
      command (aka Set Next Statement) by writing to f_lineno.

      Frame objects support one method:

      frame.clear()

         This method clears all references to local variables held by
         the frame.  Also, if the frame belonged to a generator, the
         generator is finalized.  This helps break reference cycles
         involving frame objects (for example when catching an
         exception and storing its traceback for later use).

         "RuntimeError" is raised if the frame is currently executing.

         New in version 3.4.

   Traceback objects
      Traceback objects represent a stack trace of an exception.  A
      traceback object is implicitly created when an exception occurs,
      and may also be explicitly created by calling
      "types.TracebackType".

      For implicitly created tracebacks, when the search for an
      exception handler unwinds the execution stack, at each unwound
      level a traceback object is inserted in front of the current
      traceback.  When an exception handler is entered, the stack
      trace is made available to the program. (See section The try
      statement.) It is accessible as the third item of the tuple
      returned by "sys.exc_info()", and as the "__traceback__"
      attribute of the caught exception.

      When the program contains no suitable handler, the stack trace
      is written (nicely formatted) to the standard error stream; if
      the interpreter is interactive, it is also made available to the
      user as "sys.last_traceback".

      For explicitly created tracebacks, it is up to the creator of
      the traceback to determine how the "tb_next" attributes should
      be linked to form a full stack trace.

      Special read-only attributes: "tb_frame" points to the execution
      frame of the current level; "tb_lineno" gives the line number
      where the exception occurred; "tb_lasti" indicates the precise
      instruction. The line number and last instruction in the
      traceback may differ from the line number of its frame object if
      the exception occurred in a "try" statement with no matching
      except clause or with a finally clause.

      Accessing "tb_frame" raises an auditing event
      "object.__getattr__" with arguments "obj" and ""tb_frame"".

      Special writable attribute: "tb_next" is the next level in the
      stack trace (towards the frame where the exception occurred), or
      "None" if there is no next level.

      Changed in version 3.7: Traceback objects can now be explicitly
      instantiated from Python code, and the "tb_next" attribute of
      existing instances can be updated.

   Slice objects
      Slice objects are used to represent slices for "__getitem__()"
      methods.  They are also created by the built-in "slice()"
      function.

      Special read-only attributes: "start" is the lower bound; "stop"
      is the upper bound; "step" is the step value; each is "None" if
      omitted.  These attributes can have any type.

      Slice objects support one method:

      slice.indices(self, length)

         This method takes a single integer argument *length* and
         computes information about the slice that the slice object
         would describe if applied to a sequence of *length* items.
         It returns a tuple of three integers; respectively these are
         the *start* and *stop* indices and the *step* or stride
         length of the slice. Missing or out-of-bounds indices are
         handled in a manner consistent with regular slices.

   Static method objects
      Static method objects provide a way of defeating the
      transformation of function objects to method objects described
      above. A static method object is a wrapper around any other
      object, usually a user-defined method object. When a static
      method object is retrieved from a class or a class instance, the
      object actually returned is the wrapped object, which is not
      subject to any further transformation. Static method objects are
      not themselves callable, although the objects they wrap usually
      are. Static method objects are created by the built-in
      "staticmethod()" constructor.

   Class method objects
      A class method object, like a static method object, is a wrapper
      around another object that alters the way in which that object
      is retrieved from classes and class instances. The behaviour of
      class method objects upon such retrieval is described above,
      under “User-defined methods”. Class method objects are created
      by the built-in "classmethod()" constructor.
a�Functions
*********

Function objects are created by function definitions.  The only
operation on a function object is to call it: "func(argument-list)".

There are really two flavors of function objects: built-in functions
and user-defined functions.  Both support the same operation (to call
the function), but the implementation is different, hence the
different object types.

See Function definitions for more information.
u(.Mapping Types — "dict"
**********************

A *mapping* object maps *hashable* values to arbitrary objects.
Mappings are mutable objects.  There is currently only one standard
mapping type, the *dictionary*.  (For other containers see the built-
in "list", "set", and "tuple" classes, and the "collections" module.)

A dictionary’s keys are *almost* arbitrary values.  Values that are
not *hashable*, that is, values containing lists, dictionaries or
other mutable types (that are compared by value rather than by object
identity) may not be used as keys.  Numeric types used for keys obey
the normal rules for numeric comparison: if two numbers compare equal
(such as "1" and "1.0") then they can be used interchangeably to index
the same dictionary entry.  (Note however, that since computers store
floating-point numbers as approximations it is usually unwise to use
them as dictionary keys.)

Dictionaries can be created by placing a comma-separated list of "key:
value" pairs within braces, for example: "{'jack': 4098, 'sjoerd':
4127}" or "{4098: 'jack', 4127: 'sjoerd'}", or by the "dict"
constructor.

class dict(**kwarg)
class dict(mapping, **kwarg)
class dict(iterable, **kwarg)

   Return a new dictionary initialized from an optional positional
   argument and a possibly empty set of keyword arguments.

   Dictionaries can be created by several means:

   * Use a comma-separated list of "key: value" pairs within braces:
     "{'jack': 4098, 'sjoerd': 4127}" or "{4098: 'jack', 4127:
     'sjoerd'}"

   * Use a dict comprehension: "{}", "{x: x ** 2 for x in range(10)}"

   * Use the type constructor: "dict()", "dict([('foo', 100), ('bar',
     200)])", "dict(foo=100, bar=200)"

   If no positional argument is given, an empty dictionary is created.
   If a positional argument is given and it is a mapping object, a
   dictionary is created with the same key-value pairs as the mapping
   object.  Otherwise, the positional argument must be an *iterable*
   object.  Each item in the iterable must itself be an iterable with
   exactly two objects.  The first object of each item becomes a key
   in the new dictionary, and the second object the corresponding
   value.  If a key occurs more than once, the last value for that key
   becomes the corresponding value in the new dictionary.

   If keyword arguments are given, the keyword arguments and their
   values are added to the dictionary created from the positional
   argument.  If a key being added is already present, the value from
   the keyword argument replaces the value from the positional
   argument.

   To illustrate, the following examples all return a dictionary equal
   to "{"one": 1, "two": 2, "three": 3}":

      >>> a = dict(one=1, two=2, three=3)
      >>> b = {'one': 1, 'two': 2, 'three': 3}
      >>> c = dict(zip(['one', 'two', 'three'], [1, 2, 3]))
      >>> d = dict([('two', 2), ('one', 1), ('three', 3)])
      >>> e = dict({'three': 3, 'one': 1, 'two': 2})
      >>> a == b == c == d == e
      True

   Providing keyword arguments as in the first example only works for
   keys that are valid Python identifiers.  Otherwise, any valid keys
   can be used.

   These are the operations that dictionaries support (and therefore,
   custom mapping types should support too):

   list(d)

      Return a list of all the keys used in the dictionary *d*.

   len(d)

      Return the number of items in the dictionary *d*.

   d[key]

      Return the item of *d* with key *key*.  Raises a "KeyError" if
      *key* is not in the map.

      If a subclass of dict defines a method "__missing__()" and *key*
      is not present, the "d[key]" operation calls that method with
      the key *key* as argument.  The "d[key]" operation then returns
      or raises whatever is returned or raised by the
      "__missing__(key)" call. No other operations or methods invoke
      "__missing__()". If "__missing__()" is not defined, "KeyError"
      is raised. "__missing__()" must be a method; it cannot be an
      instance variable:

         >>> class Counter(dict):
         ...     def __missing__(self, key):
         ...         return 0
         >>> c = Counter()
         >>> c['red']
         0
         >>> c['red'] += 1
         >>> c['red']
         1

      The example above shows part of the implementation of
      "collections.Counter".  A different "__missing__" method is used
      by "collections.defaultdict".

   d[key] = value

      Set "d[key]" to *value*.

   del d[key]

      Remove "d[key]" from *d*.  Raises a "KeyError" if *key* is not
      in the map.

   key in d

      Return "True" if *d* has a key *key*, else "False".

   key not in d

      Equivalent to "not key in d".

   iter(d)

      Return an iterator over the keys of the dictionary.  This is a
      shortcut for "iter(d.keys())".

   clear()

      Remove all items from the dictionary.

   copy()

      Return a shallow copy of the dictionary.

   classmethod fromkeys(iterable[, value])

      Create a new dictionary with keys from *iterable* and values set
      to *value*.

      "fromkeys()" is a class method that returns a new dictionary.
      *value* defaults to "None".  All of the values refer to just a
      single instance, so it generally doesn’t make sense for *value*
      to be a mutable object such as an empty list.  To get distinct
      values, use a dict comprehension instead.

   get(key[, default])

      Return the value for *key* if *key* is in the dictionary, else
      *default*. If *default* is not given, it defaults to "None", so
      that this method never raises a "KeyError".

   items()

      Return a new view of the dictionary’s items ("(key, value)"
      pairs). See the documentation of view objects.

   keys()

      Return a new view of the dictionary’s keys.  See the
      documentation of view objects.

   pop(key[, default])

      If *key* is in the dictionary, remove it and return its value,
      else return *default*.  If *default* is not given and *key* is
      not in the dictionary, a "KeyError" is raised.

   popitem()

      Remove and return a "(key, value)" pair from the dictionary.
      Pairs are returned in LIFO (last-in, first-out) order.

      "popitem()" is useful to destructively iterate over a
      dictionary, as often used in set algorithms.  If the dictionary
      is empty, calling "popitem()" raises a "KeyError".

      Changed in version 3.7: LIFO order is now guaranteed. In prior
      versions, "popitem()" would return an arbitrary key/value pair.

   reversed(d)

      Return a reverse iterator over the keys of the dictionary. This
      is a shortcut for "reversed(d.keys())".

      New in version 3.8.

   setdefault(key[, default])

      If *key* is in the dictionary, return its value.  If not, insert
      *key* with a value of *default* and return *default*.  *default*
      defaults to "None".

   update([other])

      Update the dictionary with the key/value pairs from *other*,
      overwriting existing keys.  Return "None".

      "update()" accepts either another dictionary object or an
      iterable of key/value pairs (as tuples or other iterables of
      length two).  If keyword arguments are specified, the dictionary
      is then updated with those key/value pairs: "d.update(red=1,
      blue=2)".

   values()

      Return a new view of the dictionary’s values.  See the
      documentation of view objects.

      An equality comparison between one "dict.values()" view and
      another will always return "False". This also applies when
      comparing "dict.values()" to itself:

         >>> d = {'a': 1}
         >>> d.values() == d.values()
         False

   Dictionaries compare equal if and only if they have the same "(key,
   value)" pairs (regardless of ordering). Order comparisons (‘<’,
   ‘<=’, ‘>=’, ‘>’) raise "TypeError".

   Dictionaries preserve insertion order.  Note that updating a key
   does not affect the order.  Keys added after deletion are inserted
   at the end.

      >>> d = {"one": 1, "two": 2, "three": 3, "four": 4}
      >>> d
      {'one': 1, 'two': 2, 'three': 3, 'four': 4}
      >>> list(d)
      ['one', 'two', 'three', 'four']
      >>> list(d.values())
      [1, 2, 3, 4]
      >>> d["one"] = 42
      >>> d
      {'one': 42, 'two': 2, 'three': 3, 'four': 4}
      >>> del d["two"]
      >>> d["two"] = None
      >>> d
      {'one': 42, 'three': 3, 'four': 4, 'two': None}

   Changed in version 3.7: Dictionary order is guaranteed to be
   insertion order.  This behavior was an implementation detail of
   CPython from 3.6.

   Dictionaries and dictionary views are reversible.

      >>> d = {"one": 1, "two": 2, "three": 3, "four": 4}
      >>> d
      {'one': 1, 'two': 2, 'three': 3, 'four': 4}
      >>> list(reversed(d))
      ['four', 'three', 'two', 'one']
      >>> list(reversed(d.values()))
      [4, 3, 2, 1]
      >>> list(reversed(d.items()))
      [('four', 4), ('three', 3), ('two', 2), ('one', 1)]

   Changed in version 3.8: Dictionaries are now reversible.

See also:

  "types.MappingProxyType" can be used to create a read-only view of a
  "dict".


Dictionary view objects
=======================

The objects returned by "dict.keys()", "dict.values()" and
"dict.items()" are *view objects*.  They provide a dynamic view on the
dictionary’s entries, which means that when the dictionary changes,
the view reflects these changes.

Dictionary views can be iterated over to yield their respective data,
and support membership tests:

len(dictview)

   Return the number of entries in the dictionary.

iter(dictview)

   Return an iterator over the keys, values or items (represented as
   tuples of "(key, value)") in the dictionary.

   Keys and values are iterated over in insertion order. This allows
   the creation of "(value, key)" pairs using "zip()": "pairs =
   zip(d.values(), d.keys())".  Another way to create the same list is
   "pairs = [(v, k) for (k, v) in d.items()]".

   Iterating views while adding or deleting entries in the dictionary
   may raise a "RuntimeError" or fail to iterate over all entries.

   Changed in version 3.7: Dictionary order is guaranteed to be
   insertion order.

x in dictview

   Return "True" if *x* is in the underlying dictionary’s keys, values
   or items (in the latter case, *x* should be a "(key, value)"
   tuple).

reversed(dictview)

   Return a reverse iterator over the keys, values or items of the
   dictionary. The view will be iterated in reverse order of the
   insertion.

   Changed in version 3.8: Dictionary views are now reversible.

Keys views are set-like since their entries are unique and hashable.
If all values are hashable, so that "(key, value)" pairs are unique
and hashable, then the items view is also set-like.  (Values views are
not treated as set-like since the entries are generally not unique.)
For set-like views, all of the operations defined for the abstract
base class "collections.abc.Set" are available (for example, "==",
"<", or "^").

An example of dictionary view usage:

   >>> dishes = {'eggs': 2, 'sausage': 1, 'bacon': 1, 'spam': 500}
   >>> keys = dishes.keys()
   >>> values = dishes.values()

   >>> # iteration
   >>> n = 0
   >>> for val in values:
   ...     n += val
   >>> print(n)
   504

   >>> # keys and values are iterated over in the same order (insertion order)
   >>> list(keys)
   ['eggs', 'sausage', 'bacon', 'spam']
   >>> list(values)
   [2, 1, 1, 500]

   >>> # view objects are dynamic and reflect dict changes
   >>> del dishes['eggs']
   >>> del dishes['sausage']
   >>> list(keys)
   ['bacon', 'spam']

   >>> # set operations
   >>> keys & {'eggs', 'bacon', 'salad'}
   {'bacon'}
   >>> keys ^ {'sausage', 'juice'}
   {'juice', 'sausage', 'bacon', 'spam'}
a�Methods
*******

Methods are functions that are called using the attribute notation.
There are two flavors: built-in methods (such as "append()" on lists)
and class instance methods.  Built-in methods are described with the
types that support them.

If you access a method (a function defined in a class namespace)
through an instance, you get a special object: a *bound method* (also
called *instance method*) object. When called, it will add the "self"
argument to the argument list.  Bound methods have two special read-
only attributes: "m.__self__" is the object on which the method
operates, and "m.__func__" is the function implementing the method.
Calling "m(arg-1, arg-2, ..., arg-n)" is completely equivalent to
calling "m.__func__(m.__self__, arg-1, arg-2, ..., arg-n)".

Like function objects, bound method objects support getting arbitrary
attributes.  However, since method attributes are actually stored on
the underlying function object ("meth.__func__"), setting method
attributes on bound methods is disallowed.  Attempting to set an
attribute on a method results in an "AttributeError" being raised.  In
order to set a method attribute, you need to explicitly set it on the
underlying function object:

   >>> class C:
   ...     def method(self):
   ...         pass
   ...
   >>> c = C()
   >>> c.method.whoami = 'my name is method'  # can't set on the method
   Traceback (most recent call last):
     File "<stdin>", line 1, in <module>
   AttributeError: 'method' object has no attribute 'whoami'
   >>> c.method.__func__.whoami = 'my name is method'
   >>> c.method.whoami
   'my name is method'

See The standard type hierarchy for more information.
u$Modules
*******

The only special operation on a module is attribute access: "m.name",
where *m* is a module and *name* accesses a name defined in *m*’s
symbol table. Module attributes can be assigned to.  (Note that the
"import" statement is not, strictly speaking, an operation on a module
object; "import foo" does not require a module object named *foo* to
exist, rather it requires an (external) *definition* for a module
named *foo* somewhere.)

A special attribute of every module is "__dict__". This is the
dictionary containing the module’s symbol table. Modifying this
dictionary will actually change the module’s symbol table, but direct
assignment to the "__dict__" attribute is not possible (you can write
"m.__dict__['a'] = 1", which defines "m.a" to be "1", but you can’t
write "m.__dict__ = {}").  Modifying "__dict__" directly is not
recommended.

Modules built into the interpreter are written like this: "<module
'sys' (built-in)>".  If loaded from a file, they are written as
"<module 'os' from '/usr/local/lib/pythonX.Y/os.pyc'>".
u�ZSequence Types — "list", "tuple", "range"
*****************************************

There are three basic sequence types: lists, tuples, and range
objects. Additional sequence types tailored for processing of binary
data and text strings are described in dedicated sections.


Common Sequence Operations
==========================

The operations in the following table are supported by most sequence
types, both mutable and immutable. The "collections.abc.Sequence" ABC
is provided to make it easier to correctly implement these operations
on custom sequence types.

This table lists the sequence operations sorted in ascending priority.
In the table, *s* and *t* are sequences of the same type, *n*, *i*,
*j* and *k* are integers and *x* is an arbitrary object that meets any
type and value restrictions imposed by *s*.

The "in" and "not in" operations have the same priorities as the
comparison operations. The "+" (concatenation) and "*" (repetition)
operations have the same priority as the corresponding numeric
operations. [3]

+----------------------------+----------------------------------+------------+
| Operation                  | Result                           | Notes      |
|============================|==================================|============|
| "x in s"                   | "True" if an item of *s* is      | (1)        |
|                            | equal to *x*, else "False"       |            |
+----------------------------+----------------------------------+------------+
| "x not in s"               | "False" if an item of *s* is     | (1)        |
|                            | equal to *x*, else "True"        |            |
+----------------------------+----------------------------------+------------+
| "s + t"                    | the concatenation of *s* and *t* | (6)(7)     |
+----------------------------+----------------------------------+------------+
| "s * n" or "n * s"         | equivalent to adding *s* to      | (2)(7)     |
|                            | itself *n* times                 |            |
+----------------------------+----------------------------------+------------+
| "s[i]"                     | *i*th item of *s*, origin 0      | (3)        |
+----------------------------+----------------------------------+------------+
| "s[i:j]"                   | slice of *s* from *i* to *j*     | (3)(4)     |
+----------------------------+----------------------------------+------------+
| "s[i:j:k]"                 | slice of *s* from *i* to *j*     | (3)(5)     |
|                            | with step *k*                    |            |
+----------------------------+----------------------------------+------------+
| "len(s)"                   | length of *s*                    |            |
+----------------------------+----------------------------------+------------+
| "min(s)"                   | smallest item of *s*             |            |
+----------------------------+----------------------------------+------------+
| "max(s)"                   | largest item of *s*              |            |
+----------------------------+----------------------------------+------------+
| "s.index(x[, i[, j]])"     | index of the first occurrence of | (8)        |
|                            | *x* in *s* (at or after index    |            |
|                            | *i* and before index *j*)        |            |
+----------------------------+----------------------------------+------------+
| "s.count(x)"               | total number of occurrences of   |            |
|                            | *x* in *s*                       |            |
+----------------------------+----------------------------------+------------+

Sequences of the same type also support comparisons.  In particular,
tuples and lists are compared lexicographically by comparing
corresponding elements. This means that to compare equal, every
element must compare equal and the two sequences must be of the same
type and have the same length.  (For full details see Comparisons in
the language reference.)

Notes:

1. While the "in" and "not in" operations are used only for simple
   containment testing in the general case, some specialised sequences
   (such as "str", "bytes" and "bytearray") also use them for
   subsequence testing:

      >>> "gg" in "eggs"
      True

2. Values of *n* less than "0" are treated as "0" (which yields an
   empty sequence of the same type as *s*).  Note that items in the
   sequence *s* are not copied; they are referenced multiple times.
   This often haunts new Python programmers; consider:

      >>> lists = [[]] * 3
      >>> lists
      [[], [], []]
      >>> lists[0].append(3)
      >>> lists
      [[3], [3], [3]]

   What has happened is that "[[]]" is a one-element list containing
   an empty list, so all three elements of "[[]] * 3" are references
   to this single empty list.  Modifying any of the elements of
   "lists" modifies this single list. You can create a list of
   different lists this way:

      >>> lists = [[] for i in range(3)]
      >>> lists[0].append(3)
      >>> lists[1].append(5)
      >>> lists[2].append(7)
      >>> lists
      [[3], [5], [7]]

   Further explanation is available in the FAQ entry How do I create a
   multidimensional list?.

3. If *i* or *j* is negative, the index is relative to the end of
   sequence *s*: "len(s) + i" or "len(s) + j" is substituted.  But
   note that "-0" is still "0".

4. The slice of *s* from *i* to *j* is defined as the sequence of
   items with index *k* such that "i <= k < j".  If *i* or *j* is
   greater than "len(s)", use "len(s)".  If *i* is omitted or "None",
   use "0".  If *j* is omitted or "None", use "len(s)".  If *i* is
   greater than or equal to *j*, the slice is empty.

5. The slice of *s* from *i* to *j* with step *k* is defined as the
   sequence of items with index  "x = i + n*k" such that "0 <= n <
   (j-i)/k".  In other words, the indices are "i", "i+k", "i+2*k",
   "i+3*k" and so on, stopping when *j* is reached (but never
   including *j*).  When *k* is positive, *i* and *j* are reduced to
   "len(s)" if they are greater. When *k* is negative, *i* and *j* are
   reduced to "len(s) - 1" if they are greater.  If *i* or *j* are
   omitted or "None", they become “end” values (which end depends on
   the sign of *k*).  Note, *k* cannot be zero. If *k* is "None", it
   is treated like "1".

6. Concatenating immutable sequences always results in a new object.
   This means that building up a sequence by repeated concatenation
   will have a quadratic runtime cost in the total sequence length.
   To get a linear runtime cost, you must switch to one of the
   alternatives below:

   * if concatenating "str" objects, you can build a list and use
     "str.join()" at the end or else write to an "io.StringIO"
     instance and retrieve its value when complete

   * if concatenating "bytes" objects, you can similarly use
     "bytes.join()" or "io.BytesIO", or you can do in-place
     concatenation with a "bytearray" object.  "bytearray" objects are
     mutable and have an efficient overallocation mechanism

   * if concatenating "tuple" objects, extend a "list" instead

   * for other types, investigate the relevant class documentation

7. Some sequence types (such as "range") only support item sequences
   that follow specific patterns, and hence don’t support sequence
   concatenation or repetition.

8. "index" raises "ValueError" when *x* is not found in *s*. Not all
   implementations support passing the additional arguments *i* and
   *j*. These arguments allow efficient searching of subsections of
   the sequence. Passing the extra arguments is roughly equivalent to
   using "s[i:j].index(x)", only without copying any data and with the
   returned index being relative to the start of the sequence rather
   than the start of the slice.


Immutable Sequence Types
========================

The only operation that immutable sequence types generally implement
that is not also implemented by mutable sequence types is support for
the "hash()" built-in.

This support allows immutable sequences, such as "tuple" instances, to
be used as "dict" keys and stored in "set" and "frozenset" instances.

Attempting to hash an immutable sequence that contains unhashable
values will result in "TypeError".


Mutable Sequence Types
======================

The operations in the following table are defined on mutable sequence
types. The "collections.abc.MutableSequence" ABC is provided to make
it easier to correctly implement these operations on custom sequence
types.

In the table *s* is an instance of a mutable sequence type, *t* is any
iterable object and *x* is an arbitrary object that meets any type and
value restrictions imposed by *s* (for example, "bytearray" only
accepts integers that meet the value restriction "0 <= x <= 255").

+--------------------------------+----------------------------------+-----------------------+
| Operation                      | Result                           | Notes                 |
|================================|==================================|=======================|
| "s[i] = x"                     | item *i* of *s* is replaced by   |                       |
|                                | *x*                              |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s[i:j] = t"                   | slice of *s* from *i* to *j* is  |                       |
|                                | replaced by the contents of the  |                       |
|                                | iterable *t*                     |                       |
+--------------------------------+----------------------------------+-----------------------+
| "del s[i:j]"                   | same as "s[i:j] = []"            |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s[i:j:k] = t"                 | the elements of "s[i:j:k]" are   | (1)                   |
|                                | replaced by those of *t*         |                       |
+--------------------------------+----------------------------------+-----------------------+
| "del s[i:j:k]"                 | removes the elements of          |                       |
|                                | "s[i:j:k]" from the list         |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.append(x)"                  | appends *x* to the end of the    |                       |
|                                | sequence (same as                |                       |
|                                | "s[len(s):len(s)] = [x]")        |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.clear()"                    | removes all items from *s* (same | (5)                   |
|                                | as "del s[:]")                   |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.copy()"                     | creates a shallow copy of *s*    | (5)                   |
|                                | (same as "s[:]")                 |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.extend(t)" or "s += t"      | extends *s* with the contents of |                       |
|                                | *t* (for the most part the same  |                       |
|                                | as "s[len(s):len(s)] = t")       |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s *= n"                       | updates *s* with its contents    | (6)                   |
|                                | repeated *n* times               |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.insert(i, x)"               | inserts *x* into *s* at the      |                       |
|                                | index given by *i* (same as      |                       |
|                                | "s[i:i] = [x]")                  |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.pop()" or "s.pop(i)"        | retrieves the item at *i* and    | (2)                   |
|                                | also removes it from *s*         |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.remove(x)"                  | remove the first item from *s*   | (3)                   |
|                                | where "s[i]" is equal to *x*     |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.reverse()"                  | reverses the items of *s* in     | (4)                   |
|                                | place                            |                       |
+--------------------------------+----------------------------------+-----------------------+

Notes:

1. *t* must have the same length as the slice it is replacing.

2. The optional argument *i* defaults to "-1", so that by default the
   last item is removed and returned.

3. "remove()" raises "ValueError" when *x* is not found in *s*.

4. The "reverse()" method modifies the sequence in place for economy
   of space when reversing a large sequence.  To remind users that it
   operates by side effect, it does not return the reversed sequence.

5. "clear()" and "copy()" are included for consistency with the
   interfaces of mutable containers that don’t support slicing
   operations (such as "dict" and "set"). "copy()" is not part of the
   "collections.abc.MutableSequence" ABC, but most concrete mutable
   sequence classes provide it.

   New in version 3.3: "clear()" and "copy()" methods.

6. The value *n* is an integer, or an object implementing
   "__index__()".  Zero and negative values of *n* clear the sequence.
   Items in the sequence are not copied; they are referenced multiple
   times, as explained for "s * n" under Common Sequence Operations.


Lists
=====

Lists are mutable sequences, typically used to store collections of
homogeneous items (where the precise degree of similarity will vary by
application).

class list([iterable])

   Lists may be constructed in several ways:

   * Using a pair of square brackets to denote the empty list: "[]"

   * Using square brackets, separating items with commas: "[a]", "[a,
     b, c]"

   * Using a list comprehension: "[x for x in iterable]"

   * Using the type constructor: "list()" or "list(iterable)"

   The constructor builds a list whose items are the same and in the
   same order as *iterable*’s items.  *iterable* may be either a
   sequence, a container that supports iteration, or an iterator
   object.  If *iterable* is already a list, a copy is made and
   returned, similar to "iterable[:]". For example, "list('abc')"
   returns "['a', 'b', 'c']" and "list( (1, 2, 3) )" returns "[1, 2,
   3]". If no argument is given, the constructor creates a new empty
   list, "[]".

   Many other operations also produce lists, including the "sorted()"
   built-in.

   Lists implement all of the common and mutable sequence operations.
   Lists also provide the following additional method:

   sort(*, key=None, reverse=False)

      This method sorts the list in place, using only "<" comparisons
      between items. Exceptions are not suppressed - if any comparison
      operations fail, the entire sort operation will fail (and the
      list will likely be left in a partially modified state).

      "sort()" accepts two arguments that can only be passed by
      keyword (keyword-only arguments):

      *key* specifies a function of one argument that is used to
      extract a comparison key from each list element (for example,
      "key=str.lower"). The key corresponding to each item in the list
      is calculated once and then used for the entire sorting process.
      The default value of "None" means that list items are sorted
      directly without calculating a separate key value.

      The "functools.cmp_to_key()" utility is available to convert a
      2.x style *cmp* function to a *key* function.

      *reverse* is a boolean value.  If set to "True", then the list
      elements are sorted as if each comparison were reversed.

      This method modifies the sequence in place for economy of space
      when sorting a large sequence.  To remind users that it operates
      by side effect, it does not return the sorted sequence (use
      "sorted()" to explicitly request a new sorted list instance).

      The "sort()" method is guaranteed to be stable.  A sort is
      stable if it guarantees not to change the relative order of
      elements that compare equal — this is helpful for sorting in
      multiple passes (for example, sort by department, then by salary
      grade).

      For sorting examples and a brief sorting tutorial, see Sorting
      HOW TO.

      **CPython implementation detail:** While a list is being sorted,
      the effect of attempting to mutate, or even inspect, the list is
      undefined.  The C implementation of Python makes the list appear
      empty for the duration, and raises "ValueError" if it can detect
      that the list has been mutated during a sort.


Tuples
======

Tuples are immutable sequences, typically used to store collections of
heterogeneous data (such as the 2-tuples produced by the "enumerate()"
built-in). Tuples are also used for cases where an immutable sequence
of homogeneous data is needed (such as allowing storage in a "set" or
"dict" instance).

class tuple([iterable])

   Tuples may be constructed in a number of ways:

   * Using a pair of parentheses to denote the empty tuple: "()"

   * Using a trailing comma for a singleton tuple: "a," or "(a,)"

   * Separating items with commas: "a, b, c" or "(a, b, c)"

   * Using the "tuple()" built-in: "tuple()" or "tuple(iterable)"

   The constructor builds a tuple whose items are the same and in the
   same order as *iterable*’s items.  *iterable* may be either a
   sequence, a container that supports iteration, or an iterator
   object.  If *iterable* is already a tuple, it is returned
   unchanged. For example, "tuple('abc')" returns "('a', 'b', 'c')"
   and "tuple( [1, 2, 3] )" returns "(1, 2, 3)". If no argument is
   given, the constructor creates a new empty tuple, "()".

   Note that it is actually the comma which makes a tuple, not the
   parentheses. The parentheses are optional, except in the empty
   tuple case, or when they are needed to avoid syntactic ambiguity.
   For example, "f(a, b, c)" is a function call with three arguments,
   while "f((a, b, c))" is a function call with a 3-tuple as the sole
   argument.

   Tuples implement all of the common sequence operations.

For heterogeneous collections of data where access by name is clearer
than access by index, "collections.namedtuple()" may be a more
appropriate choice than a simple tuple object.


Ranges
======

The "range" type represents an immutable sequence of numbers and is
commonly used for looping a specific number of times in "for" loops.

class range(stop)
class range(start, stop[, step])

   The arguments to the range constructor must be integers (either
   built-in "int" or any object that implements the "__index__"
   special method).  If the *step* argument is omitted, it defaults to
   "1". If the *start* argument is omitted, it defaults to "0". If
   *step* is zero, "ValueError" is raised.

   For a positive *step*, the contents of a range "r" are determined
   by the formula "r[i] = start + step*i" where "i >= 0" and "r[i] <
   stop".

   For a negative *step*, the contents of the range are still
   determined by the formula "r[i] = start + step*i", but the
   constraints are "i >= 0" and "r[i] > stop".

   A range object will be empty if "r[0]" does not meet the value
   constraint. Ranges do support negative indices, but these are
   interpreted as indexing from the end of the sequence determined by
   the positive indices.

   Ranges containing absolute values larger than "sys.maxsize" are
   permitted but some features (such as "len()") may raise
   "OverflowError".

   Range examples:

      >>> list(range(10))
      [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
      >>> list(range(1, 11))
      [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
      >>> list(range(0, 30, 5))
      [0, 5, 10, 15, 20, 25]
      >>> list(range(0, 10, 3))
      [0, 3, 6, 9]
      >>> list(range(0, -10, -1))
      [0, -1, -2, -3, -4, -5, -6, -7, -8, -9]
      >>> list(range(0))
      []
      >>> list(range(1, 0))
      []

   Ranges implement all of the common sequence operations except
   concatenation and repetition (due to the fact that range objects
   can only represent sequences that follow a strict pattern and
   repetition and concatenation will usually violate that pattern).

   start

      The value of the *start* parameter (or "0" if the parameter was
      not supplied)

   stop

      The value of the *stop* parameter

   step

      The value of the *step* parameter (or "1" if the parameter was
      not supplied)

The advantage of the "range" type over a regular "list" or "tuple" is
that a "range" object will always take the same (small) amount of
memory, no matter the size of the range it represents (as it only
stores the "start", "stop" and "step" values, calculating individual
items and subranges as needed).

Range objects implement the "collections.abc.Sequence" ABC, and
provide features such as containment tests, element index lookup,
slicing and support for negative indices (see Sequence Types — list,
tuple, range):

>>> r = range(0, 20, 2)
>>> r
range(0, 20, 2)
>>> 11 in r
False
>>> 10 in r
True
>>> r.index(10)
5
>>> r[5]
10
>>> r[:5]
range(0, 10, 2)
>>> r[-1]
18

Testing range objects for equality with "==" and "!=" compares them as
sequences.  That is, two range objects are considered equal if they
represent the same sequence of values.  (Note that two range objects
that compare equal might have different "start", "stop" and "step"
attributes, for example "range(0) == range(2, 1, 3)" or "range(0, 3,
2) == range(0, 4, 2)".)

Changed in version 3.2: Implement the Sequence ABC. Support slicing
and negative indices. Test "int" objects for membership in constant
time instead of iterating through all items.

Changed in version 3.3: Define ‘==’ and ‘!=’ to compare range objects
based on the sequence of values they define (instead of comparing
based on object identity).

New in version 3.3: The "start", "stop" and "step" attributes.

See also:

  * The linspace recipe shows how to implement a lazy version of range
    suitable for floating point applications.
u�Mutable Sequence Types
**********************

The operations in the following table are defined on mutable sequence
types. The "collections.abc.MutableSequence" ABC is provided to make
it easier to correctly implement these operations on custom sequence
types.

In the table *s* is an instance of a mutable sequence type, *t* is any
iterable object and *x* is an arbitrary object that meets any type and
value restrictions imposed by *s* (for example, "bytearray" only
accepts integers that meet the value restriction "0 <= x <= 255").

+--------------------------------+----------------------------------+-----------------------+
| Operation                      | Result                           | Notes                 |
|================================|==================================|=======================|
| "s[i] = x"                     | item *i* of *s* is replaced by   |                       |
|                                | *x*                              |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s[i:j] = t"                   | slice of *s* from *i* to *j* is  |                       |
|                                | replaced by the contents of the  |                       |
|                                | iterable *t*                     |                       |
+--------------------------------+----------------------------------+-----------------------+
| "del s[i:j]"                   | same as "s[i:j] = []"            |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s[i:j:k] = t"                 | the elements of "s[i:j:k]" are   | (1)                   |
|                                | replaced by those of *t*         |                       |
+--------------------------------+----------------------------------+-----------------------+
| "del s[i:j:k]"                 | removes the elements of          |                       |
|                                | "s[i:j:k]" from the list         |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.append(x)"                  | appends *x* to the end of the    |                       |
|                                | sequence (same as                |                       |
|                                | "s[len(s):len(s)] = [x]")        |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.clear()"                    | removes all items from *s* (same | (5)                   |
|                                | as "del s[:]")                   |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.copy()"                     | creates a shallow copy of *s*    | (5)                   |
|                                | (same as "s[:]")                 |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.extend(t)" or "s += t"      | extends *s* with the contents of |                       |
|                                | *t* (for the most part the same  |                       |
|                                | as "s[len(s):len(s)] = t")       |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s *= n"                       | updates *s* with its contents    | (6)                   |
|                                | repeated *n* times               |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.insert(i, x)"               | inserts *x* into *s* at the      |                       |
|                                | index given by *i* (same as      |                       |
|                                | "s[i:i] = [x]")                  |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.pop()" or "s.pop(i)"        | retrieves the item at *i* and    | (2)                   |
|                                | also removes it from *s*         |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.remove(x)"                  | remove the first item from *s*   | (3)                   |
|                                | where "s[i]" is equal to *x*     |                       |
+--------------------------------+----------------------------------+-----------------------+
| "s.reverse()"                  | reverses the items of *s* in     | (4)                   |
|                                | place                            |                       |
+--------------------------------+----------------------------------+-----------------------+

Notes:

1. *t* must have the same length as the slice it is replacing.

2. The optional argument *i* defaults to "-1", so that by default the
   last item is removed and returned.

3. "remove()" raises "ValueError" when *x* is not found in *s*.

4. The "reverse()" method modifies the sequence in place for economy
   of space when reversing a large sequence.  To remind users that it
   operates by side effect, it does not return the reversed sequence.

5. "clear()" and "copy()" are included for consistency with the
   interfaces of mutable containers that don’t support slicing
   operations (such as "dict" and "set"). "copy()" is not part of the
   "collections.abc.MutableSequence" ABC, but most concrete mutable
   sequence classes provide it.

   New in version 3.3: "clear()" and "copy()" methods.

6. The value *n* is an integer, or an object implementing
   "__index__()".  Zero and negative values of *n* clear the sequence.
   Items in the sequence are not copied; they are referenced multiple
   times, as explained for "s * n" under Common Sequence Operations.
a~Unary arithmetic and bitwise operations
***************************************

All unary arithmetic and bitwise operations have the same priority:

   u_expr ::= power | "-" u_expr | "+" u_expr | "~" u_expr

The unary "-" (minus) operator yields the negation of its numeric
argument.

The unary "+" (plus) operator yields its numeric argument unchanged.

The unary "~" (invert) operator yields the bitwise inversion of its
integer argument.  The bitwise inversion of "x" is defined as
"-(x+1)".  It only applies to integral numbers.

In all three cases, if the argument does not have the proper type, a
"TypeError" exception is raised.
u�The "while" statement
*********************

The "while" statement is used for repeated execution as long as an
expression is true:

   while_stmt ::= "while" assignment_expression ":" suite
                  ["else" ":" suite]

This repeatedly tests the expression and, if it is true, executes the
first suite; if the expression is false (which may be the first time
it is tested) the suite of the "else" clause, if present, is executed
and the loop terminates.

A "break" statement executed in the first suite terminates the loop
without executing the "else" clause’s suite.  A "continue" statement
executed in the first suite skips the rest of the suite and goes back
to testing the expression.
uMThe "with" statement
********************

The "with" statement is used to wrap the execution of a block with
methods defined by a context manager (see section With Statement
Context Managers). This allows common "try"…"except"…"finally" usage
patterns to be encapsulated for convenient reuse.

   with_stmt ::= "with" with_item ("," with_item)* ":" suite
   with_item ::= expression ["as" target]

The execution of the "with" statement with one “item” proceeds as
follows:

1. The context expression (the expression given in the "with_item") is
   evaluated to obtain a context manager.

2. The context manager’s "__enter__()" is loaded for later use.

3. The context manager’s "__exit__()" is loaded for later use.

4. The context manager’s "__enter__()" method is invoked.

5. If a target was included in the "with" statement, the return value
   from "__enter__()" is assigned to it.

   Note:

     The "with" statement guarantees that if the "__enter__()" method
     returns without an error, then "__exit__()" will always be
     called. Thus, if an error occurs during the assignment to the
     target list, it will be treated the same as an error occurring
     within the suite would be. See step 6 below.

6. The suite is executed.

7. The context manager’s "__exit__()" method is invoked.  If an
   exception caused the suite to be exited, its type, value, and
   traceback are passed as arguments to "__exit__()". Otherwise, three
   "None" arguments are supplied.

   If the suite was exited due to an exception, and the return value
   from the "__exit__()" method was false, the exception is reraised.
   If the return value was true, the exception is suppressed, and
   execution continues with the statement following the "with"
   statement.

   If the suite was exited for any reason other than an exception, the
   return value from "__exit__()" is ignored, and execution proceeds
   at the normal location for the kind of exit that was taken.

The following code:

   with EXPRESSION as TARGET:
       SUITE

is semantically equivalent to:

   manager = (EXPRESSION)
   enter = type(manager).__enter__
   exit = type(manager).__exit__
   value = enter(manager)
   hit_except = False

   try:
       TARGET = value
       SUITE
   except:
       hit_except = True
       if not exit(manager, *sys.exc_info()):
           raise
   finally:
       if not hit_except:
           exit(manager, None, None, None)

With more than one item, the context managers are processed as if
multiple "with" statements were nested:

   with A() as a, B() as b:
       SUITE

is semantically equivalent to:

   with A() as a:
       with B() as b:
           SUITE

Changed in version 3.1: Support for multiple context expressions.

See also:

  **PEP 343** - The “with” statement
     The specification, background, and examples for the Python "with"
     statement.
a,The "yield" statement
*********************

   yield_stmt ::= yield_expression

A "yield" statement is semantically equivalent to a yield expression.
The yield statement can be used to omit the parentheses that would
otherwise be required in the equivalent yield expression statement.
For example, the yield statements

   yield <expr>
   yield from <expr>

are equivalent to the yield expression statements

   (yield <expr>)
   (yield from <expr>)

Yield expressions and statements are only used when defining a
*generator* function, and are only used in the body of the generator
function.  Using yield in a function definition is sufficient to cause
that definition to create a generator function instead of a normal
function.

For full details of "yield" semantics, refer to the Yield expressions
section.
)O�assertZ
assignment�asynczatom-identifiersz
atom-literalszattribute-accesszattribute-referencesZ	augassign�awaitZbinaryZbitwisezbltin-code-objectszbltin-ellipsis-objectzbltin-null-objectzbltin-type-objectsZbooleans�breakzcallable-typesZcalls�classZcomparisonsZcompoundzcontext-managers�continueZconversionsZ
customizationZdebugger�del�dictzdynamic-features�else�
exceptionsZ	execmodelZ	exprlistsZfloating�forZ
formatstringsZfunction�globalz
id-classesZidentifiers�ifZ	imaginary�import�inZintegers�lambdaZlistsZnaming�nonlocalZnumbersz
numeric-typesZobjectszoperator-summary�passZpower�raise�returnzsequence-typesZshiftingZslicingsZspecialattrsZspecialnameszstring-methodsZstringsZ
subscriptions�truth�try�typesZtypesfunctionsZtypesmappingZtypesmethodsZtypesmodulesZtypesseqztypesseq-mutableZunary�while�with�yieldN)Ztopics�rr�)/usr/lib64/python3.8/pydoc_data/topics.py�<module>s'}(@	X1	=`bQ>J:3MD%I
H+1&.LN3"o#p3=^ai9;K9%Hh�������������������������������������������������������������������������������������������������������������pydoc_data/_pydoc.css000064400000000140151153537640010647 0ustar00/*
    CSS file for pydoc.

    Contents of this file are subject to change without notice.

*/
formatter.py000064400000035447151153537640007150 0ustar00"""Generic output formatting.

Formatter objects transform an abstract flow of formatting events into
specific output events on writer objects. Formatters manage several stack
structures to allow various properties of a writer object to be changed and
restored; writers need not be able to handle relative changes nor any sort
of ``change back'' operation. Specific writer properties which may be
controlled via formatter objects are horizontal alignment, font, and left
margin indentations. A mechanism is provided which supports providing
arbitrary, non-exclusive style settings to a writer as well. Additional
interfaces facilitate formatting events which are not reversible, such as
paragraph separation.

Writer objects encapsulate device interfaces. Abstract devices, such as
file formats, are supported as well as physical devices. The provided
implementations all work with abstract devices. The interface makes
available mechanisms for setting the properties which formatter objects
manage and inserting data into the output.
"""

import sys
import warnings
warnings.warn('the formatter module is deprecated', DeprecationWarning,
              stacklevel=2)


AS_IS = None


class NullFormatter:
    """A formatter which does nothing.

    If the writer parameter is omitted, a NullWriter instance is created.
    No methods of the writer are called by NullFormatter instances.

    Implementations should inherit from this class if implementing a writer
    interface but don't need to inherit any implementation.

    """

    def __init__(self, writer=None):
        if writer is None:
            writer = NullWriter()
        self.writer = writer
    def end_paragraph(self, blankline): pass
    def add_line_break(self): pass
    def add_hor_rule(self, *args, **kw): pass
    def add_label_data(self, format, counter, blankline=None): pass
    def add_flowing_data(self, data): pass
    def add_literal_data(self, data): pass
    def flush_softspace(self): pass
    def push_alignment(self, align): pass
    def pop_alignment(self): pass
    def push_font(self, x): pass
    def pop_font(self): pass
    def push_margin(self, margin): pass
    def pop_margin(self): pass
    def set_spacing(self, spacing): pass
    def push_style(self, *styles): pass
    def pop_style(self, n=1): pass
    def assert_line_data(self, flag=1): pass


class AbstractFormatter:
    """The standard formatter.

    This implementation has demonstrated wide applicability to many writers,
    and may be used directly in most circumstances.  It has been used to
    implement a full-featured World Wide Web browser.

    """

    #  Space handling policy:  blank spaces at the boundary between elements
    #  are handled by the outermost context.  "Literal" data is not checked
    #  to determine context, so spaces in literal data are handled directly
    #  in all circumstances.

    def __init__(self, writer):
        self.writer = writer            # Output device
        self.align = None               # Current alignment
        self.align_stack = []           # Alignment stack
        self.font_stack = []            # Font state
        self.margin_stack = []          # Margin state
        self.spacing = None             # Vertical spacing state
        self.style_stack = []           # Other state, e.g. color
        self.nospace = 1                # Should leading space be suppressed
        self.softspace = 0              # Should a space be inserted
        self.para_end = 1               # Just ended a paragraph
        self.parskip = 0                # Skipped space between paragraphs?
        self.hard_break = 1             # Have a hard break
        self.have_label = 0

    def end_paragraph(self, blankline):
        if not self.hard_break:
            self.writer.send_line_break()
            self.have_label = 0
        if self.parskip < blankline and not self.have_label:
            self.writer.send_paragraph(blankline - self.parskip)
            self.parskip = blankline
            self.have_label = 0
        self.hard_break = self.nospace = self.para_end = 1
        self.softspace = 0

    def add_line_break(self):
        if not (self.hard_break or self.para_end):
            self.writer.send_line_break()
            self.have_label = self.parskip = 0
        self.hard_break = self.nospace = 1
        self.softspace = 0

    def add_hor_rule(self, *args, **kw):
        if not self.hard_break:
            self.writer.send_line_break()
        self.writer.send_hor_rule(*args, **kw)
        self.hard_break = self.nospace = 1
        self.have_label = self.para_end = self.softspace = self.parskip = 0

    def add_label_data(self, format, counter, blankline = None):
        if self.have_label or not self.hard_break:
            self.writer.send_line_break()
        if not self.para_end:
            self.writer.send_paragraph((blankline and 1) or 0)
        if isinstance(format, str):
            self.writer.send_label_data(self.format_counter(format, counter))
        else:
            self.writer.send_label_data(format)
        self.nospace = self.have_label = self.hard_break = self.para_end = 1
        self.softspace = self.parskip = 0

    def format_counter(self, format, counter):
        label = ''
        for c in format:
            if c == '1':
                label = label + ('%d' % counter)
            elif c in 'aA':
                if counter > 0:
                    label = label + self.format_letter(c, counter)
            elif c in 'iI':
                if counter > 0:
                    label = label + self.format_roman(c, counter)
            else:
                label = label + c
        return label

    def format_letter(self, case, counter):
        label = ''
        while counter > 0:
            counter, x = divmod(counter-1, 26)
            # This makes a strong assumption that lowercase letters
            # and uppercase letters form two contiguous blocks, with
            # letters in order!
            s = chr(ord(case) + x)
            label = s + label
        return label

    def format_roman(self, case, counter):
        ones = ['i', 'x', 'c', 'm']
        fives = ['v', 'l', 'd']
        label, index = '', 0
        # This will die of IndexError when counter is too big
        while counter > 0:
            counter, x = divmod(counter, 10)
            if x == 9:
                label = ones[index] + ones[index+1] + label
            elif x == 4:
                label = ones[index] + fives[index] + label
            else:
                if x >= 5:
                    s = fives[index]
                    x = x-5
                else:
                    s = ''
                s = s + ones[index]*x
                label = s + label
            index = index + 1
        if case == 'I':
            return label.upper()
        return label

    def add_flowing_data(self, data):
        if not data: return
        prespace = data[:1].isspace()
        postspace = data[-1:].isspace()
        data = " ".join(data.split())
        if self.nospace and not data:
            return
        elif prespace or self.softspace:
            if not data:
                if not self.nospace:
                    self.softspace = 1
                    self.parskip = 0
                return
            if not self.nospace:
                data = ' ' + data
        self.hard_break = self.nospace = self.para_end = \
                          self.parskip = self.have_label = 0
        self.softspace = postspace
        self.writer.send_flowing_data(data)

    def add_literal_data(self, data):
        if not data: return
        if self.softspace:
            self.writer.send_flowing_data(" ")
        self.hard_break = data[-1:] == '\n'
        self.nospace = self.para_end = self.softspace = \
                       self.parskip = self.have_label = 0
        self.writer.send_literal_data(data)

    def flush_softspace(self):
        if self.softspace:
            self.hard_break = self.para_end = self.parskip = \
                              self.have_label = self.softspace = 0
            self.nospace = 1
            self.writer.send_flowing_data(' ')

    def push_alignment(self, align):
        if align and align != self.align:
            self.writer.new_alignment(align)
            self.align = align
            self.align_stack.append(align)
        else:
            self.align_stack.append(self.align)

    def pop_alignment(self):
        if self.align_stack:
            del self.align_stack[-1]
        if self.align_stack:
            self.align = align = self.align_stack[-1]
            self.writer.new_alignment(align)
        else:
            self.align = None
            self.writer.new_alignment(None)

    def push_font(self, font):
        size, i, b, tt = font
        if self.softspace:
            self.hard_break = self.para_end = self.softspace = 0
            self.nospace = 1
            self.writer.send_flowing_data(' ')
        if self.font_stack:
            csize, ci, cb, ctt = self.font_stack[-1]
            if size is AS_IS: size = csize
            if i is AS_IS: i = ci
            if b is AS_IS: b = cb
            if tt is AS_IS: tt = ctt
        font = (size, i, b, tt)
        self.font_stack.append(font)
        self.writer.new_font(font)

    def pop_font(self):
        if self.font_stack:
            del self.font_stack[-1]
        if self.font_stack:
            font = self.font_stack[-1]
        else:
            font = None
        self.writer.new_font(font)

    def push_margin(self, margin):
        self.margin_stack.append(margin)
        fstack = [m for m in self.margin_stack if m]
        if not margin and fstack:
            margin = fstack[-1]
        self.writer.new_margin(margin, len(fstack))

    def pop_margin(self):
        if self.margin_stack:
            del self.margin_stack[-1]
        fstack = [m for m in self.margin_stack if m]
        if fstack:
            margin = fstack[-1]
        else:
            margin = None
        self.writer.new_margin(margin, len(fstack))

    def set_spacing(self, spacing):
        self.spacing = spacing
        self.writer.new_spacing(spacing)

    def push_style(self, *styles):
        if self.softspace:
            self.hard_break = self.para_end = self.softspace = 0
            self.nospace = 1
            self.writer.send_flowing_data(' ')
        for style in styles:
            self.style_stack.append(style)
        self.writer.new_styles(tuple(self.style_stack))

    def pop_style(self, n=1):
        del self.style_stack[-n:]
        self.writer.new_styles(tuple(self.style_stack))

    def assert_line_data(self, flag=1):
        self.nospace = self.hard_break = not flag
        self.para_end = self.parskip = self.have_label = 0


class NullWriter:
    """Minimal writer interface to use in testing & inheritance.

    A writer which only provides the interface definition; no actions are
    taken on any methods.  This should be the base class for all writers
    which do not need to inherit any implementation methods.

    """
    def __init__(self): pass
    def flush(self): pass
    def new_alignment(self, align): pass
    def new_font(self, font): pass
    def new_margin(self, margin, level): pass
    def new_spacing(self, spacing): pass
    def new_styles(self, styles): pass
    def send_paragraph(self, blankline): pass
    def send_line_break(self): pass
    def send_hor_rule(self, *args, **kw): pass
    def send_label_data(self, data): pass
    def send_flowing_data(self, data): pass
    def send_literal_data(self, data): pass


class AbstractWriter(NullWriter):
    """A writer which can be used in debugging formatters, but not much else.

    Each method simply announces itself by printing its name and
    arguments on standard output.

    """

    def new_alignment(self, align):
        print("new_alignment(%r)" % (align,))

    def new_font(self, font):
        print("new_font(%r)" % (font,))

    def new_margin(self, margin, level):
        print("new_margin(%r, %d)" % (margin, level))

    def new_spacing(self, spacing):
        print("new_spacing(%r)" % (spacing,))

    def new_styles(self, styles):
        print("new_styles(%r)" % (styles,))

    def send_paragraph(self, blankline):
        print("send_paragraph(%r)" % (blankline,))

    def send_line_break(self):
        print("send_line_break()")

    def send_hor_rule(self, *args, **kw):
        print("send_hor_rule()")

    def send_label_data(self, data):
        print("send_label_data(%r)" % (data,))

    def send_flowing_data(self, data):
        print("send_flowing_data(%r)" % (data,))

    def send_literal_data(self, data):
        print("send_literal_data(%r)" % (data,))


class DumbWriter(NullWriter):
    """Simple writer class which writes output on the file object passed in
    as the file parameter or, if file is omitted, on standard output.  The
    output is simply word-wrapped to the number of columns specified by
    the maxcol parameter.  This class is suitable for reflowing a sequence
    of paragraphs.

    """

    def __init__(self, file=None, maxcol=72):
        self.file = file or sys.stdout
        self.maxcol = maxcol
        NullWriter.__init__(self)
        self.reset()

    def reset(self):
        self.col = 0
        self.atbreak = 0

    def send_paragraph(self, blankline):
        self.file.write('\n'*blankline)
        self.col = 0
        self.atbreak = 0

    def send_line_break(self):
        self.file.write('\n')
        self.col = 0
        self.atbreak = 0

    def send_hor_rule(self, *args, **kw):
        self.file.write('\n')
        self.file.write('-'*self.maxcol)
        self.file.write('\n')
        self.col = 0
        self.atbreak = 0

    def send_literal_data(self, data):
        self.file.write(data)
        i = data.rfind('\n')
        if i >= 0:
            self.col = 0
            data = data[i+1:]
        data = data.expandtabs()
        self.col = self.col + len(data)
        self.atbreak = 0

    def send_flowing_data(self, data):
        if not data: return
        atbreak = self.atbreak or data[0].isspace()
        col = self.col
        maxcol = self.maxcol
        write = self.file.write
        for word in data.split():
            if atbreak:
                if col + len(word) >= maxcol:
                    write('\n')
                    col = 0
                else:
                    write(' ')
                    col = col + 1
            write(word)
            col = col + len(word)
            atbreak = 1
        self.col = col
        self.atbreak = data[-1].isspace()


def test(file = None):
    w = DumbWriter()
    f = AbstractFormatter(w)
    if file is not None:
        fp = open(file)
    elif sys.argv[1:]:
        fp = open(sys.argv[1])
    else:
        fp = sys.stdin
    try:
        for line in fp:
            if line == '\n':
                f.end_paragraph(1)
            else:
                f.add_flowing_data(line)
    finally:
        if fp is not sys.stdin:
            fp.close()
    f.end_paragraph(0)


if __name__ == '__main__':
    test()
uu.py000064400000016155151153537640005571 0ustar00
# Copyright 1994 by Lance Ellinghouse
# Cathedral City, California Republic, United States of America.
#                        All Rights Reserved
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permission notice appear in
# supporting documentation, and that the name of Lance Ellinghouse
# not be used in advertising or publicity pertaining to distribution
# of the software without specific, written prior permission.
# LANCE ELLINGHOUSE DISCLAIMS ALL WARRANTIES WITH REGARD TO
# THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
# FITNESS, IN NO EVENT SHALL LANCE ELLINGHOUSE CENTRUM BE LIABLE
# FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#
# Modified by Jack Jansen, CWI, July 1995:
# - Use binascii module to do the actual line-by-line conversion
#   between ascii and binary. This results in a 1000-fold speedup. The C
#   version is still 5 times faster, though.
# - Arguments more compliant with python standard

"""Implementation of the UUencode and UUdecode functions.

encode(in_file, out_file [,name, mode], *, backtick=False)
decode(in_file [, out_file, mode, quiet])
"""

import binascii
import os
import sys

__all__ = ["Error", "encode", "decode"]

class Error(Exception):
    pass

def encode(in_file, out_file, name=None, mode=None, *, backtick=False):
    """Uuencode file"""
    #
    # If in_file is a pathname open it and change defaults
    #
    opened_files = []
    try:
        if in_file == '-':
            in_file = sys.stdin.buffer
        elif isinstance(in_file, str):
            if name is None:
                name = os.path.basename(in_file)
            if mode is None:
                try:
                    mode = os.stat(in_file).st_mode
                except AttributeError:
                    pass
            in_file = open(in_file, 'rb')
            opened_files.append(in_file)
        #
        # Open out_file if it is a pathname
        #
        if out_file == '-':
            out_file = sys.stdout.buffer
        elif isinstance(out_file, str):
            out_file = open(out_file, 'wb')
            opened_files.append(out_file)
        #
        # Set defaults for name and mode
        #
        if name is None:
            name = '-'
        if mode is None:
            mode = 0o666

        #
        # Remove newline chars from name
        #
        name = name.replace('\n','\\n')
        name = name.replace('\r','\\r')

        #
        # Write the data
        #
        out_file.write(('begin %o %s\n' % ((mode & 0o777), name)).encode("ascii"))
        data = in_file.read(45)
        while len(data) > 0:
            out_file.write(binascii.b2a_uu(data, backtick=backtick))
            data = in_file.read(45)
        if backtick:
            out_file.write(b'`\nend\n')
        else:
            out_file.write(b' \nend\n')
    finally:
        for f in opened_files:
            f.close()


def decode(in_file, out_file=None, mode=None, quiet=False):
    """Decode uuencoded file"""
    #
    # Open the input file, if needed.
    #
    opened_files = []
    if in_file == '-':
        in_file = sys.stdin.buffer
    elif isinstance(in_file, str):
        in_file = open(in_file, 'rb')
        opened_files.append(in_file)

    try:
        #
        # Read until a begin is encountered or we've exhausted the file
        #
        while True:
            hdr = in_file.readline()
            if not hdr:
                raise Error('No valid begin line found in input file')
            if not hdr.startswith(b'begin'):
                continue
            hdrfields = hdr.split(b' ', 2)
            if len(hdrfields) == 3 and hdrfields[0] == b'begin':
                try:
                    int(hdrfields[1], 8)
                    break
                except ValueError:
                    pass
        if out_file is None:
            # If the filename isn't ASCII, what's up with that?!?
            out_file = hdrfields[2].rstrip(b' \t\r\n\f').decode("ascii")
            if os.path.exists(out_file):
                raise Error(f'Cannot overwrite existing file: {out_file}')
            if (out_file.startswith(os.sep) or
                f'..{os.sep}' in out_file or (
                    os.altsep and
                    (out_file.startswith(os.altsep) or
                     f'..{os.altsep}' in out_file))
               ):
                raise Error(f'Refusing to write to {out_file} due to directory traversal')
        if mode is None:
            mode = int(hdrfields[1], 8)
        #
        # Open the output file
        #
        if out_file == '-':
            out_file = sys.stdout.buffer
        elif isinstance(out_file, str):
            fp = open(out_file, 'wb')
            os.chmod(out_file, mode)
            out_file = fp
            opened_files.append(out_file)
        #
        # Main decoding loop
        #
        s = in_file.readline()
        while s and s.strip(b' \t\r\n\f') != b'end':
            try:
                data = binascii.a2b_uu(s)
            except binascii.Error as v:
                # Workaround for broken uuencoders by /Fredrik Lundh
                nbytes = (((s[0]-32) & 63) * 4 + 5) // 3
                data = binascii.a2b_uu(s[:nbytes])
                if not quiet:
                    sys.stderr.write("Warning: %s\n" % v)
            out_file.write(data)
            s = in_file.readline()
        if not s:
            raise Error('Truncated input file')
    finally:
        for f in opened_files:
            f.close()

def test():
    """uuencode/uudecode main program"""

    import optparse
    parser = optparse.OptionParser(usage='usage: %prog [-d] [-t] [input [output]]')
    parser.add_option('-d', '--decode', dest='decode', help='Decode (instead of encode)?', default=False, action='store_true')
    parser.add_option('-t', '--text', dest='text', help='data is text, encoded format unix-compatible text?', default=False, action='store_true')

    (options, args) = parser.parse_args()
    if len(args) > 2:
        parser.error('incorrect number of arguments')
        sys.exit(1)

    # Use the binary streams underlying stdin/stdout
    input = sys.stdin.buffer
    output = sys.stdout.buffer
    if len(args) > 0:
        input = args[0]
    if len(args) > 1:
        output = args[1]

    if options.decode:
        if options.text:
            if isinstance(output, str):
                output = open(output, 'wb')
            else:
                print(sys.argv[0], ': cannot do -t to stdout')
                sys.exit(1)
        decode(input, output)
    else:
        if options.text:
            if isinstance(input, str):
                input = open(input, 'rb')
            else:
                print(sys.argv[0], ': cannot do -t from stdin')
                sys.exit(1)
        encode(input, output)

if __name__ == '__main__':
    test()
pdb.py000075500000172422151153537640005710 0ustar00#! /usr/bin/python3.8

"""
The Python Debugger Pdb
=======================

To use the debugger in its simplest form:

        >>> import pdb
        >>> pdb.run('<a statement>')

The debugger's prompt is '(Pdb) '.  This will stop in the first
function call in <a statement>.

Alternatively, if a statement terminated with an unhandled exception,
you can use pdb's post-mortem facility to inspect the contents of the
traceback:

        >>> <a statement>
        <exception traceback>
        >>> import pdb
        >>> pdb.pm()

The commands recognized by the debugger are listed in the next
section.  Most can be abbreviated as indicated; e.g., h(elp) means
that 'help' can be typed as 'h' or 'help' (but not as 'he' or 'hel',
nor as 'H' or 'Help' or 'HELP').  Optional arguments are enclosed in
square brackets.  Alternatives in the command syntax are separated
by a vertical bar (|).

A blank line repeats the previous command literally, except for
'list', where it lists the next 11 lines.

Commands that the debugger doesn't recognize are assumed to be Python
statements and are executed in the context of the program being
debugged.  Python statements can also be prefixed with an exclamation
point ('!').  This is a powerful way to inspect the program being
debugged; it is even possible to change variables or call functions.
When an exception occurs in such a statement, the exception name is
printed but the debugger's state is not changed.

The debugger supports aliases, which can save typing.  And aliases can
have parameters (see the alias help entry) which allows one a certain
level of adaptability to the context under examination.

Multiple commands may be entered on a single line, separated by the
pair ';;'.  No intelligence is applied to separating the commands; the
input is split at the first ';;', even if it is in the middle of a
quoted string.

If a file ".pdbrc" exists in your home directory or in the current
directory, it is read in and executed as if it had been typed at the
debugger prompt.  This is particularly useful for aliases.  If both
files exist, the one in the home directory is read first and aliases
defined there can be overridden by the local file.  This behavior can be
disabled by passing the "readrc=False" argument to the Pdb constructor.

Aside from aliases, the debugger is not directly programmable; but it
is implemented as a class from which you can derive your own debugger
class, which you can make as fancy as you like.


Debugger commands
=================

"""
# NOTE: the actual command documentation is collected from docstrings of the
# commands and is appended to __doc__ after the class has been defined.

import os
import io
import re
import sys
import cmd
import bdb
import dis
import code
import glob
import pprint
import signal
import inspect
import tokenize
import traceback
import linecache


class Restart(Exception):
    """Causes a debugger to be restarted for the debugged python program."""
    pass

__all__ = ["run", "pm", "Pdb", "runeval", "runctx", "runcall", "set_trace",
           "post_mortem", "help"]

def find_function(funcname, filename):
    cre = re.compile(r'def\s+%s\s*[(]' % re.escape(funcname))
    try:
        fp = tokenize.open(filename)
    except OSError:
        return None
    # consumer of this info expects the first line to be 1
    with fp:
        for lineno, line in enumerate(fp, start=1):
            if cre.match(line):
                return funcname, filename, lineno
    return None

def getsourcelines(obj):
    lines, lineno = inspect.findsource(obj)
    if inspect.isframe(obj) and obj.f_globals is obj.f_locals:
        # must be a module frame: do not try to cut a block out of it
        return lines, 1
    elif inspect.ismodule(obj):
        return lines, 1
    return inspect.getblock(lines[lineno:]), lineno+1

def lasti2lineno(code, lasti):
    linestarts = list(dis.findlinestarts(code))
    linestarts.reverse()
    for i, lineno in linestarts:
        if lasti >= i:
            return lineno
    return 0


class _rstr(str):
    """String that doesn't quote its repr."""
    def __repr__(self):
        return self


# Interaction prompt line will separate file and call info from code
# text using value of line_prefix string.  A newline and arrow may
# be to your liking.  You can set it once pdb is imported using the
# command "pdb.line_prefix = '\n% '".
# line_prefix = ': '    # Use this to get the old situation back
line_prefix = '\n-> '   # Probably a better default

class Pdb(bdb.Bdb, cmd.Cmd):

    _previous_sigint_handler = None

    def __init__(self, completekey='tab', stdin=None, stdout=None, skip=None,
                 nosigint=False, readrc=True):
        bdb.Bdb.__init__(self, skip=skip)
        cmd.Cmd.__init__(self, completekey, stdin, stdout)
        sys.audit("pdb.Pdb")
        if stdout:
            self.use_rawinput = 0
        self.prompt = '(Pdb) '
        self.aliases = {}
        self.displaying = {}
        self.mainpyfile = ''
        self._wait_for_mainpyfile = False
        self.tb_lineno = {}
        # Try to load readline if it exists
        try:
            import readline
            # remove some common file name delimiters
            readline.set_completer_delims(' \t\n`@#$%^&*()=+[{]}\\|;:\'",<>?')
        except ImportError:
            pass
        self.allow_kbdint = False
        self.nosigint = nosigint

        # Read ~/.pdbrc and ./.pdbrc
        self.rcLines = []
        if readrc:
            try:
                with open(os.path.expanduser('~/.pdbrc')) as rcFile:
                    self.rcLines.extend(rcFile)
            except OSError:
                pass
            try:
                with open(".pdbrc") as rcFile:
                    self.rcLines.extend(rcFile)
            except OSError:
                pass

        self.commands = {} # associates a command list to breakpoint numbers
        self.commands_doprompt = {} # for each bp num, tells if the prompt
                                    # must be disp. after execing the cmd list
        self.commands_silent = {} # for each bp num, tells if the stack trace
                                  # must be disp. after execing the cmd list
        self.commands_defining = False # True while in the process of defining
                                       # a command list
        self.commands_bnum = None # The breakpoint number for which we are
                                  # defining a list

    def sigint_handler(self, signum, frame):
        if self.allow_kbdint:
            raise KeyboardInterrupt
        self.message("\nProgram interrupted. (Use 'cont' to resume).")
        self.set_step()
        self.set_trace(frame)

    def reset(self):
        bdb.Bdb.reset(self)
        self.forget()

    def forget(self):
        self.lineno = None
        self.stack = []
        self.curindex = 0
        self.curframe = None
        self.tb_lineno.clear()

    def setup(self, f, tb):
        self.forget()
        self.stack, self.curindex = self.get_stack(f, tb)
        while tb:
            # when setting up post-mortem debugging with a traceback, save all
            # the original line numbers to be displayed along the current line
            # numbers (which can be different, e.g. due to finally clauses)
            lineno = lasti2lineno(tb.tb_frame.f_code, tb.tb_lasti)
            self.tb_lineno[tb.tb_frame] = lineno
            tb = tb.tb_next
        self.curframe = self.stack[self.curindex][0]
        # The f_locals dictionary is updated from the actual frame
        # locals whenever the .f_locals accessor is called, so we
        # cache it here to ensure that modifications are not overwritten.
        self.curframe_locals = self.curframe.f_locals
        return self.execRcLines()

    # Can be executed earlier than 'setup' if desired
    def execRcLines(self):
        if not self.rcLines:
            return
        # local copy because of recursion
        rcLines = self.rcLines
        rcLines.reverse()
        # execute every line only once
        self.rcLines = []
        while rcLines:
            line = rcLines.pop().strip()
            if line and line[0] != '#':
                if self.onecmd(line):
                    # if onecmd returns True, the command wants to exit
                    # from the interaction, save leftover rc lines
                    # to execute before next interaction
                    self.rcLines += reversed(rcLines)
                    return True

    # Override Bdb methods

    def user_call(self, frame, argument_list):
        """This method is called when there is the remote possibility
        that we ever need to stop in this function."""
        if self._wait_for_mainpyfile:
            return
        if self.stop_here(frame):
            self.message('--Call--')
            self.interaction(frame, None)

    def user_line(self, frame):
        """This function is called when we stop or break at this line."""
        if self._wait_for_mainpyfile:
            if (self.mainpyfile != self.canonic(frame.f_code.co_filename)
                or frame.f_lineno <= 0):
                return
            self._wait_for_mainpyfile = False
        if self.bp_commands(frame):
            self.interaction(frame, None)

    def bp_commands(self, frame):
        """Call every command that was set for the current active breakpoint
        (if there is one).

        Returns True if the normal interaction function must be called,
        False otherwise."""
        # self.currentbp is set in bdb in Bdb.break_here if a breakpoint was hit
        if getattr(self, "currentbp", False) and \
               self.currentbp in self.commands:
            currentbp = self.currentbp
            self.currentbp = 0
            lastcmd_back = self.lastcmd
            self.setup(frame, None)
            for line in self.commands[currentbp]:
                self.onecmd(line)
            self.lastcmd = lastcmd_back
            if not self.commands_silent[currentbp]:
                self.print_stack_entry(self.stack[self.curindex])
            if self.commands_doprompt[currentbp]:
                self._cmdloop()
            self.forget()
            return
        return 1

    def user_return(self, frame, return_value):
        """This function is called when a return trap is set here."""
        if self._wait_for_mainpyfile:
            return
        frame.f_locals['__return__'] = return_value
        self.message('--Return--')
        self.interaction(frame, None)

    def user_exception(self, frame, exc_info):
        """This function is called if an exception occurs,
        but only if we are to stop at or just below this level."""
        if self._wait_for_mainpyfile:
            return
        exc_type, exc_value, exc_traceback = exc_info
        frame.f_locals['__exception__'] = exc_type, exc_value

        # An 'Internal StopIteration' exception is an exception debug event
        # issued by the interpreter when handling a subgenerator run with
        # 'yield from' or a generator controlled by a for loop. No exception has
        # actually occurred in this case. The debugger uses this debug event to
        # stop when the debuggee is returning from such generators.
        prefix = 'Internal ' if (not exc_traceback
                                    and exc_type is StopIteration) else ''
        self.message('%s%s' % (prefix,
            traceback.format_exception_only(exc_type, exc_value)[-1].strip()))
        self.interaction(frame, exc_traceback)

    # General interaction function
    def _cmdloop(self):
        while True:
            try:
                # keyboard interrupts allow for an easy way to cancel
                # the current command, so allow them during interactive input
                self.allow_kbdint = True
                self.cmdloop()
                self.allow_kbdint = False
                break
            except KeyboardInterrupt:
                self.message('--KeyboardInterrupt--')

    # Called before loop, handles display expressions
    def preloop(self):
        displaying = self.displaying.get(self.curframe)
        if displaying:
            for expr, oldvalue in displaying.items():
                newvalue = self._getval_except(expr)
                # check for identity first; this prevents custom __eq__ to
                # be called at every loop, and also prevents instances whose
                # fields are changed to be displayed
                if newvalue is not oldvalue and newvalue != oldvalue:
                    displaying[expr] = newvalue
                    self.message('display %s: %r  [old: %r]' %
                                 (expr, newvalue, oldvalue))

    def interaction(self, frame, traceback):
        # Restore the previous signal handler at the Pdb prompt.
        if Pdb._previous_sigint_handler:
            try:
                signal.signal(signal.SIGINT, Pdb._previous_sigint_handler)
            except ValueError:  # ValueError: signal only works in main thread
                pass
            else:
                Pdb._previous_sigint_handler = None
        if self.setup(frame, traceback):
            # no interaction desired at this time (happens if .pdbrc contains
            # a command like "continue")
            self.forget()
            return
        self.print_stack_entry(self.stack[self.curindex])
        self._cmdloop()
        self.forget()

    def displayhook(self, obj):
        """Custom displayhook for the exec in default(), which prevents
        assignment of the _ variable in the builtins.
        """
        # reproduce the behavior of the standard displayhook, not printing None
        if obj is not None:
            self.message(repr(obj))

    def default(self, line):
        if line[:1] == '!': line = line[1:]
        locals = self.curframe_locals
        globals = self.curframe.f_globals
        try:
            code = compile(line + '\n', '<stdin>', 'single')
            save_stdout = sys.stdout
            save_stdin = sys.stdin
            save_displayhook = sys.displayhook
            try:
                sys.stdin = self.stdin
                sys.stdout = self.stdout
                sys.displayhook = self.displayhook
                exec(code, globals, locals)
            finally:
                sys.stdout = save_stdout
                sys.stdin = save_stdin
                sys.displayhook = save_displayhook
        except:
            exc_info = sys.exc_info()[:2]
            self.error(traceback.format_exception_only(*exc_info)[-1].strip())

    def precmd(self, line):
        """Handle alias expansion and ';;' separator."""
        if not line.strip():
            return line
        args = line.split()
        while args[0] in self.aliases:
            line = self.aliases[args[0]]
            ii = 1
            for tmpArg in args[1:]:
                line = line.replace("%" + str(ii),
                                      tmpArg)
                ii += 1
            line = line.replace("%*", ' '.join(args[1:]))
            args = line.split()
        # split into ';;' separated commands
        # unless it's an alias command
        if args[0] != 'alias':
            marker = line.find(';;')
            if marker >= 0:
                # queue up everything after marker
                next = line[marker+2:].lstrip()
                self.cmdqueue.append(next)
                line = line[:marker].rstrip()
        return line

    def onecmd(self, line):
        """Interpret the argument as though it had been typed in response
        to the prompt.

        Checks whether this line is typed at the normal prompt or in
        a breakpoint command list definition.
        """
        if not self.commands_defining:
            return cmd.Cmd.onecmd(self, line)
        else:
            return self.handle_command_def(line)

    def handle_command_def(self, line):
        """Handles one command line during command list definition."""
        cmd, arg, line = self.parseline(line)
        if not cmd:
            return
        if cmd == 'silent':
            self.commands_silent[self.commands_bnum] = True
            return # continue to handle other cmd def in the cmd list
        elif cmd == 'end':
            self.cmdqueue = []
            return 1 # end of cmd list
        cmdlist = self.commands[self.commands_bnum]
        if arg:
            cmdlist.append(cmd+' '+arg)
        else:
            cmdlist.append(cmd)
        # Determine if we must stop
        try:
            func = getattr(self, 'do_' + cmd)
        except AttributeError:
            func = self.default
        # one of the resuming commands
        if func.__name__ in self.commands_resuming:
            self.commands_doprompt[self.commands_bnum] = False
            self.cmdqueue = []
            return 1
        return

    # interface abstraction functions

    def message(self, msg):
        print(msg, file=self.stdout)

    def error(self, msg):
        print('***', msg, file=self.stdout)

    # Generic completion functions.  Individual complete_foo methods can be
    # assigned below to one of these functions.

    def _complete_location(self, text, line, begidx, endidx):
        # Complete a file/module/function location for break/tbreak/clear.
        if line.strip().endswith((':', ',')):
            # Here comes a line number or a condition which we can't complete.
            return []
        # First, try to find matching functions (i.e. expressions).
        try:
            ret = self._complete_expression(text, line, begidx, endidx)
        except Exception:
            ret = []
        # Then, try to complete file names as well.
        globs = glob.glob(glob.escape(text) + '*')
        for fn in globs:
            if os.path.isdir(fn):
                ret.append(fn + '/')
            elif os.path.isfile(fn) and fn.lower().endswith(('.py', '.pyw')):
                ret.append(fn + ':')
        return ret

    def _complete_bpnumber(self, text, line, begidx, endidx):
        # Complete a breakpoint number.  (This would be more helpful if we could
        # display additional info along with the completions, such as file/line
        # of the breakpoint.)
        return [str(i) for i, bp in enumerate(bdb.Breakpoint.bpbynumber)
                if bp is not None and str(i).startswith(text)]

    def _complete_expression(self, text, line, begidx, endidx):
        # Complete an arbitrary expression.
        if not self.curframe:
            return []
        # Collect globals and locals.  It is usually not really sensible to also
        # complete builtins, and they clutter the namespace quite heavily, so we
        # leave them out.
        ns = {**self.curframe.f_globals, **self.curframe_locals}
        if '.' in text:
            # Walk an attribute chain up to the last part, similar to what
            # rlcompleter does.  This will bail if any of the parts are not
            # simple attribute access, which is what we want.
            dotted = text.split('.')
            try:
                obj = ns[dotted[0]]
                for part in dotted[1:-1]:
                    obj = getattr(obj, part)
            except (KeyError, AttributeError):
                return []
            prefix = '.'.join(dotted[:-1]) + '.'
            return [prefix + n for n in dir(obj) if n.startswith(dotted[-1])]
        else:
            # Complete a simple name.
            return [n for n in ns.keys() if n.startswith(text)]

    # Command definitions, called by cmdloop()
    # The argument is the remaining string on the command line
    # Return true to exit from the command loop

    def do_commands(self, arg):
        """commands [bpnumber]
        (com) ...
        (com) end
        (Pdb)

        Specify a list of commands for breakpoint number bpnumber.
        The commands themselves are entered on the following lines.
        Type a line containing just 'end' to terminate the commands.
        The commands are executed when the breakpoint is hit.

        To remove all commands from a breakpoint, type commands and
        follow it immediately with end; that is, give no commands.

        With no bpnumber argument, commands refers to the last
        breakpoint set.

        You can use breakpoint commands to start your program up
        again.  Simply use the continue command, or step, or any other
        command that resumes execution.

        Specifying any command resuming execution (currently continue,
        step, next, return, jump, quit and their abbreviations)
        terminates the command list (as if that command was
        immediately followed by end).  This is because any time you
        resume execution (even with a simple next or step), you may
        encounter another breakpoint -- which could have its own
        command list, leading to ambiguities about which list to
        execute.

        If you use the 'silent' command in the command list, the usual
        message about stopping at a breakpoint is not printed.  This
        may be desirable for breakpoints that are to print a specific
        message and then continue.  If none of the other commands
        print anything, you will see no sign that the breakpoint was
        reached.
        """
        if not arg:
            bnum = len(bdb.Breakpoint.bpbynumber) - 1
        else:
            try:
                bnum = int(arg)
            except:
                self.error("Usage: commands [bnum]\n        ...\n        end")
                return
        self.commands_bnum = bnum
        # Save old definitions for the case of a keyboard interrupt.
        if bnum in self.commands:
            old_command_defs = (self.commands[bnum],
                                self.commands_doprompt[bnum],
                                self.commands_silent[bnum])
        else:
            old_command_defs = None
        self.commands[bnum] = []
        self.commands_doprompt[bnum] = True
        self.commands_silent[bnum] = False

        prompt_back = self.prompt
        self.prompt = '(com) '
        self.commands_defining = True
        try:
            self.cmdloop()
        except KeyboardInterrupt:
            # Restore old definitions.
            if old_command_defs:
                self.commands[bnum] = old_command_defs[0]
                self.commands_doprompt[bnum] = old_command_defs[1]
                self.commands_silent[bnum] = old_command_defs[2]
            else:
                del self.commands[bnum]
                del self.commands_doprompt[bnum]
                del self.commands_silent[bnum]
            self.error('command definition aborted, old commands restored')
        finally:
            self.commands_defining = False
            self.prompt = prompt_back

    complete_commands = _complete_bpnumber

    def do_break(self, arg, temporary = 0):
        """b(reak) [ ([filename:]lineno | function) [, condition] ]
        Without argument, list all breaks.

        With a line number argument, set a break at this line in the
        current file.  With a function name, set a break at the first
        executable line of that function.  If a second argument is
        present, it is a string specifying an expression which must
        evaluate to true before the breakpoint is honored.

        The line number may be prefixed with a filename and a colon,
        to specify a breakpoint in another file (probably one that
        hasn't been loaded yet).  The file is searched for on
        sys.path; the .py suffix may be omitted.
        """
        if not arg:
            if self.breaks:  # There's at least one
                self.message("Num Type         Disp Enb   Where")
                for bp in bdb.Breakpoint.bpbynumber:
                    if bp:
                        self.message(bp.bpformat())
            return
        # parse arguments; comma has lowest precedence
        # and cannot occur in filename
        filename = None
        lineno = None
        cond = None
        comma = arg.find(',')
        if comma > 0:
            # parse stuff after comma: "condition"
            cond = arg[comma+1:].lstrip()
            arg = arg[:comma].rstrip()
        # parse stuff before comma: [filename:]lineno | function
        colon = arg.rfind(':')
        funcname = None
        if colon >= 0:
            filename = arg[:colon].rstrip()
            f = self.lookupmodule(filename)
            if not f:
                self.error('%r not found from sys.path' % filename)
                return
            else:
                filename = f
            arg = arg[colon+1:].lstrip()
            try:
                lineno = int(arg)
            except ValueError:
                self.error('Bad lineno: %s' % arg)
                return
        else:
            # no colon; can be lineno or function
            try:
                lineno = int(arg)
            except ValueError:
                try:
                    func = eval(arg,
                                self.curframe.f_globals,
                                self.curframe_locals)
                except:
                    func = arg
                try:
                    if hasattr(func, '__func__'):
                        func = func.__func__
                    code = func.__code__
                    #use co_name to identify the bkpt (function names
                    #could be aliased, but co_name is invariant)
                    funcname = code.co_name
                    lineno = code.co_firstlineno
                    filename = code.co_filename
                except:
                    # last thing to try
                    (ok, filename, ln) = self.lineinfo(arg)
                    if not ok:
                        self.error('The specified object %r is not a function '
                                   'or was not found along sys.path.' % arg)
                        return
                    funcname = ok # ok contains a function name
                    lineno = int(ln)
        if not filename:
            filename = self.defaultFile()
        # Check for reasonable breakpoint
        line = self.checkline(filename, lineno)
        if line:
            # now set the break point
            err = self.set_break(filename, line, temporary, cond, funcname)
            if err:
                self.error(err)
            else:
                bp = self.get_breaks(filename, line)[-1]
                self.message("Breakpoint %d at %s:%d" %
                             (bp.number, bp.file, bp.line))

    # To be overridden in derived debuggers
    def defaultFile(self):
        """Produce a reasonable default."""
        filename = self.curframe.f_code.co_filename
        if filename == '<string>' and self.mainpyfile:
            filename = self.mainpyfile
        return filename

    do_b = do_break

    complete_break = _complete_location
    complete_b = _complete_location

    def do_tbreak(self, arg):
        """tbreak [ ([filename:]lineno | function) [, condition] ]
        Same arguments as break, but sets a temporary breakpoint: it
        is automatically deleted when first hit.
        """
        self.do_break(arg, 1)

    complete_tbreak = _complete_location

    def lineinfo(self, identifier):
        failed = (None, None, None)
        # Input is identifier, may be in single quotes
        idstring = identifier.split("'")
        if len(idstring) == 1:
            # not in single quotes
            id = idstring[0].strip()
        elif len(idstring) == 3:
            # quoted
            id = idstring[1].strip()
        else:
            return failed
        if id == '': return failed
        parts = id.split('.')
        # Protection for derived debuggers
        if parts[0] == 'self':
            del parts[0]
            if len(parts) == 0:
                return failed
        # Best first guess at file to look at
        fname = self.defaultFile()
        if len(parts) == 1:
            item = parts[0]
        else:
            # More than one part.
            # First is module, second is method/class
            f = self.lookupmodule(parts[0])
            if f:
                fname = f
            item = parts[1]
        answer = find_function(item, fname)
        return answer or failed

    def checkline(self, filename, lineno):
        """Check whether specified line seems to be executable.

        Return `lineno` if it is, 0 if not (e.g. a docstring, comment, blank
        line or EOF). Warning: testing is not comprehensive.
        """
        # this method should be callable before starting debugging, so default
        # to "no globals" if there is no current frame
        globs = self.curframe.f_globals if hasattr(self, 'curframe') else None
        line = linecache.getline(filename, lineno, globs)
        if not line:
            self.message('End of file')
            return 0
        line = line.strip()
        # Don't allow setting breakpoint at a blank line
        if (not line or (line[0] == '#') or
             (line[:3] == '"""') or line[:3] == "'''"):
            self.error('Blank or comment')
            return 0
        return lineno

    def do_enable(self, arg):
        """enable bpnumber [bpnumber ...]
        Enables the breakpoints given as a space separated list of
        breakpoint numbers.
        """
        args = arg.split()
        for i in args:
            try:
                bp = self.get_bpbynumber(i)
            except ValueError as err:
                self.error(err)
            else:
                bp.enable()
                self.message('Enabled %s' % bp)

    complete_enable = _complete_bpnumber

    def do_disable(self, arg):
        """disable bpnumber [bpnumber ...]
        Disables the breakpoints given as a space separated list of
        breakpoint numbers.  Disabling a breakpoint means it cannot
        cause the program to stop execution, but unlike clearing a
        breakpoint, it remains in the list of breakpoints and can be
        (re-)enabled.
        """
        args = arg.split()
        for i in args:
            try:
                bp = self.get_bpbynumber(i)
            except ValueError as err:
                self.error(err)
            else:
                bp.disable()
                self.message('Disabled %s' % bp)

    complete_disable = _complete_bpnumber

    def do_condition(self, arg):
        """condition bpnumber [condition]
        Set a new condition for the breakpoint, an expression which
        must evaluate to true before the breakpoint is honored.  If
        condition is absent, any existing condition is removed; i.e.,
        the breakpoint is made unconditional.
        """
        args = arg.split(' ', 1)
        try:
            cond = args[1]
        except IndexError:
            cond = None
        try:
            bp = self.get_bpbynumber(args[0].strip())
        except IndexError:
            self.error('Breakpoint number expected')
        except ValueError as err:
            self.error(err)
        else:
            bp.cond = cond
            if not cond:
                self.message('Breakpoint %d is now unconditional.' % bp.number)
            else:
                self.message('New condition set for breakpoint %d.' % bp.number)

    complete_condition = _complete_bpnumber

    def do_ignore(self, arg):
        """ignore bpnumber [count]
        Set the ignore count for the given breakpoint number.  If
        count is omitted, the ignore count is set to 0.  A breakpoint
        becomes active when the ignore count is zero.  When non-zero,
        the count is decremented each time the breakpoint is reached
        and the breakpoint is not disabled and any associated
        condition evaluates to true.
        """
        args = arg.split()
        try:
            count = int(args[1].strip())
        except:
            count = 0
        try:
            bp = self.get_bpbynumber(args[0].strip())
        except IndexError:
            self.error('Breakpoint number expected')
        except ValueError as err:
            self.error(err)
        else:
            bp.ignore = count
            if count > 0:
                if count > 1:
                    countstr = '%d crossings' % count
                else:
                    countstr = '1 crossing'
                self.message('Will ignore next %s of breakpoint %d.' %
                             (countstr, bp.number))
            else:
                self.message('Will stop next time breakpoint %d is reached.'
                             % bp.number)

    complete_ignore = _complete_bpnumber

    def do_clear(self, arg):
        """cl(ear) filename:lineno\ncl(ear) [bpnumber [bpnumber...]]
        With a space separated list of breakpoint numbers, clear
        those breakpoints.  Without argument, clear all breaks (but
        first ask confirmation).  With a filename:lineno argument,
        clear all breaks at that line in that file.
        """
        if not arg:
            try:
                reply = input('Clear all breaks? ')
            except EOFError:
                reply = 'no'
            reply = reply.strip().lower()
            if reply in ('y', 'yes'):
                bplist = [bp for bp in bdb.Breakpoint.bpbynumber if bp]
                self.clear_all_breaks()
                for bp in bplist:
                    self.message('Deleted %s' % bp)
            return
        if ':' in arg:
            # Make sure it works for "clear C:\foo\bar.py:12"
            i = arg.rfind(':')
            filename = arg[:i]
            arg = arg[i+1:]
            try:
                lineno = int(arg)
            except ValueError:
                err = "Invalid line number (%s)" % arg
            else:
                bplist = self.get_breaks(filename, lineno)
                err = self.clear_break(filename, lineno)
            if err:
                self.error(err)
            else:
                for bp in bplist:
                    self.message('Deleted %s' % bp)
            return
        numberlist = arg.split()
        for i in numberlist:
            try:
                bp = self.get_bpbynumber(i)
            except ValueError as err:
                self.error(err)
            else:
                self.clear_bpbynumber(i)
                self.message('Deleted %s' % bp)
    do_cl = do_clear # 'c' is already an abbreviation for 'continue'

    complete_clear = _complete_location
    complete_cl = _complete_location

    def do_where(self, arg):
        """w(here)
        Print a stack trace, with the most recent frame at the bottom.
        An arrow indicates the "current frame", which determines the
        context of most commands.  'bt' is an alias for this command.
        """
        self.print_stack_trace()
    do_w = do_where
    do_bt = do_where

    def _select_frame(self, number):
        assert 0 <= number < len(self.stack)
        self.curindex = number
        self.curframe = self.stack[self.curindex][0]
        self.curframe_locals = self.curframe.f_locals
        self.print_stack_entry(self.stack[self.curindex])
        self.lineno = None

    def do_up(self, arg):
        """u(p) [count]
        Move the current frame count (default one) levels up in the
        stack trace (to an older frame).
        """
        if self.curindex == 0:
            self.error('Oldest frame')
            return
        try:
            count = int(arg or 1)
        except ValueError:
            self.error('Invalid frame count (%s)' % arg)
            return
        if count < 0:
            newframe = 0
        else:
            newframe = max(0, self.curindex - count)
        self._select_frame(newframe)
    do_u = do_up

    def do_down(self, arg):
        """d(own) [count]
        Move the current frame count (default one) levels down in the
        stack trace (to a newer frame).
        """
        if self.curindex + 1 == len(self.stack):
            self.error('Newest frame')
            return
        try:
            count = int(arg or 1)
        except ValueError:
            self.error('Invalid frame count (%s)' % arg)
            return
        if count < 0:
            newframe = len(self.stack) - 1
        else:
            newframe = min(len(self.stack) - 1, self.curindex + count)
        self._select_frame(newframe)
    do_d = do_down

    def do_until(self, arg):
        """unt(il) [lineno]
        Without argument, continue execution until the line with a
        number greater than the current one is reached.  With a line
        number, continue execution until a line with a number greater
        or equal to that is reached.  In both cases, also stop when
        the current frame returns.
        """
        if arg:
            try:
                lineno = int(arg)
            except ValueError:
                self.error('Error in argument: %r' % arg)
                return
            if lineno <= self.curframe.f_lineno:
                self.error('"until" line number is smaller than current '
                           'line number')
                return
        else:
            lineno = None
        self.set_until(self.curframe, lineno)
        return 1
    do_unt = do_until

    def do_step(self, arg):
        """s(tep)
        Execute the current line, stop at the first possible occasion
        (either in a function that is called or in the current
        function).
        """
        self.set_step()
        return 1
    do_s = do_step

    def do_next(self, arg):
        """n(ext)
        Continue execution until the next line in the current function
        is reached or it returns.
        """
        self.set_next(self.curframe)
        return 1
    do_n = do_next

    def do_run(self, arg):
        """run [args...]
        Restart the debugged python program. If a string is supplied
        it is split with "shlex", and the result is used as the new
        sys.argv.  History, breakpoints, actions and debugger options
        are preserved.  "restart" is an alias for "run".
        """
        if arg:
            import shlex
            argv0 = sys.argv[0:1]
            sys.argv = shlex.split(arg)
            sys.argv[:0] = argv0
        # this is caught in the main debugger loop
        raise Restart

    do_restart = do_run

    def do_return(self, arg):
        """r(eturn)
        Continue execution until the current function returns.
        """
        self.set_return(self.curframe)
        return 1
    do_r = do_return

    def do_continue(self, arg):
        """c(ont(inue))
        Continue execution, only stop when a breakpoint is encountered.
        """
        if not self.nosigint:
            try:
                Pdb._previous_sigint_handler = \
                    signal.signal(signal.SIGINT, self.sigint_handler)
            except ValueError:
                # ValueError happens when do_continue() is invoked from
                # a non-main thread in which case we just continue without
                # SIGINT set. Would printing a message here (once) make
                # sense?
                pass
        self.set_continue()
        return 1
    do_c = do_cont = do_continue

    def do_jump(self, arg):
        """j(ump) lineno
        Set the next line that will be executed.  Only available in
        the bottom-most frame.  This lets you jump back and execute
        code again, or jump forward to skip code that you don't want
        to run.

        It should be noted that not all jumps are allowed -- for
        instance it is not possible to jump into the middle of a
        for loop or out of a finally clause.
        """
        if self.curindex + 1 != len(self.stack):
            self.error('You can only jump within the bottom frame')
            return
        try:
            arg = int(arg)
        except ValueError:
            self.error("The 'jump' command requires a line number")
        else:
            try:
                # Do the jump, fix up our copy of the stack, and display the
                # new position
                self.curframe.f_lineno = arg
                self.stack[self.curindex] = self.stack[self.curindex][0], arg
                self.print_stack_entry(self.stack[self.curindex])
            except ValueError as e:
                self.error('Jump failed: %s' % e)
    do_j = do_jump

    def do_debug(self, arg):
        """debug code
        Enter a recursive debugger that steps through the code
        argument (which is an arbitrary expression or statement to be
        executed in the current environment).
        """
        sys.settrace(None)
        globals = self.curframe.f_globals
        locals = self.curframe_locals
        p = Pdb(self.completekey, self.stdin, self.stdout)
        p.prompt = "(%s) " % self.prompt.strip()
        self.message("ENTERING RECURSIVE DEBUGGER")
        try:
            sys.call_tracing(p.run, (arg, globals, locals))
        except Exception:
            exc_info = sys.exc_info()[:2]
            self.error(traceback.format_exception_only(*exc_info)[-1].strip())
        self.message("LEAVING RECURSIVE DEBUGGER")
        sys.settrace(self.trace_dispatch)
        self.lastcmd = p.lastcmd

    complete_debug = _complete_expression

    def do_quit(self, arg):
        """q(uit)\nexit
        Quit from the debugger. The program being executed is aborted.
        """
        self._user_requested_quit = True
        self.set_quit()
        return 1

    do_q = do_quit
    do_exit = do_quit

    def do_EOF(self, arg):
        """EOF
        Handles the receipt of EOF as a command.
        """
        self.message('')
        self._user_requested_quit = True
        self.set_quit()
        return 1

    def do_args(self, arg):
        """a(rgs)
        Print the argument list of the current function.
        """
        co = self.curframe.f_code
        dict = self.curframe_locals
        n = co.co_argcount + co.co_kwonlyargcount
        if co.co_flags & inspect.CO_VARARGS: n = n+1
        if co.co_flags & inspect.CO_VARKEYWORDS: n = n+1
        for i in range(n):
            name = co.co_varnames[i]
            if name in dict:
                self.message('%s = %r' % (name, dict[name]))
            else:
                self.message('%s = *** undefined ***' % (name,))
    do_a = do_args

    def do_retval(self, arg):
        """retval
        Print the return value for the last return of a function.
        """
        if '__return__' in self.curframe_locals:
            self.message(repr(self.curframe_locals['__return__']))
        else:
            self.error('Not yet returned!')
    do_rv = do_retval

    def _getval(self, arg):
        try:
            return eval(arg, self.curframe.f_globals, self.curframe_locals)
        except:
            exc_info = sys.exc_info()[:2]
            self.error(traceback.format_exception_only(*exc_info)[-1].strip())
            raise

    def _getval_except(self, arg, frame=None):
        try:
            if frame is None:
                return eval(arg, self.curframe.f_globals, self.curframe_locals)
            else:
                return eval(arg, frame.f_globals, frame.f_locals)
        except:
            exc_info = sys.exc_info()[:2]
            err = traceback.format_exception_only(*exc_info)[-1].strip()
            return _rstr('** raised %s **' % err)

    def do_p(self, arg):
        """p expression
        Print the value of the expression.
        """
        try:
            self.message(repr(self._getval(arg)))
        except:
            pass

    def do_pp(self, arg):
        """pp expression
        Pretty-print the value of the expression.
        """
        try:
            self.message(pprint.pformat(self._getval(arg)))
        except:
            pass

    complete_print = _complete_expression
    complete_p = _complete_expression
    complete_pp = _complete_expression

    def do_list(self, arg):
        """l(ist) [first [,last] | .]

        List source code for the current file.  Without arguments,
        list 11 lines around the current line or continue the previous
        listing.  With . as argument, list 11 lines around the current
        line.  With one argument, list 11 lines starting at that line.
        With two arguments, list the given range; if the second
        argument is less than the first, it is a count.

        The current line in the current frame is indicated by "->".
        If an exception is being debugged, the line where the
        exception was originally raised or propagated is indicated by
        ">>", if it differs from the current line.
        """
        self.lastcmd = 'list'
        last = None
        if arg and arg != '.':
            try:
                if ',' in arg:
                    first, last = arg.split(',')
                    first = int(first.strip())
                    last = int(last.strip())
                    if last < first:
                        # assume it's a count
                        last = first + last
                else:
                    first = int(arg.strip())
                    first = max(1, first - 5)
            except ValueError:
                self.error('Error in argument: %r' % arg)
                return
        elif self.lineno is None or arg == '.':
            first = max(1, self.curframe.f_lineno - 5)
        else:
            first = self.lineno + 1
        if last is None:
            last = first + 10
        filename = self.curframe.f_code.co_filename
        breaklist = self.get_file_breaks(filename)
        try:
            lines = linecache.getlines(filename, self.curframe.f_globals)
            self._print_lines(lines[first-1:last], first, breaklist,
                              self.curframe)
            self.lineno = min(last, len(lines))
            if len(lines) < last:
                self.message('[EOF]')
        except KeyboardInterrupt:
            pass
    do_l = do_list

    def do_longlist(self, arg):
        """longlist | ll
        List the whole source code for the current function or frame.
        """
        filename = self.curframe.f_code.co_filename
        breaklist = self.get_file_breaks(filename)
        try:
            lines, lineno = getsourcelines(self.curframe)
        except OSError as err:
            self.error(err)
            return
        self._print_lines(lines, lineno, breaklist, self.curframe)
    do_ll = do_longlist

    def do_source(self, arg):
        """source expression
        Try to get source code for the given object and display it.
        """
        try:
            obj = self._getval(arg)
        except:
            return
        try:
            lines, lineno = getsourcelines(obj)
        except (OSError, TypeError) as err:
            self.error(err)
            return
        self._print_lines(lines, lineno)

    complete_source = _complete_expression

    def _print_lines(self, lines, start, breaks=(), frame=None):
        """Print a range of lines."""
        if frame:
            current_lineno = frame.f_lineno
            exc_lineno = self.tb_lineno.get(frame, -1)
        else:
            current_lineno = exc_lineno = -1
        for lineno, line in enumerate(lines, start):
            s = str(lineno).rjust(3)
            if len(s) < 4:
                s += ' '
            if lineno in breaks:
                s += 'B'
            else:
                s += ' '
            if lineno == current_lineno:
                s += '->'
            elif lineno == exc_lineno:
                s += '>>'
            self.message(s + '\t' + line.rstrip())

    def do_whatis(self, arg):
        """whatis arg
        Print the type of the argument.
        """
        try:
            value = self._getval(arg)
        except:
            # _getval() already printed the error
            return
        code = None
        # Is it an instance method?
        try:
            code = value.__func__.__code__
        except Exception:
            pass
        if code:
            self.message('Method %s' % code.co_name)
            return
        # Is it a function?
        try:
            code = value.__code__
        except Exception:
            pass
        if code:
            self.message('Function %s' % code.co_name)
            return
        # Is it a class?
        if value.__class__ is type:
            self.message('Class %s.%s' % (value.__module__, value.__qualname__))
            return
        # None of the above...
        self.message(type(value))

    complete_whatis = _complete_expression

    def do_display(self, arg):
        """display [expression]

        Display the value of the expression if it changed, each time execution
        stops in the current frame.

        Without expression, list all display expressions for the current frame.
        """
        if not arg:
            self.message('Currently displaying:')
            for item in self.displaying.get(self.curframe, {}).items():
                self.message('%s: %r' % item)
        else:
            val = self._getval_except(arg)
            self.displaying.setdefault(self.curframe, {})[arg] = val
            self.message('display %s: %r' % (arg, val))

    complete_display = _complete_expression

    def do_undisplay(self, arg):
        """undisplay [expression]

        Do not display the expression any more in the current frame.

        Without expression, clear all display expressions for the current frame.
        """
        if arg:
            try:
                del self.displaying.get(self.curframe, {})[arg]
            except KeyError:
                self.error('not displaying %s' % arg)
        else:
            self.displaying.pop(self.curframe, None)

    def complete_undisplay(self, text, line, begidx, endidx):
        return [e for e in self.displaying.get(self.curframe, {})
                if e.startswith(text)]

    def do_interact(self, arg):
        """interact

        Start an interactive interpreter whose global namespace
        contains all the (global and local) names found in the current scope.
        """
        ns = {**self.curframe.f_globals, **self.curframe_locals}
        code.interact("*interactive*", local=ns)

    def do_alias(self, arg):
        """alias [name [command [parameter parameter ...] ]]
        Create an alias called 'name' that executes 'command'.  The
        command must *not* be enclosed in quotes.  Replaceable
        parameters can be indicated by %1, %2, and so on, while %* is
        replaced by all the parameters.  If no command is given, the
        current alias for name is shown. If no name is given, all
        aliases are listed.

        Aliases may be nested and can contain anything that can be
        legally typed at the pdb prompt.  Note!  You *can* override
        internal pdb commands with aliases!  Those internal commands
        are then hidden until the alias is removed.  Aliasing is
        recursively applied to the first word of the command line; all
        other words in the line are left alone.

        As an example, here are two useful aliases (especially when
        placed in the .pdbrc file):

        # Print instance variables (usage "pi classInst")
        alias pi for k in %1.__dict__.keys(): print("%1.",k,"=",%1.__dict__[k])
        # Print instance variables in self
        alias ps pi self
        """
        args = arg.split()
        if len(args) == 0:
            keys = sorted(self.aliases.keys())
            for alias in keys:
                self.message("%s = %s" % (alias, self.aliases[alias]))
            return
        if args[0] in self.aliases and len(args) == 1:
            self.message("%s = %s" % (args[0], self.aliases[args[0]]))
        else:
            self.aliases[args[0]] = ' '.join(args[1:])

    def do_unalias(self, arg):
        """unalias name
        Delete the specified alias.
        """
        args = arg.split()
        if len(args) == 0: return
        if args[0] in self.aliases:
            del self.aliases[args[0]]

    def complete_unalias(self, text, line, begidx, endidx):
        return [a for a in self.aliases if a.startswith(text)]

    # List of all the commands making the program resume execution.
    commands_resuming = ['do_continue', 'do_step', 'do_next', 'do_return',
                         'do_quit', 'do_jump']

    # Print a traceback starting at the top stack frame.
    # The most recently entered frame is printed last;
    # this is different from dbx and gdb, but consistent with
    # the Python interpreter's stack trace.
    # It is also consistent with the up/down commands (which are
    # compatible with dbx and gdb: up moves towards 'main()'
    # and down moves towards the most recent stack frame).

    def print_stack_trace(self):
        try:
            for frame_lineno in self.stack:
                self.print_stack_entry(frame_lineno)
        except KeyboardInterrupt:
            pass

    def print_stack_entry(self, frame_lineno, prompt_prefix=line_prefix):
        frame, lineno = frame_lineno
        if frame is self.curframe:
            prefix = '> '
        else:
            prefix = '  '
        self.message(prefix +
                     self.format_stack_entry(frame_lineno, prompt_prefix))

    # Provide help

    def do_help(self, arg):
        """h(elp)
        Without argument, print the list of available commands.
        With a command name as argument, print help about that command.
        "help pdb" shows the full pdb documentation.
        "help exec" gives help on the ! command.
        """
        if not arg:
            return cmd.Cmd.do_help(self, arg)
        try:
            try:
                topic = getattr(self, 'help_' + arg)
                return topic()
            except AttributeError:
                command = getattr(self, 'do_' + arg)
        except AttributeError:
            self.error('No help for %r' % arg)
        else:
            if sys.flags.optimize >= 2:
                self.error('No help for %r; please do not run Python with -OO '
                           'if you need command help' % arg)
                return
            self.message(command.__doc__.rstrip())

    do_h = do_help

    def help_exec(self):
        """(!) statement
        Execute the (one-line) statement in the context of the current
        stack frame.  The exclamation point can be omitted unless the
        first word of the statement resembles a debugger command.  To
        assign to a global variable you must always prefix the command
        with a 'global' command, e.g.:
        (Pdb) global list_options; list_options = ['-l']
        (Pdb)
        """
        self.message((self.help_exec.__doc__ or '').strip())

    def help_pdb(self):
        help()

    # other helper functions

    def lookupmodule(self, filename):
        """Helper function for break/clear parsing -- may be overridden.

        lookupmodule() translates (possibly incomplete) file or module name
        into an absolute file name.
        """
        if os.path.isabs(filename) and  os.path.exists(filename):
            return filename
        f = os.path.join(sys.path[0], filename)
        if  os.path.exists(f) and self.canonic(f) == self.mainpyfile:
            return f
        root, ext = os.path.splitext(filename)
        if ext == '':
            filename = filename + '.py'
        if os.path.isabs(filename):
            return filename
        for dirname in sys.path:
            while os.path.islink(dirname):
                dirname = os.readlink(dirname)
            fullname = os.path.join(dirname, filename)
            if os.path.exists(fullname):
                return fullname
        return None

    def _runmodule(self, module_name):
        self._wait_for_mainpyfile = True
        self._user_requested_quit = False
        import runpy
        mod_name, mod_spec, code = runpy._get_module_details(module_name)
        self.mainpyfile = self.canonic(code.co_filename)
        import __main__
        __main__.__dict__.clear()
        __main__.__dict__.update({
            "__name__": "__main__",
            "__file__": self.mainpyfile,
            "__package__": mod_spec.parent,
            "__loader__": mod_spec.loader,
            "__spec__": mod_spec,
            "__builtins__": __builtins__,
        })
        self.run(code)

    def _runscript(self, filename):
        # The script has to run in __main__ namespace (or imports from
        # __main__ will break).
        #
        # So we clear up the __main__ and set several special variables
        # (this gets rid of pdb's globals and cleans old variables on restarts).
        import __main__
        __main__.__dict__.clear()
        __main__.__dict__.update({"__name__"    : "__main__",
                                  "__file__"    : filename,
                                  "__builtins__": __builtins__,
                                 })

        # When bdb sets tracing, a number of call and line events happens
        # BEFORE debugger even reaches user's code (and the exact sequence of
        # events depends on python version). So we take special measures to
        # avoid stopping before we reach the main script (see user_line and
        # user_call for details).
        self._wait_for_mainpyfile = True
        self.mainpyfile = self.canonic(filename)
        self._user_requested_quit = False
        with io.open_code(filename) as fp:
            statement = "exec(compile(%r, %r, 'exec'))" % \
                        (fp.read(), self.mainpyfile)
        self.run(statement)

# Collect all command help into docstring, if not run with -OO

if __doc__ is not None:
    # unfortunately we can't guess this order from the class definition
    _help_order = [
        'help', 'where', 'down', 'up', 'break', 'tbreak', 'clear', 'disable',
        'enable', 'ignore', 'condition', 'commands', 'step', 'next', 'until',
        'jump', 'return', 'retval', 'run', 'continue', 'list', 'longlist',
        'args', 'p', 'pp', 'whatis', 'source', 'display', 'undisplay',
        'interact', 'alias', 'unalias', 'debug', 'quit',
    ]

    for _command in _help_order:
        __doc__ += getattr(Pdb, 'do_' + _command).__doc__.strip() + '\n\n'
    __doc__ += Pdb.help_exec.__doc__

    del _help_order, _command


# Simplified interface

def run(statement, globals=None, locals=None):
    Pdb().run(statement, globals, locals)

def runeval(expression, globals=None, locals=None):
    return Pdb().runeval(expression, globals, locals)

def runctx(statement, globals, locals):
    # B/W compatibility
    run(statement, globals, locals)

def runcall(*args, **kwds):
    return Pdb().runcall(*args, **kwds)

def set_trace(*, header=None):
    pdb = Pdb()
    if header is not None:
        pdb.message(header)
    pdb.set_trace(sys._getframe().f_back)

# Post-Mortem interface

def post_mortem(t=None):
    # handling the default
    if t is None:
        # sys.exc_info() returns (type, value, traceback) if an exception is
        # being handled, otherwise it returns None
        t = sys.exc_info()[2]
    if t is None:
        raise ValueError("A valid traceback must be passed if no "
                         "exception is being handled")

    p = Pdb()
    p.reset()
    p.interaction(None, t)

def pm():
    post_mortem(sys.last_traceback)


# Main program for testing

TESTCMD = 'import x; x.main()'

def test():
    run(TESTCMD)

# print help
def help():
    import pydoc
    pydoc.pager(__doc__)

_usage = """\
usage: pdb.py [-c command] ... [-m module | pyfile] [arg] ...

Debug the Python program given by pyfile. Alternatively,
an executable module or package to debug can be specified using
the -m switch.

Initial commands are read from .pdbrc files in your home directory
and in the current directory, if they exist.  Commands supplied with
-c are executed after commands from .pdbrc files.

To let the script run until an exception occurs, use "-c continue".
To let the script run up to a given line X in the debugged file, use
"-c 'until X'"."""

def main():
    import getopt

    opts, args = getopt.getopt(sys.argv[1:], 'mhc:', ['help', 'command='])

    if not args:
        print(_usage)
        sys.exit(2)

    commands = []
    run_as_module = False
    for opt, optarg in opts:
        if opt in ['-h', '--help']:
            print(_usage)
            sys.exit()
        elif opt in ['-c', '--command']:
            commands.append(optarg)
        elif opt in ['-m']:
            run_as_module = True

    mainpyfile = args[0]     # Get script filename
    if not run_as_module and not os.path.exists(mainpyfile):
        print('Error:', mainpyfile, 'does not exist')
        sys.exit(1)

    sys.argv[:] = args      # Hide "pdb.py" and pdb options from argument list

    if not run_as_module:
        mainpyfile = os.path.realpath(mainpyfile)
        # Replace pdb's dir with script's dir in front of module search path.
        sys.path[0] = os.path.dirname(mainpyfile)

    # Note on saving/restoring sys.argv: it's a good idea when sys.argv was
    # modified by the script being debugged. It's a bad idea when it was
    # changed by the user from the command line. There is a "restart" command
    # which allows explicit specification of command line arguments.
    pdb = Pdb()
    pdb.rcLines.extend(commands)
    while True:
        try:
            if run_as_module:
                pdb._runmodule(mainpyfile)
            else:
                pdb._runscript(mainpyfile)
            if pdb._user_requested_quit:
                break
            print("The program finished and will be restarted")
        except Restart:
            print("Restarting", mainpyfile, "with arguments:")
            print("\t" + " ".join(sys.argv[1:]))
        except SystemExit:
            # In most cases SystemExit does not warrant a post-mortem session.
            print("The program exited via sys.exit(). Exit status:", end=' ')
            print(sys.exc_info()[1])
        except SyntaxError:
            traceback.print_exc()
            sys.exit(1)
        except:
            traceback.print_exc()
            print("Uncaught exception. Entering post mortem debugging")
            print("Running 'cont' or 'step' will restart the program")
            t = sys.exc_info()[2]
            pdb.interaction(None, t)
            print("Post mortem debugger finished. The " + mainpyfile +
                  " will be restarted")


# When invoked as main program, invoke the debugger on a script
if __name__ == '__main__':
    import pdb
    pdb.main()
selectors.py000064400000044201151153537640007134 0ustar00"""Selectors module.

This module allows high-level and efficient I/O multiplexing, built upon the
`select` module primitives.
"""


from abc import ABCMeta, abstractmethod
from collections import namedtuple
from collections.abc import Mapping
import math
import select
import sys


# generic events, that must be mapped to implementation-specific ones
EVENT_READ = (1 << 0)
EVENT_WRITE = (1 << 1)


def _fileobj_to_fd(fileobj):
    """Return a file descriptor from a file object.

    Parameters:
    fileobj -- file object or file descriptor

    Returns:
    corresponding file descriptor

    Raises:
    ValueError if the object is invalid
    """
    if isinstance(fileobj, int):
        fd = fileobj
    else:
        try:
            fd = int(fileobj.fileno())
        except (AttributeError, TypeError, ValueError):
            raise ValueError("Invalid file object: "
                             "{!r}".format(fileobj)) from None
    if fd < 0:
        raise ValueError("Invalid file descriptor: {}".format(fd))
    return fd


SelectorKey = namedtuple('SelectorKey', ['fileobj', 'fd', 'events', 'data'])

SelectorKey.__doc__ = """SelectorKey(fileobj, fd, events, data)

    Object used to associate a file object to its backing
    file descriptor, selected event mask, and attached data.
"""
if sys.version_info >= (3, 5):
    SelectorKey.fileobj.__doc__ = 'File object registered.'
    SelectorKey.fd.__doc__ = 'Underlying file descriptor.'
    SelectorKey.events.__doc__ = 'Events that must be waited for on this file object.'
    SelectorKey.data.__doc__ = ('''Optional opaque data associated to this file object.
    For example, this could be used to store a per-client session ID.''')

class _SelectorMapping(Mapping):
    """Mapping of file objects to selector keys."""

    def __init__(self, selector):
        self._selector = selector

    def __len__(self):
        return len(self._selector._fd_to_key)

    def __getitem__(self, fileobj):
        try:
            fd = self._selector._fileobj_lookup(fileobj)
            return self._selector._fd_to_key[fd]
        except KeyError:
            raise KeyError("{!r} is not registered".format(fileobj)) from None

    def __iter__(self):
        return iter(self._selector._fd_to_key)


class BaseSelector(metaclass=ABCMeta):
    """Selector abstract base class.

    A selector supports registering file objects to be monitored for specific
    I/O events.

    A file object is a file descriptor or any object with a `fileno()` method.
    An arbitrary object can be attached to the file object, which can be used
    for example to store context information, a callback, etc.

    A selector can use various implementations (select(), poll(), epoll()...)
    depending on the platform. The default `Selector` class uses the most
    efficient implementation on the current platform.
    """

    @abstractmethod
    def register(self, fileobj, events, data=None):
        """Register a file object.

        Parameters:
        fileobj -- file object or file descriptor
        events  -- events to monitor (bitwise mask of EVENT_READ|EVENT_WRITE)
        data    -- attached data

        Returns:
        SelectorKey instance

        Raises:
        ValueError if events is invalid
        KeyError if fileobj is already registered
        OSError if fileobj is closed or otherwise is unacceptable to
                the underlying system call (if a system call is made)

        Note:
        OSError may or may not be raised
        """
        raise NotImplementedError

    @abstractmethod
    def unregister(self, fileobj):
        """Unregister a file object.

        Parameters:
        fileobj -- file object or file descriptor

        Returns:
        SelectorKey instance

        Raises:
        KeyError if fileobj is not registered

        Note:
        If fileobj is registered but has since been closed this does
        *not* raise OSError (even if the wrapped syscall does)
        """
        raise NotImplementedError

    def modify(self, fileobj, events, data=None):
        """Change a registered file object monitored events or attached data.

        Parameters:
        fileobj -- file object or file descriptor
        events  -- events to monitor (bitwise mask of EVENT_READ|EVENT_WRITE)
        data    -- attached data

        Returns:
        SelectorKey instance

        Raises:
        Anything that unregister() or register() raises
        """
        self.unregister(fileobj)
        return self.register(fileobj, events, data)

    @abstractmethod
    def select(self, timeout=None):
        """Perform the actual selection, until some monitored file objects are
        ready or a timeout expires.

        Parameters:
        timeout -- if timeout > 0, this specifies the maximum wait time, in
                   seconds
                   if timeout <= 0, the select() call won't block, and will
                   report the currently ready file objects
                   if timeout is None, select() will block until a monitored
                   file object becomes ready

        Returns:
        list of (key, events) for ready file objects
        `events` is a bitwise mask of EVENT_READ|EVENT_WRITE
        """
        raise NotImplementedError

    def close(self):
        """Close the selector.

        This must be called to make sure that any underlying resource is freed.
        """
        pass

    def get_key(self, fileobj):
        """Return the key associated to a registered file object.

        Returns:
        SelectorKey for this file object
        """
        mapping = self.get_map()
        if mapping is None:
            raise RuntimeError('Selector is closed')
        try:
            return mapping[fileobj]
        except KeyError:
            raise KeyError("{!r} is not registered".format(fileobj)) from None

    @abstractmethod
    def get_map(self):
        """Return a mapping of file objects to selector keys."""
        raise NotImplementedError

    def __enter__(self):
        return self

    def __exit__(self, *args):
        self.close()


class _BaseSelectorImpl(BaseSelector):
    """Base selector implementation."""

    def __init__(self):
        # this maps file descriptors to keys
        self._fd_to_key = {}
        # read-only mapping returned by get_map()
        self._map = _SelectorMapping(self)

    def _fileobj_lookup(self, fileobj):
        """Return a file descriptor from a file object.

        This wraps _fileobj_to_fd() to do an exhaustive search in case
        the object is invalid but we still have it in our map.  This
        is used by unregister() so we can unregister an object that
        was previously registered even if it is closed.  It is also
        used by _SelectorMapping.
        """
        try:
            return _fileobj_to_fd(fileobj)
        except ValueError:
            # Do an exhaustive search.
            for key in self._fd_to_key.values():
                if key.fileobj is fileobj:
                    return key.fd
            # Raise ValueError after all.
            raise

    def register(self, fileobj, events, data=None):
        if (not events) or (events & ~(EVENT_READ | EVENT_WRITE)):
            raise ValueError("Invalid events: {!r}".format(events))

        key = SelectorKey(fileobj, self._fileobj_lookup(fileobj), events, data)

        if key.fd in self._fd_to_key:
            raise KeyError("{!r} (FD {}) is already registered"
                           .format(fileobj, key.fd))

        self._fd_to_key[key.fd] = key
        return key

    def unregister(self, fileobj):
        try:
            key = self._fd_to_key.pop(self._fileobj_lookup(fileobj))
        except KeyError:
            raise KeyError("{!r} is not registered".format(fileobj)) from None
        return key

    def modify(self, fileobj, events, data=None):
        try:
            key = self._fd_to_key[self._fileobj_lookup(fileobj)]
        except KeyError:
            raise KeyError("{!r} is not registered".format(fileobj)) from None
        if events != key.events:
            self.unregister(fileobj)
            key = self.register(fileobj, events, data)
        elif data != key.data:
            # Use a shortcut to update the data.
            key = key._replace(data=data)
            self._fd_to_key[key.fd] = key
        return key

    def close(self):
        self._fd_to_key.clear()
        self._map = None

    def get_map(self):
        return self._map

    def _key_from_fd(self, fd):
        """Return the key associated to a given file descriptor.

        Parameters:
        fd -- file descriptor

        Returns:
        corresponding key, or None if not found
        """
        try:
            return self._fd_to_key[fd]
        except KeyError:
            return None


class SelectSelector(_BaseSelectorImpl):
    """Select-based selector."""

    def __init__(self):
        super().__init__()
        self._readers = set()
        self._writers = set()

    def register(self, fileobj, events, data=None):
        key = super().register(fileobj, events, data)
        if events & EVENT_READ:
            self._readers.add(key.fd)
        if events & EVENT_WRITE:
            self._writers.add(key.fd)
        return key

    def unregister(self, fileobj):
        key = super().unregister(fileobj)
        self._readers.discard(key.fd)
        self._writers.discard(key.fd)
        return key

    if sys.platform == 'win32':
        def _select(self, r, w, _, timeout=None):
            r, w, x = select.select(r, w, w, timeout)
            return r, w + x, []
    else:
        _select = select.select

    def select(self, timeout=None):
        timeout = None if timeout is None else max(timeout, 0)
        ready = []
        try:
            r, w, _ = self._select(self._readers, self._writers, [], timeout)
        except InterruptedError:
            return ready
        r = set(r)
        w = set(w)
        for fd in r | w:
            events = 0
            if fd in r:
                events |= EVENT_READ
            if fd in w:
                events |= EVENT_WRITE

            key = self._key_from_fd(fd)
            if key:
                ready.append((key, events & key.events))
        return ready


class _PollLikeSelector(_BaseSelectorImpl):
    """Base class shared between poll, epoll and devpoll selectors."""
    _selector_cls = None
    _EVENT_READ = None
    _EVENT_WRITE = None

    def __init__(self):
        super().__init__()
        self._selector = self._selector_cls()

    def register(self, fileobj, events, data=None):
        key = super().register(fileobj, events, data)
        poller_events = 0
        if events & EVENT_READ:
            poller_events |= self._EVENT_READ
        if events & EVENT_WRITE:
            poller_events |= self._EVENT_WRITE
        try:
            self._selector.register(key.fd, poller_events)
        except:
            super().unregister(fileobj)
            raise
        return key

    def unregister(self, fileobj):
        key = super().unregister(fileobj)
        try:
            self._selector.unregister(key.fd)
        except OSError:
            # This can happen if the FD was closed since it
            # was registered.
            pass
        return key

    def modify(self, fileobj, events, data=None):
        try:
            key = self._fd_to_key[self._fileobj_lookup(fileobj)]
        except KeyError:
            raise KeyError(f"{fileobj!r} is not registered") from None

        changed = False
        if events != key.events:
            selector_events = 0
            if events & EVENT_READ:
                selector_events |= self._EVENT_READ
            if events & EVENT_WRITE:
                selector_events |= self._EVENT_WRITE
            try:
                self._selector.modify(key.fd, selector_events)
            except:
                super().unregister(fileobj)
                raise
            changed = True
        if data != key.data:
            changed = True

        if changed:
            key = key._replace(events=events, data=data)
            self._fd_to_key[key.fd] = key
        return key

    def select(self, timeout=None):
        # This is shared between poll() and epoll().
        # epoll() has a different signature and handling of timeout parameter.
        if timeout is None:
            timeout = None
        elif timeout <= 0:
            timeout = 0
        else:
            # poll() has a resolution of 1 millisecond, round away from
            # zero to wait *at least* timeout seconds.
            timeout = math.ceil(timeout * 1e3)
        ready = []
        try:
            fd_event_list = self._selector.poll(timeout)
        except InterruptedError:
            return ready
        for fd, event in fd_event_list:
            events = 0
            if event & ~self._EVENT_READ:
                events |= EVENT_WRITE
            if event & ~self._EVENT_WRITE:
                events |= EVENT_READ

            key = self._key_from_fd(fd)
            if key:
                ready.append((key, events & key.events))
        return ready


if hasattr(select, 'poll'):

    class PollSelector(_PollLikeSelector):
        """Poll-based selector."""
        _selector_cls = select.poll
        _EVENT_READ = select.POLLIN
        _EVENT_WRITE = select.POLLOUT


if hasattr(select, 'epoll'):

    class EpollSelector(_PollLikeSelector):
        """Epoll-based selector."""
        _selector_cls = select.epoll
        _EVENT_READ = select.EPOLLIN
        _EVENT_WRITE = select.EPOLLOUT

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

        def select(self, timeout=None):
            if timeout is None:
                timeout = -1
            elif timeout <= 0:
                timeout = 0
            else:
                # epoll_wait() has a resolution of 1 millisecond, round away
                # from zero to wait *at least* timeout seconds.
                timeout = math.ceil(timeout * 1e3) * 1e-3

            # epoll_wait() expects `maxevents` to be greater than zero;
            # we want to make sure that `select()` can be called when no
            # FD is registered.
            max_ev = max(len(self._fd_to_key), 1)

            ready = []
            try:
                fd_event_list = self._selector.poll(timeout, max_ev)
            except InterruptedError:
                return ready
            for fd, event in fd_event_list:
                events = 0
                if event & ~select.EPOLLIN:
                    events |= EVENT_WRITE
                if event & ~select.EPOLLOUT:
                    events |= EVENT_READ

                key = self._key_from_fd(fd)
                if key:
                    ready.append((key, events & key.events))
            return ready

        def close(self):
            self._selector.close()
            super().close()


if hasattr(select, 'devpoll'):

    class DevpollSelector(_PollLikeSelector):
        """Solaris /dev/poll selector."""
        _selector_cls = select.devpoll
        _EVENT_READ = select.POLLIN
        _EVENT_WRITE = select.POLLOUT

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

        def close(self):
            self._selector.close()
            super().close()


if hasattr(select, 'kqueue'):

    class KqueueSelector(_BaseSelectorImpl):
        """Kqueue-based selector."""

        def __init__(self):
            super().__init__()
            self._selector = select.kqueue()

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

        def register(self, fileobj, events, data=None):
            key = super().register(fileobj, events, data)
            try:
                if events & EVENT_READ:
                    kev = select.kevent(key.fd, select.KQ_FILTER_READ,
                                        select.KQ_EV_ADD)
                    self._selector.control([kev], 0, 0)
                if events & EVENT_WRITE:
                    kev = select.kevent(key.fd, select.KQ_FILTER_WRITE,
                                        select.KQ_EV_ADD)
                    self._selector.control([kev], 0, 0)
            except:
                super().unregister(fileobj)
                raise
            return key

        def unregister(self, fileobj):
            key = super().unregister(fileobj)
            if key.events & EVENT_READ:
                kev = select.kevent(key.fd, select.KQ_FILTER_READ,
                                    select.KQ_EV_DELETE)
                try:
                    self._selector.control([kev], 0, 0)
                except OSError:
                    # This can happen if the FD was closed since it
                    # was registered.
                    pass
            if key.events & EVENT_WRITE:
                kev = select.kevent(key.fd, select.KQ_FILTER_WRITE,
                                    select.KQ_EV_DELETE)
                try:
                    self._selector.control([kev], 0, 0)
                except OSError:
                    # See comment above.
                    pass
            return key

        def select(self, timeout=None):
            timeout = None if timeout is None else max(timeout, 0)
            max_ev = len(self._fd_to_key)
            ready = []
            try:
                kev_list = self._selector.control(None, max_ev, timeout)
            except InterruptedError:
                return ready
            for kev in kev_list:
                fd = kev.ident
                flag = kev.filter
                events = 0
                if flag == select.KQ_FILTER_READ:
                    events |= EVENT_READ
                if flag == select.KQ_FILTER_WRITE:
                    events |= EVENT_WRITE

                key = self._key_from_fd(fd)
                if key:
                    ready.append((key, events & key.events))
            return ready

        def close(self):
            self._selector.close()
            super().close()


# Choose the best implementation, roughly:
#    epoll|kqueue|devpoll > poll > select.
# select() also can't accept a FD > FD_SETSIZE (usually around 1024)
if 'KqueueSelector' in globals():
    DefaultSelector = KqueueSelector
elif 'EpollSelector' in globals():
    DefaultSelector = EpollSelector
elif 'DevpollSelector' in globals():
    DefaultSelector = DevpollSelector
elif 'PollSelector' in globals():
    DefaultSelector = PollSelector
else:
    DefaultSelector = SelectSelector
string.py000064400000024447151153537640006451 0ustar00"""A collection of string constants.

Public module variables:

whitespace -- a string containing all ASCII whitespace
ascii_lowercase -- a string containing all ASCII lowercase letters
ascii_uppercase -- a string containing all ASCII uppercase letters
ascii_letters -- a string containing all ASCII letters
digits -- a string containing all ASCII decimal digits
hexdigits -- a string containing all ASCII hexadecimal digits
octdigits -- a string containing all ASCII octal digits
punctuation -- a string containing all ASCII punctuation characters
printable -- a string containing all ASCII characters considered printable

"""

__all__ = ["ascii_letters", "ascii_lowercase", "ascii_uppercase", "capwords",
           "digits", "hexdigits", "octdigits", "printable", "punctuation",
           "whitespace", "Formatter", "Template"]

import _string

# Some strings for ctype-style character classification
whitespace = ' \t\n\r\v\f'
ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_letters = ascii_lowercase + ascii_uppercase
digits = '0123456789'
hexdigits = digits + 'abcdef' + 'ABCDEF'
octdigits = '01234567'
punctuation = r"""!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~"""
printable = digits + ascii_letters + punctuation + whitespace

# Functions which aren't available as string methods.

# Capitalize the words in a string, e.g. " aBc  dEf " -> "Abc Def".
def capwords(s, sep=None):
    """capwords(s [,sep]) -> string

    Split the argument into words using split, capitalize each
    word using capitalize, and join the capitalized words using
    join.  If the optional second argument sep is absent or None,
    runs of whitespace characters are replaced by a single space
    and leading and trailing whitespace are removed, otherwise
    sep is used to split and join the words.

    """
    return (sep or ' ').join(x.capitalize() for x in s.split(sep))


####################################################################
import re as _re
from collections import ChainMap as _ChainMap

_sentinel_dict = {}

class _TemplateMetaclass(type):
    pattern = r"""
    %(delim)s(?:
      (?P<escaped>%(delim)s) |   # Escape sequence of two delimiters
      (?P<named>%(id)s)      |   # delimiter and a Python identifier
      {(?P<braced>%(bid)s)}  |   # delimiter and a braced identifier
      (?P<invalid>)              # Other ill-formed delimiter exprs
    )
    """

    def __init__(cls, name, bases, dct):
        super(_TemplateMetaclass, cls).__init__(name, bases, dct)
        if 'pattern' in dct:
            pattern = cls.pattern
        else:
            pattern = _TemplateMetaclass.pattern % {
                'delim' : _re.escape(cls.delimiter),
                'id'    : cls.idpattern,
                'bid'   : cls.braceidpattern or cls.idpattern,
                }
        cls.pattern = _re.compile(pattern, cls.flags | _re.VERBOSE)


class Template(metaclass=_TemplateMetaclass):
    """A string class for supporting $-substitutions."""

    delimiter = '$'
    # r'[a-z]' matches to non-ASCII letters when used with IGNORECASE, but
    # without the ASCII flag.  We can't add re.ASCII to flags because of
    # backward compatibility.  So we use the ?a local flag and [a-z] pattern.
    # See https://bugs.python.org/issue31672
    idpattern = r'(?a:[_a-z][_a-z0-9]*)'
    braceidpattern = None
    flags = _re.IGNORECASE

    def __init__(self, template):
        self.template = template

    # Search for $$, $identifier, ${identifier}, and any bare $'s

    def _invalid(self, mo):
        i = mo.start('invalid')
        lines = self.template[:i].splitlines(keepends=True)
        if not lines:
            colno = 1
            lineno = 1
        else:
            colno = i - len(''.join(lines[:-1]))
            lineno = len(lines)
        raise ValueError('Invalid placeholder in string: line %d, col %d' %
                         (lineno, colno))

    def substitute(self, mapping=_sentinel_dict, /, **kws):
        if mapping is _sentinel_dict:
            mapping = kws
        elif kws:
            mapping = _ChainMap(kws, mapping)
        # Helper function for .sub()
        def convert(mo):
            # Check the most common path first.
            named = mo.group('named') or mo.group('braced')
            if named is not None:
                return str(mapping[named])
            if mo.group('escaped') is not None:
                return self.delimiter
            if mo.group('invalid') is not None:
                self._invalid(mo)
            raise ValueError('Unrecognized named group in pattern',
                             self.pattern)
        return self.pattern.sub(convert, self.template)

    def safe_substitute(self, mapping=_sentinel_dict, /, **kws):
        if mapping is _sentinel_dict:
            mapping = kws
        elif kws:
            mapping = _ChainMap(kws, mapping)
        # Helper function for .sub()
        def convert(mo):
            named = mo.group('named') or mo.group('braced')
            if named is not None:
                try:
                    return str(mapping[named])
                except KeyError:
                    return mo.group()
            if mo.group('escaped') is not None:
                return self.delimiter
            if mo.group('invalid') is not None:
                return mo.group()
            raise ValueError('Unrecognized named group in pattern',
                             self.pattern)
        return self.pattern.sub(convert, self.template)



########################################################################
# the Formatter class
# see PEP 3101 for details and purpose of this class

# The hard parts are reused from the C implementation.  They're exposed as "_"
# prefixed methods of str.

# The overall parser is implemented in _string.formatter_parser.
# The field name parser is implemented in _string.formatter_field_name_split

class Formatter:
    def format(self, format_string, /, *args, **kwargs):
        return self.vformat(format_string, args, kwargs)

    def vformat(self, format_string, args, kwargs):
        used_args = set()
        result, _ = self._vformat(format_string, args, kwargs, used_args, 2)
        self.check_unused_args(used_args, args, kwargs)
        return result

    def _vformat(self, format_string, args, kwargs, used_args, recursion_depth,
                 auto_arg_index=0):
        if recursion_depth < 0:
            raise ValueError('Max string recursion exceeded')
        result = []
        for literal_text, field_name, format_spec, conversion in \
                self.parse(format_string):

            # output the literal text
            if literal_text:
                result.append(literal_text)

            # if there's a field, output it
            if field_name is not None:
                # this is some markup, find the object and do
                #  the formatting

                # handle arg indexing when empty field_names are given.
                if field_name == '':
                    if auto_arg_index is False:
                        raise ValueError('cannot switch from manual field '
                                         'specification to automatic field '
                                         'numbering')
                    field_name = str(auto_arg_index)
                    auto_arg_index += 1
                elif field_name.isdigit():
                    if auto_arg_index:
                        raise ValueError('cannot switch from manual field '
                                         'specification to automatic field '
                                         'numbering')
                    # disable auto arg incrementing, if it gets
                    # used later on, then an exception will be raised
                    auto_arg_index = False

                # given the field_name, find the object it references
                #  and the argument it came from
                obj, arg_used = self.get_field(field_name, args, kwargs)
                used_args.add(arg_used)

                # do any conversion on the resulting object
                obj = self.convert_field(obj, conversion)

                # expand the format spec, if needed
                format_spec, auto_arg_index = self._vformat(
                    format_spec, args, kwargs,
                    used_args, recursion_depth-1,
                    auto_arg_index=auto_arg_index)

                # format the object and append to the result
                result.append(self.format_field(obj, format_spec))

        return ''.join(result), auto_arg_index


    def get_value(self, key, args, kwargs):
        if isinstance(key, int):
            return args[key]
        else:
            return kwargs[key]


    def check_unused_args(self, used_args, args, kwargs):
        pass


    def format_field(self, value, format_spec):
        return format(value, format_spec)


    def convert_field(self, value, conversion):
        # do any conversion on the resulting object
        if conversion is None:
            return value
        elif conversion == 's':
            return str(value)
        elif conversion == 'r':
            return repr(value)
        elif conversion == 'a':
            return ascii(value)
        raise ValueError("Unknown conversion specifier {0!s}".format(conversion))


    # returns an iterable that contains tuples of the form:
    # (literal_text, field_name, format_spec, conversion)
    # literal_text can be zero length
    # field_name can be None, in which case there's no
    #  object to format and output
    # if field_name is not None, it is looked up, formatted
    #  with format_spec and conversion and then used
    def parse(self, format_string):
        return _string.formatter_parser(format_string)


    # given a field_name, find the object it references.
    #  field_name:   the field being looked up, e.g. "0.name"
    #                 or "lookup[3]"
    #  used_args:    a set of which args have been used
    #  args, kwargs: as passed in to vformat
    def get_field(self, field_name, args, kwargs):
        first, rest = _string.formatter_field_name_split(field_name)

        obj = self.get_value(first, args, kwargs)

        # loop through the rest of the field_name, doing
        #  getattr or getitem as needed
        for is_attr, i in rest:
            if is_attr:
                obj = getattr(obj, i)
            else:
                obj = obj[i]

        return obj, first
email/architecture.rst000064400000022531151153537640011064 0ustar00:mod:`email` Package Architecture
=================================

Overview
--------

The email package consists of three major components:

    Model
        An object structure that represents an email message, and provides an
        API for creating, querying, and modifying a message.

    Parser
        Takes a sequence of characters or bytes and produces a model of the
        email message represented by those characters or bytes.

    Generator
        Takes a model and turns it into a sequence of characters or bytes.  The
        sequence can either be intended for human consumption (a printable
        unicode string) or bytes suitable for transmission over the wire.  In
        the latter case all data is properly encoded using the content transfer
        encodings specified by the relevant RFCs.

Conceptually the package is organized around the model.  The model provides both
"external" APIs intended for use by application programs using the library,
and "internal" APIs intended for use by the Parser and Generator components.
This division is intentionally a bit fuzzy; the API described by this
documentation is all a public, stable API.  This allows for an application
with special needs to implement its own parser and/or generator.

In addition to the three major functional components, there is a third key
component to the architecture:

    Policy
        An object that specifies various behavioral settings and carries
        implementations of various behavior-controlling methods.

The Policy framework provides a simple and convenient way to control the
behavior of the library, making it possible for the library to be used in a
very flexible fashion while leveraging the common code required to parse,
represent, and generate message-like objects.  For example, in addition to the
default :rfc:`5322` email message policy, we also have a policy that manages
HTTP headers in a fashion compliant with :rfc:`2616`.  Individual policy
controls, such as the maximum line length produced by the generator, can also
be controlled individually to meet specialized application requirements.


The Model
---------

The message model is implemented by the :class:`~email.message.Message` class.
The model divides a message into the two fundamental parts discussed by the
RFC: the header section and the body.  The `Message` object acts as a
pseudo-dictionary of named headers.  Its dictionary interface provides
convenient access to individual headers by name.  However, all headers are kept
internally in an ordered list, so that the information about the order of the
headers in the original message is preserved.

The `Message` object also has a `payload` that holds the body.  A `payload` can
be one of two things: data, or a list of `Message` objects.  The latter is used
to represent a multipart MIME message.  Lists can be nested arbitrarily deeply
in order to represent the message, with all terminal leaves having non-list
data payloads.


Message Lifecycle
-----------------

The general lifecycle of a message is:

    Creation
        A `Message` object can be created by a Parser, or it can be
        instantiated as an empty message by an application.

    Manipulation
        The application may examine one or more headers, and/or the
        payload, and it may modify one or more headers and/or
        the payload.  This may be done on the top level `Message`
        object, or on any sub-object.

    Finalization
        The Model is converted into a unicode or binary stream,
        or the model is discarded.



Header Policy Control During Lifecycle
--------------------------------------

One of the major controls exerted by the Policy is the management of headers
during the `Message` lifecycle.  Most applications don't need to be aware of
this.

A header enters the model in one of two ways: via a Parser, or by being set to
a specific value by an application program after the Model already exists.
Similarly, a header exits the model in one of two ways: by being serialized by
a Generator, or by being retrieved from a Model by an application program.  The
Policy object provides hooks for all four of these pathways.

The model storage for headers is a list of (name, value) tuples.

The Parser identifies headers during parsing, and passes them to the
:meth:`~email.policy.Policy.header_source_parse` method of the Policy.  The
result of that method is the (name, value) tuple to be stored in the model.

When an application program supplies a header value (for example, through the
`Message` object `__setitem__` interface), the name and the value are passed to
the :meth:`~email.policy.Policy.header_store_parse` method of the Policy, which
returns the (name, value) tuple to be stored in the model.

When an application program retrieves a header (through any of the dict or list
interfaces of `Message`), the name and value are passed to the
:meth:`~email.policy.Policy.header_fetch_parse` method of the Policy to
obtain the value returned to the application.

When a Generator requests a header during serialization, the name and value are
passed to the :meth:`~email.policy.Policy.fold` method of the Policy, which
returns a string containing line breaks in the appropriate places.  The
:meth:`~email.policy.Policy.cte_type` Policy control determines whether or
not Content Transfer Encoding is performed on the data in the header.  There is
also a :meth:`~email.policy.Policy.binary_fold` method for use by generators
that produce binary output, which returns the folded header as binary data,
possibly folded at different places than the corresponding string would be.


Handling Binary Data
--------------------

In an ideal world all message data would conform to the RFCs, meaning that the
parser could decode the message into the idealized unicode message that the
sender originally wrote.  In the real world, the email package must also be
able to deal with badly formatted messages, including messages containing
non-ASCII characters that either have no indicated character set or are not
valid characters in the indicated character set.

Since email messages are *primarily* text data, and operations on message data
are primarily text operations (except for binary payloads of course), the model
stores all text data as unicode strings.  Un-decodable binary inside text
data is handled by using the `surrogateescape` error handler of the ASCII
codec.  As with the binary filenames the error handler was introduced to
handle, this allows the email package to "carry" the binary data received
during parsing along until the output stage, at which time it is regenerated
in its original form.

This carried binary data is almost entirely an implementation detail.  The one
place where it is visible in the API is in the "internal" API.  A Parser must
do the `surrogateescape` encoding of binary input data, and pass that data to
the appropriate Policy method.  The "internal" interface used by the Generator
to access header values preserves the `surrogateescaped` bytes.  All other
interfaces convert the binary data either back into bytes or into a safe form
(losing information in some cases).


Backward Compatibility
----------------------

The :class:`~email.policy.Policy.Compat32` Policy provides backward
compatibility with version 5.1 of the email package.  It does this via the
following implementation of the four+1 Policy methods described above:

header_source_parse
    Splits the first line on the colon to obtain the name, discards any spaces
    after the colon, and joins the remainder of the line with all of the
    remaining lines, preserving the linesep characters to obtain the value.
    Trailing carriage return and/or linefeed characters are stripped from the
    resulting value string.

header_store_parse
    Returns the name and value exactly as received from the application.

header_fetch_parse
    If the value contains any `surrogateescaped` binary data, return the value
    as a :class:`~email.header.Header` object, using the character set
    `unknown-8bit`.  Otherwise just returns the value.

fold
    Uses :class:`~email.header.Header`'s folding to fold headers in the
    same way the email5.1 generator did.

binary_fold
    Same as fold, but encodes to 'ascii'.


New Algorithm
-------------

header_source_parse
    Same as legacy behavior.

header_store_parse
    Same as legacy behavior.

header_fetch_parse
    If the value is already a header object, returns it.  Otherwise, parses the
    value using the new parser, and returns the resulting object as the value.
    `surrogateescaped` bytes get turned into unicode unknown character code
    points.

fold
    Uses the new header folding algorithm, respecting the policy settings.
    surrogateescaped bytes are encoded using the ``unknown-8bit`` charset for
    ``cte_type=7bit`` or ``8bit``.  Returns a string.

    At some point there will also be a ``cte_type=unicode``, and for that
    policy fold will serialize the idealized unicode message with RFC-like
    folding, converting any surrogateescaped bytes into the unicode
    unknown character glyph.

binary_fold
    Uses the new header folding algorithm, respecting the policy settings.
    surrogateescaped bytes are encoded using the `unknown-8bit` charset for
    ``cte_type=7bit``, and get turned back into bytes for ``cte_type=8bit``.
    Returns bytes.

    At some point there will also be a ``cte_type=unicode``, and for that
    policy binary_fold will serialize the message according to :rfc:``5335``.
email/_policybase.py000064400000035341151153537640010516 0ustar00"""Policy framework for the email package.

Allows fine grained feature control of how the package parses and emits data.
"""

import abc
from email import header
from email import charset as _charset
from email.utils import _has_surrogates

__all__ = [
    'Policy',
    'Compat32',
    'compat32',
    ]


class _PolicyBase:

    """Policy Object basic framework.

    This class is useless unless subclassed.  A subclass should define
    class attributes with defaults for any values that are to be
    managed by the Policy object.  The constructor will then allow
    non-default values to be set for these attributes at instance
    creation time.  The instance will be callable, taking these same
    attributes keyword arguments, and returning a new instance
    identical to the called instance except for those values changed
    by the keyword arguments.  Instances may be added, yielding new
    instances with any non-default values from the right hand
    operand overriding those in the left hand operand.  That is,

        A + B == A(<non-default values of B>)

    The repr of an instance can be used to reconstruct the object
    if and only if the repr of the values can be used to reconstruct
    those values.

    """

    def __init__(self, **kw):
        """Create new Policy, possibly overriding some defaults.

        See class docstring for a list of overridable attributes.

        """
        for name, value in kw.items():
            if hasattr(self, name):
                super(_PolicyBase,self).__setattr__(name, value)
            else:
                raise TypeError(
                    "{!r} is an invalid keyword argument for {}".format(
                        name, self.__class__.__name__))

    def __repr__(self):
        args = [ "{}={!r}".format(name, value)
                 for name, value in self.__dict__.items() ]
        return "{}({})".format(self.__class__.__name__, ', '.join(args))

    def clone(self, **kw):
        """Return a new instance with specified attributes changed.

        The new instance has the same attribute values as the current object,
        except for the changes passed in as keyword arguments.

        """
        newpolicy = self.__class__.__new__(self.__class__)
        for attr, value in self.__dict__.items():
            object.__setattr__(newpolicy, attr, value)
        for attr, value in kw.items():
            if not hasattr(self, attr):
                raise TypeError(
                    "{!r} is an invalid keyword argument for {}".format(
                        attr, self.__class__.__name__))
            object.__setattr__(newpolicy, attr, value)
        return newpolicy

    def __setattr__(self, name, value):
        if hasattr(self, name):
            msg = "{!r} object attribute {!r} is read-only"
        else:
            msg = "{!r} object has no attribute {!r}"
        raise AttributeError(msg.format(self.__class__.__name__, name))

    def __add__(self, other):
        """Non-default values from right operand override those from left.

        The object returned is a new instance of the subclass.

        """
        return self.clone(**other.__dict__)


def _append_doc(doc, added_doc):
    doc = doc.rsplit('\n', 1)[0]
    added_doc = added_doc.split('\n', 1)[1]
    return doc + '\n' + added_doc

def _extend_docstrings(cls):
    if cls.__doc__ and cls.__doc__.startswith('+'):
        cls.__doc__ = _append_doc(cls.__bases__[0].__doc__, cls.__doc__)
    for name, attr in cls.__dict__.items():
        if attr.__doc__ and attr.__doc__.startswith('+'):
            for c in (c for base in cls.__bases__ for c in base.mro()):
                doc = getattr(getattr(c, name), '__doc__')
                if doc:
                    attr.__doc__ = _append_doc(doc, attr.__doc__)
                    break
    return cls


class Policy(_PolicyBase, metaclass=abc.ABCMeta):

    r"""Controls for how messages are interpreted and formatted.

    Most of the classes and many of the methods in the email package accept
    Policy objects as parameters.  A Policy object contains a set of values and
    functions that control how input is interpreted and how output is rendered.
    For example, the parameter 'raise_on_defect' controls whether or not an RFC
    violation results in an error being raised or not, while 'max_line_length'
    controls the maximum length of output lines when a Message is serialized.

    Any valid attribute may be overridden when a Policy is created by passing
    it as a keyword argument to the constructor.  Policy objects are immutable,
    but a new Policy object can be created with only certain values changed by
    calling the Policy instance with keyword arguments.  Policy objects can
    also be added, producing a new Policy object in which the non-default
    attributes set in the right hand operand overwrite those specified in the
    left operand.

    Settable attributes:

    raise_on_defect     -- If true, then defects should be raised as errors.
                           Default: False.

    linesep             -- string containing the value to use as separation
                           between output lines.  Default '\n'.

    cte_type            -- Type of allowed content transfer encodings

                           7bit  -- ASCII only
                           8bit  -- Content-Transfer-Encoding: 8bit is allowed

                           Default: 8bit.  Also controls the disposition of
                           (RFC invalid) binary data in headers; see the
                           documentation of the binary_fold method.

    max_line_length     -- maximum length of lines, excluding 'linesep',
                           during serialization.  None or 0 means no line
                           wrapping is done.  Default is 78.

    mangle_from_        -- a flag that, when True escapes From_ lines in the
                           body of the message by putting a `>' in front of
                           them. This is used when the message is being
                           serialized by a generator. Default: True.

    message_factory     -- the class to use to create new message objects.
                           If the value is None, the default is Message.

    """

    raise_on_defect = False
    linesep = '\n'
    cte_type = '8bit'
    max_line_length = 78
    mangle_from_ = False
    message_factory = None

    def handle_defect(self, obj, defect):
        """Based on policy, either raise defect or call register_defect.

            handle_defect(obj, defect)

        defect should be a Defect subclass, but in any case must be an
        Exception subclass.  obj is the object on which the defect should be
        registered if it is not raised.  If the raise_on_defect is True, the
        defect is raised as an error, otherwise the object and the defect are
        passed to register_defect.

        This method is intended to be called by parsers that discover defects.
        The email package parsers always call it with Defect instances.

        """
        if self.raise_on_defect:
            raise defect
        self.register_defect(obj, defect)

    def register_defect(self, obj, defect):
        """Record 'defect' on 'obj'.

        Called by handle_defect if raise_on_defect is False.  This method is
        part of the Policy API so that Policy subclasses can implement custom
        defect handling.  The default implementation calls the append method of
        the defects attribute of obj.  The objects used by the email package by
        default that get passed to this method will always have a defects
        attribute with an append method.

        """
        obj.defects.append(defect)

    def header_max_count(self, name):
        """Return the maximum allowed number of headers named 'name'.

        Called when a header is added to a Message object.  If the returned
        value is not 0 or None, and there are already a number of headers with
        the name 'name' equal to the value returned, a ValueError is raised.

        Because the default behavior of Message's __setitem__ is to append the
        value to the list of headers, it is easy to create duplicate headers
        without realizing it.  This method allows certain headers to be limited
        in the number of instances of that header that may be added to a
        Message programmatically.  (The limit is not observed by the parser,
        which will faithfully produce as many headers as exist in the message
        being parsed.)

        The default implementation returns None for all header names.
        """
        return None

    @abc.abstractmethod
    def header_source_parse(self, sourcelines):
        """Given a list of linesep terminated strings constituting the lines of
        a single header, return the (name, value) tuple that should be stored
        in the model.  The input lines should retain their terminating linesep
        characters.  The lines passed in by the email package may contain
        surrogateescaped binary data.
        """
        raise NotImplementedError

    @abc.abstractmethod
    def header_store_parse(self, name, value):
        """Given the header name and the value provided by the application
        program, return the (name, value) that should be stored in the model.
        """
        raise NotImplementedError

    @abc.abstractmethod
    def header_fetch_parse(self, name, value):
        """Given the header name and the value from the model, return the value
        to be returned to the application program that is requesting that
        header.  The value passed in by the email package may contain
        surrogateescaped binary data if the lines were parsed by a BytesParser.
        The returned value should not contain any surrogateescaped data.

        """
        raise NotImplementedError

    @abc.abstractmethod
    def fold(self, name, value):
        """Given the header name and the value from the model, return a string
        containing linesep characters that implement the folding of the header
        according to the policy controls.  The value passed in by the email
        package may contain surrogateescaped binary data if the lines were
        parsed by a BytesParser.  The returned value should not contain any
        surrogateescaped data.

        """
        raise NotImplementedError

    @abc.abstractmethod
    def fold_binary(self, name, value):
        """Given the header name and the value from the model, return binary
        data containing linesep characters that implement the folding of the
        header according to the policy controls.  The value passed in by the
        email package may contain surrogateescaped binary data.

        """
        raise NotImplementedError


@_extend_docstrings
class Compat32(Policy):

    """+
    This particular policy is the backward compatibility Policy.  It
    replicates the behavior of the email package version 5.1.
    """

    mangle_from_ = True

    def _sanitize_header(self, name, value):
        # If the header value contains surrogates, return a Header using
        # the unknown-8bit charset to encode the bytes as encoded words.
        if not isinstance(value, str):
            # Assume it is already a header object
            return value
        if _has_surrogates(value):
            return header.Header(value, charset=_charset.UNKNOWN8BIT,
                                 header_name=name)
        else:
            return value

    def header_source_parse(self, sourcelines):
        """+
        The name is parsed as everything up to the ':' and returned unmodified.
        The value is determined by stripping leading whitespace off the
        remainder of the first line, joining all subsequent lines together, and
        stripping any trailing carriage return or linefeed characters.

        """
        name, value = sourcelines[0].split(':', 1)
        value = value.lstrip(' \t') + ''.join(sourcelines[1:])
        return (name, value.rstrip('\r\n'))

    def header_store_parse(self, name, value):
        """+
        The name and value are returned unmodified.
        """
        return (name, value)

    def header_fetch_parse(self, name, value):
        """+
        If the value contains binary data, it is converted into a Header object
        using the unknown-8bit charset.  Otherwise it is returned unmodified.
        """
        return self._sanitize_header(name, value)

    def fold(self, name, value):
        """+
        Headers are folded using the Header folding algorithm, which preserves
        existing line breaks in the value, and wraps each resulting line to the
        max_line_length.  Non-ASCII binary data are CTE encoded using the
        unknown-8bit charset.

        """
        return self._fold(name, value, sanitize=True)

    def fold_binary(self, name, value):
        """+
        Headers are folded using the Header folding algorithm, which preserves
        existing line breaks in the value, and wraps each resulting line to the
        max_line_length.  If cte_type is 7bit, non-ascii binary data is CTE
        encoded using the unknown-8bit charset.  Otherwise the original source
        header is used, with its existing line breaks and/or binary data.

        """
        folded = self._fold(name, value, sanitize=self.cte_type=='7bit')
        return folded.encode('ascii', 'surrogateescape')

    def _fold(self, name, value, sanitize):
        parts = []
        parts.append('%s: ' % name)
        if isinstance(value, str):
            if _has_surrogates(value):
                if sanitize:
                    h = header.Header(value,
                                      charset=_charset.UNKNOWN8BIT,
                                      header_name=name)
                else:
                    # If we have raw 8bit data in a byte string, we have no idea
                    # what the encoding is.  There is no safe way to split this
                    # string.  If it's ascii-subset, then we could do a normal
                    # ascii split, but if it's multibyte then we could break the
                    # string.  There's no way to know so the least harm seems to
                    # be to not split the string and risk it being too long.
                    parts.append(value)
                    h = None
            else:
                h = header.Header(value, header_name=name)
        else:
            # Assume it is a Header-like object.
            h = value
        if h is not None:
            # The Header class interprets a value of None for maxlinelen as the
            # default value of 78, as recommended by RFC 2822.
            maxlinelen = 0
            if self.max_line_length is not None:
                maxlinelen = self.max_line_length
            parts.append(h.encode(linesep=self.linesep, maxlinelen=maxlinelen))
        parts.append(self.linesep)
        return ''.join(parts)


compat32 = Compat32()
email/_encoded_words.py000064400000020514151153537640011177 0ustar00""" Routines for manipulating RFC2047 encoded words.

This is currently a package-private API, but will be considered for promotion
to a public API if there is demand.

"""

# An ecoded word looks like this:
#
#        =?charset[*lang]?cte?encoded_string?=
#
# for more information about charset see the charset module.  Here it is one
# of the preferred MIME charset names (hopefully; you never know when parsing).
# cte (Content Transfer Encoding) is either 'q' or 'b' (ignoring case).  In
# theory other letters could be used for other encodings, but in practice this
# (almost?) never happens.  There could be a public API for adding entries
# to the CTE tables, but YAGNI for now.  'q' is Quoted Printable, 'b' is
# Base64.  The meaning of encoded_string should be obvious.  'lang' is optional
# as indicated by the brackets (they are not part of the syntax) but is almost
# never encountered in practice.
#
# The general interface for a CTE decoder is that it takes the encoded_string
# as its argument, and returns a tuple (cte_decoded_string, defects).  The
# cte_decoded_string is the original binary that was encoded using the
# specified cte.  'defects' is a list of MessageDefect instances indicating any
# problems encountered during conversion.  'charset' and 'lang' are the
# corresponding strings extracted from the EW, case preserved.
#
# The general interface for a CTE encoder is that it takes a binary sequence
# as input and returns the cte_encoded_string, which is an ascii-only string.
#
# Each decoder must also supply a length function that takes the binary
# sequence as its argument and returns the length of the resulting encoded
# string.
#
# The main API functions for the module are decode, which calls the decoder
# referenced by the cte specifier, and encode, which adds the appropriate
# RFC 2047 "chrome" to the encoded string, and can optionally automatically
# select the shortest possible encoding.  See their docstrings below for
# details.

import re
import base64
import binascii
import functools
from string import ascii_letters, digits
from email import errors

__all__ = ['decode_q',
           'encode_q',
           'decode_b',
           'encode_b',
           'len_q',
           'len_b',
           'decode',
           'encode',
           ]

#
# Quoted Printable
#

# regex based decoder.
_q_byte_subber = functools.partial(re.compile(br'=([a-fA-F0-9]{2})').sub,
        lambda m: bytes.fromhex(m.group(1).decode()))

def decode_q(encoded):
    encoded = encoded.replace(b'_', b' ')
    return _q_byte_subber(encoded), []


# dict mapping bytes to their encoded form
class _QByteMap(dict):

    safe = b'-!*+/' + ascii_letters.encode('ascii') + digits.encode('ascii')

    def __missing__(self, key):
        if key in self.safe:
            self[key] = chr(key)
        else:
            self[key] = "={:02X}".format(key)
        return self[key]

_q_byte_map = _QByteMap()

# In headers spaces are mapped to '_'.
_q_byte_map[ord(' ')] = '_'

def encode_q(bstring):
    return ''.join(_q_byte_map[x] for x in bstring)

def len_q(bstring):
    return sum(len(_q_byte_map[x]) for x in bstring)


#
# Base64
#

def decode_b(encoded):
    # First try encoding with validate=True, fixing the padding if needed.
    # This will succeed only if encoded includes no invalid characters.
    pad_err = len(encoded) % 4
    missing_padding = b'==='[:4-pad_err] if pad_err else b''
    try:
        return (
            base64.b64decode(encoded + missing_padding, validate=True),
            [errors.InvalidBase64PaddingDefect()] if pad_err else [],
        )
    except binascii.Error:
        # Since we had correct padding, this is likely an invalid char error.
        #
        # The non-alphabet characters are ignored as far as padding
        # goes, but we don't know how many there are.  So try without adding
        # padding to see if it works.
        try:
            return (
                base64.b64decode(encoded, validate=False),
                [errors.InvalidBase64CharactersDefect()],
            )
        except binascii.Error:
            # Add as much padding as could possibly be necessary (extra padding
            # is ignored).
            try:
                return (
                    base64.b64decode(encoded + b'==', validate=False),
                    [errors.InvalidBase64CharactersDefect(),
                     errors.InvalidBase64PaddingDefect()],
                )
            except binascii.Error:
                # This only happens when the encoded string's length is 1 more
                # than a multiple of 4, which is invalid.
                #
                # bpo-27397: Just return the encoded string since there's no
                # way to decode.
                return encoded, [errors.InvalidBase64LengthDefect()]

def encode_b(bstring):
    return base64.b64encode(bstring).decode('ascii')

def len_b(bstring):
    groups_of_3, leftover = divmod(len(bstring), 3)
    # 4 bytes out for each 3 bytes (or nonzero fraction thereof) in.
    return groups_of_3 * 4 + (4 if leftover else 0)


_cte_decoders = {
    'q': decode_q,
    'b': decode_b,
    }

def decode(ew):
    """Decode encoded word and return (string, charset, lang, defects) tuple.

    An RFC 2047/2243 encoded word has the form:

        =?charset*lang?cte?encoded_string?=

    where '*lang' may be omitted but the other parts may not be.

    This function expects exactly such a string (that is, it does not check the
    syntax and may raise errors if the string is not well formed), and returns
    the encoded_string decoded first from its Content Transfer Encoding and
    then from the resulting bytes into unicode using the specified charset.  If
    the cte-decoded string does not successfully decode using the specified
    character set, a defect is added to the defects list and the unknown octets
    are replaced by the unicode 'unknown' character \\uFDFF.

    The specified charset and language are returned.  The default for language,
    which is rarely if ever encountered, is the empty string.

    """
    _, charset, cte, cte_string, _ = ew.split('?')
    charset, _, lang = charset.partition('*')
    cte = cte.lower()
    # Recover the original bytes and do CTE decoding.
    bstring = cte_string.encode('ascii', 'surrogateescape')
    bstring, defects = _cte_decoders[cte](bstring)
    # Turn the CTE decoded bytes into unicode.
    try:
        string = bstring.decode(charset)
    except UnicodeError:
        defects.append(errors.UndecodableBytesDefect("Encoded word "
            "contains bytes not decodable using {} charset".format(charset)))
        string = bstring.decode(charset, 'surrogateescape')
    except LookupError:
        string = bstring.decode('ascii', 'surrogateescape')
        if charset.lower() != 'unknown-8bit':
            defects.append(errors.CharsetError("Unknown charset {} "
                "in encoded word; decoded as unknown bytes".format(charset)))
    return string, charset, lang, defects


_cte_encoders = {
    'q': encode_q,
    'b': encode_b,
    }

_cte_encode_length = {
    'q': len_q,
    'b': len_b,
    }

def encode(string, charset='utf-8', encoding=None, lang=''):
    """Encode string using the CTE encoding that produces the shorter result.

    Produces an RFC 2047/2243 encoded word of the form:

        =?charset*lang?cte?encoded_string?=

    where '*lang' is omitted unless the 'lang' parameter is given a value.
    Optional argument charset (defaults to utf-8) specifies the charset to use
    to encode the string to binary before CTE encoding it.  Optional argument
    'encoding' is the cte specifier for the encoding that should be used ('q'
    or 'b'); if it is None (the default) the encoding which produces the
    shortest encoded sequence is used, except that 'q' is preferred if it is up
    to five characters longer.  Optional argument 'lang' (default '') gives the
    RFC 2243 language string to specify in the encoded word.

    """
    if charset == 'unknown-8bit':
        bstring = string.encode('ascii', 'surrogateescape')
    else:
        bstring = string.encode(charset)
    if encoding is None:
        qlen = _cte_encode_length['q'](bstring)
        blen = _cte_encode_length['b'](bstring)
        # Bias toward q.  5 is arbitrary.
        encoding = 'q' if qlen - blen < 5 else 'b'
    encoded = _cte_encoders[encoding](bstring)
    if lang:
        lang = '*' + lang
    return "=?{}{}?{}?{}?=".format(charset, lang, encoding, encoded)
email/generator.py000064400000047344151153537640010221 0ustar00# Copyright (C) 2001-2010 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org

"""Classes to generate plain text from a message object tree."""

__all__ = ['Generator', 'DecodedGenerator', 'BytesGenerator']

import re
import sys
import time
import random

from copy import deepcopy
from io import StringIO, BytesIO
from email.utils import _has_surrogates

UNDERSCORE = '_'
NL = '\n'  # XXX: no longer used by the code below.

NLCRE = re.compile(r'\r\n|\r|\n')
fcre = re.compile(r'^From ', re.MULTILINE)



class Generator:
    """Generates output from a Message object tree.

    This basic generator writes the message to the given file object as plain
    text.
    """
    #
    # Public interface
    #

    def __init__(self, outfp, mangle_from_=None, maxheaderlen=None, *,
                 policy=None):
        """Create the generator for message flattening.

        outfp is the output file-like object for writing the message to.  It
        must have a write() method.

        Optional mangle_from_ is a flag that, when True (the default if policy
        is not set), escapes From_ lines in the body of the message by putting
        a `>' in front of them.

        Optional maxheaderlen specifies the longest length for a non-continued
        header.  When a header line is longer (in characters, with tabs
        expanded to 8 spaces) than maxheaderlen, the header will split as
        defined in the Header class.  Set maxheaderlen to zero to disable
        header wrapping.  The default is 78, as recommended (but not required)
        by RFC 2822.

        The policy keyword specifies a policy object that controls a number of
        aspects of the generator's operation.  If no policy is specified,
        the policy associated with the Message object passed to the
        flatten method is used.

        """

        if mangle_from_ is None:
            mangle_from_ = True if policy is None else policy.mangle_from_
        self._fp = outfp
        self._mangle_from_ = mangle_from_
        self.maxheaderlen = maxheaderlen
        self.policy = policy

    def write(self, s):
        # Just delegate to the file object
        self._fp.write(s)

    def flatten(self, msg, unixfrom=False, linesep=None):
        r"""Print the message object tree rooted at msg to the output file
        specified when the Generator instance was created.

        unixfrom is a flag that forces the printing of a Unix From_ delimiter
        before the first object in the message tree.  If the original message
        has no From_ delimiter, a `standard' one is crafted.  By default, this
        is False to inhibit the printing of any From_ delimiter.

        Note that for subobjects, no From_ line is printed.

        linesep specifies the characters used to indicate a new line in
        the output.  The default value is determined by the policy specified
        when the Generator instance was created or, if none was specified,
        from the policy associated with the msg.

        """
        # We use the _XXX constants for operating on data that comes directly
        # from the msg, and _encoded_XXX constants for operating on data that
        # has already been converted (to bytes in the BytesGenerator) and
        # inserted into a temporary buffer.
        policy = msg.policy if self.policy is None else self.policy
        if linesep is not None:
            policy = policy.clone(linesep=linesep)
        if self.maxheaderlen is not None:
            policy = policy.clone(max_line_length=self.maxheaderlen)
        self._NL = policy.linesep
        self._encoded_NL = self._encode(self._NL)
        self._EMPTY = ''
        self._encoded_EMPTY = self._encode(self._EMPTY)
        # Because we use clone (below) when we recursively process message
        # subparts, and because clone uses the computed policy (not None),
        # submessages will automatically get set to the computed policy when
        # they are processed by this code.
        old_gen_policy = self.policy
        old_msg_policy = msg.policy
        try:
            self.policy = policy
            msg.policy = policy
            if unixfrom:
                ufrom = msg.get_unixfrom()
                if not ufrom:
                    ufrom = 'From nobody ' + time.ctime(time.time())
                self.write(ufrom + self._NL)
            self._write(msg)
        finally:
            self.policy = old_gen_policy
            msg.policy = old_msg_policy

    def clone(self, fp):
        """Clone this generator with the exact same options."""
        return self.__class__(fp,
                              self._mangle_from_,
                              None, # Use policy setting, which we've adjusted
                              policy=self.policy)

    #
    # Protected interface - undocumented ;/
    #

    # Note that we use 'self.write' when what we are writing is coming from
    # the source, and self._fp.write when what we are writing is coming from a
    # buffer (because the Bytes subclass has already had a chance to transform
    # the data in its write method in that case).  This is an entirely
    # pragmatic split determined by experiment; we could be more general by
    # always using write and having the Bytes subclass write method detect when
    # it has already transformed the input; but, since this whole thing is a
    # hack anyway this seems good enough.

    def _new_buffer(self):
        # BytesGenerator overrides this to return BytesIO.
        return StringIO()

    def _encode(self, s):
        # BytesGenerator overrides this to encode strings to bytes.
        return s

    def _write_lines(self, lines):
        # We have to transform the line endings.
        if not lines:
            return
        lines = NLCRE.split(lines)
        for line in lines[:-1]:
            self.write(line)
            self.write(self._NL)
        if lines[-1]:
            self.write(lines[-1])
        # XXX logic tells me this else should be needed, but the tests fail
        # with it and pass without it.  (NLCRE.split ends with a blank element
        # if and only if there was a trailing newline.)
        #else:
        #    self.write(self._NL)

    def _write(self, msg):
        # We can't write the headers yet because of the following scenario:
        # say a multipart message includes the boundary string somewhere in
        # its body.  We'd have to calculate the new boundary /before/ we write
        # the headers so that we can write the correct Content-Type:
        # parameter.
        #
        # The way we do this, so as to make the _handle_*() methods simpler,
        # is to cache any subpart writes into a buffer.  The we write the
        # headers and the buffer contents.  That way, subpart handlers can
        # Do The Right Thing, and can still modify the Content-Type: header if
        # necessary.
        oldfp = self._fp
        try:
            self._munge_cte = None
            self._fp = sfp = self._new_buffer()
            self._dispatch(msg)
        finally:
            self._fp = oldfp
            munge_cte = self._munge_cte
            del self._munge_cte
        # If we munged the cte, copy the message again and re-fix the CTE.
        if munge_cte:
            msg = deepcopy(msg)
            # Preserve the header order if the CTE header already exists.
            if msg.get('content-transfer-encoding') is None:
                msg['Content-Transfer-Encoding'] = munge_cte[0]
            else:
                msg.replace_header('content-transfer-encoding', munge_cte[0])
            msg.replace_header('content-type', munge_cte[1])
        # Write the headers.  First we see if the message object wants to
        # handle that itself.  If not, we'll do it generically.
        meth = getattr(msg, '_write_headers', None)
        if meth is None:
            self._write_headers(msg)
        else:
            meth(self)
        self._fp.write(sfp.getvalue())

    def _dispatch(self, msg):
        # Get the Content-Type: for the message, then try to dispatch to
        # self._handle_<maintype>_<subtype>().  If there's no handler for the
        # full MIME type, then dispatch to self._handle_<maintype>().  If
        # that's missing too, then dispatch to self._writeBody().
        main = msg.get_content_maintype()
        sub = msg.get_content_subtype()
        specific = UNDERSCORE.join((main, sub)).replace('-', '_')
        meth = getattr(self, '_handle_' + specific, None)
        if meth is None:
            generic = main.replace('-', '_')
            meth = getattr(self, '_handle_' + generic, None)
            if meth is None:
                meth = self._writeBody
        meth(msg)

    #
    # Default handlers
    #

    def _write_headers(self, msg):
        for h, v in msg.raw_items():
            self.write(self.policy.fold(h, v))
        # A blank line always separates headers from body
        self.write(self._NL)

    #
    # Handlers for writing types and subtypes
    #

    def _handle_text(self, msg):
        payload = msg.get_payload()
        if payload is None:
            return
        if not isinstance(payload, str):
            raise TypeError('string payload expected: %s' % type(payload))
        if _has_surrogates(msg._payload):
            charset = msg.get_param('charset')
            if charset is not None:
                # XXX: This copy stuff is an ugly hack to avoid modifying the
                # existing message.
                msg = deepcopy(msg)
                del msg['content-transfer-encoding']
                msg.set_payload(payload, charset)
                payload = msg.get_payload()
                self._munge_cte = (msg['content-transfer-encoding'],
                                   msg['content-type'])
        if self._mangle_from_:
            payload = fcre.sub('>From ', payload)
        self._write_lines(payload)

    # Default body handler
    _writeBody = _handle_text

    def _handle_multipart(self, msg):
        # The trick here is to write out each part separately, merge them all
        # together, and then make sure that the boundary we've chosen isn't
        # present in the payload.
        msgtexts = []
        subparts = msg.get_payload()
        if subparts is None:
            subparts = []
        elif isinstance(subparts, str):
            # e.g. a non-strict parse of a message with no starting boundary.
            self.write(subparts)
            return
        elif not isinstance(subparts, list):
            # Scalar payload
            subparts = [subparts]
        for part in subparts:
            s = self._new_buffer()
            g = self.clone(s)
            g.flatten(part, unixfrom=False, linesep=self._NL)
            msgtexts.append(s.getvalue())
        # BAW: What about boundaries that are wrapped in double-quotes?
        boundary = msg.get_boundary()
        if not boundary:
            # Create a boundary that doesn't appear in any of the
            # message texts.
            alltext = self._encoded_NL.join(msgtexts)
            boundary = self._make_boundary(alltext)
            msg.set_boundary(boundary)
        # If there's a preamble, write it out, with a trailing CRLF
        if msg.preamble is not None:
            if self._mangle_from_:
                preamble = fcre.sub('>From ', msg.preamble)
            else:
                preamble = msg.preamble
            self._write_lines(preamble)
            self.write(self._NL)
        # dash-boundary transport-padding CRLF
        self.write('--' + boundary + self._NL)
        # body-part
        if msgtexts:
            self._fp.write(msgtexts.pop(0))
        # *encapsulation
        # --> delimiter transport-padding
        # --> CRLF body-part
        for body_part in msgtexts:
            # delimiter transport-padding CRLF
            self.write(self._NL + '--' + boundary + self._NL)
            # body-part
            self._fp.write(body_part)
        # close-delimiter transport-padding
        self.write(self._NL + '--' + boundary + '--' + self._NL)
        if msg.epilogue is not None:
            if self._mangle_from_:
                epilogue = fcre.sub('>From ', msg.epilogue)
            else:
                epilogue = msg.epilogue
            self._write_lines(epilogue)

    def _handle_multipart_signed(self, msg):
        # The contents of signed parts has to stay unmodified in order to keep
        # the signature intact per RFC1847 2.1, so we disable header wrapping.
        # RDM: This isn't enough to completely preserve the part, but it helps.
        p = self.policy
        self.policy = p.clone(max_line_length=0)
        try:
            self._handle_multipart(msg)
        finally:
            self.policy = p

    def _handle_message_delivery_status(self, msg):
        # We can't just write the headers directly to self's file object
        # because this will leave an extra newline between the last header
        # block and the boundary.  Sigh.
        blocks = []
        for part in msg.get_payload():
            s = self._new_buffer()
            g = self.clone(s)
            g.flatten(part, unixfrom=False, linesep=self._NL)
            text = s.getvalue()
            lines = text.split(self._encoded_NL)
            # Strip off the unnecessary trailing empty line
            if lines and lines[-1] == self._encoded_EMPTY:
                blocks.append(self._encoded_NL.join(lines[:-1]))
            else:
                blocks.append(text)
        # Now join all the blocks with an empty line.  This has the lovely
        # effect of separating each block with an empty line, but not adding
        # an extra one after the last one.
        self._fp.write(self._encoded_NL.join(blocks))

    def _handle_message(self, msg):
        s = self._new_buffer()
        g = self.clone(s)
        # The payload of a message/rfc822 part should be a multipart sequence
        # of length 1.  The zeroth element of the list should be the Message
        # object for the subpart.  Extract that object, stringify it, and
        # write it out.
        # Except, it turns out, when it's a string instead, which happens when
        # and only when HeaderParser is used on a message of mime type
        # message/rfc822.  Such messages are generated by, for example,
        # Groupwise when forwarding unadorned messages.  (Issue 7970.)  So
        # in that case we just emit the string body.
        payload = msg._payload
        if isinstance(payload, list):
            g.flatten(msg.get_payload(0), unixfrom=False, linesep=self._NL)
            payload = s.getvalue()
        else:
            payload = self._encode(payload)
        self._fp.write(payload)

    # This used to be a module level function; we use a classmethod for this
    # and _compile_re so we can continue to provide the module level function
    # for backward compatibility by doing
    #   _make_boundary = Generator._make_boundary
    # at the end of the module.  It *is* internal, so we could drop that...
    @classmethod
    def _make_boundary(cls, text=None):
        # Craft a random boundary.  If text is given, ensure that the chosen
        # boundary doesn't appear in the text.
        token = random.randrange(sys.maxsize)
        boundary = ('=' * 15) + (_fmt % token) + '=='
        if text is None:
            return boundary
        b = boundary
        counter = 0
        while True:
            cre = cls._compile_re('^--' + re.escape(b) + '(--)?$', re.MULTILINE)
            if not cre.search(text):
                break
            b = boundary + '.' + str(counter)
            counter += 1
        return b

    @classmethod
    def _compile_re(cls, s, flags):
        return re.compile(s, flags)


class BytesGenerator(Generator):
    """Generates a bytes version of a Message object tree.

    Functionally identical to the base Generator except that the output is
    bytes and not string.  When surrogates were used in the input to encode
    bytes, these are decoded back to bytes for output.  If the policy has
    cte_type set to 7bit, then the message is transformed such that the
    non-ASCII bytes are properly content transfer encoded, using the charset
    unknown-8bit.

    The outfp object must accept bytes in its write method.
    """

    def write(self, s):
        self._fp.write(s.encode('ascii', 'surrogateescape'))

    def _new_buffer(self):
        return BytesIO()

    def _encode(self, s):
        return s.encode('ascii')

    def _write_headers(self, msg):
        # This is almost the same as the string version, except for handling
        # strings with 8bit bytes.
        for h, v in msg.raw_items():
            self._fp.write(self.policy.fold_binary(h, v))
        # A blank line always separates headers from body
        self.write(self._NL)

    def _handle_text(self, msg):
        # If the string has surrogates the original source was bytes, so
        # just write it back out.
        if msg._payload is None:
            return
        if _has_surrogates(msg._payload) and not self.policy.cte_type=='7bit':
            if self._mangle_from_:
                msg._payload = fcre.sub(">From ", msg._payload)
            self._write_lines(msg._payload)
        else:
            super(BytesGenerator,self)._handle_text(msg)

    # Default body handler
    _writeBody = _handle_text

    @classmethod
    def _compile_re(cls, s, flags):
        return re.compile(s.encode('ascii'), flags)



_FMT = '[Non-text (%(type)s) part of message omitted, filename %(filename)s]'

class DecodedGenerator(Generator):
    """Generates a text representation of a message.

    Like the Generator base class, except that non-text parts are substituted
    with a format string representing the part.
    """
    def __init__(self, outfp, mangle_from_=None, maxheaderlen=None, fmt=None, *,
                 policy=None):
        """Like Generator.__init__() except that an additional optional
        argument is allowed.

        Walks through all subparts of a message.  If the subpart is of main
        type `text', then it prints the decoded payload of the subpart.

        Otherwise, fmt is a format string that is used instead of the message
        payload.  fmt is expanded with the following keywords (in
        %(keyword)s format):

        type       : Full MIME type of the non-text part
        maintype   : Main MIME type of the non-text part
        subtype    : Sub-MIME type of the non-text part
        filename   : Filename of the non-text part
        description: Description associated with the non-text part
        encoding   : Content transfer encoding of the non-text part

        The default value for fmt is None, meaning

        [Non-text (%(type)s) part of message omitted, filename %(filename)s]
        """
        Generator.__init__(self, outfp, mangle_from_, maxheaderlen,
                           policy=policy)
        if fmt is None:
            self._fmt = _FMT
        else:
            self._fmt = fmt

    def _dispatch(self, msg):
        for part in msg.walk():
            maintype = part.get_content_maintype()
            if maintype == 'text':
                print(part.get_payload(decode=False), file=self)
            elif maintype == 'multipart':
                # Just skip this
                pass
            else:
                print(self._fmt % {
                    'type'       : part.get_content_type(),
                    'maintype'   : part.get_content_maintype(),
                    'subtype'    : part.get_content_subtype(),
                    'filename'   : part.get_filename('[no filename]'),
                    'description': part.get('Content-Description',
                                            '[no description]'),
                    'encoding'   : part.get('Content-Transfer-Encoding',
                                            '[no encoding]'),
                    }, file=self)



# Helper used by Generator._make_boundary
_width = len(repr(sys.maxsize-1))
_fmt = '%%0%dd' % _width

# Backward compatibility
_make_boundary = Generator._make_boundary
email/feedparser.py000064400000054374151153537640010354 0ustar00# Copyright (C) 2004-2006 Python Software Foundation
# Authors: Baxter, Wouters and Warsaw
# Contact: email-sig@python.org

"""FeedParser - An email feed parser.

The feed parser implements an interface for incrementally parsing an email
message, line by line.  This has advantages for certain applications, such as
those reading email messages off a socket.

FeedParser.feed() is the primary interface for pushing new data into the
parser.  It returns when there's nothing more it can do with the available
data.  When you have no more data to push into the parser, call .close().
This completes the parsing and returns the root message object.

The other advantage of this parser is that it will never raise a parsing
exception.  Instead, when it finds something unexpected, it adds a 'defect' to
the current message.  Defects are just instances that live on the message
object's .defects attribute.
"""

__all__ = ['FeedParser', 'BytesFeedParser']

import re

from email import errors
from email._policybase import compat32
from collections import deque
from io import StringIO

NLCRE = re.compile(r'\r\n|\r|\n')
NLCRE_bol = re.compile(r'(\r\n|\r|\n)')
NLCRE_eol = re.compile(r'(\r\n|\r|\n)\Z')
NLCRE_crack = re.compile(r'(\r\n|\r|\n)')
# RFC 2822 $3.6.8 Optional fields.  ftext is %d33-57 / %d59-126, Any character
# except controls, SP, and ":".
headerRE = re.compile(r'^(From |[\041-\071\073-\176]*:|[\t ])')
EMPTYSTRING = ''
NL = '\n'

NeedMoreData = object()



class BufferedSubFile(object):
    """A file-ish object that can have new data loaded into it.

    You can also push and pop line-matching predicates onto a stack.  When the
    current predicate matches the current line, a false EOF response
    (i.e. empty string) is returned instead.  This lets the parser adhere to a
    simple abstraction -- it parses until EOF closes the current message.
    """
    def __init__(self):
        # Text stream of the last partial line pushed into this object.
        # See issue 22233 for why this is a text stream and not a list.
        self._partial = StringIO(newline='')
        # A deque of full, pushed lines
        self._lines = deque()
        # The stack of false-EOF checking predicates.
        self._eofstack = []
        # A flag indicating whether the file has been closed or not.
        self._closed = False

    def push_eof_matcher(self, pred):
        self._eofstack.append(pred)

    def pop_eof_matcher(self):
        return self._eofstack.pop()

    def close(self):
        # Don't forget any trailing partial line.
        self._partial.seek(0)
        self.pushlines(self._partial.readlines())
        self._partial.seek(0)
        self._partial.truncate()
        self._closed = True

    def readline(self):
        if not self._lines:
            if self._closed:
                return ''
            return NeedMoreData
        # Pop the line off the stack and see if it matches the current
        # false-EOF predicate.
        line = self._lines.popleft()
        # RFC 2046, section 5.1.2 requires us to recognize outer level
        # boundaries at any level of inner nesting.  Do this, but be sure it's
        # in the order of most to least nested.
        for ateof in reversed(self._eofstack):
            if ateof(line):
                # We're at the false EOF.  But push the last line back first.
                self._lines.appendleft(line)
                return ''
        return line

    def unreadline(self, line):
        # Let the consumer push a line back into the buffer.
        assert line is not NeedMoreData
        self._lines.appendleft(line)

    def push(self, data):
        """Push some new data into this object."""
        self._partial.write(data)
        if '\n' not in data and '\r' not in data:
            # No new complete lines, wait for more.
            return

        # Crack into lines, preserving the linesep characters.
        self._partial.seek(0)
        parts = self._partial.readlines()
        self._partial.seek(0)
        self._partial.truncate()

        # If the last element of the list does not end in a newline, then treat
        # it as a partial line.  We only check for '\n' here because a line
        # ending with '\r' might be a line that was split in the middle of a
        # '\r\n' sequence (see bugs 1555570 and 1721862).
        if not parts[-1].endswith('\n'):
            self._partial.write(parts.pop())
        self.pushlines(parts)

    def pushlines(self, lines):
        self._lines.extend(lines)

    def __iter__(self):
        return self

    def __next__(self):
        line = self.readline()
        if line == '':
            raise StopIteration
        return line



class FeedParser:
    """A feed-style parser of email."""

    def __init__(self, _factory=None, *, policy=compat32):
        """_factory is called with no arguments to create a new message obj

        The policy keyword specifies a policy object that controls a number of
        aspects of the parser's operation.  The default policy maintains
        backward compatibility.

        """
        self.policy = policy
        self._old_style_factory = False
        if _factory is None:
            if policy.message_factory is None:
                from email.message import Message
                self._factory = Message
            else:
                self._factory = policy.message_factory
        else:
            self._factory = _factory
            try:
                _factory(policy=self.policy)
            except TypeError:
                # Assume this is an old-style factory
                self._old_style_factory = True
        self._input = BufferedSubFile()
        self._msgstack = []
        self._parse = self._parsegen().__next__
        self._cur = None
        self._last = None
        self._headersonly = False

    # Non-public interface for supporting Parser's headersonly flag
    def _set_headersonly(self):
        self._headersonly = True

    def feed(self, data):
        """Push more data into the parser."""
        self._input.push(data)
        self._call_parse()

    def _call_parse(self):
        try:
            self._parse()
        except StopIteration:
            pass

    def close(self):
        """Parse all remaining data and return the root message object."""
        self._input.close()
        self._call_parse()
        root = self._pop_message()
        assert not self._msgstack
        # Look for final set of defects
        if root.get_content_maintype() == 'multipart' \
               and not root.is_multipart():
            defect = errors.MultipartInvariantViolationDefect()
            self.policy.handle_defect(root, defect)
        return root

    def _new_message(self):
        if self._old_style_factory:
            msg = self._factory()
        else:
            msg = self._factory(policy=self.policy)
        if self._cur and self._cur.get_content_type() == 'multipart/digest':
            msg.set_default_type('message/rfc822')
        if self._msgstack:
            self._msgstack[-1].attach(msg)
        self._msgstack.append(msg)
        self._cur = msg
        self._last = msg

    def _pop_message(self):
        retval = self._msgstack.pop()
        if self._msgstack:
            self._cur = self._msgstack[-1]
        else:
            self._cur = None
        return retval

    def _parsegen(self):
        # Create a new message and start by parsing headers.
        self._new_message()
        headers = []
        # Collect the headers, searching for a line that doesn't match the RFC
        # 2822 header or continuation pattern (including an empty line).
        for line in self._input:
            if line is NeedMoreData:
                yield NeedMoreData
                continue
            if not headerRE.match(line):
                # If we saw the RFC defined header/body separator
                # (i.e. newline), just throw it away. Otherwise the line is
                # part of the body so push it back.
                if not NLCRE.match(line):
                    defect = errors.MissingHeaderBodySeparatorDefect()
                    self.policy.handle_defect(self._cur, defect)
                    self._input.unreadline(line)
                break
            headers.append(line)
        # Done with the headers, so parse them and figure out what we're
        # supposed to see in the body of the message.
        self._parse_headers(headers)
        # Headers-only parsing is a backwards compatibility hack, which was
        # necessary in the older parser, which could raise errors.  All
        # remaining lines in the input are thrown into the message body.
        if self._headersonly:
            lines = []
            while True:
                line = self._input.readline()
                if line is NeedMoreData:
                    yield NeedMoreData
                    continue
                if line == '':
                    break
                lines.append(line)
            self._cur.set_payload(EMPTYSTRING.join(lines))
            return
        if self._cur.get_content_type() == 'message/delivery-status':
            # message/delivery-status contains blocks of headers separated by
            # a blank line.  We'll represent each header block as a separate
            # nested message object, but the processing is a bit different
            # than standard message/* types because there is no body for the
            # nested messages.  A blank line separates the subparts.
            while True:
                self._input.push_eof_matcher(NLCRE.match)
                for retval in self._parsegen():
                    if retval is NeedMoreData:
                        yield NeedMoreData
                        continue
                    break
                msg = self._pop_message()
                # We need to pop the EOF matcher in order to tell if we're at
                # the end of the current file, not the end of the last block
                # of message headers.
                self._input.pop_eof_matcher()
                # The input stream must be sitting at the newline or at the
                # EOF.  We want to see if we're at the end of this subpart, so
                # first consume the blank line, then test the next line to see
                # if we're at this subpart's EOF.
                while True:
                    line = self._input.readline()
                    if line is NeedMoreData:
                        yield NeedMoreData
                        continue
                    break
                while True:
                    line = self._input.readline()
                    if line is NeedMoreData:
                        yield NeedMoreData
                        continue
                    break
                if line == '':
                    break
                # Not at EOF so this is a line we're going to need.
                self._input.unreadline(line)
            return
        if self._cur.get_content_maintype() == 'message':
            # The message claims to be a message/* type, then what follows is
            # another RFC 2822 message.
            for retval in self._parsegen():
                if retval is NeedMoreData:
                    yield NeedMoreData
                    continue
                break
            self._pop_message()
            return
        if self._cur.get_content_maintype() == 'multipart':
            boundary = self._cur.get_boundary()
            if boundary is None:
                # The message /claims/ to be a multipart but it has not
                # defined a boundary.  That's a problem which we'll handle by
                # reading everything until the EOF and marking the message as
                # defective.
                defect = errors.NoBoundaryInMultipartDefect()
                self.policy.handle_defect(self._cur, defect)
                lines = []
                for line in self._input:
                    if line is NeedMoreData:
                        yield NeedMoreData
                        continue
                    lines.append(line)
                self._cur.set_payload(EMPTYSTRING.join(lines))
                return
            # Make sure a valid content type was specified per RFC 2045:6.4.
            if (str(self._cur.get('content-transfer-encoding', '8bit')).lower()
                    not in ('7bit', '8bit', 'binary')):
                defect = errors.InvalidMultipartContentTransferEncodingDefect()
                self.policy.handle_defect(self._cur, defect)
            # Create a line match predicate which matches the inter-part
            # boundary as well as the end-of-multipart boundary.  Don't push
            # this onto the input stream until we've scanned past the
            # preamble.
            separator = '--' + boundary
            boundaryre = re.compile(
                '(?P<sep>' + re.escape(separator) +
                r')(?P<end>--)?(?P<ws>[ \t]*)(?P<linesep>\r\n|\r|\n)?$')
            capturing_preamble = True
            preamble = []
            linesep = False
            close_boundary_seen = False
            while True:
                line = self._input.readline()
                if line is NeedMoreData:
                    yield NeedMoreData
                    continue
                if line == '':
                    break
                mo = boundaryre.match(line)
                if mo:
                    # If we're looking at the end boundary, we're done with
                    # this multipart.  If there was a newline at the end of
                    # the closing boundary, then we need to initialize the
                    # epilogue with the empty string (see below).
                    if mo.group('end'):
                        close_boundary_seen = True
                        linesep = mo.group('linesep')
                        break
                    # We saw an inter-part boundary.  Were we in the preamble?
                    if capturing_preamble:
                        if preamble:
                            # According to RFC 2046, the last newline belongs
                            # to the boundary.
                            lastline = preamble[-1]
                            eolmo = NLCRE_eol.search(lastline)
                            if eolmo:
                                preamble[-1] = lastline[:-len(eolmo.group(0))]
                            self._cur.preamble = EMPTYSTRING.join(preamble)
                        capturing_preamble = False
                        self._input.unreadline(line)
                        continue
                    # We saw a boundary separating two parts.  Consume any
                    # multiple boundary lines that may be following.  Our
                    # interpretation of RFC 2046 BNF grammar does not produce
                    # body parts within such double boundaries.
                    while True:
                        line = self._input.readline()
                        if line is NeedMoreData:
                            yield NeedMoreData
                            continue
                        mo = boundaryre.match(line)
                        if not mo:
                            self._input.unreadline(line)
                            break
                    # Recurse to parse this subpart; the input stream points
                    # at the subpart's first line.
                    self._input.push_eof_matcher(boundaryre.match)
                    for retval in self._parsegen():
                        if retval is NeedMoreData:
                            yield NeedMoreData
                            continue
                        break
                    # Because of RFC 2046, the newline preceding the boundary
                    # separator actually belongs to the boundary, not the
                    # previous subpart's payload (or epilogue if the previous
                    # part is a multipart).
                    if self._last.get_content_maintype() == 'multipart':
                        epilogue = self._last.epilogue
                        if epilogue == '':
                            self._last.epilogue = None
                        elif epilogue is not None:
                            mo = NLCRE_eol.search(epilogue)
                            if mo:
                                end = len(mo.group(0))
                                self._last.epilogue = epilogue[:-end]
                    else:
                        payload = self._last._payload
                        if isinstance(payload, str):
                            mo = NLCRE_eol.search(payload)
                            if mo:
                                payload = payload[:-len(mo.group(0))]
                                self._last._payload = payload
                    self._input.pop_eof_matcher()
                    self._pop_message()
                    # Set the multipart up for newline cleansing, which will
                    # happen if we're in a nested multipart.
                    self._last = self._cur
                else:
                    # I think we must be in the preamble
                    assert capturing_preamble
                    preamble.append(line)
            # We've seen either the EOF or the end boundary.  If we're still
            # capturing the preamble, we never saw the start boundary.  Note
            # that as a defect and store the captured text as the payload.
            if capturing_preamble:
                defect = errors.StartBoundaryNotFoundDefect()
                self.policy.handle_defect(self._cur, defect)
                self._cur.set_payload(EMPTYSTRING.join(preamble))
                epilogue = []
                for line in self._input:
                    if line is NeedMoreData:
                        yield NeedMoreData
                        continue
                self._cur.epilogue = EMPTYSTRING.join(epilogue)
                return
            # If we're not processing the preamble, then we might have seen
            # EOF without seeing that end boundary...that is also a defect.
            if not close_boundary_seen:
                defect = errors.CloseBoundaryNotFoundDefect()
                self.policy.handle_defect(self._cur, defect)
                return
            # Everything from here to the EOF is epilogue.  If the end boundary
            # ended in a newline, we'll need to make sure the epilogue isn't
            # None
            if linesep:
                epilogue = ['']
            else:
                epilogue = []
            for line in self._input:
                if line is NeedMoreData:
                    yield NeedMoreData
                    continue
                epilogue.append(line)
            # Any CRLF at the front of the epilogue is not technically part of
            # the epilogue.  Also, watch out for an empty string epilogue,
            # which means a single newline.
            if epilogue:
                firstline = epilogue[0]
                bolmo = NLCRE_bol.match(firstline)
                if bolmo:
                    epilogue[0] = firstline[len(bolmo.group(0)):]
            self._cur.epilogue = EMPTYSTRING.join(epilogue)
            return
        # Otherwise, it's some non-multipart type, so the entire rest of the
        # file contents becomes the payload.
        lines = []
        for line in self._input:
            if line is NeedMoreData:
                yield NeedMoreData
                continue
            lines.append(line)
        self._cur.set_payload(EMPTYSTRING.join(lines))

    def _parse_headers(self, lines):
        # Passed a list of lines that make up the headers for the current msg
        lastheader = ''
        lastvalue = []
        for lineno, line in enumerate(lines):
            # Check for continuation
            if line[0] in ' \t':
                if not lastheader:
                    # The first line of the headers was a continuation.  This
                    # is illegal, so let's note the defect, store the illegal
                    # line, and ignore it for purposes of headers.
                    defect = errors.FirstHeaderLineIsContinuationDefect(line)
                    self.policy.handle_defect(self._cur, defect)
                    continue
                lastvalue.append(line)
                continue
            if lastheader:
                self._cur.set_raw(*self.policy.header_source_parse(lastvalue))
                lastheader, lastvalue = '', []
            # Check for envelope header, i.e. unix-from
            if line.startswith('From '):
                if lineno == 0:
                    # Strip off the trailing newline
                    mo = NLCRE_eol.search(line)
                    if mo:
                        line = line[:-len(mo.group(0))]
                    self._cur.set_unixfrom(line)
                    continue
                elif lineno == len(lines) - 1:
                    # Something looking like a unix-from at the end - it's
                    # probably the first line of the body, so push back the
                    # line and stop.
                    self._input.unreadline(line)
                    return
                else:
                    # Weirdly placed unix-from line.  Note this as a defect
                    # and ignore it.
                    defect = errors.MisplacedEnvelopeHeaderDefect(line)
                    self._cur.defects.append(defect)
                    continue
            # Split the line on the colon separating field name from value.
            # There will always be a colon, because if there wasn't the part of
            # the parser that calls us would have started parsing the body.
            i = line.find(':')

            # If the colon is on the start of the line the header is clearly
            # malformed, but we might be able to salvage the rest of the
            # message. Track the error but keep going.
            if i == 0:
                defect = errors.InvalidHeaderDefect("Missing header name.")
                self._cur.defects.append(defect)
                continue

            assert i>0, "_parse_headers fed line with no : and no leading WS"
            lastheader = line[:i]
            lastvalue = [line]
        # Done with all the lines, so handle the last header.
        if lastheader:
            self._cur.set_raw(*self.policy.header_source_parse(lastvalue))


class BytesFeedParser(FeedParser):
    """Like FeedParser, but feed accepts bytes."""

    def feed(self, data):
        super().feed(data.decode('ascii', 'surrogateescape'))
email/_header_value_parser.py000064400000320717151153537640012370 0ustar00"""Header value parser implementing various email-related RFC parsing rules.

The parsing methods defined in this module implement various email related
parsing rules.  Principal among them is RFC 5322, which is the followon
to RFC 2822 and primarily a clarification of the former.  It also implements
RFC 2047 encoded word decoding.

RFC 5322 goes to considerable trouble to maintain backward compatibility with
RFC 822 in the parse phase, while cleaning up the structure on the generation
phase.  This parser supports correct RFC 5322 generation by tagging white space
as folding white space only when folding is allowed in the non-obsolete rule
sets.  Actually, the parser is even more generous when accepting input than RFC
5322 mandates, following the spirit of Postel's Law, which RFC 5322 encourages.
Where possible deviations from the standard are annotated on the 'defects'
attribute of tokens that deviate.

The general structure of the parser follows RFC 5322, and uses its terminology
where there is a direct correspondence.  Where the implementation requires a
somewhat different structure than that used by the formal grammar, new terms
that mimic the closest existing terms are used.  Thus, it really helps to have
a copy of RFC 5322 handy when studying this code.

Input to the parser is a string that has already been unfolded according to
RFC 5322 rules.  According to the RFC this unfolding is the very first step, and
this parser leaves the unfolding step to a higher level message parser, which
will have already detected the line breaks that need unfolding while
determining the beginning and end of each header.

The output of the parser is a TokenList object, which is a list subclass.  A
TokenList is a recursive data structure.  The terminal nodes of the structure
are Terminal objects, which are subclasses of str.  These do not correspond
directly to terminal objects in the formal grammar, but are instead more
practical higher level combinations of true terminals.

All TokenList and Terminal objects have a 'value' attribute, which produces the
semantically meaningful value of that part of the parse subtree.  The value of
all whitespace tokens (no matter how many sub-tokens they may contain) is a
single space, as per the RFC rules.  This includes 'CFWS', which is herein
included in the general class of whitespace tokens.  There is one exception to
the rule that whitespace tokens are collapsed into single spaces in values: in
the value of a 'bare-quoted-string' (a quoted-string with no leading or
trailing whitespace), any whitespace that appeared between the quotation marks
is preserved in the returned value.  Note that in all Terminal strings quoted
pairs are turned into their unquoted values.

All TokenList and Terminal objects also have a string value, which attempts to
be a "canonical" representation of the RFC-compliant form of the substring that
produced the parsed subtree, including minimal use of quoted pair quoting.
Whitespace runs are not collapsed.

Comment tokens also have a 'content' attribute providing the string found
between the parens (including any nested comments) with whitespace preserved.

All TokenList and Terminal objects have a 'defects' attribute which is a
possibly empty list all of the defects found while creating the token.  Defects
may appear on any token in the tree, and a composite list of all defects in the
subtree is available through the 'all_defects' attribute of any node.  (For
Terminal notes x.defects == x.all_defects.)

Each object in a parse tree is called a 'token', and each has a 'token_type'
attribute that gives the name from the RFC 5322 grammar that it represents.
Not all RFC 5322 nodes are produced, and there is one non-RFC 5322 node that
may be produced: 'ptext'.  A 'ptext' is a string of printable ascii characters.
It is returned in place of lists of (ctext/quoted-pair) and
(qtext/quoted-pair).

XXX: provide complete list of token types.
"""

import re
import sys
import urllib   # For urllib.parse.unquote
from string import hexdigits
from operator import itemgetter
from email import _encoded_words as _ew
from email import errors
from email import utils

#
# Useful constants and functions
#

WSP = set(' \t')
CFWS_LEADER = WSP | set('(')
SPECIALS = set(r'()<>@,:;.\"[]')
ATOM_ENDS = SPECIALS | WSP
DOT_ATOM_ENDS = ATOM_ENDS - set('.')
# '.', '"', and '(' do not end phrases in order to support obs-phrase
PHRASE_ENDS = SPECIALS - set('."(')
TSPECIALS = (SPECIALS | set('/?=')) - set('.')
TOKEN_ENDS = TSPECIALS | WSP
ASPECIALS = TSPECIALS | set("*'%")
ATTRIBUTE_ENDS = ASPECIALS | WSP
EXTENDED_ATTRIBUTE_ENDS = ATTRIBUTE_ENDS - set('%')

def quote_string(value):
    return '"'+str(value).replace('\\', '\\\\').replace('"', r'\"')+'"'

# Match a RFC 2047 word, looks like =?utf-8?q?someword?=
rfc2047_matcher = re.compile(r'''
   =\?            # literal =?
   [^?]*          # charset
   \?             # literal ?
   [qQbB]         # literal 'q' or 'b', case insensitive
   \?             # literal ?
  .*?             # encoded word
  \?=             # literal ?=
''', re.VERBOSE | re.MULTILINE)


#
# TokenList and its subclasses
#

class TokenList(list):

    token_type = None
    syntactic_break = True
    ew_combine_allowed = True

    def __init__(self, *args, **kw):
        super().__init__(*args, **kw)
        self.defects = []

    def __str__(self):
        return ''.join(str(x) for x in self)

    def __repr__(self):
        return '{}({})'.format(self.__class__.__name__,
                             super().__repr__())

    @property
    def value(self):
        return ''.join(x.value for x in self if x.value)

    @property
    def all_defects(self):
        return sum((x.all_defects for x in self), self.defects)

    def startswith_fws(self):
        return self[0].startswith_fws()

    @property
    def as_ew_allowed(self):
        """True if all top level tokens of this part may be RFC2047 encoded."""
        return all(part.as_ew_allowed for part in self)

    @property
    def comments(self):
        comments = []
        for token in self:
            comments.extend(token.comments)
        return comments

    def fold(self, *, policy):
        return _refold_parse_tree(self, policy=policy)

    def pprint(self, indent=''):
        print(self.ppstr(indent=indent))

    def ppstr(self, indent=''):
        return '\n'.join(self._pp(indent=indent))

    def _pp(self, indent=''):
        yield '{}{}/{}('.format(
            indent,
            self.__class__.__name__,
            self.token_type)
        for token in self:
            if not hasattr(token, '_pp'):
                yield (indent + '    !! invalid element in token '
                                        'list: {!r}'.format(token))
            else:
                yield from token._pp(indent+'    ')
        if self.defects:
            extra = ' Defects: {}'.format(self.defects)
        else:
            extra = ''
        yield '{}){}'.format(indent, extra)


class WhiteSpaceTokenList(TokenList):

    @property
    def value(self):
        return ' '

    @property
    def comments(self):
        return [x.content for x in self if x.token_type=='comment']


class UnstructuredTokenList(TokenList):
    token_type = 'unstructured'


class Phrase(TokenList):
    token_type = 'phrase'

class Word(TokenList):
    token_type = 'word'


class CFWSList(WhiteSpaceTokenList):
    token_type = 'cfws'


class Atom(TokenList):
    token_type = 'atom'


class Token(TokenList):
    token_type = 'token'
    encode_as_ew = False


class EncodedWord(TokenList):
    token_type = 'encoded-word'
    cte = None
    charset = None
    lang = None


class QuotedString(TokenList):

    token_type = 'quoted-string'

    @property
    def content(self):
        for x in self:
            if x.token_type == 'bare-quoted-string':
                return x.value

    @property
    def quoted_value(self):
        res = []
        for x in self:
            if x.token_type == 'bare-quoted-string':
                res.append(str(x))
            else:
                res.append(x.value)
        return ''.join(res)

    @property
    def stripped_value(self):
        for token in self:
            if token.token_type == 'bare-quoted-string':
                return token.value


class BareQuotedString(QuotedString):

    token_type = 'bare-quoted-string'

    def __str__(self):
        return quote_string(''.join(str(x) for x in self))

    @property
    def value(self):
        return ''.join(str(x) for x in self)


class Comment(WhiteSpaceTokenList):

    token_type = 'comment'

    def __str__(self):
        return ''.join(sum([
                            ["("],
                            [self.quote(x) for x in self],
                            [")"],
                            ], []))

    def quote(self, value):
        if value.token_type == 'comment':
            return str(value)
        return str(value).replace('\\', '\\\\').replace(
                                  '(', r'\(').replace(
                                  ')', r'\)')

    @property
    def content(self):
        return ''.join(str(x) for x in self)

    @property
    def comments(self):
        return [self.content]

class AddressList(TokenList):

    token_type = 'address-list'

    @property
    def addresses(self):
        return [x for x in self if x.token_type=='address']

    @property
    def mailboxes(self):
        return sum((x.mailboxes
                    for x in self if x.token_type=='address'), [])

    @property
    def all_mailboxes(self):
        return sum((x.all_mailboxes
                    for x in self if x.token_type=='address'), [])


class Address(TokenList):

    token_type = 'address'

    @property
    def display_name(self):
        if self[0].token_type == 'group':
            return self[0].display_name

    @property
    def mailboxes(self):
        if self[0].token_type == 'mailbox':
            return [self[0]]
        elif self[0].token_type == 'invalid-mailbox':
            return []
        return self[0].mailboxes

    @property
    def all_mailboxes(self):
        if self[0].token_type == 'mailbox':
            return [self[0]]
        elif self[0].token_type == 'invalid-mailbox':
            return [self[0]]
        return self[0].all_mailboxes

class MailboxList(TokenList):

    token_type = 'mailbox-list'

    @property
    def mailboxes(self):
        return [x for x in self if x.token_type=='mailbox']

    @property
    def all_mailboxes(self):
        return [x for x in self
            if x.token_type in ('mailbox', 'invalid-mailbox')]


class GroupList(TokenList):

    token_type = 'group-list'

    @property
    def mailboxes(self):
        if not self or self[0].token_type != 'mailbox-list':
            return []
        return self[0].mailboxes

    @property
    def all_mailboxes(self):
        if not self or self[0].token_type != 'mailbox-list':
            return []
        return self[0].all_mailboxes


class Group(TokenList):

    token_type = "group"

    @property
    def mailboxes(self):
        if self[2].token_type != 'group-list':
            return []
        return self[2].mailboxes

    @property
    def all_mailboxes(self):
        if self[2].token_type != 'group-list':
            return []
        return self[2].all_mailboxes

    @property
    def display_name(self):
        return self[0].display_name


class NameAddr(TokenList):

    token_type = 'name-addr'

    @property
    def display_name(self):
        if len(self) == 1:
            return None
        return self[0].display_name

    @property
    def local_part(self):
        return self[-1].local_part

    @property
    def domain(self):
        return self[-1].domain

    @property
    def route(self):
        return self[-1].route

    @property
    def addr_spec(self):
        return self[-1].addr_spec


class AngleAddr(TokenList):

    token_type = 'angle-addr'

    @property
    def local_part(self):
        for x in self:
            if x.token_type == 'addr-spec':
                return x.local_part

    @property
    def domain(self):
        for x in self:
            if x.token_type == 'addr-spec':
                return x.domain

    @property
    def route(self):
        for x in self:
            if x.token_type == 'obs-route':
                return x.domains

    @property
    def addr_spec(self):
        for x in self:
            if x.token_type == 'addr-spec':
                if x.local_part:
                    return x.addr_spec
                else:
                    return quote_string(x.local_part) + x.addr_spec
        else:
            return '<>'


class ObsRoute(TokenList):

    token_type = 'obs-route'

    @property
    def domains(self):
        return [x.domain for x in self if x.token_type == 'domain']


class Mailbox(TokenList):

    token_type = 'mailbox'

    @property
    def display_name(self):
        if self[0].token_type == 'name-addr':
            return self[0].display_name

    @property
    def local_part(self):
        return self[0].local_part

    @property
    def domain(self):
        return self[0].domain

    @property
    def route(self):
        if self[0].token_type == 'name-addr':
            return self[0].route

    @property
    def addr_spec(self):
        return self[0].addr_spec


class InvalidMailbox(TokenList):

    token_type = 'invalid-mailbox'

    @property
    def display_name(self):
        return None

    local_part = domain = route = addr_spec = display_name


class Domain(TokenList):

    token_type = 'domain'
    as_ew_allowed = False

    @property
    def domain(self):
        return ''.join(super().value.split())


class DotAtom(TokenList):
    token_type = 'dot-atom'


class DotAtomText(TokenList):
    token_type = 'dot-atom-text'
    as_ew_allowed = True


class NoFoldLiteral(TokenList):
    token_type = 'no-fold-literal'
    as_ew_allowed = False


class AddrSpec(TokenList):

    token_type = 'addr-spec'
    as_ew_allowed = False

    @property
    def local_part(self):
        return self[0].local_part

    @property
    def domain(self):
        if len(self) < 3:
            return None
        return self[-1].domain

    @property
    def value(self):
        if len(self) < 3:
            return self[0].value
        return self[0].value.rstrip()+self[1].value+self[2].value.lstrip()

    @property
    def addr_spec(self):
        nameset = set(self.local_part)
        if len(nameset) > len(nameset-DOT_ATOM_ENDS):
            lp = quote_string(self.local_part)
        else:
            lp = self.local_part
        if self.domain is not None:
            return lp + '@' + self.domain
        return lp


class ObsLocalPart(TokenList):

    token_type = 'obs-local-part'
    as_ew_allowed = False


class DisplayName(Phrase):

    token_type = 'display-name'
    ew_combine_allowed = False

    @property
    def display_name(self):
        res = TokenList(self)
        if len(res) == 0:
            return res.value
        if res[0].token_type == 'cfws':
            res.pop(0)
        else:
            if res[0][0].token_type == 'cfws':
                res[0] = TokenList(res[0][1:])
        if res[-1].token_type == 'cfws':
            res.pop()
        else:
            if res[-1][-1].token_type == 'cfws':
                res[-1] = TokenList(res[-1][:-1])
        return res.value

    @property
    def value(self):
        quote = False
        if self.defects:
            quote = True
        else:
            for x in self:
                if x.token_type == 'quoted-string':
                    quote = True
        if len(self) != 0 and quote:
            pre = post = ''
            if self[0].token_type=='cfws' or self[0][0].token_type=='cfws':
                pre = ' '
            if self[-1].token_type=='cfws' or self[-1][-1].token_type=='cfws':
                post = ' '
            return pre+quote_string(self.display_name)+post
        else:
            return super().value


class LocalPart(TokenList):

    token_type = 'local-part'
    as_ew_allowed = False

    @property
    def value(self):
        if self[0].token_type == "quoted-string":
            return self[0].quoted_value
        else:
            return self[0].value

    @property
    def local_part(self):
        # Strip whitespace from front, back, and around dots.
        res = [DOT]
        last = DOT
        last_is_tl = False
        for tok in self[0] + [DOT]:
            if tok.token_type == 'cfws':
                continue
            if (last_is_tl and tok.token_type == 'dot' and
                    last[-1].token_type == 'cfws'):
                res[-1] = TokenList(last[:-1])
            is_tl = isinstance(tok, TokenList)
            if (is_tl and last.token_type == 'dot' and
                    tok[0].token_type == 'cfws'):
                res.append(TokenList(tok[1:]))
            else:
                res.append(tok)
            last = res[-1]
            last_is_tl = is_tl
        res = TokenList(res[1:-1])
        return res.value


class DomainLiteral(TokenList):

    token_type = 'domain-literal'
    as_ew_allowed = False

    @property
    def domain(self):
        return ''.join(super().value.split())

    @property
    def ip(self):
        for x in self:
            if x.token_type == 'ptext':
                return x.value


class MIMEVersion(TokenList):

    token_type = 'mime-version'
    major = None
    minor = None


class Parameter(TokenList):

    token_type = 'parameter'
    sectioned = False
    extended = False
    charset = 'us-ascii'

    @property
    def section_number(self):
        # Because the first token, the attribute (name) eats CFWS, the second
        # token is always the section if there is one.
        return self[1].number if self.sectioned else 0

    @property
    def param_value(self):
        # This is part of the "handle quoted extended parameters" hack.
        for token in self:
            if token.token_type == 'value':
                return token.stripped_value
            if token.token_type == 'quoted-string':
                for token in token:
                    if token.token_type == 'bare-quoted-string':
                        for token in token:
                            if token.token_type == 'value':
                                return token.stripped_value
        return ''


class InvalidParameter(Parameter):

    token_type = 'invalid-parameter'


class Attribute(TokenList):

    token_type = 'attribute'

    @property
    def stripped_value(self):
        for token in self:
            if token.token_type.endswith('attrtext'):
                return token.value

class Section(TokenList):

    token_type = 'section'
    number = None


class Value(TokenList):

    token_type = 'value'

    @property
    def stripped_value(self):
        token = self[0]
        if token.token_type == 'cfws':
            token = self[1]
        if token.token_type.endswith(
                ('quoted-string', 'attribute', 'extended-attribute')):
            return token.stripped_value
        return self.value


class MimeParameters(TokenList):

    token_type = 'mime-parameters'
    syntactic_break = False

    @property
    def params(self):
        # The RFC specifically states that the ordering of parameters is not
        # guaranteed and may be reordered by the transport layer.  So we have
        # to assume the RFC 2231 pieces can come in any order.  However, we
        # output them in the order that we first see a given name, which gives
        # us a stable __str__.
        params = {}  # Using order preserving dict from Python 3.7+
        for token in self:
            if not token.token_type.endswith('parameter'):
                continue
            if token[0].token_type != 'attribute':
                continue
            name = token[0].value.strip()
            if name not in params:
                params[name] = []
            params[name].append((token.section_number, token))
        for name, parts in params.items():
            parts = sorted(parts, key=itemgetter(0))
            first_param = parts[0][1]
            charset = first_param.charset
            # Our arbitrary error recovery is to ignore duplicate parameters,
            # to use appearance order if there are duplicate rfc 2231 parts,
            # and to ignore gaps.  This mimics the error recovery of get_param.
            if not first_param.extended and len(parts) > 1:
                if parts[1][0] == 0:
                    parts[1][1].defects.append(errors.InvalidHeaderDefect(
                        'duplicate parameter name; duplicate(s) ignored'))
                    parts = parts[:1]
                # Else assume the *0* was missing...note that this is different
                # from get_param, but we registered a defect for this earlier.
            value_parts = []
            i = 0
            for section_number, param in parts:
                if section_number != i:
                    # We could get fancier here and look for a complete
                    # duplicate extended parameter and ignore the second one
                    # seen.  But we're not doing that.  The old code didn't.
                    if not param.extended:
                        param.defects.append(errors.InvalidHeaderDefect(
                            'duplicate parameter name; duplicate ignored'))
                        continue
                    else:
                        param.defects.append(errors.InvalidHeaderDefect(
                            "inconsistent RFC2231 parameter numbering"))
                i += 1
                value = param.param_value
                if param.extended:
                    try:
                        value = urllib.parse.unquote_to_bytes(value)
                    except UnicodeEncodeError:
                        # source had surrogate escaped bytes.  What we do now
                        # is a bit of an open question.  I'm not sure this is
                        # the best choice, but it is what the old algorithm did
                        value = urllib.parse.unquote(value, encoding='latin-1')
                    else:
                        try:
                            value = value.decode(charset, 'surrogateescape')
                        except LookupError:
                            # XXX: there should really be a custom defect for
                            # unknown character set to make it easy to find,
                            # because otherwise unknown charset is a silent
                            # failure.
                            value = value.decode('us-ascii', 'surrogateescape')
                        if utils._has_surrogates(value):
                            param.defects.append(errors.UndecodableBytesDefect())
                value_parts.append(value)
            value = ''.join(value_parts)
            yield name, value

    def __str__(self):
        params = []
        for name, value in self.params:
            if value:
                params.append('{}={}'.format(name, quote_string(value)))
            else:
                params.append(name)
        params = '; '.join(params)
        return ' ' + params if params else ''


class ParameterizedHeaderValue(TokenList):

    # Set this false so that the value doesn't wind up on a new line even
    # if it and the parameters would fit there but not on the first line.
    syntactic_break = False

    @property
    def params(self):
        for token in reversed(self):
            if token.token_type == 'mime-parameters':
                return token.params
        return {}


class ContentType(ParameterizedHeaderValue):
    token_type = 'content-type'
    as_ew_allowed = False
    maintype = 'text'
    subtype = 'plain'


class ContentDisposition(ParameterizedHeaderValue):
    token_type = 'content-disposition'
    as_ew_allowed = False
    content_disposition = None


class ContentTransferEncoding(TokenList):
    token_type = 'content-transfer-encoding'
    as_ew_allowed = False
    cte = '7bit'


class HeaderLabel(TokenList):
    token_type = 'header-label'
    as_ew_allowed = False


class MsgID(TokenList):
    token_type = 'msg-id'
    as_ew_allowed = False

    def fold(self, policy):
        # message-id tokens may not be folded.
        return str(self) + policy.linesep


class MessageID(MsgID):
    token_type = 'message-id'


class InvalidMessageID(MessageID):
    token_type = 'invalid-message-id'


class Header(TokenList):
    token_type = 'header'


#
# Terminal classes and instances
#

class Terminal(str):

    as_ew_allowed = True
    ew_combine_allowed = True
    syntactic_break = True

    def __new__(cls, value, token_type):
        self = super().__new__(cls, value)
        self.token_type = token_type
        self.defects = []
        return self

    def __repr__(self):
        return "{}({})".format(self.__class__.__name__, super().__repr__())

    def pprint(self):
        print(self.__class__.__name__ + '/' + self.token_type)

    @property
    def all_defects(self):
        return list(self.defects)

    def _pp(self, indent=''):
        return ["{}{}/{}({}){}".format(
            indent,
            self.__class__.__name__,
            self.token_type,
            super().__repr__(),
            '' if not self.defects else ' {}'.format(self.defects),
            )]

    def pop_trailing_ws(self):
        # This terminates the recursion.
        return None

    @property
    def comments(self):
        return []

    def __getnewargs__(self):
        return(str(self), self.token_type)


class WhiteSpaceTerminal(Terminal):

    @property
    def value(self):
        return ' '

    def startswith_fws(self):
        return True


class ValueTerminal(Terminal):

    @property
    def value(self):
        return self

    def startswith_fws(self):
        return False


class EWWhiteSpaceTerminal(WhiteSpaceTerminal):

    @property
    def value(self):
        return ''

    def __str__(self):
        return ''


class _InvalidEwError(errors.HeaderParseError):
    """Invalid encoded word found while parsing headers."""


# XXX these need to become classes and used as instances so
# that a program can't change them in a parse tree and screw
# up other parse trees.  Maybe should have  tests for that, too.
DOT = ValueTerminal('.', 'dot')
ListSeparator = ValueTerminal(',', 'list-separator')
RouteComponentMarker = ValueTerminal('@', 'route-component-marker')

#
# Parser
#

# Parse strings according to RFC822/2047/2822/5322 rules.
#
# This is a stateless parser.  Each get_XXX function accepts a string and
# returns either a Terminal or a TokenList representing the RFC object named
# by the method and a string containing the remaining unparsed characters
# from the input.  Thus a parser method consumes the next syntactic construct
# of a given type and returns a token representing the construct plus the
# unparsed remainder of the input string.
#
# For example, if the first element of a structured header is a 'phrase',
# then:
#
#     phrase, value = get_phrase(value)
#
# returns the complete phrase from the start of the string value, plus any
# characters left in the string after the phrase is removed.

_wsp_splitter = re.compile(r'([{}]+)'.format(''.join(WSP))).split
_non_atom_end_matcher = re.compile(r"[^{}]+".format(
    re.escape(''.join(ATOM_ENDS)))).match
_non_printable_finder = re.compile(r"[\x00-\x20\x7F]").findall
_non_token_end_matcher = re.compile(r"[^{}]+".format(
    re.escape(''.join(TOKEN_ENDS)))).match
_non_attribute_end_matcher = re.compile(r"[^{}]+".format(
    re.escape(''.join(ATTRIBUTE_ENDS)))).match
_non_extended_attribute_end_matcher = re.compile(r"[^{}]+".format(
    re.escape(''.join(EXTENDED_ATTRIBUTE_ENDS)))).match

def _validate_xtext(xtext):
    """If input token contains ASCII non-printables, register a defect."""

    non_printables = _non_printable_finder(xtext)
    if non_printables:
        xtext.defects.append(errors.NonPrintableDefect(non_printables))
    if utils._has_surrogates(xtext):
        xtext.defects.append(errors.UndecodableBytesDefect(
            "Non-ASCII characters found in header token"))

def _get_ptext_to_endchars(value, endchars):
    """Scan printables/quoted-pairs until endchars and return unquoted ptext.

    This function turns a run of qcontent, ccontent-without-comments, or
    dtext-with-quoted-printables into a single string by unquoting any
    quoted printables.  It returns the string, the remaining value, and
    a flag that is True iff there were any quoted printables decoded.

    """
    fragment, *remainder = _wsp_splitter(value, 1)
    vchars = []
    escape = False
    had_qp = False
    for pos in range(len(fragment)):
        if fragment[pos] == '\\':
            if escape:
                escape = False
                had_qp = True
            else:
                escape = True
                continue
        if escape:
            escape = False
        elif fragment[pos] in endchars:
            break
        vchars.append(fragment[pos])
    else:
        pos = pos + 1
    return ''.join(vchars), ''.join([fragment[pos:]] + remainder), had_qp

def get_fws(value):
    """FWS = 1*WSP

    This isn't the RFC definition.  We're using fws to represent tokens where
    folding can be done, but when we are parsing the *un*folding has already
    been done so we don't need to watch out for CRLF.

    """
    newvalue = value.lstrip()
    fws = WhiteSpaceTerminal(value[:len(value)-len(newvalue)], 'fws')
    return fws, newvalue

def get_encoded_word(value):
    """ encoded-word = "=?" charset "?" encoding "?" encoded-text "?="

    """
    ew = EncodedWord()
    if not value.startswith('=?'):
        raise errors.HeaderParseError(
            "expected encoded word but found {}".format(value))
    tok, *remainder = value[2:].split('?=', 1)
    if tok == value[2:]:
        raise errors.HeaderParseError(
            "expected encoded word but found {}".format(value))
    remstr = ''.join(remainder)
    if (len(remstr) > 1 and
        remstr[0] in hexdigits and
        remstr[1] in hexdigits and
        tok.count('?') < 2):
        # The ? after the CTE was followed by an encoded word escape (=XX).
        rest, *remainder = remstr.split('?=', 1)
        tok = tok + '?=' + rest
    if len(tok.split()) > 1:
        ew.defects.append(errors.InvalidHeaderDefect(
            "whitespace inside encoded word"))
    ew.cte = value
    value = ''.join(remainder)
    try:
        text, charset, lang, defects = _ew.decode('=?' + tok + '?=')
    except (ValueError, KeyError):
        raise _InvalidEwError(
            "encoded word format invalid: '{}'".format(ew.cte))
    ew.charset = charset
    ew.lang = lang
    ew.defects.extend(defects)
    while text:
        if text[0] in WSP:
            token, text = get_fws(text)
            ew.append(token)
            continue
        chars, *remainder = _wsp_splitter(text, 1)
        vtext = ValueTerminal(chars, 'vtext')
        _validate_xtext(vtext)
        ew.append(vtext)
        text = ''.join(remainder)
    # Encoded words should be followed by a WS
    if value and value[0] not in WSP:
        ew.defects.append(errors.InvalidHeaderDefect(
            "missing trailing whitespace after encoded-word"))
    return ew, value

def get_unstructured(value):
    """unstructured = (*([FWS] vchar) *WSP) / obs-unstruct
       obs-unstruct = *((*LF *CR *(obs-utext) *LF *CR)) / FWS)
       obs-utext = %d0 / obs-NO-WS-CTL / LF / CR

       obs-NO-WS-CTL is control characters except WSP/CR/LF.

    So, basically, we have printable runs, plus control characters or nulls in
    the obsolete syntax, separated by whitespace.  Since RFC 2047 uses the
    obsolete syntax in its specification, but requires whitespace on either
    side of the encoded words, I can see no reason to need to separate the
    non-printable-non-whitespace from the printable runs if they occur, so we
    parse this into xtext tokens separated by WSP tokens.

    Because an 'unstructured' value must by definition constitute the entire
    value, this 'get' routine does not return a remaining value, only the
    parsed TokenList.

    """
    # XXX: but what about bare CR and LF?  They might signal the start or
    # end of an encoded word.  YAGNI for now, since our current parsers
    # will never send us strings with bare CR or LF.

    unstructured = UnstructuredTokenList()
    while value:
        if value[0] in WSP:
            token, value = get_fws(value)
            unstructured.append(token)
            continue
        valid_ew = True
        if value.startswith('=?'):
            try:
                token, value = get_encoded_word(value)
            except _InvalidEwError:
                valid_ew = False
            except errors.HeaderParseError:
                # XXX: Need to figure out how to register defects when
                # appropriate here.
                pass
            else:
                have_ws = True
                if len(unstructured) > 0:
                    if unstructured[-1].token_type != 'fws':
                        unstructured.defects.append(errors.InvalidHeaderDefect(
                            "missing whitespace before encoded word"))
                        have_ws = False
                if have_ws and len(unstructured) > 1:
                    if unstructured[-2].token_type == 'encoded-word':
                        unstructured[-1] = EWWhiteSpaceTerminal(
                            unstructured[-1], 'fws')
                unstructured.append(token)
                continue
        tok, *remainder = _wsp_splitter(value, 1)
        # Split in the middle of an atom if there is a rfc2047 encoded word
        # which does not have WSP on both sides. The defect will be registered
        # the next time through the loop.
        # This needs to only be performed when the encoded word is valid;
        # otherwise, performing it on an invalid encoded word can cause
        # the parser to go in an infinite loop.
        if valid_ew and rfc2047_matcher.search(tok):
            tok, *remainder = value.partition('=?')
        vtext = ValueTerminal(tok, 'vtext')
        _validate_xtext(vtext)
        unstructured.append(vtext)
        value = ''.join(remainder)
    return unstructured

def get_qp_ctext(value):
    r"""ctext = <printable ascii except \ ( )>

    This is not the RFC ctext, since we are handling nested comments in comment
    and unquoting quoted-pairs here.  We allow anything except the '()'
    characters, but if we find any ASCII other than the RFC defined printable
    ASCII, a NonPrintableDefect is added to the token's defects list.  Since
    quoted pairs are converted to their unquoted values, what is returned is
    a 'ptext' token.  In this case it is a WhiteSpaceTerminal, so it's value
    is ' '.

    """
    ptext, value, _ = _get_ptext_to_endchars(value, '()')
    ptext = WhiteSpaceTerminal(ptext, 'ptext')
    _validate_xtext(ptext)
    return ptext, value

def get_qcontent(value):
    """qcontent = qtext / quoted-pair

    We allow anything except the DQUOTE character, but if we find any ASCII
    other than the RFC defined printable ASCII, a NonPrintableDefect is
    added to the token's defects list.  Any quoted pairs are converted to their
    unquoted values, so what is returned is a 'ptext' token.  In this case it
    is a ValueTerminal.

    """
    ptext, value, _ = _get_ptext_to_endchars(value, '"')
    ptext = ValueTerminal(ptext, 'ptext')
    _validate_xtext(ptext)
    return ptext, value

def get_atext(value):
    """atext = <matches _atext_matcher>

    We allow any non-ATOM_ENDS in atext, but add an InvalidATextDefect to
    the token's defects list if we find non-atext characters.
    """
    m = _non_atom_end_matcher(value)
    if not m:
        raise errors.HeaderParseError(
            "expected atext but found '{}'".format(value))
    atext = m.group()
    value = value[len(atext):]
    atext = ValueTerminal(atext, 'atext')
    _validate_xtext(atext)
    return atext, value

def get_bare_quoted_string(value):
    """bare-quoted-string = DQUOTE *([FWS] qcontent) [FWS] DQUOTE

    A quoted-string without the leading or trailing white space.  Its
    value is the text between the quote marks, with whitespace
    preserved and quoted pairs decoded.
    """
    if value[0] != '"':
        raise errors.HeaderParseError(
            "expected '\"' but found '{}'".format(value))
    bare_quoted_string = BareQuotedString()
    value = value[1:]
    if value and value[0] == '"':
        token, value = get_qcontent(value)
        bare_quoted_string.append(token)
    while value and value[0] != '"':
        if value[0] in WSP:
            token, value = get_fws(value)
        elif value[:2] == '=?':
            valid_ew = False
            try:
                token, value = get_encoded_word(value)
                bare_quoted_string.defects.append(errors.InvalidHeaderDefect(
                    "encoded word inside quoted string"))
                valid_ew = True
            except errors.HeaderParseError:
                token, value = get_qcontent(value)
            # Collapse the whitespace between two encoded words that occur in a
            # bare-quoted-string.
            if valid_ew and len(bare_quoted_string) > 1:
                if (bare_quoted_string[-1].token_type == 'fws' and
                        bare_quoted_string[-2].token_type == 'encoded-word'):
                    bare_quoted_string[-1] = EWWhiteSpaceTerminal(
                        bare_quoted_string[-1], 'fws')
        else:
            token, value = get_qcontent(value)
        bare_quoted_string.append(token)
    if not value:
        bare_quoted_string.defects.append(errors.InvalidHeaderDefect(
            "end of header inside quoted string"))
        return bare_quoted_string, value
    return bare_quoted_string, value[1:]

def get_comment(value):
    """comment = "(" *([FWS] ccontent) [FWS] ")"
       ccontent = ctext / quoted-pair / comment

    We handle nested comments here, and quoted-pair in our qp-ctext routine.
    """
    if value and value[0] != '(':
        raise errors.HeaderParseError(
            "expected '(' but found '{}'".format(value))
    comment = Comment()
    value = value[1:]
    while value and value[0] != ")":
        if value[0] in WSP:
            token, value = get_fws(value)
        elif value[0] == '(':
            token, value = get_comment(value)
        else:
            token, value = get_qp_ctext(value)
        comment.append(token)
    if not value:
        comment.defects.append(errors.InvalidHeaderDefect(
            "end of header inside comment"))
        return comment, value
    return comment, value[1:]

def get_cfws(value):
    """CFWS = (1*([FWS] comment) [FWS]) / FWS

    """
    cfws = CFWSList()
    while value and value[0] in CFWS_LEADER:
        if value[0] in WSP:
            token, value = get_fws(value)
        else:
            token, value = get_comment(value)
        cfws.append(token)
    return cfws, value

def get_quoted_string(value):
    """quoted-string = [CFWS] <bare-quoted-string> [CFWS]

    'bare-quoted-string' is an intermediate class defined by this
    parser and not by the RFC grammar.  It is the quoted string
    without any attached CFWS.
    """
    quoted_string = QuotedString()
    if value and value[0] in CFWS_LEADER:
        token, value = get_cfws(value)
        quoted_string.append(token)
    token, value = get_bare_quoted_string(value)
    quoted_string.append(token)
    if value and value[0] in CFWS_LEADER:
        token, value = get_cfws(value)
        quoted_string.append(token)
    return quoted_string, value

def get_atom(value):
    """atom = [CFWS] 1*atext [CFWS]

    An atom could be an rfc2047 encoded word.
    """
    atom = Atom()
    if value and value[0] in CFWS_LEADER:
        token, value = get_cfws(value)
        atom.append(token)
    if value and value[0] in ATOM_ENDS:
        raise errors.HeaderParseError(
            "expected atom but found '{}'".format(value))
    if value.startswith('=?'):
        try:
            token, value = get_encoded_word(value)
        except errors.HeaderParseError:
            # XXX: need to figure out how to register defects when
            # appropriate here.
            token, value = get_atext(value)
    else:
        token, value = get_atext(value)
    atom.append(token)
    if value and value[0] in CFWS_LEADER:
        token, value = get_cfws(value)
        atom.append(token)
    return atom, value

def get_dot_atom_text(value):
    """ dot-text = 1*atext *("." 1*atext)

    """
    dot_atom_text = DotAtomText()
    if not value or value[0] in ATOM_ENDS:
        raise errors.HeaderParseError("expected atom at a start of "
            "dot-atom-text but found '{}'".format(value))
    while value and value[0] not in ATOM_ENDS:
        token, value = get_atext(value)
        dot_atom_text.append(token)
        if value and value[0] == '.':
            dot_atom_text.append(DOT)
            value = value[1:]
    if dot_atom_text[-1] is DOT:
        raise errors.HeaderParseError("expected atom at end of dot-atom-text "
            "but found '{}'".format('.'+value))
    return dot_atom_text, value

def get_dot_atom(value):
    """ dot-atom = [CFWS] dot-atom-text [CFWS]

    Any place we can have a dot atom, we could instead have an rfc2047 encoded
    word.
    """
    dot_atom = DotAtom()
    if value[0] in CFWS_LEADER:
        token, value = get_cfws(value)
        dot_atom.append(token)
    if value.startswith('=?'):
        try:
            token, value = get_encoded_word(value)
        except errors.HeaderParseError:
            # XXX: need to figure out how to register defects when
            # appropriate here.
            token, value = get_dot_atom_text(value)
    else:
        token, value = get_dot_atom_text(value)
    dot_atom.append(token)
    if value and value[0] in CFWS_LEADER:
        token, value = get_cfws(value)
        dot_atom.append(token)
    return dot_atom, value

def get_word(value):
    """word = atom / quoted-string

    Either atom or quoted-string may start with CFWS.  We have to peel off this
    CFWS first to determine which type of word to parse.  Afterward we splice
    the leading CFWS, if any, into the parsed sub-token.

    If neither an atom or a quoted-string is found before the next special, a
    HeaderParseError is raised.

    The token returned is either an Atom or a QuotedString, as appropriate.
    This means the 'word' level of the formal grammar is not represented in the
    parse tree; this is because having that extra layer when manipulating the
    parse tree is more confusing than it is helpful.

    """
    if value[0] in CFWS_LEADER:
        leader, value = get_cfws(value)
    else:
        leader = None
    if not value:
        raise errors.HeaderParseError(
            "Expected 'atom' or 'quoted-string' but found nothing.")
    if value[0]=='"':
        token, value = get_quoted_string(value)
    elif value[0] in SPECIALS:
        raise errors.HeaderParseError("Expected 'atom' or 'quoted-string' "
                                      "but found '{}'".format(value))
    else:
        token, value = get_atom(value)
    if leader is not None:
        token[:0] = [leader]
    return token, value

def get_phrase(value):
    """ phrase = 1*word / obs-phrase
        obs-phrase = word *(word / "." / CFWS)

    This means a phrase can be a sequence of words, periods, and CFWS in any
    order as long as it starts with at least one word.  If anything other than
    words is detected, an ObsoleteHeaderDefect is added to the token's defect
    list.  We also accept a phrase that starts with CFWS followed by a dot;
    this is registered as an InvalidHeaderDefect, since it is not supported by
    even the obsolete grammar.

    """
    phrase = Phrase()
    try:
        token, value = get_word(value)
        phrase.append(token)
    except errors.HeaderParseError:
        phrase.defects.append(errors.InvalidHeaderDefect(
            "phrase does not start with word"))
    while value and value[0] not in PHRASE_ENDS:
        if value[0]=='.':
            phrase.append(DOT)
            phrase.defects.append(errors.ObsoleteHeaderDefect(
                "period in 'phrase'"))
            value = value[1:]
        else:
            try:
                token, value = get_word(value)
            except errors.HeaderParseError:
                if value[0] in CFWS_LEADER:
                    token, value = get_cfws(value)
                    phrase.defects.append(errors.ObsoleteHeaderDefect(
                        "comment found without atom"))
                else:
                    raise
            phrase.append(token)
    return phrase, value

def get_local_part(value):
    """ local-part = dot-atom / quoted-string / obs-local-part

    """
    local_part = LocalPart()
    leader = None
    if value[0] in CFWS_LEADER:
        leader, value = get_cfws(value)
    if not value:
        raise errors.HeaderParseError(
            "expected local-part but found '{}'".format(value))
    try:
        token, value = get_dot_atom(value)
    except errors.HeaderParseError:
        try:
            token, value = get_word(value)
        except errors.HeaderParseError:
            if value[0] != '\\' and value[0] in PHRASE_ENDS:
                raise
            token = TokenList()
    if leader is not None:
        token[:0] = [leader]
    local_part.append(token)
    if value and (value[0]=='\\' or value[0] not in PHRASE_ENDS):
        obs_local_part, value = get_obs_local_part(str(local_part) + value)
        if obs_local_part.token_type == 'invalid-obs-local-part':
            local_part.defects.append(errors.InvalidHeaderDefect(
                "local-part is not dot-atom, quoted-string, or obs-local-part"))
        else:
            local_part.defects.append(errors.ObsoleteHeaderDefect(
                "local-part is not a dot-atom (contains CFWS)"))
        local_part[0] = obs_local_part
    try:
        local_part.value.encode('ascii')
    except UnicodeEncodeError:
        local_part.defects.append(errors.NonASCIILocalPartDefect(
                "local-part contains non-ASCII characters)"))
    return local_part, value

def get_obs_local_part(value):
    """ obs-local-part = word *("." word)
    """
    obs_local_part = ObsLocalPart()
    last_non_ws_was_dot = False
    while value and (value[0]=='\\' or value[0] not in PHRASE_ENDS):
        if value[0] == '.':
            if last_non_ws_was_dot:
                obs_local_part.defects.append(errors.InvalidHeaderDefect(
                    "invalid repeated '.'"))
            obs_local_part.append(DOT)
            last_non_ws_was_dot = True
            value = value[1:]
            continue
        elif value[0]=='\\':
            obs_local_part.append(ValueTerminal(value[0],
                                                'misplaced-special'))
            value = value[1:]
            obs_local_part.defects.append(errors.InvalidHeaderDefect(
                "'\\' character outside of quoted-string/ccontent"))
            last_non_ws_was_dot = False
            continue
        if obs_local_part and obs_local_part[-1].token_type != 'dot':
            obs_local_part.defects.append(errors.InvalidHeaderDefect(
                "missing '.' between words"))
        try:
            token, value = get_word(value)
            last_non_ws_was_dot = False
        except errors.HeaderParseError:
            if value[0] not in CFWS_LEADER:
                raise
            token, value = get_cfws(value)
        obs_local_part.append(token)
    if (obs_local_part[0].token_type == 'dot' or
            obs_local_part[0].token_type=='cfws' and
            obs_local_part[1].token_type=='dot'):
        obs_local_part.defects.append(errors.InvalidHeaderDefect(
            "Invalid leading '.' in local part"))
    if (obs_local_part[-1].token_type == 'dot' or
            obs_local_part[-1].token_type=='cfws' and
            obs_local_part[-2].token_type=='dot'):
        obs_local_part.defects.append(errors.InvalidHeaderDefect(
            "Invalid trailing '.' in local part"))
    if obs_local_part.defects:
        obs_local_part.token_type = 'invalid-obs-local-part'
    return obs_local_part, value

def get_dtext(value):
    r""" dtext = <printable ascii except \ [ ]> / obs-dtext
        obs-dtext = obs-NO-WS-CTL / quoted-pair

    We allow anything except the excluded characters, but if we find any
    ASCII other than the RFC defined printable ASCII, a NonPrintableDefect is
    added to the token's defects list.  Quoted pairs are converted to their
    unquoted values, so what is returned is a ptext token, in this case a
    ValueTerminal.  If there were quoted-printables, an ObsoleteHeaderDefect is
    added to the returned token's defect list.

    """
    ptext, value, had_qp = _get_ptext_to_endchars(value, '[]')
    ptext = ValueTerminal(ptext, 'ptext')
    if had_qp:
        ptext.defects.append(errors.ObsoleteHeaderDefect(
            "quoted printable found in domain-literal"))
    _validate_xtext(ptext)
    return ptext, value

def _check_for_early_dl_end(value, domain_literal):
    if value:
        return False
    domain_literal.append(errors.InvalidHeaderDefect(
        "end of input inside domain-literal"))
    domain_literal.append(ValueTerminal(']', 'domain-literal-end'))
    return True

def get_domain_literal(value):
    """ domain-literal = [CFWS] "[" *([FWS] dtext) [FWS] "]" [CFWS]

    """
    domain_literal = DomainLiteral()
    if value[0] in CFWS_LEADER:
        token, value = get_cfws(value)
        domain_literal.append(token)
    if not value:
        raise errors.HeaderParseError("expected domain-literal")
    if value[0] != '[':
        raise errors.HeaderParseError("expected '[' at start of domain-literal "
                "but found '{}'".format(value))
    value = value[1:]
    if _check_for_early_dl_end(value, domain_literal):
        return domain_literal, value
    domain_literal.append(ValueTerminal('[', 'domain-literal-start'))
    if value[0] in WSP:
        token, value = get_fws(value)
        domain_literal.append(token)
    token, value = get_dtext(value)
    domain_literal.append(token)
    if _check_for_early_dl_end(value, domain_literal):
        return domain_literal, value
    if value[0] in WSP:
        token, value = get_fws(value)
        domain_literal.append(token)
    if _check_for_early_dl_end(value, domain_literal):
        return domain_literal, value
    if value[0] != ']':
        raise errors.HeaderParseError("expected ']' at end of domain-literal "
                "but found '{}'".format(value))
    domain_literal.append(ValueTerminal(']', 'domain-literal-end'))
    value = value[1:]
    if value and value[0] in CFWS_LEADER:
        token, value = get_cfws(value)
        domain_literal.append(token)
    return domain_literal, value

def get_domain(value):
    """ domain = dot-atom / domain-literal / obs-domain
        obs-domain = atom *("." atom))

    """
    domain = Domain()
    leader = None
    if value[0] in CFWS_LEADER:
        leader, value = get_cfws(value)
    if not value:
        raise errors.HeaderParseError(
            "expected domain but found '{}'".format(value))
    if value[0] == '[':
        token, value = get_domain_literal(value)
        if leader is not None:
            token[:0] = [leader]
        domain.append(token)
        return domain, value
    try:
        token, value = get_dot_atom(value)
    except errors.HeaderParseError:
        token, value = get_atom(value)
    if value and value[0] == '@':
        raise errors.HeaderParseError('Invalid Domain')
    if leader is not None:
        token[:0] = [leader]
    domain.append(token)
    if value and value[0] == '.':
        domain.defects.append(errors.ObsoleteHeaderDefect(
            "domain is not a dot-atom (contains CFWS)"))
        if domain[0].token_type == 'dot-atom':
            domain[:] = domain[0]
        while value and value[0] == '.':
            domain.append(DOT)
            token, value = get_atom(value[1:])
            domain.append(token)
    return domain, value

def get_addr_spec(value):
    """ addr-spec = local-part "@" domain

    """
    addr_spec = AddrSpec()
    token, value = get_local_part(value)
    addr_spec.append(token)
    if not value or value[0] != '@':
        addr_spec.defects.append(errors.InvalidHeaderDefect(
            "addr-spec local part with no domain"))
        return addr_spec, value
    addr_spec.append(ValueTerminal('@', 'address-at-symbol'))
    token, value = get_domain(value[1:])
    addr_spec.append(token)
    return addr_spec, value

def get_obs_route(value):
    """ obs-route = obs-domain-list ":"
        obs-domain-list = *(CFWS / ",") "@" domain *("," [CFWS] ["@" domain])

        Returns an obs-route token with the appropriate sub-tokens (that is,
        there is no obs-domain-list in the parse tree).
    """
    obs_route = ObsRoute()
    while value and (value[0]==',' or value[0] in CFWS_LEADER):
        if value[0] in CFWS_LEADER:
            token, value = get_cfws(value)
            obs_route.append(token)
        elif value[0] == ',':
            obs_route.append(ListSeparator)
            value = value[1:]
    if not value or value[0] != '@':
        raise errors.HeaderParseError(
            "expected obs-route domain but found '{}'".format(value))
    obs_route.append(RouteComponentMarker)
    token, value = get_domain(value[1:])
    obs_route.append(token)
    while value and value[0]==',':
        obs_route.append(ListSeparator)
        value = value[1:]
        if not value:
            break
        if value[0] in CFWS_LEADER:
            token, value = get_cfws(value)
            obs_route.append(token)
        if value[0] == '@':
            obs_route.append(RouteComponentMarker)
            token, value = get_domain(value[1:])
            obs_route.append(token)
    if not value:
        raise errors.HeaderParseError("end of header while parsing obs-route")
    if value[0] != ':':
        raise errors.HeaderParseError( "expected ':' marking end of "
            "obs-route but found '{}'".format(value))
    obs_route.append(ValueTerminal(':', 'end-of-obs-route-marker'))
    return obs_route, value[1:]

def get_angle_addr(value):
    """ angle-addr = [CFWS] "<" addr-spec ">" [CFWS] / obs-angle-addr
        obs-angle-addr = [CFWS] "<" obs-route addr-spec ">" [CFWS]

    """
    angle_addr = AngleAddr()
    if value[0] in CFWS_LEADER:
        token, value = get_cfws(value)
        angle_addr.append(token)
    if not value or value[0] != '<':
        raise errors.HeaderParseError(
            "expected angle-addr but found '{}'".format(value))
    angle_addr.append(ValueTerminal('<', 'angle-addr-start'))
    value = value[1:]
    # Although it is not legal per RFC5322, SMTP uses '<>' in certain
    # circumstances.
    if value[0] == '>':
        angle_addr.append(ValueTerminal('>', 'angle-addr-end'))
        angle_addr.defects.append(errors.InvalidHeaderDefect(
            "null addr-spec in angle-addr"))
        value = value[1:]
        return angle_addr, value
    try:
        token, value = get_addr_spec(value)
    except errors.HeaderParseError:
        try:
            token, value = get_obs_route(value)
            angle_addr.defects.append(errors.ObsoleteHeaderDefect(
                "obsolete route specification in angle-addr"))
        except errors.HeaderParseError:
            raise errors.HeaderParseError(
                "expected addr-spec or obs-route but found '{}'".format(value))
        angle_addr.append(token)
        token, value = get_addr_spec(value)
    angle_addr.append(token)
    if value and value[0] == '>':
        value = value[1:]
    else:
        angle_addr.defects.append(errors.InvalidHeaderDefect(
            "missing trailing '>' on angle-addr"))
    angle_addr.append(ValueTerminal('>', 'angle-addr-end'))
    if value and value[0] in CFWS_LEADER:
        token, value = get_cfws(value)
        angle_addr.append(token)
    return angle_addr, value

def get_display_name(value):
    """ display-name = phrase

    Because this is simply a name-rule, we don't return a display-name
    token containing a phrase, but rather a display-name token with
    the content of the phrase.

    """
    display_name = DisplayName()
    token, value = get_phrase(value)
    display_name.extend(token[:])
    display_name.defects = token.defects[:]
    return display_name, value


def get_name_addr(value):
    """ name-addr = [display-name] angle-addr

    """
    name_addr = NameAddr()
    # Both the optional display name and the angle-addr can start with cfws.
    leader = None
    if value[0] in CFWS_LEADER:
        leader, value = get_cfws(value)
        if not value:
            raise errors.HeaderParseError(
                "expected name-addr but found '{}'".format(leader))
    if value[0] != '<':
        if value[0] in PHRASE_ENDS:
            raise errors.HeaderParseError(
                "expected name-addr but found '{}'".format(value))
        token, value = get_display_name(value)
        if not value:
            raise errors.HeaderParseError(
                "expected name-addr but found '{}'".format(token))
        if leader is not None:
            token[0][:0] = [leader]
            leader = None
        name_addr.append(token)
    token, value = get_angle_addr(value)
    if leader is not None:
        token[:0] = [leader]
    name_addr.append(token)
    return name_addr, value

def get_mailbox(value):
    """ mailbox = name-addr / addr-spec

    """
    # The only way to figure out if we are dealing with a name-addr or an
    # addr-spec is to try parsing each one.
    mailbox = Mailbox()
    try:
        token, value = get_name_addr(value)
    except errors.HeaderParseError:
        try:
            token, value = get_addr_spec(value)
        except errors.HeaderParseError:
            raise errors.HeaderParseError(
                "expected mailbox but found '{}'".format(value))
    if any(isinstance(x, errors.InvalidHeaderDefect)
                       for x in token.all_defects):
        mailbox.token_type = 'invalid-mailbox'
    mailbox.append(token)
    return mailbox, value

def get_invalid_mailbox(value, endchars):
    """ Read everything up to one of the chars in endchars.

    This is outside the formal grammar.  The InvalidMailbox TokenList that is
    returned acts like a Mailbox, but the data attributes are None.

    """
    invalid_mailbox = InvalidMailbox()
    while value and value[0] not in endchars:
        if value[0] in PHRASE_ENDS:
            invalid_mailbox.append(ValueTerminal(value[0],
                                                 'misplaced-special'))
            value = value[1:]
        else:
            token, value = get_phrase(value)
            invalid_mailbox.append(token)
    return invalid_mailbox, value

def get_mailbox_list(value):
    """ mailbox-list = (mailbox *("," mailbox)) / obs-mbox-list
        obs-mbox-list = *([CFWS] ",") mailbox *("," [mailbox / CFWS])

    For this routine we go outside the formal grammar in order to improve error
    handling.  We recognize the end of the mailbox list only at the end of the
    value or at a ';' (the group terminator).  This is so that we can turn
    invalid mailboxes into InvalidMailbox tokens and continue parsing any
    remaining valid mailboxes.  We also allow all mailbox entries to be null,
    and this condition is handled appropriately at a higher level.

    """
    mailbox_list = MailboxList()
    while value and value[0] != ';':
        try:
            token, value = get_mailbox(value)
            mailbox_list.append(token)
        except errors.HeaderParseError:
            leader = None
            if value[0] in CFWS_LEADER:
                leader, value = get_cfws(value)
                if not value or value[0] in ',;':
                    mailbox_list.append(leader)
                    mailbox_list.defects.append(errors.ObsoleteHeaderDefect(
                        "empty element in mailbox-list"))
                else:
                    token, value = get_invalid_mailbox(value, ',;')
                    if leader is not None:
                        token[:0] = [leader]
                    mailbox_list.append(token)
                    mailbox_list.defects.append(errors.InvalidHeaderDefect(
                        "invalid mailbox in mailbox-list"))
            elif value[0] == ',':
                mailbox_list.defects.append(errors.ObsoleteHeaderDefect(
                    "empty element in mailbox-list"))
            else:
                token, value = get_invalid_mailbox(value, ',;')
                if leader is not None:
                    token[:0] = [leader]
                mailbox_list.append(token)
                mailbox_list.defects.append(errors.InvalidHeaderDefect(
                    "invalid mailbox in mailbox-list"))
        if value and value[0] not in ',;':
            # Crap after mailbox; treat it as an invalid mailbox.
            # The mailbox info will still be available.
            mailbox = mailbox_list[-1]
            mailbox.token_type = 'invalid-mailbox'
            token, value = get_invalid_mailbox(value, ',;')
            mailbox.extend(token)
            mailbox_list.defects.append(errors.InvalidHeaderDefect(
                "invalid mailbox in mailbox-list"))
        if value and value[0] == ',':
            mailbox_list.append(ListSeparator)
            value = value[1:]
    return mailbox_list, value


def get_group_list(value):
    """ group-list = mailbox-list / CFWS / obs-group-list
        obs-group-list = 1*([CFWS] ",") [CFWS]

    """
    group_list = GroupList()
    if not value:
        group_list.defects.append(errors.InvalidHeaderDefect(
            "end of header before group-list"))
        return group_list, value
    leader = None
    if value and value[0] in CFWS_LEADER:
        leader, value = get_cfws(value)
        if not value:
            # This should never happen in email parsing, since CFWS-only is a
            # legal alternative to group-list in a group, which is the only
            # place group-list appears.
            group_list.defects.append(errors.InvalidHeaderDefect(
                "end of header in group-list"))
            group_list.append(leader)
            return group_list, value
        if value[0] == ';':
            group_list.append(leader)
            return group_list, value
    token, value = get_mailbox_list(value)
    if len(token.all_mailboxes)==0:
        if leader is not None:
            group_list.append(leader)
        group_list.extend(token)
        group_list.defects.append(errors.ObsoleteHeaderDefect(
            "group-list with empty entries"))
        return group_list, value
    if leader is not None:
        token[:0] = [leader]
    group_list.append(token)
    return group_list, value

def get_group(value):
    """ group = display-name ":" [group-list] ";" [CFWS]

    """
    group = Group()
    token, value = get_display_name(value)
    if not value or value[0] != ':':
        raise errors.HeaderParseError("expected ':' at end of group "
            "display name but found '{}'".format(value))
    group.append(token)
    group.append(ValueTerminal(':', 'group-display-name-terminator'))
    value = value[1:]
    if value and value[0] == ';':
        group.append(ValueTerminal(';', 'group-terminator'))
        return group, value[1:]
    token, value = get_group_list(value)
    group.append(token)
    if not value:
        group.defects.append(errors.InvalidHeaderDefect(
            "end of header in group"))
    elif value[0] != ';':
        raise errors.HeaderParseError(
            "expected ';' at end of group but found {}".format(value))
    group.append(ValueTerminal(';', 'group-terminator'))
    value = value[1:]
    if value and value[0] in CFWS_LEADER:
        token, value = get_cfws(value)
        group.append(token)
    return group, value

def get_address(value):
    """ address = mailbox / group

    Note that counter-intuitively, an address can be either a single address or
    a list of addresses (a group).  This is why the returned Address object has
    a 'mailboxes' attribute which treats a single address as a list of length
    one.  When you need to differentiate between to two cases, extract the single
    element, which is either a mailbox or a group token.

    """
    # The formal grammar isn't very helpful when parsing an address.  mailbox
    # and group, especially when allowing for obsolete forms, start off very
    # similarly.  It is only when you reach one of @, <, or : that you know
    # what you've got.  So, we try each one in turn, starting with the more
    # likely of the two.  We could perhaps make this more efficient by looking
    # for a phrase and then branching based on the next character, but that
    # would be a premature optimization.
    address = Address()
    try:
        token, value = get_group(value)
    except errors.HeaderParseError:
        try:
            token, value = get_mailbox(value)
        except errors.HeaderParseError:
            raise errors.HeaderParseError(
                "expected address but found '{}'".format(value))
    address.append(token)
    return address, value

def get_address_list(value):
    """ address_list = (address *("," address)) / obs-addr-list
        obs-addr-list = *([CFWS] ",") address *("," [address / CFWS])

    We depart from the formal grammar here by continuing to parse until the end
    of the input, assuming the input to be entirely composed of an
    address-list.  This is always true in email parsing, and allows us
    to skip invalid addresses to parse additional valid ones.

    """
    address_list = AddressList()
    while value:
        try:
            token, value = get_address(value)
            address_list.append(token)
        except errors.HeaderParseError as err:
            leader = None
            if value[0] in CFWS_LEADER:
                leader, value = get_cfws(value)
                if not value or value[0] == ',':
                    address_list.append(leader)
                    address_list.defects.append(errors.ObsoleteHeaderDefect(
                        "address-list entry with no content"))
                else:
                    token, value = get_invalid_mailbox(value, ',')
                    if leader is not None:
                        token[:0] = [leader]
                    address_list.append(Address([token]))
                    address_list.defects.append(errors.InvalidHeaderDefect(
                        "invalid address in address-list"))
            elif value[0] == ',':
                address_list.defects.append(errors.ObsoleteHeaderDefect(
                    "empty element in address-list"))
            else:
                token, value = get_invalid_mailbox(value, ',')
                if leader is not None:
                    token[:0] = [leader]
                address_list.append(Address([token]))
                address_list.defects.append(errors.InvalidHeaderDefect(
                    "invalid address in address-list"))
        if value and value[0] != ',':
            # Crap after address; treat it as an invalid mailbox.
            # The mailbox info will still be available.
            mailbox = address_list[-1][0]
            mailbox.token_type = 'invalid-mailbox'
            token, value = get_invalid_mailbox(value, ',')
            mailbox.extend(token)
            address_list.defects.append(errors.InvalidHeaderDefect(
                "invalid address in address-list"))
        if value:  # Must be a , at this point.
            address_list.append(ValueTerminal(',', 'list-separator'))
            value = value[1:]
    return address_list, value


def get_no_fold_literal(value):
    """ no-fold-literal = "[" *dtext "]"
    """
    no_fold_literal = NoFoldLiteral()
    if not value:
        raise errors.HeaderParseError(
            "expected no-fold-literal but found '{}'".format(value))
    if value[0] != '[':
        raise errors.HeaderParseError(
            "expected '[' at the start of no-fold-literal "
            "but found '{}'".format(value))
    no_fold_literal.append(ValueTerminal('[', 'no-fold-literal-start'))
    value = value[1:]
    token, value = get_dtext(value)
    no_fold_literal.append(token)
    if not value or value[0] != ']':
        raise errors.HeaderParseError(
            "expected ']' at the end of no-fold-literal "
            "but found '{}'".format(value))
    no_fold_literal.append(ValueTerminal(']', 'no-fold-literal-end'))
    return no_fold_literal, value[1:]

def get_msg_id(value):
    """msg-id = [CFWS] "<" id-left '@' id-right  ">" [CFWS]
       id-left = dot-atom-text / obs-id-left
       id-right = dot-atom-text / no-fold-literal / obs-id-right
       no-fold-literal = "[" *dtext "]"
    """
    msg_id = MsgID()
    if value and value[0] in CFWS_LEADER:
        token, value = get_cfws(value)
        msg_id.append(token)
    if not value or value[0] != '<':
        raise errors.HeaderParseError(
            "expected msg-id but found '{}'".format(value))
    msg_id.append(ValueTerminal('<', 'msg-id-start'))
    value = value[1:]
    # Parse id-left.
    try:
        token, value = get_dot_atom_text(value)
    except errors.HeaderParseError:
        try:
            # obs-id-left is same as local-part of add-spec.
            token, value = get_obs_local_part(value)
            msg_id.defects.append(errors.ObsoleteHeaderDefect(
                "obsolete id-left in msg-id"))
        except errors.HeaderParseError:
            raise errors.HeaderParseError(
                "expected dot-atom-text or obs-id-left"
                " but found '{}'".format(value))
    msg_id.append(token)
    if not value or value[0] != '@':
        msg_id.defects.append(errors.InvalidHeaderDefect(
            "msg-id with no id-right"))
        # Even though there is no id-right, if the local part
        # ends with `>` let's just parse it too and return
        # along with the defect.
        if value and value[0] == '>':
            msg_id.append(ValueTerminal('>', 'msg-id-end'))
            value = value[1:]
        return msg_id, value
    msg_id.append(ValueTerminal('@', 'address-at-symbol'))
    value = value[1:]
    # Parse id-right.
    try:
        token, value = get_dot_atom_text(value)
    except errors.HeaderParseError:
        try:
            token, value = get_no_fold_literal(value)
        except errors.HeaderParseError as e:
            try:
                token, value = get_domain(value)
                msg_id.defects.append(errors.ObsoleteHeaderDefect(
                    "obsolete id-right in msg-id"))
            except errors.HeaderParseError:
                raise errors.HeaderParseError(
                    "expected dot-atom-text, no-fold-literal or obs-id-right"
                    " but found '{}'".format(value))
    msg_id.append(token)
    if value and value[0] == '>':
        value = value[1:]
    else:
        msg_id.defects.append(errors.InvalidHeaderDefect(
            "missing trailing '>' on msg-id"))
    msg_id.append(ValueTerminal('>', 'msg-id-end'))
    if value and value[0] in CFWS_LEADER:
        token, value = get_cfws(value)
        msg_id.append(token)
    return msg_id, value


def parse_message_id(value):
    """message-id      =   "Message-ID:" msg-id CRLF
    """
    message_id = MessageID()
    try:
        token, value = get_msg_id(value)
        message_id.append(token)
    except errors.HeaderParseError as ex:
        token = get_unstructured(value)
        message_id = InvalidMessageID(token)
        message_id.defects.append(
            errors.InvalidHeaderDefect("Invalid msg-id: {!r}".format(ex)))
    else:
        # Value after parsing a valid msg_id should be None.
        if value:
            message_id.defects.append(errors.InvalidHeaderDefect(
                "Unexpected {!r}".format(value)))

    return message_id

#
# XXX: As I begin to add additional header parsers, I'm realizing we probably
# have two level of parser routines: the get_XXX methods that get a token in
# the grammar, and parse_XXX methods that parse an entire field value.  So
# get_address_list above should really be a parse_ method, as probably should
# be get_unstructured.
#

def parse_mime_version(value):
    """ mime-version = [CFWS] 1*digit [CFWS] "." [CFWS] 1*digit [CFWS]

    """
    # The [CFWS] is implicit in the RFC 2045 BNF.
    # XXX: This routine is a bit verbose, should factor out a get_int method.
    mime_version = MIMEVersion()
    if not value:
        mime_version.defects.append(errors.HeaderMissingRequiredValue(
            "Missing MIME version number (eg: 1.0)"))
        return mime_version
    if value[0] in CFWS_LEADER:
        token, value = get_cfws(value)
        mime_version.append(token)
        if not value:
            mime_version.defects.append(errors.HeaderMissingRequiredValue(
                "Expected MIME version number but found only CFWS"))
    digits = ''
    while value and value[0] != '.' and value[0] not in CFWS_LEADER:
        digits += value[0]
        value = value[1:]
    if not digits.isdigit():
        mime_version.defects.append(errors.InvalidHeaderDefect(
            "Expected MIME major version number but found {!r}".format(digits)))
        mime_version.append(ValueTerminal(digits, 'xtext'))
    else:
        mime_version.major = int(digits)
        mime_version.append(ValueTerminal(digits, 'digits'))
    if value and value[0] in CFWS_LEADER:
        token, value = get_cfws(value)
        mime_version.append(token)
    if not value or value[0] != '.':
        if mime_version.major is not None:
            mime_version.defects.append(errors.InvalidHeaderDefect(
                "Incomplete MIME version; found only major number"))
        if value:
            mime_version.append(ValueTerminal(value, 'xtext'))
        return mime_version
    mime_version.append(ValueTerminal('.', 'version-separator'))
    value = value[1:]
    if value and value[0] in CFWS_LEADER:
        token, value = get_cfws(value)
        mime_version.append(token)
    if not value:
        if mime_version.major is not None:
            mime_version.defects.append(errors.InvalidHeaderDefect(
                "Incomplete MIME version; found only major number"))
        return mime_version
    digits = ''
    while value and value[0] not in CFWS_LEADER:
        digits += value[0]
        value = value[1:]
    if not digits.isdigit():
        mime_version.defects.append(errors.InvalidHeaderDefect(
            "Expected MIME minor version number but found {!r}".format(digits)))
        mime_version.append(ValueTerminal(digits, 'xtext'))
    else:
        mime_version.minor = int(digits)
        mime_version.append(ValueTerminal(digits, 'digits'))
    if value and value[0] in CFWS_LEADER:
        token, value = get_cfws(value)
        mime_version.append(token)
    if value:
        mime_version.defects.append(errors.InvalidHeaderDefect(
            "Excess non-CFWS text after MIME version"))
        mime_version.append(ValueTerminal(value, 'xtext'))
    return mime_version

def get_invalid_parameter(value):
    """ Read everything up to the next ';'.

    This is outside the formal grammar.  The InvalidParameter TokenList that is
    returned acts like a Parameter, but the data attributes are None.

    """
    invalid_parameter = InvalidParameter()
    while value and value[0] != ';':
        if value[0] in PHRASE_ENDS:
            invalid_parameter.append(ValueTerminal(value[0],
                                                   'misplaced-special'))
            value = value[1:]
        else:
            token, value = get_phrase(value)
            invalid_parameter.append(token)
    return invalid_parameter, value

def get_ttext(value):
    """ttext = <matches _ttext_matcher>

    We allow any non-TOKEN_ENDS in ttext, but add defects to the token's
    defects list if we find non-ttext characters.  We also register defects for
    *any* non-printables even though the RFC doesn't exclude all of them,
    because we follow the spirit of RFC 5322.

    """
    m = _non_token_end_matcher(value)
    if not m:
        raise errors.HeaderParseError(
            "expected ttext but found '{}'".format(value))
    ttext = m.group()
    value = value[len(ttext):]
    ttext = ValueTerminal(ttext, 'ttext')
    _validate_xtext(ttext)
    return ttext, value

def get_token(value):
    """token = [CFWS] 1*ttext [CFWS]

    The RFC equivalent of ttext is any US-ASCII chars except space, ctls, or
    tspecials.  We also exclude tabs even though the RFC doesn't.

    The RFC implies the CFWS but is not explicit about it in the BNF.

    """
    mtoken = Token()
    if value and value[0] in CFWS_LEADER:
        token, value = get_cfws(value)
        mtoken.append(token)
    if value and value[0] in TOKEN_ENDS:
        raise errors.HeaderParseError(
            "expected token but found '{}'".format(value))
    token, value = get_ttext(value)
    mtoken.append(token)
    if value and value[0] in CFWS_LEADER:
        token, value = get_cfws(value)
        mtoken.append(token)
    return mtoken, value

def get_attrtext(value):
    """attrtext = 1*(any non-ATTRIBUTE_ENDS character)

    We allow any non-ATTRIBUTE_ENDS in attrtext, but add defects to the
    token's defects list if we find non-attrtext characters.  We also register
    defects for *any* non-printables even though the RFC doesn't exclude all of
    them, because we follow the spirit of RFC 5322.

    """
    m = _non_attribute_end_matcher(value)
    if not m:
        raise errors.HeaderParseError(
            "expected attrtext but found {!r}".format(value))
    attrtext = m.group()
    value = value[len(attrtext):]
    attrtext = ValueTerminal(attrtext, 'attrtext')
    _validate_xtext(attrtext)
    return attrtext, value

def get_attribute(value):
    """ [CFWS] 1*attrtext [CFWS]

    This version of the BNF makes the CFWS explicit, and as usual we use a
    value terminal for the actual run of characters.  The RFC equivalent of
    attrtext is the token characters, with the subtraction of '*', "'", and '%'.
    We include tab in the excluded set just as we do for token.

    """
    attribute = Attribute()
    if value and value[0] in CFWS_LEADER:
        token, value = get_cfws(value)
        attribute.append(token)
    if value and value[0] in ATTRIBUTE_ENDS:
        raise errors.HeaderParseError(
            "expected token but found '{}'".format(value))
    token, value = get_attrtext(value)
    attribute.append(token)
    if value and value[0] in CFWS_LEADER:
        token, value = get_cfws(value)
        attribute.append(token)
    return attribute, value

def get_extended_attrtext(value):
    """attrtext = 1*(any non-ATTRIBUTE_ENDS character plus '%')

    This is a special parsing routine so that we get a value that
    includes % escapes as a single string (which we decode as a single
    string later).

    """
    m = _non_extended_attribute_end_matcher(value)
    if not m:
        raise errors.HeaderParseError(
            "expected extended attrtext but found {!r}".format(value))
    attrtext = m.group()
    value = value[len(attrtext):]
    attrtext = ValueTerminal(attrtext, 'extended-attrtext')
    _validate_xtext(attrtext)
    return attrtext, value

def get_extended_attribute(value):
    """ [CFWS] 1*extended_attrtext [CFWS]

    This is like the non-extended version except we allow % characters, so that
    we can pick up an encoded value as a single string.

    """
    # XXX: should we have an ExtendedAttribute TokenList?
    attribute = Attribute()
    if value and value[0] in CFWS_LEADER:
        token, value = get_cfws(value)
        attribute.append(token)
    if value and value[0] in EXTENDED_ATTRIBUTE_ENDS:
        raise errors.HeaderParseError(
            "expected token but found '{}'".format(value))
    token, value = get_extended_attrtext(value)
    attribute.append(token)
    if value and value[0] in CFWS_LEADER:
        token, value = get_cfws(value)
        attribute.append(token)
    return attribute, value

def get_section(value):
    """ '*' digits

    The formal BNF is more complicated because leading 0s are not allowed.  We
    check for that and add a defect.  We also assume no CFWS is allowed between
    the '*' and the digits, though the RFC is not crystal clear on that.
    The caller should already have dealt with leading CFWS.

    """
    section = Section()
    if not value or value[0] != '*':
        raise errors.HeaderParseError("Expected section but found {}".format(
                                        value))
    section.append(ValueTerminal('*', 'section-marker'))
    value = value[1:]
    if not value or not value[0].isdigit():
        raise errors.HeaderParseError("Expected section number but "
                                      "found {}".format(value))
    digits = ''
    while value and value[0].isdigit():
        digits += value[0]
        value = value[1:]
    if digits[0] == '0' and digits != '0':
        section.defects.append(errors.InvalidHeaderError(
                "section number has an invalid leading 0"))
    section.number = int(digits)
    section.append(ValueTerminal(digits, 'digits'))
    return section, value


def get_value(value):
    """ quoted-string / attribute

    """
    v = Value()
    if not value:
        raise errors.HeaderParseError("Expected value but found end of string")
    leader = None
    if value[0] in CFWS_LEADER:
        leader, value = get_cfws(value)
    if not value:
        raise errors.HeaderParseError("Expected value but found "
                                      "only {}".format(leader))
    if value[0] == '"':
        token, value = get_quoted_string(value)
    else:
        token, value = get_extended_attribute(value)
    if leader is not None:
        token[:0] = [leader]
    v.append(token)
    return v, value

def get_parameter(value):
    """ attribute [section] ["*"] [CFWS] "=" value

    The CFWS is implied by the RFC but not made explicit in the BNF.  This
    simplified form of the BNF from the RFC is made to conform with the RFC BNF
    through some extra checks.  We do it this way because it makes both error
    recovery and working with the resulting parse tree easier.
    """
    # It is possible CFWS would also be implicitly allowed between the section
    # and the 'extended-attribute' marker (the '*') , but we've never seen that
    # in the wild and we will therefore ignore the possibility.
    param = Parameter()
    token, value = get_attribute(value)
    param.append(token)
    if not value or value[0] == ';':
        param.defects.append(errors.InvalidHeaderDefect("Parameter contains "
            "name ({}) but no value".format(token)))
        return param, value
    if value[0] == '*':
        try:
            token, value = get_section(value)
            param.sectioned = True
            param.append(token)
        except errors.HeaderParseError:
            pass
        if not value:
            raise errors.HeaderParseError("Incomplete parameter")
        if value[0] == '*':
            param.append(ValueTerminal('*', 'extended-parameter-marker'))
            value = value[1:]
            param.extended = True
    if value[0] != '=':
        raise errors.HeaderParseError("Parameter not followed by '='")
    param.append(ValueTerminal('=', 'parameter-separator'))
    value = value[1:]
    leader = None
    if value and value[0] in CFWS_LEADER:
        token, value = get_cfws(value)
        param.append(token)
    remainder = None
    appendto = param
    if param.extended and value and value[0] == '"':
        # Now for some serious hackery to handle the common invalid case of
        # double quotes around an extended value.  We also accept (with defect)
        # a value marked as encoded that isn't really.
        qstring, remainder = get_quoted_string(value)
        inner_value = qstring.stripped_value
        semi_valid = False
        if param.section_number == 0:
            if inner_value and inner_value[0] == "'":
                semi_valid = True
            else:
                token, rest = get_attrtext(inner_value)
                if rest and rest[0] == "'":
                    semi_valid = True
        else:
            try:
                token, rest = get_extended_attrtext(inner_value)
            except:
                pass
            else:
                if not rest:
                    semi_valid = True
        if semi_valid:
            param.defects.append(errors.InvalidHeaderDefect(
                "Quoted string value for extended parameter is invalid"))
            param.append(qstring)
            for t in qstring:
                if t.token_type == 'bare-quoted-string':
                    t[:] = []
                    appendto = t
                    break
            value = inner_value
        else:
            remainder = None
            param.defects.append(errors.InvalidHeaderDefect(
                "Parameter marked as extended but appears to have a "
                "quoted string value that is non-encoded"))
    if value and value[0] == "'":
        token = None
    else:
        token, value = get_value(value)
    if not param.extended or param.section_number > 0:
        if not value or value[0] != "'":
            appendto.append(token)
            if remainder is not None:
                assert not value, value
                value = remainder
            return param, value
        param.defects.append(errors.InvalidHeaderDefect(
            "Apparent initial-extended-value but attribute "
            "was not marked as extended or was not initial section"))
    if not value:
        # Assume the charset/lang is missing and the token is the value.
        param.defects.append(errors.InvalidHeaderDefect(
            "Missing required charset/lang delimiters"))
        appendto.append(token)
        if remainder is None:
            return param, value
    else:
        if token is not None:
            for t in token:
                if t.token_type == 'extended-attrtext':
                    break
            t.token_type == 'attrtext'
            appendto.append(t)
            param.charset = t.value
        if value[0] != "'":
            raise errors.HeaderParseError("Expected RFC2231 char/lang encoding "
                                          "delimiter, but found {!r}".format(value))
        appendto.append(ValueTerminal("'", 'RFC2231-delimiter'))
        value = value[1:]
        if value and value[0] != "'":
            token, value = get_attrtext(value)
            appendto.append(token)
            param.lang = token.value
            if not value or value[0] != "'":
                raise errors.HeaderParseError("Expected RFC2231 char/lang encoding "
                                  "delimiter, but found {}".format(value))
        appendto.append(ValueTerminal("'", 'RFC2231-delimiter'))
        value = value[1:]
    if remainder is not None:
        # Treat the rest of value as bare quoted string content.
        v = Value()
        while value:
            if value[0] in WSP:
                token, value = get_fws(value)
            elif value[0] == '"':
                token = ValueTerminal('"', 'DQUOTE')
                value = value[1:]
            else:
                token, value = get_qcontent(value)
            v.append(token)
        token = v
    else:
        token, value = get_value(value)
    appendto.append(token)
    if remainder is not None:
        assert not value, value
        value = remainder
    return param, value

def parse_mime_parameters(value):
    """ parameter *( ";" parameter )

    That BNF is meant to indicate this routine should only be called after
    finding and handling the leading ';'.  There is no corresponding rule in
    the formal RFC grammar, but it is more convenient for us for the set of
    parameters to be treated as its own TokenList.

    This is 'parse' routine because it consumes the remaining value, but it
    would never be called to parse a full header.  Instead it is called to
    parse everything after the non-parameter value of a specific MIME header.

    """
    mime_parameters = MimeParameters()
    while value:
        try:
            token, value = get_parameter(value)
            mime_parameters.append(token)
        except errors.HeaderParseError as err:
            leader = None
            if value[0] in CFWS_LEADER:
                leader, value = get_cfws(value)
            if not value:
                mime_parameters.append(leader)
                return mime_parameters
            if value[0] == ';':
                if leader is not None:
                    mime_parameters.append(leader)
                mime_parameters.defects.append(errors.InvalidHeaderDefect(
                    "parameter entry with no content"))
            else:
                token, value = get_invalid_parameter(value)
                if leader:
                    token[:0] = [leader]
                mime_parameters.append(token)
                mime_parameters.defects.append(errors.InvalidHeaderDefect(
                    "invalid parameter {!r}".format(token)))
        if value and value[0] != ';':
            # Junk after the otherwise valid parameter.  Mark it as
            # invalid, but it will have a value.
            param = mime_parameters[-1]
            param.token_type = 'invalid-parameter'
            token, value = get_invalid_parameter(value)
            param.extend(token)
            mime_parameters.defects.append(errors.InvalidHeaderDefect(
                "parameter with invalid trailing text {!r}".format(token)))
        if value:
            # Must be a ';' at this point.
            mime_parameters.append(ValueTerminal(';', 'parameter-separator'))
            value = value[1:]
    return mime_parameters

def _find_mime_parameters(tokenlist, value):
    """Do our best to find the parameters in an invalid MIME header

    """
    while value and value[0] != ';':
        if value[0] in PHRASE_ENDS:
            tokenlist.append(ValueTerminal(value[0], 'misplaced-special'))
            value = value[1:]
        else:
            token, value = get_phrase(value)
            tokenlist.append(token)
    if not value:
        return
    tokenlist.append(ValueTerminal(';', 'parameter-separator'))
    tokenlist.append(parse_mime_parameters(value[1:]))

def parse_content_type_header(value):
    """ maintype "/" subtype *( ";" parameter )

    The maintype and substype are tokens.  Theoretically they could
    be checked against the official IANA list + x-token, but we
    don't do that.
    """
    ctype = ContentType()
    recover = False
    if not value:
        ctype.defects.append(errors.HeaderMissingRequiredValue(
            "Missing content type specification"))
        return ctype
    try:
        token, value = get_token(value)
    except errors.HeaderParseError:
        ctype.defects.append(errors.InvalidHeaderDefect(
            "Expected content maintype but found {!r}".format(value)))
        _find_mime_parameters(ctype, value)
        return ctype
    ctype.append(token)
    # XXX: If we really want to follow the formal grammar we should make
    # mantype and subtype specialized TokenLists here.  Probably not worth it.
    if not value or value[0] != '/':
        ctype.defects.append(errors.InvalidHeaderDefect(
            "Invalid content type"))
        if value:
            _find_mime_parameters(ctype, value)
        return ctype
    ctype.maintype = token.value.strip().lower()
    ctype.append(ValueTerminal('/', 'content-type-separator'))
    value = value[1:]
    try:
        token, value = get_token(value)
    except errors.HeaderParseError:
        ctype.defects.append(errors.InvalidHeaderDefect(
            "Expected content subtype but found {!r}".format(value)))
        _find_mime_parameters(ctype, value)
        return ctype
    ctype.append(token)
    ctype.subtype = token.value.strip().lower()
    if not value:
        return ctype
    if value[0] != ';':
        ctype.defects.append(errors.InvalidHeaderDefect(
            "Only parameters are valid after content type, but "
            "found {!r}".format(value)))
        # The RFC requires that a syntactically invalid content-type be treated
        # as text/plain.  Perhaps we should postel this, but we should probably
        # only do that if we were checking the subtype value against IANA.
        del ctype.maintype, ctype.subtype
        _find_mime_parameters(ctype, value)
        return ctype
    ctype.append(ValueTerminal(';', 'parameter-separator'))
    ctype.append(parse_mime_parameters(value[1:]))
    return ctype

def parse_content_disposition_header(value):
    """ disposition-type *( ";" parameter )

    """
    disp_header = ContentDisposition()
    if not value:
        disp_header.defects.append(errors.HeaderMissingRequiredValue(
            "Missing content disposition"))
        return disp_header
    try:
        token, value = get_token(value)
    except errors.HeaderParseError:
        disp_header.defects.append(errors.InvalidHeaderDefect(
            "Expected content disposition but found {!r}".format(value)))
        _find_mime_parameters(disp_header, value)
        return disp_header
    disp_header.append(token)
    disp_header.content_disposition = token.value.strip().lower()
    if not value:
        return disp_header
    if value[0] != ';':
        disp_header.defects.append(errors.InvalidHeaderDefect(
            "Only parameters are valid after content disposition, but "
            "found {!r}".format(value)))
        _find_mime_parameters(disp_header, value)
        return disp_header
    disp_header.append(ValueTerminal(';', 'parameter-separator'))
    disp_header.append(parse_mime_parameters(value[1:]))
    return disp_header

def parse_content_transfer_encoding_header(value):
    """ mechanism

    """
    # We should probably validate the values, since the list is fixed.
    cte_header = ContentTransferEncoding()
    if not value:
        cte_header.defects.append(errors.HeaderMissingRequiredValue(
            "Missing content transfer encoding"))
        return cte_header
    try:
        token, value = get_token(value)
    except errors.HeaderParseError:
        cte_header.defects.append(errors.InvalidHeaderDefect(
            "Expected content transfer encoding but found {!r}".format(value)))
    else:
        cte_header.append(token)
        cte_header.cte = token.value.strip().lower()
    if not value:
        return cte_header
    while value:
        cte_header.defects.append(errors.InvalidHeaderDefect(
            "Extra text after content transfer encoding"))
        if value[0] in PHRASE_ENDS:
            cte_header.append(ValueTerminal(value[0], 'misplaced-special'))
            value = value[1:]
        else:
            token, value = get_phrase(value)
            cte_header.append(token)
    return cte_header


#
# Header folding
#
# Header folding is complex, with lots of rules and corner cases.  The
# following code does its best to obey the rules and handle the corner
# cases, but you can be sure there are few bugs:)
#
# This folder generally canonicalizes as it goes, preferring the stringified
# version of each token.  The tokens contain information that supports the
# folder, including which tokens can be encoded in which ways.
#
# Folded text is accumulated in a simple list of strings ('lines'), each
# one of which should be less than policy.max_line_length ('maxlen').
#

def _steal_trailing_WSP_if_exists(lines):
    wsp = ''
    if lines and lines[-1] and lines[-1][-1] in WSP:
        wsp = lines[-1][-1]
        lines[-1] = lines[-1][:-1]
    return wsp

def _refold_parse_tree(parse_tree, *, policy):
    """Return string of contents of parse_tree folded according to RFC rules.

    """
    # max_line_length 0/None means no limit, ie: infinitely long.
    maxlen = policy.max_line_length or sys.maxsize
    encoding = 'utf-8' if policy.utf8 else 'us-ascii'
    lines = ['']
    last_ew = None
    wrap_as_ew_blocked = 0
    want_encoding = False
    end_ew_not_allowed = Terminal('', 'wrap_as_ew_blocked')
    parts = list(parse_tree)
    while parts:
        part = parts.pop(0)
        if part is end_ew_not_allowed:
            wrap_as_ew_blocked -= 1
            continue
        tstr = str(part)
        if part.token_type == 'ptext' and set(tstr) & SPECIALS:
            # Encode if tstr contains special characters.
            want_encoding = True
        try:
            tstr.encode(encoding)
            charset = encoding
        except UnicodeEncodeError:
            if any(isinstance(x, errors.UndecodableBytesDefect)
                   for x in part.all_defects):
                charset = 'unknown-8bit'
            else:
                # If policy.utf8 is false this should really be taken from a
                # 'charset' property on the policy.
                charset = 'utf-8'
            want_encoding = True
        if part.token_type == 'mime-parameters':
            # Mime parameter folding (using RFC2231) is extra special.
            _fold_mime_parameters(part, lines, maxlen, encoding)
            continue
        if want_encoding and not wrap_as_ew_blocked:
            if not part.as_ew_allowed:
                want_encoding = False
                last_ew = None
                if part.syntactic_break:
                    encoded_part = part.fold(policy=policy)[:-len(policy.linesep)]
                    if policy.linesep not in encoded_part:
                        # It fits on a single line
                        if len(encoded_part) > maxlen - len(lines[-1]):
                            # But not on this one, so start a new one.
                            newline = _steal_trailing_WSP_if_exists(lines)
                            # XXX what if encoded_part has no leading FWS?
                            lines.append(newline)
                        lines[-1] += encoded_part
                        continue
                # Either this is not a major syntactic break, so we don't
                # want it on a line by itself even if it fits, or it
                # doesn't fit on a line by itself.  Either way, fall through
                # to unpacking the subparts and wrapping them.
            if not hasattr(part, 'encode'):
                # It's not a Terminal, do each piece individually.
                parts = list(part) + parts
            else:
                # It's a terminal, wrap it as an encoded word, possibly
                # combining it with previously encoded words if allowed.
                last_ew = _fold_as_ew(tstr, lines, maxlen, last_ew,
                                      part.ew_combine_allowed, charset)
            want_encoding = False
            continue
        if len(tstr) <= maxlen - len(lines[-1]):
            lines[-1] += tstr
            continue
        # This part is too long to fit.  The RFC wants us to break at
        # "major syntactic breaks", so unless we don't consider this
        # to be one, check if it will fit on the next line by itself.
        if (part.syntactic_break and
                len(tstr) + 1 <= maxlen):
            newline = _steal_trailing_WSP_if_exists(lines)
            if newline or part.startswith_fws():
                lines.append(newline + tstr)
                last_ew = None
                continue
        if not hasattr(part, 'encode'):
            # It's not a terminal, try folding the subparts.
            newparts = list(part)
            if not part.as_ew_allowed:
                wrap_as_ew_blocked += 1
                newparts.append(end_ew_not_allowed)
            parts = newparts + parts
            continue
        if part.as_ew_allowed and not wrap_as_ew_blocked:
            # It doesn't need CTE encoding, but encode it anyway so we can
            # wrap it.
            parts.insert(0, part)
            want_encoding = True
            continue
        # We can't figure out how to wrap, it, so give up.
        newline = _steal_trailing_WSP_if_exists(lines)
        if newline or part.startswith_fws():
            lines.append(newline + tstr)
        else:
            # We can't fold it onto the next line either...
            lines[-1] += tstr
    return policy.linesep.join(lines) + policy.linesep

def _fold_as_ew(to_encode, lines, maxlen, last_ew, ew_combine_allowed, charset):
    """Fold string to_encode into lines as encoded word, combining if allowed.
    Return the new value for last_ew, or None if ew_combine_allowed is False.

    If there is already an encoded word in the last line of lines (indicated by
    a non-None value for last_ew) and ew_combine_allowed is true, decode the
    existing ew, combine it with to_encode, and re-encode.  Otherwise, encode
    to_encode.  In either case, split to_encode as necessary so that the
    encoded segments fit within maxlen.

    """
    if last_ew is not None and ew_combine_allowed:
        to_encode = str(
            get_unstructured(lines[-1][last_ew:] + to_encode))
        lines[-1] = lines[-1][:last_ew]
    if to_encode[0] in WSP:
        # We're joining this to non-encoded text, so don't encode
        # the leading blank.
        leading_wsp = to_encode[0]
        to_encode = to_encode[1:]
        if (len(lines[-1]) == maxlen):
            lines.append(_steal_trailing_WSP_if_exists(lines))
        lines[-1] += leading_wsp
    trailing_wsp = ''
    if to_encode[-1] in WSP:
        # Likewise for the trailing space.
        trailing_wsp = to_encode[-1]
        to_encode = to_encode[:-1]
    new_last_ew = len(lines[-1]) if last_ew is None else last_ew

    encode_as = 'utf-8' if charset == 'us-ascii' else charset

    # The RFC2047 chrome takes up 7 characters plus the length
    # of the charset name.
    chrome_len = len(encode_as) + 7

    if (chrome_len + 1) >= maxlen:
        raise errors.HeaderParseError(
            "max_line_length is too small to fit an encoded word")

    while to_encode:
        remaining_space = maxlen - len(lines[-1])
        text_space = remaining_space - chrome_len
        if text_space <= 0:
            lines.append(' ')
            continue

        to_encode_word = to_encode[:text_space]
        encoded_word = _ew.encode(to_encode_word, charset=encode_as)
        excess = len(encoded_word) - remaining_space
        while excess > 0:
            # Since the chunk to encode is guaranteed to fit into less than 100 characters,
            # shrinking it by one at a time shouldn't take long.
            to_encode_word = to_encode_word[:-1]
            encoded_word = _ew.encode(to_encode_word, charset=encode_as)
            excess = len(encoded_word) - remaining_space
        lines[-1] += encoded_word
        to_encode = to_encode[len(to_encode_word):]

        if to_encode:
            lines.append(' ')
            new_last_ew = len(lines[-1])
    lines[-1] += trailing_wsp
    return new_last_ew if ew_combine_allowed else None

def _fold_mime_parameters(part, lines, maxlen, encoding):
    """Fold TokenList 'part' into the 'lines' list as mime parameters.

    Using the decoded list of parameters and values, format them according to
    the RFC rules, including using RFC2231 encoding if the value cannot be
    expressed in 'encoding' and/or the parameter+value is too long to fit
    within 'maxlen'.

    """
    # Special case for RFC2231 encoding: start from decoded values and use
    # RFC2231 encoding iff needed.
    #
    # Note that the 1 and 2s being added to the length calculations are
    # accounting for the possibly-needed spaces and semicolons we'll be adding.
    #
    for name, value in part.params:
        # XXX What if this ';' puts us over maxlen the first time through the
        # loop?  We should split the header value onto a newline in that case,
        # but to do that we need to recognize the need earlier or reparse the
        # header, so I'm going to ignore that bug for now.  It'll only put us
        # one character over.
        if not lines[-1].rstrip().endswith(';'):
            lines[-1] += ';'
        charset = encoding
        error_handler = 'strict'
        try:
            value.encode(encoding)
            encoding_required = False
        except UnicodeEncodeError:
            encoding_required = True
            if utils._has_surrogates(value):
                charset = 'unknown-8bit'
                error_handler = 'surrogateescape'
            else:
                charset = 'utf-8'
        if encoding_required:
            encoded_value = urllib.parse.quote(
                value, safe='', errors=error_handler)
            tstr = "{}*={}''{}".format(name, charset, encoded_value)
        else:
            tstr = '{}={}'.format(name, quote_string(value))
        if len(lines[-1]) + len(tstr) + 1 < maxlen:
            lines[-1] = lines[-1] + ' ' + tstr
            continue
        elif len(tstr) + 2 <= maxlen:
            lines.append(' ' + tstr)
            continue
        # We need multiple sections.  We are allowed to mix encoded and
        # non-encoded sections, but we aren't going to.  We'll encode them all.
        section = 0
        extra_chrome = charset + "''"
        while value:
            chrome_len = len(name) + len(str(section)) + 3 + len(extra_chrome)
            if maxlen <= chrome_len + 3:
                # We need room for the leading blank, the trailing semicolon,
                # and at least one character of the value.  If we don't
                # have that, we'd be stuck, so in that case fall back to
                # the RFC standard width.
                maxlen = 78
            splitpoint = maxchars = maxlen - chrome_len - 2
            while True:
                partial = value[:splitpoint]
                encoded_value = urllib.parse.quote(
                    partial, safe='', errors=error_handler)
                if len(encoded_value) <= maxchars:
                    break
                splitpoint -= 1
            lines.append(" {}*{}*={}{}".format(
                name, section, extra_chrome, encoded_value))
            extra_chrome = ''
            section += 1
            value = value[splitpoint:]
            if value:
                lines[-1] += ';'
email/iterators.py000064400000004127151153537640010237 0ustar00# Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org

"""Various types of useful iterators and generators."""

__all__ = [
    'body_line_iterator',
    'typed_subpart_iterator',
    'walk',
    # Do not include _structure() since it's part of the debugging API.
    ]

import sys
from io import StringIO



# This function will become a method of the Message class
def walk(self):
    """Walk over the message tree, yielding each subpart.

    The walk is performed in depth-first order.  This method is a
    generator.
    """
    yield self
    if self.is_multipart():
        for subpart in self.get_payload():
            yield from subpart.walk()



# These two functions are imported into the Iterators.py interface module.
def body_line_iterator(msg, decode=False):
    """Iterate over the parts, returning string payloads line-by-line.

    Optional decode (default False) is passed through to .get_payload().
    """
    for subpart in msg.walk():
        payload = subpart.get_payload(decode=decode)
        if isinstance(payload, str):
            yield from StringIO(payload)


def typed_subpart_iterator(msg, maintype='text', subtype=None):
    """Iterate over the subparts with a given MIME type.

    Use `maintype' as the main MIME type to match against; this defaults to
    "text".  Optional `subtype' is the MIME subtype to match against; if
    omitted, only the main type is matched.
    """
    for subpart in msg.walk():
        if subpart.get_content_maintype() == maintype:
            if subtype is None or subpart.get_content_subtype() == subtype:
                yield subpart



def _structure(msg, fp=None, level=0, include_default=False):
    """A handy debugging aid"""
    if fp is None:
        fp = sys.stdout
    tab = ' ' * (level * 4)
    print(tab + msg.get_content_type(), end='', file=fp)
    if include_default:
        print(' [%s]' % msg.get_default_type(), file=fp)
    else:
        print(file=fp)
    if msg.is_multipart():
        for subpart in msg.get_payload():
            _structure(subpart, fp, level+1, include_default)
email/__init__.py000064400000003346151153537640007764 0ustar00# Copyright (C) 2001-2007 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org

"""A package for parsing, handling, and generating email messages."""

__all__ = [
    'base64mime',
    'charset',
    'encoders',
    'errors',
    'feedparser',
    'generator',
    'header',
    'iterators',
    'message',
    'message_from_file',
    'message_from_binary_file',
    'message_from_string',
    'message_from_bytes',
    'mime',
    'parser',
    'quoprimime',
    'utils',
    ]



# Some convenience routines.  Don't import Parser and Message as side-effects
# of importing email since those cascadingly import most of the rest of the
# email package.
def message_from_string(s, *args, **kws):
    """Parse a string into a Message object model.

    Optional _class and strict are passed to the Parser constructor.
    """
    from email.parser import Parser
    return Parser(*args, **kws).parsestr(s)

def message_from_bytes(s, *args, **kws):
    """Parse a bytes string into a Message object model.

    Optional _class and strict are passed to the Parser constructor.
    """
    from email.parser import BytesParser
    return BytesParser(*args, **kws).parsebytes(s)

def message_from_file(fp, *args, **kws):
    """Read a file and parse its contents into a Message object model.

    Optional _class and strict are passed to the Parser constructor.
    """
    from email.parser import Parser
    return Parser(*args, **kws).parse(fp)

def message_from_binary_file(fp, *args, **kws):
    """Read a binary file and parse its contents into a Message object model.

    Optional _class and strict are passed to the Parser constructor.
    """
    from email.parser import BytesParser
    return BytesParser(*args, **kws).parse(fp)
email/message.py000064400000133740151153537640007653 0ustar00# Copyright (C) 2001-2007 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org

"""Basic message object for the email package object model."""

__all__ = ['Message', 'EmailMessage']

import re
import uu
import quopri
from io import BytesIO, StringIO

# Intrapackage imports
from email import utils
from email import errors
from email._policybase import Policy, compat32
from email import charset as _charset
from email._encoded_words import decode_b
Charset = _charset.Charset

SEMISPACE = '; '

# Regular expression that matches `special' characters in parameters, the
# existence of which force quoting of the parameter value.
tspecials = re.compile(r'[ \(\)<>@,;:\\"/\[\]\?=]')


def _splitparam(param):
    # Split header parameters.  BAW: this may be too simple.  It isn't
    # strictly RFC 2045 (section 5.1) compliant, but it catches most headers
    # found in the wild.  We may eventually need a full fledged parser.
    # RDM: we might have a Header here; for now just stringify it.
    a, sep, b = str(param).partition(';')
    if not sep:
        return a.strip(), None
    return a.strip(), b.strip()

def _formatparam(param, value=None, quote=True):
    """Convenience function to format and return a key=value pair.

    This will quote the value if needed or if quote is true.  If value is a
    three tuple (charset, language, value), it will be encoded according
    to RFC2231 rules.  If it contains non-ascii characters it will likewise
    be encoded according to RFC2231 rules, using the utf-8 charset and
    a null language.
    """
    if value is not None and len(value) > 0:
        # A tuple is used for RFC 2231 encoded parameter values where items
        # are (charset, language, value).  charset is a string, not a Charset
        # instance.  RFC 2231 encoded values are never quoted, per RFC.
        if isinstance(value, tuple):
            # Encode as per RFC 2231
            param += '*'
            value = utils.encode_rfc2231(value[2], value[0], value[1])
            return '%s=%s' % (param, value)
        else:
            try:
                value.encode('ascii')
            except UnicodeEncodeError:
                param += '*'
                value = utils.encode_rfc2231(value, 'utf-8', '')
                return '%s=%s' % (param, value)
        # BAW: Please check this.  I think that if quote is set it should
        # force quoting even if not necessary.
        if quote or tspecials.search(value):
            return '%s="%s"' % (param, utils.quote(value))
        else:
            return '%s=%s' % (param, value)
    else:
        return param

def _parseparam(s):
    # RDM This might be a Header, so for now stringify it.
    s = ';' + str(s)
    plist = []
    while s[:1] == ';':
        s = s[1:]
        end = s.find(';')
        while end > 0 and (s.count('"', 0, end) - s.count('\\"', 0, end)) % 2:
            end = s.find(';', end + 1)
        if end < 0:
            end = len(s)
        f = s[:end]
        if '=' in f:
            i = f.index('=')
            f = f[:i].strip().lower() + '=' + f[i+1:].strip()
        plist.append(f.strip())
        s = s[end:]
    return plist


def _unquotevalue(value):
    # This is different than utils.collapse_rfc2231_value() because it doesn't
    # try to convert the value to a unicode.  Message.get_param() and
    # Message.get_params() are both currently defined to return the tuple in
    # the face of RFC 2231 parameters.
    if isinstance(value, tuple):
        return value[0], value[1], utils.unquote(value[2])
    else:
        return utils.unquote(value)



class Message:
    """Basic message object.

    A message object is defined as something that has a bunch of RFC 2822
    headers and a payload.  It may optionally have an envelope header
    (a.k.a. Unix-From or From_ header).  If the message is a container (i.e. a
    multipart or a message/rfc822), then the payload is a list of Message
    objects, otherwise it is a string.

    Message objects implement part of the `mapping' interface, which assumes
    there is exactly one occurrence of the header per message.  Some headers
    do in fact appear multiple times (e.g. Received) and for those headers,
    you must use the explicit API to set or get all the headers.  Not all of
    the mapping methods are implemented.
    """
    def __init__(self, policy=compat32):
        self.policy = policy
        self._headers = []
        self._unixfrom = None
        self._payload = None
        self._charset = None
        # Defaults for multipart messages
        self.preamble = self.epilogue = None
        self.defects = []
        # Default content type
        self._default_type = 'text/plain'

    def __str__(self):
        """Return the entire formatted message as a string.
        """
        return self.as_string()

    def as_string(self, unixfrom=False, maxheaderlen=0, policy=None):
        """Return the entire formatted message as a string.

        Optional 'unixfrom', when true, means include the Unix From_ envelope
        header.  For backward compatibility reasons, if maxheaderlen is
        not specified it defaults to 0, so you must override it explicitly
        if you want a different maxheaderlen.  'policy' is passed to the
        Generator instance used to serialize the message; if it is not
        specified the policy associated with the message instance is used.

        If the message object contains binary data that is not encoded
        according to RFC standards, the non-compliant data will be replaced by
        unicode "unknown character" code points.
        """
        from email.generator import Generator
        policy = self.policy if policy is None else policy
        fp = StringIO()
        g = Generator(fp,
                      mangle_from_=False,
                      maxheaderlen=maxheaderlen,
                      policy=policy)
        g.flatten(self, unixfrom=unixfrom)
        return fp.getvalue()

    def __bytes__(self):
        """Return the entire formatted message as a bytes object.
        """
        return self.as_bytes()

    def as_bytes(self, unixfrom=False, policy=None):
        """Return the entire formatted message as a bytes object.

        Optional 'unixfrom', when true, means include the Unix From_ envelope
        header.  'policy' is passed to the BytesGenerator instance used to
        serialize the message; if not specified the policy associated with
        the message instance is used.
        """
        from email.generator import BytesGenerator
        policy = self.policy if policy is None else policy
        fp = BytesIO()
        g = BytesGenerator(fp, mangle_from_=False, policy=policy)
        g.flatten(self, unixfrom=unixfrom)
        return fp.getvalue()

    def is_multipart(self):
        """Return True if the message consists of multiple parts."""
        return isinstance(self._payload, list)

    #
    # Unix From_ line
    #
    def set_unixfrom(self, unixfrom):
        self._unixfrom = unixfrom

    def get_unixfrom(self):
        return self._unixfrom

    #
    # Payload manipulation.
    #
    def attach(self, payload):
        """Add the given payload to the current payload.

        The current payload will always be a list of objects after this method
        is called.  If you want to set the payload to a scalar object, use
        set_payload() instead.
        """
        if self._payload is None:
            self._payload = [payload]
        else:
            try:
                self._payload.append(payload)
            except AttributeError:
                raise TypeError("Attach is not valid on a message with a"
                                " non-multipart payload")

    def get_payload(self, i=None, decode=False):
        """Return a reference to the payload.

        The payload will either be a list object or a string.  If you mutate
        the list object, you modify the message's payload in place.  Optional
        i returns that index into the payload.

        Optional decode is a flag indicating whether the payload should be
        decoded or not, according to the Content-Transfer-Encoding header
        (default is False).

        When True and the message is not a multipart, the payload will be
        decoded if this header's value is `quoted-printable' or `base64'.  If
        some other encoding is used, or the header is missing, or if the
        payload has bogus data (i.e. bogus base64 or uuencoded data), the
        payload is returned as-is.

        If the message is a multipart and the decode flag is True, then None
        is returned.
        """
        # Here is the logic table for this code, based on the email5.0.0 code:
        #   i     decode  is_multipart  result
        # ------  ------  ------------  ------------------------------
        #  None   True    True          None
        #   i     True    True          None
        #  None   False   True          _payload (a list)
        #   i     False   True          _payload element i (a Message)
        #   i     False   False         error (not a list)
        #   i     True    False         error (not a list)
        #  None   False   False         _payload
        #  None   True    False         _payload decoded (bytes)
        # Note that Barry planned to factor out the 'decode' case, but that
        # isn't so easy now that we handle the 8 bit data, which needs to be
        # converted in both the decode and non-decode path.
        if self.is_multipart():
            if decode:
                return None
            if i is None:
                return self._payload
            else:
                return self._payload[i]
        # For backward compatibility, Use isinstance and this error message
        # instead of the more logical is_multipart test.
        if i is not None and not isinstance(self._payload, list):
            raise TypeError('Expected list, got %s' % type(self._payload))
        payload = self._payload
        # cte might be a Header, so for now stringify it.
        cte = str(self.get('content-transfer-encoding', '')).lower()
        # payload may be bytes here.
        if isinstance(payload, str):
            if utils._has_surrogates(payload):
                bpayload = payload.encode('ascii', 'surrogateescape')
                if not decode:
                    try:
                        payload = bpayload.decode(self.get_param('charset', 'ascii'), 'replace')
                    except LookupError:
                        payload = bpayload.decode('ascii', 'replace')
            elif decode:
                try:
                    bpayload = payload.encode('ascii')
                except UnicodeError:
                    # This won't happen for RFC compliant messages (messages
                    # containing only ASCII code points in the unicode input).
                    # If it does happen, turn the string into bytes in a way
                    # guaranteed not to fail.
                    bpayload = payload.encode('raw-unicode-escape')
        if not decode:
            return payload
        if cte == 'quoted-printable':
            return quopri.decodestring(bpayload)
        elif cte == 'base64':
            # XXX: this is a bit of a hack; decode_b should probably be factored
            # out somewhere, but I haven't figured out where yet.
            value, defects = decode_b(b''.join(bpayload.splitlines()))
            for defect in defects:
                self.policy.handle_defect(self, defect)
            return value
        elif cte in ('x-uuencode', 'uuencode', 'uue', 'x-uue'):
            in_file = BytesIO(bpayload)
            out_file = BytesIO()
            try:
                uu.decode(in_file, out_file, quiet=True)
                return out_file.getvalue()
            except uu.Error:
                # Some decoding problem
                return bpayload
        if isinstance(payload, str):
            return bpayload
        return payload

    def set_payload(self, payload, charset=None):
        """Set the payload to the given value.

        Optional charset sets the message's default character set.  See
        set_charset() for details.
        """
        if hasattr(payload, 'encode'):
            if charset is None:
                self._payload = payload
                return
            if not isinstance(charset, Charset):
                charset = Charset(charset)
            payload = payload.encode(charset.output_charset)
        if hasattr(payload, 'decode'):
            self._payload = payload.decode('ascii', 'surrogateescape')
        else:
            self._payload = payload
        if charset is not None:
            self.set_charset(charset)

    def set_charset(self, charset):
        """Set the charset of the payload to a given character set.

        charset can be a Charset instance, a string naming a character set, or
        None.  If it is a string it will be converted to a Charset instance.
        If charset is None, the charset parameter will be removed from the
        Content-Type field.  Anything else will generate a TypeError.

        The message will be assumed to be of type text/* encoded with
        charset.input_charset.  It will be converted to charset.output_charset
        and encoded properly, if needed, when generating the plain text
        representation of the message.  MIME headers (MIME-Version,
        Content-Type, Content-Transfer-Encoding) will be added as needed.
        """
        if charset is None:
            self.del_param('charset')
            self._charset = None
            return
        if not isinstance(charset, Charset):
            charset = Charset(charset)
        self._charset = charset
        if 'MIME-Version' not in self:
            self.add_header('MIME-Version', '1.0')
        if 'Content-Type' not in self:
            self.add_header('Content-Type', 'text/plain',
                            charset=charset.get_output_charset())
        else:
            self.set_param('charset', charset.get_output_charset())
        if charset != charset.get_output_charset():
            self._payload = charset.body_encode(self._payload)
        if 'Content-Transfer-Encoding' not in self:
            cte = charset.get_body_encoding()
            try:
                cte(self)
            except TypeError:
                # This 'if' is for backward compatibility, it allows unicode
                # through even though that won't work correctly if the
                # message is serialized.
                payload = self._payload
                if payload:
                    try:
                        payload = payload.encode('ascii', 'surrogateescape')
                    except UnicodeError:
                        payload = payload.encode(charset.output_charset)
                self._payload = charset.body_encode(payload)
                self.add_header('Content-Transfer-Encoding', cte)

    def get_charset(self):
        """Return the Charset instance associated with the message's payload.
        """
        return self._charset

    #
    # MAPPING INTERFACE (partial)
    #
    def __len__(self):
        """Return the total number of headers, including duplicates."""
        return len(self._headers)

    def __getitem__(self, name):
        """Get a header value.

        Return None if the header is missing instead of raising an exception.

        Note that if the header appeared multiple times, exactly which
        occurrence gets returned is undefined.  Use get_all() to get all
        the values matching a header field name.
        """
        return self.get(name)

    def __setitem__(self, name, val):
        """Set the value of a header.

        Note: this does not overwrite an existing header with the same field
        name.  Use __delitem__() first to delete any existing headers.
        """
        max_count = self.policy.header_max_count(name)
        if max_count:
            lname = name.lower()
            found = 0
            for k, v in self._headers:
                if k.lower() == lname:
                    found += 1
                    if found >= max_count:
                        raise ValueError("There may be at most {} {} headers "
                                         "in a message".format(max_count, name))
        self._headers.append(self.policy.header_store_parse(name, val))

    def __delitem__(self, name):
        """Delete all occurrences of a header, if present.

        Does not raise an exception if the header is missing.
        """
        name = name.lower()
        newheaders = []
        for k, v in self._headers:
            if k.lower() != name:
                newheaders.append((k, v))
        self._headers = newheaders

    def __contains__(self, name):
        return name.lower() in [k.lower() for k, v in self._headers]

    def __iter__(self):
        for field, value in self._headers:
            yield field

    def keys(self):
        """Return a list of all the message's header field names.

        These will be sorted in the order they appeared in the original
        message, or were added to the message, and may contain duplicates.
        Any fields deleted and re-inserted are always appended to the header
        list.
        """
        return [k for k, v in self._headers]

    def values(self):
        """Return a list of all the message's header values.

        These will be sorted in the order they appeared in the original
        message, or were added to the message, and may contain duplicates.
        Any fields deleted and re-inserted are always appended to the header
        list.
        """
        return [self.policy.header_fetch_parse(k, v)
                for k, v in self._headers]

    def items(self):
        """Get all the message's header fields and values.

        These will be sorted in the order they appeared in the original
        message, or were added to the message, and may contain duplicates.
        Any fields deleted and re-inserted are always appended to the header
        list.
        """
        return [(k, self.policy.header_fetch_parse(k, v))
                for k, v in self._headers]

    def get(self, name, failobj=None):
        """Get a header value.

        Like __getitem__() but return failobj instead of None when the field
        is missing.
        """
        name = name.lower()
        for k, v in self._headers:
            if k.lower() == name:
                return self.policy.header_fetch_parse(k, v)
        return failobj

    #
    # "Internal" methods (public API, but only intended for use by a parser
    # or generator, not normal application code.
    #

    def set_raw(self, name, value):
        """Store name and value in the model without modification.

        This is an "internal" API, intended only for use by a parser.
        """
        self._headers.append((name, value))

    def raw_items(self):
        """Return the (name, value) header pairs without modification.

        This is an "internal" API, intended only for use by a generator.
        """
        return iter(self._headers.copy())

    #
    # Additional useful stuff
    #

    def get_all(self, name, failobj=None):
        """Return a list of all the values for the named field.

        These will be sorted in the order they appeared in the original
        message, and may contain duplicates.  Any fields deleted and
        re-inserted are always appended to the header list.

        If no such fields exist, failobj is returned (defaults to None).
        """
        values = []
        name = name.lower()
        for k, v in self._headers:
            if k.lower() == name:
                values.append(self.policy.header_fetch_parse(k, v))
        if not values:
            return failobj
        return values

    def add_header(self, _name, _value, **_params):
        """Extended header setting.

        name is the header field to add.  keyword arguments can be used to set
        additional parameters for the header field, with underscores converted
        to dashes.  Normally the parameter will be added as key="value" unless
        value is None, in which case only the key will be added.  If a
        parameter value contains non-ASCII characters it can be specified as a
        three-tuple of (charset, language, value), in which case it will be
        encoded according to RFC2231 rules.  Otherwise it will be encoded using
        the utf-8 charset and a language of ''.

        Examples:

        msg.add_header('content-disposition', 'attachment', filename='bud.gif')
        msg.add_header('content-disposition', 'attachment',
                       filename=('utf-8', '', Fußballer.ppt'))
        msg.add_header('content-disposition', 'attachment',
                       filename='Fußballer.ppt'))
        """
        parts = []
        for k, v in _params.items():
            if v is None:
                parts.append(k.replace('_', '-'))
            else:
                parts.append(_formatparam(k.replace('_', '-'), v))
        if _value is not None:
            parts.insert(0, _value)
        self[_name] = SEMISPACE.join(parts)

    def replace_header(self, _name, _value):
        """Replace a header.

        Replace the first matching header found in the message, retaining
        header order and case.  If no matching header was found, a KeyError is
        raised.
        """
        _name = _name.lower()
        for i, (k, v) in zip(range(len(self._headers)), self._headers):
            if k.lower() == _name:
                self._headers[i] = self.policy.header_store_parse(k, _value)
                break
        else:
            raise KeyError(_name)

    #
    # Use these three methods instead of the three above.
    #

    def get_content_type(self):
        """Return the message's content type.

        The returned string is coerced to lower case of the form
        `maintype/subtype'.  If there was no Content-Type header in the
        message, the default type as given by get_default_type() will be
        returned.  Since according to RFC 2045, messages always have a default
        type this will always return a value.

        RFC 2045 defines a message's default type to be text/plain unless it
        appears inside a multipart/digest container, in which case it would be
        message/rfc822.
        """
        missing = object()
        value = self.get('content-type', missing)
        if value is missing:
            # This should have no parameters
            return self.get_default_type()
        ctype = _splitparam(value)[0].lower()
        # RFC 2045, section 5.2 says if its invalid, use text/plain
        if ctype.count('/') != 1:
            return 'text/plain'
        return ctype

    def get_content_maintype(self):
        """Return the message's main content type.

        This is the `maintype' part of the string returned by
        get_content_type().
        """
        ctype = self.get_content_type()
        return ctype.split('/')[0]

    def get_content_subtype(self):
        """Returns the message's sub-content type.

        This is the `subtype' part of the string returned by
        get_content_type().
        """
        ctype = self.get_content_type()
        return ctype.split('/')[1]

    def get_default_type(self):
        """Return the `default' content type.

        Most messages have a default content type of text/plain, except for
        messages that are subparts of multipart/digest containers.  Such
        subparts have a default content type of message/rfc822.
        """
        return self._default_type

    def set_default_type(self, ctype):
        """Set the `default' content type.

        ctype should be either "text/plain" or "message/rfc822", although this
        is not enforced.  The default content type is not stored in the
        Content-Type header.
        """
        self._default_type = ctype

    def _get_params_preserve(self, failobj, header):
        # Like get_params() but preserves the quoting of values.  BAW:
        # should this be part of the public interface?
        missing = object()
        value = self.get(header, missing)
        if value is missing:
            return failobj
        params = []
        for p in _parseparam(value):
            try:
                name, val = p.split('=', 1)
                name = name.strip()
                val = val.strip()
            except ValueError:
                # Must have been a bare attribute
                name = p.strip()
                val = ''
            params.append((name, val))
        params = utils.decode_params(params)
        return params

    def get_params(self, failobj=None, header='content-type', unquote=True):
        """Return the message's Content-Type parameters, as a list.

        The elements of the returned list are 2-tuples of key/value pairs, as
        split on the `=' sign.  The left hand side of the `=' is the key,
        while the right hand side is the value.  If there is no `=' sign in
        the parameter the value is the empty string.  The value is as
        described in the get_param() method.

        Optional failobj is the object to return if there is no Content-Type
        header.  Optional header is the header to search instead of
        Content-Type.  If unquote is True, the value is unquoted.
        """
        missing = object()
        params = self._get_params_preserve(missing, header)
        if params is missing:
            return failobj
        if unquote:
            return [(k, _unquotevalue(v)) for k, v in params]
        else:
            return params

    def get_param(self, param, failobj=None, header='content-type',
                  unquote=True):
        """Return the parameter value if found in the Content-Type header.

        Optional failobj is the object to return if there is no Content-Type
        header, or the Content-Type header has no such parameter.  Optional
        header is the header to search instead of Content-Type.

        Parameter keys are always compared case insensitively.  The return
        value can either be a string, or a 3-tuple if the parameter was RFC
        2231 encoded.  When it's a 3-tuple, the elements of the value are of
        the form (CHARSET, LANGUAGE, VALUE).  Note that both CHARSET and
        LANGUAGE can be None, in which case you should consider VALUE to be
        encoded in the us-ascii charset.  You can usually ignore LANGUAGE.
        The parameter value (either the returned string, or the VALUE item in
        the 3-tuple) is always unquoted, unless unquote is set to False.

        If your application doesn't care whether the parameter was RFC 2231
        encoded, it can turn the return value into a string as follows:

            rawparam = msg.get_param('foo')
            param = email.utils.collapse_rfc2231_value(rawparam)

        """
        if header not in self:
            return failobj
        for k, v in self._get_params_preserve(failobj, header):
            if k.lower() == param.lower():
                if unquote:
                    return _unquotevalue(v)
                else:
                    return v
        return failobj

    def set_param(self, param, value, header='Content-Type', requote=True,
                  charset=None, language='', replace=False):
        """Set a parameter in the Content-Type header.

        If the parameter already exists in the header, its value will be
        replaced with the new value.

        If header is Content-Type and has not yet been defined for this
        message, it will be set to "text/plain" and the new parameter and
        value will be appended as per RFC 2045.

        An alternate header can be specified in the header argument, and all
        parameters will be quoted as necessary unless requote is False.

        If charset is specified, the parameter will be encoded according to RFC
        2231.  Optional language specifies the RFC 2231 language, defaulting
        to the empty string.  Both charset and language should be strings.
        """
        if not isinstance(value, tuple) and charset:
            value = (charset, language, value)

        if header not in self and header.lower() == 'content-type':
            ctype = 'text/plain'
        else:
            ctype = self.get(header)
        if not self.get_param(param, header=header):
            if not ctype:
                ctype = _formatparam(param, value, requote)
            else:
                ctype = SEMISPACE.join(
                    [ctype, _formatparam(param, value, requote)])
        else:
            ctype = ''
            for old_param, old_value in self.get_params(header=header,
                                                        unquote=requote):
                append_param = ''
                if old_param.lower() == param.lower():
                    append_param = _formatparam(param, value, requote)
                else:
                    append_param = _formatparam(old_param, old_value, requote)
                if not ctype:
                    ctype = append_param
                else:
                    ctype = SEMISPACE.join([ctype, append_param])
        if ctype != self.get(header):
            if replace:
                self.replace_header(header, ctype)
            else:
                del self[header]
                self[header] = ctype

    def del_param(self, param, header='content-type', requote=True):
        """Remove the given parameter completely from the Content-Type header.

        The header will be re-written in place without the parameter or its
        value. All values will be quoted as necessary unless requote is
        False.  Optional header specifies an alternative to the Content-Type
        header.
        """
        if header not in self:
            return
        new_ctype = ''
        for p, v in self.get_params(header=header, unquote=requote):
            if p.lower() != param.lower():
                if not new_ctype:
                    new_ctype = _formatparam(p, v, requote)
                else:
                    new_ctype = SEMISPACE.join([new_ctype,
                                                _formatparam(p, v, requote)])
        if new_ctype != self.get(header):
            del self[header]
            self[header] = new_ctype

    def set_type(self, type, header='Content-Type', requote=True):
        """Set the main type and subtype for the Content-Type header.

        type must be a string in the form "maintype/subtype", otherwise a
        ValueError is raised.

        This method replaces the Content-Type header, keeping all the
        parameters in place.  If requote is False, this leaves the existing
        header's quoting as is.  Otherwise, the parameters will be quoted (the
        default).

        An alternative header can be specified in the header argument.  When
        the Content-Type header is set, we'll always also add a MIME-Version
        header.
        """
        # BAW: should we be strict?
        if not type.count('/') == 1:
            raise ValueError
        # Set the Content-Type, you get a MIME-Version
        if header.lower() == 'content-type':
            del self['mime-version']
            self['MIME-Version'] = '1.0'
        if header not in self:
            self[header] = type
            return
        params = self.get_params(header=header, unquote=requote)
        del self[header]
        self[header] = type
        # Skip the first param; it's the old type.
        for p, v in params[1:]:
            self.set_param(p, v, header, requote)

    def get_filename(self, failobj=None):
        """Return the filename associated with the payload if present.

        The filename is extracted from the Content-Disposition header's
        `filename' parameter, and it is unquoted.  If that header is missing
        the `filename' parameter, this method falls back to looking for the
        `name' parameter.
        """
        missing = object()
        filename = self.get_param('filename', missing, 'content-disposition')
        if filename is missing:
            filename = self.get_param('name', missing, 'content-type')
        if filename is missing:
            return failobj
        return utils.collapse_rfc2231_value(filename).strip()

    def get_boundary(self, failobj=None):
        """Return the boundary associated with the payload if present.

        The boundary is extracted from the Content-Type header's `boundary'
        parameter, and it is unquoted.
        """
        missing = object()
        boundary = self.get_param('boundary', missing)
        if boundary is missing:
            return failobj
        # RFC 2046 says that boundaries may begin but not end in w/s
        return utils.collapse_rfc2231_value(boundary).rstrip()

    def set_boundary(self, boundary):
        """Set the boundary parameter in Content-Type to 'boundary'.

        This is subtly different than deleting the Content-Type header and
        adding a new one with a new boundary parameter via add_header().  The
        main difference is that using the set_boundary() method preserves the
        order of the Content-Type header in the original message.

        HeaderParseError is raised if the message has no Content-Type header.
        """
        missing = object()
        params = self._get_params_preserve(missing, 'content-type')
        if params is missing:
            # There was no Content-Type header, and we don't know what type
            # to set it to, so raise an exception.
            raise errors.HeaderParseError('No Content-Type header found')
        newparams = []
        foundp = False
        for pk, pv in params:
            if pk.lower() == 'boundary':
                newparams.append(('boundary', '"%s"' % boundary))
                foundp = True
            else:
                newparams.append((pk, pv))
        if not foundp:
            # The original Content-Type header had no boundary attribute.
            # Tack one on the end.  BAW: should we raise an exception
            # instead???
            newparams.append(('boundary', '"%s"' % boundary))
        # Replace the existing Content-Type header with the new value
        newheaders = []
        for h, v in self._headers:
            if h.lower() == 'content-type':
                parts = []
                for k, v in newparams:
                    if v == '':
                        parts.append(k)
                    else:
                        parts.append('%s=%s' % (k, v))
                val = SEMISPACE.join(parts)
                newheaders.append(self.policy.header_store_parse(h, val))

            else:
                newheaders.append((h, v))
        self._headers = newheaders

    def get_content_charset(self, failobj=None):
        """Return the charset parameter of the Content-Type header.

        The returned string is always coerced to lower case.  If there is no
        Content-Type header, or if that header has no charset parameter,
        failobj is returned.
        """
        missing = object()
        charset = self.get_param('charset', missing)
        if charset is missing:
            return failobj
        if isinstance(charset, tuple):
            # RFC 2231 encoded, so decode it, and it better end up as ascii.
            pcharset = charset[0] or 'us-ascii'
            try:
                # LookupError will be raised if the charset isn't known to
                # Python.  UnicodeError will be raised if the encoded text
                # contains a character not in the charset.
                as_bytes = charset[2].encode('raw-unicode-escape')
                charset = str(as_bytes, pcharset)
            except (LookupError, UnicodeError):
                charset = charset[2]
        # charset characters must be in us-ascii range
        try:
            charset.encode('us-ascii')
        except UnicodeError:
            return failobj
        # RFC 2046, $4.1.2 says charsets are not case sensitive
        return charset.lower()

    def get_charsets(self, failobj=None):
        """Return a list containing the charset(s) used in this message.

        The returned list of items describes the Content-Type headers'
        charset parameter for this message and all the subparts in its
        payload.

        Each item will either be a string (the value of the charset parameter
        in the Content-Type header of that part) or the value of the
        'failobj' parameter (defaults to None), if the part does not have a
        main MIME type of "text", or the charset is not defined.

        The list will contain one string for each part of the message, plus
        one for the container message (i.e. self), so that a non-multipart
        message will still return a list of length 1.
        """
        return [part.get_content_charset(failobj) for part in self.walk()]

    def get_content_disposition(self):
        """Return the message's content-disposition if it exists, or None.

        The return values can be either 'inline', 'attachment' or None
        according to the rfc2183.
        """
        value = self.get('content-disposition')
        if value is None:
            return None
        c_d = _splitparam(value)[0].lower()
        return c_d

    # I.e. def walk(self): ...
    from email.iterators import walk


class MIMEPart(Message):

    def __init__(self, policy=None):
        if policy is None:
            from email.policy import default
            policy = default
        Message.__init__(self, policy)


    def as_string(self, unixfrom=False, maxheaderlen=None, policy=None):
        """Return the entire formatted message as a string.

        Optional 'unixfrom', when true, means include the Unix From_ envelope
        header.  maxheaderlen is retained for backward compatibility with the
        base Message class, but defaults to None, meaning that the policy value
        for max_line_length controls the header maximum length.  'policy' is
        passed to the Generator instance used to serialize the message; if it
        is not specified the policy associated with the message instance is
        used.
        """
        policy = self.policy if policy is None else policy
        if maxheaderlen is None:
            maxheaderlen = policy.max_line_length
        return super().as_string(maxheaderlen=maxheaderlen, policy=policy)

    def __str__(self):
        return self.as_string(policy=self.policy.clone(utf8=True))

    def is_attachment(self):
        c_d = self.get('content-disposition')
        return False if c_d is None else c_d.content_disposition == 'attachment'

    def _find_body(self, part, preferencelist):
        if part.is_attachment():
            return
        maintype, subtype = part.get_content_type().split('/')
        if maintype == 'text':
            if subtype in preferencelist:
                yield (preferencelist.index(subtype), part)
            return
        if maintype != 'multipart':
            return
        if subtype != 'related':
            for subpart in part.iter_parts():
                yield from self._find_body(subpart, preferencelist)
            return
        if 'related' in preferencelist:
            yield (preferencelist.index('related'), part)
        candidate = None
        start = part.get_param('start')
        if start:
            for subpart in part.iter_parts():
                if subpart['content-id'] == start:
                    candidate = subpart
                    break
        if candidate is None:
            subparts = part.get_payload()
            candidate = subparts[0] if subparts else None
        if candidate is not None:
            yield from self._find_body(candidate, preferencelist)

    def get_body(self, preferencelist=('related', 'html', 'plain')):
        """Return best candidate mime part for display as 'body' of message.

        Do a depth first search, starting with self, looking for the first part
        matching each of the items in preferencelist, and return the part
        corresponding to the first item that has a match, or None if no items
        have a match.  If 'related' is not included in preferencelist, consider
        the root part of any multipart/related encountered as a candidate
        match.  Ignore parts with 'Content-Disposition: attachment'.
        """
        best_prio = len(preferencelist)
        body = None
        for prio, part in self._find_body(self, preferencelist):
            if prio < best_prio:
                best_prio = prio
                body = part
                if prio == 0:
                    break
        return body

    _body_types = {('text', 'plain'),
                   ('text', 'html'),
                   ('multipart', 'related'),
                   ('multipart', 'alternative')}
    def iter_attachments(self):
        """Return an iterator over the non-main parts of a multipart.

        Skip the first of each occurrence of text/plain, text/html,
        multipart/related, or multipart/alternative in the multipart (unless
        they have a 'Content-Disposition: attachment' header) and include all
        remaining subparts in the returned iterator.  When applied to a
        multipart/related, return all parts except the root part.  Return an
        empty iterator when applied to a multipart/alternative or a
        non-multipart.
        """
        maintype, subtype = self.get_content_type().split('/')
        if maintype != 'multipart' or subtype == 'alternative':
            return
        payload = self.get_payload()
        # Certain malformed messages can have content type set to `multipart/*`
        # but still have single part body, in which case payload.copy() can
        # fail with AttributeError.
        try:
            parts = payload.copy()
        except AttributeError:
            # payload is not a list, it is most probably a string.
            return

        if maintype == 'multipart' and subtype == 'related':
            # For related, we treat everything but the root as an attachment.
            # The root may be indicated by 'start'; if there's no start or we
            # can't find the named start, treat the first subpart as the root.
            start = self.get_param('start')
            if start:
                found = False
                attachments = []
                for part in parts:
                    if part.get('content-id') == start:
                        found = True
                    else:
                        attachments.append(part)
                if found:
                    yield from attachments
                    return
            parts.pop(0)
            yield from parts
            return
        # Otherwise we more or less invert the remaining logic in get_body.
        # This only really works in edge cases (ex: non-text related or
        # alternatives) if the sending agent sets content-disposition.
        seen = []   # Only skip the first example of each candidate type.
        for part in parts:
            maintype, subtype = part.get_content_type().split('/')
            if ((maintype, subtype) in self._body_types and
                    not part.is_attachment() and subtype not in seen):
                seen.append(subtype)
                continue
            yield part

    def iter_parts(self):
        """Return an iterator over all immediate subparts of a multipart.

        Return an empty iterator for a non-multipart.
        """
        if self.get_content_maintype() == 'multipart':
            yield from self.get_payload()

    def get_content(self, *args, content_manager=None, **kw):
        if content_manager is None:
            content_manager = self.policy.content_manager
        return content_manager.get_content(self, *args, **kw)

    def set_content(self, *args, content_manager=None, **kw):
        if content_manager is None:
            content_manager = self.policy.content_manager
        content_manager.set_content(self, *args, **kw)

    def _make_multipart(self, subtype, disallowed_subtypes, boundary):
        if self.get_content_maintype() == 'multipart':
            existing_subtype = self.get_content_subtype()
            disallowed_subtypes = disallowed_subtypes + (subtype,)
            if existing_subtype in disallowed_subtypes:
                raise ValueError("Cannot convert {} to {}".format(
                    existing_subtype, subtype))
        keep_headers = []
        part_headers = []
        for name, value in self._headers:
            if name.lower().startswith('content-'):
                part_headers.append((name, value))
            else:
                keep_headers.append((name, value))
        if part_headers:
            # There is existing content, move it to the first subpart.
            part = type(self)(policy=self.policy)
            part._headers = part_headers
            part._payload = self._payload
            self._payload = [part]
        else:
            self._payload = []
        self._headers = keep_headers
        self['Content-Type'] = 'multipart/' + subtype
        if boundary is not None:
            self.set_param('boundary', boundary)

    def make_related(self, boundary=None):
        self._make_multipart('related', ('alternative', 'mixed'), boundary)

    def make_alternative(self, boundary=None):
        self._make_multipart('alternative', ('mixed',), boundary)

    def make_mixed(self, boundary=None):
        self._make_multipart('mixed', (), boundary)

    def _add_multipart(self, _subtype, *args, _disp=None, **kw):
        if (self.get_content_maintype() != 'multipart' or
                self.get_content_subtype() != _subtype):
            getattr(self, 'make_' + _subtype)()
        part = type(self)(policy=self.policy)
        part.set_content(*args, **kw)
        if _disp and 'content-disposition' not in part:
            part['Content-Disposition'] = _disp
        self.attach(part)

    def add_related(self, *args, **kw):
        self._add_multipart('related', *args, _disp='inline', **kw)

    def add_alternative(self, *args, **kw):
        self._add_multipart('alternative', *args, **kw)

    def add_attachment(self, *args, **kw):
        self._add_multipart('mixed', *args, _disp='attachment', **kw)

    def clear(self):
        self._headers = []
        self._payload = None

    def clear_content(self):
        self._headers = [(n, v) for n, v in self._headers
                         if not n.lower().startswith('content-')]
        self._payload = None


class EmailMessage(MIMEPart):

    def set_content(self, *args, **kw):
        super().set_content(*args, **kw)
        if 'MIME-Version' not in self:
            self['MIME-Version'] = '1.0'
email/mime/audio.py000064400000005263151153537640010255 0ustar00# Copyright (C) 2001-2007 Python Software Foundation
# Author: Anthony Baxter
# Contact: email-sig@python.org

"""Class representing audio/* type MIME documents."""

__all__ = ['MIMEAudio']

import sndhdr

from io import BytesIO
from email import encoders
from email.mime.nonmultipart import MIMENonMultipart



_sndhdr_MIMEmap = {'au'  : 'basic',
                   'wav' :'x-wav',
                   'aiff':'x-aiff',
                   'aifc':'x-aiff',
                   }

# There are others in sndhdr that don't have MIME types. :(
# Additional ones to be added to sndhdr? midi, mp3, realaudio, wma??
def _whatsnd(data):
    """Try to identify a sound file type.

    sndhdr.what() has a pretty cruddy interface, unfortunately.  This is why
    we re-do it here.  It would be easier to reverse engineer the Unix 'file'
    command and use the standard 'magic' file, as shipped with a modern Unix.
    """
    hdr = data[:512]
    fakefile = BytesIO(hdr)
    for testfn in sndhdr.tests:
        res = testfn(hdr, fakefile)
        if res is not None:
            return _sndhdr_MIMEmap.get(res[0])
    return None



class MIMEAudio(MIMENonMultipart):
    """Class for generating audio/* MIME documents."""

    def __init__(self, _audiodata, _subtype=None,
                 _encoder=encoders.encode_base64, *, policy=None, **_params):
        """Create an audio/* type MIME document.

        _audiodata is a string containing the raw audio data.  If this data
        can be decoded by the standard Python `sndhdr' module, then the
        subtype will be automatically included in the Content-Type header.
        Otherwise, you can specify  the specific audio subtype via the
        _subtype parameter.  If _subtype is not given, and no subtype can be
        guessed, a TypeError is raised.

        _encoder is a function which will perform the actual encoding for
        transport of the image data.  It takes one argument, which is this
        Image instance.  It should use get_payload() and set_payload() to
        change the payload to the encoded form.  It should also add any
        Content-Transfer-Encoding or other headers to the message as
        necessary.  The default encoding is Base64.

        Any additional keyword arguments are passed to the base class
        constructor, which turns them into parameters on the Content-Type
        header.
        """
        if _subtype is None:
            _subtype = _whatsnd(_audiodata)
        if _subtype is None:
            raise TypeError('Could not find audio MIME subtype')
        MIMENonMultipart.__init__(self, 'audio', _subtype, policy=policy,
                                  **_params)
        self.set_payload(_audiodata)
        _encoder(self)
email/mime/text.py000064400000002635151153537640010140 0ustar00# Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org

"""Class representing text/* type MIME documents."""

__all__ = ['MIMEText']

from email.charset import Charset
from email.mime.nonmultipart import MIMENonMultipart



class MIMEText(MIMENonMultipart):
    """Class for generating text/* type MIME documents."""

    def __init__(self, _text, _subtype='plain', _charset=None, *, policy=None):
        """Create a text/* type MIME document.

        _text is the string for this message object.

        _subtype is the MIME sub content type, defaulting to "plain".

        _charset is the character set parameter added to the Content-Type
        header.  This defaults to "us-ascii".  Note that as a side-effect, the
        Content-Transfer-Encoding header will also be set.
        """

        # If no _charset was specified, check to see if there are non-ascii
        # characters present. If not, use 'us-ascii', otherwise use utf-8.
        # XXX: This can be removed once #7304 is fixed.
        if _charset is None:
            try:
                _text.encode('us-ascii')
                _charset = 'us-ascii'
            except UnicodeEncodeError:
                _charset = 'utf-8'

        MIMENonMultipart.__init__(self, 'text', _subtype, policy=policy,
                                  **{'charset': str(_charset)})

        self.set_payload(_text, _charset)
email/mime/__init__.py000064400000000000151153537640010673 0ustar00email/mime/message.py000064400000002445151153537640010577 0ustar00# Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org

"""Class representing message/* MIME documents."""

__all__ = ['MIMEMessage']

from email import message
from email.mime.nonmultipart import MIMENonMultipart



class MIMEMessage(MIMENonMultipart):
    """Class representing message/* MIME documents."""

    def __init__(self, _msg, _subtype='rfc822', *, policy=None):
        """Create a message/* type MIME document.

        _msg is a message object and must be an instance of Message, or a
        derived class of Message, otherwise a TypeError is raised.

        Optional _subtype defines the subtype of the contained message.  The
        default is "rfc822" (this is defined by the MIME standard, even though
        the term "rfc822" is technically outdated by RFC 2822).
        """
        MIMENonMultipart.__init__(self, 'message', _subtype, policy=policy)
        if not isinstance(_msg, message.Message):
            raise TypeError('Argument is not an instance of Message')
        # It's convenient to use this base class method.  We need to do it
        # this way or we'll get an exception
        message.Message.attach(self, _msg)
        # And be sure our default type is set correctly
        self.set_default_type('message/rfc822')
email/mime/multipart.py000064400000003125151153537640011170 0ustar00# Copyright (C) 2002-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org

"""Base class for MIME multipart/* type messages."""

__all__ = ['MIMEMultipart']

from email.mime.base import MIMEBase



class MIMEMultipart(MIMEBase):
    """Base class for MIME multipart/* type messages."""

    def __init__(self, _subtype='mixed', boundary=None, _subparts=None,
                 *, policy=None,
                 **_params):
        """Creates a multipart/* type message.

        By default, creates a multipart/mixed message, with proper
        Content-Type and MIME-Version headers.

        _subtype is the subtype of the multipart content type, defaulting to
        `mixed'.

        boundary is the multipart boundary string.  By default it is
        calculated as needed.

        _subparts is a sequence of initial subparts for the payload.  It
        must be an iterable object, such as a list.  You can always
        attach new subparts to the message by using the attach() method.

        Additional parameters for the Content-Type header are taken from the
        keyword arguments (or passed into the _params argument).
        """
        MIMEBase.__init__(self, 'multipart', _subtype, policy=policy, **_params)

        # Initialise _payload to an empty list as the Message superclass's
        # implementation of is_multipart assumes that _payload is a list for
        # multipart messages.
        self._payload = []

        if _subparts:
            for p in _subparts:
                self.attach(p)
        if boundary:
            self.set_boundary(boundary)
email/mime/__pycache__/base.cpython-38.pyc000064400000002023151153537640014343 0ustar00U

e5d��@s4dZdgZddlZddlmZGdd�dej�ZdS)�$Base class for MIME specializations.�MIMEBase�N)�messagec@seZdZdZdd�dd�ZdS)rrN��policycKsH|dkrtjj}tjj||d�d||f}|jd|f|�d|d<dS)z�This constructor adds a Content-Type: and a MIME-Version: header.

        The Content-Type: header is taken from the _maintype and _subtype
        arguments.  Additional parameters for this header are taken from the
        keyword arguments.
        Nrz%s/%szContent-Typez1.0zMIME-Version)�emailrZcompat32r�Message�__init__Z
add_header)�selfZ	_maintypeZ_subtyperZ_paramsZctype�r�'/usr/lib64/python3.8/email/mime/base.pyr	szMIMEBase.__init__)�__name__�
__module__�__qualname__�__doc__r	rrrrrs)r�__all__Zemail.policyrrrrrrrr�<module>semail/mime/__pycache__/multipart.cpython-38.opt-2.pyc000064400000001304151153537640016413 0ustar00U

e5dU�@s&dgZddlmZGdd�de�ZdS)�
MIMEMultipart�)�MIMEBasec@seZdZddd�dd�ZdS)r�mixedN)�policycKsJtj|d|fd|i|��g|_|r8|D]}|�|�q(|rF|�|�dS)NZ	multipartr)r�__init__Z_payloadZattachZset_boundary)�selfZ_subtype�boundaryZ	_subpartsrZ_params�p�r
�,/usr/lib64/python3.8/email/mime/multipart.pyrszMIMEMultipart.__init__)rNN)�__name__�
__module__�__qualname__rr
r
r
rr
s�N)�__all__Zemail.mime.baserrr
r
r
r�<module>semail/mime/__pycache__/multipart.cpython-38.pyc000064400000002740151153537640015460 0ustar00U

e5dU�@s*dZdgZddlmZGdd�de�ZdS)�.Base class for MIME multipart/* type messages.�
MIMEMultipart�)�MIMEBasec@s eZdZdZddd�dd�ZdS)rr�mixedN)�policycKsJtj|d|fd|i|��g|_|r8|D]}|�|�q(|rF|�|�dS)a�Creates a multipart/* type message.

        By default, creates a multipart/mixed message, with proper
        Content-Type and MIME-Version headers.

        _subtype is the subtype of the multipart content type, defaulting to
        `mixed'.

        boundary is the multipart boundary string.  By default it is
        calculated as needed.

        _subparts is a sequence of initial subparts for the payload.  It
        must be an iterable object, such as a list.  You can always
        attach new subparts to the message by using the attach() method.

        Additional parameters for the Content-Type header are taken from the
        keyword arguments (or passed into the _params argument).
        Z	multipartrN)r�__init__Z_payloadZattachZset_boundary)�selfZ_subtype�boundaryZ	_subpartsrZ_params�p�r�,/usr/lib64/python3.8/email/mime/multipart.pyrszMIMEMultipart.__init__)rNN)�__name__�
__module__�__qualname__�__doc__rrrrrr
s�N)r�__all__Zemail.mime.baserrrrrr�<module>semail/mime/__pycache__/image.cpython-38.opt-1.pyc000064400000003562151153537640015463 0ustar00U

e5d%�@s>dZdgZddlZddlmZddlmZGdd�de�ZdS)z/Class representing image/* type MIME documents.�	MIMEImage�N)�encoders)�MIMENonMultipartc@s&eZdZdZdejfdd�dd�ZdS)rz1Class for generating image/* type MIME documents.N)�policycKsT|dkrt�d|�}|dkr$td��tj|d|fd|i|��|�|�||�dS)a�Create an image/* type MIME document.

        _imagedata is a string containing the raw image data.  If this data
        can be decoded by the standard Python `imghdr' module, then the
        subtype will be automatically included in the Content-Type header.
        Otherwise, you can specify the specific image subtype via the _subtype
        parameter.

        _encoder is a function which will perform the actual encoding for
        transport of the image data.  It takes one argument, which is this
        Image instance.  It should use get_payload() and set_payload() to
        change the payload to the encoded form.  It should also add any
        Content-Transfer-Encoding or other headers to the message as
        necessary.  The default encoding is Base64.

        Any additional keyword arguments are passed to the base class
        constructor, which turns them into parameters on the Content-Type
        header.
        Nz"Could not guess image MIME subtypeZimager)�imghdrZwhat�	TypeErrorr�__init__Zset_payload)�selfZ
_imagedataZ_subtypeZ_encoderrZ_params�r
�(/usr/lib64/python3.8/email/mime/image.pyrs�
zMIMEImage.__init__)�__name__�
__module__�__qualname__�__doc__rZ
encode_base64rr
r
r
rrs��)r�__all__rZemailrZemail.mime.nonmultipartrrr
r
r
r�<module>s
email/mime/__pycache__/image.cpython-38.opt-2.pyc000064400000001475151153537640015465 0ustar00U

e5d%�@s:dgZddlZddlmZddlmZGdd�de�ZdS)�	MIMEImage�N)�encoders)�MIMENonMultipartc@s"eZdZdejfdd�dd�ZdS)rN)�policycKsT|dkrt�d|�}|dkr$td��tj|d|fd|i|��|�|�||�dS)Nz"Could not guess image MIME subtypeZimager)�imghdrZwhat�	TypeErrorr�__init__Zset_payload)�selfZ
_imagedataZ_subtypeZ_encoderrZ_params�r
�(/usr/lib64/python3.8/email/mime/image.pyrs�
zMIMEImage.__init__)�__name__�
__module__�__qualname__rZ
encode_base64rr
r
r
rrs
��)�__all__rZemailrZemail.mime.nonmultipartrrr
r
r
r�<module>semail/mime/__pycache__/audio.cpython-38.opt-2.pyc000064400000002242151153537640015475 0ustar00U

e5d�
�@s\dgZddlZddlmZddlmZddlmZddddd	�Zd
d�Z	Gdd�de�Z
dS)
�	MIMEAudio�N)�BytesIO)�encoders)�MIMENonMultipartZbasiczx-wavzx-aiff)ZauZwavZaiffZaifccCsH|dd�}t|�}tjD](}|||�}|dk	rt�|d�SqdS)Nir)r�sndhdrZtests�_sndhdr_MIMEmap�get)�dataZhdrZfakefileZtestfn�res�r�(/usr/lib64/python3.8/email/mime/audio.py�_whatsnds

r
c@s"eZdZdejfdd�dd�ZdS)rN)�policycKsP|dkrt|�}|dkr td��tj|d|fd|i|��|�|�||�dS)Nz!Could not find audio MIME subtypeZaudior)r
�	TypeErrorr�__init__Zset_payload)�selfZ
_audiodataZ_subtypeZ_encoderrZ_paramsrrrr-s�
zMIMEAudio.__init__)�__name__�
__module__�__qualname__rZ
encode_base64rrrrrr*s
��)�__all__r�iorZemailrZemail.mime.nonmultipartrrr
rrrrr�<module>s�email/mime/__pycache__/audio.cpython-38.opt-1.pyc000064400000005102151153537640015472 0ustar00U

e5d�
�@s`dZdgZddlZddlmZddlmZddlmZddd	d	d
�Z	dd�Z
Gd
d�de�ZdS)z/Class representing audio/* type MIME documents.�	MIMEAudio�N)�BytesIO)�encoders)�MIMENonMultipartZbasiczx-wavzx-aiff)ZauZwavZaiffZaifccCsH|dd�}t|�}tjD](}|||�}|dk	rt�|d�SqdS)aTry to identify a sound file type.

    sndhdr.what() has a pretty cruddy interface, unfortunately.  This is why
    we re-do it here.  It would be easier to reverse engineer the Unix 'file'
    command and use the standard 'magic' file, as shipped with a modern Unix.
    Nir)r�sndhdrZtests�_sndhdr_MIMEmap�get)�dataZhdrZfakefileZtestfn�res�r�(/usr/lib64/python3.8/email/mime/audio.py�_whatsnds

r
c@s&eZdZdZdejfdd�dd�ZdS)rz,Class for generating audio/* MIME documents.N)�policycKsP|dkrt|�}|dkr td��tj|d|fd|i|��|�|�||�dS)aCreate an audio/* type MIME document.

        _audiodata is a string containing the raw audio data.  If this data
        can be decoded by the standard Python `sndhdr' module, then the
        subtype will be automatically included in the Content-Type header.
        Otherwise, you can specify  the specific audio subtype via the
        _subtype parameter.  If _subtype is not given, and no subtype can be
        guessed, a TypeError is raised.

        _encoder is a function which will perform the actual encoding for
        transport of the image data.  It takes one argument, which is this
        Image instance.  It should use get_payload() and set_payload() to
        change the payload to the encoded form.  It should also add any
        Content-Transfer-Encoding or other headers to the message as
        necessary.  The default encoding is Base64.

        Any additional keyword arguments are passed to the base class
        constructor, which turns them into parameters on the Content-Type
        header.
        Nz!Could not find audio MIME subtypeZaudior)r
�	TypeErrorr�__init__Zset_payload)�selfZ
_audiodataZ_subtypeZ_encoderrZ_paramsrrrr-s�
zMIMEAudio.__init__)�__name__�
__module__�__qualname__�__doc__rZ
encode_base64rrrrrr*s��)r�__all__r�iorZemailrZemail.mime.nonmultipartrrr
rrrrr�<module>s�email/mime/__pycache__/__init__.cpython-38.opt-1.pyc000064400000000206151153537640016130 0ustar00U

��.e�@sdS)N�rrr�+/usr/lib64/python3.8/email/mime/__init__.py�<module>�email/mime/__pycache__/text.cpython-38.pyc000064400000002441151153537640014421 0ustar00U

e5d��@s6dZdgZddlmZddlmZGdd�de�ZdS)z.Class representing text/* type MIME documents.�MIMEText�)�Charset)�MIMENonMultipartc@s eZdZdZddd�dd�ZdS)rz0Class for generating text/* type MIME documents.�plainN)�policycCsf|dkr4z|�d�d}Wntk
r2d}YnXtj|d|fd|idt|�i��|�||�dS)a~Create a text/* type MIME document.

        _text is the string for this message object.

        _subtype is the MIME sub content type, defaulting to "plain".

        _charset is the character set parameter added to the Content-Type
        header.  This defaults to "us-ascii".  Note that as a side-effect, the
        Content-Transfer-Encoding header will also be set.
        Nzus-asciizutf-8�textr�charset)�encode�UnicodeEncodeErrorr�__init__�strZset_payload)�selfZ_textZ_subtypeZ_charsetr�r�'/usr/lib64/python3.8/email/mime/text.pyrs


�zMIMEText.__init__)rN)�__name__�
__module__�__qualname__�__doc__rrrrrrsN)r�__all__Z
email.charsetrZemail.mime.nonmultipartrrrrrr�<module>semail/mime/__pycache__/message.cpython-38.opt-1.pyc000064400000002404151153537640016017 0ustar00U

e5d%�@s6dZdgZddlmZddlmZGdd�de�ZdS)�,Class representing message/* MIME documents.�MIMEMessage�)�message)�MIMENonMultipartc@s eZdZdZddd�dd�ZdS)rr�rfc822N��policycCsBtj|d||d�t|tj�s&td��tj�||�|�d�dS)a�Create a message/* type MIME document.

        _msg is a message object and must be an instance of Message, or a
        derived class of Message, otherwise a TypeError is raised.

        Optional _subtype defines the subtype of the contained message.  The
        default is "rfc822" (this is defined by the MIME standard, even though
        the term "rfc822" is technically outdated by RFC 2822).
        rrz&Argument is not an instance of Messagezmessage/rfc822N)r�__init__�
isinstancerZMessage�	TypeErrorZattachZset_default_type)�selfZ_msgZ_subtyper�r
�*/usr/lib64/python3.8/email/mime/message.pyr	s

zMIMEMessage.__init__)r)�__name__�
__module__�__qualname__�__doc__r	r
r
r
rrsN)r�__all__ZemailrZemail.mime.nonmultipartrrr
r
r
r�<module>semail/mime/__pycache__/message.cpython-38.opt-2.pyc000064400000001430151153537640016016 0ustar00U

e5d%�@s2dgZddlmZddlmZGdd�de�ZdS)�MIMEMessage�)�message)�MIMENonMultipartc@seZdZddd�dd�ZdS)r�rfc822N��policycCsBtj|d||d�t|tj�s&td��tj�||�|�d�dS)Nrrz&Argument is not an instance of Messagezmessage/rfc822)r�__init__�
isinstancerZMessage�	TypeErrorZattachZset_default_type)�selfZ_msgZ_subtyper�r�*/usr/lib64/python3.8/email/mime/message.pyrs

zMIMEMessage.__init__)r)�__name__�
__module__�__qualname__rrrrr
rsN)�__all__ZemailrZemail.mime.nonmultipartrrrrrr
�<module>semail/mime/__pycache__/application.cpython-38.pyc000064400000002665151153537640015750 0ustar00U

e5d)�@s6dZdgZddlmZddlmZGdd�de�ZdS)z5Class representing application/* type MIME documents.�MIMEApplication�)�encoders)�MIMENonMultipartc@s&eZdZdZdejfdd�dd�ZdS)rz2Class for generating application/* MIME documents.zoctet-streamN)�policycKs@|dkrtd��tj|d|fd|i|��|�|�||�dS)aCreate an application/* type MIME document.

        _data is a string containing the raw application data.

        _subtype is the MIME content type subtype, defaulting to
        'octet-stream'.

        _encoder is a function which will perform the actual encoding for
        transport of the application data, defaulting to base64 encoding.

        Any additional keyword arguments are passed to the base class
        constructor, which turns them into parameters on the Content-Type
        header.
        Nz Invalid application MIME subtypeZapplicationr)�	TypeErrorr�__init__Zset_payload)�self�_dataZ_subtypeZ_encoderrZ_params�r
�./usr/lib64/python3.8/email/mime/application.pyrs�
zMIMEApplication.__init__)�__name__�
__module__�__qualname__�__doc__rZ
encode_base64rr
r
r
rr
s��N)r�__all__ZemailrZemail.mime.nonmultipartrrr
r
r
r�<module>semail/mime/__pycache__/text.cpython-38.opt-2.pyc000064400000001442151153537640015361 0ustar00U

e5d��@s2dgZddlmZddlmZGdd�de�ZdS)�MIMEText�)�Charset)�MIMENonMultipartc@seZdZddd�dd�ZdS)r�plainN)�policycCsf|dkr4z|�d�d}Wntk
r2d}YnXtj|d|fd|idt|�i��|�||�dS)Nzus-asciizutf-8�textr�charset)�encode�UnicodeEncodeErrorr�__init__�strZset_payload)�selfZ_textZ_subtypeZ_charsetr�r�'/usr/lib64/python3.8/email/mime/text.pyrs


�zMIMEText.__init__)rN)�__name__�
__module__�__qualname__rrrrrrsN)�__all__Z
email.charsetrZemail.mime.nonmultipartrrrrrr�<module>semail/mime/__pycache__/base.cpython-38.opt-1.pyc000064400000002023151153537640015302 0ustar00U

e5d��@s4dZdgZddlZddlmZGdd�dej�ZdS)�$Base class for MIME specializations.�MIMEBase�N)�messagec@seZdZdZdd�dd�ZdS)rrN��policycKsH|dkrtjj}tjj||d�d||f}|jd|f|�d|d<dS)z�This constructor adds a Content-Type: and a MIME-Version: header.

        The Content-Type: header is taken from the _maintype and _subtype
        arguments.  Additional parameters for this header are taken from the
        keyword arguments.
        Nrz%s/%szContent-Typez1.0zMIME-Version)�emailrZcompat32r�Message�__init__Z
add_header)�selfZ	_maintypeZ_subtyperZ_paramsZctype�r�'/usr/lib64/python3.8/email/mime/base.pyr	szMIMEBase.__init__)�__name__�
__module__�__qualname__�__doc__r	rrrrrs)r�__all__Zemail.policyrrrrrrrr�<module>semail/mime/__pycache__/message.cpython-38.pyc000064400000002404151153537640015060 0ustar00U

e5d%�@s6dZdgZddlmZddlmZGdd�de�ZdS)�,Class representing message/* MIME documents.�MIMEMessage�)�message)�MIMENonMultipartc@s eZdZdZddd�dd�ZdS)rr�rfc822N��policycCsBtj|d||d�t|tj�s&td��tj�||�|�d�dS)a�Create a message/* type MIME document.

        _msg is a message object and must be an instance of Message, or a
        derived class of Message, otherwise a TypeError is raised.

        Optional _subtype defines the subtype of the contained message.  The
        default is "rfc822" (this is defined by the MIME standard, even though
        the term "rfc822" is technically outdated by RFC 2822).
        rrz&Argument is not an instance of Messagezmessage/rfc822N)r�__init__�
isinstancerZMessage�	TypeErrorZattachZset_default_type)�selfZ_msgZ_subtyper�r
�*/usr/lib64/python3.8/email/mime/message.pyr	s

zMIMEMessage.__init__)r)�__name__�
__module__�__qualname__�__doc__r	r
r
r
rrsN)r�__all__ZemailrZemail.mime.nonmultipartrrr
r
r
r�<module>semail/mime/__pycache__/audio.cpython-38.pyc000064400000005102151153537640014533 0ustar00U

e5d�
�@s`dZdgZddlZddlmZddlmZddlmZddd	d	d
�Z	dd�Z
Gd
d�de�ZdS)z/Class representing audio/* type MIME documents.�	MIMEAudio�N)�BytesIO)�encoders)�MIMENonMultipartZbasiczx-wavzx-aiff)ZauZwavZaiffZaifccCsH|dd�}t|�}tjD](}|||�}|dk	rt�|d�SqdS)aTry to identify a sound file type.

    sndhdr.what() has a pretty cruddy interface, unfortunately.  This is why
    we re-do it here.  It would be easier to reverse engineer the Unix 'file'
    command and use the standard 'magic' file, as shipped with a modern Unix.
    Nir)r�sndhdrZtests�_sndhdr_MIMEmap�get)�dataZhdrZfakefileZtestfn�res�r�(/usr/lib64/python3.8/email/mime/audio.py�_whatsnds

r
c@s&eZdZdZdejfdd�dd�ZdS)rz,Class for generating audio/* MIME documents.N)�policycKsP|dkrt|�}|dkr td��tj|d|fd|i|��|�|�||�dS)aCreate an audio/* type MIME document.

        _audiodata is a string containing the raw audio data.  If this data
        can be decoded by the standard Python `sndhdr' module, then the
        subtype will be automatically included in the Content-Type header.
        Otherwise, you can specify  the specific audio subtype via the
        _subtype parameter.  If _subtype is not given, and no subtype can be
        guessed, a TypeError is raised.

        _encoder is a function which will perform the actual encoding for
        transport of the image data.  It takes one argument, which is this
        Image instance.  It should use get_payload() and set_payload() to
        change the payload to the encoded form.  It should also add any
        Content-Transfer-Encoding or other headers to the message as
        necessary.  The default encoding is Base64.

        Any additional keyword arguments are passed to the base class
        constructor, which turns them into parameters on the Content-Type
        header.
        Nz!Could not find audio MIME subtypeZaudior)r
�	TypeErrorr�__init__Zset_payload)�selfZ
_audiodataZ_subtypeZ_encoderrZ_paramsrrrr-s�
zMIMEAudio.__init__)�__name__�
__module__�__qualname__�__doc__rZ
encode_base64rrrrrr*s��)r�__all__r�iorZemailrZemail.mime.nonmultipartrrr
rrrrr�<module>s�email/mime/__pycache__/image.cpython-38.pyc000064400000003562151153537640014524 0ustar00U

e5d%�@s>dZdgZddlZddlmZddlmZGdd�de�ZdS)z/Class representing image/* type MIME documents.�	MIMEImage�N)�encoders)�MIMENonMultipartc@s&eZdZdZdejfdd�dd�ZdS)rz1Class for generating image/* type MIME documents.N)�policycKsT|dkrt�d|�}|dkr$td��tj|d|fd|i|��|�|�||�dS)a�Create an image/* type MIME document.

        _imagedata is a string containing the raw image data.  If this data
        can be decoded by the standard Python `imghdr' module, then the
        subtype will be automatically included in the Content-Type header.
        Otherwise, you can specify the specific image subtype via the _subtype
        parameter.

        _encoder is a function which will perform the actual encoding for
        transport of the image data.  It takes one argument, which is this
        Image instance.  It should use get_payload() and set_payload() to
        change the payload to the encoded form.  It should also add any
        Content-Transfer-Encoding or other headers to the message as
        necessary.  The default encoding is Base64.

        Any additional keyword arguments are passed to the base class
        constructor, which turns them into parameters on the Content-Type
        header.
        Nz"Could not guess image MIME subtypeZimager)�imghdrZwhat�	TypeErrorr�__init__Zset_payload)�selfZ
_imagedataZ_subtypeZ_encoderrZ_params�r
�(/usr/lib64/python3.8/email/mime/image.pyrs�
zMIMEImage.__init__)�__name__�
__module__�__qualname__�__doc__rZ
encode_base64rr
r
r
rrs��)r�__all__rZemailrZemail.mime.nonmultipartrrr
r
r
r�<module>s
email/mime/__pycache__/text.cpython-38.opt-1.pyc000064400000002441151153537640015360 0ustar00U

e5d��@s6dZdgZddlmZddlmZGdd�de�ZdS)z.Class representing text/* type MIME documents.�MIMEText�)�Charset)�MIMENonMultipartc@s eZdZdZddd�dd�ZdS)rz0Class for generating text/* type MIME documents.�plainN)�policycCsf|dkr4z|�d�d}Wntk
r2d}YnXtj|d|fd|idt|�i��|�||�dS)a~Create a text/* type MIME document.

        _text is the string for this message object.

        _subtype is the MIME sub content type, defaulting to "plain".

        _charset is the character set parameter added to the Content-Type
        header.  This defaults to "us-ascii".  Note that as a side-effect, the
        Content-Transfer-Encoding header will also be set.
        Nzus-asciizutf-8�textr�charset)�encode�UnicodeEncodeErrorr�__init__�strZset_payload)�selfZ_textZ_subtypeZ_charsetr�r�'/usr/lib64/python3.8/email/mime/text.pyrs


�zMIMEText.__init__)rN)�__name__�
__module__�__qualname__�__doc__rrrrrrsN)r�__all__Z
email.charsetrZemail.mime.nonmultipartrrrrrr�<module>semail/mime/__pycache__/multipart.cpython-38.opt-1.pyc000064400000002740151153537640016417 0ustar00U

e5dU�@s*dZdgZddlmZGdd�de�ZdS)�.Base class for MIME multipart/* type messages.�
MIMEMultipart�)�MIMEBasec@s eZdZdZddd�dd�ZdS)rr�mixedN)�policycKsJtj|d|fd|i|��g|_|r8|D]}|�|�q(|rF|�|�dS)a�Creates a multipart/* type message.

        By default, creates a multipart/mixed message, with proper
        Content-Type and MIME-Version headers.

        _subtype is the subtype of the multipart content type, defaulting to
        `mixed'.

        boundary is the multipart boundary string.  By default it is
        calculated as needed.

        _subparts is a sequence of initial subparts for the payload.  It
        must be an iterable object, such as a list.  You can always
        attach new subparts to the message by using the attach() method.

        Additional parameters for the Content-Type header are taken from the
        keyword arguments (or passed into the _params argument).
        Z	multipartrN)r�__init__Z_payloadZattachZset_boundary)�selfZ_subtype�boundaryZ	_subpartsrZ_params�p�r�,/usr/lib64/python3.8/email/mime/multipart.pyrszMIMEMultipart.__init__)rNN)�__name__�
__module__�__qualname__�__doc__rrrrrr
s�N)r�__all__Zemail.mime.baserrrrrr�<module>semail/mime/__pycache__/__init__.cpython-38.opt-2.pyc000064400000000206151153537640016131 0ustar00U

��.e�@sdS)N�rrr�+/usr/lib64/python3.8/email/mime/__init__.py�<module>�email/mime/__pycache__/nonmultipart.cpython-38.opt-2.pyc000064400000001167151153537640017135 0ustar00U

e5d��@s2dgZddlmZddlmZGdd�de�ZdS)�MIMENonMultipart�)�errors)�MIMEBasec@seZdZdd�ZdS)rcCst�d��dS)Nz4Cannot attach additional subparts to non-multipart/*)rZMultipartConversionError)�selfZpayload�r�//usr/lib64/python3.8/email/mime/nonmultipart.py�attachs�zMIMENonMultipart.attachN)�__name__�
__module__�__qualname__rrrrrrsN)�__all__ZemailrZemail.mime.baserrrrrr�<module>semail/mime/__pycache__/application.cpython-38.opt-1.pyc000064400000002665151153537640016707 0ustar00U

e5d)�@s6dZdgZddlmZddlmZGdd�de�ZdS)z5Class representing application/* type MIME documents.�MIMEApplication�)�encoders)�MIMENonMultipartc@s&eZdZdZdejfdd�dd�ZdS)rz2Class for generating application/* MIME documents.zoctet-streamN)�policycKs@|dkrtd��tj|d|fd|i|��|�|�||�dS)aCreate an application/* type MIME document.

        _data is a string containing the raw application data.

        _subtype is the MIME content type subtype, defaulting to
        'octet-stream'.

        _encoder is a function which will perform the actual encoding for
        transport of the application data, defaulting to base64 encoding.

        Any additional keyword arguments are passed to the base class
        constructor, which turns them into parameters on the Content-Type
        header.
        Nz Invalid application MIME subtypeZapplicationr)�	TypeErrorr�__init__Zset_payload)�self�_dataZ_subtypeZ_encoderrZ_params�r
�./usr/lib64/python3.8/email/mime/application.pyrs�
zMIMEApplication.__init__)�__name__�
__module__�__qualname__�__doc__rZ
encode_base64rr
r
r
rr
s��N)r�__all__ZemailrZemail.mime.nonmultipartrrr
r
r
r�<module>semail/mime/__pycache__/nonmultipart.cpython-38.pyc000064400000001376151153537640016177 0ustar00U

e5d��@s6dZdgZddlmZddlmZGdd�de�ZdS)z9Base class for MIME type messages that are not multipart.�MIMENonMultipart�)�errors)�MIMEBasec@seZdZdZdd�ZdS)rz0Base class for MIME non-multipart type messages.cCst�d��dS)Nz4Cannot attach additional subparts to non-multipart/*)rZMultipartConversionError)�selfZpayload�r�//usr/lib64/python3.8/email/mime/nonmultipart.py�attachs�zMIMENonMultipart.attachN)�__name__�
__module__�__qualname__�__doc__rrrrrrsN)r�__all__ZemailrZemail.mime.baserrrrrr�<module>semail/mime/__pycache__/application.cpython-38.opt-2.pyc000064400000001447151153537640016705 0ustar00U

e5d)�@s2dgZddlmZddlmZGdd�de�ZdS)�MIMEApplication�)�encoders)�MIMENonMultipartc@s"eZdZdejfdd�dd�ZdS)rzoctet-streamN)�policycKs@|dkrtd��tj|d|fd|i|��|�|�||�dS)Nz Invalid application MIME subtypeZapplicationr)�	TypeErrorr�__init__Zset_payload)�self�_dataZ_subtypeZ_encoderrZ_params�r
�./usr/lib64/python3.8/email/mime/application.pyrs�
zMIMEApplication.__init__)�__name__�
__module__�__qualname__rZ
encode_base64rr
r
r
rr
s
��N)�__all__ZemailrZemail.mime.nonmultipartrrr
r
r
r�<module>semail/mime/__pycache__/base.cpython-38.opt-2.pyc000064400000001317151153537640015310 0ustar00U

e5d��@s0dgZddlZddlmZGdd�dej�ZdS)�MIMEBase�N)�messagec@seZdZdd�dd�ZdS)rN��policycKsH|dkrtjj}tjj||d�d||f}|jd|f|�d|d<dS)Nrz%s/%szContent-Typez1.0zMIME-Version)�emailrZcompat32r�Message�__init__Z
add_header)�selfZ	_maintypeZ_subtyperZ_paramsZctype�r
�'/usr/lib64/python3.8/email/mime/base.pyrszMIMEBase.__init__)�__name__�
__module__�__qualname__rr
r
r
rrs)�__all__Zemail.policyrrrrr
r
r
r�<module>semail/mime/__pycache__/__init__.cpython-38.pyc000064400000000206151153537640015171 0ustar00U

��.e�@sdS)N�rrr�+/usr/lib64/python3.8/email/mime/__init__.py�<module>�email/mime/__pycache__/nonmultipart.cpython-38.opt-1.pyc000064400000001376151153537640017136 0ustar00U

e5d��@s6dZdgZddlmZddlmZGdd�de�ZdS)z9Base class for MIME type messages that are not multipart.�MIMENonMultipart�)�errors)�MIMEBasec@seZdZdZdd�ZdS)rz0Base class for MIME non-multipart type messages.cCst�d��dS)Nz4Cannot attach additional subparts to non-multipart/*)rZMultipartConversionError)�selfZpayload�r�//usr/lib64/python3.8/email/mime/nonmultipart.py�attachs�zMIMENonMultipart.attachN)�__name__�
__module__�__qualname__�__doc__rrrrrrsN)r�__all__ZemailrZemail.mime.baserrrrrr�<module>semail/mime/nonmultipart.py000064400000001263151153537640011704 0ustar00# Copyright (C) 2002-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org

"""Base class for MIME type messages that are not multipart."""

__all__ = ['MIMENonMultipart']

from email import errors
from email.mime.base import MIMEBase



class MIMENonMultipart(MIMEBase):
    """Base class for MIME non-multipart type messages."""

    def attach(self, payload):
        # The public API prohibits attaching multiple subparts to MIMEBase
        # derived subtypes since none of them are, by definition, of content
        # type multipart/*
        raise errors.MultipartConversionError(
            'Cannot attach additional subparts to non-multipart/*')
email/mime/application.py000064400000002451151153537640011453 0ustar00# Copyright (C) 2001-2006 Python Software Foundation
# Author: Keith Dart
# Contact: email-sig@python.org

"""Class representing application/* type MIME documents."""

__all__ = ["MIMEApplication"]

from email import encoders
from email.mime.nonmultipart import MIMENonMultipart


class MIMEApplication(MIMENonMultipart):
    """Class for generating application/* MIME documents."""

    def __init__(self, _data, _subtype='octet-stream',
                 _encoder=encoders.encode_base64, *, policy=None, **_params):
        """Create an application/* type MIME document.

        _data is a string containing the raw application data.

        _subtype is the MIME content type subtype, defaulting to
        'octet-stream'.

        _encoder is a function which will perform the actual encoding for
        transport of the application data, defaulting to base64 encoding.

        Any additional keyword arguments are passed to the base class
        constructor, which turns them into parameters on the Content-Type
        header.
        """
        if _subtype is None:
            raise TypeError('Invalid application MIME subtype')
        MIMENonMultipart.__init__(self, 'application', _subtype, policy=policy,
                                  **_params)
        self.set_payload(_data)
        _encoder(self)
email/mime/image.py000064400000003445151153537640010236 0ustar00# Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org

"""Class representing image/* type MIME documents."""

__all__ = ['MIMEImage']

import imghdr

from email import encoders
from email.mime.nonmultipart import MIMENonMultipart



class MIMEImage(MIMENonMultipart):
    """Class for generating image/* type MIME documents."""

    def __init__(self, _imagedata, _subtype=None,
                 _encoder=encoders.encode_base64, *, policy=None, **_params):
        """Create an image/* type MIME document.

        _imagedata is a string containing the raw image data.  If this data
        can be decoded by the standard Python `imghdr' module, then the
        subtype will be automatically included in the Content-Type header.
        Otherwise, you can specify the specific image subtype via the _subtype
        parameter.

        _encoder is a function which will perform the actual encoding for
        transport of the image data.  It takes one argument, which is this
        Image instance.  It should use get_payload() and set_payload() to
        change the payload to the encoded form.  It should also add any
        Content-Transfer-Encoding or other headers to the message as
        necessary.  The default encoding is Base64.

        Any additional keyword arguments are passed to the base class
        constructor, which turns them into parameters on the Content-Type
        header.
        """
        if _subtype is None:
            _subtype = imghdr.what(None, _imagedata)
        if _subtype is None:
            raise TypeError('Could not guess image MIME subtype')
        MIMENonMultipart.__init__(self, 'image', _subtype, policy=policy,
                                  **_params)
        self.set_payload(_imagedata)
        _encoder(self)
email/mime/base.py000064400000001624151153537640010063 0ustar00# Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org

"""Base class for MIME specializations."""

__all__ = ['MIMEBase']

import email.policy

from email import message



class MIMEBase(message.Message):
    """Base class for MIME specializations."""

    def __init__(self, _maintype, _subtype, *, policy=None, **_params):
        """This constructor adds a Content-Type: and a MIME-Version: header.

        The Content-Type: header is taken from the _maintype and _subtype
        arguments.  Additional parameters for this header are taken from the
        keyword arguments.
        """
        if policy is None:
            policy = email.policy.compat32
        message.Message.__init__(self, policy=policy)
        ctype = '%s/%s' % (_maintype, _subtype)
        self.add_header('Content-Type', ctype, **_params)
        self['MIME-Version'] = '1.0'
email/utils.py000064400000032253151153537640007364 0ustar00# Copyright (C) 2001-2010 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org

"""Miscellaneous utilities."""

__all__ = [
    'collapse_rfc2231_value',
    'decode_params',
    'decode_rfc2231',
    'encode_rfc2231',
    'formataddr',
    'formatdate',
    'format_datetime',
    'getaddresses',
    'make_msgid',
    'mktime_tz',
    'parseaddr',
    'parsedate',
    'parsedate_tz',
    'parsedate_to_datetime',
    'unquote',
    ]

import os
import re
import time
import random
import socket
import datetime
import urllib.parse

from email._parseaddr import quote
from email._parseaddr import AddressList as _AddressList
from email._parseaddr import mktime_tz

from email._parseaddr import parsedate, parsedate_tz, _parsedate_tz

# Intrapackage imports
from email.charset import Charset

COMMASPACE = ', '
EMPTYSTRING = ''
UEMPTYSTRING = ''
CRLF = '\r\n'
TICK = "'"

specialsre = re.compile(r'[][\\()<>@,:;".]')
escapesre = re.compile(r'[\\"]')

def _has_surrogates(s):
    """Return True if s contains surrogate-escaped binary data."""
    # This check is based on the fact that unless there are surrogates, utf8
    # (Python's default encoding) can encode any string.  This is the fastest
    # way to check for surrogates, see issue 11454 for timings.
    try:
        s.encode()
        return False
    except UnicodeEncodeError:
        return True

# How to deal with a string containing bytes before handing it to the
# application through the 'normal' interface.
def _sanitize(string):
    # Turn any escaped bytes into unicode 'unknown' char.  If the escaped
    # bytes happen to be utf-8 they will instead get decoded, even if they
    # were invalid in the charset the source was supposed to be in.  This
    # seems like it is not a bad thing; a defect was still registered.
    original_bytes = string.encode('utf-8', 'surrogateescape')
    return original_bytes.decode('utf-8', 'replace')



# Helpers

def formataddr(pair, charset='utf-8'):
    """The inverse of parseaddr(), this takes a 2-tuple of the form
    (realname, email_address) and returns the string value suitable
    for an RFC 2822 From, To or Cc header.

    If the first element of pair is false, then the second element is
    returned unmodified.

    The optional charset is the character set that is used to encode
    realname in case realname is not ASCII safe.  Can be an instance of str or
    a Charset-like object which has a header_encode method.  Default is
    'utf-8'.
    """
    name, address = pair
    # The address MUST (per RFC) be ascii, so raise a UnicodeError if it isn't.
    address.encode('ascii')
    if name:
        try:
            name.encode('ascii')
        except UnicodeEncodeError:
            if isinstance(charset, str):
                charset = Charset(charset)
            encoded_name = charset.header_encode(name)
            return "%s <%s>" % (encoded_name, address)
        else:
            quotes = ''
            if specialsre.search(name):
                quotes = '"'
            name = escapesre.sub(r'\\\g<0>', name)
            return '%s%s%s <%s>' % (quotes, name, quotes, address)
    return address



def getaddresses(fieldvalues):
    """Return a list of (REALNAME, EMAIL) for each fieldvalue."""
    all = COMMASPACE.join(fieldvalues)
    a = _AddressList(all)
    return a.addresslist


def _format_timetuple_and_zone(timetuple, zone):
    return '%s, %02d %s %04d %02d:%02d:%02d %s' % (
        ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'][timetuple[6]],
        timetuple[2],
        ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
         'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'][timetuple[1] - 1],
        timetuple[0], timetuple[3], timetuple[4], timetuple[5],
        zone)

def formatdate(timeval=None, localtime=False, usegmt=False):
    """Returns a date string as specified by RFC 2822, e.g.:

    Fri, 09 Nov 2001 01:08:47 -0000

    Optional timeval if given is a floating point time value as accepted by
    gmtime() and localtime(), otherwise the current time is used.

    Optional localtime is a flag that when True, interprets timeval, and
    returns a date relative to the local timezone instead of UTC, properly
    taking daylight savings time into account.

    Optional argument usegmt means that the timezone is written out as
    an ascii string, not numeric one (so "GMT" instead of "+0000"). This
    is needed for HTTP, and is only used when localtime==False.
    """
    # Note: we cannot use strftime() because that honors the locale and RFC
    # 2822 requires that day and month names be the English abbreviations.
    if timeval is None:
        timeval = time.time()
    if localtime or usegmt:
        dt = datetime.datetime.fromtimestamp(timeval, datetime.timezone.utc)
    else:
        dt = datetime.datetime.utcfromtimestamp(timeval)
    if localtime:
        dt = dt.astimezone()
        usegmt = False
    return format_datetime(dt, usegmt)

def format_datetime(dt, usegmt=False):
    """Turn a datetime into a date string as specified in RFC 2822.

    If usegmt is True, dt must be an aware datetime with an offset of zero.  In
    this case 'GMT' will be rendered instead of the normal +0000 required by
    RFC2822.  This is to support HTTP headers involving date stamps.
    """
    now = dt.timetuple()
    if usegmt:
        if dt.tzinfo is None or dt.tzinfo != datetime.timezone.utc:
            raise ValueError("usegmt option requires a UTC datetime")
        zone = 'GMT'
    elif dt.tzinfo is None:
        zone = '-0000'
    else:
        zone = dt.strftime("%z")
    return _format_timetuple_and_zone(now, zone)


def make_msgid(idstring=None, domain=None):
    """Returns a string suitable for RFC 2822 compliant Message-ID, e.g:

    <142480216486.20800.16526388040877946887@nightshade.la.mastaler.com>

    Optional idstring if given is a string used to strengthen the
    uniqueness of the message id.  Optional domain if given provides the
    portion of the message id after the '@'.  It defaults to the locally
    defined hostname.
    """
    timeval = int(time.time()*100)
    pid = os.getpid()
    randint = random.getrandbits(64)
    if idstring is None:
        idstring = ''
    else:
        idstring = '.' + idstring
    if domain is None:
        domain = socket.getfqdn()
    msgid = '<%d.%d.%d%s@%s>' % (timeval, pid, randint, idstring, domain)
    return msgid


def parsedate_to_datetime(data):
    *dtuple, tz = _parsedate_tz(data)
    if tz is None:
        return datetime.datetime(*dtuple[:6])
    return datetime.datetime(*dtuple[:6],
            tzinfo=datetime.timezone(datetime.timedelta(seconds=tz)))


def parseaddr(addr):
    """
    Parse addr into its constituent realname and email address parts.

    Return a tuple of realname and email address, unless the parse fails, in
    which case return a 2-tuple of ('', '').
    """
    addrs = _AddressList(addr).addresslist
    if not addrs:
        return '', ''
    return addrs[0]


# rfc822.unquote() doesn't properly de-backslash-ify in Python pre-2.3.
def unquote(str):
    """Remove quotes from a string."""
    if len(str) > 1:
        if str.startswith('"') and str.endswith('"'):
            return str[1:-1].replace('\\\\', '\\').replace('\\"', '"')
        if str.startswith('<') and str.endswith('>'):
            return str[1:-1]
    return str



# RFC2231-related functions - parameter encoding and decoding
def decode_rfc2231(s):
    """Decode string according to RFC 2231"""
    parts = s.split(TICK, 2)
    if len(parts) <= 2:
        return None, None, s
    return parts


def encode_rfc2231(s, charset=None, language=None):
    """Encode string according to RFC 2231.

    If neither charset nor language is given, then s is returned as-is.  If
    charset is given but not language, the string is encoded using the empty
    string for language.
    """
    s = urllib.parse.quote(s, safe='', encoding=charset or 'ascii')
    if charset is None and language is None:
        return s
    if language is None:
        language = ''
    return "%s'%s'%s" % (charset, language, s)


rfc2231_continuation = re.compile(r'^(?P<name>\w+)\*((?P<num>[0-9]+)\*?)?$',
    re.ASCII)

def decode_params(params):
    """Decode parameters list according to RFC 2231.

    params is a sequence of 2-tuples containing (param name, string value).
    """
    # Copy params so we don't mess with the original
    params = params[:]
    new_params = []
    # Map parameter's name to a list of continuations.  The values are a
    # 3-tuple of the continuation number, the string value, and a flag
    # specifying whether a particular segment is %-encoded.
    rfc2231_params = {}
    name, value = params.pop(0)
    new_params.append((name, value))
    while params:
        name, value = params.pop(0)
        if name.endswith('*'):
            encoded = True
        else:
            encoded = False
        value = unquote(value)
        mo = rfc2231_continuation.match(name)
        if mo:
            name, num = mo.group('name', 'num')
            if num is not None:
                num = int(num)
            rfc2231_params.setdefault(name, []).append((num, value, encoded))
        else:
            new_params.append((name, '"%s"' % quote(value)))
    if rfc2231_params:
        for name, continuations in rfc2231_params.items():
            value = []
            extended = False
            # Sort by number
            continuations.sort()
            # And now append all values in numerical order, converting
            # %-encodings for the encoded segments.  If any of the
            # continuation names ends in a *, then the entire string, after
            # decoding segments and concatenating, must have the charset and
            # language specifiers at the beginning of the string.
            for num, s, encoded in continuations:
                if encoded:
                    # Decode as "latin-1", so the characters in s directly
                    # represent the percent-encoded octet values.
                    # collapse_rfc2231_value treats this as an octet sequence.
                    s = urllib.parse.unquote(s, encoding="latin-1")
                    extended = True
                value.append(s)
            value = quote(EMPTYSTRING.join(value))
            if extended:
                charset, language, value = decode_rfc2231(value)
                new_params.append((name, (charset, language, '"%s"' % value)))
            else:
                new_params.append((name, '"%s"' % value))
    return new_params

def collapse_rfc2231_value(value, errors='replace',
                           fallback_charset='us-ascii'):
    if not isinstance(value, tuple) or len(value) != 3:
        return unquote(value)
    # While value comes to us as a unicode string, we need it to be a bytes
    # object.  We do not want bytes() normal utf-8 decoder, we want a straight
    # interpretation of the string as character bytes.
    charset, language, text = value
    if charset is None:
        # Issue 17369: if charset/lang is None, decode_rfc2231 couldn't parse
        # the value, so use the fallback_charset.
        charset = fallback_charset
    rawbytes = bytes(text, 'raw-unicode-escape')
    try:
        return str(rawbytes, charset, errors)
    except LookupError:
        # charset is not a known codec.
        return unquote(text)


#
# datetime doesn't provide a localtime function yet, so provide one.  Code
# adapted from the patch in issue 9527.  This may not be perfect, but it is
# better than not having it.
#

def localtime(dt=None, isdst=-1):
    """Return local time as an aware datetime object.

    If called without arguments, return current time.  Otherwise *dt*
    argument should be a datetime instance, and it is converted to the
    local time zone according to the system time zone database.  If *dt* is
    naive (that is, dt.tzinfo is None), it is assumed to be in local time.
    In this case, a positive or zero value for *isdst* causes localtime to
    presume initially that summer time (for example, Daylight Saving Time)
    is or is not (respectively) in effect for the specified time.  A
    negative value for *isdst* causes the localtime() function to attempt
    to divine whether summer time is in effect for the specified time.

    """
    if dt is None:
        return datetime.datetime.now(datetime.timezone.utc).astimezone()
    if dt.tzinfo is not None:
        return dt.astimezone()
    # We have a naive datetime.  Convert to a (localtime) timetuple and pass to
    # system mktime together with the isdst hint.  System mktime will return
    # seconds since epoch.
    tm = dt.timetuple()[:-1] + (isdst,)
    seconds = time.mktime(tm)
    localtm = time.localtime(seconds)
    try:
        delta = datetime.timedelta(seconds=localtm.tm_gmtoff)
        tz = datetime.timezone(delta, localtm.tm_zone)
    except AttributeError:
        # Compute UTC offset and compare with the value implied by tm_isdst.
        # If the values match, use the zone name implied by tm_isdst.
        delta = dt - datetime.datetime(*time.gmtime(seconds)[:6])
        dst = time.daylight and localtm.tm_isdst > 0
        gmtoff = -(time.altzone if dst else time.timezone)
        if delta == datetime.timedelta(seconds=gmtoff):
            tz = datetime.timezone(delta, time.tzname[dst])
        else:
            tz = datetime.timezone(delta)
    return dt.replace(tzinfo=tz)
email/header.py000064400000057046151153537640007463 0ustar00# Copyright (C) 2002-2007 Python Software Foundation
# Author: Ben Gertzfield, Barry Warsaw
# Contact: email-sig@python.org

"""Header encoding and decoding functionality."""

__all__ = [
    'Header',
    'decode_header',
    'make_header',
    ]

import re
import binascii

import email.quoprimime
import email.base64mime

from email.errors import HeaderParseError
from email import charset as _charset
Charset = _charset.Charset

NL = '\n'
SPACE = ' '
BSPACE = b' '
SPACE8 = ' ' * 8
EMPTYSTRING = ''
MAXLINELEN = 78
FWS = ' \t'

USASCII = Charset('us-ascii')
UTF8 = Charset('utf-8')

# Match encoded-word strings in the form =?charset?q?Hello_World?=
ecre = re.compile(r'''
  =\?                   # literal =?
  (?P<charset>[^?]*?)   # non-greedy up to the next ? is the charset
  \?                    # literal ?
  (?P<encoding>[qQbB])  # either a "q" or a "b", case insensitive
  \?                    # literal ?
  (?P<encoded>.*?)      # non-greedy up to the next ?= is the encoded string
  \?=                   # literal ?=
  ''', re.VERBOSE | re.MULTILINE)

# Field name regexp, including trailing colon, but not separating whitespace,
# according to RFC 2822.  Character range is from tilde to exclamation mark.
# For use with .match()
fcre = re.compile(r'[\041-\176]+:$')

# Find a header embedded in a putative header value.  Used to check for
# header injection attack.
_embedded_header = re.compile(r'\n[^ \t]+:')



# Helpers
_max_append = email.quoprimime._max_append



def decode_header(header):
    """Decode a message header value without converting charset.

    Returns a list of (string, charset) pairs containing each of the decoded
    parts of the header.  Charset is None for non-encoded parts of the header,
    otherwise a lower-case string containing the name of the character set
    specified in the encoded string.

    header may be a string that may or may not contain RFC2047 encoded words,
    or it may be a Header object.

    An email.errors.HeaderParseError may be raised when certain decoding error
    occurs (e.g. a base64 decoding exception).
    """
    # If it is a Header object, we can just return the encoded chunks.
    if hasattr(header, '_chunks'):
        return [(_charset._encode(string, str(charset)), str(charset))
                    for string, charset in header._chunks]
    # If no encoding, just return the header with no charset.
    if not ecre.search(header):
        return [(header, None)]
    # First step is to parse all the encoded parts into triplets of the form
    # (encoded_string, encoding, charset).  For unencoded strings, the last
    # two parts will be None.
    words = []
    for line in header.splitlines():
        parts = ecre.split(line)
        first = True
        while parts:
            unencoded = parts.pop(0)
            if first:
                unencoded = unencoded.lstrip()
                first = False
            if unencoded:
                words.append((unencoded, None, None))
            if parts:
                charset = parts.pop(0).lower()
                encoding = parts.pop(0).lower()
                encoded = parts.pop(0)
                words.append((encoded, encoding, charset))
    # Now loop over words and remove words that consist of whitespace
    # between two encoded strings.
    droplist = []
    for n, w in enumerate(words):
        if n>1 and w[1] and words[n-2][1] and words[n-1][0].isspace():
            droplist.append(n-1)
    for d in reversed(droplist):
        del words[d]

    # The next step is to decode each encoded word by applying the reverse
    # base64 or quopri transformation.  decoded_words is now a list of the
    # form (decoded_word, charset).
    decoded_words = []
    for encoded_string, encoding, charset in words:
        if encoding is None:
            # This is an unencoded word.
            decoded_words.append((encoded_string, charset))
        elif encoding == 'q':
            word = email.quoprimime.header_decode(encoded_string)
            decoded_words.append((word, charset))
        elif encoding == 'b':
            paderr = len(encoded_string) % 4   # Postel's law: add missing padding
            if paderr:
                encoded_string += '==='[:4 - paderr]
            try:
                word = email.base64mime.decode(encoded_string)
            except binascii.Error:
                raise HeaderParseError('Base64 decoding error')
            else:
                decoded_words.append((word, charset))
        else:
            raise AssertionError('Unexpected encoding: ' + encoding)
    # Now convert all words to bytes and collapse consecutive runs of
    # similarly encoded words.
    collapsed = []
    last_word = last_charset = None
    for word, charset in decoded_words:
        if isinstance(word, str):
            word = bytes(word, 'raw-unicode-escape')
        if last_word is None:
            last_word = word
            last_charset = charset
        elif charset != last_charset:
            collapsed.append((last_word, last_charset))
            last_word = word
            last_charset = charset
        elif last_charset is None:
            last_word += BSPACE + word
        else:
            last_word += word
    collapsed.append((last_word, last_charset))
    return collapsed



def make_header(decoded_seq, maxlinelen=None, header_name=None,
                continuation_ws=' '):
    """Create a Header from a sequence of pairs as returned by decode_header()

    decode_header() takes a header value string and returns a sequence of
    pairs of the format (decoded_string, charset) where charset is the string
    name of the character set.

    This function takes one of those sequence of pairs and returns a Header
    instance.  Optional maxlinelen, header_name, and continuation_ws are as in
    the Header constructor.
    """
    h = Header(maxlinelen=maxlinelen, header_name=header_name,
               continuation_ws=continuation_ws)
    for s, charset in decoded_seq:
        # None means us-ascii but we can simply pass it on to h.append()
        if charset is not None and not isinstance(charset, Charset):
            charset = Charset(charset)
        h.append(s, charset)
    return h



class Header:
    def __init__(self, s=None, charset=None,
                 maxlinelen=None, header_name=None,
                 continuation_ws=' ', errors='strict'):
        """Create a MIME-compliant header that can contain many character sets.

        Optional s is the initial header value.  If None, the initial header
        value is not set.  You can later append to the header with .append()
        method calls.  s may be a byte string or a Unicode string, but see the
        .append() documentation for semantics.

        Optional charset serves two purposes: it has the same meaning as the
        charset argument to the .append() method.  It also sets the default
        character set for all subsequent .append() calls that omit the charset
        argument.  If charset is not provided in the constructor, the us-ascii
        charset is used both as s's initial charset and as the default for
        subsequent .append() calls.

        The maximum line length can be specified explicitly via maxlinelen. For
        splitting the first line to a shorter value (to account for the field
        header which isn't included in s, e.g. `Subject') pass in the name of
        the field in header_name.  The default maxlinelen is 78 as recommended
        by RFC 2822.

        continuation_ws must be RFC 2822 compliant folding whitespace (usually
        either a space or a hard tab) which will be prepended to continuation
        lines.

        errors is passed through to the .append() call.
        """
        if charset is None:
            charset = USASCII
        elif not isinstance(charset, Charset):
            charset = Charset(charset)
        self._charset = charset
        self._continuation_ws = continuation_ws
        self._chunks = []
        if s is not None:
            self.append(s, charset, errors)
        if maxlinelen is None:
            maxlinelen = MAXLINELEN
        self._maxlinelen = maxlinelen
        if header_name is None:
            self._headerlen = 0
        else:
            # Take the separating colon and space into account.
            self._headerlen = len(header_name) + 2

    def __str__(self):
        """Return the string value of the header."""
        self._normalize()
        uchunks = []
        lastcs = None
        lastspace = None
        for string, charset in self._chunks:
            # We must preserve spaces between encoded and non-encoded word
            # boundaries, which means for us we need to add a space when we go
            # from a charset to None/us-ascii, or from None/us-ascii to a
            # charset.  Only do this for the second and subsequent chunks.
            # Don't add a space if the None/us-ascii string already has
            # a space (trailing or leading depending on transition)
            nextcs = charset
            if nextcs == _charset.UNKNOWN8BIT:
                original_bytes = string.encode('ascii', 'surrogateescape')
                string = original_bytes.decode('ascii', 'replace')
            if uchunks:
                hasspace = string and self._nonctext(string[0])
                if lastcs not in (None, 'us-ascii'):
                    if nextcs in (None, 'us-ascii') and not hasspace:
                        uchunks.append(SPACE)
                        nextcs = None
                elif nextcs not in (None, 'us-ascii') and not lastspace:
                    uchunks.append(SPACE)
            lastspace = string and self._nonctext(string[-1])
            lastcs = nextcs
            uchunks.append(string)
        return EMPTYSTRING.join(uchunks)

    # Rich comparison operators for equality only.  BAW: does it make sense to
    # have or explicitly disable <, <=, >, >= operators?
    def __eq__(self, other):
        # other may be a Header or a string.  Both are fine so coerce
        # ourselves to a unicode (of the unencoded header value), swap the
        # args and do another comparison.
        return other == str(self)

    def append(self, s, charset=None, errors='strict'):
        """Append a string to the MIME header.

        Optional charset, if given, should be a Charset instance or the name
        of a character set (which will be converted to a Charset instance).  A
        value of None (the default) means that the charset given in the
        constructor is used.

        s may be a byte string or a Unicode string.  If it is a byte string
        (i.e. isinstance(s, str) is false), then charset is the encoding of
        that byte string, and a UnicodeError will be raised if the string
        cannot be decoded with that charset.  If s is a Unicode string, then
        charset is a hint specifying the character set of the characters in
        the string.  In either case, when producing an RFC 2822 compliant
        header using RFC 2047 rules, the string will be encoded using the
        output codec of the charset.  If the string cannot be encoded to the
        output codec, a UnicodeError will be raised.

        Optional `errors' is passed as the errors argument to the decode
        call if s is a byte string.
        """
        if charset is None:
            charset = self._charset
        elif not isinstance(charset, Charset):
            charset = Charset(charset)
        if not isinstance(s, str):
            input_charset = charset.input_codec or 'us-ascii'
            if input_charset == _charset.UNKNOWN8BIT:
                s = s.decode('us-ascii', 'surrogateescape')
            else:
                s = s.decode(input_charset, errors)
        # Ensure that the bytes we're storing can be decoded to the output
        # character set, otherwise an early error is raised.
        output_charset = charset.output_codec or 'us-ascii'
        if output_charset != _charset.UNKNOWN8BIT:
            try:
                s.encode(output_charset, errors)
            except UnicodeEncodeError:
                if output_charset!='us-ascii':
                    raise
                charset = UTF8
        self._chunks.append((s, charset))

    def _nonctext(self, s):
        """True if string s is not a ctext character of RFC822.
        """
        return s.isspace() or s in ('(', ')', '\\')

    def encode(self, splitchars=';, \t', maxlinelen=None, linesep='\n'):
        r"""Encode a message header into an RFC-compliant format.

        There are many issues involved in converting a given string for use in
        an email header.  Only certain character sets are readable in most
        email clients, and as header strings can only contain a subset of
        7-bit ASCII, care must be taken to properly convert and encode (with
        Base64 or quoted-printable) header strings.  In addition, there is a
        75-character length limit on any given encoded header field, so
        line-wrapping must be performed, even with double-byte character sets.

        Optional maxlinelen specifies the maximum length of each generated
        line, exclusive of the linesep string.  Individual lines may be longer
        than maxlinelen if a folding point cannot be found.  The first line
        will be shorter by the length of the header name plus ": " if a header
        name was specified at Header construction time.  The default value for
        maxlinelen is determined at header construction time.

        Optional splitchars is a string containing characters which should be
        given extra weight by the splitting algorithm during normal header
        wrapping.  This is in very rough support of RFC 2822's `higher level
        syntactic breaks':  split points preceded by a splitchar are preferred
        during line splitting, with the characters preferred in the order in
        which they appear in the string.  Space and tab may be included in the
        string to indicate whether preference should be given to one over the
        other as a split point when other split chars do not appear in the line
        being split.  Splitchars does not affect RFC 2047 encoded lines.

        Optional linesep is a string to be used to separate the lines of
        the value.  The default value is the most useful for typical
        Python applications, but it can be set to \r\n to produce RFC-compliant
        line separators when needed.
        """
        self._normalize()
        if maxlinelen is None:
            maxlinelen = self._maxlinelen
        # A maxlinelen of 0 means don't wrap.  For all practical purposes,
        # choosing a huge number here accomplishes that and makes the
        # _ValueFormatter algorithm much simpler.
        if maxlinelen == 0:
            maxlinelen = 1000000
        formatter = _ValueFormatter(self._headerlen, maxlinelen,
                                    self._continuation_ws, splitchars)
        lastcs = None
        hasspace = lastspace = None
        for string, charset in self._chunks:
            if hasspace is not None:
                hasspace = string and self._nonctext(string[0])
                if lastcs not in (None, 'us-ascii'):
                    if not hasspace or charset not in (None, 'us-ascii'):
                        formatter.add_transition()
                elif charset not in (None, 'us-ascii') and not lastspace:
                    formatter.add_transition()
            lastspace = string and self._nonctext(string[-1])
            lastcs = charset
            hasspace = False
            lines = string.splitlines()
            if lines:
                formatter.feed('', lines[0], charset)
            else:
                formatter.feed('', '', charset)
            for line in lines[1:]:
                formatter.newline()
                if charset.header_encoding is not None:
                    formatter.feed(self._continuation_ws, ' ' + line.lstrip(),
                                   charset)
                else:
                    sline = line.lstrip()
                    fws = line[:len(line)-len(sline)]
                    formatter.feed(fws, sline, charset)
            if len(lines) > 1:
                formatter.newline()
        if self._chunks:
            formatter.add_transition()
        value = formatter._str(linesep)
        if _embedded_header.search(value):
            raise HeaderParseError("header value appears to contain "
                "an embedded header: {!r}".format(value))
        return value

    def _normalize(self):
        # Step 1: Normalize the chunks so that all runs of identical charsets
        # get collapsed into a single unicode string.
        chunks = []
        last_charset = None
        last_chunk = []
        for string, charset in self._chunks:
            if charset == last_charset:
                last_chunk.append(string)
            else:
                if last_charset is not None:
                    chunks.append((SPACE.join(last_chunk), last_charset))
                last_chunk = [string]
                last_charset = charset
        if last_chunk:
            chunks.append((SPACE.join(last_chunk), last_charset))
        self._chunks = chunks



class _ValueFormatter:
    def __init__(self, headerlen, maxlen, continuation_ws, splitchars):
        self._maxlen = maxlen
        self._continuation_ws = continuation_ws
        self._continuation_ws_len = len(continuation_ws)
        self._splitchars = splitchars
        self._lines = []
        self._current_line = _Accumulator(headerlen)

    def _str(self, linesep):
        self.newline()
        return linesep.join(self._lines)

    def __str__(self):
        return self._str(NL)

    def newline(self):
        end_of_line = self._current_line.pop()
        if end_of_line != (' ', ''):
            self._current_line.push(*end_of_line)
        if len(self._current_line) > 0:
            if self._current_line.is_onlyws() and self._lines:
                self._lines[-1] += str(self._current_line)
            else:
                self._lines.append(str(self._current_line))
        self._current_line.reset()

    def add_transition(self):
        self._current_line.push(' ', '')

    def feed(self, fws, string, charset):
        # If the charset has no header encoding (i.e. it is an ASCII encoding)
        # then we must split the header at the "highest level syntactic break"
        # possible. Note that we don't have a lot of smarts about field
        # syntax; we just try to break on semi-colons, then commas, then
        # whitespace.  Eventually, this should be pluggable.
        if charset.header_encoding is None:
            self._ascii_split(fws, string, self._splitchars)
            return
        # Otherwise, we're doing either a Base64 or a quoted-printable
        # encoding which means we don't need to split the line on syntactic
        # breaks.  We can basically just find enough characters to fit on the
        # current line, minus the RFC 2047 chrome.  What makes this trickier
        # though is that we have to split at octet boundaries, not character
        # boundaries but it's only safe to split at character boundaries so at
        # best we can only get close.
        encoded_lines = charset.header_encode_lines(string, self._maxlengths())
        # The first element extends the current line, but if it's None then
        # nothing more fit on the current line so start a new line.
        try:
            first_line = encoded_lines.pop(0)
        except IndexError:
            # There are no encoded lines, so we're done.
            return
        if first_line is not None:
            self._append_chunk(fws, first_line)
        try:
            last_line = encoded_lines.pop()
        except IndexError:
            # There was only one line.
            return
        self.newline()
        self._current_line.push(self._continuation_ws, last_line)
        # Everything else are full lines in themselves.
        for line in encoded_lines:
            self._lines.append(self._continuation_ws + line)

    def _maxlengths(self):
        # The first line's length.
        yield self._maxlen - len(self._current_line)
        while True:
            yield self._maxlen - self._continuation_ws_len

    def _ascii_split(self, fws, string, splitchars):
        # The RFC 2822 header folding algorithm is simple in principle but
        # complex in practice.  Lines may be folded any place where "folding
        # white space" appears by inserting a linesep character in front of the
        # FWS.  The complication is that not all spaces or tabs qualify as FWS,
        # and we are also supposed to prefer to break at "higher level
        # syntactic breaks".  We can't do either of these without intimate
        # knowledge of the structure of structured headers, which we don't have
        # here.  So the best we can do here is prefer to break at the specified
        # splitchars, and hope that we don't choose any spaces or tabs that
        # aren't legal FWS.  (This is at least better than the old algorithm,
        # where we would sometimes *introduce* FWS after a splitchar, or the
        # algorithm before that, where we would turn all white space runs into
        # single spaces or tabs.)
        parts = re.split("(["+FWS+"]+)", fws+string)
        if parts[0]:
            parts[:0] = ['']
        else:
            parts.pop(0)
        for fws, part in zip(*[iter(parts)]*2):
            self._append_chunk(fws, part)

    def _append_chunk(self, fws, string):
        self._current_line.push(fws, string)
        if len(self._current_line) > self._maxlen:
            # Find the best split point, working backward from the end.
            # There might be none, on a long first line.
            for ch in self._splitchars:
                for i in range(self._current_line.part_count()-1, 0, -1):
                    if ch.isspace():
                        fws = self._current_line[i][0]
                        if fws and fws[0]==ch:
                            break
                    prevpart = self._current_line[i-1][1]
                    if prevpart and prevpart[-1]==ch:
                        break
                else:
                    continue
                break
            else:
                fws, part = self._current_line.pop()
                if self._current_line._initial_size > 0:
                    # There will be a header, so leave it on a line by itself.
                    self.newline()
                    if not fws:
                        # We don't use continuation_ws here because the whitespace
                        # after a header should always be a space.
                        fws = ' '
                self._current_line.push(fws, part)
                return
            remainder = self._current_line.pop_from(i)
            self._lines.append(str(self._current_line))
            self._current_line.reset(remainder)


class _Accumulator(list):

    def __init__(self, initial_size=0):
        self._initial_size = initial_size
        super().__init__()

    def push(self, fws, string):
        self.append((fws, string))

    def pop_from(self, i=0):
        popped = self[i:]
        self[i:] = []
        return popped

    def pop(self):
        if self.part_count()==0:
            return ('', '')
        return super().pop()

    def __len__(self):
        return sum((len(fws)+len(part) for fws, part in self),
                   self._initial_size)

    def __str__(self):
        return EMPTYSTRING.join((EMPTYSTRING.join((fws, part))
                                for fws, part in self))

    def reset(self, startval=None):
        if startval is None:
            startval = []
        self[:] = startval
        self._initial_size = 0

    def is_onlyws(self):
        return self._initial_size==0 and (not self or str(self).isspace())

    def part_count(self):
        return super().__len__()
email/encoders.py000064400000003372151153537640010026 0ustar00# Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org

"""Encodings and related functions."""

__all__ = [
    'encode_7or8bit',
    'encode_base64',
    'encode_noop',
    'encode_quopri',
    ]


from base64 import encodebytes as _bencode
from quopri import encodestring as _encodestring



def _qencode(s):
    enc = _encodestring(s, quotetabs=True)
    # Must encode spaces, which quopri.encodestring() doesn't do
    return enc.replace(b' ', b'=20')


def encode_base64(msg):
    """Encode the message's payload in Base64.

    Also, add an appropriate Content-Transfer-Encoding header.
    """
    orig = msg.get_payload(decode=True)
    encdata = str(_bencode(orig), 'ascii')
    msg.set_payload(encdata)
    msg['Content-Transfer-Encoding'] = 'base64'



def encode_quopri(msg):
    """Encode the message's payload in quoted-printable.

    Also, add an appropriate Content-Transfer-Encoding header.
    """
    orig = msg.get_payload(decode=True)
    encdata = _qencode(orig)
    msg.set_payload(encdata)
    msg['Content-Transfer-Encoding'] = 'quoted-printable'



def encode_7or8bit(msg):
    """Set the Content-Transfer-Encoding header to 7bit or 8bit."""
    orig = msg.get_payload(decode=True)
    if orig is None:
        # There's no payload.  For backwards compatibility we use 7bit
        msg['Content-Transfer-Encoding'] = '7bit'
        return
    # We play a trick to make this go fast.  If decoding from ASCII succeeds,
    # we know the data must be 7bit, otherwise treat it as 8bit.
    try:
        orig.decode('ascii')
    except UnicodeError:
        msg['Content-Transfer-Encoding'] = '8bit'
    else:
        msg['Content-Transfer-Encoding'] = '7bit'



def encode_noop(msg):
    """Do nothing."""
email/policy.py000064400000024217151153537640007524 0ustar00"""This will be the home for the policy that hooks in the new
code that adds all the email6 features.
"""

import re
import sys
from email._policybase import Policy, Compat32, compat32, _extend_docstrings
from email.utils import _has_surrogates
from email.headerregistry import HeaderRegistry as HeaderRegistry
from email.contentmanager import raw_data_manager
from email.message import EmailMessage

__all__ = [
    'Compat32',
    'compat32',
    'Policy',
    'EmailPolicy',
    'default',
    'strict',
    'SMTP',
    'HTTP',
    ]

linesep_splitter = re.compile(r'\n|\r')

@_extend_docstrings
class EmailPolicy(Policy):

    """+
    PROVISIONAL

    The API extensions enabled by this policy are currently provisional.
    Refer to the documentation for details.

    This policy adds new header parsing and folding algorithms.  Instead of
    simple strings, headers are custom objects with custom attributes
    depending on the type of the field.  The folding algorithm fully
    implements RFCs 2047 and 5322.

    In addition to the settable attributes listed above that apply to
    all Policies, this policy adds the following additional attributes:

    utf8                -- if False (the default) message headers will be
                           serialized as ASCII, using encoded words to encode
                           any non-ASCII characters in the source strings.  If
                           True, the message headers will be serialized using
                           utf8 and will not contain encoded words (see RFC
                           6532 for more on this serialization format).

    refold_source       -- if the value for a header in the Message object
                           came from the parsing of some source, this attribute
                           indicates whether or not a generator should refold
                           that value when transforming the message back into
                           stream form.  The possible values are:

                           none  -- all source values use original folding
                           long  -- source values that have any line that is
                                    longer than max_line_length will be
                                    refolded
                           all  -- all values are refolded.

                           The default is 'long'.

    header_factory      -- a callable that takes two arguments, 'name' and
                           'value', where 'name' is a header field name and
                           'value' is an unfolded header field value, and
                           returns a string-like object that represents that
                           header.  A default header_factory is provided that
                           understands some of the RFC5322 header field types.
                           (Currently address fields and date fields have
                           special treatment, while all other fields are
                           treated as unstructured.  This list will be
                           completed before the extension is marked stable.)

    content_manager     -- an object with at least two methods: get_content
                           and set_content.  When the get_content or
                           set_content method of a Message object is called,
                           it calls the corresponding method of this object,
                           passing it the message object as its first argument,
                           and any arguments or keywords that were passed to
                           it as additional arguments.  The default
                           content_manager is
                           :data:`~email.contentmanager.raw_data_manager`.

    """

    message_factory = EmailMessage
    utf8 = False
    refold_source = 'long'
    header_factory = HeaderRegistry()
    content_manager = raw_data_manager

    def __init__(self, **kw):
        # Ensure that each new instance gets a unique header factory
        # (as opposed to clones, which share the factory).
        if 'header_factory' not in kw:
            object.__setattr__(self, 'header_factory', HeaderRegistry())
        super().__init__(**kw)

    def header_max_count(self, name):
        """+
        The implementation for this class returns the max_count attribute from
        the specialized header class that would be used to construct a header
        of type 'name'.
        """
        return self.header_factory[name].max_count

    # The logic of the next three methods is chosen such that it is possible to
    # switch a Message object between a Compat32 policy and a policy derived
    # from this class and have the results stay consistent.  This allows a
    # Message object constructed with this policy to be passed to a library
    # that only handles Compat32 objects, or to receive such an object and
    # convert it to use the newer style by just changing its policy.  It is
    # also chosen because it postpones the relatively expensive full rfc5322
    # parse until as late as possible when parsing from source, since in many
    # applications only a few headers will actually be inspected.

    def header_source_parse(self, sourcelines):
        """+
        The name is parsed as everything up to the ':' and returned unmodified.
        The value is determined by stripping leading whitespace off the
        remainder of the first line, joining all subsequent lines together, and
        stripping any trailing carriage return or linefeed characters.  (This
        is the same as Compat32).

        """
        name, value = sourcelines[0].split(':', 1)
        value = value.lstrip(' \t') + ''.join(sourcelines[1:])
        return (name, value.rstrip('\r\n'))

    def header_store_parse(self, name, value):
        """+
        The name is returned unchanged.  If the input value has a 'name'
        attribute and it matches the name ignoring case, the value is returned
        unchanged.  Otherwise the name and value are passed to header_factory
        method, and the resulting custom header object is returned as the
        value.  In this case a ValueError is raised if the input value contains
        CR or LF characters.

        """
        if hasattr(value, 'name') and value.name.lower() == name.lower():
            return (name, value)
        if isinstance(value, str) and len(value.splitlines())>1:
            # XXX this error message isn't quite right when we use splitlines
            # (see issue 22233), but I'm not sure what should happen here.
            raise ValueError("Header values may not contain linefeed "
                             "or carriage return characters")
        return (name, self.header_factory(name, value))

    def header_fetch_parse(self, name, value):
        """+
        If the value has a 'name' attribute, it is returned to unmodified.
        Otherwise the name and the value with any linesep characters removed
        are passed to the header_factory method, and the resulting custom
        header object is returned.  Any surrogateescaped bytes get turned
        into the unicode unknown-character glyph.

        """
        if hasattr(value, 'name'):
            return value
        # We can't use splitlines here because it splits on more than \r and \n.
        value = ''.join(linesep_splitter.split(value))
        return self.header_factory(name, value)

    def fold(self, name, value):
        """+
        Header folding is controlled by the refold_source policy setting.  A
        value is considered to be a 'source value' if and only if it does not
        have a 'name' attribute (having a 'name' attribute means it is a header
        object of some sort).  If a source value needs to be refolded according
        to the policy, it is converted into a custom header object by passing
        the name and the value with any linesep characters removed to the
        header_factory method.  Folding of a custom header object is done by
        calling its fold method with the current policy.

        Source values are split into lines using splitlines.  If the value is
        not to be refolded, the lines are rejoined using the linesep from the
        policy and returned.  The exception is lines containing non-ascii
        binary data.  In that case the value is refolded regardless of the
        refold_source setting, which causes the binary data to be CTE encoded
        using the unknown-8bit charset.

        """
        return self._fold(name, value, refold_binary=True)

    def fold_binary(self, name, value):
        """+
        The same as fold if cte_type is 7bit, except that the returned value is
        bytes.

        If cte_type is 8bit, non-ASCII binary data is converted back into
        bytes.  Headers with binary data are not refolded, regardless of the
        refold_header setting, since there is no way to know whether the binary
        data consists of single byte characters or multibyte characters.

        If utf8 is true, headers are encoded to utf8, otherwise to ascii with
        non-ASCII unicode rendered as encoded words.

        """
        folded = self._fold(name, value, refold_binary=self.cte_type=='7bit')
        charset = 'utf8' if self.utf8 else 'ascii'
        return folded.encode(charset, 'surrogateescape')

    def _fold(self, name, value, refold_binary=False):
        if hasattr(value, 'name'):
            return value.fold(policy=self)
        maxlen = self.max_line_length if self.max_line_length else sys.maxsize
        lines = value.splitlines()
        refold = (self.refold_source == 'all' or
                  self.refold_source == 'long' and
                    (lines and len(lines[0])+len(name)+2 > maxlen or
                     any(len(x) > maxlen for x in lines[1:])))
        if refold or refold_binary and _has_surrogates(value):
            return self.header_factory(name, ''.join(lines)).fold(policy=self)
        return name + ': ' + self.linesep.join(lines) + self.linesep


default = EmailPolicy()
# Make the default policy use the class default header_factory
del default.header_factory
strict = default.clone(raise_on_defect=True)
SMTP = default.clone(linesep='\r\n')
HTTP = default.clone(linesep='\r\n', max_line_length=None)
SMTPUTF8 = SMTP.clone(utf8=True)
email/headerregistry.py000064400000050513151153537640011244 0ustar00"""Representing and manipulating email headers via custom objects.

This module provides an implementation of the HeaderRegistry API.
The implementation is designed to flexibly follow RFC5322 rules.

Eventually HeaderRegistry will be a public API, but it isn't yet,
and will probably change some before that happens.

"""
from types import MappingProxyType

from email import utils
from email import errors
from email import _header_value_parser as parser

class Address:

    def __init__(self, display_name='', username='', domain='', addr_spec=None):
        """Create an object representing a full email address.

        An address can have a 'display_name', a 'username', and a 'domain'.  In
        addition to specifying the username and domain separately, they may be
        specified together by using the addr_spec keyword *instead of* the
        username and domain keywords.  If an addr_spec string is specified it
        must be properly quoted according to RFC 5322 rules; an error will be
        raised if it is not.

        An Address object has display_name, username, domain, and addr_spec
        attributes, all of which are read-only.  The addr_spec and the string
        value of the object are both quoted according to RFC5322 rules, but
        without any Content Transfer Encoding.

        """

        inputs = ''.join(filter(None, (display_name, username, domain, addr_spec)))
        if '\r' in inputs or '\n' in inputs:
            raise ValueError("invalid arguments; address parts cannot contain CR or LF")

        # This clause with its potential 'raise' may only happen when an
        # application program creates an Address object using an addr_spec
        # keyword.  The email library code itself must always supply username
        # and domain.
        if addr_spec is not None:
            if username or domain:
                raise TypeError("addrspec specified when username and/or "
                                "domain also specified")
            a_s, rest = parser.get_addr_spec(addr_spec)
            if rest:
                raise ValueError("Invalid addr_spec; only '{}' "
                                 "could be parsed from '{}'".format(
                                    a_s, addr_spec))
            if a_s.all_defects:
                raise a_s.all_defects[0]
            username = a_s.local_part
            domain = a_s.domain
        self._display_name = display_name
        self._username = username
        self._domain = domain

    @property
    def display_name(self):
        return self._display_name

    @property
    def username(self):
        return self._username

    @property
    def domain(self):
        return self._domain

    @property
    def addr_spec(self):
        """The addr_spec (username@domain) portion of the address, quoted
        according to RFC 5322 rules, but with no Content Transfer Encoding.
        """
        nameset = set(self.username)
        if len(nameset) > len(nameset-parser.DOT_ATOM_ENDS):
            lp = parser.quote_string(self.username)
        else:
            lp = self.username
        if self.domain:
            return lp + '@' + self.domain
        if not lp:
            return '<>'
        return lp

    def __repr__(self):
        return "{}(display_name={!r}, username={!r}, domain={!r})".format(
                        self.__class__.__name__,
                        self.display_name, self.username, self.domain)

    def __str__(self):
        nameset = set(self.display_name)
        if len(nameset) > len(nameset-parser.SPECIALS):
            disp = parser.quote_string(self.display_name)
        else:
            disp = self.display_name
        if disp:
            addr_spec = '' if self.addr_spec=='<>' else self.addr_spec
            return "{} <{}>".format(disp, addr_spec)
        return self.addr_spec

    def __eq__(self, other):
        if type(other) != type(self):
            return False
        return (self.display_name == other.display_name and
                self.username == other.username and
                self.domain == other.domain)


class Group:

    def __init__(self, display_name=None, addresses=None):
        """Create an object representing an address group.

        An address group consists of a display_name followed by colon and a
        list of addresses (see Address) terminated by a semi-colon.  The Group
        is created by specifying a display_name and a possibly empty list of
        Address objects.  A Group can also be used to represent a single
        address that is not in a group, which is convenient when manipulating
        lists that are a combination of Groups and individual Addresses.  In
        this case the display_name should be set to None.  In particular, the
        string representation of a Group whose display_name is None is the same
        as the Address object, if there is one and only one Address object in
        the addresses list.

        """
        self._display_name = display_name
        self._addresses = tuple(addresses) if addresses else tuple()

    @property
    def display_name(self):
        return self._display_name

    @property
    def addresses(self):
        return self._addresses

    def __repr__(self):
        return "{}(display_name={!r}, addresses={!r}".format(
                 self.__class__.__name__,
                 self.display_name, self.addresses)

    def __str__(self):
        if self.display_name is None and len(self.addresses)==1:
            return str(self.addresses[0])
        disp = self.display_name
        if disp is not None:
            nameset = set(disp)
            if len(nameset) > len(nameset-parser.SPECIALS):
                disp = parser.quote_string(disp)
        adrstr = ", ".join(str(x) for x in self.addresses)
        adrstr = ' ' + adrstr if adrstr else adrstr
        return "{}:{};".format(disp, adrstr)

    def __eq__(self, other):
        if type(other) != type(self):
            return False
        return (self.display_name == other.display_name and
                self.addresses == other.addresses)


# Header Classes #

class BaseHeader(str):

    """Base class for message headers.

    Implements generic behavior and provides tools for subclasses.

    A subclass must define a classmethod named 'parse' that takes an unfolded
    value string and a dictionary as its arguments.  The dictionary will
    contain one key, 'defects', initialized to an empty list.  After the call
    the dictionary must contain two additional keys: parse_tree, set to the
    parse tree obtained from parsing the header, and 'decoded', set to the
    string value of the idealized representation of the data from the value.
    (That is, encoded words are decoded, and values that have canonical
    representations are so represented.)

    The defects key is intended to collect parsing defects, which the message
    parser will subsequently dispose of as appropriate.  The parser should not,
    insofar as practical, raise any errors.  Defects should be added to the
    list instead.  The standard header parsers register defects for RFC
    compliance issues, for obsolete RFC syntax, and for unrecoverable parsing
    errors.

    The parse method may add additional keys to the dictionary.  In this case
    the subclass must define an 'init' method, which will be passed the
    dictionary as its keyword arguments.  The method should use (usually by
    setting them as the value of similarly named attributes) and remove all the
    extra keys added by its parse method, and then use super to call its parent
    class with the remaining arguments and keywords.

    The subclass should also make sure that a 'max_count' attribute is defined
    that is either None or 1. XXX: need to better define this API.

    """

    def __new__(cls, name, value):
        kwds = {'defects': []}
        cls.parse(value, kwds)
        if utils._has_surrogates(kwds['decoded']):
            kwds['decoded'] = utils._sanitize(kwds['decoded'])
        self = str.__new__(cls, kwds['decoded'])
        del kwds['decoded']
        self.init(name, **kwds)
        return self

    def init(self, name, *, parse_tree, defects):
        self._name = name
        self._parse_tree = parse_tree
        self._defects = defects

    @property
    def name(self):
        return self._name

    @property
    def defects(self):
        return tuple(self._defects)

    def __reduce__(self):
        return (
            _reconstruct_header,
            (
                self.__class__.__name__,
                self.__class__.__bases__,
                str(self),
            ),
            self.__dict__)

    @classmethod
    def _reconstruct(cls, value):
        return str.__new__(cls, value)

    def fold(self, *, policy):
        """Fold header according to policy.

        The parsed representation of the header is folded according to
        RFC5322 rules, as modified by the policy.  If the parse tree
        contains surrogateescaped bytes, the bytes are CTE encoded using
        the charset 'unknown-8bit".

        Any non-ASCII characters in the parse tree are CTE encoded using
        charset utf-8. XXX: make this a policy setting.

        The returned value is an ASCII-only string possibly containing linesep
        characters, and ending with a linesep character.  The string includes
        the header name and the ': ' separator.

        """
        # At some point we need to put fws here if it was in the source.
        header = parser.Header([
            parser.HeaderLabel([
                parser.ValueTerminal(self.name, 'header-name'),
                parser.ValueTerminal(':', 'header-sep')]),
            ])
        if self._parse_tree:
            header.append(
                parser.CFWSList([parser.WhiteSpaceTerminal(' ', 'fws')]))
        header.append(self._parse_tree)
        return header.fold(policy=policy)


def _reconstruct_header(cls_name, bases, value):
    return type(cls_name, bases, {})._reconstruct(value)


class UnstructuredHeader:

    max_count = None
    value_parser = staticmethod(parser.get_unstructured)

    @classmethod
    def parse(cls, value, kwds):
        kwds['parse_tree'] = cls.value_parser(value)
        kwds['decoded'] = str(kwds['parse_tree'])


class UniqueUnstructuredHeader(UnstructuredHeader):

    max_count = 1


class DateHeader:

    """Header whose value consists of a single timestamp.

    Provides an additional attribute, datetime, which is either an aware
    datetime using a timezone, or a naive datetime if the timezone
    in the input string is -0000.  Also accepts a datetime as input.
    The 'value' attribute is the normalized form of the timestamp,
    which means it is the output of format_datetime on the datetime.
    """

    max_count = None

    # This is used only for folding, not for creating 'decoded'.
    value_parser = staticmethod(parser.get_unstructured)

    @classmethod
    def parse(cls, value, kwds):
        if not value:
            kwds['defects'].append(errors.HeaderMissingRequiredValue())
            kwds['datetime'] = None
            kwds['decoded'] = ''
            kwds['parse_tree'] = parser.TokenList()
            return
        if isinstance(value, str):
            value = utils.parsedate_to_datetime(value)
        kwds['datetime'] = value
        kwds['decoded'] = utils.format_datetime(kwds['datetime'])
        kwds['parse_tree'] = cls.value_parser(kwds['decoded'])

    def init(self, *args, **kw):
        self._datetime = kw.pop('datetime')
        super().init(*args, **kw)

    @property
    def datetime(self):
        return self._datetime


class UniqueDateHeader(DateHeader):

    max_count = 1


class AddressHeader:

    max_count = None

    @staticmethod
    def value_parser(value):
        address_list, value = parser.get_address_list(value)
        assert not value, 'this should not happen'
        return address_list

    @classmethod
    def parse(cls, value, kwds):
        if isinstance(value, str):
            # We are translating here from the RFC language (address/mailbox)
            # to our API language (group/address).
            kwds['parse_tree'] = address_list = cls.value_parser(value)
            groups = []
            for addr in address_list.addresses:
                groups.append(Group(addr.display_name,
                                    [Address(mb.display_name or '',
                                             mb.local_part or '',
                                             mb.domain or '')
                                     for mb in addr.all_mailboxes]))
            defects = list(address_list.all_defects)
        else:
            # Assume it is Address/Group stuff
            if not hasattr(value, '__iter__'):
                value = [value]
            groups = [Group(None, [item]) if not hasattr(item, 'addresses')
                                          else item
                                    for item in value]
            defects = []
        kwds['groups'] = groups
        kwds['defects'] = defects
        kwds['decoded'] = ', '.join([str(item) for item in groups])
        if 'parse_tree' not in kwds:
            kwds['parse_tree'] = cls.value_parser(kwds['decoded'])

    def init(self, *args, **kw):
        self._groups = tuple(kw.pop('groups'))
        self._addresses = None
        super().init(*args, **kw)

    @property
    def groups(self):
        return self._groups

    @property
    def addresses(self):
        if self._addresses is None:
            self._addresses = tuple(address for group in self._groups
                                            for address in group.addresses)
        return self._addresses


class UniqueAddressHeader(AddressHeader):

    max_count = 1


class SingleAddressHeader(AddressHeader):

    @property
    def address(self):
        if len(self.addresses)!=1:
            raise ValueError(("value of single address header {} is not "
                "a single address").format(self.name))
        return self.addresses[0]


class UniqueSingleAddressHeader(SingleAddressHeader):

    max_count = 1


class MIMEVersionHeader:

    max_count = 1

    value_parser = staticmethod(parser.parse_mime_version)

    @classmethod
    def parse(cls, value, kwds):
        kwds['parse_tree'] = parse_tree = cls.value_parser(value)
        kwds['decoded'] = str(parse_tree)
        kwds['defects'].extend(parse_tree.all_defects)
        kwds['major'] = None if parse_tree.minor is None else parse_tree.major
        kwds['minor'] = parse_tree.minor
        if parse_tree.minor is not None:
            kwds['version'] = '{}.{}'.format(kwds['major'], kwds['minor'])
        else:
            kwds['version'] = None

    def init(self, *args, **kw):
        self._version = kw.pop('version')
        self._major = kw.pop('major')
        self._minor = kw.pop('minor')
        super().init(*args, **kw)

    @property
    def major(self):
        return self._major

    @property
    def minor(self):
        return self._minor

    @property
    def version(self):
        return self._version


class ParameterizedMIMEHeader:

    # Mixin that handles the params dict.  Must be subclassed and
    # a property value_parser for the specific header provided.

    max_count = 1

    @classmethod
    def parse(cls, value, kwds):
        kwds['parse_tree'] = parse_tree = cls.value_parser(value)
        kwds['decoded'] = str(parse_tree)
        kwds['defects'].extend(parse_tree.all_defects)
        if parse_tree.params is None:
            kwds['params'] = {}
        else:
            # The MIME RFCs specify that parameter ordering is arbitrary.
            kwds['params'] = {utils._sanitize(name).lower():
                                    utils._sanitize(value)
                               for name, value in parse_tree.params}

    def init(self, *args, **kw):
        self._params = kw.pop('params')
        super().init(*args, **kw)

    @property
    def params(self):
        return MappingProxyType(self._params)


class ContentTypeHeader(ParameterizedMIMEHeader):

    value_parser = staticmethod(parser.parse_content_type_header)

    def init(self, *args, **kw):
        super().init(*args, **kw)
        self._maintype = utils._sanitize(self._parse_tree.maintype)
        self._subtype = utils._sanitize(self._parse_tree.subtype)

    @property
    def maintype(self):
        return self._maintype

    @property
    def subtype(self):
        return self._subtype

    @property
    def content_type(self):
        return self.maintype + '/' + self.subtype


class ContentDispositionHeader(ParameterizedMIMEHeader):

    value_parser = staticmethod(parser.parse_content_disposition_header)

    def init(self, *args, **kw):
        super().init(*args, **kw)
        cd = self._parse_tree.content_disposition
        self._content_disposition = cd if cd is None else utils._sanitize(cd)

    @property
    def content_disposition(self):
        return self._content_disposition


class ContentTransferEncodingHeader:

    max_count = 1

    value_parser = staticmethod(parser.parse_content_transfer_encoding_header)

    @classmethod
    def parse(cls, value, kwds):
        kwds['parse_tree'] = parse_tree = cls.value_parser(value)
        kwds['decoded'] = str(parse_tree)
        kwds['defects'].extend(parse_tree.all_defects)

    def init(self, *args, **kw):
        super().init(*args, **kw)
        self._cte = utils._sanitize(self._parse_tree.cte)

    @property
    def cte(self):
        return self._cte


class MessageIDHeader:

    max_count = 1
    value_parser = staticmethod(parser.parse_message_id)

    @classmethod
    def parse(cls, value, kwds):
        kwds['parse_tree'] = parse_tree = cls.value_parser(value)
        kwds['decoded'] = str(parse_tree)
        kwds['defects'].extend(parse_tree.all_defects)


# The header factory #

_default_header_map = {
    'subject':                      UniqueUnstructuredHeader,
    'date':                         UniqueDateHeader,
    'resent-date':                  DateHeader,
    'orig-date':                    UniqueDateHeader,
    'sender':                       UniqueSingleAddressHeader,
    'resent-sender':                SingleAddressHeader,
    'to':                           UniqueAddressHeader,
    'resent-to':                    AddressHeader,
    'cc':                           UniqueAddressHeader,
    'resent-cc':                    AddressHeader,
    'bcc':                          UniqueAddressHeader,
    'resent-bcc':                   AddressHeader,
    'from':                         UniqueAddressHeader,
    'resent-from':                  AddressHeader,
    'reply-to':                     UniqueAddressHeader,
    'mime-version':                 MIMEVersionHeader,
    'content-type':                 ContentTypeHeader,
    'content-disposition':          ContentDispositionHeader,
    'content-transfer-encoding':    ContentTransferEncodingHeader,
    'message-id':                   MessageIDHeader,
    }

class HeaderRegistry:

    """A header_factory and header registry."""

    def __init__(self, base_class=BaseHeader, default_class=UnstructuredHeader,
                       use_default_map=True):
        """Create a header_factory that works with the Policy API.

        base_class is the class that will be the last class in the created
        header class's __bases__ list.  default_class is the class that will be
        used if "name" (see __call__) does not appear in the registry.
        use_default_map controls whether or not the default mapping of names to
        specialized classes is copied in to the registry when the factory is
        created.  The default is True.

        """
        self.registry = {}
        self.base_class = base_class
        self.default_class = default_class
        if use_default_map:
            self.registry.update(_default_header_map)

    def map_to_type(self, name, cls):
        """Register cls as the specialized class for handling "name" headers.

        """
        self.registry[name.lower()] = cls

    def __getitem__(self, name):
        cls = self.registry.get(name.lower(), self.default_class)
        return type('_'+cls.__name__, (cls, self.base_class), {})

    def __call__(self, name, value):
        """Create a header instance for header 'name' from 'value'.

        Creates a header instance by creating a specialized class for parsing
        and representing the specified header by combining the factory
        base_class with a specialized class from the registry or the
        default_class, and passing the name and value to the constructed
        class's constructor.

        """
        return self[name](name, value)
email/parser.py000064400000011661151153537640007520 0ustar00# Copyright (C) 2001-2007 Python Software Foundation
# Author: Barry Warsaw, Thomas Wouters, Anthony Baxter
# Contact: email-sig@python.org

"""A parser of RFC 2822 and MIME email messages."""

__all__ = ['Parser', 'HeaderParser', 'BytesParser', 'BytesHeaderParser',
           'FeedParser', 'BytesFeedParser']

from io import StringIO, TextIOWrapper

from email.feedparser import FeedParser, BytesFeedParser
from email._policybase import compat32


class Parser:
    def __init__(self, _class=None, *, policy=compat32):
        """Parser of RFC 2822 and MIME email messages.

        Creates an in-memory object tree representing the email message, which
        can then be manipulated and turned over to a Generator to return the
        textual representation of the message.

        The string must be formatted as a block of RFC 2822 headers and header
        continuation lines, optionally preceded by a `Unix-from' header.  The
        header block is terminated either by the end of the string or by a
        blank line.

        _class is the class to instantiate for new message objects when they
        must be created.  This class must have a constructor that can take
        zero arguments.  Default is Message.Message.

        The policy keyword specifies a policy object that controls a number of
        aspects of the parser's operation.  The default policy maintains
        backward compatibility.

        """
        self._class = _class
        self.policy = policy

    def parse(self, fp, headersonly=False):
        """Create a message structure from the data in a file.

        Reads all the data from the file and returns the root of the message
        structure.  Optional headersonly is a flag specifying whether to stop
        parsing after reading the headers or not.  The default is False,
        meaning it parses the entire contents of the file.
        """
        feedparser = FeedParser(self._class, policy=self.policy)
        if headersonly:
            feedparser._set_headersonly()
        while True:
            data = fp.read(8192)
            if not data:
                break
            feedparser.feed(data)
        return feedparser.close()

    def parsestr(self, text, headersonly=False):
        """Create a message structure from a string.

        Returns the root of the message structure.  Optional headersonly is a
        flag specifying whether to stop parsing after reading the headers or
        not.  The default is False, meaning it parses the entire contents of
        the file.
        """
        return self.parse(StringIO(text), headersonly=headersonly)



class HeaderParser(Parser):
    def parse(self, fp, headersonly=True):
        return Parser.parse(self, fp, True)

    def parsestr(self, text, headersonly=True):
        return Parser.parsestr(self, text, True)


class BytesParser:

    def __init__(self, *args, **kw):
        """Parser of binary RFC 2822 and MIME email messages.

        Creates an in-memory object tree representing the email message, which
        can then be manipulated and turned over to a Generator to return the
        textual representation of the message.

        The input must be formatted as a block of RFC 2822 headers and header
        continuation lines, optionally preceded by a `Unix-from' header.  The
        header block is terminated either by the end of the input or by a
        blank line.

        _class is the class to instantiate for new message objects when they
        must be created.  This class must have a constructor that can take
        zero arguments.  Default is Message.Message.
        """
        self.parser = Parser(*args, **kw)

    def parse(self, fp, headersonly=False):
        """Create a message structure from the data in a binary file.

        Reads all the data from the file and returns the root of the message
        structure.  Optional headersonly is a flag specifying whether to stop
        parsing after reading the headers or not.  The default is False,
        meaning it parses the entire contents of the file.
        """
        fp = TextIOWrapper(fp, encoding='ascii', errors='surrogateescape')
        try:
            return self.parser.parse(fp, headersonly)
        finally:
            fp.detach()


    def parsebytes(self, text, headersonly=False):
        """Create a message structure from a byte string.

        Returns the root of the message structure.  Optional headersonly is a
        flag specifying whether to stop parsing after reading the headers or
        not.  The default is False, meaning it parses the entire contents of
        the file.
        """
        text = text.decode('ASCII', errors='surrogateescape')
        return self.parser.parsestr(text, headersonly)


class BytesHeaderParser(BytesParser):
    def parse(self, fp, headersonly=True):
        return BytesParser.parse(self, fp, headersonly=True)

    def parsebytes(self, text, headersonly=True):
        return BytesParser.parsebytes(self, text, headersonly=True)
email/base64mime.py000064400000006746151153537640010170 0ustar00# Copyright (C) 2002-2007 Python Software Foundation
# Author: Ben Gertzfield
# Contact: email-sig@python.org

"""Base64 content transfer encoding per RFCs 2045-2047.

This module handles the content transfer encoding method defined in RFC 2045
to encode arbitrary 8-bit data using the three 8-bit bytes in four 7-bit
characters encoding known as Base64.

It is used in the MIME standards for email to attach images, audio, and text
using some 8-bit character sets to messages.

This module provides an interface to encode and decode both headers and bodies
with Base64 encoding.

RFC 2045 defines a method for including character set information in an
`encoded-word' in a header.  This method is commonly used for 8-bit real names
in To:, From:, Cc:, etc. fields, as well as Subject: lines.

This module does not do the line wrapping or end-of-line character conversion
necessary for proper internationalized headers; it only does dumb encoding and
decoding.  To deal with the various line wrapping issues, use the email.header
module.
"""

__all__ = [
    'body_decode',
    'body_encode',
    'decode',
    'decodestring',
    'header_encode',
    'header_length',
    ]


from base64 import b64encode
from binascii import b2a_base64, a2b_base64

CRLF = '\r\n'
NL = '\n'
EMPTYSTRING = ''

# See also Charset.py
MISC_LEN = 7



# Helpers
def header_length(bytearray):
    """Return the length of s when it is encoded with base64."""
    groups_of_3, leftover = divmod(len(bytearray), 3)
    # 4 bytes out for each 3 bytes (or nonzero fraction thereof) in.
    n = groups_of_3 * 4
    if leftover:
        n += 4
    return n



def header_encode(header_bytes, charset='iso-8859-1'):
    """Encode a single header line with Base64 encoding in a given charset.

    charset names the character set to use to encode the header.  It defaults
    to iso-8859-1.  Base64 encoding is defined in RFC 2045.
    """
    if not header_bytes:
        return ""
    if isinstance(header_bytes, str):
        header_bytes = header_bytes.encode(charset)
    encoded = b64encode(header_bytes).decode("ascii")
    return '=?%s?b?%s?=' % (charset, encoded)



def body_encode(s, maxlinelen=76, eol=NL):
    r"""Encode a string with base64.

    Each line will be wrapped at, at most, maxlinelen characters (defaults to
    76 characters).

    Each line of encoded text will end with eol, which defaults to "\n".  Set
    this to "\r\n" if you will be using the result of this function directly
    in an email.
    """
    if not s:
        return s

    encvec = []
    max_unencoded = maxlinelen * 3 // 4
    for i in range(0, len(s), max_unencoded):
        # BAW: should encode() inherit b2a_base64()'s dubious behavior in
        # adding a newline to the encoded string?
        enc = b2a_base64(s[i:i + max_unencoded]).decode("ascii")
        if enc.endswith(NL) and eol != NL:
            enc = enc[:-1] + eol
        encvec.append(enc)
    return EMPTYSTRING.join(encvec)



def decode(string):
    """Decode a raw base64 string, returning a bytes object.

    This function does not parse a full MIME header value encoded with
    base64 (like =?iso-8859-1?b?bmloISBuaWgh?=) -- please use the high
    level email.header class for that functionality.
    """
    if not string:
        return bytes()
    elif isinstance(string, str):
        return a2b_base64(string.encode('raw-unicode-escape'))
    else:
        return a2b_base64(string)


# For convenience and backwards compatibility w/ standard base64 module
body_decode = decode
decodestring = decode
email/__pycache__/_policybase.cpython-38.opt-1.pyc000064400000034734151153537640015750 0ustar00U

e5d�:�@s�dZddlZddlmZddlmZddlmZdddgZGd	d
�d
�Z	dd�Z
d
d�ZGdd�de	ejd�Z
eGdd�de
��Ze�ZdS)zwPolicy framework for the email package.

Allows fine grained feature control of how the package parses and emits data.
�N)�header)�charset)�_has_surrogates�Policy�Compat32�compat32cs@eZdZdZ�fdd�Zdd�Zdd�Zdd	�Zd
d�Z�Z	S)�_PolicyBasea�Policy Object basic framework.

    This class is useless unless subclassed.  A subclass should define
    class attributes with defaults for any values that are to be
    managed by the Policy object.  The constructor will then allow
    non-default values to be set for these attributes at instance
    creation time.  The instance will be callable, taking these same
    attributes keyword arguments, and returning a new instance
    identical to the called instance except for those values changed
    by the keyword arguments.  Instances may be added, yielding new
    instances with any non-default values from the right hand
    operand overriding those in the left hand operand.  That is,

        A + B == A(<non-default values of B>)

    The repr of an instance can be used to reconstruct the object
    if and only if the repr of the values can be used to reconstruct
    those values.

    csH|��D]:\}}t||�r.tt|��||�qtd�||jj���qdS)z�Create new Policy, possibly overriding some defaults.

        See class docstring for a list of overridable attributes.

        �*{!r} is an invalid keyword argument for {}N)	�items�hasattr�superr�__setattr__�	TypeError�format�	__class__�__name__)�self�kw�name�value�r��)/usr/lib64/python3.8/email/_policybase.py�__init__)s
��z_PolicyBase.__init__cCs*dd�|j��D�}d�|jjd�|��S)NcSsg|]\}}d�||��qS)z{}={!r})r)�.0rrrrr�
<listcomp>8s�z(_PolicyBase.__repr__.<locals>.<listcomp>z{}({})z, )�__dict__r
rrr�join)r�argsrrr�__repr__7s�z_PolicyBase.__repr__cKsr|j�|j�}|j��D]\}}t�|||�q|��D]4\}}t||�s^td�||jj	���t�|||�q8|S)z�Return a new instance with specified attributes changed.

        The new instance has the same attribute values as the current object,
        except for the changes passed in as keyword arguments.

        r	)
r�__new__rr
�objectr
rrrr)rrZ	newpolicy�attrrrrr�clone<s
��z_PolicyBase.clonecCs,t||�rd}nd}t|�|jj|���dS)Nz'{!r} object attribute {!r} is read-onlyz!{!r} object has no attribute {!r})r�AttributeErrorrrr)rrr�msgrrrr
Ns
z_PolicyBase.__setattr__cCs|jf|j�S)z�Non-default values from right operand override those from left.

        The object returned is a new instance of the subclass.

        )r#r)r�otherrrr�__add__Usz_PolicyBase.__add__)
r�
__module__�__qualname__�__doc__rrr#r
r'�
__classcell__rrrrrsrcCs,|�dd�d}|�dd�d}|d|S)N�
�r)�rsplit�split)�docZ	added_docrrr�_append_doc^sr1cCs�|jr(|j�d�r(t|jdj|j�|_|j��D]V\}}|jr2|j�d�r2dd�|jD�D]*}tt||�d�}|r\t||j�|_q2q\q2|S)N�+rcss |]}|��D]
}|VqqdS)N)�mro)r�base�crrr�	<genexpr>hs
z%_extend_docstrings.<locals>.<genexpr>r*)r*�
startswithr1�	__bases__rr
�getattr)�clsrr"r5r0rrr�_extend_docstringscsr;c@s�eZdZdZdZdZdZdZdZdZ	dd�Z
d	d
�Zdd�Ze
jd
d��Ze
jdd��Ze
jdd��Ze
jdd��Ze
jdd��ZdS)raI	Controls for how messages are interpreted and formatted.

    Most of the classes and many of the methods in the email package accept
    Policy objects as parameters.  A Policy object contains a set of values and
    functions that control how input is interpreted and how output is rendered.
    For example, the parameter 'raise_on_defect' controls whether or not an RFC
    violation results in an error being raised or not, while 'max_line_length'
    controls the maximum length of output lines when a Message is serialized.

    Any valid attribute may be overridden when a Policy is created by passing
    it as a keyword argument to the constructor.  Policy objects are immutable,
    but a new Policy object can be created with only certain values changed by
    calling the Policy instance with keyword arguments.  Policy objects can
    also be added, producing a new Policy object in which the non-default
    attributes set in the right hand operand overwrite those specified in the
    left operand.

    Settable attributes:

    raise_on_defect     -- If true, then defects should be raised as errors.
                           Default: False.

    linesep             -- string containing the value to use as separation
                           between output lines.  Default '\n'.

    cte_type            -- Type of allowed content transfer encodings

                           7bit  -- ASCII only
                           8bit  -- Content-Transfer-Encoding: 8bit is allowed

                           Default: 8bit.  Also controls the disposition of
                           (RFC invalid) binary data in headers; see the
                           documentation of the binary_fold method.

    max_line_length     -- maximum length of lines, excluding 'linesep',
                           during serialization.  None or 0 means no line
                           wrapping is done.  Default is 78.

    mangle_from_        -- a flag that, when True escapes From_ lines in the
                           body of the message by putting a `>' in front of
                           them. This is used when the message is being
                           serialized by a generator. Default: True.

    message_factory     -- the class to use to create new message objects.
                           If the value is None, the default is Message.

    Fr,Z8bit�NNcCs|jr
|�|�||�dS)aZBased on policy, either raise defect or call register_defect.

            handle_defect(obj, defect)

        defect should be a Defect subclass, but in any case must be an
        Exception subclass.  obj is the object on which the defect should be
        registered if it is not raised.  If the raise_on_defect is True, the
        defect is raised as an error, otherwise the object and the defect are
        passed to register_defect.

        This method is intended to be called by parsers that discover defects.
        The email package parsers always call it with Defect instances.

        N)�raise_on_defect�register_defect�r�objZdefectrrr�
handle_defect�szPolicy.handle_defectcCs|j�|�dS)a�Record 'defect' on 'obj'.

        Called by handle_defect if raise_on_defect is False.  This method is
        part of the Policy API so that Policy subclasses can implement custom
        defect handling.  The default implementation calls the append method of
        the defects attribute of obj.  The objects used by the email package by
        default that get passed to this method will always have a defects
        attribute with an append method.

        N)Zdefects�appendr?rrrr>�szPolicy.register_defectcCsdS)a[Return the maximum allowed number of headers named 'name'.

        Called when a header is added to a Message object.  If the returned
        value is not 0 or None, and there are already a number of headers with
        the name 'name' equal to the value returned, a ValueError is raised.

        Because the default behavior of Message's __setitem__ is to append the
        value to the list of headers, it is easy to create duplicate headers
        without realizing it.  This method allows certain headers to be limited
        in the number of instances of that header that may be added to a
        Message programmatically.  (The limit is not observed by the parser,
        which will faithfully produce as many headers as exist in the message
        being parsed.)

        The default implementation returns None for all header names.
        Nr)rrrrr�header_max_count�szPolicy.header_max_countcCst�dS)aZGiven a list of linesep terminated strings constituting the lines of
        a single header, return the (name, value) tuple that should be stored
        in the model.  The input lines should retain their terminating linesep
        characters.  The lines passed in by the email package may contain
        surrogateescaped binary data.
        N��NotImplementedError)r�sourcelinesrrr�header_source_parse�szPolicy.header_source_parsecCst�dS)z�Given the header name and the value provided by the application
        program, return the (name, value) that should be stored in the model.
        NrD�rrrrrr�header_store_parse�szPolicy.header_store_parsecCst�dS)awGiven the header name and the value from the model, return the value
        to be returned to the application program that is requesting that
        header.  The value passed in by the email package may contain
        surrogateescaped binary data if the lines were parsed by a BytesParser.
        The returned value should not contain any surrogateescaped data.

        NrDrHrrr�header_fetch_parse�s	zPolicy.header_fetch_parsecCst�dS)a�Given the header name and the value from the model, return a string
        containing linesep characters that implement the folding of the header
        according to the policy controls.  The value passed in by the email
        package may contain surrogateescaped binary data if the lines were
        parsed by a BytesParser.  The returned value should not contain any
        surrogateescaped data.

        NrDrHrrr�fold�s
zPolicy.foldcCst�dS)a%Given the header name and the value from the model, return binary
        data containing linesep characters that implement the folding of the
        header according to the policy controls.  The value passed in by the
        email package may contain surrogateescaped binary data.

        NrDrHrrr�fold_binaryszPolicy.fold_binary)rr(r)r*r=�linesep�cte_type�max_line_length�mangle_from_Zmessage_factoryrAr>rC�abc�abstractmethodrGrIrJrKrLrrrrrps(0

	



)�	metaclassc@sLeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�ZdS)rz�+
    This particular policy is the backward compatibility Policy.  It
    replicates the behavior of the email package version 5.1.
    TcCs0t|t�s|St|�r(tj|tj|d�S|SdS)N�r�header_name)�
isinstance�strrr�Header�_charset�UNKNOWN8BITrHrrr�_sanitize_headers

�zCompat32._sanitize_headercCs>|d�dd�\}}|�d�d�|dd��}||�d�fS)a:+
        The name is parsed as everything up to the ':' and returned unmodified.
        The value is determined by stripping leading whitespace off the
        remainder of the first line, joining all subsequent lines together, and
        stripping any trailing carriage return or linefeed characters.

        r�:r-z 	�Nz
)r/�lstripr�rstrip)rrFrrrrrrG%szCompat32.header_source_parsecCs||fS)z>+
        The name and value are returned unmodified.
        rrHrrrrI1szCompat32.header_store_parsecCs|�||�S)z�+
        If the value contains binary data, it is converted into a Header object
        using the unknown-8bit charset.  Otherwise it is returned unmodified.
        )r[rHrrrrJ7szCompat32.header_fetch_parsecCs|j||dd�S)a+
        Headers are folded using the Header folding algorithm, which preserves
        existing line breaks in the value, and wraps each resulting line to the
        max_line_length.  Non-ASCII binary data are CTE encoded using the
        unknown-8bit charset.

        T��sanitize)�_foldrHrrrrK>sz
Compat32.foldcCs"|j|||jdkd�}|�dd�S)a�+
        Headers are folded using the Header folding algorithm, which preserves
        existing line breaks in the value, and wraps each resulting line to the
        max_line_length.  If cte_type is 7bit, non-ascii binary data is CTE
        encoded using the unknown-8bit charset.  Otherwise the original source
        header is used, with its existing line breaks and/or binary data.

        Z7bitr`�ascii�surrogateescape)rbrN�encode)rrrZfoldedrrrrLHs	zCompat32.fold_binarycCs�g}|�d|�t|t�r\t|�rL|r<tj|tj|d�}qZ|�|�d}q`tj||d�}n|}|dk	r�d}|jdk	r||j}|�|j	|j
|d��|�|j
�d�|�S)Nz%s: rT)rUr)rM�
maxlinelenr])rBrVrWrrrXrYrZrOrerMr)rrrra�parts�hrfrrrrbTs(
�


zCompat32._foldN)rr(r)r*rPr[rGrIrJrKrLrbrrrrrs
)r*rQZemailrrrYZemail.utilsr�__all__rr1r;�ABCMetarrrrrrr�<module>s �L
 femail/__pycache__/policy.cpython-38.opt-1.pyc000064400000022674151153537640014756 0ustar00U

e5d�(�@s�dZddlZddlZddlmZmZmZmZddlm	Z	ddl
mZddlm
Z
ddlmZdd	d
ddd
ddgZe�d�ZeGdd�de��Ze�Ze`ejdd�Zejdd�Zejddd�Zejdd�ZdS)zcThis will be the home for the policy that hooks in the new
code that adds all the email6 features.
�N)�Policy�Compat32�compat32�_extend_docstrings)�_has_surrogates)�HeaderRegistry)�raw_data_manager)�EmailMessagerrr�EmailPolicy�default�strict�SMTP�HTTPz\n|\rcspeZdZdZeZdZdZe�Z	e
Z�fdd�Zdd�Z
dd	�Zd
d�Zdd
�Zdd�Zdd�Zddd�Z�ZS)r
aQ+
    PROVISIONAL

    The API extensions enabled by this policy are currently provisional.
    Refer to the documentation for details.

    This policy adds new header parsing and folding algorithms.  Instead of
    simple strings, headers are custom objects with custom attributes
    depending on the type of the field.  The folding algorithm fully
    implements RFCs 2047 and 5322.

    In addition to the settable attributes listed above that apply to
    all Policies, this policy adds the following additional attributes:

    utf8                -- if False (the default) message headers will be
                           serialized as ASCII, using encoded words to encode
                           any non-ASCII characters in the source strings.  If
                           True, the message headers will be serialized using
                           utf8 and will not contain encoded words (see RFC
                           6532 for more on this serialization format).

    refold_source       -- if the value for a header in the Message object
                           came from the parsing of some source, this attribute
                           indicates whether or not a generator should refold
                           that value when transforming the message back into
                           stream form.  The possible values are:

                           none  -- all source values use original folding
                           long  -- source values that have any line that is
                                    longer than max_line_length will be
                                    refolded
                           all  -- all values are refolded.

                           The default is 'long'.

    header_factory      -- a callable that takes two arguments, 'name' and
                           'value', where 'name' is a header field name and
                           'value' is an unfolded header field value, and
                           returns a string-like object that represents that
                           header.  A default header_factory is provided that
                           understands some of the RFC5322 header field types.
                           (Currently address fields and date fields have
                           special treatment, while all other fields are
                           treated as unstructured.  This list will be
                           completed before the extension is marked stable.)

    content_manager     -- an object with at least two methods: get_content
                           and set_content.  When the get_content or
                           set_content method of a Message object is called,
                           it calls the corresponding method of this object,
                           passing it the message object as its first argument,
                           and any arguments or keywords that were passed to
                           it as additional arguments.  The default
                           content_manager is
                           :data:`~email.contentmanager.raw_data_manager`.

    F�longcs*d|krt�|dt��t�jf|�dS)N�header_factory)�object�__setattr__r�super�__init__)�self�kw��	__class__��$/usr/lib64/python3.8/email/policy.pyr]szEmailPolicy.__init__cCs|j|jS)z�+
        The implementation for this class returns the max_count attribute from
        the specialized header class that would be used to construct a header
        of type 'name'.
        )rZ	max_count)r�namerrr�header_max_countdszEmailPolicy.header_max_countcCs>|d�dd�\}}|�d�d�|dd��}||�d�fS)ac+
        The name is parsed as everything up to the ':' and returned unmodified.
        The value is determined by stripping leading whitespace off the
        remainder of the first line, joining all subsequent lines together, and
        stripping any trailing carriage return or linefeed characters.  (This
        is the same as Compat32).

        r�:�z 	�N�
)�split�lstrip�join�rstrip)rZsourcelinesr�valuerrr�header_source_parsevs	zEmailPolicy.header_source_parsecCsVt|d�r$|j��|��kr$||fSt|t�rFt|���dkrFtd��||�||�fS)a�+
        The name is returned unchanged.  If the input value has a 'name'
        attribute and it matches the name ignoring case, the value is returned
        unchanged.  Otherwise the name and value are passed to header_factory
        method, and the resulting custom header object is returned as the
        value.  In this case a ValueError is raised if the input value contains
        CR or LF characters.

        rrzDHeader values may not contain linefeed or carriage return characters)	�hasattrr�lower�
isinstance�str�len�
splitlines�
ValueErrorr�rrr%rrr�header_store_parse�s

zEmailPolicy.header_store_parsecCs*t|d�r|Sd�t�|��}|�||�S)ai+
        If the value has a 'name' attribute, it is returned to unmodified.
        Otherwise the name and the value with any linesep characters removed
        are passed to the header_factory method, and the resulting custom
        header object is returned.  Any surrogateescaped bytes get turned
        into the unicode unknown-character glyph.

        rr)r'r#�linesep_splitterr!rr.rrr�header_fetch_parse�s	
zEmailPolicy.header_fetch_parsecCs|j||dd�S)a+
        Header folding is controlled by the refold_source policy setting.  A
        value is considered to be a 'source value' if and only if it does not
        have a 'name' attribute (having a 'name' attribute means it is a header
        object of some sort).  If a source value needs to be refolded according
        to the policy, it is converted into a custom header object by passing
        the name and the value with any linesep characters removed to the
        header_factory method.  Folding of a custom header object is done by
        calling its fold method with the current policy.

        Source values are split into lines using splitlines.  If the value is
        not to be refolded, the lines are rejoined using the linesep from the
        policy and returned.  The exception is lines containing non-ascii
        binary data.  In that case the value is refolded regardless of the
        refold_source setting, which causes the binary data to be CTE encoded
        using the unknown-8bit charset.

        T��
refold_binary)�_foldr.rrr�fold�szEmailPolicy.foldcCs0|j|||jdkd�}|jr dnd}|�|d�S)a+
        The same as fold if cte_type is 7bit, except that the returned value is
        bytes.

        If cte_type is 8bit, non-ASCII binary data is converted back into
        bytes.  Headers with binary data are not refolded, regardless of the
        refold_header setting, since there is no way to know whether the binary
        data consists of single byte characters or multibyte characters.

        If utf8 is true, headers are encoded to utf8, otherwise to ascii with
        non-ASCII unicode rendered as encoded words.

        Z7bitr2�utf8�ascii�surrogateescape)r4Zcte_typer6�encode)rrr%Zfolded�charsetrrr�fold_binary�szEmailPolicy.fold_binarycs�t|d�r|j|d�S|jr"|jntj�|��}|jdkp�|jdko�|rdt|d�t|�d�kp�t�fdd�|d	d�D��}|s�|r�t	|�r�|�
|d
�|��j|d�S|d|j�|�|jS)Nr)Zpolicy�allrr�c3s|]}t|��kVqdS)N)r+)�.0�x��maxlenrr�	<genexpr>�sz$EmailPolicy._fold.<locals>.<genexpr>rrz: )
r'r5�max_line_length�sys�maxsizer,�
refold_sourcer+�anyrrr#�linesep)rrr%r3�linesZrefoldrr@rr4�s


 �zEmailPolicy._fold)F)�__name__�
__module__�__qualname__�__doc__r	Zmessage_factoryr6rFrrrZcontent_managerrrr&r/r1r5r;r4�
__classcell__rrrrr
s:
T)Zraise_on_defectr )rH)rHrC)r6)rM�rerDZemail._policybaserrrrZemail.utilsrZemail.headerregistryrZemail.contentmanagerrZ
email.messager	�__all__�compiler0r
rrZclonerr
rZSMTPUTF8rrrr�<module>s4�
@email/__pycache__/_parseaddr.cpython-38.opt-1.pyc000064400000030266151153537640015557 0ustar00U

e5dE�@s�dZddddgZddlZddlZdZdZd	Zd
ddd
dddddddddddddddddddd gZd!d"d#d$d%d&d'gZddddd(d)d*d(d+d*d,d+d-d,d.�Z	d/d�Z
d0d1�Zd2d�Zd3d�Z
d4d�ZGd5d6�d6�ZGd7d8�d8e�ZdS)9zcEmail address parsing code.

Lifted directly from rfc822.py.  This should eventually be rewritten.
�	mktime_tz�	parsedate�parsedate_tz�quote�N� �z, ZjanZfebZmarZaprZmayZjunZjulZaug�sep�octZnovZdecZjanuaryZfebruaryZmarchZaprilZjuneZjulyZaugustZ	septemberZoctoberZnovemberZdecemberZmonZtueZwedZthuZfriZsatZsunip���i���i���i����iD���i��)ZUTZUTCZGMT�ZZASTZADTZESTZEDTZCSTZCDTZMSTZMDTZPSTZPDTcCs,t|�}|sdS|ddkr$d|d<t|�S)zQConvert a date string to a time tuple.

    Accounts for military timezones.
    N�	r)�
_parsedate_tz�tuple)�data�res�r�(/usr/lib64/python3.8/email/_parseaddr.pyr-sc
Cs�|sdS|��}|sdS|d�d�s6|d��tkr>|d=n.|d�d�}|dkrl|d|dd�|d<t|�dkr�|d�d�}t|�dkr�||dd�}t|�dk�r|d}|�d�}|d	kr�|�d�}|dkr�|d|�||d�g|dd�<n
|�d
�t|�dk�rdS|dd�}|\}}}}}|��}|tk�rb||��}}|tk�rbdSt�	|�d}|dk�r�|d8}|d	dk�r�|dd	�}|�d
�}|dk�r�||}}|d	dk�r�|dd	�}|d�
��s�||}}|d	dk�r|dd	�}|�d
�}t|�dk�r,|\}	}
d}n~t|�dk�rF|\}	}
}ndt|�dk�r�d|dk�r�|d�d�}t|�dk�r�|\}	}
d}nt|�dk�r�|\}	}
}ndSz,t|�}t|�}t|	�}	t|
�}
t|�}Wntk
�r�YdSX|dk�r|dk�r|d7}n|d7}d}|�
�}|tk�r6t|}n>zt|�}Wntk
�rXYnX|dk�rt|�d��rtd}|�r�|dk�r�d	}
|}nd}
|
|dd|dd}||||	|
|ddd	|g
S)a�Convert date to extended time tuple.

    The last (additional) element is the time zone offset in seconds, except if
    the timezone was specified as -0000.  In that case the last element is
    None.  This indicates a UTC timestamp that explicitly declaims knowledge of
    the source timezone, as opposed to a +0000 timestamp that indicates the
    source timezone really was UTC.

    Nr�,���-��+���r���:��0�.�d�Dili�i�<)�split�endswith�lower�	_daynames�rfind�len�find�append�_monthnames�index�isdigit�int�
ValueError�upper�
_timezones�
startswith)r�iZstuff�sZddZmmZyyZtmZtzZthhZtmmZtssZtzoffsetZtzsignrrrr9s�


"














rcCs&t|�}t|t�r|dd�S|SdS)z&Convert a time string to a time tuple.Nr)r�
isinstancer
�r�trrrr�s
cCs<|ddkr"t�|dd�d�St�|�}||dSdS)zETurn a 10-tuple as returned by parsedate_tz() into a POSIX timestamp.rN�)r)�time�mktime�calendarZtimegmr5rrrr�s
cCs|�dd��dd�S)z�Prepare string to be used in a quoted string.

    Turns backslash and double quote characters into quoted pairs.  These
    are the only characters that need to be quoted inside a quoted string.
    Does not add the surrounding double quotes.
    �\z\\�"z\")�replace)�strrrrr�sc@s|eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
ddd�Zdd�Zdd�Z
dd�Zddd�Zdd�ZdS) �
AddrlistClassaAddress parser class by Ben Escoto.

    To understand what this class does, it helps to have a copy of RFC 2822 in
    front of you.

    Note: this class interface is deprecated and may be removed in the future.
    Use email.utils.AddressList instead.
    cCsZd|_d|_d|_d|_|j|j|_|j|j|j|_|j�dd�|_||_g|_	dS)z�Initialize a new instance.

        `field' is an unparsed address header field, containing
        one or more addresses.
        z()<>@,:;."[]rz 	z
rrN)
�specials�pos�LWSZCR�FWS�atomendsr=�
phraseends�field�commentlist��selfrFrrr�__init__�szAddrlistClass.__init__cCs�g}|jt|j�kr�|j|j|jdkr\|j|jdkrL|�|j|j�|jd7_q|j|jdkr�|j�|���qq�qt�|�S)z&Skip white space and extract comments.z

r�()	rAr'rFrBr)rG�
getcomment�EMPTYSTRING�join)rIZwslistrrr�gotonext�szAddrlistClass.gotonextcCs:g}|jt|j�kr6|��}|r*||7}q|�d�q|S)zVParse all addresses.

        Returns a list containing all of the addresses.
        )rr)rAr'rF�
getaddressr))rI�resultZadrrr�getaddrlist�s
zAddrlistClass.getaddrlistcCs�g|_|��|j}|j}|��}|��g}|jt|j�kr\|rXt�|j�|dfg}�n\|j|jdkr�||_||_|��}t�|j�|fg}�n"|j|jdk�rg}t|j�}|jd7_|jt|j�k�r�|��|j|k�r|j|jdk�r|jd7_�q�||�	�}q�n�|j|jdk�rx|�
�}|j�rft�|�dd�|j�d	|fg}nt�|�|fg}n@|�r�t�|j�|dfg}n"|j|j|jk�r�|jd7_|��|jt|j�k�r�|j|jd
k�r�|jd7_|S)zParse the next address.rz.@rr�;�<z (r�)r)rGrOrA�
getphraselistr'rF�SPACErN�getaddrspecrP�getrouteaddrr@)rIZoldposZoldcl�plistZ
returnlistZaddrspecZfieldlenZ	routeaddrrrrrPsX

���$zAddrlistClass.getaddresscCs�|j|jdkrdSd}|jd7_|��d}|jt|j�kr�|rT|��d}n~|j|jdkrv|jd7_q�n\|j|jdkr�|jd7_d}n8|j|jd	kr�|jd7_n|��}|jd7_q�|��q2|S)
z�Parse a route address (Return-path value).

        This method just skips all the route stuff and returns the addrspec.
        rTNFrr�>�@Tr)rFrArOr'�	getdomainrX)rIZexpectrouteZadlistrrrrYAs.
zAddrlistClass.getrouteaddrcCsTg}|��|jt|j�kr�d}|j|jdkrf|rH|d��sH|��|�d�|jd7_d}nd|j|jdkr�|�dt|����n<|j|j|j	kr�|r�|d��s�|��q�n|�|�
��|��}|r|r|�|�q|jt|j�k�s
|j|jdk�rt�|�S|�d�|jd7_|��|�
�}|�sFtSt�|�|S)	zParse an RFC 2822 addr-spec.TrrrFr<z"%s"r\)rOrAr'rF�strip�popr)r�getquoterD�getatomrMrNr])rIZaslistZpreserve_wsZwsZdomainrrrrXas:
$

zAddrlistClass.getaddrspeccCs�g}|jt|j�kr�|j|j|jkr6|jd7_q|j|jdkrX|j�|���q|j|jdkrx|�|���q|j|jdkr�|jd7_|�d�q|j|jdkr�tS|j|j|j	kr�q�q|�|�
��qt�|�S)z-Get the complete domain name from an address.rrK�[rr\)rAr'rFrBrGr)rL�getdomainliteralrMrDrarN)rIZsdlistrrrr]�s"zAddrlistClass.getdomainTcCs�|j|j|krdSdg}d}|jd7_|jt|j�kr�|rX|�|j|j�d}np|j|j|krz|jd7_q�nN|r�|j|jdkr�|�|���q,n(|j|jdkr�d}n|�|j|j�|jd7_q,t�|�S)a�Parse a header fragment delimited by special characters.

        `beginchar' is the start character for the fragment.
        If self is not looking at an instance of `beginchar' then
        getdelimited returns the empty string.

        `endchars' is a sequence of allowable end-delimiting characters.
        Parsing stops when one of these is encountered.

        If `allowcomments' is non-zero, embedded RFC 2822 comments are allowed
        within the parsed fragment.
        rFrrKr;T)rFrAr'r)rLrMrN)rIZ	begincharZendcharsZ
allowcommentsZslistrrrr�getdelimited�s(
zAddrlistClass.getdelimitedcCs|�ddd�S)z1Get a quote-delimited fragment from self's field.r<z"
F�rd�rIrrrr`�szAddrlistClass.getquotecCs|�ddd�S)z7Get a parenthesis-delimited fragment from self's field.rKz)
TrerfrrrrL�szAddrlistClass.getcommentcCsd|�ddd�S)z!Parse an RFC 2822 domain-literal.z[%s]rbz]
Frerfrrrrc�szAddrlistClass.getdomainliteralNcCsddg}|dkr|j}|jt|j�krZ|j|j|kr8qZn|�|j|j�|jd7_qt�|�S)aParse an RFC 2822 atom.

        Optional atomends specifies a different set of end token delimiters
        (the default is to use self.atomends).  This is used e.g. in
        getphraselist() since phrase endings must not include the `.' (which
        is legal in phrases).rNr)rDrAr'rFr)rMrN)rIrDZatomlistrrrra�szAddrlistClass.getatomcCs�g}|jt|j�kr�|j|j|jkr6|jd7_q|j|jdkrV|�|���q|j|jdkrx|j�|���q|j|j|jkr�q�q|�|�	|j��q|S)z�Parse a sequence of RFC 2822 phrases.

        A phrase is a sequence of words, which are in turn either RFC 2822
        atoms or quoted-strings.  Phrases are canonicalized by squeezing all
        runs of continuous whitespace into one space.
        rr<rK)
rAr'rFrCr)r`rGrLrEra)rIrZrrrrV�szAddrlistClass.getphraselist)T)N)�__name__�
__module__�__qualname__�__doc__rJrOrRrPrYrXr]rdr`rLrcrarVrrrrr?�s	; &
%
r?c@sHeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)�AddressListz@An AddressList encapsulates a list of parsed RFC 2822 addresses.cCs&t�||�|r|��|_ng|_dS�N)r?rJrR�addresslistrHrrrrJ�szAddressList.__init__cCs
t|j�Srl)r'rmrfrrr�__len__szAddressList.__len__cCs>td�}|jdd�|_|jD]}||jkr|j�|�q|Srl�rkrmr)�rI�otherZnewaddr�xrrr�__add__s

zAddressList.__add__cCs&|jD]}||jkr|j�|�q|Srl)rmr)�rIrqrrrrr�__iadd__s

zAddressList.__iadd__cCs.td�}|jD]}||jkr|j�|�q|Srlrorprrr�__sub__s


zAddressList.__sub__cCs&|jD]}||jkr|j�|�q|Srl)rm�removertrrr�__isub__s

zAddressList.__isub__cCs
|j|Srl)rm)rIr+rrr�__getitem__%szAddressList.__getitem__N)rgrhrirjrJrnrsrurvrxryrrrrrk�s	rk)rj�__all__r8r:rWrMZ
COMMASPACEr*r%r0rrrrrr?rkrrrr�<module>sd���	w	

/email/__pycache__/generator.cpython-38.opt-2.pyc000064400000021173151153537640015437 0ustar00U

e5d�N�@s�dddgZddlZddlZddlZddlZddlmZddlmZm	Z	ddl
mZdZd	Z
e�d
�Ze�dej�ZGdd�d�ZGd
d�de�ZdZGdd�de�Zeeejd��ZdeZejZdS)�	Generator�DecodedGenerator�BytesGenerator�N)�deepcopy)�StringIO�BytesIO)�_has_surrogates�_�
z
\r\n|\r|\nz^From c@s�eZdZd&dd�dd�Zdd�Zd'dd	�Zd
d�Zdd
�Zdd�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
e
Zdd�Zdd�Zdd�Zd d!�Zed(d"d#��Zed$d%��ZdS))rN��policycCs6|dkr|dkrdn|j}||_||_||_||_dS)NT)�mangle_from_�_fp�
_mangle_from_�maxheaderlenr)�self�outfpr
rr�r�'/usr/lib64/python3.8/email/generator.py�__init__$szGenerator.__init__cCs|j�|�dS�N)r�write�r�srrrrDszGenerator.writeFcCs�|jdkr|jn|j}|dk	r*|j|d�}|jdk	rB|j|jd�}|j|_|�|j�|_d|_|�|j�|_|j}|j}zL||_||_|r�|�	�}|s�dt
�t
�
��}|�||j�|�
|�W5||_||_XdS)N)�linesep�Zmax_line_length�zFrom nobody )r�clonerr�_NL�_encode�_encoded_NLZ_EMPTY�_encoded_EMPTYZget_unixfrom�time�ctimer�_write)r�msg�unixfromrrZold_gen_policyZold_msg_policyZufromrrr�flattenHs,
zGenerator.flattencCs|j||jd|jd�S�Nr)�	__class__rr)r�fprrrrys
�zGenerator.clonecCst�Sr)r�rrrr�_new_buffer�szGenerator._new_buffercCs|Srrrrrrr�szGenerator._encodecCsT|sdSt�|�}|dd�D]}|�|�|�|j�q|drP|�|d�dS)N���)�NLCRE�splitrr)r�lines�linerrr�_write_lines�s

zGenerator._write_linescCs�|j}z"d|_|��|_}|�|�W5||_|j}|`X|r�t|�}|�d�dkrd|d|d<n|�d|d�|�d|d�t|dd�}|dkr�|�|�n||�|j�	|�
��dS)N�content-transfer-encodingr�Content-Transfer-Encoding�content-type��_write_headers)r�
_munge_cter,�	_dispatchr�getZreplace_header�getattrr7r�getvalue)rr%ZoldfpZ	munge_cteZsfp�methrrrr$�s&zGenerator._writecCst|��}|��}t�||f��dd�}t|d|d�}|dkrh|�dd�}t|d|d�}|dkrh|j}||�dS)N�-r	Z_handle_)�get_content_maintype�get_content_subtype�
UNDERSCORE�join�replacer;�
_writeBody)rr%�main�subZspecificr=Zgenericrrrr9�szGenerator._dispatchcCs6|��D]\}}|�|j�||��q|�|j�dSr)�	raw_itemsrrZfoldr�rr%�h�vrrrr7�szGenerator._write_headerscCs�|��}|dkrdSt|t�s.tdt|���t|j�r~|�d�}|dk	r~t|�}|d=|�	||�|��}|d|df|_
|jr�t�
d|�}|�|�dS)Nzstring payload expected: %s�charsetr3r5�>From )�get_payload�
isinstance�str�	TypeError�typer�_payloadZ	get_paramrZset_payloadr8r�fcrerFr2)rr%�payloadrKrrr�_handle_text�s$


�zGenerator._handle_textcCs�g}|��}|dkrg}n(t|t�r2|�|�dSt|t�sB|g}|D]6}|��}|�|�}|j|d|jd�|�	|�
��qF|��}|s�|j�
|�}|�|�}|�|�|jdk	r�|jr�t�d|j�}	n|j}	|�|	�|�|j�|�d||j�|�r|j�|�d��|D],}
|�|jd||j�|j�|
��q|�|jd|d|j�|jdk	�r�|j�r�t�d|j�}n|j}|�|�dS)NF�r&rrLz--r)rMrNrOr�listr,rr'r�appendr<Zget_boundaryr rB�_make_boundaryZset_boundary�preamblerrSrFr2r�pop�epilogue)rr%ZmsgtextsZsubparts�partr�g�boundaryZalltextrZZ	body_partr\rrr�_handle_multipartsJ







zGenerator._handle_multipartcCs0|j}|jdd�|_z|�|�W5||_XdS)Nrr)rrr`)rr%�prrr�_handle_multipart_signed<s
z"Generator._handle_multipart_signedcCs�g}|��D]t}|��}|�|�}|j|d|jd�|��}|�|j�}|rv|d|jkrv|�	|j�
|dd���q|�	|�q|j�|j�
|��dS)NFrVr-)
rMr,rr'rr<r/r r!rXrBrr)rr%Zblocksr]rr^�textr0rrr�_handle_message_delivery_statusGs
z)Generator._handle_message_delivery_statuscCs^|��}|�|�}|j}t|t�rD|j|�d�d|jd�|��}n
|�	|�}|j
�|�dS)NrFrV)r,rrRrNrWr'rMrr<rrr)rr%rr^rTrrr�_handle_message\s




zGenerator._handle_messagecCsvt�tj�}dt|d}|dkr(|S|}d}|�dt�|�dtj�}|�	|�sXqr|dt
|�}|d7}q0|S)Nz===============z==rz^--z(--)?$�.r6)�randomZ	randrange�sys�maxsize�_fmt�_compile_re�re�escape�	MULTILINE�searchrO)�clsrc�tokenr_�bZcounterZcrerrrrYus

zGenerator._make_boundarycCst�||�Sr)rl�compile�rpr�flagsrrrrk�szGenerator._compile_re)NN)FN)N)�__name__�
__module__�__qualname__rrr'rr,rr2r$r9r7rUrDr`rbrdre�classmethodrYrkrrrrrs,
� 
1'
:csLeZdZdd�Zdd�Zdd�Zdd�Z�fd	d
�ZeZe	dd��Z
�ZS)
rcCs|j�|�dd��dS)N�ascii�surrogateescape)rr�encoderrrrr�szBytesGenerator.writecCst�Sr)rr+rrrr,�szBytesGenerator._new_buffercCs
|�d�S�Nrz)r|rrrrr�szBytesGenerator._encodecCs8|��D]\}}|j�|j�||��q|�|j�dSr)rGrrrZfold_binaryrrHrrrr7�szBytesGenerator._write_headerscs\|jdkrdSt|j�rH|jjdksH|jr:t�d|j�|_|�|j�ntt	|��
|�dS)NZ7bitrL)rRrrZcte_typerrSrFr2�superrrU)rr%�r)rrrU�s
zBytesGenerator._handle_textcCst�|�d�|�Sr})rlrsr|rtrrrrk�szBytesGenerator._compile_re)rvrwrxrr,rr7rUrDryrk�
__classcell__rrrrr�s

zD[Non-text (%(type)s) part of message omitted, filename %(filename)s]c@s$eZdZddd�dd�Zdd�ZdS)rNrcCs.tj|||||d�|dkr$t|_n||_dSr()rr�_FMTrj)rrr
rZfmtrrrrr�s�zDecodedGenerator.__init__cCs�|��D]v}|��}|dkr2t|jdd�|d�q|dkr<qt|j|��|��|��|�d�|�dd�|�d	d
�d�|d�qdS)NrcF)�decode)�fileZ	multipartz
[no filename]zContent-Descriptionz[no description]r4z
[no encoding])rQ�maintypeZsubtype�filenameZdescription�encoding)	�walkr?�printrMrjZget_content_typer@�get_filenamer:)rr%r]r�rrrr9�s(���	�zDecodedGenerator._dispatch)NNN)rvrwrxrr9rrrrr�s�r6z%%0%dd)�__all__rlrhr"rg�copyr�iorrZemail.utilsrrA�NLrsr.rnrSrrr�r�len�reprriZ_widthrjrYrrrr�<module>s(

t3;email/__pycache__/feedparser.cpython-38.opt-1.pyc000064400000024374151153537640015576 0ustar00U

e5d�X�@s�dZddgZddlZddlmZddlmZddlmZddl	m
Z
e�d	�Ze�d
�Z
e�d�Ze�d
�Ze�d�Zd
ZdZe�ZGdd�de�ZGdd�d�ZGdd�de�ZdS)aFeedParser - An email feed parser.

The feed parser implements an interface for incrementally parsing an email
message, line by line.  This has advantages for certain applications, such as
those reading email messages off a socket.

FeedParser.feed() is the primary interface for pushing new data into the
parser.  It returns when there's nothing more it can do with the available
data.  When you have no more data to push into the parser, call .close().
This completes the parsing and returns the root message object.

The other advantage of this parser is that it will never raise a parsing
exception.  Instead, when it finds something unexpected, it adds a 'defect' to
the current message.  Defects are just instances that live on the message
object's .defects attribute.
�
FeedParser�BytesFeedParser�N)�errors)�compat32)�deque)�StringIOz
\r\n|\r|\nz(\r\n|\r|\n)z(\r\n|\r|\n)\Zz%^(From |[\041-\071\073-\176]*:|[\t ])��
c@s`eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�BufferedSubFileakA file-ish object that can have new data loaded into it.

    You can also push and pop line-matching predicates onto a stack.  When the
    current predicate matches the current line, a false EOF response
    (i.e. empty string) is returned instead.  This lets the parser adhere to a
    simple abstraction -- it parses until EOF closes the current message.
    cCs$tdd�|_t�|_g|_d|_dS)Nr)�newlineF)r�_partialr�_lines�	_eofstack�_closed��self�r�(/usr/lib64/python3.8/email/feedparser.py�__init__5szBufferedSubFile.__init__cCs|j�|�dS�N)r�append)rZpredrrr�push_eof_matcher@sz BufferedSubFile.push_eof_matchercCs
|j��Sr)r�poprrrr�pop_eof_matcherCszBufferedSubFile.pop_eof_matchercCs<|j�d�|�|j���|j�d�|j��d|_dS)NrT)r�seek�	pushlines�	readlines�truncaterrrrr�closeFs

zBufferedSubFile.closecCsL|js|jrdStS|j��}t|j�D]}||�r(|j�|�dSq(|S�Nr)r
r�NeedMoreData�popleft�reversedr�
appendleft)r�lineZateofrrr�readlineNs
zBufferedSubFile.readlinecCs|j�|�dSr)r
r#�rr$rrr�
unreadline`szBufferedSubFile.unreadlinecCsx|j�|�d|kr d|kr dS|j�d�|j��}|j�d�|j��|d�d�sj|j�|���|�|�dS)z$Push some new data into this object.r	�
Nr���)r�writerrr�endswithrr)r�data�partsrrr�pushes

zBufferedSubFile.pushcCs|j�|�dSr)r
�extend)r�linesrrrrzszBufferedSubFile.pushlinescCs|Srrrrrr�__iter__}szBufferedSubFile.__iter__cCs|��}|dkrt�|Sr)r%�
StopIterationr&rrr�__next__�szBufferedSubFile.__next__N)�__name__�
__module__�__qualname__�__doc__rrrrr%r'r.rr1r3rrrrr
-sr
c@s`eZdZdZded�dd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dS)rzA feed-style parser of email.N��policycCs�||_d|_|dkr<|jdkr2ddlm}||_qn|j|_n2||_z||jd�Wntk
rld|_YnXt�|_g|_	|�
�j|_d|_
d|_d|_dS)a_factory is called with no arguments to create a new message obj

        The policy keyword specifies a policy object that controls a number of
        aspects of the parser's operation.  The default policy maintains
        backward compatibility.

        FNr)�Messager8T)r9�_old_style_factoryZmessage_factoryZ
email.messager:�_factory�	TypeErrorr
�_input�	_msgstack�	_parsegenr3�_parse�_cur�_last�_headersonly)rr<r9r:rrrr�s$

zFeedParser.__init__cCs
d|_dS)NT)rDrrrr�_set_headersonly�szFeedParser._set_headersonlycCs|j�|�|��dS)zPush more data into the parser.N)r>r.�_call_parse�rr,rrr�feed�szFeedParser.feedcCs&z|��Wntk
r YnXdSr)rAr2rrrrrF�szFeedParser._call_parsecCsH|j��|��|��}|��dkrD|��sDt��}|j�	||�|S)z<Parse all remaining data and return the root message object.�	multipart)
r>rrF�_pop_message�get_content_maintypeZis_multipartrZ!MultipartInvariantViolationDefectr9�
handle_defect)r�root�defectrrrr�s
�zFeedParser.closecCsn|jr|��}n|j|jd�}|jr<|j��dkr<|�d�|jrR|jd�|�|j�|�||_||_	dS)Nr8zmultipart/digestzmessage/rfc822r))
r;r<r9rB�get_content_typeZset_default_typer?ZattachrrC)r�msgrrr�_new_message�s

zFeedParser._new_messagecCs(|j��}|jr|jd|_nd|_|S)Nr))r?rrB)r�retvalrrrrJ�s

zFeedParser._pop_messageccs|��g}|jD]Z}|tkr&tVqt�|�sbt�|�s^t��}|j�	|j
|�|j�|�qn|�|�q|�
|�|jr�g}|j��}|tkr�tVq�|dkr�q�|�|�q�|j
�t�|��dS|j
��dk�r�|j�tj�|��D]}|tk�rtVq��qq�|��}|j��|j��}|tk�rDtV�q�qD�q|j��}|tk�rjtV�qD�qj�qD|dk�rx�q�|j�|�q�dS|j
��dk�r�|��D] }|tk�r�tV�q��qĐq�|��dS|j
��dk�r�|j
��}|dk�rRt��}|j�	|j
|�g}|jD]$}|tk�r.tV�q|�|��q|j
�t�|��dSt|j
�dd����dk�r�t��}|j�	|j
|�d|}t� d	t�!|�d
�}	d}
g}d}d}
|j��}|tk�r�tV�q�|dk�r�q�|	�|�}|�r�|�"d
��rd}
|�"d�}�q�|
�rr|�r^|d}t#�$|�}|�rP|dt%|�"d���|d<t�|�|j
_&d}
|j�|��q�|j��}|tk�r�tV�qr|	�|�}|�sr|j�|��q��qr|j�|	j�|��D] }|tk�r�tV�q��q�q�|j'��dk�rT|j'j(}|dk�rd|j'_(n:|dk	�r�t#�$|�}|�r�t%|�"d��}|d|�|j'_(nD|j'j)}t*|t��r�t#�$|�}|�r�|dt%|�"d���}||j'_)|j��|��|j
|_'n
|�|��q�|
�r*t�+�}|j�	|j
|�|j
�t�|��g}|jD]}|tk�r�tV�q��q�t�|�|j
_(dS|
�sLt�,�}|j�	|j
|�dS|�rZdg}ng}|jD]$}|tk�r|tV�qd|�|��qd|�r�|d}t-�|�}|�r�|t%|�"d��d�|d<t�|�|j
_(dSg}|jD]$}|tk�r�tV�q�|�|��q�|j
�t�|��dS)Nrzmessage/delivery-status�messagerIzcontent-transfer-encoding�8bit)Z7bitrTZbinaryz--z(?P<sep>z4)(?P<end>--)?(?P<ws>[ \t]*)(?P<linesep>\r\n|\r|\n)?$TF�end�linesepr)r).rQr>r �headerRE�match�NLCRErZ MissingHeaderBodySeparatorDefectr9rLrBr'r�_parse_headersrDr%Zset_payload�EMPTYSTRING�joinrOrr@rJrrKZget_boundaryZNoBoundaryInMultipartDefect�str�get�lowerZ-InvalidMultipartContentTransferEncodingDefect�re�compile�escape�group�	NLCRE_eol�search�len�preamblerC�epilogueZ_payload�
isinstanceZStartBoundaryNotFoundDefectZCloseBoundaryNotFoundDefect�	NLCRE_bol)rZheadersr$rNr0rRrP�boundaryZ	separatorZ
boundaryreZcapturing_preamblergrVZclose_boundary_seen�moZlastlineZeolmorhrUZpayload�	firstlineZbolmorrrr@�s`

















���
























zFeedParser._parsegenc	CsXd}g}t|�D�]&\}}|ddkrR|sFt�|�}|j�|j|�q|�|�q|rt|jj|j�|��dg}}|�	d�r�|dkr�t
�|�}|r�|dt|�
d���}|j�|�qn<|t|�dkr�|j�|�dSt�|�}|jj�|�q|�d�}|dk�r&t�d�}|jj�|�q|d|�}|g}q|�rT|jj|j�|��dS)Nrrz 	zFrom ��:zMissing header name.)�	enumeraterZ#FirstHeaderLineIsContinuationDefectr9rLrBrZset_rawZheader_source_parse�
startswithrdrerfrcZset_unixfromr>r'ZMisplacedEnvelopeHeaderDefectZdefects�findZInvalidHeaderDefect)	rr0Z
lastheaderZ	lastvalue�linenor$rNrl�irrrrZ�sF








zFeedParser._parse_headers)N)r4r5r6r7rrrErHrFrrQrJr@rZrrrrr�s

~cs eZdZdZ�fdd�Z�ZS)rz(Like FeedParser, but feed accepts bytes.cst��|�dd��dS)N�ascii�surrogateescape)�superrH�decoderG��	__class__rrrHszBytesFeedParser.feed)r4r5r6r7rH�
__classcell__rrryrrs)r7�__all__r`ZemailrZemail._policybaser�collectionsr�iorrarYrjrdZNLCRE_crackrWr[�NL�objectr r
rrrrrr�<module>s(




[email/__pycache__/quoprimime.cpython-38.opt-1.pyc000064400000017000151153537640015631 0ustar00U

e5d�&�
@sXdZddddddddd	d
g
ZddlZdd
lmZmZmZdZdZdZ	dd�e
d�D�Zedd�Zedd�Z
de�d�e�d�D]Zee�ee<q�deed�<dD]Zee�e
e<q�dd�Zdd�Zdd�Zdd�Zd,dd �Zd!d
�Zd"d	�Zd-d$d�Ze
dd�Zd%D]Zee�ee<�qd&efd'd�Zefd(d�ZeZeZd)d*�Zd+d�Z dS).aFQuoted-printable content transfer encoding per RFCs 2045-2047.

This module handles the content transfer encoding method defined in RFC 2045
to encode US ASCII-like 8-bit data called `quoted-printable'.  It is used to
safely encode text that is in a character set similar to the 7-bit US ASCII
character set, but that includes some 8-bit characters that are normally not
allowed in email bodies or headers.

Quoted-printable is very space-inefficient for encoding binary files; use the
email.base64mime module for that instead.

This module provides an interface to encode and decode both headers and bodies
with quoted-printable encoding.

RFC 2045 defines a method for including character set information in an
`encoded-word' in a header.  This method is commonly used for 8-bit real names
in To:/From:/Cc: etc. fields, as well as Subject: lines.

This module does not do the line wrapping or end-of-line character
conversion necessary for proper internationalized headers; it only
does dumb encoding and decoding.  To deal with the various line
wrapping issues, use the email.header module.
�body_decode�body_encode�body_length�decode�decodestring�
header_decode�
header_encode�
header_length�quote�unquote�N)�
ascii_letters�digits�	hexdigits�
�
�cCsg|]}d|�qS)z=%02X�)�.0�crr�(/usr/lib64/python3.8/email/quoprimime.py�
<listcomp>7sr�s-!*+/�ascii�_� s_ !"#$%&'()*+,-./0123456789:;<>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~	cCst|�t|kS)z>Return True if the octet should be escaped with header quopri.)�chr�_QUOPRI_HEADER_MAP��octetrrr�header_checkJsrcCst|�t|kS)z<Return True if the octet should be escaped with body quopri.)r�_QUOPRI_BODY_MAPrrrr�
body_checkOsr!cCstdd�|D��S)a:Return a header quoted-printable encoding length.

    Note that this does not include any RFC 2047 chrome added by
    `header_encode()`.

    :param bytearray: An array of bytes (a.k.a. octets).
    :return: The length in bytes of the byte array when it is encoded with
        quoted-printable for headers.
    css|]}tt|�VqdS�N)�lenr�rrrrr�	<genexpr>^sz header_length.<locals>.<genexpr>��sum��	bytearrayrrrrTs
cCstdd�|D��S)z�Return a body quoted-printable encoding length.

    :param bytearray: An array of bytes (a.k.a. octets).
    :return: The length in bytes of the byte array when it is encoded with
        quoted-printable for bodies.
    css|]}tt|�VqdSr")r#r r$rrrr%hszbody_length.<locals>.<genexpr>r&r(rrrrascCsft|t�st|�}|s&|�|���n<t|d�t|�|krT|d||7<n|�|���dS)N���)�
isinstance�strr�append�lstripr#)�L�s�maxlenZextrarrr�_max_appendks
r2cCstt|dd�d��S)zDTurn a string in the form =AB to the ASCII character with value 0xab���)r�int�r0rrrr
vscCstt|�Sr")�_QUOPRI_MAP�ord)rrrrr	{s�
iso-8859-1cCs$|sdS|�d��t�}d||fS)a�Encode a single header line with quoted-printable (like) encoding.

    Defined in RFC 2045, this `Q' encoding is similar to quoted-printable, but
    used specifically for email header fields to allow charsets with mostly 7
    bit characters (and some 8 bit) to remain more or less readable in non-RFC
    2045 aware mail clients.

    charset names the character set to use in the RFC 2046 header.  It
    defaults to iso-8859-1.
    r�latin1z=?%s?q?%s?=)r�	translater)Zheader_bytes�charset�encodedrrrrss
�Lc
Cs�|dkrtd��|s|S|�t�}d|}|d}g}|j}|��D�]}d}t|�d|}	||	kr�||}
||
ddkr�||||
d��|
d}q^||
ddkr�||||
��|
d}q^||||
�d�|
}q^|�rR|ddk�rR||	}|d	k�rt|d�}n(|dk�r,|d|}n|t|d�}|||d�|�qD|||d
��qD|dtk�rz|d�|�|�S)a�Encode with quoted-printable, wrapping at maxlinelen characters.

    Each line of encoded text will end with eol, which defaults to "\n".  Set
    this to "\r\n" if you will be using the result of this function directly
    in an email.

    Each line will be wrapped at, at most, maxlinelen characters before the
    eol string (maxlinelen defaults to 76 characters, the maximum value
    permitted by RFC 2045).  Long lines will have the 'soft line break'
    quoted-printable character "=" appended to them, so the decoded text will
    be identical to the original text.

    The minimum maxlinelen is 4 to have room for a quoted character ("=XX")
    followed by a soft line break.  Smaller values will generate a
    ValueError.

    �zmaxlinelen must be at least 4�=r3r�r*z 	r4Nr)	�
ValueErrorr<�_QUOPRI_BODY_ENCODE_MAPr-�
splitlinesr#r	�CRLF�join)
ZbodyZ
maxlinelen�eolZ
soft_breakZmaxlinelen1Zencoded_bodyr-�line�startZ	laststart�stopZroom�qrrrr�sD




cCs|s|Sd}|��D]�}|��}|s.||7}qd}t|�}||kr||}|dkrd||7}|d7}nv|d|kr||d7}q:n^|d|kr�||dtkr�||dtkr�|t|||d��7}|d7}n||7}|d7}||kr:||7}q:q|ddk�r|�|��r|d	d�}|S)
z_Decode a quoted-printable string.

    Lines are separated with eol, which defaults to \n.
    rrrAr3rBr4r*rN)rE�rstripr#rr
�endswith)r>rHZdecodedrI�i�nrrrrr�s8
,
cCs|�d�}t|�S)zCTurn a match in the form =AB to the ASCII character with value 0xabr)�groupr
)�matchr0rrr�_unquote_matchs
rScCs |�dd�}tjdt|tjd�S)aDecode a string encoded with RFC 2045 MIME header `Q' encoding.

    This function does not parse a full MIME header value encoded with
    quoted-printable (like =?iso-8859-1?q?Hello_World?=) -- please use
    the high level email.header class for that functionality.
    rrz=[a-fA-F0-9]{2})�flags)�replace�re�subrS�ASCIIr7rrrr#s)r)r:)!�__doc__�__all__rV�stringrr
rrF�NLZEMPTYSTRING�ranger8rr �encoderrr9rr!rrr2r
r	rrDrrrrrSrrrrr�<module>sR�




O0email/__pycache__/parser.cpython-38.pyc000064400000013134151153537640014003 0ustar00U

e5d��@s�dZddddddgZddlmZmZdd	lmZmZdd
lm	Z	Gdd�d�Z
Gdd�de
�ZGd
d�d�ZGdd�de�Z
dS)z-A parser of RFC 2822 and MIME email messages.�Parser�HeaderParser�BytesParser�BytesHeaderParser�
FeedParser�BytesFeedParser�)�StringIO�
TextIOWrapper)rr)�compat32c@s0eZdZd
ed�dd�Zddd�Zddd	�ZdS)
rN��policycCs||_||_dS)a�Parser of RFC 2822 and MIME email messages.

        Creates an in-memory object tree representing the email message, which
        can then be manipulated and turned over to a Generator to return the
        textual representation of the message.

        The string must be formatted as a block of RFC 2822 headers and header
        continuation lines, optionally preceded by a `Unix-from' header.  The
        header block is terminated either by the end of the string or by a
        blank line.

        _class is the class to instantiate for new message objects when they
        must be created.  This class must have a constructor that can take
        zero arguments.  Default is Message.Message.

        The policy keyword specifies a policy object that controls a number of
        aspects of the parser's operation.  The default policy maintains
        backward compatibility.

        N)�_classr)�selfr
r�r�$/usr/lib64/python3.8/email/parser.py�__init__szParser.__init__FcCs@t|j|jd�}|r|��|�d�}|s,q8|�|�q|��S)a\Create a message structure from the data in a file.

        Reads all the data from the file and returns the root of the message
        structure.  Optional headersonly is a flag specifying whether to stop
        parsing after reading the headers or not.  The default is False,
        meaning it parses the entire contents of the file.
        ri )rr
rZ_set_headersonly�readZfeed�close)r�fp�headersonlyZ
feedparser�datarrr�parse)s
zParser.parsecCs|jt|�|d�S)a-Create a message structure from a string.

        Returns the root of the message structure.  Optional headersonly is a
        flag specifying whether to stop parsing after reading the headers or
        not.  The default is False, meaning it parses the entire contents of
        the file.
        �r)rr�r�textrrrr�parsestr;szParser.parsestr)N)F)F)�__name__�
__module__�__qualname__r
rrrrrrrrs
c@s eZdZddd�Zddd�ZdS)	rTcCst�||d�S�NT)rr�rrrrrrrHszHeaderParser.parsecCst�||d�Sr)rrrrrrrKszHeaderParser.parsestrN)T)T)rrrrrrrrrrGs
c@s(eZdZdd�Zd	dd�Zd
dd�ZdS)rcOst||�|_dS)a�Parser of binary RFC 2822 and MIME email messages.

        Creates an in-memory object tree representing the email message, which
        can then be manipulated and turned over to a Generator to return the
        textual representation of the message.

        The input must be formatted as a block of RFC 2822 headers and header
        continuation lines, optionally preceded by a `Unix-from' header.  The
        header block is terminated either by the end of the input or by a
        blank line.

        _class is the class to instantiate for new message objects when they
        must be created.  This class must have a constructor that can take
        zero arguments.  Default is Message.Message.
        N)r�parser)r�args�kwrrrrQszBytesParser.__init__FcCs0t|ddd�}z|j�||�W�S|��XdS)acCreate a message structure from the data in a binary file.

        Reads all the data from the file and returns the root of the message
        structure.  Optional headersonly is a flag specifying whether to stop
        parsing after reading the headers or not.  The default is False,
        meaning it parses the entire contents of the file.
        �ascii�surrogateescape)�encoding�errorsN)r	�detachr!rr rrrrcszBytesParser.parsecCs|jddd�}|j�||�S)a2Create a message structure from a byte string.

        Returns the root of the message structure.  Optional headersonly is a
        flag specifying whether to stop parsing after reading the headers or
        not.  The default is False, meaning it parses the entire contents of
        the file.
        �ASCIIr%)r')�decoder!rrrrr�
parsebytesrszBytesParser.parsebytesN)F)F)rrrrrr+rrrrrOs
c@s eZdZddd�Zddd�ZdS)	rTcCstj||dd�S�NTr)rrr rrrrszBytesHeaderParser.parsecCstj||dd�Sr,)rr+rrrrr+�szBytesHeaderParser.parsebytesN)T)T)rrrrr+rrrrr~s
N)�__doc__�__all__�iorr	Zemail.feedparserrrZemail._policybaser
rrrrrrrr�<module>s�7/email/__pycache__/errors.cpython-38.pyc000064400000013423151153537640014024 0ustar00U

e5d?�@s�dZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGd	d
�d
ee�ZGdd�de�ZGd
d�de	�Z
Gdd�de
�ZGdd�de
�ZGdd�de
�Z
Gdd�de
�ZGdd�de
�ZGdd�de
�ZeZGdd�de
�ZGdd�de
�ZGdd �d e
�ZGd!d"�d"e
�ZGd#d$�d$e
�ZGd%d&�d&e
�ZGd'd(�d(e
�ZGd)d*�d*e�ZGd+d,�d,e�ZGd-d.�d.e�ZGd/d0�d0e�ZGd1d2�d2e�Zd3S)4z email package exception classes.c@seZdZdZdS)�MessageErrorz+Base class for errors in the email package.N��__name__�
__module__�__qualname__�__doc__�rr�$/usr/lib64/python3.8/email/errors.pyrsrc@seZdZdZdS)�MessageParseErrorz&Base class for message parsing errors.Nrrrrrr	sr	c@seZdZdZdS)�HeaderParseErrorzError while parsing headers.Nrrrrrr
sr
c@seZdZdZdS)�
BoundaryErrorz#Couldn't find terminating boundary.Nrrrrrrsrc@seZdZdZdS)�MultipartConversionErrorz(Conversion to a multipart is prohibited.Nrrrrrrsrc@seZdZdZdS)�CharsetErrorzAn illegal charset was given.Nrrrrrr
sr
cs"eZdZdZd�fdd�	Z�ZS)�
MessageDefectz Base class for a message defect.Ncs|dk	rt��|�||_dS�N)�super�__init__�line)�selfr��	__class__rrr$szMessageDefect.__init__)N�rrrrr�
__classcell__rrrrr!src@seZdZdZdS)�NoBoundaryInMultipartDefectzBA message claimed to be a multipart but had no boundary parameter.Nrrrrrr)src@seZdZdZdS)�StartBoundaryNotFoundDefectz+The claimed start boundary was never found.Nrrrrrr,src@seZdZdZdS)�CloseBoundaryNotFoundDefectzEA start boundary was found, but not the corresponding close boundary.Nrrrrrr/src@seZdZdZdS)�#FirstHeaderLineIsContinuationDefectz;A message had a continuation line as its first header line.Nrrrrrr2src@seZdZdZdS)�MisplacedEnvelopeHeaderDefectz?A 'Unix-from' header was found in the middle of a header block.Nrrrrrr5src@seZdZdZdS)� MissingHeaderBodySeparatorDefectzEFound line with no leading whitespace and no colon before blank line.Nrrrrrr8src@seZdZdZdS)�!MultipartInvariantViolationDefectz?A message claimed to be a multipart but no subparts were found.Nrrrrrr=src@seZdZdZdS)�-InvalidMultipartContentTransferEncodingDefectzEAn invalid content transfer encoding was set on the multipart itself.Nrrrrrr@src@seZdZdZdS)�UndecodableBytesDefectz0Header contained bytes that could not be decodedNrrrrrr Csr c@seZdZdZdS)�InvalidBase64PaddingDefectz/base64 encoded sequence had an incorrect lengthNrrrrrr!Fsr!c@seZdZdZdS)�InvalidBase64CharactersDefectz=base64 encoded sequence had characters not in base64 alphabetNrrrrrr"Isr"c@seZdZdZdS)�InvalidBase64LengthDefectz4base64 encoded sequence had invalid length (1 mod 4)Nrrrrrr#Lsr#cs eZdZdZ�fdd�Z�ZS)�HeaderDefectzBase class for a header defect.cst�j||�dSr)rr)r�args�kwrrrrTszHeaderDefect.__init__rrrrrr$Qsr$c@seZdZdZdS)�InvalidHeaderDefectz+Header is not valid, message gives details.Nrrrrrr'Wsr'c@seZdZdZdS)�HeaderMissingRequiredValuez(A header that must have a value had noneNrrrrrr(Zsr(cs(eZdZdZ�fdd�Zdd�Z�ZS)�NonPrintableDefectz8ASCII characters outside the ascii-printable range foundcst��|�||_dSr)rr�non_printables)rr*rrrr`szNonPrintableDefect.__init__cCsd�|j�S)Nz6the following ASCII non-printables found in header: {})�formatr*)rrrr�__str__ds�zNonPrintableDefect.__str__)rrrrrr,rrrrrr)]sr)c@seZdZdZdS)�ObsoleteHeaderDefectz0Header uses syntax declared obsolete by RFC 5322Nrrrrrr-hsr-c@seZdZdZdS)�NonASCIILocalPartDefectz(local_part contains non-ASCII charactersNrrrrrr.ksr.N)r�	Exceptionrr	r
r�	TypeErrorrr
�
ValueErrorrrrrrrrZMalformedHeaderDefectrrr r!r"r#r$r'r(r)r-r.rrrr�<module>s4email/__pycache__/contentmanager.cpython-38.opt-1.pyc000064400000016303151153537640016454 0ustar00U

e5d�)�@s.ddlZddlZddlZddlZddlmZGdd�d�Ze�Zd%dd�Ze�	de�d	d
�Z
d��D]Ze�	ee
�qfdd
�Z
d��D]Ze�	dee
�q�dd�Ze�	de�dd�Zdd�Zdd�Zdd�Zd&dd�Ze�ee�d'd d!�Ze�ejje�d(d#d$�ZeeefD]Ze�ee��qdS))�N)�
quoprimimec@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�ContentManagercCsi|_i|_dS�N)�get_handlers�set_handlers)�self�r�,/usr/lib64/python3.8/email/contentmanager.py�__init__	szContentManager.__init__cCs||j|<dSr)r)r�key�handlerrrr	�add_get_handler
szContentManager.add_get_handlercOs||��}||jkr(|j||f|�|�S|��}||jkrP|j||f|�|�Sd|jkrp|jd|f|�|�St|��dS)N�)Zget_content_typer�get_content_maintype�KeyError)r�msg�args�kwZcontent_type�maintyperrr	�get_contents


zContentManager.get_contentcCs||j|<dSr)r)rZtypekeyrrrr	�add_set_handlerszContentManager.add_set_handlercOs>|��dkrtd��|�||�}|��|||f|�|�dS)NZ	multipartz"set_content not valid on multipart)r�	TypeError�_find_set_handlerZ
clear_content)rr�objrrrrrr	�set_contents
zContentManager.set_contentc	Cs�d}t|�jD]�}||jkr*|j|S|j}t|dd�}|rNd�||f�n|}|dkr^|}||jkrv|j|S||jkr�|j|S|j}||jkr|j|Sqd|jkr�|jdSt|��dS)N�
__module__r�.)�type�__mro__r�__qualname__�getattr�join�__name__r)	rrrZfull_path_for_error�typZqname�modname�	full_path�namerrr	r's&





z ContentManager._find_set_handlerN)	r"rrr
r
rrrrrrrr	rs	r�replacecCs&|jdd�}|�dd�}|j||d�S)NT��decode�charset�ASCII)�errors)�get_payloadZ	get_paramr))rr,Zcontentr*rrr	�get_text_content@sr.�textcCs|jdd�S)NTr(�r-�rrrr	�get_non_text_contentGsr2zaudio image video applicationcCs
|�d�S�Nrr0r1rrr	�get_message_contentMsr4zrfc822 external-bodyzmessage/cCst|�d��Sr3)�bytesr-r1rrr	�%get_and_fixup_unknown_message_contentSsr6�messagec
s�d�||f�|d<|r�t|dd�s<|j��fdd�|D�}z(|D]}|jrV|jd�|||j<qBWn@tjjk
r�}ztd�	|j
|jd���|�W5d}~XYnXdS)	N�/zContent-Typerr&csg|]}�j��|g���qSr)Zheader_factoryZheader_source_parse)�.0�header�Zmprr	�
<listcomp>ds�z _prepare_set.<locals>.<listcomp>zInvalid header: {})�policy)r!�hasattrr=Zdefectsr&�emailr,ZHeaderDefect�
ValueError�formatZfold)rr�subtype�headersr:�excrr;r	�_prepare_set_s$
�
��rEcCsx|dkr|dk	rd}|dk	r$||d<|dk	r>|jd|ddd�|dk	rN||d<|dk	rt|��D]\}}|�||�q^dS)NZ
attachmentzContent-Disposition�filenameT)r:r'z
Content-ID)�	set_param�items)r�dispositionrF�cid�paramsr�valuerrr	�
_finalize_setps�rMcCsVg}|dd}tdt|�|�D]*}||||�}|�t�|��d��q d�|�S)N��r�asciir)�range�len�append�binascii�
b2a_base64r)r!)�data�max_line_lengthZ
encoded_linesZunencoded_bytes_per_line�iZthislinerrr	�_encode_base64�srYcs�|�|���}|j�d���fdd�}dd�}|dkr�tdd�|D�dd	�|jkr�zd
||��d�fWStk
rzYnX|jdkr�d||��dd�fS||dd
��}t�	|�d�|j�}t
�|�}	t|�t|	�kr�d}nd}t|�d
kr�||fS|d
k�r||��d�}
nj|dk�r,||��dd�}
nN|dk�rPt�	||��d�|j�}
n*|dk�rlt
||�|j�}
ntd�|���||
fS)NrPcs��|��Sr�r!��lines��lineseprr	�
embedded_body��z#_encode_text.<locals>.embedded_bodycSsd�|�dS)N�
rZr[rrr	�normal_body�r`z!_encode_text.<locals>.normal_bodycss|]}t|�VqdSr)rR)r9�xrrr	�	<genexpr>�sz_encode_text.<locals>.<genexpr>r)�default�7bit�8bit�surrogateescape�
zlatin-1�base64�quoted-printablez$Unknown content transfer encoding {})�encode�
splitlinesr^�maxrWr)�UnicodeDecodeErrorZcte_typerZbody_encoderTrUrRrYr@rA)�stringr*�cter=r\r_rbZsniffZsniff_qpZsniff_base64rVrr]r	�_encode_text�sD
�



�
rr�plain�utf-8c
Csdt|d||	�t||||j�\}}
|�|
�|jdtjj�||�dd�||d<t	|||||�dS)Nr/r*T)r'�Content-Transfer-Encoding)
rErrr=�set_payloadrGr?r*ZALIASES�getrM)rrprBr*rqrIrFrJrKrCZpayloadrrr	�set_text_content�s
�rx�rfc822c		Cs�|dkrtd��|dkr@|dkr.td�|���|dkr:dn|}n0|dkrd|dkr^td	�|���d
}n|dkrpd
}t|d||�|�|g�||d<t|||||�dS)
N�partialz4message/partial is not supported for Message objectsry)Nrfrg�binaryz*message/rfc822 parts do not support cte={}rgz
external-body)Nrfz1message/external-body parts do not support cte={}rfr7ru)r@rArErvrM)	rr7rBrqrIrFrJrKrCrrr	�set_message_content�s(��r|rjc

Cs�t||||	�|dkr(t||jjd�}nN|dkrNtj|dddd�}|�d�}n(|dkrb|�d�n|d	krv|�dd
�}|�|�||d<t	|||||�dS)Nrj)rWrkFT)�istextr:Z	quotetabsrPrf)rgr{rhru)
rErYr=rWrTZb2a_qpr)rlrvrM)
rrVrrBrqrIrFrJrKrCrrr	�set_bytes_content�s
r~)r')rsrtNNNNNN)ryNNNNNN)rjNNNNN)rTZ
email.charsetr?Z
email.messageZemail.errorsrrZraw_data_managerr.r
r2�splitrr4rBr6rErMrYrrrxr�strr|r7ZMessager~r5�	bytearray�
memoryviewr#rrrr	�<module>s^6
�	'�
�
�
email/__pycache__/parser.cpython-38.opt-2.pyc000064400000005222151153537640014742 0ustar00U

e5d��@s|ddddddgZddlmZmZddlmZmZdd	lmZGd
d�d�Z	Gdd�de	�Z
Gdd�d�ZGd
d�de�ZdS)�Parser�HeaderParser�BytesParser�BytesHeaderParser�
FeedParser�BytesFeedParser�)�StringIO�
TextIOWrapper)rr)�compat32c@s0eZdZd
ed�dd�Zddd�Zddd	�ZdS)
rN��policycCs||_||_dS�N)�_classr)�selfrr�r�$/usr/lib64/python3.8/email/parser.py�__init__szParser.__init__FcCs@t|j|jd�}|r|��|�d�}|s,q8|�|�q|��S)Nri )rrrZ_set_headersonly�readZfeed�close)r�fp�headersonlyZ
feedparser�datarrr�parse)s
zParser.parsecCs|jt|�|d�S)N�r)rr�r�textrrrr�parsestr;szParser.parsestr)N)F)F)�__name__�
__module__�__qualname__r
rrrrrrrrs
c@s eZdZddd�Zddd�ZdS)	rTcCst�||d�S�NT)rr�rrrrrrrHszHeaderParser.parsecCst�||d�Sr )rrrrrrrKszHeaderParser.parsestrN)T)T)rrrrrrrrrrGs
c@s(eZdZdd�Zd	dd�Zd
dd�ZdS)rcOst||�|_dSr
)r�parser)r�args�kwrrrrQszBytesParser.__init__FcCs0t|ddd�}z|j�||�W�S|��XdS)N�ascii�surrogateescape)�encoding�errors)r	�detachr"rr!rrrrcszBytesParser.parsecCs|jddd�}|j�||�S)N�ASCIIr&)r()�decoder"rrrrr�
parsebytesrszBytesParser.parsebytesN)F)F)rrrrrr,rrrrrOs
c@s eZdZddd�Zddd�ZdS)	rTcCstj||dd�S�NTr)rrr!rrrrszBytesHeaderParser.parsecCstj||dd�Sr-)rr,rrrrr,�szBytesHeaderParser.parsebytesN)T)T)rrrrr,rrrrr~s
N)
�__all__�iorr	Zemail.feedparserrrZemail._policybaser
rrrrrrrr�<module>s�7/email/__pycache__/contentmanager.cpython-38.opt-2.pyc000064400000016303151153537640016455 0ustar00U

e5d�)�@s.ddlZddlZddlZddlZddlmZGdd�d�Ze�Zd%dd�Ze�	de�d	d
�Z
d��D]Ze�	ee
�qfdd
�Z
d��D]Ze�	dee
�q�dd�Ze�	de�dd�Zdd�Zdd�Zdd�Zd&dd�Ze�ee�d'd d!�Ze�ejje�d(d#d$�ZeeefD]Ze�ee��qdS))�N)�
quoprimimec@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�ContentManagercCsi|_i|_dS�N)�get_handlers�set_handlers)�self�r�,/usr/lib64/python3.8/email/contentmanager.py�__init__	szContentManager.__init__cCs||j|<dSr)r)r�key�handlerrrr	�add_get_handler
szContentManager.add_get_handlercOs||��}||jkr(|j||f|�|�S|��}||jkrP|j||f|�|�Sd|jkrp|jd|f|�|�St|��dS)N�)Zget_content_typer�get_content_maintype�KeyError)r�msg�args�kwZcontent_type�maintyperrr	�get_contents


zContentManager.get_contentcCs||j|<dSr)r)rZtypekeyrrrr	�add_set_handlerszContentManager.add_set_handlercOs>|��dkrtd��|�||�}|��|||f|�|�dS)NZ	multipartz"set_content not valid on multipart)r�	TypeError�_find_set_handlerZ
clear_content)rr�objrrrrrr	�set_contents
zContentManager.set_contentc	Cs�d}t|�jD]�}||jkr*|j|S|j}t|dd�}|rNd�||f�n|}|dkr^|}||jkrv|j|S||jkr�|j|S|j}||jkr|j|Sqd|jkr�|jdSt|��dS)N�
__module__r�.)�type�__mro__r�__qualname__�getattr�join�__name__r)	rrrZfull_path_for_error�typZqname�modname�	full_path�namerrr	r's&





z ContentManager._find_set_handlerN)	r"rrr
r
rrrrrrrr	rs	r�replacecCs&|jdd�}|�dd�}|j||d�S)NT��decode�charset�ASCII)�errors)�get_payloadZ	get_paramr))rr,Zcontentr*rrr	�get_text_content@sr.�textcCs|jdd�S)NTr(�r-�rrrr	�get_non_text_contentGsr2zaudio image video applicationcCs
|�d�S�Nrr0r1rrr	�get_message_contentMsr4zrfc822 external-bodyzmessage/cCst|�d��Sr3)�bytesr-r1rrr	�%get_and_fixup_unknown_message_contentSsr6�messagec
s�d�||f�|d<|r�t|dd�s<|j��fdd�|D�}z(|D]}|jrV|jd�|||j<qBWn@tjjk
r�}ztd�	|j
|jd���|�W5d}~XYnXdS)	N�/zContent-Typerr&csg|]}�j��|g���qSr)Zheader_factoryZheader_source_parse)�.0�header�Zmprr	�
<listcomp>ds�z _prepare_set.<locals>.<listcomp>zInvalid header: {})�policy)r!�hasattrr=Zdefectsr&�emailr,ZHeaderDefect�
ValueError�formatZfold)rr�subtype�headersr:�excrr;r	�_prepare_set_s$
�
��rEcCsx|dkr|dk	rd}|dk	r$||d<|dk	r>|jd|ddd�|dk	rN||d<|dk	rt|��D]\}}|�||�q^dS)NZ
attachmentzContent-Disposition�filenameT)r:r'z
Content-ID)�	set_param�items)r�dispositionrF�cid�paramsr�valuerrr	�
_finalize_setps�rMcCsVg}|dd}tdt|�|�D]*}||||�}|�t�|��d��q d�|�S)N��r�asciir)�range�len�append�binascii�
b2a_base64r)r!)�data�max_line_lengthZ
encoded_linesZunencoded_bytes_per_line�iZthislinerrr	�_encode_base64�srYcs�|�|���}|j�d���fdd�}dd�}|dkr�tdd�|D�dd	�|jkr�zd
||��d�fWStk
rzYnX|jdkr�d||��dd�fS||dd
��}t�	|�d�|j�}t
�|�}	t|�t|	�kr�d}nd}t|�d
kr�||fS|d
k�r||��d�}
nj|dk�r,||��dd�}
nN|dk�rPt�	||��d�|j�}
n*|dk�rlt
||�|j�}
ntd�|���||
fS)NrPcs��|��Sr�r!��lines��lineseprr	�
embedded_body��z#_encode_text.<locals>.embedded_bodycSsd�|�dS)N�
rZr[rrr	�normal_body�r`z!_encode_text.<locals>.normal_bodycss|]}t|�VqdSr)rR)r9�xrrr	�	<genexpr>�sz_encode_text.<locals>.<genexpr>r)�default�7bit�8bit�surrogateescape�
zlatin-1�base64�quoted-printablez$Unknown content transfer encoding {})�encode�
splitlinesr^�maxrWr)�UnicodeDecodeErrorZcte_typerZbody_encoderTrUrRrYr@rA)�stringr*�cter=r\r_rbZsniffZsniff_qpZsniff_base64rVrr]r	�_encode_text�sD
�



�
rr�plain�utf-8c
Csdt|d||	�t||||j�\}}
|�|
�|jdtjj�||�dd�||d<t	|||||�dS)Nr/r*T)r'�Content-Transfer-Encoding)
rErrr=�set_payloadrGr?r*ZALIASES�getrM)rrprBr*rqrIrFrJrKrCZpayloadrrr	�set_text_content�s
�rx�rfc822c		Cs�|dkrtd��|dkr@|dkr.td�|���|dkr:dn|}n0|dkrd|dkr^td	�|���d
}n|dkrpd
}t|d||�|�|g�||d<t|||||�dS)
N�partialz4message/partial is not supported for Message objectsry)Nrfrg�binaryz*message/rfc822 parts do not support cte={}rgz
external-body)Nrfz1message/external-body parts do not support cte={}rfr7ru)r@rArErvrM)	rr7rBrqrIrFrJrKrCrrr	�set_message_content�s(��r|rjc

Cs�t||||	�|dkr(t||jjd�}nN|dkrNtj|dddd�}|�d�}n(|dkrb|�d�n|d	krv|�dd
�}|�|�||d<t	|||||�dS)Nrj)rWrkFT)�istextr:Z	quotetabsrPrf)rgr{rhru)
rErYr=rWrTZb2a_qpr)rlrvrM)
rrVrrBrqrIrFrJrKrCrrr	�set_bytes_content�s
r~)r')rsrtNNNNNN)ryNNNNNN)rjNNNNN)rTZ
email.charsetr?Z
email.messageZemail.errorsrrZraw_data_managerr.r
r2�splitrr4rBr6rErMrYrrrxr�strr|r7ZMessager~r5�	bytearray�
memoryviewr#rrrr	�<module>s^6
�	'�
�
�
email/__pycache__/feedparser.cpython-38.opt-2.pyc000064400000021175151153537640015573 0ustar00U

e5d�X�@s�ddgZddlZddlmZddlmZddlmZddlm	Z	e�
d�Ze�
d	�Ze�
d
�Z
e�
d	�Ze�
d�ZdZd
Ze�ZGdd�de�ZGdd�d�ZGdd�de�ZdS)�
FeedParser�BytesFeedParser�N)�errors)�compat32)�deque)�StringIOz
\r\n|\r|\nz(\r\n|\r|\n)z(\r\n|\r|\n)\Zz%^(From |[\041-\071\073-\176]*:|[\t ])��
c@s\eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)�BufferedSubFilecCs$tdd�|_t�|_g|_d|_dS)Nr)�newlineF)r�_partialr�_lines�	_eofstack�_closed��self�r�(/usr/lib64/python3.8/email/feedparser.py�__init__5szBufferedSubFile.__init__cCs|j�|�dS�N)r�append)rZpredrrr�push_eof_matcher@sz BufferedSubFile.push_eof_matchercCs
|j��Sr)r�poprrrr�pop_eof_matcherCszBufferedSubFile.pop_eof_matchercCs<|j�d�|�|j���|j�d�|j��d|_dS)NrT)r�seek�	pushlines�	readlines�truncaterrrrr�closeFs

zBufferedSubFile.closecCsL|js|jrdStS|j��}t|j�D]}||�r(|j�|�dSq(|S�Nr)r
r�NeedMoreData�popleft�reversedr�
appendleft)r�lineZateofrrr�readlineNs
zBufferedSubFile.readlinecCs|j�|�dSr)r
r#�rr$rrr�
unreadline`szBufferedSubFile.unreadlinecCsx|j�|�d|kr d|kr dS|j�d�|j��}|j�d�|j��|d�d�sj|j�|���|�|�dS)Nr	�
r���)r�writerrr�endswithrr)r�data�partsrrr�pushes

zBufferedSubFile.pushcCs|j�|�dSr)r
�extend)r�linesrrrrzszBufferedSubFile.pushlinescCs|Srrrrrr�__iter__}szBufferedSubFile.__iter__cCs|��}|dkrt�|Sr)r%�
StopIterationr&rrr�__next__�szBufferedSubFile.__next__N)
�__name__�
__module__�__qualname__rrrrr%r'r.rr1r3rrrrr
-sr
c@s\eZdZded�dd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)rN��policycCs�||_d|_|dkr<|jdkr2ddlm}||_qn|j|_n2||_z||jd�Wntk
rld|_YnXt�|_g|_	|�
�j|_d|_
d|_d|_dS)NFr)�Messager7T)r8�_old_style_factoryZmessage_factoryZ
email.messager9�_factory�	TypeErrorr
�_input�	_msgstack�	_parsegenr3�_parse�_cur�_last�_headersonly)rr;r8r9rrrr�s$

zFeedParser.__init__cCs
d|_dS)NT)rCrrrr�_set_headersonly�szFeedParser._set_headersonlycCs|j�|�|��dSr)r=r.�_call_parse�rr,rrr�feed�szFeedParser.feedcCs&z|��Wntk
r YnXdSr)r@r2rrrrrE�szFeedParser._call_parsecCsH|j��|��|��}|��dkrD|��sDt��}|j�	||�|S)N�	multipart)
r=rrE�_pop_message�get_content_maintypeZis_multipartrZ!MultipartInvariantViolationDefectr8�
handle_defect)r�root�defectrrrr�s
�zFeedParser.closecCsn|jr|��}n|j|jd�}|jr<|j��dkr<|�d�|jrR|jd�|�|j�|�||_||_	dS)Nr7zmultipart/digestzmessage/rfc822r))
r:r;r8rA�get_content_typeZset_default_typer>ZattachrrB)r�msgrrr�_new_message�s

zFeedParser._new_messagecCs(|j��}|jr|jd|_nd|_|S)Nr))r>rrA)r�retvalrrrrI�s

zFeedParser._pop_messageccs|��g}|jD]Z}|tkr&tVqt�|�sbt�|�s^t��}|j�	|j
|�|j�|�qn|�|�q|�
|�|jr�g}|j��}|tkr�tVq�|dkr�q�|�|�q�|j
�t�|��dS|j
��dk�r�|j�tj�|��D]}|tk�rtVq��qq�|��}|j��|j��}|tk�rDtV�q�qD�q|j��}|tk�rjtV�qD�qj�qD|dk�rx�q�|j�|�q�dS|j
��dk�r�|��D] }|tk�r�tV�q��qĐq�|��dS|j
��dk�r�|j
��}|dk�rRt��}|j�	|j
|�g}|jD]$}|tk�r.tV�q|�|��q|j
�t�|��dSt|j
�dd����dk�r�t��}|j�	|j
|�d|}t� d	t�!|�d
�}	d}
g}d}d}
|j��}|tk�r�tV�q�|dk�r�q�|	�|�}|�r�|�"d
��rd}
|�"d�}�q�|
�rr|�r^|d}t#�$|�}|�rP|dt%|�"d���|d<t�|�|j
_&d}
|j�|��q�|j��}|tk�r�tV�qr|	�|�}|�sr|j�|��q��qr|j�|	j�|��D] }|tk�r�tV�q��q�q�|j'��dk�rT|j'j(}|dk�rd|j'_(n:|dk	�r�t#�$|�}|�r�t%|�"d��}|d|�|j'_(nD|j'j)}t*|t��r�t#�$|�}|�r�|dt%|�"d���}||j'_)|j��|��|j
|_'n
|�|��q�|
�r*t�+�}|j�	|j
|�|j
�t�|��g}|jD]}|tk�r�tV�q��q�t�|�|j
_(dS|
�sLt�,�}|j�	|j
|�dS|�rZdg}ng}|jD]$}|tk�r|tV�qd|�|��qd|�r�|d}t-�|�}|�r�|t%|�"d��d�|d<t�|�|j
_(dSg}|jD]$}|tk�r�tV�q�|�|��q�|j
�t�|��dS)Nrzmessage/delivery-status�messagerHzcontent-transfer-encoding�8bit)Z7bitrSZbinaryz--z(?P<sep>z4)(?P<end>--)?(?P<ws>[ \t]*)(?P<linesep>\r\n|\r|\n)?$TF�end�linesepr)r).rPr=r �headerRE�match�NLCRErZ MissingHeaderBodySeparatorDefectr8rKrAr'r�_parse_headersrCr%Zset_payload�EMPTYSTRING�joinrNrr?rIrrJZget_boundaryZNoBoundaryInMultipartDefect�str�get�lowerZ-InvalidMultipartContentTransferEncodingDefect�re�compile�escape�group�	NLCRE_eol�search�len�preamblerB�epilogueZ_payload�
isinstanceZStartBoundaryNotFoundDefectZCloseBoundaryNotFoundDefect�	NLCRE_bol)rZheadersr$rMr0rQrO�boundaryZ	separatorZ
boundaryreZcapturing_preamblerfrUZclose_boundary_seen�moZlastlineZeolmorgrTZpayload�	firstlineZbolmorrrr?�s`

















���
























zFeedParser._parsegenc	CsXd}g}t|�D�]&\}}|ddkrR|sFt�|�}|j�|j|�q|�|�q|rt|jj|j�|��dg}}|�	d�r�|dkr�t
�|�}|r�|dt|�
d���}|j�|�qn<|t|�dkr�|j�|�dSt�|�}|jj�|�q|�d�}|dk�r&t�d�}|jj�|�q|d|�}|g}q|�rT|jj|j�|��dS)Nrrz 	zFrom ��:zMissing header name.)�	enumeraterZ#FirstHeaderLineIsContinuationDefectr8rKrArZset_rawZheader_source_parse�
startswithrcrdrerbZset_unixfromr=r'ZMisplacedEnvelopeHeaderDefectZdefects�findZInvalidHeaderDefect)	rr0Z
lastheaderZ	lastvalue�linenor$rMrk�irrrrY�sF








zFeedParser._parse_headers)N)
r4r5r6rrrDrGrErrPrIr?rYrrrrr�s

~cseZdZ�fdd�Z�ZS)rcst��|�dd��dS)N�ascii�surrogateescape)�superrG�decoderF��	__class__rrrGszBytesFeedParser.feed)r4r5r6rG�
__classcell__rrrxrrs)�__all__r_ZemailrZemail._policybaser�collectionsr�iorr`rXrircZNLCRE_crackrVrZ�NL�objectr r
rrrrrr�<module>s&




[email/__pycache__/iterators.cpython-38.opt-2.pyc000064400000002426151153537640015465 0ustar00U

e5dW�@sHdddgZddlZddlmZdd�Zd
dd�Zdd
d�Zddd�ZdS)�body_line_iterator�typed_subpart_iterator�walk�N)�StringIOccs.|V|��r*|��D]}|��EdHqdS�N)�is_multipart�get_payloadr)�self�subpart�r�'/usr/lib64/python3.8/email/iterators.pyrsFccs6|��D](}|j|d�}t|t�rt|�EdHqdS)N)�decode)rr�
isinstance�strr)�msgr
r
Zpayloadrrrr"s
�textccs8|��D]*}|��|kr|dks,|��|kr|VqdSr)rZget_content_maintypeZget_content_subtype)rZmaintypeZsubtyper
rrrr-scCs�|dkrtj}d|d}t||��d|d�|rJtd|��|d�n
t|d�|��r||��D]}t|||d|�qddS)N� ��)�end�filez [%s])r�)�sys�stdout�printZget_content_typeZget_default_typerr�
_structure)r�fp�levelZinclude_defaultZtabr
rrrr;s
r)F)rN)NrF)�__all__r�iorrrrrrrrr�<module>s�

email/__pycache__/_policybase.cpython-38.pyc000064400000034734151153537640015011 0ustar00U

e5d�:�@s�dZddlZddlmZddlmZddlmZdddgZGd	d
�d
�Z	dd�Z
d
d�ZGdd�de	ejd�Z
eGdd�de
��Ze�ZdS)zwPolicy framework for the email package.

Allows fine grained feature control of how the package parses and emits data.
�N)�header)�charset)�_has_surrogates�Policy�Compat32�compat32cs@eZdZdZ�fdd�Zdd�Zdd�Zdd	�Zd
d�Z�Z	S)�_PolicyBasea�Policy Object basic framework.

    This class is useless unless subclassed.  A subclass should define
    class attributes with defaults for any values that are to be
    managed by the Policy object.  The constructor will then allow
    non-default values to be set for these attributes at instance
    creation time.  The instance will be callable, taking these same
    attributes keyword arguments, and returning a new instance
    identical to the called instance except for those values changed
    by the keyword arguments.  Instances may be added, yielding new
    instances with any non-default values from the right hand
    operand overriding those in the left hand operand.  That is,

        A + B == A(<non-default values of B>)

    The repr of an instance can be used to reconstruct the object
    if and only if the repr of the values can be used to reconstruct
    those values.

    csH|��D]:\}}t||�r.tt|��||�qtd�||jj���qdS)z�Create new Policy, possibly overriding some defaults.

        See class docstring for a list of overridable attributes.

        �*{!r} is an invalid keyword argument for {}N)	�items�hasattr�superr�__setattr__�	TypeError�format�	__class__�__name__)�self�kw�name�value�r��)/usr/lib64/python3.8/email/_policybase.py�__init__)s
��z_PolicyBase.__init__cCs*dd�|j��D�}d�|jjd�|��S)NcSsg|]\}}d�||��qS)z{}={!r})r)�.0rrrrr�
<listcomp>8s�z(_PolicyBase.__repr__.<locals>.<listcomp>z{}({})z, )�__dict__r
rrr�join)r�argsrrr�__repr__7s�z_PolicyBase.__repr__cKsr|j�|j�}|j��D]\}}t�|||�q|��D]4\}}t||�s^td�||jj	���t�|||�q8|S)z�Return a new instance with specified attributes changed.

        The new instance has the same attribute values as the current object,
        except for the changes passed in as keyword arguments.

        r	)
r�__new__rr
�objectr
rrrr)rrZ	newpolicy�attrrrrr�clone<s
��z_PolicyBase.clonecCs,t||�rd}nd}t|�|jj|���dS)Nz'{!r} object attribute {!r} is read-onlyz!{!r} object has no attribute {!r})r�AttributeErrorrrr)rrr�msgrrrr
Ns
z_PolicyBase.__setattr__cCs|jf|j�S)z�Non-default values from right operand override those from left.

        The object returned is a new instance of the subclass.

        )r#r)r�otherrrr�__add__Usz_PolicyBase.__add__)
r�
__module__�__qualname__�__doc__rrr#r
r'�
__classcell__rrrrrsrcCs,|�dd�d}|�dd�d}|d|S)N�
�r)�rsplit�split)�docZ	added_docrrr�_append_doc^sr1cCs�|jr(|j�d�r(t|jdj|j�|_|j��D]V\}}|jr2|j�d�r2dd�|jD�D]*}tt||�d�}|r\t||j�|_q2q\q2|S)N�+rcss |]}|��D]
}|VqqdS)N)�mro)r�base�crrr�	<genexpr>hs
z%_extend_docstrings.<locals>.<genexpr>r*)r*�
startswithr1�	__bases__rr
�getattr)�clsrr"r5r0rrr�_extend_docstringscsr;c@s�eZdZdZdZdZdZdZdZdZ	dd�Z
d	d
�Zdd�Ze
jd
d��Ze
jdd��Ze
jdd��Ze
jdd��Ze
jdd��ZdS)raI	Controls for how messages are interpreted and formatted.

    Most of the classes and many of the methods in the email package accept
    Policy objects as parameters.  A Policy object contains a set of values and
    functions that control how input is interpreted and how output is rendered.
    For example, the parameter 'raise_on_defect' controls whether or not an RFC
    violation results in an error being raised or not, while 'max_line_length'
    controls the maximum length of output lines when a Message is serialized.

    Any valid attribute may be overridden when a Policy is created by passing
    it as a keyword argument to the constructor.  Policy objects are immutable,
    but a new Policy object can be created with only certain values changed by
    calling the Policy instance with keyword arguments.  Policy objects can
    also be added, producing a new Policy object in which the non-default
    attributes set in the right hand operand overwrite those specified in the
    left operand.

    Settable attributes:

    raise_on_defect     -- If true, then defects should be raised as errors.
                           Default: False.

    linesep             -- string containing the value to use as separation
                           between output lines.  Default '\n'.

    cte_type            -- Type of allowed content transfer encodings

                           7bit  -- ASCII only
                           8bit  -- Content-Transfer-Encoding: 8bit is allowed

                           Default: 8bit.  Also controls the disposition of
                           (RFC invalid) binary data in headers; see the
                           documentation of the binary_fold method.

    max_line_length     -- maximum length of lines, excluding 'linesep',
                           during serialization.  None or 0 means no line
                           wrapping is done.  Default is 78.

    mangle_from_        -- a flag that, when True escapes From_ lines in the
                           body of the message by putting a `>' in front of
                           them. This is used when the message is being
                           serialized by a generator. Default: True.

    message_factory     -- the class to use to create new message objects.
                           If the value is None, the default is Message.

    Fr,Z8bit�NNcCs|jr
|�|�||�dS)aZBased on policy, either raise defect or call register_defect.

            handle_defect(obj, defect)

        defect should be a Defect subclass, but in any case must be an
        Exception subclass.  obj is the object on which the defect should be
        registered if it is not raised.  If the raise_on_defect is True, the
        defect is raised as an error, otherwise the object and the defect are
        passed to register_defect.

        This method is intended to be called by parsers that discover defects.
        The email package parsers always call it with Defect instances.

        N)�raise_on_defect�register_defect�r�objZdefectrrr�
handle_defect�szPolicy.handle_defectcCs|j�|�dS)a�Record 'defect' on 'obj'.

        Called by handle_defect if raise_on_defect is False.  This method is
        part of the Policy API so that Policy subclasses can implement custom
        defect handling.  The default implementation calls the append method of
        the defects attribute of obj.  The objects used by the email package by
        default that get passed to this method will always have a defects
        attribute with an append method.

        N)Zdefects�appendr?rrrr>�szPolicy.register_defectcCsdS)a[Return the maximum allowed number of headers named 'name'.

        Called when a header is added to a Message object.  If the returned
        value is not 0 or None, and there are already a number of headers with
        the name 'name' equal to the value returned, a ValueError is raised.

        Because the default behavior of Message's __setitem__ is to append the
        value to the list of headers, it is easy to create duplicate headers
        without realizing it.  This method allows certain headers to be limited
        in the number of instances of that header that may be added to a
        Message programmatically.  (The limit is not observed by the parser,
        which will faithfully produce as many headers as exist in the message
        being parsed.)

        The default implementation returns None for all header names.
        Nr)rrrrr�header_max_count�szPolicy.header_max_countcCst�dS)aZGiven a list of linesep terminated strings constituting the lines of
        a single header, return the (name, value) tuple that should be stored
        in the model.  The input lines should retain their terminating linesep
        characters.  The lines passed in by the email package may contain
        surrogateescaped binary data.
        N��NotImplementedError)r�sourcelinesrrr�header_source_parse�szPolicy.header_source_parsecCst�dS)z�Given the header name and the value provided by the application
        program, return the (name, value) that should be stored in the model.
        NrD�rrrrrr�header_store_parse�szPolicy.header_store_parsecCst�dS)awGiven the header name and the value from the model, return the value
        to be returned to the application program that is requesting that
        header.  The value passed in by the email package may contain
        surrogateescaped binary data if the lines were parsed by a BytesParser.
        The returned value should not contain any surrogateescaped data.

        NrDrHrrr�header_fetch_parse�s	zPolicy.header_fetch_parsecCst�dS)a�Given the header name and the value from the model, return a string
        containing linesep characters that implement the folding of the header
        according to the policy controls.  The value passed in by the email
        package may contain surrogateescaped binary data if the lines were
        parsed by a BytesParser.  The returned value should not contain any
        surrogateescaped data.

        NrDrHrrr�fold�s
zPolicy.foldcCst�dS)a%Given the header name and the value from the model, return binary
        data containing linesep characters that implement the folding of the
        header according to the policy controls.  The value passed in by the
        email package may contain surrogateescaped binary data.

        NrDrHrrr�fold_binaryszPolicy.fold_binary)rr(r)r*r=�linesep�cte_type�max_line_length�mangle_from_Zmessage_factoryrAr>rC�abc�abstractmethodrGrIrJrKrLrrrrrps(0

	



)�	metaclassc@sLeZdZdZdZdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�ZdS)rz�+
    This particular policy is the backward compatibility Policy.  It
    replicates the behavior of the email package version 5.1.
    TcCs0t|t�s|St|�r(tj|tj|d�S|SdS)N�r�header_name)�
isinstance�strrr�Header�_charset�UNKNOWN8BITrHrrr�_sanitize_headers

�zCompat32._sanitize_headercCs>|d�dd�\}}|�d�d�|dd��}||�d�fS)a:+
        The name is parsed as everything up to the ':' and returned unmodified.
        The value is determined by stripping leading whitespace off the
        remainder of the first line, joining all subsequent lines together, and
        stripping any trailing carriage return or linefeed characters.

        r�:r-z 	�Nz
)r/�lstripr�rstrip)rrFrrrrrrG%szCompat32.header_source_parsecCs||fS)z>+
        The name and value are returned unmodified.
        rrHrrrrI1szCompat32.header_store_parsecCs|�||�S)z�+
        If the value contains binary data, it is converted into a Header object
        using the unknown-8bit charset.  Otherwise it is returned unmodified.
        )r[rHrrrrJ7szCompat32.header_fetch_parsecCs|j||dd�S)a+
        Headers are folded using the Header folding algorithm, which preserves
        existing line breaks in the value, and wraps each resulting line to the
        max_line_length.  Non-ASCII binary data are CTE encoded using the
        unknown-8bit charset.

        T��sanitize)�_foldrHrrrrK>sz
Compat32.foldcCs"|j|||jdkd�}|�dd�S)a�+
        Headers are folded using the Header folding algorithm, which preserves
        existing line breaks in the value, and wraps each resulting line to the
        max_line_length.  If cte_type is 7bit, non-ascii binary data is CTE
        encoded using the unknown-8bit charset.  Otherwise the original source
        header is used, with its existing line breaks and/or binary data.

        Z7bitr`�ascii�surrogateescape)rbrN�encode)rrrZfoldedrrrrLHs	zCompat32.fold_binarycCs�g}|�d|�t|t�r\t|�rL|r<tj|tj|d�}qZ|�|�d}q`tj||d�}n|}|dk	r�d}|jdk	r||j}|�|j	|j
|d��|�|j
�d�|�S)Nz%s: rT)rUr)rM�
maxlinelenr])rBrVrWrrrXrYrZrOrerMr)rrrra�parts�hrfrrrrbTs(
�


zCompat32._foldN)rr(r)r*rPr[rGrIrJrKrLrbrrrrrs
)r*rQZemailrrrYZemail.utilsr�__all__rr1r;�ABCMetarrrrrrr�<module>s �L
 femail/__pycache__/quoprimime.cpython-38.pyc000064400000017000151153537640014672 0ustar00U

e5d�&�
@sXdZddddddddd	d
g
ZddlZdd
lmZmZmZdZdZdZ	dd�e
d�D�Zedd�Zedd�Z
de�d�e�d�D]Zee�ee<q�deed�<dD]Zee�e
e<q�dd�Zdd�Zdd�Zdd�Zd,dd �Zd!d
�Zd"d	�Zd-d$d�Ze
dd�Zd%D]Zee�ee<�qd&efd'd�Zefd(d�ZeZeZd)d*�Zd+d�Z dS).aFQuoted-printable content transfer encoding per RFCs 2045-2047.

This module handles the content transfer encoding method defined in RFC 2045
to encode US ASCII-like 8-bit data called `quoted-printable'.  It is used to
safely encode text that is in a character set similar to the 7-bit US ASCII
character set, but that includes some 8-bit characters that are normally not
allowed in email bodies or headers.

Quoted-printable is very space-inefficient for encoding binary files; use the
email.base64mime module for that instead.

This module provides an interface to encode and decode both headers and bodies
with quoted-printable encoding.

RFC 2045 defines a method for including character set information in an
`encoded-word' in a header.  This method is commonly used for 8-bit real names
in To:/From:/Cc: etc. fields, as well as Subject: lines.

This module does not do the line wrapping or end-of-line character
conversion necessary for proper internationalized headers; it only
does dumb encoding and decoding.  To deal with the various line
wrapping issues, use the email.header module.
�body_decode�body_encode�body_length�decode�decodestring�
header_decode�
header_encode�
header_length�quote�unquote�N)�
ascii_letters�digits�	hexdigits�
�
�cCsg|]}d|�qS)z=%02X�)�.0�crr�(/usr/lib64/python3.8/email/quoprimime.py�
<listcomp>7sr�s-!*+/�ascii�_� s_ !"#$%&'()*+,-./0123456789:;<>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~	cCst|�t|kS)z>Return True if the octet should be escaped with header quopri.)�chr�_QUOPRI_HEADER_MAP��octetrrr�header_checkJsrcCst|�t|kS)z<Return True if the octet should be escaped with body quopri.)r�_QUOPRI_BODY_MAPrrrr�
body_checkOsr!cCstdd�|D��S)a:Return a header quoted-printable encoding length.

    Note that this does not include any RFC 2047 chrome added by
    `header_encode()`.

    :param bytearray: An array of bytes (a.k.a. octets).
    :return: The length in bytes of the byte array when it is encoded with
        quoted-printable for headers.
    css|]}tt|�VqdS�N)�lenr�rrrrr�	<genexpr>^sz header_length.<locals>.<genexpr>��sum��	bytearrayrrrrTs
cCstdd�|D��S)z�Return a body quoted-printable encoding length.

    :param bytearray: An array of bytes (a.k.a. octets).
    :return: The length in bytes of the byte array when it is encoded with
        quoted-printable for bodies.
    css|]}tt|�VqdSr")r#r r$rrrr%hszbody_length.<locals>.<genexpr>r&r(rrrrascCsft|t�st|�}|s&|�|���n<t|d�t|�|krT|d||7<n|�|���dS)N���)�
isinstance�strr�append�lstripr#)�L�s�maxlenZextrarrr�_max_appendks
r2cCstt|dd�d��S)zDTurn a string in the form =AB to the ASCII character with value 0xab���)r�int�r0rrrr
vscCstt|�Sr")�_QUOPRI_MAP�ord)rrrrr	{s�
iso-8859-1cCs$|sdS|�d��t�}d||fS)a�Encode a single header line with quoted-printable (like) encoding.

    Defined in RFC 2045, this `Q' encoding is similar to quoted-printable, but
    used specifically for email header fields to allow charsets with mostly 7
    bit characters (and some 8 bit) to remain more or less readable in non-RFC
    2045 aware mail clients.

    charset names the character set to use in the RFC 2046 header.  It
    defaults to iso-8859-1.
    r�latin1z=?%s?q?%s?=)r�	translater)Zheader_bytes�charset�encodedrrrrss
�Lc
Cs�|dkrtd��|s|S|�t�}d|}|d}g}|j}|��D�]}d}t|�d|}	||	kr�||}
||
ddkr�||||
d��|
d}q^||
ddkr�||||
��|
d}q^||||
�d�|
}q^|�rR|ddk�rR||	}|d	k�rt|d�}n(|dk�r,|d|}n|t|d�}|||d�|�qD|||d
��qD|dtk�rz|d�|�|�S)a�Encode with quoted-printable, wrapping at maxlinelen characters.

    Each line of encoded text will end with eol, which defaults to "\n".  Set
    this to "\r\n" if you will be using the result of this function directly
    in an email.

    Each line will be wrapped at, at most, maxlinelen characters before the
    eol string (maxlinelen defaults to 76 characters, the maximum value
    permitted by RFC 2045).  Long lines will have the 'soft line break'
    quoted-printable character "=" appended to them, so the decoded text will
    be identical to the original text.

    The minimum maxlinelen is 4 to have room for a quoted character ("=XX")
    followed by a soft line break.  Smaller values will generate a
    ValueError.

    �zmaxlinelen must be at least 4�=r3r�r*z 	r4Nr)	�
ValueErrorr<�_QUOPRI_BODY_ENCODE_MAPr-�
splitlinesr#r	�CRLF�join)
ZbodyZ
maxlinelen�eolZ
soft_breakZmaxlinelen1Zencoded_bodyr-�line�startZ	laststart�stopZroom�qrrrr�sD




cCs|s|Sd}|��D]�}|��}|s.||7}qd}t|�}||kr||}|dkrd||7}|d7}nv|d|kr||d7}q:n^|d|kr�||dtkr�||dtkr�|t|||d��7}|d7}n||7}|d7}||kr:||7}q:q|ddk�r|�|��r|d	d�}|S)
z_Decode a quoted-printable string.

    Lines are separated with eol, which defaults to \n.
    rrrAr3rBr4r*rN)rE�rstripr#rr
�endswith)r>rHZdecodedrI�i�nrrrrr�s8
,
cCs|�d�}t|�S)zCTurn a match in the form =AB to the ASCII character with value 0xabr)�groupr
)�matchr0rrr�_unquote_matchs
rScCs |�dd�}tjdt|tjd�S)aDecode a string encoded with RFC 2045 MIME header `Q' encoding.

    This function does not parse a full MIME header value encoded with
    quoted-printable (like =?iso-8859-1?q?Hello_World?=) -- please use
    the high level email.header class for that functionality.
    rrz=[a-fA-F0-9]{2})�flags)�replace�re�subrS�ASCIIr7rrrr#s)r)r:)!�__doc__�__all__rV�stringrr
rrF�NLZEMPTYSTRING�ranger8rr �encoderrr9rr!rrr2r
r	rrDrrrrrSrrrrr�<module>sR�




O0email/__pycache__/header.cpython-38.opt-1.pyc000064400000040071151153537640014676 0ustar00U

e5d&^�@s�dZdddgZddlZddlZddlZddlZddlmZddlm	Z
e
jZdZd	Z
d
ZdZdZd
ZdZed�Zed�Ze�dejejB�Ze�d�Ze�d�ZejjZdd�Zddd�ZGdd�d�ZGdd�d�Z Gdd�de!�Z"dS)z+Header encoding and decoding functionality.�Header�
decode_header�make_header�N)�HeaderParseError)�charset�
� � z        ��Nz 	�us-asciizutf-8ai
  =\?                   # literal =?
  (?P<charset>[^?]*?)   # non-greedy up to the next ? is the charset
  \?                    # literal ?
  (?P<encoding>[qQbB])  # either a "q" or a "b", case insensitive
  \?                    # literal ?
  (?P<encoded>.*?)      # non-greedy up to the next ?= is the encoded string
  \?=                   # literal ?=
  z[\041-\176]+:$z
\n[^ \t]+:c	Cs�t|d�rdd�|jD�St�|�s.|dfgSg}|��D]�}t�|�}d}|r:|�d�}|rj|��}d}|r~|�|ddf�|rL|�d��	�}|�d��	�}|�d�}|�|||f�qLq:g}	t
|�D]J\}
}|
dkr�|dr�||
d	dr�||
dd��r�|	�|
d�q�t|	�D]}||=�qg}
|D]�\}}}|dk�rV|
�||f�n�|d
k�r|t
j�|�}|
�||f�n~|dk�r�t|�d}|�r�|d
dd|�7}zt
j�|�}Wn tjk
�r�td��YnX|
�||f�ntd|���q2g}d}}|
D]v\}}t|t��r,t|d�}|dk�r@|}|}nB||k�rb|�||f�|}|}n |dk�rz|t|7}n||7}�q|�||f�|S)a;Decode a message header value without converting charset.

    Returns a list of (string, charset) pairs containing each of the decoded
    parts of the header.  Charset is None for non-encoded parts of the header,
    otherwise a lower-case string containing the name of the character set
    specified in the encoded string.

    header may be a string that may or may not contain RFC2047 encoded words,
    or it may be a Header object.

    An email.errors.HeaderParseError may be raised when certain decoding error
    occurs (e.g. a base64 decoding exception).
    �_chunkscSs(g|] \}}t�|t|��t|�f�qS�)�_charsetZ_encode�str)�.0�stringrrr�$/usr/lib64/python3.8/email/header.py�
<listcomp>Ms�z!decode_header.<locals>.<listcomp>NTrF���q�b�z===zBase64 decoding errorzUnexpected encoding: zraw-unicode-escape)�hasattrr
�ecre�search�
splitlines�split�pop�lstrip�append�lower�	enumerate�isspace�reversed�email�
quoprimimeZ
header_decode�lenZ
base64mime�decode�binascii�Errorr�AssertionError�
isinstancer�bytes�BSPACE)�headerZwords�line�parts�firstZ	unencodedr�encodingZencodedZdroplist�n�w�dZ
decoded_wordsZencoded_stringZwordZpaderrZ	collapsedZ	last_word�last_charsetrrrr=s|
�




4







cCsFt|||d�}|D].\}}|dk	r4t|t�s4t|�}|�||�q|S)a�Create a Header from a sequence of pairs as returned by decode_header()

    decode_header() takes a header value string and returns a sequence of
    pairs of the format (decoded_string, charset) where charset is the string
    name of the character set.

    This function takes one of those sequence of pairs and returns a Header
    instance.  Optional maxlinelen, header_name, and continuation_ws are as in
    the Header constructor.
    )�
maxlinelen�header_name�continuation_wsN)rr-�Charsetr!)Zdecoded_seqr9r:r;�h�srrrrr�s�c@sJeZdZddd�Zdd�Zdd	�Zdd
d�Zdd
�Zddd�Zdd�Z	dS)rNr�strictcCs||dkrt}nt|t�s t|�}||_||_g|_|dk	rH|�|||�|dkrTt}||_|dkrjd|_	nt
|�d|_	dS)aDCreate a MIME-compliant header that can contain many character sets.

        Optional s is the initial header value.  If None, the initial header
        value is not set.  You can later append to the header with .append()
        method calls.  s may be a byte string or a Unicode string, but see the
        .append() documentation for semantics.

        Optional charset serves two purposes: it has the same meaning as the
        charset argument to the .append() method.  It also sets the default
        character set for all subsequent .append() calls that omit the charset
        argument.  If charset is not provided in the constructor, the us-ascii
        charset is used both as s's initial charset and as the default for
        subsequent .append() calls.

        The maximum line length can be specified explicitly via maxlinelen. For
        splitting the first line to a shorter value (to account for the field
        header which isn't included in s, e.g. `Subject') pass in the name of
        the field in header_name.  The default maxlinelen is 78 as recommended
        by RFC 2822.

        continuation_ws must be RFC 2822 compliant folding whitespace (usually
        either a space or a hard tab) which will be prepended to continuation
        lines.

        errors is passed through to the .append() call.
        Nrr)�USASCIIr-r<r�_continuation_wsr
r!�
MAXLINELEN�_maxlinelen�
_headerlenr()�selfr>rr9r:r;�errorsrrr�__init__�s
zHeader.__init__c	Cs�|��g}d}d}|jD]�\}}|}|tjkrH|�dd�}|�dd�}|r�|o\|�|d�}|dkr�|dkr�|s�|�t�d}n|dkr�|s�|�t�|o�|�|d�}|}|�|�qt	�
|�S)z&Return the string value of the header.N�ascii�surrogateescape�replacer�Nr���)�
_normalizer
r�UNKNOWN8BIT�encoder)�	_nonctextr!�SPACE�EMPTYSTRING�join)	rEZuchunks�lastcs�	lastspacerrZnextcsZoriginal_bytes�hasspacerrr�__str__�s*


zHeader.__str__cCs|t|�kS�N)r)rE�otherrrr�__eq__sz
Header.__eq__cCs�|dkr|j}nt|t�s"t|�}t|t�sZ|jp4d}|tjkrN|�dd�}n|�||�}|jpbd}|tjkr�z|�||�Wn"t	k
r�|dkr��t
}YnX|j�||f�dS)a.Append a string to the MIME header.

        Optional charset, if given, should be a Charset instance or the name
        of a character set (which will be converted to a Charset instance).  A
        value of None (the default) means that the charset given in the
        constructor is used.

        s may be a byte string or a Unicode string.  If it is a byte string
        (i.e. isinstance(s, str) is false), then charset is the encoding of
        that byte string, and a UnicodeError will be raised if the string
        cannot be decoded with that charset.  If s is a Unicode string, then
        charset is a hint specifying the character set of the characters in
        the string.  In either case, when producing an RFC 2822 compliant
        header using RFC 2047 rules, the string will be encoded using the
        output codec of the charset.  If the string cannot be encoded to the
        output codec, a UnicodeError will be raised.

        Optional `errors' is passed as the errors argument to the decode
        call if s is a byte string.
        NrrI)
rr-r<rZinput_codecrNr)Zoutput_codecrO�UnicodeEncodeError�UTF8r
r!)rEr>rrFZ
input_charsetZoutput_charsetrrrr!	s$






z
Header.appendcCs|��p|dkS)z=True if string s is not a ctext character of RFC822.
        )�(�)�\)r$)rEr>rrrrP4szHeader._nonctext�;, 	rcCs�|��|dkr|j}|dkr"d}t|j||j|�}d}d}}|jD�]\}}	|dk	r�|oh|�|d�}|dkr�|r~|	dkr�|��n|	dkr�|s�|��|o�|�|d�}|	}d}|��}
|
r�|�	d|
d|	�n|�	dd|	�|
dd�D]`}|�
�|	jdk	�r"|�	|jd	|��|	�q�|��}|dt
|�t
|��}
|�	|
||	�q�t
|
�dkrF|�
�qF|j�rx|��|�|�}t�|��r�td
�|���|S)a�Encode a message header into an RFC-compliant format.

        There are many issues involved in converting a given string for use in
        an email header.  Only certain character sets are readable in most
        email clients, and as header strings can only contain a subset of
        7-bit ASCII, care must be taken to properly convert and encode (with
        Base64 or quoted-printable) header strings.  In addition, there is a
        75-character length limit on any given encoded header field, so
        line-wrapping must be performed, even with double-byte character sets.

        Optional maxlinelen specifies the maximum length of each generated
        line, exclusive of the linesep string.  Individual lines may be longer
        than maxlinelen if a folding point cannot be found.  The first line
        will be shorter by the length of the header name plus ": " if a header
        name was specified at Header construction time.  The default value for
        maxlinelen is determined at header construction time.

        Optional splitchars is a string containing characters which should be
        given extra weight by the splitting algorithm during normal header
        wrapping.  This is in very rough support of RFC 2822's `higher level
        syntactic breaks':  split points preceded by a splitchar are preferred
        during line splitting, with the characters preferred in the order in
        which they appear in the string.  Space and tab may be included in the
        string to indicate whether preference should be given to one over the
        other as a split point when other split chars do not appear in the line
        being split.  Splitchars does not affect RFC 2047 encoded lines.

        Optional linesep is a string to be used to separate the lines of
        the value.  The default value is the most useful for typical
        Python applications, but it can be set to \r\n to produce RFC-compliant
        line separators when needed.
        Nri@BrKrLFr
rrz8header value appears to contain an embedded header: {!r})rMrC�_ValueFormatterrDrAr
rP�add_transitionr�feed�newline�header_encodingr r(�_str�_embedded_headerrr�format)rE�
splitcharsr9�linesepZ	formatterrTrVrUrr�linesr1Zsline�fws�valuerrrrO9sZ!�
�

�z
Header.encodecCsxg}d}g}|jD]B\}}||kr.|�|�q|dk	rJ|�t�|�|f�|g}|}q|rn|�t�|�|f�||_dSrX)r
r!rQrS)rEZchunksr8Z
last_chunkrrrrrrM�szHeader._normalize)NNNNrr?)Nr?)r`Nr)
�__name__�
__module__�__qualname__rGrWrZr!rPrOrMrrrrr�s�
/ 
+
Pc@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)racCs0||_||_t|�|_||_g|_t|�|_dSrX)�_maxlenrAr(�_continuation_ws_len�_splitchars�_lines�_Accumulator�
_current_line)rEZ	headerlen�maxlenr;rirrrrG�s
z_ValueFormatter.__init__cCs|��|�|j�SrX)rdrSrt)rErjrrrrf�sz_ValueFormatter._strcCs
|�t�SrX)rf�NL�rErrrrW�sz_ValueFormatter.__str__cCsv|j��}|dkr|jj|�t|j�dkrh|j��rV|jrV|jdt|j�7<n|j�t|j��|j��dS)N)rr
rrL)	rvr�pushr(�	is_onlywsrtrr!�reset)rEZend_of_linerrrrd�s
z_ValueFormatter.newlinecCs|j�dd�dS)Nrr
)rvrzryrrrrb�sz_ValueFormatter.add_transitioncCs�|jdkr|�|||j�dS|�||���}z|�d�}Wntk
rRYdSX|dk	rh|�||�z|��}Wntk
r�YdSX|��|j	�
|j|�|D]}|j�
|j|�q�dS�Nr)re�_ascii_splitrsZheader_encode_lines�_maxlengthsr�
IndexError�
_append_chunkrdrvrzrArtr!)rErlrrZ
encoded_linesZ
first_line�	last_liner1rrrrc�s$
z_ValueFormatter.feedccs&|jt|j�V|j|jVqdSrX)rqr(rvrrryrrrr�sz_ValueFormatter._maxlengthscCsft�dtd||�}|dr0dg|dd�<n
|�d�tt|�gd�D]\}}|�||�qLdS)Nz([z]+)rr
r)�rer�FWSr�zip�iterr�)rErlrrir2�partrrrr~�s
z_ValueFormatter._ascii_splitcCs|j�||�t|j�|jk�r|jD]v}t|j��ddd�D]T}|��rn|j|d}|rn|d|krnq�|j|dd}|r@|d|kr@q�q@q&q�q&|j��\}}|jj	dkr�|�
�|s�d}|j�||�dS|j�|�}|j�
t|j��|j�|�dS)NrrrLr)rvrzr(rqrs�range�
part_countr$r�
_initial_sizerd�pop_fromrtr!rr|)rErlrZch�iZprevpartr�Z	remainderrrrr��s.
z_ValueFormatter._append_chunkN)rnrorprGrfrWrdrbrcrr~r�rrrrra�s%racsjeZdZd�fdd�	Zdd�Zddd�Z�fdd	�Zd
d�Zdd
�Zddd�Z	dd�Z
�fdd�Z�ZS)rurcs||_t���dSrX)r��superrG)rEZinitial_size��	__class__rrrGsz_Accumulator.__init__cCs|�||f�dSrX)r!)rErlrrrrrz#sz_Accumulator.pushcCs||d�}g||d�<|SrXr)rEr�Zpoppedrrrr�&sz_Accumulator.pop_fromcs|��dkrdSt���S)Nr)r
r
)r�r�rryr�rrr+sz_Accumulator.popcCstdd�|D�|j�S)Ncss"|]\}}t|�t|�VqdSrX)r(�rrlr�rrr�	<genexpr>1sz'_Accumulator.__len__.<locals>.<genexpr>)�sumr�ryrrr�__len__0s�z_Accumulator.__len__cCst�dd�|D��S)Ncss |]\}}t�||f�VqdSrX�rRrSr�rrrr�5s�z'_Accumulator.__str__.<locals>.<genexpr>r�ryrrrrW4s
�z_Accumulator.__str__NcCs"|dkrg}||dd�<d|_dSr})r�)rEZstartvalrrrr|8sz_Accumulator.resetcCs|jdko|pt|���Sr})r�rr$ryrrrr{>sz_Accumulator.is_onlywscs
t���SrX)r�r�ryr�rrr�Asz_Accumulator.part_count)r)r)N)
rnrorprGrzr�rr�rWr|r{r��
__classcell__rrr�rrus

ru)NNr)#�__doc__�__all__r�r*Zemail.quoprimimer&Zemail.base64mimeZemail.errorsrrrr<rxrQr/ZSPACE8rRrBr�r@r\�compile�VERBOSE�	MULTILINErZfcrergr'Z_max_appendrrrra�listrurrrr�<module>sF�
�

_�
kemail/__pycache__/_encoded_words.cpython-38.opt-1.pyc000064400000013070151153537640016423 0ustar00U

e5dL!�@s�dZddlZddlZddlZddlZddlmZmZddlm	Z	ddddd	d
ddgZ
e�e�d
�j
dd��Zdd�ZGdd�de�Ze�Zdeed�<dd�Zdd	�Zdd�Zdd�Zdd
�Zeed�Zdd�Zeed�Zeed�Zddd�ZdS) z� Routines for manipulating RFC2047 encoded words.

This is currently a package-private API, but will be considered for promotion
to a public API if there is demand.

�N)�
ascii_letters�digits)�errors�decode_q�encode_q�decode_b�encode_b�len_q�len_b�decode�encodes=([a-fA-F0-9]{2})cCst�|�d����S)N�)�bytes�fromhex�groupr)�m�r�,/usr/lib64/python3.8/email/_encoded_words.py�<lambda>A�rcCs|�dd�}t|�gfS)N�_� )�replace�_q_byte_subber)�encodedrrrrCsc@s,eZdZde�d�e�d�Zdd�ZdS)�	_QByteMaps-!*+/�asciicCs.||jkrt|�||<nd�|�||<||S)Nz={:02X})�safe�chr�format)�self�keyrrr�__missing__Ms
z_QByteMap.__missing__N)�__name__�
__module__�__qualname__rrrrr"rrrrrIsr�_� cCsd�dd�|D��S)N�css|]}t|VqdS�N)�_q_byte_map��.0�xrrr�	<genexpr>Zszencode_q.<locals>.<genexpr>)�join��bstringrrrrYscCstdd�|D��S)Ncss|]}tt|�VqdSr))�lenr*r+rrrr.]szlen_q.<locals>.<genexpr>)�sumr0rrrr	\scCs�t|�d}|r ddd|�nd}z&tj||dd�|rDt��gngfWStjk
�r�ztj|dd�t��gfWYStjk
r�z,tj|ddd�t��t��gfWYYStjk
r�|t��gfYYYSXYnXYnXdS)N�s===rT)ZvalidateFs==)	r2�base64Z	b64decoderZInvalidBase64PaddingDefect�binascii�ErrorZInvalidBase64CharactersDefectZInvalidBase64LengthDefect)rZpad_errZmissing_paddingrrrrds(��
��cCst�|��d�S)Nr)r5Z	b64encoderr0rrrr�scCs&tt|�d�\}}|d|r dndS)N�r4r)�divmodr2)r1Zgroups_of_3Zleftoverrrrr
�s)�q�bc	
Cs�|�d�\}}}}}|�d�\}}}|��}|�dd�}t||�\}}z|�|�}Wnvtk
r�|�t�	d�
|���|�|d�}YnBtk
r�|�dd�}|��dkr�|�t�d�
|���YnX||||fS)a�Decode encoded word and return (string, charset, lang, defects) tuple.

    An RFC 2047/2243 encoded word has the form:

        =?charset*lang?cte?encoded_string?=

    where '*lang' may be omitted but the other parts may not be.

    This function expects exactly such a string (that is, it does not check the
    syntax and may raise errors if the string is not well formed), and returns
    the encoded_string decoded first from its Content Transfer Encoding and
    then from the resulting bytes into unicode using the specified charset.  If
    the cte-decoded string does not successfully decode using the specified
    character set, a defect is added to the defects list and the unknown octets
    are replaced by the unicode 'unknown' character \uFDFF.

    The specified charset and language are returned.  The default for language,
    which is rarely if ever encountered, is the empty string.

    �?�*r�surrogateescapez:Encoded word contains bytes not decodable using {} charset�unknown-8bitz<Unknown charset {} in encoded word; decoded as unknown bytes)
�split�	partition�lowerr�
_cte_decodersr�UnicodeError�appendrZUndecodableBytesDefectr�LookupErrorZCharsetError)	Zewr&�charsetZcteZ
cte_string�langr1Zdefects�stringrrrr�s&���utf-8r(cCs||dkr|�dd�}n
|�|�}|dkrTtd|�}td|�}||dkrPdnd}t||�}|rld|}d	�||||�S)
aEncode string using the CTE encoding that produces the shorter result.

    Produces an RFC 2047/2243 encoded word of the form:

        =?charset*lang?cte?encoded_string?=

    where '*lang' is omitted unless the 'lang' parameter is given a value.
    Optional argument charset (defaults to utf-8) specifies the charset to use
    to encode the string to binary before CTE encoding it.  Optional argument
    'encoding' is the cte specifier for the encoding that should be used ('q'
    or 'b'); if it is None (the default) the encoding which produces the
    shortest encoded sequence is used, except that 'q' is preferred if it is up
    to five characters longer.  Optional argument 'lang' (default '') gives the
    RFC 2243 language string to specify in the encoded word.

    r?rr>Nr:r;�r=z=?{}{}?{}?{}?=)r�_cte_encode_length�
_cte_encodersr)rIrG�encodingrHr1ZqlenZblenrrrrr�s
)rJNr()�__doc__�rer5r6�	functoolsrIrrZemailr�__all__�partial�compile�subrr�dictrr*�ordrr	rrr
rCrrMrLrrrrr�<module>sL)��&�+��email/__pycache__/__init__.cpython-38.opt-1.pyc000064400000003235151153537640015206 0ustar00U

e5d��@sNdZddddddddd	d
ddd
ddddgZdd�Zdd
�Zdd
�Zdd�ZdS)z?A package for parsing, handling, and generating email messages.Z
base64mime�charsetZencoders�errorsZ
feedparser�	generator�headerZ	iterators�message�message_from_file�message_from_binary_file�message_from_string�message_from_bytesZmime�parserZ
quoprimimeZutilscOsddlm}|||��|�S)zvParse a string into a Message object model.

    Optional _class and strict are passed to the Parser constructor.
    ���Parser)�email.parserr
Zparsestr)�s�args�kwsr
�r�&/usr/lib64/python3.8/email/__init__.pyr scOsddlm}|||��|�S)z|Parse a bytes string into a Message object model.

    Optional _class and strict are passed to the Parser constructor.
    r��BytesParser)rrZ
parsebytes)rrrrrrrr	(scOsddlm}|||��|�S)z�Read a file and parse its contents into a Message object model.

    Optional _class and strict are passed to the Parser constructor.
    rr)rr
�parse)�fprrr
rrrr0scOsddlm}|||��|�S)z�Read a binary file and parse its contents into a Message object model.

    Optional _class and strict are passed to the Parser constructor.
    rr)rrr)rrrrrrrr8sN)�__doc__�__all__rr	rrrrrr�<module>s,�email/__pycache__/charset.cpython-38.pyc000064400000026305151153537640014144 0ustar00U

e5d�B�@srddddgZddlmZddlZddlZddlmZddlmZd	Z	d
Z
dZdZd
Z
dZdZe	e	dfe	e	dfe	e	dfe	e	dfe	e	dfe	e	dfe	e	dfe	e	dfe	e	dfe	e	dfe	e	dfe	e	dfde
e
dfe
e
dfe
ddfe
ddfe
ddfe
e
dfee
dfd�Zddddddddddddddddddddddd d
d!�Zd"d#dd$�Zd+d%d�Zd&d�Zd'd�Zd(d)�ZGd*d�d�ZdS),�Charset�	add_alias�add_charset�	add_codec�)�partialN)�errors)�encode_7or8bit�����us-asciizunknown-8bit�)NNN�iso-2022-jp�utf-8)�
iso-8859-1�
iso-8859-2�
iso-8859-3�
iso-8859-4�
iso-8859-9�iso-8859-10�iso-8859-13�iso-8859-14�iso-8859-15�iso-8859-16zwindows-1252Zvisciir
�big5�gb2312�euc-jp�	shift_jisrzkoi8-rrrrrrrrrrrrzks_c_5601-1987rzeuc-kr)�latin_1zlatin-1Zlatin_2zlatin-2Zlatin_3zlatin-3Zlatin_4zlatin-4Zlatin_5zlatin-5Zlatin_6zlatin-6Zlatin_7zlatin-7Zlatin_8zlatin-8Zlatin_9zlatin-9Zlatin_10zlatin-10�cp949�euc_jp�euc_kr�ascii�eucgb2312_cn�big5_tw)rrr
cCs"|tkrtd��|||ft|<dS)a>Add character set properties to the global registry.

    charset is the input character set, and must be the canonical name of a
    character set.

    Optional header_enc and body_enc is either Charset.QP for
    quoted-printable, Charset.BASE64 for base64 encoding, Charset.SHORTEST for
    the shortest of qp or base64 encoding, or None for no encoding.  SHORTEST
    is only valid for header_enc.  It describes how message headers and
    message bodies in the input charset are to be encoded.  Default is no
    encoding.

    Optional output_charset is the character set that the output should be
    in.  Conversions will proceed from input charset, to Unicode, to the
    output charset when the method Charset.convert() is called.  The default
    is to output in the same character set as the input.

    Both input_charset and output_charset must have Unicode codec entries in
    the module's charset-to-codec mapping; use add_codec(charset, codecname)
    to add codecs the module does not know about.  See the codecs module's
    documentation for more information.
    z!SHORTEST not allowed for body_encN)�SHORTEST�
ValueError�CHARSETS)�charsetZ
header_encZbody_enc�output_charset�r+�%/usr/lib64/python3.8/email/charset.pyrmscCs|t|<dS)z�Add a character set alias.

    alias is the alias name, e.g. latin-1
    canonical is the character set's canonical name, e.g. iso-8859-1
    N)�ALIASES)�aliasZ	canonicalr+r+r,r�scCs|t|<dS)a$Add a codec that map characters in the given charset to/from Unicode.

    charset is the canonical name of a character set.  codecname is the name
    of a Python codec, as appropriate for the second argument to the unicode()
    built-in, or to the encode() method of a Unicode string.
    N)�	CODEC_MAP)r)Z	codecnamer+r+r,r�scCs"|tkr|�dd�S|�|�SdS)Nr#�surrogateescape)�UNKNOWN8BIT�encode)�string�codecr+r+r,�_encode�sr5c@s\eZdZdZefdd�Zdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dS)ra@	Map character sets to their email properties.

    This class provides information about the requirements imposed on email
    for a specific character set.  It also provides convenience routines for
    converting between character sets, given the availability of the
    applicable codecs.  Given a character set, it will do its best to provide
    information on how to use that character set in an email in an
    RFC-compliant way.

    Certain character sets must be encoded with quoted-printable or base64
    when used in email headers or bodies.  Certain character sets must be
    converted outright, and are not allowed in email.  Instances of this
    module expose the following information about a character set:

    input_charset: The initial character set specified.  Common aliases
                   are converted to their `official' email names (e.g. latin_1
                   is converted to iso-8859-1).  Defaults to 7-bit us-ascii.

    header_encoding: If the character set must be encoded before it can be
                     used in an email header, this attribute will be set to
                     Charset.QP (for quoted-printable), Charset.BASE64 (for
                     base64 encoding), or Charset.SHORTEST for the shortest of
                     QP or BASE64 encoding.  Otherwise, it will be None.

    body_encoding: Same as header_encoding, but describes the encoding for the
                   mail message's body, which indeed may be different than the
                   header encoding.  Charset.SHORTEST is not allowed for
                   body_encoding.

    output_charset: Some character sets must be converted before they can be
                    used in email headers or bodies.  If the input_charset is
                    one of them, this attribute will contain the name of the
                    charset output will be converted to.  Otherwise, it will
                    be None.

    input_codec: The name of the Python codec used to convert the
                 input_charset to Unicode.  If no conversion codec is
                 necessary, this attribute will be None.

    output_codec: The name of the Python codec used to convert Unicode
                  to the output_charset.  If no conversion codec is necessary,
                  this attribute will have the same value as the input_codec.
    cCs�z$t|t�r|�d�n
t|d�}Wntk
rBt�|��YnX|��}t�||�|_	t
�|j	ttdf�\}}}|s~|j	}||_
||_t�||�|_t�|j	|j	�|_t�|j|j�|_dS)Nr#)�
isinstance�strr2�UnicodeErrorrZCharsetError�lowerr-�get�
input_charsetr(r&�BASE64�header_encoding�
body_encodingr*r/Zinput_codec�output_codec)�selfr;ZhencZbencZconvr+r+r,�__init__�s,
�
��zCharset.__init__cCs
|j��S�N)r;r9�r@r+r+r,�__repr__�szCharset.__repr__cCst|�t|���kSrB)r7r9)r@�otherr+r+r,�__eq__�szCharset.__eq__cCs2|jtkst�|jtkrdS|jtkr*dStSdS)aPReturn the content-transfer-encoding used for body encoding.

        This is either the string `quoted-printable' or `base64' depending on
        the encoding used, or it is a function in which case you should call
        the function with a single argument, the Message object being
        encoded.  The function should then set the Content-Transfer-Encoding
        header itself to whatever is appropriate.

        Returns "quoted-printable" if self.body_encoding is QP.
        Returns "base64" if self.body_encoding is BASE64.
        Returns conversion function otherwise.
        zquoted-printable�base64N)r>r&�AssertionError�QPr<rrCr+r+r,�get_body_encoding�s


zCharset.get_body_encodingcCs|jp
|jS)z�Return the output character set.

        This is self.output_charset if that is not None, otherwise it is
        self.input_charset.
        )r*r;rCr+r+r,�get_output_charsetszCharset.get_output_charsetcCs6|jpd}t||�}|�|�}|dkr*|S|�||�S)a�Header-encode a string by converting it first to bytes.

        The type of encoding (base64 or quoted-printable) will be based on
        this charset's `header_encoding`.

        :param string: A unicode string for the header.  It must be possible
            to encode this string to bytes using the character set's
            output codec.
        :return: The encoded string, with RFC 2047 chrome.
        r
N)r?r5�_get_encoder�
header_encode)r@r3r4�header_bytes�encoder_moduler+r+r,rMs


zCharset.header_encodecCs|jpd}t||�}|�|�}t|j|d�}|��}t|�t}g}	g}
t|�|}|D]�}|
�	|�t
�|
�}
|�t|
|��}||krX|
�
�|	s�|
s�|	�	d�n.|	r�dnd}t
�|
�}t||�}|	�	||��|g}
t|�|}qXt
�|
�}t||�}|	�	||��|	S)afHeader-encode a string by converting it first to bytes.

        This is similar to `header_encode()` except that the string is fit
        into maximum line lengths as given by the argument.

        :param string: A unicode string for the header.  It must be possible
            to encode this string to bytes using the character set's
            output codec.
        :param maxlengths: Maximum line length iterator.  Each element
            returned from this iterator will provide the next maximum line
            length.  This parameter is used as an argument to built-in next()
            and should never be exhausted.  The maximum line lengths should
            not count the RFC 2047 chrome.  These line lengths are only a
            hint; the splitter does the best it can.
        :return: Lines of encoded strings, each with RFC 2047 chrome.
        r
)r)N� r)r?r5rLrrMrK�len�RFC2047_CHROME_LEN�next�append�EMPTYSTRING�join�
header_length�pop)r@r3Z
maxlengthsr4rNrO�encoderr)Zextra�linesZcurrent_line�maxlen�	characterZ	this_lineZlengthZ	separatorZjoined_liner+r+r,�header_encode_lines*s6








zCharset.header_encode_linescCs`|jtkrtjS|jtkr tjS|jtkrXtj�|�}tj�|�}||krPtjStjSndSdSrB)r=r<�email�
base64mimerI�
quoprimimer&rW)r@rNZlen64Zlenqpr+r+r,rLhs


zCharset._get_encodercCs�|s|S|jtkr4t|t�r(|�|j�}tj�|�S|jt	krjt|t�rT|�|j�}|�
d�}tj�|�St|t�r�|�|j��
d�}|SdS)avBody-encode a string by converting it first to bytes.

        The type of encoding (base64 or quoted-printable) will be based on
        self.body_encoding.  If body_encoding is None, we assume the
        output charset is a 7bit encoding, so re-encoding the decoded
        string using the ascii codec produces the correct string version
        of the content.
        �latin1r#N)r>r<r6r7r2r*r^r_�body_encoderI�decoder`)r@r3r+r+r,rbws	





zCharset.body_encodeN)�__name__�
__module__�__qualname__�__doc__�DEFAULT_CHARSETrArDrFrJrKrMr]rLrbr+r+r+r,r�s+!>)NNN)�__all__�	functoolsrZemail.base64mimer^Zemail.quoprimimerZemail.encodersrrIr<r&rRrhr1rUr(r-r/rrrr5rr+r+r+r,�<module>s��� ��
	
email/__pycache__/policy.cpython-38.pyc000064400000022674151153537640014017 0ustar00U

e5d�(�@s�dZddlZddlZddlmZmZmZmZddlm	Z	ddl
mZddlm
Z
ddlmZdd	d
ddd
ddgZe�d�ZeGdd�de��Ze�Ze`ejdd�Zejdd�Zejddd�Zejdd�ZdS)zcThis will be the home for the policy that hooks in the new
code that adds all the email6 features.
�N)�Policy�Compat32�compat32�_extend_docstrings)�_has_surrogates)�HeaderRegistry)�raw_data_manager)�EmailMessagerrr�EmailPolicy�default�strict�SMTP�HTTPz\n|\rcspeZdZdZeZdZdZe�Z	e
Z�fdd�Zdd�Z
dd	�Zd
d�Zdd
�Zdd�Zdd�Zddd�Z�ZS)r
aQ+
    PROVISIONAL

    The API extensions enabled by this policy are currently provisional.
    Refer to the documentation for details.

    This policy adds new header parsing and folding algorithms.  Instead of
    simple strings, headers are custom objects with custom attributes
    depending on the type of the field.  The folding algorithm fully
    implements RFCs 2047 and 5322.

    In addition to the settable attributes listed above that apply to
    all Policies, this policy adds the following additional attributes:

    utf8                -- if False (the default) message headers will be
                           serialized as ASCII, using encoded words to encode
                           any non-ASCII characters in the source strings.  If
                           True, the message headers will be serialized using
                           utf8 and will not contain encoded words (see RFC
                           6532 for more on this serialization format).

    refold_source       -- if the value for a header in the Message object
                           came from the parsing of some source, this attribute
                           indicates whether or not a generator should refold
                           that value when transforming the message back into
                           stream form.  The possible values are:

                           none  -- all source values use original folding
                           long  -- source values that have any line that is
                                    longer than max_line_length will be
                                    refolded
                           all  -- all values are refolded.

                           The default is 'long'.

    header_factory      -- a callable that takes two arguments, 'name' and
                           'value', where 'name' is a header field name and
                           'value' is an unfolded header field value, and
                           returns a string-like object that represents that
                           header.  A default header_factory is provided that
                           understands some of the RFC5322 header field types.
                           (Currently address fields and date fields have
                           special treatment, while all other fields are
                           treated as unstructured.  This list will be
                           completed before the extension is marked stable.)

    content_manager     -- an object with at least two methods: get_content
                           and set_content.  When the get_content or
                           set_content method of a Message object is called,
                           it calls the corresponding method of this object,
                           passing it the message object as its first argument,
                           and any arguments or keywords that were passed to
                           it as additional arguments.  The default
                           content_manager is
                           :data:`~email.contentmanager.raw_data_manager`.

    F�longcs*d|krt�|dt��t�jf|�dS)N�header_factory)�object�__setattr__r�super�__init__)�self�kw��	__class__��$/usr/lib64/python3.8/email/policy.pyr]szEmailPolicy.__init__cCs|j|jS)z�+
        The implementation for this class returns the max_count attribute from
        the specialized header class that would be used to construct a header
        of type 'name'.
        )rZ	max_count)r�namerrr�header_max_countdszEmailPolicy.header_max_countcCs>|d�dd�\}}|�d�d�|dd��}||�d�fS)ac+
        The name is parsed as everything up to the ':' and returned unmodified.
        The value is determined by stripping leading whitespace off the
        remainder of the first line, joining all subsequent lines together, and
        stripping any trailing carriage return or linefeed characters.  (This
        is the same as Compat32).

        r�:�z 	�N�
)�split�lstrip�join�rstrip)rZsourcelinesr�valuerrr�header_source_parsevs	zEmailPolicy.header_source_parsecCsVt|d�r$|j��|��kr$||fSt|t�rFt|���dkrFtd��||�||�fS)a�+
        The name is returned unchanged.  If the input value has a 'name'
        attribute and it matches the name ignoring case, the value is returned
        unchanged.  Otherwise the name and value are passed to header_factory
        method, and the resulting custom header object is returned as the
        value.  In this case a ValueError is raised if the input value contains
        CR or LF characters.

        rrzDHeader values may not contain linefeed or carriage return characters)	�hasattrr�lower�
isinstance�str�len�
splitlines�
ValueErrorr�rrr%rrr�header_store_parse�s

zEmailPolicy.header_store_parsecCs*t|d�r|Sd�t�|��}|�||�S)ai+
        If the value has a 'name' attribute, it is returned to unmodified.
        Otherwise the name and the value with any linesep characters removed
        are passed to the header_factory method, and the resulting custom
        header object is returned.  Any surrogateescaped bytes get turned
        into the unicode unknown-character glyph.

        rr)r'r#�linesep_splitterr!rr.rrr�header_fetch_parse�s	
zEmailPolicy.header_fetch_parsecCs|j||dd�S)a+
        Header folding is controlled by the refold_source policy setting.  A
        value is considered to be a 'source value' if and only if it does not
        have a 'name' attribute (having a 'name' attribute means it is a header
        object of some sort).  If a source value needs to be refolded according
        to the policy, it is converted into a custom header object by passing
        the name and the value with any linesep characters removed to the
        header_factory method.  Folding of a custom header object is done by
        calling its fold method with the current policy.

        Source values are split into lines using splitlines.  If the value is
        not to be refolded, the lines are rejoined using the linesep from the
        policy and returned.  The exception is lines containing non-ascii
        binary data.  In that case the value is refolded regardless of the
        refold_source setting, which causes the binary data to be CTE encoded
        using the unknown-8bit charset.

        T��
refold_binary)�_foldr.rrr�fold�szEmailPolicy.foldcCs0|j|||jdkd�}|jr dnd}|�|d�S)a+
        The same as fold if cte_type is 7bit, except that the returned value is
        bytes.

        If cte_type is 8bit, non-ASCII binary data is converted back into
        bytes.  Headers with binary data are not refolded, regardless of the
        refold_header setting, since there is no way to know whether the binary
        data consists of single byte characters or multibyte characters.

        If utf8 is true, headers are encoded to utf8, otherwise to ascii with
        non-ASCII unicode rendered as encoded words.

        Z7bitr2�utf8�ascii�surrogateescape)r4Zcte_typer6�encode)rrr%Zfolded�charsetrrr�fold_binary�szEmailPolicy.fold_binarycs�t|d�r|j|d�S|jr"|jntj�|��}|jdkp�|jdko�|rdt|d�t|�d�kp�t�fdd�|d	d�D��}|s�|r�t	|�r�|�
|d
�|��j|d�S|d|j�|�|jS)Nr)Zpolicy�allrr�c3s|]}t|��kVqdS)N)r+)�.0�x��maxlenrr�	<genexpr>�sz$EmailPolicy._fold.<locals>.<genexpr>rrz: )
r'r5�max_line_length�sys�maxsizer,�
refold_sourcer+�anyrrr#�linesep)rrr%r3�linesZrefoldrr@rr4�s


 �zEmailPolicy._fold)F)�__name__�
__module__�__qualname__�__doc__r	Zmessage_factoryr6rFrrrZcontent_managerrrr&r/r1r5r;r4�
__classcell__rrrrr
s:
T)Zraise_on_defectr )rH)rHrC)r6)rM�rerDZemail._policybaserrrrZemail.utilsrZemail.headerregistryrZemail.contentmanagerrZ
email.messager	�__all__�compiler0r
rrZclonerr
rZSMTPUTF8rrrr�<module>s4�
@email/__pycache__/message.cpython-38.opt-1.pyc000064400000111770151153537640015077 0ustar00U

e5d��@s�dZddgZddlZddlZddlZddlmZmZddlm	Z	ddlm
Z
ddlmZm
Z
dd	lmZdd
lmZejZdZe�d�Zd
d�Zddd�Zdd�Zdd�ZGdd�d�ZGdd�de�ZGdd�de�ZdS)z8Basic message object for the email package object model.�Message�EmailMessage�N)�BytesIO�StringIO)�utils)�errors)�Policy�compat32��charset)�decode_bz; z[ \(\)<>@,;:\\"/\[\]\?=]cCs4t|��d�\}}}|s$|��dfS|��|��fS)N�;)�str�	partition�strip)�param�a�sep�b�r�%/usr/lib64/python3.8/email/message.py�_splitparamsrTcCs�|dk	r�t|�dkr�t|t�rL|d7}t�|d|d|d�}d||fSz|�d�Wn6tk
r�|d7}t�|dd	�}d||fYSX|s�t�|�r�d
|t�	|�fSd||fSn|SdS)a~Convenience function to format and return a key=value pair.

    This will quote the value if needed or if quote is true.  If value is a
    three tuple (charset, language, value), it will be encoded according
    to RFC2231 rules.  If it contains non-ascii characters it will likewise
    be encoded according to RFC2231 rules, using the utf-8 charset and
    a null language.
    Nr�*���%s=%s�asciizutf-8�z%s="%s")
�len�
isinstance�tuplerZencode_rfc2231�encode�UnicodeEncodeError�	tspecials�search�quote)r�valuer%rrr�_formatparam's	
r'cCs�dt|�}g}|dd�dkr�|dd�}|�d�}|dkrp|�dd|�|�dd|�drp|�d|d�}q6|dkr�t|�}|d|�}d|kr�|�d�}|d|�����d||dd���}|�|���||d�}q|S)Nr
rr�"z\"r�=)r�find�countr�indexr�lower�append)�sZplist�end�f�irrr�_parseparamIs 
(
,r3cCs4t|t�r&|d|dt�|d�fSt�|�SdS)Nrrr)rr r�unquote)r&rrr�
_unquotevalue]s
r5c@s�eZdZdZefdd�Zdd�Zddd	d
�Zdd�Zded
d�Z	dd�Z
dd�Zdd�Zdd�Z
dfdd�Zdgdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zdhd1d2�Zd3d4�Zd5d6�Zdid7d8�Zd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dAdB�Z#dCdD�Z$dEdF�Z%dGdH�Z&djdKdL�Z'dkdMdN�Z(dldQdR�Z)dmdSdT�Z*dndUdV�Z+dodWdX�Z,dpdYdZ�Z-d[d\�Z.dqd]d^�Z/drd_d`�Z0dadb�Z1ddcl2m3Z3dS)sra�Basic message object.

    A message object is defined as something that has a bunch of RFC 2822
    headers and a payload.  It may optionally have an envelope header
    (a.k.a. Unix-From or From_ header).  If the message is a container (i.e. a
    multipart or a message/rfc822), then the payload is a list of Message
    objects, otherwise it is a string.

    Message objects implement part of the `mapping' interface, which assumes
    there is exactly one occurrence of the header per message.  Some headers
    do in fact appear multiple times (e.g. Received) and for those headers,
    you must use the explicit API to set or get all the headers.  Not all of
    the mapping methods are implemented.
    cCs:||_g|_d|_d|_d|_d|_|_g|_d|_dS)N�
text/plain)	�policy�_headers�	_unixfrom�_payload�_charsetZpreambleZepilogue�defects�
_default_type)�selfr7rrr�__init__xszMessage.__init__cCs|��S)z9Return the entire formatted message as a string.
        )�	as_string�r>rrr�__str__�szMessage.__str__FrNcCsJddlm}|dkr|jn|}t�}||d||d�}|j||d�|��S)a�Return the entire formatted message as a string.

        Optional 'unixfrom', when true, means include the Unix From_ envelope
        header.  For backward compatibility reasons, if maxheaderlen is
        not specified it defaults to 0, so you must override it explicitly
        if you want a different maxheaderlen.  'policy' is passed to the
        Generator instance used to serialize the message; if it is not
        specified the policy associated with the message instance is used.

        If the message object contains binary data that is not encoded
        according to RFC standards, the non-compliant data will be replaced by
        unicode "unknown character" code points.
        r)�	GeneratorNF)�mangle_from_�maxheaderlenr7��unixfrom)�email.generatorrCr7r�flatten�getvalue)r>rGrEr7rC�fp�grrrr@�s�zMessage.as_stringcCs|��S)z?Return the entire formatted message as a bytes object.
        )�as_bytesrArrr�	__bytes__�szMessage.__bytes__cCsHddlm}|dkr|jn|}t�}||d|d�}|j||d�|��S)aJReturn the entire formatted message as a bytes object.

        Optional 'unixfrom', when true, means include the Unix From_ envelope
        header.  'policy' is passed to the BytesGenerator instance used to
        serialize the message; if not specified the policy associated with
        the message instance is used.
        r)�BytesGeneratorNF)rDr7rF)rHrOr7rrIrJ)r>rGr7rOrKrLrrrrM�szMessage.as_bytescCst|jt�S)z6Return True if the message consists of multiple parts.)rr:�listrArrr�is_multipart�szMessage.is_multipartcCs
||_dS�N�r9)r>rGrrr�set_unixfrom�szMessage.set_unixfromcCs|jSrRrSrArrr�get_unixfrom�szMessage.get_unixfromcCsF|jdkr|g|_n.z|j�|�Wntk
r@td��YnXdS)z�Add the given payload to the current payload.

        The current payload will always be a list of objects after this method
        is called.  If you want to set the payload to a scalar object, use
        set_payload() instead.
        Nz=Attach is not valid on a message with a non-multipart payload)r:r.�AttributeError�	TypeError)r>�payloadrrr�attach�s

zMessage.attachcCs�|��r(|rdS|dkr|jS|j|S|dk	rNt|jt�sNtdt|j���|j}t|�dd����}t|t�r�t	�
|�r�|�dd�}|s�z|�|�
dd�d�}Wq�tk
r�|�dd�}Yq�Xn2|r�z|�d�}Wntk
r�|�d	�}YnX|�s|S|d
k�rt�|�S|dk�rVtd�|����\}}|D]}|j�||��q<|S|d
k�r�t|�}	t�}
ztj|	|
dd�|
��WStjk
�r�|YSXt|t��r�|S|S)aZReturn a reference to the payload.

        The payload will either be a list object or a string.  If you mutate
        the list object, you modify the message's payload in place.  Optional
        i returns that index into the payload.

        Optional decode is a flag indicating whether the payload should be
        decoded or not, according to the Content-Transfer-Encoding header
        (default is False).

        When True and the message is not a multipart, the payload will be
        decoded if this header's value is `quoted-printable' or `base64'.  If
        some other encoding is used, or the header is missing, or if the
        payload has bogus data (i.e. bogus base64 or uuencoded data), the
        payload is returned as-is.

        If the message is a multipart and the decode flag is True, then None
        is returned.
        NzExpected list, got %szcontent-transfer-encodingrr�surrogateescaper�replace�raw-unicode-escapezquoted-printable�base64�)z
x-uuencodeZuuencodeZuuezx-uueT)�quiet)rQr:rrPrW�typer�getr-rZ_has_surrogatesr!�decode�	get_param�LookupError�UnicodeError�quopriZdecodestringr�join�
splitlinesr7Z
handle_defectr�uurJ�Error)r>r2rbrX�cteZbpayloadr&r<ZdefectZin_fileZout_filerrr�get_payload�sV"








zMessage.get_payloadcCspt|d�r:|dkr||_dSt|t�s.t|�}|�|j�}t|d�rT|�dd�|_n||_|dk	rl|�|�dS)z�Set the payload to the given value.

        Optional charset sets the message's default character set.  See
        set_charset() for details.
        r!NrbrrZ)�hasattrr:r�Charsetr!�output_charsetrb�set_charset)r>rXrrrr�set_payload/s


zMessage.set_payloadcCs|dkr|�d�d|_dSt|t�s.t|�}||_d|krH|�dd�d|krf|jdd|��d�n|�d|���||��kr�|�|j�|_d|k�r|�	�}z||�Wnjt
k
�r|j}|r�z|�d	d
�}Wn tk
r�|�|j
�}YnX|�|�|_|�d|�YnXdS)a�Set the charset of the payload to a given character set.

        charset can be a Charset instance, a string naming a character set, or
        None.  If it is a string it will be converted to a Charset instance.
        If charset is None, the charset parameter will be removed from the
        Content-Type field.  Anything else will generate a TypeError.

        The message will be assumed to be of type text/* encoded with
        charset.input_charset.  It will be converted to charset.output_charset
        and encoded properly, if needed, when generating the plain text
        representation of the message.  MIME headers (MIME-Version,
        Content-Type, Content-Transfer-Encoding) will be added as needed.
        Nr�MIME-Version�1.0�Content-Typer6r
zContent-Transfer-EncodingrrZ)�	del_paramr;rrn�
add_headerZget_output_charset�	set_paramZbody_encoder:Zget_body_encodingrWr!rero)r>rrkrXrrrrpCs:

�
zMessage.set_charsetcCs|jS)zKReturn the Charset instance associated with the message's payload.
        )r;rArrr�get_charsetrszMessage.get_charsetcCs
t|j�S)z9Return the total number of headers, including duplicates.)rr8rArrr�__len__zszMessage.__len__cCs
|�|�S)a-Get a header value.

        Return None if the header is missing instead of raising an exception.

        Note that if the header appeared multiple times, exactly which
        occurrence gets returned is undefined.  Use get_all() to get all
        the values matching a header field name.
        )ra�r>�namerrr�__getitem__~s	zMessage.__getitem__cCsr|j�|�}|rX|��}d}|jD]4\}}|��|kr"|d7}||kr"td�||���q"|j�|j�||��dS)z�Set the value of a header.

        Note: this does not overwrite an existing header with the same field
        name.  Use __delitem__() first to delete any existing headers.
        rrz/There may be at most {} {} headers in a messageN)r7Zheader_max_countr-r8�
ValueError�formatr.�header_store_parse)r>r{�valZ	max_countZlname�found�k�vrrr�__setitem__�s�zMessage.__setitem__cCs@|��}g}|jD]"\}}|��|kr|�||f�q||_dS)zwDelete all occurrences of a header, if present.

        Does not raise an exception if the header is missing.
        N)r-r8r.)r>r{�
newheadersr�r�rrr�__delitem__�szMessage.__delitem__cCs|��dd�|jD�kS)NcSsg|]\}}|���qSr)r-��.0r�r�rrr�
<listcomp>�sz(Message.__contains__.<locals>.<listcomp>)r-r8rzrrr�__contains__�szMessage.__contains__ccs|jD]\}}|VqdSrR�r8)r>Zfieldr&rrr�__iter__�szMessage.__iter__cCsdd�|jD�S)a.Return a list of all the message's header field names.

        These will be sorted in the order they appeared in the original
        message, or were added to the message, and may contain duplicates.
        Any fields deleted and re-inserted are always appended to the header
        list.
        cSsg|]\}}|�qSrrr�rrrr��sz Message.keys.<locals>.<listcomp>r�rArrr�keys�szMessage.keyscs�fdd��jD�S)a)Return a list of all the message's header values.

        These will be sorted in the order they appeared in the original
        message, or were added to the message, and may contain duplicates.
        Any fields deleted and re-inserted are always appended to the header
        list.
        csg|]\}}�j�||��qSr�r7�header_fetch_parser�rArrr��s�z"Message.values.<locals>.<listcomp>r�rArrAr�values�s
�zMessage.valuescs�fdd��jD�S)a'Get all the message's header fields and values.

        These will be sorted in the order they appeared in the original
        message, or were added to the message, and may contain duplicates.
        Any fields deleted and re-inserted are always appended to the header
        list.
        cs"g|]\}}|�j�||�f�qSrr�r�rArrr��s�z!Message.items.<locals>.<listcomp>r�rArrAr�items�s
�z
Message.itemscCs:|��}|jD]&\}}|��|kr|j�||�Sq|S)z~Get a header value.

        Like __getitem__() but return failobj instead of None when the field
        is missing.
        )r-r8r7r�)r>r{�failobjr�r�rrrra�s
zMessage.getcCs|j�||f�dS)z�Store name and value in the model without modification.

        This is an "internal" API, intended only for use by a parser.
        N)r8r.)r>r{r&rrr�set_raw�szMessage.set_rawcCst|j���S)z�Return the (name, value) header pairs without modification.

        This is an "internal" API, intended only for use by a generator.
        )�iterr8�copyrArrr�	raw_items�szMessage.raw_itemscCsHg}|��}|jD](\}}|��|kr|�|j�||��q|sD|S|S)aQReturn a list of all the values for the named field.

        These will be sorted in the order they appeared in the original
        message, and may contain duplicates.  Any fields deleted and
        re-inserted are always appended to the header list.

        If no such fields exist, failobj is returned (defaults to None).
        )r-r8r.r7r�)r>r{r�r�r�r�rrr�get_all�s	zMessage.get_allcKspg}|��D]<\}}|dkr0|�|�dd��q|�t|�dd�|��q|dk	r^|�d|�t�|�||<dS)u�Extended header setting.

        name is the header field to add.  keyword arguments can be used to set
        additional parameters for the header field, with underscores converted
        to dashes.  Normally the parameter will be added as key="value" unless
        value is None, in which case only the key will be added.  If a
        parameter value contains non-ASCII characters it can be specified as a
        three-tuple of (charset, language, value), in which case it will be
        encoded according to RFC2231 rules.  Otherwise it will be encoded using
        the utf-8 charset and a language of ''.

        Examples:

        msg.add_header('content-disposition', 'attachment', filename='bud.gif')
        msg.add_header('content-disposition', 'attachment',
                       filename=('utf-8', '', Fußballer.ppt'))
        msg.add_header('content-disposition', 'attachment',
                       filename='Fußballer.ppt'))
        N�_�-r)r�r.r[r'�insert�	SEMISPACErg)r>�_name�_valueZ_params�partsr�r�rrrrvszMessage.add_headercCs\|��}ttt|j��|j�D]0\}\}}|��|kr|j�||�|j|<qXqt|��dS)z�Replace a header.

        Replace the first matching header found in the message, retaining
        header order and case.  If no matching header was found, a KeyError is
        raised.
        N)r-�zip�rangerr8r7r�KeyError)r>r�r�r2r�r�rrr�replace_header!s"zMessage.replace_headercCsHt�}|�d|�}||kr"|��St|�d��}|�d�dkrDdS|S)a0Return the message's content type.

        The returned string is coerced to lower case of the form
        `maintype/subtype'.  If there was no Content-Type header in the
        message, the default type as given by get_default_type() will be
        returned.  Since according to RFC 2045, messages always have a default
        type this will always return a value.

        RFC 2045 defines a message's default type to be text/plain unless it
        appears inside a multipart/digest container, in which case it would be
        message/rfc822.
        �content-typer�/rr6)�objectra�get_default_typerr-r+)r>�missingr&�ctyperrr�get_content_type4s
zMessage.get_content_typecCs|��}|�d�dS)z�Return the message's main content type.

        This is the `maintype' part of the string returned by
        get_content_type().
        r�r�r��split�r>r�rrr�get_content_maintypeLszMessage.get_content_maintypecCs|��}|�d�dS)z�Returns the message's sub-content type.

        This is the `subtype' part of the string returned by
        get_content_type().
        r�rr�r�rrr�get_content_subtypeUszMessage.get_content_subtypecCs|jS)aReturn the `default' content type.

        Most messages have a default content type of text/plain, except for
        messages that are subparts of multipart/digest containers.  Such
        subparts have a default content type of message/rfc822.
        �r=rArrrr�^szMessage.get_default_typecCs
||_dS)z�Set the `default' content type.

        ctype should be either "text/plain" or "message/rfc822", although this
        is not enforced.  The default content type is not stored in the
        Content-Type header.
        Nr�r�rrr�set_default_typegszMessage.set_default_typec		Cs�t�}|�||�}||kr|Sg}t|�D]X}z$|�dd�\}}|��}|��}Wn tk
rr|��}d}YnX|�||f�q*t�|�}|S)Nr)rr)	r�rar3r�rr}r.rZ
decode_params)	r>r��headerr�r&�params�pr{r�rrr�_get_params_preserveps 

zMessage._get_params_preserver�TcCs8t�}|�||�}||kr|S|r0dd�|D�S|SdS)amReturn the message's Content-Type parameters, as a list.

        The elements of the returned list are 2-tuples of key/value pairs, as
        split on the `=' sign.  The left hand side of the `=' is the key,
        while the right hand side is the value.  If there is no `=' sign in
        the parameter the value is the empty string.  The value is as
        described in the get_param() method.

        Optional failobj is the object to return if there is no Content-Type
        header.  Optional header is the header to search instead of
        Content-Type.  If unquote is True, the value is unquoted.
        cSsg|]\}}|t|�f�qSr)r5r�rrrr��sz&Message.get_params.<locals>.<listcomp>N)r�r�)r>r�r�r4r�r�rrr�
get_params�s
zMessage.get_paramscCsN||kr|S|�||�D]0\}}|��|��kr|r@t|�S|Sq|S)a�Return the parameter value if found in the Content-Type header.

        Optional failobj is the object to return if there is no Content-Type
        header, or the Content-Type header has no such parameter.  Optional
        header is the header to search instead of Content-Type.

        Parameter keys are always compared case insensitively.  The return
        value can either be a string, or a 3-tuple if the parameter was RFC
        2231 encoded.  When it's a 3-tuple, the elements of the value are of
        the form (CHARSET, LANGUAGE, VALUE).  Note that both CHARSET and
        LANGUAGE can be None, in which case you should consider VALUE to be
        encoded in the us-ascii charset.  You can usually ignore LANGUAGE.
        The parameter value (either the returned string, or the VALUE item in
        the 3-tuple) is always unquoted, unless unquote is set to False.

        If your application doesn't care whether the parameter was RFC 2231
        encoded, it can turn the return value into a string as follows:

            rawparam = msg.get_param('foo')
            param = email.utils.collapse_rfc2231_value(rawparam)

        )r�r-r5)r>rr�r�r4r�r�rrrrc�s
zMessage.get_paramrtrcCs
t|t�s|r|||f}||kr2|��dkr2d}n
|�|�}|j||d�st|s\t|||�}q�t�|t|||�g�}nbd}|j||d�D]N\}	}
d}|	��|��kr�t|||�}nt|	|
|�}|s�|}q�t�||g�}q�||�|�k�r|r�|�	||�n||=|||<dS)a�Set a parameter in the Content-Type header.

        If the parameter already exists in the header, its value will be
        replaced with the new value.

        If header is Content-Type and has not yet been defined for this
        message, it will be set to "text/plain" and the new parameter and
        value will be appended as per RFC 2045.

        An alternate header can be specified in the header argument, and all
        parameters will be quoted as necessary unless requote is False.

        If charset is specified, the parameter will be encoded according to RFC
        2231.  Optional language specifies the RFC 2231 language, defaulting
        to the empty string.  Both charset and language should be strings.
        r�r6)r�r�r�r4N)
rr r-rarcr'r�rgr�r�)r>rr&r��requoterZlanguager[r�Z	old_param�	old_valueZappend_paramrrrrw�s6

��zMessage.set_paramcCs�||krdSd}|j||d�D]@\}}|��|��kr|sHt|||�}qt�|t|||�g�}q||�|�kr|||=|||<dS)a>Remove the given parameter completely from the Content-Type header.

        The header will be re-written in place without the parameter or its
        value. All values will be quoted as necessary unless requote is
        False.  Optional header specifies an alternative to the Content-Type
        header.
        Nrr�)r�r-r'r�rgra)r>rr�r�Z	new_ctyper�r�rrrru�s
�zMessage.del_paramcCs�|�d�dkst�|��dkr,|d=d|d<||kr@|||<dS|j||d�}||=|||<|dd�D]\}}|�||||�qhdS)	aKSet the main type and subtype for the Content-Type header.

        type must be a string in the form "maintype/subtype", otherwise a
        ValueError is raised.

        This method replaces the Content-Type header, keeping all the
        parameters in place.  If requote is False, this leaves the existing
        header's quoting as is.  Otherwise, the parameters will be quoted (the
        default).

        An alternative header can be specified in the header argument.  When
        the Content-Type header is set, we'll always also add a MIME-Version
        header.
        r�rr�zmime-versionrsrrNr�)r+r}r-r�rw)r>r`r�r�r�r�r�rrr�set_typeszMessage.set_typecCsDt�}|�d|d�}||kr*|�d|d�}||kr6|St�|���S)a@Return the filename associated with the payload if present.

        The filename is extracted from the Content-Disposition header's
        `filename' parameter, and it is unquoted.  If that header is missing
        the `filename' parameter, this method falls back to looking for the
        `name' parameter.
        �filename�content-dispositionr{r�)r�rcr�collapse_rfc2231_valuer)r>r�r�r�rrr�get_filename&szMessage.get_filenamecCs,t�}|�d|�}||kr|St�|���S)z�Return the boundary associated with the payload if present.

        The boundary is extracted from the Content-Type header's `boundary'
        parameter, and it is unquoted.
        �boundary)r�rcrr��rstrip)r>r�r�r�rrr�get_boundary6s
zMessage.get_boundarycCst�}|�|d�}||kr$t�d��g}d}|D]:\}}|��dkr\|�dd|f�d}q0|�||f�q0|s�|�dd|f�g}|jD]z\}	}
|	��dkr�g}|D].\}}
|
dkr�|�|�q�|�d||
f�q�t�|�}
|�|j	�
|	|
��q�|�|	|
f�q�||_d	S)
a�Set the boundary parameter in Content-Type to 'boundary'.

        This is subtly different than deleting the Content-Type header and
        adding a new one with a new boundary parameter via add_header().  The
        main difference is that using the set_boundary() method preserves the
        order of the Content-Type header in the original message.

        HeaderParseError is raised if the message has no Content-Type header.
        r�zNo Content-Type header foundFr�z"%s"TrrN)r�r�rZHeaderParseErrorr-r.r8r�rgr7r)r>r�r�r�Z	newparamsZfoundpZpkZpvr��hr�r�r�r�rrr�set_boundaryCs2


zMessage.set_boundaryc	Cs�t�}|�d|�}||kr|St|t�rr|dp2d}z|d�d�}t||�}Wn ttfk
rp|d}YnXz|�d�Wntk
r�|YSX|��S)z�Return the charset parameter of the Content-Type header.

        The returned string is always coerced to lower case.  If there is no
        Content-Type header, or if that header has no charset parameter,
        failobj is returned.
        rrzus-asciirr\)	r�rcrr r!rrdrer-)r>r�r�rZpcharsetrMrrr�get_content_charsetqs 

zMessage.get_content_charsetcs�fdd�|��D�S)a�Return a list containing the charset(s) used in this message.

        The returned list of items describes the Content-Type headers'
        charset parameter for this message and all the subparts in its
        payload.

        Each item will either be a string (the value of the charset parameter
        in the Content-Type header of that part) or the value of the
        'failobj' parameter (defaults to None), if the part does not have a
        main MIME type of "text", or the charset is not defined.

        The list will contain one string for each part of the message, plus
        one for the container message (i.e. self), so that a non-multipart
        message will still return a list of length 1.
        csg|]}|����qSr)r�)r��part�r�rrr��sz(Message.get_charsets.<locals>.<listcomp>��walk)r>r�rr�r�get_charsets�szMessage.get_charsetscCs*|�d�}|dkrdSt|�d��}|S)z�Return the message's content-disposition if it exists, or None.

        The return values can be either 'inline', 'attachment' or None
        according to the rfc2183.
        r�Nr)rarr-)r>r&�c_drrr�get_content_disposition�s

zMessage.get_content_dispositionr�)FrN)FN)NF)N)N)N)Nr�T)Nr�T)rtTNrF)r�T)rtT)N)N)N)N)4�__name__�
__module__�__qualname__�__doc__r	r?rBr@rNrMrQrTrUrYrlrqrprxryr|r�r�r�r�r�r�r�rar�r�r�rvr�r�r�r�r�r�r�r�rcrwrur�r�r�r�r�r�r�Zemail.iteratorsr�rrrrrisj


Z
/


				
�
"�
3

 


.


cs�eZdZd2dd�Zd3�fdd�	Zdd�Zd	d
�Zdd�Zd4dd�ZddddhZ	dd�Z
dd�Zdd�dd�Zdd�dd�Z
dd�Zd5dd �Zd6d!d"�Zd7d#d$�Zdd%�d&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Z�ZS)8�MIMEPartNcCs(|dkrddlm}|}t�||�dS)Nr)�default)Zemail.policyr�rr?)r>r7r�rrrr?�szMIMEPart.__init__Fcs0|dkr|jn|}|dkr |j}t�j||d�S)aReturn the entire formatted message as a string.

        Optional 'unixfrom', when true, means include the Unix From_ envelope
        header.  maxheaderlen is retained for backward compatibility with the
        base Message class, but defaults to None, meaning that the policy value
        for max_line_length controls the header maximum length.  'policy' is
        passed to the Generator instance used to serialize the message; if it
        is not specified the policy associated with the message instance is
        used.
        N)rEr7)r7Zmax_line_length�superr@)r>rGrEr7��	__class__rrr@�szMIMEPart.as_stringcCs|j|jjdd�d�S)NT)�utf8�r7)r@r7ZclonerArrrrB�szMIMEPart.__str__cCs |�d�}|dkrdS|jdkS)Nr�F�
attachment)raZcontent_disposition)r>r�rrr�
is_attachment�s
zMIMEPart.is_attachmentc	cs|��rdS|���d�\}}|dkrB||kr>|�|�|fVdS|dkrNdS|dkrz|��D]}|�||�EdHq^dSd|kr�|�d�|fVd}|�d�}|r�|��D]}|d|kr�|}q�q�|dkr�|��}|r�|dnd}|dk	�r|�||�EdHdS)Nr��text�	multipart�related�start�
content-idr)r�r�r�r,�
iter_parts�
_find_bodyrcrl)	r>r��preferencelist�maintype�subtypeZsubpart�	candidater�Zsubpartsrrrr��s6

zMIMEPart._find_body�r��html�plaincCsBt|�}d}|�||�D]$\}}||kr|}|}|dkrq>q|S)aReturn best candidate mime part for display as 'body' of message.

        Do a depth first search, starting with self, looking for the first part
        matching each of the items in preferencelist, and return the part
        corresponding to the first item that has a match, or None if no items
        have a match.  If 'related' is not included in preferencelist, consider
        the root part of any multipart/related encountered as a candidate
        match.  Ignore parts with 'Content-Disposition: attachment'.
        Nr)rr�)r>r�Z	best_prioZbodyZprior�rrr�get_body�s
zMIMEPart.get_body)r�r�)r�r�)r�r�)r��alternativec
cs$|���d�\}}|dks"|dkr&dS|��}z|��}Wntk
rPYdSX|dkr�|dkr�|�d�}|r�d}g}|D]"}|�d�|kr�d	}q||�|�q||r�|EdHdS|�d
�|EdHdSg}	|D]L}|���d�\}}||f|j	k�r|�
��s||	k�r|	�|�q�|Vq�dS)aReturn an iterator over the non-main parts of a multipart.

        Skip the first of each occurrence of text/plain, text/html,
        multipart/related, or multipart/alternative in the multipart (unless
        they have a 'Content-Disposition: attachment' header) and include all
        remaining subparts in the returned iterator.  When applied to a
        multipart/related, return all parts except the root part.  Return an
        empty iterator when applied to a multipart/alternative or a
        non-multipart.
        r�r�r�Nr�r�Fr�Tr)r�r�rlr�rVrcrar.�pop�_body_typesr�)
r>r�r�rXr�r�r�Zattachmentsr��seenrrr�iter_attachmentssD



��
zMIMEPart.iter_attachmentsccs|��dkr|��EdHdS)z~Return an iterator over all immediate subparts of a multipart.

        Return an empty iterator for a non-multipart.
        r�N)r�rlrArrrr�=szMIMEPart.iter_parts)�content_managercOs"|dkr|jj}|j|f|�|�SrR)r7r��get_content�r>r��args�kwrrrr�EszMIMEPart.get_contentcOs&|dkr|jj}|j|f|�|�dSrR)r7r��set_contentr�rrrr�JszMIMEPart.set_contentc
Cs�|��dkr6|��}||f}||kr6td�||���g}g}|jD]4\}}|���d�rj|�||f�qD|�||f�qD|r�t|�|j	d�}	||	_|j
|	_
|	g|_
ng|_
||_d||d<|dk	r�|�d|�dS)Nr�zCannot convert {} to {}�content-r�z
multipart/rtr�)r�r�r}r~r8r-�
startswithr.r`r7r:rw)
r>r�Zdisallowed_subtypesr�Zexisting_subtypeZkeep_headersZpart_headersr{r&r�rrr�_make_multipartOs0
�
zMIMEPart._make_multipartcCs|�dd|�dS)Nr�)r��mixed�r��r>r�rrr�make_relatedjszMIMEPart.make_relatedcCs|�dd|�dS)Nr�)r�r�r�rrr�make_alternativemszMIMEPart.make_alternativecCs|�dd|�dS)Nr�rr�r�rrr�
make_mixedpszMIMEPart.make_mixed)�_dispcOsf|��dks|��|kr(t|d|��t|�|jd�}|j||�|rXd|krX||d<|�|�dS)Nr�Zmake_r�r�zContent-Disposition)r�r��getattrr`r7r�rY)r>Z_subtyper�r�r�r�rrr�_add_multipartss
�zMIMEPart._add_multipartcOs|jd|�ddi|��dS)Nr�r�Zinline)r��r��r>r�r�rrr�add_related}szMIMEPart.add_relatedcOs|jd|�|�dS)Nr�)r�r�r�rrr�add_alternative�szMIMEPart.add_alternativecOs|jd|�ddi|��dS)Nr�r�r�)r�r�r�rrr�add_attachment�szMIMEPart.add_attachmentcCsg|_d|_dSrR�r8r:rArrr�clear�szMIMEPart.clearcCsdd�|jD�|_d|_dS)NcSs&g|]\}}|���d�s||f�qS)r�)r-r�)r��nr�rrrr��s�z*MIMEPart.clear_content.<locals>.<listcomp>rrArrr�
clear_content�szMIMEPart.clear_content)N)FNN)r�)N)N)N)r�r�r�r?r@rBr�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr�
__classcell__rrr�rr��s2

�7



r�cseZdZ�fdd�Z�ZS)rcs"t�j||�d|krd|d<dS)Nrrrs)r�r�r�r�rrr��szEmailMessage.set_content)r�r�r�r�rrrr�rr�s)NT)r��__all__�rerirf�iorrZemailrrZemail._policybaserr	rr;Zemail._encoded_wordsrrnr��compiler#rr'r3r5rr�rrrrr�<module>s6


"N`email/__pycache__/contentmanager.cpython-38.pyc000064400000016303151153537640015515 0ustar00U

e5d�)�@s.ddlZddlZddlZddlZddlmZGdd�d�Ze�Zd%dd�Ze�	de�d	d
�Z
d��D]Ze�	ee
�qfdd
�Z
d��D]Ze�	dee
�q�dd�Ze�	de�dd�Zdd�Zdd�Zdd�Zd&dd�Ze�ee�d'd d!�Ze�ejje�d(d#d$�ZeeefD]Ze�ee��qdS))�N)�
quoprimimec@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�ContentManagercCsi|_i|_dS�N)�get_handlers�set_handlers)�self�r�,/usr/lib64/python3.8/email/contentmanager.py�__init__	szContentManager.__init__cCs||j|<dSr)r)r�key�handlerrrr	�add_get_handler
szContentManager.add_get_handlercOs||��}||jkr(|j||f|�|�S|��}||jkrP|j||f|�|�Sd|jkrp|jd|f|�|�St|��dS)N�)Zget_content_typer�get_content_maintype�KeyError)r�msg�args�kwZcontent_type�maintyperrr	�get_contents


zContentManager.get_contentcCs||j|<dSr)r)rZtypekeyrrrr	�add_set_handlerszContentManager.add_set_handlercOs>|��dkrtd��|�||�}|��|||f|�|�dS)NZ	multipartz"set_content not valid on multipart)r�	TypeError�_find_set_handlerZ
clear_content)rr�objrrrrrr	�set_contents
zContentManager.set_contentc	Cs�d}t|�jD]�}||jkr*|j|S|j}t|dd�}|rNd�||f�n|}|dkr^|}||jkrv|j|S||jkr�|j|S|j}||jkr|j|Sqd|jkr�|jdSt|��dS)N�
__module__r�.)�type�__mro__r�__qualname__�getattr�join�__name__r)	rrrZfull_path_for_error�typZqname�modname�	full_path�namerrr	r's&





z ContentManager._find_set_handlerN)	r"rrr
r
rrrrrrrr	rs	r�replacecCs&|jdd�}|�dd�}|j||d�S)NT��decode�charset�ASCII)�errors)�get_payloadZ	get_paramr))rr,Zcontentr*rrr	�get_text_content@sr.�textcCs|jdd�S)NTr(�r-�rrrr	�get_non_text_contentGsr2zaudio image video applicationcCs
|�d�S�Nrr0r1rrr	�get_message_contentMsr4zrfc822 external-bodyzmessage/cCst|�d��Sr3)�bytesr-r1rrr	�%get_and_fixup_unknown_message_contentSsr6�messagec
s�d�||f�|d<|r�t|dd�s<|j��fdd�|D�}z(|D]}|jrV|jd�|||j<qBWn@tjjk
r�}ztd�	|j
|jd���|�W5d}~XYnXdS)	N�/zContent-Typerr&csg|]}�j��|g���qSr)Zheader_factoryZheader_source_parse)�.0�header�Zmprr	�
<listcomp>ds�z _prepare_set.<locals>.<listcomp>zInvalid header: {})�policy)r!�hasattrr=Zdefectsr&�emailr,ZHeaderDefect�
ValueError�formatZfold)rr�subtype�headersr:�excrr;r	�_prepare_set_s$
�
��rEcCsx|dkr|dk	rd}|dk	r$||d<|dk	r>|jd|ddd�|dk	rN||d<|dk	rt|��D]\}}|�||�q^dS)NZ
attachmentzContent-Disposition�filenameT)r:r'z
Content-ID)�	set_param�items)r�dispositionrF�cid�paramsr�valuerrr	�
_finalize_setps�rMcCsVg}|dd}tdt|�|�D]*}||||�}|�t�|��d��q d�|�S)N��r�asciir)�range�len�append�binascii�
b2a_base64r)r!)�data�max_line_lengthZ
encoded_linesZunencoded_bytes_per_line�iZthislinerrr	�_encode_base64�srYcs�|�|���}|j�d���fdd�}dd�}|dkr�tdd�|D�dd	�|jkr�zd
||��d�fWStk
rzYnX|jdkr�d||��dd�fS||dd
��}t�	|�d�|j�}t
�|�}	t|�t|	�kr�d}nd}t|�d
kr�||fS|d
k�r||��d�}
nj|dk�r,||��dd�}
nN|dk�rPt�	||��d�|j�}
n*|dk�rlt
||�|j�}
ntd�|���||
fS)NrPcs��|��Sr�r!��lines��lineseprr	�
embedded_body��z#_encode_text.<locals>.embedded_bodycSsd�|�dS)N�
rZr[rrr	�normal_body�r`z!_encode_text.<locals>.normal_bodycss|]}t|�VqdSr)rR)r9�xrrr	�	<genexpr>�sz_encode_text.<locals>.<genexpr>r)�default�7bit�8bit�surrogateescape�
zlatin-1�base64�quoted-printablez$Unknown content transfer encoding {})�encode�
splitlinesr^�maxrWr)�UnicodeDecodeErrorZcte_typerZbody_encoderTrUrRrYr@rA)�stringr*�cter=r\r_rbZsniffZsniff_qpZsniff_base64rVrr]r	�_encode_text�sD
�



�
rr�plain�utf-8c
Csdt|d||	�t||||j�\}}
|�|
�|jdtjj�||�dd�||d<t	|||||�dS)Nr/r*T)r'�Content-Transfer-Encoding)
rErrr=�set_payloadrGr?r*ZALIASES�getrM)rrprBr*rqrIrFrJrKrCZpayloadrrr	�set_text_content�s
�rx�rfc822c		Cs�|dkrtd��|dkr@|dkr.td�|���|dkr:dn|}n0|dkrd|dkr^td	�|���d
}n|dkrpd
}t|d||�|�|g�||d<t|||||�dS)
N�partialz4message/partial is not supported for Message objectsry)Nrfrg�binaryz*message/rfc822 parts do not support cte={}rgz
external-body)Nrfz1message/external-body parts do not support cte={}rfr7ru)r@rArErvrM)	rr7rBrqrIrFrJrKrCrrr	�set_message_content�s(��r|rjc

Cs�t||||	�|dkr(t||jjd�}nN|dkrNtj|dddd�}|�d�}n(|dkrb|�d�n|d	krv|�dd
�}|�|�||d<t	|||||�dS)Nrj)rWrkFT)�istextr:Z	quotetabsrPrf)rgr{rhru)
rErYr=rWrTZb2a_qpr)rlrvrM)
rrVrrBrqrIrFrJrKrCrrr	�set_bytes_content�s
r~)r')rsrtNNNNNN)ryNNNNNN)rjNNNNN)rTZ
email.charsetr?Z
email.messageZemail.errorsrrZraw_data_managerr.r
r2�splitrr4rBr6rErMrYrrrxr�strr|r7ZMessager~r5�	bytearray�
memoryviewr#rrrr	�<module>s^6
�	'�
�
�
email/__pycache__/header.cpython-38.pyc000064400000040071151153537640013737 0ustar00U

e5d&^�@s�dZdddgZddlZddlZddlZddlZddlmZddlm	Z
e
jZdZd	Z
d
ZdZdZd
ZdZed�Zed�Ze�dejejB�Ze�d�Ze�d�ZejjZdd�Zddd�ZGdd�d�ZGdd�d�Z Gdd�de!�Z"dS)z+Header encoding and decoding functionality.�Header�
decode_header�make_header�N)�HeaderParseError)�charset�
� � z        ��Nz 	�us-asciizutf-8ai
  =\?                   # literal =?
  (?P<charset>[^?]*?)   # non-greedy up to the next ? is the charset
  \?                    # literal ?
  (?P<encoding>[qQbB])  # either a "q" or a "b", case insensitive
  \?                    # literal ?
  (?P<encoded>.*?)      # non-greedy up to the next ?= is the encoded string
  \?=                   # literal ?=
  z[\041-\176]+:$z
\n[^ \t]+:c	Cs�t|d�rdd�|jD�St�|�s.|dfgSg}|��D]�}t�|�}d}|r:|�d�}|rj|��}d}|r~|�|ddf�|rL|�d��	�}|�d��	�}|�d�}|�|||f�qLq:g}	t
|�D]J\}
}|
dkr�|dr�||
d	dr�||
dd��r�|	�|
d�q�t|	�D]}||=�qg}
|D]�\}}}|dk�rV|
�||f�n�|d
k�r|t
j�|�}|
�||f�n~|dk�r�t|�d}|�r�|d
dd|�7}zt
j�|�}Wn tjk
�r�td��YnX|
�||f�ntd|���q2g}d}}|
D]v\}}t|t��r,t|d�}|dk�r@|}|}nB||k�rb|�||f�|}|}n |dk�rz|t|7}n||7}�q|�||f�|S)a;Decode a message header value without converting charset.

    Returns a list of (string, charset) pairs containing each of the decoded
    parts of the header.  Charset is None for non-encoded parts of the header,
    otherwise a lower-case string containing the name of the character set
    specified in the encoded string.

    header may be a string that may or may not contain RFC2047 encoded words,
    or it may be a Header object.

    An email.errors.HeaderParseError may be raised when certain decoding error
    occurs (e.g. a base64 decoding exception).
    �_chunkscSs(g|] \}}t�|t|��t|�f�qS�)�_charsetZ_encode�str)�.0�stringrrr�$/usr/lib64/python3.8/email/header.py�
<listcomp>Ms�z!decode_header.<locals>.<listcomp>NTrF���q�b�z===zBase64 decoding errorzUnexpected encoding: zraw-unicode-escape)�hasattrr
�ecre�search�
splitlines�split�pop�lstrip�append�lower�	enumerate�isspace�reversed�email�
quoprimimeZ
header_decode�lenZ
base64mime�decode�binascii�Errorr�AssertionError�
isinstancer�bytes�BSPACE)�headerZwords�line�parts�firstZ	unencodedr�encodingZencodedZdroplist�n�w�dZ
decoded_wordsZencoded_stringZwordZpaderrZ	collapsedZ	last_word�last_charsetrrrr=s|
�




4







cCsFt|||d�}|D].\}}|dk	r4t|t�s4t|�}|�||�q|S)a�Create a Header from a sequence of pairs as returned by decode_header()

    decode_header() takes a header value string and returns a sequence of
    pairs of the format (decoded_string, charset) where charset is the string
    name of the character set.

    This function takes one of those sequence of pairs and returns a Header
    instance.  Optional maxlinelen, header_name, and continuation_ws are as in
    the Header constructor.
    )�
maxlinelen�header_name�continuation_wsN)rr-�Charsetr!)Zdecoded_seqr9r:r;�h�srrrrr�s�c@sJeZdZddd�Zdd�Zdd	�Zdd
d�Zdd
�Zddd�Zdd�Z	dS)rNr�strictcCs||dkrt}nt|t�s t|�}||_||_g|_|dk	rH|�|||�|dkrTt}||_|dkrjd|_	nt
|�d|_	dS)aDCreate a MIME-compliant header that can contain many character sets.

        Optional s is the initial header value.  If None, the initial header
        value is not set.  You can later append to the header with .append()
        method calls.  s may be a byte string or a Unicode string, but see the
        .append() documentation for semantics.

        Optional charset serves two purposes: it has the same meaning as the
        charset argument to the .append() method.  It also sets the default
        character set for all subsequent .append() calls that omit the charset
        argument.  If charset is not provided in the constructor, the us-ascii
        charset is used both as s's initial charset and as the default for
        subsequent .append() calls.

        The maximum line length can be specified explicitly via maxlinelen. For
        splitting the first line to a shorter value (to account for the field
        header which isn't included in s, e.g. `Subject') pass in the name of
        the field in header_name.  The default maxlinelen is 78 as recommended
        by RFC 2822.

        continuation_ws must be RFC 2822 compliant folding whitespace (usually
        either a space or a hard tab) which will be prepended to continuation
        lines.

        errors is passed through to the .append() call.
        Nrr)�USASCIIr-r<r�_continuation_wsr
r!�
MAXLINELEN�_maxlinelen�
_headerlenr()�selfr>rr9r:r;�errorsrrr�__init__�s
zHeader.__init__c	Cs�|��g}d}d}|jD]�\}}|}|tjkrH|�dd�}|�dd�}|r�|o\|�|d�}|dkr�|dkr�|s�|�t�d}n|dkr�|s�|�t�|o�|�|d�}|}|�|�qt	�
|�S)z&Return the string value of the header.N�ascii�surrogateescape�replacer�Nr���)�
_normalizer
r�UNKNOWN8BIT�encoder)�	_nonctextr!�SPACE�EMPTYSTRING�join)	rEZuchunks�lastcs�	lastspacerrZnextcsZoriginal_bytes�hasspacerrr�__str__�s*


zHeader.__str__cCs|t|�kS�N)r)rE�otherrrr�__eq__sz
Header.__eq__cCs�|dkr|j}nt|t�s"t|�}t|t�sZ|jp4d}|tjkrN|�dd�}n|�||�}|jpbd}|tjkr�z|�||�Wn"t	k
r�|dkr��t
}YnX|j�||f�dS)a.Append a string to the MIME header.

        Optional charset, if given, should be a Charset instance or the name
        of a character set (which will be converted to a Charset instance).  A
        value of None (the default) means that the charset given in the
        constructor is used.

        s may be a byte string or a Unicode string.  If it is a byte string
        (i.e. isinstance(s, str) is false), then charset is the encoding of
        that byte string, and a UnicodeError will be raised if the string
        cannot be decoded with that charset.  If s is a Unicode string, then
        charset is a hint specifying the character set of the characters in
        the string.  In either case, when producing an RFC 2822 compliant
        header using RFC 2047 rules, the string will be encoded using the
        output codec of the charset.  If the string cannot be encoded to the
        output codec, a UnicodeError will be raised.

        Optional `errors' is passed as the errors argument to the decode
        call if s is a byte string.
        NrrI)
rr-r<rZinput_codecrNr)Zoutput_codecrO�UnicodeEncodeError�UTF8r
r!)rEr>rrFZ
input_charsetZoutput_charsetrrrr!	s$






z
Header.appendcCs|��p|dkS)z=True if string s is not a ctext character of RFC822.
        )�(�)�\)r$)rEr>rrrrP4szHeader._nonctext�;, 	rcCs�|��|dkr|j}|dkr"d}t|j||j|�}d}d}}|jD�]\}}	|dk	r�|oh|�|d�}|dkr�|r~|	dkr�|��n|	dkr�|s�|��|o�|�|d�}|	}d}|��}
|
r�|�	d|
d|	�n|�	dd|	�|
dd�D]`}|�
�|	jdk	�r"|�	|jd	|��|	�q�|��}|dt
|�t
|��}
|�	|
||	�q�t
|
�dkrF|�
�qF|j�rx|��|�|�}t�|��r�td
�|���|S)a�Encode a message header into an RFC-compliant format.

        There are many issues involved in converting a given string for use in
        an email header.  Only certain character sets are readable in most
        email clients, and as header strings can only contain a subset of
        7-bit ASCII, care must be taken to properly convert and encode (with
        Base64 or quoted-printable) header strings.  In addition, there is a
        75-character length limit on any given encoded header field, so
        line-wrapping must be performed, even with double-byte character sets.

        Optional maxlinelen specifies the maximum length of each generated
        line, exclusive of the linesep string.  Individual lines may be longer
        than maxlinelen if a folding point cannot be found.  The first line
        will be shorter by the length of the header name plus ": " if a header
        name was specified at Header construction time.  The default value for
        maxlinelen is determined at header construction time.

        Optional splitchars is a string containing characters which should be
        given extra weight by the splitting algorithm during normal header
        wrapping.  This is in very rough support of RFC 2822's `higher level
        syntactic breaks':  split points preceded by a splitchar are preferred
        during line splitting, with the characters preferred in the order in
        which they appear in the string.  Space and tab may be included in the
        string to indicate whether preference should be given to one over the
        other as a split point when other split chars do not appear in the line
        being split.  Splitchars does not affect RFC 2047 encoded lines.

        Optional linesep is a string to be used to separate the lines of
        the value.  The default value is the most useful for typical
        Python applications, but it can be set to \r\n to produce RFC-compliant
        line separators when needed.
        Nri@BrKrLFr
rrz8header value appears to contain an embedded header: {!r})rMrC�_ValueFormatterrDrAr
rP�add_transitionr�feed�newline�header_encodingr r(�_str�_embedded_headerrr�format)rE�
splitcharsr9�linesepZ	formatterrTrVrUrr�linesr1Zsline�fws�valuerrrrO9sZ!�
�

�z
Header.encodecCsxg}d}g}|jD]B\}}||kr.|�|�q|dk	rJ|�t�|�|f�|g}|}q|rn|�t�|�|f�||_dSrX)r
r!rQrS)rEZchunksr8Z
last_chunkrrrrrrM�szHeader._normalize)NNNNrr?)Nr?)r`Nr)
�__name__�
__module__�__qualname__rGrWrZr!rPrOrMrrrrr�s�
/ 
+
Pc@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)racCs0||_||_t|�|_||_g|_t|�|_dSrX)�_maxlenrAr(�_continuation_ws_len�_splitchars�_lines�_Accumulator�
_current_line)rEZ	headerlen�maxlenr;rirrrrG�s
z_ValueFormatter.__init__cCs|��|�|j�SrX)rdrSrt)rErjrrrrf�sz_ValueFormatter._strcCs
|�t�SrX)rf�NL�rErrrrW�sz_ValueFormatter.__str__cCsv|j��}|dkr|jj|�t|j�dkrh|j��rV|jrV|jdt|j�7<n|j�t|j��|j��dS)N)rr
rrL)	rvr�pushr(�	is_onlywsrtrr!�reset)rEZend_of_linerrrrd�s
z_ValueFormatter.newlinecCs|j�dd�dS)Nrr
)rvrzryrrrrb�sz_ValueFormatter.add_transitioncCs�|jdkr|�|||j�dS|�||���}z|�d�}Wntk
rRYdSX|dk	rh|�||�z|��}Wntk
r�YdSX|��|j	�
|j|�|D]}|j�
|j|�q�dS�Nr)re�_ascii_splitrsZheader_encode_lines�_maxlengthsr�
IndexError�
_append_chunkrdrvrzrArtr!)rErlrrZ
encoded_linesZ
first_line�	last_liner1rrrrc�s$
z_ValueFormatter.feedccs&|jt|j�V|j|jVqdSrX)rqr(rvrrryrrrr�sz_ValueFormatter._maxlengthscCsft�dtd||�}|dr0dg|dd�<n
|�d�tt|�gd�D]\}}|�||�qLdS)Nz([z]+)rr
r)�rer�FWSr�zip�iterr�)rErlrrir2�partrrrr~�s
z_ValueFormatter._ascii_splitcCs|j�||�t|j�|jk�r|jD]v}t|j��ddd�D]T}|��rn|j|d}|rn|d|krnq�|j|dd}|r@|d|kr@q�q@q&q�q&|j��\}}|jj	dkr�|�
�|s�d}|j�||�dS|j�|�}|j�
t|j��|j�|�dS)NrrrLr)rvrzr(rqrs�range�
part_countr$r�
_initial_sizerd�pop_fromrtr!rr|)rErlrZch�iZprevpartr�Z	remainderrrrr��s.
z_ValueFormatter._append_chunkN)rnrorprGrfrWrdrbrcrr~r�rrrrra�s%racsjeZdZd�fdd�	Zdd�Zddd�Z�fdd	�Zd
d�Zdd
�Zddd�Z	dd�Z
�fdd�Z�ZS)rurcs||_t���dSrX)r��superrG)rEZinitial_size��	__class__rrrGsz_Accumulator.__init__cCs|�||f�dSrX)r!)rErlrrrrrz#sz_Accumulator.pushcCs||d�}g||d�<|SrXr)rEr�Zpoppedrrrr�&sz_Accumulator.pop_fromcs|��dkrdSt���S)Nr)r
r
)r�r�rryr�rrr+sz_Accumulator.popcCstdd�|D�|j�S)Ncss"|]\}}t|�t|�VqdSrX)r(�rrlr�rrr�	<genexpr>1sz'_Accumulator.__len__.<locals>.<genexpr>)�sumr�ryrrr�__len__0s�z_Accumulator.__len__cCst�dd�|D��S)Ncss |]\}}t�||f�VqdSrX�rRrSr�rrrr�5s�z'_Accumulator.__str__.<locals>.<genexpr>r�ryrrrrW4s
�z_Accumulator.__str__NcCs"|dkrg}||dd�<d|_dSr})r�)rEZstartvalrrrr|8sz_Accumulator.resetcCs|jdko|pt|���Sr})r�rr$ryrrrr{>sz_Accumulator.is_onlywscs
t���SrX)r�r�ryr�rrr�Asz_Accumulator.part_count)r)r)N)
rnrorprGrzr�rr�rWr|r{r��
__classcell__rrr�rrus

ru)NNr)#�__doc__�__all__r�r*Zemail.quoprimimer&Zemail.base64mimeZemail.errorsrrrr<rxrQr/ZSPACE8rRrBr�r@r\�compile�VERBOSE�	MULTILINErZfcrergr'Z_max_appendrrrra�listrurrrr�<module>sF�
�

_�
kemail/__pycache__/charset.cpython-38.opt-1.pyc000064400000026240151153537640015101 0ustar00U

e5d�B�@srddddgZddlmZddlZddlZddlmZddlmZd	Z	d
Z
dZdZd
Z
dZdZe	e	dfe	e	dfe	e	dfe	e	dfe	e	dfe	e	dfe	e	dfe	e	dfe	e	dfe	e	dfe	e	dfe	e	dfde
e
dfe
e
dfe
ddfe
ddfe
ddfe
e
dfee
dfd�Zddddddddddddddddddddddd d
d!�Zd"d#dd$�Zd+d%d�Zd&d�Zd'd�Zd(d)�ZGd*d�d�ZdS),�Charset�	add_alias�add_charset�	add_codec�)�partialN)�errors)�encode_7or8bit�����us-asciizunknown-8bit�)NNN�iso-2022-jp�utf-8)�
iso-8859-1�
iso-8859-2�
iso-8859-3�
iso-8859-4�
iso-8859-9�iso-8859-10�iso-8859-13�iso-8859-14�iso-8859-15�iso-8859-16zwindows-1252Zvisciir
�big5�gb2312�euc-jp�	shift_jisrzkoi8-rrrrrrrrrrrrzks_c_5601-1987rzeuc-kr)�latin_1zlatin-1Zlatin_2zlatin-2Zlatin_3zlatin-3Zlatin_4zlatin-4Zlatin_5zlatin-5Zlatin_6zlatin-6Zlatin_7zlatin-7Zlatin_8zlatin-8Zlatin_9zlatin-9Zlatin_10zlatin-10�cp949�euc_jp�euc_kr�ascii�eucgb2312_cn�big5_tw)rrr
cCs"|tkrtd��|||ft|<dS)a>Add character set properties to the global registry.

    charset is the input character set, and must be the canonical name of a
    character set.

    Optional header_enc and body_enc is either Charset.QP for
    quoted-printable, Charset.BASE64 for base64 encoding, Charset.SHORTEST for
    the shortest of qp or base64 encoding, or None for no encoding.  SHORTEST
    is only valid for header_enc.  It describes how message headers and
    message bodies in the input charset are to be encoded.  Default is no
    encoding.

    Optional output_charset is the character set that the output should be
    in.  Conversions will proceed from input charset, to Unicode, to the
    output charset when the method Charset.convert() is called.  The default
    is to output in the same character set as the input.

    Both input_charset and output_charset must have Unicode codec entries in
    the module's charset-to-codec mapping; use add_codec(charset, codecname)
    to add codecs the module does not know about.  See the codecs module's
    documentation for more information.
    z!SHORTEST not allowed for body_encN)�SHORTEST�
ValueError�CHARSETS)�charsetZ
header_encZbody_enc�output_charset�r+�%/usr/lib64/python3.8/email/charset.pyrmscCs|t|<dS)z�Add a character set alias.

    alias is the alias name, e.g. latin-1
    canonical is the character set's canonical name, e.g. iso-8859-1
    N)�ALIASES)�aliasZ	canonicalr+r+r,r�scCs|t|<dS)a$Add a codec that map characters in the given charset to/from Unicode.

    charset is the canonical name of a character set.  codecname is the name
    of a Python codec, as appropriate for the second argument to the unicode()
    built-in, or to the encode() method of a Unicode string.
    N)�	CODEC_MAP)r)Z	codecnamer+r+r,r�scCs"|tkr|�dd�S|�|�SdS)Nr#�surrogateescape)�UNKNOWN8BIT�encode)�string�codecr+r+r,�_encode�sr5c@s\eZdZdZefdd�Zdd�Zdd�Zdd	�Zd
d�Z	dd
�Z
dd�Zdd�Zdd�Z
dS)ra@	Map character sets to their email properties.

    This class provides information about the requirements imposed on email
    for a specific character set.  It also provides convenience routines for
    converting between character sets, given the availability of the
    applicable codecs.  Given a character set, it will do its best to provide
    information on how to use that character set in an email in an
    RFC-compliant way.

    Certain character sets must be encoded with quoted-printable or base64
    when used in email headers or bodies.  Certain character sets must be
    converted outright, and are not allowed in email.  Instances of this
    module expose the following information about a character set:

    input_charset: The initial character set specified.  Common aliases
                   are converted to their `official' email names (e.g. latin_1
                   is converted to iso-8859-1).  Defaults to 7-bit us-ascii.

    header_encoding: If the character set must be encoded before it can be
                     used in an email header, this attribute will be set to
                     Charset.QP (for quoted-printable), Charset.BASE64 (for
                     base64 encoding), or Charset.SHORTEST for the shortest of
                     QP or BASE64 encoding.  Otherwise, it will be None.

    body_encoding: Same as header_encoding, but describes the encoding for the
                   mail message's body, which indeed may be different than the
                   header encoding.  Charset.SHORTEST is not allowed for
                   body_encoding.

    output_charset: Some character sets must be converted before they can be
                    used in email headers or bodies.  If the input_charset is
                    one of them, this attribute will contain the name of the
                    charset output will be converted to.  Otherwise, it will
                    be None.

    input_codec: The name of the Python codec used to convert the
                 input_charset to Unicode.  If no conversion codec is
                 necessary, this attribute will be None.

    output_codec: The name of the Python codec used to convert Unicode
                  to the output_charset.  If no conversion codec is necessary,
                  this attribute will have the same value as the input_codec.
    cCs�z$t|t�r|�d�n
t|d�}Wntk
rBt�|��YnX|��}t�||�|_	t
�|j	ttdf�\}}}|s~|j	}||_
||_t�||�|_t�|j	|j	�|_t�|j|j�|_dS)Nr#)�
isinstance�strr2�UnicodeErrorrZCharsetError�lowerr-�get�
input_charsetr(r&�BASE64�header_encoding�
body_encodingr*r/Zinput_codec�output_codec)�selfr;ZhencZbencZconvr+r+r,�__init__�s,
�
��zCharset.__init__cCs
|j��S�N)r;r9�r@r+r+r,�__repr__�szCharset.__repr__cCst|�t|���kSrB)r7r9)r@�otherr+r+r,�__eq__�szCharset.__eq__cCs$|jtkrdS|jtkrdStSdS)aPReturn the content-transfer-encoding used for body encoding.

        This is either the string `quoted-printable' or `base64' depending on
        the encoding used, or it is a function in which case you should call
        the function with a single argument, the Message object being
        encoded.  The function should then set the Content-Transfer-Encoding
        header itself to whatever is appropriate.

        Returns "quoted-printable" if self.body_encoding is QP.
        Returns "base64" if self.body_encoding is BASE64.
        Returns conversion function otherwise.
        zquoted-printable�base64N)r>�QPr<rrCr+r+r,�get_body_encoding�s


zCharset.get_body_encodingcCs|jp
|jS)z�Return the output character set.

        This is self.output_charset if that is not None, otherwise it is
        self.input_charset.
        )r*r;rCr+r+r,�get_output_charsetszCharset.get_output_charsetcCs6|jpd}t||�}|�|�}|dkr*|S|�||�S)a�Header-encode a string by converting it first to bytes.

        The type of encoding (base64 or quoted-printable) will be based on
        this charset's `header_encoding`.

        :param string: A unicode string for the header.  It must be possible
            to encode this string to bytes using the character set's
            output codec.
        :return: The encoded string, with RFC 2047 chrome.
        r
N)r?r5�_get_encoder�
header_encode)r@r3r4�header_bytes�encoder_moduler+r+r,rLs


zCharset.header_encodecCs|jpd}t||�}|�|�}t|j|d�}|��}t|�t}g}	g}
t|�|}|D]�}|
�	|�t
�|
�}
|�t|
|��}||krX|
�
�|	s�|
s�|	�	d�n.|	r�dnd}t
�|
�}t||�}|	�	||��|g}
t|�|}qXt
�|
�}t||�}|	�	||��|	S)afHeader-encode a string by converting it first to bytes.

        This is similar to `header_encode()` except that the string is fit
        into maximum line lengths as given by the argument.

        :param string: A unicode string for the header.  It must be possible
            to encode this string to bytes using the character set's
            output codec.
        :param maxlengths: Maximum line length iterator.  Each element
            returned from this iterator will provide the next maximum line
            length.  This parameter is used as an argument to built-in next()
            and should never be exhausted.  The maximum line lengths should
            not count the RFC 2047 chrome.  These line lengths are only a
            hint; the splitter does the best it can.
        :return: Lines of encoded strings, each with RFC 2047 chrome.
        r
)r)N� r)r?r5rKrrLrJ�len�RFC2047_CHROME_LEN�next�append�EMPTYSTRING�join�
header_length�pop)r@r3Z
maxlengthsr4rMrN�encoderr)Zextra�linesZcurrent_line�maxlen�	characterZ	this_lineZlengthZ	separatorZjoined_liner+r+r,�header_encode_lines*s6








zCharset.header_encode_linescCs`|jtkrtjS|jtkr tjS|jtkrXtj�|�}tj�|�}||krPtjStjSndSdSrB)r=r<�email�
base64mimerH�
quoprimimer&rV)r@rMZlen64Zlenqpr+r+r,rKhs


zCharset._get_encodercCs�|s|S|jtkr4t|t�r(|�|j�}tj�|�S|jt	krjt|t�rT|�|j�}|�
d�}tj�|�St|t�r�|�|j��
d�}|SdS)avBody-encode a string by converting it first to bytes.

        The type of encoding (base64 or quoted-printable) will be based on
        self.body_encoding.  If body_encoding is None, we assume the
        output charset is a 7bit encoding, so re-encoding the decoded
        string using the ascii codec produces the correct string version
        of the content.
        �latin1r#N)r>r<r6r7r2r*r]r^�body_encoderH�decoder_)r@r3r+r+r,raws	





zCharset.body_encodeN)�__name__�
__module__�__qualname__�__doc__�DEFAULT_CHARSETrArDrFrIrJrLr\rKrar+r+r+r,r�s+!>)NNN)�__all__�	functoolsrZemail.base64mimer]Zemail.quoprimimerZemail.encodersrrHr<r&rQrgr1rTr(r-r/rrrr5rr+r+r+r,�<module>s��� ��
	
email/__pycache__/feedparser.cpython-38.pyc000064400000024624151153537640014635 0ustar00U

e5d�X�@s�dZddgZddlZddlmZddlmZddlmZddl	m
Z
e�d	�Ze�d
�Z
e�d�Ze�d
�Ze�d�Zd
ZdZe�ZGdd�de�ZGdd�d�ZGdd�de�ZdS)aFeedParser - An email feed parser.

The feed parser implements an interface for incrementally parsing an email
message, line by line.  This has advantages for certain applications, such as
those reading email messages off a socket.

FeedParser.feed() is the primary interface for pushing new data into the
parser.  It returns when there's nothing more it can do with the available
data.  When you have no more data to push into the parser, call .close().
This completes the parsing and returns the root message object.

The other advantage of this parser is that it will never raise a parsing
exception.  Instead, when it finds something unexpected, it adds a 'defect' to
the current message.  Defects are just instances that live on the message
object's .defects attribute.
�
FeedParser�BytesFeedParser�N)�errors)�compat32)�deque)�StringIOz
\r\n|\r|\nz(\r\n|\r|\n)z(\r\n|\r|\n)\Zz%^(From |[\041-\071\073-\176]*:|[\t ])��
c@s`eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dS)�BufferedSubFileakA file-ish object that can have new data loaded into it.

    You can also push and pop line-matching predicates onto a stack.  When the
    current predicate matches the current line, a false EOF response
    (i.e. empty string) is returned instead.  This lets the parser adhere to a
    simple abstraction -- it parses until EOF closes the current message.
    cCs$tdd�|_t�|_g|_d|_dS)Nr)�newlineF)r�_partialr�_lines�	_eofstack�_closed��self�r�(/usr/lib64/python3.8/email/feedparser.py�__init__5szBufferedSubFile.__init__cCs|j�|�dS�N)r�append)rZpredrrr�push_eof_matcher@sz BufferedSubFile.push_eof_matchercCs
|j��Sr)r�poprrrr�pop_eof_matcherCszBufferedSubFile.pop_eof_matchercCs<|j�d�|�|j���|j�d�|j��d|_dS)NrT)r�seek�	pushlines�	readlines�truncaterrrrr�closeFs

zBufferedSubFile.closecCsL|js|jrdStS|j��}t|j�D]}||�r(|j�|�dSq(|S�Nr)r
r�NeedMoreData�popleft�reversedr�
appendleft)r�lineZateofrrr�readlineNs
zBufferedSubFile.readlinecCs|tk	st�|j�|�dSr)r �AssertionErrorr
r#�rr$rrr�
unreadline`szBufferedSubFile.unreadlinecCsx|j�|�d|kr d|kr dS|j�d�|j��}|j�d�|j��|d�d�sj|j�|���|�|�dS)z$Push some new data into this object.r	�
Nr���)r�writerrr�endswithrr)r�data�partsrrr�pushes

zBufferedSubFile.pushcCs|j�|�dSr)r
�extend)r�linesrrrrzszBufferedSubFile.pushlinescCs|Srrrrrr�__iter__}szBufferedSubFile.__iter__cCs|��}|dkrt�|Sr)r%�
StopIterationr'rrr�__next__�szBufferedSubFile.__next__N)�__name__�
__module__�__qualname__�__doc__rrrrr%r(r/rr2r4rrrrr
-sr
c@s`eZdZdZded�dd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dS)rzA feed-style parser of email.N��policycCs�||_d|_|dkr<|jdkr2ddlm}||_qn|j|_n2||_z||jd�Wntk
rld|_YnXt�|_g|_	|�
�j|_d|_
d|_d|_dS)a_factory is called with no arguments to create a new message obj

        The policy keyword specifies a policy object that controls a number of
        aspects of the parser's operation.  The default policy maintains
        backward compatibility.

        FNr)�Messager9T)r:�_old_style_factoryZmessage_factoryZ
email.messager;�_factory�	TypeErrorr
�_input�	_msgstack�	_parsegenr4�_parse�_cur�_last�_headersonly)rr=r:r;rrrr�s$

zFeedParser.__init__cCs
d|_dS)NT)rErrrr�_set_headersonly�szFeedParser._set_headersonlycCs|j�|�|��dS)zPush more data into the parser.N)r?r/�_call_parse�rr-rrr�feed�szFeedParser.feedcCs&z|��Wntk
r YnXdSr)rBr3rrrrrG�szFeedParser._call_parsecCsR|j��|��|��}|jr$t�|��dkrN|��sNt�	�}|j
�||�|S)z<Parse all remaining data and return the root message object.�	multipart)r?rrG�_pop_messager@r&�get_content_maintypeZis_multipartrZ!MultipartInvariantViolationDefectr:�
handle_defect)r�root�defectrrrr�s

�zFeedParser.closecCsn|jr|��}n|j|jd�}|jr<|j��dkr<|�d�|jrR|jd�|�|j�|�||_||_	dS)Nr9zmultipart/digestzmessage/rfc822r*)
r<r=r:rC�get_content_typeZset_default_typer@ZattachrrD)r�msgrrr�_new_message�s

zFeedParser._new_messagecCs(|j��}|jr|jd|_nd|_|S)Nr*)r@rrC)r�retvalrrrrK�s

zFeedParser._pop_messageccs$|��g}|jD]Z}|tkr&tVqt�|�sbt�|�s^t��}|j�	|j
|�|j�|�qn|�|�q|�
|�|jr�g}|j��}|tkr�tVq�|dkr�q�|�|�q�|j
�t�|��dS|j
��dk�r�|j�tj�|��D]}|tk�rtVq��qq�|��}|j��|j��}|tk�rDtV�q�qD�q|j��}|tk�rjtV�qD�qj�qD|dk�rx�q�|j�|�q�dS|j
��dk�r�|��D] }|tk�r�tV�q��qĐq�|��dS|j
��dk�r�|j
��}|dk�rRt��}|j�	|j
|�g}|jD]$}|tk�r.tV�q|�|��q|j
�t�|��dSt|j
�dd����dk�r�t��}|j�	|j
|�d|}t� d	t�!|�d
�}	d}
g}d}d}
|j��}|tk�r�tV�q�|dk�r�q�|	�|�}|�r�|�"d
��rd}
|�"d�}�q�|
�rr|�r^|d}t#�$|�}|�rP|dt%|�"d���|d<t�|�|j
_&d}
|j�|��q�|j��}|tk�r�tV�qr|	�|�}|�sr|j�|��q��qr|j�|	j�|��D] }|tk�r�tV�q��q�q�|j'��dk�rT|j'j(}|dk�rd|j'_(n:|dk	�r�t#�$|�}|�r�t%|�"d��}|d|�|j'_(nD|j'j)}t*|t��r�t#�$|�}|�r�|dt%|�"d���}||j'_)|j��|��|j
|_'n|
�s�t+�|�|��q�|
�r4t�,�}|j�	|j
|�|j
�t�|��g}|jD]}|tk�rtV�q�qt�|�|j
_(dS|
�sVt�-�}|j�	|j
|�dS|�rddg}ng}|jD]$}|tk�r�tV�qn|�|��qn|�r�|d}t.�|�}|�r�|t%|�"d��d�|d<t�|�|j
_(dSg}|jD]$}|tk�rtV�q�|�|��q�|j
�t�|��dS)Nrzmessage/delivery-status�messagerJzcontent-transfer-encoding�8bit)Z7bitrUZbinaryz--z(?P<sep>z4)(?P<end>--)?(?P<ws>[ \t]*)(?P<linesep>\r\n|\r|\n)?$TF�end�linesepr*r)/rRr?r �headerRE�match�NLCRErZ MissingHeaderBodySeparatorDefectr:rMrCr(r�_parse_headersrEr%Zset_payload�EMPTYSTRING�joinrPrrArKrrLZget_boundaryZNoBoundaryInMultipartDefect�str�get�lowerZ-InvalidMultipartContentTransferEncodingDefect�re�compile�escape�group�	NLCRE_eol�search�len�preamblerD�epilogueZ_payload�
isinstancer&ZStartBoundaryNotFoundDefectZCloseBoundaryNotFoundDefect�	NLCRE_bol)rZheadersr$rOr1rSrQ�boundaryZ	separatorZ
boundaryreZcapturing_preamblerhrWZclose_boundary_seen�moZlastlineZeolmorirVZpayload�	firstlineZbolmorrrrA�sb

















���

























zFeedParser._parsegenc	Csjd}g}t|�D�]8\}}|ddkrR|sFt�|�}|j�|j|�q|�|�q|rt|jj|j�|��dg}}|�	d�r�|dkr�t
�|�}|r�|dt|�
d���}|j�|�qn<|t|�dkr�|j�|�dSt�|�}|jj�|�q|�d�}|dk�r&t�d�}|jj�|�q|dk�s8td��|d|�}|g}q|�rf|jj|j�|��dS)	Nrrz 	zFrom ��:zMissing header name.z3_parse_headers fed line with no : and no leading WS)�	enumeraterZ#FirstHeaderLineIsContinuationDefectr:rMrCrZset_rawZheader_source_parse�
startswithrerfrgrdZset_unixfromr?r(ZMisplacedEnvelopeHeaderDefectZdefects�findZInvalidHeaderDefectr&)	rr1Z
lastheaderZ	lastvalue�linenor$rOrm�irrrr[�sH








zFeedParser._parse_headers)N)r5r6r7r8rrrFrIrGrrRrKrAr[rrrrr�s

~cs eZdZdZ�fdd�Z�ZS)rz(Like FeedParser, but feed accepts bytes.cst��|�dd��dS)N�ascii�surrogateescape)�superrI�decoderH��	__class__rrrIszBytesFeedParser.feed)r5r6r7r8rI�
__classcell__rrrzrrs)r8�__all__raZemailrZemail._policybaser�collectionsr�iorrbrZrkreZNLCRE_crackrXr\�NL�objectr r
rrrrrr�<module>s(




[email/__pycache__/encoders.cpython-38.opt-2.pyc000064400000002357151153537640015256 0ustar00U

e5d��@sPddddgZddlmZddlmZdd�Zd	d�Zd
d�Z	dd�Z
dd�Zd
S)�encode_7or8bit�
encode_base64�encode_noop�
encode_quopri�)�encodebytes)�encodestringcCst|dd�}|�dd�S)NT)Z	quotetabs� s=20)�
_encodestring�replace)�s�enc�r
�&/usr/lib64/python3.8/email/encoders.py�_qencodesrcCs0|jdd�}tt|�d�}|�|�d|d<dS)NT��decode�ascii�base64�Content-Transfer-Encoding)�get_payload�str�_bencode�set_payload��msg�origZencdatar
r
rrs
cCs*|jdd�}t|�}|�|�d|d<dS)NTrzquoted-printabler)rrrrr
r
rr&s
cCsX|jdd�}|dkr d|d<dSz|�d�Wntk
rJd|d<Yn
Xd|d<dS)NTrZ7bitrrZ8bit)rr�UnicodeError)rrr
r
rr2scCsdS)Nr
)rr
r
rrDsN)�__all__rrr�quoprirr	rrrrrr
r
r
r�<module>s�email/__pycache__/parser.cpython-38.opt-1.pyc000064400000013134151153537640014742 0ustar00U

e5d��@s�dZddddddgZddlmZmZdd	lmZmZdd
lm	Z	Gdd�d�Z
Gdd�de
�ZGd
d�d�ZGdd�de�Z
dS)z-A parser of RFC 2822 and MIME email messages.�Parser�HeaderParser�BytesParser�BytesHeaderParser�
FeedParser�BytesFeedParser�)�StringIO�
TextIOWrapper)rr)�compat32c@s0eZdZd
ed�dd�Zddd�Zddd	�ZdS)
rN��policycCs||_||_dS)a�Parser of RFC 2822 and MIME email messages.

        Creates an in-memory object tree representing the email message, which
        can then be manipulated and turned over to a Generator to return the
        textual representation of the message.

        The string must be formatted as a block of RFC 2822 headers and header
        continuation lines, optionally preceded by a `Unix-from' header.  The
        header block is terminated either by the end of the string or by a
        blank line.

        _class is the class to instantiate for new message objects when they
        must be created.  This class must have a constructor that can take
        zero arguments.  Default is Message.Message.

        The policy keyword specifies a policy object that controls a number of
        aspects of the parser's operation.  The default policy maintains
        backward compatibility.

        N)�_classr)�selfr
r�r�$/usr/lib64/python3.8/email/parser.py�__init__szParser.__init__FcCs@t|j|jd�}|r|��|�d�}|s,q8|�|�q|��S)a\Create a message structure from the data in a file.

        Reads all the data from the file and returns the root of the message
        structure.  Optional headersonly is a flag specifying whether to stop
        parsing after reading the headers or not.  The default is False,
        meaning it parses the entire contents of the file.
        ri )rr
rZ_set_headersonly�readZfeed�close)r�fp�headersonlyZ
feedparser�datarrr�parse)s
zParser.parsecCs|jt|�|d�S)a-Create a message structure from a string.

        Returns the root of the message structure.  Optional headersonly is a
        flag specifying whether to stop parsing after reading the headers or
        not.  The default is False, meaning it parses the entire contents of
        the file.
        �r)rr�r�textrrrr�parsestr;szParser.parsestr)N)F)F)�__name__�
__module__�__qualname__r
rrrrrrrrs
c@s eZdZddd�Zddd�ZdS)	rTcCst�||d�S�NT)rr�rrrrrrrHszHeaderParser.parsecCst�||d�Sr)rrrrrrrKszHeaderParser.parsestrN)T)T)rrrrrrrrrrGs
c@s(eZdZdd�Zd	dd�Zd
dd�ZdS)rcOst||�|_dS)a�Parser of binary RFC 2822 and MIME email messages.

        Creates an in-memory object tree representing the email message, which
        can then be manipulated and turned over to a Generator to return the
        textual representation of the message.

        The input must be formatted as a block of RFC 2822 headers and header
        continuation lines, optionally preceded by a `Unix-from' header.  The
        header block is terminated either by the end of the input or by a
        blank line.

        _class is the class to instantiate for new message objects when they
        must be created.  This class must have a constructor that can take
        zero arguments.  Default is Message.Message.
        N)r�parser)r�args�kwrrrrQszBytesParser.__init__FcCs0t|ddd�}z|j�||�W�S|��XdS)acCreate a message structure from the data in a binary file.

        Reads all the data from the file and returns the root of the message
        structure.  Optional headersonly is a flag specifying whether to stop
        parsing after reading the headers or not.  The default is False,
        meaning it parses the entire contents of the file.
        �ascii�surrogateescape)�encoding�errorsN)r	�detachr!rr rrrrcszBytesParser.parsecCs|jddd�}|j�||�S)a2Create a message structure from a byte string.

        Returns the root of the message structure.  Optional headersonly is a
        flag specifying whether to stop parsing after reading the headers or
        not.  The default is False, meaning it parses the entire contents of
        the file.
        �ASCIIr%)r')�decoder!rrrrr�
parsebytesrszBytesParser.parsebytesN)F)F)rrrrrr+rrrrrOs
c@s eZdZddd�Zddd�ZdS)	rTcCstj||dd�S�NTr)rrr rrrrszBytesHeaderParser.parsecCstj||dd�Sr,)rr+rrrrr+�szBytesHeaderParser.parsebytesN)T)T)rrrrr+rrrrr~s
N)�__doc__�__all__�iorr	Zemail.feedparserrrZemail._policybaser
rrrrrrrr�<module>s�7/email/__pycache__/iterators.cpython-38.opt-1.pyc000064400000003602151153537640015461 0ustar00U

e5dW�@sLdZdddgZddlZddlmZdd�Zdd	d�Zddd�Zddd
�ZdS)z1Various types of useful iterators and generators.�body_line_iterator�typed_subpart_iterator�walk�N)�StringIOccs.|V|��r*|��D]}|��EdHqdS)z�Walk over the message tree, yielding each subpart.

    The walk is performed in depth-first order.  This method is a
    generator.
    N)�is_multipart�get_payloadr)�self�subpart�r
�'/usr/lib64/python3.8/email/iterators.pyrsFccs6|��D](}|j|d�}t|t�rt|�EdHqdS)z�Iterate over the parts, returning string payloads line-by-line.

    Optional decode (default False) is passed through to .get_payload().
    )�decodeN)rr�
isinstance�strr)�msgrr	Zpayloadr
r
rr"s
�textccs8|��D]*}|��|kr|dks,|��|kr|VqdS)z�Iterate over the subparts with a given MIME type.

    Use `maintype' as the main MIME type to match against; this defaults to
    "text".  Optional `subtype' is the MIME subtype to match against; if
    omitted, only the main type is matched.
    N)rZget_content_maintypeZget_content_subtype)rZmaintypeZsubtyper	r
r
rr-scCs�|dkrtj}d|d}t||��d|d�|rJtd|��|d�n
t|d�|��r||��D]}t|||d|�qddS)	zA handy debugging aidN� ��)�end�filez [%s])r�)�sys�stdout�printZget_content_typeZget_default_typerr�
_structure)r�fp�levelZinclude_defaultZtabr	r
r
rr;s
r)F)rN)NrF)	�__doc__�__all__r�iorrrrrr
r
r
r�<module>s�

email/__pycache__/policy.cpython-38.opt-2.pyc000064400000006565151153537640014760 0ustar00U

e5d�(�@s�ddlZddlZddlmZmZmZmZddlmZddl	m
Z
ddlmZddl
mZddd	d
ddd
dgZe�d�ZeGdd
�d
e��Ze�Ze`ejdd�Zejdd�Zejddd�Zejdd�ZdS)�N)�Policy�Compat32�compat32�_extend_docstrings)�_has_surrogates)�HeaderRegistry)�raw_data_manager)�EmailMessagerrr�EmailPolicy�default�strict�SMTP�HTTPz\n|\rcsleZdZeZdZdZe�Ze	Z
�fdd�Zdd�Zdd�Z
d	d
�Zdd�Zd
d�Zdd�Zddd�Z�ZS)r
F�longcs*d|krt�|dt��t�jf|�dS)N�header_factory)�object�__setattr__r�super�__init__)�self�kw��	__class__��$/usr/lib64/python3.8/email/policy.pyr]szEmailPolicy.__init__cCs|j|jS�N)rZ	max_count)r�namerrr�header_max_countdszEmailPolicy.header_max_countcCs>|d�dd�\}}|�d�d�|dd��}||�d�fS)Nr�:�z 	��
)�split�lstrip�join�rstrip)rZsourcelinesr�valuerrr�header_source_parsevs	zEmailPolicy.header_source_parsecCsVt|d�r$|j��|��kr$||fSt|t�rFt|���dkrFtd��||�||�fS)NrrzDHeader values may not contain linefeed or carriage return characters)	�hasattrr�lower�
isinstance�str�len�
splitlines�
ValueErrorr�rrr&rrr�header_store_parse�s

zEmailPolicy.header_store_parsecCs*t|d�r|Sd�t�|��}|�||�S)Nrr )r(r$�linesep_splitterr"rr/rrr�header_fetch_parse�s	
zEmailPolicy.header_fetch_parsecCs|j||dd�S)NT��
refold_binary)�_foldr/rrr�fold�szEmailPolicy.foldcCs0|j|||jdkd�}|jr dnd}|�|d�S)NZ7bitr3�utf8�ascii�surrogateescape)r5Zcte_typer7�encode)rrr&Zfolded�charsetrrr�fold_binary�szEmailPolicy.fold_binarycs�t|d�r|j|d�S|jr"|jntj�|��}|jdkp�|jdko�|rdt|d�t|�d�kp�t�fdd�|d	d�D��}|s�|r�t	|�r�|�
|d
�|��j|d�S|d|j�|�|jS)Nr)Zpolicy�allrr�c3s|]}t|��kVqdSr)r,)�.0�x��maxlenrr�	<genexpr>�sz$EmailPolicy._fold.<locals>.<genexpr>rr z: )
r(r6�max_line_length�sys�maxsizer-�
refold_sourcer,�anyrrr$�linesep)rrr&r4�linesZrefoldrrArr5�s


 �zEmailPolicy._fold)F)�__name__�
__module__�__qualname__r	Zmessage_factoryr7rGrrrZcontent_managerrrr'r0r2r6r<r5�
__classcell__rrrrr
s=
T)Zraise_on_defectr!)rI)rIrD)r7)�rerEZemail._policybaserrrrZemail.utilsrZemail.headerregistryrZemail.contentmanagerrZ
email.messager	�__all__�compiler1r
rrZclonerr
rZSMTPUTF8rrrr�<module>s2�
@email/__pycache__/iterators.cpython-38.pyc000064400000003602151153537640014522 0ustar00U

e5dW�@sLdZdddgZddlZddlmZdd�Zdd	d�Zddd�Zddd
�ZdS)z1Various types of useful iterators and generators.�body_line_iterator�typed_subpart_iterator�walk�N)�StringIOccs.|V|��r*|��D]}|��EdHqdS)z�Walk over the message tree, yielding each subpart.

    The walk is performed in depth-first order.  This method is a
    generator.
    N)�is_multipart�get_payloadr)�self�subpart�r
�'/usr/lib64/python3.8/email/iterators.pyrsFccs6|��D](}|j|d�}t|t�rt|�EdHqdS)z�Iterate over the parts, returning string payloads line-by-line.

    Optional decode (default False) is passed through to .get_payload().
    )�decodeN)rr�
isinstance�strr)�msgrr	Zpayloadr
r
rr"s
�textccs8|��D]*}|��|kr|dks,|��|kr|VqdS)z�Iterate over the subparts with a given MIME type.

    Use `maintype' as the main MIME type to match against; this defaults to
    "text".  Optional `subtype' is the MIME subtype to match against; if
    omitted, only the main type is matched.
    N)rZget_content_maintypeZget_content_subtype)rZmaintypeZsubtyper	r
r
rr-scCs�|dkrtj}d|d}t||��d|d�|rJtd|��|d�n
t|d�|��r||��D]}t|||d|�qddS)	zA handy debugging aidN� ��)�end�filez [%s])r�)�sys�stdout�printZget_content_typeZget_default_typerr�
_structure)r�fp�levelZinclude_defaultZtabr	r
r
rr;s
r)F)rN)NrF)	�__doc__�__all__r�iorrrrrr
r
r
r�<module>s�

email/__pycache__/message.cpython-38.opt-2.pyc000064400000051506151153537640015100 0ustar00U

e5d��@s�ddgZddlZddlZddlZddlmZmZddlmZddlm	Z	ddl
mZmZddlm
Zdd	lmZejZd
Ze�d�Zdd
�Zddd�Zdd�Zdd�ZGdd�d�ZGdd�de�ZGdd�de�ZdS)�Message�EmailMessage�N)�BytesIO�StringIO)�utils)�errors)�Policy�compat32��charset)�decode_bz; z[ \(\)<>@,;:\\"/\[\]\?=]cCs4t|��d�\}}}|s$|��dfS|��|��fS)N�;)�str�	partition�strip)�param�a�sep�b�r�%/usr/lib64/python3.8/email/message.py�_splitparamsrTcCs�|dk	r�t|�dkr�t|t�rL|d7}t�|d|d|d�}d||fSz|�d�Wn6tk
r�|d7}t�|dd�}d||fYSX|s�t�|�r�d	|t�	|�fSd||fSn|SdS)
Nr�*���%s=%s�asciizutf-8�z%s="%s")
�len�
isinstance�tuplerZencode_rfc2231�encode�UnicodeEncodeError�	tspecials�search�quote)r�valuer%rrr�_formatparam's	
r'cCs�dt|�}g}|dd�dkr�|dd�}|�d�}|dkrp|�dd|�|�dd|�drp|�d|d�}q6|dkr�t|�}|d|�}d|kr�|�d�}|d|�����d||dd���}|�|���||d�}q|S)Nr
rr�"z\"r�=)r�find�countr�indexr�lower�append)�sZplist�end�f�irrr�_parseparamIs 
(
,r3cCs4t|t�r&|d|dt�|d�fSt�|�SdS)Nrrr)rr r�unquote)r&rrr�
_unquotevalue]s
r5c@s�eZdZefdd�Zdd�Zdcdd	�Zd
d�Zdddd
�Zdd�Z	dd�Z
dd�Zdd�Zdedd�Z
dfdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zdgd0d1�Zd2d3�Zd4d5�Zdhd6d7�Zd8d9�Zd:d;�Zd<d=�Z d>d?�Z!d@dA�Z"dBdC�Z#dDdE�Z$dFdG�Z%didJdK�Z&djdLdM�Z'dkdPdQ�Z(dldRdS�Z)dmdTdU�Z*dndVdW�Z+dodXdY�Z,dZd[�Z-dpd\d]�Z.dqd^d_�Z/d`da�Z0ddbl1m2Z2dS)rrcCs:||_g|_d|_d|_d|_d|_|_g|_d|_dS)N�
text/plain)	�policy�_headers�	_unixfrom�_payload�_charsetZpreambleZepilogue�defects�
_default_type)�selfr7rrr�__init__xszMessage.__init__cCs|��S�N)�	as_string�r>rrr�__str__�szMessage.__str__FrNcCsJddlm}|dkr|jn|}t�}||d||d�}|j||d�|��S)Nr)�	GeneratorF)�mangle_from_�maxheaderlenr7��unixfrom)�email.generatorrDr7r�flatten�getvalue)r>rHrFr7rD�fp�grrrrA�s�zMessage.as_stringcCs|��Sr@)�as_bytesrBrrr�	__bytes__�szMessage.__bytes__cCsHddlm}|dkr|jn|}t�}||d|d�}|j||d�|��S)Nr)�BytesGeneratorF)rEr7rG)rIrPr7rrJrK)r>rHr7rPrLrMrrrrN�szMessage.as_bytescCst|jt�Sr@)rr:�listrBrrr�is_multipart�szMessage.is_multipartcCs
||_dSr@�r9)r>rHrrr�set_unixfrom�szMessage.set_unixfromcCs|jSr@rSrBrrr�get_unixfrom�szMessage.get_unixfromcCsF|jdkr|g|_n.z|j�|�Wntk
r@td��YnXdS)Nz=Attach is not valid on a message with a non-multipart payload)r:r.�AttributeError�	TypeError)r>�payloadrrr�attach�s

zMessage.attachcCs�|��r(|rdS|dkr|jS|j|S|dk	rNt|jt�sNtdt|j���|j}t|�dd����}t|t�r�t	�
|�r�|�dd�}|s�z|�|�
dd�d�}Wq�tk
r�|�dd�}Yq�Xn2|r�z|�d�}Wntk
r�|�d�}YnX|�s|S|d	k�rt�|�S|d
k�rVtd�|����\}}|D]}|j�||��q<|S|dk�r�t|�}	t�}
ztj|	|
d
d�|
��WStjk
�r�|YSXt|t��r�|S|S)NzExpected list, got %szcontent-transfer-encodingrr�surrogateescaper�replace�raw-unicode-escapezquoted-printable�base64�)z
x-uuencodeZuuencodeZuuezx-uueT)�quiet)rRr:rrQrW�typer�getr-rZ_has_surrogatesr!�decode�	get_param�LookupError�UnicodeError�quopriZdecodestringr�join�
splitlinesr7Z
handle_defectr�uurK�Error)r>r2rbrX�cteZbpayloadr&r<ZdefectZin_fileZout_filerrr�get_payload�sV"








zMessage.get_payloadcCspt|d�r:|dkr||_dSt|t�s.t|�}|�|j�}t|d�rT|�dd�|_n||_|dk	rl|�|�dS)Nr!rbrrZ)�hasattrr:r�Charsetr!�output_charsetrb�set_charset)r>rXrrrr�set_payload/s


zMessage.set_payloadcCs|dkr|�d�d|_dSt|t�s.t|�}||_d|krH|�dd�d|krf|jdd|��d�n|�d|���||��kr�|�|j�|_d|k�r|�	�}z||�Wnjt
k
�r|j}|r�z|�dd	�}Wn tk
r�|�|j
�}YnX|�|�|_|�d|�YnXdS)
Nr�MIME-Version�1.0�Content-Typer6r
zContent-Transfer-EncodingrrZ)�	del_paramr;rrn�
add_headerZget_output_charset�	set_paramZbody_encoder:Zget_body_encodingrWr!rero)r>rrkrXrrrrpCs:

�
zMessage.set_charsetcCs|jSr@)r;rBrrr�get_charsetrszMessage.get_charsetcCs
t|j�Sr@)rr8rBrrr�__len__zszMessage.__len__cCs
|�|�Sr@)ra�r>�namerrr�__getitem__~s	zMessage.__getitem__cCsr|j�|�}|rX|��}d}|jD]4\}}|��|kr"|d7}||kr"td�||���q"|j�|j�||��dS)Nrrz/There may be at most {} {} headers in a message)r7Zheader_max_countr-r8�
ValueError�formatr.�header_store_parse)r>r{�valZ	max_countZlname�found�k�vrrr�__setitem__�s�zMessage.__setitem__cCs@|��}g}|jD]"\}}|��|kr|�||f�q||_dSr@)r-r8r.)r>r{�
newheadersr�r�rrr�__delitem__�szMessage.__delitem__cCs|��dd�|jD�kS)NcSsg|]\}}|���qSr)r-��.0r�r�rrr�
<listcomp>�sz(Message.__contains__.<locals>.<listcomp>)r-r8rzrrr�__contains__�szMessage.__contains__ccs|jD]\}}|VqdSr@�r8)r>Zfieldr&rrr�__iter__�szMessage.__iter__cCsdd�|jD�S)NcSsg|]\}}|�qSrrr�rrrr��sz Message.keys.<locals>.<listcomp>r�rBrrr�keys�szMessage.keyscs�fdd��jD�S)Ncsg|]\}}�j�||��qSr�r7�header_fetch_parser�rBrrr��s�z"Message.values.<locals>.<listcomp>r�rBrrBr�values�s
�zMessage.valuescs�fdd��jD�S)Ncs"g|]\}}|�j�||�f�qSrr�r�rBrrr��s�z!Message.items.<locals>.<listcomp>r�rBrrBr�items�s
�z
Message.itemscCs:|��}|jD]&\}}|��|kr|j�||�Sq|Sr@)r-r8r7r�)r>r{�failobjr�r�rrrra�s
zMessage.getcCs|j�||f�dSr@)r8r.)r>r{r&rrr�set_raw�szMessage.set_rawcCst|j���Sr@)�iterr8�copyrBrrr�	raw_items�szMessage.raw_itemscCsHg}|��}|jD](\}}|��|kr|�|j�||��q|sD|S|Sr@)r-r8r.r7r�)r>r{r�r�r�r�rrr�get_all�s	zMessage.get_allcKspg}|��D]<\}}|dkr0|�|�dd��q|�t|�dd�|��q|dk	r^|�d|�t�|�||<dS)N�_�-r)r�r.r[r'�insert�	SEMISPACErg)r>�_name�_valueZ_params�partsr�r�rrrrvszMessage.add_headercCs\|��}ttt|j��|j�D]0\}\}}|��|kr|j�||�|j|<qXqt|��dSr@)r-�zip�rangerr8r7r�KeyError)r>r�r�r2r�r�rrr�replace_header!s"zMessage.replace_headercCsHt�}|�d|�}||kr"|��St|�d��}|�d�dkrDdS|S)N�content-typer�/rr6)�objectra�get_default_typerr-r+)r>�missingr&�ctyperrr�get_content_type4s
zMessage.get_content_typecCs|��}|�d�dS)Nr�r�r��split�r>r�rrr�get_content_maintypeLszMessage.get_content_maintypecCs|��}|�d�dS)Nr�rr�r�rrr�get_content_subtypeUszMessage.get_content_subtypecCs|jSr@�r=rBrrrr�^szMessage.get_default_typecCs
||_dSr@r�r�rrr�set_default_typegszMessage.set_default_typec		Cs�t�}|�||�}||kr|Sg}t|�D]X}z$|�dd�\}}|��}|��}Wn tk
rr|��}d}YnX|�||f�q*t�|�}|S)Nr)rr)	r�rar3r�rr}r.rZ
decode_params)	r>r��headerr�r&�params�pr{r�rrr�_get_params_preserveps 

zMessage._get_params_preserver�TcCs8t�}|�||�}||kr|S|r0dd�|D�S|SdS)NcSsg|]\}}|t|�f�qSr)r5r�rrrr��sz&Message.get_params.<locals>.<listcomp>)r�r�)r>r�r�r4r�r�rrr�
get_params�s
zMessage.get_paramscCsN||kr|S|�||�D]0\}}|��|��kr|r@t|�S|Sq|Sr@)r�r-r5)r>rr�r�r4r�r�rrrrc�s
zMessage.get_paramrtrcCs
t|t�s|r|||f}||kr2|��dkr2d}n
|�|�}|j||d�st|s\t|||�}q�t�|t|||�g�}nbd}|j||d�D]N\}	}
d}|	��|��kr�t|||�}nt|	|
|�}|s�|}q�t�||g�}q�||�|�k�r|r�|�	||�n||=|||<dS)Nr�r6)r�r�r�r4)
rr r-rarcr'r�rgr�r�)r>rr&r��requoterZlanguager[r�Z	old_param�	old_valueZappend_paramrrrrw�s6

��zMessage.set_paramcCs�||krdSd}|j||d�D]@\}}|��|��kr|sHt|||�}qt�|t|||�g�}q||�|�kr|||=|||<dS)Nrr�)r�r-r'r�rgra)r>rr�r�Z	new_ctyper�r�rrrru�s
�zMessage.del_paramcCs�|�d�dkst�|��dkr,|d=d|d<||kr@|||<dS|j||d�}||=|||<|dd�D]\}}|�||||�qhdS)Nr�rr�zmime-versionrsrrr�)r+r}r-r�rw)r>r`r�r�r�r�r�rrr�set_typeszMessage.set_typecCsDt�}|�d|d�}||kr*|�d|d�}||kr6|St�|���S)N�filename�content-dispositionr{r�)r�rcr�collapse_rfc2231_valuer)r>r�r�r�rrr�get_filename&szMessage.get_filenamecCs,t�}|�d|�}||kr|St�|���S)N�boundary)r�rcrr��rstrip)r>r�r�r�rrr�get_boundary6s
zMessage.get_boundarycCst�}|�|d�}||kr$t�d��g}d}|D]:\}}|��dkr\|�dd|f�d}q0|�||f�q0|s�|�dd|f�g}|jD]z\}	}
|	��dkr�g}|D].\}}
|
dkr�|�|�q�|�d||
f�q�t�|�}
|�|j	�
|	|
��q�|�|	|
f�q�||_dS)	Nr�zNo Content-Type header foundFr�z"%s"Trr)r�r�rZHeaderParseErrorr-r.r8r�rgr7r)r>r�r�r�Z	newparamsZfoundpZpkZpvr��hr�r�r�r�rrr�set_boundaryCs2


zMessage.set_boundaryc	Cs�t�}|�d|�}||kr|St|t�rr|dp2d}z|d�d�}t||�}Wn ttfk
rp|d}YnXz|�d�Wntk
r�|YSX|��S)Nrrzus-asciirr\)	r�rcrr r!rrdrer-)r>r�r�rZpcharsetrNrrr�get_content_charsetqs 

zMessage.get_content_charsetcs�fdd�|��D�S)Ncsg|]}|����qSr)r�)r��part�r�rrr��sz(Message.get_charsets.<locals>.<listcomp>��walk)r>r�rr�r�get_charsets�szMessage.get_charsetscCs*|�d�}|dkrdSt|�d��}|S)Nr�r)rarr-)r>r&�c_drrr�get_content_disposition�s

zMessage.get_content_dispositionr�)FrN)FN)NF)N)N)N)Nr�T)Nr�T)rtTNrF)r�T)rtT)N)N)N)N)3�__name__�
__module__�__qualname__r	r?rCrArOrNrRrTrUrYrlrqrprxryr|r�r�r�r�r�r�r�rar�r�r�rvr�r�r�r�r�r�r�r�rcrwrur�r�r�r�r�r�r�Zemail.iteratorsr�rrrrrish


Z
/


				
�
"�
3

 


.


cs�eZdZd2dd�Zd3�fdd�	Zdd�Zd	d
�Zdd�Zd4dd�ZddddhZ	dd�Z
dd�Zdd�dd�Zdd�dd�Z
dd�Zd5dd �Zd6d!d"�Zd7d#d$�Zdd%�d&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Z�ZS)8�MIMEPartNcCs(|dkrddlm}|}t�||�dS)Nr)�default)Zemail.policyr�rr?)r>r7r�rrrr?�szMIMEPart.__init__Fcs0|dkr|jn|}|dkr |j}t�j||d�S)N)rFr7)r7Zmax_line_length�superrA)r>rHrFr7��	__class__rrrA�szMIMEPart.as_stringcCs|j|jjdd�d�S)NT)�utf8�r7)rAr7ZclonerBrrrrC�szMIMEPart.__str__cCs |�d�}|dkrdS|jdkS)Nr�F�
attachment)raZcontent_disposition)r>r�rrr�
is_attachment�s
zMIMEPart.is_attachmentc	cs|��rdS|���d�\}}|dkrB||kr>|�|�|fVdS|dkrNdS|dkrz|��D]}|�||�EdHq^dSd|kr�|�d�|fVd}|�d�}|r�|��D]}|d|kr�|}q�q�|dkr�|��}|r�|dnd}|dk	�r|�||�EdHdS)Nr��text�	multipart�related�start�
content-idr)r�r�r�r,�
iter_parts�
_find_bodyrcrl)	r>r��preferencelist�maintype�subtypeZsubpart�	candidater�Zsubpartsrrrr��s6

zMIMEPart._find_body�r��html�plaincCsBt|�}d}|�||�D]$\}}||kr|}|}|dkrq>q|S)Nr)rr�)r>r�Z	best_prioZbodyZprior�rrr�get_body�s
zMIMEPart.get_body)r�r�)r�r�)r�r�)r��alternativec
cs$|���d�\}}|dks"|dkr&dS|��}z|��}Wntk
rPYdSX|dkr�|dkr�|�d�}|r�d}g}|D]"}|�d�|kr�d}q||�|�q||r�|EdHdS|�d	�|EdHdSg}	|D]L}|���d�\}}||f|j	k�r|�
��s||	k�r|	�|�q�|Vq�dS)
Nr�r�r�r�r�Fr�Tr)r�r�rlr�rVrcrar.�pop�_body_typesr�)
r>r�r�rXr�r�r�Zattachmentsr��seenrrr�iter_attachmentssD



��
zMIMEPart.iter_attachmentsccs|��dkr|��EdHdS)Nr�)r�rlrBrrrr�=szMIMEPart.iter_parts)�content_managercOs"|dkr|jj}|j|f|�|�Sr@)r7r��get_content�r>r��args�kwrrrr�EszMIMEPart.get_contentcOs&|dkr|jj}|j|f|�|�dSr@)r7r��set_contentr�rrrr�JszMIMEPart.set_contentc
Cs�|��dkr6|��}||f}||kr6td�||���g}g}|jD]4\}}|���d�rj|�||f�qD|�||f�qD|r�t|�|j	d�}	||	_|j
|	_
|	g|_
ng|_
||_d||d<|dk	r�|�d|�dS)Nr�zCannot convert {} to {}�content-r�z
multipart/rtr�)r�r�r}r~r8r-�
startswithr.r`r7r:rw)
r>r�Zdisallowed_subtypesr�Zexisting_subtypeZkeep_headersZpart_headersr{r&r�rrr�_make_multipartOs0
�
zMIMEPart._make_multipartcCs|�dd|�dS)Nr�)r��mixed�r��r>r�rrr�make_relatedjszMIMEPart.make_relatedcCs|�dd|�dS)Nr�)r�r�r�rrr�make_alternativemszMIMEPart.make_alternativecCs|�dd|�dS)Nr�rr�r�rrr�
make_mixedpszMIMEPart.make_mixed)�_dispcOsf|��dks|��|kr(t|d|��t|�|jd�}|j||�|rXd|krX||d<|�|�dS)Nr�Zmake_r�r�zContent-Disposition)r�r��getattrr`r7r�rY)r>Z_subtyper�r�r�r�rrr�_add_multipartss
�zMIMEPart._add_multipartcOs|jd|�ddi|��dS)Nr�r�Zinline)r��r��r>r�r�rrr�add_related}szMIMEPart.add_relatedcOs|jd|�|�dS)Nr�)r�r�r�rrr�add_alternative�szMIMEPart.add_alternativecOs|jd|�ddi|��dS)Nr�r�r�)r�r�r�rrr�add_attachment�szMIMEPart.add_attachmentcCsg|_d|_dSr@�r8r:rBrrr�clear�szMIMEPart.clearcCsdd�|jD�|_d|_dS)NcSs&g|]\}}|���d�s||f�qS)r�)r-r�)r��nr�rrrr��s�z*MIMEPart.clear_content.<locals>.<listcomp>rrBrrr�
clear_content�szMIMEPart.clear_content)N)FNN)r�)N)N)N)r�r�r�r?rArCr�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrr�
__classcell__rrr�rr��s2

�7



r�cseZdZ�fdd�Z�ZS)rcs"t�j||�d|krd|d<dS)Nrrrs)r�r�r�r�rrr��szEmailMessage.set_content)r�r�r�r�rrrr�rr�s)NT)�__all__�rerirf�iorrZemailrrZemail._policybaserr	rr;Zemail._encoded_wordsrrnr��compiler#rr'r3r5rr�rrrrr�<module>s4


"N`email/__pycache__/_policybase.cpython-38.opt-2.pyc000064400000013540151153537640015741 0ustar00U

e5d�:�@s�ddlZddlmZddlmZddlmZdddgZGdd	�d	�Zd
d�Z	dd
�Z
Gdd�deejd�Ze
Gdd�de��Z
e
�ZdS)�N)�header)�charset)�_has_surrogates�Policy�Compat32�compat32cs<eZdZ�fdd�Zdd�Zdd�Zdd�Zd	d
�Z�ZS)�_PolicyBasecsH|��D]:\}}t||�r.tt|��||�qtd�||jj���qdS�Nz*{!r} is an invalid keyword argument for {})	�items�hasattr�superr�__setattr__�	TypeError�format�	__class__�__name__)�self�kw�name�value�r��)/usr/lib64/python3.8/email/_policybase.py�__init__)s
��z_PolicyBase.__init__cCs*dd�|j��D�}d�|jjd�|��S)NcSsg|]\}}d�||��qS)z{}={!r})r)�.0rrrrr�
<listcomp>8s�z(_PolicyBase.__repr__.<locals>.<listcomp>z{}({})z, )�__dict__r
rrr�join)r�argsrrr�__repr__7s�z_PolicyBase.__repr__cKsr|j�|j�}|j��D]\}}t�|||�q|��D]4\}}t||�s^td�||jj	���t�|||�q8|Sr	)
r�__new__rr
�objectr
rrrr)rrZ	newpolicy�attrrrrr�clone<s
��z_PolicyBase.clonecCs,t||�rd}nd}t|�|jj|���dS)Nz'{!r} object attribute {!r} is read-onlyz!{!r} object has no attribute {!r})r�AttributeErrorrrr)rrr�msgrrrr
Ns
z_PolicyBase.__setattr__cCs|jf|j�S�N)r#r)r�otherrrr�__add__Usz_PolicyBase.__add__)	r�
__module__�__qualname__rrr#r
r(�
__classcell__rrrrrs
rcCs,|�dd�d}|�dd�d}|d|S)N�
�r)�rsplit�split)�docZ	added_docrrr�_append_doc^sr1cCs�|jr(|j�d�r(t|jdj|j�|_|j��D]V\}}|jr2|j�d�r2dd�|jD�D]*}tt||�d�}|r\t||j�|_q2q\q2|S)N�+rcss |]}|��D]
}|VqqdSr&)�mro)r�base�crrr�	<genexpr>hs
z%_extend_docstrings.<locals>.<genexpr>�__doc__)r7�
startswithr1�	__bases__rr
�getattr)�clsrr"r5r0rrr�_extend_docstringscsr<c@s�eZdZdZdZdZdZdZdZdd�Z	dd	�Z
d
d�Zej
dd
��Zej
dd��Zej
dd��Zej
dd��Zej
dd��ZdS)rFr,Z8bit�NNcCs|jr
|�|�||�dSr&)�raise_on_defect�register_defect�r�objZdefectrrr�
handle_defect�szPolicy.handle_defectcCs|j�|�dSr&)Zdefects�appendr@rrrr?�szPolicy.register_defectcCsdSr&r)rrrrr�header_max_count�szPolicy.header_max_countcCst�dSr&��NotImplementedError)r�sourcelinesrrr�header_source_parse�szPolicy.header_source_parsecCst�dSr&rE�rrrrrr�header_store_parse�szPolicy.header_store_parsecCst�dSr&rErIrrr�header_fetch_parse�s	zPolicy.header_fetch_parsecCst�dSr&rErIrrr�fold�s
zPolicy.foldcCst�dSr&rErIrrr�fold_binaryszPolicy.fold_binary)rr)r*r>�linesep�cte_type�max_line_length�mangle_from_Zmessage_factoryrBr?rD�abc�abstractmethodrHrJrKrLrMrrrrrps&2

	



)�	metaclassc@sHeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)rTcCs0t|t�s|St|�r(tj|tj|d�S|SdS)N�r�header_name)�
isinstance�strrr�Header�_charset�UNKNOWN8BITrIrrr�_sanitize_headers

�zCompat32._sanitize_headercCs>|d�dd�\}}|�d�d�|dd��}||�d�fS)Nr�:r-z 	�z
)r/�lstripr�rstrip)rrGrrrrrrH%szCompat32.header_source_parsecCs||fSr&rrIrrrrJ1szCompat32.header_store_parsecCs|�||�Sr&)r\rIrrrrK7szCompat32.header_fetch_parsecCs|j||dd�S)NT��sanitize)�_foldrIrrrrL>sz
Compat32.foldcCs"|j|||jdkd�}|�dd�S)NZ7bitra�ascii�surrogateescape)rcrO�encode)rrrZfoldedrrrrMHs	zCompat32.fold_binarycCs�g}|�d|�t|t�r\t|�rL|r<tj|tj|d�}qZ|�|�d}q`tj||d�}n|}|dk	r�d}|jdk	r||j}|�|j	|j
|d��|�|j
�d�|�S)Nz%s: rU)rVr)rN�
maxlinelenr^)rCrWrXrrrYrZr[rPrfrNr)rrrrb�parts�hrgrrrrcTs(
�


zCompat32._foldN)rr)r*rQr\rHrJrKrLrMrcrrrrrs
)rRZemailrrrZZemail.utilsr�__all__rr1r<�ABCMetarrrrrrr�<module>s�L
 femail/__pycache__/_parseaddr.cpython-38.pyc000064400000030266151153537640014620 0ustar00U

e5dE�@s�dZddddgZddlZddlZdZdZd	Zd
ddd
dddddddddddddddddddd gZd!d"d#d$d%d&d'gZddddd(d)d*d(d+d*d,d+d-d,d.�Z	d/d�Z
d0d1�Zd2d�Zd3d�Z
d4d�ZGd5d6�d6�ZGd7d8�d8e�ZdS)9zcEmail address parsing code.

Lifted directly from rfc822.py.  This should eventually be rewritten.
�	mktime_tz�	parsedate�parsedate_tz�quote�N� �z, ZjanZfebZmarZaprZmayZjunZjulZaug�sep�octZnovZdecZjanuaryZfebruaryZmarchZaprilZjuneZjulyZaugustZ	septemberZoctoberZnovemberZdecemberZmonZtueZwedZthuZfriZsatZsunip���i���i���i����iD���i��)ZUTZUTCZGMT�ZZASTZADTZESTZEDTZCSTZCDTZMSTZMDTZPSTZPDTcCs,t|�}|sdS|ddkr$d|d<t|�S)zQConvert a date string to a time tuple.

    Accounts for military timezones.
    N�	r)�
_parsedate_tz�tuple)�data�res�r�(/usr/lib64/python3.8/email/_parseaddr.pyr-sc
Cs�|sdS|��}|sdS|d�d�s6|d��tkr>|d=n.|d�d�}|dkrl|d|dd�|d<t|�dkr�|d�d�}t|�dkr�||dd�}t|�dk�r|d}|�d�}|d	kr�|�d�}|dkr�|d|�||d�g|dd�<n
|�d
�t|�dk�rdS|dd�}|\}}}}}|��}|tk�rb||��}}|tk�rbdSt�	|�d}|dk�r�|d8}|d	dk�r�|dd	�}|�d
�}|dk�r�||}}|d	dk�r�|dd	�}|d�
��s�||}}|d	dk�r|dd	�}|�d
�}t|�dk�r,|\}	}
d}n~t|�dk�rF|\}	}
}ndt|�dk�r�d|dk�r�|d�d�}t|�dk�r�|\}	}
d}nt|�dk�r�|\}	}
}ndSz,t|�}t|�}t|	�}	t|
�}
t|�}Wntk
�r�YdSX|dk�r|dk�r|d7}n|d7}d}|�
�}|tk�r6t|}n>zt|�}Wntk
�rXYnX|dk�rt|�d��rtd}|�r�|dk�r�d	}
|}nd}
|
|dd|dd}||||	|
|ddd	|g
S)a�Convert date to extended time tuple.

    The last (additional) element is the time zone offset in seconds, except if
    the timezone was specified as -0000.  In that case the last element is
    None.  This indicates a UTC timestamp that explicitly declaims knowledge of
    the source timezone, as opposed to a +0000 timestamp that indicates the
    source timezone really was UTC.

    Nr�,���-��+���r���:��0�.�d�Dili�i�<)�split�endswith�lower�	_daynames�rfind�len�find�append�_monthnames�index�isdigit�int�
ValueError�upper�
_timezones�
startswith)r�iZstuff�sZddZmmZyyZtmZtzZthhZtmmZtssZtzoffsetZtzsignrrrr9s�


"














rcCs&t|�}t|t�r|dd�S|SdS)z&Convert a time string to a time tuple.Nr)r�
isinstancer
�r�trrrr�s
cCs<|ddkr"t�|dd�d�St�|�}||dSdS)zETurn a 10-tuple as returned by parsedate_tz() into a POSIX timestamp.rN�)r)�time�mktime�calendarZtimegmr5rrrr�s
cCs|�dd��dd�S)z�Prepare string to be used in a quoted string.

    Turns backslash and double quote characters into quoted pairs.  These
    are the only characters that need to be quoted inside a quoted string.
    Does not add the surrounding double quotes.
    �\z\\�"z\")�replace)�strrrrr�sc@s|eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
ddd�Zdd�Zdd�Z
dd�Zddd�Zdd�ZdS) �
AddrlistClassaAddress parser class by Ben Escoto.

    To understand what this class does, it helps to have a copy of RFC 2822 in
    front of you.

    Note: this class interface is deprecated and may be removed in the future.
    Use email.utils.AddressList instead.
    cCsZd|_d|_d|_d|_|j|j|_|j|j|j|_|j�dd�|_||_g|_	dS)z�Initialize a new instance.

        `field' is an unparsed address header field, containing
        one or more addresses.
        z()<>@,:;."[]rz 	z
rrN)
�specials�pos�LWSZCR�FWS�atomendsr=�
phraseends�field�commentlist��selfrFrrr�__init__�szAddrlistClass.__init__cCs�g}|jt|j�kr�|j|j|jdkr\|j|jdkrL|�|j|j�|jd7_q|j|jdkr�|j�|���qq�qt�|�S)z&Skip white space and extract comments.z

r�()	rAr'rFrBr)rG�
getcomment�EMPTYSTRING�join)rIZwslistrrr�gotonext�szAddrlistClass.gotonextcCs:g}|jt|j�kr6|��}|r*||7}q|�d�q|S)zVParse all addresses.

        Returns a list containing all of the addresses.
        )rr)rAr'rF�
getaddressr))rI�resultZadrrr�getaddrlist�s
zAddrlistClass.getaddrlistcCs�g|_|��|j}|j}|��}|��g}|jt|j�kr\|rXt�|j�|dfg}�n\|j|jdkr�||_||_|��}t�|j�|fg}�n"|j|jdk�rg}t|j�}|jd7_|jt|j�k�r�|��|j|k�r|j|jdk�r|jd7_�q�||�	�}q�n�|j|jdk�rx|�
�}|j�rft�|�dd�|j�d	|fg}nt�|�|fg}n@|�r�t�|j�|dfg}n"|j|j|jk�r�|jd7_|��|jt|j�k�r�|j|jd
k�r�|jd7_|S)zParse the next address.rz.@rr�;�<z (r�)r)rGrOrA�
getphraselistr'rF�SPACErN�getaddrspecrP�getrouteaddrr@)rIZoldposZoldcl�plistZ
returnlistZaddrspecZfieldlenZ	routeaddrrrrrPsX

���$zAddrlistClass.getaddresscCs�|j|jdkrdSd}|jd7_|��d}|jt|j�kr�|rT|��d}n~|j|jdkrv|jd7_q�n\|j|jdkr�|jd7_d}n8|j|jd	kr�|jd7_n|��}|jd7_q�|��q2|S)
z�Parse a route address (Return-path value).

        This method just skips all the route stuff and returns the addrspec.
        rTNFrr�>�@Tr)rFrArOr'�	getdomainrX)rIZexpectrouteZadlistrrrrYAs.
zAddrlistClass.getrouteaddrcCsTg}|��|jt|j�kr�d}|j|jdkrf|rH|d��sH|��|�d�|jd7_d}nd|j|jdkr�|�dt|����n<|j|j|j	kr�|r�|d��s�|��q�n|�|�
��|��}|r|r|�|�q|jt|j�k�s
|j|jdk�rt�|�S|�d�|jd7_|��|�
�}|�sFtSt�|�|S)	zParse an RFC 2822 addr-spec.TrrrFr<z"%s"r\)rOrAr'rF�strip�popr)r�getquoterD�getatomrMrNr])rIZaslistZpreserve_wsZwsZdomainrrrrXas:
$

zAddrlistClass.getaddrspeccCs�g}|jt|j�kr�|j|j|jkr6|jd7_q|j|jdkrX|j�|���q|j|jdkrx|�|���q|j|jdkr�|jd7_|�d�q|j|jdkr�tS|j|j|j	kr�q�q|�|�
��qt�|�S)z-Get the complete domain name from an address.rrK�[rr\)rAr'rFrBrGr)rL�getdomainliteralrMrDrarN)rIZsdlistrrrr]�s"zAddrlistClass.getdomainTcCs�|j|j|krdSdg}d}|jd7_|jt|j�kr�|rX|�|j|j�d}np|j|j|krz|jd7_q�nN|r�|j|jdkr�|�|���q,n(|j|jdkr�d}n|�|j|j�|jd7_q,t�|�S)a�Parse a header fragment delimited by special characters.

        `beginchar' is the start character for the fragment.
        If self is not looking at an instance of `beginchar' then
        getdelimited returns the empty string.

        `endchars' is a sequence of allowable end-delimiting characters.
        Parsing stops when one of these is encountered.

        If `allowcomments' is non-zero, embedded RFC 2822 comments are allowed
        within the parsed fragment.
        rFrrKr;T)rFrAr'r)rLrMrN)rIZ	begincharZendcharsZ
allowcommentsZslistrrrr�getdelimited�s(
zAddrlistClass.getdelimitedcCs|�ddd�S)z1Get a quote-delimited fragment from self's field.r<z"
F�rd�rIrrrr`�szAddrlistClass.getquotecCs|�ddd�S)z7Get a parenthesis-delimited fragment from self's field.rKz)
TrerfrrrrL�szAddrlistClass.getcommentcCsd|�ddd�S)z!Parse an RFC 2822 domain-literal.z[%s]rbz]
Frerfrrrrc�szAddrlistClass.getdomainliteralNcCsddg}|dkr|j}|jt|j�krZ|j|j|kr8qZn|�|j|j�|jd7_qt�|�S)aParse an RFC 2822 atom.

        Optional atomends specifies a different set of end token delimiters
        (the default is to use self.atomends).  This is used e.g. in
        getphraselist() since phrase endings must not include the `.' (which
        is legal in phrases).rNr)rDrAr'rFr)rMrN)rIrDZatomlistrrrra�szAddrlistClass.getatomcCs�g}|jt|j�kr�|j|j|jkr6|jd7_q|j|jdkrV|�|���q|j|jdkrx|j�|���q|j|j|jkr�q�q|�|�	|j��q|S)z�Parse a sequence of RFC 2822 phrases.

        A phrase is a sequence of words, which are in turn either RFC 2822
        atoms or quoted-strings.  Phrases are canonicalized by squeezing all
        runs of continuous whitespace into one space.
        rr<rK)
rAr'rFrCr)r`rGrLrEra)rIrZrrrrV�szAddrlistClass.getphraselist)T)N)�__name__�
__module__�__qualname__�__doc__rJrOrRrPrYrXr]rdr`rLrcrarVrrrrr?�s	; &
%
r?c@sHeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)�AddressListz@An AddressList encapsulates a list of parsed RFC 2822 addresses.cCs&t�||�|r|��|_ng|_dS�N)r?rJrR�addresslistrHrrrrJ�szAddressList.__init__cCs
t|j�Srl)r'rmrfrrr�__len__szAddressList.__len__cCs>td�}|jdd�|_|jD]}||jkr|j�|�q|Srl�rkrmr)�rI�otherZnewaddr�xrrr�__add__s

zAddressList.__add__cCs&|jD]}||jkr|j�|�q|Srl)rmr)�rIrqrrrrr�__iadd__s

zAddressList.__iadd__cCs.td�}|jD]}||jkr|j�|�q|Srlrorprrr�__sub__s


zAddressList.__sub__cCs&|jD]}||jkr|j�|�q|Srl)rm�removertrrr�__isub__s

zAddressList.__isub__cCs
|j|Srl)rm)rIr+rrr�__getitem__%szAddressList.__getitem__N)rgrhrirjrJrnrsrurvrxryrrrrrk�s	rk)rj�__all__r8r:rWrMZ
COMMASPACEr*r%r0rrrrrr?rkrrrr�<module>sd���	w	

/email/__pycache__/generator.cpython-38.pyc000064400000030356151153537640014502 0ustar00U

e5d�N�@s�dZdddgZddlZddlZddlZddlZddlmZddlm	Z	m
Z
ddlmZd	Z
d
Ze�d�Ze�dej�ZGd
d�d�ZGdd�de�ZdZGdd�de�Zeeejd��ZdeZejZdS)z:Classes to generate plain text from a message object tree.�	Generator�DecodedGenerator�BytesGenerator�N)�deepcopy)�StringIO�BytesIO)�_has_surrogates�_�
z
\r\n|\r|\nz^From c@s�eZdZdZd'dd�dd�Zdd�Zd(d	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZeZdd�Zdd�Zdd �Zd!d"�Zed)d#d$��Zed%d&��ZdS)*rz�Generates output from a Message object tree.

    This basic generator writes the message to the given file object as plain
    text.
    N��policycCs6|dkr|dkrdn|j}||_||_||_||_dS)a�Create the generator for message flattening.

        outfp is the output file-like object for writing the message to.  It
        must have a write() method.

        Optional mangle_from_ is a flag that, when True (the default if policy
        is not set), escapes From_ lines in the body of the message by putting
        a `>' in front of them.

        Optional maxheaderlen specifies the longest length for a non-continued
        header.  When a header line is longer (in characters, with tabs
        expanded to 8 spaces) than maxheaderlen, the header will split as
        defined in the Header class.  Set maxheaderlen to zero to disable
        header wrapping.  The default is 78, as recommended (but not required)
        by RFC 2822.

        The policy keyword specifies a policy object that controls a number of
        aspects of the generator's operation.  If no policy is specified,
        the policy associated with the Message object passed to the
        flatten method is used.

        NT)�mangle_from_�_fp�
_mangle_from_�maxheaderlenr)�self�outfpr
rr�r�'/usr/lib64/python3.8/email/generator.py�__init__$szGenerator.__init__cCs|j�|�dS�N)r�write�r�srrrrDszGenerator.writeFcCs�|jdkr|jn|j}|dk	r*|j|d�}|jdk	rB|j|jd�}|j|_|�|j�|_d|_|�|j�|_|j}|j}zL||_||_|r�|�	�}|s�dt
�t
�
��}|�||j�|�
|�W5||_||_XdS)a�Print the message object tree rooted at msg to the output file
        specified when the Generator instance was created.

        unixfrom is a flag that forces the printing of a Unix From_ delimiter
        before the first object in the message tree.  If the original message
        has no From_ delimiter, a `standard' one is crafted.  By default, this
        is False to inhibit the printing of any From_ delimiter.

        Note that for subobjects, no From_ line is printed.

        linesep specifies the characters used to indicate a new line in
        the output.  The default value is determined by the policy specified
        when the Generator instance was created or, if none was specified,
        from the policy associated with the msg.

        N)�linesep�Zmax_line_length�zFrom nobody )r�clonerr�_NL�_encode�_encoded_NLZ_EMPTY�_encoded_EMPTYZget_unixfrom�time�ctimer�_write)r�msg�unixfromrrZold_gen_policyZold_msg_policyZufromrrr�flattenHs,
zGenerator.flattencCs|j||jd|jd�S)z1Clone this generator with the exact same options.Nr)�	__class__rr)r�fprrrrys
�zGenerator.clonecCst�Sr)r�rrrr�_new_buffer�szGenerator._new_buffercCs|Srrrrrrr�szGenerator._encodecCsT|sdSt�|�}|dd�D]}|�|�|�|j�q|drP|�|d�dS)N���)�NLCRE�splitrr)r�lines�linerrr�_write_lines�s

zGenerator._write_linescCs�|j}z"d|_|��|_}|�|�W5||_|j}|`X|r�t|�}|�d�dkrd|d|d<n|�d|d�|�d|d�t|dd�}|dkr�|�|�n||�|j�	|�
��dS)N�content-transfer-encodingr�Content-Transfer-Encoding�content-type��_write_headers)r�
_munge_cter+�	_dispatchr�getZreplace_header�getattrr6r�getvalue)rr%ZoldfpZ	munge_cteZsfp�methrrrr$�s&zGenerator._writecCst|��}|��}t�||f��dd�}t|d|d�}|dkrh|�dd�}t|d|d�}|dkrh|j}||�dS)N�-r	Z_handle_)�get_content_maintype�get_content_subtype�
UNDERSCORE�join�replacer:�
_writeBody)rr%�main�subZspecificr<Zgenericrrrr8�szGenerator._dispatchcCs6|��D]\}}|�|j�||��q|�|j�dSr)�	raw_itemsrrZfoldr�rr%�h�vrrrr6�szGenerator._write_headerscCs�|��}|dkrdSt|t�s.tdt|���t|j�r~|�d�}|dk	r~t|�}|d=|�	||�|��}|d|df|_
|jr�t�
d|�}|�|�dS)Nzstring payload expected: %s�charsetr2r4�>From )�get_payload�
isinstance�str�	TypeError�typer�_payloadZ	get_paramrZset_payloadr7r�fcrerEr1)rr%�payloadrJrrr�_handle_text�s$


�zGenerator._handle_textcCs�g}|��}|dkrg}n(t|t�r2|�|�dSt|t�sB|g}|D]6}|��}|�|�}|j|d|jd�|�	|�
��qF|��}|s�|j�
|�}|�|�}|�|�|jdk	r�|jr�t�d|j�}	n|j}	|�|	�|�|j�|�d||j�|�r|j�|�d��|D],}
|�|jd||j�|j�|
��q|�|jd|d|j�|jdk	�r�|j�r�t�d|j�}n|j}|�|�dS)NF�r&rrKz--r)rLrMrNr�listr+rr'r�appendr;Zget_boundaryr rA�_make_boundaryZset_boundary�preamblerrRrEr1r�pop�epilogue)rr%ZmsgtextsZsubparts�partr�g�boundaryZalltextrYZ	body_partr[rrr�_handle_multipartsJ







zGenerator._handle_multipartcCs0|j}|jdd�|_z|�|�W5||_XdS)Nrr)rrr_)rr%�prrr�_handle_multipart_signed<s
z"Generator._handle_multipart_signedcCs�g}|��D]t}|��}|�|�}|j|d|jd�|��}|�|j�}|rv|d|jkrv|�	|j�
|dd���q|�	|�q|j�|j�
|��dS)NFrUr,)
rLr+rr'rr;r.r r!rWrArr)rr%Zblocksr\rr]�textr/rrr�_handle_message_delivery_statusGs
z)Generator._handle_message_delivery_statuscCs^|��}|�|�}|j}t|t�rD|j|�d�d|jd�|��}n
|�	|�}|j
�|�dS)NrFrU)r+rrQrMrVr'rLrr;rrr)rr%rr]rSrrr�_handle_message\s




zGenerator._handle_messagecCsvt�tj�}dt|d}|dkr(|S|}d}|�dt�|�dtj�}|�	|�sXqr|dt
|�}|d7}q0|S)Nz===============z==rz^--z(--)?$�.r5)�randomZ	randrange�sys�maxsize�_fmt�_compile_re�re�escape�	MULTILINE�searchrN)�clsrb�tokenr^�bZcounterZcrerrrrXus

zGenerator._make_boundarycCst�||�Sr)rk�compile�ror�flagsrrrrj�szGenerator._compile_re)NN)FN)N)�__name__�
__module__�__qualname__�__doc__rrr'rr+rr1r$r8r6rTrCr_rarcrd�classmethodrXrjrrrrrs.	� 
1'
:csPeZdZdZdd�Zdd�Zdd�Zdd	�Z�fd
d�ZeZ	e
dd
��Z�ZS)ra�Generates a bytes version of a Message object tree.

    Functionally identical to the base Generator except that the output is
    bytes and not string.  When surrogates were used in the input to encode
    bytes, these are decoded back to bytes for output.  If the policy has
    cte_type set to 7bit, then the message is transformed such that the
    non-ASCII bytes are properly content transfer encoded, using the charset
    unknown-8bit.

    The outfp object must accept bytes in its write method.
    cCs|j�|�dd��dS)N�ascii�surrogateescape)rr�encoderrrrr�szBytesGenerator.writecCst�Sr)rr*rrrr+�szBytesGenerator._new_buffercCs
|�d�S�Nrz)r|rrrrr�szBytesGenerator._encodecCs8|��D]\}}|j�|j�||��q|�|j�dSr)rFrrrZfold_binaryrrGrrrr6�szBytesGenerator._write_headerscs\|jdkrdSt|j�rH|jjdksH|jr:t�d|j�|_|�|j�ntt	|��
|�dS)NZ7bitrK)rQrrZcte_typerrRrEr1�superrrT)rr%�r(rrrT�s
zBytesGenerator._handle_textcCst�|�d�|�Sr})rkrrr|rsrrrrj�szBytesGenerator._compile_re)
rurvrwrxrr+rr6rTrCryrj�
__classcell__rrrrr�s
zD[Non-text (%(type)s) part of message omitted, filename %(filename)s]c@s(eZdZdZddd�dd�Zdd�ZdS)	rz�Generates a text representation of a message.

    Like the Generator base class, except that non-text parts are substituted
    with a format string representing the part.
    NrcCs.tj|||||d�|dkr$t|_n||_dS)a�Like Generator.__init__() except that an additional optional
        argument is allowed.

        Walks through all subparts of a message.  If the subpart is of main
        type `text', then it prints the decoded payload of the subpart.

        Otherwise, fmt is a format string that is used instead of the message
        payload.  fmt is expanded with the following keywords (in
        %(keyword)s format):

        type       : Full MIME type of the non-text part
        maintype   : Main MIME type of the non-text part
        subtype    : Sub-MIME type of the non-text part
        filename   : Filename of the non-text part
        description: Description associated with the non-text part
        encoding   : Content transfer encoding of the non-text part

        The default value for fmt is None, meaning

        [Non-text (%(type)s) part of message omitted, filename %(filename)s]
        rN)rr�_FMTri)rrr
rZfmtrrrrr�s�zDecodedGenerator.__init__cCs�|��D]v}|��}|dkr2t|jdd�|d�q|dkr<qt|j|��|��|��|�d�|�dd�|�d	d
�d�|d�qdS)NrbF)�decode)�fileZ	multipartz
[no filename]zContent-Descriptionz[no description]r3z
[no encoding])rP�maintypeZsubtype�filenameZdescription�encoding)	�walkr>�printrLriZget_content_typer?�get_filenamer9)rr%r\r�rrrr8�s(���	�zDecodedGenerator._dispatch)NNN)rurvrwrxrr8rrrrr�s
�r5z%%0%dd)rx�__all__rkrgr"rf�copyr�iorrZemail.utilsrr@�NLrrr-rmrRrrr�r�len�reprrhZ_widthrirXrrrr�<module>s*

t3;email/__pycache__/header.cpython-38.opt-2.pyc000064400000025101151153537640014674 0ustar00U

e5d&^�@s�dddgZddlZddlZddlZddlZddlmZddlmZ	e	j
Z
dZdZd	Z
d
ZdZdZd
Ze
d�Ze
d�Ze�dejejB�Ze�d�Ze�d�ZejjZdd�Zddd�ZGdd�d�ZGdd�d�ZGdd�de �Z!dS)�Header�
decode_header�make_header�N)�HeaderParseError)�charset�
� � z        ��Nz 	�us-asciizutf-8ai
  =\?                   # literal =?
  (?P<charset>[^?]*?)   # non-greedy up to the next ? is the charset
  \?                    # literal ?
  (?P<encoding>[qQbB])  # either a "q" or a "b", case insensitive
  \?                    # literal ?
  (?P<encoded>.*?)      # non-greedy up to the next ?= is the encoded string
  \?=                   # literal ?=
  z[\041-\176]+:$z
\n[^ \t]+:c	Cs�t|d�rdd�|jD�St�|�s.|dfgSg}|��D]�}t�|�}d}|r:|�d�}|rj|��}d}|r~|�|ddf�|rL|�d��	�}|�d��	�}|�d�}|�|||f�qLq:g}	t
|�D]J\}
}|
dkr�|dr�||
ddr�||
dd��r�|	�|
d�q�t|	�D]}||=�qg}
|D]�\}}}|dk�rV|
�||f�n�|d	k�r|t
j�|�}|
�||f�n~|d
k�r�t|�d}|�r�|ddd|�7}zt
j�|�}Wn tjk
�r�td
��YnX|
�||f�ntd|���q2g}d}}|
D]v\}}t|t��r,t|d�}|dk�r@|}|}nB||k�rb|�||f�|}|}n |dk�rz|t|7}n||7}�q|�||f�|S)N�_chunkscSs(g|] \}}t�|t|��t|�f�qS�)�_charsetZ_encode�str)�.0�stringrrr�$/usr/lib64/python3.8/email/header.py�
<listcomp>Ms�z!decode_header.<locals>.<listcomp>TrF���q�b�z===zBase64 decoding errorzUnexpected encoding: zraw-unicode-escape)�hasattrr
�ecre�search�
splitlines�split�pop�lstrip�append�lower�	enumerate�isspace�reversed�email�
quoprimimeZ
header_decode�lenZ
base64mime�decode�binascii�Errorr�AssertionError�
isinstancer�bytes�BSPACE)�headerZwords�line�parts�firstZ	unencodedr�encodingZencodedZdroplist�n�w�dZ
decoded_wordsZencoded_stringZwordZpaderrZ	collapsedZ	last_word�last_charsetrrrr=s|
�




4







cCsFt|||d�}|D].\}}|dk	r4t|t�s4t|�}|�||�q|S)N)�
maxlinelen�header_name�continuation_ws)rr-�Charsetr!)Zdecoded_seqr9r:r;�h�srrrrr�s�c@sJeZdZddd�Zdd�Zdd	�Zdd
d�Zdd
�Zddd�Zdd�Z	dS)rNr�strictcCs||dkrt}nt|t�s t|�}||_||_g|_|dk	rH|�|||�|dkrTt}||_|dkrjd|_	nt
|�d|_	dS)Nrr)�USASCIIr-r<r�_continuation_wsr
r!�
MAXLINELEN�_maxlinelen�
_headerlenr()�selfr>rr9r:r;�errorsrrr�__init__�s
zHeader.__init__c	Cs�|��g}d}d}|jD]�\}}|}|tjkrH|�dd�}|�dd�}|r�|o\|�|d�}|dkr�|dkr�|s�|�t�d}n|dkr�|s�|�t�|o�|�|d�}|}|�|�qt	�
|�S)N�ascii�surrogateescape�replacer�Nr���)�
_normalizer
r�UNKNOWN8BIT�encoder)�	_nonctextr!�SPACE�EMPTYSTRING�join)	rEZuchunks�lastcs�	lastspacerrZnextcsZoriginal_bytes�hasspacerrr�__str__�s*


zHeader.__str__cCs|t|�kS�N)r)rE�otherrrr�__eq__sz
Header.__eq__cCs�|dkr|j}nt|t�s"t|�}t|t�sZ|jp4d}|tjkrN|�dd�}n|�||�}|jpbd}|tjkr�z|�||�Wn"t	k
r�|dkr��t
}YnX|j�||f�dS)NrrI)
rr-r<rZinput_codecrNr)Zoutput_codecrO�UnicodeEncodeError�UTF8r
r!)rEr>rrFZ
input_charsetZoutput_charsetrrrr!	s$






z
Header.appendcCs|��p|dkS)N)�(�)�\)r$)rEr>rrrrP4szHeader._nonctext�;, 	rcCs�|��|dkr|j}|dkr"d}t|j||j|�}d}d}}|jD�]\}}	|dk	r�|oh|�|d�}|dkr�|r~|	dkr�|��n|	dkr�|s�|��|o�|�|d�}|	}d}|��}
|
r�|�	d|
d|	�n|�	dd|	�|
dd�D]`}|�
�|	jdk	�r"|�	|jd|��|	�q�|��}|dt
|�t
|��}
|�	|
||	�q�t
|
�dkrF|�
�qF|j�rx|��|�|�}t�|��r�td	�|���|S)
Nri@BrKrLFr
rrz8header value appears to contain an embedded header: {!r})rMrC�_ValueFormatterrDrAr
rP�add_transitionr�feed�newline�header_encodingr r(�_str�_embedded_headerrr�format)rE�
splitcharsr9�linesepZ	formatterrTrVrUrr�linesr1Zsline�fws�valuerrrrO9sZ!�
�

�z
Header.encodecCsxg}d}g}|jD]B\}}||kr.|�|�q|dk	rJ|�t�|�|f�|g}|}q|rn|�t�|�|f�||_dSrX)r
r!rQrS)rEZchunksr8Z
last_chunkrrrrrrM�szHeader._normalize)NNNNrr?)Nr?)r`Nr)
�__name__�
__module__�__qualname__rGrWrZr!rPrOrMrrrrr�s�
/ 
+
Pc@sTeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�ZdS)racCs0||_||_t|�|_||_g|_t|�|_dSrX)�_maxlenrAr(�_continuation_ws_len�_splitchars�_lines�_Accumulator�
_current_line)rEZ	headerlen�maxlenr;rirrrrG�s
z_ValueFormatter.__init__cCs|��|�|j�SrX)rdrSrt)rErjrrrrf�sz_ValueFormatter._strcCs
|�t�SrX)rf�NL�rErrrrW�sz_ValueFormatter.__str__cCsv|j��}|dkr|jj|�t|j�dkrh|j��rV|jrV|jdt|j�7<n|j�t|j��|j��dS)N)rr
rrL)	rvr�pushr(�	is_onlywsrtrr!�reset)rEZend_of_linerrrrd�s
z_ValueFormatter.newlinecCs|j�dd�dS)Nrr
)rvrzryrrrrb�sz_ValueFormatter.add_transitioncCs�|jdkr|�|||j�dS|�||���}z|�d�}Wntk
rRYdSX|dk	rh|�||�z|��}Wntk
r�YdSX|��|j	�
|j|�|D]}|j�
|j|�q�dS�Nr)re�_ascii_splitrsZheader_encode_lines�_maxlengthsr�
IndexError�
_append_chunkrdrvrzrArtr!)rErlrrZ
encoded_linesZ
first_line�	last_liner1rrrrc�s$
z_ValueFormatter.feedccs&|jt|j�V|j|jVqdSrX)rqr(rvrrryrrrr�sz_ValueFormatter._maxlengthscCsft�dtd||�}|dr0dg|dd�<n
|�d�tt|�gd�D]\}}|�||�qLdS)Nz([z]+)rr
r)�rer�FWSr�zip�iterr�)rErlrrir2�partrrrr~�s
z_ValueFormatter._ascii_splitcCs|j�||�t|j�|jk�r|jD]v}t|j��ddd�D]T}|��rn|j|d}|rn|d|krnq�|j|dd}|r@|d|kr@q�q@q&q�q&|j��\}}|jj	dkr�|�
�|s�d}|j�||�dS|j�|�}|j�
t|j��|j�|�dS)NrrrLr)rvrzr(rqrs�range�
part_countr$r�
_initial_sizerd�pop_fromrtr!rr|)rErlrZch�iZprevpartr�Z	remainderrrrr��s.
z_ValueFormatter._append_chunkN)rnrorprGrfrWrdrbrcrr~r�rrrrra�s%racsjeZdZd�fdd�	Zdd�Zddd�Z�fdd	�Zd
d�Zdd
�Zddd�Z	dd�Z
�fdd�Z�ZS)rurcs||_t���dSrX)r��superrG)rEZinitial_size��	__class__rrrGsz_Accumulator.__init__cCs|�||f�dSrX)r!)rErlrrrrrz#sz_Accumulator.pushcCs||d�}g||d�<|SrXr)rEr�Zpoppedrrrr�&sz_Accumulator.pop_fromcs|��dkrdSt���S)Nr)r
r
)r�r�rryr�rrr+sz_Accumulator.popcCstdd�|D�|j�S)Ncss"|]\}}t|�t|�VqdSrX)r(�rrlr�rrr�	<genexpr>1sz'_Accumulator.__len__.<locals>.<genexpr>)�sumr�ryrrr�__len__0s�z_Accumulator.__len__cCst�dd�|D��S)Ncss |]\}}t�||f�VqdSrX�rRrSr�rrrr�5s�z'_Accumulator.__str__.<locals>.<genexpr>r�ryrrrrW4s
�z_Accumulator.__str__NcCs"|dkrg}||dd�<d|_dSr})r�)rEZstartvalrrrr|8sz_Accumulator.resetcCs|jdko|pt|���Sr})r�rr$ryrrrr{>sz_Accumulator.is_onlywscs
t���SrX)r�r�ryr�rrr�Asz_Accumulator.part_count)r)r)N)
rnrorprGrzr�rr�rWr|r{r��
__classcell__rrr�rrus

ru)NNr)"�__all__r�r*Zemail.quoprimimer&Zemail.base64mimeZemail.errorsrrrr<rxrQr/ZSPACE8rRrBr�r@r\�compile�VERBOSE�	MULTILINErZfcrergr'Z_max_appendrrrra�listrurrrr�<module>sD�
�

_�
kemail/__pycache__/_header_value_parser.cpython-38.pyc000064400000234077151153537640016661 0ustar00U

e5dϡ�	@s�dZddlZddlZddlZddlmZddlmZddlm	Z
ddlmZddlmZe
d�Zee
d	�BZe
d
�ZeeBZee
d�Zee
d�Zee
d
�Be
d�ZeeBZee
d�BZeeBZee
d�Zdd�Ze�dejejB�ZGdd�de�ZGdd�de�Z Gdd�de�Z!Gdd�de�Z"Gdd�de�Z#Gdd�de �Z$Gdd �d e�Z%Gd!d"�d"e�Z&Gd#d$�d$e�Z'Gd%d&�d&e�Z(Gd'd(�d(e(�Z)Gd)d*�d*e �Z*Gd+d,�d,e�Z+Gd-d.�d.e�Z,Gd/d0�d0e�Z-Gd1d2�d2e�Z.Gd3d4�d4e�Z/Gd5d6�d6e�Z0Gd7d8�d8e�Z1Gd9d:�d:e�Z2Gd;d<�d<e�Z3Gd=d>�d>e�Z4Gd?d@�d@e�Z5GdAdB�dBe�Z6GdCdD�dDe�Z7GdEdF�dFe�Z8GdGdH�dHe�Z9GdIdJ�dJe�Z:GdKdL�dLe"�Z;GdMdN�dNe�Z<GdOdP�dPe�Z=GdQdR�dRe�Z>GdSdT�dTe�Z?GdUdV�dVe?�Z@GdWdX�dXe�ZAGdYdZ�dZe�ZBGd[d\�d\e�ZCGd]d^�d^e�ZDGd_d`�d`e�ZEGdadb�dbeE�ZFGdcdd�ddeE�ZGGdedf�dfe�ZHGdgdh�dhe�ZIGdidj�dje�ZJGdkdl�dleJ�ZKGdmdn�dneK�ZLGdodp�dpe�ZMGdqdr�dreN�ZOGdsdt�dteO�ZPGdudv�dveO�ZQGdwdx�dxeP�ZRGdydz�dzejS�ZTeQdd{�ZUeQd|d}�ZVeQd~d�ZWe�d��Xd��Ye���jZZ[e�d��Xe�\d��Ye����j]Z^e�d��j_Z`e�d��Xe�\d��Ye����j]Zae�d��Xe�\d��Ye����j]Zbe�d��Xe�\d��Ye����j]Zcd�d��Zdd�d��Zed�d��Zfd�d��Zgd�d��Zhd�d��Zid�d��Zjd�d��Zkd�d��Zld�d��Zmd�d��Znd�d��Zod�d��Zpd�d��Zqd�d��Zrd�d��Zsd�d��Ztd�d��Zud�d��Zvd�d��Zwd�d��Zxd�d��Zyd�d��Zzd�d��Z{d�d��Z|d�d��Z}d�d��Z~d�d��Zd�d��Z�d�d��Z�d�d��Z�d�dÄZ�d�dńZ�d�dDŽZ�d�dɄZ�d�d˄Z�d�d̈́Z�d�dτZ�d�dфZ�d�dӄZ�d�dՄZ�d�dׄZ�d�dلZ�d�dۄZ�d�d݄Z�d�d߄Z�d�d�Z�d�d�Z�d�d�Z�d�d�Z�d�d�Z�d�d�Z�d�d�Z�d�d�Z�d�d�Z�d�d�Z�d�d��Z�d�d��Z�dS)�alHeader value parser implementing various email-related RFC parsing rules.

The parsing methods defined in this module implement various email related
parsing rules.  Principal among them is RFC 5322, which is the followon
to RFC 2822 and primarily a clarification of the former.  It also implements
RFC 2047 encoded word decoding.

RFC 5322 goes to considerable trouble to maintain backward compatibility with
RFC 822 in the parse phase, while cleaning up the structure on the generation
phase.  This parser supports correct RFC 5322 generation by tagging white space
as folding white space only when folding is allowed in the non-obsolete rule
sets.  Actually, the parser is even more generous when accepting input than RFC
5322 mandates, following the spirit of Postel's Law, which RFC 5322 encourages.
Where possible deviations from the standard are annotated on the 'defects'
attribute of tokens that deviate.

The general structure of the parser follows RFC 5322, and uses its terminology
where there is a direct correspondence.  Where the implementation requires a
somewhat different structure than that used by the formal grammar, new terms
that mimic the closest existing terms are used.  Thus, it really helps to have
a copy of RFC 5322 handy when studying this code.

Input to the parser is a string that has already been unfolded according to
RFC 5322 rules.  According to the RFC this unfolding is the very first step, and
this parser leaves the unfolding step to a higher level message parser, which
will have already detected the line breaks that need unfolding while
determining the beginning and end of each header.

The output of the parser is a TokenList object, which is a list subclass.  A
TokenList is a recursive data structure.  The terminal nodes of the structure
are Terminal objects, which are subclasses of str.  These do not correspond
directly to terminal objects in the formal grammar, but are instead more
practical higher level combinations of true terminals.

All TokenList and Terminal objects have a 'value' attribute, which produces the
semantically meaningful value of that part of the parse subtree.  The value of
all whitespace tokens (no matter how many sub-tokens they may contain) is a
single space, as per the RFC rules.  This includes 'CFWS', which is herein
included in the general class of whitespace tokens.  There is one exception to
the rule that whitespace tokens are collapsed into single spaces in values: in
the value of a 'bare-quoted-string' (a quoted-string with no leading or
trailing whitespace), any whitespace that appeared between the quotation marks
is preserved in the returned value.  Note that in all Terminal strings quoted
pairs are turned into their unquoted values.

All TokenList and Terminal objects also have a string value, which attempts to
be a "canonical" representation of the RFC-compliant form of the substring that
produced the parsed subtree, including minimal use of quoted pair quoting.
Whitespace runs are not collapsed.

Comment tokens also have a 'content' attribute providing the string found
between the parens (including any nested comments) with whitespace preserved.

All TokenList and Terminal objects have a 'defects' attribute which is a
possibly empty list all of the defects found while creating the token.  Defects
may appear on any token in the tree, and a composite list of all defects in the
subtree is available through the 'all_defects' attribute of any node.  (For
Terminal notes x.defects == x.all_defects.)

Each object in a parse tree is called a 'token', and each has a 'token_type'
attribute that gives the name from the RFC 5322 grammar that it represents.
Not all RFC 5322 nodes are produced, and there is one non-RFC 5322 node that
may be produced: 'ptext'.  A 'ptext' is a string of printable ascii characters.
It is returned in place of lists of (ctext/quoted-pair) and
(qtext/quoted-pair).

XXX: provide complete list of token types.
�N)�	hexdigits)�
itemgetter)�_encoded_words)�errors)�utilsz 	�(z
()<>@,:;.\"[]�.z."(z/?=z*'%�%cCs dt|��dd��dd�dS)N�"�\�\\z\")�str�replace��value�r�2/usr/lib64/python3.8/email/_header_value_parser.py�quote_string`srz�
   =\?            # literal =?
   [^?]*          # charset
   \?             # literal ?
   [qQbB]         # literal 'q' or 'b', case insensitive
   \?             # literal ?
  .*?             # encoded word
  \?=             # literal ?=
cs�eZdZdZdZdZ�fdd�Zdd�Z�fdd�Ze	d	d
��Z
e	dd��Zd
d�Ze	dd��Z
e	dd��Zdd�Zddd�Zddd�Zddd�Z�ZS)�	TokenListNTcst�j||�g|_dS�N)�super�__init__�defects)�self�args�kw��	__class__rrryszTokenList.__init__cCsd�dd�|D��S)N�css|]}t|�VqdSr�r
��.0�xrrr�	<genexpr>~sz$TokenList.__str__.<locals>.<genexpr>��join�rrrr�__str__}szTokenList.__str__csd�|jjt����S�Nz{}({})��formatr�__name__r�__repr__r&rrrr,�s
�zTokenList.__repr__cCsd�dd�|D��S)Nrcss|]}|jr|jVqdSrrr rrrr#�sz"TokenList.value.<locals>.<genexpr>r$r&rrrr�szTokenList.valuecCstdd�|D�|j�S)Ncss|]}|jVqdSr)�all_defectsr rrrr#�sz(TokenList.all_defects.<locals>.<genexpr>)�sumrr&rrrr-�szTokenList.all_defectscCs|d��S�Nr)�startswith_fwsr&rrrr0�szTokenList.startswith_fwscCstdd�|D��S)zATrue if all top level tokens of this part may be RFC2047 encoded.css|]}|jVqdSr)�
as_ew_allowed)r!�partrrrr#�sz*TokenList.as_ew_allowed.<locals>.<genexpr>)�allr&rrrr1�szTokenList.as_ew_allowedcCsg}|D]}|�|j�q|Sr)�extend�comments)rr5�tokenrrrr5�szTokenList.commentscCst||d�S)N��policy)�_refold_parse_tree�rr8rrr�fold�szTokenList.foldrcCst|j|d��dS)N��indent)�print�ppstr�rr=rrr�pprint�szTokenList.pprintcCsd�|j|d��S)N�
r<)r%�_ppr@rrrr?�szTokenList.ppstrccszd�||jj|j�V|D]4}t|d�s:|d�|�Vq|�|d�EdHq|jrdd�|j�}nd}d�||�VdS)Nz{}{}/{}(rCz*    !! invalid element in token list: {!r}z    z Defects: {}rz{}){})r*rr+�
token_type�hasattrrCr)rr=r6ZextrarrrrC�s�
�
z
TokenList._pp)r)r)r)r+�
__module__�__qualname__rD�syntactic_break�ew_combine_allowedrr'r,�propertyrr-r0r1r5r;rAr?rC�
__classcell__rrrrrss&





rc@s$eZdZedd��Zedd��ZdS)�WhiteSpaceTokenListcCsdS�N� rr&rrrr�szWhiteSpaceTokenList.valuecCsdd�|D�S)NcSsg|]}|jdkr|j�qS)�comment)rD�contentr rrr�
<listcomp>�s
z0WhiteSpaceTokenList.comments.<locals>.<listcomp>rr&rrrr5�szWhiteSpaceTokenList.commentsN)r+rFrGrJrr5rrrrrL�s
rLc@seZdZdZdS)�UnstructuredTokenList�unstructuredN�r+rFrGrDrrrrrR�srRc@seZdZdZdS)�Phrase�phraseNrTrrrrrU�srUc@seZdZdZdS)�WordZwordNrTrrrrrW�srWc@seZdZdZdS)�CFWSList�cfwsNrTrrrrrX�srXc@seZdZdZdS)�Atom�atomNrTrrrrrZ�srZc@seZdZdZdZdS)�Tokenr6FN)r+rFrGrDZencode_as_ewrrrrr\�sr\c@seZdZdZdZdZdZdS)�EncodedWord�encoded-wordN)r+rFrGrD�cte�charset�langrrrrr]�sr]c@s4eZdZdZedd��Zedd��Zedd��ZdS)	�QuotedString�
quoted-stringcCs"|D]}|jdkr|jSqdS�N�bare-quoted-string�rDr�rr"rrrrP�s
zQuotedString.contentcCs>g}|D]*}|jdkr&|�t|��q|�|j�qd�|�S)Nrer)rD�appendr
rr%)r�resr"rrr�quoted_value�s
zQuotedString.quoted_valuecCs"|D]}|jdkr|jSqdSrdrf�rr6rrr�stripped_value�s
zQuotedString.stripped_valueN)r+rFrGrDrJrPrjrlrrrrrb�s

	rbc@s$eZdZdZdd�Zedd��ZdS)�BareQuotedStringrecCstd�dd�|D���S)Nrcss|]}t|�VqdSrrr rrrr#sz+BareQuotedString.__str__.<locals>.<genexpr>)rr%r&rrrr'�szBareQuotedString.__str__cCsd�dd�|D��S)Nrcss|]}t|�VqdSrrr rrrr#sz)BareQuotedString.value.<locals>.<genexpr>r$r&rrrrszBareQuotedString.valueN)r+rFrGrDr'rJrrrrrrm�srmc@s8eZdZdZdd�Zdd�Zedd��Zedd	��Zd
S)�CommentrOcs(d�tdg�fdd��D�dggg��S)Nrrcsg|]}��|��qSr)�quoter r&rrrQsz#Comment.__str__.<locals>.<listcomp>�))r%r.r&rr&rr's��zComment.__str__cCs2|jdkrt|�St|��dd��dd��dd�S)NrOrrrz\(rpz\))rDr
r)rrrrrros
��z
Comment.quotecCsd�dd�|D��S)Nrcss|]}t|�VqdSrrr rrrr#sz"Comment.content.<locals>.<genexpr>r$r&rrrrPszComment.contentcCs|jgSr)rPr&rrrr5szComment.commentsN)	r+rFrGrDr'rorJrPr5rrrrrns
rnc@s4eZdZdZedd��Zedd��Zedd��ZdS)	�AddressListzaddress-listcCsdd�|D�S)NcSsg|]}|jdkr|�qS)�address�rDr rrrrQ's
z)AddressList.addresses.<locals>.<listcomp>rr&rrr�	addresses%szAddressList.addressescCstdd�|D�g�S)Ncss|]}|jdkr|jVqdS�rrN�rD�	mailboxesr rrrr#+s
�z(AddressList.mailboxes.<locals>.<genexpr>�r.r&rrrrw)s
��zAddressList.mailboxescCstdd�|D�g�S)Ncss|]}|jdkr|jVqdSru�rD�
all_mailboxesr rrrr#0s
�z,AddressList.all_mailboxes.<locals>.<genexpr>rxr&rrrrz.s
��zAddressList.all_mailboxesN)r+rFrGrDrJrtrwrzrrrrrq!s

rqc@s4eZdZdZedd��Zedd��Zedd��ZdS)	�AddressrrcCs|djdkr|djSdS)Nr�group�rD�display_namer&rrrr~8szAddress.display_namecCs4|djdkr|dgS|djdkr*gS|djS�Nr�mailbox�invalid-mailboxrvr&rrrrw=s

zAddress.mailboxescCs:|djdkr|dgS|djdkr0|dgS|djSrryr&rrrrzEs


zAddress.all_mailboxesN)r+rFrGrDrJr~rwrzrrrrr{4s

r{c@s(eZdZdZedd��Zedd��ZdS)�MailboxList�mailbox-listcCsdd�|D�S)NcSsg|]}|jdkr|�qS)r�rsr rrrrQSs
z)MailboxList.mailboxes.<locals>.<listcomp>rr&rrrrwQszMailboxList.mailboxescCsdd�|D�S)NcSsg|]}|jdkr|�qS))r�r�rsr rrrrQWs
�z-MailboxList.all_mailboxes.<locals>.<listcomp>rr&rrrrzUszMailboxList.all_mailboxesN�r+rFrGrDrJrwrzrrrrr�Ms

r�c@s(eZdZdZedd��Zedd��ZdS)�	GroupList�
group-listcCs |r|djdkrgS|djS�Nrr�rvr&rrrrw_szGroupList.mailboxescCs |r|djdkrgS|djSr�ryr&rrrrzeszGroupList.all_mailboxesNr�rrrrr�[s

r�c@s4eZdZdZedd��Zedd��Zedd��ZdS)	�Groupr|cCs|djdkrgS|djS�N�r�rvr&rrrrwpszGroup.mailboxescCs|djdkrgS|djSr�ryr&rrrrzvszGroup.all_mailboxescCs
|djSr/)r~r&rrrr~|szGroup.display_nameN)r+rFrGrDrJrwrzr~rrrrr�ls

r�c@sLeZdZdZedd��Zedd��Zedd��Zedd	��Zed
d��Z	dS)
�NameAddr�	name-addrcCst|�dkrdS|djS�N�r)�lenr~r&rrrr~�szNameAddr.display_namecCs
|djS�N�����
local_partr&rrrr��szNameAddr.local_partcCs
|djSr���domainr&rrrr��szNameAddr.domaincCs
|djSr�)�router&rrrr��szNameAddr.routecCs
|djSr���	addr_specr&rrrr��szNameAddr.addr_specN�
r+rFrGrDrJr~r�r�r�r�rrrrr��s



r�c@s@eZdZdZedd��Zedd��Zedd��Zedd	��Zd
S)�	AngleAddrz
angle-addrcCs"|D]}|jdkr|jSqdS�N�	addr-spec)rDr�rgrrrr��s
zAngleAddr.local_partcCs"|D]}|jdkr|jSqdSr��rDr�rgrrrr��s
zAngleAddr.domaincCs"|D]}|jdkr|jSqdS)N�	obs-route)rD�domainsrgrrrr��s
zAngleAddr.routecCs<|D]2}|jdkr|jr"|jSt|j�|jSqdS)Nr�z<>)rDr�r�rrgrrrr��s

zAngleAddr.addr_specN)	r+rFrGrDrJr�r�r�r�rrrrr��s


r�c@seZdZdZedd��ZdS)�ObsRouter�cCsdd�|D�S)NcSsg|]}|jdkr|j�qSr�r�r rrrrQ�s
z$ObsRoute.domains.<locals>.<listcomp>rr&rrrr��szObsRoute.domainsN)r+rFrGrDrJr�rrrrr��sr�c@sLeZdZdZedd��Zedd��Zedd��Zedd	��Zed
d��Z	dS)
�Mailboxr�cCs|djdkr|djSdS�Nrr�r}r&rrrr~�szMailbox.display_namecCs
|djSr/r�r&rrrr��szMailbox.local_partcCs
|djSr/r�r&rrrr��szMailbox.domaincCs|djdkr|djSdSr�)rDr�r&rrrr��sz
Mailbox.routecCs
|djSr/r�r&rrrr��szMailbox.addr_specNr�rrrrr��s



r�c@s,eZdZdZedd��ZeZZZZ	dS)�InvalidMailboxr�cCsdSrrr&rrrr~�szInvalidMailbox.display_nameNr�rrrrr��s
r�cs(eZdZdZdZe�fdd��Z�ZS)�Domainr�Fcsd�t�j���S�Nr�r%rr�splitr&rrrr��sz
Domain.domain)r+rFrGrDr1rJr�rKrrrrr��sr�c@seZdZdZdS)�DotAtom�dot-atomNrTrrrrr��sr�c@seZdZdZdZdS)�DotAtomTextz
dot-atom-textTN�r+rFrGrDr1rrrrr��sr�c@seZdZdZdZdS)�
NoFoldLiteralzno-fold-literalFNr�rrrrr�sr�c@sDeZdZdZdZedd��Zedd��Zedd��Zed	d
��Z	dS)�AddrSpecr�FcCs
|djSr/r�r&rrrr�
szAddrSpec.local_partcCst|�dkrdS|djS)N�r�)r�r�r&rrrr�szAddrSpec.domaincCs<t|�dkr|djS|dj��|dj|dj��S)Nr�rr�r�)r�r�rstrip�lstripr&rrrrs
zAddrSpec.valuecCsLt|j�}t|�t|t�kr*t|j�}n|j}|jdk	rH|d|jS|S)N�@)�setr�r��
DOT_ATOM_ENDSrr�)rZnamesetZlprrrr�s

zAddrSpec.addr_specN)
r+rFrGrDr1rJr�r�rr�rrrrr�s


r�c@seZdZdZdZdS)�ObsLocalPartzobs-local-partFNr�rrrrr�&sr�cs4eZdZdZdZedd��Ze�fdd��Z�ZS)�DisplayNamezdisplay-nameFcCs�t|�}t|�dkr|jS|djdkr4|�d�n*|ddjdkr^t|ddd��|d<|djdkrv|��n*|ddjdkr�t|ddd��|d<|jS)NrrYr�r�)rr�rrD�pop)rrirrrr~1s
zDisplayName.display_namecs�d}|jrd}n|D]}|jdkrd}qt|�dkr�|r�d}}|djdks`|ddjdkrdd}|djdks�|ddjdkr�d}|t|j�|St�jSdS)	NFTrcrrrYrNr�)rrDr�rr~rr)rror"ZpreZpostrrrrBs
  zDisplayName.value)	r+rFrGrDrIrJr~rrKrrrrr�,s
r�c@s,eZdZdZdZedd��Zedd��ZdS)�	LocalPartz
local-partFcCs&|djdkr|djS|djSdS)Nrrc)rDrjrr&rrrr[s
zLocalPart.valuecCs�tg}t}d}|dtgD]�}|jdkr,q|r\|jdkr\|djdkr\t|dd��|d<t|t�}|r�|jdkr�|djdkr�|�t|dd���n
|�|�|d}|}qt|dd��}|jS)NFrrY�dotr�r�)�DOTrDr�
isinstancerhr)rriZlastZ
last_is_tl�tokZis_tlrrrr�bs(
�
�
zLocalPart.local_partN)r+rFrGrDr1rJrr�rrrrr�Vs
r�cs4eZdZdZdZe�fdd��Zedd��Z�ZS)�
DomainLiteralzdomain-literalFcsd�t�j���Sr�r�r&rrrr�szDomainLiteral.domaincCs"|D]}|jdkr|jSqdS)N�ptextrfrgrrr�ip�s
zDomainLiteral.ip)	r+rFrGrDr1rJr�r�rKrrrrr�zsr�c@seZdZdZdZdZdS)�MIMEVersionzmime-versionN)r+rFrGrD�major�minorrrrrr��sr�c@s4eZdZdZdZdZdZedd��Zedd��Z	dS)	�	Parameter�	parameterF�us-asciicCs|jr|djSdSr�)�	sectioned�numberr&rrr�section_number�szParameter.section_numbercCsf|D]\}|jdkr|jS|jdkr|D]4}|jdkr*|D] }|jdkr<|jSq<q*qdS)Nrrcrer)rDrlrkrrr�param_value�s




zParameter.param_valueN)
r+rFrGrDr��extendedr`rJr�r�rrrrr��s
r�c@seZdZdZdS)�InvalidParameter�invalid-parameterNrTrrrrr��sr�c@seZdZdZedd��ZdS)�	Attribute�	attributecCs$|D]}|j�d�r|jSqdS)N�attrtext)rD�endswithrrkrrrrl�szAttribute.stripped_valueN�r+rFrGrDrJrlrrrrr��sr�c@seZdZdZdZdS)�Section�sectionN)r+rFrGrDr�rrrrr��sr�c@seZdZdZedd��ZdS)�ValuercCs2|d}|jdkr|d}|j�d�r,|jS|jS)NrrYr�)rcr�zextended-attribute)rDr�rlrrkrrrrl�s
�zValue.stripped_valueNr�rrrrr��sr�c@s(eZdZdZdZedd��Zdd�ZdS)�MimeParameters�mime-parametersFc
cs�i}|D]T}|j�d�sq|djdkr*q|dj��}||krHg||<||�|j|f�q|��D�]~\}}t|td�d�}|dd}|j	}|j
s�t|�dkr�|dddkr�|ddj�t
�d��|dd�}g}d}|D]�\}	}
|	|k�r(|
j
�s|
j�t
�d��q�n|
j�t
�d��|d7}|
j}|
j
�r�ztj�|�}Wn&tk
�rttjj|d	d
�}YnRXz|�|d�}Wn"tk
�r�|�dd�}YnXt�|��r�|
j�t
���|�|�q�d
�|�}||fVqfdS)Nr�rr�)�keyr�z.duplicate parameter name; duplicate(s) ignoredz+duplicate parameter name; duplicate ignoredz(inconsistent RFC2231 parameter numberingzlatin-1)�encoding�surrogateescaper�r)rDr�r�striprhr��items�sortedrr`r�r�rr�InvalidHeaderDefectr��urllib�parseZunquote_to_bytes�UnicodeEncodeErrorZunquote�decode�LookupErrorr�_has_surrogates�UndecodableBytesDefectr%)r�paramsr6�name�partsZfirst_paramr`Zvalue_parts�ir��paramrrrrr��s`�

�
�
zMimeParameters.paramscCsTg}|jD].\}}|r.|�d�|t|���q
|�|�q
d�|�}|rPd|SdS)N�{}={}z; rNr)r�rhr*rr%)rr�r�rrrrr's
zMimeParameters.__str__N)r+rFrGrDrHrJr�r'rrrrr��s

Er�c@seZdZdZedd��ZdS)�ParameterizedHeaderValueFcCs&t|�D]}|jdkr|jSqiS)Nr�)�reversedrDr�rkrrrr�-s
zParameterizedHeaderValue.paramsN)r+rFrGrHrJr�rrrrr�'sr�c@seZdZdZdZdZdZdS)�ContentTypezcontent-typeF�textZplainN)r+rFrGrDr1�maintype�subtyperrrrr�5sr�c@seZdZdZdZdZdS)�ContentDispositionzcontent-dispositionFN)r+rFrGrDr1�content_dispositionrrrrr�<sr�c@seZdZdZdZdZdS)�ContentTransferEncodingzcontent-transfer-encodingFZ7bitN)r+rFrGrDr1r_rrrrr�Bsr�c@seZdZdZdZdS)�HeaderLabelzheader-labelFNr�rrrrr�Hsr�c@seZdZdZdZdd�ZdS)�MsgIDzmsg-idFcCst|�|jSr)r
�linesepr:rrrr;Qsz
MsgID.foldN)r+rFrGrDr1r;rrrrr�Msr�c@seZdZdZdS)�	MessageIDz
message-idNrTrrrrr�Vsr�c@seZdZdZdS)�InvalidMessageIDzinvalid-message-idNrTrrrrr�Zsr�c@seZdZdZdS)�Header�headerNrTrrrrr�^sr�csreZdZdZdZdZ�fdd�Z�fdd�Zdd�Ze	dd	��Z
d�fdd�	Zd
d�Ze	dd��Z
dd�Z�ZS)�TerminalTcst��||�}||_g|_|Sr)r�__new__rDr)�clsrrDrrrrr�lszTerminal.__new__csd�|jjt����Sr(r)r&rrrr,rszTerminal.__repr__cCst|jjd|j�dS)N�/)r>rr+rDr&rrrrAuszTerminal.pprintcCs
t|j�Sr)�listrr&rrrr-xszTerminal.all_defectsrc	s2d�||jj|jt���|js"dn
d�|j��gS)Nz
{}{}/{}({}){}rz {})r*rr+rDrr,rr@rrrrC|s�zTerminal._ppcCsdSrrr&rrr�pop_trailing_ws�szTerminal.pop_trailing_wscCsgSrrr&rrrr5�szTerminal.commentscCst|�|jfSr)r
rDr&rrr�__getnewargs__�szTerminal.__getnewargs__)r)r+rFrGr1rIrHr�r,rArJr-rCr�r5rrKrrrrr�fs
	
r�c@s eZdZedd��Zdd�ZdS)�WhiteSpaceTerminalcCsdSrMrr&rrrr�szWhiteSpaceTerminal.valuecCsdS)NTrr&rrrr0�sz!WhiteSpaceTerminal.startswith_fwsN�r+rFrGrJrr0rrrrr�s
rc@s eZdZedd��Zdd�ZdS)�
ValueTerminalcCs|Srrr&rrrr�szValueTerminal.valuecCsdS)NFrr&rrrr0�szValueTerminal.startswith_fwsNrrrrrr�s
rc@s eZdZedd��Zdd�ZdS)�EWWhiteSpaceTerminalcCsdSr�rr&rrrr�szEWWhiteSpaceTerminal.valuecCsdSr�rr&rrrr'�szEWWhiteSpaceTerminal.__str__N)r+rFrGrJrr'rrrrr�s
rc@seZdZdZdS)�_InvalidEwErrorz1Invalid encoded word found while parsing headers.N)r+rFrG�__doc__rrrrr�srr��,�list-separatorr�zroute-component-markerz([{}]+)rz[^{}]+z[\x00-\x20\x7F]cCs>t|�}|r|j�t�|��t�|�r:|j�t�d��dS)z@If input token contains ASCII non-printables, register a defect.z*Non-ASCII characters found in header tokenN)�_non_printable_finderrrhrZNonPrintableDefectrr�r�)�xtextZnon_printablesrrr�_validate_xtext�s

�rcCs�t|d�^}}g}d}d}tt|��D]L}||dkrJ|rDd}d}nd}q&|rTd}n|||krdq||�||�q&|d}d�|�d�||d�g|�|fS)akScan printables/quoted-pairs until endchars and return unquoted ptext.

    This function turns a run of qcontent, ccontent-without-comments, or
    dtext-with-quoted-printables into a single string by unquoting any
    quoted printables.  It returns the string, the remaining value, and
    a flag that is True iff there were any quoted printables decoded.

    r�FrTrN)�
_wsp_splitter�ranger�rhr%)r�endcharsZfragment�	remainderZvchars�escape�had_qp�posrrr�_get_ptext_to_endchars�s$	rcCs.|��}t|dt|�t|��d�}||fS)z�FWS = 1*WSP

    This isn't the RFC definition.  We're using fws to represent tokens where
    folding can be done, but when we are parsing the *un*folding has already
    been done so we don't need to watch out for CRLF.

    N�fws)r�rr�)rZnewvaluerrrr�get_fwssrc
	Cs�t�}|�d�s t�d�|���|dd��dd�^}}||dd�krXt�d�|���d�|�}t|�dkr�|dtkr�|dtkr�|�	d	�dkr�|�dd�^}}|d|}t|���dkr�|j
�t�d
��||_
d�|�}zt�d|d�\}}}}	Wn*ttfk
�r*td�|j
���YnX||_||_|j
�|	�|�r�|dtk�rrt|�\}
}|�|
��qDt|d�^}}t|d�}t|�|�|�d�|�}�qD|�r�|dtk�r�|j
�t�d
��||fS)zE encoded-word = "=?" charset "?" encoding "?" encoded-text "?="

    �=?z"expected encoded word but found {}r�Nz?=r�rr�?zwhitespace inside encoded wordz!encoded word format invalid: '{}'�vtextz.missing trailing whitespace after encoded-word)r]�
startswithr�HeaderParseErrorr*r�r%r�r�countrrhr�r_�_ewr��
ValueError�KeyErrorrr`rar4�WSPrrrr)
rZewr�rZremstr�restr�r`rarr6�charsrrrr�get_encoded_wordsd
��

�
��
�

�




�r"cCsFt�}|�rB|dtkr0t|�\}}|�|�qd}|�d�r�zt|�\}}Wn,tk
rfd}Yn�tjk
rzYnrXd}t	|�dkr�|dj
dkr�|j�t�d��d}|r�t	|�dkr�|d	j
d
kr�t
|dd�|d<|�|�qt|d�^}}|�rt�|��r|�d�^}}t|d�}t|�|�|�d�|�}q|S)
aOunstructured = (*([FWS] vchar) *WSP) / obs-unstruct
       obs-unstruct = *((*LF *CR *(obs-utext) *LF *CR)) / FWS)
       obs-utext = %d0 / obs-NO-WS-CTL / LF / CR

       obs-NO-WS-CTL is control characters except WSP/CR/LF.

    So, basically, we have printable runs, plus control characters or nulls in
    the obsolete syntax, separated by whitespace.  Since RFC 2047 uses the
    obsolete syntax in its specification, but requires whitespace on either
    side of the encoded words, I can see no reason to need to separate the
    non-printable-non-whitespace from the printable runs if they occur, so we
    parse this into xtext tokens separated by WSP tokens.

    Because an 'unstructured' value must by definition constitute the entire
    value, this 'get' routine does not return a remaining value, only the
    parsed TokenList.

    rTrFr�rz&missing whitespace before encoded wordr����r^rr)rRrrrhrr"rrrr�rDrr�rr�rfc2047_matcher�search�	partitionrrr%)rrSr6�valid_ewZhave_wsr�rrrrr�get_unstructured?sJ


��


r(cCs*t|d�\}}}t|d�}t|�||fS)actext = <printable ascii except \ ( )>

    This is not the RFC ctext, since we are handling nested comments in comment
    and unquoting quoted-pairs here.  We allow anything except the '()'
    characters, but if we find any ASCII other than the RFC defined printable
    ASCII, a NonPrintableDefect is added to the token's defects list.  Since
    quoted pairs are converted to their unquoted values, what is returned is
    a 'ptext' token.  In this case it is a WhiteSpaceTerminal, so it's value
    is ' '.

    z()r�)rrr�rr��_rrr�get_qp_ctext�s
r+cCs*t|d�\}}}t|d�}t|�||fS)aoqcontent = qtext / quoted-pair

    We allow anything except the DQUOTE character, but if we find any ASCII
    other than the RFC defined printable ASCII, a NonPrintableDefect is
    added to the token's defects list.  Any quoted pairs are converted to their
    unquoted values, so what is returned is a 'ptext' token.  In this case it
    is a ValueTerminal.

    r
r�)rrrr)rrr�get_qcontent�s

r,cCsNt|�}|st�d�|���|��}|t|�d�}t|d�}t|�||fS)z�atext = <matches _atext_matcher>

    We allow any non-ATOM_ENDS in atext, but add an InvalidATextDefect to
    the token's defects list if we find non-atext characters.
    zexpected atext but found '{}'N�atext)�_non_atom_end_matcherrrr*r|r�rr)r�mr-rrr�	get_atext�s�
r0cCsr|ddkrt�d�|���t�}|dd�}|rT|ddkrTt|�\}}|�|�|�rB|ddk�rB|dtkr�t|�\}}n�|dd�dk�r*d}z&t|�\}}|j	�t�
d	��d
}Wn"tjk
r�t|�\}}YnX|�r6t|�dk�r6|djdk�r6|d
jdk�r6t
|dd�|d<nt|�\}}|�|�qT|�sb|j	�t�
d��||fS||dd�fS)z�bare-quoted-string = DQUOTE *([FWS] qcontent) [FWS] DQUOTE

    A quoted-string without the leading or trailing white space.  Its
    value is the text between the quote marks, with whitespace
    preserved and quoted pairs decoded.
    rr
zexpected '"' but found '{}'r�Nr�rFz!encoded word inside quoted stringTr�rr#r^z"end of header inside quoted string)rrr*rmr,rhrrr"rr�r�rDr)rZbare_quoted_stringr6r'rrr�get_bare_quoted_string�sL�

���

�r1cCs�|r |ddkr t�d�|���t�}|dd�}|r�|ddkr�|dtkr\t|�\}}n&|ddkrvt|�\}}nt|�\}}|�|�q2|s�|j	�t�
d��||fS||dd�fS)z�comment = "(" *([FWS] ccontent) [FWS] ")"
       ccontent = ctext / quoted-pair / comment

    We handle nested comments here, and quoted-pair in our qp-ctext routine.
    rrzexpected '(' but found '{}'r�Nrpzend of header inside comment)rrr*rnrr�get_commentr+rhrr�)rrOr6rrrr2�s&�
�r2cCsPt�}|rH|dtkrH|dtkr0t|�\}}nt|�\}}|�|�q||fS)z,CFWS = (1*([FWS] comment) [FWS]) / FWS

    r)rX�CFWS_LEADERrrr2rh)rrYr6rrr�get_cfws�sr4cCspt�}|r,|dtkr,t|�\}}|�|�t|�\}}|�|�|rh|dtkrht|�\}}|�|�||fS)z�quoted-string = [CFWS] <bare-quoted-string> [CFWS]

    'bare-quoted-string' is an intermediate class defined by this
    parser and not by the RFC grammar.  It is the quoted string
    without any attached CFWS.
    r)rbr3r4rhr1)rZ
quoted_stringr6rrr�get_quoted_strings


r5cCs�t�}|r,|dtkr,t|�\}}|�|�|rL|dtkrLt�d�|���|�d�r�zt	|�\}}Wq�tjk
r�t
|�\}}Yq�Xnt
|�\}}|�|�|r�|dtkr�t|�\}}|�|�||fS)zPatom = [CFWS] 1*atext [CFWS]

    An atom could be an rfc2047 encoded word.
    rzexpected atom but found '{}'r)rZr3r4rh�	ATOM_ENDSrrr*rr"r0)rr[r6rrr�get_atoms&
�


r7cCs�t�}|r|dtkr&t�d�|���|rt|dtkrtt|�\}}|�|�|r&|ddkr&|�t�|dd�}q&|dtkr�t�d�d|���||fS)z( dot-text = 1*atext *("." 1*atext)

    rz8expected atom at a start of dot-atom-text but found '{}'rr�Nr�z4expected atom at end of dot-atom-text but found '{}')r�r6rrr*r0rhr�)rZ
dot_atom_textr6rrr�get_dot_atom_text0s �

�r8cCs�t�}|dtkr(t|�\}}|�|�|�d�rhzt|�\}}Wqttjk
rdt|�\}}YqtXnt|�\}}|�|�|r�|dtkr�t|�\}}|�|�||fS)z� dot-atom = [CFWS] dot-atom-text [CFWS]

    Any place we can have a dot atom, we could instead have an rfc2047 encoded
    word.
    rr)	r�r3r4rhrr"rrr8)rZdot_atomr6rrr�get_dot_atomCs



r9cCs�|dtkrt|�\}}nd}|s,t�d��|ddkrFt|�\}}n*|dtkrdt�d�|���nt|�\}}|dk	r�|g|dd�<||fS)a�word = atom / quoted-string

    Either atom or quoted-string may start with CFWS.  We have to peel off this
    CFWS first to determine which type of word to parse.  Afterward we splice
    the leading CFWS, if any, into the parsed sub-token.

    If neither an atom or a quoted-string is found before the next special, a
    HeaderParseError is raised.

    The token returned is either an Atom or a QuotedString, as appropriate.
    This means the 'word' level of the formal grammar is not represented in the
    parse tree; this is because having that extra layer when manipulating the
    parse tree is more confusing than it is helpful.

    rNz5Expected 'atom' or 'quoted-string' but found nothing.r
z1Expected 'atom' or 'quoted-string' but found '{}')r3r4rrr5�SPECIALSr*r7)r�leaderr6rrr�get_word\s"��r<cCs�t�}zt|�\}}|�|�Wn(tjk
rH|j�t�d��YnX|r�|dtkr�|ddkr�|�t�|j�t�	d��|dd�}qJzt|�\}}WnDtjk
r�|dt
kr�t|�\}}|j�t�	d��n�YnX|�|�qJ||fS)a� phrase = 1*word / obs-phrase
        obs-phrase = word *(word / "." / CFWS)

    This means a phrase can be a sequence of words, periods, and CFWS in any
    order as long as it starts with at least one word.  If anything other than
    words is detected, an ObsoleteHeaderDefect is added to the token's defect
    list.  We also accept a phrase that starts with CFWS followed by a dot;
    this is registered as an InvalidHeaderDefect, since it is not supported by
    even the obsolete grammar.

    zphrase does not start with wordrrzperiod in 'phrase'r�Nzcomment found without atom)rUr<rhrrrr��PHRASE_ENDSr��ObsoleteHeaderDefectr3r4)rrVr6rrr�
get_phrase~s4
�

�
�r?cCsvt�}d}|dtkr"t|�\}}|s6t�d�|���zt|�\}}Wn^tjk
r�zt|�\}}Wn6tjk
r�|ddkr�|dtkr��t	�}YnXYnX|dk	r�|g|dd�<|�
|�|�r4|ddks�|dtk�r4tt|�|�\}}|j
dk�r|j�
t�d��n|j�
t�d��||d<z|j�d�Wn(tk
�rl|j�
t�d	��YnX||fS)
z= local-part = dot-atom / quoted-string / obs-local-part

    Nrz"expected local-part but found '{}'r�invalid-obs-local-partz<local-part is not dot-atom, quoted-string, or obs-local-partz,local-part is not a dot-atom (contains CFWS)�asciiz)local-part contains non-ASCII characters))r�r3r4rrr*r9r<r=rrh�get_obs_local_partr
rDrr�r>r�encoder�ZNonASCIILocalPartDefect)rr�r;r6�obs_local_partrrr�get_local_part�sJ�
 
�
�
�rEcCs�t�}d}|�r(|ddks*|dtk�r(|ddkrj|rL|j�t�d��|�t�d}|dd�}q
nD|ddkr�|�t|dd	��|dd�}|j�t�d
��d}q
|r�|djdkr�|j�t�d
��zt	|�\}}d}Wn4tj
k
�r|dtk�r
�t|�\}}YnX|�|�q
|djdk�sX|djdk�rj|djdk�rj|j�t�d��|djdk�s�|djdk�r�|djdk�r�|j�t�d��|j�r�d|_||fS)z' obs-local-part = word *("." word)
    Frrrzinvalid repeated '.'Tr�N�misplaced-specialz/'\' character outside of quoted-string/ccontentr�r�zmissing '.' between wordsrYz!Invalid leading '.' in local partr#z"Invalid trailing '.' in local partr@)
r�r=rrhrr�r�rrDr<rr3r4)rrDZlast_non_ws_was_dotr6rrrrB�sj 
�
�
�
���
���
�rBcCs@t|d�\}}}t|d�}|r0|j�t�d��t|�||fS)a dtext = <printable ascii except \ [ ]> / obs-dtext
        obs-dtext = obs-NO-WS-CTL / quoted-pair

    We allow anything except the excluded characters, but if we find any
    ASCII other than the RFC defined printable ASCII, a NonPrintableDefect is
    added to the token's defects list.  Quoted pairs are converted to their
    unquoted values, so what is returned is a ptext token, in this case a
    ValueTerminal.  If there were quoted-printables, an ObsoleteHeaderDefect is
    added to the returned token's defect list.

    z[]r�z(quoted printable found in domain-literal)rrrrhrr>r)rr�rrrr�	get_dtext�s

�rGcCs,|rdS|�t�d��|�tdd��dS)NFz"end of input inside domain-literal�]�domain-literal-endT)rhrr�r)r�domain_literalrrr�_check_for_early_dl_ends�rKcCsjt�}|dtkr(t|�\}}|�|�|s6t�d��|ddkrRt�d�|���|dd�}t||�rp||fS|�tdd��|dt	kr�t
|�\}}|�|�t|�\}}|�|�t||�r�||fS|dt	kr�t
|�\}}|�|�t||�r�||fS|ddk�rt�d	�|���|�tdd
��|dd�}|�rb|dtk�rbt|�\}}|�|�||fS)zB domain-literal = [CFWS] "[" *([FWS] dtext) [FWS] "]" [CFWS]

    rzexpected domain-literal�[z6expected '[' at start of domain-literal but found '{}'r�Nzdomain-literal-startrHz4expected ']' at end of domain-literal but found '{}'rI)r�r3r4rhrrr*rKrrrrG)rrJr6rrr�get_domain_literalsH

�





�
rMcCsrt�}d}|dtkr"t|�\}}|s6t�d�|���|ddkrvt|�\}}|dk	rd|g|dd�<|�|�||fSzt|�\}}Wn"tjk
r�t	|�\}}YnX|r�|ddkr�t�d��|dk	r�|g|dd�<|�|�|�rj|ddk�rj|j
�t�d��|djd	k�r*|d|dd�<|�rj|ddk�rj|�t
�t	|d
d��\}}|�|��q*||fS)z] domain = dot-atom / domain-literal / obs-domain
        obs-domain = atom *("." atom))

    Nrzexpected domain but found '{}'rLr�zInvalid Domainrz(domain is not a dot-atom (contains CFWS)r�r�)r�r3r4rrr*rMrhr9r7rr>rDr�)rr�r;r6rrr�
get_domain=sD�



�
rNcCs|t�}t|�\}}|�|�|r,|ddkrF|j�t�d��||fS|�tdd��t|dd��\}}|�|�||fS)z( addr-spec = local-part "@" domain

    rr�z#addr-spec local part with no domain�address-at-symbolr�N)r�rErhrrr�rrN)rr�r6rrr�
get_addr_speccs

�
rPcCs�t�}|rj|ddks"|dtkrj|dtkrFt|�\}}|�|�q|ddkr|�t�|dd�}q|rz|ddkr�t�d�|���|�t�t	|dd��\}}|�|�|�r>|ddk�r>|�t�|dd�}|s�q>|dtk�rt|�\}}|�|�|ddkr�|�t�t	|dd��\}}|�|�q�|�sNt�d��|ddk�rlt�d	�|���|�t
dd
��||dd�fS)z� obs-route = obs-domain-list ":"
        obs-domain-list = *(CFWS / ",") "@" domain *("," [CFWS] ["@" domain])

        Returns an obs-route token with the appropriate sub-tokens (that is,
        there is no obs-domain-list in the parse tree).
    rrr�Nr�z(expected obs-route domain but found '{}'z%end of header while parsing obs-route�:z4expected ':' marking end of obs-route but found '{}'zend-of-obs-route-marker)r�r3r4rh�
ListSeparatorrrr*�RouteComponentMarkerrNr)rZ	obs_router6rrr�
get_obs_routessF
�





�rTcCs�t�}|dtkr(t|�\}}|�|�|r8|ddkrHt�d�|���|�tdd��|dd�}|ddkr�|�tdd��|j�t�	d	��|dd�}||fSzt
|�\}}Wnztjk
�r0z"t|�\}}|j�t�d
��Wn(tjk
�rt�d�|���YnX|�|�t
|�\}}YnX|�|�|�r^|ddk�r^|dd�}n|j�t�	d��|�tdd��|�r�|dtk�r�t|�\}}|�|�||fS)
z� angle-addr = [CFWS] "<" addr-spec ">" [CFWS] / obs-angle-addr
        obs-angle-addr = [CFWS] "<" obs-route addr-spec ">" [CFWS]

    r�<z"expected angle-addr but found '{}'zangle-addr-startr�N�>zangle-addr-endznull addr-spec in angle-addrz*obsolete route specification in angle-addrz.expected addr-spec or obs-route but found '{}'z"missing trailing '>' on angle-addr)
r�r3r4rhrrr*rrr�rPrTr>)rZ
angle_addrr6rrr�get_angle_addr�sT
�
�
�
�



�
rWcCs<t�}t|�\}}|�|dd��|jdd�|_||fS)z� display-name = phrase

    Because this is simply a name-rule, we don't return a display-name
    token containing a phrase, but rather a display-name token with
    the content of the phrase.

    N)r�r?r4r)rr~r6rrr�get_display_name�s
rXcCs�t�}d}|dtkr6t|�\}}|s6t�d�|���|ddkr�|dtkr^t�d�|���t|�\}}|s~t�d�|���|dk	r�|g|ddd�<d}|�|�t	|�\}}|dk	r�|g|dd�<|�|�||fS)z, name-addr = [display-name] angle-addr

    Nrz!expected name-addr but found '{}'rU)
r�r3r4rrr*r=rXrhrW)rZ	name_addrr;r6rrr�
get_name_addr�s6���

rYcCs�t�}zt|�\}}WnNtjk
rdzt|�\}}Wn&tjk
r^t�d�|���YnXYnXtdd�|jD��r�d|_|�	|�||fS)z& mailbox = name-addr / addr-spec

    zexpected mailbox but found '{}'css|]}t|tj�VqdSr)r�rr�r rrrr#s�zget_mailbox.<locals>.<genexpr>r�)
r�rYrrrPr*�anyr-rDrh)rr�r6rrr�get_mailbox�s ��
r[cCsdt�}|r\|d|kr\|dtkrD|�t|dd��|dd�}qt|�\}}|�|�q||fS)z� Read everything up to one of the chars in endchars.

    This is outside the formal grammar.  The InvalidMailbox TokenList that is
    returned acts like a Mailbox, but the data attributes are None.

    rrFr�N)r�r=rhrr?)rrZinvalid_mailboxr6rrr�get_invalid_mailboxs�r\cCs�t�}|�r�|ddk�r�zt|�\}}|�|�W�ntjk
�r<d}|dtkr�t|�\}}|rv|ddkr�|�|�|j�t�d��n@t	|d�\}}|dk	r�|g|dd�<|�|�|j�t�
d��nb|ddkr�|j�t�d��nBt	|d�\}}|dk	�r|g|dd�<|�|�|j�t�
d��YnX|�r�|ddk�r�|d}d	|_t	|d�\}}|�|�|j�t�
d��|r|ddkr|�t
�|d
d�}q||fS)aJ mailbox-list = (mailbox *("," mailbox)) / obs-mbox-list
        obs-mbox-list = *([CFWS] ",") mailbox *("," [mailbox / CFWS])

    For this routine we go outside the formal grammar in order to improve error
    handling.  We recognize the end of the mailbox list only at the end of the
    value or at a ';' (the group terminator).  This is so that we can turn
    invalid mailboxes into InvalidMailbox tokens and continue parsing any
    remaining valid mailboxes.  We also allow all mailbox entries to be null,
    and this condition is handled appropriately at a higher level.

    r�;Nz,;zempty element in mailbox-listzinvalid mailbox in mailbox-listrr�r�r�)r�r[rhrrr3r4rr>r\r�rDr4rR)rZmailbox_listr6r;r�rrr�get_mailbox_listsX

�

�
�


�

�
r^cCst�}|s$|j�t�d��||fSd}|r�|dtkr�t|�\}}|sl|j�t�d��|�|�||fS|ddkr�|�|�||fSt|�\}}t|j	�dkr�|dk	r�|�|�|�
|�|j�t�d��||fS|dk	r�|g|dd�<|�|�||fS)zg group-list = mailbox-list / CFWS / obs-group-list
        obs-group-list = 1*([CFWS] ",") [CFWS]

    zend of header before group-listNrzend of header in group-listr]zgroup-list with empty entries)r�rrhrr�r3r4r^r�rzr4r>)rZ
group_listr;r6rrr�get_group_listWs>
�
�




�
r_cCs t�}t|�\}}|r"|ddkr2t�d�|���|�|�|�tdd��|dd�}|r�|ddkr�|�tdd��||dd�fSt|�\}}|�|�|s�|j�t�	d	��n|ddkr�t�d
�|���|�tdd��|dd�}|�r|dt
k�rt|�\}}|�|�||fS)z7 group = display-name ":" [group-list] ";" [CFWS]

    rrQz8expected ':' at end of group display name but found '{}'zgroup-display-name-terminatorr�Nr]zgroup-terminatorzend of header in groupz)expected ';' at end of group but found {})r�rXrrr*rhrr_rr�r3r4)rr|r6rrr�	get_group|s8�


��
r`cCsxt�}zt|�\}}WnNtjk
rdzt|�\}}Wn&tjk
r^t�d�|���YnXYnX|�|�||fS)a� address = mailbox / group

    Note that counter-intuitively, an address can be either a single address or
    a list of addresses (a group).  This is why the returned Address object has
    a 'mailboxes' attribute which treats a single address as a list of length
    one.  When you need to differentiate between to two cases, extract the single
    element, which is either a mailbox or a group token.

    zexpected address but found '{}')r{r`rrr[r*rh)rrrr6rrr�get_address�s�
rac
Cs�t�}|�r�zt|�\}}|�|�W�n tjk
�rH}z�d}|dtkr�t|�\}}|rj|ddkr�|�|�|j�t�d��nFt	|d�\}}|dk	r�|g|dd�<|�t
|g��|j�t�d��nh|ddkr�|j�t�d��nHt	|d�\}}|dk	�r|g|dd�<|�t
|g��|j�t�d��W5d}~XYnX|�r�|ddk�r�|dd}d|_t	|d�\}}|�
|�|j�t�d��|r|�tdd	��|d
d�}q||fS)a� address_list = (address *("," address)) / obs-addr-list
        obs-addr-list = *([CFWS] ",") address *("," [address / CFWS])

    We depart from the formal grammar here by continuing to parse until the end
    of the input, assuming the input to be entirely composed of an
    address-list.  This is always true in email parsing, and allows us
    to skip invalid addresses to parse additional valid ones.

    Nrrz"address-list entry with no contentzinvalid address in address-listzempty element in address-listr�r�rr�)rqrarhrrr3r4rr>r\r{r�rDr4r)rZaddress_listr6�errr;r�rrr�get_address_list�sX


�
�
�

�

�rccCs�t�}|st�d�|���|ddkr6t�d�|���|�tdd��|dd�}t|�\}}|�|�|rx|ddkr�t�d	�|���|�tdd
��||dd�fS)z& no-fold-literal = "[" *dtext "]"
    z'expected no-fold-literal but found '{}'rrLz;expected '[' at the start of no-fold-literal but found '{}'zno-fold-literal-startr�NrHz9expected ']' at the end of no-fold-literal but found '{}'zno-fold-literal-end)r�rrr*rhrrG)rZno_fold_literalr6rrr�get_no_fold_literal�s.���
��rdcCs�t�}|r,|dtkr,t|�\}}|�|�|r<|ddkrLt�d�|���|�tdd��|dd�}zt|�\}}Wn`tjk
r�z"t	|�\}}|j
�t�d��Wn&tjk
r�t�d�|���YnXYnX|�|�|r�|dd	k�r@|j
�t�d
��|�r8|ddk�r8|�tdd��|dd�}||fS|�td	d
��|dd�}zt|�\}}Wn�tjk
�rzt
|�\}}Wnrtjk
�r}zPz"t|�\}}|j
�t�d��Wn(tjk
�r�t�d�|���YnXW5d}~XYnXYnX|�|�|�r6|ddk�r6|dd�}n|j
�t�d��|�tdd��|�r�|dtk�r�t|�\}}|�|�||fS)z�msg-id = [CFWS] "<" id-left '@' id-right  ">" [CFWS]
       id-left = dot-atom-text / obs-id-left
       id-right = dot-atom-text / no-fold-literal / obs-id-right
       no-fold-literal = "[" *dtext "]"
    rrUzexpected msg-id but found '{}'zmsg-id-startr�Nzobsolete id-left in msg-idz4expected dot-atom-text or obs-id-left but found '{}'r�zmsg-id with no id-rightrVz
msg-id-endrOzobsolete id-right in msg-idzFexpected dot-atom-text, no-fold-literal or obs-id-right but found '{}'zmissing trailing '>' on msg-id)r�r3r4rhrrr*rr8rBrr>r�rdrN)rZmsg_idr6�errr�
get_msg_ids~
�
�
��

�
�
��"

�
rfc
Cs�t�}zt|�\}}|�|�WnLtjk
rl}z,t|�}t|�}|j�t�d�	|���W5d}~XYnX|r�|j�t�d�	|���|S)z2message-id      =   "Message-ID:" msg-id CRLF
    zInvalid msg-id: {!r}NzUnexpected {!r})
r�rfrhrrr(r�rr�r*)rZ
message_idr6Zexrrr�parse_message_idIs�
�rgcCs�t�}|s |j�t�d��|S|dtkrXt|�\}}|�|�|sX|j�t�d��d}|r�|ddkr�|dtkr�||d7}|dd�}q\|��s�|j�t�d�	|���|�t
|d	��nt|�|_|�t
|d
��|�r|dtk�rt|�\}}|�|�|�r|ddk�rT|jdk	�r:|j�t�d��|�rP|�t
|d	��|S|�t
dd��|dd�}|�r�|dtk�r�t|�\}}|�|�|�s�|jdk	�r�|j�t�d��|Sd}|�r�|dtk�r�||d7}|dd�}�q�|���s*|j�t�d
�	|���|�t
|d	��nt|�|_
|�t
|d
��|�rn|dtk�rnt|�\}}|�|�|�r�|j�t�d��|�t
|d	��|S)zE mime-version = [CFWS] 1*digit [CFWS] "." [CFWS] 1*digit [CFWS]

    z%Missing MIME version number (eg: 1.0)rz0Expected MIME version number but found only CFWSrrr�Nz1Expected MIME major version number but found {!r}r
�digitsz0Incomplete MIME version; found only major numberzversion-separatorz1Expected MIME minor version number but found {!r}z'Excess non-CFWS text after MIME version)r�rrhr�HeaderMissingRequiredValuer3r4�isdigitr�r*r�intr�r�)rZmime_versionr6rhrrr�parse_mime_versiones�
�

�
�


�

�

�


�rlcCsdt�}|r\|ddkr\|dtkrD|�t|dd��|dd�}qt|�\}}|�|�q||fS)z� Read everything up to the next ';'.

    This is outside the formal grammar.  The InvalidParameter TokenList that is
    returned acts like a Parameter, but the data attributes are None.

    rr]rFr�N)r�r=rhrr?)rZinvalid_parameterr6rrr�get_invalid_parameter�s�rmcCsNt|�}|st�d�|���|��}|t|�d�}t|d�}t|�||fS)a8ttext = <matches _ttext_matcher>

    We allow any non-TOKEN_ENDS in ttext, but add defects to the token's
    defects list if we find non-ttext characters.  We also register defects for
    *any* non-printables even though the RFC doesn't exclude all of them,
    because we follow the spirit of RFC 5322.

    zexpected ttext but found '{}'N�ttext)�_non_token_end_matcherrrr*r|r�rr)rr/rnrrr�	get_ttext�s	�
rpcCs�t�}|r,|dtkr,t|�\}}|�|�|rL|dtkrLt�d�|���t|�\}}|�|�|r�|dtkr�t|�\}}|�|�||fS)z�token = [CFWS] 1*ttext [CFWS]

    The RFC equivalent of ttext is any US-ASCII chars except space, ctls, or
    tspecials.  We also exclude tabs even though the RFC doesn't.

    The RFC implies the CFWS but is not explicit about it in the BNF.

    r�expected token but found '{}')	r\r3r4rh�
TOKEN_ENDSrrr*rp)rZmtokenr6rrr�	get_token�s	
�

rscCsNt|�}|st�d�|���|��}|t|�d�}t|d�}t|�||fS)aQattrtext = 1*(any non-ATTRIBUTE_ENDS character)

    We allow any non-ATTRIBUTE_ENDS in attrtext, but add defects to the
    token's defects list if we find non-attrtext characters.  We also register
    defects for *any* non-printables even though the RFC doesn't exclude all of
    them, because we follow the spirit of RFC 5322.

    z expected attrtext but found {!r}Nr�)�_non_attribute_end_matcherrrr*r|r�rr�rr/r�rrr�get_attrtext�s	�
rvcCs�t�}|r,|dtkr,t|�\}}|�|�|rL|dtkrLt�d�|���t|�\}}|�|�|r�|dtkr�t|�\}}|�|�||fS)aH [CFWS] 1*attrtext [CFWS]

    This version of the BNF makes the CFWS explicit, and as usual we use a
    value terminal for the actual run of characters.  The RFC equivalent of
    attrtext is the token characters, with the subtraction of '*', "'", and '%'.
    We include tab in the excluded set just as we do for token.

    rrq)	r�r3r4rh�ATTRIBUTE_ENDSrrr*rv�rr�r6rrr�
get_attribute�s	
�

rycCsNt|�}|st�d�|���|��}|t|�d�}t|d�}t|�||fS)z�attrtext = 1*(any non-ATTRIBUTE_ENDS character plus '%')

    This is a special parsing routine so that we get a value that
    includes % escapes as a single string (which we decode as a single
    string later).

    z)expected extended attrtext but found {!r}N�extended-attrtext)�#_non_extended_attribute_end_matcherrrr*r|r�rrrurrr�get_extended_attrtext	s�
r|cCs�t�}|r,|dtkr,t|�\}}|�|�|rL|dtkrLt�d�|���t|�\}}|�|�|r�|dtkr�t|�\}}|�|�||fS)z� [CFWS] 1*extended_attrtext [CFWS]

    This is like the non-extended version except we allow % characters, so that
    we can pick up an encoded value as a single string.

    rrq)	r�r3r4rh�EXTENDED_ATTRIBUTE_ENDSrrr*r|rxrrr�get_extended_attribute!	s
�

r~cCs�t�}|r|ddkr&t�d�|���|�tdd��|dd�}|rR|d��sbt�d�|���d}|r�|d��r�||d7}|dd�}qf|dd	kr�|d	kr�|j�t�d
��t	|�|_
|�t|d��||fS)a6 '*' digits

    The formal BNF is more complicated because leading 0s are not allowed.  We
    check for that and add a defect.  We also assume no CFWS is allowed between
    the '*' and the digits, though the RFC is not crystal clear on that.
    The caller should already have dealt with leading CFWS.

    r�*zExpected section but found {}zsection-markerr�Nz$Expected section number but found {}r�0z'section number has an invalid leading 0rh)r�rrr*rhrrjrZInvalidHeaderErrorrkr�)rr�rhrrr�get_section7	s,	��
�
r�cCs�t�}|st�d��d}|dtkr0t|�\}}|sDt�d�|���|ddkr^t|�\}}nt|�\}}|dk	r�|g|dd�<|�|�||fS)z  quoted-string / attribute

    z&Expected value but found end of stringNrz Expected value but found only {}r
)	r�rrr3r4r*r5r~rh)r�vr;r6rrr�	get_valueU	s"
�
r�cCs�t�}t|�\}}|�|�|r,|ddkrL|j�t�d�|���||fS|ddkr�z t|�\}}d|_|�|�Wntj	k
r�YnX|s�t�	d��|ddkr�|�t
dd��|dd	�}d|_|dd
kr�t�	d��|�t
d
d��|dd	�}d	}|�r,|dtk�r,t
|�\}}|�|�d	}|}|j�rF|�rF|dd
k�rFt|�\}}|j}d}|jdk�r�|�r�|ddk�r�d}n$t|�\}}	|	�r�|	ddk�r�d}n(zt|�\}}	WnYnX|	�s�d}|�r0|j�t�d��|�|�|D](}
|
jdk�rg|
d	d	�<|
}�q*�q|}nd	}|j�t�d��|�r`|ddk�r`d	}nt|�\}}|j�r�|jdk�r�|�r�|ddk�r�|�|�|d	k	�r�|�r�t|��|}||fS|j�t�d��|�s
|j�t�d��|�|�|d	k�r�||fSn�|d	k	�rN|D]}
|
jdk�r�q2�q|
jdk|�|
�|
j|_|ddk�rlt�	d�|���|�t
dd��|dd	�}|�r�|ddk�r�t|�\}}|�|�|j|_|�r�|ddk�r�t�	d�|���|�t
dd��|dd	�}|d	k	�rrt�}|�rl|dtk�r,t|�\}}n2|dd
k�rRt
d
d�}|dd	�}nt|�\}}|�|��q
|}nt|�\}}|�|�|d	k	�r�|�r�t|��|}||fS)aY attribute [section] ["*"] [CFWS] "=" value

    The CFWS is implied by the RFC but not made explicit in the BNF.  This
    simplified form of the BNF from the RFC is made to conform with the RFC BNF
    through some extra checks.  We do it this way because it makes both error
    recovery and working with the resulting parse tree easier.
    rr]z)Parameter contains name ({}) but no valuerTzIncomplete parameterzextended-parameter-markerr�N�=zParameter not followed by '='�parameter-separatorr
F�'z5Quoted string value for extended parameter is invalidrezZParameter marked as extended but appears to have a quoted string value that is non-encodedzcApparent initial-extended-value but attribute was not marked as extended or was not initial sectionz(Missing required charset/lang delimitersrzr�z=Expected RFC2231 char/lang encoding delimiter, but found {!r}zRFC2231-delimiterz;Expected RFC2231 char/lang encoding delimiter, but found {}ZDQUOTE)r�ryrhrrr�r*r�r�rrr�r3r4r5rlr�rvr|rDr��AssertionErrorrr`rar�rrr,)rr�r6r;rZappendtoZqstringZinner_valueZ
semi_validr �tr�rrr�
get_parameterk	s�
�



�


�


�
�






�
�



r�c
Csjt�}|�rfzt|�\}}|�|�Wn�tjk
r�}z�d}|dtkrVt|�\}}|sp|�|�|WY�xS|ddkr�|dk	r�|�|�|j�t�d��n@t	|�\}}|r�|g|dd�<|�|�|j�t�d�
|���W5d}~XYnX|�rD|ddk�rD|d}d|_t	|�\}}|�|�|j�t�d�
|���|r|�t
dd	��|d
d�}q|S)a! parameter *( ";" parameter )

    That BNF is meant to indicate this routine should only be called after
    finding and handling the leading ';'.  There is no corresponding rule in
    the formal RFC grammar, but it is more convenient for us for the set of
    parameters to be treated as its own TokenList.

    This is 'parse' routine because it consumes the remaining value, but it
    would never be called to parse a full header.  Instead it is called to
    parse everything after the non-parameter value of a specific MIME header.

    Nrr]zparameter entry with no contentzinvalid parameter {!r}r�r�z)parameter with invalid trailing text {!r}r�r�)r�r�rhrrr3r4rr�rmr*rDr4r)rZmime_parametersr6rbr;r�rrr�parse_mime_parameters�	sJ



�

�

�r�cCs�|rV|ddkrV|dtkr>|�t|dd��|dd�}qt|�\}}|�|�q|s^dS|�tdd��|�t|dd���dS)zBDo our best to find the parameters in an invalid MIME header

    rr]rFr�Nr�)r=rhrr?r�)Z	tokenlistrr6rrr�_find_mime_parameters-
sr�c
Cs�t�}d}|s$|j�t�d��|Szt|�\}}Wn<tjk
rp|j�t�d�|���t	||�|YSX|�|�|r�|ddkr�|j�t�d��|r�t	||�|S|j
����|_
|�tdd��|dd	�}zt|�\}}Wn>tjk
�r*|j�t�d
�|���t	||�|YSX|�|�|j
����|_|�sP|S|ddk�r�|j�t�d�|���|`
|`t	||�|S|�tdd
��|�t|dd	���|S)z� maintype "/" subtype *( ";" parameter )

    The maintype and substype are tokens.  Theoretically they could
    be checked against the official IANA list + x-token, but we
    don't do that.
    Fz"Missing content type specificationz(Expected content maintype but found {!r}rr�zInvalid content typezcontent-type-separatorr�Nz'Expected content subtype but found {!r}r]z<Only parameters are valid after content type, but found {!r}r�)r�rrhrrirsrr�r*r�rr��lowerr�rr�r�)rZctypeZrecoverr6rrr�parse_content_type_header=
sd
�
�



�

�



��
r�c
Cs�t�}|s |j�t�d��|Szt|�\}}Wn<tjk
rl|j�t�d�|���t	||�|YSX|�|�|j
����|_
|s�|S|ddkr�|j�t�d�|���t	||�|S|�tdd��|�t|dd���|S)	z* disposition-type *( ";" parameter )

    zMissing content dispositionz+Expected content disposition but found {!r}rr]zCOnly parameters are valid after content disposition, but found {!r}r�r�N)r�rrhrrirsrr�r*r�rr�r�r�rr�)rZdisp_headerr6rrr� parse_content_disposition_headerv
s:
�
�



��
r�c
Cs�t�}|s |j�t�d��|Szt|�\}}Wn.tjk
r^|j�t�d�|���YnX|�|�|j	�
���|_|s�|S|r�|j�t�d��|dt
kr�|�t|dd��|dd�}q�t|�\}}|�|�q�|S)z mechanism

    z!Missing content transfer encodingz1Expected content transfer encoding but found {!r}z*Extra text after content transfer encodingrrFr�N)r�rrhrrirsrr�r*rr�r�r_r=rr?)rZ
cte_headerr6rrr�&parse_content_transfer_encoding_header�
s4
�
�

�r�cCsDd}|r@|dr@|ddtkr@|dd}|ddd�|d<|S)Nrr�)r)�linesZwsprrr�_steal_trailing_WSP_if_exists�
s
r�cCs�|jp
tj}|jrdnd}dg}d}d}d}tdd�}t|�}	|	�r�|	�d�}
|
|kr`|d8}q>t|
�}|
jd	kr�t	|�t
@r�d
}z|�|�|}Wn6tk
r�t
dd�|
jD��r�d
}nd}d
}YnX|
jdkr�t|
|||�q>|�r�|�s�|
j�spd}d}|
j�rp|
j|d�dt|j��}
|j|
k�rpt|
�|t|d�k�r^t|�}|�|�|d|
7<q>t|
d��s�t|
�|	}	nt|||||
j|�}d}q>t|�|t|d�k�r�|d|7<q>|
j�rt|�d|k�rt|�}|�s|
���r|�||�d}q>t|
d��sNt|
�}|
j�sD|d7}|�|�||	}	q>|
j�rn|�sn|	�d|
�d
}q>t|�}|�s�|
���r�|�||�q>|d|7<q>|j�|�|jS)zLReturn string of contents of parse_tree folded according to RFC rules.

    �utf-8r�rNrF�wrap_as_ew_blockedr�r�Tcss|]}t|tj�VqdSr)r�rr�r rrrr#�
s�z%_refold_parse_tree.<locals>.<genexpr>�unknown-8bitr�r7r�rC)Zmax_line_length�sys�maxsize�utf8r�r�r�r
rDr�r:rCr�rZr-�_fold_mime_parametersr1rHr;r�r�r�rhrE�_fold_as_ewrIr0�insertr%)Z
parse_treer8�maxlenr�r��last_ewr�Z
want_encodingZend_ew_not_allowedr�r2�tstrr`Zencoded_part�newlineZnewpartsrrrr9�
s�


�



��
r9cCs�|dk	r<|r<tt|d|d�|��}|dd|�|d<|dtkr�|d}|dd�}t|d�|krz|�t|��|d|7<d}|dtkr�|d}|dd�}|dkr�t|d�n|}|dkr�dn|}	t|	�d}
|
d|kr�t�d	��|�r�|t|d�}||
}|dk�r,|�d
�q�|d|�}
tj	|
|	d�}t|�|}|dk�r�|
dd�}
tj	|
|	d�}t|�|}�qR|d|7<|t|
�d�}|r�|�d
�t|d�}q�|d|7<|�r�|SdS)a�Fold string to_encode into lines as encoded word, combining if allowed.
    Return the new value for last_ew, or None if ew_combine_allowed is False.

    If there is already an encoded word in the last line of lines (indicated by
    a non-None value for last_ew) and ew_combine_allowed is true, decode the
    existing ew, combine it with to_encode, and re-encode.  Otherwise, encode
    to_encode.  In either case, split to_encode as necessary so that the
    encoded segments fit within maxlen.

    Nr�rr�rr�r��z3max_line_length is too small to fit an encoded wordrN)r`)
r
r(rr�rhr�rrrrC)Z	to_encoder�r�r�rIr`Zleading_wspZtrailing_wspZnew_last_ewZ	encode_as�
chrome_lenZremaining_spaceZ
text_spaceZto_encode_wordZencoded_wordZexcessrrrr�1sT��



r�c	Cs�|jD�]�\}}|d���d�s2|dd7<|}d}z|�|�d}Wn0tk
r|d}t�|�rtd}d}nd}YnX|r�tjj	|d	|d
�}	d�
|||	�}
nd�
|t|��}
t|d�t|
�d
|kr�|dd|
|d<qn"t|
�d|k�r
|�
d|
�qd}|d}|rt|�tt|��dt|�}
||
dk�rLd}||
d}}|d|�}tjj	|d	|d
�}	t|	�|k�r��q�|d
8}�q\|�
d�
||||	��d	}|d
7}||d�}|�r|dd7<�qqdS)a>Fold TokenList 'part' into the 'lines' list as mime parameters.

    Using the decoded list of parameters and values, format them according to
    the RFC rules, including using RFC2231 encoding if the value cannot be
    expressed in 'encoding' and/or the parameter+value is too long to fit
    within 'maxlen'.

    r�r]�strictFTr�r�r�r)Zsaferz
{}*={}''{}r�r�rNr�rz''r��NNz {}*{}*={}{})r�r�r�rCr�rr�r�r�ror*rr�rhr
)r2r�r�r�r�rr`Z
error_handlerZencoding_requiredZ
encoded_valuer�r�Zextra_chromer�Z
splitpointZmaxchars�partialrrrr�rsn


� ��r�)�r�rer�r��stringr�operatorrZemailrrrrr�rr3r:r6r�r=Z	TSPECIALSrrZ	ASPECIALSrwr}r�compile�VERBOSE�	MULTILINEr$r�rrLrRrUrWrXrZr\r]rbrmrnrqr{r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r
r�rrrrrr�rRrSr*r%r�rr�matchr.�findallr	rortr{rrrr"r(r+r,r0r1r2r4r5r7r8r9r<r?rErBrGrKrMrNrPrTrWrXrYr[r\r^r_r`rarcrdrfrgrlrmrprsrvryr|r~r�r�r�r�r�r�r�r�r�r9r�r�rrrr�<module>s.E
�C"	
!*$
V	+





����
1C+
"&'/'&).9%7ED49/gAemail/__pycache__/errors.cpython-38.opt-1.pyc000064400000013423151153537650014764 0ustar00U

e5d?�@s�dZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGd	d
�d
ee�ZGdd�de�ZGd
d�de	�Z
Gdd�de
�ZGdd�de
�ZGdd�de
�Z
Gdd�de
�ZGdd�de
�ZGdd�de
�ZeZGdd�de
�ZGdd�de
�ZGdd �d e
�ZGd!d"�d"e
�ZGd#d$�d$e
�ZGd%d&�d&e
�ZGd'd(�d(e
�ZGd)d*�d*e�ZGd+d,�d,e�ZGd-d.�d.e�ZGd/d0�d0e�ZGd1d2�d2e�Zd3S)4z email package exception classes.c@seZdZdZdS)�MessageErrorz+Base class for errors in the email package.N��__name__�
__module__�__qualname__�__doc__�rr�$/usr/lib64/python3.8/email/errors.pyrsrc@seZdZdZdS)�MessageParseErrorz&Base class for message parsing errors.Nrrrrrr	sr	c@seZdZdZdS)�HeaderParseErrorzError while parsing headers.Nrrrrrr
sr
c@seZdZdZdS)�
BoundaryErrorz#Couldn't find terminating boundary.Nrrrrrrsrc@seZdZdZdS)�MultipartConversionErrorz(Conversion to a multipart is prohibited.Nrrrrrrsrc@seZdZdZdS)�CharsetErrorzAn illegal charset was given.Nrrrrrr
sr
cs"eZdZdZd�fdd�	Z�ZS)�
MessageDefectz Base class for a message defect.Ncs|dk	rt��|�||_dS�N)�super�__init__�line)�selfr��	__class__rrr$szMessageDefect.__init__)N�rrrrr�
__classcell__rrrrr!src@seZdZdZdS)�NoBoundaryInMultipartDefectzBA message claimed to be a multipart but had no boundary parameter.Nrrrrrr)src@seZdZdZdS)�StartBoundaryNotFoundDefectz+The claimed start boundary was never found.Nrrrrrr,src@seZdZdZdS)�CloseBoundaryNotFoundDefectzEA start boundary was found, but not the corresponding close boundary.Nrrrrrr/src@seZdZdZdS)�#FirstHeaderLineIsContinuationDefectz;A message had a continuation line as its first header line.Nrrrrrr2src@seZdZdZdS)�MisplacedEnvelopeHeaderDefectz?A 'Unix-from' header was found in the middle of a header block.Nrrrrrr5src@seZdZdZdS)� MissingHeaderBodySeparatorDefectzEFound line with no leading whitespace and no colon before blank line.Nrrrrrr8src@seZdZdZdS)�!MultipartInvariantViolationDefectz?A message claimed to be a multipart but no subparts were found.Nrrrrrr=src@seZdZdZdS)�-InvalidMultipartContentTransferEncodingDefectzEAn invalid content transfer encoding was set on the multipart itself.Nrrrrrr@src@seZdZdZdS)�UndecodableBytesDefectz0Header contained bytes that could not be decodedNrrrrrr Csr c@seZdZdZdS)�InvalidBase64PaddingDefectz/base64 encoded sequence had an incorrect lengthNrrrrrr!Fsr!c@seZdZdZdS)�InvalidBase64CharactersDefectz=base64 encoded sequence had characters not in base64 alphabetNrrrrrr"Isr"c@seZdZdZdS)�InvalidBase64LengthDefectz4base64 encoded sequence had invalid length (1 mod 4)Nrrrrrr#Lsr#cs eZdZdZ�fdd�Z�ZS)�HeaderDefectzBase class for a header defect.cst�j||�dSr)rr)r�args�kwrrrrTszHeaderDefect.__init__rrrrrr$Qsr$c@seZdZdZdS)�InvalidHeaderDefectz+Header is not valid, message gives details.Nrrrrrr'Wsr'c@seZdZdZdS)�HeaderMissingRequiredValuez(A header that must have a value had noneNrrrrrr(Zsr(cs(eZdZdZ�fdd�Zdd�Z�ZS)�NonPrintableDefectz8ASCII characters outside the ascii-printable range foundcst��|�||_dSr)rr�non_printables)rr*rrrr`szNonPrintableDefect.__init__cCsd�|j�S)Nz6the following ASCII non-printables found in header: {})�formatr*)rrrr�__str__ds�zNonPrintableDefect.__str__)rrrrrr,rrrrrr)]sr)c@seZdZdZdS)�ObsoleteHeaderDefectz0Header uses syntax declared obsolete by RFC 5322Nrrrrrr-hsr-c@seZdZdZdS)�NonASCIILocalPartDefectz(local_part contains non-ASCII charactersNrrrrrr.ksr.N)r�	Exceptionrr	r
r�	TypeErrorrr
�
ValueErrorrrrrrrrZMalformedHeaderDefectrrr r!r"r#r$r'r(r)r-r.rrrr�<module>s4email/__pycache__/quoprimime.cpython-38.opt-2.pyc000064400000010157151153537650015641 0ustar00U

e5d�&�
@sTdddddddddd	g
Zd
dlZd
dlmZmZmZd
ZdZdZdd�e	d�D�Z
e
dd�Ze
dd�Zde�
d�e�
d�D]Zee�ee<q�deed�<dD]Zee�ee<q�dd�Zdd�Zdd�Zdd�Zd+dd�Zd d	�Zd!d�Zd,d#d�Zedd�Zd$D]Zee�ee<�q
d%efd&d�Zefd'd�ZeZeZd(d)�Zd*d�ZdS)-�body_decode�body_encode�body_length�decode�decodestring�
header_decode�
header_encode�
header_length�quote�unquote�N)�
ascii_letters�digits�	hexdigits�
�
�cCsg|]}d|�qS)z=%02X�)�.0�crr�(/usr/lib64/python3.8/email/quoprimime.py�
<listcomp>7sr�s-!*+/�ascii�_� s_ !"#$%&'()*+,-./0123456789:;<>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~	cCst|�t|kS�N)�chr�_QUOPRI_HEADER_MAP��octetrrr�header_checkJsr cCst|�t|kSr)r�_QUOPRI_BODY_MAPrrrr�
body_checkOsr"cCstdd�|D��S)Ncss|]}tt|�VqdSr)�lenr�rrrrr�	<genexpr>^sz header_length.<locals>.<genexpr>��sum��	bytearrayrrrrTs
cCstdd�|D��S)Ncss|]}tt|�VqdSr)r#r!r$rrrr%hszbody_length.<locals>.<genexpr>r&r(rrrrascCsft|t�st|�}|s&|�|���n<t|d�t|�|krT|d||7<n|�|���dS)N���)�
isinstance�strr�append�lstripr#)�L�s�maxlenZextrarrr�_max_appendks
r2cCstt|dd�d��S)N���)r�int�r0rrrr
vscCstt|�Sr)�_QUOPRI_MAP�ord)rrrrr	{s�
iso-8859-1cCs$|sdS|�d��t�}d||fS)Nr�latin1z=?%s?q?%s?=)r�	translater)Zheader_bytes�charset�encodedrrrrss
�Lc
Cs�|dkrtd��|s|S|�t�}d|}|d}g}|j}|��D�]}d}t|�d|}	||	kr�||}
||
ddkr�||||
d��|
d}q^||
ddkr�||||
��|
d}q^||||
�d�|
}q^|�rR|ddk�rR||	}|d	k�rt|d�}n(|dk�r,|d|}n|t|d�}|||d�|�qD|||d��qD|dtk�rz|d
�|�|�S)N�zmaxlinelen must be at least 4�=r3r�r*z 	r4r)	�
ValueErrorr<�_QUOPRI_BODY_ENCODE_MAPr-�
splitlinesr#r	�CRLF�join)
ZbodyZ
maxlinelen�eolZ
soft_breakZmaxlinelen1Zencoded_bodyr-�line�startZ	laststart�stopZroom�qrrrr�sD




cCs|s|Sd}|��D]�}|��}|s.||7}qd}t|�}||kr||}|dkrd||7}|d7}nv|d|kr||d7}q:n^|d|kr�||dtkr�||dtkr�|t|||d��7}|d7}n||7}|d7}||kr:||7}q:q|ddk�r|�|��r|dd�}|S)	NrrrAr3rBr4r*r)rE�rstripr#rr
�endswith)r>rHZdecodedrI�i�nrrrrr�s8
,
cCs|�d�}t|�S)Nr)�groupr
)�matchr0rrr�_unquote_matchs
rScCs |�dd�}tjdt|tjd�S)Nrrz=[a-fA-F0-9]{2})�flags)�replace�re�subrS�ASCIIr7rrrr#s)r)r:) �__all__rV�stringrr
rrF�NLZEMPTYSTRING�ranger8rr!�encoderrr9r r"rrr2r
r	rrDrrrrrSrrrrr�<module>sP�




O0email/__pycache__/headerregistry.cpython-38.pyc000064400000053036151153537650015536 0ustar00U

e5dKQ�@szdZddlmZddlmZddlmZddlmZGdd�d�ZGdd	�d	�Z	Gd
d�de
�Zdd
�ZGdd�d�Z
Gdd�de
�ZGdd�d�ZGdd�de�ZGdd�d�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�d�ZGd d!�d!�ZGd"d#�d#e�ZGd$d%�d%e�ZGd&d'�d'�ZGd(d)�d)�Zeeeeeeeeeeeeeeeeeeeed*�ZGd+d,�d,�Zd-S).a;Representing and manipulating email headers via custom objects.

This module provides an implementation of the HeaderRegistry API.
The implementation is designed to flexibly follow RFC5322 rules.

Eventually HeaderRegistry will be a public API, but it isn't yet,
and will probably change some before that happens.

�)�MappingProxyType)�utils)�errors)�_header_value_parserc@s^eZdZddd�Zedd��Zedd��Zed	d
��Zedd��Zd
d�Z	dd�Z
dd�ZdS)�Address�NcCs�d�td||||f��}d|ks(d|kr0td��|dk	r�|s@|rHtd��t�|�\}}|rjtd�||���|jrz|jd�|j}|j	}||_
||_||_dS)	a�Create an object representing a full email address.

        An address can have a 'display_name', a 'username', and a 'domain'.  In
        addition to specifying the username and domain separately, they may be
        specified together by using the addr_spec keyword *instead of* the
        username and domain keywords.  If an addr_spec string is specified it
        must be properly quoted according to RFC 5322 rules; an error will be
        raised if it is not.

        An Address object has display_name, username, domain, and addr_spec
        attributes, all of which are read-only.  The addr_spec and the string
        value of the object are both quoted according to RFC5322 rules, but
        without any Content Transfer Encoding.

        rN�
�
z8invalid arguments; address parts cannot contain CR or LFz=addrspec specified when username and/or domain also specifiedz6Invalid addr_spec; only '{}' could be parsed from '{}'r)
�join�filter�
ValueError�	TypeError�parserZ
get_addr_spec�format�all_defects�
local_part�domain�
_display_name�	_username�_domain)�self�display_name�usernamer�	addr_specZinputsZa_s�rest�r�,/usr/lib64/python3.8/email/headerregistry.py�__init__s&�
zAddress.__init__cCs|jS�N�r�rrrrr<szAddress.display_namecCs|jSr)rr rrrr@szAddress.usernamecCs|jSr)rr rrrrDszAddress.domaincCsTt|j�}t|�t|tj�kr.t�|j�}n|j}|jrH|d|jS|sPdS|S)z�The addr_spec (username@domain) portion of the address, quoted
        according to RFC 5322 rules, but with no Content Transfer Encoding.
        �@�<>)�setr�lenrZ
DOT_ATOM_ENDS�quote_stringr)r�namesetZlprrrrHs
zAddress.addr_speccCsd�|jj|j|j|j�S)Nz1{}(display_name={!r}, username={!r}, domain={!r}))r�	__class__�__name__rrrr rrr�__repr__Xs�zAddress.__repr__cCs^t|j�}t|�t|tj�kr.t�|j�}n|j}|rX|jdkrFdn|j}d�||�S|jS)Nr"rz{} <{}>)r#rr$r�SPECIALSr%rr)rr&�disprrrr�__str__]s
zAddress.__str__cCs8t|�t|�krdS|j|jko6|j|jko6|j|jkS�NF)�typerrr�r�otherrrr�__eq__hs
�
�zAddress.__eq__)rrrN)r(�
__module__�__qualname__r�propertyrrrrr)r,r1rrrrrs
*



rc@sFeZdZddd�Zedd��Zedd��Zdd	�Zd
d�Zdd
�Z	dS)�GroupNcCs||_|rt|�nt�|_dS)aCreate an object representing an address group.

        An address group consists of a display_name followed by colon and a
        list of addresses (see Address) terminated by a semi-colon.  The Group
        is created by specifying a display_name and a possibly empty list of
        Address objects.  A Group can also be used to represent a single
        address that is not in a group, which is convenient when manipulating
        lists that are a combination of Groups and individual Addresses.  In
        this case the display_name should be set to None.  In particular, the
        string representation of a Group whose display_name is None is the same
        as the Address object, if there is one and only one Address object in
        the addresses list.

        N)r�tuple�
_addresses)rr�	addressesrrrrrszGroup.__init__cCs|jSrrr rrrr�szGroup.display_namecCs|jSr)r7r rrrr8�szGroup.addressescCsd�|jj|j|j�S)Nz${}(display_name={!r}, addresses={!r})rr'r(rr8r rrrr)�s
�zGroup.__repr__cCs�|jdkr&t|j�dkr&t|jd�S|j}|dk	r\t|�}t|�t|tj�kr\t�|�}d�dd�|jD��}|r~d|n|}d�	||�S)N�r�, css|]}t|�VqdSr��str)�.0�xrrr�	<genexpr>�sz Group.__str__.<locals>.<genexpr>� z{}:{};)
rr$r8r<r#rr*r%r
r)rr+r&Zadrstrrrrr,�s
z
Group.__str__cCs,t|�t|�krdS|j|jko*|j|jkSr-)r.rr8r/rrrr1�s

�zGroup.__eq__)NN)
r(r2r3rr4rr8r)r,r1rrrrr5ps


r5c@sTeZdZdZdd�Zdd�Zedd��Zedd	��Zd
d�Z	e
dd
��Zdd�ZdS)�
BaseHeadera|Base class for message headers.

    Implements generic behavior and provides tools for subclasses.

    A subclass must define a classmethod named 'parse' that takes an unfolded
    value string and a dictionary as its arguments.  The dictionary will
    contain one key, 'defects', initialized to an empty list.  After the call
    the dictionary must contain two additional keys: parse_tree, set to the
    parse tree obtained from parsing the header, and 'decoded', set to the
    string value of the idealized representation of the data from the value.
    (That is, encoded words are decoded, and values that have canonical
    representations are so represented.)

    The defects key is intended to collect parsing defects, which the message
    parser will subsequently dispose of as appropriate.  The parser should not,
    insofar as practical, raise any errors.  Defects should be added to the
    list instead.  The standard header parsers register defects for RFC
    compliance issues, for obsolete RFC syntax, and for unrecoverable parsing
    errors.

    The parse method may add additional keys to the dictionary.  In this case
    the subclass must define an 'init' method, which will be passed the
    dictionary as its keyword arguments.  The method should use (usually by
    setting them as the value of similarly named attributes) and remove all the
    extra keys added by its parse method, and then use super to call its parent
    class with the remaining arguments and keywords.

    The subclass should also make sure that a 'max_count' attribute is defined
    that is either None or 1. XXX: need to better define this API.

    cCs\dgi}|�||�t�|d�r4t�|d�|d<t�||d�}|d=|j|f|�|S)N�defects�decoded)�parserZ_has_surrogates�	_sanitizer<�__new__�init)�cls�name�value�kwdsrrrrrF�szBaseHeader.__new__cCs||_||_||_dSr)�_name�_parse_tree�_defects)rrI�
parse_treerBrrrrG�szBaseHeader.initcCs|jSr)rLr rrrrI�szBaseHeader.namecCs
t|j�Sr)r6rNr rrrrB�szBaseHeader.defectscCst|jj|jjt|�f|jfSr)�_reconstruct_headerr'r(�	__bases__r<�__dict__r rrr�
__reduce__�s��zBaseHeader.__reduce__cCst�||�Sr)r<rF)rHrJrrr�_reconstruct�szBaseHeader._reconstructc	Cs`t�t�t�|jd�t�dd�g�g�}|jrH|�t�t�dd�g��|�|j�|j	|d�S)atFold header according to policy.

        The parsed representation of the header is folded according to
        RFC5322 rules, as modified by the policy.  If the parse tree
        contains surrogateescaped bytes, the bytes are CTE encoded using
        the charset 'unknown-8bit".

        Any non-ASCII characters in the parse tree are CTE encoded using
        charset utf-8. XXX: make this a policy setting.

        The returned value is an ASCII-only string possibly containing linesep
        characters, and ending with a linesep character.  The string includes
        the header name and the ': ' separator.

        zheader-name�:z
header-sepr@Zfws)�policy)
rZHeaderZHeaderLabelZ
ValueTerminalrIrM�appendZCFWSListZWhiteSpaceTerminal�fold)rrV�headerrrrrX�s
���zBaseHeader.foldN)
r(r2r3�__doc__rFrGr4rIrBrS�classmethodrTrXrrrrrA�s 




rAcCst||i��|�Sr)r.rT)Zcls_name�basesrJrrrrP
srPc@s&eZdZdZeej�Zedd��Z	dS)�UnstructuredHeaderNcCs"|�|�|d<t|d�|d<dS)NrOrC)�value_parserr<�rHrJrKrrrrDszUnstructuredHeader.parse)
r(r2r3�	max_count�staticmethodr�get_unstructuredr^r[rDrrrrr]s
r]c@seZdZdZdS)�UniqueUnstructuredHeaderr9N�r(r2r3r`rrrrrcsrccsFeZdZdZdZeej�Ze	dd��Z
�fdd�Zedd��Z
�ZS)	�
DateHeadera�Header whose value consists of a single timestamp.

    Provides an additional attribute, datetime, which is either an aware
    datetime using a timezone, or a naive datetime if the timezone
    in the input string is -0000.  Also accepts a datetime as input.
    The 'value' attribute is the normalized form of the timestamp,
    which means it is the output of format_datetime on the datetime.
    NcCsz|s6|d�t���d|d<d|d<t��|d<dSt|t�rJt�|�}||d<t�	|d�|d<|�
|d�|d<dS)NrB�datetimerrCrO)rWrZHeaderMissingRequiredValuerZ	TokenList�
isinstancer<rZparsedate_to_datetimeZformat_datetimer^r_rrrrD.s

zDateHeader.parsecs|�d�|_t�j||�dS)Nrf)�pop�	_datetime�superrG�r�args�kw�r'rrrG<szDateHeader.initcCs|jSr)rir rrrrf@szDateHeader.datetime)r(r2r3rZr`rarrbr^r[rDrGr4rf�
__classcell__rrrnrres	


rec@seZdZdZdS)�UniqueDateHeaderr9NrdrrrrrpEsrpcsPeZdZdZedd��Zedd��Z�fdd�Ze	dd	��Z
e	d
d��Z�ZS)�
AddressHeaderNcCst�|�\}}|rtd��|S)Nzthis should not happen)rZget_address_list�AssertionError)rJ�address_listrrrr^NszAddressHeader.value_parsercCs�t|t�rV|�|�|d<}g}|jD]"}|�t|jdd�|jD���q&t|j	�}n"t
|d�sf|g}dd�|D�}g}||d<||d<d�d	d�|D��|d
<d|kr�|�|d
�|d<dS)NrOcSs*g|]"}t|jpd|jpd|jp"d��qS)r)rrrr)r=Zmbrrr�
<listcomp>]s
�
�z'AddressHeader.parse.<locals>.<listcomp>�__iter__cSs&g|]}t|d�std|g�n|�qS)r8N)�hasattrr5�r=�itemrrrrtfs��groupsrBr:cSsg|]}t|��qSrr;rwrrrrtlsrC)rgr<r^r8rWr5rZ
all_mailboxes�listrrvr
)rHrJrKrsryZaddrrBrrrrDTs*


��
�zAddressHeader.parsecs(t|�d��|_d|_t�j||�dS)Nry)r6rh�_groupsr7rjrGrkrnrrrGpszAddressHeader.initcCs|jSr)r{r rrrryuszAddressHeader.groupscCs&|jdkr tdd�|jD��|_|jS)Ncss|]}|jD]
}|VqqdSr)r8)r=�group�addressrrrr?|s�z*AddressHeader.addresses.<locals>.<genexpr>)r7r6r{r rrrr8ys
zAddressHeader.addresses)
r(r2r3r`rar^r[rDrGr4ryr8rorrrnrrqJs


rqc@seZdZdZdS)�UniqueAddressHeaderr9Nrdrrrrr~�sr~c@seZdZedd��ZdS)�SingleAddressHeadercCs(t|j�dkrtd�|j���|jdS)Nr9z9value of single address header {} is not a single addressr)r$r8rrrIr rrrr}�s
�zSingleAddressHeader.addressN)r(r2r3r4r}rrrrr�src@seZdZdZdS)�UniqueSingleAddressHeaderr9Nrdrrrrr��sr�csZeZdZdZeej�Zedd��Z	�fdd�Z
edd��Zedd	��Z
ed
d��Z�ZS)�MIMEVersionHeaderr9cCs�|�|�|d<}t|�|d<|d�|j�|jdkr<dn|j|d<|j|d<|jdk	rtd�|d|d�|d<nd|d<dS)NrOrCrB�major�minorz{}.{}�version)r^r<�extendrr�r�r�rHrJrKrOrrrrD�s

zMIMEVersionHeader.parsecs6|�d�|_|�d�|_|�d�|_t�j||�dS)Nr�r�r�)rh�_version�_major�_minorrjrGrkrnrrrG�szMIMEVersionHeader.initcCs|jSr)r�r rrrr��szMIMEVersionHeader.majorcCs|jSr)r�r rrrr��szMIMEVersionHeader.minorcCs|jSr)r�r rrrr��szMIMEVersionHeader.version)r(r2r3r`rarZparse_mime_versionr^r[rDrGr4r�r�r�rorrrnrr��s



r�cs8eZdZdZedd��Z�fdd�Zedd��Z�Z	S)�ParameterizedMIMEHeaderr9cCsZ|�|�|d<}t|�|d<|d�|j�|jdkrBi|d<ndd�|jD�|d<dS)NrOrCrB�paramscSs&i|]\}}t�|���t�|��qSr)rrE�lower)r=rIrJrrr�
<dictcomp>�s�z1ParameterizedMIMEHeader.parse.<locals>.<dictcomp>)r^r<r�rr�r�rrrrD�s

�zParameterizedMIMEHeader.parsecs|�d�|_t�j||�dS)Nr�)rh�_paramsrjrGrkrnrrrG�szParameterizedMIMEHeader.initcCs
t|j�Sr)rr�r rrrr��szParameterizedMIMEHeader.params)
r(r2r3r`r[rDrGr4r�rorrrnrr��s
r�csJeZdZeej�Z�fdd�Zedd��Z	edd��Z
edd��Z�ZS)	�ContentTypeHeadercs2t�j||�t�|jj�|_t�|jj�|_dSr)	rjrGrrErM�maintype�	_maintype�subtype�_subtyperkrnrrrG�szContentTypeHeader.initcCs|jSr)r�r rrrr��szContentTypeHeader.maintypecCs|jSr)r�r rrrr��szContentTypeHeader.subtypecCs|jd|jS)N�/)r�r�r rrr�content_type�szContentTypeHeader.content_type)
r(r2r3rarZparse_content_type_headerr^rGr4r�r�r�rorrrnrr��s


r�cs2eZdZeej�Z�fdd�Zedd��Z	�Z
S)�ContentDispositionHeadercs2t�j||�|jj}|dkr"|nt�|�|_dSr)rjrGrM�content_dispositionrrE�_content_disposition)rrlrmZcdrnrrrG�szContentDispositionHeader.initcCs|jSr)r�r rrrr��sz,ContentDispositionHeader.content_disposition)r(r2r3rarZ parse_content_disposition_headerr^rGr4r�rorrrnrr��s
r�csBeZdZdZeej�Zedd��Z	�fdd�Z
edd��Z�Z
S)�ContentTransferEncodingHeaderr9cCs2|�|�|d<}t|�|d<|d�|j�dS�NrOrCrB�r^r<r�rr�rrrrDsz#ContentTransferEncodingHeader.parsecs"t�j||�t�|jj�|_dSr)rjrGrrErM�cte�_cterkrnrrrGsz"ContentTransferEncodingHeader.initcCs|jSr)r�r rrrr�sz!ContentTransferEncodingHeader.cte)r(r2r3r`rarZ&parse_content_transfer_encoding_headerr^r[rDrGr4r�rorrrnrr��s

r�c@s&eZdZdZeej�Zedd��Z	dS)�MessageIDHeaderr9cCs2|�|�|d<}t|�|d<|d�|j�dSr�r�r�rrrrDszMessageIDHeader.parseN)
r(r2r3r`rarZparse_message_idr^r[rDrrrrr�s
r�)Zsubject�datezresent-datez	orig-dateZsenderz
resent-sender�toz	resent-toZccz	resent-ccZbccz
resent-bcc�fromzresent-fromzreply-tozmime-versionzcontent-typezcontent-dispositionzcontent-transfer-encodingz
message-idc@s8eZdZdZeedfdd�Zdd�Zdd�Zd	d
�Z	dS)�HeaderRegistryz%A header_factory and header registry.TcCs&i|_||_||_|r"|j�t�dS)a�Create a header_factory that works with the Policy API.

        base_class is the class that will be the last class in the created
        header class's __bases__ list.  default_class is the class that will be
        used if "name" (see __call__) does not appear in the registry.
        use_default_map controls whether or not the default mapping of names to
        specialized classes is copied in to the registry when the factory is
        created.  The default is True.

        N)�registry�
base_class�
default_class�update�_default_header_map)rr�r�Zuse_default_maprrrr9s
zHeaderRegistry.__init__cCs||j|��<dS)zLRegister cls as the specialized class for handling "name" headers.

        N)r�r��rrIrHrrr�map_to_typeKszHeaderRegistry.map_to_typecCs,|j�|��|j�}td|j||jfi�S)N�_)r��getr�r�r.r(r�r�rrr�__getitem__QszHeaderRegistry.__getitem__cCs||||�S)a�Create a header instance for header 'name' from 'value'.

        Creates a header instance by creating a specialized class for parsing
        and representing the specified header by combining the factory
        base_class with a specialized class from the registry or the
        default_class, and passing the name and value to the constructed
        class's constructor.

        r)rrIrJrrr�__call__Us
zHeaderRegistry.__call__N)
r(r2r3rZrAr]rr�r�r�rrrrr�5s�
r�N)rZ�typesrZemailrrrrrr5r<rArPr]rcrerprqr~rr�r�r�r�r�r�r�r�r�rrrr�<module>sX	`6d'7
%�email/__pycache__/message.cpython-38.pyc000064400000111770151153537650014141 0ustar00U

e5d��@s�dZddgZddlZddlZddlZddlmZmZddlm	Z	ddlm
Z
ddlmZm
Z
dd	lmZdd
lmZejZdZe�d�Zd
d�Zddd�Zdd�Zdd�ZGdd�d�ZGdd�de�ZGdd�de�ZdS)z8Basic message object for the email package object model.�Message�EmailMessage�N)�BytesIO�StringIO)�utils)�errors)�Policy�compat32��charset)�decode_bz; z[ \(\)<>@,;:\\"/\[\]\?=]cCs4t|��d�\}}}|s$|��dfS|��|��fS)N�;)�str�	partition�strip)�param�a�sep�b�r�%/usr/lib64/python3.8/email/message.py�_splitparamsrTcCs�|dk	r�t|�dkr�t|t�rL|d7}t�|d|d|d�}d||fSz|�d�Wn6tk
r�|d7}t�|dd	�}d||fYSX|s�t�|�r�d
|t�	|�fSd||fSn|SdS)a~Convenience function to format and return a key=value pair.

    This will quote the value if needed or if quote is true.  If value is a
    three tuple (charset, language, value), it will be encoded according
    to RFC2231 rules.  If it contains non-ascii characters it will likewise
    be encoded according to RFC2231 rules, using the utf-8 charset and
    a null language.
    Nr�*���%s=%s�asciizutf-8�z%s="%s")
�len�
isinstance�tuplerZencode_rfc2231�encode�UnicodeEncodeError�	tspecials�search�quote)r�valuer%rrr�_formatparam's	
r'cCs�dt|�}g}|dd�dkr�|dd�}|�d�}|dkrp|�dd|�|�dd|�drp|�d|d�}q6|dkr�t|�}|d|�}d|kr�|�d�}|d|�����d||dd���}|�|���||d�}q|S)Nr
rr�"z\"r�=)r�find�countr�indexr�lower�append)�sZplist�end�f�irrr�_parseparamIs 
(
,r3cCs4t|t�r&|d|dt�|d�fSt�|�SdS)Nrrr)rr r�unquote)r&rrr�
_unquotevalue]s
r5c@s�eZdZdZefdd�Zdd�Zddd	d
�Zdd�Zded
d�Z	dd�Z
dd�Zdd�Zdd�Z
dfdd�Zdgdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zdhd1d2�Zd3d4�Zd5d6�Zdid7d8�Zd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dAdB�Z#dCdD�Z$dEdF�Z%dGdH�Z&djdKdL�Z'dkdMdN�Z(dldQdR�Z)dmdSdT�Z*dndUdV�Z+dodWdX�Z,dpdYdZ�Z-d[d\�Z.dqd]d^�Z/drd_d`�Z0dadb�Z1ddcl2m3Z3dS)sra�Basic message object.

    A message object is defined as something that has a bunch of RFC 2822
    headers and a payload.  It may optionally have an envelope header
    (a.k.a. Unix-From or From_ header).  If the message is a container (i.e. a
    multipart or a message/rfc822), then the payload is a list of Message
    objects, otherwise it is a string.

    Message objects implement part of the `mapping' interface, which assumes
    there is exactly one occurrence of the header per message.  Some headers
    do in fact appear multiple times (e.g. Received) and for those headers,
    you must use the explicit API to set or get all the headers.  Not all of
    the mapping methods are implemented.
    cCs:||_g|_d|_d|_d|_d|_|_g|_d|_dS)N�
text/plain)	�policy�_headers�	_unixfrom�_payload�_charsetZpreambleZepilogue�defects�
_default_type)�selfr7rrr�__init__xszMessage.__init__cCs|��S)z9Return the entire formatted message as a string.
        )�	as_string�r>rrr�__str__�szMessage.__str__FrNcCsJddlm}|dkr|jn|}t�}||d||d�}|j||d�|��S)a�Return the entire formatted message as a string.

        Optional 'unixfrom', when true, means include the Unix From_ envelope
        header.  For backward compatibility reasons, if maxheaderlen is
        not specified it defaults to 0, so you must override it explicitly
        if you want a different maxheaderlen.  'policy' is passed to the
        Generator instance used to serialize the message; if it is not
        specified the policy associated with the message instance is used.

        If the message object contains binary data that is not encoded
        according to RFC standards, the non-compliant data will be replaced by
        unicode "unknown character" code points.
        r)�	GeneratorNF)�mangle_from_�maxheaderlenr7��unixfrom)�email.generatorrCr7r�flatten�getvalue)r>rGrEr7rC�fp�grrrr@�s�zMessage.as_stringcCs|��S)z?Return the entire formatted message as a bytes object.
        )�as_bytesrArrr�	__bytes__�szMessage.__bytes__cCsHddlm}|dkr|jn|}t�}||d|d�}|j||d�|��S)aJReturn the entire formatted message as a bytes object.

        Optional 'unixfrom', when true, means include the Unix From_ envelope
        header.  'policy' is passed to the BytesGenerator instance used to
        serialize the message; if not specified the policy associated with
        the message instance is used.
        r)�BytesGeneratorNF)rDr7rF)rHrOr7rrIrJ)r>rGr7rOrKrLrrrrM�szMessage.as_bytescCst|jt�S)z6Return True if the message consists of multiple parts.)rr:�listrArrr�is_multipart�szMessage.is_multipartcCs
||_dS�N�r9)r>rGrrr�set_unixfrom�szMessage.set_unixfromcCs|jSrRrSrArrr�get_unixfrom�szMessage.get_unixfromcCsF|jdkr|g|_n.z|j�|�Wntk
r@td��YnXdS)z�Add the given payload to the current payload.

        The current payload will always be a list of objects after this method
        is called.  If you want to set the payload to a scalar object, use
        set_payload() instead.
        Nz=Attach is not valid on a message with a non-multipart payload)r:r.�AttributeError�	TypeError)r>�payloadrrr�attach�s

zMessage.attachcCs�|��r(|rdS|dkr|jS|j|S|dk	rNt|jt�sNtdt|j���|j}t|�dd����}t|t�r�t	�
|�r�|�dd�}|s�z|�|�
dd�d�}Wq�tk
r�|�dd�}Yq�Xn2|r�z|�d�}Wntk
r�|�d	�}YnX|�s|S|d
k�rt�|�S|dk�rVtd�|����\}}|D]}|j�||��q<|S|d
k�r�t|�}	t�}
ztj|	|
dd�|
��WStjk
�r�|YSXt|t��r�|S|S)aZReturn a reference to the payload.

        The payload will either be a list object or a string.  If you mutate
        the list object, you modify the message's payload in place.  Optional
        i returns that index into the payload.

        Optional decode is a flag indicating whether the payload should be
        decoded or not, according to the Content-Transfer-Encoding header
        (default is False).

        When True and the message is not a multipart, the payload will be
        decoded if this header's value is `quoted-printable' or `base64'.  If
        some other encoding is used, or the header is missing, or if the
        payload has bogus data (i.e. bogus base64 or uuencoded data), the
        payload is returned as-is.

        If the message is a multipart and the decode flag is True, then None
        is returned.
        NzExpected list, got %szcontent-transfer-encodingrr�surrogateescaper�replace�raw-unicode-escapezquoted-printable�base64�)z
x-uuencodeZuuencodeZuuezx-uueT)�quiet)rQr:rrPrW�typer�getr-rZ_has_surrogatesr!�decode�	get_param�LookupError�UnicodeError�quopriZdecodestringr�join�
splitlinesr7Z
handle_defectr�uurJ�Error)r>r2rbrX�cteZbpayloadr&r<ZdefectZin_fileZout_filerrr�get_payload�sV"








zMessage.get_payloadcCspt|d�r:|dkr||_dSt|t�s.t|�}|�|j�}t|d�rT|�dd�|_n||_|dk	rl|�|�dS)z�Set the payload to the given value.

        Optional charset sets the message's default character set.  See
        set_charset() for details.
        r!NrbrrZ)�hasattrr:r�Charsetr!�output_charsetrb�set_charset)r>rXrrrr�set_payload/s


zMessage.set_payloadcCs|dkr|�d�d|_dSt|t�s.t|�}||_d|krH|�dd�d|krf|jdd|��d�n|�d|���||��kr�|�|j�|_d|k�r|�	�}z||�Wnjt
k
�r|j}|r�z|�d	d
�}Wn tk
r�|�|j
�}YnX|�|�|_|�d|�YnXdS)a�Set the charset of the payload to a given character set.

        charset can be a Charset instance, a string naming a character set, or
        None.  If it is a string it will be converted to a Charset instance.
        If charset is None, the charset parameter will be removed from the
        Content-Type field.  Anything else will generate a TypeError.

        The message will be assumed to be of type text/* encoded with
        charset.input_charset.  It will be converted to charset.output_charset
        and encoded properly, if needed, when generating the plain text
        representation of the message.  MIME headers (MIME-Version,
        Content-Type, Content-Transfer-Encoding) will be added as needed.
        Nr�MIME-Version�1.0�Content-Typer6r
zContent-Transfer-EncodingrrZ)�	del_paramr;rrn�
add_headerZget_output_charset�	set_paramZbody_encoder:Zget_body_encodingrWr!rero)r>rrkrXrrrrpCs:

�
zMessage.set_charsetcCs|jS)zKReturn the Charset instance associated with the message's payload.
        )r;rArrr�get_charsetrszMessage.get_charsetcCs
t|j�S)z9Return the total number of headers, including duplicates.)rr8rArrr�__len__zszMessage.__len__cCs
|�|�S)a-Get a header value.

        Return None if the header is missing instead of raising an exception.

        Note that if the header appeared multiple times, exactly which
        occurrence gets returned is undefined.  Use get_all() to get all
        the values matching a header field name.
        )ra�r>�namerrr�__getitem__~s	zMessage.__getitem__cCsr|j�|�}|rX|��}d}|jD]4\}}|��|kr"|d7}||kr"td�||���q"|j�|j�||��dS)z�Set the value of a header.

        Note: this does not overwrite an existing header with the same field
        name.  Use __delitem__() first to delete any existing headers.
        rrz/There may be at most {} {} headers in a messageN)r7Zheader_max_countr-r8�
ValueError�formatr.�header_store_parse)r>r{�valZ	max_countZlname�found�k�vrrr�__setitem__�s�zMessage.__setitem__cCs@|��}g}|jD]"\}}|��|kr|�||f�q||_dS)zwDelete all occurrences of a header, if present.

        Does not raise an exception if the header is missing.
        N)r-r8r.)r>r{�
newheadersr�r�rrr�__delitem__�szMessage.__delitem__cCs|��dd�|jD�kS)NcSsg|]\}}|���qSr)r-��.0r�r�rrr�
<listcomp>�sz(Message.__contains__.<locals>.<listcomp>)r-r8rzrrr�__contains__�szMessage.__contains__ccs|jD]\}}|VqdSrR�r8)r>Zfieldr&rrr�__iter__�szMessage.__iter__cCsdd�|jD�S)a.Return a list of all the message's header field names.

        These will be sorted in the order they appeared in the original
        message, or were added to the message, and may contain duplicates.
        Any fields deleted and re-inserted are always appended to the header
        list.
        cSsg|]\}}|�qSrrr�rrrr��sz Message.keys.<locals>.<listcomp>r�rArrr�keys�szMessage.keyscs�fdd��jD�S)a)Return a list of all the message's header values.

        These will be sorted in the order they appeared in the original
        message, or were added to the message, and may contain duplicates.
        Any fields deleted and re-inserted are always appended to the header
        list.
        csg|]\}}�j�||��qSr�r7�header_fetch_parser�rArrr��s�z"Message.values.<locals>.<listcomp>r�rArrAr�values�s
�zMessage.valuescs�fdd��jD�S)a'Get all the message's header fields and values.

        These will be sorted in the order they appeared in the original
        message, or were added to the message, and may contain duplicates.
        Any fields deleted and re-inserted are always appended to the header
        list.
        cs"g|]\}}|�j�||�f�qSrr�r�rArrr��s�z!Message.items.<locals>.<listcomp>r�rArrAr�items�s
�z
Message.itemscCs:|��}|jD]&\}}|��|kr|j�||�Sq|S)z~Get a header value.

        Like __getitem__() but return failobj instead of None when the field
        is missing.
        )r-r8r7r�)r>r{�failobjr�r�rrrra�s
zMessage.getcCs|j�||f�dS)z�Store name and value in the model without modification.

        This is an "internal" API, intended only for use by a parser.
        N)r8r.)r>r{r&rrr�set_raw�szMessage.set_rawcCst|j���S)z�Return the (name, value) header pairs without modification.

        This is an "internal" API, intended only for use by a generator.
        )�iterr8�copyrArrr�	raw_items�szMessage.raw_itemscCsHg}|��}|jD](\}}|��|kr|�|j�||��q|sD|S|S)aQReturn a list of all the values for the named field.

        These will be sorted in the order they appeared in the original
        message, and may contain duplicates.  Any fields deleted and
        re-inserted are always appended to the header list.

        If no such fields exist, failobj is returned (defaults to None).
        )r-r8r.r7r�)r>r{r�r�r�r�rrr�get_all�s	zMessage.get_allcKspg}|��D]<\}}|dkr0|�|�dd��q|�t|�dd�|��q|dk	r^|�d|�t�|�||<dS)u�Extended header setting.

        name is the header field to add.  keyword arguments can be used to set
        additional parameters for the header field, with underscores converted
        to dashes.  Normally the parameter will be added as key="value" unless
        value is None, in which case only the key will be added.  If a
        parameter value contains non-ASCII characters it can be specified as a
        three-tuple of (charset, language, value), in which case it will be
        encoded according to RFC2231 rules.  Otherwise it will be encoded using
        the utf-8 charset and a language of ''.

        Examples:

        msg.add_header('content-disposition', 'attachment', filename='bud.gif')
        msg.add_header('content-disposition', 'attachment',
                       filename=('utf-8', '', Fußballer.ppt'))
        msg.add_header('content-disposition', 'attachment',
                       filename='Fußballer.ppt'))
        N�_�-r)r�r.r[r'�insert�	SEMISPACErg)r>�_name�_valueZ_params�partsr�r�rrrrvszMessage.add_headercCs\|��}ttt|j��|j�D]0\}\}}|��|kr|j�||�|j|<qXqt|��dS)z�Replace a header.

        Replace the first matching header found in the message, retaining
        header order and case.  If no matching header was found, a KeyError is
        raised.
        N)r-�zip�rangerr8r7r�KeyError)r>r�r�r2r�r�rrr�replace_header!s"zMessage.replace_headercCsHt�}|�d|�}||kr"|��St|�d��}|�d�dkrDdS|S)a0Return the message's content type.

        The returned string is coerced to lower case of the form
        `maintype/subtype'.  If there was no Content-Type header in the
        message, the default type as given by get_default_type() will be
        returned.  Since according to RFC 2045, messages always have a default
        type this will always return a value.

        RFC 2045 defines a message's default type to be text/plain unless it
        appears inside a multipart/digest container, in which case it would be
        message/rfc822.
        �content-typer�/rr6)�objectra�get_default_typerr-r+)r>�missingr&�ctyperrr�get_content_type4s
zMessage.get_content_typecCs|��}|�d�dS)z�Return the message's main content type.

        This is the `maintype' part of the string returned by
        get_content_type().
        r�r�r��split�r>r�rrr�get_content_maintypeLszMessage.get_content_maintypecCs|��}|�d�dS)z�Returns the message's sub-content type.

        This is the `subtype' part of the string returned by
        get_content_type().
        r�rr�r�rrr�get_content_subtypeUszMessage.get_content_subtypecCs|jS)aReturn the `default' content type.

        Most messages have a default content type of text/plain, except for
        messages that are subparts of multipart/digest containers.  Such
        subparts have a default content type of message/rfc822.
        �r=rArrrr�^szMessage.get_default_typecCs
||_dS)z�Set the `default' content type.

        ctype should be either "text/plain" or "message/rfc822", although this
        is not enforced.  The default content type is not stored in the
        Content-Type header.
        Nr�r�rrr�set_default_typegszMessage.set_default_typec		Cs�t�}|�||�}||kr|Sg}t|�D]X}z$|�dd�\}}|��}|��}Wn tk
rr|��}d}YnX|�||f�q*t�|�}|S)Nr)rr)	r�rar3r�rr}r.rZ
decode_params)	r>r��headerr�r&�params�pr{r�rrr�_get_params_preserveps 

zMessage._get_params_preserver�TcCs8t�}|�||�}||kr|S|r0dd�|D�S|SdS)amReturn the message's Content-Type parameters, as a list.

        The elements of the returned list are 2-tuples of key/value pairs, as
        split on the `=' sign.  The left hand side of the `=' is the key,
        while the right hand side is the value.  If there is no `=' sign in
        the parameter the value is the empty string.  The value is as
        described in the get_param() method.

        Optional failobj is the object to return if there is no Content-Type
        header.  Optional header is the header to search instead of
        Content-Type.  If unquote is True, the value is unquoted.
        cSsg|]\}}|t|�f�qSr)r5r�rrrr��sz&Message.get_params.<locals>.<listcomp>N)r�r�)r>r�r�r4r�r�rrr�
get_params�s
zMessage.get_paramscCsN||kr|S|�||�D]0\}}|��|��kr|r@t|�S|Sq|S)a�Return the parameter value if found in the Content-Type header.

        Optional failobj is the object to return if there is no Content-Type
        header, or the Content-Type header has no such parameter.  Optional
        header is the header to search instead of Content-Type.

        Parameter keys are always compared case insensitively.  The return
        value can either be a string, or a 3-tuple if the parameter was RFC
        2231 encoded.  When it's a 3-tuple, the elements of the value are of
        the form (CHARSET, LANGUAGE, VALUE).  Note that both CHARSET and
        LANGUAGE can be None, in which case you should consider VALUE to be
        encoded in the us-ascii charset.  You can usually ignore LANGUAGE.
        The parameter value (either the returned string, or the VALUE item in
        the 3-tuple) is always unquoted, unless unquote is set to False.

        If your application doesn't care whether the parameter was RFC 2231
        encoded, it can turn the return value into a string as follows:

            rawparam = msg.get_param('foo')
            param = email.utils.collapse_rfc2231_value(rawparam)

        )r�r-r5)r>rr�r�r4r�r�rrrrc�s
zMessage.get_paramrtrcCs
t|t�s|r|||f}||kr2|��dkr2d}n
|�|�}|j||d�st|s\t|||�}q�t�|t|||�g�}nbd}|j||d�D]N\}	}
d}|	��|��kr�t|||�}nt|	|
|�}|s�|}q�t�||g�}q�||�|�k�r|r�|�	||�n||=|||<dS)a�Set a parameter in the Content-Type header.

        If the parameter already exists in the header, its value will be
        replaced with the new value.

        If header is Content-Type and has not yet been defined for this
        message, it will be set to "text/plain" and the new parameter and
        value will be appended as per RFC 2045.

        An alternate header can be specified in the header argument, and all
        parameters will be quoted as necessary unless requote is False.

        If charset is specified, the parameter will be encoded according to RFC
        2231.  Optional language specifies the RFC 2231 language, defaulting
        to the empty string.  Both charset and language should be strings.
        r�r6)r�r�r�r4N)
rr r-rarcr'r�rgr�r�)r>rr&r��requoterZlanguager[r�Z	old_param�	old_valueZappend_paramrrrrw�s6

��zMessage.set_paramcCs�||krdSd}|j||d�D]@\}}|��|��kr|sHt|||�}qt�|t|||�g�}q||�|�kr|||=|||<dS)a>Remove the given parameter completely from the Content-Type header.

        The header will be re-written in place without the parameter or its
        value. All values will be quoted as necessary unless requote is
        False.  Optional header specifies an alternative to the Content-Type
        header.
        Nrr�)r�r-r'r�rgra)r>rr�r�Z	new_ctyper�r�rrrru�s
�zMessage.del_paramcCs�|�d�dkst�|��dkr,|d=d|d<||kr@|||<dS|j||d�}||=|||<|dd�D]\}}|�||||�qhdS)	aKSet the main type and subtype for the Content-Type header.

        type must be a string in the form "maintype/subtype", otherwise a
        ValueError is raised.

        This method replaces the Content-Type header, keeping all the
        parameters in place.  If requote is False, this leaves the existing
        header's quoting as is.  Otherwise, the parameters will be quoted (the
        default).

        An alternative header can be specified in the header argument.  When
        the Content-Type header is set, we'll always also add a MIME-Version
        header.
        r�rr�zmime-versionrsrrNr�)r+r}r-r�rw)r>r`r�r�r�r�r�rrr�set_typeszMessage.set_typecCsDt�}|�d|d�}||kr*|�d|d�}||kr6|St�|���S)a@Return the filename associated with the payload if present.

        The filename is extracted from the Content-Disposition header's
        `filename' parameter, and it is unquoted.  If that header is missing
        the `filename' parameter, this method falls back to looking for the
        `name' parameter.
        �filename�content-dispositionr{r�)r�rcr�collapse_rfc2231_valuer)r>r�r�r�rrr�get_filename&szMessage.get_filenamecCs,t�}|�d|�}||kr|St�|���S)z�Return the boundary associated with the payload if present.

        The boundary is extracted from the Content-Type header's `boundary'
        parameter, and it is unquoted.
        �boundary)r�rcrr��rstrip)r>r�r�r�rrr�get_boundary6s
zMessage.get_boundarycCst�}|�|d�}||kr$t�d��g}d}|D]:\}}|��dkr\|�dd|f�d}q0|�||f�q0|s�|�dd|f�g}|jD]z\}	}
|	��dkr�g}|D].\}}
|
dkr�|�|�q�|�d||
f�q�t�|�}
|�|j	�
|	|
��q�|�|	|
f�q�||_d	S)
a�Set the boundary parameter in Content-Type to 'boundary'.

        This is subtly different than deleting the Content-Type header and
        adding a new one with a new boundary parameter via add_header().  The
        main difference is that using the set_boundary() method preserves the
        order of the Content-Type header in the original message.

        HeaderParseError is raised if the message has no Content-Type header.
        r�zNo Content-Type header foundFr�z"%s"TrrN)r�r�rZHeaderParseErrorr-r.r8r�rgr7r)r>r�r�r�Z	newparamsZfoundpZpkZpvr��hr�r�r�r�rrr�set_boundaryCs2


zMessage.set_boundaryc	Cs�t�}|�d|�}||kr|St|t�rr|dp2d}z|d�d�}t||�}Wn ttfk
rp|d}YnXz|�d�Wntk
r�|YSX|��S)z�Return the charset parameter of the Content-Type header.

        The returned string is always coerced to lower case.  If there is no
        Content-Type header, or if that header has no charset parameter,
        failobj is returned.
        rrzus-asciirr\)	r�rcrr r!rrdrer-)r>r�r�rZpcharsetrMrrr�get_content_charsetqs 

zMessage.get_content_charsetcs�fdd�|��D�S)a�Return a list containing the charset(s) used in this message.

        The returned list of items describes the Content-Type headers'
        charset parameter for this message and all the subparts in its
        payload.

        Each item will either be a string (the value of the charset parameter
        in the Content-Type header of that part) or the value of the
        'failobj' parameter (defaults to None), if the part does not have a
        main MIME type of "text", or the charset is not defined.

        The list will contain one string for each part of the message, plus
        one for the container message (i.e. self), so that a non-multipart
        message will still return a list of length 1.
        csg|]}|����qSr)r�)r��part�r�rrr��sz(Message.get_charsets.<locals>.<listcomp>��walk)r>r�rr�r�get_charsets�szMessage.get_charsetscCs*|�d�}|dkrdSt|�d��}|S)z�Return the message's content-disposition if it exists, or None.

        The return values can be either 'inline', 'attachment' or None
        according to the rfc2183.
        r�Nr)rarr-)r>r&�c_drrr�get_content_disposition�s

zMessage.get_content_dispositionr�)FrN)FN)NF)N)N)N)Nr�T)Nr�T)rtTNrF)r�T)rtT)N)N)N)N)4�__name__�
__module__�__qualname__�__doc__r	r?rBr@rNrMrQrTrUrYrlrqrprxryr|r�r�r�r�r�r�r�rar�r�r�rvr�r�r�r�r�r�r�r�rcrwrur�r�r�r�r�r�r�Zemail.iteratorsr�rrrrrisj


Z
/


				
�
"�
3

 


.


cs�eZdZd2dd�Zd3�fdd�	Zdd�Zd	d
�Zdd�Zd4dd�ZddddhZ	dd�Z
dd�Zdd�dd�Zdd�dd�Z
dd�Zd5dd �Zd6d!d"�Zd7d#d$�Zdd%�d&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Z�ZS)8�MIMEPartNcCs(|dkrddlm}|}t�||�dS)Nr)�default)Zemail.policyr�rr?)r>r7r�rrrr?�szMIMEPart.__init__Fcs0|dkr|jn|}|dkr |j}t�j||d�S)aReturn the entire formatted message as a string.

        Optional 'unixfrom', when true, means include the Unix From_ envelope
        header.  maxheaderlen is retained for backward compatibility with the
        base Message class, but defaults to None, meaning that the policy value
        for max_line_length controls the header maximum length.  'policy' is
        passed to the Generator instance used to serialize the message; if it
        is not specified the policy associated with the message instance is
        used.
        N)rEr7)r7Zmax_line_length�superr@)r>rGrEr7��	__class__rrr@�szMIMEPart.as_stringcCs|j|jjdd�d�S)NT)�utf8�r7)r@r7ZclonerArrrrB�szMIMEPart.__str__cCs |�d�}|dkrdS|jdkS)Nr�F�
attachment)raZcontent_disposition)r>r�rrr�
is_attachment�s
zMIMEPart.is_attachmentc	cs|��rdS|���d�\}}|dkrB||kr>|�|�|fVdS|dkrNdS|dkrz|��D]}|�||�EdHq^dSd|kr�|�d�|fVd}|�d�}|r�|��D]}|d|kr�|}q�q�|dkr�|��}|r�|dnd}|dk	�r|�||�EdHdS)Nr��text�	multipart�related�start�
content-idr)r�r�r�r,�
iter_parts�
_find_bodyrcrl)	r>r��preferencelist�maintype�subtypeZsubpart�	candidater�Zsubpartsrrrr��s6

zMIMEPart._find_body�r��html�plaincCsBt|�}d}|�||�D]$\}}||kr|}|}|dkrq>q|S)aReturn best candidate mime part for display as 'body' of message.

        Do a depth first search, starting with self, looking for the first part
        matching each of the items in preferencelist, and return the part
        corresponding to the first item that has a match, or None if no items
        have a match.  If 'related' is not included in preferencelist, consider
        the root part of any multipart/related encountered as a candidate
        match.  Ignore parts with 'Content-Disposition: attachment'.
        Nr)rr�)r>r�Z	best_prioZbodyZprior�rrr�get_body�s
zMIMEPart.get_body)r�r�)r�r�)r�r�)r��alternativec
cs$|���d�\}}|dks"|dkr&dS|��}z|��}Wntk
rPYdSX|dkr�|dkr�|�d�}|r�d}g}|D]"}|�d�|kr�d	}q||�|�q||r�|EdHdS|�d
�|EdHdSg}	|D]L}|���d�\}}||f|j	k�r|�
��s||	k�r|	�|�q�|Vq�dS)aReturn an iterator over the non-main parts of a multipart.

        Skip the first of each occurrence of text/plain, text/html,
        multipart/related, or multipart/alternative in the multipart (unless
        they have a 'Content-Disposition: attachment' header) and include all
        remaining subparts in the returned iterator.  When applied to a
        multipart/related, return all parts except the root part.  Return an
        empty iterator when applied to a multipart/alternative or a
        non-multipart.
        r�r�r�Nr�r�Fr�Tr)r�r�rlr�rVrcrar.�pop�_body_typesr�)
r>r�r�rXr�r�r�Zattachmentsr��seenrrr�iter_attachmentssD



��
zMIMEPart.iter_attachmentsccs|��dkr|��EdHdS)z~Return an iterator over all immediate subparts of a multipart.

        Return an empty iterator for a non-multipart.
        r�N)r�rlrArrrr�=szMIMEPart.iter_parts)�content_managercOs"|dkr|jj}|j|f|�|�SrR)r7r��get_content�r>r��args�kwrrrr�EszMIMEPart.get_contentcOs&|dkr|jj}|j|f|�|�dSrR)r7r��set_contentr�rrrr�JszMIMEPart.set_contentc
Cs�|��dkr6|��}||f}||kr6td�||���g}g}|jD]4\}}|���d�rj|�||f�qD|�||f�qD|r�t|�|j	d�}	||	_|j
|	_
|	g|_
ng|_
||_d||d<|dk	r�|�d|�dS)Nr�zCannot convert {} to {}�content-r�z
multipart/rtr�)r�r�r}r~r8r-�
startswithr.r`r7r:rw)
r>r�Zdisallowed_subtypesr�Zexisting_subtypeZkeep_headersZpart_headersr{r&r�rrr�_make_multipartOs0
�
zMIMEPart._make_multipartcCs|�dd|�dS)Nr�)r��mixed�r��r>r�rrr�make_relatedjszMIMEPart.make_relatedcCs|�dd|�dS)Nr�)r�r�r�rrr�make_alternativemszMIMEPart.make_alternativecCs|�dd|�dS)Nr�rr�r�rrr�
make_mixedpszMIMEPart.make_mixed)�_dispcOsf|��dks|��|kr(t|d|��t|�|jd�}|j||�|rXd|krX||d<|�|�dS)Nr�Zmake_r�r�zContent-Disposition)r�r��getattrr`r7r�rY)r>Z_subtyper�r�r�r�rrr�_add_multipartss
�zMIMEPart._add_multipartcOs|jd|�ddi|��dS)Nr�r�Zinline)r��r��r>r�r�rrr�add_related}szMIMEPart.add_relatedcOs|jd|�|�dS)Nr�)r�r�r�rrr�add_alternative�szMIMEPart.add_alternativecOs|jd|�ddi|��dS)Nr�r�r�)r�r�r�rrr�add_attachment�szMIMEPart.add_attachmentcCsg|_d|_dSrR�r8r:rArrr�clear�szMIMEPart.clearcCsdd�|jD�|_d|_dS)NcSs&g|]\}}|���d�s||f�qS)r�)r-r�)r��nr�rrrr��s�z*MIMEPart.clear_content.<locals>.<listcomp>rrArrr�
clear_content�szMIMEPart.clear_content)N)FNN)r�)N)N)N)r�r�r�r?r@rBr�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr�
__classcell__rrr�rr��s2

�7



r�cseZdZ�fdd�Z�ZS)rcs"t�j||�d|krd|d<dS)Nrrrs)r�r�r�r�rrr��szEmailMessage.set_content)r�r�r�r�rrrr�rr�s)NT)r��__all__�rerirf�iorrZemailrrZemail._policybaserr	rr;Zemail._encoded_wordsrrnr��compiler#rr'r3r5rr�rrrrr�<module>s6


"N`email/__pycache__/charset.cpython-38.opt-2.pyc000064400000011747151153537650015111 0ustar00U

e5d�B�@srddddgZddlmZddlZddlZddlmZddlmZd	Z	d
Z
dZdZd
Z
dZdZe	e	dfe	e	dfe	e	dfe	e	dfe	e	dfe	e	dfe	e	dfe	e	dfe	e	dfe	e	dfe	e	dfe	e	dfde
e
dfe
e
dfe
ddfe
ddfe
ddfe
e
dfee
dfd�Zddddddddddddddddddddddd d
d!�Zd"d#dd$�Zd+d%d�Zd&d�Zd'd�Zd(d)�ZGd*d�d�ZdS),�Charset�	add_alias�add_charset�	add_codec�)�partialN)�errors)�encode_7or8bit�����us-asciizunknown-8bit�)NNN�iso-2022-jp�utf-8)�
iso-8859-1�
iso-8859-2�
iso-8859-3�
iso-8859-4�
iso-8859-9�iso-8859-10�iso-8859-13�iso-8859-14�iso-8859-15�iso-8859-16zwindows-1252Zvisciir
�big5�gb2312�euc-jp�	shift_jisrzkoi8-rrrrrrrrrrrrzks_c_5601-1987rzeuc-kr)�latin_1zlatin-1Zlatin_2zlatin-2Zlatin_3zlatin-3Zlatin_4zlatin-4Zlatin_5zlatin-5Zlatin_6zlatin-6Zlatin_7zlatin-7Zlatin_8zlatin-8Zlatin_9zlatin-9Zlatin_10zlatin-10�cp949�euc_jp�euc_kr�ascii�eucgb2312_cn�big5_tw)rrr
cCs"|tkrtd��|||ft|<dS)Nz!SHORTEST not allowed for body_enc)�SHORTEST�
ValueError�CHARSETS)�charsetZ
header_encZbody_enc�output_charset�r+�%/usr/lib64/python3.8/email/charset.pyrmscCs|t|<dS�N)�ALIASES)�aliasZ	canonicalr+r+r,r�scCs|t|<dSr-)�	CODEC_MAP)r)Z	codecnamer+r+r,r�scCs"|tkr|�dd�S|�|�SdS)Nr#�surrogateescape)�UNKNOWN8BIT�encode)�string�codecr+r+r,�_encode�sr6c@sXeZdZefdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�Zdd�ZdS)rcCs�z$t|t�r|�d�n
t|d�}Wntk
rBt�|��YnX|��}t�||�|_	t
�|j	ttdf�\}}}|s~|j	}||_
||_t�||�|_t�|j	|j	�|_t�|j|j�|_dS)Nr#)�
isinstance�strr3�UnicodeErrorrZCharsetError�lowerr.�get�
input_charsetr(r&�BASE64�header_encoding�
body_encodingr*r0Zinput_codec�output_codec)�selfr<ZhencZbencZconvr+r+r,�__init__�s,
�
��zCharset.__init__cCs
|j��Sr-)r<r:�rAr+r+r,�__repr__�szCharset.__repr__cCst|�t|���kSr-)r8r:)rA�otherr+r+r,�__eq__�szCharset.__eq__cCs$|jtkrdS|jtkrdStSdS)Nzquoted-printable�base64)r?�QPr=rrCr+r+r,�get_body_encoding�s


zCharset.get_body_encodingcCs|jp
|jSr-)r*r<rCr+r+r,�get_output_charsetszCharset.get_output_charsetcCs6|jpd}t||�}|�|�}|dkr*|S|�||�S)Nr
)r@r6�_get_encoder�
header_encode)rAr4r5�header_bytes�encoder_moduler+r+r,rLs


zCharset.header_encodecCs|jpd}t||�}|�|�}t|j|d�}|��}t|�t}g}	g}
t|�|}|D]�}|
�	|�t
�|
�}
|�t|
|��}||krX|
�
�|	s�|
s�|	�	d�n.|	r�dnd}t
�|
�}t||�}|	�	||��|g}
t|�|}qXt
�|
�}t||�}|	�	||��|	S)Nr
)r)� r)r@r6rKrrLrJ�len�RFC2047_CHROME_LEN�next�append�EMPTYSTRING�join�
header_length�pop)rAr4Z
maxlengthsr5rMrN�encoderr)Zextra�linesZcurrent_line�maxlen�	characterZ	this_lineZlengthZ	separatorZjoined_liner+r+r,�header_encode_lines*s6








zCharset.header_encode_linescCs`|jtkrtjS|jtkr tjS|jtkrXtj�|�}tj�|�}||krPtjStjSndSdSr-)r>r=�email�
base64mimerH�
quoprimimer&rV)rArMZlen64Zlenqpr+r+r,rKhs


zCharset._get_encodercCs�|s|S|jtkr4t|t�r(|�|j�}tj�|�S|jt	krjt|t�rT|�|j�}|�
d�}tj�|�St|t�r�|�|j��
d�}|SdS)N�latin1r#)r?r=r7r8r3r*r]r^�body_encoderH�decoder_)rAr4r+r+r,raws	





zCharset.body_encodeN)
�__name__�
__module__�__qualname__�DEFAULT_CHARSETrBrDrFrIrJrLr\rKrar+r+r+r,r�s,!>)NNN)�__all__�	functoolsrZemail.base64mimer]Zemail.quoprimimerZemail.encodersrrHr=r&rQrfr2rTr(r.r0rrrr6rr+r+r+r,�<module>s��� ��
	
email/__pycache__/_header_value_parser.cpython-38.opt-2.pyc000064400000173047151153537650017621 0ustar00U

e5dϡ�	@s�ddlZddlZddlZddlmZddlmZddlmZ	ddlm
Z
ddlmZed�Z
e
ed�BZed	�Zee
BZeed
�Zeed�Zeed�Bed
�Zee
BZeed
�BZee
BZeed�Zdd�Ze�dejejB�ZGdd�de�ZGdd�de�ZGdd�de�Z Gdd�de�Z!Gdd�de�Z"Gdd�de�Z#Gdd�de�Z$Gd d!�d!e�Z%Gd"d#�d#e�Z&Gd$d%�d%e�Z'Gd&d'�d'e'�Z(Gd(d)�d)e�Z)Gd*d+�d+e�Z*Gd,d-�d-e�Z+Gd.d/�d/e�Z,Gd0d1�d1e�Z-Gd2d3�d3e�Z.Gd4d5�d5e�Z/Gd6d7�d7e�Z0Gd8d9�d9e�Z1Gd:d;�d;e�Z2Gd<d=�d=e�Z3Gd>d?�d?e�Z4Gd@dA�dAe�Z5GdBdC�dCe�Z6GdDdE�dEe�Z7GdFdG�dGe�Z8GdHdI�dIe�Z9GdJdK�dKe!�Z:GdLdM�dMe�Z;GdNdO�dOe�Z<GdPdQ�dQe�Z=GdRdS�dSe�Z>GdTdU�dUe>�Z?GdVdW�dWe�Z@GdXdY�dYe�ZAGdZd[�d[e�ZBGd\d]�d]e�ZCGd^d_�d_e�ZDGd`da�daeD�ZEGdbdc�dceD�ZFGddde�dee�ZGGdfdg�dge�ZHGdhdi�die�ZIGdjdk�dkeI�ZJGdldm�dmeJ�ZKGdndo�doe�ZLGdpdq�dqeM�ZNGdrds�dseN�ZOGdtdu�dueN�ZPGdvdw�dweO�ZQGdxdy�dye
jR�ZSePd
dz�ZTePd{d|�ZUePd}d~�ZVe�d�Wd��Xe
���jYZZe�d��We�[d��Xe����j\Z]e�d��j^Z_e�d��We�[d��Xe����j\Z`e�d��We�[d��Xe����j\Zae�d��We�[d��Xe����j\Zbd�d��Zcd�d��Zdd�d��Zed�d��Zfd�d��Zgd�d��Zhd�d��Zid�d��Zjd�d��Zkd�d��Zld�d��Zmd�d��Znd�d��Zod�d��Zpd�d��Zqd�d��Zrd�d��Zsd�d��Ztd�d��Zud�d��Zvd�d��Zwd�d��Zxd�d��Zyd�d��Zzd�d��Z{d�d��Z|d�d��Z}d�d��Z~d�d��Zd�d��Z�d�d��Z�d�d„Z�d�dĄZ�d�dƄZ�d�dȄZ�d�dʄZ�d�d̄Z�d�d΄Z�d�dЄZ�d�d҄Z�d�dԄZ�d�dքZ�d�d؄Z�d�dڄZ�d�d܄Z�d�dބZ�d�d�Z�d�d�Z�d�d�Z�d�d�Z�d�d�Z�d�d�Z�d�d�Z�d�d�Z�d�d�Z�d�d�Z�d�d�Z�d�d��Z�dS)��N)�	hexdigits)�
itemgetter)�_encoded_words)�errors)�utilsz 	�(z
()<>@,:;.\"[]�.z."(z/?=z*'%�%cCs dt|��dd��dd�dS)N�"�\�\\z\")�str�replace��value�r�2/usr/lib64/python3.8/email/_header_value_parser.py�quote_string`srz�
   =\?            # literal =?
   [^?]*          # charset
   \?             # literal ?
   [qQbB]         # literal 'q' or 'b', case insensitive
   \?             # literal ?
  .*?             # encoded word
  \?=             # literal ?=
cs�eZdZdZdZdZ�fdd�Zdd�Z�fdd�Ze	d	d
��Z
e	dd��Zd
d�Ze	dd��Z
e	dd��Zdd�Zddd�Zddd�Zddd�Z�ZS)�	TokenListNTcst�j||�g|_dS�N)�super�__init__�defects)�self�args�kw��	__class__rrryszTokenList.__init__cCsd�dd�|D��S)N�css|]}t|�VqdSr�r
��.0�xrrr�	<genexpr>~sz$TokenList.__str__.<locals>.<genexpr>��join�rrrr�__str__}szTokenList.__str__csd�|jjt����S�Nz{}({})��formatr�__name__r�__repr__r&rrrr,�s
�zTokenList.__repr__cCsd�dd�|D��S)Nrcss|]}|jr|jVqdSrrr rrrr#�sz"TokenList.value.<locals>.<genexpr>r$r&rrrr�szTokenList.valuecCstdd�|D�|j�S)Ncss|]}|jVqdSr)�all_defectsr rrrr#�sz(TokenList.all_defects.<locals>.<genexpr>)�sumrr&rrrr-�szTokenList.all_defectscCs|d��S�Nr)�startswith_fwsr&rrrr0�szTokenList.startswith_fwscCstdd�|D��S)Ncss|]}|jVqdSr)�
as_ew_allowed)r!�partrrrr#�sz*TokenList.as_ew_allowed.<locals>.<genexpr>)�allr&rrrr1�szTokenList.as_ew_allowedcCsg}|D]}|�|j�q|Sr)�extend�comments)rr5�tokenrrrr5�szTokenList.commentscCst||d�S)N��policy)�_refold_parse_tree�rr8rrr�fold�szTokenList.foldrcCst|j|d��dS)N��indent)�print�ppstr�rr=rrr�pprint�szTokenList.pprintcCsd�|j|d��S)N�
r<)r%�_ppr@rrrr?�szTokenList.ppstrccszd�||jj|j�V|D]4}t|d�s:|d�|�Vq|�|d�EdHq|jrdd�|j�}nd}d�||�VdS)Nz{}{}/{}(rCz*    !! invalid element in token list: {!r}z    z Defects: {}rz{}){})r*rr+�
token_type�hasattrrCr)rr=r6ZextrarrrrC�s�
�
z
TokenList._pp)r)r)r)r+�
__module__�__qualname__rD�syntactic_break�ew_combine_allowedrr'r,�propertyrr-r0r1r5r;rAr?rC�
__classcell__rrrrrss&





rc@s$eZdZedd��Zedd��ZdS)�WhiteSpaceTokenListcCsdS�N� rr&rrrr�szWhiteSpaceTokenList.valuecCsdd�|D�S)NcSsg|]}|jdkr|j�qS)�comment)rD�contentr rrr�
<listcomp>�s
z0WhiteSpaceTokenList.comments.<locals>.<listcomp>rr&rrrr5�szWhiteSpaceTokenList.commentsN)r+rFrGrJrr5rrrrrL�s
rLc@seZdZdZdS)�UnstructuredTokenList�unstructuredN�r+rFrGrDrrrrrR�srRc@seZdZdZdS)�Phrase�phraseNrTrrrrrU�srUc@seZdZdZdS)�WordZwordNrTrrrrrW�srWc@seZdZdZdS)�CFWSList�cfwsNrTrrrrrX�srXc@seZdZdZdS)�Atom�atomNrTrrrrrZ�srZc@seZdZdZdZdS)�Tokenr6FN)r+rFrGrDZencode_as_ewrrrrr\�sr\c@seZdZdZdZdZdZdS)�EncodedWord�encoded-wordN)r+rFrGrD�cte�charset�langrrrrr]�sr]c@s4eZdZdZedd��Zedd��Zedd��ZdS)	�QuotedString�
quoted-stringcCs"|D]}|jdkr|jSqdS�N�bare-quoted-string�rDr�rr"rrrrP�s
zQuotedString.contentcCs>g}|D]*}|jdkr&|�t|��q|�|j�qd�|�S)Nrer)rD�appendr
rr%)r�resr"rrr�quoted_value�s
zQuotedString.quoted_valuecCs"|D]}|jdkr|jSqdSrdrf�rr6rrr�stripped_value�s
zQuotedString.stripped_valueN)r+rFrGrDrJrPrjrlrrrrrb�s

	rbc@s$eZdZdZdd�Zedd��ZdS)�BareQuotedStringrecCstd�dd�|D���S)Nrcss|]}t|�VqdSrrr rrrr#sz+BareQuotedString.__str__.<locals>.<genexpr>)rr%r&rrrr'�szBareQuotedString.__str__cCsd�dd�|D��S)Nrcss|]}t|�VqdSrrr rrrr#sz)BareQuotedString.value.<locals>.<genexpr>r$r&rrrrszBareQuotedString.valueN)r+rFrGrDr'rJrrrrrrm�srmc@s8eZdZdZdd�Zdd�Zedd��Zedd	��Zd
S)�CommentrOcs(d�tdg�fdd��D�dggg��S)Nrrcsg|]}��|��qSr)�quoter r&rrrQsz#Comment.__str__.<locals>.<listcomp>�))r%r.r&rr&rr's��zComment.__str__cCs2|jdkrt|�St|��dd��dd��dd�S)NrOrrrz\(rpz\))rDr
r)rrrrrros
��z
Comment.quotecCsd�dd�|D��S)Nrcss|]}t|�VqdSrrr rrrr#sz"Comment.content.<locals>.<genexpr>r$r&rrrrPszComment.contentcCs|jgSr)rPr&rrrr5szComment.commentsN)	r+rFrGrDr'rorJrPr5rrrrrns
rnc@s4eZdZdZedd��Zedd��Zedd��ZdS)	�AddressListzaddress-listcCsdd�|D�S)NcSsg|]}|jdkr|�qS)�address�rDr rrrrQ's
z)AddressList.addresses.<locals>.<listcomp>rr&rrr�	addresses%szAddressList.addressescCstdd�|D�g�S)Ncss|]}|jdkr|jVqdS�rrN�rD�	mailboxesr rrrr#+s
�z(AddressList.mailboxes.<locals>.<genexpr>�r.r&rrrrw)s
��zAddressList.mailboxescCstdd�|D�g�S)Ncss|]}|jdkr|jVqdSru�rD�
all_mailboxesr rrrr#0s
�z,AddressList.all_mailboxes.<locals>.<genexpr>rxr&rrrrz.s
��zAddressList.all_mailboxesN)r+rFrGrDrJrtrwrzrrrrrq!s

rqc@s4eZdZdZedd��Zedd��Zedd��ZdS)	�AddressrrcCs|djdkr|djSdS)Nr�group�rD�display_namer&rrrr~8szAddress.display_namecCs4|djdkr|dgS|djdkr*gS|djS�Nr�mailbox�invalid-mailboxrvr&rrrrw=s

zAddress.mailboxescCs:|djdkr|dgS|djdkr0|dgS|djSrryr&rrrrzEs


zAddress.all_mailboxesN)r+rFrGrDrJr~rwrzrrrrr{4s

r{c@s(eZdZdZedd��Zedd��ZdS)�MailboxList�mailbox-listcCsdd�|D�S)NcSsg|]}|jdkr|�qS)r�rsr rrrrQSs
z)MailboxList.mailboxes.<locals>.<listcomp>rr&rrrrwQszMailboxList.mailboxescCsdd�|D�S)NcSsg|]}|jdkr|�qS))r�r�rsr rrrrQWs
�z-MailboxList.all_mailboxes.<locals>.<listcomp>rr&rrrrzUszMailboxList.all_mailboxesN�r+rFrGrDrJrwrzrrrrr�Ms

r�c@s(eZdZdZedd��Zedd��ZdS)�	GroupList�
group-listcCs |r|djdkrgS|djS�Nrr�rvr&rrrrw_szGroupList.mailboxescCs |r|djdkrgS|djSr�ryr&rrrrzeszGroupList.all_mailboxesNr�rrrrr�[s

r�c@s4eZdZdZedd��Zedd��Zedd��ZdS)	�Groupr|cCs|djdkrgS|djS�N�r�rvr&rrrrwpszGroup.mailboxescCs|djdkrgS|djSr�ryr&rrrrzvszGroup.all_mailboxescCs
|djSr/)r~r&rrrr~|szGroup.display_nameN)r+rFrGrDrJrwrzr~rrrrr�ls

r�c@sLeZdZdZedd��Zedd��Zedd��Zedd	��Zed
d��Z	dS)
�NameAddr�	name-addrcCst|�dkrdS|djS�N�r)�lenr~r&rrrr~�szNameAddr.display_namecCs
|djS�N�����
local_partr&rrrr��szNameAddr.local_partcCs
|djSr���domainr&rrrr��szNameAddr.domaincCs
|djSr�)�router&rrrr��szNameAddr.routecCs
|djSr���	addr_specr&rrrr��szNameAddr.addr_specN�
r+rFrGrDrJr~r�r�r�r�rrrrr��s



r�c@s@eZdZdZedd��Zedd��Zedd��Zedd	��Zd
S)�	AngleAddrz
angle-addrcCs"|D]}|jdkr|jSqdS�N�	addr-spec)rDr�rgrrrr��s
zAngleAddr.local_partcCs"|D]}|jdkr|jSqdSr��rDr�rgrrrr��s
zAngleAddr.domaincCs"|D]}|jdkr|jSqdS)N�	obs-route)rD�domainsrgrrrr��s
zAngleAddr.routecCs<|D]2}|jdkr|jr"|jSt|j�|jSqdS)Nr�z<>)rDr�r�rrgrrrr��s

zAngleAddr.addr_specN)	r+rFrGrDrJr�r�r�r�rrrrr��s


r�c@seZdZdZedd��ZdS)�ObsRouter�cCsdd�|D�S)NcSsg|]}|jdkr|j�qSr�r�r rrrrQ�s
z$ObsRoute.domains.<locals>.<listcomp>rr&rrrr��szObsRoute.domainsN)r+rFrGrDrJr�rrrrr��sr�c@sLeZdZdZedd��Zedd��Zedd��Zedd	��Zed
d��Z	dS)
�Mailboxr�cCs|djdkr|djSdS�Nrr�r}r&rrrr~�szMailbox.display_namecCs
|djSr/r�r&rrrr��szMailbox.local_partcCs
|djSr/r�r&rrrr��szMailbox.domaincCs|djdkr|djSdSr�)rDr�r&rrrr��sz
Mailbox.routecCs
|djSr/r�r&rrrr��szMailbox.addr_specNr�rrrrr��s



r�c@s,eZdZdZedd��ZeZZZZ	dS)�InvalidMailboxr�cCsdSrrr&rrrr~�szInvalidMailbox.display_nameNr�rrrrr��s
r�cs(eZdZdZdZe�fdd��Z�ZS)�Domainr�Fcsd�t�j���S�Nr�r%rr�splitr&rrrr��sz
Domain.domain)r+rFrGrDr1rJr�rKrrrrr��sr�c@seZdZdZdS)�DotAtom�dot-atomNrTrrrrr��sr�c@seZdZdZdZdS)�DotAtomTextz
dot-atom-textTN�r+rFrGrDr1rrrrr��sr�c@seZdZdZdZdS)�
NoFoldLiteralzno-fold-literalFNr�rrrrr�sr�c@sDeZdZdZdZedd��Zedd��Zedd��Zed	d
��Z	dS)�AddrSpecr�FcCs
|djSr/r�r&rrrr�
szAddrSpec.local_partcCst|�dkrdS|djS)N�r�)r�r�r&rrrr�szAddrSpec.domaincCs<t|�dkr|djS|dj��|dj|dj��S)Nr�rr�r�)r�r�rstrip�lstripr&rrrrs
zAddrSpec.valuecCsLt|j�}t|�t|t�kr*t|j�}n|j}|jdk	rH|d|jS|S)N�@)�setr�r��
DOT_ATOM_ENDSrr�)rZnamesetZlprrrr�s

zAddrSpec.addr_specN)
r+rFrGrDr1rJr�r�rr�rrrrr�s


r�c@seZdZdZdZdS)�ObsLocalPartzobs-local-partFNr�rrrrr�&sr�cs4eZdZdZdZedd��Ze�fdd��Z�ZS)�DisplayNamezdisplay-nameFcCs�t|�}t|�dkr|jS|djdkr4|�d�n*|ddjdkr^t|ddd��|d<|djdkrv|��n*|ddjdkr�t|ddd��|d<|jS)NrrYr�r�)rr�rrD�pop)rrirrrr~1s
zDisplayName.display_namecs�d}|jrd}n|D]}|jdkrd}qt|�dkr�|r�d}}|djdks`|ddjdkrdd}|djdks�|ddjdkr�d}|t|j�|St�jSdS)	NFTrcrrrYrNr�)rrDr�rr~rr)rror"ZpreZpostrrrrBs
  zDisplayName.value)	r+rFrGrDrIrJr~rrKrrrrr�,s
r�c@s,eZdZdZdZedd��Zedd��ZdS)�	LocalPartz
local-partFcCs&|djdkr|djS|djSdS)Nrrc)rDrjrr&rrrr[s
zLocalPart.valuecCs�tg}t}d}|dtgD]�}|jdkr,q|r\|jdkr\|djdkr\t|dd��|d<t|t�}|r�|jdkr�|djdkr�|�t|dd���n
|�|�|d}|}qt|dd��}|jS)NFrrY�dotr�r�)�DOTrDr�
isinstancerhr)rriZlastZ
last_is_tl�tokZis_tlrrrr�bs(
�
�
zLocalPart.local_partN)r+rFrGrDr1rJrr�rrrrr�Vs
r�cs4eZdZdZdZe�fdd��Zedd��Z�ZS)�
DomainLiteralzdomain-literalFcsd�t�j���Sr�r�r&rrrr�szDomainLiteral.domaincCs"|D]}|jdkr|jSqdS)N�ptextrfrgrrr�ip�s
zDomainLiteral.ip)	r+rFrGrDr1rJr�r�rKrrrrr�zsr�c@seZdZdZdZdZdS)�MIMEVersionzmime-versionN)r+rFrGrD�major�minorrrrrr��sr�c@s4eZdZdZdZdZdZedd��Zedd��Z	dS)	�	Parameter�	parameterF�us-asciicCs|jr|djSdSr�)�	sectioned�numberr&rrr�section_number�szParameter.section_numbercCsf|D]\}|jdkr|jS|jdkr|D]4}|jdkr*|D] }|jdkr<|jSq<q*qdS)Nrrcrer)rDrlrkrrr�param_value�s




zParameter.param_valueN)
r+rFrGrDr��extendedr`rJr�r�rrrrr��s
r�c@seZdZdZdS)�InvalidParameter�invalid-parameterNrTrrrrr��sr�c@seZdZdZedd��ZdS)�	Attribute�	attributecCs$|D]}|j�d�r|jSqdS)N�attrtext)rD�endswithrrkrrrrl�szAttribute.stripped_valueN�r+rFrGrDrJrlrrrrr��sr�c@seZdZdZdZdS)�Section�sectionN)r+rFrGrDr�rrrrr��sr�c@seZdZdZedd��ZdS)�ValuercCs2|d}|jdkr|d}|j�d�r,|jS|jS)NrrYr�)rcr�zextended-attribute)rDr�rlrrkrrrrl�s
�zValue.stripped_valueNr�rrrrr��sr�c@s(eZdZdZdZedd��Zdd�ZdS)�MimeParameters�mime-parametersFc
cs�i}|D]T}|j�d�sq|djdkr*q|dj��}||krHg||<||�|j|f�q|��D�]~\}}t|td�d�}|dd}|j	}|j
s�t|�dkr�|dddkr�|ddj�t
�d��|dd�}g}d}|D]�\}	}
|	|k�r(|
j
�s|
j�t
�d��q�n|
j�t
�d��|d7}|
j}|
j
�r�ztj�|�}Wn&tk
�rttjj|d	d
�}YnRXz|�|d�}Wn"tk
�r�|�dd�}YnXt�|��r�|
j�t
���|�|�q�d
�|�}||fVqfdS)Nr�rr�)�keyr�z.duplicate parameter name; duplicate(s) ignoredz+duplicate parameter name; duplicate ignoredz(inconsistent RFC2231 parameter numberingzlatin-1)�encoding�surrogateescaper�r)rDr�r�striprhr��items�sortedrr`r�r�rr�InvalidHeaderDefectr��urllib�parseZunquote_to_bytes�UnicodeEncodeErrorZunquote�decode�LookupErrorr�_has_surrogates�UndecodableBytesDefectr%)r�paramsr6�name�partsZfirst_paramr`Zvalue_parts�ir��paramrrrrr��s`�

�
�
zMimeParameters.paramscCsTg}|jD].\}}|r.|�d�|t|���q
|�|�q
d�|�}|rPd|SdS)N�{}={}z; rNr)r�rhr*rr%)rr�r�rrrrr's
zMimeParameters.__str__N)r+rFrGrDrHrJr�r'rrrrr��s

Er�c@seZdZdZedd��ZdS)�ParameterizedHeaderValueFcCs&t|�D]}|jdkr|jSqiS)Nr�)�reversedrDr�rkrrrr�-s
zParameterizedHeaderValue.paramsN)r+rFrGrHrJr�rrrrr�'sr�c@seZdZdZdZdZdZdS)�ContentTypezcontent-typeF�textZplainN)r+rFrGrDr1�maintype�subtyperrrrr�5sr�c@seZdZdZdZdZdS)�ContentDispositionzcontent-dispositionFN)r+rFrGrDr1�content_dispositionrrrrr�<sr�c@seZdZdZdZdZdS)�ContentTransferEncodingzcontent-transfer-encodingFZ7bitN)r+rFrGrDr1r_rrrrr�Bsr�c@seZdZdZdZdS)�HeaderLabelzheader-labelFNr�rrrrr�Hsr�c@seZdZdZdZdd�ZdS)�MsgIDzmsg-idFcCst|�|jSr)r
�linesepr:rrrr;Qsz
MsgID.foldN)r+rFrGrDr1r;rrrrr�Msr�c@seZdZdZdS)�	MessageIDz
message-idNrTrrrrr�Vsr�c@seZdZdZdS)�InvalidMessageIDzinvalid-message-idNrTrrrrr�Zsr�c@seZdZdZdS)�Header�headerNrTrrrrr�^sr�csreZdZdZdZdZ�fdd�Z�fdd�Zdd�Ze	dd	��Z
d�fdd�	Zd
d�Ze	dd��Z
dd�Z�ZS)�TerminalTcst��||�}||_g|_|Sr)r�__new__rDr)�clsrrDrrrrr�lszTerminal.__new__csd�|jjt����Sr(r)r&rrrr,rszTerminal.__repr__cCst|jjd|j�dS)N�/)r>rr+rDr&rrrrAuszTerminal.pprintcCs
t|j�Sr)�listrr&rrrr-xszTerminal.all_defectsrc	s2d�||jj|jt���|js"dn
d�|j��gS)Nz
{}{}/{}({}){}rz {})r*rr+rDrr,rr@rrrrC|s�zTerminal._ppcCsdSrrr&rrr�pop_trailing_ws�szTerminal.pop_trailing_wscCsgSrrr&rrrr5�szTerminal.commentscCst|�|jfSr)r
rDr&rrr�__getnewargs__�szTerminal.__getnewargs__)r)r+rFrGr1rIrHr�r,rArJr-rCr�r5rrKrrrrr�fs
	
r�c@s eZdZedd��Zdd�ZdS)�WhiteSpaceTerminalcCsdSrMrr&rrrr�szWhiteSpaceTerminal.valuecCsdS)NTrr&rrrr0�sz!WhiteSpaceTerminal.startswith_fwsN�r+rFrGrJrr0rrrrr�s
rc@s eZdZedd��Zdd�ZdS)�
ValueTerminalcCs|Srrr&rrrr�szValueTerminal.valuecCsdS)NFrr&rrrr0�szValueTerminal.startswith_fwsNrrrrrr�s
rc@s eZdZedd��Zdd�ZdS)�EWWhiteSpaceTerminalcCsdSr�rr&rrrr�szEWWhiteSpaceTerminal.valuecCsdSr�rr&rrrr'�szEWWhiteSpaceTerminal.__str__N)r+rFrGrJrr'rrrrr�s
rc@seZdZdS)�_InvalidEwErrorN)r+rFrGrrrrr�srr��,�list-separatorr�zroute-component-markerz([{}]+)rz[^{}]+z[\x00-\x20\x7F]cCs>t|�}|r|j�t�|��t�|�r:|j�t�d��dS)Nz*Non-ASCII characters found in header token)�_non_printable_finderrrhrZNonPrintableDefectrr�r�)�xtextZnon_printablesrrr�_validate_xtext�s

�r
cCs�t|d�^}}g}d}d}tt|��D]L}||dkrJ|rDd}d}nd}q&|rTd}n|||krdq||�||�q&|d}d�|�d�||d�g|�|fS)Nr�FrTr)�
_wsp_splitter�ranger�rhr%)r�endcharsZfragment�	remainderZvchars�escape�had_qp�posrrr�_get_ptext_to_endchars�s$	rcCs.|��}t|dt|�t|��d�}||fS)N�fws)r�rr�)rZnewvaluerrrr�get_fwssrc
	Cs�t�}|�d�s t�d�|���|dd��dd�^}}||dd�krXt�d�|���d�|�}t|�dkr�|dtkr�|dtkr�|�	d�dkr�|�dd�^}}|d|}t|���dkr�|j
�t�d	��||_
d�|�}zt�d|d�\}}}}	Wn*ttfk
�r*td
�|j
���YnX||_||_|j
�|	�|�r�|dtk�rrt|�\}
}|�|
��qDt|d�^}}t|d�}t|�|�|�d�|�}�qD|�r�|dtk�r�|j
�t�d��||fS)
N�=?z"expected encoded word but found {}r�z?=r�rr�?zwhitespace inside encoded wordz!encoded word format invalid: '{}'�vtextz.missing trailing whitespace after encoded-word)r]�
startswithr�HeaderParseErrorr*r�r%r�r�countrrhr�r_�_ewr��
ValueError�KeyErrorrr`rar4�WSPrrrr
)
rZewr�rZremstr�restr�r`rarr6�charsrrrr�get_encoded_wordsd
��

�
��
�

�




�r!cCsFt�}|�rB|dtkr0t|�\}}|�|�qd}|�d�r�zt|�\}}Wn,tk
rfd}Yn�tjk
rzYnrXd}t	|�dkr�|dj
dkr�|j�t�d��d}|r�t	|�dkr�|d	j
d
kr�t
|dd�|d<|�|�qt|d�^}}|�rt�|��r|�d�^}}t|d�}t|�|�|�d�|�}q|S)
NrTrFr�rz&missing whitespace before encoded wordr����r^rr)rRrrrhrr!rrrr�rDrr�rr�rfc2047_matcher�search�	partitionrr
r%)rrSr6�valid_ewZhave_wsr�rrrrr�get_unstructured?sJ


��


r'cCs*t|d�\}}}t|d�}t|�||fS)Nz()r�)rrr
�rr��_rrr�get_qp_ctext�s
r*cCs*t|d�\}}}t|d�}t|�||fS)Nr
r�)rrr
r(rrr�get_qcontent�s

r+cCsNt|�}|st�d�|���|��}|t|�d�}t|d�}t|�||fS)Nzexpected atext but found '{}'�atext)�_non_atom_end_matcherrrr*r|r�rr
)r�mr,rrr�	get_atext�s�
r/cCsr|ddkrt�d�|���t�}|dd�}|rT|ddkrTt|�\}}|�|�|�rB|ddk�rB|dtkr�t|�\}}n�|dd�dk�r*d}z&t|�\}}|j	�t�
d��d	}Wn"tjk
r�t|�\}}YnX|�r6t|�dk�r6|d
jdk�r6|djd
k�r6t
|d
d�|d
<nt|�\}}|�|�qT|�sb|j	�t�
d��||fS||dd�fS)Nrr
zexpected '"' but found '{}'r�r�rFz!encoded word inside quoted stringTr�rr"r^z"end of header inside quoted string)rrr*rmr+rhrrr!rr�r�rDr)rZbare_quoted_stringr6r&rrr�get_bare_quoted_string�sL�

���

�r0cCs�|r |ddkr t�d�|���t�}|dd�}|r�|ddkr�|dtkr\t|�\}}n&|ddkrvt|�\}}nt|�\}}|�|�q2|s�|j	�t�
d��||fS||dd�fS)Nrrzexpected '(' but found '{}'r�rpzend of header inside comment)rrr*rnrr�get_commentr*rhrr�)rrOr6rrrr1�s&�
�r1cCsPt�}|rH|dtkrH|dtkr0t|�\}}nt|�\}}|�|�q||fSr/)rX�CFWS_LEADERrrr1rh)rrYr6rrr�get_cfws�sr3cCspt�}|r,|dtkr,t|�\}}|�|�t|�\}}|�|�|rh|dtkrht|�\}}|�|�||fSr/)rbr2r3rhr0)rZ
quoted_stringr6rrr�get_quoted_strings


r4cCs�t�}|r,|dtkr,t|�\}}|�|�|rL|dtkrLt�d�|���|�d�r�zt	|�\}}Wq�tjk
r�t
|�\}}Yq�Xnt
|�\}}|�|�|r�|dtkr�t|�\}}|�|�||fS)Nrzexpected atom but found '{}'r)rZr2r3rh�	ATOM_ENDSrrr*rr!r/)rr[r6rrr�get_atoms&
�


r6cCs�t�}|r|dtkr&t�d�|���|rt|dtkrtt|�\}}|�|�|r&|ddkr&|�t�|dd�}q&|dtkr�t�d�d|���||fS)Nrz8expected atom at a start of dot-atom-text but found '{}'rr�r�z4expected atom at end of dot-atom-text but found '{}')r�r5rrr*r/rhr�)rZ
dot_atom_textr6rrr�get_dot_atom_text0s �

�r7cCs�t�}|dtkr(t|�\}}|�|�|�d�rhzt|�\}}Wqttjk
rdt|�\}}YqtXnt|�\}}|�|�|r�|dtkr�t|�\}}|�|�||fS)Nrr)	r�r2r3rhrr!rrr7)rZdot_atomr6rrr�get_dot_atomCs



r8cCs�|dtkrt|�\}}nd}|s,t�d��|ddkrFt|�\}}n*|dtkrdt�d�|���nt|�\}}|dk	r�|g|dd�<||fS)Nrz5Expected 'atom' or 'quoted-string' but found nothing.r
z1Expected 'atom' or 'quoted-string' but found '{}')r2r3rrr4�SPECIALSr*r6)r�leaderr6rrr�get_word\s"��r;cCs�t�}zt|�\}}|�|�Wn(tjk
rH|j�t�d��YnX|r�|dtkr�|ddkr�|�t�|j�t�	d��|dd�}qJzt|�\}}WnDtjk
r�|dt
kr�t|�\}}|j�t�	d��n�YnX|�|�qJ||fS)Nzphrase does not start with wordrrzperiod in 'phrase'r�zcomment found without atom)rUr;rhrrrr��PHRASE_ENDSr��ObsoleteHeaderDefectr2r3)rrVr6rrr�
get_phrase~s4
�

�
�r>cCsvt�}d}|dtkr"t|�\}}|s6t�d�|���zt|�\}}Wn^tjk
r�zt|�\}}Wn6tjk
r�|ddkr�|dtkr��t	�}YnXYnX|dk	r�|g|dd�<|�
|�|�r4|ddks�|dtk�r4tt|�|�\}}|j
dk�r|j�
t�d��n|j�
t�d��||d<z|j�d�Wn(tk
�rl|j�
t�d��YnX||fS)	Nrz"expected local-part but found '{}'r�invalid-obs-local-partz<local-part is not dot-atom, quoted-string, or obs-local-partz,local-part is not a dot-atom (contains CFWS)�asciiz)local-part contains non-ASCII characters))r�r2r3rrr*r8r;r<rrh�get_obs_local_partr
rDrr�r=r�encoder�ZNonASCIILocalPartDefect)rr�r:r6�obs_local_partrrr�get_local_part�sJ�
 
�
�
�rDcCs�t�}d}|�r(|ddks*|dtk�r(|ddkrj|rL|j�t�d��|�t�d}|dd�}q
nD|ddkr�|�t|dd��|dd�}|j�t�d	��d}q
|r�|d
jdkr�|j�t�d��zt	|�\}}d}Wn4tj
k
�r|dtk�r
�t|�\}}YnX|�|�q
|djdk�sX|djd
k�rj|djdk�rj|j�t�d��|d
jdk�s�|d
jd
k�r�|djdk�r�|j�t�d��|j�r�d|_||fS)NFrrrzinvalid repeated '.'Tr��misplaced-specialz/'\' character outside of quoted-string/ccontentr�r�zmissing '.' between wordsrYz!Invalid leading '.' in local partr"z"Invalid trailing '.' in local partr?)
r�r<rrhrr�r�rrDr;rr2r3)rrCZlast_non_ws_was_dotr6rrrrA�sj 
�
�
�
���
���
�rAcCs@t|d�\}}}t|d�}|r0|j�t�d��t|�||fS)Nz[]r�z(quoted printable found in domain-literal)rrrrhrr=r
)rr�rrrr�	get_dtext�s

�rFcCs,|rdS|�t�d��|�tdd��dS)NFz"end of input inside domain-literal�]�domain-literal-endT)rhrr�r)r�domain_literalrrr�_check_for_early_dl_ends�rJcCsjt�}|dtkr(t|�\}}|�|�|s6t�d��|ddkrRt�d�|���|dd�}t||�rp||fS|�tdd��|dt	kr�t
|�\}}|�|�t|�\}}|�|�t||�r�||fS|dt	kr�t
|�\}}|�|�t||�r�||fS|ddk�rt�d�|���|�tdd	��|dd�}|�rb|dtk�rbt|�\}}|�|�||fS)
Nrzexpected domain-literal�[z6expected '[' at start of domain-literal but found '{}'r�zdomain-literal-startrGz4expected ']' at end of domain-literal but found '{}'rH)r�r2r3rhrrr*rJrrrrF)rrIr6rrr�get_domain_literalsH

�





�
rLcCsrt�}d}|dtkr"t|�\}}|s6t�d�|���|ddkrvt|�\}}|dk	rd|g|dd�<|�|�||fSzt|�\}}Wn"tjk
r�t	|�\}}YnX|r�|ddkr�t�d��|dk	r�|g|dd�<|�|�|�rj|ddk�rj|j
�t�d��|djdk�r*|d|dd�<|�rj|ddk�rj|�t
�t	|d	d��\}}|�|��q*||fS)
Nrzexpected domain but found '{}'rKr�zInvalid Domainrz(domain is not a dot-atom (contains CFWS)r�r�)r�r2r3rrr*rLrhr8r6rr=rDr�)rr�r:r6rrr�
get_domain=sD�



�
rMcCs|t�}t|�\}}|�|�|r,|ddkrF|j�t�d��||fS|�tdd��t|dd��\}}|�|�||fS)Nrr�z#addr-spec local part with no domain�address-at-symbolr�)r�rDrhrrr�rrM)rr�r6rrr�
get_addr_speccs

�
rOcCs�t�}|rj|ddks"|dtkrj|dtkrFt|�\}}|�|�q|ddkr|�t�|dd�}q|rz|ddkr�t�d�|���|�t�t	|dd��\}}|�|�|�r>|ddk�r>|�t�|dd�}|s�q>|dtk�rt|�\}}|�|�|ddkr�|�t�t	|dd��\}}|�|�q�|�sNt�d��|ddk�rlt�d�|���|�t
dd	��||dd�fS)
Nrrr�r�z(expected obs-route domain but found '{}'z%end of header while parsing obs-route�:z4expected ':' marking end of obs-route but found '{}'zend-of-obs-route-marker)r�r2r3rh�
ListSeparatorrrr*�RouteComponentMarkerrMr)rZ	obs_router6rrr�
get_obs_routessF
�





�rScCs�t�}|dtkr(t|�\}}|�|�|r8|ddkrHt�d�|���|�tdd��|dd�}|ddkr�|�tdd��|j�t�	d��|dd�}||fSzt
|�\}}Wnztjk
�r0z"t|�\}}|j�t�d	��Wn(tjk
�rt�d
�|���YnX|�|�t
|�\}}YnX|�|�|�r^|ddk�r^|dd�}n|j�t�	d��|�tdd��|�r�|dtk�r�t|�\}}|�|�||fS)Nr�<z"expected angle-addr but found '{}'zangle-addr-startr��>zangle-addr-endznull addr-spec in angle-addrz*obsolete route specification in angle-addrz.expected addr-spec or obs-route but found '{}'z"missing trailing '>' on angle-addr)
r�r2r3rhrrr*rrr�rOrSr=)rZ
angle_addrr6rrr�get_angle_addr�sT
�
�
�
�



�
rVcCs<t�}t|�\}}|�|dd��|jdd�|_||fSr)r�r>r4r)rr~r6rrr�get_display_name�s
rWcCs�t�}d}|dtkr6t|�\}}|s6t�d�|���|ddkr�|dtkr^t�d�|���t|�\}}|s~t�d�|���|dk	r�|g|ddd�<d}|�|�t	|�\}}|dk	r�|g|dd�<|�|�||fS)Nrz!expected name-addr but found '{}'rT)
r�r2r3rrr*r<rWrhrV)rZ	name_addrr:r6rrr�
get_name_addr�s6���

rXcCs�t�}zt|�\}}WnNtjk
rdzt|�\}}Wn&tjk
r^t�d�|���YnXYnXtdd�|jD��r�d|_|�	|�||fS)Nzexpected mailbox but found '{}'css|]}t|tj�VqdSr)r�rr�r rrrr#s�zget_mailbox.<locals>.<genexpr>r�)
r�rXrrrOr*�anyr-rDrh)rr�r6rrr�get_mailbox�s ��
rZcCsdt�}|r\|d|kr\|dtkrD|�t|dd��|dd�}qt|�\}}|�|�q||fS)NrrEr�)r�r<rhrr>)rr
Zinvalid_mailboxr6rrr�get_invalid_mailboxs�r[cCs�t�}|�r�|ddk�r�zt|�\}}|�|�W�ntjk
�r<d}|dtkr�t|�\}}|rv|ddkr�|�|�|j�t�d��n@t	|d�\}}|dk	r�|g|dd�<|�|�|j�t�
d��nb|ddkr�|j�t�d��nBt	|d�\}}|dk	�r|g|dd�<|�|�|j�t�
d��YnX|�r�|ddk�r�|d}d|_t	|d�\}}|�|�|j�t�
d��|r|ddkr|�t
�|d	d�}q||fS)
Nr�;z,;zempty element in mailbox-listzinvalid mailbox in mailbox-listrr�r�r�)r�rZrhrrr2r3rr=r[r�rDr4rQ)rZmailbox_listr6r:r�rrr�get_mailbox_listsX

�

�
�


�

�
r]cCst�}|s$|j�t�d��||fSd}|r�|dtkr�t|�\}}|sl|j�t�d��|�|�||fS|ddkr�|�|�||fSt|�\}}t|j	�dkr�|dk	r�|�|�|�
|�|j�t�d��||fS|dk	r�|g|dd�<|�|�||fS)Nzend of header before group-listrzend of header in group-listr\zgroup-list with empty entries)r�rrhrr�r2r3r]r�rzr4r=)rZ
group_listr:r6rrr�get_group_listWs>
�
�




�
r^cCs t�}t|�\}}|r"|ddkr2t�d�|���|�|�|�tdd��|dd�}|r�|ddkr�|�tdd��||dd�fSt|�\}}|�|�|s�|j�t�	d��n|ddkr�t�d	�|���|�tdd��|dd�}|�r|dt
k�rt|�\}}|�|�||fS)
NrrPz8expected ':' at end of group display name but found '{}'zgroup-display-name-terminatorr�r\zgroup-terminatorzend of header in groupz)expected ';' at end of group but found {})r�rWrrr*rhrr^rr�r2r3)rr|r6rrr�	get_group|s8�


��
r_cCsxt�}zt|�\}}WnNtjk
rdzt|�\}}Wn&tjk
r^t�d�|���YnXYnX|�|�||fS)Nzexpected address but found '{}')r{r_rrrZr*rh)rrrr6rrr�get_address�s�
r`c
Cs�t�}|�r�zt|�\}}|�|�W�n tjk
�rH}z�d}|dtkr�t|�\}}|rj|ddkr�|�|�|j�t�d��nFt	|d�\}}|dk	r�|g|dd�<|�t
|g��|j�t�d��nh|ddkr�|j�t�d��nHt	|d�\}}|dk	�r|g|dd�<|�t
|g��|j�t�d��W5d}~XYnX|�r�|ddk�r�|dd}d|_t	|d�\}}|�
|�|j�t�d��|r|�tdd��|d	d�}q||fS)
Nrrz"address-list entry with no contentzinvalid address in address-listzempty element in address-listr�r�rr�)rqr`rhrrr2r3rr=r[r{r�rDr4r)rZaddress_listr6�errr:r�rrr�get_address_list�sX


�
�
�

�

�rbcCs�t�}|st�d�|���|ddkr6t�d�|���|�tdd��|dd�}t|�\}}|�|�|rx|ddkr�t�d�|���|�tdd	��||dd�fS)
Nz'expected no-fold-literal but found '{}'rrKz;expected '[' at the start of no-fold-literal but found '{}'zno-fold-literal-startr�rGz9expected ']' at the end of no-fold-literal but found '{}'zno-fold-literal-end)r�rrr*rhrrF)rZno_fold_literalr6rrr�get_no_fold_literal�s.���
��rccCs�t�}|r,|dtkr,t|�\}}|�|�|r<|ddkrLt�d�|���|�tdd��|dd�}zt|�\}}Wn`tjk
r�z"t	|�\}}|j
�t�d��Wn&tjk
r�t�d�|���YnXYnX|�|�|r�|ddk�r@|j
�t�d	��|�r8|dd
k�r8|�td
d��|dd�}||fS|�tdd��|dd�}zt|�\}}Wn�tjk
�rzt
|�\}}Wnrtjk
�r}zPz"t|�\}}|j
�t�d
��Wn(tjk
�r�t�d�|���YnXW5d}~XYnXYnX|�|�|�r6|dd
k�r6|dd�}n|j
�t�d��|�td
d��|�r�|dtk�r�t|�\}}|�|�||fS)NrrTzexpected msg-id but found '{}'zmsg-id-startr�zobsolete id-left in msg-idz4expected dot-atom-text or obs-id-left but found '{}'r�zmsg-id with no id-rightrUz
msg-id-endrNzobsolete id-right in msg-idzFexpected dot-atom-text, no-fold-literal or obs-id-right but found '{}'zmissing trailing '>' on msg-id)r�r2r3rhrrr*rr7rArr=r�rcrM)rZmsg_idr6�errr�
get_msg_ids~
�
�
��

�
�
��"

�
rec
Cs�t�}zt|�\}}|�|�WnLtjk
rl}z,t|�}t|�}|j�t�d�	|���W5d}~XYnX|r�|j�t�d�	|���|S)NzInvalid msg-id: {!r}zUnexpected {!r})
r�rerhrrr'r�rr�r*)rZ
message_idr6Zexrrr�parse_message_idIs�
�rfcCs�t�}|s |j�t�d��|S|dtkrXt|�\}}|�|�|sX|j�t�d��d}|r�|ddkr�|dtkr�||d7}|dd�}q\|��s�|j�t�d�	|���|�t
|d��nt|�|_|�t
|d	��|�r|dtk�rt|�\}}|�|�|�r|ddk�rT|jdk	�r:|j�t�d
��|�rP|�t
|d��|S|�t
dd��|dd�}|�r�|dtk�r�t|�\}}|�|�|�s�|jdk	�r�|j�t�d
��|Sd}|�r�|dtk�r�||d7}|dd�}�q�|���s*|j�t�d�	|���|�t
|d��nt|�|_
|�t
|d	��|�rn|dtk�rnt|�\}}|�|�|�r�|j�t�d
��|�t
|d��|S)Nz%Missing MIME version number (eg: 1.0)rz0Expected MIME version number but found only CFWSrrr�z1Expected MIME major version number but found {!r}r	�digitsz0Incomplete MIME version; found only major numberzversion-separatorz1Expected MIME minor version number but found {!r}z'Excess non-CFWS text after MIME version)r�rrhr�HeaderMissingRequiredValuer2r3�isdigitr�r*r�intr�r�)rZmime_versionr6rgrrr�parse_mime_versiones�
�

�
�


�

�

�


�rkcCsdt�}|r\|ddkr\|dtkrD|�t|dd��|dd�}qt|�\}}|�|�q||fS)Nrr\rEr�)r�r<rhrr>)rZinvalid_parameterr6rrr�get_invalid_parameter�s�rlcCsNt|�}|st�d�|���|��}|t|�d�}t|d�}t|�||fS)Nzexpected ttext but found '{}'�ttext)�_non_token_end_matcherrrr*r|r�rr
)rr.rmrrr�	get_ttext�s	�
rocCs�t�}|r,|dtkr,t|�\}}|�|�|rL|dtkrLt�d�|���t|�\}}|�|�|r�|dtkr�t|�\}}|�|�||fS�Nrzexpected token but found '{}')	r\r2r3rh�
TOKEN_ENDSrrr*ro)rZmtokenr6rrr�	get_token�s	
�

rrcCsNt|�}|st�d�|���|��}|t|�d�}t|d�}t|�||fS)Nz expected attrtext but found {!r}r�)�_non_attribute_end_matcherrrr*r|r�rr
�rr.r�rrr�get_attrtext�s	�
rucCs�t�}|r,|dtkr,t|�\}}|�|�|rL|dtkrLt�d�|���t|�\}}|�|�|r�|dtkr�t|�\}}|�|�||fSrp)	r�r2r3rh�ATTRIBUTE_ENDSrrr*ru�rr�r6rrr�
get_attribute�s	
�

rxcCsNt|�}|st�d�|���|��}|t|�d�}t|d�}t|�||fS)Nz)expected extended attrtext but found {!r}�extended-attrtext)�#_non_extended_attribute_end_matcherrrr*r|r�rr
rtrrr�get_extended_attrtext	s�
r{cCs�t�}|r,|dtkr,t|�\}}|�|�|rL|dtkrLt�d�|���t|�\}}|�|�|r�|dtkr�t|�\}}|�|�||fSrp)	r�r2r3rh�EXTENDED_ATTRIBUTE_ENDSrrr*r{rwrrr�get_extended_attribute!	s
�

r}cCs�t�}|r|ddkr&t�d�|���|�tdd��|dd�}|rR|d��sbt�d�|���d}|r�|d��r�||d7}|dd�}qf|ddkr�|dkr�|j�t�d	��t	|�|_
|�t|d
��||fS)Nr�*zExpected section but found {}zsection-markerr�z$Expected section number but found {}r�0z'section number has an invalid leading 0rg)r�rrr*rhrrirZInvalidHeaderErrorrjr�)rr�rgrrr�get_section7	s,	��
�
r�cCs�t�}|st�d��d}|dtkr0t|�\}}|sDt�d�|���|ddkr^t|�\}}nt|�\}}|dk	r�|g|dd�<|�|�||fS)Nz&Expected value but found end of stringrz Expected value but found only {}r
)	r�rrr2r3r*r4r}rh)r�vr:r6rrr�	get_valueU	s"
�
r�cCs�t�}t|�\}}|�|�|r,|ddkrL|j�t�d�|���||fS|ddkr�z t|�\}}d|_|�|�Wntj	k
r�YnX|s�t�	d��|ddkr�|�t
dd��|dd�}d|_|dd	kr�t�	d
��|�t
d	d��|dd�}d}|�r,|dtk�r,t
|�\}}|�|�d}|}|j�rF|�rF|ddk�rFt|�\}}|j}d
}|jdk�r�|�r�|ddk�r�d}n$t|�\}}	|	�r�|	ddk�r�d}n(zt|�\}}	WnYnX|	�s�d}|�r0|j�t�d��|�|�|D](}
|
jdk�rg|
dd�<|
}�q*�q|}nd}|j�t�d��|�r`|ddk�r`d}nt|�\}}|j�r�|jdk�r�|�r�|ddk�r�|�|�|dk	�r�|}||fS|j�t�d��|�s�|j�t�d��|�|�|dk�r�||fSn�|dk	�r@|D]}
|
jdk�r
�q$�q
|
jdk|�|
�|
j|_|ddk�r^t�	d�|���|�t
dd��|dd�}|�r�|ddk�r�t|�\}}|�|�|j|_|�r�|ddk�r�t�	d�|���|�t
dd��|dd�}|dk	�rdt�}|�r^|dtk�rt|�\}}n2|ddk�rDt
dd�}|dd�}nt|�\}}|�|��q�|}nt|�\}}|�|�|dk	�r�|}||fS)Nrr\z)Parameter contains name ({}) but no valuer~TzIncomplete parameterzextended-parameter-markerr��=zParameter not followed by '='�parameter-separatorr
F�'z5Quoted string value for extended parameter is invalidrezZParameter marked as extended but appears to have a quoted string value that is non-encodedzcApparent initial-extended-value but attribute was not marked as extended or was not initial sectionz(Missing required charset/lang delimitersryr�z=Expected RFC2231 char/lang encoding delimiter, but found {!r}zRFC2231-delimiterz;Expected RFC2231 char/lang encoding delimiter, but found {}ZDQUOTE)r�rxrhrrr�r*r�r�rrr�r2r3r4rlr�rur{rDr�rr`rar�rrr+)rr�r6r:rZappendtoZqstringZinner_valueZ
semi_validr�tr�rrr�
get_parameterk	s�
�



�


�


�
�






�
�



r�c
Csjt�}|�rfzt|�\}}|�|�Wn�tjk
r�}z�d}|dtkrVt|�\}}|sp|�|�|WY�xS|ddkr�|dk	r�|�|�|j�t�d��n@t	|�\}}|r�|g|dd�<|�|�|j�t�d�
|���W5d}~XYnX|�rD|ddk�rD|d}d|_t	|�\}}|�|�|j�t�d�
|���|r|�t
dd��|d	d�}q|S)
Nrr\zparameter entry with no contentzinvalid parameter {!r}r�r�z)parameter with invalid trailing text {!r}r�r�)r�r�rhrrr2r3rr�rlr*rDr4r)rZmime_parametersr6rar:r�rrr�parse_mime_parameters�	sJ



�

�

�r�cCs�|rV|ddkrV|dtkr>|�t|dd��|dd�}qt|�\}}|�|�q|s^dS|�tdd��|�t|dd���dS)Nrr\rEr�r�)r<rhrr>r�)Z	tokenlistrr6rrr�_find_mime_parameters-
sr�c
Cs�t�}d}|s$|j�t�d��|Szt|�\}}Wn<tjk
rp|j�t�d�|���t	||�|YSX|�|�|r�|ddkr�|j�t�d��|r�t	||�|S|j
����|_
|�tdd��|dd�}zt|�\}}Wn>tjk
�r*|j�t�d	�|���t	||�|YSX|�|�|j
����|_|�sP|S|dd
k�r�|j�t�d�|���|`
|`t	||�|S|�td
d��|�t|dd���|S)
NFz"Missing content type specificationz(Expected content maintype but found {!r}rr�zInvalid content typezcontent-type-separatorr�z'Expected content subtype but found {!r}r\z<Only parameters are valid after content type, but found {!r}r�)r�rrhrrhrrrr�r*r�rr��lowerr�rr�r�)rZctypeZrecoverr6rrr�parse_content_type_header=
sd
�
�



�

�



��
r�c
Cs�t�}|s |j�t�d��|Szt|�\}}Wn<tjk
rl|j�t�d�|���t	||�|YSX|�|�|j
����|_
|s�|S|ddkr�|j�t�d�|���t	||�|S|�tdd��|�t|dd���|S)NzMissing content dispositionz+Expected content disposition but found {!r}rr\zCOnly parameters are valid after content disposition, but found {!r}r�r�)r�rrhrrhrrrr�r*r�rr�r�r�rr�)rZdisp_headerr6rrr� parse_content_disposition_headerv
s:
�
�



��
r�c
Cs�t�}|s |j�t�d��|Szt|�\}}Wn.tjk
r^|j�t�d�|���YnX|�|�|j	�
���|_|s�|S|r�|j�t�d��|dt
kr�|�t|dd��|dd�}q�t|�\}}|�|�q�|S)Nz!Missing content transfer encodingz1Expected content transfer encoding but found {!r}z*Extra text after content transfer encodingrrEr�)r�rrhrrhrrrr�r*rr�r�r_r<rr>)rZ
cte_headerr6rrr�&parse_content_transfer_encoding_header�
s4
�
�

�r�cCsDd}|r@|dr@|ddtkr@|dd}|ddd�|d<|S)Nrr�)r)�linesZwsprrr�_steal_trailing_WSP_if_exists�
s
r�cCs�|jp
tj}|jrdnd}dg}d}d}d}tdd�}t|�}	|	�r�|	�d�}
|
|kr`|d8}q>t|
�}|
jdkr�t	|�t
@r�d	}z|�|�|}Wn6tk
r�t
d
d�|
jD��r�d}nd}d	}YnX|
jd
kr�t|
|||�q>|�r�|�s�|
j�spd}d}|
j�rp|
j|d�dt|j��}
|j|
k�rpt|
�|t|d�k�r^t|�}|�|�|d|
7<q>t|
d��s�t|
�|	}	nt|||||
j|�}d}q>t|�|t|d�k�r�|d|7<q>|
j�rt|�d|k�rt|�}|�s|
���r|�||�d}q>t|
d��sNt|
�}|
j�sD|d7}|�|�||	}	q>|
j�rn|�sn|	�d|
�d	}q>t|�}|�s�|
���r�|�||�q>|d|7<q>|j�|�|jS)N�utf-8r�rrF�wrap_as_ew_blockedr�r�Tcss|]}t|tj�VqdSr)r�rr�r rrrr#�
s�z%_refold_parse_tree.<locals>.<genexpr>�unknown-8bitr�r7r�rB)Zmax_line_length�sys�maxsize�utf8r�r�r�r
rDr�r9rBr�rYr-�_fold_mime_parametersr1rHr;r�r�r�rhrE�_fold_as_ewrIr0�insertr%)Z
parse_treer8�maxlenr�r��last_ewr�Z
want_encodingZend_ew_not_allowedr�r2�tstrr`Zencoded_part�newlineZnewpartsrrrr9�
s�


�



��
r9cCs�|dk	r<|r<tt|d|d�|��}|dd|�|d<|dtkr�|d}|dd�}t|d�|krz|�t|��|d|7<d}|dtkr�|d}|dd�}|dkr�t|d�n|}|dkr�dn|}	t|	�d}
|
d|kr�t�d��|�r�|t|d�}||
}|dk�r,|�d	�q�|d|�}
tj	|
|	d
�}t|�|}|dk�r�|
dd�}
tj	|
|	d
�}t|�|}�qR|d|7<|t|
�d�}|r�|�d	�t|d�}q�|d|7<|�r�|SdS)Nr�rr�rr�r��z3max_line_length is too small to fit an encoded wordrN)r`)
r
r'rr�rhr�rrrrB)Z	to_encoder�r�r�rIr`Zleading_wspZtrailing_wspZnew_last_ewZ	encode_as�
chrome_lenZremaining_spaceZ
text_spaceZto_encode_wordZencoded_wordZexcessrrrr�1sT��



r�c	Cs�|jD�]�\}}|d���d�s2|dd7<|}d}z|�|�d}Wn0tk
r|d}t�|�rtd}d}nd}YnX|r�tjj	|d	|d
�}	d�
|||	�}
nd�
|t|��}
t|d�t|
�d
|kr�|dd|
|d<qn"t|
�d|k�r
|�
d|
�qd}|d}|rt|�tt|��dt|�}
||
dk�rLd}||
d}}|d|�}tjj	|d	|d
�}	t|	�|k�r��q�|d
8}�q\|�
d�
||||	��d	}|d
7}||d�}|�r|dd7<�qqdS)Nr�r\�strictFTr�r�r�r)Zsaferz
{}*={}''{}r�r�rNr�rz''r��Nz {}*{}*={}{})r�r�r�rBr�rr�r�r�ror*rr�rhr
)r2r�r�r�r�rr`Z
error_handlerZencoding_requiredZ
encoded_valuer�r�Zextra_chromer�Z
splitpointZmaxchars�partialrrrr�rsn


� ��r�)��rer�r��stringr�operatorrZemailrrrrr�rr2r9r5r�r<Z	TSPECIALSrqZ	ASPECIALSrvr|r�compile�VERBOSE�	MULTILINEr#r�rrLrRrUrWrXrZr\r]rbrmrnrqr{r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r
r�rrrrrr�rQrRr*r%r�rr�matchr-�findallrrnrsrzr
rrr!r'r*r+r/r0r1r3r4r6r7r8r;r>rDrArFrJrLrMrOrSrVrWrXrZr[r]r^r_r`rbrcrerfrkrlrorrrurxr{r}r�r�r�r�r�r�r�r�r�r9r�r�rrrr�<module>Fs,
�C"	
!*$
V	+





����
1C+
"&'/'&).9%7ED49/gAemail/__pycache__/headerregistry.cpython-38.opt-2.pyc000064400000037547151153537650016507 0ustar00U

e5dKQ�@svddlmZddlmZddlmZddlmZGdd�d�ZGdd�d�ZGd	d
�d
e	�Z
dd�ZGd
d�d�ZGdd�de�Z
Gdd�d�ZGdd�de�ZGdd�d�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�d�ZGdd �d �ZGd!d"�d"e�ZGd#d$�d$e�ZGd%d&�d&�ZGd'd(�d(�Ze
eeeeeeeeeeeeeeeeeeed)�ZGd*d+�d+�Zd,S)-�)�MappingProxyType)�utils)�errors)�_header_value_parserc@s^eZdZddd�Zedd��Zedd��Zed	d
��Zedd��Zd
d�Z	dd�Z
dd�ZdS)�Address�NcCs�d�td||||f��}d|ks(d|kr0td��|dk	r�|s@|rHtd��t�|�\}}|rjtd�||���|jrz|jd�|j}|j	}||_
||_||_dS)Nr�
�
z8invalid arguments; address parts cannot contain CR or LFz=addrspec specified when username and/or domain also specifiedz6Invalid addr_spec; only '{}' could be parsed from '{}'r)
�join�filter�
ValueError�	TypeError�parserZ
get_addr_spec�format�all_defects�
local_part�domain�
_display_name�	_username�_domain)�self�display_name�usernamer�	addr_specZinputsZa_s�rest�r�,/usr/lib64/python3.8/email/headerregistry.py�__init__s&�
zAddress.__init__cCs|jS�N�r�rrrrr<szAddress.display_namecCs|jSr)rr rrrr@szAddress.usernamecCs|jSr)rr rrrrDszAddress.domaincCsTt|j�}t|�t|tj�kr.t�|j�}n|j}|jrH|d|jS|sPdS|S)N�@�<>)�setr�lenrZ
DOT_ATOM_ENDS�quote_stringr)r�namesetZlprrrrHs
zAddress.addr_speccCsd�|jj|j|j|j�S)Nz1{}(display_name={!r}, username={!r}, domain={!r}))r�	__class__�__name__rrrr rrr�__repr__Xs�zAddress.__repr__cCs^t|j�}t|�t|tj�kr.t�|j�}n|j}|rX|jdkrFdn|j}d�||�S|jS)Nr"rz{} <{}>)r#rr$r�SPECIALSr%rr)rr&�disprrrr�__str__]s
zAddress.__str__cCs8t|�t|�krdS|j|jko6|j|jko6|j|jkS�NF)�typerrr�r�otherrrr�__eq__hs
�
�zAddress.__eq__)rrrN)r(�
__module__�__qualname__r�propertyrrrrr)r,r1rrrrrs
*



rc@sFeZdZddd�Zedd��Zedd��Zdd	�Zd
d�Zdd
�Z	dS)�GroupNcCs||_|rt|�nt�|_dSr)r�tuple�
_addresses)rr�	addressesrrrrrszGroup.__init__cCs|jSrrr rrrr�szGroup.display_namecCs|jSr)r7r rrrr8�szGroup.addressescCsd�|jj|j|j�S)Nz${}(display_name={!r}, addresses={!r})rr'r(rr8r rrrr)�s
�zGroup.__repr__cCs�|jdkr&t|j�dkr&t|jd�S|j}|dk	r\t|�}t|�t|tj�kr\t�|�}d�dd�|jD��}|r~d|n|}d�	||�S)N�r�, css|]}t|�VqdSr��str)�.0�xrrr�	<genexpr>�sz Group.__str__.<locals>.<genexpr>� z{}:{};)
rr$r8r<r#rr*r%r
r)rr+r&Zadrstrrrrr,�s
z
Group.__str__cCs,t|�t|�krdS|j|jko*|j|jkSr-)r.rr8r/rrrr1�s

�zGroup.__eq__)NN)
r(r2r3rr4rr8r)r,r1rrrrr5ps


r5c@sPeZdZdd�Zdd�Zedd��Zedd��Zd	d
�Ze	dd��Z
d
d�ZdS)�
BaseHeadercCs\dgi}|�||�t�|d�r4t�|d�|d<t�||d�}|d=|j|f|�|S)N�defects�decoded)�parserZ_has_surrogates�	_sanitizer<�__new__�init)�cls�name�value�kwdsrrrrrF�szBaseHeader.__new__cCs||_||_||_dSr)�_name�_parse_tree�_defects)rrI�
parse_treerBrrrrG�szBaseHeader.initcCs|jSr)rLr rrrrI�szBaseHeader.namecCs
t|j�Sr)r6rNr rrrrB�szBaseHeader.defectscCst|jj|jjt|�f|jfSr)�_reconstruct_headerr'r(�	__bases__r<�__dict__r rrr�
__reduce__�s��zBaseHeader.__reduce__cCst�||�Sr)r<rF)rHrJrrr�_reconstruct�szBaseHeader._reconstructc	Cs`t�t�t�|jd�t�dd�g�g�}|jrH|�t�t�dd�g��|�|j�|j	|d�S)Nzheader-name�:z
header-sepr@Zfws)�policy)
rZHeaderZHeaderLabelZ
ValueTerminalrIrM�appendZCFWSListZWhiteSpaceTerminal�fold)rrV�headerrrrrX�s
���zBaseHeader.foldN)r(r2r3rFrGr4rIrBrS�classmethodrTrXrrrrrA�s"




rAcCst||i��|�Sr)r.rT)Zcls_name�basesrJrrrrP
srPc@s&eZdZdZeej�Zedd��Z	dS)�UnstructuredHeaderNcCs"|�|�|d<t|d�|d<dS)NrOrC)�value_parserr<�rHrJrKrrrrDszUnstructuredHeader.parse)
r(r2r3�	max_count�staticmethodr�get_unstructuredr]rZrDrrrrr\s
r\c@seZdZdZdS)�UniqueUnstructuredHeaderr9N�r(r2r3r_rrrrrbsrbcsBeZdZdZeej�Zedd��Z	�fdd�Z
edd��Z�Z
S)�
DateHeaderNcCsz|s6|d�t���d|d<d|d<t��|d<dSt|t�rJt�|�}||d<t�	|d�|d<|�
|d�|d<dS)NrB�datetimerrCrO)rWrZHeaderMissingRequiredValuerZ	TokenList�
isinstancer<rZparsedate_to_datetimeZformat_datetimer]r^rrrrD.s

zDateHeader.parsecs|�d�|_t�j||�dS)Nre)�pop�	_datetime�superrG�r�args�kw�r'rrrG<szDateHeader.initcCs|jSr)rhr rrrre@szDateHeader.datetime)r(r2r3r_r`rrar]rZrDrGr4re�
__classcell__rrrmrrds


rdc@seZdZdZdS)�UniqueDateHeaderr9NrcrrrrroEsrocsPeZdZdZedd��Zedd��Z�fdd�Ze	dd	��Z
e	d
d��Z�ZS)�
AddressHeaderNcCst�|�\}}|Sr)rZget_address_list)rJ�address_listrrrr]NszAddressHeader.value_parsercCs�t|t�rV|�|�|d<}g}|jD]"}|�t|jdd�|jD���q&t|j	�}n"t
|d�sf|g}dd�|D�}g}||d<||d<d�d	d�|D��|d
<d|kr�|�|d
�|d<dS)NrOcSs*g|]"}t|jpd|jpd|jp"d��qS)r)rrrr)r=Zmbrrr�
<listcomp>]s
�
�z'AddressHeader.parse.<locals>.<listcomp>�__iter__cSs&g|]}t|d�std|g�n|�qS)r8N)�hasattrr5�r=�itemrrrrrfs��groupsrBr:cSsg|]}t|��qSrr;rurrrrrlsrC)rfr<r]r8rWr5rZ
all_mailboxes�listrrtr
)rHrJrKrqrwZaddrrBrrrrDTs*


��
�zAddressHeader.parsecs(t|�d��|_d|_t�j||�dS)Nrw)r6rg�_groupsr7rirGrjrmrrrGpszAddressHeader.initcCs|jSr)ryr rrrrwuszAddressHeader.groupscCs&|jdkr tdd�|jD��|_|jS)Ncss|]}|jD]
}|VqqdSr)r8)r=�group�addressrrrr?|s�z*AddressHeader.addresses.<locals>.<genexpr>)r7r6ryr rrrr8ys
zAddressHeader.addresses)
r(r2r3r_r`r]rZrDrGr4rwr8rnrrrmrrpJs


rpc@seZdZdZdS)�UniqueAddressHeaderr9Nrcrrrrr|�sr|c@seZdZedd��ZdS)�SingleAddressHeadercCs(t|j�dkrtd�|j���|jdS)Nr9z9value of single address header {} is not a single addressr)r$r8rrrIr rrrr{�s
�zSingleAddressHeader.addressN)r(r2r3r4r{rrrrr}�sr}c@seZdZdZdS)�UniqueSingleAddressHeaderr9Nrcrrrrr~�sr~csZeZdZdZeej�Zedd��Z	�fdd�Z
edd��Zedd	��Z
ed
d��Z�ZS)�MIMEVersionHeaderr9cCs�|�|�|d<}t|�|d<|d�|j�|jdkr<dn|j|d<|j|d<|jdk	rtd�|d|d�|d<nd|d<dS)NrOrCrB�major�minorz{}.{}�version)r]r<�extendrr�r�r�rHrJrKrOrrrrD�s

zMIMEVersionHeader.parsecs6|�d�|_|�d�|_|�d�|_t�j||�dS)Nr�r�r�)rg�_version�_major�_minorrirGrjrmrrrG�szMIMEVersionHeader.initcCs|jSr)r�r rrrr��szMIMEVersionHeader.majorcCs|jSr)r�r rrrr��szMIMEVersionHeader.minorcCs|jSr)r�r rrrr��szMIMEVersionHeader.version)r(r2r3r_r`rZparse_mime_versionr]rZrDrGr4r�r�r�rnrrrmrr�s



rcs8eZdZdZedd��Z�fdd�Zedd��Z�Z	S)�ParameterizedMIMEHeaderr9cCsZ|�|�|d<}t|�|d<|d�|j�|jdkrBi|d<ndd�|jD�|d<dS)NrOrCrB�paramscSs&i|]\}}t�|���t�|��qSr)rrE�lower)r=rIrJrrr�
<dictcomp>�s�z1ParameterizedMIMEHeader.parse.<locals>.<dictcomp>)r]r<r�rr�r�rrrrD�s

�zParameterizedMIMEHeader.parsecs|�d�|_t�j||�dS)Nr�)rg�_paramsrirGrjrmrrrG�szParameterizedMIMEHeader.initcCs
t|j�Sr)rr�r rrrr��szParameterizedMIMEHeader.params)
r(r2r3r_rZrDrGr4r�rnrrrmrr��s
r�csJeZdZeej�Z�fdd�Zedd��Z	edd��Z
edd��Z�ZS)	�ContentTypeHeadercs2t�j||�t�|jj�|_t�|jj�|_dSr)	rirGrrErM�maintype�	_maintype�subtype�_subtyperjrmrrrG�szContentTypeHeader.initcCs|jSr)r�r rrrr��szContentTypeHeader.maintypecCs|jSr)r�r rrrr��szContentTypeHeader.subtypecCs|jd|jS)N�/)r�r�r rrr�content_type�szContentTypeHeader.content_type)
r(r2r3r`rZparse_content_type_headerr]rGr4r�r�r�rnrrrmrr��s


r�cs2eZdZeej�Z�fdd�Zedd��Z	�Z
S)�ContentDispositionHeadercs2t�j||�|jj}|dkr"|nt�|�|_dSr)rirGrM�content_dispositionrrE�_content_disposition)rrkrlZcdrmrrrG�szContentDispositionHeader.initcCs|jSr)r�r rrrr��sz,ContentDispositionHeader.content_disposition)r(r2r3r`rZ parse_content_disposition_headerr]rGr4r�rnrrrmrr��s
r�csBeZdZdZeej�Zedd��Z	�fdd�Z
edd��Z�Z
S)�ContentTransferEncodingHeaderr9cCs2|�|�|d<}t|�|d<|d�|j�dS�NrOrCrB�r]r<r�rr�rrrrDsz#ContentTransferEncodingHeader.parsecs"t�j||�t�|jj�|_dSr)rirGrrErM�cte�_cterjrmrrrGsz"ContentTransferEncodingHeader.initcCs|jSr)r�r rrrr�sz!ContentTransferEncodingHeader.cte)r(r2r3r_r`rZ&parse_content_transfer_encoding_headerr]rZrDrGr4r�rnrrrmrr��s

r�c@s&eZdZdZeej�Zedd��Z	dS)�MessageIDHeaderr9cCs2|�|�|d<}t|�|d<|d�|j�dSr�r�r�rrrrDszMessageIDHeader.parseN)
r(r2r3r_r`rZparse_message_idr]rZrDrrrrr�s
r�)Zsubject�datezresent-datez	orig-dateZsenderz
resent-sender�toz	resent-toZccz	resent-ccZbccz
resent-bcc�fromzresent-fromzreply-tozmime-versionzcontent-typezcontent-dispositionzcontent-transfer-encodingz
message-idc@s4eZdZeedfdd�Zdd�Zdd�Zdd	�Zd
S)�HeaderRegistryTcCs&i|_||_||_|r"|j�t�dSr)�registry�
base_class�
default_class�update�_default_header_map)rr�r�Zuse_default_maprrrr9s
zHeaderRegistry.__init__cCs||j|��<dSr)r�r��rrIrHrrr�map_to_typeKszHeaderRegistry.map_to_typecCs,|j�|��|j�}td|j||jfi�S)N�_)r��getr�r�r.r(r�r�rrr�__getitem__QszHeaderRegistry.__getitem__cCs||||�Srr)rrIrJrrr�__call__Us
zHeaderRegistry.__call__N)	r(r2r3rAr\rr�r�r�rrrrr�5s�
r�N)�typesrZemailrrrrrr5r<rArPr\rbrdrorpr|r}r~rr�r�r�r�r�r�r�rrrr�<module>
sV`6d'7
%�email/__pycache__/utils.cpython-38.opt-1.pyc000064400000022510151153537650014605 0ustar00U

e5d�4�@sjdZddddddddd	d
ddd
ddgZddlZddlZddlZddlZddlZddlZddlZ	ddl
mZddl
mZ
ddl
mZddl
mZmZmZddlmZdZdZdZdZdZe�d�Ze�d�Zdd�Zdd �Zd7d"d�Zd#d�Zd$d%�Z d8d'd�Z!d9d(d�Z"d:d)d	�Z#d*d�Z$d+d�Z%d,d�Z&d-d�Z'd;d.d�Z(e�d/ej)�Z*d0d�Z+d<d3d�Z,d=d5d6�Z-dS)>zMiscellaneous utilities.�collapse_rfc2231_value�
decode_params�decode_rfc2231�encode_rfc2231�
formataddr�
formatdate�format_datetime�getaddresses�
make_msgid�	mktime_tz�	parseaddr�	parsedate�parsedate_tz�parsedate_to_datetime�unquote�N)�quote)�AddressList)r
)rr
�
_parsedate_tz)�Charsetz, �z
�'z[][\\()<>@,:;".]z[\\"]cCs*z|��WdStk
r$YdSXdS)z8Return True if s contains surrogate-escaped binary data.FTN)�encode�UnicodeEncodeError)�s�r�#/usr/lib64/python3.8/email/utils.py�_has_surrogates3s
rcCs|�dd�}|�dd�S)N�utf-8�surrogateescape�replace)r�decode)�stringZoriginal_bytesrrr�	_sanitize@sr"rcCs�|\}}|�d�|r�z|�d�Wn<tk
r`t|t�rFt|�}|�|�}d||fYSXd}t�|�rtd}t�	d|�}d||||fS|S)a�The inverse of parseaddr(), this takes a 2-tuple of the form
    (realname, email_address) and returns the string value suitable
    for an RFC 2822 From, To or Cc header.

    If the first element of pair is false, then the second element is
    returned unmodified.

    The optional charset is the character set that is used to encode
    realname in case realname is not ASCII safe.  Can be an instance of str or
    a Charset-like object which has a header_encode method.  Default is
    'utf-8'.
    �asciiz%s <%s>r�"z\\\g<0>z%s%s%s <%s>)
rr�
isinstance�strrZ
header_encode�
specialsre�search�	escapesre�sub)Zpair�charset�nameZaddressZencoded_nameZquotesrrrrLs 




cCst�|�}t|�}|jS)z7Return a list of (REALNAME, EMAIL) for each fieldvalue.)�
COMMASPACE�join�_AddressList�addresslist)Zfieldvalues�all�arrrrns
cCsfddddddddg|d	|d
ddd
dddddddddg|dd|d|d|d|d|fS)Nz"%s, %02d %s %04d %02d:%02d:%02d %sZMonZTueZWedZThuZFriZSatZSun��ZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDec�r���r)�	timetuple�zonerrr�_format_timetuple_and_zoneus&�
��r;FcCsR|dkrt��}|s|r,tj�|tjj�}ntj�|�}|rH|��}d}t||�S)a�Returns a date string as specified by RFC 2822, e.g.:

    Fri, 09 Nov 2001 01:08:47 -0000

    Optional timeval if given is a floating point time value as accepted by
    gmtime() and localtime(), otherwise the current time is used.

    Optional localtime is a flag that when True, interprets timeval, and
    returns a date relative to the local timezone instead of UTC, properly
    taking daylight savings time into account.

    Optional argument usegmt means that the timezone is written out as
    an ascii string, not numeric one (so "GMT" instead of "+0000"). This
    is needed for HTTP, and is only used when localtime==False.
    NF)�time�datetimeZ
fromtimestamp�timezone�utcZutcfromtimestamp�
astimezoner)�timeval�	localtime�usegmt�dtrrrr~scCsV|��}|r2|jdks$|jtjjkr,td��d}n|jdkrBd}n
|�d�}t||�S)a$Turn a datetime into a date string as specified in RFC 2822.

    If usegmt is True, dt must be an aware datetime with an offset of zero.  In
    this case 'GMT' will be rendered instead of the normal +0000 required by
    RFC2822.  This is to support HTTP headers involving date stamps.
    Nz%usegmt option requires a UTC datetimeZGMTz-0000z%z)r9�tzinfor=r>r?�
ValueError�strftimer;)rDrC�nowr:rrrr�s

cCs^tt��d�}t��}t�d�}|dkr0d}nd|}|dkrHt��}d|||||f}|S)a{Returns a string suitable for RFC 2822 compliant Message-ID, e.g:

    <142480216486.20800.16526388040877946887@nightshade.la.mastaler.com>

    Optional idstring if given is a string used to strengthen the
    uniqueness of the message id.  Optional domain if given provides the
    portion of the message id after the '@'.  It defaults to the locally
    defined hostname.
    �d�@Nr�.z<%d.%d.%d%s@%s>)�intr<�os�getpid�randomZgetrandbits�socketZgetfqdn)ZidstringZdomainrA�pidZrandintZmsgidrrrr	�s

cCsNt|��^}}|dkr(tj|dd��Stj|dd�dt�tj|d��i�S)Nr3rE��seconds)rr=r>�	timedelta)�dataZdtuple�tzrrrr�s�cCst|�j}|sdS|dS)z�
    Parse addr into its constituent realname and email address parts.

    Return a tuple of realname and email address, unless the parse fails, in
    which case return a 2-tuple of ('', '').
    )rrr)r/r0)ZaddrZaddrsrrrr�s
cCs`t|�dkr\|�d�r<|�d�r<|dd��dd��dd�S|�d�r\|�d�r\|dd�S|S)	zRemove quotes from a string.r5r$���z\\�\z\"�<�>)�len�
startswith�endswithr)r&rrrr�scCs&|�td�}t|�dkr"dd|fS|S)z#Decode string according to RFC 2231r4N)�split�TICKr[)r�partsrrrr�s
cCsDtjj|d|pdd�}|dkr*|dkr*|S|dkr6d}d|||fS)z�Encode string according to RFC 2231.

    If neither charset nor language is given, then s is returned as-is.  If
    charset is given but not language, the string is encoded using the empty
    string for language.
    rr#)Zsafe�encodingNz%s'%s'%s)�urllib�parser)rr+�languagerrrr�sz&^(?P<name>\w+)\*((?P<num>[0-9]+)\*?)?$c
Csl|dd�}g}i}|�d�\}}|�||f�|r�|�d�\}}|�d�rRd}nd}t|�}t�|�}|r�|�dd�\}}|dk	r�t|�}|�|g��|||f�q0|�|dt	|�f�q0|�rh|�
�D]�\}}g}d}	|��|D].\}}
}|�rtj
j|
d	d
�}
d}	|�|
�q�t	t�|��}|	�rTt|�\}}}|�|||d|ff�q�|�|d|f�q�|S)zDecode parameters list according to RFC 2231.

    params is a sequence of 2-tuples containing (param name, string value).
    Nr�*TFr,�numz"%s"zlatin-1)ra)�pop�appendr]r�rfc2231_continuation�match�grouprL�
setdefaultr�items�sortrbrc�EMPTYSTRINGr.r)
ZparamsZ
new_paramsZrfc2231_paramsr,�valueZencodedZmorfZ
continuationsZextendedrr+rdrrrrsD

r�us-asciicCsnt|t�rt|�dkrt|�S|\}}}|dkr4|}t|d�}zt|||�WStk
rht|�YSXdS)Nr6zraw-unicode-escape)r%�tupler[r�bytesr&�LookupError)rp�errorsZfallback_charsetr+rd�textZrawbytesrrrr9s

rWc	Cs|dkrtj�tjj���S|jdk	r.|��S|��dd�|f}t�|�}t�	|�}z tj
|jd�}t�||j�}Wn�t
k
r�|tjt�|�dd��}tjo�|jdk}|r�tjntj}|tj
|d�kr�t�|tj|�}n
t�|�}YnX|j|d�S)a�Return local time as an aware datetime object.

    If called without arguments, return current time.  Otherwise *dt*
    argument should be a datetime instance, and it is converted to the
    local time zone according to the system time zone database.  If *dt* is
    naive (that is, dt.tzinfo is None), it is assumed to be in local time.
    In this case, a positive or zero value for *isdst* causes localtime to
    presume initially that summer time (for example, Daylight Saving Time)
    is or is not (respectively) in effect for the specified time.  A
    negative value for *isdst* causes the localtime() function to attempt
    to divine whether summer time is in effect for the specified time.

    NrWrRr3r)rE)r=rHr>r?r@rEr9r<�mktimerBrT�	tm_gmtoff�tm_zone�AttributeError�gmtime�daylight�tm_isdst�altzone�tznamer)	rDZisdstZtmrSZlocaltmZdeltarVZdstZgmtoffrrrrBSs$


rB)r)NFF)F)NN)NN)rrq)NrW).�__doc__�__all__rM�rer<rOrPr=Zurllib.parserbZemail._parseaddrrrr/r
rr
rZ
email.charsetrr-roZUEMPTYSTRINGZCRLFr_�compiler'r)rr"rrr;rrr	rrrrr�ASCIIrirrrBrrrr�<module>sp�



"	



�8�
email/__pycache__/errors.cpython-38.opt-2.pyc000064400000010573151153537650014770 0ustar00U

e5d?�@s�Gdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd	�d	ee�ZGd
d�de�ZGdd
�d
e�Z	Gdd�de	�Z
Gdd�de	�ZGdd�de	�ZGdd�de	�Z
Gdd�de	�ZGdd�de	�ZeZGdd�de	�ZGdd�de	�ZGdd�de	�ZGd d!�d!e	�ZGd"d#�d#e	�ZGd$d%�d%e	�ZGd&d'�d'e	�ZGd(d)�d)e�ZGd*d+�d+e�ZGd,d-�d-e�ZGd.d/�d/e�ZGd0d1�d1e�Zd2S)3c@seZdZdS)�MessageErrorN��__name__�
__module__�__qualname__�rr�$/usr/lib64/python3.8/email/errors.pyrsrc@seZdZdS)�MessageParseErrorNrrrrrrsrc@seZdZdS)�HeaderParseErrorNrrrrrr	sr	c@seZdZdS)�
BoundaryErrorNrrrrrr
sr
c@seZdZdS)�MultipartConversionErrorNrrrrrrsrc@seZdZdS)�CharsetErrorNrrrrrrsrcseZdZd�fdd�	Z�ZS)�
MessageDefectNcs|dk	rt��|�||_dS�N)�super�__init__�line)�selfr��	__class__rrr$szMessageDefect.__init__)N�rrrr�
__classcell__rrrrr
!sr
c@seZdZdS)�NoBoundaryInMultipartDefectNrrrrrr)src@seZdZdS)�StartBoundaryNotFoundDefectNrrrrrr,src@seZdZdS)�CloseBoundaryNotFoundDefectNrrrrrr/src@seZdZdS)�#FirstHeaderLineIsContinuationDefectNrrrrrr2src@seZdZdS)�MisplacedEnvelopeHeaderDefectNrrrrrr5src@seZdZdS)� MissingHeaderBodySeparatorDefectNrrrrrr8src@seZdZdS)�!MultipartInvariantViolationDefectNrrrrrr=src@seZdZdS)�-InvalidMultipartContentTransferEncodingDefectNrrrrrr@src@seZdZdS)�UndecodableBytesDefectNrrrrrrCsrc@seZdZdS)�InvalidBase64PaddingDefectNrrrrrr Fsr c@seZdZdS)�InvalidBase64CharactersDefectNrrrrrr!Isr!c@seZdZdS)�InvalidBase64LengthDefectNrrrrrr"Lsr"cseZdZ�fdd�Z�ZS)�HeaderDefectcst�j||�dSr)rr)r�args�kwrrrrTszHeaderDefect.__init__rrrrrr#Qsr#c@seZdZdS)�InvalidHeaderDefectNrrrrrr&Wsr&c@seZdZdS)�HeaderMissingRequiredValueNrrrrrr'Zsr'cs$eZdZ�fdd�Zdd�Z�ZS)�NonPrintableDefectcst��|�||_dSr)rr�non_printables)rr)rrrr`szNonPrintableDefect.__init__cCsd�|j�S)Nz6the following ASCII non-printables found in header: {})�formatr))rrrr�__str__ds�zNonPrintableDefect.__str__)rrrrr+rrrrrr(]sr(c@seZdZdS)�ObsoleteHeaderDefectNrrrrrr,hsr,c@seZdZdS)�NonASCIILocalPartDefectNrrrrrr-ksr-N)�	Exceptionrrr	r
�	TypeErrorrr�
ValueErrorr
rrrrrrZMalformedHeaderDefectrrrr r!r"r#r&r'r(r,r-rrrr�<module>s2email/__pycache__/base64mime.cpython-38.pyc000064400000006245151153537650014451 0ustar00U

e5d�
�@stdZddddddgZddlmZdd	lmZmZd
ZdZdZ	d
Z
dd�Zddd�Zdefdd�Z
dd�ZeZeZdS)a�Base64 content transfer encoding per RFCs 2045-2047.

This module handles the content transfer encoding method defined in RFC 2045
to encode arbitrary 8-bit data using the three 8-bit bytes in four 7-bit
characters encoding known as Base64.

It is used in the MIME standards for email to attach images, audio, and text
using some 8-bit character sets to messages.

This module provides an interface to encode and decode both headers and bodies
with Base64 encoding.

RFC 2045 defines a method for including character set information in an
`encoded-word' in a header.  This method is commonly used for 8-bit real names
in To:, From:, Cc:, etc. fields, as well as Subject: lines.

This module does not do the line wrapping or end-of-line character conversion
necessary for proper internationalized headers; it only does dumb encoding and
decoding.  To deal with the various line wrapping issues, use the email.header
module.
�body_decode�body_encode�decode�decodestring�
header_encode�
header_length�)�	b64encode)�
b2a_base64�
a2b_base64z
�
��cCs*tt|�d�\}}|d}|r&|d7}|S)z6Return the length of s when it is encoded with base64.��)�divmod�len)�	bytearrayZgroups_of_3Zleftover�n�r�(/usr/lib64/python3.8/email/base64mime.pyr2s
�
iso-8859-1cCs6|sdSt|t�r|�|�}t|��d�}d||fS)z�Encode a single header line with Base64 encoding in a given charset.

    charset names the character set to use to encode the header.  It defaults
    to iso-8859-1.  Base64 encoding is defined in RFC 2045.
    r�asciiz=?%s?b?%s?=)�
isinstance�str�encoderr)Zheader_bytes�charsetZencodedrrrr=s

�LcCs~|s|Sg}|dd}tdt|�|�D]J}t||||���d�}|�t�rh|tkrh|dd�|}|�|�q(t�|�S)a1Encode a string with base64.

    Each line will be wrapped at, at most, maxlinelen characters (defaults to
    76 characters).

    Each line of encoded text will end with eol, which defaults to "\n".  Set
    this to "\r\n" if you will be using the result of this function directly
    in an email.
    rrrrN���)	�rangerr	r�endswith�NL�append�EMPTYSTRING�join)�sZ
maxlinelenZeolZencvecZ
max_unencoded�i�encrrrrLs
cCs.|s
t�St|t�r"t|�d��St|�SdS)z�Decode a raw base64 string, returning a bytes object.

    This function does not parse a full MIME header value encoded with
    base64 (like =?iso-8859-1?b?bmloISBuaWgh?=) -- please use the high
    level email.header class for that functionality.
    zraw-unicode-escapeN)�bytesrrr
r)�stringrrrrfs

N)r)�__doc__�__all__�base64rZbinasciir	r
ZCRLFr r"ZMISC_LENrrrrrrrrrr�<module>s&�

email/__pycache__/_encoded_words.cpython-38.pyc000064400000013070151153537650015465 0ustar00U

e5dL!�@s�dZddlZddlZddlZddlZddlmZmZddlm	Z	ddddd	d
ddgZ
e�e�d
�j
dd��Zdd�ZGdd�de�Ze�Zdeed�<dd�Zdd	�Zdd�Zdd�Zdd
�Zeed�Zdd�Zeed�Zeed�Zddd�ZdS) z� Routines for manipulating RFC2047 encoded words.

This is currently a package-private API, but will be considered for promotion
to a public API if there is demand.

�N)�
ascii_letters�digits)�errors�decode_q�encode_q�decode_b�encode_b�len_q�len_b�decode�encodes=([a-fA-F0-9]{2})cCst�|�d����S)N�)�bytes�fromhex�groupr)�m�r�,/usr/lib64/python3.8/email/_encoded_words.py�<lambda>A�rcCs|�dd�}t|�gfS)N�_� )�replace�_q_byte_subber)�encodedrrrrCsc@s,eZdZde�d�e�d�Zdd�ZdS)�	_QByteMaps-!*+/�asciicCs.||jkrt|�||<nd�|�||<||S)Nz={:02X})�safe�chr�format)�self�keyrrr�__missing__Ms
z_QByteMap.__missing__N)�__name__�
__module__�__qualname__rrrrr"rrrrrIsr�_� cCsd�dd�|D��S)N�css|]}t|VqdS�N)�_q_byte_map��.0�xrrr�	<genexpr>Zszencode_q.<locals>.<genexpr>)�join��bstringrrrrYscCstdd�|D��S)Ncss|]}tt|�VqdSr))�lenr*r+rrrr.]szlen_q.<locals>.<genexpr>)�sumr0rrrr	\scCs�t|�d}|r ddd|�nd}z&tj||dd�|rDt��gngfWStjk
�r�ztj|dd�t��gfWYStjk
r�z,tj|ddd�t��t��gfWYYStjk
r�|t��gfYYYSXYnXYnXdS)N�s===rT)ZvalidateFs==)	r2�base64Z	b64decoderZInvalidBase64PaddingDefect�binascii�ErrorZInvalidBase64CharactersDefectZInvalidBase64LengthDefect)rZpad_errZmissing_paddingrrrrds(��
��cCst�|��d�S)Nr)r5Z	b64encoderr0rrrr�scCs&tt|�d�\}}|d|r dndS)N�r4r)�divmodr2)r1Zgroups_of_3Zleftoverrrrr
�s)�q�bc	
Cs�|�d�\}}}}}|�d�\}}}|��}|�dd�}t||�\}}z|�|�}Wnvtk
r�|�t�	d�
|���|�|d�}YnBtk
r�|�dd�}|��dkr�|�t�d�
|���YnX||||fS)a�Decode encoded word and return (string, charset, lang, defects) tuple.

    An RFC 2047/2243 encoded word has the form:

        =?charset*lang?cte?encoded_string?=

    where '*lang' may be omitted but the other parts may not be.

    This function expects exactly such a string (that is, it does not check the
    syntax and may raise errors if the string is not well formed), and returns
    the encoded_string decoded first from its Content Transfer Encoding and
    then from the resulting bytes into unicode using the specified charset.  If
    the cte-decoded string does not successfully decode using the specified
    character set, a defect is added to the defects list and the unknown octets
    are replaced by the unicode 'unknown' character \uFDFF.

    The specified charset and language are returned.  The default for language,
    which is rarely if ever encountered, is the empty string.

    �?�*r�surrogateescapez:Encoded word contains bytes not decodable using {} charset�unknown-8bitz<Unknown charset {} in encoded word; decoded as unknown bytes)
�split�	partition�lowerr�
_cte_decodersr�UnicodeError�appendrZUndecodableBytesDefectr�LookupErrorZCharsetError)	Zewr&�charsetZcteZ
cte_string�langr1Zdefects�stringrrrr�s&���utf-8r(cCs||dkr|�dd�}n
|�|�}|dkrTtd|�}td|�}||dkrPdnd}t||�}|rld|}d	�||||�S)
aEncode string using the CTE encoding that produces the shorter result.

    Produces an RFC 2047/2243 encoded word of the form:

        =?charset*lang?cte?encoded_string?=

    where '*lang' is omitted unless the 'lang' parameter is given a value.
    Optional argument charset (defaults to utf-8) specifies the charset to use
    to encode the string to binary before CTE encoding it.  Optional argument
    'encoding' is the cte specifier for the encoding that should be used ('q'
    or 'b'); if it is None (the default) the encoding which produces the
    shortest encoded sequence is used, except that 'q' is preferred if it is up
    to five characters longer.  Optional argument 'lang' (default '') gives the
    RFC 2243 language string to specify in the encoded word.

    r?rr>Nr:r;�r=z=?{}{}?{}?{}?=)r�_cte_encode_length�
_cte_encodersr)rIrG�encodingrHr1ZqlenZblenrrrrr�s
)rJNr()�__doc__�rer5r6�	functoolsrIrrZemailr�__all__�partial�compile�subrr�dictrr*�ordrr	rrr
rCrrMrLrrrrr�<module>sL)��&�+��email/__pycache__/_header_value_parser.cpython-38.opt-1.pyc000064400000234017151153537650017613 0ustar00U

e5dϡ�	@s�dZddlZddlZddlZddlmZddlmZddlm	Z
ddlmZddlmZe
d�Zee
d	�BZe
d
�ZeeBZee
d�Zee
d�Zee
d
�Be
d�ZeeBZee
d�BZeeBZee
d�Zdd�Ze�dejejB�ZGdd�de�ZGdd�de�Z Gdd�de�Z!Gdd�de�Z"Gdd�de�Z#Gdd�de �Z$Gdd �d e�Z%Gd!d"�d"e�Z&Gd#d$�d$e�Z'Gd%d&�d&e�Z(Gd'd(�d(e(�Z)Gd)d*�d*e �Z*Gd+d,�d,e�Z+Gd-d.�d.e�Z,Gd/d0�d0e�Z-Gd1d2�d2e�Z.Gd3d4�d4e�Z/Gd5d6�d6e�Z0Gd7d8�d8e�Z1Gd9d:�d:e�Z2Gd;d<�d<e�Z3Gd=d>�d>e�Z4Gd?d@�d@e�Z5GdAdB�dBe�Z6GdCdD�dDe�Z7GdEdF�dFe�Z8GdGdH�dHe�Z9GdIdJ�dJe�Z:GdKdL�dLe"�Z;GdMdN�dNe�Z<GdOdP�dPe�Z=GdQdR�dRe�Z>GdSdT�dTe�Z?GdUdV�dVe?�Z@GdWdX�dXe�ZAGdYdZ�dZe�ZBGd[d\�d\e�ZCGd]d^�d^e�ZDGd_d`�d`e�ZEGdadb�dbeE�ZFGdcdd�ddeE�ZGGdedf�dfe�ZHGdgdh�dhe�ZIGdidj�dje�ZJGdkdl�dleJ�ZKGdmdn�dneK�ZLGdodp�dpe�ZMGdqdr�dreN�ZOGdsdt�dteO�ZPGdudv�dveO�ZQGdwdx�dxeP�ZRGdydz�dzejS�ZTeQdd{�ZUeQd|d}�ZVeQd~d�ZWe�d��Xd��Ye���jZZ[e�d��Xe�\d��Ye����j]Z^e�d��j_Z`e�d��Xe�\d��Ye����j]Zae�d��Xe�\d��Ye����j]Zbe�d��Xe�\d��Ye����j]Zcd�d��Zdd�d��Zed�d��Zfd�d��Zgd�d��Zhd�d��Zid�d��Zjd�d��Zkd�d��Zld�d��Zmd�d��Znd�d��Zod�d��Zpd�d��Zqd�d��Zrd�d��Zsd�d��Ztd�d��Zud�d��Zvd�d��Zwd�d��Zxd�d��Zyd�d��Zzd�d��Z{d�d��Z|d�d��Z}d�d��Z~d�d��Zd�d��Z�d�d��Z�d�d��Z�d�dÄZ�d�dńZ�d�dDŽZ�d�dɄZ�d�d˄Z�d�d̈́Z�d�dτZ�d�dфZ�d�dӄZ�d�dՄZ�d�dׄZ�d�dلZ�d�dۄZ�d�d݄Z�d�d߄Z�d�d�Z�d�d�Z�d�d�Z�d�d�Z�d�d�Z�d�d�Z�d�d�Z�d�d�Z�d�d�Z�d�d�Z�d�d��Z�d�d��Z�dS)�alHeader value parser implementing various email-related RFC parsing rules.

The parsing methods defined in this module implement various email related
parsing rules.  Principal among them is RFC 5322, which is the followon
to RFC 2822 and primarily a clarification of the former.  It also implements
RFC 2047 encoded word decoding.

RFC 5322 goes to considerable trouble to maintain backward compatibility with
RFC 822 in the parse phase, while cleaning up the structure on the generation
phase.  This parser supports correct RFC 5322 generation by tagging white space
as folding white space only when folding is allowed in the non-obsolete rule
sets.  Actually, the parser is even more generous when accepting input than RFC
5322 mandates, following the spirit of Postel's Law, which RFC 5322 encourages.
Where possible deviations from the standard are annotated on the 'defects'
attribute of tokens that deviate.

The general structure of the parser follows RFC 5322, and uses its terminology
where there is a direct correspondence.  Where the implementation requires a
somewhat different structure than that used by the formal grammar, new terms
that mimic the closest existing terms are used.  Thus, it really helps to have
a copy of RFC 5322 handy when studying this code.

Input to the parser is a string that has already been unfolded according to
RFC 5322 rules.  According to the RFC this unfolding is the very first step, and
this parser leaves the unfolding step to a higher level message parser, which
will have already detected the line breaks that need unfolding while
determining the beginning and end of each header.

The output of the parser is a TokenList object, which is a list subclass.  A
TokenList is a recursive data structure.  The terminal nodes of the structure
are Terminal objects, which are subclasses of str.  These do not correspond
directly to terminal objects in the formal grammar, but are instead more
practical higher level combinations of true terminals.

All TokenList and Terminal objects have a 'value' attribute, which produces the
semantically meaningful value of that part of the parse subtree.  The value of
all whitespace tokens (no matter how many sub-tokens they may contain) is a
single space, as per the RFC rules.  This includes 'CFWS', which is herein
included in the general class of whitespace tokens.  There is one exception to
the rule that whitespace tokens are collapsed into single spaces in values: in
the value of a 'bare-quoted-string' (a quoted-string with no leading or
trailing whitespace), any whitespace that appeared between the quotation marks
is preserved in the returned value.  Note that in all Terminal strings quoted
pairs are turned into their unquoted values.

All TokenList and Terminal objects also have a string value, which attempts to
be a "canonical" representation of the RFC-compliant form of the substring that
produced the parsed subtree, including minimal use of quoted pair quoting.
Whitespace runs are not collapsed.

Comment tokens also have a 'content' attribute providing the string found
between the parens (including any nested comments) with whitespace preserved.

All TokenList and Terminal objects have a 'defects' attribute which is a
possibly empty list all of the defects found while creating the token.  Defects
may appear on any token in the tree, and a composite list of all defects in the
subtree is available through the 'all_defects' attribute of any node.  (For
Terminal notes x.defects == x.all_defects.)

Each object in a parse tree is called a 'token', and each has a 'token_type'
attribute that gives the name from the RFC 5322 grammar that it represents.
Not all RFC 5322 nodes are produced, and there is one non-RFC 5322 node that
may be produced: 'ptext'.  A 'ptext' is a string of printable ascii characters.
It is returned in place of lists of (ctext/quoted-pair) and
(qtext/quoted-pair).

XXX: provide complete list of token types.
�N)�	hexdigits)�
itemgetter)�_encoded_words)�errors)�utilsz 	�(z
()<>@,:;.\"[]�.z."(z/?=z*'%�%cCs dt|��dd��dd�dS)N�"�\�\\z\")�str�replace��value�r�2/usr/lib64/python3.8/email/_header_value_parser.py�quote_string`srz�
   =\?            # literal =?
   [^?]*          # charset
   \?             # literal ?
   [qQbB]         # literal 'q' or 'b', case insensitive
   \?             # literal ?
  .*?             # encoded word
  \?=             # literal ?=
cs�eZdZdZdZdZ�fdd�Zdd�Z�fdd�Ze	d	d
��Z
e	dd��Zd
d�Ze	dd��Z
e	dd��Zdd�Zddd�Zddd�Zddd�Z�ZS)�	TokenListNTcst�j||�g|_dS�N)�super�__init__�defects)�self�args�kw��	__class__rrryszTokenList.__init__cCsd�dd�|D��S)N�css|]}t|�VqdSr�r
��.0�xrrr�	<genexpr>~sz$TokenList.__str__.<locals>.<genexpr>��join�rrrr�__str__}szTokenList.__str__csd�|jjt����S�Nz{}({})��formatr�__name__r�__repr__r&rrrr,�s
�zTokenList.__repr__cCsd�dd�|D��S)Nrcss|]}|jr|jVqdSrrr rrrr#�sz"TokenList.value.<locals>.<genexpr>r$r&rrrr�szTokenList.valuecCstdd�|D�|j�S)Ncss|]}|jVqdSr)�all_defectsr rrrr#�sz(TokenList.all_defects.<locals>.<genexpr>)�sumrr&rrrr-�szTokenList.all_defectscCs|d��S�Nr)�startswith_fwsr&rrrr0�szTokenList.startswith_fwscCstdd�|D��S)zATrue if all top level tokens of this part may be RFC2047 encoded.css|]}|jVqdSr)�
as_ew_allowed)r!�partrrrr#�sz*TokenList.as_ew_allowed.<locals>.<genexpr>)�allr&rrrr1�szTokenList.as_ew_allowedcCsg}|D]}|�|j�q|Sr)�extend�comments)rr5�tokenrrrr5�szTokenList.commentscCst||d�S)N��policy)�_refold_parse_tree�rr8rrr�fold�szTokenList.foldrcCst|j|d��dS)N��indent)�print�ppstr�rr=rrr�pprint�szTokenList.pprintcCsd�|j|d��S)N�
r<)r%�_ppr@rrrr?�szTokenList.ppstrccszd�||jj|j�V|D]4}t|d�s:|d�|�Vq|�|d�EdHq|jrdd�|j�}nd}d�||�VdS)Nz{}{}/{}(rCz*    !! invalid element in token list: {!r}z    z Defects: {}rz{}){})r*rr+�
token_type�hasattrrCr)rr=r6ZextrarrrrC�s�
�
z
TokenList._pp)r)r)r)r+�
__module__�__qualname__rD�syntactic_break�ew_combine_allowedrr'r,�propertyrr-r0r1r5r;rAr?rC�
__classcell__rrrrrss&





rc@s$eZdZedd��Zedd��ZdS)�WhiteSpaceTokenListcCsdS�N� rr&rrrr�szWhiteSpaceTokenList.valuecCsdd�|D�S)NcSsg|]}|jdkr|j�qS)�comment)rD�contentr rrr�
<listcomp>�s
z0WhiteSpaceTokenList.comments.<locals>.<listcomp>rr&rrrr5�szWhiteSpaceTokenList.commentsN)r+rFrGrJrr5rrrrrL�s
rLc@seZdZdZdS)�UnstructuredTokenList�unstructuredN�r+rFrGrDrrrrrR�srRc@seZdZdZdS)�Phrase�phraseNrTrrrrrU�srUc@seZdZdZdS)�WordZwordNrTrrrrrW�srWc@seZdZdZdS)�CFWSList�cfwsNrTrrrrrX�srXc@seZdZdZdS)�Atom�atomNrTrrrrrZ�srZc@seZdZdZdZdS)�Tokenr6FN)r+rFrGrDZencode_as_ewrrrrr\�sr\c@seZdZdZdZdZdZdS)�EncodedWord�encoded-wordN)r+rFrGrD�cte�charset�langrrrrr]�sr]c@s4eZdZdZedd��Zedd��Zedd��ZdS)	�QuotedString�
quoted-stringcCs"|D]}|jdkr|jSqdS�N�bare-quoted-string�rDr�rr"rrrrP�s
zQuotedString.contentcCs>g}|D]*}|jdkr&|�t|��q|�|j�qd�|�S)Nrer)rD�appendr
rr%)r�resr"rrr�quoted_value�s
zQuotedString.quoted_valuecCs"|D]}|jdkr|jSqdSrdrf�rr6rrr�stripped_value�s
zQuotedString.stripped_valueN)r+rFrGrDrJrPrjrlrrrrrb�s

	rbc@s$eZdZdZdd�Zedd��ZdS)�BareQuotedStringrecCstd�dd�|D���S)Nrcss|]}t|�VqdSrrr rrrr#sz+BareQuotedString.__str__.<locals>.<genexpr>)rr%r&rrrr'�szBareQuotedString.__str__cCsd�dd�|D��S)Nrcss|]}t|�VqdSrrr rrrr#sz)BareQuotedString.value.<locals>.<genexpr>r$r&rrrrszBareQuotedString.valueN)r+rFrGrDr'rJrrrrrrm�srmc@s8eZdZdZdd�Zdd�Zedd��Zedd	��Zd
S)�CommentrOcs(d�tdg�fdd��D�dggg��S)Nrrcsg|]}��|��qSr)�quoter r&rrrQsz#Comment.__str__.<locals>.<listcomp>�))r%r.r&rr&rr's��zComment.__str__cCs2|jdkrt|�St|��dd��dd��dd�S)NrOrrrz\(rpz\))rDr
r)rrrrrros
��z
Comment.quotecCsd�dd�|D��S)Nrcss|]}t|�VqdSrrr rrrr#sz"Comment.content.<locals>.<genexpr>r$r&rrrrPszComment.contentcCs|jgSr)rPr&rrrr5szComment.commentsN)	r+rFrGrDr'rorJrPr5rrrrrns
rnc@s4eZdZdZedd��Zedd��Zedd��ZdS)	�AddressListzaddress-listcCsdd�|D�S)NcSsg|]}|jdkr|�qS)�address�rDr rrrrQ's
z)AddressList.addresses.<locals>.<listcomp>rr&rrr�	addresses%szAddressList.addressescCstdd�|D�g�S)Ncss|]}|jdkr|jVqdS�rrN�rD�	mailboxesr rrrr#+s
�z(AddressList.mailboxes.<locals>.<genexpr>�r.r&rrrrw)s
��zAddressList.mailboxescCstdd�|D�g�S)Ncss|]}|jdkr|jVqdSru�rD�
all_mailboxesr rrrr#0s
�z,AddressList.all_mailboxes.<locals>.<genexpr>rxr&rrrrz.s
��zAddressList.all_mailboxesN)r+rFrGrDrJrtrwrzrrrrrq!s

rqc@s4eZdZdZedd��Zedd��Zedd��ZdS)	�AddressrrcCs|djdkr|djSdS)Nr�group�rD�display_namer&rrrr~8szAddress.display_namecCs4|djdkr|dgS|djdkr*gS|djS�Nr�mailbox�invalid-mailboxrvr&rrrrw=s

zAddress.mailboxescCs:|djdkr|dgS|djdkr0|dgS|djSrryr&rrrrzEs


zAddress.all_mailboxesN)r+rFrGrDrJr~rwrzrrrrr{4s

r{c@s(eZdZdZedd��Zedd��ZdS)�MailboxList�mailbox-listcCsdd�|D�S)NcSsg|]}|jdkr|�qS)r�rsr rrrrQSs
z)MailboxList.mailboxes.<locals>.<listcomp>rr&rrrrwQszMailboxList.mailboxescCsdd�|D�S)NcSsg|]}|jdkr|�qS))r�r�rsr rrrrQWs
�z-MailboxList.all_mailboxes.<locals>.<listcomp>rr&rrrrzUszMailboxList.all_mailboxesN�r+rFrGrDrJrwrzrrrrr�Ms

r�c@s(eZdZdZedd��Zedd��ZdS)�	GroupList�
group-listcCs |r|djdkrgS|djS�Nrr�rvr&rrrrw_szGroupList.mailboxescCs |r|djdkrgS|djSr�ryr&rrrrzeszGroupList.all_mailboxesNr�rrrrr�[s

r�c@s4eZdZdZedd��Zedd��Zedd��ZdS)	�Groupr|cCs|djdkrgS|djS�N�r�rvr&rrrrwpszGroup.mailboxescCs|djdkrgS|djSr�ryr&rrrrzvszGroup.all_mailboxescCs
|djSr/)r~r&rrrr~|szGroup.display_nameN)r+rFrGrDrJrwrzr~rrrrr�ls

r�c@sLeZdZdZedd��Zedd��Zedd��Zedd	��Zed
d��Z	dS)
�NameAddr�	name-addrcCst|�dkrdS|djS�N�r)�lenr~r&rrrr~�szNameAddr.display_namecCs
|djS�N�����
local_partr&rrrr��szNameAddr.local_partcCs
|djSr���domainr&rrrr��szNameAddr.domaincCs
|djSr�)�router&rrrr��szNameAddr.routecCs
|djSr���	addr_specr&rrrr��szNameAddr.addr_specN�
r+rFrGrDrJr~r�r�r�r�rrrrr��s



r�c@s@eZdZdZedd��Zedd��Zedd��Zedd	��Zd
S)�	AngleAddrz
angle-addrcCs"|D]}|jdkr|jSqdS�N�	addr-spec)rDr�rgrrrr��s
zAngleAddr.local_partcCs"|D]}|jdkr|jSqdSr��rDr�rgrrrr��s
zAngleAddr.domaincCs"|D]}|jdkr|jSqdS)N�	obs-route)rD�domainsrgrrrr��s
zAngleAddr.routecCs<|D]2}|jdkr|jr"|jSt|j�|jSqdS)Nr�z<>)rDr�r�rrgrrrr��s

zAngleAddr.addr_specN)	r+rFrGrDrJr�r�r�r�rrrrr��s


r�c@seZdZdZedd��ZdS)�ObsRouter�cCsdd�|D�S)NcSsg|]}|jdkr|j�qSr�r�r rrrrQ�s
z$ObsRoute.domains.<locals>.<listcomp>rr&rrrr��szObsRoute.domainsN)r+rFrGrDrJr�rrrrr��sr�c@sLeZdZdZedd��Zedd��Zedd��Zedd	��Zed
d��Z	dS)
�Mailboxr�cCs|djdkr|djSdS�Nrr�r}r&rrrr~�szMailbox.display_namecCs
|djSr/r�r&rrrr��szMailbox.local_partcCs
|djSr/r�r&rrrr��szMailbox.domaincCs|djdkr|djSdSr�)rDr�r&rrrr��sz
Mailbox.routecCs
|djSr/r�r&rrrr��szMailbox.addr_specNr�rrrrr��s



r�c@s,eZdZdZedd��ZeZZZZ	dS)�InvalidMailboxr�cCsdSrrr&rrrr~�szInvalidMailbox.display_nameNr�rrrrr��s
r�cs(eZdZdZdZe�fdd��Z�ZS)�Domainr�Fcsd�t�j���S�Nr�r%rr�splitr&rrrr��sz
Domain.domain)r+rFrGrDr1rJr�rKrrrrr��sr�c@seZdZdZdS)�DotAtom�dot-atomNrTrrrrr��sr�c@seZdZdZdZdS)�DotAtomTextz
dot-atom-textTN�r+rFrGrDr1rrrrr��sr�c@seZdZdZdZdS)�
NoFoldLiteralzno-fold-literalFNr�rrrrr�sr�c@sDeZdZdZdZedd��Zedd��Zedd��Zed	d
��Z	dS)�AddrSpecr�FcCs
|djSr/r�r&rrrr�
szAddrSpec.local_partcCst|�dkrdS|djS)N�r�)r�r�r&rrrr�szAddrSpec.domaincCs<t|�dkr|djS|dj��|dj|dj��S)Nr�rr�r�)r�r�rstrip�lstripr&rrrrs
zAddrSpec.valuecCsLt|j�}t|�t|t�kr*t|j�}n|j}|jdk	rH|d|jS|S)N�@)�setr�r��
DOT_ATOM_ENDSrr�)rZnamesetZlprrrr�s

zAddrSpec.addr_specN)
r+rFrGrDr1rJr�r�rr�rrrrr�s


r�c@seZdZdZdZdS)�ObsLocalPartzobs-local-partFNr�rrrrr�&sr�cs4eZdZdZdZedd��Ze�fdd��Z�ZS)�DisplayNamezdisplay-nameFcCs�t|�}t|�dkr|jS|djdkr4|�d�n*|ddjdkr^t|ddd��|d<|djdkrv|��n*|ddjdkr�t|ddd��|d<|jS)NrrYr�r�)rr�rrD�pop)rrirrrr~1s
zDisplayName.display_namecs�d}|jrd}n|D]}|jdkrd}qt|�dkr�|r�d}}|djdks`|ddjdkrdd}|djdks�|ddjdkr�d}|t|j�|St�jSdS)	NFTrcrrrYrNr�)rrDr�rr~rr)rror"ZpreZpostrrrrBs
  zDisplayName.value)	r+rFrGrDrIrJr~rrKrrrrr�,s
r�c@s,eZdZdZdZedd��Zedd��ZdS)�	LocalPartz
local-partFcCs&|djdkr|djS|djSdS)Nrrc)rDrjrr&rrrr[s
zLocalPart.valuecCs�tg}t}d}|dtgD]�}|jdkr,q|r\|jdkr\|djdkr\t|dd��|d<t|t�}|r�|jdkr�|djdkr�|�t|dd���n
|�|�|d}|}qt|dd��}|jS)NFrrY�dotr�r�)�DOTrDr�
isinstancerhr)rriZlastZ
last_is_tl�tokZis_tlrrrr�bs(
�
�
zLocalPart.local_partN)r+rFrGrDr1rJrr�rrrrr�Vs
r�cs4eZdZdZdZe�fdd��Zedd��Z�ZS)�
DomainLiteralzdomain-literalFcsd�t�j���Sr�r�r&rrrr�szDomainLiteral.domaincCs"|D]}|jdkr|jSqdS)N�ptextrfrgrrr�ip�s
zDomainLiteral.ip)	r+rFrGrDr1rJr�r�rKrrrrr�zsr�c@seZdZdZdZdZdS)�MIMEVersionzmime-versionN)r+rFrGrD�major�minorrrrrr��sr�c@s4eZdZdZdZdZdZedd��Zedd��Z	dS)	�	Parameter�	parameterF�us-asciicCs|jr|djSdSr�)�	sectioned�numberr&rrr�section_number�szParameter.section_numbercCsf|D]\}|jdkr|jS|jdkr|D]4}|jdkr*|D] }|jdkr<|jSq<q*qdS)Nrrcrer)rDrlrkrrr�param_value�s




zParameter.param_valueN)
r+rFrGrDr��extendedr`rJr�r�rrrrr��s
r�c@seZdZdZdS)�InvalidParameter�invalid-parameterNrTrrrrr��sr�c@seZdZdZedd��ZdS)�	Attribute�	attributecCs$|D]}|j�d�r|jSqdS)N�attrtext)rD�endswithrrkrrrrl�szAttribute.stripped_valueN�r+rFrGrDrJrlrrrrr��sr�c@seZdZdZdZdS)�Section�sectionN)r+rFrGrDr�rrrrr��sr�c@seZdZdZedd��ZdS)�ValuercCs2|d}|jdkr|d}|j�d�r,|jS|jS)NrrYr�)rcr�zextended-attribute)rDr�rlrrkrrrrl�s
�zValue.stripped_valueNr�rrrrr��sr�c@s(eZdZdZdZedd��Zdd�ZdS)�MimeParameters�mime-parametersFc
cs�i}|D]T}|j�d�sq|djdkr*q|dj��}||krHg||<||�|j|f�q|��D�]~\}}t|td�d�}|dd}|j	}|j
s�t|�dkr�|dddkr�|ddj�t
�d��|dd�}g}d}|D]�\}	}
|	|k�r(|
j
�s|
j�t
�d��q�n|
j�t
�d��|d7}|
j}|
j
�r�ztj�|�}Wn&tk
�rttjj|d	d
�}YnRXz|�|d�}Wn"tk
�r�|�dd�}YnXt�|��r�|
j�t
���|�|�q�d
�|�}||fVqfdS)Nr�rr�)�keyr�z.duplicate parameter name; duplicate(s) ignoredz+duplicate parameter name; duplicate ignoredz(inconsistent RFC2231 parameter numberingzlatin-1)�encoding�surrogateescaper�r)rDr�r�striprhr��items�sortedrr`r�r�rr�InvalidHeaderDefectr��urllib�parseZunquote_to_bytes�UnicodeEncodeErrorZunquote�decode�LookupErrorr�_has_surrogates�UndecodableBytesDefectr%)r�paramsr6�name�partsZfirst_paramr`Zvalue_parts�ir��paramrrrrr��s`�

�
�
zMimeParameters.paramscCsTg}|jD].\}}|r.|�d�|t|���q
|�|�q
d�|�}|rPd|SdS)N�{}={}z; rNr)r�rhr*rr%)rr�r�rrrrr's
zMimeParameters.__str__N)r+rFrGrDrHrJr�r'rrrrr��s

Er�c@seZdZdZedd��ZdS)�ParameterizedHeaderValueFcCs&t|�D]}|jdkr|jSqiS)Nr�)�reversedrDr�rkrrrr�-s
zParameterizedHeaderValue.paramsN)r+rFrGrHrJr�rrrrr�'sr�c@seZdZdZdZdZdZdS)�ContentTypezcontent-typeF�textZplainN)r+rFrGrDr1�maintype�subtyperrrrr�5sr�c@seZdZdZdZdZdS)�ContentDispositionzcontent-dispositionFN)r+rFrGrDr1�content_dispositionrrrrr�<sr�c@seZdZdZdZdZdS)�ContentTransferEncodingzcontent-transfer-encodingFZ7bitN)r+rFrGrDr1r_rrrrr�Bsr�c@seZdZdZdZdS)�HeaderLabelzheader-labelFNr�rrrrr�Hsr�c@seZdZdZdZdd�ZdS)�MsgIDzmsg-idFcCst|�|jSr)r
�linesepr:rrrr;Qsz
MsgID.foldN)r+rFrGrDr1r;rrrrr�Msr�c@seZdZdZdS)�	MessageIDz
message-idNrTrrrrr�Vsr�c@seZdZdZdS)�InvalidMessageIDzinvalid-message-idNrTrrrrr�Zsr�c@seZdZdZdS)�Header�headerNrTrrrrr�^sr�csreZdZdZdZdZ�fdd�Z�fdd�Zdd�Ze	dd	��Z
d�fdd�	Zd
d�Ze	dd��Z
dd�Z�ZS)�TerminalTcst��||�}||_g|_|Sr)r�__new__rDr)�clsrrDrrrrr�lszTerminal.__new__csd�|jjt����Sr(r)r&rrrr,rszTerminal.__repr__cCst|jjd|j�dS)N�/)r>rr+rDr&rrrrAuszTerminal.pprintcCs
t|j�Sr)�listrr&rrrr-xszTerminal.all_defectsrc	s2d�||jj|jt���|js"dn
d�|j��gS)Nz
{}{}/{}({}){}rz {})r*rr+rDrr,rr@rrrrC|s�zTerminal._ppcCsdSrrr&rrr�pop_trailing_ws�szTerminal.pop_trailing_wscCsgSrrr&rrrr5�szTerminal.commentscCst|�|jfSr)r
rDr&rrr�__getnewargs__�szTerminal.__getnewargs__)r)r+rFrGr1rIrHr�r,rArJr-rCr�r5rrKrrrrr�fs
	
r�c@s eZdZedd��Zdd�ZdS)�WhiteSpaceTerminalcCsdSrMrr&rrrr�szWhiteSpaceTerminal.valuecCsdS)NTrr&rrrr0�sz!WhiteSpaceTerminal.startswith_fwsN�r+rFrGrJrr0rrrrr�s
rc@s eZdZedd��Zdd�ZdS)�
ValueTerminalcCs|Srrr&rrrr�szValueTerminal.valuecCsdS)NFrr&rrrr0�szValueTerminal.startswith_fwsNrrrrrr�s
rc@s eZdZedd��Zdd�ZdS)�EWWhiteSpaceTerminalcCsdSr�rr&rrrr�szEWWhiteSpaceTerminal.valuecCsdSr�rr&rrrr'�szEWWhiteSpaceTerminal.__str__N)r+rFrGrJrr'rrrrr�s
rc@seZdZdZdS)�_InvalidEwErrorz1Invalid encoded word found while parsing headers.N)r+rFrG�__doc__rrrrr�srr��,�list-separatorr�zroute-component-markerz([{}]+)rz[^{}]+z[\x00-\x20\x7F]cCs>t|�}|r|j�t�|��t�|�r:|j�t�d��dS)z@If input token contains ASCII non-printables, register a defect.z*Non-ASCII characters found in header tokenN)�_non_printable_finderrrhrZNonPrintableDefectrr�r�)�xtextZnon_printablesrrr�_validate_xtext�s

�rcCs�t|d�^}}g}d}d}tt|��D]L}||dkrJ|rDd}d}nd}q&|rTd}n|||krdq||�||�q&|d}d�|�d�||d�g|�|fS)akScan printables/quoted-pairs until endchars and return unquoted ptext.

    This function turns a run of qcontent, ccontent-without-comments, or
    dtext-with-quoted-printables into a single string by unquoting any
    quoted printables.  It returns the string, the remaining value, and
    a flag that is True iff there were any quoted printables decoded.

    r�FrTrN)�
_wsp_splitter�ranger�rhr%)r�endcharsZfragment�	remainderZvchars�escape�had_qp�posrrr�_get_ptext_to_endchars�s$	rcCs.|��}t|dt|�t|��d�}||fS)z�FWS = 1*WSP

    This isn't the RFC definition.  We're using fws to represent tokens where
    folding can be done, but when we are parsing the *un*folding has already
    been done so we don't need to watch out for CRLF.

    N�fws)r�rr�)rZnewvaluerrrr�get_fwssrc
	Cs�t�}|�d�s t�d�|���|dd��dd�^}}||dd�krXt�d�|���d�|�}t|�dkr�|dtkr�|dtkr�|�	d	�dkr�|�dd�^}}|d|}t|���dkr�|j
�t�d
��||_
d�|�}zt�d|d�\}}}}	Wn*ttfk
�r*td�|j
���YnX||_||_|j
�|	�|�r�|dtk�rrt|�\}
}|�|
��qDt|d�^}}t|d�}t|�|�|�d�|�}�qD|�r�|dtk�r�|j
�t�d
��||fS)zE encoded-word = "=?" charset "?" encoding "?" encoded-text "?="

    �=?z"expected encoded word but found {}r�Nz?=r�rr�?zwhitespace inside encoded wordz!encoded word format invalid: '{}'�vtextz.missing trailing whitespace after encoded-word)r]�
startswithr�HeaderParseErrorr*r�r%r�r�countrrhr�r_�_ewr��
ValueError�KeyErrorrr`rar4�WSPrrrr)
rZewr�rZremstr�restr�r`rarr6�charsrrrr�get_encoded_wordsd
��

�
��
�

�




�r"cCsFt�}|�rB|dtkr0t|�\}}|�|�qd}|�d�r�zt|�\}}Wn,tk
rfd}Yn�tjk
rzYnrXd}t	|�dkr�|dj
dkr�|j�t�d��d}|r�t	|�dkr�|d	j
d
kr�t
|dd�|d<|�|�qt|d�^}}|�rt�|��r|�d�^}}t|d�}t|�|�|�d�|�}q|S)
aOunstructured = (*([FWS] vchar) *WSP) / obs-unstruct
       obs-unstruct = *((*LF *CR *(obs-utext) *LF *CR)) / FWS)
       obs-utext = %d0 / obs-NO-WS-CTL / LF / CR

       obs-NO-WS-CTL is control characters except WSP/CR/LF.

    So, basically, we have printable runs, plus control characters or nulls in
    the obsolete syntax, separated by whitespace.  Since RFC 2047 uses the
    obsolete syntax in its specification, but requires whitespace on either
    side of the encoded words, I can see no reason to need to separate the
    non-printable-non-whitespace from the printable runs if they occur, so we
    parse this into xtext tokens separated by WSP tokens.

    Because an 'unstructured' value must by definition constitute the entire
    value, this 'get' routine does not return a remaining value, only the
    parsed TokenList.

    rTrFr�rz&missing whitespace before encoded wordr����r^rr)rRrrrhrr"rrrr�rDrr�rr�rfc2047_matcher�search�	partitionrrr%)rrSr6�valid_ewZhave_wsr�rrrrr�get_unstructured?sJ


��


r(cCs*t|d�\}}}t|d�}t|�||fS)actext = <printable ascii except \ ( )>

    This is not the RFC ctext, since we are handling nested comments in comment
    and unquoting quoted-pairs here.  We allow anything except the '()'
    characters, but if we find any ASCII other than the RFC defined printable
    ASCII, a NonPrintableDefect is added to the token's defects list.  Since
    quoted pairs are converted to their unquoted values, what is returned is
    a 'ptext' token.  In this case it is a WhiteSpaceTerminal, so it's value
    is ' '.

    z()r�)rrr�rr��_rrr�get_qp_ctext�s
r+cCs*t|d�\}}}t|d�}t|�||fS)aoqcontent = qtext / quoted-pair

    We allow anything except the DQUOTE character, but if we find any ASCII
    other than the RFC defined printable ASCII, a NonPrintableDefect is
    added to the token's defects list.  Any quoted pairs are converted to their
    unquoted values, so what is returned is a 'ptext' token.  In this case it
    is a ValueTerminal.

    r
r�)rrrr)rrr�get_qcontent�s

r,cCsNt|�}|st�d�|���|��}|t|�d�}t|d�}t|�||fS)z�atext = <matches _atext_matcher>

    We allow any non-ATOM_ENDS in atext, but add an InvalidATextDefect to
    the token's defects list if we find non-atext characters.
    zexpected atext but found '{}'N�atext)�_non_atom_end_matcherrrr*r|r�rr)r�mr-rrr�	get_atext�s�
r0cCsr|ddkrt�d�|���t�}|dd�}|rT|ddkrTt|�\}}|�|�|�rB|ddk�rB|dtkr�t|�\}}n�|dd�dk�r*d}z&t|�\}}|j	�t�
d	��d
}Wn"tjk
r�t|�\}}YnX|�r6t|�dk�r6|djdk�r6|d
jdk�r6t
|dd�|d<nt|�\}}|�|�qT|�sb|j	�t�
d��||fS||dd�fS)z�bare-quoted-string = DQUOTE *([FWS] qcontent) [FWS] DQUOTE

    A quoted-string without the leading or trailing white space.  Its
    value is the text between the quote marks, with whitespace
    preserved and quoted pairs decoded.
    rr
zexpected '"' but found '{}'r�Nr�rFz!encoded word inside quoted stringTr�rr#r^z"end of header inside quoted string)rrr*rmr,rhrrr"rr�r�rDr)rZbare_quoted_stringr6r'rrr�get_bare_quoted_string�sL�

���

�r1cCs�|r |ddkr t�d�|���t�}|dd�}|r�|ddkr�|dtkr\t|�\}}n&|ddkrvt|�\}}nt|�\}}|�|�q2|s�|j	�t�
d��||fS||dd�fS)z�comment = "(" *([FWS] ccontent) [FWS] ")"
       ccontent = ctext / quoted-pair / comment

    We handle nested comments here, and quoted-pair in our qp-ctext routine.
    rrzexpected '(' but found '{}'r�Nrpzend of header inside comment)rrr*rnrr�get_commentr+rhrr�)rrOr6rrrr2�s&�
�r2cCsPt�}|rH|dtkrH|dtkr0t|�\}}nt|�\}}|�|�q||fS)z,CFWS = (1*([FWS] comment) [FWS]) / FWS

    r)rX�CFWS_LEADERrrr2rh)rrYr6rrr�get_cfws�sr4cCspt�}|r,|dtkr,t|�\}}|�|�t|�\}}|�|�|rh|dtkrht|�\}}|�|�||fS)z�quoted-string = [CFWS] <bare-quoted-string> [CFWS]

    'bare-quoted-string' is an intermediate class defined by this
    parser and not by the RFC grammar.  It is the quoted string
    without any attached CFWS.
    r)rbr3r4rhr1)rZ
quoted_stringr6rrr�get_quoted_strings


r5cCs�t�}|r,|dtkr,t|�\}}|�|�|rL|dtkrLt�d�|���|�d�r�zt	|�\}}Wq�tjk
r�t
|�\}}Yq�Xnt
|�\}}|�|�|r�|dtkr�t|�\}}|�|�||fS)zPatom = [CFWS] 1*atext [CFWS]

    An atom could be an rfc2047 encoded word.
    rzexpected atom but found '{}'r)rZr3r4rh�	ATOM_ENDSrrr*rr"r0)rr[r6rrr�get_atoms&
�


r7cCs�t�}|r|dtkr&t�d�|���|rt|dtkrtt|�\}}|�|�|r&|ddkr&|�t�|dd�}q&|dtkr�t�d�d|���||fS)z( dot-text = 1*atext *("." 1*atext)

    rz8expected atom at a start of dot-atom-text but found '{}'rr�Nr�z4expected atom at end of dot-atom-text but found '{}')r�r6rrr*r0rhr�)rZ
dot_atom_textr6rrr�get_dot_atom_text0s �

�r8cCs�t�}|dtkr(t|�\}}|�|�|�d�rhzt|�\}}Wqttjk
rdt|�\}}YqtXnt|�\}}|�|�|r�|dtkr�t|�\}}|�|�||fS)z� dot-atom = [CFWS] dot-atom-text [CFWS]

    Any place we can have a dot atom, we could instead have an rfc2047 encoded
    word.
    rr)	r�r3r4rhrr"rrr8)rZdot_atomr6rrr�get_dot_atomCs



r9cCs�|dtkrt|�\}}nd}|s,t�d��|ddkrFt|�\}}n*|dtkrdt�d�|���nt|�\}}|dk	r�|g|dd�<||fS)a�word = atom / quoted-string

    Either atom or quoted-string may start with CFWS.  We have to peel off this
    CFWS first to determine which type of word to parse.  Afterward we splice
    the leading CFWS, if any, into the parsed sub-token.

    If neither an atom or a quoted-string is found before the next special, a
    HeaderParseError is raised.

    The token returned is either an Atom or a QuotedString, as appropriate.
    This means the 'word' level of the formal grammar is not represented in the
    parse tree; this is because having that extra layer when manipulating the
    parse tree is more confusing than it is helpful.

    rNz5Expected 'atom' or 'quoted-string' but found nothing.r
z1Expected 'atom' or 'quoted-string' but found '{}')r3r4rrr5�SPECIALSr*r7)r�leaderr6rrr�get_word\s"��r<cCs�t�}zt|�\}}|�|�Wn(tjk
rH|j�t�d��YnX|r�|dtkr�|ddkr�|�t�|j�t�	d��|dd�}qJzt|�\}}WnDtjk
r�|dt
kr�t|�\}}|j�t�	d��n�YnX|�|�qJ||fS)a� phrase = 1*word / obs-phrase
        obs-phrase = word *(word / "." / CFWS)

    This means a phrase can be a sequence of words, periods, and CFWS in any
    order as long as it starts with at least one word.  If anything other than
    words is detected, an ObsoleteHeaderDefect is added to the token's defect
    list.  We also accept a phrase that starts with CFWS followed by a dot;
    this is registered as an InvalidHeaderDefect, since it is not supported by
    even the obsolete grammar.

    zphrase does not start with wordrrzperiod in 'phrase'r�Nzcomment found without atom)rUr<rhrrrr��PHRASE_ENDSr��ObsoleteHeaderDefectr3r4)rrVr6rrr�
get_phrase~s4
�

�
�r?cCsvt�}d}|dtkr"t|�\}}|s6t�d�|���zt|�\}}Wn^tjk
r�zt|�\}}Wn6tjk
r�|ddkr�|dtkr��t	�}YnXYnX|dk	r�|g|dd�<|�
|�|�r4|ddks�|dtk�r4tt|�|�\}}|j
dk�r|j�
t�d��n|j�
t�d��||d<z|j�d�Wn(tk
�rl|j�
t�d	��YnX||fS)
z= local-part = dot-atom / quoted-string / obs-local-part

    Nrz"expected local-part but found '{}'r�invalid-obs-local-partz<local-part is not dot-atom, quoted-string, or obs-local-partz,local-part is not a dot-atom (contains CFWS)�asciiz)local-part contains non-ASCII characters))r�r3r4rrr*r9r<r=rrh�get_obs_local_partr
rDrr�r>r�encoder�ZNonASCIILocalPartDefect)rr�r;r6�obs_local_partrrr�get_local_part�sJ�
 
�
�
�rEcCs�t�}d}|�r(|ddks*|dtk�r(|ddkrj|rL|j�t�d��|�t�d}|dd�}q
nD|ddkr�|�t|dd	��|dd�}|j�t�d
��d}q
|r�|djdkr�|j�t�d
��zt	|�\}}d}Wn4tj
k
�r|dtk�r
�t|�\}}YnX|�|�q
|djdk�sX|djdk�rj|djdk�rj|j�t�d��|djdk�s�|djdk�r�|djdk�r�|j�t�d��|j�r�d|_||fS)z' obs-local-part = word *("." word)
    Frrrzinvalid repeated '.'Tr�N�misplaced-specialz/'\' character outside of quoted-string/ccontentr�r�zmissing '.' between wordsrYz!Invalid leading '.' in local partr#z"Invalid trailing '.' in local partr@)
r�r=rrhrr�r�rrDr<rr3r4)rrDZlast_non_ws_was_dotr6rrrrB�sj 
�
�
�
���
���
�rBcCs@t|d�\}}}t|d�}|r0|j�t�d��t|�||fS)a dtext = <printable ascii except \ [ ]> / obs-dtext
        obs-dtext = obs-NO-WS-CTL / quoted-pair

    We allow anything except the excluded characters, but if we find any
    ASCII other than the RFC defined printable ASCII, a NonPrintableDefect is
    added to the token's defects list.  Quoted pairs are converted to their
    unquoted values, so what is returned is a ptext token, in this case a
    ValueTerminal.  If there were quoted-printables, an ObsoleteHeaderDefect is
    added to the returned token's defect list.

    z[]r�z(quoted printable found in domain-literal)rrrrhrr>r)rr�rrrr�	get_dtext�s

�rGcCs,|rdS|�t�d��|�tdd��dS)NFz"end of input inside domain-literal�]�domain-literal-endT)rhrr�r)r�domain_literalrrr�_check_for_early_dl_ends�rKcCsjt�}|dtkr(t|�\}}|�|�|s6t�d��|ddkrRt�d�|���|dd�}t||�rp||fS|�tdd��|dt	kr�t
|�\}}|�|�t|�\}}|�|�t||�r�||fS|dt	kr�t
|�\}}|�|�t||�r�||fS|ddk�rt�d	�|���|�tdd
��|dd�}|�rb|dtk�rbt|�\}}|�|�||fS)zB domain-literal = [CFWS] "[" *([FWS] dtext) [FWS] "]" [CFWS]

    rzexpected domain-literal�[z6expected '[' at start of domain-literal but found '{}'r�Nzdomain-literal-startrHz4expected ']' at end of domain-literal but found '{}'rI)r�r3r4rhrrr*rKrrrrG)rrJr6rrr�get_domain_literalsH

�





�
rMcCsrt�}d}|dtkr"t|�\}}|s6t�d�|���|ddkrvt|�\}}|dk	rd|g|dd�<|�|�||fSzt|�\}}Wn"tjk
r�t	|�\}}YnX|r�|ddkr�t�d��|dk	r�|g|dd�<|�|�|�rj|ddk�rj|j
�t�d��|djd	k�r*|d|dd�<|�rj|ddk�rj|�t
�t	|d
d��\}}|�|��q*||fS)z] domain = dot-atom / domain-literal / obs-domain
        obs-domain = atom *("." atom))

    Nrzexpected domain but found '{}'rLr�zInvalid Domainrz(domain is not a dot-atom (contains CFWS)r�r�)r�r3r4rrr*rMrhr9r7rr>rDr�)rr�r;r6rrr�
get_domain=sD�



�
rNcCs|t�}t|�\}}|�|�|r,|ddkrF|j�t�d��||fS|�tdd��t|dd��\}}|�|�||fS)z( addr-spec = local-part "@" domain

    rr�z#addr-spec local part with no domain�address-at-symbolr�N)r�rErhrrr�rrN)rr�r6rrr�
get_addr_speccs

�
rPcCs�t�}|rj|ddks"|dtkrj|dtkrFt|�\}}|�|�q|ddkr|�t�|dd�}q|rz|ddkr�t�d�|���|�t�t	|dd��\}}|�|�|�r>|ddk�r>|�t�|dd�}|s�q>|dtk�rt|�\}}|�|�|ddkr�|�t�t	|dd��\}}|�|�q�|�sNt�d��|ddk�rlt�d	�|���|�t
dd
��||dd�fS)z� obs-route = obs-domain-list ":"
        obs-domain-list = *(CFWS / ",") "@" domain *("," [CFWS] ["@" domain])

        Returns an obs-route token with the appropriate sub-tokens (that is,
        there is no obs-domain-list in the parse tree).
    rrr�Nr�z(expected obs-route domain but found '{}'z%end of header while parsing obs-route�:z4expected ':' marking end of obs-route but found '{}'zend-of-obs-route-marker)r�r3r4rh�
ListSeparatorrrr*�RouteComponentMarkerrNr)rZ	obs_router6rrr�
get_obs_routessF
�





�rTcCs�t�}|dtkr(t|�\}}|�|�|r8|ddkrHt�d�|���|�tdd��|dd�}|ddkr�|�tdd��|j�t�	d	��|dd�}||fSzt
|�\}}Wnztjk
�r0z"t|�\}}|j�t�d
��Wn(tjk
�rt�d�|���YnX|�|�t
|�\}}YnX|�|�|�r^|ddk�r^|dd�}n|j�t�	d��|�tdd��|�r�|dtk�r�t|�\}}|�|�||fS)
z� angle-addr = [CFWS] "<" addr-spec ">" [CFWS] / obs-angle-addr
        obs-angle-addr = [CFWS] "<" obs-route addr-spec ">" [CFWS]

    r�<z"expected angle-addr but found '{}'zangle-addr-startr�N�>zangle-addr-endznull addr-spec in angle-addrz*obsolete route specification in angle-addrz.expected addr-spec or obs-route but found '{}'z"missing trailing '>' on angle-addr)
r�r3r4rhrrr*rrr�rPrTr>)rZ
angle_addrr6rrr�get_angle_addr�sT
�
�
�
�



�
rWcCs<t�}t|�\}}|�|dd��|jdd�|_||fS)z� display-name = phrase

    Because this is simply a name-rule, we don't return a display-name
    token containing a phrase, but rather a display-name token with
    the content of the phrase.

    N)r�r?r4r)rr~r6rrr�get_display_name�s
rXcCs�t�}d}|dtkr6t|�\}}|s6t�d�|���|ddkr�|dtkr^t�d�|���t|�\}}|s~t�d�|���|dk	r�|g|ddd�<d}|�|�t	|�\}}|dk	r�|g|dd�<|�|�||fS)z, name-addr = [display-name] angle-addr

    Nrz!expected name-addr but found '{}'rU)
r�r3r4rrr*r=rXrhrW)rZ	name_addrr;r6rrr�
get_name_addr�s6���

rYcCs�t�}zt|�\}}WnNtjk
rdzt|�\}}Wn&tjk
r^t�d�|���YnXYnXtdd�|jD��r�d|_|�	|�||fS)z& mailbox = name-addr / addr-spec

    zexpected mailbox but found '{}'css|]}t|tj�VqdSr)r�rr�r rrrr#s�zget_mailbox.<locals>.<genexpr>r�)
r�rYrrrPr*�anyr-rDrh)rr�r6rrr�get_mailbox�s ��
r[cCsdt�}|r\|d|kr\|dtkrD|�t|dd��|dd�}qt|�\}}|�|�q||fS)z� Read everything up to one of the chars in endchars.

    This is outside the formal grammar.  The InvalidMailbox TokenList that is
    returned acts like a Mailbox, but the data attributes are None.

    rrFr�N)r�r=rhrr?)rrZinvalid_mailboxr6rrr�get_invalid_mailboxs�r\cCs�t�}|�r�|ddk�r�zt|�\}}|�|�W�ntjk
�r<d}|dtkr�t|�\}}|rv|ddkr�|�|�|j�t�d��n@t	|d�\}}|dk	r�|g|dd�<|�|�|j�t�
d��nb|ddkr�|j�t�d��nBt	|d�\}}|dk	�r|g|dd�<|�|�|j�t�
d��YnX|�r�|ddk�r�|d}d	|_t	|d�\}}|�|�|j�t�
d��|r|ddkr|�t
�|d
d�}q||fS)aJ mailbox-list = (mailbox *("," mailbox)) / obs-mbox-list
        obs-mbox-list = *([CFWS] ",") mailbox *("," [mailbox / CFWS])

    For this routine we go outside the formal grammar in order to improve error
    handling.  We recognize the end of the mailbox list only at the end of the
    value or at a ';' (the group terminator).  This is so that we can turn
    invalid mailboxes into InvalidMailbox tokens and continue parsing any
    remaining valid mailboxes.  We also allow all mailbox entries to be null,
    and this condition is handled appropriately at a higher level.

    r�;Nz,;zempty element in mailbox-listzinvalid mailbox in mailbox-listrr�r�r�)r�r[rhrrr3r4rr>r\r�rDr4rR)rZmailbox_listr6r;r�rrr�get_mailbox_listsX

�

�
�


�

�
r^cCst�}|s$|j�t�d��||fSd}|r�|dtkr�t|�\}}|sl|j�t�d��|�|�||fS|ddkr�|�|�||fSt|�\}}t|j	�dkr�|dk	r�|�|�|�
|�|j�t�d��||fS|dk	r�|g|dd�<|�|�||fS)zg group-list = mailbox-list / CFWS / obs-group-list
        obs-group-list = 1*([CFWS] ",") [CFWS]

    zend of header before group-listNrzend of header in group-listr]zgroup-list with empty entries)r�rrhrr�r3r4r^r�rzr4r>)rZ
group_listr;r6rrr�get_group_listWs>
�
�




�
r_cCs t�}t|�\}}|r"|ddkr2t�d�|���|�|�|�tdd��|dd�}|r�|ddkr�|�tdd��||dd�fSt|�\}}|�|�|s�|j�t�	d	��n|ddkr�t�d
�|���|�tdd��|dd�}|�r|dt
k�rt|�\}}|�|�||fS)z7 group = display-name ":" [group-list] ";" [CFWS]

    rrQz8expected ':' at end of group display name but found '{}'zgroup-display-name-terminatorr�Nr]zgroup-terminatorzend of header in groupz)expected ';' at end of group but found {})r�rXrrr*rhrr_rr�r3r4)rr|r6rrr�	get_group|s8�


��
r`cCsxt�}zt|�\}}WnNtjk
rdzt|�\}}Wn&tjk
r^t�d�|���YnXYnX|�|�||fS)a� address = mailbox / group

    Note that counter-intuitively, an address can be either a single address or
    a list of addresses (a group).  This is why the returned Address object has
    a 'mailboxes' attribute which treats a single address as a list of length
    one.  When you need to differentiate between to two cases, extract the single
    element, which is either a mailbox or a group token.

    zexpected address but found '{}')r{r`rrr[r*rh)rrrr6rrr�get_address�s�
rac
Cs�t�}|�r�zt|�\}}|�|�W�n tjk
�rH}z�d}|dtkr�t|�\}}|rj|ddkr�|�|�|j�t�d��nFt	|d�\}}|dk	r�|g|dd�<|�t
|g��|j�t�d��nh|ddkr�|j�t�d��nHt	|d�\}}|dk	�r|g|dd�<|�t
|g��|j�t�d��W5d}~XYnX|�r�|ddk�r�|dd}d|_t	|d�\}}|�
|�|j�t�d��|r|�tdd	��|d
d�}q||fS)a� address_list = (address *("," address)) / obs-addr-list
        obs-addr-list = *([CFWS] ",") address *("," [address / CFWS])

    We depart from the formal grammar here by continuing to parse until the end
    of the input, assuming the input to be entirely composed of an
    address-list.  This is always true in email parsing, and allows us
    to skip invalid addresses to parse additional valid ones.

    Nrrz"address-list entry with no contentzinvalid address in address-listzempty element in address-listr�r�rr�)rqrarhrrr3r4rr>r\r{r�rDr4r)rZaddress_listr6�errr;r�rrr�get_address_list�sX


�
�
�

�

�rccCs�t�}|st�d�|���|ddkr6t�d�|���|�tdd��|dd�}t|�\}}|�|�|rx|ddkr�t�d	�|���|�tdd
��||dd�fS)z& no-fold-literal = "[" *dtext "]"
    z'expected no-fold-literal but found '{}'rrLz;expected '[' at the start of no-fold-literal but found '{}'zno-fold-literal-startr�NrHz9expected ']' at the end of no-fold-literal but found '{}'zno-fold-literal-end)r�rrr*rhrrG)rZno_fold_literalr6rrr�get_no_fold_literal�s.���
��rdcCs�t�}|r,|dtkr,t|�\}}|�|�|r<|ddkrLt�d�|���|�tdd��|dd�}zt|�\}}Wn`tjk
r�z"t	|�\}}|j
�t�d��Wn&tjk
r�t�d�|���YnXYnX|�|�|r�|dd	k�r@|j
�t�d
��|�r8|ddk�r8|�tdd��|dd�}||fS|�td	d
��|dd�}zt|�\}}Wn�tjk
�rzt
|�\}}Wnrtjk
�r}zPz"t|�\}}|j
�t�d��Wn(tjk
�r�t�d�|���YnXW5d}~XYnXYnX|�|�|�r6|ddk�r6|dd�}n|j
�t�d��|�tdd��|�r�|dtk�r�t|�\}}|�|�||fS)z�msg-id = [CFWS] "<" id-left '@' id-right  ">" [CFWS]
       id-left = dot-atom-text / obs-id-left
       id-right = dot-atom-text / no-fold-literal / obs-id-right
       no-fold-literal = "[" *dtext "]"
    rrUzexpected msg-id but found '{}'zmsg-id-startr�Nzobsolete id-left in msg-idz4expected dot-atom-text or obs-id-left but found '{}'r�zmsg-id with no id-rightrVz
msg-id-endrOzobsolete id-right in msg-idzFexpected dot-atom-text, no-fold-literal or obs-id-right but found '{}'zmissing trailing '>' on msg-id)r�r3r4rhrrr*rr8rBrr>r�rdrN)rZmsg_idr6�errr�
get_msg_ids~
�
�
��

�
�
��"

�
rfc
Cs�t�}zt|�\}}|�|�WnLtjk
rl}z,t|�}t|�}|j�t�d�	|���W5d}~XYnX|r�|j�t�d�	|���|S)z2message-id      =   "Message-ID:" msg-id CRLF
    zInvalid msg-id: {!r}NzUnexpected {!r})
r�rfrhrrr(r�rr�r*)rZ
message_idr6Zexrrr�parse_message_idIs�
�rgcCs�t�}|s |j�t�d��|S|dtkrXt|�\}}|�|�|sX|j�t�d��d}|r�|ddkr�|dtkr�||d7}|dd�}q\|��s�|j�t�d�	|���|�t
|d	��nt|�|_|�t
|d
��|�r|dtk�rt|�\}}|�|�|�r|ddk�rT|jdk	�r:|j�t�d��|�rP|�t
|d	��|S|�t
dd��|dd�}|�r�|dtk�r�t|�\}}|�|�|�s�|jdk	�r�|j�t�d��|Sd}|�r�|dtk�r�||d7}|dd�}�q�|���s*|j�t�d
�	|���|�t
|d	��nt|�|_
|�t
|d
��|�rn|dtk�rnt|�\}}|�|�|�r�|j�t�d��|�t
|d	��|S)zE mime-version = [CFWS] 1*digit [CFWS] "." [CFWS] 1*digit [CFWS]

    z%Missing MIME version number (eg: 1.0)rz0Expected MIME version number but found only CFWSrrr�Nz1Expected MIME major version number but found {!r}r
�digitsz0Incomplete MIME version; found only major numberzversion-separatorz1Expected MIME minor version number but found {!r}z'Excess non-CFWS text after MIME version)r�rrhr�HeaderMissingRequiredValuer3r4�isdigitr�r*r�intr�r�)rZmime_versionr6rhrrr�parse_mime_versiones�
�

�
�


�

�

�


�rlcCsdt�}|r\|ddkr\|dtkrD|�t|dd��|dd�}qt|�\}}|�|�q||fS)z� Read everything up to the next ';'.

    This is outside the formal grammar.  The InvalidParameter TokenList that is
    returned acts like a Parameter, but the data attributes are None.

    rr]rFr�N)r�r=rhrr?)rZinvalid_parameterr6rrr�get_invalid_parameter�s�rmcCsNt|�}|st�d�|���|��}|t|�d�}t|d�}t|�||fS)a8ttext = <matches _ttext_matcher>

    We allow any non-TOKEN_ENDS in ttext, but add defects to the token's
    defects list if we find non-ttext characters.  We also register defects for
    *any* non-printables even though the RFC doesn't exclude all of them,
    because we follow the spirit of RFC 5322.

    zexpected ttext but found '{}'N�ttext)�_non_token_end_matcherrrr*r|r�rr)rr/rnrrr�	get_ttext�s	�
rpcCs�t�}|r,|dtkr,t|�\}}|�|�|rL|dtkrLt�d�|���t|�\}}|�|�|r�|dtkr�t|�\}}|�|�||fS)z�token = [CFWS] 1*ttext [CFWS]

    The RFC equivalent of ttext is any US-ASCII chars except space, ctls, or
    tspecials.  We also exclude tabs even though the RFC doesn't.

    The RFC implies the CFWS but is not explicit about it in the BNF.

    r�expected token but found '{}')	r\r3r4rh�
TOKEN_ENDSrrr*rp)rZmtokenr6rrr�	get_token�s	
�

rscCsNt|�}|st�d�|���|��}|t|�d�}t|d�}t|�||fS)aQattrtext = 1*(any non-ATTRIBUTE_ENDS character)

    We allow any non-ATTRIBUTE_ENDS in attrtext, but add defects to the
    token's defects list if we find non-attrtext characters.  We also register
    defects for *any* non-printables even though the RFC doesn't exclude all of
    them, because we follow the spirit of RFC 5322.

    z expected attrtext but found {!r}Nr�)�_non_attribute_end_matcherrrr*r|r�rr�rr/r�rrr�get_attrtext�s	�
rvcCs�t�}|r,|dtkr,t|�\}}|�|�|rL|dtkrLt�d�|���t|�\}}|�|�|r�|dtkr�t|�\}}|�|�||fS)aH [CFWS] 1*attrtext [CFWS]

    This version of the BNF makes the CFWS explicit, and as usual we use a
    value terminal for the actual run of characters.  The RFC equivalent of
    attrtext is the token characters, with the subtraction of '*', "'", and '%'.
    We include tab in the excluded set just as we do for token.

    rrq)	r�r3r4rh�ATTRIBUTE_ENDSrrr*rv�rr�r6rrr�
get_attribute�s	
�

rycCsNt|�}|st�d�|���|��}|t|�d�}t|d�}t|�||fS)z�attrtext = 1*(any non-ATTRIBUTE_ENDS character plus '%')

    This is a special parsing routine so that we get a value that
    includes % escapes as a single string (which we decode as a single
    string later).

    z)expected extended attrtext but found {!r}N�extended-attrtext)�#_non_extended_attribute_end_matcherrrr*r|r�rrrurrr�get_extended_attrtext	s�
r|cCs�t�}|r,|dtkr,t|�\}}|�|�|rL|dtkrLt�d�|���t|�\}}|�|�|r�|dtkr�t|�\}}|�|�||fS)z� [CFWS] 1*extended_attrtext [CFWS]

    This is like the non-extended version except we allow % characters, so that
    we can pick up an encoded value as a single string.

    rrq)	r�r3r4rh�EXTENDED_ATTRIBUTE_ENDSrrr*r|rxrrr�get_extended_attribute!	s
�

r~cCs�t�}|r|ddkr&t�d�|���|�tdd��|dd�}|rR|d��sbt�d�|���d}|r�|d��r�||d7}|dd�}qf|dd	kr�|d	kr�|j�t�d
��t	|�|_
|�t|d��||fS)a6 '*' digits

    The formal BNF is more complicated because leading 0s are not allowed.  We
    check for that and add a defect.  We also assume no CFWS is allowed between
    the '*' and the digits, though the RFC is not crystal clear on that.
    The caller should already have dealt with leading CFWS.

    r�*zExpected section but found {}zsection-markerr�Nz$Expected section number but found {}r�0z'section number has an invalid leading 0rh)r�rrr*rhrrjrZInvalidHeaderErrorrkr�)rr�rhrrr�get_section7	s,	��
�
r�cCs�t�}|st�d��d}|dtkr0t|�\}}|sDt�d�|���|ddkr^t|�\}}nt|�\}}|dk	r�|g|dd�<|�|�||fS)z  quoted-string / attribute

    z&Expected value but found end of stringNrz Expected value but found only {}r
)	r�rrr3r4r*r5r~rh)r�vr;r6rrr�	get_valueU	s"
�
r�cCs�t�}t|�\}}|�|�|r,|ddkrL|j�t�d�|���||fS|ddkr�z t|�\}}d|_|�|�Wntj	k
r�YnX|s�t�	d��|ddkr�|�t
dd��|dd	�}d|_|dd
kr�t�	d��|�t
d
d��|dd	�}d	}|�r,|dtk�r,t
|�\}}|�|�d	}|}|j�rF|�rF|dd
k�rFt|�\}}|j}d}|jdk�r�|�r�|ddk�r�d}n$t|�\}}	|	�r�|	ddk�r�d}n(zt|�\}}	WnYnX|	�s�d}|�r0|j�t�d��|�|�|D](}
|
jdk�rg|
d	d	�<|
}�q*�q|}nd	}|j�t�d��|�r`|ddk�r`d	}nt|�\}}|j�r�|jdk�r�|�r�|ddk�r�|�|�|d	k	�r�|}||fS|j�t�d��|�s�|j�t�d��|�|�|d	k�r�||fSn�|d	k	�r@|D]}
|
jdk�r
�q$�q
|
jdk|�|
�|
j|_|ddk�r^t�	d�|���|�t
dd��|dd	�}|�r�|ddk�r�t|�\}}|�|�|j|_|�r�|ddk�r�t�	d�|���|�t
dd��|dd	�}|d	k	�rdt�}|�r^|dtk�rt|�\}}n2|dd
k�rDt
d
d�}|dd	�}nt|�\}}|�|��q�|}nt|�\}}|�|�|d	k	�r�|}||fS)aY attribute [section] ["*"] [CFWS] "=" value

    The CFWS is implied by the RFC but not made explicit in the BNF.  This
    simplified form of the BNF from the RFC is made to conform with the RFC BNF
    through some extra checks.  We do it this way because it makes both error
    recovery and working with the resulting parse tree easier.
    rr]z)Parameter contains name ({}) but no valuerTzIncomplete parameterzextended-parameter-markerr�N�=zParameter not followed by '='�parameter-separatorr
F�'z5Quoted string value for extended parameter is invalidrezZParameter marked as extended but appears to have a quoted string value that is non-encodedzcApparent initial-extended-value but attribute was not marked as extended or was not initial sectionz(Missing required charset/lang delimitersrzr�z=Expected RFC2231 char/lang encoding delimiter, but found {!r}zRFC2231-delimiterz;Expected RFC2231 char/lang encoding delimiter, but found {}ZDQUOTE)r�ryrhrrr�r*r�r�rrr�r3r4r5rlr�rvr|rDr�rr`rar�rrr,)rr�r6r;rZappendtoZqstringZinner_valueZ
semi_validr �tr�rrr�
get_parameterk	s�
�



�


�


�
�






�
�



r�c
Csjt�}|�rfzt|�\}}|�|�Wn�tjk
r�}z�d}|dtkrVt|�\}}|sp|�|�|WY�xS|ddkr�|dk	r�|�|�|j�t�d��n@t	|�\}}|r�|g|dd�<|�|�|j�t�d�
|���W5d}~XYnX|�rD|ddk�rD|d}d|_t	|�\}}|�|�|j�t�d�
|���|r|�t
dd	��|d
d�}q|S)a! parameter *( ";" parameter )

    That BNF is meant to indicate this routine should only be called after
    finding and handling the leading ';'.  There is no corresponding rule in
    the formal RFC grammar, but it is more convenient for us for the set of
    parameters to be treated as its own TokenList.

    This is 'parse' routine because it consumes the remaining value, but it
    would never be called to parse a full header.  Instead it is called to
    parse everything after the non-parameter value of a specific MIME header.

    Nrr]zparameter entry with no contentzinvalid parameter {!r}r�r�z)parameter with invalid trailing text {!r}r�r�)r�r�rhrrr3r4rr�rmr*rDr4r)rZmime_parametersr6rbr;r�rrr�parse_mime_parameters�	sJ



�

�

�r�cCs�|rV|ddkrV|dtkr>|�t|dd��|dd�}qt|�\}}|�|�q|s^dS|�tdd��|�t|dd���dS)zBDo our best to find the parameters in an invalid MIME header

    rr]rFr�Nr�)r=rhrr?r�)Z	tokenlistrr6rrr�_find_mime_parameters-
sr�c
Cs�t�}d}|s$|j�t�d��|Szt|�\}}Wn<tjk
rp|j�t�d�|���t	||�|YSX|�|�|r�|ddkr�|j�t�d��|r�t	||�|S|j
����|_
|�tdd��|dd	�}zt|�\}}Wn>tjk
�r*|j�t�d
�|���t	||�|YSX|�|�|j
����|_|�sP|S|ddk�r�|j�t�d�|���|`
|`t	||�|S|�tdd
��|�t|dd	���|S)z� maintype "/" subtype *( ";" parameter )

    The maintype and substype are tokens.  Theoretically they could
    be checked against the official IANA list + x-token, but we
    don't do that.
    Fz"Missing content type specificationz(Expected content maintype but found {!r}rr�zInvalid content typezcontent-type-separatorr�Nz'Expected content subtype but found {!r}r]z<Only parameters are valid after content type, but found {!r}r�)r�rrhrrirsrr�r*r�rr��lowerr�rr�r�)rZctypeZrecoverr6rrr�parse_content_type_header=
sd
�
�



�

�



��
r�c
Cs�t�}|s |j�t�d��|Szt|�\}}Wn<tjk
rl|j�t�d�|���t	||�|YSX|�|�|j
����|_
|s�|S|ddkr�|j�t�d�|���t	||�|S|�tdd��|�t|dd���|S)	z* disposition-type *( ";" parameter )

    zMissing content dispositionz+Expected content disposition but found {!r}rr]zCOnly parameters are valid after content disposition, but found {!r}r�r�N)r�rrhrrirsrr�r*r�rr�r�r�rr�)rZdisp_headerr6rrr� parse_content_disposition_headerv
s:
�
�



��
r�c
Cs�t�}|s |j�t�d��|Szt|�\}}Wn.tjk
r^|j�t�d�|���YnX|�|�|j	�
���|_|s�|S|r�|j�t�d��|dt
kr�|�t|dd��|dd�}q�t|�\}}|�|�q�|S)z mechanism

    z!Missing content transfer encodingz1Expected content transfer encoding but found {!r}z*Extra text after content transfer encodingrrFr�N)r�rrhrrirsrr�r*rr�r�r_r=rr?)rZ
cte_headerr6rrr�&parse_content_transfer_encoding_header�
s4
�
�

�r�cCsDd}|r@|dr@|ddtkr@|dd}|ddd�|d<|S)Nrr�)r)�linesZwsprrr�_steal_trailing_WSP_if_exists�
s
r�cCs�|jp
tj}|jrdnd}dg}d}d}d}tdd�}t|�}	|	�r�|	�d�}
|
|kr`|d8}q>t|
�}|
jd	kr�t	|�t
@r�d
}z|�|�|}Wn6tk
r�t
dd�|
jD��r�d
}nd}d
}YnX|
jdkr�t|
|||�q>|�r�|�s�|
j�spd}d}|
j�rp|
j|d�dt|j��}
|j|
k�rpt|
�|t|d�k�r^t|�}|�|�|d|
7<q>t|
d��s�t|
�|	}	nt|||||
j|�}d}q>t|�|t|d�k�r�|d|7<q>|
j�rt|�d|k�rt|�}|�s|
���r|�||�d}q>t|
d��sNt|
�}|
j�sD|d7}|�|�||	}	q>|
j�rn|�sn|	�d|
�d
}q>t|�}|�s�|
���r�|�||�q>|d|7<q>|j�|�|jS)zLReturn string of contents of parse_tree folded according to RFC rules.

    �utf-8r�rNrF�wrap_as_ew_blockedr�r�Tcss|]}t|tj�VqdSr)r�rr�r rrrr#�
s�z%_refold_parse_tree.<locals>.<genexpr>�unknown-8bitr�r7r�rC)Zmax_line_length�sys�maxsize�utf8r�r�r�r
rDr�r:rCr�rZr-�_fold_mime_parametersr1rHr;r�r�r�rhrE�_fold_as_ewrIr0�insertr%)Z
parse_treer8�maxlenr�r��last_ewr�Z
want_encodingZend_ew_not_allowedr�r2�tstrr`Zencoded_part�newlineZnewpartsrrrr9�
s�


�



��
r9cCs�|dk	r<|r<tt|d|d�|��}|dd|�|d<|dtkr�|d}|dd�}t|d�|krz|�t|��|d|7<d}|dtkr�|d}|dd�}|dkr�t|d�n|}|dkr�dn|}	t|	�d}
|
d|kr�t�d	��|�r�|t|d�}||
}|dk�r,|�d
�q�|d|�}
tj	|
|	d�}t|�|}|dk�r�|
dd�}
tj	|
|	d�}t|�|}�qR|d|7<|t|
�d�}|r�|�d
�t|d�}q�|d|7<|�r�|SdS)a�Fold string to_encode into lines as encoded word, combining if allowed.
    Return the new value for last_ew, or None if ew_combine_allowed is False.

    If there is already an encoded word in the last line of lines (indicated by
    a non-None value for last_ew) and ew_combine_allowed is true, decode the
    existing ew, combine it with to_encode, and re-encode.  Otherwise, encode
    to_encode.  In either case, split to_encode as necessary so that the
    encoded segments fit within maxlen.

    Nr�rr�rr�r��z3max_line_length is too small to fit an encoded wordrN)r`)
r
r(rr�rhr�rrrrC)Z	to_encoder�r�r�rIr`Zleading_wspZtrailing_wspZnew_last_ewZ	encode_as�
chrome_lenZremaining_spaceZ
text_spaceZto_encode_wordZencoded_wordZexcessrrrr�1sT��



r�c	Cs�|jD�]�\}}|d���d�s2|dd7<|}d}z|�|�d}Wn0tk
r|d}t�|�rtd}d}nd}YnX|r�tjj	|d	|d
�}	d�
|||	�}
nd�
|t|��}
t|d�t|
�d
|kr�|dd|
|d<qn"t|
�d|k�r
|�
d|
�qd}|d}|rt|�tt|��dt|�}
||
dk�rLd}||
d}}|d|�}tjj	|d	|d
�}	t|	�|k�r��q�|d
8}�q\|�
d�
||||	��d	}|d
7}||d�}|�r|dd7<�qqdS)a>Fold TokenList 'part' into the 'lines' list as mime parameters.

    Using the decoded list of parameters and values, format them according to
    the RFC rules, including using RFC2231 encoding if the value cannot be
    expressed in 'encoding' and/or the parameter+value is too long to fit
    within 'maxlen'.

    r�r]�strictFTr�r�r�r)Zsaferz
{}*={}''{}r�r�rNr�rz''r��NNz {}*{}*={}{})r�r�r�rCr�rr�r�r�ror*rr�rhr
)r2r�r�r�r�rr`Z
error_handlerZencoding_requiredZ
encoded_valuer�r�Zextra_chromer�Z
splitpointZmaxchars�partialrrrr�rsn


� ��r�)�r�rer�r��stringr�operatorrZemailrrrrr�rr3r:r6r�r=Z	TSPECIALSrrZ	ASPECIALSrwr}r�compile�VERBOSE�	MULTILINEr$r�rrLrRrUrWrXrZr\r]rbrmrnrqr{r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r
r�rrrrrr�rRrSr*r%r�rr�matchr.�findallr	rortr{rrrr"r(r+r,r0r1r2r4r5r7r8r9r<r?rErBrGrKrMrNrPrTrWrXrYr[r\r^r_r`rarcrdrfrgrlrmrprsrvryr|r~r�r�r�r�r�r�r�r�r�r9r�r�rrrr�<module>s.E
�C"	
!*$
V	+





����
1C+
"&'/'&).9%7ED49/gAemail/__pycache__/__init__.cpython-38.opt-2.pyc000064400000002054151153537650015206 0ustar00U

e5d��@sJdddddddddd	d
ddd
dddgZdd�Zdd�Zdd	�Zdd
�ZdS)Z
base64mime�charsetZencoders�errorsZ
feedparser�	generator�headerZ	iterators�message�message_from_file�message_from_binary_file�message_from_string�message_from_bytesZmime�parserZ
quoprimimeZutilscOsddlm}|||��|�S�N�)�Parser)�email.parserr
Zparsestr)�s�args�kwsr
�r�&/usr/lib64/python3.8/email/__init__.pyr scOsddlm}|||��|�S�Nr)�BytesParser)rrZ
parsebytes)rrrrrrrr	(scOsddlm}|||��|�Sr)rr
�parse)�fprrr
rrrr0scOsddlm}|||��|�Sr)rrr)rrrrrrrr8sN)�__all__rr	rrrrrr�<module>s*�email/__pycache__/generator.cpython-38.opt-1.pyc000064400000030356151153537650015442 0ustar00U

e5d�N�@s�dZdddgZddlZddlZddlZddlZddlmZddlm	Z	m
Z
ddlmZd	Z
d
Ze�d�Ze�dej�ZGd
d�d�ZGdd�de�ZdZGdd�de�Zeeejd��ZdeZejZdS)z:Classes to generate plain text from a message object tree.�	Generator�DecodedGenerator�BytesGenerator�N)�deepcopy)�StringIO�BytesIO)�_has_surrogates�_�
z
\r\n|\r|\nz^From c@s�eZdZdZd'dd�dd�Zdd�Zd(d	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZeZdd�Zdd�Zdd �Zd!d"�Zed)d#d$��Zed%d&��ZdS)*rz�Generates output from a Message object tree.

    This basic generator writes the message to the given file object as plain
    text.
    N��policycCs6|dkr|dkrdn|j}||_||_||_||_dS)a�Create the generator for message flattening.

        outfp is the output file-like object for writing the message to.  It
        must have a write() method.

        Optional mangle_from_ is a flag that, when True (the default if policy
        is not set), escapes From_ lines in the body of the message by putting
        a `>' in front of them.

        Optional maxheaderlen specifies the longest length for a non-continued
        header.  When a header line is longer (in characters, with tabs
        expanded to 8 spaces) than maxheaderlen, the header will split as
        defined in the Header class.  Set maxheaderlen to zero to disable
        header wrapping.  The default is 78, as recommended (but not required)
        by RFC 2822.

        The policy keyword specifies a policy object that controls a number of
        aspects of the generator's operation.  If no policy is specified,
        the policy associated with the Message object passed to the
        flatten method is used.

        NT)�mangle_from_�_fp�
_mangle_from_�maxheaderlenr)�self�outfpr
rr�r�'/usr/lib64/python3.8/email/generator.py�__init__$szGenerator.__init__cCs|j�|�dS�N)r�write�r�srrrrDszGenerator.writeFcCs�|jdkr|jn|j}|dk	r*|j|d�}|jdk	rB|j|jd�}|j|_|�|j�|_d|_|�|j�|_|j}|j}zL||_||_|r�|�	�}|s�dt
�t
�
��}|�||j�|�
|�W5||_||_XdS)a�Print the message object tree rooted at msg to the output file
        specified when the Generator instance was created.

        unixfrom is a flag that forces the printing of a Unix From_ delimiter
        before the first object in the message tree.  If the original message
        has no From_ delimiter, a `standard' one is crafted.  By default, this
        is False to inhibit the printing of any From_ delimiter.

        Note that for subobjects, no From_ line is printed.

        linesep specifies the characters used to indicate a new line in
        the output.  The default value is determined by the policy specified
        when the Generator instance was created or, if none was specified,
        from the policy associated with the msg.

        N)�linesep�Zmax_line_length�zFrom nobody )r�clonerr�_NL�_encode�_encoded_NLZ_EMPTY�_encoded_EMPTYZget_unixfrom�time�ctimer�_write)r�msg�unixfromrrZold_gen_policyZold_msg_policyZufromrrr�flattenHs,
zGenerator.flattencCs|j||jd|jd�S)z1Clone this generator with the exact same options.Nr)�	__class__rr)r�fprrrrys
�zGenerator.clonecCst�Sr)r�rrrr�_new_buffer�szGenerator._new_buffercCs|Srrrrrrr�szGenerator._encodecCsT|sdSt�|�}|dd�D]}|�|�|�|j�q|drP|�|d�dS)N���)�NLCRE�splitrr)r�lines�linerrr�_write_lines�s

zGenerator._write_linescCs�|j}z"d|_|��|_}|�|�W5||_|j}|`X|r�t|�}|�d�dkrd|d|d<n|�d|d�|�d|d�t|dd�}|dkr�|�|�n||�|j�	|�
��dS)N�content-transfer-encodingr�Content-Transfer-Encoding�content-type��_write_headers)r�
_munge_cter+�	_dispatchr�getZreplace_header�getattrr6r�getvalue)rr%ZoldfpZ	munge_cteZsfp�methrrrr$�s&zGenerator._writecCst|��}|��}t�||f��dd�}t|d|d�}|dkrh|�dd�}t|d|d�}|dkrh|j}||�dS)N�-r	Z_handle_)�get_content_maintype�get_content_subtype�
UNDERSCORE�join�replacer:�
_writeBody)rr%�main�subZspecificr<Zgenericrrrr8�szGenerator._dispatchcCs6|��D]\}}|�|j�||��q|�|j�dSr)�	raw_itemsrrZfoldr�rr%�h�vrrrr6�szGenerator._write_headerscCs�|��}|dkrdSt|t�s.tdt|���t|j�r~|�d�}|dk	r~t|�}|d=|�	||�|��}|d|df|_
|jr�t�
d|�}|�|�dS)Nzstring payload expected: %s�charsetr2r4�>From )�get_payload�
isinstance�str�	TypeError�typer�_payloadZ	get_paramrZset_payloadr7r�fcrerEr1)rr%�payloadrJrrr�_handle_text�s$


�zGenerator._handle_textcCs�g}|��}|dkrg}n(t|t�r2|�|�dSt|t�sB|g}|D]6}|��}|�|�}|j|d|jd�|�	|�
��qF|��}|s�|j�
|�}|�|�}|�|�|jdk	r�|jr�t�d|j�}	n|j}	|�|	�|�|j�|�d||j�|�r|j�|�d��|D],}
|�|jd||j�|j�|
��q|�|jd|d|j�|jdk	�r�|j�r�t�d|j�}n|j}|�|�dS)NF�r&rrKz--r)rLrMrNr�listr+rr'r�appendr;Zget_boundaryr rA�_make_boundaryZset_boundary�preamblerrRrEr1r�pop�epilogue)rr%ZmsgtextsZsubparts�partr�g�boundaryZalltextrYZ	body_partr[rrr�_handle_multipartsJ







zGenerator._handle_multipartcCs0|j}|jdd�|_z|�|�W5||_XdS)Nrr)rrr_)rr%�prrr�_handle_multipart_signed<s
z"Generator._handle_multipart_signedcCs�g}|��D]t}|��}|�|�}|j|d|jd�|��}|�|j�}|rv|d|jkrv|�	|j�
|dd���q|�	|�q|j�|j�
|��dS)NFrUr,)
rLr+rr'rr;r.r r!rWrArr)rr%Zblocksr\rr]�textr/rrr�_handle_message_delivery_statusGs
z)Generator._handle_message_delivery_statuscCs^|��}|�|�}|j}t|t�rD|j|�d�d|jd�|��}n
|�	|�}|j
�|�dS)NrFrU)r+rrQrMrVr'rLrr;rrr)rr%rr]rSrrr�_handle_message\s




zGenerator._handle_messagecCsvt�tj�}dt|d}|dkr(|S|}d}|�dt�|�dtj�}|�	|�sXqr|dt
|�}|d7}q0|S)Nz===============z==rz^--z(--)?$�.r5)�randomZ	randrange�sys�maxsize�_fmt�_compile_re�re�escape�	MULTILINE�searchrN)�clsrb�tokenr^�bZcounterZcrerrrrXus

zGenerator._make_boundarycCst�||�Sr)rk�compile�ror�flagsrrrrj�szGenerator._compile_re)NN)FN)N)�__name__�
__module__�__qualname__�__doc__rrr'rr+rr1r$r8r6rTrCr_rarcrd�classmethodrXrjrrrrrs.	� 
1'
:csPeZdZdZdd�Zdd�Zdd�Zdd	�Z�fd
d�ZeZ	e
dd
��Z�ZS)ra�Generates a bytes version of a Message object tree.

    Functionally identical to the base Generator except that the output is
    bytes and not string.  When surrogates were used in the input to encode
    bytes, these are decoded back to bytes for output.  If the policy has
    cte_type set to 7bit, then the message is transformed such that the
    non-ASCII bytes are properly content transfer encoded, using the charset
    unknown-8bit.

    The outfp object must accept bytes in its write method.
    cCs|j�|�dd��dS)N�ascii�surrogateescape)rr�encoderrrrr�szBytesGenerator.writecCst�Sr)rr*rrrr+�szBytesGenerator._new_buffercCs
|�d�S�Nrz)r|rrrrr�szBytesGenerator._encodecCs8|��D]\}}|j�|j�||��q|�|j�dSr)rFrrrZfold_binaryrrGrrrr6�szBytesGenerator._write_headerscs\|jdkrdSt|j�rH|jjdksH|jr:t�d|j�|_|�|j�ntt	|��
|�dS)NZ7bitrK)rQrrZcte_typerrRrEr1�superrrT)rr%�r(rrrT�s
zBytesGenerator._handle_textcCst�|�d�|�Sr})rkrrr|rsrrrrj�szBytesGenerator._compile_re)
rurvrwrxrr+rr6rTrCryrj�
__classcell__rrrrr�s
zD[Non-text (%(type)s) part of message omitted, filename %(filename)s]c@s(eZdZdZddd�dd�Zdd�ZdS)	rz�Generates a text representation of a message.

    Like the Generator base class, except that non-text parts are substituted
    with a format string representing the part.
    NrcCs.tj|||||d�|dkr$t|_n||_dS)a�Like Generator.__init__() except that an additional optional
        argument is allowed.

        Walks through all subparts of a message.  If the subpart is of main
        type `text', then it prints the decoded payload of the subpart.

        Otherwise, fmt is a format string that is used instead of the message
        payload.  fmt is expanded with the following keywords (in
        %(keyword)s format):

        type       : Full MIME type of the non-text part
        maintype   : Main MIME type of the non-text part
        subtype    : Sub-MIME type of the non-text part
        filename   : Filename of the non-text part
        description: Description associated with the non-text part
        encoding   : Content transfer encoding of the non-text part

        The default value for fmt is None, meaning

        [Non-text (%(type)s) part of message omitted, filename %(filename)s]
        rN)rr�_FMTri)rrr
rZfmtrrrrr�s�zDecodedGenerator.__init__cCs�|��D]v}|��}|dkr2t|jdd�|d�q|dkr<qt|j|��|��|��|�d�|�dd�|�d	d
�d�|d�qdS)NrbF)�decode)�fileZ	multipartz
[no filename]zContent-Descriptionz[no description]r3z
[no encoding])rP�maintypeZsubtype�filenameZdescription�encoding)	�walkr>�printrLriZget_content_typer?�get_filenamer9)rr%r\r�rrrr8�s(���	�zDecodedGenerator._dispatch)NNN)rurvrwrxrr8rrrrr�s
�r5z%%0%dd)rx�__all__rkrgr"rf�copyr�iorrZemail.utilsrr@�NLrrr-rmrRrrr�r�len�reprrhZ_widthrirXrrrr�<module>s*

t3;email/__pycache__/_encoded_words.cpython-38.opt-2.pyc000064400000007332151153537650016431 0ustar00U

e5dL!�@s�ddlZddlZddlZddlZddlmZmZddlmZdddddd	d
dgZ	e�
e�d�jd
d��Z
dd�ZGdd�de�Ze�Zdeed�<dd�Zdd�Zdd�Zdd�Zdd	�Zeed�Zdd
�Zeed�Zeed�Zddd�ZdS)�N)�
ascii_letters�digits)�errors�decode_q�encode_q�decode_b�encode_b�len_q�len_b�decode�encodes=([a-fA-F0-9]{2})cCst�|�d����S)N�)�bytes�fromhex�groupr)�m�r�,/usr/lib64/python3.8/email/_encoded_words.py�<lambda>A�rcCs|�dd�}t|�gfS)N�_� )�replace�_q_byte_subber)�encodedrrrrCsc@s,eZdZde�d�e�d�Zdd�ZdS)�	_QByteMaps-!*+/�asciicCs.||jkrt|�||<nd�|�||<||S)Nz={:02X})�safe�chr�format)�self�keyrrr�__missing__Ms
z_QByteMap.__missing__N)�__name__�
__module__�__qualname__rrrrr"rrrrrIsr�_� cCsd�dd�|D��S)N�css|]}t|VqdS�N)�_q_byte_map��.0�xrrr�	<genexpr>Zszencode_q.<locals>.<genexpr>)�join��bstringrrrrYscCstdd�|D��S)Ncss|]}tt|�VqdSr))�lenr*r+rrrr.]szlen_q.<locals>.<genexpr>)�sumr0rrrr	\scCs�t|�d}|r ddd|�nd}z&tj||dd�|rDt��gngfWStjk
�r�ztj|dd�t��gfWYStjk
r�z,tj|ddd�t��t��gfWYYStjk
r�|t��gfYYYSXYnXYnXdS)N�s===rT)ZvalidateFs==)	r2�base64Z	b64decoderZInvalidBase64PaddingDefect�binascii�ErrorZInvalidBase64CharactersDefectZInvalidBase64LengthDefect)rZpad_errZmissing_paddingrrrrds(��
��cCst�|��d�S)Nr)r5Z	b64encoderr0rrrr�scCs&tt|�d�\}}|d|r dndS)N�r4r)�divmodr2)r1Zgroups_of_3Zleftoverrrrr
�s)�q�bc	
Cs�|�d�\}}}}}|�d�\}}}|��}|�dd�}t||�\}}z|�|�}Wnvtk
r�|�t�	d�
|���|�|d�}YnBtk
r�|�dd�}|��dkr�|�t�d�
|���YnX||||fS)N�?�*r�surrogateescapez:Encoded word contains bytes not decodable using {} charset�unknown-8bitz<Unknown charset {} in encoded word; decoded as unknown bytes)
�split�	partition�lowerr�
_cte_decodersr�UnicodeError�appendrZUndecodableBytesDefectr�LookupErrorZCharsetError)	Zewr&�charsetZcteZ
cte_string�langr1Zdefects�stringrrrr�s&���utf-8r(cCs||dkr|�dd�}n
|�|�}|dkrTtd|�}td|�}||dkrPdnd}t||�}|rld|}d�||||�S)	Nr?rr>r:r;�r=z=?{}{}?{}?{}?=)r�_cte_encode_length�
_cte_encodersr)rIrG�encodingrHr1ZqlenZblenrrrrr�s
)rJNr()�rer5r6�	functoolsrIrrZemailr�__all__�partial�compile�subrr�dictrr*�ordrr	rrr
rCrrMrLrrrrr�<module>*sJ��&�+��email/__pycache__/encoders.cpython-38.pyc000064400000003116151153537650014311 0ustar00U

e5d��@sTdZddddgZddlmZddlmZdd	�Zd
d�Z	dd�Z
dd�Zd
d�ZdS)z Encodings and related functions.�encode_7or8bit�
encode_base64�encode_noop�
encode_quopri�)�encodebytes)�encodestringcCst|dd�}|�dd�S)NT)Z	quotetabs� s=20)�
_encodestring�replace)�s�enc�r
�&/usr/lib64/python3.8/email/encoders.py�_qencodesrcCs0|jdd�}tt|�d�}|�|�d|d<dS)zlEncode the message's payload in Base64.

    Also, add an appropriate Content-Transfer-Encoding header.
    T��decode�ascii�base64�Content-Transfer-EncodingN)�get_payload�str�_bencode�set_payload��msg�origZencdatar
r
rrs
cCs*|jdd�}t|�}|�|�d|d<dS)zvEncode the message's payload in quoted-printable.

    Also, add an appropriate Content-Transfer-Encoding header.
    Trzquoted-printablerN)rrrrr
r
rr&s
cCsX|jdd�}|dkr d|d<dSz|�d�Wntk
rJd|d<Yn
Xd|d<dS)z9Set the Content-Transfer-Encoding header to 7bit or 8bit.TrNZ7bitrrZ8bit)rr�UnicodeError)rrr
r
rr2scCsdS)zDo nothing.Nr
)rr
r
rrDsN)
�__doc__�__all__rrr�quoprirr	rrrrrr
r
r
r�<module>s�email/__pycache__/utils.cpython-38.pyc000064400000022510151153537650013646 0ustar00U

e5d�4�@sjdZddddddddd	d
ddd
ddgZddlZddlZddlZddlZddlZddlZddlZ	ddl
mZddl
mZ
ddl
mZddl
mZmZmZddlmZdZdZdZdZdZe�d�Ze�d�Zdd�Zdd �Zd7d"d�Zd#d�Zd$d%�Z d8d'd�Z!d9d(d�Z"d:d)d	�Z#d*d�Z$d+d�Z%d,d�Z&d-d�Z'd;d.d�Z(e�d/ej)�Z*d0d�Z+d<d3d�Z,d=d5d6�Z-dS)>zMiscellaneous utilities.�collapse_rfc2231_value�
decode_params�decode_rfc2231�encode_rfc2231�
formataddr�
formatdate�format_datetime�getaddresses�
make_msgid�	mktime_tz�	parseaddr�	parsedate�parsedate_tz�parsedate_to_datetime�unquote�N)�quote)�AddressList)r
)rr
�
_parsedate_tz)�Charsetz, �z
�'z[][\\()<>@,:;".]z[\\"]cCs*z|��WdStk
r$YdSXdS)z8Return True if s contains surrogate-escaped binary data.FTN)�encode�UnicodeEncodeError)�s�r�#/usr/lib64/python3.8/email/utils.py�_has_surrogates3s
rcCs|�dd�}|�dd�S)N�utf-8�surrogateescape�replace)r�decode)�stringZoriginal_bytesrrr�	_sanitize@sr"rcCs�|\}}|�d�|r�z|�d�Wn<tk
r`t|t�rFt|�}|�|�}d||fYSXd}t�|�rtd}t�	d|�}d||||fS|S)a�The inverse of parseaddr(), this takes a 2-tuple of the form
    (realname, email_address) and returns the string value suitable
    for an RFC 2822 From, To or Cc header.

    If the first element of pair is false, then the second element is
    returned unmodified.

    The optional charset is the character set that is used to encode
    realname in case realname is not ASCII safe.  Can be an instance of str or
    a Charset-like object which has a header_encode method.  Default is
    'utf-8'.
    �asciiz%s <%s>r�"z\\\g<0>z%s%s%s <%s>)
rr�
isinstance�strrZ
header_encode�
specialsre�search�	escapesre�sub)Zpair�charset�nameZaddressZencoded_nameZquotesrrrrLs 




cCst�|�}t|�}|jS)z7Return a list of (REALNAME, EMAIL) for each fieldvalue.)�
COMMASPACE�join�_AddressList�addresslist)Zfieldvalues�all�arrrrns
cCsfddddddddg|d	|d
ddd
dddddddddg|dd|d|d|d|d|fS)Nz"%s, %02d %s %04d %02d:%02d:%02d %sZMonZTueZWedZThuZFriZSatZSun��ZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDec�r���r)�	timetuple�zonerrr�_format_timetuple_and_zoneus&�
��r;FcCsR|dkrt��}|s|r,tj�|tjj�}ntj�|�}|rH|��}d}t||�S)a�Returns a date string as specified by RFC 2822, e.g.:

    Fri, 09 Nov 2001 01:08:47 -0000

    Optional timeval if given is a floating point time value as accepted by
    gmtime() and localtime(), otherwise the current time is used.

    Optional localtime is a flag that when True, interprets timeval, and
    returns a date relative to the local timezone instead of UTC, properly
    taking daylight savings time into account.

    Optional argument usegmt means that the timezone is written out as
    an ascii string, not numeric one (so "GMT" instead of "+0000"). This
    is needed for HTTP, and is only used when localtime==False.
    NF)�time�datetimeZ
fromtimestamp�timezone�utcZutcfromtimestamp�
astimezoner)�timeval�	localtime�usegmt�dtrrrr~scCsV|��}|r2|jdks$|jtjjkr,td��d}n|jdkrBd}n
|�d�}t||�S)a$Turn a datetime into a date string as specified in RFC 2822.

    If usegmt is True, dt must be an aware datetime with an offset of zero.  In
    this case 'GMT' will be rendered instead of the normal +0000 required by
    RFC2822.  This is to support HTTP headers involving date stamps.
    Nz%usegmt option requires a UTC datetimeZGMTz-0000z%z)r9�tzinfor=r>r?�
ValueError�strftimer;)rDrC�nowr:rrrr�s

cCs^tt��d�}t��}t�d�}|dkr0d}nd|}|dkrHt��}d|||||f}|S)a{Returns a string suitable for RFC 2822 compliant Message-ID, e.g:

    <142480216486.20800.16526388040877946887@nightshade.la.mastaler.com>

    Optional idstring if given is a string used to strengthen the
    uniqueness of the message id.  Optional domain if given provides the
    portion of the message id after the '@'.  It defaults to the locally
    defined hostname.
    �d�@Nr�.z<%d.%d.%d%s@%s>)�intr<�os�getpid�randomZgetrandbits�socketZgetfqdn)ZidstringZdomainrA�pidZrandintZmsgidrrrr	�s

cCsNt|��^}}|dkr(tj|dd��Stj|dd�dt�tj|d��i�S)Nr3rE��seconds)rr=r>�	timedelta)�dataZdtuple�tzrrrr�s�cCst|�j}|sdS|dS)z�
    Parse addr into its constituent realname and email address parts.

    Return a tuple of realname and email address, unless the parse fails, in
    which case return a 2-tuple of ('', '').
    )rrr)r/r0)ZaddrZaddrsrrrr�s
cCs`t|�dkr\|�d�r<|�d�r<|dd��dd��dd�S|�d�r\|�d�r\|dd�S|S)	zRemove quotes from a string.r5r$���z\\�\z\"�<�>)�len�
startswith�endswithr)r&rrrr�scCs&|�td�}t|�dkr"dd|fS|S)z#Decode string according to RFC 2231r4N)�split�TICKr[)r�partsrrrr�s
cCsDtjj|d|pdd�}|dkr*|dkr*|S|dkr6d}d|||fS)z�Encode string according to RFC 2231.

    If neither charset nor language is given, then s is returned as-is.  If
    charset is given but not language, the string is encoded using the empty
    string for language.
    rr#)Zsafe�encodingNz%s'%s'%s)�urllib�parser)rr+�languagerrrr�sz&^(?P<name>\w+)\*((?P<num>[0-9]+)\*?)?$c
Csl|dd�}g}i}|�d�\}}|�||f�|r�|�d�\}}|�d�rRd}nd}t|�}t�|�}|r�|�dd�\}}|dk	r�t|�}|�|g��|||f�q0|�|dt	|�f�q0|�rh|�
�D]�\}}g}d}	|��|D].\}}
}|�rtj
j|
d	d
�}
d}	|�|
�q�t	t�|��}|	�rTt|�\}}}|�|||d|ff�q�|�|d|f�q�|S)zDecode parameters list according to RFC 2231.

    params is a sequence of 2-tuples containing (param name, string value).
    Nr�*TFr,�numz"%s"zlatin-1)ra)�pop�appendr]r�rfc2231_continuation�match�grouprL�
setdefaultr�items�sortrbrc�EMPTYSTRINGr.r)
ZparamsZ
new_paramsZrfc2231_paramsr,�valueZencodedZmorfZ
continuationsZextendedrr+rdrrrrsD

r�us-asciicCsnt|t�rt|�dkrt|�S|\}}}|dkr4|}t|d�}zt|||�WStk
rht|�YSXdS)Nr6zraw-unicode-escape)r%�tupler[r�bytesr&�LookupError)rp�errorsZfallback_charsetr+rd�textZrawbytesrrrr9s

rWc	Cs|dkrtj�tjj���S|jdk	r.|��S|��dd�|f}t�|�}t�	|�}z tj
|jd�}t�||j�}Wn�t
k
r�|tjt�|�dd��}tjo�|jdk}|r�tjntj}|tj
|d�kr�t�|tj|�}n
t�|�}YnX|j|d�S)a�Return local time as an aware datetime object.

    If called without arguments, return current time.  Otherwise *dt*
    argument should be a datetime instance, and it is converted to the
    local time zone according to the system time zone database.  If *dt* is
    naive (that is, dt.tzinfo is None), it is assumed to be in local time.
    In this case, a positive or zero value for *isdst* causes localtime to
    presume initially that summer time (for example, Daylight Saving Time)
    is or is not (respectively) in effect for the specified time.  A
    negative value for *isdst* causes the localtime() function to attempt
    to divine whether summer time is in effect for the specified time.

    NrWrRr3r)rE)r=rHr>r?r@rEr9r<�mktimerBrT�	tm_gmtoff�tm_zone�AttributeError�gmtime�daylight�tm_isdst�altzone�tznamer)	rDZisdstZtmrSZlocaltmZdeltarVZdstZgmtoffrrrrBSs$


rB)r)NFF)F)NN)NN)rrq)NrW).�__doc__�__all__rM�rer<rOrPr=Zurllib.parserbZemail._parseaddrrrr/r
rr
rZ
email.charsetrr-roZUEMPTYSTRINGZCRLFr_�compiler'r)rr"rrr;rrr	rrrrr�ASCIIrirrrBrrrr�<module>sp�



"	



�8�
email/__pycache__/encoders.cpython-38.opt-1.pyc000064400000003116151153537650015250 0ustar00U

e5d��@sTdZddddgZddlmZddlmZdd	�Zd
d�Z	dd�Z
dd�Zd
d�ZdS)z Encodings and related functions.�encode_7or8bit�
encode_base64�encode_noop�
encode_quopri�)�encodebytes)�encodestringcCst|dd�}|�dd�S)NT)Z	quotetabs� s=20)�
_encodestring�replace)�s�enc�r
�&/usr/lib64/python3.8/email/encoders.py�_qencodesrcCs0|jdd�}tt|�d�}|�|�d|d<dS)zlEncode the message's payload in Base64.

    Also, add an appropriate Content-Transfer-Encoding header.
    T��decode�ascii�base64�Content-Transfer-EncodingN)�get_payload�str�_bencode�set_payload��msg�origZencdatar
r
rrs
cCs*|jdd�}t|�}|�|�d|d<dS)zvEncode the message's payload in quoted-printable.

    Also, add an appropriate Content-Transfer-Encoding header.
    Trzquoted-printablerN)rrrrr
r
rr&s
cCsX|jdd�}|dkr d|d<dSz|�d�Wntk
rJd|d<Yn
Xd|d<dS)z9Set the Content-Transfer-Encoding header to 7bit or 8bit.TrNZ7bitrrZ8bit)rr�UnicodeError)rrr
r
rr2scCsdS)zDo nothing.Nr
)rr
r
rrDsN)
�__doc__�__all__rrr�quoprirr	rrrrrr
r
r
r�<module>s�email/__pycache__/__init__.cpython-38.pyc000064400000003235151153537650014250 0ustar00U

e5d��@sNdZddddddddd	d
ddd
ddddgZdd�Zdd
�Zdd
�Zdd�ZdS)z?A package for parsing, handling, and generating email messages.Z
base64mime�charsetZencoders�errorsZ
feedparser�	generator�headerZ	iterators�message�message_from_file�message_from_binary_file�message_from_string�message_from_bytesZmime�parserZ
quoprimimeZutilscOsddlm}|||��|�S)zvParse a string into a Message object model.

    Optional _class and strict are passed to the Parser constructor.
    ���Parser)�email.parserr
Zparsestr)�s�args�kwsr
�r�&/usr/lib64/python3.8/email/__init__.pyr scOsddlm}|||��|�S)z|Parse a bytes string into a Message object model.

    Optional _class and strict are passed to the Parser constructor.
    r��BytesParser)rrZ
parsebytes)rrrrrrrr	(scOsddlm}|||��|�S)z�Read a file and parse its contents into a Message object model.

    Optional _class and strict are passed to the Parser constructor.
    rr)rr
�parse)�fprrr
rrrr0scOsddlm}|||��|�S)z�Read a binary file and parse its contents into a Message object model.

    Optional _class and strict are passed to the Parser constructor.
    rr)rrr)rrrrrrrr8sN)�__doc__�__all__rr	rrrrrr�<module>s,�email/__pycache__/_parseaddr.cpython-38.opt-2.pyc000064400000022446151153537650015562 0ustar00U

e5dE�@s�ddddgZddlZddlZdZdZdZd	d
ddd
dddddddddddd
dddddddgZd d!d"d#d$d%d&gZddddd'd(d)d'd*d)d+d*d,d+d-�Zd.d�Z	d/d0�Z
d1d�Zd2d�Zd3d�Z
Gd4d5�d5�ZGd6d7�d7e�ZdS)8�	mktime_tz�	parsedate�parsedate_tz�quote�N� �z, ZjanZfebZmarZaprZmayZjunZjulZaug�sep�octZnovZdecZjanuaryZfebruaryZmarchZaprilZjuneZjulyZaugustZ	septemberZoctoberZnovemberZdecemberZmonZtueZwedZthuZfriZsatZsunip���i���i���i����iD���i��)ZUTZUTCZGMT�ZZASTZADTZESTZEDTZCSTZCDTZMSTZMDTZPSTZPDTcCs,t|�}|sdS|ddkr$d|d<t|�S)N�	r)�
_parsedate_tz�tuple)�data�res�r�(/usr/lib64/python3.8/email/_parseaddr.pyr-sc
Cs�|sdS|��}|sdS|d�d�s6|d��tkr>|d=n.|d�d�}|dkrl|d|dd�|d<t|�dkr�|d�d�}t|�dkr�||dd�}t|�dk�r|d}|�d�}|dkr�|�d�}|dkr�|d|�||d�g|dd�<n
|�d	�t|�d
k�rdS|dd
�}|\}}}}}|��}|tk�rb||��}}|tk�rbdSt�	|�d}|dk�r�|d8}|ddk�r�|dd�}|�d�}|dk�r�||}}|ddk�r�|dd�}|d�
��s�||}}|ddk�r|dd�}|�d�}t|�d
k�r,|\}	}
d}n~t|�dk�rF|\}	}
}ndt|�dk�r�d|dk�r�|d�d�}t|�d
k�r�|\}	}
d}nt|�dk�r�|\}	}
}ndSz,t|�}t|�}t|	�}	t|
�}
t|�}Wntk
�r�YdSX|dk�r|dk�r|d7}n|d7}d}|�
�}|tk�r6t|}n>zt|�}Wntk
�rXYnX|dk�rt|�d��rtd}|�r�|dk�r�d}
|}nd}
|
|dd|dd}||||	|
|ddd|g
S)Nr�,���-��+���r���:��0�.�d�Dili�i�<)�split�endswith�lower�	_daynames�rfind�len�find�append�_monthnames�index�isdigit�int�
ValueError�upper�
_timezones�
startswith)r�iZstuff�sZddZmmZyyZtmZtzZthhZtmmZtssZtzoffsetZtzsignrrrr9s�


"














rcCs&t|�}t|t�r|dd�S|SdS)Nr)r�
isinstancer
�r�trrrr�s
cCs<|ddkr"t�|dd�d�St�|�}||dSdS)Nr�)r)�time�mktime�calendarZtimegmr5rrrr�s
cCs|�dd��dd�S)N�\z\\�"z\")�replace)�strrrrr�sc@sxeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	ddd�Z
dd�Zdd�Zdd�Z
ddd�Zdd�ZdS)�
AddrlistClasscCsZd|_d|_d|_d|_|j|j|_|j|j|j|_|j�dd�|_||_g|_	dS)Nz()<>@,:;."[]rz 	z
rr)
�specials�pos�LWSZCR�FWS�atomendsr=�
phraseends�field�commentlist��selfrFrrr�__init__�szAddrlistClass.__init__cCs�g}|jt|j�kr�|j|j|jdkr\|j|jdkrL|�|j|j�|jd7_q|j|jdkr�|j�|���qq�qt�|�S)Nz

r�()	rAr'rFrBr)rG�
getcomment�EMPTYSTRING�join)rIZwslistrrr�gotonext�szAddrlistClass.gotonextcCs:g}|jt|j�kr6|��}|r*||7}q|�d�q|S)N)rr)rAr'rF�
getaddressr))rI�resultZadrrr�getaddrlist�s
zAddrlistClass.getaddrlistcCs�g|_|��|j}|j}|��}|��g}|jt|j�kr\|rXt�|j�|dfg}�n\|j|jdkr�||_||_|��}t�|j�|fg}�n"|j|jdk�rg}t|j�}|jd7_|jt|j�k�r�|��|j|k�r|j|jdk�r|jd7_�q�||�	�}q�n�|j|jdk�rx|�
�}|j�rft�|�dd�|j�d	|fg}nt�|�|fg}n@|�r�t�|j�|dfg}n"|j|j|jk�r�|jd7_|��|jt|j�k�r�|j|jd
k�r�|jd7_|S)Nrz.@rr�;�<z (r�)r)rGrOrA�
getphraselistr'rF�SPACErN�getaddrspecrP�getrouteaddrr@)rIZoldposZoldcl�plistZ
returnlistZaddrspecZfieldlenZ	routeaddrrrrrPsX

���$zAddrlistClass.getaddresscCs�|j|jdkrdSd}|jd7_|��d}|jt|j�kr�|rT|��d}n~|j|jdkrv|jd7_q�n\|j|jdkr�|jd7_d}n8|j|jdkr�|jd7_n|��}|jd7_q�|��q2|S)	NrTFrr�>�@Tr)rFrArOr'�	getdomainrX)rIZexpectrouteZadlistrrrrYAs.
zAddrlistClass.getrouteaddrcCsTg}|��|jt|j�kr�d}|j|jdkrf|rH|d��sH|��|�d�|jd7_d}nd|j|jdkr�|�dt|����n<|j|j|j	kr�|r�|d��s�|��q�n|�|�
��|��}|r|r|�|�q|jt|j�k�s
|j|jdk�rt�|�S|�d�|jd7_|��|�
�}|�sFtSt�|�|S)	NTrrrFr<z"%s"r\)rOrAr'rF�strip�popr)r�getquoterD�getatomrMrNr])rIZaslistZpreserve_wsZwsZdomainrrrrXas:
$

zAddrlistClass.getaddrspeccCs�g}|jt|j�kr�|j|j|jkr6|jd7_q|j|jdkrX|j�|���q|j|jdkrx|�|���q|j|jdkr�|jd7_|�d�q|j|jdkr�tS|j|j|j	kr�q�q|�|�
��qt�|�S)NrrK�[rr\)rAr'rFrBrGr)rL�getdomainliteralrMrDrarN)rIZsdlistrrrr]�s"zAddrlistClass.getdomainTcCs�|j|j|krdSdg}d}|jd7_|jt|j�kr�|rX|�|j|j�d}np|j|j|krz|jd7_q�nN|r�|j|jdkr�|�|���q,n(|j|jdkr�d}n|�|j|j�|jd7_q,t�|�S)NrFrrKr;T)rFrAr'r)rLrMrN)rIZ	begincharZendcharsZ
allowcommentsZslistrrrr�getdelimited�s(
zAddrlistClass.getdelimitedcCs|�ddd�S)Nr<z"
F�rd�rIrrrr`�szAddrlistClass.getquotecCs|�ddd�S)NrKz)
TrerfrrrrL�szAddrlistClass.getcommentcCsd|�ddd�S)Nz[%s]rbz]
Frerfrrrrc�szAddrlistClass.getdomainliteralNcCsddg}|dkr|j}|jt|j�krZ|j|j|kr8qZn|�|j|j�|jd7_qt�|�S)Nrr)rDrAr'rFr)rMrN)rIrDZatomlistrrrra�szAddrlistClass.getatomcCs�g}|jt|j�kr�|j|j|jkr6|jd7_q|j|jdkrV|�|���q|j|jdkrx|j�|���q|j|j|jkr�q�q|�|�	|j��q|S)Nrr<rK)
rAr'rFrCr)r`rGrLrEra)rIrZrrrrV�szAddrlistClass.getphraselist)T)N)�__name__�
__module__�__qualname__rJrOrRrPrYrXr]rdr`rLrcrarVrrrrr?�s
; &
%
r?c@sDeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�AddressListcCs&t�||�|r|��|_ng|_dS�N)r?rJrR�addresslistrHrrrrJ�szAddressList.__init__cCs
t|j�Srk)r'rlrfrrr�__len__szAddressList.__len__cCs>td�}|jdd�|_|jD]}||jkr|j�|�q|Srk�rjrlr)�rI�otherZnewaddr�xrrr�__add__s

zAddressList.__add__cCs&|jD]}||jkr|j�|�q|Srk)rlr)�rIrprqrrr�__iadd__s

zAddressList.__iadd__cCs.td�}|jD]}||jkr|j�|�q|Srkrnrorrr�__sub__s


zAddressList.__sub__cCs&|jD]}||jkr|j�|�q|Srk)rl�removersrrr�__isub__s

zAddressList.__isub__cCs
|j|Srk)rl)rIr+rrr�__getitem__%szAddressList.__getitem__N)
rgrhrirJrmrrrtrurwrxrrrrrj�s	rj)�__all__r8r:rWrMZ
COMMASPACEr*r%r0rrrrrr?rjrrrr�<module>
sb���	w	

/email/__pycache__/base64mime.cpython-38.opt-1.pyc000064400000006245151153537650015410 0ustar00U

e5d�
�@stdZddddddgZddlmZdd	lmZmZd
ZdZdZ	d
Z
dd�Zddd�Zdefdd�Z
dd�ZeZeZdS)a�Base64 content transfer encoding per RFCs 2045-2047.

This module handles the content transfer encoding method defined in RFC 2045
to encode arbitrary 8-bit data using the three 8-bit bytes in four 7-bit
characters encoding known as Base64.

It is used in the MIME standards for email to attach images, audio, and text
using some 8-bit character sets to messages.

This module provides an interface to encode and decode both headers and bodies
with Base64 encoding.

RFC 2045 defines a method for including character set information in an
`encoded-word' in a header.  This method is commonly used for 8-bit real names
in To:, From:, Cc:, etc. fields, as well as Subject: lines.

This module does not do the line wrapping or end-of-line character conversion
necessary for proper internationalized headers; it only does dumb encoding and
decoding.  To deal with the various line wrapping issues, use the email.header
module.
�body_decode�body_encode�decode�decodestring�
header_encode�
header_length�)�	b64encode)�
b2a_base64�
a2b_base64z
�
��cCs*tt|�d�\}}|d}|r&|d7}|S)z6Return the length of s when it is encoded with base64.��)�divmod�len)�	bytearrayZgroups_of_3Zleftover�n�r�(/usr/lib64/python3.8/email/base64mime.pyr2s
�
iso-8859-1cCs6|sdSt|t�r|�|�}t|��d�}d||fS)z�Encode a single header line with Base64 encoding in a given charset.

    charset names the character set to use to encode the header.  It defaults
    to iso-8859-1.  Base64 encoding is defined in RFC 2045.
    r�asciiz=?%s?b?%s?=)�
isinstance�str�encoderr)Zheader_bytes�charsetZencodedrrrr=s

�LcCs~|s|Sg}|dd}tdt|�|�D]J}t||||���d�}|�t�rh|tkrh|dd�|}|�|�q(t�|�S)a1Encode a string with base64.

    Each line will be wrapped at, at most, maxlinelen characters (defaults to
    76 characters).

    Each line of encoded text will end with eol, which defaults to "\n".  Set
    this to "\r\n" if you will be using the result of this function directly
    in an email.
    rrrrN���)	�rangerr	r�endswith�NL�append�EMPTYSTRING�join)�sZ
maxlinelenZeolZencvecZ
max_unencoded�i�encrrrrLs
cCs.|s
t�St|t�r"t|�d��St|�SdS)z�Decode a raw base64 string, returning a bytes object.

    This function does not parse a full MIME header value encoded with
    base64 (like =?iso-8859-1?b?bmloISBuaWgh?=) -- please use the high
    level email.header class for that functionality.
    zraw-unicode-escapeN)�bytesrrr
r)�stringrrrrfs

N)r)�__doc__�__all__�base64rZbinasciir	r
ZCRLFr r"ZMISC_LENrrrrrrrrrr�<module>s&�

email/__pycache__/utils.cpython-38.opt-2.pyc000064400000014114151153537650014607 0ustar00U

e5d�4�@sfdddddddddd	d
ddd
dgZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddl	mZddl	m
Z
ddl	mZmZmZddlmZdZdZdZdZdZe�d�Ze�d�Zdd�Zdd�Zd6d!d�Zd"d�Zd#d$�Zd7d&d�Z d8d'd�Z!d9d(d�Z"d)d
�Z#d*d
�Z$d+d�Z%d,d�Z&d:d-d�Z'e�d.ej(�Z)d/d�Z*d;d2d�Z+d<d4d5�Z,dS)=�collapse_rfc2231_value�
decode_params�decode_rfc2231�encode_rfc2231�
formataddr�
formatdate�format_datetime�getaddresses�
make_msgid�	mktime_tz�	parseaddr�	parsedate�parsedate_tz�parsedate_to_datetime�unquote�N)�quote)�AddressList)r
)rr
�
_parsedate_tz)�Charsetz, �z
�'z[][\\()<>@,:;".]z[\\"]cCs*z|��WdStk
r$YdSXdS)NFT)�encode�UnicodeEncodeError)�s�r�#/usr/lib64/python3.8/email/utils.py�_has_surrogates3s
rcCs|�dd�}|�dd�S)N�utf-8�surrogateescape�replace)r�decode)�stringZoriginal_bytesrrr�	_sanitize@sr"rcCs�|\}}|�d�|r�z|�d�Wn<tk
r`t|t�rFt|�}|�|�}d||fYSXd}t�|�rtd}t�	d|�}d||||fS|S)N�asciiz%s <%s>r�"z\\\g<0>z%s%s%s <%s>)
rr�
isinstance�strrZ
header_encode�
specialsre�search�	escapesre�sub)Zpair�charset�nameZaddressZencoded_nameZquotesrrrrLs 




cCst�|�}t|�}|jS)N)�
COMMASPACE�join�_AddressList�addresslist)Zfieldvalues�all�arrrrns
cCsfddddddddg|d	|d
ddd
dddddddddg|dd|d|d|d|d|fS)Nz"%s, %02d %s %04d %02d:%02d:%02d %sZMonZTueZWedZThuZFriZSatZSun��ZJanZFebZMarZAprZMayZJunZJulZAugZSepZOctZNovZDec�r���r)�	timetuple�zonerrr�_format_timetuple_and_zoneus&�
��r;FcCsR|dkrt��}|s|r,tj�|tjj�}ntj�|�}|rH|��}d}t||�S)NF)�time�datetimeZ
fromtimestamp�timezone�utcZutcfromtimestamp�
astimezoner)�timeval�	localtime�usegmt�dtrrrr~scCsV|��}|r2|jdks$|jtjjkr,td��d}n|jdkrBd}n
|�d�}t||�S)Nz%usegmt option requires a UTC datetimeZGMTz-0000z%z)r9�tzinfor=r>r?�
ValueError�strftimer;)rDrC�nowr:rrrr�s

cCs^tt��d�}t��}t�d�}|dkr0d}nd|}|dkrHt��}d|||||f}|S)N�d�@r�.z<%d.%d.%d%s@%s>)�intr<�os�getpid�randomZgetrandbits�socketZgetfqdn)ZidstringZdomainrA�pidZrandintZmsgidrrrr	�s

cCsNt|��^}}|dkr(tj|dd��Stj|dd�dt�tj|d��i�S)Nr3rE��seconds)rr=r>�	timedelta)�dataZdtuple�tzrrrr�s�cCst|�j}|sdS|dS)N)rrr)r/r0)ZaddrZaddrsrrrr�s
cCs`t|�dkr\|�d�r<|�d�r<|dd��dd��dd�S|�d�r\|�d�r\|dd�S|S)	Nr5r$���z\\�\z\"�<�>)�len�
startswith�endswithr)r&rrrr�scCs&|�td�}t|�dkr"dd|fS|S)Nr4)�split�TICKr[)r�partsrrrr�s
cCsDtjj|d|pdd�}|dkr*|dkr*|S|dkr6d}d|||fS)Nrr#)Zsafe�encodingz%s'%s'%s)�urllib�parser)rr+�languagerrrr�sz&^(?P<name>\w+)\*((?P<num>[0-9]+)\*?)?$c
Csl|dd�}g}i}|�d�\}}|�||f�|r�|�d�\}}|�d�rRd}nd}t|�}t�|�}|r�|�dd�\}}|dk	r�t|�}|�|g��|||f�q0|�|dt	|�f�q0|�rh|�
�D]�\}}g}d}	|��|D].\}}
}|�rtj
j|
dd	�}
d}	|�|
�q�t	t�|��}|	�rTt|�\}}}|�|||d|ff�q�|�|d|f�q�|S)
Nr�*TFr,�numz"%s"zlatin-1)ra)�pop�appendr]r�rfc2231_continuation�match�grouprL�
setdefaultr�items�sortrbrc�EMPTYSTRINGr.r)
ZparamsZ
new_paramsZrfc2231_paramsr,�valueZencodedZmorfZ
continuationsZextendedrr+rdrrrrsD

r�us-asciicCsnt|t�rt|�dkrt|�S|\}}}|dkr4|}t|d�}zt|||�WStk
rht|�YSXdS)Nr6zraw-unicode-escape)r%�tupler[r�bytesr&�LookupError)rp�errorsZfallback_charsetr+rd�textZrawbytesrrrr9s

rWc	Cs|dkrtj�tjj���S|jdk	r.|��S|��dd�|f}t�|�}t�	|�}z tj
|jd�}t�||j�}Wn�t
k
r�|tjt�|�dd��}tjo�|jdk}|r�tjntj}|tj
|d�kr�t�|tj|�}n
t�|�}YnX|j|d�S)NrWrRr3r)rE)r=rHr>r?r@rEr9r<�mktimerBrT�	tm_gmtoff�tm_zone�AttributeError�gmtime�daylight�tm_isdst�altzone�tznamer)	rDZisdstZtmrSZlocaltmZdeltarVZdstZgmtoffrrrrBSs$


rB)r)NFF)F)NN)NN)rrq)NrW)-�__all__rM�rer<rOrPr=Zurllib.parserbZemail._parseaddrrrr/r
rr
rZ
email.charsetrr-roZUEMPTYSTRINGZCRLFr_�compiler'r)rr"rrr;rrr	rrrrr�ASCIIrirrrBrrrr�<module>sn�



"	



�8�
email/__pycache__/headerregistry.cpython-38.opt-1.pyc000064400000052752151153537650016501 0ustar00U

e5dKQ�@szdZddlmZddlmZddlmZddlmZGdd�d�ZGdd	�d	�Z	Gd
d�de
�Zdd
�ZGdd�d�Z
Gdd�de
�ZGdd�d�ZGdd�de�ZGdd�d�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�d�ZGd d!�d!�ZGd"d#�d#e�ZGd$d%�d%e�ZGd&d'�d'�ZGd(d)�d)�Zeeeeeeeeeeeeeeeeeeeed*�ZGd+d,�d,�Zd-S).a;Representing and manipulating email headers via custom objects.

This module provides an implementation of the HeaderRegistry API.
The implementation is designed to flexibly follow RFC5322 rules.

Eventually HeaderRegistry will be a public API, but it isn't yet,
and will probably change some before that happens.

�)�MappingProxyType)�utils)�errors)�_header_value_parserc@s^eZdZddd�Zedd��Zedd��Zed	d
��Zedd��Zd
d�Z	dd�Z
dd�ZdS)�Address�NcCs�d�td||||f��}d|ks(d|kr0td��|dk	r�|s@|rHtd��t�|�\}}|rjtd�||���|jrz|jd�|j}|j	}||_
||_||_dS)	a�Create an object representing a full email address.

        An address can have a 'display_name', a 'username', and a 'domain'.  In
        addition to specifying the username and domain separately, they may be
        specified together by using the addr_spec keyword *instead of* the
        username and domain keywords.  If an addr_spec string is specified it
        must be properly quoted according to RFC 5322 rules; an error will be
        raised if it is not.

        An Address object has display_name, username, domain, and addr_spec
        attributes, all of which are read-only.  The addr_spec and the string
        value of the object are both quoted according to RFC5322 rules, but
        without any Content Transfer Encoding.

        rN�
�
z8invalid arguments; address parts cannot contain CR or LFz=addrspec specified when username and/or domain also specifiedz6Invalid addr_spec; only '{}' could be parsed from '{}'r)
�join�filter�
ValueError�	TypeError�parserZ
get_addr_spec�format�all_defects�
local_part�domain�
_display_name�	_username�_domain)�self�display_name�usernamer�	addr_specZinputsZa_s�rest�r�,/usr/lib64/python3.8/email/headerregistry.py�__init__s&�
zAddress.__init__cCs|jS�N�r�rrrrr<szAddress.display_namecCs|jSr)rr rrrr@szAddress.usernamecCs|jSr)rr rrrrDszAddress.domaincCsTt|j�}t|�t|tj�kr.t�|j�}n|j}|jrH|d|jS|sPdS|S)z�The addr_spec (username@domain) portion of the address, quoted
        according to RFC 5322 rules, but with no Content Transfer Encoding.
        �@�<>)�setr�lenrZ
DOT_ATOM_ENDS�quote_stringr)r�namesetZlprrrrHs
zAddress.addr_speccCsd�|jj|j|j|j�S)Nz1{}(display_name={!r}, username={!r}, domain={!r}))r�	__class__�__name__rrrr rrr�__repr__Xs�zAddress.__repr__cCs^t|j�}t|�t|tj�kr.t�|j�}n|j}|rX|jdkrFdn|j}d�||�S|jS)Nr"rz{} <{}>)r#rr$r�SPECIALSr%rr)rr&�disprrrr�__str__]s
zAddress.__str__cCs8t|�t|�krdS|j|jko6|j|jko6|j|jkS�NF)�typerrr�r�otherrrr�__eq__hs
�
�zAddress.__eq__)rrrN)r(�
__module__�__qualname__r�propertyrrrrr)r,r1rrrrrs
*



rc@sFeZdZddd�Zedd��Zedd��Zdd	�Zd
d�Zdd
�Z	dS)�GroupNcCs||_|rt|�nt�|_dS)aCreate an object representing an address group.

        An address group consists of a display_name followed by colon and a
        list of addresses (see Address) terminated by a semi-colon.  The Group
        is created by specifying a display_name and a possibly empty list of
        Address objects.  A Group can also be used to represent a single
        address that is not in a group, which is convenient when manipulating
        lists that are a combination of Groups and individual Addresses.  In
        this case the display_name should be set to None.  In particular, the
        string representation of a Group whose display_name is None is the same
        as the Address object, if there is one and only one Address object in
        the addresses list.

        N)r�tuple�
_addresses)rr�	addressesrrrrrszGroup.__init__cCs|jSrrr rrrr�szGroup.display_namecCs|jSr)r7r rrrr8�szGroup.addressescCsd�|jj|j|j�S)Nz${}(display_name={!r}, addresses={!r})rr'r(rr8r rrrr)�s
�zGroup.__repr__cCs�|jdkr&t|j�dkr&t|jd�S|j}|dk	r\t|�}t|�t|tj�kr\t�|�}d�dd�|jD��}|r~d|n|}d�	||�S)N�r�, css|]}t|�VqdSr��str)�.0�xrrr�	<genexpr>�sz Group.__str__.<locals>.<genexpr>� z{}:{};)
rr$r8r<r#rr*r%r
r)rr+r&Zadrstrrrrr,�s
z
Group.__str__cCs,t|�t|�krdS|j|jko*|j|jkSr-)r.rr8r/rrrr1�s

�zGroup.__eq__)NN)
r(r2r3rr4rr8r)r,r1rrrrr5ps


r5c@sTeZdZdZdd�Zdd�Zedd��Zedd	��Zd
d�Z	e
dd
��Zdd�ZdS)�
BaseHeadera|Base class for message headers.

    Implements generic behavior and provides tools for subclasses.

    A subclass must define a classmethod named 'parse' that takes an unfolded
    value string and a dictionary as its arguments.  The dictionary will
    contain one key, 'defects', initialized to an empty list.  After the call
    the dictionary must contain two additional keys: parse_tree, set to the
    parse tree obtained from parsing the header, and 'decoded', set to the
    string value of the idealized representation of the data from the value.
    (That is, encoded words are decoded, and values that have canonical
    representations are so represented.)

    The defects key is intended to collect parsing defects, which the message
    parser will subsequently dispose of as appropriate.  The parser should not,
    insofar as practical, raise any errors.  Defects should be added to the
    list instead.  The standard header parsers register defects for RFC
    compliance issues, for obsolete RFC syntax, and for unrecoverable parsing
    errors.

    The parse method may add additional keys to the dictionary.  In this case
    the subclass must define an 'init' method, which will be passed the
    dictionary as its keyword arguments.  The method should use (usually by
    setting them as the value of similarly named attributes) and remove all the
    extra keys added by its parse method, and then use super to call its parent
    class with the remaining arguments and keywords.

    The subclass should also make sure that a 'max_count' attribute is defined
    that is either None or 1. XXX: need to better define this API.

    cCs\dgi}|�||�t�|d�r4t�|d�|d<t�||d�}|d=|j|f|�|S)N�defects�decoded)�parserZ_has_surrogates�	_sanitizer<�__new__�init)�cls�name�value�kwdsrrrrrF�szBaseHeader.__new__cCs||_||_||_dSr)�_name�_parse_tree�_defects)rrI�
parse_treerBrrrrG�szBaseHeader.initcCs|jSr)rLr rrrrI�szBaseHeader.namecCs
t|j�Sr)r6rNr rrrrB�szBaseHeader.defectscCst|jj|jjt|�f|jfSr)�_reconstruct_headerr'r(�	__bases__r<�__dict__r rrr�
__reduce__�s��zBaseHeader.__reduce__cCst�||�Sr)r<rF)rHrJrrr�_reconstruct�szBaseHeader._reconstructc	Cs`t�t�t�|jd�t�dd�g�g�}|jrH|�t�t�dd�g��|�|j�|j	|d�S)atFold header according to policy.

        The parsed representation of the header is folded according to
        RFC5322 rules, as modified by the policy.  If the parse tree
        contains surrogateescaped bytes, the bytes are CTE encoded using
        the charset 'unknown-8bit".

        Any non-ASCII characters in the parse tree are CTE encoded using
        charset utf-8. XXX: make this a policy setting.

        The returned value is an ASCII-only string possibly containing linesep
        characters, and ending with a linesep character.  The string includes
        the header name and the ': ' separator.

        zheader-name�:z
header-sepr@Zfws)�policy)
rZHeaderZHeaderLabelZ
ValueTerminalrIrM�appendZCFWSListZWhiteSpaceTerminal�fold)rrV�headerrrrrX�s
���zBaseHeader.foldN)
r(r2r3�__doc__rFrGr4rIrBrS�classmethodrTrXrrrrrA�s 




rAcCst||i��|�Sr)r.rT)Zcls_name�basesrJrrrrP
srPc@s&eZdZdZeej�Zedd��Z	dS)�UnstructuredHeaderNcCs"|�|�|d<t|d�|d<dS)NrOrC)�value_parserr<�rHrJrKrrrrDszUnstructuredHeader.parse)
r(r2r3�	max_count�staticmethodr�get_unstructuredr^r[rDrrrrr]s
r]c@seZdZdZdS)�UniqueUnstructuredHeaderr9N�r(r2r3r`rrrrrcsrccsFeZdZdZdZeej�Ze	dd��Z
�fdd�Zedd��Z
�ZS)	�
DateHeadera�Header whose value consists of a single timestamp.

    Provides an additional attribute, datetime, which is either an aware
    datetime using a timezone, or a naive datetime if the timezone
    in the input string is -0000.  Also accepts a datetime as input.
    The 'value' attribute is the normalized form of the timestamp,
    which means it is the output of format_datetime on the datetime.
    NcCsz|s6|d�t���d|d<d|d<t��|d<dSt|t�rJt�|�}||d<t�	|d�|d<|�
|d�|d<dS)NrB�datetimerrCrO)rWrZHeaderMissingRequiredValuerZ	TokenList�
isinstancer<rZparsedate_to_datetimeZformat_datetimer^r_rrrrD.s

zDateHeader.parsecs|�d�|_t�j||�dS)Nrf)�pop�	_datetime�superrG�r�args�kw�r'rrrG<szDateHeader.initcCs|jSr)rir rrrrf@szDateHeader.datetime)r(r2r3rZr`rarrbr^r[rDrGr4rf�
__classcell__rrrnrres	


rec@seZdZdZdS)�UniqueDateHeaderr9NrdrrrrrpEsrpcsPeZdZdZedd��Zedd��Z�fdd�Ze	dd	��Z
e	d
d��Z�ZS)�
AddressHeaderNcCst�|�\}}|Sr)rZget_address_list)rJ�address_listrrrr^NszAddressHeader.value_parsercCs�t|t�rV|�|�|d<}g}|jD]"}|�t|jdd�|jD���q&t|j	�}n"t
|d�sf|g}dd�|D�}g}||d<||d<d�d	d�|D��|d
<d|kr�|�|d
�|d<dS)NrOcSs*g|]"}t|jpd|jpd|jp"d��qS)r)rrrr)r=Zmbrrr�
<listcomp>]s
�
�z'AddressHeader.parse.<locals>.<listcomp>�__iter__cSs&g|]}t|d�std|g�n|�qS)r8N)�hasattrr5�r=�itemrrrrsfs��groupsrBr:cSsg|]}t|��qSrr;rvrrrrslsrC)rgr<r^r8rWr5rZ
all_mailboxes�listrrur
)rHrJrKrrrxZaddrrBrrrrDTs*


��
�zAddressHeader.parsecs(t|�d��|_d|_t�j||�dS)Nrx)r6rh�_groupsr7rjrGrkrnrrrGpszAddressHeader.initcCs|jSr)rzr rrrrxuszAddressHeader.groupscCs&|jdkr tdd�|jD��|_|jS)Ncss|]}|jD]
}|VqqdSr)r8)r=�group�addressrrrr?|s�z*AddressHeader.addresses.<locals>.<genexpr>)r7r6rzr rrrr8ys
zAddressHeader.addresses)
r(r2r3r`rar^r[rDrGr4rxr8rorrrnrrqJs


rqc@seZdZdZdS)�UniqueAddressHeaderr9Nrdrrrrr}�sr}c@seZdZedd��ZdS)�SingleAddressHeadercCs(t|j�dkrtd�|j���|jdS)Nr9z9value of single address header {} is not a single addressr)r$r8rrrIr rrrr|�s
�zSingleAddressHeader.addressN)r(r2r3r4r|rrrrr~�sr~c@seZdZdZdS)�UniqueSingleAddressHeaderr9Nrdrrrrr�srcsZeZdZdZeej�Zedd��Z	�fdd�Z
edd��Zedd	��Z
ed
d��Z�ZS)�MIMEVersionHeaderr9cCs�|�|�|d<}t|�|d<|d�|j�|jdkr<dn|j|d<|j|d<|jdk	rtd�|d|d�|d<nd|d<dS)NrOrCrB�major�minorz{}.{}�version)r^r<�extendrr�r�r�rHrJrKrOrrrrD�s

zMIMEVersionHeader.parsecs6|�d�|_|�d�|_|�d�|_t�j||�dS)Nr�r�r�)rh�_version�_major�_minorrjrGrkrnrrrG�szMIMEVersionHeader.initcCs|jSr)r�r rrrr��szMIMEVersionHeader.majorcCs|jSr)r�r rrrr��szMIMEVersionHeader.minorcCs|jSr)r�r rrrr��szMIMEVersionHeader.version)r(r2r3r`rarZparse_mime_versionr^r[rDrGr4r�r�r�rorrrnrr��s



r�cs8eZdZdZedd��Z�fdd�Zedd��Z�Z	S)�ParameterizedMIMEHeaderr9cCsZ|�|�|d<}t|�|d<|d�|j�|jdkrBi|d<ndd�|jD�|d<dS)NrOrCrB�paramscSs&i|]\}}t�|���t�|��qSr)rrE�lower)r=rIrJrrr�
<dictcomp>�s�z1ParameterizedMIMEHeader.parse.<locals>.<dictcomp>)r^r<r�rr�r�rrrrD�s

�zParameterizedMIMEHeader.parsecs|�d�|_t�j||�dS)Nr�)rh�_paramsrjrGrkrnrrrG�szParameterizedMIMEHeader.initcCs
t|j�Sr)rr�r rrrr��szParameterizedMIMEHeader.params)
r(r2r3r`r[rDrGr4r�rorrrnrr��s
r�csJeZdZeej�Z�fdd�Zedd��Z	edd��Z
edd��Z�ZS)	�ContentTypeHeadercs2t�j||�t�|jj�|_t�|jj�|_dSr)	rjrGrrErM�maintype�	_maintype�subtype�_subtyperkrnrrrG�szContentTypeHeader.initcCs|jSr)r�r rrrr��szContentTypeHeader.maintypecCs|jSr)r�r rrrr��szContentTypeHeader.subtypecCs|jd|jS)N�/)r�r�r rrr�content_type�szContentTypeHeader.content_type)
r(r2r3rarZparse_content_type_headerr^rGr4r�r�r�rorrrnrr��s


r�cs2eZdZeej�Z�fdd�Zedd��Z	�Z
S)�ContentDispositionHeadercs2t�j||�|jj}|dkr"|nt�|�|_dSr)rjrGrM�content_dispositionrrE�_content_disposition)rrlrmZcdrnrrrG�szContentDispositionHeader.initcCs|jSr)r�r rrrr��sz,ContentDispositionHeader.content_disposition)r(r2r3rarZ parse_content_disposition_headerr^rGr4r�rorrrnrr��s
r�csBeZdZdZeej�Zedd��Z	�fdd�Z
edd��Z�Z
S)�ContentTransferEncodingHeaderr9cCs2|�|�|d<}t|�|d<|d�|j�dS�NrOrCrB�r^r<r�rr�rrrrDsz#ContentTransferEncodingHeader.parsecs"t�j||�t�|jj�|_dSr)rjrGrrErM�cte�_cterkrnrrrGsz"ContentTransferEncodingHeader.initcCs|jSr)r�r rrrr�sz!ContentTransferEncodingHeader.cte)r(r2r3r`rarZ&parse_content_transfer_encoding_headerr^r[rDrGr4r�rorrrnrr��s

r�c@s&eZdZdZeej�Zedd��Z	dS)�MessageIDHeaderr9cCs2|�|�|d<}t|�|d<|d�|j�dSr�r�r�rrrrDszMessageIDHeader.parseN)
r(r2r3r`rarZparse_message_idr^r[rDrrrrr�s
r�)Zsubject�datezresent-datez	orig-dateZsenderz
resent-sender�toz	resent-toZccz	resent-ccZbccz
resent-bcc�fromzresent-fromzreply-tozmime-versionzcontent-typezcontent-dispositionzcontent-transfer-encodingz
message-idc@s8eZdZdZeedfdd�Zdd�Zdd�Zd	d
�Z	dS)�HeaderRegistryz%A header_factory and header registry.TcCs&i|_||_||_|r"|j�t�dS)a�Create a header_factory that works with the Policy API.

        base_class is the class that will be the last class in the created
        header class's __bases__ list.  default_class is the class that will be
        used if "name" (see __call__) does not appear in the registry.
        use_default_map controls whether or not the default mapping of names to
        specialized classes is copied in to the registry when the factory is
        created.  The default is True.

        N)�registry�
base_class�
default_class�update�_default_header_map)rr�r�Zuse_default_maprrrr9s
zHeaderRegistry.__init__cCs||j|��<dS)zLRegister cls as the specialized class for handling "name" headers.

        N)r�r��rrIrHrrr�map_to_typeKszHeaderRegistry.map_to_typecCs,|j�|��|j�}td|j||jfi�S)N�_)r��getr�r�r.r(r�r�rrr�__getitem__QszHeaderRegistry.__getitem__cCs||||�S)a�Create a header instance for header 'name' from 'value'.

        Creates a header instance by creating a specialized class for parsing
        and representing the specified header by combining the factory
        base_class with a specialized class from the registry or the
        default_class, and passing the name and value to the constructed
        class's constructor.

        r)rrIrJrrr�__call__Us
zHeaderRegistry.__call__N)
r(r2r3rZrAr]rr�r�r�rrrrr�5s�
r�N)rZ�typesrZemailrrrrrr5r<rArPr]rcrerprqr}r~rr�r�r�r�r�r�r�r�rrrr�<module>sX	`6d'7
%�email/__pycache__/base64mime.cpython-38.opt-2.pyc000064400000002664151153537650015412 0ustar00U

e5d�
�@spddddddgZddlmZddlmZmZd	Zd
ZdZdZ	d
d�Z
ddd�Zdefdd�Zdd�Z
e
Ze
ZdS)�body_decode�body_encode�decode�decodestring�
header_encode�
header_length�)�	b64encode)�
b2a_base64�
a2b_base64z
�
��cCs*tt|�d�\}}|d}|r&|d7}|S)N��)�divmod�len)�	bytearrayZgroups_of_3Zleftover�n�r�(/usr/lib64/python3.8/email/base64mime.pyr2s
�
iso-8859-1cCs6|sdSt|t�r|�|�}t|��d�}d||fS)Nr�asciiz=?%s?b?%s?=)�
isinstance�str�encoderr)Zheader_bytes�charsetZencodedrrrr=s

�LcCs~|s|Sg}|dd}tdt|�|�D]J}t||||���d�}|�t�rh|tkrh|dd�|}|�|�q(t�|�S)Nrrrr���)	�rangerr	r�endswith�NL�append�EMPTYSTRING�join)�sZ
maxlinelenZeolZencvecZ
max_unencoded�i�encrrrrLs
cCs.|s
t�St|t�r"t|�d��St|�SdS)Nzraw-unicode-escape)�bytesrrr
r)�stringrrrrfs

N)r)�__all__�base64rZbinasciir	r
ZCRLFr r"ZMISC_LENrrrrrrrrrr�<module>s$�

email/quoprimime.py000064400000023202151153537650010406 0ustar00# Copyright (C) 2001-2006 Python Software Foundation
# Author: Ben Gertzfield
# Contact: email-sig@python.org

"""Quoted-printable content transfer encoding per RFCs 2045-2047.

This module handles the content transfer encoding method defined in RFC 2045
to encode US ASCII-like 8-bit data called `quoted-printable'.  It is used to
safely encode text that is in a character set similar to the 7-bit US ASCII
character set, but that includes some 8-bit characters that are normally not
allowed in email bodies or headers.

Quoted-printable is very space-inefficient for encoding binary files; use the
email.base64mime module for that instead.

This module provides an interface to encode and decode both headers and bodies
with quoted-printable encoding.

RFC 2045 defines a method for including character set information in an
`encoded-word' in a header.  This method is commonly used for 8-bit real names
in To:/From:/Cc: etc. fields, as well as Subject: lines.

This module does not do the line wrapping or end-of-line character
conversion necessary for proper internationalized headers; it only
does dumb encoding and decoding.  To deal with the various line
wrapping issues, use the email.header module.
"""

__all__ = [
    'body_decode',
    'body_encode',
    'body_length',
    'decode',
    'decodestring',
    'header_decode',
    'header_encode',
    'header_length',
    'quote',
    'unquote',
    ]

import re

from string import ascii_letters, digits, hexdigits

CRLF = '\r\n'
NL = '\n'
EMPTYSTRING = ''

# Build a mapping of octets to the expansion of that octet.  Since we're only
# going to have 256 of these things, this isn't terribly inefficient
# space-wise.  Remember that headers and bodies have different sets of safe
# characters.  Initialize both maps with the full expansion, and then override
# the safe bytes with the more compact form.
_QUOPRI_MAP = ['=%02X' % c for c in range(256)]
_QUOPRI_HEADER_MAP = _QUOPRI_MAP[:]
_QUOPRI_BODY_MAP = _QUOPRI_MAP[:]

# Safe header bytes which need no encoding.
for c in b'-!*+/' + ascii_letters.encode('ascii') + digits.encode('ascii'):
    _QUOPRI_HEADER_MAP[c] = chr(c)
# Headers have one other special encoding; spaces become underscores.
_QUOPRI_HEADER_MAP[ord(' ')] = '_'

# Safe body bytes which need no encoding.
for c in (b' !"#$%&\'()*+,-./0123456789:;<>'
          b'?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`'
          b'abcdefghijklmnopqrstuvwxyz{|}~\t'):
    _QUOPRI_BODY_MAP[c] = chr(c)



# Helpers
def header_check(octet):
    """Return True if the octet should be escaped with header quopri."""
    return chr(octet) != _QUOPRI_HEADER_MAP[octet]


def body_check(octet):
    """Return True if the octet should be escaped with body quopri."""
    return chr(octet) != _QUOPRI_BODY_MAP[octet]


def header_length(bytearray):
    """Return a header quoted-printable encoding length.

    Note that this does not include any RFC 2047 chrome added by
    `header_encode()`.

    :param bytearray: An array of bytes (a.k.a. octets).
    :return: The length in bytes of the byte array when it is encoded with
        quoted-printable for headers.
    """
    return sum(len(_QUOPRI_HEADER_MAP[octet]) for octet in bytearray)


def body_length(bytearray):
    """Return a body quoted-printable encoding length.

    :param bytearray: An array of bytes (a.k.a. octets).
    :return: The length in bytes of the byte array when it is encoded with
        quoted-printable for bodies.
    """
    return sum(len(_QUOPRI_BODY_MAP[octet]) for octet in bytearray)


def _max_append(L, s, maxlen, extra=''):
    if not isinstance(s, str):
        s = chr(s)
    if not L:
        L.append(s.lstrip())
    elif len(L[-1]) + len(s) <= maxlen:
        L[-1] += extra + s
    else:
        L.append(s.lstrip())


def unquote(s):
    """Turn a string in the form =AB to the ASCII character with value 0xab"""
    return chr(int(s[1:3], 16))


def quote(c):
    return _QUOPRI_MAP[ord(c)]


def header_encode(header_bytes, charset='iso-8859-1'):
    """Encode a single header line with quoted-printable (like) encoding.

    Defined in RFC 2045, this `Q' encoding is similar to quoted-printable, but
    used specifically for email header fields to allow charsets with mostly 7
    bit characters (and some 8 bit) to remain more or less readable in non-RFC
    2045 aware mail clients.

    charset names the character set to use in the RFC 2046 header.  It
    defaults to iso-8859-1.
    """
    # Return empty headers as an empty string.
    if not header_bytes:
        return ''
    # Iterate over every byte, encoding if necessary.
    encoded = header_bytes.decode('latin1').translate(_QUOPRI_HEADER_MAP)
    # Now add the RFC chrome to each encoded chunk and glue the chunks
    # together.
    return '=?%s?q?%s?=' % (charset, encoded)


_QUOPRI_BODY_ENCODE_MAP = _QUOPRI_BODY_MAP[:]
for c in b'\r\n':
    _QUOPRI_BODY_ENCODE_MAP[c] = chr(c)

def body_encode(body, maxlinelen=76, eol=NL):
    """Encode with quoted-printable, wrapping at maxlinelen characters.

    Each line of encoded text will end with eol, which defaults to "\\n".  Set
    this to "\\r\\n" if you will be using the result of this function directly
    in an email.

    Each line will be wrapped at, at most, maxlinelen characters before the
    eol string (maxlinelen defaults to 76 characters, the maximum value
    permitted by RFC 2045).  Long lines will have the 'soft line break'
    quoted-printable character "=" appended to them, so the decoded text will
    be identical to the original text.

    The minimum maxlinelen is 4 to have room for a quoted character ("=XX")
    followed by a soft line break.  Smaller values will generate a
    ValueError.

    """

    if maxlinelen < 4:
        raise ValueError("maxlinelen must be at least 4")
    if not body:
        return body

    # quote special characters
    body = body.translate(_QUOPRI_BODY_ENCODE_MAP)

    soft_break = '=' + eol
    # leave space for the '=' at the end of a line
    maxlinelen1 = maxlinelen - 1

    encoded_body = []
    append = encoded_body.append

    for line in body.splitlines():
        # break up the line into pieces no longer than maxlinelen - 1
        start = 0
        laststart = len(line) - 1 - maxlinelen
        while start <= laststart:
            stop = start + maxlinelen1
            # make sure we don't break up an escape sequence
            if line[stop - 2] == '=':
                append(line[start:stop - 1])
                start = stop - 2
            elif line[stop - 1] == '=':
                append(line[start:stop])
                start = stop - 1
            else:
                append(line[start:stop] + '=')
                start = stop

        # handle rest of line, special case if line ends in whitespace
        if line and line[-1] in ' \t':
            room = start - laststart
            if room >= 3:
                # It's a whitespace character at end-of-line, and we have room
                # for the three-character quoted encoding.
                q = quote(line[-1])
            elif room == 2:
                # There's room for the whitespace character and a soft break.
                q = line[-1] + soft_break
            else:
                # There's room only for a soft break.  The quoted whitespace
                # will be the only content on the subsequent line.
                q = soft_break + quote(line[-1])
            append(line[start:-1] + q)
        else:
            append(line[start:])

    # add back final newline if present
    if body[-1] in CRLF:
        append('')

    return eol.join(encoded_body)



# BAW: I'm not sure if the intent was for the signature of this function to be
# the same as base64MIME.decode() or not...
def decode(encoded, eol=NL):
    """Decode a quoted-printable string.

    Lines are separated with eol, which defaults to \\n.
    """
    if not encoded:
        return encoded
    # BAW: see comment in encode() above.  Again, we're building up the
    # decoded string with string concatenation, which could be done much more
    # efficiently.
    decoded = ''

    for line in encoded.splitlines():
        line = line.rstrip()
        if not line:
            decoded += eol
            continue

        i = 0
        n = len(line)
        while i < n:
            c = line[i]
            if c != '=':
                decoded += c
                i += 1
            # Otherwise, c == "=".  Are we at the end of the line?  If so, add
            # a soft line break.
            elif i+1 == n:
                i += 1
                continue
            # Decode if in form =AB
            elif i+2 < n and line[i+1] in hexdigits and line[i+2] in hexdigits:
                decoded += unquote(line[i:i+3])
                i += 3
            # Otherwise, not in form =AB, pass literally
            else:
                decoded += c
                i += 1

            if i == n:
                decoded += eol
    # Special case if original string did not end with eol
    if encoded[-1] not in '\r\n' and decoded.endswith(eol):
        decoded = decoded[:-1]
    return decoded


# For convenience and backwards compatibility w/ standard base64 module
body_decode = decode
decodestring = decode



def _unquote_match(match):
    """Turn a match in the form =AB to the ASCII character with value 0xab"""
    s = match.group(0)
    return unquote(s)


# Header decoding is done a bit differently
def header_decode(s):
    """Decode a string encoded with RFC 2045 MIME header `Q' encoding.

    This function does not parse a full MIME header value encoded with
    quoted-printable (like =?iso-8859-1?q?Hello_World?=) -- please use
    the high level email.header class for that functionality.
    """
    s = s.replace('_', ' ')
    return re.sub(r'=[a-fA-F0-9]{2}', _unquote_match, s, flags=re.ASCII)
email/errors.py000064400000007077151153537650007547 0ustar00# Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org

"""email package exception classes."""


class MessageError(Exception):
    """Base class for errors in the email package."""


class MessageParseError(MessageError):
    """Base class for message parsing errors."""


class HeaderParseError(MessageParseError):
    """Error while parsing headers."""


class BoundaryError(MessageParseError):
    """Couldn't find terminating boundary."""


class MultipartConversionError(MessageError, TypeError):
    """Conversion to a multipart is prohibited."""


class CharsetError(MessageError):
    """An illegal charset was given."""


# These are parsing defects which the parser was able to work around.
class MessageDefect(ValueError):
    """Base class for a message defect."""

    def __init__(self, line=None):
        if line is not None:
            super().__init__(line)
        self.line = line

class NoBoundaryInMultipartDefect(MessageDefect):
    """A message claimed to be a multipart but had no boundary parameter."""

class StartBoundaryNotFoundDefect(MessageDefect):
    """The claimed start boundary was never found."""

class CloseBoundaryNotFoundDefect(MessageDefect):
    """A start boundary was found, but not the corresponding close boundary."""

class FirstHeaderLineIsContinuationDefect(MessageDefect):
    """A message had a continuation line as its first header line."""

class MisplacedEnvelopeHeaderDefect(MessageDefect):
    """A 'Unix-from' header was found in the middle of a header block."""

class MissingHeaderBodySeparatorDefect(MessageDefect):
    """Found line with no leading whitespace and no colon before blank line."""
# XXX: backward compatibility, just in case (it was never emitted).
MalformedHeaderDefect = MissingHeaderBodySeparatorDefect

class MultipartInvariantViolationDefect(MessageDefect):
    """A message claimed to be a multipart but no subparts were found."""

class InvalidMultipartContentTransferEncodingDefect(MessageDefect):
    """An invalid content transfer encoding was set on the multipart itself."""

class UndecodableBytesDefect(MessageDefect):
    """Header contained bytes that could not be decoded"""

class InvalidBase64PaddingDefect(MessageDefect):
    """base64 encoded sequence had an incorrect length"""

class InvalidBase64CharactersDefect(MessageDefect):
    """base64 encoded sequence had characters not in base64 alphabet"""

class InvalidBase64LengthDefect(MessageDefect):
    """base64 encoded sequence had invalid length (1 mod 4)"""

# These errors are specific to header parsing.

class HeaderDefect(MessageDefect):
    """Base class for a header defect."""

    def __init__(self, *args, **kw):
        super().__init__(*args, **kw)

class InvalidHeaderDefect(HeaderDefect):
    """Header is not valid, message gives details."""

class HeaderMissingRequiredValue(HeaderDefect):
    """A header that must have a value had none"""

class NonPrintableDefect(HeaderDefect):
    """ASCII characters outside the ascii-printable range found"""

    def __init__(self, non_printables):
        super().__init__(non_printables)
        self.non_printables = non_printables

    def __str__(self):
        return ("the following ASCII non-printables found in header: "
            "{}".format(self.non_printables))

class ObsoleteHeaderDefect(HeaderDefect):
    """Header uses syntax declared obsolete by RFC 5322"""

class NonASCIILocalPartDefect(HeaderDefect):
    """local_part contains non-ASCII characters"""
    # This defect only occurs during unicode parsing, not when
    # parsing messages decoded from binary.
email/contentmanager.py000064400000024713151153537650011234 0ustar00import binascii
import email.charset
import email.message
import email.errors
from email import quoprimime

class ContentManager:

    def __init__(self):
        self.get_handlers = {}
        self.set_handlers = {}

    def add_get_handler(self, key, handler):
        self.get_handlers[key] = handler

    def get_content(self, msg, *args, **kw):
        content_type = msg.get_content_type()
        if content_type in self.get_handlers:
            return self.get_handlers[content_type](msg, *args, **kw)
        maintype = msg.get_content_maintype()
        if maintype in self.get_handlers:
            return self.get_handlers[maintype](msg, *args, **kw)
        if '' in self.get_handlers:
            return self.get_handlers[''](msg, *args, **kw)
        raise KeyError(content_type)

    def add_set_handler(self, typekey, handler):
        self.set_handlers[typekey] = handler

    def set_content(self, msg, obj, *args, **kw):
        if msg.get_content_maintype() == 'multipart':
            # XXX: is this error a good idea or not?  We can remove it later,
            # but we can't add it later, so do it for now.
            raise TypeError("set_content not valid on multipart")
        handler = self._find_set_handler(msg, obj)
        msg.clear_content()
        handler(msg, obj, *args, **kw)

    def _find_set_handler(self, msg, obj):
        full_path_for_error = None
        for typ in type(obj).__mro__:
            if typ in self.set_handlers:
                return self.set_handlers[typ]
            qname = typ.__qualname__
            modname = getattr(typ, '__module__', '')
            full_path = '.'.join((modname, qname)) if modname else qname
            if full_path_for_error is None:
                full_path_for_error = full_path
            if full_path in self.set_handlers:
                return self.set_handlers[full_path]
            if qname in self.set_handlers:
                return self.set_handlers[qname]
            name = typ.__name__
            if name in self.set_handlers:
                return self.set_handlers[name]
        if None in self.set_handlers:
            return self.set_handlers[None]
        raise KeyError(full_path_for_error)


raw_data_manager = ContentManager()


def get_text_content(msg, errors='replace'):
    content = msg.get_payload(decode=True)
    charset = msg.get_param('charset', 'ASCII')
    return content.decode(charset, errors=errors)
raw_data_manager.add_get_handler('text', get_text_content)


def get_non_text_content(msg):
    return msg.get_payload(decode=True)
for maintype in 'audio image video application'.split():
    raw_data_manager.add_get_handler(maintype, get_non_text_content)


def get_message_content(msg):
    return msg.get_payload(0)
for subtype in 'rfc822 external-body'.split():
    raw_data_manager.add_get_handler('message/'+subtype, get_message_content)


def get_and_fixup_unknown_message_content(msg):
    # If we don't understand a message subtype, we are supposed to treat it as
    # if it were application/octet-stream, per
    # tools.ietf.org/html/rfc2046#section-5.2.4.  Feedparser doesn't do that,
    # so do our best to fix things up.  Note that it is *not* appropriate to
    # model message/partial content as Message objects, so they are handled
    # here as well.  (How to reassemble them is out of scope for this comment :)
    return bytes(msg.get_payload(0))
raw_data_manager.add_get_handler('message',
                                 get_and_fixup_unknown_message_content)


def _prepare_set(msg, maintype, subtype, headers):
    msg['Content-Type'] = '/'.join((maintype, subtype))
    if headers:
        if not hasattr(headers[0], 'name'):
            mp = msg.policy
            headers = [mp.header_factory(*mp.header_source_parse([header]))
                       for header in headers]
        try:
            for header in headers:
                if header.defects:
                    raise header.defects[0]
                msg[header.name] = header
        except email.errors.HeaderDefect as exc:
            raise ValueError("Invalid header: {}".format(
                                header.fold(policy=msg.policy))) from exc


def _finalize_set(msg, disposition, filename, cid, params):
    if disposition is None and filename is not None:
        disposition = 'attachment'
    if disposition is not None:
        msg['Content-Disposition'] = disposition
    if filename is not None:
        msg.set_param('filename',
                      filename,
                      header='Content-Disposition',
                      replace=True)
    if cid is not None:
        msg['Content-ID'] = cid
    if params is not None:
        for key, value in params.items():
            msg.set_param(key, value)


# XXX: This is a cleaned-up version of base64mime.body_encode (including a bug
# fix in the calculation of unencoded_bytes_per_line).  It would be nice to
# drop both this and quoprimime.body_encode in favor of enhanced binascii
# routines that accepted a max_line_length parameter.
def _encode_base64(data, max_line_length):
    encoded_lines = []
    unencoded_bytes_per_line = max_line_length // 4 * 3
    for i in range(0, len(data), unencoded_bytes_per_line):
        thisline = data[i:i+unencoded_bytes_per_line]
        encoded_lines.append(binascii.b2a_base64(thisline).decode('ascii'))
    return ''.join(encoded_lines)


def _encode_text(string, charset, cte, policy):
    lines = string.encode(charset).splitlines()
    linesep = policy.linesep.encode('ascii')
    def embedded_body(lines): return linesep.join(lines) + linesep
    def normal_body(lines): return b'\n'.join(lines) + b'\n'
    if cte==None:
        # Use heuristics to decide on the "best" encoding.
        if max((len(x) for x in lines), default=0) <= policy.max_line_length:
            try:
                return '7bit', normal_body(lines).decode('ascii')
            except UnicodeDecodeError:
                pass
            if policy.cte_type == '8bit':
                return '8bit', normal_body(lines).decode('ascii', 'surrogateescape')
        sniff = embedded_body(lines[:10])
        sniff_qp = quoprimime.body_encode(sniff.decode('latin-1'),
                                          policy.max_line_length)
        sniff_base64 = binascii.b2a_base64(sniff)
        # This is a little unfair to qp; it includes lineseps, base64 doesn't.
        if len(sniff_qp) > len(sniff_base64):
            cte = 'base64'
        else:
            cte = 'quoted-printable'
            if len(lines) <= 10:
                return cte, sniff_qp
    if cte == '7bit':
        data = normal_body(lines).decode('ascii')
    elif cte == '8bit':
        data = normal_body(lines).decode('ascii', 'surrogateescape')
    elif cte == 'quoted-printable':
        data = quoprimime.body_encode(normal_body(lines).decode('latin-1'),
                                      policy.max_line_length)
    elif cte == 'base64':
        data = _encode_base64(embedded_body(lines), policy.max_line_length)
    else:
        raise ValueError("Unknown content transfer encoding {}".format(cte))
    return cte, data


def set_text_content(msg, string, subtype="plain", charset='utf-8', cte=None,
                     disposition=None, filename=None, cid=None,
                     params=None, headers=None):
    _prepare_set(msg, 'text', subtype, headers)
    cte, payload = _encode_text(string, charset, cte, msg.policy)
    msg.set_payload(payload)
    msg.set_param('charset',
                  email.charset.ALIASES.get(charset, charset),
                  replace=True)
    msg['Content-Transfer-Encoding'] = cte
    _finalize_set(msg, disposition, filename, cid, params)
raw_data_manager.add_set_handler(str, set_text_content)


def set_message_content(msg, message, subtype="rfc822", cte=None,
                       disposition=None, filename=None, cid=None,
                       params=None, headers=None):
    if subtype == 'partial':
        raise ValueError("message/partial is not supported for Message objects")
    if subtype == 'rfc822':
        if cte not in (None, '7bit', '8bit', 'binary'):
            # http://tools.ietf.org/html/rfc2046#section-5.2.1 mandate.
            raise ValueError(
                "message/rfc822 parts do not support cte={}".format(cte))
        # 8bit will get coerced on serialization if policy.cte_type='7bit'.  We
        # may end up claiming 8bit when it isn't needed, but the only negative
        # result of that should be a gateway that needs to coerce to 7bit
        # having to look through the whole embedded message to discover whether
        # or not it actually has to do anything.
        cte = '8bit' if cte is None else cte
    elif subtype == 'external-body':
        if cte not in (None, '7bit'):
            # http://tools.ietf.org/html/rfc2046#section-5.2.3 mandate.
            raise ValueError(
                "message/external-body parts do not support cte={}".format(cte))
        cte = '7bit'
    elif cte is None:
        # http://tools.ietf.org/html/rfc2046#section-5.2.4 says all future
        # subtypes should be restricted to 7bit, so assume that.
        cte = '7bit'
    _prepare_set(msg, 'message', subtype, headers)
    msg.set_payload([message])
    msg['Content-Transfer-Encoding'] = cte
    _finalize_set(msg, disposition, filename, cid, params)
raw_data_manager.add_set_handler(email.message.Message, set_message_content)


def set_bytes_content(msg, data, maintype, subtype, cte='base64',
                     disposition=None, filename=None, cid=None,
                     params=None, headers=None):
    _prepare_set(msg, maintype, subtype, headers)
    if cte == 'base64':
        data = _encode_base64(data, max_line_length=msg.policy.max_line_length)
    elif cte == 'quoted-printable':
        # XXX: quoprimime.body_encode won't encode newline characters in data,
        # so we can't use it.  This means max_line_length is ignored.  Another
        # bug to fix later.  (Note: encoders.quopri is broken on line ends.)
        data = binascii.b2a_qp(data, istext=False, header=False, quotetabs=True)
        data = data.decode('ascii')
    elif cte == '7bit':
        # Make sure it really is only ASCII.  The early warning here seems
        # worth the overhead...if you care write your own content manager :).
        data.encode('ascii')
    elif cte in ('8bit', 'binary'):
        data = data.decode('ascii', 'surrogateescape')
    msg.set_payload(data)
    msg['Content-Transfer-Encoding'] = cte
    _finalize_set(msg, disposition, filename, cid, params)
for typ in (bytes, bytearray, memoryview):
    raw_data_manager.add_set_handler(typ, set_bytes_content)
email/_parseaddr.py000064400000042424151153537650010332 0ustar00# Copyright (C) 2002-2007 Python Software Foundation
# Contact: email-sig@python.org

"""Email address parsing code.

Lifted directly from rfc822.py.  This should eventually be rewritten.
"""

__all__ = [
    'mktime_tz',
    'parsedate',
    'parsedate_tz',
    'quote',
    ]

import time, calendar

SPACE = ' '
EMPTYSTRING = ''
COMMASPACE = ', '

# Parse a date field
_monthnames = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul',
               'aug', 'sep', 'oct', 'nov', 'dec',
               'january', 'february', 'march', 'april', 'may', 'june', 'july',
               'august', 'september', 'october', 'november', 'december']

_daynames = ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun']

# The timezone table does not include the military time zones defined
# in RFC822, other than Z.  According to RFC1123, the description in
# RFC822 gets the signs wrong, so we can't rely on any such time
# zones.  RFC1123 recommends that numeric timezone indicators be used
# instead of timezone names.

_timezones = {'UT':0, 'UTC':0, 'GMT':0, 'Z':0,
              'AST': -400, 'ADT': -300,  # Atlantic (used in Canada)
              'EST': -500, 'EDT': -400,  # Eastern
              'CST': -600, 'CDT': -500,  # Central
              'MST': -700, 'MDT': -600,  # Mountain
              'PST': -800, 'PDT': -700   # Pacific
              }


def parsedate_tz(data):
    """Convert a date string to a time tuple.

    Accounts for military timezones.
    """
    res = _parsedate_tz(data)
    if not res:
        return
    if res[9] is None:
        res[9] = 0
    return tuple(res)

def _parsedate_tz(data):
    """Convert date to extended time tuple.

    The last (additional) element is the time zone offset in seconds, except if
    the timezone was specified as -0000.  In that case the last element is
    None.  This indicates a UTC timestamp that explicitly declaims knowledge of
    the source timezone, as opposed to a +0000 timestamp that indicates the
    source timezone really was UTC.

    """
    if not data:
        return
    data = data.split()
    if not data:  # This happens for whitespace-only input.
        return None
    # The FWS after the comma after the day-of-week is optional, so search and
    # adjust for this.
    if data[0].endswith(',') or data[0].lower() in _daynames:
        # There's a dayname here. Skip it
        del data[0]
    else:
        i = data[0].rfind(',')
        if i >= 0:
            data[0] = data[0][i+1:]
    if len(data) == 3: # RFC 850 date, deprecated
        stuff = data[0].split('-')
        if len(stuff) == 3:
            data = stuff + data[1:]
    if len(data) == 4:
        s = data[3]
        i = s.find('+')
        if i == -1:
            i = s.find('-')
        if i > 0:
            data[3:] = [s[:i], s[i:]]
        else:
            data.append('') # Dummy tz
    if len(data) < 5:
        return None
    data = data[:5]
    [dd, mm, yy, tm, tz] = data
    mm = mm.lower()
    if mm not in _monthnames:
        dd, mm = mm, dd.lower()
        if mm not in _monthnames:
            return None
    mm = _monthnames.index(mm) + 1
    if mm > 12:
        mm -= 12
    if dd[-1] == ',':
        dd = dd[:-1]
    i = yy.find(':')
    if i > 0:
        yy, tm = tm, yy
    if yy[-1] == ',':
        yy = yy[:-1]
    if not yy[0].isdigit():
        yy, tz = tz, yy
    if tm[-1] == ',':
        tm = tm[:-1]
    tm = tm.split(':')
    if len(tm) == 2:
        [thh, tmm] = tm
        tss = '0'
    elif len(tm) == 3:
        [thh, tmm, tss] = tm
    elif len(tm) == 1 and '.' in tm[0]:
        # Some non-compliant MUAs use '.' to separate time elements.
        tm = tm[0].split('.')
        if len(tm) == 2:
            [thh, tmm] = tm
            tss = 0
        elif len(tm) == 3:
            [thh, tmm, tss] = tm
    else:
        return None
    try:
        yy = int(yy)
        dd = int(dd)
        thh = int(thh)
        tmm = int(tmm)
        tss = int(tss)
    except ValueError:
        return None
    # Check for a yy specified in two-digit format, then convert it to the
    # appropriate four-digit format, according to the POSIX standard. RFC 822
    # calls for a two-digit yy, but RFC 2822 (which obsoletes RFC 822)
    # mandates a 4-digit yy. For more information, see the documentation for
    # the time module.
    if yy < 100:
        # The year is between 1969 and 1999 (inclusive).
        if yy > 68:
            yy += 1900
        # The year is between 2000 and 2068 (inclusive).
        else:
            yy += 2000
    tzoffset = None
    tz = tz.upper()
    if tz in _timezones:
        tzoffset = _timezones[tz]
    else:
        try:
            tzoffset = int(tz)
        except ValueError:
            pass
        if tzoffset==0 and tz.startswith('-'):
            tzoffset = None
    # Convert a timezone offset into seconds ; -0500 -> -18000
    if tzoffset:
        if tzoffset < 0:
            tzsign = -1
            tzoffset = -tzoffset
        else:
            tzsign = 1
        tzoffset = tzsign * ( (tzoffset//100)*3600 + (tzoffset % 100)*60)
    # Daylight Saving Time flag is set to -1, since DST is unknown.
    return [yy, mm, dd, thh, tmm, tss, 0, 1, -1, tzoffset]


def parsedate(data):
    """Convert a time string to a time tuple."""
    t = parsedate_tz(data)
    if isinstance(t, tuple):
        return t[:9]
    else:
        return t


def mktime_tz(data):
    """Turn a 10-tuple as returned by parsedate_tz() into a POSIX timestamp."""
    if data[9] is None:
        # No zone info, so localtime is better assumption than GMT
        return time.mktime(data[:8] + (-1,))
    else:
        t = calendar.timegm(data)
        return t - data[9]


def quote(str):
    """Prepare string to be used in a quoted string.

    Turns backslash and double quote characters into quoted pairs.  These
    are the only characters that need to be quoted inside a quoted string.
    Does not add the surrounding double quotes.
    """
    return str.replace('\\', '\\\\').replace('"', '\\"')


class AddrlistClass:
    """Address parser class by Ben Escoto.

    To understand what this class does, it helps to have a copy of RFC 2822 in
    front of you.

    Note: this class interface is deprecated and may be removed in the future.
    Use email.utils.AddressList instead.
    """

    def __init__(self, field):
        """Initialize a new instance.

        `field' is an unparsed address header field, containing
        one or more addresses.
        """
        self.specials = '()<>@,:;.\"[]'
        self.pos = 0
        self.LWS = ' \t'
        self.CR = '\r\n'
        self.FWS = self.LWS + self.CR
        self.atomends = self.specials + self.LWS + self.CR
        # Note that RFC 2822 now specifies `.' as obs-phrase, meaning that it
        # is obsolete syntax.  RFC 2822 requires that we recognize obsolete
        # syntax, so allow dots in phrases.
        self.phraseends = self.atomends.replace('.', '')
        self.field = field
        self.commentlist = []

    def gotonext(self):
        """Skip white space and extract comments."""
        wslist = []
        while self.pos < len(self.field):
            if self.field[self.pos] in self.LWS + '\n\r':
                if self.field[self.pos] not in '\n\r':
                    wslist.append(self.field[self.pos])
                self.pos += 1
            elif self.field[self.pos] == '(':
                self.commentlist.append(self.getcomment())
            else:
                break
        return EMPTYSTRING.join(wslist)

    def getaddrlist(self):
        """Parse all addresses.

        Returns a list containing all of the addresses.
        """
        result = []
        while self.pos < len(self.field):
            ad = self.getaddress()
            if ad:
                result += ad
            else:
                result.append(('', ''))
        return result

    def getaddress(self):
        """Parse the next address."""
        self.commentlist = []
        self.gotonext()

        oldpos = self.pos
        oldcl = self.commentlist
        plist = self.getphraselist()

        self.gotonext()
        returnlist = []

        if self.pos >= len(self.field):
            # Bad email address technically, no domain.
            if plist:
                returnlist = [(SPACE.join(self.commentlist), plist[0])]

        elif self.field[self.pos] in '.@':
            # email address is just an addrspec
            # this isn't very efficient since we start over
            self.pos = oldpos
            self.commentlist = oldcl
            addrspec = self.getaddrspec()
            returnlist = [(SPACE.join(self.commentlist), addrspec)]

        elif self.field[self.pos] == ':':
            # address is a group
            returnlist = []

            fieldlen = len(self.field)
            self.pos += 1
            while self.pos < len(self.field):
                self.gotonext()
                if self.pos < fieldlen and self.field[self.pos] == ';':
                    self.pos += 1
                    break
                returnlist = returnlist + self.getaddress()

        elif self.field[self.pos] == '<':
            # Address is a phrase then a route addr
            routeaddr = self.getrouteaddr()

            if self.commentlist:
                returnlist = [(SPACE.join(plist) + ' (' +
                               ' '.join(self.commentlist) + ')', routeaddr)]
            else:
                returnlist = [(SPACE.join(plist), routeaddr)]

        else:
            if plist:
                returnlist = [(SPACE.join(self.commentlist), plist[0])]
            elif self.field[self.pos] in self.specials:
                self.pos += 1

        self.gotonext()
        if self.pos < len(self.field) and self.field[self.pos] == ',':
            self.pos += 1
        return returnlist

    def getrouteaddr(self):
        """Parse a route address (Return-path value).

        This method just skips all the route stuff and returns the addrspec.
        """
        if self.field[self.pos] != '<':
            return

        expectroute = False
        self.pos += 1
        self.gotonext()
        adlist = ''
        while self.pos < len(self.field):
            if expectroute:
                self.getdomain()
                expectroute = False
            elif self.field[self.pos] == '>':
                self.pos += 1
                break
            elif self.field[self.pos] == '@':
                self.pos += 1
                expectroute = True
            elif self.field[self.pos] == ':':
                self.pos += 1
            else:
                adlist = self.getaddrspec()
                self.pos += 1
                break
            self.gotonext()

        return adlist

    def getaddrspec(self):
        """Parse an RFC 2822 addr-spec."""
        aslist = []

        self.gotonext()
        while self.pos < len(self.field):
            preserve_ws = True
            if self.field[self.pos] == '.':
                if aslist and not aslist[-1].strip():
                    aslist.pop()
                aslist.append('.')
                self.pos += 1
                preserve_ws = False
            elif self.field[self.pos] == '"':
                aslist.append('"%s"' % quote(self.getquote()))
            elif self.field[self.pos] in self.atomends:
                if aslist and not aslist[-1].strip():
                    aslist.pop()
                break
            else:
                aslist.append(self.getatom())
            ws = self.gotonext()
            if preserve_ws and ws:
                aslist.append(ws)

        if self.pos >= len(self.field) or self.field[self.pos] != '@':
            return EMPTYSTRING.join(aslist)

        aslist.append('@')
        self.pos += 1
        self.gotonext()
        domain = self.getdomain()
        if not domain:
            # Invalid domain, return an empty address instead of returning a
            # local part to denote failed parsing.
            return EMPTYSTRING
        return EMPTYSTRING.join(aslist) + domain

    def getdomain(self):
        """Get the complete domain name from an address."""
        sdlist = []
        while self.pos < len(self.field):
            if self.field[self.pos] in self.LWS:
                self.pos += 1
            elif self.field[self.pos] == '(':
                self.commentlist.append(self.getcomment())
            elif self.field[self.pos] == '[':
                sdlist.append(self.getdomainliteral())
            elif self.field[self.pos] == '.':
                self.pos += 1
                sdlist.append('.')
            elif self.field[self.pos] == '@':
                # bpo-34155: Don't parse domains with two `@` like
                # `a@malicious.org@important.com`.
                return EMPTYSTRING
            elif self.field[self.pos] in self.atomends:
                break
            else:
                sdlist.append(self.getatom())
        return EMPTYSTRING.join(sdlist)

    def getdelimited(self, beginchar, endchars, allowcomments=True):
        """Parse a header fragment delimited by special characters.

        `beginchar' is the start character for the fragment.
        If self is not looking at an instance of `beginchar' then
        getdelimited returns the empty string.

        `endchars' is a sequence of allowable end-delimiting characters.
        Parsing stops when one of these is encountered.

        If `allowcomments' is non-zero, embedded RFC 2822 comments are allowed
        within the parsed fragment.
        """
        if self.field[self.pos] != beginchar:
            return ''

        slist = ['']
        quote = False
        self.pos += 1
        while self.pos < len(self.field):
            if quote:
                slist.append(self.field[self.pos])
                quote = False
            elif self.field[self.pos] in endchars:
                self.pos += 1
                break
            elif allowcomments and self.field[self.pos] == '(':
                slist.append(self.getcomment())
                continue        # have already advanced pos from getcomment
            elif self.field[self.pos] == '\\':
                quote = True
            else:
                slist.append(self.field[self.pos])
            self.pos += 1

        return EMPTYSTRING.join(slist)

    def getquote(self):
        """Get a quote-delimited fragment from self's field."""
        return self.getdelimited('"', '"\r', False)

    def getcomment(self):
        """Get a parenthesis-delimited fragment from self's field."""
        return self.getdelimited('(', ')\r', True)

    def getdomainliteral(self):
        """Parse an RFC 2822 domain-literal."""
        return '[%s]' % self.getdelimited('[', ']\r', False)

    def getatom(self, atomends=None):
        """Parse an RFC 2822 atom.

        Optional atomends specifies a different set of end token delimiters
        (the default is to use self.atomends).  This is used e.g. in
        getphraselist() since phrase endings must not include the `.' (which
        is legal in phrases)."""
        atomlist = ['']
        if atomends is None:
            atomends = self.atomends

        while self.pos < len(self.field):
            if self.field[self.pos] in atomends:
                break
            else:
                atomlist.append(self.field[self.pos])
            self.pos += 1

        return EMPTYSTRING.join(atomlist)

    def getphraselist(self):
        """Parse a sequence of RFC 2822 phrases.

        A phrase is a sequence of words, which are in turn either RFC 2822
        atoms or quoted-strings.  Phrases are canonicalized by squeezing all
        runs of continuous whitespace into one space.
        """
        plist = []

        while self.pos < len(self.field):
            if self.field[self.pos] in self.FWS:
                self.pos += 1
            elif self.field[self.pos] == '"':
                plist.append(self.getquote())
            elif self.field[self.pos] == '(':
                self.commentlist.append(self.getcomment())
            elif self.field[self.pos] in self.phraseends:
                break
            else:
                plist.append(self.getatom(self.phraseends))

        return plist

class AddressList(AddrlistClass):
    """An AddressList encapsulates a list of parsed RFC 2822 addresses."""
    def __init__(self, field):
        AddrlistClass.__init__(self, field)
        if field:
            self.addresslist = self.getaddrlist()
        else:
            self.addresslist = []

    def __len__(self):
        return len(self.addresslist)

    def __add__(self, other):
        # Set union
        newaddr = AddressList(None)
        newaddr.addresslist = self.addresslist[:]
        for x in other.addresslist:
            if not x in self.addresslist:
                newaddr.addresslist.append(x)
        return newaddr

    def __iadd__(self, other):
        # Set union, in-place
        for x in other.addresslist:
            if not x in self.addresslist:
                self.addresslist.append(x)
        return self

    def __sub__(self, other):
        # Set difference
        newaddr = AddressList(None)
        for x in self.addresslist:
            if not x in other.addresslist:
                newaddr.addresslist.append(x)
        return newaddr

    def __isub__(self, other):
        # Set difference, in-place
        for x in other.addresslist:
            if x in self.addresslist:
                self.addresslist.remove(x)
        return self

    def __getitem__(self, index):
        # Make indexing, slices, and 'in' work
        return self.addresslist[index]
email/charset.py000064400000041350151153537650007654 0ustar00# Copyright (C) 2001-2007 Python Software Foundation
# Author: Ben Gertzfield, Barry Warsaw
# Contact: email-sig@python.org

__all__ = [
    'Charset',
    'add_alias',
    'add_charset',
    'add_codec',
    ]

from functools import partial

import email.base64mime
import email.quoprimime

from email import errors
from email.encoders import encode_7or8bit



# Flags for types of header encodings
QP          = 1 # Quoted-Printable
BASE64      = 2 # Base64
SHORTEST    = 3 # the shorter of QP and base64, but only for headers

# In "=?charset?q?hello_world?=", the =?, ?q?, and ?= add up to 7
RFC2047_CHROME_LEN = 7

DEFAULT_CHARSET = 'us-ascii'
UNKNOWN8BIT = 'unknown-8bit'
EMPTYSTRING = ''



# Defaults
CHARSETS = {
    # input        header enc  body enc output conv
    'iso-8859-1':  (QP,        QP,      None),
    'iso-8859-2':  (QP,        QP,      None),
    'iso-8859-3':  (QP,        QP,      None),
    'iso-8859-4':  (QP,        QP,      None),
    # iso-8859-5 is Cyrillic, and not especially used
    # iso-8859-6 is Arabic, also not particularly used
    # iso-8859-7 is Greek, QP will not make it readable
    # iso-8859-8 is Hebrew, QP will not make it readable
    'iso-8859-9':  (QP,        QP,      None),
    'iso-8859-10': (QP,        QP,      None),
    # iso-8859-11 is Thai, QP will not make it readable
    'iso-8859-13': (QP,        QP,      None),
    'iso-8859-14': (QP,        QP,      None),
    'iso-8859-15': (QP,        QP,      None),
    'iso-8859-16': (QP,        QP,      None),
    'windows-1252':(QP,        QP,      None),
    'viscii':      (QP,        QP,      None),
    'us-ascii':    (None,      None,    None),
    'big5':        (BASE64,    BASE64,  None),
    'gb2312':      (BASE64,    BASE64,  None),
    'euc-jp':      (BASE64,    None,    'iso-2022-jp'),
    'shift_jis':   (BASE64,    None,    'iso-2022-jp'),
    'iso-2022-jp': (BASE64,    None,    None),
    'koi8-r':      (BASE64,    BASE64,  None),
    'utf-8':       (SHORTEST,  BASE64, 'utf-8'),
    }

# Aliases for other commonly-used names for character sets.  Map
# them to the real ones used in email.
ALIASES = {
    'latin_1': 'iso-8859-1',
    'latin-1': 'iso-8859-1',
    'latin_2': 'iso-8859-2',
    'latin-2': 'iso-8859-2',
    'latin_3': 'iso-8859-3',
    'latin-3': 'iso-8859-3',
    'latin_4': 'iso-8859-4',
    'latin-4': 'iso-8859-4',
    'latin_5': 'iso-8859-9',
    'latin-5': 'iso-8859-9',
    'latin_6': 'iso-8859-10',
    'latin-6': 'iso-8859-10',
    'latin_7': 'iso-8859-13',
    'latin-7': 'iso-8859-13',
    'latin_8': 'iso-8859-14',
    'latin-8': 'iso-8859-14',
    'latin_9': 'iso-8859-15',
    'latin-9': 'iso-8859-15',
    'latin_10':'iso-8859-16',
    'latin-10':'iso-8859-16',
    'cp949':   'ks_c_5601-1987',
    'euc_jp':  'euc-jp',
    'euc_kr':  'euc-kr',
    'ascii':   'us-ascii',
    }


# Map charsets to their Unicode codec strings.
CODEC_MAP = {
    'gb2312':      'eucgb2312_cn',
    'big5':        'big5_tw',
    # Hack: We don't want *any* conversion for stuff marked us-ascii, as all
    # sorts of garbage might be sent to us in the guise of 7-bit us-ascii.
    # Let that stuff pass through without conversion to/from Unicode.
    'us-ascii':    None,
    }



# Convenience functions for extending the above mappings
def add_charset(charset, header_enc=None, body_enc=None, output_charset=None):
    """Add character set properties to the global registry.

    charset is the input character set, and must be the canonical name of a
    character set.

    Optional header_enc and body_enc is either Charset.QP for
    quoted-printable, Charset.BASE64 for base64 encoding, Charset.SHORTEST for
    the shortest of qp or base64 encoding, or None for no encoding.  SHORTEST
    is only valid for header_enc.  It describes how message headers and
    message bodies in the input charset are to be encoded.  Default is no
    encoding.

    Optional output_charset is the character set that the output should be
    in.  Conversions will proceed from input charset, to Unicode, to the
    output charset when the method Charset.convert() is called.  The default
    is to output in the same character set as the input.

    Both input_charset and output_charset must have Unicode codec entries in
    the module's charset-to-codec mapping; use add_codec(charset, codecname)
    to add codecs the module does not know about.  See the codecs module's
    documentation for more information.
    """
    if body_enc == SHORTEST:
        raise ValueError('SHORTEST not allowed for body_enc')
    CHARSETS[charset] = (header_enc, body_enc, output_charset)


def add_alias(alias, canonical):
    """Add a character set alias.

    alias is the alias name, e.g. latin-1
    canonical is the character set's canonical name, e.g. iso-8859-1
    """
    ALIASES[alias] = canonical


def add_codec(charset, codecname):
    """Add a codec that map characters in the given charset to/from Unicode.

    charset is the canonical name of a character set.  codecname is the name
    of a Python codec, as appropriate for the second argument to the unicode()
    built-in, or to the encode() method of a Unicode string.
    """
    CODEC_MAP[charset] = codecname



# Convenience function for encoding strings, taking into account
# that they might be unknown-8bit (ie: have surrogate-escaped bytes)
def _encode(string, codec):
    if codec == UNKNOWN8BIT:
        return string.encode('ascii', 'surrogateescape')
    else:
        return string.encode(codec)



class Charset:
    """Map character sets to their email properties.

    This class provides information about the requirements imposed on email
    for a specific character set.  It also provides convenience routines for
    converting between character sets, given the availability of the
    applicable codecs.  Given a character set, it will do its best to provide
    information on how to use that character set in an email in an
    RFC-compliant way.

    Certain character sets must be encoded with quoted-printable or base64
    when used in email headers or bodies.  Certain character sets must be
    converted outright, and are not allowed in email.  Instances of this
    module expose the following information about a character set:

    input_charset: The initial character set specified.  Common aliases
                   are converted to their `official' email names (e.g. latin_1
                   is converted to iso-8859-1).  Defaults to 7-bit us-ascii.

    header_encoding: If the character set must be encoded before it can be
                     used in an email header, this attribute will be set to
                     Charset.QP (for quoted-printable), Charset.BASE64 (for
                     base64 encoding), or Charset.SHORTEST for the shortest of
                     QP or BASE64 encoding.  Otherwise, it will be None.

    body_encoding: Same as header_encoding, but describes the encoding for the
                   mail message's body, which indeed may be different than the
                   header encoding.  Charset.SHORTEST is not allowed for
                   body_encoding.

    output_charset: Some character sets must be converted before they can be
                    used in email headers or bodies.  If the input_charset is
                    one of them, this attribute will contain the name of the
                    charset output will be converted to.  Otherwise, it will
                    be None.

    input_codec: The name of the Python codec used to convert the
                 input_charset to Unicode.  If no conversion codec is
                 necessary, this attribute will be None.

    output_codec: The name of the Python codec used to convert Unicode
                  to the output_charset.  If no conversion codec is necessary,
                  this attribute will have the same value as the input_codec.
    """
    def __init__(self, input_charset=DEFAULT_CHARSET):
        # RFC 2046, $4.1.2 says charsets are not case sensitive.  We coerce to
        # unicode because its .lower() is locale insensitive.  If the argument
        # is already a unicode, we leave it at that, but ensure that the
        # charset is ASCII, as the standard (RFC XXX) requires.
        try:
            if isinstance(input_charset, str):
                input_charset.encode('ascii')
            else:
                input_charset = str(input_charset, 'ascii')
        except UnicodeError:
            raise errors.CharsetError(input_charset)
        input_charset = input_charset.lower()
        # Set the input charset after filtering through the aliases
        self.input_charset = ALIASES.get(input_charset, input_charset)
        # We can try to guess which encoding and conversion to use by the
        # charset_map dictionary.  Try that first, but let the user override
        # it.
        henc, benc, conv = CHARSETS.get(self.input_charset,
                                        (SHORTEST, BASE64, None))
        if not conv:
            conv = self.input_charset
        # Set the attributes, allowing the arguments to override the default.
        self.header_encoding = henc
        self.body_encoding = benc
        self.output_charset = ALIASES.get(conv, conv)
        # Now set the codecs.  If one isn't defined for input_charset,
        # guess and try a Unicode codec with the same name as input_codec.
        self.input_codec = CODEC_MAP.get(self.input_charset,
                                         self.input_charset)
        self.output_codec = CODEC_MAP.get(self.output_charset,
                                          self.output_charset)

    def __repr__(self):
        return self.input_charset.lower()

    def __eq__(self, other):
        return str(self) == str(other).lower()

    def get_body_encoding(self):
        """Return the content-transfer-encoding used for body encoding.

        This is either the string `quoted-printable' or `base64' depending on
        the encoding used, or it is a function in which case you should call
        the function with a single argument, the Message object being
        encoded.  The function should then set the Content-Transfer-Encoding
        header itself to whatever is appropriate.

        Returns "quoted-printable" if self.body_encoding is QP.
        Returns "base64" if self.body_encoding is BASE64.
        Returns conversion function otherwise.
        """
        assert self.body_encoding != SHORTEST
        if self.body_encoding == QP:
            return 'quoted-printable'
        elif self.body_encoding == BASE64:
            return 'base64'
        else:
            return encode_7or8bit

    def get_output_charset(self):
        """Return the output character set.

        This is self.output_charset if that is not None, otherwise it is
        self.input_charset.
        """
        return self.output_charset or self.input_charset

    def header_encode(self, string):
        """Header-encode a string by converting it first to bytes.

        The type of encoding (base64 or quoted-printable) will be based on
        this charset's `header_encoding`.

        :param string: A unicode string for the header.  It must be possible
            to encode this string to bytes using the character set's
            output codec.
        :return: The encoded string, with RFC 2047 chrome.
        """
        codec = self.output_codec or 'us-ascii'
        header_bytes = _encode(string, codec)
        # 7bit/8bit encodings return the string unchanged (modulo conversions)
        encoder_module = self._get_encoder(header_bytes)
        if encoder_module is None:
            return string
        return encoder_module.header_encode(header_bytes, codec)

    def header_encode_lines(self, string, maxlengths):
        """Header-encode a string by converting it first to bytes.

        This is similar to `header_encode()` except that the string is fit
        into maximum line lengths as given by the argument.

        :param string: A unicode string for the header.  It must be possible
            to encode this string to bytes using the character set's
            output codec.
        :param maxlengths: Maximum line length iterator.  Each element
            returned from this iterator will provide the next maximum line
            length.  This parameter is used as an argument to built-in next()
            and should never be exhausted.  The maximum line lengths should
            not count the RFC 2047 chrome.  These line lengths are only a
            hint; the splitter does the best it can.
        :return: Lines of encoded strings, each with RFC 2047 chrome.
        """
        # See which encoding we should use.
        codec = self.output_codec or 'us-ascii'
        header_bytes = _encode(string, codec)
        encoder_module = self._get_encoder(header_bytes)
        encoder = partial(encoder_module.header_encode, charset=codec)
        # Calculate the number of characters that the RFC 2047 chrome will
        # contribute to each line.
        charset = self.get_output_charset()
        extra = len(charset) + RFC2047_CHROME_LEN
        # Now comes the hard part.  We must encode bytes but we can't split on
        # bytes because some character sets are variable length and each
        # encoded word must stand on its own.  So the problem is you have to
        # encode to bytes to figure out this word's length, but you must split
        # on characters.  This causes two problems: first, we don't know how
        # many octets a specific substring of unicode characters will get
        # encoded to, and second, we don't know how many ASCII characters
        # those octets will get encoded to.  Unless we try it.  Which seems
        # inefficient.  In the interest of being correct rather than fast (and
        # in the hope that there will be few encoded headers in any such
        # message), brute force it. :(
        lines = []
        current_line = []
        maxlen = next(maxlengths) - extra
        for character in string:
            current_line.append(character)
            this_line = EMPTYSTRING.join(current_line)
            length = encoder_module.header_length(_encode(this_line, charset))
            if length > maxlen:
                # This last character doesn't fit so pop it off.
                current_line.pop()
                # Does nothing fit on the first line?
                if not lines and not current_line:
                    lines.append(None)
                else:
                    separator = (' ' if lines else '')
                    joined_line = EMPTYSTRING.join(current_line)
                    header_bytes = _encode(joined_line, codec)
                    lines.append(encoder(header_bytes))
                current_line = [character]
                maxlen = next(maxlengths) - extra
        joined_line = EMPTYSTRING.join(current_line)
        header_bytes = _encode(joined_line, codec)
        lines.append(encoder(header_bytes))
        return lines

    def _get_encoder(self, header_bytes):
        if self.header_encoding == BASE64:
            return email.base64mime
        elif self.header_encoding == QP:
            return email.quoprimime
        elif self.header_encoding == SHORTEST:
            len64 = email.base64mime.header_length(header_bytes)
            lenqp = email.quoprimime.header_length(header_bytes)
            if len64 < lenqp:
                return email.base64mime
            else:
                return email.quoprimime
        else:
            return None

    def body_encode(self, string):
        """Body-encode a string by converting it first to bytes.

        The type of encoding (base64 or quoted-printable) will be based on
        self.body_encoding.  If body_encoding is None, we assume the
        output charset is a 7bit encoding, so re-encoding the decoded
        string using the ascii codec produces the correct string version
        of the content.
        """
        if not string:
            return string
        if self.body_encoding is BASE64:
            if isinstance(string, str):
                string = string.encode(self.output_charset)
            return email.base64mime.body_encode(string)
        elif self.body_encoding is QP:
            # quopromime.body_encode takes a string, but operates on it as if
            # it were a list of byte codes.  For a (minimal) history on why
            # this is so, see changeset 0cf700464177.  To correctly encode a
            # character set, then, we must turn it into pseudo bytes via the
            # latin1 charset, which will encode any byte as a single code point
            # between 0 and 255, which is what body_encode is expecting.
            if isinstance(string, str):
                string = string.encode(self.output_charset)
            string = string.decode('latin1')
            return email.quoprimime.body_encode(string)
        else:
            if isinstance(string, str):
                string = string.encode(self.output_charset).decode('ascii')
            return string
datetime.py000064400000254337151153537650006743 0ustar00"""Concrete date/time and related types.

See http://www.iana.org/time-zones/repository/tz-link.html for
time zone and DST data sources.
"""

import time as _time
import math as _math
import sys

def _cmp(x, y):
    return 0 if x == y else 1 if x > y else -1

MINYEAR = 1
MAXYEAR = 9999
_MAXORDINAL = 3652059  # date.max.toordinal()

# Utility functions, adapted from Python's Demo/classes/Dates.py, which
# also assumes the current Gregorian calendar indefinitely extended in
# both directions.  Difference:  Dates.py calls January 1 of year 0 day
# number 1.  The code here calls January 1 of year 1 day number 1.  This is
# to match the definition of the "proleptic Gregorian" calendar in Dershowitz
# and Reingold's "Calendrical Calculations", where it's the base calendar
# for all computations.  See the book for algorithms for converting between
# proleptic Gregorian ordinals and many other calendar systems.

# -1 is a placeholder for indexing purposes.
_DAYS_IN_MONTH = [-1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]

_DAYS_BEFORE_MONTH = [-1]  # -1 is a placeholder for indexing purposes.
dbm = 0
for dim in _DAYS_IN_MONTH[1:]:
    _DAYS_BEFORE_MONTH.append(dbm)
    dbm += dim
del dbm, dim

def _is_leap(year):
    "year -> 1 if leap year, else 0."
    return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)

def _days_before_year(year):
    "year -> number of days before January 1st of year."
    y = year - 1
    return y*365 + y//4 - y//100 + y//400

def _days_in_month(year, month):
    "year, month -> number of days in that month in that year."
    assert 1 <= month <= 12, month
    if month == 2 and _is_leap(year):
        return 29
    return _DAYS_IN_MONTH[month]

def _days_before_month(year, month):
    "year, month -> number of days in year preceding first day of month."
    assert 1 <= month <= 12, 'month must be in 1..12'
    return _DAYS_BEFORE_MONTH[month] + (month > 2 and _is_leap(year))

def _ymd2ord(year, month, day):
    "year, month, day -> ordinal, considering 01-Jan-0001 as day 1."
    assert 1 <= month <= 12, 'month must be in 1..12'
    dim = _days_in_month(year, month)
    assert 1 <= day <= dim, ('day must be in 1..%d' % dim)
    return (_days_before_year(year) +
            _days_before_month(year, month) +
            day)

_DI400Y = _days_before_year(401)    # number of days in 400 years
_DI100Y = _days_before_year(101)    #    "    "   "   " 100   "
_DI4Y   = _days_before_year(5)      #    "    "   "   "   4   "

# A 4-year cycle has an extra leap day over what we'd get from pasting
# together 4 single years.
assert _DI4Y == 4 * 365 + 1

# Similarly, a 400-year cycle has an extra leap day over what we'd get from
# pasting together 4 100-year cycles.
assert _DI400Y == 4 * _DI100Y + 1

# OTOH, a 100-year cycle has one fewer leap day than we'd get from
# pasting together 25 4-year cycles.
assert _DI100Y == 25 * _DI4Y - 1

def _ord2ymd(n):
    "ordinal -> (year, month, day), considering 01-Jan-0001 as day 1."

    # n is a 1-based index, starting at 1-Jan-1.  The pattern of leap years
    # repeats exactly every 400 years.  The basic strategy is to find the
    # closest 400-year boundary at or before n, then work with the offset
    # from that boundary to n.  Life is much clearer if we subtract 1 from
    # n first -- then the values of n at 400-year boundaries are exactly
    # those divisible by _DI400Y:
    #
    #     D  M   Y            n              n-1
    #     -- --- ----        ----------     ----------------
    #     31 Dec -400        -_DI400Y       -_DI400Y -1
    #      1 Jan -399         -_DI400Y +1   -_DI400Y      400-year boundary
    #     ...
    #     30 Dec  000        -1             -2
    #     31 Dec  000         0             -1
    #      1 Jan  001         1              0            400-year boundary
    #      2 Jan  001         2              1
    #      3 Jan  001         3              2
    #     ...
    #     31 Dec  400         _DI400Y        _DI400Y -1
    #      1 Jan  401         _DI400Y +1     _DI400Y      400-year boundary
    n -= 1
    n400, n = divmod(n, _DI400Y)
    year = n400 * 400 + 1   # ..., -399, 1, 401, ...

    # Now n is the (non-negative) offset, in days, from January 1 of year, to
    # the desired date.  Now compute how many 100-year cycles precede n.
    # Note that it's possible for n100 to equal 4!  In that case 4 full
    # 100-year cycles precede the desired day, which implies the desired
    # day is December 31 at the end of a 400-year cycle.
    n100, n = divmod(n, _DI100Y)

    # Now compute how many 4-year cycles precede it.
    n4, n = divmod(n, _DI4Y)

    # And now how many single years.  Again n1 can be 4, and again meaning
    # that the desired day is December 31 at the end of the 4-year cycle.
    n1, n = divmod(n, 365)

    year += n100 * 100 + n4 * 4 + n1
    if n1 == 4 or n100 == 4:
        assert n == 0
        return year-1, 12, 31

    # Now the year is correct, and n is the offset from January 1.  We find
    # the month via an estimate that's either exact or one too large.
    leapyear = n1 == 3 and (n4 != 24 or n100 == 3)
    assert leapyear == _is_leap(year)
    month = (n + 50) >> 5
    preceding = _DAYS_BEFORE_MONTH[month] + (month > 2 and leapyear)
    if preceding > n:  # estimate is too large
        month -= 1
        preceding -= _DAYS_IN_MONTH[month] + (month == 2 and leapyear)
    n -= preceding
    assert 0 <= n < _days_in_month(year, month)

    # Now the year and month are correct, and n is the offset from the
    # start of that month:  we're done!
    return year, month, n+1

# Month and day names.  For localized versions, see the calendar module.
_MONTHNAMES = [None, "Jan", "Feb", "Mar", "Apr", "May", "Jun",
                     "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
_DAYNAMES = [None, "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]


def _build_struct_time(y, m, d, hh, mm, ss, dstflag):
    wday = (_ymd2ord(y, m, d) + 6) % 7
    dnum = _days_before_month(y, m) + d
    return _time.struct_time((y, m, d, hh, mm, ss, wday, dnum, dstflag))

def _format_time(hh, mm, ss, us, timespec='auto'):
    specs = {
        'hours': '{:02d}',
        'minutes': '{:02d}:{:02d}',
        'seconds': '{:02d}:{:02d}:{:02d}',
        'milliseconds': '{:02d}:{:02d}:{:02d}.{:03d}',
        'microseconds': '{:02d}:{:02d}:{:02d}.{:06d}'
    }

    if timespec == 'auto':
        # Skip trailing microseconds when us==0.
        timespec = 'microseconds' if us else 'seconds'
    elif timespec == 'milliseconds':
        us //= 1000
    try:
        fmt = specs[timespec]
    except KeyError:
        raise ValueError('Unknown timespec value')
    else:
        return fmt.format(hh, mm, ss, us)

def _format_offset(off):
    s = ''
    if off is not None:
        if off.days < 0:
            sign = "-"
            off = -off
        else:
            sign = "+"
        hh, mm = divmod(off, timedelta(hours=1))
        mm, ss = divmod(mm, timedelta(minutes=1))
        s += "%s%02d:%02d" % (sign, hh, mm)
        if ss or ss.microseconds:
            s += ":%02d" % ss.seconds

            if ss.microseconds:
                s += '.%06d' % ss.microseconds
    return s

# Correctly substitute for %z and %Z escapes in strftime formats.
def _wrap_strftime(object, format, timetuple):
    # Don't call utcoffset() or tzname() unless actually needed.
    freplace = None  # the string to use for %f
    zreplace = None  # the string to use for %z
    Zreplace = None  # the string to use for %Z

    # Scan format for %z and %Z escapes, replacing as needed.
    newformat = []
    push = newformat.append
    i, n = 0, len(format)
    while i < n:
        ch = format[i]
        i += 1
        if ch == '%':
            if i < n:
                ch = format[i]
                i += 1
                if ch == 'f':
                    if freplace is None:
                        freplace = '%06d' % getattr(object,
                                                    'microsecond', 0)
                    newformat.append(freplace)
                elif ch == 'z':
                    if zreplace is None:
                        zreplace = ""
                        if hasattr(object, "utcoffset"):
                            offset = object.utcoffset()
                            if offset is not None:
                                sign = '+'
                                if offset.days < 0:
                                    offset = -offset
                                    sign = '-'
                                h, rest = divmod(offset, timedelta(hours=1))
                                m, rest = divmod(rest, timedelta(minutes=1))
                                s = rest.seconds
                                u = offset.microseconds
                                if u:
                                    zreplace = '%c%02d%02d%02d.%06d' % (sign, h, m, s, u)
                                elif s:
                                    zreplace = '%c%02d%02d%02d' % (sign, h, m, s)
                                else:
                                    zreplace = '%c%02d%02d' % (sign, h, m)
                    assert '%' not in zreplace
                    newformat.append(zreplace)
                elif ch == 'Z':
                    if Zreplace is None:
                        Zreplace = ""
                        if hasattr(object, "tzname"):
                            s = object.tzname()
                            if s is not None:
                                # strftime is going to have at this: escape %
                                Zreplace = s.replace('%', '%%')
                    newformat.append(Zreplace)
                else:
                    push('%')
                    push(ch)
            else:
                push('%')
        else:
            push(ch)
    newformat = "".join(newformat)
    return _time.strftime(newformat, timetuple)

# Helpers for parsing the result of isoformat()
def _parse_isoformat_date(dtstr):
    # It is assumed that this function will only be called with a
    # string of length exactly 10, and (though this is not used) ASCII-only
    year = int(dtstr[0:4])
    if dtstr[4] != '-':
        raise ValueError('Invalid date separator: %s' % dtstr[4])

    month = int(dtstr[5:7])

    if dtstr[7] != '-':
        raise ValueError('Invalid date separator')

    day = int(dtstr[8:10])

    return [year, month, day]

def _parse_hh_mm_ss_ff(tstr):
    # Parses things of the form HH[:MM[:SS[.fff[fff]]]]
    len_str = len(tstr)

    time_comps = [0, 0, 0, 0]
    pos = 0
    for comp in range(0, 3):
        if (len_str - pos) < 2:
            raise ValueError('Incomplete time component')

        time_comps[comp] = int(tstr[pos:pos+2])

        pos += 2
        next_char = tstr[pos:pos+1]

        if not next_char or comp >= 2:
            break

        if next_char != ':':
            raise ValueError('Invalid time separator: %c' % next_char)

        pos += 1

    if pos < len_str:
        if tstr[pos] != '.':
            raise ValueError('Invalid microsecond component')
        else:
            pos += 1

            len_remainder = len_str - pos
            if len_remainder not in (3, 6):
                raise ValueError('Invalid microsecond component')

            time_comps[3] = int(tstr[pos:])
            if len_remainder == 3:
                time_comps[3] *= 1000

    return time_comps

def _parse_isoformat_time(tstr):
    # Format supported is HH[:MM[:SS[.fff[fff]]]][+HH:MM[:SS[.ffffff]]]
    len_str = len(tstr)
    if len_str < 2:
        raise ValueError('Isoformat time too short')

    # This is equivalent to re.search('[+-]', tstr), but faster
    tz_pos = (tstr.find('-') + 1 or tstr.find('+') + 1)
    timestr = tstr[:tz_pos-1] if tz_pos > 0 else tstr

    time_comps = _parse_hh_mm_ss_ff(timestr)

    tzi = None
    if tz_pos > 0:
        tzstr = tstr[tz_pos:]

        # Valid time zone strings are:
        # HH:MM               len: 5
        # HH:MM:SS            len: 8
        # HH:MM:SS.ffffff     len: 15

        if len(tzstr) not in (5, 8, 15):
            raise ValueError('Malformed time zone string')

        tz_comps = _parse_hh_mm_ss_ff(tzstr)
        if all(x == 0 for x in tz_comps):
            tzi = timezone.utc
        else:
            tzsign = -1 if tstr[tz_pos - 1] == '-' else 1

            td = timedelta(hours=tz_comps[0], minutes=tz_comps[1],
                           seconds=tz_comps[2], microseconds=tz_comps[3])

            tzi = timezone(tzsign * td)

    time_comps.append(tzi)

    return time_comps


# Just raise TypeError if the arg isn't None or a string.
def _check_tzname(name):
    if name is not None and not isinstance(name, str):
        raise TypeError("tzinfo.tzname() must return None or string, "
                        "not '%s'" % type(name))

# name is the offset-producing method, "utcoffset" or "dst".
# offset is what it returned.
# If offset isn't None or timedelta, raises TypeError.
# If offset is None, returns None.
# Else offset is checked for being in range.
# If it is, its integer value is returned.  Else ValueError is raised.
def _check_utc_offset(name, offset):
    assert name in ("utcoffset", "dst")
    if offset is None:
        return
    if not isinstance(offset, timedelta):
        raise TypeError("tzinfo.%s() must return None "
                        "or timedelta, not '%s'" % (name, type(offset)))
    if not -timedelta(1) < offset < timedelta(1):
        raise ValueError("%s()=%s, must be strictly between "
                         "-timedelta(hours=24) and timedelta(hours=24)" %
                         (name, offset))

def _check_int_field(value):
    if isinstance(value, int):
        return value
    if isinstance(value, float):
        raise TypeError('integer argument expected, got float')
    try:
        value = value.__index__()
    except AttributeError:
        pass
    else:
        if not isinstance(value, int):
            raise TypeError('__index__ returned non-int (type %s)' %
                            type(value).__name__)
        return value
    orig = value
    try:
        value = value.__int__()
    except AttributeError:
        pass
    else:
        if not isinstance(value, int):
            raise TypeError('__int__ returned non-int (type %s)' %
                            type(value).__name__)
        import warnings
        warnings.warn("an integer is required (got type %s)"  %
                      type(orig).__name__,
                      DeprecationWarning,
                      stacklevel=2)
        return value
    raise TypeError('an integer is required (got type %s)' %
                    type(value).__name__)

def _check_date_fields(year, month, day):
    year = _check_int_field(year)
    month = _check_int_field(month)
    day = _check_int_field(day)
    if not MINYEAR <= year <= MAXYEAR:
        raise ValueError('year must be in %d..%d' % (MINYEAR, MAXYEAR), year)
    if not 1 <= month <= 12:
        raise ValueError('month must be in 1..12', month)
    dim = _days_in_month(year, month)
    if not 1 <= day <= dim:
        raise ValueError('day must be in 1..%d' % dim, day)
    return year, month, day

def _check_time_fields(hour, minute, second, microsecond, fold):
    hour = _check_int_field(hour)
    minute = _check_int_field(minute)
    second = _check_int_field(second)
    microsecond = _check_int_field(microsecond)
    if not 0 <= hour <= 23:
        raise ValueError('hour must be in 0..23', hour)
    if not 0 <= minute <= 59:
        raise ValueError('minute must be in 0..59', minute)
    if not 0 <= second <= 59:
        raise ValueError('second must be in 0..59', second)
    if not 0 <= microsecond <= 999999:
        raise ValueError('microsecond must be in 0..999999', microsecond)
    if fold not in (0, 1):
        raise ValueError('fold must be either 0 or 1', fold)
    return hour, minute, second, microsecond, fold

def _check_tzinfo_arg(tz):
    if tz is not None and not isinstance(tz, tzinfo):
        raise TypeError("tzinfo argument must be None or of a tzinfo subclass")

def _cmperror(x, y):
    raise TypeError("can't compare '%s' to '%s'" % (
                    type(x).__name__, type(y).__name__))

def _divide_and_round(a, b):
    """divide a by b and round result to the nearest integer

    When the ratio is exactly half-way between two integers,
    the even integer is returned.
    """
    # Based on the reference implementation for divmod_near
    # in Objects/longobject.c.
    q, r = divmod(a, b)
    # round up if either r / b > 0.5, or r / b == 0.5 and q is odd.
    # The expression r / b > 0.5 is equivalent to 2 * r > b if b is
    # positive, 2 * r < b if b negative.
    r *= 2
    greater_than_half = r > b if b > 0 else r < b
    if greater_than_half or r == b and q % 2 == 1:
        q += 1

    return q


class timedelta:
    """Represent the difference between two datetime objects.

    Supported operators:

    - add, subtract timedelta
    - unary plus, minus, abs
    - compare to timedelta
    - multiply, divide by int

    In addition, datetime supports subtraction of two datetime objects
    returning a timedelta, and addition or subtraction of a datetime
    and a timedelta giving a datetime.

    Representation: (days, seconds, microseconds).  Why?  Because I
    felt like it.
    """
    __slots__ = '_days', '_seconds', '_microseconds', '_hashcode'

    def __new__(cls, days=0, seconds=0, microseconds=0,
                milliseconds=0, minutes=0, hours=0, weeks=0):
        # Doing this efficiently and accurately in C is going to be difficult
        # and error-prone, due to ubiquitous overflow possibilities, and that
        # C double doesn't have enough bits of precision to represent
        # microseconds over 10K years faithfully.  The code here tries to make
        # explicit where go-fast assumptions can be relied on, in order to
        # guide the C implementation; it's way more convoluted than speed-
        # ignoring auto-overflow-to-long idiomatic Python could be.

        # XXX Check that all inputs are ints or floats.

        # Final values, all integer.
        # s and us fit in 32-bit signed ints; d isn't bounded.
        d = s = us = 0

        # Normalize everything to days, seconds, microseconds.
        days += weeks*7
        seconds += minutes*60 + hours*3600
        microseconds += milliseconds*1000

        # Get rid of all fractions, and normalize s and us.
        # Take a deep breath <wink>.
        if isinstance(days, float):
            dayfrac, days = _math.modf(days)
            daysecondsfrac, daysecondswhole = _math.modf(dayfrac * (24.*3600.))
            assert daysecondswhole == int(daysecondswhole)  # can't overflow
            s = int(daysecondswhole)
            assert days == int(days)
            d = int(days)
        else:
            daysecondsfrac = 0.0
            d = days
        assert isinstance(daysecondsfrac, float)
        assert abs(daysecondsfrac) <= 1.0
        assert isinstance(d, int)
        assert abs(s) <= 24 * 3600
        # days isn't referenced again before redefinition

        if isinstance(seconds, float):
            secondsfrac, seconds = _math.modf(seconds)
            assert seconds == int(seconds)
            seconds = int(seconds)
            secondsfrac += daysecondsfrac
            assert abs(secondsfrac) <= 2.0
        else:
            secondsfrac = daysecondsfrac
        # daysecondsfrac isn't referenced again
        assert isinstance(secondsfrac, float)
        assert abs(secondsfrac) <= 2.0

        assert isinstance(seconds, int)
        days, seconds = divmod(seconds, 24*3600)
        d += days
        s += int(seconds)    # can't overflow
        assert isinstance(s, int)
        assert abs(s) <= 2 * 24 * 3600
        # seconds isn't referenced again before redefinition

        usdouble = secondsfrac * 1e6
        assert abs(usdouble) < 2.1e6    # exact value not critical
        # secondsfrac isn't referenced again

        if isinstance(microseconds, float):
            microseconds = round(microseconds + usdouble)
            seconds, microseconds = divmod(microseconds, 1000000)
            days, seconds = divmod(seconds, 24*3600)
            d += days
            s += seconds
        else:
            microseconds = int(microseconds)
            seconds, microseconds = divmod(microseconds, 1000000)
            days, seconds = divmod(seconds, 24*3600)
            d += days
            s += seconds
            microseconds = round(microseconds + usdouble)
        assert isinstance(s, int)
        assert isinstance(microseconds, int)
        assert abs(s) <= 3 * 24 * 3600
        assert abs(microseconds) < 3.1e6

        # Just a little bit of carrying possible for microseconds and seconds.
        seconds, us = divmod(microseconds, 1000000)
        s += seconds
        days, s = divmod(s, 24*3600)
        d += days

        assert isinstance(d, int)
        assert isinstance(s, int) and 0 <= s < 24*3600
        assert isinstance(us, int) and 0 <= us < 1000000

        if abs(d) > 999999999:
            raise OverflowError("timedelta # of days is too large: %d" % d)

        self = object.__new__(cls)
        self._days = d
        self._seconds = s
        self._microseconds = us
        self._hashcode = -1
        return self

    def __repr__(self):
        args = []
        if self._days:
            args.append("days=%d" % self._days)
        if self._seconds:
            args.append("seconds=%d" % self._seconds)
        if self._microseconds:
            args.append("microseconds=%d" % self._microseconds)
        if not args:
            args.append('0')
        return "%s.%s(%s)" % (self.__class__.__module__,
                              self.__class__.__qualname__,
                              ', '.join(args))

    def __str__(self):
        mm, ss = divmod(self._seconds, 60)
        hh, mm = divmod(mm, 60)
        s = "%d:%02d:%02d" % (hh, mm, ss)
        if self._days:
            def plural(n):
                return n, abs(n) != 1 and "s" or ""
            s = ("%d day%s, " % plural(self._days)) + s
        if self._microseconds:
            s = s + ".%06d" % self._microseconds
        return s

    def total_seconds(self):
        """Total seconds in the duration."""
        return ((self.days * 86400 + self.seconds) * 10**6 +
                self.microseconds) / 10**6

    # Read-only field accessors
    @property
    def days(self):
        """days"""
        return self._days

    @property
    def seconds(self):
        """seconds"""
        return self._seconds

    @property
    def microseconds(self):
        """microseconds"""
        return self._microseconds

    def __add__(self, other):
        if isinstance(other, timedelta):
            # for CPython compatibility, we cannot use
            # our __class__ here, but need a real timedelta
            return timedelta(self._days + other._days,
                             self._seconds + other._seconds,
                             self._microseconds + other._microseconds)
        return NotImplemented

    __radd__ = __add__

    def __sub__(self, other):
        if isinstance(other, timedelta):
            # for CPython compatibility, we cannot use
            # our __class__ here, but need a real timedelta
            return timedelta(self._days - other._days,
                             self._seconds - other._seconds,
                             self._microseconds - other._microseconds)
        return NotImplemented

    def __rsub__(self, other):
        if isinstance(other, timedelta):
            return -self + other
        return NotImplemented

    def __neg__(self):
        # for CPython compatibility, we cannot use
        # our __class__ here, but need a real timedelta
        return timedelta(-self._days,
                         -self._seconds,
                         -self._microseconds)

    def __pos__(self):
        return self

    def __abs__(self):
        if self._days < 0:
            return -self
        else:
            return self

    def __mul__(self, other):
        if isinstance(other, int):
            # for CPython compatibility, we cannot use
            # our __class__ here, but need a real timedelta
            return timedelta(self._days * other,
                             self._seconds * other,
                             self._microseconds * other)
        if isinstance(other, float):
            usec = self._to_microseconds()
            a, b = other.as_integer_ratio()
            return timedelta(0, 0, _divide_and_round(usec * a, b))
        return NotImplemented

    __rmul__ = __mul__

    def _to_microseconds(self):
        return ((self._days * (24*3600) + self._seconds) * 1000000 +
                self._microseconds)

    def __floordiv__(self, other):
        if not isinstance(other, (int, timedelta)):
            return NotImplemented
        usec = self._to_microseconds()
        if isinstance(other, timedelta):
            return usec // other._to_microseconds()
        if isinstance(other, int):
            return timedelta(0, 0, usec // other)

    def __truediv__(self, other):
        if not isinstance(other, (int, float, timedelta)):
            return NotImplemented
        usec = self._to_microseconds()
        if isinstance(other, timedelta):
            return usec / other._to_microseconds()
        if isinstance(other, int):
            return timedelta(0, 0, _divide_and_round(usec, other))
        if isinstance(other, float):
            a, b = other.as_integer_ratio()
            return timedelta(0, 0, _divide_and_round(b * usec, a))

    def __mod__(self, other):
        if isinstance(other, timedelta):
            r = self._to_microseconds() % other._to_microseconds()
            return timedelta(0, 0, r)
        return NotImplemented

    def __divmod__(self, other):
        if isinstance(other, timedelta):
            q, r = divmod(self._to_microseconds(),
                          other._to_microseconds())
            return q, timedelta(0, 0, r)
        return NotImplemented

    # Comparisons of timedelta objects with other.

    def __eq__(self, other):
        if isinstance(other, timedelta):
            return self._cmp(other) == 0
        else:
            return NotImplemented

    def __le__(self, other):
        if isinstance(other, timedelta):
            return self._cmp(other) <= 0
        else:
            return NotImplemented

    def __lt__(self, other):
        if isinstance(other, timedelta):
            return self._cmp(other) < 0
        else:
            return NotImplemented

    def __ge__(self, other):
        if isinstance(other, timedelta):
            return self._cmp(other) >= 0
        else:
            return NotImplemented

    def __gt__(self, other):
        if isinstance(other, timedelta):
            return self._cmp(other) > 0
        else:
            return NotImplemented

    def _cmp(self, other):
        assert isinstance(other, timedelta)
        return _cmp(self._getstate(), other._getstate())

    def __hash__(self):
        if self._hashcode == -1:
            self._hashcode = hash(self._getstate())
        return self._hashcode

    def __bool__(self):
        return (self._days != 0 or
                self._seconds != 0 or
                self._microseconds != 0)

    # Pickle support.

    def _getstate(self):
        return (self._days, self._seconds, self._microseconds)

    def __reduce__(self):
        return (self.__class__, self._getstate())

timedelta.min = timedelta(-999999999)
timedelta.max = timedelta(days=999999999, hours=23, minutes=59, seconds=59,
                          microseconds=999999)
timedelta.resolution = timedelta(microseconds=1)

class date:
    """Concrete date type.

    Constructors:

    __new__()
    fromtimestamp()
    today()
    fromordinal()

    Operators:

    __repr__, __str__
    __eq__, __le__, __lt__, __ge__, __gt__, __hash__
    __add__, __radd__, __sub__ (add/radd only with timedelta arg)

    Methods:

    timetuple()
    toordinal()
    weekday()
    isoweekday(), isocalendar(), isoformat()
    ctime()
    strftime()

    Properties (readonly):
    year, month, day
    """
    __slots__ = '_year', '_month', '_day', '_hashcode'

    def __new__(cls, year, month=None, day=None):
        """Constructor.

        Arguments:

        year, month, day (required, base 1)
        """
        if (month is None and
            isinstance(year, (bytes, str)) and len(year) == 4 and
            1 <= ord(year[2:3]) <= 12):
            # Pickle support
            if isinstance(year, str):
                try:
                    year = year.encode('latin1')
                except UnicodeEncodeError:
                    # More informative error message.
                    raise ValueError(
                        "Failed to encode latin1 string when unpickling "
                        "a date object. "
                        "pickle.load(data, encoding='latin1') is assumed.")
            self = object.__new__(cls)
            self.__setstate(year)
            self._hashcode = -1
            return self
        year, month, day = _check_date_fields(year, month, day)
        self = object.__new__(cls)
        self._year = year
        self._month = month
        self._day = day
        self._hashcode = -1
        return self

    # Additional constructors

    @classmethod
    def fromtimestamp(cls, t):
        "Construct a date from a POSIX timestamp (like time.time())."
        y, m, d, hh, mm, ss, weekday, jday, dst = _time.localtime(t)
        return cls(y, m, d)

    @classmethod
    def today(cls):
        "Construct a date from time.time()."
        t = _time.time()
        return cls.fromtimestamp(t)

    @classmethod
    def fromordinal(cls, n):
        """Construct a date from a proleptic Gregorian ordinal.

        January 1 of year 1 is day 1.  Only the year, month and day are
        non-zero in the result.
        """
        y, m, d = _ord2ymd(n)
        return cls(y, m, d)

    @classmethod
    def fromisoformat(cls, date_string):
        """Construct a date from the output of date.isoformat()."""
        if not isinstance(date_string, str):
            raise TypeError('fromisoformat: argument must be str')

        try:
            assert len(date_string) == 10
            return cls(*_parse_isoformat_date(date_string))
        except Exception:
            raise ValueError(f'Invalid isoformat string: {date_string!r}')

    @classmethod
    def fromisocalendar(cls, year, week, day):
        """Construct a date from the ISO year, week number and weekday.

        This is the inverse of the date.isocalendar() function"""
        # Year is bounded this way because 9999-12-31 is (9999, 52, 5)
        if not MINYEAR <= year <= MAXYEAR:
            raise ValueError(f"Year is out of range: {year}")

        if not 0 < week < 53:
            out_of_range = True

            if week == 53:
                # ISO years have 53 weeks in them on years starting with a
                # Thursday and leap years starting on a Wednesday
                first_weekday = _ymd2ord(year, 1, 1) % 7
                if (first_weekday == 4 or (first_weekday == 3 and
                                           _is_leap(year))):
                    out_of_range = False

            if out_of_range:
                raise ValueError(f"Invalid week: {week}")

        if not 0 < day < 8:
            raise ValueError(f"Invalid weekday: {day} (range is [1, 7])")

        # Now compute the offset from (Y, 1, 1) in days:
        day_offset = (week - 1) * 7 + (day - 1)

        # Calculate the ordinal day for monday, week 1
        day_1 = _isoweek1monday(year)
        ord_day = day_1 + day_offset

        return cls(*_ord2ymd(ord_day))

    # Conversions to string

    def __repr__(self):
        """Convert to formal string, for repr().

        >>> dt = datetime(2010, 1, 1)
        >>> repr(dt)
        'datetime.datetime(2010, 1, 1, 0, 0)'

        >>> dt = datetime(2010, 1, 1, tzinfo=timezone.utc)
        >>> repr(dt)
        'datetime.datetime(2010, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)'
        """
        return "%s.%s(%d, %d, %d)" % (self.__class__.__module__,
                                      self.__class__.__qualname__,
                                      self._year,
                                      self._month,
                                      self._day)
    # XXX These shouldn't depend on time.localtime(), because that
    # clips the usable dates to [1970 .. 2038).  At least ctime() is
    # easily done without using strftime() -- that's better too because
    # strftime("%c", ...) is locale specific.


    def ctime(self):
        "Return ctime() style string."
        weekday = self.toordinal() % 7 or 7
        return "%s %s %2d 00:00:00 %04d" % (
            _DAYNAMES[weekday],
            _MONTHNAMES[self._month],
            self._day, self._year)

    def strftime(self, fmt):
        "Format using strftime()."
        return _wrap_strftime(self, fmt, self.timetuple())

    def __format__(self, fmt):
        if not isinstance(fmt, str):
            raise TypeError("must be str, not %s" % type(fmt).__name__)
        if len(fmt) != 0:
            return self.strftime(fmt)
        return str(self)

    def isoformat(self):
        """Return the date formatted according to ISO.

        This is 'YYYY-MM-DD'.

        References:
        - http://www.w3.org/TR/NOTE-datetime
        - http://www.cl.cam.ac.uk/~mgk25/iso-time.html
        """
        return "%04d-%02d-%02d" % (self._year, self._month, self._day)

    __str__ = isoformat

    # Read-only field accessors
    @property
    def year(self):
        """year (1-9999)"""
        return self._year

    @property
    def month(self):
        """month (1-12)"""
        return self._month

    @property
    def day(self):
        """day (1-31)"""
        return self._day

    # Standard conversions, __eq__, __le__, __lt__, __ge__, __gt__,
    # __hash__ (and helpers)

    def timetuple(self):
        "Return local time tuple compatible with time.localtime()."
        return _build_struct_time(self._year, self._month, self._day,
                                  0, 0, 0, -1)

    def toordinal(self):
        """Return proleptic Gregorian ordinal for the year, month and day.

        January 1 of year 1 is day 1.  Only the year, month and day values
        contribute to the result.
        """
        return _ymd2ord(self._year, self._month, self._day)

    def replace(self, year=None, month=None, day=None):
        """Return a new date with new values for the specified fields."""
        if year is None:
            year = self._year
        if month is None:
            month = self._month
        if day is None:
            day = self._day
        return type(self)(year, month, day)

    # Comparisons of date objects with other.

    def __eq__(self, other):
        if isinstance(other, date):
            return self._cmp(other) == 0
        return NotImplemented

    def __le__(self, other):
        if isinstance(other, date):
            return self._cmp(other) <= 0
        return NotImplemented

    def __lt__(self, other):
        if isinstance(other, date):
            return self._cmp(other) < 0
        return NotImplemented

    def __ge__(self, other):
        if isinstance(other, date):
            return self._cmp(other) >= 0
        return NotImplemented

    def __gt__(self, other):
        if isinstance(other, date):
            return self._cmp(other) > 0
        return NotImplemented

    def _cmp(self, other):
        assert isinstance(other, date)
        y, m, d = self._year, self._month, self._day
        y2, m2, d2 = other._year, other._month, other._day
        return _cmp((y, m, d), (y2, m2, d2))

    def __hash__(self):
        "Hash."
        if self._hashcode == -1:
            self._hashcode = hash(self._getstate())
        return self._hashcode

    # Computations

    def __add__(self, other):
        "Add a date to a timedelta."
        if isinstance(other, timedelta):
            o = self.toordinal() + other.days
            if 0 < o <= _MAXORDINAL:
                return type(self).fromordinal(o)
            raise OverflowError("result out of range")
        return NotImplemented

    __radd__ = __add__

    def __sub__(self, other):
        """Subtract two dates, or a date and a timedelta."""
        if isinstance(other, timedelta):
            return self + timedelta(-other.days)
        if isinstance(other, date):
            days1 = self.toordinal()
            days2 = other.toordinal()
            return timedelta(days1 - days2)
        return NotImplemented

    def weekday(self):
        "Return day of the week, where Monday == 0 ... Sunday == 6."
        return (self.toordinal() + 6) % 7

    # Day-of-the-week and week-of-the-year, according to ISO

    def isoweekday(self):
        "Return day of the week, where Monday == 1 ... Sunday == 7."
        # 1-Jan-0001 is a Monday
        return self.toordinal() % 7 or 7

    def isocalendar(self):
        """Return a 3-tuple containing ISO year, week number, and weekday.

        The first ISO week of the year is the (Mon-Sun) week
        containing the year's first Thursday; everything else derives
        from that.

        The first week is 1; Monday is 1 ... Sunday is 7.

        ISO calendar algorithm taken from
        http://www.phys.uu.nl/~vgent/calendar/isocalendar.htm
        (used with permission)
        """
        year = self._year
        week1monday = _isoweek1monday(year)
        today = _ymd2ord(self._year, self._month, self._day)
        # Internally, week and day have origin 0
        week, day = divmod(today - week1monday, 7)
        if week < 0:
            year -= 1
            week1monday = _isoweek1monday(year)
            week, day = divmod(today - week1monday, 7)
        elif week >= 52:
            if today >= _isoweek1monday(year+1):
                year += 1
                week = 0
        return year, week+1, day+1

    # Pickle support.

    def _getstate(self):
        yhi, ylo = divmod(self._year, 256)
        return bytes([yhi, ylo, self._month, self._day]),

    def __setstate(self, string):
        yhi, ylo, self._month, self._day = string
        self._year = yhi * 256 + ylo

    def __reduce__(self):
        return (self.__class__, self._getstate())

_date_class = date  # so functions w/ args named "date" can get at the class

date.min = date(1, 1, 1)
date.max = date(9999, 12, 31)
date.resolution = timedelta(days=1)


class tzinfo:
    """Abstract base class for time zone info classes.

    Subclasses must override the name(), utcoffset() and dst() methods.
    """
    __slots__ = ()

    def tzname(self, dt):
        "datetime -> string name of time zone."
        raise NotImplementedError("tzinfo subclass must override tzname()")

    def utcoffset(self, dt):
        "datetime -> timedelta, positive for east of UTC, negative for west of UTC"
        raise NotImplementedError("tzinfo subclass must override utcoffset()")

    def dst(self, dt):
        """datetime -> DST offset as timedelta, positive for east of UTC.

        Return 0 if DST not in effect.  utcoffset() must include the DST
        offset.
        """
        raise NotImplementedError("tzinfo subclass must override dst()")

    def fromutc(self, dt):
        "datetime in UTC -> datetime in local time."

        if not isinstance(dt, datetime):
            raise TypeError("fromutc() requires a datetime argument")
        if dt.tzinfo is not self:
            raise ValueError("dt.tzinfo is not self")

        dtoff = dt.utcoffset()
        if dtoff is None:
            raise ValueError("fromutc() requires a non-None utcoffset() "
                             "result")

        # See the long comment block at the end of this file for an
        # explanation of this algorithm.
        dtdst = dt.dst()
        if dtdst is None:
            raise ValueError("fromutc() requires a non-None dst() result")
        delta = dtoff - dtdst
        if delta:
            dt += delta
            dtdst = dt.dst()
            if dtdst is None:
                raise ValueError("fromutc(): dt.dst gave inconsistent "
                                 "results; cannot convert")
        return dt + dtdst

    # Pickle support.

    def __reduce__(self):
        getinitargs = getattr(self, "__getinitargs__", None)
        if getinitargs:
            args = getinitargs()
        else:
            args = ()
        getstate = getattr(self, "__getstate__", None)
        if getstate:
            state = getstate()
        else:
            state = getattr(self, "__dict__", None) or None
        if state is None:
            return (self.__class__, args)
        else:
            return (self.__class__, args, state)

_tzinfo_class = tzinfo

class time:
    """Time with time zone.

    Constructors:

    __new__()

    Operators:

    __repr__, __str__
    __eq__, __le__, __lt__, __ge__, __gt__, __hash__

    Methods:

    strftime()
    isoformat()
    utcoffset()
    tzname()
    dst()

    Properties (readonly):
    hour, minute, second, microsecond, tzinfo, fold
    """
    __slots__ = '_hour', '_minute', '_second', '_microsecond', '_tzinfo', '_hashcode', '_fold'

    def __new__(cls, hour=0, minute=0, second=0, microsecond=0, tzinfo=None, *, fold=0):
        """Constructor.

        Arguments:

        hour, minute (required)
        second, microsecond (default to zero)
        tzinfo (default to None)
        fold (keyword only, default to zero)
        """
        if (isinstance(hour, (bytes, str)) and len(hour) == 6 and
            ord(hour[0:1])&0x7F < 24):
            # Pickle support
            if isinstance(hour, str):
                try:
                    hour = hour.encode('latin1')
                except UnicodeEncodeError:
                    # More informative error message.
                    raise ValueError(
                        "Failed to encode latin1 string when unpickling "
                        "a time object. "
                        "pickle.load(data, encoding='latin1') is assumed.")
            self = object.__new__(cls)
            self.__setstate(hour, minute or None)
            self._hashcode = -1
            return self
        hour, minute, second, microsecond, fold = _check_time_fields(
            hour, minute, second, microsecond, fold)
        _check_tzinfo_arg(tzinfo)
        self = object.__new__(cls)
        self._hour = hour
        self._minute = minute
        self._second = second
        self._microsecond = microsecond
        self._tzinfo = tzinfo
        self._hashcode = -1
        self._fold = fold
        return self

    # Read-only field accessors
    @property
    def hour(self):
        """hour (0-23)"""
        return self._hour

    @property
    def minute(self):
        """minute (0-59)"""
        return self._minute

    @property
    def second(self):
        """second (0-59)"""
        return self._second

    @property
    def microsecond(self):
        """microsecond (0-999999)"""
        return self._microsecond

    @property
    def tzinfo(self):
        """timezone info object"""
        return self._tzinfo

    @property
    def fold(self):
        return self._fold

    # Standard conversions, __hash__ (and helpers)

    # Comparisons of time objects with other.

    def __eq__(self, other):
        if isinstance(other, time):
            return self._cmp(other, allow_mixed=True) == 0
        else:
            return NotImplemented

    def __le__(self, other):
        if isinstance(other, time):
            return self._cmp(other) <= 0
        else:
            return NotImplemented

    def __lt__(self, other):
        if isinstance(other, time):
            return self._cmp(other) < 0
        else:
            return NotImplemented

    def __ge__(self, other):
        if isinstance(other, time):
            return self._cmp(other) >= 0
        else:
            return NotImplemented

    def __gt__(self, other):
        if isinstance(other, time):
            return self._cmp(other) > 0
        else:
            return NotImplemented

    def _cmp(self, other, allow_mixed=False):
        assert isinstance(other, time)
        mytz = self._tzinfo
        ottz = other._tzinfo
        myoff = otoff = None

        if mytz is ottz:
            base_compare = True
        else:
            myoff = self.utcoffset()
            otoff = other.utcoffset()
            base_compare = myoff == otoff

        if base_compare:
            return _cmp((self._hour, self._minute, self._second,
                         self._microsecond),
                        (other._hour, other._minute, other._second,
                         other._microsecond))
        if myoff is None or otoff is None:
            if allow_mixed:
                return 2 # arbitrary non-zero value
            else:
                raise TypeError("cannot compare naive and aware times")
        myhhmm = self._hour * 60 + self._minute - myoff//timedelta(minutes=1)
        othhmm = other._hour * 60 + other._minute - otoff//timedelta(minutes=1)
        return _cmp((myhhmm, self._second, self._microsecond),
                    (othhmm, other._second, other._microsecond))

    def __hash__(self):
        """Hash."""
        if self._hashcode == -1:
            if self.fold:
                t = self.replace(fold=0)
            else:
                t = self
            tzoff = t.utcoffset()
            if not tzoff:  # zero or None
                self._hashcode = hash(t._getstate()[0])
            else:
                h, m = divmod(timedelta(hours=self.hour, minutes=self.minute) - tzoff,
                              timedelta(hours=1))
                assert not m % timedelta(minutes=1), "whole minute"
                m //= timedelta(minutes=1)
                if 0 <= h < 24:
                    self._hashcode = hash(time(h, m, self.second, self.microsecond))
                else:
                    self._hashcode = hash((h, m, self.second, self.microsecond))
        return self._hashcode

    # Conversion to string

    def _tzstr(self):
        """Return formatted timezone offset (+xx:xx) or an empty string."""
        off = self.utcoffset()
        return _format_offset(off)

    def __repr__(self):
        """Convert to formal string, for repr()."""
        if self._microsecond != 0:
            s = ", %d, %d" % (self._second, self._microsecond)
        elif self._second != 0:
            s = ", %d" % self._second
        else:
            s = ""
        s= "%s.%s(%d, %d%s)" % (self.__class__.__module__,
                                self.__class__.__qualname__,
                                self._hour, self._minute, s)
        if self._tzinfo is not None:
            assert s[-1:] == ")"
            s = s[:-1] + ", tzinfo=%r" % self._tzinfo + ")"
        if self._fold:
            assert s[-1:] == ")"
            s = s[:-1] + ", fold=1)"
        return s

    def isoformat(self, timespec='auto'):
        """Return the time formatted according to ISO.

        The full format is 'HH:MM:SS.mmmmmm+zz:zz'. By default, the fractional
        part is omitted if self.microsecond == 0.

        The optional argument timespec specifies the number of additional
        terms of the time to include. Valid options are 'auto', 'hours',
        'minutes', 'seconds', 'milliseconds' and 'microseconds'.
        """
        s = _format_time(self._hour, self._minute, self._second,
                          self._microsecond, timespec)
        tz = self._tzstr()
        if tz:
            s += tz
        return s

    __str__ = isoformat

    @classmethod
    def fromisoformat(cls, time_string):
        """Construct a time from the output of isoformat()."""
        if not isinstance(time_string, str):
            raise TypeError('fromisoformat: argument must be str')

        try:
            return cls(*_parse_isoformat_time(time_string))
        except Exception:
            raise ValueError(f'Invalid isoformat string: {time_string!r}')


    def strftime(self, fmt):
        """Format using strftime().  The date part of the timestamp passed
        to underlying strftime should not be used.
        """
        # The year must be >= 1000 else Python's strftime implementation
        # can raise a bogus exception.
        timetuple = (1900, 1, 1,
                     self._hour, self._minute, self._second,
                     0, 1, -1)
        return _wrap_strftime(self, fmt, timetuple)

    def __format__(self, fmt):
        if not isinstance(fmt, str):
            raise TypeError("must be str, not %s" % type(fmt).__name__)
        if len(fmt) != 0:
            return self.strftime(fmt)
        return str(self)

    # Timezone functions

    def utcoffset(self):
        """Return the timezone offset as timedelta, positive east of UTC
         (negative west of UTC)."""
        if self._tzinfo is None:
            return None
        offset = self._tzinfo.utcoffset(None)
        _check_utc_offset("utcoffset", offset)
        return offset

    def tzname(self):
        """Return the timezone name.

        Note that the name is 100% informational -- there's no requirement that
        it mean anything in particular. For example, "GMT", "UTC", "-500",
        "-5:00", "EDT", "US/Eastern", "America/New York" are all valid replies.
        """
        if self._tzinfo is None:
            return None
        name = self._tzinfo.tzname(None)
        _check_tzname(name)
        return name

    def dst(self):
        """Return 0 if DST is not in effect, or the DST offset (as timedelta
        positive eastward) if DST is in effect.

        This is purely informational; the DST offset has already been added to
        the UTC offset returned by utcoffset() if applicable, so there's no
        need to consult dst() unless you're interested in displaying the DST
        info.
        """
        if self._tzinfo is None:
            return None
        offset = self._tzinfo.dst(None)
        _check_utc_offset("dst", offset)
        return offset

    def replace(self, hour=None, minute=None, second=None, microsecond=None,
                tzinfo=True, *, fold=None):
        """Return a new time with new values for the specified fields."""
        if hour is None:
            hour = self.hour
        if minute is None:
            minute = self.minute
        if second is None:
            second = self.second
        if microsecond is None:
            microsecond = self.microsecond
        if tzinfo is True:
            tzinfo = self.tzinfo
        if fold is None:
            fold = self._fold
        return type(self)(hour, minute, second, microsecond, tzinfo, fold=fold)

    # Pickle support.

    def _getstate(self, protocol=3):
        us2, us3 = divmod(self._microsecond, 256)
        us1, us2 = divmod(us2, 256)
        h = self._hour
        if self._fold and protocol > 3:
            h += 128
        basestate = bytes([h, self._minute, self._second,
                           us1, us2, us3])
        if self._tzinfo is None:
            return (basestate,)
        else:
            return (basestate, self._tzinfo)

    def __setstate(self, string, tzinfo):
        if tzinfo is not None and not isinstance(tzinfo, _tzinfo_class):
            raise TypeError("bad tzinfo state arg")
        h, self._minute, self._second, us1, us2, us3 = string
        if h > 127:
            self._fold = 1
            self._hour = h - 128
        else:
            self._fold = 0
            self._hour = h
        self._microsecond = (((us1 << 8) | us2) << 8) | us3
        self._tzinfo = tzinfo

    def __reduce_ex__(self, protocol):
        return (self.__class__, self._getstate(protocol))

    def __reduce__(self):
        return self.__reduce_ex__(2)

_time_class = time  # so functions w/ args named "time" can get at the class

time.min = time(0, 0, 0)
time.max = time(23, 59, 59, 999999)
time.resolution = timedelta(microseconds=1)

class datetime(date):
    """datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]])

    The year, month and day arguments are required. tzinfo may be None, or an
    instance of a tzinfo subclass. The remaining arguments may be ints.
    """
    __slots__ = date.__slots__ + time.__slots__

    def __new__(cls, year, month=None, day=None, hour=0, minute=0, second=0,
                microsecond=0, tzinfo=None, *, fold=0):
        if (isinstance(year, (bytes, str)) and len(year) == 10 and
            1 <= ord(year[2:3])&0x7F <= 12):
            # Pickle support
            if isinstance(year, str):
                try:
                    year = bytes(year, 'latin1')
                except UnicodeEncodeError:
                    # More informative error message.
                    raise ValueError(
                        "Failed to encode latin1 string when unpickling "
                        "a datetime object. "
                        "pickle.load(data, encoding='latin1') is assumed.")
            self = object.__new__(cls)
            self.__setstate(year, month)
            self._hashcode = -1
            return self
        year, month, day = _check_date_fields(year, month, day)
        hour, minute, second, microsecond, fold = _check_time_fields(
            hour, minute, second, microsecond, fold)
        _check_tzinfo_arg(tzinfo)
        self = object.__new__(cls)
        self._year = year
        self._month = month
        self._day = day
        self._hour = hour
        self._minute = minute
        self._second = second
        self._microsecond = microsecond
        self._tzinfo = tzinfo
        self._hashcode = -1
        self._fold = fold
        return self

    # Read-only field accessors
    @property
    def hour(self):
        """hour (0-23)"""
        return self._hour

    @property
    def minute(self):
        """minute (0-59)"""
        return self._minute

    @property
    def second(self):
        """second (0-59)"""
        return self._second

    @property
    def microsecond(self):
        """microsecond (0-999999)"""
        return self._microsecond

    @property
    def tzinfo(self):
        """timezone info object"""
        return self._tzinfo

    @property
    def fold(self):
        return self._fold

    @classmethod
    def _fromtimestamp(cls, t, utc, tz):
        """Construct a datetime from a POSIX timestamp (like time.time()).

        A timezone info object may be passed in as well.
        """
        frac, t = _math.modf(t)
        us = round(frac * 1e6)
        if us >= 1000000:
            t += 1
            us -= 1000000
        elif us < 0:
            t -= 1
            us += 1000000

        converter = _time.gmtime if utc else _time.localtime
        y, m, d, hh, mm, ss, weekday, jday, dst = converter(t)
        ss = min(ss, 59)    # clamp out leap seconds if the platform has them
        result = cls(y, m, d, hh, mm, ss, us, tz)
        if tz is None:
            # As of version 2015f max fold in IANA database is
            # 23 hours at 1969-09-30 13:00:00 in Kwajalein.
            # Let's probe 24 hours in the past to detect a transition:
            max_fold_seconds = 24 * 3600

            # On Windows localtime_s throws an OSError for negative values,
            # thus we can't perform fold detection for values of time less
            # than the max time fold. See comments in _datetimemodule's
            # version of this method for more details.
            if t < max_fold_seconds and sys.platform.startswith("win"):
                return result

            y, m, d, hh, mm, ss = converter(t - max_fold_seconds)[:6]
            probe1 = cls(y, m, d, hh, mm, ss, us, tz)
            trans = result - probe1 - timedelta(0, max_fold_seconds)
            if trans.days < 0:
                y, m, d, hh, mm, ss = converter(t + trans // timedelta(0, 1))[:6]
                probe2 = cls(y, m, d, hh, mm, ss, us, tz)
                if probe2 == result:
                    result._fold = 1
        else:
            result = tz.fromutc(result)
        return result

    @classmethod
    def fromtimestamp(cls, t, tz=None):
        """Construct a datetime from a POSIX timestamp (like time.time()).

        A timezone info object may be passed in as well.
        """
        _check_tzinfo_arg(tz)

        return cls._fromtimestamp(t, tz is not None, tz)

    @classmethod
    def utcfromtimestamp(cls, t):
        """Construct a naive UTC datetime from a POSIX timestamp."""
        return cls._fromtimestamp(t, True, None)

    @classmethod
    def now(cls, tz=None):
        "Construct a datetime from time.time() and optional time zone info."
        t = _time.time()
        return cls.fromtimestamp(t, tz)

    @classmethod
    def utcnow(cls):
        "Construct a UTC datetime from time.time()."
        t = _time.time()
        return cls.utcfromtimestamp(t)

    @classmethod
    def combine(cls, date, time, tzinfo=True):
        "Construct a datetime from a given date and a given time."
        if not isinstance(date, _date_class):
            raise TypeError("date argument must be a date instance")
        if not isinstance(time, _time_class):
            raise TypeError("time argument must be a time instance")
        if tzinfo is True:
            tzinfo = time.tzinfo
        return cls(date.year, date.month, date.day,
                   time.hour, time.minute, time.second, time.microsecond,
                   tzinfo, fold=time.fold)

    @classmethod
    def fromisoformat(cls, date_string):
        """Construct a datetime from the output of datetime.isoformat()."""
        if not isinstance(date_string, str):
            raise TypeError('fromisoformat: argument must be str')

        # Split this at the separator
        dstr = date_string[0:10]
        tstr = date_string[11:]

        try:
            date_components = _parse_isoformat_date(dstr)
        except ValueError:
            raise ValueError(f'Invalid isoformat string: {date_string!r}')

        if tstr:
            try:
                time_components = _parse_isoformat_time(tstr)
            except ValueError:
                raise ValueError(f'Invalid isoformat string: {date_string!r}')
        else:
            time_components = [0, 0, 0, 0, None]

        return cls(*(date_components + time_components))

    def timetuple(self):
        "Return local time tuple compatible with time.localtime()."
        dst = self.dst()
        if dst is None:
            dst = -1
        elif dst:
            dst = 1
        else:
            dst = 0
        return _build_struct_time(self.year, self.month, self.day,
                                  self.hour, self.minute, self.second,
                                  dst)

    def _mktime(self):
        """Return integer POSIX timestamp."""
        epoch = datetime(1970, 1, 1)
        max_fold_seconds = 24 * 3600
        t = (self - epoch) // timedelta(0, 1)
        def local(u):
            y, m, d, hh, mm, ss = _time.localtime(u)[:6]
            return (datetime(y, m, d, hh, mm, ss) - epoch) // timedelta(0, 1)

        # Our goal is to solve t = local(u) for u.
        a = local(t) - t
        u1 = t - a
        t1 = local(u1)
        if t1 == t:
            # We found one solution, but it may not be the one we need.
            # Look for an earlier solution (if `fold` is 0), or a
            # later one (if `fold` is 1).
            u2 = u1 + (-max_fold_seconds, max_fold_seconds)[self.fold]
            b = local(u2) - u2
            if a == b:
                return u1
        else:
            b = t1 - u1
            assert a != b
        u2 = t - b
        t2 = local(u2)
        if t2 == t:
            return u2
        if t1 == t:
            return u1
        # We have found both offsets a and b, but neither t - a nor t - b is
        # a solution.  This means t is in the gap.
        return (max, min)[self.fold](u1, u2)


    def timestamp(self):
        "Return POSIX timestamp as float"
        if self._tzinfo is None:
            s = self._mktime()
            return s + self.microsecond / 1e6
        else:
            return (self - _EPOCH).total_seconds()

    def utctimetuple(self):
        "Return UTC time tuple compatible with time.gmtime()."
        offset = self.utcoffset()
        if offset:
            self -= offset
        y, m, d = self.year, self.month, self.day
        hh, mm, ss = self.hour, self.minute, self.second
        return _build_struct_time(y, m, d, hh, mm, ss, 0)

    def date(self):
        "Return the date part."
        return date(self._year, self._month, self._day)

    def time(self):
        "Return the time part, with tzinfo None."
        return time(self.hour, self.minute, self.second, self.microsecond, fold=self.fold)

    def timetz(self):
        "Return the time part, with same tzinfo."
        return time(self.hour, self.minute, self.second, self.microsecond,
                    self._tzinfo, fold=self.fold)

    def replace(self, year=None, month=None, day=None, hour=None,
                minute=None, second=None, microsecond=None, tzinfo=True,
                *, fold=None):
        """Return a new datetime with new values for the specified fields."""
        if year is None:
            year = self.year
        if month is None:
            month = self.month
        if day is None:
            day = self.day
        if hour is None:
            hour = self.hour
        if minute is None:
            minute = self.minute
        if second is None:
            second = self.second
        if microsecond is None:
            microsecond = self.microsecond
        if tzinfo is True:
            tzinfo = self.tzinfo
        if fold is None:
            fold = self.fold
        return type(self)(year, month, day, hour, minute, second,
                          microsecond, tzinfo, fold=fold)

    def _local_timezone(self):
        if self.tzinfo is None:
            ts = self._mktime()
        else:
            ts = (self - _EPOCH) // timedelta(seconds=1)
        localtm = _time.localtime(ts)
        local = datetime(*localtm[:6])
        # Extract TZ data
        gmtoff = localtm.tm_gmtoff
        zone = localtm.tm_zone
        return timezone(timedelta(seconds=gmtoff), zone)

    def astimezone(self, tz=None):
        if tz is None:
            tz = self._local_timezone()
        elif not isinstance(tz, tzinfo):
            raise TypeError("tz argument must be an instance of tzinfo")

        mytz = self.tzinfo
        if mytz is None:
            mytz = self._local_timezone()
            myoffset = mytz.utcoffset(self)
        else:
            myoffset = mytz.utcoffset(self)
            if myoffset is None:
                mytz = self.replace(tzinfo=None)._local_timezone()
                myoffset = mytz.utcoffset(self)

        if tz is mytz:
            return self

        # Convert self to UTC, and attach the new time zone object.
        utc = (self - myoffset).replace(tzinfo=tz)

        # Convert from UTC to tz's local time.
        return tz.fromutc(utc)

    # Ways to produce a string.

    def ctime(self):
        "Return ctime() style string."
        weekday = self.toordinal() % 7 or 7
        return "%s %s %2d %02d:%02d:%02d %04d" % (
            _DAYNAMES[weekday],
            _MONTHNAMES[self._month],
            self._day,
            self._hour, self._minute, self._second,
            self._year)

    def isoformat(self, sep='T', timespec='auto'):
        """Return the time formatted according to ISO.

        The full format looks like 'YYYY-MM-DD HH:MM:SS.mmmmmm'.
        By default, the fractional part is omitted if self.microsecond == 0.

        If self.tzinfo is not None, the UTC offset is also attached, giving
        giving a full format of 'YYYY-MM-DD HH:MM:SS.mmmmmm+HH:MM'.

        Optional argument sep specifies the separator between date and
        time, default 'T'.

        The optional argument timespec specifies the number of additional
        terms of the time to include. Valid options are 'auto', 'hours',
        'minutes', 'seconds', 'milliseconds' and 'microseconds'.
        """
        s = ("%04d-%02d-%02d%c" % (self._year, self._month, self._day, sep) +
             _format_time(self._hour, self._minute, self._second,
                          self._microsecond, timespec))

        off = self.utcoffset()
        tz = _format_offset(off)
        if tz:
            s += tz

        return s

    def __repr__(self):
        """Convert to formal string, for repr()."""
        L = [self._year, self._month, self._day,  # These are never zero
             self._hour, self._minute, self._second, self._microsecond]
        if L[-1] == 0:
            del L[-1]
        if L[-1] == 0:
            del L[-1]
        s = "%s.%s(%s)" % (self.__class__.__module__,
                           self.__class__.__qualname__,
                           ", ".join(map(str, L)))
        if self._tzinfo is not None:
            assert s[-1:] == ")"
            s = s[:-1] + ", tzinfo=%r" % self._tzinfo + ")"
        if self._fold:
            assert s[-1:] == ")"
            s = s[:-1] + ", fold=1)"
        return s

    def __str__(self):
        "Convert to string, for str()."
        return self.isoformat(sep=' ')

    @classmethod
    def strptime(cls, date_string, format):
        'string, format -> new datetime parsed from a string (like time.strptime()).'
        import _strptime
        return _strptime._strptime_datetime(cls, date_string, format)

    def utcoffset(self):
        """Return the timezone offset as timedelta positive east of UTC (negative west of
        UTC)."""
        if self._tzinfo is None:
            return None
        offset = self._tzinfo.utcoffset(self)
        _check_utc_offset("utcoffset", offset)
        return offset

    def tzname(self):
        """Return the timezone name.

        Note that the name is 100% informational -- there's no requirement that
        it mean anything in particular. For example, "GMT", "UTC", "-500",
        "-5:00", "EDT", "US/Eastern", "America/New York" are all valid replies.
        """
        if self._tzinfo is None:
            return None
        name = self._tzinfo.tzname(self)
        _check_tzname(name)
        return name

    def dst(self):
        """Return 0 if DST is not in effect, or the DST offset (as timedelta
        positive eastward) if DST is in effect.

        This is purely informational; the DST offset has already been added to
        the UTC offset returned by utcoffset() if applicable, so there's no
        need to consult dst() unless you're interested in displaying the DST
        info.
        """
        if self._tzinfo is None:
            return None
        offset = self._tzinfo.dst(self)
        _check_utc_offset("dst", offset)
        return offset

    # Comparisons of datetime objects with other.

    def __eq__(self, other):
        if isinstance(other, datetime):
            return self._cmp(other, allow_mixed=True) == 0
        elif not isinstance(other, date):
            return NotImplemented
        else:
            return False

    def __le__(self, other):
        if isinstance(other, datetime):
            return self._cmp(other) <= 0
        elif not isinstance(other, date):
            return NotImplemented
        else:
            _cmperror(self, other)

    def __lt__(self, other):
        if isinstance(other, datetime):
            return self._cmp(other) < 0
        elif not isinstance(other, date):
            return NotImplemented
        else:
            _cmperror(self, other)

    def __ge__(self, other):
        if isinstance(other, datetime):
            return self._cmp(other) >= 0
        elif not isinstance(other, date):
            return NotImplemented
        else:
            _cmperror(self, other)

    def __gt__(self, other):
        if isinstance(other, datetime):
            return self._cmp(other) > 0
        elif not isinstance(other, date):
            return NotImplemented
        else:
            _cmperror(self, other)

    def _cmp(self, other, allow_mixed=False):
        assert isinstance(other, datetime)
        mytz = self._tzinfo
        ottz = other._tzinfo
        myoff = otoff = None

        if mytz is ottz:
            base_compare = True
        else:
            myoff = self.utcoffset()
            otoff = other.utcoffset()
            # Assume that allow_mixed means that we are called from __eq__
            if allow_mixed:
                if myoff != self.replace(fold=not self.fold).utcoffset():
                    return 2
                if otoff != other.replace(fold=not other.fold).utcoffset():
                    return 2
            base_compare = myoff == otoff

        if base_compare:
            return _cmp((self._year, self._month, self._day,
                         self._hour, self._minute, self._second,
                         self._microsecond),
                        (other._year, other._month, other._day,
                         other._hour, other._minute, other._second,
                         other._microsecond))
        if myoff is None or otoff is None:
            if allow_mixed:
                return 2 # arbitrary non-zero value
            else:
                raise TypeError("cannot compare naive and aware datetimes")
        # XXX What follows could be done more efficiently...
        diff = self - other     # this will take offsets into account
        if diff.days < 0:
            return -1
        return diff and 1 or 0

    def __add__(self, other):
        "Add a datetime and a timedelta."
        if not isinstance(other, timedelta):
            return NotImplemented
        delta = timedelta(self.toordinal(),
                          hours=self._hour,
                          minutes=self._minute,
                          seconds=self._second,
                          microseconds=self._microsecond)
        delta += other
        hour, rem = divmod(delta.seconds, 3600)
        minute, second = divmod(rem, 60)
        if 0 < delta.days <= _MAXORDINAL:
            return type(self).combine(date.fromordinal(delta.days),
                                      time(hour, minute, second,
                                           delta.microseconds,
                                           tzinfo=self._tzinfo))
        raise OverflowError("result out of range")

    __radd__ = __add__

    def __sub__(self, other):
        "Subtract two datetimes, or a datetime and a timedelta."
        if not isinstance(other, datetime):
            if isinstance(other, timedelta):
                return self + -other
            return NotImplemented

        days1 = self.toordinal()
        days2 = other.toordinal()
        secs1 = self._second + self._minute * 60 + self._hour * 3600
        secs2 = other._second + other._minute * 60 + other._hour * 3600
        base = timedelta(days1 - days2,
                         secs1 - secs2,
                         self._microsecond - other._microsecond)
        if self._tzinfo is other._tzinfo:
            return base
        myoff = self.utcoffset()
        otoff = other.utcoffset()
        if myoff == otoff:
            return base
        if myoff is None or otoff is None:
            raise TypeError("cannot mix naive and timezone-aware time")
        return base + otoff - myoff

    def __hash__(self):
        if self._hashcode == -1:
            if self.fold:
                t = self.replace(fold=0)
            else:
                t = self
            tzoff = t.utcoffset()
            if tzoff is None:
                self._hashcode = hash(t._getstate()[0])
            else:
                days = _ymd2ord(self.year, self.month, self.day)
                seconds = self.hour * 3600 + self.minute * 60 + self.second
                self._hashcode = hash(timedelta(days, seconds, self.microsecond) - tzoff)
        return self._hashcode

    # Pickle support.

    def _getstate(self, protocol=3):
        yhi, ylo = divmod(self._year, 256)
        us2, us3 = divmod(self._microsecond, 256)
        us1, us2 = divmod(us2, 256)
        m = self._month
        if self._fold and protocol > 3:
            m += 128
        basestate = bytes([yhi, ylo, m, self._day,
                           self._hour, self._minute, self._second,
                           us1, us2, us3])
        if self._tzinfo is None:
            return (basestate,)
        else:
            return (basestate, self._tzinfo)

    def __setstate(self, string, tzinfo):
        if tzinfo is not None and not isinstance(tzinfo, _tzinfo_class):
            raise TypeError("bad tzinfo state arg")
        (yhi, ylo, m, self._day, self._hour,
         self._minute, self._second, us1, us2, us3) = string
        if m > 127:
            self._fold = 1
            self._month = m - 128
        else:
            self._fold = 0
            self._month = m
        self._year = yhi * 256 + ylo
        self._microsecond = (((us1 << 8) | us2) << 8) | us3
        self._tzinfo = tzinfo

    def __reduce_ex__(self, protocol):
        return (self.__class__, self._getstate(protocol))

    def __reduce__(self):
        return self.__reduce_ex__(2)


datetime.min = datetime(1, 1, 1)
datetime.max = datetime(9999, 12, 31, 23, 59, 59, 999999)
datetime.resolution = timedelta(microseconds=1)


def _isoweek1monday(year):
    # Helper to calculate the day number of the Monday starting week 1
    # XXX This could be done more efficiently
    THURSDAY = 3
    firstday = _ymd2ord(year, 1, 1)
    firstweekday = (firstday + 6) % 7  # See weekday() above
    week1monday = firstday - firstweekday
    if firstweekday > THURSDAY:
        week1monday += 7
    return week1monday


class timezone(tzinfo):
    __slots__ = '_offset', '_name'

    # Sentinel value to disallow None
    _Omitted = object()
    def __new__(cls, offset, name=_Omitted):
        if not isinstance(offset, timedelta):
            raise TypeError("offset must be a timedelta")
        if name is cls._Omitted:
            if not offset:
                return cls.utc
            name = None
        elif not isinstance(name, str):
            raise TypeError("name must be a string")
        if not cls._minoffset <= offset <= cls._maxoffset:
            raise ValueError("offset must be a timedelta "
                             "strictly between -timedelta(hours=24) and "
                             "timedelta(hours=24).")
        return cls._create(offset, name)

    @classmethod
    def _create(cls, offset, name=None):
        self = tzinfo.__new__(cls)
        self._offset = offset
        self._name = name
        return self

    def __getinitargs__(self):
        """pickle support"""
        if self._name is None:
            return (self._offset,)
        return (self._offset, self._name)

    def __eq__(self, other):
        if isinstance(other, timezone):
            return self._offset == other._offset
        return NotImplemented

    def __hash__(self):
        return hash(self._offset)

    def __repr__(self):
        """Convert to formal string, for repr().

        >>> tz = timezone.utc
        >>> repr(tz)
        'datetime.timezone.utc'
        >>> tz = timezone(timedelta(hours=-5), 'EST')
        >>> repr(tz)
        "datetime.timezone(datetime.timedelta(-1, 68400), 'EST')"
        """
        if self is self.utc:
            return 'datetime.timezone.utc'
        if self._name is None:
            return "%s.%s(%r)" % (self.__class__.__module__,
                                  self.__class__.__qualname__,
                                  self._offset)
        return "%s.%s(%r, %r)" % (self.__class__.__module__,
                                  self.__class__.__qualname__,
                                  self._offset, self._name)

    def __str__(self):
        return self.tzname(None)

    def utcoffset(self, dt):
        if isinstance(dt, datetime) or dt is None:
            return self._offset
        raise TypeError("utcoffset() argument must be a datetime instance"
                        " or None")

    def tzname(self, dt):
        if isinstance(dt, datetime) or dt is None:
            if self._name is None:
                return self._name_from_offset(self._offset)
            return self._name
        raise TypeError("tzname() argument must be a datetime instance"
                        " or None")

    def dst(self, dt):
        if isinstance(dt, datetime) or dt is None:
            return None
        raise TypeError("dst() argument must be a datetime instance"
                        " or None")

    def fromutc(self, dt):
        if isinstance(dt, datetime):
            if dt.tzinfo is not self:
                raise ValueError("fromutc: dt.tzinfo "
                                 "is not self")
            return dt + self._offset
        raise TypeError("fromutc() argument must be a datetime instance"
                        " or None")

    _maxoffset = timedelta(hours=24, microseconds=-1)
    _minoffset = -_maxoffset

    @staticmethod
    def _name_from_offset(delta):
        if not delta:
            return 'UTC'
        if delta < timedelta(0):
            sign = '-'
            delta = -delta
        else:
            sign = '+'
        hours, rest = divmod(delta, timedelta(hours=1))
        minutes, rest = divmod(rest, timedelta(minutes=1))
        seconds = rest.seconds
        microseconds = rest.microseconds
        if microseconds:
            return (f'UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}'
                    f'.{microseconds:06d}')
        if seconds:
            return f'UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}'
        return f'UTC{sign}{hours:02d}:{minutes:02d}'

timezone.utc = timezone._create(timedelta(0))
# bpo-37642: These attributes are rounded to the nearest minute for backwards
# compatibility, even though the constructor will accept a wider range of
# values. This may change in the future.
timezone.min = timezone._create(-timedelta(hours=23, minutes=59))
timezone.max = timezone._create(timedelta(hours=23, minutes=59))
_EPOCH = datetime(1970, 1, 1, tzinfo=timezone.utc)

# Some time zone algebra.  For a datetime x, let
#     x.n = x stripped of its timezone -- its naive time.
#     x.o = x.utcoffset(), and assuming that doesn't raise an exception or
#           return None
#     x.d = x.dst(), and assuming that doesn't raise an exception or
#           return None
#     x.s = x's standard offset, x.o - x.d
#
# Now some derived rules, where k is a duration (timedelta).
#
# 1. x.o = x.s + x.d
#    This follows from the definition of x.s.
#
# 2. If x and y have the same tzinfo member, x.s = y.s.
#    This is actually a requirement, an assumption we need to make about
#    sane tzinfo classes.
#
# 3. The naive UTC time corresponding to x is x.n - x.o.
#    This is again a requirement for a sane tzinfo class.
#
# 4. (x+k).s = x.s
#    This follows from #2, and that datetime.timetz+timedelta preserves tzinfo.
#
# 5. (x+k).n = x.n + k
#    Again follows from how arithmetic is defined.
#
# Now we can explain tz.fromutc(x).  Let's assume it's an interesting case
# (meaning that the various tzinfo methods exist, and don't blow up or return
# None when called).
#
# The function wants to return a datetime y with timezone tz, equivalent to x.
# x is already in UTC.
#
# By #3, we want
#
#     y.n - y.o = x.n                             [1]
#
# The algorithm starts by attaching tz to x.n, and calling that y.  So
# x.n = y.n at the start.  Then it wants to add a duration k to y, so that [1]
# becomes true; in effect, we want to solve [2] for k:
#
#    (y+k).n - (y+k).o = x.n                      [2]
#
# By #1, this is the same as
#
#    (y+k).n - ((y+k).s + (y+k).d) = x.n          [3]
#
# By #5, (y+k).n = y.n + k, which equals x.n + k because x.n=y.n at the start.
# Substituting that into [3],
#
#    x.n + k - (y+k).s - (y+k).d = x.n; the x.n terms cancel, leaving
#    k - (y+k).s - (y+k).d = 0; rearranging,
#    k = (y+k).s - (y+k).d; by #4, (y+k).s == y.s, so
#    k = y.s - (y+k).d
#
# On the RHS, (y+k).d can't be computed directly, but y.s can be, and we
# approximate k by ignoring the (y+k).d term at first.  Note that k can't be
# very large, since all offset-returning methods return a duration of magnitude
# less than 24 hours.  For that reason, if y is firmly in std time, (y+k).d must
# be 0, so ignoring it has no consequence then.
#
# In any case, the new value is
#
#     z = y + y.s                                 [4]
#
# It's helpful to step back at look at [4] from a higher level:  it's simply
# mapping from UTC to tz's standard time.
#
# At this point, if
#
#     z.n - z.o = x.n                             [5]
#
# we have an equivalent time, and are almost done.  The insecurity here is
# at the start of daylight time.  Picture US Eastern for concreteness.  The wall
# time jumps from 1:59 to 3:00, and wall hours of the form 2:MM don't make good
# sense then.  The docs ask that an Eastern tzinfo class consider such a time to
# be EDT (because it's "after 2"), which is a redundant spelling of 1:MM EST
# on the day DST starts.  We want to return the 1:MM EST spelling because that's
# the only spelling that makes sense on the local wall clock.
#
# In fact, if [5] holds at this point, we do have the standard-time spelling,
# but that takes a bit of proof.  We first prove a stronger result.  What's the
# difference between the LHS and RHS of [5]?  Let
#
#     diff = x.n - (z.n - z.o)                    [6]
#
# Now
#     z.n =                       by [4]
#     (y + y.s).n =               by #5
#     y.n + y.s =                 since y.n = x.n
#     x.n + y.s =                 since z and y are have the same tzinfo member,
#                                     y.s = z.s by #2
#     x.n + z.s
#
# Plugging that back into [6] gives
#
#     diff =
#     x.n - ((x.n + z.s) - z.o) =     expanding
#     x.n - x.n - z.s + z.o =         cancelling
#     - z.s + z.o =                   by #2
#     z.d
#
# So diff = z.d.
#
# If [5] is true now, diff = 0, so z.d = 0 too, and we have the standard-time
# spelling we wanted in the endcase described above.  We're done.  Contrarily,
# if z.d = 0, then we have a UTC equivalent, and are also done.
#
# If [5] is not true now, diff = z.d != 0, and z.d is the offset we need to
# add to z (in effect, z is in tz's standard time, and we need to shift the
# local clock into tz's daylight time).
#
# Let
#
#     z' = z + z.d = z + diff                     [7]
#
# and we can again ask whether
#
#     z'.n - z'.o = x.n                           [8]
#
# If so, we're done.  If not, the tzinfo class is insane, according to the
# assumptions we've made.  This also requires a bit of proof.  As before, let's
# compute the difference between the LHS and RHS of [8] (and skipping some of
# the justifications for the kinds of substitutions we've done several times
# already):
#
#     diff' = x.n - (z'.n - z'.o) =           replacing z'.n via [7]
#             x.n  - (z.n + diff - z'.o) =    replacing diff via [6]
#             x.n - (z.n + x.n - (z.n - z.o) - z'.o) =
#             x.n - z.n - x.n + z.n - z.o + z'.o =    cancel x.n
#             - z.n + z.n - z.o + z'.o =              cancel z.n
#             - z.o + z'.o =                      #1 twice
#             -z.s - z.d + z'.s + z'.d =          z and z' have same tzinfo
#             z'.d - z.d
#
# So z' is UTC-equivalent to x iff z'.d = z.d at this point.  If they are equal,
# we've found the UTC-equivalent so are done.  In fact, we stop with [7] and
# return z', not bothering to compute z'.d.
#
# How could z.d and z'd differ?  z' = z + z.d [7], so merely moving z' by
# a dst() offset, and starting *from* a time already in DST (we know z.d != 0),
# would have to change the result dst() returns:  we start in DST, and moving
# a little further into it takes us out of DST.
#
# There isn't a sane case where this can happen.  The closest it gets is at
# the end of DST, where there's an hour in UTC with no spelling in a hybrid
# tzinfo class.  In US Eastern, that's 5:MM UTC = 0:MM EST = 1:MM EDT.  During
# that hour, on an Eastern clock 1:MM is taken as being in standard time (6:MM
# UTC) because the docs insist on that, but 0:MM is taken as being in daylight
# time (4:MM UTC).  There is no local time mapping to 5:MM UTC.  The local
# clock jumps from 1:59 back to 1:00 again, and repeats the 1:MM hour in
# standard time.  Since that's what the local clock *does*, we want to map both
# UTC hours 5:MM and 6:MM to 1:MM Eastern.  The result is ambiguous
# in local time, but so it goes -- it's the way the local clock works.
#
# When x = 5:MM UTC is the input to this algorithm, x.o=0, y.o=-5 and y.d=0,
# so z=0:MM.  z.d=60 (minutes) then, so [5] doesn't hold and we keep going.
# z' = z + z.d = 1:MM then, and z'.d=0, and z'.d - z.d = -60 != 0 so [8]
# (correctly) concludes that z' is not UTC-equivalent to x.
#
# Because we know z.d said z was in daylight time (else [5] would have held and
# we would have stopped then), and we know z.d != z'.d (else [8] would have held
# and we have stopped then), and there are only 2 possible values dst() can
# return in Eastern, it follows that z'.d must be 0 (which it is in the example,
# but the reasoning doesn't depend on the example -- it depends on there being
# two possible dst() outcomes, one zero and the other non-zero).  Therefore
# z' must be in standard time, and is the spelling we want in this case.
#
# Note again that z' is not UTC-equivalent as far as the hybrid tzinfo class is
# concerned (because it takes z' as being in standard time rather than the
# daylight time we intend here), but returning it gives the real-life "local
# clock repeats an hour" behavior when mapping the "unspellable" UTC hour into
# tz.
#
# When the input is 6:MM, z=1:MM and z.d=0, and we stop at once, again with
# the 1:MM standard time spelling we want.
#
# So how can this break?  One of the assumptions must be violated.  Two
# possibilities:
#
# 1) [2] effectively says that y.s is invariant across all y belong to a given
#    time zone.  This isn't true if, for political reasons or continental drift,
#    a region decides to change its base offset from UTC.
#
# 2) There may be versions of "double daylight" time where the tail end of
#    the analysis gives up a step too early.  I haven't thought about that
#    enough to say.
#
# In any case, it's clear that the default fromutc() is strong enough to handle
# "almost all" time zones:  so long as the standard offset is invariant, it
# doesn't matter if daylight time transition points change from year to year, or
# if daylight time is skipped in some years; it doesn't matter how large or
# small dst() may get within its bounds; and it doesn't even matter if some
# perverse time zone returns a negative dst()).  So a breaking case must be
# pretty bizarre, and a tzinfo subclass can override fromutc() if it is.

try:
    from _datetime import *
except ImportError:
    pass
else:
    # Clean up unused names
    del (_DAYNAMES, _DAYS_BEFORE_MONTH, _DAYS_IN_MONTH, _DI100Y, _DI400Y,
         _DI4Y, _EPOCH, _MAXORDINAL, _MONTHNAMES, _build_struct_time,
         _check_date_fields, _check_int_field, _check_time_fields,
         _check_tzinfo_arg, _check_tzname, _check_utc_offset, _cmp, _cmperror,
         _date_class, _days_before_month, _days_before_year, _days_in_month,
         _format_time, _format_offset, _is_leap, _isoweek1monday, _math,
         _ord2ymd, _time, _time_class, _tzinfo_class, _wrap_strftime, _ymd2ord,
         _divide_and_round, _parse_isoformat_date, _parse_isoformat_time,
         _parse_hh_mm_ss_ff)
    # XXX Since import * above excludes names that start with _,
    # docstring does not get overwritten. In the future, it may be
    # appropriate to maintain a single module level docstring and
    # remove the following line.
    from _datetime import __doc__